[
  {
    "path": ".clang-format",
    "content": "# http://clang.llvm.org/docs/ClangFormatStyleOptions.html\n# Must be in sync with clangStyle in tools\\clang-fmt.go\nBasedOnStyle: Chromium\nIndentWidth: 4\nColumnLimit: 100\nAccessModifierOffset: -2\nPointerAlignment: Left\nSpacesBeforeTrailingComments: 1\nBinPackParameters: true\n"
  },
  {
    "path": ".gitattributes",
    "content": "# Disable LF normalization for all files\r\n* -text"
  },
  {
    "path": ".gitignore",
    "content": "scripts/cert.pfx\r\nscripts/config.py\r\nscripts/secrets.json\r\nobj-rel/\r\nobj-dbg/\r\nrel/\r\nrel64/\r\ndbg/\r\ndbg64/\r\nrel-mac/\r\ndbg-mac/\r\nbuilds/\r\nmupdf/generated/\r\ngyp/*.sln\r\ngyp/*.vcxproj\r\ngyp/*.vcxproj.filters\r\ngyp/*props\r\ngyp/*targets\r\ngyp/*.xml\r\ngyp/Debug/\r\n*.suo\r\n*.opensdf\r\n*.sdf\r\nvs/obj/\r\n*pyc\r\n*.vcxproj.user\r\nbin/premake5.exe\r\nvs2013/\r\nrel/\r\nrel64/\r\nrelPrefast/\r\nrelPrefast64/\r\ndbg/\r\ndbg64/\r\nbin/cmapdump.exe\r\nbin/pigz.exe\r\ndrmemlogs/\r\nsrc/utils/BuildConfig.h\r\n*.vspx\r\nbuild-log.txt\r\nanalyze-output.txt\r\nanalyze-errors.html\r\n*.cov\r\nCoverageReport*\r\nLastCoverageResults.log\r\n*.db\r\n*.opendb\r\n.vscode/.BROWSE.VC.DB-shm\r\n.vscode/.BROWSE.VC.DB-wal\r\nInstaller.aps\r\n"
  },
  {
    "path": "AUTHORS",
    "content": "﻿SumatraPDF contains code by:\r\n\r\n* Alexander Klenin\r\n* Củ Văn Chuối (mrchuoi at gmail.com)\r\n* David Lopez\r\n* Danilo Roascio\r\n* Jarkko Pöyry\r\n* Krzysztof J. Kowalczyk  (http://blog.kowalczyk.info)\r\n* Ludo Brands\r\n* Matthew Wilcoxson (matthew.wilcoxson at gmail.com)\r\n* Nathan Jhaveri\r\n* Peter Astrand\r\n* Robert Liu\r\n* Robert Prouse (rprouse at gmail.com)\r\n* Simon Bünzli (zeniko at gmail.com, http://www.zeniko.ch/#SumatraPDF)\r\n* Stefan Stefanov (userchefo at gmail.com)\r\n* Tom Clegg\r\n* vadmium at gmail.com\r\n* Vasily Fomin (vasili.fomin at gmail.com)\r\n* Victor Kozyakin\r\n* William Blum (william.blum at gmail.com, http://william.famille-blum.org/)\r\n\r\nMost code under src is licensed as GPL v3 (see COPYING) with the main\r\nexception of code in src/utils and src/mui which has a BSD license\r\n(see COPYING.BSD). Due to mupdf/COPYING, section 13 of the AGPL v3\r\napplies to SumatraPDF as well.\r\n\r\nIcons by Zenon, Sonke Tesch, George Georgiou, Robert Hegner,\r\nFAMFAMFAM and Yusuke Kamiyamane.\r\n\r\nWindows program icon (gfx/SumatraPDF*.png, gfx/SumatraPDF.ico) by\r\nAlex (koo.studios at gmail.com, old address: zenon38 at gmail.com).\r\nLicense: CC BY 3.0 (http://creativecommons.org/licenses/by/3.0/).\r\n\r\nTranslations by various translators (see TRANSLATORS).\r\n\r\nExternal projects are by their various authors:\r\n\r\nProject        License                   Type Website\r\n---------------------------------------------------------------------------------------------------------\r\nMuPDF          mupdf/COPYING             AGPL http://mupdf.com/\r\nbzip2          ext/bzip2/LICENSE              http://bzip.org/\r\nCHMLIB         ext/CHMLib/COPYING        LGPL http://www.jedrea.com/chmlib/\r\nFreeType       ext/freetype2/FTL.txt          http://www.freetype.org/\r\njbig2dec       ext/jbig2dec/COPYING      AGPL http://www.ghostscript.com/jbig2dec.html\r\nlibjpeg-turbo  ext/.../README-turbo.txt  BSD  http://libjpeg-turbo.virtualgl.org/\r\nDjVuLibre      ext/libdjvu/COPYRIGHT     GPL  http://djvu.sourceforge.net/\r\nOpenJPEG       ext/openjpeg/LICENSE      BSD  http://www.openjpeg.org/\r\nSyncTeX        ext/.../synctex_parser.c       http://itexmac.sourceforge.net/SyncTeX.html\r\nzlib           ext/zlib/zlib.h                http://www.zlib.net/\r\nlzma           ext/lzma/lzma.txt              http://www.7-zip.org/sdk.html\r\nlibwebp        ext/libwebp/COPYING       BSD  https://developers.google.com/speed/webp/\r\nunarr          ext/unarr/COPYING         LGPL https://github.com/zeniko/unarr\r\n\r\nCMap Resources mupdf/.../cmaps/README         http://sourceforge.net/adobe/cmap/home/Home/\r\nXySSL          mupdf/.../crypt-aes.c     BSD  http://en.wikipedia.org/wiki/PolarSSL#History\r\nArcfour        mupdf/.../crypt-arc4.c         http://tools.ietf.org/html/draft-kaukonen-cipher-arcfour-01\r\nRSA's MD5      mupdf/.../crypt-md5.c          http://tools.ietf.org/html/rfc1321\r\nAndroid        mupdf/.../droid/NOTICE    APL  http://www.droidfonts.com/\r\nPoppler        mupdf/.../pdf-annot.c     GPL  http://poppler.freedesktop.org/\r\nezgdi          mupdf/.../pdf-ft-tools.c  GPL  http://code.google.com/p/ezgdi/\r\n\r\nFugue Icons    CC BY 3.0                      http://p.yusukekamiyamane.com/\r\n"
  },
  {
    "path": "COPYING",
    "content": "                    GNU GENERAL PUBLIC LICENSE\r\n                       Version 3, 29 June 2007\r\n\r\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\r\n Everyone is permitted to copy and distribute verbatim copies\r\n of this license document, but changing it is not allowed.\r\n\r\n                            Preamble\r\n\r\n  The GNU General Public License is a free, copyleft license for\r\nsoftware and other kinds of works.\r\n\r\n  The licenses for most software and other practical works are designed\r\nto take away your freedom to share and change the works.  By contrast,\r\nthe GNU General Public License is intended to guarantee your freedom to\r\nshare and change all versions of a program--to make sure it remains free\r\nsoftware for all its users.  We, the Free Software Foundation, use the\r\nGNU General Public License for most of our software; it applies also to\r\nany other work released this way by its authors.  You can apply it to\r\nyour programs, too.\r\n\r\n  When we speak of free software, we are referring to freedom, not\r\nprice.  Our General Public Licenses are designed to make sure that you\r\nhave the freedom to distribute copies of free software (and charge for\r\nthem if you wish), that you receive source code or can get it if you\r\nwant it, that you can change the software or use pieces of it in new\r\nfree programs, and that you know you can do these things.\r\n\r\n  To protect your rights, we need to prevent others from denying you\r\nthese rights or asking you to surrender the rights.  Therefore, you have\r\ncertain responsibilities if you distribute copies of the software, or if\r\nyou modify it: responsibilities to respect the freedom of others.\r\n\r\n  For example, if you distribute copies of such a program, whether\r\ngratis or for a fee, you must pass on to the recipients the same\r\nfreedoms that you received.  You must make sure that they, too, receive\r\nor can get the source code.  And you must show them these terms so they\r\nknow their rights.\r\n\r\n  Developers that use the GNU GPL protect your rights with two steps:\r\n(1) assert copyright on the software, and (2) offer you this License\r\ngiving you legal permission to copy, distribute and/or modify it.\r\n\r\n  For the developers' and authors' protection, the GPL clearly explains\r\nthat there is no warranty for this free software.  For both users' and\r\nauthors' sake, the GPL requires that modified versions be marked as\r\nchanged, so that their problems will not be attributed erroneously to\r\nauthors of previous versions.\r\n\r\n  Some devices are designed to deny users access to install or run\r\nmodified versions of the software inside them, although the manufacturer\r\ncan do so.  This is fundamentally incompatible with the aim of\r\nprotecting users' freedom to change the software.  The systematic\r\npattern of such abuse occurs in the area of products for individuals to\r\nuse, which is precisely where it is most unacceptable.  Therefore, we\r\nhave designed this version of the GPL to prohibit the practice for those\r\nproducts.  If such problems arise substantially in other domains, we\r\nstand ready to extend this provision to those domains in future versions\r\nof the GPL, as needed to protect the freedom of users.\r\n\r\n  Finally, every program is threatened constantly by software patents.\r\nStates should not allow patents to restrict development and use of\r\nsoftware on general-purpose computers, but in those that do, we wish to\r\navoid the special danger that patents applied to a free program could\r\nmake it effectively proprietary.  To prevent this, the GPL assures that\r\npatents cannot be used to render the program non-free.\r\n\r\n  The precise terms and conditions for copying, distribution and\r\nmodification follow.\r\n\r\n                       TERMS AND CONDITIONS\r\n\r\n  0. Definitions.\r\n\r\n  \"This License\" refers to version 3 of the GNU General Public License.\r\n\r\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\r\nworks, such as semiconductor masks.\r\n\r\n  \"The Program\" refers to any copyrightable work licensed under this\r\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\r\n\"recipients\" may be individuals or organizations.\r\n\r\n  To \"modify\" a work means to copy from or adapt all or part of the work\r\nin a fashion requiring copyright permission, other than the making of an\r\nexact copy.  The resulting work is called a \"modified version\" of the\r\nearlier work or a work \"based on\" the earlier work.\r\n\r\n  A \"covered work\" means either the unmodified Program or a work based\r\non the Program.\r\n\r\n  To \"propagate\" a work means to do anything with it that, without\r\npermission, would make you directly or secondarily liable for\r\ninfringement under applicable copyright law, except executing it on a\r\ncomputer or modifying a private copy.  Propagation includes copying,\r\ndistribution (with or without modification), making available to the\r\npublic, and in some countries other activities as well.\r\n\r\n  To \"convey\" a work means any kind of propagation that enables other\r\nparties to make or receive copies.  Mere interaction with a user through\r\na computer network, with no transfer of a copy, is not conveying.\r\n\r\n  An interactive user interface displays \"Appropriate Legal Notices\"\r\nto the extent that it includes a convenient and prominently visible\r\nfeature that (1) displays an appropriate copyright notice, and (2)\r\ntells the user that there is no warranty for the work (except to the\r\nextent that warranties are provided), that licensees may convey the\r\nwork under this License, and how to view a copy of this License.  If\r\nthe interface presents a list of user commands or options, such as a\r\nmenu, a prominent item in the list meets this criterion.\r\n\r\n  1. Source Code.\r\n\r\n  The \"source code\" for a work means the preferred form of the work\r\nfor making modifications to it.  \"Object code\" means any non-source\r\nform of a work.\r\n\r\n  A \"Standard Interface\" means an interface that either is an official\r\nstandard defined by a recognized standards body, or, in the case of\r\ninterfaces specified for a particular programming language, one that\r\nis widely used among developers working in that language.\r\n\r\n  The \"System Libraries\" of an executable work include anything, other\r\nthan the work as a whole, that (a) is included in the normal form of\r\npackaging a Major Component, but which is not part of that Major\r\nComponent, and (b) serves only to enable use of the work with that\r\nMajor Component, or to implement a Standard Interface for which an\r\nimplementation is available to the public in source code form.  A\r\n\"Major Component\", in this context, means a major essential component\r\n(kernel, window system, and so on) of the specific operating system\r\n(if any) on which the executable work runs, or a compiler used to\r\nproduce the work, or an object code interpreter used to run it.\r\n\r\n  The \"Corresponding Source\" for a work in object code form means all\r\nthe source code needed to generate, install, and (for an executable\r\nwork) run the object code and to modify the work, including scripts to\r\ncontrol those activities.  However, it does not include the work's\r\nSystem Libraries, or general-purpose tools or generally available free\r\nprograms which are used unmodified in performing those activities but\r\nwhich are not part of the work.  For example, Corresponding Source\r\nincludes interface definition files associated with source files for\r\nthe work, and the source code for shared libraries and dynamically\r\nlinked subprograms that the work is specifically designed to require,\r\nsuch as by intimate data communication or control flow between those\r\nsubprograms and other parts of the work.\r\n\r\n  The Corresponding Source need not include anything that users\r\ncan regenerate automatically from other parts of the Corresponding\r\nSource.\r\n\r\n  The Corresponding Source for a work in source code form is that\r\nsame work.\r\n\r\n  2. Basic Permissions.\r\n\r\n  All rights granted under this License are granted for the term of\r\ncopyright on the Program, and are irrevocable provided the stated\r\nconditions are met.  This License explicitly affirms your unlimited\r\npermission to run the unmodified Program.  The output from running a\r\ncovered work is covered by this License only if the output, given its\r\ncontent, constitutes a covered work.  This License acknowledges your\r\nrights of fair use or other equivalent, as provided by copyright law.\r\n\r\n  You may make, run and propagate covered works that you do not\r\nconvey, without conditions so long as your license otherwise remains\r\nin force.  You may convey covered works to others for the sole purpose\r\nof having them make modifications exclusively for you, or provide you\r\nwith facilities for running those works, provided that you comply with\r\nthe terms of this License in conveying all material for which you do\r\nnot control copyright.  Those thus making or running the covered works\r\nfor you must do so exclusively on your behalf, under your direction\r\nand control, on terms that prohibit them from making any copies of\r\nyour copyrighted material outside their relationship with you.\r\n\r\n  Conveying under any other circumstances is permitted solely under\r\nthe conditions stated below.  Sublicensing is not allowed; section 10\r\nmakes it unnecessary.\r\n\r\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\r\n\r\n  No covered work shall be deemed part of an effective technological\r\nmeasure under any applicable law fulfilling obligations under article\r\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\r\nsimilar laws prohibiting or restricting circumvention of such\r\nmeasures.\r\n\r\n  When you convey a covered work, you waive any legal power to forbid\r\ncircumvention of technological measures to the extent such circumvention\r\nis effected by exercising rights under this License with respect to\r\nthe covered work, and you disclaim any intention to limit operation or\r\nmodification of the work as a means of enforcing, against the work's\r\nusers, your or third parties' legal rights to forbid circumvention of\r\ntechnological measures.\r\n\r\n  4. Conveying Verbatim Copies.\r\n\r\n  You may convey verbatim copies of the Program's source code as you\r\nreceive it, in any medium, provided that you conspicuously and\r\nappropriately publish on each copy an appropriate copyright notice;\r\nkeep intact all notices stating that this License and any\r\nnon-permissive terms added in accord with section 7 apply to the code;\r\nkeep intact all notices of the absence of any warranty; and give all\r\nrecipients a copy of this License along with the Program.\r\n\r\n  You may charge any price or no price for each copy that you convey,\r\nand you may offer support or warranty protection for a fee.\r\n\r\n  5. Conveying Modified Source Versions.\r\n\r\n  You may convey a work based on the Program, or the modifications to\r\nproduce it from the Program, in the form of source code under the\r\nterms of section 4, provided that you also meet all of these conditions:\r\n\r\n    a) The work must carry prominent notices stating that you modified\r\n    it, and giving a relevant date.\r\n\r\n    b) The work must carry prominent notices stating that it is\r\n    released under this License and any conditions added under section\r\n    7.  This requirement modifies the requirement in section 4 to\r\n    \"keep intact all notices\".\r\n\r\n    c) You must license the entire work, as a whole, under this\r\n    License to anyone who comes into possession of a copy.  This\r\n    License will therefore apply, along with any applicable section 7\r\n    additional terms, to the whole of the work, and all its parts,\r\n    regardless of how they are packaged.  This License gives no\r\n    permission to license the work in any other way, but it does not\r\n    invalidate such permission if you have separately received it.\r\n\r\n    d) If the work has interactive user interfaces, each must display\r\n    Appropriate Legal Notices; however, if the Program has interactive\r\n    interfaces that do not display Appropriate Legal Notices, your\r\n    work need not make them do so.\r\n\r\n  A compilation of a covered work with other separate and independent\r\nworks, which are not by their nature extensions of the covered work,\r\nand which are not combined with it such as to form a larger program,\r\nin or on a volume of a storage or distribution medium, is called an\r\n\"aggregate\" if the compilation and its resulting copyright are not\r\nused to limit the access or legal rights of the compilation's users\r\nbeyond what the individual works permit.  Inclusion of a covered work\r\nin an aggregate does not cause this License to apply to the other\r\nparts of the aggregate.\r\n\r\n  6. Conveying Non-Source Forms.\r\n\r\n  You may convey a covered work in object code form under the terms\r\nof sections 4 and 5, provided that you also convey the\r\nmachine-readable Corresponding Source under the terms of this License,\r\nin one of these ways:\r\n\r\n    a) Convey the object code in, or embodied in, a physical product\r\n    (including a physical distribution medium), accompanied by the\r\n    Corresponding Source fixed on a durable physical medium\r\n    customarily used for software interchange.\r\n\r\n    b) Convey the object code in, or embodied in, a physical product\r\n    (including a physical distribution medium), accompanied by a\r\n    written offer, valid for at least three years and valid for as\r\n    long as you offer spare parts or customer support for that product\r\n    model, to give anyone who possesses the object code either (1) a\r\n    copy of the Corresponding Source for all the software in the\r\n    product that is covered by this License, on a durable physical\r\n    medium customarily used for software interchange, for a price no\r\n    more than your reasonable cost of physically performing this\r\n    conveying of source, or (2) access to copy the\r\n    Corresponding Source from a network server at no charge.\r\n\r\n    c) Convey individual copies of the object code with a copy of the\r\n    written offer to provide the Corresponding Source.  This\r\n    alternative is allowed only occasionally and noncommercially, and\r\n    only if you received the object code with such an offer, in accord\r\n    with subsection 6b.\r\n\r\n    d) Convey the object code by offering access from a designated\r\n    place (gratis or for a charge), and offer equivalent access to the\r\n    Corresponding Source in the same way through the same place at no\r\n    further charge.  You need not require recipients to copy the\r\n    Corresponding Source along with the object code.  If the place to\r\n    copy the object code is a network server, the Corresponding Source\r\n    may be on a different server (operated by you or a third party)\r\n    that supports equivalent copying facilities, provided you maintain\r\n    clear directions next to the object code saying where to find the\r\n    Corresponding Source.  Regardless of what server hosts the\r\n    Corresponding Source, you remain obligated to ensure that it is\r\n    available for as long as needed to satisfy these requirements.\r\n\r\n    e) Convey the object code using peer-to-peer transmission, provided\r\n    you inform other peers where the object code and Corresponding\r\n    Source of the work are being offered to the general public at no\r\n    charge under subsection 6d.\r\n\r\n  A separable portion of the object code, whose source code is excluded\r\nfrom the Corresponding Source as a System Library, need not be\r\nincluded in conveying the object code work.\r\n\r\n  A \"User Product\" is either (1) a \"consumer product\", which means any\r\ntangible personal property which is normally used for personal, family,\r\nor household purposes, or (2) anything designed or sold for incorporation\r\ninto a dwelling.  In determining whether a product is a consumer product,\r\ndoubtful cases shall be resolved in favor of coverage.  For a particular\r\nproduct received by a particular user, \"normally used\" refers to a\r\ntypical or common use of that class of product, regardless of the status\r\nof the particular user or of the way in which the particular user\r\nactually uses, or expects or is expected to use, the product.  A product\r\nis a consumer product regardless of whether the product has substantial\r\ncommercial, industrial or non-consumer uses, unless such uses represent\r\nthe only significant mode of use of the product.\r\n\r\n  \"Installation Information\" for a User Product means any methods,\r\nprocedures, authorization keys, or other information required to install\r\nand execute modified versions of a covered work in that User Product from\r\na modified version of its Corresponding Source.  The information must\r\nsuffice to ensure that the continued functioning of the modified object\r\ncode is in no case prevented or interfered with solely because\r\nmodification has been made.\r\n\r\n  If you convey an object code work under this section in, or with, or\r\nspecifically for use in, a User Product, and the conveying occurs as\r\npart of a transaction in which the right of possession and use of the\r\nUser Product is transferred to the recipient in perpetuity or for a\r\nfixed term (regardless of how the transaction is characterized), the\r\nCorresponding Source conveyed under this section must be accompanied\r\nby the Installation Information.  But this requirement does not apply\r\nif neither you nor any third party retains the ability to install\r\nmodified object code on the User Product (for example, the work has\r\nbeen installed in ROM).\r\n\r\n  The requirement to provide Installation Information does not include a\r\nrequirement to continue to provide support service, warranty, or updates\r\nfor a work that has been modified or installed by the recipient, or for\r\nthe User Product in which it has been modified or installed.  Access to a\r\nnetwork may be denied when the modification itself materially and\r\nadversely affects the operation of the network or violates the rules and\r\nprotocols for communication across the network.\r\n\r\n  Corresponding Source conveyed, and Installation Information provided,\r\nin accord with this section must be in a format that is publicly\r\ndocumented (and with an implementation available to the public in\r\nsource code form), and must require no special password or key for\r\nunpacking, reading or copying.\r\n\r\n  7. Additional Terms.\r\n\r\n  \"Additional permissions\" are terms that supplement the terms of this\r\nLicense by making exceptions from one or more of its conditions.\r\nAdditional permissions that are applicable to the entire Program shall\r\nbe treated as though they were included in this License, to the extent\r\nthat they are valid under applicable law.  If additional permissions\r\napply only to part of the Program, that part may be used separately\r\nunder those permissions, but the entire Program remains governed by\r\nthis License without regard to the additional permissions.\r\n\r\n  When you convey a copy of a covered work, you may at your option\r\nremove any additional permissions from that copy, or from any part of\r\nit.  (Additional permissions may be written to require their own\r\nremoval in certain cases when you modify the work.)  You may place\r\nadditional permissions on material, added by you to a covered work,\r\nfor which you have or can give appropriate copyright permission.\r\n\r\n  Notwithstanding any other provision of this License, for material you\r\nadd to a covered work, you may (if authorized by the copyright holders of\r\nthat material) supplement the terms of this License with terms:\r\n\r\n    a) Disclaiming warranty or limiting liability differently from the\r\n    terms of sections 15 and 16 of this License; or\r\n\r\n    b) Requiring preservation of specified reasonable legal notices or\r\n    author attributions in that material or in the Appropriate Legal\r\n    Notices displayed by works containing it; or\r\n\r\n    c) Prohibiting misrepresentation of the origin of that material, or\r\n    requiring that modified versions of such material be marked in\r\n    reasonable ways as different from the original version; or\r\n\r\n    d) Limiting the use for publicity purposes of names of licensors or\r\n    authors of the material; or\r\n\r\n    e) Declining to grant rights under trademark law for use of some\r\n    trade names, trademarks, or service marks; or\r\n\r\n    f) Requiring indemnification of licensors and authors of that\r\n    material by anyone who conveys the material (or modified versions of\r\n    it) with contractual assumptions of liability to the recipient, for\r\n    any liability that these contractual assumptions directly impose on\r\n    those licensors and authors.\r\n\r\n  All other non-permissive additional terms are considered \"further\r\nrestrictions\" within the meaning of section 10.  If the Program as you\r\nreceived it, or any part of it, contains a notice stating that it is\r\ngoverned by this License along with a term that is a further\r\nrestriction, you may remove that term.  If a license document contains\r\na further restriction but permits relicensing or conveying under this\r\nLicense, you may add to a covered work material governed by the terms\r\nof that license document, provided that the further restriction does\r\nnot survive such relicensing or conveying.\r\n\r\n  If you add terms to a covered work in accord with this section, you\r\nmust place, in the relevant source files, a statement of the\r\nadditional terms that apply to those files, or a notice indicating\r\nwhere to find the applicable terms.\r\n\r\n  Additional terms, permissive or non-permissive, may be stated in the\r\nform of a separately written license, or stated as exceptions;\r\nthe above requirements apply either way.\r\n\r\n  8. Termination.\r\n\r\n  You may not propagate or modify a covered work except as expressly\r\nprovided under this License.  Any attempt otherwise to propagate or\r\nmodify it is void, and will automatically terminate your rights under\r\nthis License (including any patent licenses granted under the third\r\nparagraph of section 11).\r\n\r\n  However, if you cease all violation of this License, then your\r\nlicense from a particular copyright holder is reinstated (a)\r\nprovisionally, unless and until the copyright holder explicitly and\r\nfinally terminates your license, and (b) permanently, if the copyright\r\nholder fails to notify you of the violation by some reasonable means\r\nprior to 60 days after the cessation.\r\n\r\n  Moreover, your license from a particular copyright holder is\r\nreinstated permanently if the copyright holder notifies you of the\r\nviolation by some reasonable means, this is the first time you have\r\nreceived notice of violation of this License (for any work) from that\r\ncopyright holder, and you cure the violation prior to 30 days after\r\nyour receipt of the notice.\r\n\r\n  Termination of your rights under this section does not terminate the\r\nlicenses of parties who have received copies or rights from you under\r\nthis License.  If your rights have been terminated and not permanently\r\nreinstated, you do not qualify to receive new licenses for the same\r\nmaterial under section 10.\r\n\r\n  9. Acceptance Not Required for Having Copies.\r\n\r\n  You are not required to accept this License in order to receive or\r\nrun a copy of the Program.  Ancillary propagation of a covered work\r\noccurring solely as a consequence of using peer-to-peer transmission\r\nto receive a copy likewise does not require acceptance.  However,\r\nnothing other than this License grants you permission to propagate or\r\nmodify any covered work.  These actions infringe copyright if you do\r\nnot accept this License.  Therefore, by modifying or propagating a\r\ncovered work, you indicate your acceptance of this License to do so.\r\n\r\n  10. Automatic Licensing of Downstream Recipients.\r\n\r\n  Each time you convey a covered work, the recipient automatically\r\nreceives a license from the original licensors, to run, modify and\r\npropagate that work, subject to this License.  You are not responsible\r\nfor enforcing compliance by third parties with this License.\r\n\r\n  An \"entity transaction\" is a transaction transferring control of an\r\norganization, or substantially all assets of one, or subdividing an\r\norganization, or merging organizations.  If propagation of a covered\r\nwork results from an entity transaction, each party to that\r\ntransaction who receives a copy of the work also receives whatever\r\nlicenses to the work the party's predecessor in interest had or could\r\ngive under the previous paragraph, plus a right to possession of the\r\nCorresponding Source of the work from the predecessor in interest, if\r\nthe predecessor has it or can get it with reasonable efforts.\r\n\r\n  You may not impose any further restrictions on the exercise of the\r\nrights granted or affirmed under this License.  For example, you may\r\nnot impose a license fee, royalty, or other charge for exercise of\r\nrights granted under this License, and you may not initiate litigation\r\n(including a cross-claim or counterclaim in a lawsuit) alleging that\r\nany patent claim is infringed by making, using, selling, offering for\r\nsale, or importing the Program or any portion of it.\r\n\r\n  11. Patents.\r\n\r\n  A \"contributor\" is a copyright holder who authorizes use under this\r\nLicense of the Program or a work on which the Program is based.  The\r\nwork thus licensed is called the contributor's \"contributor version\".\r\n\r\n  A contributor's \"essential patent claims\" are all patent claims\r\nowned or controlled by the contributor, whether already acquired or\r\nhereafter acquired, that would be infringed by some manner, permitted\r\nby this License, of making, using, or selling its contributor version,\r\nbut do not include claims that would be infringed only as a\r\nconsequence of further modification of the contributor version.  For\r\npurposes of this definition, \"control\" includes the right to grant\r\npatent sublicenses in a manner consistent with the requirements of\r\nthis License.\r\n\r\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\r\npatent license under the contributor's essential patent claims, to\r\nmake, use, sell, offer for sale, import and otherwise run, modify and\r\npropagate the contents of its contributor version.\r\n\r\n  In the following three paragraphs, a \"patent license\" is any express\r\nagreement or commitment, however denominated, not to enforce a patent\r\n(such as an express permission to practice a patent or covenant not to\r\nsue for patent infringement).  To \"grant\" such a patent license to a\r\nparty means to make such an agreement or commitment not to enforce a\r\npatent against the party.\r\n\r\n  If you convey a covered work, knowingly relying on a patent license,\r\nand the Corresponding Source of the work is not available for anyone\r\nto copy, free of charge and under the terms of this License, through a\r\npublicly available network server or other readily accessible means,\r\nthen you must either (1) cause the Corresponding Source to be so\r\navailable, or (2) arrange to deprive yourself of the benefit of the\r\npatent license for this particular work, or (3) arrange, in a manner\r\nconsistent with the requirements of this License, to extend the patent\r\nlicense to downstream recipients.  \"Knowingly relying\" means you have\r\nactual knowledge that, but for the patent license, your conveying the\r\ncovered work in a country, or your recipient's use of the covered work\r\nin a country, would infringe one or more identifiable patents in that\r\ncountry that you have reason to believe are valid.\r\n\r\n  If, pursuant to or in connection with a single transaction or\r\narrangement, you convey, or propagate by procuring conveyance of, a\r\ncovered work, and grant a patent license to some of the parties\r\nreceiving the covered work authorizing them to use, propagate, modify\r\nor convey a specific copy of the covered work, then the patent license\r\nyou grant is automatically extended to all recipients of the covered\r\nwork and works based on it.\r\n\r\n  A patent license is \"discriminatory\" if it does not include within\r\nthe scope of its coverage, prohibits the exercise of, or is\r\nconditioned on the non-exercise of one or more of the rights that are\r\nspecifically granted under this License.  You may not convey a covered\r\nwork if you are a party to an arrangement with a third party that is\r\nin the business of distributing software, under which you make payment\r\nto the third party based on the extent of your activity of conveying\r\nthe work, and under which the third party grants, to any of the\r\nparties who would receive the covered work from you, a discriminatory\r\npatent license (a) in connection with copies of the covered work\r\nconveyed by you (or copies made from those copies), or (b) primarily\r\nfor and in connection with specific products or compilations that\r\ncontain the covered work, unless you entered into that arrangement,\r\nor that patent license was granted, prior to 28 March 2007.\r\n\r\n  Nothing in this License shall be construed as excluding or limiting\r\nany implied license or other defenses to infringement that may\r\notherwise be available to you under applicable patent law.\r\n\r\n  12. No Surrender of Others' Freedom.\r\n\r\n  If conditions are imposed on you (whether by court order, agreement or\r\notherwise) that contradict the conditions of this License, they do not\r\nexcuse you from the conditions of this License.  If you cannot convey a\r\ncovered work so as to satisfy simultaneously your obligations under this\r\nLicense and any other pertinent obligations, then as a consequence you may\r\nnot convey it at all.  For example, if you agree to terms that obligate you\r\nto collect a royalty for further conveying from those to whom you convey\r\nthe Program, the only way you could satisfy both those terms and this\r\nLicense would be to refrain entirely from conveying the Program.\r\n\r\n  13. Use with the GNU Affero General Public License.\r\n\r\n  Notwithstanding any other provision of this License, you have\r\npermission to link or combine any covered work with a work licensed\r\nunder version 3 of the GNU Affero General Public License into a single\r\ncombined work, and to convey the resulting work.  The terms of this\r\nLicense will continue to apply to the part which is the covered work,\r\nbut the special requirements of the GNU Affero General Public License,\r\nsection 13, concerning interaction through a network will apply to the\r\ncombination as such.\r\n\r\n  14. Revised Versions of this License.\r\n\r\n  The Free Software Foundation may publish revised and/or new versions of\r\nthe GNU General Public License from time to time.  Such new versions will\r\nbe similar in spirit to the present version, but may differ in detail to\r\naddress new problems or concerns.\r\n\r\n  Each version is given a distinguishing version number.  If the\r\nProgram specifies that a certain numbered version of the GNU General\r\nPublic License \"or any later version\" applies to it, you have the\r\noption of following the terms and conditions either of that numbered\r\nversion or of any later version published by the Free Software\r\nFoundation.  If the Program does not specify a version number of the\r\nGNU General Public License, you may choose any version ever published\r\nby the Free Software Foundation.\r\n\r\n  If the Program specifies that a proxy can decide which future\r\nversions of the GNU General Public License can be used, that proxy's\r\npublic statement of acceptance of a version permanently authorizes you\r\nto choose that version for the Program.\r\n\r\n  Later license versions may give you additional or different\r\npermissions.  However, no additional obligations are imposed on any\r\nauthor or copyright holder as a result of your choosing to follow a\r\nlater version.\r\n\r\n  15. Disclaimer of Warranty.\r\n\r\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\r\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\r\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\r\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\r\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\r\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\r\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\r\n\r\n  16. Limitation of Liability.\r\n\r\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\r\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\r\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\r\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\r\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\r\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\r\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\r\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\r\nSUCH DAMAGES.\r\n\r\n  17. Interpretation of Sections 15 and 16.\r\n\r\n  If the disclaimer of warranty and limitation of liability provided\r\nabove cannot be given local legal effect according to their terms,\r\nreviewing courts shall apply local law that most closely approximates\r\nan absolute waiver of all civil liability in connection with the\r\nProgram, unless a warranty or assumption of liability accompanies a\r\ncopy of the Program in return for a fee.\r\n\r\n                     END OF TERMS AND CONDITIONS\r\n\r\n            How to Apply These Terms to Your New Programs\r\n\r\n  If you develop a new program, and you want it to be of the greatest\r\npossible use to the public, the best way to achieve this is to make it\r\nfree software which everyone can redistribute and change under these terms.\r\n\r\n  To do so, attach the following notices to the program.  It is safest\r\nto attach them to the start of each source file to most effectively\r\nstate the exclusion of warranty; and each file should have at least\r\nthe \"copyright\" line and a pointer to where the full notice is found.\r\n\r\n    <one line to give the program's name and a brief idea of what it does.>\r\n    Copyright (C) <year>  <name of author>\r\n\r\n    This program is free software: you can redistribute it and/or modify\r\n    it under the terms of the GNU General Public License as published by\r\n    the Free Software Foundation, either version 3 of the License, or\r\n    (at your option) any later version.\r\n\r\n    This program is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r\n    GNU General Public License for more details.\r\n\r\n    You should have received a copy of the GNU General Public License\r\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\r\n\r\nAlso add information on how to contact you by electronic and paper mail.\r\n\r\n  If the program does terminal interaction, make it output a short\r\nnotice like this when it starts in an interactive mode:\r\n\r\n    <program>  Copyright (C) <year>  <name of author>\r\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\r\n    This is free software, and you are welcome to redistribute it\r\n    under certain conditions; type `show c' for details.\r\n\r\nThe hypothetical commands `show w' and `show c' should show the appropriate\r\nparts of the General Public License.  Of course, your program's commands\r\nmight be different; for a GUI interface, you would use an \"about box\".\r\n\r\n  You should also get your employer (if you work as a programmer) or school,\r\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\r\nFor more information on this, and how to apply and follow the GNU GPL, see\r\n<http://www.gnu.org/licenses/>.\r\n\r\n  The GNU General Public License does not permit incorporating your program\r\ninto proprietary programs.  If your program is a subroutine library, you\r\nmay consider it more useful to permit linking proprietary applications with\r\nthe library.  If this is what you want to do, use the GNU Lesser General\r\nPublic License instead of this License.  But first, please read\r\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\r\n"
  },
  {
    "path": "COPYING.BSD",
    "content": "Copyright 2006-2014 SumatraPDF project authors (see AUTHORS file). All rights reserved.\r\n\r\nRedistribution and use in source and binary forms, with or without modification, are\r\npermitted provided that the following conditions are met:\r\n\r\n   1. Redistributions of source code must retain the above copyright notice, this list of\r\n      conditions and the following disclaimer.\r\n\r\n   2. Redistributions in binary form must reproduce the above copyright notice, this list\r\n      of conditions and the following disclaimer in the documentation and/or other materials\r\n      provided with the distribution.\r\n\r\nTHIS SOFTWARE IS PROVIDED BY SUMATRAPDF PROJECT AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED\r\nWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\r\nFITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SUMATRAPDF PROJECT AUTHORS OR\r\nCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\nCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\r\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\r\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\r\nADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n"
  },
  {
    "path": "TRANSLATORS",
    "content": "﻿Are you interested in helping to translate Sumatra to your language?\r\nSee https://github.com/sumatrapdfreader/sumatrapdf/wiki/Contribute-translation\r\n\r\nTranslations of Sumatra PDF have been contributed by many people.\r\n\r\nTranslators that used apptranslator.org can be seen by visiting\r\nhttp://www.apptranslator.org/app/SumatraPDF\r\n\r\nMore detailed credits for apptranslator.org translators:\r\n\r\n* Suresh Gautam, http://twitter.com/Peace_NP, sureshgautam@gmail.com\r\n* Gorran Kurd, https://twitter.com/GorranKurd\r\n\r\n(If you're a translator using apptranslator.org and want more\r\ndetailed credit than the link to twitter account available on\r\napptranslator.org, email me at kkowalczy@gmail.com).\r\n\r\nTranslators before apptranslator.org was available:\r\n\r\n* Maxin B. John (maxinbjohn@gmail.com) - Malayalam\r\n* Uthen Phutneam - Thai\r\n* Brian Musarurwa - Shona\r\n* Mohammed Ottama - Burmese\r\n* Jon Stødle - Norwegian Neo-Norwegian\r\n* Pieter Kotzé - Afrikaans\r\n* Shabab Mustafa (shabab.mustafa@gmail.com) - Bengali\r\n* Soham Chatterjee (soham.chatterjee@gmail.com) - Bengali\r\n* Masley b. Mastil - Malaysian\r\n* Muhammad Syawal bin Halimun www.sabily.org (syawal@sabily.org) - Malaysian\r\n* Drive DRKA (drka2003@mail.ru) - Belarusian\r\n* Яўген Змачынскі - Belarusian\r\n* Albert Bock - Cornish\r\n* Ben Bruch - Cornish\r\n* Steve Harris - Cornish\r\n* Wim Benes - Frisian\r\n* Hasitha Jayasooriya (hasithakj@gmail.com) - Sinhala\r\n* Jegatheesan Veeramalai (vjegatheesh@gmail.com) - Tamil\r\n* N. Ejaz Ahamed (ejaz_nasar@yahoo.co.in) - Tamil\r\n* R. Rajesh Jeba Anbiah (rajeshanbiah.blogspot.com) - Tamil\r\n* Glenn Wall - Welsh\r\n* Rhoslyn Prys Cymraeg/Welsh (post@meddal.com) - Welsh\r\n* Arden Christopher C. Chan - Tagalog\r\n* Mark Angelo F. Racca - Tagalog\r\n* Arnoldas Viburys - Lithuanian\r\n* Rimas Kudelis - Lithuanian\r\n* Viktoras Jakovlevas - Lithuanian\r\n* Brian S. Vangsgaard - Danish\r\n* Claus Ørnfeldt Willemoës - Danish\r\n* Jakob Wadsager - Danish\r\n* Lars J. Helbo - Danish\r\n* Mikkel Vestergaard - Danish\r\n* Nardog (nardog.takoweb.com) - Japanese\r\n* kobachi - Japanese\r\n* Joan Montané - Catalan-Valencian\r\n* Pau Iranzo - Catalan-Valencian\r\n* Beqa Arabuli (arabulibeqa@yahoo.com) - Georgian\r\n* Amos Kotter http://sites.google.com/site/hillasystem/ - Hebrew\r\n* Eyal Berman - Hebrew\r\n* Elly Câmpeanu - Romanian\r\n* Gabriel Lazăr - Romanian\r\n* Joan Montané - Catalan\r\n* Pau Iranzo - Catalan\r\n* Raúl Álvarez - Catalan\r\n* Xulio Gómez Díaz - Galician\r\n* BJ Hill - Norwegian\r\n* Bjørn Aas - Norwegian\r\n* Jon Ivar F. Omland - Norwegian\r\n* Kjell A. A. Holm - Norwegian\r\n* Tommy M. Stephansen - Norwegian\r\n* Slavko Majski - Serbian\r\n* milanso (milanso@gmail.com) - Serbian\r\n* Andriy Ilechko - Ukrainian\r\n* Daniel Bohdan - Ukrainian\r\n* FreeXD (http://blog.ecstart.com/?47979) - Chinese Traditional\r\n* theowoo (http://grnrnat.net.ru/) - Chinese Traditional\r\n* 張修銘 (cges30901@gmail.com) - Chinese Traditional\r\n* Joonas - Finnish\r\n* Olli - Finnish\r\n* Pekka Halmela - Finnish\r\n* Nikolay Ikonomov - Bulgarian\r\n* Христо Бенев (http://hbcom.info) - Bulgarian\r\n* Гоце Митевски (http://www.nicer2.com) - Macedonian\r\n* Горан Обрадовић - Serbian\r\n* Милан Гашић - Serbian\r\n* Славко Мајски - Serbian\r\n* H. Metin ÖZER - Turkish\r\n* Hakan ATAÇ - Turkish\r\n* Kerim Kalamujic (kkalamujic@gmail.com) - Bosnian\r\n* WangKing (http://wkismet.spaces.live.com) - Chinese Simplified\r\n* Aivo Kuhlberg - Estonian\r\n* Cs. Gergely, NoIP (info@mthq.org) - Hungarian\r\n* Csaba Vágányik - Hungarian\r\n* Gábor Zsótér - Hungarian\r\n* Lázár Viktor - Hungarian\r\n* Richard Magyar (magyar_richard@yahoo.com) - Hungarian\r\n* Alif Jum'an (www.boloplekcd.blogspot.com) - Indonesian\r\n* M. Ridwan Hakim (http://rescenin.blogspot.com) - Indonesian\r\n* Muhamad Abdul Rosid - Indonesian\r\n* Ricki Yani Setiawan - Indonesian\r\n* Tri R.A. Wibowo - Indonesian\r\n* Yudi Wibisono (http://yudiwbs.wordpress.com) - Indonesian\r\n* Begina - Polish\r\n* Skiff - Polish\r\n* Bernard Holý - TREVERT - Slovak\r\n* Dalibor - Slovak\r\n* Peter Bartik - Slovak\r\n* Radoslav Zelenák (radoslav.zelenak@elkop.sk) - Slovak\r\n* Damjan Gerl - Slovenian\r\n* Janez Vehovec - Slovenian\r\n* Martin Srebotnjak - Slovenian\r\n* Cecilia B - Swedish\r\n* Linus Persson - Swedish\r\n* Mattias D. - Swedish\r\n* Sebastian Rasmussen - Swedish\r\n* Simon B. - Swedish\r\n* Tommy G. - Swedish\r\n* alex - Swedish\r\n* Umidjon Almasov (u.almasov@gmail.com) - Uzbek\r\n* Besmir Godole - Albanian\r\n* Abu Abdullah (falcon.sheep@gmail.com) - Arabic\r\n* Boubker Talibi - Arabic\r\n* Felark (felark@hotmail.com) - Arabic\r\n* Islam Shoman (http://about.me/drshoman2009) - Arabic\r\n* Mohammed Al-Foulad (http://www.mbsee.info) - Arabic\r\n* Hrant Ohanyan »»» http://haysoft.org (hrantohanyan@mail.am) - Armenian\r\n* Igor G. Olaizola - Basque\r\n* Xabier Aramendi (2011-2012) (https://sites.google.com/site/azpidatziak/) - Basque\r\n* Krunoslav Tomorad (cygnus77@gmail.com) - Croatian\r\n* Stjepan Treger (stjepan.treger@gmail.com) - Croatian\r\n* Jiri Saneistr - Czech\r\n* Kristian Vrhel - Czech\r\n* Martin Ruzicka (martin.ruzicka.cz(at)gmail(dot)com) - Czech\r\n* Pavel Zampach - Czech\r\n* Barry Haveman - Dutch\r\n* Jaap Ginder - Dutch\r\n* Jeroen Baert - Dutch\r\n* Kristof Bal - Dutch\r\n* Marco La Fors - Dutch\r\n* Ricki Yani Setiawan - Dutch\r\n* Robbert Feunekes - Dutch\r\n* Ruud Kok - Dutch\r\n* Stephan Paternotte - Dutch\r\n* Wim Benes - Dutch\r\n* bernard - French\r\n* didier - French\r\n* fiuzzy - French\r\n* laclasse - French\r\n* leo - French\r\n* pconno - French\r\n* phoenix - French\r\n* Dimitris Mytilinaios - Greek\r\n* George Georgiou (geonetor@yahoo.gr) - Greek\r\n* Giorgos Dimopoulos (geodimo1985@gmail.com) - Greek\r\n* XhmikosR - Greek\r\n* Alessandro Mariani - Italian\r\n* Alessandro Visentin - Italian\r\n* Angelo Contardi - Italian\r\n* Antonio Colombo - Italian\r\n* Cosimo Prete Damiano - Italian\r\n* Massimiliano Beltrando - Italian\r\n* Mirco Scottà - Italian\r\n* Roberto Boriotti - Italian\r\n* iBlawgger - Italian\r\n* Adham Beyki (odinay@gmail.com) - Persian\r\n* Ali Nayeri - Persian\r\n* DR. dawood fakhim - Persian\r\n* IRIman (iriman@chmail.ir) - Persian\r\n* Mardi Az Pansad Dastgah Artesh - Persian\r\n* dawoodiran@gmail.com - Persian\r\n* داود فخیم - Persian\r\n* Francisco Fuchs (pontocinza.blogspot.com) - Portuguese - Brazil\r\n* Paulo R. M. Cereda (cereda AT users DOT sf DOT net) - Portuguese - Brazil\r\n* Bruno Rodrigues - Portuguese - Portugal\r\n* Ricardo Santos[bogas] (http://www.meta-morf.pt.vu) - Portuguese - Portugal\r\n* Sérgio Marques , 2010-2012 - Portuguese - Portugal\r\n* Carlos Luna - Spanish\r\n* Javier Gutiérrez [http://guti.isgreat.org] - Spanish\r\n* Jose Virgili - Spanish\r\n* José Luis Rivera [jlrn7@yahoo.com] - Spanish\r\n* Juan Vílchez [http://www.juanvilchez.es] - Spanish\r\n* LinoSP [http://reactos.wordpress.com] - Spanish\r\n* Pedro Sanchez [http://www.pedrosanchez-net.es] - Spanish\r\n* pragmart [http://putolinux.wordpress.com] - Spanish\r\n* Andreas Hopp (teraflop@arcor.de) - German\r\n* Christopher Amann - German\r\n* Lars Wohlfahrt (www.eviltux.de) - German\r\n* Michael (quelbs@gmail.com) - German\r\n* Simon Bünzli (zeniko@gmail.com) - German\r\n* 4Li - Korean\r\n* Han Seung-ho (silversoul@korea.com) - Korean\r\n* Hong Seung-geol (hsgno5@hanmir.com) - Korean\r\n* Karnes Kim (karnes@gmail.com) - Korean\r\n* Dmitry Yerokhin (erodim@mail.ru) - Russian\r\n* Victor Kozyakin - Russian\r\n* Zero-8 - Russian\r\n* Nguyễn Lương Đống (http://sites.google.com/site/nguyenluongdong) - Vietnamese\r\n* Tào Trần Vương Thắng (http://keaclamviectot.blogspot.com) - Vietnamese\r\n"
  },
  {
    "path": "appveyor.yml",
    "content": "# docs: http://www.appveyor.com/docs/appveyor-yml\r\n# software installed on build machines: http://www.appveyor.com/docs/installed-software\r\n\r\nversion: 3.1.{build}\r\n\r\nos: Visual Studio 2015\r\n\r\nbranches:\r\n  only:\r\n    - master\r\n\r\n# set env var when running in appveyor so that we can distinguish\r\n# from running locally\r\nenvironment:\r\n  inappveyor: 1\r\n\r\nskip_tags: true\r\n\r\nbuild_script:\r\n  - scripts\\appveyor-build.bat\r\n\r\ntest_script:\r\n  - rel\\test_util.exe\r\n  - rel64\\test_util.exe\r\n\r\nartifacts:\r\n  - path: rel\\SumatraPDF.exe\r\n  - path: rel\\Installer.exe\r\n  - path: rel\\SumatraPDF.pdb.lzsa\r\n  - path: rel64\\SumatraPDF.exe\r\n  - path: rel64\\Installer.exe\r\n  - path: rel64\\SumatraPDF.pdb.lzsa\r\n"
  },
  {
    "path": "docs/codingstyle.txt",
    "content": "Over time Sumatra accrued code using different naming styles.\n\nLet's fix that.\n\nThis document describes the naming style we should use in\nfuture code (and, as a low priority, convert existing code\nto that style).\n\nCoding styles are always controversial because they are mostly\na matter of opinion.\n\nThis coding style follows 2 main principles:\n* codify the style that is already used frequently in Sumatra\n* clean looking code (which is e.g. why we avoid \"_\" prefixes or postfixes in names)\n\n1. Naming classes, methods, functions, variables\n------------------------------------------------\n\nThe best way to describe naming style is via examples.\n\nstruct ThisIsStruct\n{\n    bool    firstMember;\n    int     second;\n    char    seeHowWeAlignNames;\n};\n\nclass ThisIsClass\n{\n    bool   firstDataMember;\n    int    second;\n\n    bool   ThisIsMethod(int inArgsGoFirst, WCHAR *outArgsGoLast);\n};\n\nbool ThisIsFunction(int inArgsGoFirst, int *outArgsGoLast)\n{\n    bool   variableName = true;\n    *outArgsGoLast = 5;\n    return variableName;\n}\n\nint gThisIsGlobalVariable;\n\n2. Tabs vs. spaces\n------------------\n\nWe use spaces, not tabs, with 4 space indentation.\n\n3. #include statements\n----------------------\n\nOur include scheme is not traditional. The rules are:\n- .h files don't #include other .h files\n- we don't have traditional #ifdef .h header guards\n- .cpp files #include \"BaseUtil.h\" first and then all the necessary\n  .h files from\n  1. src/utils\n  2. rendering engines (which can be used for other applications as well,\n     e.g. EngineDump, IFilter, PdfPreview)\n  3. layout controllers (which could be used mostly independently of SumatraPDF as well)\n  4. ui\n  (.cpp files should not include any headers from a group below their own)\n"
  },
  {
    "path": "docs/mui-html-fusion.txt",
    "content": "As web shows, html is a decent way to build UI. In some ways it's better\r\nthan traditional way of building UIs (winforms and similar) and in some\r\nways worse.\r\n\r\nMozilla's XUL, Microsoft's XAML, DirectUI (https://github.com/kjk/directui)\r\ncombine those ideas.\r\n\r\nMui could do as well. There are similarities between DrawInstr and\r\nControl and html's layout proces and mui's layouts.\r\n\r\nThe big idea is to make html element (i.e. currently DrawInstr) to be\r\nfirst-class citizen in mui and vice-versa.\r\n\r\nUltimately this should allow e.g. implementing the equivalent of the\r\ntoolbar, settings and other dialogs, notifications etc. declaratively \r\nin html, with only small amount of code to hook up the actions (like\r\npressing a button) to code.\r\n\r\nImplementation-wise, it requiers the following:\r\n\r\n1. Having the equivalent of DrawInstr be a part of mui UI element\r\nhierarchy. Following XAML design, we could introduce a lighter-weight\r\nbase class UIElement which would have position/size, css style and\r\nwhatever it needs to participate in layouts. Control would derive\r\nfrom that and add the interactive capability.\r\n\r\n2. Ability to instantiate arbitrary mui controls from html parser and\r\nbind code to elements. E.g. our 'update available' dialog  could be:\r\n\r\n<p>You have version <b>5964</b></p>\r\n<p>New version <b>5972</b> is available. Download new version?</p>\r\n<p><control type=checkbox name=skipcheck>&Skip this version</control></p>\r\n<p align=right>\r\n  <control type=button name=dl>Download</control>\r\n  <control type=button name=nodl>&No, thanks</control>\r\n</p>\r\n\r\n// very sketchy syntax, just to illustrate ideas\r\nUIFragment *frag = FragmentFromHtml(gUpdateDialogHtml);\r\nUpdateAvailableController *controller = new UpdateAvailableController(frag);\r\nButton *btnDl = this->frag->FindElement(\"button\", \"dl\");\r\nbtnDl->Connect(controller::OnDownloadPressed);\r\nButton *btnNoDl = frag->FindElement(\"button\", \"nodl\");\r\nbtnNoDl->Connect(controller::OnNoDownloadPressed);\r\n\r\nController::OnNoDownloadPressed() {\r\n  Checkbox *skipCheck = frag->FindElement(\"checkbox\", \"skipcheck\");\r\n  if (skipCheck->IsOn()) {\r\n  } else {\r\n    // is off\r\n  }\r\n  // close the dialog\r\n}\r\nRunDialog(frag);\r\n...\r\n\r\n2.1. <control type=foo ...></control> serves as an extension point\r\nwhere html parser calls mui to interpret a given control syntax.\r\nMui parses until </control> element and when it returns html\r\nparser continues parsing.\r\n\r\nThis can be further extended to allow non-core elements as well e.g.\r\nif sumatra defines SumatraButton control, it could do:\r\nmui::RegisterParsingForControl(\"SumatraButton\", MuiControlParserFunc *parserFunc);\r\n\r\n2.2 Ability to add name and/or id to UIElement and ability to find\r\nelements of a given type/(name/id), like in html's DOM.\r\n\r\n----------------------\r\nEven more ratical idea of how to structure mui is to use DrawInstr-like\r\nmechanizm instead of inheritance. Classes/objects are just a  way to\r\ngive identity to objects that allows referring to them (for the purpose\r\nof manipulation) at runtime. Html doesn't work that way and instead\r\nuses names/ids/DOM traversal to refer to ui elements and uses\r\na fixed number of events that apply to each element.\r\nThere are practical issues in that e.g. implementing a rounded border\r\n(and other sophisticated painting) for a Button is easier via custom\r\npaint function than by adding such capability in generic way.\r\n-----------------------\r\n\r\n "
  },
  {
    "path": "docs/releasenotes.txt",
    "content": "﻿The idea is to record here changes that deserve mentioning in\r\nthe release notes, as we make them, to make the release process easier.\r\n\r\nNext version:\r\n\r\n3.2 (????-??-??)\r\n\r\n\r\n3.1.1 (2015-11-02)\r\n* (re)add support for old processors that don't have SSE2\r\n* support newer versions of unrar.dll\r\n* allow keeping browser plugin if it's already installed\r\n* crash fixes\r\n\r\n3.1 (2015-10-24)\r\n\r\n* 64bit builds\r\n* all documents are restored at startup if a window with multiple tabs\r\n  is closed (or if closing happened through File -> Exit); this can be\r\n  disabled through the RestoreSession advanced setting\r\n* printing happens (again) always as image which leads to more reliable\r\n  results at the cost of requiring more printer memory; the \"Print as Image\"\r\n  advanced printing option has been removed\r\n* scrolling with touchpad (e.g. on Surface Pro) now works\r\n* many crash and other bug fixes\r\n\r\n3.0 (2014-10-18)\r\n\r\n* Tabs!\r\n* deprecated the browser plugin (remains installed if used)\r\n* support table of contents and links in ebook UI\r\n* add support for PalmDoc ebooks\r\n* add support for displaying CB7 and CBT comic books (in addition to CBZ and CBR)\r\n* add support for LZMA and PPMd compression in CBZ comic books\r\n* allow saving Comic Book files as PDF\r\n* swapped keybindings:\r\n  * F11 : Fullscreen mode (still also Ctrl+Shift+L)\r\n  * F5  : Presentation mode (also Shift+F11, still also Ctrl+L)\r\n* added a document measurement helper (invoke by pressing M)\r\n* new advanced settings: FullPathInTitle, UseSysColors (no longer exposed through the Options dialog)\r\n* replaced non-free UnRAR with a free RAR extraction library\r\n  (if some CBR files fail to open for you, please download unrar.dll from\r\n  http://www.rarlab.com/rar_add.htm and place it alongside SumatraPDF.exe)\r\n* removed support for reading sumatrapdfprefs.dat (when updating from a version prior to\r\n  version 2.3, please upgrade to 2.5.2 first and have that convert your settings to the\r\n  format introduced in version 2.3 before updating to a later version)\r\n\r\n2.5.2 (2014-05-13)\r\n\r\n* use less memory for comic book files\r\n* PDF rendering improvements\r\n\r\n2.5.1 (2014-05-07):\r\n\r\n* hopefully fix frequent ebook crashes\r\n\r\n2.5 (2014-05-05):\r\n\r\n* 2 page view for ebooks\r\n* new keybindings:\r\n  * Ctrl+PgDn, Ctrl+Right : go to next page\r\n  * Ctrl+PgUp, Ctrl+Left  : go to previous page\r\n* 10x faster ebook layout\r\n* support JP2 images\r\n* new advanced settings: ShowMenuBar, ReloadModifiedDocuments, CustomScreenDPI\r\n* left/right clicking no longer changes pages in fullscreen mode\r\n  (use Presentation mode if you rely on this feature)\r\n* fixed multiple crashes\r\n\r\n2.4 (2013-10-01):\r\n\r\n* full-screen mode for ebooks (Ctrl-L)\r\n* new key bindings:\r\n  * F9 - show/hide menu (not remembered after quitting)\r\n  * F8 - show/hide toolbar\r\n* support WebP images\r\n* support for RAR5 compressed comic books\r\n* fixed multiple crashes\r\n\r\n2.3.2 (2013-05-25):\r\n\r\n* fix a bug changing a language using Settings/Change Language menu\r\n\r\n2.3.1 (2013-05-23):\r\n\r\n* not compiled with SSE2\r\n\r\n2.3 (2013-05-22):\r\n\r\n* more configurability. Settings are now saved in human-editable\r\n  SumatraPDF-settings.txt (instead of binary sumatrapdfprefs.dat)\r\n  and there are more settings for customizing Sumatra. For more\r\n  documentation see http://blog.kowalczyk.info/software/sumatrapdf/settings.html\r\n* \"Go To Page\" for ebook format\r\n* add support for OpenXPS documents\r\n* add View/Manga Mode menu item for Comic Book (CBZ/CBR) files\r\n* support Deflate64 in Comic Book (CBZ) files\r\n* new key bindings:\r\n  * Ctrl-Up   : page up\r\n  * Ctrl-Down : page down\r\n* fixed paragraph indentation missing for EPUB documents\r\n* printing with \"Use original page sizes\" no longer centers pages on paper\r\n* reduced size. Installer is ~1MB smaller\r\n\r\n2.2.1 (2013-01-12):\r\n\r\n* fixed ebooks sometimes not remembering the viewing position\r\n* fixed Sumatra not exiting when opening files from a network drive\r\n* fixes for most frequent crashes, PDF parsing robustness fixes and\r\n  regressions from 2.1.1 introduced in 2.2\r\n\r\n2.2 (2012-12-24):\r\n\r\n* add support for FictionBook ebook format\r\n* add support for PDF documents encrypted with Acrobat X\r\n* “Print as image” compatibility option for documents that fail to print properly\r\n* -manga-mode [1|true|0|false] for proper display of manga comic books\r\n* fixed a reuse-after-free crash reported by John Leitch from\r\n  Microsoft Vulnerability Research (MSVR)\r\n* fixed multiple crashes caused by overflows\r\n\r\n2.1.1 (2012-05-07):\r\n\r\n* fix a couple of crashes, most importantly crash when resizing some ePub files\r\n\r\n2.1 (2012-05-03):\r\n\r\n* support for EPUB ebook format\r\n* added menu item to rename a file (contributed by Vasily Fomin)\r\n* support multi-page TIFF files\r\n* support TGA images\r\n* support for some comic book (CBZ) metadata\r\n* support JPEG XR images (available on Windows Vista or later,\r\n  for Windows XP the Windows Imaging Component has to be installed)\r\n* fixed multiple heap overflows reported by John Leitch from\r\n  Microsoft Vulnerability Research (MSVR) and by Carlo Di Dato (aka shinnai)\r\n* the installer is now signed\r\n\r\n2.0.1 (2012-04-08):\r\n\r\n* fix loading .mobi files from command line\r\n* fix a crash loading multiple .mobi files at once\r\n* fix a crash showing tooltips for table of contents tree entries\r\n\r\n2.0 (2012-04-02):\r\n\r\n* support for mobi ebook format\r\n* we can now open CHM documents from network drives\r\n* images from documents can be copied from the context menu\r\n* document colors can be replaced with Windows system colors\r\n  (option hidden if Windows displays text black-on-white)\r\n* smaller size thanks to ucrt\r\n\r\n1.9 (2011-11-23):\r\n\r\n* CHM documents support\r\n* support touch gestures (available on Windows 7 or later)\r\n  (contributed by Robert Prouse)\r\n* open linked audio and video files in an external media player\r\n* improved support for PDF transparency groups\r\n\r\n1.8 (2011-09-18):\r\n\r\n* improved support for PDF form text fields\r\n* various minor improvements and crash fixes\r\n* speedup handling some djvu files\r\n\r\n1.7 (2011-07-18):\r\n\r\n* favorites\r\n* logical page numbers are displayed and used, if a document\r\n  provides them (such as i, ii, iii, etc.)\r\n* allow to restrict SumatraPDF's features with more granularity; see\r\n  http://code.google.com/p/sumatrapdf/source/browse/trunk/docs/sumatrapdfrestrict.ini\r\n* -named-dest also matches strings in table of contents\r\n* improved support for EPS files (requires Ghostscript)\r\n* improved support for right-to-left languages e.g. Arabic\r\n* more robust installer (requires to close programs, like a browser, that\r\n  are using Sumatra components, preventing them from being over-written\r\n  during installation)\r\n\r\n1.6 (2011-05-30):\r\n\r\n* display Frequently Read list when no document is open\r\n* add support for displaying DjVu documents\r\n* add support for displaying Postscript documents\r\n  (requires a recent Ghostscript installation)\r\n* add support for displaying a folder containing images\r\n  (to display it, drag the folder over SumatraPDF)\r\n* support clickable links and a Table of Content for XPS documents\r\n* optional previewing of PDF documents in Windows Vista and 7 (creates\r\n  thumbnails and displays documents in Explorer's Preview pane)\r\n* display printing progress and allow to cancel it\r\n* add Print toolbar button\r\n\r\n1.5.1 (2011-04-27):\r\n\r\n* fixes for crashes\r\n\r\n1.5 (2011-04-23):\r\n\r\n* add support for displaying XPS documents\r\n* add support for displaying CBZ and CBR comic books\r\n* add \"Save Shortcut\" to create shortcuts to specific places in a document\r\n* add a basic context menu for copying text, link addresses and comments\r\n  (and saving and printing for the browser plugin)\r\n* add folder browsing (Ctrl+Shift+Right opens the next PDF document in the\r\n  current folder, Ctrl+Shift+Left the previous one)\r\n\r\n1.4 (2011-03-12):\r\n\r\n* browser plugin for Mozilla Firefox, Google Chrome and Opera for displaying\r\n  PDF documents with SumatraPDF inside the browser (does NOT work under MSIE)\r\n* IFilter for PDF to support searching document contents with\r\n  Windows Desktop Search (full text search from Windows Vista/7's Start Menu)\r\n* add support for AES-256 encrypted documents\r\n* Right Mouse now drags the document (same as Shift+Left),\r\n  Right+Scroll zooms it (same as Ctrl+Scroll)\r\n* add menu item to open with Foxit Reader and PDF-XChange Viewer (if installed)\r\n* add suport for custom installation directories in the installer\r\n* removed -title cmd-line option\r\n* we no longer compress binaries that come with installer with mpress to\r\n  avoid anti-virus programs flagging us as a virus. The portable, .zip version\r\n  is still compressed with mpress\r\n* fixed an integer overflow reported by Jeroen van der Gun\r\n\r\n1.3 (2011-02-04):\r\n\r\n* improved text selection and copying. We now mimic the way a browser\r\n  or Adobe Reader works: just select text with mouse and use Ctrl+C\r\n  to copy it to a clipboard\r\n* Shift+Left Mouse now scrolls the document, Ctrl+Left mouse still\r\n  creates a rectangular selection (for copying images)\r\n* 'c' shortcut toggles continuous mode\r\n* '+' / '*' on the numeric keyboard now do zoom and rotation\r\n* added toolbar icons for Fit Page and Fit Width and updated\r\n  the look of toolbar icons\r\n* add support for back/forward mouse buttons for back/forward navigation\r\n* 1.2 introduces a new full screen mode and made it the default\r\n  full screen mode. Old mode was still available but not easily\r\n  discoverable. We've added View/Presentation menu item for\r\n  new full screen mode and View/Fullscreen menu item for the old\r\n  full screen mode, to make it more discoverable\r\n* new, improved installer\r\n* improved zoom performance (zooming to 6400% no longer crashes)\r\n* text find uses less memory\r\n* further printing improvements\r\n* translation updates\r\n* updated to latest mupdf for misc bugfixes and improvements\r\n* use libjpeg-turbo library instead of libjpeg, for faster decoding\r\n  of some PDFs\r\n* updated openjpeg library to version 1.4 and freetype to version 2.4.4\r\n* fixed 2 integer overflows reported by Stefan Cornelius from Secunia Research\r\n\r\n1.2 (2010-11-26):\r\n\r\n* improved printing: faster and uses less resources\r\n* add Ctrl+Y as a shortcut for Custom Zoom\r\n* add Ctrl+A as a shortcut for Select All Text\r\n* improved full screen mode\r\n* open embedded PDF documents\r\n* allow saving PDF document attachements to disk\r\n* latest fixes and improvements to PDF rendering from mupdf project\r\n\r\n1.1 (2010-05-20):\r\n\r\n* added book view (“View/Book View” menu item) option. It’s known as “Show Cover Page During Two-Up” in Adobe Reader\r\n* added “File/Properties” menu item, showing basic information about PDF file\r\n* added “File/Send by email” menu\r\n* added export as text. When doing “File/Save As”, change “Save As types” from “PDF documents” to “Text documents”. Don’t expect miracles, though. Conversion to text is not very good in most cases.\r\n* auto-detect commonly used TeX editors for inverse-search command\r\n* bug fixes to PDF handling (more PDFs are shown correctly)\r\n* misc bug fixes and small improvements in UI\r\n* add Ctrl + and Ctrl – as shortcuts for zooming (matches Adobe Reader)\r\n\r\n1.0.1 (2009-11-27):\r\n\r\n* many memory leaks fixed (Simon Bünzli)\r\n* potential crash due to stack corruption (pointed out by Christophe Devine)\r\n* making Sumatra default PDF reader no longer asks for admin priviledges on Vista/Windows 7\r\n* translation updates\r\n\r\n1.0 (2009-11-17):\r\n\r\n* lots of small bug fixes and improvements\r\n\r\n0.9.4 (2009-07-19):\r\n\r\n* improved PDF compatibility (more types of documents can be rendered)\r\n* added settings dialog (contributed by Simon Bünzli)\r\n* improvements in handling unicode\r\n* changed default view from single page to continuous\r\n* SyncTex improvements (contributed by William Blum)\r\n* add option to not remember opened files\r\n* a new icon for documents association (contributed by George Georgiou)\r\n* lots of bugfixes and UI polish\r\n\r\n0.9.3 (2008-10-07):\r\n\r\n* fix an issue with opening non-ascii files\r\nupdated Japanese and Brazillian translation\r\n\r\n0.9.2 (2008-10-06):\r\n\r\n* ability to disable auto-update check\r\n* improved text rendering - should fix problems with overlapping text\r\n* improved font substition for fonts not present in PDF file\r\n* can now open PDF files with non-ascii names\r\n* improvements to DDE (contributed by Danilo Roascio)\r\n* SyncTex improvements\r\n* improve persistance of state (contributed by Robert Liu)\r\n* fix crash when pressing 'Cancel' when entering a password\r\n* updated translations\r\n\r\n0.9.1 (2008-08-22):\r\n\r\n* improved rendering of some PDFs\r\n* support for links inside PDF file\r\n* added -restrict and -title cmd-line options (contributed by Matthew Wilcoxson)\r\n* enabled SyncTex support which mistakenly disabled in 0.9\r\nmisc fixes and translation updates\r\n\r\n0.9 (2008-08-10):\r\n\r\n* add Ctrl+P as print shortcut\r\n* add F11 as full-screen shortcut\r\n* password dialog no longer shows the password\r\n* support for AES-encrypted PDF files\r\n* updates to SyncTeX/PdfSync integration (contributed by William Blum)\r\n* add -nameddest command-line option and DDE commands for jumping to named destination(contributed by Alexander Klenin)\r\n* add -reuse-instance command-line option (contributed by William Blum)\r\n* add DDE command to open PDF file (contributed by William Blum)\r\n* removed poppler rendering engine resulting in smaller program and updated to latest mupdf sources\r\n* misc bugfixes and translation updates\r\n\r\n0.8.1 (2008-05-27):\r\n\r\n* automatic reloading of changed PDFs (contributed by William Blum)\r\n* tex integration (contributed by William Blum)\r\n* updated icon for case-sensitivity selection in find (contributed by Sonke Tesch)\r\n* language change is now a separate dialog instead of a menu\r\n* remember more settings (like default view)\r\n* automatic checks for new versions\r\n* add command-line option -lang $lang\r\n* add command-line option -print-dialog (contributed by Peter Astrand)\r\n* ESC or single mouse click hides selection\r\n* fix showing boxes in table of contents tree\r\n* translation updates (contributed by many people)\r\n\r\n0.8 (2008-01-01):\r\n\r\n* added search (contributed by MrChuoi)\r\n* added table of contents (contributed by MrChuoi)\r\n* added many translation (contributed by many people)\r\n* new program icon\r\n* fixed printing\r\n* fixed some crashes\r\n* rendering speedups\r\n* fixed loading of some PDFs\r\n* add command-line option -esc-to-exit\r\n* add command-line option -bgcolor $color\r\n\r\n0.7 (2007-07-28):\r\n\r\n* added ability to select the text and copy to clipboard - contributed by Tomek Weksej\r\n* made it multi-lingual (13 translations contributed by many people)\r\n* added Save As option\r\n* list of recently opened files is updated immediately\r\n* fixed .pdf extension registration on Vista\r\n* added ability to compile as DLL and C# sample application - contributed by Valery Possoz\r\n* mingw compilation fixes and project files for CodeBlocks - contributed by MrChuoi\r\n* fixed a few crashes\r\n* moved the sources to Google Code project hosting\r\n\r\n0.6 (2007-04-29):\r\n\r\n* enable opening password-protected PDFs\r\n* don't allow printing in PDFs that have printing forbidden\r\n* don't automatically reopen files at startup\r\n* fix opening PDFs from network shares\r\n* new, better icon\r\n* reload the document when changing rendering engine\r\n* improve cursor shown when dragging\r\n* fix toolbar appearance on XP and Vista with classic theme\r\n* when MuPDF engine cannot load a file or render a page, we fallback to * poppler engine to make rendering more robust\r\n* fixed a few crashes\r\n\r\n0.5 (2007-03-04):\r\n\r\n* fixed rendering problems with some PDF files\r\n* speedups - the application should feel be snappy and there should be less waiting for rendering\r\n* added 'r' keybinding for reloading currently open PDF file\r\n* added <Ctrl>-<Shift>-+ and <Ctrl>-<Shift>-- keybindings to rotate clockwise and counter-clockwise (just like Acrobat Reader)\r\n* fixed a crash or two\r\n\r\n0.4 (2007-02-18):\r\n\r\n* printing\r\n* ask before registering as a default handler for PDF files\r\n* faster rendering thanks to alternative PDF rendering engine. Previous engine is available as well.\r\n* scrolling with mouse wheel\r\n* fix toolbar issues on win2k\r\n* improve the way fonts directory is found\r\n* improvements to portable mode\r\n* uninstaller completely removes the program\r\n* changed name of preferences files from prefs.txt to sumatrapdfprefs.txt\r\n\r\n0.3 (2006-11-25):\r\n\r\n* added toolbar for most frequently used operations\r\n* should be more snappy because rendering is done in background and it caches one page ahead\r\n* some things are faster\r\n\r\n0.2 (2006-08-06):\r\n\r\n* added facing, continuous and continuous facing viewing modes\r\n* remember history of opened files\r\n* session saving i.e. on exit remember which files are opened and restore the session when the program is started without any command-line parameters\r\n* ability to open encrypted files\r\n* \"Go to page dialog\"\r\n* less invasive (less yellow) icon that doesn't jump at you on desktop\r\n* fixed problem where sometimes text wouldn't show (better mapping for fonts; use a default font if can't find the font specified in PDF file)\r\n* handle URI links inside PDF documents\r\n* show \"About\" screen\r\n* provide a download in a .zip file for those who can't run installation program\r\n* switched to poppler code instead of xpdf\r\n\r\n0.1 (2006-06-01):\r\n\r\n* first version released\r\n"
  },
  {
    "path": "docs/releaseplan.txt",
    "content": "Some ideas for 3.2 release:\r\n- improve tabs (re-arrange with drag&drop, allow moving between windows)\r\n- background loading so that we don't stall on slow filesystem (network drives)\r\n- ebook improvements\r\n - allow changing font size\r\n - change font/bg color\r\n - search\r\n - text selection\r\n- better handle fit-width for files that have non-uniform pages\r\n\r\nIt's best to make the most risky (most likely to introduce breakage) changes\r\nfirst so that there is time to stabilize the code. E.g. in 2.2, LoadDocument()\r\nrefactoring is such a change.\r\n\r\nA random list of things to implement sooner or later:\r\n- html: format text on a line to a baseline\r\n  http://www.bobpowell.net/formattingtext.htm\r\n- mobi: links\r\n- ebook ui: links\r\n- mobi: lists (ul, li)\r\n- ebook ui: search\r\n- ebook ui: printing\r\n- ebook ui: allow to change default font name/size, remember it\r\n        for a given document in preferences\r\n- ebook ui: 2 page display\r\n- ebook ui: rtl support\r\n- mobi: parse table of content (<html><head><guide><reference type=\"toc\" title=\"Table of Contents\", filepos=$N />)\r\n- ebook ui: change the font size\r\n- ebook ui: change font/background combinations (just 3 options, like in kindle app:\r\n  black on white, sepia, white on black)\r\n- ebook ui: change brightness\r\n- ebook ui: table of content\r\n- ebook ui: better (on-screen) ui for bookmarks\r\n- html: hyphenation (http://www.tug.org/docs/liang/)\r\n"
  },
  {
    "path": "docs/settings/langs3.1.html",
    "content": "<!doctype html>\n\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<title>Languages supported by SumatraPDF 3.1</title>\n<style type=text/css>\nbody {\n    font-size: 90%;\n    background-color: #f5f5f5;\n}\n\n.txt1 {\n    /* bold doesn't look good in the fonts above */\n    font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;\n    font-size: 88%;\n    color: #800; /* this is brown */\n}\n\n.txt2 {\n    font-family: Verdana, Arial, sans-serif;\n    font-family: serif;\n    font-size: 90%;\n    font-weight: bold;\n    color: #800; /* this is brown */\n}\n\n.txt {\n    font-family: serif;\n    font-size: 95%;\n    font-weight: bold;\n    color: #800; /* this is brown */\n    color: #000;\n    background-color: #ececec;\n}\n\n.cm {\n    color: #800;   /* this is brown, a bit aggressive */\n    color: #8c8c8c; /* this is gray */\n    color: #555; /* this is darker gray */\n    font-weight: normal;\n}\n</style>\n</head>\n\n<body>\n\n<h2>Languages supported by SumatraPDF</h2>\n\n<p>Languages supported by SumatraPDF. You can use ISO code as a value\nof <code>UiLanguage</code> setting in <a href=\"settings3.1.html\">settings file</a>.\n</p>\n\n<p>Note: not all languages are fully translated. Help us <a href=\"http://www.apptranslator.org/app/SumatraPDF\">translate SumatraPDF</a>.</p>\n\n<table>\n<tr><th>Language name</th><th>ISO code</th></tr>\n<tr><td>Afrikaans</td><td>af</td></tr>\n<tr><td>Albanian (Shqip)</td><td>sq</td></tr>\n<tr><td>Arabic (الْعَرَبيّة)</td><td>ar</td></tr>\n<tr><td>Armenian (Հայերեն)</td><td>am</td></tr>\n<tr><td>Azerbaijani (Azərbaycanca)</td><td>az</td></tr>\n<tr><td>Basque (Euskara)</td><td>eu</td></tr>\n<tr><td>Belarusian (Беларуская)</td><td>by</td></tr>\n<tr><td>Bengali (বাংলা)</td><td>bn</td></tr>\n<tr><td>Bosnian (Bosanski)</td><td>bs</td></tr>\n<tr><td>Bulgarian (Български)</td><td>bg</td></tr>\n<tr><td>Burmese (ဗမာ စာ)</td><td>mm</td></tr>\n<tr><td>Catalan (Català)</td><td>ca</td></tr>\n<tr><td>Catalan-Valencian (Català-Valencià)</td><td>ca-xv</td></tr>\n<tr><td>Chinese Simplified (简体中文)</td><td>cn</td></tr>\n<tr><td>Chinese Traditional (繁體中文)</td><td>tw</td></tr>\n<tr><td>Cornish (Kernewek)</td><td>kw</td></tr>\n<tr><td>Croatian (Hrvatski)</td><td>hr</td></tr>\n<tr><td>Czech (Čeština)</td><td>cz</td></tr>\n<tr><td>Danish (Dansk)</td><td>dk</td></tr>\n<tr><td>Dutch (Nederlands)</td><td>nl</td></tr>\n<tr><td>English</td><td>en</td></tr>\n<tr><td>Estonian (Eesti)</td><td>et</td></tr>\n<tr><td>Finnish (Suomi)</td><td>fi</td></tr>\n<tr><td>French (Français)</td><td>fr</td></tr>\n<tr><td>Frisian (Frysk)</td><td>fy-nl</td></tr>\n<tr><td>Galician (Galego)</td><td>gl</td></tr>\n<tr><td>Georgian (ქართული)</td><td>ka</td></tr>\n<tr><td>German (Deutsch)</td><td>de</td></tr>\n<tr><td>Greek (Ελληνικά)</td><td>el</td></tr>\n<tr><td>Hebrew (עברית)</td><td>he</td></tr>\n<tr><td>Hindi (हिंदी)</td><td>hi</td></tr>\n<tr><td>Hungarian (Magyar)</td><td>hu</td></tr>\n<tr><td>Indonesian (Bahasa Indonesia)</td><td>id</td></tr>\n<tr><td>Irish (Gaeilge)</td><td>ga</td></tr>\n<tr><td>Italian (Italiano)</td><td>it</td></tr>\n<tr><td>Japanese (日本語)</td><td>ja</td></tr>\n<tr><td>Javanese (ꦧꦱꦗꦮ)</td><td>jv</td></tr>\n<tr><td>Korean (한국어)</td><td>kr</td></tr>\n<tr><td>Kurdish (كوردی)</td><td>ku</td></tr>\n<tr><td>Latvian (latviešu valoda)</td><td>lv</td></tr>\n<tr><td>Lithuanian (Lietuvių)</td><td>lt</td></tr>\n<tr><td>Macedonian (македонски)</td><td>mk</td></tr>\n<tr><td>Malayalam (മലയാളം)</td><td>ml</td></tr>\n<tr><td>Malaysian (Bahasa Melayu)</td><td>my</td></tr>\n<tr><td>Nepali (नेपाली)</td><td>ne</td></tr>\n<tr><td>Norwegian (Norsk)</td><td>no</td></tr>\n<tr><td>Norwegian Neo-Norwegian (Norsk nynorsk)</td><td>nn</td></tr>\n<tr><td>Persian (فارسی)</td><td>fa</td></tr>\n<tr><td>Polish (Polski)</td><td>pl</td></tr>\n<tr><td>Portuguese - Brazil (Português)</td><td>br</td></tr>\n<tr><td>Portuguese - Portugal (Português)</td><td>pt</td></tr>\n<tr><td>Punjabi (ਪੰਜਾਬੀ)</td><td>pa</td></tr>\n<tr><td>Romanian (Română)</td><td>ro</td></tr>\n<tr><td>Russian (Русский)</td><td>ru</td></tr>\n<tr><td>Serbian (Cyrillic)</td><td>sr-rs</td></tr>\n<tr><td>Serbian (Latin)</td><td>sp-rs</td></tr>\n<tr><td>Shona (Shona)</td><td>sn</td></tr>\n<tr><td>Sinhala (සිංහල)</td><td>si</td></tr>\n<tr><td>Slovak (Slovenčina)</td><td>sk</td></tr>\n<tr><td>Slovenian (Slovenščina)</td><td>sl</td></tr>\n<tr><td>Spanish (Español)</td><td>es</td></tr>\n<tr><td>Swedish (Svenska)</td><td>sv</td></tr>\n<tr><td>Tagalog (Tagalog)</td><td>tl</td></tr>\n<tr><td>Tamil (தமிழ்)</td><td>ta</td></tr>\n<tr><td>Thai (ภาษาไทย)</td><td>th</td></tr>\n<tr><td>Turkish (Türkçe)</td><td>tr</td></tr>\n<tr><td>Ukrainian (Українська)</td><td>uk</td></tr>\n<tr><td>Uzbek (O'zbek)</td><td>uz</td></tr>\n<tr><td>Vietnamese (Việt Nam)</td><td>vn</td></tr>\n<tr><td>Welsh (Cymraeg)</td><td>cy</td></tr>\n</table>\n\n</body>\n</html>\n"
  },
  {
    "path": "docs/settings/langs3.2.html",
    "content": "<!doctype html>\n\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<title>Languages supported by SumatraPDF 3.2</title>\n<style type=\"text/css\">\nbody {\n    font-size: 90%;\n    background-color: #f5f5f5;\n}\n\n.txt1 {\n    /* bold doesn't look good in the fonts above */\n    font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;\n    font-size: 88%;\n    color: #800; /* this is brown */\n}\n\n.txt2 {\n    font-family: Verdana, Arial, sans-serif;\n    font-family: serif;\n    font-size: 90%;\n    font-weight: bold;\n    color: #800; /* this is brown */\n}\n\n.txt {\n    font-family: serif;\n    font-size: 95%;\n    font-weight: bold;\n    color: #800; /* this is brown */\n    color: #000;\n    background-color: #ececec;\n}\n\n.cm {\n    color: #800;   /* this is brown, a bit aggressive */\n    color: #8c8c8c; /* this is gray */\n    color: #555; /* this is darker gray */\n    font-weight: normal;\n}\n</style>\n</head>\n\n<body>\n\n<h2>Languages supported by SumatraPDF 3.2</h2>\n\n<p>Languages supported by SumatraPDF. You can use ISO code as a value\nof <code>UiLanguage</code> setting in <a href=\"settings3.2.html\">settings file</a>.\n</p>\n\n<p>Note: not all languages are fully translated. Help us <a href=\"http://www.apptranslator.org/app/SumatraPDF\">translate SumatraPDF</a>.</p>\n\n<table>\n<tr><th>Language name</th><th>ISO code</th></tr>\n<tr><td>Afrikaans</td><td>af</td></tr>\n<tr><td>Albanian (Shqip)</td><td>sq</td></tr>\n<tr><td>Arabic (الْعَرَبيّة)</td><td>ar</td></tr>\n<tr><td>Armenian (Հայերեն)</td><td>am</td></tr>\n<tr><td>Azerbaijani (Azərbaycanca)</td><td>az</td></tr>\n<tr><td>Basque (Euskara)</td><td>eu</td></tr>\n<tr><td>Belarusian (Беларуская)</td><td>by</td></tr>\n<tr><td>Bengali (বাংলা)</td><td>bn</td></tr>\n<tr><td>Bosnian (Bosanski)</td><td>bs</td></tr>\n<tr><td>Bulgarian (Български)</td><td>bg</td></tr>\n<tr><td>Burmese (ဗမာ စာ)</td><td>mm</td></tr>\n<tr><td>Catalan (Català)</td><td>ca</td></tr>\n<tr><td>Catalan-Valencian (Català-Valencià)</td><td>ca-xv</td></tr>\n<tr><td>Chinese Simplified (简体中文)</td><td>cn</td></tr>\n<tr><td>Chinese Traditional (繁體中文)</td><td>tw</td></tr>\n<tr><td>Cornish (Kernewek)</td><td>kw</td></tr>\n<tr><td>Croatian (Hrvatski)</td><td>hr</td></tr>\n<tr><td>Czech (Čeština)</td><td>cz</td></tr>\n<tr><td>Danish (Dansk)</td><td>dk</td></tr>\n<tr><td>Dutch (Nederlands)</td><td>nl</td></tr>\n<tr><td>English</td><td>en</td></tr>\n<tr><td>Estonian (Eesti)</td><td>et</td></tr>\n<tr><td>Finnish (Suomi)</td><td>fi</td></tr>\n<tr><td>French (Français)</td><td>fr</td></tr>\n<tr><td>Frisian (Frysk)</td><td>fy-nl</td></tr>\n<tr><td>Galician (Galego)</td><td>gl</td></tr>\n<tr><td>Georgian (ქართული)</td><td>ka</td></tr>\n<tr><td>German (Deutsch)</td><td>de</td></tr>\n<tr><td>Greek (Ελληνικά)</td><td>el</td></tr>\n<tr><td>Hebrew (עברית)</td><td>he</td></tr>\n<tr><td>Hindi (हिंदी)</td><td>hi</td></tr>\n<tr><td>Hungarian (Magyar)</td><td>hu</td></tr>\n<tr><td>Indonesian (Bahasa Indonesia)</td><td>id</td></tr>\n<tr><td>Irish (Gaeilge)</td><td>ga</td></tr>\n<tr><td>Italian (Italiano)</td><td>it</td></tr>\n<tr><td>Japanese (日本語)</td><td>ja</td></tr>\n<tr><td>Javanese (ꦧꦱꦗꦮ)</td><td>jv</td></tr>\n<tr><td>Korean (한국어)</td><td>kr</td></tr>\n<tr><td>Kurdish (كوردی)</td><td>ku</td></tr>\n<tr><td>Latvian (latviešu valoda)</td><td>lv</td></tr>\n<tr><td>Lithuanian (Lietuvių)</td><td>lt</td></tr>\n<tr><td>Macedonian (македонски)</td><td>mk</td></tr>\n<tr><td>Malayalam (മലയാളം)</td><td>ml</td></tr>\n<tr><td>Malaysian (Bahasa Melayu)</td><td>my</td></tr>\n<tr><td>Nepali (नेपाली)</td><td>ne</td></tr>\n<tr><td>Norwegian (Norsk)</td><td>no</td></tr>\n<tr><td>Norwegian Neo-Norwegian (Norsk nynorsk)</td><td>nn</td></tr>\n<tr><td>Persian (فارسی)</td><td>fa</td></tr>\n<tr><td>Polish (Polski)</td><td>pl</td></tr>\n<tr><td>Portuguese - Brazil (Português)</td><td>br</td></tr>\n<tr><td>Portuguese - Portugal (Português)</td><td>pt</td></tr>\n<tr><td>Punjabi (ਪੰਜਾਬੀ)</td><td>pa</td></tr>\n<tr><td>Romanian (Română)</td><td>ro</td></tr>\n<tr><td>Russian (Русский)</td><td>ru</td></tr>\n<tr><td>Serbian (Cyrillic)</td><td>sr-rs</td></tr>\n<tr><td>Serbian (Latin)</td><td>sp-rs</td></tr>\n<tr><td>Shona (Shona)</td><td>sn</td></tr>\n<tr><td>Sinhala (සිංහල)</td><td>si</td></tr>\n<tr><td>Slovak (Slovenčina)</td><td>sk</td></tr>\n<tr><td>Slovenian (Slovenščina)</td><td>sl</td></tr>\n<tr><td>Spanish (Español)</td><td>es</td></tr>\n<tr><td>Swedish (Svenska)</td><td>sv</td></tr>\n<tr><td>Tagalog (Tagalog)</td><td>tl</td></tr>\n<tr><td>Tamil (தமிழ்)</td><td>ta</td></tr>\n<tr><td>Thai (ภาษาไทย)</td><td>th</td></tr>\n<tr><td>Turkish (Türkçe)</td><td>tr</td></tr>\n<tr><td>Ukrainian (Українська)</td><td>uk</td></tr>\n<tr><td>Uzbek (O'zbek)</td><td>uz</td></tr>\n<tr><td>Vietnamese (Việt Nam)</td><td>vn</td></tr>\n<tr><td>Welsh (Cymraeg)</td><td>cy</td></tr>\n</table>\n\n</body>\n</html>\n"
  },
  {
    "path": "docs/settings/settings3.1.html",
    "content": "<!doctype html>\n\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<title>Customizing SumatraPDF 3.1</title>\n<style type=text/css>\nbody {\n    font-size: 90%;\n    background-color: #f5f5f5;\n}\n\n.desc {\n    padding: 0px 10px 0px 10px;\n}\n\n.txt1 {\n    /* bold doesn't look good in the fonts above */\n    font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;\n    font-size: 88%;\n    color: #800; /* this is brown */\n}\n\n.txt2 {\n    font-family: Verdana, Arial, sans-serif;\n    font-family: serif;\n    font-size: 90%;\n    font-weight: bold;\n    color: #800; /* this is brown */\n}\n\n.txt {\n    font-family: serif;\n    font-size: 95%;\n    font-weight: bold;\n    color: #800; /* this is brown */\n    color: #000;\n    background-color: #ececec;\n    border: 1px solid #fff;\n    border-radius: 10px;\n    -webkit-border-radius: 10px;\n    box-shadow: rgba(0, 0, 0, .15) 3px 3px 4px;\n    -webkit-box-shadow: rgba(0, 0, 0, .15) 3px 3px 4px;\n    padding: 10px 10px 10px 20px;\n}\n\n.cm {\n    color: #800;   /* this is brown, a bit aggressive */\n    color: #8c8c8c; /* this is gray */\n    color: #555; /* this is darker gray */\n    font-weight: normal;\n}\n\n</style>\n</head>\n\n<body>\n\n<div class=desc>\n\n<h2>Customizing SumatraPDF 3.1</h2>\n\n<p>You can change the look and behavior of\n<a href=\"http://www.sumatrapdfreader.org/\">SumatraPDF</a>\nby editing the file <code>SumatraPDF-settings.txt</code>. The file is stored in\n<code>%APPDATA%\\SumatraPDF</code> directory for the installed version or in the\nsame directory as <code>SumatraPDF.exe</code> executable for the portable version.</p>\n\n<p>Use the menu item <code>Settings -> Advanced Settings...</code> to open the settings file\nwith your default text editor.</p>\n\n<p>The file is in a simple text format. Below is an explanation of\nwhat the different settings mean and what their default values are.</p>\n\n<p>Highlighted settings can't be changed from the UI. Modifying other settings\ndirectly in this file is not recommended.</p>\n\n<p>If you add or remove lines with square brackets, <b>make sure to always add/remove\nsquare brackets in pairs</b>! Else you risk losing all the data following them.</p>\n\n</div>\n\n<pre class=txt>\n<div><span class=cm id=\"MainWindowBackground\">background <a href=\"#color\">color</a> of the non-document windows, traditionally yellow</span>\nMainWindowBackground = #fff200\n\n<span class=cm id=\"EscToExit\">if true, Esc key closes SumatraPDF</span>\nEscToExit = false\n\n<span class=cm id=\"ReuseInstance\">if true, we'll always open files using existing SumatraPDF process</span>\nReuseInstance = false\n\n<span class=cm id=\"UseSysColors\">if true, we use Windows system <a href=\"#color\">colors</a> for background/text color. Over-rides other settings</span>\nUseSysColors = false\n\n<span class=cm id=\"RestoreSession\">if true and SessionData isn't empty, that session will be restored at startup</span>\nRestoreSession = true\n\n<span class=cm id=\"FixedPageUI\">customization options for PDF, XPS, DjVu and PostScript UI</span>\nFixedPageUI [\n    <span class=cm id=\"FixedPageUI_TextColor\"><a href=\"#color\">color</a> value with which black (text) will be substituted</span>\n    TextColor = #000000\n\n    <span class=cm id=\"FixedPageUI_BackgroundColor\"><a href=\"#color\">color</a> value with which white (background) will be substituted</span>\n    BackgroundColor = #ffffff\n\n    <span class=cm id=\"FixedPageUI_SelectionColor\"><a href=\"#color\">color</a> value for the text selection rectangle (also used to highlight found text) (introduced in \n    version 2.4)</span>\n    SelectionColor = #f5fc0c\n\n    <span class=cm id=\"FixedPageUI_WindowMargin\">top, right, bottom and left margin (in that order) between window and document</span>\n    WindowMargin = 2 4 2 4\n\n    <span class=cm id=\"FixedPageUI_PageSpacing\">horizontal and vertical distance between two pages in facing and book view modes</span>\n    PageSpacing = 4 4\n\n    <span class=cm id=\"FixedPageUI_GradientColors\"><a href=\"#color\">colors</a> to use for the gradient from top to bottom (stops will be inserted at regular intervals \n    throughout the document); currently only up to three <a href=\"#color\">colors</a> are supported; the idea behind this \n    experimental feature is that the background might allow to subconsciously determine reading \n    progress; suggested values: #2828aa #28aa28 #aa2828</span>\n    GradientColors =\n]\n\n<span class=cm id=\"EbookUI\">customization options for eBooks (EPUB, Mobi, FictionBook) UI. If UseFixedPageUI is true, \nFixedPageUI settings apply instead</span>\nEbookUI [\n    <span class=cm id=\"EbookUI_FontName\">name of the font. takes effect after re-opening the document</span>\n    FontName = Georgia\n\n    <span class=cm id=\"EbookUI_FontSize\">size of the font. takes effect after re-opening the document</span>\n    FontSize = 12.5\n\n    <span class=cm id=\"EbookUI_TextColor\"><a href=\"#color\">color</a> for text</span>\n    TextColor = #5f4b32\n\n    <span class=cm id=\"EbookUI_BackgroundColor\"><a href=\"#color\">color</a> of the background (page)</span>\n    BackgroundColor = #fbf0d9\n\n    <span class=cm id=\"EbookUI_UseFixedPageUI\">if true, the UI used for PDF documents will be used for ebooks as well (enables printing and \n    searching, disables automatic reflow)</span>\n    UseFixedPageUI = false\n]\n\n<span class=cm id=\"ComicBookUI\">customization options for Comic Book and images UI</span>\nComicBookUI [\n    <span class=cm id=\"ComicBookUI_WindowMargin\">top, right, bottom and left margin (in that order) between window and document</span>\n    WindowMargin = 0 0 0 0\n\n    <span class=cm id=\"ComicBookUI_PageSpacing\">horizontal and vertical distance between two pages in facing and book view modes</span>\n    PageSpacing = 4 4\n\n    <span class=cm id=\"ComicBookUI_CbxMangaMode\">if true, default to displaying Comic Book files in manga mode (from right to left if showing 2 \n    pages at a time)</span>\n    CbxMangaMode = false\n]\n\n<span class=cm id=\"ChmUI\">customization options for CHM UI. If UseFixedPageUI is true, FixedPageUI settings apply instead</span>\nChmUI [\n    <span class=cm id=\"ChmUI_UseFixedPageUI\">if true, the UI used for PDF documents will be used for CHM documents as well</span>\n    UseFixedPageUI = false\n]\n\n<span class=cm id=\"ExternalViewers\">list of additional external viewers for various file types (can have multiple entries for the same \nformat)</span>\nExternalViewers [\n  [\n    <span class=cm id=\"ExternalViewers_CommandLine\">command line with which to call the external viewer, may contain %p for page numer and \"%1\" for \n    the file name (add quotation marks around paths containing spaces)</span>\n    CommandLine =\n\n    <span class=cm id=\"ExternalViewers_Name\">name of the external viewer to be shown in the menu (implied by CommandLine if missing)</span>\n    Name =\n\n    <span class=cm id=\"ExternalViewers_Filter\">optional filter for which file types the menu item is to be shown; separate multiple entries \n    using ';' and don't include any spaces (e.g. *.pdf;*.xps for all PDF and XPS documents)</span>\n    Filter =\n  ]\n]\n\n<span class=cm id=\"ShowMenubar\">if false, the menu bar will be hidden for all newly opened windows (use F9 to show it until the \nwindow closes or Alt to show it just briefly), only applies if UseTabs is false (introduced in \nversion 2.5)</span>\nShowMenubar = true\n\n<span class=cm id=\"ReloadModifiedDocuments\">if true, a document will be reloaded automatically whenever it's changed (currently doesn't work for \ndocuments shown in the ebook UI) (introduced in version 2.5)</span>\nReloadModifiedDocuments = true\n\n<span class=cm id=\"FullPathInTitle\">if true, we show the full path to a file in the title bar (introduced in version 3.0)</span>\nFullPathInTitle = false\n\n<span class=cm id=\"ZoomLevels\">sequence of zoom levels when zooming in/out; all values must lie between 8.33 and 6400</span>\nZoomLevels = 8.33 12.5 18 25 33.33 50 66.67 75 100 125 150 200 300 400 600 800 1000 1200 1600 2000 2400 3200 4800 6400\n\n<span class=cm id=\"ZoomIncrement\">zoom step size in percents relative to the current zoom level. if zero or negative, the values from \nZoomLevels are used instead</span>\nZoomIncrement = 0\n\n<span class=cm id=\"PrinterDefaults\">these override the default settings in the Print dialog</span>\nPrinterDefaults [\n    <span class=cm id=\"PrinterDefaults_PrintScale\">default value for scaling (shrink, fit, none)</span>\n    PrintScale = shrink\n]\n\n<span class=cm id=\"ForwardSearch\">customization options for how we show forward search results (used from LaTeX editors)</span>\nForwardSearch [\n    <span class=cm id=\"ForwardSearch_HighlightOffset\">when set to a positive value, the forward search highlight style will be changed to a rectangle \n    at the left of the page (with the indicated amount of margin from the page margin)</span>\n    HighlightOffset = 0\n\n    <span class=cm id=\"ForwardSearch_HighlightWidth\">width of the highlight rectangle (if HighlightOffset is > 0)</span>\n    HighlightWidth = 15\n\n    <span class=cm id=\"ForwardSearch_HighlightColor\"><a href=\"#color\">color</a> used for the forward search highlight</span>\n    HighlightColor = #6581ff\n\n    <span class=cm id=\"ForwardSearch_HighlightPermanent\">if true, highlight remains visible until the next mouse click (instead of fading away \n    immediately)</span>\n    HighlightPermanent = false\n]\n\n<span class=cm id=\"DefaultPasswords\">a whitespace separated list of passwords to try when opening a password protected document \n(passwords containing spaces must be quoted) (introduced in version 2.4)</span>\nDefaultPasswords =\n\n<span class=cm id=\"CustomScreenDPI\">actual resolution of the main screen in DPI (if this value isn't positive, the system's UI setting \nis used) (introduced in version 2.5)</span>\nCustomScreenDPI = 0\n</div>\n<span class=cm id=\"RememberStatePerDocument\">if true, we store display settings for each document separately (i.e. everything after \nUseDefaultState in FileStates)</span>\nRememberStatePerDocument = true\n\n<span class=cm id=\"UiLanguage\"><a href=\"langs3.1.html\">ISO code</a> of the current UI language</span>\nUiLanguage =\n\n<span class=cm id=\"ShowToolbar\">if true, we show the toolbar at the top of the window</span>\nShowToolbar = true\n\n<span class=cm id=\"ShowFavorites\">if true, we show the Favorites sidebar</span>\nShowFavorites = false\n\n<span class=cm id=\"AssociatedExtensions\">a list of extensions that SumatraPDF has associated itself with and will reassociate if a different \napplication takes over (e.g. \".pdf .xps .epub\")</span>\nAssociatedExtensions =\n\n<span class=cm id=\"AssociateSilently\">whether file associations should be fixed silently or only after user feedback</span>\nAssociateSilently = false\n\n<span class=cm id=\"CheckForUpdates\">if true, we check once a day if an update is available</span>\nCheckForUpdates = true\n\n<span class=cm id=\"VersionToSkip\">we won't ask again to update to this version</span>\nVersionToSkip =\n\n<span class=cm id=\"RememberOpenedFiles\">if true, we remember which files we opened and their display settings</span>\nRememberOpenedFiles = true\n\n<span class=cm id=\"InverseSearchCmdLine\">pattern used to launch the LaTeX editor when doing inverse search</span>\nInverseSearchCmdLine =\n\n<span class=cm id=\"EnableTeXEnhancements\">if true, we expose the SyncTeX inverse search command line in Settings -> Options</span>\nEnableTeXEnhancements = false\n\n<span class=cm id=\"DefaultDisplayMode\">default layout of pages. valid values: automatic, single page, facing, book view, continuous, \ncontinuous facing, continuous book view</span>\nDefaultDisplayMode = automatic\n\n<span class=cm id=\"DefaultZoom\">default zoom (in %) or one of those values: fit page, fit width, fit content</span>\nDefaultZoom = fit page\n\n<span class=cm id=\"WindowState\">default state of the window. 1 is normal, 2 is maximized, 3 is fullscreen, 4 is minimized</span>\nWindowState = 1\n\n<span class=cm id=\"WindowPos\">default position (x, y) and size (width, height) of the window</span>\nWindowPos = 0 0 0 0\n\n<span class=cm id=\"ShowToc\">if true, we show table of contents (Bookmarks) sidebar if it's present in the document</span>\nShowToc = true\n\n<span class=cm id=\"SidebarDx\">width of favorites/bookmarks sidebar (if shown)</span>\nSidebarDx = 0\n\n<span class=cm id=\"TocDy\">if both favorites and bookmarks parts of sidebar are visible, this is the height of bookmarks (table \nof contents) part</span>\nTocDy = 0\n\n<span class=cm id=\"ShowStartPage\">if true, we show a list of frequently read documents when no document is loaded</span>\nShowStartPage = true\n\n<span class=cm id=\"UseTabs\">if true, documents are opened in tabs instead of new windows (introduced in version 3.0)</span>\nUseTabs = true\n\n<span class=cm id=\"FileStates\">information about opened files (in most recently used order)</span>\nFileStates [\n  [\n    <span class=cm id=\"FileStates_FilePath\">path of the document</span>\n    FilePath =\n\n    <span class=cm id=\"FileStates_Favorites\">Values which are persisted for bookmarks/favorites</span>\n    Favorites [\n      [\n        <span class=cm id=\"Favorites_Name\">name of this favorite as shown in the menu</span>\n        Name =\n\n        <span class=cm id=\"Favorites_PageNo\">number of the bookmarked page</span>\n        PageNo = 0\n\n        <span class=cm id=\"Favorites_PageLabel\">label for this page (only present if logical and physical page numbers are not the same)</span>\n        PageLabel =\n      ]\n    ]\n\n    <span class=cm id=\"FileStates_IsPinned\">a document can be \"pinned\" to the Frequently Read list so that it isn't displaced by recently \n    opened documents</span>\n    IsPinned = false\n\n    <span class=cm id=\"FileStates_IsMissing\">if true, the file is considered missing and won't be shown in any list</span>\n    IsMissing = false\n\n    <span class=cm id=\"FileStates_OpenCount\">number of times this document has been opened recently</span>\n    OpenCount = 0\n\n    <span class=cm id=\"FileStates_DecryptionKey\">data required to open a password protected document without having to ask for the password again</span>\n    DecryptionKey =\n\n    <span class=cm id=\"FileStates_UseDefaultState\">if true, we use global defaults when opening this file (instead of the values below)</span>\n    UseDefaultState = false\n\n    <span class=cm id=\"FileStates_DisplayMode\">layout of pages. valid values: automatic, single page, facing, book view, continuous, continuous \n    facing, continuous book view</span>\n    DisplayMode = automatic\n\n    <span class=cm id=\"FileStates_ScrollPos\">how far this document has been scrolled (in x and y direction)</span>\n    ScrollPos = 0 0\n\n    <span class=cm id=\"FileStates_PageNo\">number of the last read page</span>\n    PageNo = 1\n\n    <span class=cm id=\"FileStates_Zoom\">zoom (in %) or one of those values: fit page, fit width, fit content</span>\n    Zoom = fit page\n\n    <span class=cm id=\"FileStates_Rotation\">how far pages have been rotated as a multiple of 90 degrees</span>\n    Rotation = 0\n\n    <span class=cm id=\"FileStates_WindowState\">state of the window. 1 is normal, 2 is maximized, 3 is fullscreen, 4 is minimized</span>\n    WindowState = 0\n\n    <span class=cm id=\"FileStates_WindowPos\">default position (can be on any monitor)</span>\n    WindowPos = 0 0 0 0\n\n    <span class=cm id=\"FileStates_ShowToc\">if true, we show table of contents (Bookmarks) sidebar if it's present in the document</span>\n    ShowToc = true\n\n    <span class=cm id=\"FileStates_SidebarDx\">width of the left sidebar panel containing the table of contents</span>\n    SidebarDx = 0\n\n    <span class=cm id=\"FileStates_DisplayR2L\">if true, the document is displayed right-to-left in facing and book view modes (only used for \n    comic book documents)</span>\n    DisplayR2L = false\n\n    <span class=cm id=\"FileStates_ReparseIdx\">data required to restore the last read page in the ebook UI</span>\n    ReparseIdx = 0\n\n    <span class=cm id=\"FileStates_TocState\">data required to determine which parts of the table of contents have been expanded</span>\n    TocState =\n  ]\n]\n\n<span class=cm id=\"SessionData\">state of the last session, usage depends on RestoreSession (introduced in version 3.1)</span>\nSessionData [\n  [\n    <span class=cm id=\"SessionData_TabStates\">data required for restoring the view state of a single tab</span>\n    TabStates [\n      [\n        <span class=cm id=\"TabStates_FilePath\">path of the document</span>\n        FilePath =\n\n        <span class=cm id=\"TabStates_DisplayMode\">same as FileStates -> DisplayMode</span>\n        DisplayMode = automatic\n\n        <span class=cm id=\"TabStates_PageNo\">number of the last read page</span>\n        PageNo = 1\n\n        <span class=cm id=\"TabStates_Zoom\">same as FileStates -> Zoom</span>\n        Zoom = fit page\n\n        <span class=cm id=\"TabStates_Rotation\">same as FileStates -> Rotation</span>\n        Rotation = 0\n\n        <span class=cm id=\"TabStates_ScrollPos\">how far this document has been scrolled (in x and y direction)</span>\n        ScrollPos = 0 0\n\n        <span class=cm id=\"TabStates_ShowToc\">if true, the table of contents was shown when the document was closed</span>\n        ShowToc = true\n\n        <span class=cm id=\"TabStates_TocState\">same as FileStates -> TocState</span>\n        TocState =\n      ]\n    ]\n\n    <span class=cm id=\"SessionData_TabIndex\">index of the currently selected tab (1-based)</span>\n    TabIndex = 1\n\n    <span class=cm id=\"SessionData_WindowState\">same as FileState -> WindowState</span>\n    WindowState = 0\n\n    <span class=cm id=\"SessionData_WindowPos\">default position (can be on any monitor)</span>\n    WindowPos = 0 0 0 0\n\n    <span class=cm id=\"SessionData_SidebarDx\">width of favorites/bookmarks sidebar (if shown)</span>\n    SidebarDx = 0\n  ]\n]\n\n<span class=cm id=\"ReopenOnce\">data required for reloading documents after an auto-update (introduced in version 3.0)</span>\nReopenOnce =\n\n<span class=cm id=\"TimeOfLastUpdateCheck\">data required to determine when SumatraPDF last checked for updates</span>\nTimeOfLastUpdateCheck = 0 0\n\n<span class=cm id=\"OpenCountWeek\">value required to determine recency for the OpenCount value in FileStates</span>\nOpenCountWeek = 0\n</pre>\n\n<div class=desc>\n<h3 id=\"color\">Syntax for color values</h3>\n\n<p>\nThe syntax for colors is: <code>#rrggbb</code>.</p>\n<p>The components are hex values (ranging from 00 to FF) and stand for:\n<ul>\n  <li><code>rr</code> : red component</li>\n  <li><code>gg</code> : green component</li>\n  <li><code>bb</code> : blue component</li>\n</ul>\nFor example #ff0000 means red color. You can use <a href=\"http://www.colorpicker.com/\">\nColor Picker</a> or <a href=\"http://mudcu.be/sphere/\">Sphere</a> or\n<a href=\"http://colorschemedesigner.com/\">ColorScheme Designer</a> to pick a color.\n</p>\n</div>\n\n</body>\n</html>\n"
  },
  {
    "path": "docs/settings/settings3.2.html",
    "content": "<!doctype html>\n\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n<title>Customizing SumatraPDF 3.2</title>\n<style type=\"text/css\">\nbody {\n    font-size: 90%;\n    background-color: #f5f5f5;\n}\n\n.desc {\n    padding: 0px 10px 0px 10px;\n}\n\n.txt1 {\n    /* bold doesn't look good in the fonts above */\n    font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;\n    font-size: 88%;\n    color: #800; /* this is brown */\n}\n\n.txt2 {\n    font-family: Verdana, Arial, sans-serif;\n    font-family: serif;\n    font-size: 90%;\n    font-weight: bold;\n    color: #800; /* this is brown */\n}\n\n.txt {\n    font-family: serif;\n    font-size: 95%;\n    font-weight: bold;\n    color: #800; /* this is brown */\n    color: #000;\n    background-color: #ececec;\n    border: 1px solid #fff;\n    border-radius: 10px;\n    -webkit-border-radius: 10px;\n    box-shadow: rgba(0, 0, 0, .15) 3px 3px 4px;\n    -webkit-box-shadow: rgba(0, 0, 0, .15) 3px 3px 4px;\n    padding: 10px 10px 10px 20px;\n}\n\n.cm {\n    color: #800;   /* this is brown, a bit aggressive */\n    color: #8c8c8c; /* this is gray */\n    color: #555; /* this is darker gray */\n    font-weight: normal;\n}\n\n</style>\n</head>\n\n<body>\n\n<div class=\"desc\">\n\n<h2>Customizing SumatraPDF 3.2</h2>\n\n<p>You can change the look and behavior of\n<a href=\"http://www.sumatrapdfreader.org/\">SumatraPDF</a>\nby editing the file <code>SumatraPDF-settings.txt</code>. The file is stored in\n<code>%APPDATA%\\SumatraPDF</code> directory for the installed version or in the\nsame directory as <code>SumatraPDF.exe</code> executable for the portable version.</p>\n\n<p>Use the menu item <code>Settings -> Advanced Settings...</code> to open the settings file\nwith your default text editor.</p>\n\n<p>The file is in a simple text format. Below is an explanation of\nwhat the different settings mean and what their default values are.</p>\n\n<p>Highlighted settings can't be changed from the UI. Modifying other settings\ndirectly in this file is not recommended.</p>\n\n<p>If you add or remove lines with square brackets, <b>make sure to always add/remove\nsquare brackets in pairs</b>! Else you risk losing all the data following them.</p>\n\n</div>\n\n<pre class=\"txt\">\n<div><span class=\"cm\" id=\"MainWindowBackground\">background <a href=\"#color\">color</a> of the non-document windows, traditionally yellow</span>\nMainWindowBackground = #fff200\n\n<span class=\"cm\" id=\"EscToExit\">if true, Esc key closes SumatraPDF</span>\nEscToExit = false\n\n<span class=\"cm\" id=\"ReuseInstance\">if true, we'll always open files using existing SumatraPDF process</span>\nReuseInstance = false\n\n<span class=\"cm\" id=\"UseSysColors\">if true, we use Windows system <a href=\"#color\">colors</a> for background/text color. Over-rides other settings</span>\nUseSysColors = false\n\n<span class=\"cm\" id=\"RestoreSession\">if true and SessionData isn't empty, that session will be restored at startup</span>\nRestoreSession = true\n\n<span class=\"cm\" id=\"FixedPageUI\">customization options for PDF, XPS, DjVu and PostScript UI</span>\nFixedPageUI [\n    <span class=\"cm\" id=\"FixedPageUI_TextColor\"><a href=\"#color\">color</a> value with which black (text) will be substituted</span>\n    TextColor = #000000\n\n    <span class=\"cm\" id=\"FixedPageUI_BackgroundColor\"><a href=\"#color\">color</a> value with which white (background) will be substituted</span>\n    BackgroundColor = #ffffff\n\n    <span class=\"cm\" id=\"FixedPageUI_SelectionColor\"><a href=\"#color\">color</a> value for the text selection rectangle (also used to highlight found text) (introduced in \n    version 2.4)</span>\n    SelectionColor = #f5fc0c\n\n    <span class=\"cm\" id=\"FixedPageUI_WindowMargin\">top, right, bottom and left margin (in that order) between window and document</span>\n    WindowMargin = 2 4 2 4\n\n    <span class=\"cm\" id=\"FixedPageUI_PageSpacing\">horizontal and vertical distance between two pages in facing and book view modes</span>\n    PageSpacing = 4 4\n\n    <span class=\"cm\" id=\"FixedPageUI_GradientColors\"><a href=\"#color\">colors</a> to use for the gradient from top to bottom (stops will be inserted at regular intervals \n    throughout the document); currently only up to three <a href=\"#color\">colors</a> are supported; the idea behind this \n    experimental feature is that the background might allow to subconsciously determine reading \n    progress; suggested values: #2828aa #28aa28 #aa2828</span>\n    GradientColors =\n]\n\n<span class=\"cm\" id=\"EbookUI\">customization options for eBooks (EPUB, Mobi, FictionBook) UI. If UseFixedPageUI is true, \nFixedPageUI settings apply instead</span>\nEbookUI [\n    <span class=\"cm\" id=\"EbookUI_FontName\">name of the font. takes effect after re-opening the document</span>\n    FontName = Georgia\n\n    <span class=\"cm\" id=\"EbookUI_FontSize\">size of the font. takes effect after re-opening the document</span>\n    FontSize = 12.5\n\n    <span class=\"cm\" id=\"EbookUI_TextColor\"><a href=\"#color\">color</a> for text</span>\n    TextColor = #5f4b32\n\n    <span class=\"cm\" id=\"EbookUI_BackgroundColor\"><a href=\"#color\">color</a> of the background (page)</span>\n    BackgroundColor = #fbf0d9\n\n    <span class=\"cm\" id=\"EbookUI_UseFixedPageUI\">if true, the UI used for PDF documents will be used for ebooks as well (enables printing and \n    searching, disables automatic reflow)</span>\n    UseFixedPageUI = false\n]\n\n<span class=\"cm\" id=\"ComicBookUI\">customization options for Comic Book and images UI</span>\nComicBookUI [\n    <span class=\"cm\" id=\"ComicBookUI_WindowMargin\">top, right, bottom and left margin (in that order) between window and document</span>\n    WindowMargin = 0 0 0 0\n\n    <span class=\"cm\" id=\"ComicBookUI_PageSpacing\">horizontal and vertical distance between two pages in facing and book view modes</span>\n    PageSpacing = 4 4\n\n    <span class=\"cm\" id=\"ComicBookUI_CbxMangaMode\">if true, default to displaying Comic Book files in manga mode (from right to left if showing 2 \n    pages at a time)</span>\n    CbxMangaMode = false\n]\n\n<span class=\"cm\" id=\"ChmUI\">customization options for CHM UI. If UseFixedPageUI is true, FixedPageUI settings apply instead</span>\nChmUI [\n    <span class=\"cm\" id=\"ChmUI_UseFixedPageUI\">if true, the UI used for PDF documents will be used for CHM documents as well</span>\n    UseFixedPageUI = false\n]\n\n<span class=\"cm\" id=\"ExternalViewers\">list of additional external viewers for various file types (can have multiple entries for the same \nformat)</span>\nExternalViewers [\n  [\n    <span class=\"cm\" id=\"ExternalViewers_CommandLine\">command line with which to call the external viewer, may contain %p for page numer and \"%1\" for \n    the file name (add quotation marks around paths containing spaces)</span>\n    CommandLine =\n\n    <span class=\"cm\" id=\"ExternalViewers_Name\">name of the external viewer to be shown in the menu (implied by CommandLine if missing)</span>\n    Name =\n\n    <span class=\"cm\" id=\"ExternalViewers_Filter\">optional filter for which file types the menu item is to be shown; separate multiple entries \n    using ';' and don't include any spaces (e.g. *.pdf;*.xps for all PDF and XPS documents)</span>\n    Filter =\n  ]\n]\n\n<span class=\"cm\" id=\"ShowMenubar\">if false, the menu bar will be hidden for all newly opened windows (use F9 to show it until the \nwindow closes or Alt to show it just briefly), only applies if UseTabs is false (introduced in \nversion 2.5)</span>\nShowMenubar = true\n\n<span class=\"cm\" id=\"ReloadModifiedDocuments\">if true, a document will be reloaded automatically whenever it's changed (currently doesn't work for \ndocuments shown in the ebook UI) (introduced in version 2.5)</span>\nReloadModifiedDocuments = true\n\n<span class=\"cm\" id=\"FullPathInTitle\">if true, we show the full path to a file in the title bar (introduced in version 3.0)</span>\nFullPathInTitle = false\n\n<span class=\"cm\" id=\"ZoomLevels\">sequence of zoom levels when zooming in/out; all values must lie between 8.33 and 6400</span>\nZoomLevels = 8.33 12.5 18 25 33.33 50 66.67 75 100 125 150 200 300 400 600 800 1000 1200 1600 2000 2400 3200 4800 6400\n\n<span class=\"cm\" id=\"ZoomIncrement\">zoom step size in percents relative to the current zoom level. if zero or negative, the values from \nZoomLevels are used instead</span>\nZoomIncrement = 0\n\n<span class=\"cm\" id=\"PrinterDefaults\">these override the default settings in the Print dialog</span>\nPrinterDefaults [\n    <span class=\"cm\" id=\"PrinterDefaults_PrintScale\">default value for scaling (shrink, fit, none)</span>\n    PrintScale = shrink\n]\n\n<span class=\"cm\" id=\"ForwardSearch\">customization options for how we show forward search results (used from LaTeX editors)</span>\nForwardSearch [\n    <span class=\"cm\" id=\"ForwardSearch_HighlightOffset\">when set to a positive value, the forward search highlight style will be changed to a rectangle \n    at the left of the page (with the indicated amount of margin from the page margin)</span>\n    HighlightOffset = 0\n\n    <span class=\"cm\" id=\"ForwardSearch_HighlightWidth\">width of the highlight rectangle (if HighlightOffset is &gt; 0)</span>\n    HighlightWidth = 15\n\n    <span class=\"cm\" id=\"ForwardSearch_HighlightColor\"><a href=\"#color\">color</a> used for the forward search highlight</span>\n    HighlightColor = #6581ff\n\n    <span class=\"cm\" id=\"ForwardSearch_HighlightPermanent\">if true, highlight remains visible until the next mouse click (instead of fading away \n    immediately)</span>\n    HighlightPermanent = false\n]\n\n<span class=\"cm\" id=\"DefaultPasswords\">a whitespace separated list of passwords to try when opening a password protected document \n(passwords containing spaces must be quoted) (introduced in version 2.4)</span>\nDefaultPasswords =\n\n<span class=\"cm\" id=\"CustomScreenDPI\">actual resolution of the main screen in DPI (if this value isn't positive, the system's UI setting \nis used) (introduced in version 2.5)</span>\nCustomScreenDPI = 0\n</div>\n<span class=\"cm\" id=\"RememberStatePerDocument\">if true, we store display settings for each document separately (i.e. everything after \nUseDefaultState in FileStates)</span>\nRememberStatePerDocument = true\n\n<span class=\"cm\" id=\"UiLanguage\"><a href=\"langs3.2.html\">ISO code</a> of the current UI language</span>\nUiLanguage =\n\n<span class=\"cm\" id=\"ShowToolbar\">if true, we show the toolbar at the top of the window</span>\nShowToolbar = true\n\n<span class=\"cm\" id=\"ShowFavorites\">if true, we show the Favorites sidebar</span>\nShowFavorites = false\n\n<span class=\"cm\" id=\"AssociatedExtensions\">a list of extensions that SumatraPDF has associated itself with and will reassociate if a different \napplication takes over (e.g. \".pdf .xps .epub\")</span>\nAssociatedExtensions =\n\n<span class=\"cm\" id=\"AssociateSilently\">whether file associations should be fixed silently or only after user feedback</span>\nAssociateSilently = false\n\n<span class=\"cm\" id=\"CheckForUpdates\">if true, we check once a day if an update is available</span>\nCheckForUpdates = true\n\n<span class=\"cm\" id=\"VersionToSkip\">we won't ask again to update to this version</span>\nVersionToSkip =\n\n<span class=\"cm\" id=\"RememberOpenedFiles\">if true, we remember which files we opened and their display settings</span>\nRememberOpenedFiles = true\n\n<span class=\"cm\" id=\"InverseSearchCmdLine\">pattern used to launch the LaTeX editor when doing inverse search</span>\nInverseSearchCmdLine =\n\n<span class=\"cm\" id=\"EnableTeXEnhancements\">if true, we expose the SyncTeX inverse search command line in Settings -&gt; Options</span>\nEnableTeXEnhancements = false\n\n<span class=\"cm\" id=\"DefaultDisplayMode\">default layout of pages. valid values: automatic, single page, facing, book view, continuous, \ncontinuous facing, continuous book view</span>\nDefaultDisplayMode = automatic\n\n<span class=\"cm\" id=\"DefaultZoom\">default zoom (in %) or one of those values: fit page, fit width, fit content</span>\nDefaultZoom = fit page\n\n<span class=\"cm\" id=\"WindowState\">default state of the window. 1 is normal, 2 is maximized, 3 is fullscreen, 4 is minimized</span>\nWindowState = 1\n\n<span class=\"cm\" id=\"WindowPos\">default position (x, y) and size (width, height) of the window</span>\nWindowPos = 0 0 0 0\n\n<span class=\"cm\" id=\"ShowToc\">if true, we show table of contents (Bookmarks) sidebar if it's present in the document</span>\nShowToc = true\n\n<span class=\"cm\" id=\"SidebarDx\">width of favorites/bookmarks sidebar (if shown)</span>\nSidebarDx = 0\n\n<span class=\"cm\" id=\"TocDy\">if both favorites and bookmarks parts of sidebar are visible, this is the height of bookmarks (table \nof contents) part</span>\nTocDy = 0\n\n<span class=\"cm\" id=\"ShowStartPage\">if true, we show a list of frequently read documents when no document is loaded</span>\nShowStartPage = true\n\n<span class=\"cm\" id=\"UseTabs\">if true, documents are opened in tabs instead of new windows (introduced in version 3.0)</span>\nUseTabs = true\n\n<span class=\"cm\" id=\"FileStates\">information about opened files (in most recently used order)</span>\nFileStates [\n  [\n    <span class=\"cm\" id=\"FileStates_FilePath\">path of the document</span>\n    FilePath =\n\n    <span class=\"cm\" id=\"FileStates_Favorites\">Values which are persisted for bookmarks/favorites</span>\n    Favorites [\n      [\n        <span class=\"cm\" id=\"Favorites_Name\">name of this favorite as shown in the menu</span>\n        Name =\n\n        <span class=\"cm\" id=\"Favorites_PageNo\">number of the bookmarked page</span>\n        PageNo = 0\n\n        <span class=\"cm\" id=\"Favorites_PageLabel\">label for this page (only present if logical and physical page numbers are not the same)</span>\n        PageLabel =\n      ]\n    ]\n\n    <span class=\"cm\" id=\"FileStates_IsPinned\">a document can be \"pinned\" to the Frequently Read list so that it isn't displaced by recently \n    opened documents</span>\n    IsPinned = false\n\n    <span class=\"cm\" id=\"FileStates_IsMissing\">if true, the file is considered missing and won't be shown in any list</span>\n    IsMissing = false\n\n    <span class=\"cm\" id=\"FileStates_OpenCount\">number of times this document has been opened recently</span>\n    OpenCount = 0\n\n    <span class=\"cm\" id=\"FileStates_DecryptionKey\">data required to open a password protected document without having to ask for the password again</span>\n    DecryptionKey =\n\n    <span class=\"cm\" id=\"FileStates_UseDefaultState\">if true, we use global defaults when opening this file (instead of the values below)</span>\n    UseDefaultState = false\n\n    <span class=\"cm\" id=\"FileStates_DisplayMode\">layout of pages. valid values: automatic, single page, facing, book view, continuous, continuous \n    facing, continuous book view</span>\n    DisplayMode = automatic\n\n    <span class=\"cm\" id=\"FileStates_ScrollPos\">how far this document has been scrolled (in x and y direction)</span>\n    ScrollPos = 0 0\n\n    <span class=\"cm\" id=\"FileStates_PageNo\">number of the last read page</span>\n    PageNo = 1\n\n    <span class=\"cm\" id=\"FileStates_Zoom\">zoom (in %) or one of those values: fit page, fit width, fit content</span>\n    Zoom = fit page\n\n    <span class=\"cm\" id=\"FileStates_Rotation\">how far pages have been rotated as a multiple of 90 degrees</span>\n    Rotation = 0\n\n    <span class=\"cm\" id=\"FileStates_WindowState\">state of the window. 1 is normal, 2 is maximized, 3 is fullscreen, 4 is minimized</span>\n    WindowState = 0\n\n    <span class=\"cm\" id=\"FileStates_WindowPos\">default position (can be on any monitor)</span>\n    WindowPos = 0 0 0 0\n\n    <span class=\"cm\" id=\"FileStates_ShowToc\">if true, we show table of contents (Bookmarks) sidebar if it's present in the document</span>\n    ShowToc = true\n\n    <span class=\"cm\" id=\"FileStates_SidebarDx\">width of the left sidebar panel containing the table of contents</span>\n    SidebarDx = 0\n\n    <span class=\"cm\" id=\"FileStates_DisplayR2L\">if true, the document is displayed right-to-left in facing and book view modes (only used for \n    comic book documents)</span>\n    DisplayR2L = false\n\n    <span class=\"cm\" id=\"FileStates_ReparseIdx\">data required to restore the last read page in the ebook UI</span>\n    ReparseIdx = 0\n\n    <span class=\"cm\" id=\"FileStates_TocState\">data required to determine which parts of the table of contents have been expanded</span>\n    TocState =\n  ]\n]\n\n<span class=\"cm\" id=\"SessionData\">state of the last session, usage depends on RestoreSession (introduced in version 3.1)</span>\nSessionData [\n  [\n    <span class=\"cm\" id=\"SessionData_TabStates\">data required for restoring the view state of a single tab</span>\n    TabStates [\n      [\n        <span class=\"cm\" id=\"TabStates_FilePath\">path of the document</span>\n        FilePath =\n\n        <span class=\"cm\" id=\"TabStates_DisplayMode\">same as FileStates -&gt; DisplayMode</span>\n        DisplayMode = automatic\n\n        <span class=\"cm\" id=\"TabStates_PageNo\">number of the last read page</span>\n        PageNo = 1\n\n        <span class=\"cm\" id=\"TabStates_Zoom\">same as FileStates -&gt; Zoom</span>\n        Zoom = fit page\n\n        <span class=\"cm\" id=\"TabStates_Rotation\">same as FileStates -&gt; Rotation</span>\n        Rotation = 0\n\n        <span class=\"cm\" id=\"TabStates_ScrollPos\">how far this document has been scrolled (in x and y direction)</span>\n        ScrollPos = 0 0\n\n        <span class=\"cm\" id=\"TabStates_ShowToc\">if true, the table of contents was shown when the document was closed</span>\n        ShowToc = true\n\n        <span class=\"cm\" id=\"TabStates_TocState\">same as FileStates -&gt; TocState</span>\n        TocState =\n      ]\n    ]\n\n    <span class=\"cm\" id=\"SessionData_TabIndex\">index of the currently selected tab (1-based)</span>\n    TabIndex = 1\n\n    <span class=\"cm\" id=\"SessionData_WindowState\">same as FileState -&gt; WindowState</span>\n    WindowState = 0\n\n    <span class=\"cm\" id=\"SessionData_WindowPos\">default position (can be on any monitor)</span>\n    WindowPos = 0 0 0 0\n\n    <span class=\"cm\" id=\"SessionData_SidebarDx\">width of favorites/bookmarks sidebar (if shown)</span>\n    SidebarDx = 0\n  ]\n]\n\n<span class=\"cm\" id=\"ReopenOnce\">data required for reloading documents after an auto-update (introduced in version 3.0)</span>\nReopenOnce =\n\n<span class=\"cm\" id=\"TimeOfLastUpdateCheck\">data required to determine when SumatraPDF last checked for updates</span>\nTimeOfLastUpdateCheck = 0 0\n\n<span class=\"cm\" id=\"OpenCountWeek\">value required to determine recency for the OpenCount value in FileStates</span>\nOpenCountWeek = 0\n</pre>\n\n<div class=\"desc\">\n<h3 id=\"color\">Syntax for color values</h3>\n\n<p>\nThe syntax for colors is: <code>#rrggbb</code>.</p>\n<p>The components are hex values (ranging from 00 to FF) and stand for:\n<ul>\n  <li><code>rr</code> : red component</li>\n  <li><code>gg</code> : green component</li>\n  <li><code>bb</code> : blue component</li>\n</ul>\nFor example #ff0000 means red color. You can use <a href=\"http://www.colorpicker.com/\">\nColor Picker</a> or <a href=\"http://mudcu.be/sphere/\">Sphere</a> or\n<a href=\"http://colorschemedesigner.com/\">ColorScheme Designer</a> to pick a color.\n</p>\n</div>\n\n</body>\n</html>\n"
  },
  {
    "path": "docs/sumatrapdfrestrict.ini",
    "content": "; This is an example configuration file which can be used\n; to disable some of SumatraPDF's functionality.\n\n; To apply this configuration, copy this file into\n; the same directory as SumatraPDF.exe.\n\n; All settings listed below can have a value of either\n; 0 for disabling the feature or 1 for enabling the feature\n; (missing settings default to 0).\n\n[Policies]\n; Whether SumatraPDF should be allowed to access the Internet.\n; Needed for:\n; * Checking for updates\n; * Sending crash reports\nInternetAccess = 1\n\n; Whether SumatraPDF should allow access to the file system.\n; Needed for:\n; * Opening files through dialog\n; * Saving file or bookmark shortcut\n; * Opening a web browser after a click on a hyperlink\n; * Launching external PDF viewers, LaTeX source editors or media players\n; * Displaying Frequently Read page (also requires SavePreferences)\n; * Reopening recently opened files\n; * Print dialog\nDiskAccess = 1\n\n; Whether SumatraPDF should save user preferences on exit.\n; Needed for:\n; * Changing settings\n; * Favorites menu\n; * Remembering recently opened files (includes Frequently Read page)\nSavePreferences = 1\n\n; Whether SumatraPDF should be allowed to write to the Registry.\n; Needed for:\n; * Making SumatraPDF a default PDF viewer\nRegistryAccess = 1\n\n; Whether SumatraPDF should be allowed to print.\n; Needed for:\n; * Printing (parts of) a document\nPrinterAccess = 1\n\n; Whether users should be allowed to select and copy content.\n; Needed for:\n; * Selecting with the mouse\n; * Select all\n; * Copying the selection\nCopySelection = 1\n\n; Whether SumatraPDF should be allowed to cover the entire screen.\n; Needed for:\n; * Fullscreen mode and Presentation mode\nFullscreenAccess = 1\n\n; What protocols for links inside documents should be passed\n; on to the operating system (e.g. for opening a browser).\n; Default: http,https,mailto (web links and email addresses)\nLinkProtocols = http,https,mailto\n\n; What file types should be opened in an external application\n; if they're linked to by a (PDF) document and can't be opened\n; within SumatraPDF itself (use \"*\" for all types)\n; These file types are stored as \"PerceivedType\" in the Registry,\n; common values: audio, video, image, document, text, system\n; Default: audio,video,webpage\nSafeFileTypes = audio,video,webpage\n"
  },
  {
    "path": "docs/wishlist-lua.txt",
    "content": "## Idea\r\n\r\nWrite as much of Sumatra as possible in Lua\r\n\r\n## Why\r\n\r\n1. Writing Sumatra becomes harder and harder due to long compilation times\r\n\r\n2. Writing in Lua would be faster thanks to garbage collection, closures and\r\nother higher-level functionality\r\n\r\n3. As a result of 1, testing different approaches (e.g. to layout system) is\r\ntoo expensive so we don't do it. With lua we could hopefully test various\r\nthings by writing small scripts\r\n\r\n4. We're writing half-assed functionality that Lua would give us for free.\r\n\r\nLayout definitions that we parse from text (EbookWinDesc.txt) could be lua\r\nscript.\r\n\r\nSettings file could be de(serialized) lua data.\r\n\r\nMuiCss.h is a semi-dynamic system that would naturally could be done via lua\r\nobjects.\r\n\r\n5. With lua it would be possible to add new code to running app, without the\r\nlong re-compilation needed with C.\r\n\r\n## How\r\n\r\nThe ultimate goal would be to have lua be the driver and call C functions\r\n(as opposed to C code calling Lua scripts).\r\n\r\nThe road from here to that will be long. Here's a possible approach:\r\n- validate writing UI code with luajit is sensible by writing sample apps.\r\n  In those apps recreate some of the Sumatra functionality.\r\n- write luajit FFI bindings to libraries we use\r\n- integrate luajit and replace some small functionality with lua code\r\n  (e.g. parsing layout definitions)\r\n- everything else\r\n\r\nSuch project would require lots of effort and would take a long time but I'm\r\nvery interested in exploring this approach.\r\n\r\n## References\r\n\r\nLuaJit\r\n. http://luajit.org/\r\n. Because it's faster than Lua and has great FFI which allows calling Windows\r\n  APIs\r\n\r\nMoonScript\r\n . http://moonscript.org\r\n . Because it's much better syntax than Lua (inspired by CoffeeScript) and\r\n   it's fully interoperable with Lua (it compiles to Lua)\r\n\r\nVarious win32 API bindings\r\n https://code.google.com/p/lua-files/source/browse/#hg%2Fwinapi\r\n https://github.com/Wiladams/LJIT2Win32\r\n https://github.com/Wiladams/TINN\r\n"
  },
  {
    "path": "docs/wishlist-tabs.txt",
    "content": "Summary of tab-related work.\r\n\r\nTBD means \"to be designed\" i.e. a decision about the behavior must be made\r\n\r\nMust have:\r\n\r\n. we already are not very good at showing error messages. Need to make sure\r\n  that in the tab world, a failure to load document is shown to the user in some\r\n  way\r\n\r\n. will probably release tabs as 3.0, as it's a big feature\r\n\r\nNice to have:\r\n\r\n. tear-off tabs i.e. move out so that tab can become a window or be moved\r\n  between windows\r\n\r\n. \"start page\" behaves like in chrome i.e. it stays as a tab when we open new\r\n  document (i.e. a document doesn't replace a start page). It can be closed\r\n  manually (and re-appears when last tab in the window is closed). We can\r\n  provide an option to change the behavior (i.e. don't keep \"start page\" as\r\n  a tab as there's argument that if we only have one document in the window,\r\n  we don't have to show tab strip, which saves screen space)\r\n\r\n. save and restore session (opened files when tabs enabled and closing a window\r\n  with multiple tabs). Like chrome.\r\n\r\nDone:\r\n\r\n. TBD: go single-process? Currently we might end up with multiple Sumatra processes.\r\n  Currently it doesn't matter much but if we implement moving tabs between\r\n  windows, it'll be much easier to do it if all windows belong to the same\r\n  process. Otherwise we would have to marshall quite a bit of state across\r\n  processes.\r\n\r\n. tabs must be above all content (i.e. toolbar will be inside the tab) to match\r\n  chrome/firefox and also because when we have tabs in ebook window, tab bar\r\n  would jump around the window since there is no toolbar in ebook window\r\n\r\n. TBD: when a document is loaded as tab, the size of the window over-rides\r\n  the size previously remembered. But should we remember that size or try\r\n  to preserve the size from the time it was the only document in the window?\r\n  Probably remember as otherwise it'll be complicated and the rule would be\r\n  rather magical (which is not a good thing).\r\n\r\n. tab support in ebook window\r\n\r\n"
  },
  {
    "path": "docs/wishlist.txt",
    "content": "A list of random ideas, big and small. In no particular order. Those that are\r\nmarked \"risky\" are likely to cause disturbance to existing code, so should be\r\ndone at the beginning of the dev cycle. I also estimate the complexity (time to\r\nimplement) as low/med/high\r\n\r\n-- fullscreen (low)\r\n\r\nSee if http://stackoverflow.com/questions/2382464/win32-full-screen-and-hiding-taskbar \r\nhas better way of switching to fullscreen\r\n\r\n-- text viewer (high)\r\n\r\nImportant thing: make it work even with gigantic files by limiting how much of\r\nthe file we load in memory (1-10 MB?). We would only build and index for each\r\nline, consisting of:\r\n* position in the file\r\n* length in bytes\r\n* encoding (to support various encodings; but we would start by only supporting\r\nascii/utf8)\r\n* measured size of this line\r\n\r\nWe would build that index for the whole file in the background thread, then\r\nonly load the needed part as the user scrolls through the document.\r\n\r\n-- hex viewer (high)\r\n\r\n-- search for ebook UI (med)\r\n\r\n-- thumbnails (med)\r\n\r\nMany viewers have an option to navigate document via thumbnails.\r\n\r\nFor perf, we could cache thumbnails as a single, webp-encoded image + info\r\nabout where a thumbnail for a given page is within the image (similar to\r\nsprite technique in web dev)\r\n\r\n-- wclang build (med)\r\n\r\nTo get static analysis from clang, use wclang (https://github.com/tpoechtrager/wclang).\r\nWould require writing a makefile and probably code changes to acommodate\r\nmingw winapi headers.\r\n\r\nThen would need another buildbot script (wclang only works on Linux).\r\n\r\n-- toolbar improvements (med, risky)\r\n\r\nDitch using toolbar control for the toolbar and use more mui-like approach.\r\nThat would allow us to have overlaid toolbar (shown semi-transparent over the\r\ncontent). Also we could add an option to make it vertical. Also an option to\r\nhave it user-configurable (via advanced settings, allow specifying the order\r\nof controls in the toolbar).\r\n\r\nThis would also help in unifying full-screen modes (overlaid, auto-hidden\r\ntoolbar is a better match for full-screen mode than the current one).\r\n\r\n-- change fit width mode\r\n\r\nMake all pages have uniform size. Currently they all have uniform zoom ratio\r\nand one big page can make other pages really small.\r\n\r\n-- better looking notifications (med)\r\n\r\nVisual style of notifications is dated. Use more modern look e.g. inspired by\r\nChrome or Android.\r\n\r\n-- loading errors are not always reported (low)\r\n\r\nIn some cases we don't show document loading errors (e.g. drag&drop a file that\r\nfails to load). We need to show them as notifications\r\n\r\n-- more detail when page doesn't render\r\n\r\nI think we sometimes get bug reports when PDF page doesn't render because of\r\nrunning out of memory. It would be good to show the exact cause of page\r\nrendering failure instead of generic \"failed to render\" message.\r\n\r\n-- faster re-layout for ebooks (med, risky)\r\n\r\nLayout time is dominated by measuring strings.\r\n\r\nSplit layout into 2 or 3 phases:\r\n* generate instructions (text fragments, images, font/style changes etc.)\r\n* measure strings, images etc.\r\n* calculating positions of the elements given page dx/dy and break them into pages\r\n\r\nWhen users resizes the window, we would only need to redo phase 3. A small\r\ncomplication: when a string doesn't fit in a single line, we need to split\r\nit into to string instructions. We would need to be able to do it e.g. by\r\nadding a \"compound\" instruction, that just contains one or more other instructions.\r\nThat way the istruction stream would be almost-immutable, and we could turn\r\na e.g. a long string into 2 smaller strings by replacing string instruction with\r\n\"compound\" instructions that points to the original string instructions (so that we\r\ncan undo that in the next layout) and 2 or more substrings.\r\n\r\nChanging default font would require redoing phase 2 and 3.\r\n\r\n-- ebook: re-introduce preserving top of page after re-layout (risky, med)\r\n\r\nThe code to preserve current top of page after re-layout was so complicated\r\nthat I had to remove it in order to implement dual pages in ebook mode.\r\nIt would be nice to bring it back in a saner way and without the problem\r\nof breaking the styling.\r\nIt would be easier if we implement faster re-layout as described above and\r\nhave every element remember its reparse point (instead of having it on a\r\nper-page basis).\r\n\r\nThat way we would generate instructions just once. A page would just be:\r\n(index of first instruction, number of instructions).\r\n\r\nWe could avoid breaking styling because now we have access to the whole instruction\r\nstream and we could quickly scan back instructions from any point to find\r\nformatting instructions and recover current styling.\r\n\r\n-- improve find UI (med, risky)\r\n\r\nThe one I like the best is in Chrome browser (with\r\nmodification needed for specyfing search parameters like case sensitivity\r\nand additions like 'match whole words' modifier). Another nice implementation\r\nis in Kindle PC reader.\r\nWe could then free up significant amount of space in the toolbar.\r\n\r\n-- manual cropping of margins for PDFs (med, risky)\r\n\r\nScreen space is always at premium and most PDFs have very wasteful\r\nmargins. Good Reader has a really nice feature for manual cropping of margins\r\n(http://www.goodiware.com/gr-man-view-pdf.html#crop). They have a mode for\r\nmanually selecting visible part of the PDF, similar to how many graphics\r\nprogram implement cropping. Cropping can be set for all pages or separately\r\nfor odd/even pages. Cropping can also be reset. After cropping, the program\r\nonly shows the non-cropped part. This would be especially valuable for small\r\nscreens (netbooks/small laptops).\r\n\r\nNote: Automatic cropping is currently implemented as \"Fit Content\" View mode.\r\nNote to note: it's similar but not really the same. One big difference is that\r\nwith this style of cropping, for the purpose of layout and display the cropped\r\npart doesn't exist. Fit Content positions the page so that it's out of the view,\r\nbut change zoom and it's really there.\r\nPlus, automatic cropping has limitations. There are many cases where a PDF has\r\nlots of white-space but cannot be cropped because has some small thing there,\r\nlike a page number.\r\n\r\n-- Editing/saving of PDF forms (high)\r\n\r\n-- PDF JavaScript support using mujs (low, risky)\r\n\r\n-- Integration with web-based backup/viewer system (high)\r\n\r\nThe idea is that users could easily backup their PDFs on the server. They would\r\nhave a convenient access to those PDFs from Sumatra as well as being able to\r\nview them on the web. Basically it would be private Scribd for PDFs only. The\r\nweb service would have to be paid (since on-line storage is rather expensive)\r\nbut there would be free accounts (with quota, similar to how Dropbox works).\r\n\r\n-- Direct integration with Dropbox (high)\r\n\r\nThey have APIs. Being able to list, download and read PDF files in Dropbox\r\naccount. Not sure if that makes sense, though, since having Dropbox pretty much\r\nmeans the files are locally anyway.\r\n\r\n-- Integration with Scribd (high)\r\n\r\nAs an alternative (or addition) to Dropbox integration. Being able to search for\r\nPDF documents on Scribd and download/view them in Sumatra. They have APIs\r\n(http://www.scribd.com/developers).\r\n\r\n-- Document library management (high)\r\n\r\nSimilar to how e.g. Picasa manages photos or iTunes anages mp3 files.\r\n\r\nUser would tell us which directories contain PDF and oher supported files\r\n(or, on Win 7, we could use windows search or scan the whole hard-drive to\r\nautomatically find all files). We would index the files (their filenames, metadata,\r\nmaybe extract text for full-text search), build thumbnails and allow efficient\r\nbrowsing/searching those files.\r\n\r\nThis would be a good feature for those who have large collections of PDFs\r\n(compared to using file explorer or open file dialog for locating the file).\r\n\r\n-- Native client version (super high)\r\n\r\nhttps://developers.google.com/native-client/.\r\nThere are some challenges (need completely custom UI, fonts aren't as easy\r\nto get at, CHM support would be much harder). The upside is we would have\r\nno-install, browser hosted (well, at least in Chrome) app.\r\n\r\n-- mac version (super high)\r\n\r\n-- use SafeInt (low)\r\n\r\nWe have quite a few places where we do integer overflow checks. Explore\r\ndoing that in a systematic way, using SafeInt (http://safeint.codeplex.com/) or\r\nsimilar library (or extract useful stuff for us from SafeInt)\r\n\r\n-- use pdfium (high)\r\n\r\nGoogle released https://pdfium.googlesource.com/pdfium/ which is Foxit codebase\r\nunder BSD license.\r\n\r\nIt would probably be a bunch of work to integrate this (although at first it\r\ncould be done alongside mupdf, since we have necessary abstractions to plug\r\nanother engine). So that's the downside.\r\n\r\nI've briefly looked at the code and it might have some benefits over mupdf:\r\n* they have hooks for form editing (which should make implementing this much\r\n  easier)\r\n* their priting code looks more efficient\r\n* they probably support some of the more advanced PDF features\r\n* they are probably faster and (thanks to Google) more secure\r\n"
  },
  {
    "path": "drmem-sup.txt",
    "content": "# Supressions for DrMemory\r\n# Run as:  ..\\drmemory\\bin\\drmemory.exe -suppress drmem-sup.txt -- .\\rel\\SumatraPDF.exe\r\n# Probably needs to be updated for different OS versions\r\n# quite a few false positives come from inside __scrt_common_main_seh\r\n#\r\n# Suppression for startup code\r\nUNINITIALIZED READ\r\nname=crt startup issues\r\n...\r\nSumatraPDF.exe!__scrt_common_main_seh\r\n\r\n# wcslen in crt startup\r\nUNADDRESSABLE ACCESS\r\nname=wcslen in crt startup\r\nSumatraPDF.exe!wcsnlen\r\n...\r\nSumatraPDF.exe!__scrt_common_main_seh\r\nKERNEL32.dll!BaseThreadInitThunk\r\n\r\n# wcslen from str::FmtV\r\nUNADDRESSABLE ACCESS\r\nname=wcslen from FmtV\r\nSumatraPDF.exe!wcsnlen\r\n...\r\nSumatraPDF.exe!str::FmtV\r\n\r\n# parallels driver\r\nUNINITIALIZED READ\r\nname=parallels driver\r\n...\r\nPrlToolsShellExt.dll!*\r\n\r\n# GetLocaleInfoW\r\nUNINITIALIZED READ\r\nname=GetLocaleInfoW\r\n...\r\nSumatraPDF.exe!GetMeasurementSystem\r\n\r\n# GetUserInfoWord\r\nUNINITIALIZED READ\r\nname=GetUserInfoWord\r\nKERNELBASE.dll!GetUserInfoWord\r\n...\r\nSumatraPDF.exe!FormatSystemTime\r\n\r\n# GetDateFormatW from kernelbase.dll and kernel32.dll\r\nUNINITIALIZED READ\r\nname=GetDateFormatW\r\n*!GetDateFormatW\r\n...\r\nSumatraPDF.exe!FormatSystemTime\r\n\r\n# GetUserInfo\r\nUNINITIALIZED READ\r\nname=GetUserInfo\r\nKERNELBASE.dll!GetUserInfo\r\n\r\n# weird leak\r\nLEAK\r\nname=weird leak\r\n...\r\nSumatraPDF.exe!pre_c_initialization\r\n\r\n# ddjvu_context_create\r\nUNINITIALIZED READ\r\nname=ddjvu_context_create\r\n...\r\nSumatraPDF.exe!ddjvu_context_create\r\n\r\n# ddjvu_context_create #2\r\nUNADDRESSABLE ACCESS\r\nname=ddjvu_context_create #2\r\n...\r\nSumatraPDF.exe!ddjvu_context_create\r\n"
  },
  {
    "path": "ext/CHMLib/AUTHORS",
    "content": "Jed Wing <jedwin@ugcs.caltech.edu>\nincludes modified LZX code from cabextract-0.5 by Stuart Caie.\n\nThanks to:\n   iDEFENSE for reporting the stack overflow vulnerability.\n   Palasik Sandor for reporting and fixing the LZX buffer overrun vulnerability.\n   David Huseby for enhancements to the chm_enumerate functionality.\n   Vitaly Bursov for compilation fixes for x86-64.\n   Vadim Zeitlin for a patch to clean up and fix some deficiencies in the\n            configure script.\n   Stan Tobias for bugfixes and index-page improvement to chm_http.\n   Andrew Hodgetts for major portability improvement.\n   Rich Erwin for his work towards Windows CE support.\n   Pabs for bug fixes and suggestions.\n   Antony Dovgal for setting up autoconf/automake based build process.\n   Ragnar Hojland Espinosa for patches to make chm_http more useful.\n   Razvan Cojocaru for forwarding along information regarding building on OS X.\n   Anyone else I've forgotten.\n"
  },
  {
    "path": "ext/CHMLib/COPYING",
    "content": "\n                  GNU LESSER GENERAL PUBLIC LICENSE\n                       Version 2.1, February 1999\n\n Copyright (C) 1991, 1999 Free Software Foundation, Inc.\n     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n[This is the first released version of the Lesser GPL.  It also counts\n as the successor of the GNU Library Public License, version 2, hence\n the version number 2.1.]\n\n                            Preamble\n\n  The licenses for most software are designed to take away your\nfreedom to share and change it.  By contrast, the GNU General Public\nLicenses are intended to guarantee your freedom to share and change\nfree software--to make sure the software is free for all its users.\n\n  This license, the Lesser General Public License, applies to some\nspecially designated software packages--typically libraries--of the\nFree Software Foundation and other authors who decide to use it.  You\ncan use it too, but we suggest you first think carefully about whether\nthis license or the ordinary General Public License is the better\nstrategy to use in any particular case, based on the explanations\nbelow.\n\n  When we speak of free software, we are referring to freedom of use,\nnot price.  Our General Public Licenses are designed to make sure that\nyou have the freedom to distribute copies of free software (and charge\nfor this service if you wish); that you receive source code or can get\nit if you want it; that you can change the software and use pieces of\nit in new free programs; and that you are informed that you can do\nthese things.\n\n  To protect your rights, we need to make restrictions that forbid\ndistributors to deny you these rights or to ask you to surrender these\nrights.  These restrictions translate to certain responsibilities for\nyou if you distribute copies of the library or if you modify it.\n\n  For example, if you distribute copies of the library, whether gratis\nor for a fee, you must give the recipients all the rights that we gave\nyou.  You must make sure that they, too, receive or can get the source\ncode.  If you link other code with the library, you must provide\ncomplete object files to the recipients, so that they can relink them\nwith the library after making changes to the library and recompiling\nit.  And you must show them these terms so they know their rights.\n\n  We protect your rights with a two-step method: (1) we copyright the\nlibrary, and (2) we offer you this license, which gives you legal\npermission to copy, distribute and/or modify the library.\n\n  To protect each distributor, we want to make it very clear that\nthere is no warranty for the free library.  Also, if the library is\nmodified by someone else and passed on, the recipients should know\nthat what they have is not the original version, so that the original\nauthor's reputation will not be affected by problems that might be\nintroduced by others.\n^L\n  Finally, software patents pose a constant threat to the existence of\nany free program.  We wish to make sure that a company cannot\neffectively restrict the users of a free program by obtaining a\nrestrictive license from a patent holder.  Therefore, we insist that\nany patent license obtained for a version of the library must be\nconsistent with the full freedom of use specified in this license.\n\n  Most GNU software, including some libraries, is covered by the\nordinary GNU General Public License.  This license, the GNU Lesser\nGeneral Public License, applies to certain designated libraries, and\nis quite different from the ordinary General Public License.  We use\nthis license for certain libraries in order to permit linking those\nlibraries into non-free programs.\n\n  When a program is linked with a library, whether statically or using\na shared library, the combination of the two is legally speaking a\ncombined work, a derivative of the original library.  The ordinary\nGeneral Public License therefore permits such linking only if the\nentire combination fits its criteria of freedom.  The Lesser General\nPublic License permits more lax criteria for linking other code with\nthe library.\n\n  We call this license the \"Lesser\" General Public License because it\ndoes Less to protect the user's freedom than the ordinary General\nPublic License.  It also provides other free software developers Less\nof an advantage over competing non-free programs.  These disadvantages\nare the reason we use the ordinary General Public License for many\nlibraries.  However, the Lesser license provides advantages in certain\nspecial circumstances.\n\n  For example, on rare occasions, there may be a special need to\nencourage the widest possible use of a certain library, so that it\nbecomes a de-facto standard.  To achieve this, non-free programs must\nbe allowed to use the library.  A more frequent case is that a free\nlibrary does the same job as widely used non-free libraries.  In this\ncase, there is little to gain by limiting the free library to free\nsoftware only, so we use the Lesser General Public License.\n\n  In other cases, permission to use a particular library in non-free\nprograms enables a greater number of people to use a large body of\nfree software.  For example, permission to use the GNU C Library in\nnon-free programs enables many more people to use the whole GNU\noperating system, as well as its variant, the GNU/Linux operating\nsystem.\n\n  Although the Lesser General Public License is Less protective of the\nusers' freedom, it does ensure that the user of a program that is\nlinked with the Library has the freedom and the wherewithal to run\nthat program using a modified version of the Library.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.  Pay close attention to the difference between a\n\"work based on the library\" and a \"work that uses the library\".  The\nformer contains code derived from the library, whereas the latter must\nbe combined with the library in order to run.\n^L\n                  GNU LESSER GENERAL PUBLIC LICENSE\n   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n\n  0. This License Agreement applies to any software library or other\nprogram which contains a notice placed by the copyright holder or\nother authorized party saying it may be distributed under the terms of\nthis Lesser General Public License (also called \"this License\").\nEach licensee is addressed as \"you\".\n\n  A \"library\" means a collection of software functions and/or data\nprepared so as to be conveniently linked with application programs\n(which use some of those functions and data) to form executables.\n\n  The \"Library\", below, refers to any such software library or work\nwhich has been distributed under these terms.  A \"work based on the\nLibrary\" means either the Library or any derivative work under\ncopyright law: that is to say, a work containing the Library or a\nportion of it, either verbatim or with modifications and/or translated\nstraightforwardly into another language.  (Hereinafter, translation is\nincluded without limitation in the term \"modification\".)\n\n  \"Source code\" for a work means the preferred form of the work for\nmaking modifications to it.  For a library, complete source code means\nall the source code for all modules it contains, plus any associated\ninterface definition files, plus the scripts used to control\ncompilation and installation of the library.\n\n  Activities other than copying, distribution and modification are not\ncovered by this License; they are outside its scope.  The act of\nrunning a program using the Library is not restricted, and output from\nsuch a program is covered only if its contents constitute a work based\non the Library (independent of the use of the Library in a tool for\nwriting it).  Whether that is true depends on what the Library does\nand what the program that uses the Library does.\n\n  1. You may copy and distribute verbatim copies of the Library's\ncomplete source code as you receive it, in any medium, provided that\nyou conspicuously and appropriately publish on each copy an\nappropriate copyright notice and disclaimer of warranty; keep intact\nall the notices that refer to this License and to the absence of any\nwarranty; and distribute a copy of this License along with the\nLibrary.\n\n  You may charge a fee for the physical act of transferring a copy,\nand you may at your option offer warranty protection in exchange for a\nfee.\n\f\n  2. You may modify your copy or copies of the Library or any portion\nof it, thus forming a work based on the Library, and copy and\ndistribute such modifications or work under the terms of Section 1\nabove, provided that you also meet all of these conditions:\n\n    a) The modified work must itself be a software library.\n\n    b) You must cause the files modified to carry prominent notices\n    stating that you changed the files and the date of any change.\n\n    c) You must cause the whole of the work to be licensed at no\n    charge to all third parties under the terms of this License.\n\n    d) If a facility in the modified Library refers to a function or a\n    table of data to be supplied by an application program that uses\n    the facility, other than as an argument passed when the facility\n    is invoked, then you must make a good faith effort to ensure that,\n    in the event an application does not supply such function or\n    table, the facility still operates, and performs whatever part of\n    its purpose remains meaningful.\n\n    (For example, a function in a library to compute square roots has\n    a purpose that is entirely well-defined independent of the\n    application.  Therefore, Subsection 2d requires that any\n    application-supplied function or table used by this function must\n    be optional: if the application does not supply it, the square\n    root function must still compute square roots.)\n\nThese requirements apply to the modified work as a whole.  If\nidentifiable sections of that work are not derived from the Library,\nand can be reasonably considered independent and separate works in\nthemselves, then this License, and its terms, do not apply to those\nsections when you distribute them as separate works.  But when you\ndistribute the same sections as part of a whole which is a work based\non the Library, the distribution of the whole must be on the terms of\nthis License, whose permissions for other licensees extend to the\nentire whole, and thus to each and every part regardless of who wrote\nit.\n\nThus, it is not the intent of this section to claim rights or contest\nyour rights to work written entirely by you; rather, the intent is to\nexercise the right to control the distribution of derivative or\ncollective works based on the Library.\n\nIn addition, mere aggregation of another work not based on the Library\nwith the Library (or with a work based on the Library) on a volume of\na storage or distribution medium does not bring the other work under\nthe scope of this License.\n\n  3. You may opt to apply the terms of the ordinary GNU General Public\nLicense instead of this License to a given copy of the Library.  To do\nthis, you must alter all the notices that refer to this License, so\nthat they refer to the ordinary GNU General Public License, version 2,\ninstead of to this License.  (If a newer version than version 2 of the\nordinary GNU General Public License has appeared, then you can specify\nthat version instead if you wish.)  Do not make any other change in\nthese notices.\n^L\n  Once this change is made in a given copy, it is irreversible for\nthat copy, so the ordinary GNU General Public License applies to all\nsubsequent copies and derivative works made from that copy.\n\n  This option is useful when you wish to copy part of the code of\nthe Library into a program that is not a library.\n\n  4. You may copy and distribute the Library (or a portion or\nderivative of it, under Section 2) in object code or executable form\nunder the terms of Sections 1 and 2 above provided that you accompany\nit with the complete corresponding machine-readable source code, which\nmust be distributed under the terms of Sections 1 and 2 above on a\nmedium customarily used for software interchange.\n\n  If distribution of object code is made by offering access to copy\nfrom a designated place, then offering equivalent access to copy the\nsource code from the same place satisfies the requirement to\ndistribute the source code, even though third parties are not\ncompelled to copy the source along with the object code.\n\n  5. A program that contains no derivative of any portion of the\nLibrary, but is designed to work with the Library by being compiled or\nlinked with it, is called a \"work that uses the Library\".  Such a\nwork, in isolation, is not a derivative work of the Library, and\ntherefore falls outside the scope of this License.\n\n  However, linking a \"work that uses the Library\" with the Library\ncreates an executable that is a derivative of the Library (because it\ncontains portions of the Library), rather than a \"work that uses the\nlibrary\".  The executable is therefore covered by this License.\nSection 6 states terms for distribution of such executables.\n\n  When a \"work that uses the Library\" uses material from a header file\nthat is part of the Library, the object code for the work may be a\nderivative work of the Library even though the source code is not.\nWhether this is true is especially significant if the work can be\nlinked without the Library, or if the work is itself a library.  The\nthreshold for this to be true is not precisely defined by law.\n\n  If such an object file uses only numerical parameters, data\nstructure layouts and accessors, and small macros and small inline\nfunctions (ten lines or less in length), then the use of the object\nfile is unrestricted, regardless of whether it is legally a derivative\nwork.  (Executables containing this object code plus portions of the\nLibrary will still fall under Section 6.)\n\n  Otherwise, if the work is a derivative of the Library, you may\ndistribute the object code for the work under the terms of Section 6.\nAny executables containing that work also fall under Section 6,\nwhether or not they are linked directly with the Library itself.\n^L\n  6. As an exception to the Sections above, you may also combine or\nlink a \"work that uses the Library\" with the Library to produce a\nwork containing portions of the Library, and distribute that work\nunder terms of your choice, provided that the terms permit\nmodification of the work for the customer's own use and reverse\nengineering for debugging such modifications.\n\n  You must give prominent notice with each copy of the work that the\nLibrary is used in it and that the Library and its use are covered by\nthis License.  You must supply a copy of this License.  If the work\nduring execution displays copyright notices, you must include the\ncopyright notice for the Library among them, as well as a reference\ndirecting the user to the copy of this License.  Also, you must do one\nof these things:\n\n    a) Accompany the work with the complete corresponding\n    machine-readable source code for the Library including whatever\n    changes were used in the work (which must be distributed under\n    Sections 1 and 2 above); and, if the work is an executable linked\n    with the Library, with the complete machine-readable \"work that\n    uses the Library\", as object code and/or source code, so that the\n    user can modify the Library and then relink to produce a modified\n    executable containing the modified Library.  (It is understood\n    that the user who changes the contents of definitions files in the\n    Library will not necessarily be able to recompile the application\n    to use the modified definitions.)\n\n    b) Use a suitable shared library mechanism for linking with the\n    Library.  A suitable mechanism is one that (1) uses at run time a\n    copy of the library already present on the user's computer system,\n    rather than copying library functions into the executable, and (2)\n    will operate properly with a modified version of the library, if\n    the user installs one, as long as the modified version is\n    interface-compatible with the version that the work was made with.\n\n    c) Accompany the work with a written offer, valid for at least\n    three years, to give the same user the materials specified in\n    Subsection 6a, above, for a charge no more than the cost of\n    performing this distribution.\n\n    d) If distribution of the work is made by offering access to copy\n    from a designated place, offer equivalent access to copy the above\n    specified materials from the same place.\n\n    e) Verify that the user has already received a copy of these\n    materials or that you have already sent this user a copy.\n\n  For an executable, the required form of the \"work that uses the\nLibrary\" must include any data and utility programs needed for\nreproducing the executable from it.  However, as a special exception,\nthe materials to be distributed need not include anything that is\nnormally distributed (in either source or binary form) with the major\ncomponents (compiler, kernel, and so on) of the operating system on\nwhich the executable runs, unless that component itself accompanies\nthe executable.\n\n  It may happen that this requirement contradicts the license\nrestrictions of other proprietary libraries that do not normally\naccompany the operating system.  Such a contradiction means you cannot\nuse both them and the Library together in an executable that you\ndistribute.\n^L\n  7. You may place library facilities that are a work based on the\nLibrary side-by-side in a single library together with other library\nfacilities not covered by this License, and distribute such a combined\nlibrary, provided that the separate distribution of the work based on\nthe Library and of the other library facilities is otherwise\npermitted, and provided that you do these two things:\n\n    a) Accompany the combined library with a copy of the same work\n    based on the Library, uncombined with any other library\n    facilities.  This must be distributed under the terms of the\n    Sections above.\n\n    b) Give prominent notice with the combined library of the fact\n    that part of it is a work based on the Library, and explaining\n    where to find the accompanying uncombined form of the same work.\n\n  8. You may not copy, modify, sublicense, link with, or distribute\nthe Library except as expressly provided under this License.  Any\nattempt otherwise to copy, modify, sublicense, link with, or\ndistribute the Library is void, and will automatically terminate your\nrights under this License.  However, parties who have received copies,\nor rights, from you under this License will not have their licenses\nterminated so long as such parties remain in full compliance.\n\n  9. You are not required to accept this License, since you have not\nsigned it.  However, nothing else grants you permission to modify or\ndistribute the Library or its derivative works.  These actions are\nprohibited by law if you do not accept this License.  Therefore, by\nmodifying or distributing the Library (or any work based on the\nLibrary), you indicate your acceptance of this License to do so, and\nall its terms and conditions for copying, distributing or modifying\nthe Library or works based on it.\n\n  10. Each time you redistribute the Library (or any work based on the\nLibrary), the recipient automatically receives a license from the\noriginal licensor to copy, distribute, link with or modify the Library\nsubject to these terms and conditions.  You may not impose any further\nrestrictions on the recipients' exercise of the rights granted herein.\nYou are not responsible for enforcing compliance by third parties with\nthis License.\n^L\n  11. If, as a consequence of a court judgment or allegation of patent\ninfringement or for any other reason (not limited to patent issues),\nconditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot\ndistribute so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you\nmay not distribute the Library at all.  For example, if a patent\nlicense would not permit royalty-free redistribution of the Library by\nall those who receive copies directly or indirectly through you, then\nthe only way you could satisfy both it and this License would be to\nrefrain entirely from distribution of the Library.\n\nIf any portion of this section is held invalid or unenforceable under\nany particular circumstance, the balance of the section is intended to\napply, and the section as a whole is intended to apply in other\ncircumstances.\n\nIt is not the purpose of this section to induce you to infringe any\npatents or other property right claims or to contest validity of any\nsuch claims; this section has the sole purpose of protecting the\nintegrity of the free software distribution system which is\nimplemented by public license practices.  Many people have made\ngenerous contributions to the wide range of software distributed\nthrough that system in reliance on consistent application of that\nsystem; it is up to the author/donor to decide if he or she is willing\nto distribute software through any other system and a licensee cannot\nimpose that choice.\n\nThis section is intended to make thoroughly clear what is believed to\nbe a consequence of the rest of this License.\n\n  12. If the distribution and/or use of the Library is restricted in\ncertain countries either by patents or by copyrighted interfaces, the\noriginal copyright holder who places the Library under this License\nmay add an explicit geographical distribution limitation excluding those\ncountries, so that distribution is permitted only in or among\ncountries not thus excluded.  In such case, this License incorporates\nthe limitation as if written in the body of this License.\n\n  13. The Free Software Foundation may publish revised and/or new\nversions of the Lesser General Public License from time to time.\nSuch new versions will be similar in spirit to the present version,\nbut may differ in detail to address new problems or concerns.\n\nEach version is given a distinguishing version number.  If the Library\nspecifies a version number of this License which applies to it and\n\"any later version\", you have the option of following the terms and\nconditions either of that version or of any later version published by\nthe Free Software Foundation.  If the Library does not specify a\nlicense version number, you may choose any version ever published by\nthe Free Software Foundation.\n^L\n  14. If you wish to incorporate parts of the Library into other free\nprograms whose distribution conditions are incompatible with these,\nwrite to the author to ask for permission.  For software which is\ncopyrighted by the Free Software Foundation, write to the Free\nSoftware Foundation; we sometimes make exceptions for this.  Our\ndecision will be guided by the two goals of preserving the free status\nof all derivatives of our free software and of promoting the sharing\nand reuse of software generally.\n\n                            NO WARRANTY\n\n  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO\nWARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.\nEXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR\nOTHER PARTIES PROVIDE THE LIBRARY \"AS IS\" WITHOUT WARRANTY OF ANY\nKIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE\nLIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME\nTHE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN\nWRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY\nAND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU\nFOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR\nCONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE\nLIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING\nRENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A\nFAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF\nSUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH\nDAMAGES.\n\n                     END OF TERMS AND CONDITIONS\n^L\n           How to Apply These Terms to Your New Libraries\n\n  If you develop a new library, and you want it to be of the greatest\npossible use to the public, we recommend making it free software that\neveryone can redistribute and change.  You can do so by permitting\nredistribution under these terms (or, alternatively, under the terms\nof the ordinary General Public License).\n\n  To apply these terms, attach the following notices to the library.\nIt is safest to attach them to the start of each source file to most\neffectively convey the exclusion of warranty; and each file should\nhave at least the \"copyright\" line and a pointer to where the full\nnotice is found.\n\n\n    <one line to give the library's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This library is free software; you can redistribute it and/or\n    modify it under the terms of the GNU Lesser General Public\n    License as published by the Free Software Foundation; either\n    version 2.1 of the License, or (at your option) any later version.\n\n    This library is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n    Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public\n    License along with this library; if not, write to the Free Software\n    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA\n\nAlso add information on how to contact you by electronic and paper mail.\n\nYou should also get your employer (if you work as a programmer) or\nyour school, if any, to sign a \"copyright disclaimer\" for the library,\nif necessary.  Here is a sample; alter the names:\n\n  Yoyodyne, Inc., hereby disclaims all copyright interest in the\n  library `Frob' (a library for tweaking knobs) written by James\n  Random Hacker.\n\n  <signature of Ty Coon>, 1 April 1990\n  Ty Coon, President of Vice\n\nThat's all there is to it!\n\n\n"
  },
  {
    "path": "ext/CHMLib/NEWS",
    "content": "Changes from 0.39 to 0.40\n    - chm_http bug fixed (chm_http begins to refuse connections)\n    - bashism in contrib/mozilla_helper.sh\n    - patch to use stdint.h (from Goswin von Brederlow)\n    - patch to fix soname (from Julien Lemoine, via Kartik Mistry)\n    - fix for extract_chmLib with empty files (from Paul Wise)\n\nChanges from 0.38 to 0.39\n    - Security fix: eliminated all uses of alloca and similar, in favor of\n      malloc/free.  This was in response to an iDefense security advisory.\n    - Added autoconf/automake support (patch from Antony Dovgal)\n    - Added contrib/mozilla_helper.sh from Kyle Davenport\n\nChanges from 0.37 to 0.38\n    - Fix for reading some chm files.  Running over a large directory of chm\n      files, about 1% of them turned out to be unreadable.  This resulted from\n      an incomplete understanding of one of the header fields (index_root).\n      Apparently, this can take negative values other than -1.\n\n    - Security fix for extract_chmLib.  Pathnames containing a \"..\" element\n      will not be extracted.  There doesn't seem to be a legitimate reason to\n      use \"..\" as a path element in a chm file.\n\nChanges from 0.36 to 0.37\n    - Major security fix for stack overflow vulnerability:\n        http://www.sven-tantau.de/public_files/chmlib/chmlib_20051126.txt\n    - Corrected the broken Makefile.in.\n\nChanges from 0.35 to 0.36\n    - Major security fix (iDEFENSE Security Advisory IDEF1099 - Stack Overflow\n      Vulnerability)\n    - Major security fix from Palasik Sandor (LZX decompression buffer overrun)\n    - Bugfix/enhancement from David Huseby to make the \"what\" flags to\n      chm_enumerate work correctly, and to pass the flags along to the callback\n      function (via the chmUnitInfo structure) so that the callback doesn't\n      need to re-parse the filename.\n    - Compilation fixes for x86-64 from Vitaly V. Bursov.\n    - Miscellaneous fixes to the configure script, including some significant\n      cleanup by Vadim Zeitlin.  The changes from Vadim should also allow the\n      configure script to correctly configure the build on OS X, where it was\n      previously failing to note that pread64 doesn't work.\n    - Minor update to the Makefile.in to do a mkdir before the install, in case\n      the specified INSTALLPREFIX directory is non-existent\n\nChanges from 0.32 to 0.35\n    - UTF-8 filenames, while still not handled correctly, are handled a little\n      more gracefully.  That is to say, the library doesn't fail to open files\n      with filenames using characters outside the ASCII subset.  I'm very\n      interested in any information as to the \"right\" way to handle filenames\n      of this sort.\n    - Files not containing a compressed section are handled properly, such as\n      .chw files.  These files seem to contain information about compression,\n      but the information is invalid or empty.  The library deals gracefully\n      with this now.\n    - Files compressed with different options were not being decompressed\n      properly.  In particular, if the \"reset interval\" for the compressed\n      section was other than 2 block sizes, it could fail to read some of the\n      files.\n    - The caching system was improved slightly, in conjunction with this\n      previous bugfix.\n\nChanges from 0.3 to 0.32:\n    - [Rich Erwin] Minor portability fixes for Windows CE.\n    - [Pabs] Minor bugfix regarding detecting directory entries versus empty files.\n    - [Antony Dovgal] autoconf-based build process\n    - [Ragnar Hojland Espinosa] Feature additions for chm_http:\n        * Use SO_REUSEADDR\n        * Allow --bind= and --port= command line arguments\n    - Simple makefile has been fixed (finally) to use gcc instead of gcc-3.2.  (Sorry, everybody!)\n\nChanges from 0.2 to 0.3:\n\n    - initial attempt at portability to Win32.\n    - bugfixes from Stan Tobias:\n        * memory corruption error with caching system\n        * case insensitivity, to match with the Windows semantics\n    - modification to chm_http by Stan Tobias:\n        * when the user requests the page '/', they get a page with links to\n          all of the files in the archive\n    - Andrew Hodgetts has ported the library to Solaris and Irix.  See README for details.\n    - Stuart Caie has granted permission to relicense under the LGPL.\n"
  },
  {
    "path": "ext/CHMLib/NOTES",
    "content": "CHMLIB 0.40 Installation\n=======================\n\n-----\nLinux/Unix and Windows (Cygwin)\n-----\n\nI. Relevant options:\n\n   CHM_MT:              build library with synchronization for thread-safety\n   CHM_USE_PREAD:       use pread instead of lseek/read\n   CHM_USE_IO64:        support 64-bit file I/O\n\n   Modify the INSTALLPREFIX to change the installation location.\n\n    Except on platforms where they need to be disabled, I recommend leaving all\n    three options enabled.  OS X, however, in particular, seems to need pread\n    and io64 disabled.\n\nII. autoconf/automake-style build\n\n    ./configure [options]\n    make\n    su\n    make install\n\nIII. old-style (plain Makefile) build\n\n    cd src\n    <edit Makefile.simple if necessary>\n    make -f Makefile.old\n    su\n    make install\n\nTo use the library, see chm_lib.h, and the included example programs:\n\n    test_chmLib.c\n    enum_chmLib.c\n    chm_http.c\n\n-------\nWindows (MSVC++, Win CE SDK)\n-------\n\nI. Relevant options:\n\n   CHM_MT:              build library with synchronization for thread-safety\n\nII. Windows Standard Build\n\n    Unzip ChmLib-vs6.zip in the src directory, and open the ChmLib.dsw file in\n    Developer Studio.  (This was developed on Developer Studio 6.  I don't know\n    if that matters.)  You may wish to enable or disable certain features by\n    adding preprocessor defines under the project settings dialog:\n\n   CHM_MT:              build library with synchronization for thread-safety\n\n   CHM_MT is enabled by default in the Windows build.\n\n   The resultant library is called chmlib.lib.\n\n   To use the library, see chm_lib.h, and the included example programs:\n\n    test_chmLib.c\n    enum_chmLib.c\n    chm_http.c\n\n  The example programs should also show up in the Visual Studio workspace,\n  except for chm_http.  I don't know enough about Windows network programming\n  to try to get that one working.  Other than that one, all the other examples\n  run without any problems.\n\nIII. Windows CE Build\n\n    Unzip ChmLib-ce.zip in the src directory.  I don't know much beyond that,\n    as I have no familiarity with Windows CE, but this should be a good\n    starting point.  These project files are from Rich Erwin, who also supplied\n    the necessary code changes to get it running.\n\nSparc (Solaris)\n---------------\n    Andrew Hodgetts has gotten the library compilable and working on Sparc\nSolaris machines, with CPUs ranging from a Sun4m (Sparc5) up through an\nUltraSparcIII (SunFireV880).  He has managed the compilation using both GCC and\nSunProC, although, he notes, some modification to the Makefile was required,\nsince SunProC does not understand the -fPIC flag, which GCC uses for Position\nIndependent Code.\n\nMIPS (SGI Irix)\n---------------\n    Andrew Hodgetts has gotten the library compilable and working on SGI MIPS\nmachines running Irix; this was using only the standard MIPS compiler, not GCC.\nHe reported that the -n32 flag was required in the Makefile.  He also reported\nthat the MIPS compiler was fairly verbose with the warning messages, but that\nthe simple examples that came with the library seemed to work.\n\nOS X\n----\n    Apparently, various people have gotten the library compiled for OS X.  From\nwhat I've heard, the secret is to disable pread and io64, and possibly to use\nthe 'libtool' from fink, instead of the one included with the standard\ndevelopers kit.\n\nBSD variants\n----\n    I've heard that the library has been compiled on BSD variants.  I haven't\nheard of any particular difficulties.\n\nOther Unix variants\n-------------------\n    The code has been written with an eye on portability.  Presently, I've only\npersonally compiled on Linux and Windows, albeit on a variety of Linux\nconfigurations, but, as reported above, Andrew Hodgetts has reported successful\nuse of the library on both Solaris machines and MIPS machines..  After I get\nversion 0.3 out, I may try to get it compiling on some of the machines I have\nat work.  This code may or may not compile out of the box with, for instance,\n*BSD or other Unix variants.  I welcome any patches that increase the\nportability of this code.\n\n    Platforms that I have access to at work, and may attempt to support after\nversion 0.3:\n\n        - AIX\n        - maybe Tru64\n"
  },
  {
    "path": "ext/CHMLib/README",
    "content": "CHMLIB 0.40a\n===========\n\n-------\nSUMMARY\n-------\nchmlib is a small library designed for accessing MS ITSS files.  The ITSS file\nformat is used for Microsoft Html Help files (.chm), which have been the\npredominant medium for software documentation from Microsoft during the past\nseveral years, having superceded the previously used .hlp file format.\n\nNote that this is NOT the same as the OLE structured storage file format used\nby MS Excel, Word, and so on.  Instead, it is a different file format which\nfulfills a similar purpose.  Both file formats may be accessed via instances\nof the IStorage COM interface, which is essentially an \"acts like a\nfilesystem\" interface.\n\n-------\nFILE FORMAT SUPPORT\n-------\n\nLookup of files in the archive is supported, and should be relatively quick.\nReading of files in the archive is also supported.\nWriting is not supported, but may be added in the future.\n\nIn terms of support for the ITSS file format, there are a few places in which\nthe support provided by this library is not fully general:\n\n1. ITSS files whose names contain UTF-8 characters which are not part of the\n   ASCII subset will not currently be dealt with gracefully.  Currently, the\n   filenames are not converted from UTF-8, but are instead returned as-is.  I'm\n   very interested in hearing any suggestions as to the \"right\" way to handle\n   this.\n\n2. Only version 3 ITSS files are supported at present, though some work has\n   gone towards divining the differences between different versions of the\n   file format.  It is possible that version 2 ITSS files might work properly\n   with this library, but unconfirmed.\n\n3. Archives larger than 4 GB should be supported just fine, but if they\n   contain files larger than 4GB, this library may break.  Fortunately, this\n   seems somewhat unlikely.\n\nIf you run into .chm files (or files you suspect are ITSS files) that this\nlibrary doesn't work with, please contact me so I can fix the library.\n\n-------\nPORTABILITY\n-------\n\nThis software is maintained on an x86-64 Debian GNU/Linux machine using gcc\n4.x.  It has been compiled on various other Linux distributions, using versions\nof gcc from 2.95 through 4.4.  Win32 support is provided.\n\nChmlib apparently works on OS X, with some tweaks.  In particular, disabling\npread and io64 apparently works.\n\nFinally, Andrew Hodgetts has ported to Solaris and IRIX:\n\nOn Monday, 7 Oct 2002, Andrew Hodgetts wrote:\n> Solaris(Sun):\n> \n> I used both SunProC and GCC on the solaris machines to compile. They\n> both worked ok.\n> However, both required -lsocket on the link line of the Makefile or you\n> recieve linking errors.\n> \n> I have this working on CPUs ranging from Sun4m (Sparc5) through to\n> UltraSparcIII (SunFireV880).\n> \n> Irix (SGI):\n> \n> I only testing with the MIPS compiler (not GCC). All worked ok - lots of\n> warning messages, but it always does that.\n\nHe further noted that:\n\n> ... for NON GCC compilers, a little tweaking may be required, but nothing too\n> complex.  ie SunProC doesn't understand -fPIC for library building.  Irix\n> required -n32 (new 32bit libraries) etc.  These are things that someone who\n> uses the OS and compiler should be used to dealing with.\n\n-------\nCREDITS\n-------\n\n* Stuart Caie: the LZX decompression code, and for granting permission to\n  re-license under the LGPL.\n\n* Sven Tantau: identification of a stack-overflow security flaw and a quick fix\n  for the problem; identification of a possible security danger in the example\n  program \"extract_chmLib\"\n\n* iDEFENSE Labs: identification of a nasty stack-overflow security flaw\n\n* Palasik Sandor: identification of a potential security flaw in lzx.c as well\n  as a quick fix for the problem\n\n* David Huseby: An excellent patch to the chm_enumerate functionality, relating\n  to the \"what\" flags, which didn't work entirely correctly before\n\n* Vadim Zeitlin: Configure script cleanup, including an important update to\n  allow detection of platforms where pread64 doesn't work.  (OS X)\n\n* Vitaly V. Bursov: Compilation on x86-64.\n\n* mc: A suggestion to add a \"mkdir\" to the install step.\n\n* Stan Tobias: bugfixes and the added 'index page' feature of chm_http.\n\n* Andrew Hodgetts: porting to Solaris and IRIX, as well as fixing some\n  little-endian biases in the code.\n\n* Rich Erwin: Windows CE support.\n\n* Pabs: bug fixes and suggestions.\n\n* Kartik Mistry: Debian package maintainer\n\n* Antony Dovgal: setting up autoconf/automake based build process.\n\n* Ragnar Hojland Espinosa: patches to make chm_http more useful.\n\n* Razvan Cojocaru: forwarding along information regarding building on OS X.\n\n* Julien Lemoine: creating and maintaining the Debian package of chmlib.\n\n* Prarit Bhargava: Compilation on ia64\n\n* Jean-Marc Vanel: elimination of compilation warnings in extract_chmLib\n\n* Sisyphus & Matej Spiller-Muys: Compilation under MinGW32\n\n* Kyle Davenport: helper script for using chm_http with mozilla\n\n* Matthew Daniel & Mark Rosenstand: help to sort out issues with the build\n  system.\n\n* Anyone else I've forgotten. (?)\n\n"
  },
  {
    "path": "ext/CHMLib/src/Makefile.am",
    "content": "lib_LTLIBRARIES=libchm.la\nlibchm_la_SOURCES=chm_lib.c lzx.c\nlibchm_la_LDFLAGS=-version-info 1\ninclude_HEADERS=chm_lib.h lzx.h\n\nif EXAMPLES\nbin_PROGRAMS=chm_http enum_chmLib enumdir_chmLib extract_chmLib test_chmLib\nenum_chmLib_SOURCES=enum_chmLib.c\nenum_chmLib_LDADD=libchm.la\nchm_http_SOURCES=chm_http.c\nchm_http_LDADD=libchm.la\nenumdir_chmLib_SOURCES=enumdir_chmLib.c\nenumdir_chmLib_LDADD=libchm.la\nextract_chmLib_SOURCES=extract_chmLib.c\nextract_chmLib_LDADD=libchm.la\ntest_chmLib_SOURCES=test_chmLib.c\ntest_chmLib_LDADD=libchm.la\nendif ##EXAMPLES\n"
  },
  {
    "path": "ext/CHMLib/src/Makefile.simple",
    "content": "## Available defines for building chm_lib with particular options\n# CHM_MT:        build thread-safe version of chm_lib\n# CHM_USE_PREAD: build chm_lib to use pread/pread64 for all I/O\n# CHM_USE_IO64:  build chm_lib to support 64-bit file I/O\n#\n# Note: LDFLAGS must contain -lpthread if you are using -DCHM_MT.\n#\n#CFLAGS=-DCHM_MT -DCHM_USE_PREAD -DCHM_USE_IO64\nCFLAGS=-DCHM_MT -DCHM_USE_PREAD -DCHM_USE_IO64 -g -DDMALLOC_DISABLE\nLDFLAGS=-lpthread\nINSTALLPREFIX=/usr/local\nCC=gcc\nLD=gcc\nLIBTOOL=libtool\nCP=/bin/cp\nEXAMPLES=test_chmLib enum_chmLib enumdir_chmLib chm_http extract_chmLib\n\nall: libchm.la\n\nexamples: ${EXAMPLES}\n\n%.lo: %.c\n\t${LIBTOOL} --mode=compile ${CC} -c -o $@ $^ ${CFLAGS}\n\nlibchm.la: chm_lib.lo lzx.lo\n\t${LIBTOOL} --mode=link ${LD} -o $@ $^ ${LDFLAGS} -rpath ${INSTALLPREFIX}/lib\n\ninstall: libchm.la\n\tchmod a+r libchm.la\n\t${LIBTOOL} --mode=install ${CP} libchm.la ${INSTALLPREFIX}/lib\n\t${CP} chm_lib.h ${INSTALLPREFIX}/include\n\nclean:\n\trm -fr libchm.la *.o *.lo .libs ${EXAMPLES}\n\ntest_chmLib: test_chmLib.c\n\t${CC} -o $@ $^ -I${INSTALLPREFIX}/include -L${INSTALLPREFIX}/lib -lchm ${CFLAGS}\n\nenum_chmLib: enum_chmLib.c\n\t${CC} -o $@ $^ -I${INSTALLPREFIX}/include -L${INSTALLPREFIX}/lib -lchm ${CFLAGS}\n\nenumdir_chmLib: enumdir_chmLib.c\n\t${CC} -o $@ $^ -I${INSTALLPREFIX}/include -L${INSTALLPREFIX}/lib -lchm ${CFLAGS}\n\nextract_chmLib: extract_chmLib.c\n\t${CC} -o $@ $^ -I${INSTALLPREFIX}/include -L${INSTALLPREFIX}/lib -lchm ${CFLAGS}\n\nchm_http: chm_http.c\n\t${CC} -o $@ $^ -I${INSTALLPREFIX}/include -L${INSTALLPREFIX}/lib -lchm -lpthread ${CFLAGS}\n\n"
  },
  {
    "path": "ext/CHMLib/src/chm_http.c",
    "content": "/* $Id: chm_http.c,v 1.7 2002/10/08 03:43:33 jedwin Exp $ */\n/***************************************************************************\n *             chm_http.c - CHM archive test driver                        *\n *                           -------------------                           *\n *                                                                         *\n *  author:     Jed Wing <jedwin@ugcs.caltech.edu>                         *\n *  notes:      This is a slightly more complex test driver for the chm    *\n *              routines.  It also serves the purpose of making .chm html  *\n *              help files viewable from a text mode browser, which was my *\n *              original purpose for all of this.                          *\n *                                                                         *\n *              It is not included with the expectation that it will be of *\n *              use to others; nor is it included as an example of a       *\n *              stunningly good implementation of an HTTP server.  It is,  *\n *              in fact, probably badly broken for any serious usage.      *\n *                                                                         *\n *              Nevertheless, it is another example program, and it does   *\n *              serve a purpose for me, so I've included it as well.       *\n ***************************************************************************/\n\n/***************************************************************************\n *                                                                         *\n *   This program is free software; you can redistribute it and/or modify  *\n *   it under the terms of the GNU Lesser General Public License as        *\n *   published by the Free Software Foundation; either version 2.1 of the  *\n *   License, or (at your option) any later version.                       *\n *                                                                         *\n ***************************************************************************/\n\n#include \"chm_lib.h\"\n\n/* standard system includes */\n#define _REENTRANT\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#if __sun || __sgi\n#include <strings.h>\n#define strrchr rindex\n#endif\n\n/* includes for networking */\n#include <sys/socket.h>\n#include <sys/types.h>\n#include <netinet/in.h>\n\n/* threading includes */\n#include <pthread.h>\n\n#include <getopt.h>\n\nint config_port = 8080;\nchar config_bind[65536] = \"0.0.0.0\";\n\nstatic void usage(const char *argv0)\n{\n#ifdef CHM_HTTP_SIMPLE\n    fprintf(stderr, \"usage: %s <filename>\\n\", argv0);\n#else\n    fprintf(stderr, \"usage: %s [--port=PORT] [--bind=IP] <filename>\\n\", argv0);\n#endif\n    exit(1);\n}\n\nstatic void chmhttp_server(const char *filename);\n\nint main(int c, char **v)\n{\n#ifdef CHM_HTTP_SIMPLE\n    if (c < 2)\n        usage(v[0]);\n\n    /* run the server */\n    chmhttp_server(v[1]);\n\n#else\n    int optindex = 0;\n\n    struct option longopts[] = \n    {\n        { \"port\", required_argument, 0, 'p' },\n        { \"bind\", required_argument, 0, 'b' },\n        { \"help\", no_argument, 0, 'h' },\n        { 0, 0, 0, 0 }\n    };\n\n    while (1) \n    {\n        int o;\n        o = getopt_long (c, v, \"n:b:h\", longopts, &optindex);\n        if (o < 0) \n        {\n            break;\n        }\n\n        switch (o) \n        {\n            case 'p':\n                config_port = atoi (optarg);\n                if (config_port <= 0) \n                {\n                    fprintf(stderr, \"bad port number (%s)\\n\", optarg);\n                    exit(1);\n                }\n                break;\n\n            case 'b':\n                strncpy (config_bind, optarg, 65536);\n                config_bind[65535] = '\\0';\n                break;\n\n            case 'h':\n                usage (v[0]);\n                break;\n        }\n\n    }\n\n    if (optind + 1 != c)\n    {\n        usage (v[0]);\n    }\n\n    /* run the server */\n    chmhttp_server(v[optind]);\n#endif\n\n    /* NOT REACHED */\n    return 0;\n}\n\nstruct chmHttpServer\n{\n    int                         socket;\n    struct chmFile             *file;\n};\n\nstruct chmHttpSlave\n{\n    int                         fd;\n    struct chmHttpServer       *server;\n};\n\nstatic void *_slave(void *param);\n\nstatic void chmhttp_server(const char *filename)\n{\n    struct chmHttpServer        server;\n    struct chmHttpSlave        *slave;\n    struct sockaddr_in          bindAddr;\n    int                         addrLen;\n    pthread_t                   tid;\n    int                         one = 1;\n\n    /* open file */\n    if ((server.file = chm_open(filename)) == NULL)\n    {\n        fprintf(stderr, \"couldn't open file '%s'\\n\", filename);\n        exit(2);\n    }\n\n    /* create socket */\n    server.socket = socket(AF_INET, SOCK_STREAM, 0);\n    memset(&bindAddr, 0, sizeof(struct sockaddr_in));\n    bindAddr.sin_family = AF_INET;\n    bindAddr.sin_port = htons(config_port);\n    bindAddr.sin_addr.s_addr = inet_addr(config_bind);\n\n    if (setsockopt (server.socket, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one))) \n    {\n        perror (\"setsockopt\");\n        exit(3);\n    }\n\n    if (bind(server.socket, \n             (struct sockaddr *)&bindAddr,\n             sizeof(struct sockaddr_in)) < 0)\n    {\n        close(server.socket);\n        server.socket = -1;\n        fprintf(stderr, \"couldn't bind to ip %s port %d\\n\", config_bind, config_port);\n        exit(3);\n    }\n\n    /* listen for connections */\n    listen(server.socket, 75);\n    addrLen = sizeof(struct sockaddr);\n    while(1)\n    {\n        slave = (struct chmHttpSlave *)malloc(sizeof(struct chmHttpSlave));\n        slave->server = &server;\n        slave->fd = accept(server.socket, (struct sockaddr *)&bindAddr, &addrLen);\n        if (slave->fd == -1)\n            break;\n\n        pthread_create(&tid, NULL, _slave, (void *)slave);\n        pthread_detach(tid);\n    }\n    free(slave);\n}\n\nstatic void service_request(int fd, struct chmFile *file);\n\nstatic void *_slave(void *param)\n{\n    struct chmHttpSlave *slave;\n    struct chmFile *file;\n\n    /* grab our relevant information */\n    slave = (struct chmHttpSlave *)param;\n    file = slave->server->file;\n\n    /* handle request */\n    service_request(slave->fd, file);\n\n    /* free our resources and return */\n    close(slave->fd);\n    free(slave);\n    return NULL;\n}\n\nstatic const char CONTENT_404[] = \"HTTP/1.1 404 File not found\\r\\nConnection: close\\r\\nContent-Type: text/html; charset=iso-8859-1\\r\\n\\r\\n<html><head><title>404 File Not Found</title></head><body><h1>404 File not found</h1></body></html>\\r\\n\";\nstatic const char CONTENT_500[] = \"HTTP/1.1 500 Unknown thing\\r\\nConnection: close\\r\\nContent-Type: text/html; charset=iso-8859-1\\r\\n\\r\\n<html><head><title>500 Unknown thing</title></head><body><h1>500 Unknown thing</h1></body></html>\\r\\n\";\nstatic const char INTERNAL_ERROR[] = \"HTTP/1.1 500 Internal error\\r\\nConnection: close\\r\\nContent-Type: text/html; charset=iso-8859-1\\r\\n\\r\\n<html><head><title>500 Unknown thing</title></head><body><h1>500 Server error</h1></body></html>\\r\\n\";\n\nstruct mime_mapping\n{\n    const char *ext;\n    const char *ctype;\n};\n\nstruct mime_mapping mime_types[] =\n{ { \".htm\",  \"text/html\"    },\n  { \".html\", \"text/html\"    },\n  { \".css\",  \"text/css\"     },\n  { \".gif\",  \"image/gif\"    },\n  { \".jpg\",  \"image/jpeg\"   },\n  { \".jpeg\", \"image/jpeg\"   },\n  { \".jpe\",  \"image/jpeg\"   },\n  { \".bmp\",  \"image/bitmap\" },\n  { \".png\",  \"image/png\"    }\n};\n\nstatic const char *lookup_mime(const char *ext)\n{\n    int i;\n    if (ext != NULL)\n    {\n        for (i=0; i<sizeof(mime_types)/sizeof(struct mime_mapping); i++)\n        {\n            if (strcasecmp(mime_types[i].ext, ext) == 0)\n                return mime_types[i].ctype;\n        }\n    }\n\n    return \"application/octet-stream\";\n}\n\n\nstatic int _print_ui_index(struct chmFile *h, struct chmUnitInfo *ui, \n                           void *context)\n{\n    FILE *fout = (FILE*) context;\n    fprintf(fout,\n            \"<tr>\"\n            \"<td align=right>%8d\\n</td>\"\n            \"<td><a href=\\\"%s\\\">%s</a></td>\"\n            \"</tr>\",\n            (int)ui->length, ui->path, ui->path);\n    return CHM_ENUMERATOR_CONTINUE;\n}\n\nstatic void deliver_index(FILE *fout, struct chmFile *file)\n{\n    fprintf(fout, \n            \"HTTP/1.1 200 OK\\r\\n\"\n            \"Connection: close\\r\\n\"\n         /* \"Content-Length: 1000000\\r\\n\" */\n            \"Content-Type: text/html\\r\\n\\r\\n\"\n\n            \"<h2><u>CHM contents:</u></h2>\"\n            \"<body><table>\"\n            \"<tr><td><h5>Size:</h5></td><td><h5>File:</h5></td></tr>\"\n            \"<tt>\");\n    if (! chm_enumerate(file, CHM_ENUMERATE_ALL, _print_ui_index, fout))\n        fprintf(fout,\"<br>   *** ERROR ***\\r\\n\");\n    fprintf(fout,\"</tt> </table></body></html>\");\n}\n\n\nstatic void deliver_content(FILE *fout, const char *filename, struct chmFile *file)\n{\n    struct chmUnitInfo ui;\n    const char *ext;\n    unsigned char buffer[65536];\n    int swath, offset;\n\n    if (strcmp(filename,\"/\") == 0)\n    {\n        deliver_index(fout,file);\n        fclose(fout);\n        return;\n    }\n    /* try to find the file */\n    if (chm_resolve_object(file, filename, &ui) != CHM_RESOLVE_SUCCESS)\n    {\n        fprintf(fout, CONTENT_404);\n        fclose(fout);\n        return;\n    }\n\n    /* send the file back */\n    ext = strrchr(filename, '.');\n    fprintf(fout, \"HTTP/1.1 200 OK\\r\\nConnection: close\\r\\nContent-Length: %d\\r\\nContent-Type: %s\\r\\n\\r\\n\",\n            (int)ui.length,\n            lookup_mime(ext));\n\n    /* pump the data out */\n    swath = 65536;\n    offset = 0;\n    while (offset < ui.length)\n    {\n        if ((ui.length - offset) < 65536)\n            swath = ui.length - offset;\n        else\n            swath = 65536;\n        swath = (int)chm_retrieve_object(file, &ui, buffer, offset, swath);\n        offset += swath;\n        fwrite(buffer, 1, swath, fout);\n    }\n    fclose(fout);\n}\n\nstatic void service_request(int fd, struct chmFile *file)\n{\n    char buffer[4096];\n    char buffer2[4096];\n    char *end;\n    FILE *fout = fdopen(fd, \"w+b\");\n    if (fout == NULL)\n    {\n        perror(\"chm_http: failed to fdopen client stream\");\n        write(fd, INTERNAL_ERROR, strlen(INTERNAL_ERROR));\n        close(fd);\n        return;\n    }\n\n    fgets(buffer, 4096, fout);\n    while (1)\n    {\n        if (fgets(buffer2, 4096, fout) == NULL)\n            break;\n        if (buffer2[0] == '\\r' || buffer2[0] == '\\n'  ||  buffer2[0] == '\\0')\n            break;\n    }\n    end = strrchr(buffer, ' ');\n    if (strncmp(end+1, \"HTTP\", 4) == 0)\n        *end = '\\0';\n    if (strncmp(buffer, \"GET \", 4) == 0)\n        deliver_content(fout, buffer+4, file);\n    else\n    {\n        fprintf(fout, CONTENT_500);\n        fclose(fout);\n        return;\n    }\n}\n"
  },
  {
    "path": "ext/CHMLib/src/chm_lib.c",
    "content": "/* $Id: chm_lib.c,v 1.19 2003/09/07 13:01:43 jedwin Exp $ */\n/***************************************************************************\n *             chm_lib.c - CHM archive manipulation routines               *\n *                           -------------------                           *\n *                                                                         *\n *  author:     Jed Wing <jedwin@ugcs.caltech.edu>                         *\n *  version:    0.3                                                        *\n *  notes:      These routines are meant for the manipulation of microsoft *\n *              .chm (compiled html help) files, but may likely be used    *\n *              for the manipulation of any ITSS archive, if ever ITSS     *\n *              archives are used for any other purpose.                   *\n *                                                                         *\n *              Note also that the section names are statically handled.   *\n *              To be entirely correct, the section names should be read   *\n *              from the section names meta-file, and then the various     *\n *              content sections and the \"transforms\" to apply to the data *\n *              they contain should be inferred from the section name and  *\n *              the meta-files referenced using that name; however, all of *\n *              the files I've been able to get my hands on appear to have *\n *              only two sections: Uncompressed and MSCompressed.          *\n *              Additionally, the ITSS.DLL file included with Windows does *\n *              not appear to handle any different transforms than the     *\n *              simple LZX-transform.  Furthermore, the list of transforms *\n *              to apply is broken, in that only half the required space   *\n *              is allocated for the list.  (It appears as though the      *\n *              space is allocated for ASCII strings, but the strings are  *\n *              written as unicode.  As a result, only the first half of   *\n *              the string appears.)  So this is probably not too big of   *\n *              a deal, at least until CHM v4 (MS .lit files), which also  *\n *              incorporate encryption, of some description.               *\n *                                                                         *\n * switches:    CHM_MT:        compile library with thread-safety          *\n *                                                                         *\n * switches (Linux only):                                                  *\n *              CHM_USE_PREAD: compile library to use pread instead of     *\n *                             lseek/read                                  *\n *              CHM_USE_IO64:  compile library to support full 64-bit I/O  *\n *                             as is needed to properly deal with the      *\n *                             64-bit file offsets.                        *\n ***************************************************************************/\n\n/***************************************************************************\n *                                                                         *\n *   This program is free software; you can redistribute it and/or modify  *\n *   it under the terms of the GNU Lesser General Public License as        *\n *   published by the Free Software Foundation; either version 2.1 of the  *\n *   License, or (at your option) any later version.                       *\n *                                                                         *\n ***************************************************************************/\n\n#include \"chm_lib.h\"\n\n#ifdef CHM_MT\n#define _REENTRANT\n#endif\n\n#include \"lzx.h\"\n\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n#ifdef CHM_DEBUG\n#include <stdio.h>\n#endif\n\n#if __sun || __sgi\n#include <strings.h>\n#endif\n\n#ifdef WIN32\n#include <windows.h>\n#include <malloc.h>\n#ifdef _WIN32_WCE\n#define strcasecmp _stricmp\n#define strncasecmp _strnicmp\n#else\n#define strcasecmp stricmp\n#define strncasecmp strnicmp\n#endif\n#else\n/* basic Linux system includes */\n#define _XOPEN_SOURCE 500\n#include <unistd.h>\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <fcntl.h>\n/* #include <dmalloc.h> */\n#endif\n\n/* includes/defines for threading, if using them */\n#ifdef CHM_MT\n#ifdef WIN32\n#define CHM_ACQUIRE_LOCK(a) do {                        \\\n        EnterCriticalSection(&(a));                     \\\n    } while(0)\n#define CHM_RELEASE_LOCK(a) do {                        \\\n        LeaveCriticalSection(&(a));                     \\\n    } while(0)\n\n#else\n#include <pthread.h>\n\n#define CHM_ACQUIRE_LOCK(a) do {                        \\\n        pthread_mutex_lock(&(a));                       \\\n    } while(0)\n#define CHM_RELEASE_LOCK(a) do {                        \\\n        pthread_mutex_unlock(&(a));                     \\\n    } while(0)\n\n#endif\n#else\n#define CHM_ACQUIRE_LOCK(a) /* do nothing */\n#define CHM_RELEASE_LOCK(a) /* do nothing */\n#endif\n\n#ifdef WIN32\n#define CHM_NULL_FD (INVALID_HANDLE_VALUE)\n#define CHM_USE_WIN32IO 1\n#define CHM_CLOSE_FILE(fd) CloseHandle((fd))\n#else\n#define CHM_NULL_FD (-1)\n#define CHM_CLOSE_FILE(fd) close((fd))\n#endif\n\n/*\n * defines related to tuning\n */\n#ifndef CHM_MAX_BLOCKS_CACHED\n#define CHM_MAX_BLOCKS_CACHED 5\n#endif\n\n/*\n * architecture specific defines\n *\n * Note: as soon as C99 is more widespread, the below defines should\n * probably just use the C99 sized-int types.\n *\n * The following settings will probably work for many platforms.  The sizes\n * don't have to be exactly correct, but the types must accommodate at least as\n * many bits as they specify.\n */\n\n/* i386, 32-bit, Windows */\n#ifdef WIN32\ntypedef unsigned char           UChar;\ntypedef __int16                 Int16;\ntypedef unsigned __int16        UInt16;\ntypedef __int32                 Int32;\ntypedef unsigned __int32        UInt32;\ntypedef __int64                 Int64;\ntypedef unsigned __int64        UInt64;\n\n/* x86-64 */\n/* Note that these may be appropriate for other 64-bit machines. */\n#elif defined(__LP64__)\ntypedef unsigned char           UChar;\ntypedef short                   Int16;\ntypedef unsigned short          UInt16;\ntypedef int                     Int32;\ntypedef unsigned int            UInt32;\ntypedef long                    Int64;\ntypedef unsigned long           UInt64;\n\n/* I386, 32-bit, non-Windows */\n/* Sparc        */\n/* MIPS         */\n/* PPC          */\n#else\ntypedef unsigned char           UChar;\ntypedef short                   Int16;\ntypedef unsigned short          UInt16;\ntypedef long                    Int32;\ntypedef unsigned long           UInt32;\ntypedef long long               Int64;\ntypedef unsigned long long      UInt64;\n#endif\n\n/* GCC */\n#ifdef __GNUC__\n#define memcmp __builtin_memcmp\n#define memcpy __builtin_memcpy\n#define strlen __builtin_strlen\n\n#elif defined(WIN32)\nstatic int ffs(unsigned int val)\n{\n    int bit=1, idx=1;\n    while (bit != 0  &&  (val & bit) == 0)\n    {\n        bit <<= 1;\n        ++idx;\n    }\n    if (bit == 0)\n        return 0;\n    else\n        return idx;\n}\n\n#endif\n\n/* utilities for unmarshalling data */\nstatic int _unmarshal_char_array(unsigned char **pData,\n                                 unsigned int *pLenRemain,\n                                 char *dest,\n                                 int count)\n{\n    if (count <= 0  ||  (unsigned int)count > *pLenRemain)\n        return 0;\n    memcpy(dest, (*pData), count);\n    *pData += count;\n    *pLenRemain -= count;\n    return 1;\n}\n\nstatic int _unmarshal_uchar_array(unsigned char **pData,\n                                  unsigned int *pLenRemain,\n                                  unsigned char *dest,\n                                  int count)\n{\n        if (count <= 0  ||  (unsigned int)count > *pLenRemain)\n        return 0;\n    memcpy(dest, (*pData), count);\n    *pData += count;\n    *pLenRemain -= count;\n    return 1;\n}\n\n#if 0\nstatic int _unmarshal_int16(unsigned char **pData,\n                            unsigned int *pLenRemain,\n                            Int16 *dest)\n{\n    if (2 > *pLenRemain)\n        return 0;\n    *dest = (*pData)[0] | (*pData)[1]<<8;\n    *pData += 2;\n    *pLenRemain -= 2;\n    return 1;\n}\n\nstatic int _unmarshal_uint16(unsigned char **pData,\n                             unsigned int *pLenRemain,\n                             UInt16 *dest)\n{\n    if (2 > *pLenRemain)\n        return 0;\n    *dest = (*pData)[0] | (*pData)[1]<<8;\n    *pData += 2;\n    *pLenRemain -= 2;\n    return 1;\n}\n#endif\n\nstatic int _unmarshal_int32(unsigned char **pData,\n                            unsigned int *pLenRemain,\n                            Int32 *dest)\n{\n    if (4 > *pLenRemain)\n        return 0;\n    *dest = (*pData)[0] | (*pData)[1]<<8 | (*pData)[2]<<16 | (*pData)[3]<<24;\n    *pData += 4;\n    *pLenRemain -= 4;\n    return 1;\n}\n\nstatic int _unmarshal_uint32(unsigned char **pData,\n                             unsigned int *pLenRemain,\n                             UInt32 *dest)\n{\n    if (4 > *pLenRemain)\n        return 0;\n    *dest = (*pData)[0] | (*pData)[1]<<8 | (*pData)[2]<<16 | (*pData)[3]<<24;\n    *pData += 4;\n    *pLenRemain -= 4;\n    return 1;\n}\n\nstatic int _unmarshal_int64(unsigned char **pData,\n                            unsigned int *pLenRemain,\n                            Int64 *dest)\n{\n    Int64 temp;\n    int i;\n    if (8 > *pLenRemain)\n        return 0;\n    temp=0;\n    for(i=8; i>0; i--)\n    {\n        temp <<= 8;\n        temp |= (*pData)[i-1];\n    }\n    *dest = temp;\n    *pData += 8;\n    *pLenRemain -= 8;\n    return 1;\n}\n\nstatic int _unmarshal_uint64(unsigned char **pData,\n                             unsigned int *pLenRemain,\n                             UInt64 *dest)\n{\n    UInt64 temp;\n    int i;\n    if (8 > *pLenRemain)\n        return 0;\n    temp=0;\n    for(i=8; i>0; i--)\n    {\n        temp <<= 8;\n        temp |= (*pData)[i-1];\n    }\n    *dest = temp;\n    *pData += 8;\n    *pLenRemain -= 8;\n    return 1;\n}\n\nstatic int _unmarshal_uuid(unsigned char **pData,\n                           unsigned int *pDataLen,\n                           unsigned char *dest)\n{\n    return _unmarshal_uchar_array(pData, pDataLen, dest, 16);\n}\n\n/* names of sections essential to decompression */\nstatic const char _CHMU_RESET_TABLE[] =\n        \"::DataSpace/Storage/MSCompressed/Transform/\"\n        \"{7FC28940-9D31-11D0-9B27-00A0C91E9C7C}/\"\n        \"InstanceData/ResetTable\";\nstatic const char _CHMU_LZXC_CONTROLDATA[] =\n        \"::DataSpace/Storage/MSCompressed/ControlData\";\nstatic const char _CHMU_CONTENT[] =\n        \"::DataSpace/Storage/MSCompressed/Content\";\nstatic const char _CHMU_SPANINFO[] =\n        \"::DataSpace/Storage/MSCompressed/SpanInfo\";\n\n/*\n * structures local to this module\n */\n\n/* structure of ITSF headers */\n#define _CHM_ITSF_V2_LEN (0x58)\n#define _CHM_ITSF_V3_LEN (0x60)\nstruct chmItsfHeader\n{\n    char        signature[4];           /*  0 (ITSF) */\n    Int32       version;                /*  4 */\n    Int32       header_len;             /*  8 */\n    Int32       unknown_000c;           /*  c */\n    UInt32      last_modified;          /* 10 */\n    UInt32      lang_id;                /* 14 */\n    UChar       dir_uuid[16];           /* 18 */\n    UChar       stream_uuid[16];        /* 28 */\n    UInt64      unknown_offset;         /* 38 */\n    UInt64      unknown_len;            /* 40 */\n    UInt64      dir_offset;             /* 48 */\n    UInt64      dir_len;                /* 50 */\n    UInt64      data_offset;            /* 58 (Not present before V3) */\n}; /* __attribute__ ((aligned (1))); */\n\nstatic int _unmarshal_itsf_header(unsigned char **pData,\n                                  unsigned int *pDataLen,\n                                  struct chmItsfHeader *dest)\n{\n    /* we only know how to deal with the 0x58 and 0x60 byte structures */\n    if (*pDataLen != _CHM_ITSF_V2_LEN  &&  *pDataLen != _CHM_ITSF_V3_LEN)\n        return 0;\n\n    /* unmarshal common fields */\n    _unmarshal_char_array(pData, pDataLen,  dest->signature, 4);\n    _unmarshal_int32     (pData, pDataLen, &dest->version);\n    _unmarshal_int32     (pData, pDataLen, &dest->header_len);\n    _unmarshal_int32     (pData, pDataLen, &dest->unknown_000c);\n    _unmarshal_uint32    (pData, pDataLen, &dest->last_modified);\n    _unmarshal_uint32    (pData, pDataLen, &dest->lang_id);\n    _unmarshal_uuid      (pData, pDataLen,  dest->dir_uuid);\n    _unmarshal_uuid      (pData, pDataLen,  dest->stream_uuid);\n    _unmarshal_uint64    (pData, pDataLen, &dest->unknown_offset);\n    _unmarshal_uint64    (pData, pDataLen, &dest->unknown_len);\n    _unmarshal_uint64    (pData, pDataLen, &dest->dir_offset);\n    _unmarshal_uint64    (pData, pDataLen, &dest->dir_len);\n\n    /* error check the data */\n    /* XXX: should also check UUIDs, probably, though with a version 3 file,\n     * current MS tools do not seem to use them.\n     */\n    if (memcmp(dest->signature, \"ITSF\", 4) != 0)\n        return 0;\n    if (dest->version == 2)\n    {\n        if (dest->header_len < _CHM_ITSF_V2_LEN)\n            return 0;\n    }\n    else if (dest->version == 3)\n    {\n        if (dest->header_len < _CHM_ITSF_V3_LEN)\n            return 0;\n    }\n    else\n        return 0;\n\n    /* now, if we have a V3 structure, unmarshal the rest.\n     * otherwise, compute it\n     */\n    if (dest->version == 3)\n    {\n        if (*pDataLen != 0)\n            _unmarshal_uint64(pData, pDataLen, &dest->data_offset);\n        else\n            return 0;\n    }\n    else\n        dest->data_offset = dest->dir_offset + dest->dir_len;\n\n    /* SumatraPDF: sanity check (huge values are usually due to broken files) */\n    if (dest->dir_offset > UINT_MAX || dest->dir_len > UINT_MAX)\n        return 0;\n\n    return 1;\n}\n\n/* structure of ITSP headers */\n#define _CHM_ITSP_V1_LEN (0x54)\nstruct chmItspHeader\n{\n    char        signature[4];           /*  0 (ITSP) */\n    Int32       version;                /*  4 */\n    Int32       header_len;             /*  8 */\n    Int32       unknown_000c;           /*  c */\n    UInt32      block_len;              /* 10 */\n    Int32       blockidx_intvl;         /* 14 */\n    Int32       index_depth;            /* 18 */\n    Int32       index_root;             /* 1c */\n    Int32       index_head;             /* 20 */\n    Int32       unknown_0024;           /* 24 */\n    UInt32      num_blocks;             /* 28 */\n    Int32       unknown_002c;           /* 2c */\n    UInt32      lang_id;                /* 30 */\n    UChar       system_uuid[16];        /* 34 */\n    UChar       unknown_0044[16];       /* 44 */\n}; /* __attribute__ ((aligned (1))); */\n\nstatic int _unmarshal_itsp_header(unsigned char **pData,\n                                  unsigned int *pDataLen,\n                                  struct chmItspHeader *dest)\n{\n    /* we only know how to deal with a 0x54 byte structures */\n    if (*pDataLen != _CHM_ITSP_V1_LEN)\n        return 0;\n\n    /* unmarshal fields */\n    _unmarshal_char_array(pData, pDataLen,  dest->signature, 4);\n    _unmarshal_int32     (pData, pDataLen, &dest->version);\n    _unmarshal_int32     (pData, pDataLen, &dest->header_len);\n    _unmarshal_int32     (pData, pDataLen, &dest->unknown_000c);\n    _unmarshal_uint32    (pData, pDataLen, &dest->block_len);\n    _unmarshal_int32     (pData, pDataLen, &dest->blockidx_intvl);\n    _unmarshal_int32     (pData, pDataLen, &dest->index_depth);\n    _unmarshal_int32     (pData, pDataLen, &dest->index_root);\n    _unmarshal_int32     (pData, pDataLen, &dest->index_head);\n    _unmarshal_int32     (pData, pDataLen, &dest->unknown_0024);\n    _unmarshal_uint32    (pData, pDataLen, &dest->num_blocks);\n    _unmarshal_int32     (pData, pDataLen, &dest->unknown_002c);\n    _unmarshal_uint32    (pData, pDataLen, &dest->lang_id);\n    _unmarshal_uuid      (pData, pDataLen,  dest->system_uuid);\n    _unmarshal_uchar_array(pData, pDataLen, dest->unknown_0044, 16);\n\n    /* error check the data */\n    if (memcmp(dest->signature, \"ITSP\", 4) != 0)\n        return 0;\n    if (dest->version != 1)\n        return 0;\n    if (dest->header_len != _CHM_ITSP_V1_LEN)\n        return 0;\n    /* SumatraPDF: sanity check */\n    if (dest->block_len == 0)\n        return 0;\n\n    return 1;\n}\n\n/* structure of PMGL headers */\nstatic const char _chm_pmgl_marker[4] = \"PMGL\";\n#define _CHM_PMGL_LEN (0x14)\nstruct chmPmglHeader\n{\n    char        signature[4];           /*  0 (PMGL) */\n    UInt32      free_space;             /*  4 */\n    UInt32      unknown_0008;           /*  8 */\n    Int32       block_prev;             /*  c */\n    Int32       block_next;             /* 10 */\n}; /* __attribute__ ((aligned (1))); */\n\nstatic int _unmarshal_pmgl_header(unsigned char **pData,\n                                  unsigned int *pDataLen,\n                                  unsigned int blockLen,\n                                  struct chmPmglHeader *dest)\n{\n    /* we only know how to deal with a 0x14 byte structures */\n    if (*pDataLen != _CHM_PMGL_LEN)\n        return 0;\n    /* SumatraPDF: sanity check */\n    if (blockLen < _CHM_PMGL_LEN)\n        return 0;\n\n    /* unmarshal fields */\n    _unmarshal_char_array(pData, pDataLen,  dest->signature, 4);\n    _unmarshal_uint32    (pData, pDataLen, &dest->free_space);\n    _unmarshal_uint32    (pData, pDataLen, &dest->unknown_0008);\n    _unmarshal_int32     (pData, pDataLen, &dest->block_prev);\n    _unmarshal_int32     (pData, pDataLen, &dest->block_next);\n\n    /* check structure */\n    if (memcmp(dest->signature, _chm_pmgl_marker, 4) != 0)\n        return 0;\n    /* SumatraPDF: sanity check */\n    if (dest->free_space > blockLen - _CHM_PMGL_LEN)\n        return 0;\n\n    return 1;\n}\n\n/* structure of PMGI headers */\nstatic const char _chm_pmgi_marker[4] = \"PMGI\";\n#define _CHM_PMGI_LEN (0x08)\nstruct chmPmgiHeader\n{\n    char        signature[4];           /*  0 (PMGI) */\n    UInt32      free_space;             /*  4 */\n}; /* __attribute__ ((aligned (1))); */\n\nstatic int _unmarshal_pmgi_header(unsigned char **pData,\n                                  unsigned int *pDataLen,\n                                  unsigned int blockLen,\n                                  struct chmPmgiHeader *dest)\n{\n    /* we only know how to deal with a 0x8 byte structures */\n    if (*pDataLen != _CHM_PMGI_LEN)\n        return 0;\n    /* SumatraPDF: sanity check */\n    if (blockLen < _CHM_PMGI_LEN)\n        return 0;\n\n    /* unmarshal fields */\n    _unmarshal_char_array(pData, pDataLen,  dest->signature, 4);\n    _unmarshal_uint32    (pData, pDataLen, &dest->free_space);\n\n    /* check structure */\n    if (memcmp(dest->signature, _chm_pmgi_marker, 4) != 0)\n        return 0;\n    /* SumatraPDF: sanity check */\n    if (dest->free_space > blockLen - _CHM_PMGI_LEN)\n        return 0;\n\n    return 1;\n}\n\n/* structure of LZXC reset table */\n#define _CHM_LZXC_RESETTABLE_V1_LEN (0x28)\nstruct chmLzxcResetTable\n{\n    UInt32      version;\n    UInt32      block_count;\n    UInt32      unknown;\n    UInt32      table_offset;\n    UInt64      uncompressed_len;\n    UInt64      compressed_len;\n    UInt64      block_len;\n}; /* __attribute__ ((aligned (1))); */\n\nstatic int _unmarshal_lzxc_reset_table(unsigned char **pData,\n                                       unsigned int *pDataLen,\n                                       struct chmLzxcResetTable *dest)\n{\n    /* we only know how to deal with a 0x28 byte structures */\n    if (*pDataLen != _CHM_LZXC_RESETTABLE_V1_LEN)\n        return 0;\n\n    /* unmarshal fields */\n    _unmarshal_uint32    (pData, pDataLen, &dest->version);\n    _unmarshal_uint32    (pData, pDataLen, &dest->block_count);\n    _unmarshal_uint32    (pData, pDataLen, &dest->unknown);\n    _unmarshal_uint32    (pData, pDataLen, &dest->table_offset);\n    _unmarshal_uint64    (pData, pDataLen, &dest->uncompressed_len);\n    _unmarshal_uint64    (pData, pDataLen, &dest->compressed_len);\n    _unmarshal_uint64    (pData, pDataLen, &dest->block_len);\n\n    /* check structure */\n    if (dest->version != 2)\n        return 0;\n    /* SumatraPDF: sanity check (huge values are usually due to broken files) */\n    if (dest->uncompressed_len > UINT_MAX || dest->compressed_len > UINT_MAX)\n        return 0;\n    if (dest->block_len == 0 || dest->block_len > UINT_MAX)\n        return 0;\n\n    return 1;\n}\n\n/* structure of LZXC control data block */\n#define _CHM_LZXC_MIN_LEN (0x18)\n#define _CHM_LZXC_V2_LEN (0x1c)\nstruct chmLzxcControlData\n{\n    UInt32      size;                   /*  0        */\n    char        signature[4];           /*  4 (LZXC) */\n    UInt32      version;                /*  8        */\n    UInt32      resetInterval;          /*  c        */\n    UInt32      windowSize;             /* 10        */\n    UInt32      windowsPerReset;        /* 14        */\n    UInt32      unknown_18;             /* 18        */\n};\n\nstatic int _unmarshal_lzxc_control_data(unsigned char **pData,\n                                        unsigned int *pDataLen,\n                                        struct chmLzxcControlData *dest)\n{\n    /* we want at least 0x18 bytes */\n    if (*pDataLen < _CHM_LZXC_MIN_LEN)\n        return 0;\n\n    /* unmarshal fields */\n    _unmarshal_uint32    (pData, pDataLen, &dest->size);\n    _unmarshal_char_array(pData, pDataLen,  dest->signature, 4);\n    _unmarshal_uint32    (pData, pDataLen, &dest->version);\n    _unmarshal_uint32    (pData, pDataLen, &dest->resetInterval);\n    _unmarshal_uint32    (pData, pDataLen, &dest->windowSize);\n    _unmarshal_uint32    (pData, pDataLen, &dest->windowsPerReset);\n\n    if (*pDataLen >= _CHM_LZXC_V2_LEN)\n        _unmarshal_uint32    (pData, pDataLen, &dest->unknown_18);\n    else\n        dest->unknown_18 = 0;\n\n    if (dest->version == 2)\n    {\n        dest->resetInterval *= 0x8000;\n        dest->windowSize *= 0x8000;\n    }\n    if (dest->windowSize == 0  ||  dest->resetInterval == 0)\n        return 0;\n\n    /* for now, only support resetInterval a multiple of windowSize/2 */\n    if (dest->windowSize == 1)\n        return 0;\n    if ((dest->resetInterval % (dest->windowSize/2)) != 0)\n        return 0;\n\n    /* check structure */\n    if (memcmp(dest->signature, \"LZXC\", 4) != 0)\n        return 0;\n\n    return 1;\n}\n\n/* the structure used for chm file handles */\nstruct chmFile\n{\n#ifdef WIN32\n    HANDLE              fd;\n#else\n    int                 fd;\n#endif\n\n#ifdef CHM_MT\n#ifdef WIN32\n    CRITICAL_SECTION    mutex;\n    CRITICAL_SECTION    lzx_mutex;\n    CRITICAL_SECTION    cache_mutex;\n#else\n    pthread_mutex_t     mutex;\n    pthread_mutex_t     lzx_mutex;\n    pthread_mutex_t     cache_mutex;\n#endif\n#endif\n\n    UInt64              dir_offset;\n    UInt64              dir_len;\n    UInt64              data_offset;\n    Int32               index_root;\n    Int32               index_head;\n    UInt32              block_len;\n\n    UInt64              span;\n    struct chmUnitInfo  rt_unit;\n    struct chmUnitInfo  cn_unit;\n    struct chmLzxcResetTable reset_table;\n\n    /* LZX control data */\n    int                 compression_enabled;\n    UInt32              window_size;\n    UInt32              reset_interval;\n    UInt32              reset_blkcount;\n\n    /* decompressor state */\n    struct LZXstate    *lzx_state;\n    int                 lzx_last_block;\n\n    /* cache for decompressed blocks */\n    UChar             **cache_blocks;\n    UInt64             *cache_block_indices;\n    Int32               cache_num_blocks;\n};\n\n/*\n * utility functions local to this module\n */\n\n/* utility function to handle differences between {pread,read}(64)? */\nstatic Int64 _chm_fetch_bytes(struct chmFile *h,\n                              UChar *buf,\n                              UInt64 os,\n                              Int64 len)\n{\n    Int64 readLen=0, oldOs=0;\n    if (h->fd  ==  CHM_NULL_FD)\n        return readLen;\n\n    CHM_ACQUIRE_LOCK(h->mutex);\n#ifdef CHM_USE_WIN32IO\n    /* NOTE: this might be better done with CreateFileMapping, et cetera... */\n    {\n        DWORD origOffsetLo=0, origOffsetHi=0;\n        DWORD offsetLo, offsetHi;\n        DWORD actualLen=0;\n\n        /* awkward Win32 Seek/Tell */\n        offsetLo = (unsigned int)(os & 0xffffffffL);\n        offsetHi = (unsigned int)((os >> 32) & 0xffffffffL);\n        origOffsetLo = SetFilePointer(h->fd, 0, &origOffsetHi, FILE_CURRENT);\n        offsetLo = SetFilePointer(h->fd, offsetLo, &offsetHi, FILE_BEGIN);\n\n        /* read the data */\n        if (ReadFile(h->fd,\n                     buf,\n                     (DWORD)len,\n                     &actualLen,\n                     NULL) == TRUE)\n            readLen = actualLen;\n        else\n            readLen = 0;\n\n        /* restore original position */\n        SetFilePointer(h->fd, origOffsetLo, &origOffsetHi, FILE_BEGIN);\n    }\n#else\n#ifdef CHM_USE_PREAD\n#ifdef CHM_USE_IO64\n    readLen = pread64(h->fd, buf, (long)len, os);\n#else\n    readLen = pread(h->fd, buf, (long)len, (unsigned int)os);\n#endif\n#else\n#ifdef CHM_USE_IO64\n    oldOs = lseek64(h->fd, 0, SEEK_CUR);\n    lseek64(h->fd, os, SEEK_SET);\n    readLen = read(h->fd, buf, len);\n    lseek64(h->fd, oldOs, SEEK_SET);\n#else\n    oldOs = lseek(h->fd, 0, SEEK_CUR);\n    lseek(h->fd, (long)os, SEEK_SET);\n    readLen = read(h->fd, buf, len);\n    lseek(h->fd, (long)oldOs, SEEK_SET);\n#endif\n#endif\n#endif\n    CHM_RELEASE_LOCK(h->mutex);\n    return readLen;\n}\n\n/* open an ITS archive */\n#ifdef PPC_BSTR\n/* RWE 6/12/2003 */\nstruct chmFile *chm_open(BSTR filename)\n#else\nstruct chmFile *chm_open(const char *filename)\n#endif\n{\n    unsigned char               sbuffer[256];\n    unsigned int                sremain;\n    unsigned char              *sbufpos;\n    struct chmFile             *newHandle=NULL;\n    struct chmItsfHeader        itsfHeader;\n    struct chmItspHeader        itspHeader;\n#if 0\n    struct chmUnitInfo          uiSpan;\n#endif\n    struct chmUnitInfo          uiLzxc;\n    struct chmLzxcControlData   ctlData;\n\n    /* allocate handle */\n    newHandle = (struct chmFile *)malloc(sizeof(struct chmFile));\n    if (newHandle == NULL)\n        return NULL;\n    newHandle->fd = CHM_NULL_FD;\n    newHandle->lzx_state = NULL;\n    newHandle->cache_blocks = NULL;\n    newHandle->cache_block_indices = NULL;\n    newHandle->cache_num_blocks = 0;\n\n    /* open file */\n#ifdef WIN32\n#ifdef PPC_BSTR\n    if ((newHandle->fd=CreateFile(filename,\n                                  GENERIC_READ,\n                                  FILE_SHARE_READ,\n                                  NULL,\n                                  OPEN_EXISTING,\n                                  FILE_ATTRIBUTE_NORMAL,\n                                  NULL)) == CHM_NULL_FD)\n    {\n        free(newHandle);\n        return NULL;\n    }\n#else\n    if ((newHandle->fd=CreateFileA(filename,\n                                   GENERIC_READ,\n                                   0,\n                                   NULL,\n                                   OPEN_EXISTING,\n                                   FILE_ATTRIBUTE_NORMAL,\n                                   NULL)) == CHM_NULL_FD)\n    {\n        free(newHandle);\n        return NULL;\n    }\n#endif\n#else\n    if ((newHandle->fd=open(filename, O_RDONLY)) == CHM_NULL_FD)\n    {\n        free(newHandle);\n        return NULL;\n    }\n#endif\n\n    /* initialize mutexes, if needed */\n#ifdef CHM_MT\n#ifdef WIN32\n    InitializeCriticalSection(&newHandle->mutex);\n    InitializeCriticalSection(&newHandle->lzx_mutex);\n    InitializeCriticalSection(&newHandle->cache_mutex);\n#else\n    pthread_mutex_init(&newHandle->mutex, NULL);\n    pthread_mutex_init(&newHandle->lzx_mutex, NULL);\n    pthread_mutex_init(&newHandle->cache_mutex, NULL);\n#endif\n#endif\n\n    /* read and verify header */\n    sremain = _CHM_ITSF_V3_LEN;\n    sbufpos = sbuffer;\n    if (_chm_fetch_bytes(newHandle, sbuffer, (UInt64)0, sremain) != sremain    ||\n        !_unmarshal_itsf_header(&sbufpos, &sremain, &itsfHeader))\n    {\n        chm_close(newHandle);\n        return NULL;\n    }\n\n    /* stash important values from header */\n    newHandle->dir_offset  = itsfHeader.dir_offset;\n    newHandle->dir_len     = itsfHeader.dir_len;\n    newHandle->data_offset = itsfHeader.data_offset;\n\n    /* now, read and verify the directory header chunk */\n    sremain = _CHM_ITSP_V1_LEN;\n    sbufpos = sbuffer;\n    if (_chm_fetch_bytes(newHandle, sbuffer,\n                         (UInt64)itsfHeader.dir_offset, sremain) != sremain       ||\n        !_unmarshal_itsp_header(&sbufpos, &sremain, &itspHeader))\n    {\n        chm_close(newHandle);\n        return NULL;\n    }\n\n    /* grab essential information from ITSP header */\n    newHandle->dir_offset += itspHeader.header_len;\n    newHandle->dir_len    -= itspHeader.header_len;\n    newHandle->index_root  = itspHeader.index_root;\n    newHandle->index_head  = itspHeader.index_head;\n    newHandle->block_len   = itspHeader.block_len;\n\n    /* if the index root is -1, this means we don't have any PMGI blocks.\n     * as a result, we must use the sole PMGL block as the index root\n     */\n    if (newHandle->index_root <= -1)\n        newHandle->index_root = newHandle->index_head;\n\n    /* By default, compression is enabled. */\n    newHandle->compression_enabled = 1;\n\n/* Jed, Sun Jun 27: 'span' doesn't seem to be used anywhere?! */\n#if 0\n    /* fetch span */\n    if (CHM_RESOLVE_SUCCESS != chm_resolve_object(newHandle,\n                                                  _CHMU_SPANINFO,\n                                                  &uiSpan)                ||\n        uiSpan.space == CHM_COMPRESSED)\n    {\n        chm_close(newHandle);\n        return NULL;\n    }\n\n    /* N.B.: we've already checked that uiSpan is in the uncompressed section,\n     *       so this should not require attempting to decompress, which may\n     *       rely on having a valid \"span\"\n     */\n    sremain = 8;\n    sbufpos = sbuffer;\n    if (chm_retrieve_object(newHandle, &uiSpan, sbuffer,\n                            0, sremain) != sremain                        ||\n        !_unmarshal_uint64(&sbufpos, &sremain, &newHandle->span))\n    {\n        chm_close(newHandle);\n        return NULL;\n    }\n#endif\n\n    /* prefetch most commonly needed unit infos */\n    if (CHM_RESOLVE_SUCCESS != chm_resolve_object(newHandle,\n                                                  _CHMU_RESET_TABLE,\n                                                  &newHandle->rt_unit)    ||\n        newHandle->rt_unit.space == CHM_COMPRESSED                        ||\n        CHM_RESOLVE_SUCCESS != chm_resolve_object(newHandle,\n                                                  _CHMU_CONTENT,\n                                                  &newHandle->cn_unit)    ||\n        newHandle->cn_unit.space == CHM_COMPRESSED                        ||\n        CHM_RESOLVE_SUCCESS != chm_resolve_object(newHandle,\n                                                  _CHMU_LZXC_CONTROLDATA,\n                                                  &uiLzxc)                ||\n        uiLzxc.space == CHM_COMPRESSED)\n    {\n        newHandle->compression_enabled = 0;\n    }\n\n    /* read reset table info */\n    if (newHandle->compression_enabled)\n    {\n        sremain = _CHM_LZXC_RESETTABLE_V1_LEN;\n        sbufpos = sbuffer;\n        if (chm_retrieve_object(newHandle, &newHandle->rt_unit, sbuffer,\n                                0, sremain) != sremain                        ||\n            !_unmarshal_lzxc_reset_table(&sbufpos, &sremain,\n                                         &newHandle->reset_table))\n        {\n            newHandle->compression_enabled = 0;\n        }\n    }\n\n    /* read control data */\n    if (newHandle->compression_enabled)\n    {\n        sremain = (unsigned int)uiLzxc.length;\n        if (uiLzxc.length > sizeof(sbuffer))\n        {\n            chm_close(newHandle);\n            return NULL;\n        }\n\n        sbufpos = sbuffer;\n        if (chm_retrieve_object(newHandle, &uiLzxc, sbuffer,\n                                0, sremain) != sremain                       ||\n            !_unmarshal_lzxc_control_data(&sbufpos, &sremain,\n                                          &ctlData))\n        {\n            newHandle->compression_enabled = 0;\n        }\n        else /* SumatraPDF: prevent division by zero */\n        {\n\n        newHandle->window_size = ctlData.windowSize;\n        newHandle->reset_interval = ctlData.resetInterval;\n\n/* Jed, Mon Jun 28: Experimentally, it appears that the reset block count */\n/*       must be multiplied by this formerly unknown ctrl data field in   */\n/*       order to decompress some files.                                  */\n#if 0\n        newHandle->reset_blkcount = newHandle->reset_interval /\n                    (newHandle->window_size / 2);\n#else\n        newHandle->reset_blkcount = newHandle->reset_interval    /\n                                    (newHandle->window_size / 2) *\n                                    ctlData.windowsPerReset;\n#endif\n        }\n    }\n\n    /* initialize cache */\n    chm_set_param(newHandle, CHM_PARAM_MAX_BLOCKS_CACHED,\n                  CHM_MAX_BLOCKS_CACHED);\n\n    return newHandle;\n}\n\n/* close an ITS archive */\nvoid chm_close(struct chmFile *h)\n{\n    if (h != NULL)\n    {\n        if (h->fd != CHM_NULL_FD)\n            CHM_CLOSE_FILE(h->fd);\n        h->fd = CHM_NULL_FD;\n\n#ifdef CHM_MT\n#ifdef WIN32\n        DeleteCriticalSection(&h->mutex);\n        DeleteCriticalSection(&h->lzx_mutex);\n        DeleteCriticalSection(&h->cache_mutex);\n#else\n        pthread_mutex_destroy(&h->mutex);\n        pthread_mutex_destroy(&h->lzx_mutex);\n        pthread_mutex_destroy(&h->cache_mutex);\n#endif\n#endif\n\n        if (h->lzx_state)\n            LZXteardown(h->lzx_state);\n        h->lzx_state = NULL;\n\n        if (h->cache_blocks)\n        {\n            int i;\n            for (i=0; i<h->cache_num_blocks; i++)\n            {\n                if (h->cache_blocks[i])\n                    free(h->cache_blocks[i]);\n            }\n            free(h->cache_blocks);\n            h->cache_blocks = NULL;\n        }\n\n        if (h->cache_block_indices)\n            free(h->cache_block_indices);\n        h->cache_block_indices = NULL;\n\n        free(h);\n    }\n}\n\n/*\n * set a parameter on the file handle.\n * valid parameter types:\n *          CHM_PARAM_MAX_BLOCKS_CACHED:\n *                 how many decompressed blocks should be cached?  A simple\n *                 caching scheme is used, wherein the index of the block is\n *                 used as a hash value, and hash collision results in the\n *                 invalidation of the previously cached block.\n */\nvoid chm_set_param(struct chmFile *h,\n                   int paramType,\n                   int paramVal)\n{\n    switch (paramType)\n    {\n        case CHM_PARAM_MAX_BLOCKS_CACHED:\n            CHM_ACQUIRE_LOCK(h->cache_mutex);\n            if (paramVal != h->cache_num_blocks)\n            {\n                UChar **newBlocks;\n                UInt64 *newIndices;\n                int     i;\n\n                /* allocate new cached blocks */\n                newBlocks = (UChar **)malloc(paramVal * sizeof (UChar *));\n                if (newBlocks == NULL) return;\n                newIndices = (UInt64 *)malloc(paramVal * sizeof (UInt64));\n                if (newIndices == NULL) { free(newBlocks); return; }\n                for (i=0; i<paramVal; i++)\n                {\n                    newBlocks[i] = NULL;\n                    newIndices[i] = 0;\n                }\n\n                /* re-distribute old cached blocks */\n                if (h->cache_blocks)\n                {\n                    for (i=0; i<h->cache_num_blocks; i++)\n                    {\n                        int newSlot = (int)(h->cache_block_indices[i] % paramVal);\n\n                        if (h->cache_blocks[i])\n                        {\n                            /* in case of collision, destroy newcomer */\n                            if (newBlocks[newSlot])\n                            {\n                                free(h->cache_blocks[i]);\n                                h->cache_blocks[i] = NULL;\n                            }\n                            else\n                            {\n                                newBlocks[newSlot] = h->cache_blocks[i];\n                                newIndices[newSlot] =\n                                            h->cache_block_indices[i];\n                            }\n                        }\n                    }\n\n                    free(h->cache_blocks);\n                    free(h->cache_block_indices);\n                }\n\n                /* now, set new values */\n                h->cache_blocks = newBlocks;\n                h->cache_block_indices = newIndices;\n                h->cache_num_blocks = paramVal;\n            }\n            CHM_RELEASE_LOCK(h->cache_mutex);\n            break;\n\n        default:\n            break;\n    }\n}\n\n/*\n * helper methods for chm_resolve_object\n */\n\n/* skip a compressed dword */\nstatic void _chm_skip_cword(UChar **pEntry)\n{\n    while (*(*pEntry)++ >= 0x80)\n        ;\n}\n\n/* skip the data from a PMGL entry */\nstatic void _chm_skip_PMGL_entry_data(UChar **pEntry)\n{\n    _chm_skip_cword(pEntry);\n    _chm_skip_cword(pEntry);\n    _chm_skip_cword(pEntry);\n}\n\n/* parse a compressed dword */\nstatic UInt64 _chm_parse_cword(UChar **pEntry)\n{\n    UInt64 accum = 0;\n    UChar temp;\n    while ((temp=*(*pEntry)++) >= 0x80)\n    {\n        accum <<= 7;\n        accum += temp & 0x7f;\n    }\n\n    return (accum << 7) + temp;\n}\n\n/* parse a utf-8 string into an ASCII char buffer */\nstatic int _chm_parse_UTF8(UChar **pEntry, UInt64 count, char *path)\n{\n    /* XXX: implement UTF-8 support, including a real mapping onto\n     *      ISO-8859-1?  probably there is a library to do this?  As is\n     *      immediately apparent from the below code, I'm presently not doing\n     *      any special handling for files in which none of the strings contain\n     *      UTF-8 multi-byte characters.\n     */\n    while (count != 0)\n    {\n        *path++ = (char)(*(*pEntry)++);\n        --count;\n    }\n\n    *path = '\\0';\n    return 1;\n}\n\n/* parse a PMGL entry into a chmUnitInfo struct; return 1 on success. */\nstatic int _chm_parse_PMGL_entry(UChar **pEntry, struct chmUnitInfo *ui)\n{\n    UInt64 strLen;\n\n    /* parse str len */\n    strLen = _chm_parse_cword(pEntry);\n    if (strLen > CHM_MAX_PATHLEN)\n        return 0;\n\n    /* parse path */\n    if (! _chm_parse_UTF8(pEntry, strLen, ui->path))\n        return 0;\n\n    /* parse info */\n    ui->space  = (int)_chm_parse_cword(pEntry);\n    ui->start  = _chm_parse_cword(pEntry);\n    ui->length = _chm_parse_cword(pEntry);\n    return 1;\n}\n\n/* find an exact entry in PMGL; return NULL if we fail */\nstatic UChar *_chm_find_in_PMGL(UChar *page_buf,\n                         UInt32 block_len,\n                         const char *objPath)\n{\n    /* XXX: modify this to do a binary search using the nice index structure\n     *      that is provided for us.\n     */\n    struct chmPmglHeader header;\n    unsigned int hremain;\n    UChar *end;\n    UChar *cur;\n    UChar *temp;\n    UInt64 strLen;\n    char buffer[CHM_MAX_PATHLEN+1];\n\n    /* figure out where to start and end */\n    cur = page_buf;\n    hremain = _CHM_PMGL_LEN;\n    if (! _unmarshal_pmgl_header(&cur, &hremain, block_len, &header))\n        return NULL;\n    end = page_buf + block_len - (header.free_space);\n\n    /* now, scan progressively */\n    while (cur < end)\n    {\n        /* grab the name */\n        temp = cur;\n        strLen = _chm_parse_cword(&cur);\n        if (strLen > CHM_MAX_PATHLEN)\n            return NULL;\n        if (! _chm_parse_UTF8(&cur, strLen, buffer))\n            return NULL;\n\n        /* check if it is the right name */\n        if (! strcasecmp(buffer, objPath))\n            return temp;\n\n        _chm_skip_PMGL_entry_data(&cur);\n    }\n\n    return NULL;\n}\n\n/* find which block should be searched next for the entry; -1 if no block */\nstatic Int32 _chm_find_in_PMGI(UChar *page_buf,\n                        UInt32 block_len,\n                        const char *objPath)\n{\n    /* XXX: modify this to do a binary search using the nice index structure\n     *      that is provided for us\n     */\n    struct chmPmgiHeader header;\n    unsigned int hremain;\n    int page=-1;\n    UChar *end;\n    UChar *cur;\n    UInt64 strLen;\n    char buffer[CHM_MAX_PATHLEN+1];\n\n    /* figure out where to start and end */\n    cur = page_buf;\n    hremain = _CHM_PMGI_LEN;\n    if (! _unmarshal_pmgi_header(&cur, &hremain, block_len, &header))\n        return -1;\n    end = page_buf + block_len - (header.free_space);\n\n    /* now, scan progressively */\n    while (cur < end)\n    {\n        /* grab the name */\n        strLen = _chm_parse_cword(&cur);\n        if (strLen > CHM_MAX_PATHLEN)\n            return -1;\n        if (! _chm_parse_UTF8(&cur, strLen, buffer))\n            return -1;\n\n        /* check if it is the right name */\n        if (strcasecmp(buffer, objPath) > 0)\n            return page;\n\n        /* load next value for path */\n        page = (int)_chm_parse_cword(&cur);\n    }\n\n    return page;\n}\n\n/* resolve a particular object from the archive */\nint chm_resolve_object(struct chmFile *h,\n                       const char *objPath,\n                       struct chmUnitInfo *ui)\n{\n    /*\n     * XXX: implement caching scheme for dir pages\n     */\n\n    Int32 curPage;\n\n    /* buffer to hold whatever page we're looking at */\n    /* RWE 6/12/2003 */\n    UChar *page_buf = malloc(h->block_len);\n    if (page_buf == NULL)\n        return CHM_RESOLVE_FAILURE;\n\n    /* starting page */\n    curPage = h->index_root;\n\n    /* until we have either returned or given up */\n    while (curPage != -1)\n    {\n\n        /* try to fetch the index page */\n        if (_chm_fetch_bytes(h, page_buf,\n                             (UInt64)h->dir_offset + (UInt64)curPage*h->block_len,\n                             h->block_len) != h->block_len)\n        {\n            free(page_buf);\n            return CHM_RESOLVE_FAILURE;\n        }\n\n        /* now, if it is a leaf node: */\n        if (memcmp(page_buf, _chm_pmgl_marker, 4) == 0)\n        {\n            /* scan block */\n            UChar *pEntry = _chm_find_in_PMGL(page_buf,\n                                              h->block_len,\n                                              objPath);\n            if (pEntry == NULL)\n            {\n                free(page_buf);\n                return CHM_RESOLVE_FAILURE;\n            }\n\n            /* parse entry and return */\n            _chm_parse_PMGL_entry(&pEntry, ui);\n            free(page_buf);\n            return CHM_RESOLVE_SUCCESS;\n        }\n\n        /* else, if it is a branch node: */\n        else if (memcmp(page_buf, _chm_pmgi_marker, 4) == 0)\n            curPage = _chm_find_in_PMGI(page_buf, h->block_len, objPath);\n\n        /* else, we are confused.  give up. */\n        else\n        {\n            free(page_buf);\n            return CHM_RESOLVE_FAILURE;\n        }\n    }\n\n    /* didn't find anything.  fail. */\n    free(page_buf);\n    return CHM_RESOLVE_FAILURE;\n}\n\n/*\n * utility methods for dealing with compressed data\n */\n\n/* get the bounds of a compressed block.  return 0 on failure */\nstatic int _chm_get_cmpblock_bounds(struct chmFile *h,\n                             UInt64 block,\n                             UInt64 *start,\n                             Int64 *len)\n{\n    UChar buffer[8], *dummy;\n    unsigned int remain;\n\n    /* for all but the last block, use the reset table */\n    if (block < h->reset_table.block_count-1)\n    {\n        /* unpack the start address */\n        dummy = buffer;\n        remain = 8;\n        if (_chm_fetch_bytes(h, buffer,\n                             (UInt64)h->data_offset\n                                + (UInt64)h->rt_unit.start\n                                + (UInt64)h->reset_table.table_offset\n                                + (UInt64)block*8,\n                             remain) != remain                            ||\n            !_unmarshal_uint64(&dummy, &remain, start))\n            return 0;\n\n        /* unpack the end address */\n        dummy = buffer;\n        remain = 8;\n        if (_chm_fetch_bytes(h, buffer,\n                         (UInt64)h->data_offset\n                                + (UInt64)h->rt_unit.start\n                                + (UInt64)h->reset_table.table_offset\n                                + (UInt64)block*8 + 8,\n                         remain) != remain                                ||\n            !_unmarshal_int64(&dummy, &remain, len))\n            return 0;\n    }\n\n    /* for the last block, use the span in addition to the reset table */\n    else\n    {\n        /* unpack the start address */\n        dummy = buffer;\n        remain = 8;\n        if (_chm_fetch_bytes(h, buffer,\n                             (UInt64)h->data_offset\n                                + (UInt64)h->rt_unit.start\n                                + (UInt64)h->reset_table.table_offset\n                                + (UInt64)block*8,\n                             remain) != remain                            ||\n            !_unmarshal_uint64(&dummy, &remain, start))\n            return 0;\n\n        *len = h->reset_table.compressed_len;\n    }\n\n    /* compute the length and absolute start address */\n    *len -= *start;\n    *start += h->data_offset + h->cn_unit.start;\n\n    return 1;\n}\n\n/* decompress the block.  must have lzx_mutex. */\nstatic Int64 _chm_decompress_block(struct chmFile *h,\n                                   UInt64 block,\n                                   UChar **ubuffer)\n{\n    UChar *cbuffer = malloc(((unsigned int)h->reset_table.block_len + 6144));\n    UInt64 cmpStart;                                    /* compressed start  */\n    Int64 cmpLen;                                       /* compressed len    */\n    int indexSlot;                                      /* cache index slot  */\n    UChar *lbuffer;                                     /* local buffer ptr  */\n    UInt32 blockAlign = (UInt32)(block % h->reset_blkcount); /* reset intvl. aln. */\n    UInt32 i;                                           /* local loop index  */\n\n    if (cbuffer == NULL)\n        return -1;\n\n    /* let the caching system pull its weight! */\n    if (block - blockAlign <= h->lzx_last_block  &&\n        block              >= h->lzx_last_block)\n        blockAlign = (block - h->lzx_last_block);\n\n    /* check if we need previous blocks */\n    if (blockAlign != 0)\n    {\n        /* fetch all required previous blocks since last reset */\n        for (i = blockAlign; i > 0; i--)\n        {\n            UInt32 curBlockIdx = block - i;\n\n            /* check if we most recently decompressed the previous block */\n            if (h->lzx_last_block != (int)curBlockIdx)\n            {\n                if ((curBlockIdx % h->reset_blkcount) == 0)\n                {\n#ifdef CHM_DEBUG\n                    fprintf(stderr, \"***RESET (1)***\\n\");\n#endif\n                    LZXreset(h->lzx_state);\n                }\n\n                indexSlot = (int)((curBlockIdx) % h->cache_num_blocks);\n                if (! h->cache_blocks[indexSlot])\n                    h->cache_blocks[indexSlot] = (UChar *)malloc((unsigned int)(h->reset_table.block_len));\n                if (! h->cache_blocks[indexSlot])\n                {\n                    free(cbuffer);\n                    return -1;\n                }\n                h->cache_block_indices[indexSlot] = curBlockIdx;\n                lbuffer = h->cache_blocks[indexSlot];\n\n                /* decompress the previous block */\n#ifdef CHM_DEBUG\n                fprintf(stderr, \"Decompressing block #%4d (EXTRA)\\n\", curBlockIdx);\n#endif\n                if (!_chm_get_cmpblock_bounds(h, curBlockIdx, &cmpStart, &cmpLen) ||\n                    cmpLen < 0                                                    ||\n                    cmpLen > h->reset_table.block_len + 6144                      ||\n                    _chm_fetch_bytes(h, cbuffer, cmpStart, cmpLen) != cmpLen      ||\n                    LZXdecompress(h->lzx_state, cbuffer, lbuffer, (int)cmpLen,\n                                  (int)h->reset_table.block_len) != DECR_OK)\n                {\n#ifdef CHM_DEBUG\n                    fprintf(stderr, \"   (DECOMPRESS FAILED!)\\n\");\n#endif\n                    free(cbuffer);\n                    return (Int64)0;\n                }\n\n                h->lzx_last_block = (int)curBlockIdx;\n            }\n        }\n    }\n    else\n    {\n        if ((block % h->reset_blkcount) == 0)\n        {\n#ifdef CHM_DEBUG\n            fprintf(stderr, \"***RESET (2)***\\n\");\n#endif\n            LZXreset(h->lzx_state);\n        }\n    }\n\n    /* allocate slot in cache */\n    indexSlot = (int)(block % h->cache_num_blocks);\n    if (! h->cache_blocks[indexSlot])\n        h->cache_blocks[indexSlot] = (UChar *)malloc(((unsigned int)h->reset_table.block_len));\n    if (! h->cache_blocks[indexSlot])\n    {\n        free(cbuffer);\n        return -1;\n    }\n    h->cache_block_indices[indexSlot] = block;\n    lbuffer = h->cache_blocks[indexSlot];\n    *ubuffer = lbuffer;\n\n    /* decompress the block we actually want */\n#ifdef CHM_DEBUG\n    fprintf(stderr, \"Decompressing block #%4d (REAL )\\n\", block);\n#endif\n    if (! _chm_get_cmpblock_bounds(h, block, &cmpStart, &cmpLen)          ||\n        _chm_fetch_bytes(h, cbuffer, cmpStart, cmpLen) != cmpLen          ||\n        LZXdecompress(h->lzx_state, cbuffer, lbuffer, (int)cmpLen,\n                      (int)h->reset_table.block_len) != DECR_OK)\n    {\n#ifdef CHM_DEBUG\n        fprintf(stderr, \"   (DECOMPRESS FAILED!)\\n\");\n#endif\n        free(cbuffer);\n        return (Int64)0;\n    }\n    h->lzx_last_block = (int)block;\n\n    /* XXX: modify LZX routines to return the length of the data they\n     * decompressed and return that instead, for an extra sanity check.\n     */\n    free(cbuffer);\n    return h->reset_table.block_len;\n}\n\n/* grab a region from a compressed block */\nstatic Int64 _chm_decompress_region(struct chmFile *h,\n                                    UChar *buf,\n                                    UInt64 start,\n                                    Int64 len)\n{\n    UInt64 nBlock, nOffset;\n    UInt64 nLen;\n    UInt64 gotLen;\n    UChar *ubuffer;\n\n    if (len <= 0)\n        return (Int64)0;\n\n    /* figure out what we need to read */\n    nBlock = start / h->reset_table.block_len;\n    nOffset = start % h->reset_table.block_len;\n    nLen = len;\n    if (nLen > (h->reset_table.block_len - nOffset))\n        nLen = h->reset_table.block_len - nOffset;\n\n    /* if block is cached, return data from it. */\n    CHM_ACQUIRE_LOCK(h->lzx_mutex);\n    CHM_ACQUIRE_LOCK(h->cache_mutex);\n    if (h->cache_block_indices[nBlock % h->cache_num_blocks] == nBlock    &&\n        h->cache_blocks[nBlock % h->cache_num_blocks] != NULL)\n    {\n        memcpy(buf,\n               h->cache_blocks[nBlock % h->cache_num_blocks] + nOffset,\n               (unsigned int)nLen);\n        CHM_RELEASE_LOCK(h->cache_mutex);\n        CHM_RELEASE_LOCK(h->lzx_mutex);\n        return nLen;\n    }\n    CHM_RELEASE_LOCK(h->cache_mutex);\n\n    /* data request not satisfied, so... start up the decompressor machine */\n    if (! h->lzx_state)\n    {\n        int window_size = ffs(h->window_size) - 1;\n        h->lzx_last_block = -1;\n        h->lzx_state = LZXinit(window_size);\n    }\n\n    /* decompress some data */\n    gotLen = _chm_decompress_block(h, nBlock, &ubuffer);\n    /* SumatraPDF: check return value */\n    if (gotLen == (UInt64)-1)\n    {\n        CHM_RELEASE_LOCK(h->lzx_mutex);\n        return 0;\n    }\n    if (gotLen < nLen)\n        nLen = gotLen;\n    memcpy(buf, ubuffer+nOffset, (unsigned int)nLen);\n    CHM_RELEASE_LOCK(h->lzx_mutex);\n    return nLen;\n}\n\n/* retrieve (part of) an object */\nLONGINT64 chm_retrieve_object(struct chmFile *h,\n                               struct chmUnitInfo *ui,\n                               unsigned char *buf,\n                               LONGUINT64 addr,\n                               LONGINT64 len)\n{\n    /* must be valid file handle */\n    if (h == NULL)\n        return (Int64)0;\n\n    /* starting address must be in correct range */\n    if (addr < 0  ||  addr >= ui->length)\n        return (Int64)0;\n\n    /* clip length */\n    if (addr + len > ui->length)\n        len = ui->length - addr;\n\n    /* if the file is uncompressed, it's simple */\n    if (ui->space == CHM_UNCOMPRESSED)\n    {\n        /* read data */\n        return _chm_fetch_bytes(h,\n                                buf,\n                                (UInt64)h->data_offset + (UInt64)ui->start + (UInt64)addr,\n                                len);\n    }\n\n    /* else if the file is compressed, it's a little trickier */\n    else /* ui->space == CHM_COMPRESSED */\n    {\n        Int64 swath=0, total=0;\n\n        /* if compression is not enabled for this file... */\n        if (! h->compression_enabled)\n            return total;\n\n        do {\n\n            /* swill another mouthful */\n            swath = _chm_decompress_region(h, buf, ui->start + addr, len);\n\n            /* if we didn't get any... */\n            if (swath == 0)\n                return total;\n\n            /* update stats */\n            total += swath;\n            len -= swath;\n            addr += swath;\n            buf += swath;\n\n        } while (len != 0);\n\n        return total;\n    }\n}\n\n/* enumerate the objects in the .chm archive */\nint chm_enumerate(struct chmFile *h,\n                  int what,\n                  CHM_ENUMERATOR e,\n                  void *context)\n{\n    Int32 curPage;\n\n    /* buffer to hold whatever page we're looking at */\n    /* RWE 6/12/2003 */\n    UChar *page_buf = malloc((unsigned int)h->block_len);\n    struct chmPmglHeader header;\n    UChar *end;\n    UChar *cur;\n    unsigned int lenRemain;\n    UInt64 ui_path_len;\n\n    /* the current ui */\n    struct chmUnitInfo ui;\n    int type_bits = (what & 0x7);\n    int filter_bits = (what & 0xF8);\n\n    if (page_buf == NULL)\n        return 0;\n\n    /* starting page */\n    curPage = h->index_head;\n\n    /* until we have either returned or given up */\n    while (curPage != -1)\n    {\n\n        /* try to fetch the index page */\n        if (_chm_fetch_bytes(h,\n                             page_buf,\n                             (UInt64)h->dir_offset + (UInt64)curPage*h->block_len,\n                             h->block_len) != h->block_len)\n        {\n            free(page_buf);\n            return 0;\n        }\n\n        /* figure out start and end for this page */\n        cur = page_buf;\n        lenRemain = _CHM_PMGL_LEN;\n        if (! _unmarshal_pmgl_header(&cur, &lenRemain, h->block_len, &header))\n        {\n            free(page_buf);\n            return 0;\n        }\n        end = page_buf + h->block_len - (header.free_space);\n\n        /* loop over this page */\n        while (cur < end)\n        {\n            ui.flags = 0;\n\n            if (! _chm_parse_PMGL_entry(&cur, &ui))\n            {\n                free(page_buf);\n                return 0;\n            }\n\n            /* get the length of the path */\n            ui_path_len = strlen(ui.path)-1;\n\n            /* check for DIRS */\n            if (ui.path[ui_path_len] == '/')\n                ui.flags |= CHM_ENUMERATE_DIRS;\n\n            /* check for FILES */\n            if (ui.path[ui_path_len] != '/')\n                ui.flags |= CHM_ENUMERATE_FILES;\n\n            /* check for NORMAL vs. META */\n            if (ui.path[0] == '/')\n            {\n\n                /* check for NORMAL vs. SPECIAL */\n                if (ui.path[1] == '#'  ||  ui.path[1] == '$')\n                    ui.flags |= CHM_ENUMERATE_SPECIAL;\n                else\n                    ui.flags |= CHM_ENUMERATE_NORMAL;\n            }\n            else\n                ui.flags |= CHM_ENUMERATE_META;\n\n            if (! (type_bits & ui.flags))\n                continue;\n\n            if (filter_bits && ! (filter_bits & ui.flags))\n                continue;\n\n            /* call the enumerator */\n            {\n                int status = (*e)(h, &ui, context);\n                switch (status)\n                {\n                    case CHM_ENUMERATOR_FAILURE:\n                        free(page_buf);\n                        return 0;\n                    case CHM_ENUMERATOR_CONTINUE:\n                        break;\n                    case CHM_ENUMERATOR_SUCCESS:\n                        free(page_buf);\n                        return 1;\n                    default:\n                        break;\n                }\n            }\n        }\n\n        /* advance to next page */\n        curPage = header.block_next;\n    }\n\n    free(page_buf);\n    return 1;\n}\n\nint chm_enumerate_dir(struct chmFile *h,\n                      const char *prefix,\n                      int what,\n                      CHM_ENUMERATOR e,\n                      void *context)\n{\n    /*\n     * XXX: do this efficiently (i.e. using the tree index)\n     */\n\n    Int32 curPage;\n\n    /* buffer to hold whatever page we're looking at */\n    /* RWE 6/12/2003 */\n    UChar *page_buf = malloc((unsigned int)h->block_len);\n    struct chmPmglHeader header;\n    UChar *end;\n    UChar *cur;\n    unsigned int lenRemain;\n\n    /* set to 1 once we've started */\n    int it_has_begun=0;\n\n    /* the current ui */\n    struct chmUnitInfo ui;\n    int type_bits = (what & 0x7);\n    int filter_bits = (what & 0xF8);\n    UInt64 ui_path_len;\n\n    /* the length of the prefix */\n    char prefixRectified[CHM_MAX_PATHLEN+1];\n    int prefixLen;\n    char lastPath[CHM_MAX_PATHLEN+1];\n    int lastPathLen;\n\n    if (page_buf == NULL)\n        return 0;\n\n    /* starting page */\n    curPage = h->index_head;\n\n    /* initialize pathname state */\n    strncpy(prefixRectified, prefix, CHM_MAX_PATHLEN);\n    prefixRectified[CHM_MAX_PATHLEN] = '\\0';\n    prefixLen = strlen(prefixRectified);\n    if (prefixLen != 0)\n    {\n        if (prefixRectified[prefixLen-1] != '/')\n        {\n            prefixRectified[prefixLen] = '/';\n            prefixRectified[prefixLen+1] = '\\0';\n            ++prefixLen;\n        }\n    }\n    lastPath[0] = '\\0';\n    lastPathLen = -1;\n\n    /* until we have either returned or given up */\n    while (curPage != -1)\n    {\n\n        /* try to fetch the index page */\n        if (_chm_fetch_bytes(h,\n                             page_buf,\n                             (UInt64)h->dir_offset + (UInt64)curPage*h->block_len,\n                             h->block_len) != h->block_len)\n        {\n            free(page_buf);\n            return 0;\n        }\n\n        /* figure out start and end for this page */\n        cur = page_buf;\n        lenRemain = _CHM_PMGL_LEN;\n        if (! _unmarshal_pmgl_header(&cur, &lenRemain, h->block_len, &header))\n        {\n            free(page_buf);\n            return 0;\n        }\n        end = page_buf + h->block_len - (header.free_space);\n\n        /* loop over this page */\n        while (cur < end)\n        {\n            ui.flags = 0;\n\n            if (! _chm_parse_PMGL_entry(&cur, &ui))\n            {\n                free(page_buf);\n                return 0;\n            }\n\n            /* check if we should start */\n            if (! it_has_begun)\n            {\n                if (ui.length == 0  &&  strncasecmp(ui.path, prefixRectified, prefixLen) == 0)\n                    it_has_begun = 1;\n                else\n                    continue;\n\n                if (ui.path[prefixLen] == '\\0')\n                    continue;\n            }\n\n            /* check if we should stop */\n            else\n            {\n                if (strncasecmp(ui.path, prefixRectified, prefixLen) != 0)\n                {\n                    free(page_buf);\n                    return 1;\n                }\n            }\n\n            /* check if we should include this path */\n            if (lastPathLen != -1)\n            {\n                if (strncasecmp(ui.path, lastPath, lastPathLen) == 0)\n                    continue;\n            }\n            strncpy(lastPath, ui.path, CHM_MAX_PATHLEN);\n            lastPath[CHM_MAX_PATHLEN] = '\\0';\n            lastPathLen = strlen(lastPath);\n\n            /* get the length of the path */\n            ui_path_len = strlen(ui.path)-1;\n\n            /* check for DIRS */\n            if (ui.path[ui_path_len] == '/')\n                ui.flags |= CHM_ENUMERATE_DIRS;\n\n            /* check for FILES */\n            if (ui.path[ui_path_len] != '/')\n                ui.flags |= CHM_ENUMERATE_FILES;\n\n            /* check for NORMAL vs. META */\n            if (ui.path[0] == '/')\n            {\n\n                /* check for NORMAL vs. SPECIAL */\n                if (ui.path[1] == '#'  ||  ui.path[1] == '$')\n                    ui.flags |= CHM_ENUMERATE_SPECIAL;\n                else\n                    ui.flags |= CHM_ENUMERATE_NORMAL;\n            }\n            else\n                ui.flags |= CHM_ENUMERATE_META;\n\n            if (! (type_bits & ui.flags))\n                continue;\n\n            if (filter_bits && ! (filter_bits & ui.flags))\n                continue;\n\n            /* call the enumerator */\n            {\n                int status = (*e)(h, &ui, context);\n                switch (status)\n                {\n                    case CHM_ENUMERATOR_FAILURE:\n                        free(page_buf);\n                        return 0;\n                    case CHM_ENUMERATOR_CONTINUE:\n                        break;\n                    case CHM_ENUMERATOR_SUCCESS:\n                        free(page_buf);\n                        return 1;\n                    default:\n                        break;\n                }\n            }\n        }\n\n        /* advance to next page */\n        curPage = header.block_next;\n    }\n\n    free(page_buf);\n    return 1;\n}\n"
  },
  {
    "path": "ext/CHMLib/src/chm_lib.h",
    "content": "/* $Id: chm_lib.h,v 1.10 2002/10/09 01:16:33 jedwin Exp $ */\n/***************************************************************************\n *             chm_lib.h - CHM archive manipulation routines               *\n *                           -------------------                           *\n *                                                                         *\n *  author:     Jed Wing <jedwin@ugcs.caltech.edu>                         *\n *  version:    0.3                                                        *\n *  notes:      These routines are meant for the manipulation of microsoft *\n *              .chm (compiled html help) files, but may likely be used    *\n *              for the manipulation of any ITSS archive, if ever ITSS     *\n *              archives are used for any other purpose.                   *\n *                                                                         *\n *              Note also that the section names are statically handled.   *\n *              To be entirely correct, the section names should be read   *\n *              from the section names meta-file, and then the various     *\n *              content sections and the \"transforms\" to apply to the data *\n *              they contain should be inferred from the section name and  *\n *              the meta-files referenced using that name; however, all of *\n *              the files I've been able to get my hands on appear to have *\n *              only two sections: Uncompressed and MSCompressed.          *\n *              Additionally, the ITSS.DLL file included with Windows does *\n *              not appear to handle any different transforms than the     *\n *              simple LZX-transform.  Furthermore, the list of transforms *\n *              to apply is broken, in that only half the required space   *\n *              is allocated for the list.  (It appears as though the      *\n *              space is allocated for ASCII strings, but the strings are  *\n *              written as unicode.  As a result, only the first half of   *\n *              the string appears.)  So this is probably not too big of   *\n *              a deal, at least until CHM v4 (MS .lit files), which also  *\n *              incorporate encryption, of some description.               *\n ***************************************************************************/\n\n/***************************************************************************\n *                                                                         *\n *   This program is free software; you can redistribute it and/or modify  *\n *   it under the terms of the GNU Lesser General Public License as        *\n *   published by the Free Software Foundation; either version 2.1 of the  *\n *   License, or (at your option) any later version.                       *\n *                                                                         *\n ***************************************************************************/\n\n#ifndef INCLUDED_CHMLIB_H\n#define INCLUDED_CHMLIB_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/* RWE 6/12/1002 */\n#ifdef PPC_BSTR\n#include <wtypes.h>\n#endif\n\n#ifdef WIN32\n#ifdef __MINGW32__\n#define __int64 long long\n#endif\ntypedef unsigned __int64 LONGUINT64;\ntypedef __int64          LONGINT64;\n#else\ntypedef unsigned long long LONGUINT64;\ntypedef long long          LONGINT64;\n#endif\n\n/* the two available spaces in a CHM file                      */\n/* N.B.: The format supports arbitrarily many spaces, but only */\n/*       two appear to be used at present.                     */\n#define CHM_UNCOMPRESSED (0)\n#define CHM_COMPRESSED   (1)\n\n/* structure representing an ITS (CHM) file stream             */\nstruct chmFile;\n\n/* structure representing an element from an ITS file stream   */\n#define CHM_MAX_PATHLEN  (512)\nstruct chmUnitInfo\n{\n    LONGUINT64         start;\n    LONGUINT64         length;\n    int                space;\n    int                flags;\n    char               path[CHM_MAX_PATHLEN+1];\n};\n\n/* open an ITS archive */\n#ifdef PPC_BSTR\n/* RWE 6/12/2003 */\nstruct chmFile* chm_open(BSTR filename);\n#else\nstruct chmFile* chm_open(const char *filename);\n#endif\n\n/* close an ITS archive */\nvoid chm_close(struct chmFile *h);\n\n/* methods for ssetting tuning parameters for particular file */\n#define CHM_PARAM_MAX_BLOCKS_CACHED 0\nvoid chm_set_param(struct chmFile *h,\n                   int paramType,\n                   int paramVal);\n\n/* resolve a particular object from the archive */\n#define CHM_RESOLVE_SUCCESS (0)\n#define CHM_RESOLVE_FAILURE (1)\nint chm_resolve_object(struct chmFile *h,\n                       const char *objPath,\n                       struct chmUnitInfo *ui);\n\n/* retrieve part of an object from the archive */\nLONGINT64 chm_retrieve_object(struct chmFile *h,\n                              struct chmUnitInfo *ui,\n                              unsigned char *buf,\n                              LONGUINT64 addr,\n                              LONGINT64 len);\n\n/* enumerate the objects in the .chm archive */\ntypedef int (*CHM_ENUMERATOR)(struct chmFile *h,\n                              struct chmUnitInfo *ui,\n                              void *context);\n#define CHM_ENUMERATE_NORMAL    (1)\n#define CHM_ENUMERATE_META      (2)\n#define CHM_ENUMERATE_SPECIAL   (4)\n#define CHM_ENUMERATE_FILES     (8)\n#define CHM_ENUMERATE_DIRS      (16)\n#define CHM_ENUMERATE_ALL       (31)\n#define CHM_ENUMERATOR_FAILURE  (0)\n#define CHM_ENUMERATOR_CONTINUE (1)\n#define CHM_ENUMERATOR_SUCCESS  (2)\nint chm_enumerate(struct chmFile *h,\n                  int what,\n                  CHM_ENUMERATOR e,\n                  void *context);\n\nint chm_enumerate_dir(struct chmFile *h,\n                      const char *prefix,\n                      int what,\n                      CHM_ENUMERATOR e,\n                      void *context);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* INCLUDED_CHMLIB_H */\n"
  },
  {
    "path": "ext/CHMLib/src/enum_chmLib.c",
    "content": "/* $Id: enum_chmLib.c,v 1.7 2002/10/09 12:38:12 jedwin Exp $ */\n/***************************************************************************\n *          enum_chmLib.c - CHM archive test driver                        *\n *                           -------------------                           *\n *                                                                         *\n *  author:     Jed Wing <jedwin@ugcs.caltech.edu>                         *\n *  notes:      This is a quick-and-dirty test driver for the chm lib      *\n *              routines.  The program takes as its input the paths to one *\n *              or more .chm files.  It attempts to open each .chm file in *\n *              turn, and display a listing of all of the files in the     *\n *              archive.                                                   *\n *                                                                         *\n *              It is not included as a particularly useful program, but   *\n *              rather as a sort of \"simplest possible\" example of how to  *\n *              use the enumerate portion of the API.                      *\n ***************************************************************************/\n\n/***************************************************************************\n *                                                                         *\n *   This program is free software; you can redistribute it and/or modify  *\n *   it under the terms of the GNU Lesser General Public License as        *\n *   published by the Free Software Foundation; either version 2.1 of the  *\n *   License, or (at your option) any later version.                       *\n *                                                                         *\n ***************************************************************************/\n\n#include \"chm_lib.h\"\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n/*\n * callback function for enumerate API\n */\nint _print_ui(struct chmFile *h,\n              struct chmUnitInfo *ui,\n              void *context)\n{\n\tstatic char szBuf[128];\n\tmemset(szBuf, 0, 128);\n\tif(ui->flags & CHM_ENUMERATE_NORMAL)\n\t\tstrcpy(szBuf, \"normal \");\n\telse if(ui->flags & CHM_ENUMERATE_SPECIAL)\n\t\tstrcpy(szBuf, \"special \");\n\telse if(ui->flags & CHM_ENUMERATE_META)\n\t\tstrcpy(szBuf, \"meta \");\n\t\n\tif(ui->flags & CHM_ENUMERATE_DIRS)\n\t\tstrcat(szBuf, \"dir\");\n\telse if(ui->flags & CHM_ENUMERATE_FILES)\n\t\tstrcat(szBuf, \"file\");\n\n    printf(\"   %1d %8d %8d   %s\\t\\t%s\\n\",\n           (int)ui->space,\n           (int)ui->start,\n           (int)ui->length,\n\t\t   szBuf,\n           ui->path);\n    return CHM_ENUMERATOR_CONTINUE;\n}\n\nint main(int c, char **v)\n{\n    struct chmFile *h;\n    int i;\n\n    for (i=1; i<c; i++)\n    {\n        h = chm_open(v[i]);\n        if (h == NULL)\n        {\n            fprintf(stderr, \"failed to open %s\\n\", v[i]);\n            exit(1);\n        }\n\n        printf(\"%s:\\n\", v[i]);\n        printf(\" spc    start   length   type\\t\\t\\tname\\n\");\n        printf(\" ===    =====   ======   ====\\t\\t\\t====\\n\");\n\n        if (! chm_enumerate(h,\n                            CHM_ENUMERATE_ALL,\n                            _print_ui,\n                            NULL))\n            printf(\"   *** ERROR ***\\n\");\n\n        chm_close(h);\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "ext/CHMLib/src/enumdir_chmLib.c",
    "content": "/* $Id: enumdir_chmLib.c,v 1.3 2002/10/09 12:38:12 jedwin Exp $ */\n/***************************************************************************\n *          enumdir_chmLib.c - CHM archive test driver                     *\n *                           -------------------                           *\n *                                                                         *\n *  author:     Jed Wing <jedwin@ugcs.caltech.edu>                         *\n *  notes:      This is a quick-and-dirty test driver for the chm lib      *\n *              routines.  The program takes as its input the paths to one *\n *              or more .chm files.  It attempts to open each .chm file in *\n *              turn, and display a listing of all of the files in the     *\n *              archive.                                                   *\n *                                                                         *\n *              It is not included as a particularly useful program, but   *\n *              rather as a sort of \"simplest possible\" example of how to  *\n *              use the enumerate portion of the API.                      *\n ***************************************************************************/\n\n/***************************************************************************\n *                                                                         *\n *   This program is free software; you can redistribute it and/or modify  *\n *   it under the terms of the GNU Lesser General Public License as        *\n *   published by the Free Software Foundation; either version 2.1 of the  *\n *   License, or (at your option) any later version.                       *\n *                                                                         *\n ***************************************************************************/\n\n#include \"chm_lib.h\"\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n/*\n * callback function for enumerate API\n */\nint _print_ui(struct chmFile *h,\n              struct chmUnitInfo *ui,\n              void *context)\n{\n    static char szBuf[128];\n\tmemset(szBuf, 0, 128);\n\tif(ui->flags & CHM_ENUMERATE_NORMAL)\n\t\tstrcpy(szBuf, \"normal \");\n\telse if(ui->flags & CHM_ENUMERATE_SPECIAL)\n\t\tstrcpy(szBuf, \"special \");\n\telse if(ui->flags & CHM_ENUMERATE_META)\n\t\tstrcpy(szBuf, \"meta \");\n\t\n\tif(ui->flags & CHM_ENUMERATE_DIRS)\n\t\tstrcat(szBuf, \"dir\");\n\telse if(ui->flags & CHM_ENUMERATE_FILES)\n\t\tstrcat(szBuf, \"file\");\n\n    printf(\"   %1d %8d %8d   %s\\t\\t%s\\n\",\n           (int)ui->space,\n           (int)ui->start,\n           (int)ui->length,\n\t\t   szBuf,\n           ui->path);\n    return CHM_ENUMERATOR_CONTINUE;}\n\nint main(int c, char **v)\n{\n    struct chmFile *h;\n    int i;\n\n    if (c < 2)\n    {\n        fprintf(stderr, \"%s <chmfile> [dir] [dir] ...\\n\", v[0]);\n        exit(1);\n    }\n\n    h = chm_open(v[1]);\n    if (h == NULL)\n    {\n        fprintf(stderr, \"failed to open %s\\n\", v[1]);\n        exit(1);\n    }\n\n    if (c < 3)\n    {\n        printf(\"/:\\n\");\n        printf(\" spc    start   length   type\\t\\t\\tname\\n\");\n        printf(\" ===    =====   ======   ====\\t\\t\\t====\\n\");\n\t\t\n        if (! chm_enumerate_dir(h,\n                                \"/\",\n                                CHM_ENUMERATE_ALL,\n                                _print_ui,\n                                NULL))\n            printf(\"   *** ERROR ***\\n\");\n    }\n    else\n    {\n        for (i=2; i<c; i++)\n        {\n            printf(\"%s:\\n\", v[i]);\n            printf(\" spc    start   length   name\\n\");\n            printf(\" ===    =====   ======   ====\\n\");\n\n            if (! chm_enumerate_dir(h,\n                                    v[i],\n                                    CHM_ENUMERATE_ALL,\n                                    _print_ui,\n                                    NULL))\n            printf(\"   *** ERROR ***\\n\");\n        }\n    }\n\n    chm_close(h);\n\n    return 0;\n}\n"
  },
  {
    "path": "ext/CHMLib/src/extract_chmLib.c",
    "content": "/* $Id: extract_chmLib.c,v 1.4 2002/10/10 03:24:51 jedwin Exp $ */\n/***************************************************************************\n *          extract_chmLib.c - CHM archive extractor                       *\n *                           -------------------                           *\n *                                                                         *\n *  author:     Jed Wing <jedwin@ugcs.caltech.edu>                         *\n *  notes:      This is a quick-and-dirty chm archive extractor.           *\n ***************************************************************************/\n\n/***************************************************************************\n *                                                                         *\n *   This program is free software; you can redistribute it and/or modify  *\n *   it under the terms of the GNU Lesser General Public License as        *\n *   published by the Free Software Foundation; either version 2.1 of the  *\n *   License, or (at your option) any later version.                       *\n *                                                                         *\n ***************************************************************************/\n\n#include \"chm_lib.h\"\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#ifdef WIN32\n#include <windows.h>\n#include <direct.h>\n#define mkdir(X, Y) _mkdir(X)\n#define snprintf _snprintf\n#else\n#include <unistd.h>\n#include <sys/stat.h>\n#include <sys/types.h>\n#endif\n\nstruct extract_context\n{\n    const char *base_path;\n};\n\nstatic int dir_exists(const char *path)\n{\n#ifdef WIN32\n        /* why doesn't this work?!? */\n        HANDLE hFile;\n\n        hFile = CreateFileA(path,\n                        FILE_LIST_DIRECTORY,\n                        0,\n                        NULL,\n                        OPEN_EXISTING,\n                        FILE_ATTRIBUTE_NORMAL,\n                        NULL);\n        if (hFile != INVALID_HANDLE_VALUE)\n        {\n        CloseHandle(hFile);\n        return 1;\n        }\n        else\n        return 0;\n#else\n        struct stat statbuf;\n        if (stat(path, &statbuf) != -1)\n                return 1;\n        else\n                return 0;\n#endif\n}\n\nstatic int rmkdir(char *path)\n{\n    /*\n     * strip off trailing components unless we can stat the directory, or we\n     * have run out of components\n     */\n\n    char *i = strrchr(path, '/');\n\n    if(path[0] == '\\0'  ||  dir_exists(path))\n        return 0;\n\n    if (i != NULL)\n    {\n        *i = '\\0';\n        rmkdir(path);\n        *i = '/';\n        mkdir(path, 0777);\n    }\n\n#ifdef WIN32\n        return 0;\n#else\n    if (dir_exists(path))\n        return 0;\n    else\n        return -1;\n#endif\n}\n\n/*\n * callback function for enumerate API\n */\nint _extract_callback(struct chmFile *h,\n              struct chmUnitInfo *ui,\n              void *context)\n{\n    LONGUINT64 ui_path_len;\n    char buffer[32768];\n    struct extract_context *ctx = (struct extract_context *)context;\n    char *i;\n\n    if (ui->path[0] != '/')\n        return CHM_ENUMERATOR_CONTINUE;\n\n    /* quick hack for security hole mentioned by Sven Tantau */\n    if (strstr(ui->path, \"/../\") != NULL)\n    {\n        /* fprintf(stderr, \"Not extracting %s (dangerous path)\\n\", ui->path); */\n        return CHM_ENUMERATOR_CONTINUE;\n    }\n\n    if (snprintf(buffer, sizeof(buffer), \"%s%s\", ctx->base_path, ui->path) > 1024)\n        return CHM_ENUMERATOR_FAILURE;\n\n    /* Get the length of the path */\n    ui_path_len = strlen(ui->path)-1;\n\n    /* Distinguish between files and dirs */\n    if (ui->path[ui_path_len] != '/' )\n    {\n        FILE *fout;\n        LONGINT64 len, remain=ui->length;\n        LONGUINT64 offset = 0;\n\n        printf(\"--> %s\\n\", ui->path);\n        if ((fout = fopen(buffer, \"wb\")) == NULL)\n\t{\n\t    /* make sure that it isn't just a missing directory before we abort */ \n\t    char newbuf[32768];\n\t    strcpy(newbuf, buffer);\n\t    i = strrchr(newbuf, '/');\n\t    *i = '\\0';\n\t    rmkdir(newbuf);\n\t    if ((fout = fopen(buffer, \"wb\")) == NULL)\n              return CHM_ENUMERATOR_FAILURE;\n\t}\n\n        while (remain != 0)\n        {\n            len = chm_retrieve_object(h, ui, (unsigned char *)buffer, offset, 32768);\n            if (len > 0)\n            {\n                fwrite(buffer, 1, (size_t)len, fout);\n                offset += len;\n                remain -= len;\n            }\n            else\n            {\n                fprintf(stderr, \"incomplete file: %s\\n\", ui->path);\n                break;\n            }\n        }\n\n        fclose(fout);\n    }\n    else\n    {\n        if (rmkdir(buffer) == -1)\n            return CHM_ENUMERATOR_FAILURE;\n    }\n\n    return CHM_ENUMERATOR_CONTINUE;\n}\n\nint main(int c, char **v)\n{\n    struct chmFile *h;\n    struct extract_context ec;\n\n    if (c < 3)\n    {\n        fprintf(stderr, \"usage: %s <chmfile> <outdir>\\n\", v[0]);\n        exit(1);\n    }\n\n    h = chm_open(v[1]);\n    if (h == NULL)\n    {\n        fprintf(stderr, \"failed to open %s\\n\", v[1]);\n        exit(1);\n    }\n\n    printf(\"%s:\\n\", v[1]);\n    ec.base_path = v[2];\n    if (! chm_enumerate(h,\n                        CHM_ENUMERATE_ALL,\n                        _extract_callback,\n                        (void *)&ec))\n        printf(\"   *** ERROR ***\\n\");\n\n    chm_close(h);\n\n    return 0;\n}\n"
  },
  {
    "path": "ext/CHMLib/src/lzx.c",
    "content": "/* $Id: lzx.c,v 1.5 2002/10/09 01:16:33 jedwin Exp $ */\n/***************************************************************************\n *                        lzx.c - LZX decompression routines               *\n *                           -------------------                           *\n *                                                                         *\n *  maintainer: Jed Wing <jedwin@ugcs.caltech.edu>                         *\n *  source:     modified lzx.c from cabextract v0.5                        *\n *  notes:      This file was taken from cabextract v0.5, which was,       *\n *              itself, a modified version of the lzx decompression code   *\n *              from unlzx.                                                *\n *                                                                         *\n *  platforms:  In its current incarnation, this file has been tested on   *\n *              two different Linux platforms (one, redhat-based, with a   *\n *              2.1.2 glibc and gcc 2.95.x, and the other, Debian, with    *\n *              2.2.4 glibc and both gcc 2.95.4 and gcc 3.0.2).  Both were *\n *              Intel x86 compatible machines.                             *\n ***************************************************************************/\n\n/***************************************************************************\n *                                                                         *\n *   This program is free software; you can redistribute it and/or modify  *\n *   it under the terms of the GNU General Public License as published by  *\n *   the Free Software Foundation; either version 2 of the License, or     *\n *   (at your option) any later version.  Note that an exemption to this   *\n *   license has been granted by Stuart Caie for the purposes of           *\n *   distribution with chmlib.  This does not, to the best of my           *\n *   knowledge, constitute a change in the license of this (the LZX) code  *\n *   in general.                                                           *\n *                                                                         *\n ***************************************************************************/\n\n#include \"lzx.h\"\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#ifdef __GNUC__\n#define memcpy __builtin_memcpy\n#endif\n\n/* sized types */\ntypedef unsigned char  UBYTE; /* 8 bits exactly    */\ntypedef unsigned short UWORD; /* 16 bits (or more) */\ntypedef unsigned int   ULONG; /* 32 bits (or more) */\ntypedef   signed int    LONG; /* 32 bits (or more) */\n\n/* some constants defined by the LZX specification */\n#define LZX_MIN_MATCH                (2)\n#define LZX_MAX_MATCH                (257)\n#define LZX_NUM_CHARS                (256)\n#define LZX_BLOCKTYPE_INVALID        (0)   /* also blocktypes 4-7 invalid */\n#define LZX_BLOCKTYPE_VERBATIM       (1)\n#define LZX_BLOCKTYPE_ALIGNED        (2)\n#define LZX_BLOCKTYPE_UNCOMPRESSED   (3)\n#define LZX_PRETREE_NUM_ELEMENTS     (20)\n#define LZX_ALIGNED_NUM_ELEMENTS     (8)   /* aligned offset tree #elements */\n#define LZX_NUM_PRIMARY_LENGTHS      (7)   /* this one missing from spec! */\n#define LZX_NUM_SECONDARY_LENGTHS    (249) /* length tree #elements */\n\n/* LZX huffman defines: tweak tablebits as desired */\n#define LZX_PRETREE_MAXSYMBOLS  (LZX_PRETREE_NUM_ELEMENTS)\n#define LZX_PRETREE_TABLEBITS   (6)\n#define LZX_MAINTREE_MAXSYMBOLS (LZX_NUM_CHARS + 50*8)\n#define LZX_MAINTREE_TABLEBITS  (12)\n#define LZX_LENGTH_MAXSYMBOLS   (LZX_NUM_SECONDARY_LENGTHS+1)\n#define LZX_LENGTH_TABLEBITS    (12)\n#define LZX_ALIGNED_MAXSYMBOLS  (LZX_ALIGNED_NUM_ELEMENTS)\n#define LZX_ALIGNED_TABLEBITS   (7)\n\n#define LZX_LENTABLE_SAFETY (64) /* we allow length table decoding overruns */\n\n#define LZX_DECLARE_TABLE(tbl) \\\n  UWORD tbl##_table[(1<<LZX_##tbl##_TABLEBITS) + (LZX_##tbl##_MAXSYMBOLS<<1)];\\\n  UBYTE tbl##_len  [LZX_##tbl##_MAXSYMBOLS + LZX_LENTABLE_SAFETY]\n\nstruct LZXstate\n{\n    UBYTE *window;         /* the actual decoding window              */\n    ULONG window_size;     /* window size (32Kb through 2Mb)          */\n    ULONG actual_size;     /* window size when it was first allocated */\n    ULONG window_posn;     /* current offset within the window        */\n    ULONG R0, R1, R2;      /* for the LRU offset system               */\n    UWORD main_elements;   /* number of main tree elements            */\n    int   header_read;     /* have we started decoding at all yet?    */\n    UWORD block_type;      /* type of this block                      */\n    ULONG block_length;    /* uncompressed length of this block       */\n    ULONG block_remaining; /* uncompressed bytes still left to decode */\n    ULONG frames_read;     /* the number of CFDATA blocks processed   */\n    LONG  intel_filesize;  /* magic header value used for transform   */\n    LONG  intel_curpos;    /* current offset in transform space       */\n    int   intel_started;   /* have we seen any translatable data yet? */\n\n    LZX_DECLARE_TABLE(PRETREE);\n    LZX_DECLARE_TABLE(MAINTREE);\n    LZX_DECLARE_TABLE(LENGTH);\n    LZX_DECLARE_TABLE(ALIGNED);\n};\n\n/* LZX decruncher */\n\n/* Microsoft's LZX document and their implementation of the\n * com.ms.util.cab Java package do not concur.\n *\n * In the LZX document, there is a table showing the correlation between\n * window size and the number of position slots. It states that the 1MB\n * window = 40 slots and the 2MB window = 42 slots. In the implementation,\n * 1MB = 42 slots, 2MB = 50 slots. The actual calculation is 'find the\n * first slot whose position base is equal to or more than the required\n * window size'. This would explain why other tables in the document refer\n * to 50 slots rather than 42.\n *\n * The constant NUM_PRIMARY_LENGTHS used in the decompression pseudocode\n * is not defined in the specification.\n *\n * The LZX document does not state the uncompressed block has an\n * uncompressed length field. Where does this length field come from, so\n * we can know how large the block is? The implementation has it as the 24\n * bits following after the 3 blocktype bits, before the alignment\n * padding.\n *\n * The LZX document states that aligned offset blocks have their aligned\n * offset huffman tree AFTER the main and length trees. The implementation\n * suggests that the aligned offset tree is BEFORE the main and length\n * trees.\n *\n * The LZX document decoding algorithm states that, in an aligned offset\n * block, if an extra_bits value is 1, 2 or 3, then that number of bits\n * should be read and the result added to the match offset. This is\n * correct for 1 and 2, but not 3, where just a huffman symbol (using the\n * aligned tree) should be read.\n *\n * Regarding the E8 preprocessing, the LZX document states 'No translation\n * may be performed on the last 6 bytes of the input block'. This is\n * correct.  However, the pseudocode provided checks for the *E8 leader*\n * up to the last 6 bytes. If the leader appears between -10 and -7 bytes\n * from the end, this would cause the next four bytes to be modified, at\n * least one of which would be in the last 6 bytes, which is not allowed\n * according to the spec.\n *\n * The specification states that the huffman trees must always contain at\n * least one element. However, many CAB files contain blocks where the\n * length tree is completely empty (because there are no matches), and\n * this is expected to succeed.\n */\n\n\n/* LZX uses what it calls 'position slots' to represent match offsets.\n * What this means is that a small 'position slot' number and a small\n * offset from that slot are encoded instead of one large offset for\n * every match.\n * - position_base is an index to the position slot bases\n * - extra_bits states how many bits of offset-from-base data is needed.\n */\nstatic const UBYTE extra_bits[51] = {\n     0,  0,  0,  0,  1,  1,  2,  2,  3,  3,  4,  4,  5,  5,  6,  6,\n     7,  7,  8,  8,  9,  9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14,\n    15, 15, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,\n    17, 17, 17\n};\n\nstatic const ULONG position_base[51] = {\n          0,       1,       2,      3,      4,      6,      8,     12,     16,     24,     32,       48,      64,      96,     128,     192,\n        256,     384,     512,    768,   1024,   1536,   2048,   3072,   4096,   6144,   8192,    12288,   16384,   24576,   32768,   49152,\n      65536,   98304,  131072, 196608, 262144, 393216, 524288, 655360, 786432, 917504, 1048576, 1179648, 1310720, 1441792, 1572864, 1703936,\n    1835008, 1966080, 2097152\n};\n\nstruct LZXstate *LZXinit(int window)\n{\n    struct LZXstate *pState=NULL;\n    ULONG wndsize = 1 << window;\n    int i, posn_slots;\n\n    /* LZX supports window sizes of 2^15 (32Kb) through 2^21 (2Mb) */\n    /* if a previously allocated window is big enough, keep it     */\n    if (window < 15 || window > 21) return NULL;\n\n    /* allocate state and associated window */\n    pState = (struct LZXstate *)malloc(sizeof(struct LZXstate));\n    if (!pState || !(pState->window = (UBYTE *)malloc(wndsize)))\n    {\n        free(pState);\n        return NULL;\n    }\n    pState->actual_size = wndsize;\n    pState->window_size = wndsize;\n\n    /* calculate required position slots */\n    if (window == 20) posn_slots = 42;\n    else if (window == 21) posn_slots = 50;\n    else posn_slots = window << 1;\n\n    /** alternatively **/\n    /* posn_slots=i=0; while (i < wndsize) i += 1 << extra_bits[posn_slots++]; */\n\n    /* initialize other state */\n    pState->R0  =  pState->R1  = pState->R2 = 1;\n    pState->main_elements   = LZX_NUM_CHARS + (posn_slots << 3);\n    pState->header_read     = 0;\n    pState->frames_read     = 0;\n    pState->block_remaining = 0;\n    pState->block_type      = LZX_BLOCKTYPE_INVALID;\n    pState->intel_curpos    = 0;\n    pState->intel_started   = 0;\n    pState->window_posn     = 0;\n\n    /* initialise tables to 0 (because deltas will be applied to them) */\n    for (i = 0; i < LZX_MAINTREE_MAXSYMBOLS; i++) pState->MAINTREE_len[i] = 0;\n    for (i = 0; i < LZX_LENGTH_MAXSYMBOLS; i++)   pState->LENGTH_len[i]   = 0;\n\n    return pState;\n}\n\nvoid LZXteardown(struct LZXstate *pState)\n{\n    if (pState)\n    {\n        if (pState->window)\n            free(pState->window);\n        free(pState);\n    }\n}\n\nint LZXreset(struct LZXstate *pState)\n{\n    int i;\n\n    pState->R0  =  pState->R1  = pState->R2 = 1;\n    pState->header_read     = 0;\n    pState->frames_read     = 0;\n    pState->block_remaining = 0;\n    pState->block_type      = LZX_BLOCKTYPE_INVALID;\n    pState->intel_curpos    = 0;\n    pState->intel_started   = 0;\n    pState->window_posn     = 0;\n\n    for (i = 0; i < LZX_MAINTREE_MAXSYMBOLS + LZX_LENTABLE_SAFETY; i++) pState->MAINTREE_len[i] = 0;\n    for (i = 0; i < LZX_LENGTH_MAXSYMBOLS + LZX_LENTABLE_SAFETY; i++)   pState->LENGTH_len[i]   = 0;\n\n    return DECR_OK;\n}\n\n\n/* Bitstream reading macros:\n *\n * INIT_BITSTREAM    should be used first to set up the system\n * READ_BITS(var,n)  takes N bits from the buffer and puts them in var\n *\n * ENSURE_BITS(n)    ensures there are at least N bits in the bit buffer\n * PEEK_BITS(n)      extracts (without removing) N bits from the bit buffer\n * REMOVE_BITS(n)    removes N bits from the bit buffer\n *\n * These bit access routines work by using the area beyond the MSB and the\n * LSB as a free source of zeroes. This avoids having to mask any bits.\n * So we have to know the bit width of the bitbuffer variable. This is\n * sizeof(ULONG) * 8, also defined as ULONG_BITS\n */\n\n/* number of bits in ULONG. Note: This must be at multiple of 16, and at\n * least 32 for the bitbuffer code to work (ie, it must be able to ensure\n * up to 17 bits - that's adding 16 bits when there's one bit left, or\n * adding 32 bits when there are no bits left. The code should work fine\n * for machines where ULONG >= 32 bits.\n */\n#define ULONG_BITS (sizeof(ULONG)<<3)\n\n#define INIT_BITSTREAM do { bitsleft = 0; bitbuf = 0; } while (0)\n\n#define ENSURE_BITS(n)\t\t\t\t\t\t\t\\\n  while (bitsleft < (n)) {\t\t\t\t\t\t\\\n    bitbuf |= ((inpos[1]<<8)|inpos[0]) << (ULONG_BITS-16 - bitsleft);\t\\\n    bitsleft += 16; inpos+=2;\t\t\t\t\t\t\\\n  }\n\n#define PEEK_BITS(n)   (bitbuf >> (ULONG_BITS - (n)))\n#define REMOVE_BITS(n) ((bitbuf <<= (n)), (bitsleft -= (n)))\n\n#define READ_BITS(v,n) do {\t\t\t\t\t\t\\\n  ENSURE_BITS(n);\t\t\t\t\t\t\t\\\n  (v) = PEEK_BITS(n);\t\t\t\t\t\t\t\\\n  REMOVE_BITS(n);\t\t\t\t\t\t\t\\\n} while (0)\n\n\n/* Huffman macros */\n\n#define TABLEBITS(tbl)   (LZX_##tbl##_TABLEBITS)\n#define MAXSYMBOLS(tbl)  (LZX_##tbl##_MAXSYMBOLS)\n#define SYMTABLE(tbl)    (pState->tbl##_table)\n#define LENTABLE(tbl)    (pState->tbl##_len)\n\n/* BUILD_TABLE(tablename) builds a huffman lookup table from code lengths.\n * In reality, it just calls make_decode_table() with the appropriate\n * values - they're all fixed by some #defines anyway, so there's no point\n * writing each call out in full by hand.\n */\n#define BUILD_TABLE(tbl)\t\t\t\t\t\t\\\n  if (make_decode_table(\t\t\t\t\t\t\\\n    MAXSYMBOLS(tbl), TABLEBITS(tbl), LENTABLE(tbl), SYMTABLE(tbl)\t\\\n  )) { return DECR_ILLEGALDATA; }\n\n\n/* READ_HUFFSYM(tablename, var) decodes one huffman symbol from the\n * bitstream using the stated table and puts it in var.\n */\n#define READ_HUFFSYM(tbl,var) do {\t\t\t\t\t\\\n  ENSURE_BITS(16);\t\t\t\t\t\t\t\\\n  hufftbl = SYMTABLE(tbl);\t\t\t\t\t\t\\\n  if ((i = hufftbl[PEEK_BITS(TABLEBITS(tbl))]) >= MAXSYMBOLS(tbl)) {\t\\\n    j = 1 << (ULONG_BITS - TABLEBITS(tbl));\t\t\t\t\\\n    do {\t\t\t\t\t\t\t\t\\\n      j >>= 1; i <<= 1; i |= (bitbuf & j) ? 1 : 0;\t\t\t\\\n      if (!j) { return DECR_ILLEGALDATA; }\t                        \\\n    } while ((i = hufftbl[i]) >= MAXSYMBOLS(tbl));\t\t\t\\\n  }\t\t\t\t\t\t\t\t\t\\\n  j = LENTABLE(tbl)[(var) = i];\t\t\t\t\t\t\\\n  REMOVE_BITS(j);\t\t\t\t\t\t\t\\\n} while (0)\n\n\n/* READ_LENGTHS(tablename, first, last) reads in code lengths for symbols\n * first to last in the given table. The code lengths are stored in their\n * own special LZX way.\n */\n#define READ_LENGTHS(tbl,first,last) do { \\\n  lb.bb = bitbuf; lb.bl = bitsleft; lb.ip = inpos; \\\n  if (lzx_read_lens(pState, LENTABLE(tbl),(first),(last),&lb)) { \\\n    return DECR_ILLEGALDATA; \\\n  } \\\n  bitbuf = lb.bb; bitsleft = lb.bl; inpos = lb.ip; \\\n} while (0)\n\n\n/* make_decode_table(nsyms, nbits, length[], table[])\n *\n * This function was coded by David Tritscher. It builds a fast huffman\n * decoding table out of just a canonical huffman code lengths table.\n *\n * nsyms  = total number of symbols in this huffman tree.\n * nbits  = any symbols with a code length of nbits or less can be decoded\n *          in one lookup of the table.\n * length = A table to get code lengths from [0 to syms-1]\n * table  = The table to fill up with decoded symbols and pointers.\n *\n * Returns 0 for OK or 1 for error\n */\n\nstatic int make_decode_table(ULONG nsyms, ULONG nbits, UBYTE *length, UWORD *table) {\n    register UWORD sym;\n    register ULONG leaf;\n    register UBYTE bit_num = 1;\n    ULONG fill;\n    ULONG pos         = 0; /* the current position in the decode table */\n    ULONG table_mask  = 1 << nbits;\n    ULONG bit_mask    = table_mask >> 1; /* don't do 0 length codes */\n    ULONG next_symbol = bit_mask; /* base of allocation for long codes */\n\n    /* fill entries for codes short enough for a direct mapping */\n    while (bit_num <= nbits) {\n        for (sym = 0; sym < nsyms; sym++) {\n            if (length[sym] == bit_num) {\n                leaf = pos;\n\n                if((pos += bit_mask) > table_mask) return 1; /* table overrun */\n\n                /* fill all possible lookups of this symbol with the symbol itself */\n                fill = bit_mask;\n                while (fill-- > 0) table[leaf++] = sym;\n            }\n        }\n        bit_mask >>= 1;\n        bit_num++;\n    }\n\n    /* if there are any codes longer than nbits */\n    if (pos != table_mask) {\n        /* clear the remainder of the table */\n        for (sym = pos; sym < table_mask; sym++) table[sym] = 0;\n\n        /* give ourselves room for codes to grow by up to 16 more bits */\n        pos <<= 16;\n        table_mask <<= 16;\n        bit_mask = 1 << 15;\n\n        while (bit_num <= 16) {\n            for (sym = 0; sym < nsyms; sym++) {\n                if (length[sym] == bit_num) {\n                    leaf = pos >> 16;\n                    for (fill = 0; fill < bit_num - nbits; fill++) {\n                        /* if this path hasn't been taken yet, 'allocate' two entries */\n                        if (table[leaf] == 0) {\n                            table[(next_symbol << 1)] = 0;\n                            table[(next_symbol << 1) + 1] = 0;\n                            table[leaf] = next_symbol++;\n                        }\n                        /* follow the path and select either left or right for next bit */\n                        leaf = table[leaf] << 1;\n                        if ((pos >> (15-fill)) & 1) leaf++;\n                    }\n                    table[leaf] = sym;\n\n                    if ((pos += bit_mask) > table_mask) return 1; /* table overflow */\n                }\n            }\n            bit_mask >>= 1;\n            bit_num++;\n        }\n    }\n\n    /* full table? */\n    if (pos == table_mask) return 0;\n\n    /* either erroneous table, or all elements are 0 - let's find out. */\n    for (sym = 0; sym < nsyms; sym++) if (length[sym]) return 1;\n    return 0;\n}\n\nstruct lzx_bits {\n  ULONG bb;\n  int bl;\n  UBYTE *ip;\n};\n\nstatic int lzx_read_lens(struct LZXstate *pState, UBYTE *lens, ULONG first, ULONG last, struct lzx_bits *lb) {\n    ULONG i,j, x,y;\n    int z;\n\n    register ULONG bitbuf = lb->bb;\n    register int bitsleft = lb->bl;\n    UBYTE *inpos = lb->ip;\n    UWORD *hufftbl;\n\n    for (x = 0; x < 20; x++) {\n        READ_BITS(y, 4);\n        LENTABLE(PRETREE)[x] = y;\n    }\n    BUILD_TABLE(PRETREE);\n\n    for (x = first; x < last; ) {\n        READ_HUFFSYM(PRETREE, z);\n        if (z == 17) {\n            READ_BITS(y, 4); y += 4;\n            while (y--) lens[x++] = 0;\n        }\n        else if (z == 18) {\n            READ_BITS(y, 5); y += 20;\n            while (y--) lens[x++] = 0;\n        }\n        else if (z == 19) {\n            READ_BITS(y, 1); y += 4;\n            READ_HUFFSYM(PRETREE, z);\n            z = lens[x] - z; if (z < 0) z += 17;\n            while (y--) lens[x++] = z;\n        }\n        else {\n            z = lens[x] - z; if (z < 0) z += 17;\n            lens[x++] = z;\n        }\n    }\n\n    lb->bb = bitbuf;\n    lb->bl = bitsleft;\n    lb->ip = inpos;\n    return 0;\n}\n\nint LZXdecompress(struct LZXstate *pState, unsigned char *inpos, unsigned char *outpos, int inlen, int outlen) {\n    UBYTE *endinp = inpos + inlen;\n    UBYTE *window = pState->window;\n    UBYTE *runsrc, *rundest;\n    UWORD *hufftbl; /* used in READ_HUFFSYM macro as chosen decoding table */\n\n    ULONG window_posn = pState->window_posn;\n    ULONG window_size = pState->window_size;\n    ULONG R0 = pState->R0;\n    ULONG R1 = pState->R1;\n    ULONG R2 = pState->R2;\n\n    register ULONG bitbuf;\n    register int bitsleft;\n    ULONG match_offset, i,j,k; /* ijk used in READ_HUFFSYM macro */\n    struct lzx_bits lb; /* used in READ_LENGTHS macro */\n\n    int togo = outlen, this_run, main_element, aligned_bits;\n    int match_length, length_footer, extra, verbatim_bits;\n\n    INIT_BITSTREAM;\n\n    /* read header if necessary */\n    if (!pState->header_read) {\n        i = j = 0;\n        READ_BITS(k, 1); if (k) { READ_BITS(i,16); READ_BITS(j,16); }\n        pState->intel_filesize = (i << 16) | j; /* or 0 if not encoded */\n        pState->header_read = 1;\n    }\n\n    /* main decoding loop */\n    while (togo > 0) {\n        /* last block finished, new block expected */\n        if (pState->block_remaining == 0) {\n            if (pState->block_type == LZX_BLOCKTYPE_UNCOMPRESSED) {\n                if (pState->block_length & 1) inpos++; /* realign bitstream to word */\n                INIT_BITSTREAM;\n            }\n\n            READ_BITS(pState->block_type, 3);\n            READ_BITS(i, 16);\n            READ_BITS(j, 8);\n            pState->block_remaining = pState->block_length = (i << 8) | j;\n\n            switch (pState->block_type) {\n                case LZX_BLOCKTYPE_ALIGNED:\n                    for (i = 0; i < 8; i++) { READ_BITS(j, 3); LENTABLE(ALIGNED)[i] = j; }\n                    BUILD_TABLE(ALIGNED);\n                    /* rest of aligned header is same as verbatim */\n\n                case LZX_BLOCKTYPE_VERBATIM:\n                    READ_LENGTHS(MAINTREE, 0, 256);\n                    READ_LENGTHS(MAINTREE, 256, pState->main_elements);\n                    BUILD_TABLE(MAINTREE);\n                    if (LENTABLE(MAINTREE)[0xE8] != 0) pState->intel_started = 1;\n\n                    READ_LENGTHS(LENGTH, 0, LZX_NUM_SECONDARY_LENGTHS);\n                    BUILD_TABLE(LENGTH);\n                    break;\n\n                case LZX_BLOCKTYPE_UNCOMPRESSED:\n                    pState->intel_started = 1; /* because we can't assume otherwise */\n                    ENSURE_BITS(16); /* get up to 16 pad bits into the buffer */\n                    if (bitsleft > 16) inpos -= 2; /* and align the bitstream! */\n                    R0 = inpos[0]|(inpos[1]<<8)|(inpos[2]<<16)|(inpos[3]<<24);inpos+=4;\n                    R1 = inpos[0]|(inpos[1]<<8)|(inpos[2]<<16)|(inpos[3]<<24);inpos+=4;\n                    R2 = inpos[0]|(inpos[1]<<8)|(inpos[2]<<16)|(inpos[3]<<24);inpos+=4;\n                    break;\n\n                default:\n                    return DECR_ILLEGALDATA;\n            }\n        }\n\n        /* buffer exhaustion check */\n        if (inpos > endinp) {\n            /* it's possible to have a file where the next run is less than\n             * 16 bits in size. In this case, the READ_HUFFSYM() macro used\n             * in building the tables will exhaust the buffer, so we should\n             * allow for this, but not allow those accidentally read bits to\n             * be used (so we check that there are at least 16 bits\n             * remaining - in this boundary case they aren't really part of\n             * the compressed data)\n             */\n            if (inpos > (endinp+2) || bitsleft < 16) return DECR_ILLEGALDATA;\n        }\n\n        while ((this_run = pState->block_remaining) > 0 && togo > 0) {\n            if (this_run > togo) this_run = togo;\n            togo -= this_run;\n            pState->block_remaining -= this_run;\n\n            /* apply 2^x-1 mask */\n            window_posn &= window_size - 1;\n            /* runs can't straddle the window wraparound */\n            if ((window_posn + this_run) > window_size)\n                return DECR_DATAFORMAT;\n\n            switch (pState->block_type) {\n\n                case LZX_BLOCKTYPE_VERBATIM:\n                    while (this_run > 0) {\n                        READ_HUFFSYM(MAINTREE, main_element);\n\n                        if (main_element < LZX_NUM_CHARS) {\n                            /* literal: 0 to LZX_NUM_CHARS-1 */\n                            window[window_posn++] = main_element;\n                            this_run--;\n                        }\n                        else {\n                            /* match: LZX_NUM_CHARS + ((slot<<3) | length_header (3 bits)) */\n                            main_element -= LZX_NUM_CHARS;\n\n                            match_length = main_element & LZX_NUM_PRIMARY_LENGTHS;\n                            if (match_length == LZX_NUM_PRIMARY_LENGTHS) {\n                                READ_HUFFSYM(LENGTH, length_footer);\n                                match_length += length_footer;\n                            }\n                            match_length += LZX_MIN_MATCH;\n\n                            match_offset = main_element >> 3;\n\n                            if (match_offset > 2) {\n                                /* not repeated offset */\n                                if (match_offset != 3) {\n                                    extra = extra_bits[match_offset];\n                                    READ_BITS(verbatim_bits, extra);\n                                    match_offset = position_base[match_offset] - 2 + verbatim_bits;\n                                }\n                                else {\n                                    match_offset = 1;\n                                }\n\n                                /* update repeated offset LRU queue */\n                                R2 = R1; R1 = R0; R0 = match_offset;\n                            }\n                            else if (match_offset == 0) {\n                                match_offset = R0;\n                            }\n                            else if (match_offset == 1) {\n                                match_offset = R1;\n                                R1 = R0; R0 = match_offset;\n                            }\n                            else /* match_offset == 2 */ {\n                                match_offset = R2;\n                                R2 = R0; R0 = match_offset;\n                            }\n\n                            rundest = window + window_posn;\n                            runsrc  = rundest - match_offset;\n                            window_posn += match_length;\n                            if (window_posn > window_size) return DECR_ILLEGALDATA;\n                            this_run -= match_length;\n\n                            /* copy any wrapped around source data */\n                            while ((runsrc < window) && (match_length-- > 0)) {\n                                *rundest++ = *(runsrc + window_size); runsrc++;\n                            }\n                            /* copy match data - no worries about destination wraps */\n                            while (match_length-- > 0) *rundest++ = *runsrc++;\n\n                        }\n                    }\n                    break;\n\n                case LZX_BLOCKTYPE_ALIGNED:\n                    while (this_run > 0) {\n                        READ_HUFFSYM(MAINTREE, main_element);\n\n                        if (main_element < LZX_NUM_CHARS) {\n                            /* literal: 0 to LZX_NUM_CHARS-1 */\n                            window[window_posn++] = main_element;\n                            this_run--;\n                        }\n                        else {\n                            /* match: LZX_NUM_CHARS + ((slot<<3) | length_header (3 bits)) */\n                            main_element -= LZX_NUM_CHARS;\n\n                            match_length = main_element & LZX_NUM_PRIMARY_LENGTHS;\n                            if (match_length == LZX_NUM_PRIMARY_LENGTHS) {\n                                READ_HUFFSYM(LENGTH, length_footer);\n                                match_length += length_footer;\n                            }\n                            match_length += LZX_MIN_MATCH;\n\n                            match_offset = main_element >> 3;\n\n                            if (match_offset > 2) {\n                                /* not repeated offset */\n                                extra = extra_bits[match_offset];\n                                match_offset = position_base[match_offset] - 2;\n                                if (extra > 3) {\n                                    /* verbatim and aligned bits */\n                                    extra -= 3;\n                                    READ_BITS(verbatim_bits, extra);\n                                    match_offset += (verbatim_bits << 3);\n                                    READ_HUFFSYM(ALIGNED, aligned_bits);\n                                    match_offset += aligned_bits;\n                                }\n                                else if (extra == 3) {\n                                    /* aligned bits only */\n                                    READ_HUFFSYM(ALIGNED, aligned_bits);\n                                    match_offset += aligned_bits;\n                                }\n                                else if (extra > 0) { /* extra==1, extra==2 */\n                                    /* verbatim bits only */\n                                    READ_BITS(verbatim_bits, extra);\n                                    match_offset += verbatim_bits;\n                                }\n                                else /* extra == 0 */ {\n                                    /* ??? */\n                                    match_offset = 1;\n                                }\n\n                                /* update repeated offset LRU queue */\n                                R2 = R1; R1 = R0; R0 = match_offset;\n                            }\n                            else if (match_offset == 0) {\n                                match_offset = R0;\n                            }\n                            else if (match_offset == 1) {\n                                match_offset = R1;\n                                R1 = R0; R0 = match_offset;\n                            }\n                            else /* match_offset == 2 */ {\n                                match_offset = R2;\n                                R2 = R0; R0 = match_offset;\n                            }\n\n                            rundest = window + window_posn;\n                            runsrc  = rundest - match_offset;\n                            window_posn += match_length;\n                            if (window_posn > window_size) return DECR_ILLEGALDATA;\n                            this_run -= match_length;\n\n                            /* copy any wrapped around source data */\n                            while ((runsrc < window) && (match_length-- > 0)) {\n                                *rundest++ = *(runsrc + window_size); runsrc++;\n                            }\n                            /* copy match data - no worries about destination wraps */\n                            while (match_length-- > 0) *rundest++ = *runsrc++;\n\n                        }\n                    }\n                    break;\n\n                case LZX_BLOCKTYPE_UNCOMPRESSED:\n                    if ((inpos + this_run) > endinp) return DECR_ILLEGALDATA;\n                    memcpy(window + window_posn, inpos, (size_t) this_run);\n                    inpos += this_run; window_posn += this_run;\n                    break;\n\n                default:\n                    return DECR_ILLEGALDATA; /* might as well */\n            }\n\n        }\n    }\n\n    if (togo != 0) return DECR_ILLEGALDATA;\n    memcpy(outpos, window + ((!window_posn) ? window_size : window_posn) - outlen, (size_t) outlen);\n\n    pState->window_posn = window_posn;\n    pState->R0 = R0;\n    pState->R1 = R1;\n    pState->R2 = R2;\n\n    /* intel E8 decoding */\n    if ((pState->frames_read++ < 32768) && pState->intel_filesize != 0) {\n        if (outlen <= 6 || !pState->intel_started) {\n            pState->intel_curpos += outlen;\n        }\n        else {\n            UBYTE *data    = outpos;\n            UBYTE *dataend = data + outlen - 10;\n            LONG curpos    = pState->intel_curpos;\n            LONG filesize  = pState->intel_filesize;\n            LONG abs_off, rel_off;\n\n            pState->intel_curpos = curpos + outlen;\n\n            while (data < dataend) {\n                if (*data++ != 0xE8) { curpos++; continue; }\n                abs_off = data[0] | (data[1]<<8) | (data[2]<<16) | (data[3]<<24);\n                if ((abs_off >= -curpos) && (abs_off < filesize)) {\n                    rel_off = (abs_off >= 0) ? abs_off - curpos : abs_off + filesize;\n                    data[0] = (UBYTE) rel_off;\n                    data[1] = (UBYTE) (rel_off >> 8);\n                    data[2] = (UBYTE) (rel_off >> 16);\n                    data[3] = (UBYTE) (rel_off >> 24);\n                }\n                data += 4;\n                curpos += 5;\n            }\n        }\n    }\n    return DECR_OK;\n}\n\n#ifdef LZX_CHM_TESTDRIVER\nint main(int c, char **v)\n{\n    FILE *fin, *fout;\n    struct LZXstate state;\n    UBYTE ibuf[16384];\n    UBYTE obuf[32768];\n    int ilen, olen;\n    int status;\n    int i;\n    int count=0;\n    int w = atoi(v[1]);\n    LZXinit(&state, w);\n    fout = fopen(v[2], \"wb\");\n    for (i=3; i<c; i++)\n    {\n        fin = fopen(v[i], \"rb\");\n        ilen = fread(ibuf, 1, 16384, fin);\n        status = LZXdecompress(&state, ibuf, obuf, ilen, 32768);\n        switch (status)\n        {\n            case DECR_OK:\n                printf(\"ok\\n\");\n                fwrite(obuf, 1, 32768, fout);\n                break;\n            case DECR_DATAFORMAT:\n                printf(\"bad format\\n\");\n                break;\n            case DECR_ILLEGALDATA:\n                printf(\"illegal data\\n\");\n                break;\n            case DECR_NOMEMORY:\n                printf(\"no memory\\n\");\n                break;\n            default:\n                break;\n        }\n        fclose(fin);\n        if (++count == 2)\n        {\n            count = 0;\n            LZXreset(&state);\n        }\n    }\n    fclose(fout);\n}\n#endif\n"
  },
  {
    "path": "ext/CHMLib/src/lzx.h",
    "content": "/* $Id: lzx.h,v 1.5 2002/10/08 03:43:33 jedwin Exp $ */\n/***************************************************************************\n *                        lzx.h - LZX decompression routines               *\n *                           -------------------                           *\n *                                                                         *\n *  maintainer: Jed Wing <jedwin@ugcs.caltech.edu>                         *\n *  source:     modified lzx.c from cabextract v0.5                        *\n *  notes:      This file was taken from cabextract v0.5, which was,       *\n *              itself, a modified version of the lzx decompression code   *\n *              from unlzx.                                                *\n ***************************************************************************/\n\n/***************************************************************************\n *                                                                         *\n *   This program is free software; you can redistribute it and/or modify  *\n *   it under the terms of the GNU General Public License as published by  *\n *   the Free Software Foundation; either version 2 of the License, or     *\n *   (at your option) any later version.  Note that an exemption to this   *\n *   license has been granted by Stuart Caie for the purposes of           *\n *   distribution with chmlib.  This does not, to the best of my           *\n *   knowledge, constitute a change in the license of this (the LZX) code  *\n *   in general.                                                           *\n *                                                                         *\n ***************************************************************************/\n\n#ifndef INCLUDED_LZX_H\n#define INCLUDED_LZX_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/* return codes */\n#define DECR_OK           (0)\n#define DECR_DATAFORMAT   (1)\n#define DECR_ILLEGALDATA  (2)\n#define DECR_NOMEMORY     (3)\n\n/* opaque state structure */\nstruct LZXstate;\n\n/* create an lzx state object */\nstruct LZXstate *LZXinit(int window);\n\n/* destroy an lzx state object */\nvoid LZXteardown(struct LZXstate *pState);\n\n/* reset an lzx stream */\nint LZXreset(struct LZXstate *pState);\n\n/* decompress an LZX compressed block */\nint LZXdecompress(struct LZXstate *pState,\n                  unsigned char *inpos,\n                  unsigned char *outpos,\n                  int inlen,\n                  int outlen);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* INCLUDED_LZX_H */\n"
  },
  {
    "path": "ext/CHMLib/src/test_chmLib.c",
    "content": "/* $Id: test_chmLib.c,v 1.5 2002/10/09 12:38:12 jedwin Exp $ */\n/***************************************************************************\n *          test_chmLib.c - CHM archive test driver                        *\n *                           -------------------                           *\n *                                                                         *\n *  author:     Jed Wing <jedwin@ugcs.caltech.edu>                         *\n *  notes:      This is the quick-and-dirty test driver for the chm lib    *\n *              routines.  The program takes as its inputs the path to a   *\n *              .chm file, a path within the .chm file, and a destination  *\n *              path.  It attempts to open the .chm file, locate the       *\n *              desired file in the archive, and extract to the specified  *\n *              destination.                                               *\n *                                                                         *\n *              It is not included as a particularly useful program, but   *\n *              rather as a sort of \"simplest possible\" example of how to  *\n *              use the resolve/retrieve portion of the API.               *\n ***************************************************************************/\n\n/***************************************************************************\n *                                                                         *\n *   This program is free software; you can redistribute it and/or modify  *\n *   it under the terms of the GNU Lesser General Public License as        *\n *   published by the Free Software Foundation; either version 2.1 of the  *\n *   License, or (at your option) any later version.                       *\n *                                                                         *\n ***************************************************************************/\n\n#include \"chm_lib.h\"\n\n#ifdef WIN32\n#include <malloc.h>\n#endif\n#include <stdio.h>\n#include <stdlib.h>\n\nint main(int c, char **v)\n{\n    struct chmFile *h;\n    struct chmUnitInfo ui;\n\n    if (c < 4)\n    {\n        fprintf(stderr, \"usage: %s <chmfile> <filename> <destfile>\\n\", v[0]);\n        exit(1);\n    }\n\n    h = chm_open(v[1]);\n    if (h == NULL)\n    {\n        fprintf(stderr, \"failed to open %s\\n\", v[1]);\n        exit(1);\n    }\n\n    printf(\"resolving %s\\n\", v[2]);\n    if (CHM_RESOLVE_SUCCESS == chm_resolve_object(h, \n                                                  v[2],\n                                                  &ui))\n    {\n#ifdef WIN32\n        unsigned char *buffer = (unsigned char *)alloca((unsigned int)ui.length);\n#else\n        unsigned char buffer[ui.length];\n#endif\n        LONGINT64 gotLen;\n        FILE *fout;\n        printf(\"    object: <%d, %lu, %lu>\\n\",\n               ui.space,\n               (unsigned long)ui.start,\n               (unsigned long)ui.length);\n\n        printf(\"extracting to '%s'\\n\", v[3]);\n        gotLen = chm_retrieve_object(h, &ui, buffer, 0, ui.length);\n        if (gotLen == 0)\n        {\n            printf(\"   extract failed\\n\");\n            return 2;\n        }\n        else if ((fout = fopen(v[3], \"wb\")) == NULL)\n        {\n            printf(\"   create failed\\n\");\n            return 3;\n        }\n        else\n        {\n            fwrite(buffer, 1, (unsigned int)ui.length, fout);\n            fclose(fout);\n            printf(\"   finished\\n\");\n        }\n    }\n    else\n        printf(\"    failed\\n\");\n\n    return 0;\n}\n"
  },
  {
    "path": "ext/_patches/CHMLib.patch",
    "content": "diff -rPu5 CHMLib.orig\\src\\chm_lib.c CHMLib\\src\\chm_lib.c\r\n--- CHMLib.orig\\src\\chm_lib.c\tFri Jul 03 08:34:54 2009\r\n+++ CHMLib\\src\\chm_lib.c\tTue Apr 09 20:53:17 2013\r\n@@ -92,11 +92,11 @@\r\n #ifdef WIN32\r\n #define CHM_ACQUIRE_LOCK(a) do {                        \\\r\n         EnterCriticalSection(&(a));                     \\\r\n     } while(0)\r\n #define CHM_RELEASE_LOCK(a) do {                        \\\r\n-        EnterCriticalSection(&(a));                     \\\r\n+        LeaveCriticalSection(&(a));                     \\\r\n     } while(0)\r\n \r\n #else\r\n #include <pthread.h>\r\n \r\n@@ -410,10 +410,14 @@\r\n             return 0;\r\n     }\r\n     else\r\n         dest->data_offset = dest->dir_offset + dest->dir_len;\r\n \r\n+    /* SumatraPDF: sanity check (huge values are usually due to broken files) */\r\n+    if (dest->dir_offset > UINT_MAX || dest->dir_len > UINT_MAX)\r\n+        return 0;\r\n+\r\n     return 1;\r\n }\r\n \r\n /* structure of ITSP headers */\r\n #define _CHM_ITSP_V1_LEN (0x54)\r\n@@ -466,10 +470,13 @@\r\n         return 0;\r\n     if (dest->version != 1)\r\n         return 0;\r\n     if (dest->header_len != _CHM_ITSP_V1_LEN)\r\n         return 0;\r\n+    /* SumatraPDF: sanity check */\r\n+    if (dest->block_len == 0)\r\n+        return 0;\r\n \r\n     return 1;\r\n }\r\n \r\n /* structure of PMGL headers */\r\n@@ -484,15 +491,19 @@\r\n     Int32       block_next;             /* 10 */\r\n }; /* __attribute__ ((aligned (1))); */\r\n \r\n static int _unmarshal_pmgl_header(unsigned char **pData,\r\n                                   unsigned int *pDataLen,\r\n+                                  unsigned int blockLen,\r\n                                   struct chmPmglHeader *dest)\r\n {\r\n     /* we only know how to deal with a 0x14 byte structures */\r\n     if (*pDataLen != _CHM_PMGL_LEN)\r\n         return 0;\r\n+    /* SumatraPDF: sanity check */\r\n+    if (blockLen < _CHM_PMGL_LEN)\r\n+        return 0;\r\n \r\n     /* unmarshal fields */\r\n     _unmarshal_char_array(pData, pDataLen,  dest->signature, 4);\r\n     _unmarshal_uint32    (pData, pDataLen, &dest->free_space);\r\n     _unmarshal_uint32    (pData, pDataLen, &dest->unknown_0008);\r\n@@ -500,10 +511,13 @@\r\n     _unmarshal_int32     (pData, pDataLen, &dest->block_next);\r\n \r\n     /* check structure */\r\n     if (memcmp(dest->signature, _chm_pmgl_marker, 4) != 0)\r\n         return 0;\r\n+    /* SumatraPDF: sanity check */\r\n+    if (dest->free_space > blockLen - _CHM_PMGL_LEN)\r\n+        return 0;\r\n \r\n     return 1;\r\n }\r\n \r\n /* structure of PMGI headers */\r\n@@ -515,23 +529,30 @@\r\n     UInt32      free_space;             /*  4 */\r\n }; /* __attribute__ ((aligned (1))); */\r\n \r\n static int _unmarshal_pmgi_header(unsigned char **pData,\r\n                                   unsigned int *pDataLen,\r\n+                                  unsigned int blockLen,\r\n                                   struct chmPmgiHeader *dest)\r\n {\r\n     /* we only know how to deal with a 0x8 byte structures */\r\n     if (*pDataLen != _CHM_PMGI_LEN)\r\n         return 0;\r\n+    /* SumatraPDF: sanity check */\r\n+    if (blockLen < _CHM_PMGI_LEN)\r\n+        return 0;\r\n \r\n     /* unmarshal fields */\r\n     _unmarshal_char_array(pData, pDataLen,  dest->signature, 4);\r\n     _unmarshal_uint32    (pData, pDataLen, &dest->free_space);\r\n \r\n     /* check structure */\r\n     if (memcmp(dest->signature, _chm_pmgi_marker, 4) != 0)\r\n         return 0;\r\n+    /* SumatraPDF: sanity check */\r\n+    if (dest->free_space > blockLen - _CHM_PMGI_LEN)\r\n+        return 0;\r\n \r\n     return 1;\r\n }\r\n \r\n /* structure of LZXC reset table */\r\n@@ -565,10 +586,15 @@\r\n     _unmarshal_uint64    (pData, pDataLen, &dest->block_len);\r\n \r\n     /* check structure */\r\n     if (dest->version != 2)\r\n         return 0;\r\n+    /* SumatraPDF: sanity check (huge values are usually due to broken files) */\r\n+    if (dest->uncompressed_len > UINT_MAX || dest->compressed_len > UINT_MAX)\r\n+        return 0;\r\n+    if (dest->block_len == 0 || dest->block_len > UINT_MAX)\r\n+        return 0;\r\n \r\n     return 1;\r\n }\r\n \r\n /* structure of LZXC control data block */\r\n@@ -936,10 +962,12 @@\r\n             !_unmarshal_lzxc_control_data(&sbufpos, &sremain,\r\n                                           &ctlData))\r\n         {\r\n             newHandle->compression_enabled = 0;\r\n         }\r\n+        else /* SumatraPDF: prevent division by zero */\r\n+        {\r\n \r\n         newHandle->window_size = ctlData.windowSize;\r\n         newHandle->reset_interval = ctlData.resetInterval;\r\n \r\n /* Jed, Mon Jun 28: Experimentally, it appears that the reset block count */\r\n@@ -951,10 +979,11 @@\r\n #else\r\n         newHandle->reset_blkcount = newHandle->reset_interval    /\r\n                                     (newHandle->window_size / 2) *\r\n                                     ctlData.windowsPerReset;\r\n #endif\r\n+        }\r\n     }\r\n \r\n     /* initialize cache */\r\n     chm_set_param(newHandle, CHM_PARAM_MAX_BLOCKS_CACHED,\r\n                   CHM_MAX_BLOCKS_CACHED);\r\n@@ -1172,11 +1201,11 @@\r\n     char buffer[CHM_MAX_PATHLEN+1];\r\n \r\n     /* figure out where to start and end */\r\n     cur = page_buf;\r\n     hremain = _CHM_PMGL_LEN;\r\n-    if (! _unmarshal_pmgl_header(&cur, &hremain, &header))\r\n+    if (! _unmarshal_pmgl_header(&cur, &hremain, block_len, &header))\r\n         return NULL;\r\n     end = page_buf + block_len - (header.free_space);\r\n \r\n     /* now, scan progressively */\r\n     while (cur < end)\r\n@@ -1216,11 +1245,11 @@\r\n     char buffer[CHM_MAX_PATHLEN+1];\r\n \r\n     /* figure out where to start and end */\r\n     cur = page_buf;\r\n     hremain = _CHM_PMGI_LEN;\r\n-    if (! _unmarshal_pmgi_header(&cur, &hremain, &header))\r\n+    if (! _unmarshal_pmgi_header(&cur, &hremain, block_len, &header))\r\n         return -1;\r\n     end = page_buf + block_len - (header.free_space);\r\n \r\n     /* now, scan progressively */\r\n     while (cur < end)\r\n@@ -1406,11 +1435,11 @@\r\n         for (i = blockAlign; i > 0; i--)\r\n         {\r\n             UInt32 curBlockIdx = block - i;\r\n \r\n             /* check if we most recently decompressed the previous block */\r\n-            if (h->lzx_last_block != curBlockIdx)\r\n+            if (h->lzx_last_block != (int)curBlockIdx)\r\n             {\r\n                 if ((curBlockIdx % h->reset_blkcount) == 0)\r\n                 {\r\n #ifdef CHM_DEBUG\r\n                     fprintf(stderr, \"***RESET (1)***\\n\");\r\n@@ -1543,10 +1572,16 @@\r\n         h->lzx_state = LZXinit(window_size);\r\n     }\r\n \r\n     /* decompress some data */\r\n     gotLen = _chm_decompress_block(h, nBlock, &ubuffer);\r\n+    /* SumatraPDF: check return value */\r\n+    if (gotLen == (UInt64)-1)\r\n+    {\r\n+        CHM_RELEASE_LOCK(h->lzx_mutex);\r\n+        return 0;\r\n+    }\r\n     if (gotLen < nLen)\r\n         nLen = gotLen;\r\n     memcpy(buf, ubuffer+nOffset, (unsigned int)nLen);\r\n     CHM_RELEASE_LOCK(h->lzx_mutex);\r\n     return nLen;\r\n@@ -1654,11 +1689,11 @@\r\n         }\r\n \r\n         /* figure out start and end for this page */\r\n         cur = page_buf;\r\n         lenRemain = _CHM_PMGL_LEN;\r\n-        if (! _unmarshal_pmgl_header(&cur, &lenRemain, &header))\r\n+        if (! _unmarshal_pmgl_header(&cur, &lenRemain, h->block_len, &header))\r\n         {\r\n             free(page_buf);\r\n             return 0;\r\n         }\r\n         end = page_buf + h->block_len - (header.free_space);\r\n@@ -1803,11 +1838,11 @@\r\n         }\r\n \r\n         /* figure out start and end for this page */\r\n         cur = page_buf;\r\n         lenRemain = _CHM_PMGL_LEN;\r\n-        if (! _unmarshal_pmgl_header(&cur, &lenRemain, &header))\r\n+        if (! _unmarshal_pmgl_header(&cur, &lenRemain, h->block_len, &header))\r\n         {\r\n             free(page_buf);\r\n             return 0;\r\n         }\r\n         end = page_buf + h->block_len - (header.free_space);\r\ndiff -rPu5 CHMLib.orig\\src\\lzx.c CHMLib\\src\\lzx.c\r\n--- CHMLib.orig\\src\\lzx.c\tFri Jul 03 08:34:54 2009\r\n+++ CHMLib\\src\\lzx.c\tMon Oct 01 12:36:01 2012\r\n@@ -175,11 +175,11 @@\r\n     /* if a previously allocated window is big enough, keep it     */\r\n     if (window < 15 || window > 21) return NULL;\r\n \r\n     /* allocate state and associated window */\r\n     pState = (struct LZXstate *)malloc(sizeof(struct LZXstate));\r\n-    if (!(pState->window = (UBYTE *)malloc(wndsize)))\r\n+    if (!pState || !(pState->window = (UBYTE *)malloc(wndsize)))\r\n     {\r\n         free(pState);\r\n         return NULL;\r\n     }\r\n     pState->actual_size = wndsize;\r\n"
  },
  {
    "path": "ext/_patches/bzip2.patch",
    "content": "diff -rPu5 bzip2.orig\\bz_internal_error.c bzip2\\bz_internal_error.c\r\n--- bzip2.orig\\bz_internal_error.c\tThu Jan 01 01:00:00 1970\r\n+++ bzip2\\bz_internal_error.c\tSun Feb 05 23:13:51 2012\r\n@@ -0,0 +1,8 @@\r\n+/* Use when compiling with BZ_NO_STDIO */\r\n+\r\n+#include <assert.h>\r\n+\r\n+void bz_internal_error(int errcode)\r\n+{\r\n+\tassert(0);\r\n+}\r\ndiff -rPu5 bzip2.orig\\bzip_all.c bzip2\\bzip_all.c\r\n--- bzip2.orig\\bzip_all.c\tThu Jan 01 01:00:00 1970\r\n+++ bzip2\\bzip_all.c\tTue Mar 19 10:17:15 2013\r\n@@ -0,0 +1,8 @@\r\n+#include \"blocksort.c\"\r\n+#include \"bzlib.c\"\r\n+#include \"compress.c\"\r\n+#include \"crctable.c\"\r\n+#include \"decompress.c\"\r\n+#include \"huffman.c\"\r\n+#include \"randtable.c\"\r\n+#include \"bz_internal_error.c\"\r\n"
  },
  {
    "path": "ext/_patches/freetype2.patch",
    "content": "diff -rPu5 freetype2.orig\\include\\config\\ftstdlib.h freetype2\\include\\config\\ftstdlib.h\r\n--- freetype2.orig\\include\\config\\ftstdlib.h\tThu Jan 01 15:45:12 2015\r\n+++ freetype2\\include\\config\\ftstdlib.h\tThu Jan 01 15:48:53 2015\r\n@@ -106,10 +106,16 @@\r\n #define ft_fread    fread\r\n #define ft_fseek    fseek\r\n #define ft_ftell    ftell\r\n #define ft_sprintf  sprintf\r\n \r\n+/* cf. http://lists.gnu.org/archive/html/freetype/2006-09/msg00036.html */\r\n+#ifdef _WIN32\r\n+#undef ft_fopen\r\n+#define ft_fopen    ft_fopen_win32\r\n+#endif\r\n+\r\n \r\n   /**********************************************************************/\r\n   /*                                                                    */\r\n   /*                             sorting                                */\r\n   /*                                                                    */\r\ndiff -rPu5 freetype2.orig\\include\\ftsystem.h freetype2\\include\\ftsystem.h\r\n--- freetype2.orig\\include\\ftsystem.h\tThu Jan 01 15:45:12 2015\r\n+++ freetype2\\include\\ftsystem.h\tThu Jan 01 15:49:09 2015\r\n@@ -345,10 +345,16 @@\r\n   } FT_StreamRec;\r\n \r\n   /* */\r\n \r\n \r\n+/* cf. http://lists.gnu.org/archive/html/freetype/2006-09/msg00036.html */\r\n+#ifdef _WIN32\r\n+FT_FILE* ft_fopen_win32(const char *fname, const char *mode);\r\n+#endif\r\n+\r\n+\r\n FT_END_HEADER\r\n \r\n #endif /* __FTSYSTEM_H__ */\r\n \r\n \r\ndiff -rPu5 freetype2.orig\\src\\base\\ftsystem.c freetype2\\src\\base\\ftsystem.c\r\n--- freetype2.orig\\src\\base\\ftsystem.c\tThu Jan 01 15:45:12 2015\r\n+++ freetype2\\src\\base\\ftsystem.c\tThu Jan 01 15:49:23 2015\r\n@@ -315,6 +315,29 @@\r\n #endif\r\n     ft_sfree( memory );\r\n   }\r\n \r\n \r\n+/* cf. http://lists.gnu.org/archive/html/freetype/2006-09/msg00036.html */\r\n+#ifdef _WIN32\r\n+#include <windows.h>\r\n+\r\n+  FT_FILE* ft_fopen_win32(const char *fname, const char *mode)\r\n+  {\r\n+    // First try fopen, assuming nothing about character encodings.\r\n+    FT_FILE *file = fopen(fname, mode);\r\n+    if (!file)\r\n+    {\r\n+      // fopen failed. Assume the filename is UTF-8, convert to UTF-16, and try _wfopen.\r\n+      WCHAR fnameW[MAX_PATH], modeW[8];\r\n+      if (MultiByteToWideChar(CP_UTF8, 0, fname, -1, fnameW, _countof(fnameW)) &&\r\n+          MultiByteToWideChar(CP_UTF8, 0, mode, -1, modeW, _countof(modeW)))\r\n+      {\r\n+        file = _wfopen(fnameW, modeW);\r\n+      }\r\n+    }\r\n+    return file;\r\n+  }\r\n+#endif\r\n+\r\n+\r\n /* END */\r\ndiff -rPu5 freetype2.orig\\src\\sfnt\\sfobjs.c freetype2\\src\\sfnt\\sfobjs.c\r\n--- freetype2.orig\\src\\sfnt\\sfobjs.c\tThu Jan 01 15:45:12 2015\r\n+++ freetype2\\src\\sfnt\\sfobjs.c\tThu Jan 01 15:49:41 2015\r\n@@ -1077,10 +1077,14 @@\r\n                  get_glyph_metrics                                 )\r\n           {\r\n             face->horizontal.number_Of_HMetrics = 0;\r\n             error                               = FT_Err_Ok;\r\n           }\r\n+#else /* cf. https://code.google.com/p/sumatrapdf/issues/detail?id=2778 */\r\n+          FT_ERROR((\"sfnt_load_face: horizontal metrics (hmtx) table missing\\n\"));\r\n+          face->horizontal.number_Of_HMetrics = 0;\r\n+          error                               = FT_Err_Ok;\r\n #endif\r\n         }\r\n       }\r\n       else if ( FT_ERR_EQ( error, Table_Missing ) )\r\n       {\r\n"
  },
  {
    "path": "ext/_patches/libdjvu.patch",
    "content": "diff -rPu5 libdjvu.orig\\ddjvuapi.cpp libdjvu\\ddjvuapi.cpp\r\n--- libdjvu.orig\\ddjvuapi.cpp\tTue May 08 04:56:53 2012\r\n+++ libdjvu\\ddjvuapi.cpp\tMon Aug 11 14:45:43 2014\r\n@@ -1051,10 +1051,49 @@\r\n                                        int cache)\r\n {\r\n   return ddjvu_document_create_by_filename_imp(ctx,filename,cache,1);\r\n }\r\n \r\n+/* SumatraPDF: ddjvu_document_create_by_data */\r\n+ddjvu_document_t *\r\n+ddjvu_document_create_by_data(ddjvu_context_t *ctx,\r\n+                              const char *data,\r\n+                              unsigned long datalen)\r\n+{\r\n+  ddjvu_document_t *d = 0;\r\n+  G_TRY\r\n+    {\r\n+      d = new ddjvu_document_s;\r\n+      ref(d);\r\n+      GMonitorLock lock(&d->monitor);\r\n+      d->streams[0] = DataPool::create();\r\n+      d->streamid = -1;\r\n+      d->fileflag = false;\r\n+      d->docinfoflag = false;\r\n+      d->pageinfoflag = false;\r\n+      d->myctx = ctx;\r\n+      d->mydoc = 0;\r\n+      d->doc = DjVuDocument::create_noinit();\r\n+      ddjvu_stream_write(d, 0, data, datalen);\r\n+      ddjvu_stream_close(d, 0, 0);\r\n+      GUTF8String s;\r\n+      s.format(\"ddjvu:///doc%d/index.djvu\", ++(ctx->uniqueid));;\r\n+      GURL gurl = s;\r\n+      d->urlflag = false;\r\n+      d->doc->start_init(gurl, d, 0);\r\n+    }\r\n+  G_CATCH(ex)\r\n+    {\r\n+      if (d) \r\n+        unref(d);\r\n+      d = 0;\r\n+      ERROR1(ctx, ex);\r\n+    }\r\n+  G_ENDCATCH;\r\n+  return d;\r\n+}\r\n+\r\n ddjvu_job_t *\r\n ddjvu_document_job(ddjvu_document_t *document)\r\n {\r\n   return document;\r\n }\r\n@@ -3841,10 +3880,12 @@\r\n             {\r\n               if (file->get_flags() & DjVuFile::STOPPED)\r\n                 return miniexp_status(DDJVU_JOB_STOPPED);\r\n               return miniexp_status(DDJVU_JOB_FAILED);\r\n             }\r\n+          /* SumatraPDF: TODO: how to prevent a potentially infinite loop? */\r\n+          return miniexp_status(DDJVU_JOB_FAILED);\r\n         }\r\n       return miniexp_dummy;\r\n     }\r\n   // Access annotation data\r\n   return get_bytestream_anno(file->get_merged_anno());\r\n@@ -4090,5 +4131,10 @@\r\n {\r\n   return document->doc;\r\n }\r\n \r\n \r\n+/* SumatraPDF: access to free() mirroring malloc() above */\r\n+void ddjvu_free(void *ptr)\r\n+{\r\n+  free(ptr);\r\n+}\r\ndiff -rPu5 libdjvu.orig\\ddjvuapi.h libdjvu\\ddjvuapi.h\r\n--- libdjvu.orig\\ddjvuapi.h\tTue May 08 04:56:53 2012\r\n+++ libdjvu\\ddjvuapi.h\tMon Aug 11 14:49:17 2014\r\n@@ -528,10 +528,22 @@\r\n DDJVUAPI ddjvu_document_t *\r\n ddjvu_document_create_by_filename_utf8(ddjvu_context_t *context,\r\n                                        const char *filename,\r\n                                        int cache);\r\n \r\n+\r\n+/* SumatraPDF: ddvu_document_create_by_data ---\r\n+   Creates a document from in-memory data\r\n+   (needed as an alternative to ddjvu_document_create when\r\n+   compiling libdjvu without thread support) */\r\n+\r\n+DDJVUAPI ddjvu_document_t *\r\n+ddjvu_document_create_by_data(ddjvu_context_t *context,\r\n+                              const char *data,\r\n+                              unsigned long datalen);\r\n+\r\n+\r\n /* ddjvu_document_job ---\r\n    Access the job object in charge of decoding the document header. \r\n    In fact <ddjvu_document_t> is a subclass of <ddjvu_job_t>\r\n    and this function is a type cast. */\r\n \r\n@@ -1673,7 +1685,10 @@\r\n DDJVUAPI GP<DjVuDocument>\r\n ddjvu_get_DjVuDocument(ddjvu_document_t *document);\r\n #  endif\r\n # endif\r\n #endif\r\n+\r\n+/* SumatraPDF: implementation of <free> mentioned above */\r\n+void ddjvu_free(void *ptr);\r\n \r\n #endif /* DDJVUAPI_H */\r\ndiff -rPu5 libdjvu.orig\\djvu_all.cpp libdjvu\\djvu_all.cpp\r\n--- libdjvu.orig\\djvu_all.cpp\tThu Jan 01 01:00:00 1970\r\n+++ libdjvu\\djvu_all.cpp\tTue May 14 21:21:21 2013\r\n@@ -0,0 +1,44 @@\r\n+#include \"Arrays.cpp\"\r\n+#include \"atomic.cpp\"\r\n+#include \"BSByteStream.cpp\"\r\n+#include \"BSEncodeByteStream.cpp\"\r\n+#include \"ByteStream.cpp\"\r\n+#include \"DataPool.cpp\"\r\n+#include \"DjVmDir0.cpp\"\r\n+#include \"DjVmDoc.cpp\"\r\n+#include \"DjVmNav.cpp\"\r\n+#include \"DjVuAnno.cpp\"\r\n+#include \"DjVuDumpHelper.cpp\"\r\n+#include \"DjVuErrorList.cpp\"\r\n+#include \"DjVuFile.cpp\"\r\n+#include \"DjVuFileCache.cpp\"\r\n+#include \"DjVuGlobal.cpp\"\r\n+#include \"DjVuGlobalMemory.cpp\"\r\n+#include \"DjVuImage.cpp\"\r\n+#include \"DjVuInfo.cpp\"\r\n+#include \"DjVuMessage.cpp\"\r\n+#include \"DjVuNavDir.cpp\"\r\n+#include \"DjVuPalette.cpp\"\r\n+#include \"DjVuPort.cpp\"\r\n+#include \"DjVuText.cpp\"\r\n+#include \"GBitmap.cpp\"\r\n+#include \"GContainer.cpp\"\r\n+#include \"GException.cpp\"\r\n+#include \"GIFFManager.cpp\"\r\n+#include \"GOS.cpp\"\r\n+#include \"GRect.cpp\"\r\n+#include \"GSmartPointer.cpp\"\r\n+#include \"GString.cpp\"\r\n+#include \"GThreads.cpp\"\r\n+#include \"GUnicode.cpp\"\r\n+#include \"IFFByteStream.cpp\"\r\n+#include \"JB2EncodeCodec.cpp\"\r\n+#include \"DjVmDir.cpp\"\r\n+#include \"MMRDecoder.cpp\"\r\n+#include \"MMX.cpp\"\r\n+#include \"UnicodeByteStream.cpp\"\r\n+#include \"XMLTags.cpp\"\r\n+#include \"ZPCodec.cpp\"\r\n+#include \"ddjvuapi.cpp\"\r\n+#include \"debug.cpp\"\r\n+\r\ndiff -rPu5 libdjvu.orig\\DjVuGlobal.h libdjvu\\DjVuGlobal.h\r\n--- libdjvu.orig\\DjVuGlobal.h\tTue May 08 04:56:53 2012\r\n+++ libdjvu\\DjVuGlobal.h\tThu Dec 27 14:30:53 2012\r\n@@ -70,11 +70,12 @@\r\n # include <new>\r\n #else\r\n # include <new.h>\r\n #endif\r\n \r\n-#ifdef WIN32\r\n+// SumatraPDF: allow to build as a static library (built-in)\r\n+#ifdef WIN32_AND_NOT_STATIC\r\n # ifdef DLL_EXPORT\r\n #  define DJVUAPI __declspec(dllexport)\r\n # else\r\n #  define DJVUAPI __declspec(dllimport)\r\n # endif\r\ndiff -rPu5 libdjvu.orig\\DjVuMessage.cpp libdjvu\\DjVuMessage.cpp\r\n--- libdjvu.orig\\DjVuMessage.cpp\tTue May 08 04:56:53 2012\r\n+++ libdjvu\\DjVuMessage.cpp\tMon Aug 12 21:07:40 2013\r\n@@ -498,10 +498,11 @@\r\n static GUTF8String\r\n parse(GMap<GUTF8String,GP<lt_XMLTags> > &retval)\r\n {\r\n   GUTF8String errors;\r\n   GPList<lt_XMLTags> body;\r\n+  if (0) /* SumatraPDF: don't bother looking for messages.xml and languages.xml using broken code */\r\n   {\r\n     GList<GURL> paths=DjVuMessage::GetProfilePaths();\r\n     GMap<GUTF8String, void *> map;\r\n     GUTF8String m(MessageFile);\r\n     errors=getbodies(paths,m,body,map);\r\ndiff -rPu5 libdjvu.orig\\DjVuPalette.cpp libdjvu\\DjVuPalette.cpp\r\n--- libdjvu.orig\\DjVuPalette.cpp\tTue May 08 04:56:53 2012\r\n+++ libdjvu\\DjVuPalette.cpp\tFri Oct 25 13:39:08 2013\r\n@@ -96,13 +96,16 @@\r\n \r\n inline unsigned char \r\n umin(unsigned char a, unsigned char b) \r\n { return (a>b) ? b : a; }\r\n \r\n+/* SumatraPDF: in VS 2013 math.h already defines fmin */\r\n+#if !defined(_MSC_VER) || (_MSC_VER < 1800)\r\n inline float \r\n fmin(float a, float b) \r\n { return (a>b) ? b : a; }\r\n+#endif\r\n \r\n \r\n \r\n // ------- DJVUPALETTE\r\n \r\ndiff -rPu5 libdjvu.orig\\GException.cpp libdjvu\\GException.cpp\r\n--- libdjvu.orig\\GException.cpp\tTue May 08 04:56:53 2012\r\n+++ libdjvu\\GException.cpp\tTue May 14 21:21:21 2013\r\n@@ -251,10 +251,12 @@\r\n \r\n \r\n \r\n // ------ MEMORY MANAGEMENT HANDLER\r\n \r\n+/* SumatraPDF: prevent exception handler overriding when not building stand-alone libdjvu */\r\n+#ifdef ALLOW_GLOBAL_OOM_HANDLING\r\n #ifndef NEED_DJVU_MEMORY\r\n // This is not activated when C++ memory management\r\n // is overidden.  The overriding functions handle\r\n // memory exceptions by themselves.\r\n # if defined(_MSC_VER)\r\n@@ -271,10 +273,11 @@\r\n static void (*old_handler)() = set_new_handler(throw_memory_error);\r\n #   endif // HAVE_STDINCLUDES\r\n #  endif // ! WIN32\r\n # endif // !_MSC_VER\r\n #endif // !NEED_DJVU_MEMORY\r\n+#endif\r\n \r\n \r\n #ifdef HAVE_NAMESPACES\r\n }\r\n # ifndef NOT_USING_DJVU_NAMESPACE\r\ndiff -rPu5 libdjvu.orig\\GException.h libdjvu\\GException.h\r\n--- libdjvu.orig\\GException.h\tTue May 08 04:56:53 2012\r\n+++ libdjvu\\GException.h\tTue May 14 21:21:21 2013\r\n@@ -310,12 +310,13 @@\r\n #ifdef __GNUG__\r\n #define G_THROW_TYPE(msg,xtype) GExceptionHandler::emthrow \\\r\n   (GException(msg, __FILE__, __LINE__, __PRETTY_FUNCTION__, xtype)) \r\n #define G_EMTHROW(ex) GExceptionHandler::emthrow(ex)\r\n #else\r\n+// SumatraPDF: don't collect messages, file and line for smaller size\r\n #define G_THROW_TYPE(m,xtype) GExceptionHandler::emthrow \\\r\n-  (GException(m, __FILE__, __LINE__,0, xtype))\r\n+  (GException(0, 0, 0, 0, xtype))\r\n #define G_EMTHROW(ex) GExceptionHandler::emthrow(ex)\r\n #endif\r\n \r\n #endif // !CPP_SUPPORTS_EXCEPTIONS\r\n \r\ndiff -rPu5 libdjvu.orig\\GThreads.h libdjvu\\GThreads.h\r\n--- libdjvu.orig\\GThreads.h\tTue May 08 04:56:53 2012\r\n+++ libdjvu\\GThreads.h\tSat Aug 18 20:17:23 2012\r\n@@ -105,10 +105,13 @@\r\n #include \"GException.h\"\r\n \r\n #define NOTHREADS     0\r\n #define POSIXTHREADS  10\r\n #define WINTHREADS    11\r\n+/* SumatraPDF: prevent these constants from being confused with NOTHREADS */\r\n+#define MACTHREADS    -1\r\n+#define COTHREADS     -1\r\n \r\n // Known platforms\r\n #ifndef THREADMODEL\r\n #if defined(WIN32)\r\n #define THREADMODEL WINTHREADS\r\ndiff -rPu5 libdjvu.orig\\GURL.cpp libdjvu\\GURL.cpp\r\n--- libdjvu.orig\\GURL.cpp\tTue May 08 04:56:53 2012\r\n+++ libdjvu\\GURL.cpp\tSun Dec 16 16:00:23 2012\r\n@@ -482,11 +482,11 @@\r\n GURL::protocol(const GUTF8String& url)\r\n {\r\n   const char * const url_ptr=url;\r\n   const char * ptr=url_ptr;\r\n   for(char c=*ptr;\r\n-      c && (isalnum(c) || c == '+' || c == '-' || c == '.');\r\n+      c && (isalnum((unsigned char)c) || c == '+' || c == '-' || c == '.');\r\n       c=*(++ptr)) EMPTY_LOOP;\r\n   if (ptr[0]==colon && ptr[1]=='/' && ptr[2]=='/')\r\n     return GUTF8String(url_ptr, ptr-url_ptr);\r\n   return GUTF8String();\r\n }\r\ndiff -rPu5 libdjvu.orig\\IW44Image.cpp libdjvu\\IW44Image.cpp\r\n--- libdjvu.orig\\IW44Image.cpp\tTue May 08 04:56:53 2012\r\n+++ libdjvu\\IW44Image.cpp\tSat Jul 26 23:31:55 2014\r\n@@ -682,10 +682,13 @@\r\n void \r\n IW44Image::Map::image(signed char *img8, int rowsize, int pixsep, int fast)\r\n {\r\n   // Allocate reconstruction buffer\r\n   short *data16;\r\n+  // cf. http://sourceforge.net/p/djvu/djvulibre-git/ci/7993b445f071a15248bd4be788a10643213cb9d2/\r\n+  if (INT_MAX / bw < bh)\r\n+    G_THROW(\"IW44Image: image size exceeds maximum (corrupted file?)\");\r\n   GPBuffer<short> gdata16(data16,bw*bh);\r\n   // Copy coefficients\r\n   int i;\r\n   short *p = data16;\r\n   const IW44Image::Block *block = blocks;\r\ndiff -rPu5 libdjvu.orig\\miniexp.cpp libdjvu\\miniexp.cpp\r\n--- libdjvu.orig\\miniexp.cpp\tTue May 08 04:56:53 2012\r\n+++ libdjvu\\miniexp.cpp\tTue May 14 21:21:21 2013\r\n@@ -899,11 +899,12 @@\r\n }\r\n \r\n int \r\n miniexp_stringp(miniexp_t p)\r\n {\r\n-  return miniexp_isa(p, ministring_t::classname) ? 1 : 0;\r\n+  // SumatraPDF: don't execute code until asked to\r\n+  return miniexp_isa(p, miniexp_symbol(\"string\")) ? 1 : 0;\r\n }\r\n \r\n const char *\r\n miniexp_to_str(miniexp_t p)\r\n {\r\n@@ -1333,10 +1334,13 @@\r\n }\r\n \r\n \r\n /* ---- PNAME */\r\n \r\n+// SumatraPDF: don't compile as it's not used and it's the only place\r\n+// using try/catch, which is not compatible with compiling as /EHs-c-\r\n+#if 0\r\n static int\r\n pname_fputs(miniexp_io_t *io, const char *s)\r\n {\r\n   char *b = (char*)(io->data[0]);\r\n   size_t l = (size_t)(io->data[2]);\r\n@@ -1380,10 +1384,11 @@\r\n     {\r\n       delete [] (char*)(io.data[0]);\r\n     }\r\n   return r;\r\n }\r\n+#endif\r\n \r\n \r\n /* ---- INPUT */\r\n \r\n static void\r\ndiff -rPu5 libdjvu.orig\\miniexp.h libdjvu\\miniexp.h\r\n--- libdjvu.orig\\miniexp.h\tTue May 08 04:56:53 2012\r\n+++ libdjvu\\miniexp.h\tSat Aug 18 20:14:08 2012\r\n@@ -679,15 +679,16 @@\r\n   public: static const miniexp_t classname; \\\r\n           virtual miniexp_t classof() const; \\\r\n           virtual bool isa(miniexp_t) const; \r\n \r\n #define MINIOBJ_IMPLEMENT(cls, supercls, name)\\\r\n-  const miniexp_t cls::classname = miniexp_symbol(name);\\\r\n+  /* SumatraPDF: don't execute code until asked to */\\\r\n+  const miniexp_t cls::classname = 0;\\\r\n   miniexp_t cls::classof() const {\\\r\n-    return cls::classname; }\\\r\n+    return miniexp_symbol(name); }\\\r\n   bool cls::isa(miniexp_t n) const {\\\r\n-    return (cls::classname==n) || (supercls::isa(n)); }\r\n+    return (classof()==n) || (supercls::isa(n)); }\r\n \r\n \r\n /* miniexp_to_obj --\r\n    Returns a pointer to the object represented by an lisp\r\n    expression. Returns NULL if the expression is not an\r\n"
  },
  {
    "path": "ext/_patches/libjpeg-turbo.patch",
    "content": "diff -rPu5 libjpeg-turbo.orig\\config.h libjpeg-turbo\\config.h\r\n--- libjpeg-turbo.orig\\config.h\tThu Jan 01 01:00:00 1970\r\n+++ libjpeg-turbo\\config.h\tSun Apr 20 14:13:22 2014\r\n@@ -0,0 +1,13 @@\r\n+#define VERSION 1.3.1\r\n+#define BUILD 0\r\n+#define PACKAGE_NAME \"libjpeg-turbo\"\r\n+\r\n+#ifndef INLINE\r\n+#if defined(__GNUC__)\r\n+#define INLINE __attribute__((always_inline))\r\n+#elif defined(_MSC_VER)\r\n+#define INLINE __forceinline\r\n+#else\r\n+#define INLINE\r\n+#endif\r\n+#endif\r\ndiff -rPu5 libjpeg-turbo.orig\\jconfig.h libjpeg-turbo\\jconfig.h\r\n--- libjpeg-turbo.orig\\jconfig.h\tThu Jan 01 01:00:00 1970\r\n+++ libjpeg-turbo\\jconfig.h\tSun Apr 20 14:13:14 2014\r\n@@ -0,0 +1,43 @@\r\n+/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */\r\n+/* see jconfig.txt for explanations */\r\n+\r\n+#define JPEG_LIB_VERSION 80\r\n+#define LIBJPEG_TURBO_VERSION 1.3.1\r\n+#define C_ARITH_CODING_SUPPORTED\r\n+#define D_ARITH_CODING_SUPPORTED\r\n+\r\n+#define HAVE_PROTOTYPES\r\n+#define HAVE_UNSIGNED_CHAR\r\n+#define HAVE_UNSIGNED_SHORT\r\n+/* #define void char */\r\n+/* #define const */\r\n+#undef CHAR_IS_UNSIGNED\r\n+#define HAVE_STDDEF_H\r\n+#define HAVE_STDLIB_H\r\n+#undef NEED_BSD_STRINGS\r\n+#undef NEED_SYS_TYPES_H\r\n+#undef NEED_FAR_POINTERS\t/* we presume a 32-bit flat memory model */\r\n+#undef NEED_SHORT_EXTERNAL_NAMES\r\n+#undef INCOMPLETE_TYPES_BROKEN\r\n+\r\n+/* Define \"boolean\" as unsigned char, not int, per Windows custom */\r\n+#ifndef __RPCNDR_H__\t\t/* don't conflict if rpcndr.h already read */\r\n+typedef unsigned char boolean;\r\n+#endif\r\n+#define HAVE_BOOLEAN\t\t/* prevent jmorecfg.h from redefining it */\r\n+\r\n+/* Define \"INT32\" as int, not long, per Windows custom */\r\n+#if !(defined(_BASETSD_H_) || defined(_BASETSD_H))   /* don't conflict if basetsd.h already read */\r\n+typedef short INT16;\r\n+typedef signed int INT32;\r\n+#endif\r\n+#define XMD_H                   /* prevent jmorecfg.h from redefining it */\r\n+\r\n+#ifdef JPEG_INTERNALS\r\n+\r\n+#undef RIGHT_SHIFT_IS_UNSIGNED\r\n+\r\n+#endif /* JPEG_INTERNALS */\r\n+\r\n+/* SumatraPDF: enable SIMD under Win32 */\r\n+#define WITH_SIMD\r\n"
  },
  {
    "path": "ext/_patches/openjpeg.patch",
    "content": "diff -rPu5 openjpeg.orig\\j2k.c openjpeg\\j2k.c\r\n--- openjpeg.orig\\j2k.c\tTue Apr 29 09:15:02 2014\r\n+++ openjpeg\\j2k.c\tWed Jul 09 02:05:04 2014\r\n@@ -3162,11 +3162,11 @@\r\n                                 &l_cp->tcps[p_j2k->m_current_tile_number] :\r\n                                 p_j2k->m_specific_param.m_decoder.m_default_tcp;\r\n         l_old_poc_nb = l_tcp->POC ? l_tcp->numpocs + 1 : 0;\r\n         l_current_poc_nb += l_old_poc_nb;\r\n \r\n-        if(l_current_poc_nb >= 32)\r\n+        if(l_current_poc_nb >= sizeof(l_tcp->pocs) / sizeof(l_tcp->pocs[0]))\r\n           {\r\n           opj_event_msg(p_manager, EVT_ERROR, \"Too many POCs %d\\n\", l_current_poc_nb);\r\n           return OPJ_FALSE;\r\n           }\r\n         assert(l_current_poc_nb < 32);\r\n@@ -3645,11 +3645,12 @@\r\n                 p_header_size -= l_N_ppm;\r\n                 p_header_data += l_N_ppm;\r\n \r\n                 l_cp->ppm_data_read += l_N_ppm; /* Increase the number of data read*/\r\n \r\n-                if (p_header_size)\r\n+                /* cf. https://code.google.com/p/openjpeg/issues/detail?id=362 */\r\n+                if (p_header_size >= 4)\r\n                 {\r\n                         opj_read_bytes(p_header_data,&l_N_ppm,4);               /* N_ppm^i */\r\n                         p_header_data+=4;\r\n                         p_header_size-=4;\r\n                 }\r\n@@ -3686,11 +3687,12 @@\r\n \r\n         /* Need to read an incomplete Ippm series*/\r\n         if (l_remaining_data) {\r\n                 OPJ_BYTE *new_ppm_data;\r\n                 assert(l_cp->ppm_data == l_cp->ppm_buffer && \"We need ppm_data and ppm_buffer to be the same when reallocating\");\r\n-                new_ppm_data = (OPJ_BYTE *) opj_realloc(l_cp->ppm_data, l_cp->ppm_len + l_N_ppm);\r\n+                /* cf. https://code.google.com/p/openjpeg/issues/detail?id=362 */\r\n+                new_ppm_data = (OPJ_BYTE *) opj_realloc(l_cp->ppm_data, l_cp->ppm_len + l_remaining_data);\r\n                 if (! new_ppm_data) {\r\n                         opj_free(l_cp->ppm_data);\r\n                         l_cp->ppm_data = NULL;\r\n                         l_cp->ppm_buffer = NULL;  /* TODO: no need for a new local variable: ppm_buffer and ppm_data are enough */\r\n                         l_cp->ppm_len = 0;\r\n@@ -4070,10 +4072,14 @@\r\n                                                         \"number of tile-part (%d), giving up\\n\", l_current_part, l_tcp->m_nb_tile_parts );\r\n                                         p_j2k->m_specific_param.m_decoder.m_last_tile_part = 1;\r\n                                         return OPJ_FALSE;\r\n                                 }\r\n                         }\r\n+                        /* cf. https://code.google.com/p/openjpeg/issues/detail?id=254 */\r\n+                        if (++l_num_parts < l_tcp->m_nb_tile_parts) {\r\n+                                l_num_parts = l_tcp->m_nb_tile_parts;\r\n+                        }\r\n                         if( l_current_part >= l_num_parts ) {\r\n                           /* testcase 451.pdf.SIGSEGV.ce9.3723 */\r\n                           opj_event_msg(p_manager, EVT_ERROR, \"In SOT marker, TPSot (%d) is not valid regards to the current \"\r\n                             \"number of tile-part (header) (%d), giving up\\n\", l_current_part, l_num_parts );\r\n                           p_j2k->m_specific_param.m_decoder.m_last_tile_part = 1;\r\n@@ -4314,10 +4320,16 @@\r\n         l_current_data = &(l_tcp->m_data);\r\n         l_tile_len = &l_tcp->m_data_size;\r\n \r\n         /* Patch to support new PHR data */\r\n         if (p_j2k->m_specific_param.m_decoder.m_sot_length) {\r\n+            /* cf. https://code.google.com/p/openjpeg/issues/detail?id=348 */\r\n+            if (p_j2k->m_specific_param.m_decoder.m_sot_length > opj_stream_get_number_byte_left(p_stream)) {\r\n+                opj_event_msg(p_manager, EVT_ERROR, \"Not enough data to decode tile\\n\");\r\n+                return OPJ_FALSE;\r\n+            }\r\n+\r\n             if (! *l_current_data) {\r\n                 /* LH: oddly enough, in this path, l_tile_len!=0.\r\n                  * TODO: If this was consistant, we could simplify the code to only use realloc(), as realloc(0,...) default to malloc(0,...).\r\n                  */\r\n                 *l_current_data = (OPJ_BYTE*) opj_malloc(p_j2k->m_specific_param.m_decoder.m_sot_length);\r\ndiff -rPu5 openjpeg.orig\\opj_config.h openjpeg\\opj_config.h\r\n--- openjpeg.orig\\opj_config.h\tThu Jan 01 01:00:00 1970\r\n+++ openjpeg\\opj_config.h\tThu May 15 21:53:22 2014\r\n@@ -0,0 +1,5 @@\r\n+// #define OPJ_HAVE_STDINT_H\r\n+\r\n+#define OPJ_VERSION_MAJOR 2\r\n+#define OPJ_VERSION_MINOR 1\r\n+#define OPJ_VERSION_BUILD 0\r\ndiff -rPu5 openjpeg.orig\\opj_config_private.h openjpeg\\opj_config_private.h\r\n--- openjpeg.orig\\opj_config_private.h\tThu Jan 01 01:00:00 1970\r\n+++ openjpeg\\opj_config_private.h\tThu May 15 21:56:02 2014\r\n@@ -0,0 +1,11 @@\r\n+// #define OPJ_HAVE_STDINT_H\r\n+\r\n+#define OPJ_PACKAGE_VERSION \"2.1.0\"\r\n+\r\n+// #define OPJ_HAVE_INTTYPES_H\r\n+// #define OPJ_HAVE_FSEEKO\r\n+\r\n+#define OPJ_STATIC\r\n+#define OPJ_EXPORTS\r\n+\r\n+#define USE_JPIP\r\ndiff -rPu5 openjpeg.orig\\opj_malloc.h openjpeg\\opj_malloc.h\r\n--- openjpeg.orig\\opj_malloc.h\tTue Apr 29 09:15:02 2014\r\n+++ openjpeg\\opj_malloc.h\tThu May 15 22:00:14 2014\r\n@@ -53,11 +53,11 @@\r\n #ifdef ALLOC_PERF_OPT\r\n void * OPJ_CALLCONV opj_malloc(size_t size);\r\n #else\r\n /* prevent assertion on overflow for MSVC */\r\n #ifdef _MSC_VER\r\n-#define opj_malloc(size) ((size_t)(size) >= (size_t)-0x100 ? NULL : malloc(size))\r\n+#define opj_malloc(size) ((size_t)(size) >= 0x7ffdefff ? NULL : malloc(size))\r\n #else\r\n #define opj_malloc(size) malloc(size)\r\n #endif\r\n #endif\r\n \r\n@@ -70,11 +70,11 @@\r\n #ifdef ALLOC_PERF_OPT\r\n void * OPJ_CALLCONV opj_calloc(size_t _NumOfElements, size_t _SizeOfElements);\r\n #else\r\n /* prevent assertion on overflow for MSVC */\r\n #ifdef _MSC_VER\r\n-#define opj_calloc(num, size) ((size_t)(num) != 0 && (size_t)(num) >= (size_t)-0x100 / (size_t)(size) ? NULL : calloc(num, size))\r\n+#define opj_calloc(num, size) ((size_t)(num) != 0 && (size_t)(num) >= 0x7ffdefff / (size_t)(size) ? NULL : calloc(num, size))\r\n #else\r\n #define opj_calloc(num, size) calloc(num, size)\r\n #endif\r\n #endif\r\n \r\n@@ -154,11 +154,11 @@\r\n #ifdef ALLOC_PERF_OPT\r\n void * OPJ_CALLCONV opj_realloc(void * m, size_t s);\r\n #else\r\n /* prevent assertion on overflow for MSVC */\r\n #ifdef _MSC_VER\r\n-#define opj_realloc(m, s) ((size_t)(s) >= (size_t)-0x100 ? NULL : realloc(m, s))\r\n+#define opj_realloc(m, s) ((size_t)(s) >= 0x7ffdefff ? NULL : realloc(m, s))\r\n #else\r\n #define opj_realloc(m, s) realloc(m, s)\r\n #endif\r\n #endif\r\n \r\ndiff -rPu5 openjpeg.orig\\t2.c openjpeg\\t2.c\r\n--- openjpeg.orig\\t2.c\tTue Apr 29 09:15:02 2014\r\n+++ openjpeg\\t2.c\tThu May 15 22:12:09 2014\r\n@@ -861,14 +861,13 @@\r\n         /* SOP markers */\r\n \r\n         if (p_tcp->csty & J2K_CP_CSTY_SOP) {\r\n                 if (p_max_length < 6) {\r\n                         /* TODO opj_event_msg(p_t2->cinfo->event_mgr, EVT_WARNING, \"Not enough space for expected SOP marker\\n\"); */\r\n-                        printf(\"Not enough space for expected SOP marker\\n\");\r\n+                        fprintf(stderr, \"Not enough space for expected SOP marker\\n\");\r\n                 } else if ((*l_current_data) != 0xff || (*(l_current_data + 1) != 0x91)) {\r\n                         /* TODO opj_event_msg(p_t2->cinfo->event_mgr, EVT_WARNING, \"Expected SOP marker\\n\"); */\r\n-                        printf(\"Expected SOP marker\\n\");\r\n                         fprintf(stderr, \"Error : expected SOP marker\\n\");\r\n                 } else {\r\n                         l_current_data += 6;\r\n                 }\r\n \r\n@@ -1015,10 +1014,15 @@\r\n \r\n                         do {\r\n                                 l_cblk->segs[l_segno].numnewpasses = (OPJ_UINT32)opj_int_min((OPJ_INT32)(l_cblk->segs[l_segno].maxpasses - l_cblk->segs[l_segno].numpasses), n);\r\n                                 l_cblk->segs[l_segno].newlen = opj_bio_read(l_bio, l_cblk->numlenbits + opj_uint_floorlog2(l_cblk->segs[l_segno].numnewpasses));\r\n                                         JAS_FPRINTF(stderr, \"included=%d numnewpasses=%d increment=%d len=%d \\n\", l_included, l_cblk->segs[l_segno].numnewpasses, l_increment, l_cblk->segs[l_segno].newlen );\r\n+                                /* testcase 1802.pdf.SIGSEGV.36e.894 */\r\n+                                if (l_cblk->segs[l_segno].newlen > *l_modified_length_ptr) {\r\n+                                        opj_bio_destroy(l_bio);\r\n+                                        return OPJ_FALSE;\r\n+                                }\r\n \r\n                                 n -= (OPJ_INT32)l_cblk->segs[l_segno].numnewpasses;\r\n                                 if (n > 0) {\r\n                                         ++l_segno;\r\n \r\n@@ -1157,10 +1161,11 @@\r\n                                 /* Check if the cblk->data have allocated enough memory */\r\n                                 if ((l_cblk->data_current_size + l_seg->newlen) > l_cblk->data_max_size) {\r\n                                     OPJ_BYTE* new_cblk_data = (OPJ_BYTE*) opj_realloc(l_cblk->data, l_cblk->data_current_size + l_seg->newlen);\r\n                                     if(! new_cblk_data) {\r\n                                         opj_free(l_cblk->data);\r\n+                                        l_cblk->data = NULL;\r\n                                         l_cblk->data_max_size = 0;\r\n                                         /* opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to realloc code block cata!\\n\"); */\r\n                                         return OPJ_FALSE;\r\n                                     }\r\n                                     l_cblk->data_max_size = l_cblk->data_current_size + l_seg->newlen;\r\n"
  },
  {
    "path": "ext/_patches/synctex.patch",
    "content": "diff -rPu5 synctex.orig\\synctex_parser.c synctex\\synctex_parser.c\r\n--- synctex.orig\\synctex_parser.c\tTue Jun 14 15:40:56 2011\r\n+++ synctex\\synctex_parser.c\tMon Feb 04 17:41:54 2013\r\n@@ -224,37 +224,43 @@\r\n #   define SYNCTEX_SET_NEXT_HORIZ_BOX(NODE,NEXT_BOX) if (NODE && NEXT_BOX){\\\r\n \t\tSYNCTEX_GETTER(NODE,next_box)[0]=NEXT_BOX;\\\r\n \t}\r\n \r\n void _synctex_free_node(synctex_node_t node);\r\n-void _synctex_free_leaf(synctex_node_t node);\r\n+/* SumatraPDF: prevent stack overflow */\r\n+#\tdefine _synctex_free_leaf _synctex_free_node\r\n \r\n /*  A node is meant to own its child and sibling.\r\n  *  It is not owned by its parent, unless it is its first child.\r\n  *  This destructor is for all nodes with children.\r\n  */\r\n void _synctex_free_node(synctex_node_t node) {\r\n-\tif (node) {\r\n+\t/* SumatraPDF: prevent stack overflow */\r\n+\tsynctex_node_t next;\r\n+\twhile (node) {\r\n \t\t(*((node->class)->sibling))(node);\r\n-\t\tSYNCTEX_FREE(SYNCTEX_SIBLING(node));\r\n+\t\tnext = SYNCTEX_SIBLING(node);\r\n \t\tSYNCTEX_FREE(SYNCTEX_CHILD(node));\r\n \t\tfree(node);\r\n+\t\tnode = next;\r\n \t}\r\n \treturn;\r\n }\r\n \r\n /*  A node is meant to own its child and sibling.\r\n  *  It is not owned by its parent, unless it is its first child.\r\n  *  This destructor is for nodes with no child.\r\n  */\r\n+/* SumatraPDF: prevent stack overflow * /\r\n void _synctex_free_leaf(synctex_node_t node) {\r\n \tif (node) {\r\n \t\tSYNCTEX_FREE(SYNCTEX_SIBLING(node));\r\n \t\tfree(node);\r\n \t}\r\n \treturn;\r\n }\r\n+*/\r\n #\tifdef\t__SYNCTEX_WORK__\r\n #\t\tinclude \"/usr/include/zlib.h\"\r\n #\telse\r\n #\t\tinclude <zlib.h>\r\n #\tendif\r\n@@ -1418,10 +1424,13 @@\r\n \t\t\t/*  We have current_size+len+1<=UINT_MAX\r\n \t\t\t *  or equivalently new_size<UINT_MAX,\r\n \t\t\t *  where we have assumed that len<UINT_MAX */\r\n \t\t\tif ((* value_ref = realloc(* value_ref,new_size+1)) != NULL) {\r\n \t\t\t\tif (memcpy((*value_ref)+current_size,SYNCTEX_CUR,len)) {\r\n+\t\t\t\t\t/* SumatraPDF: fix reading files with DOS line endings*/\r\n+\t\t\t\t\tif (new_size > 0 && (*value_ref)[new_size - 1] == '\\r')\r\n+\t\t\t\t\t\tnew_size--;\r\n \t\t\t\t\t(* value_ref)[new_size]='\\0'; /*  Terminate the string */\r\n \t\t\t\t\tSYNCTEX_CUR += len;/*  Advance to the terminating '\\n' */\r\n \t\t\t\t\treturn SYNCTEX_STATUS_OK;\r\n \t\t\t\t}\r\n \t\t\t\tfree(* value_ref);\r\n@@ -4146,11 +4155,11 @@\r\n typedef int (*synctex_fprintf_t)(void *, const char * , ...); /*  print formatted to either FILE *  or gzFile */\r\n \r\n #   define SYNCTEX_BITS_PER_BYTE 8\r\n \r\n struct __synctex_updater_t {\r\n-    void *file;                 /*  the foo.synctex or foo.synctex.gz I/O identifier  */\r\n+    gzFile file;                /*  the foo.synctex or foo.synctex.gz I/O identifier  */\r\n \tsynctex_fprintf_t fprintf;  /*  either fprintf or gzprintf */\r\n \tint length;                 /*  the number of chars appended */\r\n     struct _flags {\r\n         unsigned int no_gz:1;   /*  Whether zlib is used or not */\r\n         unsigned int reserved:SYNCTEX_BITS_PER_BYTE*sizeof(int)-1; /*  Align */\r\ndiff -rPu5 synctex.orig\\synctex_parser_utils.c synctex\\synctex_parser_utils.c\r\n--- synctex.orig\\synctex_parser_utils.c\tTue Jun 14 10:23:56 2011\r\n+++ synctex\\synctex_parser_utils.c\tMon Mar 12 19:56:52 2012\r\n@@ -166,10 +166,13 @@\r\n next_character:\r\n \tif(SYNCTEX_IS_PATH_SEPARATOR(*lhs)) {/*  lhs points to a path separator */\r\n \t\tif(!SYNCTEX_IS_PATH_SEPARATOR(*rhs)) {/*  but not rhs */\r\n \t\t\treturn synctex_NO;\r\n \t\t}\r\n+\t\t/* SumatraPDF: ignore spurious \"./\" parts (caused by TeXlive 2011) */\r\n+\t\tlhs = synctex_ignore_leading_dot_slash(lhs + 1) - 1;\r\n+\t\trhs = synctex_ignore_leading_dot_slash(rhs + 1) - 1;\r\n \t} else if(SYNCTEX_IS_PATH_SEPARATOR(*rhs)) {/*  rhs points to a path separator but not lhs */\r\n \t\treturn synctex_NO;\r\n \t} else if(toupper(*lhs) != toupper(*rhs)){/*  uppercase do not match */\r\n \t\treturn synctex_NO;\r\n \t} else if (!*lhs) {/*  lhs is at the end of the string */\r\n"
  },
  {
    "path": "ext/bzip2/CHANGES",
    "content": " ------------------------------------------------------------------\n This file is part of bzip2/libbzip2, a program and library for\n lossless, block-sorting data compression.\n\n bzip2/libbzip2 version 1.0.6 of 6 September 2010\n Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>\n\n Please read the WARNING, DISCLAIMER and PATENTS sections in the \n README file.\n\n This program is released under the terms of the license contained\n in the file LICENSE.\n ------------------------------------------------------------------\n\n\n0.9.0\n~~~~~\nFirst version.\n\n\n0.9.0a\n~~~~~~\nRemoved 'ranlib' from Makefile, since most modern Unix-es \ndon't need it, or even know about it.\n\n\n0.9.0b\n~~~~~~\nFixed a problem with error reporting in bzip2.c.  This does not effect\nthe library in any way.  Problem is: versions 0.9.0 and 0.9.0a (of the\nprogram proper) compress and decompress correctly, but give misleading\nerror messages (internal panics) when an I/O error occurs, instead of\nreporting the problem correctly.  This shouldn't give any data loss\n(as far as I can see), but is confusing.\n\nMade the inline declarations disappear for non-GCC compilers.\n\n\n0.9.0c\n~~~~~~\nFixed some problems in the library pertaining to some boundary cases.\nThis makes the library behave more correctly in those situations.  The\nfixes apply only to features (calls and parameters) not used by\nbzip2.c, so the non-fixedness of them in previous versions has no\neffect on reliability of bzip2.c.\n\nIn bzlib.c:\n   * made zero-length BZ_FLUSH work correctly in bzCompress().\n   * fixed bzWrite/bzRead to ignore zero-length requests.\n   * fixed bzread to correctly handle read requests after EOF.\n   * wrong parameter order in call to bzDecompressInit in\n     bzBuffToBuffDecompress.  Fixed.\n\nIn compress.c:\n   * changed setting of nGroups in sendMTFValues() so as to \n     do a bit better on small files.  This _does_ effect\n     bzip2.c.\n\n\n0.9.5a\n~~~~~~\nMajor change: add a fallback sorting algorithm (blocksort.c)\nto give reasonable behaviour even for very repetitive inputs.\nNuked --repetitive-best and --repetitive-fast since they are\nno longer useful.\n\nMinor changes: mostly a whole bunch of small changes/\nbugfixes in the driver (bzip2.c).  Changes pertaining to the\nuser interface are:\n\n   allow decompression of symlink'd files to stdout\n   decompress/test files even without .bz2 extension\n   give more accurate error messages for I/O errors\n   when compressing/decompressing to stdout, don't catch control-C\n   read flags from BZIP2 and BZIP environment variables\n   decline to break hard links to a file unless forced with -f\n   allow -c flag even with no filenames\n   preserve file ownerships as far as possible\n   make -s -1 give the expected block size (100k)\n   add a flag -q --quiet to suppress nonessential warnings\n   stop decoding flags after --, so files beginning in - can be handled\n   resolved inconsistent naming: bzcat or bz2cat ?\n   bzip2 --help now returns 0\n\nProgramming-level changes are:\n\n   fixed syntax error in GET_LL4 for Borland C++ 5.02\n   let bzBuffToBuffDecompress return BZ_DATA_ERROR{_MAGIC}\n   fix overshoot of mode-string end in bzopen_or_bzdopen\n   wrapped bzlib.h in #ifdef __cplusplus ... extern \"C\" { ... }\n   close file handles under all error conditions\n   added minor mods so it compiles with DJGPP out of the box\n   fixed Makefile so it doesn't give problems with BSD make\n   fix uninitialised memory reads in dlltest.c\n\n0.9.5b\n~~~~~~\nOpen stdin/stdout in binary mode for DJGPP.\n\n0.9.5c\n~~~~~~\nChanged BZ_N_OVERSHOOT to be ... + 2 instead of ... + 1.  The + 1\nversion could cause the sorted order to be wrong in some extremely\nobscure cases.  Also changed setting of quadrant in blocksort.c.\n\n0.9.5d\n~~~~~~\nThe only functional change is to make bzlibVersion() in the library\nreturn the correct string.  This has no effect whatsoever on the\nfunctioning of the bzip2 program or library.  Added a couple of casts\nso the library compiles without warnings at level 3 in MS Visual\nStudio 6.0.  Included a Y2K statement in the file Y2K_INFO.  All other\nchanges are minor documentation changes.\n\n1.0\n~~~\nSeveral minor bugfixes and enhancements:\n\n* Large file support.  The library uses 64-bit counters to\n  count the volume of data passing through it.  bzip2.c \n  is now compiled with -D_FILE_OFFSET_BITS=64 to get large\n  file support from the C library.  -v correctly prints out\n  file sizes greater than 4 gigabytes.  All these changes have\n  been made without assuming a 64-bit platform or a C compiler\n  which supports 64-bit ints, so, except for the C library\n  aspect, they are fully portable.\n\n* Decompression robustness.  The library/program should be\n  robust to any corruption of compressed data, detecting and\n  handling _all_ corruption, instead of merely relying on\n  the CRCs.  What this means is that the program should \n  never crash, given corrupted data, and the library should\n  always return BZ_DATA_ERROR.\n\n* Fixed an obscure race-condition bug only ever observed on\n  Solaris, in which, if you were very unlucky and issued\n  control-C at exactly the wrong time, both input and output\n  files would be deleted.\n\n* Don't run out of file handles on test/decompression when\n  large numbers of files have invalid magic numbers.\n\n* Avoid library namespace pollution.  Prefix all exported \n  symbols with BZ2_.\n\n* Minor sorting enhancements from my DCC2000 paper.\n\n* Advance the version number to 1.0, so as to counteract the\n  (false-in-this-case) impression some people have that programs \n  with version numbers less than 1.0 are in some way, experimental,\n  pre-release versions.\n\n* Create an initial Makefile-libbz2_so to build a shared library.\n  Yes, I know I should really use libtool et al ...\n\n* Make the program exit with 2 instead of 0 when decompression\n  fails due to a bad magic number (ie, an invalid bzip2 header).\n  Also exit with 1 (as the manual claims :-) whenever a diagnostic\n  message would have been printed AND the corresponding operation \n  is aborted, for example\n     bzip2: Output file xx already exists.\n  When a diagnostic message is printed but the operation is not \n  aborted, for example\n     bzip2: Can't guess original name for wurble -- using wurble.out\n  then the exit value 0 is returned, unless some other problem is\n  also detected.\n\n  I think it corresponds more closely to what the manual claims now.\n\n\n1.0.1\n~~~~~\n* Modified dlltest.c so it uses the new BZ2_ naming scheme.\n* Modified makefile-msc to fix minor build probs on Win2k.\n* Updated README.COMPILATION.PROBLEMS.\n\nThere are no functionality changes or bug fixes relative to version\n1.0.0.  This is just a documentation update + a fix for minor Win32\nbuild problems.  For almost everyone, upgrading from 1.0.0 to 1.0.1 is\nutterly pointless.  Don't bother.\n\n\n1.0.2\n~~~~~\nA bug fix release, addressing various minor issues which have appeared\nin the 18 or so months since 1.0.1 was released.  Most of the fixes\nare to do with file-handling or documentation bugs.  To the best of my\nknowledge, there have been no data-loss-causing bugs reported in the\ncompression/decompression engine of 1.0.0 or 1.0.1.\n\nNote that this release does not improve the rather crude build system\nfor Unix platforms.  The general plan here is to autoconfiscate/\nlibtoolise 1.0.2 soon after release, and release the result as 1.1.0\nor perhaps 1.2.0.  That, however, is still just a plan at this point.\n\nHere are the changes in 1.0.2.  Bug-reporters and/or patch-senders in\nparentheses.\n\n* Fix an infinite segfault loop in 1.0.1 when a directory is\n  encountered in -f (force) mode.\n     (Trond Eivind Glomsrod, Nicholas Nethercote, Volker Schmidt)\n\n* Avoid double fclose() of output file on certain I/O error paths.\n     (Solar Designer)\n\n* Don't fail with internal error 1007 when fed a long stream (> 48MB)\n  of byte 251.  Also print useful message suggesting that 1007s may be\n  caused by bad memory.\n     (noticed by Juan Pedro Vallejo, fixed by me)\n\n* Fix uninitialised variable silly bug in demo prog dlltest.c.\n     (Jorj Bauer)\n\n* Remove 512-MB limitation on recovered file size for bzip2recover\n  on selected platforms which support 64-bit ints.  At the moment\n  all GCC supported platforms, and Win32.\n     (me, Alson van der Meulen)\n\n* Hard-code header byte values, to give correct operation on platforms\n  using EBCDIC as their native character set (IBM's OS/390).\n     (Leland Lucius)\n\n* Copy file access times correctly.\n     (Marty Leisner)\n\n* Add distclean and check targets to Makefile.\n     (Michael Carmack)\n\n* Parameterise use of ar and ranlib in Makefile.  Also add $(LDFLAGS).\n     (Rich Ireland, Bo Thorsen)\n\n* Pass -p (create parent dirs as needed) to mkdir during make install.\n     (Jeremy Fusco)\n\n* Dereference symlinks when copying file permissions in -f mode.\n     (Volker Schmidt)\n\n* Majorly simplify implementation of uInt64_qrm10.\n     (Bo Lindbergh)\n\n* Check the input file still exists before deleting the output one,\n  when aborting in cleanUpAndFail().\n     (Joerg Prante, Robert Linden, Matthias Krings)\n\nAlso a bunch of patches courtesy of Philippe Troin, the Debian maintainer\nof bzip2:\n\n* Wrapper scripts (with manpages): bzdiff, bzgrep, bzmore.\n\n* Spelling changes and minor enhancements in bzip2.1.\n\n* Avoid race condition between creating the output file and setting its\n  interim permissions safely, by using fopen_output_safely().\n  No changes to bzip2recover since there is no issue with file\n  permissions there.\n\n* do not print senseless report with -v when compressing an empty\n  file.\n\n* bzcat -f works on non-bzip2 files.\n\n* do not try to escape shell meta-characters on unix (the shell takes\n  care of these).\n\n* added --fast and --best aliases for -1 -9 for gzip compatibility.\n\n\n1.0.3 (15 Feb 05)\n~~~~~~~~~~~~~~~~~\nFixes some minor bugs since the last version, 1.0.2.\n\n* Further robustification against corrupted compressed data.\n  There are currently no known bitstreams which can cause the\n  decompressor to crash, loop or access memory which does not\n  belong to it.  If you are using bzip2 or the library to \n  decompress bitstreams from untrusted sources, an upgrade\n  to 1.0.3 is recommended.  This fixes CAN-2005-1260.\n\n* The documentation has been converted to XML, from which html\n  and pdf can be derived.\n\n* Various minor bugs in the documentation have been fixed.\n\n* Fixes for various compilation warnings with newer versions of\n  gcc, and on 64-bit platforms.\n\n* The BZ_NO_STDIO cpp symbol was not properly observed in 1.0.2.\n  This has been fixed.\n\n\n1.0.4 (20 Dec 06)\n~~~~~~~~~~~~~~~~~\nFixes some minor bugs since the last version, 1.0.3.\n\n* Fix file permissions race problem (CAN-2005-0953).\n\n* Avoid possible segfault in BZ2_bzclose.  From Coverity's NetBSD\n  scan.\n\n* 'const'/prototype cleanups in the C code.\n\n* Change default install location to /usr/local, and handle multiple\n  'make install's without error.\n\n* Sanitise file names more carefully in bzgrep.  Fixes CAN-2005-0758\n  to the extent that applies to bzgrep.\n\n* Use 'mktemp' rather than 'tempfile' in bzdiff.\n\n* Tighten up a couple of assertions in blocksort.c following automated\n  analysis.\n\n* Fix minor doc/comment bugs.\n\n\n1.0.5 (10 Dec 07)\n~~~~~~~~~~~~~~~~~\nSecurity fix only.  Fixes CERT-FI 20469 as it applies to bzip2.\n\n\n1.0.6 (6 Sept 10)\n~~~~~~~~~~~~~~~~~\n\n* Security fix for CVE-2010-0405.  This was reported by Mikolaj\n  Izdebski.\n\n* Make the documentation build on Ubuntu 10.04\n"
  },
  {
    "path": "ext/bzip2/LICENSE",
    "content": "\n--------------------------------------------------------------------------\n\nThis program, \"bzip2\", the associated library \"libbzip2\", and all\ndocumentation, are copyright (C) 1996-2010 Julian R Seward.  All\nrights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1. Redistributions of source code must retain the above copyright\n   notice, this list of conditions and the following disclaimer.\n\n2. The origin of this software must not be misrepresented; you must \n   not claim that you wrote the original software.  If you use this \n   software in a product, an acknowledgment in the product \n   documentation would be appreciated but is not required.\n\n3. Altered source versions must be plainly marked as such, and must\n   not be misrepresented as being the original software.\n\n4. The name of the author may not be used to endorse or promote \n   products derived from this software without specific prior written \n   permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS\nOR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\nGOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\nWHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nJulian Seward, jseward@bzip.org\nbzip2/libbzip2 version 1.0.6 of 6 September 2010\n\n--------------------------------------------------------------------------\n"
  },
  {
    "path": "ext/bzip2/blocksort.c",
    "content": "\n/*-------------------------------------------------------------*/\n/*--- Block sorting machinery                               ---*/\n/*---                                           blocksort.c ---*/\n/*-------------------------------------------------------------*/\n\n/* ------------------------------------------------------------------\n   This file is part of bzip2/libbzip2, a program and library for\n   lossless, block-sorting data compression.\n\n   bzip2/libbzip2 version 1.0.6 of 6 September 2010\n   Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>\n\n   Please read the WARNING, DISCLAIMER and PATENTS sections in the \n   README file.\n\n   This program is released under the terms of the license contained\n   in the file LICENSE.\n   ------------------------------------------------------------------ */\n\n\n#include \"bzlib_private.h\"\n\n/*---------------------------------------------*/\n/*--- Fallback O(N log(N)^2) sorting        ---*/\n/*--- algorithm, for repetitive blocks      ---*/\n/*---------------------------------------------*/\n\n/*---------------------------------------------*/\nstatic \n__inline__\nvoid fallbackSimpleSort ( UInt32* fmap, \n                          UInt32* eclass, \n                          Int32   lo, \n                          Int32   hi )\n{\n   Int32 i, j, tmp;\n   UInt32 ec_tmp;\n\n   if (lo == hi) return;\n\n   if (hi - lo > 3) {\n      for ( i = hi-4; i >= lo; i-- ) {\n         tmp = fmap[i];\n         ec_tmp = eclass[tmp];\n         for ( j = i+4; j <= hi && ec_tmp > eclass[fmap[j]]; j += 4 )\n            fmap[j-4] = fmap[j];\n         fmap[j-4] = tmp;\n      }\n   }\n\n   for ( i = hi-1; i >= lo; i-- ) {\n      tmp = fmap[i];\n      ec_tmp = eclass[tmp];\n      for ( j = i+1; j <= hi && ec_tmp > eclass[fmap[j]]; j++ )\n         fmap[j-1] = fmap[j];\n      fmap[j-1] = tmp;\n   }\n}\n\n\n/*---------------------------------------------*/\n#define fswap(zz1, zz2) \\\n   { Int32 zztmp = zz1; zz1 = zz2; zz2 = zztmp; }\n\n#define fvswap(zzp1, zzp2, zzn)       \\\n{                                     \\\n   Int32 yyp1 = (zzp1);               \\\n   Int32 yyp2 = (zzp2);               \\\n   Int32 yyn  = (zzn);                \\\n   while (yyn > 0) {                  \\\n      fswap(fmap[yyp1], fmap[yyp2]);  \\\n      yyp1++; yyp2++; yyn--;          \\\n   }                                  \\\n}\n\n\n#define fmin(a,b) ((a) < (b)) ? (a) : (b)\n\n#define fpush(lz,hz) { stackLo[sp] = lz; \\\n                       stackHi[sp] = hz; \\\n                       sp++; }\n\n#define fpop(lz,hz) { sp--;              \\\n                      lz = stackLo[sp];  \\\n                      hz = stackHi[sp]; }\n\n#define FALLBACK_QSORT_SMALL_THRESH 10\n#define FALLBACK_QSORT_STACK_SIZE   100\n\n\nstatic\nvoid fallbackQSort3 ( UInt32* fmap, \n                      UInt32* eclass,\n                      Int32   loSt, \n                      Int32   hiSt )\n{\n   Int32 unLo, unHi, ltLo, gtHi, n, m;\n   Int32 sp, lo, hi;\n   UInt32 med, r, r3;\n   Int32 stackLo[FALLBACK_QSORT_STACK_SIZE];\n   Int32 stackHi[FALLBACK_QSORT_STACK_SIZE];\n\n   r = 0;\n\n   sp = 0;\n   fpush ( loSt, hiSt );\n\n   while (sp > 0) {\n\n      AssertH ( sp < FALLBACK_QSORT_STACK_SIZE - 1, 1004 );\n\n      fpop ( lo, hi );\n      if (hi - lo < FALLBACK_QSORT_SMALL_THRESH) {\n         fallbackSimpleSort ( fmap, eclass, lo, hi );\n         continue;\n      }\n\n      /* Random partitioning.  Median of 3 sometimes fails to\n         avoid bad cases.  Median of 9 seems to help but \n         looks rather expensive.  This too seems to work but\n         is cheaper.  Guidance for the magic constants \n         7621 and 32768 is taken from Sedgewick's algorithms\n         book, chapter 35.\n      */\n      r = ((r * 7621) + 1) % 32768;\n      r3 = r % 3;\n      if (r3 == 0) med = eclass[fmap[lo]]; else\n      if (r3 == 1) med = eclass[fmap[(lo+hi)>>1]]; else\n                   med = eclass[fmap[hi]];\n\n      unLo = ltLo = lo;\n      unHi = gtHi = hi;\n\n      while (1) {\n         while (1) {\n            if (unLo > unHi) break;\n            n = (Int32)eclass[fmap[unLo]] - (Int32)med;\n            if (n == 0) { \n               fswap(fmap[unLo], fmap[ltLo]); \n               ltLo++; unLo++; \n               continue; \n            };\n            if (n > 0) break;\n            unLo++;\n         }\n         while (1) {\n            if (unLo > unHi) break;\n            n = (Int32)eclass[fmap[unHi]] - (Int32)med;\n            if (n == 0) { \n               fswap(fmap[unHi], fmap[gtHi]); \n               gtHi--; unHi--; \n               continue; \n            };\n            if (n < 0) break;\n            unHi--;\n         }\n         if (unLo > unHi) break;\n         fswap(fmap[unLo], fmap[unHi]); unLo++; unHi--;\n      }\n\n      AssertD ( unHi == unLo-1, \"fallbackQSort3(2)\" );\n\n      if (gtHi < ltLo) continue;\n\n      n = fmin(ltLo-lo, unLo-ltLo); fvswap(lo, unLo-n, n);\n      m = fmin(hi-gtHi, gtHi-unHi); fvswap(unLo, hi-m+1, m);\n\n      n = lo + unLo - ltLo - 1;\n      m = hi - (gtHi - unHi) + 1;\n\n      if (n - lo > hi - m) {\n         fpush ( lo, n );\n         fpush ( m, hi );\n      } else {\n         fpush ( m, hi );\n         fpush ( lo, n );\n      }\n   }\n}\n\n#undef fmin\n#undef fpush\n#undef fpop\n#undef fswap\n#undef fvswap\n#undef FALLBACK_QSORT_SMALL_THRESH\n#undef FALLBACK_QSORT_STACK_SIZE\n\n\n/*---------------------------------------------*/\n/* Pre:\n      nblock > 0\n      eclass exists for [0 .. nblock-1]\n      ((UChar*)eclass) [0 .. nblock-1] holds block\n      ptr exists for [0 .. nblock-1]\n\n   Post:\n      ((UChar*)eclass) [0 .. nblock-1] holds block\n      All other areas of eclass destroyed\n      fmap [0 .. nblock-1] holds sorted order\n      bhtab [ 0 .. 2+(nblock/32) ] destroyed\n*/\n\n#define       SET_BH(zz)  bhtab[(zz) >> 5] |= (1 << ((zz) & 31))\n#define     CLEAR_BH(zz)  bhtab[(zz) >> 5] &= ~(1 << ((zz) & 31))\n#define     ISSET_BH(zz)  (bhtab[(zz) >> 5] & (1 << ((zz) & 31)))\n#define      WORD_BH(zz)  bhtab[(zz) >> 5]\n#define UNALIGNED_BH(zz)  ((zz) & 0x01f)\n\nstatic\nvoid fallbackSort ( UInt32* fmap, \n                    UInt32* eclass, \n                    UInt32* bhtab,\n                    Int32   nblock,\n                    Int32   verb )\n{\n   Int32 ftab[257];\n   Int32 ftabCopy[256];\n   Int32 H, i, j, k, l, r, cc, cc1;\n   Int32 nNotDone;\n   Int32 nBhtab;\n   UChar* eclass8 = (UChar*)eclass;\n\n   /*--\n      Initial 1-char radix sort to generate\n      initial fmap and initial BH bits.\n   --*/\n   if (verb >= 4)\n      VPrintf0 ( \"        bucket sorting ...\\n\" );\n   for (i = 0; i < 257;    i++) ftab[i] = 0;\n   for (i = 0; i < nblock; i++) ftab[eclass8[i]]++;\n   for (i = 0; i < 256;    i++) ftabCopy[i] = ftab[i];\n   for (i = 1; i < 257;    i++) ftab[i] += ftab[i-1];\n\n   for (i = 0; i < nblock; i++) {\n      j = eclass8[i];\n      k = ftab[j] - 1;\n      ftab[j] = k;\n      fmap[k] = i;\n   }\n\n   nBhtab = 2 + (nblock / 32);\n   for (i = 0; i < nBhtab; i++) bhtab[i] = 0;\n   for (i = 0; i < 256; i++) SET_BH(ftab[i]);\n\n   /*--\n      Inductively refine the buckets.  Kind-of an\n      \"exponential radix sort\" (!), inspired by the\n      Manber-Myers suffix array construction algorithm.\n   --*/\n\n   /*-- set sentinel bits for block-end detection --*/\n   for (i = 0; i < 32; i++) { \n      SET_BH(nblock + 2*i);\n      CLEAR_BH(nblock + 2*i + 1);\n   }\n\n   /*-- the log(N) loop --*/\n   H = 1;\n   while (1) {\n\n      if (verb >= 4) \n         VPrintf1 ( \"        depth %6d has \", H );\n\n      j = 0;\n      for (i = 0; i < nblock; i++) {\n         if (ISSET_BH(i)) j = i;\n         k = fmap[i] - H; if (k < 0) k += nblock;\n         eclass[k] = j;\n      }\n\n      nNotDone = 0;\n      r = -1;\n      while (1) {\n\n\t /*-- find the next non-singleton bucket --*/\n         k = r + 1;\n         while (ISSET_BH(k) && UNALIGNED_BH(k)) k++;\n         if (ISSET_BH(k)) {\n            while (WORD_BH(k) == 0xffffffff) k += 32;\n            while (ISSET_BH(k)) k++;\n         }\n         l = k - 1;\n         if (l >= nblock) break;\n         while (!ISSET_BH(k) && UNALIGNED_BH(k)) k++;\n         if (!ISSET_BH(k)) {\n            while (WORD_BH(k) == 0x00000000) k += 32;\n            while (!ISSET_BH(k)) k++;\n         }\n         r = k - 1;\n         if (r >= nblock) break;\n\n         /*-- now [l, r] bracket current bucket --*/\n         if (r > l) {\n            nNotDone += (r - l + 1);\n            fallbackQSort3 ( fmap, eclass, l, r );\n\n            /*-- scan bucket and generate header bits-- */\n            cc = -1;\n            for (i = l; i <= r; i++) {\n               cc1 = eclass[fmap[i]];\n               if (cc != cc1) { SET_BH(i); cc = cc1; };\n            }\n         }\n      }\n\n      if (verb >= 4) \n         VPrintf1 ( \"%6d unresolved strings\\n\", nNotDone );\n\n      H *= 2;\n      if (H > nblock || nNotDone == 0) break;\n   }\n\n   /*-- \n      Reconstruct the original block in\n      eclass8 [0 .. nblock-1], since the\n      previous phase destroyed it.\n   --*/\n   if (verb >= 4)\n      VPrintf0 ( \"        reconstructing block ...\\n\" );\n   j = 0;\n   for (i = 0; i < nblock; i++) {\n      while (ftabCopy[j] == 0) j++;\n      ftabCopy[j]--;\n      eclass8[fmap[i]] = (UChar)j;\n   }\n   AssertH ( j < 256, 1005 );\n}\n\n#undef       SET_BH\n#undef     CLEAR_BH\n#undef     ISSET_BH\n#undef      WORD_BH\n#undef UNALIGNED_BH\n\n\n/*---------------------------------------------*/\n/*--- The main, O(N^2 log(N)) sorting       ---*/\n/*--- algorithm.  Faster for \"normal\"       ---*/\n/*--- non-repetitive blocks.                ---*/\n/*---------------------------------------------*/\n\n/*---------------------------------------------*/\nstatic\n__inline__\nBool mainGtU ( UInt32  i1, \n               UInt32  i2,\n               UChar*  block, \n               UInt16* quadrant,\n               UInt32  nblock,\n               Int32*  budget )\n{\n   Int32  k;\n   UChar  c1, c2;\n   UInt16 s1, s2;\n\n   AssertD ( i1 != i2, \"mainGtU\" );\n   /* 1 */\n   c1 = block[i1]; c2 = block[i2];\n   if (c1 != c2) return (c1 > c2);\n   i1++; i2++;\n   /* 2 */\n   c1 = block[i1]; c2 = block[i2];\n   if (c1 != c2) return (c1 > c2);\n   i1++; i2++;\n   /* 3 */\n   c1 = block[i1]; c2 = block[i2];\n   if (c1 != c2) return (c1 > c2);\n   i1++; i2++;\n   /* 4 */\n   c1 = block[i1]; c2 = block[i2];\n   if (c1 != c2) return (c1 > c2);\n   i1++; i2++;\n   /* 5 */\n   c1 = block[i1]; c2 = block[i2];\n   if (c1 != c2) return (c1 > c2);\n   i1++; i2++;\n   /* 6 */\n   c1 = block[i1]; c2 = block[i2];\n   if (c1 != c2) return (c1 > c2);\n   i1++; i2++;\n   /* 7 */\n   c1 = block[i1]; c2 = block[i2];\n   if (c1 != c2) return (c1 > c2);\n   i1++; i2++;\n   /* 8 */\n   c1 = block[i1]; c2 = block[i2];\n   if (c1 != c2) return (c1 > c2);\n   i1++; i2++;\n   /* 9 */\n   c1 = block[i1]; c2 = block[i2];\n   if (c1 != c2) return (c1 > c2);\n   i1++; i2++;\n   /* 10 */\n   c1 = block[i1]; c2 = block[i2];\n   if (c1 != c2) return (c1 > c2);\n   i1++; i2++;\n   /* 11 */\n   c1 = block[i1]; c2 = block[i2];\n   if (c1 != c2) return (c1 > c2);\n   i1++; i2++;\n   /* 12 */\n   c1 = block[i1]; c2 = block[i2];\n   if (c1 != c2) return (c1 > c2);\n   i1++; i2++;\n\n   k = nblock + 8;\n\n   do {\n      /* 1 */\n      c1 = block[i1]; c2 = block[i2];\n      if (c1 != c2) return (c1 > c2);\n      s1 = quadrant[i1]; s2 = quadrant[i2];\n      if (s1 != s2) return (s1 > s2);\n      i1++; i2++;\n      /* 2 */\n      c1 = block[i1]; c2 = block[i2];\n      if (c1 != c2) return (c1 > c2);\n      s1 = quadrant[i1]; s2 = quadrant[i2];\n      if (s1 != s2) return (s1 > s2);\n      i1++; i2++;\n      /* 3 */\n      c1 = block[i1]; c2 = block[i2];\n      if (c1 != c2) return (c1 > c2);\n      s1 = quadrant[i1]; s2 = quadrant[i2];\n      if (s1 != s2) return (s1 > s2);\n      i1++; i2++;\n      /* 4 */\n      c1 = block[i1]; c2 = block[i2];\n      if (c1 != c2) return (c1 > c2);\n      s1 = quadrant[i1]; s2 = quadrant[i2];\n      if (s1 != s2) return (s1 > s2);\n      i1++; i2++;\n      /* 5 */\n      c1 = block[i1]; c2 = block[i2];\n      if (c1 != c2) return (c1 > c2);\n      s1 = quadrant[i1]; s2 = quadrant[i2];\n      if (s1 != s2) return (s1 > s2);\n      i1++; i2++;\n      /* 6 */\n      c1 = block[i1]; c2 = block[i2];\n      if (c1 != c2) return (c1 > c2);\n      s1 = quadrant[i1]; s2 = quadrant[i2];\n      if (s1 != s2) return (s1 > s2);\n      i1++; i2++;\n      /* 7 */\n      c1 = block[i1]; c2 = block[i2];\n      if (c1 != c2) return (c1 > c2);\n      s1 = quadrant[i1]; s2 = quadrant[i2];\n      if (s1 != s2) return (s1 > s2);\n      i1++; i2++;\n      /* 8 */\n      c1 = block[i1]; c2 = block[i2];\n      if (c1 != c2) return (c1 > c2);\n      s1 = quadrant[i1]; s2 = quadrant[i2];\n      if (s1 != s2) return (s1 > s2);\n      i1++; i2++;\n\n      if (i1 >= nblock) i1 -= nblock;\n      if (i2 >= nblock) i2 -= nblock;\n\n      k -= 8;\n      (*budget)--;\n   }\n      while (k >= 0);\n\n   return False;\n}\n\n\n/*---------------------------------------------*/\n/*--\n   Knuth's increments seem to work better\n   than Incerpi-Sedgewick here.  Possibly\n   because the number of elems to sort is\n   usually small, typically <= 20.\n--*/\nstatic\nInt32 incs[14] = { 1, 4, 13, 40, 121, 364, 1093, 3280,\n                   9841, 29524, 88573, 265720,\n                   797161, 2391484 };\n\nstatic\nvoid mainSimpleSort ( UInt32* ptr,\n                      UChar*  block,\n                      UInt16* quadrant,\n                      Int32   nblock,\n                      Int32   lo, \n                      Int32   hi, \n                      Int32   d,\n                      Int32*  budget )\n{\n   Int32 i, j, h, bigN, hp;\n   UInt32 v;\n\n   bigN = hi - lo + 1;\n   if (bigN < 2) return;\n\n   hp = 0;\n   while (incs[hp] < bigN) hp++;\n   hp--;\n\n   for (; hp >= 0; hp--) {\n      h = incs[hp];\n\n      i = lo + h;\n      while (True) {\n\n         /*-- copy 1 --*/\n         if (i > hi) break;\n         v = ptr[i];\n         j = i;\n         while ( mainGtU ( \n                    ptr[j-h]+d, v+d, block, quadrant, nblock, budget \n                 ) ) {\n            ptr[j] = ptr[j-h];\n            j = j - h;\n            if (j <= (lo + h - 1)) break;\n         }\n         ptr[j] = v;\n         i++;\n\n         /*-- copy 2 --*/\n         if (i > hi) break;\n         v = ptr[i];\n         j = i;\n         while ( mainGtU ( \n                    ptr[j-h]+d, v+d, block, quadrant, nblock, budget \n                 ) ) {\n            ptr[j] = ptr[j-h];\n            j = j - h;\n            if (j <= (lo + h - 1)) break;\n         }\n         ptr[j] = v;\n         i++;\n\n         /*-- copy 3 --*/\n         if (i > hi) break;\n         v = ptr[i];\n         j = i;\n         while ( mainGtU ( \n                    ptr[j-h]+d, v+d, block, quadrant, nblock, budget \n                 ) ) {\n            ptr[j] = ptr[j-h];\n            j = j - h;\n            if (j <= (lo + h - 1)) break;\n         }\n         ptr[j] = v;\n         i++;\n\n         if (*budget < 0) return;\n      }\n   }\n}\n\n\n/*---------------------------------------------*/\n/*--\n   The following is an implementation of\n   an elegant 3-way quicksort for strings,\n   described in a paper \"Fast Algorithms for\n   Sorting and Searching Strings\", by Robert\n   Sedgewick and Jon L. Bentley.\n--*/\n\n#define mswap(zz1, zz2) \\\n   { Int32 zztmp = zz1; zz1 = zz2; zz2 = zztmp; }\n\n#define mvswap(zzp1, zzp2, zzn)       \\\n{                                     \\\n   Int32 yyp1 = (zzp1);               \\\n   Int32 yyp2 = (zzp2);               \\\n   Int32 yyn  = (zzn);                \\\n   while (yyn > 0) {                  \\\n      mswap(ptr[yyp1], ptr[yyp2]);    \\\n      yyp1++; yyp2++; yyn--;          \\\n   }                                  \\\n}\n\nstatic \n__inline__\nUChar mmed3 ( UChar a, UChar b, UChar c )\n{\n   UChar t;\n   if (a > b) { t = a; a = b; b = t; };\n   if (b > c) { \n      b = c;\n      if (a > b) b = a;\n   }\n   return b;\n}\n\n#define mmin(a,b) ((a) < (b)) ? (a) : (b)\n\n#define mpush(lz,hz,dz) { stackLo[sp] = lz; \\\n                          stackHi[sp] = hz; \\\n                          stackD [sp] = dz; \\\n                          sp++; }\n\n#define mpop(lz,hz,dz) { sp--;             \\\n                         lz = stackLo[sp]; \\\n                         hz = stackHi[sp]; \\\n                         dz = stackD [sp]; }\n\n\n#define mnextsize(az) (nextHi[az]-nextLo[az])\n\n#define mnextswap(az,bz)                                        \\\n   { Int32 tz;                                                  \\\n     tz = nextLo[az]; nextLo[az] = nextLo[bz]; nextLo[bz] = tz; \\\n     tz = nextHi[az]; nextHi[az] = nextHi[bz]; nextHi[bz] = tz; \\\n     tz = nextD [az]; nextD [az] = nextD [bz]; nextD [bz] = tz; }\n\n\n#define MAIN_QSORT_SMALL_THRESH 20\n#define MAIN_QSORT_DEPTH_THRESH (BZ_N_RADIX + BZ_N_QSORT)\n#define MAIN_QSORT_STACK_SIZE 100\n\nstatic\nvoid mainQSort3 ( UInt32* ptr,\n                  UChar*  block,\n                  UInt16* quadrant,\n                  Int32   nblock,\n                  Int32   loSt, \n                  Int32   hiSt, \n                  Int32   dSt,\n                  Int32*  budget )\n{\n   Int32 unLo, unHi, ltLo, gtHi, n, m, med;\n   Int32 sp, lo, hi, d;\n\n   Int32 stackLo[MAIN_QSORT_STACK_SIZE];\n   Int32 stackHi[MAIN_QSORT_STACK_SIZE];\n   Int32 stackD [MAIN_QSORT_STACK_SIZE];\n\n   Int32 nextLo[3];\n   Int32 nextHi[3];\n   Int32 nextD [3];\n\n   sp = 0;\n   mpush ( loSt, hiSt, dSt );\n\n   while (sp > 0) {\n\n      AssertH ( sp < MAIN_QSORT_STACK_SIZE - 2, 1001 );\n\n      mpop ( lo, hi, d );\n      if (hi - lo < MAIN_QSORT_SMALL_THRESH || \n          d > MAIN_QSORT_DEPTH_THRESH) {\n         mainSimpleSort ( ptr, block, quadrant, nblock, lo, hi, d, budget );\n         if (*budget < 0) return;\n         continue;\n      }\n\n      med = (Int32) \n            mmed3 ( block[ptr[ lo         ]+d],\n                    block[ptr[ hi         ]+d],\n                    block[ptr[ (lo+hi)>>1 ]+d] );\n\n      unLo = ltLo = lo;\n      unHi = gtHi = hi;\n\n      while (True) {\n         while (True) {\n            if (unLo > unHi) break;\n            n = ((Int32)block[ptr[unLo]+d]) - med;\n            if (n == 0) { \n               mswap(ptr[unLo], ptr[ltLo]); \n               ltLo++; unLo++; continue; \n            };\n            if (n >  0) break;\n            unLo++;\n         }\n         while (True) {\n            if (unLo > unHi) break;\n            n = ((Int32)block[ptr[unHi]+d]) - med;\n            if (n == 0) { \n               mswap(ptr[unHi], ptr[gtHi]); \n               gtHi--; unHi--; continue; \n            };\n            if (n <  0) break;\n            unHi--;\n         }\n         if (unLo > unHi) break;\n         mswap(ptr[unLo], ptr[unHi]); unLo++; unHi--;\n      }\n\n      AssertD ( unHi == unLo-1, \"mainQSort3(2)\" );\n\n      if (gtHi < ltLo) {\n         mpush(lo, hi, d+1 );\n         continue;\n      }\n\n      n = mmin(ltLo-lo, unLo-ltLo); mvswap(lo, unLo-n, n);\n      m = mmin(hi-gtHi, gtHi-unHi); mvswap(unLo, hi-m+1, m);\n\n      n = lo + unLo - ltLo - 1;\n      m = hi - (gtHi - unHi) + 1;\n\n      nextLo[0] = lo;  nextHi[0] = n;   nextD[0] = d;\n      nextLo[1] = m;   nextHi[1] = hi;  nextD[1] = d;\n      nextLo[2] = n+1; nextHi[2] = m-1; nextD[2] = d+1;\n\n      if (mnextsize(0) < mnextsize(1)) mnextswap(0,1);\n      if (mnextsize(1) < mnextsize(2)) mnextswap(1,2);\n      if (mnextsize(0) < mnextsize(1)) mnextswap(0,1);\n\n      AssertD (mnextsize(0) >= mnextsize(1), \"mainQSort3(8)\" );\n      AssertD (mnextsize(1) >= mnextsize(2), \"mainQSort3(9)\" );\n\n      mpush (nextLo[0], nextHi[0], nextD[0]);\n      mpush (nextLo[1], nextHi[1], nextD[1]);\n      mpush (nextLo[2], nextHi[2], nextD[2]);\n   }\n}\n\n#undef mswap\n#undef mvswap\n#undef mpush\n#undef mpop\n#undef mmin\n#undef mnextsize\n#undef mnextswap\n#undef MAIN_QSORT_SMALL_THRESH\n#undef MAIN_QSORT_DEPTH_THRESH\n#undef MAIN_QSORT_STACK_SIZE\n\n\n/*---------------------------------------------*/\n/* Pre:\n      nblock > N_OVERSHOOT\n      block32 exists for [0 .. nblock-1 +N_OVERSHOOT]\n      ((UChar*)block32) [0 .. nblock-1] holds block\n      ptr exists for [0 .. nblock-1]\n\n   Post:\n      ((UChar*)block32) [0 .. nblock-1] holds block\n      All other areas of block32 destroyed\n      ftab [0 .. 65536 ] destroyed\n      ptr [0 .. nblock-1] holds sorted order\n      if (*budget < 0), sorting was abandoned\n*/\n\n#define BIGFREQ(b) (ftab[((b)+1) << 8] - ftab[(b) << 8])\n#define SETMASK (1 << 21)\n#define CLEARMASK (~(SETMASK))\n\nstatic\nvoid mainSort ( UInt32* ptr, \n                UChar*  block,\n                UInt16* quadrant, \n                UInt32* ftab,\n                Int32   nblock,\n                Int32   verb,\n                Int32*  budget )\n{\n   Int32  i, j, k, ss, sb;\n   Int32  runningOrder[256];\n   Bool   bigDone[256];\n   Int32  copyStart[256];\n   Int32  copyEnd  [256];\n   UChar  c1;\n   Int32  numQSorted;\n   UInt16 s;\n   if (verb >= 4) VPrintf0 ( \"        main sort initialise ...\\n\" );\n\n   /*-- set up the 2-byte frequency table --*/\n   for (i = 65536; i >= 0; i--) ftab[i] = 0;\n\n   j = block[0] << 8;\n   i = nblock-1;\n   for (; i >= 3; i -= 4) {\n      quadrant[i] = 0;\n      j = (j >> 8) | ( ((UInt16)block[i]) << 8);\n      ftab[j]++;\n      quadrant[i-1] = 0;\n      j = (j >> 8) | ( ((UInt16)block[i-1]) << 8);\n      ftab[j]++;\n      quadrant[i-2] = 0;\n      j = (j >> 8) | ( ((UInt16)block[i-2]) << 8);\n      ftab[j]++;\n      quadrant[i-3] = 0;\n      j = (j >> 8) | ( ((UInt16)block[i-3]) << 8);\n      ftab[j]++;\n   }\n   for (; i >= 0; i--) {\n      quadrant[i] = 0;\n      j = (j >> 8) | ( ((UInt16)block[i]) << 8);\n      ftab[j]++;\n   }\n\n   /*-- (emphasises close relationship of block & quadrant) --*/\n   for (i = 0; i < BZ_N_OVERSHOOT; i++) {\n      block   [nblock+i] = block[i];\n      quadrant[nblock+i] = 0;\n   }\n\n   if (verb >= 4) VPrintf0 ( \"        bucket sorting ...\\n\" );\n\n   /*-- Complete the initial radix sort --*/\n   for (i = 1; i <= 65536; i++) ftab[i] += ftab[i-1];\n\n   s = block[0] << 8;\n   i = nblock-1;\n   for (; i >= 3; i -= 4) {\n      s = (s >> 8) | (block[i] << 8);\n      j = ftab[s] -1;\n      ftab[s] = j;\n      ptr[j] = i;\n      s = (s >> 8) | (block[i-1] << 8);\n      j = ftab[s] -1;\n      ftab[s] = j;\n      ptr[j] = i-1;\n      s = (s >> 8) | (block[i-2] << 8);\n      j = ftab[s] -1;\n      ftab[s] = j;\n      ptr[j] = i-2;\n      s = (s >> 8) | (block[i-3] << 8);\n      j = ftab[s] -1;\n      ftab[s] = j;\n      ptr[j] = i-3;\n   }\n   for (; i >= 0; i--) {\n      s = (s >> 8) | (block[i] << 8);\n      j = ftab[s] -1;\n      ftab[s] = j;\n      ptr[j] = i;\n   }\n\n   /*--\n      Now ftab contains the first loc of every small bucket.\n      Calculate the running order, from smallest to largest\n      big bucket.\n   --*/\n   for (i = 0; i <= 255; i++) {\n      bigDone     [i] = False;\n      runningOrder[i] = i;\n   }\n\n   {\n      Int32 vv;\n      Int32 h = 1;\n      do h = 3 * h + 1; while (h <= 256);\n      do {\n         h = h / 3;\n         for (i = h; i <= 255; i++) {\n            vv = runningOrder[i];\n            j = i;\n            while ( BIGFREQ(runningOrder[j-h]) > BIGFREQ(vv) ) {\n               runningOrder[j] = runningOrder[j-h];\n               j = j - h;\n               if (j <= (h - 1)) goto zero;\n            }\n            zero:\n            runningOrder[j] = vv;\n         }\n      } while (h != 1);\n   }\n\n   /*--\n      The main sorting loop.\n   --*/\n\n   numQSorted = 0;\n\n   for (i = 0; i <= 255; i++) {\n\n      /*--\n         Process big buckets, starting with the least full.\n         Basically this is a 3-step process in which we call\n         mainQSort3 to sort the small buckets [ss, j], but\n         also make a big effort to avoid the calls if we can.\n      --*/\n      ss = runningOrder[i];\n\n      /*--\n         Step 1:\n         Complete the big bucket [ss] by quicksorting\n         any unsorted small buckets [ss, j], for j != ss.  \n         Hopefully previous pointer-scanning phases have already\n         completed many of the small buckets [ss, j], so\n         we don't have to sort them at all.\n      --*/\n      for (j = 0; j <= 255; j++) {\n         if (j != ss) {\n            sb = (ss << 8) + j;\n            if ( ! (ftab[sb] & SETMASK) ) {\n               Int32 lo = ftab[sb]   & CLEARMASK;\n               Int32 hi = (ftab[sb+1] & CLEARMASK) - 1;\n               if (hi > lo) {\n                  if (verb >= 4)\n                     VPrintf4 ( \"        qsort [0x%x, 0x%x]   \"\n                                \"done %d   this %d\\n\",\n                                ss, j, numQSorted, hi - lo + 1 );\n                  mainQSort3 ( \n                     ptr, block, quadrant, nblock, \n                     lo, hi, BZ_N_RADIX, budget \n                  );   \n                  numQSorted += (hi - lo + 1);\n                  if (*budget < 0) return;\n               }\n            }\n            ftab[sb] |= SETMASK;\n         }\n      }\n\n      AssertH ( !bigDone[ss], 1006 );\n\n      /*--\n         Step 2:\n         Now scan this big bucket [ss] so as to synthesise the\n         sorted order for small buckets [t, ss] for all t,\n         including, magically, the bucket [ss,ss] too.\n         This will avoid doing Real Work in subsequent Step 1's.\n      --*/\n      {\n         for (j = 0; j <= 255; j++) {\n            copyStart[j] =  ftab[(j << 8) + ss]     & CLEARMASK;\n            copyEnd  [j] = (ftab[(j << 8) + ss + 1] & CLEARMASK) - 1;\n         }\n         for (j = ftab[ss << 8] & CLEARMASK; j < copyStart[ss]; j++) {\n            k = ptr[j]-1; if (k < 0) k += nblock;\n            c1 = block[k];\n            if (!bigDone[c1])\n               ptr[ copyStart[c1]++ ] = k;\n         }\n         for (j = (ftab[(ss+1) << 8] & CLEARMASK) - 1; j > copyEnd[ss]; j--) {\n            k = ptr[j]-1; if (k < 0) k += nblock;\n            c1 = block[k];\n            if (!bigDone[c1]) \n               ptr[ copyEnd[c1]-- ] = k;\n         }\n      }\n\n      AssertH ( (copyStart[ss]-1 == copyEnd[ss])\n                || \n                /* Extremely rare case missing in bzip2-1.0.0 and 1.0.1.\n                   Necessity for this case is demonstrated by compressing \n                   a sequence of approximately 48.5 million of character \n                   251; 1.0.0/1.0.1 will then die here. */\n                (copyStart[ss] == 0 && copyEnd[ss] == nblock-1),\n                1007 )\n\n      for (j = 0; j <= 255; j++) ftab[(j << 8) + ss] |= SETMASK;\n\n      /*--\n         Step 3:\n         The [ss] big bucket is now done.  Record this fact,\n         and update the quadrant descriptors.  Remember to\n         update quadrants in the overshoot area too, if\n         necessary.  The \"if (i < 255)\" test merely skips\n         this updating for the last bucket processed, since\n         updating for the last bucket is pointless.\n\n         The quadrant array provides a way to incrementally\n         cache sort orderings, as they appear, so as to \n         make subsequent comparisons in fullGtU() complete\n         faster.  For repetitive blocks this makes a big\n         difference (but not big enough to be able to avoid\n         the fallback sorting mechanism, exponential radix sort).\n\n         The precise meaning is: at all times:\n\n            for 0 <= i < nblock and 0 <= j <= nblock\n\n            if block[i] != block[j], \n\n               then the relative values of quadrant[i] and \n                    quadrant[j] are meaningless.\n\n               else {\n                  if quadrant[i] < quadrant[j]\n                     then the string starting at i lexicographically\n                     precedes the string starting at j\n\n                  else if quadrant[i] > quadrant[j]\n                     then the string starting at j lexicographically\n                     precedes the string starting at i\n\n                  else\n                     the relative ordering of the strings starting\n                     at i and j has not yet been determined.\n               }\n      --*/\n      bigDone[ss] = True;\n\n      if (i < 255) {\n         Int32 bbStart  = ftab[ss << 8] & CLEARMASK;\n         Int32 bbSize   = (ftab[(ss+1) << 8] & CLEARMASK) - bbStart;\n         Int32 shifts   = 0;\n\n         while ((bbSize >> shifts) > 65534) shifts++;\n\n         for (j = bbSize-1; j >= 0; j--) {\n            Int32 a2update     = ptr[bbStart + j];\n            UInt16 qVal        = (UInt16)(j >> shifts);\n            quadrant[a2update] = qVal;\n            if (a2update < BZ_N_OVERSHOOT)\n               quadrant[a2update + nblock] = qVal;\n         }\n         AssertH ( ((bbSize-1) >> shifts) <= 65535, 1002 );\n      }\n\n   }\n\n   if (verb >= 4)\n      VPrintf3 ( \"        %d pointers, %d sorted, %d scanned\\n\",\n                 nblock, numQSorted, nblock - numQSorted );\n}\n\n#undef BIGFREQ\n#undef SETMASK\n#undef CLEARMASK\n\n\n/*---------------------------------------------*/\n/* Pre:\n      nblock > 0\n      arr2 exists for [0 .. nblock-1 +N_OVERSHOOT]\n      ((UChar*)arr2)  [0 .. nblock-1] holds block\n      arr1 exists for [0 .. nblock-1]\n\n   Post:\n      ((UChar*)arr2) [0 .. nblock-1] holds block\n      All other areas of block destroyed\n      ftab [ 0 .. 65536 ] destroyed\n      arr1 [0 .. nblock-1] holds sorted order\n*/\nvoid BZ2_blockSort ( EState* s )\n{\n   UInt32* ptr    = s->ptr; \n   UChar*  block  = s->block;\n   UInt32* ftab   = s->ftab;\n   Int32   nblock = s->nblock;\n   Int32   verb   = s->verbosity;\n   Int32   wfact  = s->workFactor;\n   UInt16* quadrant;\n   Int32   budget;\n   Int32   budgetInit;\n   Int32   i;\n\n   if (nblock < 10000) {\n      fallbackSort ( s->arr1, s->arr2, ftab, nblock, verb );\n   } else {\n      /* Calculate the location for quadrant, remembering to get\n         the alignment right.  Assumes that &(block[0]) is at least\n         2-byte aligned -- this should be ok since block is really\n         the first section of arr2.\n      */\n      i = nblock+BZ_N_OVERSHOOT;\n      if (i & 1) i++;\n      quadrant = (UInt16*)(&(block[i]));\n\n      /* (wfact-1) / 3 puts the default-factor-30\n         transition point at very roughly the same place as \n         with v0.1 and v0.9.0.  \n         Not that it particularly matters any more, since the\n         resulting compressed stream is now the same regardless\n         of whether or not we use the main sort or fallback sort.\n      */\n      if (wfact < 1  ) wfact = 1;\n      if (wfact > 100) wfact = 100;\n      budgetInit = nblock * ((wfact-1) / 3);\n      budget = budgetInit;\n\n      mainSort ( ptr, block, quadrant, ftab, nblock, verb, &budget );\n      if (verb >= 3) \n         VPrintf3 ( \"      %d work, %d block, ratio %5.2f\\n\",\n                    budgetInit - budget,\n                    nblock, \n                    (float)(budgetInit - budget) /\n                    (float)(nblock==0 ? 1 : nblock) ); \n      if (budget < 0) {\n         if (verb >= 2) \n            VPrintf0 ( \"    too repetitive; using fallback\"\n                       \" sorting algorithm\\n\" );\n         fallbackSort ( s->arr1, s->arr2, ftab, nblock, verb );\n      }\n   }\n\n   s->origPtr = -1;\n   for (i = 0; i < s->nblock; i++)\n      if (ptr[i] == 0)\n         { s->origPtr = i; break; };\n\n   AssertH( s->origPtr != -1, 1003 );\n}\n\n\n/*-------------------------------------------------------------*/\n/*--- end                                       blocksort.c ---*/\n/*-------------------------------------------------------------*/\n"
  },
  {
    "path": "ext/bzip2/bz_internal_error.c",
    "content": "/* Use when compiling with BZ_NO_STDIO */\n\n#include <assert.h>\n\nvoid bz_internal_error(int errcode)\n{\n\tassert(0);\n}\n"
  },
  {
    "path": "ext/bzip2/bzip_all.c",
    "content": "#include \"blocksort.c\"\r\n#include \"bzlib.c\"\r\n#include \"compress.c\"\r\n#include \"crctable.c\"\r\n#include \"decompress.c\"\r\n#include \"huffman.c\"\r\n#include \"randtable.c\"\r\n#include \"bz_internal_error.c\"\r\n"
  },
  {
    "path": "ext/bzip2/bzlib.c",
    "content": "\n/*-------------------------------------------------------------*/\n/*--- Library top-level functions.                          ---*/\n/*---                                               bzlib.c ---*/\n/*-------------------------------------------------------------*/\n\n/* ------------------------------------------------------------------\n   This file is part of bzip2/libbzip2, a program and library for\n   lossless, block-sorting data compression.\n\n   bzip2/libbzip2 version 1.0.6 of 6 September 2010\n   Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>\n\n   Please read the WARNING, DISCLAIMER and PATENTS sections in the \n   README file.\n\n   This program is released under the terms of the license contained\n   in the file LICENSE.\n   ------------------------------------------------------------------ */\n\n/* CHANGES\n   0.9.0    -- original version.\n   0.9.0a/b -- no changes in this file.\n   0.9.0c   -- made zero-length BZ_FLUSH work correctly in bzCompress().\n     fixed bzWrite/bzRead to ignore zero-length requests.\n     fixed bzread to correctly handle read requests after EOF.\n     wrong parameter order in call to bzDecompressInit in\n     bzBuffToBuffDecompress.  Fixed.\n*/\n\n#include \"bzlib_private.h\"\n\n\n/*---------------------------------------------------*/\n/*--- Compression stuff                           ---*/\n/*---------------------------------------------------*/\n\n\n/*---------------------------------------------------*/\n#ifndef BZ_NO_STDIO\nvoid BZ2_bz__AssertH__fail ( int errcode )\n{\n   fprintf(stderr, \n      \"\\n\\nbzip2/libbzip2: internal error number %d.\\n\"\n      \"This is a bug in bzip2/libbzip2, %s.\\n\"\n      \"Please report it to me at: jseward@bzip.org.  If this happened\\n\"\n      \"when you were using some program which uses libbzip2 as a\\n\"\n      \"component, you should also report this bug to the author(s)\\n\"\n      \"of that program.  Please make an effort to report this bug;\\n\"\n      \"timely and accurate bug reports eventually lead to higher\\n\"\n      \"quality software.  Thanks.  Julian Seward, 10 December 2007.\\n\\n\",\n      errcode,\n      BZ2_bzlibVersion()\n   );\n\n   if (errcode == 1007) {\n   fprintf(stderr,\n      \"\\n*** A special note about internal error number 1007 ***\\n\"\n      \"\\n\"\n      \"Experience suggests that a common cause of i.e. 1007\\n\"\n      \"is unreliable memory or other hardware.  The 1007 assertion\\n\"\n      \"just happens to cross-check the results of huge numbers of\\n\"\n      \"memory reads/writes, and so acts (unintendedly) as a stress\\n\"\n      \"test of your memory system.\\n\"\n      \"\\n\"\n      \"I suggest the following: try compressing the file again,\\n\"\n      \"possibly monitoring progress in detail with the -vv flag.\\n\"\n      \"\\n\"\n      \"* If the error cannot be reproduced, and/or happens at different\\n\"\n      \"  points in compression, you may have a flaky memory system.\\n\"\n      \"  Try a memory-test program.  I have used Memtest86\\n\"\n      \"  (www.memtest86.com).  At the time of writing it is free (GPLd).\\n\"\n      \"  Memtest86 tests memory much more thorougly than your BIOSs\\n\"\n      \"  power-on test, and may find failures that the BIOS doesn't.\\n\"\n      \"\\n\"\n      \"* If the error can be repeatably reproduced, this is a bug in\\n\"\n      \"  bzip2, and I would very much like to hear about it.  Please\\n\"\n      \"  let me know, and, ideally, save a copy of the file causing the\\n\"\n      \"  problem -- without which I will be unable to investigate it.\\n\"\n      \"\\n\"\n   );\n   }\n\n   exit(3);\n}\n#endif\n\n\n/*---------------------------------------------------*/\nstatic\nint bz_config_ok ( void )\n{\n   if (sizeof(int)   != 4) return 0;\n   if (sizeof(short) != 2) return 0;\n   if (sizeof(char)  != 1) return 0;\n   return 1;\n}\n\n\n/*---------------------------------------------------*/\nstatic\nvoid* default_bzalloc ( void* opaque, Int32 items, Int32 size )\n{\n   void* v = malloc ( items * size );\n   return v;\n}\n\nstatic\nvoid default_bzfree ( void* opaque, void* addr )\n{\n   if (addr != NULL) free ( addr );\n}\n\n\n/*---------------------------------------------------*/\nstatic\nvoid prepare_new_block ( EState* s )\n{\n   Int32 i;\n   s->nblock = 0;\n   s->numZ = 0;\n   s->state_out_pos = 0;\n   BZ_INITIALISE_CRC ( s->blockCRC );\n   for (i = 0; i < 256; i++) s->inUse[i] = False;\n   s->blockNo++;\n}\n\n\n/*---------------------------------------------------*/\nstatic\nvoid init_RL ( EState* s )\n{\n   s->state_in_ch  = 256;\n   s->state_in_len = 0;\n}\n\n\nstatic\nBool isempty_RL ( EState* s )\n{\n   if (s->state_in_ch < 256 && s->state_in_len > 0)\n      return False; else\n      return True;\n}\n\n\n/*---------------------------------------------------*/\nint BZ_API(BZ2_bzCompressInit) \n                    ( bz_stream* strm, \n                     int        blockSize100k,\n                     int        verbosity,\n                     int        workFactor )\n{\n   Int32   n;\n   EState* s;\n\n   if (!bz_config_ok()) return BZ_CONFIG_ERROR;\n\n   if (strm == NULL || \n       blockSize100k < 1 || blockSize100k > 9 ||\n       workFactor < 0 || workFactor > 250)\n     return BZ_PARAM_ERROR;\n\n   if (workFactor == 0) workFactor = 30;\n   if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc;\n   if (strm->bzfree == NULL) strm->bzfree = default_bzfree;\n\n   s = BZALLOC( sizeof(EState) );\n   if (s == NULL) return BZ_MEM_ERROR;\n   s->strm = strm;\n\n   s->arr1 = NULL;\n   s->arr2 = NULL;\n   s->ftab = NULL;\n\n   n       = 100000 * blockSize100k;\n   s->arr1 = BZALLOC( n                  * sizeof(UInt32) );\n   s->arr2 = BZALLOC( (n+BZ_N_OVERSHOOT) * sizeof(UInt32) );\n   s->ftab = BZALLOC( 65537              * sizeof(UInt32) );\n\n   if (s->arr1 == NULL || s->arr2 == NULL || s->ftab == NULL) {\n      if (s->arr1 != NULL) BZFREE(s->arr1);\n      if (s->arr2 != NULL) BZFREE(s->arr2);\n      if (s->ftab != NULL) BZFREE(s->ftab);\n      if (s       != NULL) BZFREE(s);\n      return BZ_MEM_ERROR;\n   }\n\n   s->blockNo           = 0;\n   s->state             = BZ_S_INPUT;\n   s->mode              = BZ_M_RUNNING;\n   s->combinedCRC       = 0;\n   s->blockSize100k     = blockSize100k;\n   s->nblockMAX         = 100000 * blockSize100k - 19;\n   s->verbosity         = verbosity;\n   s->workFactor        = workFactor;\n\n   s->block             = (UChar*)s->arr2;\n   s->mtfv              = (UInt16*)s->arr1;\n   s->zbits             = NULL;\n   s->ptr               = (UInt32*)s->arr1;\n\n   strm->state          = s;\n   strm->total_in_lo32  = 0;\n   strm->total_in_hi32  = 0;\n   strm->total_out_lo32 = 0;\n   strm->total_out_hi32 = 0;\n   init_RL ( s );\n   prepare_new_block ( s );\n   return BZ_OK;\n}\n\n\n/*---------------------------------------------------*/\nstatic\nvoid add_pair_to_block ( EState* s )\n{\n   Int32 i;\n   UChar ch = (UChar)(s->state_in_ch);\n   for (i = 0; i < s->state_in_len; i++) {\n      BZ_UPDATE_CRC( s->blockCRC, ch );\n   }\n   s->inUse[s->state_in_ch] = True;\n   switch (s->state_in_len) {\n      case 1:\n         s->block[s->nblock] = (UChar)ch; s->nblock++;\n         break;\n      case 2:\n         s->block[s->nblock] = (UChar)ch; s->nblock++;\n         s->block[s->nblock] = (UChar)ch; s->nblock++;\n         break;\n      case 3:\n         s->block[s->nblock] = (UChar)ch; s->nblock++;\n         s->block[s->nblock] = (UChar)ch; s->nblock++;\n         s->block[s->nblock] = (UChar)ch; s->nblock++;\n         break;\n      default:\n         s->inUse[s->state_in_len-4] = True;\n         s->block[s->nblock] = (UChar)ch; s->nblock++;\n         s->block[s->nblock] = (UChar)ch; s->nblock++;\n         s->block[s->nblock] = (UChar)ch; s->nblock++;\n         s->block[s->nblock] = (UChar)ch; s->nblock++;\n         s->block[s->nblock] = ((UChar)(s->state_in_len-4));\n         s->nblock++;\n         break;\n   }\n}\n\n\n/*---------------------------------------------------*/\nstatic\nvoid flush_RL ( EState* s )\n{\n   if (s->state_in_ch < 256) add_pair_to_block ( s );\n   init_RL ( s );\n}\n\n\n/*---------------------------------------------------*/\n#define ADD_CHAR_TO_BLOCK(zs,zchh0)               \\\n{                                                 \\\n   UInt32 zchh = (UInt32)(zchh0);                 \\\n   /*-- fast track the common case --*/           \\\n   if (zchh != zs->state_in_ch &&                 \\\n       zs->state_in_len == 1) {                   \\\n      UChar ch = (UChar)(zs->state_in_ch);        \\\n      BZ_UPDATE_CRC( zs->blockCRC, ch );          \\\n      zs->inUse[zs->state_in_ch] = True;          \\\n      zs->block[zs->nblock] = (UChar)ch;          \\\n      zs->nblock++;                               \\\n      zs->state_in_ch = zchh;                     \\\n   }                                              \\\n   else                                           \\\n   /*-- general, uncommon cases --*/              \\\n   if (zchh != zs->state_in_ch ||                 \\\n      zs->state_in_len == 255) {                  \\\n      if (zs->state_in_ch < 256)                  \\\n         add_pair_to_block ( zs );                \\\n      zs->state_in_ch = zchh;                     \\\n      zs->state_in_len = 1;                       \\\n   } else {                                       \\\n      zs->state_in_len++;                         \\\n   }                                              \\\n}\n\n\n/*---------------------------------------------------*/\nstatic\nBool copy_input_until_stop ( EState* s )\n{\n   Bool progress_in = False;\n\n   if (s->mode == BZ_M_RUNNING) {\n\n      /*-- fast track the common case --*/\n      while (True) {\n         /*-- block full? --*/\n         if (s->nblock >= s->nblockMAX) break;\n         /*-- no input? --*/\n         if (s->strm->avail_in == 0) break;\n         progress_in = True;\n         ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) ); \n         s->strm->next_in++;\n         s->strm->avail_in--;\n         s->strm->total_in_lo32++;\n         if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++;\n      }\n\n   } else {\n\n      /*-- general, uncommon case --*/\n      while (True) {\n         /*-- block full? --*/\n         if (s->nblock >= s->nblockMAX) break;\n         /*-- no input? --*/\n         if (s->strm->avail_in == 0) break;\n         /*-- flush/finish end? --*/\n         if (s->avail_in_expect == 0) break;\n         progress_in = True;\n         ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) ); \n         s->strm->next_in++;\n         s->strm->avail_in--;\n         s->strm->total_in_lo32++;\n         if (s->strm->total_in_lo32 == 0) s->strm->total_in_hi32++;\n         s->avail_in_expect--;\n      }\n   }\n   return progress_in;\n}\n\n\n/*---------------------------------------------------*/\nstatic\nBool copy_output_until_stop ( EState* s )\n{\n   Bool progress_out = False;\n\n   while (True) {\n\n      /*-- no output space? --*/\n      if (s->strm->avail_out == 0) break;\n\n      /*-- block done? --*/\n      if (s->state_out_pos >= s->numZ) break;\n\n      progress_out = True;\n      *(s->strm->next_out) = s->zbits[s->state_out_pos];\n      s->state_out_pos++;\n      s->strm->avail_out--;\n      s->strm->next_out++;\n      s->strm->total_out_lo32++;\n      if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;\n   }\n\n   return progress_out;\n}\n\n\n/*---------------------------------------------------*/\nstatic\nBool handle_compress ( bz_stream* strm )\n{\n   Bool progress_in  = False;\n   Bool progress_out = False;\n   EState* s = strm->state;\n   \n   while (True) {\n\n      if (s->state == BZ_S_OUTPUT) {\n         progress_out |= copy_output_until_stop ( s );\n         if (s->state_out_pos < s->numZ) break;\n         if (s->mode == BZ_M_FINISHING && \n             s->avail_in_expect == 0 &&\n             isempty_RL(s)) break;\n         prepare_new_block ( s );\n         s->state = BZ_S_INPUT;\n         if (s->mode == BZ_M_FLUSHING && \n             s->avail_in_expect == 0 &&\n             isempty_RL(s)) break;\n      }\n\n      if (s->state == BZ_S_INPUT) {\n         progress_in |= copy_input_until_stop ( s );\n         if (s->mode != BZ_M_RUNNING && s->avail_in_expect == 0) {\n            flush_RL ( s );\n            BZ2_compressBlock ( s, (Bool)(s->mode == BZ_M_FINISHING) );\n            s->state = BZ_S_OUTPUT;\n         }\n         else\n         if (s->nblock >= s->nblockMAX) {\n            BZ2_compressBlock ( s, False );\n            s->state = BZ_S_OUTPUT;\n         }\n         else\n         if (s->strm->avail_in == 0) {\n            break;\n         }\n      }\n\n   }\n\n   return progress_in || progress_out;\n}\n\n\n/*---------------------------------------------------*/\nint BZ_API(BZ2_bzCompress) ( bz_stream *strm, int action )\n{\n   Bool progress;\n   EState* s;\n   if (strm == NULL) return BZ_PARAM_ERROR;\n   s = strm->state;\n   if (s == NULL) return BZ_PARAM_ERROR;\n   if (s->strm != strm) return BZ_PARAM_ERROR;\n\n   preswitch:\n   switch (s->mode) {\n\n      case BZ_M_IDLE:\n         return BZ_SEQUENCE_ERROR;\n\n      case BZ_M_RUNNING:\n         if (action == BZ_RUN) {\n            progress = handle_compress ( strm );\n            return progress ? BZ_RUN_OK : BZ_PARAM_ERROR;\n         } \n         else\n\t if (action == BZ_FLUSH) {\n            s->avail_in_expect = strm->avail_in;\n            s->mode = BZ_M_FLUSHING;\n            goto preswitch;\n         }\n         else\n         if (action == BZ_FINISH) {\n            s->avail_in_expect = strm->avail_in;\n            s->mode = BZ_M_FINISHING;\n            goto preswitch;\n         }\n         else \n            return BZ_PARAM_ERROR;\n\n      case BZ_M_FLUSHING:\n         if (action != BZ_FLUSH) return BZ_SEQUENCE_ERROR;\n         if (s->avail_in_expect != s->strm->avail_in) \n            return BZ_SEQUENCE_ERROR;\n         progress = handle_compress ( strm );\n         if (s->avail_in_expect > 0 || !isempty_RL(s) ||\n             s->state_out_pos < s->numZ) return BZ_FLUSH_OK;\n         s->mode = BZ_M_RUNNING;\n         return BZ_RUN_OK;\n\n      case BZ_M_FINISHING:\n         if (action != BZ_FINISH) return BZ_SEQUENCE_ERROR;\n         if (s->avail_in_expect != s->strm->avail_in) \n            return BZ_SEQUENCE_ERROR;\n         progress = handle_compress ( strm );\n         if (!progress) return BZ_SEQUENCE_ERROR;\n         if (s->avail_in_expect > 0 || !isempty_RL(s) ||\n             s->state_out_pos < s->numZ) return BZ_FINISH_OK;\n         s->mode = BZ_M_IDLE;\n         return BZ_STREAM_END;\n   }\n   return BZ_OK; /*--not reached--*/\n}\n\n\n/*---------------------------------------------------*/\nint BZ_API(BZ2_bzCompressEnd)  ( bz_stream *strm )\n{\n   EState* s;\n   if (strm == NULL) return BZ_PARAM_ERROR;\n   s = strm->state;\n   if (s == NULL) return BZ_PARAM_ERROR;\n   if (s->strm != strm) return BZ_PARAM_ERROR;\n\n   if (s->arr1 != NULL) BZFREE(s->arr1);\n   if (s->arr2 != NULL) BZFREE(s->arr2);\n   if (s->ftab != NULL) BZFREE(s->ftab);\n   BZFREE(strm->state);\n\n   strm->state = NULL;   \n\n   return BZ_OK;\n}\n\n\n/*---------------------------------------------------*/\n/*--- Decompression stuff                         ---*/\n/*---------------------------------------------------*/\n\n/*---------------------------------------------------*/\nint BZ_API(BZ2_bzDecompressInit) \n                     ( bz_stream* strm, \n                       int        verbosity,\n                       int        small )\n{\n   DState* s;\n\n   if (!bz_config_ok()) return BZ_CONFIG_ERROR;\n\n   if (strm == NULL) return BZ_PARAM_ERROR;\n   if (small != 0 && small != 1) return BZ_PARAM_ERROR;\n   if (verbosity < 0 || verbosity > 4) return BZ_PARAM_ERROR;\n\n   if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc;\n   if (strm->bzfree == NULL) strm->bzfree = default_bzfree;\n\n   s = BZALLOC( sizeof(DState) );\n   if (s == NULL) return BZ_MEM_ERROR;\n   s->strm                  = strm;\n   strm->state              = s;\n   s->state                 = BZ_X_MAGIC_1;\n   s->bsLive                = 0;\n   s->bsBuff                = 0;\n   s->calculatedCombinedCRC = 0;\n   strm->total_in_lo32      = 0;\n   strm->total_in_hi32      = 0;\n   strm->total_out_lo32     = 0;\n   strm->total_out_hi32     = 0;\n   s->smallDecompress       = (Bool)small;\n   s->ll4                   = NULL;\n   s->ll16                  = NULL;\n   s->tt                    = NULL;\n   s->currBlockNo           = 0;\n   s->verbosity             = verbosity;\n\n   return BZ_OK;\n}\n\n\n/*---------------------------------------------------*/\n/* Return  True iff data corruption is discovered.\n   Returns False if there is no problem.\n*/\nstatic\nBool unRLE_obuf_to_output_FAST ( DState* s )\n{\n   UChar k1;\n\n   if (s->blockRandomised) {\n\n      while (True) {\n         /* try to finish existing run */\n         while (True) {\n            if (s->strm->avail_out == 0) return False;\n            if (s->state_out_len == 0) break;\n            *( (UChar*)(s->strm->next_out) ) = s->state_out_ch;\n            BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch );\n            s->state_out_len--;\n            s->strm->next_out++;\n            s->strm->avail_out--;\n            s->strm->total_out_lo32++;\n            if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;\n         }\n\n         /* can a new run be started? */\n         if (s->nblock_used == s->save_nblock+1) return False;\n               \n         /* Only caused by corrupt data stream? */\n         if (s->nblock_used > s->save_nblock+1)\n            return True;\n   \n         s->state_out_len = 1;\n         s->state_out_ch = s->k0;\n         BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; \n         k1 ^= BZ_RAND_MASK; s->nblock_used++;\n         if (s->nblock_used == s->save_nblock+1) continue;\n         if (k1 != s->k0) { s->k0 = k1; continue; };\n   \n         s->state_out_len = 2;\n         BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; \n         k1 ^= BZ_RAND_MASK; s->nblock_used++;\n         if (s->nblock_used == s->save_nblock+1) continue;\n         if (k1 != s->k0) { s->k0 = k1; continue; };\n   \n         s->state_out_len = 3;\n         BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; \n         k1 ^= BZ_RAND_MASK; s->nblock_used++;\n         if (s->nblock_used == s->save_nblock+1) continue;\n         if (k1 != s->k0) { s->k0 = k1; continue; };\n   \n         BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; \n         k1 ^= BZ_RAND_MASK; s->nblock_used++;\n         s->state_out_len = ((Int32)k1) + 4;\n         BZ_GET_FAST(s->k0); BZ_RAND_UPD_MASK; \n         s->k0 ^= BZ_RAND_MASK; s->nblock_used++;\n      }\n\n   } else {\n\n      /* restore */\n      UInt32        c_calculatedBlockCRC = s->calculatedBlockCRC;\n      UChar         c_state_out_ch       = s->state_out_ch;\n      Int32         c_state_out_len      = s->state_out_len;\n      Int32         c_nblock_used        = s->nblock_used;\n      Int32         c_k0                 = s->k0;\n      UInt32*       c_tt                 = s->tt;\n      UInt32        c_tPos               = s->tPos;\n      char*         cs_next_out          = s->strm->next_out;\n      unsigned int  cs_avail_out         = s->strm->avail_out;\n      Int32         ro_blockSize100k     = s->blockSize100k;\n      /* end restore */\n\n      UInt32       avail_out_INIT = cs_avail_out;\n      Int32        s_save_nblockPP = s->save_nblock+1;\n      unsigned int total_out_lo32_old;\n\n      while (True) {\n\n         /* try to finish existing run */\n         if (c_state_out_len > 0) {\n            while (True) {\n               if (cs_avail_out == 0) goto return_notr;\n               if (c_state_out_len == 1) break;\n               *( (UChar*)(cs_next_out) ) = c_state_out_ch;\n               BZ_UPDATE_CRC ( c_calculatedBlockCRC, c_state_out_ch );\n               c_state_out_len--;\n               cs_next_out++;\n               cs_avail_out--;\n            }\n            s_state_out_len_eq_one:\n            {\n               if (cs_avail_out == 0) { \n                  c_state_out_len = 1; goto return_notr;\n               };\n               *( (UChar*)(cs_next_out) ) = c_state_out_ch;\n               BZ_UPDATE_CRC ( c_calculatedBlockCRC, c_state_out_ch );\n               cs_next_out++;\n               cs_avail_out--;\n            }\n         }   \n         /* Only caused by corrupt data stream? */\n         if (c_nblock_used > s_save_nblockPP)\n            return True;\n\n         /* can a new run be started? */\n         if (c_nblock_used == s_save_nblockPP) {\n            c_state_out_len = 0; goto return_notr;\n         };   \n         c_state_out_ch = c_k0;\n         BZ_GET_FAST_C(k1); c_nblock_used++;\n         if (k1 != c_k0) { \n            c_k0 = k1; goto s_state_out_len_eq_one; \n         };\n         if (c_nblock_used == s_save_nblockPP) \n            goto s_state_out_len_eq_one;\n   \n         c_state_out_len = 2;\n         BZ_GET_FAST_C(k1); c_nblock_used++;\n         if (c_nblock_used == s_save_nblockPP) continue;\n         if (k1 != c_k0) { c_k0 = k1; continue; };\n   \n         c_state_out_len = 3;\n         BZ_GET_FAST_C(k1); c_nblock_used++;\n         if (c_nblock_used == s_save_nblockPP) continue;\n         if (k1 != c_k0) { c_k0 = k1; continue; };\n   \n         BZ_GET_FAST_C(k1); c_nblock_used++;\n         c_state_out_len = ((Int32)k1) + 4;\n         BZ_GET_FAST_C(c_k0); c_nblock_used++;\n      }\n\n      return_notr:\n      total_out_lo32_old = s->strm->total_out_lo32;\n      s->strm->total_out_lo32 += (avail_out_INIT - cs_avail_out);\n      if (s->strm->total_out_lo32 < total_out_lo32_old)\n         s->strm->total_out_hi32++;\n\n      /* save */\n      s->calculatedBlockCRC = c_calculatedBlockCRC;\n      s->state_out_ch       = c_state_out_ch;\n      s->state_out_len      = c_state_out_len;\n      s->nblock_used        = c_nblock_used;\n      s->k0                 = c_k0;\n      s->tt                 = c_tt;\n      s->tPos               = c_tPos;\n      s->strm->next_out     = cs_next_out;\n      s->strm->avail_out    = cs_avail_out;\n      /* end save */\n   }\n   return False;\n}\n\n\n\n/*---------------------------------------------------*/\n__inline__ Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab )\n{\n   Int32 nb, na, mid;\n   nb = 0;\n   na = 256;\n   do {\n      mid = (nb + na) >> 1;\n      if (indx >= cftab[mid]) nb = mid; else na = mid;\n   }\n   while (na - nb != 1);\n   return nb;\n}\n\n\n/*---------------------------------------------------*/\n/* Return  True iff data corruption is discovered.\n   Returns False if there is no problem.\n*/\nstatic\nBool unRLE_obuf_to_output_SMALL ( DState* s )\n{\n   UChar k1;\n\n   if (s->blockRandomised) {\n\n      while (True) {\n         /* try to finish existing run */\n         while (True) {\n            if (s->strm->avail_out == 0) return False;\n            if (s->state_out_len == 0) break;\n            *( (UChar*)(s->strm->next_out) ) = s->state_out_ch;\n            BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch );\n            s->state_out_len--;\n            s->strm->next_out++;\n            s->strm->avail_out--;\n            s->strm->total_out_lo32++;\n            if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;\n         }\n   \n         /* can a new run be started? */\n         if (s->nblock_used == s->save_nblock+1) return False;\n\n         /* Only caused by corrupt data stream? */\n         if (s->nblock_used > s->save_nblock+1)\n            return True;\n   \n         s->state_out_len = 1;\n         s->state_out_ch = s->k0;\n         BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; \n         k1 ^= BZ_RAND_MASK; s->nblock_used++;\n         if (s->nblock_used == s->save_nblock+1) continue;\n         if (k1 != s->k0) { s->k0 = k1; continue; };\n   \n         s->state_out_len = 2;\n         BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; \n         k1 ^= BZ_RAND_MASK; s->nblock_used++;\n         if (s->nblock_used == s->save_nblock+1) continue;\n         if (k1 != s->k0) { s->k0 = k1; continue; };\n   \n         s->state_out_len = 3;\n         BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; \n         k1 ^= BZ_RAND_MASK; s->nblock_used++;\n         if (s->nblock_used == s->save_nblock+1) continue;\n         if (k1 != s->k0) { s->k0 = k1; continue; };\n   \n         BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; \n         k1 ^= BZ_RAND_MASK; s->nblock_used++;\n         s->state_out_len = ((Int32)k1) + 4;\n         BZ_GET_SMALL(s->k0); BZ_RAND_UPD_MASK; \n         s->k0 ^= BZ_RAND_MASK; s->nblock_used++;\n      }\n\n   } else {\n\n      while (True) {\n         /* try to finish existing run */\n         while (True) {\n            if (s->strm->avail_out == 0) return False;\n            if (s->state_out_len == 0) break;\n            *( (UChar*)(s->strm->next_out) ) = s->state_out_ch;\n            BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch );\n            s->state_out_len--;\n            s->strm->next_out++;\n            s->strm->avail_out--;\n            s->strm->total_out_lo32++;\n            if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++;\n         }\n   \n         /* can a new run be started? */\n         if (s->nblock_used == s->save_nblock+1) return False;\n\n         /* Only caused by corrupt data stream? */\n         if (s->nblock_used > s->save_nblock+1)\n            return True;\n   \n         s->state_out_len = 1;\n         s->state_out_ch = s->k0;\n         BZ_GET_SMALL(k1); s->nblock_used++;\n         if (s->nblock_used == s->save_nblock+1) continue;\n         if (k1 != s->k0) { s->k0 = k1; continue; };\n   \n         s->state_out_len = 2;\n         BZ_GET_SMALL(k1); s->nblock_used++;\n         if (s->nblock_used == s->save_nblock+1) continue;\n         if (k1 != s->k0) { s->k0 = k1; continue; };\n   \n         s->state_out_len = 3;\n         BZ_GET_SMALL(k1); s->nblock_used++;\n         if (s->nblock_used == s->save_nblock+1) continue;\n         if (k1 != s->k0) { s->k0 = k1; continue; };\n   \n         BZ_GET_SMALL(k1); s->nblock_used++;\n         s->state_out_len = ((Int32)k1) + 4;\n         BZ_GET_SMALL(s->k0); s->nblock_used++;\n      }\n\n   }\n}\n\n\n/*---------------------------------------------------*/\nint BZ_API(BZ2_bzDecompress) ( bz_stream *strm )\n{\n   Bool    corrupt;\n   DState* s;\n   if (strm == NULL) return BZ_PARAM_ERROR;\n   s = strm->state;\n   if (s == NULL) return BZ_PARAM_ERROR;\n   if (s->strm != strm) return BZ_PARAM_ERROR;\n\n   while (True) {\n      if (s->state == BZ_X_IDLE) return BZ_SEQUENCE_ERROR;\n      if (s->state == BZ_X_OUTPUT) {\n         if (s->smallDecompress)\n            corrupt = unRLE_obuf_to_output_SMALL ( s ); else\n            corrupt = unRLE_obuf_to_output_FAST  ( s );\n         if (corrupt) return BZ_DATA_ERROR;\n         if (s->nblock_used == s->save_nblock+1 && s->state_out_len == 0) {\n            BZ_FINALISE_CRC ( s->calculatedBlockCRC );\n            if (s->verbosity >= 3) \n               VPrintf2 ( \" {0x%08x, 0x%08x}\", s->storedBlockCRC, \n                          s->calculatedBlockCRC );\n            if (s->verbosity >= 2) VPrintf0 ( \"]\" );\n            if (s->calculatedBlockCRC != s->storedBlockCRC)\n               return BZ_DATA_ERROR;\n            s->calculatedCombinedCRC \n               = (s->calculatedCombinedCRC << 1) | \n                    (s->calculatedCombinedCRC >> 31);\n            s->calculatedCombinedCRC ^= s->calculatedBlockCRC;\n            s->state = BZ_X_BLKHDR_1;\n         } else {\n            return BZ_OK;\n         }\n      }\n      if (s->state >= BZ_X_MAGIC_1) {\n         Int32 r = BZ2_decompress ( s );\n         if (r == BZ_STREAM_END) {\n            if (s->verbosity >= 3)\n               VPrintf2 ( \"\\n    combined CRCs: stored = 0x%08x, computed = 0x%08x\", \n                          s->storedCombinedCRC, s->calculatedCombinedCRC );\n            if (s->calculatedCombinedCRC != s->storedCombinedCRC)\n               return BZ_DATA_ERROR;\n            return r;\n         }\n         if (s->state != BZ_X_OUTPUT) return r;\n      }\n   }\n\n   AssertH ( 0, 6001 );\n\n   return 0;  /*NOTREACHED*/\n}\n\n\n/*---------------------------------------------------*/\nint BZ_API(BZ2_bzDecompressEnd)  ( bz_stream *strm )\n{\n   DState* s;\n   if (strm == NULL) return BZ_PARAM_ERROR;\n   s = strm->state;\n   if (s == NULL) return BZ_PARAM_ERROR;\n   if (s->strm != strm) return BZ_PARAM_ERROR;\n\n   if (s->tt   != NULL) BZFREE(s->tt);\n   if (s->ll16 != NULL) BZFREE(s->ll16);\n   if (s->ll4  != NULL) BZFREE(s->ll4);\n\n   BZFREE(strm->state);\n   strm->state = NULL;\n\n   return BZ_OK;\n}\n\n\n#ifndef BZ_NO_STDIO\n/*---------------------------------------------------*/\n/*--- File I/O stuff                              ---*/\n/*---------------------------------------------------*/\n\n#define BZ_SETERR(eee)                    \\\n{                                         \\\n   if (bzerror != NULL) *bzerror = eee;   \\\n   if (bzf != NULL) bzf->lastErr = eee;   \\\n}\n\ntypedef \n   struct {\n      FILE*     handle;\n      Char      buf[BZ_MAX_UNUSED];\n      Int32     bufN;\n      Bool      writing;\n      bz_stream strm;\n      Int32     lastErr;\n      Bool      initialisedOk;\n   }\n   bzFile;\n\n\n/*---------------------------------------------*/\nstatic Bool myfeof ( FILE* f )\n{\n   Int32 c = fgetc ( f );\n   if (c == EOF) return True;\n   ungetc ( c, f );\n   return False;\n}\n\n\n/*---------------------------------------------------*/\nBZFILE* BZ_API(BZ2_bzWriteOpen) \n                    ( int*  bzerror,      \n                      FILE* f, \n                      int   blockSize100k, \n                      int   verbosity,\n                      int   workFactor )\n{\n   Int32   ret;\n   bzFile* bzf = NULL;\n\n   BZ_SETERR(BZ_OK);\n\n   if (f == NULL ||\n       (blockSize100k < 1 || blockSize100k > 9) ||\n       (workFactor < 0 || workFactor > 250) ||\n       (verbosity < 0 || verbosity > 4))\n      { BZ_SETERR(BZ_PARAM_ERROR); return NULL; };\n\n   if (ferror(f))\n      { BZ_SETERR(BZ_IO_ERROR); return NULL; };\n\n   bzf = malloc ( sizeof(bzFile) );\n   if (bzf == NULL)\n      { BZ_SETERR(BZ_MEM_ERROR); return NULL; };\n\n   BZ_SETERR(BZ_OK);\n   bzf->initialisedOk = False;\n   bzf->bufN          = 0;\n   bzf->handle        = f;\n   bzf->writing       = True;\n   bzf->strm.bzalloc  = NULL;\n   bzf->strm.bzfree   = NULL;\n   bzf->strm.opaque   = NULL;\n\n   if (workFactor == 0) workFactor = 30;\n   ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k, \n                              verbosity, workFactor );\n   if (ret != BZ_OK)\n      { BZ_SETERR(ret); free(bzf); return NULL; };\n\n   bzf->strm.avail_in = 0;\n   bzf->initialisedOk = True;\n   return bzf;   \n}\n\n\n\n/*---------------------------------------------------*/\nvoid BZ_API(BZ2_bzWrite)\n             ( int*    bzerror, \n               BZFILE* b, \n               void*   buf, \n               int     len )\n{\n   Int32 n, n2, ret;\n   bzFile* bzf = (bzFile*)b;\n\n   BZ_SETERR(BZ_OK);\n   if (bzf == NULL || buf == NULL || len < 0)\n      { BZ_SETERR(BZ_PARAM_ERROR); return; };\n   if (!(bzf->writing))\n      { BZ_SETERR(BZ_SEQUENCE_ERROR); return; };\n   if (ferror(bzf->handle))\n      { BZ_SETERR(BZ_IO_ERROR); return; };\n\n   if (len == 0)\n      { BZ_SETERR(BZ_OK); return; };\n\n   bzf->strm.avail_in = len;\n   bzf->strm.next_in  = buf;\n\n   while (True) {\n      bzf->strm.avail_out = BZ_MAX_UNUSED;\n      bzf->strm.next_out = bzf->buf;\n      ret = BZ2_bzCompress ( &(bzf->strm), BZ_RUN );\n      if (ret != BZ_RUN_OK)\n         { BZ_SETERR(ret); return; };\n\n      if (bzf->strm.avail_out < BZ_MAX_UNUSED) {\n         n = BZ_MAX_UNUSED - bzf->strm.avail_out;\n         n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), \n                       n, bzf->handle );\n         if (n != n2 || ferror(bzf->handle))\n            { BZ_SETERR(BZ_IO_ERROR); return; };\n      }\n\n      if (bzf->strm.avail_in == 0)\n         { BZ_SETERR(BZ_OK); return; };\n   }\n}\n\n\n/*---------------------------------------------------*/\nvoid BZ_API(BZ2_bzWriteClose)\n                  ( int*          bzerror, \n                    BZFILE*       b, \n                    int           abandon,\n                    unsigned int* nbytes_in,\n                    unsigned int* nbytes_out )\n{\n   BZ2_bzWriteClose64 ( bzerror, b, abandon, \n                        nbytes_in, NULL, nbytes_out, NULL );\n}\n\n\nvoid BZ_API(BZ2_bzWriteClose64)\n                  ( int*          bzerror, \n                    BZFILE*       b, \n                    int           abandon,\n                    unsigned int* nbytes_in_lo32,\n                    unsigned int* nbytes_in_hi32,\n                    unsigned int* nbytes_out_lo32,\n                    unsigned int* nbytes_out_hi32 )\n{\n   Int32   n, n2, ret;\n   bzFile* bzf = (bzFile*)b;\n\n   if (bzf == NULL)\n      { BZ_SETERR(BZ_OK); return; };\n   if (!(bzf->writing))\n      { BZ_SETERR(BZ_SEQUENCE_ERROR); return; };\n   if (ferror(bzf->handle))\n      { BZ_SETERR(BZ_IO_ERROR); return; };\n\n   if (nbytes_in_lo32 != NULL) *nbytes_in_lo32 = 0;\n   if (nbytes_in_hi32 != NULL) *nbytes_in_hi32 = 0;\n   if (nbytes_out_lo32 != NULL) *nbytes_out_lo32 = 0;\n   if (nbytes_out_hi32 != NULL) *nbytes_out_hi32 = 0;\n\n   if ((!abandon) && bzf->lastErr == BZ_OK) {\n      while (True) {\n         bzf->strm.avail_out = BZ_MAX_UNUSED;\n         bzf->strm.next_out = bzf->buf;\n         ret = BZ2_bzCompress ( &(bzf->strm), BZ_FINISH );\n         if (ret != BZ_FINISH_OK && ret != BZ_STREAM_END)\n            { BZ_SETERR(ret); return; };\n\n         if (bzf->strm.avail_out < BZ_MAX_UNUSED) {\n            n = BZ_MAX_UNUSED - bzf->strm.avail_out;\n            n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), \n                          n, bzf->handle );\n            if (n != n2 || ferror(bzf->handle))\n               { BZ_SETERR(BZ_IO_ERROR); return; };\n         }\n\n         if (ret == BZ_STREAM_END) break;\n      }\n   }\n\n   if ( !abandon && !ferror ( bzf->handle ) ) {\n      fflush ( bzf->handle );\n      if (ferror(bzf->handle))\n         { BZ_SETERR(BZ_IO_ERROR); return; };\n   }\n\n   if (nbytes_in_lo32 != NULL)\n      *nbytes_in_lo32 = bzf->strm.total_in_lo32;\n   if (nbytes_in_hi32 != NULL)\n      *nbytes_in_hi32 = bzf->strm.total_in_hi32;\n   if (nbytes_out_lo32 != NULL)\n      *nbytes_out_lo32 = bzf->strm.total_out_lo32;\n   if (nbytes_out_hi32 != NULL)\n      *nbytes_out_hi32 = bzf->strm.total_out_hi32;\n\n   BZ_SETERR(BZ_OK);\n   BZ2_bzCompressEnd ( &(bzf->strm) );\n   free ( bzf );\n}\n\n\n/*---------------------------------------------------*/\nBZFILE* BZ_API(BZ2_bzReadOpen) \n                   ( int*  bzerror, \n                     FILE* f, \n                     int   verbosity,\n                     int   small,\n                     void* unused,\n                     int   nUnused )\n{\n   bzFile* bzf = NULL;\n   int     ret;\n\n   BZ_SETERR(BZ_OK);\n\n   if (f == NULL || \n       (small != 0 && small != 1) ||\n       (verbosity < 0 || verbosity > 4) ||\n       (unused == NULL && nUnused != 0) ||\n       (unused != NULL && (nUnused < 0 || nUnused > BZ_MAX_UNUSED)))\n      { BZ_SETERR(BZ_PARAM_ERROR); return NULL; };\n\n   if (ferror(f))\n      { BZ_SETERR(BZ_IO_ERROR); return NULL; };\n\n   bzf = malloc ( sizeof(bzFile) );\n   if (bzf == NULL) \n      { BZ_SETERR(BZ_MEM_ERROR); return NULL; };\n\n   BZ_SETERR(BZ_OK);\n\n   bzf->initialisedOk = False;\n   bzf->handle        = f;\n   bzf->bufN          = 0;\n   bzf->writing       = False;\n   bzf->strm.bzalloc  = NULL;\n   bzf->strm.bzfree   = NULL;\n   bzf->strm.opaque   = NULL;\n   \n   while (nUnused > 0) {\n      bzf->buf[bzf->bufN] = *((UChar*)(unused)); bzf->bufN++;\n      unused = ((void*)( 1 + ((UChar*)(unused))  ));\n      nUnused--;\n   }\n\n   ret = BZ2_bzDecompressInit ( &(bzf->strm), verbosity, small );\n   if (ret != BZ_OK)\n      { BZ_SETERR(ret); free(bzf); return NULL; };\n\n   bzf->strm.avail_in = bzf->bufN;\n   bzf->strm.next_in  = bzf->buf;\n\n   bzf->initialisedOk = True;\n   return bzf;   \n}\n\n\n/*---------------------------------------------------*/\nvoid BZ_API(BZ2_bzReadClose) ( int *bzerror, BZFILE *b )\n{\n   bzFile* bzf = (bzFile*)b;\n\n   BZ_SETERR(BZ_OK);\n   if (bzf == NULL)\n      { BZ_SETERR(BZ_OK); return; };\n\n   if (bzf->writing)\n      { BZ_SETERR(BZ_SEQUENCE_ERROR); return; };\n\n   if (bzf->initialisedOk)\n      (void)BZ2_bzDecompressEnd ( &(bzf->strm) );\n   free ( bzf );\n}\n\n\n/*---------------------------------------------------*/\nint BZ_API(BZ2_bzRead) \n           ( int*    bzerror, \n             BZFILE* b, \n             void*   buf, \n             int     len )\n{\n   Int32   n, ret;\n   bzFile* bzf = (bzFile*)b;\n\n   BZ_SETERR(BZ_OK);\n\n   if (bzf == NULL || buf == NULL || len < 0)\n      { BZ_SETERR(BZ_PARAM_ERROR); return 0; };\n\n   if (bzf->writing)\n      { BZ_SETERR(BZ_SEQUENCE_ERROR); return 0; };\n\n   if (len == 0)\n      { BZ_SETERR(BZ_OK); return 0; };\n\n   bzf->strm.avail_out = len;\n   bzf->strm.next_out = buf;\n\n   while (True) {\n\n      if (ferror(bzf->handle)) \n         { BZ_SETERR(BZ_IO_ERROR); return 0; };\n\n      if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) {\n         n = fread ( bzf->buf, sizeof(UChar), \n                     BZ_MAX_UNUSED, bzf->handle );\n         if (ferror(bzf->handle))\n            { BZ_SETERR(BZ_IO_ERROR); return 0; };\n         bzf->bufN = n;\n         bzf->strm.avail_in = bzf->bufN;\n         bzf->strm.next_in = bzf->buf;\n      }\n\n      ret = BZ2_bzDecompress ( &(bzf->strm) );\n\n      if (ret != BZ_OK && ret != BZ_STREAM_END)\n         { BZ_SETERR(ret); return 0; };\n\n      if (ret == BZ_OK && myfeof(bzf->handle) && \n          bzf->strm.avail_in == 0 && bzf->strm.avail_out > 0)\n         { BZ_SETERR(BZ_UNEXPECTED_EOF); return 0; };\n\n      if (ret == BZ_STREAM_END)\n         { BZ_SETERR(BZ_STREAM_END);\n           return len - bzf->strm.avail_out; };\n      if (bzf->strm.avail_out == 0)\n         { BZ_SETERR(BZ_OK); return len; };\n      \n   }\n\n   return 0; /*not reached*/\n}\n\n\n/*---------------------------------------------------*/\nvoid BZ_API(BZ2_bzReadGetUnused) \n                     ( int*    bzerror, \n                       BZFILE* b, \n                       void**  unused, \n                       int*    nUnused )\n{\n   bzFile* bzf = (bzFile*)b;\n   if (bzf == NULL)\n      { BZ_SETERR(BZ_PARAM_ERROR); return; };\n   if (bzf->lastErr != BZ_STREAM_END)\n      { BZ_SETERR(BZ_SEQUENCE_ERROR); return; };\n   if (unused == NULL || nUnused == NULL)\n      { BZ_SETERR(BZ_PARAM_ERROR); return; };\n\n   BZ_SETERR(BZ_OK);\n   *nUnused = bzf->strm.avail_in;\n   *unused = bzf->strm.next_in;\n}\n#endif\n\n\n/*---------------------------------------------------*/\n/*--- Misc convenience stuff                      ---*/\n/*---------------------------------------------------*/\n\n/*---------------------------------------------------*/\nint BZ_API(BZ2_bzBuffToBuffCompress) \n                         ( char*         dest, \n                           unsigned int* destLen,\n                           char*         source, \n                           unsigned int  sourceLen,\n                           int           blockSize100k, \n                           int           verbosity, \n                           int           workFactor )\n{\n   bz_stream strm;\n   int ret;\n\n   if (dest == NULL || destLen == NULL || \n       source == NULL ||\n       blockSize100k < 1 || blockSize100k > 9 ||\n       verbosity < 0 || verbosity > 4 ||\n       workFactor < 0 || workFactor > 250) \n      return BZ_PARAM_ERROR;\n\n   if (workFactor == 0) workFactor = 30;\n   strm.bzalloc = NULL;\n   strm.bzfree = NULL;\n   strm.opaque = NULL;\n   ret = BZ2_bzCompressInit ( &strm, blockSize100k, \n                              verbosity, workFactor );\n   if (ret != BZ_OK) return ret;\n\n   strm.next_in = source;\n   strm.next_out = dest;\n   strm.avail_in = sourceLen;\n   strm.avail_out = *destLen;\n\n   ret = BZ2_bzCompress ( &strm, BZ_FINISH );\n   if (ret == BZ_FINISH_OK) goto output_overflow;\n   if (ret != BZ_STREAM_END) goto errhandler;\n\n   /* normal termination */\n   *destLen -= strm.avail_out;   \n   BZ2_bzCompressEnd ( &strm );\n   return BZ_OK;\n\n   output_overflow:\n   BZ2_bzCompressEnd ( &strm );\n   return BZ_OUTBUFF_FULL;\n\n   errhandler:\n   BZ2_bzCompressEnd ( &strm );\n   return ret;\n}\n\n\n/*---------------------------------------------------*/\nint BZ_API(BZ2_bzBuffToBuffDecompress) \n                           ( char*         dest, \n                             unsigned int* destLen,\n                             char*         source, \n                             unsigned int  sourceLen,\n                             int           small,\n                             int           verbosity )\n{\n   bz_stream strm;\n   int ret;\n\n   if (dest == NULL || destLen == NULL || \n       source == NULL ||\n       (small != 0 && small != 1) ||\n       verbosity < 0 || verbosity > 4) \n          return BZ_PARAM_ERROR;\n\n   strm.bzalloc = NULL;\n   strm.bzfree = NULL;\n   strm.opaque = NULL;\n   ret = BZ2_bzDecompressInit ( &strm, verbosity, small );\n   if (ret != BZ_OK) return ret;\n\n   strm.next_in = source;\n   strm.next_out = dest;\n   strm.avail_in = sourceLen;\n   strm.avail_out = *destLen;\n\n   ret = BZ2_bzDecompress ( &strm );\n   if (ret == BZ_OK) goto output_overflow_or_eof;\n   if (ret != BZ_STREAM_END) goto errhandler;\n\n   /* normal termination */\n   *destLen -= strm.avail_out;\n   BZ2_bzDecompressEnd ( &strm );\n   return BZ_OK;\n\n   output_overflow_or_eof:\n   if (strm.avail_out > 0) {\n      BZ2_bzDecompressEnd ( &strm );\n      return BZ_UNEXPECTED_EOF;\n   } else {\n      BZ2_bzDecompressEnd ( &strm );\n      return BZ_OUTBUFF_FULL;\n   };      \n\n   errhandler:\n   BZ2_bzDecompressEnd ( &strm );\n   return ret; \n}\n\n\n/*---------------------------------------------------*/\n/*--\n   Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp)\n   to support better zlib compatibility.\n   This code is not _officially_ part of libbzip2 (yet);\n   I haven't tested it, documented it, or considered the\n   threading-safeness of it.\n   If this code breaks, please contact both Yoshioka and me.\n--*/\n/*---------------------------------------------------*/\n\n/*---------------------------------------------------*/\n/*--\n   return version like \"0.9.5d, 4-Sept-1999\".\n--*/\nconst char * BZ_API(BZ2_bzlibVersion)(void)\n{\n   return BZ_VERSION;\n}\n\n\n#ifndef BZ_NO_STDIO\n/*---------------------------------------------------*/\n\n#if defined(_WIN32) || defined(OS2) || defined(MSDOS)\n#   include <fcntl.h>\n#   include <io.h>\n#   define SET_BINARY_MODE(file) setmode(fileno(file),O_BINARY)\n#else\n#   define SET_BINARY_MODE(file)\n#endif\nstatic\nBZFILE * bzopen_or_bzdopen\n               ( const char *path,   /* no use when bzdopen */\n                 int fd,             /* no use when bzdopen */\n                 const char *mode,\n                 int open_mode)      /* bzopen: 0, bzdopen:1 */\n{\n   int    bzerr;\n   char   unused[BZ_MAX_UNUSED];\n   int    blockSize100k = 9;\n   int    writing       = 0;\n   char   mode2[10]     = \"\";\n   FILE   *fp           = NULL;\n   BZFILE *bzfp         = NULL;\n   int    verbosity     = 0;\n   int    workFactor    = 30;\n   int    smallMode     = 0;\n   int    nUnused       = 0; \n\n   if (mode == NULL) return NULL;\n   while (*mode) {\n      switch (*mode) {\n      case 'r':\n         writing = 0; break;\n      case 'w':\n         writing = 1; break;\n      case 's':\n         smallMode = 1; break;\n      default:\n         if (isdigit((int)(*mode))) {\n            blockSize100k = *mode-BZ_HDR_0;\n         }\n      }\n      mode++;\n   }\n   strcat(mode2, writing ? \"w\" : \"r\" );\n   strcat(mode2,\"b\");   /* binary mode */\n\n   if (open_mode==0) {\n      if (path==NULL || strcmp(path,\"\")==0) {\n        fp = (writing ? stdout : stdin);\n        SET_BINARY_MODE(fp);\n      } else {\n        fp = fopen(path,mode2);\n      }\n   } else {\n#ifdef BZ_STRICT_ANSI\n      fp = NULL;\n#else\n      fp = fdopen(fd,mode2);\n#endif\n   }\n   if (fp == NULL) return NULL;\n\n   if (writing) {\n      /* Guard against total chaos and anarchy -- JRS */\n      if (blockSize100k < 1) blockSize100k = 1;\n      if (blockSize100k > 9) blockSize100k = 9; \n      bzfp = BZ2_bzWriteOpen(&bzerr,fp,blockSize100k,\n                             verbosity,workFactor);\n   } else {\n      bzfp = BZ2_bzReadOpen(&bzerr,fp,verbosity,smallMode,\n                            unused,nUnused);\n   }\n   if (bzfp == NULL) {\n      if (fp != stdin && fp != stdout) fclose(fp);\n      return NULL;\n   }\n   return bzfp;\n}\n\n\n/*---------------------------------------------------*/\n/*--\n   open file for read or write.\n      ex) bzopen(\"file\",\"w9\")\n      case path=\"\" or NULL => use stdin or stdout.\n--*/\nBZFILE * BZ_API(BZ2_bzopen)\n               ( const char *path,\n                 const char *mode )\n{\n   return bzopen_or_bzdopen(path,-1,mode,/*bzopen*/0);\n}\n\n\n/*---------------------------------------------------*/\nBZFILE * BZ_API(BZ2_bzdopen)\n               ( int fd,\n                 const char *mode )\n{\n   return bzopen_or_bzdopen(NULL,fd,mode,/*bzdopen*/1);\n}\n\n\n/*---------------------------------------------------*/\nint BZ_API(BZ2_bzread) (BZFILE* b, void* buf, int len )\n{\n   int bzerr, nread;\n   if (((bzFile*)b)->lastErr == BZ_STREAM_END) return 0;\n   nread = BZ2_bzRead(&bzerr,b,buf,len);\n   if (bzerr == BZ_OK || bzerr == BZ_STREAM_END) {\n      return nread;\n   } else {\n      return -1;\n   }\n}\n\n\n/*---------------------------------------------------*/\nint BZ_API(BZ2_bzwrite) (BZFILE* b, void* buf, int len )\n{\n   int bzerr;\n\n   BZ2_bzWrite(&bzerr,b,buf,len);\n   if(bzerr == BZ_OK){\n      return len;\n   }else{\n      return -1;\n   }\n}\n\n\n/*---------------------------------------------------*/\nint BZ_API(BZ2_bzflush) (BZFILE *b)\n{\n   /* do nothing now... */\n   return 0;\n}\n\n\n/*---------------------------------------------------*/\nvoid BZ_API(BZ2_bzclose) (BZFILE* b)\n{\n   int bzerr;\n   FILE *fp;\n   \n   if (b==NULL) {return;}\n   fp = ((bzFile *)b)->handle;\n   if(((bzFile*)b)->writing){\n      BZ2_bzWriteClose(&bzerr,b,0,NULL,NULL);\n      if(bzerr != BZ_OK){\n         BZ2_bzWriteClose(NULL,b,1,NULL,NULL);\n      }\n   }else{\n      BZ2_bzReadClose(&bzerr,b);\n   }\n   if(fp!=stdin && fp!=stdout){\n      fclose(fp);\n   }\n}\n\n\n/*---------------------------------------------------*/\n/*--\n   return last error code \n--*/\nstatic const char *bzerrorstrings[] = {\n       \"OK\"\n      ,\"SEQUENCE_ERROR\"\n      ,\"PARAM_ERROR\"\n      ,\"MEM_ERROR\"\n      ,\"DATA_ERROR\"\n      ,\"DATA_ERROR_MAGIC\"\n      ,\"IO_ERROR\"\n      ,\"UNEXPECTED_EOF\"\n      ,\"OUTBUFF_FULL\"\n      ,\"CONFIG_ERROR\"\n      ,\"???\"   /* for future */\n      ,\"???\"   /* for future */\n      ,\"???\"   /* for future */\n      ,\"???\"   /* for future */\n      ,\"???\"   /* for future */\n      ,\"???\"   /* for future */\n};\n\n\nconst char * BZ_API(BZ2_bzerror) (BZFILE *b, int *errnum)\n{\n   int err = ((bzFile *)b)->lastErr;\n\n   if(err>0) err = 0;\n   *errnum = err;\n   return bzerrorstrings[err*-1];\n}\n#endif\n\n\n/*-------------------------------------------------------------*/\n/*--- end                                           bzlib.c ---*/\n/*-------------------------------------------------------------*/\n"
  },
  {
    "path": "ext/bzip2/bzlib.h",
    "content": "\n/*-------------------------------------------------------------*/\n/*--- Public header file for the library.                   ---*/\n/*---                                               bzlib.h ---*/\n/*-------------------------------------------------------------*/\n\n/* ------------------------------------------------------------------\n   This file is part of bzip2/libbzip2, a program and library for\n   lossless, block-sorting data compression.\n\n   bzip2/libbzip2 version 1.0.6 of 6 September 2010\n   Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>\n\n   Please read the WARNING, DISCLAIMER and PATENTS sections in the \n   README file.\n\n   This program is released under the terms of the license contained\n   in the file LICENSE.\n   ------------------------------------------------------------------ */\n\n\n#ifndef _BZLIB_H\n#define _BZLIB_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#define BZ_RUN               0\n#define BZ_FLUSH             1\n#define BZ_FINISH            2\n\n#define BZ_OK                0\n#define BZ_RUN_OK            1\n#define BZ_FLUSH_OK          2\n#define BZ_FINISH_OK         3\n#define BZ_STREAM_END        4\n#define BZ_SEQUENCE_ERROR    (-1)\n#define BZ_PARAM_ERROR       (-2)\n#define BZ_MEM_ERROR         (-3)\n#define BZ_DATA_ERROR        (-4)\n#define BZ_DATA_ERROR_MAGIC  (-5)\n#define BZ_IO_ERROR          (-6)\n#define BZ_UNEXPECTED_EOF    (-7)\n#define BZ_OUTBUFF_FULL      (-8)\n#define BZ_CONFIG_ERROR      (-9)\n\ntypedef \n   struct {\n      char *next_in;\n      unsigned int avail_in;\n      unsigned int total_in_lo32;\n      unsigned int total_in_hi32;\n\n      char *next_out;\n      unsigned int avail_out;\n      unsigned int total_out_lo32;\n      unsigned int total_out_hi32;\n\n      void *state;\n\n      void *(*bzalloc)(void *,int,int);\n      void (*bzfree)(void *,void *);\n      void *opaque;\n   } \n   bz_stream;\n\n\n#ifndef BZ_IMPORT\n#define BZ_EXPORT\n#endif\n\n#ifndef BZ_NO_STDIO\n/* Need a definitition for FILE */\n#include <stdio.h>\n#endif\n\n#ifdef _WIN32\n#   include <windows.h>\n#   ifdef small\n      /* windows.h define small to char */\n#      undef small\n#   endif\n#   ifdef BZ_EXPORT\n#   define BZ_API(func) WINAPI func\n#   define BZ_EXTERN extern\n#   else\n   /* import windows dll dynamically */\n#   define BZ_API(func) (WINAPI * func)\n#   define BZ_EXTERN\n#   endif\n#else\n#   define BZ_API(func) func\n#   define BZ_EXTERN extern\n#endif\n\n\n/*-- Core (low-level) library functions --*/\n\nBZ_EXTERN int BZ_API(BZ2_bzCompressInit) ( \n      bz_stream* strm, \n      int        blockSize100k, \n      int        verbosity, \n      int        workFactor \n   );\n\nBZ_EXTERN int BZ_API(BZ2_bzCompress) ( \n      bz_stream* strm, \n      int action \n   );\n\nBZ_EXTERN int BZ_API(BZ2_bzCompressEnd) ( \n      bz_stream* strm \n   );\n\nBZ_EXTERN int BZ_API(BZ2_bzDecompressInit) ( \n      bz_stream *strm, \n      int       verbosity, \n      int       small\n   );\n\nBZ_EXTERN int BZ_API(BZ2_bzDecompress) ( \n      bz_stream* strm \n   );\n\nBZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) ( \n      bz_stream *strm \n   );\n\n\n\n/*-- High(er) level library functions --*/\n\n#ifndef BZ_NO_STDIO\n#define BZ_MAX_UNUSED 5000\n\ntypedef void BZFILE;\n\nBZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) ( \n      int*  bzerror,   \n      FILE* f, \n      int   verbosity, \n      int   small,\n      void* unused,    \n      int   nUnused \n   );\n\nBZ_EXTERN void BZ_API(BZ2_bzReadClose) ( \n      int*    bzerror, \n      BZFILE* b \n   );\n\nBZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) ( \n      int*    bzerror, \n      BZFILE* b, \n      void**  unused,  \n      int*    nUnused \n   );\n\nBZ_EXTERN int BZ_API(BZ2_bzRead) ( \n      int*    bzerror, \n      BZFILE* b, \n      void*   buf, \n      int     len \n   );\n\nBZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) ( \n      int*  bzerror,      \n      FILE* f, \n      int   blockSize100k, \n      int   verbosity, \n      int   workFactor \n   );\n\nBZ_EXTERN void BZ_API(BZ2_bzWrite) ( \n      int*    bzerror, \n      BZFILE* b, \n      void*   buf, \n      int     len \n   );\n\nBZ_EXTERN void BZ_API(BZ2_bzWriteClose) ( \n      int*          bzerror, \n      BZFILE*       b, \n      int           abandon, \n      unsigned int* nbytes_in, \n      unsigned int* nbytes_out \n   );\n\nBZ_EXTERN void BZ_API(BZ2_bzWriteClose64) ( \n      int*          bzerror, \n      BZFILE*       b, \n      int           abandon, \n      unsigned int* nbytes_in_lo32, \n      unsigned int* nbytes_in_hi32, \n      unsigned int* nbytes_out_lo32, \n      unsigned int* nbytes_out_hi32\n   );\n#endif\n\n\n/*-- Utility functions --*/\n\nBZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) ( \n      char*         dest, \n      unsigned int* destLen,\n      char*         source, \n      unsigned int  sourceLen,\n      int           blockSize100k, \n      int           verbosity, \n      int           workFactor \n   );\n\nBZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) ( \n      char*         dest, \n      unsigned int* destLen,\n      char*         source, \n      unsigned int  sourceLen,\n      int           small, \n      int           verbosity \n   );\n\n\n/*--\n   Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp)\n   to support better zlib compatibility.\n   This code is not _officially_ part of libbzip2 (yet);\n   I haven't tested it, documented it, or considered the\n   threading-safeness of it.\n   If this code breaks, please contact both Yoshioka and me.\n--*/\n\nBZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) (\n      void\n   );\n\n#ifndef BZ_NO_STDIO\nBZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) (\n      const char *path,\n      const char *mode\n   );\n\nBZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) (\n      int        fd,\n      const char *mode\n   );\n         \nBZ_EXTERN int BZ_API(BZ2_bzread) (\n      BZFILE* b, \n      void* buf, \n      int len \n   );\n\nBZ_EXTERN int BZ_API(BZ2_bzwrite) (\n      BZFILE* b, \n      void*   buf, \n      int     len \n   );\n\nBZ_EXTERN int BZ_API(BZ2_bzflush) (\n      BZFILE* b\n   );\n\nBZ_EXTERN void BZ_API(BZ2_bzclose) (\n      BZFILE* b\n   );\n\nBZ_EXTERN const char * BZ_API(BZ2_bzerror) (\n      BZFILE *b, \n      int    *errnum\n   );\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n\n/*-------------------------------------------------------------*/\n/*--- end                                           bzlib.h ---*/\n/*-------------------------------------------------------------*/\n"
  },
  {
    "path": "ext/bzip2/bzlib_private.h",
    "content": "\n/*-------------------------------------------------------------*/\n/*--- Private header file for the library.                  ---*/\n/*---                                       bzlib_private.h ---*/\n/*-------------------------------------------------------------*/\n\n/* ------------------------------------------------------------------\n   This file is part of bzip2/libbzip2, a program and library for\n   lossless, block-sorting data compression.\n\n   bzip2/libbzip2 version 1.0.6 of 6 September 2010\n   Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>\n\n   Please read the WARNING, DISCLAIMER and PATENTS sections in the \n   README file.\n\n   This program is released under the terms of the license contained\n   in the file LICENSE.\n   ------------------------------------------------------------------ */\n\n\n#ifndef _BZLIB_PRIVATE_H\n#define _BZLIB_PRIVATE_H\n\n#include <stdlib.h>\n\n#ifndef BZ_NO_STDIO\n#include <stdio.h>\n#include <ctype.h>\n#include <string.h>\n#endif\n\n#include \"bzlib.h\"\n\n\n\n/*-- General stuff. --*/\n\n#define BZ_VERSION  \"1.0.6, 6-Sept-2010\"\n\ntypedef char            Char;\ntypedef unsigned char   Bool;\ntypedef unsigned char   UChar;\ntypedef int             Int32;\ntypedef unsigned int    UInt32;\ntypedef short           Int16;\ntypedef unsigned short  UInt16;\n\n#define True  ((Bool)1)\n#define False ((Bool)0)\n\n#ifndef __GNUC__\n#define __inline__  /* */\n#endif \n\n#ifndef BZ_NO_STDIO\n\nextern void BZ2_bz__AssertH__fail ( int errcode );\n#define AssertH(cond,errcode) \\\n   { if (!(cond)) BZ2_bz__AssertH__fail ( errcode ); }\n\n#if BZ_DEBUG\n#define AssertD(cond,msg) \\\n   { if (!(cond)) {       \\\n      fprintf ( stderr,   \\\n        \"\\n\\nlibbzip2(debug build): internal error\\n\\t%s\\n\", msg );\\\n      exit(1); \\\n   }}\n#else\n#define AssertD(cond,msg) /* */\n#endif\n\n#define VPrintf0(zf) \\\n   fprintf(stderr,zf)\n#define VPrintf1(zf,za1) \\\n   fprintf(stderr,zf,za1)\n#define VPrintf2(zf,za1,za2) \\\n   fprintf(stderr,zf,za1,za2)\n#define VPrintf3(zf,za1,za2,za3) \\\n   fprintf(stderr,zf,za1,za2,za3)\n#define VPrintf4(zf,za1,za2,za3,za4) \\\n   fprintf(stderr,zf,za1,za2,za3,za4)\n#define VPrintf5(zf,za1,za2,za3,za4,za5) \\\n   fprintf(stderr,zf,za1,za2,za3,za4,za5)\n\n#else\n\nextern void bz_internal_error ( int errcode );\n#define AssertH(cond,errcode) \\\n   { if (!(cond)) bz_internal_error ( errcode ); }\n#define AssertD(cond,msg)                do { } while (0)\n#define VPrintf0(zf)                     do { } while (0)\n#define VPrintf1(zf,za1)                 do { } while (0)\n#define VPrintf2(zf,za1,za2)             do { } while (0)\n#define VPrintf3(zf,za1,za2,za3)         do { } while (0)\n#define VPrintf4(zf,za1,za2,za3,za4)     do { } while (0)\n#define VPrintf5(zf,za1,za2,za3,za4,za5) do { } while (0)\n\n#endif\n\n\n#define BZALLOC(nnn) (strm->bzalloc)(strm->opaque,(nnn),1)\n#define BZFREE(ppp)  (strm->bzfree)(strm->opaque,(ppp))\n\n\n/*-- Header bytes. --*/\n\n#define BZ_HDR_B 0x42   /* 'B' */\n#define BZ_HDR_Z 0x5a   /* 'Z' */\n#define BZ_HDR_h 0x68   /* 'h' */\n#define BZ_HDR_0 0x30   /* '0' */\n  \n/*-- Constants for the back end. --*/\n\n#define BZ_MAX_ALPHA_SIZE 258\n#define BZ_MAX_CODE_LEN    23\n\n#define BZ_RUNA 0\n#define BZ_RUNB 1\n\n#define BZ_N_GROUPS 6\n#define BZ_G_SIZE   50\n#define BZ_N_ITERS  4\n\n#define BZ_MAX_SELECTORS (2 + (900000 / BZ_G_SIZE))\n\n\n\n/*-- Stuff for randomising repetitive blocks. --*/\n\nextern Int32 BZ2_rNums[512];\n\n#define BZ_RAND_DECLS                          \\\n   Int32 rNToGo;                               \\\n   Int32 rTPos                                 \\\n\n#define BZ_RAND_INIT_MASK                      \\\n   s->rNToGo = 0;                              \\\n   s->rTPos  = 0                               \\\n\n#define BZ_RAND_MASK ((s->rNToGo == 1) ? 1 : 0)\n\n#define BZ_RAND_UPD_MASK                       \\\n   if (s->rNToGo == 0) {                       \\\n      s->rNToGo = BZ2_rNums[s->rTPos];         \\\n      s->rTPos++;                              \\\n      if (s->rTPos == 512) s->rTPos = 0;       \\\n   }                                           \\\n   s->rNToGo--;\n\n\n\n/*-- Stuff for doing CRCs. --*/\n\nextern UInt32 BZ2_crc32Table[256];\n\n#define BZ_INITIALISE_CRC(crcVar)              \\\n{                                              \\\n   crcVar = 0xffffffffL;                       \\\n}\n\n#define BZ_FINALISE_CRC(crcVar)                \\\n{                                              \\\n   crcVar = ~(crcVar);                         \\\n}\n\n#define BZ_UPDATE_CRC(crcVar,cha)              \\\n{                                              \\\n   crcVar = (crcVar << 8) ^                    \\\n            BZ2_crc32Table[(crcVar >> 24) ^    \\\n                           ((UChar)cha)];      \\\n}\n\n\n\n/*-- States and modes for compression. --*/\n\n#define BZ_M_IDLE      1\n#define BZ_M_RUNNING   2\n#define BZ_M_FLUSHING  3\n#define BZ_M_FINISHING 4\n\n#define BZ_S_OUTPUT    1\n#define BZ_S_INPUT     2\n\n#define BZ_N_RADIX 2\n#define BZ_N_QSORT 12\n#define BZ_N_SHELL 18\n#define BZ_N_OVERSHOOT (BZ_N_RADIX + BZ_N_QSORT + BZ_N_SHELL + 2)\n\n\n\n\n/*-- Structure holding all the compression-side stuff. --*/\n\ntypedef\n   struct {\n      /* pointer back to the struct bz_stream */\n      bz_stream* strm;\n\n      /* mode this stream is in, and whether inputting */\n      /* or outputting data */\n      Int32    mode;\n      Int32    state;\n\n      /* remembers avail_in when flush/finish requested */\n      UInt32   avail_in_expect;\n\n      /* for doing the block sorting */\n      UInt32*  arr1;\n      UInt32*  arr2;\n      UInt32*  ftab;\n      Int32    origPtr;\n\n      /* aliases for arr1 and arr2 */\n      UInt32*  ptr;\n      UChar*   block;\n      UInt16*  mtfv;\n      UChar*   zbits;\n\n      /* for deciding when to use the fallback sorting algorithm */\n      Int32    workFactor;\n\n      /* run-length-encoding of the input */\n      UInt32   state_in_ch;\n      Int32    state_in_len;\n      BZ_RAND_DECLS;\n\n      /* input and output limits and current posns */\n      Int32    nblock;\n      Int32    nblockMAX;\n      Int32    numZ;\n      Int32    state_out_pos;\n\n      /* map of bytes used in block */\n      Int32    nInUse;\n      Bool     inUse[256];\n      UChar    unseqToSeq[256];\n\n      /* the buffer for bit stream creation */\n      UInt32   bsBuff;\n      Int32    bsLive;\n\n      /* block and combined CRCs */\n      UInt32   blockCRC;\n      UInt32   combinedCRC;\n\n      /* misc administratium */\n      Int32    verbosity;\n      Int32    blockNo;\n      Int32    blockSize100k;\n\n      /* stuff for coding the MTF values */\n      Int32    nMTF;\n      Int32    mtfFreq    [BZ_MAX_ALPHA_SIZE];\n      UChar    selector   [BZ_MAX_SELECTORS];\n      UChar    selectorMtf[BZ_MAX_SELECTORS];\n\n      UChar    len     [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];\n      Int32    code    [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];\n      Int32    rfreq   [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];\n      /* second dimension: only 3 needed; 4 makes index calculations faster */\n      UInt32   len_pack[BZ_MAX_ALPHA_SIZE][4];\n\n   }\n   EState;\n\n\n\n/*-- externs for compression. --*/\n\nextern void \nBZ2_blockSort ( EState* );\n\nextern void \nBZ2_compressBlock ( EState*, Bool );\n\nextern void \nBZ2_bsInitWrite ( EState* );\n\nextern void \nBZ2_hbAssignCodes ( Int32*, UChar*, Int32, Int32, Int32 );\n\nextern void \nBZ2_hbMakeCodeLengths ( UChar*, Int32*, Int32, Int32 );\n\n\n\n/*-- states for decompression. --*/\n\n#define BZ_X_IDLE        1\n#define BZ_X_OUTPUT      2\n\n#define BZ_X_MAGIC_1     10\n#define BZ_X_MAGIC_2     11\n#define BZ_X_MAGIC_3     12\n#define BZ_X_MAGIC_4     13\n#define BZ_X_BLKHDR_1    14\n#define BZ_X_BLKHDR_2    15\n#define BZ_X_BLKHDR_3    16\n#define BZ_X_BLKHDR_4    17\n#define BZ_X_BLKHDR_5    18\n#define BZ_X_BLKHDR_6    19\n#define BZ_X_BCRC_1      20\n#define BZ_X_BCRC_2      21\n#define BZ_X_BCRC_3      22\n#define BZ_X_BCRC_4      23\n#define BZ_X_RANDBIT     24\n#define BZ_X_ORIGPTR_1   25\n#define BZ_X_ORIGPTR_2   26\n#define BZ_X_ORIGPTR_3   27\n#define BZ_X_MAPPING_1   28\n#define BZ_X_MAPPING_2   29\n#define BZ_X_SELECTOR_1  30\n#define BZ_X_SELECTOR_2  31\n#define BZ_X_SELECTOR_3  32\n#define BZ_X_CODING_1    33\n#define BZ_X_CODING_2    34\n#define BZ_X_CODING_3    35\n#define BZ_X_MTF_1       36\n#define BZ_X_MTF_2       37\n#define BZ_X_MTF_3       38\n#define BZ_X_MTF_4       39\n#define BZ_X_MTF_5       40\n#define BZ_X_MTF_6       41\n#define BZ_X_ENDHDR_2    42\n#define BZ_X_ENDHDR_3    43\n#define BZ_X_ENDHDR_4    44\n#define BZ_X_ENDHDR_5    45\n#define BZ_X_ENDHDR_6    46\n#define BZ_X_CCRC_1      47\n#define BZ_X_CCRC_2      48\n#define BZ_X_CCRC_3      49\n#define BZ_X_CCRC_4      50\n\n\n\n/*-- Constants for the fast MTF decoder. --*/\n\n#define MTFA_SIZE 4096\n#define MTFL_SIZE 16\n\n\n\n/*-- Structure holding all the decompression-side stuff. --*/\n\ntypedef\n   struct {\n      /* pointer back to the struct bz_stream */\n      bz_stream* strm;\n\n      /* state indicator for this stream */\n      Int32    state;\n\n      /* for doing the final run-length decoding */\n      UChar    state_out_ch;\n      Int32    state_out_len;\n      Bool     blockRandomised;\n      BZ_RAND_DECLS;\n\n      /* the buffer for bit stream reading */\n      UInt32   bsBuff;\n      Int32    bsLive;\n\n      /* misc administratium */\n      Int32    blockSize100k;\n      Bool     smallDecompress;\n      Int32    currBlockNo;\n      Int32    verbosity;\n\n      /* for undoing the Burrows-Wheeler transform */\n      Int32    origPtr;\n      UInt32   tPos;\n      Int32    k0;\n      Int32    unzftab[256];\n      Int32    nblock_used;\n      Int32    cftab[257];\n      Int32    cftabCopy[257];\n\n      /* for undoing the Burrows-Wheeler transform (FAST) */\n      UInt32   *tt;\n\n      /* for undoing the Burrows-Wheeler transform (SMALL) */\n      UInt16   *ll16;\n      UChar    *ll4;\n\n      /* stored and calculated CRCs */\n      UInt32   storedBlockCRC;\n      UInt32   storedCombinedCRC;\n      UInt32   calculatedBlockCRC;\n      UInt32   calculatedCombinedCRC;\n\n      /* map of bytes used in block */\n      Int32    nInUse;\n      Bool     inUse[256];\n      Bool     inUse16[16];\n      UChar    seqToUnseq[256];\n\n      /* for decoding the MTF values */\n      UChar    mtfa   [MTFA_SIZE];\n      Int32    mtfbase[256 / MTFL_SIZE];\n      UChar    selector   [BZ_MAX_SELECTORS];\n      UChar    selectorMtf[BZ_MAX_SELECTORS];\n      UChar    len  [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];\n\n      Int32    limit  [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];\n      Int32    base   [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];\n      Int32    perm   [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];\n      Int32    minLens[BZ_N_GROUPS];\n\n      /* save area for scalars in the main decompress code */\n      Int32    save_i;\n      Int32    save_j;\n      Int32    save_t;\n      Int32    save_alphaSize;\n      Int32    save_nGroups;\n      Int32    save_nSelectors;\n      Int32    save_EOB;\n      Int32    save_groupNo;\n      Int32    save_groupPos;\n      Int32    save_nextSym;\n      Int32    save_nblockMAX;\n      Int32    save_nblock;\n      Int32    save_es;\n      Int32    save_N;\n      Int32    save_curr;\n      Int32    save_zt;\n      Int32    save_zn; \n      Int32    save_zvec;\n      Int32    save_zj;\n      Int32    save_gSel;\n      Int32    save_gMinlen;\n      Int32*   save_gLimit;\n      Int32*   save_gBase;\n      Int32*   save_gPerm;\n\n   }\n   DState;\n\n\n\n/*-- Macros for decompression. --*/\n\n#define BZ_GET_FAST(cccc)                     \\\n    /* c_tPos is unsigned, hence test < 0 is pointless. */ \\\n    if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return True; \\\n    s->tPos = s->tt[s->tPos];                 \\\n    cccc = (UChar)(s->tPos & 0xff);           \\\n    s->tPos >>= 8;\n\n#define BZ_GET_FAST_C(cccc)                   \\\n    /* c_tPos is unsigned, hence test < 0 is pointless. */ \\\n    if (c_tPos >= (UInt32)100000 * (UInt32)ro_blockSize100k) return True; \\\n    c_tPos = c_tt[c_tPos];                    \\\n    cccc = (UChar)(c_tPos & 0xff);            \\\n    c_tPos >>= 8;\n\n#define SET_LL4(i,n)                                          \\\n   { if (((i) & 0x1) == 0)                                    \\\n        s->ll4[(i) >> 1] = (s->ll4[(i) >> 1] & 0xf0) | (n); else    \\\n        s->ll4[(i) >> 1] = (s->ll4[(i) >> 1] & 0x0f) | ((n) << 4);  \\\n   }\n\n#define GET_LL4(i)                             \\\n   ((((UInt32)(s->ll4[(i) >> 1])) >> (((i) << 2) & 0x4)) & 0xF)\n\n#define SET_LL(i,n)                          \\\n   { s->ll16[i] = (UInt16)(n & 0x0000ffff);  \\\n     SET_LL4(i, n >> 16);                    \\\n   }\n\n#define GET_LL(i) \\\n   (((UInt32)s->ll16[i]) | (GET_LL4(i) << 16))\n\n#define BZ_GET_SMALL(cccc)                            \\\n    /* c_tPos is unsigned, hence test < 0 is pointless. */ \\\n    if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return True; \\\n    cccc = BZ2_indexIntoF ( s->tPos, s->cftab );    \\\n    s->tPos = GET_LL(s->tPos);\n\n\n/*-- externs for decompression. --*/\n\nextern Int32 \nBZ2_indexIntoF ( Int32, Int32* );\n\nextern Int32 \nBZ2_decompress ( DState* );\n\nextern void \nBZ2_hbCreateDecodeTables ( Int32*, Int32*, Int32*, UChar*,\n                           Int32,  Int32, Int32 );\n\n\n#endif\n\n\n/*-- BZ_NO_STDIO seems to make NULL disappear on some platforms. --*/\n\n#ifdef BZ_NO_STDIO\n#ifndef NULL\n#define NULL 0\n#endif\n#endif\n\n\n/*-------------------------------------------------------------*/\n/*--- end                                   bzlib_private.h ---*/\n/*-------------------------------------------------------------*/\n"
  },
  {
    "path": "ext/bzip2/compress.c",
    "content": "\n/*-------------------------------------------------------------*/\n/*--- Compression machinery (not incl block sorting)        ---*/\n/*---                                            compress.c ---*/\n/*-------------------------------------------------------------*/\n\n/* ------------------------------------------------------------------\n   This file is part of bzip2/libbzip2, a program and library for\n   lossless, block-sorting data compression.\n\n   bzip2/libbzip2 version 1.0.6 of 6 September 2010\n   Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>\n\n   Please read the WARNING, DISCLAIMER and PATENTS sections in the \n   README file.\n\n   This program is released under the terms of the license contained\n   in the file LICENSE.\n   ------------------------------------------------------------------ */\n\n\n/* CHANGES\n    0.9.0    -- original version.\n    0.9.0a/b -- no changes in this file.\n    0.9.0c   -- changed setting of nGroups in sendMTFValues() \n                so as to do a bit better on small files\n*/\n\n#include \"bzlib_private.h\"\n\n\n/*---------------------------------------------------*/\n/*--- Bit stream I/O                              ---*/\n/*---------------------------------------------------*/\n\n/*---------------------------------------------------*/\nvoid BZ2_bsInitWrite ( EState* s )\n{\n   s->bsLive = 0;\n   s->bsBuff = 0;\n}\n\n\n/*---------------------------------------------------*/\nstatic\nvoid bsFinishWrite ( EState* s )\n{\n   while (s->bsLive > 0) {\n      s->zbits[s->numZ] = (UChar)(s->bsBuff >> 24);\n      s->numZ++;\n      s->bsBuff <<= 8;\n      s->bsLive -= 8;\n   }\n}\n\n\n/*---------------------------------------------------*/\n#define bsNEEDW(nz)                           \\\n{                                             \\\n   while (s->bsLive >= 8) {                   \\\n      s->zbits[s->numZ]                       \\\n         = (UChar)(s->bsBuff >> 24);          \\\n      s->numZ++;                              \\\n      s->bsBuff <<= 8;                        \\\n      s->bsLive -= 8;                         \\\n   }                                          \\\n}\n\n\n/*---------------------------------------------------*/\nstatic\n__inline__\nvoid bsW ( EState* s, Int32 n, UInt32 v )\n{\n   bsNEEDW ( n );\n   s->bsBuff |= (v << (32 - s->bsLive - n));\n   s->bsLive += n;\n}\n\n\n/*---------------------------------------------------*/\nstatic\nvoid bsPutUInt32 ( EState* s, UInt32 u )\n{\n   bsW ( s, 8, (u >> 24) & 0xffL );\n   bsW ( s, 8, (u >> 16) & 0xffL );\n   bsW ( s, 8, (u >>  8) & 0xffL );\n   bsW ( s, 8,  u        & 0xffL );\n}\n\n\n/*---------------------------------------------------*/\nstatic\nvoid bsPutUChar ( EState* s, UChar c )\n{\n   bsW( s, 8, (UInt32)c );\n}\n\n\n/*---------------------------------------------------*/\n/*--- The back end proper                         ---*/\n/*---------------------------------------------------*/\n\n/*---------------------------------------------------*/\nstatic\nvoid makeMaps_e ( EState* s )\n{\n   Int32 i;\n   s->nInUse = 0;\n   for (i = 0; i < 256; i++)\n      if (s->inUse[i]) {\n         s->unseqToSeq[i] = s->nInUse;\n         s->nInUse++;\n      }\n}\n\n\n/*---------------------------------------------------*/\nstatic\nvoid generateMTFValues ( EState* s )\n{\n   UChar   yy[256];\n   Int32   i, j;\n   Int32   zPend;\n   Int32   wr;\n   Int32   EOB;\n\n   /* \n      After sorting (eg, here),\n         s->arr1 [ 0 .. s->nblock-1 ] holds sorted order,\n         and\n         ((UChar*)s->arr2) [ 0 .. s->nblock-1 ] \n         holds the original block data.\n\n      The first thing to do is generate the MTF values,\n      and put them in\n         ((UInt16*)s->arr1) [ 0 .. s->nblock-1 ].\n      Because there are strictly fewer or equal MTF values\n      than block values, ptr values in this area are overwritten\n      with MTF values only when they are no longer needed.\n\n      The final compressed bitstream is generated into the\n      area starting at\n         (UChar*) (&((UChar*)s->arr2)[s->nblock])\n\n      These storage aliases are set up in bzCompressInit(),\n      except for the last one, which is arranged in \n      compressBlock().\n   */\n   UInt32* ptr   = s->ptr;\n   UChar* block  = s->block;\n   UInt16* mtfv  = s->mtfv;\n\n   makeMaps_e ( s );\n   EOB = s->nInUse+1;\n\n   for (i = 0; i <= EOB; i++) s->mtfFreq[i] = 0;\n\n   wr = 0;\n   zPend = 0;\n   for (i = 0; i < s->nInUse; i++) yy[i] = (UChar) i;\n\n   for (i = 0; i < s->nblock; i++) {\n      UChar ll_i;\n      AssertD ( wr <= i, \"generateMTFValues(1)\" );\n      j = ptr[i]-1; if (j < 0) j += s->nblock;\n      ll_i = s->unseqToSeq[block[j]];\n      AssertD ( ll_i < s->nInUse, \"generateMTFValues(2a)\" );\n\n      if (yy[0] == ll_i) { \n         zPend++;\n      } else {\n\n         if (zPend > 0) {\n            zPend--;\n            while (True) {\n               if (zPend & 1) {\n                  mtfv[wr] = BZ_RUNB; wr++; \n                  s->mtfFreq[BZ_RUNB]++; \n               } else {\n                  mtfv[wr] = BZ_RUNA; wr++; \n                  s->mtfFreq[BZ_RUNA]++; \n               }\n               if (zPend < 2) break;\n               zPend = (zPend - 2) / 2;\n            };\n            zPend = 0;\n         }\n         {\n            register UChar  rtmp;\n            register UChar* ryy_j;\n            register UChar  rll_i;\n            rtmp  = yy[1];\n            yy[1] = yy[0];\n            ryy_j = &(yy[1]);\n            rll_i = ll_i;\n            while ( rll_i != rtmp ) {\n               register UChar rtmp2;\n               ryy_j++;\n               rtmp2  = rtmp;\n               rtmp   = *ryy_j;\n               *ryy_j = rtmp2;\n            };\n            yy[0] = rtmp;\n            j = ryy_j - &(yy[0]);\n            mtfv[wr] = j+1; wr++; s->mtfFreq[j+1]++;\n         }\n\n      }\n   }\n\n   if (zPend > 0) {\n      zPend--;\n      while (True) {\n         if (zPend & 1) {\n            mtfv[wr] = BZ_RUNB; wr++; \n            s->mtfFreq[BZ_RUNB]++; \n         } else {\n            mtfv[wr] = BZ_RUNA; wr++; \n            s->mtfFreq[BZ_RUNA]++; \n         }\n         if (zPend < 2) break;\n         zPend = (zPend - 2) / 2;\n      };\n      zPend = 0;\n   }\n\n   mtfv[wr] = EOB; wr++; s->mtfFreq[EOB]++;\n\n   s->nMTF = wr;\n}\n\n\n/*---------------------------------------------------*/\n#define BZ_LESSER_ICOST  0\n#define BZ_GREATER_ICOST 15\n\nstatic\nvoid sendMTFValues ( EState* s )\n{\n   Int32 v, t, i, j, gs, ge, totc, bt, bc, iter;\n   Int32 nSelectors, alphaSize, minLen, maxLen, selCtr;\n   Int32 nGroups, nBytes;\n\n   /*--\n   UChar  len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];\n   is a global since the decoder also needs it.\n\n   Int32  code[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];\n   Int32  rfreq[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];\n   are also globals only used in this proc.\n   Made global to keep stack frame size small.\n   --*/\n\n\n   UInt16 cost[BZ_N_GROUPS];\n   Int32  fave[BZ_N_GROUPS];\n\n   UInt16* mtfv = s->mtfv;\n\n   if (s->verbosity >= 3)\n      VPrintf3( \"      %d in block, %d after MTF & 1-2 coding, \"\n                \"%d+2 syms in use\\n\", \n                s->nblock, s->nMTF, s->nInUse );\n\n   alphaSize = s->nInUse+2;\n   for (t = 0; t < BZ_N_GROUPS; t++)\n      for (v = 0; v < alphaSize; v++)\n         s->len[t][v] = BZ_GREATER_ICOST;\n\n   /*--- Decide how many coding tables to use ---*/\n   AssertH ( s->nMTF > 0, 3001 );\n   if (s->nMTF < 200)  nGroups = 2; else\n   if (s->nMTF < 600)  nGroups = 3; else\n   if (s->nMTF < 1200) nGroups = 4; else\n   if (s->nMTF < 2400) nGroups = 5; else\n                       nGroups = 6;\n\n   /*--- Generate an initial set of coding tables ---*/\n   { \n      Int32 nPart, remF, tFreq, aFreq;\n\n      nPart = nGroups;\n      remF  = s->nMTF;\n      gs = 0;\n      while (nPart > 0) {\n         tFreq = remF / nPart;\n         ge = gs-1;\n         aFreq = 0;\n         while (aFreq < tFreq && ge < alphaSize-1) {\n            ge++;\n            aFreq += s->mtfFreq[ge];\n         }\n\n         if (ge > gs \n             && nPart != nGroups && nPart != 1 \n             && ((nGroups-nPart) % 2 == 1)) {\n            aFreq -= s->mtfFreq[ge];\n            ge--;\n         }\n\n         if (s->verbosity >= 3)\n            VPrintf5( \"      initial group %d, [%d .. %d], \"\n                      \"has %d syms (%4.1f%%)\\n\",\n                      nPart, gs, ge, aFreq, \n                      (100.0 * (float)aFreq) / (float)(s->nMTF) );\n \n         for (v = 0; v < alphaSize; v++)\n            if (v >= gs && v <= ge) \n               s->len[nPart-1][v] = BZ_LESSER_ICOST; else\n               s->len[nPart-1][v] = BZ_GREATER_ICOST;\n \n         nPart--;\n         gs = ge+1;\n         remF -= aFreq;\n      }\n   }\n\n   /*--- \n      Iterate up to BZ_N_ITERS times to improve the tables.\n   ---*/\n   for (iter = 0; iter < BZ_N_ITERS; iter++) {\n\n      for (t = 0; t < nGroups; t++) fave[t] = 0;\n\n      for (t = 0; t < nGroups; t++)\n         for (v = 0; v < alphaSize; v++)\n            s->rfreq[t][v] = 0;\n\n      /*---\n        Set up an auxiliary length table which is used to fast-track\n\tthe common case (nGroups == 6). \n      ---*/\n      if (nGroups == 6) {\n         for (v = 0; v < alphaSize; v++) {\n            s->len_pack[v][0] = (s->len[1][v] << 16) | s->len[0][v];\n            s->len_pack[v][1] = (s->len[3][v] << 16) | s->len[2][v];\n            s->len_pack[v][2] = (s->len[5][v] << 16) | s->len[4][v];\n\t }\n      }\n\n      nSelectors = 0;\n      totc = 0;\n      gs = 0;\n      while (True) {\n\n         /*--- Set group start & end marks. --*/\n         if (gs >= s->nMTF) break;\n         ge = gs + BZ_G_SIZE - 1; \n         if (ge >= s->nMTF) ge = s->nMTF-1;\n\n         /*-- \n            Calculate the cost of this group as coded\n            by each of the coding tables.\n         --*/\n         for (t = 0; t < nGroups; t++) cost[t] = 0;\n\n         if (nGroups == 6 && 50 == ge-gs+1) {\n            /*--- fast track the common case ---*/\n            register UInt32 cost01, cost23, cost45;\n            register UInt16 icv;\n            cost01 = cost23 = cost45 = 0;\n\n#           define BZ_ITER(nn)                \\\n               icv = mtfv[gs+(nn)];           \\\n               cost01 += s->len_pack[icv][0]; \\\n               cost23 += s->len_pack[icv][1]; \\\n               cost45 += s->len_pack[icv][2]; \\\n\n            BZ_ITER(0);  BZ_ITER(1);  BZ_ITER(2);  BZ_ITER(3);  BZ_ITER(4);\n            BZ_ITER(5);  BZ_ITER(6);  BZ_ITER(7);  BZ_ITER(8);  BZ_ITER(9);\n            BZ_ITER(10); BZ_ITER(11); BZ_ITER(12); BZ_ITER(13); BZ_ITER(14);\n            BZ_ITER(15); BZ_ITER(16); BZ_ITER(17); BZ_ITER(18); BZ_ITER(19);\n            BZ_ITER(20); BZ_ITER(21); BZ_ITER(22); BZ_ITER(23); BZ_ITER(24);\n            BZ_ITER(25); BZ_ITER(26); BZ_ITER(27); BZ_ITER(28); BZ_ITER(29);\n            BZ_ITER(30); BZ_ITER(31); BZ_ITER(32); BZ_ITER(33); BZ_ITER(34);\n            BZ_ITER(35); BZ_ITER(36); BZ_ITER(37); BZ_ITER(38); BZ_ITER(39);\n            BZ_ITER(40); BZ_ITER(41); BZ_ITER(42); BZ_ITER(43); BZ_ITER(44);\n            BZ_ITER(45); BZ_ITER(46); BZ_ITER(47); BZ_ITER(48); BZ_ITER(49);\n\n#           undef BZ_ITER\n\n            cost[0] = cost01 & 0xffff; cost[1] = cost01 >> 16;\n            cost[2] = cost23 & 0xffff; cost[3] = cost23 >> 16;\n            cost[4] = cost45 & 0xffff; cost[5] = cost45 >> 16;\n\n         } else {\n\t    /*--- slow version which correctly handles all situations ---*/\n            for (i = gs; i <= ge; i++) { \n               UInt16 icv = mtfv[i];\n               for (t = 0; t < nGroups; t++) cost[t] += s->len[t][icv];\n            }\n         }\n \n         /*-- \n            Find the coding table which is best for this group,\n            and record its identity in the selector table.\n         --*/\n         bc = 999999999; bt = -1;\n         for (t = 0; t < nGroups; t++)\n            if (cost[t] < bc) { bc = cost[t]; bt = t; };\n         totc += bc;\n         fave[bt]++;\n         s->selector[nSelectors] = bt;\n         nSelectors++;\n\n         /*-- \n            Increment the symbol frequencies for the selected table.\n          --*/\n         if (nGroups == 6 && 50 == ge-gs+1) {\n            /*--- fast track the common case ---*/\n\n#           define BZ_ITUR(nn) s->rfreq[bt][ mtfv[gs+(nn)] ]++\n\n            BZ_ITUR(0);  BZ_ITUR(1);  BZ_ITUR(2);  BZ_ITUR(3);  BZ_ITUR(4);\n            BZ_ITUR(5);  BZ_ITUR(6);  BZ_ITUR(7);  BZ_ITUR(8);  BZ_ITUR(9);\n            BZ_ITUR(10); BZ_ITUR(11); BZ_ITUR(12); BZ_ITUR(13); BZ_ITUR(14);\n            BZ_ITUR(15); BZ_ITUR(16); BZ_ITUR(17); BZ_ITUR(18); BZ_ITUR(19);\n            BZ_ITUR(20); BZ_ITUR(21); BZ_ITUR(22); BZ_ITUR(23); BZ_ITUR(24);\n            BZ_ITUR(25); BZ_ITUR(26); BZ_ITUR(27); BZ_ITUR(28); BZ_ITUR(29);\n            BZ_ITUR(30); BZ_ITUR(31); BZ_ITUR(32); BZ_ITUR(33); BZ_ITUR(34);\n            BZ_ITUR(35); BZ_ITUR(36); BZ_ITUR(37); BZ_ITUR(38); BZ_ITUR(39);\n            BZ_ITUR(40); BZ_ITUR(41); BZ_ITUR(42); BZ_ITUR(43); BZ_ITUR(44);\n            BZ_ITUR(45); BZ_ITUR(46); BZ_ITUR(47); BZ_ITUR(48); BZ_ITUR(49);\n\n#           undef BZ_ITUR\n\n         } else {\n\t    /*--- slow version which correctly handles all situations ---*/\n            for (i = gs; i <= ge; i++)\n               s->rfreq[bt][ mtfv[i] ]++;\n         }\n\n         gs = ge+1;\n      }\n      if (s->verbosity >= 3) {\n         VPrintf2 ( \"      pass %d: size is %d, grp uses are \", \n                   iter+1, totc/8 );\n         for (t = 0; t < nGroups; t++)\n            VPrintf1 ( \"%d \", fave[t] );\n         VPrintf0 ( \"\\n\" );\n      }\n\n      /*--\n        Recompute the tables based on the accumulated frequencies.\n      --*/\n      /* maxLen was changed from 20 to 17 in bzip2-1.0.3.  See \n         comment in huffman.c for details. */\n      for (t = 0; t < nGroups; t++)\n         BZ2_hbMakeCodeLengths ( &(s->len[t][0]), &(s->rfreq[t][0]), \n                                 alphaSize, 17 /*20*/ );\n   }\n\n\n   AssertH( nGroups < 8, 3002 );\n   AssertH( nSelectors < 32768 &&\n            nSelectors <= (2 + (900000 / BZ_G_SIZE)),\n            3003 );\n\n\n   /*--- Compute MTF values for the selectors. ---*/\n   {\n      UChar pos[BZ_N_GROUPS], ll_i, tmp2, tmp;\n      for (i = 0; i < nGroups; i++) pos[i] = i;\n      for (i = 0; i < nSelectors; i++) {\n         ll_i = s->selector[i];\n         j = 0;\n         tmp = pos[j];\n         while ( ll_i != tmp ) {\n            j++;\n            tmp2 = tmp;\n            tmp = pos[j];\n            pos[j] = tmp2;\n         };\n         pos[0] = tmp;\n         s->selectorMtf[i] = j;\n      }\n   };\n\n   /*--- Assign actual codes for the tables. --*/\n   for (t = 0; t < nGroups; t++) {\n      minLen = 32;\n      maxLen = 0;\n      for (i = 0; i < alphaSize; i++) {\n         if (s->len[t][i] > maxLen) maxLen = s->len[t][i];\n         if (s->len[t][i] < minLen) minLen = s->len[t][i];\n      }\n      AssertH ( !(maxLen > 17 /*20*/ ), 3004 );\n      AssertH ( !(minLen < 1),  3005 );\n      BZ2_hbAssignCodes ( &(s->code[t][0]), &(s->len[t][0]), \n                          minLen, maxLen, alphaSize );\n   }\n\n   /*--- Transmit the mapping table. ---*/\n   { \n      Bool inUse16[16];\n      for (i = 0; i < 16; i++) {\n          inUse16[i] = False;\n          for (j = 0; j < 16; j++)\n             if (s->inUse[i * 16 + j]) inUse16[i] = True;\n      }\n     \n      nBytes = s->numZ;\n      for (i = 0; i < 16; i++)\n         if (inUse16[i]) bsW(s,1,1); else bsW(s,1,0);\n\n      for (i = 0; i < 16; i++)\n         if (inUse16[i])\n            for (j = 0; j < 16; j++) {\n               if (s->inUse[i * 16 + j]) bsW(s,1,1); else bsW(s,1,0);\n            }\n\n      if (s->verbosity >= 3) \n         VPrintf1( \"      bytes: mapping %d, \", s->numZ-nBytes );\n   }\n\n   /*--- Now the selectors. ---*/\n   nBytes = s->numZ;\n   bsW ( s, 3, nGroups );\n   bsW ( s, 15, nSelectors );\n   for (i = 0; i < nSelectors; i++) { \n      for (j = 0; j < s->selectorMtf[i]; j++) bsW(s,1,1);\n      bsW(s,1,0);\n   }\n   if (s->verbosity >= 3)\n      VPrintf1( \"selectors %d, \", s->numZ-nBytes );\n\n   /*--- Now the coding tables. ---*/\n   nBytes = s->numZ;\n\n   for (t = 0; t < nGroups; t++) {\n      Int32 curr = s->len[t][0];\n      bsW ( s, 5, curr );\n      for (i = 0; i < alphaSize; i++) {\n         while (curr < s->len[t][i]) { bsW(s,2,2); curr++; /* 10 */ };\n         while (curr > s->len[t][i]) { bsW(s,2,3); curr--; /* 11 */ };\n         bsW ( s, 1, 0 );\n      }\n   }\n\n   if (s->verbosity >= 3)\n      VPrintf1 ( \"code lengths %d, \", s->numZ-nBytes );\n\n   /*--- And finally, the block data proper ---*/\n   nBytes = s->numZ;\n   selCtr = 0;\n   gs = 0;\n   while (True) {\n      if (gs >= s->nMTF) break;\n      ge = gs + BZ_G_SIZE - 1; \n      if (ge >= s->nMTF) ge = s->nMTF-1;\n      AssertH ( s->selector[selCtr] < nGroups, 3006 );\n\n      if (nGroups == 6 && 50 == ge-gs+1) {\n            /*--- fast track the common case ---*/\n            UInt16 mtfv_i;\n            UChar* s_len_sel_selCtr \n               = &(s->len[s->selector[selCtr]][0]);\n            Int32* s_code_sel_selCtr\n               = &(s->code[s->selector[selCtr]][0]);\n\n#           define BZ_ITAH(nn)                      \\\n               mtfv_i = mtfv[gs+(nn)];              \\\n               bsW ( s,                             \\\n                     s_len_sel_selCtr[mtfv_i],      \\\n                     s_code_sel_selCtr[mtfv_i] )\n\n            BZ_ITAH(0);  BZ_ITAH(1);  BZ_ITAH(2);  BZ_ITAH(3);  BZ_ITAH(4);\n            BZ_ITAH(5);  BZ_ITAH(6);  BZ_ITAH(7);  BZ_ITAH(8);  BZ_ITAH(9);\n            BZ_ITAH(10); BZ_ITAH(11); BZ_ITAH(12); BZ_ITAH(13); BZ_ITAH(14);\n            BZ_ITAH(15); BZ_ITAH(16); BZ_ITAH(17); BZ_ITAH(18); BZ_ITAH(19);\n            BZ_ITAH(20); BZ_ITAH(21); BZ_ITAH(22); BZ_ITAH(23); BZ_ITAH(24);\n            BZ_ITAH(25); BZ_ITAH(26); BZ_ITAH(27); BZ_ITAH(28); BZ_ITAH(29);\n            BZ_ITAH(30); BZ_ITAH(31); BZ_ITAH(32); BZ_ITAH(33); BZ_ITAH(34);\n            BZ_ITAH(35); BZ_ITAH(36); BZ_ITAH(37); BZ_ITAH(38); BZ_ITAH(39);\n            BZ_ITAH(40); BZ_ITAH(41); BZ_ITAH(42); BZ_ITAH(43); BZ_ITAH(44);\n            BZ_ITAH(45); BZ_ITAH(46); BZ_ITAH(47); BZ_ITAH(48); BZ_ITAH(49);\n\n#           undef BZ_ITAH\n\n      } else {\n\t /*--- slow version which correctly handles all situations ---*/\n         for (i = gs; i <= ge; i++) {\n            bsW ( s, \n                  s->len  [s->selector[selCtr]] [mtfv[i]],\n                  s->code [s->selector[selCtr]] [mtfv[i]] );\n         }\n      }\n\n\n      gs = ge+1;\n      selCtr++;\n   }\n   AssertH( selCtr == nSelectors, 3007 );\n\n   if (s->verbosity >= 3)\n      VPrintf1( \"codes %d\\n\", s->numZ-nBytes );\n}\n\n\n/*---------------------------------------------------*/\nvoid BZ2_compressBlock ( EState* s, Bool is_last_block )\n{\n   if (s->nblock > 0) {\n\n      BZ_FINALISE_CRC ( s->blockCRC );\n      s->combinedCRC = (s->combinedCRC << 1) | (s->combinedCRC >> 31);\n      s->combinedCRC ^= s->blockCRC;\n      if (s->blockNo > 1) s->numZ = 0;\n\n      if (s->verbosity >= 2)\n         VPrintf4( \"    block %d: crc = 0x%08x, \"\n                   \"combined CRC = 0x%08x, size = %d\\n\",\n                   s->blockNo, s->blockCRC, s->combinedCRC, s->nblock );\n\n      BZ2_blockSort ( s );\n   }\n\n   s->zbits = (UChar*) (&((UChar*)s->arr2)[s->nblock]);\n\n   /*-- If this is the first block, create the stream header. --*/\n   if (s->blockNo == 1) {\n      BZ2_bsInitWrite ( s );\n      bsPutUChar ( s, BZ_HDR_B );\n      bsPutUChar ( s, BZ_HDR_Z );\n      bsPutUChar ( s, BZ_HDR_h );\n      bsPutUChar ( s, (UChar)(BZ_HDR_0 + s->blockSize100k) );\n   }\n\n   if (s->nblock > 0) {\n\n      bsPutUChar ( s, 0x31 ); bsPutUChar ( s, 0x41 );\n      bsPutUChar ( s, 0x59 ); bsPutUChar ( s, 0x26 );\n      bsPutUChar ( s, 0x53 ); bsPutUChar ( s, 0x59 );\n\n      /*-- Now the block's CRC, so it is in a known place. --*/\n      bsPutUInt32 ( s, s->blockCRC );\n\n      /*-- \n         Now a single bit indicating (non-)randomisation. \n         As of version 0.9.5, we use a better sorting algorithm\n         which makes randomisation unnecessary.  So always set\n         the randomised bit to 'no'.  Of course, the decoder\n         still needs to be able to handle randomised blocks\n         so as to maintain backwards compatibility with\n         older versions of bzip2.\n      --*/\n      bsW(s,1,0);\n\n      bsW ( s, 24, s->origPtr );\n      generateMTFValues ( s );\n      sendMTFValues ( s );\n   }\n\n\n   /*-- If this is the last block, add the stream trailer. --*/\n   if (is_last_block) {\n\n      bsPutUChar ( s, 0x17 ); bsPutUChar ( s, 0x72 );\n      bsPutUChar ( s, 0x45 ); bsPutUChar ( s, 0x38 );\n      bsPutUChar ( s, 0x50 ); bsPutUChar ( s, 0x90 );\n      bsPutUInt32 ( s, s->combinedCRC );\n      if (s->verbosity >= 2)\n         VPrintf1( \"    final combined CRC = 0x%08x\\n   \", s->combinedCRC );\n      bsFinishWrite ( s );\n   }\n}\n\n\n/*-------------------------------------------------------------*/\n/*--- end                                        compress.c ---*/\n/*-------------------------------------------------------------*/\n"
  },
  {
    "path": "ext/bzip2/crctable.c",
    "content": "\n/*-------------------------------------------------------------*/\n/*--- Table for doing CRCs                                  ---*/\n/*---                                            crctable.c ---*/\n/*-------------------------------------------------------------*/\n\n/* ------------------------------------------------------------------\n   This file is part of bzip2/libbzip2, a program and library for\n   lossless, block-sorting data compression.\n\n   bzip2/libbzip2 version 1.0.6 of 6 September 2010\n   Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>\n\n   Please read the WARNING, DISCLAIMER and PATENTS sections in the \n   README file.\n\n   This program is released under the terms of the license contained\n   in the file LICENSE.\n   ------------------------------------------------------------------ */\n\n\n#include \"bzlib_private.h\"\n\n/*--\n  I think this is an implementation of the AUTODIN-II,\n  Ethernet & FDDI 32-bit CRC standard.  Vaguely derived\n  from code by Rob Warnock, in Section 51 of the\n  comp.compression FAQ.\n--*/\n\nUInt32 BZ2_crc32Table[256] = {\n\n   /*-- Ugly, innit? --*/\n\n   0x00000000L, 0x04c11db7L, 0x09823b6eL, 0x0d4326d9L,\n   0x130476dcL, 0x17c56b6bL, 0x1a864db2L, 0x1e475005L,\n   0x2608edb8L, 0x22c9f00fL, 0x2f8ad6d6L, 0x2b4bcb61L,\n   0x350c9b64L, 0x31cd86d3L, 0x3c8ea00aL, 0x384fbdbdL,\n   0x4c11db70L, 0x48d0c6c7L, 0x4593e01eL, 0x4152fda9L,\n   0x5f15adacL, 0x5bd4b01bL, 0x569796c2L, 0x52568b75L,\n   0x6a1936c8L, 0x6ed82b7fL, 0x639b0da6L, 0x675a1011L,\n   0x791d4014L, 0x7ddc5da3L, 0x709f7b7aL, 0x745e66cdL,\n   0x9823b6e0L, 0x9ce2ab57L, 0x91a18d8eL, 0x95609039L,\n   0x8b27c03cL, 0x8fe6dd8bL, 0x82a5fb52L, 0x8664e6e5L,\n   0xbe2b5b58L, 0xbaea46efL, 0xb7a96036L, 0xb3687d81L,\n   0xad2f2d84L, 0xa9ee3033L, 0xa4ad16eaL, 0xa06c0b5dL,\n   0xd4326d90L, 0xd0f37027L, 0xddb056feL, 0xd9714b49L,\n   0xc7361b4cL, 0xc3f706fbL, 0xceb42022L, 0xca753d95L,\n   0xf23a8028L, 0xf6fb9d9fL, 0xfbb8bb46L, 0xff79a6f1L,\n   0xe13ef6f4L, 0xe5ffeb43L, 0xe8bccd9aL, 0xec7dd02dL,\n   0x34867077L, 0x30476dc0L, 0x3d044b19L, 0x39c556aeL,\n   0x278206abL, 0x23431b1cL, 0x2e003dc5L, 0x2ac12072L,\n   0x128e9dcfL, 0x164f8078L, 0x1b0ca6a1L, 0x1fcdbb16L,\n   0x018aeb13L, 0x054bf6a4L, 0x0808d07dL, 0x0cc9cdcaL,\n   0x7897ab07L, 0x7c56b6b0L, 0x71159069L, 0x75d48ddeL,\n   0x6b93dddbL, 0x6f52c06cL, 0x6211e6b5L, 0x66d0fb02L,\n   0x5e9f46bfL, 0x5a5e5b08L, 0x571d7dd1L, 0x53dc6066L,\n   0x4d9b3063L, 0x495a2dd4L, 0x44190b0dL, 0x40d816baL,\n   0xaca5c697L, 0xa864db20L, 0xa527fdf9L, 0xa1e6e04eL,\n   0xbfa1b04bL, 0xbb60adfcL, 0xb6238b25L, 0xb2e29692L,\n   0x8aad2b2fL, 0x8e6c3698L, 0x832f1041L, 0x87ee0df6L,\n   0x99a95df3L, 0x9d684044L, 0x902b669dL, 0x94ea7b2aL,\n   0xe0b41de7L, 0xe4750050L, 0xe9362689L, 0xedf73b3eL,\n   0xf3b06b3bL, 0xf771768cL, 0xfa325055L, 0xfef34de2L,\n   0xc6bcf05fL, 0xc27dede8L, 0xcf3ecb31L, 0xcbffd686L,\n   0xd5b88683L, 0xd1799b34L, 0xdc3abdedL, 0xd8fba05aL,\n   0x690ce0eeL, 0x6dcdfd59L, 0x608edb80L, 0x644fc637L,\n   0x7a089632L, 0x7ec98b85L, 0x738aad5cL, 0x774bb0ebL,\n   0x4f040d56L, 0x4bc510e1L, 0x46863638L, 0x42472b8fL,\n   0x5c007b8aL, 0x58c1663dL, 0x558240e4L, 0x51435d53L,\n   0x251d3b9eL, 0x21dc2629L, 0x2c9f00f0L, 0x285e1d47L,\n   0x36194d42L, 0x32d850f5L, 0x3f9b762cL, 0x3b5a6b9bL,\n   0x0315d626L, 0x07d4cb91L, 0x0a97ed48L, 0x0e56f0ffL,\n   0x1011a0faL, 0x14d0bd4dL, 0x19939b94L, 0x1d528623L,\n   0xf12f560eL, 0xf5ee4bb9L, 0xf8ad6d60L, 0xfc6c70d7L,\n   0xe22b20d2L, 0xe6ea3d65L, 0xeba91bbcL, 0xef68060bL,\n   0xd727bbb6L, 0xd3e6a601L, 0xdea580d8L, 0xda649d6fL,\n   0xc423cd6aL, 0xc0e2d0ddL, 0xcda1f604L, 0xc960ebb3L,\n   0xbd3e8d7eL, 0xb9ff90c9L, 0xb4bcb610L, 0xb07daba7L,\n   0xae3afba2L, 0xaafbe615L, 0xa7b8c0ccL, 0xa379dd7bL,\n   0x9b3660c6L, 0x9ff77d71L, 0x92b45ba8L, 0x9675461fL,\n   0x8832161aL, 0x8cf30badL, 0x81b02d74L, 0x857130c3L,\n   0x5d8a9099L, 0x594b8d2eL, 0x5408abf7L, 0x50c9b640L,\n   0x4e8ee645L, 0x4a4ffbf2L, 0x470cdd2bL, 0x43cdc09cL,\n   0x7b827d21L, 0x7f436096L, 0x7200464fL, 0x76c15bf8L,\n   0x68860bfdL, 0x6c47164aL, 0x61043093L, 0x65c52d24L,\n   0x119b4be9L, 0x155a565eL, 0x18197087L, 0x1cd86d30L,\n   0x029f3d35L, 0x065e2082L, 0x0b1d065bL, 0x0fdc1becL,\n   0x3793a651L, 0x3352bbe6L, 0x3e119d3fL, 0x3ad08088L,\n   0x2497d08dL, 0x2056cd3aL, 0x2d15ebe3L, 0x29d4f654L,\n   0xc5a92679L, 0xc1683bceL, 0xcc2b1d17L, 0xc8ea00a0L,\n   0xd6ad50a5L, 0xd26c4d12L, 0xdf2f6bcbL, 0xdbee767cL,\n   0xe3a1cbc1L, 0xe760d676L, 0xea23f0afL, 0xeee2ed18L,\n   0xf0a5bd1dL, 0xf464a0aaL, 0xf9278673L, 0xfde69bc4L,\n   0x89b8fd09L, 0x8d79e0beL, 0x803ac667L, 0x84fbdbd0L,\n   0x9abc8bd5L, 0x9e7d9662L, 0x933eb0bbL, 0x97ffad0cL,\n   0xafb010b1L, 0xab710d06L, 0xa6322bdfL, 0xa2f33668L,\n   0xbcb4666dL, 0xb8757bdaL, 0xb5365d03L, 0xb1f740b4L\n};\n\n\n/*-------------------------------------------------------------*/\n/*--- end                                        crctable.c ---*/\n/*-------------------------------------------------------------*/\n"
  },
  {
    "path": "ext/bzip2/decompress.c",
    "content": "\n/*-------------------------------------------------------------*/\n/*--- Decompression machinery                               ---*/\n/*---                                          decompress.c ---*/\n/*-------------------------------------------------------------*/\n\n/* ------------------------------------------------------------------\n   This file is part of bzip2/libbzip2, a program and library for\n   lossless, block-sorting data compression.\n\n   bzip2/libbzip2 version 1.0.6 of 6 September 2010\n   Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>\n\n   Please read the WARNING, DISCLAIMER and PATENTS sections in the \n   README file.\n\n   This program is released under the terms of the license contained\n   in the file LICENSE.\n   ------------------------------------------------------------------ */\n\n\n#include \"bzlib_private.h\"\n\n\n/*---------------------------------------------------*/\nstatic\nvoid makeMaps_d ( DState* s )\n{\n   Int32 i;\n   s->nInUse = 0;\n   for (i = 0; i < 256; i++)\n      if (s->inUse[i]) {\n         s->seqToUnseq[s->nInUse] = i;\n         s->nInUse++;\n      }\n}\n\n\n/*---------------------------------------------------*/\n#define RETURN(rrr)                               \\\n   { retVal = rrr; goto save_state_and_return; };\n\n#define GET_BITS(lll,vvv,nnn)                     \\\n   case lll: s->state = lll;                      \\\n   while (True) {                                 \\\n      if (s->bsLive >= nnn) {                     \\\n         UInt32 v;                                \\\n         v = (s->bsBuff >>                        \\\n             (s->bsLive-nnn)) & ((1 << nnn)-1);   \\\n         s->bsLive -= nnn;                        \\\n         vvv = v;                                 \\\n         break;                                   \\\n      }                                           \\\n      if (s->strm->avail_in == 0) RETURN(BZ_OK);  \\\n      s->bsBuff                                   \\\n         = (s->bsBuff << 8) |                     \\\n           ((UInt32)                              \\\n              (*((UChar*)(s->strm->next_in))));   \\\n      s->bsLive += 8;                             \\\n      s->strm->next_in++;                         \\\n      s->strm->avail_in--;                        \\\n      s->strm->total_in_lo32++;                   \\\n      if (s->strm->total_in_lo32 == 0)            \\\n         s->strm->total_in_hi32++;                \\\n   }\n\n#define GET_UCHAR(lll,uuu)                        \\\n   GET_BITS(lll,uuu,8)\n\n#define GET_BIT(lll,uuu)                          \\\n   GET_BITS(lll,uuu,1)\n\n/*---------------------------------------------------*/\n#define GET_MTF_VAL(label1,label2,lval)           \\\n{                                                 \\\n   if (groupPos == 0) {                           \\\n      groupNo++;                                  \\\n      if (groupNo >= nSelectors)                  \\\n         RETURN(BZ_DATA_ERROR);                   \\\n      groupPos = BZ_G_SIZE;                       \\\n      gSel = s->selector[groupNo];                \\\n      gMinlen = s->minLens[gSel];                 \\\n      gLimit = &(s->limit[gSel][0]);              \\\n      gPerm = &(s->perm[gSel][0]);                \\\n      gBase = &(s->base[gSel][0]);                \\\n   }                                              \\\n   groupPos--;                                    \\\n   zn = gMinlen;                                  \\\n   GET_BITS(label1, zvec, zn);                    \\\n   while (1) {                                    \\\n      if (zn > 20 /* the longest code */)         \\\n         RETURN(BZ_DATA_ERROR);                   \\\n      if (zvec <= gLimit[zn]) break;              \\\n      zn++;                                       \\\n      GET_BIT(label2, zj);                        \\\n      zvec = (zvec << 1) | zj;                    \\\n   };                                             \\\n   if (zvec - gBase[zn] < 0                       \\\n       || zvec - gBase[zn] >= BZ_MAX_ALPHA_SIZE)  \\\n      RETURN(BZ_DATA_ERROR);                      \\\n   lval = gPerm[zvec - gBase[zn]];                \\\n}\n\n\n/*---------------------------------------------------*/\nInt32 BZ2_decompress ( DState* s )\n{\n   UChar      uc;\n   Int32      retVal;\n   Int32      minLen, maxLen;\n   bz_stream* strm = s->strm;\n\n   /* stuff that needs to be saved/restored */\n   Int32  i;\n   Int32  j;\n   Int32  t;\n   Int32  alphaSize;\n   Int32  nGroups;\n   Int32  nSelectors;\n   Int32  EOB;\n   Int32  groupNo;\n   Int32  groupPos;\n   Int32  nextSym;\n   Int32  nblockMAX;\n   Int32  nblock;\n   Int32  es;\n   Int32  N;\n   Int32  curr;\n   Int32  zt;\n   Int32  zn; \n   Int32  zvec;\n   Int32  zj;\n   Int32  gSel;\n   Int32  gMinlen;\n   Int32* gLimit;\n   Int32* gBase;\n   Int32* gPerm;\n\n   if (s->state == BZ_X_MAGIC_1) {\n      /*initialise the save area*/\n      s->save_i           = 0;\n      s->save_j           = 0;\n      s->save_t           = 0;\n      s->save_alphaSize   = 0;\n      s->save_nGroups     = 0;\n      s->save_nSelectors  = 0;\n      s->save_EOB         = 0;\n      s->save_groupNo     = 0;\n      s->save_groupPos    = 0;\n      s->save_nextSym     = 0;\n      s->save_nblockMAX   = 0;\n      s->save_nblock      = 0;\n      s->save_es          = 0;\n      s->save_N           = 0;\n      s->save_curr        = 0;\n      s->save_zt          = 0;\n      s->save_zn          = 0;\n      s->save_zvec        = 0;\n      s->save_zj          = 0;\n      s->save_gSel        = 0;\n      s->save_gMinlen     = 0;\n      s->save_gLimit      = NULL;\n      s->save_gBase       = NULL;\n      s->save_gPerm       = NULL;\n   }\n\n   /*restore from the save area*/\n   i           = s->save_i;\n   j           = s->save_j;\n   t           = s->save_t;\n   alphaSize   = s->save_alphaSize;\n   nGroups     = s->save_nGroups;\n   nSelectors  = s->save_nSelectors;\n   EOB         = s->save_EOB;\n   groupNo     = s->save_groupNo;\n   groupPos    = s->save_groupPos;\n   nextSym     = s->save_nextSym;\n   nblockMAX   = s->save_nblockMAX;\n   nblock      = s->save_nblock;\n   es          = s->save_es;\n   N           = s->save_N;\n   curr        = s->save_curr;\n   zt          = s->save_zt;\n   zn          = s->save_zn; \n   zvec        = s->save_zvec;\n   zj          = s->save_zj;\n   gSel        = s->save_gSel;\n   gMinlen     = s->save_gMinlen;\n   gLimit      = s->save_gLimit;\n   gBase       = s->save_gBase;\n   gPerm       = s->save_gPerm;\n\n   retVal = BZ_OK;\n\n   switch (s->state) {\n\n      GET_UCHAR(BZ_X_MAGIC_1, uc);\n      if (uc != BZ_HDR_B) RETURN(BZ_DATA_ERROR_MAGIC);\n\n      GET_UCHAR(BZ_X_MAGIC_2, uc);\n      if (uc != BZ_HDR_Z) RETURN(BZ_DATA_ERROR_MAGIC);\n\n      GET_UCHAR(BZ_X_MAGIC_3, uc)\n      if (uc != BZ_HDR_h) RETURN(BZ_DATA_ERROR_MAGIC);\n\n      GET_BITS(BZ_X_MAGIC_4, s->blockSize100k, 8)\n      if (s->blockSize100k < (BZ_HDR_0 + 1) || \n          s->blockSize100k > (BZ_HDR_0 + 9)) RETURN(BZ_DATA_ERROR_MAGIC);\n      s->blockSize100k -= BZ_HDR_0;\n\n      if (s->smallDecompress) {\n         s->ll16 = BZALLOC( s->blockSize100k * 100000 * sizeof(UInt16) );\n         s->ll4  = BZALLOC( \n                      ((1 + s->blockSize100k * 100000) >> 1) * sizeof(UChar) \n                   );\n         if (s->ll16 == NULL || s->ll4 == NULL) RETURN(BZ_MEM_ERROR);\n      } else {\n         s->tt  = BZALLOC( s->blockSize100k * 100000 * sizeof(Int32) );\n         if (s->tt == NULL) RETURN(BZ_MEM_ERROR);\n      }\n\n      GET_UCHAR(BZ_X_BLKHDR_1, uc);\n\n      if (uc == 0x17) goto endhdr_2;\n      if (uc != 0x31) RETURN(BZ_DATA_ERROR);\n      GET_UCHAR(BZ_X_BLKHDR_2, uc);\n      if (uc != 0x41) RETURN(BZ_DATA_ERROR);\n      GET_UCHAR(BZ_X_BLKHDR_3, uc);\n      if (uc != 0x59) RETURN(BZ_DATA_ERROR);\n      GET_UCHAR(BZ_X_BLKHDR_4, uc);\n      if (uc != 0x26) RETURN(BZ_DATA_ERROR);\n      GET_UCHAR(BZ_X_BLKHDR_5, uc);\n      if (uc != 0x53) RETURN(BZ_DATA_ERROR);\n      GET_UCHAR(BZ_X_BLKHDR_6, uc);\n      if (uc != 0x59) RETURN(BZ_DATA_ERROR);\n\n      s->currBlockNo++;\n      if (s->verbosity >= 2)\n         VPrintf1 ( \"\\n    [%d: huff+mtf \", s->currBlockNo );\n \n      s->storedBlockCRC = 0;\n      GET_UCHAR(BZ_X_BCRC_1, uc);\n      s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);\n      GET_UCHAR(BZ_X_BCRC_2, uc);\n      s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);\n      GET_UCHAR(BZ_X_BCRC_3, uc);\n      s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);\n      GET_UCHAR(BZ_X_BCRC_4, uc);\n      s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);\n\n      GET_BITS(BZ_X_RANDBIT, s->blockRandomised, 1);\n\n      s->origPtr = 0;\n      GET_UCHAR(BZ_X_ORIGPTR_1, uc);\n      s->origPtr = (s->origPtr << 8) | ((Int32)uc);\n      GET_UCHAR(BZ_X_ORIGPTR_2, uc);\n      s->origPtr = (s->origPtr << 8) | ((Int32)uc);\n      GET_UCHAR(BZ_X_ORIGPTR_3, uc);\n      s->origPtr = (s->origPtr << 8) | ((Int32)uc);\n\n      if (s->origPtr < 0)\n         RETURN(BZ_DATA_ERROR);\n      if (s->origPtr > 10 + 100000*s->blockSize100k) \n         RETURN(BZ_DATA_ERROR);\n\n      /*--- Receive the mapping table ---*/\n      for (i = 0; i < 16; i++) {\n         GET_BIT(BZ_X_MAPPING_1, uc);\n         if (uc == 1) \n            s->inUse16[i] = True; else \n            s->inUse16[i] = False;\n      }\n\n      for (i = 0; i < 256; i++) s->inUse[i] = False;\n\n      for (i = 0; i < 16; i++)\n         if (s->inUse16[i])\n            for (j = 0; j < 16; j++) {\n               GET_BIT(BZ_X_MAPPING_2, uc);\n               if (uc == 1) s->inUse[i * 16 + j] = True;\n            }\n      makeMaps_d ( s );\n      if (s->nInUse == 0) RETURN(BZ_DATA_ERROR);\n      alphaSize = s->nInUse+2;\n\n      /*--- Now the selectors ---*/\n      GET_BITS(BZ_X_SELECTOR_1, nGroups, 3);\n      if (nGroups < 2 || nGroups > 6) RETURN(BZ_DATA_ERROR);\n      GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15);\n      if (nSelectors < 1) RETURN(BZ_DATA_ERROR);\n      for (i = 0; i < nSelectors; i++) {\n         j = 0;\n         while (True) {\n            GET_BIT(BZ_X_SELECTOR_3, uc);\n            if (uc == 0) break;\n            j++;\n            if (j >= nGroups) RETURN(BZ_DATA_ERROR);\n         }\n         s->selectorMtf[i] = j;\n      }\n\n      /*--- Undo the MTF values for the selectors. ---*/\n      {\n         UChar pos[BZ_N_GROUPS], tmp, v;\n         for (v = 0; v < nGroups; v++) pos[v] = v;\n   \n         for (i = 0; i < nSelectors; i++) {\n            v = s->selectorMtf[i];\n            tmp = pos[v];\n            while (v > 0) { pos[v] = pos[v-1]; v--; }\n            pos[0] = tmp;\n            s->selector[i] = tmp;\n         }\n      }\n\n      /*--- Now the coding tables ---*/\n      for (t = 0; t < nGroups; t++) {\n         GET_BITS(BZ_X_CODING_1, curr, 5);\n         for (i = 0; i < alphaSize; i++) {\n            while (True) {\n               if (curr < 1 || curr > 20) RETURN(BZ_DATA_ERROR);\n               GET_BIT(BZ_X_CODING_2, uc);\n               if (uc == 0) break;\n               GET_BIT(BZ_X_CODING_3, uc);\n               if (uc == 0) curr++; else curr--;\n            }\n            s->len[t][i] = curr;\n         }\n      }\n\n      /*--- Create the Huffman decoding tables ---*/\n      for (t = 0; t < nGroups; t++) {\n         minLen = 32;\n         maxLen = 0;\n         for (i = 0; i < alphaSize; i++) {\n            if (s->len[t][i] > maxLen) maxLen = s->len[t][i];\n            if (s->len[t][i] < minLen) minLen = s->len[t][i];\n         }\n         BZ2_hbCreateDecodeTables ( \n            &(s->limit[t][0]), \n            &(s->base[t][0]), \n            &(s->perm[t][0]), \n            &(s->len[t][0]),\n            minLen, maxLen, alphaSize\n         );\n         s->minLens[t] = minLen;\n      }\n\n      /*--- Now the MTF values ---*/\n\n      EOB      = s->nInUse+1;\n      nblockMAX = 100000 * s->blockSize100k;\n      groupNo  = -1;\n      groupPos = 0;\n\n      for (i = 0; i <= 255; i++) s->unzftab[i] = 0;\n\n      /*-- MTF init --*/\n      {\n         Int32 ii, jj, kk;\n         kk = MTFA_SIZE-1;\n         for (ii = 256 / MTFL_SIZE - 1; ii >= 0; ii--) {\n            for (jj = MTFL_SIZE-1; jj >= 0; jj--) {\n               s->mtfa[kk] = (UChar)(ii * MTFL_SIZE + jj);\n               kk--;\n            }\n            s->mtfbase[ii] = kk + 1;\n         }\n      }\n      /*-- end MTF init --*/\n\n      nblock = 0;\n      GET_MTF_VAL(BZ_X_MTF_1, BZ_X_MTF_2, nextSym);\n\n      while (True) {\n\n         if (nextSym == EOB) break;\n\n         if (nextSym == BZ_RUNA || nextSym == BZ_RUNB) {\n\n            es = -1;\n            N = 1;\n            do {\n               /* Check that N doesn't get too big, so that es doesn't\n                  go negative.  The maximum value that can be\n                  RUNA/RUNB encoded is equal to the block size (post\n                  the initial RLE), viz, 900k, so bounding N at 2\n                  million should guard against overflow without\n                  rejecting any legitimate inputs. */\n               if (N >= 2*1024*1024) RETURN(BZ_DATA_ERROR);\n               if (nextSym == BZ_RUNA) es = es + (0+1) * N; else\n               if (nextSym == BZ_RUNB) es = es + (1+1) * N;\n               N = N * 2;\n               GET_MTF_VAL(BZ_X_MTF_3, BZ_X_MTF_4, nextSym);\n            }\n               while (nextSym == BZ_RUNA || nextSym == BZ_RUNB);\n\n            es++;\n            uc = s->seqToUnseq[ s->mtfa[s->mtfbase[0]] ];\n            s->unzftab[uc] += es;\n\n            if (s->smallDecompress)\n               while (es > 0) {\n                  if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR);\n                  s->ll16[nblock] = (UInt16)uc;\n                  nblock++;\n                  es--;\n               }\n            else\n               while (es > 0) {\n                  if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR);\n                  s->tt[nblock] = (UInt32)uc;\n                  nblock++;\n                  es--;\n               };\n\n            continue;\n\n         } else {\n\n            if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR);\n\n            /*-- uc = MTF ( nextSym-1 ) --*/\n            {\n               Int32 ii, jj, kk, pp, lno, off;\n               UInt32 nn;\n               nn = (UInt32)(nextSym - 1);\n\n               if (nn < MTFL_SIZE) {\n                  /* avoid general-case expense */\n                  pp = s->mtfbase[0];\n                  uc = s->mtfa[pp+nn];\n                  while (nn > 3) {\n                     Int32 z = pp+nn;\n                     s->mtfa[(z)  ] = s->mtfa[(z)-1];\n                     s->mtfa[(z)-1] = s->mtfa[(z)-2];\n                     s->mtfa[(z)-2] = s->mtfa[(z)-3];\n                     s->mtfa[(z)-3] = s->mtfa[(z)-4];\n                     nn -= 4;\n                  }\n                  while (nn > 0) { \n                     s->mtfa[(pp+nn)] = s->mtfa[(pp+nn)-1]; nn--; \n                  };\n                  s->mtfa[pp] = uc;\n               } else { \n                  /* general case */\n                  lno = nn / MTFL_SIZE;\n                  off = nn % MTFL_SIZE;\n                  pp = s->mtfbase[lno] + off;\n                  uc = s->mtfa[pp];\n                  while (pp > s->mtfbase[lno]) { \n                     s->mtfa[pp] = s->mtfa[pp-1]; pp--; \n                  };\n                  s->mtfbase[lno]++;\n                  while (lno > 0) {\n                     s->mtfbase[lno]--;\n                     s->mtfa[s->mtfbase[lno]] \n                        = s->mtfa[s->mtfbase[lno-1] + MTFL_SIZE - 1];\n                     lno--;\n                  }\n                  s->mtfbase[0]--;\n                  s->mtfa[s->mtfbase[0]] = uc;\n                  if (s->mtfbase[0] == 0) {\n                     kk = MTFA_SIZE-1;\n                     for (ii = 256 / MTFL_SIZE-1; ii >= 0; ii--) {\n                        for (jj = MTFL_SIZE-1; jj >= 0; jj--) {\n                           s->mtfa[kk] = s->mtfa[s->mtfbase[ii] + jj];\n                           kk--;\n                        }\n                        s->mtfbase[ii] = kk + 1;\n                     }\n                  }\n               }\n            }\n            /*-- end uc = MTF ( nextSym-1 ) --*/\n\n            s->unzftab[s->seqToUnseq[uc]]++;\n            if (s->smallDecompress)\n               s->ll16[nblock] = (UInt16)(s->seqToUnseq[uc]); else\n               s->tt[nblock]   = (UInt32)(s->seqToUnseq[uc]);\n            nblock++;\n\n            GET_MTF_VAL(BZ_X_MTF_5, BZ_X_MTF_6, nextSym);\n            continue;\n         }\n      }\n\n      /* Now we know what nblock is, we can do a better sanity\n         check on s->origPtr.\n      */\n      if (s->origPtr < 0 || s->origPtr >= nblock)\n         RETURN(BZ_DATA_ERROR);\n\n      /*-- Set up cftab to facilitate generation of T^(-1) --*/\n      /* Check: unzftab entries in range. */\n      for (i = 0; i <= 255; i++) {\n         if (s->unzftab[i] < 0 || s->unzftab[i] > nblock)\n            RETURN(BZ_DATA_ERROR);\n      }\n      /* Actually generate cftab. */\n      s->cftab[0] = 0;\n      for (i = 1; i <= 256; i++) s->cftab[i] = s->unzftab[i-1];\n      for (i = 1; i <= 256; i++) s->cftab[i] += s->cftab[i-1];\n      /* Check: cftab entries in range. */\n      for (i = 0; i <= 256; i++) {\n         if (s->cftab[i] < 0 || s->cftab[i] > nblock) {\n            /* s->cftab[i] can legitimately be == nblock */\n            RETURN(BZ_DATA_ERROR);\n         }\n      }\n      /* Check: cftab entries non-descending. */\n      for (i = 1; i <= 256; i++) {\n         if (s->cftab[i-1] > s->cftab[i]) {\n            RETURN(BZ_DATA_ERROR);\n         }\n      }\n\n      s->state_out_len = 0;\n      s->state_out_ch  = 0;\n      BZ_INITIALISE_CRC ( s->calculatedBlockCRC );\n      s->state = BZ_X_OUTPUT;\n      if (s->verbosity >= 2) VPrintf0 ( \"rt+rld\" );\n\n      if (s->smallDecompress) {\n\n         /*-- Make a copy of cftab, used in generation of T --*/\n         for (i = 0; i <= 256; i++) s->cftabCopy[i] = s->cftab[i];\n\n         /*-- compute the T vector --*/\n         for (i = 0; i < nblock; i++) {\n            uc = (UChar)(s->ll16[i]);\n            SET_LL(i, s->cftabCopy[uc]);\n            s->cftabCopy[uc]++;\n         }\n\n         /*-- Compute T^(-1) by pointer reversal on T --*/\n         i = s->origPtr;\n         j = GET_LL(i);\n         do {\n            Int32 tmp = GET_LL(j);\n            SET_LL(j, i);\n            i = j;\n            j = tmp;\n         }\n            while (i != s->origPtr);\n\n         s->tPos = s->origPtr;\n         s->nblock_used = 0;\n         if (s->blockRandomised) {\n            BZ_RAND_INIT_MASK;\n            BZ_GET_SMALL(s->k0); s->nblock_used++;\n            BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK; \n         } else {\n            BZ_GET_SMALL(s->k0); s->nblock_used++;\n         }\n\n      } else {\n\n         /*-- compute the T^(-1) vector --*/\n         for (i = 0; i < nblock; i++) {\n            uc = (UChar)(s->tt[i] & 0xff);\n            s->tt[s->cftab[uc]] |= (i << 8);\n            s->cftab[uc]++;\n         }\n\n         s->tPos = s->tt[s->origPtr] >> 8;\n         s->nblock_used = 0;\n         if (s->blockRandomised) {\n            BZ_RAND_INIT_MASK;\n            BZ_GET_FAST(s->k0); s->nblock_used++;\n            BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK; \n         } else {\n            BZ_GET_FAST(s->k0); s->nblock_used++;\n         }\n\n      }\n\n      RETURN(BZ_OK);\n\n\n\n    endhdr_2:\n\n      GET_UCHAR(BZ_X_ENDHDR_2, uc);\n      if (uc != 0x72) RETURN(BZ_DATA_ERROR);\n      GET_UCHAR(BZ_X_ENDHDR_3, uc);\n      if (uc != 0x45) RETURN(BZ_DATA_ERROR);\n      GET_UCHAR(BZ_X_ENDHDR_4, uc);\n      if (uc != 0x38) RETURN(BZ_DATA_ERROR);\n      GET_UCHAR(BZ_X_ENDHDR_5, uc);\n      if (uc != 0x50) RETURN(BZ_DATA_ERROR);\n      GET_UCHAR(BZ_X_ENDHDR_6, uc);\n      if (uc != 0x90) RETURN(BZ_DATA_ERROR);\n\n      s->storedCombinedCRC = 0;\n      GET_UCHAR(BZ_X_CCRC_1, uc);\n      s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);\n      GET_UCHAR(BZ_X_CCRC_2, uc);\n      s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);\n      GET_UCHAR(BZ_X_CCRC_3, uc);\n      s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);\n      GET_UCHAR(BZ_X_CCRC_4, uc);\n      s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);\n\n      s->state = BZ_X_IDLE;\n      RETURN(BZ_STREAM_END);\n\n      default: AssertH ( False, 4001 );\n   }\n\n   AssertH ( False, 4002 );\n\n   save_state_and_return:\n\n   s->save_i           = i;\n   s->save_j           = j;\n   s->save_t           = t;\n   s->save_alphaSize   = alphaSize;\n   s->save_nGroups     = nGroups;\n   s->save_nSelectors  = nSelectors;\n   s->save_EOB         = EOB;\n   s->save_groupNo     = groupNo;\n   s->save_groupPos    = groupPos;\n   s->save_nextSym     = nextSym;\n   s->save_nblockMAX   = nblockMAX;\n   s->save_nblock      = nblock;\n   s->save_es          = es;\n   s->save_N           = N;\n   s->save_curr        = curr;\n   s->save_zt          = zt;\n   s->save_zn          = zn;\n   s->save_zvec        = zvec;\n   s->save_zj          = zj;\n   s->save_gSel        = gSel;\n   s->save_gMinlen     = gMinlen;\n   s->save_gLimit      = gLimit;\n   s->save_gBase       = gBase;\n   s->save_gPerm       = gPerm;\n\n   return retVal;   \n}\n\n\n/*-------------------------------------------------------------*/\n/*--- end                                      decompress.c ---*/\n/*-------------------------------------------------------------*/\n"
  },
  {
    "path": "ext/bzip2/huffman.c",
    "content": "\n/*-------------------------------------------------------------*/\n/*--- Huffman coding low-level stuff                        ---*/\n/*---                                             huffman.c ---*/\n/*-------------------------------------------------------------*/\n\n/* ------------------------------------------------------------------\n   This file is part of bzip2/libbzip2, a program and library for\n   lossless, block-sorting data compression.\n\n   bzip2/libbzip2 version 1.0.6 of 6 September 2010\n   Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>\n\n   Please read the WARNING, DISCLAIMER and PATENTS sections in the \n   README file.\n\n   This program is released under the terms of the license contained\n   in the file LICENSE.\n   ------------------------------------------------------------------ */\n\n\n#include \"bzlib_private.h\"\n\n/*---------------------------------------------------*/\n#define WEIGHTOF(zz0)  ((zz0) & 0xffffff00)\n#define DEPTHOF(zz1)   ((zz1) & 0x000000ff)\n#define MYMAX(zz2,zz3) ((zz2) > (zz3) ? (zz2) : (zz3))\n\n#define ADDWEIGHTS(zw1,zw2)                           \\\n   (WEIGHTOF(zw1)+WEIGHTOF(zw2)) |                    \\\n   (1 + MYMAX(DEPTHOF(zw1),DEPTHOF(zw2)))\n\n#define UPHEAP(z)                                     \\\n{                                                     \\\n   Int32 zz, tmp;                                     \\\n   zz = z; tmp = heap[zz];                            \\\n   while (weight[tmp] < weight[heap[zz >> 1]]) {      \\\n      heap[zz] = heap[zz >> 1];                       \\\n      zz >>= 1;                                       \\\n   }                                                  \\\n   heap[zz] = tmp;                                    \\\n}\n\n#define DOWNHEAP(z)                                   \\\n{                                                     \\\n   Int32 zz, yy, tmp;                                 \\\n   zz = z; tmp = heap[zz];                            \\\n   while (True) {                                     \\\n      yy = zz << 1;                                   \\\n      if (yy > nHeap) break;                          \\\n      if (yy < nHeap &&                               \\\n          weight[heap[yy+1]] < weight[heap[yy]])      \\\n         yy++;                                        \\\n      if (weight[tmp] < weight[heap[yy]]) break;      \\\n      heap[zz] = heap[yy];                            \\\n      zz = yy;                                        \\\n   }                                                  \\\n   heap[zz] = tmp;                                    \\\n}\n\n\n/*---------------------------------------------------*/\nvoid BZ2_hbMakeCodeLengths ( UChar *len, \n                             Int32 *freq,\n                             Int32 alphaSize,\n                             Int32 maxLen )\n{\n   /*--\n      Nodes and heap entries run from 1.  Entry 0\n      for both the heap and nodes is a sentinel.\n   --*/\n   Int32 nNodes, nHeap, n1, n2, i, j, k;\n   Bool  tooLong;\n\n   Int32 heap   [ BZ_MAX_ALPHA_SIZE + 2 ];\n   Int32 weight [ BZ_MAX_ALPHA_SIZE * 2 ];\n   Int32 parent [ BZ_MAX_ALPHA_SIZE * 2 ]; \n\n   for (i = 0; i < alphaSize; i++)\n      weight[i+1] = (freq[i] == 0 ? 1 : freq[i]) << 8;\n\n   while (True) {\n\n      nNodes = alphaSize;\n      nHeap = 0;\n\n      heap[0] = 0;\n      weight[0] = 0;\n      parent[0] = -2;\n\n      for (i = 1; i <= alphaSize; i++) {\n         parent[i] = -1;\n         nHeap++;\n         heap[nHeap] = i;\n         UPHEAP(nHeap);\n      }\n\n      AssertH( nHeap < (BZ_MAX_ALPHA_SIZE+2), 2001 );\n   \n      while (nHeap > 1) {\n         n1 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1);\n         n2 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1);\n         nNodes++;\n         parent[n1] = parent[n2] = nNodes;\n         weight[nNodes] = ADDWEIGHTS(weight[n1], weight[n2]);\n         parent[nNodes] = -1;\n         nHeap++;\n         heap[nHeap] = nNodes;\n         UPHEAP(nHeap);\n      }\n\n      AssertH( nNodes < (BZ_MAX_ALPHA_SIZE * 2), 2002 );\n\n      tooLong = False;\n      for (i = 1; i <= alphaSize; i++) {\n         j = 0;\n         k = i;\n         while (parent[k] >= 0) { k = parent[k]; j++; }\n         len[i-1] = j;\n         if (j > maxLen) tooLong = True;\n      }\n      \n      if (! tooLong) break;\n\n      /* 17 Oct 04: keep-going condition for the following loop used\n         to be 'i < alphaSize', which missed the last element,\n         theoretically leading to the possibility of the compressor\n         looping.  However, this count-scaling step is only needed if\n         one of the generated Huffman code words is longer than\n         maxLen, which up to and including version 1.0.2 was 20 bits,\n         which is extremely unlikely.  In version 1.0.3 maxLen was\n         changed to 17 bits, which has minimal effect on compression\n         ratio, but does mean this scaling step is used from time to\n         time, enough to verify that it works.\n\n         This means that bzip2-1.0.3 and later will only produce\n         Huffman codes with a maximum length of 17 bits.  However, in\n         order to preserve backwards compatibility with bitstreams\n         produced by versions pre-1.0.3, the decompressor must still\n         handle lengths of up to 20. */\n\n      for (i = 1; i <= alphaSize; i++) {\n         j = weight[i] >> 8;\n         j = 1 + (j / 2);\n         weight[i] = j << 8;\n      }\n   }\n}\n\n\n/*---------------------------------------------------*/\nvoid BZ2_hbAssignCodes ( Int32 *code,\n                         UChar *length,\n                         Int32 minLen,\n                         Int32 maxLen,\n                         Int32 alphaSize )\n{\n   Int32 n, vec, i;\n\n   vec = 0;\n   for (n = minLen; n <= maxLen; n++) {\n      for (i = 0; i < alphaSize; i++)\n         if (length[i] == n) { code[i] = vec; vec++; };\n      vec <<= 1;\n   }\n}\n\n\n/*---------------------------------------------------*/\nvoid BZ2_hbCreateDecodeTables ( Int32 *limit,\n                                Int32 *base,\n                                Int32 *perm,\n                                UChar *length,\n                                Int32 minLen,\n                                Int32 maxLen,\n                                Int32 alphaSize )\n{\n   Int32 pp, i, j, vec;\n\n   pp = 0;\n   for (i = minLen; i <= maxLen; i++)\n      for (j = 0; j < alphaSize; j++)\n         if (length[j] == i) { perm[pp] = j; pp++; };\n\n   for (i = 0; i < BZ_MAX_CODE_LEN; i++) base[i] = 0;\n   for (i = 0; i < alphaSize; i++) base[length[i]+1]++;\n\n   for (i = 1; i < BZ_MAX_CODE_LEN; i++) base[i] += base[i-1];\n\n   for (i = 0; i < BZ_MAX_CODE_LEN; i++) limit[i] = 0;\n   vec = 0;\n\n   for (i = minLen; i <= maxLen; i++) {\n      vec += (base[i+1] - base[i]);\n      limit[i] = vec-1;\n      vec <<= 1;\n   }\n   for (i = minLen + 1; i <= maxLen; i++)\n      base[i] = ((limit[i-1] + 1) << 1) - base[i];\n}\n\n\n/*-------------------------------------------------------------*/\n/*--- end                                         huffman.c ---*/\n/*-------------------------------------------------------------*/\n"
  },
  {
    "path": "ext/bzip2/randtable.c",
    "content": "\n/*-------------------------------------------------------------*/\n/*--- Table for randomising repetitive blocks               ---*/\n/*---                                           randtable.c ---*/\n/*-------------------------------------------------------------*/\n\n/* ------------------------------------------------------------------\n   This file is part of bzip2/libbzip2, a program and library for\n   lossless, block-sorting data compression.\n\n   bzip2/libbzip2 version 1.0.6 of 6 September 2010\n   Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>\n\n   Please read the WARNING, DISCLAIMER and PATENTS sections in the \n   README file.\n\n   This program is released under the terms of the license contained\n   in the file LICENSE.\n   ------------------------------------------------------------------ */\n\n\n#include \"bzlib_private.h\"\n\n\n/*---------------------------------------------*/\nInt32 BZ2_rNums[512] = { \n   619, 720, 127, 481, 931, 816, 813, 233, 566, 247, \n   985, 724, 205, 454, 863, 491, 741, 242, 949, 214, \n   733, 859, 335, 708, 621, 574, 73, 654, 730, 472, \n   419, 436, 278, 496, 867, 210, 399, 680, 480, 51, \n   878, 465, 811, 169, 869, 675, 611, 697, 867, 561, \n   862, 687, 507, 283, 482, 129, 807, 591, 733, 623, \n   150, 238, 59, 379, 684, 877, 625, 169, 643, 105, \n   170, 607, 520, 932, 727, 476, 693, 425, 174, 647, \n   73, 122, 335, 530, 442, 853, 695, 249, 445, 515, \n   909, 545, 703, 919, 874, 474, 882, 500, 594, 612, \n   641, 801, 220, 162, 819, 984, 589, 513, 495, 799, \n   161, 604, 958, 533, 221, 400, 386, 867, 600, 782, \n   382, 596, 414, 171, 516, 375, 682, 485, 911, 276, \n   98, 553, 163, 354, 666, 933, 424, 341, 533, 870, \n   227, 730, 475, 186, 263, 647, 537, 686, 600, 224, \n   469, 68, 770, 919, 190, 373, 294, 822, 808, 206, \n   184, 943, 795, 384, 383, 461, 404, 758, 839, 887, \n   715, 67, 618, 276, 204, 918, 873, 777, 604, 560, \n   951, 160, 578, 722, 79, 804, 96, 409, 713, 940, \n   652, 934, 970, 447, 318, 353, 859, 672, 112, 785, \n   645, 863, 803, 350, 139, 93, 354, 99, 820, 908, \n   609, 772, 154, 274, 580, 184, 79, 626, 630, 742, \n   653, 282, 762, 623, 680, 81, 927, 626, 789, 125, \n   411, 521, 938, 300, 821, 78, 343, 175, 128, 250, \n   170, 774, 972, 275, 999, 639, 495, 78, 352, 126, \n   857, 956, 358, 619, 580, 124, 737, 594, 701, 612, \n   669, 112, 134, 694, 363, 992, 809, 743, 168, 974, \n   944, 375, 748, 52, 600, 747, 642, 182, 862, 81, \n   344, 805, 988, 739, 511, 655, 814, 334, 249, 515, \n   897, 955, 664, 981, 649, 113, 974, 459, 893, 228, \n   433, 837, 553, 268, 926, 240, 102, 654, 459, 51, \n   686, 754, 806, 760, 493, 403, 415, 394, 687, 700, \n   946, 670, 656, 610, 738, 392, 760, 799, 887, 653, \n   978, 321, 576, 617, 626, 502, 894, 679, 243, 440, \n   680, 879, 194, 572, 640, 724, 926, 56, 204, 700, \n   707, 151, 457, 449, 797, 195, 791, 558, 945, 679, \n   297, 59, 87, 824, 713, 663, 412, 693, 342, 606, \n   134, 108, 571, 364, 631, 212, 174, 643, 304, 329, \n   343, 97, 430, 751, 497, 314, 983, 374, 822, 928, \n   140, 206, 73, 263, 980, 736, 876, 478, 430, 305, \n   170, 514, 364, 692, 829, 82, 855, 953, 676, 246, \n   369, 970, 294, 750, 807, 827, 150, 790, 288, 923, \n   804, 378, 215, 828, 592, 281, 565, 555, 710, 82, \n   896, 831, 547, 261, 524, 462, 293, 465, 502, 56, \n   661, 821, 976, 991, 658, 869, 905, 758, 745, 193, \n   768, 550, 608, 933, 378, 286, 215, 979, 792, 961, \n   61, 688, 793, 644, 986, 403, 106, 366, 905, 644, \n   372, 567, 466, 434, 645, 210, 389, 550, 919, 135, \n   780, 773, 635, 389, 707, 100, 626, 958, 165, 504, \n   920, 176, 193, 713, 857, 265, 203, 50, 668, 108, \n   645, 990, 626, 197, 510, 357, 358, 850, 858, 364, \n   936, 638\n};\n\n\n/*-------------------------------------------------------------*/\n/*--- end                                       randtable.c ---*/\n/*-------------------------------------------------------------*/\n"
  },
  {
    "path": "ext/freetype2/ChangeLog",
    "content": "2014-12-30  Werner Lemberg  <wl@gnu.org>\n\n\t* Version 2.5.5 released.\n\t=========================\n\n\n\tTag sources with `VER-2-5-5'.\n\n\t* docs/VERSION.DLL: Update documentation and bump version number to\n\t2.5.5.\n\n\t* README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,\n\tbuilds/windows/vc2005/index.html,\n\tbuilds/windows/vc2008/freetype.vcproj,\n\tbuilds/windows/vc2008/index.html,\n\tbuilds/windows/vc2010/freetype.vcxproj,\n\tbuilds/windows/vc2010/index.html,\n\tbuilds/windows/visualc/freetype.dsp,\n\tbuilds/windows/visualc/freetype.vcproj,\n\tbuilds/windows/visualc/index.html,\n\tbuilds/windows/visualce/freetype.dsp,\n\tbuilds/windows/visualce/freetype.vcproj,\n\tbuilds/windows/visualce/index.html,\n\tbuilds/wince/vc2005-ce/freetype.vcproj,\n\tbuilds/wince/vc2005-ce/index.html,\n\tbuilds/wince/vc2008-ce/freetype.vcproj,\n\tbuilds/wince/vc2008-ce/index.html: s/2.5.4/2.5.5/, s/254/255/.\n\n\t* include/freetype/freetype.h (FREETYPE_PATCH): Set to 5.\n\n\t* builds/unix/configure.raw (version_info): Set to 17:4:11.\n\t* CMakeLists.txt (VERSION_PATCH): Set to 5.\n\t* docs/CHANGES: Updated.\n\n2014-12-24  Alexei Podtelezhnikov <apodtele@gmail.com>\n\n\t[base] Formatting and nanooptimizations.\n\n\t* src/base/ftcalc.c,\n\t* src/base/fttrigon.c: Revise sign restoration.\n\n2014-12-13  Werner Lemberg  <wl@gnu.org>\n\n\t* src/pcf/pcfread.c (pcf_read_TOC): Improve fix from 2014-12-08.\n\n2014-12-11  Werner Lemberg  <wl@gnu.org>\n\n\t* builds/toplevel.mk (dist): Use older POSIX standard for `tar'.\n\n\tApparently, BSD tar isn't capable yet of handling POSIX-1.2001\n\t(contrary to GNU tar), so force the POSIX-1.1988 format.\n\n\tProblem reported by Stephen Fisher <sfisher@SDF.ORG>.\n\n2014-12-11  Werner Lemberg  <wl@gnu.org>\n\n\t* src/type42/t42parse.c (t42_parse_sfnts): Reject invalid TTF size.\n\n2014-12-11  Werner Lemberg  <wl@gnu.org>\n\n\t* src/base/ftobjs.c (FT_Get_Glyph_Name): Fix off-by-one check.\n\n\tProblem reported by Dennis Felsing <dennis@felsin9.de>.\n\n2014-12-11  Werner Lemberg  <wl@gnu.org>\n\n\t* src/type42/t42parse.c (t42_parse_sfnts): Check `string_size'.\n\n\tProblem reported by Dennis Felsing <dennis@felsin9.de>.\n\n2014-12-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>\n\n\t[gxvalid] Fix a naming convention conflicting with ftvalid.\n\n\tSee previous changeset for otvalid.\n\n\t* src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace\n\t`valid' by `gxvalid'.\n\t* src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,\n\tgxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,\n\tgxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,\n\tgxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,\n\tgxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if\n\tit is typed as GXV_Validator.\n\n2014-12-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>\n\n\t[otvalid] Fix a naming convention conflicting with ftvalid.\n\n\tSome prototypes in ftvalid.h use `valid' for the variables\n\ttyped as FT_Validator.  Their implementations in src/base/\n\tftobjs.c and utilizations in src/sfnt/ttcmap.c do similar.\n\n\tSome macros in otvcommn.h assume the exist of the variable\n\t`valid' typed as OTV_Validator in the caller.\n\n\tMixing these two conventions cause invalid pointer conversion\n\tand unexpected SEGV in longjmp.  To prevent it, all variables\n\ttyped as OTV_Validator are renamed to `otvalid'.\n\n\t* src/otvalid/otvcommn.h: Replace `valid' by `otvalid'.\n\t* src/otvalid/{otvcommn.c, otvbase.c, otvgdef.c, otvgpos.c,\n\totvgsub.c, otvjstf.c, otvmath.c}: Replace `valid' by `otvalid'\n\tif it is typed as OTV_Validator.\n\n2014-12-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>\n\n\t[ftvalid] Introduce FT_THROW() in FT_INVALID_XXX macros.\n\n\tOriginal patch is designed by Werner Lemberg.  Extra part\n\tfor otvalid and gxvalid are added by suzuki toshiya, see\n\tdiscussion:\n\thttp://lists.nongnu.org/archive/html/freetype-devel/2014-12/msg00002.html\n\thttp://lists.nongnu.org/archive/html/freetype-devel/2014-12/msg00007.html\n\n\t* include/internal/ftvalid.h: Introduce FT_THROW() in FT_INVALID_().\n\t* src/gxvalid/gxvcommn.h: Ditto.\n\t* src/otvalid/otvcommn.h: Ditto.\n\n2014-12-08  Werner Lemberg  <wl@gnu.org>\n\n\t[pcf] Fix Savannah bug #43774.\n\n\tWork around `features' of X11's `pcfWriteFont' and `pcfReadFont'\n\tfunctions.  Since the PCF format doesn't have an official\n\tspecification, we have to exactly follow these functions' behaviour.\n\n\tThe problem was unveiled with a patch from 2014-11-06, fixing issue\n\t#43547.\n\n\t* src/pcf/pcfread.c (pcf_read_TOC): Don't check table size for last\n\telement.  Instead, assign real size.\n\n2014-12-07  Werner Lemberg  <wl@gnu.org>\n\n\tWork around a bug in Borland's C++ compiler.\n\n\tSee\n\n\t  http://qc.embarcadero.com/wc/qcmain.aspx?d=118998\n\n\tfor Borland's bug tracker entry.\n\n\tReported by Yuliana Zigangirova <zigangirova@inbox.ru>,\n\thttp://lists.gnu.org/archive/html/freetype-devel/2014-04/msg00001.html.\n\n\t* include/internal/ftvalid.h (FT_ValidatorRec), src/smooth/ftgrays.c\n\t(gray_TWorker_): Move `ft_jmp_buf' field to be the first element.\n\n2014-12-07  Werner Lemberg  <wl@gnu.org>\n\n\t*/*: Decorate hex constants with `U' and `L' where appropriate.\n\n2014-12-07  Werner Lemberg  <wl@gnu.org>\n\n\t[truetype] Prevent memory leak for buggy fonts.\n\n\t* src/truetype/ttobjs.c (tt_size_done): Unconditionally call\n\t`tt_size_done_bytecode'.\n\n2014-12-06  Werner Lemberg  <wl@gnu.org>\n\n\t* Version 2.5.4 released.\n\t=========================\n\n\n\tTag sources with `VER-2-5-4'.\n\n\t* docs/VERSION.DLL: Update documentation and bump version number to\n\t2.5.4.\n\n\t* README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,\n\tbuilds/windows/vc2005/index.html,\n\tbuilds/windows/vc2008/freetype.vcproj,\n\tbuilds/windows/vc2008/index.html,\n\tbuilds/windows/vc2010/freetype.vcxproj,\n\tbuilds/windows/vc2010/index.html,\n\tbuilds/windows/visualc/freetype.dsp,\n\tbuilds/windows/visualc/freetype.vcproj,\n\tbuilds/windows/visualc/index.html,\n\tbuilds/windows/visualce/freetype.dsp,\n\tbuilds/windows/visualce/freetype.vcproj,\n\tbuilds/windows/visualce/index.html,\n\tbuilds/wince/vc2005-ce/freetype.vcproj,\n\tbuilds/wince/vc2005-ce/index.html,\n\tbuilds/wince/vc2008-ce/freetype.vcproj,\n\tbuilds/wince/vc2008-ce/index.html: s/2.5.3/2.5.4/, s/253/254/.\n\n\t* include/freetype/freetype.h (FREETYPE_PATCH): Set to 4.\n\n\t* builds/unix/configure.raw (version_info): Set to 17:3:11.\n\t* CMakeLists.txt (VERSION_PATCH): Set to 4.\n\t* docs/CHANGES: Updated.\n\n2014-12-04  Werner Lemberg  <wl@gnu.org>\n\n\tdocs/CHANGES: Updated, formatted.\n\n2014-12-04  Dave Arnold  <darnold@adobe.com>\n\n\t[cff] Modify an FT_ASSERT.\n\n\t* src/cff/cf2hints.c (cf2_hintmap_map): After the fix for Savannah\n\tbug #43661, the test font `...aspartam.otf' still triggers an\n\tFT_ASSERT.  Since hintmap still works with count==0, ...\n\t(cf2_glyphpath_lineTo, cf2_glyphpath_curveTo): ... add that term to\n\tsuppress the assert.\n\n2014-12-04  Dave Arnold  <darnold@adobe.com>\n\n\t[cff] Fix Savannah bug #43661.\n\n\t* src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdHSTEM,\n\tcf2_cmdVSTEM, cf2_cmdHINTMASK>: Don't append to stem arrays after\n\thintmask is constructed.\n\n\t* src/cff/cf2hints.c (cf2_hintmap_build): Add defensive code to\n\tavoid reading past end of hintmask.\n\n2014-12-03  Werner Lemberg  <wl@gnu.org>\n\n\tdocs/CHANGES: Updated.\n\n2014-12-03  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Better fix for conversion specifiers in debug messages.\n\n\tUsing `%ld' for pointer differences causes warnings on 32bit\n\tplatforms.  The correct type would be (the relatively new) `%td',\n\thowever, this is missing on some important platforms.\n\n\tThis patch improves the change from 2014-11-28.\n\n\t* src/autofit/afhints.c (AF_INDEX_NUM): Use `int' typecast.  Our\n\tpointer differences are always sufficiently small.\n\t(af_glyph_hints_dump_points, af_glyph_hints_dump_segments,\n\taf_glyph_hints_dump_edge): Revert to `%d' and use `AF_INDEX_NUM'.\n\n2014-12-03  Werner Lemberg  <wl@gnu.org>\n\n\tFT_Sfnt_Tag: s/ft_sfnt_xxx/FT_SFNT_XXX/ for orthogonality.\n\n\tAll public FreeType enumeration and flag values are uppercase...\n\n\t* include/tttables.h (FT_Sfnt_Tag): Implement it.  For backwards\n\tcompatilibity, retain the old values as macros.\n\n\t* src/base/ftfstype.c (FT_Get_FSType_Flags), src/sfnt/sfdriver.c\n\t(get_sfnt_table): Updated.\n\n2014-12-02  Werner Lemberg  <wl@gnu.org>\n\n\t* include/*: Improve structure of documentation.\n\n\t. Add and update many `<Order>' tags.\n\t. Apply various documentation fixes.\n\t. Remove details to deprecated (or never implemented) data.\n\n2014-12-02  Werner Lemberg  <wl@gnu.org>\n\n\t[docmaker] Always handle `<Order>' section elements.\n\n\tPreviously, those elements were handled only for sections present in\n\ta `<Sections>' chapter element.\n\n\t* src/tools/docmaker/content.py (ContentProcessor::finish):\n\tImplement it.\n\n2014-12-02  Werner Lemberg  <wl@gnu.org>\n\n\t[docmaker] Properly handle empty rows in Synopsis.\n\n\t* src/tools/docmaker/tohtml.py (HtmlFormatter::section_enter): Emit\n\t`&nbsp;' for empty fields.\n\n2014-12-02  Werner Lemberg  <wl@gnu.org>\n\n\t[docmaker] Thinko.\n\n\t* src/tools/docmaker/content.py (DocBlock::get_markup_words_all):\n\tEmit `/empty/' string for first element also.\n\n2014-12-02  Werner Lemberg  <wl@gnu.org>\n\n\t[docmaker] Honour empty lines in `<Order>' section element.\n\n\tThis greatly improves the readability of the `Synopsis' links.\n\n\t* src/tools/docmaker/content.py (DocBlock::get_markup_words_all):\n\tInsert string `/empty/' between items.\n\n\t* src/tools/docmaker/formatter.py (Formatter::section_dump): Make it\n\trobust against nonexistent keys.\n\n\t* src/tools/docmaker/tohtml.py (HtmlFormatter::section_enter): Emit\n\tempty <td> elements for `/empty/'.\n\n2014-12-02  Werner Lemberg  <wl@gnu.org>\n\n\t[docmaker] Ensure Python 3 compatibility.\n\n\t* src/tools/docmaker/content.py (ContentProcessor::set_section,\n\tContentProcessor::finish): Replace `has_key' function with `in'\n\tkeyword.\n\n\t* src/tools/docmaker/formatter.py (Formatter::__init__): Replace\n\tsorting function with a key generator.\n\t(Formatter::add_identifier): Replace `has_key' function with `in'\n\tkeyword.\n\n\t* src/tools/docmaker/tohtml.py (HtmlFormatter::html_source_quote):\n\tReplace `has_key' function with `in' keyword.\n\t(HtmlFormatter::index_exit, HtmlFormatter::section_enter): Use\n\tinteger division.\n\ts/<>/>/.\n\n\t* src/tools/docmaker/utils.py: Import `itertools'.\n\t(index_sort): Replaced by...\n\t(index_key): ... this new key generator (doing exactly the same).\n\n2014-11-29  Werner Lemberg  <wl@gnu.org>\n\n\t[docmaker] Don't output a block multiple times.\n\n\tThis bug was hidden by not processing all lines of `<Order>' blocks.\n\n\t* src/tools/docmaker/formatter.py (Formatter::section_dump): Filter\n\tout field names.\n\n2014-11-29  Werner Lemberg  <wl@gnu.org>\n\n\t[docmaker] Use field values as HTML link targets where possible.\n\n\t* src/tools/docmaker/tohtml.py (HtmlFormatter::make_block_url):\n\tAccept second, optional argument to specify a name.\n\t(HtmlFormatter::html_source_quote): Link to field ID if possible.\n\t(HtmlFormatter::print_html_field_list): Emit `id' attribute.\n\n2014-11-29  Werner Lemberg  <wl@gnu.org>\n\n\t[docmaker] Allow empty lines in `<Order>' blocks.\n\n\tBefore this patch, the suggested order of entries stopped at the\n\tfirst empty line.\n\n\tObviously, nobody noticed that this problem caused a much reduced\n\tset of links in the `Synopsis' sections; in particular, the\n\t`<Order>' blocks contain a lot of entries that wouldn't be listed\n\totherwise...\n\n\t* src/tools/docmaker/content.py (DocBlock::get_markup_words_all):\n\tNew function to iterate over all items.\n\t(DocSection::process): Use it.\n\n2014-11-29  Werner Lemberg  <wl@gnu.org>\n\n\t* src/tools/docmaker/sources.py (column) [Format 2]: Fix regexp.\n\n\tAfter the single asterisk there must be no other immediately following\n\tasterisk.\n\n2014-11-29  Werner Lemberg  <wl@gnu.org>\n\n\t* src/tools/docmaker/tohtml.py: Improve CSS for vertical spacing.\n\n2014-11-29  Werner Lemberg  <wl@gnu.org>\n\n\t[docmaker] Improve HTML code for table of contents.\n\n\t* src/tools/docmaker/tohtml.py: Introduce a new table class `toc',\n\ttogether with proper CSS.\n\n2014-11-29  Werner Lemberg  <wl@gnu.org>\n\n\t[docmaker] Provide higher-level markup and simplify HTML.\n\n\t* src/tools/docmaker/tohtml.py: Instead of using extraneous `<div>'\n\telements, use CSS descendants (of class `section') to format the\n\tdata.\n\n\tAlso remove reduntant <p> and <br> elements, replacing them with\n\tproper CSS.\n\n\tGlobally reduce page width to 75%.\n\n\t(block_header): Rename <div> class to `section'.\n\n2014-11-29  Werner Lemberg  <wl@gnu.org>\n\n\t[docmaker] Add `top' links after blocks.\n\n\t* src/tools/docmaker/tohtml.py (block_footer_middle): Implement it.\n\n2014-11-29  Werner Lemberg  <wl@gnu.org>\n\n\t* src/tools/docmaker/tohtml.py: Improve CSS for fields.\n\n\tMake fields align horizontally relative to full line width.\n\n2014-11-29  Werner Lemberg  <wl@gnu.org>\n\n\t* src/tools/docmaker/tohtml.py: Fix index and TOC templates.\n\n\tThis thinko was introduced 2014-11-27.\n\n2014-11-28  Werner Lemberg  <wl@gnu.org>\n\n\t[docmaker] Format field lists with CSS.\n\n\tThis also simplifies the inserted HTML code.\n\n\t* src/tools/docmaker/tohtml.py\n\t(HtmlFormatter::print_html_field_list): Do it.\n\n2014-11-28  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>\n\n\tFix compiler warning to the comparison between signed and\n\tunsigned variable.\n\n\t* src/pfr/pfrsbit.c (pfr_slot_load_bitmap): Fix the comparison\n\tbetween `ypos + ysize' and FT_INT_{MAX,MIN}.\n\n2014-11-28  Werner Lemberg  <wl@gnu.org>\n\n\t[docmaker] Replace empty `<td>' with CSS.\n\n\t* src/tools/docmaker/tohtml.py (HtmlFormatter::section_enter): Do\n\tit.\n\n2014-11-28  Werner Lemberg  <wl@gnu.org>\n\n\t[docmaker] Replace some `<table>' tags with `<h4>' and `<div>'.\n\n\t* src/tools/docmaker/tohtml.py (marker_*): Use `<h4>'.\n\t(source_*): Use `<div>'.\n\t(HtmlFormatter::block_enter): s/<h4>/<h3>/.\n\n2014-11-28  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>\n\n\tFix compiler warning to conversion specifiers in debug messages.\n\n\t* src/autofit/afhints.c (af_glyph_hints_dump_points): Add length\n\tmodifier to dump long integers.\n\t(af_glyph_hints_dump_segments, af_glyph_hints_dump_edges): Ditto.\n\n2014-11-27  Werner Lemberg  <wl@gnu.org>\n\n\t* src/tools/docmaker/tohtml.py: Use more CSS for index.\n\n2014-11-27  Werner Lemberg  <wl@gnu.org>\n\n\t[docmaker] Replace `name' attribute of `<a>' with `id'.\n\n\t* src/tools/docmaker/tohtml.py (HtmlFormatter::block_enter): Do it.\n\n2014-11-27  Werner Lemberg  <wl@gnu.org>\n\n\t* src/tools/docmaker/tohtml.py: Remove remaining `width' attributes.\n\n\tFor `Index' and `TOC' links, we now simply use the `text-align' CSS\n\tproperty of `<td>' to enforce flush-left and flush-right,\n\teliminating the hack with an empty, full-width `<td>' element\n\tinbetween.\n\n\tThe change also enforces the same (smaller) size for all index and\n\tTOC links.\n\n2014-11-27  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>\n\n\t* src/cff/cf2font.c: Include `ftcalc.h' to use FT_MSB(),\n\tcf2font.c could not find it under `make multi' build.\n\n2014-11-27  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>\n\n\t* src/smooth/ftsmooth.c (ft_smooth_render_generic): Remove\n\tunrequired negative value check for `width' and `height'.\n\n2014-11-27  Werner Lemberg  <wl@gnu.org>\n\n\t* src/tools/docmaker/tohtml.py: More HTML table refactoring.\n\n\tReplace some `<table>' tags with `<div>' to simplify structure.\n\n\tMove `bgcolor' attribute to CSS.\n\n\tReplace most `width' attributes with CSS.  The remaining instances\n\t(providing a similar effect as LaTeX's `\\hfill' command) are removed\n\tin a later patch.\n\n2014-11-27  Werner Lemberg  <wl@gnu.org>\n\n\t* src/tools/docmaker/tohtml.py: Replace <font> with CSS.\n\n2014-11-27  Werner Lemberg  <wl@gnu.org>\n\n\t* src/tools/docmaker/tohtml.py: Center <table> with CSS.\n\n2014-11-27  Werner Lemberg  <wl@gnu.org>\n\n\t* src/tools/docmaker/tohtml.py: Replace `<center>' with `<div>'.\n\n2014-11-27  Werner Lemberg  <wl@gnu.org>\n\n\t* src/tools/docmaker/tohtml.py: Remove redundant `<center>' tags.\n\n\tThis starts a series of commits into the direction of generating\n\tvalid HTML 5 code, especially using much more CSS.\n\n2014-11-27  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>\n\n\tPrevent too negative values (< FT_INT_MIN) in bitmap metrics,\n\tsuggested by Alexei.\n\n\t* src/pfr/pfrsbit.c (pfr_slot_load_bitmap): Prevent too\n\tnegative values in `xpos' and `ypos + ysize'.\n\t* src/smooth/ftsmooth.c (ft_smooth_render_generic): Prevent\n\ttoo negative values in `x_left' and `y_top'.  Either negative\n\tvalues in `width' and `height' are checked.\n\n2014-11-27  Werner Lemberg  <wl@gnu.org>\n\n\t[docmaker] Produce better HTML code.\n\n\t* src/tools/docmaker/tohtml.py: Always use double quotes for\n\tattribute values.\n\t(source_footer): Close `td' and `tr' groups.\n\n2014-11-27  Werner Lemberg  <wl@gnu.org>\n\n\tUse better way to disable creation of .pyc files for `make refdoc'.\n\n\tPython 2.6 was released in 2008...\n\n\t* builds/freetype.mk (refdoc): Use python's `-B' option.\n\n\t* builds/detect.mk (std_setup, dos_setup): Mention required python\n\tversion for `refdoc' target.\n\n2014-11-27  Werner Lemberg  <wl@gnu.org>\n\n\t* src/tools/docmaker/sources.py (re_bold, re_italic): Use\n\tnon-grouping parentheses.\n\t* src/tools/docmaker/tohtml.py (HtmlFormatter::make_html_word):\n\tUpdated.\n\n2014-11-27  Werner Lemberg  <wl@gnu.org>\n\n\t* src/base/ftobjs.c (FT_Get_Glyph_Name): Fix compiler warning.\n\n\tIntrodruced in previous change.  Reported by Alexei.\n\n2014-11-26  Werner Lemberg  <wl@gnu.org>\n\n\t* src/*: Add checks for parameters of API functions where missing.\n\n\t`API functions' are functions tagged with `FT_EXPORT_DEF'.\n\n\tBesides trivial fixes, the following changes are included, too.\n\n\t* src/base/ftbdf.c (FT_Get_BDF_Charset_ID, FT_Get_BDF_Property): Set\n\terror code if no service is available.\n\n\t* src/base/ftinit.c (FT_Done_FreeType): Change return value for\n\tinvalid `library' parameter to `Invalid_Library_Handle'.\n\n\t* src/base/ftobjs.c (FT_New_Size): Change return value for invalid\n\t`asize' parameter to `Invalid_Argument'.\n\n\t* src/base/ftoutln.c (FT_Outline_Copy): Change return value for\n\tinvalid `source' and `target' parameters to `Invalid_Outline'.\n\t(FT_Outline_Done_Internal): Change return value for invalid\n\t`outline' parameter to `Invalid_Outline'.\n\n2014-11-26  Werner Lemberg  <wl@gnu.org>\n\n\t* src/cache/ftcbasic.c: Use single calls to `FT_TRACE'.\n\n2014-11-26  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>\n\n\t* src/base/ftobj.c (Mac_Read_POST_Resource): Additional\n\toverflow check in the summation of POST fragment lengths,\n\tsuggested by Mateusz Jurczyk <mjurczyk@google.com>.\n\n2014-11-26  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>\n\n\t* src/base/ftobjs.c (Mac_Read_POST_Resource): Insert comments\n\tand fold too long tracing messages.\n\n2014-11-26  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>\n\n\tFix Savannah bug #43540.\n\n\t* src/base/ftmac.c (parse_fond): Prevent a buffer overrun\n\tcaused by a font including too many (> 63) strings to store\n\tnames[] table.\n\n2014-11-26  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>\n\n\t* src/base/ftobjs.c (Mac_Read_POST_Resource): Use unsigned long\n\tvariables to read the lengths in POST fragments.  Suggested by\n\tMateusz Jurczyk <mjurczyk@google.com>.\n\n2014-11-26  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>\n\n\tFix Savannah bug #43539.\n\n\t* src/base/ftobjs.c (Mac_Read_POST_Resource): Fix integer overflow\n\tby a broken POST table in resource-fork.\n\n2014-11-26  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>\n\n\tFix Savannah bug #43538.\n\n\t* src/base/ftobjs.c (Mac_Read_POST_Resource): Fix integer overflow\n\tby a broken POST table in resource-fork.\n\n2014-11-26  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>\n\n\t* src/base/ftobjs.c (Mac_Read_POST_Resource): Avoid memory leak\n\tby a broken POST table in resource-fork.  Return after freeing\n\tthe buffered POST table when it is found to be broken.\n\n2014-11-25  Werner Lemberg  <wl@gnu.org>\n\n\t*/*: s/Invalid_Argument/Invalid_Size_Handle/ where appropriate.\n\n2014-11-25  Werner Lemberg  <wl@gnu.org>\n\n\t*/*: s/Invalid_Argument/Invalid_Stream_Handle/ where appropriate.\n\n2014-11-25  Werner Lemberg  <wl@gnu.org>\n\n\t*/*: s/Invalid_Argument/Invalid_Library_Handle/ where appropriate.\n\n2014-11-25  Werner Lemberg  <wl@gnu.org>\n\n\t*/*: s/Invalid_Argument/Invalid_Outline/ where appropriate.\n\n2014-11-25  Werner Lemberg  <wl@gnu.org>\n\n\t*/*: s/Invalid_Argument/Invalid_Face_Handle/ where appropriate.\n\n2014-11-24  Werner Lemberg  <wl@gnu.org>\n\n\t[Savannah bug #43682] Adjust some renderer callbacks.\n\n\t* src/raster/ftraster.c (ft_black_set_mode): Change return type to\n\t`int' to stay in sync with `FT_Renderer_SetModeFunc' prototype.\n\n\t* src/smooth/ftgrays.c (gray_raster_set_mode): New dummy function\n\tfor orthogonality.\n\t(ft_grays_raster): Use it.\n\n2014-11-25  Werner Lemberg  <wl@gnu.org>\n\n\t[Savannah bug #43682] Properly handle missing return errors.\n\n\tThe functions in this patch *do* return non-trivial errors that must\n\tbe taken care of.\n\n\t* src/autofit/afloader.c (af_loader_load_g), src/base/ftobjs.c\n\t(FT_Render_Glyph_Internal), src/base/ftoutln.c (FT_Outline_Render),\n\tsrc/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_endchar>,\n\tsrc/psaux/psobjs.c (ps_parser_load_field_table), src/psaux/t1decode\n\t(t1_decoder_parse_charstrings) <op_endchar>, src/truetype/ttgload.c\n\t(load_truetype_glyph <subglyph loop>, tt_loader_init,\n\tTT_Load_Glyph), src/truetype/ttgxvar.c (TT_Set_MM_Blend),\n\tsrc/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Do it.\n\n2014-11-25  Werner Lemberg  <wl@gnu.org>\n\n\t[Savannah bug #43682] Add/remove `void' casts to some functions.\n\n\tWe use a cast to indicate that we intentionally ignore a function's\n\treturn value.  However, this doesn't apply to API functions where\n\terrors can only happen for trivially invalid input.\n\n\t* src/base/ftstroke.c (FT_Glyph_Stroke, FT_Glyph_StrokeBorder),\n\tsrc/base/ftsynth.c (FT_GlyphSlot_Embolden), src/cff/cffgload.c\n\t(cff_slot_load), src/pfr/pfrdrivr.c (pfr_get_kerning),\n\tsrc/type1/t1load.c (parse_encoding), src/type42/t42parse.c\n\t(t42_parse_encoding): Do it.\n\n2014-11-25  Werner Lemberg  <wl@gnu.org>\n\n\t[Savannah bug #43682] Change some signatures to `void' return type.\n\n\t* include/internal/pshints.h (PSH_Globals_SetScaleFunc),\n\tinclude/internal/sfnt.h (TT_Get_Metrics_Func),\n\tsrc/pshinter/pshglob.c (psh_globals_set_scale),\n\tsrc/pshinter/pshrec.c (ps_hints_init), src/sfnt/ttmtx.c\n\t(tt_face_get_metrics), src/truetype/ttinterp.c (TT_Goto_CodeRange,\n\tTT_Set_CodeRange, TT_Clear_CodeRange, TT_Done_Context,\n\tTT_Save_Context): Do it.\n\n\t* src/pshinter/pshglob.h, src/pshinter/pshrec.h, src/sfnt/ttmtx.h,\n\tsrc/truetype/ttgload.c (TT_Hint_Glyph), src/truetype/ttinterp.c\n\t(TT_Run_Context), src/truetype/ttinterp.h, src/truetype/ttobjs.c\n\t(tt_size_run_fpgm, tt_size_run_prep): Updated.\n\n2014-11-24  Werner Lemberg  <wl@gnu.org>\n\n\tRemove all code related to FT_MAX_CHARMAP_CACHEABLE.\n\n\tThis is no longer used.\n\n\t* src/base/ftobjs.c, src/cache/ftccmap.c, src/cff/cffobjs.c,\n\tsrc/sfnt/ttcmap.c: Do it.\n\n2014-11-24  Werner Lemberg  <wl@gnu.org>\n\n\t[sfnt] Fix Savannah bug #43680.\n\n\tThis adds an additional constraint to make the fix from 2013-01-25\n\treally work.\n\n\t* src/sfnt/ttsbit.c (tt_sbit_decoder_load_image) <index_format==4>:\n\tCheck `p' before `num_glyphs'.\n\n2014-11-24  Werner Lemberg  <wl@gnu.org>\n\n\t[truetype] Fix Savannah bug #43679.\n\n\t* src/truetype/ttpload.c (tt_face_load_hdmx): Check minimum size of\n\t`record_size'.\n\n2014-11-24  Jarkko Pöyry  <jarkko.poyry@gmail.com>\n\n\t[cff, pfr, psaux, winfonts] Fix Savannah bug #43676.\n\n\tDon't cast cmap init function pointers to an incompatible type.\n\n\tWithout this patch, the number of parameters between declaration and\n\tthe real signature differs.  Calling such a function results in\n\tundefined behavior.\n\n\t  ISO/IEC 9899:TC3 (Committee Draft September 7, 2007)\n\t    6.5.2.2 Function calls\n\t      9 If the function is defined with a type that is not\n\t        compatible with the type (of the expression) pointed to by\n\t        the expression that denotes the called function, the\n\t        behavior is undefined.\n\n\tOn certain platforms (c -> js with emscripten) this causes\n\ttermination of execution or invalid calls because in the emscripten\n\timplementation, function pointers of different types are stored in\n\tdifferent pointer arrays.  Incorrect pointer type here results in\n\tindexing of an incorrect array.\n\n\t* src/cff/cffcmap.c (cff_cmap_encoding_init, cff_cmap_unicode_init),\n\tsrc/pfr/pfrcmap.c (pfr_cmap_init), src/psaux/t1cmap.c\n\tt1_cmap_standard_init, t1_cmap_expert_init, t1_cmap_custom_init,\n\tt1_cmap_unicode_init), src/winfonts/winfnt.c (fnt_cmap_init): Fix\n\tsignature.\n\n2014-11-24  Werner Lemberg  <wl@gnu.org>\n\n\t[sfnt] Fix Savannah bug #43672.\n\n\t* src/sfnt/ttkern.c (tt_face_load_kern): Use correct value for\n\tminimum table length test.\n\n2014-11-24  Werner Lemberg  <wl@gnu.org>\n\n\t[type1, type42] Another fix for Savannah bug #43655.\n\n\t* src/type1/t1load.c (parse_charstrings), src/type42/t42parse.c\n\t(t42_parse_charstrings): Add another boundary testing.\n\n2014-11-24  Werner Lemberg  <wl@gnu.org>\n\n\t[docmaker] Formatting, copyright, improved documentation.\n\n\t* src/tools/docmaker/*: No code changes besides trivial\n\tmodifications.\n\n2014-11-22  Werner Lemberg  <wl@gnu.org>\n\n\t[bdf] Fix Savannah bug #43660.\n\n\t* src/bdf/bdflib.c (_bdf_parse_glyphs) <\"ENDFONT\">: Check\n\t`_BDF_GLYPH_BITS'.\n\n2014-11-22  Werner Lemberg  <wl@gnu.org>\n\n\t[type42] Allow only embedded TrueType fonts.\n\n\tThis is a follow-up to Savannah bug #43659.\n\n\t* src/type42/t42objs.c (T42_Face_Init): Exclusively use the\n\t`truetype' font driver for loading the font contained in the `sfnts'\n\tarray.\n\n2014-11-22  Werner Lemberg  <wl@gnu.org>\n\n\t[type42] Fix Savannah bug #43659.\n\n\t* src/type42/t42objs.c (T42_Open_Face): Initialize `face->ttf_size'.\n\n\t* src/type42/t42parse.c (t42_parse_sfnts): Always set\n\t`face->ttf_size' directly.  This ensures a correct stream size in\n\tthe call to `FT_Open_Face', which follows after parsing, even for\n\tbuggy input data.\n\tFix error messages.\n\n2014-11-22  Werner Lemberg  <wl@gnu.org>\n\n\t[cff] Fix Savannah bug #43658.\n\n\t* src/cff/cf2ft.c (cf2_builder_lineTo, cf2_builder_cubeTo): Handle\n\treturn values of point allocation routines.\n\n2014-11-22  Werner Lemberg  <wl@gnu.org>\n\n\t[sfnt] Fix Savannah bug #43656.\n\n\t* src/sfnt/ttcmap.c (tt_cmap4_validate): Fix order of validity\n\ttests.\n\n2014-11-21  Werner Lemberg  <wl@gnu.org>\n\n\t[type1, type42] Fix Savannah bug #43655.\n\n\t* src/type1/t1load.c (parse_charstrings), src/type42/t42parse.c\n\t(t42_parse_charstrings): Fix boundary testing.\n\n2014-11-21  Werner Lemberg  <wl@gnu.org>\n\n\t* src/pcf/pcfread.c (pcf_get_metrics): Sanitize invalid metrics.\n\n2014-11-21  Werner Lemberg  <wl@gnu.org>\n\n\t[ftlcdfil] Obey flow direction.\n\n\t* src/base/ftlcdfil.c (_ft_lcd_filter_fir, _ft_lcd_filter_legacy):\n\tHandle `up' flow.\n\n2014-11-21  Werner Lemberg  <wl@gnu.org>\n\n\t* src/base/ftbitmap.c (FT_Bitmap_Convert): Improve.\n\n\tThis commit completes argument checks and adds support for different\n\tflow directions.\n\n2014-11-21  Werner Lemberg  <wl@gnu.org>\n\n\t* src/base/ftbitmap.c (FT_Bitmap_Copy): Improve.\n\n\tThis commit adds argument checks and support for different flow\n\tdirections.\n\n2014-11-20  Werner Lemberg  <wl@gnu.org>\n\n\t* src/base/ftbitmap.c (FT_Bitmap_New): Check argument.\n\n2014-11-19  Werner Lemberg  <wl@gnu.org>\n\n\tChange some fields in `FT_Bitmap' to unsigned type.\n\n\tThis doesn't break ABI.\n\n\t* include/ftimage.h (FT_Bitmap): Make `rows', `width', `num_grays',\n\t`pixel_mode', and `palette_mode' unsigned types.\n\n\t* src/base/ftbitmap.c: Updated.\n\t(FT_Bitmap_Copy): Fix casts.\n\n\t* src/cache/ftcsbits.c, src/raster/ftraster.c, src/sfnt/pngshim.c:\n\tUpdated.\n\n2014-11-19  Werner Lemberg  <wl@gnu.org>\n\n\tMake `FT_Bitmap_Convert' correctly handle negative `pitch' values.\n\n\t* src/base/ftbitmap.c (FT_Bitmap_Convert): Always use positive value\n\tfor the pitch while copying data.\n\tCorrectly set pitch sign in target bitmap.\n\n2014-11-19  Werner Lemberg  <wl@gnu.org>\n\n\tMinor code improvement in `FT_Bitmap_Embolden'.\n\n\t* src/base/ftbitmap.c (FT_Bitmap_Embolden) <FT_PIXEL_MODE_GRAY[24]>:\n\tFix thinko.\n\n2014-11-19  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t* src/base/fttrigon.c: Use dedicated `FT_Angle' for arctan table.\n\n2014-11-19  Behdad Esfahbod  <behdad@behdad.org>\n\n\tAvoid compiler warnings on x86-64 for `FT_MulFix'.\n\n\t`FT_MulFix' takes `FT_Long' parameters as defined in `freetype.h',\n\tbut several inline implementations of it in `ftcalc.h' take\n\t`FT_Int32' arguments.  This is causing compiler warnings on x86-64:\n\tIf parameters of type `FT_Fixed' (= `FT_Long') are passed to the\n\tinline implementation of this function, integer values are truncated\n\tfrom 64bit to 32bit.\n\n\t* include/internal/ftcalc.h (FT_MulFix) [FT_MULFIX_ASSEMBLER]: Add\n\tcasts.\n\n2014-11-15  Werner Lemberg  <wl@gnu.org>\n\n\t[sfnt] Fix Savannah bug #43597.\n\n\t* src/sfnt/pngshim.c (Load_SBit_Png): Protect against too large\n\tbitmaps.\n\n2014-11-12  Werner Lemberg  <wl@gnu.org>\n\n\t[sfnt] Fix Savannah bug #43591.\n\n\t* src/sfnt/ttsbit.c (tt_sbit_decoder_init): Protect against addition\n\tand multiplication overflow.\n\n2014-11-12  Werner Lemberg  <wl@gnu.org>\n\n\t[sfnt] Fix Savannah bug #43590.\n\n\t* src/sfnt/ttload.c (check_table_dir, tt_face_load_font_dir):\n\tProtect against addition overflow.\n\n2014-11-12  Werner Lemberg  <wl@gnu.org>\n\n\t[sfnt] Fix Savannah bug #43589.\n\n\t* src/sfnt/sfobjs.c (woff_open_font): Protect against addition\n\toverflow.\n\n2014-11-12  Werner Lemberg  <wl@gnu.org>\n\n\t[sfnt] Fix Savannah bug #43588.\n\n\t* src/sfnt/ttcmap.c (tt_cmap8_validate, tt_cmap10_validate,\n\ttt_cmap12_validate, tt_cmap13_validate, tt_cmap14_validate): Protect\n\tagainst overflow in additions and multiplications.\n\n2014-11-10  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] CORDIC improvements.\n\n\tThe scaling between the hypotenuse and its CORDIC approximation is\n\tbased on regression analysis. The smaller padding for `theta' is\n\tjustifed by its maximum error of less than 6.\n\n\t* src/base/fttrigon.c (ft_trig_downscale): Borrow code from\n\t./ftcalc.c (ft_multo64), change linear intercept.\n\t(ft_trig_pseudo_polarize): Decrease `theta' padding.\n\n2014-11-09  Werner Lemberg  <wl@gnu.org>\n\n\t* src/base/ftstroke.c (ft_stroker_inside): Fix border intersections.\n\n\tOne more place to check whether `radius' is zero.\n\n\tProblem reported by Marco Wertz <marco.wertz@gmx.de>.\n\n2014-11-07  Werner Lemberg  <wl@gnu.org>\n\n\t[bdf] Fix Savannah bug #43535.\n\n\t* src/bdf/bdflib.c (_bdf_strncmp): New macro that checks one\n\tcharacter more than `strncmp'.\n\ts/ft_strncmp/_bdf_strncmp/ everywhere.\n\n2014-11-06  Werner Lemberg  <wl@gnu.org>\n\n\t[pcf] Fix Savannah bug #43548.\n\n\t* src/pcf/pcfread.c (pcf_get_encodings): Add sanity checks for row\n\tand column values.\n\n2014-11-06  Werner Lemberg  <wl@gnu.org>\n\n\t[pcf] Fix Savannah bug #43547.\n\n\t* src/pcf/pcfread.c (pcf_read_TOC): Check `size' and `offset'\n\tvalues.\n\n2014-11-06  Werner Lemberg  <wl@gnu.org>\n\n\t* src/pcf/pcfread.c (pcf_read_TOC): Avoid memory leak.\n\n2014-11-03  Infinality  <infinality@infinality.net>\n\n\t* src/truetype/ttsubpix.c (COMPATIBILITY_MODE_Rules): Updated.\n\n\tThe previous commit deteriorates rendering of DejaVu and similar\n\tfonts; this gets compensated with this rule.\n\n2014-11-03  Werner Lemberg  <wl@gnu.org>\n\n\t* src/truetype/ttinterp.c (Ins_DELTAP): Fix subpixel hinting.\n\n\tBefore this patch, it was impossible to ever call DELTAP[123] in\n\tsubpixel hinting mode as described in the ClearType whitepaper; it\n\tonly worked if in `compatibility mode'.  However, compatibility mode\n\tessentially disables SHPIX, completely ruining hinting of\n\tttfautohint output, for example.\n\n\tWe now follow the whitepaper more closely so that DELTAP[123]\n\tinstructions for touched points in the non-subpixel direction are\n\texecuted.\n\n2014-10-31  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[smooth] Improve code readability.\n\n\t* src/smooth/ftsmooth.c (ft_smooth_render_generic): Rearrange code.\n\n2014-10-31  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[smooth] Reduce outline translations during rendering.\n\n\t* src/smooth/ftsmooth.c (ft_smooth_render_generic): Translate origin\n\tvirtually by modifying cbox, actually translate outline if cumulative\n\tshift is not zero.\n\n2014-10-30  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[smooth] Fix Savannah bug #35604 (cont'd).\n\n\t* src/smooth/ftsmooth.c (ft_smooth_render_generic): Remove checks and\n\tcasts that became unnecessary after the variable type upgrades.\n\n2014-10-29  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[smooth] Improve code readability.\n\n\t* src/smooth/ftsmooth.c (ft_smooth_render_generic): Rearrange code.\n\n2014-10-29  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\tUnify hypotenuse approximations.\n\n\t* include/internal/ftcalc.h (FT_HYPOT): Move macro from here...\n\t* include/internal/ftobjs.h: ... to here, next to required `FT_ABS'.\n\t* src/smooth/ftgrays.c (gray_render_cubic): Use it here.\n\n2014-10-25  Werner Lemberg  <wl@gnu.org>\n\n\t[cff] Test valid darkening parameter macros in `ftoption.h'.\n\n\tWe no longer need an otherwise unused typedef that can cause a gcc\n\twarning.\n\tProblem reported by Alexei.\n\n\t* src/cff/cffobjs.c (cff_driver_init): Use\n\t`CFF_CONFIG_OPTION_DARKENING_PARAMETER_XXX' macros directly.\n\t(SET_DARKENING_PARAMETERS): Removed.\n\tCompile time tests are now ...\n\n\t* devel/ftoption.h, include/config/ftoption.h: ... here.\n\n2014-10-25  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\tImprove flat corner definition.\n\n\t* include/internal/ftcalc.h (FT_HYPOT): Macro to approximate Euclidean\n\tdistance with the alpha max plus beta min algorithm.\n\t* src/base/ftcalc.c (ft_corner_is_flat): Use it instead of Taxicab\n\tmetric.\n\n2014-10-23  David Weiß  <David.Weiss@ptvgroup.com>\n\n\t[build] Improve property file for vc2010.\n\n\tUser-defined properties should be empty by default to prevent linker\n\tfailures.\n\n\t* builds/windows/vc2010/freetype.user.props,\n\tbuilds/windows/vc2010/freetype.vcxproj:\n\ts/OptionsDirectory/UserOptionDirectory/.\n\tComment out all user options.\n\n2014-10-23  Werner Lemberg  <wl@gnu.org>\n\n\t[cff] Work around bug in preprocessor of MSVC 2010.\n\n\tWe have been hit by\n\n\t  https://connect.microsoft.com/VisualStudio/feedback/details/718976/msvc-pr\n\n\t* devel/ftoption.h, include/config/ftoption.h: Replace\n\t`CFF_CONFIG_OPTION_DARKENING_PARAMETERS' with eight macros\n\t`CFF_CONFIG_OPTION_DARKENING_PARAMETER_{X,Y}{1,2,3,4}'.\n\n\t* src/cff/cffobjs.c (SET_DARKENING_PARAMETERS): Removed.  We no\n\tlonger need double expansion.\n\t(SET_DARKENING_PARAMETERS_0): Renamed to ...\n\t(SET_DARKENING_PARAMETERS): ... this.\n\tUpdate call.\n\n2014-10-20  Werner Lemberg  <wl@gnu.org>\n\n\t[sbit] Minor fixes.\n\n\t* src/sfnt/ttsbit.c (tt_face_load_sbit) [TT_SBIT_TABLE_TYPE_SBIX]:\n\tAccept overlay format also, but emit warning message in that case.\n\t(tt_sbit_decoder_load_metrics): Add missing newline to error\n\tmessage.\n\t(tt_sbit_load_sbix_image): Add `rgbl' graphic type (as used on iOS\n\t7.1) to the list of unsupported formats.\n\n2014-10-19  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[truetype] Clean up bytecode rounding.\n\n\tZero distance does not have to be treated specially if you follow\n\tspecifications and check the sign as the very last step of rounding.\n\n\t* src/truetype/ttinterp.c (Round_None, Round_To_Grid,\n\tRound_Down_To_Grid, Round_Up_To_Grid, Round_To_Double_Grid): Use\n\tmacros when available, do not check for non-zero distance.\n\t(Round_To_Half_Grid, Round_Super, Round_Super_45): Ditto, return phase\n\tif sign changed.\n\n2014-10-18  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[truetype] Unwrap engine compensation settings.\n\n\t* src/truetype/ttobjs.c (tt_size_init_bytecode): Updated.\n\n2014-10-18  David Weiß  <David.Weiss@ptvgroup.com>\n\n\t[build] Add property file to vc2010 project.\n\n\tThis simplifies custom build configurations, especially for\n\tautomated build environments.\n\n\t* builds/windows/vc2010/freetype.user.props: New configuration file.\n\n\t* builds/windows/vc2010/freetype.vcxproj: Include\n\t`freetype.user.props' and use its data fields.\n\n\t* builds/windows/vc2010/index.html: Updated.\n\n2014-10-18  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Add blue-zone support for Telugu.\n\n\tThis essentially moves the Telugu script from the `Indic' hinter to\n\tthe `Latin' hinter.\n\n\tNote that this is a first shot and quite certainly needs\n\trefinements.\n\n\t* src/autofit/afblue.dat: Add blue zone data for Telugu.\n\n\t* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.\n\n\t* src/autofit/afscript.h: Add Telugu standard characters and move\n\tdata out of AF_CONFIG_OPTION_INDIC block.\n\n\t* src/autofit/afranges.c: Move Telugu data out of\n\tAF_CONFIG_OPTION_INDIC block.\n\n\t* src/autofit/afstyles.h: Update Telugu data; in particular, use\n\tAF_WRITING_SYSTEM_LATIN.\n\n2014-10-18  David Wimsey  <david@wimsey.us>\n\n\t[cmake] Add iOS build support.\n\tFrom Savannah patch #8497.\n\n\t* builds/cmake/iOS.cmake: New file.  Universal binaries are built\n\twith both 32 and 64 bit arm architectures.\n\n\t* CMakeLists.txt (IOS_PLATFORM): New variable for running the iOS\n\ttoolchain.  Possible values are `OS' to build on iOS, or\n\t`SIMULATOR' to build on APPLE.\n\n2014-10-16  Behdad Esfahbod  <behdad@behdad.org>\n\t    Werner Lemberg  <wl@gnu.org>\n\n\t[cff] Add `CFF_CONFIG_OPTION_DARKENING_PARAMETERS' config macro.\n\n\t* devel/ftoption.h, include/config/ftoption.h\n\t(CFF_CONFIG_OPTION_DARKENING_PARAMETERS): New macro.\n\n\t* src/cff/cffobjs.c (SET_DARKENING_PARAMETERS,\n\tSET_DARKENING_PARAMETERS_0): New macros.\n\t(cff_driver_init): Use new macros.\n\n2014-10-14  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[truetype] Limit delta shift range.\n\n\tThe valid range for delta shift is zero through six.  Negative values\n\tare invalid according to\n\n\t  https://developer.apple.com/fonts/TrueType-Reference-Manual/RM04/Chap4.html#delta%20shift\n\n\t* src/truetype/ttobjs.h (delta_shift, delta_base): Make unsigned.\n\t* src/truetype/ttinterp.h (DO_SDS): Throw an error if `delta_shift'\n\tis out of range.\n\t(Ins_DELTAP, Ins_DELTAC): Optimize for valid `delta_shift'.\n\n2014-10-16  Werner Lemberg  <wl@gnu.org>\n\n\tA better fix for Savannah bug #43392.\n\tSuggested by Doug Felt <dougfelt@gmail.com>.\n\n\t* src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics): Set\n\t`vertAdvance' to zero...\n\n\t* src/truetype/ttgload.c (TT_Load_Glyph): ... and set here a default\n\tvalue for `vertAdvance' based on `linearVertAdvance' in case\n\t`vertAdvance' is zero.  Note that the previous computed ad-hoc value\n\tfor `linearVertAdvance' was apparently not tested in a real-life\n\tsituation.\n\n2014-10-14  David Weiß  <David.Weiss@ptvgroup.com>\n\n\t[build] Better optimization settings for vc2010 solution file.\n\n\t* builds/windows/vc2010/freetype.sln,\n\tbuilds/windows/vc2010/freetype.vcxproj: Updated.\n\n2014-10-14  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Adjust Devenagari character range.\n\n\t* src/autofit/afranges.c (af_deva_uniranges): Omit characters that\n\tare common to all other Indic scripts.\n\n2014-10-12  Werner Lemberg  <wl@gnu.org>\n\n\t[sfnt] Fix Savannah bug #43392.\n\n\t* src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics): Don't let\n\tvertical metrics uninitialized.\n\n2014-10-11  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Small bbox correction.\n\n\t* src/base/ftbbox.c (FT_Outline_Get_BBox): Start from nonsense bbox\n\tinstead of initial point that could be `off' in conic outlines.\n\n2014-10-08  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Fix Savannah bug #43356.\n\n\t* src/base/ftbbox.c (BBox_Move_To, BBox_Conic_To): Update bbox in case\n\tof implicit `to'.\n\t(BBox_Line_To): New emitter that does not update bbox.\n\n2014-10-08  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Introduce and use new macro `FT_UPDATE_BBOX'\n\n\t* src/base/ftbbox.c (FT_UPDATE_BBOX): New macro.\n\t(FT_Outline_Get_BBox): Use it here.\n\n2014-10-02  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Significant optimization of `ft_div64by32'\n\n\tWe shift as many bits as we can into the high register, perform\n\t32-bit division with modulo there, then work through the remaining\n\tbits with long division. This optimization is especially noticeable\n\tfor smaller dividends that barely use the high register.\n\n\t* src/base/ftcalc.c (ft_div64by32): Updated.\n\n2014-10-02  Dave Arnold  <darnold@adobe.com>\n\n\t[cff] Fix Savannah bug #43271.\n\n\t* src/cff/cf2font.c (cf2_computeDarkening): Change overflow\n\tdetection to use logarithms and clamp `scaledStem'.\n\n2014-10-01  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t* src/base/ftcalc.c: Remove miscellaneous type casts.\n\n2014-10-01  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Use more common `FT_MSB' implementation with masks.\n\n\t* src/base/ftcalc.c (FT_MSB): Updated.\n\n2014-09-30  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Clean up.\n\n\t* src/base/ftcalc.c (FT_MOVE_SIGN): New macro for frequently used\n\tcode.\n\n2014-09-25  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Avoid unnecessary long division.\n\n\tThis applies to `FT_MulDiv' but not to `FT_DivFix', where overflows or\n\tlack thereof are predicted accurately.\n\n\t* src/base/ftcalc.c (ft_div64by32): Improve readability.\n\t(FT_MulDiv, FT_MulDiv_No_Round) [!FT_LONG64]: Use straight division\n\twhen multiplication stayed within 32 bits.\n\n2014-09-24  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Minor clean-ups.\n\n\t* src/autofit/afhints.c (AF_FLAGS): Remove obsolete values.\n\n\t* src/autofit/afhints.c (af_glyph_hints_dump_points,\n\taf_glyph_hints_align_strong_points): Updated.\n\n\t* src/autofit/aflatin.c (af_latin_hints_link_segments,\n\taf_latin_hints_compute_segments), src/autofit/afcjk.c\n\t(af_cjk_hints_link_segments), src/autofit/aflatin2.c\n\t(af_latin2_hints_link_segments, af_latin2_hints_compute_segments):\n\tThere are no longer fake segments since more than 10 years...\n\n2014-09-22  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Minor code streamlining.\n\n\t* src/autofit/afhints.c (af_axis_hints_new_edge): Remove redundant\n\tinitialization.\n\n2014-09-19  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t* src/base/ftcalc.c: Harmonize code.\n\n2014-09-15  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Tighten the overflow check in `FT_MulDiv'.\n\n\t* src/base/ftcalc.c (FT_MulDiv) [!FT_LONG64]: Updated.\n\n2014-09-08  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\tFix Savannah bug #43153.\n\n\t* src/psaux/psconv.c (PS_Conv_ToFixed): Add protection against\n\toverflow in `divider'.\n\n2014-09-03  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Tighten the overflow check in `FT_DivFix'.\n\n\tThis fixes a 13-year old bug. The original overflow check should have\n\tbeen updated when rounding was introduced into this function\n\t(c2cd00443b).\n\n\t* src/base/ftcalc.c (FT_DivFix) [!FT_LONG64]: Updated.\n\t* include/freetype.h (FT_DivFix): Updated documentation.\n\n2014-09-03  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Tighten the overflow check in `FT_MulFix'.\n\n\t* src/base/ftcalc.c (FT_MulFix) [!FT_LONG64]: Updated.\n\n2014-09-02  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[truetype] Shortcut ppem calculations for square pixels.\n\n\t* src/truetype/ttinterp.h (TT_ExecContextRec): New field\n\t`cur_ppem_func' with a function pointer.\n\t* src/truetype/ttinterp.c (TT_RunIns): Initialize `cur_ppem_func'\n\tdepending on the pixel geometry to either...\n\t(Current_Ppem_Stretched): ... this for stretched pixels.\n\t(Current_Ppem): ... or this for square pixels.\n\t(DO_MPPEM, DO_MPS, Ins_DELTAP, Ins_DELTAC): Use `cur_ppem_func'.\n\n2014-08-31  Behdad Esfahbod  <behdad@behdad.org>\n\n\tDon't use `register' keyword.  Fixes compiler warnings.\n\n\t* src/base/ftcalc.c (FT_Add64) [!FT_LONG64]: Do it.\n\t* src/gzip/inftrees.c (huft_build): Ditto.\n\t* src/truetype/ttinterp.c (TT_MulFix14_arm): Ditto.\n\n2014-08-24  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[truetype] Optimize DELTAP and DELTAC.\n\n\t* src/truetype/ttinterp.c (Ins_DELTAP, Ins_DELTAC): Move ppem\n\tcalculations outside of the loop.\n\n2014-08-21  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\tFix Savannah bug #43033.\n\n\t* include/config/ftconfig.h, builds/unix/ftconfig.in,\n\tbuilds/vms/ftconfig.h [FT_LONG64]: Do not disable the macro when\n\t64-bit type is `long'.\n\n2014-08-20  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Small optimization of `FT_MulFix'.\n\n\t* src/base/ftcalc.c (FT_MulFix): Loosen up the condition for direct\n\t32-bit calculations.\n\n2014-08-19  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Use unsigned calculation in `FT_MulDiv'.\n\n\t* src/base/ftcalc.c (FT_MulDiv): Updated to expand 32-bit range.\n\n2014-08-18  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Remove truncation in `FT_DivFix'.\n\n\t* src/base/ftcalc.c (FT_DivFix): Updated.\n\n2014-08-14  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\tMinor refactoring.\n\n\t* src/base/ftcalc.c (FT_MulDiv, FT_MulDiv_No_Round): Updated.\n\n2014-08-14  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\tTurn FT_MSB into a macro when using gcc builtins.\n\n\t* src/base/ftcalc.c, include/internal/ftcalc.h: Updated.\n\n2014-08-12  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Avoid undefined FT_MSB in `BBox_Cubic_Check'.\n\n\t* src/base/ftbbox.c (BBox_Cubic_Check): Update.\n\t(update_cubic_max): Repalce with...\n\t(cubic_peak): ... this, which now handles upscaling.\n\n2014-08-11  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Handle collapsed outlines to avoid undefined FT_MSB.\n\n\t* src/base/ftoutln.c (FT_Outline_Get_Orientation): Update.\n\n2014-08-11  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Restore FT_MulFix inlining.\n\n\t* include/freetype.h (FT_MulFix): Unconditionally defined.\n\n\t* src/base/ftcalc.c [FT_MULFIX_ASSEMBLER]: Move code from here...\n\n\t* include/internal/ftcalc.h [FT_MULFIX_ASSEMBLER]: ... to here,\n\twhich conditionally replaces the function with an inline version\n\tthrough the macro.\n\n2014-08-08  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t* src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Refactor.\n\n2014-07-26  Werner Lemberg  <wl@gnu.org>\n\n\t[cff] Fix typo.\n\n\t* src/cff/cf2hints.c (cf2_glyphpath_computeOffset): Use correct\n\toffsets in third quadrant.\n\n\tReported by maks <maksqwe1@ukr.net>.\n\n2014-07-17  Werner Lemberg  <wl@gnu.org>\n\n\tFix Savannah bug #42788.\n\n\t* src/pfr/pfrobjs.c: Include `ftcalc.h'.\n\n2014-07-16  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\tReplace `ft_highpow2' function.\n\n\t* src/pfr/pfrobjs.c (pfr_face_get_kerning): Use `FT_MSB' instead of\n\t`ft_highpow2'.\n\n\t* src/base/ftutil.c, include/internal/ftobjs.h (ft_highpow2): Remove\n\tit.\n\n2014-07-15  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t* src/base/ftcalc.c (FT_MSB): Utilize gcc builtins.\n\n2014-07-15  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Move assembler code back in the source file.\n\n\tFT_MulFix assembler used to reside in ftcalc.c before f47d263f1b.\n\n\t* include/config/ftconfig.h, builds/unix/ftconfig.in,\n\tbuilds/vms/ftconfig.h [FT_MULFIX_ASSEMBLER]: Move code from here...\n\n\t* src/base/ftcalc.c [FT_MULFIX_ASSEMBLER]: ... to here.\n\n2014-07-14  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Further clean up color bitmap conversion.\n\n\t* src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Stop\n\tusing FT_MulFix and FT_DivFix since all calculations fit into 32 bits.\n\n2014-07-13  Werner Lemberg  <wl@gnu.org>\n\n\t[truetype] Improve handling of buggy `prep' tables.\n\n\tIn case of an error in the `prep' table, no longer try to execute it\n\tagain and again.  This makes FreeType handle endless loops in buggy\n\tfonts much faster.\n\n\t* src/truetype/ttobjs.h (TT_SizeRec): The fields `bytecode_ready'\n\tand `cvt_ready' are now negative if not initialized yet, otherwise\n\tthey indicate the error code of the last run.\n\n\t* src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep,\n\ttt_size_done_bytecode, tt_size_init_bytecode,\n\ttt_size_ready_bytecode, tt_size_init, tt_size_done, tt_size_reset):\n\tUpdated.\n\n\t* src/truetype/ttgload.c (tt_loader_init): Updated.\n\t* src/truetype/ttinterp.c (TT_RunIns): Force reexecution of `fpgm'\n\tand `prep' only if we are in the `glyf' table.\n\n2014-07-12  Werner Lemberg  <wl@gnu.org>\n\n\t* builds/vms/ftconfig.h: Synchronize.\n\tProblem reported by Alexei.\n\n2014-07-11  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Clean up bitmap conversion.\n\n\t* src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use\n\tappropriate FT_DivFix and remove superfluous upscaling.\n\n2014-07-04  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Small optimization of the ancient code.\n\n\t* src/base/ftcalc.c (FT_MulDiv, FT_MulDiv_No_Round): Loosen up the\n\tcondition for direct 32-bit calculations.\n\n2014-06-27  Werner Lemberg  <wl@gnu.org>\n\n\tFix Apple standard glyph names.\n\n\t* src/sfnt/ttpost.c (tt_post_default_names): Synchronize with\n\t`tools/glnames.py'\n\n\tProblem reported by Adam Twardoch <adam@fontlab.com>.\n\n2014-06-17  Werner Lemberg  <wl@gnu.org>\n\n\tPartially revert commit from 2014-06-13.\n\n\t* src/autofit/aflatin.c (af_latin_metrics_init_blues): Move\n\tdeclaration of `p_first' and `p_last' out of the loop.\n\n2014-06-17  Werner Lemberg  <wl@gnu.org>\n\n\t* builds/unix/freetype2.m4: s/AC_PATH_PROG/AC_PATH_TOOL/.\n\n\tThis simplifies cross-compiling.\n\n2014-06-13  Werner Lemberg  <wl@gnu.org>\n\n\tFix more compiler warnings.\n\tReported by Wojciech Mamrak <wmamrak@gmail.com>.\n\n\t* src/autofit/afglobal.c (af_face_globals_compute_style_coverage):\n\tMake integer constant unsigned.\n\n\t* src/sfnt/ttsbit.c (tt_face_load_strike_metrics)\n\t<TT_SBIT_TABLE_TYPE_SBIX>: Fix types.\n\t(tt_sbit_decoder_load_compound, tt_face_load_sbix_image): Add proper\n\tcasts.\n\n2014-06-13  Werner Lemberg  <wl@gnu.org>\n\n\tFix compiler warnings.\n\tReported by Wojciech Mamrak <wmamrak@gmail.com>.\n\n\t* src/autofit/afglobal.c (af_face_globals_compute_style_coverage),\n\tsrc/autofit/afmodule.c (af_property_set): Fix `signed' vs.\n\t`unsigned' issues.\n\n\t* src/autofit/aflatin.c (af_latin_metrics_init_blues): Make compiler\n\thappy.\n\n\t* src/base/ftlcdfil.c (_ft_lcd_filter_fir): Use only four elements\n\tfor `fir'.\n\tFix `signed' vs. `unsigned' issues.\n\n\t* src/sfnt/sfobjs.c (WRITE_BYTE): Removed, unused.\n\t(WRITE_USHORT, WRITE_ULONG): Add proper casts.\n\n\t* src/truetype/ttgload.c (TT_Get_VMetrics): Add proper casts.\n\n\t* src/truetype/ttinterp.c (Ins_DELTAP): Add proper casts for `B1'\n\tand `B2'.\n\n2014-05-16  Alexey Petruchik  <alexey.petruchik@gmail.com>\n\n\t[cmake] Add option to build OS X framework.\n\n\t* CMakeLists.txt: Update accordingly.\n\n\t* builds/mac/freetype-Info.plist: New file.\n\n2014-05-13  Pavel Koshevoy  <pkoshevoy@gmail.com>\n\n\t* CMakeLists.txt (BASE_SRCS): Add missing `ftbdf.c'.\n\n2014-05-11  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Fix variable initializations.\n\n\t* src/autofit/afhints.c (af_glyph_hints_reload): Assign default\n\tvalues to `in_dir' and `out_dir' for all points.\n\n2014-05-11  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Fix crash with font `CabinSketch-Bold.ttf'.\n\n\tProblem reported by Ralf S. Engelschall <rse@engelschall.com>.\n\n\t* src/autofit/afhints.c (af_glyph_hints_reload): Fix threshold for\n\tfinding first non-near point.\n\tProperly initialize non-near point deltas.\n\n2014-05-01  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Add blue-zone support for Devanagari.\n\n\tThis essentially moves the Devanagari script from the `Indic' hinter\n\tto the `Latin' hinter.  Thanks to Girish Dalvi\n\t<girish.dalvi@gmail.com> for guidance with blue zone characters!\n\n\t* src/autofit/afblue.dat: Add blue zone data for Devanagari.\n\n\t* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.\n\n\t* src/autofit/afscript.h: Add Devanagari standard characters and\n\tmove data out of AF_CONFIG_OPTION_INDIC block.\n\n\t* src/autofit/afranges.c: Move Devanagari data out of\n\tAF_CONFIG_OPTION_INDIC block.\n\tMove U+20B9, (new) Rupee sign, from Latin to Devanagari.\n\n\t* src/autofit/afstyles.h: Update Devanagari data; in particular, use\n\tAF_WRITING_SYSTEM_LATIN.\n\n2014-05-01  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Fix handling of neutral blue zones in stems.\n\n\t* src/autofit/afhints.h (AF_Edge_Flags): New value\n\t`AF_EDGE_NEUTRAL'.\n\n\t* src/autofit/aflatin.c (af_latin_hints_compute_blue_edges): Trace\n\tneutral blue zones with AF_EDGE_NEUTRAL.\n\t(af_latin_hint_edges): Skip neutral blue zones if necessary.\n\n2014-04-28  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Introduce neutral blue zones to the latin module.\n\n\tSuch blue zones match either the top or the bottom of a contour.  We\n\tneed them for scripts where accent-like elements directly touch the\n\tbase character (for example, some vowel signs in Devanagari, cf.\n\tU+0913 or U+0914).\n\n\t* src/autofit/afblue.hin (AF_BLUE_PROPERTY_LATIN_NEUTRAL): New\n\tproperty.\n\n\t* src/autofit/afblue.h: Regenerated.\n\n\t* src/autofit/aflatin.h (AF_LATIN_IS_NEUTRAL_BLUE): New macro.\n\t(AF_LATIN_BLUE_NEUTRAL): New enumeration value.\n\n\t* src/autofit/aflatin.c (af_latin_metrics_init_blues,\n\taf_latin_hints_compute_blue_edges): Handle neutral blue zones.\n\n2014-04-25  Werner Lemberg  <wl@gnu.org>\n\n\t* src/autofit/hbshim.c: Partially revert commit from 2014-04-17.\n\n\tUsing input glyph coverage data is simply wrong.\n\n\tProblem reported by Nikolaus Waxweiler <madigens@gmail.com> and\n\tMantas Mikulėnas <grawity@gmail.com>.\n\n2014-04-23  Werner Lemberg  <wl@gnu.org>\n\n\t* src/raster/ftraster.c (Vertical_Sweep_Span): Use drop-out mode.\n\n\tThis spot has been missed while introducing support for various\n\tdrop-out modes years ago (including no drop-out mode, which this\n\tcommit fixes).\n\n\tProblem reported by Patrick Thomas <pthomas505@gmail.com>.\n\n2014-04-22  Werner Lemberg  <wl@gnu.org>\n\n\t* src/sfnt/pngshim.c (error_callback): s/longjmp/ft_longjmp/.\n\n2014-04-20  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Fix Savannah bug #42148.\n\n\tThe adaptation of the cjk auto-hinter module to blue stringsets in\n\t2013-08-25 had three severe bugs.  Mea culpa.\n\n\t1. Contrary to the latin auto-hinter, characters for reference and\n\t   overshoot values of a blue zone are specified separately.  Due to\n\t   the screwed-up change it didn't work at all.\n\n\t2. A boolean comparison was erroneously replaced with a cast,\n\t   causing invalid results with the `^' operator later on.  The\n\t   visual artifact caused by this problem is the topic of the bug\n\t   report.\n\n\t3. Two flag values were inverted, causing incorrect assignment of\n\t   reference and overshoot values.\n\n\t* src/autofit/afblue.dat: Fix CJK bluestrings, introducing a new\n\tsyntax to have both reference and overshoot characters in a single\n\tstring.  This is error #1.\n\tAdd extensive comments.\n\n\t* src/autofit/afblue.hin (AF_BLUE_PROPERTY_CJK_FILL): Removed, no\n\tlonger used.\n\t(AF_BLUE_PROPERTY_CJK_TOP, AF_BLUE_PROPERTY_CJK_HORIZ): Fix values.\n\tThis is error #3.\n\n\t* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.\n\n\t* src/autofit/afcjk.c (af_cjk_metrics_init_blues): Correct error #1.\n\tUse character `|' to separate characters for reference and overshoot\n\tvalues.\n\tImprove tracing messages, synchronizing them with the latin\n\tauto-hinter.\n\t(af_cjk_hints_compute_blue_edges): Fix value of `is_top_right_blue'.\n\tThis is error #2.\n\t(af_cjk_align_linked_edge): Add tracing message.\n\n\t* src/autofit/afcjk.h (AF_CJK_IS_FILLED_BLUE): Removed, no longer\n\tused.\n\n2014-04-17  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] More coverage fixes for complex scripts.\n\n\t* src/autofit/hbshim.c (af_get_coverage): Merge input glyph coverage\n\tof GSUB lookups into output coverage.  Otherwise, ligatures are not\n\thandled properly.\n\tDon't check blue zone characters for default coverage.\n\n2014-04-17  Werner Lemberg  <wl@gnu.org>\n\n\tMake `FT_Get_SubGlyph_Info' actually work.\n\n\t* src/base/ftobjs.c (FT_Get_SubGlyph_Info): Return FT_Err_Ok\n\tif there is no error.\n\n2014-04-15  Werner Lemberg  <wl@gnu.org>\n\n\t[afblue.pl]: Minor improvements.\n\n\t* src/tools/afblue.pl: Allow whitespace before comments.\n\tIgnore whitespace in strings.\n\n2014-04-14  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Improve coverage handling.\n\n\t* src/autofit/hbshim.c (af_get_coverage): Don't exclude glyphs\n\tappearing in the GPOS table if we are processing the default\n\tcoverage.\n\n2014-04-13  David Weber <weber.aulendorf@googlemail.com>\n\n\t[smooth] Fix stand-alone compilation.\n\n\t* src/smooth/ftgrays.c (FT_BEGIN_STMNT, FT_END_STMNT): Define.\n\n2014-04-12  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Redesign the recognition algorithm of strong points.\n\n\tIn particular, local extrema without horizontal or vertical segments\n\tare better recognized:\n\n\t  + A                + D\n\t   \\                /\n\t    \\              /\n\t     \\            /\n\t      \\          /\n\t       \\        + C\n\t        \\    /\n\t       B +/\n\n\tIf the distances AB and CD are large, point B wasn't previously\n\tdetected as an extremum since the `ft_corner_is_flat' function\n\t`swallowed' BC regardless of its direction, tagging point B as weak.\n\tThe next iteration started at B and made `ft_corner_is_flat' swallow\n\tpoint C, tagging it as weak also, et voilà.\n\n\tTo improve that, another pass gets now performed before calling\n\t`ft_corner_is_flat' to improve the `topology' of an outline: A\n\tsequence of non-horizontal or non-vertical vectors that point into\n\tthe same quadrant are handled as a single, large vector.\n\n\tAdditionally, distances of near points are now accumulated, which\n\tmakes the auto-hinter handle them as if they were prepended to the\n\tnext non-near vector.\n\n\tThis generally improves the auto-hinter's rendering results.\n\n\t* src/autofit/afhints.c (af_glyph_hints_reload): Implement it.\n\n\t* src/autofit/afhints.h (AF_FLAGS): Remove no longer used flag\n\t`AF_FLAG_NEAR'.\n\n2014-04-05  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Improve scoring algorithm for identifying stems.\n\n\tProblem reported by Karsten Lücke <karsten.luecke@kltf.de>.\n\n\tThe new algorithm takes care of the width of stems: If the distance\n\tbetween two segments is larger than the largest stem width, the\n\tdemerits quickly increase for larger distances.  This improves\n\thinting of slanted fonts (especially if the inner parts of serifs\n\thave non-horizontal `shoulders'), avoiding false stem links.\n\n\t* src/autofit/aflatin.c (af_latin_hints_link_segments): Use largest\n\tstem width (if available) to compute better demerits for distances\n\tbetween stems.\n\t(af_latin_hints_detect_features): Pass stem width array and array\n\tsize.\n\t(af_latin_metrics_init_widths): Updated to use original algorithm.\n\t(af_latin_hints_apply): Updated to use new algorithm.\n\n\t* src/autofit/aflatin.h: Updated.\n\t* src/autofit/afcjk.c: Updated.\n\n2014-04-03  Werner Lemberg  <wl@gnu.org>\n\n\tDon't require `gzip' module for `sfnt'.\n\n\tReported by Preet <prismatic.project@gmail.com>.\n\n\t* src/sfnt/sfobjs.c (woff_open_font): Guard use of\n\tFT_Gzip_Uncompress with FT_CONFIG_OPTION_USE_ZLIB.\n\n2014-03-27  Werner Lemberg  <wl@gnu.org>\n\n\tFix Savannah bug #38235.\n\n\tWork around a bug in pkg-config version 0.28 and earlier: If a\n\tvariable value gets surrounded by doublequotes (in particular values\n\tfor the `prefix' variable), the prefix override mechanism fails.\n\n\t* builds/unix/freetype2.in: Don't use doublequotes.\n\t* builds/unix/unix-def.in (freetype.pc): Escape spaces in directory\n\tnames with backslashes.\n\n2014-03-24  Werner Lemberg  <wl@gnu.org>\n\n\tFix Savannah bug #41946.\n\n\tBased on a patch from Marek Kašík <mkasik@redhat.com>.\n\n\t* builds/unix/configure.raw (LIBS_CONFIG): Remove.\n\t* builds/unix/freetype-config.in (libs): Hard-code value.\n\t* builds/unix/unix-def.in: Updated.\n\n2014-03-22  Werner Lemberg  <wl@gnu.org>\n\n\tAnother revert for the change from 2014-03-18.\n\n\tProblem reported by Nikolaus Waxweiler <madigens@gmail.com>.\n\n\t* src/base/ftcalc.c (FT_MulFix): Ensure that an `FT_MulFix' symbol\n\tgets always exported.\n\n2014-03-20  Werner Lemberg  <wl@gnu.org>\n\n\tCMakeLists.txt: Another fix for include directories.\n\n\tProblem reported by Taylor Holberton <taylorcholberton@gmail.com>.\n\n2014-03-19  Werner Lemberg  <wl@gnu.org>\n\n\tCMakeLists.txt: Fix include directories.\n\n\tProblem reported by Taylor Holberton <taylorcholberton@gmail.com>.\n\n2014-03-19  Werner Lemberg  <wl@gnu.org>\n\n\tPartially revert last commit.\n\n\tFound by Alexei.\n\n\t* src/autofit/aflatin.c (af_latin_metrics_init_blues): Initializing\n\tthose variables is plain wrong, since we are in a loop.\n\n2014-03-18  Sean McBride  <sean@rogue-research.com>\n\t    Werner Lemberg  <wl@gnu.org>\n\n\tFix clang warnings.\n\n\t* src/autofit/aflatin.c (af_latin_metrics_init_blues): Initialize\n\tsome variables.\n\n\t* src/base/ftcalc.c (FT_MulFix): Only use code if\n\t`FT_MULFIX_INLINED' is not defined.\n\n\t* src/bdf/bdfdrivr.c (bdf_cmap_class), src/cache/ftcbasic.c\n\t(ftc_basic_image_family_class, ftc_basic_image_cache_class,\n\tftc_basic_sbit_family_class, ftc_basic_sbit_cache_class),\n\tsrc/cache/ftccmap.c (ftc_cmap_cache_class), src/cache/ftcmanag.c\n\t(ftc_size_list_class, ftc_face_list_class), src/pcf/pcfdrivr.c\n\t(pcf_cmap_class), src/pfr/pfrdrivr.c (pfr_metrics_service_rec): Make\n\tfunction static.\n\n\t* src/type1/t1driver.c (t1_ps_get_font_value): Remove redundant\n\tcode.\n\n2014-03-17  Werner Lemberg  <wl@gnu.org>\n\n\tFix Savannah bug #41869.\n\n\tThis works around a problem with HarfBuzz (<= 0.9.26), which doesn't\n\tvalidate glyph indices returned by\n\t`hb_ot_layout_lookup_collect_glyphs'.\n\n\t* src/autofit/hbshim.c (af_get_coverage): Guard `idx'.\n\n\t* docs/CHANGES: Updated.\n\n2014-03-14  Werner Lemberg  <wl@gnu.org>\n\n\t* builds/unix/configure.raw: Don't show error messages of `which'.\n\n2014-03-09  Alan Coopersmith  <alan.coopersmith@oracle.com>\n\n\tFix cppcheck 1.64 warning.\n\n\t* src/autofit/afglobal.c (af_face_globals_new): Catch NULL pointer\n\tdereference in case of error.\n\n2014-03-09  Sean McBride  <sean@rogue-research.com>\n\n\t* src/sfnt/ttcmap.c (tt_face_build_cmaps): Remove clang warning.\n\n2014-03-06  Werner Lemberg  <wl@gnu.org>\n\n\t* Version 2.5.3 released.\n\t=========================\n\n\n\tTag sources with `VER-2-5-3'.\n\n\t* docs/VERSION.DLL: Update documentation and bump version number to\n\t2.5.3.\n\n\t* README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,\n\tbuilds/windows/vc2005/index.html,\n\tbuilds/windows/vc2008/freetype.vcproj,\n\tbuilds/windows/vc2008/index.html,\n\tbuilds/windows/vc2010/freetype.vcxproj,\n\tbuilds/windows/vc2010/index.html,\n\tbuilds/windows/visualc/freetype.dsp,\n\tbuilds/windows/visualc/freetype.vcproj,\n\tbuilds/windows/visualc/index.html,\n\tbuilds/windows/visualce/freetype.dsp,\n\tbuilds/windows/visualce/freetype.vcproj,\n\tbuilds/windows/visualce/index.html,\n\tbuilds/wince/vc2005-ce/freetype.vcproj,\n\tbuilds/wince/vc2005-ce/index.html,\n\tbuilds/wince/vc2008-ce/freetype.vcproj,\n\tbuilds/wince/vc2008-ce/index.html: s/2.5.2/2.5.3/, s/252/253/.\n\n\t* include/freetype/freetype.h (FREETYPE_PATCH): Set to 3.\n\n\t* builds/unix/configure.raw (version_info): Set to 17:2:11.\n\t* CMakeLists.txt (VERSION_PATCH): Set to 3.\n\t* docs/CHANGES: Updated.\n\n2014-03-06  Werner Lemberg  <wl@gnu.org>\n\n\tFixes for compilation with C++.\n\n\t* src/autofit/hbshim.c (scripts): Change type to `hb_script_t'.\n\t(af_get_coverage): Updated.\n\t(COVERAGE): Add cast.\n\n2014-03-06  Sean McBride  <sean@rogue-research.com>\n\n\tRemove more clang analyzer warnings.\n\n\t* src/bdf/bdflib.c (_bdf_readstream), src/truetype/ttgload.c\n\t(TT_Load_Glyph): Remove dead stores.\n\n2014-03-05  Werner Lemberg  <wl@gnu.org>\n\n\t* builds/unix/configure.raw: Simplify.\n\n2014-03-05  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>\n\n\tFix a bug in configure in library dependency setting\n\tReported in https://bugs.freedesktop.org/show_bug.cgi?id=75652.\n\n\t* builds/unix/configure.raw: Use `x\"${xxx}\" != xno' style.\n\n2014-03-04  Werner Lemberg  <wl@gnu.org>\n\n\tMinor fix for `make devel'.\n\n\t* builds/freetype.mk (INCLUDE_FLAGS) [DEVEL_DIR]: Don't use\n\tpkg-config for bzip2 since not all GNU/Linux distributions have\n\t`bzip2.pc' (and the header file `bzlib.h' is located in /usr/include\n\tnormally).\n\n2014-03-04  Sean McBride  <sean@rogue-research.com>\n\n\tFix several clang static analyzer dead store warnings.\n\n\t* src/autofit/afhints.c (af_glyph_hints_reload,\n\taf_glyph_hints_align_weak_points): Remove unnecessary assignments.\n\n\t* src/bdf/bdflib.c (bdf_font_load): Ditto.\n\n\t* src/pshinter/pshalgo.c (psh_glyph_compute_extrema,\n\tpsh_glyph_interpolate_other_points): Ditto.\n\n\t* src/type1/t1load.c (T1_Set_MM_Blend): Ditto.\n\n2014-03-03  Werner Lemberg  <wl@gnu.org>\n\n\tRewrite library option handling in `configure'.\n\n\to Introduce `auto' value for `--with-XXX' library options; this is\n\t  now the default.\n\n\to First use `pkg-config' for library detection, then fall back to\n\t  other tests.\n\n\t* builds/unix/configure.raw (--with-zlib, --with-bzip2, --with-png,\n\t--with-harfbuzz): Rewrite.\n\tUse new `xxx_reqpriv', `xxx_libpriv', and `xxx_libstaticconf'\n\tvariables to collect data for `freetype2.pc' and `freetype-config'.\n\t(FT2_EXTRA_LIBS): Renamed to ...\n\t(ft2_extra_libs): This since it gets no longer substituted.\n\t(REQUIRES_PRIVATE, LIBS_PRIVATE, LIBS_CONFIG, LIBSSTATIC_CONFIG):\n\tNew output variables, replacing `XXX_PKG' and `LIBXXX'.\n\tAdd notice at the end of `configure' showing the library\n\tconfiguration.\n\n\t* builds/unix/freetype-config.in (--static): New command line\n\toption.\n\t(libs): Updated.\n\t(staticlibs): New variable, to be used if `--static' is given.\n\t* docs/freetype-config.1: Document `--static'.\n\n\t* builds/unix/freetype2.in, builds/unix/unix-def.in: Updated.\n\n2014-03-01  Werner Lemberg  <wl@gnu.org>\n\n\tAvoid `long long' warnings with older gcc compilers.\n\tProblem reported by Hin-Tak Leung <htl10@users.sourceforge.net>.\n\n\t* builds/unix/configure.raw: Don't use gcc's `-pedantic' flag for\n\tversions < 4.6.  This is especially needed for Max OS X since this\n\tOS runs a gcc variant (or emulation) based on version 4.2.1.\n\n2014-03-01  Werner Lemberg  <wl@gnu.org>\n\n\t* docs/INSTALL.CROSS: Revised and updated.\n\n2014-03-01  Werner Lemberg  <wl@gnu.org>\n\n\tMake `make clean' remove `freetype2.pc'.\n\n\tThis is a generated file at build time, not configure time.\n\n\t* builds/unix/unix-def.in (DISTCLEAN): Move `freetype2.pc' to ...\n\t(CLEAN): This variable.\n\n2014-03-01  Werner Lemberg  <wl@gnu.org>\n\n\tUse pkg-config for detecting libpng and libbz2 also.\n\n\t* builds/unix/configure.raw (HAVE_PKG): New variable.\n\tSearch for libbz2 using `pkg-config'; s/BZ2/BZIP2/.\n\tSearch for libpng using `pkg-config'.\n\tFix definition of `LIBHARFBUZZ' variable.\n\t* builds/unix/freetype-config.in ($libs): Updated.\n\t* builds/unix/freetype2.in: Add `URL' field.\n\tUpdate `Requires.private' and `Libs.private'.\n\t* builds/unix/unix-def.in: Updated.\n\n2014-03-01  Werner Lemberg  <wl@gnu.org>\n\n\tAdd configure support for HarfBuzz.\n\n\t* builds/unix/pkg.m4: New file.\n\t* builds/unix/configure.raw: Search for libharfbuzz using\n\t`pkg-config'.\n\tAdd `--without-harfbuzz' option.\n\t* builds/unix/freetype-config.in, builds/unix/freetype2.in,\n\tbuilds/unix/unix-def.in (freetype-config, freetype2.pc): Handle\n\tHarfBuzz.\n\n\t* docs/INSTALL.UNIX: Document interdependency of Freetype with\n\tHarfBuzz.\n\n2014-02-28  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[cff] Math simplifications.\n\n\t* src/cf2blues.c (cf2_blues_init): Use `FT_MulDiv'.\n\t* src/cf2ft.c (cf2_getScaleAndHintFlag): Use simple division.\n\n2014-02-28  Dave Arnold  <darnold@adobe.com>\n\n\t[cff] Fix Savannah bug #41697, part 2.\n\n\t* src/cff/cf2ft.c (cf2_initLocalRegionBuffer,\n\tcf2_initGlobalRegionBuffer): It is possible for a charstring to call\n\ta subroutine if no subroutines exist.  This is an error but should\n\tnot trigger an assert.  Split the assert to account for this.\n\n2014-02-28  Dave Arnold  <darnold@adobe.com>\n\n\t[cff] Fix Savannah bug #41697, part 1.\n\n\t* src/cff/cf2hints.c (cf2_hintmap_build): Return when `hintMask' is\n\tinvalid.  In this case, it is not safe to use the length of\n\t`hStemHintArray'; the exception has already been recorded in\n\t`hintMask'.\n\n2014-02-26  Werner Lemberg  <wl@gnu.org>\n\n\t[sfnt] Fix Savannah bug #41696.\n\n\t* src/sfnt/ttcmap.c (tt_cmap0_validate, tt_cmap2_validate,\n\ttt_cmap4_validate, tt_cmap14_validate): Fix limit tests.\n\n2014-02-26  Werner Lemberg  <wl@gnu.org>\n\n\t[winfnt] Fix Savannah bug #41694.\n\n\t* src/winfonts/winfnt.c (FNT_Load_Glyph): Check glyph offset.\n\n2014-02-26  Werner Lemberg  <wl@gnu.org>\n\n\t[cff] Fix Savannah bug #41693.\n\n\t* src/cff/cffload.c (CFF_Load_FD_Select): Reject empty array.\n\n2014-02-26  Werner Lemberg  <wl@gnu.org>\n\n\t[bdf] Fix Savannah bug #41692.\n\n\tbdflib puts data from the input stream into a buffer in chunks of\n\t1024 bytes.  The data itself gets then parsed line by line, simply\n\tincreasing the current pointer into the buffer; if the search for\n\tthe final newline character exceeds the buffer size, more data gets\n\tread.\n\n\tHowever, in case the current line's end is very near to the buffer\n\tend, and the keyword to compare with is longer than the current\n\tline's length, an out-of-bounds read might happen since `memcmp'\n\tdoesn't stop properly at the string end.\n\n\t* src/bdf/bdflib.c: s/ft_memcmp/ft_strncmp/ to make comparisons\n\tstop at string ends.\n\n2014-02-17  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>\n\n\t[autofit] Fix `make multi' compilation.\n\n\t* src/autofit/hbshim.c: Include `afglobal.h' and `aftypes.h'.\n\n2014-02-19  Werner Lemberg  <wl@gnu.org>\n\t    Simon Bünzli  <zeniko@gmail.com>\n\n\tFix Savannah bug #32902.\n\n\tPatch taken from\n\n\t  https://code.google.com/p/sumatrapdf/source/browse/trunk/ext/_patches/freetype2.patch?spec=svn8620&r=8620#87\n\n\twith slight modifications.\n\n\t* src/type1/t1parse.c (T1_Get_Private_Dict): Add heuristic test to\n\thandle fonts that incorrectly use \\r at the beginning of an eexec\n\tblock.\n\n2014-02-19  Simon Bünzli  <zeniko@gmail.com>\n\n\tFix Savannah bug #41590.\n\n\t* src/type1/t1load.c (parse_encoding): Protect against invalid\n\tnumber.\n\n2014-02-12  Dave Arnold  <darnold@adobe.com>\n\n\t[cff] Optimize by using `FT_MulDiv'.\n\tSuggested by Alexei.\n\n\t* src/cff/cf2font.c (cf2_computeDarkening): Do it.\n\n2014-02-12  Werner Lemberg  <wl@gnu.org>\n\n\tFix Savannah bug #41465.\n\n\t* builds/unix/unix-def.in (CLEAN): Add `freetype-config'.\n\t(DISTCLEAN): Remove `freetype-config'.\n\n2014-02-08  Sean McBride  <sean@rogue-research.com>\n\n\tFix clang static analyzer and compiler warnings.\n\n\t* src/autofit/afhints.c (af_glyph_hints_align_weak_points),\n\tsrc/autofit/afloader (af_loader_load_g) <FT_GLYPH_FORMAT_COMPOSITE>,\n\tsrc/base/ftcalc.c (FT_MSB), src/base/ftoutln.c\n\t(FT_Outline_Decompose), src/bdf/bdfdrivr.c (bdf_interpret_style),\n\tsrc/cff/cffparse.c (cff_parse_integer), src/cid/cidparse.c\n\t(cid_parser_new), src/pfr/pfrload.c (pfr_phy_font_load),\n\tsrc/raster/ftraster.c (Decompose_Curve), src/sfnt/sfdriver.c\n\t(sfnt_get_ps_name), src/sfnt/ttcmap.c (tt_cmap12_next,\n\ttt_cmap13_next), src/smooth/ftgrays.c (gray_hline): Remove dead\n\tcode.\n\n\t* src/autofit/afmodule.c (af_property_get_face_globals,\n\taf_property_set, af_property_get), src/base/ftbitmap.c\n\t(ft_gray_for_premultiplied_srgb_bgra): Make functions static.\n\n\t* src/base/ftobjs.c (ft_remove_renderer): Protect against\n\tlibrary == NULL.\n\t(ft_property_do): Make function static.\n\n\t* src/base/ftrfork.c: Include `ftbase.h'.\n\n\t* src/sfnt/ttsbit.c (tt_face_load_sbix_image)\n\t[!FT_CONFIG_OPTION_USE_PNG], src/type1/t1gload.c\n\t(T1_Compute_Max_Advance): Avoid compiler warning.\n\n\t* src/truetype/ttinterp.c (TT_New_Context): Reduce scope of\n\tvariable.\n\n2014-02-08  Werner Lemberg  <wl@gnu.org>\n\n\tFix Windows build directories.\n\n\tThe build target is now `windows' instead of `win32'.\n\n\tProblem reported by Nickolas George <darknova.clan@gmail.com>.\n\n\t* builds/modules.mk: Don't use `win32' and `win16' (!) but\n\t`windows'.\n\n\t* builds/windows/detect.mk, builds/windows/win32-def.mk:\n\ts/win32/windows/.\n\n2014-02-08  Eugen Sawin  <esawin@mozilla.com>\n\n\tFix Savannah bug #41507.\n\n\t* src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap)\n\t[!FT_CONFIG_OPTION_USE_PNG] <17, 17, 19>: Fix error handling.\n\n2014-02-08  Dave Arnold  <darnold@adobe.com>\n\n\t[cff] Fix minor performance bug.\n\n\t* src/cff/cf2font.c (cf2_font_setup): Darkening amount and blue zone\n\tcalculations are now cached and not recomputed on each glyph.\n\n2014-02-05  Werner Lemberg  <wl@gnu.org>\n\n\tFix problems with perl 5.8.8 as distributed with current MinGW.\n\n\t* src/tools/afblue.pl: Work-around for Perl bug #63402.\n\t(string_re): Avoid `possessive quantifiers', which have been\n\tintroduced in Perl version 5.10.\n\n2014-02-04  Werner Lemberg  <wl@gnu.org>\n\n\tFix compilation with MinGW.\n\n\tRight now, compilation out of the box with latest MinGW is broken\n\tdue to bugs in header files of mingwrt 4.0.3 in strict ANSI mode,\n\tcf.\n\n\t  https://sourceforge.net/p/mingw/bugs/2024/\n\t  https://sourceforge.net/p/mingw/bugs/2046/\n\n\t* builds/unix/configure.raw: Don't set `-ansi' flag for MinGW.\n\n2014-02-04  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Minor fix.\n\n\t* src/autofit/afcjk.c (af_cjk_metrics_init_widths),\n\tsrc/autofit/aflatin.c (af_latin_metrics_init_widths): Fix handling\n\tof alternative standard characters.\n\tThis also fixes a compilation warning in non-debug mode.\n\n2014-02-03  Werner Lemberg  <wl@gnu.org>\n\n\t[cff] Fix Savannah bug #41363.\n\n\t* src/cff/cf2ft.c (cf2_checkTransform): Convert assertion into\n\tparameter check.\n\t(cf2_decoder_parse_charstrings): Call `cf2_checkTransform' only if\n\twe are scaling the outline.\n\t(cf2_getPpemY): Remove problematic assertion.\n\n2014-01-26  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Introduce two more slots for standard characters.\n\n\tThis is useful for OpenType features like `c2sc' (caps to small\n\tcaps) that don't have lowercase letters by definition, or other\n\tfeatures that mainly operate on numerals.\n\n\t* src/autofit/afscript.h: Add more standard characters.\n\n\t* src/autofit/aftypes.h: Update use of `SCRIPT' macro.\n\t(AF_ScriptClassRec): Add members to hold two more standard\n\tcharacters.\n\t(AF_DEFINE_SCRIPT_CLASS): Updated.\n\n\t* src/autofit/afglobal.c, src/autofit/afglobal.h,\n\t* src/autofit/afpic.c, src/autofit/afranges.h, src/autofit/hbshim.c:\n\tUpdate use of `SCRIPT' macro.\n\n\t* src/autofit/afcjk.c (af_cjk_metrics_init_widths),\n\tsrc/autofit/aflatin.c (af_latin_metrics_init_widths): Scan two more\n\tstandard characters.\n\n2014-01-24  Werner Lemberg  <wl@gnu.org>\n\n\tFix Savannah bug #41320.\n\n\t* src/autofit/aflatin.c (af_latin_metrics_init_blues)\n\t<AF_LATIN_IS_LONG_BLUE>: Avoid negative index of `last'.\n\n2014-01-23  Werner Lemberg  <wl@gnu.org>\n\n\tFix Savannah bug #41310.\n\n\t* src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap) <glyph_format==5>:\n\tDon't check metrics, which this format doesn't have.\n\tThis is another correction to the commit from 2013-11-21.\n\n2014-01-23  Werner Lemberg  <wl@gnu.org>\n\n\tFix Savannah bug #41309.\n\n\t* src/type1/t1load.c (t1_parse_font_matrix): Properly handle result\n\tof `T1_ToFixedArray'.\n\n\t* src/cid/cidload.c (cid_parse_font_matrix): Synchronize with\n\t`t1_parse_font_matrix'.\n\n\t* src/type42/t42parse.c (t42_parse_font_matrix): Synchronize with\n\t`t1_parse_font_matrix'.\n\t(t42_parse_encoding): Synchronize with `t1_parse_encoding'.\n\n\t* src/psaux/psobjs.c (ps_parser_load_field) <T1_FIELD_TYPE_BBOX>,\n\t<T1_FIELD_TYPE_MMOX>: Properly handle result of `ps_tofixedarray'.\n\n2014-01-22  Werner Lemberg  <wl@gnu.org>\n\n\t* src/autofit/hbshim.c (af_get_coverage): Fix memory leaks.\n\n2014-01-16  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Improve tracing of style coverages.\n\n\t* include/internal/fttrace.h: Add `afglobal' for tracing style\n\tcoverages.\n\n\t* src/autofit/afglobal.c: Include FT_INTERNAL_DEBUG_H.\n\t(FT_COMPONENT): Define.\n\t(af_face_globals_compute_style_coverage): Trace `gstyles' array\n\tdata.\n\n2014-01-09  Werner Lemberg  <wl@gnu.org>\n\n\tFix Savannah bug #41158.\n\n\t* builds/unix/install.mk (install): Create man page directory.\n\n2014-01-08  Chongyu Zhu  <lembacon@gmail.com>\n\n\t[arm] Fix Savannah bug #41138, part 2.\n\n\t* builds/unix/ftconfig.in (FT_MulFix_arm), include/config/ftconfig.h\n\t(FT_MulFix_arm), src/truetype/ttinterp.c (TT_MulFix14_arm): Fix\n\tpreprocessor conditionals for `add.w'.\n\n2014-01-08  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Fix Savannah bug #41138, part 1.\n\n\t* src/tools/afblue.pl <Handling #endif>: Produce correct auxiliary\n\tenumeration names for generated `#else'.\n\n\t* src/autofit/afblue.h: Regenerated.\n\n2014-01-06  Werner Lemberg  <wl@gnu.org>\n\n\tAdd manual page for `freetype-config'.\n\tContributed by Nis Martensen <nis.martensen@web.de>.\n\n\t* docs/freetype-config.1: New file.\n\n\t* builds/unix/unix-def.in (mandir): Define.\n\t* builds/unix/install.mk (install, uninstall): Handle manpage.\n\n2014-01-05  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Minor fixes for `afblue.pl'.\n\n\t* src/tools/afblue.pl (aux_name): Don't use `reverse'.\n\t<Handling #endif>: Use proper indentation for generated `#else'.\n\n\t* src/autofit/afblue.h: Regenerated.\n\n2014-01-04  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Fix Indic scripts.\n\n\tSplit the single, incorrect Indic entry into separate scripts so\n\tthat the covered ranges are the same: Bengali, Devanagari, Gujarati,\n\tGurmukhi, Kannada, Limbu, Malayalam, Oriya, Sinhala, Sundanese,\n\tSyloti Nagri, Tamil, Telugu, and Tibetan.  At the same time, remove\n\tentries for Meetai Mayak and Sharada – the Unicode ranges were\n\tincorrect (and nobody has complained about that), fonts are scarce\n\tfor those scripts, and the Indic auto-hinter support is rudimentary\n\tanyways.\n\n\t* src/autofit/afscript.h: Updated, using AF_CONFIG_OPTION_INDIC and\n\tAF_CONFIG_OPTION_CJK.\n\n\t* src/autofit/afstyles.h (STYLE_DEFAULT_INDIC): New auxiliary macro.\n\tUse it, together with AF_CONFIG_OPTION_INDIC and\n\tAF_CONFIG_OPTION_CJK, to update.\n\n\t* src/autofit/afranges.c [AF_CONFIG_OPTION_INDIC]: Updated.\n\t[!AF_CONFIG_OPTION_INDIC, !AF_CONFIG_OPTION_CJK]: Removed.\n\tSort entries by tags.\n\n2014-01-03  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Thinko.\n\n\t* src/autofit/hbshim.c (af_get_char_index): Similar to\n\t`af_get_coverage', reject glyphs which are not substituted.\n\n2014-01-03  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Fix handling of default coverages.\n\n\tWith this commit, the implementation of coverage handling is\n\tcompleted.\n\n\t* src/autofit/hbshim.c (af_get_coverage): Exit early if nothing to\n\tdo.\n\tReject coverages which don't contain appropriate glyphs for blue\n\tzones.\n\n2014-01-03  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Fix handling of default coverages.\n\n\t* src/autofit/afglobal.c (af_face_globals_compute_style_coverage):\n\tFirst handle non-default coverages, then the default coverage of the\n\tdefault script, and finally the other default coverages.\n\n2014-01-03  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Fix scaling of HarfBuzz shaping.\n\n\t* src/autofit/hbshim.c (af_get_char_index): Scale to units per EM.\n\n2014-01-03  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Better ftgrid support.\n\n\t* src/autofit/afhints.c (af_glyph_hints_get_segment_offset): Add\n\tparameters `is_blue' and `blue_offset'.\n\n2014-01-01  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Remove some styles.\n\n\t* src/autofit/afcover.h: Remove coverages for alternative fractions,\n\tdenominators, numerators, and fractions.\n\n\t* src/autofit/afstyles.h (META_STYLE_LATIN): Updated.\n\n2014-01-01  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Add more styles.\n\n\t* src/autofit/afstyles.h (STYLE_LATIN, META_STYLE_LATIN): New\n\tauxiliary macros; use them to define styles for Cyrillic, Greek, and\n\tLatin.\n\n\t* src/autofit/afcover.h: Remove coverage for oldstyle figures.\n\tSince those digits are used in combination with ordinary letters, it\n\tmakes no sense to handle them separately.\n\n\t* src/autofit/afglobal.c (af_face_globals_get_metrics): Don't limit\n\t`options' parameter to 4 bits.\n\n2014-01-01  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Fix style assignments to glyphs.\n\n\t* src/autofit/hbshim.c (af_get_coverage)\n\t[FT_CONFIG_OPTION_USE_HARFBUZZ]: Scan GPOS coverage of features also\n\tso that we can skip glyphs that have both GSUB and GPOS data.\n\n2014-01-01  Werner Lemberg  <wl@gnu.org>\n\n\t* src/autofit/hbshim.c: s/{lookups,glyphs}/gsub_{lookups,glyphs}/.\n\n2014-01-01  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Implement and use `af_get_char_index' with HarfBuzz.\n\n\t* src/autofit/hbshim.c (COVERAGE) [FT_CONFIG_OPTION_USE_HARFBUZZ]:\n\tRedefine to construct HarfBuzz features.\n\t(af_get_char_index) [FT_CONFIG_OPTION_USE_HARFBUZZ]: Rewritten.\n\n\t* src/autofit/aflatin.c (af_latin_metrics_init_blues): Use\n\t`y_offset' to adjust `best_y'.\n\n2013-12-31  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] s/AF_STYLE_...._DEFAULT/AF_STYLE_...._DFLT/i.\n\n2013-12-31  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Fix interface of `af_get_char_index'.\n\n\t* src/autofit/hbshim.c (af_get_char_index): Return error value.\n\tAdd argument for y offset (to be used in a yet-to-come patch).\n\n\t* src/autofit/hbshim.h, src/autofit/afcjk.c,\n\tsrc/autofit/aflatin.c: Updated.\n\n2013-12-30  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Don't combine multiple features into one set.\n\n\tCombining them, as originally envisioned, would lead to much more\n\tcomplicated code, as investigations have shown meanwhile.  The major\n\tdrawback is that we run out of available style slots much earlier.\n\tHowever, this is only a theoretical issue since we don't support a\n\tlarge number of scripts currently.\n\n\t* src/autofit/afcover.h: Replace `COVERAGE_{1,2,3}' macros with\n\ta single-element `COVERAGE' macro, sort the elements by the feature\n\ttags, and add entry for `ruby'.\n\n\t* src/autofit/aftypes.h: Updated.\n\t* src/autofit/hbshim.c: Updated.\n\n2013-12-28  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Code shuffling to reduce use of cpp macros.\n\n\t* src/autofit/afglobal.c (af_face_globals_compute_style_coverage):\n\tCall `af_get_coverage' unconditionally.\n\n\t* src/autofit/autofit.c: Include `hbshim.c' unconditionally.\n\n\t* src/autofit/hbshim.c (af_get_coverage)\n\t[!FT_CONFIG_OPTION_USE_HARFBUZZ]: Provide dummy function.\n\n\t* src/autofit/hbshim.h: Provide function declarations\n\tunconditionally.\n\n2013-12-28  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Add wrapper function for `FT_Get_Char_Index'.\n\n\tYet-to-come changes will provide HarfBuzz functionality for the new\n\tfunction.\n\n\t* src/autofit/hbshim.c (af_get_char_index): New function.\n\t* src/autofit/hbshim.h: Updated.\n\n\t* src/autofit/afcjk.c (af_cjk_metrics_init_widths,\n\taf_cjk_metrics_init_blues, af_cjk_metrics_check_digits): Updated.\n\n\t* src/autofit/aflatin.c (af_latin_metrics_init_widths,\n\taf_latin_metrics_init_blues, af_latin_metrics_check_digits):\n\tUpdated.\n\n2013-12-28  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Use `global' HarfBuzz font object.\n\n\tWe now use `hb_font' instead of `hb_face' since yet-to-come changes\n\tneed this.\n\n\t* src/autofit/afglobal.h: Include `hbshim.h'.\n\t(AF_FaceGlobalsRec) [FT_CONFIG_OPTION_USE_HARFBUZZ]: New member\n\t`hb_font'.\n\n\t* src/autofit/afglobal.c (af_face_globals_new)\n\t[FT_CONFIG_OPTION_USE_HARFBUZZ]: Create `hb_font'.\n\t(af_face_globals_free) [FT_CONFIG_OPTION_USE_HARFBUZZ]: Destroy\n\t`hb_font'.\n\n\t* src/autofit/hbshim.h: Include HarfBuzz headers.\n\n\t* src/autofit/hbshim.c: Include `hbshim.h' instead of HarfBuzz\n\theaders.\n\t(af_get_coverage): Updated.\n\n2013-12-27  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Handle `DFLT' OpenType script for coverages.\n\n\t* include/ftautoh.h: Document new `default-script' property.\n\n\t* src/autofit/hbshim.c (af_get_coverage): Use `AF_FaceGlobals' for\n\ttype of first parameter.\n\t(script_tags): Add one more element.\n\t(af_get_coverage): Adjust `script_tags' to handle `DFLT' script tag.\n\n\t* src/autofit/hbshim.h: Updated.\n\n\t* src/autofit/afglobal.c (af_face_globals_compute_style_coverage):\n\tUpdated.\n\n\t* src/autofit/afglobal.h (AF_SCRIPT_DEFAULT): New macro.\n\n\t* src/autofit/afmodule.h (AF_ModuleRec): New `default_script'\n\tmember.\n\n\t* src/autofit/afmodule.c (af_property_set, af_property_get): Handle\n\t`default-script' property.\n\t(af_autofitter_init): Updated.\n\n2013-12-27  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>\n\n\t[ftrfork] Fix the face order difference between POSIX and Carbon.\n\n\tThe fragmented resources in Suitcase and .dfont should be reordered\n\twhen `POST' resource for Type1 is being restored, but reordering of\n\tsfnt resources induces the different face order.  Now the ordering\n\tis restricted to `POST' resource only, to prevent the different\n\torder issue (e.g. the face index in the fontconfig cache generated\n\twith Carbon framework is incompatible with that by FreeType 2\n\twithout Carbon framework.)  Found by Khaled Hosny and Hin-Tak Leung.\n\n\thttp://lists.gnu.org/archive/html/freetype-devel/2013-02/msg00035.html\n\thttp://lists.gnu.org/archive/html/freetype-devel/2013-12/msg00027.html\n\n\t* src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Add a switch\n\t`sort_by_res_id' to control the fragmented resource ordering.\n\t* include/internal/ftrfork.h: Declare new switch.\n\t* src/base/ftobjs.c (IsMacResource): Enable the sorting for `POST'\n\tresource, and disable the sorting for `sfnt' resource.\n\n2013-12-25  Werner Lemberg  <wl@gnu.org>\n\n\tFix Savannah bug #40997.\n\n\t* src/bdf/bdfdrivr.c (BDF_Face_Init): Only use OR operator to\n\tadjust face flags since FT_FACE_FLAG_EXTERNAL_STREAM might already\n\tbe set.\n\t* src/cff/cffobjs.c (cff_face_init): Ditto.\n\t* src/cid/cidobjs.c (cid_face_init): Ditto.\n\t* src/pcf/pcfread.c (pcf_load_font): Ditto.\n\t* src/pfr/pfrobjs.c (pfr_face_init): Ditto.\n\t* src/type1/t1objs.c (T1_Face_Init): Ditto.\n\t* src/type42/t42objs.c (T42_Face_Init): Ditto.\n\t* src/winfonts/winfnt.c (FNT_Face_Init): Ditto.\n\n2013-12-21  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Introduce `coverages'.\n\n\tCoverages are the interface to the HarfBuzz library to acces\n\tOpenType features for handling glyphs not addressable by the cmap.\n\n\tRight now, compilation of HarfBuzz is only added to the development\n\tbuild.  A solution for standard build mode will be delayed until\n\tHarfBuzz gets split into two libraries to avoid mutual dependencies\n\tbetween FreeType and HarfBuzz.\n\n\tNote that this is only a first step in handling coverages, basically\n\tproviding the framework only.  Code for handling selected OpenType\n\tfeatures (this is, actually using the data in `afcover.h') will\n\tfollow.\n\n\t* devel/ftoption.h, include/config/ftoption.h\n\t(FT_CONFIG_OPTION_USE_HARFBUZZ): New macro.\n\n\t* src/autofit/hbshim.c, src/autofit/hbshim.h, src/autofit/afcover.h:\n\tNew files.\n\n\t* src/autofit/afscript.h: Add HarfBuzz script name tags.\n\n\t* src/autofit/afstyles.h: Add default coverage enumeration values.\n\n\t* src/autofit/aftypes.h: Update use of `SCRIPT' and `STYLE' macros.\n\t(AF_Coverage): New enumeration (generated by `afcover.h').\n\t(AF_StyleClassRec): New member `coverage'.\n\t(AF_DEFINE_STYLE_CLASS): Updated.\n\n\t* include/internal/fttrace.h: Add `afharfbuzz' for tracing coverage\n\tdata.\n\n\t* src/autofit/afglobal.h: Update use of `SCRIPT' and `STYLE' macros.\n\t(AF_SCRIPT_FALLBACK): Renamed to ...\n\t(AF_STYLE_FALLBACK): ... this.\n\n\t* src/autofit/afglobal.c: Include `hbshim.c'.\n\tUpdate use of `SCRIPT' and `STYLE' macros.\n\t(af_face_globals_compute_style_coverage)\n\t[FT_CONFIG_OPTION_USE_HARFBUZZ]: Call `af_get_coverage'.\n\tUpdate.\n\n\t* src/autofit/afmodule.h (AF_ModuleRec):\n\ts/fallback_script/fallback_style/.\n\n\t* src/autofit/afmodule.c (af_property_set): Adapt handling of\n\t`fallback-script' property to set a fallback style.\n\t(af_property_get, af_autofitter_init): Updated.\n\n\t* src/autofit/afpic.c: Update use of `SCRIPT' and `STYLE' macros.\n\n\t* src/autofit/afranges.h: Update use of `SCRIPT' macro.\n\n\t* src/autofit/autofit.c [FT_CONFIG_OPTION_USE_HARFBUZZ]: Include\n\t`hbshim.c'.\n\n\t* src/autofit/rules.mk (AUTOF_DRV_SRC): Add `hbshim.c'.\n\t(AUTOF_DRV_H): Add `afcover.h'.\n\n\t* builds/freetype.mk (INCLUDE_FLAGS) [DEVEL_DIR]: Use pkg-config for\n\tall libraries needed by FreeType.\n\n2013-12-21  Werner Lemberg  <wl@gnu.org>\n\n\tFix Savannah bug #40975 (sort of).\n\n\t* src/truetype/ttinterp.c (Ins_IP): Fix sign typo to make FreeType\n\tbehave the same as the Windows TrueType engine for the invalid case.\n\n2013-12-21  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Make PIC mode work actually.\n\n\t* src/autofit/afpic.h (AFModulePIC): Fix array sizes to fit the\n\tenumeration values automatically generated by including `afscript.h'\n\tand friends.\n\n\t* src/autofit/afpic.c (autofit_module_class_pic_init): Updated.\n\n2013-12-21  Werner Lemberg  <wl@gnu.org>\n\n\tFix PIC linking.\n\n\t* include/internal/ftrfork.h (CONST_FT_RFORK_RULE_ARRAY_BEGIN): Fix\n\tgenerated function name.\n\n\t* src/base/basepic.c (FT_Init_Table_raccess_guess_table): Rename\n\tto ...\n\t(FT_Init_Table_ft_raccess_guess_table): ... this so that the\n\tfunction name correctly corresponds to what the macro framework\n\texpects.\n\n\t* src/psnames/rules.mk (PSNAMES_DRV_SRC_S): Use correct file name so\n\tthat PIC functions are compiled also.\n\n2013-12-21  Werner Lemberg  <wl@gnu.org>\n\n\t[base] Add missing dependencies to Makefile.\n\n\t* src/base/rules.mk (BASE_SRC): Add `basepic.c' and `ftpic.c'.\n\t(BASE_H): Add `basepic.h'.\n\n2013-12-20  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Fix PIC compilation.\n\n\t* src/autofit/afcjk.c (af_cjk_metrics_init_widths),\n\tsrc/autofit/aflatin.c (af_latin_metrics_init_widths)\n\t[FT_CONFIG_OPTION_PIC]: Declare `globals'.\n\n\t* src/autofit/afglobal.c: Always call AF_DEFINE_SCRIPT_CLASS, and\n\tAF_DEFINE_STYLE_CLASS.\n\n\t* src/autofit/afpic.c: Include `afglobal.h'.\n\t(autofit_module_class_pic_init): Typo.\n\n\t* src/autofit/aftypes.h (AF_DEFINE_SCRIPT_CLASS,\n\tAF_DEFINE_STYLE_CLASS): Don't use the same identifier for macro\n\tparameter and structure member.\n\n2013-12-20  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Introduce `styles'.\n\n\tThis is the new top-level structure for handling glyph input data;\n\tscripts are now defined separately.\n\n\t* src/autofit/aftypes.h (SCRIPT): Updated.\n\t(AF_ScriptClassRec): Move `blue_stringset' and `writing_system'\n\tmembers to ...\n\t(AF_Style_ClassRec): ... this new structure.\n\t(AF_Style): New enumeration.\n\t(AF_StyleMetricsRec): Replace `script' enumeration with\n\t`style_class' pointer.\n\t(AF_DEFINE_SCRIPT_CLASS, AF_DECLARE_SCRIPT_CLASS): Updated.\n\t(AF_DEFINE_STYLE_CLASS, AF_DECLARE_STYLE_CLASS): New macros.\n\n\t* src/autofit/afstyles.h: New file, using data from `afscript.h'.\n\t* src/autofit/afscript.h: Updated.\n\n\t* src/autofit/afcjk.c (af_cjk_metrics_init_widths,\n\taf_cjk_metrics_init_blues, af_cjk_hint_edges): Updated.\n\n\t* src/autofit/afglobal.c (SCRIPT): Updated.\n\t(STYLE): Redefine macro to load `afstyles.h'.\n\t(af_script_names) [FT_DEBUG_LEVEL_TRACE]: Replace with...\n\t(af_style_names): ... this array.\n\t(af_face_globals_compute_script_coverage): Renamed to...\n\t(af_face_globals_compute_style_coverage): ... this.\n\tUpdated.\n\t(af_face_globals_new, af_face_globals_free,\n\taf_face_globals_get_metrics): Updated.\n\n\t* src/autofit/afglobal.h (SCRIPT): Updated.\n\t(STYLE): Redefine macro to load `afstyles.h'.\n\t(AF_SCRIPT_FALLBACK): Update definition.  This will get more\n\trefinements with later on.\n\t(AF_SCRIPT_UNASSIGNED): Replace with...\n\t(AF_STYLE_UNASSIGNED): ... this macro.\n\t(AF_FaceGlobalsRec): Updated.\n\n\t* src/autofit/aflatin.c (af_latin_metrics_init_widths,\n\taf_latin_metrics_init_blues, af_latin_metrics_scale_dim,\n\taf_latin_hint_edges): Updated.\n\n\t* src/autofit/aflatin2.c (af_latin2_metrics_init_widths): Updated.\n\t(af_ltn2_uniranges): Removed.\n\n\t* src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):\n\tUpdated.\n\n\t* src/autofit/afpic.c (autofit_module_class_pic_init): Updated.\n\t* src/autofit/afpic.h (AF_STYLE_CLASSES_GET): New macro.\n\t(AFModulePIC): Add `af_style_classes' and `af_style_classes_rec'\n\tmembers.\n\n\t* src/autofit/afranges.h: Updated.\n\n\t* src/autofit/rules.mk (AUTOF_DRV_H): Add `afstyles.h'.\n\n2013-12-19  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Factor scripts and uniranges out of writing system files.\n\n\t* src/autofit/afranges.c, src/autofit/afranges.h: New files.\n\n\t* src/autofit/afscript.h: Extend `SCRIPT' macro with more\n\tparameters, taking data from the writing system files.\n\n\t* src/autofit/aftypes.h: Updated.\n\n\t* src/autofit/afglobal.c: Include `afranges.h'.\n\tLoad `afscript.h' to call AF_DEFINE_SCRIPT_CLASS.\n\t* src/autofit/afglobal.c: Include `afranges.h'.\n\tLoad `afscript.h' to call AF_DECLARE_SCRIPT_CLASS.\n\n\t* src/autofit/afcjk.c, src/autofit/afcjk.h: Updated.\n\t* src/autofit/afdummy.c, src/autofit/afdummy.h: Updated.\n\t* src/autofit/afindic.c, src/autofit/afindic.h: Updated.\n\t* src/autofit/aflatin.c, src/autofit/aflatin.h: Updated.\n\t* src/autofit/aflatn2.c, src/autofit/aflatn2.h: Updated.\n\n\t* src/autofit/afpic.c: Updated.\n\n\t* src/autofir/autofit.c: Include `afranges.c'.\n\t* src/autofit/rules.mk (AUTOF_DRV_SRC): Add `afranges.c'.\n\n2013-12-18  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] More code orthogonality.\n\n\t* src/autofit/aftypes.h (AF_StyleMetrics): Replace `script_class'\n\tpointer to an `AF_ScriptClass' structure with `script' index of type\n\t`AF_Script'.\n\tMove some code around.\n\n\t* src/autofit/afcjk.c: Include `afpic.h'.\n\t(af_cjk_metrics_init_widths, af_cjk_metrics_init_blues,\n\taf_cjk_hint_edges): Updated.\n\n\t* src/autofit/aflatin.c: Include `afpic.h'.\n\t(af_latin_metrics_init_widths, af_latin_metrics_init_blues,\n\taf_latin_metrics_scale_dim, af_latin_hint_edges): Updated.\n\n\t* src/autofit/afglobal.c (af_face_globals_get_metrics): Updated.\n\n\t* src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):\n\tUpdated.\n\n2013-12-18  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] s/ScriptMetrics/StyleMetrics/.\n\n2013-12-18  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] s/script_{metrics,hints}/style_{metrics,hints}/\n\n2013-12-18  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] s/gscripts/gstyles/.\n\n2013-12-18  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] s/glyph_scripts/glyph_styles/.\n\n\tThis is the first commit of a series to create a new top-level\n\tstructure (a `style') for handling scripts, writing_systems, and\n\tsoon-to-be-added coverages.\n\n2013-12-17  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] s/AF_Script_/AF_WritingSystem_/ where appropriate.\n\n2013-12-11  Infinality  <infinality@infinality.net>\n\n\t[truetype] Simplify logic of rendering modes.\n\n\tThis patch unifies the subpixel and non-subpixel cases.\n\n\t* src/truetype/ttinterp.h (TT_ExecContextRec): Remove\n\t`grayscale_hinting'; all code should refer to `grayscale' instead.\n\tRemove unused `native_hinting' member.\n\tRename `subpixel_hinting' member to `subpixel.\n\n\t* src/truetype/ttgload.c (TT_LOADER_SET_PP): Updated.\n\t(tt_loader_init): Updated.\n\n\t* src/truetype/ttinterp.c (Ins_GETINFO): Simplify.\n\tUpdated.\n\n2013-12-11  Werner Lemberg  <wl@gnu.org>\n\n\t[documentation] Add section how to include FreeType header files.\n\tProblem reported by David Kastrup <dak@gnu.org>.\n\n\tSurprisingly, a description how to do that was completely missing in\n\tthe API reference.\n\n\t* include/freetype.h, include/ftchapters.h: New documentation\n\tsection `header_inclusion'.\n\n2013-12-10  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] s/DFLT/NONE/, s/dflt/none/.\n\n2013-12-10  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] s/AF_SCRIPT_NONE/AF_SCRIPT_UNASSIGNED/.\n\n2013-12-10  Werner Lemberg  <wl@gnu.org>\n\n\t[truetype] Fix scaling of vertical phantom points.\n\n\t* src/truetype/ttgload.c (load_truetype_glyph): Scale pp3.x and\n\tpp4.x also.\n\n2013-12-10  Werner Lemberg  <wl@gnu.org>\n\n\t[truetype] Fix positioning of composite glyphs.\n\tProblem reported by Nigel Tao <nigeltao@golang.org>.\n\n\t* src/truetype/ttgload.c (TT_Hint_Glyph): Remove code that shifts\n\tthe glyph (component) by a fractional value computed from the LSB\n\tphantom point.  This is wrong, since the horizontal phantom points\n\tget rounded horizontally later on.\n\n2013-12-08  Werner Lemberg  <wl@gnu.org>\n\n\t* Version 2.5.2 released.\n\t=========================\n\n\n\tTag sources with `VER-2-5-2'.\n\n\t* docs/VERSION.DLL: Update documentation and bump version number to\n\t2.5.2.\n\n\t* README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,\n\tbuilds/windows/vc2005/index.html,\n\tbuilds/windows/vc2008/freetype.vcproj,\n\tbuilds/windows/vc2008/index.html,\n\tbuilds/windows/vc2010/freetype.vcxproj,\n\tbuilds/windows/vc2010/index.html,\n\tbuilds/windows/visualc/freetype.dsp,\n\tbuilds/windows/visualc/freetype.vcproj,\n\tbuilds/windows/visualc/index.html,\n\tbuilds/windows/visualce/freetype.dsp,\n\tbuilds/windows/visualce/freetype.vcproj,\n\tbuilds/windows/visualce/index.html,\n\tbuilds/wince/vc2005-ce/freetype.vcproj,\n\tbuilds/wince/vc2005-ce/index.html,\n\tbuilds/wince/vc2008-ce/freetype.vcproj,\n\tbuilds/wince/vc2008-ce/index.html: s/2.5.1/2.5.2/, s/251/252/.\n\n\t* include/freetype/freetype.h (FREETYPE_PATCH): Set to 2.\n\n\t* builds/unix/configure.raw (version_info): Set to 17:1:11.\n\t* CMakeLists.txt (VERSION_PATCH): Set to 2.\n\t* docs/CHANGES: Updated.\n\n2013-12-07  Werner Lemberg  <wl@gnu.org>\n\n\t[truetype] Next round in phantom point handling.\n\n\tGreg Hitchcock provided very interesting insights into the\n\tcomplicated history of the horizontal positions of the TSB and BSB\n\tphantom points.\n\n\t* src/truetype/ttgload.c (TT_LOADER_SET_PP)\n\t[TT_CONFIG_OPTION_SUBPIXEL_HINTING]: Use `subpixel_hinting' and\n\t`grayscale_hinting' flags as conditionals for the x position of TSB\n\tand BSB.\n\n2013-12-05  Werner Lemberg  <wl@gnu.org>\n\n\t* builds/freetype.mk (FT_CC): Removed.  Unused.\n\n2013-12-04  Werner Lemberg  <wl@gnu.org>\n\n\t[sfnt] Fix handling of embedded bitmap strikes.\n\n\tThis corrects the commit from 2013-11-21.  Problem reported by\n\tAndrey Panov <panov@canopus.iacp.dvo.ru>.\n\n\t* src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Fix logic to\n\tdetect excessive bytes for bit-aligned bitmaps.\n\n2013-12-03  Werner Lemberg  <wl@gnu.org>\n\n\t[truetype] Remove dead code.\n\n\tReported by Nigel Tao <nigeltao@golang.org>.\n\n\t* include/internal/tttypes.h (TT_LoaderRec): Remove unused\n\t`preserve_pps' field.\n\t* src/truetype/ttgload.c (TT_Hint_Glyph): Updated.\n\n2013-12-03  Werner Lemberg  <wl@gnu.org>\n\n\t[truetype] Fix phantom point handling.\n\n\tThis is a further improvement to the changes from 2013-11-06.\n\n\t* src/truetype/ttgload.c (TT_Hint_Glyph): Horizontal phantom points\n\tare rounded horizontally, vertical ones are rounded vertically.\n\t(TT_LOADER_SET_PP): The horizontal position of vertical phantom\n\tpoints in pre-ClearType mode is zero, as shown in the OpenType\n\tspecification.\n\n2013-12-02  Werner Lemberg  <wl@gnu.org>\n\n\t[truetype] Fix change from 2013-11-20.\n\n\tProblem reported by Akira Kakuto <kakuto@fuk.kindai.ac.jp>.\n\n\t* src/truetype/ttgload.c (TT_Load_Simple_Glyph): Protect call to\n\t`Update_Max' with both a TT_USE_BYTECODE_INTERPRETER guard and a\n\t`IS_HINTED' clause.\n\tAlso remove redundant check using `maxSizeOfInstructions' – in\n\tsimple glyphs, the bytecode data comes before the outline data, and\n\ta validity test for this is already present.\n\n2013-11-27  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Fix use of dumping functions in `ftgrid' demo program.\n\n\t* src/autofit/afhints.c (AF_DUMP) [FT_DEBUG_AUTOFIT]: New macro.\n\t(af_glyph_hints_dump_points, af_glyph_hints_dump_segments,\n\taf_glyph_hints_dump_edges) [FT_DEBUG_AUTOFIT]: Add parameter to\n\thandle output to stdout.\n\tUse AF_DUMP.\n\t(af_glyph_hints_dump_points, af_glyph_hints_dump_segments,\n\taf_glyph_hints_dump_edges) [!FT_DEBUG_AUTOFIT]: Removed.\n\n2013-11-25  Werner Lemberg  <wl@gnu.org>\n\n\t* Version 2.5.1 released.\n\t=========================\n\n\n\tTag sources with `VER-2-5-1'.\n\n\t* docs/VERSION.DLL: Update documentation and bump version number to\n\t2.5.1.\n\n\t* README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,\n\tbuilds/windows/vc2005/index.html,\n\tbuilds/windows/vc2008/freetype.vcproj,\n\tbuilds/windows/vc2008/index.html,\n\tbuilds/windows/vc2010/freetype.vcxproj,\n\tbuilds/windows/vc2010/index.html,\n\tbuilds/windows/visualc/freetype.dsp,\n\tbuilds/windows/visualc/freetype.vcproj,\n\tbuilds/windows/visualc/index.html,\n\tbuilds/windows/visualce/freetype.dsp,\n\tbuilds/windows/visualce/freetype.vcproj,\n\tbuilds/windows/visualce/index.html,\n\tbuilds/wince/vc2005-ce/freetype.vcproj,\n\tbuilds/wince/vc2005-ce/index.html,\n\tbuilds/wince/vc2008-ce/freetype.vcproj,\n\tbuilds/wince/vc2008-ce/index.html: s/2.5.0/2.5.1/, s/250/251/.\n\n\t* include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.\n\n\t* builds/unix/configure.raw (version_info): Set to 17:0:11.\n\t* CMakeLists.txt (VERSION_PATCH): Set to 1.\n\t* docs/CHANGES, docs/release: Updated.\n\n2013-11-23  Werner Lemberg  <wl@gnu.org>\n\n\t[truetype]: Add tricky font names `hkscsiic.ttf' and `iicore.ttf'.\n\n\t* src/truetype/ttobjs.c (TRICK_NAMES_MAX_CHARACTERS,\n\tTRICK_NAMES_COUNT): Updated.\n\t(trick_names): Add family name for the two fonts.\n\n2013-11-23  Werner Lemberg  <wl@gnu.org>\n\n\t* src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Typo.\n\n2013-11-21  Werner Lemberg  <wl@gnu.org>\n\n\t[sfnt] Typo.\n\n\tProblem reported by Hin-Tak Leung <htl10@users.sourceforge.net>.\n\n\t* src/sfnt/sfobjs.c (sfnt_load_face): Return correct `bsize->width'\n\tvalue if the font lacks an `OS/2' table.\n\n2013-11-21  Werner Lemberg  <wl@gnu.org>\n\n\t[sfnt] Improve handling of buggy embedded bitmap strikes.\n\n\tWe are now able to successfully load `AppleMyoungJo.ttf'.\n\tProblem reported by Hin-Tak Leung <htl10@users.sourceforge.net>.\n\n\t* src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Don't trust glyph\n\tformat.\n\n2013-11-20  Werner Lemberg  <wl@gnu.org>\n\n\t[truetype] Don't trust `maxp's `maxSizeOfInstructions'.\n\n\tProblem reported by Hin-Tak Leung <htl10@users.sourceforge.net>; see\n\n\t  http://lists.nongnu.org/archive/html/freetype-devel/2013-08/msg00005.html\n\n\tfor details.\n\n\t* src/base/ftobjs.c (FT_Load_Glyph): Check size of `fpgm' and `prep'\n\ttables also for setting `autohint'.\n\n\t* src/truetype/ttgload.c (TT_Load_Simple_Glyph): Use code from\n\t`TT_Process_Composite_Glyph' for handling unreliable values of\n\t`maxSizeOfInstructions'.\n\n2013-11-16  Werner Lemberg  <wl@gnu.org>\n\n\t[sfnt] Fix `OS/2' table version 5 support.\n\n\tWe now follow the `official' announcement from Microsoft (on the\n\tOpenType mailing list, which unfortunately hasn't a public archive).\n\n\t* include/freetype/tttables.h (TT_OS2):\n\ts/usLowerPointSize/usLowerOpticalPointSize/,\n\ts/usUpperPointSize/usUpperOpticalPointSize/.\n\n\t* src/sfnt/ttload.c (tt_face_load_os2): Update, and set correct\n\tdefault values.\n\n2013-11-13  Werner Lemberg  <wl@gnu.org>\n\n\t* builds/unix/ft2unix.h: Remove.  No longer necessary.\n\n\t* builds/unix/install.mk (install): Updated.\n\n2013-11-13  Werner Lemberg  <wl@gnu.org>\n\n\tSimplify header file hierarchy.\n\n\tThis large patch changes the header file directory layout from\n\t`include/freetype/...' to `include/...', effectively removing one\n\tlevel.  Since the file `ft2build.h' is also located in `include'\n\t(and it stays there even after installation), all FreeType header\n\tfiles are now in a single directory.\n\n\tApplications that use (a) `freetype-config' or FreeType's\n\t`pkg-config' file to get the include directory for the compiler, and\n\t(b) the documented way for header inclusion like\n\n\t  #include <ft2build.h>\n\t  #include FT_FREETYPE_H\n\t  ...\n\n\tdon't need any change to the source code.\n\n\t* include/freetype/*: Move up to...\n\t* include/*: ... this directory.\n\n\t* builds/amiga/include/freetype/*: Move up to...\n\t* builds/amiga/include/*: ... this directory.\n\n\t*/*: Essentially do `s@/freetype/@/@' where appropriate.\n\n\t* CMakeList.txt: Simplify.\n\t* builds/unix/freetype-config.in, builds/unix/freetype2.in: For\n\t`--cflags', return a single directory.\n\t* builds/unix/install.mk (install): No longer try to remove `cache'\n\tand `internal' subdirectories; instead, remove the `freetype'\n\tsubdirectory.\n\n2013-11-12  Werner Lemberg  <wl@gnu.org>\n\n\t[truetype] Fix last `truetype' commit.\n\n\t* src/truetype/ttgload.c (tt_get_metrics): Preserve stream position.\n\tReturn error value.\n\t(load_truetype_glyph): Updated.\n\n2013-11-10  Werner Lemberg  <wl@gnu.org>\n\n\t* docs/CMAKE: New dummy file.\n\n2013-11-08  Dave Arnold  <darnold@adobe.com>\n\n\t[cff] Fix for hints that touch.\n\n\t* src/cff/cf2hints.c (cf2_hintmap_insertHint): Fix condition for\n\tfinding index value of insertion point.\n\n2013-11-06  Werner Lemberg  <wl@gnu.org>\n\n\t[truetype] Fix handling of phantom points in composite glyphs.\n\tProblem reported by Nigel Tao <nigeltao@golang.org>.\n\n\tThis is a follow-up commit to the previous one.\n\n\t* src/truetype/ttgload.c (load_truetype_glyph): Call\n\t`tt_get_metrics' after loading the glyph header.\n\n2013-11-06  Werner Lemberg  <wl@gnu.org>\n\n\t[truetype] Improve emulation of vertical metrics.\n\n\tThis commit also improves the start values of vertical phantom\n\tpoints.  Kudos to Greg Hitchcock for help.\n\n\t* src/truetype/ttgload.c (TT_Get_VMetrics): Add parameter to pass\n\t`yMax' value.  Replace code with fixed Microsoft definition.\n\t(tt_get_metrics): Updated.\n\t(TT_LOADER_SET_PP): Add explanation how to initialize phantom\n\tpoints, taken from both the OpenType specification and private\n\tcommunication with Greg (which will eventually be added to the\n\tstandard).\n\tFix horizontal position of `pp3' and `pp4'.\n\n\t* src/truetype/ttgload.h: Updated.\n\n\t* src/truetype/ttdriver.c (tt_get_advances): Updated.\n\n\t* docs/CHANGES: Updated.\n\n2013-11-05  Werner Lemberg  <wl@gnu.org>\n\n\t* builds/windows/vc2010/freetype.vcxproj: s/v110/v100/.\n\tPlatformToolSet version 110 is for VC2012.\n\n\tProblem reported (with solution) by Dave Arnold <darnold@adobe.com>.\n\n2013-11-05  Werner Lemberg  <wl@gnu.org>\n\n\t[truetype] Correctly reset point tags for glyph components.\n\tProblem reported by Nigel Tao <nigeltao@golang.org>.\n\n\t* src/truetype/ttgload.c (TT_Process_Composite_Glyph): Fix loop.\n\n2013-11-02  Werner Lemberg  <wl@gnu.org>\n\n\t[truetype] Fix GETINFO opcode handling of subpixel hinting bits.\n\n\t* src/truetype/ttinterp.c (Ins_GETINFO): Don't request bit 6 set to\n\tget info on subpixel hinting.\n\n\t* docs/CHANGES: Updated.\n\n2013-11-02  Werner Lemberg  <wl@gnu.org>\n\n\tFix Savannah bug #40451.\n\n\tSimply apply the patch from the bug report.\n\n\t* builds/unix/ftconfig.in, builds/vms/ftconfig.h,\n\tinclude/freetype/config/ftconfig.h: The used #pragma directives only\n\twork with gcc versions 4.6 and higher.\n\n2013-11-01  Werner Lemberg  <wl@gnu.org>\n\n\t* docs/CHANGES: Updated.\n\n2013-11-01  Werner Lemberg  <wl@gnu.org>\n\n\t[truetype] Minor code refactoring.\n\n\tTwo benefits: The allocated FDEF (and IDEF) array gets slightly\n\tsmaller, and the `ttdebug' demo program has access to function\n\tnumbers without additional costs.\n\n\tFortunately, no changes to FontForge are necessary – this is the\n\tonly external TrueType debugger I know of, but others may exist and\n\tshould check the code accordingly.\n\n\t* src/truetype/ttinterp.h (TT_CallRec): Replace `Cur_Restart' and\n\t`Cur_End' with a pointer to the corresponding `TT_DefRecord'\n\tstructure.\n\n\t* src/truetype/ttinterp.c (DO_JROT, DO_JMPR, DO_JROF, Ins_ENDF,\n\tIns_CALL, Ins_LOOPCALL, Ins_UNKNOWN, TT_RunIns <Invalid_Opcode>):\n\tUpdated.\n\n2013-10-27  Werner Lemberg  <wl@gnu.org>\n\n\t[sfnt] Implement support for `OS/2' table version 5.\n\n\tSee\n\n\t  http://typedrawers.com/discussion/470/new-microsoft-size-specific-design-selection-mechanism\n\n\tfor the announcement.\n\n\t* include/freetype/tttables.h (TT_OS2): Add fields\n\t`usLowerPointSize' and `usUpperPointSize'.  Since FreeType returns\n\tthis structure only as a pointer through `FT_Get_Sfnt_Table', there\n\tshouldn't be any ABI problems.\n\n\t* src/sfnt/ttload.c (tt_face_load_os2): Implement it.\n\n\t* docs/CHANGES: Updated.\n\n2013-10-24  Werner Lemberg  <wl@gnu.org>\n\n\t* README.git, docs/CHANGES, docs/INSTALL: Updated.\n\n2013-10-24  John Cary  <cary@txcorp.com>\n\n\tProvide cmake support.\n\n\t* CMakeLists.txt: New file.\n\n2013-10-23  Kenneth Miller  <kennethadammiller@yahoo.com>\n\t    Werner Lemberg  <wl@gnu.org>\n\n\tProvide support for x64 builds in Visual C++ project files.\n\n\t* src/builds/win32: Renamed to...\n\t* src/builds/windows: This.\n\n\t* src/builds/windows/vc2010/*: Updated to handle x64 target.\n\n\t* src/builds/windows/*.mk, docs/INSTALL.GNU: s/win32/windows/ where\n\tappropriate.\n\n2013-10-22  Werner Lemberg  <wl@gnu.org>\n\n\t* src/base/md5.c, src/base/md5.h: Updated to recent version.\n\n\t* src/base/ftobjs.c: Updated; `md5.c' no longer uses `free'.\n\n\tThe canonical URL to get updates for this file is\n\n\t  http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/popa3d/popa3d/md5/\n\n\tas the author told me in private communication.\n\n2013-10-19  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] s/SMALL_TOP/X_HEIGHT/.\n\n\t* src/autofit/afblue.dat: Updated.\n\n\t* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.\n\n\t* src/autofit/aflatin.c, src/autofit/aflatin.h,\n\tsrc/autofit/atlatin2.c: Updated.\n\n2013-10-19  Werner Lemberg  <wl@gnu.org>\n\n\t* src/autofit/afblue.dat: s/MINOR/DESCENDER/.\n\n\t* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.\n\n2013-10-16  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Add description strings to script entries.\n\n\tCurrently, this is unused.\n\n\t* src/autofit/afscript.h: Do it.\n\t* src/autofit/afglobal.c, src/autofit/afpic.c,\n\tsrc/autofit/aftypes.h: Updated.\n\n2013-10-16  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Improve tracing message for extra light flag.\n\n\t* src/autofit/aflatin.c (af_latin_metrics_scale_dim): Do it.\n\n2013-10-15  Chongyu Zhu  <lembacon@gmail.com>\n\n\t[arm] Fix thumb2 inline assembly under LLVM.\n\n\tWhen using `ADD' with an immediate operand, the instruction is\n\tactually `ADD Rd, Rn, #<imm12>', that is, the maximum of the\n\timmediate operand cannot exceed 4095.  It will fail to compile with\n\tLLVM.\n\n\tHowever, in GCC, due to some legacy compatibility considerations,\n\t`ADD.W' will be automatically emitted when the immediate operand is\n\tlarger than 4095.\n\n\t* builds/unix/ftconfig.in, include/freetype/config/ftconfig.h\n\t(FT_MulFix_arm) [__GNUC__]: Support clang compiler.\n\n\t* src/truetype/ttinterp.c (TT_MulFix14_arm) [__GNUC__]: Ditto.\n\n2013-10-12  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Improve tracing of `latin' hinter.\n\n\t* src/autofit/aflatin.c (af_latin_metrics_init_blues): Report blue\n\tzone types.\n\t(af_latin_metrics_scale_dim): Report scaling changes due to x height\n\talignment.\n\tReport scaled stroke width and blue zone values.\n\n2013-10-03  Dave Arnold  <darnold@adobe.com>\n\n\t* src/cff/cf2font.c (cf2_computeDarkening): Avoid division by zero.\n\n\tNote that the old code avoided using a region of the piecewise\n\tlinear function where the slope was zero.  The recovery was to use a\n\tdifferent section of the function, which produced a different,\n\tincorrect amount of darkening.\n\n2013-10-02  Darrell Bellert  <darrell.bellert@hl.konicaminolta.us>\n\n\t* src/sfnt/ttload.c (tt_face_load_pclt): Fix `pclt_fields'.\n\n2013-10-02  Dave Arnold  <darnold@adobe.com>\n\n\t* src/cff/cf2font.c (cf2_computeDarkening): Initialize darkenAmount.\n\n\tThis line was lost in commit 89ca1fd6 (from 2013-06-25).  The effect\n\tis to use a previous darkening amount when producing an unhinted,\n\tunscaled outline.  This can cause autohint samples in ftgrid and\n\tftview to be based on darkened CFF outlines instead of unhinted,\n\tundarkened ones.\n\n2013-09-29  Dave Arnold  <darnold@adobe.com>\n\n\tFix Savannah bug #39295.\n\n\tThe bug was caused by switching to the initial hintmap (the one in\n\teffect when `moveto' executes) just before drawing the final element\n\tin the charstring.  This ensured that the path was closed (in both\n\tCharacter Space and Device Space).  But if the final element was a\n\tcurve and if the final hintmap was different enough from the initial\n\tone, then the curve was visibly distorted.\n\n\tThe first part of the fix is to draw the final curve using the final\n\thintmap as specified by the charstring.  This corrects the\n\tdistortion but does not ensure closing in Device Space.  It may\n\trequire the rasterizer to automatically generate an extra closing\n\tline.  Depending on the hintmap differences, this line could be from\n\tzero to a couple pixels in length.\n\n\tThe second part of the fix covers the case where the charstring\n\tsubpath is closed with an explicit line.  We now modify that line's\n\tend point to avoid the distortion.\n\n\tSome glyphs in the bug report font (TexGyreHeros-Regular) that show\n\tthe change are:\n\n\t  25ppem    S (98)\n\t  24ppem    eight (52)\n\t  25.5ppem  p (85)\n\n\tCurves at the *end* of a subpath are no longer distorted.  However,\n\tsome of these glyphs have bad hint substitutions in the middle of a\n\tsubpath, and these are not affected.\n\n\tThe patch has been tested with a set of 106 fonts that shipped with\n\tAdobe Creative Suite 4, together with 756 Open Source CFF fonts from\n\tGoogle Fonts.  There are 1.5 million glyphs, of which some 20k are\n\tchanged with the fix.  A sampling of a few hundred of these changes\n\thave been examined more closely, and the changes look good (or at\n\tleast acceptable).\n\n\t* src/cff/cf2hints.h (CF2_GlyphPathRec): New element `pathIsClosing'\n\tto indicate that we synthesize a closepath line.\n\n\t* src/cff/cf2hints.c (cf2_glyphpath_init): Updated.\n\t(cf2_glyphpath_pushPrevElem): If closing, use first hint map (for\n\t`lineto' operator) and adjust hint zone.\n\tFor synthesized closing lines, use end point in first hint zone.\n\t(cf2_glyphpath_lineTo): Take care of synthesized closing lines.  In\n\tparticular, shift the detection of zero-length lines from character\n\tspace to device space.\n\t(cf2_glyphpath_closeOpenPath): Remove assertion.\n\tUpdated.\n\n2013-09-25  Werner Lemberg  <wl@gnu.org>\n\n\t* src/autofit/aflatin.c (af_{grek,cyrl}_uniranges): Fix arrays.\n\n2013-09-25  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>\n\n\t[bdf, pcf] Refuse non-zero face_index.\n\n\tSuggested by Akira Tagoh, see\n\n\t  http://lists.gnu.org/archive/html/freetype/2013-09/msg00030.html\n\n\t* src/bdf/bdfdrivr.c (BDF_Face_Init): Return `Invalid_Argument'\n\terror if the font could be opened but non-zero `face_index' is\n\tgiven.\n\t* src/pcf/pcfdrivr.c (PCF_Face_Init): Ditto.\n\n\t* src/type42/t42objs.c (T42_Face_Init): Remove unrequired FT_UNUSED\n\tmacro for `face_index' because it is validated later.\n\n2013-09-23  Werner Lemberg  <wl@gnu.org>\n\n\tFix Savannah bug #40090.\n\n\t* src/autofit/afcjk.c (af_cjk_metrics_scale): Revert commit\n\t306f8c5d (from 2013-08-25) affecting this function.\n\n2013-09-22  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Disunify Cyrillic and Greek handling from Latin.\n\n\t* src/autofit/afscript.h: Add Cyrillic and Greek.\n\n\t* src/autofit/afblue.dat (AF_BLUE_STRINGSET_GREK,\n\tAF_BLUE_STRINGSET_CYRL): Add blue zones for Greek and Cyrillic.\n\t(AF_BLUE_STRINGSET_LATN): Fix typo.\n\t* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.\n\n\t* src/autofit/aflatin.c (af_grek_uniranges, af_cyrl_uniranges): New\n\tarrays.\n\t(af_grek_script_class, af_cyrl_script_class): New scripts.\n\t* src/autofit/aflatin.h: Updated.\n\n2013-09-20  Werner Lemberg  <wl@gnu.org>\n\n\t* docs/CHANGES: Updated.\n\n2013-09-20  Behdad Esfahbod  <behdad@behdad.org>\n\n\tFix vertical size of emboldened glyphs.\n\n\tCf. https://bugzilla.gnome.org/show_bug.cgi?id=686709\n\n\t* src/base/ftsynth.c (FT_GlyphSlot_Embolden): Adjust `horiBearingY'\n\talso.\n\n2013-09-11  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t* include/freetype/ftoutln.h: Correct FT_Outline_Get_Orientation\n\talgorithm description.\n\n2013-09-11  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Improve Hebrew rendering.\n\n\tThis change introduces a new blue zone property\n\t`AF_BLUE_PROPERTY_LATIN_LONG' to make the auto-hinter ignore short\n\ttop segments.\n\n\t* src/autofit/afblue.dat: Fix Hebrew blue strings.\n\tUse AF_BLUE_PROPERTY_LATIN_LONG for AF_BLUE_STRING_HEBREW_TOP.\n\n\t* src/autofit/afblue.hin (AF_BLUE_PROPERTY_LATIN_LONG): New macro.\n\n\t* src/autofit/afblue.c, src/autofit/afblue.h: Updated.\n\n\t* src/autofit/aflatin.c (af_latin_metrics_init_blues): Handle\n\t`AF_LATIN_IS_LONG_BLUE'.\n\n\t* src/autofit/aflatin.h (AF_LATIN_IS_LONG_BLUE): New macro.\n\n2013-08-28  Behdad Esfahbod  <behdad@google.com>\n\n\t[sfnt] Fix frame access while reading WOFF table directory.\n\n\t* src/sfnt/sfobjs.c (woff_open_font): Using single memory frame\n\twhile reading the directory entries for the whole loop.\n\n2013-08-29  Werner Lemberg  <wl@gnu.org>\n            Behdad Esfahbod  <behdad@google.com>\n\n\tImplement support for WOFF containers.\n\n\tWe simply synthesize a SFNT from the WOFF, create a memory stream\n\tfor the new data, and load the SFNT as usual.\n\n\tDoes NOT add any API to access WOFF metadata or private blocks.\n\n\t* include/freetype/internal/tttypes.h (WOFF_HeaderRec,\n\tWOFF_TableRec): New structures.\n\n\t* include/freetype/tttags.h (TTAG_wOFF): New macro.\n\n\t* src/base/ftobjs.c (FT_Open_Face): Set `stream' after calling\n\t`open_face'.\n\n\t* src/sfnt/sfobjs.c [FT_CONFIG_OPTION_SYSTEM_ZLIB]: Include\n\t`FT_GZIP_H'.\n\t(WRITE_BYTE, WRITE_USHORT, WRITE_ULONG): New temporary macros for\n\twriting to a stream.\n\t(sfnt_stream_close, compare_offsets, woff_open_font): New functions.\n\t(sfnt_open_font): Handle `TTAG_wOFF'.\n\t(sfnt_init_face): Set `stream' after calling `sfnt_open_font'.\n\n\t* src/truetype/ttobjs.c (tt_face_init): Set `stream' after calling\n\t`sfnt->init_face'.\n\n\t* src/base/ftobjs.c (open_face): Use a pointer to FT_Stream as an\n\targument so that a changed stream survives.\n\tUpdate callers.\n\n2013-08-28  Werner Lemberg  <wl@gnu.org>\n\n\t[gzip] New function `FT_Gzip_Uncompress'.\n\n\tThis is modeled after zlib's `uncompress' function.  We need this\n\tfor WOFF support.\n\n\t* include/freetype/ftgzip.h, src/gzip/ftgzip.c (FT_Gzip_Uncompress):\n\tNew function.\n\n\t* src/gzip/rules.mk: Rewrite to better reflect dependencies.\n\n2013-08-28  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Fix `make multi' compilation.\n\n\t* src/autofit/afblue.cin, src/autofit/afblue.c: Don't include\n\t`afblue.h' but `aftypes.h'.\n\t* src/autofit/afcjk.c: Don't include `aftypes.h' but `afglobal.h'.\n\n2013-08-28  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Fix C++ compilation.\n\n\t* src/autofit/afglobal.c (af_face_globals_get_metrics),\n\tsrc/autofit/afdummy.c (af_dflt_script_class), src/autofit/afindic.c\n\t(af_deva_script_class): Use proper casts.\n\n2013-08-27  Behdad Esfahbod  <behdad@google.com>\n\n\t* src/sfnt/ttload.c (tt_face_load_font_dir): Fix sign typos.\n\n2013-08-27  Behdad Esfahbod  <behdad@google.com>\n\n\tFT_Open_Face: Improve external stream handling.\n\n\tIf the font's `clazz->init_face' function wants to swap to new\n\tstream, handling of whether original stream was external could\n\tresult to either memory leak or double free.  Mark externality into\n\tface flags before calling `init_face' such that the clazz can handle\n\texternal streams properly.\n\n\t* src/base/ftobjs.c (FT_Open_Face): Move code to set\n\tFT_FACE_FLAG_EXTERNAL_STREAM to...\n\t(open_face): This function.\n\n2013-08-27  Werner Lemberg  <wl@gnu.org>\n\n\tRemove `FT_SqrtFixed' function.\n\n\tIt's no longer used.\n\n\t* include/freetype/internal/ftcalc.h, src/base/ftcalc.c: Do it.\n\n2013-08-27  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] While tracing, report script names instead of ID values.\n\n\t* src/autofit/afglobal.c (af_script_names) [FT_DEBUG_LEVEL_TRACE]:\n\tNew array.\n\t* src/autofit/afglobal.h: Updated.\n\n\t* src/autofit/afcjk.c (af_cjk_metrics_init_widths,\n\taf_cjk_hint_edges): Use `af_script_names'.\n\t* src/autofit/aflatin.c (af_latin_metrics_init_widths,\n\taf_latin_hint_edges): Ditto.\n\n2013-08-26  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Report used script while hinting a glyph.\n\n\t* src/autofit/afcjk.c (af_cjk_hint_edges), src/autofit/aflatin.c\n\t(af_latin_hint_edges): Implement it.\n\n2013-08-26  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Add support for Hebrew script.\n\n\t* src/autofit/afblue.dat: Add blue strings for Hebrew.\n\t* src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.\n\n\t* src/autofit/aflatin.c (af_hebr_uniranges): New array.\n\t(af_hebr_script_class): New script.\n\t* src/autofit/aflatin.h, src/autofit/afscript.h: Updated.\n\n2013-08-26  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Improve tracing messages.\n\n\t* src/autofit/afcjk.c (af_cjk_metrics_init_widths): Mention script\n\tID in tracing message.\n\t(af_cjk_metrics_init_blues): Initialize `axis' outside of the inner\n\tloop.\n\tImprove tracing messages.\n\t(af_cjk_hint_edges) [FT_DEBUG_LEVEL_TRACE]: New variable\n\t`num_actions' to count hinting actions.\n\tImprove tracing messages.\n\n\t* src/autofit/aflatin.c (af_latin_metrics_init_widths): Mention\n\tscript ID in tracing message.\n\t(af_latin_metrics_init_blues, af_latin_hint_edges): Improve tracing\n\tmessages.\n\n2013-08-26  Werner Lemberg  <wl@gnu.org>\n\n\tBetter tracing of loaded glyphs.\n\n\tPreviously, the loading of a glyph was traced at level 4, if at all.\n\tWith this change, all font loading routines emit a tracing message\n\tat level 1, making it easier to select tracing output (for example\n\tusing F2_DEBUG=\"any:1 afhints:7 aflatin:7\").\n\n\t* src/bdf/bdfdrivr.c (BDF_Glyph_Load): Add tracing message.\n\t* src/cff/cffdrivr.c (cff_glyph_load): Ditto.\n\t* src/cff/cffgload.c (cff_decoder_prepare): Improve tracing\n\tmessages.\n\t* src/cid/cidgload.c (cid_load_glyph): Use level 1 for tracing\n\tmessage.\n\t* src/pcf/pcfdrivr.c (PCF_Glyph_Load): Ditto.\n\t* src/pfr/pfrobjs.c (pfr_slot_load): Add tracing message.\n\t* src/truetype/ttgload.c (TT_Load_Glyph): Ditto.\n\t* src/type1/t1gload.c (T1_Load_Glyph): Ditto.\n\t* src/type42/t42objs.c (T42_GlyphSlot_Load): Ditto.\n\t* src/winfonts/winfnt.c (FNT_Load_Glyph): Ditto.\n\n2013-08-26  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Fix script selection.\n\n\t* src/autofit/afglobal.c (af_face_globals_get_metrics): Use\n\t`AF_SCRIPT_DFLT', not value 0.\n\tSimplify code.\n\n\t* src/autofit/afscript.h: Sort by script name.\n\n2013-08-26  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Make `dummy' hinter work as expected.\n\n\t* src/autofit/afdummy.c (af_dummy_hints_init): Properly set scaling\n\tinformation.\n\t(af_dummy_hints_apply): Scale the glyphs.\n\n2013-08-25  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Make `cjk' module use blue stringsets.\n\n\t* src/autofit/afcjk.c (AF_CJK_MAX_TEST_CHARACTERS): Removed.\n\t(af_cjk_hani_blue_chars): Removed.\n\t(AF_CJK_BLUE_TYPE_*): Removed.\n\t(af_cjk_metrics_init_blues): Replace AF_CJK_MAX_TEST_CHARACTERS with\n\tAF_BLUE_STRING_MAX_LEN.\n\tChange loops to use offsets (in file `afblue.h') into the new arrays\n\t`af_blue_stringsets' and `af_blue_strings' (in file `afblue.c').\n\tInstead of three dimensions (as used in the old blue string array)\n\twe now use properties to do the same, saving one loop nesting level.\n\n\t* src/autofit/afcjk.h: Remove old enumeration values superseded by\n\tthe new data in `afblue.h'.\n\t(AF_CJK_IS_TOP_BLUE, AF_CJK_IS_HORIZ_BLUE, AF_CJK_IS_FILLED_BLUE,\n\tAF_CJK_IS_RIGHT_BLUE): New macros, to be used in\n\t`af_cjk_metrics_init_blues'.\n\t(AF_CJK_BLUE_IS_RIGHT): Remove this now redundant enum value.\n\t(AF_CJK_BLUE_IS_TOP): Renamed to...\n\t(AF_CJK_BLUE_TOP): This.\n\t(AF_CJK_MAX_BLUES): Remove.\n\t(AF_CJKAxisRec): Updated.\n\n2013-08-25  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Typo.\n\n\t* src/autofit/afblue.hin, src/autofit/afblue.c (GET_UTF8_CHAR): Use\n\tcast.\n\n2013-08-25  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Synchronize `cjk' with `latin' module (and vice versa).\n\n\t* src/autofit/afcjk.c (af_cjk_metrics_init_widths): Add tracing\n\tmessages.\n\t(af_cjk_metrics_init_blues): Don't pass blue string array as\n\targument but use the global array directly.\n\tUse `outline' directly.\n\tUpdate and add tracing messages.\n\t(af_cjk_metrics_init): Simplify code.\n\t(af_cjk_metrics_scale_dim): Improve tracing message.\n\t(af_cjk_metrics_scale): Synchronize.\n\n\t* src/autofit/aflatin.c (af_latin_metrics_init_widths,\n\taf_latin_metrics_init_blues): Improve and add tracing messages.\n\n2013-08-25  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Make `latin' module use blue stringsets.\n\n\t* src/autofit/aflatin.c (AF_LATIN_MAX_TEST_CHARACTERS): Removed.\n\t(af_latin_blue_chars): Removed.\n\t(af_latin_metrics_init_blues): Replace AF_LATIN_MAX_TEST_CHARACTERS\n\twith AF_BLUE_STRING_MAX_LEN.\n\tChange loops to use offsets (in file `afblue.h') into the new arrays\n\t`af_blue_stringsets' and `af_blue_strings' (in file `afblue.c').\n\tUse `AF_LATIN_IS_SMALL_TOP_BLUE' macro.\n\n\t* src/autofit/aflatin.h: Remove old enumeration values superseded by\n\tthe new data in `afblue.h'.\n\t(AF_LATIN_IS_TOP_BLUE): Updated definition.\n\t(AF_LATIN_IS_SMALL_TOP_BLUE): New macro.\n\t(AF_LATIN_MAX_BLUES): Remove.\n\t(AF_LatinAxisRec): Updated.\n\n2013-08-25  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Add blue stringsets.\n\n\t* src/autofit/aftypes.h: Include `afblue.h'.\n\t(AF_ScriptClassRec): Add `blue_stringset' field.\n\t(AF_DEFINE_SCRIPT_CLASS): Updated.\n\n\t* src/autofit/autofit.c: Include `afblue.c'.\n\n\t* src/autofit/afcjk.c (af_hani_script_class), src/autofit/afdummy.c\n\t(af_dflt_script_class), src/autofit/afindic.c\n\t(af_deva_script_class), src/autofit/aflatin.c\n\t(af_latn_script_class), src/autofit/aflatin2.c\n\t(af_ltn2_script_class): Updated.\n\n\t* src/autofit/rules.mk (AUTOF_DRV_SRC): Add `afblue.c'.\n\n2013-08-25  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Introduce data file for blue strings.\n\n\tThe idea is to have a central file which gets processed by a Perl\n\tscript to create proper `.c' and `.h' files using templates.  There\n\tare two other reasons to do that:\n\n\t  . The data file should be easily readable.  We use UTF-8 encoding\n\t    which then gets converted to single bytes.\n\n\t  . Since the number of supported scripts will increase soon, the\n\t    current usage of blue string arrays is a waste of space.  Using\n\t    the Perl script it is possible to imitate jagged arrays,\n\t    defining enumeration constants as offsets into the arrays.\n\n\tThis commit only adds files without changing any functionality.\n\n\t* src/autofit/afblue.dat: New data file.\n\t* src/tools/afblue.pl: New Perl script for processing `afblue.dat'.\n\n\t* src/autofit/afblue.cin, src/autofit/afblue.hin: New template files\n\tfor...\n\t* src/autofit/afblue.c, src/autofit/afblue.c: New source files.\n\tTo avoid a dependency on Perl, we add them too.\n\n2013-08-19  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Enable new algorithm for `BBox_Cubic_Check'.\n\n\t* src/base/ftbbox.c: Enable new BBox_Cubic_Check algorithm, remove\n\tthe old one.\n\tImprove comments.\n\n2013-08-18  Werner Lemberg  <wl@gnu.org>\n\n\t* builds/unix/unix-def.in (freetype2.pc): Don't set executable bit.\n\n2013-08-18  Werner Lemberg  <wl@gnu.org>\n\n\tFix Savannah bug #39804.\n\n\t* builds/unix/configure.raw (LIBPNG): Define and export.\n\t* builds/unix/freetype-config.in, builds/unix/freetype2.in: Handle\n\tlibpng.\n\n2013-08-17  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Clean up BBox_Conic_Check.\n\n\t* src/base/ftbbox.c (BBox_Conic_Check): Remove redundant checks for\n\textremum at the segment ends, which are already within the bbox.\n\tSlightly modify calculations.\n\n2013-08-15  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Finish experimental (disabled) BBox_Cubic_Check implementation.\n\n\t* src/base/ftbbox.c (BBox_Cubic_Check): Scale arguments to improve\n\taccuracy and avoid overflows.\n\n2013-08-13  Alexei Podtelezhnikov  <apodtele@gmail.com>\n\n\t[base] Refactor experimental (disabled) BBox_Cubic_Check.\n\n\t* src/base/ftbbox.c (BBox_Cubic_Check): Implement the minimum search\n\tas the mirror image of the maximum search implemented here...\n\t(update_max): New function.\n\n2013-08-06  John Tytgat  <John.Tytgat@esko.com>\n\n\tFix Savannah bug #39702.\n\n\t* src/cff/cffload.c (cff_index_get_pointers): Check for `cur_offset\n\t!= 0'; this stronger test is mandated by the CFF specification.\n\tFix test for INDEX structures which have one or more empty entries\n\tat the end.\n\n2013-08-05  Werner Lemberg  <wl@gnu.org>\n\n\tFix gcc pragmas, part 2.\n\n\t* src/truetype/ttinterp.c (TT_MulFix14_long_long,\n\tTT_DotFix14_long_long): `#pragma gcc diagnostic {push,pop}' has been\n\tintroduced with gcc version 4.6.\n\n2013-08-05  Werner Lemberg  <wl@gnu.org>\n\n\tFix gcc pragmas.\n\n\t* src/truetype/ttinterp.c (TT_MulFix14_long_long,\n\tTT_DotFix14_long_long): Older gcc versions don't accept diagnostic\n\tpragmas within a function body.\n\n2013-08-05  Werner Lemberg  <wl@gnu.org>\n\n\tFix Savannah bug #39700.\n\n\t* builds/unix/ftconfig.h: Synchronize with\n\t`include/freetype/config/ftconfig.h'.\n\n\t* builds/vms/ftconfig.h: Ditto.\n\tMake the differences to the master `ftconfig.h' file as small as\n\tpossible for easier maintainance.\n\n2013-08-05  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Improve handling of `near' points.\n\n\tPoints which are very near to each other are now marked as such.\n\tThe `weak' flag is then computed by using the `in' vector of the\n\tfirst and the `out' vector of the last point of a group of near\n\tpoints.\n\n\tFor example, this fixes the rendering of glyph `Oslash' in\n\t`Roboto-Thin.ttf'.\n\n\t* src/autofit/afhints.h (AF_Flags): New value `AF_FLAGS_NEAR'.\n\n\t* src/autofit/afhints.c (af_glyph_hints_reload): Introduce\n\tthe heuristic value `near_limit' to decide whether the current point\n\tis near to the previous one, then set `AF_FLAG_NEAR' accordingly.\n\tStore good `in' vector (of last non-near point) in\n\t`last_good_in_{x,y}' and use it as an argument to\n\t`ft_corner_is_flat' if necessary.\n\n2013-08-02  Werner Lemberg  <wl@gnu.org>\n\n\t* include/freetype/ftcffdrv.h: Improve documentation.\n\tThis is based on blog entries from David Lemon and Dave Arnold (both\n\tfrom Adobe) with kind permission.  Dave also helped in\n\tproof-reading.\n\n2013-08-02  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Move declaration of scripts into separate file.\n\n\tThis has the benefit that we don't need to duplicate the data at\n\tdifferent places.\n\n\t* src/autofit/afscript.h: New file.\n\n\t* src/autofit/aftypes.h (AF_Script): Include `afscript.h' to define\n\tthe enumeration values.\n\n\t* src/autofit/afglobal.c: Include `afscript.h' to get the script\n\tspecific header files.\n\t(af_script_classes): Include `afscript.h' to fill this array.\n\n\t* src/autofit/afpic.c: Include `afscript.h' to get the script\n\tspecific header files.\n\t(autofit_module_class_pic_init): Include `afscript.h' for\n\tinitialization.\n\t* src/autofit/afpic.h (AF_SCRIPT_CLASSES_COUNT,\n\tAF_SCRIPT_CLASSES_REC_COUNT): Removed.  Use `AF_SCRIPT_MAX' instead.\n\n\t* src/autofit/rules.mk (AUTOF_DRV_H): Updated.\n\n2013-08-02  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Move declaration of writing systems into separate file.\n\n\tThis has the benefit that we don't need to duplicate the data at\n\tdifferent places.\n\n\t* src/autofit/afwrtsys.h: New file.\n\n\t* src/autofit/aftypes.h (AF_WritingSystem): Include `afwrtsys.h' to\n\tdefine the enumeration values.\n\n\t* src/autofit/afglobal.c: Include `afwrtsys.h' to get the writing\n\tsystem specific header files.\n\tInclude `afpic.h'.\n\t(af_writing_system_classes): Include `afwrtsys.h' to fill this\n\tarray.\n\n\t* src/autofit/afpic.c: Include `afwrtsys.h' to get the writing\n\tsystem specific header files.\n\t(autofit_module_class_pic_init): Include `afwrtsys.h' for\n\tinitialization.\n\t* src/autofit/afpic.h (AF_WRITING_SYSTEM_CLASSES_COUNT,\n\tAF_WRITING_SYSTEM_CLASSES_REC_COUNT): Removed.  Use\n\t`AF_WRITING_SYSTEM_MAX' instead.\n\n2013-08-02  Werner Lemberg  <wl@gnu.org>\n\n\t[sfnt] Fix compilation with g++.\n\n\t* src/sfnt/pngshim.c (error_callback, read_data_from_FT_stream): Use\n\tcast.\n\t(Load_SBit_Png): Pacify compiler.\n\n2013-08-02  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>\n            Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Fix `make multi'.\n\n\t* include/freetype/config/ftconfig.h (FT_LOCAL_ARRAY,\n\tFT_LOCAL_ARRAY_DEF): New macros.\n\n\t* src/autofit/afglobal.c (af_writing_system_classes,\n\taf_script_classes): Use FT_LOCAL_ARRAY_DEF.\n\t* src/autofit/afglobal.h: Declare `af_writing_system_classes' and\n\t`af_script_classes'.\n\t* src/autofit/afloader.c: Include `afpic.h'.\n\n2013-08-01  Werner Lemberg  <wl@gnu.org>\n\n\tAnother round of cppcheck nitpicks.\n\n\tThe call was (from the top-level of the FreeType tree):\n\n\t  cppcheck --force \\\n\t           --enable=all \\\n\t           -I /usr/include \\\n\t           -I /usr/local/include \\\n\t           -I /usr/lib/gcc/i586-suse-linux/4.7/include \\\n\t           -I include \\\n\t           -I include/freetype \\\n\t           -I include/freetype/config \\\n\t           -I include/freetype/internal \\\n\t           -DFT2_BUILD_LIBRARY \\\n\t           . &> cppcheck.log\n\n\tusing cppcheck git commit f7e93f99.\n\n\tNote that cppcheck still can't handle `#include FOO' (with `FOO' a\n\tmacro).\n\n\t*/* Improve variable scopes.\n\t*/* Remove redundant initializations which get overwritten.\n\n\t* src/gxvalid/*: Comment out redundant code or guard it with\n\tFT_DEBUG_LEVEL_TRACE.\n\n2013-07-30  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Introduce `writing systems'.\n\n\tThis patch adds a new top level to the auto-hinter's script class\n\thierarchy.  It defines `writing systems' which can contain multiple\n\tscripts.\n\n\tFor example, the `latin' writing system (in file `aflatin.c') is\n\table to support scripts like Latin, Cyrillic, Armenian, etc., which\n\tcan be handled similarly.\n\n\tScripts are now named using four-letter OpenType tags.\n\n\t* src/autofit/aftypes.h (AF_ScriptClassRec): Move relevant members\n\tto...\n\t(AF_WritingSystemClassRec): This new structure.  It holds pointers\n\tto functions which can be shared among related scripts.\n\t(AF_WritingSystem): New enumeration.\n\t(AF_Script): Revised values using four-letter tags.\n\t(AF_DEFINE_WRITING_SYSTEM_CLASS): New macro.\n\t(AF_DEFINE_SCRIPT_CLASS): Updated.\n\n\t* src/autofit/afglobal.c (af_writing_system_classes): New global,\n\tconstant array.\n\t(af_script_classes): Updated.\n\t(af_face_globals_free): Updated.\n\tRemove assertion.\n\t(af_face_globals_get_metrics): Updated.\n\n\t* src/autofit/afglobal.h (AF_SCRIPT_FALLBACK)\n\t[!AF_CONFIG_OPTION_CJK]: Handle this case.\n\n\t* src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):\n\tUpdated.\n\n\t* src/autofit/afpic.c (autofit_module_class_pic_init): Updated;\n\tinitialize structures for both writing systems and scripts.\n\t* src/autofit/afpic.h: Updated.\n\t(AF_WRITING_SYSTEM_CLASSES_GET): New macro.\n\n\t* src/autofit/afcjk.c (af_cjk_writing_system_class): New writing\n\tsystem.\n\t(af_cjk_uniranges): Renamed to...\n\t(af_hani_uniranges): This.\n\t(af_cjk_script_class): Reduced and renamed to...\n\t(af_hani_script_class): This.\n\t* src/autofit/afcjk.h: Updated.\n\n\t* src/autofit/afdummy.c (af_dummy_writing_system_class): New writing\n\tsystem.\n\t(af_dummy_script_class): Reduced and renamed to...\n\t(af_dflt_script_class): This.\n\t* src/autofit/afdummy.h: Updated.\n\n\t* src/autofit/afindic.c (af_indic_writing_system_class): New writing\n\tsystem.\n\t(af_indic_uniranges): Renamed to...\n\t(af_deva_uniranges): This.\n\t(af_indic_script_class): Reduced and renamed to...\n\t(af_deva_script_class): This.\n\t* src/autofit/afcjk.h: Updated.\n\n\t* src/autofit/aflatin.c (af_latin_writing_system_class): New writing\n\tsystem.\n\t(af_latin_uniranges): Renamed to...\n\t(af_latn_uniranges): This.\n\t(af_latin_script_class): Reduced and renamed to...\n\t(af_latn_script_class): This.\n\t* src/autofit/aflatin.h: Updated.\n\n\t* src/autofit/aflatin2.c (af_latin2_writing_system_class): New\n\twriting system.\n\t(af_latin2_uniranges): Renamed to...\n\t(af_ltn2_uniranges): This.\n\tSynchronize ranges with `latin'.\n\t(af_latin2_script_class): Reduced and renamed to...\n\t(af_ltn2_script_class): This.\n\t* src/autofit/aflatin2.h: Updated.\n\n2013-07-30  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Variable renaming.\n\n\t* src/autofit/aftypes.h (AF_ScriptMetricsRec):\n\ts/clazz/script_class/.\n\tUpdate all users.\n\n2013-07-30  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>\n\n\tIgnore libpng-config under cross-building configuration,\n\tbecause it will return the flags for the hosting environment.\n\n\t* builds/unix/configure.raw: Ignore libpng-config when\n\t`cross_compiling' == yes.\n\n2013-07-30  Behdad Esfahbod  <behdad@google.com>\n\n\tPrevent division by zero by a transparent color.\n\n\t* src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra):\n\tReturn 0 immediately, when alpha channel is zero.\n\n2013-07-25  Behdad Esfahbod  <behdad@google.com>\n\n\tAdd FT_FACE_FLAG_COLOR and FT_HAS_COLOR.\n\n\tAlso disambiguate Google's color bitmap tables.\n\n\t* include/freetype/freetype.h (FT_FACE_FLAG_COLOR, FT_HAS_COLOR):\n\tNew macros.\n\n\t* include/freetype/internal/tttypes.h (TT_SbitTableType): Add\n\tTT_SBIT_TABLE_TYPE_CBLC.\n\n\t* src/sfnt/sfobjs.c (sfnt_load_face): Handle FT_FACE_FLAG_COLOR.\n\n\t* src/sfnt/ttsbit.c (tt_face_load_sbit,\n\ttt_face_load_strike_metrics, tt_face_load_sbit_image): Handle\n\tTT_SBIT_TABLE_TYPE_CBLC.\n\n2013-07-24  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>\n\n\t[sfnt] Fix for `make multi' target.\n\n\t* src/sfnt/pngshim.c (Load_SBit_Png): Use FT_LOCAL_DEF().\n\n2013-07-20  Werner Lemberg  <wl@gnu.org>\n\n\t* docs/INSTALL.GNU: Updated.\n\n2013-07-20  Behdad Esfahbod  <behdad@google.com>\n\n\t[sfnt] Fix `sbix' table version handling.\n\n\t* src/sfnt/ttsbit.c (tt_face_load_sbit) [TT_SBIT_TABLE_TYPE_SBIX]:\n\tUSHORT version numbers are to be considered as `minor'.\n\n2013-07-19  Werner Lemberg  <wl@gnu.org>\n\n\t[autofit] Fix segment classification for blue zones.\n\n\tThe old code (essentially unchanged since the very beginning)\n\tincorrectly handled this configuration\n\n\t               x -o- x\n\t                /   \\\n\t               /     \\\n\t              /       \\\n\t             o         o\n\n\tas flat and this\n\n\t                o               o\n\t               /               /\n\t             x|              x|\n\t              |               |\n\t              o---------------o\n\n\tas round.  (`o' and `x' are on and off points, respectively).\n\n\tThis is a major change which should improve the rendering results\n\tenormously for many TrueType fonts, especially in the range approx.\n\t20-40ppem, fixing the appearance of many overshoots.\n\n\t* src/autofit/aflatin.c (af_latin_metrics_init_blues): Look at the\n\tfirst and last points of the segment, not the points right before\n\tand after.\n\n2013-07-19  Behdad Esfahbod  <behdad@google.com>\n\n\t[sfnt] `sbix' fix-ups.\n\n\t* src/sfnt/sfobjs.c (sfnt_load_face): Apple's `sbix' color bitmaps\n\tare rendered scaled and then the `glyf' outline rendered on top.  We\n\tdon't support that yet, so just ignore the `glyf' outline and\n\tadvertise it as a bitmap-only font.\n\n\t* src/sfnt/ttsbit.c (tt_face_load_strike_metrics)\n\t[TT_SBIT_TABLE_TYPE_SBIX]: Return metrics in 26.6 units.\n\t(tt_face_load_sbix_image): Typo.\n\n2013-07-18  Behdad Esfahbod  <behdad@google.com>\n\n\t[sfnt] Add support for Apple's `sbix' color bitmap table.\n\n\t* include/freetype/internal/tttypes.h (TT_SBit_MetricsRec): Widen\n\tfields to FT_Short and FT_UShort, respectively.\n\t(TT_SBitTableType): New enumeration.\n\t(TT_FaceRec): Add `sbit_table_type' field.\n\n\t* include/freetype/tttags.h (TTAG_sbix): New macro.\n\n\t* src/sfnt/pngshim.c (Load_SBit_Png): Pass a more generic\n\tFT_GlyphSlot argument instead FT_Bitmap.\n\tAdd flag to control map and metrics handling.\n\tUpdate all users.\n\n\t* src/sfnt/ttsbit.c: Include `ttmtx.h'.\n\t(tt_face_load_eblc): Renamed to...\n\t(tt_face_load_sbit): This.\n\tHandlic `sbix' bitmaps.\n\t(tt_face_free_eblc): Renamed to...\n\t(tt_face_load_sbit): This.\n\tUpdated.\n\t(tt_face_load_strike_metrics): Handle `sbix' bitmaps.\n\t(tt_face_load_sbix_image): New function.\n\t(tt_sbit_decoder_alloc_bitmap, tt_sbit_decoder_load_image,\n\ttt_sbit_decoder_load_byte_aligned, tt_sbit_decoder_load_bit_aligned,\n\ttt_sbit_decoder_load_compound, tt_sbit_decoder_load_png,\n\ttt_sbit_decoder_load_image, tt_sbit_decoder_load_bitmap): Don't pass\n\tand handle load flags.\n\t(tt_sbit_decoder_load_bitmap) [!FT_CONFIG_OPTION_USE_PNG]: Better\n\thandle formats 17-19.\n\tMove color to grayscale conversion to...\n\t(tt_face_load_sbit_image): Here.\n\tHandle `sbix' bitmaps.\n\n\t* src/sfnt/pngshim.h: Updated.\n\t* src/sfnt/ttsbit.h: Updated.\n\t* src/sfnt/sfdriver.c: Updated.\n\n2013-07-18  Werner Lemberg  <wl@gnu.org>\n\n\t[sfnt] Ignore invalid magic number in `head' or `bhed'.\n\n\tOther font engines seem to ignore it also.  Problem reported by\n\tHin-Tak Leung <htl10@users.sourceforge.net>.\n\n\t* src/sfnt/ttload.c (check_table_dir): Don't abort but warn only if\n\twe have an invalid magic number.\n\n2013-07-16  Werner Lemberg  <wl@gnu.org>\n\n\t[smooth] Fix segfault caused by previous commit.\n\n\t* src/smooth/ftgrays.c (gray_set_cell): Always compute\n\t`ras.invalid'.\n\n2013-07-16  David Turner  <digit@google.com>\n\n\t[smooth] Improve performance.\n\n\tProvide a work-around for an ARM-specific performance bug in GCC.\n\tThis speeds up the rasterizer by more than 5%.\n\n\tAlso slightly optimize `set_gray_cell' and `gray_record_cell' (which\n\talso improves performance on other platforms by a tiny bit (<1%).\n\n\t* src/smooth/ftgrays.c (FT_DIV_MOD): New macro.\n\tUse it where appropriate.\n\n\t(gray_record_cell, gray_set_cell, gray_move_to,\n\tgray_convert_glyph_inner): Streamline condition handling.\n\n2013-07-16  David Turner  <digit@google.com>\n\n\t[truetype] Add assembler code for TT_MulFix14 and TT_DotFix14.\n\n\tThis patch provides slightly optimized versions for ARM, x86, and\n\tx86_64 CPUs if built with GCC.\n\n\tAlso remove some dead code.\n\n\t* src/truetype/ttinterp.c (TT_MulFix14_arm, TT_MulFix14_long_long,\n\tTT_DotFix14_long_long): New functions.\n\n2013-07-16  David Turner  <digit@google.com>\n\n\tOptimize FT_MulFix for x86_64 GCC builds.\n\n\tThis patch provides an optimized `FT_MulFix' implementation for\n\tx86_64 machines when FreeType is built with GCC, or compatible\n\tcompilers like Clang.\n\n\tExample:\n\t  bin/ftbench -p -t 5 -s 14 -f 0008 Arial.ttf\n\n\tBefore:\n\n\t  Load                       4.863 us/op\n\t  Load_Advances (Normal)     4.816 us/op\n\t  Load_Advances (Fast)       0.028 us/op\n\t  Render                     2.753 us/op\n\t  Get_Glyph                  0.463 us/op\n\t  Get_CBox                   0.077 us/op\n\t  Get_Char_Index             0.023 us/op\n\t  Iterate CMap              13.898 us/op\n\t  New_Face                  12.368 us/op\n\t  Embolden                   0.028 us/op\n\t  Get_BBox                   0.302 us/op\n\n\tAfter:\n\n\t  Load                       4.617 us/op\n\t  Load_Advances (Normal)     4.645 us/op\n\t  Load_Advances (Fast)       0.027 us/op\n\t  Render                     2.789 us/op\n\t  Get_Glyph                  0.460 us/op\n\t  Get_CBox                   0.077 us/op\n\t  Get_Char_Index             0.024 us/op\n\t  Iterate CMap              13.403 us/op\n\t  New_Face                  12.278 us/op\n\t  Embolden                   0.028 us/op\n\t  Get_BBox                   0.301 us/op\n\n\t* builds/unix/ftconfig.in, include/freetype/config/ftconfig.h\n\t(FT_MulFix_x86_64): New function.\n\n2013-07-16  David Turner  <digit@google.com>\n\n\tSpeed up ARMv7 support.\n\n\tWhen building for ARMv7 with thumb2 instructions, the optimized\n\t`FT_MulFix_arm' assembly routine was not being used.\n\n\tThe reason for this is in the `ftconfig.h' header, namely:\n\n\t- The assembly routine uses the `smull' instruction which is not\n\t  available when generating Thumb-1 machine code.  It is available\n\t  in Thumb-2 mode, though.\n\n\t- The header was written a long time ago before Thumb-2 became\n\t  widely popular (e.g. with Android).  So it simply doesn't use the\n\t  assembly routine if the `__thumb__' built-in macro is defined.\n\n\t- When compiling in Thumb-2 mode, the compiler will define both\n\t  `__thumb__' and `__thumb2__'.\n\n\tBy checking for `(__thumb2__ || !__thumb__)', we ensure that the\n\tassembly routine is only avoided when generating Thumb-1 code.\n\n\tGiven that this is performance-sensitive function, this improves\n\t`ftbench' as follows on a Galaxy Nexus:\n\n\t                           Before (us/op)   After (us/op)\n\n\t  - loading Arial.ttf glyphs at 14 ppem [1]\n\n\t      Load                   34.285          33.098\n\n\t  - same operation with the light auto-hinter [2]\n\n\t      Load                   31.317          29.590\n\n\t  - same operation without hinting [3]\n\n\t      Load                    6.143           5.376\n\n\t  - loading Arial.ttf advances at 14 ppem [4]\n\n\t      Load_Advances (normal) 34.216          33.016\n\t      Load_Advances (fast)    0.176           0.176\n\n\t  [1] ftbench -t 5 -p -s 14 -b a -f 0008 Arial.ttf\n\t  [2] ftbench -t 5 -p -s 14 -b a -r 1 -f 0028 Arial.ttf\n\t  [3] ftbench -t 5 -p -s 14 -b a -f 000a Arial.ttf\n\t  [4] ftbench -t 5 -p -s 14 -b b -f 0008 Arial.ttf\n\n\t* builds/unix/ftconfig.in, include/freetype/config/ftconfig.h\n\t(FT_MULFIX_ASSEMBLER): Fix handling for ARMv7.\n\n2013-06-28  Werner Lemberg  <wl@gnu.org>\n\n\t* docs/CHANGES: Updated.\n\n2013-06-27  Werner Lemberg  <wl@gnu.org>\n\n\t* src/winfonts/winfnt.c (FNT_Load_Glyph): Fix bitmap width guard.\n\n2013-06-25  Werner Lemberg  <wl@gnu.org>\n\n\t[cff] Add darkening limit to `darkening-parameters'.\n\n\t* src/cff/cffdrivr.c (cff_property_set): Add check.\n\n2013-06-25  Werner Lemberg  <wl@gnu.org>\n\n\t[cff] Add `darkening-parameters' property.\n\n\t* include/freetype/ftcffdrv.h: Document it.\n\n\t* src/cff/cffdrivr.c (cff_property_set, cff_property_get): Handle\n\t`darkening-parameters' property.\n\n\t* src/cff/cf2font.h (CF2_FontRec): Add `darkenParams' array.\n\n\t* src/cff/cf2font.c (cf2_computeDarkening): Add `darkenParams'\n\targument and use it.\n\tUpdate all callers.\n\n\t* src/cff/cf2ft.c (cf2_decoder_parse_charstrings): Copy\n\t`darken_params' values.\n\n\t* src/cff/cffobjs.h (CFF_DriverRec): Add `darken_params' array.\n\n\t* src/cff/cffobjs.c (cff_driver_init): Set default values for\n\t`darken_params'.\n\n2013-06-25  Werner Lemberg  <wl@gnu.org>\n\n\t[docmaker] Code shuffling.\n\n\t* src/tools/docmaker/tohtml.py (re_url): Move regexp...\n\t* src/tools/docmaker/sources.py: ... to this file.\n\n2013-06-25  Werner Lemberg  <wl@gnu.org>\n\n\t[docmaker] Remove unused functions.\n\n\t* src/tools/docmaker/content.py (DocMarkup.get_start,\n\tDocBlock.get_markup_name): Removed.\n\t* src/tools/docmaker/tohtml.py (html_quote0, dump_html_code,\n\tHtmlFormatter.make_html_words): Removed.\n\n2013-06-25  Werner Lemberg  <wl@gnu.org>\n\n\t* builds/freetype.mk (dll): Remove target.\n\n\tProblem reported by Jörg Günnewig <joerg.guennewig@googlemail.com>.\n\n2013-06-25  Werner Lemberg  <wl@gnu.org>\n\n\t[docmaker] Recognise URLs.\n\n\t* src/tools/docmaker/tohtml.py (re_url): New regular expression.\n\t(make_html_para): Use it.\n\n2013-06-19  Werner Lemberg  <wl@gnu.org>\n\n\t* Version 2.5.0.1 released.\n\t===========================\n\n\n\tTag sources with `VER-2-5-0-1'.\n\n\t* include/freetype/config/ftoption.h: Undefine\n\tCFF_CONFIG_OPTION_OLD_ENGINE.\n\t* devel/ftoption.h: Define CFF_CONFIG_OPTION_OLD_ENGINE.\n\n2013-06-19  Werner Lemberg  <wl@gnu.org>\n\n\t* builds/unix/install.mk (install): Don't create `cache' directory.\n\n\tFound by Peter Breitenlohner <peb@mppmu.mpg.de>.\n\n2013-06-19  Werner Lemberg  <wl@gnu.org>\n\n\t* Version 2.5.0 released.\n\t=========================\n\n\n\tTag sources with `VER-2-5-0'.\n\n\t* docs/VERSION.DLL: Update documentation and bump version number to\n\t2.5.0.\n\n\t* README, Jamfile (RefDoc),\n\tbuilds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html,\n\tbuilds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html,\n\tbuilds/win32/vc2010/freetype.vcxproj, builds/win32/vc2010/index.html,\n\tbuilds/win32/visualc/freetype.dsp,\n\tbuilds/win32/visualc/freetype.vcproj,\n\tbuilds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp,\n\tbuilds/win32/visualce/freetype.vcproj,\n\tbuilds/win32/visualce/index.html,\n\tbuilds/wince/vc2005-ce/freetype.vcproj,\n\tbuilds/wince/vc2005-ce/index.html,\n\tbuilds/wince/vc2008-ce/freetype.vcproj,\n\tbuilds/wince/vc2008-ce/index.html: s/2.4.12/2.5.0/, s/2412/250/.\n\n\t* include/freetype/freetype.h (FREETYPE_MINOR): Set to 5.\n\t(FREETYPE_PATCH): Set to 0.\n\n\t* builds/unix/configure.raw (version_info): Set to 16:2:10.\n\n\t* src/base/ftobjs.c (FT_Open_Face): Pacify compiler.\n\t* src/truetype/ttinterp.c (Ins_MSIRP, Ins_MIRP): Ditto.\n\n2013-06-18  Werner Lemberg  <wl@gnu.org>\n\n\tFix Savannah bug #39269.\n\n\t* src/base/ftgloadr.c (FT_GlyphLoader_CheckPoints): Free memory in\n\tcase of reacollocation failures.\n\n2013-06-18  Andrew Church  <achurch+savannah@achurch.org>\n\n\tFix Savannah bug #39266.\n\n\tIf memory allocations fail at certain points while opening a font,\n\tFreeType can either crash due to a NULL dereference or leak memory.\n\n\t* include/freetype/internal/ftobjs.c (FT_Face_InternalRec,\n\tFT_LibraryRec): Make `refcount' a signed integer.  If, for example,\n\tFT_Open_Face() fails in a memory allocation before the face's\n\treference count is set to 1, a subsequent `FT_Done_Library' call\n\twould otherwise loop over `FT_Done_Face' 2^32 times before freeing\n\tthe face.\n\n\t* src/base/ftobjs.c (open_face): Initialize `stream' and friends\n\tearlier.\n\t(FT_Open_Face) <Fail>: Behave correctly if `node' is NULL.\n\t(FT_Destroy_Module) <Fail>: Check that `renderer_clazz' is valid.\n\n2013-06-14  Werner Lemberg  <wl@gnu.org>\n\n\t* src/smooth/ftgrays.c One final pragma to silence 64-bit MSVC.\n\n2013-06-06  Dave Arnold  <darnold@adobe.com>\n\t    Werner Lemberg  <wl@gnu.org>\n\n\t[cff] Add code to Adobe's engine to handle ppem > 2000.\n\n\t* src/cff/cffgload.c (cff_slot_load): If we get\n\tFT_Err_Glyph_Too_Big, retry unhinted and scale up later on.\n\n2013-06-12  Werner Lemberg  <wl@gnu.org>\n\n\tAnother try on pragmas.\n\n\t* include/freetype/internal/ftdebug.h: Move pragmas to...\n\t* include/freetype/internal/internal.h: ... this file since it gets\n\tincluded by all source files.\n\t* include/freetype/internal/ftserv.h: Remove pragma which has no\n\teffect.\n\n2013-06-12  Werner Lemberg  <wl@gnu.org>\n\n\t* include/freetype/internal/ftdebug.h: Disable MSVC warning C4127.\n\n\tThis partially undoes commit 3f6e0e0c.\n\n2013-06-12  Werner Lemberg  <wl@gnu.org>\n\n\tMore compiler warning fixes.\n\n\t*/*: Use cast to `FT_Bool' (or `Bool') where appropriate.\n\n2013-06-10  Werner Lemberg  <wl@gnu.org>\n\n\t[truetype] Improve handling of broken sbit advance widths.\n\n\t* src/truetype/ttgload.c (TT_Load_Glyph): Use the glyph's (scaled)\n\t`linearHoriAdvance' if the sbit's `horiAdvance' value is zero.\n\n\tCf. font `Fixedsys Excelsior' v3.01 (FSEX300.ttf), glyph A, 16ppem.\n\n2013-06-10  Werner Lemberg  <wl@gnu.org>\n\n\t[sfnt] Improve embedded bitmap tracing.\n\n\t* src/base/ftobjs.c (FT_Request_Size): Move trace message regarding\n\tbitmap strike match to...\n\t(FT_Match_Size): This function.\n\n\t* src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics,\n\ttt_sbit_decoder_load_byte_aligned, tt_sbit_decoder_load_bit_aligned,\n\ttt_sbit_decoder_load_compound, tt_sbit_decoder_load_png,\n\ttt_sbit_decoder_load_image): Decorate with tracing messages.\n\n2013-06-10  Werner Lemberg  <wl@gnu.org>\n\n\tFix Savannah bug #39160.\n\n\t* src/truetype/ttinterp.c (Ins_SDPVTL): Set projection vector too\n\tfor the degenerate case.\n\n2013-06-09  David Turner  <digit@google.com>\n\n\t* src/cache/ftcmanag.c (FTC_Manager_Reset): Add missing cache flush.\n\n\tThis code, present since eight(!) years in the unused `CACHE'\n\tbranch, has been forgotten to apply to the master branch.  It's\n\treally amazing that noone has ever complained since\n\t`FTC_Manager_Reset' is pretty useless without flushing the cache.\n\n2013-06-07  Werner Lemberg  <wl@gnu.org>\n\n\tAdd and improve pragmas for MSVC compiler.\n\n\t* include/freetype/internal/ftdebug.h: Remove pragmas.\n\t* include/freetype/internal/ftserv.h: Use push and pop for pragmas.\n\t* include/freetype/internal/ftvalid.h: Handle warning C4324.\n\t* src/base/ftobjs.c: Use push and pop for pragmas.\n\t* src/gzip/ftgzip.c: Handle warning C4244.\n\n2013-06-07  Werner Lemberg  <wl@gnu.org>\n\n\t[cff] s/cf2_getGlyphWidth/cf2_getGlyphOutline/.\n\n\t* src/cff/cf2font.c, src/cff/cf2font.h, src/cff/cf2ft.c: Do it.\n\n2013-06-06  Dave Arnold  <darnold@adobe.com>\n\n\t[cff] Add early exit feature for width-only calls.\n\n\tThis is for `FT_Get_Advance'.\n\n\tThere are 7 places where the spec says the width can be defined:\n\n\t  hstem/hstemhm\n\t  vstem/vstemhm\n\t  cntrmask/hintmask\n\t  hmoveto\n\t  vmoveto\n\t  rmoveto\n\t  endchar\n\n\t* src/cff/cf2intrp.c (cf2_doStems): Exit early for width-only calls,\n\tif possible.\n\n\t(cf2_interpT2CharString) <cf2_cmdHSTEM>, <cf2_cmdVSTEM>,\n\t<cf2_cmdVMOVETO>, <cf2_cmdENDCHAR>, <cf2_cmdHINTMASK>,\n\t<cf2_cmdRMOVETO>, <cf2_cmdHMOVETO>: Exit early for width-only calls.\n\n2013-06-06  Werner Lemberg  <wl@gnu.org>\n\n\tNext round of compiler fixes.\n\n\t* builds/win32/ftdebug.c, builds/wince/ftdebug.c (ft_debug_init):\n\tAdd proper cast.\n\n\t* include/freetype/internal/ftserv.h (FT_SERVICE_UNAVAILABLE): Fix\n\tcast.\n\t* include/freetype/internal/ftstream.h: Decorate stream and frame\n\tmacros with `FT_Long' and `FT_ULong' as appropriate.\n\n\t* src/base/ftrfork.c (raccess_guess_darwin_hfsplus,\n\traccess_guess_darwin_newvfs): Use cast.\n\n\t* src/bdf/bdflib.c (_bdf_set_default_spacing): Use cast.\n\n\t* src/cache/ftcmanag.c (FTC_Manager_Check): Fix cast.\n\t* src/cache/ftcmanag.h (FTC_ManagerRec): Ditto.\n\n\t* src/cff/cf2arrst.c (cf2_arrstack_setNum_Elements): Use cast.\n\t* src/cff/cf2ft.c (cf2_freeSeacComponent): Ditto.\n\t* src/cff/cffobjs.c (remove_subset_prefix, remove_style): Ditto.\n\n\t* src/cid/cidparse.c (cid_parser_new): Use cast.\n\n\t* src/pcf/pcfdrivr.c (PCF_Glyph_Load): Use cast.\n\n\t* src/psaux/psobjs.c (reallocate_t1_table): Fix argument type.\n\n\t* src/raster/ftraster.c (ft_black_reset): Use cast.\n\n\t* src/truetype/ttgxvar.c (FT_Stream_FTell): Use cast.\n\t(ALL_POINTS): Fix cast.\n\n\t* src/type1/t1driver.c (t1_ps_get_font_value): Add casts.\n\t* src/type1/t1parse.c (T1_Get_Private_Dict): Add cast.\n\n2013-06-05  Dave Arnold  <darnold@adobe.com>\n\n\tFix more MSVC Win32 compiler warnings.\n\n\t* src/base/ftobjs.c: Fix typo in MS pragma.\n\n\t* src/base/bdflib.c (_bdf_set_default_spacing, _bdf_add_property):\n\t`lineno' is only used in debug mode.\n\n\t* src/cff/cf2ft.c (cf2_builder_moveTo): `params' is only used in\n\tdebug mode.\n\n2013-06-05  Werner Lemberg  <wl@gnu.org>\n\n\tFix compiler warnings.\n\n\t* include/freetype/internal/ftmemory.h: Decorate memory allocation\n\tmacros with `FT_Long' where appropriate.\n\tRemove duplicate of FT_MEM_QRENEW_ARRAY definition.\n\n\t* src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use\n\tcast.\n\n\t* src/base/ftobjs.c: Add warning disabling pragma for MSVC while\n\tincluding `md5.c'.\n\n\t* src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdESC>: Add\n\tcast.\n\n\t* src/sfnt/ttsbit.c (tt_sbit_decoder_load_compound): Fix casts.\n\t(tt_sbit_decoder_load_bitmap): Beautification.\n\n\t* src/smooth/ftsmooth.c (ft_smooth_render_generic): Initialize\n\tvariables (earlier).\n\n\t* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Pacify compiler.\n\n\t* src/truetype/ttgxvar.c (TT_Get_MM_Var): Use unsigned constants\n\twhere appropriate.\n\n\t* src/type1/t1load.c (T1_Get_MM_Var): Ditto.\n\n2013-06-04  Werner Lemberg  <wl@gnu.org>\n\n\t* src/cff/cf2font.c (cf2_getGlyphWidth): Initialize `advWidth'.\n\n\tProblem reported by Ingmar Sittl <ingmar.sittl@elektrobit.com>.\n\n2013-06-04  Werner Lemberg  <wl@gnu.org>\n\n\tApply fixes for cppcheck nitpicks.\n\n\t  http://cppcheck.sourceforge.net/\n\n\tThe call was (from the top-level of the FreeType tree):\n\n\t  cppcheck --force \\\n\t           --enable=all \\\n\t           -I include \\\n\t           -I include/freetype/ \\\n\t           -I include/freetype/config/ \\\n\t           -I include/freetype/internal/ \\\n\t           . &> cppcheck.log\n\n\tNote that the current version heavily chokes on FreeType, delivering\n\tmany wrong results.  I will report those issues to the cppcheck team\n\tso that a newer version gives improved results hopefully.\n\n\t*/* Improve variable scopes.\n\t*/* Remove redundant initializations which get overwritten.\n\n\t* src/base/ftmac.c, builds/mac/ftmac.c (count_faces_scalable):\n\tRemove unused variable.\n\n\t* src/base/ftdbgmem.c (ft_mem_table_destroy): `table' can't be zero.\n\n\t* src/gxvalid/gxvkern.c (gxv_kern_subtable_fmt1_entry_validate):\n\tRemove functionless code.\n\n\t* src/tools/ftrandom.c (main): Fix memory leak.\n\n2013-06-03  Werner Lemberg  <wl@gnu.org>\n\n\tAdd CFF_CONFIG_OPTION_OLD_ENGINE configuration option.\n\n\tThis controls whether the old FreeType CFF engine gets compiled into\n\tFreeType.  It is now disabled by default.\n\n\t* devel/ftoption.h, include/freetype/config/ftoption.h\n\t(CFF_CONFIG_OPTION_OLD_ENGINE): New macro.\n\n\t* src/cff/cffdrivr.c (cff_property_set), src/cff/cffgload.c\n\t(CFF_Operator, cff_argument_counts, cff_builder_add_point,\n\tcff_operator_seac, cff_decoder_parse_charstrings, cff_slot_load),\n\tsrc/cff/cffgload.h, src/cff/cffobjs.c (cff_driver_init): Use\n\tCFF_CONFIG_OPTION_OLD_ENGINE to guard the affected code.\n\n\t* docs/CHANGES: Updated.\n\n2013-06-02  Werner Lemberg  <wl@gnu.org>\n\n\tFix PNG library handling.\n\n\t* builds/unix/configure.raw: Don't use LIBPNG_LIBS but\n\tLIBPNG_LDFLAGS.\n\n2013-05-23  Behdad Esfahbod  <behdad@google.com>\n\n\tAdd support for color embedded bitmaps (eg. color emoji).\n\n\tA new load flag, FT_LOAD_COLOR, makes FreeType load color\n\tembedded-bitmaps, following this draft specification\n\n\t  https://color-emoji.googlecode.com/git/specification/v1.html\n\n\twhich defines two new SFNT tables, `CBDT' and `CBLC' (named and\n\tmodeled after `EBDT' and `EBLC', respectively).  The color bitmaps\n\tare stored in the new FT_PIXEL_MODE_BGRA format to represent BGRA\n\tpre-multiplied sRGB images.  If PNG support is available, PNG color\n\timages as defined in the same proposed specification are supported\n\talso.\n\n\tNote that color bitmaps are converted to grayscale if client didn't\n\task for color.\n\n\t* builds/unix/configure.raw: Search for libpng.\n\tAdd `--without-png' option.\n\n\t* devel/ftoption.h, include/freetype/config/ftoption.h\n\t(FT_CONFIG_OPTION_USE_PNG): New macro.\n\n\t* include/freetype/freetype.h (FT_LOAD_COLOR): New load flag.\n\n\t* include/freetype/ftimage.h (FT_Pixel_Mode): Add\n\t`FT_PIXEL_MODE_BGRA'.\n\n\t* include/freetype/tttags.h (TTAG_CBDT, TTAG_CBLC): New tags.\n\n\t* src/base/ftbitmap.c (FT_Bitmap_Embolden): Updated.\n\t(ft_gray_for_premultiplied_srgb_bgra): New function.\n\t(FT_Bitmap_Convert): Handle FT_PIXEL_MODE_BGRA.\n\n\t* src/sfnt/pngshim.c, src/sfnt/pngshim.h: New files.\n\n\t* src/sfnt/sfnt.c: Include `pngshim.c'.\n\n\t* src/sfnt/ttsbit.c: Include FT_BITMAP_H and `pngshim.h'\n\t(tt_face_load_eblc): Load `CBLC'.\n\t(tt_sbit_decoder_init): Load `CBDT'.\n\t(tt_sbit_decoder_alloc_bitmap): Pass load flags to select between\n\tcolor and grayscale bitmaps.\n\tSet `num_grays'.  This is used by `ftview' to choose the blending\n\talgorithm.\n\t(tt_sbit_decoder_load_byte_aligned,\n\ttt_sbit_decoder_load_bit_aligned, tt_sbit_decoder_load_compound,\n\ttt_sbit_decoder_load_image): Pass load flag.\n\ts/write/pwrite/.\n\tDon't call `tt_sbit_decoder_alloc_bitmap'.\n\tUpdated.\n\t(tt_sbit_decoder_load_png) [FT_CONFIG_OPTION_USE_PNG]: New function.\n\t(tt_sbit_decoder_load_bitmap): Pass load flag.\n\tHandle new glyph formats 17, 18, and 19.\n\tCall `tt_sbit_decoder_alloc_bitmap'.\n\tFlatten color bitmaps if necessary.\n\t(tt_face_load_sbit_image): Updated.\n\n\t* src/sfnt/rules.mk (SFNT_DRV_SRC): Add `pngshim.c'.\n\n\t* docs/CHANGES: Updated.\n\n2013-05-24  Guenter  <info@gknw.net>\n\n\tApply Savannah patch #8055.\n\n\tMake `apinames' create an import file for NetWare.\n\n\t* src/tools/apinames.c (PROGRAM_VERSION): Set to 0.2.\n\t(OutputFormat): Add `OUTPUT_NETWARE_IMP'.\n\t(names_dump): Handle it.\n\t(usage): Updated.\n\t(main): Handle new command line flag `-wN'.\n\n2013-05-23  Behdad Esfahbod  <behdad@behdad.org>\n\n\tCompilation fix.\n\n\t* src/truetype/ttinterp.c (TT_RunIns)\n\t[!TT_CONFIG_OPTION_SUBPIXEL_HINTING]: Make it work.\n\n2013-05-22  Infinality  <infinality@infinality.net>\n\n\t[truetype] Formatting and an additional subpixel tweak.\n\n\t* src/truetype/ttinterp.c (Ins_SHPIX): Formatting fix.\n\t* src/truetype/ttsubpix.c (SKIP_NONPIXEL_Y_MOVES_Rules):\n\tRevert previous modification for Verdana clones.\n\n2013-05-22  Infinality  <infinality@infinality.net>\n\n\t[truetype] Adjust subpixel zp2 moves and tweak rules.\n\n\tThese modifications fix thin diagonal stems in some legacy fonts.\n\n\t* src/truetype/ttinterp.c (Direct_Move_X): Remove unused macro.\n\t(Move_Zp2_Point): Don't always disable x moves for subpixel rendering.\n\t(Ins_SHP): Disable x moves here for subpixel rendering.\n\t(Ins_SHPIX): Only disable x moves in compatibility mode.\n\tSplit out zp2 move reversals and reorder conditional respectively.\n\n\t* src/truetype/ttsubpix.c (SKIP_NONPIXEL_Y_MOVES_Rules): Fix oversight.\n\tOnly adjust Verdana clones for 17 ppem.\n\t(SKIP_NONPIXEL_Y_MOVES_Rules_Exceptions): Add Courier New.\n\t(ALWAYS_SKIP_DELTAP_Rules): Found additional cases for Arial `s'.\n\n2013-05-20  Infinality  <infinality@infinality.net>\n\n\t[truetype] Simplify and improve subpixel function detection.\n\n\tSome small enhancements have allowed the removal of many macros and\n\tthe simplification of existing rules in `ttsubpix.c'.\n\n\t* src/truetype/ttsubpix.h (SPH_TWEAK_ALLOW_X_DMOVEX,\n\tSPH_TWEAK_ALLOW_X_MOVE_ZP2,\n\tSPH_TWEAK_DELTAP_SKIP_EXAGGERATED_VALUES,\n\tSPH_TWEAK_SKIP_INLINE_DELTAS, SPH_TWEAK_MIRP_CVT_ZERO): Removed.\n\t(SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES_DELTAP): New rule macro.\n\n\t* src/truetype/ttsubpix.c: Updated affected rules.\n\n\t* src/truetype/ttinterp.c (Direct_Move_X): Updated.\n\t(INS_FDEF): Add additional function detection.\n\t(INS_ENDF): Set runtime flag.\n\t(Ins_CALL): Skip the call under certain conditions.\n\tRemove bad code.\n\t(Ins_LOOPCALL): Skip the call under certain conditions.\n\tRemove bad code.\n\t(Move_Zp2_Point): Updated.\n\t(Ins_SHPIX): Updated.\n\tSkip the move under some situations.\n\t(Ins_MIAP): Improve conditions.\n\t(Ins_MIRP): Updated.\n\t(Ins_DELTAP): Skip move under certain conditions.\n\tSimplify conditions.\n\t(TT_RunIns): Updated.\n\tAdd code to handle new function detection.\n\tTrace messages.\n\n2013-05-17  Werner Lemberg  <wl@gnu.org>\n\n\tUpdate more FT_Err_XXX macros using FT_ERR and FT_THROW;\n\n\t* builds/amiga/src/base/ftsystem.c, builds/mac/ftmac.c,\n\tbuilds/unix/ftsystem.c, builds/vms/ftsystem.c: Do it.\n\n2013-05-15  Werner Lemberg  <wl@gnu.org>\n\n\t[truetype] Add `interpreter-version' property.\n\n\tThis makes the option TT_CONFIG_OPTION_SUBPIXEL_HINTING controllable\n\tat runtime.\n\n\t* include/freetype/ftttdrv.h: New file.\n\n\t* include/freetype/config/ftheader.h (FT_TRUETYPE_DRIVER_H): New\n\tmacro.\n\n\t* src/truetype/ttdriver.c: Include FT_TRUETYPE_DRIVER_H.\n\t(tt_property_set, tt_property_get): Fill templates.\n\n\t* src/truetype/ttobjs.h (TT_DriverRec): Add `interpreter_version'\n\tmember.\n\tRemove unused `extension_component' member.\n\n\t* src/truetype/ttgload.c: Include FT_TRUETYPE_DRIVER_H.\n\t(tt_get_metrics, TT_Hint_Glyph, TT_Process_Simple_Glyph,\n\tcompute_glyph_metrics, tt_loader_init): Use `interpreter_version'.\n\n\t* src/truetype/ttinterp.c: Include FT_TRUETYPE_DRIVER_H.\n\t(SUBPIXEL_HINTING): New macro to check `interpreter_version' flag.\n\tUpdate all affected functions to use it.\n\tUse TT_INTERPRETER_VERSION_XXX where appropriate.\n\n\t* src/truetype/ttobjs.c: Include FT_TRUETYPE_DRIVER_H.\n\t(tt_driver_init): Initialize `interpreter_version'.\n\n\t* src/truetype/ttsubpix.c: Include FT_TRUETYPE_DRIVER_H.\n\tUse TT_INTERPRETER_VERSION_XXX where appropriate.\n\n2013-05-13  Werner Lemberg  <wl@gnu.org>\n\n\t[truetype] Avoid empty source file.\n\n\t* src/truetype/ttsubpix.c [!TT_CONFIG_OPTION_SUBPIXEL_HINTING]:\n\tProvide dummy typedef.\n\n2013-05-13  Werner Lemberg  <wl@gnu.org>\n\n\t* src/cff/cf2font.c (cf2_getGlyphWidth): Fix uninitialized variable.\n\n\tFix suggested by Vaibhav Nagarnaik <vnagarnaik@gmail.com>.\n\n2013-05-13  Brian Nixon  <bnixon@yahoo.com>\n\n\tFix Savannah bug #38970.\n\n\t* src/base/ftdebug.c, builds/win32/ftdebug.c,\n\tbuilds/wince/ftdebug.c, builds/amiga/src/base/ftdebug.c\n\t(ft_debug_init): Don't read past the environment variable FT2_DEBUG.\n\n2013-05-12  Werner Lemberg  <wl@gnu.org>\n\n\t[truetype] Add framework for TrueType properties.\n\n\t* src/truetype/ttdrivr.c: Include FT_SERVICE_PROPERTIES_H.\n\t(tt_property_set, tt_property_get): New functions, still empty.\n\tDefine `tt_service_properties' service.\n\tUpdate `tt_services'.\n\n\t* src/truetype/ttpic.h: Include FT_SERVICE_PROPERTIES_H.\n\t(TT_SERVICE_PROPERTIES_GET): New macro.\n\t(TTModulePIC): Add `tt_service_properties'.\n\n2013-05-12  Werner Lemberg  <wl@gnu.org>\n\n\tFix Savannah bug #38967.\n\n\t* src/base/ftcalc.c (FT_DivFix) [FT_LONG64]: Fix cast.\n\n2013-05-12  Werner Lemberg  <wl@gnu.org>\n\n\tIntroduce unsigned 64bit type (if available).\n\n\t* include/freetype/config/ftconfig.h: Define FT_UINT64 if available.\n\t[FT_LONG64]: Provide FT_UInt64.\n\n\t* builds/unix/ftconfig.in: Synchronized.\n\n2013-05-12  Werner Lemberg  <wl@gnu.org>\n\n\tFix Savannah bug #38968.\n\n\t* include/freetype/ftmodapi.h: Add `FT_EXPORT' to\n\tFT_Property_{Set,Get}.\n\t* src/base/ftobjs.c: Add `FT_EXPORT_DEF' to\n\tFT_Property_{Set,Get}.\n\n2013-05-10  Werner Lemberg  <wl@gnu.org>\n\n\t[sfnt] Clean up bitmap code.\n\n\t* src/sfnt/ttsbit.c: Deleted.\n\t* src/sfnt/ttsbit0.c: Renamed to `ttsbit.c'.\n\t* rules.mk (SFNT_DRV_H): Updated.\n\n2013-05-10  Werner Lemberg  <wl@gnu.org>\n\n\t*/* [FT_CONFIG_OPTION_OLD_INTERNALS]: Remove macro and guarded code.\n\n----------------------------------------------------------------------------\n\nCopyright 2013-2014 by\nDavid Turner, Robert Wilhelm, and Werner Lemberg.\n\nThis file is part of the FreeType project, and may only be used, modified,\nand distributed under the terms of the FreeType project license,\nLICENSE.TXT.  By continuing to use, modify, or distribute this file you\nindicate that you have read the license and understand and accept it\nfully.\n\n\nLocal Variables:\nversion-control: never\ncoding: utf-8\nEnd:\n"
  },
  {
    "path": "ext/freetype2/FTL.TXT",
    "content": "                    The FreeType Project LICENSE\r\n                    ----------------------------\r\n\r\n                            2006-Jan-27\r\n\r\n                    Copyright 1996-2002, 2006 by\r\n          David Turner, Robert Wilhelm, and Werner Lemberg\r\n\r\n\r\n\r\nIntroduction\r\n============\r\n\r\n  The FreeType  Project is distributed in  several archive packages;\r\n  some of them may contain, in addition to the FreeType font engine,\r\n  various tools and  contributions which rely on, or  relate to, the\r\n  FreeType Project.\r\n\r\n  This  license applies  to all  files found  in such  packages, and\r\n  which do not  fall under their own explicit  license.  The license\r\n  affects  thus  the  FreeType   font  engine,  the  test  programs,\r\n  documentation and makefiles, at the very least.\r\n\r\n  This  license   was  inspired  by  the  BSD,   Artistic,  and  IJG\r\n  (Independent JPEG  Group) licenses, which  all encourage inclusion\r\n  and  use of  free  software in  commercial  and freeware  products\r\n  alike.  As a consequence, its main points are that:\r\n\r\n    o We don't promise that this software works. However, we will be\r\n      interested in any kind of bug reports. (`as is' distribution)\r\n\r\n    o You can  use this software for whatever you  want, in parts or\r\n      full form, without having to pay us. (`royalty-free' usage)\r\n\r\n    o You may not pretend that  you wrote this software.  If you use\r\n      it, or  only parts of it,  in a program,  you must acknowledge\r\n      somewhere  in  your  documentation  that  you  have  used  the\r\n      FreeType code. (`credits')\r\n\r\n  We  specifically  permit  and  encourage  the  inclusion  of  this\r\n  software, with  or without modifications,  in commercial products.\r\n  We  disclaim  all warranties  covering  The  FreeType Project  and\r\n  assume no liability related to The FreeType Project.\r\n\r\n\r\n  Finally,  many  people  asked  us  for  a  preferred  form  for  a\r\n  credit/disclaimer to use in compliance with this license.  We thus\r\n  encourage you to use the following text:\r\n\r\n   \"\"\"\r\n    Portions of this software are copyright  <year> The FreeType\r\n    Project (www.freetype.org).  All rights reserved.\r\n   \"\"\"\r\n\r\n  Please replace <year> with the value from the FreeType version you\r\n  actually use.\r\n\r\n\r\nLegal Terms\r\n===========\r\n\r\n0. Definitions\r\n--------------\r\n\r\n  Throughout this license,  the terms `package', `FreeType Project',\r\n  and  `FreeType  archive' refer  to  the  set  of files  originally\r\n  distributed  by the  authors  (David Turner,  Robert Wilhelm,  and\r\n  Werner Lemberg) as the `FreeType Project', be they named as alpha,\r\n  beta or final release.\r\n\r\n  `You' refers to  the licensee, or person using  the project, where\r\n  `using' is a generic term including compiling the project's source\r\n  code as  well as linking it  to form a  `program' or `executable'.\r\n  This  program is  referred to  as  `a program  using the  FreeType\r\n  engine'.\r\n\r\n  This  license applies  to all  files distributed  in  the original\r\n  FreeType  Project,   including  all  source   code,  binaries  and\r\n  documentation,  unless  otherwise  stated   in  the  file  in  its\r\n  original, unmodified form as  distributed in the original archive.\r\n  If you are  unsure whether or not a particular  file is covered by\r\n  this license, you must contact us to verify this.\r\n\r\n  The FreeType  Project is copyright (C) 1996-2000  by David Turner,\r\n  Robert Wilhelm, and Werner Lemberg.  All rights reserved except as\r\n  specified below.\r\n\r\n1. No Warranty\r\n--------------\r\n\r\n  THE FREETYPE PROJECT  IS PROVIDED `AS IS' WITHOUT  WARRANTY OF ANY\r\n  KIND, EITHER  EXPRESS OR IMPLIED,  INCLUDING, BUT NOT  LIMITED TO,\r\n  WARRANTIES  OF  MERCHANTABILITY   AND  FITNESS  FOR  A  PARTICULAR\r\n  PURPOSE.  IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS\r\n  BE LIABLE  FOR ANY DAMAGES CAUSED  BY THE USE OR  THE INABILITY TO\r\n  USE, OF THE FREETYPE PROJECT.\r\n\r\n2. Redistribution\r\n-----------------\r\n\r\n  This  license  grants  a  worldwide, royalty-free,  perpetual  and\r\n  irrevocable right  and license to use,  execute, perform, compile,\r\n  display,  copy,   create  derivative  works   of,  distribute  and\r\n  sublicense the  FreeType Project (in  both source and  object code\r\n  forms)  and  derivative works  thereof  for  any  purpose; and  to\r\n  authorize others  to exercise  some or all  of the  rights granted\r\n  herein, subject to the following conditions:\r\n\r\n    o Redistribution of  source code  must retain this  license file\r\n      (`FTL.TXT') unaltered; any  additions, deletions or changes to\r\n      the original  files must be clearly  indicated in accompanying\r\n      documentation.   The  copyright   notices  of  the  unaltered,\r\n      original  files must  be  preserved in  all  copies of  source\r\n      files.\r\n\r\n    o Redistribution in binary form must provide a  disclaimer  that\r\n      states  that  the software is based in part of the work of the\r\n      FreeType Team,  in  the  distribution  documentation.  We also\r\n      encourage you to put an URL to the FreeType web page  in  your\r\n      documentation, though this isn't mandatory.\r\n\r\n  These conditions  apply to any  software derived from or  based on\r\n  the FreeType Project,  not just the unmodified files.   If you use\r\n  our work, you  must acknowledge us.  However, no  fee need be paid\r\n  to us.\r\n\r\n3. Advertising\r\n--------------\r\n\r\n  Neither the  FreeType authors and  contributors nor you  shall use\r\n  the name of the  other for commercial, advertising, or promotional\r\n  purposes without specific prior written permission.\r\n\r\n  We suggest,  but do not require, that  you use one or  more of the\r\n  following phrases to refer  to this software in your documentation\r\n  or advertising  materials: `FreeType Project',  `FreeType Engine',\r\n  `FreeType library', or `FreeType Distribution'.\r\n\r\n  As  you have  not signed  this license,  you are  not  required to\r\n  accept  it.   However,  as  the FreeType  Project  is  copyrighted\r\n  material, only  this license, or  another one contracted  with the\r\n  authors, grants you  the right to use, distribute,  and modify it.\r\n  Therefore,  by  using,  distributing,  or modifying  the  FreeType\r\n  Project, you indicate that you understand and accept all the terms\r\n  of this license.\r\n\r\n4. Contacts\r\n-----------\r\n\r\n  There are two mailing lists related to FreeType:\r\n\r\n    o freetype@nongnu.org\r\n\r\n      Discusses general use and applications of FreeType, as well as\r\n      future and  wanted additions to the  library and distribution.\r\n      If  you are looking  for support,  start in  this list  if you\r\n      haven't found anything to help you in the documentation.\r\n\r\n    o freetype-devel@nongnu.org\r\n\r\n      Discusses bugs,  as well  as engine internals,  design issues,\r\n      specific licenses, porting, etc.\r\n\r\n  Our home page can be found at\r\n\r\n    http://www.freetype.org\r\n\r\n\r\n--- end of FTL.TXT ---\r\n"
  },
  {
    "path": "ext/freetype2/config/ft2build.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ft2build.h                                                             */\n/*                                                                         */\n/*    FreeType 2 build and setup macros.                                   */\n/*    (Generic version)                                                    */\n/*                                                                         */\n/*  Copyright 1996-2001, 2006 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file corresponds to the default `ft2build.h' file for            */\n  /* FreeType 2.  It uses the `freetype' include root.                     */\n  /*                                                                       */\n  /* Note that specific platforms might use a different configuration.     */\n  /* See builds/unix/ft2unix.h for an example.                             */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FT2_BUILD_GENERIC_H__\n#define __FT2_BUILD_GENERIC_H__\n\n#define FT_CONFIG_CONFIG_H  <sumatrapdf_ftoption.h>\n#define FT_CONFIG_MODULES_H <sumatrapdf_ftmodule.h>\n#include <config/ftheader.h>\n\n#endif /* __FT2_BUILD_GENERIC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/config/sumatrapdf_ftmodule.h",
    "content": "// #include <freetype/config/ftmodule.h>\n\n/* custom ftmodule.h which selects the minimum features required by mupdf */\n\n// FT_USE_MODULE( FT_Module_Class, autofit_module_class )\nFT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )\n// FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )\n// FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )\n// FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )\n// FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )\nFT_USE_MODULE( FT_Module_Class, psaux_module_class )\nFT_USE_MODULE( FT_Module_Class, psnames_module_class )\nFT_USE_MODULE( FT_Module_Class, pshinter_module_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )\nFT_USE_MODULE( FT_Module_Class, sfnt_module_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )\n// FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class )\n// FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class )\n// FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )\n\nFT_USE_MODULE( FT_Module_Class, otv_module_class )\n"
  },
  {
    "path": "ext/freetype2/config/sumatrapdf_ftoption.h",
    "content": "#ifndef __SUMATRAPDF__FTOPTION_H__\n#define __SUMATRAPDF__FTOPTION_H__\n\n#ifdef __FTOPTION_H__\n#error \"This header must be included before the default configuration header!\"\n#endif\n\n#include <config/ftconfig.h>\n\nFT_BEGIN_HEADER\n\n#undef FT_CONFIG_OPTION_USE_LZW\n#undef FT_CONFIG_OPTION_USE_ZLIB\n#undef FT_CONFIG_OPTION_MAC_FONTS\n#undef FT_CONFIG_OPTION_INCREMENTAL\n#undef TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n#undef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n#undef TT_CONFIG_OPTION_BDF\n#undef T1_CONFIG_OPTION_NO_AFM\n#undef T1_CONFIG_OPTION_NO_MM_SUPPORT\n\n#define CFF_CONFIG_OPTION_OLD_ENGINE\n\n#ifdef _DEBUG\n#define FT_DEBUG_LEVEL_ERROR\n#endif\n\nFT_END_HEADER\n\n#endif\n"
  },
  {
    "path": "ext/freetype2/include/config/ftconfig.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftconfig.h                                                             */\n/*                                                                         */\n/*    ANSI-specific configuration file (specification only).               */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006-2008, 2010-2011, 2013, 2014 by               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This header file contains a number of macro definitions that are used */\n  /* by the rest of the engine.  Most of the macros here are automatically */\n  /* determined at compile time, and you should not need to change it to   */\n  /* port FreeType, except to compile the library with a non-ANSI          */\n  /* compiler.                                                             */\n  /*                                                                       */\n  /* Note however that if some specific modifications are needed, we       */\n  /* advise you to place a modified copy in your build directory.          */\n  /*                                                                       */\n  /* The build directory is usually `builds/<system>', and contains        */\n  /* system-specific files that are always included first when building    */\n  /* the library.                                                          */\n  /*                                                                       */\n  /* This ANSI version should stay in `include/config/'.                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __FTCONFIG_H__\n#define __FTCONFIG_H__\n\n#include <ft2build.h>\n#include FT_CONFIG_OPTIONS_H\n#include FT_CONFIG_STANDARD_LIBRARY_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*               PLATFORM-SPECIFIC CONFIGURATION MACROS                  */\n  /*                                                                       */\n  /* These macros can be toggled to suit a specific system.  The current   */\n  /* ones are defaults used to compile FreeType in an ANSI C environment   */\n  /* (16bit compilers are also supported).  Copy this file to your own     */\n  /* `builds/<system>' directory, and edit it to port the engine.          */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* There are systems (like the Texas Instruments 'C54x) where a `char' */\n  /* has 16 bits.  ANSI C says that sizeof(char) is always 1.  Since an  */\n  /* `int' has 16 bits also for this system, sizeof(int) gives 1 which   */\n  /* is probably unexpected.                                             */\n  /*                                                                     */\n  /* `CHAR_BIT' (defined in limits.h) gives the number of bits in a      */\n  /* `char' type.                                                        */\n\n#ifndef FT_CHAR_BIT\n#define FT_CHAR_BIT  CHAR_BIT\n#endif\n\n\n  /* The size of an `int' type.  */\n#if                                 FT_UINT_MAX == 0xFFFFUL\n#define FT_SIZEOF_INT  (16 / FT_CHAR_BIT)\n#elif                               FT_UINT_MAX == 0xFFFFFFFFUL\n#define FT_SIZEOF_INT  (32 / FT_CHAR_BIT)\n#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL\n#define FT_SIZEOF_INT  (64 / FT_CHAR_BIT)\n#else\n#error \"Unsupported size of `int' type!\"\n#endif\n\n  /* The size of a `long' type.  A five-byte `long' (as used e.g. on the */\n  /* DM642) is recognized but avoided.                                   */\n#if                                  FT_ULONG_MAX == 0xFFFFFFFFUL\n#define FT_SIZEOF_LONG  (32 / FT_CHAR_BIT)\n#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL\n#define FT_SIZEOF_LONG  (32 / FT_CHAR_BIT)\n#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL\n#define FT_SIZEOF_LONG  (64 / FT_CHAR_BIT)\n#else\n#error \"Unsupported size of `long' type!\"\n#endif\n\n\n  /* FT_UNUSED is a macro used to indicate that a given parameter is not  */\n  /* used -- this is only used to get rid of unpleasant compiler warnings */\n#ifndef FT_UNUSED\n#define FT_UNUSED( arg )  ( (arg) = (arg) )\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                     AUTOMATIC CONFIGURATION MACROS                    */\n  /*                                                                       */\n  /* These macros are computed from the ones defined above.  Don't touch   */\n  /* their definition, unless you know precisely what you are doing.  No   */\n  /* porter should need to mess with them.                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Mac support                                                           */\n  /*                                                                       */\n  /*   This is the only necessary change, so it is defined here instead    */\n  /*   providing a new configuration file.                                 */\n  /*                                                                       */\n#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )\n  /* no Carbon frameworks for 64bit 10.4.x */\n  /* AvailabilityMacros.h is available since Mac OS X 10.2,        */\n  /* so guess the system version by maximum errno before inclusion */\n#include <errno.h>\n#ifdef ECANCELED /* defined since 10.2 */\n#include \"AvailabilityMacros.h\"\n#endif\n#if defined( __LP64__ ) && \\\n    ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )\n#undef FT_MACINTOSH\n#endif\n\n#elif defined( __SC__ ) || defined( __MRC__ )\n  /* Classic MacOS compilers */\n#include \"ConditionalMacros.h\"\n#if TARGET_OS_MAC\n#define FT_MACINTOSH 1\n#endif\n\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int16                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for a 16bit signed integer type.                         */\n  /*                                                                       */\n  typedef signed short  FT_Int16;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt16                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for a 16bit unsigned integer type.                       */\n  /*                                                                       */\n  typedef unsigned short  FT_UInt16;\n\n  /* */\n\n\n  /* this #if 0 ... #endif clause is for documentation purposes */\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int32                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for a 32bit signed integer type.  The size depends on    */\n  /*    the configuration.                                                 */\n  /*                                                                       */\n  typedef signed XXX  FT_Int32;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt32                                                          */\n  /*                                                                       */\n  /*    A typedef for a 32bit unsigned integer type.  The size depends on  */\n  /*    the configuration.                                                 */\n  /*                                                                       */\n  typedef unsigned XXX  FT_UInt32;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int64                                                           */\n  /*                                                                       */\n  /*    A typedef for a 64bit signed integer type.  The size depends on    */\n  /*    the configuration.  Only defined if there is real 64bit support;   */\n  /*    otherwise, it gets emulated with a structure (if necessary).       */\n  /*                                                                       */\n  typedef signed XXX  FT_Int64;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt64                                                          */\n  /*                                                                       */\n  /*    A typedef for a 64bit unsigned integer type.  The size depends on  */\n  /*    the configuration.  Only defined if there is real 64bit support;   */\n  /*    otherwise, it gets emulated with a structure (if necessary).       */\n  /*                                                                       */\n  typedef unsigned XXX  FT_UInt64;\n\n  /* */\n\n#endif\n\n#if FT_SIZEOF_INT == (32 / FT_CHAR_BIT)\n\n  typedef signed int      FT_Int32;\n  typedef unsigned int    FT_UInt32;\n\n#elif FT_SIZEOF_LONG == (32 / FT_CHAR_BIT)\n\n  typedef signed long     FT_Int32;\n  typedef unsigned long   FT_UInt32;\n\n#else\n#error \"no 32bit type found -- please check your configuration files\"\n#endif\n\n\n  /* look up an integer type that is at least 32 bits */\n#if FT_SIZEOF_INT >= (32 / FT_CHAR_BIT)\n\n  typedef int            FT_Fast;\n  typedef unsigned int   FT_UFast;\n\n#elif FT_SIZEOF_LONG >= (32 / FT_CHAR_BIT)\n\n  typedef long           FT_Fast;\n  typedef unsigned long  FT_UFast;\n\n#endif\n\n\n  /* determine whether we have a 64-bit int type for platforms without */\n  /* Autoconf                                                          */\n#if FT_SIZEOF_LONG == (64 / FT_CHAR_BIT)\n\n  /* FT_LONG64 must be defined if a 64-bit type is available */\n#define FT_LONG64\n#define FT_INT64   long\n#define FT_UINT64  unsigned long\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* A 64-bit data type may create compilation problems if you compile     */\n  /* in strict ANSI mode.  To avoid them, we disable other 64-bit data     */\n  /* types if __STDC__ is defined.  You can however ignore this rule       */\n  /* by defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro.     */\n  /*                                                                       */\n#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )\n\n#if defined( _MSC_VER ) && _MSC_VER >= 900  /* Visual C++ (and Intel C++) */\n\n  /* this compiler provides the __int64 type */\n#define FT_LONG64\n#define FT_INT64   __int64\n#define FT_UINT64  unsigned __int64\n\n#elif defined( __BORLANDC__ )  /* Borland C++ */\n\n  /* XXXX: We should probably check the value of __BORLANDC__ in order */\n  /*       to test the compiler version.                               */\n\n  /* this compiler provides the __int64 type */\n#define FT_LONG64\n#define FT_INT64   __int64\n#define FT_UINT64  unsigned __int64\n\n#elif defined( __WATCOMC__ )   /* Watcom C++ */\n\n  /* Watcom doesn't provide 64-bit data types */\n\n#elif defined( __MWERKS__ )    /* Metrowerks CodeWarrior */\n\n#define FT_LONG64\n#define FT_INT64   long long int\n#define FT_UINT64  unsigned long long int\n\n#elif defined( __GNUC__ )\n\n  /* GCC provides the `long long' type */\n#define FT_LONG64\n#define FT_INT64   long long int\n#define FT_UINT64  unsigned long long int\n\n#endif /* _MSC_VER */\n\n#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */\n\n#ifdef FT_LONG64\n  typedef FT_INT64   FT_Int64;\n  typedef FT_UINT64  FT_UInt64;\n#endif\n\n\n#define FT_BEGIN_STMNT  do {\n#define FT_END_STMNT    } while ( 0 )\n#define FT_DUMMY_STMNT  FT_BEGIN_STMNT FT_END_STMNT\n\n\n#ifdef FT_MAKE_OPTION_SINGLE_OBJECT\n\n#define FT_LOCAL( x )      static  x\n#define FT_LOCAL_DEF( x )  static  x\n\n#else\n\n#ifdef __cplusplus\n#define FT_LOCAL( x )      extern \"C\"  x\n#define FT_LOCAL_DEF( x )  extern \"C\"  x\n#else\n#define FT_LOCAL( x )      extern  x\n#define FT_LOCAL_DEF( x )  x\n#endif\n\n#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */\n\n#define FT_LOCAL_ARRAY( x )      extern const  x\n#define FT_LOCAL_ARRAY_DEF( x )  const  x\n\n\n#ifndef FT_BASE\n\n#ifdef __cplusplus\n#define FT_BASE( x )  extern \"C\"  x\n#else\n#define FT_BASE( x )  extern  x\n#endif\n\n#endif /* !FT_BASE */\n\n\n#ifndef FT_BASE_DEF\n\n#ifdef __cplusplus\n#define FT_BASE_DEF( x )  x\n#else\n#define FT_BASE_DEF( x )  x\n#endif\n\n#endif /* !FT_BASE_DEF */\n\n\n#ifndef FT_EXPORT\n\n#ifdef __cplusplus\n#define FT_EXPORT( x )  extern \"C\"  x\n#else\n#define FT_EXPORT( x )  extern  x\n#endif\n\n#endif /* !FT_EXPORT */\n\n\n#ifndef FT_EXPORT_DEF\n\n#ifdef __cplusplus\n#define FT_EXPORT_DEF( x )  extern \"C\"  x\n#else\n#define FT_EXPORT_DEF( x )  extern  x\n#endif\n\n#endif /* !FT_EXPORT_DEF */\n\n\n#ifndef FT_EXPORT_VAR\n\n#ifdef __cplusplus\n#define FT_EXPORT_VAR( x )  extern \"C\"  x\n#else\n#define FT_EXPORT_VAR( x )  extern  x\n#endif\n\n#endif /* !FT_EXPORT_VAR */\n\n  /* The following macros are needed to compile the library with a   */\n  /* C++ compiler and with 16bit compilers.                          */\n  /*                                                                 */\n\n  /* This is special.  Within C++, you must specify `extern \"C\"' for */\n  /* functions which are used via function pointers, and you also    */\n  /* must do that for structures which contain function pointers to  */\n  /* assure C linkage -- it's not possible to have (local) anonymous */\n  /* functions which are accessed by (global) function pointers.     */\n  /*                                                                 */\n  /*                                                                 */\n  /* FT_CALLBACK_DEF is used to _define_ a callback function.        */\n  /*                                                                 */\n  /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */\n  /* contains pointers to callback functions.                        */\n  /*                                                                 */\n  /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable   */\n  /* that contains pointers to callback functions.                   */\n  /*                                                                 */\n  /*                                                                 */\n  /* Some 16bit compilers have to redefine these macros to insert    */\n  /* the infamous `_cdecl' or `__fastcall' declarations.             */\n  /*                                                                 */\n#ifndef FT_CALLBACK_DEF\n#ifdef __cplusplus\n#define FT_CALLBACK_DEF( x )  extern \"C\"  x\n#else\n#define FT_CALLBACK_DEF( x )  static  x\n#endif\n#endif /* FT_CALLBACK_DEF */\n\n#ifndef FT_CALLBACK_TABLE\n#ifdef __cplusplus\n#define FT_CALLBACK_TABLE      extern \"C\"\n#define FT_CALLBACK_TABLE_DEF  extern \"C\"\n#else\n#define FT_CALLBACK_TABLE      extern\n#define FT_CALLBACK_TABLE_DEF  /* nothing */\n#endif\n#endif /* FT_CALLBACK_TABLE */\n\n\nFT_END_HEADER\n\n\n#endif /* __FTCONFIG_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/config/ftheader.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftheader.h                                                             */\n/*                                                                         */\n/*    Build macros of the FreeType 2 library.                              */\n/*                                                                         */\n/*  Copyright 1996-2008, 2010, 2012, 2013 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#ifndef __FT_HEADER_H__\n#define __FT_HEADER_H__\n\n\n  /*@***********************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_BEGIN_HEADER                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro is used in association with @FT_END_HEADER in header    */\n  /*    files to ensure that the declarations within are properly          */\n  /*    encapsulated in an `extern \"C\" { .. }' block when included from a  */\n  /*    C++ compiler.                                                      */\n  /*                                                                       */\n#ifdef __cplusplus\n#define FT_BEGIN_HEADER  extern \"C\" {\n#else\n#define FT_BEGIN_HEADER  /* nothing */\n#endif\n\n\n  /*@***********************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_END_HEADER                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro is used in association with @FT_BEGIN_HEADER in header  */\n  /*    files to ensure that the declarations within are properly          */\n  /*    encapsulated in an `extern \"C\" { .. }' block when included from a  */\n  /*    C++ compiler.                                                      */\n  /*                                                                       */\n#ifdef __cplusplus\n#define FT_END_HEADER  }\n#else\n#define FT_END_HEADER  /* nothing */\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Aliases for the FreeType 2 public and configuration files.            */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    header_file_macros                                                 */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Header File Macros                                                 */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Macro definitions used to #include specific header files.          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The following macros are defined to the name of specific           */\n  /*    FreeType~2 header files.  They can be used directly in #include    */\n  /*    statements as in:                                                  */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      #include FT_FREETYPE_H                                           */\n  /*      #include FT_MULTIPLE_MASTERS_H                                   */\n  /*      #include FT_GLYPH_H                                              */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    There are several reasons why we are now using macros to name      */\n  /*    public header files.  The first one is that such macros are not    */\n  /*    limited to the infamous 8.3~naming rule required by DOS (and       */\n  /*    `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h').   */\n  /*                                                                       */\n  /*    The second reason is that it allows for more flexibility in the    */\n  /*    way FreeType~2 is installed on a given system.                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* configuration files */\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_CONFIG_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   FreeType~2 configuration data.\n   *\n   */\n#ifndef FT_CONFIG_CONFIG_H\n#define FT_CONFIG_CONFIG_H  <config/ftconfig.h>\n#endif\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_STANDARD_LIBRARY_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   FreeType~2 interface to the standard C library functions.\n   *\n   */\n#ifndef FT_CONFIG_STANDARD_LIBRARY_H\n#define FT_CONFIG_STANDARD_LIBRARY_H  <config/ftstdlib.h>\n#endif\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_OPTIONS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   FreeType~2 project-specific configuration options.\n   *\n   */\n#ifndef FT_CONFIG_OPTIONS_H\n#define FT_CONFIG_OPTIONS_H  <config/ftoption.h>\n#endif\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_MODULES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list of FreeType~2 modules that are statically linked to new library\n   *   instances in @FT_Init_FreeType.\n   *\n   */\n#ifndef FT_CONFIG_MODULES_H\n#define FT_CONFIG_MODULES_H  <config/ftmodule.h>\n#endif\n\n  /* */\n\n  /* public headers */\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_FREETYPE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   base FreeType~2 API.\n   *\n   */\n#define FT_FREETYPE_H  <freetype.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ERRORS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list of FreeType~2 error codes (and messages).\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_ERRORS_H  <fterrors.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MODULE_ERRORS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list of FreeType~2 module error offsets (and messages).\n   *\n   */\n#define FT_MODULE_ERRORS_H  <ftmoderr.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SYSTEM_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 interface to low-level operations (i.e., memory management\n   *   and stream i/o).\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_SYSTEM_H  <ftsystem.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IMAGE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing type\n   *   definitions related to glyph images (i.e., bitmaps, outlines,\n   *   scan-converter parameters).\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_IMAGE_H  <ftimage.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TYPES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   basic data types defined by FreeType~2.\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_TYPES_H  <fttypes.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_LIST_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list management API of FreeType~2.\n   *\n   *   (Most applications will never need to include this file.)\n   *\n   */\n#define FT_LIST_H  <ftlist.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_OUTLINE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   scalable outline management API of FreeType~2.\n   *\n   */\n#define FT_OUTLINE_H  <ftoutln.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SIZES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API which manages multiple @FT_Size objects per face.\n   *\n   */\n#define FT_SIZES_H  <ftsizes.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MODULE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   module management API of FreeType~2.\n   *\n   */\n#define FT_MODULE_H  <ftmodapi.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_RENDER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   renderer module management API of FreeType~2.\n   *\n   */\n#define FT_RENDER_H  <ftrender.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_AUTOHINTER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   structures and macros related to the auto-hinting module.\n   *\n   */\n#define FT_AUTOHINTER_H  <ftautoh.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CFF_DRIVER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   structures and macros related to the CFF driver module.\n   *\n   */\n#define FT_CFF_DRIVER_H  <ftcffdrv.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_DRIVER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   structures and macros related to the TrueType driver module.\n   *\n   */\n#define FT_TRUETYPE_DRIVER_H  <ftttdrv.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TYPE1_TABLES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   types and API specific to the Type~1 format.\n   *\n   */\n#define FT_TYPE1_TABLES_H  <t1tables.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_IDS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   enumeration values which identify name strings, languages, encodings,\n   *   etc.  This file really contains a _large_ set of constant macro\n   *   definitions, taken from the TrueType and OpenType specifications.\n   *\n   */\n#define FT_TRUETYPE_IDS_H  <ttnameid.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_TABLES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   types and API specific to the TrueType (as well as OpenType) format.\n   *\n   */\n#define FT_TRUETYPE_TABLES_H  <tttables.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_TAGS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of TrueType four-byte `tags' which identify blocks in\n   *   SFNT-based font formats (i.e., TrueType and OpenType).\n   *\n   */\n#define FT_TRUETYPE_TAGS_H  <tttags.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BDF_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which accesses BDF-specific strings from a\n   *   face.\n   *\n   */\n#define FT_BDF_H  <ftbdf.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CID_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which access CID font information from a\n   *   face.\n   *\n   */\n#define FT_CID_H  <ftcid.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GZIP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports gzip-compressed files.\n   *\n   */\n#define FT_GZIP_H  <ftgzip.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_LZW_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports LZW-compressed files.\n   *\n   */\n#define FT_LZW_H  <ftlzw.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BZIP2_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports bzip2-compressed files.\n   *\n   */\n#define FT_BZIP2_H  <ftbzip2.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_WINFONTS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports Windows FNT files.\n   *\n   */\n#define FT_WINFONTS_H   <ftwinfnt.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GLYPH_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional glyph management component.\n   *\n   */\n#define FT_GLYPH_H  <ftglyph.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BITMAP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional bitmap conversion component.\n   *\n   */\n#define FT_BITMAP_H  <ftbitmap.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BBOX_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional exact bounding box computation routines.\n   *\n   */\n#define FT_BBOX_H  <ftbbox.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional FreeType~2 cache sub-system.\n   *\n   */\n#define FT_CACHE_H  <ftcache.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_IMAGE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   `glyph image' API of the FreeType~2 cache sub-system.\n   *\n   *   It is used to define a cache for @FT_Glyph elements.  You can also\n   *   use the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to\n   *   store small glyph bitmaps, as it will use less memory.\n   *\n   *   This macro is deprecated.  Simply include @FT_CACHE_H to have all\n   *   glyph image-related cache declarations.\n   *\n   */\n#define FT_CACHE_IMAGE_H  FT_CACHE_H\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_SMALL_BITMAPS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   `small bitmaps' API of the FreeType~2 cache sub-system.\n   *\n   *   It is used to define a cache for small glyph bitmaps in a relatively\n   *   memory-efficient way.  You can also use the API defined in\n   *   @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images,\n   *   including scalable outlines.\n   *\n   *   This macro is deprecated.  Simply include @FT_CACHE_H to have all\n   *   small bitmaps-related cache declarations.\n   *\n   */\n#define FT_CACHE_SMALL_BITMAPS_H  FT_CACHE_H\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_CHARMAP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   `charmap' API of the FreeType~2 cache sub-system.\n   *\n   *   This macro is deprecated.  Simply include @FT_CACHE_H to have all\n   *   charmap-based cache declarations.\n   *\n   */\n#define FT_CACHE_CHARMAP_H  FT_CACHE_H\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MAC_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   Macintosh-specific FreeType~2 API.  The latter is used to access\n   *   fonts embedded in resource forks.\n   *\n   *   This header file must be explicitly included by client applications\n   *   compiled on the Mac (note that the base API still works though).\n   *\n   */\n#define FT_MAC_H  <ftmac.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MULTIPLE_MASTERS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional multiple-masters management API of FreeType~2.\n   *\n   */\n#define FT_MULTIPLE_MASTERS_H  <ftmm.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SFNT_NAMES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional FreeType~2 API which accesses embedded `name' strings in\n   *   SFNT-based font formats (i.e., TrueType and OpenType).\n   *\n   */\n#define FT_SFNT_NAMES_H  <ftsnames.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_OPENTYPE_VALIDATE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional FreeType~2 API which validates OpenType tables (BASE, GDEF,\n   *   GPOS, GSUB, JSTF).\n   *\n   */\n#define FT_OPENTYPE_VALIDATE_H  <ftotval.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GX_VALIDATE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional FreeType~2 API which validates TrueTypeGX/AAT tables (feat,\n   *   mort, morx, bsln, just, kern, opbd, trak, prop).\n   *\n   */\n#define FT_GX_VALIDATE_H  <ftgxval.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_PFR_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which accesses PFR-specific data.\n   *\n   */\n#define FT_PFR_H  <ftpfr.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_STROKER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which provides functions to stroke outline paths.\n   */\n#define FT_STROKER_H  <ftstroke.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SYNTHESIS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs artificial obliquing and emboldening.\n   */\n#define FT_SYNTHESIS_H  <ftsynth.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_XFREE86_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which provides functions specific to the XFree86 and\n   *   X.Org X11 servers.\n   */\n#define FT_XFREE86_H  <ftxf86.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRIGONOMETRY_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs trigonometric computations (e.g.,\n   *   cosines and arc tangents).\n   */\n#define FT_TRIGONOMETRY_H  <fttrigon.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_LCD_FILTER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs color filtering for subpixel rendering.\n   */\n#define FT_LCD_FILTER_H  <ftlcdfil.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_UNPATENTED_HINTING_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs color filtering for subpixel rendering.\n   */\n#define FT_UNPATENTED_HINTING_H  <ttunpat.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_INCREMENTAL_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which performs color filtering for subpixel rendering.\n   */\n#define FT_INCREMENTAL_H  <ftincrem.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GASP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which returns entries from the TrueType GASP table.\n   */\n#define FT_GASP_H  <ftgasp.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ADVANCES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType~2 API which returns individual and ranged glyph advances.\n   */\n#define FT_ADVANCES_H  <ftadvanc.h>\n\n\n  /* */\n\n#define FT_ERROR_DEFINITIONS_H  <fterrdef.h>\n\n\n  /* The internals of the cache sub-system are no longer exposed.  We */\n  /* default to FT_CACHE_H at the moment just in case, but we know of */\n  /* no rogue client that uses them.                                  */\n  /*                                                                  */\n#define FT_CACHE_MANAGER_H           <ftcache.h>\n#define FT_CACHE_INTERNAL_MRU_H      <ftcache.h>\n#define FT_CACHE_INTERNAL_MANAGER_H  <ftcache.h>\n#define FT_CACHE_INTERNAL_CACHE_H    <ftcache.h>\n#define FT_CACHE_INTERNAL_GLYPH_H    <ftcache.h>\n#define FT_CACHE_INTERNAL_IMAGE_H    <ftcache.h>\n#define FT_CACHE_INTERNAL_SBITS_H    <ftcache.h>\n\n\n#define FT_INCREMENTAL_H          <ftincrem.h>\n\n#define FT_TRUETYPE_UNPATENTED_H  <ttunpat.h>\n\n\n  /*\n   * Include internal headers definitions from <internal/...>\n   * only when building the library.\n   */\n#ifdef FT2_BUILD_LIBRARY\n#define  FT_INTERNAL_INTERNAL_H  <internal/internal.h>\n#include FT_INTERNAL_INTERNAL_H\n#endif /* FT2_BUILD_LIBRARY */\n\n\n#endif /* __FT2_BUILD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/config/ftmodule.h",
    "content": "/*\n *  This file registers the FreeType modules compiled into the library.\n *\n *  If you use GNU make, this file IS NOT USED!  Instead, it is created in\n *  the objects directory (normally `<topdir>/objs/') based on information\n *  from `<topdir>/modules.cfg'.\n *\n *  Please read `docs/INSTALL.ANY' and `docs/CUSTOMIZE' how to compile\n *  FreeType without GNU make.\n *\n */\n\nFT_USE_MODULE( FT_Module_Class, autofit_module_class )\nFT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )\nFT_USE_MODULE( FT_Module_Class, psaux_module_class )\nFT_USE_MODULE( FT_Module_Class, psnames_module_class )\nFT_USE_MODULE( FT_Module_Class, pshinter_module_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )\nFT_USE_MODULE( FT_Module_Class, sfnt_module_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class )\nFT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )\n\n/* EOF */\n"
  },
  {
    "path": "ext/freetype2/include/config/ftoption.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftoption.h                                                             */\n/*                                                                         */\n/*    User-selectable configuration macros (specification only).           */\n/*                                                                         */\n/*  Copyright 1996-2014 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTOPTION_H__\n#define __FTOPTION_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                 USER-SELECTABLE CONFIGURATION MACROS                  */\n  /*                                                                       */\n  /* This file contains the default configuration macro definitions for    */\n  /* a standard build of the FreeType library.  There are three ways to    */\n  /* use this file to build project-specific versions of the library:      */\n  /*                                                                       */\n  /*  - You can modify this file by hand, but this is not recommended in   */\n  /*    cases where you would like to build several versions of the        */\n  /*    library from a single source directory.                            */\n  /*                                                                       */\n  /*  - You can put a copy of this file in your build directory, more      */\n  /*    precisely in `$BUILD/config/ftoption.h', where `$BUILD' is the     */\n  /*    name of a directory that is included _before_ the FreeType include */\n  /*    path during compilation.                                           */\n  /*                                                                       */\n  /*    The default FreeType Makefiles and Jamfiles use the build          */\n  /*    directory `builds/<system>' by default, but you can easily change  */\n  /*    that for your own projects.                                        */\n  /*                                                                       */\n  /*  - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it    */\n  /*    slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to       */\n  /*    locate this file during the build.  For example,                   */\n  /*                                                                       */\n  /*      #define FT_CONFIG_OPTIONS_H  <myftoptions.h>                     */\n  /*      #include <config/ftheader.h>                                     */\n  /*                                                                       */\n  /*    will use `$BUILD/myftoptions.h' instead of this file for macro     */\n  /*    definitions.                                                       */\n  /*                                                                       */\n  /*    Note also that you can similarly pre-define the macro              */\n  /*    FT_CONFIG_MODULES_H used to locate the file listing of the modules */\n  /*    that are statically linked to the library at compile time.  By     */\n  /*    default, this file is <config/ftmodule.h>.                         */\n  /*                                                                       */\n  /* We highly recommend using the third method whenever possible.         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /**** G E N E R A L   F R E E T Y P E   2   C O N F I G U R A T I O N ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Uncomment the line below if you want to activate sub-pixel rendering  */\n  /* (a.k.a. LCD rendering, or ClearType) in this build of the library.    */\n  /*                                                                       */\n  /* Note that this feature is covered by several Microsoft patents        */\n  /* and should not be activated in any default build of the library.      */\n  /*                                                                       */\n  /* This macro has no impact on the FreeType API, only on its             */\n  /* _implementation_.  For example, using FT_RENDER_MODE_LCD when calling */\n  /* FT_Render_Glyph still generates a bitmap that is 3 times wider than   */\n  /* the original size in case this macro isn't defined; however, each     */\n  /* triplet of subpixels has R=G=B.                                       */\n  /*                                                                       */\n  /* This is done to allow FreeType clients to run unmodified, forcing     */\n  /* them to display normal gray-level anti-aliased glyphs.                */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Many compilers provide a non-ANSI 64-bit data type that can be used   */\n  /* by FreeType to speed up some computations.  However, this will create */\n  /* some problems when compiling the library in strict ANSI mode.         */\n  /*                                                                       */\n  /* For this reason, the use of 64-bit integers is normally disabled when */\n  /* the __STDC__ macro is defined.  You can however disable this by       */\n  /* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here.                 */\n  /*                                                                       */\n  /* For most compilers, this will only create compilation warnings when   */\n  /* building the library.                                                 */\n  /*                                                                       */\n  /* ObNote: The compiler-specific 64-bit integers are detected in the     */\n  /*         file `ftconfig.h' either statically or through the            */\n  /*         `configure' script on supported platforms.                    */\n  /*                                                                       */\n#undef FT_CONFIG_OPTION_FORCE_INT64\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* If this macro is defined, do not try to use an assembler version of   */\n  /* performance-critical functions (e.g. FT_MulFix).  You should only do  */\n  /* that to verify that the assembler function works properly, or to      */\n  /* execute benchmark tests of the various implementations.               */\n/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* If this macro is defined, try to use an inlined assembler version of  */\n  /* the `FT_MulFix' function, which is a `hotspot' when loading and       */\n  /* hinting glyphs, and which should be executed as fast as possible.     */\n  /*                                                                       */\n  /* Note that if your compiler or CPU is not supported, this will default */\n  /* to the standard and portable implementation found in `ftcalc.c'.      */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_INLINE_MULFIX\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* LZW-compressed file support.                                          */\n  /*                                                                       */\n  /*   FreeType now handles font files that have been compressed with the  */\n  /*   `compress' program.  This is mostly used to parse many of the PCF   */\n  /*   files that come with various X11 distributions.  The implementation */\n  /*   uses NetBSD's `zopen' to partially uncompress the file on the fly   */\n  /*   (see src/lzw/ftgzip.c).                                             */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.             */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_USE_LZW\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Gzip-compressed file support.                                         */\n  /*                                                                       */\n  /*   FreeType now handles font files that have been compressed with the  */\n  /*   `gzip' program.  This is mostly used to parse many of the PCF files */\n  /*   that come with XFree86.  The implementation uses `zlib' to          */\n  /*   partially uncompress the file on the fly (see src/gzip/ftgzip.c).   */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.  See also   */\n  /*   the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below.                       */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_USE_ZLIB\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* ZLib library selection                                                */\n  /*                                                                       */\n  /*   This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined.  */\n  /*   It allows FreeType's `ftgzip' component to link to the system's     */\n  /*   installation of the ZLib library.  This is useful on systems like   */\n  /*   Unix or VMS where it generally is already available.                */\n  /*                                                                       */\n  /*   If you let it undefined, the component will use its own copy        */\n  /*   of the zlib sources instead.  These have been modified to be        */\n  /*   included directly within the component and *not* export external    */\n  /*   function names.  This allows you to link any program with FreeType  */\n  /*   _and_ ZLib without linking conflicts.                               */\n  /*                                                                       */\n  /*   Do not #undef this macro here since the build system might define   */\n  /*   it for certain configurations only.                                 */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Bzip2-compressed file support.                                        */\n  /*                                                                       */\n  /*   FreeType now handles font files that have been compressed with the  */\n  /*   `bzip2' program.  This is mostly used to parse many of the PCF      */\n  /*   files that come with XFree86.  The implementation uses `libbz2' to  */\n  /*   partially uncompress the file on the fly (see src/bzip2/ftbzip2.c). */\n  /*   Contrary to gzip, bzip2 currently is not included and need to use   */\n  /*   the system available bzip2 implementation.                          */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.             */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_USE_BZIP2 */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define to disable the use of file stream functions and types, FILE,   */\n  /* fopen() etc.  Enables the use of smaller system libraries on embedded */\n  /* systems that have multiple system libraries, some with or without     */\n  /* file stream support, in the cases where file stream support is not    */\n  /* necessary such as memory loading of font files.                       */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* PNG bitmap support.                                                   */\n  /*                                                                       */\n  /*   FreeType now handles loading color bitmap glyphs in the PNG format. */\n  /*   This requires help from the external libpng library.  Uncompressed  */\n  /*   color bitmaps do not need any external libraries and will be        */\n  /*   supported regardless of this configuration.                         */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.             */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_USE_PNG */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* HarfBuzz support.                                                     */\n  /*                                                                       */\n  /*   FreeType uses the HarfBuzz library to improve auto-hinting of       */\n  /*   OpenType fonts.  If available, many glyphs not directly addressable */\n  /*   by a font's character map will be hinted also.                      */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.             */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_USE_HARFBUZZ */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* DLL export compilation                                                */\n  /*                                                                       */\n  /*   When compiling FreeType as a DLL, some systems/compilers need a     */\n  /*   special keyword in front OR after the return type of function       */\n  /*   declarations.                                                       */\n  /*                                                                       */\n  /*   Two macros are used within the FreeType source code to define       */\n  /*   exported library functions: FT_EXPORT and FT_EXPORT_DEF.            */\n  /*                                                                       */\n  /*     FT_EXPORT( return_type )                                          */\n  /*                                                                       */\n  /*       is used in a function declaration, as in                        */\n  /*                                                                       */\n  /*         FT_EXPORT( FT_Error )                                         */\n  /*         FT_Init_FreeType( FT_Library*  alibrary );                    */\n  /*                                                                       */\n  /*                                                                       */\n  /*     FT_EXPORT_DEF( return_type )                                      */\n  /*                                                                       */\n  /*       is used in a function definition, as in                         */\n  /*                                                                       */\n  /*         FT_EXPORT_DEF( FT_Error )                                     */\n  /*         FT_Init_FreeType( FT_Library*  alibrary )                     */\n  /*         {                                                             */\n  /*           ... some code ...                                           */\n  /*           return FT_Err_Ok;                                           */\n  /*         }                                                             */\n  /*                                                                       */\n  /*   You can provide your own implementation of FT_EXPORT and            */\n  /*   FT_EXPORT_DEF here if you want.  If you leave them undefined, they  */\n  /*   will be later automatically defined as `extern return_type' to      */\n  /*   allow normal compilation.                                           */\n  /*                                                                       */\n  /*   Do not #undef these macros here since the build system might define */\n  /*   them for certain configurations only.                               */\n  /*                                                                       */\n/* #define FT_EXPORT(x)      extern x */\n/* #define FT_EXPORT_DEF(x)  x */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Glyph Postscript Names handling                                       */\n  /*                                                                       */\n  /*   By default, FreeType 2 is compiled with the `psnames' module.  This */\n  /*   module is in charge of converting a glyph name string into a        */\n  /*   Unicode value, or return a Macintosh standard glyph name for the    */\n  /*   use with the TrueType `post' table.                                 */\n  /*                                                                       */\n  /*   Undefine this macro if you do not want `psnames' compiled in your   */\n  /*   build of FreeType.  This has the following effects:                 */\n  /*                                                                       */\n  /*   - The TrueType driver will provide its own set of glyph names,      */\n  /*     if you build it to support postscript names in the TrueType       */\n  /*     `post' table.                                                     */\n  /*                                                                       */\n  /*   - The Type 1 driver will not be able to synthesize a Unicode        */\n  /*     charmap out of the glyphs found in the fonts.                     */\n  /*                                                                       */\n  /*   You would normally undefine this configuration macro when building  */\n  /*   a version of FreeType that doesn't contain a Type 1 or CFF driver.  */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Postscript Names to Unicode Values support                            */\n  /*                                                                       */\n  /*   By default, FreeType 2 is built with the `PSNames' module compiled  */\n  /*   in.  Among other things, the module is used to convert a glyph name */\n  /*   into a Unicode value.  This is especially useful in order to        */\n  /*   synthesize on the fly a Unicode charmap from the CFF/Type 1 driver  */\n  /*   through a big table named the `Adobe Glyph List' (AGL).             */\n  /*                                                                       */\n  /*   Undefine this macro if you do not want the Adobe Glyph List         */\n  /*   compiled in your `PSNames' module.  The Type 1 driver will not be   */\n  /*   able to synthesize a Unicode charmap out of the glyphs found in the */\n  /*   fonts.                                                              */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Support for Mac fonts                                                 */\n  /*                                                                       */\n  /*   Define this macro if you want support for outline fonts in Mac      */\n  /*   format (mac dfont, mac resource, macbinary containing a mac         */\n  /*   resource) on non-Mac platforms.                                     */\n  /*                                                                       */\n  /*   Note that the `FOND' resource isn't checked.                        */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_MAC_FONTS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Guessing methods to access embedded resource forks                    */\n  /*                                                                       */\n  /*   Enable extra Mac fonts support on non-Mac platforms (e.g.           */\n  /*   GNU/Linux).                                                         */\n  /*                                                                       */\n  /*   Resource forks which include fonts data are stored sometimes in     */\n  /*   locations which users or developers don't expected.  In some cases, */\n  /*   resource forks start with some offset from the head of a file.  In  */\n  /*   other cases, the actual resource fork is stored in file different   */\n  /*   from what the user specifies.  If this option is activated,         */\n  /*   FreeType tries to guess whether such offsets or different file      */\n  /*   names must be used.                                                 */\n  /*                                                                       */\n  /*   Note that normal, direct access of resource forks is controlled via */\n  /*   the FT_CONFIG_OPTION_MAC_FONTS option.                              */\n  /*                                                                       */\n#ifdef FT_CONFIG_OPTION_MAC_FONTS\n#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Allow the use of FT_Incremental_Interface to load typefaces that      */\n  /* contain no glyph data, but supply it via a callback function.         */\n  /* This is required by clients supporting document formats which         */\n  /* supply font data incrementally as the document is parsed, such        */\n  /* as the Ghostscript interpreter for the PostScript language.           */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_INCREMENTAL\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The size in bytes of the render pool used by the scan-line converter  */\n  /* to do all of its work.                                                */\n  /*                                                                       */\n  /* This must be greater than 4KByte if you use FreeType to rasterize     */\n  /* glyphs; otherwise, you may set it to zero to avoid unnecessary        */\n  /* allocation of the render pool.                                        */\n  /*                                                                       */\n#define FT_RENDER_POOL_SIZE  16384L\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* FT_MAX_MODULES                                                        */\n  /*                                                                       */\n  /*   The maximum number of modules that can be registered in a single    */\n  /*   FreeType library object.  32 is the default.                        */\n  /*                                                                       */\n#define FT_MAX_MODULES  32\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Debug level                                                           */\n  /*                                                                       */\n  /*   FreeType can be compiled in debug or trace mode.  In debug mode,    */\n  /*   errors are reported through the `ftdebug' component.  In trace      */\n  /*   mode, additional messages are sent to the standard output during    */\n  /*   execution.                                                          */\n  /*                                                                       */\n  /*   Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode.     */\n  /*   Define FT_DEBUG_LEVEL_TRACE to build it in trace mode.              */\n  /*                                                                       */\n  /*   Don't define any of these macros to compile in `release' mode!      */\n  /*                                                                       */\n  /*   Do not #undef these macros here since the build system might define */\n  /*   them for certain configurations only.                               */\n  /*                                                                       */\n/* #define FT_DEBUG_LEVEL_ERROR */\n/* #define FT_DEBUG_LEVEL_TRACE */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Autofitter debugging                                                  */\n  /*                                                                       */\n  /*   If FT_DEBUG_AUTOFIT is defined, FreeType provides some means to     */\n  /*   control the autofitter behaviour for debugging purposes with global */\n  /*   boolean variables (consequently, you should *never* enable this     */\n  /*   while compiling in `release' mode):                                 */\n  /*                                                                       */\n  /*     _af_debug_disable_horz_hints                                      */\n  /*     _af_debug_disable_vert_hints                                      */\n  /*     _af_debug_disable_blue_hints                                      */\n  /*                                                                       */\n  /*   Additionally, the following functions provide dumps of various      */\n  /*   internal autofit structures to stdout (using `printf'):             */\n  /*                                                                       */\n  /*     af_glyph_hints_dump_points                                        */\n  /*     af_glyph_hints_dump_segments                                      */\n  /*     af_glyph_hints_dump_edges                                         */\n  /*                                                                       */\n  /*   As an argument, they use another global variable:                   */\n  /*                                                                       */\n  /*     _af_debug_hints                                                   */\n  /*                                                                       */\n  /*   Please have a look at the `ftgrid' demo program to see how those    */\n  /*   variables and macros should be used.                                */\n  /*                                                                       */\n  /*   Do not #undef these macros here since the build system might define */\n  /*   them for certain configurations only.                               */\n  /*                                                                       */\n/* #define FT_DEBUG_AUTOFIT */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Memory Debugging                                                      */\n  /*                                                                       */\n  /*   FreeType now comes with an integrated memory debugger that is       */\n  /*   capable of detecting simple errors like memory leaks or double      */\n  /*   deletes.  To compile it within your build of the library, you       */\n  /*   should define FT_DEBUG_MEMORY here.                                 */\n  /*                                                                       */\n  /*   Note that the memory debugger is only activated at runtime when     */\n  /*   when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */\n  /*                                                                       */\n  /*   Do not #undef this macro here since the build system might define   */\n  /*   it for certain configurations only.                                 */\n  /*                                                                       */\n/* #define FT_DEBUG_MEMORY */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Module errors                                                         */\n  /*                                                                       */\n  /*   If this macro is set (which is _not_ the default), the higher byte  */\n  /*   of an error code gives the module in which the error has occurred,  */\n  /*   while the lower byte is the real error code.                        */\n  /*                                                                       */\n  /*   Setting this macro makes sense for debugging purposes only, since   */\n  /*   it would break source compatibility of certain programs that use    */\n  /*   FreeType 2.                                                         */\n  /*                                                                       */\n  /*   More details can be found in the files ftmoderr.h and fterrors.h.   */\n  /*                                                                       */\n#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Position Independent Code                                             */\n  /*                                                                       */\n  /*   If this macro is set (which is _not_ the default), FreeType2 will   */\n  /*   avoid creating constants that require address fixups.  Instead the  */\n  /*   constants will be moved into a struct and additional intialization  */\n  /*   code will be used.                                                  */\n  /*                                                                       */\n  /*   Setting this macro is needed for systems that prohibit address      */\n  /*   fixups, such as BREW.                                               */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_PIC */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****        S F N T   D R I V E R    C O N F I G U R A T I O N       ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support       */\n  /* embedded bitmaps in all formats using the SFNT module (namely         */\n  /* TrueType & OpenType).                                                 */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to    */\n  /* load and enumerate the glyph Postscript names in a TrueType or        */\n  /* OpenType file.                                                        */\n  /*                                                                       */\n  /* Note that when you do not compile the `PSNames' module by undefining  */\n  /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will   */\n  /* contain additional code used to read the PS Names table from a font.  */\n  /*                                                                       */\n  /* (By default, the module uses `PSNames' to extract glyph names.)       */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to       */\n  /* access the internal name table in a SFNT-based format like TrueType   */\n  /* or OpenType.  The name table contains various strings used to         */\n  /* describe the font, like family name, copyright, version, etc.  It     */\n  /* does not contain any glyph name though.                               */\n  /*                                                                       */\n  /* Accessing SFNT names is done through the functions declared in        */\n  /* `ftsnames.h'.                                                         */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_SFNT_NAMES\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* TrueType CMap support                                                 */\n  /*                                                                       */\n  /*   Here you can fine-tune which TrueType CMap table format shall be    */\n  /*   supported.                                                          */\n#define TT_CONFIG_CMAP_FORMAT_0\n#define TT_CONFIG_CMAP_FORMAT_2\n#define TT_CONFIG_CMAP_FORMAT_4\n#define TT_CONFIG_CMAP_FORMAT_6\n#define TT_CONFIG_CMAP_FORMAT_8\n#define TT_CONFIG_CMAP_FORMAT_10\n#define TT_CONFIG_CMAP_FORMAT_12\n#define TT_CONFIG_CMAP_FORMAT_13\n#define TT_CONFIG_CMAP_FORMAT_14\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****    T R U E T Y P E   D R I V E R    C O N F I G U R A T I O N   ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile   */\n  /* a bytecode interpreter in the TrueType driver.                        */\n  /*                                                                       */\n  /* By undefining this, you will only compile the code necessary to load  */\n  /* TrueType glyphs without hinting.                                      */\n  /*                                                                       */\n  /*   Do not #undef this macro here, since the build system might         */\n  /*   define it for certain configurations only.                          */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile       */\n  /* EXPERIMENTAL subpixel hinting support into the TrueType driver.  This */\n  /* replaces the native TrueType hinting mechanism when anything but      */\n  /* FT_RENDER_MODE_MONO is requested.                                     */\n  /*                                                                       */\n  /* Enabling this causes the TrueType driver to ignore instructions under */\n  /* certain conditions.  This is done in accordance with the guide here,  */\n  /* with some minor differences:                                          */\n  /*                                                                       */\n  /*  http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */\n  /*                                                                       */\n  /* By undefining this, you only compile the code necessary to hint       */\n  /* TrueType glyphs with native TT hinting.                               */\n  /*                                                                       */\n  /*   This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be    */\n  /*   defined.                                                            */\n  /*                                                                       */\n/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version  */\n  /* of the TrueType bytecode interpreter is used that doesn't implement   */\n  /* any of the patented opcodes and algorithms.  The patents related to   */\n  /* TrueType hinting have expired worldwide since May 2010; this option   */\n  /* is now deprecated.                                                    */\n  /*                                                                       */\n  /* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored*  */\n  /* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words,  */\n  /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or                */\n  /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time.    */\n  /*                                                                       */\n  /* This macro is only useful for a small number of font files (mostly    */\n  /* for Asian scripts) that require bytecode interpretation to properly   */\n  /* load glyphs.  For all other fonts, this produces unpleasant results,  */\n  /* thus the unpatented interpreter is never used to load glyphs from     */\n  /* TrueType fonts unless one of the following two options is used.       */\n  /*                                                                       */\n  /*   - The unpatented interpreter is explicitly activated by the user    */\n  /*     through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag         */\n  /*     when opening the FT_Face.                                         */\n  /*                                                                       */\n  /*   - FreeType detects that the FT_Face corresponds to one of the       */\n  /*     `trick' fonts (e.g., `Mingliu') it knows about.  The font engine  */\n  /*     contains a hard-coded list of font names and other matching       */\n  /*     parameters (see function `tt_face_init' in file                   */\n  /*     `src/truetype/ttobjs.c').                                         */\n  /*                                                                       */\n  /* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */\n  /*                                                                       */\n  /*   {                                                                   */\n  /*     FT_Parameter  parameter;                                          */\n  /*     FT_Open_Args  open_args;                                          */\n  /*                                                                       */\n  /*                                                                       */\n  /*     parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING;                  */\n  /*                                                                       */\n  /*     open_args.flags      = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;         */\n  /*     open_args.pathname   = my_font_pathname;                          */\n  /*     open_args.num_params = 1;                                         */\n  /*     open_args.params     = &parameter;                                */\n  /*                                                                       */\n  /*     error = FT_Open_Face( library, &open_args, index, &face );        */\n  /*     ...                                                               */\n  /*   }                                                                   */\n  /*                                                                       */\n/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType    */\n  /* bytecode interpreter with a huge switch statement, rather than a call */\n  /* table.  This results in smaller and faster code for a number of       */\n  /* architectures.                                                        */\n  /*                                                                       */\n  /* Note however that on some compiler/processor combinations, undefining */\n  /* this macro will generate faster, though larger, code.                 */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_INTERPRETER_SWITCH\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the        */\n  /* TrueType glyph loader to use Apple's definition of how to handle      */\n  /* component offsets in composite glyphs.                                */\n  /*                                                                       */\n  /* Apple and MS disagree on the default behavior of component offsets    */\n  /* in composites.  Apple says that they should be scaled by the scaling  */\n  /* factors in the transformation matrix (roughly, it's more complex)     */\n  /* while MS says they should not.  OpenType defines two bits in the      */\n  /* composite flags array which can be used to disambiguate, but old      */\n  /* fonts will not have them.                                             */\n  /*                                                                       */\n  /*   http://www.microsoft.com/typography/otspec/glyf.htm                 */\n  /*   http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html                 */\n  /*                                                                       */\n#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include         */\n  /* support for Apple's distortable font technology (fvar, gvar, cvar,    */\n  /* and avar tables).  This has many similarities to Type 1 Multiple      */\n  /* Masters support.                                                      */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_GX_VAR_SUPPORT\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_BDF if you want to include support for        */\n  /* an embedded `BDF ' table within SFNT-based bitmap formats.            */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_BDF\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****      T Y P E 1   D R I V E R    C O N F I G U R A T I O N       ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_DICT_DEPTH is the maximum depth of nest dictionaries and       */\n  /* arrays in the Type 1 stream (see t1load.c).  A minimum of 4 is        */\n  /* required.                                                             */\n  /*                                                                       */\n#define T1_MAX_DICT_DEPTH  5\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine   */\n  /* calls during glyph loading.                                           */\n  /*                                                                       */\n#define T1_MAX_SUBRS_CALLS  16\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity.  A     */\n  /* minimum of 16 is required.                                            */\n  /*                                                                       */\n  /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */\n  /*                                                                       */\n#define T1_MAX_CHARSTRINGS_OPERANDS  256\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define this configuration macro if you want to prevent the            */\n  /* compilation of `t1afm', which is in charge of reading Type 1 AFM      */\n  /* files into an existing face.  Note that if set, the T1 driver will be */\n  /* unable to produce kerning distances.                                  */\n  /*                                                                       */\n#undef T1_CONFIG_OPTION_NO_AFM\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define this configuration macro if you want to prevent the            */\n  /* compilation of the Multiple Masters font support in the Type 1        */\n  /* driver.                                                               */\n  /*                                                                       */\n#undef T1_CONFIG_OPTION_NO_MM_SUPPORT\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****         C F F   D R I V E R    C O N F I G U R A T I O N        ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Using CFF_CONFIG_OPTION_DARKENING_PARAMETER_{X,Y}{1,2,3,4} it is      */\n  /* possible to set up the default values of the four control points that */\n  /* define the stem darkening behaviour of the (new) CFF engine.  For     */\n  /* more details please read the documentation of the                     */\n  /* `darkening-parameters' property of the cff driver module (file        */\n  /* `ftcffdrv.h'), which allows the control at run-time.                  */\n  /*                                                                       */\n  /* Do *not* undefine these macros!                                       */\n  /*                                                                       */\n#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1   500\n#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1   400\n\n#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2  1000\n#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2   275\n\n#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3  1667\n#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3   275\n\n#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4  2333\n#define CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4     0\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* CFF_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe CFF       */\n  /* engine gets compiled into FreeType.  If defined, it is possible to    */\n  /* switch between the two engines using the `hinting-engine' property of */\n  /* the cff driver module.                                                */\n  /*                                                                       */\n/* #define CFF_CONFIG_OPTION_OLD_ENGINE */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****    A U T O F I T   M O D U L E    C O N F I G U R A T I O N     ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Compile autofit module with CJK (Chinese, Japanese, Korean) script    */\n  /* support.                                                              */\n  /*                                                                       */\n#define AF_CONFIG_OPTION_CJK\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Compile autofit module with Indic script support.                     */\n  /*                                                                       */\n#define AF_CONFIG_OPTION_INDIC\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Compile autofit module with warp hinting.  The idea of the warping    */\n  /* code is to slightly scale and shift a glyph within a single dimension */\n  /* so that as much of its segments are aligned (more or less) on the     */\n  /* grid.  To find out the optimal scaling and shifting value, various    */\n  /* parameter combinations are tried and scored.                          */\n  /*                                                                       */\n  /* This experimental option is only active if the render mode is         */\n  /* FT_RENDER_MODE_LIGHT.                                                 */\n  /*                                                                       */\n/* #define AF_CONFIG_OPTION_USE_WARPER */\n\n  /* */\n\n\n  /*\n   * This macro is obsolete.  Support has been removed in FreeType\n   * version 2.5.\n   */\n/* #define FT_CONFIG_OPTION_OLD_INTERNALS */\n\n\n  /*\n   * This macro is defined if either unpatented or native TrueType\n   * hinting is requested by the definitions above.\n   */\n#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER\n#define  TT_USE_BYTECODE_INTERPRETER\n#undef   TT_CONFIG_OPTION_UNPATENTED_HINTING\n#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING\n#define  TT_USE_BYTECODE_INTERPRETER\n#endif\n\n\n  /*\n   * Check CFF darkening parameters.  The checks are the same as in function\n   * `cff_property_set' in file `cffdrivr.c'.\n   */\n#if CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 < 0   || \\\n    CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 < 0   || \\\n    CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 < 0   || \\\n    CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4 < 0   || \\\n                                                      \\\n    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 < 0   || \\\n    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 < 0   || \\\n    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 < 0   || \\\n    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 < 0   || \\\n                                                      \\\n    CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1 >        \\\n      CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2     || \\\n    CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2 >        \\\n      CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3     || \\\n    CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3 >        \\\n      CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4     || \\\n                                                      \\\n    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1 > 500 || \\\n    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2 > 500 || \\\n    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3 > 500 || \\\n    CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4 > 500\n#error \"Invalid CFF darkening parameters!\"\n#endif\n\nFT_END_HEADER\n\n\n#endif /* __FTOPTION_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/config/ftstdlib.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftstdlib.h                                                             */\n/*                                                                         */\n/*    ANSI-specific library and header configuration file (specification   */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 2002-2007, 2009, 2011-2012 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to group all #includes to the ANSI C library that   */\n  /* FreeType normally requires.  It also defines macros to rename the     */\n  /* standard functions within the FreeType source code.                   */\n  /*                                                                       */\n  /* Load a file which defines __FTSTDLIB_H__ before this one to override  */\n  /* it.                                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTSTDLIB_H__\n#define __FTSTDLIB_H__\n\n\n#include <stddef.h>\n\n#define ft_ptrdiff_t  ptrdiff_t\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                           integer limits                           */\n  /*                                                                    */\n  /* UINT_MAX and ULONG_MAX are used to automatically compute the size  */\n  /* of `int' and `long' in bytes at compile-time.  So far, this works  */\n  /* for all platforms the library has been tested on.                  */\n  /*                                                                    */\n  /* Note that on the extremely rare platforms that do not provide      */\n  /* integer types that are _exactly_ 16 and 32 bits wide (e.g. some    */\n  /* old Crays where `int' is 36 bits), we do not make any guarantee    */\n  /* about the correct behaviour of FT2 with all fonts.                 */\n  /*                                                                    */\n  /* In these case, `ftconfig.h' will refuse to compile anyway with a   */\n  /* message like `couldn't find 32-bit type' or something similar.     */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <limits.h>\n\n#define FT_CHAR_BIT    CHAR_BIT\n#define FT_USHORT_MAX  USHRT_MAX\n#define FT_INT_MAX     INT_MAX\n#define FT_INT_MIN     INT_MIN\n#define FT_UINT_MAX    UINT_MAX\n#define FT_ULONG_MAX   ULONG_MAX\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                 character and string processing                    */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <string.h>\n\n#define ft_memchr   memchr\n#define ft_memcmp   memcmp\n#define ft_memcpy   memcpy\n#define ft_memmove  memmove\n#define ft_memset   memset\n#define ft_strcat   strcat\n#define ft_strcmp   strcmp\n#define ft_strcpy   strcpy\n#define ft_strlen   strlen\n#define ft_strncmp  strncmp\n#define ft_strncpy  strncpy\n#define ft_strrchr  strrchr\n#define ft_strstr   strstr\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                           file handling                            */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <stdio.h>\n\n#define FT_FILE     FILE\n#define ft_fclose   fclose\n#define ft_fopen    fopen\n#define ft_fread    fread\n#define ft_fseek    fseek\n#define ft_ftell    ftell\n#define ft_sprintf  sprintf\n\n/* cf. http://lists.gnu.org/archive/html/freetype/2006-09/msg00036.html */\n#ifdef _WIN32\n#undef ft_fopen\n#define ft_fopen    ft_fopen_win32\n#endif\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                             sorting                                */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <stdlib.h>\n\n#define ft_qsort  qsort\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                        memory allocation                           */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#define ft_scalloc   calloc\n#define ft_sfree     free\n#define ft_smalloc   malloc\n#define ft_srealloc  realloc\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                          miscellaneous                             */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#define ft_atol   atol\n#define ft_labs   labs\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                         execution control                          */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <setjmp.h>\n\n#define ft_jmp_buf     jmp_buf  /* note: this cannot be a typedef since */\n                                /*       jmp_buf is defined as a macro  */\n                                /*       on certain platforms           */\n\n#define ft_longjmp     longjmp\n#define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */\n\n\n  /* the following is only used for debugging purposes, i.e., if */\n  /* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined    */\n\n#include <stdarg.h>\n\n\n#endif /* __FTSTDLIB_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/freetype.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  freetype.h                                                             */\n/*                                                                         */\n/*    FreeType high-level API and common types (specification only).       */\n/*                                                                         */\n/*  Copyright 1996-2014 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FREETYPE_H__\n#define __FREETYPE_H__\n\n\n#ifndef FT_FREETYPE_H\n#error \"`ft2build.h' hasn't been included yet!\"\n#error \"Please always use macros to include FreeType header files.\"\n#error \"Example:\"\n#error \"  #include <ft2build.h>\"\n#error \"  #include FT_FREETYPE_H\"\n#endif\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_TYPES_H\n#include FT_ERRORS_H\n\n\nFT_BEGIN_HEADER\n\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    header_inclusion                                                   */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    FreeType's header inclusion scheme                                 */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How client applications should include FreeType header files.      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    To be as flexible as possible (and for historical reasons),        */\n  /*    FreeType uses a very special inclusion scheme to load header       */\n  /*    files, for example                                                 */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      #include <ft2build.h>                                            */\n  /*                                                                       */\n  /*      #include FT_FREETYPE_H                                           */\n  /*      #include FT_OUTLINE_H                                            */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    A compiler and its preprocessor only needs an include path to find */\n  /*    the file `ft2build.h'; the exact locations and names of the other  */\n  /*    FreeType header files are hidden by preprocessor macro names,      */\n  /*    loaded by `ft2build.h'.  The API documentation always gives the    */\n  /*    header macro name needed for a particular function.                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    user_allocation                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    User allocation                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How client applications should allocate FreeType data structures.  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType assumes that structures allocated by the user and passed  */\n  /*    as arguments are zeroed out except for the actual data.  In other  */\n  /*    words, it is recommended to use `calloc' (or variants of it)       */\n  /*    instead of `malloc' for allocation.                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                        B A S I C   T Y P E S                          */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    base_interface                                                     */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Base Interface                                                     */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    The FreeType~2 base font interface.                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section describes the most important public high-level API    */\n  /*    functions of FreeType~2.                                           */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Library                                                         */\n  /*    FT_Face                                                            */\n  /*    FT_Size                                                            */\n  /*    FT_GlyphSlot                                                       */\n  /*    FT_CharMap                                                         */\n  /*    FT_Encoding                                                        */\n  /*    FT_ENC_TAG                                                         */\n  /*                                                                       */\n  /*    FT_FaceRec                                                         */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_SCALABLE                                              */\n  /*    FT_FACE_FLAG_FIXED_SIZES                                           */\n  /*    FT_FACE_FLAG_FIXED_WIDTH                                           */\n  /*    FT_FACE_FLAG_HORIZONTAL                                            */\n  /*    FT_FACE_FLAG_VERTICAL                                              */\n  /*    FT_FACE_FLAG_COLOR                                                 */\n  /*    FT_FACE_FLAG_SFNT                                                  */\n  /*    FT_FACE_FLAG_CID_KEYED                                             */\n  /*    FT_FACE_FLAG_TRICKY                                                */\n  /*    FT_FACE_FLAG_KERNING                                               */\n  /*    FT_FACE_FLAG_MULTIPLE_MASTERS                                      */\n  /*    FT_FACE_FLAG_GLYPH_NAMES                                           */\n  /*    FT_FACE_FLAG_EXTERNAL_STREAM                                       */\n  /*    FT_FACE_FLAG_HINTER                                                */\n  /*    FT_FACE_FLAG_TRICKY                                                */\n  /*                                                                       */\n  /*    FT_HAS_HORIZONTAL                                                  */\n  /*    FT_HAS_VERTICAL                                                    */\n  /*    FT_HAS_KERNING                                                     */\n  /*    FT_HAS_FIXED_SIZES                                                 */\n  /*    FT_HAS_GLYPH_NAMES                                                 */\n  /*    FT_HAS_MULTIPLE_MASTERS                                            */\n  /*    FT_HAS_COLOR                                                       */\n  /*                                                                       */\n  /*    FT_IS_SFNT                                                         */\n  /*    FT_IS_SCALABLE                                                     */\n  /*    FT_IS_FIXED_WIDTH                                                  */\n  /*    FT_IS_CID_KEYED                                                    */\n  /*    FT_IS_TRICKY                                                       */\n  /*                                                                       */\n  /*    FT_STYLE_FLAG_BOLD                                                 */\n  /*    FT_STYLE_FLAG_ITALIC                                               */\n  /*                                                                       */\n  /*    FT_SizeRec                                                         */\n  /*    FT_Size_Metrics                                                    */\n  /*                                                                       */\n  /*    FT_GlyphSlotRec                                                    */\n  /*    FT_Glyph_Metrics                                                   */\n  /*    FT_SubGlyph                                                        */\n  /*                                                                       */\n  /*    FT_Bitmap_Size                                                     */\n  /*                                                                       */\n  /*    FT_Init_FreeType                                                   */\n  /*    FT_Done_FreeType                                                   */\n  /*                                                                       */\n  /*    FT_New_Face                                                        */\n  /*    FT_Done_Face                                                       */\n  /*    FT_Reference_Face                                                  */\n  /*    FT_New_Memory_Face                                                 */\n  /*    FT_Open_Face                                                       */\n  /*    FT_Open_Args                                                       */\n  /*    FT_Parameter                                                       */\n  /*    FT_Attach_File                                                     */\n  /*    FT_Attach_Stream                                                   */\n  /*                                                                       */\n  /*    FT_Set_Char_Size                                                   */\n  /*    FT_Set_Pixel_Sizes                                                 */\n  /*    FT_Request_Size                                                    */\n  /*    FT_Select_Size                                                     */\n  /*    FT_Size_Request_Type                                               */\n  /*    FT_Size_RequestRec                                                 */\n  /*    FT_Size_Request                                                    */\n  /*    FT_Set_Transform                                                   */\n  /*    FT_Load_Glyph                                                      */\n  /*    FT_Get_Char_Index                                                  */\n  /*    FT_Get_First_Char                                                  */\n  /*    FT_Get_Next_Char                                                   */\n  /*    FT_Get_Name_Index                                                  */\n  /*    FT_Load_Char                                                       */\n  /*                                                                       */\n  /*    FT_OPEN_MEMORY                                                     */\n  /*    FT_OPEN_STREAM                                                     */\n  /*    FT_OPEN_PATHNAME                                                   */\n  /*    FT_OPEN_DRIVER                                                     */\n  /*    FT_OPEN_PARAMS                                                     */\n  /*                                                                       */\n  /*    FT_LOAD_DEFAULT                                                    */\n  /*    FT_LOAD_RENDER                                                     */\n  /*    FT_LOAD_MONOCHROME                                                 */\n  /*    FT_LOAD_LINEAR_DESIGN                                              */\n  /*    FT_LOAD_NO_SCALE                                                   */\n  /*    FT_LOAD_NO_HINTING                                                 */\n  /*    FT_LOAD_NO_BITMAP                                                  */\n  /*    FT_LOAD_NO_AUTOHINT                                                */\n  /*    FT_LOAD_COLOR                                                      */\n  /*                                                                       */\n  /*    FT_LOAD_VERTICAL_LAYOUT                                            */\n  /*    FT_LOAD_IGNORE_TRANSFORM                                           */\n  /*    FT_LOAD_FORCE_AUTOHINT                                             */\n  /*    FT_LOAD_NO_RECURSE                                                 */\n  /*    FT_LOAD_PEDANTIC                                                   */\n  /*                                                                       */\n  /*    FT_LOAD_TARGET_NORMAL                                              */\n  /*    FT_LOAD_TARGET_LIGHT                                               */\n  /*    FT_LOAD_TARGET_MONO                                                */\n  /*    FT_LOAD_TARGET_LCD                                                 */\n  /*    FT_LOAD_TARGET_LCD_V                                               */\n  /*                                                                       */\n  /*    FT_LOAD_TARGET_MODE                                                */\n  /*                                                                       */\n  /*    FT_Render_Glyph                                                    */\n  /*    FT_Render_Mode                                                     */\n  /*    FT_Get_Kerning                                                     */\n  /*    FT_Kerning_Mode                                                    */\n  /*    FT_Get_Track_Kerning                                               */\n  /*    FT_Get_Glyph_Name                                                  */\n  /*    FT_Get_Postscript_Name                                             */\n  /*                                                                       */\n  /*    FT_CharMapRec                                                      */\n  /*    FT_Select_Charmap                                                  */\n  /*    FT_Set_Charmap                                                     */\n  /*    FT_Get_Charmap_Index                                               */\n  /*                                                                       */\n  /*    FT_Get_FSType_Flags                                                */\n  /*    FT_Get_SubGlyph_Info                                               */\n  /*                                                                       */\n  /*    FT_Face_Internal                                                   */\n  /*    FT_Size_Internal                                                   */\n  /*    FT_Slot_Internal                                                   */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_XXX                                                   */\n  /*    FT_STYLE_FLAG_XXX                                                  */\n  /*    FT_OPEN_XXX                                                        */\n  /*    FT_LOAD_XXX                                                        */\n  /*    FT_LOAD_TARGET_XXX                                                 */\n  /*    FT_SUBGLYPH_FLAG_XXX                                               */\n  /*    FT_FSTYPE_XXX                                                      */\n  /*                                                                       */\n  /*    FT_HAS_FAST_GLYPHS                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Glyph_Metrics                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model the metrics of a single glyph.  The      */\n  /*    values are expressed in 26.6 fractional pixel format; if the flag  */\n  /*    @FT_LOAD_NO_SCALE has been used while loading the glyph, values    */\n  /*    are expressed in font units instead.                               */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    width ::                                                           */\n  /*      The glyph's width.                                               */\n  /*                                                                       */\n  /*    height ::                                                          */\n  /*      The glyph's height.                                              */\n  /*                                                                       */\n  /*    horiBearingX ::                                                    */\n  /*      Left side bearing for horizontal layout.                         */\n  /*                                                                       */\n  /*    horiBearingY ::                                                    */\n  /*      Top side bearing for horizontal layout.                          */\n  /*                                                                       */\n  /*    horiAdvance ::                                                     */\n  /*      Advance width for horizontal layout.                             */\n  /*                                                                       */\n  /*    vertBearingX ::                                                    */\n  /*      Left side bearing for vertical layout.                           */\n  /*                                                                       */\n  /*    vertBearingY ::                                                    */\n  /*      Top side bearing for vertical layout.  Larger positive values    */\n  /*      mean further below the vertical glyph origin.                    */\n  /*                                                                       */\n  /*    vertAdvance ::                                                     */\n  /*      Advance height for vertical layout.  Positive values mean the    */\n  /*      glyph has a positive advance downward.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If not disabled with @FT_LOAD_NO_HINTING, the values represent     */\n  /*    dimensions of the hinted glyph (in case hinting is applicable).    */\n  /*                                                                       */\n  /*    Stroking a glyph with an outside border does not increase          */\n  /*    `horiAdvance' or `vertAdvance'; you have to manually adjust these  */\n  /*    values to account for the added width and height.                  */\n  /*                                                                       */\n  typedef struct  FT_Glyph_Metrics_\n  {\n    FT_Pos  width;\n    FT_Pos  height;\n\n    FT_Pos  horiBearingX;\n    FT_Pos  horiBearingY;\n    FT_Pos  horiAdvance;\n\n    FT_Pos  vertBearingX;\n    FT_Pos  vertBearingY;\n    FT_Pos  vertAdvance;\n\n  } FT_Glyph_Metrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Bitmap_Size                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure models the metrics of a bitmap strike (i.e., a set  */\n  /*    of glyphs for a given point size and resolution) in a bitmap font. */\n  /*    It is used for the `available_sizes' field of @FT_Face.            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    height :: The vertical distance, in pixels, between two            */\n  /*              consecutive baselines.  It is always positive.           */\n  /*                                                                       */\n  /*    width  :: The average width, in pixels, of all glyphs in the       */\n  /*              strike.                                                  */\n  /*                                                                       */\n  /*    size   :: The nominal size of the strike in 26.6 fractional        */\n  /*              points.  This field is not very useful.                  */\n  /*                                                                       */\n  /*    x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional   */\n  /*              pixels.                                                  */\n  /*                                                                       */\n  /*    y_ppem :: The vertical ppem (nominal height) in 26.6 fractional    */\n  /*              pixels.                                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Windows FNT:                                                       */\n  /*      The nominal size given in a FNT font is not reliable.  Thus when */\n  /*      the driver finds it incorrect, it sets `size' to some calculated */\n  /*      values and sets `x_ppem' and `y_ppem' to the pixel width and     */\n  /*      height given in the font, respectively.                          */\n  /*                                                                       */\n  /*    TrueType embedded bitmaps:                                         */\n  /*      `size', `width', and `height' values are not contained in the    */\n  /*      bitmap strike itself.  They are computed from the global font    */\n  /*      parameters.                                                      */\n  /*                                                                       */\n  typedef struct  FT_Bitmap_Size_\n  {\n    FT_Short  height;\n    FT_Short  width;\n\n    FT_Pos    size;\n\n    FT_Pos    x_ppem;\n    FT_Pos    y_ppem;\n\n  } FT_Bitmap_Size;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                     O B J E C T   C L A S S E S                       */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Library                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a FreeType library instance.  Each `library' is        */\n  /*    completely independent from the others; it is the `root' of a set  */\n  /*    of objects like fonts, faces, sizes, etc.                          */\n  /*                                                                       */\n  /*    It also embeds a memory manager (see @FT_Memory), as well as a     */\n  /*    scan-line converter object (see @FT_Raster).                       */\n  /*                                                                       */\n  /*    In multi-threaded applications, make sure that the same FT_Library */\n  /*    object or any of its children doesn't get accessed in parallel.    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Library objects are normally created by @FT_Init_FreeType, and     */\n  /*    destroyed with @FT_Done_FreeType.  If you need reference-counting  */\n  /*    (cf. @FT_Reference_Library), use @FT_New_Library and               */\n  /*    @FT_Done_Library.                                                  */\n  /*                                                                       */\n  typedef struct FT_LibraryRec_  *FT_Library;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    module_management                                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Module                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given FreeType module object.  Each module can be a  */\n  /*    font driver, a renderer, or anything else that provides services   */\n  /*    to the formers.                                                    */\n  /*                                                                       */\n  typedef struct FT_ModuleRec_*  FT_Module;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Driver                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given FreeType font driver object.  Each font driver */\n  /*    is a special module capable of creating faces from font files.     */\n  /*                                                                       */\n  typedef struct FT_DriverRec_*  FT_Driver;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Renderer                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given FreeType renderer.  A renderer is a special    */\n  /*    module in charge of converting a glyph image to a bitmap, when     */\n  /*    necessary.  Each renderer supports a given glyph image format, and */\n  /*    one or more target surface depths.                                 */\n  /*                                                                       */\n  typedef struct FT_RendererRec_*  FT_Renderer;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    base_interface                                                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Face                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given typographic face object.  A face object models */\n  /*    a given typeface, in a given style.                                */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Each face object also owns a single @FT_GlyphSlot object, as well  */\n  /*    as one or more @FT_Size objects.                                   */\n  /*                                                                       */\n  /*    Use @FT_New_Face or @FT_Open_Face to create a new face object from */\n  /*    a given filepathname or a custom input stream.                     */\n  /*                                                                       */\n  /*    Use @FT_Done_Face to destroy it (along with its slot and sizes).   */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_FaceRec for the publicly accessible fields of a given face */\n  /*    object.                                                            */\n  /*                                                                       */\n  typedef struct FT_FaceRec_*  FT_Face;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Size                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an object used to model a face scaled to a given       */\n  /*    character size.                                                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Each @FT_Face has an _active_ @FT_Size object that is used by      */\n  /*    functions like @FT_Load_Glyph to determine the scaling             */\n  /*    transformation that in turn is used to load and hint glyphs and    */\n  /*    metrics.                                                           */\n  /*                                                                       */\n  /*    You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes,                */\n  /*    @FT_Request_Size or even @FT_Select_Size to change the content     */\n  /*    (i.e., the scaling values) of the active @FT_Size.                 */\n  /*                                                                       */\n  /*    You can use @FT_New_Size to create additional size objects for a   */\n  /*    given @FT_Face, but they won't be used by other functions until    */\n  /*    you activate it through @FT_Activate_Size.  Only one size can be   */\n  /*    activated at any given time per face.                              */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_SizeRec for the publicly accessible fields of a given size */\n  /*    object.                                                            */\n  /*                                                                       */\n  typedef struct FT_SizeRec_*  FT_Size;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_GlyphSlot                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given `glyph slot'.  A slot is a container where it  */\n  /*    is possible to load any of the glyphs contained in its parent      */\n  /*    face.                                                              */\n  /*                                                                       */\n  /*    In other words, each time you call @FT_Load_Glyph or               */\n  /*    @FT_Load_Char, the slot's content is erased by the new glyph data, */\n  /*    i.e., the glyph's metrics, its image (bitmap or outline), and      */\n  /*    other control information.                                         */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_GlyphSlotRec for the publicly accessible glyph fields.     */\n  /*                                                                       */\n  typedef struct FT_GlyphSlotRec_*  FT_GlyphSlot;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_CharMap                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given character map.  A charmap is used to translate */\n  /*    character codes in a given encoding into glyph indexes for its     */\n  /*    parent's face.  Some font formats may provide several charmaps per */\n  /*    font.                                                              */\n  /*                                                                       */\n  /*    Each face object owns zero or more charmaps, but only one of them  */\n  /*    can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char.   */\n  /*                                                                       */\n  /*    The list of available charmaps in a face is available through the  */\n  /*    `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec.   */\n  /*                                                                       */\n  /*    The currently active charmap is available as `face->charmap'.      */\n  /*    You should call @FT_Set_Charmap to change it.                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    When a new face is created (either through @FT_New_Face or         */\n  /*    @FT_Open_Face), the library looks for a Unicode charmap within     */\n  /*    the list and automatically activates it.                           */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    See @FT_CharMapRec for the publicly accessible fields of a given   */\n  /*    character map.                                                     */\n  /*                                                                       */\n  typedef struct FT_CharMapRec_*  FT_CharMap;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_ENC_TAG                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro converts four-letter tags into an unsigned long.  It is */\n  /*    used to define `encoding' identifiers (see @FT_Encoding).          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since many 16-bit compilers don't like 32-bit enumerations, you    */\n  /*    should redefine this macro in case of problems to something like   */\n  /*    this:                                                              */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      #define FT_ENC_TAG( value, a, b, c, d )  value                   */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    to get a simple enumeration without assigning special numbers.     */\n  /*                                                                       */\n\n#ifndef FT_ENC_TAG\n#define FT_ENC_TAG( value, a, b, c, d )         \\\n          value = ( ( (FT_UInt32)(a) << 24 ) |  \\\n                    ( (FT_UInt32)(b) << 16 ) |  \\\n                    ( (FT_UInt32)(c) <<  8 ) |  \\\n                      (FT_UInt32)(d)         )\n\n#endif /* FT_ENC_TAG */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Encoding                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used to specify character sets supported by         */\n  /*    charmaps.  Used in the @FT_Select_Charmap API function.            */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Despite the name, this enumeration lists specific character        */\n  /*    repertories (i.e., charsets), and not text encoding methods (e.g., */\n  /*    UTF-8, UTF-16, etc.).                                              */\n  /*                                                                       */\n  /*    Other encodings might be defined in the future.                    */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_ENCODING_NONE ::                                                */\n  /*      The encoding value~0 is reserved.                                */\n  /*                                                                       */\n  /*    FT_ENCODING_UNICODE ::                                             */\n  /*      Corresponds to the Unicode character set.  This value covers     */\n  /*      all versions of the Unicode repertoire, including ASCII and      */\n  /*      Latin-1.  Most fonts include a Unicode charmap, but not all      */\n  /*      of them.                                                         */\n  /*                                                                       */\n  /*      For example, if you want to access Unicode value U+1F028 (and    */\n  /*      the font contains it), use value 0x1F028 as the input value for  */\n  /*      @FT_Get_Char_Index.                                              */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_SYMBOL ::                                           */\n  /*      Corresponds to the Microsoft Symbol encoding, used to encode     */\n  /*      mathematical symbols in the 32..255 character code range.  For   */\n  /*      more information, see                                            */\n  /*      `http://www.kostis.net/charsets/symbol.htm'.                     */\n  /*                                                                       */\n  /*    FT_ENCODING_SJIS ::                                                */\n  /*      Corresponds to Japanese SJIS encoding.  More info at             */\n  /*      at `http://en.wikipedia.org/wiki/Shift_JIS'.                     */\n  /*      See note on multi-byte encodings below.                          */\n  /*                                                                       */\n  /*    FT_ENCODING_GB2312 ::                                              */\n  /*      Corresponds to an encoding system for Simplified Chinese as used */\n  /*      used in mainland China.                                          */\n  /*                                                                       */\n  /*    FT_ENCODING_BIG5 ::                                                */\n  /*      Corresponds to an encoding system for Traditional Chinese as     */\n  /*      used in Taiwan and Hong Kong.                                    */\n  /*                                                                       */\n  /*    FT_ENCODING_WANSUNG ::                                             */\n  /*      Corresponds to the Korean encoding system known as Wansung.      */\n  /*      For more information see                                         */\n  /*      `http://msdn.microsoft.com/en-US/goglobal/cc305154'.             */\n  /*                                                                       */\n  /*    FT_ENCODING_JOHAB ::                                               */\n  /*      The Korean standard character set (KS~C 5601-1992), which        */\n  /*      corresponds to MS Windows code page 1361.  This character set    */\n  /*      includes all possible Hangeul character combinations.            */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_LATIN_1 ::                                       */\n  /*      Corresponds to a Latin-1 encoding as defined in a Type~1         */\n  /*      PostScript font.  It is limited to 256 character codes.          */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_STANDARD ::                                      */\n  /*      Corresponds to the Adobe Standard encoding, as found in Type~1,  */\n  /*      CFF, and OpenType/CFF fonts.  It is limited to 256 character     */\n  /*      codes.                                                           */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_EXPERT ::                                        */\n  /*      Corresponds to the Adobe Expert encoding, as found in Type~1,    */\n  /*      CFF, and OpenType/CFF fonts.  It is limited to 256 character     */\n  /*      codes.                                                           */\n  /*                                                                       */\n  /*    FT_ENCODING_ADOBE_CUSTOM ::                                        */\n  /*      Corresponds to a custom encoding, as found in Type~1, CFF, and   */\n  /*      OpenType/CFF fonts.  It is limited to 256 character codes.       */\n  /*                                                                       */\n  /*    FT_ENCODING_APPLE_ROMAN ::                                         */\n  /*      Corresponds to the 8-bit Apple roman encoding.  Many TrueType    */\n  /*      and OpenType fonts contain a charmap for this encoding, since    */\n  /*      older versions of Mac OS are able to use it.                     */\n  /*                                                                       */\n  /*    FT_ENCODING_OLD_LATIN_2 ::                                         */\n  /*      This value is deprecated and was never used nor reported by      */\n  /*      FreeType.  Don't use or test for it.                             */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_SJIS ::                                             */\n  /*      Same as FT_ENCODING_SJIS.  Deprecated.                           */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_GB2312 ::                                           */\n  /*      Same as FT_ENCODING_GB2312.  Deprecated.                         */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_BIG5 ::                                             */\n  /*      Same as FT_ENCODING_BIG5.  Deprecated.                           */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_WANSUNG ::                                          */\n  /*      Same as FT_ENCODING_WANSUNG.  Deprecated.                        */\n  /*                                                                       */\n  /*    FT_ENCODING_MS_JOHAB ::                                            */\n  /*      Same as FT_ENCODING_JOHAB.  Deprecated.                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    By default, FreeType automatically synthesizes a Unicode charmap   */\n  /*    for PostScript fonts, using their glyph names dictionaries.        */\n  /*    However, it also reports the encodings defined explicitly in the   */\n  /*    font file, for the cases when they are needed, with the Adobe      */\n  /*    values as well.                                                    */\n  /*                                                                       */\n  /*    FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap  */\n  /*    is neither Unicode nor ISO-8859-1 (otherwise it is set to          */\n  /*    FT_ENCODING_UNICODE).  Use @FT_Get_BDF_Charset_ID to find out      */\n  /*    which encoding is really present.  If, for example, the            */\n  /*    `cs_registry' field is `KOI8' and the `cs_encoding' field is `R',  */\n  /*    the font is encoded in KOI8-R.                                     */\n  /*                                                                       */\n  /*    FT_ENCODING_NONE is always set (with a single exception) by the    */\n  /*    winfonts driver.  Use @FT_Get_WinFNT_Header and examine the        */\n  /*    `charset' field of the @FT_WinFNT_HeaderRec structure to find out  */\n  /*    which encoding is really present.  For example,                    */\n  /*    @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for       */\n  /*    Russian).                                                          */\n  /*                                                                       */\n  /*    FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH */\n  /*    and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to  */\n  /*    FT_ENCODING_APPLE_ROMAN).                                          */\n  /*                                                                       */\n  /*    If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function       */\n  /*    @FT_Get_CMap_Language_ID to query the Mac language ID that may     */\n  /*    be needed to be able to distinguish Apple encoding variants.  See  */\n  /*                                                                       */\n  /*      http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt  */\n  /*                                                                       */\n  /*    to get an idea how to do that.  Basically, if the language ID      */\n  /*    is~0, don't use it, otherwise subtract 1 from the language ID.     */\n  /*    Then examine `encoding_id'.  If, for example, `encoding_id' is     */\n  /*    @TT_MAC_ID_ROMAN and the language ID (minus~1) is                  */\n  /*    `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman.        */\n  /*    @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi       */\n  /*    variant the Arabic encoding.                                       */\n  /*                                                                       */\n  typedef enum  FT_Encoding_\n  {\n    FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),\n\n    FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),\n    FT_ENC_TAG( FT_ENCODING_UNICODE,   'u', 'n', 'i', 'c' ),\n\n    FT_ENC_TAG( FT_ENCODING_SJIS,    's', 'j', 'i', 's' ),\n    FT_ENC_TAG( FT_ENCODING_GB2312,  'g', 'b', ' ', ' ' ),\n    FT_ENC_TAG( FT_ENCODING_BIG5,    'b', 'i', 'g', '5' ),\n    FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),\n    FT_ENC_TAG( FT_ENCODING_JOHAB,   'j', 'o', 'h', 'a' ),\n\n    /* for backwards compatibility */\n    FT_ENCODING_MS_SJIS    = FT_ENCODING_SJIS,\n    FT_ENCODING_MS_GB2312  = FT_ENCODING_GB2312,\n    FT_ENCODING_MS_BIG5    = FT_ENCODING_BIG5,\n    FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,\n    FT_ENCODING_MS_JOHAB   = FT_ENCODING_JOHAB,\n\n    FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),\n    FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT,   'A', 'D', 'B', 'E' ),\n    FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM,   'A', 'D', 'B', 'C' ),\n    FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1,  'l', 'a', 't', '1' ),\n\n    FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ),\n\n    FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )\n\n  } FT_Encoding;\n\n\n  /* these constants are deprecated; use the corresponding `FT_Encoding' */\n  /* values instead                                                      */\n#define ft_encoding_none            FT_ENCODING_NONE\n#define ft_encoding_unicode         FT_ENCODING_UNICODE\n#define ft_encoding_symbol          FT_ENCODING_MS_SYMBOL\n#define ft_encoding_latin_1         FT_ENCODING_ADOBE_LATIN_1\n#define ft_encoding_latin_2         FT_ENCODING_OLD_LATIN_2\n#define ft_encoding_sjis            FT_ENCODING_SJIS\n#define ft_encoding_gb2312          FT_ENCODING_GB2312\n#define ft_encoding_big5            FT_ENCODING_BIG5\n#define ft_encoding_wansung         FT_ENCODING_WANSUNG\n#define ft_encoding_johab           FT_ENCODING_JOHAB\n\n#define ft_encoding_adobe_standard  FT_ENCODING_ADOBE_STANDARD\n#define ft_encoding_adobe_expert    FT_ENCODING_ADOBE_EXPERT\n#define ft_encoding_adobe_custom    FT_ENCODING_ADOBE_CUSTOM\n#define ft_encoding_apple_roman     FT_ENCODING_APPLE_ROMAN\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_CharMapRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The base charmap structure.                                        */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face        :: A handle to the parent face object.                 */\n  /*                                                                       */\n  /*    encoding    :: An @FT_Encoding tag identifying the charmap.  Use   */\n  /*                   this with @FT_Select_Charmap.                       */\n  /*                                                                       */\n  /*    platform_id :: An ID number describing the platform for the        */\n  /*                   following encoding ID.  This comes directly from    */\n  /*                   the TrueType specification and should be emulated   */\n  /*                   for other formats.                                  */\n  /*                                                                       */\n  /*    encoding_id :: A platform specific encoding number.  This also     */\n  /*                   comes from the TrueType specification and should be */\n  /*                   emulated similarly.                                 */\n  /*                                                                       */\n  typedef struct  FT_CharMapRec_\n  {\n    FT_Face      face;\n    FT_Encoding  encoding;\n    FT_UShort    platform_id;\n    FT_UShort    encoding_id;\n\n  } FT_CharMapRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                 B A S E   O B J E C T   C L A S S E S                 */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Face_Internal                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to an `FT_Face_InternalRec' structure, used to    */\n  /*    model private data of a given @FT_Face object.                     */\n  /*                                                                       */\n  /*    This structure might change between releases of FreeType~2 and is  */\n  /*    not generally available to client applications.                    */\n  /*                                                                       */\n  typedef struct FT_Face_InternalRec_*  FT_Face_Internal;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_FaceRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType root face class structure.  A face object models a        */\n  /*    typeface in a font file.                                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_faces           :: The number of faces in the font file.  Some */\n  /*                           font formats can have multiple faces in     */\n  /*                           a font file.                                */\n  /*                                                                       */\n  /*    face_index          :: The index of the face in the font file.  It */\n  /*                           is set to~0 if there is only one face in    */\n  /*                           the font file.                              */\n  /*                                                                       */\n  /*    face_flags          :: A set of bit flags that give important      */\n  /*                           information about the face; see             */\n  /*                           @FT_FACE_FLAG_XXX for the details.          */\n  /*                                                                       */\n  /*    style_flags         :: A set of bit flags indicating the style of  */\n  /*                           the face; see @FT_STYLE_FLAG_XXX for the    */\n  /*                           details.                                    */\n  /*                                                                       */\n  /*    num_glyphs          :: The number of glyphs in the face.  If the   */\n  /*                           face is scalable and has sbits (see         */\n  /*                           `num_fixed_sizes'), it is set to the number */\n  /*                           of outline glyphs.                          */\n  /*                                                                       */\n  /*                           For CID-keyed fonts, this value gives the   */\n  /*                           highest CID used in the font.               */\n  /*                                                                       */\n  /*    family_name         :: The face's family name.  This is an ASCII   */\n  /*                           string, usually in English, that describes  */\n  /*                           the typeface's family (like `Times New      */\n  /*                           Roman', `Bodoni', `Garamond', etc).  This   */\n  /*                           is a least common denominator used to list  */\n  /*                           fonts.  Some formats (TrueType & OpenType)  */\n  /*                           provide localized and Unicode versions of   */\n  /*                           this string.  Applications should use the   */\n  /*                           format specific interface to access them.   */\n  /*                           Can be NULL (e.g., in fonts embedded in a   */\n  /*                           PDF file).                                  */\n  /*                                                                       */\n  /*    style_name          :: The face's style name.  This is an ASCII    */\n  /*                           string, usually in English, that describes  */\n  /*                           the typeface's style (like `Italic',        */\n  /*                           `Bold', `Condensed', etc).  Not all font    */\n  /*                           formats provide a style name, so this field */\n  /*                           is optional, and can be set to NULL.  As    */\n  /*                           for `family_name', some formats provide     */\n  /*                           localized and Unicode versions of this      */\n  /*                           string.  Applications should use the format */\n  /*                           specific interface to access them.          */\n  /*                                                                       */\n  /*    num_fixed_sizes     :: The number of bitmap strikes in the face.   */\n  /*                           Even if the face is scalable, there might   */\n  /*                           still be bitmap strikes, which are called   */\n  /*                           `sbits' in that case.                       */\n  /*                                                                       */\n  /*    available_sizes     :: An array of @FT_Bitmap_Size for all bitmap  */\n  /*                           strikes in the face.  It is set to NULL if  */\n  /*                           there is no bitmap strike.                  */\n  /*                                                                       */\n  /*    num_charmaps        :: The number of charmaps in the face.         */\n  /*                                                                       */\n  /*    charmaps            :: An array of the charmaps of the face.       */\n  /*                                                                       */\n  /*    generic             :: A field reserved for client uses.  See the  */\n  /*                           @FT_Generic type description.               */\n  /*                                                                       */\n  /*    bbox                :: The font bounding box.  Coordinates are     */\n  /*                           expressed in font units (see                */\n  /*                           `units_per_EM').  The box is large enough   */\n  /*                           to contain any glyph from the font.  Thus,  */\n  /*                           `bbox.yMax' can be seen as the `maximum     */\n  /*                           ascender', and `bbox.yMin' as the `minimum  */\n  /*                           descender'.  Only relevant for scalable     */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*                           Note that the bounding box might be off by  */\n  /*                           (at least) one pixel for hinted fonts.  See */\n  /*                           @FT_Size_Metrics for further discussion.    */\n  /*                                                                       */\n  /*    units_per_EM        :: The number of font units per EM square for  */\n  /*                           this face.  This is typically 2048 for      */\n  /*                           TrueType fonts, and 1000 for Type~1 fonts.  */\n  /*                           Only relevant for scalable formats.         */\n  /*                                                                       */\n  /*    ascender            :: The typographic ascender of the face,       */\n  /*                           expressed in font units.  For font formats  */\n  /*                           not having this information, it is set to   */\n  /*                           `bbox.yMax'.  Only relevant for scalable    */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*    descender           :: The typographic descender of the face,      */\n  /*                           expressed in font units.  For font formats  */\n  /*                           not having this information, it is set to   */\n  /*                           `bbox.yMin'.  Note that this field is       */\n  /*                           usually negative.  Only relevant for        */\n  /*                           scalable formats.                           */\n  /*                                                                       */\n  /*    height              :: This value is the vertical distance         */\n  /*                           between two consecutive baselines,          */\n  /*                           expressed in font units.  It is always      */\n  /*                           positive.  Only relevant for scalable       */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*                           If you want the global glyph height, use    */\n  /*                           `ascender - descender'.                     */\n  /*                                                                       */\n  /*    max_advance_width   :: The maximum advance width, in font units,   */\n  /*                           for all glyphs in this face.  This can be   */\n  /*                           used to make word wrapping computations     */\n  /*                           faster.  Only relevant for scalable         */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*    max_advance_height  :: The maximum advance height, in font units,  */\n  /*                           for all glyphs in this face.  This is only  */\n  /*                           relevant for vertical layouts, and is set   */\n  /*                           to `height' for fonts that do not provide   */\n  /*                           vertical metrics.  Only relevant for        */\n  /*                           scalable formats.                           */\n  /*                                                                       */\n  /*    underline_position  :: The position, in font units, of the         */\n  /*                           underline line for this face.  It is the    */\n  /*                           center of the underlining stem.  Only       */\n  /*                           relevant for scalable formats.              */\n  /*                                                                       */\n  /*    underline_thickness :: The thickness, in font units, of the        */\n  /*                           underline for this face.  Only relevant for */\n  /*                           scalable formats.                           */\n  /*                                                                       */\n  /*    glyph               :: The face's associated glyph slot(s).        */\n  /*                                                                       */\n  /*    size                :: The current active size for this face.      */\n  /*                                                                       */\n  /*    charmap             :: The current active charmap for this face.   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Fields may be changed after a call to @FT_Attach_File or           */\n  /*    @FT_Attach_Stream.                                                 */\n  /*                                                                       */\n  typedef struct  FT_FaceRec_\n  {\n    FT_Long           num_faces;\n    FT_Long           face_index;\n\n    FT_Long           face_flags;\n    FT_Long           style_flags;\n\n    FT_Long           num_glyphs;\n\n    FT_String*        family_name;\n    FT_String*        style_name;\n\n    FT_Int            num_fixed_sizes;\n    FT_Bitmap_Size*   available_sizes;\n\n    FT_Int            num_charmaps;\n    FT_CharMap*       charmaps;\n\n    FT_Generic        generic;\n\n    /*# The following member variables (down to `underline_thickness') */\n    /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size    */\n    /*# for bitmap fonts.                                              */\n    FT_BBox           bbox;\n\n    FT_UShort         units_per_EM;\n    FT_Short          ascender;\n    FT_Short          descender;\n    FT_Short          height;\n\n    FT_Short          max_advance_width;\n    FT_Short          max_advance_height;\n\n    FT_Short          underline_position;\n    FT_Short          underline_thickness;\n\n    FT_GlyphSlot      glyph;\n    FT_Size           size;\n    FT_CharMap        charmap;\n\n    /*@private begin */\n\n    FT_Driver         driver;\n    FT_Memory         memory;\n    FT_Stream         stream;\n\n    FT_ListRec        sizes_list;\n\n    FT_Generic        autohint;   /* face-specific auto-hinter data */\n    void*             extensions; /* unused                         */\n\n    FT_Face_Internal  internal;\n\n    /*@private end */\n\n  } FT_FaceRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_FACE_FLAG_XXX                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit flags used in the `face_flags' field of the          */\n  /*    @FT_FaceRec structure.  They inform client applications of         */\n  /*    properties of the corresponding face.                              */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_FACE_FLAG_SCALABLE ::                                           */\n  /*      Indicates that the face contains outline glyphs.  This doesn't   */\n  /*      prevent bitmap strikes, i.e., a face can have both this and      */\n  /*      and @FT_FACE_FLAG_FIXED_SIZES set.                               */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_FIXED_SIZES ::                                        */\n  /*      Indicates that the face contains bitmap strikes.  See also the   */\n  /*      `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec.   */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_FIXED_WIDTH ::                                        */\n  /*      Indicates that the face contains fixed-width characters (like    */\n  /*      Courier, Lucido, MonoType, etc.).                                */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_SFNT ::                                               */\n  /*      Indicates that the face uses the `sfnt' storage scheme.  For     */\n  /*      now, this means TrueType and OpenType.                           */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_HORIZONTAL ::                                         */\n  /*      Indicates that the face contains horizontal glyph metrics.  This */\n  /*      should be set for all common formats.                            */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_VERTICAL ::                                           */\n  /*      Indicates that the face contains vertical glyph metrics.  This   */\n  /*      is only available in some formats, not all of them.              */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_KERNING ::                                            */\n  /*      Indicates that the face contains kerning information.  If set,   */\n  /*      the kerning distance can be retrieved through the function       */\n  /*      @FT_Get_Kerning.  Otherwise the function always return the       */\n  /*      vector (0,0).  Note that FreeType doesn't handle kerning data    */\n  /*      from the `GPOS' table (as present in some OpenType fonts).       */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_FAST_GLYPHS ::                                        */\n  /*      THIS FLAG IS DEPRECATED.  DO NOT USE OR TEST IT.                 */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_MULTIPLE_MASTERS ::                                   */\n  /*      Indicates that the font contains multiple masters and is capable */\n  /*      of interpolating between them.  See the multiple-masters         */\n  /*      specific API for details.                                        */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_GLYPH_NAMES ::                                        */\n  /*      Indicates that the font contains glyph names that can be         */\n  /*      retrieved through @FT_Get_Glyph_Name.  Note that some TrueType   */\n  /*      fonts contain broken glyph name tables.  Use the function        */\n  /*      @FT_Has_PS_Glyph_Names when needed.                              */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_EXTERNAL_STREAM ::                                    */\n  /*      Used internally by FreeType to indicate that a face's stream was */\n  /*      provided by the client application and should not be destroyed   */\n  /*      when @FT_Done_Face is called.  Don't read or test this flag.     */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_HINTER ::                                             */\n  /*      Set if the font driver has a hinting machine of its own.  For    */\n  /*      example, with TrueType fonts, it makes sense to use data from    */\n  /*      the SFNT `gasp' table only if the native TrueType hinting engine */\n  /*      (with the bytecode interpreter) is available and active.         */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_CID_KEYED ::                                          */\n  /*      Set if the font is CID-keyed.  In that case, the font is not     */\n  /*      accessed by glyph indices but by CID values.  For subsetted      */\n  /*      CID-keyed fonts this has the consequence that not all index      */\n  /*      values are a valid argument to FT_Load_Glyph.  Only the CID      */\n  /*      values for which corresponding glyphs in the subsetted font      */\n  /*      exist make FT_Load_Glyph return successfully; in all other cases */\n  /*      you get an `FT_Err_Invalid_Argument' error.                      */\n  /*                                                                       */\n  /*      Note that CID-keyed fonts that are in an SFNT wrapper don't      */\n  /*      have this flag set since the glyphs are accessed in the normal   */\n  /*      way (using contiguous indices); the `CID-ness' isn't visible to  */\n  /*      the application.                                                 */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_TRICKY ::                                             */\n  /*      Set if the font is `tricky', this is, it always needs the        */\n  /*      font format's native hinting engine to get a reasonable result.  */\n  /*      A typical example is the Chinese font `mingli.ttf' that uses     */\n  /*      TrueType bytecode instructions to move and scale all of its      */\n  /*      subglyphs.                                                       */\n  /*                                                                       */\n  /*      It is not possible to autohint such fonts using                  */\n  /*      @FT_LOAD_FORCE_AUTOHINT; it will also ignore                     */\n  /*      @FT_LOAD_NO_HINTING.  You have to set both @FT_LOAD_NO_HINTING   */\n  /*      and @FT_LOAD_NO_AUTOHINT to really disable hinting; however, you */\n  /*      probably never want this except for demonstration purposes.      */\n  /*                                                                       */\n  /*      Currently, there are about a dozen TrueType fonts in the list of */\n  /*      tricky fonts; they are hard-coded in file `ttobjs.c'.            */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_COLOR ::                                              */\n  /*      Set if the font has color glyph tables.  To access color glyphs  */\n  /*      use @FT_LOAD_COLOR.                                              */\n  /*                                                                       */\n#define FT_FACE_FLAG_SCALABLE          ( 1L <<  0 )\n#define FT_FACE_FLAG_FIXED_SIZES       ( 1L <<  1 )\n#define FT_FACE_FLAG_FIXED_WIDTH       ( 1L <<  2 )\n#define FT_FACE_FLAG_SFNT              ( 1L <<  3 )\n#define FT_FACE_FLAG_HORIZONTAL        ( 1L <<  4 )\n#define FT_FACE_FLAG_VERTICAL          ( 1L <<  5 )\n#define FT_FACE_FLAG_KERNING           ( 1L <<  6 )\n#define FT_FACE_FLAG_FAST_GLYPHS       ( 1L <<  7 )\n#define FT_FACE_FLAG_MULTIPLE_MASTERS  ( 1L <<  8 )\n#define FT_FACE_FLAG_GLYPH_NAMES       ( 1L <<  9 )\n#define FT_FACE_FLAG_EXTERNAL_STREAM   ( 1L << 10 )\n#define FT_FACE_FLAG_HINTER            ( 1L << 11 )\n#define FT_FACE_FLAG_CID_KEYED         ( 1L << 12 )\n#define FT_FACE_FLAG_TRICKY            ( 1L << 13 )\n#define FT_FACE_FLAG_COLOR             ( 1L << 14 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_HORIZONTAL( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains\n   *   horizontal metrics (this is true for all font formats though).\n   *\n   * @also:\n   *   @FT_HAS_VERTICAL can be used to check for vertical metrics.\n   *\n   */\n#define FT_HAS_HORIZONTAL( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_HORIZONTAL )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_VERTICAL( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains real\n   *   vertical metrics (and not only synthesized ones).\n   *\n   */\n#define FT_HAS_VERTICAL( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_VERTICAL )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_KERNING( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains kerning\n   *   data that can be accessed with @FT_Get_Kerning.\n   *\n   */\n#define FT_HAS_KERNING( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_KERNING )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_SCALABLE( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a scalable\n   *   font face (true for TrueType, Type~1, Type~42, CID, OpenType/CFF,\n   *   and PFR font formats.\n   *\n   */\n#define FT_IS_SCALABLE( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_SCALABLE )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_SFNT( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a font\n   *   whose format is based on the SFNT storage scheme.  This usually\n   *   means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded\n   *   bitmap fonts.\n   *\n   *   If this macro is true, all functions defined in @FT_SFNT_NAMES_H and\n   *   @FT_TRUETYPE_TABLES_H are available.\n   *\n   */\n#define FT_IS_SFNT( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_SFNT )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_FIXED_WIDTH( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a font face\n   *   that contains fixed-width (or `monospace', `fixed-pitch', etc.)\n   *   glyphs.\n   *\n   */\n#define FT_IS_FIXED_WIDTH( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_FIXED_SIZES( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains some\n   *   embedded bitmaps.  See the `available_sizes' field of the\n   *   @FT_FaceRec structure.\n   *\n   */\n#define FT_HAS_FIXED_SIZES( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_FAST_GLYPHS( face )\n   *\n   * @description:\n   *   Deprecated.\n   *\n   */\n#define FT_HAS_FAST_GLYPHS( face )  0\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_GLYPH_NAMES( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains some glyph\n   *   names that can be accessed through @FT_Get_Glyph_Name.\n   *\n   */\n#define FT_HAS_GLYPH_NAMES( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_MULTIPLE_MASTERS( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains some\n   *   multiple masters.  The functions provided by @FT_MULTIPLE_MASTERS_H\n   *   are then available to choose the exact design you want.\n   *\n   */\n#define FT_HAS_MULTIPLE_MASTERS( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_CID_KEYED( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a CID-keyed\n   *   font.  See the discussion of @FT_FACE_FLAG_CID_KEYED for more\n   *   details.\n   *\n   *   If this macro is true, all functions defined in @FT_CID_H are\n   *   available.\n   *\n   */\n#define FT_IS_CID_KEYED( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_CID_KEYED )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_TRICKY( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face represents a `tricky' font.\n   *   See the discussion of @FT_FACE_FLAG_TRICKY for more details.\n   *\n   */\n#define FT_IS_TRICKY( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_TRICKY )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_COLOR( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains\n   *   tables for color glyphs.\n   *\n   */\n#define FT_HAS_COLOR( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_COLOR )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    FT_STYLE_FLAG_XXX                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit-flags used to indicate the style of a given face.    */\n  /*    These are used in the `style_flags' field of @FT_FaceRec.          */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_STYLE_FLAG_ITALIC ::                                            */\n  /*      Indicates that a given face style is italic or oblique.          */\n  /*                                                                       */\n  /*    FT_STYLE_FLAG_BOLD ::                                              */\n  /*      Indicates that a given face is bold.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The style information as provided by FreeType is very basic.  More */\n  /*    details are beyond the scope and should be done on a higher level  */\n  /*    (for example, by analyzing various fields of the `OS/2' table in   */\n  /*    SFNT based fonts).                                                 */\n  /*                                                                       */\n#define FT_STYLE_FLAG_ITALIC  ( 1 << 0 )\n#define FT_STYLE_FLAG_BOLD    ( 1 << 1 )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Size_Internal                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to an `FT_Size_InternalRec' structure, used to    */\n  /*    model private data of a given @FT_Size object.                     */\n  /*                                                                       */\n  typedef struct FT_Size_InternalRec_*  FT_Size_Internal;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_Metrics                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The size metrics structure gives the metrics of a size object.     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x_ppem       :: The width of the scaled EM square in pixels, hence */\n  /*                    the term `ppem' (pixels per EM).  It is also       */\n  /*                    referred to as `nominal width'.                    */\n  /*                                                                       */\n  /*    y_ppem       :: The height of the scaled EM square in pixels,      */\n  /*                    hence the term `ppem' (pixels per EM).  It is also */\n  /*                    referred to as `nominal height'.                   */\n  /*                                                                       */\n  /*    x_scale      :: A 16.16 fractional scaling value used to convert   */\n  /*                    horizontal metrics from font units to 26.6         */\n  /*                    fractional pixels.  Only relevant for scalable     */\n  /*                    font formats.                                      */\n  /*                                                                       */\n  /*    y_scale      :: A 16.16 fractional scaling value used to convert   */\n  /*                    vertical metrics from font units to 26.6           */\n  /*                    fractional pixels.  Only relevant for scalable     */\n  /*                    font formats.                                      */\n  /*                                                                       */\n  /*    ascender     :: The ascender in 26.6 fractional pixels.  See       */\n  /*                    @FT_FaceRec for the details.                       */\n  /*                                                                       */\n  /*    descender    :: The descender in 26.6 fractional pixels.  See      */\n  /*                    @FT_FaceRec for the details.                       */\n  /*                                                                       */\n  /*    height       :: The height in 26.6 fractional pixels.  See         */\n  /*                    @FT_FaceRec for the details.                       */\n  /*                                                                       */\n  /*    max_advance  :: The maximum advance width in 26.6 fractional       */\n  /*                    pixels.  See @FT_FaceRec for the details.          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The scaling values, if relevant, are determined first during a     */\n  /*    size changing operation.  The remaining fields are then set by the */\n  /*    driver.  For scalable formats, they are usually set to scaled      */\n  /*    values of the corresponding fields in @FT_FaceRec.                 */\n  /*                                                                       */\n  /*    Note that due to glyph hinting, these values might not be exact    */\n  /*    for certain fonts.  Thus they must be treated as unreliable        */\n  /*    with an error margin of at least one pixel!                        */\n  /*                                                                       */\n  /*    Indeed, the only way to get the exact metrics is to render _all_   */\n  /*    glyphs.  As this would be a definite performance hit, it is up to  */\n  /*    client applications to perform such computations.                  */\n  /*                                                                       */\n  /*    The FT_Size_Metrics structure is valid for bitmap fonts also.      */\n  /*                                                                       */\n  typedef struct  FT_Size_Metrics_\n  {\n    FT_UShort  x_ppem;      /* horizontal pixels per EM               */\n    FT_UShort  y_ppem;      /* vertical pixels per EM                 */\n\n    FT_Fixed   x_scale;     /* scaling values used to convert font    */\n    FT_Fixed   y_scale;     /* units to 26.6 fractional pixels        */\n\n    FT_Pos     ascender;    /* ascender in 26.6 frac. pixels          */\n    FT_Pos     descender;   /* descender in 26.6 frac. pixels         */\n    FT_Pos     height;      /* text height in 26.6 frac. pixels       */\n    FT_Pos     max_advance; /* max horizontal advance, in 26.6 pixels */\n\n  } FT_Size_Metrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_SizeRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType root size class structure.  A size object models a face   */\n  /*    object at a given size.                                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face    :: Handle to the parent face object.                       */\n  /*                                                                       */\n  /*    generic :: A typeless pointer, unused by the FreeType library or   */\n  /*               any of its drivers.  It can be used by client           */\n  /*               applications to link their own data to each size        */\n  /*               object.                                                 */\n  /*                                                                       */\n  /*    metrics :: Metrics for this size object.  This field is read-only. */\n  /*                                                                       */\n  typedef struct  FT_SizeRec_\n  {\n    FT_Face           face;      /* parent face object              */\n    FT_Generic        generic;   /* generic pointer for client uses */\n    FT_Size_Metrics   metrics;   /* size metrics                    */\n    FT_Size_Internal  internal;\n\n  } FT_SizeRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_SubGlyph                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The subglyph structure is an internal object used to describe      */\n  /*    subglyphs (for example, in the case of composites).                */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The subglyph implementation is not part of the high-level API,     */\n  /*    hence the forward structure declaration.                           */\n  /*                                                                       */\n  /*    You can however retrieve subglyph information with                 */\n  /*    @FT_Get_SubGlyph_Info.                                             */\n  /*                                                                       */\n  typedef struct FT_SubGlyphRec_*  FT_SubGlyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Slot_Internal                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to an `FT_Slot_InternalRec' structure, used to    */\n  /*    model private data of a given @FT_GlyphSlot object.                */\n  /*                                                                       */\n  typedef struct FT_Slot_InternalRec_*  FT_Slot_Internal;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_GlyphSlotRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType root glyph slot class structure.  A glyph slot is a       */\n  /*    container where individual glyphs can be loaded, be they in        */\n  /*    outline or bitmap format.                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    library           :: A handle to the FreeType library instance     */\n  /*                         this slot belongs to.                         */\n  /*                                                                       */\n  /*    face              :: A handle to the parent face object.           */\n  /*                                                                       */\n  /*    next              :: In some cases (like some font tools), several */\n  /*                         glyph slots per face object can be a good     */\n  /*                         thing.  As this is rare, the glyph slots are  */\n  /*                         listed through a direct, single-linked list   */\n  /*                         using its `next' field.                       */\n  /*                                                                       */\n  /*    generic           :: A typeless pointer unused by the FreeType     */\n  /*                         library or any of its drivers.  It can be     */\n  /*                         used by client applications to link their own */\n  /*                         data to each glyph slot object.               */\n  /*                                                                       */\n  /*    metrics           :: The metrics of the last loaded glyph in the   */\n  /*                         slot.  The returned values depend on the last */\n  /*                         load flags (see the @FT_Load_Glyph API        */\n  /*                         function) and can be expressed either in 26.6 */\n  /*                         fractional pixels or font units.              */\n  /*                                                                       */\n  /*                         Note that even when the glyph image is        */\n  /*                         transformed, the metrics are not.             */\n  /*                                                                       */\n  /*    linearHoriAdvance :: The advance width of the unhinted glyph.      */\n  /*                         Its value is expressed in 16.16 fractional    */\n  /*                         pixels, unless @FT_LOAD_LINEAR_DESIGN is set  */\n  /*                         when loading the glyph.  This field can be    */\n  /*                         important to perform correct WYSIWYG layout.  */\n  /*                         Only relevant for outline glyphs.             */\n  /*                                                                       */\n  /*    linearVertAdvance :: The advance height of the unhinted glyph.     */\n  /*                         Its value is expressed in 16.16 fractional    */\n  /*                         pixels, unless @FT_LOAD_LINEAR_DESIGN is set  */\n  /*                         when loading the glyph.  This field can be    */\n  /*                         important to perform correct WYSIWYG layout.  */\n  /*                         Only relevant for outline glyphs.             */\n  /*                                                                       */\n  /*    advance           :: This shorthand is, depending on               */\n  /*                         @FT_LOAD_IGNORE_TRANSFORM, the transformed    */\n  /*                         (hinted) advance width for the glyph, in 26.6 */\n  /*                         fractional pixel format.  As specified with   */\n  /*                         @FT_LOAD_VERTICAL_LAYOUT, it uses either the  */\n  /*                         `horiAdvance' or the `vertAdvance' value of   */\n  /*                         `metrics' field.                              */\n  /*                                                                       */\n  /*    format            :: This field indicates the format of the image  */\n  /*                         contained in the glyph slot.  Typically       */\n  /*                         @FT_GLYPH_FORMAT_BITMAP,                      */\n  /*                         @FT_GLYPH_FORMAT_OUTLINE, or                  */\n  /*                         @FT_GLYPH_FORMAT_COMPOSITE, but others are    */\n  /*                         possible.                                     */\n  /*                                                                       */\n  /*    bitmap            :: This field is used as a bitmap descriptor     */\n  /*                         when the slot format is                       */\n  /*                         @FT_GLYPH_FORMAT_BITMAP.  Note that the       */\n  /*                         address and content of the bitmap buffer can  */\n  /*                         change between calls of @FT_Load_Glyph and a  */\n  /*                         few other functions.                          */\n  /*                                                                       */\n  /*    bitmap_left       :: The bitmap's left bearing expressed in        */\n  /*                         integer pixels.  Only valid if the format is  */\n  /*                         @FT_GLYPH_FORMAT_BITMAP, this is, if the      */\n  /*                         glyph slot contains a bitmap.                 */\n  /*                                                                       */\n  /*    bitmap_top        :: The bitmap's top bearing expressed in integer */\n  /*                         pixels.  Remember that this is the distance   */\n  /*                         from the baseline to the top-most glyph       */\n  /*                         scanline, upwards y~coordinates being         */\n  /*                         *positive*.                                   */\n  /*                                                                       */\n  /*    outline           :: The outline descriptor for the current glyph  */\n  /*                         image if its format is                        */\n  /*                         @FT_GLYPH_FORMAT_OUTLINE.  Once a glyph is    */\n  /*                         loaded, `outline' can be transformed,         */\n  /*                         distorted, embolded, etc.  However, it must   */\n  /*                         not be freed.                                 */\n  /*                                                                       */\n  /*    num_subglyphs     :: The number of subglyphs in a composite glyph. */\n  /*                         This field is only valid for the composite    */\n  /*                         glyph format that should normally only be     */\n  /*                         loaded with the @FT_LOAD_NO_RECURSE flag.     */\n  /*                                                                       */\n  /*    subglyphs         :: An array of subglyph descriptors for          */\n  /*                         composite glyphs.  There are `num_subglyphs'  */\n  /*                         elements in there.  Currently internal to     */\n  /*                         FreeType.                                     */\n  /*                                                                       */\n  /*    control_data      :: Certain font drivers can also return the      */\n  /*                         control data for a given glyph image (e.g.    */\n  /*                         TrueType bytecode, Type~1 charstrings, etc.). */\n  /*                         This field is a pointer to such data.         */\n  /*                                                                       */\n  /*    control_len       :: This is the length in bytes of the control    */\n  /*                         data.                                         */\n  /*                                                                       */\n  /*    other             :: Really wicked formats can use this pointer to */\n  /*                         present their own glyph image to client       */\n  /*                         applications.  Note that the application      */\n  /*                         needs to know about the image format.         */\n  /*                                                                       */\n  /*    lsb_delta         :: The difference between hinted and unhinted    */\n  /*                         left side bearing while autohinting is        */\n  /*                         active.  Zero otherwise.                      */\n  /*                                                                       */\n  /*    rsb_delta         :: The difference between hinted and unhinted    */\n  /*                         right side bearing while autohinting is       */\n  /*                         active.  Zero otherwise.                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If @FT_Load_Glyph is called with default flags (see                */\n  /*    @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in   */\n  /*    its native format (e.g., an outline glyph for TrueType and Type~1  */\n  /*    formats).                                                          */\n  /*                                                                       */\n  /*    This image can later be converted into a bitmap by calling         */\n  /*    @FT_Render_Glyph.  This function finds the current renderer for    */\n  /*    the native image's format, then invokes it.                        */\n  /*                                                                       */\n  /*    The renderer is in charge of transforming the native image through */\n  /*    the slot's face transformation fields, then converting it into a   */\n  /*    bitmap that is returned in `slot->bitmap'.                         */\n  /*                                                                       */\n  /*    Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */\n  /*    to specify the position of the bitmap relative to the current pen  */\n  /*    position (e.g., coordinates (0,0) on the baseline).  Of course,    */\n  /*    `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP.         */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Here a small pseudo code fragment that shows how to use            */\n  /*    `lsb_delta' and `rsb_delta':                                       */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      FT_Pos  origin_x       = 0;                                      */\n  /*      FT_Pos  prev_rsb_delta = 0;                                      */\n  /*                                                                       */\n  /*                                                                       */\n  /*      for all glyphs do                                                */\n  /*        <compute kern between current and previous glyph and add it to */\n  /*         `origin_x'>                                                   */\n  /*                                                                       */\n  /*        <load glyph with `FT_Load_Glyph'>                              */\n  /*                                                                       */\n  /*        if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 )           */\n  /*          origin_x -= 64;                                              */\n  /*        else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 )      */\n  /*          origin_x += 64;                                              */\n  /*                                                                       */\n  /*        prev_rsb_delta = face->glyph->rsb_delta;                       */\n  /*                                                                       */\n  /*        <save glyph image, or render glyph, or ...>                    */\n  /*                                                                       */\n  /*        origin_x += face->glyph->advance.x;                            */\n  /*      endfor                                                           */\n  /*    }                                                                  */\n  /*                                                                       */\n  typedef struct  FT_GlyphSlotRec_\n  {\n    FT_Library        library;\n    FT_Face           face;\n    FT_GlyphSlot      next;\n    FT_UInt           reserved;       /* retained for binary compatibility */\n    FT_Generic        generic;\n\n    FT_Glyph_Metrics  metrics;\n    FT_Fixed          linearHoriAdvance;\n    FT_Fixed          linearVertAdvance;\n    FT_Vector         advance;\n\n    FT_Glyph_Format   format;\n\n    FT_Bitmap         bitmap;\n    FT_Int            bitmap_left;\n    FT_Int            bitmap_top;\n\n    FT_Outline        outline;\n\n    FT_UInt           num_subglyphs;\n    FT_SubGlyph       subglyphs;\n\n    void*             control_data;\n    long              control_len;\n\n    FT_Pos            lsb_delta;\n    FT_Pos            rsb_delta;\n\n    void*             other;\n\n    FT_Slot_Internal  internal;\n\n  } FT_GlyphSlotRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                         F U N C T I O N S                             */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Init_FreeType                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initialize a new FreeType library object.  The set of modules      */\n  /*    that are registered by this function is determined at build time.  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    alibrary :: A handle to a new library object.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    In case you want to provide your own memory allocating routines,   */\n  /*    use @FT_New_Library instead, followed by a call to                 */\n  /*    @FT_Add_Default_Modules (or a series of calls to @FT_Add_Module).  */\n  /*                                                                       */\n  /*    For multi-threading applications each thread should have its own   */\n  /*    FT_Library object.                                                 */\n  /*                                                                       */\n  /*    If you need reference-counting (cf. @FT_Reference_Library), use    */\n  /*    @FT_New_Library and @FT_Done_Library.                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Init_FreeType( FT_Library  *alibrary );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_FreeType                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a given FreeType library object and all of its children,   */\n  /*    including resources, drivers, faces, sizes, etc.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to the target library object.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_FreeType( FT_Library  library );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_OPEN_XXX                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit-field constants used within the `flags' field of the */\n  /*    @FT_Open_Args structure.                                           */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_OPEN_MEMORY   :: This is a memory-based stream.                 */\n  /*                                                                       */\n  /*    FT_OPEN_STREAM   :: Copy the stream from the `stream' field.       */\n  /*                                                                       */\n  /*    FT_OPEN_PATHNAME :: Create a new input stream from a C~path        */\n  /*                        name.                                          */\n  /*                                                                       */\n  /*    FT_OPEN_DRIVER   :: Use the `driver' field.                        */\n  /*                                                                       */\n  /*    FT_OPEN_PARAMS   :: Use the `num_params' and `params' fields.      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME'     */\n  /*    flags are mutually exclusive.                                      */\n  /*                                                                       */\n#define FT_OPEN_MEMORY    0x1\n#define FT_OPEN_STREAM    0x2\n#define FT_OPEN_PATHNAME  0x4\n#define FT_OPEN_DRIVER    0x8\n#define FT_OPEN_PARAMS    0x10\n\n\n  /* these constants are deprecated; use the corresponding `FT_OPEN_XXX' */\n  /* values instead                                                      */\n#define ft_open_memory    FT_OPEN_MEMORY\n#define ft_open_stream    FT_OPEN_STREAM\n#define ft_open_pathname  FT_OPEN_PATHNAME\n#define ft_open_driver    FT_OPEN_DRIVER\n#define ft_open_params    FT_OPEN_PARAMS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Parameter                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to pass more or less generic parameters to */\n  /*    @FT_Open_Face.                                                     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    tag  :: A four-byte identification tag.                            */\n  /*                                                                       */\n  /*    data :: A pointer to the parameter data.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The ID and function of parameters are driver-specific.  See the    */\n  /*    various FT_PARAM_TAG_XXX flags for more information.               */\n  /*                                                                       */\n  typedef struct  FT_Parameter_\n  {\n    FT_ULong    tag;\n    FT_Pointer  data;\n\n  } FT_Parameter;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Open_Args                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to indicate how to open a new font file or        */\n  /*    stream.  A pointer to such a structure can be used as a parameter  */\n  /*    for the functions @FT_Open_Face and @FT_Attach_Stream.             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    flags       :: A set of bit flags indicating how to use the        */\n  /*                   structure.                                          */\n  /*                                                                       */\n  /*    memory_base :: The first byte of the file in memory.               */\n  /*                                                                       */\n  /*    memory_size :: The size in bytes of the file in memory.            */\n  /*                                                                       */\n  /*    pathname    :: A pointer to an 8-bit file pathname.                */\n  /*                                                                       */\n  /*    stream      :: A handle to a source stream object.                 */\n  /*                                                                       */\n  /*    driver      :: This field is exclusively used by @FT_Open_Face;    */\n  /*                   it simply specifies the font driver to use to open  */\n  /*                   the face.  If set to~0, FreeType tries to load the  */\n  /*                   face with each one of the drivers in its list.      */\n  /*                                                                       */\n  /*    num_params  :: The number of extra parameters.                     */\n  /*                                                                       */\n  /*    params      :: Extra parameters passed to the font driver when     */\n  /*                   opening a new face.                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream type is determined by the contents of `flags' that      */\n  /*    are tested in the following order by @FT_Open_Face:                */\n  /*                                                                       */\n  /*    If the @FT_OPEN_MEMORY bit is set, assume that this is a           */\n  /*    memory file of `memory_size' bytes, located at `memory_address'.   */\n  /*    The data are are not copied, and the client is responsible for     */\n  /*    releasing and destroying them _after_ the corresponding call to    */\n  /*    @FT_Done_Face.                                                     */\n  /*                                                                       */\n  /*    Otherwise, if the @FT_OPEN_STREAM bit is set, assume that a        */\n  /*    custom input stream `stream' is used.                              */\n  /*                                                                       */\n  /*    Otherwise, if the @FT_OPEN_PATHNAME bit is set, assume that this   */\n  /*    is a normal file and use `pathname' to open it.                    */\n  /*                                                                       */\n  /*    If the @FT_OPEN_DRIVER bit is set, @FT_Open_Face only tries to     */\n  /*    open the file with the driver whose handler is in `driver'.        */\n  /*                                                                       */\n  /*    If the @FT_OPEN_PARAMS bit is set, the parameters given by         */\n  /*    `num_params' and `params' is used.  They are ignored otherwise.    */\n  /*                                                                       */\n  /*    Ideally, both the `pathname' and `params' fields should be tagged  */\n  /*    as `const'; this is missing for API backwards compatibility.  In   */\n  /*    other words, applications should treat them as read-only.          */\n  /*                                                                       */\n  typedef struct  FT_Open_Args_\n  {\n    FT_UInt         flags;\n    const FT_Byte*  memory_base;\n    FT_Long         memory_size;\n    FT_String*      pathname;\n    FT_Stream       stream;\n    FT_Module       driver;\n    FT_Int          num_params;\n    FT_Parameter*   params;\n\n  } FT_Open_Args;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Open_Face to open a font by its pathname.  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    pathname   :: A path to the font file.                             */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the font.  The first    */\n  /*                  face has index~0.                                    */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.  If `face_index' is   */\n  /*                  greater than or equal to zero, it must be non-NULL.  */\n  /*                  See @FT_Open_Face for more details.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Use @FT_Done_Face to destroy the created @FT_Face object (along    */\n  /*    with its slot and sizes).                                          */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face( FT_Library   library,\n               const char*  filepathname,\n               FT_Long      face_index,\n               FT_Face     *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Memory_Face                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Open_Face to open a font that has been     */\n  /*    loaded into memory.                                                */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    file_base  :: A pointer to the beginning of the font data.         */\n  /*                                                                       */\n  /*    file_size  :: The size of the memory chunk used by the font data.  */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the font.  The first    */\n  /*                  face has index~0.                                    */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.  If `face_index' is   */\n  /*                  greater than or equal to zero, it must be non-NULL.  */\n  /*                  See @FT_Open_Face for more details.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You must not deallocate the memory before calling @FT_Done_Face.   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Memory_Face( FT_Library      library,\n                      const FT_Byte*  file_base,\n                      FT_Long         file_size,\n                      FT_Long         face_index,\n                      FT_Face        *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Open_Face                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a face object from a given resource described by            */\n  /*    @FT_Open_Args.                                                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    args       :: A pointer to an `FT_Open_Args' structure that must   */\n  /*                  be filled by the caller.                             */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the font.  The first    */\n  /*                  face has index~0.                                    */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.  If `face_index' is   */\n  /*                  greater than or equal to zero, it must be non-NULL.  */\n  /*                  See note below.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Unlike FreeType 1.x, this function automatically creates a glyph   */\n  /*    slot for the face object that can be accessed directly through     */\n  /*    `face->glyph'.                                                     */\n  /*                                                                       */\n  /*    FT_Open_Face can be used to quickly check whether the font         */\n  /*    format of a given font resource is supported by FreeType.  If the  */\n  /*    `face_index' field is negative, the function's return value is~0   */\n  /*    if the font format is recognized, or non-zero otherwise;           */\n  /*    the function returns a more or less empty face handle in `*aface'  */\n  /*    (if `aface' isn't NULL).  The only useful field in this special    */\n  /*    case is `face->num_faces' that gives the number of faces within    */\n  /*    the font file.  After examination, the returned @FT_Face structure */\n  /*    should be deallocated with a call to @FT_Done_Face.                */\n  /*                                                                       */\n  /*    Each new face object created with this function also owns a        */\n  /*    default @FT_Size object, accessible as `face->size'.               */\n  /*                                                                       */\n  /*    One @FT_Library instance can have multiple face objects, this is,  */\n  /*    @FT_Open_Face and its siblings can be called multiple times using  */\n  /*    the same `library' argument.                                       */\n  /*                                                                       */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Face.                                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Open_Face( FT_Library           library,\n                const FT_Open_Args*  args,\n                FT_Long              face_index,\n                FT_Face             *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Attach_File                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Attach_Stream to attach a file.            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face         :: The target face object.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    filepathname :: The pathname.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Attach_File( FT_Face      face,\n                  const char*  filepathname );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Attach_Stream                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    `Attach' data to a face object.  Normally, this is used to read    */\n  /*    additional information for the face object.  For example, you can  */\n  /*    attach an AFM file that comes with a Type~1 font to get the        */\n  /*    kerning values and other metrics.                                  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: The target face object.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    parameters :: A pointer to @FT_Open_Args that must be filled by    */\n  /*                  the caller.                                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The meaning of the `attach' (i.e., what really happens when the    */\n  /*    new file is read) is not fixed by FreeType itself.  It really      */\n  /*    depends on the font format (and thus the font driver).             */\n  /*                                                                       */\n  /*    Client applications are expected to know what they are doing       */\n  /*    when invoking this function.  Most drivers simply do not implement */\n  /*    file attachments.                                                  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Attach_Stream( FT_Face        face,\n                    FT_Open_Args*  parameters );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Reference_Face                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A counter gets initialized to~1 at the time an @FT_Face structure  */\n  /*    is created.  This function increments the counter.  @FT_Done_Face  */\n  /*    then only destroys a face if the counter is~1, otherwise it simply */\n  /*    decrements the counter.                                            */\n  /*                                                                       */\n  /*    This function helps in managing life-cycles of structures that     */\n  /*    reference @FT_Face objects.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to a target face object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.4.2                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Reference_Face( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Face                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard a given face object, as well as all of its child slots and */\n  /*    sizes.                                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to a target face object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Face.                                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_Face( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Select_Size                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select a bitmap strike.                                            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face         :: A handle to a target face object.                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    strike_index :: The index of the bitmap strike in the              */\n  /*                    `available_sizes' field of @FT_FaceRec structure.  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Select_Size( FT_Face  face,\n                  FT_Int   strike_index );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Size_Request_Type                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type that lists the supported size request types.   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_SIZE_REQUEST_TYPE_NOMINAL ::                                    */\n  /*      The nominal size.  The `units_per_EM' field of @FT_FaceRec is    */\n  /*      used to determine both scaling values.                           */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_REAL_DIM ::                                   */\n  /*      The real dimension.  The sum of the the `ascender' and (minus    */\n  /*      of) the `descender' fields of @FT_FaceRec are used to determine  */\n  /*      both scaling values.                                             */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_BBOX ::                                       */\n  /*      The font bounding box.  The width and height of the `bbox' field */\n  /*      of @FT_FaceRec are used to determine the horizontal and vertical */\n  /*      scaling value, respectively.                                     */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_CELL ::                                       */\n  /*      The `max_advance_width' field of @FT_FaceRec is used to          */\n  /*      determine the horizontal scaling value; the vertical scaling     */\n  /*      value is determined the same way as                              */\n  /*      @FT_SIZE_REQUEST_TYPE_REAL_DIM does.  Finally, both scaling      */\n  /*      values are set to the smaller one.  This type is useful if you   */\n  /*      want to specify the font size for, say, a window of a given      */\n  /*      dimension and 80x24 cells.                                       */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_SCALES ::                                     */\n  /*      Specify the scaling values directly.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The above descriptions only apply to scalable formats.  For bitmap */\n  /*    formats, the behaviour is up to the driver.                        */\n  /*                                                                       */\n  /*    See the note section of @FT_Size_Metrics if you wonder how size    */\n  /*    requesting relates to scaling values.                              */\n  /*                                                                       */\n  typedef enum  FT_Size_Request_Type_\n  {\n    FT_SIZE_REQUEST_TYPE_NOMINAL,\n    FT_SIZE_REQUEST_TYPE_REAL_DIM,\n    FT_SIZE_REQUEST_TYPE_BBOX,\n    FT_SIZE_REQUEST_TYPE_CELL,\n    FT_SIZE_REQUEST_TYPE_SCALES,\n\n    FT_SIZE_REQUEST_TYPE_MAX\n\n  } FT_Size_Request_Type;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_RequestRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a size request.                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    type           :: See @FT_Size_Request_Type.                       */\n  /*                                                                       */\n  /*    width          :: The desired width.                               */\n  /*                                                                       */\n  /*    height         :: The desired height.                              */\n  /*                                                                       */\n  /*    horiResolution :: The horizontal resolution.  If set to zero,      */\n  /*                      `width' is treated as a 26.6 fractional pixel    */\n  /*                      value.                                           */\n  /*                                                                       */\n  /*    vertResolution :: The vertical resolution.  If set to zero,        */\n  /*                      `height' is treated as a 26.6 fractional pixel   */\n  /*                      value.                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If `width' is zero, then the horizontal scaling value is set equal */\n  /*    to the vertical scaling value, and vice versa.                     */\n  /*                                                                       */\n  typedef struct  FT_Size_RequestRec_\n  {\n    FT_Size_Request_Type  type;\n    FT_Long               width;\n    FT_Long               height;\n    FT_UInt               horiResolution;\n    FT_UInt               vertResolution;\n\n  } FT_Size_RequestRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_Request                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a size request structure.                              */\n  /*                                                                       */\n  typedef struct FT_Size_RequestRec_  *FT_Size_Request;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Request_Size                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Resize the scale of the active @FT_Size object in a face.          */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face :: A handle to a target face object.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    req  :: A pointer to a @FT_Size_RequestRec.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Although drivers may select the bitmap strike matching the         */\n  /*    request, you should not rely on this if you intend to select a     */\n  /*    particular bitmap strike.  Use @FT_Select_Size instead in that     */\n  /*    case.                                                              */\n  /*                                                                       */\n  /*    The relation between the requested size and the resulting glyph    */\n  /*    size is dependent entirely on how the size is defined in the       */\n  /*    source face.  The font designer chooses the final size of each     */\n  /*    glyph relative to this size.  For more information refer to        */\n  /*    `http://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html'      */\n  /*                                                                       */\n  /*    Don't use this function if you are using the FreeType cache API.   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Request_Size( FT_Face          face,\n                   FT_Size_Request  req );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Char_Size                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Request_Size to request the nominal size   */\n  /*    (in points).                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face            :: A handle to a target face object.               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    char_width      :: The nominal width, in 26.6 fractional points.   */\n  /*                                                                       */\n  /*    char_height     :: The nominal height, in 26.6 fractional points.  */\n  /*                                                                       */\n  /*    horz_resolution :: The horizontal resolution in dpi.               */\n  /*                                                                       */\n  /*    vert_resolution :: The vertical resolution in dpi.                 */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If either the character width or height is zero, it is set equal   */\n  /*    to the other value.                                                */\n  /*                                                                       */\n  /*    If either the horizontal or vertical resolution is zero, it is set */\n  /*    equal to the other value.                                          */\n  /*                                                                       */\n  /*    A character width or height smaller than 1pt is set to 1pt; if     */\n  /*    both resolution values are zero, they are set to 72dpi.            */\n  /*                                                                       */\n  /*    Don't use this function if you are using the FreeType cache API.   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Char_Size( FT_Face     face,\n                    FT_F26Dot6  char_width,\n                    FT_F26Dot6  char_height,\n                    FT_UInt     horz_resolution,\n                    FT_UInt     vert_resolution );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Pixel_Sizes                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Request_Size to request the nominal size   */\n  /*    (in pixels).                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face         :: A handle to the target face object.                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    pixel_width  :: The nominal width, in pixels.                      */\n  /*                                                                       */\n  /*    pixel_height :: The nominal height, in pixels.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should not rely on the resulting glyphs matching, or being     */\n  /*    constrained, to this pixel size.  Refer to @FT_Request_Size to     */\n  /*    understand how requested sizes relate to actual sizes.             */\n  /*                                                                       */\n  /*    Don't use this function if you are using the FreeType cache API.   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Pixel_Sizes( FT_Face  face,\n                      FT_UInt  pixel_width,\n                      FT_UInt  pixel_height );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Load_Glyph                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to load a single glyph into the glyph slot of a    */\n  /*    face object.                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face        :: A handle to the target face object where the glyph  */\n  /*                   is loaded.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    glyph_index :: The index of the glyph in the font file.  For       */\n  /*                   CID-keyed fonts (either in PS or in CFF format)     */\n  /*                   this argument specifies the CID value.              */\n  /*                                                                       */\n  /*    load_flags  :: A flag indicating what to load for this glyph.  The */\n  /*                   @FT_LOAD_XXX constants can be used to control the   */\n  /*                   glyph loading process (e.g., whether the outline    */\n  /*                   should be scaled, whether to load bitmaps or not,   */\n  /*                   whether to hint the outline, etc).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The loaded glyph may be transformed.  See @FT_Set_Transform for    */\n  /*    the details.                                                       */\n  /*                                                                       */\n  /*    For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument' is        */\n  /*    returned for invalid CID values (this is, for CID values that      */\n  /*    don't have a corresponding glyph in the font).  See the discussion */\n  /*    of the @FT_FACE_FLAG_CID_KEYED flag for more details.              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Load_Glyph( FT_Face   face,\n                 FT_UInt   glyph_index,\n                 FT_Int32  load_flags );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Load_Char                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to load a single glyph into the glyph slot of a    */\n  /*    face object, according to its character code.                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face        :: A handle to a target face object where the glyph    */\n  /*                   is loaded.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    char_code   :: The glyph's character code, according to the        */\n  /*                   current charmap used in the face.                   */\n  /*                                                                       */\n  /*    load_flags  :: A flag indicating what to load for this glyph.  The */\n  /*                   @FT_LOAD_XXX constants can be used to control the   */\n  /*                   glyph loading process (e.g., whether the outline    */\n  /*                   should be scaled, whether to load bitmaps or not,   */\n  /*                   whether to hint the outline, etc).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph.  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Load_Char( FT_Face   face,\n                FT_ULong  char_code,\n                FT_Int32  load_flags );\n\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FT_LOAD_XXX\n   *\n   * @description:\n   *   A list of bit-field constants used with @FT_Load_Glyph to indicate\n   *   what kind of operations to perform during glyph loading.\n   *\n   * @values:\n   *   FT_LOAD_DEFAULT ::\n   *     Corresponding to~0, this value is used as the default glyph load\n   *     operation.  In this case, the following happens:\n   *\n   *     1. FreeType looks for a bitmap for the glyph corresponding to the\n   *        face's current size.  If one is found, the function returns.\n   *        The bitmap data can be accessed from the glyph slot (see note\n   *        below).\n   *\n   *     2. If no embedded bitmap is searched or found, FreeType looks for a\n   *        scalable outline.  If one is found, it is loaded from the font\n   *        file, scaled to device pixels, then `hinted' to the pixel grid\n   *        in order to optimize it.  The outline data can be accessed from\n   *        the glyph slot (see note below).\n   *\n   *     Note that by default, the glyph loader doesn't render outlines into\n   *     bitmaps.  The following flags are used to modify this default\n   *     behaviour to more specific and useful cases.\n   *\n   *   FT_LOAD_NO_SCALE ::\n   *     Don't scale the loaded outline glyph but keep it in font units.\n   *\n   *     This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and\n   *     unsets @FT_LOAD_RENDER.\n   *\n   *     If the font is `tricky' (see @FT_FACE_FLAG_TRICKY for more), using\n   *     FT_LOAD_NO_SCALE usually yields meaningless outlines because the\n   *     subglyphs must be scaled and positioned with hinting instructions.\n   *     This can be solved by loading the font without FT_LOAD_NO_SCALE and\n   *     setting the character size to `font->units_per_EM'.\n   *\n   *   FT_LOAD_NO_HINTING ::\n   *     Disable hinting.  This generally generates `blurrier' bitmap glyphs\n   *     when the glyph are rendered in any of the anti-aliased modes.  See\n   *     also the note below.\n   *\n   *     This flag is implied by @FT_LOAD_NO_SCALE.\n   *\n   *   FT_LOAD_RENDER ::\n   *     Call @FT_Render_Glyph after the glyph is loaded.  By default, the\n   *     glyph is rendered in @FT_RENDER_MODE_NORMAL mode.  This can be\n   *     overridden by @FT_LOAD_TARGET_XXX or @FT_LOAD_MONOCHROME.\n   *\n   *     This flag is unset by @FT_LOAD_NO_SCALE.\n   *\n   *   FT_LOAD_NO_BITMAP ::\n   *     Ignore bitmap strikes when loading.  Bitmap-only fonts ignore this\n   *     flag.\n   *\n   *     @FT_LOAD_NO_SCALE always sets this flag.\n   *\n   *   FT_LOAD_VERTICAL_LAYOUT ::\n   *     Load the glyph for vertical text layout.  In particular, the\n   *     `advance' value in the @FT_GlyphSlotRec structure is set to the\n   *     `vertAdvance' value of the `metrics' field.\n   *\n   *     In case @FT_HAS_VERTICAL doesn't return true, you shouldn't use\n   *     this flag currently.  Reason is that in this case vertical metrics\n   *     get synthesized, and those values are not always consistent across\n   *     various font formats.\n   *\n   *   FT_LOAD_FORCE_AUTOHINT ::\n   *     Indicates that the auto-hinter is preferred over the font's native\n   *     hinter.  See also the note below.\n   *\n   *   FT_LOAD_PEDANTIC ::\n   *     Indicates that the font driver should perform pedantic verifications\n   *     during glyph loading.  This is mostly used to detect broken glyphs\n   *     in fonts.  By default, FreeType tries to handle broken fonts also.\n   *\n   *     In particular, errors from the TrueType bytecode engine are not\n   *     passed to the application if this flag is not set; this might\n   *     result in partially hinted or distorted glyphs in case a glyph's\n   *     bytecode is buggy.\n   *\n   *   FT_LOAD_NO_RECURSE ::\n   *     Indicate that the font driver should not load composite glyphs\n   *     recursively.  Instead, it should set the `num_subglyph' and\n   *     `subglyphs' values of the glyph slot accordingly, and set\n   *     `glyph->format' to @FT_GLYPH_FORMAT_COMPOSITE.  The description of\n   *     subglyphs can then be accessed with @FT_Get_SubGlyph_Info.\n   *\n   *     This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM.\n   *\n   *   FT_LOAD_IGNORE_TRANSFORM ::\n   *     Indicates that the transform matrix set by @FT_Set_Transform should\n   *     be ignored.\n   *\n   *   FT_LOAD_MONOCHROME ::\n   *     This flag is used with @FT_LOAD_RENDER to indicate that you want to\n   *     render an outline glyph to a 1-bit monochrome bitmap glyph, with\n   *     8~pixels packed into each byte of the bitmap data.\n   *\n   *     Note that this has no effect on the hinting algorithm used.  You\n   *     should rather use @FT_LOAD_TARGET_MONO so that the\n   *     monochrome-optimized hinting algorithm is used.\n   *\n   *   FT_LOAD_LINEAR_DESIGN ::\n   *     Indicates that the `linearHoriAdvance' and `linearVertAdvance'\n   *     fields of @FT_GlyphSlotRec should be kept in font units.  See\n   *     @FT_GlyphSlotRec for details.\n   *\n   *   FT_LOAD_NO_AUTOHINT ::\n   *     Disable auto-hinter.  See also the note below.\n   *\n   *   FT_LOAD_COLOR ::\n   *     This flag is used to request loading of color embedded-bitmap\n   *     images.  The resulting color bitmaps, if available, will have the\n   *     @FT_PIXEL_MODE_BGRA format.  When the flag is not used and color\n   *     bitmaps are found, they will be converted to 256-level gray\n   *     bitmaps transparently.  Those bitmaps will be in the\n   *     @FT_PIXEL_MODE_GRAY format.\n   *\n   *   FT_LOAD_CROP_BITMAP ::\n   *     Ignored.  Deprecated.\n   *\n   *   FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::\n   *     Ignored.  Deprecated.\n   *\n   * @note:\n   *   By default, hinting is enabled and the font's native hinter (see\n   *   @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter.  You can\n   *   disable hinting by setting @FT_LOAD_NO_HINTING or change the\n   *   precedence by setting @FT_LOAD_FORCE_AUTOHINT.  You can also set\n   *   @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be\n   *   used at all.\n   *\n   *   See the description of @FT_FACE_FLAG_TRICKY for a special exception\n   *   (affecting only a handful of Asian fonts).\n   *\n   *   Besides deciding which hinter to use, you can also decide which\n   *   hinting algorithm to use.  See @FT_LOAD_TARGET_XXX for details.\n   *\n   *   Note that the auto-hinter needs a valid Unicode cmap (either a native\n   *   one or synthesized by FreeType) for producing correct results.  If a\n   *   font provides an incorrect mapping (for example, assigning the\n   *   character code U+005A, LATIN CAPITAL LETTER Z, to a glyph depicting a\n   *   mathematical integral sign), the auto-hinter might produce useless\n   *   results.\n   *\n   */\n#define FT_LOAD_DEFAULT                      0x0\n#define FT_LOAD_NO_SCALE                     ( 1L << 0 )\n#define FT_LOAD_NO_HINTING                   ( 1L << 1 )\n#define FT_LOAD_RENDER                       ( 1L << 2 )\n#define FT_LOAD_NO_BITMAP                    ( 1L << 3 )\n#define FT_LOAD_VERTICAL_LAYOUT              ( 1L << 4 )\n#define FT_LOAD_FORCE_AUTOHINT               ( 1L << 5 )\n#define FT_LOAD_CROP_BITMAP                  ( 1L << 6 )\n#define FT_LOAD_PEDANTIC                     ( 1L << 7 )\n#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH  ( 1L << 9 )\n#define FT_LOAD_NO_RECURSE                   ( 1L << 10 )\n#define FT_LOAD_IGNORE_TRANSFORM             ( 1L << 11 )\n#define FT_LOAD_MONOCHROME                   ( 1L << 12 )\n#define FT_LOAD_LINEAR_DESIGN                ( 1L << 13 )\n#define FT_LOAD_NO_AUTOHINT                  ( 1L << 15 )\n  /* Bits 16..19 are used by `FT_LOAD_TARGET_' */\n#define FT_LOAD_COLOR                        ( 1L << 20 )\n\n  /* */\n\n  /* used internally only by certain font drivers! */\n#define FT_LOAD_ADVANCE_ONLY                 ( 1L << 8 )\n#define FT_LOAD_SBITS_ONLY                   ( 1L << 14 )\n\n\n  /**************************************************************************\n   *\n   * @enum:\n   *   FT_LOAD_TARGET_XXX\n   *\n   * @description:\n   *   A list of values that are used to select a specific hinting algorithm\n   *   to use by the hinter.  You should OR one of these values to your\n   *   `load_flags' when calling @FT_Load_Glyph.\n   *\n   *   Note that font's native hinters may ignore the hinting algorithm you\n   *   have specified (e.g., the TrueType bytecode interpreter).  You can set\n   *   @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used.\n   *\n   *   Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it\n   *   always implies @FT_LOAD_FORCE_AUTOHINT.\n   *\n   * @values:\n   *   FT_LOAD_TARGET_NORMAL ::\n   *     This corresponds to the default hinting algorithm, optimized for\n   *     standard gray-level rendering.  For monochrome output, use\n   *     @FT_LOAD_TARGET_MONO instead.\n   *\n   *   FT_LOAD_TARGET_LIGHT ::\n   *     A lighter hinting algorithm for non-monochrome modes.  Many\n   *     generated glyphs are more fuzzy but better resemble its original\n   *     shape.  A bit like rendering on Mac OS~X.\n   *\n   *     As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT.\n   *\n   *   FT_LOAD_TARGET_MONO ::\n   *     Strong hinting algorithm that should only be used for monochrome\n   *     output.  The result is probably unpleasant if the glyph is rendered\n   *     in non-monochrome modes.\n   *\n   *   FT_LOAD_TARGET_LCD ::\n   *     A variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally\n   *     decimated LCD displays.\n   *\n   *   FT_LOAD_TARGET_LCD_V ::\n   *     A variant of @FT_LOAD_TARGET_NORMAL optimized for vertically\n   *     decimated LCD displays.\n   *\n   * @note:\n   *   You should use only _one_ of the FT_LOAD_TARGET_XXX values in your\n   *   `load_flags'.  They can't be ORed.\n   *\n   *   If @FT_LOAD_RENDER is also set, the glyph is rendered in the\n   *   corresponding mode (i.e., the mode that matches the used algorithm\n   *   best).  An exeption is FT_LOAD_TARGET_MONO since it implies\n   *   @FT_LOAD_MONOCHROME.\n   *\n   *   You can use a hinting algorithm that doesn't correspond to the same\n   *   rendering mode.  As an example, it is possible to use the `light'\n   *   hinting algorithm and have the results rendered in horizontal LCD\n   *   pixel mode, with code like\n   *\n   *     {\n   *       FT_Load_Glyph( face, glyph_index,\n   *                      load_flags | FT_LOAD_TARGET_LIGHT );\n   *\n   *       FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );\n   *     }\n   *\n   */\n#define FT_LOAD_TARGET_( x )   ( (FT_Int32)( (x) & 15 ) << 16 )\n\n#define FT_LOAD_TARGET_NORMAL  FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )\n#define FT_LOAD_TARGET_LIGHT   FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT  )\n#define FT_LOAD_TARGET_MONO    FT_LOAD_TARGET_( FT_RENDER_MODE_MONO   )\n#define FT_LOAD_TARGET_LCD     FT_LOAD_TARGET_( FT_RENDER_MODE_LCD    )\n#define FT_LOAD_TARGET_LCD_V   FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V  )\n\n\n  /**************************************************************************\n   *\n   * @macro:\n   *   FT_LOAD_TARGET_MODE\n   *\n   * @description:\n   *   Return the @FT_Render_Mode corresponding to a given\n   *   @FT_LOAD_TARGET_XXX value.\n   *\n   */\n#define FT_LOAD_TARGET_MODE( x )  ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Transform                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to set the transformation that is applied to glyph */\n  /*    images when they are loaded into a glyph slot through              */\n  /*    @FT_Load_Glyph.                                                    */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face   :: A handle to the source face object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix :: A pointer to the transformation's 2x2 matrix.  Use~0 for */\n  /*              the identity matrix.                                     */\n  /*    delta  :: A pointer to the translation vector.  Use~0 for the null */\n  /*              vector.                                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The transformation is only applied to scalable image formats after */\n  /*    the glyph has been loaded.  It means that hinting is unaltered by  */\n  /*    the transformation and is performed on the character size given in */\n  /*    the last call to @FT_Set_Char_Size or @FT_Set_Pixel_Sizes.         */\n  /*                                                                       */\n  /*    Note that this also transforms the `face.glyph.advance' field, but */\n  /*    *not* the values in `face.glyph.metrics'.                          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Set_Transform( FT_Face     face,\n                    FT_Matrix*  matrix,\n                    FT_Vector*  delta );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Render_Mode                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type that lists the render modes supported by       */\n  /*    FreeType~2.  Each mode corresponds to a specific type of scanline  */\n  /*    conversion performed on the outline.                               */\n  /*                                                                       */\n  /*    For bitmap fonts and embedded bitmaps the `bitmap->pixel_mode'     */\n  /*    field in the @FT_GlyphSlotRec structure gives the format of the    */\n  /*    returned bitmap.                                                   */\n  /*                                                                       */\n  /*    All modes except @FT_RENDER_MODE_MONO use 256 levels of opacity.   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_RENDER_MODE_NORMAL ::                                           */\n  /*      This is the default render mode; it corresponds to 8-bit         */\n  /*      anti-aliased bitmaps.                                            */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_LIGHT ::                                            */\n  /*      This is equivalent to @FT_RENDER_MODE_NORMAL.  It is only        */\n  /*      defined as a separate value because render modes are also used   */\n  /*      indirectly to define hinting algorithm selectors.  See           */\n  /*      @FT_LOAD_TARGET_XXX for details.                                 */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_MONO ::                                             */\n  /*      This mode corresponds to 1-bit bitmaps (with 2~levels of         */\n  /*      opacity).                                                        */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_LCD ::                                              */\n  /*      This mode corresponds to horizontal RGB and BGR sub-pixel        */\n  /*      displays like LCD screens.  It produces 8-bit bitmaps that are   */\n  /*      3~times the width of the original glyph outline in pixels, and   */\n  /*      which use the @FT_PIXEL_MODE_LCD mode.                           */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_LCD_V ::                                            */\n  /*      This mode corresponds to vertical RGB and BGR sub-pixel displays */\n  /*      (like PDA screens, rotated LCD displays, etc.).  It produces     */\n  /*      8-bit bitmaps that are 3~times the height of the original        */\n  /*      glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode.   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The LCD-optimized glyph bitmaps produced by FT_Render_Glyph can be */\n  /*    filtered to reduce color-fringes by using @FT_Library_SetLcdFilter */\n  /*    (not active in the default builds).  It is up to the caller to     */\n  /*    either call @FT_Library_SetLcdFilter (if available) or do the      */\n  /*    filtering itself.                                                  */\n  /*                                                                       */\n  /*    The selected render mode only affects vector glyphs of a font.     */\n  /*    Embedded bitmaps often have a different pixel mode like            */\n  /*    @FT_PIXEL_MODE_MONO.  You can use @FT_Bitmap_Convert to transform  */\n  /*    them into 8-bit pixmaps.                                           */\n  /*                                                                       */\n  typedef enum  FT_Render_Mode_\n  {\n    FT_RENDER_MODE_NORMAL = 0,\n    FT_RENDER_MODE_LIGHT,\n    FT_RENDER_MODE_MONO,\n    FT_RENDER_MODE_LCD,\n    FT_RENDER_MODE_LCD_V,\n\n    FT_RENDER_MODE_MAX\n\n  } FT_Render_Mode;\n\n\n  /* these constants are deprecated; use the corresponding */\n  /* `FT_Render_Mode' values instead                       */\n#define ft_render_mode_normal  FT_RENDER_MODE_NORMAL\n#define ft_render_mode_mono    FT_RENDER_MODE_MONO\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Render_Glyph                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Convert a given glyph image to a bitmap.  It does so by inspecting */\n  /*    the glyph image format, finding the relevant renderer, and         */\n  /*    invoking it.                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    slot        :: A handle to the glyph slot containing the image to  */\n  /*                   convert.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    render_mode :: This is the render mode used to render the glyph    */\n  /*                   image into a bitmap.  See @FT_Render_Mode for a     */\n  /*                   list of possible values.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    To get meaningful results, font scaling values must be set with    */\n  /*    functions like @FT_Set_Char_Size before calling FT_Render_Glyph.   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Render_Glyph( FT_GlyphSlot    slot,\n                   FT_Render_Mode  render_mode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Kerning_Mode                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used to specify which kerning values to return in   */\n  /*    @FT_Get_Kerning.                                                   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_KERNING_DEFAULT  :: Return scaled and grid-fitted kerning       */\n  /*                           distances (value is~0).                     */\n  /*                                                                       */\n  /*    FT_KERNING_UNFITTED :: Return scaled but un-grid-fitted kerning    */\n  /*                           distances.                                  */\n  /*                                                                       */\n  /*    FT_KERNING_UNSCALED :: Return the kerning vector in original font  */\n  /*                           units.                                      */\n  /*                                                                       */\n  typedef enum  FT_Kerning_Mode_\n  {\n    FT_KERNING_DEFAULT  = 0,\n    FT_KERNING_UNFITTED,\n    FT_KERNING_UNSCALED\n\n  } FT_Kerning_Mode;\n\n\n  /* these constants are deprecated; use the corresponding */\n  /* `FT_Kerning_Mode' values instead                      */\n#define ft_kerning_default   FT_KERNING_DEFAULT\n#define ft_kerning_unfitted  FT_KERNING_UNFITTED\n#define ft_kerning_unscaled  FT_KERNING_UNSCALED\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Kerning                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the kerning vector between two glyphs of a same face.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to a source face object.                   */\n  /*                                                                       */\n  /*    left_glyph  :: The index of the left glyph in the kern pair.       */\n  /*                                                                       */\n  /*    right_glyph :: The index of the right glyph in the kern pair.      */\n  /*                                                                       */\n  /*    kern_mode   :: See @FT_Kerning_Mode for more information.          */\n  /*                   Determines the scale and dimension of the returned  */\n  /*                   kerning vector.                                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    akerning    :: The kerning vector.  This is either in font units   */\n  /*                   or in pixels (26.6 format) for scalable formats,    */\n  /*                   and in pixels for fixed-sizes formats.              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Only horizontal layouts (left-to-right & right-to-left) are        */\n  /*    supported by this method.  Other layouts, or more sophisticated    */\n  /*    kernings, are out of the scope of this API function -- they can be */\n  /*    implemented through format-specific interfaces.                    */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Kerning( FT_Face     face,\n                  FT_UInt     left_glyph,\n                  FT_UInt     right_glyph,\n                  FT_UInt     kern_mode,\n                  FT_Vector  *akerning );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Track_Kerning                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the track kerning for a given face object at a given size.  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face       :: A handle to a source face object.                    */\n  /*                                                                       */\n  /*    point_size :: The point size in 16.16 fractional points.           */\n  /*                                                                       */\n  /*    degree     :: The degree of tightness.  Increasingly negative      */\n  /*                  values represent tighter track kerning, while        */\n  /*                  increasingly positive values represent looser track  */\n  /*                  kerning.  Value zero means no track kerning.         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    akerning   :: The kerning in 16.16 fractional points, to be        */\n  /*                  uniformly applied between all glyphs.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Currently, only the Type~1 font driver supports track kerning,     */\n  /*    using data from AFM files (if attached with @FT_Attach_File or     */\n  /*    @FT_Attach_Stream).                                                */\n  /*                                                                       */\n  /*    Only very few AFM files come with track kerning data; please refer */\n  /*    to the Adobe's AFM specification for more details.                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Track_Kerning( FT_Face    face,\n                        FT_Fixed   point_size,\n                        FT_Int     degree,\n                        FT_Fixed*  akerning );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Glyph_Name                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the ASCII name of a given glyph in a face.  This only     */\n  /*    works for those faces where @FT_HAS_GLYPH_NAMES(face) returns~1.   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to a source face object.                   */\n  /*                                                                       */\n  /*    glyph_index :: The glyph index.                                    */\n  /*                                                                       */\n  /*    buffer_max  :: The maximum number of bytes available in the        */\n  /*                   buffer.                                             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    buffer      :: A pointer to a target buffer where the name is      */\n  /*                   copied to.                                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An error is returned if the face doesn't provide glyph names or if */\n  /*    the glyph index is invalid.  In all cases of failure, the first    */\n  /*    byte of `buffer' is set to~0 to indicate an empty name.            */\n  /*                                                                       */\n  /*    The glyph name is truncated to fit within the buffer if it is too  */\n  /*    long.  The returned string is always zero-terminated.              */\n  /*                                                                       */\n  /*    Be aware that FreeType reorders glyph indices internally so that   */\n  /*    glyph index~0 always corresponds to the `missing glyph' (called    */\n  /*    `.notdef').                                                        */\n  /*                                                                       */\n  /*    This function always returns an error if the config macro          */\n  /*    `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is not defined in `ftoptions.h'. */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Glyph_Name( FT_Face     face,\n                     FT_UInt     glyph_index,\n                     FT_Pointer  buffer,\n                     FT_UInt     buffer_max );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Postscript_Name                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the ASCII PostScript name of a given face, if available.  */\n  /*    This only works with PostScript and TrueType fonts.                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source face object.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to the face's PostScript name.  NULL if unavailable.     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned pointer is owned by the face and is destroyed with    */\n  /*    it.                                                                */\n  /*                                                                       */\n  FT_EXPORT( const char* )\n  FT_Get_Postscript_Name( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Select_Charmap                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select a given charmap by its encoding tag (as listed in           */\n  /*    `freetype.h').                                                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face     :: A handle to the source face object.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    encoding :: A handle to the selected encoding.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function returns an error if no charmap in the face           */\n  /*    corresponds to the encoding queried here.                          */\n  /*                                                                       */\n  /*    Because many fonts contain more than a single cmap for Unicode     */\n  /*    encoding, this function has some special code to select the one    */\n  /*    that covers Unicode best (`best' in the sense that a UCS-4 cmap is */\n  /*    preferred to a UCS-2 cmap).  It is thus preferable to              */\n  /*    @FT_Set_Charmap in this case.                                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Select_Charmap( FT_Face      face,\n                     FT_Encoding  encoding );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Charmap                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select a given charmap for character code to glyph index mapping.  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face    :: A handle to the source face object.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    charmap :: A handle to the selected charmap.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function returns an error if the charmap is not part of       */\n  /*    the face (i.e., if it is not listed in the `face->charmaps'        */\n  /*    table).                                                            */\n  /*                                                                       */\n  /*    It also fails if a type~14 charmap is selected.                    */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Charmap( FT_Face     face,\n                  FT_CharMap  charmap );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Get_Charmap_Index\n   *\n   * @description:\n   *   Retrieve index of a given charmap.\n   *\n   * @input:\n   *   charmap ::\n   *     A handle to a charmap.\n   *\n   * @return:\n   *   The index into the array of character maps within the face to which\n   *   `charmap' belongs.  If an error occurs, -1 is returned.\n   *\n   */\n  FT_EXPORT( FT_Int )\n  FT_Get_Charmap_Index( FT_CharMap  charmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Char_Index                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the glyph index of a given character code.  This function   */\n  /*    uses a charmap object to do the mapping.                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face     :: A handle to the source face object.                    */\n  /*                                                                       */\n  /*    charcode :: The character code.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The glyph index.  0~means `undefined character code'.              */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If you use FreeType to manipulate the contents of font files       */\n  /*    directly, be aware that the glyph index returned by this function  */\n  /*    doesn't always correspond to the internal indices used within the  */\n  /*    file.  This is done to ensure that value~0 always corresponds to   */\n  /*    the `missing glyph'.  If the first glyph is not named `.notdef',   */\n  /*    then for Type~1 and Type~42 fonts, `.notdef' will be moved into    */\n  /*    the glyph ID~0 position, and whatever was there will be moved to   */\n  /*    the position `.notdef' had.  For Type~1 fonts, if there is no      */\n  /*    `.notdef' glyph at all, then one will be created at index~0 and    */\n  /*    whatever was there will be moved to the last index -- Type~42      */\n  /*    fonts are considered invalid under this condition.                 */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Get_Char_Index( FT_Face   face,\n                     FT_ULong  charcode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_First_Char                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to return the first character code in the    */\n  /*    current charmap of a given face.  It also returns the              */\n  /*    corresponding glyph index.                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: A handle to the source face object.                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    agindex :: Glyph index of first character code.  0~if charmap is   */\n  /*               empty.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The charmap's first character code.                                */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should use this function with @FT_Get_Next_Char to be able to  */\n  /*    parse all character codes available in a given charmap.  The code  */\n  /*    should look like this:                                             */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      FT_ULong  charcode;                                              */\n  /*      FT_UInt   gindex;                                                */\n  /*                                                                       */\n  /*                                                                       */\n  /*      charcode = FT_Get_First_Char( face, &gindex );                   */\n  /*      while ( gindex != 0 )                                            */\n  /*      {                                                                */\n  /*        ... do something with (charcode,gindex) pair ...               */\n  /*                                                                       */\n  /*        charcode = FT_Get_Next_Char( face, charcode, &gindex );        */\n  /*      }                                                                */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Note that `*agindex' is set to~0 if the charmap is empty.  The     */\n  /*    result itself can be~0 in two cases: if the charmap is empty or    */\n  /*    if the value~0 is the first valid character code.                  */\n  /*                                                                       */\n  FT_EXPORT( FT_ULong )\n  FT_Get_First_Char( FT_Face   face,\n                     FT_UInt  *agindex );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Next_Char                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to return the next character code in the     */\n  /*    current charmap of a given face following the value `char_code',   */\n  /*    as well as the corresponding glyph index.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face      :: A handle to the source face object.                   */\n  /*    char_code :: The starting character code.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    agindex   :: Glyph index of next character code.  0~if charmap     */\n  /*                 is empty.                                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The charmap's next character code.                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should use this function with @FT_Get_First_Char to walk       */\n  /*    over all character codes available in a given charmap.  See the    */\n  /*    note for this function for a simple code example.                  */\n  /*                                                                       */\n  /*    Note that `*agindex' is set to~0 when there are no more codes in   */\n  /*    the charmap.                                                       */\n  /*                                                                       */\n  FT_EXPORT( FT_ULong )\n  FT_Get_Next_Char( FT_Face    face,\n                    FT_ULong   char_code,\n                    FT_UInt   *agindex );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Name_Index                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the glyph index of a given glyph name.  This function uses  */\n  /*    driver specific objects to do the translation.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face       :: A handle to the source face object.                  */\n  /*                                                                       */\n  /*    glyph_name :: The glyph name.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The glyph index.  0~means `undefined character code'.              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Get_Name_Index( FT_Face     face,\n                     FT_String*  glyph_name );\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SUBGLYPH_FLAG_XXX\n   *\n   * @description:\n   *   A list of constants used to describe subglyphs.  Please refer to the\n   *   TrueType specification for the meaning of the various flags.\n   *\n   * @values:\n   *   FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS ::\n   *   FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ::\n   *   FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID ::\n   *   FT_SUBGLYPH_FLAG_SCALE ::\n   *   FT_SUBGLYPH_FLAG_XY_SCALE ::\n   *   FT_SUBGLYPH_FLAG_2X2 ::\n   *   FT_SUBGLYPH_FLAG_USE_MY_METRICS ::\n   *\n   */\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS          1\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES      2\n#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID        4\n#define FT_SUBGLYPH_FLAG_SCALE                   8\n#define FT_SUBGLYPH_FLAG_XY_SCALE             0x40\n#define FT_SUBGLYPH_FLAG_2X2                  0x80\n#define FT_SUBGLYPH_FLAG_USE_MY_METRICS      0x200\n\n\n  /*************************************************************************\n   *\n   * @func:\n   *   FT_Get_SubGlyph_Info\n   *\n   * @description:\n   *   Retrieve a description of a given subglyph.  Only use it if\n   *   `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE; an error is\n   *   returned otherwise.\n   *\n   * @input:\n   *   glyph ::\n   *     The source glyph slot.\n   *\n   *   sub_index ::\n   *     The index of the subglyph.  Must be less than\n   *     `glyph->num_subglyphs'.\n   *\n   * @output:\n   *   p_index ::\n   *     The glyph index of the subglyph.\n   *\n   *   p_flags ::\n   *     The subglyph flags, see @FT_SUBGLYPH_FLAG_XXX.\n   *\n   *   p_arg1 ::\n   *     The subglyph's first argument (if any).\n   *\n   *   p_arg2 ::\n   *     The subglyph's second argument (if any).\n   *\n   *   p_transform ::\n   *     The subglyph transformation (if any).\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   The values of `*p_arg1', `*p_arg2', and `*p_transform' must be\n   *   interpreted depending on the flags returned in `*p_flags'.  See the\n   *   TrueType specification for details.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_SubGlyph_Info( FT_GlyphSlot  glyph,\n                        FT_UInt       sub_index,\n                        FT_Int       *p_index,\n                        FT_UInt      *p_flags,\n                        FT_Int       *p_arg1,\n                        FT_Int       *p_arg2,\n                        FT_Matrix    *p_transform );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_FSTYPE_XXX                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit flags used in the `fsType' field of the OS/2 table   */\n  /*    in a TrueType or OpenType font and the `FSType' entry in a         */\n  /*    PostScript font.  These bit flags are returned by                  */\n  /*    @FT_Get_FSType_Flags; they inform client applications of embedding */\n  /*    and subsetting restrictions associated with a font.                */\n  /*                                                                       */\n  /*    See http://www.adobe.com/devnet/acrobat/pdfs/FontPolicies.pdf for  */\n  /*    more details.                                                      */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_FSTYPE_INSTALLABLE_EMBEDDING ::                                 */\n  /*      Fonts with no fsType bit set may be embedded and permanently     */\n  /*      installed on the remote system by an application.                */\n  /*                                                                       */\n  /*    FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING ::                          */\n  /*      Fonts that have only this bit set must not be modified, embedded */\n  /*      or exchanged in any manner without first obtaining permission of */\n  /*      the font software copyright owner.                               */\n  /*                                                                       */\n  /*    FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING ::                           */\n  /*      If this bit is set, the font may be embedded and temporarily     */\n  /*      loaded on the remote system.  Documents containing Preview &     */\n  /*      Print fonts must be opened `read-only'; no edits can be applied  */\n  /*      to the document.                                                 */\n  /*                                                                       */\n  /*    FT_FSTYPE_EDITABLE_EMBEDDING ::                                    */\n  /*      If this bit is set, the font may be embedded but must only be    */\n  /*      installed temporarily on other systems.  In contrast to Preview  */\n  /*      & Print fonts, documents containing editable fonts may be opened */\n  /*      for reading, editing is permitted, and changes may be saved.     */\n  /*                                                                       */\n  /*    FT_FSTYPE_NO_SUBSETTING ::                                         */\n  /*      If this bit is set, the font may not be subsetted prior to       */\n  /*      embedding.                                                       */\n  /*                                                                       */\n  /*    FT_FSTYPE_BITMAP_EMBEDDING_ONLY ::                                 */\n  /*      If this bit is set, only bitmaps contained in the font may be    */\n  /*      embedded; no outline data may be embedded.  If there are no      */\n  /*      bitmaps available in the font, then the font is unembeddable.    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    While the fsType flags can indicate that a font may be embedded, a */\n  /*    license with the font vendor may be separately required to use the */\n  /*    font in this way.                                                  */\n  /*                                                                       */\n#define FT_FSTYPE_INSTALLABLE_EMBEDDING         0x0000\n#define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING  0x0002\n#define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING   0x0004\n#define FT_FSTYPE_EDITABLE_EMBEDDING            0x0008\n#define FT_FSTYPE_NO_SUBSETTING                 0x0100\n#define FT_FSTYPE_BITMAP_EMBEDDING_ONLY         0x0200\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_FSType_Flags                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the fsType flags for a font.                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source face object.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The fsType flags, @FT_FSTYPE_XXX.                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Use this function rather than directly reading the `fs_type' field */\n  /*    in the @PS_FontInfoRec structure, which is only guaranteed to      */\n  /*    return the correct results for Type~1 fonts.                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.8                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UShort )\n  FT_Get_FSType_Flags( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    glyph_variants                                                     */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Glyph Variants                                                     */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    The FreeType~2 interface to Unicode Ideographic Variation          */\n  /*    Sequences (IVS), using the SFNT cmap format~14.                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Many CJK characters have variant forms.  They are a sort of grey   */\n  /*    area somewhere between being totally irrelevant and semantically   */\n  /*    distinct; for this reason, the Unicode consortium decided to       */\n  /*    introduce Ideographic Variation Sequences (IVS), consisting of a   */\n  /*    Unicode base character and one of 240 variant selectors            */\n  /*    (U+E0100-U+E01EF), instead of further extending the already huge   */\n  /*    code range for CJK characters.                                     */\n  /*                                                                       */\n  /*    An IVS is registered and unique; for further details please refer  */\n  /*    to Unicode Technical Standard #37, the Ideographic Variation       */\n  /*    Database:                                                          */\n  /*                                                                       */\n  /*      http://www.unicode.org/reports/tr37/                             */\n  /*                                                                       */\n  /*    To date (November 2014), the character with the most variants is   */\n  /*    U+9089, having 32 such IVS.                                        */\n  /*                                                                       */\n  /*    Adobe and MS decided to support IVS with a new cmap subtable       */\n  /*    (format~14).  It is an odd subtable because it is not a mapping of */\n  /*    input code points to glyphs, but contains lists of all variants    */\n  /*    supported by the font.                                             */\n  /*                                                                       */\n  /*    A variant may be either `default' or `non-default'.  A default     */\n  /*    variant is the one you will get for that code point if you look it */\n  /*    up in the standard Unicode cmap.  A non-default variant is a       */\n  /*    different glyph.                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetCharVariantIndex                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the glyph index of a given character code as modified by    */\n  /*    the variation selector.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    charcode ::                                                        */\n  /*      The character code point in Unicode.                             */\n  /*                                                                       */\n  /*    variantSelector ::                                                 */\n  /*      The Unicode code point of the variation selector.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The glyph index.  0~means either `undefined character code', or    */\n  /*    `undefined selector code', or `no variation selector cmap          */\n  /*    subtable', or `current CharMap is not Unicode'.                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If you use FreeType to manipulate the contents of font files       */\n  /*    directly, be aware that the glyph index returned by this function  */\n  /*    doesn't always correspond to the internal indices used within      */\n  /*    the file.  This is done to ensure that value~0 always corresponds  */\n  /*    to the `missing glyph'.                                            */\n  /*                                                                       */\n  /*    This function is only meaningful if                                */\n  /*      a) the font has a variation selector cmap sub table,             */\n  /*    and                                                                */\n  /*      b) the current charmap has a Unicode encoding.                   */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Face_GetCharVariantIndex( FT_Face   face,\n                               FT_ULong  charcode,\n                               FT_ULong  variantSelector );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetCharVariantIsDefault                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Check whether this variant of this Unicode character is the one to */\n  /*    be found in the `cmap'.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    charcode ::                                                        */\n  /*      The character codepoint in Unicode.                              */\n  /*                                                                       */\n  /*    variantSelector ::                                                 */\n  /*      The Unicode codepoint of the variation selector.                 */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    1~if found in the standard (Unicode) cmap, 0~if found in the       */\n  /*    variation selector cmap, or -1 if it is not a variant.             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is only meaningful if the font has a variation       */\n  /*    selector cmap subtable.                                            */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Int )\n  FT_Face_GetCharVariantIsDefault( FT_Face   face,\n                                   FT_ULong  charcode,\n                                   FT_ULong  variantSelector );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetVariantSelectors                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a zero-terminated list of Unicode variant selectors found   */\n  /*    in the font.                                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to an array of selector code points, or NULL if there is */\n  /*    no valid variant selector cmap subtable.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The last item in the array is~0; the array is owned by the         */\n  /*    @FT_Face object but can be overwritten or released on the next     */\n  /*    call to a FreeType function.                                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt32* )\n  FT_Face_GetVariantSelectors( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetVariantsOfChar                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a zero-terminated list of Unicode variant selectors found   */\n  /*    for the specified character code.                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    charcode ::                                                        */\n  /*      The character codepoint in Unicode.                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to an array of variant selector code points that are     */\n  /*    active for the given character, or NULL if the corresponding list  */\n  /*    is empty.                                                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The last item in the array is~0; the array is owned by the         */\n  /*    @FT_Face object but can be overwritten or released on the next     */\n  /*    call to a FreeType function.                                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt32* )\n  FT_Face_GetVariantsOfChar( FT_Face   face,\n                             FT_ULong  charcode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_GetCharsOfVariant                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a zero-terminated list of Unicode character codes found for */\n  /*    the specified variant selector.                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      A handle to the source face object.                              */\n  /*                                                                       */\n  /*    variantSelector ::                                                 */\n  /*      The variant selector code point in Unicode.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A list of all the code points that are specified by this selector  */\n  /*    (both default and non-default codes are returned) or NULL if there */\n  /*    is no valid cmap or the variant selector is invalid.               */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The last item in the array is~0; the array is owned by the         */\n  /*    @FT_Face object but can be overwritten or released on the next     */\n  /*    call to a FreeType function.                                       */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.6                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt32* )\n  FT_Face_GetCharsOfVariant( FT_Face   face,\n                             FT_ULong  variantSelector );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    computations                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Computations                                                       */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Crunching fixed numbers and vectors.                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains various functions used to perform            */\n  /*    computations on 16.16 fixed-float numbers or 2d vectors.           */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_MulDiv                                                          */\n  /*    FT_MulFix                                                          */\n  /*    FT_DivFix                                                          */\n  /*    FT_RoundFix                                                        */\n  /*    FT_CeilFix                                                         */\n  /*    FT_FloorFix                                                        */\n  /*    FT_Vector_Transform                                                */\n  /*    FT_Matrix_Multiply                                                 */\n  /*    FT_Matrix_Invert                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_MulDiv                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation `(a*b)/c'   */\n  /*    with maximum accuracy (it uses a 64-bit intermediate integer       */\n  /*    whenever necessary).                                               */\n  /*                                                                       */\n  /*    This function isn't necessarily as fast as some processor specific */\n  /*    operations, but is at least completely portable.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.                                        */\n  /*    c :: The divisor.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*b)/c'.  This function never traps when trying to */\n  /*    divide by zero; it simply returns `MaxInt' or `MinInt' depending   */\n  /*    on the signs of `a' and `b'.                                       */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_MulDiv( FT_Long  a,\n             FT_Long  b,\n             FT_Long  c );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_MulFix                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation             */\n  /*    `(a*b)/0x10000' with maximum accuracy.  Most of the time this is   */\n  /*    used to multiply a given value by a 16.16 fixed-point factor.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.  Use a 16.16 factor here whenever      */\n  /*         possible (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*b)/0x10000'.                                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function has been optimized for the case where the absolute   */\n  /*    value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */\n  /*    As this happens mainly when scaling from notional units to         */\n  /*    fractional pixels in FreeType, it resulted in noticeable speed     */\n  /*    improvements between versions 2.x and 1.x.                         */\n  /*                                                                       */\n  /*    As a conclusion, always try to place a 16.16 factor as the         */\n  /*    _second_ argument of this function; this can make a great          */\n  /*    difference.                                                        */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_MulFix( FT_Long  a,\n             FT_Long  b );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_DivFix                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation             */\n  /*    `(a*0x10000)/b' with maximum accuracy.  Most of the time, this is  */\n  /*    used to divide a given value by a 16.16 fixed-point factor.        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The numerator.                                                */\n  /*    b :: The denominator.  Use a 16.16 factor here.                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*0x10000)/b'.                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_DivFix( FT_Long  a,\n             FT_Long  b );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_RoundFix                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to round a 16.16 fixed number.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The number to be rounded.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a + 0x8000) & -0x10000'.                           */\n  /*                                                                       */\n  FT_EXPORT( FT_Fixed )\n  FT_RoundFix( FT_Fixed  a );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_CeilFix                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to compute the ceiling function of a   */\n  /*    16.16 fixed number.                                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The number for which the ceiling function is to be computed.  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a + 0x10000 - 1) & -0x10000'.                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Fixed )\n  FT_CeilFix( FT_Fixed  a );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_FloorFix                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to compute the floor function of a     */\n  /*    16.16 fixed number.                                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The number for which the floor function is to be computed.    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `a & -0x10000'.                                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Fixed )\n  FT_FloorFix( FT_Fixed  a );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Vector_Transform                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Transform a single vector through a 2x2 matrix.                    */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    vector :: The target vector to transform.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix :: A pointer to the source 2x2 matrix.                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The result is undefined if either `vector' or `matrix' is invalid. */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Vector_Transform( FT_Vector*        vec,\n                       const FT_Matrix*  matrix );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    version                                                            */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    FreeType Version                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Functions and macros related to FreeType versions.                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Note that those functions and macros are of limited use because    */\n  /*    even a new release of FreeType with only documentation changes     */\n  /*    increases the version number.                                      */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Library_Version                                                 */\n  /*                                                                       */\n  /*    FREETYPE_MAJOR                                                     */\n  /*    FREETYPE_MINOR                                                     */\n  /*    FREETYPE_PATCH                                                     */\n  /*                                                                       */\n  /*    FT_Face_CheckTrueTypePatents                                       */\n  /*    FT_Face_SetUnpatentedHinting                                       */\n  /*                                                                       */\n  /*    FREETYPE_XXX                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FREETYPE_XXX\n   *\n   * @description:\n   *   These three macros identify the FreeType source code version.\n   *   Use @FT_Library_Version to access them at runtime.\n   *\n   * @values:\n   *   FREETYPE_MAJOR :: The major version number.\n   *   FREETYPE_MINOR :: The minor version number.\n   *   FREETYPE_PATCH :: The patch level.\n   *\n   * @note:\n   *   The version number of FreeType if built as a dynamic link library\n   *   with the `libtool' package is _not_ controlled by these three\n   *   macros.\n   *\n   */\n#define FREETYPE_MAJOR  2\n#define FREETYPE_MINOR  5\n#define FREETYPE_PATCH  5\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Library_Version                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the version of the FreeType library being used.  This is    */\n  /*    useful when dynamically linking to the library, since one cannot   */\n  /*    use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and               */\n  /*    @FREETYPE_PATCH.                                                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A source library handle.                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amajor  :: The major version number.                               */\n  /*                                                                       */\n  /*    aminor  :: The minor version number.                               */\n  /*                                                                       */\n  /*    apatch  :: The patch version number.                               */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The reason why this function takes a `library' argument is because */\n  /*    certain programs implement library initialization in a custom way  */\n  /*    that doesn't use @FT_Init_FreeType.                                */\n  /*                                                                       */\n  /*    In such cases, the library version might not be available before   */\n  /*    the library object has been created.                               */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Library_Version( FT_Library   library,\n                      FT_Int      *amajor,\n                      FT_Int      *aminor,\n                      FT_Int      *apatch );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_CheckTrueTypePatents                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Parse all bytecode instructions of a TrueType font file to check   */\n  /*    whether any of the patented opcodes are used.  This is only useful */\n  /*    if you want to be able to use the unpatented hinter with           */\n  /*    fonts that do *not* use these opcodes.                             */\n  /*                                                                       */\n  /*    Note that this function parses *all* glyph instructions in the     */\n  /*    font file, which may be slow.                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A face handle.                                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    1~if this is a TrueType font that uses one of the patented         */\n  /*    opcodes, 0~otherwise.                                              */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since May 2010, TrueType hinting is no longer patented.            */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.5                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Bool )\n  FT_Face_CheckTrueTypePatents( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_SetUnpatentedHinting                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Enable or disable the unpatented hinter for a given face.          */\n  /*    Only enable it if you have determined that the face doesn't        */\n  /*    use any patented opcodes (see @FT_Face_CheckTrueTypePatents).      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face  :: A face handle.                                            */\n  /*                                                                       */\n  /*    value :: New boolean setting.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The old setting value.  This will always be false if this is not   */\n  /*    an SFNT font, or if the unpatented hinter is not compiled in this  */\n  /*    instance of the library.                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since May 2010, TrueType hinting is no longer patented.            */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.5                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Bool )\n  FT_Face_SetUnpatentedHinting( FT_Face  face,\n                                FT_Bool  value );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FREETYPE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ft2build.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ft2build.h                                                             */\n/*                                                                         */\n/*    FreeType 2 build and setup macros.                                   */\n/*                                                                         */\n/*  Copyright 1996-2001, 2006, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This is the `entry point' for FreeType header file inclusions.  It is */\n  /* the only header file which should be included directly; all other     */\n  /* FreeType header files should be accessed with macro names (after      */\n  /* including `ft2build.h').                                              */\n  /*                                                                       */\n  /* A typical example is                                                  */\n  /*                                                                       */\n  /*   #include <ft2build.h>                                               */\n  /*   #include FT_FREETYPE_H                                              */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FT2BUILD_H__\n#define __FT2BUILD_H__\n\n#include <config/ftheader.h>\n\n#endif /* __FT2BUILD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftadvanc.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftadvanc.h                                                             */\n/*                                                                         */\n/*    Quick computation of advance widths (specification only).            */\n/*                                                                         */\n/*  Copyright 2008, 2013, 2014 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTADVANC_H__\n#define __FTADVANC_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   quick_advance\n   *\n   * @title:\n   *   Quick retrieval of advance values\n   *\n   * @abstract:\n   *   Retrieve horizontal and vertical advance values without processing\n   *   glyph outlines, if possible.\n   *\n   * @description:\n   *   This section contains functions to quickly extract advance values\n   *   without handling glyph outlines, if possible.\n   *\n   * @order:\n   *   FT_Get_Advance\n   *   FT_Get_Advances\n   *\n   */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    FT_ADVANCE_FLAG_FAST_ONLY                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A bit-flag to be OR-ed with the `flags' parameter of the           */\n  /*    @FT_Get_Advance and @FT_Get_Advances functions.                    */\n  /*                                                                       */\n  /*    If set, it indicates that you want these functions to fail if the  */\n  /*    corresponding hinting mode or font driver doesn't allow for very   */\n  /*    quick advance computation.                                         */\n  /*                                                                       */\n  /*    Typically, glyphs that are either unscaled, unhinted, bitmapped,   */\n  /*    or light-hinted can have their advance width computed very         */\n  /*    quickly.                                                           */\n  /*                                                                       */\n  /*    Normal and bytecode hinted modes that require loading, scaling,    */\n  /*    and hinting of the glyph outline, are extremely slow by            */\n  /*    comparison.                                                        */\n  /*                                                                       */\n#define FT_ADVANCE_FLAG_FAST_ONLY  0x20000000UL\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Advance                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the advance value of a given glyph outline in an          */\n  /*    @FT_Face.                                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face       :: The source @FT_Face handle.                          */\n  /*                                                                       */\n  /*    gindex     :: The glyph index.                                     */\n  /*                                                                       */\n  /*    load_flags :: A set of bit flags similar to those used when        */\n  /*                  calling @FT_Load_Glyph, used to determine what kind  */\n  /*                  of advances you need.                                */\n  /* <Output>                                                              */\n  /*    padvance :: The advance value.  If scaling is performed (based on  */\n  /*                the value of `load_flags'), the advance value is in    */\n  /*                16.16 format.  Otherwise, it is in font units.         */\n  /*                                                                       */\n  /*                If @FT_LOAD_VERTICAL_LAYOUT is set, this is the        */\n  /*                vertical advance corresponding to a vertical layout.   */\n  /*                Otherwise, it is the horizontal advance in a           */\n  /*                horizontal layout.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and   */\n  /*    if the corresponding font backend doesn't have a quick way to      */\n  /*    retrieve the advances.                                             */\n  /*                                                                       */\n  /*    A scaled advance is returned in 16.16 format but isn't transformed */\n  /*    by the affine transformation specified by @FT_Set_Transform.       */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Advance( FT_Face    face,\n                  FT_UInt    gindex,\n                  FT_Int32   load_flags,\n                  FT_Fixed  *padvance );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Advances                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the advance values of several glyph outlines in an        */\n  /*    @FT_Face.                                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: The source @FT_Face handle.                         */\n  /*                                                                       */\n  /*    start       :: The first glyph index.                              */\n  /*                                                                       */\n  /*    count       :: The number of advance values you want to retrieve.  */\n  /*                                                                       */\n  /*    load_flags  :: A set of bit flags similar to those used when       */\n  /*                   calling @FT_Load_Glyph.                             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    padvance :: The advance values.  This array, to be provided by the */\n  /*                caller, must contain at least `count' elements.        */\n  /*                                                                       */\n  /*                If scaling is performed (based on the value of         */\n  /*                `load_flags'), the advance values are in 16.16 format. */\n  /*                Otherwise, they are in font units.                     */\n  /*                                                                       */\n  /*                If @FT_LOAD_VERTICAL_LAYOUT is set, these are the      */\n  /*                vertical advances corresponding to a vertical layout.  */\n  /*                Otherwise, they are the horizontal advances in a       */\n  /*                horizontal layout.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and   */\n  /*    if the corresponding font backend doesn't have a quick way to      */\n  /*    retrieve the advances.                                             */\n  /*                                                                       */\n  /*    Scaled advances are returned in 16.16 format but aren't            */\n  /*    transformed by the affine transformation specified by              */\n  /*    @FT_Set_Transform.                                                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Advances( FT_Face    face,\n                   FT_UInt    start,\n                   FT_UInt    count,\n                   FT_Int32   load_flags,\n                   FT_Fixed  *padvances );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTADVANC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftautoh.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftautoh.h                                                              */\n/*                                                                         */\n/*    FreeType API for controlling the auto-hinter (specification only).   */\n/*                                                                         */\n/*  Copyright 2012, 2013 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTAUTOH_H__\n#define __FTAUTOH_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   auto_hinter\n   *\n   * @title:\n   *   The auto-hinter\n   *\n   * @abstract:\n   *   Controlling the auto-hinting module.\n   *\n   * @description:\n   *   While FreeType's auto-hinter doesn't expose API functions by itself,\n   *   it is possible to control its behaviour with @FT_Property_Set and\n   *   @FT_Property_Get.  The following lists the available properties\n   *   together with the necessary macros and structures.\n   *\n   *   Note that the auto-hinter's module name is `autofitter' for\n   *   historical reasons.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   glyph-to-script-map\n   *\n   * @description:\n   *   *Experimental* *only*\n   *\n   *   The auto-hinter provides various script modules to hint glyphs.\n   *   Examples of supported scripts are Latin or CJK.  Before a glyph is\n   *   auto-hinted, the Unicode character map of the font gets examined, and\n   *   the script is then determined based on Unicode character ranges, see\n   *   below.\n   *\n   *   OpenType fonts, however, often provide much more glyphs than\n   *   character codes (small caps, superscripts, ligatures, swashes, etc.),\n   *   to be controlled by so-called `features'.  Handling OpenType features\n   *   can be quite complicated and thus needs a separate library on top of\n   *   FreeType.\n   *\n   *   The mapping between glyph indices and scripts (in the auto-hinter\n   *   sense, see the @FT_AUTOHINTER_SCRIPT_XXX values) is stored as an\n   *   array with `num_glyphs' elements, as found in the font's @FT_Face\n   *   structure.  The `glyph-to-script-map' property returns a pointer to\n   *   this array, which can be modified as needed.  Note that the\n   *   modification should happen before the first glyph gets processed by\n   *   the auto-hinter so that the global analysis of the font shapes\n   *   actually uses the modified mapping.\n   *\n   *   The following example code demonstrates how to access it (omitting\n   *   the error handling).\n   *\n   *   {\n   *     FT_Library                library;\n   *     FT_Face                   face;\n   *     FT_Prop_GlyphToScriptMap  prop;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *     FT_New_Face( library, \"foo.ttf\", 0, &face );\n   *\n   *     prop.face = face;\n   *\n   *     FT_Property_Get( library, \"autofitter\",\n   *                               \"glyph-to-script-map\", &prop );\n   *\n   *     // adjust `prop.map' as needed right here\n   *\n   *     FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT );\n   *   }\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @enum:\n   *   FT_AUTOHINTER_SCRIPT_XXX\n   *\n   * @description:\n   *   *Experimental* *only*\n   *\n   *   A list of constants used for the @glyph-to-script-map property to\n   *   specify the script submodule the auto-hinter should use for hinting a\n   *   particular glyph.\n   *\n   * @values:\n   *   FT_AUTOHINTER_SCRIPT_NONE ::\n   *     Don't auto-hint this glyph.\n   *\n   *   FT_AUTOHINTER_SCRIPT_LATIN ::\n   *     Apply the latin auto-hinter.  For the auto-hinter, `latin' is a\n   *     very broad term, including Cyrillic and Greek also since characters\n   *     from those scripts share the same design constraints.\n   *\n   *     By default, characters from the following Unicode ranges are\n   *     assigned to this submodule.\n   *\n   *     {\n   *       U+0020 - U+007F  // Basic Latin (no control characters)\n   *       U+00A0 - U+00FF  // Latin-1 Supplement (no control characters)\n   *       U+0100 - U+017F  // Latin Extended-A\n   *       U+0180 - U+024F  // Latin Extended-B\n   *       U+0250 - U+02AF  // IPA Extensions\n   *       U+02B0 - U+02FF  // Spacing Modifier Letters\n   *       U+0300 - U+036F  // Combining Diacritical Marks\n   *       U+0370 - U+03FF  // Greek and Coptic\n   *       U+0400 - U+04FF  // Cyrillic\n   *       U+0500 - U+052F  // Cyrillic Supplement\n   *       U+1D00 - U+1D7F  // Phonetic Extensions\n   *       U+1D80 - U+1DBF  // Phonetic Extensions Supplement\n   *       U+1DC0 - U+1DFF  // Combining Diacritical Marks Supplement\n   *       U+1E00 - U+1EFF  // Latin Extended Additional\n   *       U+1F00 - U+1FFF  // Greek Extended\n   *       U+2000 - U+206F  // General Punctuation\n   *       U+2070 - U+209F  // Superscripts and Subscripts\n   *       U+20A0 - U+20CF  // Currency Symbols\n   *       U+2150 - U+218F  // Number Forms\n   *       U+2460 - U+24FF  // Enclosed Alphanumerics\n   *       U+2C60 - U+2C7F  // Latin Extended-C\n   *       U+2DE0 - U+2DFF  // Cyrillic Extended-A\n   *       U+2E00 - U+2E7F  // Supplemental Punctuation\n   *       U+A640 - U+A69F  // Cyrillic Extended-B\n   *       U+A720 - U+A7FF  // Latin Extended-D\n   *       U+FB00 - U+FB06  // Alphab. Present. Forms (Latin Ligatures)\n   *      U+1D400 - U+1D7FF // Mathematical Alphanumeric Symbols\n   *      U+1F100 - U+1F1FF // Enclosed Alphanumeric Supplement\n   *     }\n   *\n   *   FT_AUTOHINTER_SCRIPT_CJK ::\n   *     Apply the CJK auto-hinter, covering Chinese, Japanese, Korean, old\n   *     Vietnamese, and some other scripts.\n   *\n   *     By default, characters from the following Unicode ranges are\n   *     assigned to this submodule.\n   *\n   *     {\n   *       U+1100 - U+11FF  // Hangul Jamo\n   *       U+2E80 - U+2EFF  // CJK Radicals Supplement\n   *       U+2F00 - U+2FDF  // Kangxi Radicals\n   *       U+2FF0 - U+2FFF  // Ideographic Description Characters\n   *       U+3000 - U+303F  // CJK Symbols and Punctuation\n   *       U+3040 - U+309F  // Hiragana\n   *       U+30A0 - U+30FF  // Katakana\n   *       U+3100 - U+312F  // Bopomofo\n   *       U+3130 - U+318F  // Hangul Compatibility Jamo\n   *       U+3190 - U+319F  // Kanbun\n   *       U+31A0 - U+31BF  // Bopomofo Extended\n   *       U+31C0 - U+31EF  // CJK Strokes\n   *       U+31F0 - U+31FF  // Katakana Phonetic Extensions\n   *       U+3200 - U+32FF  // Enclosed CJK Letters and Months\n   *       U+3300 - U+33FF  // CJK Compatibility\n   *       U+3400 - U+4DBF  // CJK Unified Ideographs Extension A\n   *       U+4DC0 - U+4DFF  // Yijing Hexagram Symbols\n   *       U+4E00 - U+9FFF  // CJK Unified Ideographs\n   *       U+A960 - U+A97F  // Hangul Jamo Extended-A\n   *       U+AC00 - U+D7AF  // Hangul Syllables\n   *       U+D7B0 - U+D7FF  // Hangul Jamo Extended-B\n   *       U+F900 - U+FAFF  // CJK Compatibility Ideographs\n   *       U+FE10 - U+FE1F  // Vertical forms\n   *       U+FE30 - U+FE4F  // CJK Compatibility Forms\n   *       U+FF00 - U+FFEF  // Halfwidth and Fullwidth Forms\n   *      U+1B000 - U+1B0FF // Kana Supplement\n   *      U+1D300 - U+1D35F // Tai Xuan Hing Symbols\n   *      U+1F200 - U+1F2FF // Enclosed Ideographic Supplement\n   *      U+20000 - U+2A6DF // CJK Unified Ideographs Extension B\n   *      U+2A700 - U+2B73F // CJK Unified Ideographs Extension C\n   *      U+2B740 - U+2B81F // CJK Unified Ideographs Extension D\n   *      U+2F800 - U+2FA1F // CJK Compatibility Ideographs Supplement\n   *     }\n   *\n   *   FT_AUTOHINTER_SCRIPT_INDIC ::\n   *     Apply the indic auto-hinter, covering all major scripts from the\n   *     Indian sub-continent and some other related scripts like Thai, Lao,\n   *     or Tibetan.\n   *\n   *     By default, characters from the following Unicode ranges are\n   *     assigned to this submodule.\n   *\n   *     {\n   *       U+0900 - U+0DFF  // Indic Range\n   *       U+0F00 - U+0FFF  // Tibetan\n   *       U+1900 - U+194F  // Limbu\n   *       U+1B80 - U+1BBF  // Sundanese\n   *       U+1C80 - U+1CDF  // Meetei Mayak\n   *       U+A800 - U+A82F  // Syloti Nagri\n   *      U+11800 - U+118DF // Sharada\n   *     }\n   *\n   *     Note that currently Indic support is rudimentary only, missing blue\n   *     zone support.\n   *\n   */\n#define FT_AUTOHINTER_SCRIPT_NONE   0\n#define FT_AUTOHINTER_SCRIPT_LATIN  1\n#define FT_AUTOHINTER_SCRIPT_CJK    2\n#define FT_AUTOHINTER_SCRIPT_INDIC  3\n\n\n  /**************************************************************************\n   *\n   * @struct:\n   *   FT_Prop_GlyphToScriptMap\n   *\n   * @description:\n   *   *Experimental* *only*\n   *\n   *   The data exchange structure for the @glyph-to-script-map property.\n   *\n   */\n  typedef struct  FT_Prop_GlyphToScriptMap_\n  {\n    FT_Face   face;\n    FT_Byte*  map;\n\n  } FT_Prop_GlyphToScriptMap;\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   fallback-script\n   *\n   * @description:\n   *   *Experimental* *only*\n   *\n   *   If no auto-hinter script module can be assigned to a glyph, a\n   *   fallback script gets assigned to it (see also the\n   *   @glyph-to-script-map property).  By default, this is\n   *   @FT_AUTOHINTER_SCRIPT_CJK.  Using the `fallback-script' property,\n   *   this fallback value can be changed.\n   *\n   *   {\n   *     FT_Library  library;\n   *     FT_UInt     fallback_script = FT_AUTOHINTER_SCRIPT_NONE;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *\n   *     FT_Property_Set( library, \"autofitter\",\n   *                               \"fallback-script\", &fallback_script );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   *   It's important to use the right timing for changing this value: The\n   *   creation of the glyph-to-script map that eventually uses the\n   *   fallback script value gets triggered either by setting or reading a\n   *   face-specific property like @glyph-to-script-map, or by auto-hinting\n   *   any glyph from that face.  In particular, if you have already created\n   *   an @FT_Face structure but not loaded any glyph (using the\n   *   auto-hinter), a change of the fallback script will affect this face.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   default-script\n   *\n   * @description:\n   *   *Experimental* *only*\n   *\n   *   If Freetype gets compiled with FT_CONFIG_OPTION_USE_HARFBUZZ to make\n   *   the HarfBuzz library access OpenType features for getting better\n   *   glyph coverages, this property sets the (auto-fitter) script to be\n   *   used for the default (OpenType) script data of a font's GSUB table.\n   *   Features for the default script are intended for all scripts not\n   *   explicitly handled in GSUB; an example is a `dlig' feature,\n   *   containing the combination of the characters `T', `E', and `L' to\n   *   form a `TEL' ligature.\n   *\n   *   By default, this is @FT_AUTOHINTER_SCRIPT_LATIN.  Using the\n   *   `default-script' property, this default value can be changed.\n   *\n   *   {\n   *     FT_Library  library;\n   *     FT_UInt     default_script = FT_AUTOHINTER_SCRIPT_NONE;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *\n   *     FT_Property_Set( library, \"autofitter\",\n   *                               \"default-script\", &default_script );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   *   It's important to use the right timing for changing this value: The\n   *   creation of the glyph-to-script map that eventually uses the\n   *   default script value gets triggered either by setting or reading a\n   *   face-specific property like @glyph-to-script-map, or by auto-hinting\n   *   any glyph from that face.  In particular, if you have already created\n   *   an @FT_Face structure but not loaded any glyph (using the\n   *   auto-hinter), a change of the default script will affect this face.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   increase-x-height\n   *\n   * @description:\n   *   For ppem values in the range 6~<= ppem <= `increase-x-height', round\n   *   up the font's x~height much more often than normally.  If the value\n   *   is set to~0, which is the default, this feature is switched off.  Use\n   *   this property to improve the legibility of small font sizes if\n   *   necessary.\n   *\n   *   {\n   *     FT_Library               library;\n   *     FT_Face                  face;\n   *     FT_Prop_IncreaseXHeight  prop;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *     FT_New_Face( library, \"foo.ttf\", 0, &face );\n   *     FT_Set_Char_Size( face, 10 * 64, 0, 72, 0 );\n   *\n   *     prop.face  = face;\n   *     prop.limit = 14;\n   *\n   *     FT_Property_Set( library, \"autofitter\",\n   *                               \"increase-x-height\", &prop );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   *   Set this value right after calling @FT_Set_Char_Size, but before\n   *   loading any glyph (using the auto-hinter).\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @struct:\n   *   FT_Prop_IncreaseXHeight\n   *\n   * @description:\n   *   The data exchange structure for the @increase-x-height property.\n   *\n   */\n  typedef struct  FT_Prop_IncreaseXHeight_\n  {\n    FT_Face  face;\n    FT_UInt  limit;\n\n  } FT_Prop_IncreaseXHeight;\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTAUTOH_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftbbox.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbbox.h                                                               */\n/*                                                                         */\n/*    FreeType exact bbox computation (specification).                     */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2007, 2011, 2013 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This component has a _single_ role: to compute exact outline bounding */\n  /* boxes.                                                                */\n  /*                                                                       */\n  /* It is separated from the rest of the engine for various technical     */\n  /* reasons.  It may well be integrated in `ftoutln' later.               */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTBBOX_H__\n#define __FTBBOX_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    outline_processing                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Get_BBox                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Compute the exact bounding box of an outline.  This is slower      */\n  /*    than computing the control box.  However, it uses an advanced      */\n  /*    algorithm that returns _very_ quickly when the two boxes           */\n  /*    coincide.  Otherwise, the outline Bézier arcs are traversed to     */\n  /*    extract their extrema.                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline :: A pointer to the source outline.                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    abbox   :: The outline's exact bounding box.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If the font is tricky and the glyph has been loaded with           */\n  /*    @FT_LOAD_NO_SCALE, the resulting BBox is meaningless.  To get      */\n  /*    reasonable values for the BBox it is necessary to load the glyph   */\n  /*    at a large ppem value (so that the hinting instructions can        */\n  /*    properly shift and scale the subglyphs), then extracting the BBox, */\n  /*    which can be eventually converted back to font units.              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Get_BBox( FT_Outline*  outline,\n                       FT_BBox     *abbox );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTBBOX_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "ext/freetype2/include/ftbdf.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbdf.h                                                                */\n/*                                                                         */\n/*    FreeType API for accessing BDF-specific strings (specification).     */\n/*                                                                         */\n/*  Copyright 2002-2004, 2006, 2009, 2014 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTBDF_H__\n#define __FTBDF_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    bdf_fonts                                                          */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    BDF and PCF Files                                                  */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    BDF and PCF specific API.                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of functions specific to BDF */\n  /*    and PCF fonts.                                                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /**********************************************************************\n   *\n   * @enum:\n   *    BDF_PropertyType\n   *\n   * @description:\n   *    A list of BDF property types.\n   *\n   * @values:\n   *    BDF_PROPERTY_TYPE_NONE ::\n   *      Value~0 is used to indicate a missing property.\n   *\n   *    BDF_PROPERTY_TYPE_ATOM ::\n   *      Property is a string atom.\n   *\n   *    BDF_PROPERTY_TYPE_INTEGER ::\n   *      Property is a 32-bit signed integer.\n   *\n   *    BDF_PROPERTY_TYPE_CARDINAL ::\n   *      Property is a 32-bit unsigned integer.\n   */\n  typedef enum  BDF_PropertyType_\n  {\n    BDF_PROPERTY_TYPE_NONE     = 0,\n    BDF_PROPERTY_TYPE_ATOM     = 1,\n    BDF_PROPERTY_TYPE_INTEGER  = 2,\n    BDF_PROPERTY_TYPE_CARDINAL = 3\n\n  } BDF_PropertyType;\n\n\n  /**********************************************************************\n   *\n   * @type:\n   *    BDF_Property\n   *\n   * @description:\n   *    A handle to a @BDF_PropertyRec structure to model a given\n   *    BDF/PCF property.\n   */\n  typedef struct BDF_PropertyRec_*  BDF_Property;\n\n\n /**********************************************************************\n  *\n  * @struct:\n  *    BDF_PropertyRec\n  *\n  * @description:\n  *    This structure models a given BDF/PCF property.\n  *\n  * @fields:\n  *    type ::\n  *      The property type.\n  *\n  *    u.atom ::\n  *      The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.  May be\n  *      NULL, indicating an empty string.\n  *\n  *    u.integer ::\n  *      A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.\n  *\n  *    u.cardinal ::\n  *      An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.\n  */\n  typedef struct  BDF_PropertyRec_\n  {\n    BDF_PropertyType  type;\n    union {\n      const char*     atom;\n      FT_Int32        integer;\n      FT_UInt32       cardinal;\n\n    } u;\n\n  } BDF_PropertyRec;\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_BDF_Charset_ID\n  *\n  * @description:\n  *    Retrieve a BDF font character set identity, according to\n  *    the BDF specification.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  * @output:\n  *    acharset_encoding ::\n  *       Charset encoding, as a C~string, owned by the face.\n  *\n  *    acharset_registry ::\n  *       Charset registry, as a C~string, owned by the face.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function only works with BDF faces, returning an error otherwise.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_BDF_Charset_ID( FT_Face       face,\n                         const char*  *acharset_encoding,\n                         const char*  *acharset_registry );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_BDF_Property\n  *\n  * @description:\n  *    Retrieve a BDF property from a BDF or PCF font file.\n  *\n  * @input:\n  *    face :: A handle to the input face.\n  *\n  *    name :: The property name.\n  *\n  * @output:\n  *    aproperty :: The property.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function works with BDF _and_ PCF fonts.  It returns an error\n  *   otherwise.  It also returns an error if the property is not in the\n  *   font.\n  *\n  *   A `property' is a either key-value pair within the STARTPROPERTIES\n  *   ... ENDPROPERTIES block of a BDF font or a key-value pair from the\n  *   `info->props' array within a `FontRec' structure of a PCF font.\n  *\n  *   Integer properties are always stored as `signed' within PCF fonts;\n  *   consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value\n  *   for BDF fonts only.\n  *\n  *   In case of error, `aproperty->type' is always set to\n  *   @BDF_PROPERTY_TYPE_NONE.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_BDF_Property( FT_Face           face,\n                       const char*       prop_name,\n                       BDF_PropertyRec  *aproperty );\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __FTBDF_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftbitmap.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbitmap.h                                                             */\n/*                                                                         */\n/*    FreeType utility functions for bitmaps (specification).              */\n/*                                                                         */\n/*  Copyright 2004-2006, 2008, 2013, 2014 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTBITMAP_H__\n#define __FTBITMAP_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    bitmap_handling                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Bitmap Handling                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Handling FT_Bitmap objects.                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains functions for handling @FT_Bitmap objects.   */\n  /*    Note that none of the functions changes the bitmap's `flow' (as    */\n  /*    indicated by the sign of the `pitch' field in `FT_Bitmap').        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_New                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initialize a pointer to an @FT_Bitmap structure.                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    abitmap :: A pointer to the bitmap structure.                      */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Bitmap_New( FT_Bitmap  *abitmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Copy                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Copy a bitmap into another one.                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a library object.                           */\n  /*                                                                       */\n  /*    source  :: A handle to the source bitmap.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target  :: A handle to the target bitmap.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Copy( FT_Library        library,\n                  const FT_Bitmap  *source,\n                  FT_Bitmap        *target);\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Embolden                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Embolden a bitmap.  The new bitmap will be about `xStrength'       */\n  /*    pixels wider and `yStrength' pixels higher.  The left and bottom   */\n  /*    borders are kept unchanged.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library   :: A handle to a library object.                         */\n  /*                                                                       */\n  /*    xStrength :: How strong the glyph is emboldened horizontally.      */\n  /*                 Expressed in 26.6 pixel format.                       */\n  /*                                                                       */\n  /*    yStrength :: How strong the glyph is emboldened vertically.        */\n  /*                 Expressed in 26.6 pixel format.                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    bitmap    :: A handle to the target bitmap.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The current implementation restricts `xStrength' to be less than   */\n  /*    or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO.      */\n  /*                                                                       */\n  /*    If you want to embolden the bitmap owned by a @FT_GlyphSlotRec,    */\n  /*    you should call @FT_GlyphSlot_Own_Bitmap on the slot first.        */\n  /*                                                                       */\n  /*    Bitmaps in @FT_PIXEL_MODE_GRAY2 and @FT_PIXEL_MODE_GRAY@ format    */\n  /*    are converted to @FT_PIXEL_MODE_GRAY format (i.e., 8bpp).          */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Embolden( FT_Library  library,\n                      FT_Bitmap*  bitmap,\n                      FT_Pos      xStrength,\n                      FT_Pos      yStrength );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Convert                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp */\n  /*    to a bitmap object with depth 8bpp, making the number of used      */\n  /*    bytes line (a.k.a. the `pitch') a multiple of `alignment'.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library   :: A handle to a library object.                         */\n  /*                                                                       */\n  /*    source    :: The source bitmap.                                    */\n  /*                                                                       */\n  /*    alignment :: The pitch of the bitmap is a multiple of this         */\n  /*                 parameter.  Common values are 1, 2, or 4.             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target    :: The target bitmap.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    It is possible to call @FT_Bitmap_Convert multiple times without   */\n  /*    calling @FT_Bitmap_Done (the memory is simply reallocated).        */\n  /*                                                                       */\n  /*    Use @FT_Bitmap_Done to finally remove the bitmap object.           */\n  /*                                                                       */\n  /*    The `library' argument is taken to have access to FreeType's       */\n  /*    memory handling functions.                                         */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Convert( FT_Library        library,\n                     const FT_Bitmap  *source,\n                     FT_Bitmap        *target,\n                     FT_Int            alignment );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GlyphSlot_Own_Bitmap                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Make sure that a glyph slot owns `slot->bitmap'.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    slot :: The glyph slot.                                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is to be used in combination with                    */\n  /*    @FT_Bitmap_Embolden.                                               */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot  slot );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Done                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a bitmap object created with @FT_Bitmap_New.               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a library object.                           */\n  /*                                                                       */\n  /*    bitmap  :: The bitmap object to be freed.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `library' argument is taken to have access to FreeType's       */\n  /*    memory handling functions.                                         */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Done( FT_Library  library,\n                  FT_Bitmap  *bitmap );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTBITMAP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftbzip2.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbzip2.h                                                              */\n/*                                                                         */\n/*    Bzip2-compressed stream support.                                     */\n/*                                                                         */\n/*  Copyright 2010 by                                                      */\n/*  Joel Klinghed.                                                         */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTBZIP2_H__\n#define __FTBZIP2_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    bzip2                                                              */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    BZIP2 Streams                                                      */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Using bzip2-compressed font files.                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of Bzip2-specific functions. */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /************************************************************************\n  *\n  * @function:\n  *   FT_Stream_OpenBzip2\n  *\n  * @description:\n  *   Open a new stream to parse bzip2-compressed font files.  This is\n  *   mainly used to support the compressed `*.pcf.bz2' fonts that come\n  *   with XFree86.\n  *\n  * @input:\n  *   stream ::\n  *     The target embedding stream.\n  *\n  *   source ::\n  *     The source stream.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   The source stream must be opened _before_ calling this function.\n  *\n  *   Calling the internal function `FT_Stream_Close' on the new stream will\n  *   *not* call `FT_Stream_Close' on the source stream.  None of the stream\n  *   objects will be released to the heap.\n  *\n  *   The stream implementation is very basic and resets the decompression\n  *   process each time seeking backwards is needed within the stream.\n  *\n  *   In certain builds of the library, bzip2 compression recognition is\n  *   automatically handled when calling @FT_New_Face or @FT_Open_Face.\n  *   This means that if no font driver is capable of handling the raw\n  *   compressed file, the library will try to open a bzip2 compressed stream\n  *   from it and re-open the face with it.\n  *\n  *   This function may return `FT_Err_Unimplemented_Feature' if your build\n  *   of FreeType was not compiled with bzip2 support.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Stream_OpenBzip2( FT_Stream  stream,\n                       FT_Stream  source );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTBZIP2_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftcache.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcache.h                                                              */\n/*                                                                         */\n/*    FreeType Cache subsystem (specification).                            */\n/*                                                                         */\n/*  Copyright 1996-2008, 2010, 2013, 2014 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCACHE_H__\n#define __FTCACHE_H__\n\n\n#include <ft2build.h>\n#include FT_GLYPH_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************\n   *\n   * <Section>\n   *    cache_subsystem\n   *\n   * <Title>\n   *    Cache Sub-System\n   *\n   * <Abstract>\n   *    How to cache face, size, and glyph data with FreeType~2.\n   *\n   * <Description>\n   *   This section describes the FreeType~2 cache sub-system, which is used\n   *   to limit the number of concurrently opened @FT_Face and @FT_Size\n   *   objects, as well as caching information like character maps and glyph\n   *   images while limiting their maximum memory usage.\n   *\n   *   Note that all types and functions begin with the `FTC_' prefix.\n   *\n   *   The cache is highly portable and thus doesn't know anything about the\n   *   fonts installed on your system, or how to access them.  This implies\n   *   the following scheme:\n   *\n   *   First, available or installed font faces are uniquely identified by\n   *   @FTC_FaceID values, provided to the cache by the client.  Note that\n   *   the cache only stores and compares these values, and doesn't try to\n   *   interpret them in any way.\n   *\n   *   Second, the cache calls, only when needed, a client-provided function\n   *   to convert an @FTC_FaceID into a new @FT_Face object.  The latter is\n   *   then completely managed by the cache, including its termination\n   *   through @FT_Done_Face.  To monitor termination of face objects, the\n   *   finalizer callback in the `generic' field of the @FT_Face object can\n   *   be used, which might also be used to store the @FTC_FaceID of the\n   *   face.\n   *\n   *   Clients are free to map face IDs to anything else.  The most simple\n   *   usage is to associate them to a (pathname,face_index) pair that is\n   *   used to call @FT_New_Face.  However, more complex schemes are also\n   *   possible.\n   *\n   *   Note that for the cache to work correctly, the face ID values must be\n   *   *persistent*, which means that the contents they point to should not\n   *   change at runtime, or that their value should not become invalid.\n   *\n   *   If this is unavoidable (e.g., when a font is uninstalled at runtime),\n   *   you should call @FTC_Manager_RemoveFaceID as soon as possible, to let\n   *   the cache get rid of any references to the old @FTC_FaceID it may\n   *   keep internally.  Failure to do so will lead to incorrect behaviour\n   *   or even crashes.\n   *\n   *   To use the cache, start with calling @FTC_Manager_New to create a new\n   *   @FTC_Manager object, which models a single cache instance.  You can\n   *   then look up @FT_Face and @FT_Size objects with\n   *   @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively.\n   *\n   *   If you want to use the charmap caching, call @FTC_CMapCache_New, then\n   *   later use @FTC_CMapCache_Lookup to perform the equivalent of\n   *   @FT_Get_Char_Index, only much faster.\n   *\n   *   If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then\n   *   later use @FTC_ImageCache_Lookup to retrieve the corresponding\n   *   @FT_Glyph objects from the cache.\n   *\n   *   If you need lots of small bitmaps, it is much more memory efficient\n   *   to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup.  This\n   *   returns @FTC_SBitRec structures, which are used to store small\n   *   bitmaps directly.  (A small bitmap is one whose metrics and\n   *   dimensions all fit into 8-bit integers).\n   *\n   *   We hope to also provide a kerning cache in the near future.\n   *\n   *\n   * <Order>\n   *   FTC_Manager\n   *   FTC_FaceID\n   *   FTC_Face_Requester\n   *\n   *   FTC_Manager_New\n   *   FTC_Manager_Reset\n   *   FTC_Manager_Done\n   *   FTC_Manager_LookupFace\n   *   FTC_Manager_LookupSize\n   *   FTC_Manager_RemoveFaceID\n   *\n   *   FTC_Node\n   *   FTC_Node_Unref\n   *\n   *   FTC_ImageCache\n   *   FTC_ImageCache_New\n   *   FTC_ImageCache_Lookup\n   *\n   *   FTC_SBit\n   *   FTC_SBitCache\n   *   FTC_SBitCache_New\n   *   FTC_SBitCache_Lookup\n   *\n   *   FTC_CMapCache\n   *   FTC_CMapCache_New\n   *   FTC_CMapCache_Lookup\n   *\n   *************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    BASIC TYPE DEFINITIONS                     *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type: FTC_FaceID\n   *\n   * @description:\n   *   An opaque pointer type that is used to identity face objects.  The\n   *   contents of such objects is application-dependent.\n   *\n   *   These pointers are typically used to point to a user-defined\n   *   structure containing a font file path, and face index.\n   *\n   * @note:\n   *   Never use NULL as a valid @FTC_FaceID.\n   *\n   *   Face IDs are passed by the client to the cache manager that calls,\n   *   when needed, the @FTC_Face_Requester to translate them into new\n   *   @FT_Face objects.\n   *\n   *   If the content of a given face ID changes at runtime, or if the value\n   *   becomes invalid (e.g., when uninstalling a font), you should\n   *   immediately call @FTC_Manager_RemoveFaceID before any other cache\n   *   function.\n   *\n   *   Failure to do so will result in incorrect behaviour or even\n   *   memory leaks and crashes.\n   */\n  typedef FT_Pointer  FTC_FaceID;\n\n\n  /************************************************************************\n   *\n   * @functype:\n   *   FTC_Face_Requester\n   *\n   * @description:\n   *   A callback function provided by client applications.  It is used by\n   *   the cache manager to translate a given @FTC_FaceID into a new valid\n   *   @FT_Face object, on demand.\n   *\n   * <Input>\n   *   face_id ::\n   *     The face ID to resolve.\n   *\n   *   library ::\n   *     A handle to a FreeType library object.\n   *\n   *   req_data ::\n   *     Application-provided request data (see note below).\n   *\n   * <Output>\n   *   aface ::\n   *     A new @FT_Face handle.\n   *\n   * <Return>\n   *   FreeType error code.  0~means success.\n   *\n   * <Note>\n   *   The third parameter `req_data' is the same as the one passed by the\n   *   client when @FTC_Manager_New is called.\n   *\n   *   The face requester should not perform funny things on the returned\n   *   face object, like creating a new @FT_Size for it, or setting a\n   *   transformation through @FT_Set_Transform!\n   */\n  typedef FT_Error\n  (*FTC_Face_Requester)( FTC_FaceID  face_id,\n                         FT_Library  library,\n                         FT_Pointer  req_data,\n                         FT_Face*    aface );\n\n  /* */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      CACHE MANAGER OBJECT                     *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_Manager                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This object corresponds to one instance of the cache-subsystem.    */\n  /*    It is used to cache one or more @FT_Face objects, along with       */\n  /*    corresponding @FT_Size objects.                                    */\n  /*                                                                       */\n  /*    The manager intentionally limits the total number of opened        */\n  /*    @FT_Face and @FT_Size objects to control memory usage.  See the    */\n  /*    `max_faces' and `max_sizes' parameters of @FTC_Manager_New.        */\n  /*                                                                       */\n  /*    The manager is also used to cache `nodes' of various types while   */\n  /*    limiting their total memory usage.                                 */\n  /*                                                                       */\n  /*    All limitations are enforced by keeping lists of managed objects   */\n  /*    in most-recently-used order, and flushing old nodes to make room   */\n  /*    for new ones.                                                      */\n  /*                                                                       */\n  typedef struct FTC_ManagerRec_*  FTC_Manager;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_Node                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to a cache node object.  Each cache node is       */\n  /*    reference-counted.  A node with a count of~0 might be flushed      */\n  /*    out of a full cache whenever a lookup request is performed.        */\n  /*                                                                       */\n  /*    If you look up nodes, you have the ability to `acquire' them,      */\n  /*    i.e., to increment their reference count.  This will prevent the   */\n  /*    node from being flushed out of the cache until you explicitly      */\n  /*    `release' it (see @FTC_Node_Unref).                                */\n  /*                                                                       */\n  /*    See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup.         */\n  /*                                                                       */\n  typedef struct FTC_NodeRec_*  FTC_Node;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_New                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new cache manager.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library   :: The parent FreeType library handle to use.            */\n  /*                                                                       */\n  /*    max_faces :: Maximum number of opened @FT_Face objects managed by  */\n  /*                 this cache instance.  Use~0 for defaults.             */\n  /*                                                                       */\n  /*    max_sizes :: Maximum number of opened @FT_Size objects managed by  */\n  /*                 this cache instance.  Use~0 for defaults.             */\n  /*                                                                       */\n  /*    max_bytes :: Maximum number of bytes to use for cached data nodes. */\n  /*                 Use~0 for defaults.  Note that this value does not    */\n  /*                 account for managed @FT_Face and @FT_Size objects.    */\n  /*                                                                       */\n  /*    requester :: An application-provided callback used to translate    */\n  /*                 face IDs into real @FT_Face objects.                  */\n  /*                                                                       */\n  /*    req_data  :: A generic pointer that is passed to the requester     */\n  /*                 each time it is called (see @FTC_Face_Requester).     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amanager  :: A handle to a new manager object.  0~in case of       */\n  /*                 failure.                                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_Manager_New( FT_Library          library,\n                   FT_UInt             max_faces,\n                   FT_UInt             max_sizes,\n                   FT_ULong            max_bytes,\n                   FTC_Face_Requester  requester,\n                   FT_Pointer          req_data,\n                   FTC_Manager        *amanager );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_Reset                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Empty a given cache manager.  This simply gets rid of all the      */\n  /*    currently cached @FT_Face and @FT_Size objects within the manager. */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    manager :: A handle to the manager.                                */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FTC_Manager_Reset( FTC_Manager  manager );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_Done                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a given manager after emptying it.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the target cache manager object.            */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FTC_Manager_Done( FTC_Manager  manager );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_LookupFace                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the @FT_Face object that corresponds to a given face ID   */\n  /*    through a cache manager.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the cache manager.                          */\n  /*                                                                       */\n  /*    face_id :: The ID of the face object.                              */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface   :: A handle to the face object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned @FT_Face object is always owned by the manager.  You  */\n  /*    should never try to discard it yourself.                           */\n  /*                                                                       */\n  /*    The @FT_Face object doesn't necessarily have a current size object */\n  /*    (i.e., face->size can be~0).  If you need a specific `font size',  */\n  /*    use @FTC_Manager_LookupSize instead.                               */\n  /*                                                                       */\n  /*    Never change the face's transformation matrix (i.e., never call    */\n  /*    the @FT_Set_Transform function) on a returned face!  If you need   */\n  /*    to transform glyphs, do it yourself after glyph loading.           */\n  /*                                                                       */\n  /*    When you perform a lookup, out-of-memory errors are detected       */\n  /*    _within_ the lookup and force incremental flushes of the cache     */\n  /*    until enough memory is released for the lookup to succeed.         */\n  /*                                                                       */\n  /*    If a lookup fails with `FT_Err_Out_Of_Memory' the cache has        */\n  /*    already been completely flushed, and still no memory was available */\n  /*    for the operation.                                                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_Manager_LookupFace( FTC_Manager  manager,\n                          FTC_FaceID   face_id,\n                          FT_Face     *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FTC_ScalerRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to describe a given character size in either      */\n  /*    pixels or points to the cache manager.  See                        */\n  /*    @FTC_Manager_LookupSize.                                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face_id :: The source face ID.                                     */\n  /*                                                                       */\n  /*    width   :: The character width.                                    */\n  /*                                                                       */\n  /*    height  :: The character height.                                   */\n  /*                                                                       */\n  /*    pixel   :: A Boolean.  If 1, the `width' and `height' fields are   */\n  /*               interpreted as integer pixel character sizes.           */\n  /*               Otherwise, they are expressed as 1/64th of points.      */\n  /*                                                                       */\n  /*    x_res   :: Only used when `pixel' is value~0 to indicate the       */\n  /*               horizontal resolution in dpi.                           */\n  /*                                                                       */\n  /*    y_res   :: Only used when `pixel' is value~0 to indicate the       */\n  /*               vertical resolution in dpi.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This type is mainly used to retrieve @FT_Size objects through the  */\n  /*    cache manager.                                                     */\n  /*                                                                       */\n  typedef struct  FTC_ScalerRec_\n  {\n    FTC_FaceID  face_id;\n    FT_UInt     width;\n    FT_UInt     height;\n    FT_Int      pixel;\n    FT_UInt     x_res;\n    FT_UInt     y_res;\n\n  } FTC_ScalerRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FTC_Scaler                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an @FTC_ScalerRec structure.                           */\n  /*                                                                       */\n  typedef struct FTC_ScalerRec_*  FTC_Scaler;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_LookupSize                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the @FT_Size object that corresponds to a given           */\n  /*    @FTC_ScalerRec pointer through a cache manager.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the cache manager.                          */\n  /*                                                                       */\n  /*    scaler  :: A scaler handle.                                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    asize   :: A handle to the size object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned @FT_Size object is always owned by the manager.  You  */\n  /*    should never try to discard it by yourself.                        */\n  /*                                                                       */\n  /*    You can access the parent @FT_Face object simply as `size->face'   */\n  /*    if you need it.  Note that this object is also owned by the        */\n  /*    manager.                                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    When you perform a lookup, out-of-memory errors are detected       */\n  /*    _within_ the lookup and force incremental flushes of the cache     */\n  /*    until enough memory is released for the lookup to succeed.         */\n  /*                                                                       */\n  /*    If a lookup fails with `FT_Err_Out_Of_Memory' the cache has        */\n  /*    already been completely flushed, and still no memory is available  */\n  /*    for the operation.                                                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_Manager_LookupSize( FTC_Manager  manager,\n                          FTC_Scaler   scaler,\n                          FT_Size     *asize );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Node_Unref                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Decrement a cache node's internal reference count.  When the count */\n  /*    reaches 0, it is not destroyed but becomes eligible for subsequent */\n  /*    cache flushes.                                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    node    :: The cache node handle.                                  */\n  /*                                                                       */\n  /*    manager :: The cache manager handle.                               */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FTC_Node_Unref( FTC_Node     node,\n                  FTC_Manager  manager );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FTC_Manager_RemoveFaceID\n   *\n   * @description:\n   *   A special function used to indicate to the cache manager that\n   *   a given @FTC_FaceID is no longer valid, either because its\n   *   content changed, or because it was deallocated or uninstalled.\n   *\n   * @input:\n   *   manager ::\n   *     The cache manager handle.\n   *\n   *   face_id ::\n   *     The @FTC_FaceID to be removed.\n   *\n   * @note:\n   *   This function flushes all nodes from the cache corresponding to this\n   *   `face_id', with the exception of nodes with a non-null reference\n   *   count.\n   *\n   *   Such nodes are however modified internally so as to never appear\n   *   in later lookups with the same `face_id' value, and to be immediately\n   *   destroyed when released by all their users.\n   *\n   */\n  FT_EXPORT( void )\n  FTC_Manager_RemoveFaceID( FTC_Manager  manager,\n                            FTC_FaceID   face_id );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    cache_subsystem                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FTC_CMapCache\n   *\n   * @description:\n   *   An opaque handle used to model a charmap cache.  This cache is to\n   *   hold character codes -> glyph indices mappings.\n   *\n   */\n  typedef struct FTC_CMapCacheRec_*  FTC_CMapCache;\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FTC_CMapCache_New\n   *\n   * @description:\n   *   Create a new charmap cache.\n   *\n   * @input:\n   *   manager ::\n   *     A handle to the cache manager.\n   *\n   * @output:\n   *   acache ::\n   *     A new cache handle.  NULL in case of error.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   Like all other caches, this one will be destroyed with the cache\n   *   manager.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FTC_CMapCache_New( FTC_Manager     manager,\n                     FTC_CMapCache  *acache );\n\n\n  /************************************************************************\n   *\n   * @function:\n   *   FTC_CMapCache_Lookup\n   *\n   * @description:\n   *   Translate a character code into a glyph index, using the charmap\n   *   cache.\n   *\n   * @input:\n   *   cache ::\n   *     A charmap cache handle.\n   *\n   *   face_id ::\n   *     The source face ID.\n   *\n   *   cmap_index ::\n   *     The index of the charmap in the source face.  Any negative value\n   *     means to use the cache @FT_Face's default charmap.\n   *\n   *   char_code ::\n   *     The character code (in the corresponding charmap).\n   *\n   * @return:\n   *    Glyph index.  0~means `no glyph'.\n   *\n   */\n  FT_EXPORT( FT_UInt )\n  FTC_CMapCache_Lookup( FTC_CMapCache  cache,\n                        FTC_FaceID     face_id,\n                        FT_Int         cmap_index,\n                        FT_UInt32      char_code );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    cache_subsystem                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       IMAGE CACHE OBJECT                      *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FTC_ImageTypeRec\n   *\n   * @description:\n   *   A structure used to model the type of images in a glyph cache.\n   *\n   * @fields:\n   *   face_id ::\n   *     The face ID.\n   *\n   *   width ::\n   *     The width in pixels.\n   *\n   *   height ::\n   *     The height in pixels.\n   *\n   *   flags ::\n   *     The load flags, as in @FT_Load_Glyph.\n   *\n   */\n  typedef struct  FTC_ImageTypeRec_\n  {\n    FTC_FaceID  face_id;\n    FT_Int      width;\n    FT_Int      height;\n    FT_Int32    flags;\n\n  } FTC_ImageTypeRec;\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FTC_ImageType\n   *\n   * @description:\n   *   A handle to an @FTC_ImageTypeRec structure.\n   *\n   */\n  typedef struct FTC_ImageTypeRec_*  FTC_ImageType;\n\n\n  /* */\n\n\n#define FTC_IMAGE_TYPE_COMPARE( d1, d2 )      \\\n          ( (d1)->face_id == (d2)->face_id && \\\n            (d1)->width   == (d2)->width   && \\\n            (d1)->flags   == (d2)->flags   )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_ImageCache                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a glyph image cache object.  They are designed to      */\n  /*    hold many distinct glyph images while not exceeding a certain      */\n  /*    memory threshold.                                                  */\n  /*                                                                       */\n  typedef struct FTC_ImageCacheRec_*  FTC_ImageCache;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_ImageCache_New                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new glyph image cache.                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: The parent manager for the image cache.                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acache  :: A handle to the new glyph image cache object.           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_ImageCache_New( FTC_Manager      manager,\n                      FTC_ImageCache  *acache );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_ImageCache_Lookup                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve a given glyph image from a glyph image cache.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache  :: A handle to the source glyph image cache.                */\n  /*                                                                       */\n  /*    type   :: A pointer to a glyph image type descriptor.              */\n  /*                                                                       */\n  /*    gindex :: The glyph index to retrieve.                             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aglyph :: The corresponding @FT_Glyph object.  0~in case of        */\n  /*              failure.                                                 */\n  /*                                                                       */\n  /*    anode  :: Used to return the address of of the corresponding cache */\n  /*              node after incrementing its reference count (see note    */\n  /*              below).                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned glyph is owned and managed by the glyph image cache.  */\n  /*    Never try to transform or discard it manually!  You can however    */\n  /*    create a copy with @FT_Glyph_Copy and modify the new one.          */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the glyph image, after increasing its reference    */\n  /*    count.  This ensures that the node (as well as the @FT_Glyph) will */\n  /*    always be kept in the cache until you call @FTC_Node_Unref to      */\n  /*    `release' it.                                                      */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the @FT_Glyph could be flushed out of the cache on the next   */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_ImageCache_Lookup( FTC_ImageCache  cache,\n                         FTC_ImageType   type,\n                         FT_UInt         gindex,\n                         FT_Glyph       *aglyph,\n                         FTC_Node       *anode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_ImageCache_LookupScaler                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A variant of @FTC_ImageCache_Lookup that uses an @FTC_ScalerRec    */\n  /*    to specify the face ID and its size.                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache      :: A handle to the source glyph image cache.            */\n  /*                                                                       */\n  /*    scaler     :: A pointer to a scaler descriptor.                    */\n  /*                                                                       */\n  /*    load_flags :: The corresponding load flags.                        */\n  /*                                                                       */\n  /*    gindex     :: The glyph index to retrieve.                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aglyph     :: The corresponding @FT_Glyph object.  0~in case of    */\n  /*                  failure.                                             */\n  /*                                                                       */\n  /*    anode      :: Used to return the address of of the corresponding   */\n  /*                  cache node after incrementing its reference count    */\n  /*                  (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned glyph is owned and managed by the glyph image cache.  */\n  /*    Never try to transform or discard it manually!  You can however    */\n  /*    create a copy with @FT_Glyph_Copy and modify the new one.          */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the glyph image, after increasing its reference    */\n  /*    count.  This ensures that the node (as well as the @FT_Glyph) will */\n  /*    always be kept in the cache until you call @FTC_Node_Unref to      */\n  /*    `release' it.                                                      */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the @FT_Glyph could be flushed out of the cache on the next   */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  /*    Calls to @FT_Set_Char_Size and friends have no effect on cached    */\n  /*    glyphs; you should always use the FreeType cache API instead.      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_ImageCache_LookupScaler( FTC_ImageCache  cache,\n                               FTC_Scaler      scaler,\n                               FT_ULong        load_flags,\n                               FT_UInt         gindex,\n                               FT_Glyph       *aglyph,\n                               FTC_Node       *anode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_SBit                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a small bitmap descriptor.  See the @FTC_SBitRec       */\n  /*    structure for details.                                             */\n  /*                                                                       */\n  typedef struct FTC_SBitRec_*  FTC_SBit;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FTC_SBitRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very compact structure used to describe a small glyph bitmap.    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    width     :: The bitmap width in pixels.                           */\n  /*                                                                       */\n  /*    height    :: The bitmap height in pixels.                          */\n  /*                                                                       */\n  /*    left      :: The horizontal distance from the pen position to the  */\n  /*                 left bitmap border (a.k.a. `left side bearing', or    */\n  /*                 `lsb').                                               */\n  /*                                                                       */\n  /*    top       :: The vertical distance from the pen position (on the   */\n  /*                 baseline) to the upper bitmap border (a.k.a. `top     */\n  /*                 side bearing').  The distance is positive for upwards */\n  /*                 y~coordinates.                                        */\n  /*                                                                       */\n  /*    format    :: The format of the glyph bitmap (monochrome or gray).  */\n  /*                                                                       */\n  /*    max_grays :: Maximum gray level value (in the range 1 to~255).     */\n  /*                                                                       */\n  /*    pitch     :: The number of bytes per bitmap line.  May be positive */\n  /*                 or negative.                                          */\n  /*                                                                       */\n  /*    xadvance  :: The horizontal advance width in pixels.               */\n  /*                                                                       */\n  /*    yadvance  :: The vertical advance height in pixels.                */\n  /*                                                                       */\n  /*    buffer    :: A pointer to the bitmap pixels.                       */\n  /*                                                                       */\n  typedef struct  FTC_SBitRec_\n  {\n    FT_Byte   width;\n    FT_Byte   height;\n    FT_Char   left;\n    FT_Char   top;\n\n    FT_Byte   format;\n    FT_Byte   max_grays;\n    FT_Short  pitch;\n    FT_Char   xadvance;\n    FT_Char   yadvance;\n\n    FT_Byte*  buffer;\n\n  } FTC_SBitRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_SBitCache                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a small bitmap cache.  These are special cache objects */\n  /*    used to store small glyph bitmaps (and anti-aliased pixmaps) in a  */\n  /*    much more efficient way than the traditional glyph image cache     */\n  /*    implemented by @FTC_ImageCache.                                    */\n  /*                                                                       */\n  typedef struct FTC_SBitCacheRec_*  FTC_SBitCache;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_SBitCache_New                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new cache to store small glyph bitmaps.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the source cache manager.                   */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acache  :: A handle to the new sbit cache.  NULL in case of error. */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_SBitCache_New( FTC_Manager     manager,\n                     FTC_SBitCache  *acache );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_SBitCache_Lookup                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Look up a given small glyph bitmap in a given sbit cache and       */\n  /*    `lock' it to prevent its flushing from the cache until needed.     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache  :: A handle to the source sbit cache.                       */\n  /*                                                                       */\n  /*    type   :: A pointer to the glyph image type descriptor.            */\n  /*                                                                       */\n  /*    gindex :: The glyph index.                                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    sbit   :: A handle to a small bitmap descriptor.                   */\n  /*                                                                       */\n  /*    anode  :: Used to return the address of of the corresponding cache */\n  /*              node after incrementing its reference count (see note    */\n  /*              below).                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The small bitmap descriptor and its bit buffer are owned by the    */\n  /*    cache and should never be freed by the application.  They might    */\n  /*    as well disappear from memory on the next cache lookup, so don't   */\n  /*    treat them as persistent data.                                     */\n  /*                                                                       */\n  /*    The descriptor's `buffer' field is set to~0 to indicate a missing  */\n  /*    glyph bitmap.                                                      */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the bitmap, after increasing its reference count.  */\n  /*    This ensures that the node (as well as the image) will always be   */\n  /*    kept in the cache until you call @FTC_Node_Unref to `release' it.  */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the bitmap could be flushed out of the cache on the next      */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_SBitCache_Lookup( FTC_SBitCache    cache,\n                        FTC_ImageType    type,\n                        FT_UInt          gindex,\n                        FTC_SBit        *sbit,\n                        FTC_Node        *anode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_SBitCache_LookupScaler                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A variant of @FTC_SBitCache_Lookup that uses an @FTC_ScalerRec     */\n  /*    to specify the face ID and its size.                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache      :: A handle to the source sbit cache.                   */\n  /*                                                                       */\n  /*    scaler     :: A pointer to the scaler descriptor.                  */\n  /*                                                                       */\n  /*    load_flags :: The corresponding load flags.                        */\n  /*                                                                       */\n  /*    gindex     :: The glyph index.                                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    sbit       :: A handle to a small bitmap descriptor.               */\n  /*                                                                       */\n  /*    anode      :: Used to return the address of of the corresponding   */\n  /*                  cache node after incrementing its reference count    */\n  /*                  (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The small bitmap descriptor and its bit buffer are owned by the    */\n  /*    cache and should never be freed by the application.  They might    */\n  /*    as well disappear from memory on the next cache lookup, so don't   */\n  /*    treat them as persistent data.                                     */\n  /*                                                                       */\n  /*    The descriptor's `buffer' field is set to~0 to indicate a missing  */\n  /*    glyph bitmap.                                                      */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the bitmap, after increasing its reference count.  */\n  /*    This ensures that the node (as well as the image) will always be   */\n  /*    kept in the cache until you call @FTC_Node_Unref to `release' it.  */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the bitmap could be flushed out of the cache on the next      */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_SBitCache_LookupScaler( FTC_SBitCache  cache,\n                              FTC_Scaler     scaler,\n                              FT_ULong       load_flags,\n                              FT_UInt        gindex,\n                              FTC_SBit      *sbit,\n                              FTC_Node      *anode );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTCACHE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftcffdrv.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcffdrv.h                                                             */\n/*                                                                         */\n/*    FreeType API for controlling the CFF driver (specification only).    */\n/*                                                                         */\n/*  Copyright 2013, 2014 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCFFDRV_H__\n#define __FTCFFDRV_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   cff_driver\n   *\n   * @title:\n   *   The CFF driver\n   *\n   * @abstract:\n   *   Controlling the CFF driver module.\n   *\n   * @description:\n   *   While FreeType's CFF driver doesn't expose API functions by itself,\n   *   it is possible to control its behaviour with @FT_Property_Set and\n   *   @FT_Property_Get.  The list below gives the available properties\n   *   together with the necessary macros and structures.\n   *\n   *   The CFF driver's module name is `cff'.\n   *\n   *   *Hinting* *and* *antialiasing* *principles* *of* *the* *new* *engine*\n   *\n   *   The rasterizer is positioning horizontal features (e.g., ascender\n   *   height & x-height, or crossbars) on the pixel grid and minimizing the\n   *   amount of antialiasing applied to them, while placing vertical\n   *   features (vertical stems) on the pixel grid without hinting, thus\n   *   representing the stem position and weight accurately.  Sometimes the\n   *   vertical stems may be only partially black.  In this context,\n   *   `antialiasing' means that stems are not positioned exactly on pixel\n   *   borders, causing a fuzzy appearance.\n   *\n   *   There are two principles behind this approach.\n   *\n   *   1) No hinting in the horizontal direction: Unlike `superhinted'\n   *   TrueType, which changes glyph widths to accommodate regular\n   *   inter-glyph spacing, Adobe's approach is `faithful to the design' in\n   *   representing both the glyph width and the inter-glyph spacing\n   *   designed for the font.  This makes the screen display as close as it\n   *   can be to the result one would get with infinite resolution, while\n   *   preserving what is considered the key characteristics of each glyph.\n   *   Note that the distances between unhinted and grid-fitted positions at\n   *   small sizes are comparable to kerning values and thus would be\n   *   noticeable (and distracting) while reading if hinting were applied.\n   *\n   *   One of the reasons to not hint horizontally is antialiasing for LCD\n   *   screens: The pixel geometry of modern displays supplies three\n   *   vertical sub-pixels as the eye moves horizontally across each visible\n   *   pixel.  On devices where we can be certain this characteristic is\n   *   present a rasterizer can take advantage of the sub-pixels to add\n   *   increments of weight.  In Western writing systems this turns out to\n   *   be the more critical direction anyway; the weights and spacing of\n   *   vertical stems (see above) are central to Armenian, Cyrillic, Greek,\n   *   and Latin type designs.  Even when the rasterizer uses greyscale\n   *   antialiasing instead of color (a necessary compromise when one\n   *   doesn't know the screen characteristics), the unhinted vertical\n   *   features preserve the design's weight and spacing much better than\n   *   aliased type would.\n   *\n   *   2) Aligment in the vertical direction: Weights and spacing along the\n   *   y~axis are less critical; what is much more important is the visual\n   *   alignment of related features (like cap-height and x-height).  The\n   *   sense of alignment for these is enhanced by the sharpness of grid-fit\n   *   edges, while the cruder vertical resolution (full pixels instead of\n   *   1/3 pixels) is less of a problem.\n   *\n   *   On the technical side, horizontal alignment zones for ascender,\n   *   x-height, and other important height values (traditionally called\n   *   `blue zones') as defined in the font are positioned independently,\n   *   each being rounded to the nearest pixel edge, taking care of\n   *   overshoot suppression at small sizes, stem darkening, and scaling.\n   *\n   *   Hstems (this is, hint values defined in the font to help align\n   *   horizontal features) that fall within a blue zone are said to be\n   *   `captured' and are aligned to that zone.  Uncaptured stems are moved\n   *   in one of four ways, top edge up or down, bottom edge up or down.\n   *   Unless there are conflicting hstems, the smallest movement is taken\n   *   to minimize distortion.\n   *\n   * @order:\n   *   hinting-engine\n   *   no-stem-darkening\n   *   darkening-parameters\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   hinting-engine\n   *\n   * @description:\n   *   Thanks to Adobe, which contributed a new hinting (and parsing)\n   *   engine, an application can select between `freetype' and `adobe' if\n   *   compiled with CFF_CONFIG_OPTION_OLD_ENGINE.  If this configuration\n   *   macro isn't defined, `hinting-engine' does nothing.\n   *\n   *   The default engine is `freetype' if CFF_CONFIG_OPTION_OLD_ENGINE is\n   *   defined, and `adobe' otherwise.\n   *\n   *   The following example code demonstrates how to select Adobe's hinting\n   *   engine (omitting the error handling).\n   *\n   *   {\n   *     FT_Library  library;\n   *     FT_UInt     hinting_engine = FT_CFF_HINTING_ADOBE;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *\n   *     FT_Property_Set( library, \"cff\",\n   *                               \"hinting-engine\", &hinting_engine );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @enum:\n   *   FT_CFF_HINTING_XXX\n   *\n   * @description:\n   *   A list of constants used for the @hinting-engine property to select\n   *   the hinting engine for CFF fonts.\n   *\n   * @values:\n   *   FT_CFF_HINTING_FREETYPE ::\n   *     Use the old FreeType hinting engine.\n   *\n   *   FT_CFF_HINTING_ADOBE ::\n   *     Use the hinting engine contributed by Adobe.\n   *\n   */\n#define FT_CFF_HINTING_FREETYPE  0\n#define FT_CFF_HINTING_ADOBE     1\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   no-stem-darkening\n   *\n   * @description:\n   *   By default, the Adobe CFF engine darkens stems at smaller sizes,\n   *   regardless of hinting, to enhance contrast.  This feature requires\n   *   a rendering system with proper gamma correction.  Setting this\n   *   property, stem darkening gets switched off.\n   *\n   *   Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is set.\n   *\n   *   {\n   *     FT_Library  library;\n   *     FT_Bool     no_stem_darkening = TRUE;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *\n   *     FT_Property_Set( library, \"cff\",\n   *                               \"no-stem-darkening\", &no_stem_darkening );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   darkening-parameters\n   *\n   * @description:\n   *   By default, the Adobe CFF engine darkens stems as follows (if the\n   *   `no-stem-darkening' property isn't set):\n   *\n   *   {\n   *     stem width <= 0.5px:   darkening amount = 0.4px\n   *     stem width  = 1px:     darkening amount = 0.275px\n   *     stem width  = 1.667px: darkening amount = 0.275px\n   *     stem width >= 2.333px: darkening amount = 0px\n   *   }\n   *\n   *   and piecewise linear in-between.  At configuration time, these four\n   *   control points can be set with the macro\n   *   `CFF_CONFIG_OPTION_DARKENING_PARAMETERS'.  At runtime, the control\n   *   points can be changed using the `darkening-parameters' property, as\n   *   the following example demonstrates.\n   *\n   *   {\n   *     FT_Library  library;\n   *     FT_Int      darken_params[8] = {  500, 300,   // x1, y1\n   *                                      1000, 200,   // x2, y2\n   *                                      1500, 100,   // x3, y3\n   *                                      2000,   0 }; // x4, y4\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *\n   *     FT_Property_Set( library, \"cff\",\n   *                               \"darkening-parameters\", darken_params );\n   *   }\n   *\n   *   The x~values give the stem width, and the y~values the darkening\n   *   amount.  The unit is 1000th of pixels.  All coordinate values must be\n   *   positive; the x~values must be monotonically increasing; the\n   *   y~values must be monotonically decreasing and smaller than or\n   *   equal to 500 (corresponding to half a pixel); the slope of each\n   *   linear piece must be shallower than -1 (e.g., -.4).\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __FTCFFDRV_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftchapters.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/* This file defines the structure of the FreeType reference.              */\n/* It is used by the python script that generates the HTML files.          */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    general_remarks                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    General Remarks                                                      */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    header_inclusion                                                     */\n/*    user_allocation                                                      */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    core_api                                                             */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Core API                                                             */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    version                                                              */\n/*    basic_types                                                          */\n/*    base_interface                                                       */\n/*    glyph_variants                                                       */\n/*    glyph_management                                                     */\n/*    mac_specific                                                         */\n/*    sizes_management                                                     */\n/*    header_file_macros                                                   */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    format_specific                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Format-Specific API                                                  */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    multiple_masters                                                     */\n/*    truetype_tables                                                      */\n/*    type1_tables                                                         */\n/*    sfnt_names                                                           */\n/*    bdf_fonts                                                            */\n/*    cid_fonts                                                            */\n/*    pfr_fonts                                                            */\n/*    winfnt_fonts                                                         */\n/*    font_formats                                                         */\n/*    gasp_table                                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    module_specific                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Controlling FreeType Modules                                         */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    auto_hinter                                                          */\n/*    cff_driver                                                           */\n/*    tt_driver                                                            */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    cache_subsystem                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Cache Sub-System                                                     */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    cache_subsystem                                                      */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    support_api                                                          */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Support API                                                          */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    computations                                                         */\n/*    list_processing                                                      */\n/*    outline_processing                                                   */\n/*    quick_advance                                                        */\n/*    bitmap_handling                                                      */\n/*    raster                                                               */\n/*    glyph_stroker                                                        */\n/*    system_interface                                                     */\n/*    module_management                                                    */\n/*    gzip                                                                 */\n/*    lzw                                                                  */\n/*    bzip2                                                                */\n/*    lcd_filtering                                                        */\n/*                                                                         */\n/***************************************************************************/\n"
  },
  {
    "path": "ext/freetype2/include/ftcid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcid.h                                                                */\n/*                                                                         */\n/*    FreeType API for accessing CID font information (specification).     */\n/*                                                                         */\n/*  Copyright 2007, 2009 by Dereg Clegg, Michael Toftdal.                  */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCID_H__\n#define __FTCID_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    cid_fonts                                                          */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    CID Fonts                                                          */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    CID-keyed font specific API.                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of CID-keyed font specific   */\n  /*    functions.                                                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_CID_Registry_Ordering_Supplement\n   *\n   * @description:\n   *    Retrieve the Registry/Ordering/Supplement triple (also known as the\n   *    \"R/O/S\") from a CID-keyed font.\n   *\n   * @input:\n   *    face ::\n   *       A handle to the input face.\n   *\n   * @output:\n   *    registry ::\n   *       The registry, as a C~string, owned by the face.\n   *\n   *    ordering ::\n   *       The ordering, as a C~string, owned by the face.\n   *\n   *    supplement ::\n   *       The supplement.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    This function only works with CID faces, returning an error\n   *    otherwise.\n   *\n   * @since:\n   *    2.3.6\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_CID_Registry_Ordering_Supplement( FT_Face       face,\n                                           const char*  *registry,\n                                           const char*  *ordering,\n                                           FT_Int       *supplement);\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_CID_Is_Internally_CID_Keyed\n   *\n   * @description:\n   *    Retrieve the type of the input face, CID keyed or not.  In\n   *    constrast to the @FT_IS_CID_KEYED macro this function returns\n   *    successfully also for CID-keyed fonts in an SNFT wrapper.\n   *\n   * @input:\n   *    face ::\n   *       A handle to the input face.\n   *\n   * @output:\n   *    is_cid ::\n   *       The type of the face as an @FT_Bool.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    This function only works with CID faces and OpenType fonts,\n   *    returning an error otherwise.\n   *\n   * @since:\n   *    2.3.9\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_CID_Is_Internally_CID_Keyed( FT_Face   face,\n                                      FT_Bool  *is_cid );\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_CID_From_Glyph_Index\n   *\n   * @description:\n   *    Retrieve the CID of the input glyph index.\n   *\n   * @input:\n   *    face ::\n   *       A handle to the input face.\n   *\n   *    glyph_index ::\n   *       The input glyph index.\n   *\n   * @output:\n   *    cid ::\n   *       The CID as an @FT_UInt.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    This function only works with CID faces and OpenType fonts,\n   *    returning an error otherwise.\n   *\n   * @since:\n   *    2.3.9\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_CID_From_Glyph_Index( FT_Face   face,\n                               FT_UInt   glyph_index,\n                               FT_UInt  *cid );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTCID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/fterrdef.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fterrdef.h                                                             */\n/*                                                                         */\n/*    FreeType error codes (specification).                                */\n/*                                                                         */\n/*  Copyright 2002, 2004, 2006, 2007, 2010-2013 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                LIST OF ERROR CODES/MESSAGES             *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n  /* You need to define both FT_ERRORDEF_ and FT_NOERRORDEF_ before */\n  /* including this file.                                           */\n\n\n  /* generic errors */\n\n  FT_NOERRORDEF_( Ok,                                        0x00,\n                  \"no error\" )\n\n  FT_ERRORDEF_( Cannot_Open_Resource,                        0x01,\n                \"cannot open resource\" )\n  FT_ERRORDEF_( Unknown_File_Format,                         0x02,\n                \"unknown file format\" )\n  FT_ERRORDEF_( Invalid_File_Format,                         0x03,\n                \"broken file\" )\n  FT_ERRORDEF_( Invalid_Version,                             0x04,\n                \"invalid FreeType version\" )\n  FT_ERRORDEF_( Lower_Module_Version,                        0x05,\n                \"module version is too low\" )\n  FT_ERRORDEF_( Invalid_Argument,                            0x06,\n                \"invalid argument\" )\n  FT_ERRORDEF_( Unimplemented_Feature,                       0x07,\n                \"unimplemented feature\" )\n  FT_ERRORDEF_( Invalid_Table,                               0x08,\n                \"broken table\" )\n  FT_ERRORDEF_( Invalid_Offset,                              0x09,\n                \"broken offset within table\" )\n  FT_ERRORDEF_( Array_Too_Large,                             0x0A,\n                \"array allocation size too large\" )\n  FT_ERRORDEF_( Missing_Module,                              0x0B,\n                \"missing module\" )\n  FT_ERRORDEF_( Missing_Property,                            0x0C,\n                \"missing property\" )\n\n  /* glyph/character errors */\n\n  FT_ERRORDEF_( Invalid_Glyph_Index,                         0x10,\n                \"invalid glyph index\" )\n  FT_ERRORDEF_( Invalid_Character_Code,                      0x11,\n                \"invalid character code\" )\n  FT_ERRORDEF_( Invalid_Glyph_Format,                        0x12,\n                \"unsupported glyph image format\" )\n  FT_ERRORDEF_( Cannot_Render_Glyph,                         0x13,\n                \"cannot render this glyph format\" )\n  FT_ERRORDEF_( Invalid_Outline,                             0x14,\n                \"invalid outline\" )\n  FT_ERRORDEF_( Invalid_Composite,                           0x15,\n                \"invalid composite glyph\" )\n  FT_ERRORDEF_( Too_Many_Hints,                              0x16,\n                \"too many hints\" )\n  FT_ERRORDEF_( Invalid_Pixel_Size,                          0x17,\n                \"invalid pixel size\" )\n\n  /* handle errors */\n\n  FT_ERRORDEF_( Invalid_Handle,                              0x20,\n                \"invalid object handle\" )\n  FT_ERRORDEF_( Invalid_Library_Handle,                      0x21,\n                \"invalid library handle\" )\n  FT_ERRORDEF_( Invalid_Driver_Handle,                       0x22,\n                \"invalid module handle\" )\n  FT_ERRORDEF_( Invalid_Face_Handle,                         0x23,\n                \"invalid face handle\" )\n  FT_ERRORDEF_( Invalid_Size_Handle,                         0x24,\n                \"invalid size handle\" )\n  FT_ERRORDEF_( Invalid_Slot_Handle,                         0x25,\n                \"invalid glyph slot handle\" )\n  FT_ERRORDEF_( Invalid_CharMap_Handle,                      0x26,\n                \"invalid charmap handle\" )\n  FT_ERRORDEF_( Invalid_Cache_Handle,                        0x27,\n                \"invalid cache manager handle\" )\n  FT_ERRORDEF_( Invalid_Stream_Handle,                       0x28,\n                \"invalid stream handle\" )\n\n  /* driver errors */\n\n  FT_ERRORDEF_( Too_Many_Drivers,                            0x30,\n                \"too many modules\" )\n  FT_ERRORDEF_( Too_Many_Extensions,                         0x31,\n                \"too many extensions\" )\n\n  /* memory errors */\n\n  FT_ERRORDEF_( Out_Of_Memory,                               0x40,\n                \"out of memory\" )\n  FT_ERRORDEF_( Unlisted_Object,                             0x41,\n                \"unlisted object\" )\n\n  /* stream errors */\n\n  FT_ERRORDEF_( Cannot_Open_Stream,                          0x51,\n                \"cannot open stream\" )\n  FT_ERRORDEF_( Invalid_Stream_Seek,                         0x52,\n                \"invalid stream seek\" )\n  FT_ERRORDEF_( Invalid_Stream_Skip,                         0x53,\n                \"invalid stream skip\" )\n  FT_ERRORDEF_( Invalid_Stream_Read,                         0x54,\n                \"invalid stream read\" )\n  FT_ERRORDEF_( Invalid_Stream_Operation,                    0x55,\n                \"invalid stream operation\" )\n  FT_ERRORDEF_( Invalid_Frame_Operation,                     0x56,\n                \"invalid frame operation\" )\n  FT_ERRORDEF_( Nested_Frame_Access,                         0x57,\n                \"nested frame access\" )\n  FT_ERRORDEF_( Invalid_Frame_Read,                          0x58,\n                \"invalid frame read\" )\n\n  /* raster errors */\n\n  FT_ERRORDEF_( Raster_Uninitialized,                        0x60,\n                \"raster uninitialized\" )\n  FT_ERRORDEF_( Raster_Corrupted,                            0x61,\n                \"raster corrupted\" )\n  FT_ERRORDEF_( Raster_Overflow,                             0x62,\n                \"raster overflow\" )\n  FT_ERRORDEF_( Raster_Negative_Height,                      0x63,\n                \"negative height while rastering\" )\n\n  /* cache errors */\n\n  FT_ERRORDEF_( Too_Many_Caches,                             0x70,\n                \"too many registered caches\" )\n\n  /* TrueType and SFNT errors */\n\n  FT_ERRORDEF_( Invalid_Opcode,                              0x80,\n                \"invalid opcode\" )\n  FT_ERRORDEF_( Too_Few_Arguments,                           0x81,\n                \"too few arguments\" )\n  FT_ERRORDEF_( Stack_Overflow,                              0x82,\n                \"stack overflow\" )\n  FT_ERRORDEF_( Code_Overflow,                               0x83,\n                \"code overflow\" )\n  FT_ERRORDEF_( Bad_Argument,                                0x84,\n                \"bad argument\" )\n  FT_ERRORDEF_( Divide_By_Zero,                              0x85,\n                \"division by zero\" )\n  FT_ERRORDEF_( Invalid_Reference,                           0x86,\n                \"invalid reference\" )\n  FT_ERRORDEF_( Debug_OpCode,                                0x87,\n                \"found debug opcode\" )\n  FT_ERRORDEF_( ENDF_In_Exec_Stream,                         0x88,\n                \"found ENDF opcode in execution stream\" )\n  FT_ERRORDEF_( Nested_DEFS,                                 0x89,\n                \"nested DEFS\" )\n  FT_ERRORDEF_( Invalid_CodeRange,                           0x8A,\n                \"invalid code range\" )\n  FT_ERRORDEF_( Execution_Too_Long,                          0x8B,\n                \"execution context too long\" )\n  FT_ERRORDEF_( Too_Many_Function_Defs,                      0x8C,\n                \"too many function definitions\" )\n  FT_ERRORDEF_( Too_Many_Instruction_Defs,                   0x8D,\n                \"too many instruction definitions\" )\n  FT_ERRORDEF_( Table_Missing,                               0x8E,\n                \"SFNT font table missing\" )\n  FT_ERRORDEF_( Horiz_Header_Missing,                        0x8F,\n                \"horizontal header (hhea) table missing\" )\n  FT_ERRORDEF_( Locations_Missing,                           0x90,\n                \"locations (loca) table missing\" )\n  FT_ERRORDEF_( Name_Table_Missing,                          0x91,\n                \"name table missing\" )\n  FT_ERRORDEF_( CMap_Table_Missing,                          0x92,\n                \"character map (cmap) table missing\" )\n  FT_ERRORDEF_( Hmtx_Table_Missing,                          0x93,\n                \"horizontal metrics (hmtx) table missing\" )\n  FT_ERRORDEF_( Post_Table_Missing,                          0x94,\n                \"PostScript (post) table missing\" )\n  FT_ERRORDEF_( Invalid_Horiz_Metrics,                       0x95,\n                \"invalid horizontal metrics\" )\n  FT_ERRORDEF_( Invalid_CharMap_Format,                      0x96,\n                \"invalid character map (cmap) format\" )\n  FT_ERRORDEF_( Invalid_PPem,                                0x97,\n                \"invalid ppem value\" )\n  FT_ERRORDEF_( Invalid_Vert_Metrics,                        0x98,\n                \"invalid vertical metrics\" )\n  FT_ERRORDEF_( Could_Not_Find_Context,                      0x99,\n                \"could not find context\" )\n  FT_ERRORDEF_( Invalid_Post_Table_Format,                   0x9A,\n                \"invalid PostScript (post) table format\" )\n  FT_ERRORDEF_( Invalid_Post_Table,                          0x9B,\n                \"invalid PostScript (post) table\" )\n\n  /* CFF, CID, and Type 1 errors */\n\n  FT_ERRORDEF_( Syntax_Error,                                0xA0,\n                \"opcode syntax error\" )\n  FT_ERRORDEF_( Stack_Underflow,                             0xA1,\n                \"argument stack underflow\" )\n  FT_ERRORDEF_( Ignore,                                      0xA2,\n                \"ignore\" )\n  FT_ERRORDEF_( No_Unicode_Glyph_Name,                       0xA3,\n                \"no Unicode glyph name found\" )\n  FT_ERRORDEF_( Glyph_Too_Big,                               0xA4,\n                \"glyph to big for hinting\" )\n\n  /* BDF errors */\n\n  FT_ERRORDEF_( Missing_Startfont_Field,                     0xB0,\n                \"`STARTFONT' field missing\" )\n  FT_ERRORDEF_( Missing_Font_Field,                          0xB1,\n                \"`FONT' field missing\" )\n  FT_ERRORDEF_( Missing_Size_Field,                          0xB2,\n                \"`SIZE' field missing\" )\n  FT_ERRORDEF_( Missing_Fontboundingbox_Field,               0xB3,\n                \"`FONTBOUNDINGBOX' field missing\" )\n  FT_ERRORDEF_( Missing_Chars_Field,                         0xB4,\n                \"`CHARS' field missing\" )\n  FT_ERRORDEF_( Missing_Startchar_Field,                     0xB5,\n                \"`STARTCHAR' field missing\" )\n  FT_ERRORDEF_( Missing_Encoding_Field,                      0xB6,\n                \"`ENCODING' field missing\" )\n  FT_ERRORDEF_( Missing_Bbx_Field,                           0xB7,\n                \"`BBX' field missing\" )\n  FT_ERRORDEF_( Bbx_Too_Big,                                 0xB8,\n                \"`BBX' too big\" )\n  FT_ERRORDEF_( Corrupted_Font_Header,                       0xB9,\n                \"Font header corrupted or missing fields\" )\n  FT_ERRORDEF_( Corrupted_Font_Glyphs,                       0xBA,\n                \"Font glyphs corrupted or missing fields\" )\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/fterrors.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fterrors.h                                                             */\n/*                                                                         */\n/*    FreeType error code handling (specification).                        */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004, 2007, 2013 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This special header file is used to define the handling of FT2        */\n  /* enumeration constants.  It can also be used to generate error message */\n  /* strings with a small macro trick explained below.                     */\n  /*                                                                       */\n  /* I - Error Formats                                                     */\n  /* -----------------                                                     */\n  /*                                                                       */\n  /*   The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be   */\n  /*   defined in ftoption.h in order to make the higher byte indicate     */\n  /*   the module where the error has happened (this is not compatible     */\n  /*   with standard builds of FreeType 2).  See the file `ftmoderr.h' for */\n  /*   more details.                                                       */\n  /*                                                                       */\n  /*                                                                       */\n  /* II - Error Message strings                                            */\n  /* --------------------------                                            */\n  /*                                                                       */\n  /*   The error definitions below are made through special macros that    */\n  /*   allow client applications to build a table of error message strings */\n  /*   if they need it.  The strings are not included in a normal build of */\n  /*   FreeType 2 to save space (most client applications do not use       */\n  /*   them).                                                              */\n  /*                                                                       */\n  /*   To do so, you have to define the following macros before including  */\n  /*   this file:                                                          */\n  /*                                                                       */\n  /*   FT_ERROR_START_LIST ::                                              */\n  /*     This macro is called before anything else to define the start of  */\n  /*     the error list.  It is followed by several FT_ERROR_DEF calls     */\n  /*     (see below).                                                      */\n  /*                                                                       */\n  /*   FT_ERROR_DEF( e, v, s ) ::                                          */\n  /*     This macro is called to define one single error.                  */\n  /*     `e' is the error code identifier (e.g. FT_Err_Invalid_Argument).  */\n  /*     `v' is the error numerical value.                                 */\n  /*     `s' is the corresponding error string.                            */\n  /*                                                                       */\n  /*   FT_ERROR_END_LIST ::                                                */\n  /*     This macro ends the list.                                         */\n  /*                                                                       */\n  /*   Additionally, you have to undefine __FTERRORS_H__ before #including */\n  /*   this file.                                                          */\n  /*                                                                       */\n  /*   Here is a simple example:                                           */\n  /*                                                                       */\n  /*     {                                                                 */\n  /*       #undef __FTERRORS_H__                                           */\n  /*       #define FT_ERRORDEF( e, v, s )  { e, s },                       */\n  /*       #define FT_ERROR_START_LIST     {                               */\n  /*       #define FT_ERROR_END_LIST       { 0, 0 } };                     */\n  /*                                                                       */\n  /*       const struct                                                    */\n  /*       {                                                               */\n  /*         int          err_code;                                        */\n  /*         const char*  err_msg;                                         */\n  /*       } ft_errors[] =                                                 */\n  /*                                                                       */\n  /*       #include FT_ERRORS_H                                            */\n  /*     }                                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTERRORS_H__\n#define __FTERRORS_H__\n\n\n  /* include module base error codes */\n#include FT_MODULE_ERRORS_H\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                       SETUP MACROS                      *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#undef  FT_NEED_EXTERN_C\n\n\n  /* FT_ERR_PREFIX is used as a prefix for error identifiers. */\n  /* By default, we use `FT_Err_'.                            */\n  /*                                                          */\n#ifndef FT_ERR_PREFIX\n#define FT_ERR_PREFIX  FT_Err_\n#endif\n\n\n  /* FT_ERR_BASE is used as the base for module-specific errors. */\n  /*                                                             */\n#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS\n\n#ifndef FT_ERR_BASE\n#define FT_ERR_BASE  FT_Mod_Err_Base\n#endif\n\n#else\n\n#undef FT_ERR_BASE\n#define FT_ERR_BASE  0\n\n#endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */\n\n\n  /* If FT_ERRORDEF is not defined, we need to define a simple */\n  /* enumeration type.                                         */\n  /*                                                           */\n#ifndef FT_ERRORDEF\n\n#define FT_ERRORDEF( e, v, s )  e = v,\n#define FT_ERROR_START_LIST     enum {\n#define FT_ERROR_END_LIST       FT_ERR_CAT( FT_ERR_PREFIX, Max ) };\n\n#ifdef __cplusplus\n#define FT_NEED_EXTERN_C\n  extern \"C\" {\n#endif\n\n#endif /* !FT_ERRORDEF */\n\n\n  /* this macro is used to define an error */\n#define FT_ERRORDEF_( e, v, s )                                             \\\n          FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )\n\n  /* this is only used for <module>_Err_Ok, which must be 0! */\n#define FT_NOERRORDEF_( e, v, s )                             \\\n          FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )\n\n\n#ifdef FT_ERROR_START_LIST\n  FT_ERROR_START_LIST\n#endif\n\n\n  /* now include the error codes */\n#include FT_ERROR_DEFINITIONS_H\n\n\n#ifdef FT_ERROR_END_LIST\n  FT_ERROR_END_LIST\n#endif\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                      SIMPLE CLEANUP                     *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n#ifdef FT_NEED_EXTERN_C\n  }\n#endif\n\n#undef FT_ERROR_START_LIST\n#undef FT_ERROR_END_LIST\n\n#undef FT_ERRORDEF\n#undef FT_ERRORDEF_\n#undef FT_NOERRORDEF_\n\n#undef FT_NEED_EXTERN_C\n#undef FT_ERR_BASE\n\n  /* FT_ERR_PREFIX is needed internally */\n#ifndef FT2_BUILD_LIBRARY\n#undef FT_ERR_PREFIX\n#endif\n\n#endif /* __FTERRORS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftgasp.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgasp.h                                                               */\n/*                                                                         */\n/*    Access of TrueType's `gasp' table (specification).                   */\n/*                                                                         */\n/*  Copyright 2007, 2008, 2011 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef _FT_GASP_H_\n#define _FT_GASP_H_\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\n  /***************************************************************************\n   *\n   * @section:\n   *   gasp_table\n   *\n   * @title:\n   *   Gasp Table\n   *\n   * @abstract:\n   *   Retrieving TrueType `gasp' table entries.\n   *\n   * @description:\n   *   The function @FT_Get_Gasp can be used to query a TrueType or OpenType\n   *   font for specific entries in its `gasp' table, if any.  This is\n   *   mainly useful when implementing native TrueType hinting with the\n   *   bytecode interpreter to duplicate the Windows text rendering results.\n   */\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FT_GASP_XXX\n   *\n   * @description:\n   *   A list of values and/or bit-flags returned by the @FT_Get_Gasp\n   *   function.\n   *\n   * @values:\n   *   FT_GASP_NO_TABLE ::\n   *     This special value means that there is no GASP table in this face.\n   *     It is up to the client to decide what to do.\n   *\n   *   FT_GASP_DO_GRIDFIT ::\n   *     Grid-fitting and hinting should be performed at the specified ppem.\n   *     This *really* means TrueType bytecode interpretation.  If this bit\n   *     is not set, no hinting gets applied.\n   *\n   *   FT_GASP_DO_GRAY ::\n   *     Anti-aliased rendering should be performed at the specified ppem.\n   *     If not set, do monochrome rendering.\n   *\n   *   FT_GASP_SYMMETRIC_SMOOTHING ::\n   *     If set, smoothing along multiple axes must be used with ClearType.\n   *\n   *   FT_GASP_SYMMETRIC_GRIDFIT ::\n   *     Grid-fitting must be used with ClearType's symmetric smoothing.\n   *\n   * @note:\n   *   The bit-flags `FT_GASP_DO_GRIDFIT' and `FT_GASP_DO_GRAY' are to be\n   *   used for standard font rasterization only.  Independently of that,\n   *   `FT_GASP_SYMMETRIC_SMOOTHING' and `FT_GASP_SYMMETRIC_GRIDFIT' are to\n   *   be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT' and\n   *   `FT_GASP_DO_GRAY' are consequently ignored).\n   *\n   *   `ClearType' is Microsoft's implementation of LCD rendering, partly\n   *   protected by patents.\n   *\n   * @since:\n   *   2.3.0\n   */\n#define FT_GASP_NO_TABLE               -1\n#define FT_GASP_DO_GRIDFIT           0x01\n#define FT_GASP_DO_GRAY              0x02\n#define FT_GASP_SYMMETRIC_SMOOTHING  0x08\n#define FT_GASP_SYMMETRIC_GRIDFIT    0x10\n\n\n  /*************************************************************************\n   *\n   * @func:\n   *   FT_Get_Gasp\n   *\n   * @description:\n   *   Read the `gasp' table from a TrueType or OpenType font file and\n   *   return the entry corresponding to a given character pixel size.\n   *\n   * @input:\n   *   face :: The source face handle.\n   *   ppem :: The vertical character pixel size.\n   *\n   * @return:\n   *   Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no\n   *   `gasp' table in the face.\n   *\n   * @since:\n   *   2.3.0\n   */\n  FT_EXPORT( FT_Int )\n  FT_Get_Gasp( FT_Face  face,\n               FT_UInt  ppem );\n\n  /* */\n\n\n#endif /* _FT_GASP_H_ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftglyph.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftglyph.h                                                              */\n/*                                                                         */\n/*    FreeType convenience functions to handle glyphs (specification).     */\n/*                                                                         */\n/*  Copyright 1996-2003, 2006, 2008, 2009, 2011, 2013, 2014 by             */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file contains the definition of several convenience functions    */\n  /* that can be used by client applications to easily retrieve glyph      */\n  /* bitmaps and outlines from a given face.                               */\n  /*                                                                       */\n  /* These functions should be optional if you are writing a font server   */\n  /* or text layout engine on top of FreeType.  However, they are pretty   */\n  /* handy for many other simple uses of the library.                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTGLYPH_H__\n#define __FTGLYPH_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    glyph_management                                                   */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Glyph Management                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Generic interface to manage individual glyph data.                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains definitions used to manage glyph data        */\n  /*    through generic FT_Glyph objects.  Each of them can contain a      */\n  /*    bitmap, a vector outline, or even images in other formats.         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* forward declaration to a private type */\n  typedef struct FT_Glyph_Class_  FT_Glyph_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Glyph                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Handle to an object used to model generic glyph images.  It is a   */\n  /*    pointer to the @FT_GlyphRec structure and can contain a glyph      */\n  /*    bitmap or pointer.                                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Glyph objects are not owned by the library.  You must thus release */\n  /*    them manually (through @FT_Done_Glyph) _before_ calling            */\n  /*    @FT_Done_FreeType.                                                 */\n  /*                                                                       */\n  typedef struct FT_GlyphRec_*  FT_Glyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_GlyphRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The root glyph structure contains a given glyph image plus its     */\n  /*    advance width in 16.16 fixed-point format.                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    library :: A handle to the FreeType library object.                */\n  /*                                                                       */\n  /*    clazz   :: A pointer to the glyph's class.  Private.               */\n  /*                                                                       */\n  /*    format  :: The format of the glyph's image.                        */\n  /*                                                                       */\n  /*    advance :: A 16.16 vector that gives the glyph's advance width.    */\n  /*                                                                       */\n  typedef struct  FT_GlyphRec_\n  {\n    FT_Library             library;\n    const FT_Glyph_Class*  clazz;\n    FT_Glyph_Format        format;\n    FT_Vector              advance;\n\n  } FT_GlyphRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_BitmapGlyph                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an object used to model a bitmap glyph image.  This is */\n  /*    a sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec.     */\n  /*                                                                       */\n  typedef struct FT_BitmapGlyphRec_*  FT_BitmapGlyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_BitmapGlyphRec                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used for bitmap glyph images.  This really is a        */\n  /*    `sub-class' of @FT_GlyphRec.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root   :: The root @FT_Glyph fields.                               */\n  /*                                                                       */\n  /*    left   :: The left-side bearing, i.e., the horizontal distance     */\n  /*              from the current pen position to the left border of the  */\n  /*              glyph bitmap.                                            */\n  /*                                                                       */\n  /*    top    :: The top-side bearing, i.e., the vertical distance from   */\n  /*              the current pen position to the top border of the glyph  */\n  /*              bitmap.  This distance is positive for upwards~y!        */\n  /*                                                                       */\n  /*    bitmap :: A descriptor for the bitmap.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have       */\n  /*    `glyph->format == FT_GLYPH_FORMAT_BITMAP'.  This lets you access   */\n  /*    the bitmap's contents easily.                                      */\n  /*                                                                       */\n  /*    The corresponding pixel buffer is always owned by @FT_BitmapGlyph  */\n  /*    and is thus created and destroyed with it.                         */\n  /*                                                                       */\n  typedef struct  FT_BitmapGlyphRec_\n  {\n    FT_GlyphRec  root;\n    FT_Int       left;\n    FT_Int       top;\n    FT_Bitmap    bitmap;\n\n  } FT_BitmapGlyphRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_OutlineGlyph                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an object used to model an outline glyph image.  This  */\n  /*    is a sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec. */\n  /*                                                                       */\n  typedef struct FT_OutlineGlyphRec_*  FT_OutlineGlyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_OutlineGlyphRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used for outline (vectorial) glyph images.  This       */\n  /*    really is a `sub-class' of @FT_GlyphRec.                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root    :: The root @FT_Glyph fields.                              */\n  /*                                                                       */\n  /*    outline :: A descriptor for the outline.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You can typecast an @FT_Glyph to @FT_OutlineGlyph if you have      */\n  /*    `glyph->format == FT_GLYPH_FORMAT_OUTLINE'.  This lets you access  */\n  /*    the outline's content easily.                                      */\n  /*                                                                       */\n  /*    As the outline is extracted from a glyph slot, its coordinates are */\n  /*    expressed normally in 26.6 pixels, unless the flag                 */\n  /*    @FT_LOAD_NO_SCALE was used in @FT_Load_Glyph() or @FT_Load_Char(). */\n  /*                                                                       */\n  /*    The outline's tables are always owned by the object and are        */\n  /*    destroyed with it.                                                 */\n  /*                                                                       */\n  typedef struct  FT_OutlineGlyphRec_\n  {\n    FT_GlyphRec  root;\n    FT_Outline   outline;\n\n  } FT_OutlineGlyphRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Glyph                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to extract a glyph image from a slot.  Note that   */\n  /*    the created @FT_Glyph object must be released with @FT_Done_Glyph. */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    slot   :: A handle to the source glyph slot.                       */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aglyph :: A handle to the glyph object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Glyph( FT_GlyphSlot  slot,\n                FT_Glyph     *aglyph );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_Copy                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to copy a glyph image.  Note that the created      */\n  /*    @FT_Glyph object must be released with @FT_Done_Glyph.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    source :: A handle to the source glyph object.                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target :: A handle to the target glyph object.  0~in case of       */\n  /*              error.                                                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_Copy( FT_Glyph   source,\n                 FT_Glyph  *target );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_Transform                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Transform a glyph image if its format is scalable.                 */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    glyph  :: A handle to the target glyph object.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix :: A pointer to a 2x2 matrix to apply.                      */\n  /*                                                                       */\n  /*    delta  :: A pointer to a 2d vector to apply.  Coordinates are      */\n  /*              expressed in 1/64th of a pixel.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code (if not 0, the glyph format is not scalable).  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The 2x2 transformation matrix is also applied to the glyph's       */\n  /*    advance vector.                                                    */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_Transform( FT_Glyph    glyph,\n                      FT_Matrix*  matrix,\n                      FT_Vector*  delta );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Glyph_BBox_Mode                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The mode how the values of @FT_Glyph_Get_CBox are returned.        */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_GLYPH_BBOX_UNSCALED ::                                          */\n  /*      Return unscaled font units.                                      */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_SUBPIXELS ::                                         */\n  /*      Return unfitted 26.6 coordinates.                                */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_GRIDFIT ::                                           */\n  /*      Return grid-fitted 26.6 coordinates.                             */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_TRUNCATE ::                                          */\n  /*      Return coordinates in integer pixels.                            */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_PIXELS ::                                            */\n  /*      Return grid-fitted pixel coordinates.                            */\n  /*                                                                       */\n  typedef enum  FT_Glyph_BBox_Mode_\n  {\n    FT_GLYPH_BBOX_UNSCALED  = 0,\n    FT_GLYPH_BBOX_SUBPIXELS = 0,\n    FT_GLYPH_BBOX_GRIDFIT   = 1,\n    FT_GLYPH_BBOX_TRUNCATE  = 2,\n    FT_GLYPH_BBOX_PIXELS    = 3\n\n  } FT_Glyph_BBox_Mode;\n\n\n  /* these constants are deprecated; use the corresponding */\n  /* `FT_Glyph_BBox_Mode' values instead                   */\n#define ft_glyph_bbox_unscaled   FT_GLYPH_BBOX_UNSCALED\n#define ft_glyph_bbox_subpixels  FT_GLYPH_BBOX_SUBPIXELS\n#define ft_glyph_bbox_gridfit    FT_GLYPH_BBOX_GRIDFIT\n#define ft_glyph_bbox_truncate   FT_GLYPH_BBOX_TRUNCATE\n#define ft_glyph_bbox_pixels     FT_GLYPH_BBOX_PIXELS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_Get_CBox                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a glyph's `control box'.  The control box encloses all the  */\n  /*    outline's points, including Bézier control points.  Though it      */\n  /*    coincides with the exact bounding box for most glyphs, it can be   */\n  /*    slightly larger in some situations (like when rotating an outline  */\n  /*    that contains Bézier outside arcs).                                */\n  /*                                                                       */\n  /*    Computing the control box is very fast, while getting the bounding */\n  /*    box can take much more time as it needs to walk over all segments  */\n  /*    and arcs in the outline.  To get the latter, you can use the       */\n  /*    `ftbbox' component, which is dedicated to this single task.        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    glyph :: A handle to the source glyph object.                      */\n  /*                                                                       */\n  /*    mode  :: The mode that indicates how to interpret the returned     */\n  /*             bounding box values.                                      */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acbox :: The glyph coordinate bounding box.  Coordinates are       */\n  /*             expressed in 1/64th of pixels if it is grid-fitted.       */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Coordinates are relative to the glyph origin, using the y~upwards  */\n  /*    convention.                                                        */\n  /*                                                                       */\n  /*    If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode'   */\n  /*    must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font        */\n  /*    units in 26.6 pixel format.  The value @FT_GLYPH_BBOX_SUBPIXELS    */\n  /*    is another name for this constant.                                 */\n  /*                                                                       */\n  /*    If the font is tricky and the glyph has been loaded with           */\n  /*    @FT_LOAD_NO_SCALE, the resulting CBox is meaningless.  To get      */\n  /*    reasonable values for the CBox it is necessary to load the glyph   */\n  /*    at a large ppem value (so that the hinting instructions can        */\n  /*    properly shift and scale the subglyphs), then extracting the CBox, */\n  /*    which can be eventually converted back to font units.              */\n  /*                                                                       */\n  /*    Note that the maximum coordinates are exclusive, which means that  */\n  /*    one can compute the width and height of the glyph image (be it in  */\n  /*    integer or 26.6 pixels) as:                                        */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      width  = bbox.xMax - bbox.xMin;                                  */\n  /*      height = bbox.yMax - bbox.yMin;                                  */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Note also that for 26.6 coordinates, if `bbox_mode' is set to      */\n  /*    @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted,  */\n  /*    which corresponds to:                                              */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      bbox.xMin = FLOOR(bbox.xMin);                                    */\n  /*      bbox.yMin = FLOOR(bbox.yMin);                                    */\n  /*      bbox.xMax = CEILING(bbox.xMax);                                  */\n  /*      bbox.yMax = CEILING(bbox.yMax);                                  */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    To get the bbox in pixel coordinates, set `bbox_mode' to           */\n  /*    @FT_GLYPH_BBOX_TRUNCATE.                                           */\n  /*                                                                       */\n  /*    To get the bbox in grid-fitted pixel coordinates, set `bbox_mode'  */\n  /*    to @FT_GLYPH_BBOX_PIXELS.                                          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Glyph_Get_CBox( FT_Glyph  glyph,\n                     FT_UInt   bbox_mode,\n                     FT_BBox  *acbox );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_To_Bitmap                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Convert a given glyph object to a bitmap glyph object.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    the_glyph   :: A pointer to a handle to the target glyph.          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    render_mode :: An enumeration that describes how the data is       */\n  /*                   rendered.                                           */\n  /*                                                                       */\n  /*    origin      :: A pointer to a vector used to translate the glyph   */\n  /*                   image before rendering.  Can be~0 (if no            */\n  /*                   translation).  The origin is expressed in           */\n  /*                   26.6 pixels.                                        */\n  /*                                                                       */\n  /*    destroy     :: A boolean that indicates that the original glyph    */\n  /*                   image should be destroyed by this function.  It is  */\n  /*                   never destroyed in case of error.                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function does nothing if the glyph format isn't scalable.     */\n  /*                                                                       */\n  /*    The glyph image is translated with the `origin' vector before      */\n  /*    rendering.                                                         */\n  /*                                                                       */\n  /*    The first parameter is a pointer to an @FT_Glyph handle, that will */\n  /*    be _replaced_ by this function (with newly allocated data).        */\n  /*    Typically, you would use (omitting error handling):                */\n  /*                                                                       */\n  /*                                                                       */\n  /*      {                                                                */\n  /*        FT_Glyph        glyph;                                         */\n  /*        FT_BitmapGlyph  glyph_bitmap;                                  */\n  /*                                                                       */\n  /*                                                                       */\n  /*        // load glyph                                                  */\n  /*        error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT );     */\n  /*                                                                       */\n  /*        // extract glyph image                                         */\n  /*        error = FT_Get_Glyph( face->glyph, &glyph );                   */\n  /*                                                                       */\n  /*        // convert to a bitmap (default render mode + destroying old)  */\n  /*        if ( glyph->format != FT_GLYPH_FORMAT_BITMAP )                 */\n  /*        {                                                              */\n  /*          error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL,   */\n  /*                                      0, 1 );                          */\n  /*          if ( error ) // `glyph' unchanged                            */\n  /*            ...                                                        */\n  /*        }                                                              */\n  /*                                                                       */\n  /*        // access bitmap content by typecasting                        */\n  /*        glyph_bitmap = (FT_BitmapGlyph)glyph;                          */\n  /*                                                                       */\n  /*        // do funny stuff with it, like blitting/drawing               */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        // discard glyph image (bitmap or not)                         */\n  /*        FT_Done_Glyph( glyph );                                        */\n  /*      }                                                                */\n  /*                                                                       */\n  /*                                                                       */\n  /*    Here another example, again without error handling:                */\n  /*                                                                       */\n  /*                                                                       */\n  /*      {                                                                */\n  /*        FT_Glyph  glyphs[MAX_GLYPHS]                                   */\n  /*                                                                       */\n  /*                                                                       */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        for ( idx = 0; i < MAX_GLYPHS; i++ )                           */\n  /*          error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) ||       */\n  /*                  FT_Get_Glyph ( face->glyph, &glyph[idx] );           */\n  /*                                                                       */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        for ( idx = 0; i < MAX_GLYPHS; i++ )                           */\n  /*        {                                                              */\n  /*          FT_Glyph  bitmap = glyphs[idx];                              */\n  /*                                                                       */\n  /*                                                                       */\n  /*          ...                                                          */\n  /*                                                                       */\n  /*          // after this call, `bitmap' no longer points into           */\n  /*          // the `glyphs' array (and the old value isn't destroyed)    */\n  /*          FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 );    */\n  /*                                                                       */\n  /*          ...                                                          */\n  /*                                                                       */\n  /*          FT_Done_Glyph( bitmap );                                     */\n  /*        }                                                              */\n  /*                                                                       */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        for ( idx = 0; i < MAX_GLYPHS; i++ )                           */\n  /*          FT_Done_Glyph( glyphs[idx] );                                */\n  /*      }                                                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_To_Bitmap( FT_Glyph*       the_glyph,\n                      FT_Render_Mode  render_mode,\n                      FT_Vector*      origin,\n                      FT_Bool         destroy );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Glyph                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a given glyph.                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    glyph :: A handle to the target glyph object.                      */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Done_Glyph( FT_Glyph  glyph );\n\n  /* */\n\n\n  /* other helpful functions */\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    computations                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Matrix_Multiply                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Perform the matrix operation `b = a*b'.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: A pointer to matrix `a'.                                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    b :: A pointer to matrix `b'.                                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The result is undefined if either `a' or `b' is zero.              */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Matrix_Multiply( const FT_Matrix*  a,\n                      FT_Matrix*        b );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Matrix_Invert                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Invert a 2x2 matrix.  Return an error if it can't be inverted.     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    matrix :: A pointer to the target matrix.  Remains untouched in    */\n  /*              case of error.                                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Matrix_Invert( FT_Matrix*  matrix );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGLYPH_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "ext/freetype2/include/ftgxval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgxval.h                                                              */\n/*                                                                         */\n/*    FreeType API for validating TrueTypeGX/AAT tables (specification).   */\n/*                                                                         */\n/*  Copyright 2004-2006, 2013 by                                           */\n/*  Masatake YAMATO, Redhat K.K,                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTGXVAL_H__\n#define __FTGXVAL_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    gx_validation                                                      */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    TrueTypeGX/AAT Validation                                          */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    An API to validate TrueTypeGX/AAT tables.                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of functions to validate     */\n  /*    some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd,  */\n  /*    trak, prop, lcar).                                                 */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_TrueTypeGX_Validate                                             */\n  /*    FT_TrueTypeGX_Free                                                 */\n  /*                                                                       */\n  /*    FT_ClassicKern_Validate                                            */\n  /*    FT_ClassicKern_Free                                                */\n  /*                                                                       */\n  /*    FT_VALIDATE_GX_LENGTH                                              */\n  /*    FT_VALIDATE_GXXXX                                                  */\n  /*    FT_VALIDATE_CKERNXXX                                               */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                                                                       */\n  /* Warning: Use FT_VALIDATE_XXX to validate a table.                     */\n  /*          Following definitions are for gxvalid developers.            */\n  /*                                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n#define FT_VALIDATE_feat_INDEX     0\n#define FT_VALIDATE_mort_INDEX     1\n#define FT_VALIDATE_morx_INDEX     2\n#define FT_VALIDATE_bsln_INDEX     3\n#define FT_VALIDATE_just_INDEX     4\n#define FT_VALIDATE_kern_INDEX     5\n#define FT_VALIDATE_opbd_INDEX     6\n#define FT_VALIDATE_trak_INDEX     7\n#define FT_VALIDATE_prop_INDEX     8\n#define FT_VALIDATE_lcar_INDEX     9\n#define FT_VALIDATE_GX_LAST_INDEX  FT_VALIDATE_lcar_INDEX\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_VALIDATE_GX_LENGTH\n   *\n   * @description:\n   *   The number of tables checked in this module.  Use it as a parameter\n   *   for the `table-length' argument of function @FT_TrueTypeGX_Validate.\n   */\n#define FT_VALIDATE_GX_LENGTH     (FT_VALIDATE_GX_LAST_INDEX + 1)\n\n  /* */\n\n  /* Up to 0x1000 is used by otvalid.\n     Ox2xxx is reserved for feature OT extension. */\n#define FT_VALIDATE_GX_START 0x4000\n#define FT_VALIDATE_GX_BITFIELD( tag )                  \\\n  ( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )\n\n\n /**********************************************************************\n  *\n  * @enum:\n  *    FT_VALIDATE_GXXXX\n  *\n  * @description:\n  *    A list of bit-field constants used with @FT_TrueTypeGX_Validate to\n  *    indicate which TrueTypeGX/AAT Type tables should be validated.\n  *\n  * @values:\n  *    FT_VALIDATE_feat ::\n  *      Validate `feat' table.\n  *\n  *    FT_VALIDATE_mort ::\n  *      Validate `mort' table.\n  *\n  *    FT_VALIDATE_morx ::\n  *      Validate `morx' table.\n  *\n  *    FT_VALIDATE_bsln ::\n  *      Validate `bsln' table.\n  *\n  *    FT_VALIDATE_just ::\n  *      Validate `just' table.\n  *\n  *    FT_VALIDATE_kern ::\n  *      Validate `kern' table.\n  *\n  *    FT_VALIDATE_opbd ::\n  *      Validate `opbd' table.\n  *\n  *    FT_VALIDATE_trak ::\n  *      Validate `trak' table.\n  *\n  *    FT_VALIDATE_prop ::\n  *      Validate `prop' table.\n  *\n  *    FT_VALIDATE_lcar ::\n  *      Validate `lcar' table.\n  *\n  *    FT_VALIDATE_GX ::\n  *      Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,\n  *      opbd, trak, prop and lcar).\n  *\n  */\n\n#define FT_VALIDATE_feat  FT_VALIDATE_GX_BITFIELD( feat )\n#define FT_VALIDATE_mort  FT_VALIDATE_GX_BITFIELD( mort )\n#define FT_VALIDATE_morx  FT_VALIDATE_GX_BITFIELD( morx )\n#define FT_VALIDATE_bsln  FT_VALIDATE_GX_BITFIELD( bsln )\n#define FT_VALIDATE_just  FT_VALIDATE_GX_BITFIELD( just )\n#define FT_VALIDATE_kern  FT_VALIDATE_GX_BITFIELD( kern )\n#define FT_VALIDATE_opbd  FT_VALIDATE_GX_BITFIELD( opbd )\n#define FT_VALIDATE_trak  FT_VALIDATE_GX_BITFIELD( trak )\n#define FT_VALIDATE_prop  FT_VALIDATE_GX_BITFIELD( prop )\n#define FT_VALIDATE_lcar  FT_VALIDATE_GX_BITFIELD( lcar )\n\n#define FT_VALIDATE_GX  ( FT_VALIDATE_feat | \\\n                          FT_VALIDATE_mort | \\\n                          FT_VALIDATE_morx | \\\n                          FT_VALIDATE_bsln | \\\n                          FT_VALIDATE_just | \\\n                          FT_VALIDATE_kern | \\\n                          FT_VALIDATE_opbd | \\\n                          FT_VALIDATE_trak | \\\n                          FT_VALIDATE_prop | \\\n                          FT_VALIDATE_lcar )\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_TrueTypeGX_Validate\n  *\n  * @description:\n  *    Validate various TrueTypeGX tables to assure that all offsets and\n  *    indices are valid.  The idea is that a higher-level library that\n  *    actually does the text layout can access those tables without\n  *    error checking (which can be quite time consuming).\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    validation_flags ::\n  *       A bit field that specifies the tables to be validated.  See\n  *       @FT_VALIDATE_GXXXX for possible values.\n  *\n  *    table_length ::\n  *       The size of the `tables' array.  Normally, @FT_VALIDATE_GX_LENGTH\n  *       should be passed.\n  *\n  * @output:\n  *    tables ::\n  *       The array where all validated sfnt tables are stored.\n  *       The array itself must be allocated by a client.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function only works with TrueTypeGX fonts, returning an error\n  *   otherwise.\n  *\n  *   After use, the application should deallocate the buffers pointed to by\n  *   each `tables' element, by calling @FT_TrueTypeGX_Free.  A NULL value\n  *   indicates that the table either doesn't exist in the font, the\n  *   application hasn't asked for validation, or the validator doesn't have\n  *   the ability to validate the sfnt table.\n  */\n  FT_EXPORT( FT_Error )\n  FT_TrueTypeGX_Validate( FT_Face   face,\n                          FT_UInt   validation_flags,\n                          FT_Bytes  tables[FT_VALIDATE_GX_LENGTH],\n                          FT_UInt   table_length );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_TrueTypeGX_Free\n  *\n  * @description:\n  *    Free the buffer allocated by TrueTypeGX validator.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    table ::\n  *       The pointer to the buffer allocated by\n  *       @FT_TrueTypeGX_Validate.\n  *\n  * @note:\n  *   This function must be used to free the buffer allocated by\n  *   @FT_TrueTypeGX_Validate only.\n  */\n  FT_EXPORT( void )\n  FT_TrueTypeGX_Free( FT_Face   face,\n                      FT_Bytes  table );\n\n\n /**********************************************************************\n  *\n  * @enum:\n  *    FT_VALIDATE_CKERNXXX\n  *\n  * @description:\n  *    A list of bit-field constants used with @FT_ClassicKern_Validate\n  *    to indicate the classic kern dialect or dialects.  If the selected\n  *    type doesn't fit, @FT_ClassicKern_Validate regards the table as\n  *    invalid.\n  *\n  * @values:\n  *    FT_VALIDATE_MS ::\n  *      Handle the `kern' table as a classic Microsoft kern table.\n  *\n  *    FT_VALIDATE_APPLE ::\n  *      Handle the `kern' table as a classic Apple kern table.\n  *\n  *    FT_VALIDATE_CKERN ::\n  *      Handle the `kern' as either classic Apple or Microsoft kern table.\n  */\n#define FT_VALIDATE_MS     ( FT_VALIDATE_GX_START << 0 )\n#define FT_VALIDATE_APPLE  ( FT_VALIDATE_GX_START << 1 )\n\n#define FT_VALIDATE_CKERN  ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_ClassicKern_Validate\n  *\n  * @description:\n  *    Validate classic (16-bit format) kern table to assure that the offsets\n  *    and indices are valid.  The idea is that a higher-level library that\n  *    actually does the text layout can access those tables without error\n  *    checking (which can be quite time consuming).\n  *\n  *    The `kern' table validator in @FT_TrueTypeGX_Validate deals with both\n  *    the new 32-bit format and the classic 16-bit format, while\n  *    FT_ClassicKern_Validate only supports the classic 16-bit format.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    validation_flags ::\n  *       A bit field that specifies the dialect to be validated.  See\n  *       @FT_VALIDATE_CKERNXXX for possible values.\n  *\n  * @output:\n  *    ckern_table ::\n  *       A pointer to the kern table.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   After use, the application should deallocate the buffers pointed to by\n  *   `ckern_table', by calling @FT_ClassicKern_Free.  A NULL value\n  *   indicates that the table doesn't exist in the font.\n  */\n  FT_EXPORT( FT_Error )\n  FT_ClassicKern_Validate( FT_Face    face,\n                           FT_UInt    validation_flags,\n                           FT_Bytes  *ckern_table );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_ClassicKern_Free\n  *\n  * @description:\n  *    Free the buffer allocated by classic Kern validator.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    table ::\n  *       The pointer to the buffer that is allocated by\n  *       @FT_ClassicKern_Validate.\n  *\n  * @note:\n  *   This function must be used to free the buffer allocated by\n  *   @FT_ClassicKern_Validate only.\n  */\n  FT_EXPORT( void )\n  FT_ClassicKern_Free( FT_Face   face,\n                       FT_Bytes  table );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGXVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftgzip.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgzip.h                                                               */\n/*                                                                         */\n/*    Gzip-compressed stream support.                                      */\n/*                                                                         */\n/*  Copyright 2002-2004, 2006, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTGZIP_H__\n#define __FTGZIP_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    gzip                                                               */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    GZIP Streams                                                       */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Using gzip-compressed font files.                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of Gzip-specific functions.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /************************************************************************\n  *\n  * @function:\n  *   FT_Stream_OpenGzip\n  *\n  * @description:\n  *   Open a new stream to parse gzip-compressed font files.  This is\n  *   mainly used to support the compressed `*.pcf.gz' fonts that come\n  *   with XFree86.\n  *\n  * @input:\n  *   stream ::\n  *     The target embedding stream.\n  *\n  *   source ::\n  *     The source stream.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   The source stream must be opened _before_ calling this function.\n  *\n  *   Calling the internal function `FT_Stream_Close' on the new stream will\n  *   *not* call `FT_Stream_Close' on the source stream.  None of the stream\n  *   objects will be released to the heap.\n  *\n  *   The stream implementation is very basic and resets the decompression\n  *   process each time seeking backwards is needed within the stream.\n  *\n  *   In certain builds of the library, gzip compression recognition is\n  *   automatically handled when calling @FT_New_Face or @FT_Open_Face.\n  *   This means that if no font driver is capable of handling the raw\n  *   compressed file, the library will try to open a gzipped stream from\n  *   it and re-open the face with it.\n  *\n  *   This function may return `FT_Err_Unimplemented_Feature' if your build\n  *   of FreeType was not compiled with zlib support.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Stream_OpenGzip( FT_Stream  stream,\n                      FT_Stream  source );\n\n\n /************************************************************************\n  *\n  * @function:\n  *   FT_Gzip_Uncompress\n  *\n  * @description:\n  *   Decompress a zipped input buffer into an output buffer.  This function\n  *   is modeled after zlib's `uncompress' function.\n  *\n  * @input:\n  *   memory ::\n  *     A FreeType memory handle.\n  *\n  *   input ::\n  *     The input buffer.\n  *\n  *   input_len ::\n  *     The length of the input buffer.\n  *\n  * @output:\n  *   output::\n  *     The output buffer.\n  *\n  * @inout:\n  *   output_len ::\n  *     Before calling the function, this is the the total size of the\n  *     output buffer, which must be large enough to hold the entire\n  *     uncompressed data (so the size of the uncompressed data must be\n  *     known in advance).  After calling the function, `output_len' is the\n  *     size of the used data in `output'.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function may return `FT_Err_Unimplemented_Feature' if your build\n  *   of FreeType was not compiled with zlib support.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Gzip_Uncompress( FT_Memory       memory,\n                      FT_Byte*        output,\n                      FT_ULong*       output_len,\n                      const FT_Byte*  input,\n                      FT_ULong        input_len );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGZIP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftimage.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftimage.h                                                              */\n/*                                                                         */\n/*    FreeType glyph image formats and default raster interface            */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 1996-2010, 2013, 2014 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Note: A `raster' is simply a scan-line converter, used to render      */\n  /*       FT_Outlines into FT_Bitmaps.                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTIMAGE_H__\n#define __FTIMAGE_H__\n\n\n  /* _STANDALONE_ is from ftgrays.c */\n#ifndef _STANDALONE_\n#include <ft2build.h>\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Pos                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The type FT_Pos is used to store vectorial coordinates.  Depending */\n  /*    on the context, these can represent distances in integer font      */\n  /*    units, or 16.16, or 26.6 fixed-point pixel coordinates.            */\n  /*                                                                       */\n  typedef signed long  FT_Pos;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Vector                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to store a 2D vector; coordinates are of   */\n  /*    the FT_Pos type.                                                   */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x :: The horizontal coordinate.                                    */\n  /*    y :: The vertical coordinate.                                      */\n  /*                                                                       */\n  typedef struct  FT_Vector_\n  {\n    FT_Pos  x;\n    FT_Pos  y;\n\n  } FT_Vector;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_BBox                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold an outline's bounding box, i.e., the      */\n  /*    coordinates of its extrema in the horizontal and vertical          */\n  /*    directions.                                                        */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    xMin :: The horizontal minimum (left-most).                        */\n  /*                                                                       */\n  /*    yMin :: The vertical minimum (bottom-most).                        */\n  /*                                                                       */\n  /*    xMax :: The horizontal maximum (right-most).                       */\n  /*                                                                       */\n  /*    yMax :: The vertical maximum (top-most).                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The bounding box is specified with the coordinates of the lower    */\n  /*    left and the upper right corner.  In PostScript, those values are  */\n  /*    often called (llx,lly) and (urx,ury), respectively.                */\n  /*                                                                       */\n  /*    If `yMin' is negative, this value gives the glyph's descender.     */\n  /*    Otherwise, the glyph doesn't descend below the baseline.           */\n  /*    Similarly, if `ymax' is positive, this value gives the glyph's     */\n  /*    ascender.                                                          */\n  /*                                                                       */\n  /*    `xMin' gives the horizontal distance from the glyph's origin to    */\n  /*    the left edge of the glyph's bounding box.  If `xMin' is negative, */\n  /*    the glyph extends to the left of the origin.                       */\n  /*                                                                       */\n  typedef struct  FT_BBox_\n  {\n    FT_Pos  xMin, yMin;\n    FT_Pos  xMax, yMax;\n\n  } FT_BBox;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Pixel_Mode                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type used to describe the format of pixels in a     */\n  /*    given bitmap.  Note that additional formats may be added in the    */\n  /*    future.                                                            */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_PIXEL_MODE_NONE ::                                              */\n  /*      Value~0 is reserved.                                             */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_MONO ::                                              */\n  /*      A monochrome bitmap, using 1~bit per pixel.  Note that pixels    */\n  /*      are stored in most-significant order (MSB), which means that     */\n  /*      the left-most pixel in a byte has value 128.                     */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_GRAY ::                                              */\n  /*      An 8-bit bitmap, generally used to represent anti-aliased glyph  */\n  /*      images.  Each pixel is stored in one byte.  Note that the number */\n  /*      of `gray' levels is stored in the `num_grays' field of the       */\n  /*      @FT_Bitmap structure (it generally is 256).                      */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_GRAY2 ::                                             */\n  /*      A 2-bit per pixel bitmap, used to represent embedded             */\n  /*      anti-aliased bitmaps in font files according to the OpenType     */\n  /*      specification.  We haven't found a single font using this        */\n  /*      format, however.                                                 */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_GRAY4 ::                                             */\n  /*      A 4-bit per pixel bitmap, representing embedded anti-aliased     */\n  /*      bitmaps in font files according to the OpenType specification.   */\n  /*      We haven't found a single font using this format, however.       */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_LCD ::                                               */\n  /*      An 8-bit bitmap, representing RGB or BGR decimated glyph images  */\n  /*      used for display on LCD displays; the bitmap is three times      */\n  /*      wider than the original glyph image.  See also                   */\n  /*      @FT_RENDER_MODE_LCD.                                             */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_LCD_V ::                                             */\n  /*      An 8-bit bitmap, representing RGB or BGR decimated glyph images  */\n  /*      used for display on rotated LCD displays; the bitmap is three    */\n  /*      times taller than the original glyph image.  See also            */\n  /*      @FT_RENDER_MODE_LCD_V.                                           */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_BGRA ::                                              */\n  /*      An image with four 8-bit channels per pixel, representing a      */\n  /*      color image (such as emoticons) with alpha channel.  For each    */\n  /*      pixel, the format is BGRA, which means, the blue channel comes   */\n  /*      first in memory.  The color channels are pre-multiplied and in   */\n  /*      the sRGB colorspace.  For example, full red at half-translucent  */\n  /*      opacity will be represented as `00,00,80,80', not `00,00,FF,80'. */\n  /*      See also @FT_LOAD_COLOR.                                         */\n  /*                                                                       */\n  typedef enum  FT_Pixel_Mode_\n  {\n    FT_PIXEL_MODE_NONE = 0,\n    FT_PIXEL_MODE_MONO,\n    FT_PIXEL_MODE_GRAY,\n    FT_PIXEL_MODE_GRAY2,\n    FT_PIXEL_MODE_GRAY4,\n    FT_PIXEL_MODE_LCD,\n    FT_PIXEL_MODE_LCD_V,\n    FT_PIXEL_MODE_BGRA,\n\n    FT_PIXEL_MODE_MAX      /* do not remove */\n\n  } FT_Pixel_Mode;\n\n\n  /* these constants are deprecated; use the corresponding `FT_Pixel_Mode' */\n  /* values instead.                                                       */\n#define ft_pixel_mode_none   FT_PIXEL_MODE_NONE\n#define ft_pixel_mode_mono   FT_PIXEL_MODE_MONO\n#define ft_pixel_mode_grays  FT_PIXEL_MODE_GRAY\n#define ft_pixel_mode_pal2   FT_PIXEL_MODE_GRAY2\n#define ft_pixel_mode_pal4   FT_PIXEL_MODE_GRAY4\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Bitmap                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to describe a bitmap or pixmap to the raster.     */\n  /*    Note that we now manage pixmaps of various depths through the      */\n  /*    `pixel_mode' field.                                                */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    rows         :: The number of bitmap rows.                         */\n  /*                                                                       */\n  /*    width        :: The number of pixels in bitmap row.                */\n  /*                                                                       */\n  /*    pitch        :: The pitch's absolute value is the number of bytes  */\n  /*                    taken by one bitmap row, including padding.        */\n  /*                    However, the pitch is positive when the bitmap has */\n  /*                    a `down' flow, and negative when it has an `up'    */\n  /*                    flow.  In all cases, the pitch is an offset to add */\n  /*                    to a bitmap pointer in order to go down one row.   */\n  /*                                                                       */\n  /*                    Note that `padding' means the alignment of a       */\n  /*                    bitmap to a byte border, and FreeType functions    */\n  /*                    normally align to the smallest possible integer    */\n  /*                    value.                                             */\n  /*                                                                       */\n  /*                    For the B/W rasterizer, `pitch' is always an even  */\n  /*                    number.                                            */\n  /*                                                                       */\n  /*                    To change the pitch of a bitmap (say, to make it a */\n  /*                    multiple of 4), use @FT_Bitmap_Convert.            */\n  /*                    Alternatively, you might use callback functions to */\n  /*                    directly render to the application's surface; see  */\n  /*                    the file `example2.cpp' in the tutorial for a      */\n  /*                    demonstration.                                     */\n  /*                                                                       */\n  /*    buffer       :: A typeless pointer to the bitmap buffer.  This     */\n  /*                    value should be aligned on 32-bit boundaries in    */\n  /*                    most cases.                                        */\n  /*                                                                       */\n  /*    num_grays    :: This field is only used with                       */\n  /*                    @FT_PIXEL_MODE_GRAY; it gives the number of gray   */\n  /*                    levels used in the bitmap.                         */\n  /*                                                                       */\n  /*    pixel_mode   :: The pixel mode, i.e., how pixel bits are stored.   */\n  /*                    See @FT_Pixel_Mode for possible values.            */\n  /*                                                                       */\n  /*    palette_mode :: This field is intended for paletted pixel modes;   */\n  /*                    it indicates how the palette is stored.  Not       */\n  /*                    used currently.                                    */\n  /*                                                                       */\n  /*    palette      :: A typeless pointer to the bitmap palette; this     */\n  /*                    field is intended for paletted pixel modes.  Not   */\n  /*                    used currently.                                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*   For now, the only pixel modes supported by FreeType are mono and    */\n  /*   grays.  However, drivers might be added in the future to support    */\n  /*   more `colorful' options.                                            */\n  /*                                                                       */\n  typedef struct  FT_Bitmap_\n  {\n    unsigned int    rows;\n    unsigned int    width;\n    int             pitch;\n    unsigned char*  buffer;\n    unsigned short  num_grays;\n    unsigned char   pixel_mode;\n    unsigned char   palette_mode;\n    void*           palette;\n\n  } FT_Bitmap;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    outline_processing                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Outline                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure is used to describe an outline to the scan-line     */\n  /*    converter.                                                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    n_contours :: The number of contours in the outline.               */\n  /*                                                                       */\n  /*    n_points   :: The number of points in the outline.                 */\n  /*                                                                       */\n  /*    points     :: A pointer to an array of `n_points' @FT_Vector       */\n  /*                  elements, giving the outline's point coordinates.    */\n  /*                                                                       */\n  /*    tags       :: A pointer to an array of `n_points' chars, giving    */\n  /*                  each outline point's type.                           */\n  /*                                                                       */\n  /*                  If bit~0 is unset, the point is `off' the curve,     */\n  /*                  i.e., a Bézier control point, while it is `on' if    */\n  /*                  set.                                                 */\n  /*                                                                       */\n  /*                  Bit~1 is meaningful for `off' points only.  If set,  */\n  /*                  it indicates a third-order Bézier arc control point; */\n  /*                  and a second-order control point if unset.           */\n  /*                                                                       */\n  /*                  If bit~2 is set, bits 5-7 contain the drop-out mode  */\n  /*                  (as defined in the OpenType specification; the value */\n  /*                  is the same as the argument to the SCANMODE          */\n  /*                  instruction).                                        */\n  /*                                                                       */\n  /*                  Bits 3 and~4 are reserved for internal purposes.     */\n  /*                                                                       */\n  /*    contours   :: An array of `n_contours' shorts, giving the end      */\n  /*                  point of each contour within the outline.  For       */\n  /*                  example, the first contour is defined by the points  */\n  /*                  `0' to `contours[0]', the second one is defined by   */\n  /*                  the points `contours[0]+1' to `contours[1]', etc.    */\n  /*                                                                       */\n  /*    flags      :: A set of bit flags used to characterize the outline  */\n  /*                  and give hints to the scan-converter and hinter on   */\n  /*                  how to convert/grid-fit it.  See @FT_OUTLINE_XXX.    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The B/W rasterizer only checks bit~2 in the `tags' array for the   */\n  /*    first point of each contour.  The drop-out mode as given with      */\n  /*    @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, and       */\n  /*    @FT_OUTLINE_INCLUDE_STUBS in `flags' is then overridden.           */\n  /*                                                                       */\n  typedef struct  FT_Outline_\n  {\n    short       n_contours;      /* number of contours in glyph        */\n    short       n_points;        /* number of points in the glyph      */\n\n    FT_Vector*  points;          /* the outline's points               */\n    char*       tags;            /* the points flags                   */\n    short*      contours;        /* the contour end points             */\n\n    int         flags;           /* outline masks                      */\n\n  } FT_Outline;\n\n  /* */\n\n  /* Following limits must be consistent with */\n  /* FT_Outline.{n_contours,n_points}         */\n#define FT_OUTLINE_CONTOURS_MAX  SHRT_MAX\n#define FT_OUTLINE_POINTS_MAX    SHRT_MAX\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_OUTLINE_XXX                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit-field constants use for the flags in an outline's    */\n  /*    `flags' field.                                                     */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_OUTLINE_NONE ::                                                 */\n  /*      Value~0 is reserved.                                             */\n  /*                                                                       */\n  /*    FT_OUTLINE_OWNER ::                                                */\n  /*      If set, this flag indicates that the outline's field arrays      */\n  /*      (i.e., `points', `flags', and `contours') are `owned' by the     */\n  /*      outline object, and should thus be freed when it is destroyed.   */\n  /*                                                                       */\n  /*    FT_OUTLINE_EVEN_ODD_FILL ::                                        */\n  /*      By default, outlines are filled using the non-zero winding rule. */\n  /*      If set to 1, the outline will be filled using the even-odd fill  */\n  /*      rule (only works with the smooth rasterizer).                    */\n  /*                                                                       */\n  /*    FT_OUTLINE_REVERSE_FILL ::                                         */\n  /*      By default, outside contours of an outline are oriented in       */\n  /*      clock-wise direction, as defined in the TrueType specification.  */\n  /*      This flag is set if the outline uses the opposite direction      */\n  /*      (typically for Type~1 fonts).  This flag is ignored by the scan  */\n  /*      converter.                                                       */\n  /*                                                                       */\n  /*    FT_OUTLINE_IGNORE_DROPOUTS ::                                      */\n  /*      By default, the scan converter will try to detect drop-outs in   */\n  /*      an outline and correct the glyph bitmap to ensure consistent     */\n  /*      shape continuity.  If set, this flag hints the scan-line         */\n  /*      converter to ignore such cases.  See below for more information. */\n  /*                                                                       */\n  /*    FT_OUTLINE_SMART_DROPOUTS ::                                       */\n  /*      Select smart dropout control.  If unset, use simple dropout      */\n  /*      control.  Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set.  See    */\n  /*      below for more information.                                      */\n  /*                                                                       */\n  /*    FT_OUTLINE_INCLUDE_STUBS ::                                        */\n  /*      If set, turn pixels on for `stubs', otherwise exclude them.      */\n  /*      Ignored if @FT_OUTLINE_IGNORE_DROPOUTS is set.  See below for    */\n  /*      more information.                                                */\n  /*                                                                       */\n  /*    FT_OUTLINE_HIGH_PRECISION ::                                       */\n  /*      This flag indicates that the scan-line converter should try to   */\n  /*      convert this outline to bitmaps with the highest possible        */\n  /*      quality.  It is typically set for small character sizes.  Note   */\n  /*      that this is only a hint that might be completely ignored by a   */\n  /*      given scan-converter.                                            */\n  /*                                                                       */\n  /*    FT_OUTLINE_SINGLE_PASS ::                                          */\n  /*      This flag is set to force a given scan-converter to only use a   */\n  /*      single pass over the outline to render a bitmap glyph image.     */\n  /*      Normally, it is set for very large character sizes.  It is only  */\n  /*      a hint that might be completely ignored by a given               */\n  /*      scan-converter.                                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The flags @FT_OUTLINE_IGNORE_DROPOUTS, @FT_OUTLINE_SMART_DROPOUTS, */\n  /*    and @FT_OUTLINE_INCLUDE_STUBS are ignored by the smooth            */\n  /*    rasterizer.                                                        */\n  /*                                                                       */\n  /*    There exists a second mechanism to pass the drop-out mode to the   */\n  /*    B/W rasterizer; see the `tags' field in @FT_Outline.               */\n  /*                                                                       */\n  /*    Please refer to the description of the `SCANTYPE' instruction in   */\n  /*    the OpenType specification (in file `ttinst1.doc') how simple      */\n  /*    drop-outs, smart drop-outs, and stubs are defined.                 */\n  /*                                                                       */\n#define FT_OUTLINE_NONE             0x0\n#define FT_OUTLINE_OWNER            0x1\n#define FT_OUTLINE_EVEN_ODD_FILL    0x2\n#define FT_OUTLINE_REVERSE_FILL     0x4\n#define FT_OUTLINE_IGNORE_DROPOUTS  0x8\n#define FT_OUTLINE_SMART_DROPOUTS   0x10\n#define FT_OUTLINE_INCLUDE_STUBS    0x20\n\n#define FT_OUTLINE_HIGH_PRECISION   0x100\n#define FT_OUTLINE_SINGLE_PASS      0x200\n\n\n  /* these constants are deprecated; use the corresponding */\n  /* `FT_OUTLINE_XXX' values instead                       */\n#define ft_outline_none             FT_OUTLINE_NONE\n#define ft_outline_owner            FT_OUTLINE_OWNER\n#define ft_outline_even_odd_fill    FT_OUTLINE_EVEN_ODD_FILL\n#define ft_outline_reverse_fill     FT_OUTLINE_REVERSE_FILL\n#define ft_outline_ignore_dropouts  FT_OUTLINE_IGNORE_DROPOUTS\n#define ft_outline_high_precision   FT_OUTLINE_HIGH_PRECISION\n#define ft_outline_single_pass      FT_OUTLINE_SINGLE_PASS\n\n  /* */\n\n#define FT_CURVE_TAG( flag )  ( flag & 3 )\n\n#define FT_CURVE_TAG_ON            1\n#define FT_CURVE_TAG_CONIC         0\n#define FT_CURVE_TAG_CUBIC         2\n\n#define FT_CURVE_TAG_HAS_SCANMODE  4\n\n#define FT_CURVE_TAG_TOUCH_X       8  /* reserved for the TrueType hinter */\n#define FT_CURVE_TAG_TOUCH_Y      16  /* reserved for the TrueType hinter */\n\n#define FT_CURVE_TAG_TOUCH_BOTH    ( FT_CURVE_TAG_TOUCH_X | \\\n                                     FT_CURVE_TAG_TOUCH_Y )\n\n#define FT_Curve_Tag_On       FT_CURVE_TAG_ON\n#define FT_Curve_Tag_Conic    FT_CURVE_TAG_CONIC\n#define FT_Curve_Tag_Cubic    FT_CURVE_TAG_CUBIC\n#define FT_Curve_Tag_Touch_X  FT_CURVE_TAG_TOUCH_X\n#define FT_Curve_Tag_Touch_Y  FT_CURVE_TAG_TOUCH_Y\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_MoveToFunc                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `move  */\n  /*    to' function during outline walking/decomposition.                 */\n  /*                                                                       */\n  /*    A `move to' is emitted to start a new contour in an outline.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    to   :: A pointer to the target point of the `move to'.            */\n  /*                                                                       */\n  /*    user :: A typeless pointer, which is passed from the caller of the */\n  /*            decomposition function.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_MoveToFunc)( const FT_Vector*  to,\n                            void*             user );\n\n#define FT_Outline_MoveTo_Func  FT_Outline_MoveToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_LineToFunc                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `line  */\n  /*    to' function during outline walking/decomposition.                 */\n  /*                                                                       */\n  /*    A `line to' is emitted to indicate a segment in the outline.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    to   :: A pointer to the target point of the `line to'.            */\n  /*                                                                       */\n  /*    user :: A typeless pointer, which is passed from the caller of the */\n  /*            decomposition function.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_LineToFunc)( const FT_Vector*  to,\n                            void*             user );\n\n#define FT_Outline_LineTo_Func  FT_Outline_LineToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_ConicToFunc                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `conic */\n  /*    to' function during outline walking or decomposition.              */\n  /*                                                                       */\n  /*    A `conic to' is emitted to indicate a second-order Bézier arc in   */\n  /*    the outline.                                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    control :: An intermediate control point between the last position */\n  /*               and the new target in `to'.                             */\n  /*                                                                       */\n  /*    to      :: A pointer to the target end point of the conic arc.     */\n  /*                                                                       */\n  /*    user    :: A typeless pointer, which is passed from the caller of  */\n  /*               the decomposition function.                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_ConicToFunc)( const FT_Vector*  control,\n                             const FT_Vector*  to,\n                             void*             user );\n\n#define FT_Outline_ConicTo_Func  FT_Outline_ConicToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_CubicToFunc                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `cubic */\n  /*    to' function during outline walking or decomposition.              */\n  /*                                                                       */\n  /*    A `cubic to' is emitted to indicate a third-order Bézier arc.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    control1 :: A pointer to the first Bézier control point.           */\n  /*                                                                       */\n  /*    control2 :: A pointer to the second Bézier control point.          */\n  /*                                                                       */\n  /*    to       :: A pointer to the target end point.                     */\n  /*                                                                       */\n  /*    user     :: A typeless pointer, which is passed from the caller of */\n  /*                the decomposition function.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_CubicToFunc)( const FT_Vector*  control1,\n                             const FT_Vector*  control2,\n                             const FT_Vector*  to,\n                             void*             user );\n\n#define FT_Outline_CubicTo_Func  FT_Outline_CubicToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Outline_Funcs                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure to hold various function pointers used during outline  */\n  /*    decomposition in order to emit segments, conic, and cubic Béziers. */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    move_to  :: The `move to' emitter.                                 */\n  /*                                                                       */\n  /*    line_to  :: The segment emitter.                                   */\n  /*                                                                       */\n  /*    conic_to :: The second-order Bézier arc emitter.                   */\n  /*                                                                       */\n  /*    cubic_to :: The third-order Bézier arc emitter.                    */\n  /*                                                                       */\n  /*    shift    :: The shift that is applied to coordinates before they   */\n  /*                are sent to the emitter.                               */\n  /*                                                                       */\n  /*    delta    :: The delta that is applied to coordinates before they   */\n  /*                are sent to the emitter, but after the shift.          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The point coordinates sent to the emitters are the transformed     */\n  /*    version of the original coordinates (this is important for high    */\n  /*    accuracy during scan-conversion).  The transformation is simple:   */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      x' = (x << shift) - delta                                        */\n  /*      y' = (x << shift) - delta                                        */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Set the values of `shift' and `delta' to~0 to get the original     */\n  /*    point coordinates.                                                 */\n  /*                                                                       */\n  typedef struct  FT_Outline_Funcs_\n  {\n    FT_Outline_MoveToFunc   move_to;\n    FT_Outline_LineToFunc   line_to;\n    FT_Outline_ConicToFunc  conic_to;\n    FT_Outline_CubicToFunc  cubic_to;\n\n    int                     shift;\n    FT_Pos                  delta;\n\n  } FT_Outline_Funcs;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_IMAGE_TAG                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro converts four-letter tags to an unsigned long type.     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since many 16-bit compilers don't like 32-bit enumerations, you    */\n  /*    should redefine this macro in case of problems to something like   */\n  /*    this:                                                              */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  value         */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    to get a simple enumeration without assigning special numbers.     */\n  /*                                                                       */\n#ifndef FT_IMAGE_TAG\n#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  \\\n          value = ( ( (unsigned long)_x1 << 24 ) | \\\n                    ( (unsigned long)_x2 << 16 ) | \\\n                    ( (unsigned long)_x3 << 8  ) | \\\n                      (unsigned long)_x4         )\n#endif /* FT_IMAGE_TAG */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Glyph_Format                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type used to describe the format of a given glyph   */\n  /*    image.  Note that this version of FreeType only supports two image */\n  /*    formats, even though future font drivers will be able to register  */\n  /*    their own format.                                                  */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_GLYPH_FORMAT_NONE ::                                            */\n  /*      The value~0 is reserved.                                         */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_COMPOSITE ::                                       */\n  /*      The glyph image is a composite of several other images.  This    */\n  /*      format is _only_ used with @FT_LOAD_NO_RECURSE, and is used to   */\n  /*      report compound glyphs (like accented characters).               */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_BITMAP ::                                          */\n  /*      The glyph image is a bitmap, and can be described as an          */\n  /*      @FT_Bitmap.  You generally need to access the `bitmap' field of  */\n  /*      the @FT_GlyphSlotRec structure to read it.                       */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_OUTLINE ::                                         */\n  /*      The glyph image is a vectorial outline made of line segments     */\n  /*      and Bézier arcs; it can be described as an @FT_Outline; you      */\n  /*      generally want to access the `outline' field of the              */\n  /*      @FT_GlyphSlotRec structure to read it.                           */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_PLOTTER ::                                         */\n  /*      The glyph image is a vectorial path with no inside and outside   */\n  /*      contours.  Some Type~1 fonts, like those in the Hershey family,  */\n  /*      contain glyphs in this format.  These are described as           */\n  /*      @FT_Outline, but FreeType isn't currently capable of rendering   */\n  /*      them correctly.                                                  */\n  /*                                                                       */\n  typedef enum  FT_Glyph_Format_\n  {\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ),\n\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ),\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP,    'b', 'i', 't', 's' ),\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE,   'o', 'u', 't', 'l' ),\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER,   'p', 'l', 'o', 't' )\n\n  } FT_Glyph_Format;\n\n\n  /* these constants are deprecated; use the corresponding */\n  /* `FT_Glyph_Format' values instead.                     */\n#define ft_glyph_format_none       FT_GLYPH_FORMAT_NONE\n#define ft_glyph_format_composite  FT_GLYPH_FORMAT_COMPOSITE\n#define ft_glyph_format_bitmap     FT_GLYPH_FORMAT_BITMAP\n#define ft_glyph_format_outline    FT_GLYPH_FORMAT_OUTLINE\n#define ft_glyph_format_plotter    FT_GLYPH_FORMAT_PLOTTER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****            R A S T E R   D E F I N I T I O N S                *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* A raster is a scan converter, in charge of rendering an outline into  */\n  /* a a bitmap.  This section contains the public API for rasters.        */\n  /*                                                                       */\n  /* Note that in FreeType 2, all rasters are now encapsulated within      */\n  /* specific modules called `renderers'.  See `ftrender.h' for more       */\n  /* details on renderers.                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    raster                                                             */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Scanline Converter                                                 */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How vectorial outlines are converted into bitmaps and pixmaps.     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains technical definitions.                       */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Raster                                                          */\n  /*    FT_Span                                                            */\n  /*    FT_SpanFunc                                                        */\n  /*                                                                       */\n  /*    FT_Raster_Params                                                   */\n  /*    FT_RASTER_FLAG_XXX                                                 */\n  /*                                                                       */\n  /*    FT_Raster_NewFunc                                                  */\n  /*    FT_Raster_DoneFunc                                                 */\n  /*    FT_Raster_ResetFunc                                                */\n  /*    FT_Raster_SetModeFunc                                              */\n  /*    FT_Raster_RenderFunc                                               */\n  /*    FT_Raster_Funcs                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Raster                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle (pointer) to a raster object.  Each object can be */\n  /*    used independently to convert an outline into a bitmap or pixmap.  */\n  /*                                                                       */\n  typedef struct FT_RasterRec_*  FT_Raster;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Span                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a single span of gray pixels when        */\n  /*    rendering an anti-aliased bitmap.                                  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x        :: The span's horizontal start position.                  */\n  /*                                                                       */\n  /*    len      :: The span's length in pixels.                           */\n  /*                                                                       */\n  /*    coverage :: The span color/coverage, ranging from 0 (background)   */\n  /*                to 255 (foreground).                                   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This structure is used by the span drawing callback type named     */\n  /*    @FT_SpanFunc that takes the y~coordinate of the span as a          */\n  /*    parameter.                                                         */\n  /*                                                                       */\n  /*    The coverage value is always between 0 and 255.  If you want less  */\n  /*    gray values, the callback function has to reduce them.             */\n  /*                                                                       */\n  typedef struct  FT_Span_\n  {\n    short           x;\n    unsigned short  len;\n    unsigned char   coverage;\n\n  } FT_Span;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_SpanFunc                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used as a call-back by the anti-aliased renderer in     */\n  /*    order to let client applications draw themselves the gray pixel    */\n  /*    spans on each scan line.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    y     :: The scanline's y~coordinate.                              */\n  /*                                                                       */\n  /*    count :: The number of spans to draw on this scanline.             */\n  /*                                                                       */\n  /*    spans :: A table of `count' spans to draw on the scanline.         */\n  /*                                                                       */\n  /*    user  :: User-supplied data that is passed to the callback.        */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This callback allows client applications to directly render the    */\n  /*    gray spans of the anti-aliased bitmap to any kind of surfaces.     */\n  /*                                                                       */\n  /*    This can be used to write anti-aliased outlines directly to a      */\n  /*    given background bitmap, and even perform translucency.            */\n  /*                                                                       */\n  /*    Note that the `count' field cannot be greater than a fixed value   */\n  /*    defined by the `FT_MAX_GRAY_SPANS' configuration macro in          */\n  /*    `ftoption.h'.  By default, this value is set to~32, which means    */\n  /*    that if there are more than 32~spans on a given scanline, the      */\n  /*    callback is called several times with the same `y' parameter in    */\n  /*    order to draw all callbacks.                                       */\n  /*                                                                       */\n  /*    Otherwise, the callback is only called once per scan-line, and     */\n  /*    only for those scanlines that do have `gray' pixels on them.       */\n  /*                                                                       */\n  typedef void\n  (*FT_SpanFunc)( int             y,\n                  int             count,\n                  const FT_Span*  spans,\n                  void*           user );\n\n#define FT_Raster_Span_Func  FT_SpanFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_BitTest_Func                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Deprecated, unimplemented.                                         */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_BitTest_Func)( int    y,\n                             int    x,\n                             void*  user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_BitSet_Func                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Deprecated, unimplemented.                                         */\n  /*                                                                       */\n  typedef void\n  (*FT_Raster_BitSet_Func)( int    y,\n                            int    x,\n                            void*  user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_RASTER_FLAG_XXX                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit flag constants as used in the `flags' field of a     */\n  /*    @FT_Raster_Params structure.                                       */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_RASTER_FLAG_DEFAULT :: This value is 0.                         */\n  /*                                                                       */\n  /*    FT_RASTER_FLAG_AA      :: This flag is set to indicate that an     */\n  /*                              anti-aliased glyph image should be       */\n  /*                              generated.  Otherwise, it will be        */\n  /*                              monochrome (1-bit).                      */\n  /*                                                                       */\n  /*    FT_RASTER_FLAG_DIRECT  :: This flag is set to indicate direct      */\n  /*                              rendering.  In this mode, client         */\n  /*                              applications must provide their own span */\n  /*                              callback.  This lets them directly       */\n  /*                              draw or compose over an existing bitmap. */\n  /*                              If this bit is not set, the target       */\n  /*                              pixmap's buffer _must_ be zeroed before  */\n  /*                              rendering.                               */\n  /*                                                                       */\n  /*                              Direct rendering is only possible with   */\n  /*                              anti-aliased glyphs.                     */\n  /*                                                                       */\n  /*    FT_RASTER_FLAG_CLIP    :: This flag is only used in direct         */\n  /*                              rendering mode.  If set, the output will */\n  /*                              be clipped to a box specified in the     */\n  /*                              `clip_box' field of the                  */\n  /*                              @FT_Raster_Params structure.             */\n  /*                                                                       */\n  /*                              Note that by default, the glyph bitmap   */\n  /*                              is clipped to the target pixmap, except  */\n  /*                              in direct rendering mode where all spans */\n  /*                              are generated if no clipping box is set. */\n  /*                                                                       */\n#define FT_RASTER_FLAG_DEFAULT  0x0\n#define FT_RASTER_FLAG_AA       0x1\n#define FT_RASTER_FLAG_DIRECT   0x2\n#define FT_RASTER_FLAG_CLIP     0x4\n\n  /* these constants are deprecated; use the corresponding */\n  /* `FT_RASTER_FLAG_XXX' values instead                   */\n#define ft_raster_flag_default  FT_RASTER_FLAG_DEFAULT\n#define ft_raster_flag_aa       FT_RASTER_FLAG_AA\n#define ft_raster_flag_direct   FT_RASTER_FLAG_DIRECT\n#define ft_raster_flag_clip     FT_RASTER_FLAG_CLIP\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Raster_Params                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure to hold the arguments used by a raster's render        */\n  /*    function.                                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    target      :: The target bitmap.                                  */\n  /*                                                                       */\n  /*    source      :: A pointer to the source glyph image (e.g., an       */\n  /*                   @FT_Outline).                                       */\n  /*                                                                       */\n  /*    flags       :: The rendering flags.                                */\n  /*                                                                       */\n  /*    gray_spans  :: The gray span drawing callback.                     */\n  /*                                                                       */\n  /*    black_spans :: Unused.                                             */\n  /*                                                                       */\n  /*    bit_test    :: Unused.                                             */\n  /*                                                                       */\n  /*    bit_set     :: Unused.                                             */\n  /*                                                                       */\n  /*    user        :: User-supplied data that is passed to each drawing   */\n  /*                   callback.                                           */\n  /*                                                                       */\n  /*    clip_box    :: An optional clipping box.  It is only used in       */\n  /*                   direct rendering mode.  Note that coordinates here  */\n  /*                   should be expressed in _integer_ pixels (and not in */\n  /*                   26.6 fixed-point units).                            */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An anti-aliased glyph bitmap is drawn if the @FT_RASTER_FLAG_AA    */\n  /*    bit flag is set in the `flags' field, otherwise a monochrome       */\n  /*    bitmap is generated.                                               */\n  /*                                                                       */\n  /*    If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the      */\n  /*    raster will call the `gray_spans' callback to draw gray pixel      */\n  /*    spans.  This allows direct composition over a pre-existing bitmap  */\n  /*    through user-provided callbacks to perform the span drawing and    */\n  /*    composition.    Not supported by the monochrome rasterizer.        */\n  /*                                                                       */\n  typedef struct  FT_Raster_Params_\n  {\n    const FT_Bitmap*        target;\n    const void*             source;\n    int                     flags;\n    FT_SpanFunc             gray_spans;\n    FT_SpanFunc             black_spans;  /* unused */\n    FT_Raster_BitTest_Func  bit_test;     /* unused */\n    FT_Raster_BitSet_Func   bit_set;      /* unused */\n    void*                   user;\n    FT_BBox                 clip_box;\n\n  } FT_Raster_Params;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_NewFunc                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to create a new raster object.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory :: A handle to the memory allocator.                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    raster :: A handle to the new raster object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `memory' parameter is a typeless pointer in order to avoid     */\n  /*    un-wanted dependencies on the rest of the FreeType code.  In       */\n  /*    practice, it is an @FT_Memory object, i.e., a handle to the        */\n  /*    standard FreeType memory allocator.  However, this field can be    */\n  /*    completely ignored by a given raster implementation.               */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_NewFunc)( void*       memory,\n                        FT_Raster*  raster );\n\n#define FT_Raster_New_Func  FT_Raster_NewFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_DoneFunc                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to destroy a given raster object.                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster :: A handle to the raster object.                           */\n  /*                                                                       */\n  typedef void\n  (*FT_Raster_DoneFunc)( FT_Raster  raster );\n\n#define FT_Raster_Done_Func  FT_Raster_DoneFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_ResetFunc                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType provides an area of memory called the `render pool',      */\n  /*    available to all registered rasters.  This pool can be freely used */\n  /*    during a given scan-conversion but is shared by all rasters.  Its  */\n  /*    content is thus transient.                                         */\n  /*                                                                       */\n  /*    This function is called each time the render pool changes, or just */\n  /*    after a new raster object is created.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster    :: A handle to the new raster object.                    */\n  /*                                                                       */\n  /*    pool_base :: The address in memory of the render pool.             */\n  /*                                                                       */\n  /*    pool_size :: The size in bytes of the render pool.                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Rasters can ignore the render pool and rely on dynamic memory      */\n  /*    allocation if they want to (a handle to the memory allocator is    */\n  /*    passed to the raster constructor).  However, this is not           */\n  /*    recommended for efficiency purposes.                               */\n  /*                                                                       */\n  typedef void\n  (*FT_Raster_ResetFunc)( FT_Raster       raster,\n                          unsigned char*  pool_base,\n                          unsigned long   pool_size );\n\n#define FT_Raster_Reset_Func  FT_Raster_ResetFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_SetModeFunc                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is a generic facility to change modes or attributes  */\n  /*    in a given raster.  This can be used for debugging purposes, or    */\n  /*    simply to allow implementation-specific `features' in a given      */\n  /*    raster module.                                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster :: A handle to the new raster object.                       */\n  /*                                                                       */\n  /*    mode   :: A 4-byte tag used to name the mode or property.          */\n  /*                                                                       */\n  /*    args   :: A pointer to the new mode/property to use.               */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_SetModeFunc)( FT_Raster      raster,\n                            unsigned long  mode,\n                            void*          args );\n\n#define FT_Raster_Set_Mode_Func  FT_Raster_SetModeFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_RenderFunc                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Invoke a given raster to scan-convert a given glyph image into a   */\n  /*    target bitmap.                                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster :: A handle to the raster object.                           */\n  /*                                                                       */\n  /*    params :: A pointer to an @FT_Raster_Params structure used to      */\n  /*              store the rendering parameters.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0~means success.                                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The exact format of the source image depends on the raster's glyph */\n  /*    format defined in its @FT_Raster_Funcs structure.  It can be an    */\n  /*    @FT_Outline or anything else in order to support a large array of  */\n  /*    glyph formats.                                                     */\n  /*                                                                       */\n  /*    Note also that the render function can fail and return a           */\n  /*    `FT_Err_Unimplemented_Feature' error code if the raster used does  */\n  /*    not support direct composition.                                    */\n  /*                                                                       */\n  /*    XXX: For now, the standard raster doesn't support direct           */\n  /*         composition but this should change for the final release (see */\n  /*         the files `demos/src/ftgrays.c' and `demos/src/ftgrays2.c'    */\n  /*         for examples of distinct implementations that support direct  */\n  /*         composition).                                                 */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_RenderFunc)( FT_Raster                raster,\n                           const FT_Raster_Params*  params );\n\n#define FT_Raster_Render_Func  FT_Raster_RenderFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Raster_Funcs                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   A structure used to describe a given raster class to the library.   */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    glyph_format  :: The supported glyph format for this raster.       */\n  /*                                                                       */\n  /*    raster_new    :: The raster constructor.                           */\n  /*                                                                       */\n  /*    raster_reset  :: Used to reset the render pool within the raster.  */\n  /*                                                                       */\n  /*    raster_render :: A function to render a glyph into a given bitmap. */\n  /*                                                                       */\n  /*    raster_done   :: The raster destructor.                            */\n  /*                                                                       */\n  typedef struct  FT_Raster_Funcs_\n  {\n    FT_Glyph_Format        glyph_format;\n    FT_Raster_NewFunc      raster_new;\n    FT_Raster_ResetFunc    raster_reset;\n    FT_Raster_SetModeFunc  raster_set_mode;\n    FT_Raster_RenderFunc   raster_render;\n    FT_Raster_DoneFunc     raster_done;\n\n  } FT_Raster_Funcs;\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTIMAGE_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "ext/freetype2/include/ftincrem.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftincrem.h                                                             */\n/*                                                                         */\n/*    FreeType incremental loading (specification).                        */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2006-2008, 2010, 2014 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTINCREM_H__\n#define __FTINCREM_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /***************************************************************************\n   *\n   * @section:\n   *    incremental\n   *\n   * @title:\n   *    Incremental Loading\n   *\n   * @abstract:\n   *    Custom Glyph Loading.\n   *\n   * @description:\n   *   This section contains various functions used to perform so-called\n   *   `incremental' glyph loading.  This is a mode where all glyphs loaded\n   *   from a given @FT_Face are provided by the client application.\n   *\n   *   Apart from that, all other tables are loaded normally from the font\n   *   file.  This mode is useful when FreeType is used within another\n   *   engine, e.g., a PostScript Imaging Processor.\n   *\n   *   To enable this mode, you must use @FT_Open_Face, passing an\n   *   @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an\n   *   @FT_Incremental_Interface value.  See the comments for\n   *   @FT_Incremental_InterfaceRec for an example.\n   *\n   */\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental\n   *\n   * @description:\n   *   An opaque type describing a user-provided object used to implement\n   *   `incremental' glyph loading within FreeType.  This is used to support\n   *   embedded fonts in certain environments (e.g., PostScript interpreters),\n   *   where the glyph data isn't in the font file, or must be overridden by\n   *   different values.\n   *\n   * @note:\n   *   It is up to client applications to create and implement @FT_Incremental\n   *   objects, as long as they provide implementations for the methods\n   *   @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc\n   *   and @FT_Incremental_GetGlyphMetricsFunc.\n   *\n   *   See the description of @FT_Incremental_InterfaceRec to understand how\n   *   to use incremental objects with FreeType.\n   *\n   */\n  typedef struct FT_IncrementalRec_*  FT_Incremental;\n\n\n  /***************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_MetricsRec\n   *\n   * @description:\n   *   A small structure used to contain the basic glyph metrics returned\n   *   by the @FT_Incremental_GetGlyphMetricsFunc method.\n   *\n   * @fields:\n   *   bearing_x ::\n   *     Left bearing, in font units.\n   *\n   *   bearing_y ::\n   *     Top bearing, in font units.\n   *\n   *   advance ::\n   *     Horizontal component of glyph advance, in font units.\n   *\n   *   advance_v ::\n   *     Vertical component of glyph advance, in font units.\n   *\n   * @note:\n   *   These correspond to horizontal or vertical metrics depending on the\n   *   value of the `vertical' argument to the function\n   *   @FT_Incremental_GetGlyphMetricsFunc.\n   *\n   */\n  typedef struct  FT_Incremental_MetricsRec_\n  {\n    FT_Long  bearing_x;\n    FT_Long  bearing_y;\n    FT_Long  advance;\n    FT_Long  advance_v;     /* since 2.3.12 */\n\n  } FT_Incremental_MetricsRec;\n\n\n  /***************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_Metrics\n   *\n   * @description:\n   *   A handle to an @FT_Incremental_MetricsRec structure.\n   *\n   */\n   typedef struct FT_Incremental_MetricsRec_*  FT_Incremental_Metrics;\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_GetGlyphDataFunc\n   *\n   * @description:\n   *   A function called by FreeType to access a given glyph's data bytes\n   *   during @FT_Load_Glyph or @FT_Load_Char if incremental loading is\n   *   enabled.\n   *\n   *   Note that the format of the glyph's data bytes depends on the font\n   *   file format.  For TrueType, it must correspond to the raw bytes within\n   *   the `glyf' table.  For PostScript formats, it must correspond to the\n   *   *unencrypted* charstring bytes, without any `lenIV' header.  It is\n   *   undefined for any other format.\n   *\n   * @input:\n   *   incremental ::\n   *     Handle to an opaque @FT_Incremental handle provided by the client\n   *     application.\n   *\n   *   glyph_index ::\n   *     Index of relevant glyph.\n   *\n   * @output:\n   *   adata ::\n   *     A structure describing the returned glyph data bytes (which will be\n   *     accessed as a read-only byte block).\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   If this function returns successfully the method\n   *   @FT_Incremental_FreeGlyphDataFunc will be called later to release\n   *   the data bytes.\n   *\n   *   Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for\n   *   compound glyphs.\n   *\n   */\n  typedef FT_Error\n  (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental  incremental,\n                                      FT_UInt         glyph_index,\n                                      FT_Data*        adata );\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_FreeGlyphDataFunc\n   *\n   * @description:\n   *   A function used to release the glyph data bytes returned by a\n   *   successful call to @FT_Incremental_GetGlyphDataFunc.\n   *\n   * @input:\n   *   incremental ::\n   *     A handle to an opaque @FT_Incremental handle provided by the client\n   *     application.\n   *\n   *   data ::\n   *     A structure describing the glyph data bytes (which will be accessed\n   *     as a read-only byte block).\n   *\n   */\n  typedef void\n  (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental  incremental,\n                                       FT_Data*        data );\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_GetGlyphMetricsFunc\n   *\n   * @description:\n   *   A function used to retrieve the basic metrics of a given glyph index\n   *   before accessing its data.  This is necessary because, in certain\n   *   formats like TrueType, the metrics are stored in a different place from\n   *   the glyph images proper.\n   *\n   * @input:\n   *   incremental ::\n   *     A handle to an opaque @FT_Incremental handle provided by the client\n   *     application.\n   *\n   *   glyph_index ::\n   *     Index of relevant glyph.\n   *\n   *   vertical ::\n   *     If true, return vertical metrics.\n   *\n   *   ametrics ::\n   *     This parameter is used for both input and output.\n   *     The original glyph metrics, if any, in font units.  If metrics are\n   *     not available all the values must be set to zero.\n   *\n   * @output:\n   *   ametrics ::\n   *     The replacement glyph metrics in font units.\n   *\n   */\n  typedef FT_Error\n  (*FT_Incremental_GetGlyphMetricsFunc)\n                      ( FT_Incremental              incremental,\n                        FT_UInt                     glyph_index,\n                        FT_Bool                     vertical,\n                        FT_Incremental_MetricsRec  *ametrics );\n\n\n  /**************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_FuncsRec\n   *\n   * @description:\n   *   A table of functions for accessing fonts that load data\n   *   incrementally.  Used in @FT_Incremental_InterfaceRec.\n   *\n   * @fields:\n   *   get_glyph_data ::\n   *     The function to get glyph data.  Must not be null.\n   *\n   *   free_glyph_data ::\n   *     The function to release glyph data.  Must not be null.\n   *\n   *   get_glyph_metrics ::\n   *     The function to get glyph metrics.  May be null if the font does\n   *     not provide overriding glyph metrics.\n   *\n   */\n  typedef struct  FT_Incremental_FuncsRec_\n  {\n    FT_Incremental_GetGlyphDataFunc     get_glyph_data;\n    FT_Incremental_FreeGlyphDataFunc    free_glyph_data;\n    FT_Incremental_GetGlyphMetricsFunc  get_glyph_metrics;\n\n  } FT_Incremental_FuncsRec;\n\n\n  /***************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_InterfaceRec\n   *\n   * @description:\n   *   A structure to be used with @FT_Open_Face to indicate that the user\n   *   wants to support incremental glyph loading.  You should use it with\n   *   @FT_PARAM_TAG_INCREMENTAL as in the following example:\n   *\n   *     {\n   *       FT_Incremental_InterfaceRec  inc_int;\n   *       FT_Parameter                 parameter;\n   *       FT_Open_Args                 open_args;\n   *\n   *\n   *       // set up incremental descriptor\n   *       inc_int.funcs  = my_funcs;\n   *       inc_int.object = my_object;\n   *\n   *       // set up optional parameter\n   *       parameter.tag  = FT_PARAM_TAG_INCREMENTAL;\n   *       parameter.data = &inc_int;\n   *\n   *       // set up FT_Open_Args structure\n   *       open_args.flags      = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;\n   *       open_args.pathname   = my_font_pathname;\n   *       open_args.num_params = 1;\n   *       open_args.params     = &parameter; // we use one optional argument\n   *\n   *       // open the font\n   *       error = FT_Open_Face( library, &open_args, index, &face );\n   *       ...\n   *     }\n   *\n   */\n  typedef struct  FT_Incremental_InterfaceRec_\n  {\n    const FT_Incremental_FuncsRec*  funcs;\n    FT_Incremental                  object;\n\n  } FT_Incremental_InterfaceRec;\n\n\n  /***************************************************************************\n   *\n   * @type:\n   *   FT_Incremental_Interface\n   *\n   * @description:\n   *   A pointer to an @FT_Incremental_InterfaceRec structure.\n   *\n   */\n  typedef FT_Incremental_InterfaceRec*   FT_Incremental_Interface;\n\n\n  /***************************************************************************\n   *\n   * @constant:\n   *   FT_PARAM_TAG_INCREMENTAL\n   *\n   * @description:\n   *   A constant used as the tag of @FT_Parameter structures to indicate\n   *   an incremental loading object to be used by FreeType.\n   *\n   */\n#define FT_PARAM_TAG_INCREMENTAL  FT_MAKE_TAG( 'i', 'n', 'c', 'r' )\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTINCREM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftlcdfil.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlcdfil.h                                                             */\n/*                                                                         */\n/*    FreeType API for color filtering of subpixel bitmap glyphs           */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 2006-2008, 2010, 2013, 2014 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FT_LCD_FILTER_H__\n#define __FT_LCD_FILTER_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /***************************************************************************\n   *\n   * @section:\n   *   lcd_filtering\n   *\n   * @title:\n   *   LCD Filtering\n   *\n   * @abstract:\n   *   Reduce color fringes of LCD-optimized bitmaps.\n   *\n   * @description:\n   *   The @FT_Library_SetLcdFilter API can be used to specify a low-pass\n   *   filter, which is then applied to LCD-optimized bitmaps generated\n   *   through @FT_Render_Glyph.  This is useful to reduce color fringes\n   *   that would occur with unfiltered rendering.\n   *\n   *   Note that no filter is active by default, and that this function is\n   *   *not* implemented in default builds of the library.  You need to\n   *   #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file\n   *   in order to activate it.\n   *\n   *   FreeType generates alpha coverage maps, which are linear by nature.\n   *   For instance, the value 0x80 in bitmap representation means that\n   *   (within numerical precision) 0x80/0xFF fraction of that pixel is\n   *   covered by the glyph's outline.  The blending function for placing\n   *   text over a background is\n   *\n   *   {\n   *     dst = alpha * src + (1 - alpha) * dst    ,\n   *   }\n   *\n   *   which is known as OVER.  However, when calculating the output of the\n   *   OVER operator, the source colors should first be transformed to a\n   *   linear color space, then alpha blended in that space, and transformed\n   *   back to the output color space.\n   *\n   *   When linear light blending is used, the default FIR5 filtering\n   *   weights (as given by FT_LCD_FILTER_DEFAULT) are no longer optimal, as\n   *   they have been designed for black on white rendering while lacking\n   *   gamma correction.  To preserve color neutrality, weights for a FIR5\n   *   filter should be chosen according to two free parameters `a' and `c',\n   *   and the FIR weights should be\n   *\n   *   {\n   *     [a - c, a + c, 2 * a, a + c, a - c]    .\n   *   }\n   *\n   *   This formula generates equal weights for all the color primaries\n   *   across the filter kernel, which makes it colorless.  One suggested\n   *   set of weights is\n   *\n   *   {\n   *     [0x10, 0x50, 0x60, 0x50, 0x10]    ,\n   *   }\n   *\n   *   where `a' has value 0x30 and `b' value 0x20.  The weights in filter\n   *   may have a sum larger than 0x100, which increases coloration slightly\n   *   but also improves contrast.\n   */\n\n\n  /****************************************************************************\n   *\n   * @enum:\n   *   FT_LcdFilter\n   *\n   * @description:\n   *   A list of values to identify various types of LCD filters.\n   *\n   * @values:\n   *   FT_LCD_FILTER_NONE ::\n   *     Do not perform filtering.  When used with subpixel rendering, this\n   *     results in sometimes severe color fringes.\n   *\n   *   FT_LCD_FILTER_DEFAULT ::\n   *     The default filter reduces color fringes considerably, at the cost\n   *     of a slight blurriness in the output.\n   *\n   *   FT_LCD_FILTER_LIGHT ::\n   *     The light filter is a variant that produces less blurriness at the\n   *     cost of slightly more color fringes than the default one.  It might\n   *     be better, depending on taste, your monitor, or your personal vision.\n   *\n   *   FT_LCD_FILTER_LEGACY ::\n   *     This filter corresponds to the original libXft color filter.  It\n   *     provides high contrast output but can exhibit really bad color\n   *     fringes if glyphs are not extremely well hinted to the pixel grid.\n   *     In other words, it only works well if the TrueType bytecode\n   *     interpreter is enabled *and* high-quality hinted fonts are used.\n   *\n   *     This filter is only provided for comparison purposes, and might be\n   *     disabled or stay unsupported in the future.\n   *\n   * @since:\n   *   2.3.0\n   */\n  typedef enum  FT_LcdFilter_\n  {\n    FT_LCD_FILTER_NONE    = 0,\n    FT_LCD_FILTER_DEFAULT = 1,\n    FT_LCD_FILTER_LIGHT   = 2,\n    FT_LCD_FILTER_LEGACY  = 16,\n\n    FT_LCD_FILTER_MAX   /* do not remove */\n\n  } FT_LcdFilter;\n\n\n  /**************************************************************************\n   *\n   * @func:\n   *   FT_Library_SetLcdFilter\n   *\n   * @description:\n   *   This function is used to apply color filtering to LCD decimated\n   *   bitmaps, like the ones used when calling @FT_Render_Glyph with\n   *   @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V.\n   *\n   * @input:\n   *   library ::\n   *     A handle to the target library instance.\n   *\n   *   filter ::\n   *     The filter type.\n   *\n   *     You can use @FT_LCD_FILTER_NONE here to disable this feature, or\n   *     @FT_LCD_FILTER_DEFAULT to use a default filter that should work\n   *     well on most LCD screens.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   This feature is always disabled by default.  Clients must make an\n   *   explicit call to this function with a `filter' value other than\n   *   @FT_LCD_FILTER_NONE in order to enable it.\n   *\n   *   Due to *PATENTS* covering subpixel rendering, this function doesn't\n   *   do anything except returning `FT_Err_Unimplemented_Feature' if the\n   *   configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not\n   *   defined in your build of the library, which should correspond to all\n   *   default builds of FreeType.\n   *\n   *   The filter affects glyph bitmaps rendered through @FT_Render_Glyph,\n   *   @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char.\n   *\n   *   It does _not_ affect the output of @FT_Outline_Render and\n   *   @FT_Outline_Get_Bitmap.\n   *\n   *   If this feature is activated, the dimensions of LCD glyph bitmaps are\n   *   either larger or taller than the dimensions of the corresponding\n   *   outline with regards to the pixel grid.  For example, for\n   *   @FT_RENDER_MODE_LCD, the filter adds up to 3~pixels to the left, and\n   *   up to 3~pixels to the right.\n   *\n   *   The bitmap offset values are adjusted correctly, so clients shouldn't\n   *   need to modify their layout and glyph positioning code when enabling\n   *   the filter.\n   *\n   * @since:\n   *   2.3.0\n   */\n  FT_EXPORT( FT_Error )\n  FT_Library_SetLcdFilter( FT_Library    library,\n                           FT_LcdFilter  filter );\n\n\n  /**************************************************************************\n   *\n   * @func:\n   *   FT_Library_SetLcdFilterWeights\n   *\n   * @description:\n   *   Use this function to override the filter weights selected by\n   *   @FT_Library_SetLcdFilter.  By default, FreeType uses the quintuple\n   *   (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10,\n   *   0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and\n   *   FT_LCD_FILTER_LEGACY.\n   *\n   * @input:\n   *   library ::\n   *     A handle to the target library instance.\n   *\n   *   weights ::\n   *     A pointer to an array; the function copies the first five bytes and\n   *     uses them to specify the filter weights.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   Due to *PATENTS* covering subpixel rendering, this function doesn't\n   *   do anything except returning `FT_Err_Unimplemented_Feature' if the\n   *   configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not\n   *   defined in your build of the library, which should correspond to all\n   *   default builds of FreeType.\n   *\n   *   This function must be called after @FT_Library_SetLcdFilter to have\n   *   any effect.\n   *\n   * @since:\n   *   2.4.0\n   */\n  FT_EXPORT( FT_Error )\n  FT_Library_SetLcdFilterWeights( FT_Library      library,\n                                  unsigned char  *weights );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FT_LCD_FILTER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftlist.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlist.h                                                               */\n/*                                                                         */\n/*    Generic list support for FreeType (specification).                   */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2007, 2010, 2013, 2014 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  This file implements functions relative to list processing.  Its     */\n  /*  data structures are defined in `freetype.h'.                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTLIST_H__\n#define __FTLIST_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    list_processing                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    List Processing                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Simple management of lists.                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains various definitions related to list          */\n  /*    processing using doubly-linked nodes.                              */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_List                                                            */\n  /*    FT_ListNode                                                        */\n  /*    FT_ListRec                                                         */\n  /*    FT_ListNodeRec                                                     */\n  /*                                                                       */\n  /*    FT_List_Add                                                        */\n  /*    FT_List_Insert                                                     */\n  /*    FT_List_Find                                                       */\n  /*    FT_List_Remove                                                     */\n  /*    FT_List_Up                                                         */\n  /*    FT_List_Iterate                                                    */\n  /*    FT_List_Iterator                                                   */\n  /*    FT_List_Finalize                                                   */\n  /*    FT_List_Destructor                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Find                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Find the list node for a given listed object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*    data :: The address of the listed object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    List node.  NULL if it wasn't found.                               */\n  /*                                                                       */\n  FT_EXPORT( FT_ListNode )\n  FT_List_Find( FT_List  list,\n                void*    data );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Add                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Append an element to the end of a list.                            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*    node :: The node to append.                                        */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Add( FT_List      list,\n               FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Insert                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Insert an element at the head of a list.                           */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to parent list.                                  */\n  /*    node :: The node to insert.                                        */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Insert( FT_List      list,\n                  FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Remove                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Remove a node from a list.  This function doesn't check whether    */\n  /*    the node is in the list!                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    node :: The node to remove.                                        */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Remove( FT_List      list,\n                  FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Up                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Move a node to the head/top of a list.  Used to maintain LRU       */\n  /*    lists.                                                             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*    node :: The node to move.                                          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Up( FT_List      list,\n              FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_List_Iterator                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An FT_List iterator function that is called during a list parse    */\n  /*    by @FT_List_Iterate.                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    node :: The current iteration list node.                           */\n  /*                                                                       */\n  /*    user :: A typeless pointer passed to @FT_List_Iterate.             */\n  /*            Can be used to point to the iteration's state.             */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_List_Iterator)( FT_ListNode  node,\n                       void*        user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Iterate                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Parse a list and calls a given iterator function on each element.  */\n  /*    Note that parsing is stopped as soon as one of the iterator calls  */\n  /*    returns a non-zero value.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    list     :: A handle to the list.                                  */\n  /*    iterator :: An iterator function, called on each node of the list. */\n  /*    user     :: A user-supplied field that is passed as the second     */\n  /*                argument to the iterator.                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result (a FreeType error code) of the last iterator call.      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_List_Iterate( FT_List           list,\n                   FT_List_Iterator  iterator,\n                   void*             user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_List_Destructor                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An @FT_List iterator function that is called during a list         */\n  /*    finalization by @FT_List_Finalize to destroy all elements in a     */\n  /*    given list.                                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    system :: The current system object.                               */\n  /*                                                                       */\n  /*    data   :: The current object to destroy.                           */\n  /*                                                                       */\n  /*    user   :: A typeless pointer passed to @FT_List_Iterate.  It can   */\n  /*              be used to point to the iteration's state.               */\n  /*                                                                       */\n  typedef void\n  (*FT_List_Destructor)( FT_Memory  memory,\n                         void*      data,\n                         void*      user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Finalize                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy all elements in the list as well as the list itself.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    list    :: A handle to the list.                                   */\n  /*                                                                       */\n  /*    destroy :: A list destructor that will be applied to each element  */\n  /*               of the list.  Set this to NULL if not needed.           */\n  /*                                                                       */\n  /*    memory  :: The current memory object that handles deallocation.    */\n  /*                                                                       */\n  /*    user    :: A user-supplied field that is passed as the last        */\n  /*               argument to the destructor.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function expects that all nodes added by @FT_List_Add or      */\n  /*    @FT_List_Insert have been dynamically allocated.                   */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Finalize( FT_List             list,\n                    FT_List_Destructor  destroy,\n                    FT_Memory           memory,\n                    void*               user );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTLIST_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftlzw.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlzw.h                                                                */\n/*                                                                         */\n/*    LZW-compressed stream support.                                       */\n/*                                                                         */\n/*  Copyright 2004, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTLZW_H__\n#define __FTLZW_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    lzw                                                                */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    LZW Streams                                                        */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Using LZW-compressed font files.                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of LZW-specific functions.   */\n  /*                                                                       */\n  /*************************************************************************/\n\n /************************************************************************\n  *\n  * @function:\n  *   FT_Stream_OpenLZW\n  *\n  * @description:\n  *   Open a new stream to parse LZW-compressed font files.  This is\n  *   mainly used to support the compressed `*.pcf.Z' fonts that come\n  *   with XFree86.\n  *\n  * @input:\n  *   stream :: The target embedding stream.\n  *\n  *   source :: The source stream.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   The source stream must be opened _before_ calling this function.\n  *\n  *   Calling the internal function `FT_Stream_Close' on the new stream will\n  *   *not* call `FT_Stream_Close' on the source stream.  None of the stream\n  *   objects will be released to the heap.\n  *\n  *   The stream implementation is very basic and resets the decompression\n  *   process each time seeking backwards is needed within the stream\n  *\n  *   In certain builds of the library, LZW compression recognition is\n  *   automatically handled when calling @FT_New_Face or @FT_Open_Face.\n  *   This means that if no font driver is capable of handling the raw\n  *   compressed file, the library will try to open a LZW stream from it\n  *   and re-open the face with it.\n  *\n  *   This function may return `FT_Err_Unimplemented_Feature' if your build\n  *   of FreeType was not compiled with LZW support.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Stream_OpenLZW( FT_Stream  stream,\n                     FT_Stream  source );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTLZW_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftmac.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmac.h                                                                */\n/*                                                                         */\n/*    Additional Mac-specific API.                                         */\n/*                                                                         */\n/*  Copyright 1996-2001, 2004, 2006, 2007, 2013 by                         */\n/*  Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.     */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* NOTE: Include this file after FT_FREETYPE_H and after any               */\n/*       Mac-specific headers (because this header uses Mac types such as  */\n/*       Handle, FSSpec, FSRef, etc.)                                      */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMAC_H__\n#define __FTMAC_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n\n/* gcc-3.4.1 and later can warn about functions tagged as deprecated */\n#ifndef FT_DEPRECATED_ATTRIBUTE\n#if defined(__GNUC__)                                               && \\\n    ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))\n#define FT_DEPRECATED_ATTRIBUTE  __attribute__((deprecated))\n#else\n#define FT_DEPRECATED_ATTRIBUTE\n#endif\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    mac_specific                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Mac Specific Interface                                             */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Only available on the Macintosh.                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The following definitions are only available if FreeType is        */\n  /*    compiled on a Macintosh.                                           */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FOND                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new face object from a FOND resource.                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fond       :: A FOND resource.                                     */\n  /*                                                                       */\n  /*    face_index :: Only supported for the -1 `sanity check' special     */\n  /*                  case.                                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Notes>                                                               */\n  /*    This function can be used to create @FT_Face objects from fonts    */\n  /*    that are installed in the system as follows.                       */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      fond = GetResource( 'FOND', fontName );                          */\n  /*      error = FT_New_Face_From_FOND( library, fond, 0, &face );        */\n  /*    }                                                                  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face_From_FOND( FT_Library  library,\n                         Handle      fond,\n                         FT_Long     face_index,\n                         FT_Face    *aface )\n                       FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GetFile_From_Mac_Name                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return an FSSpec for the disk file containing the named font.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fontName   :: Mac OS name of the font (e.g., Times New Roman       */\n  /*                  Bold).                                               */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    pathSpec   :: FSSpec to the file.  For passing to                  */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /*    face_index :: Index of the face.  For passing to                   */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GetFile_From_Mac_Name( const char*  fontName,\n                            FSSpec*      pathSpec,\n                            FT_Long*     face_index )\n                          FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GetFile_From_Mac_ATS_Name                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return an FSSpec for the disk file containing the named font.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fontName   :: Mac OS name of the font in ATS framework.            */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    pathSpec   :: FSSpec to the file. For passing to                   */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /*    face_index :: Index of the face. For passing to                    */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GetFile_From_Mac_ATS_Name( const char*  fontName,\n                                FSSpec*      pathSpec,\n                                FT_Long*     face_index )\n                              FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GetFilePath_From_Mac_ATS_Name                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a pathname of the disk file and face index for given font   */\n  /*    name that is handled by ATS framework.                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fontName    :: Mac OS name of the font in ATS framework.           */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    path        :: Buffer to store pathname of the file.  For passing  */\n  /*                   to @FT_New_Face.  The client must allocate this     */\n  /*                   buffer before calling this function.                */\n  /*                                                                       */\n  /*    maxPathSize :: Lengths of the buffer `path' that client allocated. */\n  /*                                                                       */\n  /*    face_index  :: Index of the face.  For passing to @FT_New_Face.    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GetFilePath_From_Mac_ATS_Name( const char*  fontName,\n                                    UInt8*       path,\n                                    UInt32       maxPathSize,\n                                    FT_Long*     face_index )\n                                  FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FSSpec                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new face object from a given resource and typeface index  */\n  /*    using an FSSpec to the font file.                                  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    spec       :: FSSpec to the font file.                             */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the resource.  The      */\n  /*                  first face has index~0.                              */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    @FT_New_Face_From_FSSpec is identical to @FT_New_Face except       */\n  /*    it accepts an FSSpec instead of a path.                            */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face_From_FSSpec( FT_Library     library,\n                           const FSSpec  *spec,\n                           FT_Long        face_index,\n                           FT_Face       *aface )\n                         FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FSRef                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new face object from a given resource and typeface index  */\n  /*    using an FSRef to the font file.                                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    spec       :: FSRef to the font file.                              */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the resource.  The      */\n  /*                  first face has index~0.                              */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    @FT_New_Face_From_FSRef is identical to @FT_New_Face except        */\n  /*    it accepts an FSRef instead of a path.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face_From_FSRef( FT_Library    library,\n                          const FSRef  *ref,\n                          FT_Long       face_index,\n                          FT_Face      *aface )\n                        FT_DEPRECATED_ATTRIBUTE;\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __FTMAC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftmm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmm.h                                                                 */\n/*                                                                         */\n/*    FreeType Multiple Master font interface (specification).             */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2004, 2006, 2009, 2013 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMM_H__\n#define __FTMM_H__\n\n\n#include <ft2build.h>\n#include FT_TYPE1_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    multiple_masters                                                   */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Multiple Masters                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How to manage Multiple Masters fonts.                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The following types and functions are used to manage Multiple      */\n  /*    Master fonts, i.e., the selection of specific design instances by  */\n  /*    setting design axis coordinates.                                   */\n  /*                                                                       */\n  /*    George Williams has extended this interface to make it work with   */\n  /*    both Type~1 Multiple Masters fonts and GX distortable (var)        */\n  /*    fonts.  Some of these routines only work with MM fonts, others     */\n  /*    will work with both types.  They are similar enough that a         */\n  /*    consistent interface makes sense.                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_MM_Axis                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to model a given axis in design space for  */\n  /*    Multiple Masters fonts.                                            */\n  /*                                                                       */\n  /*    This structure can't be used for GX var fonts.                     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    name    :: The axis's name.                                        */\n  /*                                                                       */\n  /*    minimum :: The axis's minimum design coordinate.                   */\n  /*                                                                       */\n  /*    maximum :: The axis's maximum design coordinate.                   */\n  /*                                                                       */\n  typedef struct  FT_MM_Axis_\n  {\n    FT_String*  name;\n    FT_Long     minimum;\n    FT_Long     maximum;\n\n  } FT_MM_Axis;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Multi_Master                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model the axes and space of a Multiple Masters */\n  /*    font.                                                              */\n  /*                                                                       */\n  /*    This structure can't be used for GX var fonts.                     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_axis    :: Number of axes.  Cannot exceed~4.                   */\n  /*                                                                       */\n  /*    num_designs :: Number of designs; should be normally 2^num_axis    */\n  /*                   even though the Type~1 specification strangely      */\n  /*                   allows for intermediate designs to be present. This */\n  /*                   number cannot exceed~16.                            */\n  /*                                                                       */\n  /*    axis        :: A table of axis descriptors.                        */\n  /*                                                                       */\n  typedef struct  FT_Multi_Master_\n  {\n    FT_UInt     num_axis;\n    FT_UInt     num_designs;\n    FT_MM_Axis  axis[T1_MAX_MM_AXIS];\n\n  } FT_Multi_Master;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Var_Axis                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to model a given axis in design space for  */\n  /*    Multiple Masters and GX var fonts.                                 */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    name    :: The axis's name.                                        */\n  /*               Not always meaningful for GX.                           */\n  /*                                                                       */\n  /*    minimum :: The axis's minimum design coordinate.                   */\n  /*                                                                       */\n  /*    def     :: The axis's default design coordinate.                   */\n  /*               FreeType computes meaningful default values for MM; it  */\n  /*               is then an integer value, not in 16.16 format.          */\n  /*                                                                       */\n  /*    maximum :: The axis's maximum design coordinate.                   */\n  /*                                                                       */\n  /*    tag     :: The axis's tag (the GX equivalent to `name').           */\n  /*               FreeType provides default values for MM if possible.    */\n  /*                                                                       */\n  /*    strid   :: The entry in `name' table (another GX version of        */\n  /*               `name').                                                */\n  /*               Not meaningful for MM.                                  */\n  /*                                                                       */\n  typedef struct  FT_Var_Axis_\n  {\n    FT_String*  name;\n\n    FT_Fixed    minimum;\n    FT_Fixed    def;\n    FT_Fixed    maximum;\n\n    FT_ULong    tag;\n    FT_UInt     strid;\n\n  } FT_Var_Axis;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Var_Named_Style                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to model a named style in a GX var font.   */\n  /*                                                                       */\n  /*    This structure can't be used for MM fonts.                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    coords :: The design coordinates for this style.                   */\n  /*              This is an array with one entry for each axis.           */\n  /*                                                                       */\n  /*    strid  :: The entry in `name' table identifying this style.        */\n  /*                                                                       */\n  typedef struct  FT_Var_Named_Style_\n  {\n    FT_Fixed*  coords;\n    FT_UInt    strid;\n\n  } FT_Var_Named_Style;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_MM_Var                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model the axes and space of a Multiple Masters */\n  /*    or GX var distortable font.                                        */\n  /*                                                                       */\n  /*    Some fields are specific to one format and not to the other.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_axis        :: The number of axes.  The maximum value is~4 for */\n  /*                       MM; no limit in GX.                             */\n  /*                                                                       */\n  /*    num_designs     :: The number of designs; should be normally       */\n  /*                       2^num_axis for MM fonts.  Not meaningful for GX */\n  /*                       (where every glyph could have a different       */\n  /*                       number of designs).                             */\n  /*                                                                       */\n  /*    num_namedstyles :: The number of named styles; only meaningful for */\n  /*                       GX that allows certain design coordinates to    */\n  /*                       have a string ID (in the `name' table)          */\n  /*                       associated with them.  The font can tell the    */\n  /*                       user that, for example, Weight=1.5 is `Bold'.   */\n  /*                                                                       */\n  /*    axis            :: A table of axis descriptors.                    */\n  /*                       GX fonts contain slightly more data than MM.    */\n  /*                                                                       */\n  /*    namedstyles     :: A table of named styles.                        */\n  /*                       Only meaningful with GX.                        */\n  /*                                                                       */\n  typedef struct  FT_MM_Var_\n  {\n    FT_UInt              num_axis;\n    FT_UInt              num_designs;\n    FT_UInt              num_namedstyles;\n    FT_Var_Axis*         axis;\n    FT_Var_Named_Style*  namedstyle;\n\n  } FT_MM_Var;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Multi_Master                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the Multiple Master descriptor of a given font.           */\n  /*                                                                       */\n  /*    This function can't be used with GX fonts.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: A handle to the source face.                            */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amaster :: The Multiple Masters descriptor.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Multi_Master( FT_Face           face,\n                       FT_Multi_Master  *amaster );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_MM_Var                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the Multiple Master/GX var descriptor of a given font.    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: A handle to the source face.                            */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amaster :: The Multiple Masters/GX var descriptor.                 */\n  /*               Allocates a data structure, which the user must free.   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_MM_Var( FT_Face      face,\n                 FT_MM_Var*  *amaster );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_MM_Design_Coordinates                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    For Multiple Masters fonts, choose an interpolated font design     */\n  /*    through design coordinates.                                        */\n  /*                                                                       */\n  /*    This function can't be used with GX fonts.                         */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: A handle to the source face.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: The number of design coordinates (must be equal to   */\n  /*                  the number of axes in the font).                     */\n  /*                                                                       */\n  /*    coords     :: An array of design coordinates.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_MM_Design_Coordinates( FT_Face   face,\n                                FT_UInt   num_coords,\n                                FT_Long*  coords );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Var_Design_Coordinates                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    For Multiple Master or GX Var fonts, choose an interpolated font   */\n  /*    design through design coordinates.                                 */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: A handle to the source face.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: The number of design coordinates (must be equal to   */\n  /*                  the number of axes in the font).                     */\n  /*                                                                       */\n  /*    coords     :: An array of design coordinates.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Var_Design_Coordinates( FT_Face    face,\n                                 FT_UInt    num_coords,\n                                 FT_Fixed*  coords );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_MM_Blend_Coordinates                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    For Multiple Masters and GX var fonts, choose an interpolated font */\n  /*    design through normalized blend coordinates.                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: A handle to the source face.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: The number of design coordinates (must be equal to   */\n  /*                  the number of axes in the font).                     */\n  /*                                                                       */\n  /*    coords     :: The design coordinates array (each element must be   */\n  /*                  between 0 and 1.0).                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_MM_Blend_Coordinates( FT_Face    face,\n                               FT_UInt    num_coords,\n                               FT_Fixed*  coords );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Var_Blend_Coordinates                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is another name of @FT_Set_MM_Blend_Coordinates.              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Var_Blend_Coordinates( FT_Face    face,\n                                FT_UInt    num_coords,\n                                FT_Fixed*  coords );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTMM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftmodapi.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmodapi.h                                                             */\n/*                                                                         */\n/*    FreeType modules public interface (specification).                   */\n/*                                                                         */\n/*  Copyright 1996-2003, 2006, 2008-2010, 2012, 2013 by                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMODAPI_H__\n#define __FTMODAPI_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    module_management                                                  */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Module Management                                                  */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How to add, upgrade, remove, and control modules from FreeType.    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The definitions below are used to manage modules within FreeType.  */\n  /*    Modules can be added, upgraded, and removed at runtime.            */\n  /*    Additionally, some module properties can be controlled also.       */\n  /*                                                                       */\n  /*    Here is a list of possible values of the `module_name' field in    */\n  /*    the @FT_Module_Class structure.                                    */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      autofitter                                                       */\n  /*      bdf                                                              */\n  /*      cff                                                              */\n  /*      gxvalid                                                          */\n  /*      otvalid                                                          */\n  /*      pcf                                                              */\n  /*      pfr                                                              */\n  /*      psaux                                                            */\n  /*      pshinter                                                         */\n  /*      psnames                                                          */\n  /*      raster1, raster5                                                 */\n  /*      sfnt                                                             */\n  /*      smooth, smooth-lcd, smooth-lcdv                                  */\n  /*      truetype                                                         */\n  /*      type1                                                            */\n  /*      type42                                                           */\n  /*      t1cid                                                            */\n  /*      winfonts                                                         */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Note that the FreeType Cache sub-system is not a FreeType module.  */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Module                                                          */\n  /*    FT_Module_Constructor                                              */\n  /*    FT_Module_Destructor                                               */\n  /*    FT_Module_Requester                                                */\n  /*    FT_Module_Class                                                    */\n  /*                                                                       */\n  /*    FT_Add_Module                                                      */\n  /*    FT_Get_Module                                                      */\n  /*    FT_Remove_Module                                                   */\n  /*    FT_Add_Default_Modules                                             */\n  /*                                                                       */\n  /*    FT_Property_Set                                                    */\n  /*    FT_Property_Get                                                    */\n  /*                                                                       */\n  /*    FT_New_Library                                                     */\n  /*    FT_Done_Library                                                    */\n  /*    FT_Reference_Library                                               */\n  /*                                                                       */\n  /*    FT_Renderer                                                        */\n  /*    FT_Renderer_Class                                                  */\n  /*                                                                       */\n  /*    FT_Get_Renderer                                                    */\n  /*    FT_Set_Renderer                                                    */\n  /*                                                                       */\n  /*    FT_Set_Debug_Hook                                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* module bit flags */\n#define FT_MODULE_FONT_DRIVER         1  /* this module is a font driver  */\n#define FT_MODULE_RENDERER            2  /* this module is a renderer     */\n#define FT_MODULE_HINTER              4  /* this module is a glyph hinter */\n#define FT_MODULE_STYLER              8  /* this module is a styler       */\n\n#define FT_MODULE_DRIVER_SCALABLE     0x100   /* the driver supports      */\n                                              /* scalable fonts           */\n#define FT_MODULE_DRIVER_NO_OUTLINES  0x200   /* the driver does not      */\n                                              /* support vector outlines  */\n#define FT_MODULE_DRIVER_HAS_HINTER   0x400   /* the driver provides its  */\n                                              /* own hinter               */\n\n\n  /* deprecated values */\n#define ft_module_font_driver         FT_MODULE_FONT_DRIVER\n#define ft_module_renderer            FT_MODULE_RENDERER\n#define ft_module_hinter              FT_MODULE_HINTER\n#define ft_module_styler              FT_MODULE_STYLER\n\n#define ft_module_driver_scalable     FT_MODULE_DRIVER_SCALABLE\n#define ft_module_driver_no_outlines  FT_MODULE_DRIVER_NO_OUTLINES\n#define ft_module_driver_has_hinter   FT_MODULE_DRIVER_HAS_HINTER\n\n\n  typedef FT_Pointer  FT_Module_Interface;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Constructor                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to initialize (not create) a new module object.    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module :: The module to initialize.                                */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_Module_Constructor)( FT_Module  module );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Destructor                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to finalize (not destroy) a given module object.   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module :: The module to finalize.                                  */\n  /*                                                                       */\n  typedef void\n  (*FT_Module_Destructor)( FT_Module  module );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Requester                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to query a given module for a specific interface.  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module :: The module to be searched.                               */\n  /*                                                                       */\n  /*    name ::   The name of the interface in the module.                 */\n  /*                                                                       */\n  typedef FT_Module_Interface\n  (*FT_Module_Requester)( FT_Module    module,\n                          const char*  name );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Module_Class                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The module class descriptor.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    module_flags    :: Bit flags describing the module.                */\n  /*                                                                       */\n  /*    module_size     :: The size of one module object/instance in       */\n  /*                       bytes.                                          */\n  /*                                                                       */\n  /*    module_name     :: The name of the module.                         */\n  /*                                                                       */\n  /*    module_version  :: The version, as a 16.16 fixed number            */\n  /*                       (major.minor).                                  */\n  /*                                                                       */\n  /*    module_requires :: The version of FreeType this module requires,   */\n  /*                       as a 16.16 fixed number (major.minor).  Starts  */\n  /*                       at version 2.0, i.e., 0x20000.                  */\n  /*                                                                       */\n  /*    module_init     :: The initializing function.                      */\n  /*                                                                       */\n  /*    module_done     :: The finalizing function.                        */\n  /*                                                                       */\n  /*    get_interface   :: The interface requesting function.              */\n  /*                                                                       */\n  typedef struct  FT_Module_Class_\n  {\n    FT_ULong               module_flags;\n    FT_Long                module_size;\n    const FT_String*       module_name;\n    FT_Fixed               module_version;\n    FT_Fixed               module_requires;\n\n    const void*            module_interface;\n\n    FT_Module_Constructor  module_init;\n    FT_Module_Destructor   module_done;\n    FT_Module_Requester    get_interface;\n\n  } FT_Module_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Add_Module                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Add a new module to a given library instance.                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library :: A handle to the library object.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    clazz   :: A pointer to class descriptor for the module.           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An error will be returned if a module already exists by that name, */\n  /*    or if the module requires a version of FreeType that is too great. */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Add_Module( FT_Library              library,\n                 const FT_Module_Class*  clazz );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Module                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Find a module by its name.                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library     :: A handle to the library object.                     */\n  /*                                                                       */\n  /*    module_name :: The module's name (as an ASCII string).             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A module handle.  0~if none was found.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    FreeType's internal modules aren't documented very well, and you   */\n  /*    should look up the source code for details.                        */\n  /*                                                                       */\n  FT_EXPORT( FT_Module )\n  FT_Get_Module( FT_Library   library,\n                 const char*  module_name );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Remove_Module                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Remove a given module from a library instance.                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library :: A handle to a library object.                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module  :: A handle to a module object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The module object is destroyed by the function in case of success. */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Remove_Module( FT_Library  library,\n                    FT_Module   module );\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Property_Set\n   *\n   * @description:\n   *    Set a property for a given module.\n   *\n   * @input:\n   *    library ::\n   *       A handle to the library the module is part of.\n   *\n   *    module_name ::\n   *       The module name.\n   *\n   *    property_name ::\n   *       The property name.  Properties are described in the `Synopsis'\n   *       subsection of the module's documentation.\n   *\n   *       Note that only a few modules have properties.\n   *\n   *    value ::\n   *       A generic pointer to a variable or structure that gives the new\n   *       value of the property.  The exact definition of `value' is\n   *       dependent on the property; see the `Synopsis' subsection of the\n   *       module's documentation.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *    If `module_name' isn't a valid module name, or `property_name'\n   *    doesn't specify a valid property, or if `value' doesn't represent a\n   *    valid value for the given property, an error is returned.\n   *\n   *    The following example sets property `bar' (a simple integer) in\n   *    module `foo' to value~1.\n   *\n   *    {\n   *      FT_UInt  bar;\n   *\n   *\n   *      bar = 1;\n   *      FT_Property_Set( library, \"foo\", \"bar\", &bar );\n   *    }\n   *\n   *    Note that the FreeType Cache sub-system doesn't recognize module\n   *    property changes.  To avoid glyph lookup confusion within the cache\n   *    you should call @FTC_Manager_Reset to completely flush the cache if\n   *    a module property gets changed after @FTC_Manager_New has been\n   *    called.\n   *\n   *    It is not possible to set properties of the FreeType Cache\n   *    sub-system itself with FT_Property_Set; use @FTC_Property_Set\n   *    instead.\n   *\n   *  @since:\n   *    2.4.11\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Property_Set( FT_Library        library,\n                   const FT_String*  module_name,\n                   const FT_String*  property_name,\n                   const void*       value );\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Property_Get\n   *\n   * @description:\n   *    Get a module's property value.\n   *\n   * @input:\n   *    library ::\n   *       A handle to the library the module is part of.\n   *\n   *    module_name ::\n   *       The module name.\n   *\n   *    property_name ::\n   *       The property name.  Properties are described in the `Synopsis'\n   *       subsection of the module's documentation.\n   *\n   * @inout:\n   *    value ::\n   *       A generic pointer to a variable or structure that gives the\n   *       value of the property.  The exact definition of `value' is\n   *       dependent on the property; see the `Synopsis' subsection of the\n   *       module's documentation.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *    If `module_name' isn't a valid module name, or `property_name'\n   *    doesn't specify a valid property, or if `value' doesn't represent a\n   *    valid value for the given property, an error is returned.\n   *\n   *    The following example gets property `baz' (a range) in module `foo'.\n   *\n   *    {\n   *      typedef  range_\n   *      {\n   *        FT_Int32  min;\n   *        FT_Int32  max;\n   *\n   *      } range;\n   *\n   *      range  baz;\n   *\n   *\n   *      FT_Property_Get( library, \"foo\", \"baz\", &baz );\n   *    }\n   *\n   *    It is not possible to retrieve properties of the FreeType Cache\n   *    sub-system with FT_Property_Get; use @FTC_Property_Get instead.\n   *\n   *  @since:\n   *    2.4.11\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Property_Get( FT_Library        library,\n                   const FT_String*  module_name,\n                   const FT_String*  property_name,\n                   void*             value );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Reference_Library                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A counter gets initialized to~1 at the time an @FT_Library         */\n  /*    structure is created.  This function increments the counter.       */\n  /*    @FT_Done_Library then only destroys a library if the counter is~1, */\n  /*    otherwise it simply decrements the counter.                        */\n  /*                                                                       */\n  /*    This function helps in managing life-cycles of structures that     */\n  /*    reference @FT_Library objects.                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a target library object.                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.4.2                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Reference_Library( FT_Library  library );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Library                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to create a new FreeType library instance    */\n  /*    from a given memory object.  It is thus possible to use libraries  */\n  /*    with distinct memory allocators within the same program.           */\n  /*                                                                       */\n  /*    Normally, you would call this function (followed by a call to      */\n  /*    @FT_Add_Default_Modules or a series of calls to @FT_Add_Module)    */\n  /*    instead of @FT_Init_FreeType to initialize the FreeType library.   */\n  /*                                                                       */\n  /*    Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a      */\n  /*    library instance.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory   :: A handle to the original memory object.                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    alibrary :: A pointer to handle of a new library object.           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Library.                                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Library( FT_Memory    memory,\n                  FT_Library  *alibrary );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Library                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard a given library object.  This closes all drivers and       */\n  /*    discards all resource objects.                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to the target library.                         */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See the discussion of reference counters in the description of     */\n  /*    @FT_Reference_Library.                                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_Library( FT_Library  library );\n\n  /* */\n\n  typedef void\n  (*FT_DebugHook_Func)( void*  arg );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Debug_Hook                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Set a debug hook function for debugging the interpreter of a font  */\n  /*    format.                                                            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    hook_index :: The index of the debug hook.  You should use the     */\n  /*                  values defined in `ftobjs.h', e.g.,                  */\n  /*                  `FT_DEBUG_HOOK_TRUETYPE'.                            */\n  /*                                                                       */\n  /*    debug_hook :: The function used to debug the interpreter.          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Currently, four debug hook slots are available, but only two (for  */\n  /*    the TrueType and the Type~1 interpreter) are defined.              */\n  /*                                                                       */\n  /*    Since the internal headers of FreeType are no longer installed,    */\n  /*    the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly.      */\n  /*    This is a bug and will be fixed in a forthcoming release.          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Set_Debug_Hook( FT_Library         library,\n                     FT_UInt            hook_index,\n                     FT_DebugHook_Func  debug_hook );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Add_Default_Modules                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Add the set of default drivers to a given library object.          */\n  /*    This is only useful when you create a library object with          */\n  /*    @FT_New_Library (usually to plug a custom memory manager).         */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library :: A handle to a new library object.                       */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Add_Default_Modules( FT_Library  library );\n\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   truetype_engine\n   *\n   * @title:\n   *   The TrueType Engine\n   *\n   * @abstract:\n   *   TrueType bytecode support.\n   *\n   * @description:\n   *   This section contains a function used to query the level of TrueType\n   *   bytecode support compiled in this version of the library.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   *  @enum:\n   *     FT_TrueTypeEngineType\n   *\n   *  @description:\n   *     A list of values describing which kind of TrueType bytecode\n   *     engine is implemented in a given FT_Library instance.  It is used\n   *     by the @FT_Get_TrueType_Engine_Type function.\n   *\n   *  @values:\n   *     FT_TRUETYPE_ENGINE_TYPE_NONE ::\n   *       The library doesn't implement any kind of bytecode interpreter.\n   *\n   *     FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::\n   *       The library implements a bytecode interpreter that doesn't\n   *       support the patented operations of the TrueType virtual machine.\n   *\n   *       Its main use is to load certain Asian fonts that position and\n   *       scale glyph components with bytecode instructions.  It produces\n   *       bad output for most other fonts.\n   *\n   *     FT_TRUETYPE_ENGINE_TYPE_PATENTED ::\n   *       The library implements a bytecode interpreter that covers\n   *       the full instruction set of the TrueType virtual machine (this\n   *       was governed by patents until May 2010, hence the name).\n   *\n   *  @since:\n   *     2.2\n   *\n   */\n  typedef enum  FT_TrueTypeEngineType_\n  {\n    FT_TRUETYPE_ENGINE_TYPE_NONE = 0,\n    FT_TRUETYPE_ENGINE_TYPE_UNPATENTED,\n    FT_TRUETYPE_ENGINE_TYPE_PATENTED\n\n  } FT_TrueTypeEngineType;\n\n\n  /**************************************************************************\n   *\n   *  @func:\n   *     FT_Get_TrueType_Engine_Type\n   *\n   *  @description:\n   *     Return an @FT_TrueTypeEngineType value to indicate which level of\n   *     the TrueType virtual machine a given library instance supports.\n   *\n   *  @input:\n   *     library ::\n   *       A library instance.\n   *\n   *  @return:\n   *     A value indicating which level is supported.\n   *\n   *  @since:\n   *     2.2\n   *\n   */\n  FT_EXPORT( FT_TrueTypeEngineType )\n  FT_Get_TrueType_Engine_Type( FT_Library  library );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTMODAPI_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftmoderr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmoderr.h                                                             */\n/*                                                                         */\n/*    FreeType module error offsets (specification).                       */\n/*                                                                         */\n/*  Copyright 2001-2005, 2010, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the FreeType module error codes.          */\n  /*                                                                       */\n  /* If the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in `ftoption.h' is    */\n  /* set, the lower byte of an error value identifies the error code as    */\n  /* usual.  In addition, the higher byte identifies the module.  For      */\n  /* example, the error `FT_Err_Invalid_File_Format' has value 0x0003, the */\n  /* error `TT_Err_Invalid_File_Format' has value 0x1303, the error        */\n  /* `T1_Err_Invalid_File_Format' has value 0x1403, etc.                   */\n  /*                                                                       */\n  /* Note that `FT_Err_Ok', `TT_Err_Ok', etc. are always equal to zero,    */\n  /* including the high byte.                                              */\n  /*                                                                       */\n  /* If FT_CONFIG_OPTION_USE_MODULE_ERRORS isn't set, the higher byte of   */\n  /* an error value is set to zero.                                        */\n  /*                                                                       */\n  /* To hide the various `XXX_Err_' prefixes in the source code, FreeType  */\n  /* provides some macros in `fttypes.h'.                                  */\n  /*                                                                       */\n  /*   FT_ERR( err )                                                       */\n  /*     Add current error module prefix (as defined with the              */\n  /*     `FT_ERR_PREFIX' macro) to `err'.  For example, in the BDF module  */\n  /*     the line                                                          */\n  /*                                                                       */\n  /*       error = FT_ERR( Invalid_Outline );                              */\n  /*                                                                       */\n  /*     expands to                                                        */\n  /*                                                                       */\n  /*       error = BDF_Err_Invalid_Outline;                                */\n  /*                                                                       */\n  /*     For simplicity, you can always use `FT_Err_Ok' directly instead   */\n  /*     of `FT_ERR( Ok )'.                                                */\n  /*                                                                       */\n  /*   FT_ERR_EQ( errcode, err )                                           */\n  /*   FT_ERR_NEQ( errcode, err )                                          */\n  /*     Compare error code `errcode' with the error `err' for equality    */\n  /*     and inequality, respectively.  Example:                           */\n  /*                                                                       */\n  /*       if ( FT_ERR_EQ( error, Invalid_Outline ) )                      */\n  /*         ...                                                           */\n  /*                                                                       */\n  /*     Using this macro you don't have to think about error prefixes.    */\n  /*     Of course, if module errors are not active, the above example is  */\n  /*     the same as                                                       */\n  /*                                                                       */\n  /*       if ( error == FT_Err_Invalid_Outline )                          */\n  /*         ...                                                           */\n  /*                                                                       */\n  /*   FT_ERROR_BASE( errcode )                                            */\n  /*   FT_ERROR_MODULE( errcode )                                          */\n  /*     Get base error and module error code, respectively.               */\n  /*                                                                       */\n  /*                                                                       */\n  /* It can also be used to create a module error message table easily     */\n  /* with something like                                                   */\n  /*                                                                       */\n  /*   {                                                                   */\n  /*     #undef __FTMODERR_H__                                             */\n  /*     #define FT_MODERRDEF( e, v, s )  { FT_Mod_Err_ ## e, s },         */\n  /*     #define FT_MODERR_START_LIST     {                                */\n  /*     #define FT_MODERR_END_LIST       { 0, 0 } };                      */\n  /*                                                                       */\n  /*     const struct                                                      */\n  /*     {                                                                 */\n  /*       int          mod_err_offset;                                    */\n  /*       const char*  mod_err_msg                                        */\n  /*     } ft_mod_errors[] =                                               */\n  /*                                                                       */\n  /*     #include FT_MODULE_ERRORS_H                                       */\n  /*   }                                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTMODERR_H__\n#define __FTMODERR_H__\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                       SETUP MACROS                      *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#undef  FT_NEED_EXTERN_C\n\n#ifndef FT_MODERRDEF\n\n#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS\n#define FT_MODERRDEF( e, v, s )  FT_Mod_Err_ ## e = v,\n#else\n#define FT_MODERRDEF( e, v, s )  FT_Mod_Err_ ## e = 0,\n#endif\n\n#define FT_MODERR_START_LIST  enum {\n#define FT_MODERR_END_LIST    FT_Mod_Err_Max };\n\n#ifdef __cplusplus\n#define FT_NEED_EXTERN_C\n  extern \"C\" {\n#endif\n\n#endif /* !FT_MODERRDEF */\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****               LIST MODULE ERROR BASES                   *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#ifdef FT_MODERR_START_LIST\n  FT_MODERR_START_LIST\n#endif\n\n\n  FT_MODERRDEF( Base,      0x000, \"base module\" )\n  FT_MODERRDEF( Autofit,   0x100, \"autofitter module\" )\n  FT_MODERRDEF( BDF,       0x200, \"BDF module\" )\n  FT_MODERRDEF( Bzip2,     0x300, \"Bzip2 module\" )\n  FT_MODERRDEF( Cache,     0x400, \"cache module\" )\n  FT_MODERRDEF( CFF,       0x500, \"CFF module\" )\n  FT_MODERRDEF( CID,       0x600, \"CID module\" )\n  FT_MODERRDEF( Gzip,      0x700, \"Gzip module\" )\n  FT_MODERRDEF( LZW,       0x800, \"LZW module\" )\n  FT_MODERRDEF( OTvalid,   0x900, \"OpenType validation module\" )\n  FT_MODERRDEF( PCF,       0xA00, \"PCF module\" )\n  FT_MODERRDEF( PFR,       0xB00, \"PFR module\" )\n  FT_MODERRDEF( PSaux,     0xC00, \"PS auxiliary module\" )\n  FT_MODERRDEF( PShinter,  0xD00, \"PS hinter module\" )\n  FT_MODERRDEF( PSnames,   0xE00, \"PS names module\" )\n  FT_MODERRDEF( Raster,    0xF00, \"raster module\" )\n  FT_MODERRDEF( SFNT,     0x1000, \"SFNT module\" )\n  FT_MODERRDEF( Smooth,   0x1100, \"smooth raster module\" )\n  FT_MODERRDEF( TrueType, 0x1200, \"TrueType module\" )\n  FT_MODERRDEF( Type1,    0x1300, \"Type 1 module\" )\n  FT_MODERRDEF( Type42,   0x1400, \"Type 42 module\" )\n  FT_MODERRDEF( Winfonts, 0x1500, \"Windows FON/FNT module\" )\n  FT_MODERRDEF( GXvalid,  0x1600, \"GX validation module\" )\n\n\n#ifdef FT_MODERR_END_LIST\n  FT_MODERR_END_LIST\n#endif\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                      CLEANUP                            *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#ifdef FT_NEED_EXTERN_C\n  }\n#endif\n\n#undef FT_MODERR_START_LIST\n#undef FT_MODERR_END_LIST\n#undef FT_MODERRDEF\n#undef FT_NEED_EXTERN_C\n\n\n#endif /* __FTMODERR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftotval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftotval.h                                                              */\n/*                                                                         */\n/*    FreeType API for validating OpenType tables (specification).         */\n/*                                                                         */\n/*  Copyright 2004-2007, 2013, 2014 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/*                                                                         */\n/* Warning: This module might be moved to a different library in the       */\n/*          future to avoid a tight dependency between FreeType and the    */\n/*          OpenType specification.                                        */\n/*                                                                         */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTOTVAL_H__\n#define __FTOTVAL_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    ot_validation                                                      */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    OpenType Validation                                                */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    An API to validate OpenType tables.                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of functions to validate     */\n  /*    some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).         */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_OpenType_Validate                                               */\n  /*    FT_OpenType_Free                                                   */\n  /*                                                                       */\n  /*    FT_VALIDATE_OTXXX                                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /**********************************************************************\n  *\n  * @enum:\n  *    FT_VALIDATE_OTXXX\n  *\n  * @description:\n  *    A list of bit-field constants used with @FT_OpenType_Validate to\n  *    indicate which OpenType tables should be validated.\n  *\n  * @values:\n  *    FT_VALIDATE_BASE ::\n  *      Validate BASE table.\n  *\n  *    FT_VALIDATE_GDEF ::\n  *      Validate GDEF table.\n  *\n  *    FT_VALIDATE_GPOS ::\n  *      Validate GPOS table.\n  *\n  *    FT_VALIDATE_GSUB ::\n  *      Validate GSUB table.\n  *\n  *    FT_VALIDATE_JSTF ::\n  *      Validate JSTF table.\n  *\n  *    FT_VALIDATE_MATH ::\n  *      Validate MATH table.\n  *\n  *    FT_VALIDATE_OT ::\n  *      Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).\n  *\n  */\n#define FT_VALIDATE_BASE  0x0100\n#define FT_VALIDATE_GDEF  0x0200\n#define FT_VALIDATE_GPOS  0x0400\n#define FT_VALIDATE_GSUB  0x0800\n#define FT_VALIDATE_JSTF  0x1000\n#define FT_VALIDATE_MATH  0x2000\n\n#define FT_VALIDATE_OT  FT_VALIDATE_BASE | \\\n                        FT_VALIDATE_GDEF | \\\n                        FT_VALIDATE_GPOS | \\\n                        FT_VALIDATE_GSUB | \\\n                        FT_VALIDATE_JSTF | \\\n                        FT_VALIDATE_MATH\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_OpenType_Validate\n  *\n  * @description:\n  *    Validate various OpenType tables to assure that all offsets and\n  *    indices are valid.  The idea is that a higher-level library that\n  *    actually does the text layout can access those tables without\n  *    error checking (which can be quite time consuming).\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    validation_flags ::\n  *       A bit field that specifies the tables to be validated.  See\n  *       @FT_VALIDATE_OTXXX for possible values.\n  *\n  * @output:\n  *    BASE_table ::\n  *       A pointer to the BASE table.\n  *\n  *    GDEF_table ::\n  *       A pointer to the GDEF table.\n  *\n  *    GPOS_table ::\n  *       A pointer to the GPOS table.\n  *\n  *    GSUB_table ::\n  *       A pointer to the GSUB table.\n  *\n  *    JSTF_table ::\n  *       A pointer to the JSTF table.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   This function only works with OpenType fonts, returning an error\n  *   otherwise.\n  *\n  *   After use, the application should deallocate the five tables with\n  *   @FT_OpenType_Free.  A NULL value indicates that the table either\n  *   doesn't exist in the font, or the application hasn't asked for\n  *   validation.\n  */\n  FT_EXPORT( FT_Error )\n  FT_OpenType_Validate( FT_Face    face,\n                        FT_UInt    validation_flags,\n                        FT_Bytes  *BASE_table,\n                        FT_Bytes  *GDEF_table,\n                        FT_Bytes  *GPOS_table,\n                        FT_Bytes  *GSUB_table,\n                        FT_Bytes  *JSTF_table );\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_OpenType_Free\n  *\n  * @description:\n  *    Free the buffer allocated by OpenType validator.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    table ::\n  *       The pointer to the buffer that is allocated by\n  *       @FT_OpenType_Validate.\n  *\n  * @note:\n  *   This function must be used to free the buffer allocated by\n  *   @FT_OpenType_Validate only.\n  */\n  FT_EXPORT( void )\n  FT_OpenType_Free( FT_Face   face,\n                    FT_Bytes  table );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTOTVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftoutln.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftoutln.h                                                              */\n/*                                                                         */\n/*    Support for the FT_Outline type used to store glyph shapes of        */\n/*    most scalable font formats (specification).                          */\n/*                                                                         */\n/*  Copyright 1996-2003, 2005-2014 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTOUTLN_H__\n#define __FTOUTLN_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    outline_processing                                                 */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Outline Processing                                                 */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Functions to create, transform, and render vectorial glyph images. */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains routines used to create and destroy scalable */\n  /*    glyph images known as `outlines'.  These can also be measured,     */\n  /*    transformed, and converted into bitmaps and pixmaps.               */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Outline                                                         */\n  /*    FT_Outline_New                                                     */\n  /*    FT_Outline_Done                                                    */\n  /*    FT_Outline_Copy                                                    */\n  /*    FT_Outline_Translate                                               */\n  /*    FT_Outline_Transform                                               */\n  /*    FT_Outline_Embolden                                                */\n  /*    FT_Outline_EmboldenXY                                              */\n  /*    FT_Outline_Reverse                                                 */\n  /*    FT_Outline_Check                                                   */\n  /*                                                                       */\n  /*    FT_Outline_Get_CBox                                                */\n  /*    FT_Outline_Get_BBox                                                */\n  /*                                                                       */\n  /*    FT_Outline_Get_Bitmap                                              */\n  /*    FT_Outline_Render                                                  */\n  /*    FT_Outline_Decompose                                               */\n  /*    FT_Outline_Funcs                                                   */\n  /*    FT_Outline_MoveToFunc                                              */\n  /*    FT_Outline_LineToFunc                                              */\n  /*    FT_Outline_ConicToFunc                                             */\n  /*    FT_Outline_CubicToFunc                                             */\n  /*                                                                       */\n  /*    FT_Orientation                                                     */\n  /*    FT_Outline_Get_Orientation                                         */\n  /*                                                                       */\n  /*    FT_OUTLINE_XXX                                                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Decompose                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Walk over an outline's structure to decompose it into individual   */\n  /*    segments and Bézier arcs.  This function also emits `move to'      */\n  /*    operations to indicate the start of new contours in the outline.   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline        :: A pointer to the source target.                  */\n  /*                                                                       */\n  /*    func_interface :: A table of `emitters', i.e., function pointers   */\n  /*                      called during decomposition to indicate path     */\n  /*                      operations.                                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    user           :: A typeless pointer that is passed to each        */\n  /*                      emitter during the decomposition.  It can be     */\n  /*                      used to store the state during the               */\n  /*                      decomposition.                                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    A contour that contains a single point only is represented by a    */\n  /*    `move to' operation followed by `line to' to the same point.  In   */\n  /*    most cases, it is best to filter this out before using the         */\n  /*    outline for stroking purposes (otherwise it would result in a      */\n  /*    visible dot when round caps are used).                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Decompose( FT_Outline*              outline,\n                        const FT_Outline_Funcs*  func_interface,\n                        void*                    user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_New                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new outline of a given size.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library     :: A handle to the library object from where the       */\n  /*                   outline is allocated.  Note however that the new    */\n  /*                   outline will *not* necessarily be *freed*, when     */\n  /*                   destroying the library, by @FT_Done_FreeType.       */\n  /*                                                                       */\n  /*    numPoints   :: The maximum number of points within the outline.    */\n  /*                   Must be smaller than or equal to 0xFFFF (65535).    */\n  /*                                                                       */\n  /*    numContours :: The maximum number of contours within the outline.  */\n  /*                   This value must be in the range 0 to `numPoints'.   */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    anoutline   :: A handle to the new outline.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The reason why this function takes a `library' parameter is simply */\n  /*    to use the library's memory allocator.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_New( FT_Library   library,\n                  FT_UInt      numPoints,\n                  FT_Int       numContours,\n                  FT_Outline  *anoutline );\n\n\n  FT_EXPORT( FT_Error )\n  FT_Outline_New_Internal( FT_Memory    memory,\n                           FT_UInt      numPoints,\n                           FT_Int       numContours,\n                           FT_Outline  *anoutline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Done                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy an outline created with @FT_Outline_New.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle of the library object used to allocate the     */\n  /*               outline.                                                */\n  /*                                                                       */\n  /*    outline :: A pointer to the outline object to be discarded.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If the outline's `owner' field is not set, only the outline        */\n  /*    descriptor will be released.                                       */\n  /*                                                                       */\n  /*    The reason why this function takes an `library' parameter is       */\n  /*    simply to use ft_mem_free().                                       */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Done( FT_Library   library,\n                   FT_Outline*  outline );\n\n\n  FT_EXPORT( FT_Error )\n  FT_Outline_Done_Internal( FT_Memory    memory,\n                            FT_Outline*  outline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Check                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Check the contents of an outline descriptor.                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline :: A handle to a source outline.                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Check( FT_Outline*  outline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Get_CBox                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return an outline's `control box'.  The control box encloses all   */\n  /*    the outline's points, including Bézier control points.  Though it  */\n  /*    coincides with the exact bounding box for most glyphs, it can be   */\n  /*    slightly larger in some situations (like when rotating an outline  */\n  /*    that contains Bézier outside arcs).                                */\n  /*                                                                       */\n  /*    Computing the control box is very fast, while getting the bounding */\n  /*    box can take much more time as it needs to walk over all segments  */\n  /*    and arcs in the outline.  To get the latter, you can use the       */\n  /*    `ftbbox' component, which is dedicated to this single task.        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline :: A pointer to the source outline descriptor.             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acbox   :: The outline's control box.                              */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    See @FT_Glyph_Get_CBox for a discussion of tricky fonts.           */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Get_CBox( const FT_Outline*  outline,\n                       FT_BBox           *acbox );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Translate                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Apply a simple translation to the points of an outline.            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline :: A pointer to the target outline descriptor.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    xOffset :: The horizontal offset.                                  */\n  /*                                                                       */\n  /*    yOffset :: The vertical offset.                                    */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Translate( const FT_Outline*  outline,\n                        FT_Pos             xOffset,\n                        FT_Pos             yOffset );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Copy                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Copy an outline into another one.  Both objects must have the      */\n  /*    same sizes (number of points & number of contours) when this       */\n  /*    function is called.                                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    source :: A handle to the source outline.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target :: A handle to the target outline.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Copy( const FT_Outline*  source,\n                   FT_Outline        *target );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Transform                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Apply a simple 2x2 matrix to all of an outline's points.  Useful   */\n  /*    for applying rotations, slanting, flipping, etc.                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline :: A pointer to the target outline descriptor.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix  :: A pointer to the transformation matrix.                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You can use @FT_Outline_Translate if you need to translate the     */\n  /*    outline's points.                                                  */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Transform( const FT_Outline*  outline,\n                        const FT_Matrix*   matrix );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Embolden                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Embolden an outline.  The new outline will be at most 4~times      */\n  /*    `strength' pixels wider and higher.  You may think of the left and */\n  /*    bottom borders as unchanged.                                       */\n  /*                                                                       */\n  /*    Negative `strength' values to reduce the outline thickness are     */\n  /*    possible also.                                                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline  :: A handle to the target outline.                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    strength :: How strong the glyph is emboldened.  Expressed in      */\n  /*                26.6 pixel format.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The used algorithm to increase or decrease the thickness of the    */\n  /*    glyph doesn't change the number of points; this means that certain */\n  /*    situations like acute angles or intersections are sometimes        */\n  /*    handled incorrectly.                                               */\n  /*                                                                       */\n  /*    If you need `better' metrics values you should call                */\n  /*    @FT_Outline_Get_CBox or @FT_Outline_Get_BBox.                      */\n  /*                                                                       */\n  /*    Example call:                                                      */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      FT_Load_Glyph( face, index, FT_LOAD_DEFAULT );                   */\n  /*      if ( face->slot->format == FT_GLYPH_FORMAT_OUTLINE )             */\n  /*        FT_Outline_Embolden( &face->slot->outline, strength );         */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    To get meaningful results, font scaling values must be set with    */\n  /*    functions like @FT_Set_Char_Size before calling FT_Render_Glyph.   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Embolden( FT_Outline*  outline,\n                       FT_Pos       strength );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_EmboldenXY                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Embolden an outline.  The new outline will be `xstrength' pixels   */\n  /*    wider and `ystrength' pixels higher.  Otherwise, it is similar to  */\n  /*    @FT_Outline_Embolden, which uses the same strength in both         */\n  /*    directions.                                                        */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_EmboldenXY( FT_Outline*  outline,\n                         FT_Pos       xstrength,\n                         FT_Pos       ystrength );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Reverse                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Reverse the drawing direction of an outline.  This is used to      */\n  /*    ensure consistent fill conventions for mirrored glyphs.            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline :: A pointer to the target outline descriptor.             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function toggles the bit flag @FT_OUTLINE_REVERSE_FILL in     */\n  /*    the outline's `flags' field.                                       */\n  /*                                                                       */\n  /*    It shouldn't be used by a normal client application, unless it     */\n  /*    knows what it is doing.                                            */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Reverse( FT_Outline*  outline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Get_Bitmap                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Render an outline within a bitmap.  The outline's image is simply  */\n  /*    OR-ed to the target bitmap.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a FreeType library object.                  */\n  /*                                                                       */\n  /*    outline :: A pointer to the source outline descriptor.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    abitmap :: A pointer to the target bitmap descriptor.              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function does NOT CREATE the bitmap, it only renders an       */\n  /*    outline image within the one you pass to it!  Consequently, the    */\n  /*    various fields in `abitmap' should be set accordingly.             */\n  /*                                                                       */\n  /*    It will use the raster corresponding to the default glyph format.  */\n  /*                                                                       */\n  /*    The value of the `num_grays' field in `abitmap' is ignored.  If    */\n  /*    you select the gray-level rasterizer, and you want less than 256   */\n  /*    gray levels, you have to use @FT_Outline_Render directly.          */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Get_Bitmap( FT_Library        library,\n                         FT_Outline*       outline,\n                         const FT_Bitmap  *abitmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Render                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Render an outline within a bitmap using the current scan-convert.  */\n  /*    This function uses an @FT_Raster_Params structure as an argument,  */\n  /*    allowing advanced features like direct composition, translucency,  */\n  /*    etc.                                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a FreeType library object.                  */\n  /*                                                                       */\n  /*    outline :: A pointer to the source outline descriptor.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    params  :: A pointer to an @FT_Raster_Params structure used to     */\n  /*               describe the rendering operation.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should know what you are doing and how @FT_Raster_Params works */\n  /*    to use this function.                                              */\n  /*                                                                       */\n  /*    The field `params.source' will be set to `outline' before the scan */\n  /*    converter is called, which means that the value you give to it is  */\n  /*    actually ignored.                                                  */\n  /*                                                                       */\n  /*    The gray-level rasterizer always uses 256 gray levels.  If you     */\n  /*    want less gray levels, you have to provide your own span callback. */\n  /*    See the @FT_RASTER_FLAG_DIRECT value of the `flags' field in the   */\n  /*    @FT_Raster_Params structure for more details.                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Render( FT_Library         library,\n                     FT_Outline*        outline,\n                     FT_Raster_Params*  params );\n\n\n /**************************************************************************\n  *\n  * @enum:\n  *   FT_Orientation\n  *\n  * @description:\n  *   A list of values used to describe an outline's contour orientation.\n  *\n  *   The TrueType and PostScript specifications use different conventions\n  *   to determine whether outline contours should be filled or unfilled.\n  *\n  * @values:\n  *   FT_ORIENTATION_TRUETYPE ::\n  *     According to the TrueType specification, clockwise contours must\n  *     be filled, and counter-clockwise ones must be unfilled.\n  *\n  *   FT_ORIENTATION_POSTSCRIPT ::\n  *     According to the PostScript specification, counter-clockwise contours\n  *     must be filled, and clockwise ones must be unfilled.\n  *\n  *   FT_ORIENTATION_FILL_RIGHT ::\n  *     This is identical to @FT_ORIENTATION_TRUETYPE, but is used to\n  *     remember that in TrueType, everything that is to the right of\n  *     the drawing direction of a contour must be filled.\n  *\n  *   FT_ORIENTATION_FILL_LEFT ::\n  *     This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to\n  *     remember that in PostScript, everything that is to the left of\n  *     the drawing direction of a contour must be filled.\n  *\n  *   FT_ORIENTATION_NONE ::\n  *     The orientation cannot be determined.  That is, different parts of\n  *     the glyph have different orientation.\n  *\n  */\n  typedef enum  FT_Orientation_\n  {\n    FT_ORIENTATION_TRUETYPE   = 0,\n    FT_ORIENTATION_POSTSCRIPT = 1,\n    FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE,\n    FT_ORIENTATION_FILL_LEFT  = FT_ORIENTATION_POSTSCRIPT,\n    FT_ORIENTATION_NONE\n\n  } FT_Orientation;\n\n\n /**************************************************************************\n  *\n  * @function:\n  *   FT_Outline_Get_Orientation\n  *\n  * @description:\n  *   This function analyzes a glyph outline and tries to compute its\n  *   fill orientation (see @FT_Orientation).  This is done by integrating\n  *   the total area covered by the outline. The positive integral\n  *   corresponds to the clockwise orientation and @FT_ORIENTATION_POSTSCRIPT\n  *   is returned. The negative integral corresponds to the counter-clockwise\n  *   orientation and @FT_ORIENTATION_TRUETYPE is returned.\n  *\n  *   Note that this will return @FT_ORIENTATION_TRUETYPE for empty\n  *   outlines.\n  *\n  * @input:\n  *   outline ::\n  *     A handle to the source outline.\n  *\n  * @return:\n  *   The orientation.\n  *\n  */\n  FT_EXPORT( FT_Orientation )\n  FT_Outline_Get_Orientation( FT_Outline*  outline );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTOUTLN_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "ext/freetype2/include/ftpfr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftpfr.h                                                                */\n/*                                                                         */\n/*    FreeType API for accessing PFR-specific data (specification only).   */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006, 2008, 2009 by                        */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTPFR_H__\n#define __FTPFR_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    pfr_fonts                                                          */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    PFR Fonts                                                          */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    PFR/TrueDoc specific API.                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of PFR-specific functions.   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_PFR_Metrics\n  *\n  * @description:\n  *    Return the outline and metrics resolutions of a given PFR face.\n  *\n  * @input:\n  *    face :: Handle to the input face.  It can be a non-PFR face.\n  *\n  * @output:\n  *    aoutline_resolution ::\n  *      Outline resolution.  This is equivalent to `face->units_per_EM'\n  *      for non-PFR fonts.  Optional (parameter can be NULL).\n  *\n  *    ametrics_resolution ::\n  *      Metrics resolution.  This is equivalent to `outline_resolution'\n  *      for non-PFR fonts.  Optional (parameter can be NULL).\n  *\n  *    ametrics_x_scale ::\n  *      A 16.16 fixed-point number used to scale distance expressed\n  *      in metrics units to device sub-pixels.  This is equivalent to\n  *      `face->size->x_scale', but for metrics only.  Optional (parameter\n  *      can be NULL).\n  *\n  *    ametrics_y_scale ::\n  *      Same as `ametrics_x_scale' but for the vertical direction.\n  *      optional (parameter can be NULL).\n  *\n  * @return:\n  *    FreeType error code.  0~means success.\n  *\n  * @note:\n  *   If the input face is not a PFR, this function will return an error.\n  *   However, in all cases, it will return valid values.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PFR_Metrics( FT_Face    face,\n                      FT_UInt   *aoutline_resolution,\n                      FT_UInt   *ametrics_resolution,\n                      FT_Fixed  *ametrics_x_scale,\n                      FT_Fixed  *ametrics_y_scale );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_PFR_Kerning\n  *\n  * @description:\n  *    Return the kerning pair corresponding to two glyphs in a PFR face.\n  *    The distance is expressed in metrics units, unlike the result of\n  *    @FT_Get_Kerning.\n  *\n  * @input:\n  *    face  :: A handle to the input face.\n  *\n  *    left  :: Index of the left glyph.\n  *\n  *    right :: Index of the right glyph.\n  *\n  * @output:\n  *    avector :: A kerning vector.\n  *\n  * @return:\n  *    FreeType error code.  0~means success.\n  *\n  * @note:\n  *    This function always return distances in original PFR metrics\n  *    units.  This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED\n  *    mode, which always returns distances converted to outline units.\n  *\n  *    You can use the value of the `x_scale' and `y_scale' parameters\n  *    returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PFR_Kerning( FT_Face     face,\n                      FT_UInt     left,\n                      FT_UInt     right,\n                      FT_Vector  *avector );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_PFR_Advance\n  *\n  * @description:\n  *    Return a given glyph advance, expressed in original metrics units,\n  *    from a PFR font.\n  *\n  * @input:\n  *    face   :: A handle to the input face.\n  *\n  *    gindex :: The glyph index.\n  *\n  * @output:\n  *    aadvance :: The glyph advance in metrics units.\n  *\n  * @return:\n  *    FreeType error code.  0~means success.\n  *\n  * @note:\n  *    You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics\n  *    to convert the advance to device sub-pixels (i.e., 1/64th of pixels).\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PFR_Advance( FT_Face   face,\n                      FT_UInt   gindex,\n                      FT_Pos   *aadvance );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTPFR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftrender.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftrender.h                                                             */\n/*                                                                         */\n/*    FreeType renderer modules public interface (specification).          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2005, 2006, 2010 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTRENDER_H__\n#define __FTRENDER_H__\n\n\n#include <ft2build.h>\n#include FT_MODULE_H\n#include FT_GLYPH_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    module_management                                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* create a new glyph object */\n  typedef FT_Error\n  (*FT_Glyph_InitFunc)( FT_Glyph      glyph,\n                        FT_GlyphSlot  slot );\n\n  /* destroys a given glyph object */\n  typedef void\n  (*FT_Glyph_DoneFunc)( FT_Glyph  glyph );\n\n  typedef void\n  (*FT_Glyph_TransformFunc)( FT_Glyph          glyph,\n                             const FT_Matrix*  matrix,\n                             const FT_Vector*  delta );\n\n  typedef void\n  (*FT_Glyph_GetBBoxFunc)( FT_Glyph  glyph,\n                           FT_BBox*  abbox );\n\n  typedef FT_Error\n  (*FT_Glyph_CopyFunc)( FT_Glyph   source,\n                        FT_Glyph   target );\n\n  typedef FT_Error\n  (*FT_Glyph_PrepareFunc)( FT_Glyph      glyph,\n                           FT_GlyphSlot  slot );\n\n/* deprecated */\n#define FT_Glyph_Init_Func       FT_Glyph_InitFunc\n#define FT_Glyph_Done_Func       FT_Glyph_DoneFunc\n#define FT_Glyph_Transform_Func  FT_Glyph_TransformFunc\n#define FT_Glyph_BBox_Func       FT_Glyph_GetBBoxFunc\n#define FT_Glyph_Copy_Func       FT_Glyph_CopyFunc\n#define FT_Glyph_Prepare_Func    FT_Glyph_PrepareFunc\n\n\n  struct  FT_Glyph_Class_\n  {\n    FT_Long                 glyph_size;\n    FT_Glyph_Format         glyph_format;\n    FT_Glyph_InitFunc       glyph_init;\n    FT_Glyph_DoneFunc       glyph_done;\n    FT_Glyph_CopyFunc       glyph_copy;\n    FT_Glyph_TransformFunc  glyph_transform;\n    FT_Glyph_GetBBoxFunc    glyph_bbox;\n    FT_Glyph_PrepareFunc    glyph_prepare;\n  };\n\n\n  typedef FT_Error\n  (*FT_Renderer_RenderFunc)( FT_Renderer       renderer,\n                             FT_GlyphSlot      slot,\n                             FT_UInt           mode,\n                             const FT_Vector*  origin );\n\n  typedef FT_Error\n  (*FT_Renderer_TransformFunc)( FT_Renderer       renderer,\n                                FT_GlyphSlot      slot,\n                                const FT_Matrix*  matrix,\n                                const FT_Vector*  delta );\n\n\n  typedef void\n  (*FT_Renderer_GetCBoxFunc)( FT_Renderer   renderer,\n                              FT_GlyphSlot  slot,\n                              FT_BBox*      cbox );\n\n\n  typedef FT_Error\n  (*FT_Renderer_SetModeFunc)( FT_Renderer  renderer,\n                              FT_ULong     mode_tag,\n                              FT_Pointer   mode_ptr );\n\n/* deprecated identifiers */\n#define FTRenderer_render  FT_Renderer_RenderFunc\n#define FTRenderer_transform  FT_Renderer_TransformFunc\n#define FTRenderer_getCBox  FT_Renderer_GetCBoxFunc\n#define FTRenderer_setMode  FT_Renderer_SetModeFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Renderer_Class                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The renderer module class descriptor.                              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root            :: The root @FT_Module_Class fields.               */\n  /*                                                                       */\n  /*    glyph_format    :: The glyph image format this renderer handles.   */\n  /*                                                                       */\n  /*    render_glyph    :: A method used to render the image that is in a  */\n  /*                       given glyph slot into a bitmap.                 */\n  /*                                                                       */\n  /*    transform_glyph :: A method used to transform the image that is in */\n  /*                       a given glyph slot.                             */\n  /*                                                                       */\n  /*    get_glyph_cbox  :: A method used to access the glyph's cbox.       */\n  /*                                                                       */\n  /*    set_mode        :: A method used to pass additional parameters.    */\n  /*                                                                       */\n  /*    raster_class    :: For @FT_GLYPH_FORMAT_OUTLINE renderers only.    */\n  /*                       This is a pointer to its raster's class.        */\n  /*                                                                       */\n  typedef struct  FT_Renderer_Class_\n  {\n    FT_Module_Class            root;\n\n    FT_Glyph_Format            glyph_format;\n\n    FT_Renderer_RenderFunc     render_glyph;\n    FT_Renderer_TransformFunc  transform_glyph;\n    FT_Renderer_GetCBoxFunc    get_glyph_cbox;\n    FT_Renderer_SetModeFunc    set_mode;\n\n    FT_Raster_Funcs*           raster_class;\n\n  } FT_Renderer_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Renderer                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the current renderer for a given glyph format.            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to the library object.                         */\n  /*                                                                       */\n  /*    format  :: The glyph format.                                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A renderer handle.  0~if none found.                               */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An error will be returned if a module already exists by that name, */\n  /*    or if the module requires a version of FreeType that is too great. */\n  /*                                                                       */\n  /*    To add a new renderer, simply use @FT_Add_Module.  To retrieve a   */\n  /*    renderer by its name, use @FT_Get_Module.                          */\n  /*                                                                       */\n  FT_EXPORT( FT_Renderer )\n  FT_Get_Renderer( FT_Library       library,\n                   FT_Glyph_Format  format );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Renderer                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Set the current renderer to use, and set additional mode.          */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    renderer   :: A handle to the renderer object.                     */\n  /*                                                                       */\n  /*    num_params :: The number of additional parameters.                 */\n  /*                                                                       */\n  /*    parameters :: Additional parameters.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    In case of success, the renderer will be used to convert glyph     */\n  /*    images in the renderer's known format into bitmaps.                */\n  /*                                                                       */\n  /*    This doesn't change the current renderer for other formats.        */\n  /*                                                                       */\n  /*    Currently, only the B/W renderer, if compiled with                 */\n  /*    FT_RASTER_OPTION_ANTI_ALIASING (providing a 5-levels               */\n  /*    anti-aliasing mode; this option must be set directly in            */\n  /*    `ftraster.c' and is undefined by default) accepts a single tag     */\n  /*    `pal5' to set its gray palette as a character string with          */\n  /*    5~elements.  Consequently, the third and fourth argument are zero  */\n  /*    normally.                                                          */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Renderer( FT_Library     library,\n                   FT_Renderer    renderer,\n                   FT_UInt        num_params,\n                   FT_Parameter*  parameters );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTRENDER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftsizes.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsizes.h                                                              */\n/*                                                                         */\n/*    FreeType size objects management (specification).                    */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2004, 2006, 2009, 2013 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Typical application would normally not need to use these functions.   */\n  /* However, they have been placed in a public API for the rare cases     */\n  /* where they are needed.                                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTSIZES_H__\n#define __FTSIZES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    sizes_management                                                   */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Size Management                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Managing multiple sizes per face.                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    When creating a new face object (e.g., with @FT_New_Face), an      */\n  /*    @FT_Size object is automatically created and used to store all     */\n  /*    pixel-size dependent information, available in the `face->size'    */\n  /*    field.                                                             */\n  /*                                                                       */\n  /*    It is however possible to create more sizes for a given face,      */\n  /*    mostly in order to manage several character pixel sizes of the     */\n  /*    same font family and style.  See @FT_New_Size and @FT_Done_Size.   */\n  /*                                                                       */\n  /*    Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only           */\n  /*    modify the contents of the current `active' size; you thus need    */\n  /*    to use @FT_Activate_Size to change it.                             */\n  /*                                                                       */\n  /*    99% of applications won't need the functions provided here,        */\n  /*    especially if they use the caching sub-system, so be cautious      */\n  /*    when using these.                                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Size                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new size object from a given face object.                 */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to a parent face object.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    asize :: A handle to a new size object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You need to call @FT_Activate_Size in order to select the new size */\n  /*    for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size,      */\n  /*    @FT_Load_Glyph, @FT_Load_Char, etc.                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Size( FT_Face   face,\n               FT_Size*  size );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Size                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard a given size object.  Note that @FT_Done_Face              */\n  /*    automatically discards all size objects allocated with             */\n  /*    @FT_New_Size.                                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    size :: A handle to a target size object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_Size( FT_Size  size );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Activate_Size                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Even though it is possible to create several size objects for a    */\n  /*    given face (see @FT_New_Size for details), functions like          */\n  /*    @FT_Load_Glyph or @FT_Load_Char only use the one that has been     */\n  /*    activated last to determine the `current character pixel size'.    */\n  /*                                                                       */\n  /*    This function can be used to `activate' a previously created size  */\n  /*    object.                                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    size :: A handle to a target size object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If `face' is the size's parent face object, this function changes  */\n  /*    the value of `face->size' to the input size handle.                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Activate_Size( FT_Size  size );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTSIZES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftsnames.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsnames.h                                                             */\n/*                                                                         */\n/*    Simple interface to access SFNT name tables (which are used          */\n/*    to hold font names, copyright info, notices, etc.) (specification).  */\n/*                                                                         */\n/*    This is _not_ used to retrieve glyph names!                          */\n/*                                                                         */\n/*  Copyright 1996-2003, 2006, 2009, 2010, 2013 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FT_SFNT_NAMES_H__\n#define __FT_SFNT_NAMES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    sfnt_names                                                         */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    SFNT Names                                                         */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Access the names embedded in TrueType and OpenType files.          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The TrueType and OpenType specifications allow the inclusion of    */\n  /*    a special `names table' in font files.  This table contains        */\n  /*    textual (and internationalized) information regarding the font,    */\n  /*    like family name, copyright, version, etc.                         */\n  /*                                                                       */\n  /*    The definitions below are used to access them if available.        */\n  /*                                                                       */\n  /*    Note that this has nothing to do with glyph names!                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_SfntName                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model an SFNT `name' table entry.              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    platform_id :: The platform ID for `string'.                       */\n  /*                                                                       */\n  /*    encoding_id :: The encoding ID for `string'.                       */\n  /*                                                                       */\n  /*    language_id :: The language ID for `string'.                       */\n  /*                                                                       */\n  /*    name_id     :: An identifier for `string'.                         */\n  /*                                                                       */\n  /*    string      :: The `name' string.  Note that its format differs    */\n  /*                   depending on the (platform,encoding) pair.  It can  */\n  /*                   be a Pascal String, a UTF-16 one, etc.              */\n  /*                                                                       */\n  /*                   Generally speaking, the string is not               */\n  /*                   zero-terminated.  Please refer to the TrueType      */\n  /*                   specification for details.                          */\n  /*                                                                       */\n  /*    string_len  :: The length of `string' in bytes.                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Possible values for `platform_id', `encoding_id', `language_id',   */\n  /*    and `name_id' are given in the file `ttnameid.h'.  For details     */\n  /*    please refer to the TrueType or OpenType specification.            */\n  /*                                                                       */\n  /*    See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX,       */\n  /*    @TT_ISO_ID_XXX, and @TT_MS_ID_XXX.                                 */\n  /*                                                                       */\n  typedef struct  FT_SfntName_\n  {\n    FT_UShort  platform_id;\n    FT_UShort  encoding_id;\n    FT_UShort  language_id;\n    FT_UShort  name_id;\n\n    FT_Byte*   string;      /* this string is *not* null-terminated! */\n    FT_UInt    string_len;  /* in bytes */\n\n  } FT_SfntName;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Sfnt_Name_Count                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the number of name strings in the SFNT `name' table.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source face.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The number of strings in the `name' table.                         */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Get_Sfnt_Name_Count( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Sfnt_Name                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve a string of the SFNT `name' table for a given index.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face  :: A handle to the source face.                              */\n  /*                                                                       */\n  /*    idx   :: The index of the `name' string.                           */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aname :: The indexed @FT_SfntName structure.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0~means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `string' array returned in the `aname' structure is not        */\n  /*    null-terminated.  The application should deallocate it if it is no */\n  /*    longer in use.                                                     */\n  /*                                                                       */\n  /*    Use @FT_Get_Sfnt_Name_Count to get the total number of available   */\n  /*    `name' table entries, then do a loop until you get the right       */\n  /*    platform, encoding, and name ID.                                   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Sfnt_Name( FT_Face       face,\n                    FT_UInt       idx,\n                    FT_SfntName  *aname );\n\n\n  /***************************************************************************\n   *\n   * @constant:\n   *   FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY\n   *\n   * @description:\n   *   A constant used as the tag of @FT_Parameter structures to make\n   *   FT_Open_Face() ignore preferred family subfamily names in `name'\n   *   table since OpenType version 1.4.  For backwards compatibility with\n   *   legacy systems that have a 4-face-per-family restriction.\n   *\n   */\n#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY  FT_MAKE_TAG( 'i', 'g', 'p', 'f' )\n\n\n  /***************************************************************************\n   *\n   * @constant:\n   *   FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY\n   *\n   * @description:\n   *   A constant used as the tag of @FT_Parameter structures to make\n   *   FT_Open_Face() ignore preferred subfamily names in `name' table since\n   *   OpenType version 1.4.  For backwards compatibility with legacy\n   *   systems that have a 4-face-per-family restriction.\n   *\n   */\n#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY  FT_MAKE_TAG( 'i', 'g', 'p', 's' )\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FT_SFNT_NAMES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftstroke.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftstroke.h                                                             */\n/*                                                                         */\n/*    FreeType path stroker (specification).                               */\n/*                                                                         */\n/*  Copyright 2002-2006, 2008, 2009, 2011-2012, 2014 by                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FT_STROKE_H__\n#define __FT_STROKE_H__\n\n#include <ft2build.h>\n#include FT_OUTLINE_H\n#include FT_GLYPH_H\n\n\nFT_BEGIN_HEADER\n\n\n /************************************************************************\n  *\n  * @section:\n  *    glyph_stroker\n  *\n  * @title:\n  *    Glyph Stroker\n  *\n  * @abstract:\n  *    Generating bordered and stroked glyphs.\n  *\n  * @description:\n  *    This component generates stroked outlines of a given vectorial\n  *    glyph.  It also allows you to retrieve the `outside' and/or the\n  *    `inside' borders of the stroke.\n  *\n  *    This can be useful to generate `bordered' glyph, i.e., glyphs\n  *    displayed with a coloured (and anti-aliased) border around their\n  *    shape.\n  *\n  * @order:\n  *    FT_Stroker\n  *\n  *    FT_Stroker_LineJoin\n  *    FT_Stroker_LineCap\n  *    FT_StrokerBorder\n  *\n  *    FT_Outline_GetInsideBorder\n  *    FT_Outline_GetOutsideBorder\n  *\n  *    FT_Glyph_Stroke\n  *    FT_Glyph_StrokeBorder\n  *\n  *    FT_Stroker_New\n  *    FT_Stroker_Set\n  *    FT_Stroker_Rewind\n  *    FT_Stroker_ParseOutline\n  *    FT_Stroker_Done\n  *\n  *    FT_Stroker_BeginSubPath\n  *    FT_Stroker_EndSubPath\n  *\n  *    FT_Stroker_LineTo\n  *    FT_Stroker_ConicTo\n  *    FT_Stroker_CubicTo\n  *\n  *    FT_Stroker_GetBorderCounts\n  *    FT_Stroker_ExportBorder\n  *    FT_Stroker_GetCounts\n  *    FT_Stroker_Export\n  *\n  */\n\n\n /**************************************************************\n  *\n  * @type:\n  *   FT_Stroker\n  *\n  * @description:\n  *   Opaque handle to a path stroker object.\n  */\n  typedef struct FT_StrokerRec_*  FT_Stroker;\n\n\n  /**************************************************************\n   *\n   * @enum:\n   *   FT_Stroker_LineJoin\n   *\n   * @description:\n   *   These values determine how two joining lines are rendered\n   *   in a stroker.\n   *\n   * @values:\n   *   FT_STROKER_LINEJOIN_ROUND ::\n   *     Used to render rounded line joins.  Circular arcs are used\n   *     to join two lines smoothly.\n   *\n   *   FT_STROKER_LINEJOIN_BEVEL ::\n   *     Used to render beveled line joins.  The outer corner of\n   *     the joined lines is filled by enclosing the triangular\n   *     region of the corner with a straight line between the\n   *     outer corners of each stroke.\n   *\n   *   FT_STROKER_LINEJOIN_MITER_FIXED ::\n   *     Used to render mitered line joins, with fixed bevels if the\n   *     miter limit is exceeded.  The outer edges of the strokes\n   *     for the two segments are extended until they meet at an\n   *     angle.  If the segments meet at too sharp an angle (such\n   *     that the miter would extend from the intersection of the\n   *     segments a distance greater than the product of the miter\n   *     limit value and the border radius), then a bevel join (see\n   *     above) is used instead.  This prevents long spikes being\n   *     created.  FT_STROKER_LINEJOIN_MITER_FIXED generates a miter\n   *     line join as used in PostScript and PDF.\n   *\n   *   FT_STROKER_LINEJOIN_MITER_VARIABLE ::\n   *   FT_STROKER_LINEJOIN_MITER ::\n   *     Used to render mitered line joins, with variable bevels if\n   *     the miter limit is exceeded.  The intersection of the\n   *     strokes is clipped at a line perpendicular to the bisector\n   *     of the angle between the strokes, at the distance from the\n   *     intersection of the segments equal to the product of the\n   *     miter limit value and the border radius.  This prevents\n   *     long spikes being created.\n   *     FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line\n   *     join as used in XPS.  FT_STROKER_LINEJOIN_MITER is an alias\n   *     for FT_STROKER_LINEJOIN_MITER_VARIABLE, retained for\n   *     backwards compatibility.\n   */\n  typedef enum  FT_Stroker_LineJoin_\n  {\n    FT_STROKER_LINEJOIN_ROUND          = 0,\n    FT_STROKER_LINEJOIN_BEVEL          = 1,\n    FT_STROKER_LINEJOIN_MITER_VARIABLE = 2,\n    FT_STROKER_LINEJOIN_MITER          = FT_STROKER_LINEJOIN_MITER_VARIABLE,\n    FT_STROKER_LINEJOIN_MITER_FIXED    = 3\n\n  } FT_Stroker_LineJoin;\n\n\n  /**************************************************************\n   *\n   * @enum:\n   *   FT_Stroker_LineCap\n   *\n   * @description:\n   *   These values determine how the end of opened sub-paths are\n   *   rendered in a stroke.\n   *\n   * @values:\n   *   FT_STROKER_LINECAP_BUTT ::\n   *     The end of lines is rendered as a full stop on the last\n   *     point itself.\n   *\n   *   FT_STROKER_LINECAP_ROUND ::\n   *     The end of lines is rendered as a half-circle around the\n   *     last point.\n   *\n   *   FT_STROKER_LINECAP_SQUARE ::\n   *     The end of lines is rendered as a square around the\n   *     last point.\n   */\n  typedef enum  FT_Stroker_LineCap_\n  {\n    FT_STROKER_LINECAP_BUTT = 0,\n    FT_STROKER_LINECAP_ROUND,\n    FT_STROKER_LINECAP_SQUARE\n\n  } FT_Stroker_LineCap;\n\n\n  /**************************************************************\n   *\n   * @enum:\n   *   FT_StrokerBorder\n   *\n   * @description:\n   *   These values are used to select a given stroke border\n   *   in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.\n   *\n   * @values:\n   *   FT_STROKER_BORDER_LEFT ::\n   *     Select the left border, relative to the drawing direction.\n   *\n   *   FT_STROKER_BORDER_RIGHT ::\n   *     Select the right border, relative to the drawing direction.\n   *\n   * @note:\n   *   Applications are generally interested in the `inside' and `outside'\n   *   borders.  However, there is no direct mapping between these and the\n   *   `left' and `right' ones, since this really depends on the glyph's\n   *   drawing orientation, which varies between font formats.\n   *\n   *   You can however use @FT_Outline_GetInsideBorder and\n   *   @FT_Outline_GetOutsideBorder to get these.\n   */\n  typedef enum  FT_StrokerBorder_\n  {\n    FT_STROKER_BORDER_LEFT = 0,\n    FT_STROKER_BORDER_RIGHT\n\n  } FT_StrokerBorder;\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Outline_GetInsideBorder\n   *\n   * @description:\n   *   Retrieve the @FT_StrokerBorder value corresponding to the\n   *   `inside' borders of a given outline.\n   *\n   * @input:\n   *   outline ::\n   *     The source outline handle.\n   *\n   * @return:\n   *   The border index.  @FT_STROKER_BORDER_RIGHT for empty or invalid\n   *   outlines.\n   */\n  FT_EXPORT( FT_StrokerBorder )\n  FT_Outline_GetInsideBorder( FT_Outline*  outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Outline_GetOutsideBorder\n   *\n   * @description:\n   *   Retrieve the @FT_StrokerBorder value corresponding to the\n   *   `outside' borders of a given outline.\n   *\n   * @input:\n   *   outline ::\n   *     The source outline handle.\n   *\n   * @return:\n   *   The border index.  @FT_STROKER_BORDER_LEFT for empty or invalid\n   *   outlines.\n   */\n  FT_EXPORT( FT_StrokerBorder )\n  FT_Outline_GetOutsideBorder( FT_Outline*  outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_New\n   *\n   * @description:\n   *   Create a new stroker object.\n   *\n   * @input:\n   *   library ::\n   *     FreeType library handle.\n   *\n   * @output:\n   *   astroker ::\n   *     A new stroker object handle.  NULL in case of error.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_New( FT_Library   library,\n                  FT_Stroker  *astroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Set\n   *\n   * @description:\n   *   Reset a stroker object's attributes.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   radius ::\n   *     The border radius.\n   *\n   *   line_cap ::\n   *     The line cap style.\n   *\n   *   line_join ::\n   *     The line join style.\n   *\n   *   miter_limit ::\n   *     The miter limit for the FT_STROKER_LINEJOIN_MITER_FIXED and\n   *     FT_STROKER_LINEJOIN_MITER_VARIABLE line join styles,\n   *     expressed as 16.16 fixed-point value.\n   *\n   * @note:\n   *   The radius is expressed in the same units as the outline\n   *   coordinates.\n   *\n   *   This function calls @FT_Stroker_Rewind automatically.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Set( FT_Stroker           stroker,\n                  FT_Fixed             radius,\n                  FT_Stroker_LineCap   line_cap,\n                  FT_Stroker_LineJoin  line_join,\n                  FT_Fixed             miter_limit );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Rewind\n   *\n   * @description:\n   *   Reset a stroker object without changing its attributes.\n   *   You should call this function before beginning a new\n   *   series of calls to @FT_Stroker_BeginSubPath or\n   *   @FT_Stroker_EndSubPath.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Rewind( FT_Stroker  stroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_ParseOutline\n   *\n   * @description:\n   *   A convenience function used to parse a whole outline with\n   *   the stroker.  The resulting outline(s) can be retrieved\n   *   later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   outline ::\n   *     The source outline.\n   *\n   *   opened ::\n   *     A boolean.  If~1, the outline is treated as an open path instead\n   *     of a closed one.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   If `opened' is~0 (the default), the outline is treated as a closed\n   *   path, and the stroker generates two distinct `border' outlines.\n   *\n   *   If `opened' is~1, the outline is processed as an open path, and the\n   *   stroker generates a single `stroke' outline.\n   *\n   *   This function calls @FT_Stroker_Rewind automatically.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_ParseOutline( FT_Stroker   stroker,\n                           FT_Outline*  outline,\n                           FT_Bool      opened );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_BeginSubPath\n   *\n   * @description:\n   *   Start a new sub-path in the stroker.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   to ::\n   *     A pointer to the start vector.\n   *\n   *   open ::\n   *     A boolean.  If~1, the sub-path is treated as an open one.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   This function is useful when you need to stroke a path that is\n   *   not stored as an @FT_Outline object.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_BeginSubPath( FT_Stroker  stroker,\n                           FT_Vector*  to,\n                           FT_Bool     open );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_EndSubPath\n   *\n   * @description:\n   *   Close the current sub-path in the stroker.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function after @FT_Stroker_BeginSubPath.\n   *   If the subpath was not `opened', this function `draws' a\n   *   single line segment to the start position when needed.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_EndSubPath( FT_Stroker  stroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_LineTo\n   *\n   * @description:\n   *   `Draw' a single line segment in the stroker's current sub-path,\n   *   from the last position.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   to ::\n   *     A pointer to the destination point.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function between @FT_Stroker_BeginSubPath and\n   *   @FT_Stroker_EndSubPath.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_LineTo( FT_Stroker  stroker,\n                     FT_Vector*  to );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_ConicTo\n   *\n   * @description:\n   *   `Draw' a single quadratic Bézier in the stroker's current sub-path,\n   *   from the last position.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   control ::\n   *     A pointer to a Bézier control point.\n   *\n   *   to ::\n   *     A pointer to the destination point.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function between @FT_Stroker_BeginSubPath and\n   *   @FT_Stroker_EndSubPath.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_ConicTo( FT_Stroker  stroker,\n                      FT_Vector*  control,\n                      FT_Vector*  to );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_CubicTo\n   *\n   * @description:\n   *   `Draw' a single cubic Bézier in the stroker's current sub-path,\n   *   from the last position.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   control1 ::\n   *     A pointer to the first Bézier control point.\n   *\n   *   control2 ::\n   *     A pointer to second Bézier control point.\n   *\n   *   to ::\n   *     A pointer to the destination point.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   You should call this function between @FT_Stroker_BeginSubPath and\n   *   @FT_Stroker_EndSubPath.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_CubicTo( FT_Stroker  stroker,\n                      FT_Vector*  control1,\n                      FT_Vector*  control2,\n                      FT_Vector*  to );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_GetBorderCounts\n   *\n   * @description:\n   *   Call this function once you have finished parsing your paths\n   *   with the stroker.  It returns the number of points and\n   *   contours necessary to export one of the `border' or `stroke'\n   *   outlines generated by the stroker.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   border ::\n   *     The border index.\n   *\n   * @output:\n   *   anum_points ::\n   *     The number of points.\n   *\n   *   anum_contours ::\n   *     The number of contours.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   When an outline, or a sub-path, is `closed', the stroker generates\n   *   two independent `border' outlines, named `left' and `right'.\n   *\n   *   When the outline, or a sub-path, is `opened', the stroker merges\n   *   the `border' outlines with caps.  The `left' border receives all\n   *   points, while the `right' border becomes empty.\n   *\n   *   Use the function @FT_Stroker_GetCounts instead if you want to\n   *   retrieve the counts associated to both borders.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_GetBorderCounts( FT_Stroker        stroker,\n                              FT_StrokerBorder  border,\n                              FT_UInt          *anum_points,\n                              FT_UInt          *anum_contours );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_ExportBorder\n   *\n   * @description:\n   *   Call this function after @FT_Stroker_GetBorderCounts to\n   *   export the corresponding border to your own @FT_Outline\n   *   structure.\n   *\n   *   Note that this function appends the border points and\n   *   contours to your outline, but does not try to resize its\n   *   arrays.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   border ::\n   *     The border index.\n   *\n   *   outline ::\n   *     The target outline handle.\n   *\n   * @note:\n   *   Always call this function after @FT_Stroker_GetBorderCounts to\n   *   get sure that there is enough room in your @FT_Outline object to\n   *   receive all new data.\n   *\n   *   When an outline, or a sub-path, is `closed', the stroker generates\n   *   two independent `border' outlines, named `left' and `right'.\n   *\n   *   When the outline, or a sub-path, is `opened', the stroker merges\n   *   the `border' outlines with caps.  The `left' border receives all\n   *   points, while the `right' border becomes empty.\n   *\n   *   Use the function @FT_Stroker_Export instead if you want to\n   *   retrieve all borders at once.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_ExportBorder( FT_Stroker        stroker,\n                           FT_StrokerBorder  border,\n                           FT_Outline*       outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_GetCounts\n   *\n   * @description:\n   *   Call this function once you have finished parsing your paths\n   *   with the stroker.  It returns the number of points and\n   *   contours necessary to export all points/borders from the stroked\n   *   outline/path.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   * @output:\n   *   anum_points ::\n   *     The number of points.\n   *\n   *   anum_contours ::\n   *     The number of contours.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_GetCounts( FT_Stroker  stroker,\n                        FT_UInt    *anum_points,\n                        FT_UInt    *anum_contours );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Export\n   *\n   * @description:\n   *   Call this function after @FT_Stroker_GetBorderCounts to\n   *   export all borders to your own @FT_Outline structure.\n   *\n   *   Note that this function appends the border points and\n   *   contours to your outline, but does not try to resize its\n   *   arrays.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   outline ::\n   *     The target outline handle.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Export( FT_Stroker   stroker,\n                     FT_Outline*  outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Done\n   *\n   * @description:\n   *   Destroy a stroker object.\n   *\n   * @input:\n   *   stroker ::\n   *     A stroker handle.  Can be NULL.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Done( FT_Stroker  stroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Glyph_Stroke\n   *\n   * @description:\n   *   Stroke a given outline glyph object with a given stroker.\n   *\n   * @inout:\n   *   pglyph ::\n   *     Source glyph handle on input, new glyph handle on output.\n   *\n   * @input:\n   *   stroker ::\n   *     A stroker handle.\n   *\n   *   destroy ::\n   *     A Boolean.  If~1, the source glyph object is destroyed\n   *     on success.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *   The source glyph is untouched in case of error.\n   *\n   *   Adding stroke may yield a significantly wider and taller glyph\n   *   depending on how large of a radius was used to stroke the glyph.  You\n   *   may need to manually adjust horizontal and vertical advance amounts\n   *   to account for this added size.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_Stroke( FT_Glyph    *pglyph,\n                   FT_Stroker   stroker,\n                   FT_Bool      destroy );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Glyph_StrokeBorder\n   *\n   * @description:\n   *   Stroke a given outline glyph object with a given stroker, but\n   *   only return either its inside or outside border.\n   *\n   * @inout:\n   *   pglyph ::\n   *     Source glyph handle on input, new glyph handle on output.\n   *\n   * @input:\n   *   stroker ::\n   *     A stroker handle.\n   *\n   *   inside ::\n   *     A Boolean.  If~1, return the inside border, otherwise\n   *     the outside border.\n   *\n   *   destroy ::\n   *     A Boolean.  If~1, the source glyph object is destroyed\n   *     on success.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *   The source glyph is untouched in case of error.\n   *\n   *   Adding stroke may yield a significantly wider and taller glyph\n   *   depending on how large of a radius was used to stroke the glyph.  You\n   *   may need to manually adjust horizontal and vertical advance amounts\n   *   to account for this added size.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_StrokeBorder( FT_Glyph    *pglyph,\n                         FT_Stroker   stroker,\n                         FT_Bool      inside,\n                         FT_Bool      destroy );\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __FT_STROKE_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "ext/freetype2/include/ftsynth.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsynth.h                                                              */\n/*                                                                         */\n/*    FreeType synthesizing code for emboldening and slanting              */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 2000-2001, 2003, 2006, 2008, 2012, 2013 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*********                                                       *********/\n  /*********        WARNING, THIS IS ALPHA CODE!  THIS API         *********/\n  /*********    IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE    *********/\n  /*********            FREETYPE DEVELOPMENT TEAM                  *********/\n  /*********                                                       *********/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* Main reason for not lifting the functions in this module to a  */\n  /* `standard' API is that the used parameters for emboldening and */\n  /* slanting are not configurable.  Consider the functions as a    */\n  /* code resource that should be copied into the application and   */\n  /* adapted to the particular needs.                               */\n\n\n#ifndef __FTSYNTH_H__\n#define __FTSYNTH_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /* Embolden a glyph by a `reasonable' value (which is highly a matter of */\n  /* taste).  This function is actually a convenience function, providing  */\n  /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden.           */\n  /*                                                                       */\n  /* For emboldened outlines the height, width, and advance metrics are    */\n  /* increased by the strength of the emboldening.  You can also call      */\n  /* @FT_Outline_Get_CBox to get precise values.                           */\n  FT_EXPORT( void )\n  FT_GlyphSlot_Embolden( FT_GlyphSlot  slot );\n\n  /* Slant an outline glyph to the right by about 12 degrees. */\n  FT_EXPORT( void )\n  FT_GlyphSlot_Oblique( FT_GlyphSlot  slot );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTSYNTH_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftsystem.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsystem.h                                                             */\n/*                                                                         */\n/*    FreeType low-level system interface definition (specification).      */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2005, 2010, 2014 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTSYSTEM_H__\n#define __FTSYSTEM_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*   system_interface                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*   System Interface                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*   How FreeType manages memory and i/o.                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   This section contains various definitions related to memory         */\n  /*   management and i/o access.  You need to understand this             */\n  /*   information if you want to use a custom memory manager or you own   */\n  /*   i/o streams.                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                  M E M O R Y   M A N A G E M E N T                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FT_Memory\n   *\n   * @description:\n   *   A handle to a given memory manager object, defined with an\n   *   @FT_MemoryRec structure.\n   *\n   */\n  typedef struct FT_MemoryRec_*  FT_Memory;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Alloc_Func\n   *\n   * @description:\n   *   A function used to allocate `size' bytes from `memory'.\n   *\n   * @input:\n   *   memory ::\n   *     A handle to the source memory manager.\n   *\n   *   size ::\n   *     The size in bytes to allocate.\n   *\n   * @return:\n   *   Address of new memory block.  0~in case of failure.\n   *\n   */\n  typedef void*\n  (*FT_Alloc_Func)( FT_Memory  memory,\n                    long       size );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Free_Func\n   *\n   * @description:\n   *   A function used to release a given block of memory.\n   *\n   * @input:\n   *   memory ::\n   *     A handle to the source memory manager.\n   *\n   *   block ::\n   *     The address of the target memory block.\n   *\n   */\n  typedef void\n  (*FT_Free_Func)( FT_Memory  memory,\n                   void*      block );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Realloc_Func\n   *\n   * @description:\n   *   A function used to re-allocate a given block of memory.\n   *\n   * @input:\n   *   memory ::\n   *     A handle to the source memory manager.\n   *\n   *   cur_size ::\n   *     The block's current size in bytes.\n   *\n   *   new_size ::\n   *     The block's requested new size.\n   *\n   *   block ::\n   *     The block's current address.\n   *\n   * @return:\n   *   New block address.  0~in case of memory shortage.\n   *\n   * @note:\n   *   In case of error, the old block must still be available.\n   *\n   */\n  typedef void*\n  (*FT_Realloc_Func)( FT_Memory  memory,\n                      long       cur_size,\n                      long       new_size,\n                      void*      block );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FT_MemoryRec\n   *\n   * @description:\n   *   A structure used to describe a given memory manager to FreeType~2.\n   *\n   * @fields:\n   *   user ::\n   *     A generic typeless pointer for user data.\n   *\n   *   alloc ::\n   *     A pointer type to an allocation function.\n   *\n   *   free ::\n   *     A pointer type to an memory freeing function.\n   *\n   *   realloc ::\n   *     A pointer type to a reallocation function.\n   *\n   */\n  struct  FT_MemoryRec_\n  {\n    void*            user;\n    FT_Alloc_Func    alloc;\n    FT_Free_Func     free;\n    FT_Realloc_Func  realloc;\n  };\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                       I / O   M A N A G E M E N T                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FT_Stream\n   *\n   * @description:\n   *   A handle to an input stream.\n   *\n   * @also:\n   *   See @FT_StreamRec for the publicly accessible fields of a given\n   *   stream object.\n   *\n   */\n  typedef struct FT_StreamRec_*  FT_Stream;\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FT_StreamDesc\n   *\n   * @description:\n   *   A union type used to store either a long or a pointer.  This is used\n   *   to store a file descriptor or a `FILE*' in an input stream.\n   *\n   */\n  typedef union  FT_StreamDesc_\n  {\n    long   value;\n    void*  pointer;\n\n  } FT_StreamDesc;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Stream_IoFunc\n   *\n   * @description:\n   *   A function used to seek and read data from a given input stream.\n   *\n   * @input:\n   *   stream ::\n   *     A handle to the source stream.\n   *\n   *   offset ::\n   *     The offset of read in stream (always from start).\n   *\n   *   buffer ::\n   *     The address of the read buffer.\n   *\n   *   count ::\n   *     The number of bytes to read from the stream.\n   *\n   * @return:\n   *   The number of bytes effectively read by the stream.\n   *\n   * @note:\n   *   This function might be called to perform a seek or skip operation\n   *   with a `count' of~0.  A non-zero return value then indicates an\n   *   error.\n   *\n   */\n  typedef unsigned long\n  (*FT_Stream_IoFunc)( FT_Stream       stream,\n                       unsigned long   offset,\n                       unsigned char*  buffer,\n                       unsigned long   count );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Stream_CloseFunc\n   *\n   * @description:\n   *   A function used to close a given input stream.\n   *\n   * @input:\n   *  stream ::\n   *     A handle to the target stream.\n   *\n   */\n  typedef void\n  (*FT_Stream_CloseFunc)( FT_Stream  stream );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FT_StreamRec\n   *\n   * @description:\n   *   A structure used to describe an input stream.\n   *\n   * @input:\n   *   base ::\n   *     For memory-based streams, this is the address of the first stream\n   *     byte in memory.  This field should always be set to NULL for\n   *     disk-based streams.\n   *\n   *   size ::\n   *     The stream size in bytes.\n   *\n   *     In case of compressed streams where the size is unknown before\n   *     actually doing the decompression, the value is set to 0x7FFFFFFF. \n   *     (Note that this size value can occur for normal streams also; it is\n   *     thus just a hint.)\n   *\n   *   pos ::\n   *     The current position within the stream.\n   *\n   *   descriptor ::\n   *     This field is a union that can hold an integer or a pointer.  It is\n   *     used by stream implementations to store file descriptors or `FILE*'\n   *     pointers.\n   *\n   *   pathname ::\n   *     This field is completely ignored by FreeType.  However, it is often\n   *     useful during debugging to use it to store the stream's filename\n   *     (where available).\n   *\n   *   read ::\n   *     The stream's input function.\n   *\n   *   close ::\n   *     The stream's close function.\n   *\n   *   memory ::\n   *     The memory manager to use to preload frames.  This is set\n   *     internally by FreeType and shouldn't be touched by stream\n   *     implementations.\n   *\n   *   cursor ::\n   *     This field is set and used internally by FreeType when parsing\n   *     frames.\n   *\n   *   limit ::\n   *     This field is set and used internally by FreeType when parsing\n   *     frames.\n   *\n   */\n  typedef struct  FT_StreamRec_\n  {\n    unsigned char*       base;\n    unsigned long        size;\n    unsigned long        pos;\n\n    FT_StreamDesc        descriptor;\n    FT_StreamDesc        pathname;\n    FT_Stream_IoFunc     read;\n    FT_Stream_CloseFunc  close;\n\n    FT_Memory            memory;\n    unsigned char*       cursor;\n    unsigned char*       limit;\n\n  } FT_StreamRec;\n\n  /* */\n\n\n/* cf. http://lists.gnu.org/archive/html/freetype/2006-09/msg00036.html */\n#ifdef _WIN32\nFT_FILE* ft_fopen_win32(const char *fname, const char *mode);\n#endif\n\n\nFT_END_HEADER\n\n#endif /* __FTSYSTEM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/fttrigon.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fttrigon.h                                                             */\n/*                                                                         */\n/*    FreeType trigonometric functions (specification).                    */\n/*                                                                         */\n/*  Copyright 2001, 2003, 2005, 2007, 2013 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTTRIGON_H__\n#define __FTTRIGON_H__\n\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*   computations                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FT_Angle\n   *\n   * @description:\n   *   This type is used to model angle values in FreeType.  Note that the\n   *   angle is a 16.16 fixed-point value expressed in degrees.\n   *\n   */\n  typedef FT_Fixed  FT_Angle;\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_PI\n   *\n   * @description:\n   *   The angle pi expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_PI  ( 180L << 16 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_2PI\n   *\n   * @description:\n   *   The angle 2*pi expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_2PI  ( FT_ANGLE_PI * 2 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_PI2\n   *\n   * @description:\n   *   The angle pi/2 expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_PI2  ( FT_ANGLE_PI / 2 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_PI4\n   *\n   * @description:\n   *   The angle pi/4 expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_PI4  ( FT_ANGLE_PI / 4 )\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Sin\n   *\n   * @description:\n   *   Return the sinus of a given angle in fixed-point format.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   * @return:\n   *   The sinus value.\n   *\n   * @note:\n   *   If you need both the sinus and cosinus for a given angle, use the\n   *   function @FT_Vector_Unit.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Sin( FT_Angle  angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Cos\n   *\n   * @description:\n   *   Return the cosinus of a given angle in fixed-point format.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   * @return:\n   *   The cosinus value.\n   *\n   * @note:\n   *   If you need both the sinus and cosinus for a given angle, use the\n   *   function @FT_Vector_Unit.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Cos( FT_Angle  angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Tan\n   *\n   * @description:\n   *   Return the tangent of a given angle in fixed-point format.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   * @return:\n   *   The tangent value.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Tan( FT_Angle  angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Atan2\n   *\n   * @description:\n   *   Return the arc-tangent corresponding to a given vector (x,y) in\n   *   the 2d plane.\n   *\n   * @input:\n   *   x ::\n   *     The horizontal vector coordinate.\n   *\n   *   y ::\n   *     The vertical vector coordinate.\n   *\n   * @return:\n   *   The arc-tangent value (i.e. angle).\n   *\n   */\n  FT_EXPORT( FT_Angle )\n  FT_Atan2( FT_Fixed  x,\n            FT_Fixed  y );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Angle_Diff\n   *\n   * @description:\n   *   Return the difference between two angles.  The result is always\n   *   constrained to the ]-PI..PI] interval.\n   *\n   * @input:\n   *   angle1 ::\n   *     First angle.\n   *\n   *   angle2 ::\n   *     Second angle.\n   *\n   * @return:\n   *   Constrained value of `value2-value1'.\n   *\n   */\n  FT_EXPORT( FT_Angle )\n  FT_Angle_Diff( FT_Angle  angle1,\n                 FT_Angle  angle2 );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Unit\n   *\n   * @description:\n   *   Return the unit vector corresponding to a given angle.  After the\n   *   call, the value of `vec.x' will be `sin(angle)', and the value of\n   *   `vec.y' will be `cos(angle)'.\n   *\n   *   This function is useful to retrieve both the sinus and cosinus of a\n   *   given angle quickly.\n   *\n   * @output:\n   *   vec ::\n   *     The address of target vector.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_Unit( FT_Vector*  vec,\n                  FT_Angle    angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Rotate\n   *\n   * @description:\n   *   Rotate a vector by a given angle.\n   *\n   * @inout:\n   *   vec ::\n   *     The address of target vector.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_Rotate( FT_Vector*  vec,\n                    FT_Angle    angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Length\n   *\n   * @description:\n   *   Return the length of a given vector.\n   *\n   * @input:\n   *   vec ::\n   *     The address of target vector.\n   *\n   * @return:\n   *   The vector length, expressed in the same units that the original\n   *   vector coordinates.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Vector_Length( FT_Vector*  vec );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Polarize\n   *\n   * @description:\n   *   Compute both the length and angle of a given vector.\n   *\n   * @input:\n   *   vec ::\n   *     The address of source vector.\n   *\n   * @output:\n   *   length ::\n   *     The vector length.\n   *\n   *   angle ::\n   *     The vector angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_Polarize( FT_Vector*  vec,\n                      FT_Fixed   *length,\n                      FT_Angle   *angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_From_Polar\n   *\n   * @description:\n   *   Compute vector coordinates from a length and angle.\n   *\n   * @output:\n   *   vec ::\n   *     The address of source vector.\n   *\n   * @input:\n   *   length ::\n   *     The vector length.\n   *\n   *   angle ::\n   *     The vector angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_From_Polar( FT_Vector*  vec,\n                        FT_Fixed    length,\n                        FT_Angle    angle );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTTRIGON_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftttdrv.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftttdrv.h                                                              */\n/*                                                                         */\n/*    FreeType API for controlling the TrueType driver                     */\n/*    (specification only).                                                */\n/*                                                                         */\n/*  Copyright 2013 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTTTDRV_H__\n#define __FTTTDRV_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   tt_driver\n   *\n   * @title:\n   *   The TrueType driver\n   *\n   * @abstract:\n   *   Controlling the TrueType driver module.\n   *\n   * @description:\n   *   While FreeType's TrueType driver doesn't expose API functions by\n   *   itself, it is possible to control its behaviour with @FT_Property_Set\n   *   and @FT_Property_Get.  The following lists the available properties\n   *   together with the necessary macros and structures.\n   *\n   *   The TrueType driver's module name is `truetype'.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @property:\n   *   interpreter-version\n   *\n   * @description:\n   *   Currently, two versions are available, representing the bytecode\n   *   interpreter with and without subpixel hinting support,\n   *   respectively.  The default is subpixel support if\n   *   TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel\n   *   support otherwise (since it isn't available then).\n   *\n   *   If subpixel hinting is on, many TrueType bytecode instructions\n   *   behave differently compared to B/W or grayscale rendering.  The\n   *   main idea is to render at a much increased horizontal resolution,\n   *   then sampling down the created output to subpixel precision.\n   *   However, many older fonts are not suited to this and must be\n   *   specially taken care of by applying (hardcoded) font-specific\n   *   tweaks.\n   *\n   *   Details on subpixel hinting and some of the necessary tweaks can be\n   *   found in Greg Hitchcock's whitepaper at\n   *   `http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'.\n   *\n   *   The following example code demonstrates how to activate subpixel\n   *   hinting (omitting the error handling).\n   *\n   *   {\n   *     FT_Library  library;\n   *     FT_Face     face;\n   *     FT_UInt     interpreter_version = TT_INTERPRETER_VERSION_38;\n   *\n   *\n   *     FT_Init_FreeType( &library );\n   *\n   *     FT_Property_Set( library, \"truetype\",\n   *                               \"interpreter-version\",\n   *                               &interpreter_version );\n   *   }\n   *\n   * @note:\n   *   This property can be used with @FT_Property_Get also.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   * @enum:\n   *   TT_INTERPRETER_VERSION_XXX\n   *\n   * @description:\n   *   A list of constants used for the @interpreter-version property to\n   *   select the hinting engine for Truetype fonts.\n   *\n   *   The numeric value in the constant names represents the version\n   *   number as returned by the `GETINFO' bytecode instruction.\n   *\n   * @values:\n   *   TT_INTERPRETER_VERSION_35 ::\n   *     Version~35 corresponds to MS rasterizer v.1.7 as used e.g. in\n   *     Windows~98; only grayscale and B/W rasterizing is supported.\n   *\n   *   TT_INTERPRETER_VERSION_38 ::\n   *     Version~38 corresponds to MS rasterizer v.1.9; it is roughly\n   *     equivalent to the hinting provided by DirectWrite ClearType (as\n   *     can be found, for example, in the Internet Explorer~9 running on\n   *     Windows~7).\n   *\n   * @note:\n   *   This property controls the behaviour of the bytecode interpreter\n   *   and thus how outlines get hinted.  It does *not* control how glyph\n   *   get rasterized!  In particular, it does not control subpixel color\n   *   filtering.\n   *\n   *   If FreeType has not been compiled with configuration option\n   *   FT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version~38 causes an\n   *   `FT_Err_Unimplemented_Feature' error.\n   *\n   *   Depending on the graphics framework, Microsoft uses different\n   *   bytecode engines.  As a consequence, the version numbers returned by\n   *   a call to the `GETINFO[1]' bytecode instruction are more convoluted\n   *   than desired.\n   *\n   *   {\n   *      framework   Windows version   result of GETINFO[1]\n   *     ----------------------------------------------------\n   *       GDI         before XP         35\n   *       GDI         XP and later      37\n   *       GDI+ old    before Vista      37\n   *       GDI+ old    Vista, 7          38\n   *       GDI+        after 7           40\n   *       DWrite      before 8          39\n   *       DWrite      8 and later       40\n   *   }\n   *\n   *   Since FreeType doesn't provide all capabilities of DWrite ClearType,\n   *   using version~38 seems justified.\n   *\n   */\n#define TT_INTERPRETER_VERSION_35  35\n#define TT_INTERPRETER_VERSION_38  38\n\n /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __FTTTDRV_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/fttypes.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fttypes.h                                                              */\n/*                                                                         */\n/*    FreeType simple types definitions (specification only).              */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004, 2006-2009, 2012-2014 by                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTTYPES_H__\n#define __FTTYPES_H__\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_SYSTEM_H\n#include FT_IMAGE_H\n\n#include <stddef.h>\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Basic Data Types                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    The basic data types defined by the library.                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the basic data types defined by FreeType~2,  */\n  /*    ranging from simple scalar types to bitmap descriptors.  More      */\n  /*    font-specific structures are defined in a different section.       */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Byte                                                            */\n  /*    FT_Bytes                                                           */\n  /*    FT_Char                                                            */\n  /*    FT_Int                                                             */\n  /*    FT_UInt                                                            */\n  /*    FT_Int16                                                           */\n  /*    FT_UInt16                                                          */\n  /*    FT_Int32                                                           */\n  /*    FT_UInt32                                                          */\n  /*    FT_Int64                                                           */\n  /*    FT_UInt64                                                          */\n  /*    FT_Short                                                           */\n  /*    FT_UShort                                                          */\n  /*    FT_Long                                                            */\n  /*    FT_ULong                                                           */\n  /*    FT_Bool                                                            */\n  /*    FT_Offset                                                          */\n  /*    FT_PtrDist                                                         */\n  /*    FT_String                                                          */\n  /*    FT_Tag                                                             */\n  /*    FT_Error                                                           */\n  /*    FT_Fixed                                                           */\n  /*    FT_Pointer                                                         */\n  /*    FT_Pos                                                             */\n  /*    FT_Vector                                                          */\n  /*    FT_BBox                                                            */\n  /*    FT_Matrix                                                          */\n  /*    FT_FWord                                                           */\n  /*    FT_UFWord                                                          */\n  /*    FT_F2Dot14                                                         */\n  /*    FT_UnitVector                                                      */\n  /*    FT_F26Dot6                                                         */\n  /*    FT_Data                                                            */\n  /*                                                                       */\n  /*    FT_MAKE_TAG                                                        */\n  /*                                                                       */\n  /*    FT_Generic                                                         */\n  /*    FT_Generic_Finalizer                                               */\n  /*                                                                       */\n  /*    FT_Bitmap                                                          */\n  /*    FT_Pixel_Mode                                                      */\n  /*    FT_Palette_Mode                                                    */\n  /*    FT_Glyph_Format                                                    */\n  /*    FT_IMAGE_TAG                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Bool                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef of unsigned char, used for simple booleans.  As usual,   */\n  /*    values 1 and~0 represent true and false, respectively.             */\n  /*                                                                       */\n  typedef unsigned char  FT_Bool;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_FWord                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A signed 16-bit integer used to store a distance in original font  */\n  /*    units.                                                             */\n  /*                                                                       */\n  typedef signed short  FT_FWord;   /* distance in FUnits */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UFWord                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An unsigned 16-bit integer used to store a distance in original    */\n  /*    font units.                                                        */\n  /*                                                                       */\n  typedef unsigned short  FT_UFWord;  /* unsigned distance */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Char                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for the _signed_ char type.                       */\n  /*                                                                       */\n  typedef signed char  FT_Char;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Byte                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for the _unsigned_ char type.                     */\n  /*                                                                       */\n  typedef unsigned char  FT_Byte;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Bytes                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for constant memory areas.                               */\n  /*                                                                       */\n  typedef const FT_Byte*  FT_Bytes;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Tag                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for 32-bit tags (as used in the SFNT format).            */\n  /*                                                                       */\n  typedef FT_UInt32  FT_Tag;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_String                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for the char type, usually used for strings.      */\n  /*                                                                       */\n  typedef char  FT_String;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Short                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for signed short.                                        */\n  /*                                                                       */\n  typedef signed short  FT_Short;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UShort                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for unsigned short.                                      */\n  /*                                                                       */\n  typedef unsigned short  FT_UShort;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for the int type.                                        */\n  /*                                                                       */\n  typedef signed int  FT_Int;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for the unsigned int type.                               */\n  /*                                                                       */\n  typedef unsigned int  FT_UInt;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Long                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for signed long.                                         */\n  /*                                                                       */\n  typedef signed long  FT_Long;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_ULong                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for unsigned long.                                       */\n  /*                                                                       */\n  typedef unsigned long  FT_ULong;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_F2Dot14                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A signed 2.14 fixed-point type used for unit vectors.              */\n  /*                                                                       */\n  typedef signed short  FT_F2Dot14;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_F26Dot6                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A signed 26.6 fixed-point type used for vectorial pixel            */\n  /*    coordinates.                                                       */\n  /*                                                                       */\n  typedef signed long  FT_F26Dot6;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Fixed                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This type is used to store 16.16 fixed-point values, like scaling  */\n  /*    values or matrix coefficients.                                     */\n  /*                                                                       */\n  typedef signed long  FT_Fixed;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Error                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The FreeType error code type.  A value of~0 is always interpreted  */\n  /*    as a successful operation.                                         */\n  /*                                                                       */\n  typedef int  FT_Error;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Pointer                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for a typeless pointer.                           */\n  /*                                                                       */\n  typedef void*  FT_Pointer;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Offset                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is equivalent to the ANSI~C `size_t' type, i.e., the largest  */\n  /*    _unsigned_ integer type used to express a file size or position,   */\n  /*    or a memory block size.                                            */\n  /*                                                                       */\n  typedef size_t  FT_Offset;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_PtrDist                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is equivalent to the ANSI~C `ptrdiff_t' type, i.e., the       */\n  /*    largest _signed_ integer type used to express the distance         */\n  /*    between two pointers.                                              */\n  /*                                                                       */\n  typedef ft_ptrdiff_t  FT_PtrDist;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_UnitVector                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to store a 2D vector unit vector.  Uses    */\n  /*    FT_F2Dot14 types.                                                  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x :: Horizontal coordinate.                                        */\n  /*                                                                       */\n  /*    y :: Vertical coordinate.                                          */\n  /*                                                                       */\n  typedef struct  FT_UnitVector_\n  {\n    FT_F2Dot14  x;\n    FT_F2Dot14  y;\n\n  } FT_UnitVector;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Matrix                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to store a 2x2 matrix.  Coefficients are   */\n  /*    in 16.16 fixed-point format.  The computation performed is:        */\n  /*                                                                       */\n  /*       {                                                               */\n  /*          x' = x*xx + y*xy                                             */\n  /*          y' = x*yx + y*yy                                             */\n  /*       }                                                               */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    xx :: Matrix coefficient.                                          */\n  /*                                                                       */\n  /*    xy :: Matrix coefficient.                                          */\n  /*                                                                       */\n  /*    yx :: Matrix coefficient.                                          */\n  /*                                                                       */\n  /*    yy :: Matrix coefficient.                                          */\n  /*                                                                       */\n  typedef struct  FT_Matrix_\n  {\n    FT_Fixed  xx, xy;\n    FT_Fixed  yx, yy;\n\n  } FT_Matrix;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Data                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Read-only binary data represented as a pointer and a length.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    pointer :: The data.                                               */\n  /*                                                                       */\n  /*    length  :: The length of the data in bytes.                        */\n  /*                                                                       */\n  typedef struct  FT_Data_\n  {\n    const FT_Byte*  pointer;\n    FT_Int          length;\n\n  } FT_Data;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Generic_Finalizer                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Describe a function used to destroy the `client' data of any       */\n  /*    FreeType object.  See the description of the @FT_Generic type for  */\n  /*    details of usage.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    The address of the FreeType object that is under finalization.     */\n  /*    Its client data is accessed through its `generic' field.           */\n  /*                                                                       */\n  typedef void  (*FT_Generic_Finalizer)(void*  object);\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Generic                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Client applications often need to associate their own data to a    */\n  /*    variety of FreeType core objects.  For example, a text layout API  */\n  /*    might want to associate a glyph cache to a given size object.      */\n  /*                                                                       */\n  /*    Some FreeType object contains a `generic' field, of type           */\n  /*    FT_Generic, which usage is left to client applications and font    */\n  /*    servers.                                                           */\n  /*                                                                       */\n  /*    It can be used to store a pointer to client-specific data, as well */\n  /*    as the address of a `finalizer' function, which will be called by  */\n  /*    FreeType when the object is destroyed (for example, the previous   */\n  /*    client example would put the address of the glyph cache destructor */\n  /*    in the `finalizer' field).                                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    data      :: A typeless pointer to any client-specified data. This */\n  /*                 field is completely ignored by the FreeType library.  */\n  /*                                                                       */\n  /*    finalizer :: A pointer to a `generic finalizer' function, which    */\n  /*                 will be called when the object is destroyed.  If this */\n  /*                 field is set to NULL, no code will be called.         */\n  /*                                                                       */\n  typedef struct  FT_Generic_\n  {\n    void*                 data;\n    FT_Generic_Finalizer  finalizer;\n\n  } FT_Generic;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_MAKE_TAG                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro converts four-letter tags that are used to label        */\n  /*    TrueType tables into an unsigned long, to be used within FreeType. */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The produced values *must* be 32-bit integers.  Don't redefine     */\n  /*    this macro.                                                        */\n  /*                                                                       */\n#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \\\n          (FT_Tag)                        \\\n          ( ( (FT_ULong)_x1 << 24 ) |     \\\n            ( (FT_ULong)_x2 << 16 ) |     \\\n            ( (FT_ULong)_x3 <<  8 ) |     \\\n              (FT_ULong)_x4         )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                    L I S T   M A N A G E M E N T                      */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    list_processing                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_ListNode                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*     Many elements and objects in FreeType are listed through an       */\n  /*     @FT_List record (see @FT_ListRec).  As its name suggests, an      */\n  /*     FT_ListNode is a handle to a single list element.                 */\n  /*                                                                       */\n  typedef struct FT_ListNodeRec_*  FT_ListNode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_List                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a list record (see @FT_ListRec).                       */\n  /*                                                                       */\n  typedef struct FT_ListRec_*  FT_List;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_ListNodeRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold a single list element.                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    prev :: The previous element in the list.  NULL if first.          */\n  /*                                                                       */\n  /*    next :: The next element in the list.  NULL if last.               */\n  /*                                                                       */\n  /*    data :: A typeless pointer to the listed object.                   */\n  /*                                                                       */\n  typedef struct  FT_ListNodeRec_\n  {\n    FT_ListNode  prev;\n    FT_ListNode  next;\n    void*        data;\n\n  } FT_ListNodeRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_ListRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold a simple doubly-linked list.  These are   */\n  /*    used in many parts of FreeType.                                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    head :: The head (first element) of doubly-linked list.            */\n  /*                                                                       */\n  /*    tail :: The tail (last element) of doubly-linked list.             */\n  /*                                                                       */\n  typedef struct  FT_ListRec_\n  {\n    FT_ListNode  head;\n    FT_ListNode  tail;\n\n  } FT_ListRec;\n\n  /* */\n\n\n#define FT_IS_EMPTY( list )  ( (list).head == 0 )\n#define FT_BOOL( x )  ( (FT_Bool)( x ) )\n\n  /* concatenate C tokens */\n#define FT_ERR_XCAT( x, y )  x ## y\n#define FT_ERR_CAT( x, y )   FT_ERR_XCAT( x, y )\n\n  /* see `ftmoderr.h' for descriptions of the following macros */\n\n#define FT_ERR( e )  FT_ERR_CAT( FT_ERR_PREFIX, e )\n\n#define FT_ERROR_BASE( x )    ( (x) & 0xFF )\n#define FT_ERROR_MODULE( x )  ( (x) & 0xFF00U )\n\n#define FT_ERR_EQ( x, e )                                        \\\n          ( FT_ERROR_BASE( x ) == FT_ERROR_BASE( FT_ERR( e ) ) )\n#define FT_ERR_NEQ( x, e )                                       \\\n          ( FT_ERROR_BASE( x ) != FT_ERROR_BASE( FT_ERR( e ) ) )\n\n\nFT_END_HEADER\n\n#endif /* __FTTYPES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ftwinfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftwinfnt.h                                                             */\n/*                                                                         */\n/*    FreeType API for accessing Windows fnt-specific data.                */\n/*                                                                         */\n/*  Copyright 2003, 2004, 2008 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTWINFNT_H__\n#define __FTWINFNT_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    winfnt_fonts                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Window FNT Files                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Windows FNT specific API.                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of Windows FNT specific      */\n  /*    functions.                                                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FT_WinFNT_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `charset' byte in\n   *   @FT_WinFNT_HeaderRec.  Exact mapping tables for the various cpXXXX\n   *   encodings (except for cp1361) can be found at\n   *   ftp://ftp.unicode.org/public in the MAPPINGS/VENDORS/MICSFT/WINDOWS\n   *   subdirectory.  cp1361 is roughly a superset of\n   *   MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.\n   *\n   * @values:\n   *   FT_WinFNT_ID_DEFAULT ::\n   *     This is used for font enumeration and font creation as a\n   *     `don't care' value.  Valid font files don't contain this value.\n   *     When querying for information about the character set of the font\n   *     that is currently selected into a specified device context, this\n   *     return value (of the related Windows API) simply denotes failure.\n   *\n   *   FT_WinFNT_ID_SYMBOL ::\n   *     There is no known mapping table available.\n   *\n   *   FT_WinFNT_ID_MAC ::\n   *     Mac Roman encoding.\n   *\n   *   FT_WinFNT_ID_OEM ::\n   *     From Michael Pöttgen <michael@poettgen.de>:\n   *\n   *       The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM\n   *       is used for the charset of vector fonts, like `modern.fon',\n   *       `roman.fon', and `script.fon' on Windows.\n   *\n   *       The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value\n   *       specifies a character set that is operating-system dependent.\n   *\n   *       The `IFIMETRICS' documentation from the `Windows Driver\n   *       Development Kit' says: This font supports an OEM-specific\n   *       character set.  The OEM character set is system dependent.\n   *\n   *       In general OEM, as opposed to ANSI (i.e., cp1252), denotes the\n   *       second default codepage that most international versions of\n   *       Windows have.  It is one of the OEM codepages from\n   *\n   *         http://www.microsoft.com/globaldev/reference/cphome.mspx,\n   *\n   *       and is used for the `DOS boxes', to support legacy applications.\n   *       A German Windows version for example usually uses ANSI codepage\n   *       1252 and OEM codepage 850.\n   *\n   *   FT_WinFNT_ID_CP874 ::\n   *     A superset of Thai TIS 620 and ISO 8859-11.\n   *\n   *   FT_WinFNT_ID_CP932 ::\n   *     A superset of Japanese Shift-JIS (with minor deviations).\n   *\n   *   FT_WinFNT_ID_CP936 ::\n   *     A superset of simplified Chinese GB 2312-1980 (with different\n   *     ordering and minor deviations).\n   *\n   *   FT_WinFNT_ID_CP949 ::\n   *     A superset of Korean Hangul KS~C 5601-1987 (with different\n   *     ordering and minor deviations).\n   *\n   *   FT_WinFNT_ID_CP950 ::\n   *     A superset of traditional Chinese Big~5 ETen (with different\n   *     ordering and minor deviations).\n   *\n   *   FT_WinFNT_ID_CP1250 ::\n   *     A superset of East European ISO 8859-2 (with slightly different\n   *     ordering).\n   *\n   *   FT_WinFNT_ID_CP1251 ::\n   *     A superset of Russian ISO 8859-5 (with different ordering).\n   *\n   *   FT_WinFNT_ID_CP1252 ::\n   *     ANSI encoding.  A superset of ISO 8859-1.\n   *\n   *   FT_WinFNT_ID_CP1253 ::\n   *     A superset of Greek ISO 8859-7 (with minor modifications).\n   *\n   *   FT_WinFNT_ID_CP1254 ::\n   *     A superset of Turkish ISO 8859-9.\n   *\n   *   FT_WinFNT_ID_CP1255 ::\n   *     A superset of Hebrew ISO 8859-8 (with some modifications).\n   *\n   *   FT_WinFNT_ID_CP1256 ::\n   *     A superset of Arabic ISO 8859-6 (with different ordering).\n   *\n   *   FT_WinFNT_ID_CP1257 ::\n   *     A superset of Baltic ISO 8859-13 (with some deviations).\n   *\n   *   FT_WinFNT_ID_CP1258 ::\n   *     For Vietnamese.  This encoding doesn't cover all necessary\n   *     characters.\n   *\n   *   FT_WinFNT_ID_CP1361 ::\n   *     Korean (Johab).\n   */\n\n#define FT_WinFNT_ID_CP1252    0\n#define FT_WinFNT_ID_DEFAULT   1\n#define FT_WinFNT_ID_SYMBOL    2\n#define FT_WinFNT_ID_MAC      77\n#define FT_WinFNT_ID_CP932   128\n#define FT_WinFNT_ID_CP949   129\n#define FT_WinFNT_ID_CP1361  130\n#define FT_WinFNT_ID_CP936   134\n#define FT_WinFNT_ID_CP950   136\n#define FT_WinFNT_ID_CP1253  161\n#define FT_WinFNT_ID_CP1254  162\n#define FT_WinFNT_ID_CP1258  163\n#define FT_WinFNT_ID_CP1255  177\n#define FT_WinFNT_ID_CP1256  178\n#define FT_WinFNT_ID_CP1257  186\n#define FT_WinFNT_ID_CP1251  204\n#define FT_WinFNT_ID_CP874   222\n#define FT_WinFNT_ID_CP1250  238\n#define FT_WinFNT_ID_OEM     255\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_WinFNT_HeaderRec                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Windows FNT Header info.                                           */\n  /*                                                                       */\n  typedef struct  FT_WinFNT_HeaderRec_\n  {\n    FT_UShort  version;\n    FT_ULong   file_size;\n    FT_Byte    copyright[60];\n    FT_UShort  file_type;\n    FT_UShort  nominal_point_size;\n    FT_UShort  vertical_resolution;\n    FT_UShort  horizontal_resolution;\n    FT_UShort  ascent;\n    FT_UShort  internal_leading;\n    FT_UShort  external_leading;\n    FT_Byte    italic;\n    FT_Byte    underline;\n    FT_Byte    strike_out;\n    FT_UShort  weight;\n    FT_Byte    charset;\n    FT_UShort  pixel_width;\n    FT_UShort  pixel_height;\n    FT_Byte    pitch_and_family;\n    FT_UShort  avg_width;\n    FT_UShort  max_width;\n    FT_Byte    first_char;\n    FT_Byte    last_char;\n    FT_Byte    default_char;\n    FT_Byte    break_char;\n    FT_UShort  bytes_per_row;\n    FT_ULong   device_offset;\n    FT_ULong   face_name_offset;\n    FT_ULong   bits_pointer;\n    FT_ULong   bits_offset;\n    FT_Byte    reserved;\n    FT_ULong   flags;\n    FT_UShort  A_space;\n    FT_UShort  B_space;\n    FT_UShort  C_space;\n    FT_UShort  color_table_offset;\n    FT_ULong   reserved1[4];\n\n  } FT_WinFNT_HeaderRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_WinFNT_Header                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an @FT_WinFNT_HeaderRec structure.                     */\n  /*                                                                       */\n  typedef struct FT_WinFNT_HeaderRec_*  FT_WinFNT_Header;\n\n\n  /**********************************************************************\n   *\n   * @function:\n   *    FT_Get_WinFNT_Header\n   *\n   * @description:\n   *    Retrieve a Windows FNT font info header.\n   *\n   * @input:\n   *    face    :: A handle to the input face.\n   *\n   * @output:\n   *    aheader :: The WinFNT header.\n   *\n   * @return:\n   *   FreeType error code.  0~means success.\n   *\n   * @note:\n   *   This function only works with Windows FNT faces, returning an error\n   *   otherwise.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_WinFNT_Header( FT_Face               face,\n                        FT_WinFNT_HeaderRec  *aheader );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTWINFNT_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "ext/freetype2/include/ftxf86.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftxf86.h                                                               */\n/*                                                                         */\n/*    Support functions for X11.                                           */\n/*                                                                         */\n/*  Copyright 2002-2004, 2006, 2007, 2013 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTXF86_H__\n#define __FTXF86_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*   font_formats                                                        */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*   Font Formats                                                        */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*   Getting the font format.                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   The single function in this section can be used to get the font     */\n  /*   format.  Note that this information is not needed normally;         */\n  /*   however, there are special cases (like in PDF devices) where it is  */\n  /*   important to differentiate, in spite of FreeType's uniform API.     */\n  /*                                                                       */\n  /*   This function is in the X11/xf86 namespace for historical reasons   */\n  /*   and in no way depends on that windowing system.                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*   FT_Get_X11_Font_Format                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   Return a string describing the format of a given face, using values */\n  /*   that can be used as an X11 FONT_PROPERTY.  Possible values are      */\n  /*   `TrueType', `Type~1', `BDF', `PCF', `Type~42', `CID~Type~1', `CFF', */\n  /*   `PFR', and `Windows~FNT'.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*   face ::                                                             */\n  /*     Input face handle.                                                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*   Font format string.  NULL in case of error.                         */\n  /*                                                                       */\n  FT_EXPORT( const char* )\n  FT_Get_X11_Font_Format( FT_Face  face );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTXF86_H__ */\n"
  },
  {
    "path": "ext/freetype2/include/internal/autohint.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  autohint.h                                                             */\n/*                                                                         */\n/*    High-level `autohint' module-specific interface (specification).     */\n/*                                                                         */\n/*  Copyright 1996-2002, 2007, 2009, 2012 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The auto-hinter is used to load and automatically hint glyphs if a    */\n  /* format-specific hinter isn't available.                               */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __AUTOHINT_H__\n#define __AUTOHINT_H__\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* A small technical note regarding automatic hinting in order to        */\n  /* clarify this module interface.                                        */\n  /*                                                                       */\n  /* An automatic hinter might compute two kinds of data for a given face: */\n  /*                                                                       */\n  /* - global hints: Usually some metrics that describe global properties  */\n  /*                 of the face.  It is computed by scanning more or less */\n  /*                 aggressively the glyphs in the face, and thus can be  */\n  /*                 very slow to compute (even if the size of global      */\n  /*                 hints is really small).                               */\n  /*                                                                       */\n  /* - glyph hints:  These describe some important features of the glyph   */\n  /*                 outline, as well as how to align them.  They are      */\n  /*                 generally much faster to compute than global hints.   */\n  /*                                                                       */\n  /* The current FreeType auto-hinter does a pretty good job while         */\n  /* performing fast computations for both global and glyph hints.         */\n  /* However, we might be interested in introducing more complex and       */\n  /* powerful algorithms in the future, like the one described in the John */\n  /* D. Hobby paper, which unfortunately requires a lot more horsepower.   */\n  /*                                                                       */\n  /* Because a sufficiently sophisticated font management system would     */\n  /* typically implement an LRU cache of opened face objects to reduce     */\n  /* memory usage, it is a good idea to be able to avoid recomputing       */\n  /* global hints every time the same face is re-opened.                   */\n  /*                                                                       */\n  /* We thus provide the ability to cache global hints outside of the face */\n  /* object, in order to speed up font re-opening time.  Of course, this   */\n  /* feature is purely optional, so most client programs won't even notice */\n  /* it.                                                                   */\n  /*                                                                       */\n  /* I initially thought that it would be a good idea to cache the glyph   */\n  /* hints too.  However, my general idea now is that if you really need   */\n  /* to cache these too, you are simply in need of a new font format,      */\n  /* where all this information could be stored within the font file and   */\n  /* decoded on the fly.                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n\nFT_BEGIN_HEADER\n\n\n  typedef struct FT_AutoHinterRec_  *FT_AutoHinter;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_AutoHinter_GlobalGetFunc                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the global hints computed for a given face object.  The   */\n  /*    resulting data is dissociated from the face and will survive a     */\n  /*    call to FT_Done_Face().  It must be discarded through the API      */\n  /*    FT_AutoHinter_GlobalDoneFunc().                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    hinter       :: A handle to the source auto-hinter.                */\n  /*                                                                       */\n  /*    face         :: A handle to the source face object.                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    global_hints :: A typeless pointer to the global hints.            */\n  /*                                                                       */\n  /*    global_len   :: The size in bytes of the global hints.             */\n  /*                                                                       */\n  typedef void\n  (*FT_AutoHinter_GlobalGetFunc)( FT_AutoHinter  hinter,\n                                  FT_Face        face,\n                                  void**         global_hints,\n                                  long*          global_len );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_AutoHinter_GlobalDoneFunc                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard the global hints retrieved through                         */\n  /*    FT_AutoHinter_GlobalGetFunc().  This is the only way these hints   */\n  /*    are freed from memory.                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    hinter :: A handle to the auto-hinter module.                      */\n  /*                                                                       */\n  /*    global :: A pointer to retrieved global hints to discard.          */\n  /*                                                                       */\n  typedef void\n  (*FT_AutoHinter_GlobalDoneFunc)( FT_AutoHinter  hinter,\n                                   void*          global );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_AutoHinter_GlobalResetFunc                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to recompute the global metrics in a given   */\n  /*    font.  This is useful when global font data changes (e.g. Multiple */\n  /*    Masters fonts where blend coordinates change).                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    hinter :: A handle to the source auto-hinter.                      */\n  /*                                                                       */\n  /*    face   :: A handle to the face.                                    */\n  /*                                                                       */\n  typedef void\n  (*FT_AutoHinter_GlobalResetFunc)( FT_AutoHinter  hinter,\n                                    FT_Face        face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_AutoHinter_GlyphLoadFunc                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to load, scale, and automatically hint a     */\n  /*    glyph from a given face.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to the face.                               */\n  /*                                                                       */\n  /*    glyph_index :: The glyph index.                                    */\n  /*                                                                       */\n  /*    load_flags  :: The load flags.                                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is capable of loading composite glyphs by hinting    */\n  /*    each sub-glyph independently (which improves quality).             */\n  /*                                                                       */\n  /*    It will call the font driver with @FT_Load_Glyph, with             */\n  /*    @FT_LOAD_NO_SCALE set.                                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_AutoHinter_GlyphLoadFunc)( FT_AutoHinter  hinter,\n                                  FT_GlyphSlot   slot,\n                                  FT_Size        size,\n                                  FT_UInt        glyph_index,\n                                  FT_Int32       load_flags );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_AutoHinter_InterfaceRec                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The auto-hinter module's interface.                                */\n  /*                                                                       */\n  typedef struct  FT_AutoHinter_InterfaceRec_\n  {\n    FT_AutoHinter_GlobalResetFunc  reset_face;\n    FT_AutoHinter_GlobalGetFunc    get_global_hints;\n    FT_AutoHinter_GlobalDoneFunc   done_global_hints;\n    FT_AutoHinter_GlyphLoadFunc    load_glyph;\n\n  } FT_AutoHinter_InterfaceRec, *FT_AutoHinter_Interface;\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_AUTOHINTER_INTERFACE(       \\\n          class_,                             \\\n          reset_face_,                        \\\n          get_global_hints_,                  \\\n          done_global_hints_,                 \\\n          load_glyph_ )                       \\\n  FT_CALLBACK_TABLE_DEF                       \\\n  const FT_AutoHinter_InterfaceRec  class_ =  \\\n  {                                           \\\n    reset_face_,                              \\\n    get_global_hints_,                        \\\n    done_global_hints_,                       \\\n    load_glyph_                               \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_AUTOHINTER_INTERFACE(                            \\\n          class_,                                                  \\\n          reset_face_,                                             \\\n          get_global_hints_,                                       \\\n          done_global_hints_,                                      \\\n          load_glyph_ )                                            \\\n  void                                                             \\\n  FT_Init_Class_ ## class_( FT_Library                   library,  \\\n                            FT_AutoHinter_InterfaceRec*  clazz )   \\\n  {                                                                \\\n    FT_UNUSED( library );                                          \\\n                                                                   \\\n    clazz->reset_face        = reset_face_;                        \\\n    clazz->get_global_hints  = get_global_hints_;                  \\\n    clazz->done_global_hints = done_global_hints_;                 \\\n    clazz->load_glyph        = load_glyph_;                        \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\nFT_END_HEADER\n\n#endif /* __AUTOHINT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/ftcalc.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcalc.h                                                               */\n/*                                                                         */\n/*    Arithmetic computations (specification).                             */\n/*                                                                         */\n/*  Copyright 1996-2006, 2008, 2009, 2012-2014 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCALC_H__\n#define __FTCALC_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* FT_MulDiv() and FT_MulFix() are declared in freetype.h.               */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef  FT_CONFIG_OPTION_NO_ASSEMBLER\n  /* Provide assembler fragments for performance-critical functions. */\n  /* These must be defined `static __inline__' with GCC.             */\n\n#if defined( __CC_ARM ) || defined( __ARMCC__ )  /* RVCT */\n\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_arm\n\n  /* documentation is in freetype.h */\n\n  static __inline FT_Int32\n  FT_MulFix_arm( FT_Int32  a,\n                 FT_Int32  b )\n  {\n    register FT_Int32  t, t2;\n\n\n    __asm\n    {\n      smull t2, t,  b,  a           /* (lo=t2,hi=t) = a*b */\n      mov   a,  t,  asr #31         /* a   = (hi >> 31) */\n      add   a,  a,  #0x8000         /* a  += 0x8000 */\n      adds  t2, t2, a               /* t2 += a */\n      adc   t,  t,  #0              /* t  += carry */\n      mov   a,  t2, lsr #16         /* a   = t2 >> 16 */\n      orr   a,  a,  t,  lsl #16     /* a  |= t << 16 */\n    }\n    return a;\n  }\n\n#endif /* __CC_ARM || __ARMCC__ */\n\n\n#ifdef __GNUC__\n\n#if defined( __arm__ )                                 && \\\n    ( !defined( __thumb__ ) || defined( __thumb2__ ) ) && \\\n    !( defined( __CC_ARM ) || defined( __ARMCC__ ) )\n\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_arm\n\n  /* documentation is in freetype.h */\n\n  static __inline__ FT_Int32\n  FT_MulFix_arm( FT_Int32  a,\n                 FT_Int32  b )\n  {\n    register FT_Int32  t, t2;\n\n\n    __asm__ __volatile__ (\n      \"smull  %1, %2, %4, %3\\n\\t\"       /* (lo=%1,hi=%2) = a*b */\n      \"mov    %0, %2, asr #31\\n\\t\"      /* %0  = (hi >> 31) */\n#if defined( __clang__ ) && defined( __thumb2__ )\n      \"add.w  %0, %0, #0x8000\\n\\t\"      /* %0 += 0x8000 */\n#else\n      \"add    %0, %0, #0x8000\\n\\t\"      /* %0 += 0x8000 */\n#endif\n      \"adds   %1, %1, %0\\n\\t\"           /* %1 += %0 */\n      \"adc    %2, %2, #0\\n\\t\"           /* %2 += carry */\n      \"mov    %0, %1, lsr #16\\n\\t\"      /* %0  = %1 >> 16 */\n      \"orr    %0, %0, %2, lsl #16\\n\\t\"  /* %0 |= %2 << 16 */\n      : \"=r\"(a), \"=&r\"(t2), \"=&r\"(t)\n      : \"r\"(a), \"r\"(b)\n      : \"cc\" );\n    return a;\n  }\n\n#endif /* __arm__                      && */\n       /* ( __thumb2__ || !__thumb__ ) && */\n       /* !( __CC_ARM || __ARMCC__ )      */\n\n\n#if defined( __i386__ )\n\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_i386\n\n  /* documentation is in freetype.h */\n\n  static __inline__ FT_Int32\n  FT_MulFix_i386( FT_Int32  a,\n                  FT_Int32  b )\n  {\n    register FT_Int32  result;\n\n\n    __asm__ __volatile__ (\n      \"imul  %%edx\\n\"\n      \"movl  %%edx, %%ecx\\n\"\n      \"sarl  $31, %%ecx\\n\"\n      \"addl  $0x8000, %%ecx\\n\"\n      \"addl  %%ecx, %%eax\\n\"\n      \"adcl  $0, %%edx\\n\"\n      \"shrl  $16, %%eax\\n\"\n      \"shll  $16, %%edx\\n\"\n      \"addl  %%edx, %%eax\\n\"\n      : \"=a\"(result), \"=d\"(b)\n      : \"a\"(a), \"d\"(b)\n      : \"%ecx\", \"cc\" );\n    return result;\n  }\n\n#endif /* i386 */\n\n#endif /* __GNUC__ */\n\n\n#ifdef _MSC_VER /* Visual C++ */\n\n#ifdef _M_IX86\n\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_i386\n\n  /* documentation is in freetype.h */\n\n  static __inline FT_Int32\n  FT_MulFix_i386( FT_Int32  a,\n                  FT_Int32  b )\n  {\n    register FT_Int32  result;\n\n    __asm\n    {\n      mov eax, a\n      mov edx, b\n      imul edx\n      mov ecx, edx\n      sar ecx, 31\n      add ecx, 8000h\n      add eax, ecx\n      adc edx, 0\n      shr eax, 16\n      shl edx, 16\n      add eax, edx\n      mov result, eax\n    }\n    return result;\n  }\n\n#endif /* _M_IX86 */\n\n#endif /* _MSC_VER */\n\n\n#if defined( __GNUC__ ) && defined( __x86_64__ )\n\n#define FT_MULFIX_ASSEMBLER  FT_MulFix_x86_64\n\n  static __inline__ FT_Int32\n  FT_MulFix_x86_64( FT_Int32  a,\n                    FT_Int32  b )\n  {\n    /* Temporarily disable the warning that C90 doesn't support */\n    /* `long long'.                                             */\n#if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 6 )\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wlong-long\"\n#endif\n\n#if 1\n    /* Technically not an assembly fragment, but GCC does a really good */\n    /* job at inlining it and generating good machine code for it.      */\n    long long  ret, tmp;\n\n\n    ret  = (long long)a * b;\n    tmp  = ret >> 63;\n    ret += 0x8000 + tmp;\n\n    return (FT_Int32)( ret >> 16 );\n#else\n\n    /* For some reason, GCC 4.6 on Ubuntu 12.04 generates invalid machine  */\n    /* code from the lines below.  The main issue is that `wide_a' is not  */\n    /* properly initialized by sign-extending `a'.  Instead, the generated */\n    /* machine code assumes that the register that contains `a' on input   */\n    /* can be used directly as a 64-bit value, which is wrong most of the  */\n    /* time.                                                               */\n    long long  wide_a = (long long)a;\n    long long  wide_b = (long long)b;\n    long long  result;\n\n\n    __asm__ __volatile__ (\n      \"imul %2, %1\\n\"\n      \"mov %1, %0\\n\"\n      \"sar $63, %0\\n\"\n      \"lea 0x8000(%1, %0), %0\\n\"\n      \"sar $16, %0\\n\"\n      : \"=&r\"(result), \"=&r\"(wide_a)\n      : \"r\"(wide_b)\n      : \"cc\" );\n\n    return (FT_Int32)result;\n#endif\n\n#if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 6 )\n#pragma GCC diagnostic pop\n#endif\n  }\n\n#endif /* __GNUC__ && __x86_64__ */\n\n#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */\n\n\n#ifdef FT_CONFIG_OPTION_INLINE_MULFIX\n#ifdef FT_MULFIX_ASSEMBLER\n#define FT_MulFix( a, b )  FT_MULFIX_ASSEMBLER( (FT_Int32)(a), (FT_Int32)(b) )\n#endif\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_MulDiv_No_Round                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation `(a*b)/c'   */\n  /*    (without rounding) with maximum accuracy (it uses a 64-bit         */\n  /*    intermediate integer whenever necessary).                          */\n  /*                                                                       */\n  /*    This function isn't necessarily as fast as some processor specific */\n  /*    operations, but is at least completely portable.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.                                        */\n  /*    c :: The divisor.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*b)/c'.  This function never traps when trying to */\n  /*    divide by zero; it simply returns `MaxInt' or `MinInt' depending   */\n  /*    on the signs of `a' and `b'.                                       */\n  /*                                                                       */\n  FT_BASE( FT_Long )\n  FT_MulDiv_No_Round( FT_Long  a,\n                      FT_Long  b,\n                      FT_Long  c );\n\n\n  /*\n   *  A variant of FT_Matrix_Multiply which scales its result afterwards.\n   *  The idea is that both `a' and `b' are scaled by factors of 10 so that\n   *  the values are as precise as possible to get a correct result during\n   *  the 64bit multiplication.  Let `sa' and `sb' be the scaling factors of\n   *  `a' and `b', respectively, then the scaling factor of the result is\n   *  `sa*sb'.\n   */\n  FT_BASE( void )\n  FT_Matrix_Multiply_Scaled( const FT_Matrix*  a,\n                             FT_Matrix        *b,\n                             FT_Long           scaling );\n\n\n  /*\n   *  A variant of FT_Vector_Transform.  See comments for\n   *  FT_Matrix_Multiply_Scaled.\n   */\n  FT_BASE( void )\n  FT_Vector_Transform_Scaled( FT_Vector*        vector,\n                              const FT_Matrix*  matrix,\n                              FT_Long           scaling );\n\n\n  /*\n   *  Return -1, 0, or +1, depending on the orientation of a given corner.\n   *  We use the Cartesian coordinate system, with positive vertical values\n   *  going upwards.  The function returns +1 if the corner turns to the\n   *  left, -1 to the right, and 0 for undecidable cases.\n   */\n  FT_BASE( FT_Int )\n  ft_corner_orientation( FT_Pos  in_x,\n                         FT_Pos  in_y,\n                         FT_Pos  out_x,\n                         FT_Pos  out_y );\n\n\n  /*\n   *  Return TRUE if a corner is flat or nearly flat.  This is equivalent to\n   *  saying that the corner point is close to its neighbors, or inside an\n   *  ellipse defined by the neighbor focal points to be more precise.\n   */\n  FT_BASE( FT_Int )\n  ft_corner_is_flat( FT_Pos  in_x,\n                     FT_Pos  in_y,\n                     FT_Pos  out_x,\n                     FT_Pos  out_y );\n\n\n  /*\n   *  Return the most significant bit index.\n   */\n\n#ifndef  FT_CONFIG_OPTION_NO_ASSEMBLER\n#if defined( __GNUC__ )                                          && \\\n    ( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4 ) )\n\n#if FT_SIZEOF_INT == 4\n\n#define FT_MSB( x )  ( 31 - __builtin_clz( x ) )\n\n#elif FT_SIZEOF_LONG == 4\n\n#define FT_MSB( x )  ( 31 - __builtin_clzl( x ) )\n\n#endif\n\n#endif /* __GNUC__ */\n#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */\n\n#ifndef FT_MSB\n\n  FT_BASE( FT_Int )\n  FT_MSB( FT_UInt32  z );\n\n#endif\n\n\n  /*\n   *  Return sqrt(x*x+y*y), which is the same as `FT_Vector_Length' but uses\n   *  two fixed-point arguments instead.\n   */\n  FT_BASE( FT_Fixed )\n  FT_Hypot( FT_Fixed  x,\n            FT_Fixed  y );\n\n\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_SqrtFixed                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Computes the square root of a 16.16 fixed-point value.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    x :: The value to compute the root for.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `sqrt(x)'.                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is not very fast.                                    */\n  /*                                                                       */\n  FT_BASE( FT_Int32 )\n  FT_SqrtFixed( FT_Int32  x );\n\n#endif /* 0 */\n\n\n#define INT_TO_F26DOT6( x )    ( (FT_Long)(x) << 6  )\n#define INT_TO_F2DOT14( x )    ( (FT_Long)(x) << 14 )\n#define INT_TO_FIXED( x )      ( (FT_Long)(x) << 16 )\n#define F2DOT14_TO_FIXED( x )  ( (FT_Long)(x) << 2  )\n#define FLOAT_TO_FIXED( x )    ( (FT_Long)( x * 65536.0 ) )\n#define FIXED_TO_INT( x )      ( FT_RoundFix( x ) >> 16 )\n\n#define ROUND_F26DOT6( x )     ( x >= 0 ? (    ( (x) + 32 ) & -64 )     \\\n                                        : ( -( ( 32 - (x) ) & -64 ) ) )\n\n\nFT_END_HEADER\n\n#endif /* __FTCALC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/ftdebug.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftdebug.h                                                              */\n/*                                                                         */\n/*    Debugging and logging component (specification).                     */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004, 2006-2009, 2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/*                                                                         */\n/*  IMPORTANT: A description of FreeType's debugging support can be        */\n/*             found in `docs/DEBUG.TXT'.  Read it if you need to use or   */\n/*             understand this code.                                       */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTDEBUG_H__\n#define __FTDEBUG_H__\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_FREETYPE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /* force the definition of FT_DEBUG_LEVEL_ERROR if FT_DEBUG_LEVEL_TRACE */\n  /* is already defined; this simplifies the following #ifdefs            */\n  /*                                                                      */\n#ifdef FT_DEBUG_LEVEL_TRACE\n#undef  FT_DEBUG_LEVEL_ERROR\n#define FT_DEBUG_LEVEL_ERROR\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define the trace enums as well as the trace levels array when they    */\n  /* are needed.                                                           */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n#define FT_TRACE_DEF( x )  trace_ ## x ,\n\n  /* defining the enumeration */\n  typedef enum  FT_Trace_\n  {\n#include FT_INTERNAL_TRACE_H\n    trace_count\n\n  } FT_Trace;\n\n\n  /* defining the array of trace levels, provided by `src/base/ftdebug.c' */\n  extern int  ft_trace_levels[trace_count];\n\n#undef FT_TRACE_DEF\n\n#endif /* FT_DEBUG_LEVEL_TRACE */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define the FT_TRACE macro                                             */\n  /*                                                                       */\n  /* IMPORTANT!                                                            */\n  /*                                                                       */\n  /* Each component must define the macro FT_COMPONENT to a valid FT_Trace */\n  /* value before using any TRACE macro.                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n#define FT_TRACE( level, varformat )                      \\\n          do                                              \\\n          {                                               \\\n            if ( ft_trace_levels[FT_COMPONENT] >= level ) \\\n              FT_Message varformat;                       \\\n          } while ( 0 )\n\n#else /* !FT_DEBUG_LEVEL_TRACE */\n\n#define FT_TRACE( level, varformat )  do { } while ( 0 )      /* nothing */\n\n#endif /* !FT_DEBUG_LEVEL_TRACE */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Trace_Get_Count                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the number of available trace components.                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The number of trace components.  0 if FreeType 2 is not built with */\n  /*    FT_DEBUG_LEVEL_TRACE definition.                                   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function may be useful if you want to access elements of      */\n  /*    the internal `ft_trace_levels' array by an index.                  */\n  /*                                                                       */\n  FT_BASE( FT_Int )\n  FT_Trace_Get_Count( void );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Trace_Get_Name                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the name of a trace component.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    The index of the trace component.                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The name of the trace component.  This is a statically allocated   */\n  /*    C string, so do not free it after use.  NULL if FreeType 2 is not  */\n  /*    built with FT_DEBUG_LEVEL_TRACE definition.                        */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Use @FT_Trace_Get_Count to get the number of available trace       */\n  /*    components.                                                        */\n  /*                                                                       */\n  /*    This function may be useful if you want to control FreeType 2's    */\n  /*    debug level in your application.                                   */\n  /*                                                                       */\n  FT_BASE( const char * )\n  FT_Trace_Get_Name( FT_Int  idx );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* You need two opening and closing parentheses!                         */\n  /*                                                                       */\n  /* Example: FT_TRACE0(( \"Value is %i\", foo ))                            */\n  /*                                                                       */\n  /* Output of the FT_TRACEX macros is sent to stderr.                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n#define FT_TRACE0( varformat )  FT_TRACE( 0, varformat )\n#define FT_TRACE1( varformat )  FT_TRACE( 1, varformat )\n#define FT_TRACE2( varformat )  FT_TRACE( 2, varformat )\n#define FT_TRACE3( varformat )  FT_TRACE( 3, varformat )\n#define FT_TRACE4( varformat )  FT_TRACE( 4, varformat )\n#define FT_TRACE5( varformat )  FT_TRACE( 5, varformat )\n#define FT_TRACE6( varformat )  FT_TRACE( 6, varformat )\n#define FT_TRACE7( varformat )  FT_TRACE( 7, varformat )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define the FT_ERROR macro.                                            */\n  /*                                                                       */\n  /* Output of this macro is sent to stderr.                               */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_ERROR\n\n#define FT_ERROR( varformat )  FT_Message  varformat\n\n#else  /* !FT_DEBUG_LEVEL_ERROR */\n\n#define FT_ERROR( varformat )  do { } while ( 0 )      /* nothing */\n\n#endif /* !FT_DEBUG_LEVEL_ERROR */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define the FT_ASSERT and FT_THROW macros.  The call to `FT_Throw'     */\n  /* makes it possible to easily set a breakpoint at this function.        */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_ERROR\n\n#define FT_ASSERT( condition )                                      \\\n          do                                                        \\\n          {                                                         \\\n            if ( !( condition ) )                                   \\\n              FT_Panic( \"assertion failed on line %d of file %s\\n\", \\\n                        __LINE__, __FILE__ );                       \\\n          } while ( 0 )\n\n#define FT_THROW( e )                                   \\\n          ( FT_Throw( FT_ERR_CAT( FT_ERR_PREFIX, e ),   \\\n                      __LINE__,                         \\\n                      __FILE__ )                      | \\\n            FT_ERR_CAT( FT_ERR_PREFIX, e )            )\n\n#else /* !FT_DEBUG_LEVEL_ERROR */\n\n#define FT_ASSERT( condition )  do { } while ( 0 )\n\n#define FT_THROW( e )  FT_ERR_CAT( FT_ERR_PREFIX, e )\n\n#endif /* !FT_DEBUG_LEVEL_ERROR */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define `FT_Message' and `FT_Panic' when needed.                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_LEVEL_ERROR\n\n#include \"stdio.h\"  /* for vfprintf() */\n\n  /* print a message */\n  FT_BASE( void )\n  FT_Message( const char*  fmt,\n              ... );\n\n  /* print a message and exit */\n  FT_BASE( void )\n  FT_Panic( const char*  fmt,\n            ... );\n\n  /* report file name and line number of an error */\n  FT_BASE( int )\n  FT_Throw( FT_Error     error,\n            int          line,\n            const char*  file );\n\n#endif /* FT_DEBUG_LEVEL_ERROR */\n\n\n  FT_BASE( void )\n  ft_debug_init( void );\n\nFT_END_HEADER\n\n#endif /* __FTDEBUG_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/ftdriver.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftdriver.h                                                             */\n/*                                                                         */\n/*    FreeType font driver interface (specification).                      */\n/*                                                                         */\n/*  Copyright 1996-2003, 2006, 2008, 2011-2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTDRIVER_H__\n#define __FTDRIVER_H__\n\n\n#include <ft2build.h>\n#include FT_MODULE_H\n\n\nFT_BEGIN_HEADER\n\n\n  typedef FT_Error\n  (*FT_Face_InitFunc)( FT_Stream      stream,\n                       FT_Face        face,\n                       FT_Int         typeface_index,\n                       FT_Int         num_params,\n                       FT_Parameter*  parameters );\n\n  typedef void\n  (*FT_Face_DoneFunc)( FT_Face  face );\n\n\n  typedef FT_Error\n  (*FT_Size_InitFunc)( FT_Size  size );\n\n  typedef void\n  (*FT_Size_DoneFunc)( FT_Size  size );\n\n\n  typedef FT_Error\n  (*FT_Slot_InitFunc)( FT_GlyphSlot  slot );\n\n  typedef void\n  (*FT_Slot_DoneFunc)( FT_GlyphSlot  slot );\n\n\n  typedef FT_Error\n  (*FT_Size_RequestFunc)( FT_Size          size,\n                          FT_Size_Request  req );\n\n  typedef FT_Error\n  (*FT_Size_SelectFunc)( FT_Size   size,\n                         FT_ULong  size_index );\n\n  typedef FT_Error\n  (*FT_Slot_LoadFunc)( FT_GlyphSlot  slot,\n                       FT_Size       size,\n                       FT_UInt       glyph_index,\n                       FT_Int32      load_flags );\n\n\n  typedef FT_UInt\n  (*FT_CharMap_CharIndexFunc)( FT_CharMap  charmap,\n                               FT_Long     charcode );\n\n  typedef FT_Long\n  (*FT_CharMap_CharNextFunc)( FT_CharMap  charmap,\n                              FT_Long     charcode );\n\n\n  typedef FT_Error\n  (*FT_Face_GetKerningFunc)( FT_Face     face,\n                             FT_UInt     left_glyph,\n                             FT_UInt     right_glyph,\n                             FT_Vector*  kerning );\n\n\n  typedef FT_Error\n  (*FT_Face_AttachFunc)( FT_Face    face,\n                         FT_Stream  stream );\n\n\n  typedef FT_Error\n  (*FT_Face_GetAdvancesFunc)( FT_Face    face,\n                              FT_UInt    first,\n                              FT_UInt    count,\n                              FT_Int32   flags,\n                              FT_Fixed*  advances );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Driver_ClassRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The font driver class.  This structure mostly contains pointers to */\n  /*    driver methods.                                                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root             :: The parent module.                             */\n  /*                                                                       */\n  /*    face_object_size :: The size of a face object in bytes.            */\n  /*                                                                       */\n  /*    size_object_size :: The size of a size object in bytes.            */\n  /*                                                                       */\n  /*    slot_object_size :: The size of a glyph object in bytes.           */\n  /*                                                                       */\n  /*    init_face        :: The format-specific face constructor.          */\n  /*                                                                       */\n  /*    done_face        :: The format-specific face destructor.           */\n  /*                                                                       */\n  /*    init_size        :: The format-specific size constructor.          */\n  /*                                                                       */\n  /*    done_size        :: The format-specific size destructor.           */\n  /*                                                                       */\n  /*    init_slot        :: The format-specific slot constructor.          */\n  /*                                                                       */\n  /*    done_slot        :: The format-specific slot destructor.           */\n  /*                                                                       */\n  /*                                                                       */\n  /*    load_glyph       :: A function handle to load a glyph to a slot.   */\n  /*                        This field is mandatory!                       */\n  /*                                                                       */\n  /*    get_kerning      :: A function handle to return the unscaled       */\n  /*                        kerning for a given pair of glyphs.  Can be    */\n  /*                        set to 0 if the format doesn't support         */\n  /*                        kerning.                                       */\n  /*                                                                       */\n  /*    attach_file      :: This function handle is used to read           */\n  /*                        additional data for a face from another        */\n  /*                        file/stream.  For example, this can be used to */\n  /*                        add data from AFM or PFM files on a Type 1     */\n  /*                        face, or a CIDMap on a CID-keyed face.         */\n  /*                                                                       */\n  /*    get_advances     :: A function handle used to return advance       */\n  /*                        widths of `count' glyphs (in font units),      */\n  /*                        starting at `first'.  The `vertical' flag must */\n  /*                        be set to get vertical advance heights.  The   */\n  /*                        `advances' buffer is caller-allocated.         */\n  /*                        The idea of this function is to be able to     */\n  /*                        perform device-independent text layout without */\n  /*                        loading a single glyph image.                  */\n  /*                                                                       */\n  /*    request_size     :: A handle to a function used to request the new */\n  /*                        character size.  Can be set to 0 if the        */\n  /*                        scaling done in the base layer suffices.       */\n  /*                                                                       */\n  /*    select_size      :: A handle to a function used to select a new    */\n  /*                        fixed size.  It is used only if                */\n  /*                        @FT_FACE_FLAG_FIXED_SIZES is set.  Can be set  */\n  /*                        to 0 if the scaling done in the base layer     */\n  /*                        suffices.                                      */\n  /* <Note>                                                                */\n  /*    Most function pointers, with the exception of `load_glyph', can be */\n  /*    set to 0 to indicate a default behaviour.                          */\n  /*                                                                       */\n  typedef struct  FT_Driver_ClassRec_\n  {\n    FT_Module_Class          root;\n\n    FT_Long                  face_object_size;\n    FT_Long                  size_object_size;\n    FT_Long                  slot_object_size;\n\n    FT_Face_InitFunc         init_face;\n    FT_Face_DoneFunc         done_face;\n\n    FT_Size_InitFunc         init_size;\n    FT_Size_DoneFunc         done_size;\n\n    FT_Slot_InitFunc         init_slot;\n    FT_Slot_DoneFunc         done_slot;\n\n    FT_Slot_LoadFunc         load_glyph;\n\n    FT_Face_GetKerningFunc   get_kerning;\n    FT_Face_AttachFunc       attach_file;\n    FT_Face_GetAdvancesFunc  get_advances;\n\n    /* since version 2.2 */\n    FT_Size_RequestFunc      request_size;\n    FT_Size_SelectFunc       select_size;\n\n  } FT_Driver_ClassRec, *FT_Driver_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DECLARE_DRIVER                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to create a forward declaration of an FT_Driver_ClassRec      */\n  /*    struct instance.                                                   */\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_DRIVER                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Driver_ClassRec struct.       */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is defined a `create' function has to be */\n  /*    called with a pointer where the allocated structure is returned.   */\n  /*    And when it is no longer needed a `destroy' function needs to be   */\n  /*    called to release that allocation.                                 */\n  /*                                                                       */\n  /*    `fcinit.c' (ft_create_default_module_classes) already contains a   */\n  /*    mechanism to call these functions for the default modules          */\n  /*    described in `ftmodule.h'.                                         */\n  /*                                                                       */\n  /*    Notice that the created `create' and `destroy' functions call      */\n  /*    `pic_init' and `pic_free' to allow you to manually allocate and    */\n  /*    initialize any additional global data, like a module specific      */\n  /*    interface, and put them in the global pic container defined in     */\n  /*    `ftpic.h'.  If you don't need them just implement the functions as */\n  /*    empty to resolve the link error.  Also the `pic_init' and          */\n  /*    `pic_free' functions should be declared in `pic.h', to be referred */\n  /*    by driver definition calling `FT_DEFINE_DRIVER' in following.      */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro is     */\n  /*    used).                                                             */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DECLARE_DRIVER( class_ )  \\\n  FT_CALLBACK_TABLE                  \\\n  const FT_Driver_ClassRec  class_;\n\n#define FT_DEFINE_DRIVER(                    \\\n          class_,                            \\\n          flags_,                            \\\n          size_,                             \\\n          name_,                             \\\n          version_,                          \\\n          requires_,                         \\\n          interface_,                        \\\n          init_,                             \\\n          done_,                             \\\n          get_interface_,                    \\\n          face_object_size_,                 \\\n          size_object_size_,                 \\\n          slot_object_size_,                 \\\n          init_face_,                        \\\n          done_face_,                        \\\n          init_size_,                        \\\n          done_size_,                        \\\n          init_slot_,                        \\\n          done_slot_,                        \\\n          load_glyph_,                       \\\n          get_kerning_,                      \\\n          attach_file_,                      \\\n          get_advances_,                     \\\n          request_size_,                     \\\n          select_size_ )                     \\\n  FT_CALLBACK_TABLE_DEF                      \\\n  const FT_Driver_ClassRec  class_ =         \\\n  {                                          \\\n    FT_DEFINE_ROOT_MODULE( flags_,           \\\n                           size_,            \\\n                           name_,            \\\n                           version_,         \\\n                           requires_,        \\\n                           interface_,       \\\n                           init_,            \\\n                           done_,            \\\n                           get_interface_ )  \\\n                                             \\\n    face_object_size_,                       \\\n    size_object_size_,                       \\\n    slot_object_size_,                       \\\n                                             \\\n    init_face_,                              \\\n    done_face_,                              \\\n                                             \\\n    init_size_,                              \\\n    done_size_,                              \\\n                                             \\\n    init_slot_,                              \\\n    done_slot_,                              \\\n                                             \\\n    load_glyph_,                             \\\n                                             \\\n    get_kerning_,                            \\\n    attach_file_,                            \\\n    get_advances_,                           \\\n                                             \\\n    request_size_,                           \\\n    select_size_                             \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DECLARE_DRIVER( class_ )  FT_DECLARE_MODULE( class_ )\n\n#define FT_DEFINE_DRIVER(                                        \\\n          class_,                                                \\\n          flags_,                                                \\\n          size_,                                                 \\\n          name_,                                                 \\\n          version_,                                              \\\n          requires_,                                             \\\n          interface_,                                            \\\n          init_,                                                 \\\n          done_,                                                 \\\n          get_interface_,                                        \\\n          face_object_size_,                                     \\\n          size_object_size_,                                     \\\n          slot_object_size_,                                     \\\n          init_face_,                                            \\\n          done_face_,                                            \\\n          init_size_,                                            \\\n          done_size_,                                            \\\n          init_slot_,                                            \\\n          done_slot_,                                            \\\n          load_glyph_,                                           \\\n          get_kerning_,                                          \\\n          attach_file_,                                          \\\n          get_advances_,                                         \\\n          request_size_,                                         \\\n          select_size_ )                                         \\\n  void                                                           \\\n  FT_Destroy_Class_ ## class_( FT_Library        library,        \\\n                               FT_Module_Class*  clazz )         \\\n  {                                                              \\\n    FT_Memory        memory = library->memory;                   \\\n    FT_Driver_Class  dclazz = (FT_Driver_Class)clazz;            \\\n                                                                 \\\n                                                                 \\\n    class_ ## _pic_free( library );                              \\\n    if ( dclazz )                                                \\\n      FT_FREE( dclazz );                                         \\\n  }                                                              \\\n                                                                 \\\n                                                                 \\\n  FT_Error                                                       \\\n  FT_Create_Class_ ## class_( FT_Library         library,        \\\n                              FT_Module_Class**  output_class )  \\\n  {                                                              \\\n    FT_Driver_Class  clazz  = NULL;                              \\\n    FT_Error         error;                                      \\\n    FT_Memory        memory = library->memory;                   \\\n                                                                 \\\n                                                                 \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) )                  \\\n      return error;                                              \\\n                                                                 \\\n    error = class_ ## _pic_init( library );                      \\\n    if ( error )                                                 \\\n    {                                                            \\\n      FT_FREE( clazz );                                          \\\n      return error;                                              \\\n    }                                                            \\\n                                                                 \\\n    FT_DEFINE_ROOT_MODULE( flags_,                               \\\n                           size_,                                \\\n                           name_,                                \\\n                           version_,                             \\\n                           requires_,                            \\\n                           interface_,                           \\\n                           init_,                                \\\n                           done_,                                \\\n                           get_interface_ )                      \\\n                                                                 \\\n    clazz->face_object_size = face_object_size_;                 \\\n    clazz->size_object_size = size_object_size_;                 \\\n    clazz->slot_object_size = slot_object_size_;                 \\\n                                                                 \\\n    clazz->init_face        = init_face_;                        \\\n    clazz->done_face        = done_face_;                        \\\n                                                                 \\\n    clazz->init_size        = init_size_;                        \\\n    clazz->done_size        = done_size_;                        \\\n                                                                 \\\n    clazz->init_slot        = init_slot_;                        \\\n    clazz->done_slot        = done_slot_;                        \\\n                                                                 \\\n    clazz->load_glyph       = load_glyph_;                       \\\n                                                                 \\\n    clazz->get_kerning      = get_kerning_;                      \\\n    clazz->attach_file      = attach_file_;                      \\\n    clazz->get_advances     = get_advances_;                     \\\n                                                                 \\\n    clazz->request_size     = request_size_;                     \\\n    clazz->select_size      = select_size_;                      \\\n                                                                 \\\n    *output_class = (FT_Module_Class*)clazz;                     \\\n                                                                 \\\n    return FT_Err_Ok;                                            \\\n  }\n\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\nFT_END_HEADER\n\n#endif /* __FTDRIVER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/ftgloadr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgloadr.h                                                             */\n/*                                                                         */\n/*    The FreeType glyph loader (specification).                           */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2005, 2006 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg                       */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTGLOADR_H__\n#define __FTGLOADR_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_GlyphLoader                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The glyph loader is an internal object used to load several glyphs */\n  /*    together (for example, in the case of composites).                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The glyph loader implementation is not part of the high-level API, */\n  /*    hence the forward structure declaration.                           */\n  /*                                                                       */\n  typedef struct FT_GlyphLoaderRec_*  FT_GlyphLoader ;\n\n\n#if 0  /* moved to freetype.h in version 2.2 */\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS          1\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES      2\n#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID        4\n#define FT_SUBGLYPH_FLAG_SCALE                   8\n#define FT_SUBGLYPH_FLAG_XY_SCALE             0x40\n#define FT_SUBGLYPH_FLAG_2X2                  0x80\n#define FT_SUBGLYPH_FLAG_USE_MY_METRICS      0x200\n#endif\n\n\n  typedef struct  FT_SubGlyphRec_\n  {\n    FT_Int     index;\n    FT_UShort  flags;\n    FT_Int     arg1;\n    FT_Int     arg2;\n    FT_Matrix  transform;\n\n  } FT_SubGlyphRec;\n\n\n  typedef struct  FT_GlyphLoadRec_\n  {\n    FT_Outline   outline;       /* outline                   */\n    FT_Vector*   extra_points;  /* extra points table        */\n    FT_Vector*   extra_points2; /* second extra points table */\n    FT_UInt      num_subglyphs; /* number of subglyphs       */\n    FT_SubGlyph  subglyphs;     /* subglyphs                 */\n\n  } FT_GlyphLoadRec, *FT_GlyphLoad;\n\n\n  typedef struct  FT_GlyphLoaderRec_\n  {\n    FT_Memory        memory;\n    FT_UInt          max_points;\n    FT_UInt          max_contours;\n    FT_UInt          max_subglyphs;\n    FT_Bool          use_extra;\n\n    FT_GlyphLoadRec  base;\n    FT_GlyphLoadRec  current;\n\n    void*            other;            /* for possible future extension? */\n\n  } FT_GlyphLoaderRec;\n\n\n  /* create new empty glyph loader */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_New( FT_Memory        memory,\n                      FT_GlyphLoader  *aloader );\n\n  /* add an extra points table to a glyph loader */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_CreateExtra( FT_GlyphLoader  loader );\n\n  /* destroy a glyph loader */\n  FT_BASE( void )\n  FT_GlyphLoader_Done( FT_GlyphLoader  loader );\n\n  /* reset a glyph loader (frees everything int it) */\n  FT_BASE( void )\n  FT_GlyphLoader_Reset( FT_GlyphLoader  loader );\n\n  /* rewind a glyph loader */\n  FT_BASE( void )\n  FT_GlyphLoader_Rewind( FT_GlyphLoader  loader );\n\n  /* check that there is enough space to add `n_points' and `n_contours' */\n  /* to the glyph loader                                                 */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_CheckPoints( FT_GlyphLoader  loader,\n                              FT_UInt         n_points,\n                              FT_UInt         n_contours );\n\n\n#define FT_GLYPHLOADER_CHECK_P( _loader, _count )           \\\n  ( (_count) == 0                                        || \\\n    ( (_loader)->base.outline.n_points    +                 \\\n      (_loader)->current.outline.n_points +                 \\\n      (unsigned long)(_count) ) <= (_loader)->max_points )\n\n#define FT_GLYPHLOADER_CHECK_C( _loader, _count )            \\\n  ( (_count) == 0                                         || \\\n    ( (_loader)->base.outline.n_contours    +                \\\n      (_loader)->current.outline.n_contours +                \\\n      (unsigned long)(_count)) <= (_loader)->max_contours )\n\n#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points, _contours )      \\\n  ( ( FT_GLYPHLOADER_CHECK_P( _loader, _points )   &&                   \\\n      FT_GLYPHLOADER_CHECK_C( _loader, _contours ) )                    \\\n    ? 0                                                                 \\\n    : FT_GlyphLoader_CheckPoints( (_loader), (_points), (_contours) ) )\n\n\n  /* check that there is enough space to add `n_subs' sub-glyphs to */\n  /* a glyph loader                                                 */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader  loader,\n                                 FT_UInt         n_subs );\n\n  /* prepare a glyph loader, i.e. empty the current glyph */\n  FT_BASE( void )\n  FT_GlyphLoader_Prepare( FT_GlyphLoader  loader );\n\n  /* add the current glyph to the base glyph */\n  FT_BASE( void )\n  FT_GlyphLoader_Add( FT_GlyphLoader  loader );\n\n  /* copy points from one glyph loader to another */\n  FT_BASE( FT_Error )\n  FT_GlyphLoader_CopyPoints( FT_GlyphLoader  target,\n                             FT_GlyphLoader  source );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGLOADR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/ftmemory.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmemory.h                                                             */\n/*                                                                         */\n/*    The FreeType memory management macros (specification).               */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004-2007, 2010, 2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg                       */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMEMORY_H__\n#define __FTMEMORY_H__\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_SET_ERROR                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro is used to set an implicit `error' variable to a given  */\n  /*    expression's value (usually a function call), and convert it to a  */\n  /*    boolean which is set whenever the value is != 0.                   */\n  /*                                                                       */\n#undef  FT_SET_ERROR\n#define FT_SET_ERROR( expression ) \\\n          ( ( error = (expression) ) != 0 )\n\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                           M E M O R Y                           ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*\n   *  C++ refuses to handle statements like p = (void*)anything, with `p' a\n   *  typed pointer.  Since we don't have a `typeof' operator in standard\n   *  C++, we have to use a template to emulate it.\n   */\n\n#ifdef __cplusplus\n\n  extern \"C++\"\n  template <typename T> inline T*\n  cplusplus_typeof(        T*,\n                    void  *v )\n  {\n    return static_cast <T*> ( v );\n  }\n\n#define FT_ASSIGNP( p, val )  (p) = cplusplus_typeof( (p), (val) )\n\n#else\n\n#define FT_ASSIGNP( p, val )  (p) = (val)\n\n#endif\n\n\n\n#ifdef FT_DEBUG_MEMORY\n\n  FT_BASE( const char* )  _ft_debug_file;\n  FT_BASE( long )         _ft_debug_lineno;\n\n#define FT_DEBUG_INNER( exp )  ( _ft_debug_file   = __FILE__, \\\n                                 _ft_debug_lineno = __LINE__, \\\n                                 (exp) )\n\n#define FT_ASSIGNP_INNER( p, exp )  ( _ft_debug_file   = __FILE__, \\\n                                      _ft_debug_lineno = __LINE__, \\\n                                      FT_ASSIGNP( p, exp ) )\n\n#else /* !FT_DEBUG_MEMORY */\n\n#define FT_DEBUG_INNER( exp )       (exp)\n#define FT_ASSIGNP_INNER( p, exp )  FT_ASSIGNP( p, exp )\n\n#endif /* !FT_DEBUG_MEMORY */\n\n\n  /*\n   *  The allocation functions return a pointer, and the error code\n   *  is written to through the `p_error' parameter.  See below for\n   *  for documentation.\n   */\n\n  FT_BASE( FT_Pointer )\n  ft_mem_alloc( FT_Memory  memory,\n                FT_Long    size,\n                FT_Error  *p_error );\n\n  FT_BASE( FT_Pointer )\n  ft_mem_qalloc( FT_Memory  memory,\n                 FT_Long    size,\n                 FT_Error  *p_error );\n\n  FT_BASE( FT_Pointer )\n  ft_mem_realloc( FT_Memory  memory,\n                  FT_Long    item_size,\n                  FT_Long    cur_count,\n                  FT_Long    new_count,\n                  void*      block,\n                  FT_Error  *p_error );\n\n  FT_BASE( FT_Pointer )\n  ft_mem_qrealloc( FT_Memory  memory,\n                   FT_Long    item_size,\n                   FT_Long    cur_count,\n                   FT_Long    new_count,\n                   void*      block,\n                   FT_Error  *p_error );\n\n  FT_BASE( void )\n  ft_mem_free( FT_Memory    memory,\n               const void*  P );\n\n\n#define FT_MEM_ALLOC( ptr, size )                               \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory,          \\\n                                               (FT_Long)(size), \\\n                                               &error ) )\n\n#define FT_MEM_FREE( ptr )                \\\n          FT_BEGIN_STMNT                  \\\n            ft_mem_free( memory, (ptr) ); \\\n            (ptr) = NULL;                 \\\n          FT_END_STMNT\n\n#define FT_MEM_NEW( ptr )                        \\\n          FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) )\n\n#define FT_MEM_REALLOC( ptr, cursz, newsz )                        \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,           \\\n                                                 1,                \\\n                                                 (FT_Long)(cursz), \\\n                                                 (FT_Long)(newsz), \\\n                                                 (ptr),            \\\n                                                 &error ) )\n\n#define FT_MEM_QALLOC( ptr, size )                               \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qalloc( memory,          \\\n                                                (FT_Long)(size), \\\n                                                &error ) )\n\n#define FT_MEM_QNEW( ptr )                        \\\n          FT_MEM_QALLOC( ptr, sizeof ( *(ptr) ) )\n\n#define FT_MEM_QREALLOC( ptr, cursz, newsz )                        \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,           \\\n                                                  1,                \\\n                                                  (FT_Long)(cursz), \\\n                                                  (FT_Long)(newsz), \\\n                                                  (ptr),            \\\n                                                  &error ) )\n\n#define FT_MEM_ALLOC_MULT( ptr, count, item_size )                     \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,               \\\n                                                 (FT_Long)(item_size), \\\n                                                 0,                    \\\n                                                 (FT_Long)(count),     \\\n                                                 NULL,                 \\\n                                                 &error ) )\n\n#define FT_MEM_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz )           \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,            \\\n                                                 (FT_Long)(itmsz),  \\\n                                                 (FT_Long)(oldcnt), \\\n                                                 (FT_Long)(newcnt), \\\n                                                 (ptr),             \\\n                                                 &error ) )\n\n#define FT_MEM_QALLOC_MULT( ptr, count, item_size )                     \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,               \\\n                                                  (FT_Long)(item_size), \\\n                                                  0,                    \\\n                                                  (FT_Long)(count),     \\\n                                                  NULL,                 \\\n                                                  &error ) )\n\n#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz)            \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,            \\\n                                                  (FT_Long)(itmsz),  \\\n                                                  (FT_Long)(oldcnt), \\\n                                                  (FT_Long)(newcnt), \\\n                                                  (ptr),             \\\n                                                  &error ) )\n\n\n#define FT_MEM_SET_ERROR( cond )  ( (cond), error != 0 )\n\n\n#define FT_MEM_SET( dest, byte, count )     ft_memset( dest, byte, count )\n\n#define FT_MEM_COPY( dest, source, count )  ft_memcpy( dest, source, count )\n\n#define FT_MEM_MOVE( dest, source, count )  ft_memmove( dest, source, count )\n\n\n#define FT_MEM_ZERO( dest, count )  FT_MEM_SET( dest, 0, count )\n\n#define FT_ZERO( p )                FT_MEM_ZERO( p, sizeof ( *(p) ) )\n\n\n#define FT_ARRAY_ZERO( dest, count )                        \\\n          FT_MEM_ZERO( dest, (count) * sizeof ( *(dest) ) )\n\n#define FT_ARRAY_COPY( dest, source, count )                        \\\n          FT_MEM_COPY( dest, source, (count) * sizeof ( *(dest) ) )\n\n#define FT_ARRAY_MOVE( dest, source, count )                        \\\n          FT_MEM_MOVE( dest, source, (count) * sizeof ( *(dest) ) )\n\n\n  /*\n   *  Return the maximum number of addressable elements in an array.\n   *  We limit ourselves to INT_MAX, rather than UINT_MAX, to avoid\n   *  any problems.\n   */\n#define FT_ARRAY_MAX( ptr )           ( FT_INT_MAX / sizeof ( *(ptr) ) )\n\n#define FT_ARRAY_CHECK( ptr, count )  ( (count) <= FT_ARRAY_MAX( ptr ) )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The following functions macros expect that their pointer argument is  */\n  /* _typed_ in order to automatically compute array element sizes.        */\n  /*                                                                       */\n\n#define FT_MEM_NEW_ARRAY( ptr, count )                              \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,            \\\n                                                 sizeof ( *(ptr) ), \\\n                                                 0,                 \\\n                                                 (FT_Long)(count),  \\\n                                                 NULL,              \\\n                                                 &error ) )\n\n#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz )                     \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory,            \\\n                                                 sizeof ( *(ptr) ), \\\n                                                 (FT_Long)(cursz),  \\\n                                                 (FT_Long)(newsz),  \\\n                                                 (ptr),             \\\n                                                 &error ) )\n\n#define FT_MEM_QNEW_ARRAY( ptr, count )                              \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,            \\\n                                                  sizeof ( *(ptr) ), \\\n                                                  0,                 \\\n                                                  (FT_Long)(count),  \\\n                                                  NULL,              \\\n                                                  &error ) )\n\n#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz )                     \\\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory,            \\\n                                                  sizeof ( *(ptr) ), \\\n                                                  (FT_Long)(cursz),  \\\n                                                  (FT_Long)(newsz),  \\\n                                                  (ptr),             \\\n                                                  &error ) )\n\n#define FT_ALLOC( ptr, size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_ALLOC( ptr, size ) )\n\n#define FT_REALLOC( ptr, cursz, newsz )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_REALLOC( ptr, cursz, newsz ) )\n\n#define FT_ALLOC_MULT( ptr, count, item_size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_ALLOC_MULT( ptr, count, item_size ) )\n\n#define FT_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz )              \\\n          FT_MEM_SET_ERROR( FT_MEM_REALLOC_MULT( ptr, oldcnt,      \\\n                                                 newcnt, itmsz ) )\n\n#define FT_QALLOC( ptr, size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_QALLOC( ptr, size ) )\n\n#define FT_QREALLOC( ptr, cursz, newsz )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_QREALLOC( ptr, cursz, newsz ) )\n\n#define FT_QALLOC_MULT( ptr, count, item_size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_QALLOC_MULT( ptr, count, item_size ) )\n\n#define FT_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz )              \\\n          FT_MEM_SET_ERROR( FT_MEM_QREALLOC_MULT( ptr, oldcnt,      \\\n                                                  newcnt, itmsz ) )\n\n#define FT_FREE( ptr )  FT_MEM_FREE( ptr )\n\n#define FT_NEW( ptr )  FT_MEM_SET_ERROR( FT_MEM_NEW( ptr ) )\n\n#define FT_NEW_ARRAY( ptr, count )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )\n\n#define FT_RENEW_ARRAY( ptr, curcnt, newcnt )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )\n\n#define FT_QNEW( ptr )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) )\n\n#define FT_QNEW_ARRAY( ptr, count )                          \\\n          FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )\n\n#define FT_QRENEW_ARRAY( ptr, curcnt, newcnt )                          \\\n          FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )\n\n\n  FT_BASE( FT_Pointer )\n  ft_mem_strdup( FT_Memory    memory,\n                 const char*  str,\n                 FT_Error    *p_error );\n\n  FT_BASE( FT_Pointer )\n  ft_mem_dup( FT_Memory    memory,\n              const void*  address,\n              FT_ULong     size,\n              FT_Error    *p_error );\n\n\n#define FT_MEM_STRDUP( dst, str )                                            \\\n          (dst) = (char*)ft_mem_strdup( memory, (const char*)(str), &error )\n\n#define FT_STRDUP( dst, str )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_STRDUP( dst, str ) )\n\n#define FT_MEM_DUP( dst, address, size )                                    \\\n          (dst) = ft_mem_dup( memory, (address), (FT_ULong)(size), &error )\n\n#define FT_DUP( dst, address, size )                           \\\n          FT_MEM_SET_ERROR( FT_MEM_DUP( dst, address, size ) )\n\n\n  /* Return >= 1 if a truncation occurs.            */\n  /* Return 0 if the source string fits the buffer. */\n  /* This is *not* the same as strlcpy().           */\n  FT_BASE( FT_Int )\n  ft_mem_strcpyn( char*        dst,\n                  const char*  src,\n                  FT_ULong     size );\n\n#define FT_STRCPYN( dst, src, size )                                         \\\n          ft_mem_strcpyn( (char*)dst, (const char*)(src), (FT_ULong)(size) )\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTMEMORY_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/ftobjs.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftobjs.h                                                               */\n/*                                                                         */\n/*    The FreeType private base classes (specification).                   */\n/*                                                                         */\n/*  Copyright 1996-2006, 2008, 2010, 2012-2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  This file contains the definition of all internal FreeType classes.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTOBJS_H__\n#define __FTOBJS_H__\n\n#include <ft2build.h>\n#include FT_RENDER_H\n#include FT_SIZES_H\n#include FT_LCD_FILTER_H\n#include FT_INTERNAL_MEMORY_H\n#include FT_INTERNAL_GLYPH_LOADER_H\n#include FT_INTERNAL_DRIVER_H\n#include FT_INTERNAL_AUTOHINT_H\n#include FT_INTERNAL_SERVICE_H\n#include FT_INTERNAL_PIC_H\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n#include FT_INCREMENTAL_H\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Some generic definitions.                                             */\n  /*                                                                       */\n#ifndef TRUE\n#define TRUE  1\n#endif\n\n#ifndef FALSE\n#define FALSE  0\n#endif\n\n#ifndef NULL\n#define NULL  (void*)0\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The min and max functions missing in C.  As usual, be careful not to  */\n  /* write things like FT_MIN( a++, b++ ) to avoid side effects.           */\n  /*                                                                       */\n#define FT_MIN( a, b )  ( (a) < (b) ? (a) : (b) )\n#define FT_MAX( a, b )  ( (a) > (b) ? (a) : (b) )\n\n#define FT_ABS( a )     ( (a) < 0 ? -(a) : (a) )\n\n  /*\n   *  Approximate sqrt(x*x+y*y) using the `alpha max plus beta min'\n   *  algorithm.  We use alpha = 1, beta = 3/8, giving us results with a\n   *  largest error less than 7% compared to the exact value.\n   */\n#define FT_HYPOT( x, y )                 \\\n          ( x = FT_ABS( x ),             \\\n            y = FT_ABS( y ),             \\\n            x > y ? x + ( 3 * y >> 3 )   \\\n                  : y + ( 3 * x >> 3 ) )\n\n#define FT_PAD_FLOOR( x, n )  ( (x) & ~((n)-1) )\n#define FT_PAD_ROUND( x, n )  FT_PAD_FLOOR( (x) + ((n)/2), n )\n#define FT_PAD_CEIL( x, n )   FT_PAD_FLOOR( (x) + ((n)-1), n )\n\n#define FT_PIX_FLOOR( x )     ( (x) & ~63 )\n#define FT_PIX_ROUND( x )     FT_PIX_FLOOR( (x) + 32 )\n#define FT_PIX_CEIL( x )      FT_PIX_FLOOR( (x) + 63 )\n\n\n  /*\n   *  character classification functions -- since these are used to parse\n   *  font files, we must not use those in <ctypes.h> which are\n   *  locale-dependent\n   */\n#define  ft_isdigit( x )   ( ( (unsigned)(x) - '0' ) < 10U )\n\n#define  ft_isxdigit( x )  ( ( (unsigned)(x) - '0' ) < 10U || \\\n                             ( (unsigned)(x) - 'a' ) < 6U  || \\\n                             ( (unsigned)(x) - 'A' ) < 6U  )\n\n  /* the next two macros assume ASCII representation */\n#define  ft_isupper( x )  ( ( (unsigned)(x) - 'A' ) < 26U )\n#define  ft_islower( x )  ( ( (unsigned)(x) - 'a' ) < 26U )\n\n#define  ft_isalpha( x )  ( ft_isupper( x ) || ft_islower( x ) )\n#define  ft_isalnum( x )  ( ft_isdigit( x ) || ft_isalpha( x ) )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                       C H A R M A P S                           ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* handle to internal charmap object */\n  typedef struct FT_CMapRec_*              FT_CMap;\n\n  /* handle to charmap class structure */\n  typedef const struct FT_CMap_ClassRec_*  FT_CMap_Class;\n\n  /* internal charmap object structure */\n  typedef struct  FT_CMapRec_\n  {\n    FT_CharMapRec  charmap;\n    FT_CMap_Class  clazz;\n\n  } FT_CMapRec;\n\n  /* typecase any pointer to a charmap handle */\n#define FT_CMAP( x )              ((FT_CMap)( x ))\n\n  /* obvious macros */\n#define FT_CMAP_PLATFORM_ID( x )  FT_CMAP( x )->charmap.platform_id\n#define FT_CMAP_ENCODING_ID( x )  FT_CMAP( x )->charmap.encoding_id\n#define FT_CMAP_ENCODING( x )     FT_CMAP( x )->charmap.encoding\n#define FT_CMAP_FACE( x )         FT_CMAP( x )->charmap.face\n\n\n  /* class method definitions */\n  typedef FT_Error\n  (*FT_CMap_InitFunc)( FT_CMap     cmap,\n                       FT_Pointer  init_data );\n\n  typedef void\n  (*FT_CMap_DoneFunc)( FT_CMap  cmap );\n\n  typedef FT_UInt\n  (*FT_CMap_CharIndexFunc)( FT_CMap    cmap,\n                            FT_UInt32  char_code );\n\n  typedef FT_UInt\n  (*FT_CMap_CharNextFunc)( FT_CMap     cmap,\n                           FT_UInt32  *achar_code );\n\n  typedef FT_UInt\n  (*FT_CMap_CharVarIndexFunc)( FT_CMap    cmap,\n                               FT_CMap    unicode_cmap,\n                               FT_UInt32  char_code,\n                               FT_UInt32  variant_selector );\n\n  typedef FT_Bool\n  (*FT_CMap_CharVarIsDefaultFunc)( FT_CMap    cmap,\n                                   FT_UInt32  char_code,\n                                   FT_UInt32  variant_selector );\n\n  typedef FT_UInt32 *\n  (*FT_CMap_VariantListFunc)( FT_CMap    cmap,\n                              FT_Memory  mem );\n\n  typedef FT_UInt32 *\n  (*FT_CMap_CharVariantListFunc)( FT_CMap    cmap,\n                                  FT_Memory  mem,\n                                  FT_UInt32  char_code );\n\n  typedef FT_UInt32 *\n  (*FT_CMap_VariantCharListFunc)( FT_CMap    cmap,\n                                  FT_Memory  mem,\n                                  FT_UInt32  variant_selector );\n\n\n  typedef struct  FT_CMap_ClassRec_\n  {\n    FT_ULong               size;\n    FT_CMap_InitFunc       init;\n    FT_CMap_DoneFunc       done;\n    FT_CMap_CharIndexFunc  char_index;\n    FT_CMap_CharNextFunc   char_next;\n\n    /* Subsequent entries are special ones for format 14 -- the variant */\n    /* selector subtable which behaves like no other                    */\n\n    FT_CMap_CharVarIndexFunc      char_var_index;\n    FT_CMap_CharVarIsDefaultFunc  char_var_default;\n    FT_CMap_VariantListFunc       variant_list;\n    FT_CMap_CharVariantListFunc   charvariant_list;\n    FT_CMap_VariantCharListFunc   variantchar_list;\n\n  } FT_CMap_ClassRec;\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DECLARE_CMAP_CLASS( class_ )              \\\n  FT_CALLBACK_TABLE const  FT_CMap_ClassRec class_;\n\n#define FT_DEFINE_CMAP_CLASS(       \\\n          class_,                   \\\n          size_,                    \\\n          init_,                    \\\n          done_,                    \\\n          char_index_,              \\\n          char_next_,               \\\n          char_var_index_,          \\\n          char_var_default_,        \\\n          variant_list_,            \\\n          charvariant_list_,        \\\n          variantchar_list_ )       \\\n  FT_CALLBACK_TABLE_DEF             \\\n  const FT_CMap_ClassRec  class_ =  \\\n  {                                 \\\n    size_,                          \\\n    init_,                          \\\n    done_,                          \\\n    char_index_,                    \\\n    char_next_,                     \\\n    char_var_index_,                \\\n    char_var_default_,              \\\n    variant_list_,                  \\\n    charvariant_list_,              \\\n    variantchar_list_               \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DECLARE_CMAP_CLASS( class_ )                  \\\n  void                                                   \\\n  FT_Init_Class_ ## class_( FT_Library         library,  \\\n                            FT_CMap_ClassRec*  clazz );\n\n#define FT_DEFINE_CMAP_CLASS(                            \\\n          class_,                                        \\\n          size_,                                         \\\n          init_,                                         \\\n          done_,                                         \\\n          char_index_,                                   \\\n          char_next_,                                    \\\n          char_var_index_,                               \\\n          char_var_default_,                             \\\n          variant_list_,                                 \\\n          charvariant_list_,                             \\\n          variantchar_list_ )                            \\\n  void                                                   \\\n  FT_Init_Class_ ## class_( FT_Library         library,  \\\n                            FT_CMap_ClassRec*  clazz )   \\\n  {                                                      \\\n    FT_UNUSED( library );                                \\\n                                                         \\\n    clazz->size             = size_;                     \\\n    clazz->init             = init_;                     \\\n    clazz->done             = done_;                     \\\n    clazz->char_index       = char_index_;               \\\n    clazz->char_next        = char_next_;                \\\n    clazz->char_var_index   = char_var_index_;           \\\n    clazz->char_var_default = char_var_default_;         \\\n    clazz->variant_list     = variant_list_;             \\\n    clazz->charvariant_list = charvariant_list_;         \\\n    clazz->variantchar_list = variantchar_list_;         \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /* create a new charmap and add it to charmap->face */\n  FT_BASE( FT_Error )\n  FT_CMap_New( FT_CMap_Class  clazz,\n               FT_Pointer     init_data,\n               FT_CharMap     charmap,\n               FT_CMap       *acmap );\n\n  /* destroy a charmap and remove it from face's list */\n  FT_BASE( void )\n  FT_CMap_Done( FT_CMap  cmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Face_InternalRec                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure contains the internal fields of each FT_Face        */\n  /*    object.  These fields may change between different releases of     */\n  /*    FreeType.                                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    max_points ::                                                      */\n  /*      The maximum number of points used to store the vectorial outline */\n  /*      of any glyph in this face.  If this value cannot be known in     */\n  /*      advance, or if the face isn't scalable, this should be set to 0. */\n  /*      Only relevant for scalable formats.                              */\n  /*                                                                       */\n  /*    max_contours ::                                                    */\n  /*      The maximum number of contours used to store the vectorial       */\n  /*      outline of any glyph in this face.  If this value cannot be      */\n  /*      known in advance, or if the face isn't scalable, this should be  */\n  /*      set to 0.  Only relevant for scalable formats.                   */\n  /*                                                                       */\n  /*    transform_matrix ::                                                */\n  /*      A 2x2 matrix of 16.16 coefficients used to transform glyph       */\n  /*      outlines after they are loaded from the font.  Only used by the  */\n  /*      convenience functions.                                           */\n  /*                                                                       */\n  /*    transform_delta ::                                                 */\n  /*      A translation vector used to transform glyph outlines after they */\n  /*      are loaded from the font.  Only used by the convenience          */\n  /*      functions.                                                       */\n  /*                                                                       */\n  /*    transform_flags ::                                                 */\n  /*      Some flags used to classify the transform.  Only used by the     */\n  /*      convenience functions.                                           */\n  /*                                                                       */\n  /*    services ::                                                        */\n  /*      A cache for frequently used services.  It should be only         */\n  /*      accessed with the macro `FT_FACE_LOOKUP_SERVICE'.                */\n  /*                                                                       */\n  /*    incremental_interface ::                                           */\n  /*      If non-null, the interface through which glyph data and metrics  */\n  /*      are loaded incrementally for faces that do not provide all of    */\n  /*      this data when first opened.  This field exists only if          */\n  /*      @FT_CONFIG_OPTION_INCREMENTAL is defined.                        */\n  /*                                                                       */\n  /*    ignore_unpatented_hinter ::                                        */\n  /*      This boolean flag instructs the glyph loader to ignore the       */\n  /*      native font hinter, if one is found.  This is exclusively used   */\n  /*      in the case when the unpatented hinter is compiled within the    */\n  /*      library.                                                         */\n  /*                                                                       */\n  /*    refcount ::                                                        */\n  /*      A counter initialized to~1 at the time an @FT_Face structure is  */\n  /*      created.  @FT_Reference_Face increments this counter, and        */\n  /*      @FT_Done_Face only destroys a face if the counter is~1,          */\n  /*      otherwise it simply decrements it.                               */\n  /*                                                                       */\n  typedef struct  FT_Face_InternalRec_\n  {\n    FT_Matrix           transform_matrix;\n    FT_Vector           transform_delta;\n    FT_Int              transform_flags;\n\n    FT_ServiceCacheRec  services;\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n    FT_Incremental_InterfaceRec*  incremental_interface;\n#endif\n\n    FT_Bool             ignore_unpatented_hinter;\n    FT_Int              refcount;\n\n  } FT_Face_InternalRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Slot_InternalRec                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure contains the internal fields of each FT_GlyphSlot   */\n  /*    object.  These fields may change between different releases of     */\n  /*    FreeType.                                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    loader            :: The glyph loader object used to load outlines */\n  /*                         into the glyph slot.                          */\n  /*                                                                       */\n  /*    flags             :: Possible values are zero or                   */\n  /*                         FT_GLYPH_OWN_BITMAP.  The latter indicates    */\n  /*                         that the FT_GlyphSlot structure owns the      */\n  /*                         bitmap buffer.                                */\n  /*                                                                       */\n  /*    glyph_transformed :: Boolean.  Set to TRUE when the loaded glyph   */\n  /*                         must be transformed through a specific        */\n  /*                         font transformation.  This is _not_ the same  */\n  /*                         as the face transform set through             */\n  /*                         FT_Set_Transform().                           */\n  /*                                                                       */\n  /*    glyph_matrix      :: The 2x2 matrix corresponding to the glyph     */\n  /*                         transformation, if necessary.                 */\n  /*                                                                       */\n  /*    glyph_delta       :: The 2d translation vector corresponding to    */\n  /*                         the glyph transformation, if necessary.       */\n  /*                                                                       */\n  /*    glyph_hints       :: Format-specific glyph hints management.       */\n  /*                                                                       */\n\n#define FT_GLYPH_OWN_BITMAP  0x1\n\n  typedef struct  FT_Slot_InternalRec_\n  {\n    FT_GlyphLoader  loader;\n    FT_UInt         flags;\n    FT_Bool         glyph_transformed;\n    FT_Matrix       glyph_matrix;\n    FT_Vector       glyph_delta;\n    void*           glyph_hints;\n\n  } FT_GlyphSlot_InternalRec;\n\n\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_InternalRec                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure contains the internal fields of each FT_Size        */\n  /*    object.  Currently, it's empty.                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n  typedef struct  FT_Size_InternalRec_\n  {\n    /* empty */\n\n  } FT_Size_InternalRec;\n\n#endif\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                         M O D U L E S                           ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_ModuleRec                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A module object instance.                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    clazz   :: A pointer to the module's class.                        */\n  /*                                                                       */\n  /*    library :: A handle to the parent library object.                  */\n  /*                                                                       */\n  /*    memory  :: A handle to the memory manager.                         */\n  /*                                                                       */\n  typedef struct  FT_ModuleRec_\n  {\n    FT_Module_Class*  clazz;\n    FT_Library        library;\n    FT_Memory         memory;\n\n  } FT_ModuleRec;\n\n\n  /* typecast an object to an FT_Module */\n#define FT_MODULE( x )          ((FT_Module)( x ))\n#define FT_MODULE_CLASS( x )    FT_MODULE( x )->clazz\n#define FT_MODULE_LIBRARY( x )  FT_MODULE( x )->library\n#define FT_MODULE_MEMORY( x )   FT_MODULE( x )->memory\n\n\n#define FT_MODULE_IS_DRIVER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                    FT_MODULE_FONT_DRIVER )\n\n#define FT_MODULE_IS_RENDERER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                      FT_MODULE_RENDERER )\n\n#define FT_MODULE_IS_HINTER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                    FT_MODULE_HINTER )\n\n#define FT_MODULE_IS_STYLER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                    FT_MODULE_STYLER )\n\n#define FT_DRIVER_IS_SCALABLE( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                      FT_MODULE_DRIVER_SCALABLE )\n\n#define FT_DRIVER_USES_OUTLINES( x )  !( FT_MODULE_CLASS( x )->module_flags & \\\n                                         FT_MODULE_DRIVER_NO_OUTLINES )\n\n#define FT_DRIVER_HAS_HINTER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\n                                     FT_MODULE_DRIVER_HAS_HINTER )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Module_Interface                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Finds a module and returns its specific interface as a typeless    */\n  /*    pointer.                                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library     :: A handle to the library object.                     */\n  /*                                                                       */\n  /*    module_name :: The module's name (as an ASCII string).             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A module-specific interface if available, 0 otherwise.             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should better be familiar with FreeType internals to know      */\n  /*    which module to look for, and what its interface is :-)            */\n  /*                                                                       */\n  FT_BASE( const void* )\n  FT_Get_Module_Interface( FT_Library   library,\n                           const char*  mod_name );\n\n  FT_BASE( FT_Pointer )\n  ft_module_get_service( FT_Module    module,\n                         const char*  service_id );\n\n  /* */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****   F A C E,   S I Z E   &   G L Y P H   S L O T   O B J E C T S  ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* a few macros used to perform easy typecasts with minimal brain damage */\n\n#define FT_FACE( x )          ((FT_Face)(x))\n#define FT_SIZE( x )          ((FT_Size)(x))\n#define FT_SLOT( x )          ((FT_GlyphSlot)(x))\n\n#define FT_FACE_DRIVER( x )   FT_FACE( x )->driver\n#define FT_FACE_LIBRARY( x )  FT_FACE_DRIVER( x )->root.library\n#define FT_FACE_MEMORY( x )   FT_FACE( x )->memory\n#define FT_FACE_STREAM( x )   FT_FACE( x )->stream\n\n#define FT_SIZE_FACE( x )     FT_SIZE( x )->face\n#define FT_SLOT_FACE( x )     FT_SLOT( x )->face\n\n#define FT_FACE_SLOT( x )     FT_FACE( x )->glyph\n#define FT_FACE_SIZE( x )     FT_FACE( x )->size\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_GlyphSlot                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    It is sometimes useful to have more than one glyph slot for a      */\n  /*    given face object.  This function is used to create additional     */\n  /*    slots.  All of them are automatically discarded when the face is   */\n  /*    destroyed.                                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face  :: A handle to a parent face object.                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aslot :: A handle to a new glyph slot object.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_BASE( FT_Error )\n  FT_New_GlyphSlot( FT_Face        face,\n                    FT_GlyphSlot  *aslot );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_GlyphSlot                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroys a given glyph slot.  Remember however that all slots are  */\n  /*    automatically destroyed with its parent.  Using this function is   */\n  /*    not always mandatory.                                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    slot :: A handle to a target glyph slot.                           */\n  /*                                                                       */\n  FT_BASE( void )\n  FT_Done_GlyphSlot( FT_GlyphSlot  slot );\n\n /* */\n\n#define FT_REQUEST_WIDTH( req )                                            \\\n          ( (req)->horiResolution                                          \\\n              ? (FT_Pos)( (req)->width * (req)->horiResolution + 36 ) / 72 \\\n              : (req)->width )\n\n#define FT_REQUEST_HEIGHT( req )                                            \\\n          ( (req)->vertResolution                                           \\\n              ? (FT_Pos)( (req)->height * (req)->vertResolution + 36 ) / 72 \\\n              : (req)->height )\n\n\n  /* Set the metrics according to a bitmap strike. */\n  FT_BASE( void )\n  FT_Select_Metrics( FT_Face   face,\n                     FT_ULong  strike_index );\n\n\n  /* Set the metrics according to a size request. */\n  FT_BASE( void )\n  FT_Request_Metrics( FT_Face          face,\n                      FT_Size_Request  req );\n\n\n  /* Match a size request against `available_sizes'. */\n  FT_BASE( FT_Error )\n  FT_Match_Size( FT_Face          face,\n                 FT_Size_Request  req,\n                 FT_Bool          ignore_width,\n                 FT_ULong*        size_index );\n\n\n  /* Use the horizontal metrics to synthesize the vertical metrics. */\n  /* If `advance' is zero, it is also synthesized.                  */\n  FT_BASE( void )\n  ft_synthesize_vertical_metrics( FT_Glyph_Metrics*  metrics,\n                                  FT_Pos             advance );\n\n\n  /* Free the bitmap of a given glyphslot when needed (i.e., only when it */\n  /* was allocated with ft_glyphslot_alloc_bitmap).                       */\n  FT_BASE( void )\n  ft_glyphslot_free_bitmap( FT_GlyphSlot  slot );\n\n\n  /* Allocate a new bitmap buffer in a glyph slot. */\n  FT_BASE( FT_Error )\n  ft_glyphslot_alloc_bitmap( FT_GlyphSlot  slot,\n                             FT_ULong      size );\n\n\n  /* Set the bitmap buffer in a glyph slot to a given pointer.  The buffer */\n  /* will not be freed by a later call to ft_glyphslot_free_bitmap.        */\n  FT_BASE( void )\n  ft_glyphslot_set_bitmap( FT_GlyphSlot  slot,\n                           FT_Byte*      buffer );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                        R E N D E R E R S                        ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n#define FT_RENDERER( x )      ((FT_Renderer)( x ))\n#define FT_GLYPH( x )         ((FT_Glyph)( x ))\n#define FT_BITMAP_GLYPH( x )  ((FT_BitmapGlyph)( x ))\n#define FT_OUTLINE_GLYPH( x ) ((FT_OutlineGlyph)( x ))\n\n\n  typedef struct  FT_RendererRec_\n  {\n    FT_ModuleRec            root;\n    FT_Renderer_Class*      clazz;\n    FT_Glyph_Format         glyph_format;\n    FT_Glyph_Class          glyph_class;\n\n    FT_Raster               raster;\n    FT_Raster_Render_Func   raster_render;\n    FT_Renderer_RenderFunc  render;\n\n  } FT_RendererRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                    F O N T   D R I V E R S                      ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* typecast a module into a driver easily */\n#define FT_DRIVER( x )        ((FT_Driver)(x))\n\n  /* typecast a module as a driver, and get its driver class */\n#define FT_DRIVER_CLASS( x )  FT_DRIVER( x )->clazz\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_DriverRec                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The root font driver class.  A font driver is responsible for      */\n  /*    managing and loading font files of a given format.                 */\n  /*                                                                       */\n  /*  <Fields>                                                             */\n  /*     root         :: Contains the fields of the root module class.     */\n  /*                                                                       */\n  /*     clazz        :: A pointer to the font driver's class.  Note that  */\n  /*                     this is NOT root.clazz.  `class' wasn't used      */\n  /*                     as it is a reserved word in C++.                  */\n  /*                                                                       */\n  /*     faces_list   :: The list of faces currently opened by this        */\n  /*                     driver.                                           */\n  /*                                                                       */\n  /*     glyph_loader :: The glyph loader for all faces managed by this    */\n  /*                     driver.  This object isn't defined for unscalable */\n  /*                     formats.                                          */\n  /*                                                                       */\n  typedef struct  FT_DriverRec_\n  {\n    FT_ModuleRec     root;\n    FT_Driver_Class  clazz;\n    FT_ListRec       faces_list;\n    FT_GlyphLoader   glyph_loader;\n\n  } FT_DriverRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                       L I B R A R I E S                         ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* This hook is used by the TrueType debugger.  It must be set to an */\n  /* alternate truetype bytecode interpreter function.                 */\n#define FT_DEBUG_HOOK_TRUETYPE            0\n\n\n  /* Set this debug hook to a non-null pointer to force unpatented hinting */\n  /* for all faces when both TT_USE_BYTECODE_INTERPRETER and               */\n  /* TT_CONFIG_OPTION_UNPATENTED_HINTING are defined.  This is only used   */\n  /* during debugging.                                                     */\n#define FT_DEBUG_HOOK_UNPATENTED_HINTING  1\n\n\n  typedef void  (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap*      bitmap,\n                                            FT_Render_Mode  render_mode,\n                                            FT_Library      library );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_LibraryRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The FreeType library class.  This is the root of all FreeType      */\n  /*    data.  Use FT_New_Library() to create a library object, and        */\n  /*    FT_Done_Library() to discard it and all child objects.             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    memory           :: The library's memory object.  Manages memory   */\n  /*                        allocation.                                    */\n  /*                                                                       */\n  /*    version_major    :: The major version number of the library.       */\n  /*                                                                       */\n  /*    version_minor    :: The minor version number of the library.       */\n  /*                                                                       */\n  /*    version_patch    :: The current patch level of the library.        */\n  /*                                                                       */\n  /*    num_modules      :: The number of modules currently registered     */\n  /*                        within this library.  This is set to 0 for new */\n  /*                        libraries.  New modules are added through the  */\n  /*                        FT_Add_Module() API function.                  */\n  /*                                                                       */\n  /*    modules          :: A table used to store handles to the currently */\n  /*                        registered modules. Note that each font driver */\n  /*                        contains a list of its opened faces.           */\n  /*                                                                       */\n  /*    renderers        :: The list of renderers currently registered     */\n  /*                        within the library.                            */\n  /*                                                                       */\n  /*    cur_renderer     :: The current outline renderer.  This is a       */\n  /*                        shortcut used to avoid parsing the list on     */\n  /*                        each call to FT_Outline_Render().  It is a     */\n  /*                        handle to the current renderer for the         */\n  /*                        FT_GLYPH_FORMAT_OUTLINE format.                */\n  /*                                                                       */\n  /*    auto_hinter      :: XXX                                            */\n  /*                                                                       */\n  /*    raster_pool      :: The raster object's render pool.  This can     */\n  /*                        ideally be changed dynamically at run-time.    */\n  /*                                                                       */\n  /*    raster_pool_size :: The size of the render pool in bytes.          */\n  /*                                                                       */\n  /*    debug_hooks      :: XXX                                            */\n  /*                                                                       */\n  /*    lcd_filter       :: If subpixel rendering is activated, the        */\n  /*                        selected LCD filter mode.                      */\n  /*                                                                       */\n  /*    lcd_extra        :: If subpixel rendering is activated, the number */\n  /*                        of extra pixels needed for the LCD filter.     */\n  /*                                                                       */\n  /*    lcd_weights      :: If subpixel rendering is activated, the LCD    */\n  /*                        filter weights, if any.                        */\n  /*                                                                       */\n  /*    lcd_filter_func  :: If subpixel rendering is activated, the LCD    */\n  /*                        filtering callback function.                   */\n  /*                                                                       */\n  /*    pic_container    :: Contains global structs and tables, instead    */\n  /*                        of defining them globallly.                    */\n  /*                                                                       */\n  /*    refcount         :: A counter initialized to~1 at the time an      */\n  /*                        @FT_Library structure is created.              */\n  /*                        @FT_Reference_Library increments this counter, */\n  /*                        and @FT_Done_Library only destroys a library   */\n  /*                        if the counter is~1, otherwise it simply       */\n  /*                        decrements it.                                 */\n  /*                                                                       */\n  typedef struct  FT_LibraryRec_\n  {\n    FT_Memory          memory;           /* library's memory manager */\n\n    FT_Int             version_major;\n    FT_Int             version_minor;\n    FT_Int             version_patch;\n\n    FT_UInt            num_modules;\n    FT_Module          modules[FT_MAX_MODULES];  /* module objects  */\n\n    FT_ListRec         renderers;        /* list of renderers        */\n    FT_Renderer        cur_renderer;     /* current outline renderer */\n    FT_Module          auto_hinter;\n\n    FT_Byte*           raster_pool;      /* scan-line conversion */\n                                         /* render pool          */\n    FT_ULong           raster_pool_size; /* size of render pool in bytes */\n\n    FT_DebugHook_Func  debug_hooks[4];\n\n#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING\n    FT_LcdFilter             lcd_filter;\n    FT_Int                   lcd_extra;        /* number of extra pixels */\n    FT_Byte                  lcd_weights[7];   /* filter weights, if any */\n    FT_Bitmap_LcdFilterFunc  lcd_filter_func;  /* filtering callback     */\n#endif\n\n#ifdef FT_CONFIG_OPTION_PIC\n    FT_PIC_Container   pic_container;\n#endif\n\n    FT_Int             refcount;\n\n  } FT_LibraryRec;\n\n\n  FT_BASE( FT_Renderer )\n  FT_Lookup_Renderer( FT_Library       library,\n                      FT_Glyph_Format  format,\n                      FT_ListNode*     node );\n\n  FT_BASE( FT_Error )\n  FT_Render_Glyph_Internal( FT_Library      library,\n                            FT_GlyphSlot    slot,\n                            FT_Render_Mode  render_mode );\n\n  typedef const char*\n  (*FT_Face_GetPostscriptNameFunc)( FT_Face  face );\n\n  typedef FT_Error\n  (*FT_Face_GetGlyphNameFunc)( FT_Face     face,\n                               FT_UInt     glyph_index,\n                               FT_Pointer  buffer,\n                               FT_UInt     buffer_max );\n\n  typedef FT_UInt\n  (*FT_Face_GetGlyphNameIndexFunc)( FT_Face     face,\n                                    FT_String*  glyph_name );\n\n\n#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Memory                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Creates a new memory object.                                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to the new memory object.  0 in case of error.           */\n  /*                                                                       */\n  FT_BASE( FT_Memory )\n  FT_New_Memory( void );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Memory                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discards memory manager.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory :: A handle to the memory manager.                          */\n  /*                                                                       */\n  FT_BASE( void )\n  FT_Done_Memory( FT_Memory  memory );\n\n#endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */\n\n\n  /* Define default raster's interface.  The default raster is located in  */\n  /* `src/base/ftraster.c'.                                                */\n  /*                                                                       */\n  /* Client applications can register new rasters through the              */\n  /* FT_Set_Raster() API.                                                  */\n\n#ifndef FT_NO_DEFAULT_RASTER\n  FT_EXPORT_VAR( FT_Raster_Funcs )  ft_default_raster;\n#endif\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                      P I C   S U P P O R T                      ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* PIC support macros for ftimage.h */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_OUTLINE_FUNCS                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Outline_Funcs struct.         */\n  /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */\n  /*    be called with a pre-allocated structure to be filled.             */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_OUTLINE_FUNCS(           \\\n          class_,                          \\\n          move_to_,                        \\\n          line_to_,                        \\\n          conic_to_,                       \\\n          cubic_to_,                       \\\n          shift_,                          \\\n          delta_ )                         \\\n  static const  FT_Outline_Funcs class_ =  \\\n  {                                        \\\n    move_to_,                              \\\n    line_to_,                              \\\n    conic_to_,                             \\\n    cubic_to_,                             \\\n    shift_,                                \\\n    delta_                                 \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_OUTLINE_FUNCS(                     \\\n          class_,                                    \\\n          move_to_,                                  \\\n          line_to_,                                  \\\n          conic_to_,                                 \\\n          cubic_to_,                                 \\\n          shift_,                                    \\\n          delta_ )                                   \\\n  static FT_Error                                    \\\n  Init_Class_ ## class_( FT_Outline_Funcs*  clazz )  \\\n  {                                                  \\\n    clazz->move_to  = move_to_;                      \\\n    clazz->line_to  = line_to_;                      \\\n    clazz->conic_to = conic_to_;                     \\\n    clazz->cubic_to = cubic_to_;                     \\\n    clazz->shift    = shift_;                        \\\n    clazz->delta    = delta_;                        \\\n                                                     \\\n    return FT_Err_Ok;                                \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_RASTER_FUNCS                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Raster_Funcs struct.          */\n  /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */\n  /*    be called with a pre-allocated structure to be filled.             */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_RASTER_FUNCS(    \\\n          class_,                  \\\n          glyph_format_,           \\\n          raster_new_,             \\\n          raster_reset_,           \\\n          raster_set_mode_,        \\\n          raster_render_,          \\\n          raster_done_ )           \\\n  const FT_Raster_Funcs  class_ =  \\\n  {                                \\\n    glyph_format_,                 \\\n    raster_new_,                   \\\n    raster_reset_,                 \\\n    raster_set_mode_,              \\\n    raster_render_,                \\\n    raster_done_                   \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_RASTER_FUNCS(                        \\\n          class_,                                      \\\n          glyph_format_,                               \\\n          raster_new_,                                 \\\n          raster_reset_,                               \\\n          raster_set_mode_,                            \\\n          raster_render_,                              \\\n          raster_done_ )                               \\\n  void                                                 \\\n  FT_Init_Class_ ## class_( FT_Raster_Funcs*  clazz )  \\\n  {                                                    \\\n    clazz->glyph_format    = glyph_format_;            \\\n    clazz->raster_new      = raster_new_;              \\\n    clazz->raster_reset    = raster_reset_;            \\\n    clazz->raster_set_mode = raster_set_mode_;         \\\n    clazz->raster_render   = raster_render_;           \\\n    clazz->raster_done     = raster_done_;             \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /* PIC support macros for ftrender.h */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_GLYPH                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Glyph_Class struct.           */\n  /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */\n  /*    be called with a pre-allocated stcture to be filled.               */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_GLYPH(          \\\n          class_,                 \\\n          size_,                  \\\n          format_,                \\\n          init_,                  \\\n          done_,                  \\\n          copy_,                  \\\n          transform_,             \\\n          bbox_,                  \\\n          prepare_ )              \\\n  FT_CALLBACK_TABLE_DEF           \\\n  const FT_Glyph_Class  class_ =  \\\n  {                               \\\n    size_,                        \\\n    format_,                      \\\n    init_,                        \\\n    done_,                        \\\n    copy_,                        \\\n    transform_,                   \\\n    bbox_,                        \\\n    prepare_                      \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_GLYPH(                              \\\n          class_,                                     \\\n          size_,                                      \\\n          format_,                                    \\\n          init_,                                      \\\n          done_,                                      \\\n          copy_,                                      \\\n          transform_,                                 \\\n          bbox_,                                      \\\n          prepare_ )                                  \\\n  void                                                \\\n  FT_Init_Class_ ## class_( FT_Glyph_Class*  clazz )  \\\n  {                                                   \\\n    clazz->glyph_size      = size_;                   \\\n    clazz->glyph_format    = format_;                 \\\n    clazz->glyph_init      = init_;                   \\\n    clazz->glyph_done      = done_;                   \\\n    clazz->glyph_copy      = copy_;                   \\\n    clazz->glyph_transform = transform_;              \\\n    clazz->glyph_bbox      = bbox_;                   \\\n    clazz->glyph_prepare   = prepare_;                \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DECLARE_RENDERER                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to create a forward declaration of a                          */\n  /*    FT_Renderer_Class struct instance.                                 */\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_RENDERER                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of FT_Renderer_Class struct.        */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is defined a `create' funtion will need  */\n  /*    to be called with a pointer where the allocated structure is       */\n  /*    returned.  And when it is no longer needed a `destroy' function    */\n  /*    needs to be called to release that allocation.                     */\n  /*    `fcinit.c' (ft_create_default_module_classes) already contains     */\n  /*    a mechanism to call these functions for the default modules        */\n  /*    described in `ftmodule.h'.                                         */\n  /*                                                                       */\n  /*    Notice that the created `create' and `destroy' functions call      */\n  /*    `pic_init' and `pic_free' to allow you to manually allocate and    */\n  /*    initialize any additional global data, like a module specific      */\n  /*    interface, and put them in the global pic container defined in     */\n  /*    `ftpic.h'.  If you don't need them just implement the functions as */\n  /*    empty to resolve the link error.  Also the `pic_init' and          */\n  /*    `pic_free' functions should be declared in `pic.h', to be referred */\n  /*    by the renderer definition calling `FT_DEFINE_RENDERER' in the     */\n  /*    following.                                                         */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DECLARE_RENDERER( class_ )               \\\n  FT_EXPORT_VAR( const FT_Renderer_Class ) class_;\n\n#define FT_DEFINE_RENDERER(                  \\\n          class_,                            \\\n          flags_,                            \\\n          size_,                             \\\n          name_,                             \\\n          version_,                          \\\n          requires_,                         \\\n          interface_,                        \\\n          init_,                             \\\n          done_,                             \\\n          get_interface_,                    \\\n          glyph_format_,                     \\\n          render_glyph_,                     \\\n          transform_glyph_,                  \\\n          get_glyph_cbox_,                   \\\n          set_mode_,                         \\\n          raster_class_ )                    \\\n  FT_CALLBACK_TABLE_DEF                      \\\n  const FT_Renderer_Class  class_ =          \\\n  {                                          \\\n    FT_DEFINE_ROOT_MODULE( flags_,           \\\n                           size_,            \\\n                           name_,            \\\n                           version_,         \\\n                           requires_,        \\\n                           interface_,       \\\n                           init_,            \\\n                           done_,            \\\n                           get_interface_ )  \\\n    glyph_format_,                           \\\n                                             \\\n    render_glyph_,                           \\\n    transform_glyph_,                        \\\n    get_glyph_cbox_,                         \\\n    set_mode_,                               \\\n                                             \\\n    raster_class_                            \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DECLARE_RENDERER( class_ )  FT_DECLARE_MODULE( class_ )\n\n#define FT_DEFINE_RENDERER(                                      \\\n          class_,                                                \\\n          flags_,                                                \\\n          size_,                                                 \\\n          name_,                                                 \\\n          version_,                                              \\\n          requires_,                                             \\\n          interface_,                                            \\\n          init_,                                                 \\\n          done_,                                                 \\\n          get_interface_,                                        \\\n          glyph_format_,                                         \\\n          render_glyph_,                                         \\\n          transform_glyph_,                                      \\\n          get_glyph_cbox_,                                       \\\n          set_mode_,                                             \\\n          raster_class_ )                                        \\\n  void                                                           \\\n  FT_Destroy_Class_ ## class_( FT_Library        library,        \\\n                               FT_Module_Class*  clazz )         \\\n  {                                                              \\\n    FT_Renderer_Class*  rclazz = (FT_Renderer_Class*)clazz;      \\\n    FT_Memory           memory = library->memory;                \\\n                                                                 \\\n                                                                 \\\n    class_ ## _pic_free( library );                              \\\n    if ( rclazz )                                                \\\n      FT_FREE( rclazz );                                         \\\n  }                                                              \\\n                                                                 \\\n                                                                 \\\n  FT_Error                                                       \\\n  FT_Create_Class_ ## class_( FT_Library         library,        \\\n                              FT_Module_Class**  output_class )  \\\n  {                                                              \\\n    FT_Renderer_Class*  clazz = NULL;                            \\\n    FT_Error            error;                                   \\\n    FT_Memory           memory = library->memory;                \\\n                                                                 \\\n                                                                 \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) )                  \\\n      return error;                                              \\\n                                                                 \\\n    error = class_ ## _pic_init( library );                      \\\n    if ( error )                                                 \\\n    {                                                            \\\n      FT_FREE( clazz );                                          \\\n      return error;                                              \\\n    }                                                            \\\n                                                                 \\\n    FT_DEFINE_ROOT_MODULE( flags_,                               \\\n                           size_,                                \\\n                           name_,                                \\\n                           version_,                             \\\n                           requires_,                            \\\n                           interface_,                           \\\n                           init_,                                \\\n                           done_,                                \\\n                           get_interface_ )                      \\\n                                                                 \\\n    clazz->glyph_format    = glyph_format_;                      \\\n                                                                 \\\n    clazz->render_glyph    = render_glyph_;                      \\\n    clazz->transform_glyph = transform_glyph_;                   \\\n    clazz->get_glyph_cbox  = get_glyph_cbox_;                    \\\n    clazz->set_mode        = set_mode_;                          \\\n                                                                 \\\n    clazz->raster_class    = raster_class_;                      \\\n                                                                 \\\n    *output_class = (FT_Module_Class*)clazz;                     \\\n                                                                 \\\n    return FT_Err_Ok;                                            \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /* PIC support macros for ftmodapi.h **/\n\n\n#ifdef FT_CONFIG_OPTION_PIC\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Creator                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to create (allocate) a new module class object.    */\n  /*    The object's members are initialized, but the module itself is     */\n  /*    not.                                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory       :: A handle to the memory manager.                    */\n  /*    output_class :: Initialized with the newly allocated class.        */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_Module_Creator)( FT_Memory          memory,\n                        FT_Module_Class**  output_class );\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Module_Destroyer                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to destroy (deallocate) a module class object.     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory :: A handle to the memory manager.                          */\n  /*    clazz  :: Module class to destroy.                                 */\n  /*                                                                       */\n  typedef void\n  (*FT_Module_Destroyer)( FT_Memory         memory,\n                          FT_Module_Class*  clazz );\n\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DECLARE_MODULE                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to create a forward declaration of a                          */\n  /*    FT_Module_Class struct instance.                                   */\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_MODULE                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of an FT_Module_Class struct.       */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is defined a `create' funtion needs to   */\n  /*    be called with a pointer where the allocated structure is          */\n  /*    returned.  And when it is no longer needed a `destroy' function    */\n  /*    needs to be called to release that allocation.                     */\n  /*    `fcinit.c' (ft_create_default_module_classes) already contains     */\n  /*    a mechanism to call these functions for the default modules        */\n  /*    described in `ftmodule.h'.                                         */\n  /*                                                                       */\n  /*    Notice that the created `create' and `destroy' functions call      */\n  /*    `pic_init' and `pic_free' to allow you to manually allocate and    */\n  /*    initialize any additional global data, like a module specific      */\n  /*    interface, and put them in the global pic container defined in     */\n  /*    `ftpic.h'.  If you don't need them just implement the functions as */\n  /*    empty to resolve the link error.  Also the `pic_init' and          */\n  /*    `pic_free' functions should be declared in `pic.h', to be referred */\n  /*    by the module definition calling `FT_DEFINE_MODULE' in the         */\n  /*    following.                                                         */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */\n  /*    allocated in the global scope (or the scope where the macro        */\n  /*    is used).                                                          */\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_ROOT_MODULE                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an instance of an FT_Module_Class struct inside */\n  /*    another struct that contains it or in a function that initializes  */\n  /*    that containing struct.                                            */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DECLARE_MODULE( class_ )  \\\n  FT_CALLBACK_TABLE                  \\\n  const FT_Module_Class  class_;\n\n#define FT_DEFINE_ROOT_MODULE(  \\\n          flags_,               \\\n          size_,                \\\n          name_,                \\\n          version_,             \\\n          requires_,            \\\n          interface_,           \\\n          init_,                \\\n          done_,                \\\n          get_interface_ )      \\\n  {                             \\\n    flags_,                     \\\n    size_,                      \\\n                                \\\n    name_,                      \\\n    version_,                   \\\n    requires_,                  \\\n                                \\\n    interface_,                 \\\n                                \\\n    init_,                      \\\n    done_,                      \\\n    get_interface_,             \\\n  },\n\n#define FT_DEFINE_MODULE(         \\\n          class_,                 \\\n          flags_,                 \\\n          size_,                  \\\n          name_,                  \\\n          version_,               \\\n          requires_,              \\\n          interface_,             \\\n          init_,                  \\\n          done_,                  \\\n          get_interface_ )        \\\n  FT_CALLBACK_TABLE_DEF           \\\n  const FT_Module_Class class_ =  \\\n  {                               \\\n    flags_,                       \\\n    size_,                        \\\n                                  \\\n    name_,                        \\\n    version_,                     \\\n    requires_,                    \\\n                                  \\\n    interface_,                   \\\n                                  \\\n    init_,                        \\\n    done_,                        \\\n    get_interface_,               \\\n  };\n\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DECLARE_MODULE( class_ )                               \\\n  FT_Error                                                        \\\n  FT_Create_Class_ ## class_( FT_Library         library,         \\\n                              FT_Module_Class**  output_class );  \\\n  void                                                            \\\n  FT_Destroy_Class_ ## class_( FT_Library        library,         \\\n                               FT_Module_Class*  clazz );\n\n#define FT_DEFINE_ROOT_MODULE(                      \\\n          flags_,                                   \\\n          size_,                                    \\\n          name_,                                    \\\n          version_,                                 \\\n          requires_,                                \\\n          interface_,                               \\\n          init_,                                    \\\n          done_,                                    \\\n          get_interface_ )                          \\\n    clazz->root.module_flags     = flags_;          \\\n    clazz->root.module_size      = size_;           \\\n    clazz->root.module_name      = name_;           \\\n    clazz->root.module_version   = version_;        \\\n    clazz->root.module_requires  = requires_;       \\\n                                                    \\\n    clazz->root.module_interface = interface_;      \\\n                                                    \\\n    clazz->root.module_init      = init_;           \\\n    clazz->root.module_done      = done_;           \\\n    clazz->root.get_interface    = get_interface_;\n\n#define FT_DEFINE_MODULE(                                        \\\n          class_,                                                \\\n          flags_,                                                \\\n          size_,                                                 \\\n          name_,                                                 \\\n          version_,                                              \\\n          requires_,                                             \\\n          interface_,                                            \\\n          init_,                                                 \\\n          done_,                                                 \\\n          get_interface_ )                                       \\\n  void                                                           \\\n  FT_Destroy_Class_ ## class_( FT_Library        library,        \\\n                               FT_Module_Class*  clazz )         \\\n  {                                                              \\\n    FT_Memory memory = library->memory;                          \\\n                                                                 \\\n                                                                 \\\n    class_ ## _pic_free( library );                              \\\n    if ( clazz )                                                 \\\n      FT_FREE( clazz );                                          \\\n  }                                                              \\\n                                                                 \\\n                                                                 \\\n  FT_Error                                                       \\\n  FT_Create_Class_ ## class_( FT_Library         library,        \\\n                              FT_Module_Class**  output_class )  \\\n  {                                                              \\\n    FT_Memory         memory = library->memory;                  \\\n    FT_Module_Class*  clazz  = NULL;                             \\\n    FT_Error          error;                                     \\\n                                                                 \\\n                                                                 \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) )                  \\\n      return error;                                              \\\n    error = class_ ## _pic_init( library );                      \\\n    if ( error )                                                 \\\n    {                                                            \\\n      FT_FREE( clazz );                                          \\\n      return error;                                              \\\n    }                                                            \\\n                                                                 \\\n    clazz->module_flags     = flags_;                            \\\n    clazz->module_size      = size_;                             \\\n    clazz->module_name      = name_;                             \\\n    clazz->module_version   = version_;                          \\\n    clazz->module_requires  = requires_;                         \\\n                                                                 \\\n    clazz->module_interface = interface_;                        \\\n                                                                 \\\n    clazz->module_init      = init_;                             \\\n    clazz->module_done      = done_;                             \\\n    clazz->get_interface    = get_interface_;                    \\\n                                                                 \\\n    *output_class = clazz;                                       \\\n                                                                 \\\n    return FT_Err_Ok;                                            \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\nFT_END_HEADER\n\n#endif /* __FTOBJS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/ftpic.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftpic.h                                                                */\n/*                                                                         */\n/*    The FreeType position independent code services (declaration).       */\n/*                                                                         */\n/*  Copyright 2009, 2012 by                                                */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  Modules that ordinarily have const global data that need address     */\n  /*  can instead define pointers here.                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTPIC_H__\n#define __FTPIC_H__\n\n\nFT_BEGIN_HEADER\n\n#ifdef FT_CONFIG_OPTION_PIC\n\n  typedef struct  FT_PIC_Container_\n  {\n    /* pic containers for base */\n    void*  base;\n\n    /* pic containers for modules */\n    void*  autofit;\n    void*  cff;\n    void*  pshinter;\n    void*  psnames;\n    void*  raster;\n    void*  sfnt;\n    void*  smooth;\n    void*  truetype;\n\n  } FT_PIC_Container;\n\n\n  /* Initialize the various function tables, structs, etc. */\n  /* stored in the container.                              */\n  FT_BASE( FT_Error )\n  ft_pic_container_init( FT_Library  library );\n\n\n  /* Destroy the contents of the container. */\n  FT_BASE( void )\n  ft_pic_container_destroy( FT_Library  library );\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTPIC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/ftrfork.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftrfork.h                                                              */\n/*                                                                         */\n/*    Embedded resource forks accessor (specification).                    */\n/*                                                                         */\n/*  Copyright 2004, 2006, 2007, 2012, 2013 by                              */\n/*  Masatake YAMATO and Redhat K.K.                                        */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/* Development of the code in this file is support of                      */\n/* Information-technology Promotion Agency, Japan.                         */\n/***************************************************************************/\n\n\n#ifndef __FTRFORK_H__\n#define __FTRFORK_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /* Number of guessing rules supported in `FT_Raccess_Guess'.            */\n  /* Don't forget to increment the number if you add a new guessing rule. */\n#define FT_RACCESS_N_RULES  9\n\n\n  /* A structure to describe a reference in a resource by its resource ID */\n  /* and internal offset.  The `POST' resource expects to be concatenated */\n  /* by the order of resource IDs instead of its appearance in the file.  */\n\n  typedef struct  FT_RFork_Ref_\n  {\n    FT_UShort  res_id;\n    FT_ULong   offset;\n\n  } FT_RFork_Ref;\n\n#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK\n  typedef FT_Error\n  (*ft_raccess_guess_func)( FT_Library  library,\n                            FT_Stream   stream,\n                            char       *base_file_name,\n                            char      **result_file_name,\n                            FT_Long    *result_offset );\n\n  typedef enum  FT_RFork_Rule_ {\n    FT_RFork_Rule_invalid = -2,\n    FT_RFork_Rule_uknown, /* -1 */\n    FT_RFork_Rule_apple_double,\n    FT_RFork_Rule_apple_single,\n    FT_RFork_Rule_darwin_ufs_export,\n    FT_RFork_Rule_darwin_newvfs,\n    FT_RFork_Rule_darwin_hfsplus,\n    FT_RFork_Rule_vfat,\n    FT_RFork_Rule_linux_cap,\n    FT_RFork_Rule_linux_double,\n    FT_RFork_Rule_linux_netatalk\n  } FT_RFork_Rule;\n\n  /* For fast translation between rule index and rule type,\n   * the macros FT_RFORK_xxx should be kept consistent with\n   * the raccess_guess_funcs table\n   */\n  typedef struct ft_raccess_guess_rec_ {\n    ft_raccess_guess_func  func;\n    FT_RFork_Rule          type;\n  } ft_raccess_guess_rec;\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n  /* this array is a storage in non-PIC mode, so ; is needed in END */\n#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type )  \\\n          const type name[] = {\n#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix )  \\\n          { raccess_guess_ ## func_suffix,                           \\\n            FT_RFork_Rule_ ## type_suffix },\n#define CONST_FT_RFORK_RULE_ARRAY_END  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n  /* this array is a function in PIC mode, so no ; is needed in END */\n#define CONST_FT_RFORK_RULE_ARRAY_BEGIN( name, type )  \\\n          void                                         \\\n          FT_Init_Table_ ## name( type*  storage )     \\\n          {                                            \\\n            type*  local = storage;                    \\\n                                                       \\\n                                                       \\\n            int  i = 0;\n#define CONST_FT_RFORK_RULE_ARRAY_ENTRY( func_suffix, type_suffix )  \\\n          local[i].func = raccess_guess_ ## func_suffix;             \\\n          local[i].type = FT_RFork_Rule_ ## type_suffix;             \\\n          i++;\n#define CONST_FT_RFORK_RULE_ARRAY_END  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n#endif /* FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Raccess_Guess                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Guess a file name and offset where the actual resource fork is     */\n  /*    stored.  The macro FT_RACCESS_N_RULES holds the number of          */\n  /*    guessing rules;  the guessed result for the Nth rule is            */\n  /*    represented as a triplet: a new file name (new_names[N]), a file   */\n  /*    offset (offsets[N]), and an error code (errors[N]).                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library ::                                                         */\n  /*      A FreeType library instance.                                     */\n  /*                                                                       */\n  /*    stream ::                                                          */\n  /*      A file stream containing the resource fork.                      */\n  /*                                                                       */\n  /*    base_name ::                                                       */\n  /*      The (base) file name of the resource fork used for some          */\n  /*      guessing rules.                                                  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    new_names ::                                                       */\n  /*      An array of guessed file names in which the resource forks may   */\n  /*      exist.  If `new_names[N]' is NULL, the guessed file name is      */\n  /*      equal to `base_name'.                                            */\n  /*                                                                       */\n  /*    offsets ::                                                         */\n  /*      An array of guessed file offsets.  `offsets[N]' holds the file   */\n  /*      offset of the possible start of the resource fork in file        */\n  /*      `new_names[N]'.                                                  */\n  /*                                                                       */\n  /*    errors ::                                                          */\n  /*      An array of FreeType error codes.  `errors[N]' is the error      */\n  /*      code of Nth guessing rule function.  If `errors[N]' is not       */\n  /*      FT_Err_Ok, `new_names[N]' and `offsets[N]' are meaningless.      */\n  /*                                                                       */\n  FT_BASE( void )\n  FT_Raccess_Guess( FT_Library  library,\n                    FT_Stream   stream,\n                    char*       base_name,\n                    char**      new_names,\n                    FT_Long*    offsets,\n                    FT_Error*   errors );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Raccess_Get_HeaderInfo                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Get the information from the header of resource fork.  The         */\n  /*    information includes the file offset where the resource map        */\n  /*    starts, and the file offset where the resource data starts.        */\n  /*    `FT_Raccess_Get_DataOffsets' requires these two data.              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library ::                                                         */\n  /*      A FreeType library instance.                                     */\n  /*                                                                       */\n  /*    stream ::                                                          */\n  /*      A file stream containing the resource fork.                      */\n  /*                                                                       */\n  /*    rfork_offset ::                                                    */\n  /*      The file offset where the resource fork starts.                  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    map_offset ::                                                      */\n  /*      The file offset where the resource map starts.                   */\n  /*                                                                       */\n  /*    rdata_pos ::                                                       */\n  /*      The file offset where the resource data starts.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  FT_Err_Ok means success.                     */\n  /*                                                                       */\n  FT_BASE( FT_Error )\n  FT_Raccess_Get_HeaderInfo( FT_Library  library,\n                             FT_Stream   stream,\n                             FT_Long     rfork_offset,\n                             FT_Long    *map_offset,\n                             FT_Long    *rdata_pos );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Raccess_Get_DataOffsets                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Get the data offsets for a tag in a resource fork.  Offsets are    */\n  /*    stored in an array because, in some cases, resources in a resource */\n  /*    fork have the same tag.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library ::                                                         */\n  /*      A FreeType library instance.                                     */\n  /*                                                                       */\n  /*    stream ::                                                          */\n  /*      A file stream containing the resource fork.                      */\n  /*                                                                       */\n  /*    map_offset ::                                                      */\n  /*      The file offset where the resource map starts.                   */\n  /*                                                                       */\n  /*    rdata_pos ::                                                       */\n  /*      The file offset where the resource data starts.                  */\n  /*                                                                       */\n  /*    tag ::                                                             */\n  /*      The resource tag.                                                */\n  /*                                                                       */\n  /*    sort_by_res_id ::                                                  */\n  /*      A Boolean to sort the fragmented resource by their ids.          */\n  /*      The fragmented resources for `POST' resource should be sorted    */\n  /*      to restore Type1 font properly.  For `snft' resources, sorting   */\n  /*      may induce a different order of the faces in comparison to that  */\n  /*      by QuickDraw API.                                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    offsets ::                                                         */\n  /*      The stream offsets for the resource data specified by `tag'.     */\n  /*      This array is allocated by the function, so you have to call     */\n  /*      @ft_mem_free after use.                                          */\n  /*                                                                       */\n  /*    count ::                                                           */\n  /*      The length of offsets array.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  FT_Err_Ok means success.                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Normally you should use `FT_Raccess_Get_HeaderInfo' to get the     */\n  /*    value for `map_offset' and `rdata_pos'.                            */\n  /*                                                                       */\n  FT_BASE( FT_Error )\n  FT_Raccess_Get_DataOffsets( FT_Library  library,\n                              FT_Stream   stream,\n                              FT_Long     map_offset,\n                              FT_Long     rdata_pos,\n                              FT_Long     tag,\n                              FT_Bool     sort_by_res_id,\n                              FT_Long   **offsets,\n                              FT_Long    *count );\n\n\nFT_END_HEADER\n\n#endif /* __FTRFORK_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/ftserv.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftserv.h                                                               */\n/*                                                                         */\n/*    The FreeType services (specification only).                          */\n/*                                                                         */\n/*  Copyright 2003-2007, 2009, 2012, 2013 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  Each module can export one or more `services'.  Each service is      */\n  /*  identified by a constant string and modeled by a pointer; the latter */\n  /*  generally corresponds to a structure containing function pointers.   */\n  /*                                                                       */\n  /*  Note that a service's data cannot be a mere function pointer because */\n  /*  in C it is possible that function pointers might be implemented      */\n  /*  differently than data pointers (e.g. 48 bits instead of 32).         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTSERV_H__\n#define __FTSERV_H__\n\n\nFT_BEGIN_HEADER\n\n  /*\n   * @macro:\n   *   FT_FACE_FIND_SERVICE\n   *\n   * @description:\n   *   This macro is used to look up a service from a face's driver module.\n   *\n   * @input:\n   *   face ::\n   *     The source face handle.\n   *\n   *   id ::\n   *     A string describing the service as defined in the service's\n   *     header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to\n   *     `multi-masters').  It is automatically prefixed with\n   *     `FT_SERVICE_ID_'.\n   *\n   * @output:\n   *   ptr ::\n   *     A variable that receives the service pointer.  Will be NULL\n   *     if not found.\n   */\n#ifdef __cplusplus\n\n#define FT_FACE_FIND_SERVICE( face, ptr, id )                               \\\n  FT_BEGIN_STMNT                                                            \\\n    FT_Module    module = FT_MODULE( FT_FACE( face )->driver );             \\\n    FT_Pointer   _tmp_  = NULL;                                             \\\n    FT_Pointer*  _pptr_ = (FT_Pointer*)&(ptr);                              \\\n                                                                            \\\n                                                                            \\\n    if ( module->clazz->get_interface )                                     \\\n      _tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \\\n    *_pptr_ = _tmp_;                                                        \\\n  FT_END_STMNT\n\n#else /* !C++ */\n\n#define FT_FACE_FIND_SERVICE( face, ptr, id )                               \\\n  FT_BEGIN_STMNT                                                            \\\n    FT_Module   module = FT_MODULE( FT_FACE( face )->driver );              \\\n    FT_Pointer  _tmp_  = NULL;                                              \\\n                                                                            \\\n    if ( module->clazz->get_interface )                                     \\\n      _tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \\\n    ptr = _tmp_;                                                            \\\n  FT_END_STMNT\n\n#endif /* !C++ */\n\n\n  /*\n   * @macro:\n   *   FT_FACE_FIND_GLOBAL_SERVICE\n   *\n   * @description:\n   *   This macro is used to look up a service from all modules.\n   *\n   * @input:\n   *   face ::\n   *     The source face handle.\n   *\n   *   id ::\n   *     A string describing the service as defined in the service's\n   *     header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to\n   *     `multi-masters').  It is automatically prefixed with\n   *     `FT_SERVICE_ID_'.\n   *\n   * @output:\n   *   ptr ::\n   *     A variable that receives the service pointer.  Will be NULL\n   *     if not found.\n   */\n#ifdef __cplusplus\n\n#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id )               \\\n  FT_BEGIN_STMNT                                                   \\\n    FT_Module    module = FT_MODULE( FT_FACE( face )->driver );    \\\n    FT_Pointer   _tmp_;                                            \\\n    FT_Pointer*  _pptr_ = (FT_Pointer*)&(ptr);                     \\\n                                                                   \\\n                                                                   \\\n    _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \\\n    *_pptr_ = _tmp_;                                               \\\n  FT_END_STMNT\n\n#else /* !C++ */\n\n#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id )               \\\n  FT_BEGIN_STMNT                                                   \\\n    FT_Module   module = FT_MODULE( FT_FACE( face )->driver );     \\\n    FT_Pointer  _tmp_;                                             \\\n                                                                   \\\n                                                                   \\\n    _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \\\n    ptr   = _tmp_;                                                 \\\n  FT_END_STMNT\n\n#endif /* !C++ */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****         S E R V I C E   D E S C R I P T O R S                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*\n   *  The following structure is used to _describe_ a given service\n   *  to the library.  This is useful to build simple static service lists.\n   */\n  typedef struct  FT_ServiceDescRec_\n  {\n    const char*  serv_id;     /* service name         */\n    const void*  serv_data;   /* service pointer/data */\n\n  } FT_ServiceDescRec;\n\n  typedef const FT_ServiceDescRec*  FT_ServiceDesc;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_DEFINE_SERVICEDESCREC1                                          */\n  /*    FT_DEFINE_SERVICEDESCREC2                                          */\n  /*    FT_DEFINE_SERVICEDESCREC3                                          */\n  /*    FT_DEFINE_SERVICEDESCREC4                                          */\n  /*    FT_DEFINE_SERVICEDESCREC5                                          */\n  /*    FT_DEFINE_SERVICEDESCREC6                                          */\n  /*    FT_DEFINE_SERVICEDESCREC7                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Used to initialize an array of FT_ServiceDescRec structures.       */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is defined a `create' function needs to  */\n  /*    be called with a pointer to return an allocated array.  As soon as */\n  /*    it is no longer needed, a `destroy' function needs to be called to */\n  /*    release that allocation.                                           */\n  /*                                                                       */\n  /*    These functions should be manually called from the `pic_init' and  */\n  /*    `pic_free' functions of your module (see FT_DEFINE_MODULE).        */\n  /*                                                                       */\n  /*    When FT_CONFIG_OPTION_PIC is not defined the array will be         */\n  /*    allocated in the global scope (or the scope where the macro is     */\n  /*    used).                                                             */\n  /*                                                                       */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICEDESCREC1( class_,                                  \\\n                                   serv_id_1, serv_data_1 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC2( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC3( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { serv_id_3, serv_data_3 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC4( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { serv_id_3, serv_data_3 },                                             \\\n    { serv_id_4, serv_data_4 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC5( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { serv_id_3, serv_data_3 },                                             \\\n    { serv_id_4, serv_data_4 },                                             \\\n    { serv_id_5, serv_data_5 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC6( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5,                  \\\n                                   serv_id_6, serv_data_6 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { serv_id_3, serv_data_3 },                                             \\\n    { serv_id_4, serv_data_4 },                                             \\\n    { serv_id_5, serv_data_5 },                                             \\\n    { serv_id_6, serv_data_6 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#define FT_DEFINE_SERVICEDESCREC7( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5,                  \\\n                                   serv_id_6, serv_data_6,                  \\\n                                   serv_id_7, serv_data_7 )                 \\\n  static const FT_ServiceDescRec  class_[] =                                \\\n  {                                                                         \\\n    { serv_id_1, serv_data_1 },                                             \\\n    { serv_id_2, serv_data_2 },                                             \\\n    { serv_id_3, serv_data_3 },                                             \\\n    { serv_id_4, serv_data_4 },                                             \\\n    { serv_id_5, serv_data_5 },                                             \\\n    { serv_id_6, serv_data_6 },                                             \\\n    { serv_id_7, serv_data_7 },                                             \\\n    { NULL, NULL }                                                          \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICEDESCREC1( class_,                                  \\\n                                   serv_id_1, serv_data_1 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class )           \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 2 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = NULL;                                              \\\n    clazz[1].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC2( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class )           \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 3 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = NULL;                                              \\\n    clazz[2].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC3( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class )           \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 4 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = serv_id_3;                                         \\\n    clazz[2].serv_data = serv_data_3;                                       \\\n    clazz[3].serv_id   = NULL;                                              \\\n    clazz[3].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC4( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class )           \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 5 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = serv_id_3;                                         \\\n    clazz[2].serv_data = serv_data_3;                                       \\\n    clazz[3].serv_id   = serv_id_4;                                         \\\n    clazz[3].serv_data = serv_data_4;                                       \\\n    clazz[4].serv_id   = NULL;                                              \\\n    clazz[4].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC5( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class )           \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 6 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = serv_id_3;                                         \\\n    clazz[2].serv_data = serv_data_3;                                       \\\n    clazz[3].serv_id   = serv_id_4;                                         \\\n    clazz[3].serv_data = serv_data_4;                                       \\\n    clazz[4].serv_id   = serv_id_5;                                         \\\n    clazz[4].serv_data = serv_data_5;                                       \\\n    clazz[5].serv_id   = NULL;                                              \\\n    clazz[5].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC6( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5,                  \\\n                                   serv_id_6, serv_data_6 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class)            \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 7 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = serv_id_3;                                         \\\n    clazz[2].serv_data = serv_data_3;                                       \\\n    clazz[3].serv_id   = serv_id_4;                                         \\\n    clazz[3].serv_data = serv_data_4;                                       \\\n    clazz[4].serv_id   = serv_id_5;                                         \\\n    clazz[4].serv_data = serv_data_5;                                       \\\n    clazz[5].serv_id   = serv_id_6;                                         \\\n    clazz[5].serv_data = serv_data_6;                                       \\\n    clazz[6].serv_id   = NULL;                                              \\\n    clazz[6].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#define FT_DEFINE_SERVICEDESCREC7( class_,                                  \\\n                                   serv_id_1, serv_data_1,                  \\\n                                   serv_id_2, serv_data_2,                  \\\n                                   serv_id_3, serv_data_3,                  \\\n                                   serv_id_4, serv_data_4,                  \\\n                                   serv_id_5, serv_data_5,                  \\\n                                   serv_id_6, serv_data_6,                  \\\n                                   serv_id_7, serv_data_7 )                 \\\n  void                                                                      \\\n  FT_Destroy_Class_ ## class_( FT_Library          library,                 \\\n                               FT_ServiceDescRec*  clazz )                  \\\n  {                                                                         \\\n    FT_Memory  memory = library->memory;                                    \\\n                                                                            \\\n                                                                            \\\n    if ( clazz )                                                            \\\n      FT_FREE( clazz );                                                     \\\n  }                                                                         \\\n                                                                            \\\n  FT_Error                                                                  \\\n  FT_Create_Class_ ## class_( FT_Library           library,                 \\\n                              FT_ServiceDescRec**  output_class)            \\\n  {                                                                         \\\n    FT_ServiceDescRec*  clazz  = NULL;                                      \\\n    FT_Error            error;                                              \\\n    FT_Memory           memory = library->memory;                           \\\n                                                                            \\\n                                                                            \\\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 8 ) )                         \\\n      return error;                                                         \\\n                                                                            \\\n    clazz[0].serv_id   = serv_id_1;                                         \\\n    clazz[0].serv_data = serv_data_1;                                       \\\n    clazz[1].serv_id   = serv_id_2;                                         \\\n    clazz[1].serv_data = serv_data_2;                                       \\\n    clazz[2].serv_id   = serv_id_3;                                         \\\n    clazz[2].serv_data = serv_data_3;                                       \\\n    clazz[3].serv_id   = serv_id_4;                                         \\\n    clazz[3].serv_data = serv_data_4;                                       \\\n    clazz[4].serv_id   = serv_id_5;                                         \\\n    clazz[4].serv_data = serv_data_5;                                       \\\n    clazz[5].serv_id   = serv_id_6;                                         \\\n    clazz[5].serv_data = serv_data_6;                                       \\\n    clazz[6].serv_id   = serv_id_7;                                         \\\n    clazz[6].serv_data = serv_data_7;                                       \\\n    clazz[7].serv_id   = NULL;                                              \\\n    clazz[7].serv_data = NULL;                                              \\\n                                                                            \\\n    *output_class = clazz;                                                  \\\n                                                                            \\\n    return FT_Err_Ok;                                                       \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /*\n   *  Parse a list of FT_ServiceDescRec descriptors and look for\n   *  a specific service by ID.  Note that the last element in the\n   *  array must be { NULL, NULL }, and that the function should\n   *  return NULL if the service isn't available.\n   *\n   *  This function can be used by modules to implement their\n   *  `get_service' method.\n   */\n  FT_BASE( FT_Pointer )\n  ft_service_list_lookup( FT_ServiceDesc  service_descriptors,\n                          const char*     service_id );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****             S E R V I C E S   C A C H E                       *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*\n   *  This structure is used to store a cache for several frequently used\n   *  services.  It is the type of `face->internal->services'.  You\n   *  should only use FT_FACE_LOOKUP_SERVICE to access it.\n   *\n   *  All fields should have the type FT_Pointer to relax compilation\n   *  dependencies.  We assume the developer isn't completely stupid.\n   *\n   *  Each field must be named `service_XXXX' where `XXX' corresponds to\n   *  the correct FT_SERVICE_ID_XXXX macro.  See the definition of\n   *  FT_FACE_LOOKUP_SERVICE below how this is implemented.\n   *\n   */\n  typedef struct  FT_ServiceCacheRec_\n  {\n    FT_Pointer  service_POSTSCRIPT_FONT_NAME;\n    FT_Pointer  service_MULTI_MASTERS;\n    FT_Pointer  service_GLYPH_DICT;\n    FT_Pointer  service_PFR_METRICS;\n    FT_Pointer  service_WINFNT;\n\n  } FT_ServiceCacheRec, *FT_ServiceCache;\n\n\n  /*\n   *  A magic number used within the services cache.\n   */\n\n  /* ensure that value `1' has the same width as a pointer */\n#define FT_SERVICE_UNAVAILABLE  ((FT_Pointer)~(FT_PtrDist)1)\n\n\n  /*\n   * @macro:\n   *   FT_FACE_LOOKUP_SERVICE\n   *\n   * @description:\n   *   This macro is used to lookup a service from a face's driver module\n   *   using its cache.\n   *\n   * @input:\n   *   face::\n   *     The source face handle containing the cache.\n   *\n   *   field ::\n   *     The field name in the cache.\n   *\n   *   id ::\n   *     The service ID.\n   *\n   * @output:\n   *   ptr ::\n   *     A variable receiving the service data.  NULL if not available.\n   */\n#ifdef __cplusplus\n\n#define FT_FACE_LOOKUP_SERVICE( face, ptr, id )                \\\n  FT_BEGIN_STMNT                                               \\\n    FT_Pointer   svc;                                          \\\n    FT_Pointer*  Pptr = (FT_Pointer*)&(ptr);                   \\\n                                                               \\\n                                                               \\\n    svc = FT_FACE( face )->internal->services. service_ ## id; \\\n    if ( svc == FT_SERVICE_UNAVAILABLE )                       \\\n      svc = NULL;                                              \\\n    else if ( svc == NULL )                                    \\\n    {                                                          \\\n      FT_FACE_FIND_SERVICE( face, svc, id );                   \\\n                                                               \\\n      FT_FACE( face )->internal->services. service_ ## id =    \\\n        (FT_Pointer)( svc != NULL ? svc                        \\\n                                  : FT_SERVICE_UNAVAILABLE );  \\\n    }                                                          \\\n    *Pptr = svc;                                               \\\n  FT_END_STMNT\n\n#else /* !C++ */\n\n#define FT_FACE_LOOKUP_SERVICE( face, ptr, id )                \\\n  FT_BEGIN_STMNT                                               \\\n    FT_Pointer  svc;                                           \\\n                                                               \\\n                                                               \\\n    svc = FT_FACE( face )->internal->services. service_ ## id; \\\n    if ( svc == FT_SERVICE_UNAVAILABLE )                       \\\n      svc = NULL;                                              \\\n    else if ( svc == NULL )                                    \\\n    {                                                          \\\n      FT_FACE_FIND_SERVICE( face, svc, id );                   \\\n                                                               \\\n      FT_FACE( face )->internal->services. service_ ## id =    \\\n        (FT_Pointer)( svc != NULL ? svc                        \\\n                                  : FT_SERVICE_UNAVAILABLE );  \\\n    }                                                          \\\n    ptr = svc;                                                 \\\n  FT_END_STMNT\n\n#endif /* !C++ */\n\n  /*\n   *  A macro used to define new service structure types.\n   */\n\n#define FT_DEFINE_SERVICE( name )            \\\n  typedef struct FT_Service_ ## name ## Rec_ \\\n    FT_Service_ ## name ## Rec ;             \\\n  typedef struct FT_Service_ ## name ## Rec_ \\\n    const * FT_Service_ ## name ;            \\\n  struct FT_Service_ ## name ## Rec_\n\n  /* */\n\n  /*\n   *  The header files containing the services.\n   */\n\n#define FT_SERVICE_BDF_H                <internal/services/svbdf.h>\n#define FT_SERVICE_CID_H                <internal/services/svcid.h>\n#define FT_SERVICE_GLYPH_DICT_H         <internal/services/svgldict.h>\n#define FT_SERVICE_GX_VALIDATE_H        <internal/services/svgxval.h>\n#define FT_SERVICE_KERNING_H            <internal/services/svkern.h>\n#define FT_SERVICE_MULTIPLE_MASTERS_H   <internal/services/svmm.h>\n#define FT_SERVICE_OPENTYPE_VALIDATE_H  <internal/services/svotval.h>\n#define FT_SERVICE_PFR_H                <internal/services/svpfr.h>\n#define FT_SERVICE_POSTSCRIPT_CMAPS_H   <internal/services/svpscmap.h>\n#define FT_SERVICE_POSTSCRIPT_INFO_H    <internal/services/svpsinfo.h>\n#define FT_SERVICE_POSTSCRIPT_NAME_H    <internal/services/svpostnm.h>\n#define FT_SERVICE_PROPERTIES_H         <internal/services/svprop.h>\n#define FT_SERVICE_SFNT_H               <internal/services/svsfnt.h>\n#define FT_SERVICE_TRUETYPE_ENGINE_H    <internal/services/svtteng.h>\n#define FT_SERVICE_TT_CMAP_H            <internal/services/svttcmap.h>\n#define FT_SERVICE_WINFNT_H             <internal/services/svwinfnt.h>\n#define FT_SERVICE_XFREE86_NAME_H       <internal/services/svxf86nm.h>\n#define FT_SERVICE_TRUETYPE_GLYF_H      <internal/services/svttglyf.h>\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTSERV_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/ftstream.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftstream.h                                                             */\n/*                                                                         */\n/*    Stream handling (specification).                                     */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004-2006, 2011, 2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTSTREAM_H__\n#define __FTSTREAM_H__\n\n\n#include <ft2build.h>\n#include FT_SYSTEM_H\n#include FT_INTERNAL_OBJECTS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /* format of an 8-bit frame_op value:           */\n  /*                                              */\n  /* bit  76543210                                */\n  /*      xxxxxxes                                */\n  /*                                              */\n  /* s is set to 1 if the value is signed.        */\n  /* e is set to 1 if the value is little-endian. */\n  /* xxx is a command.                            */\n\n#define FT_FRAME_OP_SHIFT         2\n#define FT_FRAME_OP_SIGNED        1\n#define FT_FRAME_OP_LITTLE        2\n#define FT_FRAME_OP_COMMAND( x )  ( x >> FT_FRAME_OP_SHIFT )\n\n#define FT_MAKE_FRAME_OP( command, little, sign ) \\\n          ( ( command << FT_FRAME_OP_SHIFT ) | ( little << 1 ) | sign )\n\n#define FT_FRAME_OP_END    0\n#define FT_FRAME_OP_START  1  /* start a new frame     */\n#define FT_FRAME_OP_BYTE   2  /* read 1-byte value     */\n#define FT_FRAME_OP_SHORT  3  /* read 2-byte value     */\n#define FT_FRAME_OP_LONG   4  /* read 4-byte value     */\n#define FT_FRAME_OP_OFF3   5  /* read 3-byte value     */\n#define FT_FRAME_OP_BYTES  6  /* read a bytes sequence */\n\n\n  typedef enum  FT_Frame_Op_\n  {\n    ft_frame_end       = 0,\n    ft_frame_start     = FT_MAKE_FRAME_OP( FT_FRAME_OP_START, 0, 0 ),\n\n    ft_frame_byte      = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE,  0, 0 ),\n    ft_frame_schar     = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE,  0, 1 ),\n\n    ft_frame_ushort_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 0 ),\n    ft_frame_short_be  = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 1 ),\n    ft_frame_ushort_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 0 ),\n    ft_frame_short_le  = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 1 ),\n\n    ft_frame_ulong_be  = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 0 ),\n    ft_frame_long_be   = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 1 ),\n    ft_frame_ulong_le  = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 0 ),\n    ft_frame_long_le   = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 1 ),\n\n    ft_frame_uoff3_be  = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 0 ),\n    ft_frame_off3_be   = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 1 ),\n    ft_frame_uoff3_le  = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 0 ),\n    ft_frame_off3_le   = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 1 ),\n\n    ft_frame_bytes     = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 0 ),\n    ft_frame_skip      = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 1 )\n\n  } FT_Frame_Op;\n\n\n  typedef struct  FT_Frame_Field_\n  {\n    FT_Byte    value;\n    FT_Byte    size;\n    FT_UShort  offset;\n\n  } FT_Frame_Field;\n\n\n  /* Construct an FT_Frame_Field out of a structure type and a field name. */\n  /* The structure type must be set in the FT_STRUCTURE macro before       */\n  /* calling the FT_FRAME_START() macro.                                   */\n  /*                                                                       */\n#define FT_FIELD_SIZE( f ) \\\n          (FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f )\n\n#define FT_FIELD_SIZE_DELTA( f ) \\\n          (FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f[0] )\n\n#define FT_FIELD_OFFSET( f ) \\\n          (FT_UShort)( offsetof( FT_STRUCTURE, f ) )\n\n#define FT_FRAME_FIELD( frame_op, field ) \\\n          {                               \\\n            frame_op,                     \\\n            FT_FIELD_SIZE( field ),       \\\n            FT_FIELD_OFFSET( field )      \\\n          }\n\n#define FT_MAKE_EMPTY_FIELD( frame_op )  { frame_op, 0, 0 }\n\n#define FT_FRAME_START( size )   { ft_frame_start, 0, size }\n#define FT_FRAME_END             { ft_frame_end, 0, 0 }\n\n#define FT_FRAME_LONG( f )       FT_FRAME_FIELD( ft_frame_long_be, f )\n#define FT_FRAME_ULONG( f )      FT_FRAME_FIELD( ft_frame_ulong_be, f )\n#define FT_FRAME_SHORT( f )      FT_FRAME_FIELD( ft_frame_short_be, f )\n#define FT_FRAME_USHORT( f )     FT_FRAME_FIELD( ft_frame_ushort_be, f )\n#define FT_FRAME_OFF3( f )       FT_FRAME_FIELD( ft_frame_off3_be, f )\n#define FT_FRAME_UOFF3( f )      FT_FRAME_FIELD( ft_frame_uoff3_be, f )\n#define FT_FRAME_BYTE( f )       FT_FRAME_FIELD( ft_frame_byte, f )\n#define FT_FRAME_CHAR( f )       FT_FRAME_FIELD( ft_frame_schar, f )\n\n#define FT_FRAME_LONG_LE( f )    FT_FRAME_FIELD( ft_frame_long_le, f )\n#define FT_FRAME_ULONG_LE( f )   FT_FRAME_FIELD( ft_frame_ulong_le, f )\n#define FT_FRAME_SHORT_LE( f )   FT_FRAME_FIELD( ft_frame_short_le, f )\n#define FT_FRAME_USHORT_LE( f )  FT_FRAME_FIELD( ft_frame_ushort_le, f )\n#define FT_FRAME_OFF3_LE( f )    FT_FRAME_FIELD( ft_frame_off3_le, f )\n#define FT_FRAME_UOFF3_LE( f )   FT_FRAME_FIELD( ft_frame_uoff3_le, f )\n\n#define FT_FRAME_SKIP_LONG       { ft_frame_long_be, 0, 0 }\n#define FT_FRAME_SKIP_SHORT      { ft_frame_short_be, 0, 0 }\n#define FT_FRAME_SKIP_BYTE       { ft_frame_byte, 0, 0 }\n\n#define FT_FRAME_BYTES( field, count ) \\\n          {                            \\\n            ft_frame_bytes,            \\\n            count,                     \\\n            FT_FIELD_OFFSET( field )   \\\n          }\n\n#define FT_FRAME_SKIP_BYTES( count )  { ft_frame_skip, count, 0 }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Integer extraction macros -- the `buffer' parameter must ALWAYS be of */\n  /* type `char*' or equivalent (1-byte elements).                         */\n  /*                                                                       */\n\n#define FT_BYTE_( p, i )  ( ((const FT_Byte*)(p))[(i)] )\n\n#define FT_INT16( x )   ( (FT_Int16)(x)  )\n#define FT_UINT16( x )  ( (FT_UInt16)(x) )\n#define FT_INT32( x )   ( (FT_Int32)(x)  )\n#define FT_UINT32( x )  ( (FT_UInt32)(x) )\n\n\n#define FT_BYTE_U16( p, i, s )  ( FT_UINT16( FT_BYTE_( p, i ) ) << (s) )\n#define FT_BYTE_U32( p, i, s )  ( FT_UINT32( FT_BYTE_( p, i ) ) << (s) )\n\n\n#define FT_PEEK_SHORT( p )  FT_INT16( FT_BYTE_U16( p, 0, 8) | \\\n                                      FT_BYTE_U16( p, 1, 0) )\n\n#define FT_PEEK_USHORT( p )  FT_UINT16( FT_BYTE_U16( p, 0, 8 ) | \\\n                                        FT_BYTE_U16( p, 1, 0 ) )\n\n#define FT_PEEK_LONG( p )  FT_INT32( FT_BYTE_U32( p, 0, 24 ) | \\\n                                     FT_BYTE_U32( p, 1, 16 ) | \\\n                                     FT_BYTE_U32( p, 2,  8 ) | \\\n                                     FT_BYTE_U32( p, 3,  0 ) )\n\n#define FT_PEEK_ULONG( p )  FT_UINT32( FT_BYTE_U32( p, 0, 24 ) | \\\n                                       FT_BYTE_U32( p, 1, 16 ) | \\\n                                       FT_BYTE_U32( p, 2,  8 ) | \\\n                                       FT_BYTE_U32( p, 3,  0 ) )\n\n#define FT_PEEK_OFF3( p )  FT_INT32( FT_BYTE_U32( p, 0, 16 ) | \\\n                                     FT_BYTE_U32( p, 1,  8 ) | \\\n                                     FT_BYTE_U32( p, 2,  0 ) )\n\n#define FT_PEEK_UOFF3( p )  FT_UINT32( FT_BYTE_U32( p, 0, 16 ) | \\\n                                       FT_BYTE_U32( p, 1,  8 ) | \\\n                                       FT_BYTE_U32( p, 2,  0 ) )\n\n#define FT_PEEK_SHORT_LE( p )  FT_INT16( FT_BYTE_U16( p, 1, 8 ) | \\\n                                         FT_BYTE_U16( p, 0, 0 ) )\n\n#define FT_PEEK_USHORT_LE( p )  FT_UINT16( FT_BYTE_U16( p, 1, 8 ) |  \\\n                                           FT_BYTE_U16( p, 0, 0 ) )\n\n#define FT_PEEK_LONG_LE( p )  FT_INT32( FT_BYTE_U32( p, 3, 24 ) | \\\n                                        FT_BYTE_U32( p, 2, 16 ) | \\\n                                        FT_BYTE_U32( p, 1,  8 ) | \\\n                                        FT_BYTE_U32( p, 0,  0 ) )\n\n#define FT_PEEK_ULONG_LE( p )  FT_UINT32( FT_BYTE_U32( p, 3, 24 ) | \\\n                                          FT_BYTE_U32( p, 2, 16 ) | \\\n                                          FT_BYTE_U32( p, 1,  8 ) | \\\n                                          FT_BYTE_U32( p, 0,  0 ) )\n\n#define FT_PEEK_OFF3_LE( p )  FT_INT32( FT_BYTE_U32( p, 2, 16 ) | \\\n                                        FT_BYTE_U32( p, 1,  8 ) | \\\n                                        FT_BYTE_U32( p, 0,  0 ) )\n\n#define FT_PEEK_UOFF3_LE( p )  FT_UINT32( FT_BYTE_U32( p, 2, 16 ) | \\\n                                          FT_BYTE_U32( p, 1,  8 ) | \\\n                                          FT_BYTE_U32( p, 0,  0 ) )\n\n\n#define FT_NEXT_CHAR( buffer )       \\\n          ( (signed char)*buffer++ )\n\n#define FT_NEXT_BYTE( buffer )         \\\n          ( (unsigned char)*buffer++ )\n\n#define FT_NEXT_SHORT( buffer )                                   \\\n          ( (short)( buffer += 2, FT_PEEK_SHORT( buffer - 2 ) ) )\n\n#define FT_NEXT_USHORT( buffer )                                            \\\n          ( (unsigned short)( buffer += 2, FT_PEEK_USHORT( buffer - 2 ) ) )\n\n#define FT_NEXT_OFF3( buffer )                                  \\\n          ( (long)( buffer += 3, FT_PEEK_OFF3( buffer - 3 ) ) )\n\n#define FT_NEXT_UOFF3( buffer )                                           \\\n          ( (unsigned long)( buffer += 3, FT_PEEK_UOFF3( buffer - 3 ) ) )\n\n#define FT_NEXT_LONG( buffer )                                  \\\n          ( (long)( buffer += 4, FT_PEEK_LONG( buffer - 4 ) ) )\n\n#define FT_NEXT_ULONG( buffer )                                           \\\n          ( (unsigned long)( buffer += 4, FT_PEEK_ULONG( buffer - 4 ) ) )\n\n\n#define FT_NEXT_SHORT_LE( buffer )                                   \\\n          ( (short)( buffer += 2, FT_PEEK_SHORT_LE( buffer - 2 ) ) )\n\n#define FT_NEXT_USHORT_LE( buffer )                                            \\\n          ( (unsigned short)( buffer += 2, FT_PEEK_USHORT_LE( buffer - 2 ) ) )\n\n#define FT_NEXT_OFF3_LE( buffer )                                  \\\n          ( (long)( buffer += 3, FT_PEEK_OFF3_LE( buffer - 3 ) ) )\n\n#define FT_NEXT_UOFF3_LE( buffer )                                           \\\n          ( (unsigned long)( buffer += 3, FT_PEEK_UOFF3_LE( buffer - 3 ) ) )\n\n#define FT_NEXT_LONG_LE( buffer )                                  \\\n          ( (long)( buffer += 4, FT_PEEK_LONG_LE( buffer - 4 ) ) )\n\n#define FT_NEXT_ULONG_LE( buffer )                                           \\\n          ( (unsigned long)( buffer += 4, FT_PEEK_ULONG_LE( buffer - 4 ) ) )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Each GET_xxxx() macro uses an implicit `stream' variable.             */\n  /*                                                                       */\n#if 0\n#define FT_GET_MACRO( type )    FT_NEXT_ ## type ( stream->cursor )\n\n#define FT_GET_CHAR()       FT_GET_MACRO( CHAR )\n#define FT_GET_BYTE()       FT_GET_MACRO( BYTE )\n#define FT_GET_SHORT()      FT_GET_MACRO( SHORT )\n#define FT_GET_USHORT()     FT_GET_MACRO( USHORT )\n#define FT_GET_OFF3()       FT_GET_MACRO( OFF3 )\n#define FT_GET_UOFF3()      FT_GET_MACRO( UOFF3 )\n#define FT_GET_LONG()       FT_GET_MACRO( LONG )\n#define FT_GET_ULONG()      FT_GET_MACRO( ULONG )\n#define FT_GET_TAG4()       FT_GET_MACRO( ULONG )\n\n#define FT_GET_SHORT_LE()   FT_GET_MACRO( SHORT_LE )\n#define FT_GET_USHORT_LE()  FT_GET_MACRO( USHORT_LE )\n#define FT_GET_LONG_LE()    FT_GET_MACRO( LONG_LE )\n#define FT_GET_ULONG_LE()   FT_GET_MACRO( ULONG_LE )\n\n#else\n#define FT_GET_MACRO( func, type )        ( (type)func( stream ) )\n\n#define FT_GET_CHAR()       FT_GET_MACRO( FT_Stream_GetChar, FT_Char )\n#define FT_GET_BYTE()       FT_GET_MACRO( FT_Stream_GetChar, FT_Byte )\n#define FT_GET_SHORT()      FT_GET_MACRO( FT_Stream_GetUShort, FT_Short )\n#define FT_GET_USHORT()     FT_GET_MACRO( FT_Stream_GetUShort, FT_UShort )\n#define FT_GET_OFF3()       FT_GET_MACRO( FT_Stream_GetUOffset, FT_Long )\n#define FT_GET_UOFF3()      FT_GET_MACRO( FT_Stream_GetUOffset, FT_ULong )\n#define FT_GET_LONG()       FT_GET_MACRO( FT_Stream_GetULong, FT_Long )\n#define FT_GET_ULONG()      FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )\n#define FT_GET_TAG4()       FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )\n\n#define FT_GET_SHORT_LE()   FT_GET_MACRO( FT_Stream_GetUShortLE, FT_Short )\n#define FT_GET_USHORT_LE()  FT_GET_MACRO( FT_Stream_GetUShortLE, FT_UShort )\n#define FT_GET_LONG_LE()    FT_GET_MACRO( FT_Stream_GetULongLE, FT_Long )\n#define FT_GET_ULONG_LE()   FT_GET_MACRO( FT_Stream_GetULongLE, FT_ULong )\n#endif\n\n#define FT_READ_MACRO( func, type, var )        \\\n          ( var = (type)func( stream, &error ), \\\n            error != FT_Err_Ok )\n\n#define FT_READ_BYTE( var )       FT_READ_MACRO( FT_Stream_ReadChar, FT_Byte, var )\n#define FT_READ_CHAR( var )       FT_READ_MACRO( FT_Stream_ReadChar, FT_Char, var )\n#define FT_READ_SHORT( var )      FT_READ_MACRO( FT_Stream_ReadUShort, FT_Short, var )\n#define FT_READ_USHORT( var )     FT_READ_MACRO( FT_Stream_ReadUShort, FT_UShort, var )\n#define FT_READ_OFF3( var )       FT_READ_MACRO( FT_Stream_ReadUOffset, FT_Long, var )\n#define FT_READ_UOFF3( var )      FT_READ_MACRO( FT_Stream_ReadUOffset, FT_ULong, var )\n#define FT_READ_LONG( var )       FT_READ_MACRO( FT_Stream_ReadULong, FT_Long, var )\n#define FT_READ_ULONG( var )      FT_READ_MACRO( FT_Stream_ReadULong, FT_ULong, var )\n\n#define FT_READ_SHORT_LE( var )   FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_Short, var )\n#define FT_READ_USHORT_LE( var )  FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_UShort, var )\n#define FT_READ_LONG_LE( var )    FT_READ_MACRO( FT_Stream_ReadULongLE, FT_Long, var )\n#define FT_READ_ULONG_LE( var )   FT_READ_MACRO( FT_Stream_ReadULongLE, FT_ULong, var )\n\n\n#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM\n\n  /* initialize a stream for reading a regular system stream */\n  FT_BASE( FT_Error )\n  FT_Stream_Open( FT_Stream    stream,\n                  const char*  filepathname );\n\n#endif /* FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */\n\n\n  /* create a new (input) stream from an FT_Open_Args structure */\n  FT_BASE( FT_Error )\n  FT_Stream_New( FT_Library           library,\n                 const FT_Open_Args*  args,\n                 FT_Stream           *astream );\n\n  /* free a stream */\n  FT_BASE( void )\n  FT_Stream_Free( FT_Stream  stream,\n                  FT_Int     external );\n\n  /* initialize a stream for reading in-memory data */\n  FT_BASE( void )\n  FT_Stream_OpenMemory( FT_Stream       stream,\n                        const FT_Byte*  base,\n                        FT_ULong        size );\n\n  /* close a stream (does not destroy the stream structure) */\n  FT_BASE( void )\n  FT_Stream_Close( FT_Stream  stream );\n\n\n  /* seek within a stream. position is relative to start of stream */\n  FT_BASE( FT_Error )\n  FT_Stream_Seek( FT_Stream  stream,\n                  FT_ULong   pos );\n\n  /* skip bytes in a stream */\n  FT_BASE( FT_Error )\n  FT_Stream_Skip( FT_Stream  stream,\n                  FT_Long    distance );\n\n  /* return current stream position */\n  FT_BASE( FT_Long )\n  FT_Stream_Pos( FT_Stream  stream );\n\n  /* read bytes from a stream into a user-allocated buffer, returns an */\n  /* error if not all bytes could be read.                             */\n  FT_BASE( FT_Error )\n  FT_Stream_Read( FT_Stream  stream,\n                  FT_Byte*   buffer,\n                  FT_ULong   count );\n\n  /* read bytes from a stream at a given position */\n  FT_BASE( FT_Error )\n  FT_Stream_ReadAt( FT_Stream  stream,\n                    FT_ULong   pos,\n                    FT_Byte*   buffer,\n                    FT_ULong   count );\n\n  /* try to read bytes at the end of a stream; return number of bytes */\n  /* really available                                                 */\n  FT_BASE( FT_ULong )\n  FT_Stream_TryRead( FT_Stream  stream,\n                     FT_Byte*   buffer,\n                     FT_ULong   count );\n\n  /* Enter a frame of `count' consecutive bytes in a stream.  Returns an */\n  /* error if the frame could not be read/accessed.  The caller can use  */\n  /* the FT_Stream_Get_XXX functions to retrieve frame data without      */\n  /* error checks.                                                       */\n  /*                                                                     */\n  /* You must _always_ call FT_Stream_ExitFrame() once you have entered  */\n  /* a stream frame!                                                     */\n  /*                                                                     */\n  FT_BASE( FT_Error )\n  FT_Stream_EnterFrame( FT_Stream  stream,\n                        FT_ULong   count );\n\n  /* exit a stream frame */\n  FT_BASE( void )\n  FT_Stream_ExitFrame( FT_Stream  stream );\n\n  /* Extract a stream frame.  If the stream is disk-based, a heap block */\n  /* is allocated and the frame bytes are read into it.  If the stream  */\n  /* is memory-based, this function simply set a pointer to the data.   */\n  /*                                                                    */\n  /* Useful to optimize access to memory-based streams transparently.   */\n  /*                                                                    */\n  /* All extracted frames must be `freed' with a call to the function   */\n  /* FT_Stream_ReleaseFrame().                                          */\n  /*                                                                    */\n  FT_BASE( FT_Error )\n  FT_Stream_ExtractFrame( FT_Stream  stream,\n                          FT_ULong   count,\n                          FT_Byte**  pbytes );\n\n  /* release an extract frame (see FT_Stream_ExtractFrame) */\n  FT_BASE( void )\n  FT_Stream_ReleaseFrame( FT_Stream  stream,\n                          FT_Byte**  pbytes );\n\n  /* read a byte from an entered frame */\n  FT_BASE( FT_Char )\n  FT_Stream_GetChar( FT_Stream  stream );\n\n  /* read a 16-bit big-endian unsigned integer from an entered frame */\n  FT_BASE( FT_UShort )\n  FT_Stream_GetUShort( FT_Stream  stream );\n\n  /* read a 24-bit big-endian unsigned integer from an entered frame */\n  FT_BASE( FT_ULong )\n  FT_Stream_GetUOffset( FT_Stream  stream );\n\n  /* read a 32-bit big-endian unsigned integer from an entered frame */\n  FT_BASE( FT_ULong )\n  FT_Stream_GetULong( FT_Stream  stream );\n\n  /* read a 16-bit little-endian unsigned integer from an entered frame */\n  FT_BASE( FT_UShort )\n  FT_Stream_GetUShortLE( FT_Stream  stream );\n\n  /* read a 32-bit little-endian unsigned integer from an entered frame */\n  FT_BASE( FT_ULong )\n  FT_Stream_GetULongLE( FT_Stream  stream );\n\n\n  /* read a byte from a stream */\n  FT_BASE( FT_Char )\n  FT_Stream_ReadChar( FT_Stream  stream,\n                      FT_Error*  error );\n\n  /* read a 16-bit big-endian unsigned integer from a stream */\n  FT_BASE( FT_UShort )\n  FT_Stream_ReadUShort( FT_Stream  stream,\n                        FT_Error*  error );\n\n  /* read a 24-bit big-endian unsigned integer from a stream */\n  FT_BASE( FT_ULong )\n  FT_Stream_ReadUOffset( FT_Stream  stream,\n                         FT_Error*  error );\n\n  /* read a 32-bit big-endian integer from a stream */\n  FT_BASE( FT_ULong )\n  FT_Stream_ReadULong( FT_Stream  stream,\n                       FT_Error*  error );\n\n  /* read a 16-bit little-endian unsigned integer from a stream */\n  FT_BASE( FT_UShort )\n  FT_Stream_ReadUShortLE( FT_Stream  stream,\n                          FT_Error*  error );\n\n  /* read a 32-bit little-endian unsigned integer from a stream */\n  FT_BASE( FT_ULong )\n  FT_Stream_ReadULongLE( FT_Stream  stream,\n                         FT_Error*  error );\n\n  /* Read a structure from a stream.  The structure must be described */\n  /* by an array of FT_Frame_Field records.                           */\n  FT_BASE( FT_Error )\n  FT_Stream_ReadFields( FT_Stream              stream,\n                        const FT_Frame_Field*  fields,\n                        void*                  structure );\n\n\n#define FT_STREAM_POS()           \\\n          FT_Stream_Pos( stream )\n\n#define FT_STREAM_SEEK( position )                               \\\n          FT_SET_ERROR( FT_Stream_Seek( stream,                  \\\n                                        (FT_ULong)(position) ) )\n\n#define FT_STREAM_SKIP( distance )                              \\\n          FT_SET_ERROR( FT_Stream_Skip( stream,                 \\\n                                        (FT_Long)(distance) ) )\n\n#define FT_STREAM_READ( buffer, count )                       \\\n          FT_SET_ERROR( FT_Stream_Read( stream,               \\\n                                        (FT_Byte*)(buffer),   \\\n                                        (FT_ULong)(count) ) )\n\n#define FT_STREAM_READ_AT( position, buffer, count )            \\\n          FT_SET_ERROR( FT_Stream_ReadAt( stream,               \\\n                                          (FT_ULong)(position), \\\n                                          (FT_Byte*)buffer,     \\\n                                          (FT_ULong)(count) ) )\n\n#define FT_STREAM_READ_FIELDS( fields, object )                          \\\n          FT_SET_ERROR( FT_Stream_ReadFields( stream, fields, object ) )\n\n\n#define FT_FRAME_ENTER( size )                                           \\\n          FT_SET_ERROR(                                                  \\\n            FT_DEBUG_INNER( FT_Stream_EnterFrame( stream,                \\\n                                                  (FT_ULong)(size) ) ) )\n\n#define FT_FRAME_EXIT()                                   \\\n          FT_DEBUG_INNER( FT_Stream_ExitFrame( stream ) )\n\n#define FT_FRAME_EXTRACT( size, bytes )                                       \\\n          FT_SET_ERROR(                                                       \\\n            FT_DEBUG_INNER( FT_Stream_ExtractFrame( stream,                   \\\n                                                    (FT_ULong)(size),         \\\n                                                    (FT_Byte**)&(bytes) ) ) )\n\n#define FT_FRAME_RELEASE( bytes )                                         \\\n          FT_DEBUG_INNER( FT_Stream_ReleaseFrame( stream,                 \\\n                                                  (FT_Byte**)&(bytes) ) )\n\n\nFT_END_HEADER\n\n#endif /* __FTSTREAM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/fttrace.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fttrace.h                                                              */\n/*                                                                         */\n/*    Tracing handling (specification only).                               */\n/*                                                                         */\n/*  Copyright 2002, 2004-2007, 2009, 2011-2014 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /* definitions of trace levels for FreeType 2 */\n\n  /* the first level must always be `trace_any' */\nFT_TRACE_DEF( any )\n\n  /* base components */\nFT_TRACE_DEF( calc )      /* calculations            (ftcalc.c)   */\nFT_TRACE_DEF( memory )    /* memory manager          (ftobjs.c)   */\nFT_TRACE_DEF( stream )    /* stream manager          (ftstream.c) */\nFT_TRACE_DEF( io )        /* i/o interface           (ftsystem.c) */\nFT_TRACE_DEF( list )      /* list management         (ftlist.c)   */\nFT_TRACE_DEF( init )      /* initialization          (ftinit.c)   */\nFT_TRACE_DEF( objs )      /* base objects            (ftobjs.c)   */\nFT_TRACE_DEF( outline )   /* outline management      (ftoutln.c)  */\nFT_TRACE_DEF( glyph )     /* glyph management        (ftglyph.c)  */\nFT_TRACE_DEF( gloader )   /* glyph loader            (ftgloadr.c) */\n\nFT_TRACE_DEF( raster )    /* monochrome rasterizer   (ftraster.c) */\nFT_TRACE_DEF( smooth )    /* anti-aliasing raster    (ftgrays.c)  */\nFT_TRACE_DEF( mm )        /* MM interface            (ftmm.c)     */\nFT_TRACE_DEF( raccess )   /* resource fork accessor  (ftrfork.c)  */\nFT_TRACE_DEF( synth )     /* bold/slant synthesizer  (ftsynth.c)  */\nFT_TRACE_DEF( bitmap )    /* bitmap checksum         (ftobjs.c)   */\n\n  /* Cache sub-system */\nFT_TRACE_DEF( cache )     /* cache sub-system        (ftcache.c, etc.) */\n\n  /* SFNT driver components */\nFT_TRACE_DEF( sfdriver )  /* SFNT font driver        (sfdriver.c) */\nFT_TRACE_DEF( sfobjs )    /* SFNT object handler     (sfobjs.c)   */\nFT_TRACE_DEF( ttcmap )    /* charmap handler         (ttcmap.c)   */\nFT_TRACE_DEF( ttkern )    /* kerning handler         (ttkern.c)   */\nFT_TRACE_DEF( ttload )    /* basic TrueType tables   (ttload.c)   */\nFT_TRACE_DEF( ttmtx )     /* metrics-related tables  (ttmtx.c)    */\nFT_TRACE_DEF( ttpost )    /* PS table processing     (ttpost.c)   */\nFT_TRACE_DEF( ttsbit )    /* TrueType sbit handling  (ttsbit.c)   */\nFT_TRACE_DEF( ttbdf )     /* TrueType embedded BDF   (ttbdf.c)    */\n\n  /* TrueType driver components */\nFT_TRACE_DEF( ttdriver )  /* TT font driver          (ttdriver.c) */\nFT_TRACE_DEF( ttgload )   /* TT glyph loader         (ttgload.c)  */\nFT_TRACE_DEF( ttinterp )  /* bytecode interpreter    (ttinterp.c) */\nFT_TRACE_DEF( ttobjs )    /* TT objects manager      (ttobjs.c)   */\nFT_TRACE_DEF( ttpload )   /* TT data/program loader  (ttpload.c)  */\nFT_TRACE_DEF( ttgxvar )   /* TrueType GX var handler (ttgxvar.c)  */\n\n  /* Type 1 driver components */\nFT_TRACE_DEF( t1afm )\nFT_TRACE_DEF( t1driver )\nFT_TRACE_DEF( t1gload )\nFT_TRACE_DEF( t1hint )\nFT_TRACE_DEF( t1load )\nFT_TRACE_DEF( t1objs )\nFT_TRACE_DEF( t1parse )\n\n  /* PostScript helper module `psaux' */\nFT_TRACE_DEF( t1decode )\nFT_TRACE_DEF( psobjs )\nFT_TRACE_DEF( psconv )\n\n  /* PostScript hinting module `pshinter' */\nFT_TRACE_DEF( pshrec )\nFT_TRACE_DEF( pshalgo1 )\nFT_TRACE_DEF( pshalgo2 )\n\n  /* Type 2 driver components */\nFT_TRACE_DEF( cffdriver )\nFT_TRACE_DEF( cffgload )\nFT_TRACE_DEF( cffload )\nFT_TRACE_DEF( cffobjs )\nFT_TRACE_DEF( cffparse )\n\nFT_TRACE_DEF( cf2blues )\nFT_TRACE_DEF( cf2hints )\nFT_TRACE_DEF( cf2interp )\n\n  /* Type 42 driver component */\nFT_TRACE_DEF( t42 )\n\n  /* CID driver components */\nFT_TRACE_DEF( cidafm )\nFT_TRACE_DEF( ciddriver )\nFT_TRACE_DEF( cidgload )\nFT_TRACE_DEF( cidload )\nFT_TRACE_DEF( cidobjs )\nFT_TRACE_DEF( cidparse )\n\n  /* Windows font component */\nFT_TRACE_DEF( winfnt )\n\n  /* PCF font components */\nFT_TRACE_DEF( pcfdriver )\nFT_TRACE_DEF( pcfread )\n\n  /* BDF font components */\nFT_TRACE_DEF( bdfdriver )\nFT_TRACE_DEF( bdflib )\n\n  /* PFR font component */\nFT_TRACE_DEF( pfr )\n\n  /* OpenType validation components */\nFT_TRACE_DEF( otvmodule )\nFT_TRACE_DEF( otvcommon )\nFT_TRACE_DEF( otvbase )\nFT_TRACE_DEF( otvgdef )\nFT_TRACE_DEF( otvgpos )\nFT_TRACE_DEF( otvgsub )\nFT_TRACE_DEF( otvjstf )\nFT_TRACE_DEF( otvmath )\n\n  /* TrueTypeGX/AAT validation components */\nFT_TRACE_DEF( gxvmodule )\nFT_TRACE_DEF( gxvcommon )\nFT_TRACE_DEF( gxvfeat )\nFT_TRACE_DEF( gxvmort )\nFT_TRACE_DEF( gxvmorx )\nFT_TRACE_DEF( gxvbsln )\nFT_TRACE_DEF( gxvjust )\nFT_TRACE_DEF( gxvkern )\nFT_TRACE_DEF( gxvopbd )\nFT_TRACE_DEF( gxvtrak )\nFT_TRACE_DEF( gxvprop )\nFT_TRACE_DEF( gxvlcar )\n\n  /* autofit components */\nFT_TRACE_DEF( afmodule )\nFT_TRACE_DEF( afhints )\nFT_TRACE_DEF( afcjk )\nFT_TRACE_DEF( aflatin )\nFT_TRACE_DEF( aflatin2 )\nFT_TRACE_DEF( afwarp )\nFT_TRACE_DEF( afharfbuzz )\nFT_TRACE_DEF( afglobal )\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/ftvalid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftvalid.h                                                              */\n/*                                                                         */\n/*    FreeType validation support (specification).                         */\n/*                                                                         */\n/*  Copyright 2004, 2013, 2014 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTVALID_H__\n#define __FTVALID_H__\n\n#include <ft2build.h>\n#include FT_CONFIG_STANDARD_LIBRARY_H   /* for ft_setjmp and ft_longjmp */\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                    V A L I D A T I O N                          ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* handle to a validation object */\n  typedef struct FT_ValidatorRec_ volatile*  FT_Validator;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* There are three distinct validation levels defined here:              */\n  /*                                                                       */\n  /* FT_VALIDATE_DEFAULT ::                                                */\n  /*   A table that passes this validation level can be used reliably by   */\n  /*   FreeType.  It generally means that all offsets have been checked to */\n  /*   prevent out-of-bound reads, that array counts are correct, etc.     */\n  /*                                                                       */\n  /* FT_VALIDATE_TIGHT ::                                                  */\n  /*   A table that passes this validation level can be used reliably and  */\n  /*   doesn't contain invalid data.  For example, a charmap table that    */\n  /*   returns invalid glyph indices will not pass, even though it can     */\n  /*   be used with FreeType in default mode (the library will simply      */\n  /*   return an error later when trying to load the glyph).               */\n  /*                                                                       */\n  /*   It also checks that fields which must be a multiple of 2, 4, or 8,  */\n  /*   don't have incorrect values, etc.                                   */\n  /*                                                                       */\n  /* FT_VALIDATE_PARANOID ::                                               */\n  /*   Only for font debugging.  Checks that a table follows the           */\n  /*   specification by 100%.  Very few fonts will be able to pass this    */\n  /*   level anyway but it can be useful for certain tools like font       */\n  /*   editors/converters.                                                 */\n  /*                                                                       */\n  typedef enum  FT_ValidationLevel_\n  {\n    FT_VALIDATE_DEFAULT = 0,\n    FT_VALIDATE_TIGHT,\n    FT_VALIDATE_PARANOID\n\n  } FT_ValidationLevel;\n\n\n#if defined( _MSC_VER )      /* Visual C++ (and Intel C++) */\n  /* We disable the warning `structure was padded due to   */\n  /* __declspec(align())' in order to compile cleanly with */\n  /* the maximum level of warnings.                        */\n#pragma warning( push )\n#pragma warning( disable : 4324 )\n#endif /* _MSC_VER */\n\n  /* validator structure */\n  typedef struct  FT_ValidatorRec_\n  {\n    ft_jmp_buf          jump_buffer; /* used for exception handling      */\n\n    const FT_Byte*      base;        /* address of table in memory       */\n    const FT_Byte*      limit;       /* `base' + sizeof(table) in memory */\n    FT_ValidationLevel  level;       /* validation level                 */\n    FT_Error            error;       /* error returned. 0 means success  */\n\n  } FT_ValidatorRec;\n\n#if defined( _MSC_VER )\n#pragma warning( pop )\n#endif\n\n#define FT_VALIDATOR( x )  ( (FT_Validator)( x ) )\n\n\n  FT_BASE( void )\n  ft_validator_init( FT_Validator        valid,\n                     const FT_Byte*      base,\n                     const FT_Byte*      limit,\n                     FT_ValidationLevel  level );\n\n  /* Do not use this. It's broken and will cause your validator to crash */\n  /* if you run it on an invalid font.                                   */\n  FT_BASE( FT_Int )\n  ft_validator_run( FT_Validator  valid );\n\n  /* Sets the error field in a validator, then calls `longjmp' to return */\n  /* to high-level caller.  Using `setjmp/longjmp' avoids many stupid    */\n  /* error checks within the validation routines.                        */\n  /*                                                                     */\n  FT_BASE( void )\n  ft_validator_error( FT_Validator  valid,\n                      FT_Error      error );\n\n\n  /* Calls ft_validate_error.  Assumes that the `valid' local variable */\n  /* holds a pointer to the current validator object.                  */\n  /*                                                                   */\n#define FT_INVALID( _error )  FT_INVALID_( _error )\n#define FT_INVALID_( _error ) \\\n          ft_validator_error( valid, FT_THROW( _error ) )\n\n  /* called when a broken table is detected */\n#define FT_INVALID_TOO_SHORT \\\n          FT_INVALID( Invalid_Table )\n\n  /* called when an invalid offset is detected */\n#define FT_INVALID_OFFSET \\\n          FT_INVALID( Invalid_Offset )\n\n  /* called when an invalid format/value is detected */\n#define FT_INVALID_FORMAT \\\n          FT_INVALID( Invalid_Table )\n\n  /* called when an invalid glyph index is detected */\n#define FT_INVALID_GLYPH_ID \\\n          FT_INVALID( Invalid_Glyph_Index )\n\n  /* called when an invalid field value is detected */\n#define FT_INVALID_DATA \\\n          FT_INVALID( Invalid_Table )\n\n\nFT_END_HEADER\n\n#endif /* __FTVALID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/internal.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  internal.h                                                             */\n/*                                                                         */\n/*    Internal header files (specification only).                          */\n/*                                                                         */\n/*  Copyright 1996-2004, 2013 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is automatically included by `ft2build.h'.                  */\n  /* Do not include it manually!                                           */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#define FT_INTERNAL_OBJECTS_H             <internal/ftobjs.h>\n#define FT_INTERNAL_PIC_H                 <internal/ftpic.h>\n#define FT_INTERNAL_STREAM_H              <internal/ftstream.h>\n#define FT_INTERNAL_MEMORY_H              <internal/ftmemory.h>\n#define FT_INTERNAL_DEBUG_H               <internal/ftdebug.h>\n#define FT_INTERNAL_CALC_H                <internal/ftcalc.h>\n#define FT_INTERNAL_DRIVER_H              <internal/ftdriver.h>\n#define FT_INTERNAL_TRACE_H               <internal/fttrace.h>\n#define FT_INTERNAL_GLYPH_LOADER_H        <internal/ftgloadr.h>\n#define FT_INTERNAL_SFNT_H                <internal/sfnt.h>\n#define FT_INTERNAL_SERVICE_H             <internal/ftserv.h>\n#define FT_INTERNAL_RFORK_H               <internal/ftrfork.h>\n#define FT_INTERNAL_VALIDATE_H            <internal/ftvalid.h>\n\n#define FT_INTERNAL_TRUETYPE_TYPES_H      <internal/tttypes.h>\n#define FT_INTERNAL_TYPE1_TYPES_H         <internal/t1types.h>\n\n#define FT_INTERNAL_POSTSCRIPT_AUX_H      <internal/psaux.h>\n#define FT_INTERNAL_POSTSCRIPT_HINTS_H    <internal/pshints.h>\n#define FT_INTERNAL_POSTSCRIPT_GLOBALS_H  <internal/psglobal.h>\n\n#define FT_INTERNAL_AUTOHINT_H            <internal/autohint.h>\n\n\n#if defined( _MSC_VER )      /* Visual C++ (and Intel C++) */\n\n  /* We disable the warning `conditional expression is constant' here */\n  /* in order to compile cleanly with the maximum level of warnings.  */\n  /* In particular, the warning complains about stuff like `while(0)' */\n  /* which is very useful in macro definitions.  There is no benefit  */\n  /* in having it enabled.                                            */\n#pragma warning( disable : 4127 )\n\n#endif /* _MSC_VER */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/psaux.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  psaux.h                                                                */\n/*                                                                         */\n/*    Auxiliary functions and data structures related to PostScript fonts  */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006, 2008, 2009, 2012 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PSAUX_H__\n#define __PSAUX_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_TYPE1_TYPES_H\n#include FT_SERVICE_POSTSCRIPT_CMAPS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                             T1_TABLE                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  typedef struct PS_TableRec_*              PS_Table;\n  typedef const struct PS_Table_FuncsRec_*  PS_Table_Funcs;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_Table_FuncsRec                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A set of function pointers to manage PS_Table objects.             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    table_init    :: Used to initialize a table.                       */\n  /*                                                                       */\n  /*    table_done    :: Finalizes resp. destroy a given table.            */\n  /*                                                                       */\n  /*    table_add     :: Adds a new object to a table.                     */\n  /*                                                                       */\n  /*    table_release :: Releases table data, then finalizes it.           */\n  /*                                                                       */\n  typedef struct  PS_Table_FuncsRec_\n  {\n    FT_Error\n    (*init)( PS_Table   table,\n             FT_Int     count,\n             FT_Memory  memory );\n\n    void\n    (*done)( PS_Table  table );\n\n    FT_Error\n    (*add)( PS_Table    table,\n            FT_Int      idx,\n            void*       object,\n            FT_PtrDist  length );\n\n    void\n    (*release)( PS_Table  table );\n\n  } PS_Table_FuncsRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_TableRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A PS_Table is a simple object used to store an array of objects in */\n  /*    a single memory block.                                             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    block     :: The address in memory of the growheap's block.  This  */\n  /*                 can change between two object adds, due to            */\n  /*                 reallocation.                                         */\n  /*                                                                       */\n  /*    cursor    :: The current top of the grow heap within its block.    */\n  /*                                                                       */\n  /*    capacity  :: The current size of the heap block.  Increments by    */\n  /*                 1kByte chunks.                                        */\n  /*                                                                       */\n  /*    init      :: Set to 0xDEADBEEF if `elements' and `lengths' have    */\n  /*                 been allocated.                                       */\n  /*                                                                       */\n  /*    max_elems :: The maximum number of elements in table.              */\n  /*                                                                       */\n  /*    num_elems :: The current number of elements in table.              */\n  /*                                                                       */\n  /*    elements  :: A table of element addresses within the block.        */\n  /*                                                                       */\n  /*    lengths   :: A table of element sizes within the block.            */\n  /*                                                                       */\n  /*    memory    :: The object used for memory operations                 */\n  /*                 (alloc/realloc).                                      */\n  /*                                                                       */\n  /*    funcs     :: A table of method pointers for this object.           */\n  /*                                                                       */\n  typedef struct  PS_TableRec_\n  {\n    FT_Byte*           block;          /* current memory block           */\n    FT_Offset          cursor;         /* current cursor in memory block */\n    FT_Offset          capacity;       /* current size of memory block   */\n    FT_Long            init;\n\n    FT_Int             max_elems;\n    FT_Int             num_elems;\n    FT_Byte**          elements;       /* addresses of table elements */\n    FT_PtrDist*        lengths;        /* lengths of table elements   */\n\n    FT_Memory          memory;\n    PS_Table_FuncsRec  funcs;\n\n  } PS_TableRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       T1 FIELDS & TOKENS                      *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct PS_ParserRec_*  PS_Parser;\n\n  typedef struct T1_TokenRec_*   T1_Token;\n\n  typedef struct T1_FieldRec_*   T1_Field;\n\n\n  /* simple enumeration type used to identify token types */\n  typedef enum  T1_TokenType_\n  {\n    T1_TOKEN_TYPE_NONE = 0,\n    T1_TOKEN_TYPE_ANY,\n    T1_TOKEN_TYPE_STRING,\n    T1_TOKEN_TYPE_ARRAY,\n    T1_TOKEN_TYPE_KEY, /* aka `name' */\n\n    /* do not remove */\n    T1_TOKEN_TYPE_MAX\n\n  } T1_TokenType;\n\n\n  /* a simple structure used to identify tokens */\n  typedef struct  T1_TokenRec_\n  {\n    FT_Byte*      start;   /* first character of token in input stream */\n    FT_Byte*      limit;   /* first character after the token          */\n    T1_TokenType  type;    /* type of token                            */\n\n  } T1_TokenRec;\n\n\n  /* enumeration type used to identify object fields */\n  typedef enum  T1_FieldType_\n  {\n    T1_FIELD_TYPE_NONE = 0,\n    T1_FIELD_TYPE_BOOL,\n    T1_FIELD_TYPE_INTEGER,\n    T1_FIELD_TYPE_FIXED,\n    T1_FIELD_TYPE_FIXED_1000,\n    T1_FIELD_TYPE_STRING,\n    T1_FIELD_TYPE_KEY,\n    T1_FIELD_TYPE_BBOX,\n    T1_FIELD_TYPE_MM_BBOX,\n    T1_FIELD_TYPE_INTEGER_ARRAY,\n    T1_FIELD_TYPE_FIXED_ARRAY,\n    T1_FIELD_TYPE_CALLBACK,\n\n    /* do not remove */\n    T1_FIELD_TYPE_MAX\n\n  } T1_FieldType;\n\n\n  typedef enum  T1_FieldLocation_\n  {\n    T1_FIELD_LOCATION_CID_INFO,\n    T1_FIELD_LOCATION_FONT_DICT,\n    T1_FIELD_LOCATION_FONT_EXTRA,\n    T1_FIELD_LOCATION_FONT_INFO,\n    T1_FIELD_LOCATION_PRIVATE,\n    T1_FIELD_LOCATION_BBOX,\n    T1_FIELD_LOCATION_LOADER,\n    T1_FIELD_LOCATION_FACE,\n    T1_FIELD_LOCATION_BLEND,\n\n    /* do not remove */\n    T1_FIELD_LOCATION_MAX\n\n  } T1_FieldLocation;\n\n\n  typedef void\n  (*T1_Field_ParseFunc)( FT_Face     face,\n                         FT_Pointer  parser );\n\n\n  /* structure type used to model object fields */\n  typedef struct  T1_FieldRec_\n  {\n    const char*         ident;        /* field identifier               */\n    T1_FieldLocation    location;\n    T1_FieldType        type;         /* type of field                  */\n    T1_Field_ParseFunc  reader;\n    FT_UInt             offset;       /* offset of field in object      */\n    FT_Byte             size;         /* size of field in bytes         */\n    FT_UInt             array_max;    /* maximum number of elements for */\n                                      /* array                          */\n    FT_UInt             count_offset; /* offset of element count for    */\n                                      /* arrays; must not be zero if in */\n                                      /* use -- in other words, a       */\n                                      /* `num_FOO' element must not     */\n                                      /* start the used structure if we */\n                                      /* parse a `FOO' array            */\n    FT_UInt             dict;         /* where we expect it             */\n  } T1_FieldRec;\n\n#define T1_FIELD_DICT_FONTDICT ( 1 << 0 ) /* also FontInfo and FDArray */\n#define T1_FIELD_DICT_PRIVATE  ( 1 << 1 )\n\n\n\n#define T1_NEW_SIMPLE_FIELD( _ident, _type, _fname, _dict ) \\\n          {                                                 \\\n            _ident, T1CODE, _type,                          \\\n            0,                                              \\\n            FT_FIELD_OFFSET( _fname ),                      \\\n            FT_FIELD_SIZE( _fname ),                        \\\n            0, 0,                                           \\\n            _dict                                           \\\n          },\n\n#define T1_NEW_CALLBACK_FIELD( _ident, _reader, _dict ) \\\n          {                                             \\\n            _ident, T1CODE, T1_FIELD_TYPE_CALLBACK,     \\\n            (T1_Field_ParseFunc)_reader,                \\\n            0, 0,                                       \\\n            0, 0,                                       \\\n            _dict                                       \\\n          },\n\n#define T1_NEW_TABLE_FIELD( _ident, _type, _fname, _max, _dict ) \\\n          {                                                      \\\n            _ident, T1CODE, _type,                               \\\n            0,                                                   \\\n            FT_FIELD_OFFSET( _fname ),                           \\\n            FT_FIELD_SIZE_DELTA( _fname ),                       \\\n            _max,                                                \\\n            FT_FIELD_OFFSET( num_ ## _fname ),                   \\\n            _dict                                                \\\n          },\n\n#define T1_NEW_TABLE_FIELD2( _ident, _type, _fname, _max, _dict ) \\\n          {                                                       \\\n            _ident, T1CODE, _type,                                \\\n            0,                                                    \\\n            FT_FIELD_OFFSET( _fname ),                            \\\n            FT_FIELD_SIZE_DELTA( _fname ),                        \\\n            _max, 0,                                              \\\n            _dict                                                 \\\n          },\n\n\n#define T1_FIELD_BOOL( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BOOL, _fname, _dict )\n\n#define T1_FIELD_NUM( _ident, _fname, _dict )                                 \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER, _fname, _dict )\n\n#define T1_FIELD_FIXED( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED, _fname, _dict )\n\n#define T1_FIELD_FIXED_1000( _ident, _fname, _dict )                     \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_1000, _fname, \\\n                               _dict )\n\n#define T1_FIELD_STRING( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_STRING, _fname, _dict )\n\n#define T1_FIELD_KEY( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_KEY, _fname, _dict )\n\n#define T1_FIELD_BBOX( _ident, _fname, _dict )                             \\\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BBOX, _fname, _dict )\n\n\n#define T1_FIELD_NUM_TABLE( _ident, _fname, _fmax, _dict )         \\\n          T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \\\n                              _fname, _fmax, _dict )\n\n#define T1_FIELD_FIXED_TABLE( _ident, _fname, _fmax, _dict )     \\\n          T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \\\n                              _fname, _fmax, _dict )\n\n#define T1_FIELD_NUM_TABLE2( _ident, _fname, _fmax, _dict )         \\\n          T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \\\n                               _fname, _fmax, _dict )\n\n#define T1_FIELD_FIXED_TABLE2( _ident, _fname, _fmax, _dict )     \\\n          T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \\\n                               _fname, _fmax, _dict )\n\n#define T1_FIELD_CALLBACK( _ident, _name, _dict )       \\\n          T1_NEW_CALLBACK_FIELD( _ident, _name, _dict )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                            T1 PARSER                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef const struct PS_Parser_FuncsRec_*  PS_Parser_Funcs;\n\n  typedef struct  PS_Parser_FuncsRec_\n  {\n    void\n    (*init)( PS_Parser  parser,\n             FT_Byte*   base,\n             FT_Byte*   limit,\n             FT_Memory  memory );\n\n    void\n    (*done)( PS_Parser  parser );\n\n    void\n    (*skip_spaces)( PS_Parser  parser );\n    void\n    (*skip_PS_token)( PS_Parser  parser );\n\n    FT_Long\n    (*to_int)( PS_Parser  parser );\n    FT_Fixed\n    (*to_fixed)( PS_Parser  parser,\n                 FT_Int     power_ten );\n\n    FT_Error\n    (*to_bytes)( PS_Parser  parser,\n                 FT_Byte*   bytes,\n                 FT_Offset  max_bytes,\n                 FT_Long*   pnum_bytes,\n                 FT_Bool    delimiters );\n\n    FT_Int\n    (*to_coord_array)( PS_Parser  parser,\n                       FT_Int     max_coords,\n                       FT_Short*  coords );\n    FT_Int\n    (*to_fixed_array)( PS_Parser  parser,\n                       FT_Int     max_values,\n                       FT_Fixed*  values,\n                       FT_Int     power_ten );\n\n    void\n    (*to_token)( PS_Parser  parser,\n                 T1_Token   token );\n    void\n    (*to_token_array)( PS_Parser  parser,\n                       T1_Token   tokens,\n                       FT_UInt    max_tokens,\n                       FT_Int*    pnum_tokens );\n\n    FT_Error\n    (*load_field)( PS_Parser       parser,\n                   const T1_Field  field,\n                   void**          objects,\n                   FT_UInt         max_objects,\n                   FT_ULong*       pflags );\n\n    FT_Error\n    (*load_field_table)( PS_Parser       parser,\n                         const T1_Field  field,\n                         void**          objects,\n                         FT_UInt         max_objects,\n                         FT_ULong*       pflags );\n\n  } PS_Parser_FuncsRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_ParserRec                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A PS_Parser is an object used to parse a Type 1 font very quickly. */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    cursor :: The current position in the text.                        */\n  /*                                                                       */\n  /*    base   :: Start of the processed text.                             */\n  /*                                                                       */\n  /*    limit  :: End of the processed text.                               */\n  /*                                                                       */\n  /*    error  :: The last error returned.                                 */\n  /*                                                                       */\n  /*    memory :: The object used for memory operations (alloc/realloc).   */\n  /*                                                                       */\n  /*    funcs  :: A table of functions for the parser.                     */\n  /*                                                                       */\n  typedef struct  PS_ParserRec_\n  {\n    FT_Byte*   cursor;\n    FT_Byte*   base;\n    FT_Byte*   limit;\n    FT_Error   error;\n    FT_Memory  memory;\n\n    PS_Parser_FuncsRec  funcs;\n\n  } PS_ParserRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         T1 BUILDER                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  typedef struct T1_BuilderRec_*  T1_Builder;\n\n\n  typedef FT_Error\n  (*T1_Builder_Check_Points_Func)( T1_Builder  builder,\n                                   FT_Int      count );\n\n  typedef void\n  (*T1_Builder_Add_Point_Func)( T1_Builder  builder,\n                                FT_Pos      x,\n                                FT_Pos      y,\n                                FT_Byte     flag );\n\n  typedef FT_Error\n  (*T1_Builder_Add_Point1_Func)( T1_Builder  builder,\n                                 FT_Pos      x,\n                                 FT_Pos      y );\n\n  typedef FT_Error\n  (*T1_Builder_Add_Contour_Func)( T1_Builder  builder );\n\n  typedef FT_Error\n  (*T1_Builder_Start_Point_Func)( T1_Builder  builder,\n                                  FT_Pos      x,\n                                  FT_Pos      y );\n\n  typedef void\n  (*T1_Builder_Close_Contour_Func)( T1_Builder  builder );\n\n\n  typedef const struct T1_Builder_FuncsRec_*  T1_Builder_Funcs;\n\n  typedef struct  T1_Builder_FuncsRec_\n  {\n    void\n    (*init)( T1_Builder    builder,\n             FT_Face       face,\n             FT_Size       size,\n             FT_GlyphSlot  slot,\n             FT_Bool       hinting );\n\n    void\n    (*done)( T1_Builder   builder );\n\n    T1_Builder_Check_Points_Func   check_points;\n    T1_Builder_Add_Point_Func      add_point;\n    T1_Builder_Add_Point1_Func     add_point1;\n    T1_Builder_Add_Contour_Func    add_contour;\n    T1_Builder_Start_Point_Func    start_point;\n    T1_Builder_Close_Contour_Func  close_contour;\n\n  } T1_Builder_FuncsRec;\n\n\n  /* an enumeration type to handle charstring parsing states */\n  typedef enum  T1_ParseState_\n  {\n    T1_Parse_Start,\n    T1_Parse_Have_Width,\n    T1_Parse_Have_Moveto,\n    T1_Parse_Have_Path\n\n  } T1_ParseState;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Structure>                                                           */\n  /*    T1_BuilderRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*     A structure used during glyph loading to store its outline.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    memory       :: The current memory object.                         */\n  /*                                                                       */\n  /*    face         :: The current face object.                           */\n  /*                                                                       */\n  /*    glyph        :: The current glyph slot.                            */\n  /*                                                                       */\n  /*    loader       :: XXX                                                */\n  /*                                                                       */\n  /*    base         :: The base glyph outline.                            */\n  /*                                                                       */\n  /*    current      :: The current glyph outline.                         */\n  /*                                                                       */\n  /*    max_points   :: maximum points in builder outline                  */\n  /*                                                                       */\n  /*    max_contours :: Maximum number of contours in builder outline.     */\n  /*                                                                       */\n  /*    pos_x        :: The horizontal translation (if composite glyph).   */\n  /*                                                                       */\n  /*    pos_y        :: The vertical translation (if composite glyph).     */\n  /*                                                                       */\n  /*    left_bearing :: The left side bearing point.                       */\n  /*                                                                       */\n  /*    advance      :: The horizontal advance vector.                     */\n  /*                                                                       */\n  /*    bbox         :: Unused.                                            */\n  /*                                                                       */\n  /*    parse_state  :: An enumeration which controls the charstring       */\n  /*                    parsing state.                                     */\n  /*                                                                       */\n  /*    load_points  :: If this flag is not set, no points are loaded.     */\n  /*                                                                       */\n  /*    no_recurse   :: Set but not used.                                  */\n  /*                                                                       */\n  /*    metrics_only :: A boolean indicating that we only want to compute  */\n  /*                    the metrics of a given glyph, not load all of its  */\n  /*                    points.                                            */\n  /*                                                                       */\n  /*    funcs        :: An array of function pointers for the builder.     */\n  /*                                                                       */\n  typedef struct  T1_BuilderRec_\n  {\n    FT_Memory       memory;\n    FT_Face         face;\n    FT_GlyphSlot    glyph;\n    FT_GlyphLoader  loader;\n    FT_Outline*     base;\n    FT_Outline*     current;\n\n    FT_Pos          pos_x;\n    FT_Pos          pos_y;\n\n    FT_Vector       left_bearing;\n    FT_Vector       advance;\n\n    FT_BBox         bbox;          /* bounding box */\n    T1_ParseState   parse_state;\n    FT_Bool         load_points;\n    FT_Bool         no_recurse;\n\n    FT_Bool         metrics_only;\n\n    void*           hints_funcs;    /* hinter-specific */\n    void*           hints_globals;  /* hinter-specific */\n\n    T1_Builder_FuncsRec  funcs;\n\n  } T1_BuilderRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         T1 DECODER                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine   */\n  /* calls during glyph loading.                                           */\n  /*                                                                       */\n#define T1_MAX_SUBRS_CALLS  8\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity.  A     */\n  /* minimum of 16 is required.                                            */\n  /*                                                                       */\n#define T1_MAX_CHARSTRINGS_OPERANDS  32\n\n#endif /* 0 */\n\n\n  typedef struct  T1_Decoder_ZoneRec_\n  {\n    FT_Byte*  cursor;\n    FT_Byte*  base;\n    FT_Byte*  limit;\n\n  } T1_Decoder_ZoneRec, *T1_Decoder_Zone;\n\n\n  typedef struct T1_DecoderRec_*              T1_Decoder;\n  typedef const struct T1_Decoder_FuncsRec_*  T1_Decoder_Funcs;\n\n\n  typedef FT_Error\n  (*T1_Decoder_Callback)( T1_Decoder  decoder,\n                          FT_UInt     glyph_index );\n\n\n  typedef struct  T1_Decoder_FuncsRec_\n  {\n    FT_Error\n    (*init)( T1_Decoder           decoder,\n             FT_Face              face,\n             FT_Size              size,\n             FT_GlyphSlot         slot,\n             FT_Byte**            glyph_names,\n             PS_Blend             blend,\n             FT_Bool              hinting,\n             FT_Render_Mode       hint_mode,\n             T1_Decoder_Callback  callback );\n\n    void\n    (*done)( T1_Decoder  decoder );\n\n    FT_Error\n    (*parse_charstrings)( T1_Decoder  decoder,\n                          FT_Byte*    base,\n                          FT_UInt     len );\n\n  } T1_Decoder_FuncsRec;\n\n\n  typedef struct  T1_DecoderRec_\n  {\n    T1_BuilderRec        builder;\n\n    FT_Long              stack[T1_MAX_CHARSTRINGS_OPERANDS];\n    FT_Long*             top;\n\n    T1_Decoder_ZoneRec   zones[T1_MAX_SUBRS_CALLS + 1];\n    T1_Decoder_Zone      zone;\n\n    FT_Service_PsCMaps   psnames;      /* for seac */\n    FT_UInt              num_glyphs;\n    FT_Byte**            glyph_names;\n\n    FT_Int               lenIV;        /* internal for sub routine calls */\n    FT_UInt              num_subrs;\n    FT_Byte**            subrs;\n    FT_PtrDist*          subrs_len;    /* array of subrs length (optional) */\n\n    FT_Matrix            font_matrix;\n    FT_Vector            font_offset;\n\n    FT_Int               flex_state;\n    FT_Int               num_flex_vectors;\n    FT_Vector            flex_vectors[7];\n\n    PS_Blend             blend;       /* for multiple master support */\n\n    FT_Render_Mode       hint_mode;\n\n    T1_Decoder_Callback  parse_callback;\n    T1_Decoder_FuncsRec  funcs;\n\n    FT_Long*             buildchar;\n    FT_UInt              len_buildchar;\n\n    FT_Bool              seac;\n\n  } T1_DecoderRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                            AFM PARSER                         *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct AFM_ParserRec_*  AFM_Parser;\n\n  typedef struct  AFM_Parser_FuncsRec_\n  {\n    FT_Error\n    (*init)( AFM_Parser  parser,\n             FT_Memory   memory,\n             FT_Byte*    base,\n             FT_Byte*    limit );\n\n    void\n    (*done)( AFM_Parser  parser );\n\n    FT_Error\n    (*parse)( AFM_Parser  parser );\n\n  } AFM_Parser_FuncsRec;\n\n\n  typedef struct AFM_StreamRec_*  AFM_Stream;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    AFM_ParserRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An AFM_Parser is a parser for the AFM files.                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    memory    :: The object used for memory operations (alloc and      */\n  /*                 realloc).                                             */\n  /*                                                                       */\n  /*    stream    :: This is an opaque object.                             */\n  /*                                                                       */\n  /*    FontInfo  :: The result will be stored here.                       */\n  /*                                                                       */\n  /*    get_index :: A user provided function to get a glyph index by its  */\n  /*                 name.                                                 */\n  /*                                                                       */\n  typedef struct  AFM_ParserRec_\n  {\n    FT_Memory     memory;\n    AFM_Stream    stream;\n\n    AFM_FontInfo  FontInfo;\n\n    FT_Int\n    (*get_index)( const char*  name,\n                  FT_Offset    len,\n                  void*        user_data );\n\n    void*         user_data;\n\n  } AFM_ParserRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                     TYPE1 CHARMAPS                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef const struct T1_CMap_ClassesRec_*  T1_CMap_Classes;\n\n  typedef struct T1_CMap_ClassesRec_\n  {\n    FT_CMap_Class  standard;\n    FT_CMap_Class  expert;\n    FT_CMap_Class  custom;\n    FT_CMap_Class  unicode;\n\n  } T1_CMap_ClassesRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                        PSAux Module Interface                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct  PSAux_ServiceRec_\n  {\n    /* don't use `PS_Table_Funcs' and friends to avoid compiler warnings */\n    const PS_Table_FuncsRec*    ps_table_funcs;\n    const PS_Parser_FuncsRec*   ps_parser_funcs;\n    const T1_Builder_FuncsRec*  t1_builder_funcs;\n    const T1_Decoder_FuncsRec*  t1_decoder_funcs;\n\n    void\n    (*t1_decrypt)( FT_Byte*   buffer,\n                   FT_Offset  length,\n                   FT_UShort  seed );\n\n    T1_CMap_Classes  t1_cmap_classes;\n\n    /* fields after this comment line were added after version 2.1.10 */\n    const AFM_Parser_FuncsRec*  afm_parser_funcs;\n\n  } PSAux_ServiceRec, *PSAux_Service;\n\n  /* backwards-compatible type definition */\n  typedef PSAux_ServiceRec   PSAux_Interface;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                 Some convenience functions                    *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#define IS_PS_NEWLINE( ch ) \\\n  ( (ch) == '\\r' ||         \\\n    (ch) == '\\n' )\n\n#define IS_PS_SPACE( ch )  \\\n  ( (ch) == ' '         || \\\n    IS_PS_NEWLINE( ch ) || \\\n    (ch) == '\\t'        || \\\n    (ch) == '\\f'        || \\\n    (ch) == '\\0' )\n\n#define IS_PS_SPECIAL( ch )       \\\n  ( (ch) == '/'                || \\\n    (ch) == '(' || (ch) == ')' || \\\n    (ch) == '<' || (ch) == '>' || \\\n    (ch) == '[' || (ch) == ']' || \\\n    (ch) == '{' || (ch) == '}' || \\\n    (ch) == '%'                )\n\n#define IS_PS_DELIM( ch )  \\\n  ( IS_PS_SPACE( ch )   || \\\n    IS_PS_SPECIAL( ch ) )\n\n#define IS_PS_DIGIT( ch )        \\\n  ( (ch) >= '0' && (ch) <= '9' )\n\n#define IS_PS_XDIGIT( ch )            \\\n  ( IS_PS_DIGIT( ch )              || \\\n    ( (ch) >= 'A' && (ch) <= 'F' ) || \\\n    ( (ch) >= 'a' && (ch) <= 'f' ) )\n\n#define IS_PS_BASE85( ch )       \\\n  ( (ch) >= '!' && (ch) <= 'u' )\n\n#define IS_PS_TOKEN( cur, limit, token )                                \\\n  ( (char)(cur)[0] == (token)[0]                                     && \\\n    ( (cur) + sizeof ( (token) ) == (limit) ||                          \\\n      ( (cur) + sizeof( (token) ) < (limit)          &&                 \\\n        IS_PS_DELIM( (cur)[sizeof ( (token) ) - 1] ) ) )             && \\\n    ft_strncmp( (char*)(cur), (token), sizeof ( (token) ) - 1 ) == 0 )\n\n\nFT_END_HEADER\n\n#endif /* __PSAUX_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/pshints.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pshints.h                                                              */\n/*                                                                         */\n/*    Interface to Postscript-specific (Type 1 and Type 2) hints           */\n/*    recorders (specification only).  These are used to support native    */\n/*    T1/T2 hints in the `type1', `cid', and `cff' font drivers.           */\n/*                                                                         */\n/*  Copyright 2001-2003, 2005-2007, 2009, 2012, 2014 by                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PSHINTS_H__\n#define __PSHINTS_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_TYPE1_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****               INTERNAL REPRESENTATION OF GLOBALS              *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct PSH_GlobalsRec_*  PSH_Globals;\n\n  typedef FT_Error\n  (*PSH_Globals_NewFunc)( FT_Memory     memory,\n                          T1_Private*   private_dict,\n                          PSH_Globals*  aglobals );\n\n  typedef void\n  (*PSH_Globals_SetScaleFunc)( PSH_Globals  globals,\n                               FT_Fixed     x_scale,\n                               FT_Fixed     y_scale,\n                               FT_Fixed     x_delta,\n                               FT_Fixed     y_delta );\n\n  typedef void\n  (*PSH_Globals_DestroyFunc)( PSH_Globals  globals );\n\n\n  typedef struct  PSH_Globals_FuncsRec_\n  {\n    PSH_Globals_NewFunc       create;\n    PSH_Globals_SetScaleFunc  set_scale;\n    PSH_Globals_DestroyFunc   destroy;\n\n  } PSH_Globals_FuncsRec, *PSH_Globals_Funcs;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                  PUBLIC TYPE 1 HINTS RECORDER                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************\n   *\n   * @type:\n   *   T1_Hints\n   *\n   * @description:\n   *   This is a handle to an opaque structure used to record glyph hints\n   *   from a Type 1 character glyph character string.\n   *\n   *   The methods used to operate on this object are defined by the\n   *   @T1_Hints_FuncsRec structure.  Recording glyph hints is normally\n   *   achieved through the following scheme:\n   *\n   *   - Open a new hint recording session by calling the `open' method.\n   *     This rewinds the recorder and prepare it for new input.\n   *\n   *   - For each hint found in the glyph charstring, call the corresponding\n   *     method (`stem', `stem3', or `reset').  Note that these functions do\n   *     not return an error code.\n   *\n   *   - Close the recording session by calling the `close' method.  It\n   *     returns an error code if the hints were invalid or something\n   *     strange happened (e.g., memory shortage).\n   *\n   *   The hints accumulated in the object can later be used by the\n   *   PostScript hinter.\n   *\n   */\n  typedef struct T1_HintsRec_*  T1_Hints;\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   T1_Hints_Funcs\n   *\n   * @description:\n   *   A pointer to the @T1_Hints_FuncsRec structure that defines the API of\n   *   a given @T1_Hints object.\n   *\n   */\n  typedef const struct T1_Hints_FuncsRec_*  T1_Hints_Funcs;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_OpenFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to prepare it for a new Type 1\n   *   hints recording session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   * @note:\n   *   You should always call the @T1_Hints_CloseFunc method in order to\n   *   close an opened recording session.\n   *\n   */\n  typedef void\n  (*T1_Hints_OpenFunc)( T1_Hints  hints );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_SetStemFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to record a new horizontal or\n   *   vertical stem.  This corresponds to the Type 1 `hstem' and `vstem'\n   *   operators.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   dimension ::\n   *     0 for horizontal stems (hstem), 1 for vertical ones (vstem).\n   *\n   *   coords ::\n   *     Array of 2 coordinates in 16.16 format, used as (position,length)\n   *     stem descriptor.\n   *\n   * @note:\n   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use\n   *   horizontal coordinates (x) for vertical stems (dim=1).\n   *\n   *   `coords[0]' is the absolute stem position (lowest coordinate);\n   *   `coords[1]' is the length.\n   *\n   *   The length can be negative, in which case it must be either -20 or\n   *   -21.  It is interpreted as a `ghost' stem, according to the Type 1\n   *   specification.\n   *\n   *   If the length is -21 (corresponding to a bottom ghost stem), then\n   *   the real stem position is `coords[0]+coords[1]'.\n   *\n   */\n  typedef void\n  (*T1_Hints_SetStemFunc)( T1_Hints   hints,\n                           FT_UInt    dimension,\n                           FT_Fixed*  coords );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_SetStem3Func\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to record three\n   *   counter-controlled horizontal or vertical stems at once.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   dimension ::\n   *     0 for horizontal stems, 1 for vertical ones.\n   *\n   *   coords ::\n   *     An array of 6 values in 16.16 format, holding 3 (position,length)\n   *     pairs for the counter-controlled stems.\n   *\n   * @note:\n   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use\n   *   horizontal coordinates (x) for vertical stems (dim=1).\n   *\n   *   The lengths cannot be negative (ghost stems are never\n   *   counter-controlled).\n   *\n   */\n  typedef void\n  (*T1_Hints_SetStem3Func)( T1_Hints   hints,\n                            FT_UInt    dimension,\n                            FT_Fixed*  coords );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_ResetFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to reset the stems hints in a\n   *   recording session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   end_point ::\n   *     The index of the last point in the input glyph in which the\n   *     previously defined hints apply.\n   *\n   */\n  typedef void\n  (*T1_Hints_ResetFunc)( T1_Hints  hints,\n                         FT_UInt   end_point );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_CloseFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to close a hint recording\n   *   session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   end_point ::\n   *     The index of the last point in the input glyph.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   The error code is set to indicate that an error occurred during the\n   *   recording session.\n   *\n   */\n  typedef FT_Error\n  (*T1_Hints_CloseFunc)( T1_Hints  hints,\n                         FT_UInt   end_point );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T1_Hints_ApplyFunc\n   *\n   * @description:\n   *   A method of the @T1_Hints class used to apply hints to the\n   *   corresponding glyph outline.  Must be called once all hints have been\n   *   recorded.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 1 hints recorder.\n   *\n   *   outline ::\n   *     A pointer to the target outline descriptor.\n   *\n   *   globals ::\n   *     The hinter globals for this font.\n   *\n   *   hint_mode ::\n   *     Hinting information.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   On input, all points within the outline are in font coordinates. On\n   *   output, they are in 1/64th of pixels.\n   *\n   *   The scaling transformation is taken from the `globals' object which\n   *   must correspond to the same font as the glyph.\n   *\n   */\n  typedef FT_Error\n  (*T1_Hints_ApplyFunc)( T1_Hints        hints,\n                         FT_Outline*     outline,\n                         PSH_Globals     globals,\n                         FT_Render_Mode  hint_mode );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   T1_Hints_FuncsRec\n   *\n   * @description:\n   *   The structure used to provide the API to @T1_Hints objects.\n   *\n   * @fields:\n   *   hints ::\n   *     A handle to the T1 Hints recorder.\n   *\n   *   open ::\n   *     The function to open a recording session.\n   *\n   *   close ::\n   *     The function to close a recording session.\n   *\n   *   stem ::\n   *     The function to set a simple stem.\n   *\n   *   stem3 ::\n   *     The function to set counter-controlled stems.\n   *\n   *   reset ::\n   *     The function to reset stem hints.\n   *\n   *   apply ::\n   *     The function to apply the hints to the corresponding glyph outline.\n   *\n   */\n  typedef struct  T1_Hints_FuncsRec_\n  {\n    T1_Hints               hints;\n    T1_Hints_OpenFunc      open;\n    T1_Hints_CloseFunc     close;\n    T1_Hints_SetStemFunc   stem;\n    T1_Hints_SetStem3Func  stem3;\n    T1_Hints_ResetFunc     reset;\n    T1_Hints_ApplyFunc     apply;\n\n  } T1_Hints_FuncsRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                  PUBLIC TYPE 2 HINTS RECORDER                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************\n   *\n   * @type:\n   *   T2_Hints\n   *\n   * @description:\n   *   This is a handle to an opaque structure used to record glyph hints\n   *   from a Type 2 character glyph character string.\n   *\n   *   The methods used to operate on this object are defined by the\n   *   @T2_Hints_FuncsRec structure.  Recording glyph hints is normally\n   *   achieved through the following scheme:\n   *\n   *   - Open a new hint recording session by calling the `open' method.\n   *     This rewinds the recorder and prepare it for new input.\n   *\n   *   - For each hint found in the glyph charstring, call the corresponding\n   *     method (`stems', `hintmask', `counters').  Note that these\n   *     functions do not return an error code.\n   *\n   *   - Close the recording session by calling the `close' method.  It\n   *     returns an error code if the hints were invalid or something\n   *     strange happened (e.g., memory shortage).\n   *\n   *   The hints accumulated in the object can later be used by the\n   *   Postscript hinter.\n   *\n   */\n  typedef struct T2_HintsRec_*  T2_Hints;\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   T2_Hints_Funcs\n   *\n   * @description:\n   *   A pointer to the @T2_Hints_FuncsRec structure that defines the API of\n   *   a given @T2_Hints object.\n   *\n   */\n  typedef const struct T2_Hints_FuncsRec_*  T2_Hints_Funcs;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_OpenFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to prepare it for a new Type 2\n   *   hints recording session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   * @note:\n   *   You should always call the @T2_Hints_CloseFunc method in order to\n   *   close an opened recording session.\n   *\n   */\n  typedef void\n  (*T2_Hints_OpenFunc)( T2_Hints  hints );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_StemsFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to set the table of stems in\n   *   either the vertical or horizontal dimension.  Equivalent to the\n   *   `hstem', `vstem', `hstemhm', and `vstemhm' Type 2 operators.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   dimension ::\n   *     0 for horizontal stems (hstem), 1 for vertical ones (vstem).\n   *\n   *   count ::\n   *     The number of stems.\n   *\n   *   coords ::\n   *     An array of `count' (position,length) pairs in 16.16 format.\n   *\n   * @note:\n   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use\n   *   horizontal coordinates (x) for vertical stems (dim=1).\n   *\n   *   There are `2*count' elements in the `coords' array.  Each even\n   *   element is an absolute position in font units, each odd element is a\n   *   length in font units.\n   *\n   *   A length can be negative, in which case it must be either -20 or\n   *   -21.  It is interpreted as a `ghost' stem, according to the Type 1\n   *   specification.\n   *\n   */\n  typedef void\n  (*T2_Hints_StemsFunc)( T2_Hints   hints,\n                         FT_UInt    dimension,\n                         FT_UInt    count,\n                         FT_Fixed*  coordinates );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_MaskFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to set a given hintmask (this\n   *   corresponds to the `hintmask' Type 2 operator).\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   end_point ::\n   *     The glyph index of the last point to which the previously defined\n   *     or activated hints apply.\n   *\n   *   bit_count ::\n   *     The number of bits in the hint mask.\n   *\n   *   bytes ::\n   *     An array of bytes modelling the hint mask.\n   *\n   * @note:\n   *   If the hintmask starts the charstring (before any glyph point\n   *   definition), the value of `end_point' should be 0.\n   *\n   *   `bit_count' is the number of meaningful bits in the `bytes' array; it\n   *   must be equal to the total number of hints defined so far (i.e.,\n   *   horizontal+verticals).\n   *\n   *   The `bytes' array can come directly from the Type 2 charstring and\n   *   respects the same format.\n   *\n   */\n  typedef void\n  (*T2_Hints_MaskFunc)( T2_Hints        hints,\n                        FT_UInt         end_point,\n                        FT_UInt         bit_count,\n                        const FT_Byte*  bytes );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_CounterFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to set a given counter mask\n   *   (this corresponds to the `hintmask' Type 2 operator).\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   end_point ::\n   *     A glyph index of the last point to which the previously defined or\n   *     active hints apply.\n   *\n   *   bit_count ::\n   *     The number of bits in the hint mask.\n   *\n   *   bytes ::\n   *     An array of bytes modelling the hint mask.\n   *\n   * @note:\n   *   If the hintmask starts the charstring (before any glyph point\n   *   definition), the value of `end_point' should be 0.\n   *\n   *   `bit_count' is the number of meaningful bits in the `bytes' array; it\n   *   must be equal to the total number of hints defined so far (i.e.,\n   *   horizontal+verticals).\n   *\n   *    The `bytes' array can come directly from the Type 2 charstring and\n   *    respects the same format.\n   *\n   */\n  typedef void\n  (*T2_Hints_CounterFunc)( T2_Hints        hints,\n                           FT_UInt         bit_count,\n                           const FT_Byte*  bytes );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_CloseFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to close a hint recording\n   *   session.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   end_point ::\n   *     The index of the last point in the input glyph.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   The error code is set to indicate that an error occurred during the\n   *   recording session.\n   *\n   */\n  typedef FT_Error\n  (*T2_Hints_CloseFunc)( T2_Hints  hints,\n                         FT_UInt   end_point );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   T2_Hints_ApplyFunc\n   *\n   * @description:\n   *   A method of the @T2_Hints class used to apply hints to the\n   *   corresponding glyph outline.  Must be called after the `close'\n   *   method.\n   *\n   * @input:\n   *   hints ::\n   *     A handle to the Type 2 hints recorder.\n   *\n   *   outline ::\n   *     A pointer to the target outline descriptor.\n   *\n   *   globals ::\n   *     The hinter globals for this font.\n   *\n   *   hint_mode ::\n   *     Hinting information.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   On input, all points within the outline are in font coordinates. On\n   *   output, they are in 1/64th of pixels.\n   *\n   *   The scaling transformation is taken from the `globals' object which\n   *   must correspond to the same font than the glyph.\n   *\n   */\n  typedef FT_Error\n  (*T2_Hints_ApplyFunc)( T2_Hints        hints,\n                         FT_Outline*     outline,\n                         PSH_Globals     globals,\n                         FT_Render_Mode  hint_mode );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   T2_Hints_FuncsRec\n   *\n   * @description:\n   *   The structure used to provide the API to @T2_Hints objects.\n   *\n   * @fields:\n   *   hints ::\n   *     A handle to the T2 hints recorder object.\n   *\n   *   open ::\n   *     The function to open a recording session.\n   *\n   *   close ::\n   *     The function to close a recording session.\n   *\n   *   stems ::\n   *     The function to set the dimension's stems table.\n   *\n   *   hintmask ::\n   *     The function to set hint masks.\n   *\n   *   counter ::\n   *     The function to set counter masks.\n   *\n   *   apply ::\n   *     The function to apply the hints on the corresponding glyph outline.\n   *\n   */\n  typedef struct  T2_Hints_FuncsRec_\n  {\n    T2_Hints              hints;\n    T2_Hints_OpenFunc     open;\n    T2_Hints_CloseFunc    close;\n    T2_Hints_StemsFunc    stems;\n    T2_Hints_MaskFunc     hintmask;\n    T2_Hints_CounterFunc  counter;\n    T2_Hints_ApplyFunc    apply;\n\n  } T2_Hints_FuncsRec;\n\n\n  /* */\n\n\n  typedef struct  PSHinter_Interface_\n  {\n    PSH_Globals_Funcs  (*get_globals_funcs)( FT_Module  module );\n    T1_Hints_Funcs     (*get_t1_funcs)     ( FT_Module  module );\n    T2_Hints_Funcs     (*get_t2_funcs)     ( FT_Module  module );\n\n  } PSHinter_Interface;\n\n  typedef PSHinter_Interface*  PSHinter_Service;\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_PSHINTER_INTERFACE(        \\\n          class_,                            \\\n          get_globals_funcs_,                \\\n          get_t1_funcs_,                     \\\n          get_t2_funcs_ )                    \\\n  static const PSHinter_Interface  class_ =  \\\n  {                                          \\\n    get_globals_funcs_,                      \\\n    get_t1_funcs_,                           \\\n    get_t2_funcs_                            \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_PSHINTER_INTERFACE(                      \\\n          class_,                                          \\\n          get_globals_funcs_,                              \\\n          get_t1_funcs_,                                   \\\n          get_t2_funcs_ )                                  \\\n  void                                                     \\\n  FT_Init_Class_ ## class_( FT_Library           library,  \\\n                            PSHinter_Interface*  clazz )   \\\n  {                                                        \\\n    FT_UNUSED( library );                                  \\\n                                                           \\\n    clazz->get_globals_funcs = get_globals_funcs_;         \\\n    clazz->get_t1_funcs      = get_t1_funcs_;              \\\n    clazz->get_t2_funcs      = get_t2_funcs_;              \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\nFT_END_HEADER\n\n#endif /* __PSHINTS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/services/svbdf.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svbdf.h                                                                */\n/*                                                                         */\n/*    The FreeType BDF services (specification).                           */\n/*                                                                         */\n/*  Copyright 2003, 2009, 2012 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVBDF_H__\n#define __SVBDF_H__\n\n#include FT_BDF_H\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_BDF  \"bdf\"\n\n  typedef FT_Error\n  (*FT_BDF_GetCharsetIdFunc)( FT_Face       face,\n                              const char*  *acharset_encoding,\n                              const char*  *acharset_registry );\n\n  typedef FT_Error\n  (*FT_BDF_GetPropertyFunc)( FT_Face           face,\n                             const char*       prop_name,\n                             BDF_PropertyRec  *aproperty );\n\n\n  FT_DEFINE_SERVICE( BDF )\n  {\n    FT_BDF_GetCharsetIdFunc  get_charset_id;\n    FT_BDF_GetPropertyFunc   get_property;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_BDFRec( class_,                                \\\n                                  get_charset_id_,                       \\\n                                  get_property_ )                        \\\n  static const FT_Service_BDFRec  class_ =                               \\\n  {                                                                      \\\n    get_charset_id_, get_property_                                       \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_BDFRec( class_,                                \\\n                                  get_charset_id_,                       \\\n                                  get_property_ )                        \\\n  void                                                                   \\\n  FT_Init_Class_ ## class_( FT_Service_BDFRec*  clazz )                  \\\n  {                                                                      \\\n    clazz->get_charset_id = get_charset_id_;                             \\\n    clazz->get_property   = get_property_;                               \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVBDF_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/services/svcid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svcid.h                                                                */\n/*                                                                         */\n/*    The FreeType CID font services (specification).                      */\n/*                                                                         */\n/*  Copyright 2007, 2009, 2012 by Derek Clegg, Michael Toftdal.            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVCID_H__\n#define __SVCID_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_CID  \"CID\"\n\n  typedef FT_Error\n  (*FT_CID_GetRegistryOrderingSupplementFunc)( FT_Face       face,\n                                               const char*  *registry,\n                                               const char*  *ordering,\n                                               FT_Int       *supplement );\n  typedef FT_Error\n  (*FT_CID_GetIsInternallyCIDKeyedFunc)( FT_Face   face,\n                                         FT_Bool  *is_cid );\n  typedef FT_Error\n  (*FT_CID_GetCIDFromGlyphIndexFunc)( FT_Face   face,\n                                      FT_UInt   glyph_index,\n                                      FT_UInt  *cid );\n\n  FT_DEFINE_SERVICE( CID )\n  {\n    FT_CID_GetRegistryOrderingSupplementFunc  get_ros;\n    FT_CID_GetIsInternallyCIDKeyedFunc        get_is_cid;\n    FT_CID_GetCIDFromGlyphIndexFunc           get_cid_from_glyph_index;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_CIDREC( class_,                                   \\\n                                  get_ros_,                                 \\\n                                  get_is_cid_,                              \\\n                                  get_cid_from_glyph_index_ )               \\\n  static const FT_Service_CIDRec class_ =                                   \\\n  {                                                                         \\\n    get_ros_, get_is_cid_, get_cid_from_glyph_index_                        \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_CIDREC( class_,                                   \\\n                                  get_ros_,                                 \\\n                                  get_is_cid_,                              \\\n                                  get_cid_from_glyph_index_ )               \\\n  void                                                                      \\\n  FT_Init_Class_ ## class_( FT_Library          library,                    \\\n                            FT_Service_CIDRec*  clazz )                     \\\n  {                                                                         \\\n    FT_UNUSED( library );                                                   \\\n                                                                            \\\n    clazz->get_ros                  = get_ros_;                             \\\n    clazz->get_is_cid               = get_is_cid_;                          \\\n    clazz->get_cid_from_glyph_index = get_cid_from_glyph_index_;            \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVCID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/services/svgldict.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svgldict.h                                                             */\n/*                                                                         */\n/*    The FreeType glyph dictionary services (specification).              */\n/*                                                                         */\n/*  Copyright 2003, 2009, 2012 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVGLDICT_H__\n#define __SVGLDICT_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  A service used to retrieve glyph names, as well as to find the\n   *  index of a given glyph name in a font.\n   *\n   */\n\n#define FT_SERVICE_ID_GLYPH_DICT  \"glyph-dict\"\n\n\n  typedef FT_Error\n  (*FT_GlyphDict_GetNameFunc)( FT_Face     face,\n                               FT_UInt     glyph_index,\n                               FT_Pointer  buffer,\n                               FT_UInt     buffer_max );\n\n  typedef FT_UInt\n  (*FT_GlyphDict_NameIndexFunc)( FT_Face     face,\n                                 FT_String*  glyph_name );\n\n\n  FT_DEFINE_SERVICE( GlyphDict )\n  {\n    FT_GlyphDict_GetNameFunc    get_name;\n    FT_GlyphDict_NameIndexFunc  name_index;  /* optional */\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_,                        \\\n                                        get_name_,                     \\\n                                        name_index_)                   \\\n  static const FT_Service_GlyphDictRec  class_ =                       \\\n  {                                                                    \\\n    get_name_, name_index_                                             \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_,                        \\\n                                        get_name_,                     \\\n                                        name_index_)                   \\\n  void                                                                 \\\n  FT_Init_Class_ ## class_( FT_Library                library,         \\\n                            FT_Service_GlyphDictRec*  clazz )          \\\n  {                                                                    \\\n    FT_UNUSED( library );                                              \\\n                                                                       \\\n    clazz->get_name   = get_name_;                                     \\\n    clazz->name_index = name_index_;                                   \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVGLDICT_H__ */\n"
  },
  {
    "path": "ext/freetype2/include/internal/services/svgxval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svgxval.h                                                              */\n/*                                                                         */\n/*    FreeType API for validating TrueTypeGX/AAT tables (specification).   */\n/*                                                                         */\n/*  Copyright 2004, 2005 by                                                */\n/*  Masatake YAMATO, Red Hat K.K.,                                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVGXVAL_H__\n#define __SVGXVAL_H__\n\n#include FT_GX_VALIDATE_H\n#include FT_INTERNAL_VALIDATE_H\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_GX_VALIDATE           \"truetypegx-validate\"\n#define FT_SERVICE_ID_CLASSICKERN_VALIDATE  \"classickern-validate\"\n\n  typedef FT_Error\n  (*gxv_validate_func)( FT_Face   face,\n                        FT_UInt   gx_flags,\n                        FT_Bytes  tables[FT_VALIDATE_GX_LENGTH],\n                        FT_UInt   table_length );\n\n\n  typedef FT_Error\n  (*ckern_validate_func)( FT_Face   face,\n                          FT_UInt   ckern_flags,\n                          FT_Bytes  *ckern_table );\n\n\n  FT_DEFINE_SERVICE( GXvalidate )\n  {\n    gxv_validate_func  validate;\n  };\n\n  FT_DEFINE_SERVICE( CKERNvalidate )\n  {\n    ckern_validate_func  validate;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVGXVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/services/svkern.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svkern.h                                                               */\n/*                                                                         */\n/*    The FreeType Kerning service (specification).                        */\n/*                                                                         */\n/*  Copyright 2006 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVKERN_H__\n#define __SVKERN_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_TRUETYPE_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n#define FT_SERVICE_ID_KERNING  \"kerning\"\n\n\n  typedef FT_Error\n  (*FT_Kerning_TrackGetFunc)( FT_Face    face,\n                              FT_Fixed   point_size,\n                              FT_Int     degree,\n                              FT_Fixed*  akerning );\n\n  FT_DEFINE_SERVICE( Kerning )\n  {\n    FT_Kerning_TrackGetFunc  get_track;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVKERN_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/services/svmm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svmm.h                                                                 */\n/*                                                                         */\n/*    The FreeType Multiple Masters and GX var services (specification).   */\n/*                                                                         */\n/*  Copyright 2003, 2004, 2009, 2012 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVMM_H__\n#define __SVMM_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  A service used to manage multiple-masters data in a given face.\n   *\n   *  See the related APIs in `ftmm.h' (FT_MULTIPLE_MASTERS_H).\n   *\n   */\n\n#define FT_SERVICE_ID_MULTI_MASTERS  \"multi-masters\"\n\n\n  typedef FT_Error\n  (*FT_Get_MM_Func)( FT_Face           face,\n                     FT_Multi_Master*  master );\n\n  typedef FT_Error\n  (*FT_Get_MM_Var_Func)( FT_Face      face,\n                         FT_MM_Var*  *master );\n\n  typedef FT_Error\n  (*FT_Set_MM_Design_Func)( FT_Face   face,\n                            FT_UInt   num_coords,\n                            FT_Long*  coords );\n\n  typedef FT_Error\n  (*FT_Set_Var_Design_Func)( FT_Face    face,\n                             FT_UInt    num_coords,\n                             FT_Fixed*  coords );\n\n  typedef FT_Error\n  (*FT_Set_MM_Blend_Func)( FT_Face   face,\n                           FT_UInt   num_coords,\n                           FT_Long*  coords );\n\n\n  FT_DEFINE_SERVICE( MultiMasters )\n  {\n    FT_Get_MM_Func          get_mm;\n    FT_Set_MM_Design_Func   set_mm_design;\n    FT_Set_MM_Blend_Func    set_mm_blend;\n    FT_Get_MM_Var_Func      get_mm_var;\n    FT_Set_Var_Design_Func  set_var_design;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_,                          \\\n                                           get_mm_,                         \\\n                                           set_mm_design_,                  \\\n                                           set_mm_blend_,                   \\\n                                           get_mm_var_,                     \\\n                                           set_var_design_ )                \\\n  static const FT_Service_MultiMastersRec  class_ =                         \\\n  {                                                                         \\\n    get_mm_, set_mm_design_, set_mm_blend_, get_mm_var_, set_var_design_    \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_,                          \\\n                                           get_mm_,                         \\\n                                           set_mm_design_,                  \\\n                                           set_mm_blend_,                   \\\n                                           get_mm_var_,                     \\\n                                           set_var_design_ )                \\\n  void                                                                      \\\n  FT_Init_Class_ ## class_( FT_Service_MultiMastersRec*  clazz )            \\\n  {                                                                         \\\n    clazz->get_mm         = get_mm_;                                        \\\n    clazz->set_mm_design  = set_mm_design_;                                 \\\n    clazz->set_mm_blend   = set_mm_blend_;                                  \\\n    clazz->get_mm_var     = get_mm_var_;                                    \\\n    clazz->set_var_design = set_var_design_;                                \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __SVMM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/services/svotval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svotval.h                                                              */\n/*                                                                         */\n/*    The FreeType OpenType validation service (specification).            */\n/*                                                                         */\n/*  Copyright 2004, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVOTVAL_H__\n#define __SVOTVAL_H__\n\n#include FT_OPENTYPE_VALIDATE_H\n#include FT_INTERNAL_VALIDATE_H\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_OPENTYPE_VALIDATE  \"opentype-validate\"\n\n\n  typedef FT_Error\n  (*otv_validate_func)( FT_Face volatile  face,\n                        FT_UInt           ot_flags,\n                        FT_Bytes         *base,\n                        FT_Bytes         *gdef,\n                        FT_Bytes         *gpos,\n                        FT_Bytes         *gsub,\n                        FT_Bytes         *jstf );\n\n\n  FT_DEFINE_SERVICE( OTvalidate )\n  {\n    otv_validate_func  validate;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVOTVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/services/svpfr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svpfr.h                                                                */\n/*                                                                         */\n/*    Internal PFR service functions (specification).                      */\n/*                                                                         */\n/*  Copyright 2003, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPFR_H__\n#define __SVPFR_H__\n\n#include FT_PFR_H\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_PFR_METRICS  \"pfr-metrics\"\n\n\n  typedef FT_Error\n  (*FT_PFR_GetMetricsFunc)( FT_Face    face,\n                            FT_UInt   *aoutline,\n                            FT_UInt   *ametrics,\n                            FT_Fixed  *ax_scale,\n                            FT_Fixed  *ay_scale );\n\n  typedef FT_Error\n  (*FT_PFR_GetKerningFunc)( FT_Face     face,\n                            FT_UInt     left,\n                            FT_UInt     right,\n                            FT_Vector  *avector );\n\n  typedef FT_Error\n  (*FT_PFR_GetAdvanceFunc)( FT_Face   face,\n                            FT_UInt   gindex,\n                            FT_Pos   *aadvance );\n\n\n  FT_DEFINE_SERVICE( PfrMetrics )\n  {\n    FT_PFR_GetMetricsFunc  get_metrics;\n    FT_PFR_GetKerningFunc  get_kerning;\n    FT_PFR_GetAdvanceFunc  get_advance;\n\n  };\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __SVPFR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/services/svpostnm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svpostnm.h                                                             */\n/*                                                                         */\n/*    The FreeType PostScript name services (specification).               */\n/*                                                                         */\n/*  Copyright 2003, 2007, 2009, 2012 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPOSTNM_H__\n#define __SVPOSTNM_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n  /*\n   *  A trivial service used to retrieve the PostScript name of a given\n   *  font when available.  The `get_name' field should never be NULL.\n   *\n   *  The corresponding function can return NULL to indicate that the\n   *  PostScript name is not available.\n   *\n   *  The name is owned by the face and will be destroyed with it.\n   */\n\n#define FT_SERVICE_ID_POSTSCRIPT_FONT_NAME  \"postscript-font-name\"\n\n\n  typedef const char*\n  (*FT_PsName_GetFunc)( FT_Face  face );\n\n\n  FT_DEFINE_SERVICE( PsFontName )\n  {\n    FT_PsName_GetFunc  get_ps_font_name;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \\\n  static const FT_Service_PsFontNameRec  class_ =                    \\\n  {                                                                  \\\n    get_ps_font_name_                                                \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_PSFONTNAMEREC( class_, get_ps_font_name_ ) \\\n  void                                                               \\\n  FT_Init_Class_ ## class_( FT_Library                 library,      \\\n                            FT_Service_PsFontNameRec*  clazz )       \\\n  {                                                                  \\\n    FT_UNUSED( library );                                            \\\n                                                                     \\\n    clazz->get_ps_font_name = get_ps_font_name_;                     \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVPOSTNM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/services/svprop.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svprop.h                                                               */\n/*                                                                         */\n/*    The FreeType property service (specification).                       */\n/*                                                                         */\n/*  Copyright 2012 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPROP_H__\n#define __SVPROP_H__\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_PROPERTIES  \"properties\"\n\n\n  typedef FT_Error\n  (*FT_Properties_SetFunc)( FT_Module    module,\n                            const char*  property_name,\n                            const void*  value );\n\n  typedef FT_Error\n  (*FT_Properties_GetFunc)( FT_Module    module,\n                            const char*  property_name,\n                            void*        value );\n\n\n  FT_DEFINE_SERVICE( Properties )\n  {\n    FT_Properties_SetFunc  set_property;\n    FT_Properties_GetFunc  get_property;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_PROPERTIESREC( class_,          \\\n                                         set_property_,   \\\n                                         get_property_ )  \\\n  static const FT_Service_PropertiesRec  class_ =         \\\n  {                                                       \\\n    set_property_,                                        \\\n    get_property_                                         \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_PROPERTIESREC( class_,                \\\n                                         set_property_,         \\\n                                         get_property_ )        \\\n  void                                                          \\\n  FT_Init_Class_ ## class_( FT_Service_PropertiesRec*  clazz )  \\\n  {                                                             \\\n    clazz->set_property = set_property_;                        \\\n    clazz->get_property = get_property_;                        \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVPROP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/services/svpscmap.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svpscmap.h                                                             */\n/*                                                                         */\n/*    The FreeType PostScript charmap service (specification).             */\n/*                                                                         */\n/*  Copyright 2003, 2006, 2009, 2012 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPSCMAP_H__\n#define __SVPSCMAP_H__\n\n#include FT_INTERNAL_OBJECTS_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_POSTSCRIPT_CMAPS  \"postscript-cmaps\"\n\n\n  /*\n   *  Adobe glyph name to unicode value.\n   */\n  typedef FT_UInt32\n  (*PS_Unicode_ValueFunc)( const char*  glyph_name );\n\n  /*\n   *  Macintosh name id to glyph name.  NULL if invalid index.\n   */\n  typedef const char*\n  (*PS_Macintosh_NameFunc)( FT_UInt  name_index );\n\n  /*\n   *  Adobe standard string ID to glyph name.  NULL if invalid index.\n   */\n  typedef const char*\n  (*PS_Adobe_Std_StringsFunc)( FT_UInt  string_index );\n\n\n  /*\n   *  Simple unicode -> glyph index charmap built from font glyph names\n   *  table.\n   */\n  typedef struct  PS_UniMap_\n  {\n    FT_UInt32  unicode;      /* bit 31 set: is glyph variant */\n    FT_UInt    glyph_index;\n\n  } PS_UniMap;\n\n\n  typedef struct PS_UnicodesRec_*  PS_Unicodes;\n\n  typedef struct  PS_UnicodesRec_\n  {\n    FT_CMapRec  cmap;\n    FT_UInt     num_maps;\n    PS_UniMap*  maps;\n\n  } PS_UnicodesRec;\n\n\n  /*\n   *  A function which returns a glyph name for a given index.  Returns\n   *  NULL if invalid index.\n   */\n  typedef const char*\n  (*PS_GetGlyphNameFunc)( FT_Pointer  data,\n                          FT_UInt     string_index );\n\n  /*\n   *  A function used to release the glyph name returned by\n   *  PS_GetGlyphNameFunc, when needed\n   */\n  typedef void\n  (*PS_FreeGlyphNameFunc)( FT_Pointer  data,\n                           const char*  name );\n\n  typedef FT_Error\n  (*PS_Unicodes_InitFunc)( FT_Memory             memory,\n                           PS_Unicodes           unicodes,\n                           FT_UInt               num_glyphs,\n                           PS_GetGlyphNameFunc   get_glyph_name,\n                           PS_FreeGlyphNameFunc  free_glyph_name,\n                           FT_Pointer            glyph_data );\n\n  typedef FT_UInt\n  (*PS_Unicodes_CharIndexFunc)( PS_Unicodes  unicodes,\n                                FT_UInt32    unicode );\n\n  typedef FT_UInt32\n  (*PS_Unicodes_CharNextFunc)( PS_Unicodes  unicodes,\n                               FT_UInt32   *unicode );\n\n\n  FT_DEFINE_SERVICE( PsCMaps )\n  {\n    PS_Unicode_ValueFunc       unicode_value;\n\n    PS_Unicodes_InitFunc       unicodes_init;\n    PS_Unicodes_CharIndexFunc  unicodes_char_index;\n    PS_Unicodes_CharNextFunc   unicodes_char_next;\n\n    PS_Macintosh_NameFunc      macintosh_name;\n    PS_Adobe_Std_StringsFunc   adobe_std_strings;\n    const unsigned short*      adobe_std_encoding;\n    const unsigned short*      adobe_expert_encoding;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_PSCMAPSREC( class_,                               \\\n                                      unicode_value_,                       \\\n                                      unicodes_init_,                       \\\n                                      unicodes_char_index_,                 \\\n                                      unicodes_char_next_,                  \\\n                                      macintosh_name_,                      \\\n                                      adobe_std_strings_,                   \\\n                                      adobe_std_encoding_,                  \\\n                                      adobe_expert_encoding_ )              \\\n  static const FT_Service_PsCMapsRec  class_ =                              \\\n  {                                                                         \\\n    unicode_value_, unicodes_init_,                                         \\\n    unicodes_char_index_, unicodes_char_next_, macintosh_name_,             \\\n    adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_         \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_PSCMAPSREC( class_,                               \\\n                                      unicode_value_,                       \\\n                                      unicodes_init_,                       \\\n                                      unicodes_char_index_,                 \\\n                                      unicodes_char_next_,                  \\\n                                      macintosh_name_,                      \\\n                                      adobe_std_strings_,                   \\\n                                      adobe_std_encoding_,                  \\\n                                      adobe_expert_encoding_ )              \\\n  void                                                                      \\\n  FT_Init_Class_ ## class_( FT_Library              library,                \\\n                            FT_Service_PsCMapsRec*  clazz )                 \\\n  {                                                                         \\\n    FT_UNUSED( library );                                                   \\\n                                                                            \\\n    clazz->unicode_value         = unicode_value_;                          \\\n    clazz->unicodes_init         = unicodes_init_;                          \\\n    clazz->unicodes_char_index   = unicodes_char_index_;                    \\\n    clazz->unicodes_char_next    = unicodes_char_next_;                     \\\n    clazz->macintosh_name        = macintosh_name_;                         \\\n    clazz->adobe_std_strings     = adobe_std_strings_;                      \\\n    clazz->adobe_std_encoding    = adobe_std_encoding_;                     \\\n    clazz->adobe_expert_encoding = adobe_expert_encoding_;                  \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVPSCMAP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/services/svpsinfo.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svpsinfo.h                                                             */\n/*                                                                         */\n/*    The FreeType PostScript info service (specification).                */\n/*                                                                         */\n/*  Copyright 2003, 2004, 2009, 2011, 2012 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVPSINFO_H__\n#define __SVPSINFO_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_INTERNAL_TYPE1_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_POSTSCRIPT_INFO  \"postscript-info\"\n\n\n  typedef FT_Error\n  (*PS_GetFontInfoFunc)( FT_Face          face,\n                         PS_FontInfoRec*  afont_info );\n\n  typedef FT_Error\n  (*PS_GetFontExtraFunc)( FT_Face           face,\n                          PS_FontExtraRec*  afont_extra );\n\n  typedef FT_Int\n  (*PS_HasGlyphNamesFunc)( FT_Face  face );\n\n  typedef FT_Error\n  (*PS_GetFontPrivateFunc)( FT_Face         face,\n                            PS_PrivateRec*  afont_private );\n\n  typedef FT_Long\n  (*PS_GetFontValueFunc)( FT_Face       face,\n                          PS_Dict_Keys  key,\n                          FT_UInt       idx,\n                          void         *value,\n                          FT_Long       value_len );\n\n\n  FT_DEFINE_SERVICE( PsInfo )\n  {\n    PS_GetFontInfoFunc     ps_get_font_info;\n    PS_GetFontExtraFunc    ps_get_font_extra;\n    PS_HasGlyphNamesFunc   ps_has_glyph_names;\n    PS_GetFontPrivateFunc  ps_get_font_private;\n    PS_GetFontValueFunc    ps_get_font_value;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_PSINFOREC( class_,                     \\\n                                     get_font_info_,             \\\n                                     ps_get_font_extra_,         \\\n                                     has_glyph_names_,           \\\n                                     get_font_private_,          \\\n                                     get_font_value_ )           \\\n  static const FT_Service_PsInfoRec  class_ =                    \\\n  {                                                              \\\n    get_font_info_, ps_get_font_extra_, has_glyph_names_,        \\\n    get_font_private_, get_font_value_                           \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_PSINFOREC( class_,                     \\\n                                     get_font_info_,             \\\n                                     ps_get_font_extra_,         \\\n                                     has_glyph_names_,           \\\n                                     get_font_private_,          \\\n                                     get_font_value_ )           \\\n  void                                                           \\\n  FT_Init_Class_ ## class_( FT_Library             library,      \\\n                            FT_Service_PsInfoRec*  clazz )       \\\n  {                                                              \\\n    FT_UNUSED( library );                                        \\\n                                                                 \\\n    clazz->ps_get_font_info    = get_font_info_;                 \\\n    clazz->ps_get_font_extra   = ps_get_font_extra_;             \\\n    clazz->ps_has_glyph_names  = has_glyph_names_;               \\\n    clazz->ps_get_font_private = get_font_private_;              \\\n    clazz->ps_get_font_value   = get_font_value_;                \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVPSINFO_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/services/svsfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svsfnt.h                                                               */\n/*                                                                         */\n/*    The FreeType SFNT table loading service (specification).             */\n/*                                                                         */\n/*  Copyright 2003, 2004, 2009, 2012 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVSFNT_H__\n#define __SVSFNT_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_TRUETYPE_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  SFNT table loading service.\n   */\n\n#define FT_SERVICE_ID_SFNT_TABLE  \"sfnt-table\"\n\n\n  /*\n   * Used to implement FT_Load_Sfnt_Table().\n   */\n  typedef FT_Error\n  (*FT_SFNT_TableLoadFunc)( FT_Face    face,\n                            FT_ULong   tag,\n                            FT_Long    offset,\n                            FT_Byte*   buffer,\n                            FT_ULong*  length );\n\n  /*\n   * Used to implement FT_Get_Sfnt_Table().\n   */\n  typedef void*\n  (*FT_SFNT_TableGetFunc)( FT_Face      face,\n                           FT_Sfnt_Tag  tag );\n\n\n  /*\n   * Used to implement FT_Sfnt_Table_Info().\n   */\n  typedef FT_Error\n  (*FT_SFNT_TableInfoFunc)( FT_Face    face,\n                            FT_UInt    idx,\n                            FT_ULong  *tag,\n                            FT_ULong  *offset,\n                            FT_ULong  *length );\n\n\n  FT_DEFINE_SERVICE( SFNT_Table )\n  {\n    FT_SFNT_TableLoadFunc  load_table;\n    FT_SFNT_TableGetFunc   get_table;\n    FT_SFNT_TableInfoFunc  table_info;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ )  \\\n  static const FT_Service_SFNT_TableRec  class_ =                      \\\n  {                                                                    \\\n    load_, get_, info_                                                 \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_SFNT_TABLEREC( class_, load_, get_, info_ ) \\\n  void                                                                \\\n  FT_Init_Class_ ## class_( FT_Service_SFNT_TableRec*  clazz )        \\\n  {                                                                   \\\n    clazz->load_table = load_;                                        \\\n    clazz->get_table  = get_;                                         \\\n    clazz->table_info = info_;                                        \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVSFNT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/services/svttcmap.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svttcmap.h                                                             */\n/*                                                                         */\n/*    The FreeType TrueType/sfnt cmap extra information service.           */\n/*                                                                         */\n/*  Copyright 2003 by                                                      */\n/*  Masatake YAMATO, Redhat K.K.                                           */\n/*                                                                         */\n/*  Copyright 2003, 2008, 2009, 2012, 2013 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/* Development of this service is support of\n   Information-technology Promotion Agency, Japan. */\n\n#ifndef __SVTTCMAP_H__\n#define __SVTTCMAP_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_TRUETYPE_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_TT_CMAP  \"tt-cmaps\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_CMapInfo                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to store TrueType/sfnt specific cmap information  */\n  /*    which is not covered by the generic @FT_CharMap structure.  This   */\n  /*    structure can be accessed with the @FT_Get_TT_CMap_Info function.  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    language ::                                                        */\n  /*      The language ID used in Mac fonts.  Definitions of values are in */\n  /*      `ttnameid.h'.                                                    */\n  /*                                                                       */\n  /*    format ::                                                          */\n  /*      The cmap format.  OpenType 1.5 defines the formats 0 (byte       */\n  /*      encoding table), 2~(high-byte mapping through table), 4~(segment */\n  /*      mapping to delta values), 6~(trimmed table mapping), 8~(mixed    */\n  /*      16-bit and 32-bit coverage), 10~(trimmed array), 12~(segmented   */\n  /*      coverage), and 14 (Unicode Variation Sequences).                 */\n  /*                                                                       */\n  typedef struct  TT_CMapInfo_\n  {\n    FT_ULong  language;\n    FT_Long   format;\n\n  } TT_CMapInfo;\n\n\n  typedef FT_Error\n  (*TT_CMap_Info_GetFunc)( FT_CharMap    charmap,\n                           TT_CMapInfo  *cmap_info );\n\n\n  FT_DEFINE_SERVICE( TTCMaps )\n  {\n    TT_CMap_Info_GetFunc  get_cmap_info;\n  };\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ )  \\\n  static const FT_Service_TTCMapsRec  class_ =                  \\\n  {                                                             \\\n    get_cmap_info_                                              \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_TTCMAPSREC( class_, get_cmap_info_ )  \\\n  void                                                          \\\n  FT_Init_Class_ ## class_( FT_Library              library,    \\\n                            FT_Service_TTCMapsRec*  clazz )     \\\n  {                                                             \\\n    FT_UNUSED( library );                                       \\\n                                                                \\\n    clazz->get_cmap_info = get_cmap_info_;                      \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __SVTTCMAP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/services/svtteng.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svtteng.h                                                              */\n/*                                                                         */\n/*    The FreeType TrueType engine query service (specification).          */\n/*                                                                         */\n/*  Copyright 2006 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVTTENG_H__\n#define __SVTTENG_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_MODULE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  SFNT table loading service.\n   */\n\n#define FT_SERVICE_ID_TRUETYPE_ENGINE  \"truetype-engine\"\n\n  /*\n   * Used to implement FT_Get_TrueType_Engine_Type\n   */\n\n  FT_DEFINE_SERVICE( TrueTypeEngine )\n  {\n    FT_TrueTypeEngineType  engine_type;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVTTENG_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/services/svttglyf.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svttglyf.h                                                             */\n/*                                                                         */\n/*    The FreeType TrueType glyph service.                                 */\n/*                                                                         */\n/*  Copyright 2007, 2009, 2012 by David Turner.                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#ifndef __SVTTGLYF_H__\n#define __SVTTGLYF_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_TRUETYPE_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_TT_GLYF  \"tt-glyf\"\n\n\n  typedef FT_ULong\n  (*TT_Glyf_GetLocationFunc)( FT_Face    face,\n                              FT_UInt    gindex,\n                              FT_ULong  *psize );\n\n  FT_DEFINE_SERVICE( TTGlyf )\n  {\n    TT_Glyf_GetLocationFunc  get_location;\n  };\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ )  \\\n  static const FT_Service_TTGlyfRec  class_ =                 \\\n  {                                                           \\\n    get_location_                                             \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_SERVICE_TTGLYFREC( class_, get_location_ )  \\\n  void                                                        \\\n  FT_Init_Class_ ## class_( FT_Service_TTGlyfRec*  clazz )    \\\n  {                                                           \\\n    clazz->get_location = get_location_;                      \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __SVTTGLYF_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/services/svwinfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svwinfnt.h                                                             */\n/*                                                                         */\n/*    The FreeType Windows FNT/FONT service (specification).               */\n/*                                                                         */\n/*  Copyright 2003 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVWINFNT_H__\n#define __SVWINFNT_H__\n\n#include FT_INTERNAL_SERVICE_H\n#include FT_WINFONTS_H\n\n\nFT_BEGIN_HEADER\n\n\n#define FT_SERVICE_ID_WINFNT  \"winfonts\"\n\n  typedef FT_Error\n  (*FT_WinFnt_GetHeaderFunc)( FT_Face               face,\n                              FT_WinFNT_HeaderRec  *aheader );\n\n\n  FT_DEFINE_SERVICE( WinFnt )\n  {\n    FT_WinFnt_GetHeaderFunc  get_header;\n  };\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVWINFNT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/services/svxf86nm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  svxf86nm.h                                                             */\n/*                                                                         */\n/*    The FreeType XFree86 services (specification only).                  */\n/*                                                                         */\n/*  Copyright 2003 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SVXF86NM_H__\n#define __SVXF86NM_H__\n\n#include FT_INTERNAL_SERVICE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  A trivial service used to return the name of a face's font driver,\n   *  according to the XFree86 nomenclature.  Note that the service data\n   *  is a simple constant string pointer.\n   */\n\n#define FT_SERVICE_ID_XF86_NAME  \"xf86-driver-name\"\n\n#define FT_XF86_FORMAT_TRUETYPE  \"TrueType\"\n#define FT_XF86_FORMAT_TYPE_1    \"Type 1\"\n#define FT_XF86_FORMAT_BDF       \"BDF\"\n#define FT_XF86_FORMAT_PCF       \"PCF\"\n#define FT_XF86_FORMAT_TYPE_42   \"Type 42\"\n#define FT_XF86_FORMAT_CID       \"CID Type 1\"\n#define FT_XF86_FORMAT_CFF       \"CFF\"\n#define FT_XF86_FORMAT_PFR       \"PFR\"\n#define FT_XF86_FORMAT_WINFNT    \"Windows FNT\"\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __SVXF86NM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/sfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  sfnt.h                                                                 */\n/*                                                                         */\n/*    High-level `sfnt' driver interface (specification).                  */\n/*                                                                         */\n/*  Copyright 1996-2006, 2009, 2012-2014 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SFNT_H__\n#define __SFNT_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DRIVER_H\n#include FT_INTERNAL_TRUETYPE_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Init_Face_Func                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    First part of the SFNT face object initialization.  This finds     */\n  /*    the face in a SFNT file or collection, and load its format tag in  */\n  /*    face->format_tag.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream     :: The input stream.                                    */\n  /*                                                                       */\n  /*    face       :: A handle to the target face object.                  */\n  /*                                                                       */\n  /*    face_index :: The index of the TrueType font, if we are opening a  */\n  /*                  collection.                                          */\n  /*                                                                       */\n  /*    num_params :: The number of additional parameters.                 */\n  /*                                                                       */\n  /*    params     :: Optional additional parameters.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream cursor must be at the font file's origin.               */\n  /*                                                                       */\n  /*    This function recognizes fonts embedded in a `TrueType             */\n  /*    collection'.                                                       */\n  /*                                                                       */\n  /*    Once the format tag has been validated by the font driver, it      */\n  /*    should then call the TT_Load_Face_Func() callback to read the rest */\n  /*    of the SFNT tables in the object.                                  */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Init_Face_Func)( FT_Stream      stream,\n                        TT_Face        face,\n                        FT_Int         face_index,\n                        FT_Int         num_params,\n                        FT_Parameter*  params );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Face_Func                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Second part of the SFNT face object initialization.  This loads    */\n  /*    the common SFNT tables (head, OS/2, maxp, metrics, etc.) in the    */\n  /*    face object.                                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream     :: The input stream.                                    */\n  /*                                                                       */\n  /*    face       :: A handle to the target face object.                  */\n  /*                                                                       */\n  /*    face_index :: The index of the TrueType font, if we are opening a  */\n  /*                  collection.                                          */\n  /*                                                                       */\n  /*    num_params :: The number of additional parameters.                 */\n  /*                                                                       */\n  /*    params     :: Optional additional parameters.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function must be called after TT_Init_Face_Func().            */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Face_Func)( FT_Stream      stream,\n                        TT_Face        face,\n                        FT_Int         face_index,\n                        FT_Int         num_params,\n                        FT_Parameter*  params );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Done_Face_Func                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A callback used to delete the common SFNT data from a face.        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the target face object.                        */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function does NOT destroy the face object.                    */\n  /*                                                                       */\n  typedef void\n  (*TT_Done_Face_Func)( TT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Any_Func                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load any font table into client memory.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: The face object to look for.                             */\n  /*                                                                       */\n  /*    tag    :: The tag of table to load.  Use the value 0 if you want   */\n  /*              to access the whole font file, else set this parameter   */\n  /*              to a valid TrueType table tag that you can forge with    */\n  /*              the MAKE_TT_TAG macro.                                   */\n  /*                                                                       */\n  /*    offset :: The starting offset in the table (or the file if         */\n  /*              tag == 0).                                               */\n  /*                                                                       */\n  /*    length :: The address of the decision variable:                    */\n  /*                                                                       */\n  /*                If length == NULL:                                     */\n  /*                  Loads the whole table.  Returns an error if          */\n  /*                  `offset' == 0!                                       */\n  /*                                                                       */\n  /*                If *length == 0:                                       */\n  /*                  Exits immediately; returning the length of the given */\n  /*                  table or of the font file, depending on the value of */\n  /*                  `tag'.                                               */\n  /*                                                                       */\n  /*                If *length != 0:                                       */\n  /*                  Loads the next `length' bytes of table or font,      */\n  /*                  starting at offset `offset' (in table or font too).  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    buffer :: The address of target buffer.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    TrueType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Any_Func)( TT_Face    face,\n                       FT_ULong   tag,\n                       FT_Long    offset,\n                       FT_Byte   *buffer,\n                       FT_ULong*  length );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Find_SBit_Image_Func                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Check whether an embedded bitmap (an `sbit') exists for a given    */\n  /*    glyph, at a given strike.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face          :: The target face object.                           */\n  /*                                                                       */\n  /*    glyph_index   :: The glyph index.                                  */\n  /*                                                                       */\n  /*    strike_index  :: The current strike index.                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    arange        :: The SBit range containing the glyph index.        */\n  /*                                                                       */\n  /*    astrike       :: The SBit strike containing the glyph index.       */\n  /*                                                                       */\n  /*    aglyph_offset :: The offset of the glyph data in `EBDT' table.     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.  Returns                    */\n  /*    SFNT_Err_Invalid_Argument if no sbit exists for the requested      */\n  /*    glyph.                                                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Find_SBit_Image_Func)( TT_Face          face,\n                              FT_UInt          glyph_index,\n                              FT_ULong         strike_index,\n                              TT_SBit_Range   *arange,\n                              TT_SBit_Strike  *astrike,\n                              FT_ULong        *aglyph_offset );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_SBit_Metrics_Func                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Get the big metrics for a given embedded bitmap.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream      :: The input stream.                                   */\n  /*                                                                       */\n  /*    range       :: The SBit range containing the glyph.                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    big_metrics :: A big SBit metrics structure for the glyph.         */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream cursor must be positioned at the glyph's offset within  */\n  /*    the `EBDT' table before the call.                                  */\n  /*                                                                       */\n  /*    If the image format uses variable metrics, the stream cursor is    */\n  /*    positioned just after the metrics header in the `EBDT' table on    */\n  /*    function exit.                                                     */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_SBit_Metrics_Func)( FT_Stream        stream,\n                                TT_SBit_Range    range,\n                                TT_SBit_Metrics  metrics );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_SBit_Image_Func                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load a given glyph sbit image from the font resource.  This also   */\n  /*    returns its metrics.                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face ::                                                            */\n  /*      The target face object.                                          */\n  /*                                                                       */\n  /*    strike_index ::                                                    */\n  /*      The strike index.                                                */\n  /*                                                                       */\n  /*    glyph_index ::                                                     */\n  /*      The current glyph index.                                         */\n  /*                                                                       */\n  /*    load_flags ::                                                      */\n  /*      The current load flags.                                          */\n  /*                                                                       */\n  /*    stream ::                                                          */\n  /*      The input stream.                                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amap ::                                                            */\n  /*      The target pixmap.                                               */\n  /*                                                                       */\n  /*    ametrics ::                                                        */\n  /*      A big sbit metrics structure for the glyph image.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.  Returns an error if no     */\n  /*    glyph sbit exists for the index.                                   */\n  /*                                                                       */\n  /*  <Note>                                                               */\n  /*    The `map.buffer' field is always freed before the glyph is loaded. */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_SBit_Image_Func)( TT_Face              face,\n                              FT_ULong             strike_index,\n                              FT_UInt              glyph_index,\n                              FT_UInt              load_flags,\n                              FT_Stream            stream,\n                              FT_Bitmap           *amap,\n                              TT_SBit_MetricsRec  *ametrics );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Set_SBit_Strike_Func                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select an sbit strike for a given size request.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face          :: The target face object.                           */\n  /*                                                                       */\n  /*    req           :: The size request.                                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    astrike_index :: The index of the sbit strike.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.  Returns an error if no     */\n  /*    sbit strike exists for the selected ppem values.                   */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Set_SBit_Strike_Func)( TT_Face          face,\n                              FT_Size_Request  req,\n                              FT_ULong*        astrike_index );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Strike_Metrics_Func                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load the metrics of a given strike.                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face          :: The target face object.                           */\n  /*                                                                       */\n  /*    strike_index  :: The strike index.                                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    metrics       :: the metrics of the strike.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.  Returns an error if no     */\n  /*    such sbit strike exists.                                           */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Strike_Metrics_Func)( TT_Face           face,\n                                  FT_ULong          strike_index,\n                                  FT_Size_Metrics*  metrics );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Get_PS_Name_Func                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Get the PostScript glyph name of a glyph.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    idx  :: The glyph index.                                           */\n  /*                                                                       */\n  /*    PSname :: The address of a string pointer.  Will be NULL in case   */\n  /*              of error, otherwise it is a pointer to the glyph name.   */\n  /*                                                                       */\n  /*              You must not modify the returned string!                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Get_PS_Name_Func)( TT_Face      face,\n                          FT_UInt      idx,\n                          FT_String**  PSname );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Metrics_Func                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load a metrics table, which is a table with a horizontal and a     */\n  /*    vertical version.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face     :: A handle to the target face object.                    */\n  /*                                                                       */\n  /*    stream   :: The input stream.                                      */\n  /*                                                                       */\n  /*    vertical :: A boolean flag.  If set, load the vertical one.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Metrics_Func)( TT_Face    face,\n                           FT_Stream  stream,\n                           FT_Bool    vertical );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Get_Metrics_Func                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load the horizontal or vertical header in a face object.           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face     :: A handle to the target face object.                    */\n  /*                                                                       */\n  /*    vertical :: A boolean flag.  If set, load vertical metrics.        */\n  /*                                                                       */\n  /*    gindex   :: The glyph index.                                       */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    abearing :: The horizontal (or vertical) bearing.  Set to zero in  */\n  /*                case of error.                                         */\n  /*                                                                       */\n  /*    aadvance :: The horizontal (or vertical) advance.  Set to zero in  */\n  /*                case of error.                                         */\n  /*                                                                       */\n  typedef void\n  (*TT_Get_Metrics_Func)( TT_Face     face,\n                          FT_Bool     vertical,\n                          FT_UInt     gindex,\n                          FT_Short*   abearing,\n                          FT_UShort*  aadvance );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Load_Table_Func                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load a given TrueType table.                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /*    stream :: The input stream.                                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The function uses `face->goto_table' to seek the stream to the     */\n  /*    start of the table, except while loading the font directory.       */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Load_Table_Func)( TT_Face    face,\n                         FT_Stream  stream );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Free_Table_Func                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Free a given TrueType table.                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the target face object.                        */\n  /*                                                                       */\n  typedef void\n  (*TT_Free_Table_Func)( TT_Face  face );\n\n\n  /*\n   * @functype:\n   *    TT_Face_GetKerningFunc\n   *\n   * @description:\n   *    Return the horizontal kerning value between two glyphs.\n   *\n   * @input:\n   *    face        :: A handle to the source face object.\n   *    left_glyph  :: The left glyph index.\n   *    right_glyph :: The right glyph index.\n   *\n   * @return:\n   *    The kerning value in font units.\n   */\n  typedef FT_Int\n  (*TT_Face_GetKerningFunc)( TT_Face  face,\n                             FT_UInt  left_glyph,\n                             FT_UInt  right_glyph );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    SFNT_Interface                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure holds pointers to the functions used to load and    */\n  /*    free the basic tables that are required in a `sfnt' font file.     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Check the various xxx_Func() descriptions for details.             */\n  /*                                                                       */\n  typedef struct  SFNT_Interface_\n  {\n    TT_Loader_GotoTableFunc      goto_table;\n\n    TT_Init_Face_Func            init_face;\n    TT_Load_Face_Func            load_face;\n    TT_Done_Face_Func            done_face;\n    FT_Module_Requester          get_interface;\n\n    TT_Load_Any_Func             load_any;\n\n    /* these functions are called by `load_face' but they can also  */\n    /* be called from external modules, if there is a need to do so */\n    TT_Load_Table_Func           load_head;\n    TT_Load_Metrics_Func         load_hhea;\n    TT_Load_Table_Func           load_cmap;\n    TT_Load_Table_Func           load_maxp;\n    TT_Load_Table_Func           load_os2;\n    TT_Load_Table_Func           load_post;\n\n    TT_Load_Table_Func           load_name;\n    TT_Free_Table_Func           free_name;\n\n    /* this field was called `load_kerning' up to version 2.1.10 */\n    TT_Load_Table_Func           load_kern;\n\n    TT_Load_Table_Func           load_gasp;\n    TT_Load_Table_Func           load_pclt;\n\n    /* see `ttload.h'; this field was called `load_bitmap_header' up to */\n    /* version 2.1.10                                                   */\n    TT_Load_Table_Func           load_bhed;\n\n    TT_Load_SBit_Image_Func      load_sbit_image;\n\n    /* see `ttpost.h' */\n    TT_Get_PS_Name_Func          get_psname;\n    TT_Free_Table_Func           free_psnames;\n\n    /* starting here, the structure differs from version 2.1.7 */\n\n    /* this field was introduced in version 2.1.8, named `get_psname' */\n    TT_Face_GetKerningFunc       get_kerning;\n\n    /* new elements introduced after version 2.1.10 */\n\n    /* load the font directory, i.e., the offset table and */\n    /* the table directory                                 */\n    TT_Load_Table_Func           load_font_dir;\n    TT_Load_Metrics_Func         load_hmtx;\n\n    TT_Load_Table_Func           load_eblc;\n    TT_Free_Table_Func           free_eblc;\n\n    TT_Set_SBit_Strike_Func      set_sbit_strike;\n    TT_Load_Strike_Metrics_Func  load_strike_metrics;\n\n    TT_Get_Metrics_Func          get_metrics;\n\n  } SFNT_Interface;\n\n\n  /* transitional */\n  typedef SFNT_Interface*   SFNT_Service;\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_SFNT_INTERFACE(        \\\n          class_,                        \\\n          goto_table_,                   \\\n          init_face_,                    \\\n          load_face_,                    \\\n          done_face_,                    \\\n          get_interface_,                \\\n          load_any_,                     \\\n          load_head_,                    \\\n          load_hhea_,                    \\\n          load_cmap_,                    \\\n          load_maxp_,                    \\\n          load_os2_,                     \\\n          load_post_,                    \\\n          load_name_,                    \\\n          free_name_,                    \\\n          load_kern_,                    \\\n          load_gasp_,                    \\\n          load_pclt_,                    \\\n          load_bhed_,                    \\\n          load_sbit_image_,              \\\n          get_psname_,                   \\\n          free_psnames_,                 \\\n          get_kerning_,                  \\\n          load_font_dir_,                \\\n          load_hmtx_,                    \\\n          load_eblc_,                    \\\n          free_eblc_,                    \\\n          set_sbit_strike_,              \\\n          load_strike_metrics_,          \\\n          get_metrics_ )                 \\\n  static const SFNT_Interface  class_ =  \\\n  {                                      \\\n    goto_table_,                         \\\n    init_face_,                          \\\n    load_face_,                          \\\n    done_face_,                          \\\n    get_interface_,                      \\\n    load_any_,                           \\\n    load_head_,                          \\\n    load_hhea_,                          \\\n    load_cmap_,                          \\\n    load_maxp_,                          \\\n    load_os2_,                           \\\n    load_post_,                          \\\n    load_name_,                          \\\n    free_name_,                          \\\n    load_kern_,                          \\\n    load_gasp_,                          \\\n    load_pclt_,                          \\\n    load_bhed_,                          \\\n    load_sbit_image_,                    \\\n    get_psname_,                         \\\n    free_psnames_,                       \\\n    get_kerning_,                        \\\n    load_font_dir_,                      \\\n    load_hmtx_,                          \\\n    load_eblc_,                          \\\n    free_eblc_,                          \\\n    set_sbit_strike_,                    \\\n    load_strike_metrics_,                \\\n    get_metrics_,                        \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_INTERNAL( a, a_ )  \\\n          clazz->a = a_;\n\n#define FT_DEFINE_SFNT_INTERFACE(                       \\\n          class_,                                       \\\n          goto_table_,                                  \\\n          init_face_,                                   \\\n          load_face_,                                   \\\n          done_face_,                                   \\\n          get_interface_,                               \\\n          load_any_,                                    \\\n          load_head_,                                   \\\n          load_hhea_,                                   \\\n          load_cmap_,                                   \\\n          load_maxp_,                                   \\\n          load_os2_,                                    \\\n          load_post_,                                   \\\n          load_name_,                                   \\\n          free_name_,                                   \\\n          load_kern_,                                   \\\n          load_gasp_,                                   \\\n          load_pclt_,                                   \\\n          load_bhed_,                                   \\\n          load_sbit_image_,                             \\\n          get_psname_,                                  \\\n          free_psnames_,                                \\\n          get_kerning_,                                 \\\n          load_font_dir_,                               \\\n          load_hmtx_,                                   \\\n          load_eblc_,                                   \\\n          free_eblc_,                                   \\\n          set_sbit_strike_,                             \\\n          load_strike_metrics_,                         \\\n          get_metrics_ )                                \\\n  void                                                  \\\n  FT_Init_Class_ ## class_( FT_Library       library,   \\\n                            SFNT_Interface*  clazz )    \\\n  {                                                     \\\n    FT_UNUSED( library );                               \\\n                                                        \\\n    clazz->goto_table          = goto_table_;           \\\n    clazz->init_face           = init_face_;            \\\n    clazz->load_face           = load_face_;            \\\n    clazz->done_face           = done_face_;            \\\n    clazz->get_interface       = get_interface_;        \\\n    clazz->load_any            = load_any_;             \\\n    clazz->load_head           = load_head_;            \\\n    clazz->load_hhea           = load_hhea_;            \\\n    clazz->load_cmap           = load_cmap_;            \\\n    clazz->load_maxp           = load_maxp_;            \\\n    clazz->load_os2            = load_os2_;             \\\n    clazz->load_post           = load_post_;            \\\n    clazz->load_name           = load_name_;            \\\n    clazz->free_name           = free_name_;            \\\n    clazz->load_kern           = load_kern_;            \\\n    clazz->load_gasp           = load_gasp_;            \\\n    clazz->load_pclt           = load_pclt_;            \\\n    clazz->load_bhed           = load_bhed_;            \\\n    clazz->load_sbit_image     = load_sbit_image_;      \\\n    clazz->get_psname          = get_psname_;           \\\n    clazz->free_psnames        = free_psnames_;         \\\n    clazz->get_kerning         = get_kerning_;          \\\n    clazz->load_font_dir       = load_font_dir_;        \\\n    clazz->load_hmtx           = load_hmtx_;            \\\n    clazz->load_eblc           = load_eblc_;            \\\n    clazz->free_eblc           = free_eblc_;            \\\n    clazz->set_sbit_strike     = set_sbit_strike_;      \\\n    clazz->load_strike_metrics = load_strike_metrics_;  \\\n    clazz->get_metrics         = get_metrics_;          \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\nFT_END_HEADER\n\n#endif /* __SFNT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/t1types.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1types.h                                                              */\n/*                                                                         */\n/*    Basic Type1/Type2 type definitions and interface (specification      */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006, 2008, 2009, 2011, 2013 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T1TYPES_H__\n#define __T1TYPES_H__\n\n\n#include <ft2build.h>\n#include FT_TYPE1_TABLES_H\n#include FT_INTERNAL_POSTSCRIPT_HINTS_H\n#include FT_INTERNAL_SERVICE_H\n#include FT_SERVICE_POSTSCRIPT_CMAPS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***              REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS              ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    T1_EncodingRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling a custom encoding.                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_chars  :: The number of character codes in the encoding.       */\n  /*                  Usually 256.                                         */\n  /*                                                                       */\n  /*    code_first :: The lowest valid character code in the encoding.     */\n  /*                                                                       */\n  /*    code_last  :: The highest valid character code in the encoding     */\n  /*                  + 1. When equal to code_first there are no valid     */\n  /*                  character codes.                                     */\n  /*                                                                       */\n  /*    char_index :: An array of corresponding glyph indices.             */\n  /*                                                                       */\n  /*    char_name  :: An array of corresponding glyph names.               */\n  /*                                                                       */\n  typedef struct  T1_EncodingRecRec_\n  {\n    FT_Int       num_chars;\n    FT_Int       code_first;\n    FT_Int       code_last;\n\n    FT_UShort*   char_index;\n    FT_String**  char_name;\n\n  } T1_EncodingRec, *T1_Encoding;\n\n\n  /* used to hold extra data of PS_FontInfoRec that\n   * cannot be stored in the publicly defined structure.\n   *\n   * Note these can't be blended with multiple-masters.\n   */\n  typedef struct  PS_FontExtraRec_\n  {\n    FT_UShort  fs_type;\n\n  } PS_FontExtraRec;\n\n\n  typedef struct  T1_FontRec_\n  {\n    PS_FontInfoRec   font_info;         /* font info dictionary   */\n    PS_FontExtraRec  font_extra;        /* font info extra fields */\n    PS_PrivateRec    private_dict;      /* private dictionary     */\n    FT_String*       font_name;         /* top-level dictionary   */\n\n    T1_EncodingType  encoding_type;\n    T1_EncodingRec   encoding;\n\n    FT_Byte*         subrs_block;\n    FT_Byte*         charstrings_block;\n    FT_Byte*         glyph_names_block;\n\n    FT_Int           num_subrs;\n    FT_Byte**        subrs;\n    FT_PtrDist*      subrs_len;\n\n    FT_Int           num_glyphs;\n    FT_String**      glyph_names;       /* array of glyph names       */\n    FT_Byte**        charstrings;       /* array of glyph charstrings */\n    FT_PtrDist*      charstrings_len;\n\n    FT_Byte          paint_type;\n    FT_Byte          font_type;\n    FT_Matrix        font_matrix;\n    FT_Vector        font_offset;\n    FT_BBox          font_bbox;\n    FT_Long          font_id;\n\n    FT_Fixed         stroke_width;\n\n  } T1_FontRec, *T1_Font;\n\n\n  typedef struct  CID_SubrsRec_\n  {\n    FT_UInt    num_subrs;\n    FT_Byte**  code;\n\n  } CID_SubrsRec, *CID_Subrs;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                AFM FONT INFORMATION STRUCTURES                    ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct  AFM_TrackKernRec_\n  {\n    FT_Int    degree;\n    FT_Fixed  min_ptsize;\n    FT_Fixed  min_kern;\n    FT_Fixed  max_ptsize;\n    FT_Fixed  max_kern;\n\n  } AFM_TrackKernRec, *AFM_TrackKern;\n\n  typedef struct  AFM_KernPairRec_\n  {\n    FT_Int  index1;\n    FT_Int  index2;\n    FT_Int  x;\n    FT_Int  y;\n\n  } AFM_KernPairRec, *AFM_KernPair;\n\n  typedef struct  AFM_FontInfoRec_\n  {\n    FT_Bool        IsCIDFont;\n    FT_BBox        FontBBox;\n    FT_Fixed       Ascender;\n    FT_Fixed       Descender;\n    AFM_TrackKern  TrackKerns;   /* free if non-NULL */\n    FT_Int         NumTrackKern;\n    AFM_KernPair   KernPairs;    /* free if non-NULL */\n    FT_Int         NumKernPair;\n\n  } AFM_FontInfoRec, *AFM_FontInfo;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                ORIGINAL T1_FACE CLASS DEFINITION                  ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  typedef struct T1_FaceRec_*   T1_Face;\n  typedef struct CID_FaceRec_*  CID_Face;\n\n\n  typedef struct  T1_FaceRec_\n  {\n    FT_FaceRec      root;\n    T1_FontRec      type1;\n    const void*     psnames;\n    const void*     psaux;\n    const void*     afm_data;\n    FT_CharMapRec   charmaprecs[2];\n    FT_CharMap      charmaps[2];\n\n    /* support for Multiple Masters fonts */\n    PS_Blend        blend;\n\n    /* undocumented, optional: indices of subroutines that express      */\n    /* the NormalizeDesignVector and the ConvertDesignVector procedure, */\n    /* respectively, as Type 2 charstrings; -1 if keywords not present  */\n    FT_Int           ndv_idx;\n    FT_Int           cdv_idx;\n\n    /* undocumented, optional: has the same meaning as len_buildchar */\n    /* for Type 2 fonts; manipulated by othersubrs 19, 24, and 25    */\n    FT_UInt          len_buildchar;\n    FT_Long*         buildchar;\n\n    /* since version 2.1 - interface to PostScript hinter */\n    const void*     pshinter;\n\n  } T1_FaceRec;\n\n\n  typedef struct  CID_FaceRec_\n  {\n    FT_FaceRec       root;\n    void*            psnames;\n    void*            psaux;\n    CID_FaceInfoRec  cid;\n    PS_FontExtraRec  font_extra;\n#if 0\n    void*            afm_data;\n#endif\n    CID_Subrs        subrs;\n\n    /* since version 2.1 - interface to PostScript hinter */\n    void*            pshinter;\n\n    /* since version 2.1.8, but was originally positioned after `afm_data' */\n    FT_Byte*         binary_data; /* used if hex data has been converted */\n    FT_Stream        cid_stream;\n\n  } CID_FaceRec;\n\n\nFT_END_HEADER\n\n#endif /* __T1TYPES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/internal/tttypes.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  tttypes.h                                                              */\n/*                                                                         */\n/*    Basic SFNT/TrueType type definitions and interface (specification    */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004-2008, 2012-2013 by                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTTYPES_H__\n#define __TTTYPES_H__\n\n\n#include <ft2build.h>\n#include FT_TRUETYPE_TABLES_H\n#include FT_INTERNAL_OBJECTS_H\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n#include FT_MULTIPLE_MASTERS_H\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***             REQUIRED TRUETYPE/OPENTYPE TABLES DEFINITIONS         ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TTC_HeaderRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    TrueType collection header.  This table contains the offsets of    */\n  /*    the font headers of each distinct TrueType face in the file.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    tag     :: Must be `ttc ' to indicate a TrueType collection.       */\n  /*                                                                       */\n  /*    version :: The version number.                                     */\n  /*                                                                       */\n  /*    count   :: The number of faces in the collection.  The             */\n  /*               specification says this should be an unsigned long, but */\n  /*               we use a signed long since we need the value -1 for     */\n  /*               specific purposes.                                      */\n  /*                                                                       */\n  /*    offsets :: The offsets of the font headers, one per face.          */\n  /*                                                                       */\n  typedef struct  TTC_HeaderRec_\n  {\n    FT_ULong   tag;\n    FT_Fixed   version;\n    FT_Long    count;\n    FT_ULong*  offsets;\n\n  } TTC_HeaderRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    SFNT_HeaderRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    SFNT file format header.                                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    format_tag     :: The font format tag.                             */\n  /*                                                                       */\n  /*    num_tables     :: The number of tables in file.                    */\n  /*                                                                       */\n  /*    search_range   :: Must be `16 * (max power of 2 <= num_tables)'.   */\n  /*                                                                       */\n  /*    entry_selector :: Must be log2 of `search_range / 16'.             */\n  /*                                                                       */\n  /*    range_shift    :: Must be `num_tables * 16 - search_range'.        */\n  /*                                                                       */\n  typedef struct  SFNT_HeaderRec_\n  {\n    FT_ULong   format_tag;\n    FT_UShort  num_tables;\n    FT_UShort  search_range;\n    FT_UShort  entry_selector;\n    FT_UShort  range_shift;\n\n    FT_ULong   offset;  /* not in file */\n\n  } SFNT_HeaderRec, *SFNT_Header;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_TableRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure describes a given table of a TrueType font.         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Tag      :: A four-bytes tag describing the table.                 */\n  /*                                                                       */\n  /*    CheckSum :: The table checksum.  This value can be ignored.        */\n  /*                                                                       */\n  /*    Offset   :: The offset of the table from the start of the TrueType */\n  /*                font in its resource.                                  */\n  /*                                                                       */\n  /*    Length   :: The table length (in bytes).                           */\n  /*                                                                       */\n  typedef struct  TT_TableRec_\n  {\n    FT_ULong  Tag;        /*        table type */\n    FT_ULong  CheckSum;   /*    table checksum */\n    FT_ULong  Offset;     /* table file offset */\n    FT_ULong  Length;     /*      table length */\n\n  } TT_TableRec, *TT_Table;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    WOFF_HeaderRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    WOFF file format header.                                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    See                                                                */\n  /*                                                                       */\n  /*      http://www.w3.org/TR/WOFF/#WOFFHeader                            */\n  /*                                                                       */\n  typedef struct  WOFF_HeaderRec_\n  {\n    FT_ULong   signature;\n    FT_ULong   flavor;\n    FT_ULong   length;\n    FT_UShort  num_tables;\n    FT_UShort  reserved;\n    FT_ULong   totalSfntSize;\n    FT_UShort  majorVersion;\n    FT_UShort  minorVersion;\n    FT_ULong   metaOffset;\n    FT_ULong   metaLength;\n    FT_ULong   metaOrigLength;\n    FT_ULong   privOffset;\n    FT_ULong   privLength;\n\n  } WOFF_HeaderRec, *WOFF_Header;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    WOFF_TableRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure describes a given table of a WOFF font.             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Tag        :: A four-bytes tag describing the table.               */\n  /*                                                                       */\n  /*    Offset     :: The offset of the table from the start of the WOFF   */\n  /*                  font in its resource.                                */\n  /*                                                                       */\n  /*    CompLength :: Compressed table length (in bytes).                  */\n  /*                                                                       */\n  /*    OrigLength :: Unompressed table length (in bytes).                 */\n  /*                                                                       */\n  /*    CheckSum   :: The table checksum.  This value can be ignored.      */\n  /*                                                                       */\n  /*    OrigOffset :: The uncompressed table file offset.  This value gets */\n  /*                  computed while constructing the (uncompressed) SFNT  */\n  /*                  header.  It is not contained in the WOFF file.       */\n  /*                                                                       */\n  typedef struct  WOFF_TableRec_\n  {\n    FT_ULong  Tag;           /* table ID                  */\n    FT_ULong  Offset;        /* table file offset         */\n    FT_ULong  CompLength;    /* compressed table length   */\n    FT_ULong  OrigLength;    /* uncompressed table length */\n    FT_ULong  CheckSum;      /* uncompressed checksum     */\n\n    FT_ULong  OrigOffset;    /* uncompressed table file offset */\n                             /* (not in the WOFF file)         */\n  } WOFF_TableRec, *WOFF_Table;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_LongMetricsRec                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling the long metrics of the `hmtx' and `vmtx'     */\n  /*    TrueType tables.  The values are expressed in font units.          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    advance :: The advance width or height for the glyph.              */\n  /*                                                                       */\n  /*    bearing :: The left-side or top-side bearing for the glyph.        */\n  /*                                                                       */\n  typedef struct  TT_LongMetricsRec_\n  {\n    FT_UShort  advance;\n    FT_Short   bearing;\n\n  } TT_LongMetricsRec, *TT_LongMetrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    TT_ShortMetrics                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple type to model the short metrics of the `hmtx' and `vmtx'  */\n  /*    tables.                                                            */\n  /*                                                                       */\n  typedef FT_Short  TT_ShortMetrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_NameEntryRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling TrueType name records.  Name records are used */\n  /*    to store important strings like family name, style name,           */\n  /*    copyright, etc. in _localized_ versions (i.e., language, encoding, */\n  /*    etc).                                                              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    platformID   :: The ID of the name's encoding platform.            */\n  /*                                                                       */\n  /*    encodingID   :: The platform-specific ID for the name's encoding.  */\n  /*                                                                       */\n  /*    languageID   :: The platform-specific ID for the name's language.  */\n  /*                                                                       */\n  /*    nameID       :: The ID specifying what kind of name this is.       */\n  /*                                                                       */\n  /*    stringLength :: The length of the string in bytes.                 */\n  /*                                                                       */\n  /*    stringOffset :: The offset to the string in the `name' table.      */\n  /*                                                                       */\n  /*    string       :: A pointer to the string's bytes.  Note that these  */\n  /*                    are usually UTF-16 encoded characters.             */\n  /*                                                                       */\n  typedef struct  TT_NameEntryRec_\n  {\n    FT_UShort  platformID;\n    FT_UShort  encodingID;\n    FT_UShort  languageID;\n    FT_UShort  nameID;\n    FT_UShort  stringLength;\n    FT_ULong   stringOffset;\n\n    /* this last field is not defined in the spec */\n    /* but used by the FreeType engine            */\n\n    FT_Byte*   string;\n\n  } TT_NameEntryRec, *TT_NameEntry;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_NameTableRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling the TrueType name table.                      */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    format         :: The format of the name table.                    */\n  /*                                                                       */\n  /*    numNameRecords :: The number of names in table.                    */\n  /*                                                                       */\n  /*    storageOffset  :: The offset of the name table in the `name'       */\n  /*                      TrueType table.                                  */\n  /*                                                                       */\n  /*    names          :: An array of name records.                        */\n  /*                                                                       */\n  /*    stream         :: the file's input stream.                         */\n  /*                                                                       */\n  typedef struct  TT_NameTableRec_\n  {\n    FT_UShort         format;\n    FT_UInt           numNameRecords;\n    FT_UInt           storageOffset;\n    TT_NameEntryRec*  names;\n    FT_Stream         stream;\n\n  } TT_NameTableRec, *TT_NameTable;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***             OPTIONAL TRUETYPE/OPENTYPE TABLES DEFINITIONS         ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_GaspRangeRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A tiny structure used to model a gasp range according to the       */\n  /*    TrueType specification.                                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    maxPPEM  :: The maximum ppem value to which `gaspFlag' applies.    */\n  /*                                                                       */\n  /*    gaspFlag :: A flag describing the grid-fitting and anti-aliasing   */\n  /*                modes to be used.                                      */\n  /*                                                                       */\n  typedef struct  TT_GaspRangeRec_\n  {\n    FT_UShort  maxPPEM;\n    FT_UShort  gaspFlag;\n\n  } TT_GaspRangeRec, *TT_GaspRange;\n\n\n#define TT_GASP_GRIDFIT  0x01\n#define TT_GASP_DOGRAY   0x02\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_GaspRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure modeling the TrueType `gasp' table used to specify     */\n  /*    grid-fitting and anti-aliasing behaviour.                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    version    :: The version number.                                  */\n  /*                                                                       */\n  /*    numRanges  :: The number of gasp ranges in table.                  */\n  /*                                                                       */\n  /*    gaspRanges :: An array of gasp ranges.                             */\n  /*                                                                       */\n  typedef struct  TT_Gasp_\n  {\n    FT_UShort     version;\n    FT_UShort     numRanges;\n    TT_GaspRange  gaspRanges;\n\n  } TT_GaspRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                    EMBEDDED BITMAPS SUPPORT                       ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_MetricsRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold the big metrics of a given glyph bitmap   */\n  /*    in a TrueType or OpenType font.  These are usually found in the    */\n  /*    `EBDT' (Microsoft) or `bloc' (Apple) table.                        */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    height       :: The glyph height in pixels.                        */\n  /*                                                                       */\n  /*    width        :: The glyph width in pixels.                         */\n  /*                                                                       */\n  /*    horiBearingX :: The horizontal left bearing.                       */\n  /*                                                                       */\n  /*    horiBearingY :: The horizontal top bearing.                        */\n  /*                                                                       */\n  /*    horiAdvance  :: The horizontal advance.                            */\n  /*                                                                       */\n  /*    vertBearingX :: The vertical left bearing.                         */\n  /*                                                                       */\n  /*    vertBearingY :: The vertical top bearing.                          */\n  /*                                                                       */\n  /*    vertAdvance  :: The vertical advance.                              */\n  /*                                                                       */\n  typedef struct  TT_SBit_MetricsRec_\n  {\n    FT_UShort  height;\n    FT_UShort  width;\n\n    FT_Short   horiBearingX;\n    FT_Short   horiBearingY;\n    FT_UShort  horiAdvance;\n\n    FT_Short   vertBearingX;\n    FT_Short   vertBearingY;\n    FT_UShort  vertAdvance;\n\n  } TT_SBit_MetricsRec, *TT_SBit_Metrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_SmallMetricsRec                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold the small metrics of a given glyph bitmap */\n  /*    in a TrueType or OpenType font.  These are usually found in the    */\n  /*    `EBDT' (Microsoft) or the `bdat' (Apple) table.                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    height   :: The glyph height in pixels.                            */\n  /*                                                                       */\n  /*    width    :: The glyph width in pixels.                             */\n  /*                                                                       */\n  /*    bearingX :: The left-side bearing.                                 */\n  /*                                                                       */\n  /*    bearingY :: The top-side bearing.                                  */\n  /*                                                                       */\n  /*    advance  :: The advance width or height.                           */\n  /*                                                                       */\n  typedef struct  TT_SBit_Small_Metrics_\n  {\n    FT_Byte  height;\n    FT_Byte  width;\n\n    FT_Char  bearingX;\n    FT_Char  bearingY;\n    FT_Byte  advance;\n\n  } TT_SBit_SmallMetricsRec, *TT_SBit_SmallMetrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_LineMetricsRec                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to describe the text line metrics of a given      */\n  /*    bitmap strike, for either a horizontal or vertical layout.         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    ascender                :: The ascender in pixels.                 */\n  /*                                                                       */\n  /*    descender               :: The descender in pixels.                */\n  /*                                                                       */\n  /*    max_width               :: The maximum glyph width in pixels.      */\n  /*                                                                       */\n  /*    caret_slope_enumerator  :: Rise of the caret slope, typically set  */\n  /*                               to 1 for non-italic fonts.              */\n  /*                                                                       */\n  /*    caret_slope_denominator :: Rise of the caret slope, typically set  */\n  /*                               to 0 for non-italic fonts.              */\n  /*                                                                       */\n  /*    caret_offset            :: Offset in pixels to move the caret for  */\n  /*                               proper positioning.                     */\n  /*                                                                       */\n  /*    min_origin_SB           :: Minimum of horiBearingX (resp.          */\n  /*                               vertBearingY).                          */\n  /*    min_advance_SB          :: Minimum of                              */\n  /*                                                                       */\n  /*                                 horizontal advance -                  */\n  /*                                   ( horiBearingX + width )            */\n  /*                                                                       */\n  /*                               resp.                                   */\n  /*                                                                       */\n  /*                                 vertical advance -                    */\n  /*                                   ( vertBearingY + height )           */\n  /*                                                                       */\n  /*    max_before_BL           :: Maximum of horiBearingY (resp.          */\n  /*                               vertBearingY).                          */\n  /*                                                                       */\n  /*    min_after_BL            :: Minimum of                              */\n  /*                                                                       */\n  /*                                 horiBearingY - height                 */\n  /*                                                                       */\n  /*                               resp.                                   */\n  /*                                                                       */\n  /*                                 vertBearingX - width                  */\n  /*                                                                       */\n  /*    pads                    :: Unused (to make the size of the record  */\n  /*                               a multiple of 32 bits.                  */\n  /*                                                                       */\n  typedef struct  TT_SBit_LineMetricsRec_\n  {\n    FT_Char  ascender;\n    FT_Char  descender;\n    FT_Byte  max_width;\n    FT_Char  caret_slope_numerator;\n    FT_Char  caret_slope_denominator;\n    FT_Char  caret_offset;\n    FT_Char  min_origin_SB;\n    FT_Char  min_advance_SB;\n    FT_Char  max_before_BL;\n    FT_Char  min_after_BL;\n    FT_Char  pads[2];\n\n  } TT_SBit_LineMetricsRec, *TT_SBit_LineMetrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_RangeRec                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A TrueType/OpenType subIndexTable as defined in the `EBLC'         */\n  /*    (Microsoft) or `bloc' (Apple) tables.                              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    first_glyph   :: The first glyph index in the range.               */\n  /*                                                                       */\n  /*    last_glyph    :: The last glyph index in the range.                */\n  /*                                                                       */\n  /*    index_format  :: The format of index table.  Valid values are 1    */\n  /*                     to 5.                                             */\n  /*                                                                       */\n  /*    image_format  :: The format of `EBDT' image data.                  */\n  /*                                                                       */\n  /*    image_offset  :: The offset to image data in `EBDT'.               */\n  /*                                                                       */\n  /*    image_size    :: For index formats 2 and 5.  This is the size in   */\n  /*                     bytes of each glyph bitmap.                       */\n  /*                                                                       */\n  /*    big_metrics   :: For index formats 2 and 5.  This is the big       */\n  /*                     metrics for each glyph bitmap.                    */\n  /*                                                                       */\n  /*    num_glyphs    :: For index formats 4 and 5.  This is the number of */\n  /*                     glyphs in the code array.                         */\n  /*                                                                       */\n  /*    glyph_offsets :: For index formats 1 and 3.                        */\n  /*                                                                       */\n  /*    glyph_codes   :: For index formats 4 and 5.                        */\n  /*                                                                       */\n  /*    table_offset  :: The offset of the index table in the `EBLC'       */\n  /*                     table.  Only used during strike loading.          */\n  /*                                                                       */\n  typedef struct  TT_SBit_RangeRec_\n  {\n    FT_UShort           first_glyph;\n    FT_UShort           last_glyph;\n\n    FT_UShort           index_format;\n    FT_UShort           image_format;\n    FT_ULong            image_offset;\n\n    FT_ULong            image_size;\n    TT_SBit_MetricsRec  metrics;\n    FT_ULong            num_glyphs;\n\n    FT_ULong*           glyph_offsets;\n    FT_UShort*          glyph_codes;\n\n    FT_ULong            table_offset;\n\n  } TT_SBit_RangeRec, *TT_SBit_Range;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_StrikeRec                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used describe a given bitmap strike in the `EBLC'      */\n  /*    (Microsoft) or `bloc' (Apple) tables.                              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*   num_index_ranges :: The number of index ranges.                     */\n  /*                                                                       */\n  /*   index_ranges     :: An array of glyph index ranges.                 */\n  /*                                                                       */\n  /*   color_ref        :: Unused.  `color_ref' is put in for future       */\n  /*                       enhancements, but these fields are already      */\n  /*                       in use by other platforms (e.g. Newton).        */\n  /*                       For details, please see                         */\n  /*                                                                       */\n  /*                         http://fonts.apple.com/                       */\n  /*                                TTRefMan/RM06/Chap6bloc.html           */\n  /*                                                                       */\n  /*   hori             :: The line metrics for horizontal layouts.        */\n  /*                                                                       */\n  /*   vert             :: The line metrics for vertical layouts.          */\n  /*                                                                       */\n  /*   start_glyph      :: The lowest glyph index for this strike.         */\n  /*                                                                       */\n  /*   end_glyph        :: The highest glyph index for this strike.        */\n  /*                                                                       */\n  /*   x_ppem           :: The number of horizontal pixels per EM.         */\n  /*                                                                       */\n  /*   y_ppem           :: The number of vertical pixels per EM.           */\n  /*                                                                       */\n  /*   bit_depth        :: The bit depth.  Valid values are 1, 2, 4,       */\n  /*                       and 8.                                          */\n  /*                                                                       */\n  /*   flags            :: Is this a vertical or horizontal strike?  For   */\n  /*                       details, please see                             */\n  /*                                                                       */\n  /*                         http://fonts.apple.com/                       */\n  /*                                TTRefMan/RM06/Chap6bloc.html           */\n  /*                                                                       */\n  typedef struct  TT_SBit_StrikeRec_\n  {\n    FT_Int                  num_ranges;\n    TT_SBit_Range           sbit_ranges;\n    FT_ULong                ranges_offset;\n\n    FT_ULong                color_ref;\n\n    TT_SBit_LineMetricsRec  hori;\n    TT_SBit_LineMetricsRec  vert;\n\n    FT_UShort               start_glyph;\n    FT_UShort               end_glyph;\n\n    FT_Byte                 x_ppem;\n    FT_Byte                 y_ppem;\n\n    FT_Byte                 bit_depth;\n    FT_Char                 flags;\n\n  } TT_SBit_StrikeRec, *TT_SBit_Strike;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_ComponentRec                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure to describe a compound sbit element.            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    glyph_code :: The element's glyph index.                           */\n  /*                                                                       */\n  /*    x_offset   :: The element's left bearing.                          */\n  /*                                                                       */\n  /*    y_offset   :: The element's top bearing.                           */\n  /*                                                                       */\n  typedef struct  TT_SBit_ComponentRec_\n  {\n    FT_UShort  glyph_code;\n    FT_Char    x_offset;\n    FT_Char    y_offset;\n\n  } TT_SBit_ComponentRec, *TT_SBit_Component;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_SBit_ScaleRec                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used describe a given bitmap scaling table, as defined */\n  /*    in the `EBSC' table.                                               */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    hori              :: The horizontal line metrics.                  */\n  /*                                                                       */\n  /*    vert              :: The vertical line metrics.                    */\n  /*                                                                       */\n  /*    x_ppem            :: The number of horizontal pixels per EM.       */\n  /*                                                                       */\n  /*    y_ppem            :: The number of vertical pixels per EM.         */\n  /*                                                                       */\n  /*    x_ppem_substitute :: Substitution x_ppem value.                    */\n  /*                                                                       */\n  /*    y_ppem_substitute :: Substitution y_ppem value.                    */\n  /*                                                                       */\n  typedef struct  TT_SBit_ScaleRec_\n  {\n    TT_SBit_LineMetricsRec  hori;\n    TT_SBit_LineMetricsRec  vert;\n\n    FT_Byte                 x_ppem;\n    FT_Byte                 y_ppem;\n\n    FT_Byte                 x_ppem_substitute;\n    FT_Byte                 y_ppem_substitute;\n\n  } TT_SBit_ScaleRec, *TT_SBit_Scale;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                  POSTSCRIPT GLYPH NAMES SUPPORT                   ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Post_20Rec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Postscript names sub-table, format 2.0.  Stores the PS name of     */\n  /*    each glyph in the font face.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_glyphs    :: The number of named glyphs in the table.          */\n  /*                                                                       */\n  /*    num_names     :: The number of PS names stored in the table.       */\n  /*                                                                       */\n  /*    glyph_indices :: The indices of the glyphs in the names arrays.    */\n  /*                                                                       */\n  /*    glyph_names   :: The PS names not in Mac Encoding.                 */\n  /*                                                                       */\n  typedef struct  TT_Post_20Rec_\n  {\n    FT_UShort   num_glyphs;\n    FT_UShort   num_names;\n    FT_UShort*  glyph_indices;\n    FT_Char**   glyph_names;\n\n  } TT_Post_20Rec, *TT_Post_20;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Post_25Rec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Postscript names sub-table, format 2.5.  Stores the PS name of     */\n  /*    each glyph in the font face.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_glyphs :: The number of glyphs in the table.                   */\n  /*                                                                       */\n  /*    offsets    :: An array of signed offsets in a normal Mac           */\n  /*                  Postscript name encoding.                            */\n  /*                                                                       */\n  typedef struct  TT_Post_25_\n  {\n    FT_UShort  num_glyphs;\n    FT_Char*   offsets;\n\n  } TT_Post_25Rec, *TT_Post_25;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Post_NamesRec                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Postscript names table, either format 2.0 or 2.5.                  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    loaded    :: A flag to indicate whether the PS names are loaded.   */\n  /*                                                                       */\n  /*    format_20 :: The sub-table used for format 2.0.                    */\n  /*                                                                       */\n  /*    format_25 :: The sub-table used for format 2.5.                    */\n  /*                                                                       */\n  typedef struct  TT_Post_NamesRec_\n  {\n    FT_Bool  loaded;\n\n    union\n    {\n      TT_Post_20Rec  format_20;\n      TT_Post_25Rec  format_25;\n\n    } names;\n\n  } TT_Post_NamesRec, *TT_Post_Names;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                    GX VARIATION TABLE SUPPORT                     ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n  typedef struct GX_BlendRec_  *GX_Blend;\n#endif\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***              EMBEDDED BDF PROPERTIES TABLE SUPPORT                ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*\n   * These types are used to support a `BDF ' table that isn't part of the\n   * official TrueType specification.  It is mainly used in SFNT-based\n   * bitmap fonts that were generated from a set of BDF fonts.\n   *\n   * The format of the table is as follows.\n   *\n   *   USHORT   version      `BDF ' table version number, should be 0x0001.\n   *   USHORT   strikeCount  Number of strikes (bitmap sizes) in this table.\n   *   ULONG    stringTable  Offset (from start of BDF table) to string\n   *                         table.\n   *\n   * This is followed by an array of `strikeCount' descriptors, having the\n   * following format.\n   *\n   *   USHORT   ppem         Vertical pixels per EM for this strike.\n   *   USHORT   numItems     Number of items for this strike (properties and\n   *                         atoms).  Maximum is 255.\n   *\n   * This array in turn is followed by `strikeCount' value sets.  Each\n   * `value set' is an array of `numItems' items with the following format.\n   *\n   *   ULONG    item_name    Offset in string table to item name.\n   *   USHORT   item_type    The item type.  Possible values are\n   *                            0 => string (e.g., COMMENT)\n   *                            1 => atom   (e.g., FONT or even SIZE)\n   *                            2 => int32\n   *                            3 => uint32\n   *                         0x10 => A flag to indicate a properties.  This\n   *                                 is ORed with the above values.\n   *   ULONG    item_value   For strings  => Offset into string table without\n   *                                         the corresponding double quotes.\n   *                         For atoms    => Offset into string table.\n   *                         For integers => Direct value.\n   *\n   * All strings in the string table consist of bytes and are\n   * zero-terminated.\n   *\n   */\n\n#ifdef TT_CONFIG_OPTION_BDF\n\n  typedef struct  TT_BDFRec_\n  {\n    FT_Byte*   table;\n    FT_Byte*   table_end;\n    FT_Byte*   strings;\n    FT_ULong   strings_size;\n    FT_UInt    num_strikes;\n    FT_Bool    loaded;\n\n  } TT_BDFRec, *TT_BDF;\n\n#endif /* TT_CONFIG_OPTION_BDF */\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /***                  ORIGINAL TT_FACE CLASS DEFINITION                ***/\n  /***                                                                   ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This structure/class is defined here because it is common to the      */\n  /* following formats: TTF, OpenType-TT, and OpenType-CFF.                */\n  /*                                                                       */\n  /* Note, however, that the classes TT_Size and TT_GlyphSlot are not      */\n  /* shared between font drivers, and are thus defined in `ttobjs.h'.      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    TT_Face                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a TrueType face/font object.  A TT_Face encapsulates   */\n  /*    the resolution and scaling independent parts of a TrueType font    */\n  /*    resource.                                                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The TT_Face structure is also used as a `parent class' for the     */\n  /*    OpenType-CFF class (T2_Face).                                      */\n  /*                                                                       */\n  typedef struct TT_FaceRec_*  TT_Face;\n\n\n  /* a function type used for the truetype bytecode interpreter hooks */\n  typedef FT_Error\n  (*TT_Interpreter)( void*  exec_context );\n\n  /* forward declaration */\n  typedef struct TT_LoaderRec_*  TT_Loader;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Loader_GotoTableFunc                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Seeks a stream to the start of a given TrueType table.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /*    tag    :: A 4-byte tag used to name the table.                     */\n  /*                                                                       */\n  /*    stream :: The input stream.                                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    length :: The length of the table in bytes.  Set to 0 if not       */\n  /*              needed.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream cursor must be at the font file's origin.               */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Loader_GotoTableFunc)( TT_Face    face,\n                              FT_ULong   tag,\n                              FT_Stream  stream,\n                              FT_ULong*  length );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Loader_StartGlyphFunc                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Seeks a stream to the start of a given glyph element, and opens a  */\n  /*    frame for it.                                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    loader      :: The current TrueType glyph loader object.           */\n  /*                                                                       */\n  /*    glyph index :: The index of the glyph to access.                   */\n  /*                                                                       */\n  /*    offset      :: The offset of the glyph according to the            */\n  /*                   `locations' table.                                  */\n  /*                                                                       */\n  /*    byte_count  :: The size of the frame in bytes.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function is normally equivalent to FT_STREAM_SEEK(offset)     */\n  /*    followed by FT_FRAME_ENTER(byte_count) with the loader's stream,   */\n  /*    but alternative formats (e.g. compressed ones) might use something */\n  /*    different.                                                         */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Loader_StartGlyphFunc)( TT_Loader  loader,\n                               FT_UInt    glyph_index,\n                               FT_ULong   offset,\n                               FT_UInt    byte_count );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Loader_ReadGlyphFunc                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Reads one glyph element (its header, a simple glyph, or a          */\n  /*    composite) from the loader's current stream frame.                 */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    loader :: The current TrueType glyph loader object.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  typedef FT_Error\n  (*TT_Loader_ReadGlyphFunc)( TT_Loader  loader );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    TT_Loader_EndGlyphFunc                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Closes the current loader stream frame for the glyph.              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    loader :: The current TrueType glyph loader object.                */\n  /*                                                                       */\n  typedef void\n  (*TT_Loader_EndGlyphFunc)( TT_Loader  loader );\n\n\n  typedef enum TT_SbitTableType_\n  {\n    TT_SBIT_TABLE_TYPE_NONE = 0,\n    TT_SBIT_TABLE_TYPE_EBLC, /* `EBLC' (Microsoft), */\n                             /* `bloc' (Apple)      */\n    TT_SBIT_TABLE_TYPE_CBLC, /* `CBLC' (Google)     */\n    TT_SBIT_TABLE_TYPE_SBIX, /* `sbix' (Apple)      */\n\n    /* do not remove */\n    TT_SBIT_TABLE_TYPE_MAX\n\n  } TT_SbitTableType;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                         TrueType Face Type                            */\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Face                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The TrueType face class.  These objects model the resolution and   */\n  /*    point-size independent data found in a TrueType font file.         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root                 :: The base FT_Face structure, managed by the */\n  /*                            base layer.                                */\n  /*                                                                       */\n  /*    ttc_header           :: The TrueType collection header, used when  */\n  /*                            the file is a `ttc' rather than a `ttf'.   */\n  /*                            For ordinary font files, the field         */\n  /*                            `ttc_header.count' is set to 0.            */\n  /*                                                                       */\n  /*    format_tag           :: The font format tag.                       */\n  /*                                                                       */\n  /*    num_tables           :: The number of TrueType tables in this font */\n  /*                            file.                                      */\n  /*                                                                       */\n  /*    dir_tables           :: The directory of TrueType tables for this  */\n  /*                            font file.                                 */\n  /*                                                                       */\n  /*    header               :: The font's font header (`head' table).     */\n  /*                            Read on font opening.                      */\n  /*                                                                       */\n  /*    horizontal           :: The font's horizontal header (`hhea'       */\n  /*                            table).  This field also contains the      */\n  /*                            associated horizontal metrics table        */\n  /*                            (`hmtx').                                  */\n  /*                                                                       */\n  /*    max_profile          :: The font's maximum profile table.  Read on */\n  /*                            font opening.  Note that some maximum      */\n  /*                            values cannot be taken directly from this  */\n  /*                            table.  We thus define additional fields   */\n  /*                            below to hold the computed maxima.         */\n  /*                                                                       */\n  /*    vertical_info        :: A boolean which is set when the font file  */\n  /*                            contains vertical metrics.  If not, the    */\n  /*                            value of the `vertical' field is           */\n  /*                            undefined.                                 */\n  /*                                                                       */\n  /*    vertical             :: The font's vertical header (`vhea' table). */\n  /*                            This field also contains the associated    */\n  /*                            vertical metrics table (`vmtx'), if found. */\n  /*                            IMPORTANT: The contents of this field is   */\n  /*                            undefined if the `verticalInfo' field is   */\n  /*                            unset.                                     */\n  /*                                                                       */\n  /*    num_names            :: The number of name records within this     */\n  /*                            TrueType font.                             */\n  /*                                                                       */\n  /*    name_table           :: The table of name records (`name').        */\n  /*                                                                       */\n  /*    os2                  :: The font's OS/2 table (`OS/2').            */\n  /*                                                                       */\n  /*    postscript           :: The font's PostScript table (`post'        */\n  /*                            table).  The PostScript glyph names are    */\n  /*                            not loaded by the driver on face opening.  */\n  /*                            See the `ttpost' module for more details.  */\n  /*                                                                       */\n  /*    cmap_table           :: Address of the face's `cmap' SFNT table    */\n  /*                            in memory (it's an extracted frame).       */\n  /*                                                                       */\n  /*    cmap_size            :: The size in bytes of the `cmap_table'      */\n  /*                            described above.                           */\n  /*                                                                       */\n  /*    goto_table           :: A function called by each TrueType table   */\n  /*                            loader to position a stream's cursor to    */\n  /*                            the start of a given table according to    */\n  /*                            its tag.  It defaults to TT_Goto_Face but  */\n  /*                            can be different for strange formats (e.g. */\n  /*                            Type 42).                                  */\n  /*                                                                       */\n  /*    access_glyph_frame   :: A function used to access the frame of a   */\n  /*                            given glyph within the face's font file.   */\n  /*                                                                       */\n  /*    forget_glyph_frame   :: A function used to forget the frame of a   */\n  /*                            given glyph when all data has been loaded. */\n  /*                                                                       */\n  /*    read_glyph_header    :: A function used to read a glyph header.    */\n  /*                            It must be called between an `access' and  */\n  /*                            `forget'.                                  */\n  /*                                                                       */\n  /*    read_simple_glyph    :: A function used to read a simple glyph.    */\n  /*                            It must be called after the header was     */\n  /*                            read, and before the `forget'.             */\n  /*                                                                       */\n  /*    read_composite_glyph :: A function used to read a composite glyph. */\n  /*                            It must be called after the header was     */\n  /*                            read, and before the `forget'.             */\n  /*                                                                       */\n  /*    sfnt                 :: A pointer to the SFNT service.             */\n  /*                                                                       */\n  /*    psnames              :: A pointer to the PostScript names service. */\n  /*                                                                       */\n  /*    hdmx                 :: The face's horizontal device metrics       */\n  /*                            (`hdmx' table).  This table is optional in */\n  /*                            TrueType/OpenType fonts.                   */\n  /*                                                                       */\n  /*    gasp                 :: The grid-fitting and scaling properties    */\n  /*                            table (`gasp').  This table is optional in */\n  /*                            TrueType/OpenType fonts.                   */\n  /*                                                                       */\n  /*    pclt                 :: The `pclt' SFNT table.                     */\n  /*                                                                       */\n  /*    num_sbit_scales      :: The number of sbit scales for this font.   */\n  /*                                                                       */\n  /*    sbit_scales          :: Array of sbit scales embedded in this      */\n  /*                            font.  This table is optional in a         */\n  /*                            TrueType/OpenType font.                    */\n  /*                                                                       */\n  /*    postscript_names     :: A table used to store the Postscript names */\n  /*                            of  the glyphs for this font.  See the     */\n  /*                            file  `ttconfig.h' for comments on the     */\n  /*                            TT_CONFIG_OPTION_POSTSCRIPT_NAMES option.  */\n  /*                                                                       */\n  /*    num_locations        :: The number of glyph locations in this      */\n  /*                            TrueType file.  This should be             */\n  /*                            identical to the number of glyphs.         */\n  /*                            Ignored for Type 2 fonts.                  */\n  /*                                                                       */\n  /*    glyph_locations      :: An array of longs.  These are offsets to   */\n  /*                            glyph data within the `glyf' table.        */\n  /*                            Ignored for Type 2 font faces.             */\n  /*                                                                       */\n  /*    glyf_len             :: The length of the `glyf' table.  Needed    */\n  /*                            for malformed `loca' tables.               */\n  /*                                                                       */\n  /*    font_program_size    :: Size in bytecodes of the face's font       */\n  /*                            program.  0 if none defined.  Ignored for  */\n  /*                            Type 2 fonts.                              */\n  /*                                                                       */\n  /*    font_program         :: The face's font program (bytecode stream)  */\n  /*                            executed at load time, also used during    */\n  /*                            glyph rendering.  Comes from the `fpgm'    */\n  /*                            table.  Ignored for Type 2 font fonts.     */\n  /*                                                                       */\n  /*    cvt_program_size     :: The size in bytecodes of the face's cvt    */\n  /*                            program.  Ignored for Type 2 fonts.        */\n  /*                                                                       */\n  /*    cvt_program          :: The face's cvt program (bytecode stream)   */\n  /*                            executed each time an instance/size is     */\n  /*                            changed/reset.  Comes from the `prep'      */\n  /*                            table.  Ignored for Type 2 fonts.          */\n  /*                                                                       */\n  /*    cvt_size             :: Size of the control value table (in        */\n  /*                            entries).   Ignored for Type 2 fonts.      */\n  /*                                                                       */\n  /*    cvt                  :: The face's original control value table.   */\n  /*                            Coordinates are expressed in unscaled font */\n  /*                            units.  Comes from the `cvt ' table.       */\n  /*                            Ignored for Type 2 fonts.                  */\n  /*                                                                       */\n  /*    num_kern_pairs       :: The number of kerning pairs present in the */\n  /*                            font file.  The engine only loads the      */\n  /*                            first horizontal format 0 kern table it    */\n  /*                            finds in the font file.  Ignored for       */\n  /*                            Type 2 fonts.                              */\n  /*                                                                       */\n  /*    kern_table_index     :: The index of the kerning table in the font */\n  /*                            kerning directory.  Ignored for Type 2     */\n  /*                            fonts.                                     */\n  /*                                                                       */\n  /*    interpreter          :: A pointer to the TrueType bytecode         */\n  /*                            interpreters field is also used to hook    */\n  /*                            the debugger in `ttdebug'.                 */\n  /*                                                                       */\n  /*    unpatented_hinting   :: If true, use only unpatented methods in    */\n  /*                            the bytecode interpreter.                  */\n  /*                                                                       */\n  /*    doblend              :: A boolean which is set if the font should  */\n  /*                            be blended (this is for GX var).           */\n  /*                                                                       */\n  /*    blend                :: Contains the data needed to control GX     */\n  /*                            variation tables (rather like Multiple     */\n  /*                            Master data).                              */\n  /*                                                                       */\n  /*    extra                :: Reserved for third-party font drivers.     */\n  /*                                                                       */\n  /*    postscript_name      :: The PS name of the font.  Used by the      */\n  /*                            postscript name service.                   */\n  /*                                                                       */\n  typedef struct  TT_FaceRec_\n  {\n    FT_FaceRec            root;\n\n    TTC_HeaderRec         ttc_header;\n\n    FT_ULong              format_tag;\n    FT_UShort             num_tables;\n    TT_Table              dir_tables;\n\n    TT_Header             header;       /* TrueType header table          */\n    TT_HoriHeader         horizontal;   /* TrueType horizontal header     */\n\n    TT_MaxProfile         max_profile;\n\n    FT_Bool               vertical_info;\n    TT_VertHeader         vertical;     /* TT Vertical header, if present */\n\n    FT_UShort             num_names;    /* number of name records  */\n    TT_NameTableRec       name_table;   /* name table              */\n\n    TT_OS2                os2;          /* TrueType OS/2 table            */\n    TT_Postscript         postscript;   /* TrueType Postscript table      */\n\n    FT_Byte*              cmap_table;   /* extracted `cmap' table */\n    FT_ULong              cmap_size;\n\n    TT_Loader_GotoTableFunc   goto_table;\n\n    TT_Loader_StartGlyphFunc  access_glyph_frame;\n    TT_Loader_EndGlyphFunc    forget_glyph_frame;\n    TT_Loader_ReadGlyphFunc   read_glyph_header;\n    TT_Loader_ReadGlyphFunc   read_simple_glyph;\n    TT_Loader_ReadGlyphFunc   read_composite_glyph;\n\n    /* a typeless pointer to the SFNT_Interface table used to load */\n    /* the basic TrueType tables in the face object                */\n    void*                 sfnt;\n\n    /* a typeless pointer to the FT_Service_PsCMapsRec table used to */\n    /* handle glyph names <-> unicode & Mac values                   */\n    void*                 psnames;\n\n\n    /***********************************************************************/\n    /*                                                                     */\n    /* Optional TrueType/OpenType tables                                   */\n    /*                                                                     */\n    /***********************************************************************/\n\n    /* grid-fitting and scaling table */\n    TT_GaspRec            gasp;                 /* the `gasp' table */\n\n    /* PCL 5 table */\n    TT_PCLT               pclt;\n\n    /* embedded bitmaps support */\n    FT_ULong              num_sbit_scales;\n    TT_SBit_Scale         sbit_scales;\n\n    /* postscript names table */\n    TT_Post_NamesRec      postscript_names;\n\n\n    /***********************************************************************/\n    /*                                                                     */\n    /* TrueType-specific fields (ignored by the OTF-Type2 driver)          */\n    /*                                                                     */\n    /***********************************************************************/\n\n    /* the font program, if any */\n    FT_ULong              font_program_size;\n    FT_Byte*              font_program;\n\n    /* the cvt program, if any */\n    FT_ULong              cvt_program_size;\n    FT_Byte*              cvt_program;\n\n    /* the original, unscaled, control value table */\n    FT_ULong              cvt_size;\n    FT_Short*             cvt;\n\n    /* A pointer to the bytecode interpreter to use.  This is also */\n    /* used to hook the debugger for the `ttdebug' utility.        */\n    TT_Interpreter        interpreter;\n\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n    /* Use unpatented hinting only. */\n    FT_Bool               unpatented_hinting;\n#endif\n\n    /***********************************************************************/\n    /*                                                                     */\n    /* Other tables or fields. This is used by derivative formats like     */\n    /* OpenType.                                                           */\n    /*                                                                     */\n    /***********************************************************************/\n\n    FT_Generic            extra;\n\n    const char*           postscript_name;\n\n    FT_ULong              glyf_len;\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n    FT_Bool               doblend;\n    GX_Blend              blend;\n#endif\n\n    /* since version 2.2 */\n\n    FT_Byte*              horz_metrics;\n    FT_ULong              horz_metrics_size;\n\n    FT_Byte*              vert_metrics;\n    FT_ULong              vert_metrics_size;\n\n    FT_ULong              num_locations; /* in broken TTF, gid > 0xFFFF */\n    FT_Byte*              glyph_locations;\n\n    FT_Byte*              hdmx_table;\n    FT_ULong              hdmx_table_size;\n    FT_UInt               hdmx_record_count;\n    FT_ULong              hdmx_record_size;\n    FT_Byte*              hdmx_record_sizes;\n\n    FT_Byte*              sbit_table;\n    FT_ULong              sbit_table_size;\n    TT_SbitTableType      sbit_table_type;\n    FT_UInt               sbit_num_strikes;\n\n    FT_Byte*              kern_table;\n    FT_ULong              kern_table_size;\n    FT_UInt               num_kern_tables;\n    FT_UInt32             kern_avail_bits;\n    FT_UInt32             kern_order_bits;\n\n#ifdef TT_CONFIG_OPTION_BDF\n    TT_BDFRec             bdf;\n#endif /* TT_CONFIG_OPTION_BDF */\n\n    /* since 2.3.0 */\n    FT_ULong              horz_metrics_offset;\n    FT_ULong              vert_metrics_offset;\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    /* since 2.4.12 */\n    FT_ULong              sph_found_func_flags; /* special functions found */\n                                                /* for this face           */\n    FT_Bool               sph_compatibility_mode;\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n  } TT_FaceRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  <Struct>                                                             */\n  /*     TT_GlyphZoneRec                                                   */\n  /*                                                                       */\n  /*  <Description>                                                        */\n  /*     A glyph zone is used to load, scale and hint glyph outline        */\n  /*     coordinates.                                                      */\n  /*                                                                       */\n  /*  <Fields>                                                             */\n  /*     memory       :: A handle to the memory manager.                   */\n  /*                                                                       */\n  /*     max_points   :: The maximum size in points of the zone.           */\n  /*                                                                       */\n  /*     max_contours :: Max size in links contours of the zone.           */\n  /*                                                                       */\n  /*     n_points     :: The current number of points in the zone.         */\n  /*                                                                       */\n  /*     n_contours   :: The current number of contours in the zone.       */\n  /*                                                                       */\n  /*     org          :: The original glyph coordinates (font              */\n  /*                     units/scaled).                                    */\n  /*                                                                       */\n  /*     cur          :: The current glyph coordinates (scaled/hinted).    */\n  /*                                                                       */\n  /*     tags         :: The point control tags.                           */\n  /*                                                                       */\n  /*     contours     :: The contours end points.                          */\n  /*                                                                       */\n  /*     first_point  :: Offset of the current subglyph's first point.     */\n  /*                                                                       */\n  typedef struct  TT_GlyphZoneRec_\n  {\n    FT_Memory   memory;\n    FT_UShort   max_points;\n    FT_UShort   max_contours;\n    FT_UShort   n_points;    /* number of points in zone    */\n    FT_Short    n_contours;  /* number of contours          */\n\n    FT_Vector*  org;         /* original point coordinates  */\n    FT_Vector*  cur;         /* current point coordinates   */\n    FT_Vector*  orus;        /* original (unscaled) point coordinates */\n\n    FT_Byte*    tags;        /* current touch flags         */\n    FT_UShort*  contours;    /* contour end points          */\n\n    FT_UShort   first_point; /* offset of first (#0) point  */\n\n  } TT_GlyphZoneRec, *TT_GlyphZone;\n\n\n  /* handle to execution context */\n  typedef struct TT_ExecContextRec_*  TT_ExecContext;\n\n  /* glyph loader structure */\n  typedef struct  TT_LoaderRec_\n  {\n    FT_Face          face;\n    FT_Size          size;\n    FT_GlyphSlot     glyph;\n    FT_GlyphLoader   gloader;\n\n    FT_ULong         load_flags;\n    FT_UInt          glyph_index;\n\n    FT_Stream        stream;\n    FT_Int           byte_len;\n\n    FT_Short         n_contours;\n    FT_BBox          bbox;\n    FT_Int           left_bearing;\n    FT_Int           advance;\n    FT_Int           linear;\n    FT_Bool          linear_def;\n    FT_Vector        pp1;\n    FT_Vector        pp2;\n\n    FT_ULong         glyf_offset;\n\n    /* the zone where we load our glyphs */\n    TT_GlyphZoneRec  base;\n    TT_GlyphZoneRec  zone;\n\n    TT_ExecContext   exec;\n    FT_Byte*         instructions;\n    FT_ULong         ins_pos;\n\n    /* for possible extensibility in other formats */\n    void*            other;\n\n    /* since version 2.1.8 */\n    FT_Int           top_bearing;\n    FT_Int           vadvance;\n    FT_Vector        pp3;\n    FT_Vector        pp4;\n\n    /* since version 2.2.1 */\n    FT_Byte*         cursor;\n    FT_Byte*         limit;\n\n  } TT_LoaderRec;\n\n\nFT_END_HEADER\n\n#endif /* __TTTYPES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/t1tables.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1tables.h                                                             */\n/*                                                                         */\n/*    Basic Type 1/Type 2 tables definitions and interface (specification  */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006, 2008, 2009, 2011, 2014 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T1TABLES_H__\n#define __T1TABLES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    type1_tables                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Type 1 Tables                                                      */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Type~1 (PostScript) specific font tables.                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the definition of Type 1-specific tables,    */\n  /*    including structures related to other PostScript font formats.     */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    PS_FontInfoRec                                                     */\n  /*    PS_FontInfo                                                        */\n  /*    PS_PrivateRec                                                      */\n  /*    PS_Private                                                         */\n  /*                                                                       */\n  /*    CID_FaceDictRec                                                    */\n  /*    CID_FaceDict                                                       */\n  /*    CID_FaceInfoRec                                                    */\n  /*    CID_FaceInfo                                                       */\n  /*                                                                       */\n  /*    FT_Has_PS_Glyph_Names                                              */\n  /*    FT_Get_PS_Font_Info                                                */\n  /*    FT_Get_PS_Font_Private                                             */\n  /*    FT_Get_PS_Font_Value                                               */\n  /*                                                                       */\n  /*    T1_Blend_Flags                                                     */\n  /*    T1_EncodingType                                                    */\n  /*    PS_Dict_Keys                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */\n  /* structures in order to support Multiple Master fonts.               */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_FontInfoRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a Type~1 or Type~2 FontInfo dictionary.  */\n  /*    Note that for Multiple Master fonts, each instance has its own     */\n  /*    FontInfo dictionary.                                               */\n  /*                                                                       */\n  typedef struct  PS_FontInfoRec_\n  {\n    FT_String*  version;\n    FT_String*  notice;\n    FT_String*  full_name;\n    FT_String*  family_name;\n    FT_String*  weight;\n    FT_Long     italic_angle;\n    FT_Bool     is_fixed_pitch;\n    FT_Short    underline_position;\n    FT_UShort   underline_thickness;\n\n  } PS_FontInfoRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_FontInfo                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @PS_FontInfoRec structure.                           */\n  /*                                                                       */\n  typedef struct PS_FontInfoRec_*  PS_FontInfo;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    T1_FontInfo                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This type is equivalent to @PS_FontInfoRec.  It is deprecated but  */\n  /*    kept to maintain source compatibility between various versions of  */\n  /*    FreeType.                                                          */\n  /*                                                                       */\n  typedef PS_FontInfoRec  T1_FontInfo;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_PrivateRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a Type~1 or Type~2 private dictionary.   */\n  /*    Note that for Multiple Master fonts, each instance has its own     */\n  /*    Private dictionary.                                                */\n  /*                                                                       */\n  typedef struct  PS_PrivateRec_\n  {\n    FT_Int     unique_id;\n    FT_Int     lenIV;\n\n    FT_Byte    num_blue_values;\n    FT_Byte    num_other_blues;\n    FT_Byte    num_family_blues;\n    FT_Byte    num_family_other_blues;\n\n    FT_Short   blue_values[14];\n    FT_Short   other_blues[10];\n\n    FT_Short   family_blues      [14];\n    FT_Short   family_other_blues[10];\n\n    FT_Fixed   blue_scale;\n    FT_Int     blue_shift;\n    FT_Int     blue_fuzz;\n\n    FT_UShort  standard_width[1];\n    FT_UShort  standard_height[1];\n\n    FT_Byte    num_snap_widths;\n    FT_Byte    num_snap_heights;\n    FT_Bool    force_bold;\n    FT_Bool    round_stem_up;\n\n    FT_Short   snap_widths [13];  /* including std width  */\n    FT_Short   snap_heights[13];  /* including std height */\n\n    FT_Fixed   expansion_factor;\n\n    FT_Long    language_group;\n    FT_Long    password;\n\n    FT_Short   min_feature[2];\n\n  } PS_PrivateRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_Private                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @PS_PrivateRec structure.                            */\n  /*                                                                       */\n  typedef struct PS_PrivateRec_*  PS_Private;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    T1_Private                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   This type is equivalent to @PS_PrivateRec.  It is deprecated but    */\n  /*   kept to maintain source compatibility between various versions of   */\n  /*   FreeType.                                                           */\n  /*                                                                       */\n  typedef PS_PrivateRec  T1_Private;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    T1_Blend_Flags                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A set of flags used to indicate which fields are present in a      */\n  /*    given blend dictionary (font info or private).  Used to support    */\n  /*    Multiple Masters fonts.                                            */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    T1_BLEND_UNDERLINE_POSITION ::                                     */\n  /*    T1_BLEND_UNDERLINE_THICKNESS ::                                    */\n  /*    T1_BLEND_ITALIC_ANGLE ::                                           */\n  /*    T1_BLEND_BLUE_VALUES ::                                            */\n  /*    T1_BLEND_OTHER_BLUES ::                                            */\n  /*    T1_BLEND_STANDARD_WIDTH ::                                         */\n  /*    T1_BLEND_STANDARD_HEIGHT ::                                        */\n  /*    T1_BLEND_STEM_SNAP_WIDTHS ::                                       */\n  /*    T1_BLEND_STEM_SNAP_HEIGHTS ::                                      */\n  /*    T1_BLEND_BLUE_SCALE ::                                             */\n  /*    T1_BLEND_BLUE_SHIFT ::                                             */\n  /*    T1_BLEND_FAMILY_BLUES ::                                           */\n  /*    T1_BLEND_FAMILY_OTHER_BLUES ::                                     */\n  /*    T1_BLEND_FORCE_BOLD ::                                             */\n  /*                                                                       */\n  typedef enum  T1_Blend_Flags_\n  {\n    /* required fields in a FontInfo blend dictionary */\n    T1_BLEND_UNDERLINE_POSITION = 0,\n    T1_BLEND_UNDERLINE_THICKNESS,\n    T1_BLEND_ITALIC_ANGLE,\n\n    /* required fields in a Private blend dictionary */\n    T1_BLEND_BLUE_VALUES,\n    T1_BLEND_OTHER_BLUES,\n    T1_BLEND_STANDARD_WIDTH,\n    T1_BLEND_STANDARD_HEIGHT,\n    T1_BLEND_STEM_SNAP_WIDTHS,\n    T1_BLEND_STEM_SNAP_HEIGHTS,\n    T1_BLEND_BLUE_SCALE,\n    T1_BLEND_BLUE_SHIFT,\n    T1_BLEND_FAMILY_BLUES,\n    T1_BLEND_FAMILY_OTHER_BLUES,\n    T1_BLEND_FORCE_BOLD,\n\n    T1_BLEND_MAX    /* do not remove */\n\n  } T1_Blend_Flags;\n\n\n  /* these constants are deprecated; use the corresponding */\n  /* `T1_Blend_Flags' values instead                       */\n#define t1_blend_underline_position   T1_BLEND_UNDERLINE_POSITION\n#define t1_blend_underline_thickness  T1_BLEND_UNDERLINE_THICKNESS\n#define t1_blend_italic_angle         T1_BLEND_ITALIC_ANGLE\n#define t1_blend_blue_values          T1_BLEND_BLUE_VALUES\n#define t1_blend_other_blues          T1_BLEND_OTHER_BLUES\n#define t1_blend_standard_widths      T1_BLEND_STANDARD_WIDTH\n#define t1_blend_standard_height      T1_BLEND_STANDARD_HEIGHT\n#define t1_blend_stem_snap_widths     T1_BLEND_STEM_SNAP_WIDTHS\n#define t1_blend_stem_snap_heights    T1_BLEND_STEM_SNAP_HEIGHTS\n#define t1_blend_blue_scale           T1_BLEND_BLUE_SCALE\n#define t1_blend_blue_shift           T1_BLEND_BLUE_SHIFT\n#define t1_blend_family_blues         T1_BLEND_FAMILY_BLUES\n#define t1_blend_family_other_blues   T1_BLEND_FAMILY_OTHER_BLUES\n#define t1_blend_force_bold           T1_BLEND_FORCE_BOLD\n#define t1_blend_max                  T1_BLEND_MAX\n\n  /* */\n\n\n  /* maximum number of Multiple Masters designs, as defined in the spec */\n#define T1_MAX_MM_DESIGNS     16\n\n  /* maximum number of Multiple Masters axes, as defined in the spec */\n#define T1_MAX_MM_AXIS        4\n\n  /* maximum number of elements in a design map */\n#define T1_MAX_MM_MAP_POINTS  20\n\n\n  /* this structure is used to store the BlendDesignMap entry for an axis */\n  typedef struct  PS_DesignMap_\n  {\n    FT_Byte    num_points;\n    FT_Long*   design_points;\n    FT_Fixed*  blend_points;\n\n  } PS_DesignMapRec, *PS_DesignMap;\n\n  /* backwards-compatible definition */\n  typedef PS_DesignMapRec  T1_DesignMap;\n\n\n  typedef struct  PS_BlendRec_\n  {\n    FT_UInt          num_designs;\n    FT_UInt          num_axis;\n\n    FT_String*       axis_names[T1_MAX_MM_AXIS];\n    FT_Fixed*        design_pos[T1_MAX_MM_DESIGNS];\n    PS_DesignMapRec  design_map[T1_MAX_MM_AXIS];\n\n    FT_Fixed*        weight_vector;\n    FT_Fixed*        default_weight_vector;\n\n    PS_FontInfo      font_infos[T1_MAX_MM_DESIGNS + 1];\n    PS_Private       privates  [T1_MAX_MM_DESIGNS + 1];\n\n    FT_ULong         blend_bitflags;\n\n    FT_BBox*         bboxes    [T1_MAX_MM_DESIGNS + 1];\n\n    /* since 2.3.0 */\n\n    /* undocumented, optional: the default design instance;   */\n    /* corresponds to default_weight_vector --                */\n    /* num_default_design_vector == 0 means it is not present */\n    /* in the font and associated metrics files               */\n    FT_UInt          default_design_vector[T1_MAX_MM_DESIGNS];\n    FT_UInt          num_default_design_vector;\n\n  } PS_BlendRec, *PS_Blend;\n\n\n  /* backwards-compatible definition */\n  typedef PS_BlendRec  T1_Blend;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceDictRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to represent data in a CID top-level dictionary.  */\n  /*                                                                       */\n  typedef struct  CID_FaceDictRec_\n  {\n    PS_PrivateRec  private_dict;\n\n    FT_UInt        len_buildchar;\n    FT_Fixed       forcebold_threshold;\n    FT_Pos         stroke_width;\n    FT_Fixed       expansion_factor;\n\n    FT_Byte        paint_type;\n    FT_Byte        font_type;\n    FT_Matrix      font_matrix;\n    FT_Vector      font_offset;\n\n    FT_UInt        num_subrs;\n    FT_ULong       subrmap_offset;\n    FT_Int         sd_bytes;\n\n  } CID_FaceDictRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceDict                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @CID_FaceDictRec structure.                          */\n  /*                                                                       */\n  typedef struct CID_FaceDictRec_*  CID_FaceDict;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FontDict                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This type is equivalent to @CID_FaceDictRec.  It is deprecated but */\n  /*    kept to maintain source compatibility between various versions of  */\n  /*    FreeType.                                                          */\n  /*                                                                       */\n  typedef CID_FaceDictRec  CID_FontDict;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceInfoRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to represent CID Face information.                */\n  /*                                                                       */\n  typedef struct  CID_FaceInfoRec_\n  {\n    FT_String*      cid_font_name;\n    FT_Fixed        cid_version;\n    FT_Int          cid_font_type;\n\n    FT_String*      registry;\n    FT_String*      ordering;\n    FT_Int          supplement;\n\n    PS_FontInfoRec  font_info;\n    FT_BBox         font_bbox;\n    FT_ULong        uid_base;\n\n    FT_Int          num_xuid;\n    FT_ULong        xuid[16];\n\n    FT_ULong        cidmap_offset;\n    FT_Int          fd_bytes;\n    FT_Int          gd_bytes;\n    FT_ULong        cid_count;\n\n    FT_Int          num_dicts;\n    CID_FaceDict    font_dicts;\n\n    FT_ULong        data_offset;\n\n  } CID_FaceInfoRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceInfo                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a @CID_FaceInfoRec structure.                          */\n  /*                                                                       */\n  typedef struct CID_FaceInfoRec_*  CID_FaceInfo;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_Info                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   This type is equivalent to @CID_FaceInfoRec.  It is deprecated but  */\n  /*   kept to maintain source compatibility between various versions of   */\n  /*   FreeType.                                                           */\n  /*                                                                       */\n  typedef CID_FaceInfoRec  CID_Info;\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Has_PS_Glyph_Names\n   *\n   * @description:\n   *    Return true if a given face provides reliable PostScript glyph\n   *    names.  This is similar to using the @FT_HAS_GLYPH_NAMES macro,\n   *    except that certain fonts (mostly TrueType) contain incorrect\n   *    glyph name tables.\n   *\n   *    When this function returns true, the caller is sure that the glyph\n   *    names returned by @FT_Get_Glyph_Name are reliable.\n   *\n   * @input:\n   *    face ::\n   *       face handle\n   *\n   * @return:\n   *    Boolean.  True if glyph names are reliable.\n   *\n   */\n  FT_EXPORT( FT_Int )\n  FT_Has_PS_Glyph_Names( FT_Face  face );\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Get_PS_Font_Info\n   *\n   * @description:\n   *    Retrieve the @PS_FontInfoRec structure corresponding to a given\n   *    PostScript font.\n   *\n   * @input:\n   *    face ::\n   *       PostScript face handle.\n   *\n   * @output:\n   *    afont_info ::\n   *       Output font info structure pointer.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    The string pointers within the font info structure are owned by\n   *    the face and don't need to be freed by the caller.\n   *\n   *    If the font's format is not PostScript-based, this function will\n   *    return the `FT_Err_Invalid_Argument' error code.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_PS_Font_Info( FT_Face      face,\n                       PS_FontInfo  afont_info );\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Get_PS_Font_Private\n   *\n   * @description:\n   *    Retrieve the @PS_PrivateRec structure corresponding to a given\n   *    PostScript font.\n   *\n   * @input:\n   *    face ::\n   *       PostScript face handle.\n   *\n   * @output:\n   *    afont_private ::\n   *       Output private dictionary structure pointer.\n   *\n   * @return:\n   *    FreeType error code.  0~means success.\n   *\n   * @note:\n   *    The string pointers within the @PS_PrivateRec structure are owned by\n   *    the face and don't need to be freed by the caller.\n   *\n   *    If the font's format is not PostScript-based, this function returns\n   *    the `FT_Err_Invalid_Argument' error code.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_PS_Font_Private( FT_Face     face,\n                          PS_Private  afont_private );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    T1_EncodingType                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration describing the `Encoding' entry in a Type 1         */\n  /*    dictionary.                                                        */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    T1_ENCODING_TYPE_NONE ::                                           */\n  /*    T1_ENCODING_TYPE_ARRAY ::                                          */\n  /*    T1_ENCODING_TYPE_STANDARD ::                                       */\n  /*    T1_ENCODING_TYPE_ISOLATIN1 ::                                      */\n  /*    T1_ENCODING_TYPE_EXPERT ::                                         */\n  /*                                                                       */\n  typedef enum  T1_EncodingType_\n  {\n    T1_ENCODING_TYPE_NONE = 0,\n    T1_ENCODING_TYPE_ARRAY,\n    T1_ENCODING_TYPE_STANDARD,\n    T1_ENCODING_TYPE_ISOLATIN1,\n    T1_ENCODING_TYPE_EXPERT\n\n  } T1_EncodingType;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    PS_Dict_Keys                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used in calls to @FT_Get_PS_Font_Value to identify  */\n  /*    the Type~1 dictionary entry to retrieve.                           */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    PS_DICT_FONT_TYPE ::                                               */\n  /*    PS_DICT_FONT_MATRIX ::                                             */\n  /*    PS_DICT_FONT_BBOX ::                                               */\n  /*    PS_DICT_PAINT_TYPE ::                                              */\n  /*    PS_DICT_FONT_NAME ::                                               */\n  /*    PS_DICT_UNIQUE_ID ::                                               */\n  /*    PS_DICT_NUM_CHAR_STRINGS ::                                        */\n  /*    PS_DICT_CHAR_STRING_KEY ::                                         */\n  /*    PS_DICT_CHAR_STRING ::                                             */\n  /*    PS_DICT_ENCODING_TYPE ::                                           */\n  /*    PS_DICT_ENCODING_ENTRY ::                                          */\n  /*    PS_DICT_NUM_SUBRS ::                                               */\n  /*    PS_DICT_SUBR ::                                                    */\n  /*    PS_DICT_STD_HW ::                                                  */\n  /*    PS_DICT_STD_VW ::                                                  */\n  /*    PS_DICT_NUM_BLUE_VALUES ::                                         */\n  /*    PS_DICT_BLUE_VALUE ::                                              */\n  /*    PS_DICT_BLUE_FUZZ ::                                               */\n  /*    PS_DICT_NUM_OTHER_BLUES ::                                         */\n  /*    PS_DICT_OTHER_BLUE ::                                              */\n  /*    PS_DICT_NUM_FAMILY_BLUES ::                                        */\n  /*    PS_DICT_FAMILY_BLUE ::                                             */\n  /*    PS_DICT_NUM_FAMILY_OTHER_BLUES ::                                  */\n  /*    PS_DICT_FAMILY_OTHER_BLUE ::                                       */\n  /*    PS_DICT_BLUE_SCALE ::                                              */\n  /*    PS_DICT_BLUE_SHIFT ::                                              */\n  /*    PS_DICT_NUM_STEM_SNAP_H ::                                         */\n  /*    PS_DICT_STEM_SNAP_H ::                                             */\n  /*    PS_DICT_NUM_STEM_SNAP_V ::                                         */\n  /*    PS_DICT_STEM_SNAP_V ::                                             */\n  /*    PS_DICT_FORCE_BOLD ::                                              */\n  /*    PS_DICT_RND_STEM_UP ::                                             */\n  /*    PS_DICT_MIN_FEATURE ::                                             */\n  /*    PS_DICT_LEN_IV ::                                                  */\n  /*    PS_DICT_PASSWORD ::                                                */\n  /*    PS_DICT_LANGUAGE_GROUP ::                                          */\n  /*    PS_DICT_VERSION ::                                                 */\n  /*    PS_DICT_NOTICE ::                                                  */\n  /*    PS_DICT_FULL_NAME ::                                               */\n  /*    PS_DICT_FAMILY_NAME ::                                             */\n  /*    PS_DICT_WEIGHT ::                                                  */\n  /*    PS_DICT_IS_FIXED_PITCH ::                                          */\n  /*    PS_DICT_UNDERLINE_POSITION ::                                      */\n  /*    PS_DICT_UNDERLINE_THICKNESS ::                                     */\n  /*    PS_DICT_FS_TYPE ::                                                 */\n  /*    PS_DICT_ITALIC_ANGLE ::                                            */\n  /*                                                                       */\n  typedef enum  PS_Dict_Keys_\n  {\n    /* conventionally in the font dictionary */\n    PS_DICT_FONT_TYPE,              /* FT_Byte         */\n    PS_DICT_FONT_MATRIX,            /* FT_Fixed        */\n    PS_DICT_FONT_BBOX,              /* FT_Fixed        */\n    PS_DICT_PAINT_TYPE,             /* FT_Byte         */\n    PS_DICT_FONT_NAME,              /* FT_String*      */\n    PS_DICT_UNIQUE_ID,              /* FT_Int          */\n    PS_DICT_NUM_CHAR_STRINGS,       /* FT_Int          */\n    PS_DICT_CHAR_STRING_KEY,        /* FT_String*      */\n    PS_DICT_CHAR_STRING,            /* FT_String*      */\n    PS_DICT_ENCODING_TYPE,          /* T1_EncodingType */\n    PS_DICT_ENCODING_ENTRY,         /* FT_String*      */\n\n    /* conventionally in the font Private dictionary */\n    PS_DICT_NUM_SUBRS,              /* FT_Int     */\n    PS_DICT_SUBR,                   /* FT_String* */\n    PS_DICT_STD_HW,                 /* FT_UShort  */\n    PS_DICT_STD_VW,                 /* FT_UShort  */\n    PS_DICT_NUM_BLUE_VALUES,        /* FT_Byte    */\n    PS_DICT_BLUE_VALUE,             /* FT_Short   */\n    PS_DICT_BLUE_FUZZ,              /* FT_Int     */\n    PS_DICT_NUM_OTHER_BLUES,        /* FT_Byte    */\n    PS_DICT_OTHER_BLUE,             /* FT_Short   */\n    PS_DICT_NUM_FAMILY_BLUES,       /* FT_Byte    */\n    PS_DICT_FAMILY_BLUE,            /* FT_Short   */\n    PS_DICT_NUM_FAMILY_OTHER_BLUES, /* FT_Byte    */\n    PS_DICT_FAMILY_OTHER_BLUE,      /* FT_Short   */\n    PS_DICT_BLUE_SCALE,             /* FT_Fixed   */\n    PS_DICT_BLUE_SHIFT,             /* FT_Int     */\n    PS_DICT_NUM_STEM_SNAP_H,        /* FT_Byte    */\n    PS_DICT_STEM_SNAP_H,            /* FT_Short   */\n    PS_DICT_NUM_STEM_SNAP_V,        /* FT_Byte    */\n    PS_DICT_STEM_SNAP_V,            /* FT_Short   */\n    PS_DICT_FORCE_BOLD,             /* FT_Bool    */\n    PS_DICT_RND_STEM_UP,            /* FT_Bool    */\n    PS_DICT_MIN_FEATURE,            /* FT_Short   */\n    PS_DICT_LEN_IV,                 /* FT_Int     */\n    PS_DICT_PASSWORD,               /* FT_Long    */\n    PS_DICT_LANGUAGE_GROUP,         /* FT_Long    */\n\n    /* conventionally in the font FontInfo dictionary */\n    PS_DICT_VERSION,                /* FT_String* */\n    PS_DICT_NOTICE,                 /* FT_String* */\n    PS_DICT_FULL_NAME,              /* FT_String* */\n    PS_DICT_FAMILY_NAME,            /* FT_String* */\n    PS_DICT_WEIGHT,                 /* FT_String* */\n    PS_DICT_IS_FIXED_PITCH,         /* FT_Bool    */\n    PS_DICT_UNDERLINE_POSITION,     /* FT_Short   */\n    PS_DICT_UNDERLINE_THICKNESS,    /* FT_UShort  */\n    PS_DICT_FS_TYPE,                /* FT_UShort  */\n    PS_DICT_ITALIC_ANGLE,           /* FT_Long    */\n\n    PS_DICT_MAX = PS_DICT_ITALIC_ANGLE\n\n  } PS_Dict_Keys;\n\n\n  /************************************************************************\n   *\n   * @function:\n   *    FT_Get_PS_Font_Value\n   *\n   * @description:\n   *    Retrieve the value for the supplied key from a PostScript font.\n   *\n   * @input:\n   *    face ::\n   *       PostScript face handle.\n   *\n   *    key ::\n   *       An enumeration value representing the dictionary key to retrieve.\n   *\n   *    idx ::\n   *       For array values, this specifies the index to be returned.\n   *\n   *    value ::\n   *       A pointer to memory into which to write the value.\n   *\n   *    valen_len ::\n   *       The size, in bytes, of the memory supplied for the value.\n   *\n   * @output:\n   *    value ::\n   *       The value matching the above key, if it exists.\n   *\n   * @return:\n   *    The amount of memory (in bytes) required to hold the requested\n   *    value (if it exists, -1 otherwise).\n   *\n   * @note:\n   *    The values returned are not pointers into the internal structures of\n   *    the face, but are `fresh' copies, so that the memory containing them\n   *    belongs to the calling application.  This also enforces the\n   *    `read-only' nature of these values, i.e., this function cannot be\n   *    used to manipulate the face.\n   *\n   *    `value' is a void pointer because the values returned can be of\n   *    various types.\n   *\n   *    If either `value' is NULL or `value_len' is too small, just the\n   *    required memory size for the requested entry is returned.\n   *\n   *    The `idx' parameter is used, not only to retrieve elements of, for\n   *    example, the FontMatrix or FontBBox, but also to retrieve name keys\n   *    from the CharStrings dictionary, and the charstrings themselves.  It\n   *    is ignored for atomic values.\n   *\n   *    PS_DICT_BLUE_SCALE returns a value that is scaled up by 1000.  To\n   *    get the value as in the font stream, you need to divide by\n   *    65536000.0 (to remove the FT_Fixed scale, and the x1000 scale).\n   *\n   *    IMPORTANT: Only key/value pairs read by the FreeType interpreter can\n   *    be retrieved.  So, for example, PostScript procedures such as NP,\n   *    ND, and RD are not available.  Arbitrary keys are, obviously, not be\n   *    available either.\n   *\n   *    If the font's format is not PostScript-based, this function returns\n   *    the `FT_Err_Invalid_Argument' error code.\n   *\n   */\n  FT_EXPORT( FT_Long )\n  FT_Get_PS_Font_Value( FT_Face       face,\n                        PS_Dict_Keys  key,\n                        FT_UInt       idx,\n                        void         *value,\n                        FT_Long       value_len );\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __T1TABLES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ttnameid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttnameid.h                                                             */\n/*                                                                         */\n/*    TrueType name ID definitions (specification only).                   */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006-2008, 2012-2014 by                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTNAMEID_H__\n#define __TTNAMEID_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    truetype_tables                                                    */\n  /*                                                                       */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values for the `platform' identifier code in the name        */\n  /* records of the TTF `name' table.                                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_PLATFORM_XXX\n   *\n   * @description:\n   *   A list of valid values for the `platform_id' identifier code in\n   *   @FT_CharMapRec and @FT_SfntName structures.\n   *\n   * @values:\n   *   TT_PLATFORM_APPLE_UNICODE ::\n   *     Used by Apple to indicate a Unicode character map and/or name entry.\n   *     See @TT_APPLE_ID_XXX for corresponding `encoding_id' values.  Note\n   *     that name entries in this format are coded as big-endian UCS-2\n   *     character codes _only_.\n   *\n   *   TT_PLATFORM_MACINTOSH ::\n   *     Used by Apple to indicate a MacOS-specific charmap and/or name entry.\n   *     See @TT_MAC_ID_XXX for corresponding `encoding_id' values.  Note that\n   *     most TrueType fonts contain an Apple roman charmap to be usable on\n   *     MacOS systems (even if they contain a Microsoft charmap as well).\n   *\n   *   TT_PLATFORM_ISO ::\n   *     This value was used to specify ISO/IEC 10646 charmaps.  It is however\n   *     now deprecated.  See @TT_ISO_ID_XXX for a list of corresponding\n   *     `encoding_id' values.\n   *\n   *   TT_PLATFORM_MICROSOFT ::\n   *     Used by Microsoft to indicate Windows-specific charmaps.  See\n   *     @TT_MS_ID_XXX for a list of corresponding `encoding_id' values.\n   *     Note that most fonts contain a Unicode charmap using\n   *     (TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS).\n   *\n   *   TT_PLATFORM_CUSTOM ::\n   *     Used to indicate application-specific charmaps.\n   *\n   *   TT_PLATFORM_ADOBE ::\n   *     This value isn't part of any font format specification, but is used\n   *     by FreeType to report Adobe-specific charmaps in an @FT_CharMapRec\n   *     structure.  See @TT_ADOBE_ID_XXX.\n   */\n\n#define TT_PLATFORM_APPLE_UNICODE  0\n#define TT_PLATFORM_MACINTOSH      1\n#define TT_PLATFORM_ISO            2 /* deprecated */\n#define TT_PLATFORM_MICROSOFT      3\n#define TT_PLATFORM_CUSTOM         4\n#define TT_PLATFORM_ADOBE          7 /* artificial */\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_APPLE_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_APPLE_UNICODE charmaps and name entries.\n   *\n   * @values:\n   *   TT_APPLE_ID_DEFAULT ::\n   *     Unicode version 1.0.\n   *\n   *   TT_APPLE_ID_UNICODE_1_1 ::\n   *     Unicode 1.1; specifies Hangul characters starting at U+34xx.\n   *\n   *   TT_APPLE_ID_ISO_10646 ::\n   *     Deprecated (identical to preceding).\n   *\n   *   TT_APPLE_ID_UNICODE_2_0 ::\n   *     Unicode 2.0 and beyond (UTF-16 BMP only).\n   *\n   *   TT_APPLE_ID_UNICODE_32 ::\n   *     Unicode 3.1 and beyond, using UTF-32.\n   *\n   *   TT_APPLE_ID_VARIANT_SELECTOR ::\n   *     From Adobe, not Apple.  Not a normal cmap.  Specifies variations\n   *     on a real cmap.\n   */\n\n#define TT_APPLE_ID_DEFAULT           0 /* Unicode 1.0 */\n#define TT_APPLE_ID_UNICODE_1_1       1 /* specify Hangul at U+34xx */\n#define TT_APPLE_ID_ISO_10646         2 /* deprecated */\n#define TT_APPLE_ID_UNICODE_2_0       3 /* or later */\n#define TT_APPLE_ID_UNICODE_32        4 /* 2.0 or later, full repertoire */\n#define TT_APPLE_ID_VARIANT_SELECTOR  5 /* variation selector data */\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_MAC_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_MACINTOSH charmaps and name entries.\n   *\n   * @values:\n   *   TT_MAC_ID_ROMAN ::\n   *   TT_MAC_ID_JAPANESE ::\n   *   TT_MAC_ID_TRADITIONAL_CHINESE ::\n   *   TT_MAC_ID_KOREAN ::\n   *   TT_MAC_ID_ARABIC ::\n   *   TT_MAC_ID_HEBREW ::\n   *   TT_MAC_ID_GREEK ::\n   *   TT_MAC_ID_RUSSIAN ::\n   *   TT_MAC_ID_RSYMBOL ::\n   *   TT_MAC_ID_DEVANAGARI ::\n   *   TT_MAC_ID_GURMUKHI ::\n   *   TT_MAC_ID_GUJARATI ::\n   *   TT_MAC_ID_ORIYA ::\n   *   TT_MAC_ID_BENGALI ::\n   *   TT_MAC_ID_TAMIL ::\n   *   TT_MAC_ID_TELUGU ::\n   *   TT_MAC_ID_KANNADA ::\n   *   TT_MAC_ID_MALAYALAM ::\n   *   TT_MAC_ID_SINHALESE ::\n   *   TT_MAC_ID_BURMESE ::\n   *   TT_MAC_ID_KHMER ::\n   *   TT_MAC_ID_THAI ::\n   *   TT_MAC_ID_LAOTIAN ::\n   *   TT_MAC_ID_GEORGIAN ::\n   *   TT_MAC_ID_ARMENIAN ::\n   *   TT_MAC_ID_MALDIVIAN ::\n   *   TT_MAC_ID_SIMPLIFIED_CHINESE ::\n   *   TT_MAC_ID_TIBETAN ::\n   *   TT_MAC_ID_MONGOLIAN ::\n   *   TT_MAC_ID_GEEZ ::\n   *   TT_MAC_ID_SLAVIC ::\n   *   TT_MAC_ID_VIETNAMESE ::\n   *   TT_MAC_ID_SINDHI ::\n   *   TT_MAC_ID_UNINTERP ::\n   */\n\n#define TT_MAC_ID_ROMAN                 0\n#define TT_MAC_ID_JAPANESE              1\n#define TT_MAC_ID_TRADITIONAL_CHINESE   2\n#define TT_MAC_ID_KOREAN                3\n#define TT_MAC_ID_ARABIC                4\n#define TT_MAC_ID_HEBREW                5\n#define TT_MAC_ID_GREEK                 6\n#define TT_MAC_ID_RUSSIAN               7\n#define TT_MAC_ID_RSYMBOL               8\n#define TT_MAC_ID_DEVANAGARI            9\n#define TT_MAC_ID_GURMUKHI             10\n#define TT_MAC_ID_GUJARATI             11\n#define TT_MAC_ID_ORIYA                12\n#define TT_MAC_ID_BENGALI              13\n#define TT_MAC_ID_TAMIL                14\n#define TT_MAC_ID_TELUGU               15\n#define TT_MAC_ID_KANNADA              16\n#define TT_MAC_ID_MALAYALAM            17\n#define TT_MAC_ID_SINHALESE            18\n#define TT_MAC_ID_BURMESE              19\n#define TT_MAC_ID_KHMER                20\n#define TT_MAC_ID_THAI                 21\n#define TT_MAC_ID_LAOTIAN              22\n#define TT_MAC_ID_GEORGIAN             23\n#define TT_MAC_ID_ARMENIAN             24\n#define TT_MAC_ID_MALDIVIAN            25\n#define TT_MAC_ID_SIMPLIFIED_CHINESE   25\n#define TT_MAC_ID_TIBETAN              26\n#define TT_MAC_ID_MONGOLIAN            27\n#define TT_MAC_ID_GEEZ                 28\n#define TT_MAC_ID_SLAVIC               29\n#define TT_MAC_ID_VIETNAMESE           30\n#define TT_MAC_ID_SINDHI               31\n#define TT_MAC_ID_UNINTERP             32\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_ISO_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_ISO charmaps and name entries.\n   *\n   *   Their use is now deprecated.\n   *\n   * @values:\n   *   TT_ISO_ID_7BIT_ASCII ::\n   *     ASCII.\n   *   TT_ISO_ID_10646 ::\n   *     ISO/10646.\n   *   TT_ISO_ID_8859_1 ::\n   *     Also known as Latin-1.\n   */\n\n#define TT_ISO_ID_7BIT_ASCII  0\n#define TT_ISO_ID_10646       1\n#define TT_ISO_ID_8859_1      2\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_MS_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_MICROSOFT charmaps and name entries.\n   *\n   * @values:\n   *   TT_MS_ID_SYMBOL_CS ::\n   *     Corresponds to Microsoft symbol encoding. See\n   *     @FT_ENCODING_MS_SYMBOL.\n   *\n   *   TT_MS_ID_UNICODE_CS ::\n   *     Corresponds to a Microsoft WGL4 charmap, matching Unicode.  See\n   *     @FT_ENCODING_UNICODE.\n   *\n   *   TT_MS_ID_SJIS ::\n   *     Corresponds to SJIS Japanese encoding.  See @FT_ENCODING_SJIS.\n   *\n   *   TT_MS_ID_GB2312 ::\n   *     Corresponds to Simplified Chinese as used in Mainland China.  See\n   *     @FT_ENCODING_GB2312.\n   *\n   *   TT_MS_ID_BIG_5 ::\n   *     Corresponds to Traditional Chinese as used in Taiwan and Hong Kong.\n   *     See @FT_ENCODING_BIG5.\n   *\n   *   TT_MS_ID_WANSUNG ::\n   *     Corresponds to Korean Wansung encoding.  See @FT_ENCODING_WANSUNG.\n   *\n   *   TT_MS_ID_JOHAB ::\n   *     Corresponds to Johab encoding.  See @FT_ENCODING_JOHAB.\n   *\n   *   TT_MS_ID_UCS_4 ::\n   *     Corresponds to UCS-4 or UTF-32 charmaps.  This has been added to\n   *     the OpenType specification version 1.4 (mid-2001.)\n   */\n\n#define TT_MS_ID_SYMBOL_CS    0\n#define TT_MS_ID_UNICODE_CS   1\n#define TT_MS_ID_SJIS         2\n#define TT_MS_ID_GB2312       3\n#define TT_MS_ID_BIG_5        4\n#define TT_MS_ID_WANSUNG      5\n#define TT_MS_ID_JOHAB        6\n#define TT_MS_ID_UCS_4       10\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_ADOBE_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_ADOBE charmaps.  This is a FreeType-specific extension!\n   *\n   * @values:\n   *   TT_ADOBE_ID_STANDARD ::\n   *     Adobe standard encoding.\n   *   TT_ADOBE_ID_EXPERT ::\n   *     Adobe expert encoding.\n   *   TT_ADOBE_ID_CUSTOM ::\n   *     Adobe custom encoding.\n   *   TT_ADOBE_ID_LATIN_1 ::\n   *     Adobe Latin~1 encoding.\n   */\n\n#define TT_ADOBE_ID_STANDARD  0\n#define TT_ADOBE_ID_EXPERT    1\n#define TT_ADOBE_ID_CUSTOM    2\n#define TT_ADOBE_ID_LATIN_1   3\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values of the language identifier field in the name records  */\n  /* of the TTF `name' table if the `platform' identifier code is          */\n  /* TT_PLATFORM_MACINTOSH.  These values are also used as return values   */\n  /* for function @FT_Get_CMap_Language_ID.                                */\n  /*                                                                       */\n  /* The canonical source for the Apple assigned Language ID's is at       */\n  /*                                                                       */\n  /*   https://developer.apple.com/fonts/TTRefMan/RM06/Chap6name.html      */\n  /*                                                                       */\n#define TT_MAC_LANGID_ENGLISH                       0\n#define TT_MAC_LANGID_FRENCH                        1\n#define TT_MAC_LANGID_GERMAN                        2\n#define TT_MAC_LANGID_ITALIAN                       3\n#define TT_MAC_LANGID_DUTCH                         4\n#define TT_MAC_LANGID_SWEDISH                       5\n#define TT_MAC_LANGID_SPANISH                       6\n#define TT_MAC_LANGID_DANISH                        7\n#define TT_MAC_LANGID_PORTUGUESE                    8\n#define TT_MAC_LANGID_NORWEGIAN                     9\n#define TT_MAC_LANGID_HEBREW                       10\n#define TT_MAC_LANGID_JAPANESE                     11\n#define TT_MAC_LANGID_ARABIC                       12\n#define TT_MAC_LANGID_FINNISH                      13\n#define TT_MAC_LANGID_GREEK                        14\n#define TT_MAC_LANGID_ICELANDIC                    15\n#define TT_MAC_LANGID_MALTESE                      16\n#define TT_MAC_LANGID_TURKISH                      17\n#define TT_MAC_LANGID_CROATIAN                     18\n#define TT_MAC_LANGID_CHINESE_TRADITIONAL          19\n#define TT_MAC_LANGID_URDU                         20\n#define TT_MAC_LANGID_HINDI                        21\n#define TT_MAC_LANGID_THAI                         22\n#define TT_MAC_LANGID_KOREAN                       23\n#define TT_MAC_LANGID_LITHUANIAN                   24\n#define TT_MAC_LANGID_POLISH                       25\n#define TT_MAC_LANGID_HUNGARIAN                    26\n#define TT_MAC_LANGID_ESTONIAN                     27\n#define TT_MAC_LANGID_LETTISH                      28\n#define TT_MAC_LANGID_SAAMISK                      29\n#define TT_MAC_LANGID_FAEROESE                     30\n#define TT_MAC_LANGID_FARSI                        31\n#define TT_MAC_LANGID_RUSSIAN                      32\n#define TT_MAC_LANGID_CHINESE_SIMPLIFIED           33\n#define TT_MAC_LANGID_FLEMISH                      34\n#define TT_MAC_LANGID_IRISH                        35\n#define TT_MAC_LANGID_ALBANIAN                     36\n#define TT_MAC_LANGID_ROMANIAN                     37\n#define TT_MAC_LANGID_CZECH                        38\n#define TT_MAC_LANGID_SLOVAK                       39\n#define TT_MAC_LANGID_SLOVENIAN                    40\n#define TT_MAC_LANGID_YIDDISH                      41\n#define TT_MAC_LANGID_SERBIAN                      42\n#define TT_MAC_LANGID_MACEDONIAN                   43\n#define TT_MAC_LANGID_BULGARIAN                    44\n#define TT_MAC_LANGID_UKRAINIAN                    45\n#define TT_MAC_LANGID_BYELORUSSIAN                 46\n#define TT_MAC_LANGID_UZBEK                        47\n#define TT_MAC_LANGID_KAZAKH                       48\n#define TT_MAC_LANGID_AZERBAIJANI                  49\n#define TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT  49\n#define TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT    50\n#define TT_MAC_LANGID_ARMENIAN                     51\n#define TT_MAC_LANGID_GEORGIAN                     52\n#define TT_MAC_LANGID_MOLDAVIAN                    53\n#define TT_MAC_LANGID_KIRGHIZ                      54\n#define TT_MAC_LANGID_TAJIKI                       55\n#define TT_MAC_LANGID_TURKMEN                      56\n#define TT_MAC_LANGID_MONGOLIAN                    57\n#define TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT   57\n#define TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT    58\n#define TT_MAC_LANGID_PASHTO                       59\n#define TT_MAC_LANGID_KURDISH                      60\n#define TT_MAC_LANGID_KASHMIRI                     61\n#define TT_MAC_LANGID_SINDHI                       62\n#define TT_MAC_LANGID_TIBETAN                      63\n#define TT_MAC_LANGID_NEPALI                       64\n#define TT_MAC_LANGID_SANSKRIT                     65\n#define TT_MAC_LANGID_MARATHI                      66\n#define TT_MAC_LANGID_BENGALI                      67\n#define TT_MAC_LANGID_ASSAMESE                     68\n#define TT_MAC_LANGID_GUJARATI                     69\n#define TT_MAC_LANGID_PUNJABI                      70\n#define TT_MAC_LANGID_ORIYA                        71\n#define TT_MAC_LANGID_MALAYALAM                    72\n#define TT_MAC_LANGID_KANNADA                      73\n#define TT_MAC_LANGID_TAMIL                        74\n#define TT_MAC_LANGID_TELUGU                       75\n#define TT_MAC_LANGID_SINHALESE                    76\n#define TT_MAC_LANGID_BURMESE                      77\n#define TT_MAC_LANGID_KHMER                        78\n#define TT_MAC_LANGID_LAO                          79\n#define TT_MAC_LANGID_VIETNAMESE                   80\n#define TT_MAC_LANGID_INDONESIAN                   81\n#define TT_MAC_LANGID_TAGALOG                      82\n#define TT_MAC_LANGID_MALAY_ROMAN_SCRIPT           83\n#define TT_MAC_LANGID_MALAY_ARABIC_SCRIPT          84\n#define TT_MAC_LANGID_AMHARIC                      85\n#define TT_MAC_LANGID_TIGRINYA                     86\n#define TT_MAC_LANGID_GALLA                        87\n#define TT_MAC_LANGID_SOMALI                       88\n#define TT_MAC_LANGID_SWAHILI                      89\n#define TT_MAC_LANGID_RUANDA                       90\n#define TT_MAC_LANGID_RUNDI                        91\n#define TT_MAC_LANGID_CHEWA                        92\n#define TT_MAC_LANGID_MALAGASY                     93\n#define TT_MAC_LANGID_ESPERANTO                    94\n#define TT_MAC_LANGID_WELSH                       128\n#define TT_MAC_LANGID_BASQUE                      129\n#define TT_MAC_LANGID_CATALAN                     130\n#define TT_MAC_LANGID_LATIN                       131\n#define TT_MAC_LANGID_QUECHUA                     132\n#define TT_MAC_LANGID_GUARANI                     133\n#define TT_MAC_LANGID_AYMARA                      134\n#define TT_MAC_LANGID_TATAR                       135\n#define TT_MAC_LANGID_UIGHUR                      136\n#define TT_MAC_LANGID_DZONGKHA                    137\n#define TT_MAC_LANGID_JAVANESE                    138\n#define TT_MAC_LANGID_SUNDANESE                   139\n\n\n#if 0  /* these seem to be errors that have been dropped */\n\n#define TT_MAC_LANGID_SCOTTISH_GAELIC             140\n#define TT_MAC_LANGID_IRISH_GAELIC                141\n\n#endif\n\n\n  /* The following codes are new as of 2000-03-10 */\n#define TT_MAC_LANGID_GALICIAN                    140\n#define TT_MAC_LANGID_AFRIKAANS                   141\n#define TT_MAC_LANGID_BRETON                      142\n#define TT_MAC_LANGID_INUKTITUT                   143\n#define TT_MAC_LANGID_SCOTTISH_GAELIC             144\n#define TT_MAC_LANGID_MANX_GAELIC                 145\n#define TT_MAC_LANGID_IRISH_GAELIC                146\n#define TT_MAC_LANGID_TONGAN                      147\n#define TT_MAC_LANGID_GREEK_POLYTONIC             148\n#define TT_MAC_LANGID_GREELANDIC                  149\n#define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT    150\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values of the language identifier field in the name records  */\n  /* of the TTF `name' table if the `platform' identifier code is          */\n  /* TT_PLATFORM_MICROSOFT.                                                */\n  /*                                                                       */\n  /* The canonical source for the MS assigned LCIDs is                     */\n  /*                                                                       */\n  /*   http://www.microsoft.com/globaldev/reference/lcid-all.mspx          */\n  /*                                                                       */\n\n#define TT_MS_LANGID_ARABIC_GENERAL                    0x0001\n#define TT_MS_LANGID_ARABIC_SAUDI_ARABIA               0x0401\n#define TT_MS_LANGID_ARABIC_IRAQ                       0x0801\n#define TT_MS_LANGID_ARABIC_EGYPT                      0x0C01\n#define TT_MS_LANGID_ARABIC_LIBYA                      0x1001\n#define TT_MS_LANGID_ARABIC_ALGERIA                    0x1401\n#define TT_MS_LANGID_ARABIC_MOROCCO                    0x1801\n#define TT_MS_LANGID_ARABIC_TUNISIA                    0x1C01\n#define TT_MS_LANGID_ARABIC_OMAN                       0x2001\n#define TT_MS_LANGID_ARABIC_YEMEN                      0x2401\n#define TT_MS_LANGID_ARABIC_SYRIA                      0x2801\n#define TT_MS_LANGID_ARABIC_JORDAN                     0x2C01\n#define TT_MS_LANGID_ARABIC_LEBANON                    0x3001\n#define TT_MS_LANGID_ARABIC_KUWAIT                     0x3401\n#define TT_MS_LANGID_ARABIC_UAE                        0x3801\n#define TT_MS_LANGID_ARABIC_BAHRAIN                    0x3C01\n#define TT_MS_LANGID_ARABIC_QATAR                      0x4001\n#define TT_MS_LANGID_BULGARIAN_BULGARIA                0x0402\n#define TT_MS_LANGID_CATALAN_SPAIN                     0x0403\n#define TT_MS_LANGID_CHINESE_GENERAL                   0x0004\n#define TT_MS_LANGID_CHINESE_TAIWAN                    0x0404\n#define TT_MS_LANGID_CHINESE_PRC                       0x0804\n#define TT_MS_LANGID_CHINESE_HONG_KONG                 0x0C04\n#define TT_MS_LANGID_CHINESE_SINGAPORE                 0x1004\n\n#if 1  /* this looks like the correct value */\n#define TT_MS_LANGID_CHINESE_MACAU                     0x1404\n#else  /* but beware, Microsoft may change its mind...\n          the most recent Word reference has the following: */\n#define TT_MS_LANGID_CHINESE_MACAU  TT_MS_LANGID_CHINESE_HONG_KONG\n#endif\n\n#if 0  /* used only with .NET `cultures'; commented out */\n#define TT_MS_LANGID_CHINESE_TRADITIONAL               0x7C04\n#endif\n\n#define TT_MS_LANGID_CZECH_CZECH_REPUBLIC              0x0405\n#define TT_MS_LANGID_DANISH_DENMARK                    0x0406\n#define TT_MS_LANGID_GERMAN_GERMANY                    0x0407\n#define TT_MS_LANGID_GERMAN_SWITZERLAND                0x0807\n#define TT_MS_LANGID_GERMAN_AUSTRIA                    0x0C07\n#define TT_MS_LANGID_GERMAN_LUXEMBOURG                 0x1007\n#define TT_MS_LANGID_GERMAN_LIECHTENSTEI               0x1407\n#define TT_MS_LANGID_GREEK_GREECE                      0x0408\n\n  /* don't ask what this one means... It is commented out currently. */\n#if 0\n#define TT_MS_LANGID_GREEK_GREECE2                     0x2008\n#endif\n\n#define TT_MS_LANGID_ENGLISH_GENERAL                   0x0009\n#define TT_MS_LANGID_ENGLISH_UNITED_STATES             0x0409\n#define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM            0x0809\n#define TT_MS_LANGID_ENGLISH_AUSTRALIA                 0x0C09\n#define TT_MS_LANGID_ENGLISH_CANADA                    0x1009\n#define TT_MS_LANGID_ENGLISH_NEW_ZEALAND               0x1409\n#define TT_MS_LANGID_ENGLISH_IRELAND                   0x1809\n#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA              0x1C09\n#define TT_MS_LANGID_ENGLISH_JAMAICA                   0x2009\n#define TT_MS_LANGID_ENGLISH_CARIBBEAN                 0x2409\n#define TT_MS_LANGID_ENGLISH_BELIZE                    0x2809\n#define TT_MS_LANGID_ENGLISH_TRINIDAD                  0x2C09\n#define TT_MS_LANGID_ENGLISH_ZIMBABWE                  0x3009\n#define TT_MS_LANGID_ENGLISH_PHILIPPINES               0x3409\n#define TT_MS_LANGID_ENGLISH_INDONESIA                 0x3809\n#define TT_MS_LANGID_ENGLISH_HONG_KONG                 0x3C09\n#define TT_MS_LANGID_ENGLISH_INDIA                     0x4009\n#define TT_MS_LANGID_ENGLISH_MALAYSIA                  0x4409\n#define TT_MS_LANGID_ENGLISH_SINGAPORE                 0x4809\n#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT    0x040A\n#define TT_MS_LANGID_SPANISH_MEXICO                    0x080A\n#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT  0x0C0A\n#define TT_MS_LANGID_SPANISH_GUATEMALA                 0x100A\n#define TT_MS_LANGID_SPANISH_COSTA_RICA                0x140A\n#define TT_MS_LANGID_SPANISH_PANAMA                    0x180A\n#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC        0x1C0A\n#define TT_MS_LANGID_SPANISH_VENEZUELA                 0x200A\n#define TT_MS_LANGID_SPANISH_COLOMBIA                  0x240A\n#define TT_MS_LANGID_SPANISH_PERU                      0x280A\n#define TT_MS_LANGID_SPANISH_ARGENTINA                 0x2C0A\n#define TT_MS_LANGID_SPANISH_ECUADOR                   0x300A\n#define TT_MS_LANGID_SPANISH_CHILE                     0x340A\n#define TT_MS_LANGID_SPANISH_URUGUAY                   0x380A\n#define TT_MS_LANGID_SPANISH_PARAGUAY                  0x3C0A\n#define TT_MS_LANGID_SPANISH_BOLIVIA                   0x400A\n#define TT_MS_LANGID_SPANISH_EL_SALVADOR               0x440A\n#define TT_MS_LANGID_SPANISH_HONDURAS                  0x480A\n#define TT_MS_LANGID_SPANISH_NICARAGUA                 0x4C0A\n#define TT_MS_LANGID_SPANISH_PUERTO_RICO               0x500A\n#define TT_MS_LANGID_SPANISH_UNITED_STATES             0x540A\n  /* The following ID blatantly violate MS specs by using a */\n  /* sublanguage > 0x1F.                                    */\n#define TT_MS_LANGID_SPANISH_LATIN_AMERICA             0xE40AU\n#define TT_MS_LANGID_FINNISH_FINLAND                   0x040B\n#define TT_MS_LANGID_FRENCH_FRANCE                     0x040C\n#define TT_MS_LANGID_FRENCH_BELGIUM                    0x080C\n#define TT_MS_LANGID_FRENCH_CANADA                     0x0C0C\n#define TT_MS_LANGID_FRENCH_SWITZERLAND                0x100C\n#define TT_MS_LANGID_FRENCH_LUXEMBOURG                 0x140C\n#define TT_MS_LANGID_FRENCH_MONACO                     0x180C\n#define TT_MS_LANGID_FRENCH_WEST_INDIES                0x1C0C\n#define TT_MS_LANGID_FRENCH_REUNION                    0x200C\n#define TT_MS_LANGID_FRENCH_CONGO                      0x240C\n  /* which was formerly: */\n#define TT_MS_LANGID_FRENCH_ZAIRE  TT_MS_LANGID_FRENCH_CONGO\n#define TT_MS_LANGID_FRENCH_SENEGAL                    0x280C\n#define TT_MS_LANGID_FRENCH_CAMEROON                   0x2C0C\n#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE              0x300C\n#define TT_MS_LANGID_FRENCH_MALI                       0x340C\n#define TT_MS_LANGID_FRENCH_MOROCCO                    0x380C\n#define TT_MS_LANGID_FRENCH_HAITI                      0x3C0C\n  /* and another violation of the spec (see 0xE40AU) */\n#define TT_MS_LANGID_FRENCH_NORTH_AFRICA               0xE40CU\n#define TT_MS_LANGID_HEBREW_ISRAEL                     0x040D\n#define TT_MS_LANGID_HUNGARIAN_HUNGARY                 0x040E\n#define TT_MS_LANGID_ICELANDIC_ICELAND                 0x040F\n#define TT_MS_LANGID_ITALIAN_ITALY                     0x0410\n#define TT_MS_LANGID_ITALIAN_SWITZERLAND               0x0810\n#define TT_MS_LANGID_JAPANESE_JAPAN                    0x0411\n#define TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA     0x0412\n#define TT_MS_LANGID_KOREAN_JOHAB_KOREA                0x0812\n#define TT_MS_LANGID_DUTCH_NETHERLANDS                 0x0413\n#define TT_MS_LANGID_DUTCH_BELGIUM                     0x0813\n#define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL           0x0414\n#define TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK          0x0814\n#define TT_MS_LANGID_POLISH_POLAND                     0x0415\n#define TT_MS_LANGID_PORTUGUESE_BRAZIL                 0x0416\n#define TT_MS_LANGID_PORTUGUESE_PORTUGAL               0x0816\n#define TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND        0x0417\n#define TT_MS_LANGID_ROMANIAN_ROMANIA                  0x0418\n#define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA                0x0818\n#define TT_MS_LANGID_RUSSIAN_RUSSIA                    0x0419\n#define TT_MS_LANGID_RUSSIAN_MOLDAVIA                  0x0819\n#define TT_MS_LANGID_CROATIAN_CROATIA                  0x041A\n#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN              0x081A\n#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC           0x0C1A\n\n#if 0  /* this used to be this value, but it looks like we were wrong */\n#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA        0x101A\n#else  /* current sources say */\n#define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA       0x101A\n#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA        0x141A\n       /* and XPsp2 Platform SDK added (2004-07-26) */\n       /* Names are shortened to be significant within 40 chars. */\n#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN         0x181A\n#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC      0x181A\n#endif\n\n#define TT_MS_LANGID_SLOVAK_SLOVAKIA                   0x041B\n#define TT_MS_LANGID_ALBANIAN_ALBANIA                  0x041C\n#define TT_MS_LANGID_SWEDISH_SWEDEN                    0x041D\n#define TT_MS_LANGID_SWEDISH_FINLAND                   0x081D\n#define TT_MS_LANGID_THAI_THAILAND                     0x041E\n#define TT_MS_LANGID_TURKISH_TURKEY                    0x041F\n#define TT_MS_LANGID_URDU_PAKISTAN                     0x0420\n#define TT_MS_LANGID_URDU_INDIA                        0x0820\n#define TT_MS_LANGID_INDONESIAN_INDONESIA              0x0421\n#define TT_MS_LANGID_UKRAINIAN_UKRAINE                 0x0422\n#define TT_MS_LANGID_BELARUSIAN_BELARUS                0x0423\n#define TT_MS_LANGID_SLOVENE_SLOVENIA                  0x0424\n#define TT_MS_LANGID_ESTONIAN_ESTONIA                  0x0425\n#define TT_MS_LANGID_LATVIAN_LATVIA                    0x0426\n#define TT_MS_LANGID_LITHUANIAN_LITHUANIA              0x0427\n#define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA      0x0827\n#define TT_MS_LANGID_TAJIK_TAJIKISTAN                  0x0428\n#define TT_MS_LANGID_FARSI_IRAN                        0x0429\n#define TT_MS_LANGID_VIETNAMESE_VIET_NAM               0x042A\n#define TT_MS_LANGID_ARMENIAN_ARMENIA                  0x042B\n#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN            0x042C\n#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC         0x082C\n#define TT_MS_LANGID_BASQUE_SPAIN                      0x042D\n#define TT_MS_LANGID_SORBIAN_GERMANY                   0x042E\n#define TT_MS_LANGID_MACEDONIAN_MACEDONIA              0x042F\n#define TT_MS_LANGID_SUTU_SOUTH_AFRICA                 0x0430\n#define TT_MS_LANGID_TSONGA_SOUTH_AFRICA               0x0431\n#define TT_MS_LANGID_TSWANA_SOUTH_AFRICA               0x0432\n#define TT_MS_LANGID_VENDA_SOUTH_AFRICA                0x0433\n#define TT_MS_LANGID_XHOSA_SOUTH_AFRICA                0x0434\n#define TT_MS_LANGID_ZULU_SOUTH_AFRICA                 0x0435\n#define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA            0x0436\n#define TT_MS_LANGID_GEORGIAN_GEORGIA                  0x0437\n#define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS           0x0438\n#define TT_MS_LANGID_HINDI_INDIA                       0x0439\n#define TT_MS_LANGID_MALTESE_MALTA                     0x043A\n  /* Added by XPsp2 Platform SDK (2004-07-26) */\n#define TT_MS_LANGID_SAMI_NORTHERN_NORWAY              0x043B\n#define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN              0x083B\n#define TT_MS_LANGID_SAMI_NORTHERN_FINLAND             0x0C3B\n#define TT_MS_LANGID_SAMI_LULE_NORWAY                  0x103B\n#define TT_MS_LANGID_SAMI_LULE_SWEDEN                  0x143B\n#define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY              0x183B\n#define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN              0x1C3B\n#define TT_MS_LANGID_SAMI_SKOLT_FINLAND                0x203B\n#define TT_MS_LANGID_SAMI_INARI_FINLAND                0x243B\n  /* ... and we also keep our old identifier... */\n#define TT_MS_LANGID_SAAMI_LAPONIA                     0x043B\n\n#if 0 /* this seems to be a previous inversion */\n#define TT_MS_LANGID_IRISH_GAELIC_IRELAND              0x043C\n#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM    0x083C\n#else\n#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM    0x083C\n#define TT_MS_LANGID_IRISH_GAELIC_IRELAND              0x043C\n#endif\n\n#define TT_MS_LANGID_YIDDISH_GERMANY                   0x043D\n#define TT_MS_LANGID_MALAY_MALAYSIA                    0x043E\n#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM           0x083E\n#define TT_MS_LANGID_KAZAK_KAZAKSTAN                   0x043F\n#define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN /* Cyrillic*/ 0x0440\n  /* alias declared in Windows 2000 */\n#define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \\\n          TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN\n\n#define TT_MS_LANGID_SWAHILI_KENYA                     0x0441\n#define TT_MS_LANGID_TURKMEN_TURKMENISTAN              0x0442\n#define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN            0x0443\n#define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC         0x0843\n#define TT_MS_LANGID_TATAR_TATARSTAN                   0x0444\n#define TT_MS_LANGID_BENGALI_INDIA                     0x0445\n#define TT_MS_LANGID_BENGALI_BANGLADESH                0x0845\n#define TT_MS_LANGID_PUNJABI_INDIA                     0x0446\n#define TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN           0x0846\n#define TT_MS_LANGID_GUJARATI_INDIA                    0x0447\n#define TT_MS_LANGID_ORIYA_INDIA                       0x0448\n#define TT_MS_LANGID_TAMIL_INDIA                       0x0449\n#define TT_MS_LANGID_TELUGU_INDIA                      0x044A\n#define TT_MS_LANGID_KANNADA_INDIA                     0x044B\n#define TT_MS_LANGID_MALAYALAM_INDIA                   0x044C\n#define TT_MS_LANGID_ASSAMESE_INDIA                    0x044D\n#define TT_MS_LANGID_MARATHI_INDIA                     0x044E\n#define TT_MS_LANGID_SANSKRIT_INDIA                    0x044F\n#define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450\n#define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN      0x0850\n#define TT_MS_LANGID_TIBETAN_CHINA                     0x0451\n  /* Don't use the next constant!  It has            */\n  /*   (1) the wrong spelling (Dzonghka)             */\n  /*   (2) Microsoft doesn't officially define it -- */\n  /*       at least it is not in the List of Local   */\n  /*       ID Values.                                */\n  /*   (3) Dzongkha is not the same language as      */\n  /*       Tibetan, so merging it is wrong anyway.   */\n  /*                                                 */\n  /* TT_MS_LANGID_TIBETAN_BHUTAN is correct, BTW.    */\n#define TT_MS_LANGID_DZONGHKA_BHUTAN                   0x0851\n\n#if 0\n  /* the following used to be defined */\n#define TT_MS_LANGID_TIBETAN_BHUTAN                    0x0451\n  /* ... but it was changed; */\n#else\n  /* So we will continue to #define it, but with the correct value */\n#define TT_MS_LANGID_TIBETAN_BHUTAN   TT_MS_LANGID_DZONGHKA_BHUTAN\n#endif\n\n#define TT_MS_LANGID_WELSH_WALES                       0x0452\n#define TT_MS_LANGID_KHMER_CAMBODIA                    0x0453\n#define TT_MS_LANGID_LAO_LAOS                          0x0454\n#define TT_MS_LANGID_BURMESE_MYANMAR                   0x0455\n#define TT_MS_LANGID_GALICIAN_SPAIN                    0x0456\n#define TT_MS_LANGID_KONKANI_INDIA                     0x0457\n#define TT_MS_LANGID_MANIPURI_INDIA  /* Bengali */     0x0458\n#define TT_MS_LANGID_SINDHI_INDIA /* Arabic */         0x0459\n#define TT_MS_LANGID_SINDHI_PAKISTAN                   0x0859\n  /* Missing a LCID for Sindhi in Devanagari script */\n#define TT_MS_LANGID_SYRIAC_SYRIA                      0x045A\n#define TT_MS_LANGID_SINHALESE_SRI_LANKA               0x045B\n#define TT_MS_LANGID_CHEROKEE_UNITED_STATES            0x045C\n#define TT_MS_LANGID_INUKTITUT_CANADA                  0x045D\n#define TT_MS_LANGID_AMHARIC_ETHIOPIA                  0x045E\n#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */    0x045F\n#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN           0x085F\n  /* Missing a LCID for Tifinagh script */\n#define TT_MS_LANGID_KASHMIRI_PAKISTAN /* Arabic */    0x0460\n  /* Spelled this way by XPsp2 Platform SDK (2004-07-26) */\n  /* script is yet unclear... might be Arabic, Nagari or Sharada */\n#define TT_MS_LANGID_KASHMIRI_SASIA                    0x0860\n  /* ... and aliased (by MS) for compatibility reasons. */\n#define TT_MS_LANGID_KASHMIRI_INDIA TT_MS_LANGID_KASHMIRI_SASIA\n#define TT_MS_LANGID_NEPALI_NEPAL                      0x0461\n#define TT_MS_LANGID_NEPALI_INDIA                      0x0861\n#define TT_MS_LANGID_FRISIAN_NETHERLANDS               0x0462\n#define TT_MS_LANGID_PASHTO_AFGHANISTAN                0x0463\n#define TT_MS_LANGID_FILIPINO_PHILIPPINES              0x0464\n#define TT_MS_LANGID_DHIVEHI_MALDIVES                  0x0465\n  /* alias declared in Windows 2000 */\n#define TT_MS_LANGID_DIVEHI_MALDIVES  TT_MS_LANGID_DHIVEHI_MALDIVES\n#define TT_MS_LANGID_EDO_NIGERIA                       0x0466\n#define TT_MS_LANGID_FULFULDE_NIGERIA                  0x0467\n#define TT_MS_LANGID_HAUSA_NIGERIA                     0x0468\n#define TT_MS_LANGID_IBIBIO_NIGERIA                    0x0469\n#define TT_MS_LANGID_YORUBA_NIGERIA                    0x046A\n#define TT_MS_LANGID_QUECHUA_BOLIVIA                   0x046B\n#define TT_MS_LANGID_QUECHUA_ECUADOR                   0x086B\n#define TT_MS_LANGID_QUECHUA_PERU                      0x0C6B\n#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA               0x046C\n  /* Also spelled by XPsp2 Platform SDK (2004-07-26) */\n#define TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA \\\n          TT_MS_LANGID_SEPEDI_SOUTH_AFRICA\n  /* language codes 0x046D, 0x046E and 0x046F are (still) unknown. */\n#define TT_MS_LANGID_IGBO_NIGERIA                      0x0470\n#define TT_MS_LANGID_KANURI_NIGERIA                    0x0471\n#define TT_MS_LANGID_OROMO_ETHIOPIA                    0x0472\n#define TT_MS_LANGID_TIGRIGNA_ETHIOPIA                 0x0473\n#define TT_MS_LANGID_TIGRIGNA_ERYTHREA                 0x0873\n  /* also spelled in the `Passport SDK' list as: */\n#define TT_MS_LANGID_TIGRIGNA_ERYTREA  TT_MS_LANGID_TIGRIGNA_ERYTHREA\n#define TT_MS_LANGID_GUARANI_PARAGUAY                  0x0474\n#define TT_MS_LANGID_HAWAIIAN_UNITED_STATES            0x0475\n#define TT_MS_LANGID_LATIN                             0x0476\n#define TT_MS_LANGID_SOMALI_SOMALIA                    0x0477\n  /* Note: Yi does not have a (proper) ISO 639-2 code, since it is mostly */\n  /*       not written (but OTOH the peculiar writing system is worth     */\n  /*       studying).                                                     */\n#define TT_MS_LANGID_YI_CHINA                          0x0478\n#define TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES   0x0479\n  /* language codes from 0x047A to 0x047F are (still) unknown. */\n#define TT_MS_LANGID_UIGHUR_CHINA                      0x0480\n#define TT_MS_LANGID_MAORI_NEW_ZEALAND                 0x0481\n\n#if 0  /* not deemed useful for fonts */\n#define TT_MS_LANGID_HUMAN_INTERFACE_DEVICE            0x04FF\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values of the `name' identifier field in the name records of */\n  /* the TTF `name' table.  These values are platform independent.         */\n  /*                                                                       */\n#define TT_NAME_ID_COPYRIGHT            0\n#define TT_NAME_ID_FONT_FAMILY          1\n#define TT_NAME_ID_FONT_SUBFAMILY       2\n#define TT_NAME_ID_UNIQUE_ID            3\n#define TT_NAME_ID_FULL_NAME            4\n#define TT_NAME_ID_VERSION_STRING       5\n#define TT_NAME_ID_PS_NAME              6\n#define TT_NAME_ID_TRADEMARK            7\n\n  /* the following values are from the OpenType spec */\n#define TT_NAME_ID_MANUFACTURER         8\n#define TT_NAME_ID_DESIGNER             9\n#define TT_NAME_ID_DESCRIPTION          10\n#define TT_NAME_ID_VENDOR_URL           11\n#define TT_NAME_ID_DESIGNER_URL         12\n#define TT_NAME_ID_LICENSE              13\n#define TT_NAME_ID_LICENSE_URL          14\n  /* number 15 is reserved */\n#define TT_NAME_ID_PREFERRED_FAMILY     16\n#define TT_NAME_ID_PREFERRED_SUBFAMILY  17\n#define TT_NAME_ID_MAC_FULL_NAME        18\n\n  /* The following code is new as of 2000-01-21 */\n#define TT_NAME_ID_SAMPLE_TEXT          19\n\n  /* This is new in OpenType 1.3 */\n#define TT_NAME_ID_CID_FINDFONT_NAME    20\n\n  /* This is new in OpenType 1.5 */\n#define TT_NAME_ID_WWS_FAMILY           21\n#define TT_NAME_ID_WWS_SUBFAMILY        22\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Bit mask values for the Unicode Ranges from the TTF `OS2 ' table.     */\n  /*                                                                       */\n  /* Updated 08-Nov-2008.                                                  */\n  /*                                                                       */\n\n  /* Bit  0   Basic Latin */\n#define TT_UCR_BASIC_LATIN                     (1L <<  0) /* U+0020-U+007E */\n  /* Bit  1   C1 Controls and Latin-1 Supplement */\n#define TT_UCR_LATIN1_SUPPLEMENT               (1L <<  1) /* U+0080-U+00FF */\n  /* Bit  2   Latin Extended-A */\n#define TT_UCR_LATIN_EXTENDED_A                (1L <<  2) /* U+0100-U+017F */\n  /* Bit  3   Latin Extended-B */\n#define TT_UCR_LATIN_EXTENDED_B                (1L <<  3) /* U+0180-U+024F */\n  /* Bit  4   IPA Extensions                 */\n  /*          Phonetic Extensions            */\n  /*          Phonetic Extensions Supplement */\n#define TT_UCR_IPA_EXTENSIONS                  (1L <<  4) /* U+0250-U+02AF */\n                                                          /* U+1D00-U+1D7F */\n                                                          /* U+1D80-U+1DBF */\n  /* Bit  5   Spacing Modifier Letters */\n  /*          Modifier Tone Letters    */\n#define TT_UCR_SPACING_MODIFIER                (1L <<  5) /* U+02B0-U+02FF */\n                                                          /* U+A700-U+A71F */\n  /* Bit  6   Combining Diacritical Marks            */\n  /*          Combining Diacritical Marks Supplement */\n#define TT_UCR_COMBINING_DIACRITICS            (1L <<  6) /* U+0300-U+036F */\n                                                          /* U+1DC0-U+1DFF */\n  /* Bit  7   Greek and Coptic */\n#define TT_UCR_GREEK                           (1L <<  7) /* U+0370-U+03FF */\n  /* Bit  8   Coptic */\n#define TT_UCR_COPTIC                          (1L <<  8) /* U+2C80-U+2CFF */\n  /* Bit  9   Cyrillic            */\n  /*          Cyrillic Supplement */\n  /*          Cyrillic Extended-A */\n  /*          Cyrillic Extended-B */\n#define TT_UCR_CYRILLIC                        (1L <<  9) /* U+0400-U+04FF */\n                                                          /* U+0500-U+052F */\n                                                          /* U+2DE0-U+2DFF */\n                                                          /* U+A640-U+A69F */\n  /* Bit 10   Armenian */\n#define TT_UCR_ARMENIAN                        (1L << 10) /* U+0530-U+058F */\n  /* Bit 11   Hebrew */\n#define TT_UCR_HEBREW                          (1L << 11) /* U+0590-U+05FF */\n  /* Bit 12   Vai */\n#define TT_UCR_VAI                             (1L << 12) /* U+A500-U+A63F */\n  /* Bit 13   Arabic            */\n  /*          Arabic Supplement */\n#define TT_UCR_ARABIC                          (1L << 13) /* U+0600-U+06FF */\n                                                          /* U+0750-U+077F */\n  /* Bit 14   NKo */\n#define TT_UCR_NKO                             (1L << 14) /* U+07C0-U+07FF */\n  /* Bit 15   Devanagari */\n#define TT_UCR_DEVANAGARI                      (1L << 15) /* U+0900-U+097F */\n  /* Bit 16   Bengali */\n#define TT_UCR_BENGALI                         (1L << 16) /* U+0980-U+09FF */\n  /* Bit 17   Gurmukhi */\n#define TT_UCR_GURMUKHI                        (1L << 17) /* U+0A00-U+0A7F */\n  /* Bit 18   Gujarati */\n#define TT_UCR_GUJARATI                        (1L << 18) /* U+0A80-U+0AFF */\n  /* Bit 19   Oriya */\n#define TT_UCR_ORIYA                           (1L << 19) /* U+0B00-U+0B7F */\n  /* Bit 20   Tamil */\n#define TT_UCR_TAMIL                           (1L << 20) /* U+0B80-U+0BFF */\n  /* Bit 21   Telugu */\n#define TT_UCR_TELUGU                          (1L << 21) /* U+0C00-U+0C7F */\n  /* Bit 22   Kannada */\n#define TT_UCR_KANNADA                         (1L << 22) /* U+0C80-U+0CFF */\n  /* Bit 23   Malayalam */\n#define TT_UCR_MALAYALAM                       (1L << 23) /* U+0D00-U+0D7F */\n  /* Bit 24   Thai */\n#define TT_UCR_THAI                            (1L << 24) /* U+0E00-U+0E7F */\n  /* Bit 25   Lao */\n#define TT_UCR_LAO                             (1L << 25) /* U+0E80-U+0EFF */\n  /* Bit 26   Georgian            */\n  /*          Georgian Supplement */\n#define TT_UCR_GEORGIAN                        (1L << 26) /* U+10A0-U+10FF */\n                                                          /* U+2D00-U+2D2F */\n  /* Bit 27   Balinese */\n#define TT_UCR_BALINESE                        (1L << 27) /* U+1B00-U+1B7F */\n  /* Bit 28   Hangul Jamo */\n#define TT_UCR_HANGUL_JAMO                     (1L << 28) /* U+1100-U+11FF */\n  /* Bit 29   Latin Extended Additional */\n  /*          Latin Extended-C          */\n  /*          Latin Extended-D          */\n#define TT_UCR_LATIN_EXTENDED_ADDITIONAL       (1L << 29) /* U+1E00-U+1EFF */\n                                                          /* U+2C60-U+2C7F */\n                                                          /* U+A720-U+A7FF */\n  /* Bit 30   Greek Extended */\n#define TT_UCR_GREEK_EXTENDED                  (1L << 30) /* U+1F00-U+1FFF */\n  /* Bit 31   General Punctuation      */\n  /*          Supplemental Punctuation */\n#define TT_UCR_GENERAL_PUNCTUATION             (1L << 31) /* U+2000-U+206F */\n                                                          /* U+2E00-U+2E7F */\n  /* Bit 32   Superscripts And Subscripts */\n#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS         (1L <<  0) /* U+2070-U+209F */\n  /* Bit 33   Currency Symbols */\n#define TT_UCR_CURRENCY_SYMBOLS                (1L <<  1) /* U+20A0-U+20CF */\n  /* Bit 34   Combining Diacritical Marks For Symbols */\n#define TT_UCR_COMBINING_DIACRITICS_SYMB       (1L <<  2) /* U+20D0-U+20FF */\n  /* Bit 35   Letterlike Symbols */\n#define TT_UCR_LETTERLIKE_SYMBOLS              (1L <<  3) /* U+2100-U+214F */\n  /* Bit 36   Number Forms */\n#define TT_UCR_NUMBER_FORMS                    (1L <<  4) /* U+2150-U+218F */\n  /* Bit 37   Arrows                           */\n  /*          Supplemental Arrows-A            */\n  /*          Supplemental Arrows-B            */\n  /*          Miscellaneous Symbols and Arrows */\n#define TT_UCR_ARROWS                          (1L <<  5) /* U+2190-U+21FF */\n                                                          /* U+27F0-U+27FF */\n                                                          /* U+2900-U+297F */\n                                                          /* U+2B00-U+2BFF */\n  /* Bit 38   Mathematical Operators               */\n  /*          Supplemental Mathematical Operators  */\n  /*          Miscellaneous Mathematical Symbols-A */\n  /*          Miscellaneous Mathematical Symbols-B */\n#define TT_UCR_MATHEMATICAL_OPERATORS          (1L <<  6) /* U+2200-U+22FF */\n                                                          /* U+2A00-U+2AFF */\n                                                          /* U+27C0-U+27EF */\n                                                          /* U+2980-U+29FF */\n  /* Bit 39 Miscellaneous Technical */\n#define TT_UCR_MISCELLANEOUS_TECHNICAL         (1L <<  7) /* U+2300-U+23FF */\n  /* Bit 40   Control Pictures */\n#define TT_UCR_CONTROL_PICTURES                (1L <<  8) /* U+2400-U+243F */\n  /* Bit 41   Optical Character Recognition */\n#define TT_UCR_OCR                             (1L <<  9) /* U+2440-U+245F */\n  /* Bit 42   Enclosed Alphanumerics */\n#define TT_UCR_ENCLOSED_ALPHANUMERICS          (1L << 10) /* U+2460-U+24FF */\n  /* Bit 43   Box Drawing */\n#define TT_UCR_BOX_DRAWING                     (1L << 11) /* U+2500-U+257F */\n  /* Bit 44   Block Elements */\n#define TT_UCR_BLOCK_ELEMENTS                  (1L << 12) /* U+2580-U+259F */\n  /* Bit 45   Geometric Shapes */\n#define TT_UCR_GEOMETRIC_SHAPES                (1L << 13) /* U+25A0-U+25FF */\n  /* Bit 46   Miscellaneous Symbols */\n#define TT_UCR_MISCELLANEOUS_SYMBOLS           (1L << 14) /* U+2600-U+26FF */\n  /* Bit 47   Dingbats */\n#define TT_UCR_DINGBATS                        (1L << 15) /* U+2700-U+27BF */\n  /* Bit 48   CJK Symbols and Punctuation */\n#define TT_UCR_CJK_SYMBOLS                     (1L << 16) /* U+3000-U+303F */\n  /* Bit 49   Hiragana */\n#define TT_UCR_HIRAGANA                        (1L << 17) /* U+3040-U+309F */\n  /* Bit 50   Katakana                     */\n  /*          Katakana Phonetic Extensions */\n#define TT_UCR_KATAKANA                        (1L << 18) /* U+30A0-U+30FF */\n                                                          /* U+31F0-U+31FF */\n  /* Bit 51   Bopomofo          */\n  /*          Bopomofo Extended */\n#define TT_UCR_BOPOMOFO                        (1L << 19) /* U+3100-U+312F */\n                                                          /* U+31A0-U+31BF */\n  /* Bit 52   Hangul Compatibility Jamo */\n#define TT_UCR_HANGUL_COMPATIBILITY_JAMO       (1L << 20) /* U+3130-U+318F */\n  /* Bit 53   Phags-Pa */\n#define TT_UCR_CJK_MISC                        (1L << 21) /* U+A840-U+A87F */\n#define TT_UCR_KANBUN  TT_UCR_CJK_MISC /* deprecated */\n#define TT_UCR_PHAGSPA\n  /* Bit 54   Enclosed CJK Letters and Months */\n#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS     (1L << 22) /* U+3200-U+32FF */\n  /* Bit 55   CJK Compatibility */\n#define TT_UCR_CJK_COMPATIBILITY               (1L << 23) /* U+3300-U+33FF */\n  /* Bit 56   Hangul Syllables */\n#define TT_UCR_HANGUL                          (1L << 24) /* U+AC00-U+D7A3 */\n  /* Bit 57   High Surrogates              */\n  /*          High Private Use Surrogates  */\n  /*          Low Surrogates               */\n  /*                                       */\n  /* According to OpenType specs v.1.3+,   */\n  /* setting bit 57 implies that there is  */\n  /* at least one codepoint beyond the     */\n  /* Basic Multilingual Plane that is      */\n  /* supported by this font.  So it really */\n  /* means >= U+10000                      */\n#define TT_UCR_SURROGATES                      (1L << 25) /* U+D800-U+DB7F */\n                                                          /* U+DB80-U+DBFF */\n                                                          /* U+DC00-U+DFFF */\n#define TT_UCR_NON_PLANE_0  TT_UCR_SURROGATES\n  /* Bit 58  Phoenician */\n#define TT_UCR_PHOENICIAN                      (1L << 26) /*U+10900-U+1091F*/\n  /* Bit 59   CJK Unified Ideographs             */\n  /*          CJK Radicals Supplement            */\n  /*          Kangxi Radicals                    */\n  /*          Ideographic Description Characters */\n  /*          CJK Unified Ideographs Extension A */\n  /*          CJK Unified Ideographs Extension B */\n  /*          Kanbun                             */\n#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS          (1L << 27) /* U+4E00-U+9FFF */\n                                                          /* U+2E80-U+2EFF */\n                                                          /* U+2F00-U+2FDF */\n                                                          /* U+2FF0-U+2FFF */\n                                                          /* U+3400-U+4DB5 */\n                                                          /*U+20000-U+2A6DF*/\n                                                          /* U+3190-U+319F */\n  /* Bit 60   Private Use */\n#define TT_UCR_PRIVATE_USE                     (1L << 28) /* U+E000-U+F8FF */\n  /* Bit 61   CJK Strokes                             */\n  /*          CJK Compatibility Ideographs            */\n  /*          CJK Compatibility Ideographs Supplement */\n#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS    (1L << 29) /* U+31C0-U+31EF */\n                                                          /* U+F900-U+FAFF */\n                                                          /*U+2F800-U+2FA1F*/\n  /* Bit 62   Alphabetic Presentation Forms */\n#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS   (1L << 30) /* U+FB00-U+FB4F */\n  /* Bit 63   Arabic Presentation Forms-A */\n#define TT_UCR_ARABIC_PRESENTATIONS_A          (1L << 31) /* U+FB50-U+FDFF */\n  /* Bit 64   Combining Half Marks */\n#define TT_UCR_COMBINING_HALF_MARKS            (1L <<  0) /* U+FE20-U+FE2F */\n  /* Bit 65   Vertical forms          */\n  /*          CJK Compatibility Forms */\n#define TT_UCR_CJK_COMPATIBILITY_FORMS         (1L <<  1) /* U+FE10-U+FE1F */\n                                                          /* U+FE30-U+FE4F */\n  /* Bit 66   Small Form Variants */\n#define TT_UCR_SMALL_FORM_VARIANTS             (1L <<  2) /* U+FE50-U+FE6F */\n  /* Bit 67   Arabic Presentation Forms-B */\n#define TT_UCR_ARABIC_PRESENTATIONS_B          (1L <<  3) /* U+FE70-U+FEFE */\n  /* Bit 68   Halfwidth and Fullwidth Forms */\n#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS       (1L <<  4) /* U+FF00-U+FFEF */\n  /* Bit 69   Specials */\n#define TT_UCR_SPECIALS                        (1L <<  5) /* U+FFF0-U+FFFD */\n  /* Bit 70   Tibetan */\n#define TT_UCR_TIBETAN                         (1L <<  6) /* U+0F00-U+0FFF */\n  /* Bit 71   Syriac */\n#define TT_UCR_SYRIAC                          (1L <<  7) /* U+0700-U+074F */\n  /* Bit 72   Thaana */\n#define TT_UCR_THAANA                          (1L <<  8) /* U+0780-U+07BF */\n  /* Bit 73   Sinhala */\n#define TT_UCR_SINHALA                         (1L <<  9) /* U+0D80-U+0DFF */\n  /* Bit 74   Myanmar */\n#define TT_UCR_MYANMAR                         (1L << 10) /* U+1000-U+109F */\n  /* Bit 75   Ethiopic            */\n  /*          Ethiopic Supplement */\n  /*          Ethiopic Extended   */\n#define TT_UCR_ETHIOPIC                        (1L << 11) /* U+1200-U+137F */\n                                                          /* U+1380-U+139F */\n                                                          /* U+2D80-U+2DDF */\n  /* Bit 76   Cherokee */\n#define TT_UCR_CHEROKEE                        (1L << 12) /* U+13A0-U+13FF */\n  /* Bit 77   Unified Canadian Aboriginal Syllabics */\n#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS   (1L << 13) /* U+1400-U+167F */\n  /* Bit 78   Ogham */\n#define TT_UCR_OGHAM                           (1L << 14) /* U+1680-U+169F */\n  /* Bit 79   Runic */\n#define TT_UCR_RUNIC                           (1L << 15) /* U+16A0-U+16FF */\n  /* Bit 80   Khmer         */\n  /*          Khmer Symbols */\n#define TT_UCR_KHMER                           (1L << 16) /* U+1780-U+17FF */\n                                                          /* U+19E0-U+19FF */\n  /* Bit 81   Mongolian */\n#define TT_UCR_MONGOLIAN                       (1L << 17) /* U+1800-U+18AF */\n  /* Bit 82   Braille Patterns */\n#define TT_UCR_BRAILLE                         (1L << 18) /* U+2800-U+28FF */\n  /* Bit 83   Yi Syllables */\n  /*          Yi Radicals  */\n#define TT_UCR_YI                              (1L << 19) /* U+A000-U+A48F */\n                                                          /* U+A490-U+A4CF */\n  /* Bit 84   Tagalog  */\n  /*          Hanunoo  */\n  /*          Buhid    */\n  /*          Tagbanwa */\n#define TT_UCR_PHILIPPINE                      (1L << 20) /* U+1700-U+171F */\n                                                          /* U+1720-U+173F */\n                                                          /* U+1740-U+175F */\n                                                          /* U+1760-U+177F */\n  /* Bit 85   Old Italic */\n#define TT_UCR_OLD_ITALIC                      (1L << 21) /*U+10300-U+1032F*/\n  /* Bit 86   Gothic */\n#define TT_UCR_GOTHIC                          (1L << 22) /*U+10330-U+1034F*/\n  /* Bit 87   Deseret */\n#define TT_UCR_DESERET                         (1L << 23) /*U+10400-U+1044F*/\n  /* Bit 88   Byzantine Musical Symbols      */\n  /*          Musical Symbols                */\n  /*          Ancient Greek Musical Notation */\n#define TT_UCR_MUSICAL_SYMBOLS                 (1L << 24) /*U+1D000-U+1D0FF*/\n                                                          /*U+1D100-U+1D1FF*/\n                                                          /*U+1D200-U+1D24F*/\n  /* Bit 89   Mathematical Alphanumeric Symbols */\n#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS       (1L << 25) /*U+1D400-U+1D7FF*/\n  /* Bit 90   Private Use (plane 15) */\n  /*          Private Use (plane 16) */\n#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY       (1L << 26) /*U+F0000-U+FFFFD*/\n                                                        /*U+100000-U+10FFFD*/\n  /* Bit 91   Variation Selectors            */\n  /*          Variation Selectors Supplement */\n#define TT_UCR_VARIATION_SELECTORS             (1L << 27) /* U+FE00-U+FE0F */\n                                                          /*U+E0100-U+E01EF*/\n  /* Bit 92   Tags */\n#define TT_UCR_TAGS                            (1L << 28) /*U+E0000-U+E007F*/\n  /* Bit 93   Limbu */\n#define TT_UCR_LIMBU                           (1L << 29) /* U+1900-U+194F */\n  /* Bit 94   Tai Le */\n#define TT_UCR_TAI_LE                          (1L << 30) /* U+1950-U+197F */\n  /* Bit 95   New Tai Lue */\n#define TT_UCR_NEW_TAI_LUE                     (1L << 31) /* U+1980-U+19DF */\n  /* Bit 96   Buginese */\n#define TT_UCR_BUGINESE                        (1L <<  0) /* U+1A00-U+1A1F */\n  /* Bit 97   Glagolitic */\n#define TT_UCR_GLAGOLITIC                      (1L <<  1) /* U+2C00-U+2C5F */\n  /* Bit 98   Tifinagh */\n#define TT_UCR_TIFINAGH                        (1L <<  2) /* U+2D30-U+2D7F */\n  /* Bit 99   Yijing Hexagram Symbols */\n#define TT_UCR_YIJING                          (1L <<  3) /* U+4DC0-U+4DFF */\n  /* Bit 100  Syloti Nagri */\n#define TT_UCR_SYLOTI_NAGRI                    (1L <<  4) /* U+A800-U+A82F */\n  /* Bit 101  Linear B Syllabary */\n  /*          Linear B Ideograms */\n  /*          Aegean Numbers     */\n#define TT_UCR_LINEAR_B                        (1L <<  5) /*U+10000-U+1007F*/\n                                                          /*U+10080-U+100FF*/\n                                                          /*U+10100-U+1013F*/\n  /* Bit 102  Ancient Greek Numbers */\n#define TT_UCR_ANCIENT_GREEK_NUMBERS           (1L <<  6) /*U+10140-U+1018F*/\n  /* Bit 103  Ugaritic */\n#define TT_UCR_UGARITIC                        (1L <<  7) /*U+10380-U+1039F*/\n  /* Bit 104  Old Persian */\n#define TT_UCR_OLD_PERSIAN                     (1L <<  8) /*U+103A0-U+103DF*/\n  /* Bit 105  Shavian */\n#define TT_UCR_SHAVIAN                         (1L <<  9) /*U+10450-U+1047F*/\n  /* Bit 106  Osmanya */\n#define TT_UCR_OSMANYA                         (1L << 10) /*U+10480-U+104AF*/\n  /* Bit 107  Cypriot Syllabary */\n#define TT_UCR_CYPRIOT_SYLLABARY               (1L << 11) /*U+10800-U+1083F*/\n  /* Bit 108  Kharoshthi */\n#define TT_UCR_KHAROSHTHI                      (1L << 12) /*U+10A00-U+10A5F*/\n  /* Bit 109  Tai Xuan Jing Symbols */\n#define TT_UCR_TAI_XUAN_JING                   (1L << 13) /*U+1D300-U+1D35F*/\n  /* Bit 110  Cuneiform                         */\n  /*          Cuneiform Numbers and Punctuation */\n#define TT_UCR_CUNEIFORM                       (1L << 14) /*U+12000-U+123FF*/\n                                                          /*U+12400-U+1247F*/\n  /* Bit 111  Counting Rod Numerals */\n#define TT_UCR_COUNTING_ROD_NUMERALS           (1L << 15) /*U+1D360-U+1D37F*/\n  /* Bit 112  Sundanese */\n#define TT_UCR_SUNDANESE                       (1L << 16) /* U+1B80-U+1BBF */\n  /* Bit 113  Lepcha */\n#define TT_UCR_LEPCHA                          (1L << 17) /* U+1C00-U+1C4F */\n  /* Bit 114  Ol Chiki */\n#define TT_UCR_OL_CHIKI                        (1L << 18) /* U+1C50-U+1C7F */\n  /* Bit 115  Saurashtra */\n#define TT_UCR_SAURASHTRA                      (1L << 19) /* U+A880-U+A8DF */\n  /* Bit 116  Kayah Li */\n#define TT_UCR_KAYAH_LI                        (1L << 20) /* U+A900-U+A92F */\n  /* Bit 117  Rejang */\n#define TT_UCR_REJANG                          (1L << 21) /* U+A930-U+A95F */\n  /* Bit 118  Cham */\n#define TT_UCR_CHAM                            (1L << 22) /* U+AA00-U+AA5F */\n  /* Bit 119  Ancient Symbols */\n#define TT_UCR_ANCIENT_SYMBOLS                 (1L << 23) /*U+10190-U+101CF*/\n  /* Bit 120  Phaistos Disc */\n#define TT_UCR_PHAISTOS_DISC                   (1L << 24) /*U+101D0-U+101FF*/\n  /* Bit 121  Carian */\n  /*          Lycian */\n  /*          Lydian */\n#define TT_UCR_OLD_ANATOLIAN                   (1L << 25) /*U+102A0-U+102DF*/\n                                                          /*U+10280-U+1029F*/\n                                                          /*U+10920-U+1093F*/\n  /* Bit 122  Domino Tiles  */\n  /*          Mahjong Tiles */\n#define TT_UCR_GAME_TILES                      (1L << 26) /*U+1F030-U+1F09F*/\n                                                          /*U+1F000-U+1F02F*/\n  /* Bit 123-127 Reserved for process-internal usage */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Some compilers have a very limited length of identifiers.             */\n  /*                                                                       */\n#if defined( __TURBOC__ ) && __TURBOC__ < 0x0410 || defined( __PACIFIC__ )\n#define HAVE_LIMIT_ON_IDENTS\n#endif\n\n\n#ifndef HAVE_LIMIT_ON_IDENTS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Here some alias #defines in order to be clearer.                      */\n  /*                                                                       */\n  /* These are not always #defined to stay within the 31~character limit,  */\n  /* which some compilers have.                                            */\n  /*                                                                       */\n  /* Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern  */\n  /* Borland compilers (read: from BC++ 3.1 on) can increase this limit.   */\n  /* If you get a warning with such a compiler, use the -i40 switch.       */\n  /*                                                                       */\n#define TT_UCR_ARABIC_PRESENTATION_FORMS_A      \\\n         TT_UCR_ARABIC_PRESENTATIONS_A\n#define TT_UCR_ARABIC_PRESENTATION_FORMS_B      \\\n         TT_UCR_ARABIC_PRESENTATIONS_B\n\n#define TT_UCR_COMBINING_DIACRITICAL_MARKS      \\\n         TT_UCR_COMBINING_DIACRITICS\n#define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \\\n         TT_UCR_COMBINING_DIACRITICS_SYMB\n\n\n#endif /* !HAVE_LIMIT_ON_IDENTS */\n\n\nFT_END_HEADER\n\n#endif /* __TTNAMEID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/tttables.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  tttables.h                                                             */\n/*                                                                         */\n/*    Basic SFNT/TrueType tables definitions and interface                 */\n/*    (specification only).                                                */\n/*                                                                         */\n/*  Copyright 1996-2005, 2008-2014 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTTABLES_H__\n#define __TTTABLES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    truetype_tables                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    TrueType Tables                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    TrueType specific table types and functions.                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the definition of TrueType-specific tables   */\n  /*    as well as some routines used to access and process them.          */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    TT_Header                                                          */\n  /*    TT_HoriHeader                                                      */\n  /*    TT_VertHeader                                                      */\n  /*    TT_OS2                                                             */\n  /*    TT_Postscript                                                      */\n  /*    TT_PCLT                                                            */\n  /*    TT_MaxProfile                                                      */\n  /*                                                                       */\n  /*    FT_Sfnt_Tag                                                        */\n  /*    FT_Get_Sfnt_Table                                                  */\n  /*    FT_Load_Sfnt_Table                                                 */\n  /*    FT_Sfnt_Table_Info                                                 */\n  /*                                                                       */\n  /*    FT_Get_CMap_Language_ID                                            */\n  /*    FT_Get_CMap_Format                                                 */\n  /*                                                                       */\n  /*    FT_PARAM_TAG_UNPATENTED_HINTING                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Header                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType font header table.  All       */\n  /*    fields follow the TrueType specification.                          */\n  /*                                                                       */\n  typedef struct  TT_Header_\n  {\n    FT_Fixed   Table_Version;\n    FT_Fixed   Font_Revision;\n\n    FT_Long    CheckSum_Adjust;\n    FT_Long    Magic_Number;\n\n    FT_UShort  Flags;\n    FT_UShort  Units_Per_EM;\n\n    FT_Long    Created [2];\n    FT_Long    Modified[2];\n\n    FT_Short   xMin;\n    FT_Short   yMin;\n    FT_Short   xMax;\n    FT_Short   yMax;\n\n    FT_UShort  Mac_Style;\n    FT_UShort  Lowest_Rec_PPEM;\n\n    FT_Short   Font_Direction;\n    FT_Short   Index_To_Loc_Format;\n    FT_Short   Glyph_Data_Format;\n\n  } TT_Header;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_HoriHeader                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType horizontal header, the `hhea' */\n  /*    table, as well as the corresponding horizontal metrics table,      */\n  /*    i.e., the `hmtx' table.                                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Version                :: The table version.                       */\n  /*                                                                       */\n  /*    Ascender               :: The font's ascender, i.e., the distance  */\n  /*                              from the baseline to the top-most of all */\n  /*                              glyph points found in the font.          */\n  /*                                                                       */\n  /*                              This value is invalid in many fonts, as  */\n  /*                              it is usually set by the font designer,  */\n  /*                              and often reflects only a portion of the */\n  /*                              glyphs found in the font (maybe ASCII).  */\n  /*                                                                       */\n  /*                              You should use the `sTypoAscender' field */\n  /*                              of the OS/2 table instead if you want    */\n  /*                              the correct one.                         */\n  /*                                                                       */\n  /*    Descender              :: The font's descender, i.e., the distance */\n  /*                              from the baseline to the bottom-most of  */\n  /*                              all glyph points found in the font.  It  */\n  /*                              is negative.                             */\n  /*                                                                       */\n  /*                              This value is invalid in many fonts, as  */\n  /*                              it is usually set by the font designer,  */\n  /*                              and often reflects only a portion of the */\n  /*                              glyphs found in the font (maybe ASCII).  */\n  /*                                                                       */\n  /*                              You should use the `sTypoDescender'      */\n  /*                              field of the OS/2 table instead if you   */\n  /*                              want the correct one.                    */\n  /*                                                                       */\n  /*    Line_Gap               :: The font's line gap, i.e., the distance  */\n  /*                              to add to the ascender and descender to  */\n  /*                              get the BTB, i.e., the                   */\n  /*                              baseline-to-baseline distance for the    */\n  /*                              font.                                    */\n  /*                                                                       */\n  /*    advance_Width_Max      :: This field is the maximum of all advance */\n  /*                              widths found in the font.  It can be     */\n  /*                              used to compute the maximum width of an  */\n  /*                              arbitrary string of text.                */\n  /*                                                                       */\n  /*    min_Left_Side_Bearing  :: The minimum left side bearing of all     */\n  /*                              glyphs within the font.                  */\n  /*                                                                       */\n  /*    min_Right_Side_Bearing :: The minimum right side bearing of all    */\n  /*                              glyphs within the font.                  */\n  /*                                                                       */\n  /*    xMax_Extent            :: The maximum horizontal extent (i.e., the */\n  /*                              `width' of a glyph's bounding box) for   */\n  /*                              all glyphs in the font.                  */\n  /*                                                                       */\n  /*    caret_Slope_Rise       :: The rise coefficient of the cursor's     */\n  /*                              slope of the cursor (slope=rise/run).    */\n  /*                                                                       */\n  /*    caret_Slope_Run        :: The run coefficient of the cursor's      */\n  /*                              slope.                                   */\n  /*                                                                       */\n  /*    Reserved               :: 8~reserved bytes.                        */\n  /*                                                                       */\n  /*    metric_Data_Format     :: Always~0.                                */\n  /*                                                                       */\n  /*    number_Of_HMetrics     :: Number of HMetrics entries in the `hmtx' */\n  /*                              table -- this value can be smaller than  */\n  /*                              the total number of glyphs in the font.  */\n  /*                                                                       */\n  /*    long_metrics           :: A pointer into the `hmtx' table.         */\n  /*                                                                       */\n  /*    short_metrics          :: A pointer into the `hmtx' table.         */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should   */\n  /*               be identical except for the names of their fields,      */\n  /*               which are different.                                    */\n  /*                                                                       */\n  /*               This ensures that a single function in the `ttload'     */\n  /*               module is able to read both the horizontal and vertical */\n  /*               headers.                                                */\n  /*                                                                       */\n  typedef struct  TT_HoriHeader_\n  {\n    FT_Fixed   Version;\n    FT_Short   Ascender;\n    FT_Short   Descender;\n    FT_Short   Line_Gap;\n\n    FT_UShort  advance_Width_Max;      /* advance width maximum */\n\n    FT_Short   min_Left_Side_Bearing;  /* minimum left-sb       */\n    FT_Short   min_Right_Side_Bearing; /* minimum right-sb      */\n    FT_Short   xMax_Extent;            /* xmax extents          */\n    FT_Short   caret_Slope_Rise;\n    FT_Short   caret_Slope_Run;\n    FT_Short   caret_Offset;\n\n    FT_Short   Reserved[4];\n\n    FT_Short   metric_Data_Format;\n    FT_UShort  number_Of_HMetrics;\n\n    /* The following fields are not defined by the TrueType specification */\n    /* but they are used to connect the metrics header to the relevant    */\n    /* `HMTX' table.                                                      */\n\n    void*      long_metrics;\n    void*      short_metrics;\n\n  } TT_HoriHeader;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_VertHeader                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType vertical header, the `vhea'   */\n  /*    table, as well as the corresponding vertical metrics table, i.e.,  */\n  /*    the `vmtx' table.                                                  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Version                 :: The table version.                      */\n  /*                                                                       */\n  /*    Ascender                :: The font's ascender, i.e., the distance */\n  /*                               from the baseline to the top-most of    */\n  /*                               all glyph points found in the font.     */\n  /*                                                                       */\n  /*                               This value is invalid in many fonts, as */\n  /*                               it is usually set by the font designer, */\n  /*                               and often reflects only a portion of    */\n  /*                               the glyphs found in the font (maybe     */\n  /*                               ASCII).                                 */\n  /*                                                                       */\n  /*                               You should use the `sTypoAscender'      */\n  /*                               field of the OS/2 table instead if you  */\n  /*                               want the correct one.                   */\n  /*                                                                       */\n  /*    Descender               :: The font's descender, i.e., the         */\n  /*                               distance from the baseline to the       */\n  /*                               bottom-most of all glyph points found   */\n  /*                               in the font.  It is negative.           */\n  /*                                                                       */\n  /*                               This value is invalid in many fonts, as */\n  /*                               it is usually set by the font designer, */\n  /*                               and often reflects only a portion of    */\n  /*                               the glyphs found in the font (maybe     */\n  /*                               ASCII).                                 */\n  /*                                                                       */\n  /*                               You should use the `sTypoDescender'     */\n  /*                               field of the OS/2 table instead if you  */\n  /*                               want the correct one.                   */\n  /*                                                                       */\n  /*    Line_Gap                :: The font's line gap, i.e., the distance */\n  /*                               to add to the ascender and descender to */\n  /*                               get the BTB, i.e., the                  */\n  /*                               baseline-to-baseline distance for the   */\n  /*                               font.                                   */\n  /*                                                                       */\n  /*    advance_Height_Max      :: This field is the maximum of all        */\n  /*                               advance heights found in the font.  It  */\n  /*                               can be used to compute the maximum      */\n  /*                               height of an arbitrary string of text.  */\n  /*                                                                       */\n  /*    min_Top_Side_Bearing    :: The minimum top side bearing of all     */\n  /*                               glyphs within the font.                 */\n  /*                                                                       */\n  /*    min_Bottom_Side_Bearing :: The minimum bottom side bearing of all  */\n  /*                               glyphs within the font.                 */\n  /*                                                                       */\n  /*    yMax_Extent             :: The maximum vertical extent (i.e., the  */\n  /*                               `height' of a glyph's bounding box) for */\n  /*                               all glyphs in the font.                 */\n  /*                                                                       */\n  /*    caret_Slope_Rise        :: The rise coefficient of the cursor's    */\n  /*                               slope of the cursor (slope=rise/run).   */\n  /*                                                                       */\n  /*    caret_Slope_Run         :: The run coefficient of the cursor's     */\n  /*                               slope.                                  */\n  /*                                                                       */\n  /*    caret_Offset            :: The cursor's offset for slanted fonts.  */\n  /*                               This value is `reserved' in vmtx        */\n  /*                               version 1.0.                            */\n  /*                                                                       */\n  /*    Reserved                :: 8~reserved bytes.                       */\n  /*                                                                       */\n  /*    metric_Data_Format      :: Always~0.                               */\n  /*                                                                       */\n  /*    number_Of_HMetrics      :: Number of VMetrics entries in the       */\n  /*                               `vmtx' table -- this value can be       */\n  /*                               smaller than the total number of glyphs */\n  /*                               in the font.                            */\n  /*                                                                       */\n  /*    long_metrics           :: A pointer into the `vmtx' table.         */\n  /*                                                                       */\n  /*    short_metrics          :: A pointer into the `vmtx' table.         */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should   */\n  /*               be identical except for the names of their fields,      */\n  /*               which are different.                                    */\n  /*                                                                       */\n  /*               This ensures that a single function in the `ttload'     */\n  /*               module is able to read both the horizontal and vertical */\n  /*               headers.                                                */\n  /*                                                                       */\n  typedef struct  TT_VertHeader_\n  {\n    FT_Fixed   Version;\n    FT_Short   Ascender;\n    FT_Short   Descender;\n    FT_Short   Line_Gap;\n\n    FT_UShort  advance_Height_Max;      /* advance height maximum */\n\n    FT_Short   min_Top_Side_Bearing;    /* minimum left-sb or top-sb       */\n    FT_Short   min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb   */\n    FT_Short   yMax_Extent;             /* xmax or ymax extents            */\n    FT_Short   caret_Slope_Rise;\n    FT_Short   caret_Slope_Run;\n    FT_Short   caret_Offset;\n\n    FT_Short   Reserved[4];\n\n    FT_Short   metric_Data_Format;\n    FT_UShort  number_Of_VMetrics;\n\n    /* The following fields are not defined by the TrueType specification */\n    /* but they're used to connect the metrics header to the relevant     */\n    /* `HMTX' or `VMTX' table.                                            */\n\n    void*      long_metrics;\n    void*      short_metrics;\n\n  } TT_VertHeader;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_OS2                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType OS/2 table.  All fields       */\n  /*    comply to the OpenType specification.                              */\n  /*                                                                       */\n  /*    Note that we now support old Mac fonts that do not include an OS/2 */\n  /*    table.  In this case, the `version' field is always set to 0xFFFF. */\n  /*                                                                       */\n  typedef struct  TT_OS2_\n  {\n    FT_UShort  version;                /* 0x0001 - more or 0xFFFF */\n    FT_Short   xAvgCharWidth;\n    FT_UShort  usWeightClass;\n    FT_UShort  usWidthClass;\n    FT_Short   fsType;\n    FT_Short   ySubscriptXSize;\n    FT_Short   ySubscriptYSize;\n    FT_Short   ySubscriptXOffset;\n    FT_Short   ySubscriptYOffset;\n    FT_Short   ySuperscriptXSize;\n    FT_Short   ySuperscriptYSize;\n    FT_Short   ySuperscriptXOffset;\n    FT_Short   ySuperscriptYOffset;\n    FT_Short   yStrikeoutSize;\n    FT_Short   yStrikeoutPosition;\n    FT_Short   sFamilyClass;\n\n    FT_Byte    panose[10];\n\n    FT_ULong   ulUnicodeRange1;        /* Bits 0-31   */\n    FT_ULong   ulUnicodeRange2;        /* Bits 32-63  */\n    FT_ULong   ulUnicodeRange3;        /* Bits 64-95  */\n    FT_ULong   ulUnicodeRange4;        /* Bits 96-127 */\n\n    FT_Char    achVendID[4];\n\n    FT_UShort  fsSelection;\n    FT_UShort  usFirstCharIndex;\n    FT_UShort  usLastCharIndex;\n    FT_Short   sTypoAscender;\n    FT_Short   sTypoDescender;\n    FT_Short   sTypoLineGap;\n    FT_UShort  usWinAscent;\n    FT_UShort  usWinDescent;\n\n    /* only version 1 and higher: */\n\n    FT_ULong   ulCodePageRange1;       /* Bits 0-31   */\n    FT_ULong   ulCodePageRange2;       /* Bits 32-63  */\n\n    /* only version 2 and higher: */\n\n    FT_Short   sxHeight;\n    FT_Short   sCapHeight;\n    FT_UShort  usDefaultChar;\n    FT_UShort  usBreakChar;\n    FT_UShort  usMaxContext;\n\n    /* only version 5 and higher: */\n\n    FT_UShort  usLowerOpticalPointSize;       /* in twips (1/20th points) */\n    FT_UShort  usUpperOpticalPointSize;       /* in twips (1/20th points) */\n\n  } TT_OS2;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Postscript                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType PostScript table.  All fields */\n  /*    comply to the TrueType specification.  This structure does not     */\n  /*    reference the PostScript glyph names, which can be nevertheless    */\n  /*    accessed with the `ttpost' module.                                 */\n  /*                                                                       */\n  typedef struct  TT_Postscript_\n  {\n    FT_Fixed  FormatType;\n    FT_Fixed  italicAngle;\n    FT_Short  underlinePosition;\n    FT_Short  underlineThickness;\n    FT_ULong  isFixedPitch;\n    FT_ULong  minMemType42;\n    FT_ULong  maxMemType42;\n    FT_ULong  minMemType1;\n    FT_ULong  maxMemType1;\n\n    /* Glyph names follow in the file, but we don't   */\n    /* load them by default.  See the ttpost.c file.  */\n\n  } TT_Postscript;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_PCLT                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType PCLT table.  All fields       */\n  /*    comply to the TrueType specification.                              */\n  /*                                                                       */\n  typedef struct  TT_PCLT_\n  {\n    FT_Fixed   Version;\n    FT_ULong   FontNumber;\n    FT_UShort  Pitch;\n    FT_UShort  xHeight;\n    FT_UShort  Style;\n    FT_UShort  TypeFamily;\n    FT_UShort  CapHeight;\n    FT_UShort  SymbolSet;\n    FT_Char    TypeFace[16];\n    FT_Char    CharacterComplement[8];\n    FT_Char    FileName[6];\n    FT_Char    StrokeWeight;\n    FT_Char    WidthType;\n    FT_Byte    SerifStyle;\n    FT_Byte    Reserved;\n\n  } TT_PCLT;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_MaxProfile                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The maximum profile is a table containing many max values, which   */\n  /*    can be used to pre-allocate arrays.  This ensures that no memory   */\n  /*    allocation occurs during a glyph load.                             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    version               :: The version number.                       */\n  /*                                                                       */\n  /*    numGlyphs             :: The number of glyphs in this TrueType     */\n  /*                             font.                                     */\n  /*                                                                       */\n  /*    maxPoints             :: The maximum number of points in a         */\n  /*                             non-composite TrueType glyph.  See also   */\n  /*                             the structure element                     */\n  /*                             `maxCompositePoints'.                     */\n  /*                                                                       */\n  /*    maxContours           :: The maximum number of contours in a       */\n  /*                             non-composite TrueType glyph.  See also   */\n  /*                             the structure element                     */\n  /*                             `maxCompositeContours'.                   */\n  /*                                                                       */\n  /*    maxCompositePoints    :: The maximum number of points in a         */\n  /*                             composite TrueType glyph.  See also the   */\n  /*                             structure element `maxPoints'.            */\n  /*                                                                       */\n  /*    maxCompositeContours  :: The maximum number of contours in a       */\n  /*                             composite TrueType glyph.  See also the   */\n  /*                             structure element `maxContours'.          */\n  /*                                                                       */\n  /*    maxZones              :: The maximum number of zones used for      */\n  /*                             glyph hinting.                            */\n  /*                                                                       */\n  /*    maxTwilightPoints     :: The maximum number of points in the       */\n  /*                             twilight zone used for glyph hinting.     */\n  /*                                                                       */\n  /*    maxStorage            :: The maximum number of elements in the     */\n  /*                             storage area used for glyph hinting.      */\n  /*                                                                       */\n  /*    maxFunctionDefs       :: The maximum number of function            */\n  /*                             definitions in the TrueType bytecode for  */\n  /*                             this font.                                */\n  /*                                                                       */\n  /*    maxInstructionDefs    :: The maximum number of instruction         */\n  /*                             definitions in the TrueType bytecode for  */\n  /*                             this font.                                */\n  /*                                                                       */\n  /*    maxStackElements      :: The maximum number of stack elements used */\n  /*                             during bytecode interpretation.           */\n  /*                                                                       */\n  /*    maxSizeOfInstructions :: The maximum number of TrueType opcodes    */\n  /*                             used for glyph hinting.                   */\n  /*                                                                       */\n  /*    maxComponentElements  :: The maximum number of simple (i.e., non-  */\n  /*                             composite) glyphs in a composite glyph.   */\n  /*                                                                       */\n  /*    maxComponentDepth     :: The maximum nesting depth of composite    */\n  /*                             glyphs.                                   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This structure is only used during font loading.                   */\n  /*                                                                       */\n  typedef struct  TT_MaxProfile_\n  {\n    FT_Fixed   version;\n    FT_UShort  numGlyphs;\n    FT_UShort  maxPoints;\n    FT_UShort  maxContours;\n    FT_UShort  maxCompositePoints;\n    FT_UShort  maxCompositeContours;\n    FT_UShort  maxZones;\n    FT_UShort  maxTwilightPoints;\n    FT_UShort  maxStorage;\n    FT_UShort  maxFunctionDefs;\n    FT_UShort  maxInstructionDefs;\n    FT_UShort  maxStackElements;\n    FT_UShort  maxSizeOfInstructions;\n    FT_UShort  maxComponentElements;\n    FT_UShort  maxComponentDepth;\n\n  } TT_MaxProfile;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Sfnt_Tag                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used to specify the index of an SFNT table.         */\n  /*    Used in the @FT_Get_Sfnt_Table API function.                       */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_SFNT_HEAD :: To access the font's @TT_Header structure.         */\n  /*                                                                       */\n  /*    FT_SFNT_MAXP :: To access the font's @TT_MaxProfile structure.     */\n  /*                                                                       */\n  /*    FT_SFNT_OS2  :: To access the font's @TT_OS2 structure.            */\n  /*                                                                       */\n  /*    FT_SFNT_HHEA :: To access the font's @TT_HoriHeader structure.     */\n  /*                                                                       */\n  /*    FT_SFNT_VHEA :: To access the font's @TT_VertHeader struture.      */\n  /*                                                                       */\n  /*    FT_SFNT_POST :: To access the font's @TT_Postscript structure.     */\n  /*                                                                       */\n  /*    FT_SFNT_PCLT :: To access the font's @TT_PCLT structure.           */\n  /*                                                                       */\n  typedef enum  FT_Sfnt_Tag_\n  {\n    FT_SFNT_HEAD,\n    FT_SFNT_MAXP,\n    FT_SFNT_OS2,\n    FT_SFNT_HHEA,\n    FT_SFNT_VHEA,\n    FT_SFNT_POST,\n    FT_SFNT_PCLT,\n\n    FT_SFNT_MAX\n\n  } FT_Sfnt_Tag;\n\n  /* these constants are deprecated; use the corresponding `FT_Sfnt_Tag' */\n  /* values instead                                                      */\n#define ft_sfnt_head  FT_SFNT_HEAD\n#define ft_sfnt_maxp  FT_SFNT_MAXP\n#define ft_sfnt_os2   FT_SFNT_OS2\n#define ft_sfnt_hhea  FT_SFNT_HHEA\n#define ft_sfnt_vhea  FT_SFNT_VHEA\n#define ft_sfnt_post  FT_SFNT_POST\n#define ft_sfnt_pclt  FT_SFNT_PCLT\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Sfnt_Table                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a pointer to a given SFNT table within a face.              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source.                                    */\n  /*                                                                       */\n  /*    tag  :: The index of the SFNT table.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A type-less pointer to the table.  This will be~0 in case of       */\n  /*    error, or if the corresponding table was not found *OR* loaded     */\n  /*    from the file.                                                     */\n  /*                                                                       */\n  /*    Use a typecast according to `tag' to access the structure          */\n  /*    elements.                                                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The table is owned by the face object and disappears with it.      */\n  /*                                                                       */\n  /*    This function is only useful to access SFNT tables that are loaded */\n  /*    by the sfnt, truetype, and opentype drivers.  See @FT_Sfnt_Tag for */\n  /*    a list.                                                            */\n  /*                                                                       */\n  /*    Here an example how to access the `vhea' table:                    */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      TT_VertHeader*  vert_header;                                     */\n  /*                                                                       */\n  /*                                                                       */\n  /*      vert_header =                                                    */\n  /*        (TT_VertHeader*)FT_Get_Sfnt_Table( face, FT_SFNT_VHEA );       */\n  /*    }                                                                  */\n  /*                                                                       */\n  FT_EXPORT( void* )\n  FT_Get_Sfnt_Table( FT_Face      face,\n                     FT_Sfnt_Tag  tag );\n\n\n /**************************************************************************\n  *\n  * @function:\n  *   FT_Load_Sfnt_Table\n  *\n  * @description:\n  *   Load any font table into client memory.\n  *\n  * @input:\n  *   face ::\n  *     A handle to the source face.\n  *\n  *   tag ::\n  *     The four-byte tag of the table to load.  Use the value~0 if you want\n  *     to access the whole font file.  Otherwise, you can use one of the\n  *     definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new\n  *     one with @FT_MAKE_TAG.\n  *\n  *   offset ::\n  *     The starting offset in the table (or file if tag == 0).\n  *\n  * @output:\n  *   buffer ::\n  *     The target buffer address.  The client must ensure that the memory\n  *     array is big enough to hold the data.\n  *\n  * @inout:\n  *   length ::\n  *     If the `length' parameter is NULL, then try to load the whole table.\n  *     Return an error code if it fails.\n  *\n  *     Else, if `*length' is~0, exit immediately while returning the\n  *     table's (or file) full size in it.\n  *\n  *     Else the number of bytes to read from the table or file, from the\n  *     starting offset.\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   If you need to determine the table's length you should first call this\n  *   function with `*length' set to~0, as in the following example:\n  *\n  *     {\n  *       FT_ULong  length = 0;\n  *\n  *\n  *       error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );\n  *       if ( error ) { ... table does not exist ... }\n  *\n  *       buffer = malloc( length );\n  *       if ( buffer == NULL ) { ... not enough memory ... }\n  *\n  *       error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );\n  *       if ( error ) { ... could not load table ... }\n  *     }\n  *\n  *   Note that structures like @TT_Header or @TT_OS2 can't be used with\n  *   this function; they are limited to @FT_Get_Sfnt_Table.  Reason is that\n  *   those structures depend on the processor architecture, with varying\n  *   size (e.g. 32bit vs. 64bit) or order (big endian vs. little endian).\n  *\n  */\n  FT_EXPORT( FT_Error )\n  FT_Load_Sfnt_Table( FT_Face    face,\n                      FT_ULong   tag,\n                      FT_Long    offset,\n                      FT_Byte*   buffer,\n                      FT_ULong*  length );\n\n\n /**************************************************************************\n  *\n  * @function:\n  *   FT_Sfnt_Table_Info\n  *\n  * @description:\n  *   Return information on an SFNT table.\n  *\n  * @input:\n  *   face ::\n  *     A handle to the source face.\n  *\n  *   table_index ::\n  *     The index of an SFNT table.  The function returns\n  *     FT_Err_Table_Missing for an invalid value.\n  *\n  * @inout:\n  *   tag ::\n  *     The name tag of the SFNT table.  If the value is NULL, `table_index'\n  *     is ignored, and `length' returns the number of SFNT tables in the\n  *     font.\n  *\n  * @output:\n  *   length ::\n  *     The length of the SFNT table (or the number of SFNT tables, depending\n  *     on `tag').\n  *\n  * @return:\n  *   FreeType error code.  0~means success.\n  *\n  * @note:\n  *   While parsing fonts, FreeType handles SFNT tables with length zero as\n  *   missing.\n  *\n  */\n  FT_EXPORT( FT_Error )\n  FT_Sfnt_Table_Info( FT_Face    face,\n                      FT_UInt    table_index,\n                      FT_ULong  *tag,\n                      FT_ULong  *length );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_CMap_Language_ID                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return TrueType/sfnt specific cmap language ID.  Definitions of    */\n  /*    language ID values are in `ttnameid.h'.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    charmap ::                                                         */\n  /*      The target charmap.                                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The language ID of `charmap'.  If `charmap' doesn't belong to a    */\n  /*    TrueType/sfnt face, just return~0 as the default value.            */\n  /*                                                                       */\n  /*    For a format~14 cmap (to access Unicode IVS), the return value is  */\n  /*    0xFFFFFFFF.                                                        */\n  /*                                                                       */\n  FT_EXPORT( FT_ULong )\n  FT_Get_CMap_Language_ID( FT_CharMap  charmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_CMap_Format                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return TrueType/sfnt specific cmap format.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    charmap ::                                                         */\n  /*      The target charmap.                                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The format of `charmap'.  If `charmap' doesn't belong to a         */\n  /*    TrueType/sfnt face, return -1.                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_Get_CMap_Format( FT_CharMap  charmap );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __TTTABLES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/tttags.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  tttags.h                                                               */\n/*                                                                         */\n/*    Tags for TrueType and OpenType tables (specification only).          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2004, 2005, 2007, 2008, 2013 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTAGS_H__\n#define __TTAGS_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n#define TTAG_avar  FT_MAKE_TAG( 'a', 'v', 'a', 'r' )\n#define TTAG_BASE  FT_MAKE_TAG( 'B', 'A', 'S', 'E' )\n#define TTAG_bdat  FT_MAKE_TAG( 'b', 'd', 'a', 't' )\n#define TTAG_BDF   FT_MAKE_TAG( 'B', 'D', 'F', ' ' )\n#define TTAG_bhed  FT_MAKE_TAG( 'b', 'h', 'e', 'd' )\n#define TTAG_bloc  FT_MAKE_TAG( 'b', 'l', 'o', 'c' )\n#define TTAG_bsln  FT_MAKE_TAG( 'b', 's', 'l', 'n' )\n#define TTAG_CBDT  FT_MAKE_TAG( 'C', 'B', 'D', 'T' )\n#define TTAG_CBLC  FT_MAKE_TAG( 'C', 'B', 'L', 'C' )\n#define TTAG_CFF   FT_MAKE_TAG( 'C', 'F', 'F', ' ' )\n#define TTAG_CID   FT_MAKE_TAG( 'C', 'I', 'D', ' ' )\n#define TTAG_cmap  FT_MAKE_TAG( 'c', 'm', 'a', 'p' )\n#define TTAG_cvar  FT_MAKE_TAG( 'c', 'v', 'a', 'r' )\n#define TTAG_cvt   FT_MAKE_TAG( 'c', 'v', 't', ' ' )\n#define TTAG_DSIG  FT_MAKE_TAG( 'D', 'S', 'I', 'G' )\n#define TTAG_EBDT  FT_MAKE_TAG( 'E', 'B', 'D', 'T' )\n#define TTAG_EBLC  FT_MAKE_TAG( 'E', 'B', 'L', 'C' )\n#define TTAG_EBSC  FT_MAKE_TAG( 'E', 'B', 'S', 'C' )\n#define TTAG_feat  FT_MAKE_TAG( 'f', 'e', 'a', 't' )\n#define TTAG_FOND  FT_MAKE_TAG( 'F', 'O', 'N', 'D' )\n#define TTAG_fpgm  FT_MAKE_TAG( 'f', 'p', 'g', 'm' )\n#define TTAG_fvar  FT_MAKE_TAG( 'f', 'v', 'a', 'r' )\n#define TTAG_gasp  FT_MAKE_TAG( 'g', 'a', 's', 'p' )\n#define TTAG_GDEF  FT_MAKE_TAG( 'G', 'D', 'E', 'F' )\n#define TTAG_glyf  FT_MAKE_TAG( 'g', 'l', 'y', 'f' )\n#define TTAG_GPOS  FT_MAKE_TAG( 'G', 'P', 'O', 'S' )\n#define TTAG_GSUB  FT_MAKE_TAG( 'G', 'S', 'U', 'B' )\n#define TTAG_gvar  FT_MAKE_TAG( 'g', 'v', 'a', 'r' )\n#define TTAG_hdmx  FT_MAKE_TAG( 'h', 'd', 'm', 'x' )\n#define TTAG_head  FT_MAKE_TAG( 'h', 'e', 'a', 'd' )\n#define TTAG_hhea  FT_MAKE_TAG( 'h', 'h', 'e', 'a' )\n#define TTAG_hmtx  FT_MAKE_TAG( 'h', 'm', 't', 'x' )\n#define TTAG_JSTF  FT_MAKE_TAG( 'J', 'S', 'T', 'F' )\n#define TTAG_just  FT_MAKE_TAG( 'j', 'u', 's', 't' )\n#define TTAG_kern  FT_MAKE_TAG( 'k', 'e', 'r', 'n' )\n#define TTAG_lcar  FT_MAKE_TAG( 'l', 'c', 'a', 'r' )\n#define TTAG_loca  FT_MAKE_TAG( 'l', 'o', 'c', 'a' )\n#define TTAG_LTSH  FT_MAKE_TAG( 'L', 'T', 'S', 'H' )\n#define TTAG_LWFN  FT_MAKE_TAG( 'L', 'W', 'F', 'N' )\n#define TTAG_MATH  FT_MAKE_TAG( 'M', 'A', 'T', 'H' )\n#define TTAG_maxp  FT_MAKE_TAG( 'm', 'a', 'x', 'p' )\n#define TTAG_META  FT_MAKE_TAG( 'M', 'E', 'T', 'A' )\n#define TTAG_MMFX  FT_MAKE_TAG( 'M', 'M', 'F', 'X' )\n#define TTAG_MMSD  FT_MAKE_TAG( 'M', 'M', 'S', 'D' )\n#define TTAG_mort  FT_MAKE_TAG( 'm', 'o', 'r', 't' )\n#define TTAG_morx  FT_MAKE_TAG( 'm', 'o', 'r', 'x' )\n#define TTAG_name  FT_MAKE_TAG( 'n', 'a', 'm', 'e' )\n#define TTAG_opbd  FT_MAKE_TAG( 'o', 'p', 'b', 'd' )\n#define TTAG_OS2   FT_MAKE_TAG( 'O', 'S', '/', '2' )\n#define TTAG_OTTO  FT_MAKE_TAG( 'O', 'T', 'T', 'O' )\n#define TTAG_PCLT  FT_MAKE_TAG( 'P', 'C', 'L', 'T' )\n#define TTAG_POST  FT_MAKE_TAG( 'P', 'O', 'S', 'T' )\n#define TTAG_post  FT_MAKE_TAG( 'p', 'o', 's', 't' )\n#define TTAG_prep  FT_MAKE_TAG( 'p', 'r', 'e', 'p' )\n#define TTAG_prop  FT_MAKE_TAG( 'p', 'r', 'o', 'p' )\n#define TTAG_sbix  FT_MAKE_TAG( 's', 'b', 'i', 'x' )\n#define TTAG_sfnt  FT_MAKE_TAG( 's', 'f', 'n', 't' )\n#define TTAG_SING  FT_MAKE_TAG( 'S', 'I', 'N', 'G' )\n#define TTAG_trak  FT_MAKE_TAG( 't', 'r', 'a', 'k' )\n#define TTAG_true  FT_MAKE_TAG( 't', 'r', 'u', 'e' )\n#define TTAG_ttc   FT_MAKE_TAG( 't', 't', 'c', ' ' )\n#define TTAG_ttcf  FT_MAKE_TAG( 't', 't', 'c', 'f' )\n#define TTAG_TYP1  FT_MAKE_TAG( 'T', 'Y', 'P', '1' )\n#define TTAG_typ1  FT_MAKE_TAG( 't', 'y', 'p', '1' )\n#define TTAG_VDMX  FT_MAKE_TAG( 'V', 'D', 'M', 'X' )\n#define TTAG_vhea  FT_MAKE_TAG( 'v', 'h', 'e', 'a' )\n#define TTAG_vmtx  FT_MAKE_TAG( 'v', 'm', 't', 'x' )\n#define TTAG_wOFF  FT_MAKE_TAG( 'w', 'O', 'F', 'F' )\n\n\nFT_END_HEADER\n\n#endif /* __TTAGS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/include/ttunpat.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttunpat.h                                                              */\n/*                                                                         */\n/*    Definitions for the unpatented TrueType hinting system               */\n/*                                                                         */\n/*  Copyright 2003, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  Written by Graham Asher <graham.asher@btinternet.com>                  */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTUNPAT_H__\n#define __TTUNPAT_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n /***************************************************************************\n  *\n  * @constant:\n  *   FT_PARAM_TAG_UNPATENTED_HINTING\n  *\n  * @description:\n  *   A constant used as the tag of an @FT_Parameter structure to indicate\n  *   that unpatented methods only should be used by the TrueType bytecode\n  *   interpreter for a typeface opened by @FT_Open_Face.\n  *\n  */\n#define FT_PARAM_TAG_UNPATENTED_HINTING  FT_MAKE_TAG( 'u', 'n', 'p', 'a' )\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __TTUNPAT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/Jamfile",
    "content": "# FreeType 2 src Jamfile\n#\n# Copyright 2001, 2002, 2013 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) ;\n\n# The file <internal/internal.h> is used to define macros that are\n# later used in #include statements.  It needs to be parsed in order to\n# record these definitions.\n#\nHDRMACRO  [ FT2_SubDir $(FT2_INCLUDE_DIR) internal internal.h ] ;\n\nfor xx in $(FT2_COMPONENTS)\n{\n  SubInclude FT2_TOP $(FT2_SRC_DIR) $(xx) ;\n}\n\n# end of src Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/autofit/Jamfile",
    "content": "# FreeType 2 src/autofit Jamfile\n#\n# Copyright 2003, 2004, 2005, 2006, 2007, 2009 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir FT2_TOP src autofit ;\n\n{\n  local  _sources ;\n\n  # define FT2_AUTOFIT2 to enable experimental latin hinter replacement\n  if $(FT2_AUTOFIT2)\n  {\n    DEFINES += FT_OPTION_AUTOFIT2 ;\n  }\n  if $(FT2_MULTI)\n  {\n    _sources = afangles afglobal afhints aflatin afcjk afindic afloader afmodule afdummy afwarp afpic ;\n\n    if $(FT2_AUTOFIT2)\n    {\n      _sources += aflatin2 ;\n    }\n  }\n  else\n  {\n    _sources = autofit ;\n  }\n\n  Library  $(FT2_LIB) : $(_sources).c ;\n}\n\n# end of src/autofit Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afangles.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afangles.c                                                             */\n/*                                                                         */\n/*    Routines used to compute vector angles with limited accuracy         */\n/*    and very high speed.  It also contains sorting routines (body).      */\n/*                                                                         */\n/*  Copyright 2003-2006, 2011-2012 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"aftypes.h\"\n\n\n  /*\n   *  We are not using `af_angle_atan' anymore, but we keep the source\n   *  code below just in case...\n   */\n\n\n#if 0\n\n\n  /*\n   *  The trick here is to realize that we don't need a very accurate angle\n   *  approximation.  We are going to use the result of `af_angle_atan' to\n   *  only compare the sign of angle differences, or check whether its\n   *  magnitude is very small.\n   *\n   *  The approximation\n   *\n   *    dy * PI / (|dx|+|dy|)\n   *\n   *  should be enough, and much faster to compute.\n   */\n  FT_LOCAL_DEF( AF_Angle )\n  af_angle_atan( FT_Fixed  dx,\n                 FT_Fixed  dy )\n  {\n    AF_Angle  angle;\n    FT_Fixed  ax = dx;\n    FT_Fixed  ay = dy;\n\n\n    if ( ax < 0 )\n      ax = -ax;\n    if ( ay < 0 )\n      ay = -ay;\n\n    ax += ay;\n\n    if ( ax == 0 )\n      angle = 0;\n    else\n    {\n      angle = ( AF_ANGLE_PI2 * dy ) / ( ax + ay );\n      if ( dx < 0 )\n      {\n        if ( angle >= 0 )\n          angle = AF_ANGLE_PI - angle;\n        else\n          angle = -AF_ANGLE_PI - angle;\n      }\n    }\n\n    return angle;\n  }\n\n\n#elif 0\n\n\n  /* the following table has been automatically generated with */\n  /* the `mather.py' Python script                             */\n\n#define AF_ATAN_BITS  8\n\n  static const FT_Byte  af_arctan[1L << AF_ATAN_BITS] =\n  {\n     0,  0,  1,  1,  1,  2,  2,  2,\n     3,  3,  3,  3,  4,  4,  4,  5,\n     5,  5,  6,  6,  6,  7,  7,  7,\n     8,  8,  8,  9,  9,  9, 10, 10,\n    10, 10, 11, 11, 11, 12, 12, 12,\n    13, 13, 13, 14, 14, 14, 14, 15,\n    15, 15, 16, 16, 16, 17, 17, 17,\n    18, 18, 18, 18, 19, 19, 19, 20,\n    20, 20, 21, 21, 21, 21, 22, 22,\n    22, 23, 23, 23, 24, 24, 24, 24,\n    25, 25, 25, 26, 26, 26, 26, 27,\n    27, 27, 28, 28, 28, 28, 29, 29,\n    29, 30, 30, 30, 30, 31, 31, 31,\n    31, 32, 32, 32, 33, 33, 33, 33,\n    34, 34, 34, 34, 35, 35, 35, 35,\n    36, 36, 36, 36, 37, 37, 37, 38,\n    38, 38, 38, 39, 39, 39, 39, 40,\n    40, 40, 40, 41, 41, 41, 41, 42,\n    42, 42, 42, 42, 43, 43, 43, 43,\n    44, 44, 44, 44, 45, 45, 45, 45,\n    46, 46, 46, 46, 46, 47, 47, 47,\n    47, 48, 48, 48, 48, 48, 49, 49,\n    49, 49, 50, 50, 50, 50, 50, 51,\n    51, 51, 51, 51, 52, 52, 52, 52,\n    52, 53, 53, 53, 53, 53, 54, 54,\n    54, 54, 54, 55, 55, 55, 55, 55,\n    56, 56, 56, 56, 56, 57, 57, 57,\n    57, 57, 57, 58, 58, 58, 58, 58,\n    59, 59, 59, 59, 59, 59, 60, 60,\n    60, 60, 60, 61, 61, 61, 61, 61,\n    61, 62, 62, 62, 62, 62, 62, 63,\n    63, 63, 63, 63, 63, 64, 64, 64\n  };\n\n\n  FT_LOCAL_DEF( AF_Angle )\n  af_angle_atan( FT_Fixed  dx,\n                 FT_Fixed  dy )\n  {\n    AF_Angle  angle;\n\n\n    /* check trivial cases */\n    if ( dy == 0 )\n    {\n      angle = 0;\n      if ( dx < 0 )\n        angle = AF_ANGLE_PI;\n      return angle;\n    }\n    else if ( dx == 0 )\n    {\n      angle = AF_ANGLE_PI2;\n      if ( dy < 0 )\n        angle = -AF_ANGLE_PI2;\n      return angle;\n    }\n\n    angle = 0;\n    if ( dx < 0 )\n    {\n      dx = -dx;\n      dy = -dy;\n      angle = AF_ANGLE_PI;\n    }\n\n    if ( dy < 0 )\n    {\n      FT_Pos  tmp;\n\n\n      tmp = dx;\n      dx  = -dy;\n      dy  = tmp;\n      angle -= AF_ANGLE_PI2;\n    }\n\n    if ( dx == 0 && dy == 0 )\n      return 0;\n\n    if ( dx == dy )\n      angle += AF_ANGLE_PI4;\n    else if ( dx > dy )\n      angle += af_arctan[FT_DivFix( dy, dx ) >> ( 16 - AF_ATAN_BITS )];\n    else\n      angle += AF_ANGLE_PI2 -\n               af_arctan[FT_DivFix( dx, dy ) >> ( 16 - AF_ATAN_BITS )];\n\n    if ( angle > AF_ANGLE_PI )\n      angle -= AF_ANGLE_2PI;\n\n    return angle;\n  }\n\n\n#endif /* 0 */\n\n\n  FT_LOCAL_DEF( void )\n  af_sort_pos( FT_UInt  count,\n               FT_Pos*  table )\n  {\n    FT_UInt  i, j;\n    FT_Pos   swap;\n\n\n    for ( i = 1; i < count; i++ )\n    {\n      for ( j = i; j > 0; j-- )\n      {\n        if ( table[j] >= table[j - 1] )\n          break;\n\n        swap         = table[j];\n        table[j]     = table[j - 1];\n        table[j - 1] = swap;\n      }\n    }\n  }\n\n\n  FT_LOCAL_DEF( void )\n  af_sort_and_quantize_widths( FT_UInt*  count,\n                               AF_Width  table,\n                               FT_Pos    threshold )\n  {\n    FT_UInt      i, j;\n    FT_UInt      cur_idx;\n    FT_Pos       cur_val;\n    FT_Pos       sum;\n    AF_WidthRec  swap;\n\n\n    if ( *count == 1 )\n      return;\n\n    /* sort */\n    for ( i = 1; i < *count; i++ )\n    {\n      for ( j = i; j > 0; j-- )\n      {\n        if ( table[j].org >= table[j - 1].org )\n          break;\n\n        swap         = table[j];\n        table[j]     = table[j - 1];\n        table[j - 1] = swap;\n      }\n    }\n\n    cur_idx = 0;\n    cur_val = table[cur_idx].org;\n\n    /* compute and use mean values for clusters not larger than  */\n    /* `threshold'; this is very primitive and might not yield   */\n    /* the best result, but normally, using reference character  */\n    /* `o', `*count' is 2, so the code below is fully sufficient */\n    for ( i = 1; i < *count; i++ )\n    {\n      if ( table[i].org - cur_val > threshold ||\n           i == *count - 1                    )\n      {\n        sum = 0;\n\n        /* fix loop for end of array */\n        if ( table[i].org - cur_val <= threshold &&\n             i == *count - 1                     )\n          i++;\n\n        for ( j = cur_idx; j < i; j++ )\n        {\n          sum         += table[j].org;\n          table[j].org = 0;\n        }\n        table[cur_idx].org = sum / j;\n\n        if ( i < *count - 1 )\n        {\n          cur_idx = i + 1;\n          cur_val = table[cur_idx].org;\n        }\n      }\n    }\n\n    cur_idx = 1;\n\n    /* compress array to remove zero values */\n    for ( i = 1; i < *count; i++ )\n    {\n      if ( table[i].org )\n        table[cur_idx++] = table[i];\n    }\n\n    *count = cur_idx;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afangles.h",
    "content": "/*\n *  afangles.h\n *\n *  This is a dummy file, used to please the build system.  It is never\n *  included by the auto-fitter sources.\n *\n */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afblue.c",
    "content": "/* This file has been generated by the Perl script `afblue.pl', */\n/* using data from file `afblue.dat'.                           */\n\n/***************************************************************************/\n/*                                                                         */\n/*  afblue.c                                                               */\n/*                                                                         */\n/*    Auto-fitter data for blue strings (body).                            */\n/*                                                                         */\n/*  Copyright 2013 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"aftypes.h\"\n\n\n  FT_LOCAL_ARRAY_DEF( char )\n  af_blue_strings[] =\n  {\n    /* */\n    '\\xD0', '\\x91', '\\xD0', '\\x92', '\\xD0', '\\x95', '\\xD0', '\\x9F', '\\xD0', '\\x97', '\\xD0', '\\x9E', '\\xD0', '\\xA1', '\\xD0', '\\xAD',  /* БВЕПЗОСЭ */\n    '\\0',\n    '\\xD0', '\\x91', '\\xD0', '\\x92', '\\xD0', '\\x95', '\\xD0', '\\xA8', '\\xD0', '\\x97', '\\xD0', '\\x9E', '\\xD0', '\\xA1', '\\xD0', '\\xAD',  /* БВЕШЗОСЭ */\n    '\\0',\n    '\\xD1', '\\x85', '\\xD0', '\\xBF', '\\xD0', '\\xBD', '\\xD1', '\\x88', '\\xD0', '\\xB5', '\\xD0', '\\xB7', '\\xD0', '\\xBE', '\\xD1', '\\x81',  /* хпншезос */\n    '\\0',\n    '\\xD1', '\\x80', '\\xD1', '\\x83', '\\xD1', '\\x84',  /* руф */\n    '\\0',\n    '\\xE0', '\\xA4', '\\x95', '\\xE0', '\\xA4', '\\xAE', '\\xE0', '\\xA4', '\\x85', '\\xE0', '\\xA4', '\\x86', '\\xE0', '\\xA4', '\\xA5', '\\xE0', '\\xA4', '\\xA7', '\\xE0', '\\xA4', '\\xAD', '\\xE0', '\\xA4', '\\xB6',  /* क म अ आ थ ध भ श */\n    '\\0',\n    '\\xE0', '\\xA4', '\\x88', '\\xE0', '\\xA4', '\\x90', '\\xE0', '\\xA4', '\\x93', '\\xE0', '\\xA4', '\\x94', '\\xE0', '\\xA4', '\\xBF', '\\xE0', '\\xA5', '\\x80', '\\xE0', '\\xA5', '\\x8B', '\\xE0', '\\xA5', '\\x8C',  /* ई ऐ ओ औ ि ी ो ौ */\n    '\\0',\n    '\\xE0', '\\xA4', '\\x95', '\\xE0', '\\xA4', '\\xAE', '\\xE0', '\\xA4', '\\x85', '\\xE0', '\\xA4', '\\x86', '\\xE0', '\\xA4', '\\xA5', '\\xE0', '\\xA4', '\\xA7', '\\xE0', '\\xA4', '\\xAD', '\\xE0', '\\xA4', '\\xB6',  /* क म अ आ थ ध भ श */\n    '\\0',\n    '\\xE0', '\\xA5', '\\x81', '\\xE0', '\\xA5', '\\x83',  /* ु ृ */\n    '\\0',\n    '\\xCE', '\\x93', '\\xCE', '\\x92', '\\xCE', '\\x95', '\\xCE', '\\x96', '\\xCE', '\\x98', '\\xCE', '\\x9F', '\\xCE', '\\xA9',  /* ΓΒΕΖΘΟΩ */\n    '\\0',\n    '\\xCE', '\\x92', '\\xCE', '\\x94', '\\xCE', '\\x96', '\\xCE', '\\x9E', '\\xCE', '\\x98', '\\xCE', '\\x9F',  /* ΒΔΖΞΘΟ */\n    '\\0',\n    '\\xCE', '\\xB2', '\\xCE', '\\xB8', '\\xCE', '\\xB4', '\\xCE', '\\xB6', '\\xCE', '\\xBB', '\\xCE', '\\xBE',  /* βθδζλξ */\n    '\\0',\n    '\\xCE', '\\xB1', '\\xCE', '\\xB5', '\\xCE', '\\xB9', '\\xCE', '\\xBF', '\\xCF', '\\x80', '\\xCF', '\\x83', '\\xCF', '\\x84', '\\xCF', '\\x89',  /* αειοπστω */\n    '\\0',\n    '\\xCE', '\\xB2', '\\xCE', '\\xB3', '\\xCE', '\\xB7', '\\xCE', '\\xBC', '\\xCF', '\\x81', '\\xCF', '\\x86', '\\xCF', '\\x87', '\\xCF', '\\x88',  /* βγημρφχψ */\n    '\\0',\n    '\\xD7', '\\x91', '\\xD7', '\\x93', '\\xD7', '\\x94', '\\xD7', '\\x97', '\\xD7', '\\x9A', '\\xD7', '\\x9B', '\\xD7', '\\x9D', '\\xD7', '\\xA1',  /* בדהחךכםס */\n    '\\0',\n    '\\xD7', '\\x91', '\\xD7', '\\x98', '\\xD7', '\\x9B', '\\xD7', '\\x9D', '\\xD7', '\\xA1', '\\xD7', '\\xA6',  /* בטכםסצ */\n    '\\0',\n    '\\xD7', '\\xA7', '\\xD7', '\\x9A', '\\xD7', '\\x9F', '\\xD7', '\\xA3', '\\xD7', '\\xA5',  /* קךןףץ */\n    '\\0',\n    'T', 'H', 'E', 'Z', 'O', 'C', 'Q', 'S',  /* THEZOCQS */\n    '\\0',\n    'H', 'E', 'Z', 'L', 'O', 'C', 'U', 'S',  /* HEZLOCUS */\n    '\\0',\n    'f', 'i', 'j', 'k', 'd', 'b', 'h',  /* fijkdbh */\n    '\\0',\n    'x', 'z', 'r', 'o', 'e', 's', 'c',  /* xzroesc */\n    '\\0',\n    'p', 'q', 'g', 'j', 'y',  /* pqgjy */\n    '\\0',\n    '\\xE0', '\\xB0', '\\x87', '\\xE0', '\\xB0', '\\x8C', '\\xE0', '\\xB0', '\\x99', '\\xE0', '\\xB0', '\\x9E', '\\xE0', '\\xB0', '\\xA3', '\\xE0', '\\xB0', '\\xB1', '\\xE0', '\\xB1', '\\xAF',  /* ఇ ఌ ఙ ఞ ణ ఱ ౯ */\n    '\\0',\n    '\\xE0', '\\xB0', '\\x85', '\\xE0', '\\xB0', '\\x95', '\\xE0', '\\xB0', '\\x9A', '\\xE0', '\\xB0', '\\xB0', '\\xE0', '\\xB0', '\\xBD', '\\xE0', '\\xB1', '\\xA8', '\\xE0', '\\xB1', '\\xAC',  /* అ క చ ర ఽ ౨ ౬ */\n#ifdef AF_CONFIG_OPTION_CJK\n    '\\0',\n    '\\xE4', '\\xBB', '\\x96', '\\xE4', '\\xBB', '\\xAC', '\\xE4', '\\xBD', '\\xA0', '\\xE4', '\\xBE', '\\x86', '\\xE5', '\\x80', '\\x91', '\\xE5', '\\x88', '\\xB0', '\\xE5', '\\x92', '\\x8C', '\\xE5', '\\x9C', '\\xB0',  /* 他们你來們到和地 */\n    '\\xE5', '\\xAF', '\\xB9', '\\xE5', '\\xB0', '\\x8D', '\\xE5', '\\xB0', '\\xB1', '\\xE5', '\\xB8', '\\xAD', '\\xE6', '\\x88', '\\x91', '\\xE6', '\\x97', '\\xB6', '\\xE6', '\\x99', '\\x82', '\\xE6', '\\x9C', '\\x83',  /* 对對就席我时時會 */\n    '\\xE6', '\\x9D', '\\xA5', '\\xE7', '\\x82', '\\xBA', '\\xE8', '\\x83', '\\xBD', '\\xE8', '\\x88', '\\xB0', '\\xE8', '\\xAA', '\\xAA', '\\xE8', '\\xAF', '\\xB4', '\\xE8', '\\xBF', '\\x99', '\\xE9', '\\x80', '\\x99',  /* 来為能舰說说这這 */\n    '\\xE9', '\\xBD', '\\x8A', '|',  /* 齊 | */\n    '\\xE5', '\\x86', '\\x9B', '\\xE5', '\\x90', '\\x8C', '\\xE5', '\\xB7', '\\xB2', '\\xE6', '\\x84', '\\xBF', '\\xE6', '\\x97', '\\xA2', '\\xE6', '\\x98', '\\x9F', '\\xE6', '\\x98', '\\xAF', '\\xE6', '\\x99', '\\xAF',  /* 军同已愿既星是景 */\n    '\\xE6', '\\xB0', '\\x91', '\\xE7', '\\x85', '\\xA7', '\\xE7', '\\x8E', '\\xB0', '\\xE7', '\\x8F', '\\xBE', '\\xE7', '\\x90', '\\x86', '\\xE7', '\\x94', '\\xA8', '\\xE7', '\\xBD', '\\xAE', '\\xE8', '\\xA6', '\\x81',  /* 民照现現理用置要 */\n    '\\xE8', '\\xBB', '\\x8D', '\\xE9', '\\x82', '\\xA3', '\\xE9', '\\x85', '\\x8D', '\\xE9', '\\x87', '\\x8C', '\\xE9', '\\x96', '\\x8B', '\\xE9', '\\x9B', '\\xB7', '\\xE9', '\\x9C', '\\xB2', '\\xE9', '\\x9D', '\\xA2',  /* 軍那配里開雷露面 */\n    '\\xE9', '\\xA1', '\\xBE',  /* 顾 */\n    '\\0',\n    '\\xE4', '\\xB8', '\\xAA', '\\xE4', '\\xB8', '\\xBA', '\\xE4', '\\xBA', '\\xBA', '\\xE4', '\\xBB', '\\x96', '\\xE4', '\\xBB', '\\xA5', '\\xE4', '\\xBB', '\\xAC', '\\xE4', '\\xBD', '\\xA0', '\\xE4', '\\xBE', '\\x86',  /* 个为人他以们你來 */\n    '\\xE5', '\\x80', '\\x8B', '\\xE5', '\\x80', '\\x91', '\\xE5', '\\x88', '\\xB0', '\\xE5', '\\x92', '\\x8C', '\\xE5', '\\xA4', '\\xA7', '\\xE5', '\\xAF', '\\xB9', '\\xE5', '\\xB0', '\\x8D', '\\xE5', '\\xB0', '\\xB1',  /* 個們到和大对對就 */\n    '\\xE6', '\\x88', '\\x91', '\\xE6', '\\x97', '\\xB6', '\\xE6', '\\x99', '\\x82', '\\xE6', '\\x9C', '\\x89', '\\xE6', '\\x9D', '\\xA5', '\\xE7', '\\x82', '\\xBA', '\\xE8', '\\xA6', '\\x81', '\\xE8', '\\xAA', '\\xAA',  /* 我时時有来為要說 */\n    '\\xE8', '\\xAF', '\\xB4', '|',  /* 说 | */\n    '\\xE4', '\\xB8', '\\xBB', '\\xE4', '\\xBA', '\\x9B', '\\xE5', '\\x9B', '\\xA0', '\\xE5', '\\xAE', '\\x83', '\\xE6', '\\x83', '\\xB3', '\\xE6', '\\x84', '\\x8F', '\\xE7', '\\x90', '\\x86', '\\xE7', '\\x94', '\\x9F',  /* 主些因它想意理生 */\n    '\\xE7', '\\x95', '\\xB6', '\\xE7', '\\x9C', '\\x8B', '\\xE7', '\\x9D', '\\x80', '\\xE7', '\\xBD', '\\xAE', '\\xE8', '\\x80', '\\x85', '\\xE8', '\\x87', '\\xAA', '\\xE8', '\\x91', '\\x97', '\\xE8', '\\xA3', '\\xA1',  /* 當看着置者自著裡 */\n    '\\xE8', '\\xBF', '\\x87', '\\xE8', '\\xBF', '\\x98', '\\xE8', '\\xBF', '\\x9B', '\\xE9', '\\x80', '\\xB2', '\\xE9', '\\x81', '\\x8E', '\\xE9', '\\x81', '\\x93', '\\xE9', '\\x82', '\\x84', '\\xE9', '\\x87', '\\x8C',  /* 过还进進過道還里 */\n    '\\xE9', '\\x9D', '\\xA2',  /* 面 */\n#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT\n    '\\0',\n    '\\xE4', '\\xBA', '\\x9B', '\\xE4', '\\xBB', '\\xAC', '\\xE4', '\\xBD', '\\xA0', '\\xE4', '\\xBE', '\\x86', '\\xE5', '\\x80', '\\x91', '\\xE5', '\\x88', '\\xB0', '\\xE5', '\\x92', '\\x8C', '\\xE5', '\\x9C', '\\xB0',  /* 些们你來們到和地 */\n    '\\xE5', '\\xA5', '\\xB9', '\\xE5', '\\xB0', '\\x86', '\\xE5', '\\xB0', '\\x87', '\\xE5', '\\xB0', '\\xB1', '\\xE5', '\\xB9', '\\xB4', '\\xE5', '\\xBE', '\\x97', '\\xE6', '\\x83', '\\x85', '\\xE6', '\\x9C', '\\x80',  /* 她将將就年得情最 */\n    '\\xE6', '\\xA0', '\\xB7', '\\xE6', '\\xA8', '\\xA3', '\\xE7', '\\x90', '\\x86', '\\xE8', '\\x83', '\\xBD', '\\xE8', '\\xAA', '\\xAA', '\\xE8', '\\xAF', '\\xB4', '\\xE8', '\\xBF', '\\x99', '\\xE9', '\\x80', '\\x99',  /* 样樣理能說说这這 */\n    '\\xE9', '\\x80', '\\x9A', '|',  /* 通 | */\n    '\\xE5', '\\x8D', '\\xB3', '\\xE5', '\\x90', '\\x97', '\\xE5', '\\x90', '\\xA7', '\\xE5', '\\x90', '\\xAC', '\\xE5', '\\x91', '\\xA2', '\\xE5', '\\x93', '\\x81', '\\xE5', '\\x93', '\\x8D', '\\xE5', '\\x97', '\\x8E',  /* 即吗吧听呢品响嗎 */\n    '\\xE5', '\\xB8', '\\x88', '\\xE5', '\\xB8', '\\xAB', '\\xE6', '\\x94', '\\xB6', '\\xE6', '\\x96', '\\xAD', '\\xE6', '\\x96', '\\xB7', '\\xE6', '\\x98', '\\x8E', '\\xE7', '\\x9C', '\\xBC', '\\xE9', '\\x96', '\\x93',  /* 师師收断斷明眼間 */\n    '\\xE9', '\\x97', '\\xB4', '\\xE9', '\\x99', '\\x85', '\\xE9', '\\x99', '\\x88', '\\xE9', '\\x99', '\\x90', '\\xE9', '\\x99', '\\xA4', '\\xE9', '\\x99', '\\xB3', '\\xE9', '\\x9A', '\\x8F', '\\xE9', '\\x9A', '\\x9B',  /* 间际陈限除陳随際 */\n    '\\xE9', '\\x9A', '\\xA8',  /* 隨 */\n    '\\0',\n    '\\xE4', '\\xBA', '\\x8B', '\\xE5', '\\x89', '\\x8D', '\\xE5', '\\xAD', '\\xB8', '\\xE5', '\\xB0', '\\x86', '\\xE5', '\\xB0', '\\x87', '\\xE6', '\\x83', '\\x85', '\\xE6', '\\x83', '\\xB3', '\\xE6', '\\x88', '\\x96',  /* 事前學将將情想或 */\n    '\\xE6', '\\x94', '\\xBF', '\\xE6', '\\x96', '\\xAF', '\\xE6', '\\x96', '\\xB0', '\\xE6', '\\xA0', '\\xB7', '\\xE6', '\\xA8', '\\xA3', '\\xE6', '\\xB0', '\\x91', '\\xE6', '\\xB2', '\\x92', '\\xE6', '\\xB2', '\\xA1',  /* 政斯新样樣民沒没 */\n    '\\xE7', '\\x84', '\\xB6', '\\xE7', '\\x89', '\\xB9', '\\xE7', '\\x8E', '\\xB0', '\\xE7', '\\x8F', '\\xBE', '\\xE7', '\\x90', '\\x83', '\\xE7', '\\xAC', '\\xAC', '\\xE7', '\\xB6', '\\x93', '\\xE8', '\\xB0', '\\x81',  /* 然特现現球第經谁 */\n    '\\xE8', '\\xB5', '\\xB7', '|',  /* 起 | */\n    '\\xE4', '\\xBE', '\\x8B', '\\xE5', '\\x88', '\\xA5', '\\xE5', '\\x88', '\\xAB', '\\xE5', '\\x88', '\\xB6', '\\xE5', '\\x8A', '\\xA8', '\\xE5', '\\x8B', '\\x95', '\\xE5', '\\x90', '\\x97', '\\xE5', '\\x97', '\\x8E',  /* 例別别制动動吗嗎 */\n    '\\xE5', '\\xA2', '\\x9E', '\\xE6', '\\x8C', '\\x87', '\\xE6', '\\x98', '\\x8E', '\\xE6', '\\x9C', '\\x9D', '\\xE6', '\\x9C', '\\x9F', '\\xE6', '\\x9E', '\\x84', '\\xE7', '\\x89', '\\xA9', '\\xE7', '\\xA1', '\\xAE',  /* 增指明朝期构物确 */\n    '\\xE7', '\\xA7', '\\x8D', '\\xE8', '\\xAA', '\\xBF', '\\xE8', '\\xB0', '\\x83', '\\xE8', '\\xB2', '\\xBB', '\\xE8', '\\xB4', '\\xB9', '\\xE9', '\\x82', '\\xA3', '\\xE9', '\\x83', '\\xBD', '\\xE9', '\\x96', '\\x93',  /* 种調调費费那都間 */\n    '\\xE9', '\\x97', '\\xB4',  /* 间 */\n#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */\n#endif /* AF_CONFIG_OPTION_CJK                */\n    '\\0',\n\n  };\n\n\n  /* stringsets are specific to styles */\n  FT_LOCAL_ARRAY_DEF( AF_Blue_StringRec )\n  af_blue_stringsets[] =\n  {\n    /* */\n    { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP,     AF_BLUE_PROPERTY_LATIN_TOP        },\n    { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM,  0                                 },\n    { AF_BLUE_STRING_CYRILLIC_SMALL,           AF_BLUE_PROPERTY_LATIN_TOP      |\n                                               AF_BLUE_PROPERTY_LATIN_X_HEIGHT   },\n    { AF_BLUE_STRING_CYRILLIC_SMALL,           0                                 },\n    { AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER, 0                                 },\n    { AF_BLUE_STRING_MAX,                      0                                 },\n    { AF_BLUE_STRING_DEVANAGARI_TOP,    AF_BLUE_PROPERTY_LATIN_TOP        },\n    { AF_BLUE_STRING_DEVANAGARI_HEAD,   AF_BLUE_PROPERTY_LATIN_TOP        },\n    { AF_BLUE_STRING_DEVANAGARI_BASE,   AF_BLUE_PROPERTY_LATIN_TOP      |\n                                        AF_BLUE_PROPERTY_LATIN_NEUTRAL  |\n                                        AF_BLUE_PROPERTY_LATIN_X_HEIGHT   },\n    { AF_BLUE_STRING_DEVANAGARI_BASE,   0                                 },\n    { AF_BLUE_STRING_DEVANAGARI_BOTTOM, 0                                 },\n    { AF_BLUE_STRING_MAX,               0                                 },\n    { AF_BLUE_STRING_GREEK_CAPITAL_TOP,     AF_BLUE_PROPERTY_LATIN_TOP        },\n    { AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM,  0                                 },\n    { AF_BLUE_STRING_GREEK_SMALL_BETA_TOP,  AF_BLUE_PROPERTY_LATIN_TOP        },\n    { AF_BLUE_STRING_GREEK_SMALL,           AF_BLUE_PROPERTY_LATIN_TOP      |\n                                            AF_BLUE_PROPERTY_LATIN_X_HEIGHT   },\n    { AF_BLUE_STRING_GREEK_SMALL,           0                                 },\n    { AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0                                 },\n    { AF_BLUE_STRING_MAX,                   0                                 },\n    { AF_BLUE_STRING_HEBREW_TOP,       AF_BLUE_PROPERTY_LATIN_TOP  |\n                                       AF_BLUE_PROPERTY_LATIN_LONG   },\n    { AF_BLUE_STRING_HEBREW_BOTTOM,    0                             },\n    { AF_BLUE_STRING_HEBREW_DESCENDER, 0                             },\n    { AF_BLUE_STRING_MAX,              0                             },\n    { AF_BLUE_STRING_LATIN_CAPITAL_TOP,     AF_BLUE_PROPERTY_LATIN_TOP        },\n    { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM,  0                                 },\n    { AF_BLUE_STRING_LATIN_SMALL_F_TOP,     AF_BLUE_PROPERTY_LATIN_TOP        },\n    { AF_BLUE_STRING_LATIN_SMALL,           AF_BLUE_PROPERTY_LATIN_TOP      |\n                                            AF_BLUE_PROPERTY_LATIN_X_HEIGHT   },\n    { AF_BLUE_STRING_LATIN_SMALL,           0                                 },\n    { AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0                                 },\n    { AF_BLUE_STRING_MAX,                   0                                 },\n    { AF_BLUE_STRING_TELUGU_TOP,    AF_BLUE_PROPERTY_LATIN_TOP },\n    { AF_BLUE_STRING_TELUGU_BOTTOM, 0                          },\n    { AF_BLUE_STRING_MAX,           0                          },\n#ifdef AF_CONFIG_OPTION_CJK\n    { AF_BLUE_STRING_CJK_TOP,    AF_BLUE_PROPERTY_CJK_TOP     },\n    { AF_BLUE_STRING_CJK_BOTTOM, 0                            },\n#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT\n    { AF_BLUE_STRING_CJK_LEFT,   AF_BLUE_PROPERTY_CJK_HORIZ   },\n    { AF_BLUE_STRING_CJK_RIGHT,  AF_BLUE_PROPERTY_CJK_HORIZ |\n                                 AF_BLUE_PROPERTY_CJK_RIGHT   },\n#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */\n    { AF_BLUE_STRING_MAX,        0                            },\n#endif /* AF_CONFIG_OPTION_CJK                */\n\n  };\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afblue.cin",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afblue.c                                                               */\n/*                                                                         */\n/*    Auto-fitter data for blue strings (body).                            */\n/*                                                                         */\n/*  Copyright 2013 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"aftypes.h\"\n\n\n  FT_LOCAL_ARRAY_DEF( char )\n  af_blue_strings[] =\n  {\n    /* */\n@AF_BLUE_STRINGS_ARRAY@\n  };\n\n\n  /* stringsets are specific to styles */\n  FT_LOCAL_ARRAY_DEF( AF_Blue_StringRec )\n  af_blue_stringsets[] =\n  {\n    /* */\n@AF_BLUE_STRINGSETS_ARRAY@\n  };\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afblue.h",
    "content": "/* This file has been generated by the Perl script `afblue.pl', */\n/* using data from file `afblue.dat'.                           */\n\n/***************************************************************************/\n/*                                                                         */\n/*  afblue.h                                                               */\n/*                                                                         */\n/*    Auto-fitter data for blue strings (specification).                   */\n/*                                                                         */\n/*  Copyright 2013, 2014 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __AFBLUE_H__\n#define __AFBLUE_H__\n\n\nFT_BEGIN_HEADER\n\n\n  /* an auxiliary macro to decode a UTF-8 character -- since we only use */\n  /* hard-coded, self-converted data, no error checking is performed     */\n#define GET_UTF8_CHAR( ch, p )                    \\\n          ch = (unsigned char)*p++;               \\\n          if ( ch >= 0x80 )                       \\\n          {                                       \\\n            FT_UInt  len;                         \\\n                                                  \\\n                                                  \\\n            if ( ch < 0xE0 )                      \\\n            {                                     \\\n              len = 1;                            \\\n              ch &= 0x1F;                         \\\n            }                                     \\\n            else if ( ch < 0xF0 )                 \\\n            {                                     \\\n              len = 2;                            \\\n              ch &= 0x0F;                         \\\n            }                                     \\\n            else                                  \\\n            {                                     \\\n              len = 3;                            \\\n              ch &= 0x07;                         \\\n            }                                     \\\n                                                  \\\n            for ( ; len > 0; len-- )              \\\n              ch = ( ch << 6 ) | ( *p++ & 0x3F ); \\\n          }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    B L U E   S T R I N G S                    *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* At the bottommost level, we define strings for finding blue zones. */\n\n\n#define AF_BLUE_STRING_MAX_LEN  51\n\n  /* The AF_Blue_String enumeration values are offsets into the */\n  /* `af_blue_strings' array.                                   */\n\n  typedef enum  AF_Blue_String_\n  {\n    AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 0,\n    AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 17,\n    AF_BLUE_STRING_CYRILLIC_SMALL = 34,\n    AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 51,\n    AF_BLUE_STRING_DEVANAGARI_BASE = 58,\n    AF_BLUE_STRING_DEVANAGARI_TOP = 83,\n    AF_BLUE_STRING_DEVANAGARI_HEAD = 108,\n    AF_BLUE_STRING_DEVANAGARI_BOTTOM = 133,\n    AF_BLUE_STRING_GREEK_CAPITAL_TOP = 140,\n    AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 155,\n    AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 168,\n    AF_BLUE_STRING_GREEK_SMALL = 181,\n    AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 198,\n    AF_BLUE_STRING_HEBREW_TOP = 215,\n    AF_BLUE_STRING_HEBREW_BOTTOM = 232,\n    AF_BLUE_STRING_HEBREW_DESCENDER = 245,\n    AF_BLUE_STRING_LATIN_CAPITAL_TOP = 256,\n    AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 265,\n    AF_BLUE_STRING_LATIN_SMALL_F_TOP = 274,\n    AF_BLUE_STRING_LATIN_SMALL = 282,\n    AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 290,\n    AF_BLUE_STRING_TELUGU_TOP = 296,\n    AF_BLUE_STRING_TELUGU_BOTTOM = 318,\n    af_blue_1_1 = 339,\n#ifdef AF_CONFIG_OPTION_CJK\n    AF_BLUE_STRING_CJK_TOP = af_blue_1_1 + 1,\n    AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 153,\n    af_blue_1_1_1 = af_blue_1_1 + 304,\n#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT\n    AF_BLUE_STRING_CJK_LEFT = af_blue_1_1_1 + 1,\n    AF_BLUE_STRING_CJK_RIGHT = af_blue_1_1_1 + 153,\n    af_blue_1_1_2 = af_blue_1_1_1 + 304,\n#else\n    af_blue_1_1_2 = af_blue_1_1_1 + 0,\n#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */\n    af_blue_1_2 = af_blue_1_1_2 + 0,\n#else\n    af_blue_1_2 = af_blue_1_1 + 0,\n#endif /* AF_CONFIG_OPTION_CJK                */\n\n\n    AF_BLUE_STRING_MAX   /* do not remove */\n\n  } AF_Blue_String;\n\n\n  FT_LOCAL_ARRAY( char )\n  af_blue_strings[];\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                 B L U E   S T R I N G S E T S                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* The next level is to group blue strings into style-specific sets. */\n\n\n  /* Properties are specific to a writing system.  We assume that a given  */\n  /* blue string can't be used in more than a single writing system, which */\n  /* is a safe bet.                                                        */\n#define AF_BLUE_PROPERTY_LATIN_TOP       ( 1 << 0 )   /* must have value 1 */\n#define AF_BLUE_PROPERTY_LATIN_NEUTRAL   ( 1 << 1 )\n#define AF_BLUE_PROPERTY_LATIN_X_HEIGHT  ( 1 << 2 )\n#define AF_BLUE_PROPERTY_LATIN_LONG      ( 1 << 3 )\n\n#define AF_BLUE_PROPERTY_CJK_TOP    ( 1 << 0 )        /* must have value 1 */\n#define AF_BLUE_PROPERTY_CJK_HORIZ  ( 1 << 1 )        /* must have value 2 */\n#define AF_BLUE_PROPERTY_CJK_RIGHT  AF_BLUE_PROPERTY_CJK_TOP\n\n\n#define AF_BLUE_STRINGSET_MAX_LEN  7\n\n  /* The AF_Blue_Stringset enumeration values are offsets into the */\n  /* `af_blue_stringsets' array.                                   */\n\n  typedef enum  AF_Blue_Stringset_\n  {\n    AF_BLUE_STRINGSET_CYRL = 0,\n    AF_BLUE_STRINGSET_DEVA = 6,\n    AF_BLUE_STRINGSET_GREK = 12,\n    AF_BLUE_STRINGSET_HEBR = 19,\n    AF_BLUE_STRINGSET_LATN = 23,\n    AF_BLUE_STRINGSET_TELU = 30,\n    af_blue_2_1 = 33,\n#ifdef AF_CONFIG_OPTION_CJK\n    AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0,\n    af_blue_2_1_1 = af_blue_2_1 + 2,\n#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT\n    af_blue_2_1_2 = af_blue_2_1_1 + 2,\n#else\n    af_blue_2_1_2 = af_blue_2_1_1 + 0,\n#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */\n    af_blue_2_2 = af_blue_2_1_2 + 1,\n#else\n    af_blue_2_2 = af_blue_2_1 + 0,\n#endif /* AF_CONFIG_OPTION_CJK                */\n\n\n    AF_BLUE_STRINGSET_MAX   /* do not remove */\n\n  } AF_Blue_Stringset;\n\n\n  typedef struct  AF_Blue_StringRec_\n  {\n    AF_Blue_String  string;\n    FT_UShort       properties;\n\n  } AF_Blue_StringRec;\n\n\n  FT_LOCAL_ARRAY( AF_Blue_StringRec )\n  af_blue_stringsets[];\n\n/* */\n\nFT_END_HEADER\n\n\n#endif /* __AFBLUE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afblue.hin",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afblue.h                                                               */\n/*                                                                         */\n/*    Auto-fitter data for blue strings (specification).                   */\n/*                                                                         */\n/*  Copyright 2013, 2014 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __AFBLUE_H__\n#define __AFBLUE_H__\n\n\nFT_BEGIN_HEADER\n\n\n  /* an auxiliary macro to decode a UTF-8 character -- since we only use */\n  /* hard-coded, self-converted data, no error checking is performed     */\n#define GET_UTF8_CHAR( ch, p )                    \\\n          ch = (unsigned char)*p++;               \\\n          if ( ch >= 0x80 )                       \\\n          {                                       \\\n            FT_UInt  len;                         \\\n                                                  \\\n                                                  \\\n            if ( ch < 0xE0 )                      \\\n            {                                     \\\n              len = 1;                            \\\n              ch &= 0x1F;                         \\\n            }                                     \\\n            else if ( ch < 0xF0 )                 \\\n            {                                     \\\n              len = 2;                            \\\n              ch &= 0x0F;                         \\\n            }                                     \\\n            else                                  \\\n            {                                     \\\n              len = 3;                            \\\n              ch &= 0x07;                         \\\n            }                                     \\\n                                                  \\\n            for ( ; len > 0; len-- )              \\\n              ch = ( ch << 6 ) | ( *p++ & 0x3F ); \\\n          }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    B L U E   S T R I N G S                    *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* At the bottommost level, we define strings for finding blue zones. */\n\n\n#define AF_BLUE_STRING_MAX_LEN  @AF_BLUE_STRING_MAX_LEN@\n\n  /* The AF_Blue_String enumeration values are offsets into the */\n  /* `af_blue_strings' array.                                   */\n\n  typedef enum  AF_Blue_String_\n  {\n@AF_BLUE_STRING_ENUM@\n\n    AF_BLUE_STRING_MAX   /* do not remove */\n\n  } AF_Blue_String;\n\n\n  FT_LOCAL_ARRAY( char )\n  af_blue_strings[];\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                 B L U E   S T R I N G S E T S                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* The next level is to group blue strings into style-specific sets. */\n\n\n  /* Properties are specific to a writing system.  We assume that a given  */\n  /* blue string can't be used in more than a single writing system, which */\n  /* is a safe bet.                                                        */\n#define AF_BLUE_PROPERTY_LATIN_TOP       ( 1 << 0 )   /* must have value 1 */\n#define AF_BLUE_PROPERTY_LATIN_NEUTRAL   ( 1 << 1 )\n#define AF_BLUE_PROPERTY_LATIN_X_HEIGHT  ( 1 << 2 )\n#define AF_BLUE_PROPERTY_LATIN_LONG      ( 1 << 3 )\n\n#define AF_BLUE_PROPERTY_CJK_TOP    ( 1 << 0 )        /* must have value 1 */\n#define AF_BLUE_PROPERTY_CJK_HORIZ  ( 1 << 1 )        /* must have value 2 */\n#define AF_BLUE_PROPERTY_CJK_RIGHT  AF_BLUE_PROPERTY_CJK_TOP\n\n\n#define AF_BLUE_STRINGSET_MAX_LEN  @AF_BLUE_STRINGSET_MAX_LEN@\n\n  /* The AF_Blue_Stringset enumeration values are offsets into the */\n  /* `af_blue_stringsets' array.                                   */\n\n  typedef enum  AF_Blue_Stringset_\n  {\n@AF_BLUE_STRINGSET_ENUM@\n\n    AF_BLUE_STRINGSET_MAX   /* do not remove */\n\n  } AF_Blue_Stringset;\n\n\n  typedef struct  AF_Blue_StringRec_\n  {\n    AF_Blue_String  string;\n    FT_UShort       properties;\n\n  } AF_Blue_StringRec;\n\n\n  FT_LOCAL_ARRAY( AF_Blue_StringRec )\n  af_blue_stringsets[];\n\n/* */\n\nFT_END_HEADER\n\n\n#endif /* __AFBLUE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afcjk.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afcjk.c                                                                */\n/*                                                                         */\n/*    Auto-fitter hinting routines for CJK writing system (body).          */\n/*                                                                         */\n/*  Copyright 2006-2014 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*\n   *  The algorithm is based on akito's autohint patch, available here:\n   *\n   *  http://www.kde.gr.jp/~akito/patch/freetype2/\n   *\n   */\n\n#include <ft2build.h>\n#include FT_ADVANCES_H\n#include FT_INTERNAL_DEBUG_H\n\n#include \"afglobal.h\"\n#include \"afpic.h\"\n#include \"aflatin.h\"\n\n\n#ifdef AF_CONFIG_OPTION_CJK\n\n#undef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT\n\n#include \"afcjk.h\"\n#include \"aferrors.h\"\n\n\n#ifdef AF_CONFIG_OPTION_USE_WARPER\n#include \"afwarp.h\"\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_afcjk\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****              C J K   G L O B A L   M E T R I C S              *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* Basically the Latin version with AF_CJKMetrics */\n  /* to replace AF_LatinMetrics.                    */\n\n  FT_LOCAL_DEF( void )\n  af_cjk_metrics_init_widths( AF_CJKMetrics  metrics,\n                              FT_Face        face )\n  {\n    /* scan the array of segments in each direction */\n    AF_GlyphHintsRec  hints[1];\n\n\n    FT_TRACE5(( \"\\n\"\n                \"cjk standard widths computation (style `%s')\\n\"\n                \"===================================================\\n\"\n                \"\\n\",\n                af_style_names[metrics->root.style_class->style] ));\n\n    af_glyph_hints_init( hints, face->memory );\n\n    metrics->axis[AF_DIMENSION_HORZ].width_count = 0;\n    metrics->axis[AF_DIMENSION_VERT].width_count = 0;\n\n    {\n      FT_Error          error;\n      FT_ULong          glyph_index;\n      FT_Long           y_offset;\n      int               dim;\n      AF_CJKMetricsRec  dummy[1];\n      AF_Scaler         scaler = &dummy->root.scaler;\n\n#ifdef FT_CONFIG_OPTION_PIC\n      AF_FaceGlobals  globals = metrics->root.globals;\n#endif\n\n      AF_StyleClass   style_class  = metrics->root.style_class;\n      AF_ScriptClass  script_class = AF_SCRIPT_CLASSES_GET\n                                       [style_class->script];\n\n      FT_UInt32  standard_char;\n\n\n      standard_char = script_class->standard_char1;\n      af_get_char_index( &metrics->root,\n                         standard_char,\n                         &glyph_index,\n                         &y_offset );\n      if ( !glyph_index )\n      {\n        if ( script_class->standard_char2 )\n        {\n          standard_char = script_class->standard_char2;\n          af_get_char_index( &metrics->root,\n                             standard_char,\n                             &glyph_index,\n                             &y_offset );\n          if ( !glyph_index )\n          {\n            if ( script_class->standard_char3 )\n            {\n              standard_char = script_class->standard_char3;\n              af_get_char_index( &metrics->root,\n                                 standard_char,\n                                 &glyph_index,\n                                 &y_offset );\n              if ( !glyph_index )\n                goto Exit;\n            }\n            else\n              goto Exit;\n          }\n        }\n        else\n          goto Exit;\n      }\n\n      FT_TRACE5(( \"standard character: U+%04lX (glyph index %d)\\n\",\n                  standard_char, glyph_index ));\n\n      error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );\n      if ( error || face->glyph->outline.n_points <= 0 )\n        goto Exit;\n\n      FT_ZERO( dummy );\n\n      dummy->units_per_em = metrics->units_per_em;\n\n      scaler->x_scale = 0x10000L;\n      scaler->y_scale = 0x10000L;\n      scaler->x_delta = 0;\n      scaler->y_delta = 0;\n\n      scaler->face        = face;\n      scaler->render_mode = FT_RENDER_MODE_NORMAL;\n      scaler->flags       = 0;\n\n      af_glyph_hints_rescale( hints, (AF_StyleMetrics)dummy );\n\n      error = af_glyph_hints_reload( hints, &face->glyph->outline );\n      if ( error )\n        goto Exit;\n\n      for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )\n      {\n        AF_CJKAxis    axis    = &metrics->axis[dim];\n        AF_AxisHints  axhints = &hints->axis[dim];\n        AF_Segment    seg, limit, link;\n        FT_UInt       num_widths = 0;\n\n\n        error = af_latin_hints_compute_segments( hints,\n                                                 (AF_Dimension)dim );\n        if ( error )\n          goto Exit;\n\n        af_latin_hints_link_segments( hints,\n                                      0,\n                                      NULL,\n                                      (AF_Dimension)dim );\n\n        seg   = axhints->segments;\n        limit = seg + axhints->num_segments;\n\n        for ( ; seg < limit; seg++ )\n        {\n          link = seg->link;\n\n          /* we only consider stem segments there! */\n          if ( link && link->link == seg && link > seg )\n          {\n            FT_Pos  dist;\n\n\n            dist = seg->pos - link->pos;\n            if ( dist < 0 )\n              dist = -dist;\n\n            if ( num_widths < AF_CJK_MAX_WIDTHS )\n              axis->widths[num_widths++].org = dist;\n          }\n        }\n\n        /* this also replaces multiple almost identical stem widths */\n        /* with a single one (the value 100 is heuristic)           */\n        af_sort_and_quantize_widths( &num_widths, axis->widths,\n                                     dummy->units_per_em / 100 );\n        axis->width_count = num_widths;\n      }\n\n    Exit:\n      for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )\n      {\n        AF_CJKAxis  axis = &metrics->axis[dim];\n        FT_Pos      stdw;\n\n\n        stdw = ( axis->width_count > 0 ) ? axis->widths[0].org\n                                         : AF_LATIN_CONSTANT( metrics, 50 );\n\n        /* let's try 20% of the smallest width */\n        axis->edge_distance_threshold = stdw / 5;\n        axis->standard_width          = stdw;\n        axis->extra_light             = 0;\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n        {\n          FT_UInt  i;\n\n\n          FT_TRACE5(( \"%s widths:\\n\",\n                      dim == AF_DIMENSION_VERT ? \"horizontal\"\n                                               : \"vertical\" ));\n\n          FT_TRACE5(( \"  %d (standard)\", axis->standard_width ));\n          for ( i = 1; i < axis->width_count; i++ )\n            FT_TRACE5(( \" %d\", axis->widths[i].org ));\n\n          FT_TRACE5(( \"\\n\" ));\n        }\n#endif\n      }\n    }\n\n    FT_TRACE5(( \"\\n\" ));\n\n    af_glyph_hints_done( hints );\n  }\n\n\n  /* Find all blue zones. */\n\n  static void\n  af_cjk_metrics_init_blues( AF_CJKMetrics  metrics,\n                             FT_Face        face )\n  {\n    FT_Pos      fills[AF_BLUE_STRING_MAX_LEN];\n    FT_Pos      flats[AF_BLUE_STRING_MAX_LEN];\n\n    FT_Int      num_fills;\n    FT_Int      num_flats;\n\n    FT_Bool     fill;\n\n    AF_CJKBlue  blue;\n    FT_Error    error;\n    AF_CJKAxis  axis;\n    FT_Outline  outline;\n\n    AF_StyleClass  sc = metrics->root.style_class;\n\n    AF_Blue_Stringset         bss = sc->blue_stringset;\n    const AF_Blue_StringRec*  bs  = &af_blue_stringsets[bss];\n\n\n    /* we walk over the blue character strings as specified in the   */\n    /* style's entry in the `af_blue_stringset' array, computing its */\n    /* extremum points (depending on the string properties)          */\n\n    FT_TRACE5(( \"cjk blue zones computation\\n\"\n                \"==========================\\n\"\n                \"\\n\" ));\n\n    for ( ; bs->string != AF_BLUE_STRING_MAX; bs++ )\n    {\n      const char*  p = &af_blue_strings[bs->string];\n      FT_Pos*      blue_ref;\n      FT_Pos*      blue_shoot;\n\n\n      if ( AF_CJK_IS_HORIZ_BLUE( bs ) )\n        axis = &metrics->axis[AF_DIMENSION_HORZ];\n      else\n        axis = &metrics->axis[AF_DIMENSION_VERT];\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n      {\n        FT_String*  cjk_blue_name[4] =\n        {\n          (FT_String*)\"bottom\",    /* --   , --  */\n          (FT_String*)\"top\",       /* --   , TOP */\n          (FT_String*)\"left\",      /* HORIZ, --  */\n          (FT_String*)\"right\"      /* HORIZ, TOP */\n        };\n\n\n        FT_TRACE5(( \"blue zone %d (%s):\\n\",\n                    axis->blue_count,\n                    cjk_blue_name[AF_CJK_IS_HORIZ_BLUE( bs ) |\n                                  AF_CJK_IS_TOP_BLUE( bs )   ] ));\n      }\n#endif /* FT_DEBUG_LEVEL_TRACE */\n\n      num_fills = 0;\n      num_flats = 0;\n\n      fill = 1;  /* start with characters that define fill values */\n      FT_TRACE5(( \"  [overshoot values]\\n\" ));\n\n      while ( *p )\n      {\n        FT_ULong    ch;\n        FT_ULong    glyph_index;\n        FT_Long     y_offset;\n        FT_Pos      best_pos;       /* same as points.y or points.x, resp. */\n        FT_Int      best_point;\n        FT_Vector*  points;\n\n\n        GET_UTF8_CHAR( ch, p );\n\n        /* switch to characters that define flat values */\n        if ( ch == '|' )\n        {\n          fill = 0;\n          FT_TRACE5(( \"  [reference values]\\n\" ));\n          continue;\n        }\n\n        /* load the character in the face -- skip unknown or empty ones */\n        af_get_char_index( &metrics->root, ch, &glyph_index, &y_offset );\n        if ( glyph_index == 0 )\n        {\n          FT_TRACE5(( \"  U+%04lX unavailable\\n\", ch ));\n          continue;\n        }\n\n        error   = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );\n        outline = face->glyph->outline;\n        if ( error || outline.n_points <= 0 )\n        {\n          FT_TRACE5(( \"  U+%04lX contains no outlines\\n\", ch ));\n          continue;\n        }\n\n        /* now compute min or max point indices and coordinates */\n        points     = outline.points;\n        best_point = -1;\n        best_pos   = 0;  /* make compiler happy */\n\n        {\n          FT_Int  nn;\n          FT_Int  first = 0;\n          FT_Int  last  = -1;\n\n\n          for ( nn = 0; nn < outline.n_contours; first = last + 1, nn++ )\n          {\n            FT_Int  pp;\n\n\n            last = outline.contours[nn];\n\n            /* Avoid single-point contours since they are never rasterized. */\n            /* In some fonts, they correspond to mark attachment points     */\n            /* which are way outside of the glyph's real outline.           */\n            if ( last <= first )\n              continue;\n\n            if ( AF_CJK_IS_HORIZ_BLUE( bs ) )\n            {\n              if ( AF_CJK_IS_RIGHT_BLUE( bs ) )\n              {\n                for ( pp = first; pp <= last; pp++ )\n                  if ( best_point < 0 || points[pp].x > best_pos )\n                  {\n                    best_point = pp;\n                    best_pos   = points[pp].x;\n                  }\n              }\n              else\n              {\n                for ( pp = first; pp <= last; pp++ )\n                  if ( best_point < 0 || points[pp].x < best_pos )\n                  {\n                    best_point = pp;\n                    best_pos   = points[pp].x;\n                  }\n              }\n            }\n            else\n            {\n              if ( AF_CJK_IS_TOP_BLUE( bs ) )\n              {\n                for ( pp = first; pp <= last; pp++ )\n                  if ( best_point < 0 || points[pp].y > best_pos )\n                  {\n                    best_point = pp;\n                    best_pos   = points[pp].y;\n                  }\n              }\n              else\n              {\n                for ( pp = first; pp <= last; pp++ )\n                  if ( best_point < 0 || points[pp].y < best_pos )\n                  {\n                    best_point = pp;\n                    best_pos   = points[pp].y;\n                  }\n              }\n            }\n          }\n\n          FT_TRACE5(( \"  U+%04lX: best_pos = %5ld\\n\", ch, best_pos ));\n        }\n\n        if ( fill )\n          fills[num_fills++] = best_pos;\n        else\n          flats[num_flats++] = best_pos;\n      }\n\n      if ( num_flats == 0 && num_fills == 0 )\n      {\n        /*\n         *  we couldn't find a single glyph to compute this blue zone,\n         *  we will simply ignore it then\n         */\n        FT_TRACE5(( \"  empty\\n\" ));\n        continue;\n      }\n\n      /* we have computed the contents of the `fill' and `flats' tables,   */\n      /* now determine the reference and overshoot position of the blue -- */\n      /* we simply take the median value after a simple sort               */\n      af_sort_pos( num_fills, fills );\n      af_sort_pos( num_flats, flats );\n\n      blue       = &axis->blues[axis->blue_count];\n      blue_ref   = &blue->ref.org;\n      blue_shoot = &blue->shoot.org;\n\n      axis->blue_count++;\n\n      if ( num_flats == 0 )\n      {\n        *blue_ref   =\n        *blue_shoot = fills[num_fills / 2];\n      }\n      else if ( num_fills == 0 )\n      {\n        *blue_ref   =\n        *blue_shoot = flats[num_flats / 2];\n      }\n      else\n      {\n        *blue_ref   = fills[num_fills / 2];\n        *blue_shoot = flats[num_flats / 2];\n      }\n\n      /* make sure blue_ref >= blue_shoot for top/right or */\n      /* vice versa for bottom/left                        */\n      if ( *blue_shoot != *blue_ref )\n      {\n        FT_Pos   ref       = *blue_ref;\n        FT_Pos   shoot     = *blue_shoot;\n        FT_Bool  under_ref = FT_BOOL( shoot < ref );\n\n\n        /* AF_CJK_IS_TOP_BLUE covers `right' and `top' */\n        if ( AF_CJK_IS_TOP_BLUE( bs ) ^ under_ref )\n        {\n          *blue_ref   =\n          *blue_shoot = ( shoot + ref ) / 2;\n\n          FT_TRACE5(( \"  [reference smaller than overshoot,\"\n                      \" taking mean value]\\n\" ));\n        }\n      }\n\n      blue->flags = 0;\n      if ( AF_CJK_IS_TOP_BLUE( bs ) )\n        blue->flags |= AF_CJK_BLUE_TOP;\n\n      FT_TRACE5(( \"    -> reference = %ld\\n\"\n                  \"       overshoot = %ld\\n\",\n                  *blue_ref, *blue_shoot ));\n    }\n\n    FT_TRACE5(( \"\\n\" ));\n\n    return;\n  }\n\n\n  /* Basically the Latin version with type AF_CJKMetrics for metrics. */\n\n  FT_LOCAL_DEF( void )\n  af_cjk_metrics_check_digits( AF_CJKMetrics  metrics,\n                               FT_Face        face )\n  {\n    FT_UInt   i;\n    FT_Bool   started = 0, same_width = 1;\n    FT_Fixed  advance, old_advance = 0;\n\n\n    /* digit `0' is 0x30 in all supported charmaps */\n    for ( i = 0x30; i <= 0x39; i++ )\n    {\n      FT_ULong  glyph_index;\n      FT_Long   y_offset;\n\n\n      af_get_char_index( &metrics->root, i, &glyph_index, &y_offset );\n      if ( glyph_index == 0 )\n        continue;\n\n      if ( FT_Get_Advance( face, glyph_index,\n                           FT_LOAD_NO_SCALE         |\n                           FT_LOAD_NO_HINTING       |\n                           FT_LOAD_IGNORE_TRANSFORM,\n                           &advance ) )\n        continue;\n\n      if ( started )\n      {\n        if ( advance != old_advance )\n        {\n          same_width = 0;\n          break;\n        }\n      }\n      else\n      {\n        old_advance = advance;\n        started     = 1;\n      }\n    }\n\n    metrics->root.digits_have_same_width = same_width;\n  }\n\n\n  /* Initialize global metrics. */\n\n  FT_LOCAL_DEF( FT_Error )\n  af_cjk_metrics_init( AF_CJKMetrics  metrics,\n                       FT_Face        face )\n  {\n    FT_CharMap  oldmap = face->charmap;\n\n\n    metrics->units_per_em = face->units_per_EM;\n\n    if ( !FT_Select_Charmap( face, FT_ENCODING_UNICODE ) )\n    {\n      af_cjk_metrics_init_widths( metrics, face );\n      af_cjk_metrics_init_blues( metrics, face );\n      af_cjk_metrics_check_digits( metrics, face );\n    }\n\n    FT_Set_Charmap( face, oldmap );\n    return FT_Err_Ok;\n  }\n\n\n  /* Adjust scaling value, then scale and shift widths   */\n  /* and blue zones (if applicable) for given dimension. */\n\n  static void\n  af_cjk_metrics_scale_dim( AF_CJKMetrics  metrics,\n                            AF_Scaler      scaler,\n                            AF_Dimension   dim )\n  {\n    FT_Fixed    scale;\n    FT_Pos      delta;\n    AF_CJKAxis  axis;\n    FT_UInt     nn;\n\n\n    if ( dim == AF_DIMENSION_HORZ )\n    {\n      scale = scaler->x_scale;\n      delta = scaler->x_delta;\n    }\n    else\n    {\n      scale = scaler->y_scale;\n      delta = scaler->y_delta;\n    }\n\n    axis = &metrics->axis[dim];\n\n    if ( axis->org_scale == scale && axis->org_delta == delta )\n      return;\n\n    axis->org_scale = scale;\n    axis->org_delta = delta;\n\n    axis->scale = scale;\n    axis->delta = delta;\n\n    /* scale the blue zones */\n    for ( nn = 0; nn < axis->blue_count; nn++ )\n    {\n      AF_CJKBlue  blue = &axis->blues[nn];\n      FT_Pos      dist;\n\n\n      blue->ref.cur   = FT_MulFix( blue->ref.org, scale ) + delta;\n      blue->ref.fit   = blue->ref.cur;\n      blue->shoot.cur = FT_MulFix( blue->shoot.org, scale ) + delta;\n      blue->shoot.fit = blue->shoot.cur;\n      blue->flags    &= ~AF_CJK_BLUE_ACTIVE;\n\n      /* a blue zone is only active if it is less than 3/4 pixels tall */\n      dist = FT_MulFix( blue->ref.org - blue->shoot.org, scale );\n      if ( dist <= 48 && dist >= -48 )\n      {\n        FT_Pos  delta1, delta2;\n\n\n        blue->ref.fit  = FT_PIX_ROUND( blue->ref.cur );\n\n        /* shoot is under shoot for cjk */\n        delta1 = FT_DivFix( blue->ref.fit, scale ) - blue->shoot.org;\n        delta2 = delta1;\n        if ( delta1 < 0 )\n          delta2 = -delta2;\n\n        delta2 = FT_MulFix( delta2, scale );\n\n        FT_TRACE5(( \"delta: %d\", delta1 ));\n        if ( delta2 < 32 )\n          delta2 = 0;\n#if 0\n        else if ( delta2 < 64 )\n          delta2 = 32 + ( ( ( delta2 - 32 ) + 16 ) & ~31 );\n#endif\n        else\n          delta2 = FT_PIX_ROUND( delta2 );\n        FT_TRACE5(( \"/%d\\n\", delta2 ));\n\n        if ( delta1 < 0 )\n          delta2 = -delta2;\n\n        blue->shoot.fit = blue->ref.fit - delta2;\n\n        FT_TRACE5(( \">> active cjk blue zone %c%d[%ld/%ld]:\\n\"\n                    \"     ref:   cur=%.2f fit=%.2f\\n\"\n                    \"     shoot: cur=%.2f fit=%.2f\\n\",\n                    ( dim == AF_DIMENSION_HORZ ) ? 'H' : 'V',\n                    nn, blue->ref.org, blue->shoot.org,\n                    blue->ref.cur / 64.0, blue->ref.fit / 64.0,\n                    blue->shoot.cur / 64.0, blue->shoot.fit / 64.0 ));\n\n        blue->flags |= AF_CJK_BLUE_ACTIVE;\n      }\n    }\n  }\n\n\n  /* Scale global values in both directions. */\n\n  FT_LOCAL_DEF( void )\n  af_cjk_metrics_scale( AF_CJKMetrics  metrics,\n                        AF_Scaler      scaler )\n  {\n    /* we copy the whole structure since the x and y scaling values */\n    /* are not modified, contrary to e.g. the `latin' auto-hinter   */\n    metrics->root.scaler = *scaler;\n\n    af_cjk_metrics_scale_dim( metrics, scaler, AF_DIMENSION_HORZ );\n    af_cjk_metrics_scale_dim( metrics, scaler, AF_DIMENSION_VERT );\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****              C J K   G L Y P H   A N A L Y S I S              *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* Walk over all contours and compute its segments. */\n\n  static FT_Error\n  af_cjk_hints_compute_segments( AF_GlyphHints  hints,\n                                 AF_Dimension   dim )\n  {\n    AF_AxisHints  axis          = &hints->axis[dim];\n    AF_Segment    segments      = axis->segments;\n    AF_Segment    segment_limit = segments + axis->num_segments;\n    FT_Error      error;\n    AF_Segment    seg;\n\n\n    error = af_latin_hints_compute_segments( hints, dim );\n    if ( error )\n      return error;\n\n    /* a segment is round if it doesn't have successive */\n    /* on-curve points.                                 */\n    for ( seg = segments; seg < segment_limit; seg++ )\n    {\n      AF_Point  pt   = seg->first;\n      AF_Point  last = seg->last;\n      AF_Flags  f0   = (AF_Flags)( pt->flags & AF_FLAG_CONTROL );\n      AF_Flags  f1;\n\n\n      seg->flags &= ~AF_EDGE_ROUND;\n\n      for ( ; pt != last; f0 = f1 )\n      {\n        pt = pt->next;\n        f1 = (AF_Flags)( pt->flags & AF_FLAG_CONTROL );\n\n        if ( !f0 && !f1 )\n          break;\n\n        if ( pt == last )\n          seg->flags |= AF_EDGE_ROUND;\n      }\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n  static void\n  af_cjk_hints_link_segments( AF_GlyphHints  hints,\n                              AF_Dimension   dim )\n  {\n    AF_AxisHints  axis          = &hints->axis[dim];\n    AF_Segment    segments      = axis->segments;\n    AF_Segment    segment_limit = segments + axis->num_segments;\n    AF_Direction  major_dir     = axis->major_dir;\n    AF_Segment    seg1, seg2;\n    FT_Pos        len_threshold;\n    FT_Pos        dist_threshold;\n\n\n    len_threshold = AF_LATIN_CONSTANT( hints->metrics, 8 );\n\n    dist_threshold = ( dim == AF_DIMENSION_HORZ ) ? hints->x_scale\n                                                  : hints->y_scale;\n    dist_threshold = FT_DivFix( 64 * 3, dist_threshold );\n\n    /* now compare each segment to the others */\n    for ( seg1 = segments; seg1 < segment_limit; seg1++ )\n    {\n      if ( seg1->dir != major_dir )\n        continue;\n\n      for ( seg2 = segments; seg2 < segment_limit; seg2++ )\n        if ( seg2 != seg1 && seg1->dir + seg2->dir == 0 )\n        {\n          FT_Pos  dist = seg2->pos - seg1->pos;\n\n\n          if ( dist < 0 )\n            continue;\n\n          {\n            FT_Pos  min = seg1->min_coord;\n            FT_Pos  max = seg1->max_coord;\n            FT_Pos  len;\n\n\n            if ( min < seg2->min_coord )\n              min = seg2->min_coord;\n\n            if ( max > seg2->max_coord )\n              max = seg2->max_coord;\n\n            len = max - min;\n            if ( len >= len_threshold )\n            {\n              if ( dist * 8 < seg1->score * 9                        &&\n                   ( dist * 8 < seg1->score * 7 || seg1->len < len ) )\n              {\n                seg1->score = dist;\n                seg1->len   = len;\n                seg1->link  = seg2;\n              }\n\n              if ( dist * 8 < seg2->score * 9                        &&\n                   ( dist * 8 < seg2->score * 7 || seg2->len < len ) )\n              {\n                seg2->score = dist;\n                seg2->len   = len;\n                seg2->link  = seg1;\n              }\n            }\n          }\n        }\n    }\n\n    /*\n     *  now compute the `serif' segments\n     *\n     *  In Hanzi, some strokes are wider on one or both of the ends.\n     *  We either identify the stems on the ends as serifs or remove\n     *  the linkage, depending on the length of the stems.\n     *\n     */\n\n    {\n      AF_Segment  link1, link2;\n\n\n      for ( seg1 = segments; seg1 < segment_limit; seg1++ )\n      {\n        link1 = seg1->link;\n        if ( !link1 || link1->link != seg1 || link1->pos <= seg1->pos )\n          continue;\n\n        if ( seg1->score >= dist_threshold )\n          continue;\n\n        for ( seg2 = segments; seg2 < segment_limit; seg2++ )\n        {\n          if ( seg2->pos > seg1->pos || seg1 == seg2 )\n            continue;\n\n          link2 = seg2->link;\n          if ( !link2 || link2->link != seg2 || link2->pos < link1->pos )\n            continue;\n\n          if ( seg1->pos == seg2->pos && link1->pos == link2->pos )\n            continue;\n\n          if ( seg2->score <= seg1->score || seg1->score * 4 <= seg2->score )\n            continue;\n\n          /* seg2 < seg1 < link1 < link2 */\n\n          if ( seg1->len >= seg2->len * 3 )\n          {\n            AF_Segment  seg;\n\n\n            for ( seg = segments; seg < segment_limit; seg++ )\n            {\n              AF_Segment  link = seg->link;\n\n\n              if ( link == seg2 )\n              {\n                seg->link  = 0;\n                seg->serif = link1;\n              }\n              else if ( link == link2 )\n              {\n                seg->link  = 0;\n                seg->serif = seg1;\n              }\n            }\n          }\n          else\n          {\n            seg1->link = link1->link = 0;\n\n            break;\n          }\n        }\n      }\n    }\n\n    for ( seg1 = segments; seg1 < segment_limit; seg1++ )\n    {\n      seg2 = seg1->link;\n\n      if ( seg2 )\n      {\n        seg2->num_linked++;\n        if ( seg2->link != seg1 )\n        {\n          seg1->link = 0;\n\n          if ( seg2->score < dist_threshold || seg1->score < seg2->score * 4 )\n            seg1->serif = seg2->link;\n          else\n            seg2->num_linked--;\n        }\n      }\n    }\n  }\n\n\n  static FT_Error\n  af_cjk_hints_compute_edges( AF_GlyphHints  hints,\n                              AF_Dimension   dim )\n  {\n    AF_AxisHints  axis   = &hints->axis[dim];\n    FT_Error      error  = FT_Err_Ok;\n    FT_Memory     memory = hints->memory;\n    AF_CJKAxis    laxis  = &((AF_CJKMetrics)hints->metrics)->axis[dim];\n\n    AF_Segment    segments      = axis->segments;\n    AF_Segment    segment_limit = segments + axis->num_segments;\n    AF_Segment    seg;\n\n    FT_Fixed      scale;\n    FT_Pos        edge_distance_threshold;\n\n\n    axis->num_edges = 0;\n\n    scale = ( dim == AF_DIMENSION_HORZ ) ? hints->x_scale\n                                         : hints->y_scale;\n\n    /*********************************************************************/\n    /*                                                                   */\n    /* We begin by generating a sorted table of edges for the current    */\n    /* direction.  To do so, we simply scan each segment and try to find */\n    /* an edge in our table that corresponds to its position.            */\n    /*                                                                   */\n    /* If no edge is found, we create and insert a new edge in the       */\n    /* sorted table.  Otherwise, we simply add the segment to the edge's */\n    /* list which is then processed in the second step to compute the    */\n    /* edge's properties.                                                */\n    /*                                                                   */\n    /* Note that the edges table is sorted along the segment/edge        */\n    /* position.                                                         */\n    /*                                                                   */\n    /*********************************************************************/\n\n    edge_distance_threshold = FT_MulFix( laxis->edge_distance_threshold,\n                                         scale );\n    if ( edge_distance_threshold > 64 / 4 )\n      edge_distance_threshold = FT_DivFix( 64 / 4, scale );\n    else\n      edge_distance_threshold = laxis->edge_distance_threshold;\n\n    for ( seg = segments; seg < segment_limit; seg++ )\n    {\n      AF_Edge  found = NULL;\n      FT_Pos   best  = 0xFFFFU;\n      FT_Int   ee;\n\n\n      /* look for an edge corresponding to the segment */\n      for ( ee = 0; ee < axis->num_edges; ee++ )\n      {\n        AF_Edge  edge = axis->edges + ee;\n        FT_Pos   dist;\n\n\n        if ( edge->dir != seg->dir )\n          continue;\n\n        dist = seg->pos - edge->fpos;\n        if ( dist < 0 )\n          dist = -dist;\n\n        if ( dist < edge_distance_threshold && dist < best )\n        {\n          AF_Segment  link = seg->link;\n\n\n          /* check whether all linked segments of the candidate edge */\n          /* can make a single edge.                                 */\n          if ( link )\n          {\n            AF_Segment  seg1  = edge->first;\n            FT_Pos      dist2 = 0;\n\n\n            do\n            {\n              AF_Segment  link1 = seg1->link;\n\n\n              if ( link1 )\n              {\n                dist2 = AF_SEGMENT_DIST( link, link1 );\n                if ( dist2 >= edge_distance_threshold )\n                  break;\n              }\n\n            } while ( ( seg1 = seg1->edge_next ) != edge->first );\n\n            if ( dist2 >= edge_distance_threshold )\n              continue;\n          }\n\n          best  = dist;\n          found = edge;\n        }\n      }\n\n      if ( !found )\n      {\n        AF_Edge  edge;\n\n\n        /* insert a new edge in the list and */\n        /* sort according to the position    */\n        error = af_axis_hints_new_edge( axis, seg->pos,\n                                        (AF_Direction)seg->dir,\n                                        memory, &edge );\n        if ( error )\n          goto Exit;\n\n        /* add the segment to the new edge's list */\n        FT_ZERO( edge );\n\n        edge->first    = seg;\n        edge->last     = seg;\n        edge->dir      = seg->dir;\n        edge->fpos     = seg->pos;\n        edge->opos     = FT_MulFix( seg->pos, scale );\n        edge->pos      = edge->opos;\n        seg->edge_next = seg;\n      }\n      else\n      {\n        /* if an edge was found, simply add the segment to the edge's */\n        /* list                                                       */\n        seg->edge_next         = found->first;\n        found->last->edge_next = seg;\n        found->last            = seg;\n      }\n    }\n\n    /******************************************************************/\n    /*                                                                */\n    /* Good, we now compute each edge's properties according to the   */\n    /* segments found on its position.  Basically, these are          */\n    /*                                                                */\n    /*  - the edge's main direction                                   */\n    /*  - stem edge, serif edge or both (which defaults to stem then) */\n    /*  - rounded edge, straight or both (which defaults to straight) */\n    /*  - link for edge                                               */\n    /*                                                                */\n    /******************************************************************/\n\n    /* first of all, set the `edge' field in each segment -- this is */\n    /* required in order to compute edge links                       */\n\n    /*\n     * Note that removing this loop and setting the `edge' field of each\n     * segment directly in the code above slows down execution speed for\n     * some reasons on platforms like the Sun.\n     */\n    {\n      AF_Edge  edges      = axis->edges;\n      AF_Edge  edge_limit = edges + axis->num_edges;\n      AF_Edge  edge;\n\n\n      for ( edge = edges; edge < edge_limit; edge++ )\n      {\n        seg = edge->first;\n        if ( seg )\n          do\n          {\n            seg->edge = edge;\n            seg       = seg->edge_next;\n\n          } while ( seg != edge->first );\n      }\n\n      /* now compute each edge properties */\n      for ( edge = edges; edge < edge_limit; edge++ )\n      {\n        FT_Int  is_round    = 0;  /* does it contain round segments?    */\n        FT_Int  is_straight = 0;  /* does it contain straight segments? */\n\n\n        seg = edge->first;\n\n        do\n        {\n          FT_Bool  is_serif;\n\n\n          /* check for roundness of segment */\n          if ( seg->flags & AF_EDGE_ROUND )\n            is_round++;\n          else\n            is_straight++;\n\n          /* check for links -- if seg->serif is set, then seg->link must */\n          /* be ignored                                                   */\n          is_serif = (FT_Bool)( seg->serif && seg->serif->edge != edge );\n\n          if ( seg->link || is_serif )\n          {\n            AF_Edge     edge2;\n            AF_Segment  seg2;\n\n\n            edge2 = edge->link;\n            seg2  = seg->link;\n\n            if ( is_serif )\n            {\n              seg2  = seg->serif;\n              edge2 = edge->serif;\n            }\n\n            if ( edge2 )\n            {\n              FT_Pos  edge_delta;\n              FT_Pos  seg_delta;\n\n\n              edge_delta = edge->fpos - edge2->fpos;\n              if ( edge_delta < 0 )\n                edge_delta = -edge_delta;\n\n              seg_delta = AF_SEGMENT_DIST( seg, seg2 );\n\n              if ( seg_delta < edge_delta )\n                edge2 = seg2->edge;\n            }\n            else\n              edge2 = seg2->edge;\n\n            if ( is_serif )\n            {\n              edge->serif   = edge2;\n              edge2->flags |= AF_EDGE_SERIF;\n            }\n            else\n              edge->link  = edge2;\n          }\n\n          seg = seg->edge_next;\n\n        } while ( seg != edge->first );\n\n        /* set the round/straight flags */\n        edge->flags = AF_EDGE_NORMAL;\n\n        if ( is_round > 0 && is_round >= is_straight )\n          edge->flags |= AF_EDGE_ROUND;\n\n        /* get rid of serifs if link is set                 */\n        /* XXX: This gets rid of many unpleasant artefacts! */\n        /*      Example: the `c' in cour.pfa at size 13     */\n\n        if ( edge->serif && edge->link )\n          edge->serif = 0;\n      }\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /* Detect segments and edges for given dimension. */\n\n  static FT_Error\n  af_cjk_hints_detect_features( AF_GlyphHints  hints,\n                                AF_Dimension   dim )\n  {\n    FT_Error  error;\n\n\n    error = af_cjk_hints_compute_segments( hints, dim );\n    if ( !error )\n    {\n      af_cjk_hints_link_segments( hints, dim );\n\n      error = af_cjk_hints_compute_edges( hints, dim );\n    }\n    return error;\n  }\n\n\n  /* Compute all edges which lie within blue zones. */\n\n  FT_LOCAL_DEF( void )\n  af_cjk_hints_compute_blue_edges( AF_GlyphHints  hints,\n                                   AF_CJKMetrics  metrics,\n                                   AF_Dimension   dim )\n  {\n    AF_AxisHints  axis       = &hints->axis[dim];\n    AF_Edge       edge       = axis->edges;\n    AF_Edge       edge_limit = edge + axis->num_edges;\n    AF_CJKAxis    cjk        = &metrics->axis[dim];\n    FT_Fixed      scale      = cjk->scale;\n    FT_Pos        best_dist0;  /* initial threshold */\n\n\n    /* compute the initial threshold as a fraction of the EM size */\n    best_dist0 = FT_MulFix( metrics->units_per_em / 40, scale );\n\n    if ( best_dist0 > 64 / 2 ) /* maximum 1/2 pixel */\n      best_dist0 = 64 / 2;\n\n    /* compute which blue zones are active, i.e. have their scaled */\n    /* size < 3/4 pixels                                           */\n\n    /* If the distant between an edge and a blue zone is shorter than */\n    /* best_dist0, set the blue zone for the edge.  Then search for   */\n    /* the blue zone with the smallest best_dist to the edge.         */\n\n    for ( ; edge < edge_limit; edge++ )\n    {\n      FT_UInt   bb;\n      AF_Width  best_blue = NULL;\n      FT_Pos    best_dist = best_dist0;\n\n\n      for ( bb = 0; bb < cjk->blue_count; bb++ )\n      {\n        AF_CJKBlue  blue = cjk->blues + bb;\n        FT_Bool     is_top_right_blue, is_major_dir;\n\n\n        /* skip inactive blue zones (i.e., those that are too small) */\n        if ( !( blue->flags & AF_CJK_BLUE_ACTIVE ) )\n          continue;\n\n        /* if it is a top zone, check for right edges -- if it is a bottom */\n        /* zone, check for left edges                                      */\n        /*                                                                 */\n        /* of course, that's for TrueType                                  */\n        is_top_right_blue =\n          (FT_Byte)( ( blue->flags & AF_CJK_BLUE_TOP ) != 0 );\n        is_major_dir =\n          FT_BOOL( edge->dir == axis->major_dir );\n\n        /* if it is a top zone, the edge must be against the major    */\n        /* direction; if it is a bottom zone, it must be in the major */\n        /* direction                                                  */\n        if ( is_top_right_blue ^ is_major_dir )\n        {\n          FT_Pos    dist;\n          AF_Width  compare;\n\n\n          /* Compare the edge to the closest blue zone type */\n          if ( FT_ABS( edge->fpos - blue->ref.org ) >\n               FT_ABS( edge->fpos - blue->shoot.org ) )\n            compare = &blue->shoot;\n          else\n            compare = &blue->ref;\n\n          dist = edge->fpos - compare->org;\n          if ( dist < 0 )\n            dist = -dist;\n\n          dist = FT_MulFix( dist, scale );\n          if ( dist < best_dist )\n          {\n            best_dist = dist;\n            best_blue = compare;\n          }\n        }\n      }\n\n      if ( best_blue )\n        edge->blue_edge = best_blue;\n    }\n  }\n\n\n  /* Initalize hinting engine. */\n\n  FT_LOCAL_DEF( FT_Error )\n  af_cjk_hints_init( AF_GlyphHints  hints,\n                     AF_CJKMetrics  metrics )\n  {\n    FT_Render_Mode  mode;\n    FT_UInt32       scaler_flags, other_flags;\n\n\n    af_glyph_hints_rescale( hints, (AF_StyleMetrics)metrics );\n\n    /*\n     *  correct x_scale and y_scale when needed, since they may have\n     *  been modified af_cjk_scale_dim above\n     */\n    hints->x_scale = metrics->axis[AF_DIMENSION_HORZ].scale;\n    hints->x_delta = metrics->axis[AF_DIMENSION_HORZ].delta;\n    hints->y_scale = metrics->axis[AF_DIMENSION_VERT].scale;\n    hints->y_delta = metrics->axis[AF_DIMENSION_VERT].delta;\n\n    /* compute flags depending on render mode, etc. */\n    mode = metrics->root.scaler.render_mode;\n\n#ifdef AF_CONFIG_OPTION_USE_WARPER\n    if ( mode == FT_RENDER_MODE_LCD || mode == FT_RENDER_MODE_LCD_V )\n      metrics->root.scaler.render_mode = mode = FT_RENDER_MODE_NORMAL;\n#endif\n\n    scaler_flags = hints->scaler_flags;\n    other_flags  = 0;\n\n    /*\n     *  We snap the width of vertical stems for the monochrome and\n     *  horizontal LCD rendering targets only.\n     */\n    if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD )\n      other_flags |= AF_LATIN_HINTS_HORZ_SNAP;\n\n    /*\n     *  We snap the width of horizontal stems for the monochrome and\n     *  vertical LCD rendering targets only.\n     */\n    if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD_V )\n      other_flags |= AF_LATIN_HINTS_VERT_SNAP;\n\n    /*\n     *  We adjust stems to full pixels only if we don't use the `light' mode.\n     */\n    if ( mode != FT_RENDER_MODE_LIGHT )\n      other_flags |= AF_LATIN_HINTS_STEM_ADJUST;\n\n    if ( mode == FT_RENDER_MODE_MONO )\n      other_flags |= AF_LATIN_HINTS_MONO;\n\n    scaler_flags |= AF_SCALER_FLAG_NO_ADVANCE;\n\n    hints->scaler_flags = scaler_flags;\n    hints->other_flags  = other_flags;\n\n    return FT_Err_Ok;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****          C J K   G L Y P H   G R I D - F I T T I N G          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* Snap a given width in scaled coordinates to one of the */\n  /* current standard widths.                               */\n\n  static FT_Pos\n  af_cjk_snap_width( AF_Width  widths,\n                     FT_Int    count,\n                     FT_Pos    width )\n  {\n    int     n;\n    FT_Pos  best      = 64 + 32 + 2;\n    FT_Pos  reference = width;\n    FT_Pos  scaled;\n\n\n    for ( n = 0; n < count; n++ )\n    {\n      FT_Pos  w;\n      FT_Pos  dist;\n\n\n      w = widths[n].cur;\n      dist = width - w;\n      if ( dist < 0 )\n        dist = -dist;\n      if ( dist < best )\n      {\n        best      = dist;\n        reference = w;\n      }\n    }\n\n    scaled = FT_PIX_ROUND( reference );\n\n    if ( width >= reference )\n    {\n      if ( width < scaled + 48 )\n        width = reference;\n    }\n    else\n    {\n      if ( width > scaled - 48 )\n        width = reference;\n    }\n\n    return width;\n  }\n\n\n  /* Compute the snapped width of a given stem.                          */\n  /* There is a lot of voodoo in this function; changing the hard-coded  */\n  /* parameters influence the whole hinting process.                     */\n\n  static FT_Pos\n  af_cjk_compute_stem_width( AF_GlyphHints  hints,\n                             AF_Dimension   dim,\n                             FT_Pos         width,\n                             AF_Edge_Flags  base_flags,\n                             AF_Edge_Flags  stem_flags )\n  {\n    AF_CJKMetrics  metrics  = (AF_CJKMetrics)hints->metrics;\n    AF_CJKAxis     axis     = &metrics->axis[dim];\n    FT_Pos         dist     = width;\n    FT_Int         sign     = 0;\n    FT_Bool        vertical = FT_BOOL( dim == AF_DIMENSION_VERT );\n\n    FT_UNUSED( base_flags );\n    FT_UNUSED( stem_flags );\n\n\n    if ( !AF_LATIN_HINTS_DO_STEM_ADJUST( hints ) )\n      return width;\n\n    if ( dist < 0 )\n    {\n      dist = -width;\n      sign = 1;\n    }\n\n    if ( (  vertical && !AF_LATIN_HINTS_DO_VERT_SNAP( hints ) ) ||\n         ( !vertical && !AF_LATIN_HINTS_DO_HORZ_SNAP( hints ) ) )\n    {\n      /* smooth hinting process: very lightly quantize the stem width */\n\n      if ( axis->width_count > 0 )\n      {\n        if ( FT_ABS( dist - axis->widths[0].cur ) < 40 )\n        {\n          dist = axis->widths[0].cur;\n          if ( dist < 48 )\n            dist = 48;\n\n          goto Done_Width;\n        }\n      }\n\n      if ( dist < 54 )\n        dist += ( 54 - dist ) / 2 ;\n      else if ( dist < 3 * 64 )\n      {\n        FT_Pos  delta;\n\n\n        delta  = dist & 63;\n        dist  &= -64;\n\n        if ( delta < 10 )\n          dist += delta;\n        else if ( delta < 22 )\n          dist += 10;\n        else if ( delta < 42 )\n          dist += delta;\n        else if ( delta < 54 )\n          dist += 54;\n        else\n          dist += delta;\n      }\n    }\n    else\n    {\n      /* strong hinting process: snap the stem width to integer pixels */\n\n      dist = af_cjk_snap_width( axis->widths, axis->width_count, dist );\n\n      if ( vertical )\n      {\n        /* in the case of vertical hinting, always round */\n        /* the stem heights to integer pixels            */\n\n        if ( dist >= 64 )\n          dist = ( dist + 16 ) & ~63;\n        else\n          dist = 64;\n      }\n      else\n      {\n        if ( AF_LATIN_HINTS_DO_MONO( hints ) )\n        {\n          /* monochrome horizontal hinting: snap widths to integer pixels */\n          /* with a different threshold                                   */\n\n          if ( dist < 64 )\n            dist = 64;\n          else\n            dist = ( dist + 32 ) & ~63;\n        }\n        else\n        {\n          /* for horizontal anti-aliased hinting, we adopt a more subtle */\n          /* approach: we strengthen small stems, round stems whose size */\n          /* is between 1 and 2 pixels to an integer, otherwise nothing  */\n\n          if ( dist < 48 )\n            dist = ( dist + 64 ) >> 1;\n\n          else if ( dist < 128 )\n            dist = ( dist + 22 ) & ~63;\n          else\n            /* round otherwise to prevent color fringes in LCD mode */\n            dist = ( dist + 32 ) & ~63;\n        }\n      }\n    }\n\n  Done_Width:\n    if ( sign )\n      dist = -dist;\n\n    return dist;\n  }\n\n\n  /* Align one stem edge relative to the previous stem edge. */\n\n  static void\n  af_cjk_align_linked_edge( AF_GlyphHints  hints,\n                            AF_Dimension   dim,\n                            AF_Edge        base_edge,\n                            AF_Edge        stem_edge )\n  {\n    FT_Pos  dist = stem_edge->opos - base_edge->opos;\n\n    FT_Pos  fitted_width = af_cjk_compute_stem_width(\n                             hints, dim, dist,\n                             (AF_Edge_Flags)base_edge->flags,\n                             (AF_Edge_Flags)stem_edge->flags );\n\n\n    stem_edge->pos = base_edge->pos + fitted_width;\n\n    FT_TRACE5(( \"  CJKLINK: edge %d @%d (opos=%.2f) linked to %.2f,\"\n                \" dist was %.2f, now %.2f\\n\",\n                stem_edge - hints->axis[dim].edges, stem_edge->fpos,\n                stem_edge->opos / 64.0, stem_edge->pos / 64.0,\n                dist / 64.0, fitted_width / 64.0 ));\n  }\n\n\n  /* Shift the coordinates of the `serif' edge by the same amount */\n  /* as the corresponding `base' edge has been moved already.     */\n\n  static void\n  af_cjk_align_serif_edge( AF_GlyphHints  hints,\n                           AF_Edge        base,\n                           AF_Edge        serif )\n  {\n    FT_UNUSED( hints );\n\n    serif->pos = base->pos + ( serif->opos - base->opos );\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                    E D G E   H I N T I N G                      ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n#define AF_LIGHT_MODE_MAX_HORZ_GAP    9\n#define AF_LIGHT_MODE_MAX_VERT_GAP   15\n#define AF_LIGHT_MODE_MAX_DELTA_ABS  14\n\n\n  static FT_Pos\n  af_hint_normal_stem( AF_GlyphHints  hints,\n                       AF_Edge        edge,\n                       AF_Edge        edge2,\n                       FT_Pos         anchor,\n                       AF_Dimension   dim )\n  {\n    FT_Pos  org_len, cur_len, org_center;\n    FT_Pos  cur_pos1, cur_pos2;\n    FT_Pos  d_off1, u_off1, d_off2, u_off2, delta;\n    FT_Pos  offset;\n    FT_Pos  threshold = 64;\n\n\n    if ( !AF_LATIN_HINTS_DO_STEM_ADJUST( hints ) )\n    {\n      if ( ( edge->flags  & AF_EDGE_ROUND ) &&\n           ( edge2->flags & AF_EDGE_ROUND ) )\n      {\n        if ( dim == AF_DIMENSION_VERT )\n          threshold = 64 - AF_LIGHT_MODE_MAX_HORZ_GAP;\n        else\n          threshold = 64 - AF_LIGHT_MODE_MAX_VERT_GAP;\n      }\n      else\n      {\n        if ( dim == AF_DIMENSION_VERT )\n          threshold = 64 - AF_LIGHT_MODE_MAX_HORZ_GAP / 3;\n        else\n          threshold = 64 - AF_LIGHT_MODE_MAX_VERT_GAP / 3;\n      }\n    }\n\n    org_len    = edge2->opos - edge->opos;\n    cur_len    = af_cjk_compute_stem_width( hints, dim, org_len,\n                                            (AF_Edge_Flags)edge->flags,\n                                            (AF_Edge_Flags)edge2->flags );\n\n    org_center = ( edge->opos + edge2->opos ) / 2 + anchor;\n    cur_pos1   = org_center - cur_len / 2;\n    cur_pos2   = cur_pos1 + cur_len;\n    d_off1     = cur_pos1 - FT_PIX_FLOOR( cur_pos1 );\n    d_off2     = cur_pos2 - FT_PIX_FLOOR( cur_pos2 );\n    u_off1     = 64 - d_off1;\n    u_off2     = 64 - d_off2;\n    delta      = 0;\n\n\n    if ( d_off1 == 0 || d_off2 == 0 )\n      goto Exit;\n\n    if ( cur_len <= threshold )\n    {\n      if ( d_off2 < cur_len )\n      {\n        if ( u_off1 <= d_off2 )\n          delta =  u_off1;\n        else\n          delta = -d_off2;\n      }\n\n      goto Exit;\n    }\n\n    if ( threshold < 64 )\n    {\n      if ( d_off1 >= threshold || u_off1 >= threshold ||\n           d_off2 >= threshold || u_off2 >= threshold )\n        goto Exit;\n    }\n\n    offset = cur_len & 63;\n\n    if ( offset < 32 )\n    {\n      if ( u_off1 <= offset || d_off2 <= offset )\n        goto Exit;\n    }\n    else\n      offset = 64 - threshold;\n\n    d_off1 = threshold - u_off1;\n    u_off1 = u_off1    - offset;\n    u_off2 = threshold - d_off2;\n    d_off2 = d_off2    - offset;\n\n    if ( d_off1 <= u_off1 )\n      u_off1 = -d_off1;\n\n    if ( d_off2 <= u_off2 )\n      u_off2 = -d_off2;\n\n    if ( FT_ABS( u_off1 ) <= FT_ABS( u_off2 ) )\n      delta = u_off1;\n    else\n      delta = u_off2;\n\n  Exit:\n\n#if 1\n    if ( !AF_LATIN_HINTS_DO_STEM_ADJUST( hints ) )\n    {\n      if ( delta > AF_LIGHT_MODE_MAX_DELTA_ABS )\n        delta = AF_LIGHT_MODE_MAX_DELTA_ABS;\n      else if ( delta < -AF_LIGHT_MODE_MAX_DELTA_ABS )\n        delta = -AF_LIGHT_MODE_MAX_DELTA_ABS;\n    }\n#endif\n\n    cur_pos1 += delta;\n\n    if ( edge->opos < edge2->opos )\n    {\n      edge->pos  = cur_pos1;\n      edge2->pos = cur_pos1 + cur_len;\n    }\n    else\n    {\n      edge->pos  = cur_pos1 + cur_len;\n      edge2->pos = cur_pos1;\n    }\n\n    return delta;\n  }\n\n\n  /* The main grid-fitting routine. */\n\n  static void\n  af_cjk_hint_edges( AF_GlyphHints  hints,\n                     AF_Dimension   dim )\n  {\n    AF_AxisHints  axis       = &hints->axis[dim];\n    AF_Edge       edges      = axis->edges;\n    AF_Edge       edge_limit = edges + axis->num_edges;\n    FT_PtrDist    n_edges;\n    AF_Edge       edge;\n    AF_Edge       anchor   = 0;\n    FT_Pos        delta    = 0;\n    FT_Int        skipped  = 0;\n    FT_Bool       has_last_stem = FALSE;\n    FT_Pos        last_stem_pos = 0;\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n    FT_UInt       num_actions = 0;\n#endif\n\n\n    FT_TRACE5(( \"cjk %s edge hinting (style `%s')\\n\",\n                dim == AF_DIMENSION_VERT ? \"horizontal\" : \"vertical\",\n                af_style_names[hints->metrics->style_class->style] ));\n\n    /* we begin by aligning all stems relative to the blue zone */\n\n    if ( AF_HINTS_DO_BLUES( hints ) )\n    {\n      for ( edge = edges; edge < edge_limit; edge++ )\n      {\n        AF_Width  blue;\n        AF_Edge   edge1, edge2;\n\n\n        if ( edge->flags & AF_EDGE_DONE )\n          continue;\n\n        blue  = edge->blue_edge;\n        edge1 = NULL;\n        edge2 = edge->link;\n\n        if ( blue )\n        {\n          edge1 = edge;\n        }\n        else if ( edge2 && edge2->blue_edge )\n        {\n          blue  = edge2->blue_edge;\n          edge1 = edge2;\n          edge2 = edge;\n        }\n\n        if ( !edge1 )\n          continue;\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n        FT_TRACE5(( \"  CJKBLUE: edge %d @%d (opos=%.2f) snapped to %.2f,\"\n                    \" was %.2f\\n\",\n                    edge1 - edges, edge1->fpos, edge1->opos / 64.0,\n                    blue->fit / 64.0, edge1->pos / 64.0 ));\n\n        num_actions++;\n#endif\n\n        edge1->pos    = blue->fit;\n        edge1->flags |= AF_EDGE_DONE;\n\n        if ( edge2 && !edge2->blue_edge )\n        {\n          af_cjk_align_linked_edge( hints, dim, edge1, edge2 );\n          edge2->flags |= AF_EDGE_DONE;\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n          num_actions++;\n#endif\n        }\n\n        if ( !anchor )\n          anchor = edge;\n      }\n    }\n\n    /* now we align all stem edges. */\n    for ( edge = edges; edge < edge_limit; edge++ )\n    {\n      AF_Edge  edge2;\n\n\n      if ( edge->flags & AF_EDGE_DONE )\n        continue;\n\n      /* skip all non-stem edges */\n      edge2 = edge->link;\n      if ( !edge2 )\n      {\n        skipped++;\n        continue;\n      }\n\n      /* Some CJK characters have so many stems that\n       * the hinter is likely to merge two adjacent ones.\n       * To solve this problem, if either edge of a stem\n       * is too close to the previous one, we avoid\n       * aligning the two edges, but rather interpolate\n       * their locations at the end of this function in\n       * order to preserve the space between the stems.\n       */\n      if ( has_last_stem                       &&\n           ( edge->pos  < last_stem_pos + 64 ||\n             edge2->pos < last_stem_pos + 64 ) )\n      {\n        skipped++;\n        continue;\n      }\n\n      /* now align the stem */\n\n      /* this should not happen, but it's better to be safe */\n      if ( edge2->blue_edge )\n      {\n        FT_TRACE5(( \"ASSERTION FAILED for edge %d\\n\", edge2-edges ));\n\n        af_cjk_align_linked_edge( hints, dim, edge2, edge );\n        edge->flags |= AF_EDGE_DONE;\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n        num_actions++;\n#endif\n\n        continue;\n      }\n\n      if ( edge2 < edge )\n      {\n        af_cjk_align_linked_edge( hints, dim, edge2, edge );\n        edge->flags |= AF_EDGE_DONE;\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n        num_actions++;\n#endif\n\n        /* We rarely reaches here it seems;\n         * usually the two edges belonging\n         * to one stem are marked as DONE together\n         */\n        has_last_stem = TRUE;\n        last_stem_pos = edge->pos;\n        continue;\n      }\n\n      if ( dim != AF_DIMENSION_VERT && !anchor )\n      {\n\n#if 0\n        if ( fixedpitch )\n        {\n          AF_Edge     left  = edge;\n          AF_Edge     right = edge_limit - 1;\n          AF_EdgeRec  left1, left2, right1, right2;\n          FT_Pos      target, center1, center2;\n          FT_Pos      delta1, delta2, d1, d2;\n\n\n          while ( right > left && !right->link )\n            right--;\n\n          left1  = *left;\n          left2  = *left->link;\n          right1 = *right->link;\n          right2 = *right;\n\n          delta  = ( ( ( hinter->pp2.x + 32 ) & -64 ) - hinter->pp2.x ) / 2;\n          target = left->opos + ( right->opos - left->opos ) / 2 + delta - 16;\n\n          delta1  = delta;\n          delta1 += af_hint_normal_stem( hints, left, left->link,\n                                         delta1, 0 );\n\n          if ( left->link != right )\n            af_hint_normal_stem( hints, right->link, right, delta1, 0 );\n\n          center1 = left->pos + ( right->pos - left->pos ) / 2;\n\n          if ( center1 >= target )\n            delta2 = delta - 32;\n          else\n            delta2 = delta + 32;\n\n          delta2 += af_hint_normal_stem( hints, &left1, &left2, delta2, 0 );\n\n          if ( delta1 != delta2 )\n          {\n            if ( left->link != right )\n              af_hint_normal_stem( hints, &right1, &right2, delta2, 0 );\n\n            center2 = left1.pos + ( right2.pos - left1.pos ) / 2;\n\n            d1 = center1 - target;\n            d2 = center2 - target;\n\n            if ( FT_ABS( d2 ) < FT_ABS( d1 ) )\n            {\n              left->pos       = left1.pos;\n              left->link->pos = left2.pos;\n\n              if ( left->link != right )\n              {\n                right->link->pos = right1.pos;\n                right->pos       = right2.pos;\n              }\n\n              delta1 = delta2;\n            }\n          }\n\n          delta               = delta1;\n          right->link->flags |= AF_EDGE_DONE;\n          right->flags       |= AF_EDGE_DONE;\n        }\n        else\n\n#endif /* 0 */\n\n          delta = af_hint_normal_stem( hints, edge, edge2, 0,\n                                       AF_DIMENSION_HORZ );\n      }\n      else\n        af_hint_normal_stem( hints, edge, edge2, delta, dim );\n\n#if 0\n      printf( \"stem (%d,%d) adjusted (%.1f,%.1f)\\n\",\n               edge - edges, edge2 - edges,\n               ( edge->pos - edge->opos ) / 64.0,\n               ( edge2->pos - edge2->opos ) / 64.0 );\n#endif\n\n      anchor = edge;\n      edge->flags  |= AF_EDGE_DONE;\n      edge2->flags |= AF_EDGE_DONE;\n      has_last_stem = TRUE;\n      last_stem_pos = edge2->pos;\n    }\n\n    /* make sure that lowercase m's maintain their symmetry */\n\n    /* In general, lowercase m's have six vertical edges if they are sans */\n    /* serif, or twelve if they are with serifs.  This implementation is  */\n    /* based on that assumption, and seems to work very well with most    */\n    /* faces.  However, if for a certain face this assumption is not      */\n    /* true, the m is just rendered like before.  In addition, any stem   */\n    /* correction will only be applied to symmetrical glyphs (even if the */\n    /* glyph is not an m), so the potential for unwanted distortion is    */\n    /* relatively low.                                                    */\n\n    /* We don't handle horizontal edges since we can't easily assure that */\n    /* the third (lowest) stem aligns with the base line; it might end up */\n    /* one pixel higher or lower.                                         */\n\n    n_edges = edge_limit - edges;\n    if ( dim == AF_DIMENSION_HORZ && ( n_edges == 6 || n_edges == 12 ) )\n    {\n      AF_Edge  edge1, edge2, edge3;\n      FT_Pos   dist1, dist2, span;\n\n\n      if ( n_edges == 6 )\n      {\n        edge1 = edges;\n        edge2 = edges + 2;\n        edge3 = edges + 4;\n      }\n      else\n      {\n        edge1 = edges + 1;\n        edge2 = edges + 5;\n        edge3 = edges + 9;\n      }\n\n      dist1 = edge2->opos - edge1->opos;\n      dist2 = edge3->opos - edge2->opos;\n\n      span = dist1 - dist2;\n      if ( span < 0 )\n        span = -span;\n\n      if ( edge1->link == edge1 + 1 &&\n           edge2->link == edge2 + 1 &&\n           edge3->link == edge3 + 1 && span < 8 )\n      {\n        delta = edge3->pos - ( 2 * edge2->pos - edge1->pos );\n        edge3->pos -= delta;\n        if ( edge3->link )\n          edge3->link->pos -= delta;\n\n        /* move the serifs along with the stem */\n        if ( n_edges == 12 )\n        {\n          ( edges + 8 )->pos -= delta;\n          ( edges + 11 )->pos -= delta;\n        }\n\n        edge3->flags |= AF_EDGE_DONE;\n        if ( edge3->link )\n          edge3->link->flags |= AF_EDGE_DONE;\n      }\n    }\n\n    if ( !skipped )\n      goto Exit;\n\n    /*\n     *  now hint the remaining edges (serifs and single) in order\n     *  to complete our processing\n     */\n    for ( edge = edges; edge < edge_limit; edge++ )\n    {\n      if ( edge->flags & AF_EDGE_DONE )\n        continue;\n\n      if ( edge->serif )\n      {\n        af_cjk_align_serif_edge( hints, edge->serif, edge );\n        edge->flags |= AF_EDGE_DONE;\n        skipped--;\n      }\n    }\n\n    if ( !skipped )\n      goto Exit;\n\n    for ( edge = edges; edge < edge_limit; edge++ )\n    {\n      AF_Edge  before, after;\n\n\n      if ( edge->flags & AF_EDGE_DONE )\n        continue;\n\n      before = after = edge;\n\n      while ( --before >= edges )\n        if ( before->flags & AF_EDGE_DONE )\n          break;\n\n      while ( ++after < edge_limit )\n        if ( after->flags & AF_EDGE_DONE )\n          break;\n\n      if ( before >= edges || after < edge_limit )\n      {\n        if ( before < edges )\n          af_cjk_align_serif_edge( hints, after, edge );\n        else if ( after >= edge_limit )\n          af_cjk_align_serif_edge( hints, before, edge );\n        else\n        {\n          if ( after->fpos == before->fpos )\n            edge->pos = before->pos;\n          else\n            edge->pos = before->pos +\n                        FT_MulDiv( edge->fpos - before->fpos,\n                                   after->pos - before->pos,\n                                   after->fpos - before->fpos );\n        }\n      }\n    }\n\n  Exit:\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n    if ( !num_actions )\n      FT_TRACE5(( \"  (none)\\n\" ));\n    FT_TRACE5(( \"\\n\" ));\n#endif\n\n    return;\n  }\n\n\n  static void\n  af_cjk_align_edge_points( AF_GlyphHints  hints,\n                            AF_Dimension   dim )\n  {\n    AF_AxisHints  axis       = & hints->axis[dim];\n    AF_Edge       edges      = axis->edges;\n    AF_Edge       edge_limit = edges + axis->num_edges;\n    AF_Edge       edge;\n    FT_Bool       snapping;\n\n\n    snapping = FT_BOOL( ( dim == AF_DIMENSION_HORZ             &&\n                          AF_LATIN_HINTS_DO_HORZ_SNAP( hints ) )  ||\n                        ( dim == AF_DIMENSION_VERT             &&\n                          AF_LATIN_HINTS_DO_VERT_SNAP( hints ) )  );\n\n    for ( edge = edges; edge < edge_limit; edge++ )\n    {\n      /* move the points of each segment     */\n      /* in each edge to the edge's position */\n      AF_Segment  seg = edge->first;\n\n\n      if ( snapping )\n      {\n        do\n        {\n          AF_Point  point = seg->first;\n\n\n          for (;;)\n          {\n            if ( dim == AF_DIMENSION_HORZ )\n            {\n              point->x      = edge->pos;\n              point->flags |= AF_FLAG_TOUCH_X;\n            }\n            else\n            {\n              point->y      = edge->pos;\n              point->flags |= AF_FLAG_TOUCH_Y;\n            }\n\n            if ( point == seg->last )\n              break;\n\n            point = point->next;\n          }\n\n          seg = seg->edge_next;\n\n        } while ( seg != edge->first );\n      }\n      else\n      {\n        FT_Pos  delta = edge->pos - edge->opos;\n\n\n        do\n        {\n          AF_Point  point = seg->first;\n\n\n          for (;;)\n          {\n            if ( dim == AF_DIMENSION_HORZ )\n            {\n              point->x     += delta;\n              point->flags |= AF_FLAG_TOUCH_X;\n            }\n            else\n            {\n              point->y     += delta;\n              point->flags |= AF_FLAG_TOUCH_Y;\n            }\n\n            if ( point == seg->last )\n              break;\n\n            point = point->next;\n          }\n\n          seg = seg->edge_next;\n\n        } while ( seg != edge->first );\n      }\n    }\n  }\n\n\n  /* Apply the complete hinting algorithm to a CJK glyph. */\n\n  FT_LOCAL_DEF( FT_Error )\n  af_cjk_hints_apply( AF_GlyphHints  hints,\n                      FT_Outline*    outline,\n                      AF_CJKMetrics  metrics )\n  {\n    FT_Error  error;\n    int       dim;\n\n    FT_UNUSED( metrics );\n\n\n    error = af_glyph_hints_reload( hints, outline );\n    if ( error )\n      goto Exit;\n\n    /* analyze glyph outline */\n    if ( AF_HINTS_DO_HORIZONTAL( hints ) )\n    {\n      error = af_cjk_hints_detect_features( hints, AF_DIMENSION_HORZ );\n      if ( error )\n        goto Exit;\n\n      af_cjk_hints_compute_blue_edges( hints, metrics, AF_DIMENSION_HORZ );\n    }\n\n    if ( AF_HINTS_DO_VERTICAL( hints ) )\n    {\n      error = af_cjk_hints_detect_features( hints, AF_DIMENSION_VERT );\n      if ( error )\n        goto Exit;\n\n      af_cjk_hints_compute_blue_edges( hints, metrics, AF_DIMENSION_VERT );\n    }\n\n    /* grid-fit the outline */\n    for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )\n    {\n      if ( ( dim == AF_DIMENSION_HORZ && AF_HINTS_DO_HORIZONTAL( hints ) ) ||\n           ( dim == AF_DIMENSION_VERT && AF_HINTS_DO_VERTICAL( hints ) )   )\n      {\n\n#ifdef AF_CONFIG_OPTION_USE_WARPER\n        if ( dim == AF_DIMENSION_HORZ                                  &&\n             metrics->root.scaler.render_mode == FT_RENDER_MODE_NORMAL )\n        {\n          AF_WarperRec  warper;\n          FT_Fixed      scale;\n          FT_Pos        delta;\n\n\n          af_warper_compute( &warper, hints, (AF_Dimension)dim,\n                             &scale, &delta );\n          af_glyph_hints_scale_dim( hints, (AF_Dimension)dim,\n                                    scale, delta );\n          continue;\n        }\n#endif /* AF_CONFIG_OPTION_USE_WARPER */\n\n        af_cjk_hint_edges( hints, (AF_Dimension)dim );\n        af_cjk_align_edge_points( hints, (AF_Dimension)dim );\n        af_glyph_hints_align_strong_points( hints, (AF_Dimension)dim );\n        af_glyph_hints_align_weak_points( hints, (AF_Dimension)dim );\n      }\n    }\n\n#if 0\n    af_glyph_hints_dump_points( hints );\n    af_glyph_hints_dump_segments( hints );\n    af_glyph_hints_dump_edges( hints );\n#endif\n\n    af_glyph_hints_save( hints, outline );\n\n  Exit:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                C J K   S C R I P T   C L A S S                *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  AF_DEFINE_WRITING_SYSTEM_CLASS(\n    af_cjk_writing_system_class,\n\n    AF_WRITING_SYSTEM_CJK,\n\n    sizeof ( AF_CJKMetricsRec ),\n\n    (AF_WritingSystem_InitMetricsFunc) af_cjk_metrics_init,\n    (AF_WritingSystem_ScaleMetricsFunc)af_cjk_metrics_scale,\n    (AF_WritingSystem_DoneMetricsFunc) NULL,\n\n    (AF_WritingSystem_InitHintsFunc)   af_cjk_hints_init,\n    (AF_WritingSystem_ApplyHintsFunc)  af_cjk_hints_apply\n  )\n\n\n#else /* !AF_CONFIG_OPTION_CJK */\n\n\n  AF_DEFINE_WRITING_SYSTEM_CLASS(\n    af_cjk_writing_system_class,\n\n    AF_WRITING_SYSTEM_CJK,\n\n    sizeof ( AF_CJKMetricsRec ),\n\n    (AF_WritingSystem_InitMetricsFunc) NULL,\n    (AF_WritingSystem_ScaleMetricsFunc)NULL,\n    (AF_WritingSystem_DoneMetricsFunc) NULL,\n\n    (AF_WritingSystem_InitHintsFunc)   NULL,\n    (AF_WritingSystem_ApplyHintsFunc)  NULL\n  )\n\n\n#endif /* !AF_CONFIG_OPTION_CJK */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afcjk.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afcjk.h                                                                */\n/*                                                                         */\n/*    Auto-fitter hinting routines for CJK writing system (specification). */\n/*                                                                         */\n/*  Copyright 2006, 2007, 2011-2014 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __AFCJK_H__\n#define __AFCJK_H__\n\n#include \"afhints.h\"\n#include \"aflatin.h\"\n\n\nFT_BEGIN_HEADER\n\n\n  /* the CJK-specific writing system */\n\n  AF_DECLARE_WRITING_SYSTEM_CLASS( af_cjk_writing_system_class )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****              C J K   G L O B A L   M E T R I C S              *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*\n   *  CJK glyphs tend to fill the square.  So we have both vertical and\n   *  horizontal blue zones.  But some glyphs have flat bounding strokes that\n   *  leave some space between neighbour glyphs.\n   */\n\n#define AF_CJK_IS_TOP_BLUE( b ) \\\n          ( (b)->properties & AF_BLUE_PROPERTY_CJK_TOP )\n#define AF_CJK_IS_HORIZ_BLUE( b ) \\\n          ( (b)->properties & AF_BLUE_PROPERTY_CJK_HORIZ )\n#define AF_CJK_IS_RIGHT_BLUE  AF_CJK_IS_TOP_BLUE\n\n#define AF_CJK_MAX_WIDTHS  16\n\n\n  enum\n  {\n    AF_CJK_BLUE_ACTIVE     = 1 << 0,  /* set if zone height is <= 3/4px */\n    AF_CJK_BLUE_TOP        = 1 << 1,  /* result of AF_CJK_IS_TOP_BLUE   */\n    AF_CJK_BLUE_ADJUSTMENT = 1 << 2,  /* used for scale adjustment      */\n                                      /* optimization                   */\n    AF_CJK_BLUE_FLAG_MAX\n  };\n\n\n  typedef struct  AF_CJKBlueRec_\n  {\n    AF_WidthRec  ref;\n    AF_WidthRec  shoot; /* undershoot */\n    FT_UInt      flags;\n\n  } AF_CJKBlueRec, *AF_CJKBlue;\n\n\n  typedef struct  AF_CJKAxisRec_\n  {\n    FT_Fixed       scale;\n    FT_Pos         delta;\n\n    FT_UInt        width_count;                   /* number of used widths */\n    AF_WidthRec    widths[AF_CJK_MAX_WIDTHS];     /* widths array          */\n    FT_Pos         edge_distance_threshold;     /* used for creating edges */\n    FT_Pos         standard_width;           /* the default stem thickness */\n    FT_Bool        extra_light;           /* is standard width very light? */\n\n    /* used for horizontal metrics too for CJK */\n    FT_Bool        control_overshoot;\n    FT_UInt        blue_count;\n    AF_CJKBlueRec  blues[AF_BLUE_STRINGSET_MAX];\n\n    FT_Fixed       org_scale;\n    FT_Pos         org_delta;\n\n  } AF_CJKAxisRec, *AF_CJKAxis;\n\n\n  typedef struct  AF_CJKMetricsRec_\n  {\n    AF_StyleMetricsRec  root;\n    FT_UInt             units_per_em;\n    AF_CJKAxisRec       axis[AF_DIMENSION_MAX];\n\n  } AF_CJKMetricsRec, *AF_CJKMetrics;\n\n\n#ifdef AF_CONFIG_OPTION_CJK\n  FT_LOCAL( FT_Error )\n  af_cjk_metrics_init( AF_CJKMetrics  metrics,\n                       FT_Face        face );\n\n  FT_LOCAL( void )\n  af_cjk_metrics_scale( AF_CJKMetrics  metrics,\n                        AF_Scaler      scaler );\n\n  FT_LOCAL( FT_Error )\n  af_cjk_hints_init( AF_GlyphHints  hints,\n                     AF_CJKMetrics  metrics );\n\n  FT_LOCAL( FT_Error )\n  af_cjk_hints_apply( AF_GlyphHints  hints,\n                      FT_Outline*    outline,\n                      AF_CJKMetrics  metrics );\n\n  /* shared; called from afindic.c */\n  FT_LOCAL( void )\n  af_cjk_metrics_check_digits( AF_CJKMetrics  metrics,\n                               FT_Face        face );\n\n  FT_LOCAL( void )\n  af_cjk_metrics_init_widths( AF_CJKMetrics  metrics,\n                              FT_Face        face );\n#endif /* AF_CONFIG_OPTION_CJK */\n\n\n/* */\n\nFT_END_HEADER\n\n#endif /* __AFCJK_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afcover.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afcover.h                                                              */\n/*                                                                         */\n/*    Auto-fitter coverages (specification only).                          */\n/*                                                                         */\n/*  Copyright 2013, 2014 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /* This header file can be included multiple times. */\n  /* Define `COVERAGE' as needed.                     */\n\n\n  /* Add new coverages here.  The first and second arguments are the   */\n  /* coverage name in lowercase and uppercase, respectively, followed  */\n  /* by a description string.  The last four arguments are the four    */\n  /* characters defining the corresponding OpenType feature.           */\n\n#if 0\n  /* XXX: It's not possible to define blue zone characters in advance. */\n  COVERAGE( alternative_fractions, ALTERNATIVE_FRACTIONS,\n            \"alternative fractions\",\n            'a', 'f', 'r', 'c' )\n#endif\n\n  COVERAGE( petite_capitals_from_capitals, PETITE_CAPITALS_FROM_CAPITALS,\n            \"petite capitals from capitals\",\n            'c', '2', 'c', 'p' )\n\n  COVERAGE( small_capitals_from_capitals, SMALL_CAPITALS_FROM_CAPITALS,\n            \"small capitals from capitals\",\n            'c', '2', 's', 'c' )\n\n#if 0\n  /* XXX: Only digits are in this coverage, however, both normal style */\n  /*      and oldstyle representation forms are possible.              */\n  COVERAGE( denominators, DENOMINATORS,\n            \"denominators\",\n            'd', 'n', 'o', 'm' )\n#endif\n\n#if 0\n  /* XXX: It's not possible to define blue zone characters in advance. */\n  COVERAGE( fractions, FRACTIONS,\n            \"fractions\",\n            'f', 'r', 'a', 'c' )\n#endif\n\n#if 0\n  /* XXX: Only digits are in this coverage, however, both normal style */\n  /*      and oldstyle representation forms are possible.              */\n  COVERAGE( numerators, NUMERATORS,\n            \"numerators\",\n            'n', 'u', 'm', 'r' )\n#endif\n\n  COVERAGE( ordinals, ORDINALS,\n            \"ordinals\",\n            'o', 'r', 'd', 'n' )\n\n  COVERAGE( petite_capitals, PETITE_CAPITALS,\n            \"petite capitals\",\n            'p', 'c', 'a', 'p' )\n\n  COVERAGE( ruby, RUBY,\n            \"ruby\",\n            'r', 'u', 'b', 'y' )\n\n  COVERAGE( scientific_inferiors, SCIENTIFIC_INFERIORS,\n            \"scientific inferiors\",\n            's', 'i', 'n', 'f' )\n\n  COVERAGE( small_capitals, SMALL_CAPITALS,\n            \"small capitals\",\n            's', 'm', 'c', 'p' )\n\n  COVERAGE( subscript, SUBSCRIPT,\n            \"subscript\",\n            's', 'u', 'b', 's' )\n\n  COVERAGE( superscript, SUPERSCRIPT,\n            \"superscript\",\n            's', 'u', 'p', 's' )\n\n  COVERAGE( titling, TITLING,\n            \"titling\",\n            't', 'i', 't', 'l' )\n\n#if 0\n  /* to be always excluded */\n  COVERAGE(nalt, 'n', 'a', 'l', 't'); /* Alternate Annotation Forms (?) */\n  COVERAGE(ornm, 'o', 'r', 'n', 'm'); /* Ornaments (?) */\n#endif\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afdummy.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afdummy.c                                                              */\n/*                                                                         */\n/*    Auto-fitter dummy routines to be used if no hinting should be        */\n/*    performed (body).                                                    */\n/*                                                                         */\n/*  Copyright 2003-2005, 2011, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"afdummy.h\"\n#include \"afhints.h\"\n#include \"aferrors.h\"\n\n\n  static FT_Error\n  af_dummy_hints_init( AF_GlyphHints    hints,\n                       AF_StyleMetrics  metrics )\n  {\n    af_glyph_hints_rescale( hints, metrics );\n\n    hints->x_scale = metrics->scaler.x_scale;\n    hints->y_scale = metrics->scaler.y_scale;\n    hints->x_delta = metrics->scaler.x_delta;\n    hints->y_delta = metrics->scaler.y_delta;\n\n    return FT_Err_Ok;\n  }\n\n\n  static FT_Error\n  af_dummy_hints_apply( AF_GlyphHints  hints,\n                        FT_Outline*    outline )\n  {\n    FT_Error  error;\n\n\n    error = af_glyph_hints_reload( hints, outline );\n    if ( !error )\n      af_glyph_hints_save( hints, outline );\n\n    return error;\n  }\n\n\n  AF_DEFINE_WRITING_SYSTEM_CLASS(\n    af_dummy_writing_system_class,\n\n    AF_WRITING_SYSTEM_DUMMY,\n\n    sizeof ( AF_StyleMetricsRec ),\n\n    (AF_WritingSystem_InitMetricsFunc) NULL,\n    (AF_WritingSystem_ScaleMetricsFunc)NULL,\n    (AF_WritingSystem_DoneMetricsFunc) NULL,\n\n    (AF_WritingSystem_InitHintsFunc)   af_dummy_hints_init,\n    (AF_WritingSystem_ApplyHintsFunc)  af_dummy_hints_apply\n  )\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afdummy.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afdummy.h                                                              */\n/*                                                                         */\n/*    Auto-fitter dummy routines to be used if no hinting should be        */\n/*    performed (specification).                                           */\n/*                                                                         */\n/*  Copyright 2003-2005, 2011, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __AFDUMMY_H__\n#define __AFDUMMY_H__\n\n#include \"aftypes.h\"\n\n\nFT_BEGIN_HEADER\n\n  /* A dummy writing system used when no hinting should be performed. */\n\n  AF_DECLARE_WRITING_SYSTEM_CLASS( af_dummy_writing_system_class )\n\n/* */\n\nFT_END_HEADER\n\n\n#endif /* __AFDUMMY_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/aferrors.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  aferrors.h                                                             */\n/*                                                                         */\n/*    Autofitter error codes (specification only).                         */\n/*                                                                         */\n/*  Copyright 2005, 2012 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the Autofitter error enumeration          */\n  /* constants.                                                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __AFERRORS_H__\n#define __AFERRORS_H__\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  AF_Err_\n#define FT_ERR_BASE    FT_Mod_Err_Autofit\n\n#include FT_ERRORS_H\n\n#endif /* __AFERRORS_H__ */\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afglobal.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afglobal.c                                                             */\n/*                                                                         */\n/*    Auto-fitter routines to compute global hinting values (body).        */\n/*                                                                         */\n/*  Copyright 2003-2014 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"afglobal.h\"\n#include \"afranges.h\"\n#include \"hbshim.h\"\n#include FT_INTERNAL_DEBUG_H\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_afglobal\n\n\n  /* get writing system specific header files */\n#undef  WRITING_SYSTEM\n#define WRITING_SYSTEM( ws, WS )  /* empty */\n#include \"afwrtsys.h\"\n\n#include \"aferrors.h\"\n#include \"afpic.h\"\n\n\n#undef  SCRIPT\n#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \\\n          AF_DEFINE_SCRIPT_CLASS(           \\\n            af_ ## s ## _script_class,      \\\n            AF_SCRIPT_ ## S,                \\\n            af_ ## s ## _uniranges,         \\\n            sc1, sc2, sc3 )\n\n#include \"afscript.h\"\n\n\n#undef  STYLE\n#define STYLE( s, S, d, ws, sc, ss, c )  \\\n          AF_DEFINE_STYLE_CLASS(         \\\n            af_ ## s ## _style_class,    \\\n            AF_STYLE_ ## S,              \\\n            ws,                          \\\n            sc,                          \\\n            ss,                          \\\n            c )\n\n#include \"afstyles.h\"\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#undef  WRITING_SYSTEM\n#define WRITING_SYSTEM( ws, WS )               \\\n          &af_ ## ws ## _writing_system_class,\n\n  FT_LOCAL_ARRAY_DEF( AF_WritingSystemClass )\n  af_writing_system_classes[] =\n  {\n\n#include \"afwrtsys.h\"\n\n    NULL  /* do not remove */\n  };\n\n\n#undef  SCRIPT\n#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \\\n          &af_ ## s ## _script_class,\n\n  FT_LOCAL_ARRAY_DEF( AF_ScriptClass )\n  af_script_classes[] =\n  {\n\n#include \"afscript.h\"\n\n    NULL  /* do not remove */\n  };\n\n\n#undef  STYLE\n#define STYLE( s, S, d, ws, sc, ss, c ) \\\n          &af_ ## s ## _style_class,\n\n  FT_LOCAL_ARRAY_DEF( AF_StyleClass )\n  af_style_classes[] =\n  {\n\n#include \"afstyles.h\"\n\n    NULL  /* do not remove */\n  };\n\n#endif /* !FT_CONFIG_OPTION_PIC */\n\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n#undef  STYLE\n#define STYLE( s, S, d, ws, sc, ss, c )  #s,\n\n  FT_LOCAL_ARRAY_DEF( char* )\n  af_style_names[] =\n  {\n\n#include \"afstyles.h\"\n\n  };\n\n#endif /* FT_DEBUG_LEVEL_TRACE */\n\n\n  /* Compute the style index of each glyph within a given face. */\n\n  static FT_Error\n  af_face_globals_compute_style_coverage( AF_FaceGlobals  globals )\n  {\n    FT_Error    error;\n    FT_Face     face        = globals->face;\n    FT_CharMap  old_charmap = face->charmap;\n    FT_Byte*    gstyles     = globals->glyph_styles;\n    FT_UInt     ss;\n    FT_UInt     i;\n    FT_UInt     dflt        = ~0U; /* a non-valid value */\n\n\n    /* the value AF_STYLE_UNASSIGNED means `uncovered glyph' */\n    FT_MEM_SET( globals->glyph_styles,\n                AF_STYLE_UNASSIGNED,\n                globals->glyph_count );\n\n    error = FT_Select_Charmap( face, FT_ENCODING_UNICODE );\n    if ( error )\n    {\n      /*\n       * Ignore this error; we simply use the fallback style.\n       * XXX: Shouldn't we rather disable hinting?\n       */\n      error = FT_Err_Ok;\n      goto Exit;\n    }\n\n    /* scan each style in a Unicode charmap */\n    for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )\n    {\n      AF_StyleClass       style_class =\n                            AF_STYLE_CLASSES_GET[ss];\n      AF_ScriptClass      script_class =\n                            AF_SCRIPT_CLASSES_GET[style_class->script];\n      AF_Script_UniRange  range;\n\n\n      if ( script_class->script_uni_ranges == NULL )\n        continue;\n\n      /*\n       *  Scan all Unicode points in the range and set the corresponding\n       *  glyph style index.\n       */\n      if ( style_class->coverage == AF_COVERAGE_DEFAULT )\n      {\n        if ( (FT_UInt)style_class->script ==\n             globals->module->default_script )\n          dflt = ss;\n\n        for ( range = script_class->script_uni_ranges;\n              range->first != 0;\n              range++ )\n        {\n          FT_ULong  charcode = range->first;\n          FT_UInt   gindex;\n\n\n          gindex = FT_Get_Char_Index( face, charcode );\n\n          if ( gindex != 0                             &&\n               gindex < (FT_ULong)globals->glyph_count &&\n               gstyles[gindex] == AF_STYLE_UNASSIGNED  )\n            gstyles[gindex] = (FT_Byte)ss;\n\n          for (;;)\n          {\n            charcode = FT_Get_Next_Char( face, charcode, &gindex );\n\n            if ( gindex == 0 || charcode > range->last )\n              break;\n\n            if ( gindex < (FT_ULong)globals->glyph_count &&\n                 gstyles[gindex] == AF_STYLE_UNASSIGNED  )\n              gstyles[gindex] = (FT_Byte)ss;\n          }\n        }\n      }\n      else\n      {\n        /* get glyphs not directly addressable by cmap */\n        af_get_coverage( globals, style_class, gstyles );\n      }\n    }\n\n    /* handle the default OpenType features of the default script ... */\n    af_get_coverage( globals, AF_STYLE_CLASSES_GET[dflt], gstyles );\n\n    /* ... and the remaining default OpenType features */\n    for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )\n    {\n      AF_StyleClass  style_class = AF_STYLE_CLASSES_GET[ss];\n\n\n      if ( ss != dflt && style_class->coverage == AF_COVERAGE_DEFAULT )\n        af_get_coverage( globals, style_class, gstyles );\n    }\n\n    /* mark ASCII digits */\n    for ( i = 0x30; i <= 0x39; i++ )\n    {\n      FT_UInt  gindex = FT_Get_Char_Index( face, i );\n\n\n      if ( gindex != 0 && gindex < (FT_ULong)globals->glyph_count )\n        gstyles[gindex] |= AF_DIGIT;\n    }\n\n  Exit:\n    /*\n     *  By default, all uncovered glyphs are set to the fallback style.\n     *  XXX: Shouldn't we disable hinting or do something similar?\n     */\n    if ( globals->module->fallback_style != AF_STYLE_UNASSIGNED )\n    {\n      FT_Long  nn;\n\n\n      for ( nn = 0; nn < globals->glyph_count; nn++ )\n      {\n        if ( ( gstyles[nn] & ~AF_DIGIT ) == AF_STYLE_UNASSIGNED )\n        {\n          gstyles[nn] &= ~AF_STYLE_UNASSIGNED;\n          gstyles[nn] |= globals->module->fallback_style;\n        }\n      }\n    }\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n    FT_TRACE4(( \"\\n\"\n                \"style coverage\\n\"\n                \"==============\\n\"\n                \"\\n\" ));\n\n    for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )\n    {\n      AF_StyleClass  style_class = AF_STYLE_CLASSES_GET[ss];\n      FT_UInt        count       = 0;\n      FT_Long        idx;\n\n\n      FT_TRACE4(( \"%s:\\n\", af_style_names[style_class->style] ));\n\n      for ( idx = 0; idx < globals->glyph_count; idx++ )\n      {\n        if ( ( gstyles[idx] & ~AF_DIGIT ) == style_class->style )\n        {\n          if ( !( count % 10 ) )\n            FT_TRACE4(( \" \" ));\n\n          FT_TRACE4(( \" %d\", idx ));\n          count++;\n\n          if ( !( count % 10 ) )\n            FT_TRACE4(( \"\\n\" ));\n        }\n      }\n\n      if ( !count )\n        FT_TRACE4(( \"  (none)\\n\" ));\n      if ( count % 10 )\n        FT_TRACE4(( \"\\n\" ));\n    }\n\n#endif /* FT_DEBUG_LEVEL_TRACE */\n\n    FT_Set_Charmap( face, old_charmap );\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  af_face_globals_new( FT_Face          face,\n                       AF_FaceGlobals  *aglobals,\n                       AF_Module        module )\n  {\n    FT_Error        error;\n    FT_Memory       memory;\n    AF_FaceGlobals  globals = NULL;\n\n\n    memory = face->memory;\n\n    if ( FT_ALLOC( globals, sizeof ( *globals ) +\n                            face->num_glyphs * sizeof ( FT_Byte ) ) )\n      goto Exit;\n\n    globals->face         = face;\n    globals->glyph_count  = face->num_glyphs;\n    globals->glyph_styles = (FT_Byte*)( globals + 1 );\n    globals->module       = module;\n\n#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ\n    globals->hb_font = hb_ft_font_create( face, NULL );\n#endif\n\n    error = af_face_globals_compute_style_coverage( globals );\n    if ( error )\n    {\n      af_face_globals_free( globals );\n      globals = NULL;\n    }\n    else\n      globals->increase_x_height = AF_PROP_INCREASE_X_HEIGHT_MAX;\n\n  Exit:\n    *aglobals = globals;\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  af_face_globals_free( AF_FaceGlobals  globals )\n  {\n    if ( globals )\n    {\n      FT_Memory  memory = globals->face->memory;\n      FT_UInt    nn;\n\n\n      for ( nn = 0; nn < AF_STYLE_MAX; nn++ )\n      {\n        if ( globals->metrics[nn] )\n        {\n          AF_StyleClass          style_class =\n            AF_STYLE_CLASSES_GET[nn];\n          AF_WritingSystemClass  writing_system_class =\n            AF_WRITING_SYSTEM_CLASSES_GET[style_class->writing_system];\n\n\n          if ( writing_system_class->style_metrics_done )\n            writing_system_class->style_metrics_done( globals->metrics[nn] );\n\n          FT_FREE( globals->metrics[nn] );\n        }\n      }\n\n#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ\n      hb_font_destroy( globals->hb_font );\n      globals->hb_font = NULL;\n#endif\n\n      globals->glyph_count  = 0;\n      globals->glyph_styles = NULL;  /* no need to free this one! */\n      globals->face         = NULL;\n\n      FT_FREE( globals );\n    }\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  af_face_globals_get_metrics( AF_FaceGlobals    globals,\n                               FT_UInt           gindex,\n                               FT_UInt           options,\n                               AF_StyleMetrics  *ametrics )\n  {\n    AF_StyleMetrics  metrics = NULL;\n\n    AF_Style               style = (AF_Style)options;\n    AF_WritingSystemClass  writing_system_class;\n    AF_StyleClass          style_class;\n\n    FT_Error  error = FT_Err_Ok;\n\n\n    if ( gindex >= (FT_ULong)globals->glyph_count )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    /* if we have a forced style (via `options'), use it, */\n    /* otherwise look into `glyph_styles' array           */\n    if ( style == AF_STYLE_NONE_DFLT || style + 1 >= AF_STYLE_MAX )\n      style = (AF_Style)( globals->glyph_styles[gindex] &\n                          AF_STYLE_UNASSIGNED           );\n\n    style_class          = AF_STYLE_CLASSES_GET[style];\n    writing_system_class = AF_WRITING_SYSTEM_CLASSES_GET\n                             [style_class->writing_system];\n\n    metrics = globals->metrics[style];\n    if ( metrics == NULL )\n    {\n      /* create the global metrics object if necessary */\n      FT_Memory  memory = globals->face->memory;\n\n\n      if ( FT_ALLOC( metrics, writing_system_class->style_metrics_size ) )\n        goto Exit;\n\n      metrics->style_class = style_class;\n      metrics->globals     = globals;\n\n      if ( writing_system_class->style_metrics_init )\n      {\n        error = writing_system_class->style_metrics_init( metrics,\n                                                          globals->face );\n        if ( error )\n        {\n          if ( writing_system_class->style_metrics_done )\n            writing_system_class->style_metrics_done( metrics );\n\n          FT_FREE( metrics );\n          goto Exit;\n        }\n      }\n\n      globals->metrics[style] = metrics;\n    }\n\n  Exit:\n    *ametrics = metrics;\n\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Bool )\n  af_face_globals_is_digit( AF_FaceGlobals  globals,\n                            FT_UInt         gindex )\n  {\n    if ( gindex < (FT_ULong)globals->glyph_count )\n      return (FT_Bool)( globals->glyph_styles[gindex] & AF_DIGIT );\n\n    return (FT_Bool)0;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afglobal.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afglobal.h                                                             */\n/*                                                                         */\n/*    Auto-fitter routines to compute global hinting values                */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 2003-2005, 2007, 2009, 2011-2014 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __AFGLOBAL_H__\n#define __AFGLOBAL_H__\n\n\n#include \"aftypes.h\"\n#include \"afmodule.h\"\n#include \"hbshim.h\"\n\n\nFT_BEGIN_HEADER\n\n\n  FT_LOCAL_ARRAY( AF_WritingSystemClass )\n  af_writing_system_classes[];\n\n\n#undef  SCRIPT\n#define SCRIPT( s, S, d, h, sc1, sc2, sc3 )                    \\\n          AF_DECLARE_SCRIPT_CLASS( af_ ## s ## _script_class )\n\n#include \"afscript.h\"\n\n  FT_LOCAL_ARRAY( AF_ScriptClass )\n  af_script_classes[];\n\n\n#undef  STYLE\n#define STYLE( s, S, d, ws, sc, ss, c )                      \\\n          AF_DECLARE_STYLE_CLASS( af_ ## s ## _style_class )\n\n#include \"afstyles.h\"\n\n  FT_LOCAL_ARRAY( AF_StyleClass )\n  af_style_classes[];\n\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n  FT_LOCAL_ARRAY( char* )\n  af_style_names[];\n#endif\n\n\n  /*\n   *  Default values and flags for both autofitter globals (found in\n   *  AF_ModuleRec) and face globals (in AF_FaceGlobalsRec).\n   */\n\n  /* index of fallback style in `af_style_classes' */\n#ifdef AF_CONFIG_OPTION_CJK\n#define AF_STYLE_FALLBACK    AF_STYLE_HANI_DFLT\n#else\n#define AF_STYLE_FALLBACK    AF_STYLE_NONE_DFLT\n#endif\n  /* default script for OpenType; ignored if HarfBuzz isn't used */\n#define AF_SCRIPT_DEFAULT    AF_SCRIPT_LATN\n  /* a bit mask indicating an uncovered glyph        */\n#define AF_STYLE_UNASSIGNED  0x7F\n  /* if this flag is set, we have an ASCII digit     */\n#define AF_DIGIT             0x80\n\n  /* `increase-x-height' property */\n#define AF_PROP_INCREASE_X_HEIGHT_MIN  6\n#define AF_PROP_INCREASE_X_HEIGHT_MAX  0\n\n\n  /************************************************************************/\n  /************************************************************************/\n  /*****                                                              *****/\n  /*****                  F A C E   G L O B A L S                     *****/\n  /*****                                                              *****/\n  /************************************************************************/\n  /************************************************************************/\n\n\n  /*\n   *  Note that glyph_styles[] maps each glyph to an index into the\n   *  `af_style_classes' array.\n   *\n   */\n  typedef struct  AF_FaceGlobalsRec_\n  {\n    FT_Face          face;\n    FT_Long          glyph_count;    /* same as face->num_glyphs */\n    FT_Byte*         glyph_styles;\n\n#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ\n    hb_font_t*       hb_font;\n#endif\n\n    /* per-face auto-hinter properties */\n    FT_UInt          increase_x_height;\n\n    AF_StyleMetrics  metrics[AF_STYLE_MAX];\n\n    AF_Module        module;         /* to access global properties */\n\n  } AF_FaceGlobalsRec;\n\n\n  /*\n   *  model the global hints data for a given face, decomposed into\n   *  style-specific items\n   */\n\n  FT_LOCAL( FT_Error )\n  af_face_globals_new( FT_Face          face,\n                       AF_FaceGlobals  *aglobals,\n                       AF_Module        module );\n\n  FT_LOCAL( FT_Error )\n  af_face_globals_get_metrics( AF_FaceGlobals    globals,\n                               FT_UInt           gindex,\n                               FT_UInt           options,\n                               AF_StyleMetrics  *ametrics );\n\n  FT_LOCAL( void )\n  af_face_globals_free( AF_FaceGlobals  globals );\n\n  FT_LOCAL_DEF( FT_Bool )\n  af_face_globals_is_digit( AF_FaceGlobals  globals,\n                            FT_UInt         gindex );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __AFGLOBAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afhints.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afhints.c                                                              */\n/*                                                                         */\n/*    Auto-fitter hinting routines (body).                                 */\n/*                                                                         */\n/*  Copyright 2003-2007, 2009-2014 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"afhints.h\"\n#include \"aferrors.h\"\n#include FT_INTERNAL_CALC_H\n#include FT_INTERNAL_DEBUG_H\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_afhints\n\n\n  /* Get new segment for given axis. */\n\n  FT_LOCAL_DEF( FT_Error )\n  af_axis_hints_new_segment( AF_AxisHints  axis,\n                             FT_Memory     memory,\n                             AF_Segment   *asegment )\n  {\n    FT_Error    error   = FT_Err_Ok;\n    AF_Segment  segment = NULL;\n\n\n    if ( axis->num_segments >= axis->max_segments )\n    {\n      FT_Int  old_max = axis->max_segments;\n      FT_Int  new_max = old_max;\n      FT_Int  big_max = (FT_Int)( FT_INT_MAX / sizeof ( *segment ) );\n\n\n      if ( old_max >= big_max )\n      {\n        error = FT_THROW( Out_Of_Memory );\n        goto Exit;\n      }\n\n      new_max += ( new_max >> 2 ) + 4;\n      if ( new_max < old_max || new_max > big_max )\n        new_max = big_max;\n\n      if ( FT_RENEW_ARRAY( axis->segments, old_max, new_max ) )\n        goto Exit;\n\n      axis->max_segments = new_max;\n    }\n\n    segment = axis->segments + axis->num_segments++;\n\n  Exit:\n    *asegment = segment;\n    return error;\n  }\n\n\n  /* Get new edge for given axis, direction, and position, */\n  /* without initializing the edge itself.                 */\n\n  FT_LOCAL( FT_Error )\n  af_axis_hints_new_edge( AF_AxisHints  axis,\n                          FT_Int        fpos,\n                          AF_Direction  dir,\n                          FT_Memory     memory,\n                          AF_Edge      *anedge )\n  {\n    FT_Error  error = FT_Err_Ok;\n    AF_Edge   edge  = NULL;\n    AF_Edge   edges;\n\n\n    if ( axis->num_edges >= axis->max_edges )\n    {\n      FT_Int  old_max = axis->max_edges;\n      FT_Int  new_max = old_max;\n      FT_Int  big_max = (FT_Int)( FT_INT_MAX / sizeof ( *edge ) );\n\n\n      if ( old_max >= big_max )\n      {\n        error = FT_THROW( Out_Of_Memory );\n        goto Exit;\n      }\n\n      new_max += ( new_max >> 2 ) + 4;\n      if ( new_max < old_max || new_max > big_max )\n        new_max = big_max;\n\n      if ( FT_RENEW_ARRAY( axis->edges, old_max, new_max ) )\n        goto Exit;\n\n      axis->max_edges = new_max;\n    }\n\n    edges = axis->edges;\n    edge  = edges + axis->num_edges;\n\n    while ( edge > edges )\n    {\n      if ( edge[-1].fpos < fpos )\n        break;\n\n      /* we want the edge with same position and minor direction */\n      /* to appear before those in the major one in the list     */\n      if ( edge[-1].fpos == fpos && dir == axis->major_dir )\n        break;\n\n      edge[0] = edge[-1];\n      edge--;\n    }\n\n    axis->num_edges++;\n\n  Exit:\n    *anedge = edge;\n    return error;\n  }\n\n\n#ifdef FT_DEBUG_AUTOFIT\n\n#include FT_CONFIG_STANDARD_LIBRARY_H\n\n  /* The dump functions are used in the `ftgrid' demo program, too. */\n#define AF_DUMP( varformat )          \\\n          do                          \\\n          {                           \\\n            if ( to_stdout )          \\\n              printf varformat;       \\\n            else                      \\\n              FT_TRACE7( varformat ); \\\n          } while ( 0 )\n\n\n  static const char*\n  af_dir_str( AF_Direction  dir )\n  {\n    const char*  result;\n\n\n    switch ( dir )\n    {\n    case AF_DIR_UP:\n      result = \"up\";\n      break;\n    case AF_DIR_DOWN:\n      result = \"down\";\n      break;\n    case AF_DIR_LEFT:\n      result = \"left\";\n      break;\n    case AF_DIR_RIGHT:\n      result = \"right\";\n      break;\n    default:\n      result = \"none\";\n    }\n\n    return result;\n  }\n\n\n#define AF_INDEX_NUM( ptr, base )  (int)( (ptr) ? ( (ptr) - (base) ) : -1 )\n\n\n#ifdef __cplusplus\n  extern \"C\" {\n#endif\n  void\n  af_glyph_hints_dump_points( AF_GlyphHints  hints,\n                              FT_Bool        to_stdout )\n  {\n    AF_Point  points = hints->points;\n    AF_Point  limit  = points + hints->num_points;\n    AF_Point  point;\n\n\n    AF_DUMP(( \"Table of points:\\n\"\n              \"  [ index |  xorg |  yorg | xscale | yscale\"\n              \" |  xfit |  yfit |  flags ]\\n\" ));\n\n    for ( point = points; point < limit; point++ )\n      AF_DUMP(( \"  [ %5d | %5d | %5d | %6.2f | %6.2f\"\n                \" | %5.2f | %5.2f | %c ]\\n\",\n                AF_INDEX_NUM( point, points ),\n                point->fx,\n                point->fy,\n                point->ox / 64.0,\n                point->oy / 64.0,\n                point->x / 64.0,\n                point->y / 64.0,\n                ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) ? 'w' : ' '));\n    AF_DUMP(( \"\\n\" ));\n  }\n#ifdef __cplusplus\n  }\n#endif\n\n\n  static const char*\n  af_edge_flags_to_string( AF_Edge_Flags  flags )\n  {\n    static char  temp[32];\n    int          pos = 0;\n\n\n    if ( flags & AF_EDGE_ROUND )\n    {\n      ft_memcpy( temp + pos, \"round\", 5 );\n      pos += 5;\n    }\n    if ( flags & AF_EDGE_SERIF )\n    {\n      if ( pos > 0 )\n        temp[pos++] = ' ';\n      ft_memcpy( temp + pos, \"serif\", 5 );\n      pos += 5;\n    }\n    if ( pos == 0 )\n      return \"normal\";\n\n    temp[pos] = '\\0';\n\n    return temp;\n  }\n\n\n  /* Dump the array of linked segments. */\n\n#ifdef __cplusplus\n  extern \"C\" {\n#endif\n  void\n  af_glyph_hints_dump_segments( AF_GlyphHints  hints,\n                                FT_Bool        to_stdout )\n  {\n    FT_Int  dimension;\n\n\n    for ( dimension = 1; dimension >= 0; dimension-- )\n    {\n      AF_AxisHints  axis     = &hints->axis[dimension];\n      AF_Point      points   = hints->points;\n      AF_Edge       edges    = axis->edges;\n      AF_Segment    segments = axis->segments;\n      AF_Segment    limit    = segments + axis->num_segments;\n      AF_Segment    seg;\n\n\n      AF_DUMP(( \"Table of %s segments:\\n\",\n                dimension == AF_DIMENSION_HORZ ? \"vertical\"\n                                               : \"horizontal\" ));\n      if ( axis->num_segments )\n        AF_DUMP(( \"  [ index |  pos  |  dir  | from\"\n                  \" |  to  | link | serif | edge\"\n                  \" | height | extra |    flags    ]\\n\" ));\n      else\n        AF_DUMP(( \"  (none)\\n\" ));\n\n      for ( seg = segments; seg < limit; seg++ )\n        AF_DUMP(( \"  [ %5d | %5.2g | %5s | %4d\"\n                  \" | %4d | %4d | %5d | %4d\"\n                  \" | %6d | %5d | %11s ]\\n\",\n                  AF_INDEX_NUM( seg, segments ),\n                  dimension == AF_DIMENSION_HORZ\n                               ? (int)seg->first->ox / 64.0\n                               : (int)seg->first->oy / 64.0,\n                  af_dir_str( (AF_Direction)seg->dir ),\n                  AF_INDEX_NUM( seg->first, points ),\n                  AF_INDEX_NUM( seg->last, points ),\n                  AF_INDEX_NUM( seg->link, segments ),\n                  AF_INDEX_NUM( seg->serif, segments ),\n                  AF_INDEX_NUM( seg->edge, edges ),\n                  seg->height,\n                  seg->height - ( seg->max_coord - seg->min_coord ),\n                  af_edge_flags_to_string( (AF_Edge_Flags)seg->flags ) ));\n      AF_DUMP(( \"\\n\" ));\n    }\n  }\n#ifdef __cplusplus\n  }\n#endif\n\n\n  /* Fetch number of segments. */\n\n#ifdef __cplusplus\n  extern \"C\" {\n#endif\n  FT_Error\n  af_glyph_hints_get_num_segments( AF_GlyphHints  hints,\n                                   FT_Int         dimension,\n                                   FT_Int*        num_segments )\n  {\n    AF_Dimension  dim;\n    AF_AxisHints  axis;\n\n\n    dim = ( dimension == 0 ) ? AF_DIMENSION_HORZ : AF_DIMENSION_VERT;\n\n    axis          = &hints->axis[dim];\n    *num_segments = axis->num_segments;\n\n    return FT_Err_Ok;\n  }\n#ifdef __cplusplus\n  }\n#endif\n\n\n  /* Fetch offset of segments into user supplied offset array. */\n\n#ifdef __cplusplus\n  extern \"C\" {\n#endif\n  FT_Error\n  af_glyph_hints_get_segment_offset( AF_GlyphHints  hints,\n                                     FT_Int         dimension,\n                                     FT_Int         idx,\n                                     FT_Pos        *offset,\n                                     FT_Bool       *is_blue,\n                                     FT_Pos        *blue_offset )\n  {\n    AF_Dimension  dim;\n    AF_AxisHints  axis;\n    AF_Segment    seg;\n\n\n    if ( !offset )\n      return FT_THROW( Invalid_Argument );\n\n    dim = ( dimension == 0 ) ? AF_DIMENSION_HORZ : AF_DIMENSION_VERT;\n\n    axis = &hints->axis[dim];\n\n    if ( idx < 0 || idx >= axis->num_segments )\n      return FT_THROW( Invalid_Argument );\n\n    seg      = &axis->segments[idx];\n    *offset  = ( dim == AF_DIMENSION_HORZ ) ? seg->first->ox\n                                            : seg->first->oy;\n    if ( seg->edge )\n      *is_blue = (FT_Bool)( seg->edge->blue_edge != 0 );\n    else\n      *is_blue = FALSE;\n\n    if ( *is_blue )\n      *blue_offset = seg->edge->blue_edge->cur;\n    else\n      *blue_offset = 0;\n\n    return FT_Err_Ok;\n  }\n#ifdef __cplusplus\n  }\n#endif\n\n\n  /* Dump the array of linked edges. */\n\n#ifdef __cplusplus\n  extern \"C\" {\n#endif\n  void\n  af_glyph_hints_dump_edges( AF_GlyphHints  hints,\n                             FT_Bool        to_stdout )\n  {\n    FT_Int  dimension;\n\n\n    for ( dimension = 1; dimension >= 0; dimension-- )\n    {\n      AF_AxisHints  axis  = &hints->axis[dimension];\n      AF_Edge       edges = axis->edges;\n      AF_Edge       limit = edges + axis->num_edges;\n      AF_Edge       edge;\n\n\n      /*\n       *  note: AF_DIMENSION_HORZ corresponds to _vertical_ edges\n       *        since they have a constant X coordinate.\n       */\n      AF_DUMP(( \"Table of %s edges:\\n\",\n                dimension == AF_DIMENSION_HORZ ? \"vertical\"\n                                               : \"horizontal\" ));\n      if ( axis->num_edges )\n        AF_DUMP(( \"  [ index |  pos  |  dir  | link\"\n                  \" | serif | blue | opos  |  pos  |    flags    ]\\n\" ));\n      else\n        AF_DUMP(( \"  (none)\\n\" ));\n\n      for ( edge = edges; edge < limit; edge++ )\n        AF_DUMP(( \"  [ %5d | %5.2g | %5s | %4d\"\n                  \" | %5d |   %c  | %5.2f | %5.2f | %11s ]\\n\",\n                  AF_INDEX_NUM( edge, edges ),\n                  (int)edge->opos / 64.0,\n                  af_dir_str( (AF_Direction)edge->dir ),\n                  AF_INDEX_NUM( edge->link, edges ),\n                  AF_INDEX_NUM( edge->serif, edges ),\n                  edge->blue_edge ? 'y' : 'n',\n                  edge->opos / 64.0,\n                  edge->pos / 64.0,\n                  af_edge_flags_to_string( (AF_Edge_Flags)edge->flags ) ));\n      AF_DUMP(( \"\\n\" ));\n    }\n  }\n#ifdef __cplusplus\n  }\n#endif\n\n#undef AF_DUMP\n\n#endif /* !FT_DEBUG_AUTOFIT */\n\n\n  /* Compute the direction value of a given vector. */\n\n  FT_LOCAL_DEF( AF_Direction )\n  af_direction_compute( FT_Pos  dx,\n                        FT_Pos  dy )\n  {\n    FT_Pos        ll, ss;  /* long and short arm lengths */\n    AF_Direction  dir;     /* candidate direction        */\n\n\n    if ( dy >= dx )\n    {\n      if ( dy >= -dx )\n      {\n        dir = AF_DIR_UP;\n        ll  = dy;\n        ss  = dx;\n      }\n      else\n      {\n        dir = AF_DIR_LEFT;\n        ll  = -dx;\n        ss  = dy;\n      }\n    }\n    else /* dy < dx */\n    {\n      if ( dy >= -dx )\n      {\n        dir = AF_DIR_RIGHT;\n        ll  = dx;\n        ss  = dy;\n      }\n      else\n      {\n        dir = AF_DIR_DOWN;\n        ll  = dy;\n        ss  = dx;\n      }\n    }\n\n    /* return no direction if arm lengths differ too much            */\n    /* (value 14 is heuristic, corresponding to approx. 4.1 degrees) */\n    ss *= 14;\n    if ( FT_ABS( ll ) <= FT_ABS( ss ) )\n      dir = AF_DIR_NONE;\n\n    return dir;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  af_glyph_hints_init( AF_GlyphHints  hints,\n                       FT_Memory      memory )\n  {\n    FT_ZERO( hints );\n    hints->memory = memory;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  af_glyph_hints_done( AF_GlyphHints  hints )\n  {\n    FT_Memory  memory = hints->memory;\n    int        dim;\n\n\n    if ( !( hints && hints->memory ) )\n      return;\n\n    /*\n     *  note that we don't need to free the segment and edge\n     *  buffers since they are really within the hints->points array\n     */\n    for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )\n    {\n      AF_AxisHints  axis = &hints->axis[dim];\n\n\n      axis->num_segments = 0;\n      axis->max_segments = 0;\n      FT_FREE( axis->segments );\n\n      axis->num_edges = 0;\n      axis->max_edges = 0;\n      FT_FREE( axis->edges );\n    }\n\n    FT_FREE( hints->contours );\n    hints->max_contours = 0;\n    hints->num_contours = 0;\n\n    FT_FREE( hints->points );\n    hints->num_points = 0;\n    hints->max_points = 0;\n\n    hints->memory = NULL;\n  }\n\n\n  /* Reset metrics. */\n\n  FT_LOCAL_DEF( void )\n  af_glyph_hints_rescale( AF_GlyphHints    hints,\n                          AF_StyleMetrics  metrics )\n  {\n    hints->metrics      = metrics;\n    hints->scaler_flags = metrics->scaler.flags;\n  }\n\n\n  /* Recompute all AF_Point in AF_GlyphHints from the definitions */\n  /* in a source outline.                                         */\n\n  FT_LOCAL_DEF( FT_Error )\n  af_glyph_hints_reload( AF_GlyphHints  hints,\n                         FT_Outline*    outline )\n  {\n    FT_Error   error   = FT_Err_Ok;\n    AF_Point   points;\n    FT_UInt    old_max, new_max;\n    FT_Fixed   x_scale = hints->x_scale;\n    FT_Fixed   y_scale = hints->y_scale;\n    FT_Pos     x_delta = hints->x_delta;\n    FT_Pos     y_delta = hints->y_delta;\n    FT_Memory  memory  = hints->memory;\n\n\n    hints->num_points   = 0;\n    hints->num_contours = 0;\n\n    hints->axis[0].num_segments = 0;\n    hints->axis[0].num_edges    = 0;\n    hints->axis[1].num_segments = 0;\n    hints->axis[1].num_edges    = 0;\n\n    /* first of all, reallocate the contours array if necessary */\n    new_max = (FT_UInt)outline->n_contours;\n    old_max = hints->max_contours;\n    if ( new_max > old_max )\n    {\n      new_max = ( new_max + 3 ) & ~3; /* round up to a multiple of 4 */\n\n      if ( FT_RENEW_ARRAY( hints->contours, old_max, new_max ) )\n        goto Exit;\n\n      hints->max_contours = new_max;\n    }\n\n    /*\n     *  then reallocate the points arrays if necessary --\n     *  note that we reserve two additional point positions, used to\n     *  hint metrics appropriately\n     */\n    new_max = (FT_UInt)( outline->n_points + 2 );\n    old_max = hints->max_points;\n    if ( new_max > old_max )\n    {\n      new_max = ( new_max + 2 + 7 ) & ~7; /* round up to a multiple of 8 */\n\n      if ( FT_RENEW_ARRAY( hints->points, old_max, new_max ) )\n        goto Exit;\n\n      hints->max_points = new_max;\n    }\n\n    hints->num_points   = outline->n_points;\n    hints->num_contours = outline->n_contours;\n\n    /* We can't rely on the value of `FT_Outline.flags' to know the fill   */\n    /* direction used for a glyph, given that some fonts are broken (e.g., */\n    /* the Arphic ones).  We thus recompute it each time we need to.       */\n    /*                                                                     */\n    hints->axis[AF_DIMENSION_HORZ].major_dir = AF_DIR_UP;\n    hints->axis[AF_DIMENSION_VERT].major_dir = AF_DIR_LEFT;\n\n    if ( FT_Outline_Get_Orientation( outline ) == FT_ORIENTATION_POSTSCRIPT )\n    {\n      hints->axis[AF_DIMENSION_HORZ].major_dir = AF_DIR_DOWN;\n      hints->axis[AF_DIMENSION_VERT].major_dir = AF_DIR_RIGHT;\n    }\n\n    hints->x_scale = x_scale;\n    hints->y_scale = y_scale;\n    hints->x_delta = x_delta;\n    hints->y_delta = y_delta;\n\n    hints->xmin_delta = 0;\n    hints->xmax_delta = 0;\n\n    points = hints->points;\n    if ( hints->num_points == 0 )\n      goto Exit;\n\n    {\n      AF_Point  point;\n      AF_Point  point_limit = points + hints->num_points;\n\n\n      /* compute coordinates & Bezier flags, next and prev */\n      {\n        FT_Vector*  vec           = outline->points;\n        char*       tag           = outline->tags;\n        AF_Point    end           = points + outline->contours[0];\n        AF_Point    prev          = end;\n        FT_Int      contour_index = 0;\n\n\n        for ( point = points; point < point_limit; point++, vec++, tag++ )\n        {\n          point->in_dir  = (FT_Char)AF_DIR_NONE;\n          point->out_dir = (FT_Char)AF_DIR_NONE;\n\n          point->fx = (FT_Short)vec->x;\n          point->fy = (FT_Short)vec->y;\n          point->ox = point->x = FT_MulFix( vec->x, x_scale ) + x_delta;\n          point->oy = point->y = FT_MulFix( vec->y, y_scale ) + y_delta;\n\n          switch ( FT_CURVE_TAG( *tag ) )\n          {\n          case FT_CURVE_TAG_CONIC:\n            point->flags = AF_FLAG_CONIC;\n            break;\n          case FT_CURVE_TAG_CUBIC:\n            point->flags = AF_FLAG_CUBIC;\n            break;\n          default:\n            point->flags = AF_FLAG_NONE;\n          }\n\n          point->prev = prev;\n          prev->next  = point;\n          prev        = point;\n\n          if ( point == end )\n          {\n            if ( ++contour_index < outline->n_contours )\n            {\n              end  = points + outline->contours[contour_index];\n              prev = end;\n            }\n          }\n        }\n      }\n\n      /* set up the contours array */\n      {\n        AF_Point*  contour       = hints->contours;\n        AF_Point*  contour_limit = contour + hints->num_contours;\n        short*     end           = outline->contours;\n        short      idx           = 0;\n\n\n        for ( ; contour < contour_limit; contour++, end++ )\n        {\n          contour[0] = points + idx;\n          idx        = (short)( end[0] + 1 );\n        }\n      }\n\n      {\n        /*\n         *  Compute directions of `in' and `out' vectors.\n         *\n         *  Note that distances between points that are very near to each\n         *  other are accumulated.  In other words, the auto-hinter\n         *  prepends the small vectors between near points to the first\n         *  non-near vector.  All intermediate points are tagged as\n         *  weak; the directions are adjusted also to be equal to the\n         *  accumulated one.\n         */\n\n        /* value 20 in `near_limit' is heuristic */\n        FT_UInt  units_per_em = hints->metrics->scaler.face->units_per_EM;\n        FT_Int   near_limit   = 20 * units_per_em / 2048;\n        FT_Int   near_limit2  = 2 * near_limit - 1;\n\n        AF_Point*  contour;\n        AF_Point*  contour_limit = hints->contours + hints->num_contours;\n\n\n        for ( contour = hints->contours; contour < contour_limit; contour++ )\n        {\n          AF_Point  first = *contour;\n          AF_Point  next, prev, curr;\n\n          FT_Pos  out_x, out_y;\n\n          FT_Bool  is_first;\n\n\n          /* since the first point of a contour could be part of a */\n          /* series of near points, go backwards to find the first */\n          /* non-near point and adjust `first'                     */\n\n          point = first;\n          prev  = first->prev;\n\n          while ( prev != first )\n          {\n            out_x = point->fx - prev->fx;\n            out_y = point->fy - prev->fy;\n\n            /*\n             *  We use Taxicab metrics to measure the vector length.\n             *\n             *  Note that the accumulated distances so far could have the\n             *  opposite direction of the distance measured here.  For this\n             *  reason we use `near_limit2' for the comparison to get a\n             *  non-near point even in the worst case.\n             */\n            if ( FT_ABS( out_x ) + FT_ABS( out_y ) >= near_limit2 )\n              break;\n\n            point = prev;\n            prev  = prev->prev;\n          }\n\n          /* adjust first point */\n          first = point;\n\n          /* now loop over all points of the contour to get */\n          /* `in' and `out' vector directions               */\n\n          curr  = first;\n\n          /*\n           *  We abuse the `u' and `v' fields to store index deltas to the\n           *  next and previous non-near point, respectively.\n           *\n           *  To avoid problems with not having non-near points, we point to\n           *  `first' by default as the next non-near point.\n           *\n           */\n          curr->u  = (FT_Pos)( first - curr );\n          first->v = -curr->u;\n\n          out_x = 0;\n          out_y = 0;\n\n          is_first = 1;\n\n          for ( point = first;\n                point != first || is_first;\n                point = point->next )\n          {\n            AF_Direction  out_dir;\n\n\n            is_first = 0;\n\n            next = point->next;\n\n            out_x += next->fx - point->fx;\n            out_y += next->fy - point->fy;\n\n            if ( FT_ABS( out_x ) + FT_ABS( out_y ) < near_limit )\n            {\n              next->flags |= AF_FLAG_WEAK_INTERPOLATION;\n              continue;\n            }\n\n            curr->u = (FT_Pos)( next - curr );\n            next->v = -curr->u;\n\n            out_dir = af_direction_compute( out_x, out_y );\n\n            /* adjust directions for all points inbetween; */\n            /* the loop also updates position of `curr'    */\n            curr->out_dir = (FT_Char)out_dir;\n            for ( curr = curr->next; curr != next; curr = curr->next )\n            {\n              curr->in_dir  = (FT_Char)out_dir;\n              curr->out_dir = (FT_Char)out_dir;\n            }\n            next->in_dir = (FT_Char)out_dir;\n\n            curr->u  = (FT_Pos)( first - curr );\n            first->v = -curr->u;\n\n            out_x = 0;\n            out_y = 0;\n          }\n        }\n\n        /*\n         *  The next step is to `simplify' an outline's topology so that we\n         *  can identify local extrema more reliably: A series of\n         *  non-horizontal or non-vertical vectors pointing into the same\n         *  quadrant are handled as a single, long vector.  From a\n         *  topological point of the view, the intermediate points are of no\n         *  interest and thus tagged as weak.\n         */\n\n        for ( point = points; point < point_limit; point++ )\n        {\n          if ( point->flags & AF_FLAG_WEAK_INTERPOLATION )\n            continue;\n\n          if ( point->in_dir  == AF_DIR_NONE &&\n               point->out_dir == AF_DIR_NONE )\n          {\n            /* check whether both vectors point into the same quadrant */\n\n            FT_Pos  in_x, in_y;\n            FT_Pos  out_x, out_y;\n\n            AF_Point  next_u = point + point->u;\n            AF_Point  prev_v = point + point->v;\n\n\n            in_x = point->fx - prev_v->fx;\n            in_y = point->fy - prev_v->fy;\n\n            out_x = next_u->fx - point->fx;\n            out_y = next_u->fy - point->fy;\n\n            if ( ( in_x ^ out_x ) >= 0 && ( in_y ^ out_y ) >= 0 )\n            {\n              /* yes, so tag current point as weak */\n              /* and update index deltas           */\n\n              point->flags |= AF_FLAG_WEAK_INTERPOLATION;\n\n              prev_v->u = (FT_Pos)( next_u - prev_v );\n              next_u->v = -prev_v->u;\n            }\n          }\n        }\n\n        /*\n         *  Finally, check for remaining weak points.  Everything else not\n         *  collected in edges so far is then implicitly classified as strong\n         *  points.\n         */\n\n        for ( point = points; point < point_limit; point++ )\n        {\n          if ( point->flags & AF_FLAG_WEAK_INTERPOLATION )\n            continue;\n\n          if ( point->flags & AF_FLAG_CONTROL )\n          {\n            /* control points are always weak */\n          Is_Weak_Point:\n            point->flags |= AF_FLAG_WEAK_INTERPOLATION;\n          }\n          else if ( point->out_dir == point->in_dir )\n          {\n            if ( point->out_dir != AF_DIR_NONE )\n            {\n              /* current point lies on a horizontal or          */\n              /* vertical segment (but doesn't start or end it) */\n              goto Is_Weak_Point;\n            }\n\n            {\n              AF_Point  next_u = point + point->u;\n              AF_Point  prev_v = point + point->v;\n\n\n              if ( ft_corner_is_flat( point->fx  - prev_v->fx,\n                                      point->fy  - prev_v->fy,\n                                      next_u->fx - point->fx,\n                                      next_u->fy - point->fy ) )\n              {\n                /* either the `in' or the `out' vector is much more  */\n                /* dominant than the other one, so tag current point */\n                /* as weak and update index deltas                   */\n\n                prev_v->u = (FT_Pos)( next_u - prev_v );\n                next_u->v = -prev_v->u;\n\n                goto Is_Weak_Point;\n              }\n            }\n          }\n          else if ( point->in_dir == -point->out_dir )\n          {\n            /* current point forms a spike */\n            goto Is_Weak_Point;\n          }\n        }\n      }\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /* Store the hinted outline in an FT_Outline structure. */\n\n  FT_LOCAL_DEF( void )\n  af_glyph_hints_save( AF_GlyphHints  hints,\n                       FT_Outline*    outline )\n  {\n    AF_Point    point = hints->points;\n    AF_Point    limit = point + hints->num_points;\n    FT_Vector*  vec   = outline->points;\n    char*       tag   = outline->tags;\n\n\n    for ( ; point < limit; point++, vec++, tag++ )\n    {\n      vec->x = point->x;\n      vec->y = point->y;\n\n      if ( point->flags & AF_FLAG_CONIC )\n        tag[0] = FT_CURVE_TAG_CONIC;\n      else if ( point->flags & AF_FLAG_CUBIC )\n        tag[0] = FT_CURVE_TAG_CUBIC;\n      else\n        tag[0] = FT_CURVE_TAG_ON;\n    }\n  }\n\n\n  /****************************************************************\n   *\n   *                     EDGE POINT GRID-FITTING\n   *\n   ****************************************************************/\n\n\n  /* Align all points of an edge to the same coordinate value, */\n  /* either horizontally or vertically.                        */\n\n  FT_LOCAL_DEF( void )\n  af_glyph_hints_align_edge_points( AF_GlyphHints  hints,\n                                    AF_Dimension   dim )\n  {\n    AF_AxisHints  axis          = & hints->axis[dim];\n    AF_Segment    segments      = axis->segments;\n    AF_Segment    segment_limit = segments + axis->num_segments;\n    AF_Segment    seg;\n\n\n    if ( dim == AF_DIMENSION_HORZ )\n    {\n      for ( seg = segments; seg < segment_limit; seg++ )\n      {\n        AF_Edge   edge = seg->edge;\n        AF_Point  point, first, last;\n\n\n        if ( edge == NULL )\n          continue;\n\n        first = seg->first;\n        last  = seg->last;\n        point = first;\n        for (;;)\n        {\n          point->x      = edge->pos;\n          point->flags |= AF_FLAG_TOUCH_X;\n\n          if ( point == last )\n            break;\n\n          point = point->next;\n        }\n      }\n    }\n    else\n    {\n      for ( seg = segments; seg < segment_limit; seg++ )\n      {\n        AF_Edge   edge = seg->edge;\n        AF_Point  point, first, last;\n\n\n        if ( edge == NULL )\n          continue;\n\n        first = seg->first;\n        last  = seg->last;\n        point = first;\n        for (;;)\n        {\n          point->y      = edge->pos;\n          point->flags |= AF_FLAG_TOUCH_Y;\n\n          if ( point == last )\n            break;\n\n          point = point->next;\n        }\n      }\n    }\n  }\n\n\n  /****************************************************************\n   *\n   *                    STRONG POINT INTERPOLATION\n   *\n   ****************************************************************/\n\n\n  /* Hint the strong points -- this is equivalent to the TrueType `IP' */\n  /* hinting instruction.                                              */\n\n  FT_LOCAL_DEF( void )\n  af_glyph_hints_align_strong_points( AF_GlyphHints  hints,\n                                      AF_Dimension   dim )\n  {\n    AF_Point      points      = hints->points;\n    AF_Point      point_limit = points + hints->num_points;\n    AF_AxisHints  axis        = &hints->axis[dim];\n    AF_Edge       edges       = axis->edges;\n    AF_Edge       edge_limit  = edges + axis->num_edges;\n    AF_Flags      touch_flag;\n\n\n    if ( dim == AF_DIMENSION_HORZ )\n      touch_flag = AF_FLAG_TOUCH_X;\n    else\n      touch_flag  = AF_FLAG_TOUCH_Y;\n\n    if ( edges < edge_limit )\n    {\n      AF_Point  point;\n      AF_Edge   edge;\n\n\n      for ( point = points; point < point_limit; point++ )\n      {\n        FT_Pos  u, ou, fu;  /* point position */\n        FT_Pos  delta;\n\n\n        if ( point->flags & touch_flag )\n          continue;\n\n        /* if this point is candidate to weak interpolation, we       */\n        /* interpolate it after all strong points have been processed */\n\n        if ( ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) )\n          continue;\n\n        if ( dim == AF_DIMENSION_VERT )\n        {\n          u  = point->fy;\n          ou = point->oy;\n        }\n        else\n        {\n          u  = point->fx;\n          ou = point->ox;\n        }\n\n        fu = u;\n\n        /* is the point before the first edge? */\n        edge  = edges;\n        delta = edge->fpos - u;\n        if ( delta >= 0 )\n        {\n          u = edge->pos - ( edge->opos - ou );\n          goto Store_Point;\n        }\n\n        /* is the point after the last edge? */\n        edge  = edge_limit - 1;\n        delta = u - edge->fpos;\n        if ( delta >= 0 )\n        {\n          u = edge->pos + ( ou - edge->opos );\n          goto Store_Point;\n        }\n\n        {\n          FT_PtrDist  min, max, mid;\n          FT_Pos      fpos;\n\n\n          /* find enclosing edges */\n          min = 0;\n          max = edge_limit - edges;\n\n#if 1\n          /* for a small number of edges, a linear search is better */\n          if ( max <= 8 )\n          {\n            FT_PtrDist  nn;\n\n\n            for ( nn = 0; nn < max; nn++ )\n              if ( edges[nn].fpos >= u )\n                break;\n\n            if ( edges[nn].fpos == u )\n            {\n              u = edges[nn].pos;\n              goto Store_Point;\n            }\n            min = nn;\n          }\n          else\n#endif\n          while ( min < max )\n          {\n            mid  = ( max + min ) >> 1;\n            edge = edges + mid;\n            fpos = edge->fpos;\n\n            if ( u < fpos )\n              max = mid;\n            else if ( u > fpos )\n              min = mid + 1;\n            else\n            {\n              /* we are on the edge */\n              u = edge->pos;\n              goto Store_Point;\n            }\n          }\n\n          /* point is not on an edge */\n          {\n            AF_Edge  before = edges + min - 1;\n            AF_Edge  after  = edges + min + 0;\n\n\n            /* assert( before && after && before != after ) */\n            if ( before->scale == 0 )\n              before->scale = FT_DivFix( after->pos - before->pos,\n                                         after->fpos - before->fpos );\n\n            u = before->pos + FT_MulFix( fu - before->fpos,\n                                         before->scale );\n          }\n        }\n\n      Store_Point:\n        /* save the point position */\n        if ( dim == AF_DIMENSION_HORZ )\n          point->x = u;\n        else\n          point->y = u;\n\n        point->flags |= touch_flag;\n      }\n    }\n  }\n\n\n  /****************************************************************\n   *\n   *                    WEAK POINT INTERPOLATION\n   *\n   ****************************************************************/\n\n\n  /* Shift the original coordinates of all points between `p1' and */\n  /* `p2' to get hinted coordinates, using the same difference as  */\n  /* given by `ref'.                                               */\n\n  static void\n  af_iup_shift( AF_Point  p1,\n                AF_Point  p2,\n                AF_Point  ref )\n  {\n    AF_Point  p;\n    FT_Pos    delta = ref->u - ref->v;\n\n\n    if ( delta == 0 )\n      return;\n\n    for ( p = p1; p < ref; p++ )\n      p->u = p->v + delta;\n\n    for ( p = ref + 1; p <= p2; p++ )\n      p->u = p->v + delta;\n  }\n\n\n  /* Interpolate the original coordinates of all points between `p1' and  */\n  /* `p2' to get hinted coordinates, using `ref1' and `ref2' as the       */\n  /* reference points.  The `u' and `v' members are the current and       */\n  /* original coordinate values, respectively.                            */\n  /*                                                                      */\n  /* Details can be found in the TrueType bytecode specification.         */\n\n  static void\n  af_iup_interp( AF_Point  p1,\n                 AF_Point  p2,\n                 AF_Point  ref1,\n                 AF_Point  ref2 )\n  {\n    AF_Point  p;\n    FT_Pos    u;\n    FT_Pos    v1 = ref1->v;\n    FT_Pos    v2 = ref2->v;\n    FT_Pos    d1 = ref1->u - v1;\n    FT_Pos    d2 = ref2->u - v2;\n\n\n    if ( p1 > p2 )\n      return;\n\n    if ( v1 == v2 )\n    {\n      for ( p = p1; p <= p2; p++ )\n      {\n        u = p->v;\n\n        if ( u <= v1 )\n          u += d1;\n        else\n          u += d2;\n\n        p->u = u;\n      }\n      return;\n    }\n\n    if ( v1 < v2 )\n    {\n      for ( p = p1; p <= p2; p++ )\n      {\n        u = p->v;\n\n        if ( u <= v1 )\n          u += d1;\n        else if ( u >= v2 )\n          u += d2;\n        else\n          u = ref1->u + FT_MulDiv( u - v1, ref2->u - ref1->u, v2 - v1 );\n\n        p->u = u;\n      }\n    }\n    else\n    {\n      for ( p = p1; p <= p2; p++ )\n      {\n        u = p->v;\n\n        if ( u <= v2 )\n          u += d2;\n        else if ( u >= v1 )\n          u += d1;\n        else\n          u = ref1->u + FT_MulDiv( u - v1, ref2->u - ref1->u, v2 - v1 );\n\n        p->u = u;\n      }\n    }\n  }\n\n\n  /* Hint the weak points -- this is equivalent to the TrueType `IUP' */\n  /* hinting instruction.                                             */\n\n  FT_LOCAL_DEF( void )\n  af_glyph_hints_align_weak_points( AF_GlyphHints  hints,\n                                    AF_Dimension   dim )\n  {\n    AF_Point   points        = hints->points;\n    AF_Point   point_limit   = points + hints->num_points;\n    AF_Point*  contour       = hints->contours;\n    AF_Point*  contour_limit = contour + hints->num_contours;\n    AF_Flags   touch_flag;\n    AF_Point   point;\n    AF_Point   end_point;\n    AF_Point   first_point;\n\n\n    /* PASS 1: Move segment points to edge positions */\n\n    if ( dim == AF_DIMENSION_HORZ )\n    {\n      touch_flag = AF_FLAG_TOUCH_X;\n\n      for ( point = points; point < point_limit; point++ )\n      {\n        point->u = point->x;\n        point->v = point->ox;\n      }\n    }\n    else\n    {\n      touch_flag = AF_FLAG_TOUCH_Y;\n\n      for ( point = points; point < point_limit; point++ )\n      {\n        point->u = point->y;\n        point->v = point->oy;\n      }\n    }\n\n    for ( ; contour < contour_limit; contour++ )\n    {\n      AF_Point  first_touched, last_touched;\n\n\n      point       = *contour;\n      end_point   = point->prev;\n      first_point = point;\n\n      /* find first touched point */\n      for (;;)\n      {\n        if ( point > end_point )  /* no touched point in contour */\n          goto NextContour;\n\n        if ( point->flags & touch_flag )\n          break;\n\n        point++;\n      }\n\n      first_touched = point;\n\n      for (;;)\n      {\n        FT_ASSERT( point <= end_point                 &&\n                   ( point->flags & touch_flag ) != 0 );\n\n        /* skip any touched neighbours */\n        while ( point < end_point                    &&\n                ( point[1].flags & touch_flag ) != 0 )\n          point++;\n\n        last_touched = point;\n\n        /* find the next touched point, if any */\n        point++;\n        for (;;)\n        {\n          if ( point > end_point )\n            goto EndContour;\n\n          if ( ( point->flags & touch_flag ) != 0 )\n            break;\n\n          point++;\n        }\n\n        /* interpolate between last_touched and point */\n        af_iup_interp( last_touched + 1, point - 1,\n                       last_touched, point );\n      }\n\n    EndContour:\n      /* special case: only one point was touched */\n      if ( last_touched == first_touched )\n        af_iup_shift( first_point, end_point, first_touched );\n\n      else /* interpolate the last part */\n      {\n        if ( last_touched < end_point )\n          af_iup_interp( last_touched + 1, end_point,\n                         last_touched, first_touched );\n\n        if ( first_touched > points )\n          af_iup_interp( first_point, first_touched - 1,\n                         last_touched, first_touched );\n      }\n\n    NextContour:\n      ;\n    }\n\n    /* now save the interpolated values back to x/y */\n    if ( dim == AF_DIMENSION_HORZ )\n    {\n      for ( point = points; point < point_limit; point++ )\n        point->x = point->u;\n    }\n    else\n    {\n      for ( point = points; point < point_limit; point++ )\n        point->y = point->u;\n    }\n  }\n\n\n#ifdef AF_CONFIG_OPTION_USE_WARPER\n\n  /* Apply (small) warp scale and warp delta for given dimension. */\n\n  FT_LOCAL_DEF( void )\n  af_glyph_hints_scale_dim( AF_GlyphHints  hints,\n                            AF_Dimension   dim,\n                            FT_Fixed       scale,\n                            FT_Pos         delta )\n  {\n    AF_Point  points       = hints->points;\n    AF_Point  points_limit = points + hints->num_points;\n    AF_Point  point;\n\n\n    if ( dim == AF_DIMENSION_HORZ )\n    {\n      for ( point = points; point < points_limit; point++ )\n        point->x = FT_MulFix( point->fx, scale ) + delta;\n    }\n    else\n    {\n      for ( point = points; point < points_limit; point++ )\n        point->y = FT_MulFix( point->fy, scale ) + delta;\n    }\n  }\n\n#endif /* AF_CONFIG_OPTION_USE_WARPER */\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afhints.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afhints.h                                                              */\n/*                                                                         */\n/*    Auto-fitter hinting routines (specification).                        */\n/*                                                                         */\n/*  Copyright 2003-2008, 2010-2012, 2014 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __AFHINTS_H__\n#define __AFHINTS_H__\n\n#include \"aftypes.h\"\n\n#define xxAF_SORT_SEGMENTS\n\nFT_BEGIN_HEADER\n\n  /*\n   *  The definition of outline glyph hints.  These are shared by all\n   *  writing system analysis routines (until now).\n   */\n\n  typedef enum  AF_Dimension_\n  {\n    AF_DIMENSION_HORZ = 0,  /* x coordinates,                    */\n                            /* i.e., vertical segments & edges   */\n    AF_DIMENSION_VERT = 1,  /* y coordinates,                    */\n                            /* i.e., horizontal segments & edges */\n\n    AF_DIMENSION_MAX  /* do not remove */\n\n  } AF_Dimension;\n\n\n  /* hint directions -- the values are computed so that two vectors are */\n  /* in opposite directions iff `dir1 + dir2 == 0'                      */\n  typedef enum  AF_Direction_\n  {\n    AF_DIR_NONE  =  4,\n    AF_DIR_RIGHT =  1,\n    AF_DIR_LEFT  = -1,\n    AF_DIR_UP    =  2,\n    AF_DIR_DOWN  = -2\n\n  } AF_Direction;\n\n\n  /*\n   *  The following explanations are mostly taken from the article\n   *\n   *    Real-Time Grid Fitting of Typographic Outlines\n   *\n   *  by David Turner and Werner Lemberg\n   *\n   *    http://www.tug.org/TUGboat/Articles/tb24-3/lemberg.pdf\n   *\n   *  with appropriate updates.\n   *\n   *\n   *  Segments\n   *\n   *    `af_{cjk,latin,...}_hints_compute_segments' are the functions to\n   *    find segments in an outline.\n   *\n   *    A segment is a series of at least two consecutive points that are\n   *    approximately aligned along a coordinate axis.  The analysis to do\n   *    so is specific to a writing system.\n   *\n   *\n   *  Edges\n   *\n   *    `af_{cjk,latin,...}_hints_compute_edges' are the functions to find\n   *    edges.\n   *\n   *    As soon as segments are defined, the auto-hinter groups them into\n   *    edges.  An edge corresponds to a single position on the main\n   *    dimension that collects one or more segments (allowing for a small\n   *    threshold).\n   *\n   *    As an example, the `latin' writing system first tries to grid-fit\n   *    edges, then to align segments on the edges unless it detects that\n   *    they form a serif.\n   *\n   *\n   *                      A          H\n   *                       |        |\n   *                       |        |\n   *                       |        |\n   *                       |        |\n   *         C             |        |             F\n   *          +------<-----+        +-----<------+\n   *          |             B      G             |\n   *          |                                  |\n   *          |                                  |\n   *          +--------------->------------------+\n   *         D                                    E\n   *\n   *\n   *  Stems\n   *\n   *    Stems are detected by `af_{cjk,latin,...}_hint_edges'.\n   *\n   *    Segments need to be `linked' to other ones in order to detect stems.\n   *    A stem is made of two segments that face each other in opposite\n   *    directions and that are sufficiently close to each other.  Using\n   *    vocabulary from the TrueType specification, stem segments form a\n   *    `black distance'.\n   *\n   *    In the above ASCII drawing, the horizontal segments are BC, DE, and\n   *    FG; the vertical segments are AB, CD, EF, and GH.\n   *\n   *    Each segment has at most one `best' candidate to form a black\n   *    distance, or no candidate at all.  Notice that two distinct segments\n   *    can have the same candidate, which frequently means a serif.\n   *\n   *    A stem is recognized by the following condition:\n   *\n   *      best segment_1 = segment_2 && best segment_2 = segment_1\n   *\n   *    The best candidate is stored in field `link' in structure\n   *    `AF_Segment'.\n   *\n   *    In the above ASCII drawing, the best candidate for both AB and CD is\n   *    GH, while the best candidate for GH is AB.  Similarly, the best\n   *    candidate for EF and GH is AB, while the best candidate for AB is\n   *    GH.\n   *\n   *    The detection and handling of stems is dependent on the writing\n   *    system.\n   *\n   *\n   *  Serifs\n   *\n   *    Serifs are detected by `af_{cjk,latin,...}_hint_edges'.\n   *\n   *    In comparison to a stem, a serif (as handled by the auto-hinter\n   *    module that takes care of the `latin' writing system) has\n   *\n   *      best segment_1 = segment_2 && best segment_2 != segment_1\n   *\n   *    where segment_1 corresponds to the serif segment (CD and EF in the\n   *    above ASCII drawing).\n   *\n   *    The best candidate is stored in field `serif' in structure\n   *    `AF_Segment' (and `link' is set to NULL).\n   *\n   *\n   *  Touched points\n   *\n   *    A point is called `touched' if it has been processed somehow by the\n   *    auto-hinter.  It basically means that it shouldn't be moved again\n   *    (or moved only under certain constraints to preserve the already\n   *    applied processing).\n   *\n   *\n   *  Flat and round segments\n   *\n   *    Segments are `round' or `flat', depending on the series of points\n   *    that define them.  A segment is round if the next and previous point\n   *    of an extremum (which can be either a single point or sequence of\n   *    points) are both conic or cubic control points.  Otherwise, a\n   *    segment with an extremum is flat.\n   *\n   *\n   *  Strong Points\n   *\n   *    Experience has shown that points not part of an edge need to be\n   *    interpolated linearly between their two closest edges, even if these\n   *    are not part of the contour of those particular points.  Typical\n   *    candidates for this are\n   *\n   *    - angle points (i.e., points where the `in' and `out' direction\n   *      differ greatly)\n   *\n   *    - inflection points (i.e., where the `in' and `out' angles are the\n   *      same, but the curvature changes sign) [currently, such points\n   *      aren't handled specially in the auto-hinter]\n   *\n   *    `af_glyph_hints_align_strong_points' is the function that takes\n   *    care of such situations; it is equivalent to the TrueType `IP'\n   *    hinting instruction.\n   *\n   *\n   *  Weak Points\n   *\n   *    Other points in the outline must be interpolated using the\n   *    coordinates of their previous and next unfitted contour neighbours.\n   *    These are called `weak points' and are touched by the function\n   *    `af_glyph_hints_align_weak_points', equivalent to the TrueType `IUP'\n   *    hinting instruction.  Typical candidates are control points and\n   *    points on the contour without a major direction.\n   *\n   *    The major effect is to reduce possible distortion caused by\n   *    alignment of edges and strong points, thus weak points are processed\n   *    after strong points.\n   */\n\n\n  /* point hint flags */\n  typedef enum  AF_Flags_\n  {\n    AF_FLAG_NONE = 0,\n\n    /* point type flags */\n    AF_FLAG_CONIC   = 1 << 0,\n    AF_FLAG_CUBIC   = 1 << 1,\n    AF_FLAG_CONTROL = AF_FLAG_CONIC | AF_FLAG_CUBIC,\n\n    /* point touch flags */\n    AF_FLAG_TOUCH_X = 1 << 2,\n    AF_FLAG_TOUCH_Y = 1 << 3,\n\n    /* candidates for weak interpolation have this flag set */\n    AF_FLAG_WEAK_INTERPOLATION = 1 << 4\n\n  } AF_Flags;\n\n\n  /* edge hint flags */\n  typedef enum  AF_Edge_Flags_\n  {\n    AF_EDGE_NORMAL  = 0,\n    AF_EDGE_ROUND   = 1 << 0,\n    AF_EDGE_SERIF   = 1 << 1,\n    AF_EDGE_DONE    = 1 << 2,\n    AF_EDGE_NEUTRAL = 1 << 3  /* set if edge aligns to a neutral blue zone */\n\n  } AF_Edge_Flags;\n\n\n  typedef struct AF_PointRec_*    AF_Point;\n  typedef struct AF_SegmentRec_*  AF_Segment;\n  typedef struct AF_EdgeRec_*     AF_Edge;\n\n\n  typedef struct  AF_PointRec_\n  {\n    FT_UShort  flags;    /* point flags used by hinter   */\n    FT_Char    in_dir;   /* direction of inwards vector  */\n    FT_Char    out_dir;  /* direction of outwards vector */\n\n    FT_Pos     ox, oy;   /* original, scaled position                   */\n    FT_Short   fx, fy;   /* original, unscaled position (in font units) */\n    FT_Pos     x, y;     /* current position                            */\n    FT_Pos     u, v;     /* current (x,y) or (y,x) depending on context */\n\n    AF_Point   next;     /* next point in contour     */\n    AF_Point   prev;     /* previous point in contour */\n\n  } AF_PointRec;\n\n\n  typedef struct  AF_SegmentRec_\n  {\n    FT_Byte     flags;       /* edge/segment flags for this segment */\n    FT_Char     dir;         /* segment direction                   */\n    FT_Short    pos;         /* position of segment                 */\n    FT_Short    min_coord;   /* minimum coordinate of segment       */\n    FT_Short    max_coord;   /* maximum coordinate of segment       */\n    FT_Short    height;      /* the hinted segment height           */\n\n    AF_Edge     edge;        /* the segment's parent edge           */\n    AF_Segment  edge_next;   /* link to next segment in parent edge */\n\n    AF_Segment  link;        /* (stem) link segment        */\n    AF_Segment  serif;       /* primary segment for serifs */\n    FT_Pos      num_linked;  /* number of linked segments  */\n    FT_Pos      score;       /* used during stem matching  */\n    FT_Pos      len;         /* used during stem matching  */\n\n    AF_Point    first;       /* first point in edge segment */\n    AF_Point    last;        /* last point in edge segment  */\n\n  } AF_SegmentRec;\n\n\n  typedef struct  AF_EdgeRec_\n  {\n    FT_Short    fpos;       /* original, unscaled position (in font units) */\n    FT_Pos      opos;       /* original, scaled position                   */\n    FT_Pos      pos;        /* current position                            */\n\n    FT_Byte     flags;      /* edge flags                                   */\n    FT_Char     dir;        /* edge direction                               */\n    FT_Fixed    scale;      /* used to speed up interpolation between edges */\n\n    AF_Width    blue_edge;  /* non-NULL if this is a blue edge */\n    AF_Edge     link;       /* link edge                       */\n    AF_Edge     serif;      /* primary edge for serifs         */\n    FT_Short    num_linked; /* number of linked edges          */\n    FT_Int      score;      /* used during stem matching       */\n\n    AF_Segment  first;      /* first segment in edge */\n    AF_Segment  last;       /* last segment in edge  */\n\n  } AF_EdgeRec;\n\n\n  typedef struct  AF_AxisHintsRec_\n  {\n    FT_Int        num_segments; /* number of used segments      */\n    FT_Int        max_segments; /* number of allocated segments */\n    AF_Segment    segments;     /* segments array               */\n#ifdef AF_SORT_SEGMENTS\n    FT_Int        mid_segments;\n#endif\n\n    FT_Int        num_edges;    /* number of used edges      */\n    FT_Int        max_edges;    /* number of allocated edges */\n    AF_Edge       edges;        /* edges array               */\n\n    AF_Direction  major_dir;    /* either vertical or horizontal */\n\n  } AF_AxisHintsRec, *AF_AxisHints;\n\n\n  typedef struct  AF_GlyphHintsRec_\n  {\n    FT_Memory        memory;\n\n    FT_Fixed         x_scale;\n    FT_Pos           x_delta;\n\n    FT_Fixed         y_scale;\n    FT_Pos           y_delta;\n\n    FT_Int           max_points;    /* number of allocated points */\n    FT_Int           num_points;    /* number of used points      */\n    AF_Point         points;        /* points array               */\n\n    FT_Int           max_contours;  /* number of allocated contours */\n    FT_Int           num_contours;  /* number of used contours      */\n    AF_Point*        contours;      /* contours array               */\n\n    AF_AxisHintsRec  axis[AF_DIMENSION_MAX];\n\n    FT_UInt32        scaler_flags;  /* copy of scaler flags    */\n    FT_UInt32        other_flags;   /* free for style-specific */\n                                    /* implementations         */\n    AF_StyleMetrics  metrics;\n\n    FT_Pos           xmin_delta;    /* used for warping */\n    FT_Pos           xmax_delta;\n\n  } AF_GlyphHintsRec;\n\n\n#define AF_HINTS_TEST_SCALER( h, f )  ( (h)->scaler_flags & (f) )\n#define AF_HINTS_TEST_OTHER( h, f )   ( (h)->other_flags  & (f) )\n\n\n#ifdef FT_DEBUG_AUTOFIT\n\n#define AF_HINTS_DO_HORIZONTAL( h )                                     \\\n          ( !_af_debug_disable_horz_hints                            && \\\n            !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_HORIZONTAL ) )\n\n#define AF_HINTS_DO_VERTICAL( h )                                     \\\n          ( !_af_debug_disable_vert_hints                          && \\\n            !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_VERTICAL ) )\n\n#define AF_HINTS_DO_ADVANCE( h )                                \\\n          !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_ADVANCE )\n\n#define AF_HINTS_DO_BLUES( h )  ( !_af_debug_disable_blue_hints )\n\n#else /* !FT_DEBUG_AUTOFIT */\n\n#define AF_HINTS_DO_HORIZONTAL( h )                                \\\n          !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_HORIZONTAL )\n\n#define AF_HINTS_DO_VERTICAL( h )                                \\\n          !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_VERTICAL )\n\n#define AF_HINTS_DO_ADVANCE( h )                                \\\n          !AF_HINTS_TEST_SCALER( h, AF_SCALER_FLAG_NO_ADVANCE )\n\n#define AF_HINTS_DO_BLUES( h )  1\n\n#endif /* !FT_DEBUG_AUTOFIT */\n\n\n  FT_LOCAL( AF_Direction )\n  af_direction_compute( FT_Pos  dx,\n                        FT_Pos  dy );\n\n\n  FT_LOCAL( FT_Error )\n  af_axis_hints_new_segment( AF_AxisHints  axis,\n                             FT_Memory     memory,\n                             AF_Segment   *asegment );\n\n  FT_LOCAL( FT_Error)\n  af_axis_hints_new_edge( AF_AxisHints  axis,\n                          FT_Int        fpos,\n                          AF_Direction  dir,\n                          FT_Memory     memory,\n                          AF_Edge      *edge );\n\n  FT_LOCAL( void )\n  af_glyph_hints_init( AF_GlyphHints  hints,\n                       FT_Memory      memory );\n\n  FT_LOCAL( void )\n  af_glyph_hints_rescale( AF_GlyphHints    hints,\n                          AF_StyleMetrics  metrics );\n\n  FT_LOCAL( FT_Error )\n  af_glyph_hints_reload( AF_GlyphHints  hints,\n                         FT_Outline*    outline );\n\n  FT_LOCAL( void )\n  af_glyph_hints_save( AF_GlyphHints  hints,\n                       FT_Outline*    outline );\n\n  FT_LOCAL( void )\n  af_glyph_hints_align_edge_points( AF_GlyphHints  hints,\n                                    AF_Dimension   dim );\n\n  FT_LOCAL( void )\n  af_glyph_hints_align_strong_points( AF_GlyphHints  hints,\n                                      AF_Dimension   dim );\n\n  FT_LOCAL( void )\n  af_glyph_hints_align_weak_points( AF_GlyphHints  hints,\n                                    AF_Dimension   dim );\n\n#ifdef AF_CONFIG_OPTION_USE_WARPER\n  FT_LOCAL( void )\n  af_glyph_hints_scale_dim( AF_GlyphHints  hints,\n                            AF_Dimension   dim,\n                            FT_Fixed       scale,\n                            FT_Pos         delta );\n#endif\n\n  FT_LOCAL( void )\n  af_glyph_hints_done( AF_GlyphHints  hints );\n\n/* */\n\n#define AF_SEGMENT_LEN( seg )          ( (seg)->max_coord - (seg)->min_coord )\n\n#define AF_SEGMENT_DIST( seg1, seg2 )  ( ( (seg1)->pos > (seg2)->pos )   \\\n                                           ? (seg1)->pos - (seg2)->pos   \\\n                                           : (seg2)->pos - (seg1)->pos )\n\n\nFT_END_HEADER\n\n#endif /* __AFHINTS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afindic.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afindic.c                                                              */\n/*                                                                         */\n/*    Auto-fitter hinting routines for Indic writing system (body).        */\n/*                                                                         */\n/*  Copyright 2007, 2011-2013 by                                           */\n/*  Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>.    */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"aftypes.h\"\n#include \"aflatin.h\"\n\n\n#ifdef AF_CONFIG_OPTION_INDIC\n\n#include \"afindic.h\"\n#include \"aferrors.h\"\n#include \"afcjk.h\"\n\n\n#ifdef AF_CONFIG_OPTION_USE_WARPER\n#include \"afwarp.h\"\n#endif\n\n\n  static FT_Error\n  af_indic_metrics_init( AF_CJKMetrics  metrics,\n                         FT_Face        face )\n  {\n    /* skip blue zone init in CJK routines */\n    FT_CharMap  oldmap = face->charmap;\n\n\n    metrics->units_per_em = face->units_per_EM;\n\n    if ( FT_Select_Charmap( face, FT_ENCODING_UNICODE ) )\n      face->charmap = NULL;\n    else\n    {\n      af_cjk_metrics_init_widths( metrics, face );\n#if 0\n      /* either need indic specific blue_chars[] or just skip blue zones */\n      af_cjk_metrics_init_blues( metrics, face, af_cjk_blue_chars );\n#endif\n      af_cjk_metrics_check_digits( metrics, face );\n    }\n\n    FT_Set_Charmap( face, oldmap );\n\n    return FT_Err_Ok;\n  }\n\n\n  static void\n  af_indic_metrics_scale( AF_CJKMetrics  metrics,\n                          AF_Scaler      scaler )\n  {\n    /* use CJK routines */\n    af_cjk_metrics_scale( metrics, scaler );\n  }\n\n\n  static FT_Error\n  af_indic_hints_init( AF_GlyphHints  hints,\n                       AF_CJKMetrics  metrics )\n  {\n    /* use CJK routines */\n    return af_cjk_hints_init( hints, metrics );\n  }\n\n\n  static FT_Error\n  af_indic_hints_apply( AF_GlyphHints  hints,\n                        FT_Outline*    outline,\n                        AF_CJKMetrics  metrics )\n  {\n    /* use CJK routines */\n    return af_cjk_hints_apply( hints, outline, metrics );\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                I N D I C   S C R I P T   C L A S S            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  AF_DEFINE_WRITING_SYSTEM_CLASS(\n    af_indic_writing_system_class,\n\n    AF_WRITING_SYSTEM_INDIC,\n\n    sizeof ( AF_CJKMetricsRec ),\n\n    (AF_WritingSystem_InitMetricsFunc) af_indic_metrics_init,\n    (AF_WritingSystem_ScaleMetricsFunc)af_indic_metrics_scale,\n    (AF_WritingSystem_DoneMetricsFunc) NULL,\n\n    (AF_WritingSystem_InitHintsFunc)   af_indic_hints_init,\n    (AF_WritingSystem_ApplyHintsFunc)  af_indic_hints_apply\n  )\n\n\n#else /* !AF_CONFIG_OPTION_INDIC */\n\n\n  AF_DEFINE_WRITING_SYSTEM_CLASS(\n    af_indic_writing_system_class,\n\n    AF_WRITING_SYSTEM_INDIC,\n\n    sizeof ( AF_CJKMetricsRec ),\n\n    (AF_WritingSystem_InitMetricsFunc) NULL,\n    (AF_WritingSystem_ScaleMetricsFunc)NULL,\n    (AF_WritingSystem_DoneMetricsFunc) NULL,\n\n    (AF_WritingSystem_InitHintsFunc)   NULL,\n    (AF_WritingSystem_ApplyHintsFunc)  NULL\n  )\n\n\n#endif /* !AF_CONFIG_OPTION_INDIC */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afindic.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afindic.h                                                              */\n/*                                                                         */\n/*    Auto-fitter hinting routines for Indic writing system                */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 2007, 2012, 2013 by                                          */\n/*  Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>.    */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __AFINDIC_H__\n#define __AFINDIC_H__\n\n#include \"afhints.h\"\n\n\nFT_BEGIN_HEADER\n\n\n  /* the `indic' writing system */\n\n  AF_DECLARE_WRITING_SYSTEM_CLASS( af_indic_writing_system_class )\n\n\n/* */\n\nFT_END_HEADER\n\n#endif /* __AFINDIC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/aflatin.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  aflatin.c                                                              */\n/*                                                                         */\n/*    Auto-fitter hinting routines for latin writing system (body).        */\n/*                                                                         */\n/*  Copyright 2003-2014 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_ADVANCES_H\n#include FT_INTERNAL_DEBUG_H\n\n#include \"afglobal.h\"\n#include \"afpic.h\"\n#include \"aflatin.h\"\n#include \"aferrors.h\"\n\n\n#ifdef AF_CONFIG_OPTION_USE_WARPER\n#include \"afwarp.h\"\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_aflatin\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****            L A T I N   G L O B A L   M E T R I C S            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* Find segments and links, compute all stem widths, and initialize */\n  /* standard width and height for the glyph with given charcode.     */\n\n  FT_LOCAL_DEF( void )\n  af_latin_metrics_init_widths( AF_LatinMetrics  metrics,\n                                FT_Face          face )\n  {\n    /* scan the array of segments in each direction */\n    AF_GlyphHintsRec  hints[1];\n\n\n    FT_TRACE5(( \"\\n\"\n                \"latin standard widths computation (style `%s')\\n\"\n                \"=====================================================\\n\"\n                \"\\n\",\n                af_style_names[metrics->root.style_class->style] ));\n\n    af_glyph_hints_init( hints, face->memory );\n\n    metrics->axis[AF_DIMENSION_HORZ].width_count = 0;\n    metrics->axis[AF_DIMENSION_VERT].width_count = 0;\n\n    {\n      FT_Error            error;\n      FT_ULong            glyph_index;\n      FT_Long             y_offset;\n      int                 dim;\n      AF_LatinMetricsRec  dummy[1];\n      AF_Scaler           scaler = &dummy->root.scaler;\n\n#ifdef FT_CONFIG_OPTION_PIC\n      AF_FaceGlobals  globals = metrics->root.globals;\n#endif\n\n      AF_StyleClass   style_class  = metrics->root.style_class;\n      AF_ScriptClass  script_class = AF_SCRIPT_CLASSES_GET\n                                       [style_class->script];\n\n      FT_UInt32  standard_char;\n\n\n      /*\n       * We check more than a single standard character to catch features\n       * like `c2sc' (small caps from caps) that don't contain lowercase\n       * letters by definition, or other features that mainly operate on\n       * numerals.\n       */\n\n      standard_char = script_class->standard_char1;\n      af_get_char_index( &metrics->root,\n                         standard_char,\n                         &glyph_index,\n                         &y_offset );\n      if ( !glyph_index )\n      {\n        if ( script_class->standard_char2 )\n        {\n          standard_char = script_class->standard_char2;\n          af_get_char_index( &metrics->root,\n                             standard_char,\n                             &glyph_index,\n                             &y_offset );\n          if ( !glyph_index )\n          {\n            if ( script_class->standard_char3 )\n            {\n              standard_char = script_class->standard_char3;\n              af_get_char_index( &metrics->root,\n                                 standard_char,\n                                 &glyph_index,\n                                 &y_offset );\n              if ( !glyph_index )\n                goto Exit;\n            }\n            else\n              goto Exit;\n          }\n        }\n        else\n          goto Exit;\n      }\n\n      FT_TRACE5(( \"standard character: U+%04lX (glyph index %d)\\n\",\n                  standard_char, glyph_index ));\n\n      error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );\n      if ( error || face->glyph->outline.n_points <= 0 )\n        goto Exit;\n\n      FT_ZERO( dummy );\n\n      dummy->units_per_em = metrics->units_per_em;\n\n      scaler->x_scale = 0x10000L;\n      scaler->y_scale = 0x10000L;\n      scaler->x_delta = 0;\n      scaler->y_delta = 0;\n\n      scaler->face        = face;\n      scaler->render_mode = FT_RENDER_MODE_NORMAL;\n      scaler->flags       = 0;\n\n      af_glyph_hints_rescale( hints, (AF_StyleMetrics)dummy );\n\n      error = af_glyph_hints_reload( hints, &face->glyph->outline );\n      if ( error )\n        goto Exit;\n\n      for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )\n      {\n        AF_LatinAxis  axis    = &metrics->axis[dim];\n        AF_AxisHints  axhints = &hints->axis[dim];\n        AF_Segment    seg, limit, link;\n        FT_UInt       num_widths = 0;\n\n\n        error = af_latin_hints_compute_segments( hints,\n                                                 (AF_Dimension)dim );\n        if ( error )\n          goto Exit;\n\n        /*\n         *  We assume that the glyphs selected for the stem width\n         *  computation are `featureless' enough so that the linking\n         *  algorithm works fine without adjustments of its scoring\n         *  function.\n         */\n        af_latin_hints_link_segments( hints,\n                                      0,\n                                      NULL,\n                                      (AF_Dimension)dim );\n\n        seg   = axhints->segments;\n        limit = seg + axhints->num_segments;\n\n        for ( ; seg < limit; seg++ )\n        {\n          link = seg->link;\n\n          /* we only consider stem segments there! */\n          if ( link && link->link == seg && link > seg )\n          {\n            FT_Pos  dist;\n\n\n            dist = seg->pos - link->pos;\n            if ( dist < 0 )\n              dist = -dist;\n\n            if ( num_widths < AF_LATIN_MAX_WIDTHS )\n              axis->widths[num_widths++].org = dist;\n          }\n        }\n\n        /* this also replaces multiple almost identical stem widths */\n        /* with a single one (the value 100 is heuristic)           */\n        af_sort_and_quantize_widths( &num_widths, axis->widths,\n                                     dummy->units_per_em / 100 );\n        axis->width_count = num_widths;\n      }\n\n    Exit:\n      for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )\n      {\n        AF_LatinAxis  axis = &metrics->axis[dim];\n        FT_Pos        stdw;\n\n\n        stdw = ( axis->width_count > 0 ) ? axis->widths[0].org\n                                         : AF_LATIN_CONSTANT( metrics, 50 );\n\n        /* let's try 20% of the smallest width */\n        axis->edge_distance_threshold = stdw / 5;\n        axis->standard_width          = stdw;\n        axis->extra_light             = 0;\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n        {\n          FT_UInt  i;\n\n\n          FT_TRACE5(( \"%s widths:\\n\",\n                      dim == AF_DIMENSION_VERT ? \"horizontal\"\n                                               : \"vertical\" ));\n\n          FT_TRACE5(( \"  %d (standard)\", axis->standard_width ));\n          for ( i = 1; i < axis->width_count; i++ )\n            FT_TRACE5(( \" %d\", axis->widths[i].org ));\n\n          FT_TRACE5(( \"\\n\" ));\n        }\n#endif\n      }\n    }\n\n    FT_TRACE5(( \"\\n\" ));\n\n    af_glyph_hints_done( hints );\n  }\n\n\n  /* Find all blue zones.  Flat segments give the reference points, */\n  /* round segments the overshoot positions.                        */\n\n  static void\n  af_latin_metrics_init_blues( AF_LatinMetrics  metrics,\n                               FT_Face          face )\n  {\n    FT_Pos        flats [AF_BLUE_STRING_MAX_LEN];\n    FT_Pos        rounds[AF_BLUE_STRING_MAX_LEN];\n\n    FT_Int        num_flats;\n    FT_Int        num_rounds;\n\n    AF_LatinBlue  blue;\n    FT_Error      error;\n    AF_LatinAxis  axis = &metrics->axis[AF_DIMENSION_VERT];\n    FT_Outline    outline;\n\n    AF_StyleClass  sc = metrics->root.style_class;\n\n    AF_Blue_Stringset         bss = sc->blue_stringset;\n    const AF_Blue_StringRec*  bs  = &af_blue_stringsets[bss];\n\n\n    /* we walk over the blue character strings as specified in the */\n    /* style's entry in the `af_blue_stringset' array              */\n\n    FT_TRACE5(( \"latin blue zones computation\\n\"\n                \"============================\\n\"\n                \"\\n\" ));\n\n    for ( ; bs->string != AF_BLUE_STRING_MAX; bs++ )\n    {\n      const char*  p = &af_blue_strings[bs->string];\n      FT_Pos*      blue_ref;\n      FT_Pos*      blue_shoot;\n\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n      {\n        FT_Bool  have_flag = 0;\n\n\n        FT_TRACE5(( \"blue zone %d\", axis->blue_count ));\n\n        if ( bs->properties )\n        {\n          FT_TRACE5(( \" (\" ));\n\n          if ( AF_LATIN_IS_TOP_BLUE( bs ) )\n          {\n            FT_TRACE5(( \"top\" ));\n            have_flag = 1;\n          }\n\n          if ( AF_LATIN_IS_NEUTRAL_BLUE( bs ) )\n          {\n            if ( have_flag )\n              FT_TRACE5(( \", \" ));\n            FT_TRACE5(( \"neutral\" ));\n            have_flag = 1;\n          }\n\n          if ( AF_LATIN_IS_X_HEIGHT_BLUE( bs ) )\n          {\n            if ( have_flag )\n              FT_TRACE5(( \", \" ));\n            FT_TRACE5(( \"small top\" ));\n            have_flag = 1;\n          }\n\n          if ( AF_LATIN_IS_LONG_BLUE( bs ) )\n          {\n            if ( have_flag )\n              FT_TRACE5(( \", \" ));\n            FT_TRACE5(( \"long\" ));\n          }\n\n          FT_TRACE5(( \")\" ));\n        }\n\n        FT_TRACE5(( \":\\n\" ));\n      }\n#endif /* FT_DEBUG_LEVEL_TRACE */\n\n      num_flats  = 0;\n      num_rounds = 0;\n\n      while ( *p )\n      {\n        FT_ULong    ch;\n        FT_ULong    glyph_index;\n        FT_Long     y_offset;\n        FT_Pos      best_y;                            /* same as points.y */\n        FT_Int      best_point, best_contour_first, best_contour_last;\n        FT_Vector*  points;\n        FT_Bool     round = 0;\n\n\n        GET_UTF8_CHAR( ch, p );\n\n        /* load the character in the face -- skip unknown or empty ones */\n        af_get_char_index( &metrics->root, ch, &glyph_index, &y_offset );\n        if ( glyph_index == 0 )\n        {\n          FT_TRACE5(( \"  U+%04lX unavailable\\n\", ch ));\n          continue;\n        }\n\n        error   = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );\n        outline = face->glyph->outline;\n        if ( error || outline.n_points <= 0 )\n        {\n          FT_TRACE5(( \"  U+%04lX contains no outlines\\n\", ch ));\n          continue;\n        }\n\n        /* now compute min or max point indices and coordinates */\n        points             = outline.points;\n        best_point         = -1;\n        best_y             = 0;  /* make compiler happy */\n        best_contour_first = 0;  /* ditto */\n        best_contour_last  = 0;  /* ditto */\n\n        {\n          FT_Int  nn;\n          FT_Int  first = 0;\n          FT_Int  last  = -1;\n\n\n          for ( nn = 0; nn < outline.n_contours; first = last + 1, nn++ )\n          {\n            FT_Int  old_best_point = best_point;\n            FT_Int  pp;\n\n\n            last = outline.contours[nn];\n\n            /* Avoid single-point contours since they are never rasterized. */\n            /* In some fonts, they correspond to mark attachment points     */\n            /* that are way outside of the glyph's real outline.            */\n            if ( last <= first )\n              continue;\n\n            if ( AF_LATIN_IS_TOP_BLUE( bs ) )\n            {\n              for ( pp = first; pp <= last; pp++ )\n                if ( best_point < 0 || points[pp].y > best_y )\n                {\n                  best_point = pp;\n                  best_y     = points[pp].y;\n                }\n            }\n            else\n            {\n              for ( pp = first; pp <= last; pp++ )\n                if ( best_point < 0 || points[pp].y < best_y )\n                {\n                  best_point = pp;\n                  best_y     = points[pp].y;\n                }\n            }\n\n            if ( best_point != old_best_point )\n            {\n              best_contour_first = first;\n              best_contour_last  = last;\n            }\n          }\n        }\n\n        /* now check whether the point belongs to a straight or round   */\n        /* segment; we first need to find in which contour the extremum */\n        /* lies, then inspect its previous and next points              */\n        if ( best_point >= 0 )\n        {\n          FT_Pos  best_x = points[best_point].x;\n          FT_Int  prev, next;\n          FT_Int  best_segment_first, best_segment_last;\n          FT_Int  best_on_point_first, best_on_point_last;\n          FT_Pos  dist;\n\n\n          best_segment_first = best_point;\n          best_segment_last  = best_point;\n\n          if ( FT_CURVE_TAG( outline.tags[best_point] ) == FT_CURVE_TAG_ON )\n          {\n            best_on_point_first = best_point;\n            best_on_point_last  = best_point;\n          }\n          else\n          {\n            best_on_point_first = -1;\n            best_on_point_last  = -1;\n          }\n\n          /* look for the previous and next points on the contour  */\n          /* that are not on the same Y coordinate, then threshold */\n          /* the `closeness'...                                    */\n          prev = best_point;\n          next = prev;\n\n          do\n          {\n            if ( prev > best_contour_first )\n              prev--;\n            else\n              prev = best_contour_last;\n\n            dist = FT_ABS( points[prev].y - best_y );\n            /* accept a small distance or a small angle (both values are */\n            /* heuristic; value 20 corresponds to approx. 2.9 degrees)   */\n            if ( dist > 5 )\n              if ( FT_ABS( points[prev].x - best_x ) <= 20 * dist )\n                break;\n\n            best_segment_first = prev;\n\n            if ( FT_CURVE_TAG( outline.tags[prev] ) == FT_CURVE_TAG_ON )\n            {\n              best_on_point_first = prev;\n              if ( best_on_point_last < 0 )\n                best_on_point_last = prev;\n            }\n\n          } while ( prev != best_point );\n\n          do\n          {\n            if ( next < best_contour_last )\n              next++;\n            else\n              next = best_contour_first;\n\n            dist = FT_ABS( points[next].y - best_y );\n            if ( dist > 5 )\n              if ( FT_ABS( points[next].x - best_x ) <= 20 * dist )\n                break;\n\n            best_segment_last = next;\n\n            if ( FT_CURVE_TAG( outline.tags[next] ) == FT_CURVE_TAG_ON )\n            {\n              best_on_point_last = next;\n              if ( best_on_point_first < 0 )\n                best_on_point_first = next;\n            }\n\n          } while ( next != best_point );\n\n          if ( AF_LATIN_IS_LONG_BLUE( bs ) )\n          {\n            /* If this flag is set, we have an additional constraint to  */\n            /* get the blue zone distance: Find a segment of the topmost */\n            /* (or bottommost) contour that is longer than a heuristic   */\n            /* threshold.  This ensures that small bumps in the outline  */\n            /* are ignored (for example, the `vertical serifs' found in  */\n            /* many Hebrew glyph designs).                               */\n\n            /* If this segment is long enough, we are done.  Otherwise,  */\n            /* search the segment next to the extremum that is long      */\n            /* enough, has the same direction, and a not too large       */\n            /* vertical distance from the extremum.  Note that the       */\n            /* algorithm doesn't check whether the found segment is      */\n            /* actually the one (vertically) nearest to the extremum.    */\n\n            /* heuristic threshold value */\n            FT_Pos  length_threshold = metrics->units_per_em / 25;\n\n\n            dist = FT_ABS( points[best_segment_last].x -\n                             points[best_segment_first].x );\n\n            if ( dist < length_threshold                       &&\n                 best_segment_last - best_segment_first + 2 <=\n                   best_contour_last - best_contour_first      )\n            {\n              /* heuristic threshold value */\n              FT_Pos  height_threshold = metrics->units_per_em / 4;\n\n              FT_Int   first;\n              FT_Int   last;\n              FT_Bool  hit;\n\n              /* we intentionally declare these two variables        */\n              /* outside of the loop since various compilers emit    */\n              /* incorrect warning messages otherwise, talking about */\n              /* `possibly uninitialized variables'                  */\n              FT_Int  p_first = 0;            /* make compiler happy */\n              FT_Int  p_last  = 0;\n\n              FT_Bool  left2right;\n\n\n              /* compute direction */\n              prev = best_point;\n\n              do\n              {\n                if ( prev > best_contour_first )\n                  prev--;\n                else\n                  prev = best_contour_last;\n\n                if ( points[prev].x != best_x )\n                  break;\n\n              } while ( prev != best_point );\n\n              /* skip glyph for the degenerate case */\n              if ( prev == best_point )\n                continue;\n\n              left2right = FT_BOOL( points[prev].x < points[best_point].x );\n\n              first = best_segment_last;\n              last  = first;\n              hit   = 0;\n\n              do\n              {\n                FT_Bool  l2r;\n                FT_Pos   d;\n\n\n                if ( !hit )\n                {\n                  /* no hit; adjust first point */\n                  first = last;\n\n                  /* also adjust first and last on point */\n                  if ( FT_CURVE_TAG( outline.tags[first] ) ==\n                         FT_CURVE_TAG_ON )\n                  {\n                    p_first = first;\n                    p_last  = first;\n                  }\n                  else\n                  {\n                    p_first = -1;\n                    p_last  = -1;\n                  }\n\n                  hit = 1;\n                }\n\n                if ( last < best_contour_last )\n                  last++;\n                else\n                  last = best_contour_first;\n\n                if ( FT_ABS( best_y - points[first].y ) > height_threshold )\n                {\n                  /* vertical distance too large */\n                  hit = 0;\n                  continue;\n                }\n\n                /* same test as above */\n                dist = FT_ABS( points[last].y - points[first].y );\n                if ( dist > 5 )\n                  if ( FT_ABS( points[last].x - points[first].x ) <=\n                         20 * dist )\n                  {\n                    hit = 0;\n                    continue;\n                  }\n\n                if ( FT_CURVE_TAG( outline.tags[last] ) == FT_CURVE_TAG_ON )\n                {\n                  p_last = last;\n                  if ( p_first < 0 )\n                    p_first = last;\n                }\n\n                l2r = FT_BOOL( points[first].x < points[last].x );\n                d   = FT_ABS( points[last].x - points[first].x );\n\n                if ( l2r == left2right     &&\n                     d >= length_threshold )\n                {\n                  /* all constraints are met; update segment after finding */\n                  /* its end                                               */\n                  do\n                  {\n                    if ( last < best_contour_last )\n                      last++;\n                    else\n                      last = best_contour_first;\n\n                    d = FT_ABS( points[last].y - points[first].y );\n                    if ( d > 5 )\n                      if ( FT_ABS( points[next].x - points[first].x ) <=\n                             20 * dist )\n                      {\n                        if ( last > best_contour_first )\n                          last--;\n                        else\n                          last = best_contour_last;\n                        break;\n                      }\n\n                    p_last = last;\n\n                    if ( FT_CURVE_TAG( outline.tags[last] ) ==\n                           FT_CURVE_TAG_ON )\n                    {\n                      p_last = last;\n                      if ( p_first < 0 )\n                        p_first = last;\n                    }\n\n                  } while ( last != best_segment_first );\n\n                  best_y = points[first].y;\n\n                  best_segment_first = first;\n                  best_segment_last  = last;\n\n                  best_on_point_first = p_first;\n                  best_on_point_last  = p_last;\n\n                  break;\n                }\n\n              } while ( last != best_segment_first );\n            }\n          }\n\n          /* for computing blue zones, we add the y offset as returned */\n          /* by the currently used OpenType feature -- for example,    */\n          /* superscript glyphs might be identical to subscript glyphs */\n          /* with a vertical shift                                     */\n          best_y += y_offset;\n\n          FT_TRACE5(( \"  U+%04lX: best_y = %5ld\", ch, best_y ));\n\n          /* now set the `round' flag depending on the segment's kind: */\n          /*                                                           */\n          /* - if the horizontal distance between the first and last   */\n          /*   `on' point is larger than upem/8 (value 8 is heuristic) */\n          /*   we have a flat segment                                  */\n          /* - if either the first or the last point of the segment is */\n          /*   an `off' point, the segment is round, otherwise it is   */\n          /*   flat                                                    */\n          if ( best_on_point_first >= 0                               &&\n               best_on_point_last >= 0                                &&\n               (FT_UInt)( FT_ABS( points[best_on_point_last].x -\n                                  points[best_on_point_first].x ) ) >\n                 metrics->units_per_em / 8                            )\n            round = 0;\n          else\n            round = FT_BOOL(\n                      FT_CURVE_TAG( outline.tags[best_segment_first] ) !=\n                        FT_CURVE_TAG_ON                                   ||\n                      FT_CURVE_TAG( outline.tags[best_segment_last]  ) !=\n                        FT_CURVE_TAG_ON                                   );\n\n          if ( round && AF_LATIN_IS_NEUTRAL_BLUE( bs ) )\n          {\n            /* only use flat segments for a neutral blue zone */\n            FT_TRACE5(( \" (round, skipped)\\n\" ));\n            continue;\n          }\n\n          FT_TRACE5(( \" (%s)\\n\", round ? \"round\" : \"flat\" ));\n        }\n\n        if ( round )\n          rounds[num_rounds++] = best_y;\n        else\n          flats[num_flats++]   = best_y;\n      }\n\n      if ( num_flats == 0 && num_rounds == 0 )\n      {\n        /*\n         *  we couldn't find a single glyph to compute this blue zone,\n         *  we will simply ignore it then\n         */\n        FT_TRACE5(( \"  empty\\n\" ));\n        continue;\n      }\n\n      /* we have computed the contents of the `rounds' and `flats' tables, */\n      /* now determine the reference and overshoot position of the blue -- */\n      /* we simply take the median value after a simple sort               */\n      af_sort_pos( num_rounds, rounds );\n      af_sort_pos( num_flats,  flats );\n\n      blue       = &axis->blues[axis->blue_count];\n      blue_ref   = &blue->ref.org;\n      blue_shoot = &blue->shoot.org;\n\n      axis->blue_count++;\n\n      if ( num_flats == 0 )\n      {\n        *blue_ref   =\n        *blue_shoot = rounds[num_rounds / 2];\n      }\n      else if ( num_rounds == 0 )\n      {\n        *blue_ref   =\n        *blue_shoot = flats[num_flats / 2];\n      }\n      else\n      {\n        *blue_ref   = flats [num_flats  / 2];\n        *blue_shoot = rounds[num_rounds / 2];\n      }\n\n      /* there are sometimes problems: if the overshoot position of top     */\n      /* zones is under its reference position, or the opposite for bottom  */\n      /* zones.  We must thus check everything there and correct the errors */\n      if ( *blue_shoot != *blue_ref )\n      {\n        FT_Pos   ref      = *blue_ref;\n        FT_Pos   shoot    = *blue_shoot;\n        FT_Bool  over_ref = FT_BOOL( shoot > ref );\n\n\n        if ( AF_LATIN_IS_TOP_BLUE( bs ) ^ over_ref )\n        {\n          *blue_ref   =\n          *blue_shoot = ( shoot + ref ) / 2;\n\n          FT_TRACE5(( \"  [overshoot smaller than reference,\"\n                      \" taking mean value]\\n\" ));\n        }\n      }\n\n      blue->flags = 0;\n      if ( AF_LATIN_IS_TOP_BLUE( bs ) )\n        blue->flags |= AF_LATIN_BLUE_TOP;\n      if ( AF_LATIN_IS_NEUTRAL_BLUE( bs ) )\n        blue->flags |= AF_LATIN_BLUE_NEUTRAL;\n\n      /*\n       * The following flag is used later to adjust the y and x scales\n       * in order to optimize the pixel grid alignment of the top of small\n       * letters.\n       */\n      if ( AF_LATIN_IS_X_HEIGHT_BLUE( bs ) )\n        blue->flags |= AF_LATIN_BLUE_ADJUSTMENT;\n\n      FT_TRACE5(( \"    -> reference = %ld\\n\"\n                  \"       overshoot = %ld\\n\",\n                  *blue_ref, *blue_shoot ));\n    }\n\n    FT_TRACE5(( \"\\n\" ));\n\n    return;\n  }\n\n\n  /* Check whether all ASCII digits have the same advance width. */\n\n  FT_LOCAL_DEF( void )\n  af_latin_metrics_check_digits( AF_LatinMetrics  metrics,\n                                 FT_Face          face )\n  {\n    FT_UInt   i;\n    FT_Bool   started = 0, same_width = 1;\n    FT_Fixed  advance, old_advance = 0;\n\n\n    /* digit `0' is 0x30 in all supported charmaps */\n    for ( i = 0x30; i <= 0x39; i++ )\n    {\n      FT_ULong  glyph_index;\n      FT_Long   y_offset;\n\n\n      af_get_char_index( &metrics->root, i, &glyph_index, &y_offset );\n      if ( glyph_index == 0 )\n        continue;\n\n      if ( FT_Get_Advance( face, glyph_index,\n                           FT_LOAD_NO_SCALE         |\n                           FT_LOAD_NO_HINTING       |\n                           FT_LOAD_IGNORE_TRANSFORM,\n                           &advance ) )\n        continue;\n\n      if ( started )\n      {\n        if ( advance != old_advance )\n        {\n          same_width = 0;\n          break;\n        }\n      }\n      else\n      {\n        old_advance = advance;\n        started     = 1;\n      }\n    }\n\n    metrics->root.digits_have_same_width = same_width;\n  }\n\n\n  /* Initialize global metrics. */\n\n  FT_LOCAL_DEF( FT_Error )\n  af_latin_metrics_init( AF_LatinMetrics  metrics,\n                         FT_Face          face )\n  {\n    FT_CharMap  oldmap = face->charmap;\n\n\n    metrics->units_per_em = face->units_per_EM;\n\n    if ( !FT_Select_Charmap( face, FT_ENCODING_UNICODE ) )\n    {\n      af_latin_metrics_init_widths( metrics, face );\n      af_latin_metrics_init_blues( metrics, face );\n      af_latin_metrics_check_digits( metrics, face );\n    }\n\n    FT_Set_Charmap( face, oldmap );\n    return FT_Err_Ok;\n  }\n\n\n  /* Adjust scaling value, then scale and shift widths   */\n  /* and blue zones (if applicable) for given dimension. */\n\n  static void\n  af_latin_metrics_scale_dim( AF_LatinMetrics  metrics,\n                              AF_Scaler        scaler,\n                              AF_Dimension     dim )\n  {\n    FT_Fixed      scale;\n    FT_Pos        delta;\n    AF_LatinAxis  axis;\n    FT_UInt       nn;\n\n\n    if ( dim == AF_DIMENSION_HORZ )\n    {\n      scale = scaler->x_scale;\n      delta = scaler->x_delta;\n    }\n    else\n    {\n      scale = scaler->y_scale;\n      delta = scaler->y_delta;\n    }\n\n    axis = &metrics->axis[dim];\n\n    if ( axis->org_scale == scale && axis->org_delta == delta )\n      return;\n\n    axis->org_scale = scale;\n    axis->org_delta = delta;\n\n    /*\n     * correct X and Y scale to optimize the alignment of the top of small\n     * letters to the pixel grid\n     */\n    {\n      AF_LatinAxis  Axis = &metrics->axis[AF_DIMENSION_VERT];\n      AF_LatinBlue  blue = NULL;\n\n\n      for ( nn = 0; nn < Axis->blue_count; nn++ )\n      {\n        if ( Axis->blues[nn].flags & AF_LATIN_BLUE_ADJUSTMENT )\n        {\n          blue = &Axis->blues[nn];\n          break;\n        }\n      }\n\n      if ( blue )\n      {\n        FT_Pos   scaled;\n        FT_Pos   threshold;\n        FT_Pos   fitted;\n        FT_UInt  limit;\n        FT_UInt  ppem;\n\n\n        scaled    = FT_MulFix( blue->shoot.org, scaler->y_scale );\n        ppem      = metrics->root.scaler.face->size->metrics.x_ppem;\n        limit     = metrics->root.globals->increase_x_height;\n        threshold = 40;\n\n        /* if the `increase-x-height' property is active, */\n        /* we round up much more often                    */\n        if ( limit                                 &&\n             ppem <= limit                         &&\n             ppem >= AF_PROP_INCREASE_X_HEIGHT_MIN )\n          threshold = 52;\n\n        fitted = ( scaled + threshold ) & ~63;\n\n        if ( scaled != fitted )\n        {\n#if 0\n          if ( dim == AF_DIMENSION_HORZ )\n          {\n            if ( fitted < scaled )\n              scale -= scale / 50;  /* scale *= 0.98 */\n          }\n          else\n#endif\n          if ( dim == AF_DIMENSION_VERT )\n          {\n            scale = FT_MulDiv( scale, fitted, scaled );\n\n            FT_TRACE5((\n              \"af_latin_metrics_scale_dim:\"\n              \" x height alignment (style `%s'):\\n\"\n              \"                           \"\n              \" vertical scaling changed from %.4f to %.4f (by %d%%)\\n\"\n              \"\\n\",\n              af_style_names[metrics->root.style_class->style],\n              axis->org_scale / 65536.0,\n              scale / 65536.0,\n              ( fitted - scaled ) * 100 / scaled ));\n          }\n        }\n      }\n    }\n\n    axis->scale = scale;\n    axis->delta = delta;\n\n    if ( dim == AF_DIMENSION_HORZ )\n    {\n      metrics->root.scaler.x_scale = scale;\n      metrics->root.scaler.x_delta = delta;\n    }\n    else\n    {\n      metrics->root.scaler.y_scale = scale;\n      metrics->root.scaler.y_delta = delta;\n    }\n\n    FT_TRACE5(( \"%s widths (style `%s')\\n\",\n                dim == AF_DIMENSION_HORZ ? \"horizontal\" : \"vertical\",\n                af_style_names[metrics->root.style_class->style] ));\n\n    /* scale the widths */\n    for ( nn = 0; nn < axis->width_count; nn++ )\n    {\n      AF_Width  width = axis->widths + nn;\n\n\n      width->cur = FT_MulFix( width->org, scale );\n      width->fit = width->cur;\n\n      FT_TRACE5(( \"  %d scaled to %.2f\\n\",\n                  width->org,\n                  width->cur / 64.0 ));\n    }\n\n    FT_TRACE5(( \"\\n\" ));\n\n    /* an extra-light axis corresponds to a standard width that is */\n    /* smaller than 5/8 pixels                                     */\n    axis->extra_light =\n      (FT_Bool)( FT_MulFix( axis->standard_width, scale ) < 32 + 8 );\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n    if ( axis->extra_light )\n      FT_TRACE5(( \"`%s' style is extra light (at current resolution)\\n\"\n                  \"\\n\",\n                  af_style_names[metrics->root.style_class->style] ));\n#endif\n\n    if ( dim == AF_DIMENSION_VERT )\n    {\n      FT_TRACE5(( \"blue zones (style `%s')\\n\",\n                  af_style_names[metrics->root.style_class->style] ));\n\n      /* scale the blue zones */\n      for ( nn = 0; nn < axis->blue_count; nn++ )\n      {\n        AF_LatinBlue  blue = &axis->blues[nn];\n        FT_Pos        dist;\n\n\n        blue->ref.cur   = FT_MulFix( blue->ref.org, scale ) + delta;\n        blue->ref.fit   = blue->ref.cur;\n        blue->shoot.cur = FT_MulFix( blue->shoot.org, scale ) + delta;\n        blue->shoot.fit = blue->shoot.cur;\n        blue->flags    &= ~AF_LATIN_BLUE_ACTIVE;\n\n        /* a blue zone is only active if it is less than 3/4 pixels tall */\n        dist = FT_MulFix( blue->ref.org - blue->shoot.org, scale );\n        if ( dist <= 48 && dist >= -48 )\n        {\n#if 0\n          FT_Pos  delta1;\n#endif\n          FT_Pos  delta2;\n\n\n          /* use discrete values for blue zone widths */\n\n#if 0\n\n          /* generic, original code */\n          delta1 = blue->shoot.org - blue->ref.org;\n          delta2 = delta1;\n          if ( delta1 < 0 )\n            delta2 = -delta2;\n\n          delta2 = FT_MulFix( delta2, scale );\n\n          if ( delta2 < 32 )\n            delta2 = 0;\n          else if ( delta2 < 64 )\n            delta2 = 32 + ( ( ( delta2 - 32 ) + 16 ) & ~31 );\n          else\n            delta2 = FT_PIX_ROUND( delta2 );\n\n          if ( delta1 < 0 )\n            delta2 = -delta2;\n\n          blue->ref.fit   = FT_PIX_ROUND( blue->ref.cur );\n          blue->shoot.fit = blue->ref.fit + delta2;\n\n#else\n\n          /* simplified version due to abs(dist) <= 48 */\n          delta2 = dist;\n          if ( dist < 0 )\n            delta2 = -delta2;\n\n          if ( delta2 < 32 )\n            delta2 = 0;\n          else if ( delta2 < 48 )\n            delta2 = 32;\n          else\n            delta2 = 64;\n\n          if ( dist < 0 )\n            delta2 = -delta2;\n\n          blue->ref.fit   = FT_PIX_ROUND( blue->ref.cur );\n          blue->shoot.fit = blue->ref.fit - delta2;\n\n#endif\n\n          blue->flags |= AF_LATIN_BLUE_ACTIVE;\n\n          FT_TRACE5(( \"  reference %d: %d scaled to %.2f%s\\n\"\n                      \"  overshoot %d: %d scaled to %.2f%s\\n\",\n                      nn,\n                      blue->ref.org,\n                      blue->ref.fit / 64.0,\n                      blue->flags & AF_LATIN_BLUE_ACTIVE ? \"\"\n                                                         : \" (inactive)\",\n                      nn,\n                      blue->shoot.org,\n                      blue->shoot.fit / 64.0,\n                      blue->flags & AF_LATIN_BLUE_ACTIVE ? \"\"\n                                                         : \" (inactive)\" ));\n        }\n      }\n    }\n  }\n\n\n  /* Scale global values in both directions. */\n\n  FT_LOCAL_DEF( void )\n  af_latin_metrics_scale( AF_LatinMetrics  metrics,\n                          AF_Scaler        scaler )\n  {\n    metrics->root.scaler.render_mode = scaler->render_mode;\n    metrics->root.scaler.face        = scaler->face;\n    metrics->root.scaler.flags       = scaler->flags;\n\n    af_latin_metrics_scale_dim( metrics, scaler, AF_DIMENSION_HORZ );\n    af_latin_metrics_scale_dim( metrics, scaler, AF_DIMENSION_VERT );\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****           L A T I N   G L Y P H   A N A L Y S I S             *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* Walk over all contours and compute its segments. */\n\n  FT_LOCAL_DEF( FT_Error )\n  af_latin_hints_compute_segments( AF_GlyphHints  hints,\n                                   AF_Dimension   dim )\n  {\n    AF_AxisHints   axis          = &hints->axis[dim];\n    FT_Memory      memory        = hints->memory;\n    FT_Error       error         = FT_Err_Ok;\n    AF_Segment     segment       = NULL;\n    AF_SegmentRec  seg0;\n    AF_Point*      contour       = hints->contours;\n    AF_Point*      contour_limit = contour + hints->num_contours;\n    AF_Direction   major_dir, segment_dir;\n\n\n    FT_ZERO( &seg0 );\n    seg0.score = 32000;\n    seg0.flags = AF_EDGE_NORMAL;\n\n    major_dir   = (AF_Direction)FT_ABS( axis->major_dir );\n    segment_dir = major_dir;\n\n    axis->num_segments = 0;\n\n    /* set up (u,v) in each point */\n    if ( dim == AF_DIMENSION_HORZ )\n    {\n      AF_Point  point = hints->points;\n      AF_Point  limit = point + hints->num_points;\n\n\n      for ( ; point < limit; point++ )\n      {\n        point->u = point->fx;\n        point->v = point->fy;\n      }\n    }\n    else\n    {\n      AF_Point  point = hints->points;\n      AF_Point  limit = point + hints->num_points;\n\n\n      for ( ; point < limit; point++ )\n      {\n        point->u = point->fy;\n        point->v = point->fx;\n      }\n    }\n\n    /* do each contour separately */\n    for ( ; contour < contour_limit; contour++ )\n    {\n      AF_Point  point   =  contour[0];\n      AF_Point  last    =  point->prev;\n      int       on_edge =  0;\n      FT_Pos    min_pos =  32000;  /* minimum segment pos != min_coord */\n      FT_Pos    max_pos = -32000;  /* maximum segment pos != max_coord */\n      FT_Bool   passed;\n\n\n      if ( point == last )  /* skip singletons -- just in case */\n        continue;\n\n      if ( FT_ABS( last->out_dir )  == major_dir &&\n           FT_ABS( point->out_dir ) == major_dir )\n      {\n        /* we are already on an edge, try to locate its start */\n        last = point;\n\n        for (;;)\n        {\n          point = point->prev;\n          if ( FT_ABS( point->out_dir ) != major_dir )\n          {\n            point = point->next;\n            break;\n          }\n          if ( point == last )\n            break;\n        }\n      }\n\n      last   = point;\n      passed = 0;\n\n      for (;;)\n      {\n        FT_Pos  u, v;\n\n\n        if ( on_edge )\n        {\n          u = point->u;\n          if ( u < min_pos )\n            min_pos = u;\n          if ( u > max_pos )\n            max_pos = u;\n\n          if ( point->out_dir != segment_dir || point == last )\n          {\n            /* we are just leaving an edge; record a new segment! */\n            segment->last = point;\n            segment->pos  = (FT_Short)( ( min_pos + max_pos ) >> 1 );\n\n            /* a segment is round if either its first or last point */\n            /* is a control point                                   */\n            if ( ( segment->first->flags | point->flags ) &\n                 AF_FLAG_CONTROL                          )\n              segment->flags |= AF_EDGE_ROUND;\n\n            /* compute segment size */\n            min_pos = max_pos = point->v;\n\n            v = segment->first->v;\n            if ( v < min_pos )\n              min_pos = v;\n            if ( v > max_pos )\n              max_pos = v;\n\n            segment->min_coord = (FT_Short)min_pos;\n            segment->max_coord = (FT_Short)max_pos;\n            segment->height    = (FT_Short)( segment->max_coord -\n                                             segment->min_coord );\n\n            on_edge = 0;\n            segment = NULL;\n            /* fall through */\n          }\n        }\n\n        /* now exit if we are at the start/end point */\n        if ( point == last )\n        {\n          if ( passed )\n            break;\n          passed = 1;\n        }\n\n        if ( !on_edge && FT_ABS( point->out_dir ) == major_dir )\n        {\n          /* this is the start of a new segment! */\n          segment_dir = (AF_Direction)point->out_dir;\n\n          error = af_axis_hints_new_segment( axis, memory, &segment );\n          if ( error )\n            goto Exit;\n\n          /* clear all segment fields */\n          segment[0] = seg0;\n\n          segment->dir      = (FT_Char)segment_dir;\n          min_pos = max_pos = point->u;\n          segment->first    = point;\n          segment->last     = point;\n\n          on_edge = 1;\n        }\n\n        point = point->next;\n      }\n\n    } /* contours */\n\n\n    /* now slightly increase the height of segments if this makes */\n    /* sense -- this is used to better detect and ignore serifs   */\n    {\n      AF_Segment  segments     = axis->segments;\n      AF_Segment  segments_end = segments + axis->num_segments;\n\n\n      for ( segment = segments; segment < segments_end; segment++ )\n      {\n        AF_Point  first   = segment->first;\n        AF_Point  last    = segment->last;\n        FT_Pos    first_v = first->v;\n        FT_Pos    last_v  = last->v;\n\n\n        if ( first_v < last_v )\n        {\n          AF_Point  p;\n\n\n          p = first->prev;\n          if ( p->v < first_v )\n            segment->height = (FT_Short)( segment->height +\n                                          ( ( first_v - p->v ) >> 1 ) );\n\n          p = last->next;\n          if ( p->v > last_v )\n            segment->height = (FT_Short)( segment->height +\n                                          ( ( p->v - last_v ) >> 1 ) );\n        }\n        else\n        {\n          AF_Point  p;\n\n\n          p = first->prev;\n          if ( p->v > first_v )\n            segment->height = (FT_Short)( segment->height +\n                                          ( ( p->v - first_v ) >> 1 ) );\n\n          p = last->next;\n          if ( p->v < last_v )\n            segment->height = (FT_Short)( segment->height +\n                                          ( ( last_v - p->v ) >> 1 ) );\n        }\n      }\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /* Link segments to form stems and serifs.  If `width_count' and      */\n  /* `widths' are non-zero, use them to fine-tune the scoring function. */\n\n  FT_LOCAL_DEF( void )\n  af_latin_hints_link_segments( AF_GlyphHints  hints,\n                                FT_UInt        width_count,\n                                AF_WidthRec*   widths,\n                                AF_Dimension   dim )\n  {\n    AF_AxisHints  axis          = &hints->axis[dim];\n    AF_Segment    segments      = axis->segments;\n    AF_Segment    segment_limit = segments + axis->num_segments;\n    FT_Pos        len_threshold, len_score, dist_score, max_width;\n    AF_Segment    seg1, seg2;\n\n\n    if ( width_count )\n      max_width = widths[width_count - 1].org;\n    else\n      max_width = 0;\n\n    /* a heuristic value to set up a minimum value for overlapping */\n    len_threshold = AF_LATIN_CONSTANT( hints->metrics, 8 );\n    if ( len_threshold == 0 )\n      len_threshold = 1;\n\n    /* a heuristic value to weight lengths */\n    len_score = AF_LATIN_CONSTANT( hints->metrics, 6000 );\n\n    /* a heuristic value to weight distances (no call to    */\n    /* AF_LATIN_CONSTANT needed, since we work on multiples */\n    /* of the stem width)                                   */\n    dist_score = 3000;\n\n    /* now compare each segment to the others */\n    for ( seg1 = segments; seg1 < segment_limit; seg1++ )\n    {\n      if ( seg1->dir != axis->major_dir )\n        continue;\n\n      /* search for stems having opposite directions, */\n      /* with seg1 to the `left' of seg2              */\n      for ( seg2 = segments; seg2 < segment_limit; seg2++ )\n      {\n        FT_Pos  pos1 = seg1->pos;\n        FT_Pos  pos2 = seg2->pos;\n\n\n        if ( seg1->dir + seg2->dir == 0 && pos2 > pos1 )\n        {\n          /* compute distance between the two segments */\n          FT_Pos  min = seg1->min_coord;\n          FT_Pos  max = seg1->max_coord;\n          FT_Pos  len;\n\n\n          if ( min < seg2->min_coord )\n            min = seg2->min_coord;\n\n          if ( max > seg2->max_coord )\n            max = seg2->max_coord;\n\n          /* compute maximum coordinate difference of the two segments */\n          /* (this is, how much they overlap)                          */\n          len = max - min;\n          if ( len >= len_threshold )\n          {\n            /*\n             *  The score is the sum of two demerits indicating the\n             *  `badness' of a fit, measured along the segments' main axis\n             *  and orthogonal to it, respectively.\n             *\n             *  o The less overlapping along the main axis, the worse it\n             *    is, causing a larger demerit.\n             *\n             *  o The nearer the orthogonal distance to a stem width, the\n             *    better it is, causing a smaller demerit.  For simplicity,\n             *    however, we only increase the demerit for values that\n             *    exceed the largest stem width.\n             */\n\n            FT_Pos  dist = pos2 - pos1;\n\n            FT_Pos  dist_demerit, score;\n\n\n            if ( max_width )\n            {\n              /* distance demerits are based on multiples of `max_width'; */\n              /* we scale by 1024 for getting more precision              */\n              FT_Pos  delta = ( dist << 10 ) / max_width - ( 1 << 10 );\n\n\n              if ( delta > 10000 )\n                dist_demerit = 32000;\n              else if ( delta > 0 )\n                dist_demerit = delta * delta / dist_score;\n              else\n                dist_demerit = 0;\n            }\n            else\n              dist_demerit = dist; /* default if no widths available */\n\n            score = dist_demerit + len_score / len;\n\n            /* and we search for the smallest score */\n            if ( score < seg1->score )\n            {\n              seg1->score = score;\n              seg1->link  = seg2;\n            }\n\n            if ( score < seg2->score )\n            {\n              seg2->score = score;\n              seg2->link  = seg1;\n            }\n          }\n        }\n      }\n    }\n\n    /* now compute the `serif' segments, cf. explanations in `afhints.h' */\n    for ( seg1 = segments; seg1 < segment_limit; seg1++ )\n    {\n      seg2 = seg1->link;\n\n      if ( seg2 )\n      {\n        if ( seg2->link != seg1 )\n        {\n          seg1->link  = 0;\n          seg1->serif = seg2->link;\n        }\n      }\n    }\n  }\n\n\n  /* Link segments to edges, using feature analysis for selection. */\n\n  FT_LOCAL_DEF( FT_Error )\n  af_latin_hints_compute_edges( AF_GlyphHints  hints,\n                                AF_Dimension   dim )\n  {\n    AF_AxisHints  axis   = &hints->axis[dim];\n    FT_Error      error  = FT_Err_Ok;\n    FT_Memory     memory = hints->memory;\n    AF_LatinAxis  laxis  = &((AF_LatinMetrics)hints->metrics)->axis[dim];\n\n    AF_Segment    segments      = axis->segments;\n    AF_Segment    segment_limit = segments + axis->num_segments;\n    AF_Segment    seg;\n\n#if 0\n    AF_Direction  up_dir;\n#endif\n    FT_Fixed      scale;\n    FT_Pos        edge_distance_threshold;\n    FT_Pos        segment_length_threshold;\n\n\n    axis->num_edges = 0;\n\n    scale = ( dim == AF_DIMENSION_HORZ ) ? hints->x_scale\n                                         : hints->y_scale;\n\n#if 0\n    up_dir = ( dim == AF_DIMENSION_HORZ ) ? AF_DIR_UP\n                                          : AF_DIR_RIGHT;\n#endif\n\n    /*\n     *  We ignore all segments that are less than 1 pixel in length\n     *  to avoid many problems with serif fonts.  We compute the\n     *  corresponding threshold in font units.\n     */\n    if ( dim == AF_DIMENSION_HORZ )\n        segment_length_threshold = FT_DivFix( 64, hints->y_scale );\n    else\n        segment_length_threshold = 0;\n\n    /*********************************************************************/\n    /*                                                                   */\n    /* We begin by generating a sorted table of edges for the current    */\n    /* direction.  To do so, we simply scan each segment and try to find */\n    /* an edge in our table that corresponds to its position.            */\n    /*                                                                   */\n    /* If no edge is found, we create and insert a new edge in the       */\n    /* sorted table.  Otherwise, we simply add the segment to the edge's */\n    /* list which gets processed in the second step to compute the       */\n    /* edge's properties.                                                */\n    /*                                                                   */\n    /* Note that the table of edges is sorted along the segment/edge     */\n    /* position.                                                         */\n    /*                                                                   */\n    /*********************************************************************/\n\n    /* assure that edge distance threshold is at most 0.25px */\n    edge_distance_threshold = FT_MulFix( laxis->edge_distance_threshold,\n                                         scale );\n    if ( edge_distance_threshold > 64 / 4 )\n      edge_distance_threshold = 64 / 4;\n\n    edge_distance_threshold = FT_DivFix( edge_distance_threshold,\n                                         scale );\n\n    for ( seg = segments; seg < segment_limit; seg++ )\n    {\n      AF_Edge  found = NULL;\n      FT_Int   ee;\n\n\n      if ( seg->height < segment_length_threshold )\n        continue;\n\n      /* A special case for serif edges: If they are smaller than */\n      /* 1.5 pixels we ignore them.                               */\n      if ( seg->serif                                     &&\n           2 * seg->height < 3 * segment_length_threshold )\n        continue;\n\n      /* look for an edge corresponding to the segment */\n      for ( ee = 0; ee < axis->num_edges; ee++ )\n      {\n        AF_Edge  edge = axis->edges + ee;\n        FT_Pos   dist;\n\n\n        dist = seg->pos - edge->fpos;\n        if ( dist < 0 )\n          dist = -dist;\n\n        if ( dist < edge_distance_threshold && edge->dir == seg->dir )\n        {\n          found = edge;\n          break;\n        }\n      }\n\n      if ( !found )\n      {\n        AF_Edge  edge;\n\n\n        /* insert a new edge in the list and */\n        /* sort according to the position    */\n        error = af_axis_hints_new_edge( axis, seg->pos,\n                                        (AF_Direction)seg->dir,\n                                        memory, &edge );\n        if ( error )\n          goto Exit;\n\n        /* add the segment to the new edge's list */\n        FT_ZERO( edge );\n\n        edge->first    = seg;\n        edge->last     = seg;\n        edge->dir      = seg->dir;\n        edge->fpos     = seg->pos;\n        edge->opos     = FT_MulFix( seg->pos, scale );\n        edge->pos      = edge->opos;\n        seg->edge_next = seg;\n      }\n      else\n      {\n        /* if an edge was found, simply add the segment to the edge's */\n        /* list                                                       */\n        seg->edge_next         = found->first;\n        found->last->edge_next = seg;\n        found->last            = seg;\n      }\n    }\n\n\n    /******************************************************************/\n    /*                                                                */\n    /* Good, we now compute each edge's properties according to the   */\n    /* segments found on its position.  Basically, these are          */\n    /*                                                                */\n    /*  - the edge's main direction                                   */\n    /*  - stem edge, serif edge or both (which defaults to stem then) */\n    /*  - rounded edge, straight or both (which defaults to straight) */\n    /*  - link for edge                                               */\n    /*                                                                */\n    /******************************************************************/\n\n    /* first of all, set the `edge' field in each segment -- this is */\n    /* required in order to compute edge links                       */\n\n    /*\n     * Note that removing this loop and setting the `edge' field of each\n     * segment directly in the code above slows down execution speed for\n     * some reasons on platforms like the Sun.\n     */\n    {\n      AF_Edge  edges      = axis->edges;\n      AF_Edge  edge_limit = edges + axis->num_edges;\n      AF_Edge  edge;\n\n\n      for ( edge = edges; edge < edge_limit; edge++ )\n      {\n        seg = edge->first;\n        if ( seg )\n          do\n          {\n            seg->edge = edge;\n            seg       = seg->edge_next;\n\n          } while ( seg != edge->first );\n      }\n\n      /* now compute each edge properties */\n      for ( edge = edges; edge < edge_limit; edge++ )\n      {\n        FT_Int  is_round    = 0;  /* does it contain round segments?    */\n        FT_Int  is_straight = 0;  /* does it contain straight segments? */\n#if 0\n        FT_Pos  ups         = 0;  /* number of upwards segments         */\n        FT_Pos  downs       = 0;  /* number of downwards segments       */\n#endif\n\n\n        seg = edge->first;\n\n        do\n        {\n          FT_Bool  is_serif;\n\n\n          /* check for roundness of segment */\n          if ( seg->flags & AF_EDGE_ROUND )\n            is_round++;\n          else\n            is_straight++;\n\n#if 0\n          /* check for segment direction */\n          if ( seg->dir == up_dir )\n            ups   += seg->max_coord - seg->min_coord;\n          else\n            downs += seg->max_coord - seg->min_coord;\n#endif\n\n          /* check for links -- if seg->serif is set, then seg->link must */\n          /* be ignored                                                   */\n          is_serif = (FT_Bool)( seg->serif               &&\n                                seg->serif->edge         &&\n                                seg->serif->edge != edge );\n\n          if ( ( seg->link && seg->link->edge != NULL ) || is_serif )\n          {\n            AF_Edge     edge2;\n            AF_Segment  seg2;\n\n\n            edge2 = edge->link;\n            seg2  = seg->link;\n\n            if ( is_serif )\n            {\n              seg2  = seg->serif;\n              edge2 = edge->serif;\n            }\n\n            if ( edge2 )\n            {\n              FT_Pos  edge_delta;\n              FT_Pos  seg_delta;\n\n\n              edge_delta = edge->fpos - edge2->fpos;\n              if ( edge_delta < 0 )\n                edge_delta = -edge_delta;\n\n              seg_delta = seg->pos - seg2->pos;\n              if ( seg_delta < 0 )\n                seg_delta = -seg_delta;\n\n              if ( seg_delta < edge_delta )\n                edge2 = seg2->edge;\n            }\n            else\n              edge2 = seg2->edge;\n\n            if ( is_serif )\n            {\n              edge->serif   = edge2;\n              edge2->flags |= AF_EDGE_SERIF;\n            }\n            else\n              edge->link  = edge2;\n          }\n\n          seg = seg->edge_next;\n\n        } while ( seg != edge->first );\n\n        /* set the round/straight flags */\n        edge->flags = AF_EDGE_NORMAL;\n\n        if ( is_round > 0 && is_round >= is_straight )\n          edge->flags |= AF_EDGE_ROUND;\n\n#if 0\n        /* set the edge's main direction */\n        edge->dir = AF_DIR_NONE;\n\n        if ( ups > downs )\n          edge->dir = (FT_Char)up_dir;\n\n        else if ( ups < downs )\n          edge->dir = (FT_Char)-up_dir;\n\n        else if ( ups == downs )\n          edge->dir = 0;  /* both up and down! */\n#endif\n\n        /* get rid of serifs if link is set                 */\n        /* XXX: This gets rid of many unpleasant artefacts! */\n        /*      Example: the `c' in cour.pfa at size 13     */\n\n        if ( edge->serif && edge->link )\n          edge->serif = 0;\n      }\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /* Detect segments and edges for given dimension. */\n\n  FT_LOCAL_DEF( FT_Error )\n  af_latin_hints_detect_features( AF_GlyphHints  hints,\n                                  FT_UInt        width_count,\n                                  AF_WidthRec*   widths,\n                                  AF_Dimension   dim )\n  {\n    FT_Error  error;\n\n\n    error = af_latin_hints_compute_segments( hints, dim );\n    if ( !error )\n    {\n      af_latin_hints_link_segments( hints, width_count, widths, dim );\n\n      error = af_latin_hints_compute_edges( hints, dim );\n    }\n\n    return error;\n  }\n\n\n  /* Compute all edges which lie within blue zones. */\n\n  FT_LOCAL_DEF( void )\n  af_latin_hints_compute_blue_edges( AF_GlyphHints    hints,\n                                     AF_LatinMetrics  metrics )\n  {\n    AF_AxisHints  axis       = &hints->axis[AF_DIMENSION_VERT];\n    AF_Edge       edge       = axis->edges;\n    AF_Edge       edge_limit = edge + axis->num_edges;\n    AF_LatinAxis  latin      = &metrics->axis[AF_DIMENSION_VERT];\n    FT_Fixed      scale      = latin->scale;\n\n\n    /* compute which blue zones are active, i.e. have their scaled */\n    /* size < 3/4 pixels                                           */\n\n    /* for each horizontal edge search the blue zone which is closest */\n    for ( ; edge < edge_limit; edge++ )\n    {\n      FT_UInt   bb;\n      AF_Width  best_blue            = NULL;\n      FT_Bool   best_blue_is_neutral = 0;\n      FT_Pos    best_dist;                 /* initial threshold */\n\n\n      /* compute the initial threshold as a fraction of the EM size */\n      /* (the value 40 is heuristic)                                */\n      best_dist = FT_MulFix( metrics->units_per_em / 40, scale );\n\n      /* assure a minimum distance of 0.5px */\n      if ( best_dist > 64 / 2 )\n        best_dist = 64 / 2;\n\n      for ( bb = 0; bb < latin->blue_count; bb++ )\n      {\n        AF_LatinBlue  blue = latin->blues + bb;\n        FT_Bool       is_top_blue, is_neutral_blue, is_major_dir;\n\n\n        /* skip inactive blue zones (i.e., those that are too large) */\n        if ( !( blue->flags & AF_LATIN_BLUE_ACTIVE ) )\n          continue;\n\n        /* if it is a top zone, check for right edges (against the major */\n        /* direction); if it is a bottom zone, check for left edges (in  */\n        /* the major direction) -- this assumes the TrueType convention  */\n        /* for the orientation of contours                               */\n        is_top_blue =\n          (FT_Byte)( ( blue->flags & AF_LATIN_BLUE_TOP ) != 0 );\n        is_neutral_blue =\n          (FT_Byte)( ( blue->flags & AF_LATIN_BLUE_NEUTRAL ) != 0);\n        is_major_dir =\n          FT_BOOL( edge->dir == axis->major_dir );\n\n        /* neutral blue zones are handled for both directions */\n        if ( is_top_blue ^ is_major_dir || is_neutral_blue )\n        {\n          FT_Pos  dist;\n\n\n          /* first of all, compare it to the reference position */\n          dist = edge->fpos - blue->ref.org;\n          if ( dist < 0 )\n            dist = -dist;\n\n          dist = FT_MulFix( dist, scale );\n          if ( dist < best_dist )\n          {\n            best_dist            = dist;\n            best_blue            = &blue->ref;\n            best_blue_is_neutral = is_neutral_blue;\n          }\n\n          /* now compare it to the overshoot position and check whether */\n          /* the edge is rounded, and whether the edge is over the      */\n          /* reference position of a top zone, or under the reference   */\n          /* position of a bottom zone (provided we don't have a        */\n          /* neutral blue zone)                                         */\n          if ( edge->flags & AF_EDGE_ROUND &&\n               dist != 0                   &&\n               !is_neutral_blue            )\n          {\n            FT_Bool  is_under_ref = FT_BOOL( edge->fpos < blue->ref.org );\n\n\n            if ( is_top_blue ^ is_under_ref )\n            {\n              dist = edge->fpos - blue->shoot.org;\n              if ( dist < 0 )\n                dist = -dist;\n\n              dist = FT_MulFix( dist, scale );\n              if ( dist < best_dist )\n              {\n                best_dist            = dist;\n                best_blue            = &blue->shoot;\n                best_blue_is_neutral = is_neutral_blue;\n              }\n            }\n          }\n        }\n      }\n\n      if ( best_blue )\n      {\n        edge->blue_edge = best_blue;\n        if ( best_blue_is_neutral )\n          edge->flags |= AF_EDGE_NEUTRAL;\n      }\n    }\n  }\n\n\n  /* Initalize hinting engine. */\n\n  static FT_Error\n  af_latin_hints_init( AF_GlyphHints    hints,\n                       AF_LatinMetrics  metrics )\n  {\n    FT_Render_Mode  mode;\n    FT_UInt32       scaler_flags, other_flags;\n    FT_Face         face = metrics->root.scaler.face;\n\n\n    af_glyph_hints_rescale( hints, (AF_StyleMetrics)metrics );\n\n    /*\n     *  correct x_scale and y_scale if needed, since they may have\n     *  been modified by `af_latin_metrics_scale_dim' above\n     */\n    hints->x_scale = metrics->axis[AF_DIMENSION_HORZ].scale;\n    hints->x_delta = metrics->axis[AF_DIMENSION_HORZ].delta;\n    hints->y_scale = metrics->axis[AF_DIMENSION_VERT].scale;\n    hints->y_delta = metrics->axis[AF_DIMENSION_VERT].delta;\n\n    /* compute flags depending on render mode, etc. */\n    mode = metrics->root.scaler.render_mode;\n\n#if 0 /* #ifdef AF_CONFIG_OPTION_USE_WARPER */\n    if ( mode == FT_RENDER_MODE_LCD || mode == FT_RENDER_MODE_LCD_V )\n      metrics->root.scaler.render_mode = mode = FT_RENDER_MODE_NORMAL;\n#endif\n\n    scaler_flags = hints->scaler_flags;\n    other_flags  = 0;\n\n    /*\n     *  We snap the width of vertical stems for the monochrome and\n     *  horizontal LCD rendering targets only.\n     */\n    if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD )\n      other_flags |= AF_LATIN_HINTS_HORZ_SNAP;\n\n    /*\n     *  We snap the width of horizontal stems for the monochrome and\n     *  vertical LCD rendering targets only.\n     */\n    if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD_V )\n      other_flags |= AF_LATIN_HINTS_VERT_SNAP;\n\n    /*\n     *  We adjust stems to full pixels only if we don't use the `light' mode.\n     */\n    if ( mode != FT_RENDER_MODE_LIGHT )\n      other_flags |= AF_LATIN_HINTS_STEM_ADJUST;\n\n    if ( mode == FT_RENDER_MODE_MONO )\n      other_flags |= AF_LATIN_HINTS_MONO;\n\n    /*\n     *  In `light' hinting mode we disable horizontal hinting completely.\n     *  We also do it if the face is italic.\n     */\n    if ( mode == FT_RENDER_MODE_LIGHT                      ||\n         ( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )\n      scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL;\n\n    hints->scaler_flags = scaler_flags;\n    hints->other_flags  = other_flags;\n\n    return FT_Err_Ok;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****        L A T I N   G L Y P H   G R I D - F I T T I N G        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* Snap a given width in scaled coordinates to one of the */\n  /* current standard widths.                               */\n\n  static FT_Pos\n  af_latin_snap_width( AF_Width  widths,\n                       FT_Int    count,\n                       FT_Pos    width )\n  {\n    int     n;\n    FT_Pos  best      = 64 + 32 + 2;\n    FT_Pos  reference = width;\n    FT_Pos  scaled;\n\n\n    for ( n = 0; n < count; n++ )\n    {\n      FT_Pos  w;\n      FT_Pos  dist;\n\n\n      w = widths[n].cur;\n      dist = width - w;\n      if ( dist < 0 )\n        dist = -dist;\n      if ( dist < best )\n      {\n        best      = dist;\n        reference = w;\n      }\n    }\n\n    scaled = FT_PIX_ROUND( reference );\n\n    if ( width >= reference )\n    {\n      if ( width < scaled + 48 )\n        width = reference;\n    }\n    else\n    {\n      if ( width > scaled - 48 )\n        width = reference;\n    }\n\n    return width;\n  }\n\n\n  /* Compute the snapped width of a given stem, ignoring very thin ones. */\n  /* There is a lot of voodoo in this function; changing the hard-coded  */\n  /* parameters influence the whole hinting process.                     */\n\n  static FT_Pos\n  af_latin_compute_stem_width( AF_GlyphHints  hints,\n                               AF_Dimension   dim,\n                               FT_Pos         width,\n                               AF_Edge_Flags  base_flags,\n                               AF_Edge_Flags  stem_flags )\n  {\n    AF_LatinMetrics  metrics  = (AF_LatinMetrics)hints->metrics;\n    AF_LatinAxis     axis     = &metrics->axis[dim];\n    FT_Pos           dist     = width;\n    FT_Int           sign     = 0;\n    FT_Int           vertical = ( dim == AF_DIMENSION_VERT );\n\n\n    if ( !AF_LATIN_HINTS_DO_STEM_ADJUST( hints ) ||\n         axis->extra_light                       )\n      return width;\n\n    if ( dist < 0 )\n    {\n      dist = -width;\n      sign = 1;\n    }\n\n    if ( (  vertical && !AF_LATIN_HINTS_DO_VERT_SNAP( hints ) ) ||\n         ( !vertical && !AF_LATIN_HINTS_DO_HORZ_SNAP( hints ) ) )\n    {\n      /* smooth hinting process: very lightly quantize the stem width */\n\n      /* leave the widths of serifs alone */\n      if ( ( stem_flags & AF_EDGE_SERIF ) &&\n           vertical                       &&\n           ( dist < 3 * 64 )              )\n        goto Done_Width;\n\n      else if ( base_flags & AF_EDGE_ROUND )\n      {\n        if ( dist < 80 )\n          dist = 64;\n      }\n      else if ( dist < 56 )\n        dist = 56;\n\n      if ( axis->width_count > 0 )\n      {\n        FT_Pos  delta;\n\n\n        /* compare to standard width */\n        delta = dist - axis->widths[0].cur;\n\n        if ( delta < 0 )\n          delta = -delta;\n\n        if ( delta < 40 )\n        {\n          dist = axis->widths[0].cur;\n          if ( dist < 48 )\n            dist = 48;\n\n          goto Done_Width;\n        }\n\n        if ( dist < 3 * 64 )\n        {\n          delta  = dist & 63;\n          dist  &= -64;\n\n          if ( delta < 10 )\n            dist += delta;\n\n          else if ( delta < 32 )\n            dist += 10;\n\n          else if ( delta < 54 )\n            dist += 54;\n\n          else\n            dist += delta;\n        }\n        else\n          dist = ( dist + 32 ) & ~63;\n      }\n    }\n    else\n    {\n      /* strong hinting process: snap the stem width to integer pixels */\n\n      FT_Pos  org_dist = dist;\n\n\n      dist = af_latin_snap_width( axis->widths, axis->width_count, dist );\n\n      if ( vertical )\n      {\n        /* in the case of vertical hinting, always round */\n        /* the stem heights to integer pixels            */\n\n        if ( dist >= 64 )\n          dist = ( dist + 16 ) & ~63;\n        else\n          dist = 64;\n      }\n      else\n      {\n        if ( AF_LATIN_HINTS_DO_MONO( hints ) )\n        {\n          /* monochrome horizontal hinting: snap widths to integer pixels */\n          /* with a different threshold                                   */\n\n          if ( dist < 64 )\n            dist = 64;\n          else\n            dist = ( dist + 32 ) & ~63;\n        }\n        else\n        {\n          /* for horizontal anti-aliased hinting, we adopt a more subtle */\n          /* approach: we strengthen small stems, round stems whose size */\n          /* is between 1 and 2 pixels to an integer, otherwise nothing  */\n\n          if ( dist < 48 )\n            dist = ( dist + 64 ) >> 1;\n\n          else if ( dist < 128 )\n          {\n            /* We only round to an integer width if the corresponding */\n            /* distortion is less than 1/4 pixel.  Otherwise this     */\n            /* makes everything worse since the diagonals, which are  */\n            /* not hinted, appear a lot bolder or thinner than the    */\n            /* vertical stems.                                        */\n\n            FT_Pos  delta;\n\n\n            dist = ( dist + 22 ) & ~63;\n            delta = dist - org_dist;\n            if ( delta < 0 )\n              delta = -delta;\n\n            if ( delta >= 16 )\n            {\n              dist = org_dist;\n              if ( dist < 48 )\n                dist = ( dist + 64 ) >> 1;\n            }\n          }\n          else\n            /* round otherwise to prevent color fringes in LCD mode */\n            dist = ( dist + 32 ) & ~63;\n        }\n      }\n    }\n\n  Done_Width:\n    if ( sign )\n      dist = -dist;\n\n    return dist;\n  }\n\n\n  /* Align one stem edge relative to the previous stem edge. */\n\n  static void\n  af_latin_align_linked_edge( AF_GlyphHints  hints,\n                              AF_Dimension   dim,\n                              AF_Edge        base_edge,\n                              AF_Edge        stem_edge )\n  {\n    FT_Pos  dist = stem_edge->opos - base_edge->opos;\n\n    FT_Pos  fitted_width = af_latin_compute_stem_width(\n                             hints, dim, dist,\n                             (AF_Edge_Flags)base_edge->flags,\n                             (AF_Edge_Flags)stem_edge->flags );\n\n\n    stem_edge->pos = base_edge->pos + fitted_width;\n\n    FT_TRACE5(( \"  LINK: edge %d (opos=%.2f) linked to %.2f,\"\n                \" dist was %.2f, now %.2f\\n\",\n                stem_edge - hints->axis[dim].edges, stem_edge->opos / 64.0,\n                stem_edge->pos / 64.0, dist / 64.0, fitted_width / 64.0 ));\n  }\n\n\n  /* Shift the coordinates of the `serif' edge by the same amount */\n  /* as the corresponding `base' edge has been moved already.     */\n\n  static void\n  af_latin_align_serif_edge( AF_GlyphHints  hints,\n                             AF_Edge        base,\n                             AF_Edge        serif )\n  {\n    FT_UNUSED( hints );\n\n    serif->pos = base->pos + ( serif->opos - base->opos );\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                    E D G E   H I N T I N G                      ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* The main grid-fitting routine. */\n\n  FT_LOCAL_DEF( void )\n  af_latin_hint_edges( AF_GlyphHints  hints,\n                       AF_Dimension   dim )\n  {\n    AF_AxisHints  axis       = &hints->axis[dim];\n    AF_Edge       edges      = axis->edges;\n    AF_Edge       edge_limit = edges + axis->num_edges;\n    FT_PtrDist    n_edges;\n    AF_Edge       edge;\n    AF_Edge       anchor     = NULL;\n    FT_Int        has_serifs = 0;\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n    FT_UInt       num_actions = 0;\n#endif\n\n\n    FT_TRACE5(( \"latin %s edge hinting (style `%s')\\n\",\n                dim == AF_DIMENSION_VERT ? \"horizontal\" : \"vertical\",\n                af_style_names[hints->metrics->style_class->style] ));\n\n    /* we begin by aligning all stems relative to the blue zone */\n    /* if needed -- that's only for horizontal edges            */\n\n    if ( dim == AF_DIMENSION_VERT && AF_HINTS_DO_BLUES( hints ) )\n    {\n      for ( edge = edges; edge < edge_limit; edge++ )\n      {\n        AF_Width  blue;\n        AF_Edge   edge1, edge2; /* these edges form the stem to check */\n\n\n        if ( edge->flags & AF_EDGE_DONE )\n          continue;\n\n        edge1 = NULL;\n        edge2 = edge->link;\n\n        /*\n         *  If a stem contains both a neutral and a non-neutral blue zone,\n         *  skip the neutral one.  Otherwise, outlines with different\n         *  directions might be incorrectly aligned at the same vertical\n         *  position.\n         *\n         *  If we have two neutral blue zones, skip one of them.\n         *\n         */\n        if ( edge->blue_edge && edge2 && edge2->blue_edge )\n        {\n          FT_Byte  neutral  = edge->flags  & AF_EDGE_NEUTRAL;\n          FT_Byte  neutral2 = edge2->flags & AF_EDGE_NEUTRAL;\n\n\n          if ( ( neutral && neutral2 ) || neutral2 )\n          {\n            edge2->blue_edge = NULL;\n            edge2->flags    &= ~AF_EDGE_NEUTRAL;\n          }\n          else if ( neutral )\n          {\n            edge->blue_edge = NULL;\n            edge->flags    &= ~AF_EDGE_NEUTRAL;\n          }\n        }\n\n        blue = edge->blue_edge;\n        if ( blue )\n          edge1 = edge;\n\n        /* flip edges if the other edge is aligned to a blue zone */\n        else if ( edge2 && edge2->blue_edge )\n        {\n          blue  = edge2->blue_edge;\n          edge1 = edge2;\n          edge2 = edge;\n        }\n\n        if ( !edge1 )\n          continue;\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n        if ( !anchor )\n          FT_TRACE5(( \"  BLUE_ANCHOR: edge %d (opos=%.2f) snapped to %.2f,\"\n                      \" was %.2f (anchor=edge %d)\\n\",\n                      edge1 - edges, edge1->opos / 64.0, blue->fit / 64.0,\n                      edge1->pos / 64.0, edge - edges ));\n        else\n          FT_TRACE5(( \"  BLUE: edge %d (opos=%.2f) snapped to %.2f,\"\n                      \" was %.2f\\n\",\n                      edge1 - edges, edge1->opos / 64.0, blue->fit / 64.0,\n                      edge1->pos / 64.0 ));\n\n        num_actions++;\n#endif\n\n        edge1->pos    = blue->fit;\n        edge1->flags |= AF_EDGE_DONE;\n\n        if ( edge2 && !edge2->blue_edge )\n        {\n          af_latin_align_linked_edge( hints, dim, edge1, edge2 );\n          edge2->flags |= AF_EDGE_DONE;\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n          num_actions++;\n#endif\n        }\n\n        if ( !anchor )\n          anchor = edge;\n      }\n    }\n\n    /* now we align all other stem edges, trying to maintain the */\n    /* relative order of stems in the glyph                      */\n    for ( edge = edges; edge < edge_limit; edge++ )\n    {\n      AF_Edge  edge2;\n\n\n      if ( edge->flags & AF_EDGE_DONE )\n        continue;\n\n      /* skip all non-stem edges */\n      edge2 = edge->link;\n      if ( !edge2 )\n      {\n        has_serifs++;\n        continue;\n      }\n\n      /* now align the stem */\n\n      /* this should not happen, but it's better to be safe */\n      if ( edge2->blue_edge )\n      {\n        FT_TRACE5(( \"  ASSERTION FAILED for edge %d\\n\", edge2 - edges ));\n\n        af_latin_align_linked_edge( hints, dim, edge2, edge );\n        edge->flags |= AF_EDGE_DONE;\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n        num_actions++;\n#endif\n        continue;\n      }\n\n      if ( !anchor )\n      {\n        /* if we reach this if clause, no stem has been aligned yet */\n\n        FT_Pos  org_len, org_center, cur_len;\n        FT_Pos  cur_pos1, error1, error2, u_off, d_off;\n\n\n        org_len = edge2->opos - edge->opos;\n        cur_len = af_latin_compute_stem_width(\n                    hints, dim, org_len,\n                    (AF_Edge_Flags)edge->flags,\n                    (AF_Edge_Flags)edge2->flags );\n\n        /* some voodoo to specially round edges for small stem widths; */\n        /* the idea is to align the center of a stem, then shifting    */\n        /* the stem edges to suitable positions                        */\n        if ( cur_len <= 64 )\n        {\n          /* width <= 1px */\n          u_off = 32;\n          d_off = 32;\n        }\n        else\n        {\n          /* 1px < width < 1.5px */\n          u_off = 38;\n          d_off = 26;\n        }\n\n        if ( cur_len < 96 )\n        {\n          org_center = edge->opos + ( org_len >> 1 );\n          cur_pos1   = FT_PIX_ROUND( org_center );\n\n          error1 = org_center - ( cur_pos1 - u_off );\n          if ( error1 < 0 )\n            error1 = -error1;\n\n          error2 = org_center - ( cur_pos1 + d_off );\n          if ( error2 < 0 )\n            error2 = -error2;\n\n          if ( error1 < error2 )\n            cur_pos1 -= u_off;\n          else\n            cur_pos1 += d_off;\n\n          edge->pos  = cur_pos1 - cur_len / 2;\n          edge2->pos = edge->pos + cur_len;\n        }\n        else\n          edge->pos = FT_PIX_ROUND( edge->opos );\n\n        anchor       = edge;\n        edge->flags |= AF_EDGE_DONE;\n\n        FT_TRACE5(( \"  ANCHOR: edge %d (opos=%.2f) and %d (opos=%.2f)\"\n                    \" snapped to %.2f and %.2f\\n\",\n                    edge - edges, edge->opos / 64.0,\n                    edge2 - edges, edge2->opos / 64.0,\n                    edge->pos / 64.0, edge2->pos / 64.0 ));\n\n        af_latin_align_linked_edge( hints, dim, edge, edge2 );\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n        num_actions += 2;\n#endif\n      }\n      else\n      {\n        FT_Pos  org_pos, org_len, org_center, cur_len;\n        FT_Pos  cur_pos1, cur_pos2, delta1, delta2;\n\n\n        org_pos    = anchor->pos + ( edge->opos - anchor->opos );\n        org_len    = edge2->opos - edge->opos;\n        org_center = org_pos + ( org_len >> 1 );\n\n        cur_len = af_latin_compute_stem_width(\n                    hints, dim, org_len,\n                    (AF_Edge_Flags)edge->flags,\n                    (AF_Edge_Flags)edge2->flags );\n\n        if ( edge2->flags & AF_EDGE_DONE )\n        {\n          FT_TRACE5(( \"  ADJUST: edge %d (pos=%.2f) moved to %.2f\\n\",\n                      edge - edges, edge->pos / 64.0,\n                      ( edge2->pos - cur_len ) / 64.0 ));\n\n          edge->pos = edge2->pos - cur_len;\n        }\n\n        else if ( cur_len < 96 )\n        {\n          FT_Pos  u_off, d_off;\n\n\n          cur_pos1 = FT_PIX_ROUND( org_center );\n\n          if ( cur_len <= 64 )\n          {\n            u_off = 32;\n            d_off = 32;\n          }\n          else\n          {\n            u_off = 38;\n            d_off = 26;\n          }\n\n          delta1 = org_center - ( cur_pos1 - u_off );\n          if ( delta1 < 0 )\n            delta1 = -delta1;\n\n          delta2 = org_center - ( cur_pos1 + d_off );\n          if ( delta2 < 0 )\n            delta2 = -delta2;\n\n          if ( delta1 < delta2 )\n            cur_pos1 -= u_off;\n          else\n            cur_pos1 += d_off;\n\n          edge->pos  = cur_pos1 - cur_len / 2;\n          edge2->pos = cur_pos1 + cur_len / 2;\n\n          FT_TRACE5(( \"  STEM: edge %d (opos=%.2f) linked to %d (opos=%.2f)\"\n                      \" snapped to %.2f and %.2f\\n\",\n                      edge - edges, edge->opos / 64.0,\n                      edge2 - edges, edge2->opos / 64.0,\n                      edge->pos / 64.0, edge2->pos / 64.0 ));\n        }\n\n        else\n        {\n          org_pos    = anchor->pos + ( edge->opos - anchor->opos );\n          org_len    = edge2->opos - edge->opos;\n          org_center = org_pos + ( org_len >> 1 );\n\n          cur_len    = af_latin_compute_stem_width(\n                         hints, dim, org_len,\n                         (AF_Edge_Flags)edge->flags,\n                         (AF_Edge_Flags)edge2->flags );\n\n          cur_pos1 = FT_PIX_ROUND( org_pos );\n          delta1   = cur_pos1 + ( cur_len >> 1 ) - org_center;\n          if ( delta1 < 0 )\n            delta1 = -delta1;\n\n          cur_pos2 = FT_PIX_ROUND( org_pos + org_len ) - cur_len;\n          delta2   = cur_pos2 + ( cur_len >> 1 ) - org_center;\n          if ( delta2 < 0 )\n            delta2 = -delta2;\n\n          edge->pos  = ( delta1 < delta2 ) ? cur_pos1 : cur_pos2;\n          edge2->pos = edge->pos + cur_len;\n\n          FT_TRACE5(( \"  STEM: edge %d (opos=%.2f) linked to %d (opos=%.2f)\"\n                      \" snapped to %.2f and %.2f\\n\",\n                      edge - edges, edge->opos / 64.0,\n                      edge2 - edges, edge2->opos / 64.0,\n                      edge->pos / 64.0, edge2->pos / 64.0 ));\n        }\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n        num_actions++;\n#endif\n\n        edge->flags  |= AF_EDGE_DONE;\n        edge2->flags |= AF_EDGE_DONE;\n\n        if ( edge > edges && edge->pos < edge[-1].pos )\n        {\n#ifdef FT_DEBUG_LEVEL_TRACE\n          FT_TRACE5(( \"  BOUND: edge %d (pos=%.2f) moved to %.2f\\n\",\n                      edge - edges, edge->pos / 64.0, edge[-1].pos / 64.0 ));\n\n          num_actions++;\n#endif\n\n          edge->pos = edge[-1].pos;\n        }\n      }\n    }\n\n    /* make sure that lowercase m's maintain their symmetry */\n\n    /* In general, lowercase m's have six vertical edges if they are sans */\n    /* serif, or twelve if they are with serifs.  This implementation is  */\n    /* based on that assumption, and seems to work very well with most    */\n    /* faces.  However, if for a certain face this assumption is not      */\n    /* true, the m is just rendered like before.  In addition, any stem   */\n    /* correction will only be applied to symmetrical glyphs (even if the */\n    /* glyph is not an m), so the potential for unwanted distortion is    */\n    /* relatively low.                                                    */\n\n    /* We don't handle horizontal edges since we can't easily assure that */\n    /* the third (lowest) stem aligns with the base line; it might end up */\n    /* one pixel higher or lower.                                         */\n\n    n_edges = edge_limit - edges;\n    if ( dim == AF_DIMENSION_HORZ && ( n_edges == 6 || n_edges == 12 ) )\n    {\n      AF_Edge  edge1, edge2, edge3;\n      FT_Pos   dist1, dist2, span, delta;\n\n\n      if ( n_edges == 6 )\n      {\n        edge1 = edges;\n        edge2 = edges + 2;\n        edge3 = edges + 4;\n      }\n      else\n      {\n        edge1 = edges + 1;\n        edge2 = edges + 5;\n        edge3 = edges + 9;\n      }\n\n      dist1 = edge2->opos - edge1->opos;\n      dist2 = edge3->opos - edge2->opos;\n\n      span = dist1 - dist2;\n      if ( span < 0 )\n        span = -span;\n\n      if ( span < 8 )\n      {\n        delta = edge3->pos - ( 2 * edge2->pos - edge1->pos );\n        edge3->pos -= delta;\n        if ( edge3->link )\n          edge3->link->pos -= delta;\n\n        /* move the serifs along with the stem */\n        if ( n_edges == 12 )\n        {\n          ( edges + 8 )->pos -= delta;\n          ( edges + 11 )->pos -= delta;\n        }\n\n        edge3->flags |= AF_EDGE_DONE;\n        if ( edge3->link )\n          edge3->link->flags |= AF_EDGE_DONE;\n      }\n    }\n\n    if ( has_serifs || !anchor )\n    {\n      /*\n       *  now hint the remaining edges (serifs and single) in order\n       *  to complete our processing\n       */\n      for ( edge = edges; edge < edge_limit; edge++ )\n      {\n        FT_Pos  delta;\n\n\n        if ( edge->flags & AF_EDGE_DONE )\n          continue;\n\n        delta = 1000;\n\n        if ( edge->serif )\n        {\n          delta = edge->serif->opos - edge->opos;\n          if ( delta < 0 )\n            delta = -delta;\n        }\n\n        if ( delta < 64 + 16 )\n        {\n          af_latin_align_serif_edge( hints, edge->serif, edge );\n          FT_TRACE5(( \"  SERIF: edge %d (opos=%.2f) serif to %d (opos=%.2f)\"\n                      \" aligned to %.2f\\n\",\n                      edge - edges, edge->opos / 64.0,\n                      edge->serif - edges, edge->serif->opos / 64.0,\n                      edge->pos / 64.0 ));\n        }\n        else if ( !anchor )\n        {\n          edge->pos = FT_PIX_ROUND( edge->opos );\n          anchor    = edge;\n          FT_TRACE5(( \"  SERIF_ANCHOR: edge %d (opos=%.2f)\"\n                      \" snapped to %.2f\\n\",\n                      edge-edges, edge->opos / 64.0, edge->pos / 64.0 ));\n        }\n        else\n        {\n          AF_Edge  before, after;\n\n\n          for ( before = edge - 1; before >= edges; before-- )\n            if ( before->flags & AF_EDGE_DONE )\n              break;\n\n          for ( after = edge + 1; after < edge_limit; after++ )\n            if ( after->flags & AF_EDGE_DONE )\n              break;\n\n          if ( before >= edges && before < edge   &&\n               after < edge_limit && after > edge )\n          {\n            if ( after->opos == before->opos )\n              edge->pos = before->pos;\n            else\n              edge->pos = before->pos +\n                          FT_MulDiv( edge->opos - before->opos,\n                                     after->pos - before->pos,\n                                     after->opos - before->opos );\n\n            FT_TRACE5(( \"  SERIF_LINK1: edge %d (opos=%.2f) snapped to %.2f\"\n                        \" from %d (opos=%.2f)\\n\",\n                        edge - edges, edge->opos / 64.0,\n                        edge->pos / 64.0,\n                        before - edges, before->opos / 64.0 ));\n          }\n          else\n          {\n            edge->pos = anchor->pos +\n                        ( ( edge->opos - anchor->opos + 16 ) & ~31 );\n            FT_TRACE5(( \"  SERIF_LINK2: edge %d (opos=%.2f)\"\n                        \" snapped to %.2f\\n\",\n                        edge - edges, edge->opos / 64.0, edge->pos / 64.0 ));\n          }\n        }\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n        num_actions++;\n#endif\n        edge->flags |= AF_EDGE_DONE;\n\n        if ( edge > edges && edge->pos < edge[-1].pos )\n        {\n#ifdef FT_DEBUG_LEVEL_TRACE\n          FT_TRACE5(( \"  BOUND: edge %d (pos=%.2f) moved to %.2f\\n\",\n                      edge - edges, edge->pos / 64.0, edge[-1].pos / 64.0 ));\n\n          num_actions++;\n#endif\n          edge->pos = edge[-1].pos;\n        }\n\n        if ( edge + 1 < edge_limit        &&\n             edge[1].flags & AF_EDGE_DONE &&\n             edge->pos > edge[1].pos      )\n        {\n#ifdef FT_DEBUG_LEVEL_TRACE\n          FT_TRACE5(( \"  BOUND: edge %d (pos=%.2f) moved to %.2f\\n\",\n                      edge - edges, edge->pos / 64.0, edge[1].pos / 64.0 ));\n\n          num_actions++;\n#endif\n\n          edge->pos = edge[1].pos;\n        }\n      }\n    }\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n    if ( !num_actions )\n      FT_TRACE5(( \"  (none)\\n\" ));\n    FT_TRACE5(( \"\\n\" ));\n#endif\n  }\n\n\n  /* Apply the complete hinting algorithm to a latin glyph. */\n\n  static FT_Error\n  af_latin_hints_apply( AF_GlyphHints    hints,\n                        FT_Outline*      outline,\n                        AF_LatinMetrics  metrics )\n  {\n    FT_Error  error;\n    int       dim;\n\n    AF_LatinAxis  axis;\n\n\n    error = af_glyph_hints_reload( hints, outline );\n    if ( error )\n      goto Exit;\n\n    /* analyze glyph outline */\n#ifdef AF_CONFIG_OPTION_USE_WARPER\n    if ( metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT ||\n         AF_HINTS_DO_HORIZONTAL( hints )                          )\n#else\n    if ( AF_HINTS_DO_HORIZONTAL( hints ) )\n#endif\n    {\n      axis  = &metrics->axis[AF_DIMENSION_HORZ];\n      error = af_latin_hints_detect_features( hints,\n                                              axis->width_count,\n                                              axis->widths,\n                                              AF_DIMENSION_HORZ );\n      if ( error )\n        goto Exit;\n    }\n\n    if ( AF_HINTS_DO_VERTICAL( hints ) )\n    {\n      axis  = &metrics->axis[AF_DIMENSION_VERT];\n      error = af_latin_hints_detect_features( hints,\n                                              axis->width_count,\n                                              axis->widths,\n                                              AF_DIMENSION_VERT );\n      if ( error )\n        goto Exit;\n\n      af_latin_hints_compute_blue_edges( hints, metrics );\n    }\n\n    /* grid-fit the outline */\n    for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )\n    {\n#ifdef AF_CONFIG_OPTION_USE_WARPER\n      if ( dim == AF_DIMENSION_HORZ                                 &&\n           metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT )\n      {\n        AF_WarperRec  warper;\n        FT_Fixed      scale;\n        FT_Pos        delta;\n\n\n        af_warper_compute( &warper, hints, (AF_Dimension)dim,\n                           &scale, &delta );\n        af_glyph_hints_scale_dim( hints, (AF_Dimension)dim,\n                                  scale, delta );\n        continue;\n      }\n#endif\n\n      if ( ( dim == AF_DIMENSION_HORZ && AF_HINTS_DO_HORIZONTAL( hints ) ) ||\n           ( dim == AF_DIMENSION_VERT && AF_HINTS_DO_VERTICAL( hints ) )   )\n      {\n        af_latin_hint_edges( hints, (AF_Dimension)dim );\n        af_glyph_hints_align_edge_points( hints, (AF_Dimension)dim );\n        af_glyph_hints_align_strong_points( hints, (AF_Dimension)dim );\n        af_glyph_hints_align_weak_points( hints, (AF_Dimension)dim );\n      }\n    }\n\n    af_glyph_hints_save( hints, outline );\n\n  Exit:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****              L A T I N   S C R I P T   C L A S S              *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  AF_DEFINE_WRITING_SYSTEM_CLASS(\n    af_latin_writing_system_class,\n\n    AF_WRITING_SYSTEM_LATIN,\n\n    sizeof ( AF_LatinMetricsRec ),\n\n    (AF_WritingSystem_InitMetricsFunc) af_latin_metrics_init,\n    (AF_WritingSystem_ScaleMetricsFunc)af_latin_metrics_scale,\n    (AF_WritingSystem_DoneMetricsFunc) NULL,\n\n    (AF_WritingSystem_InitHintsFunc)   af_latin_hints_init,\n    (AF_WritingSystem_ApplyHintsFunc)  af_latin_hints_apply\n  )\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/aflatin.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  aflatin.h                                                              */\n/*                                                                         */\n/*    Auto-fitter hinting routines for latin writing system                */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 2003-2007, 2009, 2011-2014 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __AFLATIN_H__\n#define __AFLATIN_H__\n\n#include \"afhints.h\"\n\n\nFT_BEGIN_HEADER\n\n  /* the `latin' writing system */\n\n  AF_DECLARE_WRITING_SYSTEM_CLASS( af_latin_writing_system_class )\n\n\n  /* constants are given with units_per_em == 2048 in mind */\n#define AF_LATIN_CONSTANT( metrics, c )                                      \\\n  ( ( (c) * (FT_Long)( (AF_LatinMetrics)(metrics) )->units_per_em ) / 2048 )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****            L A T I N   G L O B A L   M E T R I C S            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*\n   *  The following declarations could be embedded in the file `aflatin.c';\n   *  they have been made semi-public to allow alternate writing system\n   *  hinters to re-use some of them.\n   */\n\n\n#define AF_LATIN_IS_TOP_BLUE( b ) \\\n          ( (b)->properties & AF_BLUE_PROPERTY_LATIN_TOP )\n#define AF_LATIN_IS_NEUTRAL_BLUE( b ) \\\n          ( (b)->properties & AF_BLUE_PROPERTY_LATIN_NEUTRAL )\n#define AF_LATIN_IS_X_HEIGHT_BLUE( b ) \\\n          ( (b)->properties & AF_BLUE_PROPERTY_LATIN_X_HEIGHT )\n#define AF_LATIN_IS_LONG_BLUE( b ) \\\n          ( (b)->properties & AF_BLUE_PROPERTY_LATIN_LONG )\n\n#define AF_LATIN_MAX_WIDTHS  16\n\n\n  enum\n  {\n    AF_LATIN_BLUE_ACTIVE     = 1 << 0, /* set if zone height is <= 3/4px   */\n    AF_LATIN_BLUE_TOP        = 1 << 1, /* set if we have a top blue zone   */\n    AF_LATIN_BLUE_NEUTRAL    = 1 << 2, /* set if we have neutral blue zone */\n    AF_LATIN_BLUE_ADJUSTMENT = 1 << 3, /* used for scale adjustment        */\n                                       /* optimization                     */\n    AF_LATIN_BLUE_FLAG_MAX\n  };\n\n\n  typedef struct  AF_LatinBlueRec_\n  {\n    AF_WidthRec  ref;\n    AF_WidthRec  shoot;\n    FT_UInt      flags;\n\n  } AF_LatinBlueRec, *AF_LatinBlue;\n\n\n  typedef struct  AF_LatinAxisRec_\n  {\n    FT_Fixed         scale;\n    FT_Pos           delta;\n\n    FT_UInt          width_count;                 /* number of used widths */\n    AF_WidthRec      widths[AF_LATIN_MAX_WIDTHS]; /* widths array          */\n    FT_Pos           edge_distance_threshold;   /* used for creating edges */\n    FT_Pos           standard_width;         /* the default stem thickness */\n    FT_Bool          extra_light;         /* is standard width very light? */\n\n    /* ignored for horizontal metrics */\n    FT_UInt          blue_count;\n    AF_LatinBlueRec  blues[AF_BLUE_STRINGSET_MAX];\n\n    FT_Fixed         org_scale;\n    FT_Pos           org_delta;\n\n  } AF_LatinAxisRec, *AF_LatinAxis;\n\n\n  typedef struct  AF_LatinMetricsRec_\n  {\n    AF_StyleMetricsRec  root;\n    FT_UInt             units_per_em;\n    AF_LatinAxisRec     axis[AF_DIMENSION_MAX];\n\n  } AF_LatinMetricsRec, *AF_LatinMetrics;\n\n\n  FT_LOCAL( FT_Error )\n  af_latin_metrics_init( AF_LatinMetrics  metrics,\n                         FT_Face          face );\n\n  FT_LOCAL( void )\n  af_latin_metrics_scale( AF_LatinMetrics  metrics,\n                          AF_Scaler        scaler );\n\n  FT_LOCAL( void )\n  af_latin_metrics_init_widths( AF_LatinMetrics  metrics,\n                                FT_Face          face );\n\n  FT_LOCAL( void )\n  af_latin_metrics_check_digits( AF_LatinMetrics  metrics,\n                                 FT_Face          face );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****           L A T I N   G L Y P H   A N A L Y S I S             *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  enum\n  {\n    AF_LATIN_HINTS_HORZ_SNAP   = 1 << 0, /* enable stem width snapping  */\n    AF_LATIN_HINTS_VERT_SNAP   = 1 << 1, /* enable stem height snapping */\n    AF_LATIN_HINTS_STEM_ADJUST = 1 << 2, /* enable stem width/height    */\n                                         /* adjustment                  */\n    AF_LATIN_HINTS_MONO        = 1 << 3  /* indicate monochrome         */\n                                         /* rendering                   */\n  };\n\n\n#define AF_LATIN_HINTS_DO_HORZ_SNAP( h )             \\\n  AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_HORZ_SNAP )\n\n#define AF_LATIN_HINTS_DO_VERT_SNAP( h )             \\\n  AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_VERT_SNAP )\n\n#define AF_LATIN_HINTS_DO_STEM_ADJUST( h )             \\\n  AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_STEM_ADJUST )\n\n#define AF_LATIN_HINTS_DO_MONO( h )             \\\n  AF_HINTS_TEST_OTHER( h, AF_LATIN_HINTS_MONO )\n\n\n  /*\n   *  The next functions shouldn't normally be exported.  However, other\n   *  writing systems might like to use these functions as-is.\n   */\n  FT_LOCAL( FT_Error )\n  af_latin_hints_compute_segments( AF_GlyphHints  hints,\n                                   AF_Dimension   dim );\n\n  FT_LOCAL( void )\n  af_latin_hints_link_segments( AF_GlyphHints  hints,\n                                FT_UInt        width_count,\n                                AF_WidthRec*   widths,\n                                AF_Dimension   dim );\n\n  FT_LOCAL( FT_Error )\n  af_latin_hints_compute_edges( AF_GlyphHints  hints,\n                                AF_Dimension   dim );\n\n  FT_LOCAL( FT_Error )\n  af_latin_hints_detect_features( AF_GlyphHints  hints,\n                                  FT_UInt        width_count,\n                                  AF_WidthRec*   widths,\n                                  AF_Dimension   dim );\n\n/* */\n\nFT_END_HEADER\n\n#endif /* __AFLATIN_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/aflatin2.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  aflatin2.c                                                             */\n/*                                                                         */\n/*    Auto-fitter hinting routines for latin writing system (body).        */\n/*                                                                         */\n/*  Copyright 2003-2014 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include FT_ADVANCES_H\n\n#include \"afglobal.h\"\n#include \"aflatin.h\"\n#include \"aflatin2.h\"\n#include \"aferrors.h\"\n\n\n#ifdef AF_CONFIG_OPTION_USE_WARPER\n#include \"afwarp.h\"\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_aflatin2\n\n\n  FT_LOCAL_DEF( FT_Error )\n  af_latin2_hints_compute_segments( AF_GlyphHints  hints,\n                                    AF_Dimension   dim );\n\n  FT_LOCAL_DEF( void )\n  af_latin2_hints_link_segments( AF_GlyphHints  hints,\n                                 AF_Dimension   dim );\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****            L A T I N   G L O B A L   M E T R I C S            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL_DEF( void )\n  af_latin2_metrics_init_widths( AF_LatinMetrics  metrics,\n                                 FT_Face          face )\n  {\n    /* scan the array of segments in each direction */\n    AF_GlyphHintsRec  hints[1];\n\n\n    af_glyph_hints_init( hints, face->memory );\n\n    metrics->axis[AF_DIMENSION_HORZ].width_count = 0;\n    metrics->axis[AF_DIMENSION_VERT].width_count = 0;\n\n    {\n      FT_Error             error;\n      FT_UInt              glyph_index;\n      int                  dim;\n      AF_LatinMetricsRec   dummy[1];\n      AF_Scaler            scaler = &dummy->root.scaler;\n\n\n      glyph_index = FT_Get_Char_Index(\n                      face,\n                      metrics->root.style_class->standard_char );\n      if ( glyph_index == 0 )\n        goto Exit;\n\n      error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );\n      if ( error || face->glyph->outline.n_points <= 0 )\n        goto Exit;\n\n      FT_ZERO( dummy );\n\n      dummy->units_per_em = metrics->units_per_em;\n      scaler->x_scale     = scaler->y_scale = 0x10000L;\n      scaler->x_delta     = scaler->y_delta = 0;\n      scaler->face        = face;\n      scaler->render_mode = FT_RENDER_MODE_NORMAL;\n      scaler->flags       = 0;\n\n      af_glyph_hints_rescale( hints, (AF_StyleMetrics)dummy );\n\n      error = af_glyph_hints_reload( hints, &face->glyph->outline );\n      if ( error )\n        goto Exit;\n\n      for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )\n      {\n        AF_LatinAxis  axis    = &metrics->axis[dim];\n        AF_AxisHints  axhints = &hints->axis[dim];\n        AF_Segment    seg, limit, link;\n        FT_UInt       num_widths = 0;\n\n\n        error = af_latin2_hints_compute_segments( hints,\n                                                 (AF_Dimension)dim );\n        if ( error )\n          goto Exit;\n\n        af_latin2_hints_link_segments( hints,\n                                      (AF_Dimension)dim );\n\n        seg   = axhints->segments;\n        limit = seg + axhints->num_segments;\n\n        for ( ; seg < limit; seg++ )\n        {\n          link = seg->link;\n\n          /* we only consider stem segments there! */\n          if ( link && link->link == seg && link > seg )\n          {\n            FT_Pos  dist;\n\n\n            dist = seg->pos - link->pos;\n            if ( dist < 0 )\n              dist = -dist;\n\n            if ( num_widths < AF_LATIN_MAX_WIDTHS )\n              axis->widths[num_widths++].org = dist;\n          }\n        }\n\n        af_sort_widths( num_widths, axis->widths );\n        axis->width_count = num_widths;\n      }\n\n  Exit:\n      for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )\n      {\n        AF_LatinAxis  axis = &metrics->axis[dim];\n        FT_Pos        stdw;\n\n\n        stdw = ( axis->width_count > 0 )\n                 ? axis->widths[0].org\n                 : AF_LATIN_CONSTANT( metrics, 50 );\n\n        /* let's try 20% of the smallest width */\n        axis->edge_distance_threshold = stdw / 5;\n        axis->standard_width          = stdw;\n        axis->extra_light             = 0;\n      }\n    }\n\n    af_glyph_hints_done( hints );\n  }\n\n\n\n#define AF_LATIN_MAX_TEST_CHARACTERS  12\n\n\n  static const char af_latin2_blue_chars[AF_LATIN_MAX_BLUES]\n                                        [AF_LATIN_MAX_TEST_CHARACTERS+1] =\n  {\n    \"THEZOCQS\",\n    \"HEZLOCUS\",\n    \"fijkdbh\",\n    \"xzroesc\",\n    \"xzroesc\",\n    \"pqgjy\"\n  };\n\n\n  static void\n  af_latin2_metrics_init_blues( AF_LatinMetrics  metrics,\n                                FT_Face          face )\n  {\n    FT_Pos        flats [AF_LATIN_MAX_TEST_CHARACTERS];\n    FT_Pos        rounds[AF_LATIN_MAX_TEST_CHARACTERS];\n    FT_Int        num_flats;\n    FT_Int        num_rounds;\n    FT_Int        bb;\n    AF_LatinBlue  blue;\n    FT_Error      error;\n    AF_LatinAxis  axis  = &metrics->axis[AF_DIMENSION_VERT];\n    FT_GlyphSlot  glyph = face->glyph;\n\n\n    /* we compute the blues simply by loading each character from the     */\n    /* 'af_latin2_blue_chars[blues]' string, then compute its top-most or */\n    /* bottom-most points (depending on `AF_IS_TOP_BLUE')                 */\n\n    FT_TRACE5(( \"blue zones computation\\n\"\n                \"======================\\n\\n\" ));\n\n    for ( bb = 0; bb < AF_LATIN_BLUE_MAX; bb++ )\n    {\n      const char*  p     = af_latin2_blue_chars[bb];\n      const char*  limit = p + AF_LATIN_MAX_TEST_CHARACTERS;\n      FT_Pos*      blue_ref;\n      FT_Pos*      blue_shoot;\n\n\n      FT_TRACE5(( \"blue zone %d:\\n\", bb ));\n\n      num_flats  = 0;\n      num_rounds = 0;\n\n      for ( ; p < limit && *p; p++ )\n      {\n        FT_UInt     glyph_index;\n        FT_Int      best_point, best_y, best_first, best_last;\n        FT_Vector*  points;\n        FT_Bool     round;\n\n\n        /* load the character in the face -- skip unknown or empty ones */\n        glyph_index = FT_Get_Char_Index( face, (FT_UInt)*p );\n        if ( glyph_index == 0 )\n          continue;\n\n        error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );\n        if ( error || glyph->outline.n_points <= 0 )\n          continue;\n\n        /* now compute min or max point indices and coordinates */\n        points      = glyph->outline.points;\n        best_point  = -1;\n        best_y      = 0;  /* make compiler happy */\n        best_first  = 0;  /* ditto */\n        best_last   = 0;  /* ditto */\n\n        {\n          FT_Int  nn;\n          FT_Int  first = 0;\n          FT_Int  last  = -1;\n\n\n          for ( nn = 0; nn < glyph->outline.n_contours; first = last+1, nn++ )\n          {\n            FT_Int  old_best_point = best_point;\n            FT_Int  pp;\n\n\n            last = glyph->outline.contours[nn];\n\n            /* Avoid single-point contours since they are never rasterized. */\n            /* In some fonts, they correspond to mark attachment points     */\n            /* which are way outside of the glyph's real outline.           */\n            if ( last == first )\n                continue;\n\n            if ( AF_LATIN_IS_TOP_BLUE( bb ) )\n            {\n              for ( pp = first; pp <= last; pp++ )\n                if ( best_point < 0 || points[pp].y > best_y )\n                {\n                  best_point = pp;\n                  best_y     = points[pp].y;\n                }\n            }\n            else\n            {\n              for ( pp = first; pp <= last; pp++ )\n                if ( best_point < 0 || points[pp].y < best_y )\n                {\n                  best_point = pp;\n                  best_y     = points[pp].y;\n                }\n            }\n\n            if ( best_point != old_best_point )\n            {\n              best_first = first;\n              best_last  = last;\n            }\n          }\n          FT_TRACE5(( \"  %c  %d\", *p, best_y ));\n        }\n\n        /* now check whether the point belongs to a straight or round   */\n        /* segment; we first need to find in which contour the extremum */\n        /* lies, then inspect its previous and next points              */\n        {\n          FT_Pos  best_x = points[best_point].x;\n          FT_Int  start, end, prev, next;\n          FT_Pos  dist;\n\n\n          /* now look for the previous and next points that are not on the */\n          /* same Y coordinate.  Threshold the `closeness'...              */\n          start = end = best_point;\n\n          do\n          {\n            prev = start - 1;\n            if ( prev < best_first )\n              prev = best_last;\n\n            dist = FT_ABS( points[prev].y - best_y );\n            /* accept a small distance or a small angle (both values are */\n            /* heuristic; value 20 corresponds to approx. 2.9 degrees)   */\n            if ( dist > 5 )\n              if ( FT_ABS( points[prev].x - best_x ) <= 20 * dist )\n                break;\n\n            start = prev;\n\n          } while ( start != best_point );\n\n          do\n          {\n            next = end + 1;\n            if ( next > best_last )\n              next = best_first;\n\n            dist = FT_ABS( points[next].y - best_y );\n            if ( dist > 5 )\n              if ( FT_ABS( points[next].x - best_x ) <= 20 * dist )\n                break;\n\n            end = next;\n\n          } while ( end != best_point );\n\n          /* now, set the `round' flag depending on the segment's kind */\n          round = FT_BOOL(\n            FT_CURVE_TAG( glyph->outline.tags[start] ) != FT_CURVE_TAG_ON ||\n            FT_CURVE_TAG( glyph->outline.tags[ end ] ) != FT_CURVE_TAG_ON );\n\n          FT_TRACE5(( \" (%s)\\n\", round ? \"round\" : \"flat\" ));\n        }\n\n        if ( round )\n          rounds[num_rounds++] = best_y;\n        else\n          flats[num_flats++]   = best_y;\n      }\n\n      if ( num_flats == 0 && num_rounds == 0 )\n      {\n        /*\n         *  we couldn't find a single glyph to compute this blue zone,\n         *  we will simply ignore it then\n         */\n        FT_TRACE5(( \"  empty\\n\" ));\n        continue;\n      }\n\n      /* we have computed the contents of the `rounds' and `flats' tables, */\n      /* now determine the reference and overshoot position of the blue -- */\n      /* we simply take the median value after a simple sort               */\n      af_sort_pos( num_rounds, rounds );\n      af_sort_pos( num_flats,  flats );\n\n      blue       = & axis->blues[axis->blue_count];\n      blue_ref   = & blue->ref.org;\n      blue_shoot = & blue->shoot.org;\n\n      axis->blue_count++;\n\n      if ( num_flats == 0 )\n      {\n        *blue_ref   =\n        *blue_shoot = rounds[num_rounds / 2];\n      }\n      else if ( num_rounds == 0 )\n      {\n        *blue_ref   =\n        *blue_shoot = flats[num_flats / 2];\n      }\n      else\n      {\n        *blue_ref   = flats[num_flats / 2];\n        *blue_shoot = rounds[num_rounds / 2];\n      }\n\n      /* there are sometimes problems: if the overshoot position of top     */\n      /* zones is under its reference position, or the opposite for bottom  */\n      /* zones.  We must thus check everything there and correct the errors */\n      if ( *blue_shoot != *blue_ref )\n      {\n        FT_Pos   ref      = *blue_ref;\n        FT_Pos   shoot    = *blue_shoot;\n        FT_Bool  over_ref = FT_BOOL( shoot > ref );\n\n\n        if ( AF_LATIN_IS_TOP_BLUE( bb ) ^ over_ref )\n        {\n          *blue_ref   =\n          *blue_shoot = ( shoot + ref ) / 2;\n\n          FT_TRACE5(( \"  [overshoot smaller than reference,\"\n                      \" taking mean value]\\n\" ));\n        }\n      }\n\n      blue->flags = 0;\n      if ( AF_LATIN_IS_TOP_BLUE( bb ) )\n        blue->flags |= AF_LATIN_BLUE_TOP;\n\n      /*\n       * The following flag is used later to adjust the y and x scales\n       * in order to optimize the pixel grid alignment of the top of small\n       * letters.\n       */\n      if ( AF_LATIN_IS_X_HEIGHT_BLUE( bb ) )\n        blue->flags |= AF_LATIN_BLUE_ADJUSTMENT;\n\n      FT_TRACE5(( \"    -> reference = %ld\\n\"\n                  \"       overshoot = %ld\\n\",\n                  *blue_ref, *blue_shoot ));\n    }\n\n    return;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  af_latin2_metrics_check_digits( AF_LatinMetrics  metrics,\n                                  FT_Face          face )\n  {\n    FT_UInt   i;\n    FT_Bool   started = 0, same_width = 1;\n    FT_Fixed  advance, old_advance = 0;\n\n\n    /* check whether all ASCII digits have the same advance width; */\n    /* digit `0' is 0x30 in all supported charmaps                 */\n    for ( i = 0x30; i <= 0x39; i++ )\n    {\n      FT_UInt  glyph_index;\n\n\n      glyph_index = FT_Get_Char_Index( face, i );\n      if ( glyph_index == 0 )\n        continue;\n\n      if ( FT_Get_Advance( face, glyph_index,\n                           FT_LOAD_NO_SCALE         |\n                           FT_LOAD_NO_HINTING       |\n                           FT_LOAD_IGNORE_TRANSFORM,\n                           &advance ) )\n        continue;\n\n      if ( started )\n      {\n        if ( advance != old_advance )\n        {\n          same_width = 0;\n          break;\n        }\n      }\n      else\n      {\n        old_advance = advance;\n        started     = 1;\n      }\n    }\n\n    metrics->root.digits_have_same_width = same_width;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  af_latin2_metrics_init( AF_LatinMetrics  metrics,\n                          FT_Face          face )\n  {\n    FT_Error    error  = FT_Err_Ok;\n    FT_CharMap  oldmap = face->charmap;\n    FT_UInt     ee;\n\n    static const FT_Encoding  latin_encodings[] =\n    {\n      FT_ENCODING_UNICODE,\n      FT_ENCODING_APPLE_ROMAN,\n      FT_ENCODING_ADOBE_STANDARD,\n      FT_ENCODING_ADOBE_LATIN_1,\n      FT_ENCODING_NONE  /* end of list */\n    };\n\n\n    metrics->units_per_em = face->units_per_EM;\n\n    /* do we have a latin charmap in there? */\n    for ( ee = 0; latin_encodings[ee] != FT_ENCODING_NONE; ee++ )\n    {\n      error = FT_Select_Charmap( face, latin_encodings[ee] );\n      if ( !error )\n        break;\n    }\n\n    if ( !error )\n    {\n      af_latin2_metrics_init_widths( metrics, face );\n      af_latin2_metrics_init_blues( metrics, face );\n      af_latin2_metrics_check_digits( metrics, face );\n    }\n\n    FT_Set_Charmap( face, oldmap );\n    return FT_Err_Ok;\n  }\n\n\n  static void\n  af_latin2_metrics_scale_dim( AF_LatinMetrics  metrics,\n                               AF_Scaler        scaler,\n                               AF_Dimension     dim )\n  {\n    FT_Fixed      scale;\n    FT_Pos        delta;\n    AF_LatinAxis  axis;\n    FT_UInt       nn;\n\n\n    if ( dim == AF_DIMENSION_HORZ )\n    {\n      scale = scaler->x_scale;\n      delta = scaler->x_delta;\n    }\n    else\n    {\n      scale = scaler->y_scale;\n      delta = scaler->y_delta;\n    }\n\n    axis = &metrics->axis[dim];\n\n    if ( axis->org_scale == scale && axis->org_delta == delta )\n      return;\n\n    axis->org_scale = scale;\n    axis->org_delta = delta;\n\n    /*\n     * correct Y scale to optimize the alignment of the top of small\n     * letters to the pixel grid\n     */\n    if ( dim == AF_DIMENSION_VERT )\n    {\n      AF_LatinAxis  vaxis = &metrics->axis[AF_DIMENSION_VERT];\n      AF_LatinBlue  blue = NULL;\n\n\n      for ( nn = 0; nn < vaxis->blue_count; nn++ )\n      {\n        if ( vaxis->blues[nn].flags & AF_LATIN_BLUE_ADJUSTMENT )\n        {\n          blue = &vaxis->blues[nn];\n          break;\n        }\n      }\n\n      if ( blue )\n      {\n        FT_Pos   scaled;\n        FT_Pos   threshold;\n        FT_Pos   fitted;\n        FT_UInt  limit;\n        FT_UInt  ppem;\n\n\n        scaled    = FT_MulFix( blue->shoot.org, scaler->y_scale );\n        ppem      = metrics->root.scaler.face->size->metrics.x_ppem;\n        limit     = metrics->root.globals->increase_x_height;\n        threshold = 40;\n\n        /* if the `increase-x-height' property is active, */\n        /* we round up much more often                    */\n        if ( limit                                 &&\n             ppem <= limit                         &&\n             ppem >= AF_PROP_INCREASE_X_HEIGHT_MIN )\n          threshold = 52;\n\n        fitted = ( scaled + threshold ) & ~63;\n\n#if 1\n        if ( scaled != fitted )\n        {\n          scale = FT_MulDiv( scale, fitted, scaled );\n          FT_TRACE5(( \"== scaled x-top = %.2g\"\n                      \"  fitted = %.2g, scaling = %.4g\\n\",\n                      scaled / 64.0, fitted / 64.0,\n                      ( fitted * 1.0 ) / scaled ));\n        }\n#endif\n      }\n    }\n\n    axis->scale = scale;\n    axis->delta = delta;\n\n    if ( dim == AF_DIMENSION_HORZ )\n    {\n      metrics->root.scaler.x_scale = scale;\n      metrics->root.scaler.x_delta = delta;\n    }\n    else\n    {\n      metrics->root.scaler.y_scale = scale;\n      metrics->root.scaler.y_delta = delta;\n    }\n\n    /* scale the standard widths */\n    for ( nn = 0; nn < axis->width_count; nn++ )\n    {\n      AF_Width  width = axis->widths + nn;\n\n\n      width->cur = FT_MulFix( width->org, scale );\n      width->fit = width->cur;\n    }\n\n    /* an extra-light axis corresponds to a standard width that is */\n    /* smaller than 5/8 pixels                                     */\n    axis->extra_light =\n      (FT_Bool)( FT_MulFix( axis->standard_width, scale ) < 32 + 8 );\n\n    if ( dim == AF_DIMENSION_VERT )\n    {\n      /* scale the blue zones */\n      for ( nn = 0; nn < axis->blue_count; nn++ )\n      {\n        AF_LatinBlue  blue = &axis->blues[nn];\n        FT_Pos        dist;\n\n\n        blue->ref.cur   = FT_MulFix( blue->ref.org, scale ) + delta;\n        blue->ref.fit   = blue->ref.cur;\n        blue->shoot.cur = FT_MulFix( blue->shoot.org, scale ) + delta;\n        blue->shoot.fit = blue->shoot.cur;\n        blue->flags    &= ~AF_LATIN_BLUE_ACTIVE;\n\n        /* a blue zone is only active if it is less than 3/4 pixels tall */\n        dist = FT_MulFix( blue->ref.org - blue->shoot.org, scale );\n        if ( dist <= 48 && dist >= -48 )\n        {\n          FT_Pos  delta1, delta2;\n\n          delta1 = blue->shoot.org - blue->ref.org;\n          delta2 = delta1;\n          if ( delta1 < 0 )\n            delta2 = -delta2;\n\n          delta2 = FT_MulFix( delta2, scale );\n\n          if ( delta2 < 32 )\n            delta2 = 0;\n          else if ( delta2 < 64 )\n            delta2 = 32 + ( ( ( delta2 - 32 ) + 16 ) & ~31 );\n          else\n            delta2 = FT_PIX_ROUND( delta2 );\n\n          if ( delta1 < 0 )\n            delta2 = -delta2;\n\n          blue->ref.fit   = FT_PIX_ROUND( blue->ref.cur );\n          blue->shoot.fit = blue->ref.fit + delta2;\n\n          FT_TRACE5(( \">> activating blue zone %d:\"\n                      \"  ref.cur=%.2g ref.fit=%.2g\"\n                      \"  shoot.cur=%.2g shoot.fit=%.2g\\n\",\n                      nn, blue->ref.cur / 64.0, blue->ref.fit / 64.0,\n                      blue->shoot.cur / 64.0, blue->shoot.fit / 64.0 ));\n\n          blue->flags |= AF_LATIN_BLUE_ACTIVE;\n        }\n      }\n    }\n  }\n\n\n  FT_LOCAL_DEF( void )\n  af_latin2_metrics_scale( AF_LatinMetrics  metrics,\n                           AF_Scaler        scaler )\n  {\n    metrics->root.scaler.render_mode = scaler->render_mode;\n    metrics->root.scaler.face        = scaler->face;\n    metrics->root.scaler.flags       = scaler->flags;\n\n    af_latin2_metrics_scale_dim( metrics, scaler, AF_DIMENSION_HORZ );\n    af_latin2_metrics_scale_dim( metrics, scaler, AF_DIMENSION_VERT );\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****           L A T I N   G L Y P H   A N A L Y S I S             *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#define  SORT_SEGMENTS\n\n  FT_LOCAL_DEF( FT_Error )\n  af_latin2_hints_compute_segments( AF_GlyphHints  hints,\n                                    AF_Dimension   dim )\n  {\n    AF_AxisHints  axis          = &hints->axis[dim];\n    FT_Memory     memory        = hints->memory;\n    FT_Error      error         = FT_Err_Ok;\n    AF_Segment    segment       = NULL;\n    AF_SegmentRec seg0;\n    AF_Point*     contour       = hints->contours;\n    AF_Point*     contour_limit = contour + hints->num_contours;\n    AF_Direction  major_dir, segment_dir;\n\n\n    FT_ZERO( &seg0 );\n    seg0.score = 32000;\n    seg0.flags = AF_EDGE_NORMAL;\n\n    major_dir   = (AF_Direction)FT_ABS( axis->major_dir );\n    segment_dir = major_dir;\n\n    axis->num_segments = 0;\n\n    /* set up (u,v) in each point */\n    if ( dim == AF_DIMENSION_HORZ )\n    {\n      AF_Point  point = hints->points;\n      AF_Point  limit = point + hints->num_points;\n\n\n      for ( ; point < limit; point++ )\n      {\n        point->u = point->fx;\n        point->v = point->fy;\n      }\n    }\n    else\n    {\n      AF_Point  point = hints->points;\n      AF_Point  limit = point + hints->num_points;\n\n\n      for ( ; point < limit; point++ )\n      {\n        point->u = point->fy;\n        point->v = point->fx;\n      }\n    }\n\n    /* do each contour separately */\n    for ( ; contour < contour_limit; contour++ )\n    {\n      AF_Point  point   =  contour[0];\n      AF_Point  start   =  point;\n      AF_Point  last    =  point->prev;\n\n\n      if ( point == last )  /* skip singletons -- just in case */\n        continue;\n\n      /* already on an edge ?, backtrack to find its start */\n      if ( FT_ABS( point->in_dir ) == major_dir )\n      {\n        point = point->prev;\n\n        while ( point->in_dir == start->in_dir )\n          point = point->prev;\n      }\n      else  /* otherwise, find first segment start, if any */\n      {\n        while ( FT_ABS( point->out_dir ) != major_dir )\n        {\n          point = point->next;\n\n          if ( point == start )\n            goto NextContour;\n        }\n      }\n\n      start = point;\n\n      for  (;;)\n      {\n        AF_Point  first;\n        FT_Pos    min_u, min_v, max_u, max_v;\n\n        /* we're at the start of a new segment */\n        FT_ASSERT( FT_ABS( point->out_dir ) == major_dir &&\n                           point->in_dir != point->out_dir );\n        first = point;\n\n        min_u = max_u = point->u;\n        min_v = max_v = point->v;\n\n        point = point->next;\n\n        while ( point->out_dir == first->out_dir )\n        {\n          point = point->next;\n\n          if ( point->u < min_u )\n            min_u = point->u;\n\n          if ( point->u > max_u )\n            max_u = point->u;\n        }\n\n        if ( point->v < min_v )\n          min_v = point->v;\n\n        if ( point->v > max_v )\n          max_v = point->v;\n\n        /* record new segment */\n        error = af_axis_hints_new_segment( axis, memory, &segment );\n        if ( error )\n          goto Exit;\n\n        segment[0]         = seg0;\n        segment->dir       = first->out_dir;\n        segment->first     = first;\n        segment->last      = point;\n        segment->pos       = (FT_Short)( ( min_u + max_u ) >> 1 );\n        segment->min_coord = (FT_Short) min_v;\n        segment->max_coord = (FT_Short) max_v;\n        segment->height    = (FT_Short)( max_v - min_v );\n\n        /* a segment is round if it doesn't have successive */\n        /* on-curve points.                                 */\n        {\n          AF_Point  pt   = first;\n          AF_Point  last = point;\n          AF_Flags  f0   = (AF_Flags)( pt->flags & AF_FLAG_CONTROL );\n          AF_Flags  f1;\n\n\n          segment->flags &= ~AF_EDGE_ROUND;\n\n          for ( ; pt != last; f0 = f1 )\n          {\n            pt = pt->next;\n            f1 = (AF_Flags)( pt->flags & AF_FLAG_CONTROL );\n\n            if ( !f0 && !f1 )\n              break;\n\n            if ( pt == last )\n              segment->flags |= AF_EDGE_ROUND;\n          }\n        }\n\n       /* this can happen in the case of a degenerate contour\n        * e.g. a 2-point vertical contour\n        */\n        if ( point == start )\n          break;\n\n        /* jump to the start of the next segment, if any */\n        while ( FT_ABS( point->out_dir ) != major_dir )\n        {\n          point = point->next;\n\n          if ( point == start )\n            goto NextContour;\n        }\n      }\n\n    NextContour:\n      ;\n    } /* contours */\n\n    /* now slightly increase the height of segments when this makes */\n    /* sense -- this is used to better detect and ignore serifs     */\n    {\n      AF_Segment  segments     = axis->segments;\n      AF_Segment  segments_end = segments + axis->num_segments;\n\n\n      for ( segment = segments; segment < segments_end; segment++ )\n      {\n        AF_Point  first   = segment->first;\n        AF_Point  last    = segment->last;\n        AF_Point  p;\n        FT_Pos    first_v = first->v;\n        FT_Pos    last_v  = last->v;\n\n\n        if ( first_v < last_v )\n        {\n          p = first->prev;\n          if ( p->v < first_v )\n            segment->height = (FT_Short)( segment->height +\n                                          ( ( first_v - p->v ) >> 1 ) );\n\n          p = last->next;\n          if ( p->v > last_v )\n            segment->height = (FT_Short)( segment->height +\n                                          ( ( p->v - last_v ) >> 1 ) );\n        }\n        else\n        {\n          p = first->prev;\n          if ( p->v > first_v )\n            segment->height = (FT_Short)( segment->height +\n                                          ( ( p->v - first_v ) >> 1 ) );\n\n          p = last->next;\n          if ( p->v < last_v )\n            segment->height = (FT_Short)( segment->height +\n                                          ( ( last_v - p->v ) >> 1 ) );\n        }\n      }\n    }\n\n#ifdef AF_SORT_SEGMENTS\n   /* place all segments with a negative direction to the start\n    * of the array, used to speed up segment linking later...\n    */\n    {\n      AF_Segment  segments = axis->segments;\n      FT_UInt     count    = axis->num_segments;\n      FT_UInt     ii, jj;\n\n      for ( ii = 0; ii < count; ii++ )\n      {\n        if ( segments[ii].dir > 0 )\n        {\n          for ( jj = ii + 1; jj < count; jj++ )\n          {\n            if ( segments[jj].dir < 0 )\n            {\n              AF_SegmentRec  tmp;\n\n\n              tmp          = segments[ii];\n              segments[ii] = segments[jj];\n              segments[jj] = tmp;\n\n              break;\n            }\n          }\n\n          if ( jj == count )\n            break;\n        }\n      }\n      axis->mid_segments = ii;\n    }\n#endif\n\n  Exit:\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  af_latin2_hints_link_segments( AF_GlyphHints  hints,\n                                 AF_Dimension   dim )\n  {\n    AF_AxisHints  axis          = &hints->axis[dim];\n    AF_Segment    segments      = axis->segments;\n    AF_Segment    segment_limit = segments + axis->num_segments;\n#ifdef AF_SORT_SEGMENTS\n    AF_Segment    segment_mid   = segments + axis->mid_segments;\n#endif\n    FT_Pos        len_threshold, len_score;\n    AF_Segment    seg1, seg2;\n\n\n    len_threshold = AF_LATIN_CONSTANT( hints->metrics, 8 );\n    if ( len_threshold == 0 )\n      len_threshold = 1;\n\n    len_score = AF_LATIN_CONSTANT( hints->metrics, 6000 );\n\n#ifdef AF_SORT_SEGMENTS\n    for ( seg1 = segments; seg1 < segment_mid; seg1++ )\n    {\n      if ( seg1->dir != axis->major_dir )\n        continue;\n\n      for ( seg2 = segment_mid; seg2 < segment_limit; seg2++ )\n#else\n    /* now compare each segment to the others */\n    for ( seg1 = segments; seg1 < segment_limit; seg1++ )\n    {\n      if ( seg1->dir != axis->major_dir )\n        continue;\n\n      for ( seg2 = segments; seg2 < segment_limit; seg2++ )\n        if ( seg1->dir + seg2->dir == 0 && seg2->pos > seg1->pos )\n#endif\n        {\n          FT_Pos  pos1 = seg1->pos;\n          FT_Pos  pos2 = seg2->pos;\n          FT_Pos  dist = pos2 - pos1;\n\n\n          if ( dist < 0 )\n            continue;\n\n          {\n            FT_Pos  min = seg1->min_coord;\n            FT_Pos  max = seg1->max_coord;\n            FT_Pos  len, score;\n\n\n            if ( min < seg2->min_coord )\n              min = seg2->min_coord;\n\n            if ( max > seg2->max_coord )\n              max = seg2->max_coord;\n\n            len = max - min;\n            if ( len >= len_threshold )\n            {\n              score = dist + len_score / len;\n              if ( score < seg1->score )\n              {\n                seg1->score = score;\n                seg1->link  = seg2;\n              }\n\n              if ( score < seg2->score )\n              {\n                seg2->score = score;\n                seg2->link  = seg1;\n              }\n            }\n          }\n        }\n    }\n#if 0\n    }\n#endif\n\n    /* now, compute the `serif' segments */\n    for ( seg1 = segments; seg1 < segment_limit; seg1++ )\n    {\n      seg2 = seg1->link;\n\n      if ( seg2 )\n      {\n        if ( seg2->link != seg1 )\n        {\n          seg1->link  = 0;\n          seg1->serif = seg2->link;\n        }\n      }\n    }\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  af_latin2_hints_compute_edges( AF_GlyphHints  hints,\n                                 AF_Dimension   dim )\n  {\n    AF_AxisHints  axis   = &hints->axis[dim];\n    FT_Error      error  = FT_Err_Ok;\n    FT_Memory     memory = hints->memory;\n    AF_LatinAxis  laxis  = &((AF_LatinMetrics)hints->metrics)->axis[dim];\n\n    AF_Segment    segments      = axis->segments;\n    AF_Segment    segment_limit = segments + axis->num_segments;\n    AF_Segment    seg;\n\n    AF_Direction  up_dir;\n    FT_Fixed      scale;\n    FT_Pos        edge_distance_threshold;\n    FT_Pos        segment_length_threshold;\n\n\n    axis->num_edges = 0;\n\n    scale = ( dim == AF_DIMENSION_HORZ ) ? hints->x_scale\n                                         : hints->y_scale;\n\n    up_dir = ( dim == AF_DIMENSION_HORZ ) ? AF_DIR_UP\n                                          : AF_DIR_RIGHT;\n\n    /*\n     *  We want to ignore very small (mostly serif) segments, we do that\n     *  by ignoring those that whose length is less than a given fraction\n     *  of the standard width. If there is no standard width, we ignore\n     *  those that are less than a given size in pixels\n     *\n     *  also, unlink serif segments that are linked to segments farther\n     *  than 50% of the standard width\n     */\n    if ( dim == AF_DIMENSION_HORZ )\n    {\n      if ( laxis->width_count > 0 )\n        segment_length_threshold = ( laxis->standard_width * 10 ) >> 4;\n      else\n        segment_length_threshold = FT_DivFix( 64, hints->y_scale );\n    }\n    else\n      segment_length_threshold = 0;\n\n    /*********************************************************************/\n    /*                                                                   */\n    /* We will begin by generating a sorted table of edges for the       */\n    /* current direction.  To do so, we simply scan each segment and try */\n    /* to find an edge in our table that corresponds to its position.    */\n    /*                                                                   */\n    /* If no edge is found, we create and insert a new edge in the       */\n    /* sorted table.  Otherwise, we simply add the segment to the edge's */\n    /* list which will be processed in the second step to compute the    */\n    /* edge's properties.                                                */\n    /*                                                                   */\n    /* Note that the edges table is sorted along the segment/edge        */\n    /* position.                                                         */\n    /*                                                                   */\n    /*********************************************************************/\n\n    edge_distance_threshold = FT_MulFix( laxis->edge_distance_threshold,\n                                         scale );\n    if ( edge_distance_threshold > 64 / 4 )\n      edge_distance_threshold = 64 / 4;\n\n    edge_distance_threshold = FT_DivFix( edge_distance_threshold,\n                                         scale );\n\n    for ( seg = segments; seg < segment_limit; seg++ )\n    {\n      AF_Edge  found = 0;\n      FT_Int   ee;\n\n\n      if ( seg->height < segment_length_threshold )\n        continue;\n\n      /* A special case for serif edges: If they are smaller than */\n      /* 1.5 pixels we ignore them.                               */\n      if ( seg->serif )\n      {\n        FT_Pos  dist = seg->serif->pos - seg->pos;\n\n\n        if ( dist < 0 )\n          dist = -dist;\n\n        if ( dist >= laxis->standard_width >> 1 )\n        {\n          /* unlink this serif, it is too distant from its reference stem */\n          seg->serif = NULL;\n        }\n        else if ( 2*seg->height < 3 * segment_length_threshold )\n          continue;\n      }\n\n      /* look for an edge corresponding to the segment */\n      for ( ee = 0; ee < axis->num_edges; ee++ )\n      {\n        AF_Edge  edge = axis->edges + ee;\n        FT_Pos   dist;\n\n\n        dist = seg->pos - edge->fpos;\n        if ( dist < 0 )\n          dist = -dist;\n\n        if ( dist < edge_distance_threshold && edge->dir == seg->dir )\n        {\n          found = edge;\n          break;\n        }\n      }\n\n      if ( !found )\n      {\n        AF_Edge   edge;\n\n\n        /* insert a new edge in the list and */\n        /* sort according to the position    */\n        error = af_axis_hints_new_edge( axis, seg->pos, seg->dir,\n                                        memory, &edge );\n        if ( error )\n          goto Exit;\n\n        /* add the segment to the new edge's list */\n        FT_ZERO( edge );\n\n        edge->first    = seg;\n        edge->last     = seg;\n        edge->dir      = seg->dir;\n        edge->fpos     = seg->pos;\n        edge->opos     = FT_MulFix( seg->pos, scale );\n        edge->pos      = edge->opos;\n        seg->edge_next = seg;\n      }\n      else\n      {\n        /* if an edge was found, simply add the segment to the edge's */\n        /* list                                                       */\n        seg->edge_next         = found->first;\n        found->last->edge_next = seg;\n        found->last            = seg;\n      }\n    }\n\n\n    /*********************************************************************/\n    /*                                                                   */\n    /* Good, we will now compute each edge's properties according to     */\n    /* segments found on its position.  Basically, these are:            */\n    /*                                                                   */\n    /*  - edge's main direction                                          */\n    /*  - stem edge, serif edge or both (which defaults to stem then)    */\n    /*  - rounded edge, straight or both (which defaults to straight)    */\n    /*  - link for edge                                                  */\n    /*                                                                   */\n    /*********************************************************************/\n\n    /* first of all, set the `edge' field in each segment -- this is */\n    /* required in order to compute edge links                       */\n\n    /*\n     * Note that removing this loop and setting the `edge' field of each\n     * segment directly in the code above slows down execution speed for\n     * some reasons on platforms like the Sun.\n     */\n    {\n      AF_Edge  edges      = axis->edges;\n      AF_Edge  edge_limit = edges + axis->num_edges;\n      AF_Edge  edge;\n\n\n      for ( edge = edges; edge < edge_limit; edge++ )\n      {\n        seg = edge->first;\n        if ( seg )\n          do\n          {\n            seg->edge = edge;\n            seg       = seg->edge_next;\n\n          } while ( seg != edge->first );\n      }\n\n      /* now, compute each edge properties */\n      for ( edge = edges; edge < edge_limit; edge++ )\n      {\n        FT_Int  is_round    = 0;  /* does it contain round segments?    */\n        FT_Int  is_straight = 0;  /* does it contain straight segments? */\n#if 0\n        FT_Pos  ups         = 0;  /* number of upwards segments         */\n        FT_Pos  downs       = 0;  /* number of downwards segments       */\n#endif\n\n\n        seg = edge->first;\n\n        do\n        {\n          FT_Bool  is_serif;\n\n\n          /* check for roundness of segment */\n          if ( seg->flags & AF_EDGE_ROUND )\n            is_round++;\n          else\n            is_straight++;\n\n#if 0\n          /* check for segment direction */\n          if ( seg->dir == up_dir )\n            ups   += seg->max_coord-seg->min_coord;\n          else\n            downs += seg->max_coord-seg->min_coord;\n#endif\n\n          /* check for links -- if seg->serif is set, then seg->link must */\n          /* be ignored                                                   */\n          is_serif = (FT_Bool)( seg->serif               &&\n                                seg->serif->edge         &&\n                                seg->serif->edge != edge );\n\n          if ( ( seg->link && seg->link->edge != NULL ) || is_serif )\n          {\n            AF_Edge     edge2;\n            AF_Segment  seg2;\n\n\n            edge2 = edge->link;\n            seg2  = seg->link;\n\n            if ( is_serif )\n            {\n              seg2  = seg->serif;\n              edge2 = edge->serif;\n            }\n\n            if ( edge2 )\n            {\n              FT_Pos  edge_delta;\n              FT_Pos  seg_delta;\n\n\n              edge_delta = edge->fpos - edge2->fpos;\n              if ( edge_delta < 0 )\n                edge_delta = -edge_delta;\n\n              seg_delta = seg->pos - seg2->pos;\n              if ( seg_delta < 0 )\n                seg_delta = -seg_delta;\n\n              if ( seg_delta < edge_delta )\n                edge2 = seg2->edge;\n            }\n            else\n              edge2 = seg2->edge;\n\n            if ( is_serif )\n            {\n              edge->serif   = edge2;\n              edge2->flags |= AF_EDGE_SERIF;\n            }\n            else\n              edge->link  = edge2;\n          }\n\n          seg = seg->edge_next;\n\n        } while ( seg != edge->first );\n\n        /* set the round/straight flags */\n        edge->flags = AF_EDGE_NORMAL;\n\n        if ( is_round > 0 && is_round >= is_straight )\n          edge->flags |= AF_EDGE_ROUND;\n\n#if 0\n        /* set the edge's main direction */\n        edge->dir = AF_DIR_NONE;\n\n        if ( ups > downs )\n          edge->dir = (FT_Char)up_dir;\n\n        else if ( ups < downs )\n          edge->dir = (FT_Char)-up_dir;\n\n        else if ( ups == downs )\n          edge->dir = 0;  /* both up and down! */\n#endif\n\n        /* gets rid of serifs if link is set                */\n        /* XXX: This gets rid of many unpleasant artefacts! */\n        /*      Example: the `c' in cour.pfa at size 13     */\n\n        if ( edge->serif && edge->link )\n          edge->serif = 0;\n      }\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  af_latin2_hints_detect_features( AF_GlyphHints  hints,\n                                   AF_Dimension   dim )\n  {\n    FT_Error  error;\n\n\n    error = af_latin2_hints_compute_segments( hints, dim );\n    if ( !error )\n    {\n      af_latin2_hints_link_segments( hints, dim );\n\n      error = af_latin2_hints_compute_edges( hints, dim );\n    }\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  af_latin2_hints_compute_blue_edges( AF_GlyphHints    hints,\n                                      AF_LatinMetrics  metrics )\n  {\n    AF_AxisHints  axis       = &hints->axis[AF_DIMENSION_VERT];\n    AF_Edge       edge       = axis->edges;\n    AF_Edge       edge_limit = edge + axis->num_edges;\n    AF_LatinAxis  latin      = &metrics->axis[AF_DIMENSION_VERT];\n    FT_Fixed      scale      = latin->scale;\n    FT_Pos        best_dist0;  /* initial threshold */\n\n\n    /* compute the initial threshold as a fraction of the EM size */\n    best_dist0 = FT_MulFix( metrics->units_per_em / 40, scale );\n\n    if ( best_dist0 > 64 / 2 )\n      best_dist0 = 64 / 2;\n\n    /* compute which blue zones are active, i.e. have their scaled */\n    /* size < 3/4 pixels                                           */\n\n    /* for each horizontal edge search the blue zone which is closest */\n    for ( ; edge < edge_limit; edge++ )\n    {\n      FT_Int    bb;\n      AF_Width  best_blue = NULL;\n      FT_Pos    best_dist = best_dist0;\n\n      for ( bb = 0; bb < AF_LATIN_BLUE_MAX; bb++ )\n      {\n        AF_LatinBlue  blue = latin->blues + bb;\n        FT_Bool       is_top_blue, is_major_dir;\n\n\n        /* skip inactive blue zones (i.e., those that are too small) */\n        if ( !( blue->flags & AF_LATIN_BLUE_ACTIVE ) )\n          continue;\n\n        /* if it is a top zone, check for right edges -- if it is a bottom */\n        /* zone, check for left edges                                      */\n        /*                                                                 */\n        /* of course, that's for TrueType                                  */\n        is_top_blue  = (FT_Byte)( ( blue->flags & AF_LATIN_BLUE_TOP ) != 0 );\n        is_major_dir = FT_BOOL( edge->dir == axis->major_dir );\n\n        /* if it is a top zone, the edge must be against the major    */\n        /* direction; if it is a bottom zone, it must be in the major */\n        /* direction                                                  */\n        if ( is_top_blue ^ is_major_dir )\n        {\n          FT_Pos     dist;\n          AF_Width   compare;\n\n\n          /* if it's a rounded edge, compare it to the overshoot position */\n          /* if it's a flat edge, compare it to the reference position    */\n          if ( edge->flags & AF_EDGE_ROUND )\n            compare = &blue->shoot;\n          else\n            compare = &blue->ref;\n\n          dist = edge->fpos - compare->org;\n          if ( dist < 0 )\n            dist = -dist;\n\n          dist = FT_MulFix( dist, scale );\n          if ( dist < best_dist )\n          {\n            best_dist = dist;\n            best_blue = compare;\n          }\n\n#if 0\n          /* now, compare it to the overshoot position if the edge is     */\n          /* rounded, and if the edge is over the reference position of a */\n          /* top zone, or under the reference position of a bottom zone   */\n          if ( edge->flags & AF_EDGE_ROUND && dist != 0 )\n          {\n            FT_Bool  is_under_ref = FT_BOOL( edge->fpos < blue->ref.org );\n\n\n            if ( is_top_blue ^ is_under_ref )\n            {\n              blue = latin->blues + bb;\n              dist = edge->fpos - blue->shoot.org;\n              if ( dist < 0 )\n                dist = -dist;\n\n              dist = FT_MulFix( dist, scale );\n              if ( dist < best_dist )\n              {\n                best_dist = dist;\n                best_blue = & blue->shoot;\n              }\n            }\n          }\n#endif\n        }\n      }\n\n      if ( best_blue )\n        edge->blue_edge = best_blue;\n    }\n  }\n\n\n  static FT_Error\n  af_latin2_hints_init( AF_GlyphHints    hints,\n                        AF_LatinMetrics  metrics )\n  {\n    FT_Render_Mode  mode;\n    FT_UInt32       scaler_flags, other_flags;\n    FT_Face         face = metrics->root.scaler.face;\n\n\n    af_glyph_hints_rescale( hints, (AF_StyleMetrics)metrics );\n\n    /*\n     *  correct x_scale and y_scale if needed, since they may have\n     *  been modified `af_latin2_metrics_scale_dim' above\n     */\n    hints->x_scale = metrics->axis[AF_DIMENSION_HORZ].scale;\n    hints->x_delta = metrics->axis[AF_DIMENSION_HORZ].delta;\n    hints->y_scale = metrics->axis[AF_DIMENSION_VERT].scale;\n    hints->y_delta = metrics->axis[AF_DIMENSION_VERT].delta;\n\n    /* compute flags depending on render mode, etc. */\n    mode = metrics->root.scaler.render_mode;\n\n#if 0 /* #ifdef AF_CONFIG_OPTION_USE_WARPER */\n    if ( mode == FT_RENDER_MODE_LCD || mode == FT_RENDER_MODE_LCD_V )\n    {\n      metrics->root.scaler.render_mode = mode = FT_RENDER_MODE_NORMAL;\n    }\n#endif\n\n    scaler_flags = hints->scaler_flags;\n    other_flags  = 0;\n\n    /*\n     *  We snap the width of vertical stems for the monochrome and\n     *  horizontal LCD rendering targets only.\n     */\n    if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD )\n      other_flags |= AF_LATIN_HINTS_HORZ_SNAP;\n\n    /*\n     *  We snap the width of horizontal stems for the monochrome and\n     *  vertical LCD rendering targets only.\n     */\n    if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD_V )\n      other_flags |= AF_LATIN_HINTS_VERT_SNAP;\n\n    /*\n     *  We adjust stems to full pixels only if we don't use the `light' mode.\n     */\n    if ( mode != FT_RENDER_MODE_LIGHT )\n      other_flags |= AF_LATIN_HINTS_STEM_ADJUST;\n\n    if ( mode == FT_RENDER_MODE_MONO )\n      other_flags |= AF_LATIN_HINTS_MONO;\n\n    /*\n     *  In `light' hinting mode we disable horizontal hinting completely.\n     *  We also do it if the face is italic.\n     */\n    if ( mode == FT_RENDER_MODE_LIGHT                      ||\n         ( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )\n      scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL;\n\n    hints->scaler_flags = scaler_flags;\n    hints->other_flags  = other_flags;\n\n    return 0;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****        L A T I N   G L Y P H   G R I D - F I T T I N G        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* snap a given width in scaled coordinates to one of the */\n  /* current standard widths                                */\n\n  static FT_Pos\n  af_latin2_snap_width( AF_Width  widths,\n                        FT_Int    count,\n                        FT_Pos    width )\n  {\n    int     n;\n    FT_Pos  best      = 64 + 32 + 2;\n    FT_Pos  reference = width;\n    FT_Pos  scaled;\n\n\n    for ( n = 0; n < count; n++ )\n    {\n      FT_Pos  w;\n      FT_Pos  dist;\n\n\n      w = widths[n].cur;\n      dist = width - w;\n      if ( dist < 0 )\n        dist = -dist;\n      if ( dist < best )\n      {\n        best      = dist;\n        reference = w;\n      }\n    }\n\n    scaled = FT_PIX_ROUND( reference );\n\n    if ( width >= reference )\n    {\n      if ( width < scaled + 48 )\n        width = reference;\n    }\n    else\n    {\n      if ( width > scaled - 48 )\n        width = reference;\n    }\n\n    return width;\n  }\n\n\n  /* compute the snapped width of a given stem */\n\n  static FT_Pos\n  af_latin2_compute_stem_width( AF_GlyphHints  hints,\n                                AF_Dimension   dim,\n                                FT_Pos         width,\n                                AF_Edge_Flags  base_flags,\n                                AF_Edge_Flags  stem_flags )\n  {\n    AF_LatinMetrics  metrics  = (AF_LatinMetrics) hints->metrics;\n    AF_LatinAxis     axis     = & metrics->axis[dim];\n    FT_Pos           dist     = width;\n    FT_Int           sign     = 0;\n    FT_Int           vertical = ( dim == AF_DIMENSION_VERT );\n\n    FT_UNUSED( base_flags );\n\n\n    if ( !AF_LATIN_HINTS_DO_STEM_ADJUST( hints ) ||\n          axis->extra_light                      )\n      return width;\n\n    if ( dist < 0 )\n    {\n      dist = -width;\n      sign = 1;\n    }\n\n    if ( (  vertical && !AF_LATIN_HINTS_DO_VERT_SNAP( hints ) ) ||\n         ( !vertical && !AF_LATIN_HINTS_DO_HORZ_SNAP( hints ) ) )\n    {\n      /* smooth hinting process: very lightly quantize the stem width */\n\n      /* leave the widths of serifs alone */\n\n      if ( ( stem_flags & AF_EDGE_SERIF ) && vertical && ( dist < 3 * 64 ) )\n        goto Done_Width;\n\n#if 0\n      else if ( ( base_flags & AF_EDGE_ROUND ) )\n      {\n        if ( dist < 80 )\n          dist = 64;\n      }\n      else if ( dist < 56 )\n        dist = 56;\n#endif\n      if ( axis->width_count > 0 )\n      {\n        FT_Pos  delta;\n\n\n        /* compare to standard width */\n        if ( axis->width_count > 0 )\n        {\n          delta = dist - axis->widths[0].cur;\n\n          if ( delta < 0 )\n            delta = -delta;\n\n          if ( delta < 40 )\n          {\n            dist = axis->widths[0].cur;\n            if ( dist < 48 )\n              dist = 48;\n\n            goto Done_Width;\n          }\n        }\n\n        if ( dist < 3 * 64 )\n        {\n          delta  = dist & 63;\n          dist  &= -64;\n\n          if ( delta < 10 )\n            dist += delta;\n\n          else if ( delta < 32 )\n            dist += 10;\n\n          else if ( delta < 54 )\n            dist += 54;\n\n          else\n            dist += delta;\n        }\n        else\n          dist = ( dist + 32 ) & ~63;\n      }\n    }\n    else\n    {\n      /* strong hinting process: snap the stem width to integer pixels */\n      FT_Pos  org_dist = dist;\n\n\n      dist = af_latin2_snap_width( axis->widths, axis->width_count, dist );\n\n      if ( vertical )\n      {\n        /* in the case of vertical hinting, always round */\n        /* the stem heights to integer pixels            */\n\n        if ( dist >= 64 )\n          dist = ( dist + 16 ) & ~63;\n        else\n          dist = 64;\n      }\n      else\n      {\n        if ( AF_LATIN_HINTS_DO_MONO( hints ) )\n        {\n          /* monochrome horizontal hinting: snap widths to integer pixels */\n          /* with a different threshold                                   */\n\n          if ( dist < 64 )\n            dist = 64;\n          else\n            dist = ( dist + 32 ) & ~63;\n        }\n        else\n        {\n          /* for horizontal anti-aliased hinting, we adopt a more subtle */\n          /* approach: we strengthen small stems, round stems whose size */\n          /* is between 1 and 2 pixels to an integer, otherwise nothing  */\n\n          if ( dist < 48 )\n            dist = ( dist + 64 ) >> 1;\n\n          else if ( dist < 128 )\n          {\n            /* We only round to an integer width if the corresponding */\n            /* distortion is less than 1/4 pixel.  Otherwise this     */\n            /* makes everything worse since the diagonals, which are  */\n            /* not hinted, appear a lot bolder or thinner than the    */\n            /* vertical stems.                                        */\n\n            FT_Int  delta;\n\n\n            dist = ( dist + 22 ) & ~63;\n            delta = dist - org_dist;\n            if ( delta < 0 )\n              delta = -delta;\n\n            if ( delta >= 16 )\n            {\n              dist = org_dist;\n              if ( dist < 48 )\n                dist = ( dist + 64 ) >> 1;\n            }\n          }\n          else\n            /* round otherwise to prevent color fringes in LCD mode */\n            dist = ( dist + 32 ) & ~63;\n        }\n      }\n    }\n\n  Done_Width:\n    if ( sign )\n      dist = -dist;\n\n    return dist;\n  }\n\n\n  /* align one stem edge relative to the previous stem edge */\n\n  static void\n  af_latin2_align_linked_edge( AF_GlyphHints  hints,\n                               AF_Dimension   dim,\n                               AF_Edge        base_edge,\n                               AF_Edge        stem_edge )\n  {\n    FT_Pos  dist = stem_edge->opos - base_edge->opos;\n\n    FT_Pos  fitted_width = af_latin2_compute_stem_width(\n                             hints, dim, dist,\n                             (AF_Edge_Flags)base_edge->flags,\n                             (AF_Edge_Flags)stem_edge->flags );\n\n\n    stem_edge->pos = base_edge->pos + fitted_width;\n\n    FT_TRACE5(( \"LINK: edge %d (opos=%.2f) linked to (%.2f), \"\n                \"dist was %.2f, now %.2f\\n\",\n                stem_edge-hints->axis[dim].edges, stem_edge->opos / 64.0,\n                stem_edge->pos / 64.0, dist / 64.0, fitted_width / 64.0 ));\n  }\n\n\n  static void\n  af_latin2_align_serif_edge( AF_GlyphHints  hints,\n                              AF_Edge        base,\n                              AF_Edge        serif )\n  {\n    FT_UNUSED( hints );\n\n    serif->pos = base->pos + ( serif->opos - base->opos );\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                    E D G E   H I N T I N G                      ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  FT_LOCAL_DEF( void )\n  af_latin2_hint_edges( AF_GlyphHints  hints,\n                        AF_Dimension   dim )\n  {\n    AF_AxisHints  axis       = &hints->axis[dim];\n    AF_Edge       edges      = axis->edges;\n    AF_Edge       edge_limit = edges + axis->num_edges;\n    AF_Edge       edge;\n    AF_Edge       anchor     = 0;\n    FT_Int        has_serifs = 0;\n    FT_Pos        anchor_drift = 0;\n\n\n\n    FT_TRACE5(( \"==== hinting %s edges =====\\n\",\n                dim == AF_DIMENSION_HORZ ? \"vertical\" : \"horizontal\" ));\n\n    /* we begin by aligning all stems relative to the blue zone */\n    /* if needed -- that's only for horizontal edges            */\n\n    if ( dim == AF_DIMENSION_VERT && AF_HINTS_DO_BLUES( hints ) )\n    {\n      for ( edge = edges; edge < edge_limit; edge++ )\n      {\n        AF_Width  blue;\n        AF_Edge   edge1, edge2;\n\n\n        if ( edge->flags & AF_EDGE_DONE )\n          continue;\n\n        blue  = edge->blue_edge;\n        edge1 = NULL;\n        edge2 = edge->link;\n\n        if ( blue )\n        {\n          edge1 = edge;\n        }\n        else if ( edge2 && edge2->blue_edge )\n        {\n          blue  = edge2->blue_edge;\n          edge1 = edge2;\n          edge2 = edge;\n        }\n\n        if ( !edge1 )\n          continue;\n\n        FT_TRACE5(( \"BLUE: edge %d (opos=%.2f) snapped to (%.2f), \"\n                    \"was (%.2f)\\n\",\n                    edge1-edges, edge1->opos / 64.0, blue->fit / 64.0,\n                    edge1->pos / 64.0 ));\n\n        edge1->pos    = blue->fit;\n        edge1->flags |= AF_EDGE_DONE;\n\n        if ( edge2 && !edge2->blue_edge )\n        {\n          af_latin2_align_linked_edge( hints, dim, edge1, edge2 );\n          edge2->flags |= AF_EDGE_DONE;\n        }\n\n        if ( !anchor )\n        {\n          anchor = edge;\n\n          anchor_drift = ( anchor->pos - anchor->opos );\n          if ( edge2 )\n            anchor_drift = ( anchor_drift +\n                             ( edge2->pos - edge2->opos ) ) >> 1;\n        }\n      }\n    }\n\n    /* now we will align all stem edges, trying to maintain the */\n    /* relative order of stems in the glyph                     */\n    for ( edge = edges; edge < edge_limit; edge++ )\n    {\n      AF_Edge  edge2;\n\n\n      if ( edge->flags & AF_EDGE_DONE )\n        continue;\n\n      /* skip all non-stem edges */\n      edge2 = edge->link;\n      if ( !edge2 )\n      {\n        has_serifs++;\n        continue;\n      }\n\n      /* now align the stem */\n\n      /* this should not happen, but it's better to be safe */\n      if ( edge2->blue_edge )\n      {\n        FT_TRACE5(( \"ASSERTION FAILED for edge %d\\n\", edge2-edges ));\n\n        af_latin2_align_linked_edge( hints, dim, edge2, edge );\n        edge->flags |= AF_EDGE_DONE;\n        continue;\n      }\n\n      if ( !anchor )\n      {\n        FT_Pos  org_len, org_center, cur_len;\n        FT_Pos  cur_pos1, error1, error2, u_off, d_off;\n\n\n        org_len = edge2->opos - edge->opos;\n        cur_len = af_latin2_compute_stem_width(\n                    hints, dim, org_len,\n                    (AF_Edge_Flags)edge->flags,\n                    (AF_Edge_Flags)edge2->flags );\n        if ( cur_len <= 64 )\n          u_off = d_off = 32;\n        else\n        {\n          u_off = 38;\n          d_off = 26;\n        }\n\n        if ( cur_len < 96 )\n        {\n          org_center = edge->opos + ( org_len >> 1 );\n\n          cur_pos1   = FT_PIX_ROUND( org_center );\n\n          error1 = org_center - ( cur_pos1 - u_off );\n          if ( error1 < 0 )\n            error1 = -error1;\n\n          error2 = org_center - ( cur_pos1 + d_off );\n          if ( error2 < 0 )\n            error2 = -error2;\n\n          if ( error1 < error2 )\n            cur_pos1 -= u_off;\n          else\n            cur_pos1 += d_off;\n\n          edge->pos  = cur_pos1 - cur_len / 2;\n          edge2->pos = edge->pos + cur_len;\n        }\n        else\n          edge->pos = FT_PIX_ROUND( edge->opos );\n\n        FT_TRACE5(( \"ANCHOR: edge %d (opos=%.2f) and %d (opos=%.2f)\"\n                    \" snapped to (%.2f) (%.2f)\\n\",\n                    edge-edges, edge->opos / 64.0,\n                    edge2-edges, edge2->opos / 64.0,\n                    edge->pos / 64.0, edge2->pos / 64.0 ));\n        anchor = edge;\n\n        edge->flags |= AF_EDGE_DONE;\n\n        af_latin2_align_linked_edge( hints, dim, edge, edge2 );\n\n        edge2->flags |= AF_EDGE_DONE;\n\n        anchor_drift = ( ( anchor->pos - anchor->opos ) +\n                         ( edge2->pos - edge2->opos ) ) >> 1;\n\n        FT_TRACE5(( \"DRIFT: %.2f\\n\", anchor_drift/64.0 ));\n      }\n      else\n      {\n        FT_Pos   org_pos, org_len, org_center, cur_center, cur_len;\n        FT_Pos   org_left, org_right;\n\n\n        org_pos    = edge->opos + anchor_drift;\n        org_len    = edge2->opos - edge->opos;\n        org_center = org_pos + ( org_len >> 1 );\n\n        cur_len = af_latin2_compute_stem_width(\n                   hints, dim, org_len,\n                   (AF_Edge_Flags)edge->flags,\n                   (AF_Edge_Flags)edge2->flags );\n\n        org_left  = org_pos + ( ( org_len - cur_len ) >> 1 );\n        org_right = org_pos + ( ( org_len + cur_len ) >> 1 );\n\n        FT_TRACE5(( \"ALIGN: left=%.2f right=%.2f \",\n                    org_left / 64.0, org_right / 64.0 ));\n        cur_center = org_center;\n\n        if ( edge2->flags & AF_EDGE_DONE )\n        {\n          FT_TRACE5(( \"\\n\" ));\n          edge->pos = edge2->pos - cur_len;\n        }\n        else\n        {\n         /* we want to compare several displacement, and choose\n          * the one that increases fitness while minimizing\n          * distortion as well\n          */\n          FT_Pos   displacements[6], scores[6], org, fit, delta;\n          FT_UInt  count = 0;\n\n          /* note: don't even try to fit tiny stems */\n          if ( cur_len < 32 )\n          {\n            FT_TRACE5(( \"tiny stem\\n\" ));\n            goto AlignStem;\n          }\n\n          /* if the span is within a single pixel, don't touch it */\n          if ( FT_PIX_FLOOR( org_left ) == FT_PIX_CEIL( org_right ) )\n          {\n            FT_TRACE5(( \"single pixel stem\\n\" ));\n            goto AlignStem;\n          }\n\n          if ( cur_len <= 96 )\n          {\n           /* we want to avoid the absolute worst case which is\n            * when the left and right edges of the span each represent\n            * about 50% of the gray. we'd better want to change this\n            * to 25/75%, since this is much more pleasant to the eye with\n            * very acceptable distortion\n            */\n            FT_Pos  frac_left  = org_left  & 63;\n            FT_Pos  frac_right = org_right & 63;\n\n            if ( frac_left  >= 22 && frac_left  <= 42 &&\n                 frac_right >= 22 && frac_right <= 42 )\n            {\n              org = frac_left;\n              fit = ( org <= 32 ) ? 16 : 48;\n              delta = FT_ABS( fit - org );\n              displacements[count] = fit - org;\n              scores[count++]      = delta;\n              FT_TRACE5(( \"dispA=%.2f (%d) \", ( fit - org ) / 64.0, delta ));\n\n              org = frac_right;\n              fit = ( org <= 32 ) ? 16 : 48;\n              delta = FT_ABS( fit - org );\n              displacements[count] = fit - org;\n              scores[count++]     = delta;\n              FT_TRACE5(( \"dispB=%.2f (%d) \", ( fit - org ) / 64.0, delta ));\n            }\n          }\n\n          /* snapping the left edge to the grid */\n          org   = org_left;\n          fit   = FT_PIX_ROUND( org );\n          delta = FT_ABS( fit - org );\n          displacements[count] = fit - org;\n          scores[count++]      = delta;\n          FT_TRACE5(( \"dispC=%.2f (%d) \", ( fit - org ) / 64.0, delta ));\n\n          /* snapping the right edge to the grid */\n          org   = org_right;\n          fit   = FT_PIX_ROUND( org );\n          delta = FT_ABS( fit - org );\n          displacements[count] = fit - org;\n          scores[count++]      = delta;\n          FT_TRACE5(( \"dispD=%.2f (%d) \", ( fit - org ) / 64.0, delta ));\n\n          /* now find the best displacement */\n          {\n            FT_Pos  best_score = scores[0];\n            FT_Pos  best_disp  = displacements[0];\n            FT_UInt nn;\n\n            for ( nn = 1; nn < count; nn++ )\n            {\n              if ( scores[nn] < best_score )\n              {\n                best_score = scores[nn];\n                best_disp  = displacements[nn];\n              }\n            }\n\n            cur_center = org_center + best_disp;\n          }\n          FT_TRACE5(( \"\\n\" ));\n        }\n\n      AlignStem:\n        edge->pos  = cur_center - ( cur_len >> 1 );\n        edge2->pos = edge->pos + cur_len;\n\n        FT_TRACE5(( \"STEM1: %d (opos=%.2f) to %d (opos=%.2f)\"\n                    \" snapped to (%.2f) and (%.2f),\"\n                    \" org_len=%.2f cur_len=%.2f\\n\",\n                    edge-edges, edge->opos / 64.0,\n                    edge2-edges, edge2->opos / 64.0,\n                    edge->pos / 64.0, edge2->pos / 64.0,\n                    org_len / 64.0, cur_len / 64.0 ));\n\n        edge->flags  |= AF_EDGE_DONE;\n        edge2->flags |= AF_EDGE_DONE;\n\n        if ( edge > edges && edge->pos < edge[-1].pos )\n        {\n          FT_TRACE5(( \"BOUND: %d (pos=%.2f) to (%.2f)\\n\",\n                      edge-edges, edge->pos / 64.0, edge[-1].pos / 64.0 ));\n          edge->pos = edge[-1].pos;\n        }\n      }\n    }\n\n    /* make sure that lowercase m's maintain their symmetry */\n\n    /* In general, lowercase m's have six vertical edges if they are sans */\n    /* serif, or twelve if they are with serifs.  This implementation is  */\n    /* based on that assumption, and seems to work very well with most    */\n    /* faces.  However, if for a certain face this assumption is not      */\n    /* true, the m is just rendered like before.  In addition, any stem   */\n    /* correction will only be applied to symmetrical glyphs (even if the */\n    /* glyph is not an m), so the potential for unwanted distortion is    */\n    /* relatively low.                                                    */\n\n    /* We don't handle horizontal edges since we can't easily assure that */\n    /* the third (lowest) stem aligns with the base line; it might end up */\n    /* one pixel higher or lower.                                         */\n\n#if 0\n    {\n      FT_Int  n_edges = edge_limit - edges;\n\n\n      if ( dim == AF_DIMENSION_HORZ && ( n_edges == 6 || n_edges == 12 ) )\n      {\n        AF_Edge  edge1, edge2, edge3;\n        FT_Pos   dist1, dist2, span, delta;\n\n\n        if ( n_edges == 6 )\n        {\n          edge1 = edges;\n          edge2 = edges + 2;\n          edge3 = edges + 4;\n        }\n        else\n        {\n          edge1 = edges + 1;\n          edge2 = edges + 5;\n          edge3 = edges + 9;\n        }\n\n        dist1 = edge2->opos - edge1->opos;\n        dist2 = edge3->opos - edge2->opos;\n\n        span = dist1 - dist2;\n        if ( span < 0 )\n          span = -span;\n\n        if ( span < 8 )\n        {\n          delta = edge3->pos - ( 2 * edge2->pos - edge1->pos );\n          edge3->pos -= delta;\n          if ( edge3->link )\n            edge3->link->pos -= delta;\n\n          /* move the serifs along with the stem */\n          if ( n_edges == 12 )\n          {\n            ( edges + 8 )->pos -= delta;\n            ( edges + 11 )->pos -= delta;\n          }\n\n          edge3->flags |= AF_EDGE_DONE;\n          if ( edge3->link )\n            edge3->link->flags |= AF_EDGE_DONE;\n        }\n      }\n    }\n#endif\n\n    if ( has_serifs || !anchor )\n    {\n      /*\n       *  now hint the remaining edges (serifs and single) in order\n       *  to complete our processing\n       */\n      for ( edge = edges; edge < edge_limit; edge++ )\n      {\n        FT_Pos  delta;\n\n\n        if ( edge->flags & AF_EDGE_DONE )\n          continue;\n\n        delta = 1000;\n\n        if ( edge->serif )\n        {\n          delta = edge->serif->opos - edge->opos;\n          if ( delta < 0 )\n            delta = -delta;\n        }\n\n        if ( delta < 64 + 16 )\n        {\n          af_latin2_align_serif_edge( hints, edge->serif, edge );\n          FT_TRACE5(( \"SERIF: edge %d (opos=%.2f) serif to %d (opos=%.2f)\"\n                      \" aligned to (%.2f)\\n\",\n                      edge-edges, edge->opos / 64.0,\n                      edge->serif - edges, edge->serif->opos / 64.0,\n                      edge->pos / 64.0 ));\n        }\n        else if ( !anchor )\n        {\n          FT_TRACE5(( \"SERIF_ANCHOR: edge %d (opos=%.2f)\"\n                      \" snapped to (%.2f)\\n\",\n                      edge-edges, edge->opos / 64.0, edge->pos / 64.0 ));\n          edge->pos = FT_PIX_ROUND( edge->opos );\n          anchor    = edge;\n        }\n        else\n        {\n          AF_Edge  before, after;\n\n\n          for ( before = edge - 1; before >= edges; before-- )\n            if ( before->flags & AF_EDGE_DONE )\n              break;\n\n          for ( after = edge + 1; after < edge_limit; after++ )\n            if ( after->flags & AF_EDGE_DONE )\n              break;\n\n          if ( before >= edges && before < edge   &&\n               after < edge_limit && after > edge )\n          {\n            if ( after->opos == before->opos )\n              edge->pos = before->pos;\n            else\n              edge->pos = before->pos +\n                          FT_MulDiv( edge->opos - before->opos,\n                                     after->pos - before->pos,\n                                     after->opos - before->opos );\n            FT_TRACE5(( \"SERIF_LINK1: edge %d (opos=%.2f) snapped to (%.2f)\"\n                        \" from %d (opos=%.2f)\\n\",\n                        edge-edges, edge->opos / 64.0, edge->pos / 64.0,\n                        before - edges, before->opos / 64.0 ));\n          }\n          else\n          {\n            edge->pos = anchor->pos +\n                        ( ( edge->opos - anchor->opos + 16 ) & ~31 );\n\n            FT_TRACE5(( \"SERIF_LINK2: edge %d (opos=%.2f)\"\n                        \" snapped to (%.2f)\\n\",\n                        edge-edges, edge->opos / 64.0, edge->pos / 64.0 ));\n          }\n        }\n\n        edge->flags |= AF_EDGE_DONE;\n\n        if ( edge > edges && edge->pos < edge[-1].pos )\n          edge->pos = edge[-1].pos;\n\n        if ( edge + 1 < edge_limit        &&\n             edge[1].flags & AF_EDGE_DONE &&\n             edge->pos > edge[1].pos      )\n          edge->pos = edge[1].pos;\n      }\n    }\n  }\n\n\n  static FT_Error\n  af_latin2_hints_apply( AF_GlyphHints    hints,\n                         FT_Outline*      outline,\n                         AF_LatinMetrics  metrics )\n  {\n    FT_Error  error;\n    int       dim;\n\n\n    error = af_glyph_hints_reload( hints, outline );\n    if ( error )\n      goto Exit;\n\n    /* analyze glyph outline */\n#ifdef AF_CONFIG_OPTION_USE_WARPER\n    if ( metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT ||\n         AF_HINTS_DO_HORIZONTAL( hints ) )\n#else\n    if ( AF_HINTS_DO_HORIZONTAL( hints ) )\n#endif\n    {\n      error = af_latin2_hints_detect_features( hints, AF_DIMENSION_HORZ );\n      if ( error )\n        goto Exit;\n    }\n\n    if ( AF_HINTS_DO_VERTICAL( hints ) )\n    {\n      error = af_latin2_hints_detect_features( hints, AF_DIMENSION_VERT );\n      if ( error )\n        goto Exit;\n\n      af_latin2_hints_compute_blue_edges( hints, metrics );\n    }\n\n    /* grid-fit the outline */\n    for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )\n    {\n#ifdef AF_CONFIG_OPTION_USE_WARPER\n      if ( ( dim == AF_DIMENSION_HORZ &&\n             metrics->root.scaler.render_mode == FT_RENDER_MODE_LIGHT ) )\n      {\n        AF_WarperRec  warper;\n        FT_Fixed      scale;\n        FT_Pos        delta;\n\n\n        af_warper_compute( &warper, hints, dim, &scale, &delta );\n        af_glyph_hints_scale_dim( hints, dim, scale, delta );\n        continue;\n      }\n#endif\n\n      if ( ( dim == AF_DIMENSION_HORZ && AF_HINTS_DO_HORIZONTAL( hints ) ) ||\n           ( dim == AF_DIMENSION_VERT && AF_HINTS_DO_VERTICAL( hints ) )   )\n      {\n        af_latin2_hint_edges( hints, (AF_Dimension)dim );\n        af_glyph_hints_align_edge_points( hints, (AF_Dimension)dim );\n        af_glyph_hints_align_strong_points( hints, (AF_Dimension)dim );\n        af_glyph_hints_align_weak_points( hints, (AF_Dimension)dim );\n      }\n    }\n    af_glyph_hints_save( hints, outline );\n\n  Exit:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****              L A T I N   S C R I P T   C L A S S              *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  AF_DEFINE_WRITING_SYSTEM_CLASS(\n    af_latin2_writing_system_class,\n\n    AF_WRITING_SYSTEM_LATIN2,\n\n    sizeof ( AF_LatinMetricsRec ),\n\n    (AF_WritingSystem_InitMetricsFunc) af_latin2_metrics_init,\n    (AF_WritingSystem_ScaleMetricsFunc)af_latin2_metrics_scale,\n    (AF_WritingSystem_DoneMetricsFunc) NULL,\n\n    (AF_WritingSystem_InitHintsFunc)   af_latin2_hints_init,\n    (AF_WritingSystem_ApplyHintsFunc)  af_latin2_hints_apply\n  )\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/aflatin2.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  aflatin2.h                                                             */\n/*                                                                         */\n/*    Auto-fitter hinting routines for latin writing system                */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 2003-2007, 2012, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __AFLATIN2_H__\n#define __AFLATIN2_H__\n\n#include \"afhints.h\"\n\n\nFT_BEGIN_HEADER\n\n\n  /* the `latin' writing system */\n\n  AF_DECLARE_WRITING_SYSTEM_CLASS( af_latin2_writing_system_class )\n\n\n/* */\n\nFT_END_HEADER\n\n#endif /* __AFLATIN_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afloader.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afloader.c                                                             */\n/*                                                                         */\n/*    Auto-fitter glyph loading routines (body).                           */\n/*                                                                         */\n/*  Copyright 2003-2009, 2011-2014 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"afglobal.h\"\n#include \"afloader.h\"\n#include \"afhints.h\"\n#include \"aferrors.h\"\n#include \"afmodule.h\"\n#include \"afpic.h\"\n\n\n  /* Initialize glyph loader. */\n\n  FT_LOCAL_DEF( FT_Error )\n  af_loader_init( AF_Module  module )\n  {\n    AF_Loader  loader = module->loader;\n    FT_Memory  memory = module->root.library->memory;\n\n\n    FT_ZERO( loader );\n\n    af_glyph_hints_init( &loader->hints, memory );\n#ifdef FT_DEBUG_AUTOFIT\n    _af_debug_hints = &loader->hints;\n#endif\n    return FT_GlyphLoader_New( memory, &loader->gloader );\n  }\n\n\n  /* Reset glyph loader and compute globals if necessary. */\n\n  FT_LOCAL_DEF( FT_Error )\n  af_loader_reset( AF_Module  module,\n                   FT_Face    face )\n  {\n    FT_Error   error  = FT_Err_Ok;\n    AF_Loader  loader = module->loader;\n\n\n    loader->face    = face;\n    loader->globals = (AF_FaceGlobals)face->autohint.data;\n\n    FT_GlyphLoader_Rewind( loader->gloader );\n\n    if ( loader->globals == NULL )\n    {\n      error = af_face_globals_new( face, &loader->globals, module );\n      if ( !error )\n      {\n        face->autohint.data =\n          (FT_Pointer)loader->globals;\n        face->autohint.finalizer =\n          (FT_Generic_Finalizer)af_face_globals_free;\n      }\n    }\n\n    return error;\n  }\n\n\n  /* Finalize glyph loader. */\n\n  FT_LOCAL_DEF( void )\n  af_loader_done( AF_Module  module )\n  {\n    AF_Loader  loader = module->loader;\n\n\n    af_glyph_hints_done( &loader->hints );\n\n    loader->face    = NULL;\n    loader->globals = NULL;\n\n#ifdef FT_DEBUG_AUTOFIT\n    _af_debug_hints = NULL;\n#endif\n    FT_GlyphLoader_Done( loader->gloader );\n    loader->gloader = NULL;\n  }\n\n\n  /* Load a single glyph component.  This routine calls itself */\n  /* recursively, if necessary, and does the main work of      */\n  /* `af_loader_load_glyph.'                                   */\n\n  static FT_Error\n  af_loader_load_g( AF_Loader  loader,\n                    AF_Scaler  scaler,\n                    FT_UInt    glyph_index,\n                    FT_Int32   load_flags,\n                    FT_UInt    depth )\n  {\n    FT_Error          error;\n    FT_Face           face     = loader->face;\n    FT_GlyphLoader    gloader  = loader->gloader;\n    AF_StyleMetrics   metrics  = loader->metrics;\n    AF_GlyphHints     hints    = &loader->hints;\n    FT_GlyphSlot      slot     = face->glyph;\n    FT_Slot_Internal  internal = slot->internal;\n    FT_Int32          flags;\n\n\n    flags = load_flags | FT_LOAD_LINEAR_DESIGN;\n    error = FT_Load_Glyph( face, glyph_index, flags );\n    if ( error )\n      goto Exit;\n\n    loader->transformed = internal->glyph_transformed;\n    if ( loader->transformed )\n    {\n      FT_Matrix  inverse;\n\n\n      loader->trans_matrix = internal->glyph_matrix;\n      loader->trans_delta  = internal->glyph_delta;\n\n      inverse = loader->trans_matrix;\n      if ( !FT_Matrix_Invert( &inverse ) )\n        FT_Vector_Transform( &loader->trans_delta, &inverse );\n    }\n\n    switch ( slot->format )\n    {\n    case FT_GLYPH_FORMAT_OUTLINE:\n      /* translate the loaded glyph when an internal transform is needed */\n      if ( loader->transformed )\n        FT_Outline_Translate( &slot->outline,\n                              loader->trans_delta.x,\n                              loader->trans_delta.y );\n\n      /* copy the outline points in the loader's current                */\n      /* extra points which are used to keep original glyph coordinates */\n      error = FT_GLYPHLOADER_CHECK_POINTS( gloader,\n                                           slot->outline.n_points + 4,\n                                           slot->outline.n_contours );\n      if ( error )\n        goto Exit;\n\n      FT_ARRAY_COPY( gloader->current.outline.points,\n                     slot->outline.points,\n                     slot->outline.n_points );\n\n      FT_ARRAY_COPY( gloader->current.outline.contours,\n                     slot->outline.contours,\n                     slot->outline.n_contours );\n\n      FT_ARRAY_COPY( gloader->current.outline.tags,\n                     slot->outline.tags,\n                     slot->outline.n_points );\n\n      gloader->current.outline.n_points   = slot->outline.n_points;\n      gloader->current.outline.n_contours = slot->outline.n_contours;\n\n      /* compute original horizontal phantom points (and ignore */\n      /* vertical ones)                                         */\n      loader->pp1.x = hints->x_delta;\n      loader->pp1.y = hints->y_delta;\n      loader->pp2.x = FT_MulFix( slot->metrics.horiAdvance,\n                                 hints->x_scale ) + hints->x_delta;\n      loader->pp2.y = hints->y_delta;\n\n      /* be sure to check for spacing glyphs */\n      if ( slot->outline.n_points == 0 )\n        goto Hint_Metrics;\n\n      /* now load the slot image into the auto-outline and run the */\n      /* automatic hinting process                                 */\n      {\n#ifdef FT_CONFIG_OPTION_PIC\n        AF_FaceGlobals         globals = loader->globals;\n#endif\n        AF_StyleClass          style_class = metrics->style_class;\n        AF_WritingSystemClass  writing_system_class =\n          AF_WRITING_SYSTEM_CLASSES_GET[style_class->writing_system];\n\n\n        if ( writing_system_class->style_hints_apply )\n          writing_system_class->style_hints_apply( hints,\n                                                   &gloader->current.outline,\n                                                   metrics );\n      }\n\n      /* we now need to adjust the metrics according to the change in */\n      /* width/positioning that occurred during the hinting process   */\n      if ( scaler->render_mode != FT_RENDER_MODE_LIGHT )\n      {\n        FT_Pos        old_rsb, old_lsb, new_lsb;\n        FT_Pos        pp1x_uh, pp2x_uh;\n        AF_AxisHints  axis  = &hints->axis[AF_DIMENSION_HORZ];\n        AF_Edge       edge1 = axis->edges;         /* leftmost edge  */\n        AF_Edge       edge2 = edge1 +\n                              axis->num_edges - 1; /* rightmost edge */\n\n\n        if ( axis->num_edges > 1 && AF_HINTS_DO_ADVANCE( hints ) )\n        {\n          old_rsb = loader->pp2.x - edge2->opos;\n          old_lsb = edge1->opos;\n          new_lsb = edge1->pos;\n\n          /* remember unhinted values to later account */\n          /* for rounding errors                       */\n\n          pp1x_uh = new_lsb    - old_lsb;\n          pp2x_uh = edge2->pos + old_rsb;\n\n          /* prefer too much space over too little space */\n          /* for very small sizes                        */\n\n          if ( old_lsb < 24 )\n            pp1x_uh -= 8;\n\n          if ( old_rsb < 24 )\n            pp2x_uh += 8;\n\n          loader->pp1.x = FT_PIX_ROUND( pp1x_uh );\n          loader->pp2.x = FT_PIX_ROUND( pp2x_uh );\n\n          if ( loader->pp1.x >= new_lsb && old_lsb > 0 )\n            loader->pp1.x -= 64;\n\n          if ( loader->pp2.x <= edge2->pos && old_rsb > 0 )\n            loader->pp2.x += 64;\n\n          slot->lsb_delta = loader->pp1.x - pp1x_uh;\n          slot->rsb_delta = loader->pp2.x - pp2x_uh;\n        }\n        else\n        {\n          FT_Pos  pp1x = loader->pp1.x;\n          FT_Pos  pp2x = loader->pp2.x;\n\n\n          loader->pp1.x = FT_PIX_ROUND( pp1x );\n          loader->pp2.x = FT_PIX_ROUND( pp2x );\n\n          slot->lsb_delta = loader->pp1.x - pp1x;\n          slot->rsb_delta = loader->pp2.x - pp2x;\n        }\n      }\n      else\n      {\n        FT_Pos  pp1x = loader->pp1.x;\n        FT_Pos  pp2x = loader->pp2.x;\n\n\n        loader->pp1.x = FT_PIX_ROUND( pp1x + hints->xmin_delta );\n        loader->pp2.x = FT_PIX_ROUND( pp2x + hints->xmax_delta );\n\n        slot->lsb_delta = loader->pp1.x - pp1x;\n        slot->rsb_delta = loader->pp2.x - pp2x;\n      }\n\n      /* good, we simply add the glyph to our loader's base */\n      FT_GlyphLoader_Add( gloader );\n      break;\n\n    case FT_GLYPH_FORMAT_COMPOSITE:\n      {\n        FT_UInt      nn, num_subglyphs = slot->num_subglyphs;\n        FT_UInt      num_base_subgs, start_point;\n        FT_SubGlyph  subglyph;\n\n\n        start_point = gloader->base.outline.n_points;\n\n        /* first of all, copy the subglyph descriptors in the glyph loader */\n        error = FT_GlyphLoader_CheckSubGlyphs( gloader, num_subglyphs );\n        if ( error )\n          goto Exit;\n\n        FT_ARRAY_COPY( gloader->current.subglyphs,\n                       slot->subglyphs,\n                       num_subglyphs );\n\n        gloader->current.num_subglyphs = num_subglyphs;\n        num_base_subgs                 = gloader->base.num_subglyphs;\n\n        /* now read each subglyph independently */\n        for ( nn = 0; nn < num_subglyphs; nn++ )\n        {\n          FT_Vector  pp1, pp2;\n          FT_Pos     x, y;\n          FT_UInt    num_points, num_new_points, num_base_points;\n\n\n          /* gloader.current.subglyphs can change during glyph loading due */\n          /* to re-allocation -- we must recompute the current subglyph on */\n          /* each iteration                                                */\n          subglyph = gloader->base.subglyphs + num_base_subgs + nn;\n\n          pp1 = loader->pp1;\n          pp2 = loader->pp2;\n\n          num_base_points = gloader->base.outline.n_points;\n\n          error = af_loader_load_g( loader, scaler, subglyph->index,\n                                    load_flags, depth + 1 );\n          if ( error )\n            goto Exit;\n\n          /* recompute subglyph pointer */\n          subglyph = gloader->base.subglyphs + num_base_subgs + nn;\n\n          if ( !( subglyph->flags & FT_SUBGLYPH_FLAG_USE_MY_METRICS ) )\n          {\n            loader->pp1 = pp1;\n            loader->pp2 = pp2;\n          }\n\n          num_points     = gloader->base.outline.n_points;\n          num_new_points = num_points - num_base_points;\n\n          /* now perform the transformation required for this subglyph */\n\n          if ( subglyph->flags & ( FT_SUBGLYPH_FLAG_SCALE    |\n                                   FT_SUBGLYPH_FLAG_XY_SCALE |\n                                   FT_SUBGLYPH_FLAG_2X2      ) )\n          {\n            FT_Vector*  cur   = gloader->base.outline.points +\n                                num_base_points;\n            FT_Vector*  limit = cur + num_new_points;\n\n\n            for ( ; cur < limit; cur++ )\n              FT_Vector_Transform( cur, &subglyph->transform );\n          }\n\n          /* apply offset */\n\n          if ( !( subglyph->flags & FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ) )\n          {\n            FT_Int      k = subglyph->arg1;\n            FT_UInt     l = subglyph->arg2;\n            FT_Vector*  p1;\n            FT_Vector*  p2;\n\n\n            if ( start_point + k >= num_base_points         ||\n                               l >= (FT_UInt)num_new_points )\n            {\n              error = FT_THROW( Invalid_Composite );\n              goto Exit;\n            }\n\n            l += num_base_points;\n\n            /* for now, only use the current point coordinates; */\n            /* we eventually may consider another approach      */\n            p1 = gloader->base.outline.points + start_point + k;\n            p2 = gloader->base.outline.points + start_point + l;\n\n            x = p1->x - p2->x;\n            y = p1->y - p2->y;\n          }\n          else\n          {\n            x = FT_MulFix( subglyph->arg1, hints->x_scale ) + hints->x_delta;\n            y = FT_MulFix( subglyph->arg2, hints->y_scale ) + hints->y_delta;\n\n            x = FT_PIX_ROUND( x );\n            y = FT_PIX_ROUND( y );\n          }\n\n          {\n            FT_Outline  dummy = gloader->base.outline;\n\n\n            dummy.points  += num_base_points;\n            dummy.n_points = (short)num_new_points;\n\n            FT_Outline_Translate( &dummy, x, y );\n          }\n        }\n      }\n      break;\n\n    default:\n      /* we don't support other formats (yet?) */\n      error = FT_THROW( Unimplemented_Feature );\n    }\n\n  Hint_Metrics:\n    if ( depth == 0 )\n    {\n      FT_BBox    bbox;\n      FT_Vector  vvector;\n\n\n      vvector.x = slot->metrics.vertBearingX - slot->metrics.horiBearingX;\n      vvector.y = slot->metrics.vertBearingY - slot->metrics.horiBearingY;\n      vvector.x = FT_MulFix( vvector.x, metrics->scaler.x_scale );\n      vvector.y = FT_MulFix( vvector.y, metrics->scaler.y_scale );\n\n      /* transform the hinted outline if needed */\n      if ( loader->transformed )\n      {\n        FT_Outline_Transform( &gloader->base.outline, &loader->trans_matrix );\n        FT_Vector_Transform( &vvector, &loader->trans_matrix );\n      }\n#if 1\n      /* we must translate our final outline by -pp1.x and compute */\n      /* the new metrics                                           */\n      if ( loader->pp1.x )\n        FT_Outline_Translate( &gloader->base.outline, -loader->pp1.x, 0 );\n#endif\n      FT_Outline_Get_CBox( &gloader->base.outline, &bbox );\n\n      bbox.xMin = FT_PIX_FLOOR( bbox.xMin );\n      bbox.yMin = FT_PIX_FLOOR( bbox.yMin );\n      bbox.xMax = FT_PIX_CEIL(  bbox.xMax );\n      bbox.yMax = FT_PIX_CEIL(  bbox.yMax );\n\n      slot->metrics.width        = bbox.xMax - bbox.xMin;\n      slot->metrics.height       = bbox.yMax - bbox.yMin;\n      slot->metrics.horiBearingX = bbox.xMin;\n      slot->metrics.horiBearingY = bbox.yMax;\n\n      slot->metrics.vertBearingX = FT_PIX_FLOOR( bbox.xMin + vvector.x );\n      slot->metrics.vertBearingY = FT_PIX_FLOOR( bbox.yMax + vvector.y );\n\n      /* for mono-width fonts (like Andale, Courier, etc.) we need */\n      /* to keep the original rounded advance width; ditto for     */\n      /* digits if all have the same advance width                 */\n#if 0\n      if ( !FT_IS_FIXED_WIDTH( slot->face ) )\n        slot->metrics.horiAdvance = loader->pp2.x - loader->pp1.x;\n      else\n        slot->metrics.horiAdvance = FT_MulFix( slot->metrics.horiAdvance,\n                                               x_scale );\n#else\n      if ( scaler->render_mode != FT_RENDER_MODE_LIGHT                      &&\n           ( FT_IS_FIXED_WIDTH( slot->face )                              ||\n             ( af_face_globals_is_digit( loader->globals, glyph_index ) &&\n               metrics->digits_have_same_width                          ) ) )\n      {\n        slot->metrics.horiAdvance = FT_MulFix( slot->metrics.horiAdvance,\n                                               metrics->scaler.x_scale );\n\n        /* Set delta values to 0.  Otherwise code that uses them is */\n        /* going to ruin the fixed advance width.                   */\n        slot->lsb_delta = 0;\n        slot->rsb_delta = 0;\n      }\n      else\n      {\n        /* non-spacing glyphs must stay as-is */\n        if ( slot->metrics.horiAdvance )\n          slot->metrics.horiAdvance = loader->pp2.x - loader->pp1.x;\n      }\n#endif\n\n      slot->metrics.vertAdvance = FT_MulFix( slot->metrics.vertAdvance,\n                                             metrics->scaler.y_scale );\n\n      slot->metrics.horiAdvance = FT_PIX_ROUND( slot->metrics.horiAdvance );\n      slot->metrics.vertAdvance = FT_PIX_ROUND( slot->metrics.vertAdvance );\n\n      /* now copy outline into glyph slot */\n      FT_GlyphLoader_Rewind( internal->loader );\n      error = FT_GlyphLoader_CopyPoints( internal->loader, gloader );\n      if ( error )\n        goto Exit;\n\n      /* reassign all outline fields except flags to protect them */\n      slot->outline.n_contours = internal->loader->base.outline.n_contours;\n      slot->outline.n_points   = internal->loader->base.outline.n_points;\n      slot->outline.points     = internal->loader->base.outline.points;\n      slot->outline.tags       = internal->loader->base.outline.tags;\n      slot->outline.contours   = internal->loader->base.outline.contours;\n\n      slot->format  = FT_GLYPH_FORMAT_OUTLINE;\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /* Load a glyph. */\n\n  FT_LOCAL_DEF( FT_Error )\n  af_loader_load_glyph( AF_Module  module,\n                        FT_Face    face,\n                        FT_UInt    gindex,\n                        FT_Int32   load_flags )\n  {\n    FT_Error      error;\n    FT_Size       size   = face->size;\n    AF_Loader     loader = module->loader;\n    AF_ScalerRec  scaler;\n\n\n    if ( !size )\n      return FT_THROW( Invalid_Size_Handle );\n\n    FT_ZERO( &scaler );\n\n    scaler.face    = face;\n    scaler.x_scale = size->metrics.x_scale;\n    scaler.x_delta = 0;  /* XXX: TODO: add support for sub-pixel hinting */\n    scaler.y_scale = size->metrics.y_scale;\n    scaler.y_delta = 0;  /* XXX: TODO: add support for sub-pixel hinting */\n\n    scaler.render_mode = FT_LOAD_TARGET_MODE( load_flags );\n    scaler.flags       = 0;  /* XXX: fix this */\n\n    error = af_loader_reset( module, face );\n    if ( !error )\n    {\n      AF_StyleMetrics  metrics;\n      FT_UInt          options = AF_STYLE_NONE_DFLT;\n\n\n#ifdef FT_OPTION_AUTOFIT2\n      /* XXX: undocumented hook to activate the latin2 writing system */\n      if ( load_flags & ( 1UL << 20 ) )\n        options = AF_STYLE_LTN2_DFLT;\n#endif\n\n      error = af_face_globals_get_metrics( loader->globals, gindex,\n                                           options, &metrics );\n      if ( !error )\n      {\n#ifdef FT_CONFIG_OPTION_PIC\n        AF_FaceGlobals         globals = loader->globals;\n#endif\n        AF_StyleClass          style_class = metrics->style_class;\n        AF_WritingSystemClass  writing_system_class =\n          AF_WRITING_SYSTEM_CLASSES_GET[style_class->writing_system];\n\n\n        loader->metrics = metrics;\n\n        if ( writing_system_class->style_metrics_scale )\n          writing_system_class->style_metrics_scale( metrics, &scaler );\n        else\n          metrics->scaler = scaler;\n\n        load_flags |=  FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM;\n        load_flags &= ~FT_LOAD_RENDER;\n\n        if ( writing_system_class->style_hints_init )\n        {\n          error = writing_system_class->style_hints_init( &loader->hints,\n                                                          metrics );\n          if ( error )\n            goto Exit;\n        }\n\n        error = af_loader_load_g( loader, &scaler, gindex, load_flags, 0 );\n      }\n    }\n  Exit:\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afloader.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afloader.h                                                             */\n/*                                                                         */\n/*    Auto-fitter glyph loading routines (specification).                  */\n/*                                                                         */\n/*  Copyright 2003-2005, 2011-2013 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __AFLOADER_H__\n#define __AFLOADER_H__\n\n#include \"afhints.h\"\n#include \"afglobal.h\"\n\n\nFT_BEGIN_HEADER\n\n  typedef struct AF_ModuleRec_*  AF_Module;\n\n  /*\n   *  The autofitter module's (global) data structure to communicate with\n   *  actual fonts.  If necessary, `local' data like the current face, the\n   *  current face's auto-hint data, or the current glyph's parameters\n   *  relevant to auto-hinting are `swapped in'.  Cf. functions like\n   *  `af_loader_reset' and `af_loader_load_g'.\n   */\n\n  typedef struct  AF_LoaderRec_\n  {\n    /* current face data */\n    FT_Face           face;\n    AF_FaceGlobals    globals;\n\n    /* current glyph data */\n    FT_GlyphLoader    gloader;\n    AF_GlyphHintsRec  hints;\n    AF_StyleMetrics   metrics;\n    FT_Bool           transformed;\n    FT_Matrix         trans_matrix;\n    FT_Vector         trans_delta;\n    FT_Vector         pp1;\n    FT_Vector         pp2;\n    /* we don't handle vertical phantom points */\n\n  } AF_LoaderRec, *AF_Loader;\n\n\n  FT_LOCAL( FT_Error )\n  af_loader_init( AF_Module  module );\n\n\n  FT_LOCAL( FT_Error )\n  af_loader_reset( AF_Module  module,\n                   FT_Face    face );\n\n\n  FT_LOCAL( void )\n  af_loader_done( AF_Module  module );\n\n\n  FT_LOCAL( FT_Error )\n  af_loader_load_glyph( AF_Module  module,\n                        FT_Face    face,\n                        FT_UInt    gindex,\n                        FT_Int32   load_flags );\n\n/* */\n\n\nFT_END_HEADER\n\n#endif /* __AFLOADER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afmodule.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afmodule.c                                                             */\n/*                                                                         */\n/*    Auto-fitter module implementation (body).                            */\n/*                                                                         */\n/*  Copyright 2003-2006, 2009, 2011-2014 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"afglobal.h\"\n#include \"afmodule.h\"\n#include \"afloader.h\"\n#include \"aferrors.h\"\n#include \"afpic.h\"\n\n#ifdef FT_DEBUG_AUTOFIT\n  int    _af_debug_disable_horz_hints;\n  int    _af_debug_disable_vert_hints;\n  int    _af_debug_disable_blue_hints;\n  void*  _af_debug_hints;\n#endif\n\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_AUTOHINTER_H\n#include FT_SERVICE_PROPERTIES_H\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_afmodule\n\n\n  static FT_Error\n  af_property_get_face_globals( FT_Face          face,\n                                AF_FaceGlobals*  aglobals,\n                                AF_Module        module )\n  {\n    FT_Error        error = FT_Err_Ok;\n    AF_FaceGlobals  globals;\n\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    globals = (AF_FaceGlobals)face->autohint.data;\n    if ( !globals )\n    {\n      /* trigger computation of the global style data */\n      /* in case it hasn't been done yet              */\n      error = af_face_globals_new( face, &globals, module );\n      if ( !error )\n      {\n        face->autohint.data =\n          (FT_Pointer)globals;\n        face->autohint.finalizer =\n          (FT_Generic_Finalizer)af_face_globals_free;\n      }\n    }\n\n    if ( !error )\n      *aglobals = globals;\n\n    return error;\n  }\n\n\n  static FT_Error\n  af_property_set( FT_Module    ft_module,\n                   const char*  property_name,\n                   const void*  value )\n  {\n    FT_Error   error  = FT_Err_Ok;\n    AF_Module  module = (AF_Module)ft_module;\n\n\n    if ( !ft_strcmp( property_name, \"fallback-script\" ) )\n    {\n      FT_UInt*  fallback_script = (FT_UInt*)value;\n\n      FT_UInt  ss;\n\n\n      /* We translate the fallback script to a fallback style that uses */\n      /* `fallback-script' as its script and `AF_COVERAGE_NONE' as its  */\n      /* coverage value.                                                */\n      for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )\n      {\n        AF_StyleClass  style_class = AF_STYLE_CLASSES_GET[ss];\n\n\n        if ( (FT_UInt)style_class->script == *fallback_script &&\n             style_class->coverage == AF_COVERAGE_DEFAULT     )\n        {\n          module->fallback_style = ss;\n          break;\n        }\n      }\n\n      if ( !AF_STYLE_CLASSES_GET[ss] )\n      {\n        FT_TRACE0(( \"af_property_set: Invalid value %d for property `%s'\\n\",\n                    fallback_script, property_name ));\n        return FT_THROW( Invalid_Argument );\n      }\n\n      return error;\n    }\n    else if ( !ft_strcmp( property_name, \"default-script\" ) )\n    {\n      FT_UInt*  default_script = (FT_UInt*)value;\n\n\n      module->default_script = *default_script;\n\n      return error;\n    }\n    else if ( !ft_strcmp( property_name, \"increase-x-height\" ) )\n    {\n      FT_Prop_IncreaseXHeight*  prop = (FT_Prop_IncreaseXHeight*)value;\n      AF_FaceGlobals            globals;\n\n\n      error = af_property_get_face_globals( prop->face, &globals, module );\n      if ( !error )\n        globals->increase_x_height = prop->limit;\n\n      return error;\n    }\n\n    FT_TRACE0(( \"af_property_set: missing property `%s'\\n\",\n                property_name ));\n    return FT_THROW( Missing_Property );\n  }\n\n\n  static FT_Error\n  af_property_get( FT_Module    ft_module,\n                   const char*  property_name,\n                   void*        value )\n  {\n    FT_Error   error          = FT_Err_Ok;\n    AF_Module  module         = (AF_Module)ft_module;\n    FT_UInt    fallback_style = module->fallback_style;\n    FT_UInt    default_script = module->default_script;\n\n\n    if ( !ft_strcmp( property_name, \"glyph-to-script-map\" ) )\n    {\n      FT_Prop_GlyphToScriptMap*  prop = (FT_Prop_GlyphToScriptMap*)value;\n      AF_FaceGlobals             globals;\n\n\n      error = af_property_get_face_globals( prop->face, &globals, module );\n      if ( !error )\n        prop->map = globals->glyph_styles;\n\n      return error;\n    }\n    else if ( !ft_strcmp( property_name, \"fallback-script\" ) )\n    {\n      FT_UInt*  val = (FT_UInt*)value;\n\n      AF_StyleClass  style_class = AF_STYLE_CLASSES_GET[fallback_style];\n\n\n      *val = style_class->script;\n\n      return error;\n    }\n    else if ( !ft_strcmp( property_name, \"default-script\" ) )\n    {\n      FT_UInt*  val = (FT_UInt*)value;\n\n\n      *val = default_script;\n\n      return error;\n    }\n    else if ( !ft_strcmp( property_name, \"increase-x-height\" ) )\n    {\n      FT_Prop_IncreaseXHeight*  prop = (FT_Prop_IncreaseXHeight*)value;\n      AF_FaceGlobals            globals;\n\n\n      error = af_property_get_face_globals( prop->face, &globals, module );\n      if ( !error )\n        prop->limit = globals->increase_x_height;\n\n      return error;\n    }\n\n\n    FT_TRACE0(( \"af_property_get: missing property `%s'\\n\",\n                property_name ));\n    return FT_THROW( Missing_Property );\n  }\n\n\n  FT_DEFINE_SERVICE_PROPERTIESREC(\n    af_service_properties,\n    (FT_Properties_SetFunc)af_property_set,\n    (FT_Properties_GetFunc)af_property_get )\n\n\n  FT_DEFINE_SERVICEDESCREC1(\n    af_services,\n    FT_SERVICE_ID_PROPERTIES, &AF_SERVICE_PROPERTIES_GET )\n\n\n  FT_CALLBACK_DEF( FT_Module_Interface )\n  af_get_interface( FT_Module    module,\n                    const char*  module_interface )\n  {\n    /* AF_SERVICES_GET dereferences `library' in PIC mode */\n#ifdef FT_CONFIG_OPTION_PIC\n    FT_Library  library;\n\n\n    if ( !module )\n      return NULL;\n    library = module->library;\n    if ( !library )\n      return NULL;\n#else\n    FT_UNUSED( module );\n#endif\n\n    return ft_service_list_lookup( AF_SERVICES_GET, module_interface );\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  af_autofitter_init( FT_Module  ft_module )      /* AF_Module */\n  {\n    AF_Module  module = (AF_Module)ft_module;\n\n\n    module->fallback_style = AF_STYLE_FALLBACK;\n    module->default_script = AF_SCRIPT_DEFAULT;\n\n    return af_loader_init( module );\n  }\n\n\n  FT_CALLBACK_DEF( void )\n  af_autofitter_done( FT_Module  ft_module )      /* AF_Module */\n  {\n    AF_Module  module = (AF_Module)ft_module;\n\n\n    af_loader_done( module );\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  af_autofitter_load_glyph( AF_Module     module,\n                            FT_GlyphSlot  slot,\n                            FT_Size       size,\n                            FT_UInt       glyph_index,\n                            FT_Int32      load_flags )\n  {\n    FT_UNUSED( size );\n\n    return af_loader_load_glyph( module, slot->face,\n                                 glyph_index, load_flags );\n  }\n\n\n  FT_DEFINE_AUTOHINTER_INTERFACE(\n    af_autofitter_interface,\n    NULL,                                                    /* reset_face */\n    NULL,                                              /* get_global_hints */\n    NULL,                                             /* done_global_hints */\n    (FT_AutoHinter_GlyphLoadFunc)af_autofitter_load_glyph )  /* load_glyph */\n\n\n  FT_DEFINE_MODULE(\n    autofit_module_class,\n\n    FT_MODULE_HINTER,\n    sizeof ( AF_ModuleRec ),\n\n    \"autofitter\",\n    0x10000L,   /* version 1.0 of the autofitter  */\n    0x20000L,   /* requires FreeType 2.0 or above */\n\n    (const void*)&AF_INTERFACE_GET,\n\n    (FT_Module_Constructor)af_autofitter_init,\n    (FT_Module_Destructor) af_autofitter_done,\n    (FT_Module_Requester)  af_get_interface )\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afmodule.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afmodule.h                                                             */\n/*                                                                         */\n/*    Auto-fitter module implementation (specification).                   */\n/*                                                                         */\n/*  Copyright 2003-2005, 2009, 2012, 2013 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __AFMODULE_H__\n#define __AFMODULE_H__\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n#include FT_MODULE_H\n\n#include \"afloader.h\"\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   *  This is the `extended' FT_Module structure which holds the\n   *  autofitter's global data.  Right before hinting a glyph, the data\n   *  specific to the glyph's face (blue zones, stem widths, etc.) are\n   *  loaded into `loader' (see function `af_loader_reset').\n   */\n\n  typedef struct  AF_ModuleRec_\n  {\n    FT_ModuleRec  root;\n\n    FT_UInt       fallback_style;\n    FT_UInt       default_script;\n\n    AF_LoaderRec  loader[1];\n\n  } AF_ModuleRec;\n\n\nFT_DECLARE_MODULE(autofit_module_class)\n\n\nFT_END_HEADER\n\n#endif /* __AFMODULE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afpic.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afpic.c                                                                */\n/*                                                                         */\n/*    The FreeType position independent code services for autofit module.  */\n/*                                                                         */\n/*  Copyright 2009-2014 by                                                 */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_INTERNAL_OBJECTS_H\n#include \"afpic.h\"\n#include \"afglobal.h\"\n#include \"aferrors.h\"\n\n\n#ifdef FT_CONFIG_OPTION_PIC\n\n  /* forward declaration of PIC init functions from afmodule.c */\n  FT_Error\n  FT_Create_Class_af_services( FT_Library           library,\n                               FT_ServiceDescRec**  output_class );\n\n  void\n  FT_Destroy_Class_af_services( FT_Library          library,\n                                FT_ServiceDescRec*  clazz );\n\n  void\n  FT_Init_Class_af_service_properties( FT_Service_PropertiesRec*  clazz );\n\n  void FT_Init_Class_af_autofitter_interface(\n    FT_Library                   library,\n    FT_AutoHinter_InterfaceRec*  clazz );\n\n\n  /* forward declaration of PIC init functions from writing system classes */\n#undef  WRITING_SYSTEM\n#define WRITING_SYSTEM( ws, WS )  /* empty */\n\n#include \"afwrtsys.h\"\n\n\n  void\n  autofit_module_class_pic_free( FT_Library  library )\n  {\n    FT_PIC_Container*  pic_container = &library->pic_container;\n    FT_Memory          memory        = library->memory;\n\n\n    if ( pic_container->autofit )\n    {\n      AFModulePIC*  container = (AFModulePIC*)pic_container->autofit;\n\n\n      if ( container->af_services )\n        FT_Destroy_Class_af_services( library,\n                                      container->af_services );\n      container->af_services = NULL;\n\n      FT_FREE( container );\n      pic_container->autofit = NULL;\n    }\n  }\n\n\n  FT_Error\n  autofit_module_class_pic_init( FT_Library  library )\n  {\n    FT_PIC_Container*  pic_container = &library->pic_container;\n    FT_UInt            ss;\n    FT_Error           error         = FT_Err_Ok;\n    AFModulePIC*       container     = NULL;\n    FT_Memory          memory        = library->memory;\n\n\n    /* allocate pointer, clear and set global container pointer */\n    if ( FT_ALLOC ( container, sizeof ( *container ) ) )\n      return error;\n    FT_MEM_SET( container, 0, sizeof ( *container ) );\n    pic_container->autofit = container;\n\n    /* initialize pointer table -                       */\n    /* this is how the module usually expects this data */\n    error = FT_Create_Class_af_services( library,\n                                         &container->af_services );\n    if ( error )\n      goto Exit;\n\n    FT_Init_Class_af_service_properties( &container->af_service_properties );\n\n    for ( ss = 0; ss < AF_WRITING_SYSTEM_MAX; ss++ )\n      container->af_writing_system_classes[ss] =\n        &container->af_writing_system_classes_rec[ss];\n    container->af_writing_system_classes[AF_WRITING_SYSTEM_MAX] = NULL;\n\n    for ( ss = 0; ss < AF_SCRIPT_MAX; ss++ )\n      container->af_script_classes[ss] =\n        &container->af_script_classes_rec[ss];\n    container->af_script_classes[AF_SCRIPT_MAX] = NULL;\n\n    for ( ss = 0; ss < AF_STYLE_MAX; ss++ )\n      container->af_style_classes[ss] =\n        &container->af_style_classes_rec[ss];\n    container->af_style_classes[AF_STYLE_MAX] = NULL;\n\n#undef  WRITING_SYSTEM\n#define WRITING_SYSTEM( ws, WS )                             \\\n        FT_Init_Class_af_ ## ws ## _writing_system_class(    \\\n          &container->af_writing_system_classes_rec[ss++] );\n\n    ss = 0;\n#include \"afwrtsys.h\"\n\n#undef  SCRIPT\n#define SCRIPT( s, S, d, h, sc1, sc2, sc3 )          \\\n        FT_Init_Class_af_ ## s ## _script_class(     \\\n          &container->af_script_classes_rec[ss++] );\n\n    ss = 0;\n#include \"afscript.h\"\n\n#undef  STYLE\n#define STYLE( s, S, d, ws, sc, bss, c )            \\\n        FT_Init_Class_af_ ## s ## _style_class(     \\\n          &container->af_style_classes_rec[ss++] );\n\n    ss = 0;\n#include \"afstyles.h\"\n\n    FT_Init_Class_af_autofitter_interface(\n      library, &container->af_autofitter_interface );\n\n  Exit:\n    if ( error )\n      autofit_module_class_pic_free( library );\n    return error;\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afpic.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afpic.h                                                                */\n/*                                                                         */\n/*    The FreeType position independent code services for autofit module.  */\n/*                                                                         */\n/*  Copyright 2009, 2011-2013 by                                           */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __AFPIC_H__\n#define __AFPIC_H__\n\n\nFT_BEGIN_HEADER\n\n#include FT_INTERNAL_PIC_H\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define AF_SERVICES_GET                af_services\n#define AF_SERVICE_PROPERTIES_GET      af_service_properties\n\n#define AF_WRITING_SYSTEM_CLASSES_GET  af_writing_system_classes\n#define AF_SCRIPT_CLASSES_GET          af_script_classes\n#define AF_STYLE_CLASSES_GET           af_style_classes\n#define AF_INTERFACE_GET               af_autofitter_interface\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n  /* some include files required for members of AFModulePIC */\n#include FT_SERVICE_PROPERTIES_H\n\n#include \"aftypes.h\"\n\n\n  typedef struct  AFModulePIC_\n  {\n    FT_ServiceDescRec*          af_services;\n    FT_Service_PropertiesRec    af_service_properties;\n\n    AF_WritingSystemClass       af_writing_system_classes\n                                  [AF_WRITING_SYSTEM_MAX + 1];\n    AF_WritingSystemClassRec    af_writing_system_classes_rec\n                                  [AF_WRITING_SYSTEM_MAX];\n\n    AF_ScriptClass              af_script_classes\n                                  [AF_SCRIPT_MAX + 1];\n    AF_ScriptClassRec           af_script_classes_rec\n                                  [AF_SCRIPT_MAX];\n\n    AF_StyleClass               af_style_classes\n                                  [AF_STYLE_MAX + 1];\n    AF_StyleClassRec            af_style_classes_rec\n                                  [AF_STYLE_MAX];\n\n    FT_AutoHinter_InterfaceRec  af_autofitter_interface;\n\n  } AFModulePIC;\n\n\n#define GET_PIC( lib )  \\\n          ( (AFModulePIC*)((lib)->pic_container.autofit) )\n\n#define AF_SERVICES_GET  \\\n          ( GET_PIC( library )->af_services )\n#define AF_SERVICE_PROPERTIES_GET  \\\n          ( GET_PIC( library )->af_service_properties )\n\n#define AF_WRITING_SYSTEM_CLASSES_GET  \\\n          ( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_writing_system_classes )\n#define AF_SCRIPT_CLASSES_GET  \\\n          ( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_script_classes )\n#define AF_STYLE_CLASSES_GET  \\\n          ( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_style_classes )\n#define AF_INTERFACE_GET  \\\n          ( GET_PIC( library )->af_autofitter_interface )\n\n\n  /* see afpic.c for the implementation */\n  void\n  autofit_module_class_pic_free( FT_Library  library );\n\n  FT_Error\n  autofit_module_class_pic_init( FT_Library  library );\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __AFPIC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afranges.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afranges.c                                                             */\n/*                                                                         */\n/*    Auto-fitter Unicode script ranges (body).                            */\n/*                                                                         */\n/*  Copyright 2013, 2014 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"afranges.h\"\n\n\n  const AF_Script_UniRangeRec  af_cyrl_uniranges[] =\n  {\n    AF_UNIRANGE_REC(  0x0400UL,  0x04FFUL ),  /* Cyrillic            */\n    AF_UNIRANGE_REC(  0x0500UL,  0x052FUL ),  /* Cyrillic Supplement */\n    AF_UNIRANGE_REC(  0x2DE0UL,  0x2DFFUL ),  /* Cyrillic Extended-A */\n    AF_UNIRANGE_REC(  0xA640UL,  0xA69FUL ),  /* Cyrillic Extended-B */\n    AF_UNIRANGE_REC(       0UL,       0UL )\n  };\n\n  /* there are some characters in the Devanagari Unicode block that are    */\n  /* generic to Indic scripts; we omit them so that their presence doesn't */\n  /* trigger Devanagari                                                    */\n\n  const AF_Script_UniRangeRec  af_deva_uniranges[] =\n  {\n    AF_UNIRANGE_REC(  0x0900UL,  0x093BUL ),  /* Devanagari       */\n    /* omitting U+093C nukta */\n    AF_UNIRANGE_REC(  0x093DUL,  0x0950UL ),\n    /* omitting U+0951 udatta, U+0952 anudatta */\n    AF_UNIRANGE_REC(  0x0953UL,  0x0963UL ),\n    /* omitting U+0964 danda, U+0965 double danda */\n    AF_UNIRANGE_REC(  0x0966UL,  0x097FUL ),\n    AF_UNIRANGE_REC(  0x20B9UL,  0x20B9UL ),  /* (new) Rupee sign */\n    AF_UNIRANGE_REC(       0UL,       0UL )\n  };\n\n  const AF_Script_UniRangeRec  af_grek_uniranges[] =\n  {\n    AF_UNIRANGE_REC(  0x0370UL,  0x03FFUL ),  /* Greek and Coptic */\n    AF_UNIRANGE_REC(  0x1F00UL,  0x1FFFUL ),  /* Greek Extended   */\n    AF_UNIRANGE_REC(       0UL,       0UL )\n  };\n\n  const AF_Script_UniRangeRec  af_hebr_uniranges[] =\n  {\n    AF_UNIRANGE_REC(  0x0590UL,  0x05FFUL ),  /* Hebrew                          */\n    AF_UNIRANGE_REC(  0xFB1DUL,  0xFB4FUL ),  /* Alphab. Present. Forms (Hebrew) */\n    AF_UNIRANGE_REC(       0UL,       0UL )\n  };\n\n  const AF_Script_UniRangeRec  af_latn_uniranges[] =\n  {\n    AF_UNIRANGE_REC(  0x0020UL,  0x007FUL ),  /* Basic Latin (no control chars)         */\n    AF_UNIRANGE_REC(  0x00A0UL,  0x00FFUL ),  /* Latin-1 Supplement (no control chars)  */\n    AF_UNIRANGE_REC(  0x0100UL,  0x017FUL ),  /* Latin Extended-A                       */\n    AF_UNIRANGE_REC(  0x0180UL,  0x024FUL ),  /* Latin Extended-B                       */\n    AF_UNIRANGE_REC(  0x0250UL,  0x02AFUL ),  /* IPA Extensions                         */\n    AF_UNIRANGE_REC(  0x02B0UL,  0x02FFUL ),  /* Spacing Modifier Letters               */\n    AF_UNIRANGE_REC(  0x0300UL,  0x036FUL ),  /* Combining Diacritical Marks            */\n    AF_UNIRANGE_REC(  0x1D00UL,  0x1D7FUL ),  /* Phonetic Extensions                    */\n    AF_UNIRANGE_REC(  0x1D80UL,  0x1DBFUL ),  /* Phonetic Extensions Supplement         */\n    AF_UNIRANGE_REC(  0x1DC0UL,  0x1DFFUL ),  /* Combining Diacritical Marks Supplement */\n    AF_UNIRANGE_REC(  0x1E00UL,  0x1EFFUL ),  /* Latin Extended Additional              */\n    AF_UNIRANGE_REC(  0x2000UL,  0x206FUL ),  /* General Punctuation                    */\n    AF_UNIRANGE_REC(  0x2070UL,  0x209FUL ),  /* Superscripts and Subscripts            */\n    AF_UNIRANGE_REC(  0x20A0UL,  0x20B8UL ),  /* Currency Symbols ...                   */\n    AF_UNIRANGE_REC(  0x20BAUL,  0x20CFUL ),  /* ... except new Rupee sign              */\n    AF_UNIRANGE_REC(  0x2150UL,  0x218FUL ),  /* Number Forms                           */\n    AF_UNIRANGE_REC(  0x2460UL,  0x24FFUL ),  /* Enclosed Alphanumerics                 */\n    AF_UNIRANGE_REC(  0x2C60UL,  0x2C7FUL ),  /* Latin Extended-C                       */\n    AF_UNIRANGE_REC(  0x2E00UL,  0x2E7FUL ),  /* Supplemental Punctuation               */\n    AF_UNIRANGE_REC(  0xA720UL,  0xA7FFUL ),  /* Latin Extended-D                       */\n    AF_UNIRANGE_REC(  0xFB00UL,  0xFB06UL ),  /* Alphab. Present. Forms (Latin Ligs)    */\n    AF_UNIRANGE_REC( 0x1D400UL, 0x1D7FFUL ),  /* Mathematical Alphanumeric Symbols      */\n    AF_UNIRANGE_REC( 0x1F100UL, 0x1F1FFUL ),  /* Enclosed Alphanumeric Supplement       */\n    AF_UNIRANGE_REC(       0UL,       0UL )\n  };\n\n  const AF_Script_UniRangeRec  af_none_uniranges[] =\n  {\n    AF_UNIRANGE_REC( 0UL, 0UL )\n  };\n\n  const AF_Script_UniRangeRec  af_telu_uniranges[] =\n  {\n    AF_UNIRANGE_REC(  0x0C00UL,  0x0C7FUL ),  /* Telugu */\n    AF_UNIRANGE_REC(       0UL,       0UL )\n  };\n\n#ifdef AF_CONFIG_OPTION_INDIC\n\n  const AF_Script_UniRangeRec  af_beng_uniranges[] =\n  {\n    AF_UNIRANGE_REC(  0x0980UL,  0x09FFUL ),  /* Bengali */\n    AF_UNIRANGE_REC(       0UL,       0UL )\n  };\n\n  const AF_Script_UniRangeRec  af_gujr_uniranges[] =\n  {\n    AF_UNIRANGE_REC(  0x0A80UL,  0x0AFFUL ),  /* Gujarati */\n    AF_UNIRANGE_REC(       0UL,       0UL )\n  };\n\n  const AF_Script_UniRangeRec  af_guru_uniranges[] =\n  {\n    AF_UNIRANGE_REC(  0x0A00UL,  0x0A7FUL ),  /* Gurmukhi */\n    AF_UNIRANGE_REC(       0UL,       0UL )\n  };\n\n  const AF_Script_UniRangeRec  af_knda_uniranges[] =\n  {\n    AF_UNIRANGE_REC(  0x0C80UL,  0x0CFFUL ),  /* Kannada */\n    AF_UNIRANGE_REC(       0UL,       0UL )\n  };\n\n  const AF_Script_UniRangeRec  af_limb_uniranges[] =\n  {\n    AF_UNIRANGE_REC(  0x1900UL,  0x194FUL ),  /* Limbu */\n    AF_UNIRANGE_REC(       0UL,       0UL )\n  };\n\n  const AF_Script_UniRangeRec  af_mlym_uniranges[] =\n  {\n    AF_UNIRANGE_REC(  0x0D00UL,  0x0D7FUL ),  /* Malayalam */\n    AF_UNIRANGE_REC(       0UL,       0UL )\n  };\n\n  const AF_Script_UniRangeRec  af_orya_uniranges[] =\n  {\n    AF_UNIRANGE_REC(  0x0B00UL,  0x0B7FUL ),  /* Oriya */\n    AF_UNIRANGE_REC(       0UL,       0UL )\n  };\n\n  const AF_Script_UniRangeRec  af_sinh_uniranges[] =\n  {\n    AF_UNIRANGE_REC(  0x0D80UL,  0x0DFFUL ),  /* Sinhala */\n    AF_UNIRANGE_REC(       0UL,       0UL )\n  };\n\n  const AF_Script_UniRangeRec  af_sund_uniranges[] =\n  {\n    AF_UNIRANGE_REC(  0x1B80UL,  0x1BBFUL ),  /* Sundanese */\n    AF_UNIRANGE_REC(       0UL,       0UL )\n  };\n\n  const AF_Script_UniRangeRec  af_sylo_uniranges[] =\n  {\n    AF_UNIRANGE_REC(  0xA800UL,  0xA82FUL ),  /* Syloti Nagri */\n    AF_UNIRANGE_REC(       0UL,       0UL )\n  };\n\n  const AF_Script_UniRangeRec  af_taml_uniranges[] =\n  {\n    AF_UNIRANGE_REC(  0x0B80UL,  0x0BFFUL ),  /* Tamil */\n    AF_UNIRANGE_REC(       0UL,       0UL )\n  };\n\n  const AF_Script_UniRangeRec  af_tibt_uniranges[] =\n  {\n    AF_UNIRANGE_REC(  0x0F00UL,  0x0FFFUL ),  /* Tibetan */\n    AF_UNIRANGE_REC(       0UL,       0UL )\n  };\n\n#endif /* !AF_CONFIG_OPTION_INDIC */\n\n#ifdef AF_CONFIG_OPTION_CJK\n\n  /* this corresponds to Unicode 6.0 */\n\n  const AF_Script_UniRangeRec  af_hani_uniranges[] =\n  {\n    AF_UNIRANGE_REC(  0x1100UL,  0x11FFUL ),  /* Hangul Jamo                             */\n    AF_UNIRANGE_REC(  0x2E80UL,  0x2EFFUL ),  /* CJK Radicals Supplement                 */\n    AF_UNIRANGE_REC(  0x2F00UL,  0x2FDFUL ),  /* Kangxi Radicals                         */\n    AF_UNIRANGE_REC(  0x2FF0UL,  0x2FFFUL ),  /* Ideographic Description Characters      */\n    AF_UNIRANGE_REC(  0x3000UL,  0x303FUL ),  /* CJK Symbols and Punctuation             */\n    AF_UNIRANGE_REC(  0x3040UL,  0x309FUL ),  /* Hiragana                                */\n    AF_UNIRANGE_REC(  0x30A0UL,  0x30FFUL ),  /* Katakana                                */\n    AF_UNIRANGE_REC(  0x3100UL,  0x312FUL ),  /* Bopomofo                                */\n    AF_UNIRANGE_REC(  0x3130UL,  0x318FUL ),  /* Hangul Compatibility Jamo               */\n    AF_UNIRANGE_REC(  0x3190UL,  0x319FUL ),  /* Kanbun                                  */\n    AF_UNIRANGE_REC(  0x31A0UL,  0x31BFUL ),  /* Bopomofo Extended                       */\n    AF_UNIRANGE_REC(  0x31C0UL,  0x31EFUL ),  /* CJK Strokes                             */\n    AF_UNIRANGE_REC(  0x31F0UL,  0x31FFUL ),  /* Katakana Phonetic Extensions            */\n    AF_UNIRANGE_REC(  0x3200UL,  0x32FFUL ),  /* Enclosed CJK Letters and Months         */\n    AF_UNIRANGE_REC(  0x3300UL,  0x33FFUL ),  /* CJK Compatibility                       */\n    AF_UNIRANGE_REC(  0x3400UL,  0x4DBFUL ),  /* CJK Unified Ideographs Extension A      */\n    AF_UNIRANGE_REC(  0x4DC0UL,  0x4DFFUL ),  /* Yijing Hexagram Symbols                 */\n    AF_UNIRANGE_REC(  0x4E00UL,  0x9FFFUL ),  /* CJK Unified Ideographs                  */\n    AF_UNIRANGE_REC(  0xA960UL,  0xA97FUL ),  /* Hangul Jamo Extended-A                  */\n    AF_UNIRANGE_REC(  0xAC00UL,  0xD7AFUL ),  /* Hangul Syllables                        */\n    AF_UNIRANGE_REC(  0xD7B0UL,  0xD7FFUL ),  /* Hangul Jamo Extended-B                  */\n    AF_UNIRANGE_REC(  0xF900UL,  0xFAFFUL ),  /* CJK Compatibility Ideographs            */\n    AF_UNIRANGE_REC(  0xFE10UL,  0xFE1FUL ),  /* Vertical forms                          */\n    AF_UNIRANGE_REC(  0xFE30UL,  0xFE4FUL ),  /* CJK Compatibility Forms                 */\n    AF_UNIRANGE_REC(  0xFF00UL,  0xFFEFUL ),  /* Halfwidth and Fullwidth Forms           */\n    AF_UNIRANGE_REC( 0x1B000UL, 0x1B0FFUL ),  /* Kana Supplement                         */\n    AF_UNIRANGE_REC( 0x1D300UL, 0x1D35FUL ),  /* Tai Xuan Hing Symbols                   */\n    AF_UNIRANGE_REC( 0x1F200UL, 0x1F2FFUL ),  /* Enclosed Ideographic Supplement         */\n    AF_UNIRANGE_REC( 0x20000UL, 0x2A6DFUL ),  /* CJK Unified Ideographs Extension B      */\n    AF_UNIRANGE_REC( 0x2A700UL, 0x2B73FUL ),  /* CJK Unified Ideographs Extension C      */\n    AF_UNIRANGE_REC( 0x2B740UL, 0x2B81FUL ),  /* CJK Unified Ideographs Extension D      */\n    AF_UNIRANGE_REC( 0x2F800UL, 0x2FA1FUL ),  /* CJK Compatibility Ideographs Supplement */\n    AF_UNIRANGE_REC(       0UL,       0UL )\n  };\n\n#endif /* !AF_CONFIG_OPTION_CJK */\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afranges.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afranges.h                                                             */\n/*                                                                         */\n/*    Auto-fitter Unicode script ranges (specification).                   */\n/*                                                                         */\n/*  Copyright 2013, 2014 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __AFRANGES_H__\n#define __AFRANGES_H__\n\n\n#include \"aftypes.h\"\n\n\nFT_BEGIN_HEADER\n\n#undef  SCRIPT\n#define SCRIPT( s, S, d, h, sc1, sc2, sc3 )                             \\\n          extern const AF_Script_UniRangeRec  af_ ## s ## _uniranges[];\n\n#include \"afscript.h\"\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __AFRANGES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afscript.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afscript.h                                                             */\n/*                                                                         */\n/*    Auto-fitter scripts (specification only).                            */\n/*                                                                         */\n/*  Copyright 2013, 2014 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /* The following part can be included multiple times. */\n  /* Define `SCRIPT' as needed.                         */\n\n\n  /* Add new scripts here.  The first and second arguments are the    */\n  /* script name in lowercase and uppercase, respectively, followed   */\n  /* by a description string.  Then comes the corresponding HarfBuzz  */\n  /* script name tag, followed by a string of standard characters (to */\n  /* derive the standard width and height of stems).                  */\n\n  SCRIPT( cyrl, CYRL,\n          \"Cyrillic\",\n          HB_SCRIPT_CYRILLIC,\n          0x43E, 0x41E, 0x0 ) /* оО */\n\n  SCRIPT( deva, DEVA,\n          \"Devanagari\",\n          HB_SCRIPT_DEVANAGARI,\n          0x920, 0x935, 0x91F ) /* ठ व ट */\n\n  SCRIPT( grek, GREK,\n          \"Greek\",\n          HB_SCRIPT_GREEK,\n          0x3BF, 0x39F, 0x0 ) /* οΟ */\n\n  SCRIPT( hebr, HEBR,\n          \"Hebrew\",\n          HB_SCRIPT_HEBREW,\n          0x5DD, 0x0, 0x0 ) /* ם */\n\n  SCRIPT( latn, LATN,\n          \"Latin\",\n          HB_SCRIPT_LATIN,\n          'o', 'O', '0' )\n\n  SCRIPT( none, NONE,\n          \"no script\",\n          HB_SCRIPT_INVALID,\n          0x0, 0x0, 0x0 )\n\n  /* there are no simple forms for letters; we thus use two digit shapes */\n  SCRIPT( telu, TELU,\n          \"Telugu\",\n          HB_SCRIPT_TELUGU,\n          0xC66, 0xC67, 0x0 ) /* ౦ ౧ */\n\n#ifdef AF_CONFIG_OPTION_INDIC\n\n  SCRIPT( beng, BENG,\n          \"Bengali\",\n          HB_SCRIPT_BENGALI,\n          'o', 0x0, 0x0 ) /* XXX */\n\n  SCRIPT( gujr, GUJR,\n          \"Gujarati\",\n          HB_SCRIPT_GUJARATI,\n          'o', 0x0, 0x0 ) /* XXX */\n\n  SCRIPT( guru, GURU,\n          \"Gurmukhi\",\n          HB_SCRIPT_GURMUKHI,\n          'o', 0x0, 0x0 ) /* XXX */\n\n  SCRIPT( knda, KNDA,\n          \"Kannada\",\n          HB_SCRIPT_KANNADA,\n          'o', 0x0, 0x0 ) /* XXX */\n\n  SCRIPT( limb, LIMB,\n          \"Limbu\",\n          HB_SCRIPT_LIMBU,\n          'o', 0x0, 0x0 ) /* XXX */\n\n  SCRIPT( mlym, MLYM,\n          \"Malayalam\",\n          HB_SCRIPT_MALAYALAM,\n          'o', 0x0, 0x0 ) /* XXX */\n\n  SCRIPT( orya, ORYA,\n          \"Oriya\",\n          HB_SCRIPT_ORIYA,\n          'o', 0x0, 0x0 ) /* XXX */\n\n  SCRIPT( sinh, SINH,\n          \"Sinhala\",\n          HB_SCRIPT_SINHALA,\n          'o', 0x0, 0x0 ) /* XXX */\n\n  SCRIPT( sund, SUND,\n          \"Sundanese\",\n          HB_SCRIPT_SUNDANESE,\n          'o', 0x0, 0x0 ) /* XXX */\n\n  SCRIPT( sylo, SYLO,\n          \"Syloti Nagri\",\n          HB_SCRIPT_SYLOTI_NAGRI,\n          'o', 0x0, 0x0 ) /* XXX */\n\n  SCRIPT( taml, TAML,\n          \"Tamil\",\n          HB_SCRIPT_TAMIL,\n          'o', 0x0, 0x0 ) /* XXX */\n\n  SCRIPT( tibt, TIBT,\n          \"Tibetan\",\n          HB_SCRIPT_TIBETAN,\n          'o', 0x0, 0x0 ) /* XXX */\n\n#endif /* AF_CONFIG_OPTION_INDIC */\n\n#ifdef AF_CONFIG_OPTION_CJK\n\n  SCRIPT( hani, HANI,\n          \"CJKV ideographs\",\n          HB_SCRIPT_HAN,\n          0x7530, 0x56D7, 0x0 ) /* 田囗 */\n\n#endif /* AF_CONFIG_OPTION_CJK */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afstyles.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afstyles.h                                                             */\n/*                                                                         */\n/*    Auto-fitter styles (specification only).                             */\n/*                                                                         */\n/*  Copyright 2013, 2014 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /* The following part can be included multiple times. */\n  /* Define `STYLE' as needed.                          */\n\n\n  /* Add new styles here.  The first and second arguments are the  */\n  /* style name in lowercase and uppercase, respectively, followed */\n  /* by a description string.  The next arguments are the          */\n  /* corresponding writing system, script, blue stringset, and     */\n  /* coverage.                                                     */\n  /*                                                               */\n  /* Note that styles using `AF_COVERAGE_DEFAULT' should always    */\n  /* come after styles with other coverages.                       */\n  /*                                                               */\n  /* Example:                                                      */\n  /*                                                               */\n  /*   STYLE( cyrl_dflt, CYRL_DFLT,                                */\n  /*          \"Cyrillic default style\",                            */\n  /*          AF_WRITING_SYSTEM_LATIN,                             */\n  /*          AF_SCRIPT_CYRL,                                      */\n  /*          AF_BLUE_STRINGSET_CYRL,                              */\n  /*          AF_COVERAGE_DEFAULT )                                */\n\n#undef  STYLE_LATIN\n#define STYLE_LATIN( s, S, f, F, ds, df, C ) \\\n          STYLE( s ## _ ## f, S ## _ ## F,   \\\n                 ds \" \" df \" style\",         \\\n                 AF_WRITING_SYSTEM_LATIN,    \\\n                 AF_SCRIPT_ ## S,            \\\n                 AF_BLUE_STRINGSET_ ## S,    \\\n                 AF_COVERAGE_ ## C )\n\n#undef  META_STYLE_LATIN\n#define META_STYLE_LATIN( s, S, ds )                     \\\n          STYLE_LATIN( s, S, c2cp, C2CP, ds,             \\\n                       \"petite capticals from capitals\", \\\n                       PETITE_CAPITALS_FROM_CAPITALS )   \\\n          STYLE_LATIN( s, S, c2sc, C2SC, ds,             \\\n                       \"small capticals from capitals\",  \\\n                       SMALL_CAPITALS_FROM_CAPITALS )    \\\n          STYLE_LATIN( s, S, ordn, ORDN, ds,             \\\n                       \"ordinals\",                       \\\n                       ORDINALS )                        \\\n          STYLE_LATIN( s, S, pcap, PCAP, ds,             \\\n                       \"petite capitals\",                \\\n                       PETITE_CAPITALS )                 \\\n          STYLE_LATIN( s, S, sinf, SINF, ds,             \\\n                       \"scientific inferiors\",           \\\n                       SCIENTIFIC_INFERIORS )            \\\n          STYLE_LATIN( s, S, smcp, SMCP, ds,             \\\n                       \"small capitals\",                 \\\n                       SMALL_CAPITALS )                  \\\n          STYLE_LATIN( s, S, subs, SUBS, ds,             \\\n                       \"subscript\",                      \\\n                       SUBSCRIPT )                       \\\n          STYLE_LATIN( s, S, sups, SUPS, ds,             \\\n                       \"superscript\",                    \\\n                       SUPERSCRIPT )                     \\\n          STYLE_LATIN( s, S, titl, TITL, ds,             \\\n                       \"titling\",                        \\\n                       TITLING )                         \\\n          STYLE_LATIN( s, S, dflt, DFLT, ds,             \\\n                       \"default\",                        \\\n                       DEFAULT )\n\n  META_STYLE_LATIN( cyrl, CYRL, \"Cyrillic\" )\n\n  META_STYLE_LATIN( grek, GREK, \"Greek\" )\n\n  STYLE( hebr_dflt, HEBR_DFLT,\n         \"Hebrew default style\",\n         AF_WRITING_SYSTEM_LATIN,\n         AF_SCRIPT_HEBR,\n         AF_BLUE_STRINGSET_HEBR,\n         AF_COVERAGE_DEFAULT )\n  META_STYLE_LATIN( latn, LATN, \"Latin\" )\n\n  STYLE( deva_dflt, DEVA_DFLT,\n         \"Devanagari default style\",\n         AF_WRITING_SYSTEM_LATIN,\n         AF_SCRIPT_DEVA,\n         AF_BLUE_STRINGSET_DEVA,\n         AF_COVERAGE_DEFAULT )\n\n#ifdef FT_OPTION_AUTOFIT2\n  STYLE( ltn2_dflt, LTN2_DFLT,\n         \"Latin 2 default style\",\n         AF_WRITING_SYSTEM_LATIN2,\n         AF_SCRIPT_LATN,\n         AF_BLUE_STRINGSET_LATN,\n         AF_COVERAGE_DEFAULT )\n#endif\n\n  STYLE( none_dflt, NONE_DFLT,\n         \"no style\",\n         AF_WRITING_SYSTEM_DUMMY,\n         AF_SCRIPT_NONE,\n         (AF_Blue_Stringset)0,\n         AF_COVERAGE_DEFAULT )\n\n  STYLE( telu_dflt, TELU_DFLT,\n         \"Telugu default style\",\n         AF_WRITING_SYSTEM_LATIN,\n         AF_SCRIPT_TELU,\n         AF_BLUE_STRINGSET_TELU,\n         AF_COVERAGE_DEFAULT )\n\n#ifdef AF_CONFIG_OPTION_INDIC\n\n  /* no blue stringset support for the Indic writing system yet */\n#undef  STYLE_DEFAULT_INDIC\n#define STYLE_DEFAULT_INDIC( s, S, d )    \\\n          STYLE( s ## _dflt, S ## _DFLT,  \\\n                 d \" default style\",      \\\n                 AF_WRITING_SYSTEM_INDIC, \\\n                 AF_SCRIPT_ ## S,         \\\n                 (AF_Blue_Stringset)0,    \\\n                 AF_COVERAGE_DEFAULT )\n\n  STYLE_DEFAULT_INDIC( beng, BENG, \"Bengali\" )\n  STYLE_DEFAULT_INDIC( gujr, GUJR, \"Gujarati\" )\n  STYLE_DEFAULT_INDIC( guru, GURU, \"Gurmukhi\" )\n  STYLE_DEFAULT_INDIC( knda, KNDA, \"Kannada\" )\n  STYLE_DEFAULT_INDIC( limb, LIMB, \"Limbu\" )\n  STYLE_DEFAULT_INDIC( mlym, MLYM, \"Malayalam\" )\n  STYLE_DEFAULT_INDIC( orya, ORYA, \"Oriya\" )\n  STYLE_DEFAULT_INDIC( sinh, SINH, \"Sinhala\" )\n  STYLE_DEFAULT_INDIC( sund, SUND, \"Sundanese\" )\n  STYLE_DEFAULT_INDIC( sylo, SYLO, \"Syloti Nagri\" )\n  STYLE_DEFAULT_INDIC( taml, TAML, \"Tamil\" )\n  STYLE_DEFAULT_INDIC( tibt, TIBT, \"Tibetan\" )\n\n#endif /* AF_CONFIG_OPTION_INDIC */\n\n#ifdef AF_CONFIG_OPTION_CJK\n\n  STYLE( hani_dflt, HANI_DFLT,\n         \"CJKV ideographs default style\",\n         AF_WRITING_SYSTEM_CJK,\n         AF_SCRIPT_HANI,\n         AF_BLUE_STRINGSET_HANI,\n         AF_COVERAGE_DEFAULT )\n\n#endif /* AF_CONFIG_OPTION_CJK */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/aftypes.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  aftypes.h                                                              */\n/*                                                                         */\n/*    Auto-fitter types (specification only).                              */\n/*                                                                         */\n/*  Copyright 2003-2009, 2011-2014 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************\n   *\n   *  The auto-fitter is a complete rewrite of the old auto-hinter.\n   *  Its main feature is the ability to differentiate between different\n   *  writing systems and scripts in order to apply specific rules.\n   *\n   *  The code has also been compartmentized into several entities that\n   *  should make algorithmic experimentation easier than with the old\n   *  code.\n   *\n   *************************************************************************/\n\n\n#ifndef __AFTYPES_H__\n#define __AFTYPES_H__\n\n#include <ft2build.h>\n\n#include FT_FREETYPE_H\n#include FT_OUTLINE_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_DEBUG_H\n\n#include \"afblue.h\"\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    D E B U G G I N G                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#ifdef FT_DEBUG_AUTOFIT\n\n#include FT_CONFIG_STANDARD_LIBRARY_H\n\nextern int    _af_debug_disable_horz_hints;\nextern int    _af_debug_disable_vert_hints;\nextern int    _af_debug_disable_blue_hints;\nextern void*  _af_debug_hints;\n\n#endif /* FT_DEBUG_AUTOFIT */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                 U T I L I T Y   S T U F F                     *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct  AF_WidthRec_\n  {\n    FT_Pos  org;  /* original position/width in font units              */\n    FT_Pos  cur;  /* current/scaled position/width in device sub-pixels */\n    FT_Pos  fit;  /* current/fitted position/width in device sub-pixels */\n\n  } AF_WidthRec, *AF_Width;\n\n\n  FT_LOCAL( void )\n  af_sort_pos( FT_UInt  count,\n               FT_Pos*  table );\n\n  FT_LOCAL( void )\n  af_sort_and_quantize_widths( FT_UInt*  count,\n                               AF_Width  widths,\n                               FT_Pos    threshold );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                   A N G L E   T Y P E S                       *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*\n   *  The auto-fitter doesn't need a very high angular accuracy;\n   *  this allows us to speed up some computations considerably with a\n   *  light Cordic algorithm (see afangles.c).\n   */\n\n  typedef FT_Int  AF_Angle;\n\n\n#define AF_ANGLE_PI   256\n#define AF_ANGLE_2PI  ( AF_ANGLE_PI * 2 )\n#define AF_ANGLE_PI2  ( AF_ANGLE_PI / 2 )\n#define AF_ANGLE_PI4  ( AF_ANGLE_PI / 4 )\n\n\n#if 0\n  /*\n   *  compute the angle of a given 2-D vector\n   */\n  FT_LOCAL( AF_Angle )\n  af_angle_atan( FT_Pos  dx,\n                 FT_Pos  dy );\n\n\n  /*\n   *  compute `angle2 - angle1'; the result is always within\n   *  the range [-AF_ANGLE_PI .. AF_ANGLE_PI - 1]\n   */\n  FT_LOCAL( AF_Angle )\n  af_angle_diff( AF_Angle  angle1,\n                 AF_Angle  angle2 );\n#endif /* 0 */\n\n\n#define AF_ANGLE_DIFF( result, angle1, angle2 ) \\\n  FT_BEGIN_STMNT                                \\\n    AF_Angle  _delta = (angle2) - (angle1);     \\\n                                                \\\n                                                \\\n    _delta %= AF_ANGLE_2PI;                     \\\n    if ( _delta < 0 )                           \\\n      _delta += AF_ANGLE_2PI;                   \\\n                                                \\\n    if ( _delta > AF_ANGLE_PI )                 \\\n      _delta -= AF_ANGLE_2PI;                   \\\n                                                \\\n    result = _delta;                            \\\n  FT_END_STMNT\n\n\n  /*  opaque handle to glyph-specific hints -- see `afhints.h' for more\n   *  details\n   */\n  typedef struct AF_GlyphHintsRec_*  AF_GlyphHints;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       S C A L E R S                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*\n   *  A scaler models the target pixel device that will receive the\n   *  auto-hinted glyph image.\n   */\n\n  typedef enum  AF_ScalerFlags_\n  {\n    AF_SCALER_FLAG_NO_HORIZONTAL = 1,  /* disable horizontal hinting */\n    AF_SCALER_FLAG_NO_VERTICAL   = 2,  /* disable vertical hinting   */\n    AF_SCALER_FLAG_NO_ADVANCE    = 4   /* disable advance hinting    */\n\n  } AF_ScalerFlags;\n\n\n  typedef struct  AF_ScalerRec_\n  {\n    FT_Face         face;        /* source font face                        */\n    FT_Fixed        x_scale;     /* from font units to 1/64th device pixels */\n    FT_Fixed        y_scale;     /* from font units to 1/64th device pixels */\n    FT_Pos          x_delta;     /* in 1/64th device pixels                 */\n    FT_Pos          y_delta;     /* in 1/64th device pixels                 */\n    FT_Render_Mode  render_mode; /* monochrome, anti-aliased, LCD, etc.     */\n    FT_UInt32       flags;       /* additional control flags, see above     */\n\n  } AF_ScalerRec, *AF_Scaler;\n\n\n#define AF_SCALER_EQUAL_SCALES( a, b )      \\\n          ( (a)->x_scale == (b)->x_scale && \\\n            (a)->y_scale == (b)->y_scale && \\\n            (a)->x_delta == (b)->x_delta && \\\n            (a)->y_delta == (b)->y_delta )\n\n\n  typedef struct AF_StyleMetricsRec_*  AF_StyleMetrics;\n\n  /*  This function parses an FT_Face to compute global metrics for\n   *  a specific style.\n   */\n  typedef FT_Error\n  (*AF_WritingSystem_InitMetricsFunc)( AF_StyleMetrics  metrics,\n                                       FT_Face          face );\n\n  typedef void\n  (*AF_WritingSystem_ScaleMetricsFunc)( AF_StyleMetrics  metrics,\n                                        AF_Scaler        scaler );\n\n  typedef void\n  (*AF_WritingSystem_DoneMetricsFunc)( AF_StyleMetrics  metrics );\n\n\n  typedef FT_Error\n  (*AF_WritingSystem_InitHintsFunc)( AF_GlyphHints    hints,\n                                     AF_StyleMetrics  metrics );\n\n  typedef void\n  (*AF_WritingSystem_ApplyHintsFunc)( AF_GlyphHints    hints,\n                                      FT_Outline*      outline,\n                                      AF_StyleMetrics  metrics );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                W R I T I N G   S Y S T E M S                  *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*\n   *  For the auto-hinter, a writing system consists of multiple scripts that\n   *  can be handled similarly *in a typographical way*; the relationship is\n   *  not based on history.  For example, both the Greek and the unrelated\n   *  Armenian scripts share the same features like ascender, descender,\n   *  x-height, etc.  Essentially, a writing system is covered by a\n   *  submodule of the auto-fitter; it contains\n   *\n   *  - a specific global analyzer that computes global metrics specific to\n   *    the script (based on script-specific characters to identify ascender\n   *    height, x-height, etc.),\n   *\n   *  - a specific glyph analyzer that computes segments and edges for each\n   *    glyph covered by the script,\n   *\n   *  - a specific grid-fitting algorithm that distorts the scaled glyph\n   *    outline according to the results of the glyph analyzer.\n   */\n\n#define __AFWRTSYS_H__  /* don't load header files */\n#undef  WRITING_SYSTEM\n#define WRITING_SYSTEM( ws, WS )    \\\n          AF_WRITING_SYSTEM_ ## WS,\n\n  /* The list of known writing systems. */\n  typedef enum  AF_WritingSystem_\n  {\n\n#include \"afwrtsys.h\"\n\n    AF_WRITING_SYSTEM_MAX   /* do not remove */\n\n  } AF_WritingSystem;\n\n#undef  __AFWRTSYS_H__\n\n\n  typedef struct  AF_WritingSystemClassRec_\n  {\n    AF_WritingSystem  writing_system;\n\n    FT_Offset                          style_metrics_size;\n    AF_WritingSystem_InitMetricsFunc   style_metrics_init;\n    AF_WritingSystem_ScaleMetricsFunc  style_metrics_scale;\n    AF_WritingSystem_DoneMetricsFunc   style_metrics_done;\n\n    AF_WritingSystem_InitHintsFunc     style_hints_init;\n    AF_WritingSystem_ApplyHintsFunc    style_hints_apply;\n\n  } AF_WritingSystemClassRec;\n\n  typedef const AF_WritingSystemClassRec*  AF_WritingSystemClass;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                        S C R I P T S                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*\n   *  Each script is associated with a set of Unicode ranges that gets used\n   *  to test whether the font face supports the script.\n   *\n   *  We use four-letter script tags from the OpenType specification,\n   *  extended by `NONE', which indicates `no script'.\n   */\n\n#undef  SCRIPT\n#define SCRIPT( s, S, d, h, sc1, sc2, sc3 ) \\\n          AF_SCRIPT_ ## S,\n\n  /* The list of known scripts. */\n  typedef enum  AF_Script_\n  {\n\n#include \"afscript.h\"\n\n    AF_SCRIPT_MAX   /* do not remove */\n\n  } AF_Script;\n\n\n  typedef struct  AF_Script_UniRangeRec_\n  {\n    FT_UInt32  first;\n    FT_UInt32  last;\n\n  } AF_Script_UniRangeRec;\n\n#define AF_UNIRANGE_REC( a, b ) { (FT_UInt32)(a), (FT_UInt32)(b) }\n\n  typedef const AF_Script_UniRangeRec*  AF_Script_UniRange;\n\n\n  typedef struct  AF_ScriptClassRec_\n  {\n    AF_Script  script;\n\n    AF_Script_UniRange  script_uni_ranges; /* last must be { 0, 0 }        */\n\n    FT_UInt32  standard_char1;             /* for default width and height */\n    FT_UInt32  standard_char2;             /* ditto                        */\n    FT_UInt32  standard_char3;             /* ditto                        */\n\n  } AF_ScriptClassRec;\n\n  typedef const AF_ScriptClassRec*  AF_ScriptClass;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      C O V E R A G E S                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*\n   *  Usually, a font contains more glyphs than can be addressed by its\n   *  character map.\n   *\n   *  In the PostScript font world, encoding vectors specific to a given\n   *  task are used to select such glyphs, and these glyphs can be often\n   *  recognized by having a suffix in its glyph names.  For example, a\n   *  superscript glyph `A' might be called `A.sup'.  Unfortunately, this\n   *  naming scheme is not standardized and thus unusable for us.\n   *\n   *  In the OpenType world, a better solution was invented, namely\n   *  `features', which cleanly separate a character's input encoding from\n   *  the corresponding glyph's appearance, and which don't use glyph names\n   *  at all.  For our purposes, and slightly generalized, an OpenType\n   *  feature is a name of a mapping that maps character codes to\n   *  non-standard glyph indices (features get used for other things also).\n   *  For example, the `sups' feature provides superscript glyphs, thus\n   *  mapping character codes like `A' or `B' to superscript glyph\n   *  representation forms.  How this mapping happens is completely\n   *  uninteresting to us.\n   *\n   *  For the auto-hinter, a `coverage' represents all glyphs of an OpenType\n   *  feature collected in a set (as listed below) that can be hinted\n   *  together.  To continue the above example, superscript glyphs must not\n   *  be hinted together with normal glyphs because the blue zones\n   *  completely differ.\n   *\n   *  Note that FreeType itself doesn't compute coverages; it only provides\n   *  the glyphs addressable by the default Unicode character map.  Instead,\n   *  we use the HarfBuzz library (if available), which has many functions\n   *  exactly for this purpose.\n   *\n   *  AF_COVERAGE_DEFAULT is special: It should cover everything that isn't\n   *  listed separately (including the glyphs addressable by the character\n   *  map).  In case HarfBuzz isn't available, it exactly covers the glyphs\n   *  addressable by the character map.\n   *\n   */\n\n#undef  COVERAGE\n#define COVERAGE( name, NAME, description, \\\n                  tag1, tag2, tag3, tag4 ) \\\n          AF_COVERAGE_ ## NAME,\n\n\n  typedef enum  AF_Coverage_\n  {\n#include \"afcover.h\"\n\n    AF_COVERAGE_DEFAULT\n\n  } AF_Coverage;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         S T Y L E S                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*\n   *  The topmost structure for modelling the auto-hinter glyph input data\n   *  is a `style class', grouping everything together.\n   */\n\n#undef  STYLE\n#define STYLE( s, S, d, ws, sc, ss, c ) \\\n          AF_STYLE_ ## S,\n\n  /* The list of known styles. */\n  typedef enum  AF_Style_\n  {\n\n#include \"afstyles.h\"\n\n    AF_STYLE_MAX   /* do not remove */\n\n  } AF_Style;\n\n\n  typedef struct  AF_StyleClassRec_\n  {\n    AF_Style  style;\n\n    AF_WritingSystem   writing_system;\n    AF_Script          script;\n    AF_Blue_Stringset  blue_stringset;\n    AF_Coverage        coverage;\n\n  } AF_StyleClassRec;\n\n  typedef const AF_StyleClassRec*  AF_StyleClass;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                   S T Y L E   M E T R I C S                   *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct AF_FaceGlobalsRec_*  AF_FaceGlobals;\n\n  /* This is the main structure that combines everything.  Autofit modules */\n  /* specific to writing systems derive their structures from it, for      */\n  /* example `AF_LatinMetrics'.                                            */\n\n  typedef struct  AF_StyleMetricsRec_\n  {\n    AF_StyleClass   style_class;\n    AF_ScalerRec    scaler;\n    FT_Bool         digits_have_same_width;\n\n    AF_FaceGlobals  globals;    /* to access properties */\n\n  } AF_StyleMetricsRec;\n\n\n  /* Declare and define vtables for classes */\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define AF_DECLARE_WRITING_SYSTEM_CLASS( writing_system_class ) \\\n  FT_CALLBACK_TABLE const AF_WritingSystemClassRec              \\\n  writing_system_class;\n\n#define AF_DEFINE_WRITING_SYSTEM_CLASS(                  \\\n          writing_system_class,                          \\\n          system,                                        \\\n          m_size,                                        \\\n          m_init,                                        \\\n          m_scale,                                       \\\n          m_done,                                        \\\n          h_init,                                        \\\n          h_apply )                                      \\\n  FT_CALLBACK_TABLE_DEF                                  \\\n  const AF_WritingSystemClassRec  writing_system_class = \\\n  {                                                      \\\n    system,                                              \\\n                                                         \\\n    m_size,                                              \\\n                                                         \\\n    m_init,                                              \\\n    m_scale,                                             \\\n    m_done,                                              \\\n                                                         \\\n    h_init,                                              \\\n    h_apply                                              \\\n  };\n\n\n#define AF_DECLARE_SCRIPT_CLASS( script_class ) \\\n  FT_CALLBACK_TABLE const AF_ScriptClassRec     \\\n  script_class;\n\n#define AF_DEFINE_SCRIPT_CLASS(           \\\n          script_class,                   \\\n          script,                         \\\n          ranges,                         \\\n          std_char1,                      \\\n          std_char2,                      \\\n          std_char3 )                     \\\n  FT_CALLBACK_TABLE_DEF                   \\\n  const AF_ScriptClassRec  script_class = \\\n  {                                       \\\n    script,                               \\\n    ranges,                               \\\n    std_char1,                            \\\n    std_char2,                            \\\n    std_char3                             \\\n  };\n\n\n#define AF_DECLARE_STYLE_CLASS( style_class ) \\\n  FT_CALLBACK_TABLE const AF_StyleClassRec    \\\n  style_class;\n\n#define AF_DEFINE_STYLE_CLASS(          \\\n          style_class,                  \\\n          style,                        \\\n          writing_system,               \\\n          script,                       \\\n          blue_stringset,               \\\n          coverage )                    \\\n  FT_CALLBACK_TABLE_DEF                 \\\n  const AF_StyleClassRec  style_class = \\\n  {                                     \\\n    style,                              \\\n    writing_system,                     \\\n    script,                             \\\n    blue_stringset,                     \\\n    coverage                            \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define AF_DECLARE_WRITING_SYSTEM_CLASS( writing_system_class )            \\\n  FT_LOCAL( void )                                                         \\\n  FT_Init_Class_ ## writing_system_class( AF_WritingSystemClassRec*  ac );\n\n#define AF_DEFINE_WRITING_SYSTEM_CLASS(                                   \\\n          writing_system_class,                                           \\\n          system,                                                         \\\n          m_size,                                                         \\\n          m_init,                                                         \\\n          m_scale,                                                        \\\n          m_done,                                                         \\\n          h_init,                                                         \\\n          h_apply )                                                       \\\n  FT_LOCAL_DEF( void )                                                    \\\n  FT_Init_Class_ ## writing_system_class( AF_WritingSystemClassRec*  ac ) \\\n  {                                                                       \\\n    ac->writing_system      = system;                                     \\\n                                                                          \\\n    ac->style_metrics_size  = m_size;                                     \\\n                                                                          \\\n    ac->style_metrics_init  = m_init;                                     \\\n    ac->style_metrics_scale = m_scale;                                    \\\n    ac->style_metrics_done  = m_done;                                     \\\n                                                                          \\\n    ac->style_hints_init    = h_init;                                     \\\n    ac->style_hints_apply   = h_apply;                                    \\\n  }\n\n\n#define AF_DECLARE_SCRIPT_CLASS( script_class )             \\\n  FT_LOCAL( void )                                          \\\n  FT_Init_Class_ ## script_class( AF_ScriptClassRec*  ac );\n\n#define AF_DEFINE_SCRIPT_CLASS(                            \\\n          script_class,                                    \\\n          script_,                                         \\\n          ranges,                                          \\\n          std_char1,                                       \\\n          std_char2,                                       \\\n          std_char3 )                                      \\\n  FT_LOCAL_DEF( void )                                     \\\n  FT_Init_Class_ ## script_class( AF_ScriptClassRec*  ac ) \\\n  {                                                        \\\n    ac->script            = script_;                       \\\n    ac->script_uni_ranges = ranges;                        \\\n    ac->standard_char1    = std_char1;                     \\\n    ac->standard_char2    = std_char2;                     \\\n    ac->standard_char3    = std_char3;                     \\\n  }\n\n\n#define AF_DECLARE_STYLE_CLASS( style_class )             \\\n  FT_LOCAL( void )                                        \\\n  FT_Init_Class_ ## style_class( AF_StyleClassRec*  ac );\n\n#define AF_DEFINE_STYLE_CLASS(                           \\\n          style_class,                                   \\\n          style_,                                        \\\n          writing_system_,                               \\\n          script_,                                       \\\n          blue_stringset_,                               \\\n          coverage_ )                                    \\\n  FT_LOCAL_DEF( void )                                   \\\n  FT_Init_Class_ ## style_class( AF_StyleClassRec*  ac ) \\\n  {                                                      \\\n    ac->style          = style_;                         \\\n    ac->writing_system = writing_system_;                \\\n    ac->script         = script_;                        \\\n    ac->blue_stringset = blue_stringset_;                \\\n    ac->coverage       = coverage_;                      \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n/* */\n\nFT_END_HEADER\n\n#endif /* __AFTYPES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afwarp.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afwarp.c                                                               */\n/*                                                                         */\n/*    Auto-fitter warping algorithm (body).                                */\n/*                                                                         */\n/*  Copyright 2006, 2007, 2011 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*\n   *  The idea of the warping code is to slightly scale and shift a glyph\n   *  within a single dimension so that as much of its segments are aligned\n   *  (more or less) on the grid.  To find out the optimal scaling and\n   *  shifting value, various parameter combinations are tried and scored.\n   */\n\n#include \"afwarp.h\"\n\n#ifdef AF_CONFIG_OPTION_USE_WARPER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_afwarp\n\n\n  /* The weights cover the range 0/64 - 63/64 of a pixel.  Obviously, */\n  /* values around a half pixel (which means exactly between two grid */\n  /* lines) gets the worst weight.                                    */\n#if 1\n  static const AF_WarpScore\n  af_warper_weights[64] =\n  {\n    35, 32, 30, 25, 20, 15, 12, 10,  5,  1,  0,  0,  0,  0,  0,  0,\n     0,  0,  0,  0,  0,  0, -1, -2, -5, -8,-10,-10,-20,-20,-30,-30,\n\n   -30,-30,-20,-20,-10,-10, -8, -5, -2, -1,  0,  0,  0,  0,  0,  0,\n     0,  0,  0,  0,  0,  0,  0,  1,  5, 10, 12, 15, 20, 25, 30, 32,\n  };\n#else\n  static const AF_WarpScore\n  af_warper_weights[64] =\n  {\n    30, 20, 10,  5,  4,  4,  3,  2,  1,  0,  0,  0,  0,  0,  0,  0,\n     0,  0,  0,  0,  0,  0,  0, -1, -2, -2, -5, -5,-10,-10,-15,-20,\n\n   -20,-15,-15,-10,-10, -5, -5, -2, -2, -1,  0,  0,  0,  0,  0,  0,\n     0,  0,  0,  0,  0,  0,  0,  0,  1,  2,  3,  4,  4,  5, 10, 20,\n  };\n#endif\n\n\n  /* Score segments for a given `scale' and `delta' in the range */\n  /* `xx1' to `xx2', and store the best result in `warper'.  If  */\n  /* the new best score is equal to the old one, prefer the      */\n  /* value with a smaller distortion (around `base_distort').    */\n\n  static void\n  af_warper_compute_line_best( AF_Warper     warper,\n                               FT_Fixed      scale,\n                               FT_Pos        delta,\n                               FT_Pos        xx1,\n                               FT_Pos        xx2,\n                               AF_WarpScore  base_distort,\n                               AF_Segment    segments,\n                               FT_UInt       num_segments )\n  {\n    FT_Int        idx_min, idx_max, idx0;\n    FT_UInt       nn;\n    AF_WarpScore  scores[65];\n\n\n    for ( nn = 0; nn < 65; nn++ )\n      scores[nn] = 0;\n\n    idx0 = xx1 - warper->t1;\n\n    /* compute minimum and maximum indices */\n    {\n      FT_Pos  xx1min = warper->x1min;\n      FT_Pos  xx1max = warper->x1max;\n      FT_Pos  w      = xx2 - xx1;\n\n\n      if ( xx1min + w < warper->x2min )\n        xx1min = warper->x2min - w;\n\n      xx1max = warper->x1max;\n      if ( xx1max + w > warper->x2max )\n        xx1max = warper->x2max - w;\n\n      idx_min = xx1min - warper->t1;\n      idx_max = xx1max - warper->t1;\n\n      if ( idx_min < 0 || idx_min > idx_max || idx_max > 64 )\n      {\n        FT_TRACE5(( \"invalid indices:\\n\"\n                    \"  min=%d max=%d, xx1=%ld xx2=%ld,\\n\"\n                    \"  x1min=%ld x1max=%ld, x2min=%ld x2max=%ld\\n\",\n                    idx_min, idx_max, xx1, xx2,\n                    warper->x1min, warper->x1max,\n                    warper->x2min, warper->x2max ));\n        return;\n      }\n    }\n\n    for ( nn = 0; nn < num_segments; nn++ )\n    {\n      FT_Pos  len = segments[nn].max_coord - segments[nn].min_coord;\n      FT_Pos  y0  = FT_MulFix( segments[nn].pos, scale ) + delta;\n      FT_Pos  y   = y0 + ( idx_min - idx0 );\n      FT_Int  idx;\n\n\n      /* score the length of the segments for the given range */\n      for ( idx = idx_min; idx <= idx_max; idx++, y++ )\n        scores[idx] += af_warper_weights[y & 63] * len;\n    }\n\n    /* find best score */\n    {\n      FT_Int  idx;\n\n\n      for ( idx = idx_min; idx <= idx_max; idx++ )\n      {\n        AF_WarpScore  score = scores[idx];\n        AF_WarpScore  distort = base_distort + ( idx - idx0 );\n\n\n        if ( score > warper->best_score         ||\n             ( score == warper->best_score    &&\n               distort < warper->best_distort ) )\n        {\n          warper->best_score   = score;\n          warper->best_distort = distort;\n          warper->best_scale   = scale;\n          warper->best_delta   = delta + ( idx - idx0 );\n        }\n      }\n    }\n  }\n\n\n  /* Compute optimal scaling and delta values for a given glyph and */\n  /* dimension.                                                     */\n\n  FT_LOCAL_DEF( void )\n  af_warper_compute( AF_Warper      warper,\n                     AF_GlyphHints  hints,\n                     AF_Dimension   dim,\n                     FT_Fixed      *a_scale,\n                     FT_Pos        *a_delta )\n  {\n    AF_AxisHints  axis;\n    AF_Point      points;\n\n    FT_Fixed      org_scale;\n    FT_Pos        org_delta;\n\n    FT_UInt       nn, num_points, num_segments;\n    FT_Int        X1, X2;\n    FT_Int        w;\n\n    AF_WarpScore  base_distort;\n    AF_Segment    segments;\n\n\n    /* get original scaling transformation */\n    if ( dim == AF_DIMENSION_VERT )\n    {\n      org_scale = hints->y_scale;\n      org_delta = hints->y_delta;\n    }\n    else\n    {\n      org_scale = hints->x_scale;\n      org_delta = hints->x_delta;\n    }\n\n    warper->best_scale   = org_scale;\n    warper->best_delta   = org_delta;\n    warper->best_score   = INT_MIN;\n    warper->best_distort = 0;\n\n    axis         = &hints->axis[dim];\n    segments     = axis->segments;\n    num_segments = axis->num_segments;\n    points       = hints->points;\n    num_points   = hints->num_points;\n\n    *a_scale = org_scale;\n    *a_delta = org_delta;\n\n    /* get X1 and X2, minimum and maximum in original coordinates */\n    if ( num_segments < 1 )\n      return;\n\n#if 1\n    X1 = X2 = points[0].fx;\n    for ( nn = 1; nn < num_points; nn++ )\n    {\n      FT_Int  X = points[nn].fx;\n\n\n      if ( X < X1 )\n        X1 = X;\n      if ( X > X2 )\n        X2 = X;\n    }\n#else\n    X1 = X2 = segments[0].pos;\n    for ( nn = 1; nn < num_segments; nn++ )\n    {\n      FT_Int  X = segments[nn].pos;\n\n\n      if ( X < X1 )\n        X1 = X;\n      if ( X > X2 )\n        X2 = X;\n    }\n#endif\n\n    if ( X1 >= X2 )\n      return;\n\n    warper->x1 = FT_MulFix( X1, org_scale ) + org_delta;\n    warper->x2 = FT_MulFix( X2, org_scale ) + org_delta;\n\n    warper->t1 = AF_WARPER_FLOOR( warper->x1 );\n    warper->t2 = AF_WARPER_CEIL( warper->x2 );\n\n    /* examine a half pixel wide range around the maximum coordinates */\n    warper->x1min = warper->x1 & ~31;\n    warper->x1max = warper->x1min + 32;\n    warper->x2min = warper->x2 & ~31;\n    warper->x2max = warper->x2min + 32;\n\n    if ( warper->x1max > warper->x2 )\n      warper->x1max = warper->x2;\n\n    if ( warper->x2min < warper->x1 )\n      warper->x2min = warper->x1;\n\n    warper->w0 = warper->x2 - warper->x1;\n\n    if ( warper->w0 <= 64 )\n    {\n      warper->x1max = warper->x1;\n      warper->x2min = warper->x2;\n    }\n\n    /* examine (at most) a pixel wide range around the natural width */\n    warper->wmin = warper->x2min - warper->x1max;\n    warper->wmax = warper->x2max - warper->x1min;\n\n#if 1\n    /* some heuristics to reduce the number of widths to be examined */\n    {\n      int  margin = 16;\n\n\n      if ( warper->w0 <= 128 )\n      {\n         margin = 8;\n         if ( warper->w0 <= 96 )\n           margin = 4;\n      }\n\n      if ( warper->wmin < warper->w0 - margin )\n        warper->wmin = warper->w0 - margin;\n\n      if ( warper->wmax > warper->w0 + margin )\n        warper->wmax = warper->w0 + margin;\n    }\n\n    if ( warper->wmin < warper->w0 * 3 / 4 )\n      warper->wmin = warper->w0 * 3 / 4;\n\n    if ( warper->wmax > warper->w0 * 5 / 4 )\n      warper->wmax = warper->w0 * 5 / 4;\n#else\n    /* no scaling, just translation */\n    warper->wmin = warper->wmax = warper->w0;\n#endif\n\n    for ( w = warper->wmin; w <= warper->wmax; w++ )\n    {\n      FT_Fixed  new_scale;\n      FT_Pos    new_delta;\n      FT_Pos    xx1, xx2;\n\n\n      /* compute min and max positions for given width,       */\n      /* assuring that they stay within the coordinate ranges */\n      xx1 = warper->x1;\n      xx2 = warper->x2;\n      if ( w >= warper->w0 )\n      {\n        xx1 -= w - warper->w0;\n        if ( xx1 < warper->x1min )\n        {\n          xx2 += warper->x1min - xx1;\n          xx1  = warper->x1min;\n        }\n      }\n      else\n      {\n        xx1 -= w - warper->w0;\n        if ( xx1 > warper->x1max )\n        {\n          xx2 -= xx1 - warper->x1max;\n          xx1  = warper->x1max;\n        }\n      }\n\n      if ( xx1 < warper->x1 )\n        base_distort = warper->x1 - xx1;\n      else\n        base_distort = xx1 - warper->x1;\n\n      if ( xx2 < warper->x2 )\n        base_distort += warper->x2 - xx2;\n      else\n        base_distort += xx2 - warper->x2;\n\n      /* give base distortion a greater weight while scoring */\n      base_distort *= 10;\n\n      new_scale = org_scale + FT_DivFix( w - warper->w0, X2 - X1 );\n      new_delta = xx1 - FT_MulFix( X1, new_scale );\n\n      af_warper_compute_line_best( warper, new_scale, new_delta, xx1, xx2,\n                                   base_distort,\n                                   segments, num_segments );\n    }\n\n    {\n      FT_Fixed  best_scale = warper->best_scale;\n      FT_Pos    best_delta = warper->best_delta;\n\n\n      hints->xmin_delta = FT_MulFix( X1, best_scale - org_scale )\n                          + best_delta;\n      hints->xmax_delta = FT_MulFix( X2, best_scale - org_scale )\n                          + best_delta;\n\n      *a_scale = best_scale;\n      *a_delta = best_delta;\n    }\n  }\n\n#else /* !AF_CONFIG_OPTION_USE_WARPER */\n\n  /* ANSI C doesn't like empty source files */\n  typedef int  _af_warp_dummy;\n\n#endif /* !AF_CONFIG_OPTION_USE_WARPER */\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afwarp.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afwarp.h                                                               */\n/*                                                                         */\n/*    Auto-fitter warping algorithm (specification).                       */\n/*                                                                         */\n/*  Copyright 2006, 2007 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __AFWARP_H__\n#define __AFWARP_H__\n\n#include \"afhints.h\"\n\nFT_BEGIN_HEADER\n\n#define AF_WARPER_SCALE\n\n#define AF_WARPER_FLOOR( x )  ( (x) & ~63 )\n#define AF_WARPER_CEIL( x )   AF_WARPER_FLOOR( (x) + 63 )\n\n\n  typedef FT_Int32  AF_WarpScore;\n\n  typedef struct  AF_WarperRec_\n  {\n    FT_Pos        x1, x2;\n    FT_Pos        t1, t2;\n    FT_Pos        x1min, x1max;\n    FT_Pos        x2min, x2max;\n    FT_Pos        w0, wmin, wmax;\n\n    FT_Fixed      best_scale;\n    FT_Pos        best_delta;\n    AF_WarpScore  best_score;\n    AF_WarpScore  best_distort;\n\n  } AF_WarperRec, *AF_Warper;\n\n\n  FT_LOCAL( void )\n  af_warper_compute( AF_Warper      warper,\n                     AF_GlyphHints  hints,\n                     AF_Dimension   dim,\n                     FT_Fixed      *a_scale,\n                     FT_Fixed      *a_delta );\n\n\nFT_END_HEADER\n\n\n#endif /* __AFWARP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/afwrtsys.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afwrtsys.h                                                             */\n/*                                                                         */\n/*    Auto-fitter writing systems (specification only).                    */\n/*                                                                         */\n/*  Copyright 2013 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __AFWRTSYS_H__\n#define __AFWRTSYS_H__\n\n  /* Since preprocessor directives can't create other preprocessor */\n  /* directives, we have to include the header files manually.     */\n\n#include \"afdummy.h\"\n#include \"aflatin.h\"\n#include \"afcjk.h\"\n#include \"afindic.h\"\n#ifdef FT_OPTION_AUTOFIT2\n#include \"aflatin2.h\"\n#endif\n\n#endif /* __AFWRTSYS_H__ */\n\n\n  /* The following part can be included multiple times. */\n  /* Define `WRITING_SYSTEM' as needed.                 */\n\n\n  /* Add new writing systems here.  The arguments are the writing system */\n  /* name in lowercase and uppercase, respectively.                      */\n\n  WRITING_SYSTEM( dummy,  DUMMY  )\n  WRITING_SYSTEM( latin,  LATIN  )\n  WRITING_SYSTEM( cjk,    CJK    )\n  WRITING_SYSTEM( indic,  INDIC  )\n#ifdef FT_OPTION_AUTOFIT2\n  WRITING_SYSTEM( latin2, LATIN2 )\n#endif\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/autofit.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  autofit.c                                                              */\n/*                                                                         */\n/*    Auto-fitter module (body).                                           */\n/*                                                                         */\n/*  Copyright 2003-2007, 2011, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#define FT_MAKE_OPTION_SINGLE_OBJECT\n#include <ft2build.h>\n#include \"afpic.c\"\n#include \"afangles.c\"\n#include \"afblue.c\"\n#include \"afglobal.c\"\n#include \"afhints.c\"\n\n#include \"afranges.c\"\n\n#include \"afdummy.c\"\n#include \"aflatin.c\"\n#ifdef FT_OPTION_AUTOFIT2\n#include \"aflatin2.c\"\n#endif\n#include \"afcjk.c\"\n#include \"afindic.c\"\n\n#include \"hbshim.c\"\n\n#include \"afloader.c\"\n#include \"afmodule.c\"\n\n#ifdef AF_CONFIG_OPTION_USE_WARPER\n#include \"afwarp.c\"\n#endif\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/hbshim.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  hbshim.c                                                               */\n/*                                                                         */\n/*    HarfBuzz interface for accessing OpenType features (body).           */\n/*                                                                         */\n/*  Copyright 2013, 2014 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include \"afglobal.h\"\n#include \"aftypes.h\"\n#include \"hbshim.h\"\n\n#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_afharfbuzz\n\n\n  /*\n   * We use `sets' (in the HarfBuzz sense, which comes quite near to the\n   * usual mathematical meaning) to manage both lookups and glyph indices.\n   *\n   * 1. For each coverage, collect lookup IDs in a set.  Note that an\n   *    auto-hinter `coverage' is represented by one `feature', and a\n   *    feature consists of an arbitrary number of (font specific) `lookup's\n   *    that actually do the mapping job.  Please check the OpenType\n   *    specification for more details on features and lookups.\n   *\n   * 2. Create glyph ID sets from the corresponding lookup sets.\n   *\n   * 3. The glyph set corresponding to AF_COVERAGE_DEFAULT is computed\n   *    with all lookups specific to the OpenType script activated.  It\n   *    relies on the order of AF_DEFINE_STYLE_CLASS entries so that\n   *    special coverages (like `oldstyle figures') don't get overwritten.\n   *\n   */\n\n\n  /* load coverage tags */\n#undef  COVERAGE\n#define COVERAGE( name, NAME, description,             \\\n                  tag1, tag2, tag3, tag4 )             \\\n          static const hb_tag_t  name ## _coverage[] = \\\n          {                                            \\\n            HB_TAG( tag1, tag2, tag3, tag4 ),          \\\n            HB_TAG_NONE                                \\\n          };\n\n\n#include \"afcover.h\"\n\n\n  /* define mapping between coverage tags and AF_Coverage */\n#undef  COVERAGE\n#define COVERAGE( name, NAME, description, \\\n                  tag1, tag2, tag3, tag4 ) \\\n          name ## _coverage,\n\n\n  static const hb_tag_t*  coverages[] =\n  {\n#include \"afcover.h\"\n\n    NULL /* AF_COVERAGE_DEFAULT */\n  };\n\n\n  /* load HarfBuzz script tags */\n#undef  SCRIPT\n#define SCRIPT( s, S, d, h, sc1, sc2, sc3 )  h,\n\n\n  static const hb_script_t  scripts[] =\n  {\n#include \"afscript.h\"\n  };\n\n\n  FT_Error\n  af_get_coverage( AF_FaceGlobals  globals,\n                   AF_StyleClass   style_class,\n                   FT_Byte*        gstyles )\n  {\n    hb_face_t*  face;\n\n    hb_set_t*  gsub_lookups;  /* GSUB lookups for a given script */\n    hb_set_t*  gsub_glyphs;   /* glyphs covered by GSUB lookups  */\n    hb_set_t*  gpos_lookups;  /* GPOS lookups for a given script */\n    hb_set_t*  gpos_glyphs;   /* glyphs covered by GPOS lookups  */\n\n    hb_script_t      script;\n    const hb_tag_t*  coverage_tags;\n    hb_tag_t         script_tags[] = { HB_TAG_NONE,\n                                       HB_TAG_NONE,\n                                       HB_TAG_NONE,\n                                       HB_TAG_NONE };\n\n    hb_codepoint_t  idx;\n#ifdef FT_DEBUG_LEVEL_TRACE\n    int             count;\n#endif\n\n\n    if ( !globals || !style_class || !gstyles )\n      return FT_THROW( Invalid_Argument );\n\n    face = hb_font_get_face( globals->hb_font );\n\n    gsub_lookups = hb_set_create();\n    gsub_glyphs  = hb_set_create();\n    gpos_lookups = hb_set_create();\n    gpos_glyphs  = hb_set_create();\n\n    coverage_tags = coverages[style_class->coverage];\n    script        = scripts[style_class->script];\n\n    /* Convert a HarfBuzz script tag into the corresponding OpenType */\n    /* tag or tags -- some Indic scripts like Devanagari have an old */\n    /* and a new set of features.                                    */\n    hb_ot_tags_from_script( script,\n                            &script_tags[0],\n                            &script_tags[1] );\n\n    /* `hb_ot_tags_from_script' usually returns HB_OT_TAG_DEFAULT_SCRIPT */\n    /* as the second tag.  We change that to HB_TAG_NONE except for the  */\n    /* default script.                                                   */\n    if ( style_class->script == globals->module->default_script &&\n         style_class->coverage == AF_COVERAGE_DEFAULT           )\n    {\n      if ( script_tags[0] == HB_TAG_NONE )\n        script_tags[0] = HB_OT_TAG_DEFAULT_SCRIPT;\n      else\n      {\n        if ( script_tags[1] == HB_TAG_NONE )\n          script_tags[1] = HB_OT_TAG_DEFAULT_SCRIPT;\n        else if ( script_tags[1] != HB_OT_TAG_DEFAULT_SCRIPT )\n          script_tags[2] = HB_OT_TAG_DEFAULT_SCRIPT;\n      }\n    }\n    else\n    {\n      if ( script_tags[1] == HB_OT_TAG_DEFAULT_SCRIPT )\n        script_tags[1] = HB_TAG_NONE;\n    }\n\n    hb_ot_layout_collect_lookups( face,\n                                  HB_OT_TAG_GSUB,\n                                  script_tags,\n                                  NULL,\n                                  coverage_tags,\n                                  gsub_lookups );\n\n    if ( hb_set_is_empty( gsub_lookups ) )\n      goto Exit; /* nothing to do */\n\n    hb_ot_layout_collect_lookups( face,\n                                  HB_OT_TAG_GPOS,\n                                  script_tags,\n                                  NULL,\n                                  coverage_tags,\n                                  gpos_lookups );\n\n    FT_TRACE4(( \"GSUB lookups (style `%s'):\\n\"\n                \" \",\n                af_style_names[style_class->style] ));\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n    count = 0;\n#endif\n\n    for ( idx = -1; hb_set_next( gsub_lookups, &idx ); )\n    {\n#ifdef FT_DEBUG_LEVEL_TRACE\n      FT_TRACE4(( \" %d\", idx ));\n      count++;\n#endif\n\n      /* get output coverage of GSUB feature */\n      hb_ot_layout_lookup_collect_glyphs( face,\n                                          HB_OT_TAG_GSUB,\n                                          idx,\n                                          NULL,\n                                          NULL,\n                                          NULL,\n                                          gsub_glyphs );\n    }\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n    if ( !count )\n      FT_TRACE4(( \" (none)\" ));\n    FT_TRACE4(( \"\\n\\n\" ));\n#endif\n\n    FT_TRACE4(( \"GPOS lookups (style `%s'):\\n\"\n                \" \",\n                af_style_names[style_class->style] ));\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n    count = 0;\n#endif\n\n    for ( idx = -1; hb_set_next( gpos_lookups, &idx ); )\n    {\n#ifdef FT_DEBUG_LEVEL_TRACE\n      FT_TRACE4(( \" %d\", idx ));\n      count++;\n#endif\n\n      /* get input coverage of GPOS feature */\n      hb_ot_layout_lookup_collect_glyphs( face,\n                                          HB_OT_TAG_GPOS,\n                                          idx,\n                                          NULL,\n                                          gpos_glyphs,\n                                          NULL,\n                                          NULL );\n    }\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n    if ( !count )\n      FT_TRACE4(( \" (none)\" ));\n    FT_TRACE4(( \"\\n\\n\" ));\n#endif\n\n    /*\n     * We now check whether we can construct blue zones, using glyphs\n     * covered by the feature only.  In case there is not a single zone\n     * (this is, not a single character is covered), we skip this coverage.\n     *\n     */\n    if ( style_class->coverage != AF_COVERAGE_DEFAULT )\n    {\n      AF_Blue_Stringset         bss = style_class->blue_stringset;\n      const AF_Blue_StringRec*  bs  = &af_blue_stringsets[bss];\n\n      FT_Bool  found = 0;\n\n\n      for ( ; bs->string != AF_BLUE_STRING_MAX; bs++ )\n      {\n        const char*  p = &af_blue_strings[bs->string];\n\n\n        while ( *p )\n        {\n          hb_codepoint_t  ch;\n\n\n          GET_UTF8_CHAR( ch, p );\n\n          for ( idx = -1; hb_set_next( gsub_lookups, &idx ); )\n          {\n            hb_codepoint_t  gidx = FT_Get_Char_Index( globals->face, ch );\n\n\n            if ( hb_ot_layout_lookup_would_substitute( face, idx,\n                                                       &gidx, 1, 1 ) )\n            {\n              found = 1;\n              break;\n            }\n          }\n        }\n      }\n\n      if ( !found )\n      {\n        FT_TRACE4(( \"  no blue characters found; style skipped\\n\" ));\n        goto Exit;\n      }\n    }\n\n    /*\n     * Various OpenType features might use the same glyphs at different\n     * vertical positions; for example, superscript and subscript glyphs\n     * could be the same.  However, the auto-hinter is completely\n     * agnostic of OpenType features after the feature analysis has been\n     * completed: The engine then simply receives a glyph index and returns a\n     * hinted and usually rendered glyph.\n     *\n     * Consider the superscript feature of font `pala.ttf': Some of the\n     * glyphs are `real', this is, they have a zero vertical offset, but\n     * most of them are small caps glyphs shifted up to the superscript\n     * position (this is, the `sups' feature is present in both the GSUB and\n     * GPOS tables).  The code for blue zones computation actually uses a\n     * feature's y offset so that the `real' glyphs get correct hints.  But\n     * later on it is impossible to decide whether a glyph index belongs to,\n     * say, the small caps or superscript feature.\n     *\n     * For this reason, we don't assign a style to a glyph if the current\n     * feature covers the glyph in both the GSUB and the GPOS tables.  This\n     * is quite a broad condition, assuming that\n     *\n     *   (a) glyphs that get used in multiple features are present in a\n     *       feature without vertical shift,\n     *\n     * and\n     *\n     *   (b) a feature's GPOS data really moves the glyph vertically.\n     *\n     * Not fulfilling condition (a) makes a font larger; it would also\n     * reduce the number of glyphs that could be addressed directly without\n     * using OpenType features, so this assumption is rather strong.\n     *\n     * Condition (b) is much weaker, and there might be glyphs which get\n     * missed.  However, the OpenType features we are going to handle are\n     * primarily located in GSUB, and HarfBuzz doesn't provide an API to\n     * directly get the necessary information from the GPOS table.  A\n     * possible solution might be to directly parse the GPOS table to find\n     * out whether a glyph gets shifted vertically, but this is something I\n     * would like to avoid if not really necessary.\n     *\n     * Note that we don't follow this logic for the default coverage.\n     * Complex scripts like Devanagari have mandatory GPOS features to\n     * position many glyph elements, using mark-to-base or mark-to-ligature\n     * tables; the number of glyphs missed due to condition (b) would be far\n     * too large.\n     *\n     */\n    if ( style_class->coverage != AF_COVERAGE_DEFAULT )\n      hb_set_subtract( gsub_glyphs, gpos_glyphs );\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n    FT_TRACE4(( \"  glyphs without GPOS data (`*' means already assigned)\" ));\n    count = 0;\n#endif\n\n    for ( idx = -1; hb_set_next( gsub_glyphs, &idx ); )\n    {\n#ifdef FT_DEBUG_LEVEL_TRACE\n      if ( !( count % 10 ) )\n        FT_TRACE4(( \"\\n\"\n                    \"   \" ));\n\n      FT_TRACE4(( \" %d\", idx ));\n      count++;\n#endif\n\n      /* glyph indices returned by `hb_ot_layout_lookup_collect_glyphs' */\n      /* can be arbitrary: some fonts use fake indices for processing   */\n      /* internal to GSUB or GPOS, which is fully valid                 */\n      if ( idx >= (hb_codepoint_t)globals->glyph_count )\n        continue;\n\n      if ( gstyles[idx] == AF_STYLE_UNASSIGNED )\n        gstyles[idx] = (FT_Byte)style_class->style;\n#ifdef FT_DEBUG_LEVEL_TRACE\n      else\n        FT_TRACE4(( \"*\" ));\n#endif\n    }\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n    if ( !count )\n      FT_TRACE4(( \"\\n\"\n                  \"    (none)\" ));\n    FT_TRACE4(( \"\\n\\n\" ));\n#endif\n\n  Exit:\n    hb_set_destroy( gsub_lookups );\n    hb_set_destroy( gsub_glyphs  );\n    hb_set_destroy( gpos_lookups );\n    hb_set_destroy( gpos_glyphs  );\n\n    return FT_Err_Ok;\n  }\n\n\n  /* construct HarfBuzz features */\n#undef  COVERAGE\n#define COVERAGE( name, NAME, description,                \\\n                  tag1, tag2, tag3, tag4 )                \\\n          static const hb_feature_t  name ## _feature[] = \\\n          {                                               \\\n            {                                             \\\n              HB_TAG( tag1, tag2, tag3, tag4 ),           \\\n              1, 0, (unsigned int)-1                      \\\n            }                                             \\\n          };\n\n\n#include \"afcover.h\"\n\n\n  /* define mapping between HarfBuzz features and AF_Coverage */\n#undef  COVERAGE\n#define COVERAGE( name, NAME, description, \\\n                  tag1, tag2, tag3, tag4 ) \\\n          name ## _feature,\n\n\n  static const hb_feature_t*  features[] =\n  {\n#include \"afcover.h\"\n\n    NULL /* AF_COVERAGE_DEFAULT */\n  };\n\n\n  FT_Error\n  af_get_char_index( AF_StyleMetrics  metrics,\n                     FT_ULong         charcode,\n                     FT_ULong        *codepoint,\n                     FT_Long         *y_offset )\n  {\n    AF_StyleClass  style_class;\n\n    const hb_feature_t*  feature;\n\n    FT_ULong  in_idx, out_idx;\n\n\n    if ( !metrics )\n      return FT_THROW( Invalid_Argument );\n\n    in_idx = FT_Get_Char_Index( metrics->globals->face, charcode );\n\n    style_class = metrics->style_class;\n\n    feature = features[style_class->coverage];\n\n    if ( feature )\n    {\n      FT_UInt  upem = metrics->globals->face->units_per_EM;\n\n      hb_font_t*    font = metrics->globals->hb_font;\n      hb_buffer_t*  buf  = hb_buffer_create();\n\n      uint32_t  c = (uint32_t)charcode;\n\n      hb_glyph_info_t*      ginfo;\n      hb_glyph_position_t*  gpos;\n      unsigned int          gcount;\n\n\n      /* we shape at a size of units per EM; this means font units */\n      hb_font_set_scale( font, upem, upem );\n\n      /* XXX: is this sufficient for a single character of any script? */\n      hb_buffer_set_direction( buf, HB_DIRECTION_LTR );\n      hb_buffer_set_script( buf, scripts[style_class->script] );\n\n      /* we add one character to `buf' ... */\n      hb_buffer_add_utf32( buf, &c, 1, 0, 1 );\n\n      /* ... and apply one feature */\n      hb_shape( font, buf, feature, 1 );\n\n      ginfo = hb_buffer_get_glyph_infos( buf, &gcount );\n      gpos  = hb_buffer_get_glyph_positions( buf, &gcount );\n\n      out_idx = ginfo[0].codepoint;\n\n      /* getting the same index indicates no substitution,         */\n      /* which means that the glyph isn't available in the feature */\n      if ( in_idx == out_idx )\n      {\n        *codepoint = 0;\n        *y_offset  = 0;\n      }\n      else\n      {\n        *codepoint = out_idx;\n        *y_offset  = gpos[0].y_offset;\n      }\n\n      hb_buffer_destroy( buf );\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n      if ( gcount > 1 )\n        FT_TRACE1(( \"af_get_char_index:\"\n                    \" input character mapped to multiple glyphs\\n\" ));\n#endif\n    }\n    else\n    {\n      *codepoint = in_idx;\n      *y_offset  = 0;\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n#else /* !FT_CONFIG_OPTION_USE_HARFBUZZ */\n\n\n  FT_Error\n  af_get_coverage( AF_FaceGlobals  globals,\n                   AF_StyleClass   style_class,\n                   FT_Byte*        gstyles )\n  {\n    FT_UNUSED( globals );\n    FT_UNUSED( style_class );\n    FT_UNUSED( gstyles );\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_Error\n  af_get_char_index( AF_StyleMetrics  metrics,\n                     FT_ULong         charcode,\n                     FT_ULong        *codepoint,\n                     FT_Long         *y_offset )\n  {\n    FT_Face  face;\n\n\n    if ( !metrics )\n      return FT_THROW( Invalid_Argument );\n\n    face = metrics->globals->face;\n\n    *codepoint = FT_Get_Char_Index( face, charcode );\n    *y_offset  = 0;\n\n    return FT_Err_Ok;\n  }\n\n\n#endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/hbshim.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  hbshim.h                                                               */\n/*                                                                         */\n/*    HarfBuzz interface for accessing OpenType features (specification).  */\n/*                                                                         */\n/*  Copyright 2013 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __HBSHIM_H__\n#define __HBSHIM_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n\n#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ\n\n#include <hb.h>\n#include <hb-ot.h>\n#include <hb-ft.h>\n\n#endif\n\n\nFT_BEGIN_HEADER\n\n  FT_Error\n  af_get_coverage( AF_FaceGlobals  globals,\n                   AF_StyleClass   style_class,\n                   FT_Byte*        gstyles );\n\n  FT_Error\n  af_get_char_index( AF_StyleMetrics  metrics,\n                     FT_ULong         charcode,\n                     FT_ULong        *codepoint,\n                     FT_Long         *y_offset );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __HBSHIM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/autofit/module.mk",
    "content": "#\n# FreeType 2 auto-fitter module definition\n#\n\n\n# Copyright 2003, 2004, 2005, 2006 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\nFTMODULE_H_COMMANDS += AUTOFIT_MODULE\n\ndefine AUTOFIT_MODULE\n$(OPEN_DRIVER) FT_Module_Class, autofit_module_class $(CLOSE_DRIVER)\n$(ECHO_DRIVER)autofit   $(ECHO_DRIVER_DESC)automatic hinting module$(ECHO_DRIVER_DONE)\nendef\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/autofit/rules.mk",
    "content": "#\n# FreeType 2 auto-fitter module configuration rules\n#\n\n\n# Copyright 2003-2007, 2011, 2013 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\n# AUTOF driver directory\n#\nAUTOF_DIR := $(SRC_DIR)/autofit\n\n\n# compilation flags for the driver\n#\nAUTOF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(AUTOF_DIR))\n\n\n# AUTOF driver sources (i.e., C files)\n#\nAUTOF_DRV_SRC := $(AUTOF_DIR)/afangles.c \\\n                 $(AUTOF_DIR)/afblue.c   \\\n                 $(AUTOF_DIR)/afcjk.c    \\\n                 $(AUTOF_DIR)/afdummy.c  \\\n                 $(AUTOF_DIR)/afglobal.c \\\n                 $(AUTOF_DIR)/afhints.c  \\\n                 $(AUTOF_DIR)/afindic.c  \\\n                 $(AUTOF_DIR)/aflatin.c  \\\n                 $(AUTOF_DIR)/afloader.c \\\n                 $(AUTOF_DIR)/afmodule.c \\\n                 $(AUTOF_DIR)/afpic.c    \\\n                 $(AUTOF_DIR)/afranges.c \\\n                 $(AUTOF_DIR)/afwarp.c   \\\n                 $(AUTOF_DIR)/hbshim.c\n\n# AUTOF driver headers\n#\nAUTOF_DRV_H := $(AUTOF_DRV_SRC:%c=%h)  \\\n               $(AUTOF_DIR)/afcover.h  \\\n               $(AUTOF_DIR)/aferrors.h \\\n               $(AUTOF_DIR)/afscript.h \\\n               $(AUTOF_DIR)/afstyles.h \\\n               $(AUTOF_DIR)/aftypes.h  \\\n               $(AUTOF_DIR)/afwrtsys.h\n\n\n# AUTOF driver object(s)\n#\n#   AUTOF_DRV_OBJ_M is used during `multi' builds.\n#   AUTOF_DRV_OBJ_S is used during `single' builds.\n#\nAUTOF_DRV_OBJ_M := $(AUTOF_DRV_SRC:$(AUTOF_DIR)/%.c=$(OBJ_DIR)/%.$O)\nAUTOF_DRV_OBJ_S := $(OBJ_DIR)/autofit.$O\n\n# AUTOF driver source file for single build\n#\nAUTOF_DRV_SRC_S := $(AUTOF_DIR)/autofit.c\n\n\n# AUTOF driver - single object\n#\n$(AUTOF_DRV_OBJ_S): $(AUTOF_DRV_SRC_S) $(AUTOF_DRV_SRC) \\\n                   $(FREETYPE_H) $(AUTOF_DRV_H)\n\t$(AUTOF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(AUTOF_DRV_SRC_S))\n\n\n# AUTOF driver - multiple objects\n#\n$(OBJ_DIR)/%.$O: $(AUTOF_DIR)/%.c $(FREETYPE_H) $(AUTOF_DRV_H)\n\t$(AUTOF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\n\n\n# update main driver object lists\n#\nDRV_OBJS_S += $(AUTOF_DRV_OBJ_S)\nDRV_OBJS_M += $(AUTOF_DRV_OBJ_M)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/base/Jamfile",
    "content": "# FreeType 2 src/base Jamfile\n#\n# Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) base ;\n\n\n{\n  local  _sources ;\n\n  if $(FT2_MULTI)\n  {\n    _sources = ftadvanc ftcalc   ftdbgmem ftgloadr\n               ftobjs   ftoutln  ftrfork  ftsnames\n               ftstream fttrigon ftutil\n               basepic  ftpic\n               ;\n  }\n  else\n  {\n    _sources = ftbase ;\n  }\n\n  Library  $(FT2_LIB) : $(_sources).c ;\n}\n\n# Add the optional/replaceable files.\n#\n{\n  local  _sources = bbox   bdf    bitmap debug  gasp\n                    glyph  gxval  init   lcdfil mm\n                    otval  pfr    stroke synth  system\n                    type1  winfnt xf86   patent\n                    ;\n\n  Library  $(FT2_LIB) : ft$(_sources).c ;\n}\n\n# Add Macintosh-specific file to the library when necessary.\n#\nif $(MAC)\n{\n  Library  $(FT2_LIB) : ftmac.c ;\n}\nelse if $(OS) = MACOSX\n{\n  if $(FT2_MULTI)\n  {\n    Library  $(FT2_LIB) : ftmac.c ;\n  }\n}\n\n# end of src/base Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/base/basepic.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  basepic.c                                                              */\n/*                                                                         */\n/*    The FreeType position independent code services for base.            */\n/*                                                                         */\n/*  Copyright 2009, 2012, 2013 by                                          */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_INTERNAL_OBJECTS_H\n#include \"basepic.h\"\n\n\n#ifdef FT_CONFIG_OPTION_PIC\n\n  /* forward declaration of PIC init functions from ftglyph.c */\n  void\n  FT_Init_Class_ft_outline_glyph_class( FT_Glyph_Class*  clazz );\n\n  void\n  FT_Init_Class_ft_bitmap_glyph_class( FT_Glyph_Class*  clazz );\n\n#ifdef FT_CONFIG_OPTION_MAC_FONTS\n  /* forward declaration of PIC init function from ftrfork.c */\n  /* (not modularized)                                       */\n  void\n  FT_Init_Table_ft_raccess_guess_table( ft_raccess_guess_rec*  record );\n#endif\n\n  /* forward declaration of PIC init functions from ftinit.c */\n  FT_Error\n  ft_create_default_module_classes( FT_Library  library );\n\n  void\n  ft_destroy_default_module_classes( FT_Library  library );\n\n\n  void\n  ft_base_pic_free( FT_Library  library )\n  {\n    FT_PIC_Container*  pic_container = &library->pic_container;\n    FT_Memory          memory        = library->memory;\n\n\n    if ( pic_container->base )\n    {\n      /* destroy default module classes            */\n      /* (in case FT_Add_Default_Modules was used) */\n      ft_destroy_default_module_classes( library );\n\n      FT_FREE( pic_container->base );\n      pic_container->base = NULL;\n    }\n  }\n\n\n  FT_Error\n  ft_base_pic_init( FT_Library  library )\n  {\n    FT_PIC_Container*  pic_container = &library->pic_container;\n    FT_Error           error         = FT_Err_Ok;\n    BasePIC*           container     = NULL;\n    FT_Memory          memory        = library->memory;\n\n\n    /* allocate pointer, clear and set global container pointer */\n    if ( FT_ALLOC( container, sizeof ( *container ) ) )\n      return error;\n    FT_MEM_SET( container, 0, sizeof ( *container ) );\n    pic_container->base = container;\n\n    /* initialize default modules list and pointers */\n    error = ft_create_default_module_classes( library );\n    if ( error )\n      goto Exit;\n\n    /* initialize pointer table -                       */\n    /* this is how the module usually expects this data */\n    FT_Init_Class_ft_outline_glyph_class(\n      &container->ft_outline_glyph_class );\n    FT_Init_Class_ft_bitmap_glyph_class(\n      &container->ft_bitmap_glyph_class );\n#ifdef FT_CONFIG_OPTION_MAC_FONTS\n    FT_Init_Table_ft_raccess_guess_table(\n      (ft_raccess_guess_rec*)&container->ft_raccess_guess_table );\n#endif\n\n  Exit:\n    if ( error )\n      ft_base_pic_free( library );\n    return error;\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/basepic.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  basepic.h                                                              */\n/*                                                                         */\n/*    The FreeType position independent code services for base.            */\n/*                                                                         */\n/*  Copyright 2009 by                                                      */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __BASEPIC_H__\n#define __BASEPIC_H__\n\n\nFT_BEGIN_HEADER\n\n#include FT_INTERNAL_PIC_H\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_OUTLINE_GLYPH_CLASS_GET  &ft_outline_glyph_class\n#define FT_BITMAP_GLYPH_CLASS_GET   &ft_bitmap_glyph_class\n#define FT_DEFAULT_MODULES_GET      ft_default_modules\n\n#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK\n#define FT_RACCESS_GUESS_TABLE_GET  ft_raccess_guess_table\n#endif\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#include FT_GLYPH_H\n\n#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK\n#include FT_INTERNAL_RFORK_H\n#endif\n\n\n  typedef struct  BasePIC_\n  {\n    FT_Module_Class**  default_module_classes;\n    FT_Glyph_Class     ft_outline_glyph_class;\n    FT_Glyph_Class     ft_bitmap_glyph_class;\n\n#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK\n    ft_raccess_guess_rec  ft_raccess_guess_table[FT_RACCESS_N_RULES];\n#endif\n\n  } BasePIC;\n\n\n#define GET_PIC( lib )  ( (BasePIC*)( (lib)->pic_container.base ) )\n\n#define FT_OUTLINE_GLYPH_CLASS_GET                      \\\n          ( &GET_PIC( library )->ft_outline_glyph_class )\n#define FT_BITMAP_GLYPH_CLASS_GET                        \\\n          ( &GET_PIC( library )->ft_bitmap_glyph_class )\n#define FT_DEFAULT_MODULES_GET                           \\\n          ( GET_PIC( library )->default_module_classes )\n\n#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK\n#define FT_RACCESS_GUESS_TABLE_GET                       \\\n          ( GET_PIC( library )->ft_raccess_guess_table )\n#endif\n\n\n  /* see basepic.c for the implementation */\n  void\n  ft_base_pic_free( FT_Library  library );\n\n  FT_Error\n  ft_base_pic_init( FT_Library  library );\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __BASEPIC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftadvanc.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftadvanc.c                                                             */\n/*                                                                         */\n/*    Quick computation of advance widths (body).                          */\n/*                                                                         */\n/*  Copyright 2008, 2009, 2011, 2013, 2014 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n\n#include FT_ADVANCES_H\n#include FT_INTERNAL_OBJECTS_H\n\n\n  static FT_Error\n  _ft_face_scale_advances( FT_Face    face,\n                           FT_Fixed*  advances,\n                           FT_UInt    count,\n                           FT_Int32   flags )\n  {\n    FT_Fixed  scale;\n    FT_UInt   nn;\n\n\n    if ( flags & FT_LOAD_NO_SCALE )\n      return FT_Err_Ok;\n\n    if ( face->size == NULL )\n      return FT_THROW( Invalid_Size_Handle );\n\n    if ( flags & FT_LOAD_VERTICAL_LAYOUT )\n      scale = face->size->metrics.y_scale;\n    else\n      scale = face->size->metrics.x_scale;\n\n    /* this must be the same scaling as to get linear{Hori,Vert}Advance */\n    /* (see `FT_Load_Glyph' implementation in src/base/ftobjs.c)        */\n\n    for ( nn = 0; nn < count; nn++ )\n      advances[nn] = FT_MulDiv( advances[nn], scale, 64 );\n\n    return FT_Err_Ok;\n  }\n\n\n   /* at the moment, we can perform fast advance retrieval only in */\n   /* the following cases:                                         */\n   /*                                                              */\n   /*  - unscaled load                                             */\n   /*  - unhinted load                                             */\n   /*  - light-hinted load                                         */\n\n#define LOAD_ADVANCE_FAST_CHECK( flags )                            \\\n          ( flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING )    || \\\n            FT_LOAD_TARGET_MODE( flags ) == FT_RENDER_MODE_LIGHT )\n\n\n  /* documentation is in ftadvanc.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Get_Advance( FT_Face    face,\n                  FT_UInt    gindex,\n                  FT_Int32   flags,\n                  FT_Fixed  *padvance )\n  {\n    FT_Face_GetAdvancesFunc  func;\n\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    if ( !padvance )\n      return FT_THROW( Invalid_Argument );\n\n    if ( gindex >= (FT_UInt)face->num_glyphs )\n      return FT_THROW( Invalid_Glyph_Index );\n\n    func = face->driver->clazz->get_advances;\n    if ( func && LOAD_ADVANCE_FAST_CHECK( flags ) )\n    {\n      FT_Error  error;\n\n\n      error = func( face, gindex, 1, flags, padvance );\n      if ( !error )\n        return _ft_face_scale_advances( face, padvance, 1, flags );\n\n      if ( FT_ERR_NEQ( error, Unimplemented_Feature ) )\n        return error;\n    }\n\n    return FT_Get_Advances( face, gindex, 1, flags, padvance );\n  }\n\n\n  /* documentation is in ftadvanc.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Get_Advances( FT_Face    face,\n                   FT_UInt    start,\n                   FT_UInt    count,\n                   FT_Int32   flags,\n                   FT_Fixed  *padvances )\n  {\n    FT_Face_GetAdvancesFunc  func;\n    FT_UInt                  num, end, nn;\n    FT_Error                 error = FT_Err_Ok;\n\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    if ( !padvances )\n      return FT_THROW( Invalid_Argument );\n\n    num = (FT_UInt)face->num_glyphs;\n    end = start + count;\n    if ( start >= num || end < start || end > num )\n      return FT_THROW( Invalid_Glyph_Index );\n\n    if ( count == 0 )\n      return FT_Err_Ok;\n\n    func = face->driver->clazz->get_advances;\n    if ( func && LOAD_ADVANCE_FAST_CHECK( flags ) )\n    {\n      error = func( face, start, count, flags, padvances );\n      if ( !error )\n        return _ft_face_scale_advances( face, padvances, count, flags );\n\n      if ( FT_ERR_NEQ( error, Unimplemented_Feature ) )\n        return error;\n    }\n\n    error = FT_Err_Ok;\n\n    if ( flags & FT_ADVANCE_FLAG_FAST_ONLY )\n      return FT_THROW( Unimplemented_Feature );\n\n    flags |= (FT_UInt32)FT_LOAD_ADVANCE_ONLY;\n    for ( nn = 0; nn < count; nn++ )\n    {\n      error = FT_Load_Glyph( face, start + nn, flags );\n      if ( error )\n        break;\n\n      /* scale from 26.6 to 16.16 */\n      padvances[nn] = ( flags & FT_LOAD_VERTICAL_LAYOUT )\n                      ? face->glyph->advance.y << 10\n                      : face->glyph->advance.x << 10;\n    }\n\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftapi.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftapi.c                                                                */\n/*                                                                         */\n/*    The FreeType compatibility functions (body).                         */\n/*                                                                         */\n/*  Copyright 2002 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_LIST_H\n#include FT_OUTLINE_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_TRUETYPE_TABLES_H\n#include FT_OUTLINE_H\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                 C O M P A T I B I L I T Y                       ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* backwards compatibility API */\n\n  FT_BASE_DEF( void )\n  FT_New_Memory_Stream( FT_Library  library,\n                        FT_Byte*    base,\n                        FT_ULong    size,\n                        FT_Stream   stream )\n  {\n    FT_UNUSED( library );\n\n    FT_Stream_OpenMemory( stream, base, size );\n  }\n\n\n  FT_BASE_DEF( FT_Error )\n  FT_Seek_Stream( FT_Stream  stream,\n                  FT_ULong   pos )\n  {\n    return FT_Stream_Seek( stream, pos );\n  }\n\n\n  FT_BASE_DEF( FT_Error )\n  FT_Skip_Stream( FT_Stream  stream,\n                  FT_Long    distance )\n  {\n    return FT_Stream_Skip( stream, distance );\n  }\n\n\n  FT_BASE_DEF( FT_Error )\n  FT_Read_Stream( FT_Stream  stream,\n                  FT_Byte*   buffer,\n                  FT_ULong   count )\n  {\n    return FT_Stream_Read( stream, buffer, count );\n  }\n\n\n  FT_BASE_DEF( FT_Error )\n  FT_Read_Stream_At( FT_Stream  stream,\n                     FT_ULong   pos,\n                     FT_Byte*   buffer,\n                     FT_ULong   count )\n  {\n    return FT_Stream_ReadAt( stream, pos, buffer, count );\n  }\n\n\n  FT_BASE_DEF( FT_Error )\n  FT_Extract_Frame( FT_Stream  stream,\n                    FT_ULong   count,\n                    FT_Byte**  pbytes )\n  {\n    return FT_Stream_ExtractFrame( stream, count, pbytes );\n  }\n\n\n  FT_BASE_DEF( void )\n  FT_Release_Frame( FT_Stream  stream,\n                    FT_Byte**  pbytes )\n  {\n    FT_Stream_ReleaseFrame( stream, pbytes );\n  }\n\n  FT_BASE_DEF( FT_Error )\n  FT_Access_Frame( FT_Stream  stream,\n                   FT_ULong   count )\n  {\n    return FT_Stream_EnterFrame( stream, count );\n  }\n\n\n  FT_BASE_DEF( void )\n  FT_Forget_Frame( FT_Stream  stream )\n  {\n    FT_Stream_ExitFrame( stream );\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftbase.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbase.c                                                               */\n/*                                                                         */\n/*    Single object library component (body only).                         */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009 by       */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n\n#define  FT_MAKE_OPTION_SINGLE_OBJECT\n\n#include \"ftpic.c\"\n#include \"basepic.c\"\n#include \"ftadvanc.c\"\n#include \"ftcalc.c\"\n#include \"ftdbgmem.c\"\n#include \"ftgloadr.c\"\n#include \"ftobjs.c\"\n#include \"ftoutln.c\"\n#include \"ftrfork.c\"\n#include \"ftsnames.c\"\n#include \"ftstream.c\"\n#include \"fttrigon.c\"\n#include \"ftutil.c\"\n\n#ifdef FT_MACINTOSH\n#include \"ftmac.c\"\n#endif\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftbase.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbase.h                                                               */\n/*                                                                         */\n/*    The FreeType private functions used in base module (specification).  */\n/*                                                                         */\n/*  Copyright 2008, 2010 by                                                */\n/*  David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya.      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTBASE_H__\n#define __FTBASE_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /* Assume the stream is sfnt-wrapped PS Type1 or sfnt-wrapped CID-keyed */\n  /* font, and try to load a face specified by the face_index.            */\n  FT_LOCAL( FT_Error )\n  open_face_PS_from_sfnt_stream( FT_Library     library,\n                                 FT_Stream      stream,\n                                 FT_Long        face_index,\n                                 FT_Int         num_params,\n                                 FT_Parameter  *params,\n                                 FT_Face       *aface );\n\n\n  /* Create a new FT_Face given a buffer and a driver name. */\n  /* From ftmac.c.                                          */\n  FT_LOCAL( FT_Error )\n  open_face_from_buffer( FT_Library   library,\n                         FT_Byte*     base,\n                         FT_ULong     size,\n                         FT_Long      face_index,\n                         const char*  driver_name,\n                         FT_Face     *aface );\n\n\n#if  defined( FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK ) && \\\n    !defined( FT_MACINTOSH )\n  /* Mac OS X/Darwin kernel often changes recommended method to access */\n  /* the resource fork and older methods makes the kernel issue the    */\n  /* warning of deprecated method.  To calm it down, the methods based */\n  /* on Darwin VFS should be grouped and skip the rest methods after   */\n  /* the case the resource is opened but found to lack a font in it.   */\n  FT_LOCAL( FT_Bool )\n  ft_raccess_rule_by_darwin_vfs( FT_Library library, FT_UInt  rule_index );\n#endif\n\n\nFT_END_HEADER\n\n#endif /* __FTBASE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftbbox.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbbox.c                                                               */\n/*                                                                         */\n/*    FreeType bbox computation (body).                                    */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004, 2006, 2010, 2013, 2014 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used        */\n/*  modified and distributed under the terms of the FreeType project       */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This component has a _single_ role: to compute exact outline bounding */\n  /* boxes.                                                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n\n#include FT_BBOX_H\n#include FT_IMAGE_H\n#include FT_OUTLINE_H\n#include FT_INTERNAL_CALC_H\n#include FT_INTERNAL_OBJECTS_H\n\n\n  typedef struct  TBBox_Rec_\n  {\n    FT_Vector  last;\n    FT_BBox    bbox;\n\n  } TBBox_Rec;\n\n\n#define FT_UPDATE_BBOX( p, bbox ) \\\n  FT_BEGIN_STMNT                  \\\n    if ( p->x < bbox.xMin )       \\\n      bbox.xMin = p->x;           \\\n    if ( p->x > bbox.xMax )       \\\n      bbox.xMax = p->x;           \\\n    if ( p->y < bbox.yMin )       \\\n      bbox.yMin = p->y;           \\\n    if ( p->y > bbox.yMax )       \\\n      bbox.yMax = p->y;           \\\n  FT_END_STMNT\n\n#define CHECK_X( p, bbox )                         \\\n          ( p->x < bbox.xMin || p->x > bbox.xMax )\n\n#define CHECK_Y( p, bbox )                         \\\n          ( p->y < bbox.yMin || p->y > bbox.yMax )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    BBox_Move_To                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used as a `move_to' emitter during                */\n  /*    FT_Outline_Decompose().  It simply records the destination point   */\n  /*    in `user->last'. We also update bbox in case contour starts with   */\n  /*    an implicit `on' point.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    to   :: A pointer to the destination vector.                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    user :: A pointer to the current walk context.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Always 0.  Needed for the interface only.                          */\n  /*                                                                       */\n  static int\n  BBox_Move_To( FT_Vector*  to,\n                TBBox_Rec*  user )\n  {\n    FT_UPDATE_BBOX( to, user->bbox );\n\n    user->last = *to;\n\n    return 0;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    BBox_Line_To                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used as a `line_to' emitter during                */\n  /*    FT_Outline_Decompose().  It simply records the destination point   */\n  /*    in `user->last'; no further computations are necessary because     */\n  /*    bbox already contains both explicit ends of the line segment.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    to   :: A pointer to the destination vector.                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    user :: A pointer to the current walk context.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Always 0.  Needed for the interface only.                          */\n  /*                                                                       */\n  static int\n  BBox_Line_To( FT_Vector*  to,\n                TBBox_Rec*  user )\n  {\n    user->last = *to;\n\n    return 0;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    BBox_Conic_Check                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Find the extrema of a 1-dimensional conic Bezier curve and update  */\n  /*    a bounding range.  This version uses direct computation, as it     */\n  /*    doesn't need square roots.                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    y1  :: The start coordinate.                                       */\n  /*                                                                       */\n  /*    y2  :: The coordinate of the control point.                        */\n  /*                                                                       */\n  /*    y3  :: The end coordinate.                                         */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    min :: The address of the current minimum.                         */\n  /*                                                                       */\n  /*    max :: The address of the current maximum.                         */\n  /*                                                                       */\n  static void\n  BBox_Conic_Check( FT_Pos   y1,\n                    FT_Pos   y2,\n                    FT_Pos   y3,\n                    FT_Pos*  min,\n                    FT_Pos*  max )\n  {\n    /* This function is only called when a control off-point is outside */\n    /* the bbox that contains all on-points.  It finds a local extremum */\n    /* within the segment, equal to (y1*y3 - y2*y2)/(y1 - 2*y2 + y3).   */\n    /* Or, offsetting from y2, we get                                   */\n\n    y1 -= y2;\n    y3 -= y2;\n    y2 += FT_MulDiv( y1, y3, y1 + y3 );\n\n    if ( y2 < *min )\n      *min = y2;\n    if ( y2 > *max )\n      *max = y2;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    BBox_Conic_To                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used as a `conic_to' emitter during               */\n  /*    FT_Outline_Decompose().  It checks a conic Bezier curve with the   */\n  /*    current bounding box, and computes its extrema if necessary to     */\n  /*    update it.                                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    control :: A pointer to a control point.                           */\n  /*                                                                       */\n  /*    to      :: A pointer to the destination vector.                    */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    user    :: The address of the current walk context.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Always 0.  Needed for the interface only.                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    In the case of a non-monotonous arc, we compute directly the       */\n  /*    extremum coordinates, as it is sufficiently fast.                  */\n  /*                                                                       */\n  static int\n  BBox_Conic_To( FT_Vector*  control,\n                 FT_Vector*  to,\n                 TBBox_Rec*  user )\n  {\n    /* in case `to' is implicit and not included in bbox yet */\n    FT_UPDATE_BBOX( to, user->bbox );\n\n    if ( CHECK_X( control, user->bbox ) )\n      BBox_Conic_Check( user->last.x,\n                        control->x,\n                        to->x,\n                        &user->bbox.xMin,\n                        &user->bbox.xMax );\n\n    if ( CHECK_Y( control, user->bbox ) )\n      BBox_Conic_Check( user->last.y,\n                        control->y,\n                        to->y,\n                        &user->bbox.yMin,\n                        &user->bbox.yMax );\n\n    user->last = *to;\n\n    return 0;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    BBox_Cubic_Check                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Find the extrema of a 1-dimensional cubic Bezier curve and         */\n  /*    update a bounding range.  This version uses iterative splitting    */\n  /*    because it is faster than the exact solution with square roots.    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    p1  :: The start coordinate.                                       */\n  /*                                                                       */\n  /*    p2  :: The coordinate of the first control point.                  */\n  /*                                                                       */\n  /*    p3  :: The coordinate of the second control point.                 */\n  /*                                                                       */\n  /*    p4  :: The end coordinate.                                         */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    min :: The address of the current minimum.                         */\n  /*                                                                       */\n  /*    max :: The address of the current maximum.                         */\n  /*                                                                       */\n  static FT_Pos\n  cubic_peak( FT_Pos  q1,\n              FT_Pos  q2,\n              FT_Pos  q3,\n              FT_Pos  q4 )\n  {\n    FT_Pos  peak = 0;\n    FT_Int  shift;\n\n    /* This function finds a peak of a cubic segment if it is above 0    */\n    /* using iterative bisection of the segment, or returns 0.           */\n    /* The fixed-point arithmetic of bisection is inherently stable      */\n    /* but may loose accuracy in the two lowest bits.  To compensate,    */\n    /* we upscale the segment if there is room.  Large values may need   */\n    /* to be downscaled to avoid overflows during bisection.             */\n    /* It is called with either q2 or q3 positive, which is necessary    */\n    /* for the peak to exist and avoids undefined FT_MSB.                */\n\n    shift = 27 -\n      FT_MSB( FT_ABS( q1 ) | FT_ABS( q2 ) | FT_ABS( q3 ) | FT_ABS( q4 ) );\n\n    if ( shift > 0 )\n    {\n      /* upscaling too much just wastes time */\n      if ( shift > 2 )\n        shift = 2;\n\n      q1 <<=  shift;\n      q2 <<=  shift;\n      q3 <<=  shift;\n      q4 <<=  shift;\n    }\n    else\n    {\n      q1 >>= -shift;\n      q2 >>= -shift;\n      q3 >>= -shift;\n      q4 >>= -shift;\n    }\n\n    /* for a peak to exist above 0, the cubic segment must have */\n    /* at least one of its control off-points above 0.          */\n    while ( q2 > 0 || q3 > 0 )\n    {\n      /* determine which half contains the maximum and split */\n      if ( q1 + q2 > q3 + q4 ) /* first half */\n      {\n        q4 = q4 + q3;\n        q3 = q3 + q2;\n        q2 = q2 + q1;\n        q4 = q4 + q3;\n        q3 = q3 + q2;\n        q4 = ( q4 + q3 ) / 8;\n        q3 = q3 / 4;\n        q2 = q2 / 2;\n      }\n      else                     /* second half */\n      {\n        q1 = q1 + q2;\n        q2 = q2 + q3;\n        q3 = q3 + q4;\n        q1 = q1 + q2;\n        q2 = q2 + q3;\n        q1 = ( q1 + q2 ) / 8;\n        q2 = q2 / 4;\n        q3 = q3 / 2;\n      }\n\n      /* check whether either end reached the maximum */\n      if ( q1 == q2 && q1 >= q3 )\n      {\n        peak = q1;\n        break;\n      }\n      if ( q3 == q4 && q2 <= q4 )\n      {\n        peak = q4;\n        break;\n      }\n    }\n\n    if ( shift > 0 )\n      peak >>=  shift;\n    else\n      peak <<= -shift;\n\n    return peak;\n  }\n\n\n  static void\n  BBox_Cubic_Check( FT_Pos   p1,\n                    FT_Pos   p2,\n                    FT_Pos   p3,\n                    FT_Pos   p4,\n                    FT_Pos*  min,\n                    FT_Pos*  max )\n  {\n    /* This function is only called when a control off-point is outside  */\n    /* the bbox that contains all on-points.  So at least one of the     */\n    /* conditions below holds and cubic_peak is called with at least one */\n    /* non-zero argument.                                                */\n\n    if ( p2 > *max || p3 > *max )\n      *max += cubic_peak( p1 - *max, p2 - *max, p3 - *max, p4 - *max );\n\n    /* now flip the signs to update the minimum */\n    if ( p2 < *min || p3 < *min )\n      *min -= cubic_peak( *min - p1, *min - p2, *min - p3, *min - p4 );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    BBox_Cubic_To                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used as a `cubic_to' emitter during               */\n  /*    FT_Outline_Decompose().  It checks a cubic Bezier curve with the   */\n  /*    current bounding box, and computes its extrema if necessary to     */\n  /*    update it.                                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    control1 :: A pointer to the first control point.                  */\n  /*                                                                       */\n  /*    control2 :: A pointer to the second control point.                 */\n  /*                                                                       */\n  /*    to       :: A pointer to the destination vector.                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    user     :: The address of the current walk context.               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Always 0.  Needed for the interface only.                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    In the case of a non-monotonous arc, we don't compute directly     */\n  /*    extremum coordinates, we subdivide instead.                        */\n  /*                                                                       */\n  static int\n  BBox_Cubic_To( FT_Vector*  control1,\n                 FT_Vector*  control2,\n                 FT_Vector*  to,\n                 TBBox_Rec*  user )\n  {\n    /* We don't need to check `to' since it is always an on-point,    */\n    /* thus within the bbox.  Only segments with an off-point outside */\n    /* the bbox can possibly reach new extreme values.                */\n\n    if ( CHECK_X( control1, user->bbox ) ||\n         CHECK_X( control2, user->bbox ) )\n      BBox_Cubic_Check( user->last.x,\n                        control1->x,\n                        control2->x,\n                        to->x,\n                        &user->bbox.xMin,\n                        &user->bbox.xMax );\n\n    if ( CHECK_Y( control1, user->bbox ) ||\n         CHECK_Y( control2, user->bbox ) )\n      BBox_Cubic_Check( user->last.y,\n                        control1->y,\n                        control2->y,\n                        to->y,\n                        &user->bbox.yMin,\n                        &user->bbox.yMax );\n\n    user->last = *to;\n\n    return 0;\n  }\n\n\n  FT_DEFINE_OUTLINE_FUNCS(bbox_interface,\n    (FT_Outline_MoveTo_Func) BBox_Move_To,\n    (FT_Outline_LineTo_Func) BBox_Line_To,\n    (FT_Outline_ConicTo_Func)BBox_Conic_To,\n    (FT_Outline_CubicTo_Func)BBox_Cubic_To,\n    0, 0\n  )\n\n\n  /* documentation is in ftbbox.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Outline_Get_BBox( FT_Outline*  outline,\n                       FT_BBox     *abbox )\n  {\n    FT_BBox     cbox = {  0x7FFFFFFFL,  0x7FFFFFFFL,\n                         -0x7FFFFFFFL, -0x7FFFFFFFL };\n    FT_BBox     bbox = {  0x7FFFFFFFL,  0x7FFFFFFFL,\n                         -0x7FFFFFFFL, -0x7FFFFFFFL };\n    FT_Vector*  vec;\n    FT_UShort   n;\n\n\n    if ( !abbox )\n      return FT_THROW( Invalid_Argument );\n\n    if ( !outline )\n      return FT_THROW( Invalid_Outline );\n\n    /* if outline is empty, return (0,0,0,0) */\n    if ( outline->n_points == 0 || outline->n_contours <= 0 )\n    {\n      abbox->xMin = abbox->xMax = 0;\n      abbox->yMin = abbox->yMax = 0;\n      return 0;\n    }\n\n    /* We compute the control box as well as the bounding box of  */\n    /* all `on' points in the outline.  Then, if the two boxes    */\n    /* coincide, we exit immediately.                             */\n\n    vec = outline->points;\n\n    for ( n = 0; n < outline->n_points; n++ )\n    {\n      FT_UPDATE_BBOX( vec, cbox);\n\n      if ( FT_CURVE_TAG( outline->tags[n] ) == FT_CURVE_TAG_ON )\n        FT_UPDATE_BBOX( vec, bbox);\n\n      vec++;\n    }\n\n    /* test two boxes for equality */\n    if ( cbox.xMin < bbox.xMin || cbox.xMax > bbox.xMax ||\n         cbox.yMin < bbox.yMin || cbox.yMax > bbox.yMax )\n    {\n      /* the two boxes are different, now walk over the outline to */\n      /* get the Bezier arc extrema.                               */\n\n      FT_Error   error;\n      TBBox_Rec  user;\n\n#ifdef FT_CONFIG_OPTION_PIC\n      FT_Outline_Funcs bbox_interface;\n      Init_Class_bbox_interface(&bbox_interface);\n#endif\n\n      user.bbox = bbox;\n\n      error = FT_Outline_Decompose( outline, &bbox_interface, &user );\n      if ( error )\n        return error;\n\n      *abbox = user.bbox;\n    }\n    else\n      *abbox = bbox;\n\n    return FT_Err_Ok;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftbdf.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbdf.c                                                                */\n/*                                                                         */\n/*    FreeType API for accessing BDF-specific strings (body).              */\n/*                                                                         */\n/*  Copyright 2002-2004, 2013, 2014 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n\n#include FT_INTERNAL_OBJECTS_H\n#include FT_SERVICE_BDF_H\n\n\n  /* documentation is in ftbdf.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Get_BDF_Charset_ID( FT_Face       face,\n                         const char*  *acharset_encoding,\n                         const char*  *acharset_registry )\n  {\n    FT_Error     error;\n    const char*  encoding = NULL;\n    const char*  registry = NULL;\n\n    FT_Service_BDF  service;\n\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    FT_FACE_FIND_SERVICE( face, service, BDF );\n\n    if ( service && service->get_charset_id )\n      error = service->get_charset_id( face, &encoding, &registry );\n    else\n      error = FT_THROW( Invalid_Argument );\n\n    if ( acharset_encoding )\n      *acharset_encoding = encoding;\n\n    if ( acharset_registry )\n      *acharset_registry = registry;\n\n    return error;\n  }\n\n\n  /* documentation is in ftbdf.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Get_BDF_Property( FT_Face           face,\n                       const char*       prop_name,\n                       BDF_PropertyRec  *aproperty )\n  {\n    FT_Error  error;\n\n    FT_Service_BDF  service;\n\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    if ( !aproperty )\n      return FT_THROW( Invalid_Argument );\n\n    aproperty->type = BDF_PROPERTY_TYPE_NONE;\n\n    FT_FACE_FIND_SERVICE( face, service, BDF );\n\n    if ( service && service->get_property )\n      error = service->get_property( face, prop_name, aproperty );\n    else\n      error = FT_THROW( Invalid_Argument );\n\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftbitmap.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbitmap.c                                                             */\n/*                                                                         */\n/*    FreeType utility functions for bitmaps (body).                       */\n/*                                                                         */\n/*  Copyright 2004-2009, 2011, 2013, 2014 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n\n#include FT_BITMAP_H\n#include FT_IMAGE_H\n#include FT_INTERNAL_OBJECTS_H\n\n\n  static\n  const FT_Bitmap  null_bitmap = { 0, 0, 0, 0, 0, 0, 0, 0 };\n\n\n  /* documentation is in ftbitmap.h */\n\n  FT_EXPORT_DEF( void )\n  FT_Bitmap_New( FT_Bitmap  *abitmap )\n  {\n    if ( abitmap )\n      *abitmap = null_bitmap;\n  }\n\n\n  /* documentation is in ftbitmap.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Bitmap_Copy( FT_Library        library,\n                  const FT_Bitmap  *source,\n                  FT_Bitmap        *target)\n  {\n    FT_Memory  memory;\n    FT_Error   error  = FT_Err_Ok;\n\n    FT_Int    pitch;\n    FT_ULong  size;\n\n    FT_Int  source_pitch_sign, target_pitch_sign;\n\n\n    if ( !library )\n      return FT_THROW( Invalid_Library_Handle );\n\n    if ( !source || !target )\n      return FT_THROW( Invalid_Argument );\n\n    if ( source == target )\n      return FT_Err_Ok;\n\n    source_pitch_sign = source->pitch < 0 ? -1 : 1;\n    target_pitch_sign = target->pitch < 0 ? -1 : 1;\n\n    if ( source->buffer == NULL )\n    {\n      *target = *source;\n      if ( source_pitch_sign != target_pitch_sign )\n        target->pitch = -target->pitch;\n\n      return FT_Err_Ok;\n    }\n\n    memory = library->memory;\n    pitch  = source->pitch;\n\n    if ( pitch < 0 )\n      pitch = -pitch;\n    size = (FT_ULong)pitch * source->rows;\n\n    if ( target->buffer )\n    {\n      FT_Int    target_pitch = target->pitch;\n      FT_ULong  target_size;\n\n\n      if ( target_pitch < 0 )\n        target_pitch = -target_pitch;\n      target_size = (FT_ULong)target_pitch * target->rows;\n\n      if ( target_size != size )\n        (void)FT_QREALLOC( target->buffer, target_size, size );\n    }\n    else\n      (void)FT_QALLOC( target->buffer, size );\n\n    if ( !error )\n    {\n      unsigned char *p;\n\n\n      p = target->buffer;\n      *target = *source;\n      target->buffer = p;\n\n      if ( source_pitch_sign == target_pitch_sign )\n        FT_MEM_COPY( target->buffer, source->buffer, size );\n      else\n      {\n        /* take care of bitmap flow */\n        FT_UInt   i;\n        FT_Byte*  s = source->buffer;\n        FT_Byte*  t = target->buffer;\n\n\n        t += pitch * ( target->rows - 1 );\n\n        for ( i = target->rows; i > 0; i-- )\n        {\n          FT_ARRAY_COPY( t, s, pitch );\n\n          s += pitch;\n          t -= pitch;\n        }\n      }\n    }\n\n    return error;\n  }\n\n\n  /* Enlarge `bitmap' horizontally and vertically by `xpixels' */\n  /* and `ypixels', respectively.                              */\n\n  static FT_Error\n  ft_bitmap_assure_buffer( FT_Memory   memory,\n                           FT_Bitmap*  bitmap,\n                           FT_UInt     xpixels,\n                           FT_UInt     ypixels )\n  {\n    FT_Error        error;\n    int             pitch;\n    int             new_pitch;\n    FT_UInt         bpp;\n    FT_UInt         i, width, height;\n    unsigned char*  buffer = NULL;\n\n\n    width  = bitmap->width;\n    height = bitmap->rows;\n    pitch  = bitmap->pitch;\n    if ( pitch < 0 )\n      pitch = -pitch;\n\n    switch ( bitmap->pixel_mode )\n    {\n    case FT_PIXEL_MODE_MONO:\n      bpp       = 1;\n      new_pitch = ( width + xpixels + 7 ) >> 3;\n      break;\n    case FT_PIXEL_MODE_GRAY2:\n      bpp       = 2;\n      new_pitch = ( width + xpixels + 3 ) >> 2;\n      break;\n    case FT_PIXEL_MODE_GRAY4:\n      bpp       = 4;\n      new_pitch = ( width + xpixels + 1 ) >> 1;\n      break;\n    case FT_PIXEL_MODE_GRAY:\n    case FT_PIXEL_MODE_LCD:\n    case FT_PIXEL_MODE_LCD_V:\n      bpp       = 8;\n      new_pitch = ( width + xpixels );\n      break;\n    default:\n      return FT_THROW( Invalid_Glyph_Format );\n    }\n\n    /* if no need to allocate memory */\n    if ( ypixels == 0 && new_pitch <= pitch )\n    {\n      /* zero the padding */\n      FT_UInt  bit_width = pitch * 8;\n      FT_UInt  bit_last  = ( width + xpixels ) * bpp;\n\n\n      if ( bit_last < bit_width )\n      {\n        FT_Byte*  line  = bitmap->buffer + ( bit_last >> 3 );\n        FT_Byte*  end   = bitmap->buffer + pitch;\n        FT_UInt   shift = bit_last & 7;\n        FT_UInt   mask  = 0xFF00U >> shift;\n        FT_UInt   count = height;\n\n\n        for ( ; count > 0; count--, line += pitch, end += pitch )\n        {\n          FT_Byte*  write = line;\n\n\n          if ( shift > 0 )\n          {\n            write[0] = (FT_Byte)( write[0] & mask );\n            write++;\n          }\n          if ( write < end )\n            FT_MEM_ZERO( write, end - write );\n        }\n      }\n\n      return FT_Err_Ok;\n    }\n\n    /* otherwise allocate new buffer */\n    if ( FT_QALLOC_MULT( buffer, new_pitch, bitmap->rows + ypixels ) )\n      return error;\n\n    /* new rows get added at the top of the bitmap, */\n    /* thus take care of the flow direction         */\n    if ( bitmap->pitch > 0 )\n    {\n      FT_UInt  len = ( width * bpp + 7 ) >> 3;\n\n\n      for ( i = 0; i < bitmap->rows; i++ )\n        FT_MEM_COPY( buffer + new_pitch * ( ypixels + i ),\n                     bitmap->buffer + pitch * i, len );\n    }\n    else\n    {\n      FT_UInt  len = ( width * bpp + 7 ) >> 3;\n\n\n      for ( i = 0; i < bitmap->rows; i++ )\n        FT_MEM_COPY( buffer + new_pitch * i,\n                     bitmap->buffer + pitch * i, len );\n    }\n\n    FT_FREE( bitmap->buffer );\n    bitmap->buffer = buffer;\n\n    if ( bitmap->pitch < 0 )\n      new_pitch = -new_pitch;\n\n    /* set pitch only, width and height are left untouched */\n    bitmap->pitch = new_pitch;\n\n    return FT_Err_Ok;\n  }\n\n\n  /* documentation is in ftbitmap.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Bitmap_Embolden( FT_Library  library,\n                      FT_Bitmap*  bitmap,\n                      FT_Pos      xStrength,\n                      FT_Pos      yStrength )\n  {\n    FT_Error        error;\n    unsigned char*  p;\n    FT_Int          i, x, pitch;\n    FT_UInt         y;\n    FT_Int          xstr, ystr;\n\n\n    if ( !library )\n      return FT_THROW( Invalid_Library_Handle );\n\n    if ( !bitmap || !bitmap->buffer )\n      return FT_THROW( Invalid_Argument );\n\n    if ( ( ( FT_PIX_ROUND( xStrength ) >> 6 ) > FT_INT_MAX ) ||\n         ( ( FT_PIX_ROUND( yStrength ) >> 6 ) > FT_INT_MAX ) )\n      return FT_THROW( Invalid_Argument );\n\n    xstr = (FT_Int)FT_PIX_ROUND( xStrength ) >> 6;\n    ystr = (FT_Int)FT_PIX_ROUND( yStrength ) >> 6;\n\n    if ( xstr == 0 && ystr == 0 )\n      return FT_Err_Ok;\n    else if ( xstr < 0 || ystr < 0 )\n      return FT_THROW( Invalid_Argument );\n\n    switch ( bitmap->pixel_mode )\n    {\n    case FT_PIXEL_MODE_GRAY2:\n    case FT_PIXEL_MODE_GRAY4:\n      {\n        FT_Bitmap  tmp;\n\n\n        /* convert to 8bpp */\n        FT_Bitmap_New( &tmp );\n        error = FT_Bitmap_Convert( library, bitmap, &tmp, 1 );\n        if ( error )\n          return error;\n\n        FT_Bitmap_Done( library, bitmap );\n        *bitmap = tmp;\n      }\n      break;\n\n    case FT_PIXEL_MODE_MONO:\n      if ( xstr > 8 )\n        xstr = 8;\n      break;\n\n    case FT_PIXEL_MODE_LCD:\n      xstr *= 3;\n      break;\n\n    case FT_PIXEL_MODE_LCD_V:\n      ystr *= 3;\n      break;\n\n    case FT_PIXEL_MODE_BGRA:\n      /* We don't embolden color glyphs. */\n      return FT_Err_Ok;\n    }\n\n    error = ft_bitmap_assure_buffer( library->memory, bitmap, xstr, ystr );\n    if ( error )\n      return error;\n\n    /* take care of bitmap flow */\n    pitch = bitmap->pitch;\n    if ( pitch > 0 )\n      p = bitmap->buffer + pitch * ystr;\n    else\n    {\n      pitch = -pitch;\n      p = bitmap->buffer + pitch * ( bitmap->rows - 1 );\n    }\n\n    /* for each row */\n    for ( y = 0; y < bitmap->rows ; y++ )\n    {\n      /*\n       * Horizontally:\n       *\n       * From the last pixel on, make each pixel or'ed with the\n       * `xstr' pixels before it.\n       */\n      for ( x = pitch - 1; x >= 0; x-- )\n      {\n        unsigned char  tmp;\n\n\n        tmp = p[x];\n        for ( i = 1; i <= xstr; i++ )\n        {\n          if ( bitmap->pixel_mode == FT_PIXEL_MODE_MONO )\n          {\n            p[x] |= tmp >> i;\n\n            /* the maximum value of 8 for `xstr' comes from here */\n            if ( x > 0 )\n              p[x] |= p[x - 1] << ( 8 - i );\n\n#if 0\n            if ( p[x] == 0xFF )\n              break;\n#endif\n          }\n          else\n          {\n            if ( x - i >= 0 )\n            {\n              if ( p[x] + p[x - i] > bitmap->num_grays - 1 )\n              {\n                p[x] = (unsigned char)( bitmap->num_grays - 1 );\n                break;\n              }\n              else\n              {\n                p[x] = (unsigned char)( p[x] + p[x - i] );\n                if ( p[x] == bitmap->num_grays - 1 )\n                  break;\n              }\n            }\n            else\n              break;\n          }\n        }\n      }\n\n      /*\n       * Vertically:\n       *\n       * Make the above `ystr' rows or'ed with it.\n       */\n      for ( x = 1; x <= ystr; x++ )\n      {\n        unsigned char*  q;\n\n\n        q = p - bitmap->pitch * x;\n        for ( i = 0; i < pitch; i++ )\n          q[i] |= p[i];\n      }\n\n      p += bitmap->pitch;\n    }\n\n    bitmap->width += xstr;\n    bitmap->rows += ystr;\n\n    return FT_Err_Ok;\n  }\n\n\n  static FT_Byte\n  ft_gray_for_premultiplied_srgb_bgra( const FT_Byte*  bgra )\n  {\n    FT_UInt  a = bgra[3];\n    FT_UInt  l;\n\n\n    /* Short-circuit transparent color to avoid division by zero. */\n    if ( !a )\n      return 0;\n\n    /*\n     * Luminosity for sRGB is defined using ~0.2126,0.7152,0.0722\n     * coefficients for RGB channels *on the linear colors*.\n     * A gamma of 2.2 is fair to assume.  And then, we need to\n     * undo the premultiplication too.\n     *\n     *   http://accessibility.kde.org/hsl-adjusted.php\n     *\n     * We do the computation with integers only, applying a gamma of 2.0.\n     * We guarantee 32-bit arithmetic to avoid overflow but the resulting\n     * luminosity fits into 16 bits.\n     *\n     */\n\n    l = (  4732UL /* 0.0722 * 65536 */ * bgra[0] * bgra[0] +\n          46871UL /* 0.7152 * 65536 */ * bgra[1] * bgra[1] +\n          13933UL /* 0.2126 * 65536 */ * bgra[2] * bgra[2] ) >> 16;\n\n    /*\n     * Final transparency can be determined as follows.\n     *\n     * - If alpha is zero, we want 0.\n     * - If alpha is zero and luminosity is zero, we want 255.\n     * - If alpha is zero and luminosity is one, we want 0.\n     *\n     * So the formula is a * (1 - l) = a - l * a.\n     *\n     * We still need to undo premultiplication by dividing l by a*a.\n     *\n     */\n\n    return (FT_Byte)( a - l / a );\n  }\n\n\n  /* documentation is in ftbitmap.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Bitmap_Convert( FT_Library        library,\n                     const FT_Bitmap  *source,\n                     FT_Bitmap        *target,\n                     FT_Int            alignment )\n  {\n    FT_Error   error = FT_Err_Ok;\n    FT_Memory  memory;\n\n    FT_Byte*  s;\n    FT_Byte*  t;\n\n\n    if ( !library )\n      return FT_THROW( Invalid_Library_Handle );\n\n    if ( !source || !target )\n      return FT_THROW( Invalid_Argument );\n\n    memory = library->memory;\n\n    switch ( source->pixel_mode )\n    {\n    case FT_PIXEL_MODE_MONO:\n    case FT_PIXEL_MODE_GRAY:\n    case FT_PIXEL_MODE_GRAY2:\n    case FT_PIXEL_MODE_GRAY4:\n    case FT_PIXEL_MODE_LCD:\n    case FT_PIXEL_MODE_LCD_V:\n    case FT_PIXEL_MODE_BGRA:\n      {\n        FT_Int    pad, old_target_pitch, target_pitch;\n        FT_ULong  old_size;\n\n\n        old_target_pitch = target->pitch;\n        if ( old_target_pitch < 0 )\n          old_target_pitch = -old_target_pitch;\n\n        old_size = target->rows * old_target_pitch;\n\n        target->pixel_mode = FT_PIXEL_MODE_GRAY;\n        target->rows       = source->rows;\n        target->width      = source->width;\n\n        pad = 0;\n        if ( alignment > 0 )\n        {\n          pad = source->width % alignment;\n          if ( pad != 0 )\n            pad = alignment - pad;\n        }\n\n        target_pitch = source->width + pad;\n\n        if ( target_pitch > 0                                     &&\n             (FT_ULong)target->rows > FT_ULONG_MAX / target_pitch )\n          return FT_THROW( Invalid_Argument );\n\n        if ( target->rows * target_pitch > old_size               &&\n             FT_QREALLOC( target->buffer,\n                          old_size, target->rows * target_pitch ) )\n          return error;\n\n        target->pitch = target->pitch < 0 ? -target_pitch : target_pitch;\n      }\n      break;\n\n    default:\n      error = FT_THROW( Invalid_Argument );\n    }\n\n    s = source->buffer;\n    t = target->buffer;\n\n    /* take care of bitmap flow */\n    if ( source->pitch < 0 )\n      s -= source->pitch * ( source->rows - 1 );\n    if ( target->pitch < 0 )\n      t -= target->pitch * ( target->rows - 1 );\n\n    switch ( source->pixel_mode )\n    {\n    case FT_PIXEL_MODE_MONO:\n      {\n        FT_UInt  i;\n\n\n        target->num_grays = 2;\n\n        for ( i = source->rows; i > 0; i-- )\n        {\n          FT_Byte*  ss = s;\n          FT_Byte*  tt = t;\n          FT_UInt   j;\n\n\n          /* get the full bytes */\n          for ( j = source->width >> 3; j > 0; j-- )\n          {\n            FT_Int  val = ss[0]; /* avoid a byte->int cast on each line */\n\n\n            tt[0] = (FT_Byte)( ( val & 0x80 ) >> 7 );\n            tt[1] = (FT_Byte)( ( val & 0x40 ) >> 6 );\n            tt[2] = (FT_Byte)( ( val & 0x20 ) >> 5 );\n            tt[3] = (FT_Byte)( ( val & 0x10 ) >> 4 );\n            tt[4] = (FT_Byte)( ( val & 0x08 ) >> 3 );\n            tt[5] = (FT_Byte)( ( val & 0x04 ) >> 2 );\n            tt[6] = (FT_Byte)( ( val & 0x02 ) >> 1 );\n            tt[7] = (FT_Byte)(   val & 0x01 );\n\n            tt += 8;\n            ss += 1;\n          }\n\n          /* get remaining pixels (if any) */\n          j = source->width & 7;\n          if ( j > 0 )\n          {\n            FT_Int  val = *ss;\n\n\n            for ( ; j > 0; j-- )\n            {\n              tt[0] = (FT_Byte)( ( val & 0x80 ) >> 7);\n              val <<= 1;\n              tt   += 1;\n            }\n          }\n\n          s += source->pitch;\n          t += target->pitch;\n        }\n      }\n      break;\n\n\n    case FT_PIXEL_MODE_GRAY:\n    case FT_PIXEL_MODE_LCD:\n    case FT_PIXEL_MODE_LCD_V:\n      {\n        FT_Int   width = source->width;\n        FT_UInt  i;\n\n\n        target->num_grays = 256;\n\n        for ( i = source->rows; i > 0; i-- )\n        {\n          FT_ARRAY_COPY( t, s, width );\n\n          s += source->pitch;\n          t += target->pitch;\n        }\n      }\n      break;\n\n\n    case FT_PIXEL_MODE_GRAY2:\n      {\n        FT_UInt  i;\n\n\n        target->num_grays = 4;\n\n        for ( i = source->rows; i > 0; i-- )\n        {\n          FT_Byte*  ss = s;\n          FT_Byte*  tt = t;\n          FT_UInt   j;\n\n\n          /* get the full bytes */\n          for ( j = source->width >> 2; j > 0; j-- )\n          {\n            FT_Int  val = ss[0];\n\n\n            tt[0] = (FT_Byte)( ( val & 0xC0 ) >> 6 );\n            tt[1] = (FT_Byte)( ( val & 0x30 ) >> 4 );\n            tt[2] = (FT_Byte)( ( val & 0x0C ) >> 2 );\n            tt[3] = (FT_Byte)( ( val & 0x03 ) );\n\n            ss += 1;\n            tt += 4;\n          }\n\n          j = source->width & 3;\n          if ( j > 0 )\n          {\n            FT_Int  val = ss[0];\n\n\n            for ( ; j > 0; j-- )\n            {\n              tt[0]  = (FT_Byte)( ( val & 0xC0 ) >> 6 );\n              val  <<= 2;\n              tt    += 1;\n            }\n          }\n\n          s += source->pitch;\n          t += target->pitch;\n        }\n      }\n      break;\n\n\n    case FT_PIXEL_MODE_GRAY4:\n      {\n        FT_UInt  i;\n\n\n        target->num_grays = 16;\n\n        for ( i = source->rows; i > 0; i-- )\n        {\n          FT_Byte*  ss = s;\n          FT_Byte*  tt = t;\n          FT_UInt   j;\n\n\n          /* get the full bytes */\n          for ( j = source->width >> 1; j > 0; j-- )\n          {\n            FT_Int  val = ss[0];\n\n\n            tt[0] = (FT_Byte)( ( val & 0xF0 ) >> 4 );\n            tt[1] = (FT_Byte)( ( val & 0x0F ) );\n\n            ss += 1;\n            tt += 2;\n          }\n\n          if ( source->width & 1 )\n            tt[0] = (FT_Byte)( ( ss[0] & 0xF0 ) >> 4 );\n\n          s += source->pitch;\n          t += target->pitch;\n        }\n      }\n      break;\n\n\n    case FT_PIXEL_MODE_BGRA:\n      {\n        FT_UInt  i;\n\n\n        target->num_grays = 256;\n\n        for ( i = source->rows; i > 0; i-- )\n        {\n          FT_Byte*  ss = s;\n          FT_Byte*  tt = t;\n          FT_UInt   j;\n\n\n          for ( j = source->width; j > 0; j-- )\n          {\n            tt[0] = ft_gray_for_premultiplied_srgb_bgra( ss );\n\n            ss += 4;\n            tt += 1;\n          }\n\n          s += source->pitch;\n          t += target->pitch;\n        }\n      }\n      break;\n\n    default:\n      ;\n    }\n\n    return error;\n  }\n\n\n  /* documentation is in ftbitmap.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot  slot )\n  {\n    if ( slot && slot->format == FT_GLYPH_FORMAT_BITMAP   &&\n         !( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) )\n    {\n      FT_Bitmap  bitmap;\n      FT_Error   error;\n\n\n      FT_Bitmap_New( &bitmap );\n      error = FT_Bitmap_Copy( slot->library, &slot->bitmap, &bitmap );\n      if ( error )\n        return error;\n\n      slot->bitmap = bitmap;\n      slot->internal->flags |= FT_GLYPH_OWN_BITMAP;\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n  /* documentation is in ftbitmap.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Bitmap_Done( FT_Library  library,\n                  FT_Bitmap  *bitmap )\n  {\n    FT_Memory  memory;\n\n\n    if ( !library )\n      return FT_THROW( Invalid_Library_Handle );\n\n    if ( !bitmap )\n      return FT_THROW( Invalid_Argument );\n\n    memory = library->memory;\n\n    FT_FREE( bitmap->buffer );\n    *bitmap = null_bitmap;\n\n    return FT_Err_Ok;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftcalc.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcalc.c                                                               */\n/*                                                                         */\n/*    Arithmetic computations (body).                                      */\n/*                                                                         */\n/*  Copyright 1996-2006, 2008, 2012-2014 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Support for 1-complement arithmetic has been totally dropped in this  */\n  /* release.  You can still write your own code if you need it.           */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Implementing basic computation routines.                              */\n  /*                                                                       */\n  /* FT_MulDiv(), FT_MulFix(), FT_DivFix(), FT_RoundFix(), FT_CeilFix(),   */\n  /* and FT_FloorFix() are declared in freetype.h.                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_GLYPH_H\n#include FT_TRIGONOMETRY_H\n#include FT_INTERNAL_CALC_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_OBJECTS_H\n\n\n#ifdef FT_MULFIX_ASSEMBLER\n#undef FT_MulFix\n#endif\n\n/* we need to emulate a 64-bit data type if a real one isn't available */\n\n#ifndef FT_LONG64\n\n  typedef struct  FT_Int64_\n  {\n    FT_UInt32  lo;\n    FT_UInt32  hi;\n\n  } FT_Int64;\n\n#endif /* !FT_LONG64 */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_calc\n\n\n  /* transfer sign leaving a positive number */\n#define FT_MOVE_SIGN( x, s ) \\\n  FT_BEGIN_STMNT             \\\n    if ( x < 0 )             \\\n    {                        \\\n      x = -x;                \\\n      s = -s;                \\\n    }                        \\\n  FT_END_STMNT\n\n  /* The following three functions are available regardless of whether */\n  /* FT_LONG64 is defined.                                             */\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Fixed )\n  FT_RoundFix( FT_Fixed  a )\n  {\n    return a >= 0 ?   ( a + 0x8000L ) & ~0xFFFFL\n                  : -((-a + 0x8000L ) & ~0xFFFFL );\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Fixed )\n  FT_CeilFix( FT_Fixed  a )\n  {\n    return a >= 0 ?   ( a + 0xFFFFL ) & ~0xFFFFL\n                  : -((-a + 0xFFFFL ) & ~0xFFFFL );\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Fixed )\n  FT_FloorFix( FT_Fixed  a )\n  {\n    return a >= 0 ?   a & ~0xFFFFL\n                  : -((-a) & ~0xFFFFL );\n  }\n\n#ifndef FT_MSB\n\n  FT_BASE_DEF ( FT_Int )\n  FT_MSB( FT_UInt32 z )\n  {\n    FT_Int  shift = 0;\n\n\n    /* determine msb bit index in `shift' */\n    if ( z & 0xFFFF0000UL )\n    {\n      z     >>= 16;\n      shift  += 16;\n    }\n    if ( z & 0x0000FF00UL )\n    {\n      z     >>= 8;\n      shift  += 8;\n    }\n    if ( z & 0x000000F0UL )\n    {\n      z     >>= 4;\n      shift  += 4;\n    }\n    if ( z & 0x0000000CUL )\n    {\n      z     >>= 2;\n      shift  += 2;\n    }\n    if ( z & 0x00000002UL )\n    {\n   /* z     >>= 1; */\n      shift  += 1;\n    }\n\n    return shift;\n  }\n\n#endif /* !FT_MSB */\n\n\n  /* documentation is in ftcalc.h */\n\n  FT_BASE_DEF( FT_Fixed )\n  FT_Hypot( FT_Fixed  x,\n            FT_Fixed  y )\n  {\n    FT_Vector  v;\n\n\n    v.x = x;\n    v.y = y;\n\n    return FT_Vector_Length( &v );\n  }\n\n\n#ifdef FT_LONG64\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Long )\n  FT_MulDiv( FT_Long  a,\n             FT_Long  b,\n             FT_Long  c )\n  {\n    FT_Int   s = 1;\n    FT_Long  d;\n\n\n    FT_MOVE_SIGN( a, s );\n    FT_MOVE_SIGN( b, s );\n    FT_MOVE_SIGN( c, s );\n\n    d = (FT_Long)( c > 0 ? ( (FT_Int64)a * b + ( c >> 1 ) ) / c\n                         : 0x7FFFFFFFL );\n\n    return s < 0 ? -d : d;\n  }\n\n\n  /* documentation is in ftcalc.h */\n\n  FT_BASE_DEF( FT_Long )\n  FT_MulDiv_No_Round( FT_Long  a,\n                      FT_Long  b,\n                      FT_Long  c )\n  {\n    FT_Int   s = 1;\n    FT_Long  d;\n\n\n    FT_MOVE_SIGN( a, s );\n    FT_MOVE_SIGN( b, s );\n    FT_MOVE_SIGN( c, s );\n\n    d = (FT_Long)( c > 0 ? (FT_Int64)a * b / c\n                         : 0x7FFFFFFFL );\n\n    return s < 0 ? -d : d;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Long )\n  FT_MulFix( FT_Long  a,\n             FT_Long  b )\n  {\n#ifdef FT_MULFIX_ASSEMBLER\n\n    return FT_MULFIX_ASSEMBLER( a, b );\n\n#else\n\n    FT_Int   s = 1;\n    FT_Long  c;\n\n\n    FT_MOVE_SIGN( a, s );\n    FT_MOVE_SIGN( b, s );\n\n    c = (FT_Long)( ( (FT_Int64)a * b + 0x8000L ) >> 16 );\n\n    return s < 0 ? -c : c;\n\n#endif /* FT_MULFIX_ASSEMBLER */\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Long )\n  FT_DivFix( FT_Long  a,\n             FT_Long  b )\n  {\n    FT_Int   s = 1;\n    FT_Long  q;\n\n\n    FT_MOVE_SIGN( a, s );\n    FT_MOVE_SIGN( b, s );\n\n    q = (FT_Long)( b > 0 ? ( ( (FT_UInt64)a << 16 ) + ( b >> 1 ) ) / b\n                         : 0x7FFFFFFFL );\n\n    return s < 0 ? -q : q;\n  }\n\n\n#else /* !FT_LONG64 */\n\n\n  static void\n  ft_multo64( FT_UInt32  x,\n              FT_UInt32  y,\n              FT_Int64  *z )\n  {\n    FT_UInt32  lo1, hi1, lo2, hi2, lo, hi, i1, i2;\n\n\n    lo1 = x & 0x0000FFFFU;  hi1 = x >> 16;\n    lo2 = y & 0x0000FFFFU;  hi2 = y >> 16;\n\n    lo = lo1 * lo2;\n    i1 = lo1 * hi2;\n    i2 = lo2 * hi1;\n    hi = hi1 * hi2;\n\n    /* Check carry overflow of i1 + i2 */\n    i1 += i2;\n    hi += (FT_UInt32)( i1 < i2 ) << 16;\n\n    hi += i1 >> 16;\n    i1  = i1 << 16;\n\n    /* Check carry overflow of i1 + lo */\n    lo += i1;\n    hi += ( lo < i1 );\n\n    z->lo = lo;\n    z->hi = hi;\n  }\n\n\n  static FT_UInt32\n  ft_div64by32( FT_UInt32  hi,\n                FT_UInt32  lo,\n                FT_UInt32  y )\n  {\n    FT_UInt32  r, q;\n    FT_Int     i;\n\n\n    if ( hi >= y )\n      return (FT_UInt32)0x7FFFFFFFL;\n\n    /* We shift as many bits as we can into the high register, perform     */\n    /* 32-bit division with modulo there, then work through the remaining  */\n    /* bits with long division. This optimization is especially noticeable */\n    /* for smaller dividends that barely use the high register.            */\n\n    i = 31 - FT_MSB( hi );\n    r = ( hi << i ) | ( lo >> ( 32 - i ) ); lo <<= i; /* left 64-bit shift */\n    q = r / y;\n    r -= q * y;   /* remainder */\n\n    i = 32 - i;   /* bits remaining in low register */\n    do\n    {\n      q <<= 1;\n      r   = ( r << 1 ) | ( lo >> 31 ); lo <<= 1;\n\n      if ( r >= y )\n      {\n        r -= y;\n        q |= 1;\n      }\n    } while ( --i );\n\n    return q;\n  }\n\n\n  static void\n  FT_Add64( FT_Int64*  x,\n            FT_Int64*  y,\n            FT_Int64  *z )\n  {\n    FT_UInt32  lo, hi;\n\n\n    lo = x->lo + y->lo;\n    hi = x->hi + y->hi + ( lo < x->lo );\n\n    z->lo = lo;\n    z->hi = hi;\n  }\n\n\n  /*  The FT_MulDiv function has been optimized thanks to ideas from     */\n  /*  Graham Asher and Alexei Podtelezhnikov.  The trick is to optimize  */\n  /*  a rather common case when everything fits within 32-bits.          */\n  /*                                                                     */\n  /*  We compute 'a*b+c/2', then divide it by 'c' (all positive values). */\n  /*                                                                     */\n  /*  The product of two positive numbers never exceeds the square of    */\n  /*  its mean values.  Therefore, we always avoid the overflow by       */\n  /*  imposing                                                           */\n  /*                                                                     */\n  /*    (a + b) / 2 <= sqrt(X - c/2)    ,                                */\n  /*                                                                     */\n  /*  where X = 2^32 - 1, the maximum unsigned 32-bit value, and using   */\n  /*  unsigned arithmetic.  Now we replace `sqrt' with a linear function */\n  /*  that is smaller or equal for all values of c in the interval       */\n  /*  [0;X/2]; it should be equal to sqrt(X) and sqrt(3X/4) at the       */\n  /*  endpoints.  Substituting the linear solution and explicit numbers  */\n  /*  we get                                                             */\n  /*                                                                     */\n  /*    a + b <= 131071.99 - c / 122291.84    .                          */\n  /*                                                                     */\n  /*  In practice, we should use a faster and even stronger inequality   */\n  /*                                                                     */\n  /*    a + b <= 131071 - (c >> 16)                                      */\n  /*                                                                     */\n  /*  or, alternatively,                                                 */\n  /*                                                                     */\n  /*    a + b <= 129894 - (c >> 17)    .                                 */\n  /*                                                                     */\n  /*  FT_MulFix, on the other hand, is optimized for a small value of    */\n  /*  the first argument, when the second argument can be much larger.   */\n  /*  This can be achieved by scaling the second argument and the limit  */\n  /*  in the above inequalities.  For example,                           */\n  /*                                                                     */\n  /*    a + (b >> 8) <= (131071 >> 4)                                    */\n  /*                                                                     */\n  /*  covers the practical range of use. The actual test below is a bit  */\n  /*  tighter to avoid the border case overflows.                        */\n  /*                                                                     */\n  /*  In the case of FT_DivFix, the exact overflow check                 */\n  /*                                                                     */\n  /*    a << 16 <= X - c/2                                               */\n  /*                                                                     */\n  /*  is scaled down by 2^16 and we use                                  */\n  /*                                                                     */\n  /*    a <= 65535 - (c >> 17)    .                                      */\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Long )\n  FT_MulDiv( FT_Long  a,\n             FT_Long  b,\n             FT_Long  c )\n  {\n    FT_Int  s = 1;\n\n\n    /* XXX: this function does not allow 64-bit arguments */\n    if ( a == 0 || b == c )\n      return a;\n\n    FT_MOVE_SIGN( a, s );\n    FT_MOVE_SIGN( b, s );\n    FT_MOVE_SIGN( c, s );\n\n    if ( c == 0 )\n      a = 0x7FFFFFFFL;\n\n    else if ( (FT_ULong)a + b <= 129894UL - ( c >> 17 ) )\n      a = ( (FT_ULong)a * b + ( c >> 1 ) ) / c;\n\n    else\n    {\n      FT_Int64  temp, temp2;\n\n\n      ft_multo64( a, b, &temp );\n\n      temp2.hi = 0;\n      temp2.lo = c >> 1;\n\n      FT_Add64( &temp, &temp2, &temp );\n\n      /* last attempt to ditch long division */\n      a = temp.hi == 0 ? temp.lo / c\n                       : ft_div64by32( temp.hi, temp.lo, c );\n    }\n\n    return s < 0 ? -a : a;\n  }\n\n\n  FT_BASE_DEF( FT_Long )\n  FT_MulDiv_No_Round( FT_Long  a,\n                      FT_Long  b,\n                      FT_Long  c )\n  {\n    FT_Int  s = 1;\n\n\n    if ( a == 0 || b == c )\n      return a;\n\n    FT_MOVE_SIGN( a, s );\n    FT_MOVE_SIGN( b, s );\n    FT_MOVE_SIGN( c, s );\n\n    if ( c == 0 )\n      a = 0x7FFFFFFFL;\n\n    else if ( (FT_ULong)a + b <= 131071UL )\n      a = (FT_ULong)a * b / c;\n\n    else\n    {\n      FT_Int64  temp;\n\n\n      ft_multo64( a, b, &temp );\n\n      /* last attempt to ditch long division */\n      a = temp.hi == 0 ? temp.lo / c\n                       : ft_div64by32( temp.hi, temp.lo, c );\n    }\n\n    return s < 0 ? -a : a;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Long )\n  FT_MulFix( FT_Long  a,\n             FT_Long  b )\n  {\n#ifdef FT_MULFIX_ASSEMBLER\n\n    return FT_MULFIX_ASSEMBLER( a, b );\n\n#elif 0\n\n    /*\n     *  This code is nonportable.  See comment below.\n     *\n     *  However, on a platform where right-shift of a signed quantity fills\n     *  the leftmost bits by copying the sign bit, it might be faster.\n     */\n\n    FT_Long   sa, sb;\n    FT_ULong  ua, ub;\n\n\n    if ( a == 0 || b == 0x10000L )\n      return a;\n\n    /*\n     *  This is a clever way of converting a signed number `a' into its\n     *  absolute value (stored back into `a') and its sign.  The sign is\n     *  stored in `sa'; 0 means `a' was positive or zero, and -1 means `a'\n     *  was negative.  (Similarly for `b' and `sb').\n     *\n     *  Unfortunately, it doesn't work (at least not portably).\n     *\n     *  It makes the assumption that right-shift on a negative signed value\n     *  fills the leftmost bits by copying the sign bit.  This is wrong.\n     *  According to K&R 2nd ed, section `A7.8 Shift Operators' on page 206,\n     *  the result of right-shift of a negative signed value is\n     *  implementation-defined.  At least one implementation fills the\n     *  leftmost bits with 0s (i.e., it is exactly the same as an unsigned\n     *  right shift).  This means that when `a' is negative, `sa' ends up\n     *  with the value 1 rather than -1.  After that, everything else goes\n     *  wrong.\n     */\n    sa = ( a >> ( sizeof ( a ) * 8 - 1 ) );\n    a  = ( a ^ sa ) - sa;\n    sb = ( b >> ( sizeof ( b ) * 8 - 1 ) );\n    b  = ( b ^ sb ) - sb;\n\n    ua = (FT_ULong)a;\n    ub = (FT_ULong)b;\n\n    if ( ua + ( ub >> 8 ) <= 8190UL )\n      ua = ( ua * ub + 0x8000U ) >> 16;\n    else\n    {\n      FT_ULong  al = ua & 0xFFFFU;\n\n\n      ua = ( ua >> 16 ) * ub +  al * ( ub >> 16 ) +\n           ( ( al * ( ub & 0xFFFFU ) + 0x8000U ) >> 16 );\n    }\n\n    sa ^= sb,\n    ua  = (FT_ULong)(( ua ^ sa ) - sa);\n\n    return (FT_Long)ua;\n\n#else /* 0 */\n\n    FT_Int    s = 1;\n    FT_ULong  ua, ub;\n\n\n    if ( a == 0 || b == 0x10000L )\n      return a;\n\n    FT_MOVE_SIGN( a, s );\n    FT_MOVE_SIGN( b, s );\n\n    ua = (FT_ULong)a;\n    ub = (FT_ULong)b;\n\n    if ( ua + ( ub >> 8 ) <= 8190UL )\n      ua = ( ua * ub + 0x8000UL ) >> 16;\n    else\n    {\n      FT_ULong  al = ua & 0xFFFFUL;\n\n\n      ua = ( ua >> 16 ) * ub +  al * ( ub >> 16 ) +\n           ( ( al * ( ub & 0xFFFFUL ) + 0x8000UL ) >> 16 );\n    }\n\n    return s < 0 ? -(FT_Long)ua : (FT_Long)ua;\n\n#endif /* 0 */\n\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Long )\n  FT_DivFix( FT_Long  a,\n             FT_Long  b )\n  {\n    FT_Int   s = 1;\n    FT_Long  q;\n\n\n    /* XXX: this function does not allow 64-bit arguments */\n\n    FT_MOVE_SIGN( a, s );\n    FT_MOVE_SIGN( b, s );\n\n    if ( b == 0 )\n    {\n      /* check for division by 0 */\n      q = 0x7FFFFFFFL;\n    }\n    else if ( a <= 65535L - ( b >> 17 ) )\n    {\n      /* compute result directly */\n      q = (FT_Long)( ( ( (FT_ULong)a << 16 ) + ( b >> 1 ) ) / b );\n    }\n    else\n    {\n      /* we need more bits; we have to do it by hand */\n      FT_Int64  temp, temp2;\n\n\n      temp.hi  = a >> 16;\n      temp.lo  = a << 16;\n      temp2.hi = 0;\n      temp2.lo = b >> 1;\n\n      FT_Add64( &temp, &temp2, &temp );\n      q = (FT_Long)ft_div64by32( temp.hi, temp.lo, b );\n    }\n\n    return s < 0 ? -q : q;\n  }\n\n\n#endif /* FT_LONG64 */\n\n\n  /* documentation is in ftglyph.h */\n\n  FT_EXPORT_DEF( void )\n  FT_Matrix_Multiply( const FT_Matrix*  a,\n                      FT_Matrix        *b )\n  {\n    FT_Fixed  xx, xy, yx, yy;\n\n\n    if ( !a || !b )\n      return;\n\n    xx = FT_MulFix( a->xx, b->xx ) + FT_MulFix( a->xy, b->yx );\n    xy = FT_MulFix( a->xx, b->xy ) + FT_MulFix( a->xy, b->yy );\n    yx = FT_MulFix( a->yx, b->xx ) + FT_MulFix( a->yy, b->yx );\n    yy = FT_MulFix( a->yx, b->xy ) + FT_MulFix( a->yy, b->yy );\n\n    b->xx = xx;  b->xy = xy;\n    b->yx = yx;  b->yy = yy;\n  }\n\n\n  /* documentation is in ftglyph.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Matrix_Invert( FT_Matrix*  matrix )\n  {\n    FT_Pos  delta, xx, yy;\n\n\n    if ( !matrix )\n      return FT_THROW( Invalid_Argument );\n\n    /* compute discriminant */\n    delta = FT_MulFix( matrix->xx, matrix->yy ) -\n            FT_MulFix( matrix->xy, matrix->yx );\n\n    if ( !delta )\n      return FT_THROW( Invalid_Argument );  /* matrix can't be inverted */\n\n    matrix->xy = - FT_DivFix( matrix->xy, delta );\n    matrix->yx = - FT_DivFix( matrix->yx, delta );\n\n    xx = matrix->xx;\n    yy = matrix->yy;\n\n    matrix->xx = FT_DivFix( yy, delta );\n    matrix->yy = FT_DivFix( xx, delta );\n\n    return FT_Err_Ok;\n  }\n\n\n  /* documentation is in ftcalc.h */\n\n  FT_BASE_DEF( void )\n  FT_Matrix_Multiply_Scaled( const FT_Matrix*  a,\n                             FT_Matrix        *b,\n                             FT_Long           scaling )\n  {\n    FT_Fixed  xx, xy, yx, yy;\n\n    FT_Long   val = 0x10000L * scaling;\n\n\n    if ( !a || !b )\n      return;\n\n    xx = FT_MulDiv( a->xx, b->xx, val ) + FT_MulDiv( a->xy, b->yx, val );\n    xy = FT_MulDiv( a->xx, b->xy, val ) + FT_MulDiv( a->xy, b->yy, val );\n    yx = FT_MulDiv( a->yx, b->xx, val ) + FT_MulDiv( a->yy, b->yx, val );\n    yy = FT_MulDiv( a->yx, b->xy, val ) + FT_MulDiv( a->yy, b->yy, val );\n\n    b->xx = xx;  b->xy = xy;\n    b->yx = yx;  b->yy = yy;\n  }\n\n\n  /* documentation is in ftcalc.h */\n\n  FT_BASE_DEF( void )\n  FT_Vector_Transform_Scaled( FT_Vector*        vector,\n                              const FT_Matrix*  matrix,\n                              FT_Long           scaling )\n  {\n    FT_Pos   xz, yz;\n\n    FT_Long  val = 0x10000L * scaling;\n\n\n    if ( !vector || !matrix )\n      return;\n\n    xz = FT_MulDiv( vector->x, matrix->xx, val ) +\n         FT_MulDiv( vector->y, matrix->xy, val );\n\n    yz = FT_MulDiv( vector->x, matrix->yx, val ) +\n         FT_MulDiv( vector->y, matrix->yy, val );\n\n    vector->x = xz;\n    vector->y = yz;\n  }\n\n\n#if 0\n\n  /* documentation is in ftcalc.h */\n\n  FT_BASE_DEF( FT_Int32 )\n  FT_SqrtFixed( FT_Int32  x )\n  {\n    FT_UInt32  root, rem_hi, rem_lo, test_div;\n    FT_Int     count;\n\n\n    root = 0;\n\n    if ( x > 0 )\n    {\n      rem_hi = 0;\n      rem_lo = x;\n      count  = 24;\n      do\n      {\n        rem_hi   = ( rem_hi << 2 ) | ( rem_lo >> 30 );\n        rem_lo <<= 2;\n        root   <<= 1;\n        test_div = ( root << 1 ) + 1;\n\n        if ( rem_hi >= test_div )\n        {\n          rem_hi -= test_div;\n          root   += 1;\n        }\n      } while ( --count );\n    }\n\n    return (FT_Int32)root;\n  }\n\n#endif /* 0 */\n\n\n  /* documentation is in ftcalc.h */\n\n  FT_BASE_DEF( FT_Int )\n  ft_corner_orientation( FT_Pos  in_x,\n                         FT_Pos  in_y,\n                         FT_Pos  out_x,\n                         FT_Pos  out_y )\n  {\n    FT_Long  result; /* avoid overflow on 16-bit system */\n\n\n    /* deal with the trivial cases quickly */\n    if ( in_y == 0 )\n    {\n      if ( in_x >= 0 )\n        result = out_y;\n      else\n        result = -out_y;\n    }\n    else if ( in_x == 0 )\n    {\n      if ( in_y >= 0 )\n        result = -out_x;\n      else\n        result = out_x;\n    }\n    else if ( out_y == 0 )\n    {\n      if ( out_x >= 0 )\n        result = in_y;\n      else\n        result = -in_y;\n    }\n    else if ( out_x == 0 )\n    {\n      if ( out_y >= 0 )\n        result = -in_x;\n      else\n        result =  in_x;\n    }\n    else /* general case */\n    {\n#ifdef FT_LONG64\n\n      FT_Int64  delta = (FT_Int64)in_x * out_y - (FT_Int64)in_y * out_x;\n\n\n      if ( delta == 0 )\n        result = 0;\n      else\n        result = 1 - 2 * ( delta < 0 );\n\n#else\n\n      FT_Int64  z1, z2;\n\n\n      /* XXX: this function does not allow 64-bit arguments */\n      ft_multo64( (FT_Int32)in_x, (FT_Int32)out_y, &z1 );\n      ft_multo64( (FT_Int32)in_y, (FT_Int32)out_x, &z2 );\n\n      if ( z1.hi > z2.hi )\n        result = +1;\n      else if ( z1.hi < z2.hi )\n        result = -1;\n      else if ( z1.lo > z2.lo )\n        result = +1;\n      else if ( z1.lo < z2.lo )\n        result = -1;\n      else\n        result = 0;\n\n#endif\n    }\n\n    /* XXX: only the sign of return value, +1/0/-1 must be used */\n    return (FT_Int)result;\n  }\n\n\n  /* documentation is in ftcalc.h */\n\n  FT_BASE_DEF( FT_Int )\n  ft_corner_is_flat( FT_Pos  in_x,\n                     FT_Pos  in_y,\n                     FT_Pos  out_x,\n                     FT_Pos  out_y )\n  {\n    FT_Pos  ax = in_x + out_x;\n    FT_Pos  ay = in_y + out_y;\n\n    FT_Pos  d_in, d_out, d_hypot;\n\n\n    /* The idea of this function is to compare the length of the */\n    /* hypotenuse with the `in' and `out' length.  The `corner'  */\n    /* represented by `in' and `out' is flat if the hypotenuse's */\n    /* length isn't too large.                                   */\n    /*                                                           */\n    /* This approach has the advantage that the angle between    */\n    /* `in' and `out' is not checked.  In case one of the two    */\n    /* vectors is `dominant', this is, much larger than the      */\n    /* other vector, we thus always have a flat corner.          */\n    /*                                                           */\n    /*                hypotenuse                                 */\n    /*       x---------------------------x                       */\n    /*        \\                      /                           */\n    /*         \\                /                                */\n    /*      in  \\          /  out                                */\n    /*           \\    /                                          */\n    /*            o                                              */\n    /*              Point                                        */\n\n    d_in    = FT_HYPOT(  in_x,  in_y );\n    d_out   = FT_HYPOT( out_x, out_y );\n    d_hypot = FT_HYPOT(    ax,    ay );\n\n    /* now do a simple length comparison: */\n    /*                                    */\n    /*   d_in + d_out < 17/16 d_hypot     */\n\n    return ( d_in + d_out - d_hypot ) < ( d_hypot >> 4 );\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftcid.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcid.c                                                                */\n/*                                                                         */\n/*    FreeType API for accessing CID font information.                     */\n/*                                                                         */\n/*  Copyright 2007, 2009, 2013 by Derek Clegg, Michael Toftdal.            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_CID_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_SERVICE_CID_H\n\n\n  /* documentation is in ftcid.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Get_CID_Registry_Ordering_Supplement( FT_Face       face,\n                                           const char*  *registry,\n                                           const char*  *ordering,\n                                           FT_Int       *supplement)\n  {\n    FT_Error     error;\n    const char*  r = NULL;\n    const char*  o = NULL;\n    FT_Int       s = 0;\n\n\n    error = FT_ERR( Invalid_Argument );\n\n    if ( face )\n    {\n      FT_Service_CID  service;\n\n\n      FT_FACE_FIND_SERVICE( face, service, CID );\n\n      if ( service && service->get_ros )\n        error = service->get_ros( face, &r, &o, &s );\n    }\n\n    if ( registry )\n      *registry = r;\n\n    if ( ordering )\n      *ordering = o;\n\n    if ( supplement )\n      *supplement = s;\n\n    return error;\n  }\n\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Get_CID_Is_Internally_CID_Keyed( FT_Face   face,\n                                      FT_Bool  *is_cid )\n  {\n    FT_Error  error = FT_ERR( Invalid_Argument );\n    FT_Bool   ic = 0;\n\n\n    if ( face )\n    {\n      FT_Service_CID  service;\n\n\n      FT_FACE_FIND_SERVICE( face, service, CID );\n\n      if ( service && service->get_is_cid )\n        error = service->get_is_cid( face, &ic);\n    }\n\n    if ( is_cid )\n      *is_cid = ic;\n\n    return error;\n  }\n\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Get_CID_From_Glyph_Index( FT_Face   face,\n                               FT_UInt   glyph_index,\n                               FT_UInt  *cid )\n  {\n    FT_Error  error = FT_ERR( Invalid_Argument );\n    FT_UInt   c = 0;\n\n\n    if ( face )\n    {\n      FT_Service_CID  service;\n\n\n      FT_FACE_FIND_SERVICE( face, service, CID );\n\n      if ( service && service->get_cid_from_glyph_index )\n        error = service->get_cid_from_glyph_index( face, glyph_index, &c);\n    }\n\n    if ( cid )\n      *cid = c;\n\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftdbgmem.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftdbgmem.c                                                             */\n/*                                                                         */\n/*    Memory debugger (body).                                              */\n/*                                                                         */\n/*  Copyright 2001-2006, 2009, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_MEMORY_H\n#include FT_SYSTEM_H\n#include FT_ERRORS_H\n#include FT_TYPES_H\n\n\n#ifdef FT_DEBUG_MEMORY\n\n#define  KEEPALIVE /* `Keep alive' means that freed blocks aren't released\n                    * to the heap.  This is useful to detect double-frees\n                    * or weird heap corruption, but it uses large amounts of\n                    * memory, however.\n                    */\n\n#include FT_CONFIG_STANDARD_LIBRARY_H\n\n  FT_BASE_DEF( const char* )  _ft_debug_file   = 0;\n  FT_BASE_DEF( long )         _ft_debug_lineno = 0;\n\n  extern void\n  FT_DumpMemory( FT_Memory  memory );\n\n\n  typedef struct FT_MemSourceRec_*  FT_MemSource;\n  typedef struct FT_MemNodeRec_*    FT_MemNode;\n  typedef struct FT_MemTableRec_*   FT_MemTable;\n\n\n#define FT_MEM_VAL( addr )  ((FT_PtrDist)(FT_Pointer)( addr ))\n\n  /*\n   *  This structure holds statistics for a single allocation/release\n   *  site.  This is useful to know where memory operations happen the\n   *  most.\n   */\n  typedef struct  FT_MemSourceRec_\n  {\n    const char*   file_name;\n    long          line_no;\n\n    FT_Long       cur_blocks;   /* current number of allocated blocks */\n    FT_Long       max_blocks;   /* max. number of allocated blocks    */\n    FT_Long       all_blocks;   /* total number of blocks allocated   */\n\n    FT_Long       cur_size;     /* current cumulative allocated size */\n    FT_Long       max_size;     /* maximum cumulative allocated size */\n    FT_Long       all_size;     /* total cumulative allocated size   */\n\n    FT_Long       cur_max;      /* current maximum allocated size */\n\n    FT_UInt32     hash;\n    FT_MemSource  link;\n\n  } FT_MemSourceRec;\n\n\n  /*\n   *  We don't need a resizable array for the memory sources, because\n   *  their number is pretty limited within FreeType.\n   */\n#define FT_MEM_SOURCE_BUCKETS  128\n\n  /*\n   *  This structure holds information related to a single allocated\n   *  memory block.  If KEEPALIVE is defined, blocks that are freed by\n   *  FreeType are never released to the system.  Instead, their `size'\n   *  field is set to -size.  This is mainly useful to detect double frees,\n   *  at the price of large memory footprint during execution.\n   */\n  typedef struct  FT_MemNodeRec_\n  {\n    FT_Byte*      address;\n    FT_Long       size;     /* < 0 if the block was freed */\n\n    FT_MemSource  source;\n\n#ifdef KEEPALIVE\n    const char*   free_file_name;\n    FT_Long       free_line_no;\n#endif\n\n    FT_MemNode    link;\n\n  } FT_MemNodeRec;\n\n\n  /*\n   *  The global structure, containing compound statistics and all hash\n   *  tables.\n   */\n  typedef struct  FT_MemTableRec_\n  {\n    FT_ULong         size;\n    FT_ULong         nodes;\n    FT_MemNode*      buckets;\n\n    FT_ULong         alloc_total;\n    FT_ULong         alloc_current;\n    FT_ULong         alloc_max;\n    FT_ULong         alloc_count;\n\n    FT_Bool          bound_total;\n    FT_ULong         alloc_total_max;\n\n    FT_Bool          bound_count;\n    FT_ULong         alloc_count_max;\n\n    FT_MemSource     sources[FT_MEM_SOURCE_BUCKETS];\n\n    FT_Bool          keep_alive;\n\n    FT_Memory        memory;\n    FT_Pointer       memory_user;\n    FT_Alloc_Func    alloc;\n    FT_Free_Func     free;\n    FT_Realloc_Func  realloc;\n\n  } FT_MemTableRec;\n\n\n#define FT_MEM_SIZE_MIN  7\n#define FT_MEM_SIZE_MAX  13845163\n\n#define FT_FILENAME( x )  ((x) ? (x) : \"unknown file\")\n\n\n  /*\n   *  Prime numbers are ugly to handle.  It would be better to implement\n   *  L-Hashing, which is 10% faster and doesn't require divisions.\n   */\n  static const FT_UInt  ft_mem_primes[] =\n  {\n    7,\n    11,\n    19,\n    37,\n    73,\n    109,\n    163,\n    251,\n    367,\n    557,\n    823,\n    1237,\n    1861,\n    2777,\n    4177,\n    6247,\n    9371,\n    14057,\n    21089,\n    31627,\n    47431,\n    71143,\n    106721,\n    160073,\n    240101,\n    360163,\n    540217,\n    810343,\n    1215497,\n    1823231,\n    2734867,\n    4102283,\n    6153409,\n    9230113,\n    13845163,\n  };\n\n\n  static FT_ULong\n  ft_mem_closest_prime( FT_ULong  num )\n  {\n    FT_UInt  i;\n\n\n    for ( i = 0;\n          i < sizeof ( ft_mem_primes ) / sizeof ( ft_mem_primes[0] ); i++ )\n      if ( ft_mem_primes[i] > num )\n        return ft_mem_primes[i];\n\n    return FT_MEM_SIZE_MAX;\n  }\n\n\n  extern void\n  ft_mem_debug_panic( const char*  fmt,\n                      ... )\n  {\n    va_list  ap;\n\n\n    printf( \"FreeType.Debug: \" );\n\n    va_start( ap, fmt );\n    vprintf( fmt, ap );\n    va_end( ap );\n\n    printf( \"\\n\" );\n    exit( EXIT_FAILURE );\n  }\n\n\n  static FT_Pointer\n  ft_mem_table_alloc( FT_MemTable  table,\n                      FT_Long      size )\n  {\n    FT_Memory   memory = table->memory;\n    FT_Pointer  block;\n\n\n    memory->user = table->memory_user;\n    block = table->alloc( memory, size );\n    memory->user = table;\n\n    return block;\n  }\n\n\n  static void\n  ft_mem_table_free( FT_MemTable  table,\n                     FT_Pointer   block )\n  {\n    FT_Memory  memory = table->memory;\n\n\n    memory->user = table->memory_user;\n    table->free( memory, block );\n    memory->user = table;\n  }\n\n\n  static void\n  ft_mem_table_resize( FT_MemTable  table )\n  {\n    FT_ULong  new_size;\n\n\n    new_size = ft_mem_closest_prime( table->nodes );\n    if ( new_size != table->size )\n    {\n      FT_MemNode*  new_buckets;\n      FT_ULong     i;\n\n\n      new_buckets = (FT_MemNode *)\n                      ft_mem_table_alloc( table,\n                                          new_size * sizeof ( FT_MemNode ) );\n      if ( new_buckets == NULL )\n        return;\n\n      FT_ARRAY_ZERO( new_buckets, new_size );\n\n      for ( i = 0; i < table->size; i++ )\n      {\n        FT_MemNode  node, next, *pnode;\n        FT_PtrDist  hash;\n\n\n        node = table->buckets[i];\n        while ( node )\n        {\n          next  = node->link;\n          hash  = FT_MEM_VAL( node->address ) % new_size;\n          pnode = new_buckets + hash;\n\n          node->link = pnode[0];\n          pnode[0]   = node;\n\n          node = next;\n        }\n      }\n\n      if ( table->buckets )\n        ft_mem_table_free( table, table->buckets );\n\n      table->buckets = new_buckets;\n      table->size    = new_size;\n    }\n  }\n\n\n  static FT_MemTable\n  ft_mem_table_new( FT_Memory  memory )\n  {\n    FT_MemTable  table;\n\n\n    table = (FT_MemTable)memory->alloc( memory, sizeof ( *table ) );\n    if ( table == NULL )\n      goto Exit;\n\n    FT_ZERO( table );\n\n    table->size  = FT_MEM_SIZE_MIN;\n    table->nodes = 0;\n\n    table->memory = memory;\n\n    table->memory_user = memory->user;\n\n    table->alloc   = memory->alloc;\n    table->realloc = memory->realloc;\n    table->free    = memory->free;\n\n    table->buckets = (FT_MemNode *)\n                       memory->alloc( memory,\n                                      table->size * sizeof ( FT_MemNode ) );\n    if ( table->buckets )\n      FT_ARRAY_ZERO( table->buckets, table->size );\n    else\n    {\n      memory->free( memory, table );\n      table = NULL;\n    }\n\n  Exit:\n    return table;\n  }\n\n\n  static void\n  ft_mem_table_destroy( FT_MemTable  table )\n  {\n    FT_ULong  i;\n    FT_Long   leak_count = 0;\n    FT_ULong  leaks      = 0;\n\n\n    FT_DumpMemory( table->memory );\n\n    /* remove all blocks from the table, revealing leaked ones */\n    for ( i = 0; i < table->size; i++ )\n    {\n      FT_MemNode  *pnode = table->buckets + i, next, node = *pnode;\n\n\n      while ( node )\n      {\n        next       = node->link;\n        node->link = 0;\n\n        if ( node->size > 0 )\n        {\n          printf(\n            \"leaked memory block at address %p, size %8ld in (%s:%ld)\\n\",\n            node->address, node->size,\n            FT_FILENAME( node->source->file_name ),\n            node->source->line_no );\n\n          leak_count++;\n          leaks += node->size;\n\n          ft_mem_table_free( table, node->address );\n        }\n\n        node->address = NULL;\n        node->size    = 0;\n\n        ft_mem_table_free( table, node );\n        node = next;\n      }\n      table->buckets[i] = 0;\n    }\n\n    ft_mem_table_free( table, table->buckets );\n    table->buckets = NULL;\n\n    table->size  = 0;\n    table->nodes = 0;\n\n    /* remove all sources */\n    for ( i = 0; i < FT_MEM_SOURCE_BUCKETS; i++ )\n    {\n      FT_MemSource  source, next;\n\n\n      for ( source = table->sources[i]; source != NULL; source = next )\n      {\n        next = source->link;\n        ft_mem_table_free( table, source );\n      }\n\n      table->sources[i] = NULL;\n    }\n\n    printf( \"FreeType: total memory allocations = %ld\\n\",\n            table->alloc_total );\n    printf( \"FreeType: maximum memory footprint = %ld\\n\",\n            table->alloc_max );\n\n    ft_mem_table_free( table, table );\n\n    if ( leak_count > 0 )\n      ft_mem_debug_panic(\n        \"FreeType: %ld bytes of memory leaked in %ld blocks\\n\",\n        leaks, leak_count );\n\n    printf( \"FreeType: no memory leaks detected\\n\" );\n  }\n\n\n  static FT_MemNode*\n  ft_mem_table_get_nodep( FT_MemTable  table,\n                          FT_Byte*     address )\n  {\n    FT_PtrDist   hash;\n    FT_MemNode  *pnode, node;\n\n\n    hash  = FT_MEM_VAL( address );\n    pnode = table->buckets + ( hash % table->size );\n\n    for (;;)\n    {\n      node = pnode[0];\n      if ( !node )\n        break;\n\n      if ( node->address == address )\n        break;\n\n      pnode = &node->link;\n    }\n    return pnode;\n  }\n\n\n  static FT_MemSource\n  ft_mem_table_get_source( FT_MemTable  table )\n  {\n    FT_UInt32     hash;\n    FT_MemSource  node, *pnode;\n\n\n    /* cast to FT_PtrDist first since void* can be larger */\n    /* than FT_UInt32 and GCC 4.1.1 emits a warning       */\n    hash  = (FT_UInt32)(FT_PtrDist)(void*)_ft_debug_file +\n              (FT_UInt32)( 5 * _ft_debug_lineno );\n    pnode = &table->sources[hash % FT_MEM_SOURCE_BUCKETS];\n\n    for ( ;; )\n    {\n      node = *pnode;\n      if ( node == NULL )\n        break;\n\n      if ( node->file_name == _ft_debug_file &&\n           node->line_no   == _ft_debug_lineno   )\n        goto Exit;\n\n      pnode = &node->link;\n    }\n\n    node = (FT_MemSource)ft_mem_table_alloc( table, sizeof ( *node ) );\n    if ( node == NULL )\n      ft_mem_debug_panic(\n        \"not enough memory to perform memory debugging\\n\" );\n\n    node->file_name = _ft_debug_file;\n    node->line_no   = _ft_debug_lineno;\n\n    node->cur_blocks = 0;\n    node->max_blocks = 0;\n    node->all_blocks = 0;\n\n    node->cur_size   = 0;\n    node->max_size   = 0;\n    node->all_size   = 0;\n\n    node->cur_max    = 0;\n\n    node->link = NULL;\n    node->hash = hash;\n    *pnode     = node;\n\n  Exit:\n    return node;\n  }\n\n\n  static void\n  ft_mem_table_set( FT_MemTable  table,\n                    FT_Byte*     address,\n                    FT_ULong     size,\n                    FT_Long      delta )\n  {\n    FT_MemNode  *pnode, node;\n\n\n    if ( table )\n    {\n      FT_MemSource  source;\n\n\n      pnode = ft_mem_table_get_nodep( table, address );\n      node  = *pnode;\n      if ( node )\n      {\n        if ( node->size < 0 )\n        {\n          /* This block was already freed.  Our memory is now completely */\n          /* corrupted!                                                  */\n          /* This can only happen in keep-alive mode.                    */\n          ft_mem_debug_panic(\n            \"memory heap corrupted (allocating freed block)\" );\n        }\n        else\n        {\n          /* This block was already allocated.  This means that our memory */\n          /* is also corrupted!                                            */\n          ft_mem_debug_panic(\n            \"memory heap corrupted (re-allocating allocated block at\"\n            \" %p, of size %ld)\\n\"\n            \"org=%s:%d new=%s:%d\\n\",\n            node->address, node->size,\n            FT_FILENAME( node->source->file_name ), node->source->line_no,\n            FT_FILENAME( _ft_debug_file ), _ft_debug_lineno );\n        }\n      }\n\n      /* we need to create a new node in this table */\n      node = (FT_MemNode)ft_mem_table_alloc( table, sizeof ( *node ) );\n      if ( node == NULL )\n        ft_mem_debug_panic( \"not enough memory to run memory tests\" );\n\n      node->address = address;\n      node->size    = size;\n      node->source  = source = ft_mem_table_get_source( table );\n\n      if ( delta == 0 )\n      {\n        /* this is an allocation */\n        source->all_blocks++;\n        source->cur_blocks++;\n        if ( source->cur_blocks > source->max_blocks )\n          source->max_blocks = source->cur_blocks;\n      }\n\n      if ( size > (FT_ULong)source->cur_max )\n        source->cur_max = size;\n\n      if ( delta != 0 )\n      {\n        /* we are growing or shrinking a reallocated block */\n        source->cur_size     += delta;\n        table->alloc_current += delta;\n      }\n      else\n      {\n        /* we are allocating a new block */\n        source->cur_size     += size;\n        table->alloc_current += size;\n      }\n\n      source->all_size += size;\n\n      if ( source->cur_size > source->max_size )\n        source->max_size = source->cur_size;\n\n      node->free_file_name = NULL;\n      node->free_line_no   = 0;\n\n      node->link = pnode[0];\n\n      pnode[0] = node;\n      table->nodes++;\n\n      table->alloc_total += size;\n\n      if ( table->alloc_current > table->alloc_max )\n        table->alloc_max = table->alloc_current;\n\n      if ( table->nodes * 3 < table->size  ||\n           table->size  * 3 < table->nodes )\n        ft_mem_table_resize( table );\n    }\n  }\n\n\n  static void\n  ft_mem_table_remove( FT_MemTable  table,\n                       FT_Byte*     address,\n                       FT_Long      delta )\n  {\n    if ( table )\n    {\n      FT_MemNode  *pnode, node;\n\n\n      pnode = ft_mem_table_get_nodep( table, address );\n      node  = *pnode;\n      if ( node )\n      {\n        FT_MemSource  source;\n\n\n        if ( node->size < 0 )\n          ft_mem_debug_panic(\n            \"freeing memory block at %p more than once at (%s:%ld)\\n\"\n            \"block allocated at (%s:%ld) and released at (%s:%ld)\",\n            address,\n            FT_FILENAME( _ft_debug_file ), _ft_debug_lineno,\n            FT_FILENAME( node->source->file_name ), node->source->line_no,\n            FT_FILENAME( node->free_file_name ), node->free_line_no );\n\n        /* scramble the node's content for additional safety */\n        FT_MEM_SET( address, 0xF3, node->size );\n\n        if ( delta == 0 )\n        {\n          source = node->source;\n\n          source->cur_blocks--;\n          source->cur_size -= node->size;\n\n          table->alloc_current -= node->size;\n        }\n\n        if ( table->keep_alive )\n        {\n          /* we simply invert the node's size to indicate that the node */\n          /* was freed.                                                 */\n          node->size           = -node->size;\n          node->free_file_name = _ft_debug_file;\n          node->free_line_no   = _ft_debug_lineno;\n        }\n        else\n        {\n          table->nodes--;\n\n          *pnode = node->link;\n\n          node->size   = 0;\n          node->source = NULL;\n\n          ft_mem_table_free( table, node );\n\n          if ( table->nodes * 3 < table->size  ||\n               table->size  * 3 < table->nodes )\n            ft_mem_table_resize( table );\n        }\n      }\n      else\n        ft_mem_debug_panic(\n          \"trying to free unknown block at %p in (%s:%ld)\\n\",\n          address,\n          FT_FILENAME( _ft_debug_file ), _ft_debug_lineno );\n    }\n  }\n\n\n  extern FT_Pointer\n  ft_mem_debug_alloc( FT_Memory  memory,\n                      FT_Long    size )\n  {\n    FT_MemTable  table = (FT_MemTable)memory->user;\n    FT_Byte*     block;\n\n\n    if ( size <= 0 )\n      ft_mem_debug_panic( \"negative block size allocation (%ld)\", size );\n\n    /* return NULL if the maximum number of allocations was reached */\n    if ( table->bound_count                           &&\n         table->alloc_count >= table->alloc_count_max )\n      return NULL;\n\n    /* return NULL if this allocation would overflow the maximum heap size */\n    if ( table->bound_total                                             &&\n         table->alloc_total_max - table->alloc_current > (FT_ULong)size )\n      return NULL;\n\n    block = (FT_Byte *)ft_mem_table_alloc( table, size );\n    if ( block )\n    {\n      ft_mem_table_set( table, block, (FT_ULong)size, 0 );\n\n      table->alloc_count++;\n    }\n\n    _ft_debug_file   = \"<unknown>\";\n    _ft_debug_lineno = 0;\n\n    return (FT_Pointer)block;\n  }\n\n\n  extern void\n  ft_mem_debug_free( FT_Memory   memory,\n                     FT_Pointer  block )\n  {\n    FT_MemTable  table = (FT_MemTable)memory->user;\n\n\n    if ( block == NULL )\n      ft_mem_debug_panic( \"trying to free NULL in (%s:%ld)\",\n                          FT_FILENAME( _ft_debug_file ),\n                          _ft_debug_lineno );\n\n    ft_mem_table_remove( table, (FT_Byte*)block, 0 );\n\n    if ( !table->keep_alive )\n      ft_mem_table_free( table, block );\n\n    table->alloc_count--;\n\n    _ft_debug_file   = \"<unknown>\";\n    _ft_debug_lineno = 0;\n  }\n\n\n  extern FT_Pointer\n  ft_mem_debug_realloc( FT_Memory   memory,\n                        FT_Long     cur_size,\n                        FT_Long     new_size,\n                        FT_Pointer  block )\n  {\n    FT_MemTable  table = (FT_MemTable)memory->user;\n    FT_MemNode   node, *pnode;\n    FT_Pointer   new_block;\n    FT_Long      delta;\n\n    const char*  file_name = FT_FILENAME( _ft_debug_file );\n    FT_Long      line_no   = _ft_debug_lineno;\n\n\n    /* unlikely, but possible */\n    if ( new_size == cur_size )\n      return block;\n\n    /* the following is valid according to ANSI C */\n#if 0\n    if ( block == NULL || cur_size == 0 )\n      ft_mem_debug_panic( \"trying to reallocate NULL in (%s:%ld)\",\n                          file_name, line_no );\n#endif\n\n    /* while the following is allowed in ANSI C also, we abort since */\n    /* such case should be handled by FreeType.                      */\n    if ( new_size <= 0 )\n      ft_mem_debug_panic(\n        \"trying to reallocate %p to size 0 (current is %ld) in (%s:%ld)\",\n        block, cur_size, file_name, line_no );\n\n    /* check `cur_size' value */\n    pnode = ft_mem_table_get_nodep( table, (FT_Byte*)block );\n    node  = *pnode;\n    if ( !node )\n      ft_mem_debug_panic(\n        \"trying to reallocate unknown block at %p in (%s:%ld)\",\n        block, file_name, line_no );\n\n    if ( node->size <= 0 )\n      ft_mem_debug_panic(\n        \"trying to reallocate freed block at %p in (%s:%ld)\",\n        block, file_name, line_no );\n\n    if ( node->size != cur_size )\n      ft_mem_debug_panic( \"invalid ft_realloc request for %p. cur_size is \"\n                          \"%ld instead of %ld in (%s:%ld)\",\n                          block, cur_size, node->size, file_name, line_no );\n\n    /* return NULL if the maximum number of allocations was reached */\n    if ( table->bound_count                           &&\n         table->alloc_count >= table->alloc_count_max )\n      return NULL;\n\n    delta = (FT_Long)( new_size - cur_size );\n\n    /* return NULL if this allocation would overflow the maximum heap size */\n    if ( delta > 0                                                       &&\n         table->bound_total                                              &&\n         table->alloc_current + (FT_ULong)delta > table->alloc_total_max )\n      return NULL;\n\n    new_block = (FT_Byte *)ft_mem_table_alloc( table, new_size );\n    if ( new_block == NULL )\n      return NULL;\n\n    ft_mem_table_set( table, (FT_Byte*)new_block, new_size, delta );\n\n    ft_memcpy( new_block, block, cur_size < new_size ? cur_size : new_size );\n\n    ft_mem_table_remove( table, (FT_Byte*)block, delta );\n\n    _ft_debug_file   = \"<unknown>\";\n    _ft_debug_lineno = 0;\n\n    if ( !table->keep_alive )\n      ft_mem_table_free( table, block );\n\n    return new_block;\n  }\n\n\n  extern FT_Int\n  ft_mem_debug_init( FT_Memory  memory )\n  {\n    FT_MemTable  table;\n    FT_Int       result = 0;\n\n\n    if ( getenv( \"FT2_DEBUG_MEMORY\" ) )\n    {\n      table = ft_mem_table_new( memory );\n      if ( table )\n      {\n        const char*  p;\n\n\n        memory->user    = table;\n        memory->alloc   = ft_mem_debug_alloc;\n        memory->realloc = ft_mem_debug_realloc;\n        memory->free    = ft_mem_debug_free;\n\n        p = getenv( \"FT2_ALLOC_TOTAL_MAX\" );\n        if ( p != NULL )\n        {\n          FT_Long   total_max = ft_atol( p );\n\n\n          if ( total_max > 0 )\n          {\n            table->bound_total     = 1;\n            table->alloc_total_max = (FT_ULong)total_max;\n          }\n        }\n\n        p = getenv( \"FT2_ALLOC_COUNT_MAX\" );\n        if ( p != NULL )\n        {\n          FT_Long  total_count = ft_atol( p );\n\n\n          if ( total_count > 0 )\n          {\n            table->bound_count     = 1;\n            table->alloc_count_max = (FT_ULong)total_count;\n          }\n        }\n\n        p = getenv( \"FT2_KEEP_ALIVE\" );\n        if ( p != NULL )\n        {\n          FT_Long  keep_alive = ft_atol( p );\n\n\n          if ( keep_alive > 0 )\n            table->keep_alive = 1;\n        }\n\n        result = 1;\n      }\n    }\n    return result;\n  }\n\n\n  extern void\n  ft_mem_debug_done( FT_Memory  memory )\n  {\n    FT_MemTable  table = (FT_MemTable)memory->user;\n\n\n    if ( table )\n    {\n      memory->free    = table->free;\n      memory->realloc = table->realloc;\n      memory->alloc   = table->alloc;\n\n      ft_mem_table_destroy( table );\n      memory->user = NULL;\n    }\n  }\n\n\n\n  static int\n  ft_mem_source_compare( const void*  p1,\n                         const void*  p2 )\n  {\n    FT_MemSource  s1 = *(FT_MemSource*)p1;\n    FT_MemSource  s2 = *(FT_MemSource*)p2;\n\n\n    if ( s2->max_size > s1->max_size )\n      return 1;\n    else if ( s2->max_size < s1->max_size )\n      return -1;\n    else\n      return 0;\n  }\n\n\n  extern void\n  FT_DumpMemory( FT_Memory  memory )\n  {\n    FT_MemTable  table = (FT_MemTable)memory->user;\n\n\n    if ( table )\n    {\n      FT_MemSource*  bucket = table->sources;\n      FT_MemSource*  limit  = bucket + FT_MEM_SOURCE_BUCKETS;\n      FT_MemSource*  sources;\n      FT_UInt        nn, count;\n      const char*    fmt;\n\n\n      count = 0;\n      for ( ; bucket < limit; bucket++ )\n      {\n        FT_MemSource  source = *bucket;\n\n\n        for ( ; source; source = source->link )\n          count++;\n      }\n\n      sources = (FT_MemSource*)ft_mem_table_alloc(\n                                 table, sizeof ( *sources ) * count );\n\n      count = 0;\n      for ( bucket = table->sources; bucket < limit; bucket++ )\n      {\n        FT_MemSource  source = *bucket;\n\n\n        for ( ; source; source = source->link )\n          sources[count++] = source;\n      }\n\n      ft_qsort( sources, count, sizeof ( *sources ), ft_mem_source_compare );\n\n      printf( \"FreeType Memory Dump: \"\n              \"current=%ld max=%ld total=%ld count=%ld\\n\",\n              table->alloc_current, table->alloc_max,\n              table->alloc_total, table->alloc_count );\n      printf( \" block  block    sizes    sizes    sizes   source\\n\" );\n      printf( \" count   high      sum  highsum      max   location\\n\" );\n      printf( \"-------------------------------------------------\\n\" );\n\n      fmt = \"%6ld %6ld %8ld %8ld %8ld %s:%d\\n\";\n\n      for ( nn = 0; nn < count; nn++ )\n      {\n        FT_MemSource  source = sources[nn];\n\n\n        printf( fmt,\n                source->cur_blocks, source->max_blocks,\n                source->cur_size, source->max_size, source->cur_max,\n                FT_FILENAME( source->file_name ),\n                source->line_no );\n      }\n      printf( \"------------------------------------------------\\n\" );\n\n      ft_mem_table_free( table, sources );\n    }\n  }\n\n#else  /* !FT_DEBUG_MEMORY */\n\n  /* ANSI C doesn't like empty source files */\n  typedef int  _debug_mem_dummy;\n\n#endif /* !FT_DEBUG_MEMORY */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftdebug.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftdebug.c                                                              */\n/*                                                                         */\n/*    Debugging and logging component (body).                              */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2004, 2008, 2013 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This component contains various macros and functions used to ease the */\n  /* debugging of the FreeType engine.  Its main purpose is in assertion   */\n  /* checking, tracing, and error detection.                               */\n  /*                                                                       */\n  /* There are now three debugging modes:                                  */\n  /*                                                                       */\n  /* - trace mode                                                          */\n  /*                                                                       */\n  /*   Error and trace messages are sent to the log file (which can be the */\n  /*   standard error output).                                             */\n  /*                                                                       */\n  /* - error mode                                                          */\n  /*                                                                       */\n  /*   Only error messages are generated.                                  */\n  /*                                                                       */\n  /* - release mode:                                                       */\n  /*                                                                       */\n  /*   No error message is sent or generated.  The code is free from any   */\n  /*   debugging parts.                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_INTERNAL_DEBUG_H\n\n\n#ifdef FT_DEBUG_LEVEL_ERROR\n\n  /* documentation is in ftdebug.h */\n\n  FT_BASE_DEF( void )\n  FT_Message( const char*  fmt,\n              ... )\n  {\n    va_list  ap;\n\n\n    va_start( ap, fmt );\n    vfprintf( stderr, fmt, ap );\n    va_end( ap );\n  }\n\n\n  /* documentation is in ftdebug.h */\n\n  FT_BASE_DEF( void )\n  FT_Panic( const char*  fmt,\n            ... )\n  {\n    va_list  ap;\n\n\n    va_start( ap, fmt );\n    vfprintf( stderr, fmt, ap );\n    va_end( ap );\n\n    exit( EXIT_FAILURE );\n  }\n\n\n  /* documentation is in ftdebug.h */\n\n  FT_BASE_DEF( int )\n  FT_Throw( FT_Error     error,\n            int          line,\n            const char*  file )\n  {\n    FT_UNUSED( error );\n    FT_UNUSED( line );\n    FT_UNUSED( file );\n\n    return 0;\n  }\n\n#endif /* FT_DEBUG_LEVEL_ERROR */\n\n\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n  /* array of trace levels, initialized to 0 */\n  int  ft_trace_levels[trace_count];\n\n\n  /* define array of trace toggle names */\n#define FT_TRACE_DEF( x )  #x ,\n\n  static const char*  ft_trace_toggles[trace_count + 1] =\n  {\n#include FT_INTERNAL_TRACE_H\n    NULL\n  };\n\n#undef FT_TRACE_DEF\n\n\n  /* documentation is in ftdebug.h */\n\n  FT_BASE_DEF( FT_Int )\n  FT_Trace_Get_Count( void )\n  {\n    return trace_count;\n  }\n\n\n  /* documentation is in ftdebug.h */\n\n  FT_BASE_DEF( const char * )\n  FT_Trace_Get_Name( FT_Int  idx )\n  {\n    int  max = FT_Trace_Get_Count();\n\n\n    if ( idx < max )\n      return ft_trace_toggles[idx];\n    else\n      return NULL;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Initialize the tracing sub-system.  This is done by retrieving the    */\n  /* value of the `FT2_DEBUG' environment variable.  It must be a list of  */\n  /* toggles, separated by spaces, `;', or `,'.  Example:                  */\n  /*                                                                       */\n  /*    export FT2_DEBUG=\"any:3 memory:7 stream:5\"                         */\n  /*                                                                       */\n  /* This requests that all levels be set to 3, except the trace level for */\n  /* the memory and stream components which are set to 7 and 5,            */\n  /* respectively.                                                         */\n  /*                                                                       */\n  /* See the file <include/internal/fttrace.h> for details of the          */\n  /* available toggle names.                                               */\n  /*                                                                       */\n  /* The level must be between 0 and 7; 0 means quiet (except for serious  */\n  /* runtime errors), and 7 means _very_ verbose.                          */\n  /*                                                                       */\n  FT_BASE_DEF( void )\n  ft_debug_init( void )\n  {\n    const char*  ft2_debug = getenv( \"FT2_DEBUG\" );\n\n\n    if ( ft2_debug )\n    {\n      const char*  p = ft2_debug;\n      const char*  q;\n\n\n      for ( ; *p; p++ )\n      {\n        /* skip leading whitespace and separators */\n        if ( *p == ' ' || *p == '\\t' || *p == ',' || *p == ';' || *p == '=' )\n          continue;\n\n        /* read toggle name, followed by ':' */\n        q = p;\n        while ( *p && *p != ':' )\n          p++;\n\n        if ( !*p )\n          break;\n\n        if ( *p == ':' && p > q )\n        {\n          FT_Int  n, i, len = (FT_Int)( p - q );\n          FT_Int  level = -1, found = -1;\n\n\n          for ( n = 0; n < trace_count; n++ )\n          {\n            const char*  toggle = ft_trace_toggles[n];\n\n\n            for ( i = 0; i < len; i++ )\n            {\n              if ( toggle[i] != q[i] )\n                break;\n            }\n\n            if ( i == len && toggle[i] == 0 )\n            {\n              found = n;\n              break;\n            }\n          }\n\n          /* read level */\n          p++;\n          if ( *p )\n          {\n            level = *p - '0';\n            if ( level < 0 || level > 7 )\n              level = -1;\n          }\n\n          if ( found >= 0 && level >= 0 )\n          {\n            if ( found == trace_any )\n            {\n              /* special case for `any' */\n              for ( n = 0; n < trace_count; n++ )\n                ft_trace_levels[n] = level;\n            }\n            else\n              ft_trace_levels[found] = level;\n          }\n        }\n      }\n    }\n  }\n\n\n#else  /* !FT_DEBUG_LEVEL_TRACE */\n\n\n  FT_BASE_DEF( void )\n  ft_debug_init( void )\n  {\n    /* nothing */\n  }\n\n\n  FT_BASE_DEF( FT_Int )\n  FT_Trace_Get_Count( void )\n  {\n    return 0;\n  }\n\n\n  FT_BASE_DEF( const char * )\n  FT_Trace_Get_Name( FT_Int  idx )\n  {\n    FT_UNUSED( idx );\n\n    return NULL;\n  }\n\n\n#endif /* !FT_DEBUG_LEVEL_TRACE */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftfstype.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftfstype.c                                                             */\n/*                                                                         */\n/*    FreeType utility file to access FSType data (body).                  */\n/*                                                                         */\n/*  Copyright 2008, 2009, 2014 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#include <ft2build.h>\n#include FT_TYPE1_TABLES_H\n#include FT_TRUETYPE_TABLES_H\n#include FT_INTERNAL_SERVICE_H\n#include FT_SERVICE_POSTSCRIPT_INFO_H\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_UShort )\n  FT_Get_FSType_Flags( FT_Face  face )\n  {\n    TT_OS2*  os2;\n\n\n    /* first, try to get the fs_type directly from the font */\n    if ( face )\n    {\n      FT_Service_PsInfo  service = NULL;\n\n\n      FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );\n\n      if ( service && service->ps_get_font_extra )\n      {\n        PS_FontExtraRec  extra;\n\n\n        if ( !service->ps_get_font_extra( face, &extra ) &&\n             extra.fs_type != 0                          )\n          return extra.fs_type;\n      }\n    }\n\n    /* look at FSType before fsType for Type42 */\n\n    if ( ( os2 = (TT_OS2*)FT_Get_Sfnt_Table( face, FT_SFNT_OS2 ) ) != NULL &&\n         os2->version != 0xFFFFU                                           )\n      return os2->fsType;\n\n    return 0;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftgasp.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgasp.c                                                               */\n/*                                                                         */\n/*    Access of TrueType's `gasp' table (body).                            */\n/*                                                                         */\n/*  Copyright 2007 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_GASP_H\n#include FT_INTERNAL_TRUETYPE_TYPES_H\n\n\n  FT_EXPORT_DEF( FT_Int )\n  FT_Get_Gasp( FT_Face  face,\n               FT_UInt  ppem )\n  {\n    FT_Int  result = FT_GASP_NO_TABLE;\n\n\n    if ( face && FT_IS_SFNT( face ) )\n    {\n      TT_Face  ttface = (TT_Face)face;\n\n\n      if ( ttface->gasp.numRanges > 0 )\n      {\n        TT_GaspRange  range     = ttface->gasp.gaspRanges;\n        TT_GaspRange  range_end = range + ttface->gasp.numRanges;\n\n\n        while ( ppem > range->maxPPEM )\n        {\n          range++;\n          if ( range >= range_end )\n            goto Exit;\n        }\n\n        result = range->gaspFlag;\n\n        /* ensure that we don't have spurious bits */\n        if ( ttface->gasp.version == 0 )\n          result &= 3;\n      }\n    }\n  Exit:\n    return result;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftgloadr.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgloadr.c                                                             */\n/*                                                                         */\n/*    The FreeType glyph loader (body).                                    */\n/*                                                                         */\n/*  Copyright 2002-2006, 2010, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg                       */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_GLYPH_LOADER_H\n#include FT_INTERNAL_MEMORY_H\n#include FT_INTERNAL_OBJECTS_H\n\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gloader\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                                                               *****/\n  /*****                    G L Y P H   L O A D E R                    *****/\n  /*****                                                               *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The glyph loader is a simple object which is used to load a set of    */\n  /* glyphs easily.  It is critical for the correct loading of composites. */\n  /*                                                                       */\n  /* Ideally, one can see it as a stack of abstract `glyph' objects.       */\n  /*                                                                       */\n  /*   loader.base     Is really the bottom of the stack.  It describes a  */\n  /*                   single glyph image made of the juxtaposition of     */\n  /*                   several glyphs (those `in the stack').              */\n  /*                                                                       */\n  /*   loader.current  Describes the top of the stack, on which a new      */\n  /*                   glyph can be loaded.                                */\n  /*                                                                       */\n  /*   Rewind          Clears the stack.                                   */\n  /*   Prepare         Set up `loader.current' for addition of a new glyph */\n  /*                   image.                                              */\n  /*   Add             Add the `current' glyph image to the `base' one,    */\n  /*                   and prepare for another one.                        */\n  /*                                                                       */\n  /* The glyph loader is now a base object.  Each driver used to           */\n  /* re-implement it in one way or the other, which wasted code and        */\n  /* energy.                                                               */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* create a new glyph loader */\n  FT_BASE_DEF( FT_Error )\n  FT_GlyphLoader_New( FT_Memory        memory,\n                      FT_GlyphLoader  *aloader )\n  {\n    FT_GlyphLoader  loader = NULL;\n    FT_Error        error;\n\n\n    if ( !FT_NEW( loader ) )\n    {\n      loader->memory = memory;\n      *aloader       = loader;\n    }\n    return error;\n  }\n\n\n  /* rewind the glyph loader - reset counters to 0 */\n  FT_BASE_DEF( void )\n  FT_GlyphLoader_Rewind( FT_GlyphLoader  loader )\n  {\n    FT_GlyphLoad  base    = &loader->base;\n    FT_GlyphLoad  current = &loader->current;\n\n\n    base->outline.n_points   = 0;\n    base->outline.n_contours = 0;\n    base->num_subglyphs      = 0;\n\n    *current = *base;\n  }\n\n\n  /* reset the glyph loader, frees all allocated tables */\n  /* and starts from zero                               */\n  FT_BASE_DEF( void )\n  FT_GlyphLoader_Reset( FT_GlyphLoader  loader )\n  {\n    FT_Memory memory = loader->memory;\n\n\n    FT_FREE( loader->base.outline.points );\n    FT_FREE( loader->base.outline.tags );\n    FT_FREE( loader->base.outline.contours );\n    FT_FREE( loader->base.extra_points );\n    FT_FREE( loader->base.subglyphs );\n\n    loader->base.extra_points2 = NULL;\n\n    loader->max_points    = 0;\n    loader->max_contours  = 0;\n    loader->max_subglyphs = 0;\n\n    FT_GlyphLoader_Rewind( loader );\n  }\n\n\n  /* delete a glyph loader */\n  FT_BASE_DEF( void )\n  FT_GlyphLoader_Done( FT_GlyphLoader  loader )\n  {\n    if ( loader )\n    {\n      FT_Memory memory = loader->memory;\n\n\n      FT_GlyphLoader_Reset( loader );\n      FT_FREE( loader );\n    }\n  }\n\n\n  /* re-adjust the `current' outline fields */\n  static void\n  FT_GlyphLoader_Adjust_Points( FT_GlyphLoader  loader )\n  {\n    FT_Outline*  base    = &loader->base.outline;\n    FT_Outline*  current = &loader->current.outline;\n\n\n    current->points   = base->points   + base->n_points;\n    current->tags     = base->tags     + base->n_points;\n    current->contours = base->contours + base->n_contours;\n\n    /* handle extra points table - if any */\n    if ( loader->use_extra )\n    {\n      loader->current.extra_points  = loader->base.extra_points +\n                                      base->n_points;\n\n      loader->current.extra_points2 = loader->base.extra_points2 +\n                                      base->n_points;\n    }\n  }\n\n\n  FT_BASE_DEF( FT_Error )\n  FT_GlyphLoader_CreateExtra( FT_GlyphLoader  loader )\n  {\n    FT_Error   error;\n    FT_Memory  memory = loader->memory;\n\n\n    if ( !FT_NEW_ARRAY( loader->base.extra_points, 2 * loader->max_points ) )\n    {\n      loader->use_extra          = 1;\n      loader->base.extra_points2 = loader->base.extra_points +\n                                   loader->max_points;\n\n      FT_GlyphLoader_Adjust_Points( loader );\n    }\n    return error;\n  }\n\n\n  /* re-adjust the `current' subglyphs field */\n  static void\n  FT_GlyphLoader_Adjust_Subglyphs( FT_GlyphLoader  loader )\n  {\n    FT_GlyphLoad  base    = &loader->base;\n    FT_GlyphLoad  current = &loader->current;\n\n\n    current->subglyphs = base->subglyphs + base->num_subglyphs;\n  }\n\n\n  /* Ensure that we can add `n_points' and `n_contours' to our glyph.      */\n  /* This function reallocates its outline tables if necessary.  Note that */\n  /* it DOESN'T change the number of points within the loader!             */\n  /*                                                                       */\n  FT_BASE_DEF( FT_Error )\n  FT_GlyphLoader_CheckPoints( FT_GlyphLoader  loader,\n                              FT_UInt         n_points,\n                              FT_UInt         n_contours )\n  {\n    FT_Memory    memory  = loader->memory;\n    FT_Error     error   = FT_Err_Ok;\n    FT_Outline*  base    = &loader->base.outline;\n    FT_Outline*  current = &loader->current.outline;\n    FT_Bool      adjust  = 0;\n\n    FT_UInt      new_max, old_max;\n\n\n    /* check points & tags */\n    new_max = base->n_points + current->n_points + n_points;\n    old_max = loader->max_points;\n\n    if ( new_max > old_max )\n    {\n      new_max = FT_PAD_CEIL( new_max, 8 );\n\n      if ( new_max > FT_OUTLINE_POINTS_MAX )\n        return FT_THROW( Array_Too_Large );\n\n      if ( FT_RENEW_ARRAY( base->points, old_max, new_max ) ||\n           FT_RENEW_ARRAY( base->tags,   old_max, new_max ) )\n        goto Exit;\n\n      if ( loader->use_extra )\n      {\n        if ( FT_RENEW_ARRAY( loader->base.extra_points,\n                             old_max * 2, new_max * 2 ) )\n          goto Exit;\n\n        FT_ARRAY_MOVE( loader->base.extra_points + new_max,\n                       loader->base.extra_points + old_max,\n                       old_max );\n\n        loader->base.extra_points2 = loader->base.extra_points + new_max;\n      }\n\n      adjust = 1;\n      loader->max_points = new_max;\n    }\n\n    /* check contours */\n    old_max = loader->max_contours;\n    new_max = base->n_contours + current->n_contours +\n              n_contours;\n    if ( new_max > old_max )\n    {\n      new_max = FT_PAD_CEIL( new_max, 4 );\n\n      if ( new_max > FT_OUTLINE_CONTOURS_MAX )\n        return FT_THROW( Array_Too_Large );\n\n      if ( FT_RENEW_ARRAY( base->contours, old_max, new_max ) )\n        goto Exit;\n\n      adjust = 1;\n      loader->max_contours = new_max;\n    }\n\n    if ( adjust )\n      FT_GlyphLoader_Adjust_Points( loader );\n\n  Exit:\n    if ( error )\n      FT_GlyphLoader_Reset( loader );\n\n    return error;\n  }\n\n\n  /* Ensure that we can add `n_subglyphs' to our glyph. this function */\n  /* reallocates its subglyphs table if necessary.  Note that it DOES */\n  /* NOT change the number of subglyphs within the loader!            */\n  /*                                                                  */\n  FT_BASE_DEF( FT_Error )\n  FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader  loader,\n                                 FT_UInt         n_subs )\n  {\n    FT_Memory     memory = loader->memory;\n    FT_Error      error  = FT_Err_Ok;\n    FT_UInt       new_max, old_max;\n\n    FT_GlyphLoad  base    = &loader->base;\n    FT_GlyphLoad  current = &loader->current;\n\n\n    new_max = base->num_subglyphs + current->num_subglyphs + n_subs;\n    old_max = loader->max_subglyphs;\n    if ( new_max > old_max )\n    {\n      new_max = FT_PAD_CEIL( new_max, 2 );\n      if ( FT_RENEW_ARRAY( base->subglyphs, old_max, new_max ) )\n        goto Exit;\n\n      loader->max_subglyphs = new_max;\n\n      FT_GlyphLoader_Adjust_Subglyphs( loader );\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /* prepare loader for the addition of a new glyph on top of the base one */\n  FT_BASE_DEF( void )\n  FT_GlyphLoader_Prepare( FT_GlyphLoader  loader )\n  {\n    FT_GlyphLoad  current = &loader->current;\n\n\n    current->outline.n_points   = 0;\n    current->outline.n_contours = 0;\n    current->num_subglyphs      = 0;\n\n    FT_GlyphLoader_Adjust_Points   ( loader );\n    FT_GlyphLoader_Adjust_Subglyphs( loader );\n  }\n\n\n  /* add current glyph to the base image -- and prepare for another */\n  FT_BASE_DEF( void )\n  FT_GlyphLoader_Add( FT_GlyphLoader  loader )\n  {\n    FT_GlyphLoad  base;\n    FT_GlyphLoad  current;\n\n    FT_UInt       n_curr_contours;\n    FT_UInt       n_base_points;\n    FT_UInt       n;\n\n\n    if ( !loader )\n      return;\n\n    base    = &loader->base;\n    current = &loader->current;\n\n    n_curr_contours = current->outline.n_contours;\n    n_base_points   = base->outline.n_points;\n\n    base->outline.n_points =\n      (short)( base->outline.n_points + current->outline.n_points );\n    base->outline.n_contours =\n      (short)( base->outline.n_contours + current->outline.n_contours );\n\n    base->num_subglyphs += current->num_subglyphs;\n\n    /* adjust contours count in newest outline */\n    for ( n = 0; n < n_curr_contours; n++ )\n      current->outline.contours[n] =\n        (short)( current->outline.contours[n] + n_base_points );\n\n    /* prepare for another new glyph image */\n    FT_GlyphLoader_Prepare( loader );\n  }\n\n\n  FT_BASE_DEF( FT_Error )\n  FT_GlyphLoader_CopyPoints( FT_GlyphLoader  target,\n                             FT_GlyphLoader  source )\n  {\n    FT_Error  error;\n    FT_UInt   num_points   = source->base.outline.n_points;\n    FT_UInt   num_contours = source->base.outline.n_contours;\n\n\n    error = FT_GlyphLoader_CheckPoints( target, num_points, num_contours );\n    if ( !error )\n    {\n      FT_Outline*  out = &target->base.outline;\n      FT_Outline*  in  = &source->base.outline;\n\n\n      FT_ARRAY_COPY( out->points, in->points,\n                     num_points );\n      FT_ARRAY_COPY( out->tags, in->tags,\n                     num_points );\n      FT_ARRAY_COPY( out->contours, in->contours,\n                     num_contours );\n\n      /* do we need to copy the extra points? */\n      if ( target->use_extra && source->use_extra )\n      {\n        FT_ARRAY_COPY( target->base.extra_points, source->base.extra_points,\n                       num_points );\n        FT_ARRAY_COPY( target->base.extra_points2, source->base.extra_points2,\n                       num_points );\n      }\n\n      out->n_points   = (short)num_points;\n      out->n_contours = (short)num_contours;\n\n      FT_GlyphLoader_Adjust_Points( target );\n    }\n\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftglyph.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftglyph.c                                                              */\n/*                                                                         */\n/*    FreeType convenience functions to handle glyphs (body).              */\n/*                                                                         */\n/*  Copyright 1996-2005, 2007, 2008, 2010, 2012-2014 by                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  This file contains the definition of several convenience functions   */\n  /*  that can be used by client applications to easily retrieve glyph     */\n  /*  bitmaps and outlines from a given face.                              */\n  /*                                                                       */\n  /*  These functions should be optional if you are writing a font server  */\n  /*  or text layout engine on top of FreeType.  However, they are pretty  */\n  /*  handy for many other simple uses of the library.                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n\n#include FT_GLYPH_H\n#include FT_OUTLINE_H\n#include FT_BITMAP_H\n#include FT_INTERNAL_OBJECTS_H\n\n#include \"basepic.h\"\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_glyph\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****   FT_BitmapGlyph support                                        ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_CALLBACK_DEF( FT_Error )\n  ft_bitmap_glyph_init( FT_Glyph      bitmap_glyph,\n                        FT_GlyphSlot  slot )\n  {\n    FT_BitmapGlyph  glyph   = (FT_BitmapGlyph)bitmap_glyph;\n    FT_Error        error   = FT_Err_Ok;\n    FT_Library      library = FT_GLYPH( glyph )->library;\n\n\n    if ( slot->format != FT_GLYPH_FORMAT_BITMAP )\n    {\n      error = FT_THROW( Invalid_Glyph_Format );\n      goto Exit;\n    }\n\n    glyph->left = slot->bitmap_left;\n    glyph->top  = slot->bitmap_top;\n\n    /* do lazy copying whenever possible */\n    if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )\n    {\n      glyph->bitmap = slot->bitmap;\n      slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;\n    }\n    else\n    {\n      FT_Bitmap_New( &glyph->bitmap );\n      error = FT_Bitmap_Copy( library, &slot->bitmap, &glyph->bitmap );\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  ft_bitmap_glyph_copy( FT_Glyph  bitmap_source,\n                        FT_Glyph  bitmap_target )\n  {\n    FT_Library      library = bitmap_source->library;\n    FT_BitmapGlyph  source  = (FT_BitmapGlyph)bitmap_source;\n    FT_BitmapGlyph  target  = (FT_BitmapGlyph)bitmap_target;\n\n\n    target->left = source->left;\n    target->top  = source->top;\n\n    return FT_Bitmap_Copy( library, &source->bitmap, &target->bitmap );\n  }\n\n\n  FT_CALLBACK_DEF( void )\n  ft_bitmap_glyph_done( FT_Glyph  bitmap_glyph )\n  {\n    FT_BitmapGlyph  glyph   = (FT_BitmapGlyph)bitmap_glyph;\n    FT_Library      library = FT_GLYPH( glyph )->library;\n\n\n    FT_Bitmap_Done( library, &glyph->bitmap );\n  }\n\n\n  FT_CALLBACK_DEF( void )\n  ft_bitmap_glyph_bbox( FT_Glyph  bitmap_glyph,\n                        FT_BBox*  cbox )\n  {\n    FT_BitmapGlyph  glyph = (FT_BitmapGlyph)bitmap_glyph;\n\n\n    cbox->xMin = glyph->left << 6;\n    cbox->xMax = cbox->xMin + ( glyph->bitmap.width << 6 );\n    cbox->yMax = glyph->top << 6;\n    cbox->yMin = cbox->yMax - ( glyph->bitmap.rows << 6 );\n  }\n\n\n  FT_DEFINE_GLYPH(ft_bitmap_glyph_class,\n    sizeof ( FT_BitmapGlyphRec ),\n    FT_GLYPH_FORMAT_BITMAP,\n\n    ft_bitmap_glyph_init,\n    ft_bitmap_glyph_done,\n    ft_bitmap_glyph_copy,\n    0,                          /* FT_Glyph_TransformFunc */\n    ft_bitmap_glyph_bbox,\n    0                           /* FT_Glyph_PrepareFunc   */\n  )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****   FT_OutlineGlyph support                                       ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  ft_outline_glyph_init( FT_Glyph      outline_glyph,\n                         FT_GlyphSlot  slot )\n  {\n    FT_OutlineGlyph  glyph   = (FT_OutlineGlyph)outline_glyph;\n    FT_Error         error   = FT_Err_Ok;\n    FT_Library       library = FT_GLYPH( glyph )->library;\n    FT_Outline*      source  = &slot->outline;\n    FT_Outline*      target  = &glyph->outline;\n\n\n    /* check format in glyph slot */\n    if ( slot->format != FT_GLYPH_FORMAT_OUTLINE )\n    {\n      error = FT_THROW( Invalid_Glyph_Format );\n      goto Exit;\n    }\n\n    /* allocate new outline */\n    error = FT_Outline_New( library, source->n_points, source->n_contours,\n                            &glyph->outline );\n    if ( error )\n      goto Exit;\n\n    FT_Outline_Copy( source, target );\n\n  Exit:\n    return error;\n  }\n\n\n  FT_CALLBACK_DEF( void )\n  ft_outline_glyph_done( FT_Glyph  outline_glyph )\n  {\n    FT_OutlineGlyph  glyph = (FT_OutlineGlyph)outline_glyph;\n\n\n    FT_Outline_Done( FT_GLYPH( glyph )->library, &glyph->outline );\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  ft_outline_glyph_copy( FT_Glyph  outline_source,\n                         FT_Glyph  outline_target )\n  {\n    FT_OutlineGlyph  source  = (FT_OutlineGlyph)outline_source;\n    FT_OutlineGlyph  target  = (FT_OutlineGlyph)outline_target;\n    FT_Error         error;\n    FT_Library       library = FT_GLYPH( source )->library;\n\n\n    error = FT_Outline_New( library, source->outline.n_points,\n                            source->outline.n_contours, &target->outline );\n    if ( !error )\n      FT_Outline_Copy( &source->outline, &target->outline );\n\n    return error;\n  }\n\n\n  FT_CALLBACK_DEF( void )\n  ft_outline_glyph_transform( FT_Glyph          outline_glyph,\n                              const FT_Matrix*  matrix,\n                              const FT_Vector*  delta )\n  {\n    FT_OutlineGlyph  glyph = (FT_OutlineGlyph)outline_glyph;\n\n\n    if ( matrix )\n      FT_Outline_Transform( &glyph->outline, matrix );\n\n    if ( delta )\n      FT_Outline_Translate( &glyph->outline, delta->x, delta->y );\n  }\n\n\n  FT_CALLBACK_DEF( void )\n  ft_outline_glyph_bbox( FT_Glyph  outline_glyph,\n                         FT_BBox*  bbox )\n  {\n    FT_OutlineGlyph  glyph = (FT_OutlineGlyph)outline_glyph;\n\n\n    FT_Outline_Get_CBox( &glyph->outline, bbox );\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  ft_outline_glyph_prepare( FT_Glyph      outline_glyph,\n                            FT_GlyphSlot  slot )\n  {\n    FT_OutlineGlyph  glyph = (FT_OutlineGlyph)outline_glyph;\n\n\n    slot->format         = FT_GLYPH_FORMAT_OUTLINE;\n    slot->outline        = glyph->outline;\n    slot->outline.flags &= ~FT_OUTLINE_OWNER;\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_DEFINE_GLYPH( ft_outline_glyph_class,\n    sizeof ( FT_OutlineGlyphRec ),\n    FT_GLYPH_FORMAT_OUTLINE,\n\n    ft_outline_glyph_init,\n    ft_outline_glyph_done,\n    ft_outline_glyph_copy,\n    ft_outline_glyph_transform,\n    ft_outline_glyph_bbox,\n    ft_outline_glyph_prepare\n  )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****   FT_Glyph class and API                                        ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n   static FT_Error\n   ft_new_glyph( FT_Library             library,\n                 const FT_Glyph_Class*  clazz,\n                 FT_Glyph*              aglyph )\n   {\n     FT_Memory  memory = library->memory;\n     FT_Error   error;\n     FT_Glyph   glyph  = NULL;\n\n\n     *aglyph = 0;\n\n     if ( !FT_ALLOC( glyph, clazz->glyph_size ) )\n     {\n       glyph->library = library;\n       glyph->clazz   = clazz;\n       glyph->format  = clazz->glyph_format;\n\n       *aglyph = glyph;\n     }\n\n     return error;\n   }\n\n\n  /* documentation is in ftglyph.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Glyph_Copy( FT_Glyph   source,\n                 FT_Glyph  *target )\n  {\n    FT_Glyph               copy;\n    FT_Error               error;\n    const FT_Glyph_Class*  clazz;\n\n\n    /* check arguments */\n    if ( !target || !source || !source->clazz )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    *target = NULL;\n\n    if ( !source || !source->clazz )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    clazz = source->clazz;\n    error = ft_new_glyph( source->library, clazz, &copy );\n    if ( error )\n      goto Exit;\n\n    copy->advance = source->advance;\n    copy->format  = source->format;\n\n    if ( clazz->glyph_copy )\n      error = clazz->glyph_copy( source, copy );\n\n    if ( error )\n      FT_Done_Glyph( copy );\n    else\n      *target = copy;\n\n  Exit:\n    return error;\n  }\n\n\n  /* documentation is in ftglyph.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Get_Glyph( FT_GlyphSlot  slot,\n                FT_Glyph     *aglyph )\n  {\n    FT_Library  library;\n    FT_Error    error;\n    FT_Glyph    glyph;\n\n    const FT_Glyph_Class*  clazz = NULL;\n\n\n    if ( !slot )\n      return FT_THROW( Invalid_Slot_Handle );\n\n    library = slot->library;\n\n    if ( !aglyph )\n      return FT_THROW( Invalid_Argument );\n\n    /* if it is a bitmap, that's easy :-) */\n    if ( slot->format == FT_GLYPH_FORMAT_BITMAP )\n      clazz = FT_BITMAP_GLYPH_CLASS_GET;\n\n    /* if it is an outline */\n    else if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )\n      clazz = FT_OUTLINE_GLYPH_CLASS_GET;\n\n    else\n    {\n      /* try to find a renderer that supports the glyph image format */\n      FT_Renderer  render = FT_Lookup_Renderer( library, slot->format, 0 );\n\n\n      if ( render )\n        clazz = &render->glyph_class;\n    }\n\n    if ( !clazz )\n    {\n      error = FT_THROW( Invalid_Glyph_Format );\n      goto Exit;\n    }\n\n    /* create FT_Glyph object */\n    error = ft_new_glyph( library, clazz, &glyph );\n    if ( error )\n      goto Exit;\n\n    /* copy advance while converting it to 16.16 format */\n    glyph->advance.x = slot->advance.x << 10;\n    glyph->advance.y = slot->advance.y << 10;\n\n    /* now import the image from the glyph slot */\n    error = clazz->glyph_init( glyph, slot );\n\n    /* if an error occurred, destroy the glyph */\n    if ( error )\n      FT_Done_Glyph( glyph );\n    else\n      *aglyph = glyph;\n\n  Exit:\n    return error;\n  }\n\n\n  /* documentation is in ftglyph.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Glyph_Transform( FT_Glyph    glyph,\n                      FT_Matrix*  matrix,\n                      FT_Vector*  delta )\n  {\n    FT_Error  error = FT_Err_Ok;\n\n\n    if ( !glyph || !glyph->clazz )\n      error = FT_THROW( Invalid_Argument );\n    else\n    {\n      const FT_Glyph_Class*  clazz = glyph->clazz;\n\n\n      if ( clazz->glyph_transform )\n      {\n        /* transform glyph image */\n        clazz->glyph_transform( glyph, matrix, delta );\n\n        /* transform advance vector */\n        if ( matrix )\n          FT_Vector_Transform( &glyph->advance, matrix );\n      }\n      else\n        error = FT_THROW( Invalid_Glyph_Format );\n    }\n    return error;\n  }\n\n\n  /* documentation is in ftglyph.h */\n\n  FT_EXPORT_DEF( void )\n  FT_Glyph_Get_CBox( FT_Glyph  glyph,\n                     FT_UInt   bbox_mode,\n                     FT_BBox  *acbox )\n  {\n    const FT_Glyph_Class*  clazz;\n\n\n    if ( !acbox )\n      return;\n\n    acbox->xMin = acbox->yMin = acbox->xMax = acbox->yMax = 0;\n\n    if ( !glyph || !glyph->clazz )\n      return;\n\n    clazz = glyph->clazz;\n    if ( !clazz->glyph_bbox )\n      return;\n\n    /* retrieve bbox in 26.6 coordinates */\n    clazz->glyph_bbox( glyph, acbox );\n\n    /* perform grid fitting if needed */\n    if ( bbox_mode == FT_GLYPH_BBOX_GRIDFIT ||\n         bbox_mode == FT_GLYPH_BBOX_PIXELS  )\n    {\n      acbox->xMin = FT_PIX_FLOOR( acbox->xMin );\n      acbox->yMin = FT_PIX_FLOOR( acbox->yMin );\n      acbox->xMax = FT_PIX_CEIL( acbox->xMax );\n      acbox->yMax = FT_PIX_CEIL( acbox->yMax );\n    }\n\n    /* convert to integer pixels if needed */\n    if ( bbox_mode == FT_GLYPH_BBOX_TRUNCATE ||\n         bbox_mode == FT_GLYPH_BBOX_PIXELS   )\n    {\n      acbox->xMin >>= 6;\n      acbox->yMin >>= 6;\n      acbox->xMax >>= 6;\n      acbox->yMax >>= 6;\n    }\n  }\n\n\n  /* documentation is in ftglyph.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Glyph_To_Bitmap( FT_Glyph*       the_glyph,\n                      FT_Render_Mode  render_mode,\n                      FT_Vector*      origin,\n                      FT_Bool         destroy )\n  {\n    FT_GlyphSlotRec           dummy;\n    FT_GlyphSlot_InternalRec  dummy_internal;\n    FT_Error                  error = FT_Err_Ok;\n    FT_Glyph                  b, glyph;\n    FT_BitmapGlyph            bitmap = NULL;\n    const FT_Glyph_Class*     clazz;\n\n    /* FT_BITMAP_GLYPH_CLASS_GET dereferences `library' in PIC mode */\n    FT_Library                library;\n\n\n    /* check argument */\n    if ( !the_glyph )\n      goto Bad;\n    glyph = *the_glyph;\n    if ( !glyph )\n      goto Bad;\n\n    clazz   = glyph->clazz;\n    library = glyph->library;\n    if ( !library || !clazz )\n      goto Bad;\n\n    /* when called with a bitmap glyph, do nothing and return successfully */\n    if ( clazz == FT_BITMAP_GLYPH_CLASS_GET )\n      goto Exit;\n\n    if ( !clazz->glyph_prepare )\n      goto Bad;\n\n    /* we render the glyph into a glyph bitmap using a `dummy' glyph slot */\n    /* then calling FT_Render_Glyph_Internal()                            */\n\n    FT_MEM_ZERO( &dummy, sizeof ( dummy ) );\n    FT_MEM_ZERO( &dummy_internal, sizeof ( dummy_internal ) );\n    dummy.internal = &dummy_internal;\n    dummy.library  = library;\n    dummy.format   = clazz->glyph_format;\n\n    /* create result bitmap glyph */\n    error = ft_new_glyph( library, FT_BITMAP_GLYPH_CLASS_GET, &b );\n    if ( error )\n      goto Exit;\n    bitmap = (FT_BitmapGlyph)b;\n\n#if 1\n    /* if `origin' is set, translate the glyph image */\n    if ( origin )\n      FT_Glyph_Transform( glyph, 0, origin );\n#else\n    FT_UNUSED( origin );\n#endif\n\n    /* prepare dummy slot for rendering */\n    error = clazz->glyph_prepare( glyph, &dummy );\n    if ( !error )\n      error = FT_Render_Glyph_Internal( glyph->library, &dummy, render_mode );\n\n#if 1\n    if ( !destroy && origin )\n    {\n      FT_Vector  v;\n\n\n      v.x = -origin->x;\n      v.y = -origin->y;\n      FT_Glyph_Transform( glyph, 0, &v );\n    }\n#endif\n\n    if ( error )\n      goto Exit;\n\n    /* in case of success, copy the bitmap to the glyph bitmap */\n    error = ft_bitmap_glyph_init( (FT_Glyph)bitmap, &dummy );\n    if ( error )\n      goto Exit;\n\n    /* copy advance */\n    bitmap->root.advance = glyph->advance;\n\n    if ( destroy )\n      FT_Done_Glyph( glyph );\n\n    *the_glyph = FT_GLYPH( bitmap );\n\n  Exit:\n    if ( error && bitmap )\n      FT_Done_Glyph( FT_GLYPH( bitmap ) );\n\n    return error;\n\n  Bad:\n    error = FT_THROW( Invalid_Argument );\n    goto Exit;\n  }\n\n\n  /* documentation is in ftglyph.h */\n\n  FT_EXPORT_DEF( void )\n  FT_Done_Glyph( FT_Glyph  glyph )\n  {\n    if ( glyph )\n    {\n      FT_Memory              memory = glyph->library->memory;\n      const FT_Glyph_Class*  clazz  = glyph->clazz;\n\n\n      if ( clazz->glyph_done )\n        clazz->glyph_done( glyph );\n\n      FT_FREE( glyph );\n    }\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftgxval.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgxval.c                                                              */\n/*                                                                         */\n/*    FreeType API for validating TrueTyepGX/AAT tables (body).            */\n/*                                                                         */\n/*  Copyright 2004-2006, 2010, 2013, 2014 by                               */\n/*  Masatake YAMATO, Redhat K.K,                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n\n#include FT_INTERNAL_OBJECTS_H\n#include FT_SERVICE_GX_VALIDATE_H\n\n\n  /* documentation is in ftgxval.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_TrueTypeGX_Validate( FT_Face   face,\n                          FT_UInt   validation_flags,\n                          FT_Bytes  tables[FT_VALIDATE_GX_LENGTH],\n                          FT_UInt   table_length )\n  {\n    FT_Service_GXvalidate  service;\n    FT_Error               error;\n\n\n    if ( !face )\n    {\n      error = FT_THROW( Invalid_Face_Handle );\n      goto Exit;\n    }\n\n    if ( !tables )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    FT_FACE_FIND_GLOBAL_SERVICE( face, service, GX_VALIDATE );\n\n    if ( service )\n      error = service->validate( face,\n                                 validation_flags,\n                                 tables,\n                                 table_length );\n    else\n      error = FT_THROW( Unimplemented_Feature );\n\n  Exit:\n    return error;\n  }\n\n\n  FT_EXPORT_DEF( void )\n  FT_TrueTypeGX_Free( FT_Face   face,\n                      FT_Bytes  table )\n  {\n    FT_Memory  memory;\n\n\n    if ( !face )\n      return;\n\n    memory = FT_FACE_MEMORY( face );\n\n    FT_FREE( table );\n  }\n\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_ClassicKern_Validate( FT_Face    face,\n                           FT_UInt    validation_flags,\n                           FT_Bytes  *ckern_table )\n  {\n    FT_Service_CKERNvalidate  service;\n    FT_Error                  error;\n\n\n    if ( !face )\n    {\n      error = FT_THROW( Invalid_Face_Handle );\n      goto Exit;\n    }\n\n    if ( !ckern_table )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    FT_FACE_FIND_GLOBAL_SERVICE( face, service, CLASSICKERN_VALIDATE );\n\n    if ( service )\n      error = service->validate( face,\n                                 validation_flags,\n                                 ckern_table );\n    else\n      error = FT_THROW( Unimplemented_Feature );\n\n  Exit:\n    return error;\n  }\n\n\n  FT_EXPORT_DEF( void )\n  FT_ClassicKern_Free( FT_Face   face,\n                       FT_Bytes  table )\n  {\n    FT_Memory  memory;\n\n\n    if ( !face )\n      return;\n\n    memory = FT_FACE_MEMORY( face );\n\n\n    FT_FREE( table );\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftinit.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftinit.c                                                               */\n/*                                                                         */\n/*    FreeType initialization layer (body).                                */\n/*                                                                         */\n/*  Copyright 1996-2002, 2005, 2007, 2009, 2012-2014 by                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  The purpose of this file is to implement the following two           */\n  /*  functions:                                                           */\n  /*                                                                       */\n  /*  FT_Add_Default_Modules():                                            */\n  /*     This function is used to add the set of default modules to a      */\n  /*     fresh new library object.  The set is taken from the header file  */\n  /*     `config/ftmodule.h'.  See the document `FreeType 2.0 Build        */\n  /*     System' for more information.                                     */\n  /*                                                                       */\n  /*  FT_Init_FreeType():                                                  */\n  /*     This function creates a system object for the current platform,   */\n  /*     builds a library out of it, then calls FT_Default_Drivers().      */\n  /*                                                                       */\n  /*  Note that even if FT_Init_FreeType() uses the implementation of the  */\n  /*  system object defined at build time, client applications are still   */\n  /*  able to provide their own `ftsystem.c'.                              */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_MODULE_H\n#include \"basepic.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_init\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n\n#undef  FT_USE_MODULE\n#ifdef __cplusplus\n#define FT_USE_MODULE( type, x )  extern \"C\" const type  x;\n#else\n#define FT_USE_MODULE( type, x )  extern const type  x;\n#endif\n\n#include FT_CONFIG_MODULES_H\n\n#undef  FT_USE_MODULE\n#define FT_USE_MODULE( type, x )  (const FT_Module_Class*)&(x),\n\n  static\n  const FT_Module_Class*  const ft_default_modules[] =\n  {\n#include FT_CONFIG_MODULES_H\n    0\n  };\n\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n\n#ifdef __cplusplus\n#define FT_EXTERNC  extern \"C\"\n#else\n#define FT_EXTERNC  extern\n#endif\n\n  /* declare the module's class creation/destruction functions */\n#undef  FT_USE_MODULE\n#define FT_USE_MODULE( type, x )                            \\\n  FT_EXTERNC FT_Error                                       \\\n  FT_Create_Class_ ## x( FT_Library         library,        \\\n                         FT_Module_Class*  *output_class ); \\\n  FT_EXTERNC void                                           \\\n  FT_Destroy_Class_ ## x( FT_Library        library,        \\\n                          FT_Module_Class*  clazz );\n\n#include FT_CONFIG_MODULES_H\n\n  /* count all module classes */\n#undef  FT_USE_MODULE\n#define FT_USE_MODULE( type, x )  MODULE_CLASS_ ## x,\n\n  enum\n  {\n#include FT_CONFIG_MODULES_H\n    FT_NUM_MODULE_CLASSES\n  };\n\n  /* destroy all module classes */\n#undef  FT_USE_MODULE\n#define FT_USE_MODULE( type, x )                   \\\n  if ( classes[i] )                                \\\n  {                                                \\\n    FT_Destroy_Class_ ## x( library, classes[i] ); \\\n  }                                                \\\n  i++;\n\n\n  FT_BASE_DEF( void )\n  ft_destroy_default_module_classes( FT_Library  library )\n  {\n    FT_Module_Class*  *classes;\n    FT_Memory          memory;\n    FT_UInt            i;\n    BasePIC*           pic_container = (BasePIC*)library->pic_container.base;\n\n\n    if ( !pic_container->default_module_classes )\n      return;\n\n    memory  = library->memory;\n    classes = pic_container->default_module_classes;\n    i       = 0;\n\n#include FT_CONFIG_MODULES_H\n\n    FT_FREE( classes );\n    pic_container->default_module_classes = 0;\n  }\n\n\n  /* initialize all module classes and the pointer table */\n#undef  FT_USE_MODULE\n#define FT_USE_MODULE( type, x )                     \\\n  error = FT_Create_Class_ ## x( library, &clazz );  \\\n  if ( error )                                       \\\n    goto Exit;                                       \\\n  classes[i++] = clazz;\n\n\n  FT_BASE_DEF( FT_Error )\n  ft_create_default_module_classes( FT_Library  library )\n  {\n    FT_Error           error;\n    FT_Memory          memory;\n    FT_Module_Class*  *classes = NULL;\n    FT_Module_Class*   clazz;\n    FT_UInt            i;\n    BasePIC*           pic_container = (BasePIC*)library->pic_container.base;\n\n\n    memory = library->memory;\n\n    pic_container->default_module_classes = 0;\n\n    if ( FT_ALLOC( classes, sizeof ( FT_Module_Class* ) *\n                              ( FT_NUM_MODULE_CLASSES + 1 ) ) )\n      return error;\n\n    /* initialize all pointers to 0, especially the last one */\n    for ( i = 0; i < FT_NUM_MODULE_CLASSES; i++ )\n      classes[i] = 0;\n    classes[FT_NUM_MODULE_CLASSES] = 0;\n\n    i = 0;\n\n#include FT_CONFIG_MODULES_H\n\n  Exit:\n    if ( error )\n      ft_destroy_default_module_classes( library );\n    else\n      pic_container->default_module_classes = classes;\n\n    return error;\n  }\n\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  /* documentation is in ftmodapi.h */\n\n  FT_EXPORT_DEF( void )\n  FT_Add_Default_Modules( FT_Library  library )\n  {\n    FT_Error                       error;\n    const FT_Module_Class* const*  cur;\n\n\n    /* FT_DEFAULT_MODULES_GET dereferences `library' in PIC mode */\n#ifdef FT_CONFIG_OPTION_PIC\n    if ( !library )\n      return;\n#endif\n\n    /* GCC 4.6 warns the type difference:\n     *   FT_Module_Class** != const FT_Module_Class* const*\n     */\n    cur = (const FT_Module_Class* const*)FT_DEFAULT_MODULES_GET;\n\n    /* test for valid `library' delayed to FT_Add_Module() */\n    while ( *cur )\n    {\n      error = FT_Add_Module( library, *cur );\n      /* notify errors, but don't stop */\n      if ( error )\n        FT_TRACE0(( \"FT_Add_Default_Module:\"\n                    \" Cannot install `%s', error = 0x%x\\n\",\n                    (*cur)->module_name, error ));\n      cur++;\n    }\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Init_FreeType( FT_Library  *alibrary )\n  {\n    FT_Error   error;\n    FT_Memory  memory;\n\n\n    /* check of `alibrary' delayed to `FT_New_Library' */\n\n    /* First of all, allocate a new system object -- this function is part */\n    /* of the system-specific component, i.e. `ftsystem.c'.                */\n\n    memory = FT_New_Memory();\n    if ( !memory )\n    {\n      FT_ERROR(( \"FT_Init_FreeType: cannot find memory manager\\n\" ));\n      return FT_THROW( Unimplemented_Feature );\n    }\n\n    /* build a library out of it, then fill it with the set of */\n    /* default drivers.                                        */\n\n    error = FT_New_Library( memory, alibrary );\n    if ( error )\n      FT_Done_Memory( memory );\n    else\n      FT_Add_Default_Modules( *alibrary );\n\n    return error;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Done_FreeType( FT_Library  library )\n  {\n    FT_Memory  memory;\n\n\n    if ( !library )\n      return FT_THROW( Invalid_Library_Handle );\n\n    memory = library->memory;\n\n    /* Discard the library object */\n    FT_Done_Library( library );\n\n    /* discard memory manager */\n    FT_Done_Memory( memory );\n\n    return FT_Err_Ok;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftlcdfil.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlcdfil.c                                                             */\n/*                                                                         */\n/*    FreeType API for color filtering of subpixel bitmap glyphs (body).   */\n/*                                                                         */\n/*  Copyright 2006, 2008-2010, 2013, 2014 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n\n#include FT_LCD_FILTER_H\n#include FT_IMAGE_H\n#include FT_INTERNAL_OBJECTS_H\n\n\n#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING\n\n/* define USE_LEGACY to implement the legacy filter */\n#define  USE_LEGACY\n\n  /* FIR filter used by the default and light filters */\n  static void\n  _ft_lcd_filter_fir( FT_Bitmap*      bitmap,\n                      FT_Render_Mode  mode,\n                      FT_Library      library )\n  {\n    FT_Byte*  weights = library->lcd_weights;\n    FT_UInt   width   = (FT_UInt)bitmap->width;\n    FT_UInt   height  = (FT_UInt)bitmap->rows;\n\n\n    /* horizontal in-place FIR filter */\n    if ( mode == FT_RENDER_MODE_LCD && width >= 4 )\n    {\n      FT_Byte*  line = bitmap->buffer;\n\n\n      /* take care of bitmap flow */\n      if ( bitmap->pitch < 0 )\n        line -= bitmap->pitch * ( bitmap->rows - 1 );\n\n      /* `fir' and `pix' must be at least 32 bit wide, since the sum of */\n      /* the values in `weights' can exceed 0xFF                        */\n\n      for ( ; height > 0; height--, line += bitmap->pitch )\n      {\n        FT_UInt  fir[4];        /* below, `pix' is used as the 5th element */\n        FT_UInt  val1, xx;\n\n\n        val1   = line[0];\n        fir[0] = weights[2] * val1;\n        fir[1] = weights[3] * val1;\n        fir[2] = weights[4] * val1;\n        fir[3] = 0;\n\n        val1    = line[1];\n        fir[0] += weights[1] * val1;\n        fir[1] += weights[2] * val1;\n        fir[2] += weights[3] * val1;\n        fir[3] += weights[4] * val1;\n\n        for ( xx = 2; xx < width; xx++ )\n        {\n          FT_UInt  val, pix;\n\n\n          val    = line[xx];\n          pix    = fir[0] + weights[0] * val;\n          fir[0] = fir[1] + weights[1] * val;\n          fir[1] = fir[2] + weights[2] * val;\n          fir[2] = fir[3] + weights[3] * val;\n          fir[3] =          weights[4] * val;\n\n          pix        >>= 8;\n          pix         |= (FT_UInt)-(FT_Int)( pix >> 8 );\n          line[xx - 2] = (FT_Byte)pix;\n        }\n\n        {\n          FT_UInt  pix;\n\n\n          pix          = fir[0] >> 8;\n          pix         |= (FT_UInt)-(FT_Int)( pix >> 8 );\n          line[xx - 2] = (FT_Byte)pix;\n\n          pix          = fir[1] >> 8;\n          pix         |= (FT_UInt)-(FT_Int)( pix >> 8 );\n          line[xx - 1] = (FT_Byte)pix;\n        }\n      }\n    }\n\n    /* vertical in-place FIR filter */\n    else if ( mode == FT_RENDER_MODE_LCD_V && height >= 4 )\n    {\n      FT_Byte*  column = bitmap->buffer;\n      FT_Int    pitch  = bitmap->pitch;\n\n\n      /* take care of bitmap flow */\n      if ( bitmap->pitch < 0 )\n        column -= bitmap->pitch * ( bitmap->rows - 1 );\n\n      for ( ; width > 0; width--, column++ )\n      {\n        FT_Byte*  col = column;\n        FT_UInt   fir[4];       /* below, `pix' is used as the 5th element */\n        FT_UInt   val1, yy;\n\n\n        val1   = col[0];\n        fir[0] = weights[2] * val1;\n        fir[1] = weights[3] * val1;\n        fir[2] = weights[4] * val1;\n        fir[3] = 0;\n        col   += pitch;\n\n        val1    = col[0];\n        fir[0] += weights[1] * val1;\n        fir[1] += weights[2] * val1;\n        fir[2] += weights[3] * val1;\n        fir[3] += weights[4] * val1;\n        col    += pitch;\n\n        for ( yy = 2; yy < height; yy++ )\n        {\n          FT_UInt  val, pix;\n\n\n          val    = col[0];\n          pix    = fir[0] + weights[0] * val;\n          fir[0] = fir[1] + weights[1] * val;\n          fir[1] = fir[2] + weights[2] * val;\n          fir[2] = fir[3] + weights[3] * val;\n          fir[3] =          weights[4] * val;\n\n          pix           >>= 8;\n          pix            |= (FT_UInt)-(FT_Int)( pix >> 8 );\n          col[-2 * pitch] = (FT_Byte)pix;\n          col            += pitch;\n        }\n\n        {\n          FT_UInt  pix;\n\n\n          pix             = fir[0] >> 8;\n          pix            |= (FT_UInt)-(FT_Int)( pix >> 8 );\n          col[-2 * pitch] = (FT_Byte)pix;\n\n          pix         = fir[1] >> 8;\n          pix        |= (FT_UInt)-(FT_Int)( pix >> 8 );\n          col[-pitch] = (FT_Byte)pix;\n        }\n      }\n    }\n  }\n\n\n#ifdef USE_LEGACY\n\n  /* intra-pixel filter used by the legacy filter */\n  static void\n  _ft_lcd_filter_legacy( FT_Bitmap*      bitmap,\n                         FT_Render_Mode  mode,\n                         FT_Library      library )\n  {\n    FT_UInt  width  = (FT_UInt)bitmap->width;\n    FT_UInt  height = (FT_UInt)bitmap->rows;\n    FT_Int   pitch  = bitmap->pitch;\n\n    static const int  filters[3][3] =\n    {\n      { 65538 * 9/13, 65538 * 1/6, 65538 * 1/13 },\n      { 65538 * 3/13, 65538 * 4/6, 65538 * 3/13 },\n      { 65538 * 1/13, 65538 * 1/6, 65538 * 9/13 }\n    };\n\n    FT_UNUSED( library );\n\n\n    /* horizontal in-place intra-pixel filter */\n    if ( mode == FT_RENDER_MODE_LCD && width >= 3 )\n    {\n      FT_Byte*  line = bitmap->buffer;\n\n\n      /* take care of bitmap flow */\n      if ( bitmap->pitch < 0 )\n        line -= bitmap->pitch * ( bitmap->rows - 1 );\n\n      for ( ; height > 0; height--, line += pitch )\n      {\n        FT_UInt  xx;\n\n\n        for ( xx = 0; xx < width; xx += 3 )\n        {\n          FT_UInt  r = 0;\n          FT_UInt  g = 0;\n          FT_UInt  b = 0;\n          FT_UInt  p;\n\n\n          p  = line[xx];\n          r += filters[0][0] * p;\n          g += filters[0][1] * p;\n          b += filters[0][2] * p;\n\n          p  = line[xx + 1];\n          r += filters[1][0] * p;\n          g += filters[1][1] * p;\n          b += filters[1][2] * p;\n\n          p  = line[xx + 2];\n          r += filters[2][0] * p;\n          g += filters[2][1] * p;\n          b += filters[2][2] * p;\n\n          line[xx]     = (FT_Byte)( r / 65536 );\n          line[xx + 1] = (FT_Byte)( g / 65536 );\n          line[xx + 2] = (FT_Byte)( b / 65536 );\n        }\n      }\n    }\n    else if ( mode == FT_RENDER_MODE_LCD_V && height >= 3 )\n    {\n      FT_Byte*  column = bitmap->buffer;\n\n\n      /* take care of bitmap flow */\n      if ( bitmap->pitch < 0 )\n        column -= bitmap->pitch * ( bitmap->rows - 1 );\n\n      for ( ; width > 0; width--, column++ )\n      {\n        FT_Byte*  col     = column;\n        FT_Byte*  col_end = col + height * pitch;\n\n\n        for ( ; col < col_end; col += 3 * pitch )\n        {\n          FT_UInt  r = 0;\n          FT_UInt  g = 0;\n          FT_UInt  b = 0;\n          FT_UInt  p;\n\n\n          p  = col[0];\n          r += filters[0][0] * p;\n          g += filters[0][1] * p;\n          b += filters[0][2] * p;\n\n          p  = col[pitch];\n          r += filters[1][0] * p;\n          g += filters[1][1] * p;\n          b += filters[1][2] * p;\n\n          p  = col[pitch * 2];\n          r += filters[2][0] * p;\n          g += filters[2][1] * p;\n          b += filters[2][2] * p;\n\n          col[0]         = (FT_Byte)( r / 65536 );\n          col[pitch]     = (FT_Byte)( g / 65536 );\n          col[2 * pitch] = (FT_Byte)( b / 65536 );\n        }\n      }\n    }\n  }\n\n#endif /* USE_LEGACY */\n\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Library_SetLcdFilterWeights( FT_Library      library,\n                                  unsigned char  *weights )\n  {\n    if ( !library )\n      return FT_THROW( Invalid_Library_Handle );\n\n    if ( !weights )\n      return FT_THROW( Invalid_Argument );\n\n    ft_memcpy( library->lcd_weights, weights, 5 );\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Library_SetLcdFilter( FT_Library    library,\n                           FT_LcdFilter  filter )\n  {\n    static const FT_Byte  light_filter[5] =\n                            { 0x00, 0x55, 0x56, 0x55, 0x00 };\n    /* the values here sum up to a value larger than 256, */\n    /* providing a cheap gamma correction                 */\n    static const FT_Byte  default_filter[5] =\n                            { 0x10, 0x40, 0x70, 0x40, 0x10 };\n\n\n    if ( !library )\n      return FT_THROW( Invalid_Library_Handle );\n\n    switch ( filter )\n    {\n    case FT_LCD_FILTER_NONE:\n      library->lcd_filter_func = NULL;\n      library->lcd_extra       = 0;\n      break;\n\n    case FT_LCD_FILTER_DEFAULT:\n#if defined( FT_FORCE_LEGACY_LCD_FILTER )\n\n      library->lcd_filter_func = _ft_lcd_filter_legacy;\n      library->lcd_extra       = 0;\n\n#elif defined( FT_FORCE_LIGHT_LCD_FILTER )\n\n      ft_memcpy( library->lcd_weights, light_filter, 5 );\n      library->lcd_filter_func = _ft_lcd_filter_fir;\n      library->lcd_extra       = 2;\n\n#else\n\n      ft_memcpy( library->lcd_weights, default_filter, 5 );\n      library->lcd_filter_func = _ft_lcd_filter_fir;\n      library->lcd_extra       = 2;\n\n#endif\n\n      break;\n\n    case FT_LCD_FILTER_LIGHT:\n      ft_memcpy( library->lcd_weights, light_filter, 5 );\n      library->lcd_filter_func = _ft_lcd_filter_fir;\n      library->lcd_extra       = 2;\n      break;\n\n#ifdef USE_LEGACY\n\n    case FT_LCD_FILTER_LEGACY:\n      library->lcd_filter_func = _ft_lcd_filter_legacy;\n      library->lcd_extra       = 0;\n      break;\n\n#endif\n\n    default:\n      return FT_THROW( Invalid_Argument );\n    }\n\n    library->lcd_filter = filter;\n\n    return FT_Err_Ok;\n  }\n\n#else /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Library_SetLcdFilterWeights( FT_Library      library,\n                                  unsigned char  *weights )\n  {\n    FT_UNUSED( library );\n    FT_UNUSED( weights );\n\n    return FT_THROW( Unimplemented_Feature );\n  }\n\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Library_SetLcdFilter( FT_Library    library,\n                           FT_LcdFilter  filter )\n  {\n    FT_UNUSED( library );\n    FT_UNUSED( filter );\n\n    return FT_THROW( Unimplemented_Feature );\n  }\n\n#endif /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftmac.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmac.c                                                                */\n/*                                                                         */\n/*    Mac FOND support.  Written by just@letterror.com.                    */\n/*  Heavily modified by mpsuzuki, George Williams, and Sean McBride.       */\n/*                                                                         */\n/*  This file is for Mac OS X only; see builds/mac/ftoldmac.c for          */\n/*  classic platforms built by MPW.                                        */\n/*                                                                         */\n/*  Copyright 1996-2009, 2013, 2014 by                                     */\n/*  Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.     */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*\n    Notes\n\n    Mac suitcase files can (and often do!) contain multiple fonts.  To\n    support this I use the face_index argument of FT_(Open|New)_Face()\n    functions, and pretend the suitcase file is a collection.\n\n    Warning: fbit and NFNT bitmap resources are not supported yet.  In old\n    sfnt fonts, bitmap glyph data for each size is stored in each `NFNT'\n    resources instead of the `bdat' table in the sfnt resource.  Therefore,\n    face->num_fixed_sizes is set to 0, because bitmap data in `NFNT'\n    resource is unavailable at present.\n\n    The Mac FOND support works roughly like this:\n\n    - Check whether the offered stream points to a Mac suitcase file.  This\n      is done by checking the file type: it has to be 'FFIL' or 'tfil'.  The\n      stream that gets passed to our init_face() routine is a stdio stream,\n      which isn't usable for us, since the FOND resources live in the\n      resource fork.  So we just grab the stream->pathname field.\n\n    - Read the FOND resource into memory, then check whether there is a\n      TrueType font and/or(!) a Type 1 font available.\n\n    - If there is a Type 1 font available (as a separate `LWFN' file), read\n      its data into memory, massage it slightly so it becomes PFB data, wrap\n      it into a memory stream, load the Type 1 driver and delegate the rest\n      of the work to it by calling FT_Open_Face().  (XXX TODO: after this\n      has been done, the kerning data from the FOND resource should be\n      appended to the face: On the Mac there are usually no AFM files\n      available.  However, this is tricky since we need to map Mac char\n      codes to ps glyph names to glyph ID's...)\n\n    - If there is a TrueType font (an `sfnt' resource), read it into memory,\n      wrap it into a memory stream, load the TrueType driver and delegate\n      the rest of the work to it, by calling FT_Open_Face().\n\n    - Some suitcase fonts (notably Onyx) might point the `LWFN' file to\n      itself, even though it doesn't contains `POST' resources.  To handle\n      this special case without opening the file an extra time, we just\n      ignore errors from the `LWFN' and fallback to the `sfnt' if both are\n      available.\n  */\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_TRUETYPE_TAGS_H\n#include FT_INTERNAL_STREAM_H\n#include \"ftbase.h\"\n\n  /* This is for Mac OS X.  Without redefinition, OS_INLINE */\n  /* expands to `static inline' which doesn't survive the   */\n  /* -ansi compilation flag of GCC.                         */\n#if !HAVE_ANSI_OS_INLINE\n#undef  OS_INLINE\n#define OS_INLINE  static __inline__\n#endif\n\n  /* `configure' checks the availability of `ResourceIndex' strictly */\n  /* and sets HAVE_TYPE_RESOURCE_INDEX 1 or 0 always.  If it is      */\n  /* not set (e.g., a build without `configure'), the availability   */\n  /* is guessed from the SDK version.                                */\n#ifndef HAVE_TYPE_RESOURCE_INDEX\n#if !defined( MAC_OS_X_VERSION_10_5 ) || \\\n    ( MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 )\n#define HAVE_TYPE_RESOURCE_INDEX 0\n#else\n#define HAVE_TYPE_RESOURCE_INDEX 1\n#endif\n#endif /* !HAVE_TYPE_RESOURCE_INDEX */\n\n#if ( HAVE_TYPE_RESOURCE_INDEX == 0 )\n  typedef short  ResourceIndex;\n#endif\n\n#include <CoreServices/CoreServices.h>\n#include <ApplicationServices/ApplicationServices.h>\n#include <sys/syslimits.h> /* PATH_MAX */\n\n  /* Don't want warnings about our own use of deprecated functions. */\n#define FT_DEPRECATED_ATTRIBUTE\n\n#include FT_MAC_H\n\n#ifndef kATSOptionFlagsUnRestrictedScope /* since Mac OS X 10.1 */\n#define kATSOptionFlagsUnRestrictedScope kATSOptionFlagsDefault\n#endif\n\n\n  /* Set PREFER_LWFN to 1 if LWFN (Type 1) is preferred over\n     TrueType in case *both* are available (this is not common,\n     but it *is* possible). */\n#ifndef PREFER_LWFN\n#define PREFER_LWFN  1\n#endif\n\n\n#ifdef FT_MACINTOSH\n\n  /* This function is deprecated because FSSpec is deprecated in Mac OS X  */\n  FT_EXPORT_DEF( FT_Error )\n  FT_GetFile_From_Mac_Name( const char*  fontName,\n                            FSSpec*      pathSpec,\n                            FT_Long*     face_index )\n  {\n    FT_UNUSED( fontName );\n    FT_UNUSED( pathSpec );\n    FT_UNUSED( face_index );\n\n    return FT_THROW( Unimplemented_Feature );\n  }\n\n\n  /* Private function.                                         */\n  /* The FSSpec type has been discouraged for a long time,     */\n  /* unfortunately an FSRef replacement API for                */\n  /* ATSFontGetFileSpecification() is only available in        */\n  /* Mac OS X 10.5 and later.                                  */\n  static OSStatus\n  FT_ATSFontGetFileReference( ATSFontRef  ats_font_id,\n                              FSRef*      ats_font_ref )\n  {\n#if defined( MAC_OS_X_VERSION_10_5 ) && \\\n    ( MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 )\n\n    OSStatus  err;\n\n    err = ATSFontGetFileReference( ats_font_id, ats_font_ref );\n\n    return err;\n#elif __LP64__ /* No 64bit Carbon API on legacy platforms */\n    FT_UNUSED( ats_font_id );\n    FT_UNUSED( ats_font_ref );\n\n\n    return fnfErr;\n#else /* 32bit Carbon API on legacy platforms */\n    OSStatus  err;\n    FSSpec    spec;\n\n\n    err = ATSFontGetFileSpecification( ats_font_id, &spec );\n    if ( noErr == err )\n      err = FSpMakeFSRef( &spec, ats_font_ref );\n\n    return err;\n#endif\n  }\n\n\n  static FT_Error\n  FT_GetFileRef_From_Mac_ATS_Name( const char*  fontName,\n                                   FSRef*       ats_font_ref,\n                                   FT_Long*     face_index )\n  {\n    CFStringRef  cf_fontName;\n    ATSFontRef   ats_font_id;\n\n\n    *face_index = 0;\n\n    cf_fontName = CFStringCreateWithCString( NULL, fontName,\n                                             kCFStringEncodingMacRoman );\n    ats_font_id = ATSFontFindFromName( cf_fontName,\n                                       kATSOptionFlagsUnRestrictedScope );\n    CFRelease( cf_fontName );\n\n    if ( ats_font_id == 0 || ats_font_id == 0xFFFFFFFFUL )\n      return FT_THROW( Unknown_File_Format );\n\n    if ( noErr != FT_ATSFontGetFileReference( ats_font_id, ats_font_ref ) )\n      return FT_THROW( Unknown_File_Format );\n\n    /* face_index calculation by searching preceding fontIDs */\n    /* with same FSRef                                       */\n    {\n      ATSFontRef  id2 = ats_font_id - 1;\n      FSRef       ref2;\n\n\n      while ( id2 > 0 )\n      {\n        if ( noErr != FT_ATSFontGetFileReference( id2, &ref2 ) )\n          break;\n        if ( noErr != FSCompareFSRefs( ats_font_ref, &ref2 ) )\n          break;\n\n        id2 --;\n      }\n      *face_index = ats_font_id - ( id2 + 1 );\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_GetFilePath_From_Mac_ATS_Name( const char*  fontName,\n                                    UInt8*       path,\n                                    UInt32       maxPathSize,\n                                    FT_Long*     face_index )\n  {\n    FSRef     ref;\n    FT_Error  err;\n\n\n    if ( !fontName || !face_index )\n      return FT_THROW( Invalid_Argument) ;\n\n    err = FT_GetFileRef_From_Mac_ATS_Name( fontName, &ref, face_index );\n    if ( err )\n      return err;\n\n    if ( noErr != FSRefMakePath( &ref, path, maxPathSize ) )\n      return FT_THROW( Unknown_File_Format );\n\n    return FT_Err_Ok;\n  }\n\n\n  /* This function is deprecated because FSSpec is deprecated in Mac OS X  */\n  FT_EXPORT_DEF( FT_Error )\n  FT_GetFile_From_Mac_ATS_Name( const char*  fontName,\n                                FSSpec*      pathSpec,\n                                FT_Long*     face_index )\n  {\n#if ( __LP64__ ) || ( defined( MAC_OS_X_VERSION_10_5 ) && \\\n      ( MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 ) )\n    FT_UNUSED( fontName );\n    FT_UNUSED( pathSpec );\n    FT_UNUSED( face_index );\n\n    return FT_THROW( Unimplemented_Feature );\n#else\n    FSRef     ref;\n    FT_Error  err;\n\n\n    if ( !fontName || !face_index )\n      return FT_THROW( Invalid_Argument );\n\n    err = FT_GetFileRef_From_Mac_ATS_Name( fontName, &ref, face_index );\n    if ( err )\n      return err;\n\n    if ( noErr != FSGetCatalogInfo( &ref, kFSCatInfoNone, NULL, NULL,\n                                    pathSpec, NULL ) )\n      return FT_THROW( Unknown_File_Format );\n\n    return FT_Err_Ok;\n#endif\n  }\n\n\n  static OSErr\n  FT_FSPathMakeRes( const UInt8*    pathname,\n                    ResFileRefNum*  res )\n  {\n    OSErr  err;\n    FSRef  ref;\n\n\n    if ( noErr != FSPathMakeRef( pathname, &ref, FALSE ) )\n      return FT_THROW( Cannot_Open_Resource );\n\n    /* at present, no support for dfont format */\n    err = FSOpenResourceFile( &ref, 0, NULL, fsRdPerm, res );\n    if ( noErr == err )\n      return err;\n\n    /* fallback to original resource-fork font */\n    *res = FSOpenResFile( &ref, fsRdPerm );\n    err  = ResError();\n\n    return err;\n  }\n\n\n  /* Return the file type for given pathname */\n  static OSType\n  get_file_type_from_path( const UInt8*  pathname )\n  {\n    FSRef          ref;\n    FSCatalogInfo  info;\n\n\n    if ( noErr != FSPathMakeRef( pathname, &ref, FALSE ) )\n      return ( OSType ) 0;\n\n    if ( noErr != FSGetCatalogInfo( &ref, kFSCatInfoFinderInfo, &info,\n                                    NULL, NULL, NULL ) )\n      return ( OSType ) 0;\n\n    return ((FInfo *)(info.finderInfo))->fdType;\n  }\n\n\n  /* Given a PostScript font name, create the Macintosh LWFN file name. */\n  static void\n  create_lwfn_name( char*   ps_name,\n                    Str255  lwfn_file_name )\n  {\n    int       max = 5, count = 0;\n    FT_Byte*  p = lwfn_file_name;\n    FT_Byte*  q = (FT_Byte*)ps_name;\n\n\n    lwfn_file_name[0] = 0;\n\n    while ( *q )\n    {\n      if ( ft_isupper( *q ) )\n      {\n        if ( count )\n          max = 3;\n        count = 0;\n      }\n      if ( count < max && ( ft_isalnum( *q ) || *q == '_' ) )\n      {\n        *++p = *q;\n        lwfn_file_name[0]++;\n        count++;\n      }\n      q++;\n    }\n  }\n\n\n  static short\n  count_faces_sfnt( char*  fond_data )\n  {\n    /* The count is 1 greater than the value in the FOND.  */\n    /* Isn't that cute? :-)                                */\n\n    return EndianS16_BtoN( *( (short*)( fond_data +\n                                        sizeof ( FamRec ) ) ) ) + 1;\n  }\n\n\n  static short\n  count_faces_scalable( char*  fond_data )\n  {\n    AsscEntry*  assoc;\n    short       i, face, face_all;\n\n\n    face_all = EndianS16_BtoN( *( (short *)( fond_data +\n                                             sizeof ( FamRec ) ) ) ) + 1;\n    assoc    = (AsscEntry*)( fond_data + sizeof ( FamRec ) + 2 );\n    face     = 0;\n\n    for ( i = 0; i < face_all; i++ )\n    {\n      if ( 0 == EndianS16_BtoN( assoc[i].fontSize ) )\n        face++;\n    }\n    return face;\n  }\n\n\n  /* Look inside the FOND data, answer whether there should be an SFNT\n     resource, and answer the name of a possible LWFN Type 1 file.\n\n     Thanks to Paul Miller (paulm@profoundeffects.com) for the fix\n     to load a face OTHER than the first one in the FOND!\n  */\n\n\n  static void\n  parse_fond( char*   fond_data,\n              short*  have_sfnt,\n              ResID*  sfnt_id,\n              Str255  lwfn_file_name,\n              short   face_index )\n  {\n    AsscEntry*  assoc;\n    AsscEntry*  base_assoc;\n    FamRec*     fond;\n\n\n    *sfnt_id          = 0;\n    *have_sfnt        = 0;\n    lwfn_file_name[0] = 0;\n\n    fond       = (FamRec*)fond_data;\n    assoc      = (AsscEntry*)( fond_data + sizeof ( FamRec ) + 2 );\n    base_assoc = assoc;\n\n    /* the maximum faces in a FOND is 48, size of StyleTable.indexes[] */\n    if ( 47 < face_index )\n      return;\n\n    /* Let's do a little range checking before we get too excited here */\n    if ( face_index < count_faces_sfnt( fond_data ) )\n    {\n      assoc += face_index;        /* add on the face_index! */\n\n      /* if the face at this index is not scalable,\n         fall back to the first one (old behavior) */\n      if ( EndianS16_BtoN( assoc->fontSize ) == 0 )\n      {\n        *have_sfnt = 1;\n        *sfnt_id   = EndianS16_BtoN( assoc->fontID );\n      }\n      else if ( base_assoc->fontSize == 0 )\n      {\n        *have_sfnt = 1;\n        *sfnt_id   = EndianS16_BtoN( base_assoc->fontID );\n      }\n    }\n\n    if ( EndianS32_BtoN( fond->ffStylOff ) )\n    {\n      unsigned char*  p = (unsigned char*)fond_data;\n      StyleTable*     style;\n      unsigned short  string_count;\n      char            ps_name[256];\n      unsigned char*  names[64];\n      int             i;\n\n\n      p += EndianS32_BtoN( fond->ffStylOff );\n      style = (StyleTable*)p;\n      p += sizeof ( StyleTable );\n      string_count = EndianS16_BtoN( *(short*)(p) );\n      string_count = FT_MIN( 64, string_count );\n      p += sizeof ( short );\n\n      for ( i = 0; i < string_count; i++ )\n      {\n        names[i] = p;\n        p       += names[i][0];\n        p++;\n      }\n\n      {\n        size_t  ps_name_len = (size_t)names[0][0];\n\n\n        if ( ps_name_len != 0 )\n        {\n          ft_memcpy(ps_name, names[0] + 1, ps_name_len);\n          ps_name[ps_name_len] = 0;\n        }\n        if ( style->indexes[face_index] > 1 &&\n             style->indexes[face_index] <= string_count )\n        {\n          unsigned char*  suffixes = names[style->indexes[face_index] - 1];\n\n\n          for ( i = 1; i <= suffixes[0]; i++ )\n          {\n            unsigned char*  s;\n            size_t          j = suffixes[i] - 1;\n\n\n            if ( j < string_count && ( s = names[j] ) != NULL )\n            {\n              size_t  s_len = (size_t)s[0];\n\n\n              if ( s_len != 0 && ps_name_len + s_len < sizeof ( ps_name ) )\n              {\n                ft_memcpy( ps_name + ps_name_len, s + 1, s_len );\n                ps_name_len += s_len;\n                ps_name[ps_name_len] = 0;\n              }\n            }\n          }\n        }\n      }\n\n      create_lwfn_name( ps_name, lwfn_file_name );\n    }\n  }\n\n\n  static  FT_Error\n  lookup_lwfn_by_fond( const UInt8*      path_fond,\n                       ConstStr255Param  base_lwfn,\n                       UInt8*            path_lwfn,\n                       size_t            path_size )\n  {\n    FSRef   ref, par_ref;\n    size_t  dirname_len;\n\n\n    /* Pathname for FSRef can be in various formats: HFS, HFS+, and POSIX. */\n    /* We should not extract parent directory by string manipulation.      */\n\n    if ( noErr != FSPathMakeRef( path_fond, &ref, FALSE ) )\n      return FT_THROW( Invalid_Argument );\n\n    if ( noErr != FSGetCatalogInfo( &ref, kFSCatInfoNone,\n                                    NULL, NULL, NULL, &par_ref ) )\n      return FT_THROW( Invalid_Argument );\n\n    if ( noErr != FSRefMakePath( &par_ref, path_lwfn, path_size ) )\n      return FT_THROW( Invalid_Argument );\n\n    if ( ft_strlen( (char *)path_lwfn ) + 1 + base_lwfn[0] > path_size )\n      return FT_THROW( Invalid_Argument );\n\n    /* now we have absolute dirname in path_lwfn */\n    ft_strcat( (char *)path_lwfn, \"/\" );\n    dirname_len = ft_strlen( (char *)path_lwfn );\n    ft_strcat( (char *)path_lwfn, (char *)base_lwfn + 1 );\n    path_lwfn[dirname_len + base_lwfn[0]] = '\\0';\n\n    if ( noErr != FSPathMakeRef( path_lwfn, &ref, FALSE ) )\n      return FT_THROW( Cannot_Open_Resource );\n\n    if ( noErr != FSGetCatalogInfo( &ref, kFSCatInfoNone,\n                                    NULL, NULL, NULL, NULL ) )\n      return FT_THROW( Cannot_Open_Resource );\n\n    return FT_Err_Ok;\n  }\n\n\n  static short\n  count_faces( Handle        fond,\n               const UInt8*  pathname )\n  {\n    ResID     sfnt_id;\n    short     have_sfnt, have_lwfn;\n    Str255    lwfn_file_name;\n    UInt8     buff[PATH_MAX];\n    FT_Error  err;\n    short     num_faces;\n\n\n    have_sfnt = have_lwfn = 0;\n\n    parse_fond( *fond, &have_sfnt, &sfnt_id, lwfn_file_name, 0 );\n\n    if ( lwfn_file_name[0] )\n    {\n      err = lookup_lwfn_by_fond( pathname, lwfn_file_name,\n                                 buff, sizeof ( buff )  );\n      if ( !err )\n        have_lwfn = 1;\n    }\n\n    if ( have_lwfn && ( !have_sfnt || PREFER_LWFN ) )\n      num_faces = 1;\n    else\n      num_faces = count_faces_scalable( *fond );\n\n    return num_faces;\n  }\n\n\n  /* Read Type 1 data from the POST resources inside the LWFN file,\n     return a PFB buffer.  This is somewhat convoluted because the FT2\n     PFB parser wants the ASCII header as one chunk, and the LWFN\n     chunks are often not organized that way, so we glue chunks\n     of the same type together. */\n  static FT_Error\n  read_lwfn( FT_Memory      memory,\n             ResFileRefNum  res,\n             FT_Byte**      pfb_data,\n             FT_ULong*      size )\n  {\n    FT_Error       error = FT_Err_Ok;\n    ResID          res_id;\n    unsigned char  *buffer, *p, *size_p = NULL;\n    FT_ULong       total_size = 0;\n    FT_ULong       old_total_size = 0;\n    FT_ULong       post_size, pfb_chunk_size;\n    Handle         post_data;\n    char           code, last_code;\n\n\n    UseResFile( res );\n\n    /* First pass: load all POST resources, and determine the size of */\n    /* the output buffer.                                             */\n    res_id    = 501;\n    last_code = -1;\n\n    for (;;)\n    {\n      post_data = Get1Resource( TTAG_POST, res_id++ );\n      if ( post_data == NULL )\n        break;  /* we are done */\n\n      code = (*post_data)[0];\n\n      if ( code != last_code )\n      {\n        if ( code == 5 )\n          total_size += 2; /* just the end code */\n        else\n          total_size += 6; /* code + 4 bytes chunk length */\n      }\n\n      total_size += GetHandleSize( post_data ) - 2;\n      last_code = code;\n\n      /* detect integer overflows */\n      if ( total_size < old_total_size )\n      {\n        error = FT_THROW( Array_Too_Large );\n        goto Error;\n      }\n\n      old_total_size = total_size;\n    }\n\n    if ( FT_ALLOC( buffer, (FT_Long)total_size ) )\n      goto Error;\n\n    /* Second pass: append all POST data to the buffer, add PFB fields. */\n    /* Glue all consecutive chunks of the same type together.           */\n    p              = buffer;\n    res_id         = 501;\n    last_code      = -1;\n    pfb_chunk_size = 0;\n\n    for (;;)\n    {\n      post_data = Get1Resource( TTAG_POST, res_id++ );\n      if ( post_data == NULL )\n        break;  /* we are done */\n\n      post_size = (FT_ULong)GetHandleSize( post_data ) - 2;\n      code = (*post_data)[0];\n\n      if ( code != last_code )\n      {\n        if ( last_code != -1 )\n        {\n          /* we are done adding a chunk, fill in the size field */\n          if ( size_p != NULL )\n          {\n            *size_p++ = (FT_Byte)(   pfb_chunk_size         & 0xFF );\n            *size_p++ = (FT_Byte)( ( pfb_chunk_size >> 8  ) & 0xFF );\n            *size_p++ = (FT_Byte)( ( pfb_chunk_size >> 16 ) & 0xFF );\n            *size_p++ = (FT_Byte)( ( pfb_chunk_size >> 24 ) & 0xFF );\n          }\n          pfb_chunk_size = 0;\n        }\n\n        *p++ = 0x80;\n        if ( code == 5 )\n          *p++ = 0x03;  /* the end */\n        else if ( code == 2 )\n          *p++ = 0x02;  /* binary segment */\n        else\n          *p++ = 0x01;  /* ASCII segment */\n\n        if ( code != 5 )\n        {\n          size_p = p;   /* save for later */\n          p += 4;       /* make space for size field */\n        }\n      }\n\n      ft_memcpy( p, *post_data + 2, post_size );\n      pfb_chunk_size += post_size;\n      p += post_size;\n      last_code = code;\n    }\n\n    *pfb_data = buffer;\n    *size = total_size;\n\n  Error:\n    CloseResFile( res );\n    return error;\n  }\n\n\n  /* Create a new FT_Face from a file path to an LWFN file. */\n  static FT_Error\n  FT_New_Face_From_LWFN( FT_Library    library,\n                         const UInt8*  pathname,\n                         FT_Long       face_index,\n                         FT_Face*      aface )\n  {\n    FT_Byte*       pfb_data;\n    FT_ULong       pfb_size;\n    FT_Error       error;\n    ResFileRefNum  res;\n\n\n    if ( noErr != FT_FSPathMakeRes( pathname, &res ) )\n      return FT_THROW( Cannot_Open_Resource );\n\n    pfb_data = NULL;\n    pfb_size = 0;\n    error = read_lwfn( library->memory, res, &pfb_data, &pfb_size );\n    CloseResFile( res ); /* PFB is already loaded, useless anymore */\n    if ( error )\n      return error;\n\n    return open_face_from_buffer( library,\n                                  pfb_data,\n                                  pfb_size,\n                                  face_index,\n                                  \"type1\",\n                                  aface );\n  }\n\n\n  /* Create a new FT_Face from an SFNT resource, specified by res ID. */\n  static FT_Error\n  FT_New_Face_From_SFNT( FT_Library  library,\n                         ResID       sfnt_id,\n                         FT_Long     face_index,\n                         FT_Face*    aface )\n  {\n    Handle     sfnt = NULL;\n    FT_Byte*   sfnt_data;\n    size_t     sfnt_size;\n    FT_Error   error  = FT_Err_Ok;\n    FT_Memory  memory = library->memory;\n    int        is_cff, is_sfnt_ps;\n\n\n    sfnt = GetResource( TTAG_sfnt, sfnt_id );\n    if ( sfnt == NULL )\n      return FT_THROW( Invalid_Handle );\n\n    sfnt_size = (FT_ULong)GetHandleSize( sfnt );\n    if ( FT_ALLOC( sfnt_data, (FT_Long)sfnt_size ) )\n    {\n      ReleaseResource( sfnt );\n      return error;\n    }\n\n    ft_memcpy( sfnt_data, *sfnt, sfnt_size );\n    ReleaseResource( sfnt );\n\n    is_cff     = sfnt_size > 4 && !ft_memcmp( sfnt_data, \"OTTO\", 4 );\n    is_sfnt_ps = sfnt_size > 4 && !ft_memcmp( sfnt_data, \"typ1\", 4 );\n\n    if ( is_sfnt_ps )\n    {\n      FT_Stream  stream;\n\n\n      if ( FT_NEW( stream ) )\n        goto Try_OpenType;\n\n      FT_Stream_OpenMemory( stream, sfnt_data, sfnt_size );\n      if ( !open_face_PS_from_sfnt_stream( library,\n                                           stream,\n                                           face_index,\n                                           0, NULL,\n                                           aface ) )\n      {\n        FT_Stream_Close( stream );\n        FT_FREE( stream );\n        FT_FREE( sfnt_data );\n        goto Exit;\n      }\n\n      FT_FREE( stream );\n    }\n  Try_OpenType:\n    error = open_face_from_buffer( library,\n                                   sfnt_data,\n                                   sfnt_size,\n                                   face_index,\n                                   is_cff ? \"cff\" : \"truetype\",\n                                   aface );\n  Exit:\n    return error;\n  }\n\n\n  /* Create a new FT_Face from a file path to a suitcase file. */\n  static FT_Error\n  FT_New_Face_From_Suitcase( FT_Library    library,\n                             const UInt8*  pathname,\n                             FT_Long       face_index,\n                             FT_Face*      aface )\n  {\n    FT_Error       error = FT_ERR( Cannot_Open_Resource );\n    ResFileRefNum  res_ref;\n    ResourceIndex  res_index;\n    Handle         fond;\n    short          num_faces_in_res;\n\n\n    if ( noErr != FT_FSPathMakeRes( pathname, &res_ref ) )\n      return FT_THROW( Cannot_Open_Resource );\n\n    UseResFile( res_ref );\n    if ( ResError() )\n      return FT_THROW( Cannot_Open_Resource );\n\n    num_faces_in_res = 0;\n    for ( res_index = 1; ; ++res_index )\n    {\n      short  num_faces_in_fond;\n\n\n      fond = Get1IndResource( TTAG_FOND, res_index );\n      if ( ResError() )\n        break;\n\n      num_faces_in_fond  = count_faces( fond, pathname );\n      num_faces_in_res  += num_faces_in_fond;\n\n      if ( 0 <= face_index && face_index < num_faces_in_fond && error )\n        error = FT_New_Face_From_FOND( library, fond, face_index, aface );\n\n      face_index -= num_faces_in_fond;\n    }\n\n    CloseResFile( res_ref );\n    if ( !error && aface && *aface )\n      (*aface)->num_faces = num_faces_in_res;\n    return error;\n  }\n\n\n  /* documentation is in ftmac.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_New_Face_From_FOND( FT_Library  library,\n                         Handle      fond,\n                         FT_Long     face_index,\n                         FT_Face*    aface )\n  {\n    short     have_sfnt, have_lwfn = 0;\n    ResID     sfnt_id, fond_id;\n    OSType    fond_type;\n    Str255    fond_name;\n    Str255    lwfn_file_name;\n    UInt8     path_lwfn[PATH_MAX];\n    OSErr     err;\n    FT_Error  error = FT_Err_Ok;\n\n\n    /* check of `library' and `aface' delayed to `FT_New_Face_From_XXX' */\n\n    GetResInfo( fond, &fond_id, &fond_type, fond_name );\n    if ( ResError() != noErr || fond_type != TTAG_FOND )\n      return FT_THROW( Invalid_File_Format );\n\n    parse_fond( *fond, &have_sfnt, &sfnt_id, lwfn_file_name, face_index );\n\n    if ( lwfn_file_name[0] )\n    {\n      ResFileRefNum  res;\n\n\n      res = HomeResFile( fond );\n      if ( noErr != ResError() )\n        goto found_no_lwfn_file;\n\n      {\n        UInt8  path_fond[PATH_MAX];\n        FSRef  ref;\n\n\n        err = FSGetForkCBInfo( res, kFSInvalidVolumeRefNum,\n                               NULL, NULL, NULL, &ref, NULL );\n        if ( noErr != err )\n          goto found_no_lwfn_file;\n\n        err = FSRefMakePath( &ref, path_fond, sizeof ( path_fond ) );\n        if ( noErr != err )\n          goto found_no_lwfn_file;\n\n        error = lookup_lwfn_by_fond( path_fond, lwfn_file_name,\n                                     path_lwfn, sizeof ( path_lwfn ) );\n        if ( !error )\n          have_lwfn = 1;\n      }\n    }\n\n    if ( have_lwfn && ( !have_sfnt || PREFER_LWFN ) )\n      error = FT_New_Face_From_LWFN( library,\n                                     path_lwfn,\n                                     face_index,\n                                     aface );\n    else\n      error = FT_THROW( Unknown_File_Format );\n\n  found_no_lwfn_file:\n    if ( have_sfnt && error )\n      error = FT_New_Face_From_SFNT( library,\n                                     sfnt_id,\n                                     face_index,\n                                     aface );\n\n    return error;\n  }\n\n\n  /* Common function to load a new FT_Face from a resource file. */\n  static FT_Error\n  FT_New_Face_From_Resource( FT_Library    library,\n                             const UInt8*  pathname,\n                             FT_Long       face_index,\n                             FT_Face*      aface )\n  {\n    OSType    file_type;\n    FT_Error  error;\n\n\n    /* LWFN is a (very) specific file format, check for it explicitly */\n    file_type = get_file_type_from_path( pathname );\n    if ( file_type == TTAG_LWFN )\n      return FT_New_Face_From_LWFN( library, pathname, face_index, aface );\n\n    /* Otherwise the file type doesn't matter (there are more than  */\n    /* `FFIL' and `tfil').  Just try opening it as a font suitcase; */\n    /* if it works, fine.                                           */\n\n    error = FT_New_Face_From_Suitcase( library, pathname, face_index, aface );\n    if ( error == 0 )\n      return error;\n\n    /* let it fall through to normal loader (.ttf, .otf, etc.); */\n    /* we signal this by returning no error and no FT_Face      */\n    *aface = NULL;\n    return 0;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is the Mac-specific implementation of FT_New_Face.  In        */\n  /*    addition to the standard FT_New_Face() functionality, it also      */\n  /*    accepts pathnames to Mac suitcase files.  For further              */\n  /*    documentation see the original FT_New_Face() in freetype.h.        */\n  /*                                                                       */\n  FT_EXPORT_DEF( FT_Error )\n  FT_New_Face( FT_Library   library,\n               const char*  pathname,\n               FT_Long      face_index,\n               FT_Face*     aface )\n  {\n    FT_Open_Args  args;\n    FT_Error      error;\n\n\n    /* test for valid `library' and `aface' delayed to FT_Open_Face() */\n    if ( !pathname )\n      return FT_THROW( Invalid_Argument );\n\n    *aface = NULL;\n\n    /* try resourcefork based font: LWFN, FFIL */\n    error = FT_New_Face_From_Resource( library, (UInt8 *)pathname,\n                                       face_index, aface );\n    if ( error != 0 || *aface != NULL )\n      return error;\n\n    /* let it fall through to normal loader (.ttf, .otf, etc.) */\n    args.flags    = FT_OPEN_PATHNAME;\n    args.pathname = (char*)pathname;\n    return FT_Open_Face( library, &args, face_index, aface );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FSRef                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FT_New_Face_From_FSRef is identical to FT_New_Face except it       */\n  /*    accepts an FSRef instead of a path.                                */\n  /*                                                                       */\n  /* This function is deprecated because Carbon data types (FSRef)         */\n  /* are not cross-platform, and thus not suitable for the freetype API.   */\n  FT_EXPORT_DEF( FT_Error )\n  FT_New_Face_From_FSRef( FT_Library    library,\n                          const FSRef*  ref,\n                          FT_Long       face_index,\n                          FT_Face*      aface )\n  {\n    FT_Error      error;\n    FT_Open_Args  args;\n\n    OSErr  err;\n    UInt8  pathname[PATH_MAX];\n\n\n    /* check of `library' and `aface' delayed to */\n    /* `FT_New_Face_From_Resource'               */\n\n    if ( !ref )\n      return FT_THROW( Invalid_Argument );\n\n    err = FSRefMakePath( ref, pathname, sizeof ( pathname ) );\n    if ( err )\n      error = FT_THROW( Cannot_Open_Resource );\n\n    error = FT_New_Face_From_Resource( library, pathname, face_index, aface );\n    if ( error != 0 || *aface != NULL )\n      return error;\n\n    /* fallback to datafork font */\n    args.flags    = FT_OPEN_PATHNAME;\n    args.pathname = (char*)pathname;\n    return FT_Open_Face( library, &args, face_index, aface );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FSSpec                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FT_New_Face_From_FSSpec is identical to FT_New_Face except it      */\n  /*    accepts an FSSpec instead of a path.                               */\n  /*                                                                       */\n  /* This function is deprecated because FSSpec is deprecated in Mac OS X  */\n  FT_EXPORT_DEF( FT_Error )\n  FT_New_Face_From_FSSpec( FT_Library     library,\n                           const FSSpec*  spec,\n                           FT_Long        face_index,\n                           FT_Face*       aface )\n  {\n#if ( __LP64__ ) || ( defined( MAC_OS_X_VERSION_10_5 ) && \\\n      ( MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 ) )\n    FT_UNUSED( library );\n    FT_UNUSED( spec );\n    FT_UNUSED( face_index );\n    FT_UNUSED( aface );\n\n    return FT_THROW( Unimplemented_Feature );\n#else\n    FSRef  ref;\n\n\n    /* check of `library' and `aface' delayed to `FT_New_Face_From_FSRef' */\n\n    if ( !spec || FSpMakeFSRef( spec, &ref ) != noErr )\n      return FT_THROW( Invalid_Argument );\n    else\n      return FT_New_Face_From_FSRef( library, &ref, face_index, aface );\n#endif\n  }\n\n#endif /* FT_MACINTOSH */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftmm.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmm.c                                                                 */\n/*                                                                         */\n/*    Multiple Master font support (body).                                 */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2004, 2009, 2013, 2014 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n\n#include FT_MULTIPLE_MASTERS_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_SERVICE_MULTIPLE_MASTERS_H\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_mm\n\n\n  static FT_Error\n  ft_face_get_mm_service( FT_Face                   face,\n                          FT_Service_MultiMasters  *aservice )\n  {\n    FT_Error  error;\n\n\n    *aservice = NULL;\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    error = FT_ERR( Invalid_Argument );\n\n    if ( FT_HAS_MULTIPLE_MASTERS( face ) )\n    {\n      FT_FACE_LOOKUP_SERVICE( face,\n                              *aservice,\n                              MULTI_MASTERS );\n\n      if ( *aservice )\n        error = FT_Err_Ok;\n    }\n\n    return error;\n  }\n\n\n  /* documentation is in ftmm.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Get_Multi_Master( FT_Face           face,\n                       FT_Multi_Master  *amaster )\n  {\n    FT_Error                 error;\n    FT_Service_MultiMasters  service;\n\n\n    /* check of `face' delayed to `ft_face_get_mm_service' */\n\n    if ( !amaster )\n      return FT_THROW( Invalid_Argument );\n\n    error = ft_face_get_mm_service( face, &service );\n    if ( !error )\n    {\n      error = FT_ERR( Invalid_Argument );\n      if ( service->get_mm )\n        error = service->get_mm( face, amaster );\n    }\n\n    return error;\n  }\n\n\n  /* documentation is in ftmm.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Get_MM_Var( FT_Face      face,\n                 FT_MM_Var*  *amaster )\n  {\n    FT_Error                 error;\n    FT_Service_MultiMasters  service;\n\n\n    /* check of `face' delayed to `ft_face_get_mm_service' */\n\n    if ( !amaster )\n      return FT_THROW( Invalid_Argument );\n\n    error = ft_face_get_mm_service( face, &service );\n    if ( !error )\n    {\n      error = FT_ERR( Invalid_Argument );\n      if ( service->get_mm_var )\n        error = service->get_mm_var( face, amaster );\n    }\n\n    return error;\n  }\n\n\n  /* documentation is in ftmm.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Set_MM_Design_Coordinates( FT_Face   face,\n                                FT_UInt   num_coords,\n                                FT_Long*  coords )\n  {\n    FT_Error                 error;\n    FT_Service_MultiMasters  service;\n\n\n    /* check of `face' delayed to `ft_face_get_mm_service' */\n\n    if ( !coords )\n      return FT_THROW( Invalid_Argument );\n\n    error = ft_face_get_mm_service( face, &service );\n    if ( !error )\n    {\n      error = FT_ERR( Invalid_Argument );\n      if ( service->set_mm_design )\n        error = service->set_mm_design( face, num_coords, coords );\n    }\n\n    return error;\n  }\n\n\n  /* documentation is in ftmm.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Set_Var_Design_Coordinates( FT_Face    face,\n                                 FT_UInt    num_coords,\n                                 FT_Fixed*  coords )\n  {\n    FT_Error                 error;\n    FT_Service_MultiMasters  service;\n\n\n    /* check of `face' delayed to `ft_face_get_mm_service' */\n\n    if ( !coords )\n      return FT_THROW( Invalid_Argument );\n\n    error = ft_face_get_mm_service( face, &service );\n    if ( !error )\n    {\n      error = FT_ERR( Invalid_Argument );\n      if ( service->set_var_design )\n        error = service->set_var_design( face, num_coords, coords );\n    }\n\n    return error;\n  }\n\n\n  /* documentation is in ftmm.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Set_MM_Blend_Coordinates( FT_Face    face,\n                               FT_UInt    num_coords,\n                               FT_Fixed*  coords )\n  {\n    FT_Error                 error;\n    FT_Service_MultiMasters  service;\n\n\n    /* check of `face' delayed to `ft_face_get_mm_service' */\n\n    if ( !coords )\n      return FT_THROW( Invalid_Argument );\n\n    error = ft_face_get_mm_service( face, &service );\n    if ( !error )\n    {\n      error = FT_ERR( Invalid_Argument );\n      if ( service->set_mm_blend )\n         error = service->set_mm_blend( face, num_coords, coords );\n    }\n\n    return error;\n  }\n\n\n  /* documentation is in ftmm.h */\n\n  /* This is exactly the same as the previous function.  It exists for */\n  /* orthogonality.                                                    */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Set_Var_Blend_Coordinates( FT_Face    face,\n                                FT_UInt    num_coords,\n                                FT_Fixed*  coords )\n  {\n    FT_Error                 error;\n    FT_Service_MultiMasters  service;\n\n\n    /* check of `face' delayed to `ft_face_get_mm_service' */\n\n    if ( !coords )\n      return FT_THROW( Invalid_Argument );\n\n    error = ft_face_get_mm_service( face, &service );\n    if ( !error )\n    {\n      error = FT_ERR( Invalid_Argument );\n      if ( service->set_mm_blend )\n         error = service->set_mm_blend( face, num_coords, coords );\n    }\n\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftobjs.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftobjs.c                                                               */\n/*                                                                         */\n/*    The FreeType private base classes (body).                            */\n/*                                                                         */\n/*  Copyright 1996-2014 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_LIST_H\n#include FT_OUTLINE_H\n#include FT_INTERNAL_VALIDATE_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_RFORK_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_SFNT_H    /* for SFNT_Load_Table_Func */\n#include FT_TRUETYPE_TABLES_H\n#include FT_TRUETYPE_TAGS_H\n#include FT_TRUETYPE_IDS_H\n\n#include FT_SERVICE_PROPERTIES_H\n#include FT_SERVICE_SFNT_H\n#include FT_SERVICE_POSTSCRIPT_NAME_H\n#include FT_SERVICE_GLYPH_DICT_H\n#include FT_SERVICE_TT_CMAP_H\n#include FT_SERVICE_KERNING_H\n#include FT_SERVICE_TRUETYPE_ENGINE_H\n\n#ifdef FT_CONFIG_OPTION_MAC_FONTS\n#include \"ftbase.h\"\n#endif\n\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n#include FT_BITMAP_H\n\n#if defined( _MSC_VER )      /* Visual C++ (and Intel C++)   */\n  /* We disable the warning `conversion from XXX to YYY,     */\n  /* possible loss of data' in order to compile cleanly with */\n  /* the maximum level of warnings: `md5.c' is non-FreeType  */\n  /* code, and it gets used during development builds only.  */\n#pragma warning( push )\n#pragma warning( disable : 4244 )\n#endif /* _MSC_VER */\n\n  /* it's easiest to include `md5.c' directly */\n#include \"md5.c\"\n\n#if defined( _MSC_VER )\n#pragma warning( pop )\n#endif\n\n#endif /* FT_DEBUG_LEVEL_TRACE */\n\n\n#define GRID_FIT_METRICS\n\n\n  FT_BASE_DEF( FT_Pointer )\n  ft_service_list_lookup( FT_ServiceDesc  service_descriptors,\n                          const char*     service_id )\n  {\n    FT_Pointer      result = NULL;\n    FT_ServiceDesc  desc   = service_descriptors;\n\n\n    if ( desc && service_id )\n    {\n      for ( ; desc->serv_id != NULL; desc++ )\n      {\n        if ( ft_strcmp( desc->serv_id, service_id ) == 0 )\n        {\n          result = (FT_Pointer)desc->serv_data;\n          break;\n        }\n      }\n    }\n\n    return result;\n  }\n\n\n  FT_BASE_DEF( void )\n  ft_validator_init( FT_Validator        valid,\n                     const FT_Byte*      base,\n                     const FT_Byte*      limit,\n                     FT_ValidationLevel  level )\n  {\n    valid->base  = base;\n    valid->limit = limit;\n    valid->level = level;\n    valid->error = FT_Err_Ok;\n  }\n\n\n  FT_BASE_DEF( FT_Int )\n  ft_validator_run( FT_Validator  valid )\n  {\n    /* This function doesn't work!  None should call it. */\n    FT_UNUSED( valid );\n\n    return -1;\n  }\n\n\n  FT_BASE_DEF( void )\n  ft_validator_error( FT_Validator  valid,\n                      FT_Error      error )\n  {\n    /* since the cast below also disables the compiler's */\n    /* type check, we introduce a dummy variable, which  */\n    /* will be optimized away                            */\n    volatile ft_jmp_buf* jump_buffer = &valid->jump_buffer;\n\n\n    valid->error = error;\n\n    /* throw away volatileness; use `jump_buffer' or the  */\n    /* compiler may warn about an unused local variable   */\n    ft_longjmp( *(ft_jmp_buf*) jump_buffer, 1 );\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                           S T R E A M                           ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* create a new input stream from an FT_Open_Args structure */\n  /*                                                          */\n  FT_BASE_DEF( FT_Error )\n  FT_Stream_New( FT_Library           library,\n                 const FT_Open_Args*  args,\n                 FT_Stream           *astream )\n  {\n    FT_Error   error;\n    FT_Memory  memory;\n    FT_Stream  stream = NULL;\n\n\n    *astream = 0;\n\n    if ( !library )\n      return FT_THROW( Invalid_Library_Handle );\n\n    if ( !args )\n      return FT_THROW( Invalid_Argument );\n\n    memory = library->memory;\n\n    if ( FT_NEW( stream ) )\n      goto Exit;\n\n    stream->memory = memory;\n\n    if ( args->flags & FT_OPEN_MEMORY )\n    {\n      /* create a memory-based stream */\n      FT_Stream_OpenMemory( stream,\n                            (const FT_Byte*)args->memory_base,\n                            args->memory_size );\n    }\n\n#ifndef FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT\n\n    else if ( args->flags & FT_OPEN_PATHNAME )\n    {\n      /* create a normal system stream */\n      error = FT_Stream_Open( stream, args->pathname );\n      stream->pathname.pointer = args->pathname;\n    }\n    else if ( ( args->flags & FT_OPEN_STREAM ) && args->stream )\n    {\n      /* use an existing, user-provided stream */\n\n      /* in this case, we do not need to allocate a new stream object */\n      /* since the caller is responsible for closing it himself       */\n      FT_FREE( stream );\n      stream = args->stream;\n    }\n\n#endif\n\n    else\n      error = FT_THROW( Invalid_Argument );\n\n    if ( error )\n      FT_FREE( stream );\n    else\n      stream->memory = memory;  /* just to be certain */\n\n    *astream = stream;\n\n  Exit:\n    return error;\n  }\n\n\n  FT_BASE_DEF( void )\n  FT_Stream_Free( FT_Stream  stream,\n                  FT_Int     external )\n  {\n    if ( stream )\n    {\n      FT_Memory  memory = stream->memory;\n\n\n      FT_Stream_Close( stream );\n\n      if ( !external )\n        FT_FREE( stream );\n    }\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_objs\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****               FACE, SIZE & GLYPH SLOT OBJECTS                   ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  static FT_Error\n  ft_glyphslot_init( FT_GlyphSlot  slot )\n  {\n    FT_Driver         driver   = slot->face->driver;\n    FT_Driver_Class   clazz    = driver->clazz;\n    FT_Memory         memory   = driver->root.memory;\n    FT_Error          error    = FT_Err_Ok;\n    FT_Slot_Internal  internal = NULL;\n\n\n    slot->library = driver->root.library;\n\n    if ( FT_NEW( internal ) )\n      goto Exit;\n\n    slot->internal = internal;\n\n    if ( FT_DRIVER_USES_OUTLINES( driver ) )\n      error = FT_GlyphLoader_New( memory, &internal->loader );\n\n    if ( !error && clazz->init_slot )\n      error = clazz->init_slot( slot );\n\n  Exit:\n    return error;\n  }\n\n\n  FT_BASE_DEF( void )\n  ft_glyphslot_free_bitmap( FT_GlyphSlot  slot )\n  {\n    if ( slot->internal && ( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) )\n    {\n      FT_Memory  memory = FT_FACE_MEMORY( slot->face );\n\n\n      FT_FREE( slot->bitmap.buffer );\n      slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;\n    }\n    else\n    {\n      /* assume that the bitmap buffer was stolen or not */\n      /* allocated from the heap                         */\n      slot->bitmap.buffer = NULL;\n    }\n  }\n\n\n  FT_BASE_DEF( void )\n  ft_glyphslot_set_bitmap( FT_GlyphSlot  slot,\n                           FT_Byte*      buffer )\n  {\n    ft_glyphslot_free_bitmap( slot );\n\n    slot->bitmap.buffer = buffer;\n\n    FT_ASSERT( (slot->internal->flags & FT_GLYPH_OWN_BITMAP) == 0 );\n  }\n\n\n  FT_BASE_DEF( FT_Error )\n  ft_glyphslot_alloc_bitmap( FT_GlyphSlot  slot,\n                             FT_ULong      size )\n  {\n    FT_Memory  memory = FT_FACE_MEMORY( slot->face );\n    FT_Error   error;\n\n\n    if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )\n      FT_FREE( slot->bitmap.buffer );\n    else\n      slot->internal->flags |= FT_GLYPH_OWN_BITMAP;\n\n    (void)FT_ALLOC( slot->bitmap.buffer, size );\n    return error;\n  }\n\n\n  static void\n  ft_glyphslot_clear( FT_GlyphSlot  slot )\n  {\n    /* free bitmap if needed */\n    ft_glyphslot_free_bitmap( slot );\n\n    /* clear all public fields in the glyph slot */\n    FT_ZERO( &slot->metrics );\n    FT_ZERO( &slot->outline );\n\n    slot->bitmap.width      = 0;\n    slot->bitmap.rows       = 0;\n    slot->bitmap.pitch      = 0;\n    slot->bitmap.pixel_mode = 0;\n    /* `slot->bitmap.buffer' has been handled by ft_glyphslot_free_bitmap */\n\n    slot->bitmap_left   = 0;\n    slot->bitmap_top    = 0;\n    slot->num_subglyphs = 0;\n    slot->subglyphs     = 0;\n    slot->control_data  = 0;\n    slot->control_len   = 0;\n    slot->other         = 0;\n    slot->format        = FT_GLYPH_FORMAT_NONE;\n\n    slot->linearHoriAdvance = 0;\n    slot->linearVertAdvance = 0;\n    slot->lsb_delta         = 0;\n    slot->rsb_delta         = 0;\n  }\n\n\n  static void\n  ft_glyphslot_done( FT_GlyphSlot  slot )\n  {\n    FT_Driver        driver = slot->face->driver;\n    FT_Driver_Class  clazz  = driver->clazz;\n    FT_Memory        memory = driver->root.memory;\n\n\n    if ( clazz->done_slot )\n      clazz->done_slot( slot );\n\n    /* free bitmap buffer if needed */\n    ft_glyphslot_free_bitmap( slot );\n\n    /* slot->internal might be NULL in out-of-memory situations */\n    if ( slot->internal )\n    {\n      /* free glyph loader */\n      if ( FT_DRIVER_USES_OUTLINES( driver ) )\n      {\n        FT_GlyphLoader_Done( slot->internal->loader );\n        slot->internal->loader = 0;\n      }\n\n      FT_FREE( slot->internal );\n    }\n  }\n\n\n  /* documentation is in ftobjs.h */\n\n  FT_BASE_DEF( FT_Error )\n  FT_New_GlyphSlot( FT_Face        face,\n                    FT_GlyphSlot  *aslot )\n  {\n    FT_Error         error;\n    FT_Driver        driver;\n    FT_Driver_Class  clazz;\n    FT_Memory        memory;\n    FT_GlyphSlot     slot = NULL;\n\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    if ( !face->driver )\n      return FT_THROW( Invalid_Argument );\n\n    driver = face->driver;\n    clazz  = driver->clazz;\n    memory = driver->root.memory;\n\n    FT_TRACE4(( \"FT_New_GlyphSlot: Creating new slot object\\n\" ));\n    if ( !FT_ALLOC( slot, clazz->slot_object_size ) )\n    {\n      slot->face = face;\n\n      error = ft_glyphslot_init( slot );\n      if ( error )\n      {\n        ft_glyphslot_done( slot );\n        FT_FREE( slot );\n        goto Exit;\n      }\n\n      slot->next  = face->glyph;\n      face->glyph = slot;\n\n      if ( aslot )\n        *aslot = slot;\n    }\n    else if ( aslot )\n      *aslot = 0;\n\n\n  Exit:\n    FT_TRACE4(( \"FT_New_GlyphSlot: Return %d\\n\", error ));\n    return error;\n  }\n\n\n  /* documentation is in ftobjs.h */\n\n  FT_BASE_DEF( void )\n  FT_Done_GlyphSlot( FT_GlyphSlot  slot )\n  {\n    if ( slot )\n    {\n      FT_Driver     driver = slot->face->driver;\n      FT_Memory     memory = driver->root.memory;\n      FT_GlyphSlot  prev;\n      FT_GlyphSlot  cur;\n\n\n      /* Remove slot from its parent face's list */\n      prev = NULL;\n      cur  = slot->face->glyph;\n\n      while ( cur )\n      {\n        if ( cur == slot )\n        {\n          if ( !prev )\n            slot->face->glyph = cur->next;\n          else\n            prev->next = cur->next;\n\n          /* finalize client-specific data */\n          if ( slot->generic.finalizer )\n            slot->generic.finalizer( slot );\n\n          ft_glyphslot_done( slot );\n          FT_FREE( slot );\n          break;\n        }\n        prev = cur;\n        cur  = cur->next;\n      }\n    }\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( void )\n  FT_Set_Transform( FT_Face     face,\n                    FT_Matrix*  matrix,\n                    FT_Vector*  delta )\n  {\n    FT_Face_Internal  internal;\n\n\n    if ( !face )\n      return;\n\n    internal = face->internal;\n\n    internal->transform_flags = 0;\n\n    if ( !matrix )\n    {\n      internal->transform_matrix.xx = 0x10000L;\n      internal->transform_matrix.xy = 0;\n      internal->transform_matrix.yx = 0;\n      internal->transform_matrix.yy = 0x10000L;\n\n      matrix = &internal->transform_matrix;\n    }\n    else\n      internal->transform_matrix = *matrix;\n\n    /* set transform_flags bit flag 0 if `matrix' isn't the identity */\n    if ( ( matrix->xy | matrix->yx ) ||\n         matrix->xx != 0x10000L      ||\n         matrix->yy != 0x10000L      )\n      internal->transform_flags |= 1;\n\n    if ( !delta )\n    {\n      internal->transform_delta.x = 0;\n      internal->transform_delta.y = 0;\n\n      delta = &internal->transform_delta;\n    }\n    else\n      internal->transform_delta = *delta;\n\n    /* set transform_flags bit flag 1 if `delta' isn't the null vector */\n    if ( delta->x | delta->y )\n      internal->transform_flags |= 2;\n  }\n\n\n  static FT_Renderer\n  ft_lookup_glyph_renderer( FT_GlyphSlot  slot );\n\n\n#ifdef GRID_FIT_METRICS\n  static void\n  ft_glyphslot_grid_fit_metrics( FT_GlyphSlot  slot,\n                                 FT_Bool       vertical )\n  {\n    FT_Glyph_Metrics*  metrics = &slot->metrics;\n    FT_Pos             right, bottom;\n\n\n    if ( vertical )\n    {\n      metrics->horiBearingX = FT_PIX_FLOOR( metrics->horiBearingX );\n      metrics->horiBearingY = FT_PIX_CEIL ( metrics->horiBearingY );\n\n      right  = FT_PIX_CEIL( metrics->vertBearingX + metrics->width );\n      bottom = FT_PIX_CEIL( metrics->vertBearingY + metrics->height );\n\n      metrics->vertBearingX = FT_PIX_FLOOR( metrics->vertBearingX );\n      metrics->vertBearingY = FT_PIX_FLOOR( metrics->vertBearingY );\n\n      metrics->width  = right - metrics->vertBearingX;\n      metrics->height = bottom - metrics->vertBearingY;\n    }\n    else\n    {\n      metrics->vertBearingX = FT_PIX_FLOOR( metrics->vertBearingX );\n      metrics->vertBearingY = FT_PIX_FLOOR( metrics->vertBearingY );\n\n      right  = FT_PIX_CEIL ( metrics->horiBearingX + metrics->width );\n      bottom = FT_PIX_FLOOR( metrics->horiBearingY - metrics->height );\n\n      metrics->horiBearingX = FT_PIX_FLOOR( metrics->horiBearingX );\n      metrics->horiBearingY = FT_PIX_CEIL ( metrics->horiBearingY );\n\n      metrics->width  = right - metrics->horiBearingX;\n      metrics->height = metrics->horiBearingY - bottom;\n    }\n\n    metrics->horiAdvance = FT_PIX_ROUND( metrics->horiAdvance );\n    metrics->vertAdvance = FT_PIX_ROUND( metrics->vertAdvance );\n  }\n#endif /* GRID_FIT_METRICS */\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Load_Glyph( FT_Face   face,\n                 FT_UInt   glyph_index,\n                 FT_Int32  load_flags )\n  {\n    FT_Error      error;\n    FT_Driver     driver;\n    FT_GlyphSlot  slot;\n    FT_Library    library;\n    FT_Bool       autohint = FALSE;\n    FT_Module     hinter;\n    TT_Face       ttface = (TT_Face)face;\n\n\n    if ( !face || !face->size || !face->glyph )\n      return FT_THROW( Invalid_Face_Handle );\n\n    /* The validity test for `glyph_index' is performed by the */\n    /* font drivers.                                           */\n\n    slot = face->glyph;\n    ft_glyphslot_clear( slot );\n\n    driver  = face->driver;\n    library = driver->root.library;\n    hinter  = library->auto_hinter;\n\n    /* resolve load flags dependencies */\n\n    if ( load_flags & FT_LOAD_NO_RECURSE )\n      load_flags |= FT_LOAD_NO_SCALE         |\n                    FT_LOAD_IGNORE_TRANSFORM;\n\n    if ( load_flags & FT_LOAD_NO_SCALE )\n    {\n      load_flags |= FT_LOAD_NO_HINTING |\n                    FT_LOAD_NO_BITMAP;\n\n      load_flags &= ~FT_LOAD_RENDER;\n    }\n\n    /*\n     * Determine whether we need to auto-hint or not.\n     * The general rules are:\n     *\n     * - Do only auto-hinting if we have a hinter module, a scalable font\n     *   format dealing with outlines, and no transforms except simple\n     *   slants and/or rotations by integer multiples of 90 degrees.\n     *\n     * - Then, auto-hint if FT_LOAD_FORCE_AUTOHINT is set or if we don't\n     *   have a native font hinter.\n     *\n     * - Otherwise, auto-hint for LIGHT hinting mode or if there isn't\n     *   any hinting bytecode in the TrueType/OpenType font.\n     *\n     * - Exception: The font is `tricky' and requires the native hinter to\n     *   load properly.\n     */\n\n    if ( hinter                                           &&\n         !( load_flags & FT_LOAD_NO_HINTING )             &&\n         !( load_flags & FT_LOAD_NO_AUTOHINT )            &&\n         FT_DRIVER_IS_SCALABLE( driver )                  &&\n         FT_DRIVER_USES_OUTLINES( driver )                &&\n         !FT_IS_TRICKY( face )                            &&\n         ( ( load_flags & FT_LOAD_IGNORE_TRANSFORM )    ||\n           ( face->internal->transform_matrix.yx == 0 &&\n             face->internal->transform_matrix.xx != 0 ) ||\n           ( face->internal->transform_matrix.xx == 0 &&\n             face->internal->transform_matrix.yx != 0 ) ) )\n    {\n      if ( ( load_flags & FT_LOAD_FORCE_AUTOHINT ) ||\n           !FT_DRIVER_HAS_HINTER( driver )         )\n        autohint = TRUE;\n      else\n      {\n        FT_Render_Mode  mode = FT_LOAD_TARGET_MODE( load_flags );\n\n\n        /* the check for `num_locations' assures that we actually    */\n        /* test for instructions in a TTF and not in a CFF-based OTF */\n        /*                                                           */\n        /* since `maxSizeOfInstructions' might be unreliable, we     */\n        /* check the size of the `fpgm' and `prep' tables, too --    */\n        /* the assumption is that there don't exist real TTFs where  */\n        /* both `fpgm' and `prep' tables are missing                 */\n        if ( mode == FT_RENDER_MODE_LIGHT                       ||\n             face->internal->ignore_unpatented_hinter           ||\n             ( FT_IS_SFNT( face )                             &&\n               ttface->num_locations                          &&\n               ttface->max_profile.maxSizeOfInstructions == 0 &&\n               ttface->font_program_size == 0                 &&\n               ttface->cvt_program_size == 0                  ) )\n          autohint = TRUE;\n      }\n    }\n\n    if ( autohint )\n    {\n      FT_AutoHinter_Interface  hinting;\n\n\n      /* try to load embedded bitmaps first if available            */\n      /*                                                            */\n      /* XXX: This is really a temporary hack that should disappear */\n      /*      promptly with FreeType 2.1!                           */\n      /*                                                            */\n      if ( FT_HAS_FIXED_SIZES( face )             &&\n          ( load_flags & FT_LOAD_NO_BITMAP ) == 0 )\n      {\n        error = driver->clazz->load_glyph( slot, face->size,\n                                           glyph_index,\n                                           load_flags | FT_LOAD_SBITS_ONLY );\n\n        if ( !error && slot->format == FT_GLYPH_FORMAT_BITMAP )\n          goto Load_Ok;\n      }\n\n      {\n        FT_Face_Internal  internal        = face->internal;\n        FT_Int            transform_flags = internal->transform_flags;\n\n\n        /* since the auto-hinter calls FT_Load_Glyph by itself, */\n        /* make sure that glyphs aren't transformed             */\n        internal->transform_flags = 0;\n\n        /* load auto-hinted outline */\n        hinting = (FT_AutoHinter_Interface)hinter->clazz->module_interface;\n\n        error   = hinting->load_glyph( (FT_AutoHinter)hinter,\n                                       slot, face->size,\n                                       glyph_index, load_flags );\n\n        internal->transform_flags = transform_flags;\n      }\n    }\n    else\n    {\n      error = driver->clazz->load_glyph( slot,\n                                         face->size,\n                                         glyph_index,\n                                         load_flags );\n      if ( error )\n        goto Exit;\n\n      if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )\n      {\n        /* check that the loaded outline is correct */\n        error = FT_Outline_Check( &slot->outline );\n        if ( error )\n          goto Exit;\n\n#ifdef GRID_FIT_METRICS\n        if ( !( load_flags & FT_LOAD_NO_HINTING ) )\n          ft_glyphslot_grid_fit_metrics( slot,\n              FT_BOOL( load_flags & FT_LOAD_VERTICAL_LAYOUT ) );\n#endif\n      }\n    }\n\n  Load_Ok:\n    /* compute the advance */\n    if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )\n    {\n      slot->advance.x = 0;\n      slot->advance.y = slot->metrics.vertAdvance;\n    }\n    else\n    {\n      slot->advance.x = slot->metrics.horiAdvance;\n      slot->advance.y = 0;\n    }\n\n    /* compute the linear advance in 16.16 pixels */\n    if ( ( load_flags & FT_LOAD_LINEAR_DESIGN ) == 0 &&\n         ( FT_IS_SCALABLE( face ) )                  )\n    {\n      FT_Size_Metrics*  metrics = &face->size->metrics;\n\n\n      /* it's tricky! */\n      slot->linearHoriAdvance = FT_MulDiv( slot->linearHoriAdvance,\n                                           metrics->x_scale, 64 );\n\n      slot->linearVertAdvance = FT_MulDiv( slot->linearVertAdvance,\n                                           metrics->y_scale, 64 );\n    }\n\n    if ( ( load_flags & FT_LOAD_IGNORE_TRANSFORM ) == 0 )\n    {\n      FT_Face_Internal  internal = face->internal;\n\n\n      /* now, transform the glyph image if needed */\n      if ( internal->transform_flags )\n      {\n        /* get renderer */\n        FT_Renderer  renderer = ft_lookup_glyph_renderer( slot );\n\n\n        if ( renderer )\n          error = renderer->clazz->transform_glyph(\n                                     renderer, slot,\n                                     &internal->transform_matrix,\n                                     &internal->transform_delta );\n        else if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )\n        {\n          /* apply `standard' transformation if no renderer is available */\n          if ( internal->transform_flags & 1 )\n            FT_Outline_Transform( &slot->outline,\n                                  &internal->transform_matrix );\n\n          if ( internal->transform_flags & 2 )\n            FT_Outline_Translate( &slot->outline,\n                                  internal->transform_delta.x,\n                                  internal->transform_delta.y );\n        }\n\n        /* transform advance */\n        FT_Vector_Transform( &slot->advance, &internal->transform_matrix );\n      }\n    }\n\n    FT_TRACE5(( \"  x advance: %d\\n\" , slot->advance.x ));\n    FT_TRACE5(( \"  y advance: %d\\n\" , slot->advance.y ));\n\n    FT_TRACE5(( \"  linear x advance: %d\\n\" , slot->linearHoriAdvance ));\n    FT_TRACE5(( \"  linear y advance: %d\\n\" , slot->linearVertAdvance ));\n\n    /* do we need to render the image now? */\n    if ( !error                                    &&\n         slot->format != FT_GLYPH_FORMAT_BITMAP    &&\n         slot->format != FT_GLYPH_FORMAT_COMPOSITE &&\n         load_flags & FT_LOAD_RENDER )\n    {\n      FT_Render_Mode  mode = FT_LOAD_TARGET_MODE( load_flags );\n\n\n      if ( mode == FT_RENDER_MODE_NORMAL      &&\n           (load_flags & FT_LOAD_MONOCHROME ) )\n        mode = FT_RENDER_MODE_MONO;\n\n      error = FT_Render_Glyph( slot, mode );\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Load_Char( FT_Face   face,\n                FT_ULong  char_code,\n                FT_Int32  load_flags )\n  {\n    FT_UInt  glyph_index;\n\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    glyph_index = (FT_UInt)char_code;\n    if ( face->charmap )\n      glyph_index = FT_Get_Char_Index( face, char_code );\n\n    return FT_Load_Glyph( face, glyph_index, load_flags );\n  }\n\n\n  /* destructor for sizes list */\n  static void\n  destroy_size( FT_Memory  memory,\n                FT_Size    size,\n                FT_Driver  driver )\n  {\n    /* finalize client-specific data */\n    if ( size->generic.finalizer )\n      size->generic.finalizer( size );\n\n    /* finalize format-specific stuff */\n    if ( driver->clazz->done_size )\n      driver->clazz->done_size( size );\n\n    FT_FREE( size->internal );\n    FT_FREE( size );\n  }\n\n\n  static void\n  ft_cmap_done_internal( FT_CMap  cmap );\n\n\n  static void\n  destroy_charmaps( FT_Face    face,\n                    FT_Memory  memory )\n  {\n    FT_Int  n;\n\n\n    if ( !face )\n      return;\n\n    for ( n = 0; n < face->num_charmaps; n++ )\n    {\n      FT_CMap  cmap = FT_CMAP( face->charmaps[n] );\n\n\n      ft_cmap_done_internal( cmap );\n\n      face->charmaps[n] = NULL;\n    }\n\n    FT_FREE( face->charmaps );\n    face->num_charmaps = 0;\n  }\n\n\n  /* destructor for faces list */\n  static void\n  destroy_face( FT_Memory  memory,\n                FT_Face    face,\n                FT_Driver  driver )\n  {\n    FT_Driver_Class  clazz = driver->clazz;\n\n\n    /* discard auto-hinting data */\n    if ( face->autohint.finalizer )\n      face->autohint.finalizer( face->autohint.data );\n\n    /* Discard glyph slots for this face.                           */\n    /* Beware!  FT_Done_GlyphSlot() changes the field `face->glyph' */\n    while ( face->glyph )\n      FT_Done_GlyphSlot( face->glyph );\n\n    /* discard all sizes for this face */\n    FT_List_Finalize( &face->sizes_list,\n                      (FT_List_Destructor)destroy_size,\n                      memory,\n                      driver );\n    face->size = 0;\n\n    /* now discard client data */\n    if ( face->generic.finalizer )\n      face->generic.finalizer( face );\n\n    /* discard charmaps */\n    destroy_charmaps( face, memory );\n\n    /* finalize format-specific stuff */\n    if ( clazz->done_face )\n      clazz->done_face( face );\n\n    /* close the stream for this face if needed */\n    FT_Stream_Free(\n      face->stream,\n      ( face->face_flags & FT_FACE_FLAG_EXTERNAL_STREAM ) != 0 );\n\n    face->stream = 0;\n\n    /* get rid of it */\n    if ( face->internal )\n    {\n      FT_FREE( face->internal );\n    }\n    FT_FREE( face );\n  }\n\n\n  static void\n  Destroy_Driver( FT_Driver  driver )\n  {\n    FT_List_Finalize( &driver->faces_list,\n                      (FT_List_Destructor)destroy_face,\n                      driver->root.memory,\n                      driver );\n\n    /* check whether we need to drop the driver's glyph loader */\n    if ( FT_DRIVER_USES_OUTLINES( driver ) )\n      FT_GlyphLoader_Done( driver->glyph_loader );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    find_unicode_charmap                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function finds a Unicode charmap, if there is one.            */\n  /*    And if there is more than one, it tries to favour the more         */\n  /*    extensive one, i.e., one that supports UCS-4 against those which   */\n  /*    are limited to the BMP (said UCS-2 encoding.)                      */\n  /*                                                                       */\n  /*    This function is called from open_face() (just below), and also    */\n  /*    from FT_Select_Charmap( ..., FT_ENCODING_UNICODE ).                */\n  /*                                                                       */\n  static FT_Error\n  find_unicode_charmap( FT_Face  face )\n  {\n    FT_CharMap*  first;\n    FT_CharMap*  cur;\n\n\n    /* caller should have already checked that `face' is valid */\n    FT_ASSERT( face );\n\n    first = face->charmaps;\n\n    if ( !first )\n      return FT_THROW( Invalid_CharMap_Handle );\n\n    /*\n     *  The original TrueType specification(s) only specified charmap\n     *  formats that are capable of mapping 8 or 16 bit character codes to\n     *  glyph indices.\n     *\n     *  However, recent updates to the Apple and OpenType specifications\n     *  introduced new formats that are capable of mapping 32-bit character\n     *  codes as well.  And these are already used on some fonts, mainly to\n     *  map non-BMP Asian ideographs as defined in Unicode.\n     *\n     *  For compatibility purposes, these fonts generally come with\n     *  *several* Unicode charmaps:\n     *\n     *   - One of them in the \"old\" 16-bit format, that cannot access\n     *     all glyphs in the font.\n     *\n     *   - Another one in the \"new\" 32-bit format, that can access all\n     *     the glyphs.\n     *\n     *  This function has been written to always favor a 32-bit charmap\n     *  when found.  Otherwise, a 16-bit one is returned when found.\n     */\n\n    /* Since the `interesting' table, with IDs (3,10), is normally the */\n    /* last one, we loop backwards.  This loses with type1 fonts with  */\n    /* non-BMP characters (<.0001%), this wins with .ttf with non-BMP  */\n    /* chars (.01% ?), and this is the same about 99.99% of the time!  */\n\n    cur = first + face->num_charmaps;  /* points after the last one */\n\n    for ( ; --cur >= first; )\n    {\n      if ( cur[0]->encoding == FT_ENCODING_UNICODE )\n      {\n        /* XXX If some new encodings to represent UCS-4 are added, */\n        /*     they should be added here.                          */\n        if ( ( cur[0]->platform_id == TT_PLATFORM_MICROSOFT &&\n               cur[0]->encoding_id == TT_MS_ID_UCS_4        )     ||\n             ( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE &&\n               cur[0]->encoding_id == TT_APPLE_ID_UNICODE_32    ) )\n        {\n          face->charmap = cur[0];\n          return FT_Err_Ok;\n        }\n      }\n    }\n\n    /* We do not have any UCS-4 charmap.                */\n    /* Do the loop again and search for UCS-2 charmaps. */\n    cur = first + face->num_charmaps;\n\n    for ( ; --cur >= first; )\n    {\n      if ( cur[0]->encoding == FT_ENCODING_UNICODE )\n      {\n        face->charmap = cur[0];\n        return FT_Err_Ok;\n      }\n    }\n\n    return FT_THROW( Invalid_CharMap_Handle );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    find_variant_selector_charmap                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function finds the variant selector charmap, if there is one. */\n  /*    There can only be one (platform=0, specific=5, format=14).         */\n  /*                                                                       */\n  static FT_CharMap\n  find_variant_selector_charmap( FT_Face  face )\n  {\n    FT_CharMap*  first;\n    FT_CharMap*  end;\n    FT_CharMap*  cur;\n\n\n    /* caller should have already checked that `face' is valid */\n    FT_ASSERT( face );\n\n    first = face->charmaps;\n\n    if ( !first )\n      return NULL;\n\n    end = first + face->num_charmaps;  /* points after the last one */\n\n    for ( cur = first; cur < end; ++cur )\n    {\n      if ( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE    &&\n           cur[0]->encoding_id == TT_APPLE_ID_VARIANT_SELECTOR &&\n           FT_Get_CMap_Format( cur[0] ) == 14                  )\n        return cur[0];\n    }\n\n    return NULL;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    open_face                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function does some work for FT_Open_Face().                   */\n  /*                                                                       */\n  static FT_Error\n  open_face( FT_Driver      driver,\n             FT_Stream      *astream,\n             FT_Bool        external_stream,\n             FT_Long        face_index,\n             FT_Int         num_params,\n             FT_Parameter*  params,\n             FT_Face       *aface )\n  {\n    FT_Memory         memory;\n    FT_Driver_Class   clazz;\n    FT_Face           face     = NULL;\n    FT_Face_Internal  internal = NULL;\n\n    FT_Error          error, error2;\n\n\n    clazz  = driver->clazz;\n    memory = driver->root.memory;\n\n    /* allocate the face object and perform basic initialization */\n    if ( FT_ALLOC( face, clazz->face_object_size ) )\n      goto Fail;\n\n    face->driver = driver;\n    face->memory = memory;\n    face->stream = *astream;\n\n    /* set the FT_FACE_FLAG_EXTERNAL_STREAM bit for FT_Done_Face */\n    if ( external_stream )\n      face->face_flags |= FT_FACE_FLAG_EXTERNAL_STREAM;\n\n    if ( FT_NEW( internal ) )\n      goto Fail;\n\n    face->internal = internal;\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n    {\n      int  i;\n\n\n      face->internal->incremental_interface = 0;\n      for ( i = 0; i < num_params && !face->internal->incremental_interface;\n            i++ )\n        if ( params[i].tag == FT_PARAM_TAG_INCREMENTAL )\n          face->internal->incremental_interface =\n            (FT_Incremental_Interface)params[i].data;\n    }\n#endif\n\n    if ( clazz->init_face )\n      error = clazz->init_face( *astream,\n                                face,\n                                (FT_Int)face_index,\n                                num_params,\n                                params );\n    *astream = face->stream; /* Stream may have been changed. */\n    if ( error )\n      goto Fail;\n\n    /* select Unicode charmap by default */\n    error2 = find_unicode_charmap( face );\n\n    /* if no Unicode charmap can be found, FT_Err_Invalid_CharMap_Handle */\n    /* is returned.                                                      */\n\n    /* no error should happen, but we want to play safe */\n    if ( error2 && FT_ERR_NEQ( error2, Invalid_CharMap_Handle ) )\n    {\n      error = error2;\n      goto Fail;\n    }\n\n    *aface = face;\n\n  Fail:\n    if ( error )\n    {\n      destroy_charmaps( face, memory );\n      if ( clazz->done_face )\n        clazz->done_face( face );\n      FT_FREE( internal );\n      FT_FREE( face );\n      *aface = 0;\n    }\n\n    return error;\n  }\n\n\n  /* there's a Mac-specific extended implementation of FT_New_Face() */\n  /* in src/base/ftmac.c                                             */\n\n#ifndef FT_MACINTOSH\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_New_Face( FT_Library   library,\n               const char*  pathname,\n               FT_Long      face_index,\n               FT_Face     *aface )\n  {\n    FT_Open_Args  args;\n\n\n    /* test for valid `library' and `aface' delayed to `FT_Open_Face' */\n    if ( !pathname )\n      return FT_THROW( Invalid_Argument );\n\n    args.flags    = FT_OPEN_PATHNAME;\n    args.pathname = (char*)pathname;\n    args.stream   = NULL;\n\n    return FT_Open_Face( library, &args, face_index, aface );\n  }\n\n#endif\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_New_Memory_Face( FT_Library      library,\n                      const FT_Byte*  file_base,\n                      FT_Long         file_size,\n                      FT_Long         face_index,\n                      FT_Face        *aface )\n  {\n    FT_Open_Args  args;\n\n\n    /* test for valid `library' and `face' delayed to `FT_Open_Face' */\n    if ( !file_base )\n      return FT_THROW( Invalid_Argument );\n\n    args.flags       = FT_OPEN_MEMORY;\n    args.memory_base = file_base;\n    args.memory_size = file_size;\n    args.stream      = NULL;\n\n    return FT_Open_Face( library, &args, face_index, aface );\n  }\n\n\n#ifdef FT_CONFIG_OPTION_MAC_FONTS\n\n  /* The behavior here is very similar to that in base/ftmac.c, but it     */\n  /* is designed to work on non-mac systems, so no mac specific calls.     */\n  /*                                                                       */\n  /* We look at the file and determine if it is a mac dfont file or a mac  */\n  /* resource file, or a macbinary file containing a mac resource file.    */\n  /*                                                                       */\n  /* Unlike ftmac I'm not going to look at a `FOND'.  I don't really see   */\n  /* the point, especially since there may be multiple `FOND' resources.   */\n  /* Instead I'll just look for `sfnt' and `POST' resources, ordered as    */\n  /* they occur in the file.                                               */\n  /*                                                                       */\n  /* Note that multiple `POST' resources do not mean multiple postscript   */\n  /* fonts; they all get jammed together to make what is essentially a     */\n  /* pfb file.                                                             */\n  /*                                                                       */\n  /* We aren't interested in `NFNT' or `FONT' bitmap resources.            */\n  /*                                                                       */\n  /* As soon as we get an `sfnt' load it into memory and pass it off to    */\n  /* FT_Open_Face.                                                         */\n  /*                                                                       */\n  /* If we have a (set of) `POST' resources, massage them into a (memory)  */\n  /* pfb file and pass that to FT_Open_Face.  (As with ftmac.c I'm not     */\n  /* going to try to save the kerning info.  After all that lives in the   */\n  /* `FOND' which isn't in the file containing the `POST' resources so     */\n  /* we don't really have access to it.                                    */\n\n\n  /* Finalizer for a memory stream; gets called by FT_Done_Face(). */\n  /* It frees the memory it uses.                                  */\n  /* From ftmac.c.                                                 */\n  static void\n  memory_stream_close( FT_Stream  stream )\n  {\n    FT_Memory  memory = stream->memory;\n\n\n    FT_FREE( stream->base );\n\n    stream->size  = 0;\n    stream->base  = 0;\n    stream->close = 0;\n  }\n\n\n  /* Create a new memory stream from a buffer and a size. */\n  /* From ftmac.c.                                        */\n  static FT_Error\n  new_memory_stream( FT_Library           library,\n                     FT_Byte*             base,\n                     FT_ULong             size,\n                     FT_Stream_CloseFunc  close,\n                     FT_Stream           *astream )\n  {\n    FT_Error   error;\n    FT_Memory  memory;\n    FT_Stream  stream = NULL;\n\n\n    if ( !library )\n      return FT_THROW( Invalid_Library_Handle );\n\n    if ( !base )\n      return FT_THROW( Invalid_Argument );\n\n    *astream = 0;\n    memory = library->memory;\n    if ( FT_NEW( stream ) )\n      goto Exit;\n\n    FT_Stream_OpenMemory( stream, base, size );\n\n    stream->close = close;\n\n    *astream = stream;\n\n  Exit:\n    return error;\n  }\n\n\n  /* Create a new FT_Face given a buffer and a driver name. */\n  /* from ftmac.c */\n  FT_LOCAL_DEF( FT_Error )\n  open_face_from_buffer( FT_Library   library,\n                         FT_Byte*     base,\n                         FT_ULong     size,\n                         FT_Long      face_index,\n                         const char*  driver_name,\n                         FT_Face     *aface )\n  {\n    FT_Open_Args  args;\n    FT_Error      error;\n    FT_Stream     stream = NULL;\n    FT_Memory     memory = library->memory;\n\n\n    error = new_memory_stream( library,\n                               base,\n                               size,\n                               memory_stream_close,\n                               &stream );\n    if ( error )\n    {\n      FT_FREE( base );\n      return error;\n    }\n\n    args.flags = FT_OPEN_STREAM;\n    args.stream = stream;\n    if ( driver_name )\n    {\n      args.flags = args.flags | FT_OPEN_DRIVER;\n      args.driver = FT_Get_Module( library, driver_name );\n    }\n\n#ifdef FT_MACINTOSH\n    /* At this point, face_index has served its purpose;      */\n    /* whoever calls this function has already used it to     */\n    /* locate the correct font data.  We should not propagate */\n    /* this index to FT_Open_Face() (unless it is negative).  */\n\n    if ( face_index > 0 )\n      face_index = 0;\n#endif\n\n    error = FT_Open_Face( library, &args, face_index, aface );\n\n    if ( error == FT_Err_Ok )\n      (*aface)->face_flags &= ~FT_FACE_FLAG_EXTERNAL_STREAM;\n    else\n#ifdef FT_MACINTOSH\n      FT_Stream_Free( stream, 0 );\n#else\n    {\n      FT_Stream_Close( stream );\n      FT_FREE( stream );\n    }\n#endif\n\n    return error;\n  }\n\n\n  /* Look up `TYP1' or `CID ' table from sfnt table directory.       */\n  /* `offset' and `length' must exclude the binary header in tables. */\n\n  /* Type 1 and CID-keyed font drivers should recognize sfnt-wrapped */\n  /* format too.  Here, since we can't expect that the TrueType font */\n  /* driver is loaded unconditially, we must parse the font by       */\n  /* ourselves.  We are only interested in the name of the table and */\n  /* the offset.                                                     */\n\n  static FT_Error\n  ft_lookup_PS_in_sfnt_stream( FT_Stream  stream,\n                               FT_Long    face_index,\n                               FT_ULong*  offset,\n                               FT_ULong*  length,\n                               FT_Bool*   is_sfnt_cid )\n  {\n    FT_Error   error;\n    FT_UShort  numTables;\n    FT_Long    pstable_index;\n    FT_ULong   tag;\n    int        i;\n\n\n    *offset = 0;\n    *length = 0;\n    *is_sfnt_cid = FALSE;\n\n    /* TODO: support for sfnt-wrapped PS/CID in TTC format */\n\n    /* version check for 'typ1' (should be ignored?) */\n    if ( FT_READ_ULONG( tag ) )\n      return error;\n    if ( tag != TTAG_typ1 )\n      return FT_THROW( Unknown_File_Format );\n\n    if ( FT_READ_USHORT( numTables ) )\n      return error;\n    if ( FT_STREAM_SKIP( 2 * 3 ) ) /* skip binary search header */\n      return error;\n\n    pstable_index = -1;\n    *is_sfnt_cid  = FALSE;\n\n    for ( i = 0; i < numTables; i++ )\n    {\n      if ( FT_READ_ULONG( tag )     || FT_STREAM_SKIP( 4 )      ||\n           FT_READ_ULONG( *offset ) || FT_READ_ULONG( *length ) )\n        return error;\n\n      if ( tag == TTAG_CID )\n      {\n        pstable_index++;\n        *offset += 22;\n        *length -= 22;\n        *is_sfnt_cid = TRUE;\n        if ( face_index < 0 )\n          return FT_Err_Ok;\n      }\n      else if ( tag == TTAG_TYP1 )\n      {\n        pstable_index++;\n        *offset += 24;\n        *length -= 24;\n        *is_sfnt_cid = FALSE;\n        if ( face_index < 0 )\n          return FT_Err_Ok;\n      }\n      if ( face_index >= 0 && pstable_index == face_index )\n        return FT_Err_Ok;\n    }\n    return FT_THROW( Table_Missing );\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  open_face_PS_from_sfnt_stream( FT_Library     library,\n                                 FT_Stream      stream,\n                                 FT_Long        face_index,\n                                 FT_Int         num_params,\n                                 FT_Parameter  *params,\n                                 FT_Face       *aface )\n  {\n    FT_Error   error;\n    FT_Memory  memory = library->memory;\n    FT_ULong   offset, length;\n    FT_Long    pos;\n    FT_Bool    is_sfnt_cid;\n    FT_Byte*   sfnt_ps = NULL;\n\n    FT_UNUSED( num_params );\n    FT_UNUSED( params );\n\n\n    pos = FT_Stream_Pos( stream );\n\n    error = ft_lookup_PS_in_sfnt_stream( stream,\n                                         face_index,\n                                         &offset,\n                                         &length,\n                                         &is_sfnt_cid );\n    if ( error )\n      goto Exit;\n\n    if ( FT_Stream_Seek( stream, pos + offset ) )\n      goto Exit;\n\n    if ( FT_ALLOC( sfnt_ps, (FT_Long)length ) )\n      goto Exit;\n\n    error = FT_Stream_Read( stream, (FT_Byte *)sfnt_ps, length );\n    if ( error )\n      goto Exit;\n\n    error = open_face_from_buffer( library,\n                                   sfnt_ps,\n                                   length,\n                                   FT_MIN( face_index, 0 ),\n                                   is_sfnt_cid ? \"cid\" : \"type1\",\n                                   aface );\n  Exit:\n    {\n      FT_Error  error1;\n\n\n      if ( FT_ERR_EQ( error, Unknown_File_Format ) )\n      {\n        error1 = FT_Stream_Seek( stream, pos );\n        if ( error1 )\n          return error1;\n      }\n\n      return error;\n    }\n  }\n\n\n#ifndef FT_MACINTOSH\n\n  /* The resource header says we've got resource_cnt `POST' (type1) */\n  /* resources in this file.  They all need to be coalesced into    */\n  /* one lump which gets passed on to the type1 driver.             */\n  /* Here can be only one PostScript font in a file so face_index   */\n  /* must be 0 (or -1).                                             */\n  /*                                                                */\n  static FT_Error\n  Mac_Read_POST_Resource( FT_Library  library,\n                          FT_Stream   stream,\n                          FT_Long    *offsets,\n                          FT_Long     resource_cnt,\n                          FT_Long     face_index,\n                          FT_Face    *aface )\n  {\n    FT_Error   error  = FT_ERR( Cannot_Open_Resource );\n    FT_Memory  memory = library->memory;\n    FT_Byte*   pfb_data = NULL;\n    int        i, type, flags;\n    FT_ULong   len;\n    FT_ULong   pfb_len, pfb_pos, pfb_lenpos;\n    FT_ULong   rlen, temp;\n\n\n    if ( face_index == -1 )\n      face_index = 0;\n    if ( face_index != 0 )\n      return error;\n\n    /* Find the length of all the POST resources, concatenated.  Assume */\n    /* worst case (each resource in its own section).                   */\n    pfb_len = 0;\n    for ( i = 0; i < resource_cnt; ++i )\n    {\n      error = FT_Stream_Seek( stream, offsets[i] );\n      if ( error )\n        goto Exit;\n      if ( FT_READ_ULONG( temp ) )\n        goto Exit;\n\n      /* FT2 allocator takes signed long buffer length,\n       * too large value causing overflow should be checked\n       */\n      FT_TRACE4(( \"                 POST fragment #%d: length=0x%08x\\n\",\n                  i, temp));\n      if ( 0x7FFFFFFFUL < temp || pfb_len + temp + 6 < pfb_len )\n      {\n        FT_TRACE2(( \"             too long fragment length makes\"\n                    \" pfb_len confused: temp=0x%08x\\n\", temp ));\n        error = FT_THROW( Invalid_Offset );\n        goto Exit;\n      }\n\n      pfb_len += temp + 6;\n    }\n\n    FT_TRACE2(( \"             total buffer size to concatenate %d\"\n                \" POST fragments: 0x%08x\\n\",\n                 resource_cnt, pfb_len + 2));\n    if ( pfb_len + 2 < 6 ) {\n      FT_TRACE2(( \"             too long fragment length makes\"\n                  \" pfb_len confused: pfb_len=0x%08x\\n\", pfb_len ));\n      error = FT_THROW( Array_Too_Large );\n      goto Exit;\n    }\n    if ( FT_ALLOC( pfb_data, (FT_Long)pfb_len + 2 ) )\n      goto Exit;\n\n    pfb_data[0] = 0x80;\n    pfb_data[1] = 1;            /* Ascii section */\n    pfb_data[2] = 0;            /* 4-byte length, fill in later */\n    pfb_data[3] = 0;\n    pfb_data[4] = 0;\n    pfb_data[5] = 0;\n    pfb_pos     = 6;\n    pfb_lenpos  = 2;\n\n    len = 0;\n    type = 1;\n    for ( i = 0; i < resource_cnt; ++i )\n    {\n      error = FT_Stream_Seek( stream, offsets[i] );\n      if ( error )\n        goto Exit2;\n      if ( FT_READ_ULONG( rlen ) )\n        goto Exit2;\n\n      /* FT2 allocator takes signed long buffer length,\n       * too large fragment length causing overflow should be checked\n       */\n      if ( 0x7FFFFFFFUL < rlen )\n      {\n        error = FT_THROW( Invalid_Offset );\n        goto Exit2;\n      }\n\n      if ( FT_READ_USHORT( flags ) )\n        goto Exit2;\n      FT_TRACE3(( \"POST fragment[%d]: offsets=0x%08x, rlen=0x%08x, flags=0x%04x\\n\",\n                   i, offsets[i], rlen, flags ));\n\n      error = FT_ERR( Array_Too_Large );\n      /* postpone the check of rlen longer than buffer until FT_Stream_Read() */\n      if ( ( flags >> 8 ) == 0 )        /* Comment, should not be loaded */\n      {\n        FT_TRACE3(( \"    Skip POST fragment #%d because it is a comment\\n\", i ));\n        continue;\n      }\n\n      /* the flags are part of the resource, so rlen >= 2.  */\n      /* but some fonts declare rlen = 0 for empty fragment */\n      if ( rlen > 2 )\n        rlen -= 2;\n      else\n        rlen = 0;\n\n      if ( ( flags >> 8 ) == type )\n        len += rlen;\n      else\n      {\n        FT_TRACE3(( \"    Write POST fragment #%d header (4-byte) to buffer\"\n                    \" 0x%p + 0x%08x\\n\", i, pfb_data, pfb_lenpos ));\n        if ( pfb_lenpos + 3 > pfb_len + 2 )\n          goto Exit2;\n        pfb_data[pfb_lenpos    ] = (FT_Byte)( len );\n        pfb_data[pfb_lenpos + 1] = (FT_Byte)( len >> 8 );\n        pfb_data[pfb_lenpos + 2] = (FT_Byte)( len >> 16 );\n        pfb_data[pfb_lenpos + 3] = (FT_Byte)( len >> 24 );\n\n        if ( ( flags >> 8 ) == 5 )      /* End of font mark */\n          break;\n\n        FT_TRACE3(( \"    Write POST fragment #%d header (6-byte) to buffer\"\n                    \" 0x%p + 0x%08x\\n\", i, pfb_data, pfb_pos ));\n        if ( pfb_pos + 6 > pfb_len + 2 )\n          goto Exit2;\n        pfb_data[pfb_pos++] = 0x80;\n\n        type = flags >> 8;\n        len = rlen;\n\n        pfb_data[pfb_pos++] = (FT_Byte)type;\n        pfb_lenpos          = pfb_pos;\n        pfb_data[pfb_pos++] = 0;        /* 4-byte length, fill in later */\n        pfb_data[pfb_pos++] = 0;\n        pfb_data[pfb_pos++] = 0;\n        pfb_data[pfb_pos++] = 0;\n      }\n\n      if ( pfb_pos > pfb_len || pfb_pos + rlen > pfb_len )\n        goto Exit2;\n\n      FT_TRACE3(( \"    Load POST fragment #%d (%d byte) to buffer\"\n                  \" 0x%p + 0x%08x\\n\", i, rlen, pfb_data, pfb_pos ));\n      error = FT_Stream_Read( stream, (FT_Byte *)pfb_data + pfb_pos, rlen );\n      if ( error )\n        goto Exit2;\n      pfb_pos += rlen;\n    }\n\n    error = FT_ERR( Array_Too_Large );\n    if ( pfb_pos + 2 > pfb_len + 2 )\n      goto Exit2;\n    pfb_data[pfb_pos++] = 0x80;\n    pfb_data[pfb_pos++] = 3;\n\n    if ( pfb_lenpos + 3 > pfb_len + 2 )\n      goto Exit2;\n    pfb_data[pfb_lenpos    ] = (FT_Byte)( len );\n    pfb_data[pfb_lenpos + 1] = (FT_Byte)( len >> 8 );\n    pfb_data[pfb_lenpos + 2] = (FT_Byte)( len >> 16 );\n    pfb_data[pfb_lenpos + 3] = (FT_Byte)( len >> 24 );\n\n    return open_face_from_buffer( library,\n                                  pfb_data,\n                                  pfb_pos,\n                                  face_index,\n                                  \"type1\",\n                                  aface );\n\n  Exit2:\n    if ( error == FT_ERR( Array_Too_Large ) )\n      FT_TRACE2(( \"  Abort due to too-short buffer to store\"\n                  \" all POST fragments\\n\" ));\n    else if ( error == FT_ERR( Invalid_Offset ) )\n      FT_TRACE2(( \"  Abort due to invalid offset in a POST fragment\\n\" ));\n    if ( error )\n      error = FT_ERR( Cannot_Open_Resource );\n    FT_FREE( pfb_data );\n\n  Exit:\n    return error;\n  }\n\n\n  /* The resource header says we've got resource_cnt `sfnt'      */\n  /* (TrueType/OpenType) resources in this file.  Look through   */\n  /* them for the one indicated by face_index, load it into mem, */\n  /* pass it on the the truetype driver and return it.           */\n  /*                                                             */\n  static FT_Error\n  Mac_Read_sfnt_Resource( FT_Library  library,\n                          FT_Stream   stream,\n                          FT_Long    *offsets,\n                          FT_Long     resource_cnt,\n                          FT_Long     face_index,\n                          FT_Face    *aface )\n  {\n    FT_Memory  memory = library->memory;\n    FT_Byte*   sfnt_data = NULL;\n    FT_Error   error;\n    FT_Long    flag_offset;\n    FT_Long    rlen;\n    int        is_cff;\n    FT_Long    face_index_in_resource = 0;\n\n\n    if ( face_index == -1 )\n      face_index = 0;\n    if ( face_index >= resource_cnt )\n      return FT_THROW( Cannot_Open_Resource );\n\n    flag_offset = offsets[face_index];\n    error = FT_Stream_Seek( stream, flag_offset );\n    if ( error )\n      goto Exit;\n\n    if ( FT_READ_LONG( rlen ) )\n      goto Exit;\n    if ( rlen == -1 )\n      return FT_THROW( Cannot_Open_Resource );\n\n    error = open_face_PS_from_sfnt_stream( library,\n                                           stream,\n                                           face_index,\n                                           0, NULL,\n                                           aface );\n    if ( !error )\n      goto Exit;\n\n    /* rewind sfnt stream before open_face_PS_from_sfnt_stream() */\n    if ( FT_Stream_Seek( stream, flag_offset + 4 ) )\n      goto Exit;\n\n    if ( FT_ALLOC( sfnt_data, (FT_Long)rlen ) )\n      return error;\n    error = FT_Stream_Read( stream, (FT_Byte *)sfnt_data, rlen );\n    if ( error )\n      goto Exit;\n\n    is_cff = rlen > 4 && !ft_memcmp( sfnt_data, \"OTTO\", 4 );\n    error = open_face_from_buffer( library,\n                                   sfnt_data,\n                                   rlen,\n                                   face_index_in_resource,\n                                   is_cff ? \"cff\" : \"truetype\",\n                                   aface );\n\n  Exit:\n    return error;\n  }\n\n\n  /* Check for a valid resource fork header, or a valid dfont    */\n  /* header.  In a resource fork the first 16 bytes are repeated */\n  /* at the location specified by bytes 4-7.  In a dfont bytes   */\n  /* 4-7 point to 16 bytes of zeroes instead.                    */\n  /*                                                             */\n  static FT_Error\n  IsMacResource( FT_Library  library,\n                 FT_Stream   stream,\n                 FT_Long     resource_offset,\n                 FT_Long     face_index,\n                 FT_Face    *aface )\n  {\n    FT_Memory  memory = library->memory;\n    FT_Error   error;\n    FT_Long    map_offset, rdara_pos;\n    FT_Long    *data_offsets;\n    FT_Long    count;\n\n\n    error = FT_Raccess_Get_HeaderInfo( library, stream, resource_offset,\n                                       &map_offset, &rdara_pos );\n    if ( error )\n      return error;\n\n    /* POST resources must be sorted to concatenate properly */\n    error = FT_Raccess_Get_DataOffsets( library, stream,\n                                        map_offset, rdara_pos,\n                                        TTAG_POST, TRUE,\n                                        &data_offsets, &count );\n    if ( !error )\n    {\n      error = Mac_Read_POST_Resource( library, stream, data_offsets, count,\n                                      face_index, aface );\n      FT_FREE( data_offsets );\n      /* POST exists in an LWFN providing a single face */\n      if ( !error )\n        (*aface)->num_faces = 1;\n      return error;\n    }\n\n    /* sfnt resources should not be sorted to preserve the face order by\n       QuickDraw API */\n    error = FT_Raccess_Get_DataOffsets( library, stream,\n                                        map_offset, rdara_pos,\n                                        TTAG_sfnt, FALSE,\n                                        &data_offsets, &count );\n    if ( !error )\n    {\n      FT_Long  face_index_internal = face_index % count;\n\n\n      error = Mac_Read_sfnt_Resource( library, stream, data_offsets, count,\n                                      face_index_internal, aface );\n      FT_FREE( data_offsets );\n      if ( !error )\n        (*aface)->num_faces = count;\n    }\n\n    return error;\n  }\n\n\n  /* Check for a valid macbinary header, and if we find one   */\n  /* check that the (flattened) resource fork in it is valid. */\n  /*                                                          */\n  static FT_Error\n  IsMacBinary( FT_Library  library,\n               FT_Stream   stream,\n               FT_Long     face_index,\n               FT_Face    *aface )\n  {\n    unsigned char  header[128];\n    FT_Error       error;\n    FT_Long        dlen, offset;\n\n\n    if ( NULL == stream )\n      return FT_THROW( Invalid_Stream_Operation );\n\n    error = FT_Stream_Seek( stream, 0 );\n    if ( error )\n      goto Exit;\n\n    error = FT_Stream_Read( stream, (FT_Byte*)header, 128 );\n    if ( error )\n      goto Exit;\n\n    if (            header[ 0] !=  0 ||\n                    header[74] !=  0 ||\n                    header[82] !=  0 ||\n                    header[ 1] ==  0 ||\n                    header[ 1] >  33 ||\n                    header[63] !=  0 ||\n         header[2 + header[1]] !=  0 )\n      return FT_THROW( Unknown_File_Format );\n\n    dlen = ( header[0x53] << 24 ) |\n           ( header[0x54] << 16 ) |\n           ( header[0x55] <<  8 ) |\n             header[0x56];\n#if 0\n    rlen = ( header[0x57] << 24 ) |\n           ( header[0x58] << 16 ) |\n           ( header[0x59] <<  8 ) |\n             header[0x5A];\n#endif /* 0 */\n    offset = 128 + ( ( dlen + 127 ) & ~127 );\n\n    return IsMacResource( library, stream, offset, face_index, aface );\n\n  Exit:\n    return error;\n  }\n\n\n  static FT_Error\n  load_face_in_embedded_rfork( FT_Library           library,\n                               FT_Stream            stream,\n                               FT_Long              face_index,\n                               FT_Face             *aface,\n                               const FT_Open_Args  *args )\n  {\n\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_raccess\n\n    FT_Memory  memory = library->memory;\n    FT_Error   error  = FT_ERR( Unknown_File_Format );\n    int        i;\n\n    char *     file_names[FT_RACCESS_N_RULES];\n    FT_Long    offsets[FT_RACCESS_N_RULES];\n    FT_Error   errors[FT_RACCESS_N_RULES];\n    FT_Bool    is_darwin_vfs, vfs_rfork_has_no_font = FALSE; /* not tested */\n\n    FT_Open_Args  args2;\n    FT_Stream     stream2 = 0;\n\n\n    FT_Raccess_Guess( library, stream,\n                      args->pathname, file_names, offsets, errors );\n\n    for ( i = 0; i < FT_RACCESS_N_RULES; i++ )\n    {\n      is_darwin_vfs = ft_raccess_rule_by_darwin_vfs( library, i );\n      if ( is_darwin_vfs && vfs_rfork_has_no_font )\n      {\n        FT_TRACE3(( \"Skip rule %d: darwin vfs resource fork\"\n                    \" is already checked and\"\n                    \" no font is found\\n\", i ));\n        continue;\n      }\n\n      if ( errors[i] )\n      {\n        FT_TRACE3(( \"Error[%d] has occurred in rule %d\\n\", errors[i], i ));\n        continue;\n      }\n\n      args2.flags    = FT_OPEN_PATHNAME;\n      args2.pathname = file_names[i] ? file_names[i] : args->pathname;\n\n      FT_TRACE3(( \"Try rule %d: %s (offset=%d) ...\",\n                  i, args2.pathname, offsets[i] ));\n\n      error = FT_Stream_New( library, &args2, &stream2 );\n      if ( is_darwin_vfs && FT_ERR_EQ( error, Cannot_Open_Stream ) )\n        vfs_rfork_has_no_font = TRUE;\n\n      if ( error )\n      {\n        FT_TRACE3(( \"failed\\n\" ));\n        continue;\n      }\n\n      error = IsMacResource( library, stream2, offsets[i],\n                             face_index, aface );\n      FT_Stream_Free( stream2, 0 );\n\n      FT_TRACE3(( \"%s\\n\", error ? \"failed\": \"successful\" ));\n\n      if ( !error )\n          break;\n      else if ( is_darwin_vfs )\n          vfs_rfork_has_no_font = TRUE;\n    }\n\n    for (i = 0; i < FT_RACCESS_N_RULES; i++)\n    {\n      if ( file_names[i] )\n        FT_FREE( file_names[i] );\n    }\n\n    /* Caller (load_mac_face) requires FT_Err_Unknown_File_Format. */\n    if ( error )\n      error = FT_ERR( Unknown_File_Format );\n\n    return error;\n\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_objs\n\n  }\n\n\n  /* Check for some macintosh formats without Carbon framework.    */\n  /* Is this a macbinary file?  If so look at the resource fork.   */\n  /* Is this a mac dfont file?                                     */\n  /* Is this an old style resource fork? (in data)                 */\n  /* Else call load_face_in_embedded_rfork to try extra rules      */\n  /* (defined in `ftrfork.c').                                     */\n  /*                                                               */\n  static FT_Error\n  load_mac_face( FT_Library           library,\n                 FT_Stream            stream,\n                 FT_Long              face_index,\n                 FT_Face             *aface,\n                 const FT_Open_Args  *args )\n  {\n    FT_Error error;\n    FT_UNUSED( args );\n\n\n    error = IsMacBinary( library, stream, face_index, aface );\n    if ( FT_ERR_EQ( error, Unknown_File_Format ) )\n    {\n\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_raccess\n\n      FT_TRACE3(( \"Try as dfont: %s ...\", args->pathname ));\n\n      error = IsMacResource( library, stream, 0, face_index, aface );\n\n      FT_TRACE3(( \"%s\\n\", error ? \"failed\" : \"successful\" ));\n\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_objs\n\n    }\n\n    if ( ( FT_ERR_EQ( error, Unknown_File_Format )      ||\n           FT_ERR_EQ( error, Invalid_Stream_Operation ) ) &&\n         ( args->flags & FT_OPEN_PATHNAME )               )\n      error = load_face_in_embedded_rfork( library, stream,\n                                           face_index, aface, args );\n    return error;\n  }\n#endif\n\n#endif  /* !FT_MACINTOSH && FT_CONFIG_OPTION_MAC_FONTS */\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Open_Face( FT_Library           library,\n                const FT_Open_Args*  args,\n                FT_Long              face_index,\n                FT_Face             *aface )\n  {\n    FT_Error     error;\n    FT_Driver    driver = NULL;\n    FT_Memory    memory = NULL;\n    FT_Stream    stream = NULL;\n    FT_Face      face   = NULL;\n    FT_ListNode  node   = NULL;\n    FT_Bool      external_stream;\n    FT_Module*   cur;\n    FT_Module*   limit;\n\n\n    /* test for valid `library' delayed to `FT_Stream_New' */\n\n    if ( ( !aface && face_index >= 0 ) || !args )\n      return FT_THROW( Invalid_Argument );\n\n    external_stream = FT_BOOL( ( args->flags & FT_OPEN_STREAM ) &&\n                               args->stream                     );\n\n    /* create input stream */\n    error = FT_Stream_New( library, args, &stream );\n    if ( error )\n      goto Fail3;\n\n    memory = library->memory;\n\n    /* If the font driver is specified in the `args' structure, use */\n    /* it.  Otherwise, we scan the list of registered drivers.      */\n    if ( ( args->flags & FT_OPEN_DRIVER ) && args->driver )\n    {\n      driver = FT_DRIVER( args->driver );\n\n      /* not all modules are drivers, so check... */\n      if ( FT_MODULE_IS_DRIVER( driver ) )\n      {\n        FT_Int         num_params = 0;\n        FT_Parameter*  params     = 0;\n\n\n        if ( args->flags & FT_OPEN_PARAMS )\n        {\n          num_params = args->num_params;\n          params     = args->params;\n        }\n\n        error = open_face( driver, &stream, external_stream, face_index,\n                           num_params, params, &face );\n        if ( !error )\n          goto Success;\n      }\n      else\n        error = FT_THROW( Invalid_Handle );\n\n      FT_Stream_Free( stream, external_stream );\n      goto Fail;\n    }\n    else\n    {\n      error = FT_ERR( Missing_Module );\n\n      /* check each font driver for an appropriate format */\n      cur   = library->modules;\n      limit = cur + library->num_modules;\n\n      for ( ; cur < limit; cur++ )\n      {\n        /* not all modules are font drivers, so check... */\n        if ( FT_MODULE_IS_DRIVER( cur[0] ) )\n        {\n          FT_Int         num_params = 0;\n          FT_Parameter*  params     = 0;\n\n\n          driver = FT_DRIVER( cur[0] );\n\n          if ( args->flags & FT_OPEN_PARAMS )\n          {\n            num_params = args->num_params;\n            params     = args->params;\n          }\n\n          error = open_face( driver, &stream, external_stream, face_index,\n                             num_params, params, &face );\n          if ( !error )\n            goto Success;\n\n#ifdef FT_CONFIG_OPTION_MAC_FONTS\n          if ( ft_strcmp( cur[0]->clazz->module_name, \"truetype\" ) == 0 &&\n               FT_ERR_EQ( error, Table_Missing )                        )\n          {\n            /* TrueType but essential tables are missing */\n            if ( FT_Stream_Seek( stream, 0 ) )\n              break;\n\n            error = open_face_PS_from_sfnt_stream( library,\n                                                   stream,\n                                                   face_index,\n                                                   num_params,\n                                                   params,\n                                                   aface );\n            if ( !error )\n            {\n              FT_Stream_Free( stream, external_stream );\n              return error;\n            }\n          }\n#endif\n\n          if ( FT_ERR_NEQ( error, Unknown_File_Format ) )\n            goto Fail3;\n        }\n      }\n\n    Fail3:\n      /* If we are on the mac, and we get an                          */\n      /* FT_Err_Invalid_Stream_Operation it may be because we have an */\n      /* empty data fork, so we need to check the resource fork.      */\n      if ( FT_ERR_NEQ( error, Cannot_Open_Stream )       &&\n           FT_ERR_NEQ( error, Unknown_File_Format )      &&\n           FT_ERR_NEQ( error, Invalid_Stream_Operation ) )\n        goto Fail2;\n\n#if !defined( FT_MACINTOSH ) && defined( FT_CONFIG_OPTION_MAC_FONTS )\n      error = load_mac_face( library, stream, face_index, aface, args );\n      if ( !error )\n      {\n        /* We don't want to go to Success here.  We've already done that. */\n        /* On the other hand, if we succeeded we still need to close this */\n        /* stream (we opened a different stream which extracted the       */\n        /* interesting information out of this stream here.  That stream  */\n        /* will still be open and the face will point to it).             */\n        FT_Stream_Free( stream, external_stream );\n        return error;\n      }\n\n      if ( FT_ERR_NEQ( error, Unknown_File_Format ) )\n        goto Fail2;\n#endif  /* !FT_MACINTOSH && FT_CONFIG_OPTION_MAC_FONTS */\n\n      /* no driver is able to handle this format */\n      error = FT_THROW( Unknown_File_Format );\n\n  Fail2:\n      FT_Stream_Free( stream, external_stream );\n      goto Fail;\n    }\n\n  Success:\n    FT_TRACE4(( \"FT_Open_Face: New face object, adding to list\\n\" ));\n\n    /* add the face object to its driver's list */\n    if ( FT_NEW( node ) )\n      goto Fail;\n\n    node->data = face;\n    /* don't assume driver is the same as face->driver, so use */\n    /* face->driver instead.                                   */\n    FT_List_Add( &face->driver->faces_list, node );\n\n    /* now allocate a glyph slot object for the face */\n    FT_TRACE4(( \"FT_Open_Face: Creating glyph slot\\n\" ));\n\n    if ( face_index >= 0 )\n    {\n      error = FT_New_GlyphSlot( face, NULL );\n      if ( error )\n        goto Fail;\n\n      /* finally, allocate a size object for the face */\n      {\n        FT_Size  size;\n\n\n        FT_TRACE4(( \"FT_Open_Face: Creating size object\\n\" ));\n\n        error = FT_New_Size( face, &size );\n        if ( error )\n          goto Fail;\n\n        face->size = size;\n      }\n    }\n\n    /* some checks */\n\n    if ( FT_IS_SCALABLE( face ) )\n    {\n      if ( face->height < 0 )\n        face->height = (FT_Short)-face->height;\n\n      if ( !FT_HAS_VERTICAL( face ) )\n        face->max_advance_height = (FT_Short)face->height;\n    }\n\n    if ( FT_HAS_FIXED_SIZES( face ) )\n    {\n      FT_Int  i;\n\n\n      for ( i = 0; i < face->num_fixed_sizes; i++ )\n      {\n        FT_Bitmap_Size*  bsize = face->available_sizes + i;\n\n\n        if ( bsize->height < 0 )\n          bsize->height = (FT_Short)-bsize->height;\n        if ( bsize->x_ppem < 0 )\n          bsize->x_ppem = (FT_Short)-bsize->x_ppem;\n        if ( bsize->y_ppem < 0 )\n          bsize->y_ppem = -bsize->y_ppem;\n      }\n    }\n\n    /* initialize internal face data */\n    {\n      FT_Face_Internal  internal = face->internal;\n\n\n      internal->transform_matrix.xx = 0x10000L;\n      internal->transform_matrix.xy = 0;\n      internal->transform_matrix.yx = 0;\n      internal->transform_matrix.yy = 0x10000L;\n\n      internal->transform_delta.x = 0;\n      internal->transform_delta.y = 0;\n\n      internal->refcount = 1;\n    }\n\n    if ( aface )\n      *aface = face;\n    else\n      FT_Done_Face( face );\n\n    goto Exit;\n\n  Fail:\n    if ( node )\n      FT_Done_Face( face );    /* face must be in the driver's list */\n    else if ( face )\n      destroy_face( memory, face, driver );\n\n  Exit:\n    FT_TRACE4(( \"FT_Open_Face: Return %d\\n\", error ));\n\n    return error;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Attach_File( FT_Face      face,\n                  const char*  filepathname )\n  {\n    FT_Open_Args  open;\n\n\n    /* test for valid `face' delayed to `FT_Attach_Stream' */\n\n    if ( !filepathname )\n      return FT_THROW( Invalid_Argument );\n\n    open.stream   = NULL;\n    open.flags    = FT_OPEN_PATHNAME;\n    open.pathname = (char*)filepathname;\n\n    return FT_Attach_Stream( face, &open );\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Attach_Stream( FT_Face        face,\n                    FT_Open_Args*  parameters )\n  {\n    FT_Stream  stream;\n    FT_Error   error;\n    FT_Driver  driver;\n\n    FT_Driver_Class  clazz;\n\n\n    /* test for valid `parameters' delayed to `FT_Stream_New' */\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    driver = face->driver;\n    if ( !driver )\n      return FT_THROW( Invalid_Driver_Handle );\n\n    error = FT_Stream_New( driver->root.library, parameters, &stream );\n    if ( error )\n      goto Exit;\n\n    /* we implement FT_Attach_Stream in each driver through the */\n    /* `attach_file' interface                                  */\n\n    error = FT_ERR( Unimplemented_Feature );\n    clazz = driver->clazz;\n    if ( clazz->attach_file )\n      error = clazz->attach_file( face, stream );\n\n    /* close the attached stream */\n    FT_Stream_Free( stream,\n                    (FT_Bool)( parameters->stream &&\n                               ( parameters->flags & FT_OPEN_STREAM ) ) );\n\n  Exit:\n    return error;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Reference_Face( FT_Face  face )\n  {\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    face->internal->refcount++;\n\n    return FT_Err_Ok;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Done_Face( FT_Face  face )\n  {\n    FT_Error     error;\n    FT_Driver    driver;\n    FT_Memory    memory;\n    FT_ListNode  node;\n\n\n    error = FT_ERR( Invalid_Face_Handle );\n    if ( face && face->driver )\n    {\n      face->internal->refcount--;\n      if ( face->internal->refcount > 0 )\n        error = FT_Err_Ok;\n      else\n      {\n        driver = face->driver;\n        memory = driver->root.memory;\n\n        /* find face in driver's list */\n        node = FT_List_Find( &driver->faces_list, face );\n        if ( node )\n        {\n          /* remove face object from the driver's list */\n          FT_List_Remove( &driver->faces_list, node );\n          FT_FREE( node );\n\n          /* now destroy the object proper */\n          destroy_face( memory, face, driver );\n          error = FT_Err_Ok;\n        }\n      }\n    }\n\n    return error;\n  }\n\n\n  /* documentation is in ftobjs.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_New_Size( FT_Face   face,\n               FT_Size  *asize )\n  {\n    FT_Error         error;\n    FT_Memory        memory;\n    FT_Driver        driver;\n    FT_Driver_Class  clazz;\n\n    FT_Size          size = 0;\n    FT_ListNode      node = 0;\n\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    if ( !asize )\n      return FT_THROW( Invalid_Argument );\n\n    if ( !face->driver )\n      return FT_THROW( Invalid_Driver_Handle );\n\n    *asize = 0;\n\n    driver = face->driver;\n    clazz  = driver->clazz;\n    memory = face->memory;\n\n    /* Allocate new size object and perform basic initialisation */\n    if ( FT_ALLOC( size, clazz->size_object_size ) || FT_NEW( node ) )\n      goto Exit;\n\n    size->face = face;\n\n    /* for now, do not use any internal fields in size objects */\n    size->internal = 0;\n\n    if ( clazz->init_size )\n      error = clazz->init_size( size );\n\n    /* in case of success, add to the face's list */\n    if ( !error )\n    {\n      *asize     = size;\n      node->data = size;\n      FT_List_Add( &face->sizes_list, node );\n    }\n\n  Exit:\n    if ( error )\n    {\n      FT_FREE( node );\n      FT_FREE( size );\n    }\n\n    return error;\n  }\n\n\n  /* documentation is in ftobjs.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Done_Size( FT_Size  size )\n  {\n    FT_Error     error;\n    FT_Driver    driver;\n    FT_Memory    memory;\n    FT_Face      face;\n    FT_ListNode  node;\n\n\n    if ( !size )\n      return FT_THROW( Invalid_Size_Handle );\n\n    face = size->face;\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    driver = face->driver;\n    if ( !driver )\n      return FT_THROW( Invalid_Driver_Handle );\n\n    memory = driver->root.memory;\n\n    error = FT_Err_Ok;\n    node  = FT_List_Find( &face->sizes_list, size );\n    if ( node )\n    {\n      FT_List_Remove( &face->sizes_list, node );\n      FT_FREE( node );\n\n      if ( face->size == size )\n      {\n        face->size = 0;\n        if ( face->sizes_list.head )\n          face->size = (FT_Size)(face->sizes_list.head->data);\n      }\n\n      destroy_size( memory, size, driver );\n    }\n    else\n      error = FT_THROW( Invalid_Size_Handle );\n\n    return error;\n  }\n\n\n  /* documentation is in ftobjs.h */\n\n  FT_BASE_DEF( FT_Error )\n  FT_Match_Size( FT_Face          face,\n                 FT_Size_Request  req,\n                 FT_Bool          ignore_width,\n                 FT_ULong*        size_index )\n  {\n    FT_Int   i;\n    FT_Long  w, h;\n\n\n    if ( !FT_HAS_FIXED_SIZES( face ) )\n      return FT_THROW( Invalid_Face_Handle );\n\n    /* FT_Bitmap_Size doesn't provide enough info... */\n    if ( req->type != FT_SIZE_REQUEST_TYPE_NOMINAL )\n      return FT_THROW( Unimplemented_Feature );\n\n    w = FT_REQUEST_WIDTH ( req );\n    h = FT_REQUEST_HEIGHT( req );\n\n    if ( req->width && !req->height )\n      h = w;\n    else if ( !req->width && req->height )\n      w = h;\n\n    w = FT_PIX_ROUND( w );\n    h = FT_PIX_ROUND( h );\n\n    for ( i = 0; i < face->num_fixed_sizes; i++ )\n    {\n      FT_Bitmap_Size*  bsize = face->available_sizes + i;\n\n\n      if ( h != FT_PIX_ROUND( bsize->y_ppem ) )\n        continue;\n\n      if ( w == FT_PIX_ROUND( bsize->x_ppem ) || ignore_width )\n      {\n        FT_TRACE3(( \"FT_Match_Size: bitmap strike %d matches\\n\", i ));\n\n        if ( size_index )\n          *size_index = (FT_ULong)i;\n\n        return FT_Err_Ok;\n      }\n    }\n\n    return FT_THROW( Invalid_Pixel_Size );\n  }\n\n\n  /* documentation is in ftobjs.h */\n\n  FT_BASE_DEF( void )\n  ft_synthesize_vertical_metrics( FT_Glyph_Metrics*  metrics,\n                                  FT_Pos             advance )\n  {\n    FT_Pos  height = metrics->height;\n\n\n    /* compensate for glyph with bbox above/below the baseline */\n    if ( metrics->horiBearingY < 0 )\n    {\n      if ( height < metrics->horiBearingY )\n        height = metrics->horiBearingY;\n    }\n    else if ( metrics->horiBearingY > 0 )\n      height -= metrics->horiBearingY;\n\n    /* the factor 1.2 is a heuristical value */\n    if ( !advance )\n      advance = height * 12 / 10;\n\n    metrics->vertBearingX = metrics->horiBearingX - metrics->horiAdvance / 2;\n    metrics->vertBearingY = ( advance - height ) / 2;\n    metrics->vertAdvance  = advance;\n  }\n\n\n  static void\n  ft_recompute_scaled_metrics( FT_Face           face,\n                               FT_Size_Metrics*  metrics )\n  {\n    /* Compute root ascender, descender, test height, and max_advance */\n\n#ifdef GRID_FIT_METRICS\n    metrics->ascender    = FT_PIX_CEIL( FT_MulFix( face->ascender,\n                                                   metrics->y_scale ) );\n\n    metrics->descender   = FT_PIX_FLOOR( FT_MulFix( face->descender,\n                                                    metrics->y_scale ) );\n\n    metrics->height      = FT_PIX_ROUND( FT_MulFix( face->height,\n                                                    metrics->y_scale ) );\n\n    metrics->max_advance = FT_PIX_ROUND( FT_MulFix( face->max_advance_width,\n                                                    metrics->x_scale ) );\n#else /* !GRID_FIT_METRICS */\n    metrics->ascender    = FT_MulFix( face->ascender,\n                                      metrics->y_scale );\n\n    metrics->descender   = FT_MulFix( face->descender,\n                                      metrics->y_scale );\n\n    metrics->height      = FT_MulFix( face->height,\n                                      metrics->y_scale );\n\n    metrics->max_advance = FT_MulFix( face->max_advance_width,\n                                      metrics->x_scale );\n#endif /* !GRID_FIT_METRICS */\n  }\n\n\n  FT_BASE_DEF( void )\n  FT_Select_Metrics( FT_Face   face,\n                     FT_ULong  strike_index )\n  {\n    FT_Size_Metrics*  metrics;\n    FT_Bitmap_Size*   bsize;\n\n\n    metrics = &face->size->metrics;\n    bsize   = face->available_sizes + strike_index;\n\n    metrics->x_ppem = (FT_UShort)( ( bsize->x_ppem + 32 ) >> 6 );\n    metrics->y_ppem = (FT_UShort)( ( bsize->y_ppem + 32 ) >> 6 );\n\n    if ( FT_IS_SCALABLE( face ) )\n    {\n      metrics->x_scale = FT_DivFix( bsize->x_ppem,\n                                    face->units_per_EM );\n      metrics->y_scale = FT_DivFix( bsize->y_ppem,\n                                    face->units_per_EM );\n\n      ft_recompute_scaled_metrics( face, metrics );\n    }\n    else\n    {\n      metrics->x_scale     = 1L << 16;\n      metrics->y_scale     = 1L << 16;\n      metrics->ascender    = bsize->y_ppem;\n      metrics->descender   = 0;\n      metrics->height      = bsize->height << 6;\n      metrics->max_advance = bsize->x_ppem;\n    }\n\n    FT_TRACE5(( \"FT_Select_Metrics:\\n\" ));\n    FT_TRACE5(( \"  x scale: %d (%f)\\n\",\n                metrics->x_scale, metrics->x_scale / 65536.0 ));\n    FT_TRACE5(( \"  y scale: %d (%f)\\n\",\n                metrics->y_scale, metrics->y_scale / 65536.0 ));\n    FT_TRACE5(( \"  ascender: %f\\n\",    metrics->ascender / 64.0 ));\n    FT_TRACE5(( \"  descender: %f\\n\",   metrics->descender / 64.0 ));\n    FT_TRACE5(( \"  height: %f\\n\",      metrics->height / 64.0 ));\n    FT_TRACE5(( \"  max advance: %f\\n\", metrics->max_advance / 64.0 ));\n    FT_TRACE5(( \"  x ppem: %d\\n\",      metrics->x_ppem ));\n    FT_TRACE5(( \"  y ppem: %d\\n\",      metrics->y_ppem ));\n  }\n\n\n  FT_BASE_DEF( void )\n  FT_Request_Metrics( FT_Face          face,\n                      FT_Size_Request  req )\n  {\n    FT_Size_Metrics*  metrics;\n\n\n    metrics = &face->size->metrics;\n\n    if ( FT_IS_SCALABLE( face ) )\n    {\n      FT_Long  w = 0, h = 0, scaled_w = 0, scaled_h = 0;\n\n\n      switch ( req->type )\n      {\n      case FT_SIZE_REQUEST_TYPE_NOMINAL:\n        w = h = face->units_per_EM;\n        break;\n\n      case FT_SIZE_REQUEST_TYPE_REAL_DIM:\n        w = h = face->ascender - face->descender;\n        break;\n\n      case FT_SIZE_REQUEST_TYPE_BBOX:\n        w = face->bbox.xMax - face->bbox.xMin;\n        h = face->bbox.yMax - face->bbox.yMin;\n        break;\n\n      case FT_SIZE_REQUEST_TYPE_CELL:\n        w = face->max_advance_width;\n        h = face->ascender - face->descender;\n        break;\n\n      case FT_SIZE_REQUEST_TYPE_SCALES:\n        metrics->x_scale = (FT_Fixed)req->width;\n        metrics->y_scale = (FT_Fixed)req->height;\n        if ( !metrics->x_scale )\n          metrics->x_scale = metrics->y_scale;\n        else if ( !metrics->y_scale )\n          metrics->y_scale = metrics->x_scale;\n        goto Calculate_Ppem;\n\n      case FT_SIZE_REQUEST_TYPE_MAX:\n        break;\n      }\n\n      /* to be on the safe side */\n      if ( w < 0 )\n        w = -w;\n\n      if ( h < 0 )\n        h = -h;\n\n      scaled_w = FT_REQUEST_WIDTH ( req );\n      scaled_h = FT_REQUEST_HEIGHT( req );\n\n      /* determine scales */\n      if ( req->width )\n      {\n        metrics->x_scale = FT_DivFix( scaled_w, w );\n\n        if ( req->height )\n        {\n          metrics->y_scale = FT_DivFix( scaled_h, h );\n\n          if ( req->type == FT_SIZE_REQUEST_TYPE_CELL )\n          {\n            if ( metrics->y_scale > metrics->x_scale )\n              metrics->y_scale = metrics->x_scale;\n            else\n              metrics->x_scale = metrics->y_scale;\n          }\n        }\n        else\n        {\n          metrics->y_scale = metrics->x_scale;\n          scaled_h = FT_MulDiv( scaled_w, h, w );\n        }\n      }\n      else\n      {\n        metrics->x_scale = metrics->y_scale = FT_DivFix( scaled_h, h );\n        scaled_w = FT_MulDiv( scaled_h, w, h );\n      }\n\n  Calculate_Ppem:\n      /* calculate the ppems */\n      if ( req->type != FT_SIZE_REQUEST_TYPE_NOMINAL )\n      {\n        scaled_w = FT_MulFix( face->units_per_EM, metrics->x_scale );\n        scaled_h = FT_MulFix( face->units_per_EM, metrics->y_scale );\n      }\n\n      metrics->x_ppem = (FT_UShort)( ( scaled_w + 32 ) >> 6 );\n      metrics->y_ppem = (FT_UShort)( ( scaled_h + 32 ) >> 6 );\n\n      ft_recompute_scaled_metrics( face, metrics );\n    }\n    else\n    {\n      FT_ZERO( metrics );\n      metrics->x_scale = 1L << 16;\n      metrics->y_scale = 1L << 16;\n    }\n\n    FT_TRACE5(( \"FT_Request_Metrics:\\n\" ));\n    FT_TRACE5(( \"  x scale: %d (%f)\\n\",\n                metrics->x_scale, metrics->x_scale / 65536.0 ));\n    FT_TRACE5(( \"  y scale: %d (%f)\\n\",\n                metrics->y_scale, metrics->y_scale / 65536.0 ));\n    FT_TRACE5(( \"  ascender: %f\\n\",    metrics->ascender / 64.0 ));\n    FT_TRACE5(( \"  descender: %f\\n\",   metrics->descender / 64.0 ));\n    FT_TRACE5(( \"  height: %f\\n\",      metrics->height / 64.0 ));\n    FT_TRACE5(( \"  max advance: %f\\n\", metrics->max_advance / 64.0 ));\n    FT_TRACE5(( \"  x ppem: %d\\n\",      metrics->x_ppem ));\n    FT_TRACE5(( \"  y ppem: %d\\n\",      metrics->y_ppem ));\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Select_Size( FT_Face  face,\n                  FT_Int   strike_index )\n  {\n    FT_Driver_Class  clazz;\n\n\n    if ( !face || !FT_HAS_FIXED_SIZES( face ) )\n      return FT_THROW( Invalid_Face_Handle );\n\n    if ( strike_index < 0 || strike_index >= face->num_fixed_sizes )\n      return FT_THROW( Invalid_Argument );\n\n    clazz = face->driver->clazz;\n\n    if ( clazz->select_size )\n    {\n      FT_Error  error;\n\n\n      error = clazz->select_size( face->size, (FT_ULong)strike_index );\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n      {\n        FT_Size_Metrics*  metrics = &face->size->metrics;\n\n\n        FT_TRACE5(( \"FT_Select_Size (font driver's `select_size'):\\n\" ));\n        FT_TRACE5(( \"  x scale: %d (%f)\\n\",\n                    metrics->x_scale, metrics->x_scale / 65536.0 ));\n        FT_TRACE5(( \"  y scale: %d (%f)\\n\",\n                    metrics->y_scale, metrics->y_scale / 65536.0 ));\n        FT_TRACE5(( \"  ascender: %f\\n\",    metrics->ascender / 64.0 ));\n        FT_TRACE5(( \"  descender: %f\\n\",   metrics->descender / 64.0 ));\n        FT_TRACE5(( \"  height: %f\\n\",      metrics->height / 64.0 ));\n        FT_TRACE5(( \"  max advance: %f\\n\", metrics->max_advance / 64.0 ));\n        FT_TRACE5(( \"  x ppem: %d\\n\",      metrics->x_ppem ));\n        FT_TRACE5(( \"  y ppem: %d\\n\",      metrics->y_ppem ));\n      }\n#endif\n\n      return error;\n    }\n\n    FT_Select_Metrics( face, (FT_ULong)strike_index );\n\n    return FT_Err_Ok;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Request_Size( FT_Face          face,\n                   FT_Size_Request  req )\n  {\n    FT_Driver_Class  clazz;\n    FT_ULong         strike_index;\n\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    if ( !req || req->width < 0 || req->height < 0 ||\n         req->type >= FT_SIZE_REQUEST_TYPE_MAX )\n      return FT_THROW( Invalid_Argument );\n\n    clazz = face->driver->clazz;\n\n    if ( clazz->request_size )\n    {\n      FT_Error  error;\n\n\n      error = clazz->request_size( face->size, req );\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n      {\n        FT_Size_Metrics*  metrics = &face->size->metrics;\n\n\n        FT_TRACE5(( \"FT_Request_Size (font driver's `request_size'):\\n\" ));\n        FT_TRACE5(( \"  x scale: %d (%f)\\n\",\n                    metrics->x_scale, metrics->x_scale / 65536.0 ));\n        FT_TRACE5(( \"  y scale: %d (%f)\\n\",\n                    metrics->y_scale, metrics->y_scale / 65536.0 ));\n        FT_TRACE5(( \"  ascender: %f\\n\",    metrics->ascender / 64.0 ));\n        FT_TRACE5(( \"  descender: %f\\n\",   metrics->descender / 64.0 ));\n        FT_TRACE5(( \"  height: %f\\n\",      metrics->height / 64.0 ));\n        FT_TRACE5(( \"  max advance: %f\\n\", metrics->max_advance / 64.0 ));\n        FT_TRACE5(( \"  x ppem: %d\\n\",      metrics->x_ppem ));\n        FT_TRACE5(( \"  y ppem: %d\\n\",      metrics->y_ppem ));\n      }\n#endif\n\n      return error;\n    }\n\n    /*\n     * The reason that a driver doesn't have `request_size' defined is\n     * either that the scaling here suffices or that the supported formats\n     * are bitmap-only and size matching is not implemented.\n     *\n     * In the latter case, a simple size matching is done.\n     */\n    if ( !FT_IS_SCALABLE( face ) && FT_HAS_FIXED_SIZES( face ) )\n    {\n      FT_Error  error;\n\n\n      error = FT_Match_Size( face, req, 0, &strike_index );\n      if ( error )\n        return error;\n\n      return FT_Select_Size( face, (FT_Int)strike_index );\n    }\n\n    FT_Request_Metrics( face, req );\n\n    return FT_Err_Ok;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Set_Char_Size( FT_Face     face,\n                    FT_F26Dot6  char_width,\n                    FT_F26Dot6  char_height,\n                    FT_UInt     horz_resolution,\n                    FT_UInt     vert_resolution )\n  {\n    FT_Size_RequestRec  req;\n\n\n    /* check of `face' delayed to `FT_Request_Size' */\n\n    if ( !char_width )\n      char_width = char_height;\n    else if ( !char_height )\n      char_height = char_width;\n\n    if ( !horz_resolution )\n      horz_resolution = vert_resolution;\n    else if ( !vert_resolution )\n      vert_resolution = horz_resolution;\n\n    if ( char_width  < 1 * 64 )\n      char_width  = 1 * 64;\n    if ( char_height < 1 * 64 )\n      char_height = 1 * 64;\n\n    if ( !horz_resolution )\n      horz_resolution = vert_resolution = 72;\n\n    req.type           = FT_SIZE_REQUEST_TYPE_NOMINAL;\n    req.width          = char_width;\n    req.height         = char_height;\n    req.horiResolution = horz_resolution;\n    req.vertResolution = vert_resolution;\n\n    return FT_Request_Size( face, &req );\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Set_Pixel_Sizes( FT_Face  face,\n                      FT_UInt  pixel_width,\n                      FT_UInt  pixel_height )\n  {\n    FT_Size_RequestRec  req;\n\n\n    /* check of `face' delayed to `FT_Request_Size' */\n\n    if ( pixel_width == 0 )\n      pixel_width = pixel_height;\n    else if ( pixel_height == 0 )\n      pixel_height = pixel_width;\n\n    if ( pixel_width  < 1 )\n      pixel_width  = 1;\n    if ( pixel_height < 1 )\n      pixel_height = 1;\n\n    /* use `>=' to avoid potential compiler warning on 16bit platforms */\n    if ( pixel_width  >= 0xFFFFU )\n      pixel_width  = 0xFFFFU;\n    if ( pixel_height >= 0xFFFFU )\n      pixel_height = 0xFFFFU;\n\n    req.type           = FT_SIZE_REQUEST_TYPE_NOMINAL;\n    req.width          = pixel_width << 6;\n    req.height         = pixel_height << 6;\n    req.horiResolution = 0;\n    req.vertResolution = 0;\n\n    return FT_Request_Size( face, &req );\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Get_Kerning( FT_Face     face,\n                  FT_UInt     left_glyph,\n                  FT_UInt     right_glyph,\n                  FT_UInt     kern_mode,\n                  FT_Vector  *akerning )\n  {\n    FT_Error   error = FT_Err_Ok;\n    FT_Driver  driver;\n\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    if ( !akerning )\n      return FT_THROW( Invalid_Argument );\n\n    driver = face->driver;\n\n    akerning->x = 0;\n    akerning->y = 0;\n\n    if ( driver->clazz->get_kerning )\n    {\n      error = driver->clazz->get_kerning( face,\n                                          left_glyph,\n                                          right_glyph,\n                                          akerning );\n      if ( !error )\n      {\n        if ( kern_mode != FT_KERNING_UNSCALED )\n        {\n          akerning->x = FT_MulFix( akerning->x, face->size->metrics.x_scale );\n          akerning->y = FT_MulFix( akerning->y, face->size->metrics.y_scale );\n\n          if ( kern_mode != FT_KERNING_UNFITTED )\n          {\n            /* we scale down kerning values for small ppem values */\n            /* to avoid that rounding makes them too big.         */\n            /* `25' has been determined heuristically.            */\n            if ( face->size->metrics.x_ppem < 25 )\n              akerning->x = FT_MulDiv( akerning->x,\n                                       face->size->metrics.x_ppem, 25 );\n            if ( face->size->metrics.y_ppem < 25 )\n              akerning->y = FT_MulDiv( akerning->y,\n                                       face->size->metrics.y_ppem, 25 );\n\n            akerning->x = FT_PIX_ROUND( akerning->x );\n            akerning->y = FT_PIX_ROUND( akerning->y );\n          }\n        }\n      }\n    }\n\n    return error;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Get_Track_Kerning( FT_Face    face,\n                        FT_Fixed   point_size,\n                        FT_Int     degree,\n                        FT_Fixed*  akerning )\n  {\n    FT_Service_Kerning  service;\n    FT_Error            error = FT_Err_Ok;\n\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    if ( !akerning )\n      return FT_THROW( Invalid_Argument );\n\n    FT_FACE_FIND_SERVICE( face, service, KERNING );\n    if ( !service )\n      return FT_THROW( Unimplemented_Feature );\n\n    error = service->get_track( face,\n                                point_size,\n                                degree,\n                                akerning );\n\n    return error;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Select_Charmap( FT_Face      face,\n                     FT_Encoding  encoding )\n  {\n    FT_CharMap*  cur;\n    FT_CharMap*  limit;\n\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    if ( encoding == FT_ENCODING_NONE )\n      return FT_THROW( Invalid_Argument );\n\n    /* FT_ENCODING_UNICODE is special.  We try to find the `best' Unicode */\n    /* charmap available, i.e., one with UCS-4 characters, if possible.   */\n    /*                                                                    */\n    /* This is done by find_unicode_charmap() above, to share code.       */\n    if ( encoding == FT_ENCODING_UNICODE )\n      return find_unicode_charmap( face );\n\n    cur = face->charmaps;\n    if ( !cur )\n      return FT_THROW( Invalid_CharMap_Handle );\n\n    limit = cur + face->num_charmaps;\n\n    for ( ; cur < limit; cur++ )\n    {\n      if ( cur[0]->encoding == encoding )\n      {\n        face->charmap = cur[0];\n        return 0;\n      }\n    }\n\n    return FT_THROW( Invalid_Argument );\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Set_Charmap( FT_Face     face,\n                  FT_CharMap  charmap )\n  {\n    FT_CharMap*  cur;\n    FT_CharMap*  limit;\n\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    cur = face->charmaps;\n    if ( !cur || !charmap )\n      return FT_THROW( Invalid_CharMap_Handle );\n\n    if ( FT_Get_CMap_Format( charmap ) == 14 )\n      return FT_THROW( Invalid_Argument );\n\n    limit = cur + face->num_charmaps;\n\n    for ( ; cur < limit; cur++ )\n    {\n      if ( cur[0] == charmap )\n      {\n        face->charmap = cur[0];\n        return FT_Err_Ok;\n      }\n    }\n\n    return FT_THROW( Invalid_Argument );\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Int )\n  FT_Get_Charmap_Index( FT_CharMap  charmap )\n  {\n    FT_Int  i;\n\n\n    if ( !charmap || !charmap->face )\n      return -1;\n\n    for ( i = 0; i < charmap->face->num_charmaps; i++ )\n      if ( charmap->face->charmaps[i] == charmap )\n        break;\n\n    FT_ASSERT( i < charmap->face->num_charmaps );\n\n    return i;\n  }\n\n\n  static void\n  ft_cmap_done_internal( FT_CMap  cmap )\n  {\n    FT_CMap_Class  clazz  = cmap->clazz;\n    FT_Face        face   = cmap->charmap.face;\n    FT_Memory      memory = FT_FACE_MEMORY( face );\n\n\n    if ( clazz->done )\n      clazz->done( cmap );\n\n    FT_FREE( cmap );\n  }\n\n\n  FT_BASE_DEF( void )\n  FT_CMap_Done( FT_CMap  cmap )\n  {\n    if ( cmap )\n    {\n      FT_Face    face   = cmap->charmap.face;\n      FT_Memory  memory = FT_FACE_MEMORY( face );\n      FT_Error   error;\n      FT_Int     i, j;\n\n\n      for ( i = 0; i < face->num_charmaps; i++ )\n      {\n        if ( (FT_CMap)face->charmaps[i] == cmap )\n        {\n          FT_CharMap  last_charmap = face->charmaps[face->num_charmaps - 1];\n\n\n          if ( FT_RENEW_ARRAY( face->charmaps,\n                               face->num_charmaps,\n                               face->num_charmaps - 1 ) )\n            return;\n\n          /* remove it from our list of charmaps */\n          for ( j = i + 1; j < face->num_charmaps; j++ )\n          {\n            if ( j == face->num_charmaps - 1 )\n              face->charmaps[j - 1] = last_charmap;\n            else\n              face->charmaps[j - 1] = face->charmaps[j];\n          }\n\n          face->num_charmaps--;\n\n          if ( (FT_CMap)face->charmap == cmap )\n            face->charmap = NULL;\n\n          ft_cmap_done_internal( cmap );\n\n          break;\n        }\n      }\n    }\n  }\n\n\n  FT_BASE_DEF( FT_Error )\n  FT_CMap_New( FT_CMap_Class  clazz,\n               FT_Pointer     init_data,\n               FT_CharMap     charmap,\n               FT_CMap       *acmap )\n  {\n    FT_Error   error = FT_Err_Ok;\n    FT_Face    face;\n    FT_Memory  memory;\n    FT_CMap    cmap = NULL;\n\n\n    if ( clazz == NULL || charmap == NULL || charmap->face == NULL )\n      return FT_THROW( Invalid_Argument );\n\n    face   = charmap->face;\n    memory = FT_FACE_MEMORY( face );\n\n    if ( !FT_ALLOC( cmap, clazz->size ) )\n    {\n      cmap->charmap = *charmap;\n      cmap->clazz   = clazz;\n\n      if ( clazz->init )\n      {\n        error = clazz->init( cmap, init_data );\n        if ( error )\n          goto Fail;\n      }\n\n      /* add it to our list of charmaps */\n      if ( FT_RENEW_ARRAY( face->charmaps,\n                           face->num_charmaps,\n                           face->num_charmaps + 1 ) )\n        goto Fail;\n\n      face->charmaps[face->num_charmaps++] = (FT_CharMap)cmap;\n    }\n\n  Exit:\n    if ( acmap )\n      *acmap = cmap;\n\n    return error;\n\n  Fail:\n    ft_cmap_done_internal( cmap );\n    cmap = NULL;\n    goto Exit;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_UInt )\n  FT_Get_Char_Index( FT_Face   face,\n                     FT_ULong  charcode )\n  {\n    FT_UInt  result = 0;\n\n\n    if ( face && face->charmap )\n    {\n      FT_CMap  cmap = FT_CMAP( face->charmap );\n\n\n      if ( charcode > 0xFFFFFFFFUL )\n      {\n        FT_TRACE1(( \"FT_Get_Char_Index: too large charcode\" ));\n        FT_TRACE1(( \" 0x%x is truncated\\n\", charcode ));\n      }\n      result = cmap->clazz->char_index( cmap, (FT_UInt32)charcode );\n    }\n    return result;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_ULong )\n  FT_Get_First_Char( FT_Face   face,\n                     FT_UInt  *agindex )\n  {\n    FT_ULong  result = 0;\n    FT_UInt   gindex = 0;\n\n\n    /* only do something if we have a charmap, and we have glyphs at all */\n    if ( face && face->charmap && face->num_glyphs )\n    {\n      gindex = FT_Get_Char_Index( face, 0 );\n      if ( gindex == 0 || gindex >= (FT_UInt)face->num_glyphs )\n        result = FT_Get_Next_Char( face, 0, &gindex );\n    }\n\n    if ( agindex )\n      *agindex = gindex;\n\n    return result;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_ULong )\n  FT_Get_Next_Char( FT_Face   face,\n                    FT_ULong  charcode,\n                    FT_UInt  *agindex )\n  {\n    FT_ULong  result = 0;\n    FT_UInt   gindex = 0;\n\n\n    if ( face && face->charmap && face->num_glyphs )\n    {\n      FT_UInt32  code = (FT_UInt32)charcode;\n      FT_CMap    cmap = FT_CMAP( face->charmap );\n\n\n      do\n      {\n        gindex = cmap->clazz->char_next( cmap, &code );\n\n      } while ( gindex >= (FT_UInt)face->num_glyphs );\n\n      result = ( gindex == 0 ) ? 0 : code;\n    }\n\n    if ( agindex )\n      *agindex = gindex;\n\n    return result;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_UInt )\n  FT_Face_GetCharVariantIndex( FT_Face   face,\n                               FT_ULong  charcode,\n                               FT_ULong  variantSelector )\n  {\n    FT_UInt  result = 0;\n\n\n    if ( face                                           &&\n         face->charmap                                  &&\n         face->charmap->encoding == FT_ENCODING_UNICODE )\n    {\n      FT_CharMap  charmap = find_variant_selector_charmap( face );\n      FT_CMap     ucmap = FT_CMAP( face->charmap );\n\n\n      if ( charmap != NULL )\n      {\n        FT_CMap  vcmap = FT_CMAP( charmap );\n\n\n        if ( charcode > 0xFFFFFFFFUL )\n        {\n          FT_TRACE1(( \"FT_Get_Char_Index: too large charcode\" ));\n          FT_TRACE1(( \" 0x%x is truncated\\n\", charcode ));\n        }\n        if ( variantSelector > 0xFFFFFFFFUL )\n        {\n          FT_TRACE1(( \"FT_Get_Char_Index: too large variantSelector\" ));\n          FT_TRACE1(( \" 0x%x is truncated\\n\", variantSelector ));\n        }\n\n        result = vcmap->clazz->char_var_index( vcmap, ucmap,\n                                               (FT_UInt32)charcode,\n                                               (FT_UInt32)variantSelector );\n      }\n    }\n\n    return result;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Int )\n  FT_Face_GetCharVariantIsDefault( FT_Face   face,\n                                   FT_ULong  charcode,\n                                   FT_ULong  variantSelector )\n  {\n    FT_Int  result = -1;\n\n\n    if ( face )\n    {\n      FT_CharMap  charmap = find_variant_selector_charmap( face );\n\n\n      if ( charmap != NULL )\n      {\n        FT_CMap  vcmap = FT_CMAP( charmap );\n\n\n        if ( charcode > 0xFFFFFFFFUL )\n        {\n          FT_TRACE1(( \"FT_Get_Char_Index: too large charcode\" ));\n          FT_TRACE1(( \" 0x%x is truncated\\n\", charcode ));\n        }\n        if ( variantSelector > 0xFFFFFFFFUL )\n        {\n          FT_TRACE1(( \"FT_Get_Char_Index: too large variantSelector\" ));\n          FT_TRACE1(( \" 0x%x is truncated\\n\", variantSelector ));\n        }\n\n        result = vcmap->clazz->char_var_default( vcmap,\n                                                 (FT_UInt32)charcode,\n                                                 (FT_UInt32)variantSelector );\n      }\n    }\n\n    return result;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_UInt32* )\n  FT_Face_GetVariantSelectors( FT_Face  face )\n  {\n    FT_UInt32  *result = NULL;\n\n\n    if ( face )\n    {\n      FT_CharMap  charmap = find_variant_selector_charmap( face );\n\n\n      if ( charmap != NULL )\n      {\n        FT_CMap    vcmap  = FT_CMAP( charmap );\n        FT_Memory  memory = FT_FACE_MEMORY( face );\n\n\n        result = vcmap->clazz->variant_list( vcmap, memory );\n      }\n    }\n\n    return result;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_UInt32* )\n  FT_Face_GetVariantsOfChar( FT_Face   face,\n                             FT_ULong  charcode )\n  {\n    FT_UInt32  *result = NULL;\n\n\n    if ( face )\n    {\n      FT_CharMap  charmap = find_variant_selector_charmap( face );\n\n\n      if ( charmap != NULL )\n      {\n        FT_CMap    vcmap  = FT_CMAP( charmap );\n        FT_Memory  memory = FT_FACE_MEMORY( face );\n\n\n        if ( charcode > 0xFFFFFFFFUL )\n        {\n          FT_TRACE1(( \"FT_Get_Char_Index: too large charcode\" ));\n          FT_TRACE1(( \" 0x%x is truncated\\n\", charcode ));\n        }\n\n        result = vcmap->clazz->charvariant_list( vcmap, memory,\n                                                 (FT_UInt32)charcode );\n      }\n    }\n    return result;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_UInt32* )\n  FT_Face_GetCharsOfVariant( FT_Face   face,\n                             FT_ULong  variantSelector )\n  {\n    FT_UInt32  *result = NULL;\n\n\n    if ( face )\n    {\n      FT_CharMap  charmap = find_variant_selector_charmap( face );\n\n\n      if ( charmap != NULL )\n      {\n        FT_CMap    vcmap  = FT_CMAP( charmap );\n        FT_Memory  memory = FT_FACE_MEMORY( face );\n\n\n        if ( variantSelector > 0xFFFFFFFFUL )\n        {\n          FT_TRACE1(( \"FT_Get_Char_Index: too large variantSelector\" ));\n          FT_TRACE1(( \" 0x%x is truncated\\n\", variantSelector ));\n        }\n\n        result = vcmap->clazz->variantchar_list( vcmap, memory,\n                                                 (FT_UInt32)variantSelector );\n      }\n    }\n\n    return result;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_UInt )\n  FT_Get_Name_Index( FT_Face     face,\n                     FT_String*  glyph_name )\n  {\n    FT_UInt  result = 0;\n\n\n    if ( face                       &&\n         FT_HAS_GLYPH_NAMES( face ) &&\n         glyph_name                 )\n    {\n      FT_Service_GlyphDict  service;\n\n\n      FT_FACE_LOOKUP_SERVICE( face,\n                              service,\n                              GLYPH_DICT );\n\n      if ( service && service->name_index )\n        result = service->name_index( face, glyph_name );\n    }\n\n    return result;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Get_Glyph_Name( FT_Face     face,\n                     FT_UInt     glyph_index,\n                     FT_Pointer  buffer,\n                     FT_UInt     buffer_max )\n  {\n    FT_Error              error;\n    FT_Service_GlyphDict  service;\n\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    if ( !buffer || buffer_max == 0 )\n      return FT_THROW( Invalid_Argument );\n\n    /* clean up buffer */\n    ((FT_Byte*)buffer)[0] = '\\0';\n\n    if ( (FT_Long)glyph_index >= face->num_glyphs )\n      return FT_THROW( Invalid_Glyph_Index );\n\n    if ( !FT_HAS_GLYPH_NAMES( face ) )\n      return FT_THROW( Invalid_Argument );\n\n    FT_FACE_LOOKUP_SERVICE( face, service, GLYPH_DICT );\n    if ( service && service->get_name )\n      error = service->get_name( face, glyph_index, buffer, buffer_max );\n    else\n      error = FT_THROW( Invalid_Argument );\n\n    return error;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( const char* )\n  FT_Get_Postscript_Name( FT_Face  face )\n  {\n    const char*  result = NULL;\n\n\n    if ( !face )\n      goto Exit;\n\n    if ( !result )\n    {\n      FT_Service_PsFontName  service;\n\n\n      FT_FACE_LOOKUP_SERVICE( face,\n                              service,\n                              POSTSCRIPT_FONT_NAME );\n\n      if ( service && service->get_ps_font_name )\n        result = service->get_ps_font_name( face );\n    }\n\n  Exit:\n    return result;\n  }\n\n\n  /* documentation is in tttables.h */\n\n  FT_EXPORT_DEF( void* )\n  FT_Get_Sfnt_Table( FT_Face      face,\n                     FT_Sfnt_Tag  tag )\n  {\n    void*                  table = NULL;\n    FT_Service_SFNT_Table  service;\n\n\n    if ( face && FT_IS_SFNT( face ) )\n    {\n      FT_FACE_FIND_SERVICE( face, service, SFNT_TABLE );\n      if ( service != NULL )\n        table = service->get_table( face, tag );\n    }\n\n    return table;\n  }\n\n\n  /* documentation is in tttables.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Load_Sfnt_Table( FT_Face    face,\n                      FT_ULong   tag,\n                      FT_Long    offset,\n                      FT_Byte*   buffer,\n                      FT_ULong*  length )\n  {\n    FT_Service_SFNT_Table  service;\n\n\n    if ( !face || !FT_IS_SFNT( face ) )\n      return FT_THROW( Invalid_Face_Handle );\n\n    FT_FACE_FIND_SERVICE( face, service, SFNT_TABLE );\n    if ( service == NULL )\n      return FT_THROW( Unimplemented_Feature );\n\n    return service->load_table( face, tag, offset, buffer, length );\n  }\n\n\n  /* documentation is in tttables.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Sfnt_Table_Info( FT_Face    face,\n                      FT_UInt    table_index,\n                      FT_ULong  *tag,\n                      FT_ULong  *length )\n  {\n    FT_Service_SFNT_Table  service;\n    FT_ULong               offset;\n\n\n    /* test for valid `length' delayed to `service->table_info' */\n\n    if ( !face || !FT_IS_SFNT( face ) )\n      return FT_THROW( Invalid_Face_Handle );\n\n    FT_FACE_FIND_SERVICE( face, service, SFNT_TABLE );\n    if ( service == NULL )\n      return FT_THROW( Unimplemented_Feature );\n\n    return service->table_info( face, table_index, tag, &offset, length );\n  }\n\n\n  /* documentation is in tttables.h */\n\n  FT_EXPORT_DEF( FT_ULong )\n  FT_Get_CMap_Language_ID( FT_CharMap  charmap )\n  {\n    FT_Service_TTCMaps  service;\n    FT_Face             face;\n    TT_CMapInfo         cmap_info;\n\n\n    if ( !charmap || !charmap->face )\n      return 0;\n\n    face = charmap->face;\n    FT_FACE_FIND_SERVICE( face, service, TT_CMAP );\n    if ( service == NULL )\n      return 0;\n    if ( service->get_cmap_info( charmap, &cmap_info ))\n      return 0;\n\n    return cmap_info.language;\n  }\n\n\n  /* documentation is in tttables.h */\n\n  FT_EXPORT_DEF( FT_Long )\n  FT_Get_CMap_Format( FT_CharMap  charmap )\n  {\n    FT_Service_TTCMaps  service;\n    FT_Face             face;\n    TT_CMapInfo         cmap_info;\n\n\n    if ( !charmap || !charmap->face )\n      return -1;\n\n    face = charmap->face;\n    FT_FACE_FIND_SERVICE( face, service, TT_CMAP );\n    if ( service == NULL )\n      return -1;\n    if ( service->get_cmap_info( charmap, &cmap_info ))\n      return -1;\n\n    return cmap_info.format;\n  }\n\n\n  /* documentation is in ftsizes.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Activate_Size( FT_Size  size )\n  {\n    FT_Face  face;\n\n\n    if ( !size )\n      return FT_THROW( Invalid_Size_Handle );\n\n    face = size->face;\n    if ( !face || !face->driver )\n      return FT_THROW( Invalid_Face_Handle );\n\n    /* we don't need anything more complex than that; all size objects */\n    /* are already listed by the face                                  */\n    face->size = size;\n\n    return FT_Err_Ok;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                        R E N D E R E R S                        ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* lookup a renderer by glyph format in the library's list */\n  FT_BASE_DEF( FT_Renderer )\n  FT_Lookup_Renderer( FT_Library       library,\n                      FT_Glyph_Format  format,\n                      FT_ListNode*     node )\n  {\n    FT_ListNode  cur;\n    FT_Renderer  result = 0;\n\n\n    if ( !library )\n      goto Exit;\n\n    cur = library->renderers.head;\n\n    if ( node )\n    {\n      if ( *node )\n        cur = (*node)->next;\n      *node = 0;\n    }\n\n    while ( cur )\n    {\n      FT_Renderer  renderer = FT_RENDERER( cur->data );\n\n\n      if ( renderer->glyph_format == format )\n      {\n        if ( node )\n          *node = cur;\n\n        result = renderer;\n        break;\n      }\n      cur = cur->next;\n    }\n\n  Exit:\n    return result;\n  }\n\n\n  static FT_Renderer\n  ft_lookup_glyph_renderer( FT_GlyphSlot  slot )\n  {\n    FT_Face      face    = slot->face;\n    FT_Library   library = FT_FACE_LIBRARY( face );\n    FT_Renderer  result  = library->cur_renderer;\n\n\n    if ( !result || result->glyph_format != slot->format )\n      result = FT_Lookup_Renderer( library, slot->format, 0 );\n\n    return result;\n  }\n\n\n  static void\n  ft_set_current_renderer( FT_Library  library )\n  {\n    FT_Renderer  renderer;\n\n\n    renderer = FT_Lookup_Renderer( library, FT_GLYPH_FORMAT_OUTLINE, 0 );\n    library->cur_renderer = renderer;\n  }\n\n\n  static FT_Error\n  ft_add_renderer( FT_Module  module )\n  {\n    FT_Library   library = module->library;\n    FT_Memory    memory  = library->memory;\n    FT_Error     error;\n    FT_ListNode  node    = NULL;\n\n\n    if ( FT_NEW( node ) )\n      goto Exit;\n\n    {\n      FT_Renderer         render = FT_RENDERER( module );\n      FT_Renderer_Class*  clazz  = (FT_Renderer_Class*)module->clazz;\n\n\n      render->clazz        = clazz;\n      render->glyph_format = clazz->glyph_format;\n\n      /* allocate raster object if needed */\n      if ( clazz->glyph_format == FT_GLYPH_FORMAT_OUTLINE &&\n           clazz->raster_class->raster_new                )\n      {\n        error = clazz->raster_class->raster_new( memory, &render->raster );\n        if ( error )\n          goto Fail;\n\n        render->raster_render = clazz->raster_class->raster_render;\n        render->render        = clazz->render_glyph;\n      }\n\n      /* add to list */\n      node->data = module;\n      FT_List_Add( &library->renderers, node );\n\n      ft_set_current_renderer( library );\n    }\n\n  Fail:\n    if ( error )\n      FT_FREE( node );\n\n  Exit:\n    return error;\n  }\n\n\n  static void\n  ft_remove_renderer( FT_Module  module )\n  {\n    FT_Library   library;\n    FT_Memory    memory;\n    FT_ListNode  node;\n\n\n    library = module->library;\n    if ( !library )\n      return;\n\n    memory = library->memory;\n\n    node = FT_List_Find( &library->renderers, module );\n    if ( node )\n    {\n      FT_Renderer  render = FT_RENDERER( module );\n\n\n      /* release raster object, if any */\n      if ( render->clazz->glyph_format == FT_GLYPH_FORMAT_OUTLINE &&\n           render->raster                                         )\n        render->clazz->raster_class->raster_done( render->raster );\n\n      /* remove from list */\n      FT_List_Remove( &library->renderers, node );\n      FT_FREE( node );\n\n      ft_set_current_renderer( library );\n    }\n  }\n\n\n  /* documentation is in ftrender.h */\n\n  FT_EXPORT_DEF( FT_Renderer )\n  FT_Get_Renderer( FT_Library       library,\n                   FT_Glyph_Format  format )\n  {\n    /* test for valid `library' delayed to `FT_Lookup_Renderer' */\n\n    return FT_Lookup_Renderer( library, format, 0 );\n  }\n\n\n  /* documentation is in ftrender.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Set_Renderer( FT_Library     library,\n                   FT_Renderer    renderer,\n                   FT_UInt        num_params,\n                   FT_Parameter*  parameters )\n  {\n    FT_ListNode  node;\n    FT_Error     error = FT_Err_Ok;\n\n    FT_Renderer_SetModeFunc  set_mode;\n\n\n    if ( !library )\n    {\n      error = FT_THROW( Invalid_Library_Handle );\n      goto Exit;\n    }\n\n    if ( !renderer )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    if ( num_params > 0 && !parameters )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    node = FT_List_Find( &library->renderers, renderer );\n    if ( !node )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    FT_List_Up( &library->renderers, node );\n\n    if ( renderer->glyph_format == FT_GLYPH_FORMAT_OUTLINE )\n      library->cur_renderer = renderer;\n\n    set_mode = renderer->clazz->set_mode;\n\n    for ( ; num_params > 0; num_params-- )\n    {\n      error = set_mode( renderer, parameters->tag, parameters->data );\n      if ( error )\n        break;\n      parameters++;\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  FT_BASE_DEF( FT_Error )\n  FT_Render_Glyph_Internal( FT_Library      library,\n                            FT_GlyphSlot    slot,\n                            FT_Render_Mode  render_mode )\n  {\n    FT_Error     error = FT_Err_Ok;\n    FT_Renderer  renderer;\n\n\n    /* if it is already a bitmap, no need to do anything */\n    switch ( slot->format )\n    {\n    case FT_GLYPH_FORMAT_BITMAP:   /* already a bitmap, don't do anything */\n      break;\n\n    default:\n      {\n        FT_ListNode  node   = 0;\n        FT_Bool      update = 0;\n\n\n        /* small shortcut for the very common case */\n        if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )\n        {\n          renderer = library->cur_renderer;\n          node     = library->renderers.head;\n        }\n        else\n          renderer = FT_Lookup_Renderer( library, slot->format, &node );\n\n        error = FT_ERR( Unimplemented_Feature );\n        while ( renderer )\n        {\n          error = renderer->render( renderer, slot, render_mode, NULL );\n          if ( !error                                   ||\n               FT_ERR_NEQ( error, Cannot_Render_Glyph ) )\n            break;\n\n          /* FT_Err_Cannot_Render_Glyph is returned if the render mode   */\n          /* is unsupported by the current renderer for this glyph image */\n          /* format.                                                     */\n\n          /* now, look for another renderer that supports the same */\n          /* format.                                               */\n          renderer = FT_Lookup_Renderer( library, slot->format, &node );\n          update   = 1;\n        }\n\n        /* if we changed the current renderer for the glyph image format */\n        /* we need to select it as the next current one                  */\n        if ( !error && update && renderer )\n        {\n          error = FT_Set_Renderer( library, renderer, 0, 0 );\n          if ( error )\n            break;\n        }\n      }\n    }\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_bitmap\n\n    /* we convert to a single bitmap format for computing the checksum */\n    if ( !error )\n    {\n      FT_Bitmap  bitmap;\n      FT_Error   err;\n\n\n      FT_Bitmap_New( &bitmap );\n\n      /* this also converts the bitmap flow to `down' (i.e., pitch > 0) */\n      err = FT_Bitmap_Convert( library, &slot->bitmap, &bitmap, 1 );\n      if ( !err )\n      {\n        MD5_CTX        ctx;\n        unsigned char  md5[16];\n        int            i;\n\n\n        MD5_Init( &ctx);\n        MD5_Update( &ctx, bitmap.buffer, bitmap.rows * bitmap.pitch );\n        MD5_Final( md5, &ctx );\n\n        FT_TRACE3(( \"MD5 checksum for %dx%d bitmap:\\n\"\n                    \"  \",\n                    bitmap.rows, bitmap.pitch ));\n        for ( i = 0; i < 16; i++ )\n          FT_TRACE3(( \"%02X\", md5[i] ));\n        FT_TRACE3(( \"\\n\" ));\n      }\n\n      FT_Bitmap_Done( library, &bitmap );\n    }\n\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_objs\n\n#endif /* FT_DEBUG_LEVEL_TRACE */\n\n    return error;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Render_Glyph( FT_GlyphSlot    slot,\n                   FT_Render_Mode  render_mode )\n  {\n    FT_Library  library;\n\n\n    if ( !slot || !slot->face )\n      return FT_THROW( Invalid_Argument );\n\n    library = FT_FACE_LIBRARY( slot->face );\n\n    return FT_Render_Glyph_Internal( library, slot, render_mode );\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                         M O D U L E S                           ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Destroy_Module                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroys a given module object.  For drivers, this also destroys   */\n  /*    all child faces.                                                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    module :: A handle to the target driver object.                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The driver _must_ be LOCKED!                                       */\n  /*                                                                       */\n  static void\n  Destroy_Module( FT_Module  module )\n  {\n    FT_Memory         memory  = module->memory;\n    FT_Module_Class*  clazz   = module->clazz;\n    FT_Library        library = module->library;\n\n\n    if ( library && library->auto_hinter == module )\n      library->auto_hinter = 0;\n\n    /* if the module is a renderer */\n    if ( FT_MODULE_IS_RENDERER( module ) )\n      ft_remove_renderer( module );\n\n    /* if the module is a font driver, add some steps */\n    if ( FT_MODULE_IS_DRIVER( module ) )\n      Destroy_Driver( FT_DRIVER( module ) );\n\n    /* finalize the module object */\n    if ( clazz->module_done )\n      clazz->module_done( module );\n\n    /* discard it */\n    FT_FREE( module );\n  }\n\n\n  /* documentation is in ftmodapi.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Add_Module( FT_Library              library,\n                 const FT_Module_Class*  clazz )\n  {\n    FT_Error   error;\n    FT_Memory  memory;\n    FT_Module  module;\n    FT_UInt    nn;\n\n\n#define FREETYPE_VER_FIXED  ( ( (FT_Long)FREETYPE_MAJOR << 16 ) | \\\n                                FREETYPE_MINOR                  )\n\n    if ( !library )\n      return FT_THROW( Invalid_Library_Handle );\n\n    if ( !clazz )\n      return FT_THROW( Invalid_Argument );\n\n    /* check freetype version */\n    if ( clazz->module_requires > FREETYPE_VER_FIXED )\n      return FT_THROW( Invalid_Version );\n\n    /* look for a module with the same name in the library's table */\n    for ( nn = 0; nn < library->num_modules; nn++ )\n    {\n      module = library->modules[nn];\n      if ( ft_strcmp( module->clazz->module_name, clazz->module_name ) == 0 )\n      {\n        /* this installed module has the same name, compare their versions */\n        if ( clazz->module_version <= module->clazz->module_version )\n          return FT_THROW( Lower_Module_Version );\n\n        /* remove the module from our list, then exit the loop to replace */\n        /* it by our new version..                                        */\n        FT_Remove_Module( library, module );\n        break;\n      }\n    }\n\n    memory = library->memory;\n    error  = FT_Err_Ok;\n\n    if ( library->num_modules >= FT_MAX_MODULES )\n    {\n      error = FT_THROW( Too_Many_Drivers );\n      goto Exit;\n    }\n\n    /* allocate module object */\n    if ( FT_ALLOC( module, clazz->module_size ) )\n      goto Exit;\n\n    /* base initialization */\n    module->library = library;\n    module->memory  = memory;\n    module->clazz   = (FT_Module_Class*)clazz;\n\n    /* check whether the module is a renderer - this must be performed */\n    /* before the normal module initialization                         */\n    if ( FT_MODULE_IS_RENDERER( module ) )\n    {\n      /* add to the renderers list */\n      error = ft_add_renderer( module );\n      if ( error )\n        goto Fail;\n    }\n\n    /* is the module a auto-hinter? */\n    if ( FT_MODULE_IS_HINTER( module ) )\n      library->auto_hinter = module;\n\n    /* if the module is a font driver */\n    if ( FT_MODULE_IS_DRIVER( module ) )\n    {\n      /* allocate glyph loader if needed */\n      FT_Driver  driver = FT_DRIVER( module );\n\n\n      driver->clazz = (FT_Driver_Class)module->clazz;\n      if ( FT_DRIVER_USES_OUTLINES( driver ) )\n      {\n        error = FT_GlyphLoader_New( memory, &driver->glyph_loader );\n        if ( error )\n          goto Fail;\n      }\n    }\n\n    if ( clazz->module_init )\n    {\n      error = clazz->module_init( module );\n      if ( error )\n        goto Fail;\n    }\n\n    /* add module to the library's table */\n    library->modules[library->num_modules++] = module;\n\n  Exit:\n    return error;\n\n  Fail:\n    if ( FT_MODULE_IS_DRIVER( module ) )\n    {\n      FT_Driver  driver = FT_DRIVER( module );\n\n\n      if ( FT_DRIVER_USES_OUTLINES( driver ) )\n        FT_GlyphLoader_Done( driver->glyph_loader );\n    }\n\n    if ( FT_MODULE_IS_RENDERER( module ) )\n    {\n      FT_Renderer  renderer = FT_RENDERER( module );\n\n\n      if ( renderer->clazz                                          &&\n           renderer->clazz->glyph_format == FT_GLYPH_FORMAT_OUTLINE &&\n           renderer->raster                                         )\n        renderer->clazz->raster_class->raster_done( renderer->raster );\n    }\n\n    FT_FREE( module );\n    goto Exit;\n  }\n\n\n  /* documentation is in ftmodapi.h */\n\n  FT_EXPORT_DEF( FT_Module )\n  FT_Get_Module( FT_Library   library,\n                 const char*  module_name )\n  {\n    FT_Module   result = NULL;\n    FT_Module*  cur;\n    FT_Module*  limit;\n\n\n    if ( !library || !module_name )\n      return result;\n\n    cur   = library->modules;\n    limit = cur + library->num_modules;\n\n    for ( ; cur < limit; cur++ )\n      if ( ft_strcmp( cur[0]->clazz->module_name, module_name ) == 0 )\n      {\n        result = cur[0];\n        break;\n      }\n\n    return result;\n  }\n\n\n  /* documentation is in ftobjs.h */\n\n  FT_BASE_DEF( const void* )\n  FT_Get_Module_Interface( FT_Library   library,\n                           const char*  mod_name )\n  {\n    FT_Module  module;\n\n\n    /* test for valid `library' delayed to FT_Get_Module() */\n\n    module = FT_Get_Module( library, mod_name );\n\n    return module ? module->clazz->module_interface : 0;\n  }\n\n\n  FT_BASE_DEF( FT_Pointer )\n  ft_module_get_service( FT_Module    module,\n                         const char*  service_id )\n  {\n    FT_Pointer  result = NULL;\n\n\n    if ( module )\n    {\n      FT_ASSERT( module->clazz && module->clazz->get_interface );\n\n      /* first, look for the service in the module */\n      if ( module->clazz->get_interface )\n        result = module->clazz->get_interface( module, service_id );\n\n      if ( result == NULL )\n      {\n        /* we didn't find it, look in all other modules then */\n        FT_Library  library = module->library;\n        FT_Module*  cur     = library->modules;\n        FT_Module*  limit   = cur + library->num_modules;\n\n\n        for ( ; cur < limit; cur++ )\n        {\n          if ( cur[0] != module )\n          {\n            FT_ASSERT( cur[0]->clazz );\n\n            if ( cur[0]->clazz->get_interface )\n            {\n              result = cur[0]->clazz->get_interface( cur[0], service_id );\n              if ( result != NULL )\n                break;\n            }\n          }\n        }\n      }\n    }\n\n    return result;\n  }\n\n\n  /* documentation is in ftmodapi.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Remove_Module( FT_Library  library,\n                    FT_Module   module )\n  {\n    /* try to find the module from the table, then remove it from there */\n\n    if ( !library )\n      return FT_THROW( Invalid_Library_Handle );\n\n    if ( module )\n    {\n      FT_Module*  cur   = library->modules;\n      FT_Module*  limit = cur + library->num_modules;\n\n\n      for ( ; cur < limit; cur++ )\n      {\n        if ( cur[0] == module )\n        {\n          /* remove it from the table */\n          library->num_modules--;\n          limit--;\n          while ( cur < limit )\n          {\n            cur[0] = cur[1];\n            cur++;\n          }\n          limit[0] = 0;\n\n          /* destroy the module */\n          Destroy_Module( module );\n\n          return FT_Err_Ok;\n        }\n      }\n    }\n    return FT_THROW( Invalid_Driver_Handle );\n  }\n\n\n  static FT_Error\n  ft_property_do( FT_Library        library,\n                  const FT_String*  module_name,\n                  const FT_String*  property_name,\n                  void*             value,\n                  FT_Bool           set )\n  {\n    FT_Module*           cur;\n    FT_Module*           limit;\n    FT_Module_Interface  interface;\n\n    FT_Service_Properties  service;\n\n#ifdef FT_DEBUG_LEVEL_ERROR\n    const FT_String*  set_name  = \"FT_Property_Set\";\n    const FT_String*  get_name  = \"FT_Property_Get\";\n    const FT_String*  func_name = set ? set_name : get_name;\n#endif\n\n    FT_Bool  missing_func;\n\n\n    if ( !library )\n      return FT_THROW( Invalid_Library_Handle );\n\n    if ( !module_name || !property_name || !value )\n      return FT_THROW( Invalid_Argument );\n\n    cur   = library->modules;\n    limit = cur + library->num_modules;\n\n    /* search module */\n    for ( ; cur < limit; cur++ )\n      if ( !ft_strcmp( cur[0]->clazz->module_name, module_name ) )\n        break;\n\n    if ( cur == limit )\n    {\n      FT_ERROR(( \"%s: can't find module `%s'\\n\",\n                 func_name, module_name ));\n      return FT_THROW( Missing_Module );\n    }\n\n    /* check whether we have a service interface */\n    if ( !cur[0]->clazz->get_interface )\n    {\n      FT_ERROR(( \"%s: module `%s' doesn't support properties\\n\",\n                 func_name, module_name ));\n      return FT_THROW( Unimplemented_Feature );\n    }\n\n    /* search property service */\n    interface = cur[0]->clazz->get_interface( cur[0],\n                                              FT_SERVICE_ID_PROPERTIES );\n    if ( !interface )\n    {\n      FT_ERROR(( \"%s: module `%s' doesn't support properties\\n\",\n                 func_name, module_name ));\n      return FT_THROW( Unimplemented_Feature );\n    }\n\n    service = (FT_Service_Properties)interface;\n\n    if ( set )\n      missing_func = (FT_Bool)( !service->set_property );\n    else\n      missing_func = (FT_Bool)( !service->get_property );\n\n    if ( missing_func )\n    {\n      FT_ERROR(( \"%s: property service of module `%s' is broken\\n\",\n                 func_name, module_name ));\n      return FT_THROW( Unimplemented_Feature );\n    }\n\n    return set ? service->set_property( cur[0], property_name, value )\n               : service->get_property( cur[0], property_name, value );\n  }\n\n\n  /* documentation is in ftmodapi.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Property_Set( FT_Library        library,\n                   const FT_String*  module_name,\n                   const FT_String*  property_name,\n                   const void*       value )\n  {\n    return ft_property_do( library,\n                           module_name,\n                           property_name,\n                           (void*)value,\n                           TRUE );\n  }\n\n\n  /* documentation is in ftmodapi.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Property_Get( FT_Library        library,\n                   const FT_String*  module_name,\n                   const FT_String*  property_name,\n                   void*             value )\n  {\n    return ft_property_do( library,\n                           module_name,\n                           property_name,\n                           value,\n                           FALSE );\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                         L I B R A R Y                           ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* documentation is in ftmodapi.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Reference_Library( FT_Library  library )\n  {\n    if ( !library )\n      return FT_THROW( Invalid_Library_Handle );\n\n    library->refcount++;\n\n    return FT_Err_Ok;\n  }\n\n\n  /* documentation is in ftmodapi.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_New_Library( FT_Memory    memory,\n                  FT_Library  *alibrary )\n  {\n    FT_Library  library = NULL;\n    FT_Error    error;\n\n\n    if ( !memory || !alibrary )\n      return FT_THROW( Invalid_Argument );\n\n#ifdef FT_DEBUG_LEVEL_ERROR\n    /* init debugging support */\n    ft_debug_init();\n#endif\n\n    /* first of all, allocate the library object */\n    if ( FT_NEW( library ) )\n      return error;\n\n    library->memory = memory;\n\n#ifdef FT_CONFIG_OPTION_PIC\n    /* initialize position independent code containers */\n    error = ft_pic_container_init( library );\n    if ( error )\n      goto Fail;\n#endif\n\n    /* allocate the render pool */\n    library->raster_pool_size = FT_RENDER_POOL_SIZE;\n#if FT_RENDER_POOL_SIZE > 0\n    if ( FT_ALLOC( library->raster_pool, FT_RENDER_POOL_SIZE ) )\n      goto Fail;\n#endif\n\n    library->version_major = FREETYPE_MAJOR;\n    library->version_minor = FREETYPE_MINOR;\n    library->version_patch = FREETYPE_PATCH;\n\n    library->refcount = 1;\n\n    /* That's ok now */\n    *alibrary = library;\n\n    return FT_Err_Ok;\n\n  Fail:\n#ifdef FT_CONFIG_OPTION_PIC\n    ft_pic_container_destroy( library );\n#endif\n    FT_FREE( library );\n    return error;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( void )\n  FT_Library_Version( FT_Library   library,\n                      FT_Int      *amajor,\n                      FT_Int      *aminor,\n                      FT_Int      *apatch )\n  {\n    FT_Int  major = 0;\n    FT_Int  minor = 0;\n    FT_Int  patch = 0;\n\n\n    if ( library )\n    {\n      major = library->version_major;\n      minor = library->version_minor;\n      patch = library->version_patch;\n    }\n\n    if ( amajor )\n      *amajor = major;\n\n    if ( aminor )\n      *aminor = minor;\n\n    if ( apatch )\n      *apatch = patch;\n  }\n\n\n  /* documentation is in ftmodapi.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Done_Library( FT_Library  library )\n  {\n    FT_Memory  memory;\n\n\n    if ( !library )\n      return FT_THROW( Invalid_Library_Handle );\n\n    library->refcount--;\n    if ( library->refcount > 0 )\n      goto Exit;\n\n    memory = library->memory;\n\n    /*\n     * Close all faces in the library.  If we don't do this, we can have\n     * some subtle memory leaks.\n     *\n     * Example:\n     *\n     *  - the cff font driver uses the pshinter module in cff_size_done\n     *  - if the pshinter module is destroyed before the cff font driver,\n     *    opened FT_Face objects managed by the driver are not properly\n     *    destroyed, resulting in a memory leak\n     *\n     * Some faces are dependent on other faces, like Type42 faces that\n     * depend on TrueType faces synthesized internally.\n     *\n     * The order of drivers should be specified in driver_name[].\n     */\n    {\n      FT_UInt      m, n;\n      const char*  driver_name[] = { \"type42\", NULL };\n\n\n      for ( m = 0;\n            m < sizeof ( driver_name ) / sizeof ( driver_name[0] );\n            m++ )\n      {\n        for ( n = 0; n < library->num_modules; n++ )\n        {\n          FT_Module    module      = library->modules[n];\n          const char*  module_name = module->clazz->module_name;\n          FT_List      faces;\n\n\n          if ( driver_name[m]                                &&\n               ft_strcmp( module_name, driver_name[m] ) != 0 )\n            continue;\n\n          if ( ( module->clazz->module_flags & FT_MODULE_FONT_DRIVER ) == 0 )\n            continue;\n\n          FT_TRACE7(( \"FT_Done_Library: close faces for %s\\n\", module_name ));\n\n          faces = &FT_DRIVER( module )->faces_list;\n          while ( faces->head )\n          {\n            FT_Done_Face( FT_FACE( faces->head->data ) );\n            if ( faces->head )\n              FT_TRACE0(( \"FT_Done_Library: failed to free some faces\\n\" ));\n          }\n        }\n      }\n    }\n\n    /* Close all other modules in the library */\n#if 1\n    /* XXX Modules are removed in the reversed order so that  */\n    /* type42 module is removed before truetype module.  This */\n    /* avoids double free in some occasions.  It is a hack.   */\n    while ( library->num_modules > 0 )\n      FT_Remove_Module( library,\n                        library->modules[library->num_modules - 1] );\n#else\n    {\n      FT_UInt  n;\n\n\n      for ( n = 0; n < library->num_modules; n++ )\n      {\n        FT_Module  module = library->modules[n];\n\n\n        if ( module )\n        {\n          Destroy_Module( module );\n          library->modules[n] = 0;\n        }\n      }\n    }\n#endif\n\n    /* Destroy raster objects */\n    FT_FREE( library->raster_pool );\n    library->raster_pool_size = 0;\n\n#ifdef FT_CONFIG_OPTION_PIC\n    /* Destroy pic container contents */\n    ft_pic_container_destroy( library );\n#endif\n\n    FT_FREE( library );\n\n  Exit:\n    return FT_Err_Ok;\n  }\n\n\n  /* documentation is in ftmodapi.h */\n\n  FT_EXPORT_DEF( void )\n  FT_Set_Debug_Hook( FT_Library         library,\n                     FT_UInt            hook_index,\n                     FT_DebugHook_Func  debug_hook )\n  {\n    if ( library && debug_hook &&\n         hook_index <\n           ( sizeof ( library->debug_hooks ) / sizeof ( void* ) ) )\n      library->debug_hooks[hook_index] = debug_hook;\n  }\n\n\n  /* documentation is in ftmodapi.h */\n\n  FT_EXPORT_DEF( FT_TrueTypeEngineType )\n  FT_Get_TrueType_Engine_Type( FT_Library  library )\n  {\n    FT_TrueTypeEngineType  result = FT_TRUETYPE_ENGINE_TYPE_NONE;\n\n\n    if ( library )\n    {\n      FT_Module  module = FT_Get_Module( library, \"truetype\" );\n\n\n      if ( module )\n      {\n        FT_Service_TrueTypeEngine  service;\n\n\n        service = (FT_Service_TrueTypeEngine)\n                    ft_module_get_service( module,\n                                           FT_SERVICE_ID_TRUETYPE_ENGINE );\n        if ( service )\n          result = service->engine_type;\n      }\n    }\n\n    return result;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Get_SubGlyph_Info( FT_GlyphSlot  glyph,\n                        FT_UInt       sub_index,\n                        FT_Int       *p_index,\n                        FT_UInt      *p_flags,\n                        FT_Int       *p_arg1,\n                        FT_Int       *p_arg2,\n                        FT_Matrix    *p_transform )\n  {\n    FT_Error  error = FT_ERR( Invalid_Argument );\n\n\n    if ( glyph                                      &&\n         glyph->subglyphs                           &&\n         glyph->format == FT_GLYPH_FORMAT_COMPOSITE &&\n         sub_index < glyph->num_subglyphs           )\n    {\n      FT_SubGlyph  subg = glyph->subglyphs + sub_index;\n\n\n      *p_index     = subg->index;\n      *p_flags     = subg->flags;\n      *p_arg1      = subg->arg1;\n      *p_arg2      = subg->arg2;\n      *p_transform = subg->transform;\n\n      error = FT_Err_Ok;\n    }\n\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftotval.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftotval.c                                                              */\n/*                                                                         */\n/*    FreeType API for validating OpenType tables (body).                  */\n/*                                                                         */\n/*  Copyright 2004, 2006, 2008, 2010, 2013 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n\n#include FT_INTERNAL_OBJECTS_H\n#include FT_SERVICE_OPENTYPE_VALIDATE_H\n#include FT_OPENTYPE_VALIDATE_H\n\n\n  /* documentation is in ftotval.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_OpenType_Validate( FT_Face    face,\n                        FT_UInt    validation_flags,\n                        FT_Bytes  *BASE_table,\n                        FT_Bytes  *GDEF_table,\n                        FT_Bytes  *GPOS_table,\n                        FT_Bytes  *GSUB_table,\n                        FT_Bytes  *JSTF_table )\n  {\n    FT_Service_OTvalidate  service;\n    FT_Error               error;\n\n\n    if ( !face )\n    {\n      error = FT_THROW( Invalid_Face_Handle );\n      goto Exit;\n    }\n\n    if ( !( BASE_table &&\n            GDEF_table &&\n            GPOS_table &&\n            GSUB_table &&\n            JSTF_table ) )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    FT_FACE_FIND_GLOBAL_SERVICE( face, service, OPENTYPE_VALIDATE );\n\n    if ( service )\n      error = service->validate( face,\n                                 validation_flags,\n                                 BASE_table,\n                                 GDEF_table,\n                                 GPOS_table,\n                                 GSUB_table,\n                                 JSTF_table );\n    else\n      error = FT_THROW( Unimplemented_Feature );\n\n  Exit:\n    return error;\n  }\n\n\n  FT_EXPORT_DEF( void )\n  FT_OpenType_Free( FT_Face   face,\n                    FT_Bytes  table )\n  {\n    FT_Memory  memory;\n\n\n    if ( !face )\n      return;\n\n    memory = FT_FACE_MEMORY( face );\n\n    FT_FREE( table );\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftoutln.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftoutln.c                                                              */\n/*                                                                         */\n/*    FreeType outline management (body).                                  */\n/*                                                                         */\n/*  Copyright 1996-2008, 2010, 2012-2014 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* All functions are declared in freetype.h.                             */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_OUTLINE_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_CALC_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_TRIGONOMETRY_H\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_outline\n\n\n  static\n  const FT_Outline  null_outline = { 0, 0, 0, 0, 0, 0 };\n\n\n  /* documentation is in ftoutln.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Outline_Decompose( FT_Outline*              outline,\n                        const FT_Outline_Funcs*  func_interface,\n                        void*                    user )\n  {\n#undef SCALED\n#define SCALED( x )  ( ( (x) << shift ) - delta )\n\n    FT_Vector   v_last;\n    FT_Vector   v_control;\n    FT_Vector   v_start;\n\n    FT_Vector*  point;\n    FT_Vector*  limit;\n    char*       tags;\n\n    FT_Error    error;\n\n    FT_Int   n;         /* index of contour in outline     */\n    FT_UInt  first;     /* index of first point in contour */\n    FT_Int   tag;       /* current point's state           */\n\n    FT_Int   shift;\n    FT_Pos   delta;\n\n\n    if ( !outline )\n      return FT_THROW( Invalid_Outline );\n\n    if ( !func_interface )\n      return FT_THROW( Invalid_Argument );\n\n    shift = func_interface->shift;\n    delta = func_interface->delta;\n    first = 0;\n\n    for ( n = 0; n < outline->n_contours; n++ )\n    {\n      FT_Int  last;  /* index of last point in contour */\n\n\n      FT_TRACE5(( \"FT_Outline_Decompose: Outline %d\\n\", n ));\n\n      last = outline->contours[n];\n      if ( last < 0 )\n        goto Invalid_Outline;\n      limit = outline->points + last;\n\n      v_start   = outline->points[first];\n      v_start.x = SCALED( v_start.x );\n      v_start.y = SCALED( v_start.y );\n\n      v_last   = outline->points[last];\n      v_last.x = SCALED( v_last.x );\n      v_last.y = SCALED( v_last.y );\n\n      v_control = v_start;\n\n      point = outline->points + first;\n      tags  = outline->tags   + first;\n      tag   = FT_CURVE_TAG( tags[0] );\n\n      /* A contour cannot start with a cubic control point! */\n      if ( tag == FT_CURVE_TAG_CUBIC )\n        goto Invalid_Outline;\n\n      /* check first point to determine origin */\n      if ( tag == FT_CURVE_TAG_CONIC )\n      {\n        /* first point is conic control.  Yes, this happens. */\n        if ( FT_CURVE_TAG( outline->tags[last] ) == FT_CURVE_TAG_ON )\n        {\n          /* start at last point if it is on the curve */\n          v_start = v_last;\n          limit--;\n        }\n        else\n        {\n          /* if both first and last points are conic,         */\n          /* start at their middle and record its position    */\n          /* for closure                                      */\n          v_start.x = ( v_start.x + v_last.x ) / 2;\n          v_start.y = ( v_start.y + v_last.y ) / 2;\n\n       /* v_last = v_start; */\n        }\n        point--;\n        tags--;\n      }\n\n      FT_TRACE5(( \"  move to (%.2f, %.2f)\\n\",\n                  v_start.x / 64.0, v_start.y / 64.0 ));\n      error = func_interface->move_to( &v_start, user );\n      if ( error )\n        goto Exit;\n\n      while ( point < limit )\n      {\n        point++;\n        tags++;\n\n        tag = FT_CURVE_TAG( tags[0] );\n        switch ( tag )\n        {\n        case FT_CURVE_TAG_ON:  /* emit a single line_to */\n          {\n            FT_Vector  vec;\n\n\n            vec.x = SCALED( point->x );\n            vec.y = SCALED( point->y );\n\n            FT_TRACE5(( \"  line to (%.2f, %.2f)\\n\",\n                        vec.x / 64.0, vec.y / 64.0 ));\n            error = func_interface->line_to( &vec, user );\n            if ( error )\n              goto Exit;\n            continue;\n          }\n\n        case FT_CURVE_TAG_CONIC:  /* consume conic arcs */\n          v_control.x = SCALED( point->x );\n          v_control.y = SCALED( point->y );\n\n        Do_Conic:\n          if ( point < limit )\n          {\n            FT_Vector  vec;\n            FT_Vector  v_middle;\n\n\n            point++;\n            tags++;\n            tag = FT_CURVE_TAG( tags[0] );\n\n            vec.x = SCALED( point->x );\n            vec.y = SCALED( point->y );\n\n            if ( tag == FT_CURVE_TAG_ON )\n            {\n              FT_TRACE5(( \"  conic to (%.2f, %.2f)\"\n                          \" with control (%.2f, %.2f)\\n\",\n                          vec.x / 64.0, vec.y / 64.0,\n                          v_control.x / 64.0, v_control.y / 64.0 ));\n              error = func_interface->conic_to( &v_control, &vec, user );\n              if ( error )\n                goto Exit;\n              continue;\n            }\n\n            if ( tag != FT_CURVE_TAG_CONIC )\n              goto Invalid_Outline;\n\n            v_middle.x = ( v_control.x + vec.x ) / 2;\n            v_middle.y = ( v_control.y + vec.y ) / 2;\n\n            FT_TRACE5(( \"  conic to (%.2f, %.2f)\"\n                        \" with control (%.2f, %.2f)\\n\",\n                        v_middle.x / 64.0, v_middle.y / 64.0,\n                        v_control.x / 64.0, v_control.y / 64.0 ));\n            error = func_interface->conic_to( &v_control, &v_middle, user );\n            if ( error )\n              goto Exit;\n\n            v_control = vec;\n            goto Do_Conic;\n          }\n\n          FT_TRACE5(( \"  conic to (%.2f, %.2f)\"\n                      \" with control (%.2f, %.2f)\\n\",\n                      v_start.x / 64.0, v_start.y / 64.0,\n                      v_control.x / 64.0, v_control.y / 64.0 ));\n          error = func_interface->conic_to( &v_control, &v_start, user );\n          goto Close;\n\n        default:  /* FT_CURVE_TAG_CUBIC */\n          {\n            FT_Vector  vec1, vec2;\n\n\n            if ( point + 1 > limit                             ||\n                 FT_CURVE_TAG( tags[1] ) != FT_CURVE_TAG_CUBIC )\n              goto Invalid_Outline;\n\n            point += 2;\n            tags  += 2;\n\n            vec1.x = SCALED( point[-2].x );\n            vec1.y = SCALED( point[-2].y );\n\n            vec2.x = SCALED( point[-1].x );\n            vec2.y = SCALED( point[-1].y );\n\n            if ( point <= limit )\n            {\n              FT_Vector  vec;\n\n\n              vec.x = SCALED( point->x );\n              vec.y = SCALED( point->y );\n\n              FT_TRACE5(( \"  cubic to (%.2f, %.2f)\"\n                          \" with controls (%.2f, %.2f) and (%.2f, %.2f)\\n\",\n                          vec.x / 64.0, vec.y / 64.0,\n                          vec1.x / 64.0, vec1.y / 64.0,\n                          vec2.x / 64.0, vec2.y / 64.0 ));\n              error = func_interface->cubic_to( &vec1, &vec2, &vec, user );\n              if ( error )\n                goto Exit;\n              continue;\n            }\n\n            FT_TRACE5(( \"  cubic to (%.2f, %.2f)\"\n                        \" with controls (%.2f, %.2f) and (%.2f, %.2f)\\n\",\n                        v_start.x / 64.0, v_start.y / 64.0,\n                        vec1.x / 64.0, vec1.y / 64.0,\n                        vec2.x / 64.0, vec2.y / 64.0 ));\n            error = func_interface->cubic_to( &vec1, &vec2, &v_start, user );\n            goto Close;\n          }\n        }\n      }\n\n      /* close the contour with a line segment */\n      FT_TRACE5(( \"  line to (%.2f, %.2f)\\n\",\n                  v_start.x / 64.0, v_start.y / 64.0 ));\n      error = func_interface->line_to( &v_start, user );\n\n    Close:\n      if ( error )\n        goto Exit;\n\n      first = last + 1;\n    }\n\n    FT_TRACE5(( \"FT_Outline_Decompose: Done\\n\", n ));\n    return FT_Err_Ok;\n\n  Exit:\n    FT_TRACE5(( \"FT_Outline_Decompose: Error %d\\n\", error ));\n    return error;\n\n  Invalid_Outline:\n    return FT_THROW( Invalid_Outline );\n  }\n\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Outline_New_Internal( FT_Memory    memory,\n                           FT_UInt      numPoints,\n                           FT_Int       numContours,\n                           FT_Outline  *anoutline )\n  {\n    FT_Error  error;\n\n\n    if ( !anoutline || !memory )\n      return FT_THROW( Invalid_Argument );\n\n    *anoutline = null_outline;\n\n    if ( numContours < 0                  ||\n         (FT_UInt)numContours > numPoints )\n      return FT_THROW( Invalid_Argument );\n\n    if ( numPoints > FT_OUTLINE_POINTS_MAX )\n      return FT_THROW( Array_Too_Large );\n\n    if ( FT_NEW_ARRAY( anoutline->points,   numPoints   ) ||\n         FT_NEW_ARRAY( anoutline->tags,     numPoints   ) ||\n         FT_NEW_ARRAY( anoutline->contours, numContours ) )\n      goto Fail;\n\n    anoutline->n_points    = (FT_UShort)numPoints;\n    anoutline->n_contours  = (FT_Short)numContours;\n    anoutline->flags      |= FT_OUTLINE_OWNER;\n\n    return FT_Err_Ok;\n\n  Fail:\n    anoutline->flags |= FT_OUTLINE_OWNER;\n    FT_Outline_Done_Internal( memory, anoutline );\n\n    return error;\n  }\n\n\n  /* documentation is in ftoutln.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Outline_New( FT_Library   library,\n                  FT_UInt      numPoints,\n                  FT_Int       numContours,\n                  FT_Outline  *anoutline )\n  {\n    if ( !library )\n      return FT_THROW( Invalid_Library_Handle );\n\n    return FT_Outline_New_Internal( library->memory, numPoints,\n                                    numContours, anoutline );\n  }\n\n\n  /* documentation is in ftoutln.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Outline_Check( FT_Outline*  outline )\n  {\n    if ( outline )\n    {\n      FT_Int  n_points   = outline->n_points;\n      FT_Int  n_contours = outline->n_contours;\n      FT_Int  end0, end;\n      FT_Int  n;\n\n\n      /* empty glyph? */\n      if ( n_points == 0 && n_contours == 0 )\n        return FT_Err_Ok;\n\n      /* check point and contour counts */\n      if ( n_points <= 0 || n_contours <= 0 )\n        goto Bad;\n\n      end0 = end = -1;\n      for ( n = 0; n < n_contours; n++ )\n      {\n        end = outline->contours[n];\n\n        /* note that we don't accept empty contours */\n        if ( end <= end0 || end >= n_points )\n          goto Bad;\n\n        end0 = end;\n      }\n\n      if ( end != n_points - 1 )\n        goto Bad;\n\n      /* XXX: check the tags array */\n      return FT_Err_Ok;\n    }\n\n  Bad:\n    return FT_THROW( Invalid_Argument );\n  }\n\n\n  /* documentation is in ftoutln.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Outline_Copy( const FT_Outline*  source,\n                   FT_Outline        *target )\n  {\n    FT_Int  is_owner;\n\n\n    if ( !source || !target )\n      return FT_THROW( Invalid_Outline );\n\n    if ( source->n_points   != target->n_points   ||\n         source->n_contours != target->n_contours )\n      return FT_THROW( Invalid_Argument );\n\n    if ( source == target )\n      return FT_Err_Ok;\n\n    FT_ARRAY_COPY( target->points, source->points, source->n_points );\n\n    FT_ARRAY_COPY( target->tags, source->tags, source->n_points );\n\n    FT_ARRAY_COPY( target->contours, source->contours, source->n_contours );\n\n    /* copy all flags, except the `FT_OUTLINE_OWNER' one */\n    is_owner      = target->flags & FT_OUTLINE_OWNER;\n    target->flags = source->flags;\n\n    target->flags &= ~FT_OUTLINE_OWNER;\n    target->flags |= is_owner;\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Outline_Done_Internal( FT_Memory    memory,\n                            FT_Outline*  outline )\n  {\n    if ( !outline )\n      return FT_THROW( Invalid_Outline );\n\n    if ( !memory )\n      return FT_THROW( Invalid_Argument );\n\n    if ( outline->flags & FT_OUTLINE_OWNER )\n    {\n      FT_FREE( outline->points   );\n      FT_FREE( outline->tags     );\n      FT_FREE( outline->contours );\n    }\n    *outline = null_outline;\n\n    return FT_Err_Ok;\n  }\n\n\n  /* documentation is in ftoutln.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Outline_Done( FT_Library   library,\n                   FT_Outline*  outline )\n  {\n    /* check for valid `outline' in FT_Outline_Done_Internal() */\n\n    if ( !library )\n      return FT_THROW( Invalid_Library_Handle );\n\n    return FT_Outline_Done_Internal( library->memory, outline );\n  }\n\n\n  /* documentation is in ftoutln.h */\n\n  FT_EXPORT_DEF( void )\n  FT_Outline_Get_CBox( const FT_Outline*  outline,\n                       FT_BBox           *acbox )\n  {\n    FT_Pos  xMin, yMin, xMax, yMax;\n\n\n    if ( outline && acbox )\n    {\n      if ( outline->n_points == 0 )\n      {\n        xMin = 0;\n        yMin = 0;\n        xMax = 0;\n        yMax = 0;\n      }\n      else\n      {\n        FT_Vector*  vec   = outline->points;\n        FT_Vector*  limit = vec + outline->n_points;\n\n\n        xMin = xMax = vec->x;\n        yMin = yMax = vec->y;\n        vec++;\n\n        for ( ; vec < limit; vec++ )\n        {\n          FT_Pos  x, y;\n\n\n          x = vec->x;\n          if ( x < xMin ) xMin = x;\n          if ( x > xMax ) xMax = x;\n\n          y = vec->y;\n          if ( y < yMin ) yMin = y;\n          if ( y > yMax ) yMax = y;\n        }\n      }\n      acbox->xMin = xMin;\n      acbox->xMax = xMax;\n      acbox->yMin = yMin;\n      acbox->yMax = yMax;\n    }\n  }\n\n\n  /* documentation is in ftoutln.h */\n\n  FT_EXPORT_DEF( void )\n  FT_Outline_Translate( const FT_Outline*  outline,\n                        FT_Pos             xOffset,\n                        FT_Pos             yOffset )\n  {\n    FT_UShort   n;\n    FT_Vector*  vec;\n\n\n    if ( !outline )\n      return;\n\n    vec = outline->points;\n\n    for ( n = 0; n < outline->n_points; n++ )\n    {\n      vec->x += xOffset;\n      vec->y += yOffset;\n      vec++;\n    }\n  }\n\n\n  /* documentation is in ftoutln.h */\n\n  FT_EXPORT_DEF( void )\n  FT_Outline_Reverse( FT_Outline*  outline )\n  {\n    FT_UShort  n;\n    FT_Int     first, last;\n\n\n    if ( !outline )\n      return;\n\n    first = 0;\n\n    for ( n = 0; n < outline->n_contours; n++ )\n    {\n      last  = outline->contours[n];\n\n      /* reverse point table */\n      {\n        FT_Vector*  p = outline->points + first;\n        FT_Vector*  q = outline->points + last;\n        FT_Vector   swap;\n\n\n        while ( p < q )\n        {\n          swap = *p;\n          *p   = *q;\n          *q   = swap;\n          p++;\n          q--;\n        }\n      }\n\n      /* reverse tags table */\n      {\n        char*  p = outline->tags + first;\n        char*  q = outline->tags + last;\n\n\n        while ( p < q )\n        {\n          char  swap;\n\n\n          swap = *p;\n          *p   = *q;\n          *q   = swap;\n          p++;\n          q--;\n        }\n      }\n\n      first = last + 1;\n    }\n\n    outline->flags ^= FT_OUTLINE_REVERSE_FILL;\n  }\n\n\n  /* documentation is in ftoutln.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Outline_Render( FT_Library         library,\n                     FT_Outline*        outline,\n                     FT_Raster_Params*  params )\n  {\n    FT_Error     error;\n    FT_Bool      update = FALSE;\n    FT_Renderer  renderer;\n    FT_ListNode  node;\n\n\n    if ( !library )\n      return FT_THROW( Invalid_Library_Handle );\n\n    if ( !outline )\n      return FT_THROW( Invalid_Outline );\n\n    if ( !params )\n      return FT_THROW( Invalid_Argument );\n\n    renderer = library->cur_renderer;\n    node     = library->renderers.head;\n\n    params->source = (void*)outline;\n\n    error = FT_ERR( Cannot_Render_Glyph );\n    while ( renderer )\n    {\n      error = renderer->raster_render( renderer->raster, params );\n      if ( !error || FT_ERR_NEQ( error, Cannot_Render_Glyph ) )\n        break;\n\n      /* FT_Err_Cannot_Render_Glyph is returned if the render mode   */\n      /* is unsupported by the current renderer for this glyph image */\n      /* format                                                      */\n\n      /* now, look for another renderer that supports the same */\n      /* format                                                */\n      renderer = FT_Lookup_Renderer( library, FT_GLYPH_FORMAT_OUTLINE,\n                                     &node );\n      update   = TRUE;\n    }\n\n    /* if we changed the current renderer for the glyph image format */\n    /* we need to select it as the next current one                  */\n    if ( !error && update && renderer )\n      error = FT_Set_Renderer( library, renderer, 0, 0 );\n\n    return error;\n  }\n\n\n  /* documentation is in ftoutln.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Outline_Get_Bitmap( FT_Library        library,\n                         FT_Outline*       outline,\n                         const FT_Bitmap  *abitmap )\n  {\n    FT_Raster_Params  params;\n\n\n    if ( !abitmap )\n      return FT_THROW( Invalid_Argument );\n\n    /* other checks are delayed to `FT_Outline_Render' */\n\n    params.target = abitmap;\n    params.flags  = 0;\n\n    if ( abitmap->pixel_mode == FT_PIXEL_MODE_GRAY  ||\n         abitmap->pixel_mode == FT_PIXEL_MODE_LCD   ||\n         abitmap->pixel_mode == FT_PIXEL_MODE_LCD_V )\n      params.flags |= FT_RASTER_FLAG_AA;\n\n    return FT_Outline_Render( library, outline, &params );\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( void )\n  FT_Vector_Transform( FT_Vector*        vector,\n                       const FT_Matrix*  matrix )\n  {\n    FT_Pos  xz, yz;\n\n\n    if ( !vector || !matrix )\n      return;\n\n    xz = FT_MulFix( vector->x, matrix->xx ) +\n         FT_MulFix( vector->y, matrix->xy );\n\n    yz = FT_MulFix( vector->x, matrix->yx ) +\n         FT_MulFix( vector->y, matrix->yy );\n\n    vector->x = xz;\n    vector->y = yz;\n  }\n\n\n  /* documentation is in ftoutln.h */\n\n  FT_EXPORT_DEF( void )\n  FT_Outline_Transform( const FT_Outline*  outline,\n                        const FT_Matrix*   matrix )\n  {\n    FT_Vector*  vec;\n    FT_Vector*  limit;\n\n\n    if ( !outline || !matrix )\n      return;\n\n    vec   = outline->points;\n    limit = vec + outline->n_points;\n\n    for ( ; vec < limit; vec++ )\n      FT_Vector_Transform( vec, matrix );\n  }\n\n\n#if 0\n\n#define FT_OUTLINE_GET_CONTOUR( outline, c, first, last )  \\\n  do                                                       \\\n  {                                                        \\\n    (first) = ( c > 0 ) ? (outline)->points +              \\\n                            (outline)->contours[c - 1] + 1 \\\n                        : (outline)->points;               \\\n    (last) = (outline)->points + (outline)->contours[c];   \\\n  } while ( 0 )\n\n\n  /* Is a point in some contour?                     */\n  /*                                                 */\n  /* We treat every point of the contour as if it    */\n  /* it were ON.  That is, we allow false positives, */\n  /* but disallow false negatives.  (XXX really?)    */\n  static FT_Bool\n  ft_contour_has( FT_Outline*  outline,\n                  FT_Short     c,\n                  FT_Vector*   point )\n  {\n    FT_Vector*  first;\n    FT_Vector*  last;\n    FT_Vector*  a;\n    FT_Vector*  b;\n    FT_UInt     n = 0;\n\n\n    FT_OUTLINE_GET_CONTOUR( outline, c, first, last );\n\n    for ( a = first; a <= last; a++ )\n    {\n      FT_Pos  x;\n      FT_Int  intersect;\n\n\n      b = ( a == last ) ? first : a + 1;\n\n      intersect = ( a->y - point->y ) ^ ( b->y - point->y );\n\n      /* a and b are on the same side */\n      if ( intersect >= 0 )\n      {\n        if ( intersect == 0 && a->y == point->y )\n        {\n          if ( ( a->x <= point->x && b->x >= point->x ) ||\n               ( a->x >= point->x && b->x <= point->x ) )\n            return 1;\n        }\n\n        continue;\n      }\n\n      x = a->x + ( b->x - a->x ) * (point->y - a->y ) / ( b->y - a->y );\n\n      if ( x < point->x )\n        n++;\n      else if ( x == point->x )\n        return 1;\n    }\n\n    return n & 1;\n  }\n\n\n  static FT_Bool\n  ft_contour_enclosed( FT_Outline*  outline,\n                       FT_UShort    c )\n  {\n    FT_Vector*  first;\n    FT_Vector*  last;\n    FT_Short    i;\n\n\n    FT_OUTLINE_GET_CONTOUR( outline, c, first, last );\n\n    for ( i = 0; i < outline->n_contours; i++ )\n    {\n      if ( i != c && ft_contour_has( outline, i, first ) )\n      {\n        FT_Vector*  pt;\n\n\n        for ( pt = first + 1; pt <= last; pt++ )\n          if ( !ft_contour_has( outline, i, pt ) )\n            return 0;\n\n        return 1;\n      }\n    }\n\n    return 0;\n  }\n\n\n  /* This version differs from the public one in that each */\n  /* part (contour not enclosed in another contour) of the */\n  /* outline is checked for orientation.  This is          */\n  /* necessary for some buggy CJK fonts.                   */\n  static FT_Orientation\n  ft_outline_get_orientation( FT_Outline*  outline )\n  {\n    FT_Short        i;\n    FT_Vector*      first;\n    FT_Vector*      last;\n    FT_Orientation  orient = FT_ORIENTATION_NONE;\n\n\n    first = outline->points;\n    for ( i = 0; i < outline->n_contours; i++, first = last + 1 )\n    {\n      FT_Vector*  point;\n      FT_Vector*  xmin_point;\n      FT_Pos      xmin;\n\n\n      last = outline->points + outline->contours[i];\n\n      /* skip degenerate contours */\n      if ( last < first + 2 )\n        continue;\n\n      if ( ft_contour_enclosed( outline, i ) )\n        continue;\n\n      xmin       = first->x;\n      xmin_point = first;\n\n      for ( point = first + 1; point <= last; point++ )\n      {\n        if ( point->x < xmin )\n        {\n          xmin       = point->x;\n          xmin_point = point;\n        }\n      }\n\n      /* check the orientation of the contour */\n      {\n        FT_Vector*      prev;\n        FT_Vector*      next;\n        FT_Orientation  o;\n\n\n        prev = ( xmin_point == first ) ? last : xmin_point - 1;\n        next = ( xmin_point == last ) ? first : xmin_point + 1;\n\n        if ( FT_Atan2( prev->x - xmin_point->x, prev->y - xmin_point->y ) >\n             FT_Atan2( next->x - xmin_point->x, next->y - xmin_point->y ) )\n          o = FT_ORIENTATION_POSTSCRIPT;\n        else\n          o = FT_ORIENTATION_TRUETYPE;\n\n        if ( orient == FT_ORIENTATION_NONE )\n          orient = o;\n        else if ( orient != o )\n          return FT_ORIENTATION_NONE;\n      }\n    }\n\n    return orient;\n  }\n\n#endif /* 0 */\n\n\n  /* documentation is in ftoutln.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Outline_Embolden( FT_Outline*  outline,\n                       FT_Pos       strength )\n  {\n    return FT_Outline_EmboldenXY( outline, strength, strength );\n  }\n\n\n  /* documentation is in ftoutln.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Outline_EmboldenXY( FT_Outline*  outline,\n                         FT_Pos       xstrength,\n                         FT_Pos       ystrength )\n  {\n    FT_Vector*  points;\n    FT_Vector   v_prev, v_first, v_next, v_cur;\n    FT_Int      c, n, first;\n    FT_Int      orientation;\n\n\n    if ( !outline )\n      return FT_THROW( Invalid_Outline );\n\n    xstrength /= 2;\n    ystrength /= 2;\n    if ( xstrength == 0 && ystrength == 0 )\n      return FT_Err_Ok;\n\n    orientation = FT_Outline_Get_Orientation( outline );\n    if ( orientation == FT_ORIENTATION_NONE )\n    {\n      if ( outline->n_contours )\n        return FT_THROW( Invalid_Argument );\n      else\n        return FT_Err_Ok;\n    }\n\n    points = outline->points;\n\n    first = 0;\n    for ( c = 0; c < outline->n_contours; c++ )\n    {\n      FT_Vector  in, out, shift;\n      FT_Fixed   l_in, l_out, l, q, d;\n      int        last = outline->contours[c];\n\n\n      v_first = points[first];\n      v_prev  = points[last];\n      v_cur   = v_first;\n\n      /* compute incoming normalized vector */\n      in.x = v_cur.x - v_prev.x;\n      in.y = v_cur.y - v_prev.y;\n      l_in = FT_Vector_Length( &in );\n      if ( l_in )\n      {\n        in.x = FT_DivFix( in.x, l_in );\n        in.y = FT_DivFix( in.y, l_in );\n      }\n\n      for ( n = first; n <= last; n++ )\n      {\n        if ( n < last )\n          v_next = points[n + 1];\n        else\n          v_next = v_first;\n\n        /* compute outgoing normalized vector */\n        out.x = v_next.x - v_cur.x;\n        out.y = v_next.y - v_cur.y;\n        l_out = FT_Vector_Length( &out );\n        if ( l_out )\n        {\n          out.x = FT_DivFix( out.x, l_out );\n          out.y = FT_DivFix( out.y, l_out );\n        }\n\n        d = FT_MulFix( in.x, out.x ) + FT_MulFix( in.y, out.y );\n\n        /* shift only if turn is less than ~160 degrees */\n        if ( d > -0xF000L )\n        {\n          d = d + 0x10000L;\n\n          /* shift components are aligned along lateral bisector */\n          /* and directed according to the outline orientation.  */\n          shift.x = in.y + out.y;\n          shift.y = in.x + out.x;\n\n          if ( orientation == FT_ORIENTATION_TRUETYPE )\n            shift.x = -shift.x;\n          else\n            shift.y = -shift.y;\n\n          /* restrict shift magnitude to better handle collapsing segments */\n          q = FT_MulFix( out.x, in.y ) - FT_MulFix( out.y, in.x );\n          if ( orientation == FT_ORIENTATION_TRUETYPE )\n            q = -q;\n\n          l = FT_MIN( l_in, l_out );\n\n          /* non-strict inequalities avoid divide-by-zero when q == l == 0 */\n          if ( FT_MulFix( xstrength, q ) <= FT_MulFix( d, l ) )\n            shift.x = FT_MulDiv( shift.x, xstrength, d );\n          else\n            shift.x = FT_MulDiv( shift.x, l, q );\n\n\n          if ( FT_MulFix( ystrength, q ) <= FT_MulFix( d, l ) )\n            shift.y = FT_MulDiv( shift.y, ystrength, d );\n          else\n            shift.y = FT_MulDiv( shift.y, l, q );\n        }\n        else\n          shift.x = shift.y = 0;\n\n        outline->points[n].x = v_cur.x + xstrength + shift.x;\n        outline->points[n].y = v_cur.y + ystrength + shift.y;\n\n        in    = out;\n        l_in  = l_out;\n        v_cur = v_next;\n      }\n\n      first = last + 1;\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n  /* documentation is in ftoutln.h */\n\n  FT_EXPORT_DEF( FT_Orientation )\n  FT_Outline_Get_Orientation( FT_Outline*  outline )\n  {\n    FT_BBox     cbox;\n    FT_Int      xshift, yshift;\n    FT_Vector*  points;\n    FT_Vector   v_prev, v_cur;\n    FT_Int      c, n, first;\n    FT_Pos      area = 0;\n\n\n    if ( !outline || outline->n_points <= 0 )\n      return FT_ORIENTATION_TRUETYPE;\n\n    /* We use the nonzero winding rule to find the orientation.       */\n    /* Since glyph outlines behave much more `regular' than arbitrary */\n    /* cubic or quadratic curves, this test deals with the polygon    */\n    /* only which is spanned up by the control points.                */\n\n    FT_Outline_Get_CBox( outline, &cbox );\n\n    /* Handle collapsed outlines to avoid undefined FT_MSB. */\n    if ( cbox.xMin == cbox.xMax || cbox.yMin == cbox.yMax )\n      return FT_ORIENTATION_NONE;\n\n    xshift = FT_MSB( FT_ABS( cbox.xMax ) | FT_ABS( cbox.xMin ) ) - 14;\n    xshift = FT_MAX( xshift, 0 );\n\n    yshift = FT_MSB( cbox.yMax - cbox.yMin ) - 14;\n    yshift = FT_MAX( yshift, 0 );\n\n    points = outline->points;\n\n    first = 0;\n    for ( c = 0; c < outline->n_contours; c++ )\n    {\n      FT_Int  last = outline->contours[c];\n\n\n      v_prev = points[last];\n\n      for ( n = first; n <= last; n++ )\n      {\n        v_cur = points[n];\n        area += ( ( v_cur.y - v_prev.y ) >> yshift ) *\n                ( ( v_cur.x + v_prev.x ) >> xshift );\n        v_prev = v_cur;\n      }\n\n      first = last + 1;\n    }\n\n    if ( area > 0 )\n      return FT_ORIENTATION_POSTSCRIPT;\n    else if ( area < 0 )\n      return FT_ORIENTATION_TRUETYPE;\n    else\n      return FT_ORIENTATION_NONE;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftpatent.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftpatent.c                                                             */\n/*                                                                         */\n/*    FreeType API for checking patented TrueType bytecode instructions    */\n/*    (body).                                                              */\n/*                                                                         */\n/*  Copyright 2007, 2008, 2010 by David Turner.                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_TRUETYPE_TAGS_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_STREAM_H\n#include FT_SERVICE_SFNT_H\n#include FT_SERVICE_TRUETYPE_GLYF_H\n\n\n  static FT_Bool\n  _tt_check_patents_in_range( FT_Stream  stream,\n                              FT_ULong   size )\n  {\n    FT_Bool   result = FALSE;\n    FT_Error  error;\n    FT_Bytes  p, end;\n\n\n    if ( FT_FRAME_ENTER( size ) )\n      return 0;\n\n    p   = stream->cursor;\n    end = p + size;\n\n    while ( p < end )\n    {\n      switch (p[0])\n      {\n      case 0x06:  /* SPvTL // */\n      case 0x07:  /* SPvTL +  */\n      case 0x08:  /* SFvTL // */\n      case 0x09:  /* SFvTL +  */\n      case 0x0A:  /* SPvFS    */\n      case 0x0B:  /* SFvFS    */\n        result = TRUE;\n        goto Exit;\n\n      case 0x40:\n        if ( p + 1 >= end )\n          goto Exit;\n\n        p += p[1] + 2;\n        break;\n\n      case 0x41:\n        if ( p + 1 >= end )\n          goto Exit;\n\n        p += p[1] * 2 + 2;\n        break;\n\n      case 0x71:  /* DELTAP2 */\n      case 0x72:  /* DELTAP3 */\n      case 0x73:  /* DELTAC0 */\n      case 0x74:  /* DELTAC1 */\n      case 0x75:  /* DELTAC2 */\n        result = TRUE;\n        goto Exit;\n\n      case 0xB0:\n      case 0xB1:\n      case 0xB2:\n      case 0xB3:\n      case 0xB4:\n      case 0xB5:\n      case 0xB6:\n      case 0xB7:\n        p += ( p[0] - 0xB0 ) + 2;\n        break;\n\n      case 0xB8:\n      case 0xB9:\n      case 0xBA:\n      case 0xBB:\n      case 0xBC:\n      case 0xBD:\n      case 0xBE:\n      case 0xBF:\n        p += ( p[0] - 0xB8 ) * 2 + 3;\n        break;\n\n      default:\n        p += 1;\n        break;\n      }\n    }\n\n  Exit:\n    FT_UNUSED( error );\n    FT_FRAME_EXIT();\n    return result;\n  }\n\n\n  static FT_Bool\n  _tt_check_patents_in_table( FT_Face   face,\n                              FT_ULong  tag )\n  {\n    FT_Stream              stream = face->stream;\n    FT_Error               error  = FT_Err_Ok;\n    FT_Service_SFNT_Table  service;\n    FT_Bool                result = FALSE;\n\n\n    FT_FACE_FIND_SERVICE( face, service, SFNT_TABLE );\n\n    if ( service )\n    {\n      FT_UInt   i = 0;\n      FT_ULong  tag_i = 0, offset_i = 0, length_i = 0;\n\n\n      for ( i = 0; !error && tag_i != tag ; i++ )\n        error = service->table_info( face, i,\n                                     &tag_i, &offset_i, &length_i );\n\n      if ( error                      ||\n           FT_STREAM_SEEK( offset_i ) )\n        goto Exit;\n\n      result = _tt_check_patents_in_range( stream, length_i );\n    }\n\n  Exit:\n    return result;\n  }\n\n\n  static FT_Bool\n  _tt_face_check_patents( FT_Face  face )\n  {\n    FT_Stream  stream = face->stream;\n    FT_UInt    gindex;\n    FT_Error   error;\n    FT_Bool    result;\n\n    FT_Service_TTGlyf  service;\n\n\n    result = _tt_check_patents_in_table( face, TTAG_fpgm );\n    if ( result )\n      goto Exit;\n\n    result = _tt_check_patents_in_table( face, TTAG_prep );\n    if ( result )\n      goto Exit;\n\n    FT_FACE_FIND_SERVICE( face, service, TT_GLYF );\n    if ( service == NULL )\n      goto Exit;\n\n    for ( gindex = 0; gindex < (FT_UInt)face->num_glyphs; gindex++ )\n    {\n      FT_ULong  offset, num_ins, size;\n      FT_Int    num_contours;\n\n\n      offset = service->get_location( face, gindex, &size );\n      if ( size == 0 )\n        continue;\n\n      if ( FT_STREAM_SEEK( offset )      ||\n           FT_READ_SHORT( num_contours ) )\n        continue;\n\n      if ( num_contours >= 0 )  /* simple glyph */\n      {\n        if ( FT_STREAM_SKIP( 8 + num_contours * 2 ) )\n          continue;\n      }\n      else  /* compound glyph */\n      {\n        FT_Bool  has_instr = 0;\n\n\n        if ( FT_STREAM_SKIP( 8 ) )\n          continue;\n\n        /* now read each component */\n        for (;;)\n        {\n          FT_UInt  flags, toskip;\n\n\n          if( FT_READ_USHORT( flags ) )\n            break;\n\n          toskip = 2 + 1 + 1;\n\n          if ( ( flags & ( 1 << 0 ) ) != 0 )       /* ARGS_ARE_WORDS */\n            toskip += 2;\n\n          if ( ( flags & ( 1 << 3 ) ) != 0 )       /* WE_HAVE_A_SCALE */\n            toskip += 2;\n          else if ( ( flags & ( 1 << 6 ) ) != 0 )  /* WE_HAVE_X_Y_SCALE */\n            toskip += 4;\n          else if ( ( flags & ( 1 << 7 ) ) != 0 )  /* WE_HAVE_A_2x2 */\n            toskip += 8;\n\n          if ( ( flags & ( 1 << 8 ) ) != 0 )       /* WE_HAVE_INSTRUCTIONS */\n            has_instr = 1;\n\n          if ( FT_STREAM_SKIP( toskip ) )\n            goto NextGlyph;\n\n          if ( ( flags & ( 1 << 5 ) ) == 0 )       /* MORE_COMPONENTS */\n            break;\n        }\n\n        if ( !has_instr )\n          goto NextGlyph;\n      }\n\n      if ( FT_READ_USHORT( num_ins ) )\n        continue;\n\n      result = _tt_check_patents_in_range( stream, num_ins );\n      if ( result )\n        goto Exit;\n\n    NextGlyph:\n      ;\n    }\n\n  Exit:\n    return result;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Bool )\n  FT_Face_CheckTrueTypePatents( FT_Face  face )\n  {\n    FT_Bool  result = FALSE;\n\n\n    if ( face && FT_IS_SFNT( face ) )\n      result = _tt_face_check_patents( face );\n\n    return result;\n  }\n\n\n  /* documentation is in freetype.h */\n\n  FT_EXPORT_DEF( FT_Bool )\n  FT_Face_SetUnpatentedHinting( FT_Face  face,\n                                FT_Bool  value )\n  {\n    FT_Bool  result = FALSE;\n\n\n#if defined( TT_CONFIG_OPTION_UNPATENTED_HINTING ) && \\\n    !defined( TT_CONFIG_OPTION_BYTECODE_INTERPRETER )\n    if ( face && FT_IS_SFNT( face ) )\n    {\n      result = !face->internal->ignore_unpatented_hinter;\n      face->internal->ignore_unpatented_hinter = !value;\n    }\n#else\n    FT_UNUSED( face );\n    FT_UNUSED( value );\n#endif\n\n    return result;\n  }\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftpfr.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftpfr.c                                                                */\n/*                                                                         */\n/*    FreeType API for accessing PFR-specific data (body).                 */\n/*                                                                         */\n/*  Copyright 2002-2004, 2008, 2010, 2013, 2014 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n\n#include FT_INTERNAL_OBJECTS_H\n#include FT_SERVICE_PFR_H\n\n\n  /* check the format */\n  static FT_Service_PfrMetrics\n  ft_pfr_check( FT_Face  face )\n  {\n    FT_Service_PfrMetrics  service = NULL;\n\n\n    if ( face )\n      FT_FACE_LOOKUP_SERVICE( face, service, PFR_METRICS );\n\n    return service;\n  }\n\n\n  /* documentation is in ftpfr.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Get_PFR_Metrics( FT_Face    face,\n                      FT_UInt   *aoutline_resolution,\n                      FT_UInt   *ametrics_resolution,\n                      FT_Fixed  *ametrics_x_scale,\n                      FT_Fixed  *ametrics_y_scale )\n  {\n    FT_Error               error = FT_Err_Ok;\n    FT_Service_PfrMetrics  service;\n\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    service = ft_pfr_check( face );\n    if ( service )\n    {\n      error = service->get_metrics( face,\n                                    aoutline_resolution,\n                                    ametrics_resolution,\n                                    ametrics_x_scale,\n                                    ametrics_y_scale );\n    }\n    else\n    {\n      FT_Fixed  x_scale, y_scale;\n\n\n      /* this is not a PFR font */\n      if ( aoutline_resolution )\n        *aoutline_resolution = face->units_per_EM;\n\n      if ( ametrics_resolution )\n        *ametrics_resolution = face->units_per_EM;\n\n      x_scale = y_scale = 0x10000L;\n      if ( face->size )\n      {\n        x_scale = face->size->metrics.x_scale;\n        y_scale = face->size->metrics.y_scale;\n      }\n\n      if ( ametrics_x_scale )\n        *ametrics_x_scale = x_scale;\n\n      if ( ametrics_y_scale )\n        *ametrics_y_scale = y_scale;\n\n      error = FT_THROW( Unknown_File_Format );\n    }\n\n    return error;\n  }\n\n\n  /* documentation is in ftpfr.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Get_PFR_Kerning( FT_Face     face,\n                      FT_UInt     left,\n                      FT_UInt     right,\n                      FT_Vector  *avector )\n  {\n    FT_Error               error;\n    FT_Service_PfrMetrics  service;\n\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    if ( !avector )\n      return FT_THROW( Invalid_Argument );\n\n    service = ft_pfr_check( face );\n    if ( service )\n      error = service->get_kerning( face, left, right, avector );\n    else\n      error = FT_Get_Kerning( face, left, right,\n                              FT_KERNING_UNSCALED, avector );\n\n    return error;\n  }\n\n\n  /* documentation is in ftpfr.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Get_PFR_Advance( FT_Face   face,\n                      FT_UInt   gindex,\n                      FT_Pos   *aadvance )\n  {\n    FT_Error               error;\n    FT_Service_PfrMetrics  service;\n\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    if ( !aadvance )\n      return FT_THROW( Invalid_Argument );\n\n    service = ft_pfr_check( face );\n    if ( service )\n      error = service->get_advance( face, gindex, aadvance );\n    else\n      /* XXX: TODO: PROVIDE ADVANCE-LOADING METHOD TO ALL FONT DRIVERS */\n      error = FT_THROW( Invalid_Argument );\n\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftpic.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftpic.c                                                                */\n/*                                                                         */\n/*    The FreeType position independent code services (body).              */\n/*                                                                         */\n/*  Copyright 2009, 2013 by                                                */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_INTERNAL_OBJECTS_H\n#include \"basepic.h\"\n\n#ifdef FT_CONFIG_OPTION_PIC\n\n  /* documentation is in ftpic.h */\n\n  FT_BASE_DEF( FT_Error )\n  ft_pic_container_init( FT_Library  library )\n  {\n    FT_PIC_Container*  pic_container = &library->pic_container;\n    FT_Error           error;\n\n\n    FT_MEM_SET( pic_container, 0, sizeof ( *pic_container ) );\n\n    error = ft_base_pic_init( library );\n    if ( error )\n      return error;\n\n    return FT_Err_Ok;\n  }\n\n\n  /* Destroy the contents of the container. */\n  FT_BASE_DEF( void )\n  ft_pic_container_destroy( FT_Library  library )\n  {\n    ft_base_pic_free( library );\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftrfork.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftrfork.c                                                              */\n/*                                                                         */\n/*    Embedded resource forks accessor (body).                             */\n/*                                                                         */\n/*  Copyright 2004-2010, 2013, 2014 by                                     */\n/*  Masatake YAMATO and Redhat K.K.                                        */\n/*                                                                         */\n/*  FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are     */\n/*  derived from ftobjs.c.                                                 */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/* Development of the code in this file is support of                      */\n/* Information-technology Promotion Agency, Japan.                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_RFORK_H\n#include \"basepic.h\"\n#include \"ftbase.h\"\n\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_raccess\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****               Resource fork directory access                    ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_BASE_DEF( FT_Error )\n  FT_Raccess_Get_HeaderInfo( FT_Library  library,\n                             FT_Stream   stream,\n                             FT_Long     rfork_offset,\n                             FT_Long    *map_offset,\n                             FT_Long    *rdata_pos )\n  {\n    FT_Error       error;\n    unsigned char  head[16], head2[16];\n    FT_Long        map_pos, rdata_len;\n    int            allzeros, allmatch, i;\n    FT_Long        type_list;\n\n    FT_UNUSED( library );\n\n\n    error = FT_Stream_Seek( stream, rfork_offset );\n    if ( error )\n      return error;\n\n    error = FT_Stream_Read( stream, (FT_Byte *)head, 16 );\n    if ( error )\n      return error;\n\n    *rdata_pos = rfork_offset + ( ( head[0] << 24 ) |\n                                  ( head[1] << 16 ) |\n                                  ( head[2] <<  8 ) |\n                                    head[3]         );\n    map_pos    = rfork_offset + ( ( head[4] << 24 ) |\n                                  ( head[5] << 16 ) |\n                                  ( head[6] <<  8 ) |\n                                    head[7]         );\n    rdata_len = ( head[ 8] << 24 ) |\n                ( head[ 9] << 16 ) |\n                ( head[10] <<  8 ) |\n                  head[11];\n\n    /* map_len = head[12] .. head[15] */\n\n    if ( *rdata_pos + rdata_len != map_pos || map_pos == rfork_offset )\n      return FT_THROW( Unknown_File_Format );\n\n    error = FT_Stream_Seek( stream, map_pos );\n    if ( error )\n      return error;\n\n    head2[15] = (FT_Byte)( head[15] + 1 );       /* make it be different */\n\n    error = FT_Stream_Read( stream, (FT_Byte*)head2, 16 );\n    if ( error )\n      return error;\n\n    allzeros = 1;\n    allmatch = 1;\n    for ( i = 0; i < 16; ++i )\n    {\n      if ( head2[i] != 0 )\n        allzeros = 0;\n      if ( head2[i] != head[i] )\n        allmatch = 0;\n    }\n    if ( !allzeros && !allmatch )\n      return FT_THROW( Unknown_File_Format );\n\n    /* If we have reached this point then it is probably a mac resource */\n    /* file.  Now, does it contain any interesting resources?           */\n    /* Skip handle to next resource map, the file resource number, and  */\n    /* attributes.                                                      */\n    (void)FT_STREAM_SKIP( 4        /* skip handle to next resource map */\n                          + 2      /* skip file resource number */\n                          + 2 );   /* skip attributes */\n\n    if ( FT_READ_USHORT( type_list ) )\n      return error;\n    if ( type_list == -1 )\n      return FT_THROW( Unknown_File_Format );\n\n    error = FT_Stream_Seek( stream, map_pos + type_list );\n    if ( error )\n      return error;\n\n    *map_offset = map_pos + type_list;\n    return FT_Err_Ok;\n  }\n\n\n  static int\n  ft_raccess_sort_ref_by_id( FT_RFork_Ref*  a,\n                             FT_RFork_Ref*  b )\n  {\n    if ( a->res_id < b->res_id )\n      return -1;\n    else if ( a->res_id > b->res_id )\n      return 1;\n    else\n      return 0;\n  }\n\n\n  FT_BASE_DEF( FT_Error )\n  FT_Raccess_Get_DataOffsets( FT_Library  library,\n                              FT_Stream   stream,\n                              FT_Long     map_offset,\n                              FT_Long     rdata_pos,\n                              FT_Long     tag,\n                              FT_Bool     sort_by_res_id,\n                              FT_Long   **offsets,\n                              FT_Long    *count )\n  {\n    FT_Error      error;\n    int           i, j, cnt, subcnt;\n    FT_Long       tag_internal, rpos;\n    FT_Memory     memory = library->memory;\n    FT_Long       temp;\n    FT_Long       *offsets_internal = NULL;\n    FT_RFork_Ref  *ref = NULL;\n\n\n    FT_TRACE3(( \"\\n\" ));\n    error = FT_Stream_Seek( stream, map_offset );\n    if ( error )\n      return error;\n\n    if ( FT_READ_USHORT( cnt ) )\n      return error;\n    cnt++;\n\n    for ( i = 0; i < cnt; ++i )\n    {\n      if ( FT_READ_LONG( tag_internal ) ||\n           FT_READ_USHORT( subcnt )     ||\n           FT_READ_USHORT( rpos )       )\n        return error;\n\n      FT_TRACE2(( \"Resource tags: %c%c%c%c\\n\",\n                  (char)( 0xFF & ( tag_internal >> 24 ) ),\n                  (char)( 0xFF & ( tag_internal >> 16 ) ),\n                  (char)( 0xFF & ( tag_internal >>  8 ) ),\n                  (char)( 0xFF & ( tag_internal >>  0 ) ) ));\n      FT_TRACE3(( \"             : subcount=%d, suboffset=0x%04x\\n\",\n                  subcnt, rpos ));\n\n      if ( tag_internal == tag )\n      {\n        *count = subcnt + 1;\n        rpos  += map_offset;\n\n        error = FT_Stream_Seek( stream, rpos );\n        if ( error )\n          return error;\n\n        if ( FT_NEW_ARRAY( ref, *count ) )\n          return error;\n\n        for ( j = 0; j < *count; ++j )\n        {\n          if ( FT_READ_USHORT( ref[j].res_id ) )\n            goto Exit;\n          if ( FT_STREAM_SKIP( 2 ) ) /* resource name */\n            goto Exit;\n          if ( FT_READ_LONG( temp ) )\n            goto Exit;\n          if ( FT_STREAM_SKIP( 4 ) ) /* mbz */\n            goto Exit;\n\n          ref[j].offset = temp & 0xFFFFFFL;\n          FT_TRACE3(( \"             [%d]:\"\n                      \" resource_id=0x%04x, offset=0x%08x\\n\",\n                      j, ref[j].res_id, ref[j].offset ));\n        }\n\n        if (sort_by_res_id)\n        {\n          ft_qsort( ref, *count, sizeof ( FT_RFork_Ref ),\n                    ( int(*)(const void*, const void*) )\n                    ft_raccess_sort_ref_by_id );\n\n          FT_TRACE3(( \"             -- sort resources by their ids --\\n\" ));\n          for ( j = 0; j < *count; ++ j ) {\n            FT_TRACE3(( \"             [%d]:\"\n                        \" resource_id=0x%04x, offset=0x%08x\\n\",\n                        j, ref[j].res_id, ref[j].offset ));\n          }\n        }\n\n        if ( FT_NEW_ARRAY( offsets_internal, *count ) )\n          goto Exit;\n\n        /* XXX: duplicated reference ID,\n         *      gap between reference IDs are acceptable?\n         *      further investigation on Apple implementation is needed.\n         */\n        for ( j = 0; j < *count; ++j )\n          offsets_internal[j] = rdata_pos + ref[j].offset;\n\n        *offsets = offsets_internal;\n        error    = FT_Err_Ok;\n\n      Exit:\n        FT_FREE( ref );\n        return error;\n      }\n    }\n\n    return FT_THROW( Cannot_Open_Resource );\n  }\n\n\n#ifdef FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                     Guessing functions                          ****/\n  /****                                                                 ****/\n  /****            When you add a new guessing function,                ****/\n  /****           update FT_RACCESS_N_RULES in ftrfork.h.               ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static FT_Error\n  raccess_guess_apple_double( FT_Library  library,\n                              FT_Stream   stream,\n                              char       *base_file_name,\n                              char      **result_file_name,\n                              FT_Long    *result_offset );\n\n  static FT_Error\n  raccess_guess_apple_single( FT_Library  library,\n                              FT_Stream   stream,\n                              char       *base_file_name,\n                              char      **result_file_name,\n                              FT_Long    *result_offset );\n\n  static FT_Error\n  raccess_guess_darwin_ufs_export( FT_Library  library,\n                                   FT_Stream   stream,\n                                   char       *base_file_name,\n                                   char      **result_file_name,\n                                   FT_Long    *result_offset );\n\n  static FT_Error\n  raccess_guess_darwin_newvfs( FT_Library  library,\n                               FT_Stream   stream,\n                               char       *base_file_name,\n                               char      **result_file_name,\n                               FT_Long    *result_offset );\n\n  static FT_Error\n  raccess_guess_darwin_hfsplus( FT_Library  library,\n                                FT_Stream   stream,\n                                char       *base_file_name,\n                                char      **result_file_name,\n                                FT_Long    *result_offset );\n\n  static FT_Error\n  raccess_guess_vfat( FT_Library  library,\n                      FT_Stream   stream,\n                      char       *base_file_name,\n                      char      **result_file_name,\n                      FT_Long    *result_offset );\n\n  static FT_Error\n  raccess_guess_linux_cap( FT_Library  library,\n                           FT_Stream   stream,\n                           char       *base_file_name,\n                           char      **result_file_name,\n                           FT_Long    *result_offset );\n\n  static FT_Error\n  raccess_guess_linux_double( FT_Library  library,\n                              FT_Stream   stream,\n                              char       *base_file_name,\n                              char      **result_file_name,\n                              FT_Long    *result_offset );\n\n  static FT_Error\n  raccess_guess_linux_netatalk( FT_Library  library,\n                                FT_Stream   stream,\n                                char       *base_file_name,\n                                char      **result_file_name,\n                                FT_Long    *result_offset );\n\n\n  CONST_FT_RFORK_RULE_ARRAY_BEGIN(ft_raccess_guess_table,\n                                  ft_raccess_guess_rec)\n  CONST_FT_RFORK_RULE_ARRAY_ENTRY(apple_double,      apple_double)\n  CONST_FT_RFORK_RULE_ARRAY_ENTRY(apple_single,      apple_single)\n  CONST_FT_RFORK_RULE_ARRAY_ENTRY(darwin_ufs_export, darwin_ufs_export)\n  CONST_FT_RFORK_RULE_ARRAY_ENTRY(darwin_newvfs,     darwin_newvfs)\n  CONST_FT_RFORK_RULE_ARRAY_ENTRY(darwin_hfsplus,    darwin_hfsplus)\n  CONST_FT_RFORK_RULE_ARRAY_ENTRY(vfat,              vfat)\n  CONST_FT_RFORK_RULE_ARRAY_ENTRY(linux_cap,         linux_cap)\n  CONST_FT_RFORK_RULE_ARRAY_ENTRY(linux_double,      linux_double)\n  CONST_FT_RFORK_RULE_ARRAY_ENTRY(linux_netatalk,    linux_netatalk)\n  CONST_FT_RFORK_RULE_ARRAY_END\n\n\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                       Helper functions                          ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n\n  static FT_Error\n  raccess_guess_apple_generic( FT_Library  library,\n                               FT_Stream   stream,\n                               char       *base_file_name,\n                               FT_Int32    magic,\n                               FT_Long    *result_offset );\n\n  static FT_Error\n  raccess_guess_linux_double_from_file_name( FT_Library  library,\n                                             char *      file_name,\n                                             FT_Long    *result_offset );\n\n  static char *\n  raccess_make_file_name( FT_Memory    memory,\n                          const char  *original_name,\n                          const char  *insertion );\n\n  FT_BASE_DEF( void )\n  FT_Raccess_Guess( FT_Library  library,\n                    FT_Stream   stream,\n                    char*       base_name,\n                    char      **new_names,\n                    FT_Long    *offsets,\n                    FT_Error   *errors )\n  {\n    FT_Int  i;\n\n\n    for ( i = 0; i < FT_RACCESS_N_RULES; i++ )\n    {\n      new_names[i] = NULL;\n      if ( NULL != stream )\n        errors[i] = FT_Stream_Seek( stream, 0 );\n      else\n        errors[i] = FT_Err_Ok;\n\n      if ( errors[i] )\n        continue ;\n\n      errors[i] = (FT_RACCESS_GUESS_TABLE_GET[i].func)( library,\n                                                 stream, base_name,\n                                                 &(new_names[i]),\n                                                 &(offsets[i]) );\n    }\n\n    return;\n  }\n\n\n#ifndef FT_MACINTOSH\n  static FT_RFork_Rule\n  raccess_get_rule_type_from_rule_index( FT_Library  library,\n                                         FT_UInt     rule_index )\n  {\n    FT_UNUSED( library );\n\n    if ( rule_index >= FT_RACCESS_N_RULES )\n      return FT_RFork_Rule_invalid;\n\n    return FT_RACCESS_GUESS_TABLE_GET[rule_index].type;\n  }\n\n\n  /*\n   * For this function, refer ftbase.h.\n   */\n  FT_LOCAL_DEF( FT_Bool )\n  ft_raccess_rule_by_darwin_vfs( FT_Library  library,\n                                 FT_UInt     rule_index )\n  {\n    switch( raccess_get_rule_type_from_rule_index( library, rule_index ) )\n    {\n      case FT_RFork_Rule_darwin_newvfs:\n      case FT_RFork_Rule_darwin_hfsplus:\n        return TRUE;\n\n      default:\n        return FALSE;\n    }\n  }\n#endif\n\n\n  static FT_Error\n  raccess_guess_apple_double( FT_Library  library,\n                              FT_Stream   stream,\n                              char       *base_file_name,\n                              char      **result_file_name,\n                              FT_Long    *result_offset )\n  {\n    FT_Int32  magic = ( 0x00 << 24 ) |\n                      ( 0x05 << 16 ) |\n                      ( 0x16 <<  8 ) |\n                        0x07;\n\n\n    *result_file_name = NULL;\n    if ( NULL == stream )\n      return FT_THROW( Cannot_Open_Stream );\n\n    return raccess_guess_apple_generic( library, stream, base_file_name,\n                                        magic, result_offset );\n  }\n\n\n  static FT_Error\n  raccess_guess_apple_single( FT_Library  library,\n                              FT_Stream   stream,\n                              char       *base_file_name,\n                              char      **result_file_name,\n                              FT_Long    *result_offset )\n  {\n    FT_Int32  magic = ( 0x00 << 24 ) |\n                      ( 0x05 << 16 ) |\n                      ( 0x16 <<  8 ) |\n                        0x00;\n\n\n    *result_file_name = NULL;\n    if ( NULL == stream )\n      return FT_THROW( Cannot_Open_Stream );\n\n    return raccess_guess_apple_generic( library, stream, base_file_name,\n                                        magic, result_offset );\n  }\n\n\n  static FT_Error\n  raccess_guess_darwin_ufs_export( FT_Library  library,\n                                   FT_Stream   stream,\n                                   char       *base_file_name,\n                                   char      **result_file_name,\n                                   FT_Long    *result_offset )\n  {\n    char*      newpath;\n    FT_Error   error;\n    FT_Memory  memory;\n\n    FT_UNUSED( stream );\n\n\n    memory  = library->memory;\n    newpath = raccess_make_file_name( memory, base_file_name, \"._\" );\n    if ( !newpath )\n      return FT_THROW( Out_Of_Memory );\n\n    error = raccess_guess_linux_double_from_file_name( library, newpath,\n                                                       result_offset );\n    if ( !error )\n      *result_file_name = newpath;\n    else\n      FT_FREE( newpath );\n\n    return error;\n  }\n\n\n  static FT_Error\n  raccess_guess_darwin_hfsplus( FT_Library  library,\n                                FT_Stream   stream,\n                                char       *base_file_name,\n                                char      **result_file_name,\n                                FT_Long    *result_offset )\n  {\n    /*\n      Only meaningful on systems with hfs+ drivers (or Macs).\n     */\n    FT_Error   error;\n    char*      newpath = NULL;\n    FT_Memory  memory;\n    FT_Long    base_file_len = (FT_Long)ft_strlen( base_file_name );\n\n    FT_UNUSED( stream );\n\n\n    memory = library->memory;\n\n    if ( base_file_len + 6 > FT_INT_MAX )\n      return FT_THROW( Array_Too_Large );\n\n    if ( FT_ALLOC( newpath, base_file_len + 6 ) )\n      return error;\n\n    FT_MEM_COPY( newpath, base_file_name, base_file_len );\n    FT_MEM_COPY( newpath + base_file_len, \"/rsrc\", 6 );\n\n    *result_file_name = newpath;\n    *result_offset    = 0;\n\n    return FT_Err_Ok;\n  }\n\n\n  static FT_Error\n  raccess_guess_darwin_newvfs( FT_Library  library,\n                               FT_Stream   stream,\n                               char       *base_file_name,\n                               char      **result_file_name,\n                               FT_Long    *result_offset )\n  {\n    /*\n      Only meaningful on systems with Mac OS X (> 10.1).\n     */\n    FT_Error   error;\n    char*      newpath = NULL;\n    FT_Memory  memory;\n    FT_Long    base_file_len = (FT_Long)ft_strlen( base_file_name );\n\n    FT_UNUSED( stream );\n\n\n    memory = library->memory;\n\n    if ( base_file_len + 18 > FT_INT_MAX )\n      return FT_THROW( Array_Too_Large );\n\n    if ( FT_ALLOC( newpath, base_file_len + 18 ) )\n      return error;\n\n    FT_MEM_COPY( newpath, base_file_name, base_file_len );\n    FT_MEM_COPY( newpath + base_file_len, \"/..namedfork/rsrc\", 18 );\n\n    *result_file_name = newpath;\n    *result_offset    = 0;\n\n    return FT_Err_Ok;\n  }\n\n\n  static FT_Error\n  raccess_guess_vfat( FT_Library  library,\n                      FT_Stream   stream,\n                      char       *base_file_name,\n                      char      **result_file_name,\n                      FT_Long    *result_offset )\n  {\n    char*      newpath;\n    FT_Memory  memory;\n\n    FT_UNUSED( stream );\n\n\n    memory = library->memory;\n\n    newpath = raccess_make_file_name( memory, base_file_name,\n                                      \"resource.frk/\" );\n    if ( !newpath )\n      return FT_THROW( Out_Of_Memory );\n\n    *result_file_name = newpath;\n    *result_offset    = 0;\n\n    return FT_Err_Ok;\n  }\n\n\n  static FT_Error\n  raccess_guess_linux_cap( FT_Library  library,\n                           FT_Stream   stream,\n                           char       *base_file_name,\n                           char      **result_file_name,\n                           FT_Long    *result_offset )\n  {\n    char*      newpath;\n    FT_Memory  memory;\n\n    FT_UNUSED( stream );\n\n\n    memory = library->memory;\n\n    newpath = raccess_make_file_name( memory, base_file_name, \".resource/\" );\n    if ( !newpath )\n      return FT_THROW( Out_Of_Memory );\n\n    *result_file_name = newpath;\n    *result_offset    = 0;\n\n    return FT_Err_Ok;\n  }\n\n\n  static FT_Error\n  raccess_guess_linux_double( FT_Library  library,\n                              FT_Stream   stream,\n                              char       *base_file_name,\n                              char      **result_file_name,\n                              FT_Long    *result_offset )\n  {\n    char*      newpath;\n    FT_Error   error;\n    FT_Memory  memory;\n\n    FT_UNUSED( stream );\n\n\n    memory = library->memory;\n\n    newpath = raccess_make_file_name( memory, base_file_name, \"%\" );\n    if ( !newpath )\n      return FT_THROW( Out_Of_Memory );\n\n    error = raccess_guess_linux_double_from_file_name( library, newpath,\n                                                       result_offset );\n    if ( !error )\n      *result_file_name = newpath;\n    else\n      FT_FREE( newpath );\n\n    return error;\n  }\n\n\n  static FT_Error\n  raccess_guess_linux_netatalk( FT_Library  library,\n                                FT_Stream   stream,\n                                char       *base_file_name,\n                                char      **result_file_name,\n                                FT_Long    *result_offset )\n  {\n    char*      newpath;\n    FT_Error   error;\n    FT_Memory  memory;\n\n    FT_UNUSED( stream );\n\n\n    memory = library->memory;\n\n    newpath = raccess_make_file_name( memory, base_file_name,\n                                      \".AppleDouble/\" );\n    if ( !newpath )\n      return FT_THROW( Out_Of_Memory );\n\n    error = raccess_guess_linux_double_from_file_name( library, newpath,\n                                                       result_offset );\n    if ( !error )\n      *result_file_name = newpath;\n    else\n      FT_FREE( newpath );\n\n    return error;\n  }\n\n\n  static FT_Error\n  raccess_guess_apple_generic( FT_Library  library,\n                               FT_Stream   stream,\n                               char       *base_file_name,\n                               FT_Int32    magic,\n                               FT_Long    *result_offset )\n  {\n    FT_Int32   magic_from_stream;\n    FT_Error   error;\n    FT_Int32   version_number = 0;\n    FT_UShort  n_of_entries;\n\n    int        i;\n    FT_UInt32  entry_id, entry_offset, entry_length = 0;\n\n    const FT_UInt32  resource_fork_entry_id = 0x2;\n\n    FT_UNUSED( library );\n    FT_UNUSED( base_file_name );\n    FT_UNUSED( version_number );\n    FT_UNUSED( entry_length   );\n\n\n    if ( FT_READ_LONG( magic_from_stream ) )\n      return error;\n    if ( magic_from_stream != magic )\n      return FT_THROW( Unknown_File_Format );\n\n    if ( FT_READ_LONG( version_number ) )\n      return error;\n\n    /* filler */\n    error = FT_Stream_Skip( stream, 16 );\n    if ( error )\n      return error;\n\n    if ( FT_READ_USHORT( n_of_entries ) )\n      return error;\n    if ( n_of_entries == 0 )\n      return FT_THROW( Unknown_File_Format );\n\n    for ( i = 0; i < n_of_entries; i++ )\n    {\n      if ( FT_READ_LONG( entry_id ) )\n        return error;\n      if ( entry_id == resource_fork_entry_id )\n      {\n        if ( FT_READ_LONG( entry_offset ) ||\n             FT_READ_LONG( entry_length ) )\n          continue;\n        *result_offset = entry_offset;\n\n        return FT_Err_Ok;\n      }\n      else\n      {\n        error = FT_Stream_Skip( stream, 4 + 4 );    /* offset + length */\n        if ( error )\n          return error;\n      }\n    }\n\n    return FT_THROW( Unknown_File_Format );\n  }\n\n\n  static FT_Error\n  raccess_guess_linux_double_from_file_name( FT_Library  library,\n                                             char       *file_name,\n                                             FT_Long    *result_offset )\n  {\n    FT_Open_Args  args2;\n    FT_Stream     stream2;\n    char *        nouse = NULL;\n    FT_Error      error;\n\n\n    args2.flags    = FT_OPEN_PATHNAME;\n    args2.pathname = file_name;\n    error = FT_Stream_New( library, &args2, &stream2 );\n    if ( error )\n      return error;\n\n    error = raccess_guess_apple_double( library, stream2, file_name,\n                                        &nouse, result_offset );\n\n    FT_Stream_Free( stream2, 0 );\n\n    return error;\n  }\n\n\n  static char*\n  raccess_make_file_name( FT_Memory    memory,\n                          const char  *original_name,\n                          const char  *insertion )\n  {\n    char*        new_name = NULL;\n    const char*  tmp;\n    const char*  slash;\n    size_t       new_length;\n    FT_Error     error = FT_Err_Ok;\n\n    FT_UNUSED( error );\n\n\n    new_length = ft_strlen( original_name ) + ft_strlen( insertion );\n    if ( FT_ALLOC( new_name, new_length + 1 ) )\n      return NULL;\n\n    tmp = ft_strrchr( original_name, '/' );\n    if ( tmp )\n    {\n      ft_strncpy( new_name, original_name, tmp - original_name + 1 );\n      new_name[tmp - original_name + 1] = '\\0';\n      slash = tmp + 1;\n    }\n    else\n    {\n      slash       = original_name;\n      new_name[0] = '\\0';\n    }\n\n    ft_strcat( new_name, insertion );\n    ft_strcat( new_name, slash );\n\n    return new_name;\n  }\n\n\n#else   /* !FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */\n\n\n  /*************************************************************************/\n  /*                  Dummy function; just sets errors                     */\n  /*************************************************************************/\n\n  FT_BASE_DEF( void )\n  FT_Raccess_Guess( FT_Library  library,\n                    FT_Stream   stream,\n                    char       *base_name,\n                    char      **new_names,\n                    FT_Long    *offsets,\n                    FT_Error   *errors )\n  {\n    FT_Int  i;\n\n    FT_UNUSED( library );\n    FT_UNUSED( stream );\n    FT_UNUSED( base_name );\n\n\n    for ( i = 0; i < FT_RACCESS_N_RULES; i++ )\n    {\n      new_names[i] = NULL;\n      offsets[i]   = 0;\n      errors[i]    = FT_ERR( Unimplemented_Feature );\n    }\n  }\n\n\n#endif  /* !FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftsnames.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsnames.c                                                             */\n/*                                                                         */\n/*    Simple interface to access SFNT name tables (which are used          */\n/*    to hold font names, copyright info, notices, etc.) (body).           */\n/*                                                                         */\n/*    This is _not_ used to retrieve glyph names!                          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2009 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_SFNT_NAMES_H\n#include FT_INTERNAL_TRUETYPE_TYPES_H\n#include FT_INTERNAL_STREAM_H\n\n\n#ifdef TT_CONFIG_OPTION_SFNT_NAMES\n\n\n  /* documentation is in ftsnames.h */\n\n  FT_EXPORT_DEF( FT_UInt )\n  FT_Get_Sfnt_Name_Count( FT_Face  face )\n  {\n    return ( face && FT_IS_SFNT( face ) ) ? ((TT_Face)face)->num_names : 0;\n  }\n\n\n  /* documentation is in ftsnames.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Get_Sfnt_Name( FT_Face       face,\n                    FT_UInt       idx,\n                    FT_SfntName  *aname )\n  {\n    FT_Error  error = FT_ERR( Invalid_Argument );\n\n\n    if ( aname && face && FT_IS_SFNT( face ) )\n    {\n      TT_Face  ttface = (TT_Face)face;\n\n\n      if ( idx < (FT_UInt)ttface->num_names )\n      {\n        TT_NameEntryRec*  entry = ttface->name_table.names + idx;\n\n\n        /* load name on demand */\n        if ( entry->stringLength > 0 && entry->string == NULL )\n        {\n          FT_Memory  memory = face->memory;\n          FT_Stream  stream = face->stream;\n\n\n          if ( FT_NEW_ARRAY  ( entry->string, entry->stringLength ) ||\n               FT_STREAM_SEEK( entry->stringOffset )                ||\n               FT_STREAM_READ( entry->string, entry->stringLength ) )\n          {\n            FT_FREE( entry->string );\n            entry->stringLength = 0;\n          }\n        }\n\n        aname->platform_id = entry->platformID;\n        aname->encoding_id = entry->encodingID;\n        aname->language_id = entry->languageID;\n        aname->name_id     = entry->nameID;\n        aname->string      = (FT_Byte*)entry->string;\n        aname->string_len  = entry->stringLength;\n\n        error = FT_Err_Ok;\n      }\n    }\n\n    return error;\n  }\n\n\n#endif /* TT_CONFIG_OPTION_SFNT_NAMES */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftstream.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftstream.c                                                             */\n/*                                                                         */\n/*    I/O stream support (body).                                           */\n/*                                                                         */\n/*  Copyright 2000-2002, 2004-2006, 2008-2011, 2013 by                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_DEBUG_H\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_stream\n\n\n  FT_BASE_DEF( void )\n  FT_Stream_OpenMemory( FT_Stream       stream,\n                        const FT_Byte*  base,\n                        FT_ULong        size )\n  {\n    stream->base   = (FT_Byte*) base;\n    stream->size   = size;\n    stream->pos    = 0;\n    stream->cursor = 0;\n    stream->read   = 0;\n    stream->close  = 0;\n  }\n\n\n  FT_BASE_DEF( void )\n  FT_Stream_Close( FT_Stream  stream )\n  {\n    if ( stream && stream->close )\n      stream->close( stream );\n  }\n\n\n  FT_BASE_DEF( FT_Error )\n  FT_Stream_Seek( FT_Stream  stream,\n                  FT_ULong   pos )\n  {\n    FT_Error  error = FT_Err_Ok;\n\n\n    if ( stream->read )\n    {\n      if ( stream->read( stream, pos, 0, 0 ) )\n      {\n        FT_ERROR(( \"FT_Stream_Seek:\"\n                   \" invalid i/o; pos = 0x%lx, size = 0x%lx\\n\",\n                   pos, stream->size ));\n\n        error = FT_THROW( Invalid_Stream_Operation );\n      }\n    }\n    /* note that seeking to the first position after the file is valid */\n    else if ( pos > stream->size )\n    {\n      FT_ERROR(( \"FT_Stream_Seek:\"\n                 \" invalid i/o; pos = 0x%lx, size = 0x%lx\\n\",\n                 pos, stream->size ));\n\n      error = FT_THROW( Invalid_Stream_Operation );\n    }\n\n    if ( !error )\n      stream->pos = pos;\n\n    return error;\n  }\n\n\n  FT_BASE_DEF( FT_Error )\n  FT_Stream_Skip( FT_Stream  stream,\n                  FT_Long    distance )\n  {\n    if ( distance < 0 )\n      return FT_THROW( Invalid_Stream_Operation );\n\n    return FT_Stream_Seek( stream, (FT_ULong)( stream->pos + distance ) );\n  }\n\n\n  FT_BASE_DEF( FT_Long )\n  FT_Stream_Pos( FT_Stream  stream )\n  {\n    return stream->pos;\n  }\n\n\n  FT_BASE_DEF( FT_Error )\n  FT_Stream_Read( FT_Stream  stream,\n                  FT_Byte*   buffer,\n                  FT_ULong   count )\n  {\n    return FT_Stream_ReadAt( stream, stream->pos, buffer, count );\n  }\n\n\n  FT_BASE_DEF( FT_Error )\n  FT_Stream_ReadAt( FT_Stream  stream,\n                    FT_ULong   pos,\n                    FT_Byte*   buffer,\n                    FT_ULong   count )\n  {\n    FT_Error  error = FT_Err_Ok;\n    FT_ULong  read_bytes;\n\n\n    if ( pos >= stream->size )\n    {\n      FT_ERROR(( \"FT_Stream_ReadAt:\"\n                 \" invalid i/o; pos = 0x%lx, size = 0x%lx\\n\",\n                 pos, stream->size ));\n\n      return FT_THROW( Invalid_Stream_Operation );\n    }\n\n    if ( stream->read )\n      read_bytes = stream->read( stream, pos, buffer, count );\n    else\n    {\n      read_bytes = stream->size - pos;\n      if ( read_bytes > count )\n        read_bytes = count;\n\n      FT_MEM_COPY( buffer, stream->base + pos, read_bytes );\n    }\n\n    stream->pos = pos + read_bytes;\n\n    if ( read_bytes < count )\n    {\n      FT_ERROR(( \"FT_Stream_ReadAt:\"\n                 \" invalid read; expected %lu bytes, got %lu\\n\",\n                 count, read_bytes ));\n\n      error = FT_THROW( Invalid_Stream_Operation );\n    }\n\n    return error;\n  }\n\n\n  FT_BASE_DEF( FT_ULong )\n  FT_Stream_TryRead( FT_Stream  stream,\n                     FT_Byte*   buffer,\n                     FT_ULong   count )\n  {\n    FT_ULong  read_bytes = 0;\n\n\n    if ( stream->pos >= stream->size )\n      goto Exit;\n\n    if ( stream->read )\n      read_bytes = stream->read( stream, stream->pos, buffer, count );\n    else\n    {\n      read_bytes = stream->size - stream->pos;\n      if ( read_bytes > count )\n        read_bytes = count;\n\n      FT_MEM_COPY( buffer, stream->base + stream->pos, read_bytes );\n    }\n\n    stream->pos += read_bytes;\n\n  Exit:\n    return read_bytes;\n  }\n\n\n  FT_BASE_DEF( FT_Error )\n  FT_Stream_ExtractFrame( FT_Stream  stream,\n                          FT_ULong   count,\n                          FT_Byte**  pbytes )\n  {\n    FT_Error  error;\n\n\n    error = FT_Stream_EnterFrame( stream, count );\n    if ( !error )\n    {\n      *pbytes = (FT_Byte*)stream->cursor;\n\n      /* equivalent to FT_Stream_ExitFrame(), with no memory block release */\n      stream->cursor = 0;\n      stream->limit  = 0;\n    }\n\n    return error;\n  }\n\n\n  FT_BASE_DEF( void )\n  FT_Stream_ReleaseFrame( FT_Stream  stream,\n                          FT_Byte**  pbytes )\n  {\n    if ( stream && stream->read )\n    {\n      FT_Memory  memory = stream->memory;\n\n#ifdef FT_DEBUG_MEMORY\n      ft_mem_free( memory, *pbytes );\n      *pbytes = NULL;\n#else\n      FT_FREE( *pbytes );\n#endif\n    }\n    *pbytes = 0;\n  }\n\n\n  FT_BASE_DEF( FT_Error )\n  FT_Stream_EnterFrame( FT_Stream  stream,\n                        FT_ULong   count )\n  {\n    FT_Error  error = FT_Err_Ok;\n    FT_ULong  read_bytes;\n\n\n    /* check for nested frame access */\n    FT_ASSERT( stream && stream->cursor == 0 );\n\n    if ( stream->read )\n    {\n      /* allocate the frame in memory */\n      FT_Memory  memory = stream->memory;\n\n\n      /* simple sanity check */\n      if ( count > stream->size )\n      {\n        FT_ERROR(( \"FT_Stream_EnterFrame:\"\n                   \" frame size (%lu) larger than stream size (%lu)\\n\",\n                   count, stream->size ));\n\n        error = FT_THROW( Invalid_Stream_Operation );\n        goto Exit;\n      }\n\n#ifdef FT_DEBUG_MEMORY\n      /* assume _ft_debug_file and _ft_debug_lineno are already set */\n      stream->base = (unsigned char*)ft_mem_qalloc( memory, count, &error );\n      if ( error )\n        goto Exit;\n#else\n      if ( FT_QALLOC( stream->base, count ) )\n        goto Exit;\n#endif\n      /* read it */\n      read_bytes = stream->read( stream, stream->pos,\n                                 stream->base, count );\n      if ( read_bytes < count )\n      {\n        FT_ERROR(( \"FT_Stream_EnterFrame:\"\n                   \" invalid read; expected %lu bytes, got %lu\\n\",\n                   count, read_bytes ));\n\n        FT_FREE( stream->base );\n        error = FT_THROW( Invalid_Stream_Operation );\n      }\n      stream->cursor = stream->base;\n      stream->limit  = stream->cursor + count;\n      stream->pos   += read_bytes;\n    }\n    else\n    {\n      /* check current and new position */\n      if ( stream->pos >= stream->size        ||\n           stream->size - stream->pos < count )\n      {\n        FT_ERROR(( \"FT_Stream_EnterFrame:\"\n                   \" invalid i/o; pos = 0x%lx, count = %lu, size = 0x%lx\\n\",\n                   stream->pos, count, stream->size ));\n\n        error = FT_THROW( Invalid_Stream_Operation );\n        goto Exit;\n      }\n\n      /* set cursor */\n      stream->cursor = stream->base + stream->pos;\n      stream->limit  = stream->cursor + count;\n      stream->pos   += count;\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  FT_BASE_DEF( void )\n  FT_Stream_ExitFrame( FT_Stream  stream )\n  {\n    /* IMPORTANT: The assertion stream->cursor != 0 was removed, given    */\n    /*            that it is possible to access a frame of length 0 in    */\n    /*            some weird fonts (usually, when accessing an array of   */\n    /*            0 records, like in some strange kern tables).           */\n    /*                                                                    */\n    /*  In this case, the loader code handles the 0-length table          */\n    /*  gracefully; however, stream.cursor is really set to 0 by the      */\n    /*  FT_Stream_EnterFrame() call, and this is not an error.            */\n    /*                                                                    */\n    FT_ASSERT( stream );\n\n    if ( stream->read )\n    {\n      FT_Memory  memory = stream->memory;\n\n#ifdef FT_DEBUG_MEMORY\n      ft_mem_free( memory, stream->base );\n      stream->base = NULL;\n#else\n      FT_FREE( stream->base );\n#endif\n    }\n    stream->cursor = 0;\n    stream->limit  = 0;\n  }\n\n\n  FT_BASE_DEF( FT_Char )\n  FT_Stream_GetChar( FT_Stream  stream )\n  {\n    FT_Char  result;\n\n\n    FT_ASSERT( stream && stream->cursor );\n\n    result = 0;\n    if ( stream->cursor < stream->limit )\n      result = *stream->cursor++;\n\n    return result;\n  }\n\n\n  FT_BASE_DEF( FT_UShort )\n  FT_Stream_GetUShort( FT_Stream  stream )\n  {\n    FT_Byte*  p;\n    FT_Short  result;\n\n\n    FT_ASSERT( stream && stream->cursor );\n\n    result         = 0;\n    p              = stream->cursor;\n    if ( p + 1 < stream->limit )\n      result       = FT_NEXT_USHORT( p );\n    stream->cursor = p;\n\n    return result;\n  }\n\n\n  FT_BASE_DEF( FT_UShort )\n  FT_Stream_GetUShortLE( FT_Stream  stream )\n  {\n    FT_Byte*  p;\n    FT_Short  result;\n\n\n    FT_ASSERT( stream && stream->cursor );\n\n    result         = 0;\n    p              = stream->cursor;\n    if ( p + 1 < stream->limit )\n      result       = FT_NEXT_USHORT_LE( p );\n    stream->cursor = p;\n\n    return result;\n  }\n\n\n  FT_BASE_DEF( FT_ULong )\n  FT_Stream_GetUOffset( FT_Stream  stream )\n  {\n    FT_Byte*  p;\n    FT_Long   result;\n\n\n    FT_ASSERT( stream && stream->cursor );\n\n    result         = 0;\n    p              = stream->cursor;\n    if ( p + 2 < stream->limit )\n      result       = FT_NEXT_UOFF3( p );\n    stream->cursor = p;\n    return result;\n  }\n\n\n  FT_BASE_DEF( FT_ULong )\n  FT_Stream_GetULong( FT_Stream  stream )\n  {\n    FT_Byte*  p;\n    FT_Long   result;\n\n\n    FT_ASSERT( stream && stream->cursor );\n\n    result         = 0;\n    p              = stream->cursor;\n    if ( p + 3 < stream->limit )\n      result       = FT_NEXT_ULONG( p );\n    stream->cursor = p;\n    return result;\n  }\n\n\n  FT_BASE_DEF( FT_ULong )\n  FT_Stream_GetULongLE( FT_Stream  stream )\n  {\n    FT_Byte*  p;\n    FT_Long   result;\n\n\n    FT_ASSERT( stream && stream->cursor );\n\n    result         = 0;\n    p              = stream->cursor;\n    if ( p + 3 < stream->limit )\n      result       = FT_NEXT_ULONG_LE( p );\n    stream->cursor = p;\n    return result;\n  }\n\n\n  FT_BASE_DEF( FT_Char )\n  FT_Stream_ReadChar( FT_Stream  stream,\n                      FT_Error*  error )\n  {\n    FT_Byte  result = 0;\n\n\n    FT_ASSERT( stream );\n\n    *error = FT_Err_Ok;\n\n    if ( stream->read )\n    {\n      if ( stream->read( stream, stream->pos, &result, 1L ) != 1L )\n        goto Fail;\n    }\n    else\n    {\n      if ( stream->pos < stream->size )\n        result = stream->base[stream->pos];\n      else\n        goto Fail;\n    }\n    stream->pos++;\n\n    return result;\n\n  Fail:\n    *error = FT_THROW( Invalid_Stream_Operation );\n    FT_ERROR(( \"FT_Stream_ReadChar:\"\n               \" invalid i/o; pos = 0x%lx, size = 0x%lx\\n\",\n               stream->pos, stream->size ));\n\n    return 0;\n  }\n\n\n  FT_BASE_DEF( FT_UShort )\n  FT_Stream_ReadUShort( FT_Stream  stream,\n                       FT_Error*  error )\n  {\n    FT_Byte   reads[2];\n    FT_Byte*  p = 0;\n    FT_Short  result = 0;\n\n\n    FT_ASSERT( stream );\n\n    *error = FT_Err_Ok;\n\n    if ( stream->pos + 1 < stream->size )\n    {\n      if ( stream->read )\n      {\n        if ( stream->read( stream, stream->pos, reads, 2L ) != 2L )\n          goto Fail;\n\n        p = reads;\n      }\n      else\n      {\n        p = stream->base + stream->pos;\n      }\n\n      if ( p )\n        result = FT_NEXT_USHORT( p );\n    }\n    else\n      goto Fail;\n\n    stream->pos += 2;\n\n    return result;\n\n  Fail:\n    *error = FT_THROW( Invalid_Stream_Operation );\n    FT_ERROR(( \"FT_Stream_ReadUShort:\"\n               \" invalid i/o; pos = 0x%lx, size = 0x%lx\\n\",\n               stream->pos, stream->size ));\n\n    return 0;\n  }\n\n\n  FT_BASE_DEF( FT_UShort )\n  FT_Stream_ReadUShortLE( FT_Stream  stream,\n                         FT_Error*  error )\n  {\n    FT_Byte   reads[2];\n    FT_Byte*  p = 0;\n    FT_Short  result = 0;\n\n\n    FT_ASSERT( stream );\n\n    *error = FT_Err_Ok;\n\n    if ( stream->pos + 1 < stream->size )\n    {\n      if ( stream->read )\n      {\n        if ( stream->read( stream, stream->pos, reads, 2L ) != 2L )\n          goto Fail;\n\n        p = reads;\n      }\n      else\n      {\n        p = stream->base + stream->pos;\n      }\n\n      if ( p )\n        result = FT_NEXT_USHORT_LE( p );\n    }\n    else\n      goto Fail;\n\n    stream->pos += 2;\n\n    return result;\n\n  Fail:\n    *error = FT_THROW( Invalid_Stream_Operation );\n    FT_ERROR(( \"FT_Stream_ReadUShortLE:\"\n               \" invalid i/o; pos = 0x%lx, size = 0x%lx\\n\",\n               stream->pos, stream->size ));\n\n    return 0;\n  }\n\n\n  FT_BASE_DEF( FT_ULong )\n  FT_Stream_ReadUOffset( FT_Stream  stream,\n                        FT_Error*  error )\n  {\n    FT_Byte   reads[3];\n    FT_Byte*  p = 0;\n    FT_Long   result = 0;\n\n\n    FT_ASSERT( stream );\n\n    *error = FT_Err_Ok;\n\n    if ( stream->pos + 2 < stream->size )\n    {\n      if ( stream->read )\n      {\n        if (stream->read( stream, stream->pos, reads, 3L ) != 3L )\n          goto Fail;\n\n        p = reads;\n      }\n      else\n      {\n        p = stream->base + stream->pos;\n      }\n\n      if ( p )\n        result = FT_NEXT_UOFF3( p );\n    }\n    else\n      goto Fail;\n\n    stream->pos += 3;\n\n    return result;\n\n  Fail:\n    *error = FT_THROW( Invalid_Stream_Operation );\n    FT_ERROR(( \"FT_Stream_ReadUOffset:\"\n               \" invalid i/o; pos = 0x%lx, size = 0x%lx\\n\",\n               stream->pos, stream->size ));\n\n    return 0;\n  }\n\n\n  FT_BASE_DEF( FT_ULong )\n  FT_Stream_ReadULong( FT_Stream  stream,\n                      FT_Error*  error )\n  {\n    FT_Byte   reads[4];\n    FT_Byte*  p = 0;\n    FT_Long   result = 0;\n\n\n    FT_ASSERT( stream );\n\n    *error = FT_Err_Ok;\n\n    if ( stream->pos + 3 < stream->size )\n    {\n      if ( stream->read )\n      {\n        if ( stream->read( stream, stream->pos, reads, 4L ) != 4L )\n          goto Fail;\n\n        p = reads;\n      }\n      else\n      {\n        p = stream->base + stream->pos;\n      }\n\n      if ( p )\n        result = FT_NEXT_ULONG( p );\n    }\n    else\n      goto Fail;\n\n    stream->pos += 4;\n\n    return result;\n\n  Fail:\n    *error = FT_THROW( Invalid_Stream_Operation );\n    FT_ERROR(( \"FT_Stream_ReadULong:\"\n               \" invalid i/o; pos = 0x%lx, size = 0x%lx\\n\",\n               stream->pos, stream->size ));\n\n    return 0;\n  }\n\n\n  FT_BASE_DEF( FT_ULong )\n  FT_Stream_ReadULongLE( FT_Stream  stream,\n                        FT_Error*  error )\n  {\n    FT_Byte   reads[4];\n    FT_Byte*  p = 0;\n    FT_Long   result = 0;\n\n\n    FT_ASSERT( stream );\n\n    *error = FT_Err_Ok;\n\n    if ( stream->pos + 3 < stream->size )\n    {\n      if ( stream->read )\n      {\n        if ( stream->read( stream, stream->pos, reads, 4L ) != 4L )\n          goto Fail;\n\n        p = reads;\n      }\n      else\n      {\n        p = stream->base + stream->pos;\n      }\n\n      if ( p )\n        result = FT_NEXT_ULONG_LE( p );\n    }\n    else\n      goto Fail;\n\n    stream->pos += 4;\n\n    return result;\n\n  Fail:\n    *error = FT_THROW( Invalid_Stream_Operation );\n    FT_ERROR(( \"FT_Stream_ReadULongLE:\"\n               \" invalid i/o; pos = 0x%lx, size = 0x%lx\\n\",\n               stream->pos, stream->size ));\n\n    return 0;\n  }\n\n\n  FT_BASE_DEF( FT_Error )\n  FT_Stream_ReadFields( FT_Stream              stream,\n                        const FT_Frame_Field*  fields,\n                        void*                  structure )\n  {\n    FT_Error  error;\n    FT_Bool   frame_accessed = 0;\n    FT_Byte*  cursor;\n\n\n    if ( !fields )\n      return FT_THROW( Invalid_Argument );\n\n    if ( !stream )\n      return FT_THROW( Invalid_Stream_Handle );\n\n    cursor = stream->cursor;\n\n    error = FT_Err_Ok;\n    do\n    {\n      FT_ULong  value;\n      FT_Int    sign_shift;\n      FT_Byte*  p;\n\n\n      switch ( fields->value )\n      {\n      case ft_frame_start:  /* access a new frame */\n        error = FT_Stream_EnterFrame( stream, fields->offset );\n        if ( error )\n          goto Exit;\n\n        frame_accessed = 1;\n        cursor         = stream->cursor;\n        fields++;\n        continue;  /* loop! */\n\n      case ft_frame_bytes:  /* read a byte sequence */\n      case ft_frame_skip:   /* skip some bytes      */\n        {\n          FT_UInt  len = fields->size;\n\n\n          if ( cursor + len > stream->limit )\n          {\n            error = FT_THROW( Invalid_Stream_Operation );\n            goto Exit;\n          }\n\n          if ( fields->value == ft_frame_bytes )\n          {\n            p = (FT_Byte*)structure + fields->offset;\n            FT_MEM_COPY( p, cursor, len );\n          }\n          cursor += len;\n          fields++;\n          continue;\n        }\n\n      case ft_frame_byte:\n      case ft_frame_schar:  /* read a single byte */\n        value = FT_NEXT_BYTE( cursor );\n        sign_shift = 24;\n        break;\n\n      case ft_frame_short_be:\n      case ft_frame_ushort_be:  /* read a 2-byte big-endian short */\n        value = FT_NEXT_USHORT( cursor) ;\n        sign_shift = 16;\n        break;\n\n      case ft_frame_short_le:\n      case ft_frame_ushort_le:  /* read a 2-byte little-endian short */\n        value = FT_NEXT_USHORT_LE( cursor );\n        sign_shift = 16;\n        break;\n\n      case ft_frame_long_be:\n      case ft_frame_ulong_be:  /* read a 4-byte big-endian long */\n        value = FT_NEXT_ULONG( cursor );\n        sign_shift = 0;\n        break;\n\n      case ft_frame_long_le:\n      case ft_frame_ulong_le:  /* read a 4-byte little-endian long */\n        value = FT_NEXT_ULONG_LE( cursor );\n        sign_shift = 0;\n        break;\n\n      case ft_frame_off3_be:\n      case ft_frame_uoff3_be:  /* read a 3-byte big-endian long */\n        value = FT_NEXT_UOFF3( cursor );\n        sign_shift = 8;\n        break;\n\n      case ft_frame_off3_le:\n      case ft_frame_uoff3_le:  /* read a 3-byte little-endian long */\n        value = FT_NEXT_UOFF3_LE( cursor );\n        sign_shift = 8;\n        break;\n\n      default:\n        /* otherwise, exit the loop */\n        stream->cursor = cursor;\n        goto Exit;\n      }\n\n      /* now, compute the signed value is necessary */\n      if ( fields->value & FT_FRAME_OP_SIGNED )\n        value = (FT_ULong)( (FT_Int32)( value << sign_shift ) >> sign_shift );\n\n      /* finally, store the value in the object */\n\n      p = (FT_Byte*)structure + fields->offset;\n      switch ( fields->size )\n      {\n      case ( 8 / FT_CHAR_BIT ):\n        *(FT_Byte*)p = (FT_Byte)value;\n        break;\n\n      case ( 16 / FT_CHAR_BIT ):\n        *(FT_UShort*)p = (FT_UShort)value;\n        break;\n\n      case ( 32 / FT_CHAR_BIT ):\n        *(FT_UInt32*)p = (FT_UInt32)value;\n        break;\n\n      default:  /* for 64-bit systems */\n        *(FT_ULong*)p = (FT_ULong)value;\n      }\n\n      /* go to next field */\n      fields++;\n    }\n    while ( 1 );\n\n  Exit:\n    /* close the frame if it was opened by this read */\n    if ( frame_accessed )\n      FT_Stream_ExitFrame( stream );\n\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftstroke.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftstroke.c                                                             */\n/*                                                                         */\n/*    FreeType path stroker (body).                                        */\n/*                                                                         */\n/*  Copyright 2002-2006, 2008-2011, 2013, 2014 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_STROKER_H\n#include FT_TRIGONOMETRY_H\n#include FT_OUTLINE_H\n#include FT_INTERNAL_MEMORY_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_OBJECTS_H\n\n\n  /* documentation is in ftstroke.h */\n\n  FT_EXPORT_DEF( FT_StrokerBorder )\n  FT_Outline_GetInsideBorder( FT_Outline*  outline )\n  {\n    FT_Orientation  o = FT_Outline_Get_Orientation( outline );\n\n\n    return o == FT_ORIENTATION_TRUETYPE ? FT_STROKER_BORDER_RIGHT\n                                        : FT_STROKER_BORDER_LEFT;\n  }\n\n\n  /* documentation is in ftstroke.h */\n\n  FT_EXPORT_DEF( FT_StrokerBorder )\n  FT_Outline_GetOutsideBorder( FT_Outline*  outline )\n  {\n    FT_Orientation  o = FT_Outline_Get_Orientation( outline );\n\n\n    return o == FT_ORIENTATION_TRUETYPE ? FT_STROKER_BORDER_LEFT\n                                        : FT_STROKER_BORDER_RIGHT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      BEZIER COMPUTATIONS                      *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#define FT_SMALL_CONIC_THRESHOLD  ( FT_ANGLE_PI / 6 )\n#define FT_SMALL_CUBIC_THRESHOLD  ( FT_ANGLE_PI / 8 )\n\n#define FT_EPSILON  2\n\n#define FT_IS_SMALL( x )  ( (x) > -FT_EPSILON && (x) < FT_EPSILON )\n\n\n  static FT_Pos\n  ft_pos_abs( FT_Pos  x )\n  {\n    return x >= 0 ? x : -x;\n  }\n\n\n  static void\n  ft_conic_split( FT_Vector*  base )\n  {\n    FT_Pos  a, b;\n\n\n    base[4].x = base[2].x;\n    b = base[1].x;\n    a = base[3].x = ( base[2].x + b ) / 2;\n    b = base[1].x = ( base[0].x + b ) / 2;\n    base[2].x = ( a + b ) / 2;\n\n    base[4].y = base[2].y;\n    b = base[1].y;\n    a = base[3].y = ( base[2].y + b ) / 2;\n    b = base[1].y = ( base[0].y + b ) / 2;\n    base[2].y = ( a + b ) / 2;\n  }\n\n\n  static FT_Bool\n  ft_conic_is_small_enough( FT_Vector*  base,\n                            FT_Angle   *angle_in,\n                            FT_Angle   *angle_out )\n  {\n    FT_Vector  d1, d2;\n    FT_Angle   theta;\n    FT_Int     close1, close2;\n\n\n    d1.x = base[1].x - base[2].x;\n    d1.y = base[1].y - base[2].y;\n    d2.x = base[0].x - base[1].x;\n    d2.y = base[0].y - base[1].y;\n\n    close1 = FT_IS_SMALL( d1.x ) && FT_IS_SMALL( d1.y );\n    close2 = FT_IS_SMALL( d2.x ) && FT_IS_SMALL( d2.y );\n\n    if ( close1 )\n    {\n      if ( close2 )\n      {\n        /* basically a point;                      */\n        /* do nothing to retain original direction */\n      }\n      else\n      {\n        *angle_in  =\n        *angle_out = FT_Atan2( d2.x, d2.y );\n      }\n    }\n    else /* !close1 */\n    {\n      if ( close2 )\n      {\n        *angle_in  =\n        *angle_out = FT_Atan2( d1.x, d1.y );\n      }\n      else\n      {\n        *angle_in  = FT_Atan2( d1.x, d1.y );\n        *angle_out = FT_Atan2( d2.x, d2.y );\n      }\n    }\n\n    theta = ft_pos_abs( FT_Angle_Diff( *angle_in, *angle_out ) );\n\n    return FT_BOOL( theta < FT_SMALL_CONIC_THRESHOLD );\n  }\n\n\n  static void\n  ft_cubic_split( FT_Vector*  base )\n  {\n    FT_Pos  a, b, c, d;\n\n\n    base[6].x = base[3].x;\n    c = base[1].x;\n    d = base[2].x;\n    base[1].x = a = ( base[0].x + c ) / 2;\n    base[5].x = b = ( base[3].x + d ) / 2;\n    c = ( c + d ) / 2;\n    base[2].x = a = ( a + c ) / 2;\n    base[4].x = b = ( b + c ) / 2;\n    base[3].x = ( a + b ) / 2;\n\n    base[6].y = base[3].y;\n    c = base[1].y;\n    d = base[2].y;\n    base[1].y = a = ( base[0].y + c ) / 2;\n    base[5].y = b = ( base[3].y + d ) / 2;\n    c = ( c + d ) / 2;\n    base[2].y = a = ( a + c ) / 2;\n    base[4].y = b = ( b + c ) / 2;\n    base[3].y = ( a + b ) / 2;\n  }\n\n\n  /* Return the average of `angle1' and `angle2'.            */\n  /* This gives correct result even if `angle1' and `angle2' */\n  /* have opposite signs.                                    */\n  static FT_Angle\n  ft_angle_mean( FT_Angle  angle1,\n                 FT_Angle  angle2 )\n  {\n    return angle1 + FT_Angle_Diff( angle1, angle2 ) / 2;\n  }\n\n\n  static FT_Bool\n  ft_cubic_is_small_enough( FT_Vector*  base,\n                            FT_Angle   *angle_in,\n                            FT_Angle   *angle_mid,\n                            FT_Angle   *angle_out )\n  {\n    FT_Vector  d1, d2, d3;\n    FT_Angle   theta1, theta2;\n    FT_Int     close1, close2, close3;\n\n\n    d1.x = base[2].x - base[3].x;\n    d1.y = base[2].y - base[3].y;\n    d2.x = base[1].x - base[2].x;\n    d2.y = base[1].y - base[2].y;\n    d3.x = base[0].x - base[1].x;\n    d3.y = base[0].y - base[1].y;\n\n    close1 = FT_IS_SMALL( d1.x ) && FT_IS_SMALL( d1.y );\n    close2 = FT_IS_SMALL( d2.x ) && FT_IS_SMALL( d2.y );\n    close3 = FT_IS_SMALL( d3.x ) && FT_IS_SMALL( d3.y );\n\n    if ( close1 )\n    {\n      if ( close2 )\n      {\n        if ( close3 )\n        {\n          /* basically a point;                      */\n          /* do nothing to retain original direction */\n        }\n        else /* !close3 */\n        {\n          *angle_in  =\n          *angle_mid =\n          *angle_out = FT_Atan2( d3.x, d3.y );\n        }\n      }\n      else /* !close2 */\n      {\n        if ( close3 )\n        {\n          *angle_in  =\n          *angle_mid =\n          *angle_out = FT_Atan2( d2.x, d2.y );\n        }\n        else /* !close3 */\n        {\n          *angle_in  =\n          *angle_mid = FT_Atan2( d2.x, d2.y );\n          *angle_out = FT_Atan2( d3.x, d3.y );\n        }\n      }\n    }\n    else /* !close1 */\n    {\n      if ( close2 )\n      {\n        if ( close3 )\n        {\n          *angle_in  =\n          *angle_mid =\n          *angle_out = FT_Atan2( d1.x, d1.y );\n        }\n        else /* !close3 */\n        {\n          *angle_in  = FT_Atan2( d1.x, d1.y );\n          *angle_out = FT_Atan2( d3.x, d3.y );\n          *angle_mid = ft_angle_mean( *angle_in, *angle_out );\n        }\n      }\n      else /* !close2 */\n      {\n        if ( close3 )\n        {\n          *angle_in  = FT_Atan2( d1.x, d1.y );\n          *angle_mid =\n          *angle_out = FT_Atan2( d2.x, d2.y );\n        }\n        else /* !close3 */\n        {\n          *angle_in  = FT_Atan2( d1.x, d1.y );\n          *angle_mid = FT_Atan2( d2.x, d2.y );\n          *angle_out = FT_Atan2( d3.x, d3.y );\n        }\n      }\n    }\n\n    theta1 = ft_pos_abs( FT_Angle_Diff( *angle_in,  *angle_mid ) );\n    theta2 = ft_pos_abs( FT_Angle_Diff( *angle_mid, *angle_out ) );\n\n    return FT_BOOL( theta1 < FT_SMALL_CUBIC_THRESHOLD &&\n                    theta2 < FT_SMALL_CUBIC_THRESHOLD );\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       STROKE BORDERS                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef enum  FT_StrokeTags_\n  {\n    FT_STROKE_TAG_ON    = 1,   /* on-curve point  */\n    FT_STROKE_TAG_CUBIC = 2,   /* cubic off-point */\n    FT_STROKE_TAG_BEGIN = 4,   /* sub-path start  */\n    FT_STROKE_TAG_END   = 8    /* sub-path end    */\n\n  } FT_StrokeTags;\n\n#define  FT_STROKE_TAG_BEGIN_END  ( FT_STROKE_TAG_BEGIN | FT_STROKE_TAG_END )\n\n  typedef struct  FT_StrokeBorderRec_\n  {\n    FT_UInt     num_points;\n    FT_UInt     max_points;\n    FT_Vector*  points;\n    FT_Byte*    tags;\n    FT_Bool     movable;  /* TRUE for ends of lineto borders */\n    FT_Int      start;    /* index of current sub-path start point */\n    FT_Memory   memory;\n    FT_Bool     valid;\n\n  } FT_StrokeBorderRec, *FT_StrokeBorder;\n\n\n  static FT_Error\n  ft_stroke_border_grow( FT_StrokeBorder  border,\n                         FT_UInt          new_points )\n  {\n    FT_UInt   old_max = border->max_points;\n    FT_UInt   new_max = border->num_points + new_points;\n    FT_Error  error   = FT_Err_Ok;\n\n\n    if ( new_max > old_max )\n    {\n      FT_UInt    cur_max = old_max;\n      FT_Memory  memory  = border->memory;\n\n\n      while ( cur_max < new_max )\n        cur_max += ( cur_max >> 1 ) + 16;\n\n      if ( FT_RENEW_ARRAY( border->points, old_max, cur_max ) ||\n           FT_RENEW_ARRAY( border->tags,   old_max, cur_max ) )\n        goto Exit;\n\n      border->max_points = cur_max;\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  static void\n  ft_stroke_border_close( FT_StrokeBorder  border,\n                          FT_Bool          reverse )\n  {\n    FT_UInt  start = border->start;\n    FT_UInt  count = border->num_points;\n\n\n    FT_ASSERT( border->start >= 0 );\n\n    /* don't record empty paths! */\n    if ( count <= start + 1U )\n      border->num_points = start;\n    else\n    {\n      /* copy the last point to the start of this sub-path, since */\n      /* it contains the `adjusted' starting coordinates          */\n      border->num_points    = --count;\n      border->points[start] = border->points[count];\n\n      if ( reverse )\n      {\n        /* reverse the points */\n        {\n          FT_Vector*  vec1 = border->points + start + 1;\n          FT_Vector*  vec2 = border->points + count - 1;\n\n\n          for ( ; vec1 < vec2; vec1++, vec2-- )\n          {\n            FT_Vector  tmp;\n\n\n            tmp   = *vec1;\n            *vec1 = *vec2;\n            *vec2 = tmp;\n          }\n        }\n\n        /* then the tags */\n        {\n          FT_Byte*  tag1 = border->tags + start + 1;\n          FT_Byte*  tag2 = border->tags + count - 1;\n\n\n          for ( ; tag1 < tag2; tag1++, tag2-- )\n          {\n            FT_Byte  tmp;\n\n\n            tmp   = *tag1;\n            *tag1 = *tag2;\n            *tag2 = tmp;\n          }\n        }\n      }\n\n      border->tags[start    ] |= FT_STROKE_TAG_BEGIN;\n      border->tags[count - 1] |= FT_STROKE_TAG_END;\n    }\n\n    border->start   = -1;\n    border->movable = FALSE;\n  }\n\n\n  static FT_Error\n  ft_stroke_border_lineto( FT_StrokeBorder  border,\n                           FT_Vector*       to,\n                           FT_Bool          movable )\n  {\n    FT_Error  error = FT_Err_Ok;\n\n\n    FT_ASSERT( border->start >= 0 );\n\n    if ( border->movable )\n    {\n      /* move last point */\n      border->points[border->num_points - 1] = *to;\n    }\n    else\n    {\n      /* don't add zero-length lineto */\n      if ( border->num_points > 0                                          &&\n           FT_IS_SMALL( border->points[border->num_points - 1].x - to->x ) &&\n           FT_IS_SMALL( border->points[border->num_points - 1].y - to->y ) )\n        return error;\n\n      /* add one point */\n      error = ft_stroke_border_grow( border, 1 );\n      if ( !error )\n      {\n        FT_Vector*  vec = border->points + border->num_points;\n        FT_Byte*    tag = border->tags   + border->num_points;\n\n\n        vec[0] = *to;\n        tag[0] = FT_STROKE_TAG_ON;\n\n        border->num_points += 1;\n      }\n    }\n    border->movable = movable;\n    return error;\n  }\n\n\n  static FT_Error\n  ft_stroke_border_conicto( FT_StrokeBorder  border,\n                            FT_Vector*       control,\n                            FT_Vector*       to )\n  {\n    FT_Error  error;\n\n\n    FT_ASSERT( border->start >= 0 );\n\n    error = ft_stroke_border_grow( border, 2 );\n    if ( !error )\n    {\n      FT_Vector*  vec = border->points + border->num_points;\n      FT_Byte*    tag = border->tags   + border->num_points;\n\n\n      vec[0] = *control;\n      vec[1] = *to;\n\n      tag[0] = 0;\n      tag[1] = FT_STROKE_TAG_ON;\n\n      border->num_points += 2;\n    }\n\n    border->movable = FALSE;\n\n    return error;\n  }\n\n\n  static FT_Error\n  ft_stroke_border_cubicto( FT_StrokeBorder  border,\n                            FT_Vector*       control1,\n                            FT_Vector*       control2,\n                            FT_Vector*       to )\n  {\n    FT_Error  error;\n\n\n    FT_ASSERT( border->start >= 0 );\n\n    error = ft_stroke_border_grow( border, 3 );\n    if ( !error )\n    {\n      FT_Vector*  vec = border->points + border->num_points;\n      FT_Byte*    tag = border->tags   + border->num_points;\n\n\n      vec[0] = *control1;\n      vec[1] = *control2;\n      vec[2] = *to;\n\n      tag[0] = FT_STROKE_TAG_CUBIC;\n      tag[1] = FT_STROKE_TAG_CUBIC;\n      tag[2] = FT_STROKE_TAG_ON;\n\n      border->num_points += 3;\n    }\n\n    border->movable = FALSE;\n\n    return error;\n  }\n\n\n#define FT_ARC_CUBIC_ANGLE  ( FT_ANGLE_PI / 2 )\n\n\n  static FT_Error\n  ft_stroke_border_arcto( FT_StrokeBorder  border,\n                          FT_Vector*       center,\n                          FT_Fixed         radius,\n                          FT_Angle         angle_start,\n                          FT_Angle         angle_diff )\n  {\n    FT_Angle   total, angle, step, rotate, next, theta;\n    FT_Vector  a, b, a2, b2;\n    FT_Fixed   length;\n    FT_Error   error = FT_Err_Ok;\n\n\n    /* compute start point */\n    FT_Vector_From_Polar( &a, radius, angle_start );\n    a.x += center->x;\n    a.y += center->y;\n\n    total  = angle_diff;\n    angle  = angle_start;\n    rotate = ( angle_diff >= 0 ) ? FT_ANGLE_PI2 : -FT_ANGLE_PI2;\n\n    while ( total != 0 )\n    {\n      step = total;\n      if ( step > FT_ARC_CUBIC_ANGLE )\n        step = FT_ARC_CUBIC_ANGLE;\n\n      else if ( step < -FT_ARC_CUBIC_ANGLE )\n        step = -FT_ARC_CUBIC_ANGLE;\n\n      next  = angle + step;\n      theta = step;\n      if ( theta < 0 )\n        theta = -theta;\n\n      theta >>= 1;\n\n      /* compute end point */\n      FT_Vector_From_Polar( &b, radius, next );\n      b.x += center->x;\n      b.y += center->y;\n\n      /* compute first and second control points */\n      length = FT_MulDiv( radius, FT_Sin( theta ) * 4,\n                          ( 0x10000L + FT_Cos( theta ) ) * 3 );\n\n      FT_Vector_From_Polar( &a2, length, angle + rotate );\n      a2.x += a.x;\n      a2.y += a.y;\n\n      FT_Vector_From_Polar( &b2, length, next - rotate );\n      b2.x += b.x;\n      b2.y += b.y;\n\n      /* add cubic arc */\n      error = ft_stroke_border_cubicto( border, &a2, &b2, &b );\n      if ( error )\n        break;\n\n      /* process the rest of the arc ?? */\n      a      = b;\n      total -= step;\n      angle  = next;\n    }\n\n    return error;\n  }\n\n\n  static FT_Error\n  ft_stroke_border_moveto( FT_StrokeBorder  border,\n                           FT_Vector*       to )\n  {\n    /* close current open path if any ? */\n    if ( border->start >= 0 )\n      ft_stroke_border_close( border, FALSE );\n\n    border->start = border->num_points;\n    border->movable = FALSE;\n\n    return ft_stroke_border_lineto( border, to, FALSE );\n  }\n\n\n  static void\n  ft_stroke_border_init( FT_StrokeBorder  border,\n                         FT_Memory        memory )\n  {\n    border->memory = memory;\n    border->points = NULL;\n    border->tags   = NULL;\n\n    border->num_points = 0;\n    border->max_points = 0;\n    border->start      = -1;\n    border->valid      = FALSE;\n  }\n\n\n  static void\n  ft_stroke_border_reset( FT_StrokeBorder  border )\n  {\n    border->num_points = 0;\n    border->start      = -1;\n    border->valid      = FALSE;\n  }\n\n\n  static void\n  ft_stroke_border_done( FT_StrokeBorder  border )\n  {\n    FT_Memory  memory = border->memory;\n\n\n    FT_FREE( border->points );\n    FT_FREE( border->tags );\n\n    border->num_points = 0;\n    border->max_points = 0;\n    border->start      = -1;\n    border->valid      = FALSE;\n  }\n\n\n  static FT_Error\n  ft_stroke_border_get_counts( FT_StrokeBorder  border,\n                               FT_UInt         *anum_points,\n                               FT_UInt         *anum_contours )\n  {\n    FT_Error  error        = FT_Err_Ok;\n    FT_UInt   num_points   = 0;\n    FT_UInt   num_contours = 0;\n\n    FT_UInt     count      = border->num_points;\n    FT_Vector*  point      = border->points;\n    FT_Byte*    tags       = border->tags;\n    FT_Int      in_contour = 0;\n\n\n    for ( ; count > 0; count--, num_points++, point++, tags++ )\n    {\n      if ( tags[0] & FT_STROKE_TAG_BEGIN )\n      {\n        if ( in_contour != 0 )\n          goto Fail;\n\n        in_contour = 1;\n      }\n      else if ( in_contour == 0 )\n        goto Fail;\n\n      if ( tags[0] & FT_STROKE_TAG_END )\n      {\n        in_contour = 0;\n        num_contours++;\n      }\n    }\n\n    if ( in_contour != 0 )\n      goto Fail;\n\n    border->valid = TRUE;\n\n  Exit:\n    *anum_points   = num_points;\n    *anum_contours = num_contours;\n    return error;\n\n  Fail:\n    num_points   = 0;\n    num_contours = 0;\n    goto Exit;\n  }\n\n\n  static void\n  ft_stroke_border_export( FT_StrokeBorder  border,\n                           FT_Outline*      outline )\n  {\n    /* copy point locations */\n    FT_ARRAY_COPY( outline->points + outline->n_points,\n                   border->points,\n                   border->num_points );\n\n    /* copy tags */\n    {\n      FT_UInt   count = border->num_points;\n      FT_Byte*  read  = border->tags;\n      FT_Byte*  write = (FT_Byte*)outline->tags + outline->n_points;\n\n\n      for ( ; count > 0; count--, read++, write++ )\n      {\n        if ( *read & FT_STROKE_TAG_ON )\n          *write = FT_CURVE_TAG_ON;\n        else if ( *read & FT_STROKE_TAG_CUBIC )\n          *write = FT_CURVE_TAG_CUBIC;\n        else\n          *write = FT_CURVE_TAG_CONIC;\n      }\n    }\n\n    /* copy contours */\n    {\n      FT_UInt    count = border->num_points;\n      FT_Byte*   tags  = border->tags;\n      FT_Short*  write = outline->contours + outline->n_contours;\n      FT_Short   idx   = (FT_Short)outline->n_points;\n\n\n      for ( ; count > 0; count--, tags++, idx++ )\n      {\n        if ( *tags & FT_STROKE_TAG_END )\n        {\n          *write++ = idx;\n          outline->n_contours++;\n        }\n      }\n    }\n\n    outline->n_points = (short)( outline->n_points + border->num_points );\n\n    FT_ASSERT( FT_Outline_Check( outline ) == 0 );\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                           STROKER                             *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#define FT_SIDE_TO_ROTATE( s )   ( FT_ANGLE_PI2 - (s) * FT_ANGLE_PI )\n\n  typedef struct  FT_StrokerRec_\n  {\n    FT_Angle             angle_in;             /* direction into curr join */\n    FT_Angle             angle_out;            /* direction out of join  */\n    FT_Vector            center;               /* current position */\n    FT_Fixed             line_length;          /* length of last lineto */\n    FT_Bool              first_point;          /* is this the start? */\n    FT_Bool              subpath_open;         /* is the subpath open? */\n    FT_Angle             subpath_angle;        /* subpath start direction */\n    FT_Vector            subpath_start;        /* subpath start position */\n    FT_Fixed             subpath_line_length;  /* subpath start lineto len */\n    FT_Bool              handle_wide_strokes;  /* use wide strokes logic? */\n\n    FT_Stroker_LineCap   line_cap;\n    FT_Stroker_LineJoin  line_join;\n    FT_Stroker_LineJoin  line_join_saved;\n    FT_Fixed             miter_limit;\n    FT_Fixed             radius;\n\n    FT_StrokeBorderRec   borders[2];\n    FT_Library           library;\n\n  } FT_StrokerRec;\n\n\n  /* documentation is in ftstroke.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Stroker_New( FT_Library   library,\n                  FT_Stroker  *astroker )\n  {\n    FT_Error    error;           /* assigned in FT_NEW */\n    FT_Memory   memory;\n    FT_Stroker  stroker = NULL;\n\n\n    if ( !library )\n      return FT_THROW( Invalid_Library_Handle );\n\n    if ( !astroker )\n      return FT_THROW( Invalid_Argument );\n\n    memory = library->memory;\n\n    if ( !FT_NEW( stroker ) )\n    {\n      stroker->library = library;\n\n      ft_stroke_border_init( &stroker->borders[0], memory );\n      ft_stroke_border_init( &stroker->borders[1], memory );\n    }\n\n    *astroker = stroker;\n\n    return error;\n  }\n\n\n  /* documentation is in ftstroke.h */\n\n  FT_EXPORT_DEF( void )\n  FT_Stroker_Set( FT_Stroker           stroker,\n                  FT_Fixed             radius,\n                  FT_Stroker_LineCap   line_cap,\n                  FT_Stroker_LineJoin  line_join,\n                  FT_Fixed             miter_limit )\n  {\n    if ( !stroker )\n      return;\n\n    stroker->radius      = radius;\n    stroker->line_cap    = line_cap;\n    stroker->line_join   = line_join;\n    stroker->miter_limit = miter_limit;\n\n    /* ensure miter limit has sensible value */\n    if ( stroker->miter_limit < 0x10000L )\n      stroker->miter_limit = 0x10000L;\n\n    /* save line join style:                                           */\n    /* line join style can be temporarily changed when stroking curves */\n    stroker->line_join_saved = line_join;\n\n    FT_Stroker_Rewind( stroker );\n  }\n\n\n  /* documentation is in ftstroke.h */\n\n  FT_EXPORT_DEF( void )\n  FT_Stroker_Rewind( FT_Stroker  stroker )\n  {\n    if ( stroker )\n    {\n      ft_stroke_border_reset( &stroker->borders[0] );\n      ft_stroke_border_reset( &stroker->borders[1] );\n    }\n  }\n\n\n  /* documentation is in ftstroke.h */\n\n  FT_EXPORT_DEF( void )\n  FT_Stroker_Done( FT_Stroker  stroker )\n  {\n    if ( stroker )\n    {\n      FT_Memory  memory = stroker->library->memory;\n\n\n      ft_stroke_border_done( &stroker->borders[0] );\n      ft_stroke_border_done( &stroker->borders[1] );\n\n      stroker->library = NULL;\n      FT_FREE( stroker );\n    }\n  }\n\n\n  /* create a circular arc at a corner or cap */\n  static FT_Error\n  ft_stroker_arcto( FT_Stroker  stroker,\n                    FT_Int      side )\n  {\n    FT_Angle         total, rotate;\n    FT_Fixed         radius = stroker->radius;\n    FT_Error         error  = FT_Err_Ok;\n    FT_StrokeBorder  border = stroker->borders + side;\n\n\n    rotate = FT_SIDE_TO_ROTATE( side );\n\n    total = FT_Angle_Diff( stroker->angle_in, stroker->angle_out );\n    if ( total == FT_ANGLE_PI )\n      total = -rotate * 2;\n\n    error = ft_stroke_border_arcto( border,\n                                    &stroker->center,\n                                    radius,\n                                    stroker->angle_in + rotate,\n                                    total );\n    border->movable = FALSE;\n    return error;\n  }\n\n\n  /* add a cap at the end of an opened path */\n  static FT_Error\n  ft_stroker_cap( FT_Stroker  stroker,\n                  FT_Angle    angle,\n                  FT_Int      side )\n  {\n    FT_Error  error = FT_Err_Ok;\n\n\n    if ( stroker->line_cap == FT_STROKER_LINECAP_ROUND )\n    {\n      /* add a round cap */\n      stroker->angle_in  = angle;\n      stroker->angle_out = angle + FT_ANGLE_PI;\n\n      error = ft_stroker_arcto( stroker, side );\n    }\n    else if ( stroker->line_cap == FT_STROKER_LINECAP_SQUARE )\n    {\n      /* add a square cap */\n      FT_Vector        delta, delta2;\n      FT_Angle         rotate = FT_SIDE_TO_ROTATE( side );\n      FT_Fixed         radius = stroker->radius;\n      FT_StrokeBorder  border = stroker->borders + side;\n\n\n      FT_Vector_From_Polar( &delta2, radius, angle + rotate );\n      FT_Vector_From_Polar( &delta,  radius, angle );\n\n      delta.x += stroker->center.x + delta2.x;\n      delta.y += stroker->center.y + delta2.y;\n\n      error = ft_stroke_border_lineto( border, &delta, FALSE );\n      if ( error )\n        goto Exit;\n\n      FT_Vector_From_Polar( &delta2, radius, angle - rotate );\n      FT_Vector_From_Polar( &delta,  radius, angle );\n\n      delta.x += delta2.x + stroker->center.x;\n      delta.y += delta2.y + stroker->center.y;\n\n      error = ft_stroke_border_lineto( border, &delta, FALSE );\n    }\n    else if ( stroker->line_cap == FT_STROKER_LINECAP_BUTT )\n    {\n      /* add a butt ending */\n      FT_Vector        delta;\n      FT_Angle         rotate = FT_SIDE_TO_ROTATE( side );\n      FT_Fixed         radius = stroker->radius;\n      FT_StrokeBorder  border = stroker->borders + side;\n\n\n      FT_Vector_From_Polar( &delta, radius, angle + rotate );\n\n      delta.x += stroker->center.x;\n      delta.y += stroker->center.y;\n\n      error = ft_stroke_border_lineto( border, &delta, FALSE );\n      if ( error )\n        goto Exit;\n\n      FT_Vector_From_Polar( &delta, radius, angle - rotate );\n\n      delta.x += stroker->center.x;\n      delta.y += stroker->center.y;\n\n      error = ft_stroke_border_lineto( border, &delta, FALSE );\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /* process an inside corner, i.e. compute intersection */\n  static FT_Error\n  ft_stroker_inside( FT_Stroker  stroker,\n                     FT_Int      side,\n                     FT_Fixed    line_length )\n  {\n    FT_StrokeBorder  border = stroker->borders + side;\n    FT_Angle         phi, theta, rotate;\n    FT_Fixed         length, thcos;\n    FT_Vector        delta;\n    FT_Error         error = FT_Err_Ok;\n    FT_Bool          intersect;          /* use intersection of lines? */\n\n\n    rotate = FT_SIDE_TO_ROTATE( side );\n\n    theta = FT_Angle_Diff( stroker->angle_in, stroker->angle_out ) / 2;\n\n    /* Only intersect borders if between two lineto's and both */\n    /* lines are long enough (line_length is zero for curves). */\n    if ( !border->movable || line_length == 0 )\n      intersect = FALSE;\n    else\n    {\n      /* compute minimum required length of lines */\n      FT_Fixed  min_length = ft_pos_abs( FT_MulFix( stroker->radius,\n                                                    FT_Tan( theta ) ) );\n\n\n      intersect = FT_BOOL( min_length                         &&\n                           stroker->line_length >= min_length &&\n                           line_length          >= min_length );\n    }\n\n    if ( !intersect )\n    {\n      FT_Vector_From_Polar( &delta, stroker->radius,\n                            stroker->angle_out + rotate );\n      delta.x += stroker->center.x;\n      delta.y += stroker->center.y;\n\n      border->movable = FALSE;\n    }\n    else\n    {\n      /* compute median angle */\n      phi = stroker->angle_in + theta;\n\n      thcos = FT_Cos( theta );\n\n      length = FT_DivFix( stroker->radius, thcos );\n\n      FT_Vector_From_Polar( &delta, length, phi + rotate );\n      delta.x += stroker->center.x;\n      delta.y += stroker->center.y;\n    }\n\n    error = ft_stroke_border_lineto( border, &delta, FALSE );\n\n    return error;\n  }\n\n\n  /* process an outside corner, i.e. compute bevel/miter/round */\n  static FT_Error\n  ft_stroker_outside( FT_Stroker  stroker,\n                      FT_Int      side,\n                      FT_Fixed    line_length )\n  {\n    FT_StrokeBorder  border = stroker->borders + side;\n    FT_Error         error;\n    FT_Angle         rotate;\n\n\n    if ( stroker->line_join == FT_STROKER_LINEJOIN_ROUND )\n      error = ft_stroker_arcto( stroker, side );\n    else\n    {\n      /* this is a mitered (pointed) or beveled (truncated) corner */\n      FT_Fixed  sigma = 0, radius = stroker->radius;\n      FT_Angle  theta = 0, phi = 0;\n      FT_Fixed  thcos = 0;\n      FT_Bool   bevel, fixed_bevel;\n\n\n      rotate = FT_SIDE_TO_ROTATE( side );\n\n      bevel =\n        FT_BOOL( stroker->line_join == FT_STROKER_LINEJOIN_BEVEL );\n\n      fixed_bevel =\n        FT_BOOL( stroker->line_join != FT_STROKER_LINEJOIN_MITER_VARIABLE );\n\n      if ( !bevel )\n      {\n        theta = FT_Angle_Diff( stroker->angle_in, stroker->angle_out );\n\n        if ( theta == FT_ANGLE_PI )\n        {\n          theta = rotate;\n          phi   = stroker->angle_in;\n        }\n        else\n        {\n          theta /= 2;\n          phi    = stroker->angle_in + theta + rotate;\n        }\n\n        thcos = FT_Cos( theta );\n        sigma = FT_MulFix( stroker->miter_limit, thcos );\n\n        /* is miter limit exceeded? */\n        if ( sigma < 0x10000L )\n        {\n          /* don't create variable bevels for very small deviations; */\n          /* FT_Sin(x) = 0 for x <= 57                               */\n          if ( fixed_bevel || ft_pos_abs( theta ) > 57 )\n            bevel = TRUE;\n        }\n      }\n\n      if ( bevel )  /* this is a bevel (broken angle) */\n      {\n        if ( fixed_bevel )\n        {\n          /* the outer corners are simply joined together */\n          FT_Vector  delta;\n\n\n          /* add bevel */\n          FT_Vector_From_Polar( &delta,\n                                radius,\n                                stroker->angle_out + rotate );\n          delta.x += stroker->center.x;\n          delta.y += stroker->center.y;\n\n          border->movable = FALSE;\n          error = ft_stroke_border_lineto( border, &delta, FALSE );\n        }\n        else /* variable bevel */\n        {\n          /* the miter is truncated */\n          FT_Vector  middle, delta;\n          FT_Fixed   length;\n\n\n          /* compute middle point */\n          FT_Vector_From_Polar( &middle,\n                                FT_MulFix( radius, stroker->miter_limit ),\n                                phi );\n          middle.x += stroker->center.x;\n          middle.y += stroker->center.y;\n\n          /* compute first angle point */\n          length = FT_MulDiv( radius, 0x10000L - sigma,\n                              ft_pos_abs( FT_Sin( theta ) ) );\n\n          FT_Vector_From_Polar( &delta, length, phi + rotate );\n          delta.x += middle.x;\n          delta.y += middle.y;\n\n          error = ft_stroke_border_lineto( border, &delta, FALSE );\n          if ( error )\n            goto Exit;\n\n          /* compute second angle point */\n          FT_Vector_From_Polar( &delta, length, phi - rotate );\n          delta.x += middle.x;\n          delta.y += middle.y;\n\n          error = ft_stroke_border_lineto( border, &delta, FALSE );\n          if ( error )\n            goto Exit;\n\n          /* finally, add an end point; only needed if not lineto */\n          /* (line_length is zero for curves)                     */\n          if ( line_length == 0 )\n          {\n            FT_Vector_From_Polar( &delta,\n                                  radius,\n                                  stroker->angle_out + rotate );\n\n            delta.x += stroker->center.x;\n            delta.y += stroker->center.y;\n\n            error = ft_stroke_border_lineto( border, &delta, FALSE );\n          }\n        }\n      }\n      else /* this is a miter (intersection) */\n      {\n        FT_Fixed   length;\n        FT_Vector  delta;\n\n\n        length = FT_DivFix( stroker->radius, thcos );\n\n        FT_Vector_From_Polar( &delta, length, phi );\n        delta.x += stroker->center.x;\n        delta.y += stroker->center.y;\n\n        error = ft_stroke_border_lineto( border, &delta, FALSE );\n        if ( error )\n          goto Exit;\n\n        /* now add an end point; only needed if not lineto */\n        /* (line_length is zero for curves)                */\n        if ( line_length == 0 )\n        {\n          FT_Vector_From_Polar( &delta,\n                                stroker->radius,\n                                stroker->angle_out + rotate );\n          delta.x += stroker->center.x;\n          delta.y += stroker->center.y;\n\n          error = ft_stroke_border_lineto( border, &delta, FALSE );\n        }\n      }\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  static FT_Error\n  ft_stroker_process_corner( FT_Stroker  stroker,\n                             FT_Fixed    line_length )\n  {\n    FT_Error  error = FT_Err_Ok;\n    FT_Angle  turn;\n    FT_Int    inside_side;\n\n\n    turn = FT_Angle_Diff( stroker->angle_in, stroker->angle_out );\n\n    /* no specific corner processing is required if the turn is 0 */\n    if ( turn == 0 )\n      goto Exit;\n\n    /* when we turn to the right, the inside side is 0 */\n    inside_side = 0;\n\n    /* otherwise, the inside side is 1 */\n    if ( turn < 0 )\n      inside_side = 1;\n\n    /* process the inside side */\n    error = ft_stroker_inside( stroker, inside_side, line_length );\n    if ( error )\n      goto Exit;\n\n    /* process the outside side */\n    error = ft_stroker_outside( stroker, 1 - inside_side, line_length );\n\n  Exit:\n    return error;\n  }\n\n\n  /* add two points to the left and right borders corresponding to the */\n  /* start of the subpath                                              */\n  static FT_Error\n  ft_stroker_subpath_start( FT_Stroker  stroker,\n                            FT_Angle    start_angle,\n                            FT_Fixed    line_length )\n  {\n    FT_Vector        delta;\n    FT_Vector        point;\n    FT_Error         error;\n    FT_StrokeBorder  border;\n\n\n    FT_Vector_From_Polar( &delta, stroker->radius,\n                          start_angle + FT_ANGLE_PI2 );\n\n    point.x = stroker->center.x + delta.x;\n    point.y = stroker->center.y + delta.y;\n\n    border = stroker->borders;\n    error = ft_stroke_border_moveto( border, &point );\n    if ( error )\n      goto Exit;\n\n    point.x = stroker->center.x - delta.x;\n    point.y = stroker->center.y - delta.y;\n\n    border++;\n    error = ft_stroke_border_moveto( border, &point );\n\n    /* save angle, position, and line length for last join */\n    /* (line_length is zero for curves)                    */\n    stroker->subpath_angle       = start_angle;\n    stroker->first_point         = FALSE;\n    stroker->subpath_line_length = line_length;\n\n  Exit:\n    return error;\n  }\n\n\n  /* documentation is in ftstroke.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Stroker_LineTo( FT_Stroker  stroker,\n                     FT_Vector*  to )\n  {\n    FT_Error         error = FT_Err_Ok;\n    FT_StrokeBorder  border;\n    FT_Vector        delta;\n    FT_Angle         angle;\n    FT_Int           side;\n    FT_Fixed         line_length;\n\n\n    if ( !stroker || !to )\n      return FT_THROW( Invalid_Argument );\n\n    delta.x = to->x - stroker->center.x;\n    delta.y = to->y - stroker->center.y;\n\n    /* a zero-length lineto is a no-op; avoid creating a spurious corner */\n    if ( delta.x == 0 && delta.y == 0 )\n       goto Exit;\n\n    /* compute length of line */\n    line_length = FT_Vector_Length( &delta );\n\n    angle = FT_Atan2( delta.x, delta.y );\n    FT_Vector_From_Polar( &delta, stroker->radius, angle + FT_ANGLE_PI2 );\n\n    /* process corner if necessary */\n    if ( stroker->first_point )\n    {\n      /* This is the first segment of a subpath.  We need to     */\n      /* add a point to each border at their respective starting */\n      /* point locations.                                        */\n      error = ft_stroker_subpath_start( stroker, angle, line_length );\n      if ( error )\n        goto Exit;\n    }\n    else\n    {\n      /* process the current corner */\n      stroker->angle_out = angle;\n      error = ft_stroker_process_corner( stroker, line_length );\n      if ( error )\n        goto Exit;\n    }\n\n    /* now add a line segment to both the `inside' and `outside' paths */\n    for ( border = stroker->borders, side = 1; side >= 0; side--, border++ )\n    {\n      FT_Vector  point;\n\n\n      point.x = to->x + delta.x;\n      point.y = to->y + delta.y;\n\n      /* the ends of lineto borders are movable */\n      error = ft_stroke_border_lineto( border, &point, TRUE );\n      if ( error )\n        goto Exit;\n\n      delta.x = -delta.x;\n      delta.y = -delta.y;\n    }\n\n    stroker->angle_in    = angle;\n    stroker->center      = *to;\n    stroker->line_length = line_length;\n\n  Exit:\n    return error;\n  }\n\n\n  /* documentation is in ftstroke.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Stroker_ConicTo( FT_Stroker  stroker,\n                      FT_Vector*  control,\n                      FT_Vector*  to )\n  {\n    FT_Error    error = FT_Err_Ok;\n    FT_Vector   bez_stack[34];\n    FT_Vector*  arc;\n    FT_Vector*  limit = bez_stack + 30;\n    FT_Bool     first_arc = TRUE;\n\n\n    if ( !stroker || !control || !to )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    /* if all control points are coincident, this is a no-op; */\n    /* avoid creating a spurious corner                       */\n    if ( FT_IS_SMALL( stroker->center.x - control->x ) &&\n         FT_IS_SMALL( stroker->center.y - control->y ) &&\n         FT_IS_SMALL( control->x        - to->x      ) &&\n         FT_IS_SMALL( control->y        - to->y      ) )\n    {\n       stroker->center = *to;\n       goto Exit;\n    }\n\n    arc    = bez_stack;\n    arc[0] = *to;\n    arc[1] = *control;\n    arc[2] = stroker->center;\n\n    while ( arc >= bez_stack )\n    {\n      FT_Angle  angle_in, angle_out;\n\n\n      /* initialize with current direction */\n      angle_in = angle_out = stroker->angle_in;\n\n      if ( arc < limit                                             &&\n           !ft_conic_is_small_enough( arc, &angle_in, &angle_out ) )\n      {\n        if ( stroker->first_point )\n          stroker->angle_in = angle_in;\n\n        ft_conic_split( arc );\n        arc += 2;\n        continue;\n      }\n\n      if ( first_arc )\n      {\n        first_arc = FALSE;\n\n        /* process corner if necessary */\n        if ( stroker->first_point )\n          error = ft_stroker_subpath_start( stroker, angle_in, 0 );\n        else\n        {\n          stroker->angle_out = angle_in;\n          error = ft_stroker_process_corner( stroker, 0 );\n        }\n      }\n      else if ( ft_pos_abs( FT_Angle_Diff( stroker->angle_in, angle_in ) ) >\n                  FT_SMALL_CONIC_THRESHOLD / 4                             )\n      {\n        /* if the deviation from one arc to the next is too great, */\n        /* add a round corner                                      */\n        stroker->center    = arc[2];\n        stroker->angle_out = angle_in;\n        stroker->line_join = FT_STROKER_LINEJOIN_ROUND;\n\n        error = ft_stroker_process_corner( stroker, 0 );\n\n        /* reinstate line join style */\n        stroker->line_join = stroker->line_join_saved;\n      }\n\n      if ( error )\n        goto Exit;\n\n      /* the arc's angle is small enough; we can add it directly to each */\n      /* border                                                          */\n      {\n        FT_Vector        ctrl, end;\n        FT_Angle         theta, phi, rotate, alpha0 = 0;\n        FT_Fixed         length;\n        FT_StrokeBorder  border;\n        FT_Int           side;\n\n\n        theta  = FT_Angle_Diff( angle_in, angle_out ) / 2;\n        phi    = angle_in + theta;\n        length = FT_DivFix( stroker->radius, FT_Cos( theta ) );\n\n        /* compute direction of original arc */\n        if ( stroker->handle_wide_strokes )\n          alpha0 = FT_Atan2( arc[0].x - arc[2].x, arc[0].y - arc[2].y );\n\n        for ( border = stroker->borders, side = 0;\n              side <= 1;\n              side++, border++ )\n        {\n          rotate = FT_SIDE_TO_ROTATE( side );\n\n          /* compute control point */\n          FT_Vector_From_Polar( &ctrl, length, phi + rotate );\n          ctrl.x += arc[1].x;\n          ctrl.y += arc[1].y;\n\n          /* compute end point */\n          FT_Vector_From_Polar( &end, stroker->radius, angle_out + rotate );\n          end.x += arc[0].x;\n          end.y += arc[0].y;\n\n          if ( stroker->handle_wide_strokes )\n          {\n            FT_Vector  start;\n            FT_Angle   alpha1;\n\n\n            /* determine whether the border radius is greater than the */\n            /* radius of curvature of the original arc                 */\n            start = border->points[border->num_points - 1];\n\n            alpha1 = FT_Atan2( end.x - start.x, end.y - start.y );\n\n            /* is the direction of the border arc opposite to */\n            /* that of the original arc? */\n            if ( ft_pos_abs( FT_Angle_Diff( alpha0, alpha1 ) ) >\n                   FT_ANGLE_PI / 2                             )\n            {\n              FT_Angle   beta, gamma;\n              FT_Vector  bvec, delta;\n              FT_Fixed   blen, sinA, sinB, alen;\n\n\n              /* use the sine rule to find the intersection point */\n              beta  = FT_Atan2( arc[2].x - start.x, arc[2].y - start.y );\n              gamma = FT_Atan2( arc[0].x - end.x,   arc[0].y - end.y );\n\n              bvec.x = end.x - start.x;\n              bvec.y = end.y - start.y;\n\n              blen = FT_Vector_Length( &bvec );\n\n              sinA = ft_pos_abs( FT_Sin( alpha1 - gamma ) );\n              sinB = ft_pos_abs( FT_Sin( beta - gamma ) );\n\n              alen = FT_MulDiv( blen, sinA, sinB );\n\n              FT_Vector_From_Polar( &delta, alen, beta );\n              delta.x += start.x;\n              delta.y += start.y;\n\n              /* circumnavigate the negative sector backwards */\n              border->movable = FALSE;\n              error = ft_stroke_border_lineto( border, &delta, FALSE );\n              if ( error )\n                goto Exit;\n              error = ft_stroke_border_lineto( border, &end, FALSE );\n              if ( error )\n                goto Exit;\n              error = ft_stroke_border_conicto( border, &ctrl, &start );\n              if ( error )\n                goto Exit;\n              /* and then move to the endpoint */\n              error = ft_stroke_border_lineto( border, &end, FALSE );\n              if ( error )\n                goto Exit;\n\n              continue;\n            }\n\n            /* else fall through */\n          }\n\n          /* simply add an arc */\n          error = ft_stroke_border_conicto( border, &ctrl, &end );\n          if ( error )\n            goto Exit;\n        }\n      }\n\n      arc -= 2;\n\n      stroker->angle_in = angle_out;\n    }\n\n    stroker->center = *to;\n\n  Exit:\n    return error;\n  }\n\n\n  /* documentation is in ftstroke.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Stroker_CubicTo( FT_Stroker  stroker,\n                      FT_Vector*  control1,\n                      FT_Vector*  control2,\n                      FT_Vector*  to )\n  {\n    FT_Error    error = FT_Err_Ok;\n    FT_Vector   bez_stack[37];\n    FT_Vector*  arc;\n    FT_Vector*  limit = bez_stack + 32;\n    FT_Bool     first_arc = TRUE;\n\n\n    if ( !stroker || !control1 || !control2 || !to )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    /* if all control points are coincident, this is a no-op; */\n    /* avoid creating a spurious corner */\n    if ( FT_IS_SMALL( stroker->center.x - control1->x ) &&\n         FT_IS_SMALL( stroker->center.y - control1->y ) &&\n         FT_IS_SMALL( control1->x       - control2->x ) &&\n         FT_IS_SMALL( control1->y       - control2->y ) &&\n         FT_IS_SMALL( control2->x       - to->x       ) &&\n         FT_IS_SMALL( control2->y       - to->y       ) )\n    {\n       stroker->center = *to;\n       goto Exit;\n    }\n\n    arc    = bez_stack;\n    arc[0] = *to;\n    arc[1] = *control2;\n    arc[2] = *control1;\n    arc[3] = stroker->center;\n\n    while ( arc >= bez_stack )\n    {\n      FT_Angle  angle_in, angle_mid, angle_out;\n\n\n      /* initialize with current direction */\n      angle_in = angle_out = angle_mid = stroker->angle_in;\n\n      if ( arc < limit                                         &&\n           !ft_cubic_is_small_enough( arc, &angle_in,\n                                      &angle_mid, &angle_out ) )\n      {\n        if ( stroker->first_point )\n          stroker->angle_in = angle_in;\n\n        ft_cubic_split( arc );\n        arc += 3;\n        continue;\n      }\n\n      if ( first_arc )\n      {\n        first_arc = FALSE;\n\n        /* process corner if necessary */\n        if ( stroker->first_point )\n          error = ft_stroker_subpath_start( stroker, angle_in, 0 );\n        else\n        {\n          stroker->angle_out = angle_in;\n          error = ft_stroker_process_corner( stroker, 0 );\n        }\n      }\n      else if ( ft_pos_abs( FT_Angle_Diff( stroker->angle_in, angle_in ) ) >\n                  FT_SMALL_CUBIC_THRESHOLD / 4                             )\n      {\n        /* if the deviation from one arc to the next is too great, */\n        /* add a round corner                                      */\n        stroker->center    = arc[3];\n        stroker->angle_out = angle_in;\n        stroker->line_join = FT_STROKER_LINEJOIN_ROUND;\n\n        error = ft_stroker_process_corner( stroker, 0 );\n\n        /* reinstate line join style */\n        stroker->line_join = stroker->line_join_saved;\n      }\n\n      if ( error )\n        goto Exit;\n\n      /* the arc's angle is small enough; we can add it directly to each */\n      /* border                                                          */\n      {\n        FT_Vector        ctrl1, ctrl2, end;\n        FT_Angle         theta1, phi1, theta2, phi2, rotate, alpha0 = 0;\n        FT_Fixed         length1, length2;\n        FT_StrokeBorder  border;\n        FT_Int           side;\n\n\n        theta1  = FT_Angle_Diff( angle_in,  angle_mid ) / 2;\n        theta2  = FT_Angle_Diff( angle_mid, angle_out ) / 2;\n        phi1    = ft_angle_mean( angle_in,  angle_mid );\n        phi2    = ft_angle_mean( angle_mid, angle_out );\n        length1 = FT_DivFix( stroker->radius, FT_Cos( theta1 ) );\n        length2 = FT_DivFix( stroker->radius, FT_Cos( theta2 ) );\n\n        /* compute direction of original arc */\n        if ( stroker->handle_wide_strokes )\n          alpha0 = FT_Atan2( arc[0].x - arc[3].x, arc[0].y - arc[3].y );\n\n        for ( border = stroker->borders, side = 0;\n              side <= 1;\n              side++, border++ )\n        {\n          rotate = FT_SIDE_TO_ROTATE( side );\n\n          /* compute control points */\n          FT_Vector_From_Polar( &ctrl1, length1, phi1 + rotate );\n          ctrl1.x += arc[2].x;\n          ctrl1.y += arc[2].y;\n\n          FT_Vector_From_Polar( &ctrl2, length2, phi2 + rotate );\n          ctrl2.x += arc[1].x;\n          ctrl2.y += arc[1].y;\n\n          /* compute end point */\n          FT_Vector_From_Polar( &end, stroker->radius, angle_out + rotate );\n          end.x += arc[0].x;\n          end.y += arc[0].y;\n\n          if ( stroker->handle_wide_strokes )\n          {\n            FT_Vector  start;\n            FT_Angle   alpha1;\n\n\n            /* determine whether the border radius is greater than the */\n            /* radius of curvature of the original arc                 */\n            start = border->points[border->num_points - 1];\n\n            alpha1 = FT_Atan2( end.x - start.x, end.y - start.y );\n\n            /* is the direction of the border arc opposite to */\n            /* that of the original arc? */\n            if ( ft_pos_abs( FT_Angle_Diff( alpha0, alpha1 ) ) >\n                   FT_ANGLE_PI / 2                             )\n            {\n              FT_Angle   beta, gamma;\n              FT_Vector  bvec, delta;\n              FT_Fixed   blen, sinA, sinB, alen;\n\n\n              /* use the sine rule to find the intersection point */\n              beta  = FT_Atan2( arc[3].x - start.x, arc[3].y - start.y );\n              gamma = FT_Atan2( arc[0].x - end.x,   arc[0].y - end.y );\n\n              bvec.x = end.x - start.x;\n              bvec.y = end.y - start.y;\n\n              blen = FT_Vector_Length( &bvec );\n\n              sinA = ft_pos_abs( FT_Sin( alpha1 - gamma ) );\n              sinB = ft_pos_abs( FT_Sin( beta - gamma ) );\n\n              alen = FT_MulDiv( blen, sinA, sinB );\n\n              FT_Vector_From_Polar( &delta, alen, beta );\n              delta.x += start.x;\n              delta.y += start.y;\n\n              /* circumnavigate the negative sector backwards */\n              border->movable = FALSE;\n              error = ft_stroke_border_lineto( border, &delta, FALSE );\n              if ( error )\n                goto Exit;\n              error = ft_stroke_border_lineto( border, &end, FALSE );\n              if ( error )\n                goto Exit;\n              error = ft_stroke_border_cubicto( border,\n                                                &ctrl2,\n                                                &ctrl1,\n                                                &start );\n              if ( error )\n                goto Exit;\n              /* and then move to the endpoint */\n              error = ft_stroke_border_lineto( border, &end, FALSE );\n              if ( error )\n                goto Exit;\n\n              continue;\n            }\n\n            /* else fall through */\n          }\n\n          /* simply add an arc */\n          error = ft_stroke_border_cubicto( border, &ctrl1, &ctrl2, &end );\n          if ( error )\n            goto Exit;\n        }\n      }\n\n      arc -= 3;\n\n      stroker->angle_in = angle_out;\n    }\n\n    stroker->center = *to;\n\n  Exit:\n    return error;\n  }\n\n\n  /* documentation is in ftstroke.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Stroker_BeginSubPath( FT_Stroker  stroker,\n                           FT_Vector*  to,\n                           FT_Bool     open )\n  {\n    if ( !stroker || !to )\n      return FT_THROW( Invalid_Argument );\n\n    /* We cannot process the first point, because there is not enough      */\n    /* information regarding its corner/cap.  The latter will be processed */\n    /* in the `FT_Stroker_EndSubPath' routine.                             */\n    /*                                                                     */\n    stroker->first_point  = TRUE;\n    stroker->center       = *to;\n    stroker->subpath_open = open;\n\n    /* Determine if we need to check whether the border radius is greater */\n    /* than the radius of curvature of a curve, to handle this case       */\n    /* specially.  This is only required if bevel joins or butt caps may  */\n    /* be created, because round & miter joins and round & square caps    */\n    /* cover the negative sector created with wide strokes.               */\n    stroker->handle_wide_strokes =\n      FT_BOOL( stroker->line_join != FT_STROKER_LINEJOIN_ROUND  ||\n               ( stroker->subpath_open                        &&\n                 stroker->line_cap == FT_STROKER_LINECAP_BUTT ) );\n\n    /* record the subpath start point for each border */\n    stroker->subpath_start = *to;\n\n    stroker->angle_in = 0;\n\n    return FT_Err_Ok;\n  }\n\n\n  static FT_Error\n  ft_stroker_add_reverse_left( FT_Stroker  stroker,\n                               FT_Bool     open )\n  {\n    FT_StrokeBorder  right = stroker->borders + 0;\n    FT_StrokeBorder  left  = stroker->borders + 1;\n    FT_Int           new_points;\n    FT_Error         error = FT_Err_Ok;\n\n\n    FT_ASSERT( left->start >= 0 );\n\n    new_points = left->num_points - left->start;\n    if ( new_points > 0 )\n    {\n      error = ft_stroke_border_grow( right, (FT_UInt)new_points );\n      if ( error )\n        goto Exit;\n\n      {\n        FT_Vector*  dst_point = right->points + right->num_points;\n        FT_Byte*    dst_tag   = right->tags   + right->num_points;\n        FT_Vector*  src_point = left->points  + left->num_points - 1;\n        FT_Byte*    src_tag   = left->tags    + left->num_points - 1;\n\n\n        while ( src_point >= left->points + left->start )\n        {\n          *dst_point = *src_point;\n          *dst_tag   = *src_tag;\n\n          if ( open )\n            dst_tag[0] &= ~FT_STROKE_TAG_BEGIN_END;\n          else\n          {\n            FT_Byte  ttag =\n                       (FT_Byte)( dst_tag[0] & FT_STROKE_TAG_BEGIN_END );\n\n\n            /* switch begin/end tags if necessary */\n            if ( ttag == FT_STROKE_TAG_BEGIN ||\n                 ttag == FT_STROKE_TAG_END   )\n              dst_tag[0] ^= FT_STROKE_TAG_BEGIN_END;\n          }\n\n          src_point--;\n          src_tag--;\n          dst_point++;\n          dst_tag++;\n        }\n      }\n\n      left->num_points   = left->start;\n      right->num_points += new_points;\n\n      right->movable = FALSE;\n      left->movable  = FALSE;\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /* documentation is in ftstroke.h */\n\n  /* there's a lot of magic in this function! */\n  FT_EXPORT_DEF( FT_Error )\n  FT_Stroker_EndSubPath( FT_Stroker  stroker )\n  {\n    FT_Error  error = FT_Err_Ok;\n\n\n    if ( !stroker )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    if ( stroker->subpath_open )\n    {\n      FT_StrokeBorder  right = stroker->borders;\n\n\n      /* All right, this is an opened path, we need to add a cap between */\n      /* right & left, add the reverse of left, then add a final cap     */\n      /* between left & right.                                           */\n      error = ft_stroker_cap( stroker, stroker->angle_in, 0 );\n      if ( error )\n        goto Exit;\n\n      /* add reversed points from `left' to `right' */\n      error = ft_stroker_add_reverse_left( stroker, TRUE );\n      if ( error )\n        goto Exit;\n\n      /* now add the final cap */\n      stroker->center = stroker->subpath_start;\n      error = ft_stroker_cap( stroker,\n                              stroker->subpath_angle + FT_ANGLE_PI, 0 );\n      if ( error )\n        goto Exit;\n\n      /* Now end the right subpath accordingly.  The left one is */\n      /* rewind and doesn't need further processing.             */\n      ft_stroke_border_close( right, FALSE );\n    }\n    else\n    {\n      FT_Angle  turn;\n      FT_Int    inside_side;\n\n\n      /* close the path if needed */\n      if ( stroker->center.x != stroker->subpath_start.x ||\n           stroker->center.y != stroker->subpath_start.y )\n      {\n         error = FT_Stroker_LineTo( stroker, &stroker->subpath_start );\n         if ( error )\n           goto Exit;\n      }\n\n      /* process the corner */\n      stroker->angle_out = stroker->subpath_angle;\n      turn               = FT_Angle_Diff( stroker->angle_in,\n                                          stroker->angle_out );\n\n      /* no specific corner processing is required if the turn is 0 */\n      if ( turn != 0 )\n      {\n        /* when we turn to the right, the inside side is 0 */\n        inside_side = 0;\n\n        /* otherwise, the inside side is 1 */\n        if ( turn < 0 )\n          inside_side = 1;\n\n        error = ft_stroker_inside( stroker,\n                                   inside_side,\n                                   stroker->subpath_line_length );\n        if ( error )\n          goto Exit;\n\n        /* process the outside side */\n        error = ft_stroker_outside( stroker,\n                                    1 - inside_side,\n                                    stroker->subpath_line_length );\n        if ( error )\n          goto Exit;\n      }\n\n      /* then end our two subpaths */\n      ft_stroke_border_close( stroker->borders + 0, FALSE );\n      ft_stroke_border_close( stroker->borders + 1, TRUE );\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /* documentation is in ftstroke.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Stroker_GetBorderCounts( FT_Stroker        stroker,\n                              FT_StrokerBorder  border,\n                              FT_UInt          *anum_points,\n                              FT_UInt          *anum_contours )\n  {\n    FT_UInt   num_points = 0, num_contours = 0;\n    FT_Error  error;\n\n\n    if ( !stroker || border > 1 )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    error = ft_stroke_border_get_counts( stroker->borders + border,\n                                         &num_points, &num_contours );\n  Exit:\n    if ( anum_points )\n      *anum_points = num_points;\n\n    if ( anum_contours )\n      *anum_contours = num_contours;\n\n    return error;\n  }\n\n\n  /* documentation is in ftstroke.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Stroker_GetCounts( FT_Stroker  stroker,\n                        FT_UInt    *anum_points,\n                        FT_UInt    *anum_contours )\n  {\n    FT_UInt   count1, count2, num_points   = 0;\n    FT_UInt   count3, count4, num_contours = 0;\n    FT_Error  error;\n\n\n    if ( !stroker )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    error = ft_stroke_border_get_counts( stroker->borders + 0,\n                                         &count1, &count2 );\n    if ( error )\n      goto Exit;\n\n    error = ft_stroke_border_get_counts( stroker->borders + 1,\n                                         &count3, &count4 );\n    if ( error )\n      goto Exit;\n\n    num_points   = count1 + count3;\n    num_contours = count2 + count4;\n\n  Exit:\n    if ( anum_points )\n      *anum_points   = num_points;\n\n    if ( anum_contours )\n      *anum_contours = num_contours;\n\n    return error;\n  }\n\n\n  /* documentation is in ftstroke.h */\n\n  FT_EXPORT_DEF( void )\n  FT_Stroker_ExportBorder( FT_Stroker        stroker,\n                           FT_StrokerBorder  border,\n                           FT_Outline*       outline )\n  {\n    if ( !stroker || !outline )\n      return;\n\n    if ( border == FT_STROKER_BORDER_LEFT  ||\n         border == FT_STROKER_BORDER_RIGHT )\n    {\n      FT_StrokeBorder  sborder = & stroker->borders[border];\n\n\n      if ( sborder->valid )\n        ft_stroke_border_export( sborder, outline );\n    }\n  }\n\n\n  /* documentation is in ftstroke.h */\n\n  FT_EXPORT_DEF( void )\n  FT_Stroker_Export( FT_Stroker   stroker,\n                     FT_Outline*  outline )\n  {\n    FT_Stroker_ExportBorder( stroker, FT_STROKER_BORDER_LEFT, outline );\n    FT_Stroker_ExportBorder( stroker, FT_STROKER_BORDER_RIGHT, outline );\n  }\n\n\n  /* documentation is in ftstroke.h */\n\n  /*\n   *  The following is very similar to FT_Outline_Decompose, except\n   *  that we do support opened paths, and do not scale the outline.\n   */\n  FT_EXPORT_DEF( FT_Error )\n  FT_Stroker_ParseOutline( FT_Stroker   stroker,\n                           FT_Outline*  outline,\n                           FT_Bool      opened )\n  {\n    FT_Vector   v_last;\n    FT_Vector   v_control;\n    FT_Vector   v_start;\n\n    FT_Vector*  point;\n    FT_Vector*  limit;\n    char*       tags;\n\n    FT_Error    error;\n\n    FT_Int      n;         /* index of contour in outline     */\n    FT_UInt     first;     /* index of first point in contour */\n    FT_Int      tag;       /* current point's state           */\n\n\n    if ( !outline )\n      return FT_THROW( Invalid_Outline );\n\n    if ( !stroker )\n      return FT_THROW( Invalid_Argument );\n\n    FT_Stroker_Rewind( stroker );\n\n    first = 0;\n\n    for ( n = 0; n < outline->n_contours; n++ )\n    {\n      FT_UInt  last;  /* index of last point in contour */\n\n\n      last  = outline->contours[n];\n      limit = outline->points + last;\n\n      /* skip empty points; we don't stroke these */\n      if ( last <= first )\n      {\n        first = last + 1;\n        continue;\n      }\n\n      v_start = outline->points[first];\n      v_last  = outline->points[last];\n\n      v_control = v_start;\n\n      point = outline->points + first;\n      tags  = outline->tags   + first;\n      tag   = FT_CURVE_TAG( tags[0] );\n\n      /* A contour cannot start with a cubic control point! */\n      if ( tag == FT_CURVE_TAG_CUBIC )\n        goto Invalid_Outline;\n\n      /* check first point to determine origin */\n      if ( tag == FT_CURVE_TAG_CONIC )\n      {\n        /* First point is conic control.  Yes, this happens. */\n        if ( FT_CURVE_TAG( outline->tags[last] ) == FT_CURVE_TAG_ON )\n        {\n          /* start at last point if it is on the curve */\n          v_start = v_last;\n          limit--;\n        }\n        else\n        {\n          /* if both first and last points are conic, */\n          /* start at their middle                    */\n          v_start.x = ( v_start.x + v_last.x ) / 2;\n          v_start.y = ( v_start.y + v_last.y ) / 2;\n        }\n        point--;\n        tags--;\n      }\n\n      error = FT_Stroker_BeginSubPath( stroker, &v_start, opened );\n      if ( error )\n        goto Exit;\n\n      while ( point < limit )\n      {\n        point++;\n        tags++;\n\n        tag = FT_CURVE_TAG( tags[0] );\n        switch ( tag )\n        {\n        case FT_CURVE_TAG_ON:  /* emit a single line_to */\n          {\n            FT_Vector  vec;\n\n\n            vec.x = point->x;\n            vec.y = point->y;\n\n            error = FT_Stroker_LineTo( stroker, &vec );\n            if ( error )\n              goto Exit;\n            continue;\n          }\n\n        case FT_CURVE_TAG_CONIC:  /* consume conic arcs */\n          v_control.x = point->x;\n          v_control.y = point->y;\n\n        Do_Conic:\n          if ( point < limit )\n          {\n            FT_Vector  vec;\n            FT_Vector  v_middle;\n\n\n            point++;\n            tags++;\n            tag = FT_CURVE_TAG( tags[0] );\n\n            vec = point[0];\n\n            if ( tag == FT_CURVE_TAG_ON )\n            {\n              error = FT_Stroker_ConicTo( stroker, &v_control, &vec );\n              if ( error )\n                goto Exit;\n              continue;\n            }\n\n            if ( tag != FT_CURVE_TAG_CONIC )\n              goto Invalid_Outline;\n\n            v_middle.x = ( v_control.x + vec.x ) / 2;\n            v_middle.y = ( v_control.y + vec.y ) / 2;\n\n            error = FT_Stroker_ConicTo( stroker, &v_control, &v_middle );\n            if ( error )\n              goto Exit;\n\n            v_control = vec;\n            goto Do_Conic;\n          }\n\n          error = FT_Stroker_ConicTo( stroker, &v_control, &v_start );\n          goto Close;\n\n        default:  /* FT_CURVE_TAG_CUBIC */\n          {\n            FT_Vector  vec1, vec2;\n\n\n            if ( point + 1 > limit                             ||\n                 FT_CURVE_TAG( tags[1] ) != FT_CURVE_TAG_CUBIC )\n              goto Invalid_Outline;\n\n            point += 2;\n            tags  += 2;\n\n            vec1 = point[-2];\n            vec2 = point[-1];\n\n            if ( point <= limit )\n            {\n              FT_Vector  vec;\n\n\n              vec = point[0];\n\n              error = FT_Stroker_CubicTo( stroker, &vec1, &vec2, &vec );\n              if ( error )\n                goto Exit;\n              continue;\n            }\n\n            error = FT_Stroker_CubicTo( stroker, &vec1, &vec2, &v_start );\n            goto Close;\n          }\n        }\n      }\n\n    Close:\n      if ( error )\n        goto Exit;\n\n      /* don't try to end the path if no segments have been generated */\n      if ( !stroker->first_point )\n      {\n        error = FT_Stroker_EndSubPath( stroker );\n        if ( error )\n          goto Exit;\n      }\n\n      first = last + 1;\n    }\n\n    return FT_Err_Ok;\n\n  Exit:\n    return error;\n\n  Invalid_Outline:\n    return FT_THROW( Invalid_Outline );\n  }\n\n\n  /* declare an extern to access `ft_outline_glyph_class' globally     */\n  /* allocated  in `ftglyph.c', and use the FT_OUTLINE_GLYPH_CLASS_GET */\n  /* macro to access it when FT_CONFIG_OPTION_PIC is defined           */\n#ifndef FT_CONFIG_OPTION_PIC\n  extern const FT_Glyph_Class  ft_outline_glyph_class;\n#endif\n#include \"basepic.h\"\n\n\n  /* documentation is in ftstroke.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Glyph_Stroke( FT_Glyph    *pglyph,\n                   FT_Stroker   stroker,\n                   FT_Bool      destroy )\n  {\n    FT_Error  error = FT_ERR( Invalid_Argument );\n    FT_Glyph  glyph = NULL;\n\n    /* for FT_OUTLINE_GLYPH_CLASS_GET (in PIC mode) */\n    FT_Library  library = stroker->library;\n\n    FT_UNUSED( library );\n\n\n    if ( !pglyph )\n      goto Exit;\n\n    glyph = *pglyph;\n    if ( !glyph || glyph->clazz != FT_OUTLINE_GLYPH_CLASS_GET )\n      goto Exit;\n\n    {\n      FT_Glyph  copy;\n\n\n      error = FT_Glyph_Copy( glyph, &copy );\n      if ( error )\n        goto Exit;\n\n      glyph = copy;\n    }\n\n    {\n      FT_OutlineGlyph  oglyph  = (FT_OutlineGlyph)glyph;\n      FT_Outline*      outline = &oglyph->outline;\n      FT_UInt          num_points, num_contours;\n\n\n      error = FT_Stroker_ParseOutline( stroker, outline, FALSE );\n      if ( error )\n        goto Fail;\n\n      FT_Stroker_GetCounts( stroker, &num_points, &num_contours );\n\n      FT_Outline_Done( glyph->library, outline );\n\n      error = FT_Outline_New( glyph->library,\n                              num_points, num_contours, outline );\n      if ( error )\n        goto Fail;\n\n      outline->n_points   = 0;\n      outline->n_contours = 0;\n\n      FT_Stroker_Export( stroker, outline );\n    }\n\n    if ( destroy )\n      FT_Done_Glyph( *pglyph );\n\n    *pglyph = glyph;\n    goto Exit;\n\n  Fail:\n    FT_Done_Glyph( glyph );\n    glyph = NULL;\n\n    if ( !destroy )\n      *pglyph = NULL;\n\n  Exit:\n    return error;\n  }\n\n\n  /* documentation is in ftstroke.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Glyph_StrokeBorder( FT_Glyph    *pglyph,\n                         FT_Stroker   stroker,\n                         FT_Bool      inside,\n                         FT_Bool      destroy )\n  {\n    FT_Error  error = FT_ERR( Invalid_Argument );\n    FT_Glyph  glyph = NULL;\n\n    /* for FT_OUTLINE_GLYPH_CLASS_GET (in PIC mode) */\n    FT_Library  library = stroker->library;\n\n    FT_UNUSED( library );\n\n\n    if ( !pglyph )\n      goto Exit;\n\n    glyph = *pglyph;\n    if ( !glyph || glyph->clazz != FT_OUTLINE_GLYPH_CLASS_GET )\n      goto Exit;\n\n    {\n      FT_Glyph  copy;\n\n\n      error = FT_Glyph_Copy( glyph, &copy );\n      if ( error )\n        goto Exit;\n\n      glyph = copy;\n    }\n\n    {\n      FT_OutlineGlyph   oglyph  = (FT_OutlineGlyph)glyph;\n      FT_StrokerBorder  border;\n      FT_Outline*       outline = &oglyph->outline;\n      FT_UInt           num_points, num_contours;\n\n\n      border = FT_Outline_GetOutsideBorder( outline );\n      if ( inside )\n      {\n        if ( border == FT_STROKER_BORDER_LEFT )\n          border = FT_STROKER_BORDER_RIGHT;\n        else\n          border = FT_STROKER_BORDER_LEFT;\n      }\n\n      error = FT_Stroker_ParseOutline( stroker, outline, FALSE );\n      if ( error )\n        goto Fail;\n\n      FT_Stroker_GetBorderCounts( stroker, border,\n                                  &num_points, &num_contours );\n\n      FT_Outline_Done( glyph->library, outline );\n\n      error = FT_Outline_New( glyph->library,\n                              num_points,\n                              num_contours,\n                              outline );\n      if ( error )\n        goto Fail;\n\n      outline->n_points   = 0;\n      outline->n_contours = 0;\n\n      FT_Stroker_ExportBorder( stroker, border, outline );\n    }\n\n    if ( destroy )\n      FT_Done_Glyph( *pglyph );\n\n    *pglyph = glyph;\n    goto Exit;\n\n  Fail:\n    FT_Done_Glyph( glyph );\n    glyph = NULL;\n\n    if ( !destroy )\n      *pglyph = NULL;\n\n  Exit:\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftsynth.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsynth.c                                                              */\n/*                                                                         */\n/*    FreeType synthesizing code for emboldening and slanting (body).      */\n/*                                                                         */\n/*  Copyright 2000-2006, 2010, 2012-2014 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_SYNTHESIS_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_OUTLINE_H\n#include FT_BITMAP_H\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_synth\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****   EXPERIMENTAL OBLIQUING SUPPORT                                ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* documentation is in ftsynth.h */\n\n  FT_EXPORT_DEF( void )\n  FT_GlyphSlot_Oblique( FT_GlyphSlot  slot )\n  {\n    FT_Matrix    transform;\n    FT_Outline*  outline;\n\n\n    if ( !slot )\n      return;\n\n    outline = &slot->outline;\n\n    /* only oblique outline glyphs */\n    if ( slot->format != FT_GLYPH_FORMAT_OUTLINE )\n      return;\n\n    /* we don't touch the advance width */\n\n    /* For italic, simply apply a shear transform, with an angle */\n    /* of about 12 degrees.                                      */\n\n    transform.xx = 0x10000L;\n    transform.yx = 0x00000L;\n\n    transform.xy = 0x0366AL;\n    transform.yy = 0x10000L;\n\n    FT_Outline_Transform( outline, &transform );\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****   EXPERIMENTAL EMBOLDENING SUPPORT                              ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* documentation is in ftsynth.h */\n\n  FT_EXPORT_DEF( void )\n  FT_GlyphSlot_Embolden( FT_GlyphSlot  slot )\n  {\n    FT_Library  library;\n    FT_Face     face;\n    FT_Error    error;\n    FT_Pos      xstr, ystr;\n\n\n    if ( !slot )\n      return;\n\n    library = slot->library;\n    face    = slot->face;\n\n    if ( slot->format != FT_GLYPH_FORMAT_OUTLINE &&\n         slot->format != FT_GLYPH_FORMAT_BITMAP  )\n      return;\n\n    /* some reasonable strength */\n    xstr = FT_MulFix( face->units_per_EM,\n                      face->size->metrics.y_scale ) / 24;\n    ystr = xstr;\n\n    if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )\n      FT_Outline_EmboldenXY( &slot->outline, xstr, ystr );\n\n    else /* slot->format == FT_GLYPH_FORMAT_BITMAP */\n    {\n      /* round to full pixels */\n      xstr &= ~63;\n      if ( xstr == 0 )\n        xstr = 1 << 6;\n      ystr &= ~63;\n\n      /*\n       * XXX: overflow check for 16-bit system, for compatibility\n       *      with FT_GlyphSlot_Embolden() since freetype-2.1.10.\n       *      unfortunately, this function return no informations\n       *      about the cause of error.\n       */\n      if ( ( ystr >> 6 ) > FT_INT_MAX || ( ystr >> 6 ) < FT_INT_MIN )\n      {\n        FT_TRACE1(( \"FT_GlyphSlot_Embolden:\" ));\n        FT_TRACE1(( \"too strong embolding parameter ystr=%d\\n\", ystr ));\n        return;\n      }\n      error = FT_GlyphSlot_Own_Bitmap( slot );\n      if ( error )\n        return;\n\n      error = FT_Bitmap_Embolden( library, &slot->bitmap, xstr, ystr );\n      if ( error )\n        return;\n    }\n\n    if ( slot->advance.x )\n      slot->advance.x += xstr;\n\n    if ( slot->advance.y )\n      slot->advance.y += ystr;\n\n    slot->metrics.width        += xstr;\n    slot->metrics.height       += ystr;\n    slot->metrics.horiAdvance  += xstr;\n    slot->metrics.vertAdvance  += ystr;\n    slot->metrics.horiBearingY += ystr;\n\n    /* XXX: 16-bit overflow case must be excluded before here */\n    if ( slot->format == FT_GLYPH_FORMAT_BITMAP )\n      slot->bitmap_top += (FT_Int)( ystr >> 6 );\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftsystem.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsystem.c                                                             */\n/*                                                                         */\n/*    ANSI-specific FreeType low-level system interface (body).            */\n/*                                                                         */\n/*  Copyright 1996-2002, 2006, 2008-2011, 2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file contains the default interface used by FreeType to access   */\n  /* low-level, i.e. memory management, i/o access as well as thread       */\n  /* synchronisation.  It can be replaced by user-specific routines if     */\n  /* necessary.                                                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_SYSTEM_H\n#include FT_ERRORS_H\n#include FT_TYPES_H\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                       MEMORY MANAGEMENT INTERFACE                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* It is not necessary to do any error checking for the                  */\n  /* allocation-related functions.  This will be done by the higher level  */\n  /* routines like ft_mem_alloc() or ft_mem_realloc().                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    ft_alloc                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The memory allocation function.                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory :: A pointer to the memory object.                          */\n  /*                                                                       */\n  /*    size   :: The requested size in bytes.                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The address of newly allocated block.                              */\n  /*                                                                       */\n  FT_CALLBACK_DEF( void* )\n  ft_alloc( FT_Memory  memory,\n            long       size )\n  {\n    FT_UNUSED( memory );\n\n    return ft_smalloc( size );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    ft_realloc                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The memory reallocation function.                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory   :: A pointer to the memory object.                        */\n  /*                                                                       */\n  /*    cur_size :: The current size of the allocated memory block.        */\n  /*                                                                       */\n  /*    new_size :: The newly requested size in bytes.                     */\n  /*                                                                       */\n  /*    block    :: The current address of the block in memory.            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The address of the reallocated memory block.                       */\n  /*                                                                       */\n  FT_CALLBACK_DEF( void* )\n  ft_realloc( FT_Memory  memory,\n              long       cur_size,\n              long       new_size,\n              void*      block )\n  {\n    FT_UNUSED( memory );\n    FT_UNUSED( cur_size );\n\n    return ft_srealloc( block, new_size );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    ft_free                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The memory release function.                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory  :: A pointer to the memory object.                         */\n  /*                                                                       */\n  /*    block   :: The address of block in memory to be freed.             */\n  /*                                                                       */\n  FT_CALLBACK_DEF( void )\n  ft_free( FT_Memory  memory,\n           void*      block )\n  {\n    FT_UNUSED( memory );\n\n    ft_sfree( block );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                     RESOURCE MANAGEMENT INTERFACE                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_io\n\n  /* We use the macro STREAM_FILE for convenience to extract the       */\n  /* system-specific stream handle from a given FreeType stream object */\n#define STREAM_FILE( stream )  ( (FT_FILE*)stream->descriptor.pointer )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    ft_ansi_stream_close                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The function to close a stream.                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream :: A pointer to the stream object.                          */\n  /*                                                                       */\n  FT_CALLBACK_DEF( void )\n  ft_ansi_stream_close( FT_Stream  stream )\n  {\n    ft_fclose( STREAM_FILE( stream ) );\n\n    stream->descriptor.pointer = NULL;\n    stream->size               = 0;\n    stream->base               = 0;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    ft_ansi_stream_io                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The function to open a stream.                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream :: A pointer to the stream object.                          */\n  /*                                                                       */\n  /*    offset :: The position in the data stream to start reading.        */\n  /*                                                                       */\n  /*    buffer :: The address of buffer to store the read data.            */\n  /*                                                                       */\n  /*    count  :: The number of bytes to read from the stream.             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The number of bytes actually read.  If `count' is zero (this is,   */\n  /*    the function is used for seeking), a non-zero return value         */\n  /*    indicates an error.                                                */\n  /*                                                                       */\n  FT_CALLBACK_DEF( unsigned long )\n  ft_ansi_stream_io( FT_Stream       stream,\n                     unsigned long   offset,\n                     unsigned char*  buffer,\n                     unsigned long   count )\n  {\n    FT_FILE*  file;\n\n\n    if ( !count && offset > stream->size )\n      return 1;\n\n    file = STREAM_FILE( stream );\n\n    if ( stream->pos != offset )\n      ft_fseek( file, offset, SEEK_SET );\n\n    return (unsigned long)ft_fread( buffer, 1, count, file );\n  }\n\n\n  /* documentation is in ftstream.h */\n\n  FT_BASE_DEF( FT_Error )\n  FT_Stream_Open( FT_Stream    stream,\n                  const char*  filepathname )\n  {\n    FT_FILE*  file;\n\n\n    if ( !stream )\n      return FT_THROW( Invalid_Stream_Handle );\n\n    stream->descriptor.pointer = NULL;\n    stream->pathname.pointer   = (char*)filepathname;\n    stream->base               = 0;\n    stream->pos                = 0;\n    stream->read               = NULL;\n    stream->close              = NULL;\n\n    file = ft_fopen( filepathname, \"rb\" );\n    if ( !file )\n    {\n      FT_ERROR(( \"FT_Stream_Open:\"\n                 \" could not open `%s'\\n\", filepathname ));\n\n      return FT_THROW( Cannot_Open_Resource );\n    }\n\n    ft_fseek( file, 0, SEEK_END );\n    stream->size = ft_ftell( file );\n    if ( !stream->size )\n    {\n      FT_ERROR(( \"FT_Stream_Open:\" ));\n      FT_ERROR(( \" opened `%s' but zero-sized\\n\", filepathname ));\n      ft_fclose( file );\n      return FT_THROW( Cannot_Open_Stream );\n    }\n    ft_fseek( file, 0, SEEK_SET );\n\n    stream->descriptor.pointer = file;\n    stream->read  = ft_ansi_stream_io;\n    stream->close = ft_ansi_stream_close;\n\n    FT_TRACE1(( \"FT_Stream_Open:\" ));\n    FT_TRACE1(( \" opened `%s' (%d bytes) successfully\\n\",\n                filepathname, stream->size ));\n\n    return FT_Err_Ok;\n  }\n\n#endif /* !FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */\n\n#ifdef FT_DEBUG_MEMORY\n\n  extern FT_Int\n  ft_mem_debug_init( FT_Memory  memory );\n\n  extern void\n  ft_mem_debug_done( FT_Memory  memory );\n\n#endif\n\n\n  /* documentation is in ftobjs.h */\n\n  FT_BASE_DEF( FT_Memory )\n  FT_New_Memory( void )\n  {\n    FT_Memory  memory;\n\n\n    memory = (FT_Memory)ft_smalloc( sizeof ( *memory ) );\n    if ( memory )\n    {\n      memory->user    = 0;\n      memory->alloc   = ft_alloc;\n      memory->realloc = ft_realloc;\n      memory->free    = ft_free;\n#ifdef FT_DEBUG_MEMORY\n      ft_mem_debug_init( memory );\n#endif\n    }\n\n    return memory;\n  }\n\n\n  /* documentation is in ftobjs.h */\n\n  FT_BASE_DEF( void )\n  FT_Done_Memory( FT_Memory  memory )\n  {\n#ifdef FT_DEBUG_MEMORY\n    ft_mem_debug_done( memory );\n#endif\n    ft_sfree( memory );\n  }\n\n\n/* cf. http://lists.gnu.org/archive/html/freetype/2006-09/msg00036.html */\n#ifdef _WIN32\n#include <windows.h>\n\n  FT_FILE* ft_fopen_win32(const char *fname, const char *mode)\n  {\n    // First try fopen, assuming nothing about character encodings.\n    FT_FILE *file = fopen(fname, mode);\n    if (!file)\n    {\n      // fopen failed. Assume the filename is UTF-8, convert to UTF-16, and try _wfopen.\n      WCHAR fnameW[MAX_PATH], modeW[8];\n      if (MultiByteToWideChar(CP_UTF8, 0, fname, -1, fnameW, _countof(fnameW)) &&\n          MultiByteToWideChar(CP_UTF8, 0, mode, -1, modeW, _countof(modeW)))\n      {\n        file = _wfopen(fnameW, modeW);\n      }\n    }\n    return file;\n  }\n#endif\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/fttrigon.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fttrigon.c                                                             */\n/*                                                                         */\n/*    FreeType trigonometric functions (body).                             */\n/*                                                                         */\n/*  Copyright 2001-2005, 2012-2014 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This is a fixed-point CORDIC implementation of trigonometric          */\n  /* functions as well as transformations between Cartesian and polar      */\n  /* coordinates.  The angles are represented as 16.16 fixed-point values  */\n  /* in degrees, i.e., the angular resolution is 2^-16 degrees.  Note that */\n  /* only vectors longer than 2^16*180/pi (or at least 22 bits) on a       */\n  /* discrete Cartesian grid can have the same or better angular           */\n  /* resolution.  Therefore, to maintain this precision, some functions    */\n  /* require an interim upscaling of the vectors, whereas others operate   */\n  /* with 24-bit long vectors directly.                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_CALC_H\n#include FT_TRIGONOMETRY_H\n\n\n  /* the Cordic shrink factor 0.858785336480436 * 2^32 */\n#define FT_TRIG_SCALE      0xDBD95B16UL\n\n  /* the highest bit in overflow-safe vector components, */\n  /* MSB of 0.858785336480436 * sqrt(0.5) * 2^30         */\n#define FT_TRIG_SAFE_MSB   29\n\n  /* this table was generated for FT_PI = 180L << 16, i.e. degrees */\n#define FT_TRIG_MAX_ITERS  23\n\n  static const FT_Angle\n  ft_trig_arctan_table[] =\n  {\n    1740967L, 919879L, 466945L, 234379L, 117304L, 58666L, 29335L,\n    14668L, 7334L, 3667L, 1833L, 917L, 458L, 229L, 115L,\n    57L, 29L, 14L, 7L, 4L, 2L, 1L\n  };\n\n\n#ifdef FT_LONG64\n\n  /* multiply a given value by the CORDIC shrink factor */\n  static FT_Fixed\n  ft_trig_downscale( FT_Fixed  val )\n  {\n    FT_Int  s = 1;\n\n\n    if ( val < 0 )\n    {\n       val = -val;\n       s = -1;\n    }\n\n    /* 0x40000000 comes from regression analysis between true */\n    /* and CORDIC hypotenuse, so it minimizes the error       */\n    val = (FT_Fixed)( ( (FT_Int64)val * FT_TRIG_SCALE + 0x40000000UL ) >> 32 );\n\n    return s < 0 ? -val : val;\n  }\n\n#else /* !FT_LONG64 */\n\n  /* multiply a given value by the CORDIC shrink factor */\n  static FT_Fixed\n  ft_trig_downscale( FT_Fixed  val )\n  {\n    FT_Int     s = 1;\n    FT_UInt32  lo1, hi1, lo2, hi2, lo, hi, i1, i2;\n\n\n    if ( val < 0 )\n    {\n       val = -val;\n       s = -1;\n    }\n\n    lo1 = val & 0x0000FFFFU;\n    hi1 = val >> 16;\n    lo2 = FT_TRIG_SCALE & 0x0000FFFFU;\n    hi2 = FT_TRIG_SCALE >> 16;\n\n    lo = lo1 * lo2;\n    i1 = lo1 * hi2;\n    i2 = lo2 * hi1;\n    hi = hi1 * hi2;\n\n    /* Check carry overflow of i1 + i2 */\n    i1 += i2;\n    hi += (FT_UInt32)( i1 < i2 ) << 16;\n\n    hi += i1 >> 16;\n    i1  = i1 << 16;\n\n    /* Check carry overflow of i1 + lo */\n    lo += i1;\n    hi += ( lo < i1 );\n\n    /* 0x40000000 comes from regression analysis between true */\n    /* and CORDIC hypotenuse, so it minimizes the error       */\n\n    /* Check carry overflow of lo + 0x40000000 */\n    lo += 0x40000000UL;\n    hi += ( lo < 0x40000000UL );\n\n    val  = (FT_Fixed)hi;\n\n    return s < 0 ? -val : val;\n  }\n\n#endif /* !FT_LONG64 */\n\n\n  /* undefined and never called for zero vector */\n  static FT_Int\n  ft_trig_prenorm( FT_Vector*  vec )\n  {\n    FT_Pos  x, y;\n    FT_Int  shift;\n\n\n    x = vec->x;\n    y = vec->y;\n\n    shift = FT_MSB( FT_ABS( x ) | FT_ABS( y ) );\n\n    if ( shift <= FT_TRIG_SAFE_MSB )\n    {\n      shift  = FT_TRIG_SAFE_MSB - shift;\n      vec->x = (FT_Pos)( (FT_ULong)x << shift );\n      vec->y = (FT_Pos)( (FT_ULong)y << shift );\n    }\n    else\n    {\n      shift -= FT_TRIG_SAFE_MSB;\n      vec->x = x >> shift;\n      vec->y = y >> shift;\n      shift  = -shift;\n    }\n\n    return shift;\n  }\n\n\n  static void\n  ft_trig_pseudo_rotate( FT_Vector*  vec,\n                         FT_Angle    theta )\n  {\n    FT_Int           i;\n    FT_Fixed         x, y, xtemp, b;\n    const FT_Angle  *arctanptr;\n\n\n    x = vec->x;\n    y = vec->y;\n\n    /* Rotate inside [-PI/4,PI/4] sector */\n    while ( theta < -FT_ANGLE_PI4 )\n    {\n      xtemp  =  y;\n      y      = -x;\n      x      =  xtemp;\n      theta +=  FT_ANGLE_PI2;\n    }\n\n    while ( theta > FT_ANGLE_PI4 )\n    {\n      xtemp  = -y;\n      y      =  x;\n      x      =  xtemp;\n      theta -=  FT_ANGLE_PI2;\n    }\n\n    arctanptr = ft_trig_arctan_table;\n\n    /* Pseudorotations, with right shifts */\n    for ( i = 1, b = 1; i < FT_TRIG_MAX_ITERS; b <<= 1, i++ )\n    {\n      if ( theta < 0 )\n      {\n        xtemp  = x + ( ( y + b ) >> i );\n        y      = y - ( ( x + b ) >> i );\n        x      = xtemp;\n        theta += *arctanptr++;\n      }\n      else\n      {\n        xtemp  = x - ( ( y + b ) >> i );\n        y      = y + ( ( x + b ) >> i );\n        x      = xtemp;\n        theta -= *arctanptr++;\n      }\n    }\n\n    vec->x = x;\n    vec->y = y;\n  }\n\n\n  static void\n  ft_trig_pseudo_polarize( FT_Vector*  vec )\n  {\n    FT_Angle         theta;\n    FT_Int           i;\n    FT_Fixed         x, y, xtemp, b;\n    const FT_Angle  *arctanptr;\n\n\n    x = vec->x;\n    y = vec->y;\n\n    /* Get the vector into [-PI/4,PI/4] sector */\n    if ( y > x )\n    {\n      if ( y > -x )\n      {\n        theta =  FT_ANGLE_PI2;\n        xtemp =  y;\n        y     = -x;\n        x     =  xtemp;\n      }\n      else\n      {\n        theta =  y > 0 ? FT_ANGLE_PI : -FT_ANGLE_PI;\n        x     = -x;\n        y     = -y;\n      }\n    }\n    else\n    {\n      if ( y < -x )\n      {\n        theta = -FT_ANGLE_PI2;\n        xtemp = -y;\n        y     =  x;\n        x     =  xtemp;\n      }\n      else\n      {\n        theta = 0;\n      }\n    }\n\n    arctanptr = ft_trig_arctan_table;\n\n    /* Pseudorotations, with right shifts */\n    for ( i = 1, b = 1; i < FT_TRIG_MAX_ITERS; b <<= 1, i++ )\n    {\n      if ( y > 0 )\n      {\n        xtemp  = x + ( ( y + b ) >> i );\n        y      = y - ( ( x + b ) >> i );\n        x      = xtemp;\n        theta += *arctanptr++;\n      }\n      else\n      {\n        xtemp  = x - ( ( y + b ) >> i );\n        y      = y + ( ( x + b ) >> i );\n        x      = xtemp;\n        theta -= *arctanptr++;\n      }\n    }\n\n    /* round theta to acknowledge its error that mostly comes */\n    /* from accumulated rounding errors in the arctan table   */\n    if ( theta >= 0 )\n      theta = FT_PAD_ROUND( theta, 16 );\n    else\n      theta = -FT_PAD_ROUND( -theta, 16 );\n\n    vec->x = x;\n    vec->y = theta;\n  }\n\n\n  /* documentation is in fttrigon.h */\n\n  FT_EXPORT_DEF( FT_Fixed )\n  FT_Cos( FT_Angle  angle )\n  {\n    FT_Vector  v;\n\n\n    v.x = FT_TRIG_SCALE >> 8;\n    v.y = 0;\n    ft_trig_pseudo_rotate( &v, angle );\n\n    return ( v.x + 0x80L ) >> 8;\n  }\n\n\n  /* documentation is in fttrigon.h */\n\n  FT_EXPORT_DEF( FT_Fixed )\n  FT_Sin( FT_Angle  angle )\n  {\n    return FT_Cos( FT_ANGLE_PI2 - angle );\n  }\n\n\n  /* documentation is in fttrigon.h */\n\n  FT_EXPORT_DEF( FT_Fixed )\n  FT_Tan( FT_Angle  angle )\n  {\n    FT_Vector  v;\n\n\n    v.x = FT_TRIG_SCALE >> 8;\n    v.y = 0;\n    ft_trig_pseudo_rotate( &v, angle );\n\n    return FT_DivFix( v.y, v.x );\n  }\n\n\n  /* documentation is in fttrigon.h */\n\n  FT_EXPORT_DEF( FT_Angle )\n  FT_Atan2( FT_Fixed  dx,\n            FT_Fixed  dy )\n  {\n    FT_Vector  v;\n\n\n    if ( dx == 0 && dy == 0 )\n      return 0;\n\n    v.x = dx;\n    v.y = dy;\n    ft_trig_prenorm( &v );\n    ft_trig_pseudo_polarize( &v );\n\n    return v.y;\n  }\n\n\n  /* documentation is in fttrigon.h */\n\n  FT_EXPORT_DEF( void )\n  FT_Vector_Unit( FT_Vector*  vec,\n                  FT_Angle    angle )\n  {\n    if ( !vec )\n      return;\n\n    vec->x = FT_TRIG_SCALE >> 8;\n    vec->y = 0;\n    ft_trig_pseudo_rotate( vec, angle );\n    vec->x = ( vec->x + 0x80L ) >> 8;\n    vec->y = ( vec->y + 0x80L ) >> 8;\n  }\n\n\n  /* these macros return 0 for positive numbers,\n     and -1 for negative ones */\n#define FT_SIGN_LONG( x )   ( (x) >> ( FT_SIZEOF_LONG * 8 - 1 ) )\n#define FT_SIGN_INT( x )    ( (x) >> ( FT_SIZEOF_INT * 8 - 1 ) )\n#define FT_SIGN_INT32( x )  ( (x) >> 31 )\n#define FT_SIGN_INT16( x )  ( (x) >> 15 )\n\n\n  /* documentation is in fttrigon.h */\n\n  FT_EXPORT_DEF( void )\n  FT_Vector_Rotate( FT_Vector*  vec,\n                    FT_Angle    angle )\n  {\n    FT_Int     shift;\n    FT_Vector  v;\n\n\n    if ( !vec )\n      return;\n\n    v.x   = vec->x;\n    v.y   = vec->y;\n\n    if ( angle && ( v.x != 0 || v.y != 0 ) )\n    {\n      shift = ft_trig_prenorm( &v );\n      ft_trig_pseudo_rotate( &v, angle );\n      v.x = ft_trig_downscale( v.x );\n      v.y = ft_trig_downscale( v.y );\n\n      if ( shift > 0 )\n      {\n        FT_Int32  half = (FT_Int32)1L << ( shift - 1 );\n\n\n        vec->x = ( v.x + half + FT_SIGN_LONG( v.x ) ) >> shift;\n        vec->y = ( v.y + half + FT_SIGN_LONG( v.y ) ) >> shift;\n      }\n      else\n      {\n        shift  = -shift;\n        vec->x = (FT_Pos)( (FT_ULong)v.x << shift );\n        vec->y = (FT_Pos)( (FT_ULong)v.y << shift );\n      }\n    }\n  }\n\n\n  /* documentation is in fttrigon.h */\n\n  FT_EXPORT_DEF( FT_Fixed )\n  FT_Vector_Length( FT_Vector*  vec )\n  {\n    FT_Int     shift;\n    FT_Vector  v;\n\n\n    if ( !vec )\n      return 0;\n\n    v = *vec;\n\n    /* handle trivial cases */\n    if ( v.x == 0 )\n    {\n      return FT_ABS( v.y );\n    }\n    else if ( v.y == 0 )\n    {\n      return FT_ABS( v.x );\n    }\n\n    /* general case */\n    shift = ft_trig_prenorm( &v );\n    ft_trig_pseudo_polarize( &v );\n\n    v.x = ft_trig_downscale( v.x );\n\n    if ( shift > 0 )\n      return ( v.x + ( 1 << ( shift - 1 ) ) ) >> shift;\n\n    return (FT_Fixed)( (FT_UInt32)v.x << -shift );\n  }\n\n\n  /* documentation is in fttrigon.h */\n\n  FT_EXPORT_DEF( void )\n  FT_Vector_Polarize( FT_Vector*  vec,\n                      FT_Fixed   *length,\n                      FT_Angle   *angle )\n  {\n    FT_Int     shift;\n    FT_Vector  v;\n\n\n    if ( !vec || !length || !angle )\n      return;\n\n    v = *vec;\n\n    if ( v.x == 0 && v.y == 0 )\n      return;\n\n    shift = ft_trig_prenorm( &v );\n    ft_trig_pseudo_polarize( &v );\n\n    v.x = ft_trig_downscale( v.x );\n\n    *length = shift >= 0 ?                      ( v.x >>  shift )\n                         : (FT_Fixed)( (FT_UInt32)v.x << -shift );\n    *angle  = v.y;\n  }\n\n\n  /* documentation is in fttrigon.h */\n\n  FT_EXPORT_DEF( void )\n  FT_Vector_From_Polar( FT_Vector*  vec,\n                        FT_Fixed    length,\n                        FT_Angle    angle )\n  {\n    if ( !vec )\n      return;\n\n    vec->x = length;\n    vec->y = 0;\n\n    FT_Vector_Rotate( vec, angle );\n  }\n\n\n  /* documentation is in fttrigon.h */\n\n  FT_EXPORT_DEF( FT_Angle )\n  FT_Angle_Diff( FT_Angle  angle1,\n                 FT_Angle  angle2 )\n  {\n    FT_Angle  delta = angle2 - angle1;\n\n\n    delta %= FT_ANGLE_2PI;\n    if ( delta < 0 )\n      delta += FT_ANGLE_2PI;\n\n    if ( delta > FT_ANGLE_PI )\n      delta -= FT_ANGLE_2PI;\n\n    return delta;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/fttype1.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fttype1.c                                                              */\n/*                                                                         */\n/*    FreeType utility file for PS names support (body).                   */\n/*                                                                         */\n/*  Copyright 2002-2004, 2011, 2014 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_SERVICE_H\n#include FT_SERVICE_POSTSCRIPT_INFO_H\n\n\n  /* documentation is in t1tables.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Get_PS_Font_Info( FT_Face          face,\n                       PS_FontInfoRec*  afont_info )\n  {\n    FT_Error           error;\n    FT_Service_PsInfo  service;\n\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    if ( !afont_info )\n      return FT_THROW( Invalid_Argument );\n\n    FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );\n\n    if ( service && service->ps_get_font_info )\n      error = service->ps_get_font_info( face, afont_info );\n    else\n      error = FT_THROW( Invalid_Argument );\n\n    return error;\n  }\n\n\n  /* documentation is in t1tables.h */\n\n  FT_EXPORT_DEF( FT_Int )\n  FT_Has_PS_Glyph_Names( FT_Face  face )\n  {\n    FT_Int             result = 0;\n    FT_Service_PsInfo  service;\n\n\n    if ( face )\n    {\n      FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );\n\n      if ( service && service->ps_has_glyph_names )\n        result = service->ps_has_glyph_names( face );\n    }\n\n    return result;\n  }\n\n\n  /* documentation is in t1tables.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Get_PS_Font_Private( FT_Face         face,\n                          PS_PrivateRec*  afont_private )\n  {\n    FT_Error           error;\n    FT_Service_PsInfo  service;\n\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    if ( !afont_private )\n      return FT_THROW( Invalid_Argument );\n\n    FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );\n\n    if ( service && service->ps_get_font_private )\n      error = service->ps_get_font_private( face, afont_private );\n    else\n      error = FT_THROW( Invalid_Argument );\n\n    return error;\n  }\n\n\n  /* documentation is in t1tables.h */\n\n  FT_EXPORT_DEF( FT_Long )\n  FT_Get_PS_Font_Value( FT_Face       face,\n                        PS_Dict_Keys  key,\n                        FT_UInt       idx,\n                        void         *value,\n                        FT_Long       value_len )\n  {\n    FT_Int             result  = 0;\n    FT_Service_PsInfo  service = NULL;\n\n\n    if ( face )\n    {\n      FT_FACE_FIND_SERVICE( face, service, POSTSCRIPT_INFO );\n\n      if ( service && service->ps_get_font_value )\n        result = service->ps_get_font_value( face, key, idx,\n                                             value, value_len );\n    }\n\n    return result;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftutil.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftutil.c                                                               */\n/*                                                                         */\n/*    FreeType utility file for memory and list management (body).         */\n/*                                                                         */\n/*  Copyright 2002, 2004-2007, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_MEMORY_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_LIST_H\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_memory\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                                                               *****/\n  /*****               M E M O R Y   M A N A G E M E N T               *****/\n  /*****                                                               *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  FT_BASE_DEF( FT_Pointer )\n  ft_mem_alloc( FT_Memory  memory,\n                FT_Long    size,\n                FT_Error  *p_error )\n  {\n    FT_Error    error;\n    FT_Pointer  block = ft_mem_qalloc( memory, size, &error );\n\n    if ( !error && size > 0 )\n      FT_MEM_ZERO( block, size );\n\n    *p_error = error;\n    return block;\n  }\n\n\n  FT_BASE_DEF( FT_Pointer )\n  ft_mem_qalloc( FT_Memory  memory,\n                 FT_Long    size,\n                 FT_Error  *p_error )\n  {\n    FT_Error    error = FT_Err_Ok;\n    FT_Pointer  block = NULL;\n\n\n    if ( size > 0 )\n    {\n      block = memory->alloc( memory, size );\n      if ( block == NULL )\n        error = FT_THROW( Out_Of_Memory );\n    }\n    else if ( size < 0 )\n    {\n      /* may help catch/prevent security issues */\n      error = FT_THROW( Invalid_Argument );\n    }\n\n    *p_error = error;\n    return block;\n  }\n\n\n  FT_BASE_DEF( FT_Pointer )\n  ft_mem_realloc( FT_Memory  memory,\n                  FT_Long    item_size,\n                  FT_Long    cur_count,\n                  FT_Long    new_count,\n                  void*      block,\n                  FT_Error  *p_error )\n  {\n    FT_Error  error = FT_Err_Ok;\n\n\n    block = ft_mem_qrealloc( memory, item_size,\n                             cur_count, new_count, block, &error );\n    if ( !error && new_count > cur_count )\n      FT_MEM_ZERO( (char*)block + cur_count * item_size,\n                   ( new_count - cur_count ) * item_size );\n\n    *p_error = error;\n    return block;\n  }\n\n\n  FT_BASE_DEF( FT_Pointer )\n  ft_mem_qrealloc( FT_Memory  memory,\n                   FT_Long    item_size,\n                   FT_Long    cur_count,\n                   FT_Long    new_count,\n                   void*      block,\n                   FT_Error  *p_error )\n  {\n    FT_Error  error = FT_Err_Ok;\n\n\n    /* Note that we now accept `item_size == 0' as a valid parameter, in\n     * order to cover very weird cases where an ALLOC_MULT macro would be\n     * called.\n     */\n    if ( cur_count < 0 || new_count < 0 || item_size < 0 )\n    {\n      /* may help catch/prevent nasty security issues */\n      error = FT_THROW( Invalid_Argument );\n    }\n    else if ( new_count == 0 || item_size == 0 )\n    {\n      ft_mem_free( memory, block );\n      block = NULL;\n    }\n    else if ( new_count > FT_INT_MAX/item_size )\n    {\n      error = FT_THROW( Array_Too_Large );\n    }\n    else if ( cur_count == 0 )\n    {\n      FT_ASSERT( block == NULL );\n\n      block = ft_mem_alloc( memory, new_count*item_size, &error );\n    }\n    else\n    {\n      FT_Pointer  block2;\n      FT_Long     cur_size = cur_count*item_size;\n      FT_Long     new_size = new_count*item_size;\n\n\n      block2 = memory->realloc( memory, cur_size, new_size, block );\n      if ( block2 == NULL )\n        error = FT_THROW( Out_Of_Memory );\n      else\n        block = block2;\n    }\n\n    *p_error = error;\n    return block;\n  }\n\n\n  FT_BASE_DEF( void )\n  ft_mem_free( FT_Memory   memory,\n               const void *P )\n  {\n    if ( P )\n      memory->free( memory, (void*)P );\n  }\n\n\n  FT_BASE_DEF( FT_Pointer )\n  ft_mem_dup( FT_Memory    memory,\n              const void*  address,\n              FT_ULong     size,\n              FT_Error    *p_error )\n  {\n    FT_Error    error;\n    FT_Pointer  p = ft_mem_qalloc( memory, size, &error );\n\n\n    if ( !error && address )\n      ft_memcpy( p, address, size );\n\n    *p_error = error;\n    return p;\n  }\n\n\n  FT_BASE_DEF( FT_Pointer )\n  ft_mem_strdup( FT_Memory    memory,\n                 const char*  str,\n                 FT_Error    *p_error )\n  {\n    FT_ULong  len = str ? (FT_ULong)ft_strlen( str ) + 1\n                        : 0;\n\n\n    return ft_mem_dup( memory, str, len, p_error );\n  }\n\n\n  FT_BASE_DEF( FT_Int )\n  ft_mem_strcpyn( char*        dst,\n                  const char*  src,\n                  FT_ULong     size )\n  {\n    while ( size > 1 && *src != 0 )\n    {\n      *dst++ = *src++;\n      size--;\n    }\n\n    *dst = 0;  /* always zero-terminate */\n\n    return *src != 0;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                                                               *****/\n  /*****            D O U B L Y   L I N K E D   L I S T S              *****/\n  /*****                                                               *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_list\n\n  /* documentation is in ftlist.h */\n\n  FT_EXPORT_DEF( FT_ListNode )\n  FT_List_Find( FT_List  list,\n                void*    data )\n  {\n    FT_ListNode  cur;\n\n\n    if ( !list )\n      return NULL;\n\n    cur = list->head;\n    while ( cur )\n    {\n      if ( cur->data == data )\n        return cur;\n\n      cur = cur->next;\n    }\n\n    return NULL;\n  }\n\n\n  /* documentation is in ftlist.h */\n\n  FT_EXPORT_DEF( void )\n  FT_List_Add( FT_List      list,\n               FT_ListNode  node )\n  {\n    FT_ListNode  before;\n\n\n    if ( !list || !node )\n      return;\n\n    before = list->tail;\n\n    node->next = 0;\n    node->prev = before;\n\n    if ( before )\n      before->next = node;\n    else\n      list->head = node;\n\n    list->tail = node;\n  }\n\n\n  /* documentation is in ftlist.h */\n\n  FT_EXPORT_DEF( void )\n  FT_List_Insert( FT_List      list,\n                  FT_ListNode  node )\n  {\n    FT_ListNode  after;\n\n\n    if ( !list || !node )\n      return;\n\n    after = list->head;\n\n    node->next = after;\n    node->prev = 0;\n\n    if ( !after )\n      list->tail = node;\n    else\n      after->prev = node;\n\n    list->head = node;\n  }\n\n\n  /* documentation is in ftlist.h */\n\n  FT_EXPORT_DEF( void )\n  FT_List_Remove( FT_List      list,\n                  FT_ListNode  node )\n  {\n    FT_ListNode  before, after;\n\n\n    if ( !list || !node )\n      return;\n\n    before = node->prev;\n    after  = node->next;\n\n    if ( before )\n      before->next = after;\n    else\n      list->head = after;\n\n    if ( after )\n      after->prev = before;\n    else\n      list->tail = before;\n  }\n\n\n  /* documentation is in ftlist.h */\n\n  FT_EXPORT_DEF( void )\n  FT_List_Up( FT_List      list,\n              FT_ListNode  node )\n  {\n    FT_ListNode  before, after;\n\n\n    if ( !list || !node )\n      return;\n\n    before = node->prev;\n    after  = node->next;\n\n    /* check whether we are already on top of the list */\n    if ( !before )\n      return;\n\n    before->next = after;\n\n    if ( after )\n      after->prev = before;\n    else\n      list->tail = before;\n\n    node->prev       = 0;\n    node->next       = list->head;\n    list->head->prev = node;\n    list->head       = node;\n  }\n\n\n  /* documentation is in ftlist.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_List_Iterate( FT_List           list,\n                   FT_List_Iterator  iterator,\n                   void*             user )\n  {\n    FT_ListNode  cur;\n    FT_Error     error = FT_Err_Ok;\n\n\n    if ( !list || !iterator )\n      return FT_THROW( Invalid_Argument );\n\n    cur = list->head;\n\n    while ( cur )\n    {\n      FT_ListNode  next = cur->next;\n\n\n      error = iterator( cur, user );\n      if ( error )\n        break;\n\n      cur = next;\n    }\n\n    return error;\n  }\n\n\n  /* documentation is in ftlist.h */\n\n  FT_EXPORT_DEF( void )\n  FT_List_Finalize( FT_List             list,\n                    FT_List_Destructor  destroy,\n                    FT_Memory           memory,\n                    void*               user )\n  {\n    FT_ListNode  cur;\n\n\n    if ( !list || !memory )\n      return;\n\n    cur = list->head;\n    while ( cur )\n    {\n      FT_ListNode  next = cur->next;\n      void*        data = cur->data;\n\n\n      if ( destroy )\n        destroy( memory, data, user );\n\n      FT_FREE( cur );\n      cur = next;\n    }\n\n    list->head = 0;\n    list->tail = 0;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftwinfnt.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftwinfnt.c                                                             */\n/*                                                                         */\n/*    FreeType API for accessing Windows FNT specific info (body).         */\n/*                                                                         */\n/*  Copyright 2003, 2004, 2014 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_WINFONTS_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_SERVICE_WINFNT_H\n\n\n  /* documentation is in ftwinfnt.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Get_WinFNT_Header( FT_Face               face,\n                        FT_WinFNT_HeaderRec  *header )\n  {\n    FT_Service_WinFnt  service;\n    FT_Error           error;\n\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    if ( !header )\n      return FT_THROW( Invalid_Argument );\n\n    FT_FACE_LOOKUP_SERVICE( face, service, WINFNT );\n\n    if ( service )\n      error = service->get_header( face, header );\n    else\n      error = FT_THROW( Invalid_Argument );\n\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/ftxf86.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftxf86.c                                                               */\n/*                                                                         */\n/*    FreeType utility file for X11 support (body).                        */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_XFREE86_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_SERVICE_XFREE86_NAME_H\n\n\n  /* documentation is in ftxf86.h */\n\n  FT_EXPORT_DEF( const char* )\n  FT_Get_X11_Font_Format( FT_Face  face )\n  {\n    const char*  result = NULL;\n\n\n    if ( face )\n      FT_FACE_FIND_SERVICE( face, result, XF86_NAME );\n\n    return result;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/base/md5.c",
    "content": "/*\n * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc.\n * MD5 Message-Digest Algorithm (RFC 1321).\n *\n * Homepage:\n * http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5\n *\n * Author:\n * Alexander Peslyak, better known as Solar Designer <solar at openwall.com>\n *\n * This software was written by Alexander Peslyak in 2001.  No copyright is\n * claimed, and the software is hereby placed in the public domain.\n * In case this attempt to disclaim copyright and place the software in the\n * public domain is deemed null and void, then the software is\n * Copyright (c) 2001 Alexander Peslyak and it is hereby released to the\n * general public under the following terms:\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted.\n *\n * There's ABSOLUTELY NO WARRANTY, express or implied.\n *\n * (This is a heavily cut-down \"BSD license\".)\n *\n * This differs from Colin Plumb's older public domain implementation in that\n * no exactly 32-bit integer data type is required (any 32-bit or wider\n * unsigned integer data type will do), there's no compile-time endianness\n * configuration, and the function prototypes match OpenSSL's.  No code from\n * Colin Plumb's implementation has been reused; this comment merely compares\n * the properties of the two independent implementations.\n *\n * The primary goals of this implementation are portability and ease of use.\n * It is meant to be fast, but not as fast as possible.  Some known\n * optimizations are not included to reduce source code size and avoid\n * compile-time configuration.\n */\n\n#ifndef HAVE_OPENSSL\n\n#include <string.h>\n\n#include \"md5.h\"\n\n/*\n * The basic MD5 functions.\n *\n * F and G are optimized compared to their RFC 1321 definitions for\n * architectures that lack an AND-NOT instruction, just like in Colin Plumb's\n * implementation.\n */\n#define F(x, y, z)\t\t\t((z) ^ ((x) & ((y) ^ (z))))\n#define G(x, y, z)\t\t\t((y) ^ ((z) & ((x) ^ (y))))\n#define H(x, y, z)\t\t\t(((x) ^ (y)) ^ (z))\n#define H2(x, y, z)\t\t\t((x) ^ ((y) ^ (z)))\n#define I(x, y, z)\t\t\t((y) ^ ((x) | ~(z)))\n\n/*\n * The MD5 transformation for all four rounds.\n */\n#define STEP(f, a, b, c, d, x, t, s) \\\n\t(a) += f((b), (c), (d)) + (x) + (t); \\\n\t(a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s)))); \\\n\t(a) += (b);\n\n/*\n * SET reads 4 input bytes in little-endian byte order and stores them\n * in a properly aligned word in host byte order.\n *\n * The check for little-endian architectures that tolerate unaligned\n * memory accesses is just an optimization.  Nothing will break if it\n * doesn't work.\n */\n#if defined(__i386__) || defined(__x86_64__) || defined(__vax__)\n#define SET(n) \\\n\t(*(MD5_u32plus *)&ptr[(n) * 4])\n#define GET(n) \\\n\tSET(n)\n#else\n#define SET(n) \\\n\t(ctx->block[(n)] = \\\n\t(MD5_u32plus)ptr[(n) * 4] | \\\n\t((MD5_u32plus)ptr[(n) * 4 + 1] << 8) | \\\n\t((MD5_u32plus)ptr[(n) * 4 + 2] << 16) | \\\n\t((MD5_u32plus)ptr[(n) * 4 + 3] << 24))\n#define GET(n) \\\n\t(ctx->block[(n)])\n#endif\n\n/*\n * This processes one or more 64-byte data blocks, but does NOT update\n * the bit counters.  There are no alignment requirements.\n */\nstatic const void *body(MD5_CTX *ctx, const void *data, unsigned long size)\n{\n\tconst unsigned char *ptr;\n\tMD5_u32plus a, b, c, d;\n\tMD5_u32plus saved_a, saved_b, saved_c, saved_d;\n\n\tptr = (const unsigned char *)data;\n\n\ta = ctx->a;\n\tb = ctx->b;\n\tc = ctx->c;\n\td = ctx->d;\n\n\tdo {\n\t\tsaved_a = a;\n\t\tsaved_b = b;\n\t\tsaved_c = c;\n\t\tsaved_d = d;\n\n/* Round 1 */\n\t\tSTEP(F, a, b, c, d, SET(0), 0xd76aa478, 7)\n\t\tSTEP(F, d, a, b, c, SET(1), 0xe8c7b756, 12)\n\t\tSTEP(F, c, d, a, b, SET(2), 0x242070db, 17)\n\t\tSTEP(F, b, c, d, a, SET(3), 0xc1bdceee, 22)\n\t\tSTEP(F, a, b, c, d, SET(4), 0xf57c0faf, 7)\n\t\tSTEP(F, d, a, b, c, SET(5), 0x4787c62a, 12)\n\t\tSTEP(F, c, d, a, b, SET(6), 0xa8304613, 17)\n\t\tSTEP(F, b, c, d, a, SET(7), 0xfd469501, 22)\n\t\tSTEP(F, a, b, c, d, SET(8), 0x698098d8, 7)\n\t\tSTEP(F, d, a, b, c, SET(9), 0x8b44f7af, 12)\n\t\tSTEP(F, c, d, a, b, SET(10), 0xffff5bb1, 17)\n\t\tSTEP(F, b, c, d, a, SET(11), 0x895cd7be, 22)\n\t\tSTEP(F, a, b, c, d, SET(12), 0x6b901122, 7)\n\t\tSTEP(F, d, a, b, c, SET(13), 0xfd987193, 12)\n\t\tSTEP(F, c, d, a, b, SET(14), 0xa679438e, 17)\n\t\tSTEP(F, b, c, d, a, SET(15), 0x49b40821, 22)\n\n/* Round 2 */\n\t\tSTEP(G, a, b, c, d, GET(1), 0xf61e2562, 5)\n\t\tSTEP(G, d, a, b, c, GET(6), 0xc040b340, 9)\n\t\tSTEP(G, c, d, a, b, GET(11), 0x265e5a51, 14)\n\t\tSTEP(G, b, c, d, a, GET(0), 0xe9b6c7aa, 20)\n\t\tSTEP(G, a, b, c, d, GET(5), 0xd62f105d, 5)\n\t\tSTEP(G, d, a, b, c, GET(10), 0x02441453, 9)\n\t\tSTEP(G, c, d, a, b, GET(15), 0xd8a1e681, 14)\n\t\tSTEP(G, b, c, d, a, GET(4), 0xe7d3fbc8, 20)\n\t\tSTEP(G, a, b, c, d, GET(9), 0x21e1cde6, 5)\n\t\tSTEP(G, d, a, b, c, GET(14), 0xc33707d6, 9)\n\t\tSTEP(G, c, d, a, b, GET(3), 0xf4d50d87, 14)\n\t\tSTEP(G, b, c, d, a, GET(8), 0x455a14ed, 20)\n\t\tSTEP(G, a, b, c, d, GET(13), 0xa9e3e905, 5)\n\t\tSTEP(G, d, a, b, c, GET(2), 0xfcefa3f8, 9)\n\t\tSTEP(G, c, d, a, b, GET(7), 0x676f02d9, 14)\n\t\tSTEP(G, b, c, d, a, GET(12), 0x8d2a4c8a, 20)\n\n/* Round 3 */\n\t\tSTEP(H, a, b, c, d, GET(5), 0xfffa3942, 4)\n\t\tSTEP(H2, d, a, b, c, GET(8), 0x8771f681, 11)\n\t\tSTEP(H, c, d, a, b, GET(11), 0x6d9d6122, 16)\n\t\tSTEP(H2, b, c, d, a, GET(14), 0xfde5380c, 23)\n\t\tSTEP(H, a, b, c, d, GET(1), 0xa4beea44, 4)\n\t\tSTEP(H2, d, a, b, c, GET(4), 0x4bdecfa9, 11)\n\t\tSTEP(H, c, d, a, b, GET(7), 0xf6bb4b60, 16)\n\t\tSTEP(H2, b, c, d, a, GET(10), 0xbebfbc70, 23)\n\t\tSTEP(H, a, b, c, d, GET(13), 0x289b7ec6, 4)\n\t\tSTEP(H2, d, a, b, c, GET(0), 0xeaa127fa, 11)\n\t\tSTEP(H, c, d, a, b, GET(3), 0xd4ef3085, 16)\n\t\tSTEP(H2, b, c, d, a, GET(6), 0x04881d05, 23)\n\t\tSTEP(H, a, b, c, d, GET(9), 0xd9d4d039, 4)\n\t\tSTEP(H2, d, a, b, c, GET(12), 0xe6db99e5, 11)\n\t\tSTEP(H, c, d, a, b, GET(15), 0x1fa27cf8, 16)\n\t\tSTEP(H2, b, c, d, a, GET(2), 0xc4ac5665, 23)\n\n/* Round 4 */\n\t\tSTEP(I, a, b, c, d, GET(0), 0xf4292244, 6)\n\t\tSTEP(I, d, a, b, c, GET(7), 0x432aff97, 10)\n\t\tSTEP(I, c, d, a, b, GET(14), 0xab9423a7, 15)\n\t\tSTEP(I, b, c, d, a, GET(5), 0xfc93a039, 21)\n\t\tSTEP(I, a, b, c, d, GET(12), 0x655b59c3, 6)\n\t\tSTEP(I, d, a, b, c, GET(3), 0x8f0ccc92, 10)\n\t\tSTEP(I, c, d, a, b, GET(10), 0xffeff47d, 15)\n\t\tSTEP(I, b, c, d, a, GET(1), 0x85845dd1, 21)\n\t\tSTEP(I, a, b, c, d, GET(8), 0x6fa87e4f, 6)\n\t\tSTEP(I, d, a, b, c, GET(15), 0xfe2ce6e0, 10)\n\t\tSTEP(I, c, d, a, b, GET(6), 0xa3014314, 15)\n\t\tSTEP(I, b, c, d, a, GET(13), 0x4e0811a1, 21)\n\t\tSTEP(I, a, b, c, d, GET(4), 0xf7537e82, 6)\n\t\tSTEP(I, d, a, b, c, GET(11), 0xbd3af235, 10)\n\t\tSTEP(I, c, d, a, b, GET(2), 0x2ad7d2bb, 15)\n\t\tSTEP(I, b, c, d, a, GET(9), 0xeb86d391, 21)\n\n\t\ta += saved_a;\n\t\tb += saved_b;\n\t\tc += saved_c;\n\t\td += saved_d;\n\n\t\tptr += 64;\n\t} while (size -= 64);\n\n\tctx->a = a;\n\tctx->b = b;\n\tctx->c = c;\n\tctx->d = d;\n\n\treturn ptr;\n}\n\nvoid MD5_Init(MD5_CTX *ctx)\n{\n\tctx->a = 0x67452301;\n\tctx->b = 0xefcdab89;\n\tctx->c = 0x98badcfe;\n\tctx->d = 0x10325476;\n\n\tctx->lo = 0;\n\tctx->hi = 0;\n}\n\nvoid MD5_Update(MD5_CTX *ctx, const void *data, unsigned long size)\n{\n\tMD5_u32plus saved_lo;\n\tunsigned long used, available;\n\n\tsaved_lo = ctx->lo;\n\tif ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo)\n\t\tctx->hi++;\n\tctx->hi += size >> 29;\n\n\tused = saved_lo & 0x3f;\n\n\tif (used) {\n\t\tavailable = 64 - used;\n\n\t\tif (size < available) {\n\t\t\tmemcpy(&ctx->buffer[used], data, size);\n\t\t\treturn;\n\t\t}\n\n\t\tmemcpy(&ctx->buffer[used], data, available);\n\t\tdata = (const unsigned char *)data + available;\n\t\tsize -= available;\n\t\tbody(ctx, ctx->buffer, 64);\n\t}\n\n\tif (size >= 64) {\n\t\tdata = body(ctx, data, size & ~(unsigned long)0x3f);\n\t\tsize &= 0x3f;\n\t}\n\n\tmemcpy(ctx->buffer, data, size);\n}\n\nvoid MD5_Final(unsigned char *result, MD5_CTX *ctx)\n{\n\tunsigned long used, available;\n\n\tused = ctx->lo & 0x3f;\n\n\tctx->buffer[used++] = 0x80;\n\n\tavailable = 64 - used;\n\n\tif (available < 8) {\n\t\tmemset(&ctx->buffer[used], 0, available);\n\t\tbody(ctx, ctx->buffer, 64);\n\t\tused = 0;\n\t\tavailable = 64;\n\t}\n\n\tmemset(&ctx->buffer[used], 0, available - 8);\n\n\tctx->lo <<= 3;\n\tctx->buffer[56] = ctx->lo;\n\tctx->buffer[57] = ctx->lo >> 8;\n\tctx->buffer[58] = ctx->lo >> 16;\n\tctx->buffer[59] = ctx->lo >> 24;\n\tctx->buffer[60] = ctx->hi;\n\tctx->buffer[61] = ctx->hi >> 8;\n\tctx->buffer[62] = ctx->hi >> 16;\n\tctx->buffer[63] = ctx->hi >> 24;\n\n\tbody(ctx, ctx->buffer, 64);\n\n\tresult[0] = ctx->a;\n\tresult[1] = ctx->a >> 8;\n\tresult[2] = ctx->a >> 16;\n\tresult[3] = ctx->a >> 24;\n\tresult[4] = ctx->b;\n\tresult[5] = ctx->b >> 8;\n\tresult[6] = ctx->b >> 16;\n\tresult[7] = ctx->b >> 24;\n\tresult[8] = ctx->c;\n\tresult[9] = ctx->c >> 8;\n\tresult[10] = ctx->c >> 16;\n\tresult[11] = ctx->c >> 24;\n\tresult[12] = ctx->d;\n\tresult[13] = ctx->d >> 8;\n\tresult[14] = ctx->d >> 16;\n\tresult[15] = ctx->d >> 24;\n\n\tmemset(ctx, 0, sizeof(*ctx));\n}\n\n#endif\n"
  },
  {
    "path": "ext/freetype2/src/base/md5.h",
    "content": "/*\n * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc.\n * MD5 Message-Digest Algorithm (RFC 1321).\n *\n * Homepage:\n * http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5\n *\n * Author:\n * Alexander Peslyak, better known as Solar Designer <solar at openwall.com>\n *\n * This software was written by Alexander Peslyak in 2001.  No copyright is\n * claimed, and the software is hereby placed in the public domain.\n * In case this attempt to disclaim copyright and place the software in the\n * public domain is deemed null and void, then the software is\n * Copyright (c) 2001 Alexander Peslyak and it is hereby released to the\n * general public under the following terms:\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted.\n *\n * There's ABSOLUTELY NO WARRANTY, express or implied.\n *\n * See md5.c for more information.\n */\n\n#ifdef HAVE_OPENSSL\n#include <openssl/md5.h>\n#elif !defined(_MD5_H)\n#define _MD5_H\n\n/* Any 32-bit or wider unsigned integer data type will do */\ntypedef unsigned int MD5_u32plus;\n\ntypedef struct {\n\tMD5_u32plus lo, hi;\n\tMD5_u32plus a, b, c, d;\n\tunsigned char buffer[64];\n\tMD5_u32plus block[16];\n} MD5_CTX;\n\nextern void MD5_Init(MD5_CTX *ctx);\nextern void MD5_Update(MD5_CTX *ctx, const void *data, unsigned long size);\nextern void MD5_Final(unsigned char *result, MD5_CTX *ctx);\n\n#endif\n"
  },
  {
    "path": "ext/freetype2/src/base/rules.mk",
    "content": "#\n# FreeType 2 base layer configuration rules\n#\n\n\n# Copyright 1996-2000, 2002-2009, 2013 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\n# It sets the following variables which are used by the master Makefile\n# after the call:\n#\n#   BASE_OBJ_S:   The single-object base layer.\n#   BASE_OBJ_M:   A list of all objects for a multiple-objects build.\n#   BASE_EXT_OBJ: A list of base layer extensions, i.e., components found\n#                 in `src/base' which are not compiled within the base\n#                 layer proper.\n\n\nBASE_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SRC_DIR)/base)\n\n\n# Base layer sources\n#\n#   ftsystem, ftinit, and ftdebug are handled by freetype.mk\n#\n# All files listed here should be included in `ftbase.c' (for a `single'\n# build).\n#\nBASE_SRC := $(BASE_DIR)/basepic.c  \\\n            $(BASE_DIR)/ftadvanc.c \\\n            $(BASE_DIR)/ftcalc.c   \\\n            $(BASE_DIR)/ftdbgmem.c \\\n            $(BASE_DIR)/ftgloadr.c \\\n            $(BASE_DIR)/ftobjs.c   \\\n            $(BASE_DIR)/ftoutln.c  \\\n            $(BASE_DIR)/ftpic.c    \\\n            $(BASE_DIR)/ftrfork.c  \\\n            $(BASE_DIR)/ftsnames.c \\\n            $(BASE_DIR)/ftstream.c \\\n            $(BASE_DIR)/fttrigon.c \\\n            $(BASE_DIR)/ftutil.c\n\n\nifneq ($(ftmac_c),)\n  BASE_SRC += $(BASE_DIR)/$(ftmac_c)\nendif\n\n# for simplicity, we also handle `md5.c' (which gets included by `ftobjs.h')\nBASE_H := $(BASE_DIR)/basepic.h \\\n          $(BASE_DIR)/ftbase.h  \\\n          $(BASE_DIR)/md5.c     \\\n          $(BASE_DIR)/md5.h\n\n# Base layer `extensions' sources\n#\n# An extension is added to the library file as a separate object.  It is\n# then linked to the final executable only if one of its symbols is used by\n# the application.\n#\nBASE_EXT_SRC := $(patsubst %,$(BASE_DIR)/%,$(BASE_EXTENSIONS))\n\n# Default extensions objects\n#\nBASE_EXT_OBJ := $(BASE_EXT_SRC:$(BASE_DIR)/%.c=$(OBJ_DIR)/%.$O)\n\n\n# Base layer object(s)\n#\n#   BASE_OBJ_M is used during `multi' builds (each base source file compiles\n#   to a single object file).\n#\n#   BASE_OBJ_S is used during `single' builds (the whole base layer is\n#   compiled as a single object file using ftbase.c).\n#\nBASE_OBJ_M := $(BASE_SRC:$(BASE_DIR)/%.c=$(OBJ_DIR)/%.$O)\nBASE_OBJ_S := $(OBJ_DIR)/ftbase.$O\n\n# Base layer root source file for single build\n#\nBASE_SRC_S := $(BASE_DIR)/ftbase.c\n\n\n# Base layer - single object build\n#\n$(BASE_OBJ_S): $(BASE_SRC_S) $(BASE_SRC) $(FREETYPE_H) $(BASE_H)\n\t$(BASE_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(BASE_SRC_S))\n\n\n# Multiple objects build + extensions\n#\n$(OBJ_DIR)/%.$O: $(BASE_DIR)/%.c $(FREETYPE_H) $(BASE_H)\n\t$(BASE_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/bdf/Jamfile",
    "content": "# FreeType 2 src/bdf Jamfile\n#\n# Copyright 2002 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) bdf ;\n\n{\n  local  _sources ;\n\n  if $(FT2_MULTI)\n  {\n    _sources = bdfdrivr bdflib ;\n  }\n  else\n  {\n    _sources = bdf ;\n  }\n\n  Library  $(FT2_LIB) : $(_sources).c ;\n}\n\n# end of src/bdf Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/bdf/README",
    "content": "                  FreeType font driver for BDF fonts\n\n                       Francesco Zappa Nardelli\n                  <francesco.zappa.nardelli@ens.fr>\n\n\nIntroduction\n************\n\nBDF (Bitmap Distribution Format) is a bitmap font format defined by Adobe,\nwhich is intended to be easily understood by both humans and computers.\nThis code implements a BDF driver for the FreeType library, following the\nAdobe Specification V 2.2.  The specification of the BDF font format is\navailable from Adobe's web site:\n\n  http://partners.adobe.com/public/developer/en/font/5005.BDF_Spec.pdf\n\nMany good bitmap fonts in bdf format come with XFree86 (www.XFree86.org).\nThey do not define vertical metrics, because the X Consortium BDF\nspecification has removed them.\n\n\nEncodings\n*********\n\nThe variety of encodings that accompanies bdf fonts appears to encompass the\nsmall set defined in freetype.h.  On the other hand, two properties that\nspecify encoding and registry are usually defined in bdf fonts.\n\nI decided to make these two properties directly accessible, leaving to the\nclient application the work of interpreting them.  For instance:\n\n\n  #include FT_INTERNAL_BDF_TYPES_H\n\n  FT_Face          face;\n  BDF_Public_Face  bdfface;\n\n\n  FT_New_Face( library, ..., &face );\n\n  bdfface = (BDF_Public_Face)face;\n\n  if ( ( bdfface->charset_registry == \"ISO10646\" ) &&\n       ( bdfface->charset_encoding == \"1\" )        )\n    [..]\n\n\nThus the driver always exports `ft_encoding_none' as face->charmap.encoding.\nFT_Get_Char_Index's behavior is unmodified, that is, it converts the ULong\nvalue given as argument into the corresponding glyph number.\n\nIf the two properties are not available, Adobe Standard Encoding should be\nassumed.\n\n\nAnti-Aliased Bitmaps\n********************\n\nThe driver supports an extension to the BDF format as used in Mark Leisher's\nxmbdfed bitmap font editor.  Microsoft's SBIT tool expects bitmap fonts in\nthat format for adding anti-aliased them to TrueType fonts.  It introduces a\nfourth field to the `SIZE' keyword which gives the bpp value (bits per\npixel) of the glyph data in the font.  Possible values are 1 (the default),\n2 (four gray levels), 4 (16 gray levels), and 8 (256 gray levels).  The\ndriver returns either a bitmap with 1 bit per pixel or a pixmap with 8bits\nper pixel (using 4, 16, and 256 gray levels, respectively).\n\n\nKnown problems\n**************\n\n- A font is entirely loaded into memory.  Obviously, this is not the Right\n  Thing(TM).  If you have big fonts I suggest you convert them into PCF\n  format (using the bdftopcf utility): the PCF font drive of FreeType can\n  perform incremental glyph loading.\n\nWhen I have some time, I will implement on-demand glyph parsing.\n\n- Except for encodings properties, client applications have no visibility of\n  the PCF_Face object.  This means that applications cannot directly access\n  font tables and must trust FreeType.\n\n- Currently, glyph names are ignored.\n\n  I plan to give full visibility of the BDF_Face object in an upcoming\n  revision of the driver, thus implementing also glyph names.\n\n- As I have never seen a BDF font that defines vertical metrics, vertical\n  metrics are (parsed and) discarded.  If you own a BDF font that defines\n  vertical metrics, please let me know (I will implement them in 5-10\n  minutes).\n\n\nLicense\n*******\n\nCopyright (C) 2001-2002 by Francesco Zappa Nardelli\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*** Portions of the driver (that is, bdflib.c and bdf.h):\n\nCopyright 2000 Computing Research Labs, New Mexico State University\nCopyright 2001-2002, 2011 Francesco Zappa Nardelli\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the \"Software\"),\nto deal in the Software without restriction, including without limitation\nthe rights to use, copy, modify, merge, publish, distribute, sublicense,\nand/or sell copies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL\nTHE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT\nOR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR\nTHE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\nCredits\n*******\n\nThis driver is based on excellent Mark Leisher's bdf library.  If you\nfind something good in this driver you should probably thank him, not\nme.\n"
  },
  {
    "path": "ext/freetype2/src/bdf/bdf.c",
    "content": "/*  bdf.c\n\n    FreeType font driver for bdf files\n\n    Copyright (C) 2001, 2002 by\n    Francesco Zappa Nardelli\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\n\n#define FT_MAKE_OPTION_SINGLE_OBJECT\n\n#include <ft2build.h>\n#include \"bdflib.c\"\n#include \"bdfdrivr.c\"\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/bdf/bdf.h",
    "content": "/*\n * Copyright 2000 Computing Research Labs, New Mexico State University\n * Copyright 2001-2004, 2011 Francesco Zappa Nardelli\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL\n * THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY\n * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT\n * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR\n * THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n#ifndef __BDF_H__\n#define __BDF_H__\n\n\n/*\n * Based on bdf.h,v 1.16 2000/03/16 20:08:51 mleisher\n */\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_STREAM_H\n\n\nFT_BEGIN_HEADER\n\n\n/* Imported from bdfP.h */\n\n#define _bdf_glyph_modified( map, e )                 \\\n          ( (map)[(e) >> 5] & ( 1 << ( (e) & 31 ) ) )\n#define _bdf_set_glyph_modified( map, e )              \\\n          ( (map)[(e) >> 5] |= ( 1 << ( (e) & 31 ) ) )\n#define _bdf_clear_glyph_modified( map, e )             \\\n          ( (map)[(e) >> 5] &= ~( 1 << ( (e) & 31 ) ) )\n\n/* end of bdfP.h */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* BDF font options macros and types.                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#define BDF_CORRECT_METRICS  0x01 /* Correct invalid metrics when loading. */\n#define BDF_KEEP_COMMENTS    0x02 /* Preserve the font comments.           */\n#define BDF_KEEP_UNENCODED   0x04 /* Keep the unencoded glyphs.            */\n#define BDF_PROPORTIONAL     0x08 /* Font has proportional spacing.        */\n#define BDF_MONOWIDTH        0x10 /* Font has mono width.                  */\n#define BDF_CHARCELL         0x20 /* Font has charcell spacing.            */\n\n#define BDF_ALL_SPACING  ( BDF_PROPORTIONAL | \\\n                           BDF_MONOWIDTH    | \\\n                           BDF_CHARCELL     )\n\n#define BDF_DEFAULT_LOAD_OPTIONS  ( BDF_CORRECT_METRICS | \\\n                                    BDF_KEEP_COMMENTS   | \\\n                                    BDF_KEEP_UNENCODED  | \\\n                                    BDF_PROPORTIONAL    )\n\n\n  typedef struct  bdf_options_t_\n  {\n    int            correct_metrics;\n    int            keep_unencoded;\n    int            keep_comments;\n    int            font_spacing;\n\n  } bdf_options_t;\n\n\n  /* Callback function type for unknown configuration options. */\n  typedef int\n  (*bdf_options_callback_t)( bdf_options_t*  opts,\n                             char**          params,\n                             unsigned long   nparams,\n                             void*           client_data );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* BDF font property macros and types.                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#define BDF_ATOM      1\n#define BDF_INTEGER   2\n#define BDF_CARDINAL  3\n\n\n  /* This structure represents a particular property of a font. */\n  /* There are a set of defaults and each font has their own.   */\n  typedef struct  bdf_property_t_\n  {\n    char*  name;         /* Name of the property.   */\n    int    format;       /* Format of the property. */\n    int    builtin;      /* A builtin property.     */\n    union\n    {\n      char*          atom;\n      long           l;\n      unsigned long  ul;\n\n    } value;             /* Value of the property.  */\n\n  } bdf_property_t;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* BDF font metric and glyph types.                                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  typedef struct  bdf_bbx_t_\n  {\n    unsigned short  width;\n    unsigned short  height;\n\n    short           x_offset;\n    short           y_offset;\n\n    short           ascent;\n    short           descent;\n\n  } bdf_bbx_t;\n\n\n  typedef struct  bdf_glyph_t_\n  {\n    char*           name;        /* Glyph name.                          */\n    long            encoding;    /* Glyph encoding.                      */\n    unsigned short  swidth;      /* Scalable width.                      */\n    unsigned short  dwidth;      /* Device width.                        */\n    bdf_bbx_t       bbx;         /* Glyph bounding box.                  */\n    unsigned char*  bitmap;      /* Glyph bitmap.                        */\n    unsigned long   bpr;         /* Number of bytes used per row.        */\n    unsigned short  bytes;       /* Number of bytes used for the bitmap. */\n\n  } bdf_glyph_t;\n\n\n  typedef struct  _hashnode_\n  {\n    const char*  key;\n    size_t       data;\n\n  } _hashnode, *hashnode;\n\n\n  typedef struct  hashtable_\n  {\n    int        limit;\n    int        size;\n    int        used;\n    hashnode*  table;\n\n  } hashtable;\n\n\n  typedef struct  bdf_glyphlist_t_\n  {\n    unsigned short  pad;          /* Pad to 4-byte boundary.              */\n    unsigned short  bpp;          /* Bits per pixel.                      */\n    long            start;        /* Beginning encoding value of glyphs.  */\n    long            end;          /* Ending encoding value of glyphs.     */\n    bdf_glyph_t*    glyphs;       /* Glyphs themselves.                   */\n    unsigned long   glyphs_size;  /* Glyph structures allocated.          */\n    unsigned long   glyphs_used;  /* Glyph structures used.               */\n    bdf_bbx_t       bbx;          /* Overall bounding box of glyphs.      */\n\n  } bdf_glyphlist_t;\n\n\n  typedef struct  bdf_font_t_\n  {\n    char*            name;           /* Name of the font.                   */\n    bdf_bbx_t        bbx;            /* Font bounding box.                  */\n\n    long             point_size;     /* Point size of the font.             */\n    unsigned long    resolution_x;   /* Font horizontal resolution.         */\n    unsigned long    resolution_y;   /* Font vertical resolution.           */\n\n    int              spacing;        /* Font spacing value.                 */\n\n    unsigned short   monowidth;      /* Logical width for monowidth font.   */\n\n    long             default_char;   /* Encoding of the default glyph.      */\n\n    long             font_ascent;    /* Font ascent.                        */\n    long             font_descent;   /* Font descent.                       */\n\n    unsigned long    glyphs_size;    /* Glyph structures allocated.         */\n    unsigned long    glyphs_used;    /* Glyph structures used.              */\n    bdf_glyph_t*     glyphs;         /* Glyphs themselves.                  */\n\n    unsigned long    unencoded_size; /* Unencoded glyph struct. allocated.  */\n    unsigned long    unencoded_used; /* Unencoded glyph struct. used.       */\n    bdf_glyph_t*     unencoded;      /* Unencoded glyphs themselves.        */\n\n    unsigned long    props_size;     /* Font properties allocated.          */\n    unsigned long    props_used;     /* Font properties used.               */\n    bdf_property_t*  props;          /* Font properties themselves.         */\n\n    char*            comments;       /* Font comments.                      */\n    unsigned long    comments_len;   /* Length of comment string.           */\n\n    bdf_glyphlist_t  overflow;       /* Storage used for glyph insertion.   */\n\n    void*            internal;       /* Internal data for the font.         */\n\n    /* The size of the next two arrays must be in sync with the */\n    /* size of the `have' array in the `bdf_parse_t' structure. */\n    unsigned long    nmod[34816];    /* Bitmap indicating modified glyphs.  */\n    unsigned long    umod[34816];    /* Bitmap indicating modified          */\n                                     /* unencoded glyphs.                   */\n    unsigned short   modified;       /* Boolean indicating font modified.   */\n    unsigned short   bpp;            /* Bits per pixel.                     */\n\n    FT_Memory        memory;\n\n    bdf_property_t*  user_props;\n    unsigned long    nuser_props;\n    hashtable        proptbl;\n\n  } bdf_font_t;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Types for load/save callbacks.                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* Error codes. */\n#define BDF_MISSING_START       -1\n#define BDF_MISSING_FONTNAME    -2\n#define BDF_MISSING_SIZE        -3\n#define BDF_MISSING_CHARS       -4\n#define BDF_MISSING_STARTCHAR   -5\n#define BDF_MISSING_ENCODING    -6\n#define BDF_MISSING_BBX         -7\n\n#define BDF_OUT_OF_MEMORY      -20\n\n#define BDF_INVALID_LINE      -100\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* BDF font API.                                                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n  FT_LOCAL( FT_Error )\n  bdf_load_font( FT_Stream       stream,\n                 FT_Memory       memory,\n                 bdf_options_t*  opts,\n                 bdf_font_t*    *font );\n\n  FT_LOCAL( void )\n  bdf_free_font( bdf_font_t*  font );\n\n  FT_LOCAL( bdf_property_t * )\n  bdf_get_property( char*        name,\n                    bdf_font_t*  font );\n\n  FT_LOCAL( bdf_property_t * )\n  bdf_get_font_property( bdf_font_t*  font,\n                         const char*  name );\n\n\nFT_END_HEADER\n\n\n#endif /* __BDF_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/bdf/bdfdrivr.c",
    "content": "/*  bdfdrivr.c\n\n    FreeType font driver for bdf files\n\n    Copyright (C) 2001-2008, 2011, 2013, 2014 by\n    Francesco Zappa Nardelli\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\n\n#include <ft2build.h>\n\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_BDF_H\n#include FT_TRUETYPE_IDS_H\n\n#include FT_SERVICE_BDF_H\n#include FT_SERVICE_XFREE86_NAME_H\n\n#include \"bdf.h\"\n#include \"bdfdrivr.h\"\n\n#include \"bdferror.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_bdfdriver\n\n\n  typedef struct  BDF_CMapRec_\n  {\n    FT_CMapRec        cmap;\n    FT_ULong          num_encodings; /* ftobjs.h: FT_CMap->clazz->size */\n    BDF_encoding_el*  encodings;\n\n  } BDF_CMapRec, *BDF_CMap;\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  bdf_cmap_init( FT_CMap     bdfcmap,\n                 FT_Pointer  init_data )\n  {\n    BDF_CMap  cmap = (BDF_CMap)bdfcmap;\n    BDF_Face  face = (BDF_Face)FT_CMAP_FACE( cmap );\n    FT_UNUSED( init_data );\n\n\n    cmap->num_encodings = face->bdffont->glyphs_used;\n    cmap->encodings     = face->en_table;\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_CALLBACK_DEF( void )\n  bdf_cmap_done( FT_CMap  bdfcmap )\n  {\n    BDF_CMap  cmap = (BDF_CMap)bdfcmap;\n\n\n    cmap->encodings     = NULL;\n    cmap->num_encodings = 0;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt )\n  bdf_cmap_char_index( FT_CMap    bdfcmap,\n                       FT_UInt32  charcode )\n  {\n    BDF_CMap          cmap      = (BDF_CMap)bdfcmap;\n    BDF_encoding_el*  encodings = cmap->encodings;\n    FT_ULong          min, max, mid; /* num_encodings */\n    FT_UShort         result    = 0; /* encodings->glyph */\n\n\n    min = 0;\n    max = cmap->num_encodings;\n\n    while ( min < max )\n    {\n      FT_ULong  code;\n\n\n      mid  = ( min + max ) >> 1;\n      code = encodings[mid].enc;\n\n      if ( charcode == code )\n      {\n        /* increase glyph index by 1 --              */\n        /* we reserve slot 0 for the undefined glyph */\n        result = encodings[mid].glyph + 1;\n        break;\n      }\n\n      if ( charcode < code )\n        max = mid;\n      else\n        min = mid + 1;\n    }\n\n    return result;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt )\n  bdf_cmap_char_next( FT_CMap     bdfcmap,\n                      FT_UInt32  *acharcode )\n  {\n    BDF_CMap          cmap      = (BDF_CMap)bdfcmap;\n    BDF_encoding_el*  encodings = cmap->encodings;\n    FT_ULong          min, max, mid; /* num_encodings */\n    FT_UShort         result   = 0;  /* encodings->glyph */\n    FT_ULong          charcode = *acharcode + 1;\n\n\n    min = 0;\n    max = cmap->num_encodings;\n\n    while ( min < max )\n    {\n      FT_ULong  code; /* same as BDF_encoding_el.enc */\n\n\n      mid  = ( min + max ) >> 1;\n      code = encodings[mid].enc;\n\n      if ( charcode == code )\n      {\n        /* increase glyph index by 1 --              */\n        /* we reserve slot 0 for the undefined glyph */\n        result = encodings[mid].glyph + 1;\n        goto Exit;\n      }\n\n      if ( charcode < code )\n        max = mid;\n      else\n        min = mid + 1;\n    }\n\n    charcode = 0;\n    if ( min < cmap->num_encodings )\n    {\n      charcode = encodings[min].enc;\n      result   = encodings[min].glyph + 1;\n    }\n\n  Exit:\n    if ( charcode > 0xFFFFFFFFUL )\n    {\n      FT_TRACE1(( \"bdf_cmap_char_next: charcode 0x%x > 32bit API\" ));\n      *acharcode = 0;\n      /* XXX: result should be changed to indicate an overflow error */\n    }\n    else\n      *acharcode = (FT_UInt32)charcode;\n    return result;\n  }\n\n\n  static\n  const FT_CMap_ClassRec  bdf_cmap_class =\n  {\n    sizeof ( BDF_CMapRec ),\n    bdf_cmap_init,\n    bdf_cmap_done,\n    bdf_cmap_char_index,\n    bdf_cmap_char_next,\n\n    NULL, NULL, NULL, NULL, NULL\n  };\n\n\n  static FT_Error\n  bdf_interpret_style( BDF_Face  bdf )\n  {\n    FT_Error         error  = FT_Err_Ok;\n    FT_Face          face   = FT_FACE( bdf );\n    FT_Memory        memory = face->memory;\n    bdf_font_t*      font   = bdf->bdffont;\n    bdf_property_t*  prop;\n\n    char*   strings[4] = { NULL, NULL, NULL, NULL };\n    size_t  nn, len, lengths[4];\n\n\n    face->style_flags = 0;\n\n    prop = bdf_get_font_property( font, (char *)\"SLANT\" );\n    if ( prop && prop->format == BDF_ATOM                             &&\n         prop->value.atom                                             &&\n         ( *(prop->value.atom) == 'O' || *(prop->value.atom) == 'o' ||\n           *(prop->value.atom) == 'I' || *(prop->value.atom) == 'i' ) )\n    {\n      face->style_flags |= FT_STYLE_FLAG_ITALIC;\n      strings[2] = ( *(prop->value.atom) == 'O' || *(prop->value.atom) == 'o' )\n                   ? (char *)\"Oblique\"\n                   : (char *)\"Italic\";\n    }\n\n    prop = bdf_get_font_property( font, (char *)\"WEIGHT_NAME\" );\n    if ( prop && prop->format == BDF_ATOM                             &&\n         prop->value.atom                                             &&\n         ( *(prop->value.atom) == 'B' || *(prop->value.atom) == 'b' ) )\n    {\n      face->style_flags |= FT_STYLE_FLAG_BOLD;\n      strings[1] = (char *)\"Bold\";\n    }\n\n    prop = bdf_get_font_property( font, (char *)\"SETWIDTH_NAME\" );\n    if ( prop && prop->format == BDF_ATOM                              &&\n         prop->value.atom && *(prop->value.atom)                       &&\n         !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) )\n      strings[3] = (char *)(prop->value.atom);\n\n    prop = bdf_get_font_property( font, (char *)\"ADD_STYLE_NAME\" );\n    if ( prop && prop->format == BDF_ATOM                              &&\n         prop->value.atom && *(prop->value.atom)                       &&\n         !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) )\n      strings[0] = (char *)(prop->value.atom);\n\n    for ( len = 0, nn = 0; nn < 4; nn++ )\n    {\n      lengths[nn] = 0;\n      if ( strings[nn] )\n      {\n        lengths[nn] = ft_strlen( strings[nn] );\n        len        += lengths[nn] + 1;\n      }\n    }\n\n    if ( len == 0 )\n    {\n      strings[0] = (char *)\"Regular\";\n      lengths[0] = ft_strlen( strings[0] );\n      len        = lengths[0] + 1;\n    }\n\n    {\n      char*  s;\n\n\n      if ( FT_ALLOC( face->style_name, len ) )\n        return error;\n\n      s = face->style_name;\n\n      for ( nn = 0; nn < 4; nn++ )\n      {\n        char*  src = strings[nn];\n\n\n        len = lengths[nn];\n\n        if ( src == NULL )\n          continue;\n\n        /* separate elements with a space */\n        if ( s != face->style_name )\n          *s++ = ' ';\n\n        ft_memcpy( s, src, len );\n\n        /* need to convert spaces to dashes for */\n        /* add_style_name and setwidth_name     */\n        if ( nn == 0 || nn == 3 )\n        {\n          size_t  mm;\n\n\n          for ( mm = 0; mm < len; mm++ )\n            if ( s[mm] == ' ' )\n              s[mm] = '-';\n        }\n\n        s += len;\n      }\n      *s = 0;\n    }\n\n    return error;\n  }\n\n\n  FT_CALLBACK_DEF( void )\n  BDF_Face_Done( FT_Face  bdfface )         /* BDF_Face */\n  {\n    BDF_Face   face = (BDF_Face)bdfface;\n    FT_Memory  memory;\n\n\n    if ( !face )\n      return;\n\n    memory = FT_FACE_MEMORY( face );\n\n    bdf_free_font( face->bdffont );\n\n    FT_FREE( face->en_table );\n\n    FT_FREE( face->charset_encoding );\n    FT_FREE( face->charset_registry );\n    FT_FREE( bdfface->family_name );\n    FT_FREE( bdfface->style_name );\n\n    FT_FREE( bdfface->available_sizes );\n\n    FT_FREE( face->bdffont );\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  BDF_Face_Init( FT_Stream      stream,\n                 FT_Face        bdfface,        /* BDF_Face */\n                 FT_Int         face_index,\n                 FT_Int         num_params,\n                 FT_Parameter*  params )\n  {\n    FT_Error       error  = FT_Err_Ok;\n    BDF_Face       face   = (BDF_Face)bdfface;\n    FT_Memory      memory = FT_FACE_MEMORY( face );\n\n    bdf_font_t*    font = NULL;\n    bdf_options_t  options;\n\n    FT_UNUSED( num_params );\n    FT_UNUSED( params );\n\n\n    FT_TRACE2(( \"BDF driver\\n\" ));\n\n    if ( FT_STREAM_SEEK( 0 ) )\n      goto Exit;\n\n    options.correct_metrics = 1;   /* FZ XXX: options semantics */\n    options.keep_unencoded  = 1;\n    options.keep_comments   = 0;\n    options.font_spacing    = BDF_PROPORTIONAL;\n\n    error = bdf_load_font( stream, memory, &options, &font );\n    if ( FT_ERR_EQ( error, Missing_Startfont_Field ) )\n    {\n      FT_TRACE2(( \"  not a BDF file\\n\" ));\n      goto Fail;\n    }\n    else if ( error )\n      goto Exit;\n\n    /* we have a bdf font: let's construct the face object */\n    face->bdffont = font;\n\n    /* BDF could not have multiple face in single font file.\n     * XXX: non-zero face_index is already invalid argument, but\n     *      Type1, Type42 driver has a convention to return\n     *      an invalid argument error when the font could be\n     *      opened by the specified driver.\n     */\n    if ( face_index > 0 ) {\n      FT_ERROR(( \"BDF_Face_Init: invalid face index\\n\" ));\n      BDF_Face_Done( bdfface );\n      return FT_THROW( Invalid_Argument );\n    }\n\n    {\n      bdf_property_t*  prop = NULL;\n\n\n      FT_TRACE4(( \"  number of glyphs: allocated %d (used %d)\\n\",\n                  font->glyphs_size,\n                  font->glyphs_used ));\n      FT_TRACE4(( \"  number of unencoded glyphs: allocated %d (used %d)\\n\",\n                  font->unencoded_size,\n                  font->unencoded_used ));\n\n      bdfface->num_faces  = 1;\n      bdfface->face_index = 0;\n\n      bdfface->face_flags |= FT_FACE_FLAG_FIXED_SIZES |\n                             FT_FACE_FLAG_HORIZONTAL  |\n                             FT_FACE_FLAG_FAST_GLYPHS;\n\n      prop = bdf_get_font_property( font, \"SPACING\" );\n      if ( prop && prop->format == BDF_ATOM                             &&\n           prop->value.atom                                             &&\n           ( *(prop->value.atom) == 'M' || *(prop->value.atom) == 'm' ||\n             *(prop->value.atom) == 'C' || *(prop->value.atom) == 'c' ) )\n        bdfface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;\n\n      /* FZ XXX: TO DO: FT_FACE_FLAGS_VERTICAL   */\n      /* FZ XXX: I need a font to implement this */\n\n      prop = bdf_get_font_property( font, \"FAMILY_NAME\" );\n      if ( prop && prop->value.atom )\n      {\n        if ( FT_STRDUP( bdfface->family_name, prop->value.atom ) )\n          goto Exit;\n      }\n      else\n        bdfface->family_name = 0;\n\n      if ( ( error = bdf_interpret_style( face ) ) != 0 )\n        goto Exit;\n\n      /* the number of glyphs (with one slot for the undefined glyph */\n      /* at position 0 and all unencoded glyphs)                     */\n      bdfface->num_glyphs = font->glyphs_size + 1;\n\n      bdfface->num_fixed_sizes = 1;\n      if ( FT_NEW_ARRAY( bdfface->available_sizes, 1 ) )\n        goto Exit;\n\n      {\n        FT_Bitmap_Size*  bsize = bdfface->available_sizes;\n        FT_Short         resolution_x = 0, resolution_y = 0;\n\n\n        FT_MEM_ZERO( bsize, sizeof ( FT_Bitmap_Size ) );\n\n        bsize->height = (FT_Short)( font->font_ascent + font->font_descent );\n\n        prop = bdf_get_font_property( font, \"AVERAGE_WIDTH\" );\n        if ( prop )\n          bsize->width = (FT_Short)( ( prop->value.l + 5 ) / 10 );\n        else\n          bsize->width = (FT_Short)( bsize->height * 2/3 );\n\n        prop = bdf_get_font_property( font, \"POINT_SIZE\" );\n        if ( prop )\n          /* convert from 722.7 decipoints to 72 points per inch */\n          bsize->size =\n            (FT_Pos)( ( prop->value.l * 64 * 7200 + 36135L ) / 72270L );\n        else\n          bsize->size = bsize->width << 6;\n\n        prop = bdf_get_font_property( font, \"PIXEL_SIZE\" );\n        if ( prop )\n          bsize->y_ppem = (FT_Short)prop->value.l << 6;\n\n        prop = bdf_get_font_property( font, \"RESOLUTION_X\" );\n        if ( prop )\n          resolution_x = (FT_Short)prop->value.l;\n\n        prop = bdf_get_font_property( font, \"RESOLUTION_Y\" );\n        if ( prop )\n          resolution_y = (FT_Short)prop->value.l;\n\n        if ( bsize->y_ppem == 0 )\n        {\n          bsize->y_ppem = bsize->size;\n          if ( resolution_y )\n            bsize->y_ppem = bsize->y_ppem * resolution_y / 72;\n        }\n        if ( resolution_x && resolution_y )\n          bsize->x_ppem = bsize->y_ppem * resolution_x / resolution_y;\n        else\n          bsize->x_ppem = bsize->y_ppem;\n      }\n\n      /* encoding table */\n      {\n        bdf_glyph_t*   cur = font->glyphs;\n        unsigned long  n;\n\n\n        if ( FT_NEW_ARRAY( face->en_table, font->glyphs_size ) )\n          goto Exit;\n\n        face->default_glyph = 0;\n        for ( n = 0; n < font->glyphs_size; n++ )\n        {\n          (face->en_table[n]).enc = cur[n].encoding;\n          FT_TRACE4(( \"  idx %d, val 0x%lX\\n\", n, cur[n].encoding ));\n          (face->en_table[n]).glyph = (FT_Short)n;\n\n          if ( cur[n].encoding == font->default_char )\n          {\n            if ( n < FT_UINT_MAX )\n              face->default_glyph = (FT_UInt)n;\n            else\n              FT_TRACE1(( \"BDF_Face_Init:\"\n                          \" idx %d is too large for this system\\n\", n ));\n          }\n        }\n      }\n\n      /* charmaps */\n      {\n        bdf_property_t  *charset_registry = 0, *charset_encoding = 0;\n        FT_Bool          unicode_charmap  = 0;\n\n\n        charset_registry =\n          bdf_get_font_property( font, \"CHARSET_REGISTRY\" );\n        charset_encoding =\n          bdf_get_font_property( font, \"CHARSET_ENCODING\" );\n        if ( charset_registry && charset_encoding )\n        {\n          if ( charset_registry->format == BDF_ATOM &&\n               charset_encoding->format == BDF_ATOM &&\n               charset_registry->value.atom         &&\n               charset_encoding->value.atom         )\n          {\n            const char*  s;\n\n\n            if ( FT_STRDUP( face->charset_encoding,\n                            charset_encoding->value.atom ) ||\n                 FT_STRDUP( face->charset_registry,\n                            charset_registry->value.atom ) )\n              goto Exit;\n\n            /* Uh, oh, compare first letters manually to avoid dependency */\n            /* on locales.                                                */\n            s = face->charset_registry;\n            if ( ( s[0] == 'i' || s[0] == 'I' ) &&\n                 ( s[1] == 's' || s[1] == 'S' ) &&\n                 ( s[2] == 'o' || s[2] == 'O' ) )\n            {\n              s += 3;\n              if ( !ft_strcmp( s, \"10646\" )                      ||\n                   ( !ft_strcmp( s, \"8859\" ) &&\n                     !ft_strcmp( face->charset_encoding, \"1\" ) ) )\n              unicode_charmap = 1;\n            }\n\n            {\n              FT_CharMapRec  charmap;\n\n\n              charmap.face        = FT_FACE( face );\n              charmap.encoding    = FT_ENCODING_NONE;\n              /* initial platform/encoding should indicate unset status? */\n              charmap.platform_id = TT_PLATFORM_APPLE_UNICODE;\n              charmap.encoding_id = TT_APPLE_ID_DEFAULT;\n\n              if ( unicode_charmap )\n              {\n                charmap.encoding    = FT_ENCODING_UNICODE;\n                charmap.platform_id = TT_PLATFORM_MICROSOFT;\n                charmap.encoding_id = TT_MS_ID_UNICODE_CS;\n              }\n\n              error = FT_CMap_New( &bdf_cmap_class, NULL, &charmap, NULL );\n\n#if 0\n              /* Select default charmap */\n              if ( bdfface->num_charmaps )\n                bdfface->charmap = bdfface->charmaps[0];\n#endif\n            }\n\n            goto Exit;\n          }\n        }\n\n        /* otherwise assume Adobe standard encoding */\n\n        {\n          FT_CharMapRec  charmap;\n\n\n          charmap.face        = FT_FACE( face );\n          charmap.encoding    = FT_ENCODING_ADOBE_STANDARD;\n          charmap.platform_id = TT_PLATFORM_ADOBE;\n          charmap.encoding_id = TT_ADOBE_ID_STANDARD;\n\n          error = FT_CMap_New( &bdf_cmap_class, NULL, &charmap, NULL );\n\n          /* Select default charmap */\n          if ( bdfface->num_charmaps )\n            bdfface->charmap = bdfface->charmaps[0];\n        }\n      }\n    }\n\n  Exit:\n    return error;\n\n  Fail:\n    BDF_Face_Done( bdfface );\n    return FT_THROW( Unknown_File_Format );\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  BDF_Size_Select( FT_Size   size,\n                   FT_ULong  strike_index )\n  {\n    bdf_font_t*  bdffont = ( (BDF_Face)size->face )->bdffont;\n\n\n    FT_Select_Metrics( size->face, strike_index );\n\n    size->metrics.ascender    = bdffont->font_ascent << 6;\n    size->metrics.descender   = -bdffont->font_descent << 6;\n    size->metrics.max_advance = bdffont->bbx.width << 6;\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  BDF_Size_Request( FT_Size          size,\n                    FT_Size_Request  req )\n  {\n    FT_Face          face    = size->face;\n    FT_Bitmap_Size*  bsize   = face->available_sizes;\n    bdf_font_t*      bdffont = ( (BDF_Face)face )->bdffont;\n    FT_Error         error   = FT_ERR( Invalid_Pixel_Size );\n    FT_Long          height;\n\n\n    height = FT_REQUEST_HEIGHT( req );\n    height = ( height + 32 ) >> 6;\n\n    switch ( req->type )\n    {\n    case FT_SIZE_REQUEST_TYPE_NOMINAL:\n      if ( height == ( ( bsize->y_ppem + 32 ) >> 6 ) )\n        error = FT_Err_Ok;\n      break;\n\n    case FT_SIZE_REQUEST_TYPE_REAL_DIM:\n      if ( height == ( bdffont->font_ascent +\n                       bdffont->font_descent ) )\n        error = FT_Err_Ok;\n      break;\n\n    default:\n      error = FT_THROW( Unimplemented_Feature );\n      break;\n    }\n\n    if ( error )\n      return error;\n    else\n      return BDF_Size_Select( size, 0 );\n  }\n\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  BDF_Glyph_Load( FT_GlyphSlot  slot,\n                  FT_Size       size,\n                  FT_UInt       glyph_index,\n                  FT_Int32      load_flags )\n  {\n    BDF_Face     bdf    = (BDF_Face)FT_SIZE_FACE( size );\n    FT_Face      face   = FT_FACE( bdf );\n    FT_Error     error  = FT_Err_Ok;\n    FT_Bitmap*   bitmap = &slot->bitmap;\n    bdf_glyph_t  glyph;\n    int          bpp    = bdf->bdffont->bpp;\n\n    FT_UNUSED( load_flags );\n\n\n    if ( !face )\n    {\n      error = FT_THROW( Invalid_Face_Handle );\n      goto Exit;\n    }\n\n    if ( glyph_index >= (FT_UInt)face->num_glyphs )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    FT_TRACE1(( \"BDF_Glyph_Load: glyph index %d\\n\", glyph_index ));\n\n    /* index 0 is the undefined glyph */\n    if ( glyph_index == 0 )\n      glyph_index = bdf->default_glyph;\n    else\n      glyph_index--;\n\n    /* slot, bitmap => freetype, glyph => bdflib */\n    glyph = bdf->bdffont->glyphs[glyph_index];\n\n    bitmap->rows  = glyph.bbx.height;\n    bitmap->width = glyph.bbx.width;\n    if ( glyph.bpr > INT_MAX )\n      FT_TRACE1(( \"BDF_Glyph_Load: too large pitch %d is truncated\\n\",\n                   glyph.bpr ));\n    bitmap->pitch = (int)glyph.bpr; /* same as FT_Bitmap.pitch */\n\n    /* note: we don't allocate a new array to hold the bitmap; */\n    /*       we can simply point to it                         */\n    ft_glyphslot_set_bitmap( slot, glyph.bitmap );\n\n    switch ( bpp )\n    {\n    case 1:\n      bitmap->pixel_mode = FT_PIXEL_MODE_MONO;\n      break;\n    case 2:\n      bitmap->pixel_mode = FT_PIXEL_MODE_GRAY2;\n      break;\n    case 4:\n      bitmap->pixel_mode = FT_PIXEL_MODE_GRAY4;\n      break;\n    case 8:\n      bitmap->pixel_mode = FT_PIXEL_MODE_GRAY;\n      bitmap->num_grays  = 256;\n      break;\n    }\n\n    slot->format      = FT_GLYPH_FORMAT_BITMAP;\n    slot->bitmap_left = glyph.bbx.x_offset;\n    slot->bitmap_top  = glyph.bbx.ascent;\n\n    slot->metrics.horiAdvance  = glyph.dwidth << 6;\n    slot->metrics.horiBearingX = glyph.bbx.x_offset << 6;\n    slot->metrics.horiBearingY = glyph.bbx.ascent << 6;\n    slot->metrics.width        = bitmap->width << 6;\n    slot->metrics.height       = bitmap->rows << 6;\n\n    /*\n     * XXX DWIDTH1 and VVECTOR should be parsed and\n     * used here, provided such fonts do exist.\n     */\n    ft_synthesize_vertical_metrics( &slot->metrics,\n                                    bdf->bdffont->bbx.height << 6 );\n\n  Exit:\n    return error;\n  }\n\n\n /*\n  *\n  *  BDF SERVICE\n  *\n  */\n\n  static FT_Error\n  bdf_get_bdf_property( BDF_Face          face,\n                        const char*       prop_name,\n                        BDF_PropertyRec  *aproperty )\n  {\n    bdf_property_t*  prop;\n\n\n    FT_ASSERT( face && face->bdffont );\n\n    prop = bdf_get_font_property( face->bdffont, prop_name );\n    if ( prop )\n    {\n      switch ( prop->format )\n      {\n      case BDF_ATOM:\n        aproperty->type   = BDF_PROPERTY_TYPE_ATOM;\n        aproperty->u.atom = prop->value.atom;\n        break;\n\n      case BDF_INTEGER:\n        if ( prop->value.l > 0x7FFFFFFFL || prop->value.l < ( -1 - 0x7FFFFFFFL ) )\n        {\n          FT_TRACE1(( \"bdf_get_bdf_property:\"\n                      \" too large integer 0x%x is truncated\\n\" ));\n        }\n        aproperty->type      = BDF_PROPERTY_TYPE_INTEGER;\n        aproperty->u.integer = (FT_Int32)prop->value.l;\n        break;\n\n      case BDF_CARDINAL:\n        if ( prop->value.ul > 0xFFFFFFFFUL )\n        {\n          FT_TRACE1(( \"bdf_get_bdf_property:\"\n                      \" too large cardinal 0x%x is truncated\\n\" ));\n        }\n        aproperty->type       = BDF_PROPERTY_TYPE_CARDINAL;\n        aproperty->u.cardinal = (FT_UInt32)prop->value.ul;\n        break;\n\n      default:\n        goto Fail;\n      }\n      return 0;\n    }\n\n  Fail:\n    return FT_THROW( Invalid_Argument );\n  }\n\n\n  static FT_Error\n  bdf_get_charset_id( BDF_Face      face,\n                      const char*  *acharset_encoding,\n                      const char*  *acharset_registry )\n  {\n    *acharset_encoding = face->charset_encoding;\n    *acharset_registry = face->charset_registry;\n\n    return 0;\n  }\n\n\n  static const FT_Service_BDFRec  bdf_service_bdf =\n  {\n    (FT_BDF_GetCharsetIdFunc)bdf_get_charset_id,\n    (FT_BDF_GetPropertyFunc) bdf_get_bdf_property\n  };\n\n\n /*\n  *\n  *  SERVICES LIST\n  *\n  */\n\n  static const FT_ServiceDescRec  bdf_services[] =\n  {\n    { FT_SERVICE_ID_BDF,       &bdf_service_bdf },\n    { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_BDF },\n    { NULL, NULL }\n  };\n\n\n  FT_CALLBACK_DEF( FT_Module_Interface )\n  bdf_driver_requester( FT_Module    module,\n                        const char*  name )\n  {\n    FT_UNUSED( module );\n\n    return ft_service_list_lookup( bdf_services, name );\n  }\n\n\n\n  FT_CALLBACK_TABLE_DEF\n  const FT_Driver_ClassRec  bdf_driver_class =\n  {\n    {\n      FT_MODULE_FONT_DRIVER         |\n      FT_MODULE_DRIVER_NO_OUTLINES,\n      sizeof ( FT_DriverRec ),\n\n      \"bdf\",\n      0x10000L,\n      0x20000L,\n\n      0,\n\n      0,                        /* FT_Module_Constructor */\n      0,                        /* FT_Module_Destructor  */\n      bdf_driver_requester\n    },\n\n    sizeof ( BDF_FaceRec ),\n    sizeof ( FT_SizeRec ),\n    sizeof ( FT_GlyphSlotRec ),\n\n    BDF_Face_Init,\n    BDF_Face_Done,\n    0,                          /* FT_Size_InitFunc */\n    0,                          /* FT_Size_DoneFunc */\n    0,                          /* FT_Slot_InitFunc */\n    0,                          /* FT_Slot_DoneFunc */\n\n    BDF_Glyph_Load,\n\n    0,                          /* FT_Face_GetKerningFunc  */\n    0,                          /* FT_Face_AttachFunc      */\n    0,                          /* FT_Face_GetAdvancesFunc */\n\n    BDF_Size_Request,\n    BDF_Size_Select\n  };\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/bdf/bdfdrivr.h",
    "content": "/*  bdfdrivr.h\n\n    FreeType font driver for bdf fonts\n\n  Copyright (C) 2001, 2002, 2003, 2004 by\n  Francesco Zappa Nardelli\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\n\n\n#ifndef __BDFDRIVR_H__\n#define __BDFDRIVR_H__\n\n#include <ft2build.h>\n#include FT_INTERNAL_DRIVER_H\n\n#include \"bdf.h\"\n\n\nFT_BEGIN_HEADER\n\n#ifdef FT_CONFIG_OPTION_PIC\n#error \"this module does not support PIC yet\"\n#endif\n\n\n  typedef struct  BDF_encoding_el_\n  {\n    FT_ULong   enc;\n    FT_UShort  glyph;\n\n  } BDF_encoding_el;\n\n\n  typedef struct  BDF_FaceRec_\n  {\n    FT_FaceRec        root;\n\n    char*             charset_encoding;\n    char*             charset_registry;\n\n    bdf_font_t*       bdffont;\n\n    BDF_encoding_el*  en_table;\n\n    FT_CharMap        charmap_handle;\n    FT_CharMapRec     charmap;  /* a single charmap per face */\n\n    FT_UInt           default_glyph;\n\n  } BDF_FaceRec, *BDF_Face;\n\n\n  FT_EXPORT_VAR( const FT_Driver_ClassRec )  bdf_driver_class;\n\n\nFT_END_HEADER\n\n\n#endif /* __BDFDRIVR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/bdf/bdferror.h",
    "content": "/*\n * Copyright 2001, 2002, 2012 Francesco Zappa Nardelli\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL\n * THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY\n * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT\n * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR\n * THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the BDF error enumeration constants.      */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __BDFERROR_H__\n#define __BDFERROR_H__\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  BDF_Err_\n#define FT_ERR_BASE    FT_Mod_Err_BDF\n\n#include FT_ERRORS_H\n\n#endif /* __BDFERROR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/bdf/bdflib.c",
    "content": "/*\n * Copyright 2000 Computing Research Labs, New Mexico State University\n * Copyright 2001-2014\n *   Francesco Zappa Nardelli\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL\n * THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY\n * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT\n * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR\n * THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  This file is based on bdf.c,v 1.22 2000/03/16 20:08:50               */\n  /*                                                                       */\n  /*  taken from Mark Leisher's xmbdfed package                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#include <ft2build.h>\n\n#include FT_FREETYPE_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_OBJECTS_H\n\n#include \"bdf.h\"\n#include \"bdferror.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_bdflib\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Default BDF font options.                                             */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  static const bdf_options_t  _bdf_opts =\n  {\n    1,                /* Correct metrics.               */\n    1,                /* Preserve unencoded glyphs.     */\n    0,                /* Preserve comments.             */\n    BDF_PROPORTIONAL  /* Default spacing.               */\n  };\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Builtin BDF font properties.                                          */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /* List of most properties that might appear in a font.  Doesn't include */\n  /* the RAW_* and AXIS_* properties in X11R6 polymorphic fonts.           */\n\n  static const bdf_property_t  _bdf_properties[] =\n  {\n    { (char *)\"ADD_STYLE_NAME\",          BDF_ATOM,     1, { 0 } },\n    { (char *)\"AVERAGE_WIDTH\",           BDF_INTEGER,  1, { 0 } },\n    { (char *)\"AVG_CAPITAL_WIDTH\",       BDF_INTEGER,  1, { 0 } },\n    { (char *)\"AVG_LOWERCASE_WIDTH\",     BDF_INTEGER,  1, { 0 } },\n    { (char *)\"CAP_HEIGHT\",              BDF_INTEGER,  1, { 0 } },\n    { (char *)\"CHARSET_COLLECTIONS\",     BDF_ATOM,     1, { 0 } },\n    { (char *)\"CHARSET_ENCODING\",        BDF_ATOM,     1, { 0 } },\n    { (char *)\"CHARSET_REGISTRY\",        BDF_ATOM,     1, { 0 } },\n    { (char *)\"COMMENT\",                 BDF_ATOM,     1, { 0 } },\n    { (char *)\"COPYRIGHT\",               BDF_ATOM,     1, { 0 } },\n    { (char *)\"DEFAULT_CHAR\",            BDF_CARDINAL, 1, { 0 } },\n    { (char *)\"DESTINATION\",             BDF_CARDINAL, 1, { 0 } },\n    { (char *)\"DEVICE_FONT_NAME\",        BDF_ATOM,     1, { 0 } },\n    { (char *)\"END_SPACE\",               BDF_INTEGER,  1, { 0 } },\n    { (char *)\"FACE_NAME\",               BDF_ATOM,     1, { 0 } },\n    { (char *)\"FAMILY_NAME\",             BDF_ATOM,     1, { 0 } },\n    { (char *)\"FIGURE_WIDTH\",            BDF_INTEGER,  1, { 0 } },\n    { (char *)\"FONT\",                    BDF_ATOM,     1, { 0 } },\n    { (char *)\"FONTNAME_REGISTRY\",       BDF_ATOM,     1, { 0 } },\n    { (char *)\"FONT_ASCENT\",             BDF_INTEGER,  1, { 0 } },\n    { (char *)\"FONT_DESCENT\",            BDF_INTEGER,  1, { 0 } },\n    { (char *)\"FOUNDRY\",                 BDF_ATOM,     1, { 0 } },\n    { (char *)\"FULL_NAME\",               BDF_ATOM,     1, { 0 } },\n    { (char *)\"ITALIC_ANGLE\",            BDF_INTEGER,  1, { 0 } },\n    { (char *)\"MAX_SPACE\",               BDF_INTEGER,  1, { 0 } },\n    { (char *)\"MIN_SPACE\",               BDF_INTEGER,  1, { 0 } },\n    { (char *)\"NORM_SPACE\",              BDF_INTEGER,  1, { 0 } },\n    { (char *)\"NOTICE\",                  BDF_ATOM,     1, { 0 } },\n    { (char *)\"PIXEL_SIZE\",              BDF_INTEGER,  1, { 0 } },\n    { (char *)\"POINT_SIZE\",              BDF_INTEGER,  1, { 0 } },\n    { (char *)\"QUAD_WIDTH\",              BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_ASCENT\",              BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_AVERAGE_WIDTH\",       BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_AVG_CAPITAL_WIDTH\",   BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_AVG_LOWERCASE_WIDTH\", BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_CAP_HEIGHT\",          BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_DESCENT\",             BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_END_SPACE\",           BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_FIGURE_WIDTH\",        BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_MAX_SPACE\",           BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_MIN_SPACE\",           BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_NORM_SPACE\",          BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_PIXEL_SIZE\",          BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_POINT_SIZE\",          BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_PIXELSIZE\",           BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_POINTSIZE\",           BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_QUAD_WIDTH\",          BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_SMALL_CAP_SIZE\",      BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_STRIKEOUT_ASCENT\",    BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_STRIKEOUT_DESCENT\",   BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_SUBSCRIPT_SIZE\",      BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_SUBSCRIPT_X\",         BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_SUBSCRIPT_Y\",         BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_SUPERSCRIPT_SIZE\",    BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_SUPERSCRIPT_X\",       BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_SUPERSCRIPT_Y\",       BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_UNDERLINE_POSITION\",  BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_UNDERLINE_THICKNESS\", BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RAW_X_HEIGHT\",            BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RELATIVE_SETWIDTH\",       BDF_CARDINAL, 1, { 0 } },\n    { (char *)\"RELATIVE_WEIGHT\",         BDF_CARDINAL, 1, { 0 } },\n    { (char *)\"RESOLUTION\",              BDF_INTEGER,  1, { 0 } },\n    { (char *)\"RESOLUTION_X\",            BDF_CARDINAL, 1, { 0 } },\n    { (char *)\"RESOLUTION_Y\",            BDF_CARDINAL, 1, { 0 } },\n    { (char *)\"SETWIDTH_NAME\",           BDF_ATOM,     1, { 0 } },\n    { (char *)\"SLANT\",                   BDF_ATOM,     1, { 0 } },\n    { (char *)\"SMALL_CAP_SIZE\",          BDF_INTEGER,  1, { 0 } },\n    { (char *)\"SPACING\",                 BDF_ATOM,     1, { 0 } },\n    { (char *)\"STRIKEOUT_ASCENT\",        BDF_INTEGER,  1, { 0 } },\n    { (char *)\"STRIKEOUT_DESCENT\",       BDF_INTEGER,  1, { 0 } },\n    { (char *)\"SUBSCRIPT_SIZE\",          BDF_INTEGER,  1, { 0 } },\n    { (char *)\"SUBSCRIPT_X\",             BDF_INTEGER,  1, { 0 } },\n    { (char *)\"SUBSCRIPT_Y\",             BDF_INTEGER,  1, { 0 } },\n    { (char *)\"SUPERSCRIPT_SIZE\",        BDF_INTEGER,  1, { 0 } },\n    { (char *)\"SUPERSCRIPT_X\",           BDF_INTEGER,  1, { 0 } },\n    { (char *)\"SUPERSCRIPT_Y\",           BDF_INTEGER,  1, { 0 } },\n    { (char *)\"UNDERLINE_POSITION\",      BDF_INTEGER,  1, { 0 } },\n    { (char *)\"UNDERLINE_THICKNESS\",     BDF_INTEGER,  1, { 0 } },\n    { (char *)\"WEIGHT\",                  BDF_CARDINAL, 1, { 0 } },\n    { (char *)\"WEIGHT_NAME\",             BDF_ATOM,     1, { 0 } },\n    { (char *)\"X_HEIGHT\",                BDF_INTEGER,  1, { 0 } },\n    { (char *)\"_MULE_BASELINE_OFFSET\",   BDF_INTEGER,  1, { 0 } },\n    { (char *)\"_MULE_RELATIVE_COMPOSE\",  BDF_INTEGER,  1, { 0 } },\n  };\n\n  static const unsigned long\n  _num_bdf_properties = sizeof ( _bdf_properties ) /\n                        sizeof ( _bdf_properties[0] );\n\n\n  /* An auxiliary macro to parse properties, to be used in conditionals. */\n  /* It behaves like `strncmp' but also tests the following character    */\n  /* whether it is a whitespace or NULL.                                 */\n  /* `property' is a constant string of length `n' to compare with.      */\n#define _bdf_strncmp( name, property, n )      \\\n          ( ft_strncmp( name, property, n ) || \\\n            !( name[n] == ' '  ||              \\\n               name[n] == '\\0' ||              \\\n               name[n] == '\\n' ||              \\\n               name[n] == '\\r' ||              \\\n               name[n] == '\\t' )            )\n\n  /* Auto correction messages. */\n#define ACMSG1   \"FONT_ASCENT property missing.  \" \\\n                 \"Added `FONT_ASCENT %hd'.\\n\"\n#define ACMSG2   \"FONT_DESCENT property missing.  \" \\\n                 \"Added `FONT_DESCENT %hd'.\\n\"\n#define ACMSG3   \"Font width != actual width.  Old: %hd New: %hd.\\n\"\n#define ACMSG4   \"Font left bearing != actual left bearing.  \" \\\n                 \"Old: %hd New: %hd.\\n\"\n#define ACMSG5   \"Font ascent != actual ascent.  Old: %hd New: %hd.\\n\"\n#define ACMSG6   \"Font descent != actual descent.  Old: %hd New: %hd.\\n\"\n#define ACMSG7   \"Font height != actual height. Old: %hd New: %hd.\\n\"\n#define ACMSG8   \"Glyph scalable width (SWIDTH) adjustments made.\\n\"\n#define ACMSG9   \"SWIDTH field missing at line %ld.  Set automatically.\\n\"\n#define ACMSG10  \"DWIDTH field missing at line %ld.  Set to glyph width.\\n\"\n#define ACMSG11  \"SIZE bits per pixel field adjusted to %hd.\\n\"\n#define ACMSG12  \"Duplicate encoding %ld (%s) changed to unencoded.\\n\"\n#define ACMSG13  \"Glyph %ld extra rows removed.\\n\"\n#define ACMSG14  \"Glyph %ld extra columns removed.\\n\"\n#define ACMSG15  \"Incorrect glyph count: %ld indicated but %ld found.\\n\"\n#define ACMSG16  \"Glyph %ld missing columns padded with zero bits.\\n\"\n\n  /* Error messages. */\n#define ERRMSG1  \"[line %ld] Missing `%s' line.\\n\"\n#define ERRMSG2  \"[line %ld] Font header corrupted or missing fields.\\n\"\n#define ERRMSG3  \"[line %ld] Font glyphs corrupted or missing fields.\\n\"\n#define ERRMSG4  \"[line %ld] BBX too big.\\n\"\n#define ERRMSG5  \"[line %ld] `%s' value too big.\\n\"\n#define ERRMSG6  \"[line %ld] Input line too long.\\n\"\n#define ERRMSG7  \"[line %ld] Font name too long.\\n\"\n#define ERRMSG8  \"[line %ld] Invalid `%s' value.\\n\"\n#define ERRMSG9  \"[line %ld] Invalid keyword.\\n\"\n\n  /* Debug messages. */\n#define DBGMSG1  \"  [%6ld] %s\" /* no \\n */\n#define DBGMSG2  \" (0x%lX)\\n\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Hash table utilities for the properties.                              */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /* XXX: Replace this with FreeType's hash functions */\n\n\n#define INITIAL_HT_SIZE  241\n\n  typedef void\n  (*hash_free_func)( hashnode  node );\n\n  static hashnode*\n  hash_bucket( const char*  key,\n               hashtable*   ht )\n  {\n    const char*    kp  = key;\n    unsigned long  res = 0;\n    hashnode*      bp  = ht->table, *ndp;\n\n\n    /* Mocklisp hash function. */\n    while ( *kp )\n      res = ( res << 5 ) - res + *kp++;\n\n    ndp = bp + ( res % ht->size );\n    while ( *ndp )\n    {\n      kp = (*ndp)->key;\n      if ( kp[0] == key[0] && ft_strcmp( kp, key ) == 0 )\n        break;\n      ndp--;\n      if ( ndp < bp )\n        ndp = bp + ( ht->size - 1 );\n    }\n\n    return ndp;\n  }\n\n\n  static FT_Error\n  hash_rehash( hashtable*  ht,\n               FT_Memory   memory )\n  {\n    hashnode*  obp = ht->table, *bp, *nbp;\n    int        i, sz = ht->size;\n    FT_Error   error = FT_Err_Ok;\n\n\n    ht->size <<= 1;\n    ht->limit  = ht->size / 3;\n\n    if ( FT_NEW_ARRAY( ht->table, ht->size ) )\n      goto Exit;\n\n    for ( i = 0, bp = obp; i < sz; i++, bp++ )\n    {\n      if ( *bp )\n      {\n        nbp = hash_bucket( (*bp)->key, ht );\n        *nbp = *bp;\n      }\n    }\n    FT_FREE( obp );\n\n  Exit:\n    return error;\n  }\n\n\n  static FT_Error\n  hash_init( hashtable*  ht,\n             FT_Memory   memory )\n  {\n    int       sz    = INITIAL_HT_SIZE;\n    FT_Error  error = FT_Err_Ok;\n\n\n    ht->size  = sz;\n    ht->limit = sz / 3;\n    ht->used  = 0;\n\n    if ( FT_NEW_ARRAY( ht->table, sz ) )\n      goto Exit;\n\n  Exit:\n    return error;\n  }\n\n\n  static void\n  hash_free( hashtable*  ht,\n             FT_Memory   memory )\n  {\n    if ( ht != 0 )\n    {\n      int        i, sz = ht->size;\n      hashnode*  bp = ht->table;\n\n\n      for ( i = 0; i < sz; i++, bp++ )\n        FT_FREE( *bp );\n\n      FT_FREE( ht->table );\n    }\n  }\n\n\n  static FT_Error\n  hash_insert( char*       key,\n               size_t      data,\n               hashtable*  ht,\n               FT_Memory   memory )\n  {\n    hashnode   nn;\n    hashnode*  bp      = hash_bucket( key, ht );\n    FT_Error   error   = FT_Err_Ok;\n\n\n    nn = *bp;\n    if ( !nn )\n    {\n      if ( FT_NEW( nn ) )\n        goto Exit;\n      *bp = nn;\n\n      nn->key  = key;\n      nn->data = data;\n\n      if ( ht->used >= ht->limit )\n      {\n        error = hash_rehash( ht, memory );\n        if ( error )\n          goto Exit;\n      }\n      ht->used++;\n    }\n    else\n      nn->data = data;\n\n  Exit:\n    return error;\n  }\n\n\n  static hashnode\n  hash_lookup( const char* key,\n               hashtable*  ht )\n  {\n    hashnode *np = hash_bucket( key, ht );\n\n\n    return *np;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Utility types and functions.                                          */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* Function type for parsing lines of a BDF font. */\n\n  typedef FT_Error\n  (*_bdf_line_func_t)( char*          line,\n                       unsigned long  linelen,\n                       unsigned long  lineno,\n                       void*          call_data,\n                       void*          client_data );\n\n\n  /* List structure for splitting lines into fields. */\n\n  typedef struct  _bdf_list_t_\n  {\n    char**         field;\n    unsigned long  size;\n    unsigned long  used;\n    FT_Memory      memory;\n\n  } _bdf_list_t;\n\n\n  /* Structure used while loading BDF fonts. */\n\n  typedef struct  _bdf_parse_t_\n  {\n    unsigned long   flags;\n    unsigned long   cnt;\n    unsigned long   row;\n\n    short           minlb;\n    short           maxlb;\n    short           maxrb;\n    short           maxas;\n    short           maxds;\n\n    short           rbearing;\n\n    char*           glyph_name;\n    long            glyph_enc;\n\n    bdf_font_t*     font;\n    bdf_options_t*  opts;\n\n    unsigned long   have[34816]; /* must be in sync with `nmod' and `umod' */\n                                 /* arrays from `bdf_font_t' structure     */\n    _bdf_list_t     list;\n\n    FT_Memory       memory;\n\n  } _bdf_parse_t;\n\n\n#define setsbit( m, cc ) \\\n          ( m[(FT_Byte)(cc) >> 3] |= (FT_Byte)( 1 << ( (cc) & 7 ) ) )\n#define sbitset( m, cc ) \\\n          ( m[(FT_Byte)(cc) >> 3]  & ( 1 << ( (cc) & 7 ) ) )\n\n\n  static void\n  _bdf_list_init( _bdf_list_t*  list,\n                  FT_Memory     memory )\n  {\n    FT_ZERO( list );\n    list->memory = memory;\n  }\n\n\n  static void\n  _bdf_list_done( _bdf_list_t*  list )\n  {\n    FT_Memory  memory = list->memory;\n\n\n    if ( memory )\n    {\n      FT_FREE( list->field );\n      FT_ZERO( list );\n    }\n  }\n\n\n  static FT_Error\n  _bdf_list_ensure( _bdf_list_t*   list,\n                    unsigned long  num_items ) /* same as _bdf_list_t.used */\n  {\n    FT_Error  error = FT_Err_Ok;\n\n\n    if ( num_items > list->size )\n    {\n      unsigned long  oldsize = list->size; /* same as _bdf_list_t.size */\n      unsigned long  newsize = oldsize + ( oldsize >> 1 ) + 5;\n      unsigned long  bigsize = (unsigned long)( FT_INT_MAX / sizeof ( char* ) );\n      FT_Memory      memory  = list->memory;\n\n\n      if ( oldsize == bigsize )\n      {\n        error = FT_THROW( Out_Of_Memory );\n        goto Exit;\n      }\n      else if ( newsize < oldsize || newsize > bigsize )\n        newsize = bigsize;\n\n      if ( FT_RENEW_ARRAY( list->field, oldsize, newsize ) )\n        goto Exit;\n\n      list->size = newsize;\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  static void\n  _bdf_list_shift( _bdf_list_t*   list,\n                   unsigned long  n )\n  {\n    unsigned long  i, u;\n\n\n    if ( list == 0 || list->used == 0 || n == 0 )\n      return;\n\n    if ( n >= list->used )\n    {\n      list->used = 0;\n      return;\n    }\n\n    for ( u = n, i = 0; u < list->used; i++, u++ )\n      list->field[i] = list->field[u];\n    list->used -= n;\n  }\n\n\n  /* An empty string for empty fields. */\n\n  static const char  empty[1] = { 0 };      /* XXX eliminate this */\n\n\n  static char *\n  _bdf_list_join( _bdf_list_t*    list,\n                  int             c,\n                  unsigned long  *alen )\n  {\n    unsigned long  i, j;\n    char*          dp;\n\n\n    *alen = 0;\n\n    if ( list == 0 || list->used == 0 )\n      return 0;\n\n    dp = list->field[0];\n    for ( i = j = 0; i < list->used; i++ )\n    {\n      char*  fp = list->field[i];\n\n\n      while ( *fp )\n        dp[j++] = *fp++;\n\n      if ( i + 1 < list->used )\n        dp[j++] = (char)c;\n    }\n    if ( dp != empty )\n      dp[j] = 0;\n\n    *alen = j;\n    return dp;\n  }\n\n\n  /* The code below ensures that we have at least 4 + 1 `field' */\n  /* elements in `list' (which are possibly NULL) so that we    */\n  /* don't have to check the number of fields in most cases.    */\n\n  static FT_Error\n  _bdf_list_split( _bdf_list_t*   list,\n                   char*          separators,\n                   char*          line,\n                   unsigned long  linelen )\n  {\n    int       mult, final_empty;\n    char      *sp, *ep, *end;\n    char      seps[32];\n    FT_Error  error = FT_Err_Ok;\n\n\n    /* Initialize the list. */\n    list->used = 0;\n    if ( list->size )\n    {\n      list->field[0] = (char*)empty;\n      list->field[1] = (char*)empty;\n      list->field[2] = (char*)empty;\n      list->field[3] = (char*)empty;\n      list->field[4] = (char*)empty;\n    }\n\n    /* If the line is empty, then simply return. */\n    if ( linelen == 0 || line[0] == 0 )\n      goto Exit;\n\n    /* In the original code, if the `separators' parameter is NULL or */\n    /* empty, the list is split into individual bytes.  We don't need */\n    /* this, so an error is signaled.                                 */\n    if ( separators == 0 || *separators == 0 )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    /* Prepare the separator bitmap. */\n    FT_MEM_ZERO( seps, 32 );\n\n    /* If the very last character of the separator string is a plus, then */\n    /* set the `mult' flag to indicate that multiple separators should be */\n    /* collapsed into one.                                                */\n    for ( mult = 0, sp = separators; sp && *sp; sp++ )\n    {\n      if ( *sp == '+' && *( sp + 1 ) == 0 )\n        mult = 1;\n      else\n        setsbit( seps, *sp );\n    }\n\n    /* Break the line up into fields. */\n    for ( final_empty = 0, sp = ep = line, end = sp + linelen;\n          sp < end && *sp; )\n    {\n      /* Collect everything that is not a separator. */\n      for ( ; *ep && !sbitset( seps, *ep ); ep++ )\n        ;\n\n      /* Resize the list if necessary. */\n      if ( list->used == list->size )\n      {\n        error = _bdf_list_ensure( list, list->used + 1 );\n        if ( error )\n          goto Exit;\n      }\n\n      /* Assign the field appropriately. */\n      list->field[list->used++] = ( ep > sp ) ? sp : (char*)empty;\n\n      sp = ep;\n\n      if ( mult )\n      {\n        /* If multiple separators should be collapsed, do it now by */\n        /* setting all the separator characters to 0.               */\n        for ( ; *ep && sbitset( seps, *ep ); ep++ )\n          *ep = 0;\n      }\n      else if ( *ep != 0 )\n        /* Don't collapse multiple separators by making them 0, so just */\n        /* make the one encountered 0.                                  */\n        *ep++ = 0;\n\n      final_empty = ( ep > sp && *ep == 0 );\n      sp = ep;\n    }\n\n    /* Finally, NULL-terminate the list. */\n    if ( list->used + final_empty >= list->size )\n    {\n      error = _bdf_list_ensure( list, list->used + final_empty + 1 );\n      if ( error )\n        goto Exit;\n    }\n\n    if ( final_empty )\n      list->field[list->used++] = (char*)empty;\n\n    list->field[list->used] = 0;\n\n  Exit:\n    return error;\n  }\n\n\n#define NO_SKIP  256  /* this value cannot be stored in a 'char' */\n\n\n  static FT_Error\n  _bdf_readstream( FT_Stream         stream,\n                   _bdf_line_func_t  callback,\n                   void*             client_data,\n                   unsigned long    *lno )\n  {\n    _bdf_line_func_t  cb;\n    unsigned long     lineno, buf_size;\n    int               refill, hold, to_skip;\n    ptrdiff_t         bytes, start, end, cursor, avail;\n    char*             buf    = 0;\n    FT_Memory         memory = stream->memory;\n    FT_Error          error  = FT_Err_Ok;\n\n\n    if ( callback == 0 )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    /* initial size and allocation of the input buffer */\n    buf_size = 1024;\n\n    if ( FT_NEW_ARRAY( buf, buf_size ) )\n      goto Exit;\n\n    cb      = callback;\n    lineno  = 1;\n    buf[0]  = 0;\n    start   = 0;\n    avail   = 0;\n    cursor  = 0;\n    refill  = 1;\n    to_skip = NO_SKIP;\n    bytes   = 0;        /* make compiler happy */\n\n    for (;;)\n    {\n      if ( refill )\n      {\n        bytes  = (ptrdiff_t)FT_Stream_TryRead(\n                   stream, (FT_Byte*)buf + cursor,\n                   (FT_ULong)( buf_size - cursor ) );\n        avail  = cursor + bytes;\n        cursor = 0;\n        refill = 0;\n      }\n\n      end = start;\n\n      /* should we skip an optional character like \\n or \\r? */\n      if ( start < avail && buf[start] == to_skip )\n      {\n        start  += 1;\n        to_skip = NO_SKIP;\n        continue;\n      }\n\n      /* try to find the end of the line */\n      while ( end < avail && buf[end] != '\\n' && buf[end] != '\\r' )\n        end++;\n\n      /* if we hit the end of the buffer, try shifting its content */\n      /* or even resizing it                                       */\n      if ( end >= avail )\n      {\n        if ( bytes == 0 )  /* last line in file doesn't end in \\r or \\n */\n          break;           /* ignore it then exit                       */\n\n        if ( start == 0 )\n        {\n          /* this line is definitely too long; try resizing the input */\n          /* buffer a bit to handle it.                               */\n          FT_ULong  new_size;\n\n\n          if ( buf_size >= 65536UL )  /* limit ourselves to 64KByte */\n          {\n            FT_ERROR(( \"_bdf_readstream: \" ERRMSG6, lineno ));\n            error = FT_THROW( Invalid_Argument );\n            goto Exit;\n          }\n\n          new_size = buf_size * 2;\n          if ( FT_RENEW_ARRAY( buf, buf_size, new_size ) )\n            goto Exit;\n\n          cursor   = buf_size;\n          buf_size = new_size;\n        }\n        else\n        {\n          bytes = avail - start;\n\n          FT_MEM_MOVE( buf, buf + start, bytes );\n\n          cursor = bytes;\n          avail -= bytes;\n          start  = 0;\n        }\n        refill = 1;\n        continue;\n      }\n\n      /* Temporarily NUL-terminate the line. */\n      hold     = buf[end];\n      buf[end] = 0;\n\n      /* XXX: Use encoding independent value for 0x1A */\n      if ( buf[start] != '#' && buf[start] != 0x1A && end > start )\n      {\n        error = (*cb)( buf + start, (unsigned long)( end - start ), lineno,\n                       (void*)&cb, client_data );\n        /* Redo if we have encountered CHARS without properties. */\n        if ( error == -1 )\n          error = (*cb)( buf + start, (unsigned long)( end - start ), lineno,\n                         (void*)&cb, client_data );\n        if ( error )\n          break;\n      }\n\n      lineno  += 1;\n      buf[end] = (char)hold;\n      start    = end + 1;\n\n      if ( hold == '\\n' )\n        to_skip = '\\r';\n      else if ( hold == '\\r' )\n        to_skip = '\\n';\n      else\n        to_skip = NO_SKIP;\n    }\n\n    *lno = lineno;\n\n  Exit:\n    FT_FREE( buf );\n    return error;\n  }\n\n\n  /* XXX: make this work with EBCDIC also */\n\n  static const unsigned char  a2i[128] =\n  {\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x00,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n    0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n  };\n\n  static const unsigned char  odigits[32] =\n  {\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  };\n\n  static const unsigned char  ddigits[32] =\n  {\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x03,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  };\n\n  static const unsigned char  hdigits[32] =\n  {\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x03,\n    0x7E, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  };\n\n\n  /* Routine to convert an ASCII string into an unsigned long integer. */\n  static unsigned long\n  _bdf_atoul( char*   s,\n              char**  end,\n              int     base )\n  {\n    unsigned long         v;\n    const unsigned char*  dmap;\n\n\n    if ( s == 0 || *s == 0 )\n      return 0;\n\n    /* Make sure the radix is something recognizable.  Default to 10. */\n    switch ( base )\n    {\n    case 8:\n      dmap = odigits;\n      break;\n    case 16:\n      dmap = hdigits;\n      break;\n    default:\n      base = 10;\n      dmap = ddigits;\n      break;\n    }\n\n    /* Check for the special hex prefix. */\n    if ( *s == '0'                                  &&\n         ( *( s + 1 ) == 'x' || *( s + 1 ) == 'X' ) )\n    {\n      base = 16;\n      dmap = hdigits;\n      s   += 2;\n    }\n\n    for ( v = 0; sbitset( dmap, *s ); s++ )\n      v = v * base + a2i[(int)*s];\n\n    if ( end != 0 )\n      *end = s;\n\n    return v;\n  }\n\n\n  /* Routine to convert an ASCII string into an signed long integer. */\n  static long\n  _bdf_atol( char*   s,\n             char**  end,\n             int     base )\n  {\n    long                  v, neg;\n    const unsigned char*  dmap;\n\n\n    if ( s == 0 || *s == 0 )\n      return 0;\n\n    /* Make sure the radix is something recognizable.  Default to 10. */\n    switch ( base )\n    {\n    case 8:\n      dmap = odigits;\n      break;\n    case 16:\n      dmap = hdigits;\n      break;\n    default:\n      base = 10;\n      dmap = ddigits;\n      break;\n    }\n\n    /* Check for a minus sign. */\n    neg = 0;\n    if ( *s == '-' )\n    {\n      s++;\n      neg = 1;\n    }\n\n    /* Check for the special hex prefix. */\n    if ( *s == '0'                                  &&\n         ( *( s + 1 ) == 'x' || *( s + 1 ) == 'X' ) )\n    {\n      base = 16;\n      dmap = hdigits;\n      s   += 2;\n    }\n\n    for ( v = 0; sbitset( dmap, *s ); s++ )\n      v = v * base + a2i[(int)*s];\n\n    if ( end != 0 )\n      *end = s;\n\n    return ( !neg ) ? v : -v;\n  }\n\n\n  /* Routine to convert an ASCII string into an signed short integer. */\n  static short\n  _bdf_atos( char*   s,\n             char**  end,\n             int     base )\n  {\n    short                 v, neg;\n    const unsigned char*  dmap;\n\n\n    if ( s == 0 || *s == 0 )\n      return 0;\n\n    /* Make sure the radix is something recognizable.  Default to 10. */\n    switch ( base )\n    {\n    case 8:\n      dmap = odigits;\n      break;\n    case 16:\n      dmap = hdigits;\n      break;\n    default:\n      base = 10;\n      dmap = ddigits;\n      break;\n    }\n\n    /* Check for a minus. */\n    neg = 0;\n    if ( *s == '-' )\n    {\n      s++;\n      neg = 1;\n    }\n\n    /* Check for the special hex prefix. */\n    if ( *s == '0'                                  &&\n         ( *( s + 1 ) == 'x' || *( s + 1 ) == 'X' ) )\n    {\n      base = 16;\n      dmap = hdigits;\n      s   += 2;\n    }\n\n    for ( v = 0; sbitset( dmap, *s ); s++ )\n      v = (short)( v * base + a2i[(int)*s] );\n\n    if ( end != 0 )\n      *end = s;\n\n    return (short)( ( !neg ) ? v : -v );\n  }\n\n\n  /* Routine to compare two glyphs by encoding so they can be sorted. */\n  static int\n  by_encoding( const void*  a,\n               const void*  b )\n  {\n    bdf_glyph_t  *c1, *c2;\n\n\n    c1 = (bdf_glyph_t *)a;\n    c2 = (bdf_glyph_t *)b;\n\n    if ( c1->encoding < c2->encoding )\n      return -1;\n\n    if ( c1->encoding > c2->encoding )\n      return 1;\n\n    return 0;\n  }\n\n\n  static FT_Error\n  bdf_create_property( char*        name,\n                       int          format,\n                       bdf_font_t*  font )\n  {\n    size_t           n;\n    bdf_property_t*  p;\n    FT_Memory        memory = font->memory;\n    FT_Error         error  = FT_Err_Ok;\n\n\n    /* First check whether the property has        */\n    /* already been added or not.  If it has, then */\n    /* simply ignore it.                           */\n    if ( hash_lookup( name, &(font->proptbl) ) )\n      goto Exit;\n\n    if ( FT_RENEW_ARRAY( font->user_props,\n                         font->nuser_props,\n                         font->nuser_props + 1 ) )\n      goto Exit;\n\n    p = font->user_props + font->nuser_props;\n    FT_ZERO( p );\n\n    n = ft_strlen( name ) + 1;\n    if ( n > FT_ULONG_MAX )\n      return FT_THROW( Invalid_Argument );\n\n    if ( FT_NEW_ARRAY( p->name, n ) )\n      goto Exit;\n\n    FT_MEM_COPY( (char *)p->name, name, n );\n\n    p->format  = format;\n    p->builtin = 0;\n\n    n = _num_bdf_properties + font->nuser_props;\n\n    error = hash_insert( p->name, n, &(font->proptbl), memory );\n    if ( error )\n      goto Exit;\n\n    font->nuser_props++;\n\n  Exit:\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( bdf_property_t * )\n  bdf_get_property( char*        name,\n                    bdf_font_t*  font )\n  {\n    hashnode  hn;\n    size_t    propid;\n\n\n    if ( name == 0 || *name == 0 )\n      return 0;\n\n    if ( ( hn = hash_lookup( name, &(font->proptbl) ) ) == 0 )\n      return 0;\n\n    propid = hn->data;\n    if ( propid >= _num_bdf_properties )\n      return font->user_props + ( propid - _num_bdf_properties );\n\n    return (bdf_property_t*)_bdf_properties + propid;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* BDF font file parsing flags and functions.                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* Parse flags. */\n\n#define _BDF_START      0x0001\n#define _BDF_FONT_NAME  0x0002\n#define _BDF_SIZE       0x0004\n#define _BDF_FONT_BBX   0x0008\n#define _BDF_PROPS      0x0010\n#define _BDF_GLYPHS     0x0020\n#define _BDF_GLYPH      0x0040\n#define _BDF_ENCODING   0x0080\n#define _BDF_SWIDTH     0x0100\n#define _BDF_DWIDTH     0x0200\n#define _BDF_BBX        0x0400\n#define _BDF_BITMAP     0x0800\n\n#define _BDF_SWIDTH_ADJ  0x1000\n\n#define _BDF_GLYPH_BITS ( _BDF_GLYPH    | \\\n                          _BDF_ENCODING | \\\n                          _BDF_SWIDTH   | \\\n                          _BDF_DWIDTH   | \\\n                          _BDF_BBX      | \\\n                          _BDF_BITMAP   )\n\n#define _BDF_GLYPH_WIDTH_CHECK   0x40000000UL\n#define _BDF_GLYPH_HEIGHT_CHECK  0x80000000UL\n\n\n  static FT_Error\n  _bdf_add_comment( bdf_font_t*    font,\n                    char*          comment,\n                    unsigned long  len )\n  {\n    char*      cp;\n    FT_Memory  memory = font->memory;\n    FT_Error   error  = FT_Err_Ok;\n\n\n    if ( FT_RENEW_ARRAY( font->comments,\n                         font->comments_len,\n                         font->comments_len + len + 1 ) )\n      goto Exit;\n\n    cp = font->comments + font->comments_len;\n\n    FT_MEM_COPY( cp, comment, len );\n    cp[len] = '\\n';\n\n    font->comments_len += len + 1;\n\n  Exit:\n    return error;\n  }\n\n\n  /* Set the spacing from the font name if it exists, or set it to the */\n  /* default specified in the options.                                 */\n  static FT_Error\n  _bdf_set_default_spacing( bdf_font_t*     font,\n                            bdf_options_t*  opts,\n                            unsigned long   lineno )\n  {\n    size_t       len;\n    char         name[256];\n    _bdf_list_t  list;\n    FT_Memory    memory;\n    FT_Error     error = FT_Err_Ok;\n\n    FT_UNUSED( lineno );        /* only used in debug mode */\n\n\n    if ( font == 0 || font->name == 0 || font->name[0] == 0 )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    memory = font->memory;\n\n    _bdf_list_init( &list, memory );\n\n    font->spacing = opts->font_spacing;\n\n    len = ft_strlen( font->name ) + 1;\n    /* Limit ourselves to 256 characters in the font name. */\n    if ( len >= 256 )\n    {\n      FT_ERROR(( \"_bdf_set_default_spacing: \" ERRMSG7, lineno ));\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    FT_MEM_COPY( name, font->name, len );\n\n    error = _bdf_list_split( &list, (char *)\"-\", name, (unsigned long)len );\n    if ( error )\n      goto Fail;\n\n    if ( list.used == 15 )\n    {\n      switch ( list.field[11][0] )\n      {\n      case 'C':\n      case 'c':\n        font->spacing = BDF_CHARCELL;\n        break;\n      case 'M':\n      case 'm':\n        font->spacing = BDF_MONOWIDTH;\n        break;\n      case 'P':\n      case 'p':\n        font->spacing = BDF_PROPORTIONAL;\n        break;\n      }\n    }\n\n  Fail:\n    _bdf_list_done( &list );\n\n  Exit:\n    return error;\n  }\n\n\n  /* Determine whether the property is an atom or not.  If it is, then */\n  /* clean it up so the double quotes are removed if they exist.       */\n  static int\n  _bdf_is_atom( char*          line,\n                unsigned long  linelen,\n                char**         name,\n                char**         value,\n                bdf_font_t*    font )\n  {\n    int              hold;\n    char             *sp, *ep;\n    bdf_property_t*  p;\n\n\n    *name = sp = ep = line;\n\n    while ( *ep && *ep != ' ' && *ep != '\\t' )\n      ep++;\n\n    hold = -1;\n    if ( *ep )\n    {\n      hold = *ep;\n      *ep  = 0;\n    }\n\n    p = bdf_get_property( sp, font );\n\n    /* Restore the character that was saved before any return can happen. */\n    if ( hold != -1 )\n      *ep = (char)hold;\n\n    /* If the property exists and is not an atom, just return here. */\n    if ( p && p->format != BDF_ATOM )\n      return 0;\n\n    /* The property is an atom.  Trim all leading and trailing whitespace */\n    /* and double quotes for the atom value.                              */\n    sp = ep;\n    ep = line + linelen;\n\n    /* Trim the leading whitespace if it exists. */\n    if ( *sp )\n      *sp++ = 0;\n    while ( *sp                           &&\n            ( *sp == ' ' || *sp == '\\t' ) )\n      sp++;\n\n    /* Trim the leading double quote if it exists. */\n    if ( *sp == '\"' )\n      sp++;\n    *value = sp;\n\n    /* Trim the trailing whitespace if it exists. */\n    while ( ep > sp                                       &&\n            ( *( ep - 1 ) == ' ' || *( ep - 1 ) == '\\t' ) )\n      *--ep = 0;\n\n    /* Trim the trailing double quote if it exists. */\n    if ( ep > sp && *( ep - 1 ) == '\"' )\n      *--ep = 0;\n\n    return 1;\n  }\n\n\n  static FT_Error\n  _bdf_add_property( bdf_font_t*    font,\n                     char*          name,\n                     char*          value,\n                     unsigned long  lineno )\n  {\n    size_t          propid;\n    hashnode        hn;\n    bdf_property_t  *prop, *fp;\n    FT_Memory       memory = font->memory;\n    FT_Error        error  = FT_Err_Ok;\n\n    FT_UNUSED( lineno );        /* only used in debug mode */\n\n\n    /* First, check whether the property already exists in the font. */\n    if ( ( hn = hash_lookup( name, (hashtable *)font->internal ) ) != 0 )\n    {\n      /* The property already exists in the font, so simply replace */\n      /* the value of the property with the current value.          */\n      fp = font->props + hn->data;\n\n      switch ( fp->format )\n      {\n      case BDF_ATOM:\n        /* Delete the current atom if it exists. */\n        FT_FREE( fp->value.atom );\n\n        if ( value && value[0] != 0 )\n        {\n          if ( FT_STRDUP( fp->value.atom, value ) )\n            goto Exit;\n        }\n        break;\n\n      case BDF_INTEGER:\n        fp->value.l = _bdf_atol( value, 0, 10 );\n        break;\n\n      case BDF_CARDINAL:\n        fp->value.ul = _bdf_atoul( value, 0, 10 );\n        break;\n\n      default:\n        ;\n      }\n\n      goto Exit;\n    }\n\n    /* See whether this property type exists yet or not. */\n    /* If not, create it.                                */\n    hn = hash_lookup( name, &(font->proptbl) );\n    if ( hn == 0 )\n    {\n      error = bdf_create_property( name, BDF_ATOM, font );\n      if ( error )\n        goto Exit;\n      hn = hash_lookup( name, &(font->proptbl) );\n    }\n\n    /* Allocate another property if this is overflow. */\n    if ( font->props_used == font->props_size )\n    {\n      if ( font->props_size == 0 )\n      {\n        if ( FT_NEW_ARRAY( font->props, 1 ) )\n          goto Exit;\n      }\n      else\n      {\n        if ( FT_RENEW_ARRAY( font->props,\n                             font->props_size,\n                             font->props_size + 1 ) )\n          goto Exit;\n      }\n\n      fp = font->props + font->props_size;\n      FT_MEM_ZERO( fp, sizeof ( bdf_property_t ) );\n      font->props_size++;\n    }\n\n    propid = hn->data;\n    if ( propid >= _num_bdf_properties )\n      prop = font->user_props + ( propid - _num_bdf_properties );\n    else\n      prop = (bdf_property_t*)_bdf_properties + propid;\n\n    fp = font->props + font->props_used;\n\n    fp->name    = prop->name;\n    fp->format  = prop->format;\n    fp->builtin = prop->builtin;\n\n    switch ( prop->format )\n    {\n    case BDF_ATOM:\n      fp->value.atom = 0;\n      if ( value != 0 && value[0] )\n      {\n        if ( FT_STRDUP( fp->value.atom, value ) )\n          goto Exit;\n      }\n      break;\n\n    case BDF_INTEGER:\n      fp->value.l = _bdf_atol( value, 0, 10 );\n      break;\n\n    case BDF_CARDINAL:\n      fp->value.ul = _bdf_atoul( value, 0, 10 );\n      break;\n    }\n\n    /* If the property happens to be a comment, then it doesn't need */\n    /* to be added to the internal hash table.                       */\n    if ( _bdf_strncmp( name, \"COMMENT\", 7 ) != 0 )\n    {\n      /* Add the property to the font property table. */\n      error = hash_insert( fp->name,\n                           font->props_used,\n                           (hashtable *)font->internal,\n                           memory );\n      if ( error )\n        goto Exit;\n    }\n\n    font->props_used++;\n\n    /* Some special cases need to be handled here.  The DEFAULT_CHAR       */\n    /* property needs to be located if it exists in the property list, the */\n    /* FONT_ASCENT and FONT_DESCENT need to be assigned if they are        */\n    /* present, and the SPACING property should override the default       */\n    /* spacing.                                                            */\n    if ( _bdf_strncmp( name, \"DEFAULT_CHAR\", 12 ) == 0 )\n      font->default_char = fp->value.l;\n    else if ( _bdf_strncmp( name, \"FONT_ASCENT\", 11 ) == 0 )\n      font->font_ascent = fp->value.l;\n    else if ( _bdf_strncmp( name, \"FONT_DESCENT\", 12 ) == 0 )\n      font->font_descent = fp->value.l;\n    else if ( _bdf_strncmp( name, \"SPACING\", 7 ) == 0 )\n    {\n      if ( !fp->value.atom )\n      {\n        FT_ERROR(( \"_bdf_add_property: \" ERRMSG8, lineno, \"SPACING\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Exit;\n      }\n\n      if ( fp->value.atom[0] == 'p' || fp->value.atom[0] == 'P' )\n        font->spacing = BDF_PROPORTIONAL;\n      else if ( fp->value.atom[0] == 'm' || fp->value.atom[0] == 'M' )\n        font->spacing = BDF_MONOWIDTH;\n      else if ( fp->value.atom[0] == 'c' || fp->value.atom[0] == 'C' )\n        font->spacing = BDF_CHARCELL;\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  static const unsigned char nibble_mask[8] =\n  {\n    0xFF, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE\n  };\n\n\n  /* Actually parse the glyph info and bitmaps. */\n  static FT_Error\n  _bdf_parse_glyphs( char*          line,\n                     unsigned long  linelen,\n                     unsigned long  lineno,\n                     void*          call_data,\n                     void*          client_data )\n  {\n    int                c, mask_index;\n    char*              s;\n    unsigned char*     bp;\n    unsigned long      i, slen, nibbles;\n\n    _bdf_parse_t*      p;\n    bdf_glyph_t*       glyph;\n    bdf_font_t*        font;\n\n    FT_Memory          memory;\n    FT_Error           error = FT_Err_Ok;\n\n    FT_UNUSED( call_data );\n    FT_UNUSED( lineno );        /* only used in debug mode */\n\n\n    p = (_bdf_parse_t *)client_data;\n\n    font   = p->font;\n    memory = font->memory;\n\n    /* Check for a comment. */\n    if ( _bdf_strncmp( line, \"COMMENT\", 7 ) == 0 )\n    {\n      linelen -= 7;\n\n      s = line + 7;\n      if ( *s != 0 )\n      {\n        s++;\n        linelen--;\n      }\n      error = _bdf_add_comment( p->font, s, linelen );\n      goto Exit;\n    }\n\n    /* The very first thing expected is the number of glyphs. */\n    if ( !( p->flags & _BDF_GLYPHS ) )\n    {\n      if ( _bdf_strncmp( line, \"CHARS\", 5 ) != 0 )\n      {\n        FT_ERROR(( \"_bdf_parse_glyphs: \" ERRMSG1, lineno, \"CHARS\" ));\n        error = FT_THROW( Missing_Chars_Field );\n        goto Exit;\n      }\n\n      error = _bdf_list_split( &p->list, (char *)\" +\", line, linelen );\n      if ( error )\n        goto Exit;\n      p->cnt = font->glyphs_size = _bdf_atoul( p->list.field[1], 0, 10 );\n\n      /* Make sure the number of glyphs is non-zero. */\n      if ( p->cnt == 0 )\n        font->glyphs_size = 64;\n\n      /* Limit ourselves to 1,114,112 glyphs in the font (this is the */\n      /* number of code points available in Unicode).                 */\n      if ( p->cnt >= 0x110000UL )\n      {\n        FT_ERROR(( \"_bdf_parse_glyphs: \" ERRMSG5, lineno, \"CHARS\" ));\n        error = FT_THROW( Invalid_Argument );\n        goto Exit;\n      }\n\n      if ( FT_NEW_ARRAY( font->glyphs, font->glyphs_size ) )\n        goto Exit;\n\n      p->flags |= _BDF_GLYPHS;\n\n      goto Exit;\n    }\n\n    /* Check for the ENDFONT field. */\n    if ( _bdf_strncmp( line, \"ENDFONT\", 7 ) == 0 )\n    {\n      if ( p->flags & _BDF_GLYPH_BITS )\n      {\n        /* Missing ENDCHAR field. */\n        FT_ERROR(( \"_bdf_parse_glyphs: \" ERRMSG1, lineno, \"ENDCHAR\" ));\n        error = FT_THROW( Corrupted_Font_Glyphs );\n        goto Exit;\n      }\n\n      /* Sort the glyphs by encoding. */\n      ft_qsort( (char *)font->glyphs,\n                font->glyphs_used,\n                sizeof ( bdf_glyph_t ),\n                by_encoding );\n\n      p->flags &= ~_BDF_START;\n\n      goto Exit;\n    }\n\n    /* Check for the ENDCHAR field. */\n    if ( _bdf_strncmp( line, \"ENDCHAR\", 7 ) == 0 )\n    {\n      p->glyph_enc = 0;\n      p->flags    &= ~_BDF_GLYPH_BITS;\n\n      goto Exit;\n    }\n\n    /* Check whether a glyph is being scanned but should be */\n    /* ignored because it is an unencoded glyph.            */\n    if ( ( p->flags & _BDF_GLYPH )     &&\n         p->glyph_enc            == -1 &&\n         p->opts->keep_unencoded == 0  )\n      goto Exit;\n\n    /* Check for the STARTCHAR field. */\n    if ( _bdf_strncmp( line, \"STARTCHAR\", 9 ) == 0 )\n    {\n      /* Set the character name in the parse info first until the */\n      /* encoding can be checked for an unencoded character.      */\n      FT_FREE( p->glyph_name );\n\n      error = _bdf_list_split( &p->list, (char *)\" +\", line, linelen );\n      if ( error )\n        goto Exit;\n\n      _bdf_list_shift( &p->list, 1 );\n\n      s = _bdf_list_join( &p->list, ' ', &slen );\n\n      if ( !s )\n      {\n        FT_ERROR(( \"_bdf_parse_glyphs: \" ERRMSG8, lineno, \"STARTCHAR\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Exit;\n      }\n\n      if ( FT_NEW_ARRAY( p->glyph_name, slen + 1 ) )\n        goto Exit;\n\n      FT_MEM_COPY( p->glyph_name, s, slen + 1 );\n\n      p->flags |= _BDF_GLYPH;\n\n      FT_TRACE4(( DBGMSG1, lineno, s ));\n\n      goto Exit;\n    }\n\n    /* Check for the ENCODING field. */\n    if ( _bdf_strncmp( line, \"ENCODING\", 8 ) == 0 )\n    {\n      if ( !( p->flags & _BDF_GLYPH ) )\n      {\n        /* Missing STARTCHAR field. */\n        FT_ERROR(( \"_bdf_parse_glyphs: \" ERRMSG1, lineno, \"STARTCHAR\" ));\n        error = FT_THROW( Missing_Startchar_Field );\n        goto Exit;\n      }\n\n      error = _bdf_list_split( &p->list, (char *)\" +\", line, linelen );\n      if ( error )\n        goto Exit;\n\n      p->glyph_enc = _bdf_atol( p->list.field[1], 0, 10 );\n\n      /* Normalize negative encoding values.  The specification only */\n      /* allows -1, but we can be more generous here.                */\n      if ( p->glyph_enc < -1 )\n        p->glyph_enc = -1;\n\n      /* Check for alternative encoding format. */\n      if ( p->glyph_enc == -1 && p->list.used > 2 )\n        p->glyph_enc = _bdf_atol( p->list.field[2], 0, 10 );\n\n      if ( p->glyph_enc < -1 )\n        p->glyph_enc = -1;\n\n      FT_TRACE4(( DBGMSG2, p->glyph_enc ));\n\n      /* Check that the encoding is in the Unicode range because  */\n      /* otherwise p->have (a bitmap with static size) overflows. */\n      if ( p->glyph_enc > 0                                      &&\n           (size_t)p->glyph_enc >= sizeof ( p->have ) /\n                                   sizeof ( unsigned long ) * 32 )\n      {\n        FT_ERROR(( \"_bdf_parse_glyphs: \" ERRMSG5, lineno, \"ENCODING\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Exit;\n      }\n\n      /* Check whether this encoding has already been encountered. */\n      /* If it has then change it to unencoded so it gets added if */\n      /* indicated.                                                */\n      if ( p->glyph_enc >= 0 )\n      {\n        if ( _bdf_glyph_modified( p->have, p->glyph_enc ) )\n        {\n          /* Emit a message saying a glyph has been moved to the */\n          /* unencoded area.                                     */\n          FT_TRACE2(( \"_bdf_parse_glyphs: \" ACMSG12,\n                      p->glyph_enc, p->glyph_name ));\n          p->glyph_enc = -1;\n          font->modified = 1;\n        }\n        else\n          _bdf_set_glyph_modified( p->have, p->glyph_enc );\n      }\n\n      if ( p->glyph_enc >= 0 )\n      {\n        /* Make sure there are enough glyphs allocated in case the */\n        /* number of characters happen to be wrong.                */\n        if ( font->glyphs_used == font->glyphs_size )\n        {\n          if ( FT_RENEW_ARRAY( font->glyphs,\n                               font->glyphs_size,\n                               font->glyphs_size + 64 ) )\n            goto Exit;\n\n          font->glyphs_size += 64;\n        }\n\n        glyph           = font->glyphs + font->glyphs_used++;\n        glyph->name     = p->glyph_name;\n        glyph->encoding = p->glyph_enc;\n\n        /* Reset the initial glyph info. */\n        p->glyph_name = 0;\n      }\n      else\n      {\n        /* Unencoded glyph.  Check whether it should */\n        /* be added or not.                          */\n        if ( p->opts->keep_unencoded != 0 )\n        {\n          /* Allocate the next unencoded glyph. */\n          if ( font->unencoded_used == font->unencoded_size )\n          {\n            if ( FT_RENEW_ARRAY( font->unencoded ,\n                                 font->unencoded_size,\n                                 font->unencoded_size + 4 ) )\n              goto Exit;\n\n            font->unencoded_size += 4;\n          }\n\n          glyph           = font->unencoded + font->unencoded_used;\n          glyph->name     = p->glyph_name;\n          glyph->encoding = font->unencoded_used++;\n        }\n        else\n          /* Free up the glyph name if the unencoded shouldn't be */\n          /* kept.                                                */\n          FT_FREE( p->glyph_name );\n\n        p->glyph_name = 0;\n      }\n\n      /* Clear the flags that might be added when width and height are */\n      /* checked for consistency.                                      */\n      p->flags &= ~( _BDF_GLYPH_WIDTH_CHECK | _BDF_GLYPH_HEIGHT_CHECK );\n\n      p->flags |= _BDF_ENCODING;\n\n      goto Exit;\n    }\n\n    /* Point at the glyph being constructed. */\n    if ( p->glyph_enc == -1 )\n      glyph = font->unencoded + ( font->unencoded_used - 1 );\n    else\n      glyph = font->glyphs + ( font->glyphs_used - 1 );\n\n    /* Check whether a bitmap is being constructed. */\n    if ( p->flags & _BDF_BITMAP )\n    {\n      /* If there are more rows than are specified in the glyph metrics, */\n      /* ignore the remaining lines.                                     */\n      if ( p->row >= (unsigned long)glyph->bbx.height )\n      {\n        if ( !( p->flags & _BDF_GLYPH_HEIGHT_CHECK ) )\n        {\n          FT_TRACE2(( \"_bdf_parse_glyphs: \" ACMSG13, glyph->encoding ));\n          p->flags |= _BDF_GLYPH_HEIGHT_CHECK;\n          font->modified = 1;\n        }\n\n        goto Exit;\n      }\n\n      /* Only collect the number of nibbles indicated by the glyph     */\n      /* metrics.  If there are more columns, they are simply ignored. */\n      nibbles = glyph->bpr << 1;\n      bp      = glyph->bitmap + p->row * glyph->bpr;\n\n      for ( i = 0; i < nibbles; i++ )\n      {\n        c = line[i];\n        if ( !sbitset( hdigits, c ) )\n          break;\n        *bp = (FT_Byte)( ( *bp << 4 ) + a2i[c] );\n        if ( i + 1 < nibbles && ( i & 1 ) )\n          *++bp = 0;\n      }\n\n      /* If any line has not enough columns,            */\n      /* indicate they have been padded with zero bits. */\n      if ( i < nibbles                            &&\n           !( p->flags & _BDF_GLYPH_WIDTH_CHECK ) )\n      {\n        FT_TRACE2(( \"_bdf_parse_glyphs: \" ACMSG16, glyph->encoding ));\n        p->flags       |= _BDF_GLYPH_WIDTH_CHECK;\n        font->modified  = 1;\n      }\n\n      /* Remove possible garbage at the right. */\n      mask_index = ( glyph->bbx.width * p->font->bpp ) & 7;\n      if ( glyph->bbx.width )\n        *bp &= nibble_mask[mask_index];\n\n      /* If any line has extra columns, indicate they have been removed. */\n      if ( i == nibbles                           &&\n           sbitset( hdigits, line[nibbles] )      &&\n           !( p->flags & _BDF_GLYPH_WIDTH_CHECK ) )\n      {\n        FT_TRACE2(( \"_bdf_parse_glyphs: \" ACMSG14, glyph->encoding ));\n        p->flags       |= _BDF_GLYPH_WIDTH_CHECK;\n        font->modified  = 1;\n      }\n\n      p->row++;\n      goto Exit;\n    }\n\n    /* Expect the SWIDTH (scalable width) field next. */\n    if ( _bdf_strncmp( line, \"SWIDTH\", 6 ) == 0 )\n    {\n      if ( !( p->flags & _BDF_ENCODING ) )\n        goto Missing_Encoding;\n\n      error = _bdf_list_split( &p->list, (char *)\" +\", line, linelen );\n      if ( error )\n        goto Exit;\n\n      glyph->swidth = (unsigned short)_bdf_atoul( p->list.field[1], 0, 10 );\n      p->flags |= _BDF_SWIDTH;\n\n      goto Exit;\n    }\n\n    /* Expect the DWIDTH (scalable width) field next. */\n    if ( _bdf_strncmp( line, \"DWIDTH\", 6 ) == 0 )\n    {\n      if ( !( p->flags & _BDF_ENCODING ) )\n        goto Missing_Encoding;\n\n      error = _bdf_list_split( &p->list, (char *)\" +\", line, linelen );\n      if ( error )\n        goto Exit;\n\n      glyph->dwidth = (unsigned short)_bdf_atoul( p->list.field[1], 0, 10 );\n\n      if ( !( p->flags & _BDF_SWIDTH ) )\n      {\n        /* Missing SWIDTH field.  Emit an auto correction message and set */\n        /* the scalable width from the device width.                      */\n        FT_TRACE2(( \"_bdf_parse_glyphs: \" ACMSG9, lineno ));\n\n        glyph->swidth = (unsigned short)FT_MulDiv(\n                          glyph->dwidth, 72000L,\n                          (FT_Long)( font->point_size *\n                                     font->resolution_x ) );\n      }\n\n      p->flags |= _BDF_DWIDTH;\n      goto Exit;\n    }\n\n    /* Expect the BBX field next. */\n    if ( _bdf_strncmp( line, \"BBX\", 3 ) == 0 )\n    {\n      if ( !( p->flags & _BDF_ENCODING ) )\n        goto Missing_Encoding;\n\n      error = _bdf_list_split( &p->list, (char *)\" +\", line, linelen );\n      if ( error )\n        goto Exit;\n\n      glyph->bbx.width    = _bdf_atos( p->list.field[1], 0, 10 );\n      glyph->bbx.height   = _bdf_atos( p->list.field[2], 0, 10 );\n      glyph->bbx.x_offset = _bdf_atos( p->list.field[3], 0, 10 );\n      glyph->bbx.y_offset = _bdf_atos( p->list.field[4], 0, 10 );\n\n      /* Generate the ascent and descent of the character. */\n      glyph->bbx.ascent  = (short)( glyph->bbx.height + glyph->bbx.y_offset );\n      glyph->bbx.descent = (short)( -glyph->bbx.y_offset );\n\n      /* Determine the overall font bounding box as the characters are */\n      /* loaded so corrections can be done later if indicated.         */\n      p->maxas    = (short)FT_MAX( glyph->bbx.ascent, p->maxas );\n      p->maxds    = (short)FT_MAX( glyph->bbx.descent, p->maxds );\n\n      p->rbearing = (short)( glyph->bbx.width + glyph->bbx.x_offset );\n\n      p->maxrb    = (short)FT_MAX( p->rbearing, p->maxrb );\n      p->minlb    = (short)FT_MIN( glyph->bbx.x_offset, p->minlb );\n      p->maxlb    = (short)FT_MAX( glyph->bbx.x_offset, p->maxlb );\n\n      if ( !( p->flags & _BDF_DWIDTH ) )\n      {\n        /* Missing DWIDTH field.  Emit an auto correction message and set */\n        /* the device width to the glyph width.                           */\n        FT_TRACE2(( \"_bdf_parse_glyphs: \" ACMSG10, lineno ));\n        glyph->dwidth = glyph->bbx.width;\n      }\n\n      /* If the BDF_CORRECT_METRICS flag is set, then adjust the SWIDTH */\n      /* value if necessary.                                            */\n      if ( p->opts->correct_metrics != 0 )\n      {\n        /* Determine the point size of the glyph. */\n        unsigned short  sw = (unsigned short)FT_MulDiv(\n                               glyph->dwidth, 72000L,\n                               (FT_Long)( font->point_size *\n                                          font->resolution_x ) );\n\n\n        if ( sw != glyph->swidth )\n        {\n          glyph->swidth = sw;\n\n          if ( p->glyph_enc == -1 )\n            _bdf_set_glyph_modified( font->umod,\n                                     font->unencoded_used - 1 );\n          else\n            _bdf_set_glyph_modified( font->nmod, glyph->encoding );\n\n          p->flags       |= _BDF_SWIDTH_ADJ;\n          font->modified  = 1;\n        }\n      }\n\n      p->flags |= _BDF_BBX;\n      goto Exit;\n    }\n\n    /* And finally, gather up the bitmap. */\n    if ( _bdf_strncmp( line, \"BITMAP\", 6 ) == 0 )\n    {\n      unsigned long  bitmap_size;\n\n\n      if ( !( p->flags & _BDF_BBX ) )\n      {\n        /* Missing BBX field. */\n        FT_ERROR(( \"_bdf_parse_glyphs: \" ERRMSG1, lineno, \"BBX\" ));\n        error = FT_THROW( Missing_Bbx_Field );\n        goto Exit;\n      }\n\n      /* Allocate enough space for the bitmap. */\n      glyph->bpr = ( glyph->bbx.width * p->font->bpp + 7 ) >> 3;\n\n      bitmap_size = glyph->bpr * glyph->bbx.height;\n      if ( glyph->bpr > 0xFFFFU || bitmap_size > 0xFFFFU )\n      {\n        FT_ERROR(( \"_bdf_parse_glyphs: \" ERRMSG4, lineno ));\n        error = FT_THROW( Bbx_Too_Big );\n        goto Exit;\n      }\n      else\n        glyph->bytes = (unsigned short)bitmap_size;\n\n      if ( FT_NEW_ARRAY( glyph->bitmap, glyph->bytes ) )\n        goto Exit;\n\n      p->row    = 0;\n      p->flags |= _BDF_BITMAP;\n\n      goto Exit;\n    }\n\n    FT_ERROR(( \"_bdf_parse_glyphs: \" ERRMSG9, lineno ));\n    error = FT_THROW( Invalid_File_Format );\n    goto Exit;\n\n  Missing_Encoding:\n    /* Missing ENCODING field. */\n    FT_ERROR(( \"_bdf_parse_glyphs: \" ERRMSG1, lineno, \"ENCODING\" ));\n    error = FT_THROW( Missing_Encoding_Field );\n\n  Exit:\n    if ( error && ( p->flags & _BDF_GLYPH ) )\n      FT_FREE( p->glyph_name );\n\n    return error;\n  }\n\n\n  /* Load the font properties. */\n  static FT_Error\n  _bdf_parse_properties( char*          line,\n                         unsigned long  linelen,\n                         unsigned long  lineno,\n                         void*          call_data,\n                         void*          client_data )\n  {\n    unsigned long      vlen;\n    _bdf_line_func_t*  next;\n    _bdf_parse_t*      p;\n    char*              name;\n    char*              value;\n    char               nbuf[128];\n    FT_Error           error = FT_Err_Ok;\n\n    FT_UNUSED( lineno );\n\n\n    next = (_bdf_line_func_t *)call_data;\n    p    = (_bdf_parse_t *)    client_data;\n\n    /* Check for the end of the properties. */\n    if ( _bdf_strncmp( line, \"ENDPROPERTIES\", 13 ) == 0 )\n    {\n      /* If the FONT_ASCENT or FONT_DESCENT properties have not been      */\n      /* encountered yet, then make sure they are added as properties and */\n      /* make sure they are set from the font bounding box info.          */\n      /*                                                                  */\n      /* This is *always* done regardless of the options, because X11     */\n      /* requires these two fields to compile fonts.                      */\n      if ( bdf_get_font_property( p->font, \"FONT_ASCENT\" ) == 0 )\n      {\n        p->font->font_ascent = p->font->bbx.ascent;\n        ft_sprintf( nbuf, \"%hd\", p->font->bbx.ascent );\n        error = _bdf_add_property( p->font, (char *)\"FONT_ASCENT\",\n                                   nbuf, lineno );\n        if ( error )\n          goto Exit;\n\n        FT_TRACE2(( \"_bdf_parse_properties: \" ACMSG1, p->font->bbx.ascent ));\n        p->font->modified = 1;\n      }\n\n      if ( bdf_get_font_property( p->font, \"FONT_DESCENT\" ) == 0 )\n      {\n        p->font->font_descent = p->font->bbx.descent;\n        ft_sprintf( nbuf, \"%hd\", p->font->bbx.descent );\n        error = _bdf_add_property( p->font, (char *)\"FONT_DESCENT\",\n                                   nbuf, lineno );\n        if ( error )\n          goto Exit;\n\n        FT_TRACE2(( \"_bdf_parse_properties: \" ACMSG2, p->font->bbx.descent ));\n        p->font->modified = 1;\n      }\n\n      p->flags &= ~_BDF_PROPS;\n      *next     = _bdf_parse_glyphs;\n\n      goto Exit;\n    }\n\n    /* Ignore the _XFREE86_GLYPH_RANGES properties. */\n    if ( _bdf_strncmp( line, \"_XFREE86_GLYPH_RANGES\", 21 ) == 0 )\n      goto Exit;\n\n    /* Handle COMMENT fields and properties in a special way to preserve */\n    /* the spacing.                                                      */\n    if ( _bdf_strncmp( line, \"COMMENT\", 7 ) == 0 )\n    {\n      name = value = line;\n      value += 7;\n      if ( *value )\n        *value++ = 0;\n      error = _bdf_add_property( p->font, name, value, lineno );\n      if ( error )\n        goto Exit;\n    }\n    else if ( _bdf_is_atom( line, linelen, &name, &value, p->font ) )\n    {\n      error = _bdf_add_property( p->font, name, value, lineno );\n      if ( error )\n        goto Exit;\n    }\n    else\n    {\n      error = _bdf_list_split( &p->list, (char *)\" +\", line, linelen );\n      if ( error )\n        goto Exit;\n      name = p->list.field[0];\n\n      _bdf_list_shift( &p->list, 1 );\n      value = _bdf_list_join( &p->list, ' ', &vlen );\n\n      error = _bdf_add_property( p->font, name, value, lineno );\n      if ( error )\n        goto Exit;\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /* Load the font header. */\n  static FT_Error\n  _bdf_parse_start( char*          line,\n                    unsigned long  linelen,\n                    unsigned long  lineno,\n                    void*          call_data,\n                    void*          client_data )\n  {\n    unsigned long      slen;\n    _bdf_line_func_t*  next;\n    _bdf_parse_t*      p;\n    bdf_font_t*        font;\n    char               *s;\n\n    FT_Memory          memory = NULL;\n    FT_Error           error  = FT_Err_Ok;\n\n    FT_UNUSED( lineno );            /* only used in debug mode */\n\n\n    next = (_bdf_line_func_t *)call_data;\n    p    = (_bdf_parse_t *)    client_data;\n\n    if ( p->font )\n      memory = p->font->memory;\n\n    /* Check for a comment.  This is done to handle those fonts that have */\n    /* comments before the STARTFONT line for some reason.                */\n    if ( _bdf_strncmp( line, \"COMMENT\", 7 ) == 0 )\n    {\n      if ( p->opts->keep_comments != 0 && p->font != 0 )\n      {\n        linelen -= 7;\n\n        s = line + 7;\n        if ( *s != 0 )\n        {\n          s++;\n          linelen--;\n        }\n\n        error = _bdf_add_comment( p->font, s, linelen );\n        if ( error )\n          goto Exit;\n        /* here font is not defined! */\n      }\n\n      goto Exit;\n    }\n\n    if ( !( p->flags & _BDF_START ) )\n    {\n      memory = p->memory;\n\n      if ( _bdf_strncmp( line, \"STARTFONT\", 9 ) != 0 )\n      {\n        /* we don't emit an error message since this code gets */\n        /* explicitly caught one level higher                  */\n        error = FT_THROW( Missing_Startfont_Field );\n        goto Exit;\n      }\n\n      p->flags = _BDF_START;\n      font = p->font = 0;\n\n      if ( FT_NEW( font ) )\n        goto Exit;\n      p->font = font;\n\n      font->memory = p->memory;\n      p->memory    = 0;\n\n      { /* setup */\n        size_t           i;\n        bdf_property_t*  prop;\n\n\n        error = hash_init( &(font->proptbl), memory );\n        if ( error )\n          goto Exit;\n        for ( i = 0, prop = (bdf_property_t*)_bdf_properties;\n              i < _num_bdf_properties; i++, prop++ )\n        {\n          error = hash_insert( prop->name, i,\n                               &(font->proptbl), memory );\n          if ( error )\n            goto Exit;\n        }\n      }\n\n      if ( FT_ALLOC( p->font->internal, sizeof ( hashtable ) ) )\n        goto Exit;\n      error = hash_init( (hashtable *)p->font->internal,memory );\n      if ( error )\n        goto Exit;\n      p->font->spacing      = p->opts->font_spacing;\n      p->font->default_char = -1;\n\n      goto Exit;\n    }\n\n    /* Check for the start of the properties. */\n    if ( _bdf_strncmp( line, \"STARTPROPERTIES\", 15 ) == 0 )\n    {\n      if ( !( p->flags & _BDF_FONT_BBX ) )\n      {\n        /* Missing the FONTBOUNDINGBOX field. */\n        FT_ERROR(( \"_bdf_parse_start: \" ERRMSG1, lineno, \"FONTBOUNDINGBOX\" ));\n        error = FT_THROW( Missing_Fontboundingbox_Field );\n        goto Exit;\n      }\n\n      error = _bdf_list_split( &p->list, (char *)\" +\", line, linelen );\n      if ( error )\n        goto Exit;\n      /* at this point, `p->font' can't be NULL */\n      p->cnt = p->font->props_size = _bdf_atoul( p->list.field[1], 0, 10 );\n\n      if ( FT_NEW_ARRAY( p->font->props, p->cnt ) )\n      {\n        p->font->props_size = 0;\n        goto Exit;\n      }\n\n      p->flags |= _BDF_PROPS;\n      *next     = _bdf_parse_properties;\n\n      goto Exit;\n    }\n\n    /* Check for the FONTBOUNDINGBOX field. */\n    if ( _bdf_strncmp( line, \"FONTBOUNDINGBOX\", 15 ) == 0 )\n    {\n      if ( !( p->flags & _BDF_SIZE ) )\n      {\n        /* Missing the SIZE field. */\n        FT_ERROR(( \"_bdf_parse_start: \" ERRMSG1, lineno, \"SIZE\" ));\n        error = FT_THROW( Missing_Size_Field );\n        goto Exit;\n      }\n\n      error = _bdf_list_split( &p->list, (char *)\" +\", line, linelen );\n      if ( error )\n        goto Exit;\n\n      p->font->bbx.width  = _bdf_atos( p->list.field[1], 0, 10 );\n      p->font->bbx.height = _bdf_atos( p->list.field[2], 0, 10 );\n\n      p->font->bbx.x_offset = _bdf_atos( p->list.field[3], 0, 10 );\n      p->font->bbx.y_offset = _bdf_atos( p->list.field[4], 0, 10 );\n\n      p->font->bbx.ascent  = (short)( p->font->bbx.height +\n                                      p->font->bbx.y_offset );\n\n      p->font->bbx.descent = (short)( -p->font->bbx.y_offset );\n\n      p->flags |= _BDF_FONT_BBX;\n\n      goto Exit;\n    }\n\n    /* The next thing to check for is the FONT field. */\n    if ( _bdf_strncmp( line, \"FONT\", 4 ) == 0 )\n    {\n      error = _bdf_list_split( &p->list, (char *)\" +\", line, linelen );\n      if ( error )\n        goto Exit;\n      _bdf_list_shift( &p->list, 1 );\n\n      s = _bdf_list_join( &p->list, ' ', &slen );\n\n      if ( !s )\n      {\n        FT_ERROR(( \"_bdf_parse_start: \" ERRMSG8, lineno, \"FONT\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Exit;\n      }\n\n      /* Allowing multiple `FONT' lines (which is invalid) doesn't hurt... */\n      FT_FREE( p->font->name );\n\n      if ( FT_NEW_ARRAY( p->font->name, slen + 1 ) )\n        goto Exit;\n      FT_MEM_COPY( p->font->name, s, slen + 1 );\n\n      /* If the font name is an XLFD name, set the spacing to the one in  */\n      /* the font name.  If there is no spacing fall back on the default. */\n      error = _bdf_set_default_spacing( p->font, p->opts, lineno );\n      if ( error )\n        goto Exit;\n\n      p->flags |= _BDF_FONT_NAME;\n\n      goto Exit;\n    }\n\n    /* Check for the SIZE field. */\n    if ( _bdf_strncmp( line, \"SIZE\", 4 ) == 0 )\n    {\n      if ( !( p->flags & _BDF_FONT_NAME ) )\n      {\n        /* Missing the FONT field. */\n        FT_ERROR(( \"_bdf_parse_start: \" ERRMSG1, lineno, \"FONT\" ));\n        error = FT_THROW( Missing_Font_Field );\n        goto Exit;\n      }\n\n      error = _bdf_list_split( &p->list, (char *)\" +\", line, linelen );\n      if ( error )\n        goto Exit;\n\n      p->font->point_size   = _bdf_atoul( p->list.field[1], 0, 10 );\n      p->font->resolution_x = _bdf_atoul( p->list.field[2], 0, 10 );\n      p->font->resolution_y = _bdf_atoul( p->list.field[3], 0, 10 );\n\n      /* Check for the bits per pixel field. */\n      if ( p->list.used == 5 )\n      {\n        unsigned short bitcount, i, shift;\n\n\n        p->font->bpp = (unsigned short)_bdf_atos( p->list.field[4], 0, 10 );\n\n        /* Only values 1, 2, 4, 8 are allowed. */\n        shift = p->font->bpp;\n        bitcount = 0;\n        for ( i = 0; shift > 0; i++ )\n        {\n          if ( shift & 1 )\n            bitcount = i;\n          shift >>= 1;\n        }\n\n        shift = (short)( ( bitcount > 3 ) ? 8 : ( 1 << bitcount ) );\n\n        if ( p->font->bpp > shift || p->font->bpp != shift )\n        {\n          /* select next higher value */\n          p->font->bpp = (unsigned short)( shift << 1 );\n          FT_TRACE2(( \"_bdf_parse_start: \" ACMSG11, p->font->bpp ));\n        }\n      }\n      else\n        p->font->bpp = 1;\n\n      p->flags |= _BDF_SIZE;\n\n      goto Exit;\n    }\n\n    /* Check for the CHARS field -- font properties are optional */\n    if ( _bdf_strncmp( line, \"CHARS\", 5 ) == 0 )\n    {\n      char  nbuf[128];\n\n\n      if ( !( p->flags & _BDF_FONT_BBX ) )\n      {\n        /* Missing the FONTBOUNDINGBOX field. */\n        FT_ERROR(( \"_bdf_parse_start: \" ERRMSG1, lineno, \"FONTBOUNDINGBOX\" ));\n        error = FT_THROW( Missing_Fontboundingbox_Field );\n        goto Exit;\n      }\n\n      /* Add the two standard X11 properties which are required */\n      /* for compiling fonts.                                   */\n      p->font->font_ascent = p->font->bbx.ascent;\n      ft_sprintf( nbuf, \"%hd\", p->font->bbx.ascent );\n      error = _bdf_add_property( p->font, (char *)\"FONT_ASCENT\",\n                                 nbuf, lineno );\n      if ( error )\n        goto Exit;\n      FT_TRACE2(( \"_bdf_parse_properties: \" ACMSG1, p->font->bbx.ascent ));\n\n      p->font->font_descent = p->font->bbx.descent;\n      ft_sprintf( nbuf, \"%hd\", p->font->bbx.descent );\n      error = _bdf_add_property( p->font, (char *)\"FONT_DESCENT\",\n                                 nbuf, lineno );\n      if ( error )\n        goto Exit;\n      FT_TRACE2(( \"_bdf_parse_properties: \" ACMSG2, p->font->bbx.descent ));\n\n      p->font->modified = 1;\n\n      *next = _bdf_parse_glyphs;\n\n      /* A special return value. */\n      error = -1;\n      goto Exit;\n    }\n\n    FT_ERROR(( \"_bdf_parse_start: \" ERRMSG9, lineno ));\n    error = FT_THROW( Invalid_File_Format );\n\n  Exit:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* API.                                                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  FT_LOCAL_DEF( FT_Error )\n  bdf_load_font( FT_Stream       stream,\n                 FT_Memory       extmemory,\n                 bdf_options_t*  opts,\n                 bdf_font_t*    *font )\n  {\n    unsigned long  lineno = 0; /* make compiler happy */\n    _bdf_parse_t   *p     = NULL;\n\n    FT_Memory  memory = extmemory; /* needed for FT_NEW */\n    FT_Error   error  = FT_Err_Ok;\n\n\n    if ( FT_NEW( p ) )\n      goto Exit;\n\n    memory    = NULL;\n    p->opts   = (bdf_options_t*)( ( opts != 0 ) ? opts : &_bdf_opts );\n    p->minlb  = 32767;\n    p->memory = extmemory;  /* only during font creation */\n\n    _bdf_list_init( &p->list, extmemory );\n\n    error = _bdf_readstream( stream, _bdf_parse_start,\n                             (void *)p, &lineno );\n    if ( error )\n      goto Fail;\n\n    if ( p->font != 0 )\n    {\n      /* If the font is not proportional, set the font's monowidth */\n      /* field to the width of the font bounding box.              */\n\n      if ( p->font->spacing != BDF_PROPORTIONAL )\n        p->font->monowidth = p->font->bbx.width;\n\n      /* If the number of glyphs loaded is not that of the original count, */\n      /* indicate the difference.                                          */\n      if ( p->cnt != p->font->glyphs_used + p->font->unencoded_used )\n      {\n        FT_TRACE2(( \"bdf_load_font: \" ACMSG15, p->cnt,\n                    p->font->glyphs_used + p->font->unencoded_used ));\n        p->font->modified = 1;\n      }\n\n      /* Once the font has been loaded, adjust the overall font metrics if */\n      /* necessary.                                                        */\n      if ( p->opts->correct_metrics != 0 &&\n           ( p->font->glyphs_used > 0 || p->font->unencoded_used > 0 ) )\n      {\n        if ( p->maxrb - p->minlb != p->font->bbx.width )\n        {\n          FT_TRACE2(( \"bdf_load_font: \" ACMSG3,\n                      p->font->bbx.width, p->maxrb - p->minlb ));\n          p->font->bbx.width = (unsigned short)( p->maxrb - p->minlb );\n          p->font->modified  = 1;\n        }\n\n        if ( p->font->bbx.x_offset != p->minlb )\n        {\n          FT_TRACE2(( \"bdf_load_font: \" ACMSG4,\n                      p->font->bbx.x_offset, p->minlb ));\n          p->font->bbx.x_offset = p->minlb;\n          p->font->modified     = 1;\n        }\n\n        if ( p->font->bbx.ascent != p->maxas )\n        {\n          FT_TRACE2(( \"bdf_load_font: \" ACMSG5,\n                      p->font->bbx.ascent, p->maxas ));\n          p->font->bbx.ascent = p->maxas;\n          p->font->modified   = 1;\n        }\n\n        if ( p->font->bbx.descent != p->maxds )\n        {\n          FT_TRACE2(( \"bdf_load_font: \" ACMSG6,\n                      p->font->bbx.descent, p->maxds ));\n          p->font->bbx.descent  = p->maxds;\n          p->font->bbx.y_offset = (short)( -p->maxds );\n          p->font->modified     = 1;\n        }\n\n        if ( p->maxas + p->maxds != p->font->bbx.height )\n        {\n          FT_TRACE2(( \"bdf_load_font: \" ACMSG7,\n                      p->font->bbx.height, p->maxas + p->maxds ));\n          p->font->bbx.height = (unsigned short)( p->maxas + p->maxds );\n        }\n\n        if ( p->flags & _BDF_SWIDTH_ADJ )\n          FT_TRACE2(( \"bdf_load_font: \" ACMSG8 ));\n      }\n    }\n\n    if ( p->flags & _BDF_START )\n    {\n      /* The ENDFONT field was never reached or did not exist. */\n      if ( !( p->flags & _BDF_GLYPHS ) )\n      {\n        /* Error happened while parsing header. */\n        FT_ERROR(( \"bdf_load_font: \" ERRMSG2, lineno ));\n        error = FT_THROW( Corrupted_Font_Header );\n        goto Exit;\n      }\n      else\n      {\n        /* Error happened when parsing glyphs. */\n        FT_ERROR(( \"bdf_load_font: \" ERRMSG3, lineno ));\n        error = FT_THROW( Corrupted_Font_Glyphs );\n        goto Exit;\n      }\n    }\n\n    if ( p->font != 0 )\n    {\n      /* Make sure the comments are NULL terminated if they exist. */\n      memory = p->font->memory;\n\n      if ( p->font->comments_len > 0 )\n      {\n        if ( FT_RENEW_ARRAY( p->font->comments,\n                             p->font->comments_len,\n                             p->font->comments_len + 1 ) )\n          goto Fail;\n\n        p->font->comments[p->font->comments_len] = 0;\n      }\n    }\n    else if ( error == FT_Err_Ok )\n      error = FT_THROW( Invalid_File_Format );\n\n    *font = p->font;\n\n  Exit:\n    if ( p )\n    {\n      _bdf_list_done( &p->list );\n\n      memory = extmemory;\n\n      FT_FREE( p );\n    }\n\n    return error;\n\n  Fail:\n    bdf_free_font( p->font );\n\n    memory = extmemory;\n\n    FT_FREE( p->font );\n\n    goto Exit;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  bdf_free_font( bdf_font_t*  font )\n  {\n    bdf_property_t*  prop;\n    unsigned long    i;\n    bdf_glyph_t*     glyphs;\n    FT_Memory        memory;\n\n\n    if ( font == 0 )\n      return;\n\n    memory = font->memory;\n\n    FT_FREE( font->name );\n\n    /* Free up the internal hash table of property names. */\n    if ( font->internal )\n    {\n      hash_free( (hashtable *)font->internal, memory );\n      FT_FREE( font->internal );\n    }\n\n    /* Free up the comment info. */\n    FT_FREE( font->comments );\n\n    /* Free up the properties. */\n    for ( i = 0; i < font->props_size; i++ )\n    {\n      if ( font->props[i].format == BDF_ATOM )\n        FT_FREE( font->props[i].value.atom );\n    }\n\n    FT_FREE( font->props );\n\n    /* Free up the character info. */\n    for ( i = 0, glyphs = font->glyphs;\n          i < font->glyphs_used; i++, glyphs++ )\n    {\n      FT_FREE( glyphs->name );\n      FT_FREE( glyphs->bitmap );\n    }\n\n    for ( i = 0, glyphs = font->unencoded; i < font->unencoded_used;\n          i++, glyphs++ )\n    {\n      FT_FREE( glyphs->name );\n      FT_FREE( glyphs->bitmap );\n    }\n\n    FT_FREE( font->glyphs );\n    FT_FREE( font->unencoded );\n\n    /* Free up the overflow storage if it was used. */\n    for ( i = 0, glyphs = font->overflow.glyphs;\n          i < font->overflow.glyphs_used; i++, glyphs++ )\n    {\n      FT_FREE( glyphs->name );\n      FT_FREE( glyphs->bitmap );\n    }\n\n    FT_FREE( font->overflow.glyphs );\n\n    /* bdf_cleanup */\n    hash_free( &(font->proptbl), memory );\n\n    /* Free up the user defined properties. */\n    for ( prop = font->user_props, i = 0;\n          i < font->nuser_props; i++, prop++ )\n    {\n      FT_FREE( prop->name );\n      if ( prop->format == BDF_ATOM )\n        FT_FREE( prop->value.atom );\n    }\n\n    FT_FREE( font->user_props );\n\n    /* FREE( font ); */ /* XXX Fixme */\n  }\n\n\n  FT_LOCAL_DEF( bdf_property_t * )\n  bdf_get_font_property( bdf_font_t*  font,\n                         const char*  name )\n  {\n    hashnode  hn;\n\n\n    if ( font == 0 || font->props_size == 0 || name == 0 || *name == 0 )\n      return 0;\n\n    hn = hash_lookup( name, (hashtable *)font->internal );\n\n    return hn ? ( font->props + hn->data ) : 0;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/bdf/module.mk",
    "content": "#\n# FreeType 2 BDF module definition\n#\n\n# Copyright 2001, 2002, 2006 by\n# Francesco Zappa Nardelli\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n\nFTMODULE_H_COMMANDS += BDF_DRIVER\n\ndefine BDF_DRIVER\n$(OPEN_DRIVER) FT_Driver_ClassRec, bdf_driver_class $(CLOSE_DRIVER)\n$(ECHO_DRIVER)bdf       $(ECHO_DRIVER_DESC)bdf bitmap fonts$(ECHO_DRIVER_DONE)\nendef\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/bdf/rules.mk",
    "content": "#\n# FreeType 2 bdf driver configuration rules\n#\n\n\n# Copyright (C) 2001, 2002, 2003, 2008 by\n# Francesco Zappa Nardelli\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n\n\n\n# bdf driver directory\n#\nBDF_DIR := $(SRC_DIR)/bdf\n\n\nBDF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(BDF_DIR))\n\n\n# bdf driver sources (i.e., C files)\n#\nBDF_DRV_SRC := $(BDF_DIR)/bdflib.c \\\n               $(BDF_DIR)/bdfdrivr.c\n\n\n# bdf driver headers\n#\nBDF_DRV_H := $(BDF_DIR)/bdf.h \\\n             $(BDF_DIR)/bdfdrivr.h \\\n             $(BDF_DIR)/bdferror.h\n\n# bdf driver object(s)\n#\n#   BDF_DRV_OBJ_M is used during `multi' builds\n#   BDF_DRV_OBJ_S is used during `single' builds\n#\nBDF_DRV_OBJ_M := $(BDF_DRV_SRC:$(BDF_DIR)/%.c=$(OBJ_DIR)/%.$O)\nBDF_DRV_OBJ_S := $(OBJ_DIR)/bdf.$O\n\n# bdf driver source file for single build\n#\nBDF_DRV_SRC_S := $(BDF_DIR)/bdf.c\n\n\n# bdf driver - single object\n#\n$(BDF_DRV_OBJ_S): $(BDF_DRV_SRC_S) $(BDF_DRV_SRC) $(FREETYPE_H) $(BDF_DRV_H)\n\t$(BDF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(BDF_DRV_SRC_S))\n\n\n# bdf driver - multiple objects\n#\n$(OBJ_DIR)/%.$O: $(BDF_DIR)/%.c $(FREETYPE_H) $(BDF_DRV_H)\n\t$(BDF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\n\n\n# update main driver object lists\n#\nDRV_OBJS_S += $(BDF_DRV_OBJ_S)\nDRV_OBJS_M += $(BDF_DRV_OBJ_M)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/bzip2/Jamfile",
    "content": "# FreeType 2 src/bzip2 Jamfile\n#\n# Copyright 2010 by\n# Joel Klinghed\n#\n# Based on src/lzw/Jamfile, Copyright 2004, 2006 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) bzip2 ;\n\nLibrary  $(FT2_LIB) : ftbzip2.c ;\n\n# end of src/bzip2 Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/bzip2/ftbzip2.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbzip2.c                                                              */\n/*                                                                         */\n/*    FreeType support for .bz2 compressed files.                          */\n/*                                                                         */\n/*  This optional component relies on libbz2.  It should mainly be used to */\n/*  parse compressed PCF fonts, as found with many X11 server              */\n/*  distributions.                                                         */\n/*                                                                         */\n/*  Copyright 2010, 2012-2014 by                                           */\n/*  Joel Klinghed.                                                         */\n/*                                                                         */\n/*  Based on src/gzip/ftgzip.c, Copyright 2002 - 2010 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_MEMORY_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_BZIP2_H\n#include FT_CONFIG_STANDARD_LIBRARY_H\n\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  Bzip2_Err_\n#define FT_ERR_BASE    FT_Mod_Err_Bzip2\n\n#include FT_ERRORS_H\n\n\n#ifdef FT_CONFIG_OPTION_USE_BZIP2\n\n#ifdef FT_CONFIG_OPTION_PIC\n#error \"bzip2 code does not support PIC yet\"\n#endif\n\n#define BZ_NO_STDIO /* Do not need FILE */\n#include <bzlib.h>\n\n\n/***************************************************************************/\n/***************************************************************************/\n/*****                                                                 *****/\n/*****           B Z I P 2   M E M O R Y   M A N A G E M E N T         *****/\n/*****                                                                 *****/\n/***************************************************************************/\n/***************************************************************************/\n\n  /* it is better to use FreeType memory routines instead of raw\n     'malloc/free' */\n\n  typedef void *(* alloc_func)(void*, int, int);\n  typedef void (* free_func)(void*, void*);\n\n  static void*\n  ft_bzip2_alloc( FT_Memory  memory,\n                  int        items,\n                  int        size )\n  {\n    FT_ULong    sz = (FT_ULong)size * items;\n    FT_Error    error;\n    FT_Pointer  p  = NULL;\n\n\n    (void)FT_ALLOC( p, sz );\n    return p;\n  }\n\n\n  static void\n  ft_bzip2_free( FT_Memory  memory,\n                 void*      address )\n  {\n    FT_MEM_FREE( address );\n  }\n\n\n/***************************************************************************/\n/***************************************************************************/\n/*****                                                                 *****/\n/*****              B Z I P 2   F I L E   D E S C R I P T O R          *****/\n/*****                                                                 *****/\n/***************************************************************************/\n/***************************************************************************/\n\n#define FT_BZIP2_BUFFER_SIZE  4096\n\n  typedef struct  FT_BZip2FileRec_\n  {\n    FT_Stream  source;         /* parent/source stream        */\n    FT_Stream  stream;         /* embedding stream            */\n    FT_Memory  memory;         /* memory allocator            */\n    bz_stream  bzstream;       /* bzlib input stream          */\n\n    FT_Byte    input[FT_BZIP2_BUFFER_SIZE];  /* input read buffer  */\n\n    FT_Byte    buffer[FT_BZIP2_BUFFER_SIZE]; /* output buffer      */\n    FT_ULong   pos;                          /* position in output */\n    FT_Byte*   cursor;\n    FT_Byte*   limit;\n\n  } FT_BZip2FileRec, *FT_BZip2File;\n\n\n  /* check and skip .bz2 header - we don't support `transparent' compression */\n  static FT_Error\n  ft_bzip2_check_header( FT_Stream  stream )\n  {\n    FT_Error  error = FT_Err_Ok;\n    FT_Byte   head[4];\n\n\n    if ( FT_STREAM_SEEK( 0 )       ||\n         FT_STREAM_READ( head, 4 ) )\n      goto Exit;\n\n    /* head[0] && head[1] are the magic numbers;    */\n    /* head[2] is the version, and head[3] the blocksize */\n    if ( head[0] != 0x42  ||\n         head[1] != 0x5A  ||\n         head[2] != 0x68  )  /* only support bzip2 (huffman) */\n    {\n      error = FT_THROW( Invalid_File_Format );\n      goto Exit;\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  static FT_Error\n  ft_bzip2_file_init( FT_BZip2File  zip,\n                      FT_Stream     stream,\n                      FT_Stream     source )\n  {\n    bz_stream*  bzstream = &zip->bzstream;\n    FT_Error    error    = FT_Err_Ok;\n\n\n    zip->stream = stream;\n    zip->source = source;\n    zip->memory = stream->memory;\n\n    zip->limit  = zip->buffer + FT_BZIP2_BUFFER_SIZE;\n    zip->cursor = zip->limit;\n    zip->pos    = 0;\n\n    /* check .bz2 header */\n    {\n      stream = source;\n\n      error = ft_bzip2_check_header( stream );\n      if ( error )\n        goto Exit;\n\n      if ( FT_STREAM_SEEK( 0 ) )\n        goto Exit;\n    }\n\n    /* initialize bzlib */\n    bzstream->bzalloc = (alloc_func)ft_bzip2_alloc;\n    bzstream->bzfree  = (free_func) ft_bzip2_free;\n    bzstream->opaque  = zip->memory;\n\n    bzstream->avail_in = 0;\n    bzstream->next_in  = (char*)zip->buffer;\n\n    if ( BZ2_bzDecompressInit( bzstream, 0, 0 ) != BZ_OK ||\n         bzstream->next_in == NULL                       )\n      error = FT_THROW( Invalid_File_Format );\n\n  Exit:\n    return error;\n  }\n\n\n  static void\n  ft_bzip2_file_done( FT_BZip2File  zip )\n  {\n    bz_stream*  bzstream = &zip->bzstream;\n\n\n    BZ2_bzDecompressEnd( bzstream );\n\n    /* clear the rest */\n    bzstream->bzalloc   = NULL;\n    bzstream->bzfree    = NULL;\n    bzstream->opaque    = NULL;\n    bzstream->next_in   = NULL;\n    bzstream->next_out  = NULL;\n    bzstream->avail_in  = 0;\n    bzstream->avail_out = 0;\n\n    zip->memory = NULL;\n    zip->source = NULL;\n    zip->stream = NULL;\n  }\n\n\n  static FT_Error\n  ft_bzip2_file_reset( FT_BZip2File  zip )\n  {\n    FT_Stream  stream = zip->source;\n    FT_Error   error;\n\n\n    if ( !FT_STREAM_SEEK( 0 ) )\n    {\n      bz_stream*  bzstream = &zip->bzstream;\n\n\n      BZ2_bzDecompressEnd( bzstream );\n\n      bzstream->avail_in  = 0;\n      bzstream->next_in   = (char*)zip->input;\n      bzstream->avail_out = 0;\n      bzstream->next_out  = (char*)zip->buffer;\n\n      zip->limit  = zip->buffer + FT_BZIP2_BUFFER_SIZE;\n      zip->cursor = zip->limit;\n      zip->pos    = 0;\n\n      BZ2_bzDecompressInit( bzstream, 0, 0 );\n    }\n\n    return error;\n  }\n\n\n  static FT_Error\n  ft_bzip2_file_fill_input( FT_BZip2File  zip )\n  {\n    bz_stream*  bzstream = &zip->bzstream;\n    FT_Stream   stream    = zip->source;\n    FT_ULong    size;\n\n\n    if ( stream->read )\n    {\n      size = stream->read( stream, stream->pos, zip->input,\n                           FT_BZIP2_BUFFER_SIZE );\n      if ( size == 0 )\n        return FT_THROW( Invalid_Stream_Operation );\n    }\n    else\n    {\n      size = stream->size - stream->pos;\n      if ( size > FT_BZIP2_BUFFER_SIZE )\n        size = FT_BZIP2_BUFFER_SIZE;\n\n      if ( size == 0 )\n        return FT_THROW( Invalid_Stream_Operation );\n\n      FT_MEM_COPY( zip->input, stream->base + stream->pos, size );\n    }\n    stream->pos += size;\n\n    bzstream->next_in  = (char*)zip->input;\n    bzstream->avail_in = size;\n\n    return FT_Err_Ok;\n  }\n\n\n  static FT_Error\n  ft_bzip2_file_fill_output( FT_BZip2File  zip )\n  {\n    bz_stream*  bzstream = &zip->bzstream;\n    FT_Error    error    = FT_Err_Ok;\n\n\n    zip->cursor         = zip->buffer;\n    bzstream->next_out  = (char*)zip->cursor;\n    bzstream->avail_out = FT_BZIP2_BUFFER_SIZE;\n\n    while ( bzstream->avail_out > 0 )\n    {\n      int  err;\n\n\n      if ( bzstream->avail_in == 0 )\n      {\n        error = ft_bzip2_file_fill_input( zip );\n        if ( error )\n          break;\n      }\n\n      err = BZ2_bzDecompress( bzstream );\n\n      if ( err == BZ_STREAM_END )\n      {\n        zip->limit = (FT_Byte*)bzstream->next_out;\n        if ( zip->limit == zip->cursor )\n          error = FT_THROW( Invalid_Stream_Operation );\n        break;\n      }\n      else if ( err != BZ_OK )\n      {\n        error = FT_THROW( Invalid_Stream_Operation );\n        break;\n      }\n    }\n\n    return error;\n  }\n\n\n  /* fill output buffer; `count' must be <= FT_BZIP2_BUFFER_SIZE */\n  static FT_Error\n  ft_bzip2_file_skip_output( FT_BZip2File  zip,\n                             FT_ULong      count )\n  {\n    FT_Error  error = FT_Err_Ok;\n    FT_ULong  delta;\n\n\n    for (;;)\n    {\n      delta = (FT_ULong)( zip->limit - zip->cursor );\n      if ( delta >= count )\n        delta = count;\n\n      zip->cursor += delta;\n      zip->pos    += delta;\n\n      count -= delta;\n      if ( count == 0 )\n        break;\n\n      error = ft_bzip2_file_fill_output( zip );\n      if ( error )\n        break;\n    }\n\n    return error;\n  }\n\n\n  static FT_ULong\n  ft_bzip2_file_io( FT_BZip2File  zip,\n                    FT_ULong      pos,\n                    FT_Byte*      buffer,\n                    FT_ULong      count )\n  {\n    FT_ULong  result = 0;\n    FT_Error  error;\n\n\n    /* Reset inflate stream if we're seeking backwards.        */\n    /* Yes, that is not too efficient, but it saves memory :-) */\n    if ( pos < zip->pos )\n    {\n      error = ft_bzip2_file_reset( zip );\n      if ( error )\n        goto Exit;\n    }\n\n    /* skip unwanted bytes */\n    if ( pos > zip->pos )\n    {\n      error = ft_bzip2_file_skip_output( zip, (FT_ULong)( pos - zip->pos ) );\n      if ( error )\n        goto Exit;\n    }\n\n    if ( count == 0 )\n      goto Exit;\n\n    /* now read the data */\n    for (;;)\n    {\n      FT_ULong  delta;\n\n\n      delta = (FT_ULong)( zip->limit - zip->cursor );\n      if ( delta >= count )\n        delta = count;\n\n      FT_MEM_COPY( buffer, zip->cursor, delta );\n      buffer      += delta;\n      result      += delta;\n      zip->cursor += delta;\n      zip->pos    += delta;\n\n      count -= delta;\n      if ( count == 0 )\n        break;\n\n      error = ft_bzip2_file_fill_output( zip );\n      if ( error )\n        break;\n    }\n\n  Exit:\n    return result;\n  }\n\n\n/***************************************************************************/\n/***************************************************************************/\n/*****                                                                 *****/\n/*****               B Z   E M B E D D I N G   S T R E A M             *****/\n/*****                                                                 *****/\n/***************************************************************************/\n/***************************************************************************/\n\n  static void\n  ft_bzip2_stream_close( FT_Stream  stream )\n  {\n    FT_BZip2File  zip    = (FT_BZip2File)stream->descriptor.pointer;\n    FT_Memory     memory = stream->memory;\n\n\n    if ( zip )\n    {\n      /* finalize bzip file descriptor */\n      ft_bzip2_file_done( zip );\n\n      FT_FREE( zip );\n\n      stream->descriptor.pointer = NULL;\n    }\n  }\n\n\n  static FT_ULong\n  ft_bzip2_stream_io( FT_Stream  stream,\n                      FT_ULong   pos,\n                      FT_Byte*   buffer,\n                      FT_ULong   count )\n  {\n    FT_BZip2File  zip = (FT_BZip2File)stream->descriptor.pointer;\n\n\n    return ft_bzip2_file_io( zip, pos, buffer, count );\n  }\n\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Stream_OpenBzip2( FT_Stream  stream,\n                       FT_Stream  source )\n  {\n    FT_Error      error;\n    FT_Memory     memory;\n    FT_BZip2File  zip = NULL;\n\n\n    if ( !stream || !source )\n    {\n      error = FT_THROW( Invalid_Stream_Handle );\n      goto Exit;\n    }\n\n    memory = source->memory;\n\n    /*\n     *  check the header right now; this prevents allocating unnecessary\n     *  objects when we don't need them\n     */\n    error = ft_bzip2_check_header( source );\n    if ( error )\n      goto Exit;\n\n    FT_ZERO( stream );\n    stream->memory = memory;\n\n    if ( !FT_QNEW( zip ) )\n    {\n      error = ft_bzip2_file_init( zip, stream, source );\n      if ( error )\n      {\n        FT_FREE( zip );\n        goto Exit;\n      }\n\n      stream->descriptor.pointer = zip;\n    }\n\n    stream->size  = 0x7FFFFFFFL;  /* don't know the real size! */\n    stream->pos   = 0;\n    stream->base  = 0;\n    stream->read  = ft_bzip2_stream_io;\n    stream->close = ft_bzip2_stream_close;\n\n  Exit:\n    return error;\n  }\n\n#else  /* !FT_CONFIG_OPTION_USE_BZIP2 */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Stream_OpenBzip2( FT_Stream  stream,\n                       FT_Stream  source )\n  {\n    FT_UNUSED( stream );\n    FT_UNUSED( source );\n\n    return FT_THROW( Unimplemented_Feature );\n  }\n\n#endif /* !FT_CONFIG_OPTION_USE_BZIP2 */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/bzip2/rules.mk",
    "content": "#\n# FreeType 2 BZIP2 support configuration rules\n#\n\n# Copyright 2010 by\n# Joel Klinghed.\n#\n# Based on src/lzw/rules.mk, Copyright 2004-2006 by\n# Albert Chin-A-Young.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\n# BZIP2 driver directory\n#\nBZIP2_DIR := $(SRC_DIR)/bzip2\n\n\n# compilation flags for the driver\n#\nBZIP2_COMPILE := $(FT_COMPILE)\n\n\n# BZIP2 support sources (i.e., C files)\n#\nBZIP2_DRV_SRC := $(BZIP2_DIR)/ftbzip2.c\n\n# BZIP2 driver object(s)\n#\n#   BZIP2_DRV_OBJ_M is used during `multi' builds\n#   BZIP2_DRV_OBJ_S is used during `single' builds\n#\nBZIP2_DRV_OBJ_M := $(OBJ_DIR)/ftbzip2.$O\nBZIP2_DRV_OBJ_S := $(OBJ_DIR)/ftbzip2.$O\n\n# BZIP2 support source file for single build\n#\nBZIP2_DRV_SRC_S := $(BZIP2_DIR)/ftbzip2.c\n\n\n# BZIP2 support - single object\n#\n$(BZIP2_DRV_OBJ_S): $(BZIP2_DRV_SRC_S) $(BZIP2_DRV_SRC) $(FREETYPE_H) $(BZIP2_DRV_H)\n\t$(BZIP2_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(BZIP2_DRV_SRC_S))\n\n\n# BZIP2 support - multiple objects\n#\n$(OBJ_DIR)/%.$O: $(BZIP2_DIR)/%.c $(FREETYPE_H) $(BZIP2_DRV_H)\n\t$(BZIP2_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\n\n\n# update main driver object lists\n#\nDRV_OBJS_S += $(BZIP2_DRV_OBJ_S)\nDRV_OBJS_M += $(BZIP2_DRV_OBJ_M)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/cache/Jamfile",
    "content": "# FreeType 2 src/cache Jamfile\n#\n# Copyright 2001, 2003, 2004, 2013 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) cache ;\n\n# The file <ftcache.h> contains some macro definitions that are\n# later used in #include statements related to the cache sub-system.  It\n# needs to be parsed through a HDRMACRO rule for macro definitions.\n#\nHDRMACRO  [ FT2_SubDir  include ftcache.h ] ;\n\n{\n  local  _sources ;\n\n  if $(FT2_MULTI)\n  {\n    _sources = ftcmru\n               ftcmanag\n               ftccache\n               ftcglyph\n               ftcsbits\n               ftcimage\n               ftcbasic\n               ftccmap\n               ;\n  }\n  else\n  {\n    _sources = ftcache ;\n  }\n\n  Library  $(FT2_LIB) : $(_sources).c ;\n}\n\n# end of src/cache Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/cache/ftcache.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcache.c                                                              */\n/*                                                                         */\n/*    The FreeType Caching sub-system (body only).                         */\n/*                                                                         */\n/*  Copyright 2000-2001, 2003 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#define FT_MAKE_OPTION_SINGLE_OBJECT\n\n#include <ft2build.h>\n#include \"ftcmru.c\"\n#include \"ftcmanag.c\"\n#include \"ftccache.c\"\n#include \"ftccmap.c\"\n#include \"ftcglyph.c\"\n#include \"ftcimage.c\"\n#include \"ftcsbits.c\"\n#include \"ftcbasic.c\"\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cache/ftcbasic.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcbasic.c                                                             */\n/*                                                                         */\n/*    The FreeType basic cache interface (body).                           */\n/*                                                                         */\n/*  Copyright 2003-2007, 2009-2011, 2013, 2014 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_CACHE_H\n#include \"ftcglyph.h\"\n#include \"ftcimage.h\"\n#include \"ftcsbits.h\"\n\n#include \"ftccback.h\"\n#include \"ftcerror.h\"\n\n#define FT_COMPONENT  trace_cache\n\n\n  /*\n   *  Basic Families\n   *\n   */\n  typedef struct  FTC_BasicAttrRec_\n  {\n    FTC_ScalerRec  scaler;\n    FT_UInt        load_flags;\n\n  } FTC_BasicAttrRec, *FTC_BasicAttrs;\n\n#define FTC_BASIC_ATTR_COMPARE( a, b )                                 \\\n          FT_BOOL( FTC_SCALER_COMPARE( &(a)->scaler, &(b)->scaler ) && \\\n                   (a)->load_flags == (b)->load_flags               )\n\n#define FTC_BASIC_ATTR_HASH( a )                                   \\\n          ( FTC_SCALER_HASH( &(a)->scaler ) + 31*(a)->load_flags )\n\n\n  typedef struct  FTC_BasicQueryRec_\n  {\n    FTC_GQueryRec     gquery;\n    FTC_BasicAttrRec  attrs;\n\n  } FTC_BasicQueryRec, *FTC_BasicQuery;\n\n\n  typedef struct  FTC_BasicFamilyRec_\n  {\n    FTC_FamilyRec     family;\n    FTC_BasicAttrRec  attrs;\n\n  } FTC_BasicFamilyRec, *FTC_BasicFamily;\n\n\n  FT_CALLBACK_DEF( FT_Bool )\n  ftc_basic_family_compare( FTC_MruNode  ftcfamily,\n                            FT_Pointer   ftcquery )\n  {\n    FTC_BasicFamily  family = (FTC_BasicFamily)ftcfamily;\n    FTC_BasicQuery   query  = (FTC_BasicQuery)ftcquery;\n\n\n    return FTC_BASIC_ATTR_COMPARE( &family->attrs, &query->attrs );\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  ftc_basic_family_init( FTC_MruNode  ftcfamily,\n                         FT_Pointer   ftcquery,\n                         FT_Pointer   ftccache )\n  {\n    FTC_BasicFamily  family = (FTC_BasicFamily)ftcfamily;\n    FTC_BasicQuery   query  = (FTC_BasicQuery)ftcquery;\n    FTC_Cache        cache  = (FTC_Cache)ftccache;\n\n\n    FTC_Family_Init( FTC_FAMILY( family ), cache );\n    family->attrs = query->attrs;\n    return 0;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt )\n  ftc_basic_family_get_count( FTC_Family   ftcfamily,\n                              FTC_Manager  manager )\n  {\n    FTC_BasicFamily  family = (FTC_BasicFamily)ftcfamily;\n    FT_Error         error;\n    FT_Face          face;\n    FT_UInt          result = 0;\n\n\n    error = FTC_Manager_LookupFace( manager, family->attrs.scaler.face_id,\n                                    &face );\n\n    if ( error || !face )\n      return result;\n\n    if ( (FT_ULong)face->num_glyphs > FT_UINT_MAX || 0 > face->num_glyphs )\n      FT_TRACE1(( \"ftc_basic_family_get_count:\"\n                  \" too large number of glyphs in this face, truncated\\n\",\n                  face->num_glyphs ));\n\n    if ( !error )\n      result = (FT_UInt)face->num_glyphs;\n\n    return result;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  ftc_basic_family_load_bitmap( FTC_Family   ftcfamily,\n                                FT_UInt      gindex,\n                                FTC_Manager  manager,\n                                FT_Face     *aface )\n  {\n    FTC_BasicFamily  family = (FTC_BasicFamily)ftcfamily;\n    FT_Error         error;\n    FT_Size          size;\n\n\n    error = FTC_Manager_LookupSize( manager, &family->attrs.scaler, &size );\n    if ( !error )\n    {\n      FT_Face  face = size->face;\n\n\n      error = FT_Load_Glyph( face, gindex,\n                             family->attrs.load_flags | FT_LOAD_RENDER );\n      if ( !error )\n        *aface = face;\n    }\n\n    return error;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  ftc_basic_family_load_glyph( FTC_Family  ftcfamily,\n                               FT_UInt     gindex,\n                               FTC_Cache   cache,\n                               FT_Glyph   *aglyph )\n  {\n    FTC_BasicFamily  family = (FTC_BasicFamily)ftcfamily;\n    FT_Error         error;\n    FTC_Scaler       scaler = &family->attrs.scaler;\n    FT_Face          face;\n    FT_Size          size;\n\n\n    /* we will now load the glyph image */\n    error = FTC_Manager_LookupSize( cache->manager,\n                                    scaler,\n                                    &size );\n    if ( !error )\n    {\n      face = size->face;\n\n      error = FT_Load_Glyph( face, gindex, family->attrs.load_flags );\n      if ( !error )\n      {\n        if ( face->glyph->format == FT_GLYPH_FORMAT_BITMAP  ||\n             face->glyph->format == FT_GLYPH_FORMAT_OUTLINE )\n        {\n          /* ok, copy it */\n          FT_Glyph  glyph;\n\n\n          error = FT_Get_Glyph( face->glyph, &glyph );\n          if ( !error )\n          {\n            *aglyph = glyph;\n            goto Exit;\n          }\n        }\n        else\n          error = FT_THROW( Invalid_Argument );\n      }\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Bool )\n  ftc_basic_gnode_compare_faceid( FTC_Node    ftcgnode,\n                                  FT_Pointer  ftcface_id,\n                                  FTC_Cache   cache,\n                                  FT_Bool*    list_changed )\n  {\n    FTC_GNode        gnode   = (FTC_GNode)ftcgnode;\n    FTC_FaceID       face_id = (FTC_FaceID)ftcface_id;\n    FTC_BasicFamily  family  = (FTC_BasicFamily)gnode->family;\n    FT_Bool          result;\n\n\n    if ( list_changed )\n      *list_changed = FALSE;\n    result = FT_BOOL( family->attrs.scaler.face_id == face_id );\n    if ( result )\n    {\n      /* we must call this function to avoid this node from appearing\n       * in later lookups with the same face_id!\n       */\n      FTC_GNode_UnselectFamily( gnode, cache );\n    }\n    return result;\n  }\n\n\n /*\n  *\n  * basic image cache\n  *\n  */\n\n  static\n  const FTC_IFamilyClassRec  ftc_basic_image_family_class =\n  {\n    {\n      sizeof ( FTC_BasicFamilyRec ),\n      ftc_basic_family_compare,\n      ftc_basic_family_init,\n      0,                        /* FTC_MruNode_ResetFunc */\n      0                         /* FTC_MruNode_DoneFunc  */\n    },\n    ftc_basic_family_load_glyph\n  };\n\n\n  static\n  const FTC_GCacheClassRec  ftc_basic_image_cache_class =\n  {\n    {\n      ftc_inode_new,\n      ftc_inode_weight,\n      ftc_gnode_compare,\n      ftc_basic_gnode_compare_faceid,\n      ftc_inode_free,\n\n      sizeof ( FTC_GCacheRec ),\n      ftc_gcache_init,\n      ftc_gcache_done\n    },\n    (FTC_MruListClass)&ftc_basic_image_family_class\n  };\n\n\n  /* documentation is in ftcache.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FTC_ImageCache_New( FTC_Manager      manager,\n                      FTC_ImageCache  *acache )\n  {\n    return FTC_GCache_New( manager, &ftc_basic_image_cache_class,\n                           (FTC_GCache*)acache );\n  }\n\n\n  /* documentation is in ftcache.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FTC_ImageCache_Lookup( FTC_ImageCache  cache,\n                         FTC_ImageType   type,\n                         FT_UInt         gindex,\n                         FT_Glyph       *aglyph,\n                         FTC_Node       *anode )\n  {\n    FTC_BasicQueryRec  query;\n    FTC_Node           node = 0; /* make compiler happy */\n    FT_Error           error;\n    FT_PtrDist         hash;\n\n\n    /* some argument checks are delayed to `FTC_Cache_Lookup' */\n    if ( !aglyph )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    *aglyph = NULL;\n    if ( anode )\n      *anode  = NULL;\n\n    if ( (FT_ULong)( type->flags - FT_INT_MIN ) > FT_UINT_MAX )\n      FT_TRACE1(( \"FTC_ImageCache_Lookup:\"\n                  \" higher bits in load_flags 0x%x are dropped\\n\",\n                  type->flags & ~((FT_ULong)FT_UINT_MAX) ));\n\n    query.attrs.scaler.face_id = type->face_id;\n    query.attrs.scaler.width   = type->width;\n    query.attrs.scaler.height  = type->height;\n    query.attrs.load_flags     = (FT_UInt)type->flags;\n\n    query.attrs.scaler.pixel = 1;\n    query.attrs.scaler.x_res = 0;  /* make compilers happy */\n    query.attrs.scaler.y_res = 0;\n\n    hash = FTC_BASIC_ATTR_HASH( &query.attrs ) + gindex;\n\n#if 1  /* inlining is about 50% faster! */\n    FTC_GCACHE_LOOKUP_CMP( cache,\n                           ftc_basic_family_compare,\n                           FTC_GNode_Compare,\n                           hash, gindex,\n                           &query,\n                           node,\n                           error );\n#else\n    error = FTC_GCache_Lookup( FTC_GCACHE( cache ),\n                               hash, gindex,\n                               FTC_GQUERY( &query ),\n                               &node );\n#endif\n    if ( !error )\n    {\n      *aglyph = FTC_INODE( node )->glyph;\n\n      if ( anode )\n      {\n        *anode = node;\n        node->ref_count++;\n      }\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /* documentation is in ftcache.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FTC_ImageCache_LookupScaler( FTC_ImageCache  cache,\n                               FTC_Scaler      scaler,\n                               FT_ULong        load_flags,\n                               FT_UInt         gindex,\n                               FT_Glyph       *aglyph,\n                               FTC_Node       *anode )\n  {\n    FTC_BasicQueryRec  query;\n    FTC_Node           node = 0; /* make compiler happy */\n    FT_Error           error;\n    FT_PtrDist         hash;\n\n\n    /* some argument checks are delayed to `FTC_Cache_Lookup' */\n    if ( !aglyph || !scaler )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    *aglyph = NULL;\n    if ( anode )\n      *anode  = NULL;\n\n    /* `FT_Load_Glyph' and `FT_Load_Char' take FT_UInt flags */\n    if ( load_flags > FT_UINT_MAX )\n      FT_TRACE1(( \"FTC_ImageCache_LookupScaler:\"\n                  \" higher bits in load_flags 0x%x are dropped\\n\",\n                  load_flags & ~((FT_ULong)FT_UINT_MAX) ));\n\n    query.attrs.scaler     = scaler[0];\n    query.attrs.load_flags = (FT_UInt)load_flags;\n\n    hash = FTC_BASIC_ATTR_HASH( &query.attrs ) + gindex;\n\n    FTC_GCACHE_LOOKUP_CMP( cache,\n                           ftc_basic_family_compare,\n                           FTC_GNode_Compare,\n                           hash, gindex,\n                           &query,\n                           node,\n                           error );\n    if ( !error )\n    {\n      *aglyph = FTC_INODE( node )->glyph;\n\n      if ( anode )\n      {\n        *anode = node;\n        node->ref_count++;\n      }\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /*\n   *\n   * basic small bitmap cache\n   *\n   */\n\n  static\n  const FTC_SFamilyClassRec  ftc_basic_sbit_family_class =\n  {\n    {\n      sizeof ( FTC_BasicFamilyRec ),\n      ftc_basic_family_compare,\n      ftc_basic_family_init,\n      0,                            /* FTC_MruNode_ResetFunc */\n      0                             /* FTC_MruNode_DoneFunc  */\n    },\n    ftc_basic_family_get_count,\n    ftc_basic_family_load_bitmap\n  };\n\n\n  static\n  const FTC_GCacheClassRec  ftc_basic_sbit_cache_class =\n  {\n    {\n      ftc_snode_new,\n      ftc_snode_weight,\n      ftc_snode_compare,\n      ftc_basic_gnode_compare_faceid,\n      ftc_snode_free,\n\n      sizeof ( FTC_GCacheRec ),\n      ftc_gcache_init,\n      ftc_gcache_done\n    },\n    (FTC_MruListClass)&ftc_basic_sbit_family_class\n  };\n\n\n  /* documentation is in ftcache.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FTC_SBitCache_New( FTC_Manager     manager,\n                     FTC_SBitCache  *acache )\n  {\n    return FTC_GCache_New( manager, &ftc_basic_sbit_cache_class,\n                           (FTC_GCache*)acache );\n  }\n\n\n  /* documentation is in ftcache.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FTC_SBitCache_Lookup( FTC_SBitCache  cache,\n                        FTC_ImageType  type,\n                        FT_UInt        gindex,\n                        FTC_SBit      *ansbit,\n                        FTC_Node      *anode )\n  {\n    FT_Error           error;\n    FTC_BasicQueryRec  query;\n    FTC_Node           node = 0; /* make compiler happy */\n    FT_PtrDist         hash;\n\n\n    if ( anode )\n      *anode = NULL;\n\n    /* other argument checks delayed to `FTC_Cache_Lookup' */\n    if ( !ansbit )\n      return FT_THROW( Invalid_Argument );\n\n    *ansbit = NULL;\n\n    if ( (FT_ULong)( type->flags - FT_INT_MIN ) > FT_UINT_MAX )\n      FT_TRACE1(( \"FTC_ImageCache_Lookup:\"\n                  \" higher bits in load_flags 0x%x are dropped\\n\",\n                  type->flags & ~((FT_ULong)FT_UINT_MAX) ));\n\n    query.attrs.scaler.face_id = type->face_id;\n    query.attrs.scaler.width   = type->width;\n    query.attrs.scaler.height  = type->height;\n    query.attrs.load_flags     = (FT_UInt)type->flags;\n\n    query.attrs.scaler.pixel = 1;\n    query.attrs.scaler.x_res = 0;  /* make compilers happy */\n    query.attrs.scaler.y_res = 0;\n\n    /* beware, the hash must be the same for all glyph ranges! */\n    hash = FTC_BASIC_ATTR_HASH( &query.attrs ) +\n           gindex / FTC_SBIT_ITEMS_PER_NODE;\n\n#if 1  /* inlining is about 50% faster! */\n    FTC_GCACHE_LOOKUP_CMP( cache,\n                           ftc_basic_family_compare,\n                           FTC_SNode_Compare,\n                           hash, gindex,\n                           &query,\n                           node,\n                           error );\n#else\n    error = FTC_GCache_Lookup( FTC_GCACHE( cache ),\n                               hash,\n                               gindex,\n                               FTC_GQUERY( &query ),\n                               &node );\n#endif\n    if ( error )\n      goto Exit;\n\n    *ansbit = FTC_SNODE( node )->sbits +\n              ( gindex - FTC_GNODE( node )->gindex );\n\n    if ( anode )\n    {\n      *anode = node;\n      node->ref_count++;\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /* documentation is in ftcache.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FTC_SBitCache_LookupScaler( FTC_SBitCache  cache,\n                              FTC_Scaler     scaler,\n                              FT_ULong       load_flags,\n                              FT_UInt        gindex,\n                              FTC_SBit      *ansbit,\n                              FTC_Node      *anode )\n  {\n    FT_Error           error;\n    FTC_BasicQueryRec  query;\n    FTC_Node           node = 0; /* make compiler happy */\n    FT_PtrDist         hash;\n\n\n    if ( anode )\n        *anode = NULL;\n\n    /* other argument checks delayed to `FTC_Cache_Lookup' */\n    if ( !ansbit || !scaler )\n        return FT_THROW( Invalid_Argument );\n\n    *ansbit = NULL;\n\n    /* `FT_Load_Glyph' and `FT_Load_Char' take FT_UInt flags */\n    if ( load_flags > FT_UINT_MAX )\n      FT_TRACE1(( \"FTC_ImageCache_LookupScaler:\"\n                  \" higher bits in load_flags 0x%x are dropped\\n\",\n                  load_flags & ~((FT_ULong)FT_UINT_MAX) ));\n\n    query.attrs.scaler     = scaler[0];\n    query.attrs.load_flags = (FT_UInt)load_flags;\n\n    /* beware, the hash must be the same for all glyph ranges! */\n    hash = FTC_BASIC_ATTR_HASH( &query.attrs ) +\n             gindex / FTC_SBIT_ITEMS_PER_NODE;\n\n    FTC_GCACHE_LOOKUP_CMP( cache,\n                           ftc_basic_family_compare,\n                           FTC_SNode_Compare,\n                           hash, gindex,\n                           &query,\n                           node,\n                           error );\n    if ( error )\n      goto Exit;\n\n    *ansbit = FTC_SNODE( node )->sbits +\n              ( gindex - FTC_GNODE( node )->gindex );\n\n    if ( anode )\n    {\n      *anode = node;\n      node->ref_count++;\n    }\n\n  Exit:\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cache/ftccache.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftccache.c                                                             */\n/*                                                                         */\n/*    The FreeType internal cache interface (body).                        */\n/*                                                                         */\n/*  Copyright 2000-2007, 2009-2011, 2013 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include \"ftcmanag.h\"\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_DEBUG_H\n\n#include \"ftccback.h\"\n#include \"ftcerror.h\"\n\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_cache\n\n\n#define FTC_HASH_MAX_LOAD  2\n#define FTC_HASH_MIN_LOAD  1\n#define FTC_HASH_SUB_LOAD  ( FTC_HASH_MAX_LOAD - FTC_HASH_MIN_LOAD )\n\n  /* this one _must_ be a power of 2! */\n#define FTC_HASH_INITIAL_SIZE  8\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                   CACHE NODE DEFINITIONS                      *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* add a new node to the head of the manager's circular MRU list */\n  static void\n  ftc_node_mru_link( FTC_Node     node,\n                     FTC_Manager  manager )\n  {\n    void  *nl = &manager->nodes_list;\n\n\n    FTC_MruNode_Prepend( (FTC_MruNode*)nl,\n                         (FTC_MruNode)node );\n    manager->num_nodes++;\n  }\n\n\n  /* remove a node from the manager's MRU list */\n  static void\n  ftc_node_mru_unlink( FTC_Node     node,\n                       FTC_Manager  manager )\n  {\n    void  *nl = &manager->nodes_list;\n\n\n    FTC_MruNode_Remove( (FTC_MruNode*)nl,\n                        (FTC_MruNode)node );\n    manager->num_nodes--;\n  }\n\n\n#ifndef FTC_INLINE\n\n  /* move a node to the head of the manager's MRU list */\n  static void\n  ftc_node_mru_up( FTC_Node     node,\n                   FTC_Manager  manager )\n  {\n    FTC_MruNode_Up( (FTC_MruNode*)&manager->nodes_list,\n                    (FTC_MruNode)node );\n  }\n\n\n  /* get a top bucket for specified hash from cache,\n   * body for FTC_NODE__TOP_FOR_HASH( cache, hash )\n   */\n  FT_LOCAL_DEF( FTC_Node* )\n  ftc_get_top_node_for_hash( FTC_Cache   cache,\n                             FT_PtrDist  hash )\n  {\n    FTC_Node*  pnode;\n    FT_UInt    idx;\n\n\n    idx = (FT_UInt)( hash & cache->mask );\n    if ( idx < cache->p )\n      idx = (FT_UInt)( hash & ( 2 * cache->mask + 1 ) );\n    pnode = cache->buckets + idx;\n    return pnode;\n  }\n\n#endif /* !FTC_INLINE */\n\n\n  /* Note that this function cannot fail.  If we cannot re-size the\n   * buckets array appropriately, we simply degrade the hash table's\n   * performance!\n   */\n  static void\n  ftc_cache_resize( FTC_Cache  cache )\n  {\n    for (;;)\n    {\n      FTC_Node  node, *pnode;\n      FT_UFast  p     = cache->p;\n      FT_UFast  mask  = cache->mask;\n      FT_UFast  count = mask + p + 1;    /* number of buckets */\n\n\n      /* do we need to shrink the buckets array? */\n      if ( cache->slack < 0 )\n      {\n        FTC_Node  new_list = NULL;\n\n\n        /* try to expand the buckets array _before_ splitting\n         * the bucket lists\n         */\n        if ( p >= mask )\n        {\n          FT_Memory  memory = cache->memory;\n          FT_Error   error;\n\n\n          /* if we can't expand the array, leave immediately */\n          if ( FT_RENEW_ARRAY( cache->buckets,\n                               ( mask + 1 ) * 2, ( mask + 1 ) * 4 ) )\n            break;\n        }\n\n        /* split a single bucket */\n        pnode = cache->buckets + p;\n\n        for (;;)\n        {\n          node = *pnode;\n          if ( node == NULL )\n            break;\n\n          if ( node->hash & ( mask + 1 ) )\n          {\n            *pnode     = node->link;\n            node->link = new_list;\n            new_list   = node;\n          }\n          else\n            pnode = &node->link;\n        }\n\n        cache->buckets[p + mask + 1] = new_list;\n\n        cache->slack += FTC_HASH_MAX_LOAD;\n\n        if ( p >= mask )\n        {\n          cache->mask = 2 * mask + 1;\n          cache->p    = 0;\n        }\n        else\n          cache->p = p + 1;\n      }\n\n      /* do we need to expand the buckets array? */\n      else if ( cache->slack > (FT_Long)count * FTC_HASH_SUB_LOAD )\n      {\n        FT_UFast   old_index = p + mask;\n        FTC_Node*  pold;\n\n\n        if ( old_index + 1 <= FTC_HASH_INITIAL_SIZE )\n          break;\n\n        if ( p == 0 )\n        {\n          FT_Memory  memory = cache->memory;\n          FT_Error   error;\n\n\n          /* if we can't shrink the array, leave immediately */\n          if ( FT_RENEW_ARRAY( cache->buckets,\n                               ( mask + 1 ) * 2, mask + 1 ) )\n            break;\n\n          cache->mask >>= 1;\n          p             = cache->mask;\n        }\n        else\n          p--;\n\n        pnode = cache->buckets + p;\n        while ( *pnode )\n          pnode = &(*pnode)->link;\n\n        pold   = cache->buckets + old_index;\n        *pnode = *pold;\n        *pold  = NULL;\n\n        cache->slack -= FTC_HASH_MAX_LOAD;\n        cache->p      = p;\n      }\n\n      /* otherwise, the hash table is balanced */\n      else\n        break;\n    }\n  }\n\n\n  /* remove a node from its cache's hash table */\n  static void\n  ftc_node_hash_unlink( FTC_Node   node0,\n                        FTC_Cache  cache )\n  {\n    FTC_Node  *pnode = FTC_NODE__TOP_FOR_HASH( cache, node0->hash );\n\n\n    for (;;)\n    {\n      FTC_Node  node = *pnode;\n\n\n      if ( node == NULL )\n      {\n        FT_TRACE0(( \"ftc_node_hash_unlink: unknown node\\n\" ));\n        return;\n      }\n\n      if ( node == node0 )\n        break;\n\n      pnode = &(*pnode)->link;\n    }\n\n    *pnode      = node0->link;\n    node0->link = NULL;\n\n    cache->slack++;\n    ftc_cache_resize( cache );\n  }\n\n\n  /* add a node to the `top' of its cache's hash table */\n  static void\n  ftc_node_hash_link( FTC_Node   node,\n                      FTC_Cache  cache )\n  {\n    FTC_Node  *pnode = FTC_NODE__TOP_FOR_HASH( cache, node->hash );\n\n\n    node->link = *pnode;\n    *pnode     = node;\n\n    cache->slack--;\n    ftc_cache_resize( cache );\n  }\n\n\n  /* remove a node from the cache manager */\n  FT_LOCAL_DEF( void )\n  ftc_node_destroy( FTC_Node     node,\n                    FTC_Manager  manager )\n  {\n    FTC_Cache  cache;\n\n\n#ifdef FT_DEBUG_ERROR\n    /* find node's cache */\n    if ( node->cache_index >= manager->num_caches )\n    {\n      FT_TRACE0(( \"ftc_node_destroy: invalid node handle\\n\" ));\n      return;\n    }\n#endif\n\n    cache = manager->caches[node->cache_index];\n\n#ifdef FT_DEBUG_ERROR\n    if ( cache == NULL )\n    {\n      FT_TRACE0(( \"ftc_node_destroy: invalid node handle\\n\" ));\n      return;\n    }\n#endif\n\n    manager->cur_weight -= cache->clazz.node_weight( node, cache );\n\n    /* remove node from mru list */\n    ftc_node_mru_unlink( node, manager );\n\n    /* remove node from cache's hash table */\n    ftc_node_hash_unlink( node, cache );\n\n    /* now finalize it */\n    cache->clazz.node_free( node, cache );\n\n#if 0\n    /* check, just in case of general corruption :-) */\n    if ( manager->num_nodes == 0 )\n      FT_TRACE0(( \"ftc_node_destroy: invalid cache node count (%d)\\n\",\n                  manager->num_nodes ));\n#endif\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    ABSTRACT CACHE CLASS                       *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  FT_LOCAL_DEF( FT_Error )\n  FTC_Cache_Init( FTC_Cache  cache )\n  {\n    return ftc_cache_init( cache );\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  ftc_cache_init( FTC_Cache  cache )\n  {\n    FT_Memory  memory = cache->memory;\n    FT_Error   error;\n\n\n    cache->p     = 0;\n    cache->mask  = FTC_HASH_INITIAL_SIZE - 1;\n    cache->slack = FTC_HASH_INITIAL_SIZE * FTC_HASH_MAX_LOAD;\n\n    (void)FT_NEW_ARRAY( cache->buckets, FTC_HASH_INITIAL_SIZE * 2 );\n    return error;\n  }\n\n\n  static void\n  FTC_Cache_Clear( FTC_Cache  cache )\n  {\n    if ( cache && cache->buckets )\n    {\n      FTC_Manager  manager = cache->manager;\n      FT_UFast     i;\n      FT_UFast     count;\n\n\n      count = cache->p + cache->mask + 1;\n\n      for ( i = 0; i < count; i++ )\n      {\n        FTC_Node  *pnode = cache->buckets + i, next, node = *pnode;\n\n\n        while ( node )\n        {\n          next        = node->link;\n          node->link  = NULL;\n\n          /* remove node from mru list */\n          ftc_node_mru_unlink( node, manager );\n\n          /* now finalize it */\n          manager->cur_weight -= cache->clazz.node_weight( node, cache );\n\n          cache->clazz.node_free( node, cache );\n          node = next;\n        }\n        cache->buckets[i] = NULL;\n      }\n      ftc_cache_resize( cache );\n    }\n  }\n\n\n  FT_LOCAL_DEF( void )\n  ftc_cache_done( FTC_Cache  cache )\n  {\n    if ( cache->memory )\n    {\n      FT_Memory  memory = cache->memory;\n\n\n      FTC_Cache_Clear( cache );\n\n      FT_FREE( cache->buckets );\n      cache->mask  = 0;\n      cache->p     = 0;\n      cache->slack = 0;\n\n      cache->memory = NULL;\n    }\n  }\n\n\n  FT_LOCAL_DEF( void )\n  FTC_Cache_Done( FTC_Cache  cache )\n  {\n    ftc_cache_done( cache );\n  }\n\n\n  static void\n  ftc_cache_add( FTC_Cache  cache,\n                 FT_PtrDist hash,\n                 FTC_Node   node )\n  {\n    node->hash        = hash;\n    node->cache_index = (FT_UInt16)cache->index;\n    node->ref_count   = 0;\n\n    ftc_node_hash_link( node, cache );\n    ftc_node_mru_link( node, cache->manager );\n\n    {\n      FTC_Manager  manager = cache->manager;\n\n\n      manager->cur_weight += cache->clazz.node_weight( node, cache );\n\n      if ( manager->cur_weight >= manager->max_weight )\n      {\n        node->ref_count++;\n        FTC_Manager_Compress( manager );\n        node->ref_count--;\n      }\n    }\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  FTC_Cache_NewNode( FTC_Cache   cache,\n                     FT_PtrDist  hash,\n                     FT_Pointer  query,\n                     FTC_Node   *anode )\n  {\n    FT_Error  error;\n    FTC_Node  node;\n\n\n    /*\n     * We use the FTC_CACHE_TRYLOOP macros to support out-of-memory\n     * errors (OOM) correctly, i.e., by flushing the cache progressively\n     * in order to make more room.\n     */\n\n    FTC_CACHE_TRYLOOP( cache )\n    {\n      error = cache->clazz.node_new( &node, query, cache );\n    }\n    FTC_CACHE_TRYLOOP_END( NULL );\n\n    if ( error )\n      node = NULL;\n    else\n    {\n     /* don't assume that the cache has the same number of buckets, since\n      * our allocation request might have triggered global cache flushing\n      */\n      ftc_cache_add( cache, hash, node );\n    }\n\n    *anode = node;\n    return error;\n  }\n\n\n#ifndef FTC_INLINE\n\n  FT_LOCAL_DEF( FT_Error )\n  FTC_Cache_Lookup( FTC_Cache   cache,\n                    FT_PtrDist  hash,\n                    FT_Pointer  query,\n                    FTC_Node   *anode )\n  {\n    FTC_Node*  bucket;\n    FTC_Node*  pnode;\n    FTC_Node   node;\n    FT_Error   error        = FT_Err_Ok;\n    FT_Bool    list_changed = FALSE;\n\n    FTC_Node_CompareFunc  compare = cache->clazz.node_compare;\n\n\n    if ( cache == NULL || anode == NULL )\n      return FT_THROW( Invalid_Argument );\n\n    /* Go to the `top' node of the list sharing same masked hash */\n    bucket = pnode = FTC_NODE__TOP_FOR_HASH( cache, hash );\n\n    /* Lookup a node with exactly same hash and queried properties.  */\n    /* NOTE: _nodcomp() may change the linked list to reduce memory. */\n    for (;;)\n    {\n      node = *pnode;\n      if ( node == NULL )\n        goto NewNode;\n\n      if ( node->hash == hash                           &&\n           compare( node, query, cache, &list_changed ) )\n        break;\n\n      pnode = &node->link;\n    }\n\n    if ( list_changed )\n    {\n      /* Update bucket by modified linked list */\n      bucket = pnode = FTC_NODE__TOP_FOR_HASH( cache, hash );\n\n      /* Update pnode by modified linked list */\n      while ( *pnode != node )\n      {\n        if ( *pnode == NULL )\n        {\n          FT_ERROR(( \"FTC_Cache_Lookup: oops!!!  node missing\\n\" ));\n          goto NewNode;\n        }\n        else\n          pnode = &((*pnode)->link);\n      }\n    }\n\n    /* Reorder the list to move the found node to the `top' */\n    if ( node != *bucket )\n    {\n      *pnode     = node->link;\n      node->link = *bucket;\n      *bucket    = node;\n    }\n\n    /* move to head of MRU list */\n    {\n      FTC_Manager  manager = cache->manager;\n\n\n      if ( node != manager->nodes_list )\n        ftc_node_mru_up( node, manager );\n    }\n    *anode = node;\n\n    return error;\n\n  NewNode:\n    return FTC_Cache_NewNode( cache, hash, query, anode );\n  }\n\n#endif /* !FTC_INLINE */\n\n\n  FT_LOCAL_DEF( void )\n  FTC_Cache_RemoveFaceID( FTC_Cache   cache,\n                          FTC_FaceID  face_id )\n  {\n    FT_UFast     i, count;\n    FTC_Manager  manager = cache->manager;\n    FTC_Node     frees   = NULL;\n\n\n    count = cache->p + cache->mask + 1;\n    for ( i = 0; i < count; i++ )\n    {\n      FTC_Node*  bucket = cache->buckets + i;\n      FTC_Node*  pnode  = bucket;\n\n\n      for ( ;; )\n      {\n        FTC_Node  node = *pnode;\n        FT_Bool   list_changed = FALSE;\n\n\n        if ( node == NULL )\n          break;\n\n        if ( cache->clazz.node_remove_faceid( node, face_id,\n                                              cache, &list_changed ) )\n        {\n          *pnode     = node->link;\n          node->link = frees;\n          frees      = node;\n        }\n        else\n          pnode = &node->link;\n      }\n    }\n\n    /* remove all nodes in the free list */\n    while ( frees )\n    {\n      FTC_Node  node;\n\n\n      node  = frees;\n      frees = node->link;\n\n      manager->cur_weight -= cache->clazz.node_weight( node, cache );\n      ftc_node_mru_unlink( node, manager );\n\n      cache->clazz.node_free( node, cache );\n\n      cache->slack++;\n    }\n\n    ftc_cache_resize( cache );\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cache/ftccache.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftccache.h                                                             */\n/*                                                                         */\n/*    FreeType internal cache interface (specification).                   */\n/*                                                                         */\n/*  Copyright 2000-2007, 2009-2011, 2013 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCCACHE_H__\n#define __FTCCACHE_H__\n\n\n#include \"ftcmru.h\"\n\nFT_BEGIN_HEADER\n\n#define _FTC_FACE_ID_HASH( i )                                                \\\n          ((FT_PtrDist)(( (FT_PtrDist)(i) >> 3 ) ^ ( (FT_PtrDist)(i) << 7 )))\n\n  /* handle to cache object */\n  typedef struct FTC_CacheRec_*  FTC_Cache;\n\n  /* handle to cache class */\n  typedef const struct FTC_CacheClassRec_*  FTC_CacheClass;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                   CACHE NODE DEFINITIONS                      *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Each cache controls one or more cache nodes.  Each node is part of    */\n  /* the global_lru list of the manager.  Its `data' field however is used */\n  /* as a reference count for now.                                         */\n  /*                                                                       */\n  /* A node can be anything, depending on the type of information held by  */\n  /* the cache.  It can be an individual glyph image, a set of bitmaps     */\n  /* glyphs for a given size, some metrics, etc.                           */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /* structure size should be 20 bytes on 32-bits machines */\n  typedef struct  FTC_NodeRec_\n  {\n    FTC_MruNodeRec  mru;          /* circular mru list pointer           */\n    FTC_Node        link;         /* used for hashing                    */\n    FT_PtrDist      hash;         /* used for hashing too                */\n    FT_UShort       cache_index;  /* index of cache the node belongs to  */\n    FT_Short        ref_count;    /* reference count for this node       */\n\n  } FTC_NodeRec;\n\n\n#define FTC_NODE( x )    ( (FTC_Node)(x) )\n#define FTC_NODE_P( x )  ( (FTC_Node*)(x) )\n\n#define FTC_NODE__NEXT( x )  FTC_NODE( (x)->mru.next )\n#define FTC_NODE__PREV( x )  FTC_NODE( (x)->mru.prev )\n\n#ifdef FTC_INLINE\n#define FTC_NODE__TOP_FOR_HASH( cache, hash )                     \\\n        ( ( cache )->buckets +                                    \\\n            ( ( ( ( hash ) &   ( cache )->mask ) < ( cache )->p ) \\\n              ? ( ( hash ) & ( ( cache )->mask * 2 + 1 ) )        \\\n              : ( ( hash ) &   ( cache )->mask ) ) )\n#else\n  FT_LOCAL( FTC_Node* )\n  ftc_get_top_node_for_hash( FTC_Cache   cache,\n                             FT_PtrDist  hash );\n#define FTC_NODE__TOP_FOR_HASH( cache, hash )            \\\n        ftc_get_top_node_for_hash( ( cache ), ( hash ) )\n#endif\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       CACHE DEFINITIONS                       *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* initialize a new cache node */\n  typedef FT_Error\n  (*FTC_Node_NewFunc)( FTC_Node    *pnode,\n                       FT_Pointer   query,\n                       FTC_Cache    cache );\n\n  typedef FT_Offset\n  (*FTC_Node_WeightFunc)( FTC_Node   node,\n                          FTC_Cache  cache );\n\n  /* compare a node to a given key pair */\n  typedef FT_Bool\n  (*FTC_Node_CompareFunc)( FTC_Node    node,\n                           FT_Pointer  key,\n                           FTC_Cache   cache,\n                           FT_Bool*    list_changed );\n\n\n  typedef void\n  (*FTC_Node_FreeFunc)( FTC_Node   node,\n                        FTC_Cache  cache );\n\n  typedef FT_Error\n  (*FTC_Cache_InitFunc)( FTC_Cache  cache );\n\n  typedef void\n  (*FTC_Cache_DoneFunc)( FTC_Cache  cache );\n\n\n  typedef struct  FTC_CacheClassRec_\n  {\n    FTC_Node_NewFunc      node_new;\n    FTC_Node_WeightFunc   node_weight;\n    FTC_Node_CompareFunc  node_compare;\n    FTC_Node_CompareFunc  node_remove_faceid;\n    FTC_Node_FreeFunc     node_free;\n\n    FT_Offset             cache_size;\n    FTC_Cache_InitFunc    cache_init;\n    FTC_Cache_DoneFunc    cache_done;\n\n  } FTC_CacheClassRec;\n\n\n  /* each cache really implements a dynamic hash table to manage its nodes */\n  typedef struct  FTC_CacheRec_\n  {\n    FT_UFast           p;\n    FT_UFast           mask;\n    FT_Long            slack;\n    FTC_Node*          buckets;\n\n    FTC_CacheClassRec  clazz;       /* local copy, for speed  */\n\n    FTC_Manager        manager;\n    FT_Memory          memory;\n    FT_UInt            index;       /* in manager's table     */\n\n    FTC_CacheClass     org_class;   /* original class pointer */\n\n  } FTC_CacheRec;\n\n\n#define FTC_CACHE( x )    ( (FTC_Cache)(x) )\n#define FTC_CACHE_P( x )  ( (FTC_Cache*)(x) )\n\n\n  /* default cache initialize */\n  FT_LOCAL( FT_Error )\n  FTC_Cache_Init( FTC_Cache  cache );\n\n  /* default cache finalizer */\n  FT_LOCAL( void )\n  FTC_Cache_Done( FTC_Cache  cache );\n\n  /* Call this function to look up the cache.  If no corresponding\n   * node is found, a new one is automatically created.  This function\n   * is capable of flushing the cache adequately to make room for the\n   * new cache object.\n   */\n\n#ifndef FTC_INLINE\n  FT_LOCAL( FT_Error )\n  FTC_Cache_Lookup( FTC_Cache   cache,\n                    FT_PtrDist  hash,\n                    FT_Pointer  query,\n                    FTC_Node   *anode );\n#endif\n\n  FT_LOCAL( FT_Error )\n  FTC_Cache_NewNode( FTC_Cache   cache,\n                     FT_PtrDist  hash,\n                     FT_Pointer  query,\n                     FTC_Node   *anode );\n\n  /* Remove all nodes that relate to a given face_id.  This is useful\n   * when un-installing fonts.  Note that if a cache node relates to\n   * the face_id but is locked (i.e., has `ref_count > 0'), the node\n   * will _not_ be destroyed, but its internal face_id reference will\n   * be modified.\n   *\n   * The final result will be that the node will never come back\n   * in further lookup requests, and will be flushed on demand from\n   * the cache normally when its reference count reaches 0.\n   */\n  FT_LOCAL( void )\n  FTC_Cache_RemoveFaceID( FTC_Cache   cache,\n                          FTC_FaceID  face_id );\n\n\n#ifdef FTC_INLINE\n\n#define FTC_CACHE_LOOKUP_CMP( cache, nodecmp, hash, query, node, error ) \\\n  FT_BEGIN_STMNT                                                         \\\n    FTC_Node             *_bucket, *_pnode, _node;                       \\\n    FTC_Cache             _cache   = FTC_CACHE(cache);                   \\\n    FT_PtrDist            _hash    = (FT_PtrDist)(hash);                 \\\n    FTC_Node_CompareFunc  _nodcomp = (FTC_Node_CompareFunc)(nodecmp);    \\\n    FT_Bool               _list_changed = FALSE;                         \\\n                                                                         \\\n                                                                         \\\n    error = FT_Err_Ok;                                                   \\\n    node  = NULL;                                                        \\\n                                                                         \\\n    /* Go to the `top' node of the list sharing same masked hash */      \\\n    _bucket = _pnode = FTC_NODE__TOP_FOR_HASH( _cache, _hash );          \\\n                                                                         \\\n    /* Look up a node with identical hash and queried properties.    */  \\\n    /* NOTE: _nodcomp() may change the linked list to reduce memory. */  \\\n    for (;;)                                                             \\\n    {                                                                    \\\n      _node = *_pnode;                                                   \\\n      if ( _node == NULL )                                               \\\n        goto _NewNode;                                                   \\\n                                                                         \\\n      if ( _node->hash == _hash                             &&           \\\n           _nodcomp( _node, query, _cache, &_list_changed ) )            \\\n        break;                                                           \\\n                                                                         \\\n      _pnode = &_node->link;                                             \\\n    }                                                                    \\\n                                                                         \\\n    if ( _list_changed )                                                 \\\n    {                                                                    \\\n      /* Update _bucket by possibly modified linked list */              \\\n      _bucket = _pnode = FTC_NODE__TOP_FOR_HASH( _cache, _hash );        \\\n                                                                         \\\n      /* Update _pnode by possibly modified linked list */               \\\n      while ( *_pnode != _node )                                         \\\n      {                                                                  \\\n        if ( *_pnode == NULL )                                           \\\n        {                                                                \\\n          FT_ERROR(( \"FTC_CACHE_LOOKUP_CMP: oops!!! node missing\\n\" ));  \\\n          goto _NewNode;                                                 \\\n        }                                                                \\\n        else                                                             \\\n          _pnode = &((*_pnode)->link);                                   \\\n      }                                                                  \\\n    }                                                                    \\\n                                                                         \\\n    /* Reorder the list to move the found node to the `top' */           \\\n    if ( _node != *_bucket )                                             \\\n    {                                                                    \\\n      *_pnode     = _node->link;                                         \\\n      _node->link = *_bucket;                                            \\\n      *_bucket    = _node;                                               \\\n    }                                                                    \\\n                                                                         \\\n    /* Update MRU list */                                                \\\n    {                                                                    \\\n      FTC_Manager  _manager = _cache->manager;                           \\\n      void*        _nl      = &_manager->nodes_list;                     \\\n                                                                         \\\n                                                                         \\\n      if ( _node != _manager->nodes_list )                               \\\n        FTC_MruNode_Up( (FTC_MruNode*)_nl,                               \\\n                        (FTC_MruNode)_node );                            \\\n    }                                                                    \\\n    goto _Ok;                                                            \\\n                                                                         \\\n  _NewNode:                                                              \\\n    error = FTC_Cache_NewNode( _cache, _hash, query, &_node );           \\\n                                                                         \\\n  _Ok:                                                                   \\\n    node = _node;                                                        \\\n  FT_END_STMNT\n\n#else /* !FTC_INLINE */\n\n#define FTC_CACHE_LOOKUP_CMP( cache, nodecmp, hash, query, node, error ) \\\n  FT_BEGIN_STMNT                                                         \\\n    error = FTC_Cache_Lookup( FTC_CACHE( cache ), hash, query,           \\\n                              (FTC_Node*)&(node) );                      \\\n  FT_END_STMNT\n\n#endif /* !FTC_INLINE */\n\n\n  /*\n   * This macro, together with FTC_CACHE_TRYLOOP_END, defines a retry\n   * loop to flush the cache repeatedly in case of memory overflows.\n   *\n   * It is used when creating a new cache node, or within a lookup\n   * that needs to allocate data (e.g. the sbit cache lookup).\n   *\n   * Example:\n   *\n   *   {\n   *     FTC_CACHE_TRYLOOP( cache )\n   *       error = load_data( ... );\n   *     FTC_CACHE_TRYLOOP_END()\n   *   }\n   *\n   */\n#define FTC_CACHE_TRYLOOP( cache )                           \\\n  {                                                          \\\n    FTC_Manager  _try_manager = FTC_CACHE( cache )->manager; \\\n    FT_UInt      _try_count   = 4;                           \\\n                                                             \\\n                                                             \\\n    for (;;)                                                 \\\n    {                                                        \\\n      FT_UInt  _try_done;\n\n\n#define FTC_CACHE_TRYLOOP_END( list_changed )                     \\\n      if ( !error || FT_ERR_NEQ( error, Out_Of_Memory ) )         \\\n        break;                                                    \\\n                                                                  \\\n      _try_done = FTC_Manager_FlushN( _try_manager, _try_count ); \\\n      if ( _try_done > 0 && ( list_changed ) )                    \\\n        *(FT_Bool*)( list_changed ) = TRUE;                       \\\n                                                                  \\\n      if ( _try_done == 0 )                                       \\\n        break;                                                    \\\n                                                                  \\\n      if ( _try_done == _try_count )                              \\\n      {                                                           \\\n        _try_count *= 2;                                          \\\n        if ( _try_count < _try_done              ||               \\\n            _try_count > _try_manager->num_nodes )                \\\n          _try_count = _try_manager->num_nodes;                   \\\n      }                                                           \\\n    }                                                             \\\n  }\n\n /* */\n\nFT_END_HEADER\n\n\n#endif /* __FTCCACHE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cache/ftccback.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftccback.h                                                             */\n/*                                                                         */\n/*    Callback functions of the caching sub-system (specification only).   */\n/*                                                                         */\n/*  Copyright 2004-2006, 2011, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#ifndef __FTCCBACK_H__\n#define __FTCCBACK_H__\n\n#include <ft2build.h>\n#include FT_CACHE_H\n#include \"ftcmru.h\"\n#include \"ftcimage.h\"\n#include \"ftcmanag.h\"\n#include \"ftcglyph.h\"\n#include \"ftcsbits.h\"\n\n\n  FT_LOCAL( void )\n  ftc_inode_free( FTC_Node   inode,\n                  FTC_Cache  cache );\n\n  FT_LOCAL( FT_Error )\n  ftc_inode_new( FTC_Node   *pinode,\n                 FT_Pointer  gquery,\n                 FTC_Cache   cache );\n\n  FT_LOCAL( FT_Offset )\n  ftc_inode_weight( FTC_Node   inode,\n                    FTC_Cache  cache );\n\n\n  FT_LOCAL( void )\n  ftc_snode_free( FTC_Node   snode,\n                  FTC_Cache  cache );\n\n  FT_LOCAL( FT_Error )\n  ftc_snode_new( FTC_Node   *psnode,\n                 FT_Pointer  gquery,\n                 FTC_Cache   cache );\n\n  FT_LOCAL( FT_Offset )\n  ftc_snode_weight( FTC_Node   snode,\n                    FTC_Cache  cache );\n\n  FT_LOCAL( FT_Bool )\n  ftc_snode_compare( FTC_Node    snode,\n                     FT_Pointer  gquery,\n                     FTC_Cache   cache,\n                     FT_Bool*    list_changed );\n\n\n  FT_LOCAL( FT_Bool )\n  ftc_gnode_compare( FTC_Node    gnode,\n                     FT_Pointer  gquery,\n                     FTC_Cache   cache,\n                     FT_Bool*    list_changed );\n\n\n  FT_LOCAL( FT_Error )\n  ftc_gcache_init( FTC_Cache  cache );\n\n  FT_LOCAL( void )\n  ftc_gcache_done( FTC_Cache  cache );\n\n\n  FT_LOCAL( FT_Error )\n  ftc_cache_init( FTC_Cache  cache );\n\n  FT_LOCAL( void )\n  ftc_cache_done( FTC_Cache  cache );\n\n  FT_LOCAL( void )\n  ftc_node_destroy( FTC_Node     node,\n                    FTC_Manager  manager );\n\n\n#endif /* __FTCCBACK_H__ */\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cache/ftccmap.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftccmap.c                                                              */\n/*                                                                         */\n/*    FreeType CharMap cache (body)                                        */\n/*                                                                         */\n/*  Copyright 2000-2014 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_CACHE_H\n#include \"ftcmanag.h\"\n#include FT_INTERNAL_MEMORY_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_DEBUG_H\n\n#include \"ftccback.h\"\n#include \"ftcerror.h\"\n\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_cache\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Each FTC_CMapNode contains a simple array to map a range of character */\n  /* codes to equivalent glyph indices.                                    */\n  /*                                                                       */\n  /* For now, the implementation is very basic: Each node maps a range of  */\n  /* 128 consecutive character codes to their corresponding glyph indices. */\n  /*                                                                       */\n  /* We could do more complex things, but I don't think it is really very  */\n  /* useful.                                                               */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* number of glyph indices / character code per node */\n#define FTC_CMAP_INDICES_MAX  128\n\n  /* compute a query/node hash */\n#define FTC_CMAP_HASH( faceid, index, charcode )         \\\n          ( _FTC_FACE_ID_HASH( faceid ) + 211 * (index) + \\\n            ( (charcode) / FTC_CMAP_INDICES_MAX )      )\n\n  /* the charmap query */\n  typedef struct  FTC_CMapQueryRec_\n  {\n    FTC_FaceID  face_id;\n    FT_UInt     cmap_index;\n    FT_UInt32   char_code;\n\n  } FTC_CMapQueryRec, *FTC_CMapQuery;\n\n#define FTC_CMAP_QUERY( x )  ((FTC_CMapQuery)(x))\n#define FTC_CMAP_QUERY_HASH( x )                                         \\\n          FTC_CMAP_HASH( (x)->face_id, (x)->cmap_index, (x)->char_code )\n\n  /* the cmap cache node */\n  typedef struct  FTC_CMapNodeRec_\n  {\n    FTC_NodeRec  node;\n    FTC_FaceID   face_id;\n    FT_UInt      cmap_index;\n    FT_UInt32    first;                         /* first character in node */\n    FT_UInt16    indices[FTC_CMAP_INDICES_MAX]; /* array of glyph indices  */\n\n  } FTC_CMapNodeRec, *FTC_CMapNode;\n\n#define FTC_CMAP_NODE( x ) ( (FTC_CMapNode)( x ) )\n#define FTC_CMAP_NODE_HASH( x )                                      \\\n          FTC_CMAP_HASH( (x)->face_id, (x)->cmap_index, (x)->first )\n\n  /* if (indices[n] == FTC_CMAP_UNKNOWN), we assume that the corresponding */\n  /* glyph indices haven't been queried through FT_Get_Glyph_Index() yet   */\n#define FTC_CMAP_UNKNOWN  (FT_UInt16)~0\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                        CHARMAP NODES                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  FT_CALLBACK_DEF( void )\n  ftc_cmap_node_free( FTC_Node   ftcnode,\n                      FTC_Cache  cache )\n  {\n    FTC_CMapNode  node   = (FTC_CMapNode)ftcnode;\n    FT_Memory     memory = cache->memory;\n\n\n    FT_FREE( node );\n  }\n\n\n  /* initialize a new cmap node */\n  FT_CALLBACK_DEF( FT_Error )\n  ftc_cmap_node_new( FTC_Node   *ftcanode,\n                     FT_Pointer  ftcquery,\n                     FTC_Cache   cache )\n  {\n    FTC_CMapNode  *anode  = (FTC_CMapNode*)ftcanode;\n    FTC_CMapQuery  query  = (FTC_CMapQuery)ftcquery;\n    FT_Error       error;\n    FT_Memory      memory = cache->memory;\n    FTC_CMapNode   node   = NULL;\n    FT_UInt        nn;\n\n\n    if ( !FT_NEW( node ) )\n    {\n      node->face_id    = query->face_id;\n      node->cmap_index = query->cmap_index;\n      node->first      = (query->char_code / FTC_CMAP_INDICES_MAX) *\n                         FTC_CMAP_INDICES_MAX;\n\n      for ( nn = 0; nn < FTC_CMAP_INDICES_MAX; nn++ )\n        node->indices[nn] = FTC_CMAP_UNKNOWN;\n    }\n\n    *anode = node;\n    return error;\n  }\n\n\n  /* compute the weight of a given cmap node */\n  FT_CALLBACK_DEF( FT_Offset )\n  ftc_cmap_node_weight( FTC_Node   cnode,\n                        FTC_Cache  cache )\n  {\n    FT_UNUSED( cnode );\n    FT_UNUSED( cache );\n\n    return sizeof ( *cnode );\n  }\n\n\n  /* compare a cmap node to a given query */\n  FT_CALLBACK_DEF( FT_Bool )\n  ftc_cmap_node_compare( FTC_Node    ftcnode,\n                         FT_Pointer  ftcquery,\n                         FTC_Cache   cache,\n                         FT_Bool*    list_changed )\n  {\n    FTC_CMapNode   node  = (FTC_CMapNode)ftcnode;\n    FTC_CMapQuery  query = (FTC_CMapQuery)ftcquery;\n    FT_UNUSED( cache );\n\n\n    if ( list_changed )\n      *list_changed = FALSE;\n    if ( node->face_id    == query->face_id    &&\n         node->cmap_index == query->cmap_index )\n    {\n      FT_UInt32  offset = (FT_UInt32)( query->char_code - node->first );\n\n\n      return FT_BOOL( offset < FTC_CMAP_INDICES_MAX );\n    }\n\n    return 0;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Bool )\n  ftc_cmap_node_remove_faceid( FTC_Node    ftcnode,\n                               FT_Pointer  ftcface_id,\n                               FTC_Cache   cache,\n                               FT_Bool*    list_changed )\n  {\n    FTC_CMapNode  node    = (FTC_CMapNode)ftcnode;\n    FTC_FaceID    face_id = (FTC_FaceID)ftcface_id;\n    FT_UNUSED( cache );\n\n\n    if ( list_changed )\n      *list_changed = FALSE;\n    return FT_BOOL( node->face_id == face_id );\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    GLYPH IMAGE CACHE                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  static\n  const FTC_CacheClassRec  ftc_cmap_cache_class =\n  {\n    ftc_cmap_node_new,\n    ftc_cmap_node_weight,\n    ftc_cmap_node_compare,\n    ftc_cmap_node_remove_faceid,\n    ftc_cmap_node_free,\n\n    sizeof ( FTC_CacheRec ),\n    ftc_cache_init,\n    ftc_cache_done,\n  };\n\n\n  /* documentation is in ftcache.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FTC_CMapCache_New( FTC_Manager     manager,\n                     FTC_CMapCache  *acache )\n  {\n    return FTC_Manager_RegisterCache( manager,\n                                      &ftc_cmap_cache_class,\n                                      FTC_CACHE_P( acache ) );\n  }\n\n\n  /* documentation is in ftcache.h */\n\n  FT_EXPORT_DEF( FT_UInt )\n  FTC_CMapCache_Lookup( FTC_CMapCache  cmap_cache,\n                        FTC_FaceID     face_id,\n                        FT_Int         cmap_index,\n                        FT_UInt32      char_code )\n  {\n    FTC_Cache         cache = FTC_CACHE( cmap_cache );\n    FTC_CMapQueryRec  query;\n    FTC_Node          node;\n    FT_Error          error;\n    FT_UInt           gindex = 0;\n    FT_PtrDist        hash;\n    FT_Int            no_cmap_change = 0;\n\n\n    if ( cmap_index < 0 )\n    {\n      /* Treat a negative cmap index as a special value, meaning that you */\n      /* don't want to change the FT_Face's character map through this    */\n      /* call.  This can be useful if the face requester callback already */\n      /* sets the face's charmap to the appropriate value.                */\n\n      no_cmap_change = 1;\n      cmap_index     = 0;\n    }\n\n    if ( !cache )\n    {\n      FT_TRACE0(( \"FTC_CMapCache_Lookup: bad arguments, returning 0\\n\" ));\n      return 0;\n    }\n\n    if ( !face_id )\n      return 0;\n\n    query.face_id    = face_id;\n    query.cmap_index = (FT_UInt)cmap_index;\n    query.char_code  = char_code;\n\n    hash = FTC_CMAP_HASH( face_id, cmap_index, char_code );\n\n#if 1\n    FTC_CACHE_LOOKUP_CMP( cache, ftc_cmap_node_compare, hash, &query,\n                          node, error );\n#else\n    error = FTC_Cache_Lookup( cache, hash, &query, &node );\n#endif\n    if ( error )\n      goto Exit;\n\n    FT_ASSERT( (FT_UInt)( char_code - FTC_CMAP_NODE( node )->first ) <\n                FTC_CMAP_INDICES_MAX );\n\n    /* something rotten can happen with rogue clients */\n    if ( (FT_UInt)( char_code - FTC_CMAP_NODE( node )->first >=\n                    FTC_CMAP_INDICES_MAX ) )\n      return 0; /* XXX: should return appropriate error */\n\n    gindex = FTC_CMAP_NODE( node )->indices[char_code -\n                                            FTC_CMAP_NODE( node )->first];\n    if ( gindex == FTC_CMAP_UNKNOWN )\n    {\n      FT_Face  face;\n\n\n      gindex = 0;\n\n      error = FTC_Manager_LookupFace( cache->manager,\n                                      FTC_CMAP_NODE( node )->face_id,\n                                      &face );\n      if ( error )\n        goto Exit;\n\n      if ( (FT_UInt)cmap_index < (FT_UInt)face->num_charmaps )\n      {\n        FT_CharMap  old, cmap  = NULL;\n\n\n        old  = face->charmap;\n        cmap = face->charmaps[cmap_index];\n\n        if ( old != cmap && !no_cmap_change )\n          FT_Set_Charmap( face, cmap );\n\n        gindex = FT_Get_Char_Index( face, char_code );\n\n        if ( old != cmap && !no_cmap_change )\n          FT_Set_Charmap( face, old );\n      }\n\n      FTC_CMAP_NODE( node )->indices[char_code -\n                                     FTC_CMAP_NODE( node )->first]\n        = (FT_UShort)gindex;\n    }\n\n  Exit:\n    return gindex;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cache/ftcerror.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcerror.h                                                             */\n/*                                                                         */\n/*    Caching sub-system error codes (specification only).                 */\n/*                                                                         */\n/*  Copyright 2001, 2012 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the caching sub-system error enumeration  */\n  /* constants.                                                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __FTCERROR_H__\n#define __FTCERROR_H__\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  FTC_Err_\n#define FT_ERR_BASE    FT_Mod_Err_Cache\n\n#include FT_ERRORS_H\n\n#endif /* __FTCERROR_H__ */\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cache/ftcglyph.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcglyph.c                                                             */\n/*                                                                         */\n/*    FreeType Glyph Image (FT_Glyph) cache (body).                        */\n/*                                                                         */\n/*  Copyright 2000-2001, 2003, 2004, 2006, 2009, 2011 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n#include FT_CACHE_H\n#include \"ftcglyph.h\"\n#include FT_ERRORS_H\n\n#include \"ftccback.h\"\n#include \"ftcerror.h\"\n\n\n  /* create a new chunk node, setting its cache index and ref count */\n  FT_LOCAL_DEF( void )\n  FTC_GNode_Init( FTC_GNode   gnode,\n                  FT_UInt     gindex,\n                  FTC_Family  family )\n  {\n    gnode->family = family;\n    gnode->gindex = gindex;\n    family->num_nodes++;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  FTC_GNode_UnselectFamily( FTC_GNode  gnode,\n                            FTC_Cache  cache )\n  {\n    FTC_Family  family = gnode->family;\n\n\n    gnode->family = NULL;\n    if ( family && --family->num_nodes == 0 )\n      FTC_FAMILY_FREE( family, cache );\n  }\n\n\n  FT_LOCAL_DEF( void )\n  FTC_GNode_Done( FTC_GNode  gnode,\n                  FTC_Cache  cache )\n  {\n    /* finalize the node */\n    gnode->gindex = 0;\n\n    FTC_GNode_UnselectFamily( gnode, cache );\n  }\n\n\n  FT_LOCAL_DEF( FT_Bool )\n  ftc_gnode_compare( FTC_Node    ftcgnode,\n                     FT_Pointer  ftcgquery,\n                     FTC_Cache   cache,\n                     FT_Bool*    list_changed )\n  {\n    FTC_GNode   gnode  = (FTC_GNode)ftcgnode;\n    FTC_GQuery  gquery = (FTC_GQuery)ftcgquery;\n    FT_UNUSED( cache );\n\n\n    if ( list_changed )\n      *list_changed = FALSE;\n    return FT_BOOL( gnode->family == gquery->family &&\n                    gnode->gindex == gquery->gindex );\n  }\n\n\n#ifdef FTC_INLINE\n\n  FT_LOCAL_DEF( FT_Bool )\n  FTC_GNode_Compare( FTC_GNode   gnode,\n                     FTC_GQuery  gquery,\n                     FTC_Cache   cache,\n                     FT_Bool*    list_changed )\n  {\n    return ftc_gnode_compare( FTC_NODE( gnode ), gquery,\n                              cache, list_changed );\n  }\n\n#endif\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      CHUNK SETS                               *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL_DEF( void )\n  FTC_Family_Init( FTC_Family  family,\n                   FTC_Cache   cache )\n  {\n    FTC_GCacheClass  clazz = FTC_CACHE__GCACHE_CLASS( cache );\n\n\n    family->clazz     = clazz->family_class;\n    family->num_nodes = 0;\n    family->cache     = cache;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  ftc_gcache_init( FTC_Cache  ftccache )\n  {\n    FTC_GCache  cache = (FTC_GCache)ftccache;\n    FT_Error    error;\n\n\n    error = FTC_Cache_Init( FTC_CACHE( cache ) );\n    if ( !error )\n    {\n      FTC_GCacheClass   clazz = (FTC_GCacheClass)FTC_CACHE( cache )->org_class;\n\n      FTC_MruList_Init( &cache->families,\n                        clazz->family_class,\n                        0,  /* no maximum here! */\n                        cache,\n                        FTC_CACHE( cache )->memory );\n    }\n\n    return error;\n  }\n\n\n#if 0\n\n  FT_LOCAL_DEF( FT_Error )\n  FTC_GCache_Init( FTC_GCache  cache )\n  {\n    return ftc_gcache_init( FTC_CACHE( cache ) );\n  }\n\n#endif /* 0 */\n\n\n  FT_LOCAL_DEF( void )\n  ftc_gcache_done( FTC_Cache  ftccache )\n  {\n    FTC_GCache  cache = (FTC_GCache)ftccache;\n\n\n    FTC_Cache_Done( (FTC_Cache)cache );\n    FTC_MruList_Done( &cache->families );\n  }\n\n\n#if 0\n\n  FT_LOCAL_DEF( void )\n  FTC_GCache_Done( FTC_GCache  cache )\n  {\n    ftc_gcache_done( FTC_CACHE( cache ) );\n  }\n\n#endif /* 0 */\n\n\n  FT_LOCAL_DEF( FT_Error )\n  FTC_GCache_New( FTC_Manager       manager,\n                  FTC_GCacheClass   clazz,\n                  FTC_GCache       *acache )\n  {\n    return FTC_Manager_RegisterCache( manager, (FTC_CacheClass)clazz,\n                                      (FTC_Cache*)acache );\n  }\n\n\n#ifndef FTC_INLINE\n\n  FT_LOCAL_DEF( FT_Error )\n  FTC_GCache_Lookup( FTC_GCache   cache,\n                     FT_PtrDist   hash,\n                     FT_UInt      gindex,\n                     FTC_GQuery   query,\n                     FTC_Node    *anode )\n  {\n    FT_Error  error;\n\n\n    query->gindex = gindex;\n\n    FTC_MRULIST_LOOKUP( &cache->families, query, query->family, error );\n    if ( !error )\n    {\n      FTC_Family  family = query->family;\n\n\n      /* prevent the family from being destroyed too early when an        */\n      /* out-of-memory condition occurs during glyph node initialization. */\n      family->num_nodes++;\n\n      error = FTC_Cache_Lookup( FTC_CACHE( cache ), hash, query, anode );\n\n      if ( --family->num_nodes == 0 )\n        FTC_FAMILY_FREE( family, cache );\n    }\n    return error;\n  }\n\n#endif /* !FTC_INLINE */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cache/ftcglyph.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcglyph.h                                                             */\n/*                                                                         */\n/*    FreeType abstract glyph cache (specification).                       */\n/*                                                                         */\n/*  Copyright 2000-2001, 2003, 2004, 2006, 2007, 2011 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*\n   *\n   *  FTC_GCache is an _abstract_ cache object optimized to store glyph\n   *  data.  It works as follows:\n   *\n   *   - It manages FTC_GNode objects. Each one of them can hold one or more\n   *     glyph `items'.  Item types are not specified in the FTC_GCache but\n   *     in classes that extend it.\n   *\n   *   - Glyph attributes, like face ID, character size, render mode, etc.,\n   *     can be grouped into abstract `glyph families'.  This avoids storing\n   *     the attributes within the FTC_GCache, since it is likely that many\n   *     FTC_GNodes will belong to the same family in typical uses.\n   *\n   *   - Each FTC_GNode is thus an FTC_Node with two additional fields:\n   *\n   *       * gindex: A glyph index, or the first index in a glyph range.\n   *       * family: A pointer to a glyph `family'.\n   *\n   *   - Family types are not fully specific in the FTC_Family type, but\n   *     by classes that extend it.\n   *\n   *  Note that both FTC_ImageCache and FTC_SBitCache extend FTC_GCache.\n   *  They share an FTC_Family sub-class called FTC_BasicFamily which is\n   *  used to store the following data: face ID, pixel/point sizes, load\n   *  flags.  For more details see the file `src/cache/ftcbasic.c'.\n   *\n   *  Client applications can extend FTC_GNode with their own FTC_GNode\n   *  and FTC_Family sub-classes to implement more complex caches (e.g.,\n   *  handling automatic synthesis, like obliquing & emboldening, colored\n   *  glyphs, etc.).\n   *\n   *  See also the FTC_ICache & FTC_SCache classes in `ftcimage.h' and\n   *  `ftcsbits.h', which both extend FTC_GCache with additional\n   *  optimizations.\n   *\n   *  A typical FTC_GCache implementation must provide at least the\n   *  following:\n   *\n   *  - FTC_GNode sub-class, e.g. MyNode, with relevant methods:\n   *        my_node_new            (must call FTC_GNode_Init)\n   *        my_node_free           (must call FTC_GNode_Done)\n   *        my_node_compare        (must call FTC_GNode_Compare)\n   *        my_node_remove_faceid  (must call ftc_gnode_unselect in case\n   *                                of match)\n   *\n   *  - FTC_Family sub-class, e.g. MyFamily, with relevant methods:\n   *        my_family_compare\n   *        my_family_init\n   *        my_family_reset (optional)\n   *        my_family_done\n   *\n   *  - FTC_GQuery sub-class, e.g. MyQuery, to hold cache-specific query\n   *    data.\n   *\n   *  - Constant structures for a FTC_GNodeClass.\n   *\n   *  - MyCacheNew() can be implemented easily as a call to the convenience\n   *    function FTC_GCache_New.\n   *\n   *  - MyCacheLookup with a call to FTC_GCache_Lookup.  This function will\n   *    automatically:\n   *\n   *    - Search for the corresponding family in the cache, or create\n   *      a new one if necessary.  Put it in FTC_GQUERY(myquery).family\n   *\n   *    - Call FTC_Cache_Lookup.\n   *\n   *    If it returns NULL, you should create a new node, then call\n   *    ftc_cache_add as usual.\n   */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Important: The functions defined in this file are only used to        */\n  /*            implement an abstract glyph cache class.  You need to      */\n  /*            provide additional logic to implement a complete cache.    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*********                                                       *********/\n  /*********             WARNING, THIS IS BETA CODE.               *********/\n  /*********                                                       *********/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n#ifndef __FTCGLYPH_H__\n#define __FTCGLYPH_H__\n\n\n#include <ft2build.h>\n#include \"ftcmanag.h\"\n\n\nFT_BEGIN_HEADER\n\n\n /*\n  *  We can group glyphs into `families'.  Each family correspond to a\n  *  given face ID, character size, transform, etc.\n  *\n  *  Families are implemented as MRU list nodes.  They are\n  *  reference-counted.\n  */\n\n  typedef struct  FTC_FamilyRec_\n  {\n    FTC_MruNodeRec    mrunode;\n    FT_UInt           num_nodes; /* current number of nodes in this family */\n    FTC_Cache         cache;\n    FTC_MruListClass  clazz;\n\n  } FTC_FamilyRec, *FTC_Family;\n\n#define  FTC_FAMILY(x)    ( (FTC_Family)(x) )\n#define  FTC_FAMILY_P(x)  ( (FTC_Family*)(x) )\n\n\n  typedef struct  FTC_GNodeRec_\n  {\n    FTC_NodeRec      node;\n    FTC_Family       family;\n    FT_UInt          gindex;\n\n  } FTC_GNodeRec, *FTC_GNode;\n\n#define FTC_GNODE( x )    ( (FTC_GNode)(x) )\n#define FTC_GNODE_P( x )  ( (FTC_GNode*)(x) )\n\n\n  typedef struct  FTC_GQueryRec_\n  {\n    FT_UInt      gindex;\n    FTC_Family   family;\n\n  } FTC_GQueryRec, *FTC_GQuery;\n\n#define FTC_GQUERY( x )  ( (FTC_GQuery)(x) )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* These functions are exported so that they can be called from          */\n  /* user-provided cache classes; otherwise, they are really part of the   */\n  /* cache sub-system internals.                                           */\n  /*                                                                       */\n\n  /* must be called by derived FTC_Node_InitFunc routines */\n  FT_LOCAL( void )\n  FTC_GNode_Init( FTC_GNode   node,\n                  FT_UInt     gindex,  /* glyph index for node */\n                  FTC_Family  family );\n\n#ifdef FTC_INLINE\n\n  /* returns TRUE iff the query's glyph index correspond to the node;  */\n  /* this assumes that the `family' and `hash' fields of the query are */\n  /* already correctly set                                             */\n  FT_LOCAL( FT_Bool )\n  FTC_GNode_Compare( FTC_GNode   gnode,\n                     FTC_GQuery  gquery,\n                     FTC_Cache   cache,\n                     FT_Bool*    list_changed );\n\n#endif\n\n  /* call this function to clear a node's family -- this is necessary */\n  /* to implement the `node_remove_faceid' cache method correctly     */\n  FT_LOCAL( void )\n  FTC_GNode_UnselectFamily( FTC_GNode  gnode,\n                            FTC_Cache  cache );\n\n  /* must be called by derived FTC_Node_DoneFunc routines */\n  FT_LOCAL( void )\n  FTC_GNode_Done( FTC_GNode  node,\n                  FTC_Cache  cache );\n\n\n  FT_LOCAL( void )\n  FTC_Family_Init( FTC_Family  family,\n                   FTC_Cache   cache );\n\n  typedef struct FTC_GCacheRec_\n  {\n    FTC_CacheRec    cache;\n    FTC_MruListRec  families;\n\n  } FTC_GCacheRec, *FTC_GCache;\n\n#define FTC_GCACHE( x )  ((FTC_GCache)(x))\n\n\n#if 0\n  /* can be used as @FTC_Cache_InitFunc */\n  FT_LOCAL( FT_Error )\n  FTC_GCache_Init( FTC_GCache  cache );\n#endif\n\n\n#if 0\n  /* can be used as @FTC_Cache_DoneFunc */\n  FT_LOCAL( void )\n  FTC_GCache_Done( FTC_GCache  cache );\n#endif\n\n\n  /* the glyph cache class adds fields for the family implementation */\n  typedef struct  FTC_GCacheClassRec_\n  {\n    FTC_CacheClassRec  clazz;\n    FTC_MruListClass   family_class;\n\n  } FTC_GCacheClassRec;\n\n  typedef const FTC_GCacheClassRec*   FTC_GCacheClass;\n\n#define FTC_GCACHE_CLASS( x )  ((FTC_GCacheClass)(x))\n\n#define FTC_CACHE__GCACHE_CLASS( x ) \\\n          FTC_GCACHE_CLASS( FTC_CACHE(x)->org_class )\n#define FTC_CACHE__FAMILY_CLASS( x ) \\\n          ( (FTC_MruListClass)FTC_CACHE__GCACHE_CLASS( x )->family_class )\n\n\n  /* convenience function; use it instead of FTC_Manager_Register_Cache */\n  FT_LOCAL( FT_Error )\n  FTC_GCache_New( FTC_Manager       manager,\n                  FTC_GCacheClass   clazz,\n                  FTC_GCache       *acache );\n\n#ifndef FTC_INLINE\n  FT_LOCAL( FT_Error )\n  FTC_GCache_Lookup( FTC_GCache   cache,\n                     FT_PtrDist   hash,\n                     FT_UInt      gindex,\n                     FTC_GQuery   query,\n                     FTC_Node    *anode );\n#endif\n\n\n  /* */\n\n\n#define FTC_FAMILY_FREE( family, cache )                      \\\n          FTC_MruList_Remove( &FTC_GCACHE((cache))->families, \\\n                              (FTC_MruNode)(family) )\n\n\n#ifdef FTC_INLINE\n\n#define FTC_GCACHE_LOOKUP_CMP( cache, famcmp, nodecmp, hash,                \\\n                               gindex, query, node, error )                 \\\n  FT_BEGIN_STMNT                                                            \\\n    FTC_GCache               _gcache   = FTC_GCACHE( cache );               \\\n    FTC_GQuery               _gquery   = (FTC_GQuery)( query );             \\\n    FTC_MruNode_CompareFunc  _fcompare = (FTC_MruNode_CompareFunc)(famcmp); \\\n    FTC_MruNode              _mrunode;                                      \\\n                                                                            \\\n                                                                            \\\n    _gquery->gindex = (gindex);                                             \\\n                                                                            \\\n    FTC_MRULIST_LOOKUP_CMP( &_gcache->families, _gquery, _fcompare,         \\\n                            _mrunode, error );                              \\\n    _gquery->family = FTC_FAMILY( _mrunode );                               \\\n    if ( !error )                                                           \\\n    {                                                                       \\\n      FTC_Family  _gqfamily = _gquery->family;                              \\\n                                                                            \\\n                                                                            \\\n      _gqfamily->num_nodes++;                                               \\\n                                                                            \\\n      FTC_CACHE_LOOKUP_CMP( cache, nodecmp, hash, query, node, error );     \\\n                                                                            \\\n      if ( --_gqfamily->num_nodes == 0 )                                    \\\n        FTC_FAMILY_FREE( _gqfamily, _gcache );                              \\\n    }                                                                       \\\n  FT_END_STMNT\n  /* */\n\n#else /* !FTC_INLINE */\n\n#define FTC_GCACHE_LOOKUP_CMP( cache, famcmp, nodecmp, hash,          \\\n                               gindex, query, node, error )           \\\n   FT_BEGIN_STMNT                                                     \\\n                                                                      \\\n     error = FTC_GCache_Lookup( FTC_GCACHE( cache ), hash, gindex,    \\\n                                FTC_GQUERY( query ), &node );         \\\n                                                                      \\\n   FT_END_STMNT\n\n#endif /* !FTC_INLINE */\n\n\nFT_END_HEADER\n\n\n#endif /* __FTCGLYPH_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cache/ftcimage.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcimage.c                                                             */\n/*                                                                         */\n/*    FreeType Image cache (body).                                         */\n/*                                                                         */\n/*  Copyright 2000-2001, 2003, 2004, 2006, 2010 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_CACHE_H\n#include \"ftcimage.h\"\n#include FT_INTERNAL_MEMORY_H\n\n#include \"ftccback.h\"\n#include \"ftcerror.h\"\n\n\n  /* finalize a given glyph image node */\n  FT_LOCAL_DEF( void )\n  ftc_inode_free( FTC_Node   ftcinode,\n                  FTC_Cache  cache )\n  {\n    FTC_INode  inode = (FTC_INode)ftcinode;\n    FT_Memory  memory = cache->memory;\n\n\n    if ( inode->glyph )\n    {\n      FT_Done_Glyph( inode->glyph );\n      inode->glyph = NULL;\n    }\n\n    FTC_GNode_Done( FTC_GNODE( inode ), cache );\n    FT_FREE( inode );\n  }\n\n\n  FT_LOCAL_DEF( void )\n  FTC_INode_Free( FTC_INode  inode,\n                  FTC_Cache  cache )\n  {\n    ftc_inode_free( FTC_NODE( inode ), cache );\n  }\n\n\n  /* initialize a new glyph image node */\n  FT_LOCAL_DEF( FT_Error )\n  FTC_INode_New( FTC_INode   *pinode,\n                 FTC_GQuery   gquery,\n                 FTC_Cache    cache )\n  {\n    FT_Memory  memory = cache->memory;\n    FT_Error   error;\n    FTC_INode  inode  = NULL;\n\n\n    if ( !FT_NEW( inode ) )\n    {\n      FTC_GNode         gnode  = FTC_GNODE( inode );\n      FTC_Family        family = gquery->family;\n      FT_UInt           gindex = gquery->gindex;\n      FTC_IFamilyClass  clazz  = FTC_CACHE__IFAMILY_CLASS( cache );\n\n\n      /* initialize its inner fields */\n      FTC_GNode_Init( gnode, gindex, family );\n\n      /* we will now load the glyph image */\n      error = clazz->family_load_glyph( family, gindex, cache,\n                                        &inode->glyph );\n      if ( error )\n      {\n        FTC_INode_Free( inode, cache );\n        inode = NULL;\n      }\n    }\n\n    *pinode = inode;\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  ftc_inode_new( FTC_Node   *ftcpinode,\n                 FT_Pointer  ftcgquery,\n                 FTC_Cache   cache )\n  {\n    FTC_INode  *pinode = (FTC_INode*)ftcpinode;\n    FTC_GQuery  gquery = (FTC_GQuery)ftcgquery;\n\n\n    return FTC_INode_New( pinode, gquery, cache );\n  }\n\n\n  FT_LOCAL_DEF( FT_Offset )\n  ftc_inode_weight( FTC_Node   ftcinode,\n                    FTC_Cache  ftccache )\n  {\n    FTC_INode  inode = (FTC_INode)ftcinode;\n    FT_Offset  size  = 0;\n    FT_Glyph   glyph = inode->glyph;\n\n    FT_UNUSED( ftccache );\n\n\n    switch ( glyph->format )\n    {\n    case FT_GLYPH_FORMAT_BITMAP:\n      {\n        FT_BitmapGlyph  bitg;\n\n\n        bitg = (FT_BitmapGlyph)glyph;\n        size = bitg->bitmap.rows * ft_labs( bitg->bitmap.pitch ) +\n               sizeof ( *bitg );\n      }\n      break;\n\n    case FT_GLYPH_FORMAT_OUTLINE:\n      {\n        FT_OutlineGlyph  outg;\n\n\n        outg = (FT_OutlineGlyph)glyph;\n        size = outg->outline.n_points *\n                 ( sizeof ( FT_Vector ) + sizeof ( FT_Byte ) ) +\n               outg->outline.n_contours * sizeof ( FT_Short ) +\n               sizeof ( *outg );\n      }\n      break;\n\n    default:\n      ;\n    }\n\n    size += sizeof ( *inode );\n    return size;\n  }\n\n\n#if 0\n\n  FT_LOCAL_DEF( FT_Offset )\n  FTC_INode_Weight( FTC_INode  inode )\n  {\n    return ftc_inode_weight( FTC_NODE( inode ), NULL );\n  }\n\n#endif /* 0 */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cache/ftcimage.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcimage.h                                                             */\n/*                                                                         */\n/*    FreeType Generic Image cache (specification)                         */\n/*                                                                         */\n/*  Copyright 2000-2001, 2002, 2003, 2006 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n /*\n  *  FTC_ICache is an _abstract_ cache used to store a single FT_Glyph\n  *  image per cache node.\n  *\n  *  FTC_ICache extends FTC_GCache.  For an implementation example,\n  *  see FTC_ImageCache in `src/cache/ftbasic.c'.\n  */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Each image cache really manages FT_Glyph objects.                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTCIMAGE_H__\n#define __FTCIMAGE_H__\n\n\n#include <ft2build.h>\n#include FT_CACHE_H\n#include \"ftcglyph.h\"\n\nFT_BEGIN_HEADER\n\n\n  /* the FT_Glyph image node type - we store only 1 glyph per node */\n  typedef struct  FTC_INodeRec_\n  {\n    FTC_GNodeRec  gnode;\n    FT_Glyph      glyph;\n\n  } FTC_INodeRec, *FTC_INode;\n\n#define FTC_INODE( x )         ( (FTC_INode)( x ) )\n#define FTC_INODE_GINDEX( x )  FTC_GNODE(x)->gindex\n#define FTC_INODE_FAMILY( x )  FTC_GNODE(x)->family\n\n  typedef FT_Error\n  (*FTC_IFamily_LoadGlyphFunc)( FTC_Family  family,\n                                FT_UInt     gindex,\n                                FTC_Cache   cache,\n                                FT_Glyph   *aglyph );\n\n  typedef struct  FTC_IFamilyClassRec_\n  {\n    FTC_MruListClassRec        clazz;\n    FTC_IFamily_LoadGlyphFunc  family_load_glyph;\n\n  } FTC_IFamilyClassRec;\n\n  typedef const FTC_IFamilyClassRec*  FTC_IFamilyClass;\n\n#define FTC_IFAMILY_CLASS( x )  ((FTC_IFamilyClass)(x))\n\n#define FTC_CACHE__IFAMILY_CLASS( x ) \\\n          FTC_IFAMILY_CLASS( FTC_CACHE__GCACHE_CLASS(x)->family_class )\n\n\n  /* can be used as a @FTC_Node_FreeFunc */\n  FT_LOCAL( void )\n  FTC_INode_Free( FTC_INode  inode,\n                  FTC_Cache  cache );\n\n  /* Can be used as @FTC_Node_NewFunc.  `gquery.index' and `gquery.family'\n   * must be set correctly.  This function will call the `family_load_glyph'\n   * method to load the FT_Glyph into the cache node.\n   */\n  FT_LOCAL( FT_Error )\n  FTC_INode_New( FTC_INode   *pinode,\n                 FTC_GQuery   gquery,\n                 FTC_Cache    cache );\n\n#if 0\n  /* can be used as @FTC_Node_WeightFunc */\n  FT_LOCAL( FT_ULong )\n  FTC_INode_Weight( FTC_INode  inode );\n#endif\n\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTCIMAGE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cache/ftcmanag.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcmanag.c                                                             */\n/*                                                                         */\n/*    FreeType Cache Manager (body).                                       */\n/*                                                                         */\n/*  Copyright 2000-2006, 2008-2010, 2013, 2014 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_CACHE_H\n#include \"ftcmanag.h\"\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_SIZES_H\n\n#include \"ftccback.h\"\n#include \"ftcerror.h\"\n\n#ifdef FT_CONFIG_OPTION_PIC\n#error \"cache system does not support PIC yet\"\n#endif\n\n\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_cache\n\n#define FTC_LRU_GET_MANAGER( lru )  ( (FTC_Manager)(lru)->user_data )\n\n\n  static FT_Error\n  ftc_scaler_lookup_size( FTC_Manager  manager,\n                          FTC_Scaler   scaler,\n                          FT_Size     *asize )\n  {\n    FT_Face   face;\n    FT_Size   size = NULL;\n    FT_Error  error;\n\n\n    error = FTC_Manager_LookupFace( manager, scaler->face_id, &face );\n    if ( error )\n      goto Exit;\n\n    error = FT_New_Size( face, &size );\n    if ( error )\n      goto Exit;\n\n    FT_Activate_Size( size );\n\n    if ( scaler->pixel )\n      error = FT_Set_Pixel_Sizes( face, scaler->width, scaler->height );\n    else\n      error = FT_Set_Char_Size( face, scaler->width, scaler->height,\n                                scaler->x_res, scaler->y_res );\n    if ( error )\n    {\n      FT_Done_Size( size );\n      size = NULL;\n    }\n\n  Exit:\n    *asize = size;\n    return error;\n  }\n\n\n  typedef struct  FTC_SizeNodeRec_\n  {\n    FTC_MruNodeRec  node;\n    FT_Size         size;\n    FTC_ScalerRec   scaler;\n\n  } FTC_SizeNodeRec, *FTC_SizeNode;\n\n#define FTC_SIZE_NODE( x ) ( (FTC_SizeNode)( x ) )\n\n\n  FT_CALLBACK_DEF( void )\n  ftc_size_node_done( FTC_MruNode  ftcnode,\n                      FT_Pointer   data )\n  {\n    FTC_SizeNode  node = (FTC_SizeNode)ftcnode;\n    FT_Size       size = node->size;\n    FT_UNUSED( data );\n\n\n    if ( size )\n      FT_Done_Size( size );\n  }\n\n\n  FT_CALLBACK_DEF( FT_Bool )\n  ftc_size_node_compare( FTC_MruNode  ftcnode,\n                         FT_Pointer   ftcscaler )\n  {\n    FTC_SizeNode  node    = (FTC_SizeNode)ftcnode;\n    FTC_Scaler    scaler  = (FTC_Scaler)ftcscaler;\n    FTC_Scaler    scaler0 = &node->scaler;\n\n\n    if ( FTC_SCALER_COMPARE( scaler0, scaler ) )\n    {\n      FT_Activate_Size( node->size );\n      return 1;\n    }\n    return 0;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  ftc_size_node_init( FTC_MruNode  ftcnode,\n                      FT_Pointer   ftcscaler,\n                      FT_Pointer   ftcmanager )\n  {\n    FTC_SizeNode  node    = (FTC_SizeNode)ftcnode;\n    FTC_Scaler    scaler  = (FTC_Scaler)ftcscaler;\n    FTC_Manager   manager = (FTC_Manager)ftcmanager;\n\n\n    node->scaler = scaler[0];\n\n    return ftc_scaler_lookup_size( manager, scaler, &node->size );\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  ftc_size_node_reset( FTC_MruNode  ftcnode,\n                       FT_Pointer   ftcscaler,\n                       FT_Pointer   ftcmanager )\n  {\n    FTC_SizeNode  node    = (FTC_SizeNode)ftcnode;\n    FTC_Scaler    scaler  = (FTC_Scaler)ftcscaler;\n    FTC_Manager   manager = (FTC_Manager)ftcmanager;\n\n\n    FT_Done_Size( node->size );\n\n    node->scaler = scaler[0];\n\n    return ftc_scaler_lookup_size( manager, scaler, &node->size );\n  }\n\n\n  static\n  const FTC_MruListClassRec  ftc_size_list_class =\n  {\n    sizeof ( FTC_SizeNodeRec ),\n    ftc_size_node_compare,\n    ftc_size_node_init,\n    ftc_size_node_reset,\n    ftc_size_node_done\n  };\n\n\n  /* helper function used by ftc_face_node_done */\n  static FT_Bool\n  ftc_size_node_compare_faceid( FTC_MruNode  ftcnode,\n                                FT_Pointer   ftcface_id )\n  {\n    FTC_SizeNode  node    = (FTC_SizeNode)ftcnode;\n    FTC_FaceID    face_id = (FTC_FaceID)ftcface_id;\n\n\n    return FT_BOOL( node->scaler.face_id == face_id );\n  }\n\n\n  /* documentation is in ftcache.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FTC_Manager_LookupSize( FTC_Manager  manager,\n                          FTC_Scaler   scaler,\n                          FT_Size     *asize )\n  {\n    FT_Error     error;\n    FTC_MruNode  mrunode;\n\n\n    if ( !asize || !scaler )\n      return FT_THROW( Invalid_Argument );\n\n    *asize = NULL;\n\n    if ( !manager )\n      return FT_THROW( Invalid_Cache_Handle );\n\n#ifdef FTC_INLINE\n\n    FTC_MRULIST_LOOKUP_CMP( &manager->sizes, scaler, ftc_size_node_compare,\n                            mrunode, error );\n\n#else\n    error = FTC_MruList_Lookup( &manager->sizes, scaler, &mrunode );\n#endif\n\n    if ( !error )\n      *asize = FTC_SIZE_NODE( mrunode )->size;\n\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    FACE MRU IMPLEMENTATION                    *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct  FTC_FaceNodeRec_\n  {\n    FTC_MruNodeRec  node;\n    FTC_FaceID      face_id;\n    FT_Face         face;\n\n  } FTC_FaceNodeRec, *FTC_FaceNode;\n\n#define FTC_FACE_NODE( x ) ( ( FTC_FaceNode )( x ) )\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  ftc_face_node_init( FTC_MruNode  ftcnode,\n                      FT_Pointer   ftcface_id,\n                      FT_Pointer   ftcmanager )\n  {\n    FTC_FaceNode  node    = (FTC_FaceNode)ftcnode;\n    FTC_FaceID    face_id = (FTC_FaceID)ftcface_id;\n    FTC_Manager   manager = (FTC_Manager)ftcmanager;\n    FT_Error      error;\n\n\n    node->face_id = face_id;\n\n    error = manager->request_face( face_id,\n                                   manager->library,\n                                   manager->request_data,\n                                   &node->face );\n    if ( !error )\n    {\n      /* destroy initial size object; it will be re-created later */\n      if ( node->face->size )\n        FT_Done_Size( node->face->size );\n    }\n\n    return error;\n  }\n\n\n  FT_CALLBACK_DEF( void )\n  ftc_face_node_done( FTC_MruNode  ftcnode,\n                      FT_Pointer   ftcmanager )\n  {\n    FTC_FaceNode  node    = (FTC_FaceNode)ftcnode;\n    FTC_Manager   manager = (FTC_Manager)ftcmanager;\n\n\n    /* we must begin by removing all scalers for the target face */\n    /* from the manager's list                                   */\n    FTC_MruList_RemoveSelection( &manager->sizes,\n                                 ftc_size_node_compare_faceid,\n                                 node->face_id );\n\n    /* all right, we can discard the face now */\n    FT_Done_Face( node->face );\n    node->face    = NULL;\n    node->face_id = NULL;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Bool )\n  ftc_face_node_compare( FTC_MruNode  ftcnode,\n                         FT_Pointer   ftcface_id )\n  {\n    FTC_FaceNode  node    = (FTC_FaceNode)ftcnode;\n    FTC_FaceID    face_id = (FTC_FaceID)ftcface_id;\n\n\n    return FT_BOOL( node->face_id == face_id );\n  }\n\n\n  static\n  const FTC_MruListClassRec  ftc_face_list_class =\n  {\n    sizeof ( FTC_FaceNodeRec),\n\n    ftc_face_node_compare,\n    ftc_face_node_init,\n    0,                          /* FTC_MruNode_ResetFunc */\n    ftc_face_node_done\n  };\n\n\n  /* documentation is in ftcache.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FTC_Manager_LookupFace( FTC_Manager  manager,\n                          FTC_FaceID   face_id,\n                          FT_Face     *aface )\n  {\n    FT_Error     error;\n    FTC_MruNode  mrunode;\n\n\n    if ( !aface || !face_id )\n      return FT_THROW( Invalid_Argument );\n\n    *aface = NULL;\n\n    if ( !manager )\n      return FT_THROW( Invalid_Cache_Handle );\n\n    /* we break encapsulation for the sake of speed */\n#ifdef FTC_INLINE\n\n    FTC_MRULIST_LOOKUP_CMP( &manager->faces, face_id, ftc_face_node_compare,\n                            mrunode, error );\n\n#else\n    error = FTC_MruList_Lookup( &manager->faces, face_id, &mrunode );\n#endif\n\n    if ( !error )\n      *aface = FTC_FACE_NODE( mrunode )->face;\n\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    CACHE MANAGER ROUTINES                     *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* documentation is in ftcache.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FTC_Manager_New( FT_Library          library,\n                   FT_UInt             max_faces,\n                   FT_UInt             max_sizes,\n                   FT_ULong            max_bytes,\n                   FTC_Face_Requester  requester,\n                   FT_Pointer          req_data,\n                   FTC_Manager        *amanager )\n  {\n    FT_Error     error;\n    FT_Memory    memory;\n    FTC_Manager  manager = 0;\n\n\n    if ( !library )\n      return FT_THROW( Invalid_Library_Handle );\n\n    if ( !amanager || !requester )\n      return FT_THROW( Invalid_Argument );\n\n    memory = library->memory;\n\n    if ( FT_NEW( manager ) )\n      goto Exit;\n\n    if ( max_faces == 0 )\n      max_faces = FTC_MAX_FACES_DEFAULT;\n\n    if ( max_sizes == 0 )\n      max_sizes = FTC_MAX_SIZES_DEFAULT;\n\n    if ( max_bytes == 0 )\n      max_bytes = FTC_MAX_BYTES_DEFAULT;\n\n    manager->library      = library;\n    manager->memory       = memory;\n    manager->max_weight   = max_bytes;\n\n    manager->request_face = requester;\n    manager->request_data = req_data;\n\n    FTC_MruList_Init( &manager->faces,\n                      &ftc_face_list_class,\n                      max_faces,\n                      manager,\n                      memory );\n\n    FTC_MruList_Init( &manager->sizes,\n                      &ftc_size_list_class,\n                      max_sizes,\n                      manager,\n                      memory );\n\n    *amanager = manager;\n\n  Exit:\n    return error;\n  }\n\n\n  /* documentation is in ftcache.h */\n\n  FT_EXPORT_DEF( void )\n  FTC_Manager_Done( FTC_Manager  manager )\n  {\n    FT_Memory  memory;\n    FT_UInt    idx;\n\n\n    if ( !manager || !manager->library )\n      return;\n\n    memory = manager->memory;\n\n    /* now discard all caches */\n    for (idx = manager->num_caches; idx-- > 0; )\n    {\n      FTC_Cache  cache = manager->caches[idx];\n\n\n      if ( cache )\n      {\n        cache->clazz.cache_done( cache );\n        FT_FREE( cache );\n        manager->caches[idx] = NULL;\n      }\n    }\n    manager->num_caches = 0;\n\n    /* discard faces and sizes */\n    FTC_MruList_Done( &manager->sizes );\n    FTC_MruList_Done( &manager->faces );\n\n    manager->library = NULL;\n    manager->memory  = NULL;\n\n    FT_FREE( manager );\n  }\n\n\n  /* documentation is in ftcache.h */\n\n  FT_EXPORT_DEF( void )\n  FTC_Manager_Reset( FTC_Manager  manager )\n  {\n    if ( !manager )\n      return;\n\n    FTC_MruList_Reset( &manager->sizes );\n    FTC_MruList_Reset( &manager->faces );\n\n    FTC_Manager_FlushN( manager, manager->num_nodes );\n  }\n\n\n#ifdef FT_DEBUG_ERROR\n\n  static void\n  FTC_Manager_Check( FTC_Manager  manager )\n  {\n    FTC_Node  node, first;\n\n\n    first = manager->nodes_list;\n\n    /* check node weights */\n    if ( first )\n    {\n      FT_Offset  weight = 0;\n\n\n      node = first;\n\n      do\n      {\n        FTC_Cache  cache = manager->caches[node->cache_index];\n\n\n        if ( (FT_UInt)node->cache_index >= manager->num_caches )\n          FT_TRACE0(( \"FTC_Manager_Check: invalid node (cache index = %ld\\n\",\n                      node->cache_index ));\n        else\n          weight += cache->clazz.node_weight( node, cache );\n\n        node = FTC_NODE__NEXT( node );\n\n      } while ( node != first );\n\n      if ( weight != manager->cur_weight )\n        FT_TRACE0(( \"FTC_Manager_Check: invalid weight %ld instead of %ld\\n\",\n                    manager->cur_weight, weight ));\n    }\n\n    /* check circular list */\n    if ( first )\n    {\n      FT_UFast  count = 0;\n\n\n      node = first;\n      do\n      {\n        count++;\n        node = FTC_NODE__NEXT( node );\n\n      } while ( node != first );\n\n      if ( count != manager->num_nodes )\n        FT_TRACE0(( \"FTC_Manager_Check:\"\n                    \" invalid cache node count %d instead of %d\\n\",\n                    manager->num_nodes, count ));\n    }\n  }\n\n#endif /* FT_DEBUG_ERROR */\n\n\n  /* `Compress' the manager's data, i.e., get rid of old cache nodes */\n  /* that are not referenced anymore in order to limit the total     */\n  /* memory used by the cache.                                       */\n\n  /* documentation is in ftcmanag.h */\n\n  FT_LOCAL_DEF( void )\n  FTC_Manager_Compress( FTC_Manager  manager )\n  {\n    FTC_Node   node, first;\n\n\n    if ( !manager )\n      return;\n\n    first = manager->nodes_list;\n\n#ifdef FT_DEBUG_ERROR\n    FTC_Manager_Check( manager );\n\n    FT_TRACE0(( \"compressing, weight = %ld, max = %ld, nodes = %d\\n\",\n                manager->cur_weight, manager->max_weight,\n                manager->num_nodes ));\n#endif\n\n    if ( manager->cur_weight < manager->max_weight || first == NULL )\n      return;\n\n    /* go to last node -- it's a circular list */\n    node = FTC_NODE__PREV( first );\n    do\n    {\n      FTC_Node  prev;\n\n\n      prev = ( node == first ) ? NULL : FTC_NODE__PREV( node );\n\n      if ( node->ref_count <= 0 )\n        ftc_node_destroy( node, manager );\n\n      node = prev;\n\n    } while ( node && manager->cur_weight > manager->max_weight );\n  }\n\n\n  /* documentation is in ftcmanag.h */\n\n  FT_LOCAL_DEF( FT_Error )\n  FTC_Manager_RegisterCache( FTC_Manager      manager,\n                             FTC_CacheClass   clazz,\n                             FTC_Cache       *acache )\n  {\n    FT_Error   error = FT_ERR( Invalid_Argument );\n    FTC_Cache  cache = NULL;\n\n\n    if ( manager && clazz && acache )\n    {\n      FT_Memory  memory = manager->memory;\n\n\n      if ( manager->num_caches >= FTC_MAX_CACHES )\n      {\n        error = FT_THROW( Too_Many_Caches );\n        FT_ERROR(( \"FTC_Manager_RegisterCache:\"\n                   \" too many registered caches\\n\" ));\n        goto Exit;\n      }\n\n      if ( !FT_ALLOC( cache, clazz->cache_size ) )\n      {\n        cache->manager   = manager;\n        cache->memory    = memory;\n        cache->clazz     = clazz[0];\n        cache->org_class = clazz;\n\n        /* THIS IS VERY IMPORTANT!  IT WILL WRETCH THE MANAGER */\n        /* IF IT IS NOT SET CORRECTLY                          */\n        cache->index = manager->num_caches;\n\n        error = clazz->cache_init( cache );\n        if ( error )\n        {\n          clazz->cache_done( cache );\n          FT_FREE( cache );\n          goto Exit;\n        }\n\n        manager->caches[manager->num_caches++] = cache;\n      }\n    }\n\n  Exit:\n    if ( acache )\n      *acache = cache;\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_UInt )\n  FTC_Manager_FlushN( FTC_Manager  manager,\n                      FT_UInt      count )\n  {\n    FTC_Node  first = manager->nodes_list;\n    FTC_Node  node;\n    FT_UInt   result;\n\n\n    /* try to remove `count' nodes from the list */\n    if ( first == NULL )  /* empty list! */\n      return 0;\n\n    /* go to last node - it's a circular list */\n    node = FTC_NODE__PREV(first);\n    for ( result = 0; result < count; )\n    {\n      FTC_Node  prev = FTC_NODE__PREV( node );\n\n\n      /* don't touch locked nodes */\n      if ( node->ref_count <= 0 )\n      {\n        ftc_node_destroy( node, manager );\n        result++;\n      }\n\n      if ( node == first )\n        break;\n\n      node = prev;\n    }\n    return  result;\n  }\n\n\n  /* documentation is in ftcache.h */\n\n  FT_EXPORT_DEF( void )\n  FTC_Manager_RemoveFaceID( FTC_Manager  manager,\n                            FTC_FaceID   face_id )\n  {\n    FT_UInt  nn;\n\n\n    if ( !manager || !face_id )\n      return;\n\n    /* this will remove all FTC_SizeNode that correspond to\n     * the face_id as well\n     */\n    FTC_MruList_RemoveSelection( &manager->faces,\n                                 ftc_face_node_compare,\n                                 face_id );\n\n    for ( nn = 0; nn < manager->num_caches; nn++ )\n      FTC_Cache_RemoveFaceID( manager->caches[nn], face_id );\n  }\n\n\n  /* documentation is in ftcache.h */\n\n  FT_EXPORT_DEF( void )\n  FTC_Node_Unref( FTC_Node     node,\n                  FTC_Manager  manager )\n  {\n    if ( node                                             &&\n         manager                                          &&\n         (FT_UInt)node->cache_index < manager->num_caches )\n      node->ref_count--;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cache/ftcmanag.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcmanag.h                                                             */\n/*                                                                         */\n/*    FreeType Cache Manager (specification).                              */\n/*                                                                         */\n/*  Copyright 2000-2001, 2003, 2004, 2006, 2010, 2013 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* A cache manager is in charge of the following:                        */\n  /*                                                                       */\n  /*  - Maintain a mapping between generic FTC_FaceIDs and live FT_Face    */\n  /*    objects.  The mapping itself is performed through a user-provided  */\n  /*    callback.  However, the manager maintains a small cache of FT_Face */\n  /*    and FT_Size objects in order to speed up things considerably.      */\n  /*                                                                       */\n  /*  - Manage one or more cache objects.  Each cache is in charge of      */\n  /*    holding a varying number of `cache nodes'.  Each cache node        */\n  /*    represents a minimal amount of individually accessible cached      */\n  /*    data.  For example, a cache node can be an FT_Glyph image          */\n  /*    containing a vector outline, or some glyph metrics, or anything    */\n  /*    else.                                                              */\n  /*                                                                       */\n  /*    Each cache node has a certain size in bytes that is added to the   */\n  /*    total amount of `cache memory' within the manager.                 */\n  /*                                                                       */\n  /*    All cache nodes are located in a global LRU list, where the oldest */\n  /*    node is at the tail of the list.                                   */\n  /*                                                                       */\n  /*    Each node belongs to a single cache, and includes a reference      */\n  /*    count to avoid destroying it (due to caching).                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*********                                                       *********/\n  /*********             WARNING, THIS IS BETA CODE.               *********/\n  /*********                                                       *********/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n#ifndef __FTCMANAG_H__\n#define __FTCMANAG_H__\n\n\n#include <ft2build.h>\n#include FT_CACHE_H\n#include \"ftcmru.h\"\n#include \"ftccache.h\"\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    cache_subsystem                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#define FTC_MAX_FACES_DEFAULT  2\n#define FTC_MAX_SIZES_DEFAULT  4\n#define FTC_MAX_BYTES_DEFAULT  200000L  /* ~200kByte by default */\n\n  /* maximum number of caches registered in a single manager */\n#define FTC_MAX_CACHES         16\n\n\n  typedef struct  FTC_ManagerRec_\n  {\n    FT_Library          library;\n    FT_Memory           memory;\n\n    FTC_Node            nodes_list;\n    FT_Offset           max_weight;\n    FT_Offset           cur_weight;\n    FT_UInt             num_nodes;\n\n    FTC_Cache           caches[FTC_MAX_CACHES];\n    FT_UInt             num_caches;\n\n    FTC_MruListRec      faces;\n    FTC_MruListRec      sizes;\n\n    FT_Pointer          request_data;\n    FTC_Face_Requester  request_face;\n\n  } FTC_ManagerRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_Compress                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to check the state of the cache manager if   */\n  /*    its `num_bytes' field is greater than its `max_bytes' field.  It   */\n  /*    will flush as many old cache nodes as possible (ignoring cache     */\n  /*    nodes with a non-zero reference count).                            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    manager :: A handle to the cache manager.                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Client applications should not call this function directly.  It is */\n  /*    normally invoked by specific cache implementations.                */\n  /*                                                                       */\n  /*    The reason this function is exported is to allow client-specific   */\n  /*    cache classes.                                                     */\n  /*                                                                       */\n  FT_LOCAL( void )\n  FTC_Manager_Compress( FTC_Manager  manager );\n\n\n  /* try to flush `count' old nodes from the cache; return the number\n   * of really flushed nodes\n   */\n  FT_LOCAL( FT_UInt )\n  FTC_Manager_FlushN( FTC_Manager  manager,\n                      FT_UInt      count );\n\n\n  /* this must be used internally for the moment */\n  FT_LOCAL( FT_Error )\n  FTC_Manager_RegisterCache( FTC_Manager      manager,\n                             FTC_CacheClass   clazz,\n                             FTC_Cache       *acache );\n\n /* */\n\n#define FTC_SCALER_COMPARE( a, b )                \\\n    ( (a)->face_id      == (b)->face_id      &&   \\\n      (a)->width        == (b)->width        &&   \\\n      (a)->height       == (b)->height       &&   \\\n      ((a)->pixel != 0) == ((b)->pixel != 0) &&   \\\n      ( (a)->pixel ||                             \\\n        ( (a)->x_res == (b)->x_res &&             \\\n          (a)->y_res == (b)->y_res ) ) )\n\n#define FTC_SCALER_HASH( q )                                 \\\n    ( _FTC_FACE_ID_HASH( (q)->face_id ) +                     \\\n      (q)->width + (q)->height*7 +                           \\\n      ( (q)->pixel ? 0 : ( (q)->x_res*33 ^ (q)->y_res*61 ) ) )\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTCMANAG_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cache/ftcmru.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcmru.c                                                               */\n/*                                                                         */\n/*    FreeType MRU support (body).                                         */\n/*                                                                         */\n/*  Copyright 2003, 2004, 2006, 2009 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_CACHE_H\n#include \"ftcmru.h\"\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_DEBUG_H\n\n#include \"ftcerror.h\"\n\n\n  FT_LOCAL_DEF( void )\n  FTC_MruNode_Prepend( FTC_MruNode  *plist,\n                       FTC_MruNode   node )\n  {\n    FTC_MruNode  first = *plist;\n\n\n    if ( first )\n    {\n      FTC_MruNode  last = first->prev;\n\n\n#ifdef FT_DEBUG_ERROR\n      {\n        FTC_MruNode  cnode = first;\n\n\n        do\n        {\n          if ( cnode == node )\n          {\n            fprintf( stderr, \"FTC_MruNode_Prepend: invalid action\\n\" );\n            exit( 2 );\n          }\n          cnode = cnode->next;\n\n        } while ( cnode != first );\n      }\n#endif\n\n      first->prev = node;\n      last->next  = node;\n      node->next  = first;\n      node->prev  = last;\n    }\n    else\n    {\n      node->next = node;\n      node->prev = node;\n    }\n    *plist = node;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  FTC_MruNode_Up( FTC_MruNode  *plist,\n                  FTC_MruNode   node )\n  {\n    FTC_MruNode  first = *plist;\n\n\n    FT_ASSERT( first != NULL );\n\n    if ( first != node )\n    {\n      FTC_MruNode  prev, next, last;\n\n\n#ifdef FT_DEBUG_ERROR\n      {\n        FTC_MruNode  cnode = first;\n        do\n        {\n          if ( cnode == node )\n            goto Ok;\n          cnode = cnode->next;\n\n        } while ( cnode != first );\n\n        fprintf( stderr, \"FTC_MruNode_Up: invalid action\\n\" );\n        exit( 2 );\n      Ok:\n      }\n#endif\n      prev = node->prev;\n      next = node->next;\n\n      prev->next = next;\n      next->prev = prev;\n\n      last = first->prev;\n\n      last->next  = node;\n      first->prev = node;\n\n      node->next = first;\n      node->prev = last;\n\n      *plist = node;\n    }\n  }\n\n\n  FT_LOCAL_DEF( void )\n  FTC_MruNode_Remove( FTC_MruNode  *plist,\n                      FTC_MruNode   node )\n  {\n    FTC_MruNode  first = *plist;\n    FTC_MruNode  prev, next;\n\n\n    FT_ASSERT( first != NULL );\n\n#ifdef FT_DEBUG_ERROR\n      {\n        FTC_MruNode  cnode = first;\n\n\n        do\n        {\n          if ( cnode == node )\n            goto Ok;\n          cnode = cnode->next;\n\n        } while ( cnode != first );\n\n        fprintf( stderr, \"FTC_MruNode_Remove: invalid action\\n\" );\n        exit( 2 );\n      Ok:\n      }\n#endif\n\n    prev = node->prev;\n    next = node->next;\n\n    prev->next = next;\n    next->prev = prev;\n\n    if ( node == next )\n    {\n      FT_ASSERT( first == node );\n      FT_ASSERT( prev  == node );\n\n      *plist = NULL;\n    }\n    else if ( node == first )\n      *plist = next;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  FTC_MruList_Init( FTC_MruList       list,\n                    FTC_MruListClass  clazz,\n                    FT_UInt           max_nodes,\n                    FT_Pointer        data,\n                    FT_Memory         memory )\n  {\n    list->num_nodes = 0;\n    list->max_nodes = max_nodes;\n    list->nodes     = NULL;\n    list->clazz     = *clazz;\n    list->data      = data;\n    list->memory    = memory;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  FTC_MruList_Reset( FTC_MruList  list )\n  {\n    while ( list->nodes )\n      FTC_MruList_Remove( list, list->nodes );\n\n    FT_ASSERT( list->num_nodes == 0 );\n  }\n\n\n  FT_LOCAL_DEF( void )\n  FTC_MruList_Done( FTC_MruList  list )\n  {\n    FTC_MruList_Reset( list );\n  }\n\n\n#ifndef FTC_INLINE\n  FT_LOCAL_DEF( FTC_MruNode )\n  FTC_MruList_Find( FTC_MruList  list,\n                    FT_Pointer   key )\n  {\n    FTC_MruNode_CompareFunc  compare = list->clazz.node_compare;\n    FTC_MruNode              first, node;\n\n\n    first = list->nodes;\n    node  = NULL;\n\n    if ( first )\n    {\n      node = first;\n      do\n      {\n        if ( compare( node, key ) )\n        {\n          if ( node != first )\n            FTC_MruNode_Up( &list->nodes, node );\n\n          return node;\n        }\n\n        node = node->next;\n\n      } while ( node != first);\n    }\n\n    return NULL;\n  }\n#endif\n\n  FT_LOCAL_DEF( FT_Error )\n  FTC_MruList_New( FTC_MruList   list,\n                   FT_Pointer    key,\n                   FTC_MruNode  *anode )\n  {\n    FT_Error     error;\n    FTC_MruNode  node = NULL;\n    FT_Memory    memory = list->memory;\n\n\n    if ( list->num_nodes >= list->max_nodes && list->max_nodes > 0 )\n    {\n      node = list->nodes->prev;\n\n      FT_ASSERT( node );\n\n      if ( list->clazz.node_reset )\n      {\n        FTC_MruNode_Up( &list->nodes, node );\n\n        error = list->clazz.node_reset( node, key, list->data );\n        if ( !error )\n          goto Exit;\n      }\n\n      FTC_MruNode_Remove( &list->nodes, node );\n      list->num_nodes--;\n\n      if ( list->clazz.node_done )\n        list->clazz.node_done( node, list->data );\n    }\n    else if ( FT_ALLOC( node, list->clazz.node_size ) )\n      goto Exit;\n\n    error = list->clazz.node_init( node, key, list->data );\n    if ( error )\n      goto Fail;\n\n    FTC_MruNode_Prepend( &list->nodes, node );\n    list->num_nodes++;\n\n  Exit:\n    *anode = node;\n    return error;\n\n  Fail:\n    if ( list->clazz.node_done )\n      list->clazz.node_done( node, list->data );\n\n    FT_FREE( node );\n    goto Exit;\n  }\n\n\n#ifndef FTC_INLINE\n  FT_LOCAL_DEF( FT_Error )\n  FTC_MruList_Lookup( FTC_MruList   list,\n                      FT_Pointer    key,\n                      FTC_MruNode  *anode )\n  {\n    FTC_MruNode  node;\n\n\n    node = FTC_MruList_Find( list, key );\n    if ( node == NULL )\n      return FTC_MruList_New( list, key, anode );\n\n    *anode = node;\n    return 0;\n  }\n#endif /* FTC_INLINE */\n\n  FT_LOCAL_DEF( void )\n  FTC_MruList_Remove( FTC_MruList  list,\n                      FTC_MruNode  node )\n  {\n    FTC_MruNode_Remove( &list->nodes, node );\n    list->num_nodes--;\n\n    {\n      FT_Memory  memory = list->memory;\n\n\n      if ( list->clazz.node_done )\n        list->clazz.node_done( node, list->data );\n\n      FT_FREE( node );\n    }\n  }\n\n\n  FT_LOCAL_DEF( void )\n  FTC_MruList_RemoveSelection( FTC_MruList              list,\n                               FTC_MruNode_CompareFunc  selection,\n                               FT_Pointer               key )\n  {\n    FTC_MruNode  first, node, next;\n\n\n    first = list->nodes;\n    while ( first && ( selection == NULL || selection( first, key ) ) )\n    {\n      FTC_MruList_Remove( list, first );\n      first = list->nodes;\n    }\n\n    if ( first )\n    {\n      node = first->next;\n      while ( node != first )\n      {\n        next = node->next;\n\n        if ( selection( node, key ) )\n          FTC_MruList_Remove( list, node );\n\n        node = next;\n      }\n    }\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cache/ftcmru.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcmru.h                                                               */\n/*                                                                         */\n/*    Simple MRU list-cache (specification).                               */\n/*                                                                         */\n/*  Copyright 2000-2001, 2003-2006, 2010, 2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* An MRU is a list that cannot hold more than a certain number of       */\n  /* elements (`max_elements').  All elements in the list are sorted in    */\n  /* least-recently-used order, i.e., the `oldest' element is at the tail  */\n  /* of the list.                                                          */\n  /*                                                                       */\n  /* When doing a lookup (either through `Lookup()' or `Lookup_Node()'),   */\n  /* the list is searched for an element with the corresponding key.  If   */\n  /* it is found, the element is moved to the head of the list and is      */\n  /* returned.                                                             */\n  /*                                                                       */\n  /* If no corresponding element is found, the lookup routine will try to  */\n  /* obtain a new element with the relevant key.  If the list is already   */\n  /* full, the oldest element from the list is discarded and replaced by a */\n  /* new one; a new element is added to the list otherwise.                */\n  /*                                                                       */\n  /* Note that it is possible to pre-allocate the element list nodes.      */\n  /* This is handy if `max_elements' is sufficiently small, as it saves    */\n  /* allocations/releases during the lookup process.                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTCMRU_H__\n#define __FTCMRU_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n#define  xxFT_DEBUG_ERROR\n#define  FTC_INLINE\n\nFT_BEGIN_HEADER\n\n  typedef struct FTC_MruNodeRec_*  FTC_MruNode;\n\n  typedef struct  FTC_MruNodeRec_\n  {\n    FTC_MruNode  next;\n    FTC_MruNode  prev;\n\n  } FTC_MruNodeRec;\n\n\n  FT_LOCAL( void )\n  FTC_MruNode_Prepend( FTC_MruNode  *plist,\n                       FTC_MruNode   node );\n\n  FT_LOCAL( void )\n  FTC_MruNode_Up( FTC_MruNode  *plist,\n                  FTC_MruNode   node );\n\n  FT_LOCAL( void )\n  FTC_MruNode_Remove( FTC_MruNode  *plist,\n                      FTC_MruNode   node );\n\n\n  typedef struct FTC_MruListRec_*              FTC_MruList;\n\n  typedef struct FTC_MruListClassRec_ const *  FTC_MruListClass;\n\n\n  typedef FT_Bool\n  (*FTC_MruNode_CompareFunc)( FTC_MruNode  node,\n                              FT_Pointer   key );\n\n  typedef FT_Error\n  (*FTC_MruNode_InitFunc)( FTC_MruNode  node,\n                           FT_Pointer   key,\n                           FT_Pointer   data );\n\n  typedef FT_Error\n  (*FTC_MruNode_ResetFunc)( FTC_MruNode  node,\n                            FT_Pointer   key,\n                            FT_Pointer   data );\n\n  typedef void\n  (*FTC_MruNode_DoneFunc)( FTC_MruNode  node,\n                           FT_Pointer   data );\n\n\n  typedef struct  FTC_MruListClassRec_\n  {\n    FT_Offset                node_size;\n    FTC_MruNode_CompareFunc  node_compare;\n    FTC_MruNode_InitFunc     node_init;\n    FTC_MruNode_ResetFunc    node_reset;\n    FTC_MruNode_DoneFunc     node_done;\n\n  } FTC_MruListClassRec;\n\n  typedef struct  FTC_MruListRec_\n  {\n    FT_UInt              num_nodes;\n    FT_UInt              max_nodes;\n    FTC_MruNode          nodes;\n    FT_Pointer           data;\n    FTC_MruListClassRec  clazz;\n    FT_Memory            memory;\n\n  } FTC_MruListRec;\n\n\n  FT_LOCAL( void )\n  FTC_MruList_Init( FTC_MruList       list,\n                    FTC_MruListClass  clazz,\n                    FT_UInt           max_nodes,\n                    FT_Pointer        data,\n                    FT_Memory         memory );\n\n  FT_LOCAL( void )\n  FTC_MruList_Reset( FTC_MruList  list );\n\n\n  FT_LOCAL( void )\n  FTC_MruList_Done( FTC_MruList  list );\n\n\n  FT_LOCAL( FT_Error )\n  FTC_MruList_New( FTC_MruList   list,\n                   FT_Pointer    key,\n                   FTC_MruNode  *anode );\n\n  FT_LOCAL( void )\n  FTC_MruList_Remove( FTC_MruList  list,\n                      FTC_MruNode  node );\n\n  FT_LOCAL( void )\n  FTC_MruList_RemoveSelection( FTC_MruList              list,\n                               FTC_MruNode_CompareFunc  selection,\n                               FT_Pointer               key );\n\n\n#ifdef FTC_INLINE\n\n#define FTC_MRULIST_LOOKUP_CMP( list, key, compare, node, error )           \\\n  FT_BEGIN_STMNT                                                            \\\n    FTC_MruNode*             _pfirst  = &(list)->nodes;                     \\\n    FTC_MruNode_CompareFunc  _compare = (FTC_MruNode_CompareFunc)(compare); \\\n    FTC_MruNode              _first, _node;                                 \\\n                                                                            \\\n                                                                            \\\n    error  = FT_Err_Ok;                                                     \\\n    _first = *(_pfirst);                                                    \\\n    _node  = NULL;                                                          \\\n                                                                            \\\n    if ( _first )                                                           \\\n    {                                                                       \\\n      _node = _first;                                                       \\\n      do                                                                    \\\n      {                                                                     \\\n        if ( _compare( _node, (key) ) )                                     \\\n        {                                                                   \\\n          if ( _node != _first )                                            \\\n            FTC_MruNode_Up( _pfirst, _node );                               \\\n                                                                            \\\n          node = _node;                                                     \\\n          goto _MruOk;                                                      \\\n        }                                                                   \\\n        _node = _node->next;                                                \\\n                                                                            \\\n      } while ( _node != _first) ;                                          \\\n    }                                                                       \\\n                                                                            \\\n    error = FTC_MruList_New( (list), (key), (FTC_MruNode*)(void*)&(node) ); \\\n  _MruOk:                                                                   \\\n    ;                                                                       \\\n  FT_END_STMNT\n\n#define FTC_MRULIST_LOOKUP( list, key, node, error ) \\\n  FTC_MRULIST_LOOKUP_CMP( list, key, (list)->clazz.node_compare, node, error )\n\n#else  /* !FTC_INLINE */\n\n  FT_LOCAL( FTC_MruNode )\n  FTC_MruList_Find( FTC_MruList  list,\n                    FT_Pointer   key );\n\n  FT_LOCAL( FT_Error )\n  FTC_MruList_Lookup( FTC_MruList   list,\n                      FT_Pointer    key,\n                      FTC_MruNode  *pnode );\n\n#define FTC_MRULIST_LOOKUP( list, key, node, error ) \\\n  error = FTC_MruList_Lookup( (list), (key), (FTC_MruNode*)&(node) )\n\n#endif /* !FTC_INLINE */\n\n\n#define FTC_MRULIST_LOOP( list, node )        \\\n  FT_BEGIN_STMNT                              \\\n    FTC_MruNode  _first = (list)->nodes;      \\\n                                              \\\n                                              \\\n    if ( _first )                             \\\n    {                                         \\\n      FTC_MruNode  _node = _first;            \\\n                                              \\\n                                              \\\n      do                                      \\\n      {                                       \\\n        *(FTC_MruNode*)&(node) = _node;\n\n\n#define FTC_MRULIST_LOOP_END()               \\\n        _node = _node->next;                 \\\n                                             \\\n      } while ( _node != _first );           \\\n    }                                        \\\n  FT_END_STMNT\n\n /* */\n\nFT_END_HEADER\n\n\n#endif /* __FTCMRU_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cache/ftcsbits.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcsbits.c                                                             */\n/*                                                                         */\n/*    FreeType sbits manager (body).                                       */\n/*                                                                         */\n/*  Copyright 2000-2006, 2009-2011, 2013, 2014 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_CACHE_H\n#include \"ftcsbits.h\"\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_ERRORS_H\n\n#include \"ftccback.h\"\n#include \"ftcerror.h\"\n\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_cache\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                     SBIT CACHE NODES                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  static FT_Error\n  ftc_sbit_copy_bitmap( FTC_SBit    sbit,\n                        FT_Bitmap*  bitmap,\n                        FT_Memory   memory )\n  {\n    FT_Error  error;\n    FT_Int    pitch = bitmap->pitch;\n    FT_ULong  size;\n\n\n    if ( pitch < 0 )\n      pitch = -pitch;\n\n    size = (FT_ULong)( pitch * bitmap->rows );\n\n    if ( !FT_ALLOC( sbit->buffer, size ) )\n      FT_MEM_COPY( sbit->buffer, bitmap->buffer, size );\n\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  ftc_snode_free( FTC_Node   ftcsnode,\n                  FTC_Cache  cache )\n  {\n    FTC_SNode  snode  = (FTC_SNode)ftcsnode;\n    FTC_SBit   sbit   = snode->sbits;\n    FT_UInt    count  = snode->count;\n    FT_Memory  memory = cache->memory;\n\n\n    for ( ; count > 0; sbit++, count-- )\n      FT_FREE( sbit->buffer );\n\n    FTC_GNode_Done( FTC_GNODE( snode ), cache );\n\n    FT_FREE( snode );\n  }\n\n\n  FT_LOCAL_DEF( void )\n  FTC_SNode_Free( FTC_SNode  snode,\n                  FTC_Cache  cache )\n  {\n    ftc_snode_free( FTC_NODE( snode ), cache );\n  }\n\n\n  /*\n   *  This function tries to load a small bitmap within a given FTC_SNode.\n   *  Note that it returns a non-zero error code _only_ in the case of\n   *  out-of-memory condition.  For all other errors (e.g., corresponding\n   *  to a bad font file), this function will mark the sbit as `unavailable'\n   *  and return a value of 0.\n   *\n   *  You should also read the comment within the @ftc_snode_compare\n   *  function below to see how out-of-memory is handled during a lookup.\n   */\n  static FT_Error\n  ftc_snode_load( FTC_SNode    snode,\n                  FTC_Manager  manager,\n                  FT_UInt      gindex,\n                  FT_ULong    *asize )\n  {\n    FT_Error          error;\n    FTC_GNode         gnode  = FTC_GNODE( snode );\n    FTC_Family        family = gnode->family;\n    FT_Memory         memory = manager->memory;\n    FT_Face           face;\n    FTC_SBit          sbit;\n    FTC_SFamilyClass  clazz;\n\n\n    if ( (FT_UInt)(gindex - gnode->gindex) >= snode->count )\n    {\n      FT_ERROR(( \"ftc_snode_load: invalid glyph index\" ));\n      return FT_THROW( Invalid_Argument );\n    }\n\n    sbit  = snode->sbits + ( gindex - gnode->gindex );\n    clazz = (FTC_SFamilyClass)family->clazz;\n\n    sbit->buffer = 0;\n\n    error = clazz->family_load_glyph( family, gindex, manager, &face );\n    if ( error )\n      goto BadGlyph;\n\n    {\n      FT_Int        temp;\n      FT_GlyphSlot  slot   = face->glyph;\n      FT_Bitmap*    bitmap = &slot->bitmap;\n      FT_Pos        xadvance, yadvance; /* FT_GlyphSlot->advance.{x|y} */\n\n\n      if ( slot->format != FT_GLYPH_FORMAT_BITMAP )\n      {\n        FT_TRACE0(( \"ftc_snode_load:\"\n                    \" glyph loaded didn't return a bitmap\\n\" ));\n        goto BadGlyph;\n      }\n\n      /* Check whether our values fit into 8-bit containers!    */\n      /* If this is not the case, our bitmap is too large       */\n      /* and we will leave it as `missing' with sbit.buffer = 0 */\n\n#define CHECK_CHAR( d )  ( temp = (FT_Char)d, (FT_Int) temp == (FT_Int) d )\n#define CHECK_BYTE( d )  ( temp = (FT_Byte)d, (FT_UInt)temp == (FT_UInt)d )\n\n      /* horizontal advance in pixels */\n      xadvance = ( slot->advance.x + 32 ) >> 6;\n      yadvance = ( slot->advance.y + 32 ) >> 6;\n\n      if ( !CHECK_BYTE( bitmap->rows  )     ||\n           !CHECK_BYTE( bitmap->width )     ||\n           !CHECK_CHAR( bitmap->pitch )     ||\n           !CHECK_CHAR( slot->bitmap_left ) ||\n           !CHECK_CHAR( slot->bitmap_top  ) ||\n           !CHECK_CHAR( xadvance )          ||\n           !CHECK_CHAR( yadvance )          )\n      {\n        FT_TRACE2(( \"ftc_snode_load:\"\n                    \" glyph too large for small bitmap cache\\n\"));\n        goto BadGlyph;\n      }\n\n      sbit->width     = (FT_Byte)bitmap->width;\n      sbit->height    = (FT_Byte)bitmap->rows;\n      sbit->pitch     = (FT_Char)bitmap->pitch;\n      sbit->left      = (FT_Char)slot->bitmap_left;\n      sbit->top       = (FT_Char)slot->bitmap_top;\n      sbit->xadvance  = (FT_Char)xadvance;\n      sbit->yadvance  = (FT_Char)yadvance;\n      sbit->format    = (FT_Byte)bitmap->pixel_mode;\n      sbit->max_grays = (FT_Byte)(bitmap->num_grays - 1);\n\n      /* copy the bitmap into a new buffer -- ignore error */\n      error = ftc_sbit_copy_bitmap( sbit, bitmap, memory );\n\n      /* now, compute size */\n      if ( asize )\n        *asize = FT_ABS( sbit->pitch ) * sbit->height;\n\n    } /* glyph loading successful */\n\n    /* ignore the errors that might have occurred --   */\n    /* we mark unloaded glyphs with `sbit.buffer == 0' */\n    /* and `width == 255', `height == 0'               */\n    /*                                                 */\n    if ( error && FT_ERR_NEQ( error, Out_Of_Memory ) )\n    {\n    BadGlyph:\n      sbit->width  = 255;\n      sbit->height = 0;\n      sbit->buffer = NULL;\n      error        = FT_Err_Ok;\n      if ( asize )\n        *asize = 0;\n    }\n\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  FTC_SNode_New( FTC_SNode  *psnode,\n                 FTC_GQuery  gquery,\n                 FTC_Cache   cache )\n  {\n    FT_Memory   memory = cache->memory;\n    FT_Error    error;\n    FTC_SNode   snode  = NULL;\n    FT_UInt     gindex = gquery->gindex;\n    FTC_Family  family = gquery->family;\n\n    FTC_SFamilyClass  clazz = FTC_CACHE__SFAMILY_CLASS( cache );\n    FT_UInt           total;\n    FT_UInt           node_count;\n\n\n    total = clazz->family_get_count( family, cache->manager );\n    if ( total == 0 || gindex >= total )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    if ( !FT_NEW( snode ) )\n    {\n      FT_UInt  count, start;\n\n\n      start = gindex - ( gindex % FTC_SBIT_ITEMS_PER_NODE );\n      count = total - start;\n      if ( count > FTC_SBIT_ITEMS_PER_NODE )\n        count = FTC_SBIT_ITEMS_PER_NODE;\n\n      FTC_GNode_Init( FTC_GNODE( snode ), start, family );\n\n      snode->count = count;\n      for ( node_count = 0; node_count < count; node_count++ )\n      {\n        snode->sbits[node_count].width = 255;\n      }\n\n      error = ftc_snode_load( snode,\n                              cache->manager,\n                              gindex,\n                              NULL );\n      if ( error )\n      {\n        FTC_SNode_Free( snode, cache );\n        snode = NULL;\n      }\n    }\n\n  Exit:\n    *psnode = snode;\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  ftc_snode_new( FTC_Node   *ftcpsnode,\n                 FT_Pointer  ftcgquery,\n                 FTC_Cache   cache )\n  {\n    FTC_SNode  *psnode = (FTC_SNode*)ftcpsnode;\n    FTC_GQuery  gquery = (FTC_GQuery)ftcgquery;\n\n\n    return FTC_SNode_New( psnode, gquery, cache );\n  }\n\n\n  FT_LOCAL_DEF( FT_Offset )\n  ftc_snode_weight( FTC_Node   ftcsnode,\n                    FTC_Cache  cache )\n  {\n    FTC_SNode  snode = (FTC_SNode)ftcsnode;\n    FT_UInt    count = snode->count;\n    FTC_SBit   sbit  = snode->sbits;\n    FT_Int     pitch;\n    FT_Offset  size;\n\n    FT_UNUSED( cache );\n\n\n    FT_ASSERT( snode->count <= FTC_SBIT_ITEMS_PER_NODE );\n\n    /* the node itself */\n    size = sizeof ( *snode );\n\n    for ( ; count > 0; count--, sbit++ )\n    {\n      if ( sbit->buffer )\n      {\n        pitch = sbit->pitch;\n        if ( pitch < 0 )\n          pitch = -pitch;\n\n        /* add the size of a given glyph image */\n        size += pitch * sbit->height;\n      }\n    }\n\n    return size;\n  }\n\n\n#if 0\n\n  FT_LOCAL_DEF( FT_Offset )\n  FTC_SNode_Weight( FTC_SNode  snode )\n  {\n    return ftc_snode_weight( FTC_NODE( snode ), NULL );\n  }\n\n#endif /* 0 */\n\n\n  FT_LOCAL_DEF( FT_Bool )\n  ftc_snode_compare( FTC_Node    ftcsnode,\n                     FT_Pointer  ftcgquery,\n                     FTC_Cache   cache,\n                     FT_Bool*    list_changed )\n  {\n    FTC_SNode   snode  = (FTC_SNode)ftcsnode;\n    FTC_GQuery  gquery = (FTC_GQuery)ftcgquery;\n    FTC_GNode   gnode  = FTC_GNODE( snode );\n    FT_UInt     gindex = gquery->gindex;\n    FT_Bool     result;\n\n\n    if (list_changed)\n      *list_changed = FALSE;\n    result = FT_BOOL( gnode->family == gquery->family                    &&\n                      (FT_UInt)( gindex - gnode->gindex ) < snode->count );\n    if ( result )\n    {\n      /* check if we need to load the glyph bitmap now */\n      FTC_SBit  sbit = snode->sbits + ( gindex - gnode->gindex );\n\n\n      /*\n       *  The following code illustrates what to do when you want to\n       *  perform operations that may fail within a lookup function.\n       *\n       *  Here, we want to load a small bitmap on-demand; we thus\n       *  need to call the `ftc_snode_load' function which may return\n       *  a non-zero error code only when we are out of memory (OOM).\n       *\n       *  The correct thing to do is to use @FTC_CACHE_TRYLOOP and\n       *  @FTC_CACHE_TRYLOOP_END in order to implement a retry loop\n       *  that is capable of flushing the cache incrementally when\n       *  an OOM errors occur.\n       *\n       *  However, we need to `lock' the node before this operation to\n       *  prevent it from being flushed within the loop.\n       *\n       *  When we exit the loop, we unlock the node, then check the `error'\n       *  variable.  If it is non-zero, this means that the cache was\n       *  completely flushed and that no usable memory was found to load\n       *  the bitmap.\n       *\n       *  We then prefer to return a value of 0 (i.e., NO MATCH).  This\n       *  ensures that the caller will try to allocate a new node.\n       *  This operation consequently _fail_ and the lookup function\n       *  returns the appropriate OOM error code.\n       *\n       *  Note that `buffer == NULL && width == 255' is a hack used to\n       *  tag `unavailable' bitmaps in the array.  We should never try\n       *  to load these.\n       *\n       */\n\n      if ( sbit->buffer == NULL && sbit->width == 255 )\n      {\n        FT_ULong  size;\n        FT_Error  error;\n\n\n        ftcsnode->ref_count++;  /* lock node to prevent flushing */\n                                /* in retry loop                 */\n\n        FTC_CACHE_TRYLOOP( cache )\n        {\n          error = ftc_snode_load( snode, cache->manager, gindex, &size );\n        }\n        FTC_CACHE_TRYLOOP_END( list_changed );\n\n        ftcsnode->ref_count--;  /* unlock the node */\n\n        if ( error )\n          result = 0;\n        else\n          cache->manager->cur_weight += size;\n      }\n    }\n\n    return result;\n  }\n\n\n#ifdef FTC_INLINE\n\n  FT_LOCAL_DEF( FT_Bool )\n  FTC_SNode_Compare( FTC_SNode   snode,\n                     FTC_GQuery  gquery,\n                     FTC_Cache   cache,\n                     FT_Bool*    list_changed )\n  {\n    return ftc_snode_compare( FTC_NODE( snode ), gquery,\n                              cache, list_changed );\n  }\n\n#endif\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cache/ftcsbits.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcsbits.h                                                             */\n/*                                                                         */\n/*    A small-bitmap cache (specification).                                */\n/*                                                                         */\n/*  Copyright 2000-2001, 2002, 2003, 2006, 2011 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCSBITS_H__\n#define __FTCSBITS_H__\n\n\n#include <ft2build.h>\n#include FT_CACHE_H\n#include \"ftcglyph.h\"\n\n\nFT_BEGIN_HEADER\n\n#define FTC_SBIT_ITEMS_PER_NODE  16\n\n  typedef struct  FTC_SNodeRec_\n  {\n    FTC_GNodeRec  gnode;\n    FT_UInt       count;\n    FTC_SBitRec   sbits[FTC_SBIT_ITEMS_PER_NODE];\n\n  } FTC_SNodeRec, *FTC_SNode;\n\n\n#define FTC_SNODE( x )         ( (FTC_SNode)( x ) )\n#define FTC_SNODE_GINDEX( x )  FTC_GNODE( x )->gindex\n#define FTC_SNODE_FAMILY( x )  FTC_GNODE( x )->family\n\n  typedef FT_UInt\n  (*FTC_SFamily_GetCountFunc)( FTC_Family   family,\n                               FTC_Manager  manager );\n\n  typedef FT_Error\n  (*FTC_SFamily_LoadGlyphFunc)( FTC_Family   family,\n                                FT_UInt      gindex,\n                                FTC_Manager  manager,\n                                FT_Face     *aface );\n\n  typedef struct  FTC_SFamilyClassRec_\n  {\n    FTC_MruListClassRec        clazz;\n    FTC_SFamily_GetCountFunc   family_get_count;\n    FTC_SFamily_LoadGlyphFunc  family_load_glyph;\n\n  } FTC_SFamilyClassRec;\n\n  typedef const FTC_SFamilyClassRec*  FTC_SFamilyClass;\n\n#define FTC_SFAMILY_CLASS( x )  ((FTC_SFamilyClass)(x))\n\n#define FTC_CACHE__SFAMILY_CLASS( x )  \\\n          FTC_SFAMILY_CLASS( FTC_CACHE__GCACHE_CLASS( x )->family_class )\n\n\n  FT_LOCAL( void )\n  FTC_SNode_Free( FTC_SNode  snode,\n                  FTC_Cache  cache );\n\n  FT_LOCAL( FT_Error )\n  FTC_SNode_New( FTC_SNode   *psnode,\n                 FTC_GQuery   gquery,\n                 FTC_Cache    cache );\n\n#if 0\n  FT_LOCAL( FT_ULong )\n  FTC_SNode_Weight( FTC_SNode  inode );\n#endif\n\n\n#ifdef FTC_INLINE\n\n  FT_LOCAL( FT_Bool )\n  FTC_SNode_Compare( FTC_SNode   snode,\n                     FTC_GQuery  gquery,\n                     FTC_Cache   cache,\n                     FT_Bool*    list_changed);\n\n#endif\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __FTCSBITS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cache/rules.mk",
    "content": "#\n# FreeType 2 Cache configuration rules\n#\n\n\n# Copyright 2000, 2001, 2003, 2004, 2006, 2008 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\n# Cache driver directory\n#\nCACHE_DIR   := $(SRC_DIR)/cache\n\n# compilation flags for the driver\n#\nCACHE_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(CACHE_DIR))\n\n\n# Cache driver sources (i.e., C files)\n#\nCACHE_DRV_SRC := $(CACHE_DIR)/ftcbasic.c \\\n                 $(CACHE_DIR)/ftccache.c \\\n                 $(CACHE_DIR)/ftccmap.c  \\\n                 $(CACHE_DIR)/ftcglyph.c \\\n                 $(CACHE_DIR)/ftcimage.c \\\n                 $(CACHE_DIR)/ftcmanag.c \\\n                 $(CACHE_DIR)/ftcmru.c   \\\n                 $(CACHE_DIR)/ftcsbits.c\n\n# Cache driver headers\n#\nCACHE_DRV_H := $(CACHE_DIR)/ftccache.h \\\n               $(CACHE_DIR)/ftccback.h \\\n               $(CACHE_DIR)/ftcerror.h \\\n               $(CACHE_DIR)/ftcglyph.h \\\n               $(CACHE_DIR)/ftcimage.h \\\n               $(CACHE_DIR)/ftcmanag.h \\\n               $(CACHE_DIR)/ftcmru.h   \\\n               $(CACHE_DIR)/ftcsbits.h\n\n\n# Cache driver object(s)\n#\n#   CACHE_DRV_OBJ_M is used during `multi' builds.\n#   CACHE_DRV_OBJ_S is used during `single' builds.\n#\nCACHE_DRV_OBJ_M := $(CACHE_DRV_SRC:$(CACHE_DIR)/%.c=$(OBJ_DIR)/%.$O)\nCACHE_DRV_OBJ_S := $(OBJ_DIR)/ftcache.$O\n\n# Cache driver source file for single build\n#\nCACHE_DRV_SRC_S := $(CACHE_DIR)/ftcache.c\n\n\n# Cache driver - single object\n#\n$(CACHE_DRV_OBJ_S): $(CACHE_DRV_SRC_S) $(CACHE_DRV_SRC) \\\n                   $(FREETYPE_H) $(CACHE_DRV_H)\n\t$(CACHE_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(CACHE_DRV_SRC_S))\n\n\n# Cache driver - multiple objects\n#\n$(OBJ_DIR)/%.$O: $(CACHE_DIR)/%.c $(FREETYPE_H) $(CACHE_DRV_H)\n\t$(CACHE_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\n\n\n# update main driver object lists\n#\nDRV_OBJS_S += $(CACHE_DRV_OBJ_S)\nDRV_OBJS_M += $(CACHE_DRV_OBJ_M)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/cff/Jamfile",
    "content": "# FreeType 2 src/cff Jamfile\n#\n# Copyright 2001, 2002 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) cff ;\n\n{\n  local  _sources ;\n\n  if $(FT2_MULTI)\n  {\n    _sources = cffdrivr cffgload cffload cffobjs cffparse cffcmap cffpic ;\n  }\n  else\n  {\n    _sources = cff ;\n  }\n\n  Library  $(FT2_LIB) : $(_sources).c ;\n}\n\n# end of src/cff Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/cff/cf2arrst.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cf2arrst.c                                                             */\n/*                                                                         */\n/*    Adobe's code for Array Stacks (body).                                */\n/*                                                                         */\n/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */\n/*                                                                         */\n/*  This software, and all works of authorship, whether in source or       */\n/*  object code form as indicated by the copyright notice(s) included      */\n/*  herein (collectively, the \"Work\") is made available, and may only be   */\n/*  used, modified, and distributed under the FreeType Project License,    */\n/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */\n/*  FreeType Project License, each contributor to the Work hereby grants   */\n/*  to any individual or legal entity exercising permissions granted by    */\n/*  the FreeType Project License and this section (hereafter, \"You\" or     */\n/*  \"Your\") a perpetual, worldwide, non-exclusive, no-charge,              */\n/*  royalty-free, irrevocable (except as stated in this section) patent    */\n/*  license to make, have made, use, offer to sell, sell, import, and      */\n/*  otherwise transfer the Work, where such license applies only to those  */\n/*  patent claims licensable by such contributor that are necessarily      */\n/*  infringed by their contribution(s) alone or by combination of their    */\n/*  contribution(s) with the Work to which such contribution(s) was        */\n/*  submitted.  If You institute patent litigation against any entity      */\n/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */\n/*  the Work or a contribution incorporated within the Work constitutes    */\n/*  direct or contributory patent infringement, then any patent licenses   */\n/*  granted to You under this License for that Work shall terminate as of  */\n/*  the date such litigation is filed.                                     */\n/*                                                                         */\n/*  By using, modifying, or distributing the Work you indicate that you    */\n/*  have read and understood the terms and conditions of the               */\n/*  FreeType Project License as well as those provided in this section,    */\n/*  and you accept them fully.                                             */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"cf2ft.h\"\n#include FT_INTERNAL_DEBUG_H\n\n#include \"cf2glue.h\"\n#include \"cf2arrst.h\"\n\n#include \"cf2error.h\"\n\n\n  /*\n   * CF2_ArrStack uses an error pointer, to enable shared errors.\n   * Shared errors are necessary when multiple objects allow the program\n   * to continue after detecting errors.  Only the first error should be\n   * recorded.\n   */\n\n  FT_LOCAL_DEF( void )\n  cf2_arrstack_init( CF2_ArrStack  arrstack,\n                     FT_Memory     memory,\n                     FT_Error*     error,\n                     size_t        sizeItem )\n  {\n    FT_ASSERT( arrstack != NULL );\n\n    /* initialize the structure */\n    arrstack->memory    = memory;\n    arrstack->error     = error;\n    arrstack->sizeItem  = sizeItem;\n    arrstack->allocated = 0;\n    arrstack->chunk     = 10;    /* chunks of 10 items */\n    arrstack->count     = 0;\n    arrstack->totalSize = 0;\n    arrstack->ptr       = NULL;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cf2_arrstack_finalize( CF2_ArrStack  arrstack )\n  {\n    FT_Memory  memory = arrstack->memory;     /* for FT_FREE */\n\n\n    FT_ASSERT( arrstack != NULL );\n\n    arrstack->allocated = 0;\n    arrstack->count     = 0;\n    arrstack->totalSize = 0;\n\n    /* free the data buffer */\n    FT_FREE( arrstack->ptr );\n  }\n\n\n  /* allocate or reallocate the buffer size; */\n  /* return false on memory error */\n  static FT_Bool\n  cf2_arrstack_setNumElements( CF2_ArrStack  arrstack,\n                               size_t        numElements )\n  {\n    FT_ASSERT( arrstack != NULL );\n\n    {\n      FT_Error   error  = FT_Err_Ok;        /* for FT_REALLOC */\n      FT_Memory  memory = arrstack->memory; /* for FT_REALLOC */\n\n      FT_Long  newSize = (FT_Long)( numElements * arrstack->sizeItem );\n\n\n      if ( numElements > LONG_MAX / arrstack->sizeItem )\n        goto exit;\n\n\n      FT_ASSERT( newSize > 0 );   /* avoid realloc with zero size */\n\n      if ( !FT_REALLOC( arrstack->ptr, arrstack->totalSize, newSize ) )\n      {\n        arrstack->allocated = numElements;\n        arrstack->totalSize = newSize;\n\n        if ( arrstack->count > numElements )\n        {\n          /* we truncated the list! */\n          CF2_SET_ERROR( arrstack->error, Stack_Overflow );\n          arrstack->count = numElements;\n          return FALSE;\n        }\n\n        return TRUE;     /* success */\n      }\n    }\n\n  exit:\n    /* if there's not already an error, store this one */\n    CF2_SET_ERROR( arrstack->error, Out_Of_Memory );\n\n    return FALSE;\n  }\n\n\n  /* set the count, ensuring allocation is sufficient */\n  FT_LOCAL_DEF( void )\n  cf2_arrstack_setCount( CF2_ArrStack  arrstack,\n                         size_t        numElements )\n  {\n    FT_ASSERT( arrstack != NULL );\n\n    if ( numElements > arrstack->allocated )\n    {\n      /* expand the allocation first */\n      if ( !cf2_arrstack_setNumElements( arrstack, numElements ) )\n        return;\n    }\n\n    arrstack->count = numElements;\n  }\n\n\n  /* clear the count */\n  FT_LOCAL_DEF( void )\n  cf2_arrstack_clear( CF2_ArrStack  arrstack )\n  {\n    FT_ASSERT( arrstack != NULL );\n\n    arrstack->count = 0;\n  }\n\n\n  /* current number of items */\n  FT_LOCAL_DEF( size_t )\n  cf2_arrstack_size( const CF2_ArrStack  arrstack )\n  {\n    FT_ASSERT( arrstack != NULL );\n\n    return arrstack->count;\n  }\n\n\n  FT_LOCAL_DEF( void* )\n  cf2_arrstack_getBuffer( const CF2_ArrStack  arrstack )\n  {\n    FT_ASSERT( arrstack != NULL );\n\n    return arrstack->ptr;\n  }\n\n\n  /* return pointer to the given element */\n  FT_LOCAL_DEF( void* )\n  cf2_arrstack_getPointer( const CF2_ArrStack  arrstack,\n                           size_t              idx )\n  {\n    void*  newPtr;\n\n\n    FT_ASSERT( arrstack != NULL );\n\n    if ( idx >= arrstack->count )\n    {\n      /* overflow */\n      CF2_SET_ERROR( arrstack->error, Stack_Overflow );\n      idx = 0;    /* choose safe default */\n    }\n\n    newPtr = (FT_Byte*)arrstack->ptr + idx * arrstack->sizeItem;\n\n    return newPtr;\n  }\n\n\n  /* push (append) an element at the end of the list;         */\n  /* return false on memory error                             */\n  /* TODO: should there be a length param for extra checking? */\n  FT_LOCAL_DEF( void )\n  cf2_arrstack_push( CF2_ArrStack  arrstack,\n                     const void*   ptr )\n  {\n    FT_ASSERT( arrstack != NULL );\n\n    if ( arrstack->count == arrstack->allocated )\n    {\n      /* grow the buffer by one chunk */\n      if ( !cf2_arrstack_setNumElements(\n             arrstack, arrstack->allocated + arrstack->chunk ) )\n      {\n        /* on error, ignore the push */\n        return;\n      }\n    }\n\n    FT_ASSERT( ptr != NULL );\n\n    {\n      size_t  offset = arrstack->count * arrstack->sizeItem;\n      void*   newPtr = (FT_Byte*)arrstack->ptr + offset;\n\n\n      FT_MEM_COPY( newPtr, ptr, arrstack->sizeItem );\n      arrstack->count += 1;\n    }\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cf2arrst.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cf2arrst.h                                                             */\n/*                                                                         */\n/*    Adobe's code for Array Stacks (specification).                       */\n/*                                                                         */\n/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */\n/*                                                                         */\n/*  This software, and all works of authorship, whether in source or       */\n/*  object code form as indicated by the copyright notice(s) included      */\n/*  herein (collectively, the \"Work\") is made available, and may only be   */\n/*  used, modified, and distributed under the FreeType Project License,    */\n/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */\n/*  FreeType Project License, each contributor to the Work hereby grants   */\n/*  to any individual or legal entity exercising permissions granted by    */\n/*  the FreeType Project License and this section (hereafter, \"You\" or     */\n/*  \"Your\") a perpetual, worldwide, non-exclusive, no-charge,              */\n/*  royalty-free, irrevocable (except as stated in this section) patent    */\n/*  license to make, have made, use, offer to sell, sell, import, and      */\n/*  otherwise transfer the Work, where such license applies only to those  */\n/*  patent claims licensable by such contributor that are necessarily      */\n/*  infringed by their contribution(s) alone or by combination of their    */\n/*  contribution(s) with the Work to which such contribution(s) was        */\n/*  submitted.  If You institute patent litigation against any entity      */\n/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */\n/*  the Work or a contribution incorporated within the Work constitutes    */\n/*  direct or contributory patent infringement, then any patent licenses   */\n/*  granted to You under this License for that Work shall terminate as of  */\n/*  the date such litigation is filed.                                     */\n/*                                                                         */\n/*  By using, modifying, or distributing the Work you indicate that you    */\n/*  have read and understood the terms and conditions of the               */\n/*  FreeType Project License as well as those provided in this section,    */\n/*  and you accept them fully.                                             */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CF2ARRST_H__\n#define __CF2ARRST_H__\n\n\n#include \"cf2error.h\"\n\n\nFT_BEGIN_HEADER\n\n\n  /* need to define the struct here (not opaque) so it can be allocated by */\n  /* clients                                                               */\n  typedef struct  CF2_ArrStackRec_\n  {\n    FT_Memory  memory;\n    FT_Error*  error;\n\n    size_t  sizeItem;       /* bytes per element             */\n    size_t  allocated;      /* items allocated               */\n    size_t  chunk;          /* allocation increment in items */\n    size_t  count;          /* number of elements allocated  */\n    size_t  totalSize;      /* total bytes allocated         */\n\n    void*  ptr;             /* ptr to data                   */\n\n  } CF2_ArrStackRec, *CF2_ArrStack;\n\n\n  FT_LOCAL( void )\n  cf2_arrstack_init( CF2_ArrStack  arrstack,\n                     FT_Memory     memory,\n                     FT_Error*     error,\n                     size_t        sizeItem );\n  FT_LOCAL( void )\n  cf2_arrstack_finalize( CF2_ArrStack  arrstack );\n\n  FT_LOCAL( void )\n  cf2_arrstack_setCount( CF2_ArrStack  arrstack,\n                         size_t        numElements );\n  FT_LOCAL( void )\n  cf2_arrstack_clear( CF2_ArrStack  arrstack );\n  FT_LOCAL( size_t )\n  cf2_arrstack_size( const CF2_ArrStack  arrstack );\n\n  FT_LOCAL( void* )\n  cf2_arrstack_getBuffer( const CF2_ArrStack  arrstack );\n  FT_LOCAL( void* )\n  cf2_arrstack_getPointer( const CF2_ArrStack  arrstack,\n                           size_t              idx );\n\n  FT_LOCAL( void )\n  cf2_arrstack_push( CF2_ArrStack  arrstack,\n                     const void*   ptr );\n\n\nFT_END_HEADER\n\n\n#endif /* __CF2ARRST_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cf2blues.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cf2blues.c                                                             */\n/*                                                                         */\n/*    Adobe's code for handling Blue Zones (body).                         */\n/*                                                                         */\n/*  Copyright 2009-2014 Adobe Systems Incorporated.                        */\n/*                                                                         */\n/*  This software, and all works of authorship, whether in source or       */\n/*  object code form as indicated by the copyright notice(s) included      */\n/*  herein (collectively, the \"Work\") is made available, and may only be   */\n/*  used, modified, and distributed under the FreeType Project License,    */\n/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */\n/*  FreeType Project License, each contributor to the Work hereby grants   */\n/*  to any individual or legal entity exercising permissions granted by    */\n/*  the FreeType Project License and this section (hereafter, \"You\" or     */\n/*  \"Your\") a perpetual, worldwide, non-exclusive, no-charge,              */\n/*  royalty-free, irrevocable (except as stated in this section) patent    */\n/*  license to make, have made, use, offer to sell, sell, import, and      */\n/*  otherwise transfer the Work, where such license applies only to those  */\n/*  patent claims licensable by such contributor that are necessarily      */\n/*  infringed by their contribution(s) alone or by combination of their    */\n/*  contribution(s) with the Work to which such contribution(s) was        */\n/*  submitted.  If You institute patent litigation against any entity      */\n/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */\n/*  the Work or a contribution incorporated within the Work constitutes    */\n/*  direct or contributory patent infringement, then any patent licenses   */\n/*  granted to You under this License for that Work shall terminate as of  */\n/*  the date such litigation is filed.                                     */\n/*                                                                         */\n/*  By using, modifying, or distributing the Work you indicate that you    */\n/*  have read and understood the terms and conditions of the               */\n/*  FreeType Project License as well as those provided in this section,    */\n/*  and you accept them fully.                                             */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"cf2ft.h\"\n#include FT_INTERNAL_DEBUG_H\n\n#include \"cf2blues.h\"\n#include \"cf2hints.h\"\n#include \"cf2font.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_cf2blues\n\n\n  /*\n   * For blue values, the FreeType parser produces an array of integers,\n   * while the Adobe CFF engine produces an array of fixed.\n   * Define a macro to convert FreeType to fixed.\n   */\n#define cf2_blueToFixed( x )  cf2_intToFixed( x )\n\n\n  FT_LOCAL_DEF( void )\n  cf2_blues_init( CF2_Blues  blues,\n                  CF2_Font   font )\n  {\n    /* pointer to parsed font object */\n    CFF_Decoder*  decoder = font->decoder;\n\n    CF2_Fixed  zoneHeight;\n    CF2_Fixed  maxZoneHeight = 0;\n    CF2_Fixed  csUnitsPerPixel;\n\n    size_t  numBlueValues;\n    size_t  numOtherBlues;\n    size_t  numFamilyBlues;\n    size_t  numFamilyOtherBlues;\n\n    FT_Pos*  blueValues;\n    FT_Pos*  otherBlues;\n    FT_Pos*  familyBlues;\n    FT_Pos*  familyOtherBlues;\n\n    size_t     i;\n    CF2_Fixed  emBoxBottom, emBoxTop;\n\n#if 0\n    CF2_Int  unitsPerEm = font->unitsPerEm;\n\n\n    if ( unitsPerEm == 0 )\n      unitsPerEm = 1000;\n#endif\n\n    FT_ZERO( blues );\n    blues->scale = font->innerTransform.d;\n\n    cf2_getBlueMetrics( decoder,\n                        &blues->blueScale,\n                        &blues->blueShift,\n                        &blues->blueFuzz );\n\n    cf2_getBlueValues( decoder, &numBlueValues, &blueValues );\n    cf2_getOtherBlues( decoder, &numOtherBlues, &otherBlues );\n    cf2_getFamilyBlues( decoder, &numFamilyBlues, &familyBlues );\n    cf2_getFamilyOtherBlues( decoder, &numFamilyOtherBlues, &familyOtherBlues );\n\n    /*\n     * synthetic em box hint heuristic\n     *\n     * Apply this when ideographic dictionary (LanguageGroup 1) has no\n     * real alignment zones.  Adobe tools generate dummy zones at -250 and\n     * 1100 for a 1000 unit em.  Fonts with ICF-based alignment zones\n     * should not enable the heuristic.  When the heuristic is enabled,\n     * the font's blue zones are ignored.\n     *\n     */\n\n    /* get em box from OS/2 typoAscender/Descender                      */\n    /* TODO: FreeType does not parse these metrics.  Skip them for now. */\n#if 0\n    FCM_getHorizontalLineMetrics( &e,\n                                  font->font,\n                                  &ascender,\n                                  &descender,\n                                  &linegap );\n    if ( ascender - descender == unitsPerEm )\n    {\n      emBoxBottom = cf2_intToFixed( descender );\n      emBoxTop    = cf2_intToFixed( ascender );\n    }\n    else\n#endif\n    {\n      emBoxBottom = CF2_ICF_Bottom;\n      emBoxTop    = CF2_ICF_Top;\n    }\n\n    if ( cf2_getLanguageGroup( decoder ) == 1                   &&\n         ( numBlueValues == 0                                 ||\n           ( numBlueValues == 4                             &&\n             cf2_blueToFixed( blueValues[0] ) < emBoxBottom &&\n             cf2_blueToFixed( blueValues[1] ) < emBoxBottom &&\n             cf2_blueToFixed( blueValues[2] ) > emBoxTop    &&\n             cf2_blueToFixed( blueValues[3] ) > emBoxTop    ) ) )\n    {\n      /*\n       * Construct hint edges suitable for synthetic ghost hints at top\n       * and bottom of em box.  +-CF2_MIN_COUNTER allows for unhinted\n       * features above or below the last hinted edge.  This also gives a\n       * net 1 pixel boost to the height of ideographic glyphs.\n       *\n       * Note: Adjust synthetic hints outward by epsilon (0x.0001) to\n       *       avoid interference.  E.g., some fonts have real hints at\n       *       880 and -120.\n       */\n\n      blues->emBoxBottomEdge.csCoord = emBoxBottom - CF2_FIXED_EPSILON;\n      blues->emBoxBottomEdge.dsCoord = cf2_fixedRound(\n                                         FT_MulFix(\n                                           blues->emBoxBottomEdge.csCoord,\n                                           blues->scale ) ) -\n                                       CF2_MIN_COUNTER;\n      blues->emBoxBottomEdge.scale   = blues->scale;\n      blues->emBoxBottomEdge.flags   = CF2_GhostBottom |\n                                       CF2_Locked |\n                                       CF2_Synthetic;\n\n      blues->emBoxTopEdge.csCoord = emBoxTop + CF2_FIXED_EPSILON +\n                                    2 * font->darkenY;\n      blues->emBoxTopEdge.dsCoord = cf2_fixedRound(\n                                      FT_MulFix(\n                                        blues->emBoxTopEdge.csCoord,\n                                        blues->scale ) ) +\n                                    CF2_MIN_COUNTER;\n      blues->emBoxTopEdge.scale   = blues->scale;\n      blues->emBoxTopEdge.flags   = CF2_GhostTop |\n                                    CF2_Locked |\n                                    CF2_Synthetic;\n\n      blues->doEmBoxHints = TRUE;    /* enable the heuristic */\n\n      return;\n    }\n\n    /* copy `BlueValues' and `OtherBlues' to a combined array of top and */\n    /* bottom zones                                                      */\n    for ( i = 0; i < numBlueValues; i += 2 )\n    {\n      blues->zone[blues->count].csBottomEdge =\n        cf2_blueToFixed( blueValues[i] );\n      blues->zone[blues->count].csTopEdge =\n        cf2_blueToFixed( blueValues[i + 1] );\n\n      zoneHeight = blues->zone[blues->count].csTopEdge -\n                   blues->zone[blues->count].csBottomEdge;\n\n      if ( zoneHeight < 0 )\n      {\n        FT_TRACE4(( \"cf2_blues_init: ignoring negative zone height\\n\" ));\n        continue;   /* reject this zone */\n      }\n\n      if ( zoneHeight > maxZoneHeight )\n      {\n        /* take maximum before darkening adjustment      */\n        /* so overshoot suppression point doesn't change */\n        maxZoneHeight = zoneHeight;\n      }\n\n      /* adjust both edges of top zone upward by twice darkening amount */\n      if ( i != 0 )\n      {\n        blues->zone[blues->count].csTopEdge    += 2 * font->darkenY;\n        blues->zone[blues->count].csBottomEdge += 2 * font->darkenY;\n      }\n\n      /* first `BlueValue' is bottom zone; others are top */\n      if ( i == 0 )\n      {\n        blues->zone[blues->count].bottomZone =\n          TRUE;\n        blues->zone[blues->count].csFlatEdge =\n          blues->zone[blues->count].csTopEdge;\n      }\n      else\n      {\n        blues->zone[blues->count].bottomZone =\n          FALSE;\n        blues->zone[blues->count].csFlatEdge =\n          blues->zone[blues->count].csBottomEdge;\n      }\n\n      blues->count += 1;\n    }\n\n    for ( i = 0; i < numOtherBlues; i += 2 )\n    {\n      blues->zone[blues->count].csBottomEdge =\n        cf2_blueToFixed( otherBlues[i] );\n      blues->zone[blues->count].csTopEdge =\n        cf2_blueToFixed( otherBlues[i + 1] );\n\n      zoneHeight = blues->zone[blues->count].csTopEdge -\n                   blues->zone[blues->count].csBottomEdge;\n\n      if ( zoneHeight < 0 )\n      {\n        FT_TRACE4(( \"cf2_blues_init: ignoring negative zone height\\n\" ));\n        continue;   /* reject this zone */\n      }\n\n      if ( zoneHeight > maxZoneHeight )\n      {\n        /* take maximum before darkening adjustment      */\n        /* so overshoot suppression point doesn't change */\n        maxZoneHeight = zoneHeight;\n      }\n\n      /* Note: bottom zones are not adjusted for darkening amount */\n\n      /* all OtherBlues are bottom zone */\n      blues->zone[blues->count].bottomZone =\n        TRUE;\n      blues->zone[blues->count].csFlatEdge =\n        blues->zone[blues->count].csTopEdge;\n\n      blues->count += 1;\n    }\n\n    /* Adjust for FamilyBlues */\n\n    /* Search for the nearest flat edge in `FamilyBlues' or                */\n    /* `FamilyOtherBlues'.  According to the Black Book, any matching edge */\n    /* must be within one device pixel                                     */\n\n    csUnitsPerPixel = FT_DivFix( cf2_intToFixed( 1 ), blues->scale );\n\n    /* loop on all zones in this font */\n    for ( i = 0; i < blues->count; i++ )\n    {\n      size_t     j;\n      CF2_Fixed  minDiff;\n      CF2_Fixed  flatFamilyEdge, diff;\n      /* value for this font */\n      CF2_Fixed  flatEdge = blues->zone[i].csFlatEdge;\n\n\n      if ( blues->zone[i].bottomZone )\n      {\n        /* In a bottom zone, the top edge is the flat edge.             */\n        /* Search `FamilyOtherBlues' for bottom zones; look for closest */\n        /* Family edge that is within the one pixel threshold.          */\n\n        minDiff = CF2_FIXED_MAX;\n\n        for ( j = 0; j < numFamilyOtherBlues; j += 2 )\n        {\n          /* top edge */\n          flatFamilyEdge = cf2_blueToFixed( familyOtherBlues[j + 1] );\n\n          diff = cf2_fixedAbs( flatEdge - flatFamilyEdge );\n\n          if ( diff < minDiff && diff < csUnitsPerPixel )\n          {\n            blues->zone[i].csFlatEdge = flatFamilyEdge;\n            minDiff                   = diff;\n\n            if ( diff == 0 )\n              break;\n          }\n        }\n\n        /* check the first member of FamilyBlues, which is a bottom zone */\n        if ( numFamilyBlues >= 2 )\n        {\n          /* top edge */\n          flatFamilyEdge = cf2_blueToFixed( familyBlues[1] );\n\n          diff = cf2_fixedAbs( flatEdge - flatFamilyEdge );\n\n          if ( diff < minDiff && diff < csUnitsPerPixel )\n            blues->zone[i].csFlatEdge = flatFamilyEdge;\n        }\n      }\n      else\n      {\n        /* In a top zone, the bottom edge is the flat edge.                */\n        /* Search `FamilyBlues' for top zones; skip first zone, which is a */\n        /* bottom zone; look for closest Family edge that is within the    */\n        /* one pixel threshold                                             */\n\n        minDiff = CF2_FIXED_MAX;\n\n        for ( j = 2; j < numFamilyBlues; j += 2 )\n        {\n          /* bottom edge */\n          flatFamilyEdge = cf2_blueToFixed( familyBlues[j] );\n\n          /* adjust edges of top zone upward by twice darkening amount */\n          flatFamilyEdge += 2 * font->darkenY;      /* bottom edge */\n\n          diff = cf2_fixedAbs( flatEdge - flatFamilyEdge );\n\n          if ( diff < minDiff && diff < csUnitsPerPixel )\n          {\n            blues->zone[i].csFlatEdge = flatFamilyEdge;\n            minDiff                   = diff;\n\n            if ( diff == 0 )\n              break;\n          }\n        }\n      }\n    }\n\n    /* TODO: enforce separation of zones, including BlueFuzz */\n\n    /* Adjust BlueScale; similar to AdjustBlueScale() in coretype */\n    /* `bcsetup.c'.                                               */\n\n    if ( maxZoneHeight > 0 )\n    {\n      if ( blues->blueScale > FT_DivFix( cf2_intToFixed( 1 ),\n                                         maxZoneHeight ) )\n      {\n        /* clamp at maximum scale */\n        blues->blueScale = FT_DivFix( cf2_intToFixed( 1 ),\n                                      maxZoneHeight );\n      }\n\n      /*\n       * TODO: Revisit the bug fix for 613448.  The minimum scale\n       *       requirement catches a number of library fonts.  For\n       *       example, with default BlueScale (.039625) and 0.4 minimum,\n       *       the test below catches any font with maxZoneHeight < 10.1.\n       *       There are library fonts ranging from 2 to 10 that get\n       *       caught, including e.g., Eurostile LT Std Medium with\n       *       maxZoneHeight of 6.\n       *\n       */\n#if 0\n      if ( blueScale < .4 / maxZoneHeight )\n      {\n        tetraphilia_assert( 0 );\n        /* clamp at minimum scale, per bug 0613448 fix */\n        blueScale = .4 / maxZoneHeight;\n      }\n#endif\n\n    }\n\n    /*\n     * Suppress overshoot and boost blue zones at small sizes.  Boost\n     * amount varies linearly from 0.5 pixel near 0 to 0 pixel at\n     * blueScale cutoff.\n     * Note: This boost amount is different from the coretype heuristic.\n     *\n     */\n\n    if ( blues->scale < blues->blueScale )\n    {\n      blues->suppressOvershoot = TRUE;\n\n      /* Change rounding threshold for `dsFlatEdge'.                    */\n      /* Note: constant changed from 0.5 to 0.6 to avoid a problem with */\n      /*       10ppem Arial                                             */\n\n      blues->boost = cf2_floatToFixed( .6 ) -\n                       FT_MulDiv( cf2_floatToFixed ( .6 ),\n                                  blues->scale,\n                                  blues->blueScale );\n      if ( blues->boost > 0x7FFF )\n      {\n        /* boost must remain less than 0.5, or baseline could go negative */\n        blues->boost = 0x7FFF;\n      }\n    }\n\n    /* boost and darkening have similar effects; don't do both */\n    if ( font->stemDarkened )\n      blues->boost = 0;\n\n    /* set device space alignment for each zone;    */\n    /* apply boost amount before rounding flat edge */\n\n    for ( i = 0; i < blues->count; i++ )\n    {\n      if ( blues->zone[i].bottomZone )\n        blues->zone[i].dsFlatEdge = cf2_fixedRound(\n                                      FT_MulFix(\n                                        blues->zone[i].csFlatEdge,\n                                        blues->scale ) -\n                                      blues->boost );\n      else\n        blues->zone[i].dsFlatEdge = cf2_fixedRound(\n                                      FT_MulFix(\n                                        blues->zone[i].csFlatEdge,\n                                        blues->scale ) +\n                                      blues->boost );\n    }\n  }\n\n\n  /*\n   * Check whether `stemHint' is captured by one of the blue zones.\n   *\n   * Zero, one or both edges may be valid; only valid edges can be\n   * captured.  For compatibility with CoolType, search top and bottom\n   * zones in the same pass (see `BlueLock').  If a hint is captured,\n   * return true and position the edge(s) in one of 3 ways:\n   *\n   *  1) If `BlueScale' suppresses overshoot, position the captured edge\n   *     at the flat edge of the zone.\n   *  2) If overshoot is not suppressed and `BlueShift' requires\n   *     overshoot, position the captured edge a minimum of 1 device pixel\n   *     from the flat edge.\n   *  3) If overshoot is not suppressed or required, position the captured\n   *     edge at the nearest device pixel.\n   *\n   */\n  FT_LOCAL_DEF( FT_Bool )\n  cf2_blues_capture( const CF2_Blues  blues,\n                     CF2_Hint         bottomHintEdge,\n                     CF2_Hint         topHintEdge )\n  {\n    /* TODO: validate? */\n    CF2_Fixed  csFuzz = blues->blueFuzz;\n\n    /* new position of captured edge */\n    CF2_Fixed  dsNew;\n\n    /* amount that hint is moved when positioned */\n    CF2_Fixed  dsMove = 0;\n\n    FT_Bool   captured = FALSE;\n    CF2_UInt  i;\n\n\n    /* assert edge flags are consistent */\n    FT_ASSERT( !cf2_hint_isTop( bottomHintEdge ) &&\n               !cf2_hint_isBottom( topHintEdge ) );\n\n    /* TODO: search once without blue fuzz for compatibility with coretype? */\n    for ( i = 0; i < blues->count; i++ )\n    {\n      if ( blues->zone[i].bottomZone           &&\n           cf2_hint_isBottom( bottomHintEdge ) )\n      {\n        if ( ( blues->zone[i].csBottomEdge - csFuzz ) <=\n               bottomHintEdge->csCoord                   &&\n             bottomHintEdge->csCoord <=\n               ( blues->zone[i].csTopEdge + csFuzz )     )\n        {\n          /* bottom edge captured by bottom zone */\n\n          if ( blues->suppressOvershoot )\n            dsNew = blues->zone[i].dsFlatEdge;\n\n          else if ( ( blues->zone[i].csTopEdge - bottomHintEdge->csCoord ) >=\n                      blues->blueShift )\n          {\n            /* guarantee minimum of 1 pixel overshoot */\n            dsNew = FT_MIN(\n                      cf2_fixedRound( bottomHintEdge->dsCoord ),\n                      blues->zone[i].dsFlatEdge - cf2_intToFixed( 1 ) );\n          }\n\n          else\n          {\n            /* simply round captured edge */\n            dsNew = cf2_fixedRound( bottomHintEdge->dsCoord );\n          }\n\n          dsMove   = dsNew - bottomHintEdge->dsCoord;\n          captured = TRUE;\n\n          break;\n        }\n      }\n\n      if ( !blues->zone[i].bottomZone && cf2_hint_isTop( topHintEdge ) )\n      {\n        if ( ( blues->zone[i].csBottomEdge - csFuzz ) <=\n               topHintEdge->csCoord                      &&\n             topHintEdge->csCoord <=\n               ( blues->zone[i].csTopEdge + csFuzz )     )\n        {\n          /* top edge captured by top zone */\n\n          if ( blues->suppressOvershoot )\n            dsNew = blues->zone[i].dsFlatEdge;\n\n          else if ( ( topHintEdge->csCoord - blues->zone[i].csBottomEdge ) >=\n                      blues->blueShift )\n          {\n            /* guarantee minimum of 1 pixel overshoot */\n            dsNew = FT_MAX(\n                      cf2_fixedRound( topHintEdge->dsCoord ),\n                      blues->zone[i].dsFlatEdge + cf2_intToFixed( 1 ) );\n          }\n\n          else\n          {\n            /* simply round captured edge */\n            dsNew = cf2_fixedRound( topHintEdge->dsCoord );\n          }\n\n          dsMove   = dsNew - topHintEdge->dsCoord;\n          captured = TRUE;\n\n          break;\n        }\n      }\n    }\n\n    if ( captured )\n    {\n      /* move both edges and flag them `locked' */\n      if ( cf2_hint_isValid( bottomHintEdge ) )\n      {\n        bottomHintEdge->dsCoord += dsMove;\n        cf2_hint_lock( bottomHintEdge );\n      }\n\n      if ( cf2_hint_isValid( topHintEdge ) )\n      {\n        topHintEdge->dsCoord += dsMove;\n        cf2_hint_lock( topHintEdge );\n      }\n    }\n\n    return captured;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cf2blues.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cf2blues.h                                                             */\n/*                                                                         */\n/*    Adobe's code for handling Blue Zones (specification).                */\n/*                                                                         */\n/*  Copyright 2009-2013 Adobe Systems Incorporated.                        */\n/*                                                                         */\n/*  This software, and all works of authorship, whether in source or       */\n/*  object code form as indicated by the copyright notice(s) included      */\n/*  herein (collectively, the \"Work\") is made available, and may only be   */\n/*  used, modified, and distributed under the FreeType Project License,    */\n/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */\n/*  FreeType Project License, each contributor to the Work hereby grants   */\n/*  to any individual or legal entity exercising permissions granted by    */\n/*  the FreeType Project License and this section (hereafter, \"You\" or     */\n/*  \"Your\") a perpetual, worldwide, non-exclusive, no-charge,              */\n/*  royalty-free, irrevocable (except as stated in this section) patent    */\n/*  license to make, have made, use, offer to sell, sell, import, and      */\n/*  otherwise transfer the Work, where such license applies only to those  */\n/*  patent claims licensable by such contributor that are necessarily      */\n/*  infringed by their contribution(s) alone or by combination of their    */\n/*  contribution(s) with the Work to which such contribution(s) was        */\n/*  submitted.  If You institute patent litigation against any entity      */\n/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */\n/*  the Work or a contribution incorporated within the Work constitutes    */\n/*  direct or contributory patent infringement, then any patent licenses   */\n/*  granted to You under this License for that Work shall terminate as of  */\n/*  the date such litigation is filed.                                     */\n/*                                                                         */\n/*  By using, modifying, or distributing the Work you indicate that you    */\n/*  have read and understood the terms and conditions of the               */\n/*  FreeType Project License as well as those provided in this section,    */\n/*  and you accept them fully.                                             */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*\n   * A `CF2_Blues' object stores the blue zones (horizontal alignment\n   * zones) of a font.  These are specified in the CFF private dictionary\n   * by `BlueValues', `OtherBlues', `FamilyBlues', and `FamilyOtherBlues'.\n   * Each zone is defined by a top and bottom edge in character space.\n   * Further, each zone is either a top zone or a bottom zone, as recorded\n   * by `bottomZone'.\n   *\n   * The maximum number of `BlueValues' and `FamilyBlues' is 7 each.\n   * However, these are combined to produce a total of 7 zones.\n   * Similarly, the maximum number of `OtherBlues' and `FamilyOtherBlues'\n   * is 5 and these are combined to produce an additional 5 zones.\n   *\n   * Blue zones are used to `capture' hints and force them to a common\n   * alignment point.  This alignment is recorded in device space in\n   * `dsFlatEdge'.  Except for this value, a `CF2_Blues' object could be\n   * constructed independently of scaling.  Construction may occur once\n   * the matrix is known.  Other features implemented in the Capture\n   * method are overshoot suppression, overshoot enforcement, and Blue\n   * Boost.\n   *\n   * Capture is determined by `BlueValues' and `OtherBlues', but the\n   * alignment point may be adjusted to the scaled flat edge of\n   * `FamilyBlues' or `FamilyOtherBlues'.  No alignment is done to the\n   * curved edge of a zone.\n   *\n   */\n\n\n#ifndef __CF2BLUES_H__\n#define __CF2BLUES_H__\n\n\n#include \"cf2glue.h\"\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   * `CF2_Hint' is shared by `cf2hints.h' and\n   * `cf2blues.h', but `cf2blues.h' depends on\n   * `cf2hints.h', so define it here.  Note: The typedef is in\n   * `cf2glue.h'.\n   *\n   */\n  enum\n  {\n    CF2_GhostBottom = 0x1,  /* a single bottom edge           */\n    CF2_GhostTop    = 0x2,  /* a single top edge              */\n    CF2_PairBottom  = 0x4,  /* the bottom edge of a stem hint */\n    CF2_PairTop     = 0x8,  /* the top edge of a stem hint    */\n    CF2_Locked      = 0x10, /* this edge has been aligned     */\n                            /* by a blue zone                 */\n    CF2_Synthetic   = 0x20  /* this edge was synthesized      */\n  };\n\n\n  /*\n   * Default value for OS/2 typoAscender/Descender when their difference\n   * is not equal to `unitsPerEm'.  The default is based on -250 and 1100\n   * in `CF2_Blues', assuming 1000 units per em here.\n   *\n   */\n  enum\n  {\n    CF2_ICF_Top    = cf2_intToFixed(  880 ),\n    CF2_ICF_Bottom = cf2_intToFixed( -120 )\n  };\n\n\n  /*\n   * Constant used for hint adjustment and for synthetic em box hint\n   * placement.\n   */\n#define CF2_MIN_COUNTER  cf2_floatToFixed( 0.5 )\n\n\n  /* shared typedef is in cf2glue.h */\n  struct  CF2_HintRec_\n  {\n    CF2_UInt  flags;  /* attributes of the edge            */\n    size_t    index;  /* index in original stem hint array */\n                      /* (if not synthetic)                */\n    CF2_Fixed  csCoord;\n    CF2_Fixed  dsCoord;\n    CF2_Fixed  scale;\n  };\n\n\n  typedef struct  CF2_BlueRec_\n  {\n    CF2_Fixed  csBottomEdge;\n    CF2_Fixed  csTopEdge;\n    CF2_Fixed  csFlatEdge; /* may be from either local or Family zones */\n    CF2_Fixed  dsFlatEdge; /* top edge of bottom zone or bottom edge   */\n                           /* of top zone (rounded)                    */\n    FT_Bool  bottomZone;\n\n  } CF2_BlueRec;\n\n\n  /* max total blue zones is 12 */\n  enum\n  {\n    CF2_MAX_BLUES      = 7,\n    CF2_MAX_OTHERBLUES = 5\n  };\n\n\n  typedef struct  CF2_BluesRec_\n  {\n    CF2_Fixed  scale;\n    CF2_UInt   count;\n    FT_Bool    suppressOvershoot;\n    FT_Bool    doEmBoxHints;\n\n    CF2_Fixed  blueScale;\n    CF2_Fixed  blueShift;\n    CF2_Fixed  blueFuzz;\n\n    CF2_Fixed  boost;\n\n    CF2_HintRec  emBoxTopEdge;\n    CF2_HintRec  emBoxBottomEdge;\n\n    CF2_BlueRec  zone[CF2_MAX_BLUES + CF2_MAX_OTHERBLUES];\n\n  } CF2_BluesRec, *CF2_Blues;\n\n\n  FT_LOCAL( void )\n  cf2_blues_init( CF2_Blues  blues,\n                  CF2_Font   font );\n  FT_LOCAL( FT_Bool )\n  cf2_blues_capture( const CF2_Blues  blues,\n                     CF2_Hint         bottomHintEdge,\n                     CF2_Hint         topHintEdge );\n\n\nFT_END_HEADER\n\n\n#endif /* __CF2BLUES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cf2error.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cf2error.c                                                             */\n/*                                                                         */\n/*    Adobe's code for error handling (body).                              */\n/*                                                                         */\n/*  Copyright 2006-2013 Adobe Systems Incorporated.                        */\n/*                                                                         */\n/*  This software, and all works of authorship, whether in source or       */\n/*  object code form as indicated by the copyright notice(s) included      */\n/*  herein (collectively, the \"Work\") is made available, and may only be   */\n/*  used, modified, and distributed under the FreeType Project License,    */\n/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */\n/*  FreeType Project License, each contributor to the Work hereby grants   */\n/*  to any individual or legal entity exercising permissions granted by    */\n/*  the FreeType Project License and this section (hereafter, \"You\" or     */\n/*  \"Your\") a perpetual, worldwide, non-exclusive, no-charge,              */\n/*  royalty-free, irrevocable (except as stated in this section) patent    */\n/*  license to make, have made, use, offer to sell, sell, import, and      */\n/*  otherwise transfer the Work, where such license applies only to those  */\n/*  patent claims licensable by such contributor that are necessarily      */\n/*  infringed by their contribution(s) alone or by combination of their    */\n/*  contribution(s) with the Work to which such contribution(s) was        */\n/*  submitted.  If You institute patent litigation against any entity      */\n/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */\n/*  the Work or a contribution incorporated within the Work constitutes    */\n/*  direct or contributory patent infringement, then any patent licenses   */\n/*  granted to You under this License for that Work shall terminate as of  */\n/*  the date such litigation is filed.                                     */\n/*                                                                         */\n/*  By using, modifying, or distributing the Work you indicate that you    */\n/*  have read and understood the terms and conditions of the               */\n/*  FreeType Project License as well as those provided in this section,    */\n/*  and you accept them fully.                                             */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"cf2ft.h\"\n#include \"cf2error.h\"\n\n\n  FT_LOCAL_DEF( void )\n  cf2_setError( FT_Error*  error,\n                FT_Error   value )\n  {\n    if ( error && *error == 0 )\n      *error = value;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cf2error.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cf2error.h                                                             */\n/*                                                                         */\n/*    Adobe's code for error handling (specification).                     */\n/*                                                                         */\n/*  Copyright 2006-2013 Adobe Systems Incorporated.                        */\n/*                                                                         */\n/*  This software, and all works of authorship, whether in source or       */\n/*  object code form as indicated by the copyright notice(s) included      */\n/*  herein (collectively, the \"Work\") is made available, and may only be   */\n/*  used, modified, and distributed under the FreeType Project License,    */\n/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */\n/*  FreeType Project License, each contributor to the Work hereby grants   */\n/*  to any individual or legal entity exercising permissions granted by    */\n/*  the FreeType Project License and this section (hereafter, \"You\" or     */\n/*  \"Your\") a perpetual, worldwide, non-exclusive, no-charge,              */\n/*  royalty-free, irrevocable (except as stated in this section) patent    */\n/*  license to make, have made, use, offer to sell, sell, import, and      */\n/*  otherwise transfer the Work, where such license applies only to those  */\n/*  patent claims licensable by such contributor that are necessarily      */\n/*  infringed by their contribution(s) alone or by combination of their    */\n/*  contribution(s) with the Work to which such contribution(s) was        */\n/*  submitted.  If You institute patent litigation against any entity      */\n/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */\n/*  the Work or a contribution incorporated within the Work constitutes    */\n/*  direct or contributory patent infringement, then any patent licenses   */\n/*  granted to You under this License for that Work shall terminate as of  */\n/*  the date such litigation is filed.                                     */\n/*                                                                         */\n/*  By using, modifying, or distributing the Work you indicate that you    */\n/*  have read and understood the terms and conditions of the               */\n/*  FreeType Project License as well as those provided in this section,    */\n/*  and you accept them fully.                                             */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CF2ERROR_H__\n#define __CF2ERROR_H__\n\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  CF2_Err_\n#define FT_ERR_BASE    FT_Mod_Err_CF2\n\n\n#include FT_ERRORS_H\n#include \"cf2ft.h\"\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   * A poor-man error facility.\n   *\n   * This code being written in vanilla C, doesn't have the luxury of a\n   * language-supported exception mechanism such as the one available in\n   * Java.  Instead, we are stuck with using error codes that must be\n   * carefully managed and preserved.  However, it is convenient for us to\n   * model our error mechanism on a Java-like exception mechanism.\n   * When we assign an error code we are thus `throwing' an error.\n   *\n   * The perservation of an error code is done by coding convention.\n   * Upon a function call if the error code is anything other than\n   * `FT_Err_Ok', which is guaranteed to be zero, we\n   * will return without altering that error.  This will allow the\n   * error to propogate and be handled at the appropriate location in\n   * the code.\n   *\n   * This allows a style of code where the error code is initialized\n   * up front and a block of calls are made with the error code only\n   * being checked after the block.  If a new error occurs, the original\n   * error will be preserved and a functional no-op should result in any\n   * subsequent function that has an initial error code not equal to\n   * `FT_Err_Ok'.\n   *\n   * Errors are encoded by calling the `FT_THROW' macro.  For example,\n   *\n   * {\n   *   FT_Error  e;\n   *\n   *\n   *   ...\n   *   e = FT_THROW( Out_Of_Memory );\n   * }\n   *\n   */\n\n\n  /* Set error code to a particular value. */\n  FT_LOCAL( void )\n  cf2_setError( FT_Error*  error,\n                FT_Error   value );\n\n\n  /*\n   * A macro that conditionally sets an error code.\n   *\n   * This macro will first check whether `error' is set;\n   * if not, it will set it to `e'.\n   *\n  */\n#define CF2_SET_ERROR( error, e )              \\\n          cf2_setError( error, FT_THROW( e ) )\n\n\nFT_END_HEADER\n\n\n#endif /* __CF2ERROR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cf2fixed.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cf2fixed.h                                                             */\n/*                                                                         */\n/*    Adobe's code for Fixed Point Mathematics (specification only).       */\n/*                                                                         */\n/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */\n/*                                                                         */\n/*  This software, and all works of authorship, whether in source or       */\n/*  object code form as indicated by the copyright notice(s) included      */\n/*  herein (collectively, the \"Work\") is made available, and may only be   */\n/*  used, modified, and distributed under the FreeType Project License,    */\n/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */\n/*  FreeType Project License, each contributor to the Work hereby grants   */\n/*  to any individual or legal entity exercising permissions granted by    */\n/*  the FreeType Project License and this section (hereafter, \"You\" or     */\n/*  \"Your\") a perpetual, worldwide, non-exclusive, no-charge,              */\n/*  royalty-free, irrevocable (except as stated in this section) patent    */\n/*  license to make, have made, use, offer to sell, sell, import, and      */\n/*  otherwise transfer the Work, where such license applies only to those  */\n/*  patent claims licensable by such contributor that are necessarily      */\n/*  infringed by their contribution(s) alone or by combination of their    */\n/*  contribution(s) with the Work to which such contribution(s) was        */\n/*  submitted.  If You institute patent litigation against any entity      */\n/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */\n/*  the Work or a contribution incorporated within the Work constitutes    */\n/*  direct or contributory patent infringement, then any patent licenses   */\n/*  granted to You under this License for that Work shall terminate as of  */\n/*  the date such litigation is filed.                                     */\n/*                                                                         */\n/*  By using, modifying, or distributing the Work you indicate that you    */\n/*  have read and understood the terms and conditions of the               */\n/*  FreeType Project License as well as those provided in this section,    */\n/*  and you accept them fully.                                             */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CF2FIXED_H__\n#define __CF2FIXED_H__\n\n\nFT_BEGIN_HEADER\n\n\n  /* rasterizer integer and fixed point arithmetic must be 32-bit */\n\n#define   CF2_Fixed  CF2_F16Dot16\n  typedef FT_Int32   CF2_Frac;   /* 2.30 fixed point */\n\n\n#define CF2_FIXED_MAX      ( (CF2_Fixed)0x7FFFFFFFL )\n#define CF2_FIXED_MIN      ( (CF2_Fixed)0x80000000L )\n#define CF2_FIXED_ONE      0x10000L\n#define CF2_FIXED_EPSILON  0x0001\n\n  /* in C 89, left and right shift of negative numbers is  */\n  /* implementation specific behaviour in the general case */\n\n#define cf2_intToFixed( i )                                    \\\n          ( (CF2_Fixed)( (FT_UInt32)(i) << 16 ) )\n#define cf2_fixedToInt( x )                                    \\\n          ( (FT_Short)( ( (FT_UInt32)(x) + 0x8000U ) >> 16 ) )\n#define cf2_fixedRound( x )                                    \\\n          ( (CF2_Fixed)( ( (x) + 0x8000 ) & 0xFFFF0000L ) )\n#define cf2_floatToFixed( f )                                  \\\n          ( (CF2_Fixed)( (f) * 65536.0 + 0.5 ) )\n#define cf2_fixedAbs( x )                                      \\\n          ( (x) < 0 ? -(x) : (x) )\n#define cf2_fixedFloor( x )                                    \\\n          ( (CF2_Fixed)( (x) & 0xFFFF0000L ) )\n#define cf2_fixedFraction( x )                                 \\\n          ( (x) - cf2_fixedFloor( x ) )\n#define cf2_fracToFixed( x )                                   \\\n          ( (x) < 0 ? -( ( -(x) + 0x2000 ) >> 14 )             \\\n                    :  ( (  (x) + 0x2000 ) >> 14 ) )\n\n\n  /* signed numeric types */\n  typedef enum  CF2_NumberType_\n  {\n    CF2_NumberFixed,    /* 16.16 */\n    CF2_NumberFrac,     /*  2.30 */\n    CF2_NumberInt       /* 32.0  */\n\n  } CF2_NumberType;\n\n\nFT_END_HEADER\n\n\n#endif /*  __CF2FIXED_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cf2font.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cf2font.c                                                              */\n/*                                                                         */\n/*    Adobe's code for font instances (body).                              */\n/*                                                                         */\n/*  Copyright 2007-2014 Adobe Systems Incorporated.                        */\n/*                                                                         */\n/*  This software, and all works of authorship, whether in source or       */\n/*  object code form as indicated by the copyright notice(s) included      */\n/*  herein (collectively, the \"Work\") is made available, and may only be   */\n/*  used, modified, and distributed under the FreeType Project License,    */\n/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */\n/*  FreeType Project License, each contributor to the Work hereby grants   */\n/*  to any individual or legal entity exercising permissions granted by    */\n/*  the FreeType Project License and this section (hereafter, \"You\" or     */\n/*  \"Your\") a perpetual, worldwide, non-exclusive, no-charge,              */\n/*  royalty-free, irrevocable (except as stated in this section) patent    */\n/*  license to make, have made, use, offer to sell, sell, import, and      */\n/*  otherwise transfer the Work, where such license applies only to those  */\n/*  patent claims licensable by such contributor that are necessarily      */\n/*  infringed by their contribution(s) alone or by combination of their    */\n/*  contribution(s) with the Work to which such contribution(s) was        */\n/*  submitted.  If You institute patent litigation against any entity      */\n/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */\n/*  the Work or a contribution incorporated within the Work constitutes    */\n/*  direct or contributory patent infringement, then any patent licenses   */\n/*  granted to You under this License for that Work shall terminate as of  */\n/*  the date such litigation is filed.                                     */\n/*                                                                         */\n/*  By using, modifying, or distributing the Work you indicate that you    */\n/*  have read and understood the terms and conditions of the               */\n/*  FreeType Project License as well as those provided in this section,    */\n/*  and you accept them fully.                                             */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_CALC_H\n\n#include \"cf2ft.h\"\n\n#include \"cf2glue.h\"\n#include \"cf2font.h\"\n#include \"cf2error.h\"\n#include \"cf2intrp.h\"\n\n\n  /* Compute a stem darkening amount in character space. */\n  static void\n  cf2_computeDarkening( CF2_Fixed   emRatio,\n                        CF2_Fixed   ppem,\n                        CF2_Fixed   stemWidth,\n                        CF2_Fixed*  darkenAmount,\n                        CF2_Fixed   boldenAmount,\n                        FT_Bool     stemDarkened,\n                        FT_Int*     darkenParams )\n  {\n    /*\n     * Total darkening amount is computed in 1000 unit character space\n     * using the modified 5 part curve as Adobe's Avalon rasterizer.\n     * The darkening amount is smaller for thicker stems.\n     * It becomes zero when the stem is thicker than 2.333 pixels.\n     *\n     * By default, we use\n     *\n     *   darkenAmount = 0.4 pixels   if scaledStem <= 0.5 pixels,\n     *   darkenAmount = 0.275 pixels if 1 <= scaledStem <= 1.667 pixels,\n     *   darkenAmount = 0 pixel      if scaledStem >= 2.333 pixels,\n     *\n     * and piecewise linear in-between:\n     *\n     *\n     *   darkening\n     *       ^\n     *       |\n     *       |      (x1,y1)\n     *       |--------+\n     *       |         \\\n     *       |          \\\n     *       |           \\          (x3,y3)\n     *       |            +----------+\n     *       |        (x2,y2)         \\\n     *       |                         \\\n     *       |                          \\\n     *       |                           +-----------------\n     *       |                         (x4,y4)\n     *       +--------------------------------------------->   stem\n     *                                                       thickness\n     *\n     *\n     * This corresponds to the following values for the\n     * `darkening-parameters' property:\n     *\n     *   (x1, y1) = (500, 400)\n     *   (x2, y2) = (1000, 275)\n     *   (x3, y3) = (1667, 275)\n     *   (x4, y4) = (2333, 0)\n     *\n     */\n\n    /* Internal calculations are done in units per thousand for */\n    /* convenience. The x axis is scaled stem width in          */\n    /* thousandths of a pixel. That is, 1000 is 1 pixel.        */\n    /* The y axis is darkening amount in thousandths of a pixel.*/\n    /* In the code, below, dividing by ppem and                 */\n    /* adjusting for emRatio converts darkenAmount to character */\n    /* space (font units).                                      */\n    CF2_Fixed  stemWidthPer1000, scaledStem;\n    FT_Int     logBase2;\n\n\n    *darkenAmount = 0;\n\n    if ( boldenAmount == 0 && !stemDarkened )\n      return;\n\n    /* protect against range problems and divide by zero */\n    if ( emRatio < cf2_floatToFixed( .01 ) )\n      return;\n\n    if ( stemDarkened )\n    {\n      FT_Int  x1 = darkenParams[0];\n      FT_Int  y1 = darkenParams[1];\n      FT_Int  x2 = darkenParams[2];\n      FT_Int  y2 = darkenParams[3];\n      FT_Int  x3 = darkenParams[4];\n      FT_Int  y3 = darkenParams[5];\n      FT_Int  x4 = darkenParams[6];\n      FT_Int  y4 = darkenParams[7];\n\n\n      /* convert from true character space to 1000 unit character space; */\n      /* add synthetic emboldening effect                                */\n\n      /* `stemWidthPer1000' will not overflow for a legitimate font      */\n\n      stemWidthPer1000 = FT_MulFix( stemWidth + boldenAmount, emRatio );\n\n      /* `scaledStem' can easily overflow, so we must clamp its maximum  */\n      /* value; the test doesn't need to be precise, but must be         */\n      /* conservative.  The clamp value (default 2333) where             */\n      /* `darkenAmount' is zero is well below the overflow value of      */\n      /* 32767.                                                          */\n      /*                                                                 */\n      /* FT_MSB computes the integer part of the base 2 logarithm.  The  */\n      /* number of bits for the product is 1 or 2 more than the sum of   */\n      /* logarithms; remembering that the 16 lowest bits of the fraction */\n      /* are dropped this is correct to within a factor of almost 4.     */\n      /* For example, 0x80.0000 * 0x80.0000 = 0x4000.0000 is 23+23 and   */\n      /* is flagged as possible overflow because 0xFF.FFFF * 0xFF.FFFF = */\n      /* 0xFFFF.FE00 is also 23+23.                                      */\n\n      logBase2 = FT_MSB( (FT_UInt32)stemWidthPer1000 ) +\n                   FT_MSB( (FT_UInt32)ppem );\n\n      if ( logBase2 >= 46 )\n        /* possible overflow */\n        scaledStem = cf2_intToFixed( x4 );\n      else\n        scaledStem = FT_MulFix( stemWidthPer1000, ppem );\n\n      /* now apply the darkening parameters */\n\n      if ( scaledStem < cf2_intToFixed( x1 ) )\n        *darkenAmount = FT_DivFix( cf2_intToFixed( y1 ), ppem );\n\n      else if ( scaledStem < cf2_intToFixed( x2 ) )\n      {\n        FT_Int  xdelta = x2 - x1;\n        FT_Int  ydelta = y2 - y1;\n        FT_Int  x      = stemWidthPer1000 -\n                           FT_DivFix( cf2_intToFixed( x1 ), ppem );\n\n\n        if ( !xdelta )\n          goto Try_x3;\n\n        *darkenAmount = FT_MulDiv( x, ydelta, xdelta ) +\n                          FT_DivFix( cf2_intToFixed( y1 ), ppem );\n      }\n\n      else if ( scaledStem < cf2_intToFixed( x3 ) )\n      {\n      Try_x3:\n        {\n          FT_Int  xdelta = x3 - x2;\n          FT_Int  ydelta = y3 - y2;\n          FT_Int  x      = stemWidthPer1000 -\n                             FT_DivFix( cf2_intToFixed( x2 ), ppem );\n\n\n          if ( !xdelta )\n            goto Try_x4;\n\n          *darkenAmount = FT_MulDiv( x, ydelta, xdelta ) +\n                            FT_DivFix( cf2_intToFixed( y2 ), ppem );\n        }\n      }\n\n      else if ( scaledStem < cf2_intToFixed( x4 ) )\n      {\n      Try_x4:\n        {\n          FT_Int  xdelta = x4 - x3;\n          FT_Int  ydelta = y4 - y3;\n          FT_Int  x      = stemWidthPer1000 -\n                             FT_DivFix( cf2_intToFixed( x3 ), ppem );\n\n\n          if ( !xdelta )\n            goto Use_y4;\n\n          *darkenAmount = FT_MulDiv( x, ydelta, xdelta ) +\n                            FT_DivFix( cf2_intToFixed( y3 ), ppem );\n        }\n      }\n\n      else\n      {\n      Use_y4:\n        *darkenAmount = FT_DivFix( cf2_intToFixed( y4 ), ppem );\n      }\n\n      /* use half the amount on each side and convert back to true */\n      /* character space                                           */\n      *darkenAmount = FT_DivFix( *darkenAmount, 2 * emRatio );\n    }\n\n    /* add synthetic emboldening effect in character space */\n    *darkenAmount += boldenAmount / 2;\n  }\n\n\n  /* set up values for the current FontDict and matrix */\n\n  /* caller's transform is adjusted for subpixel positioning */\n  static void\n  cf2_font_setup( CF2_Font           font,\n                  const CF2_Matrix*  transform )\n  {\n    /* pointer to parsed font object */\n    CFF_Decoder*  decoder = font->decoder;\n\n    FT_Bool  needExtraSetup = FALSE;\n\n    /* character space units */\n    CF2_Fixed  boldenX = font->syntheticEmboldeningAmountX;\n    CF2_Fixed  boldenY = font->syntheticEmboldeningAmountY;\n\n    CFF_SubFont  subFont;\n    CF2_Fixed    ppem;\n\n\n    /* clear previous error */\n    font->error = FT_Err_Ok;\n\n    /* if a CID fontDict has changed, we need to recompute some cached */\n    /* data                                                            */\n    subFont = cf2_getSubfont( decoder );\n    if ( font->lastSubfont != subFont )\n    {\n      font->lastSubfont = subFont;\n      needExtraSetup    = TRUE;\n    }\n\n    /* if ppem has changed, we need to recompute some cached data         */\n    /* note: because of CID font matrix concatenation, ppem and transform */\n    /*       do not necessarily track.                                    */\n    ppem = cf2_getPpemY( decoder );\n    if ( font->ppem != ppem )\n    {\n      font->ppem     = ppem;\n      needExtraSetup = TRUE;\n    }\n\n    /* copy hinted flag on each call */\n    font->hinted = (FT_Bool)( font->renderingFlags & CF2_FlagsHinted );\n\n    /* determine if transform has changed;       */\n    /* include Fontmatrix but ignore translation */\n    if ( ft_memcmp( transform,\n                    &font->currentTransform,\n                    4 * sizeof ( CF2_Fixed ) ) != 0 )\n    {\n      /* save `key' information for `cache of one' matrix data; */\n      /* save client transform, without the translation         */\n      font->currentTransform    = *transform;\n      font->currentTransform.tx =\n      font->currentTransform.ty = cf2_intToFixed( 0 );\n\n      /* TODO: FreeType transform is simple scalar; for now, use identity */\n      /*       for outer                                                  */\n      font->innerTransform   = *transform;\n      font->outerTransform.a =\n      font->outerTransform.d = cf2_intToFixed( 1 );\n      font->outerTransform.b =\n      font->outerTransform.c = cf2_intToFixed( 0 );\n\n      needExtraSetup = TRUE;\n    }\n\n    /*\n     * font->darkened is set to true if there is a stem darkening request or\n     * the font is synthetic emboldened.\n     * font->darkened controls whether to adjust blue zones, winding order,\n     * and hinting.\n     *\n     */\n    if ( font->stemDarkened != ( font->renderingFlags & CF2_FlagsDarkened ) )\n    {\n      font->stemDarkened =\n        (FT_Bool)( font->renderingFlags & CF2_FlagsDarkened );\n\n      /* blue zones depend on darkened flag */\n      needExtraSetup = TRUE;\n    }\n\n    /* recompute variables that are dependent on transform or FontDict or */\n    /* darken flag                                                        */\n    if ( needExtraSetup )\n    {\n      /* StdVW is found in the private dictionary;                       */\n      /* recompute darkening amounts whenever private dictionary or      */\n      /* transform change                                                */\n      /* Note: a rendering flag turns darkening on or off, so we want to */\n      /*       store the `on' amounts;                                   */\n      /*       darkening amount is computed in character space           */\n      /* TODO: testing size-dependent darkening here;                    */\n      /*       what to do for rotations?                                 */\n\n      CF2_Fixed  emRatio;\n      CF2_Fixed  stdHW;\n      CF2_Int    unitsPerEm = font->unitsPerEm;\n\n\n      if ( unitsPerEm == 0 )\n        unitsPerEm = 1000;\n\n      ppem = FT_MAX( cf2_intToFixed( 4 ),\n                     font->ppem ); /* use minimum ppem of 4 */\n\n#if 0\n      /* since vstem is measured in the x-direction, we use the `a' member */\n      /* of the fontMatrix                                                 */\n      emRatio = cf2_fixedFracMul( cf2_intToFixed( 1000 ), fontMatrix->a );\n#endif\n\n      /* Freetype does not preserve the fontMatrix when parsing; use */\n      /* unitsPerEm instead.                                         */\n      /* TODO: check precision of this                               */\n      emRatio     = cf2_intToFixed( 1000 ) / unitsPerEm;\n      font->stdVW = cf2_getStdVW( decoder );\n\n      if ( font->stdVW <= 0 )\n        font->stdVW = FT_DivFix( cf2_intToFixed( 75 ), emRatio );\n\n      if ( boldenX > 0 )\n      {\n        /* Ensure that boldenX is at least 1 pixel for synthetic bold font */\n        /* (similar to what Avalon does)                                   */\n        boldenX = FT_MAX( boldenX,\n                          FT_DivFix( cf2_intToFixed( unitsPerEm ), ppem ) );\n\n        /* Synthetic emboldening adds at least 1 pixel to darkenX, while */\n        /* stem darkening adds at most half pixel.  Since the purpose of */\n        /* stem darkening (readability at small sizes) is met with       */\n        /* synthetic emboldening, no need to add stem darkening for a    */\n        /* synthetic bold font.                                          */\n        cf2_computeDarkening( emRatio,\n                              ppem,\n                              font->stdVW,\n                              &font->darkenX,\n                              boldenX,\n                              FALSE,\n                              font->darkenParams );\n      }\n      else\n        cf2_computeDarkening( emRatio,\n                              ppem,\n                              font->stdVW,\n                              &font->darkenX,\n                              0,\n                              font->stemDarkened,\n                              font->darkenParams );\n\n#if 0\n      /* since hstem is measured in the y-direction, we use the `d' member */\n      /* of the fontMatrix                                                 */\n      /* TODO: use the same units per em as above; check this              */\n      emRatio = cf2_fixedFracMul( cf2_intToFixed( 1000 ), fontMatrix->d );\n#endif\n\n      /* set the default stem width, because it must be the same for all */\n      /* family members;                                                 */\n      /* choose a constant for StdHW that depends on font contrast       */\n      stdHW = cf2_getStdHW( decoder );\n\n      if ( stdHW > 0 && font->stdVW > 2 * stdHW )\n        font->stdHW = FT_DivFix( cf2_intToFixed( 75 ), emRatio );\n      else\n      {\n        /* low contrast font gets less hstem darkening */\n        font->stdHW = FT_DivFix( cf2_intToFixed( 110 ), emRatio );\n      }\n\n      cf2_computeDarkening( emRatio,\n                            ppem,\n                            font->stdHW,\n                            &font->darkenY,\n                            boldenY,\n                            font->stemDarkened,\n                            font->darkenParams );\n\n      if ( font->darkenX != 0 || font->darkenY != 0 )\n        font->darkened = TRUE;\n      else\n        font->darkened = FALSE;\n\n      font->reverseWinding = FALSE; /* initial expectation is CCW */\n\n      /* compute blue zones for this instance */\n      cf2_blues_init( &font->blues, font );\n    }\n  }\n\n\n  /* equivalent to AdobeGetOutline */\n  FT_LOCAL_DEF( FT_Error )\n  cf2_getGlyphOutline( CF2_Font           font,\n                       CF2_Buffer         charstring,\n                       const CF2_Matrix*  transform,\n                       CF2_F16Dot16*      glyphWidth )\n  {\n    FT_Error  lastError = FT_Err_Ok;\n\n    FT_Vector  translation;\n\n#if 0\n    FT_Vector  advancePoint;\n#endif\n\n    CF2_Fixed  advWidth = 0;\n    FT_Bool    needWinding;\n\n\n    /* Note: use both integer and fraction for outlines.  This allows bbox */\n    /*       to come out directly.                                         */\n\n    translation.x = transform->tx;\n    translation.y = transform->ty;\n\n    /* set up values based on transform */\n    cf2_font_setup( font, transform );\n    if ( font->error )\n      goto exit;                      /* setup encountered an error */\n\n    /* reset darken direction */\n    font->reverseWinding = FALSE;\n\n    /* winding order only affects darkening */\n    needWinding = font->darkened;\n\n    while ( 1 )\n    {\n      /* reset output buffer */\n      cf2_outline_reset( &font->outline );\n\n      /* build the outline, passing the full translation */\n      cf2_interpT2CharString( font,\n                              charstring,\n                              (CF2_OutlineCallbacks)&font->outline,\n                              &translation,\n                              FALSE,\n                              0,\n                              0,\n                              &advWidth );\n\n      if ( font->error )\n        goto exit;\n\n      if ( !needWinding )\n        break;\n\n      /* check winding order */\n      if ( font->outline.root.windingMomentum >= 0 ) /* CFF is CCW */\n        break;\n\n      /* invert darkening and render again                            */\n      /* TODO: this should be a parameter to getOutline-computeOffset */\n      font->reverseWinding = TRUE;\n\n      needWinding = FALSE;    /* exit after next iteration */\n    }\n\n    /* finish storing client outline */\n    cf2_outline_close( &font->outline );\n\n  exit:\n    /* FreeType just wants the advance width; there is no translation */\n    *glyphWidth = advWidth;\n\n    /* free resources and collect errors from objects we've used */\n    cf2_setError( &font->error, lastError );\n\n    return font->error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cf2font.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cf2font.h                                                              */\n/*                                                                         */\n/*    Adobe's code for font instances (specification).                     */\n/*                                                                         */\n/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */\n/*                                                                         */\n/*  This software, and all works of authorship, whether in source or       */\n/*  object code form as indicated by the copyright notice(s) included      */\n/*  herein (collectively, the \"Work\") is made available, and may only be   */\n/*  used, modified, and distributed under the FreeType Project License,    */\n/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */\n/*  FreeType Project License, each contributor to the Work hereby grants   */\n/*  to any individual or legal entity exercising permissions granted by    */\n/*  the FreeType Project License and this section (hereafter, \"You\" or     */\n/*  \"Your\") a perpetual, worldwide, non-exclusive, no-charge,              */\n/*  royalty-free, irrevocable (except as stated in this section) patent    */\n/*  license to make, have made, use, offer to sell, sell, import, and      */\n/*  otherwise transfer the Work, where such license applies only to those  */\n/*  patent claims licensable by such contributor that are necessarily      */\n/*  infringed by their contribution(s) alone or by combination of their    */\n/*  contribution(s) with the Work to which such contribution(s) was        */\n/*  submitted.  If You institute patent litigation against any entity      */\n/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */\n/*  the Work or a contribution incorporated within the Work constitutes    */\n/*  direct or contributory patent infringement, then any patent licenses   */\n/*  granted to You under this License for that Work shall terminate as of  */\n/*  the date such litigation is filed.                                     */\n/*                                                                         */\n/*  By using, modifying, or distributing the Work you indicate that you    */\n/*  have read and understood the terms and conditions of the               */\n/*  FreeType Project License as well as those provided in this section,    */\n/*  and you accept them fully.                                             */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CF2FONT_H__\n#define __CF2FONT_H__\n\n\n#include \"cf2ft.h\"\n#include \"cf2blues.h\"\n\n\nFT_BEGIN_HEADER\n\n\n#define CF2_OPERAND_STACK_SIZE  48\n#define CF2_MAX_SUBR            10 /* maximum subroutine nesting */\n\n\n  /* typedef is in `cf2glue.h' */\n  struct  CF2_FontRec_\n  {\n    FT_Memory  memory;\n    FT_Error   error;     /* shared error for this instance */\n\n    CF2_RenderingFlags  renderingFlags;\n\n    /* variables that depend on Transform:  */\n    /* the following have zero translation; */\n    /* inner * outer = font * original      */\n\n    CF2_Matrix  currentTransform;  /* original client matrix           */\n    CF2_Matrix  innerTransform;    /* for hinting; erect, scaled       */\n    CF2_Matrix  outerTransform;    /* post hinting; includes rotations */\n    CF2_Fixed   ppem;              /* transform-dependent              */\n\n    CF2_Int  unitsPerEm;\n\n    CF2_Fixed  syntheticEmboldeningAmountX;   /* character space units */\n    CF2_Fixed  syntheticEmboldeningAmountY;   /* character space units */\n\n    /* FreeType related members */\n    CF2_OutlineRec  outline;       /* freetype glyph outline functions */\n    CFF_Decoder*    decoder;\n    CFF_SubFont     lastSubfont;              /* FreeType parsed data; */\n                                              /* top font or subfont   */\n\n    /* these flags can vary from one call to the next */\n    FT_Bool  hinted;\n    FT_Bool  darkened;       /* true if stemDarkened or synthetic bold */\n                             /* i.e. darkenX != 0 || darkenY != 0      */\n    FT_Bool  stemDarkened;\n\n    FT_Int  darkenParams[8];              /* 1000 unit character space */\n\n    /* variables that depend on both FontDict and Transform */\n    CF2_Fixed  stdVW;     /* in character space; depends on dict entry */\n    CF2_Fixed  stdHW;     /* in character space; depends on dict entry */\n    CF2_Fixed  darkenX;                    /* character space units    */\n    CF2_Fixed  darkenY;                    /* depends on transform     */\n                                           /* and private dict (StdVW) */\n    FT_Bool  reverseWinding;               /* darken assuming          */\n                                           /* counterclockwise winding */\n\n    CF2_BluesRec  blues;                         /* computed zone data */\n  };\n\n\n  FT_LOCAL( FT_Error )\n  cf2_getGlyphOutline( CF2_Font           font,\n                       CF2_Buffer         charstring,\n                       const CF2_Matrix*  transform,\n                       CF2_F16Dot16*      glyphWidth );\n\n\nFT_END_HEADER\n\n\n#endif /* __CF2FONT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cf2ft.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cf2ft.c                                                                */\n/*                                                                         */\n/*    FreeType Glue Component to Adobe's Interpreter (body).               */\n/*                                                                         */\n/*  Copyright 2013-2014 Adobe Systems Incorporated.                        */\n/*                                                                         */\n/*  This software, and all works of authorship, whether in source or       */\n/*  object code form as indicated by the copyright notice(s) included      */\n/*  herein (collectively, the \"Work\") is made available, and may only be   */\n/*  used, modified, and distributed under the FreeType Project License,    */\n/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */\n/*  FreeType Project License, each contributor to the Work hereby grants   */\n/*  to any individual or legal entity exercising permissions granted by    */\n/*  the FreeType Project License and this section (hereafter, \"You\" or     */\n/*  \"Your\") a perpetual, worldwide, non-exclusive, no-charge,              */\n/*  royalty-free, irrevocable (except as stated in this section) patent    */\n/*  license to make, have made, use, offer to sell, sell, import, and      */\n/*  otherwise transfer the Work, where such license applies only to those  */\n/*  patent claims licensable by such contributor that are necessarily      */\n/*  infringed by their contribution(s) alone or by combination of their    */\n/*  contribution(s) with the Work to which such contribution(s) was        */\n/*  submitted.  If You institute patent litigation against any entity      */\n/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */\n/*  the Work or a contribution incorporated within the Work constitutes    */\n/*  direct or contributory patent infringement, then any patent licenses   */\n/*  granted to You under this License for that Work shall terminate as of  */\n/*  the date such litigation is filed.                                     */\n/*                                                                         */\n/*  By using, modifying, or distributing the Work you indicate that you    */\n/*  have read and understood the terms and conditions of the               */\n/*  FreeType Project License as well as those provided in this section,    */\n/*  and you accept them fully.                                             */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"cf2ft.h\"\n#include FT_INTERNAL_DEBUG_H\n\n#include \"cf2font.h\"\n#include \"cf2error.h\"\n\n\n#define CF2_MAX_SIZE  cf2_intToFixed( 2000 )    /* max ppem */\n\n\n  /*\n   * This check should avoid most internal overflow cases.  Clients should\n   * generally respond to `Glyph_Too_Big' by getting a glyph outline\n   * at EM size, scaling it and filling it as a graphics operation.\n   *\n   */\n  static FT_Error\n  cf2_checkTransform( const CF2_Matrix*  transform,\n                      CF2_Int            unitsPerEm )\n  {\n    CF2_Fixed  maxScale;\n\n\n    FT_ASSERT( unitsPerEm > 0 );\n\n    if ( transform->a <= 0 || transform->d <= 0 )\n      return FT_THROW( Invalid_Size_Handle );\n\n    FT_ASSERT( transform->b == 0 && transform->c == 0 );\n    FT_ASSERT( transform->tx == 0 && transform->ty == 0 );\n\n    if ( unitsPerEm > 0x7FFF )\n      return FT_THROW( Glyph_Too_Big );\n\n    maxScale = FT_DivFix( CF2_MAX_SIZE, cf2_intToFixed( unitsPerEm ) );\n\n    if ( transform->a > maxScale || transform->d > maxScale )\n      return FT_THROW( Glyph_Too_Big );\n\n    return FT_Err_Ok;\n  }\n\n\n  static void\n  cf2_setGlyphWidth( CF2_Outline  outline,\n                     CF2_Fixed    width )\n  {\n    CFF_Decoder*  decoder = outline->decoder;\n\n\n    FT_ASSERT( decoder );\n\n    decoder->glyph_width = cf2_fixedToInt( width );\n  }\n\n\n  /* Clean up font instance. */\n  static void\n  cf2_free_instance( void*  ptr )\n  {\n    CF2_Font  font = (CF2_Font)ptr;\n\n\n    if ( font )\n    {\n      FT_Memory  memory = font->memory;\n\n\n      (void)memory;\n    }\n  }\n\n\n  /********************************************/\n  /*                                          */\n  /* functions for handling client outline;   */\n  /* FreeType uses coordinates in 26.6 format */\n  /*                                          */\n  /********************************************/\n\n  static void\n  cf2_builder_moveTo( CF2_OutlineCallbacks      callbacks,\n                      const CF2_CallbackParams  params )\n  {\n    /* downcast the object pointer */\n    CF2_Outline   outline = (CF2_Outline)callbacks;\n    CFF_Builder*  builder;\n\n    (void)params;        /* only used in debug mode */\n\n\n    FT_ASSERT( outline && outline->decoder );\n    FT_ASSERT( params->op == CF2_PathOpMoveTo );\n\n    builder = &outline->decoder->builder;\n\n    /* note: two successive moves simply close the contour twice */\n    cff_builder_close_contour( builder );\n    builder->path_begun = 0;\n  }\n\n\n  static void\n  cf2_builder_lineTo( CF2_OutlineCallbacks      callbacks,\n                      const CF2_CallbackParams  params )\n  {\n    FT_Error  error;\n\n    /* downcast the object pointer */\n    CF2_Outline   outline = (CF2_Outline)callbacks;\n    CFF_Builder*  builder;\n\n\n    FT_ASSERT( outline && outline->decoder );\n    FT_ASSERT( params->op == CF2_PathOpLineTo );\n\n    builder = &outline->decoder->builder;\n\n    if ( !builder->path_begun )\n    {\n      /* record the move before the line; also check points and set */\n      /* `path_begun'                                               */\n      error = cff_builder_start_point( builder,\n                                       params->pt0.x,\n                                       params->pt0.y );\n      if ( error )\n      {\n        if ( !*callbacks->error )\n          *callbacks->error =  error;\n        return;\n      }\n    }\n\n    /* `cff_builder_add_point1' includes a check_points call for one point */\n    error = cff_builder_add_point1( builder,\n                                    params->pt1.x,\n                                    params->pt1.y );\n    if ( error )\n    {\n      if ( !*callbacks->error )\n        *callbacks->error =  error;\n      return;\n    }\n  }\n\n\n  static void\n  cf2_builder_cubeTo( CF2_OutlineCallbacks      callbacks,\n                      const CF2_CallbackParams  params )\n  {\n    FT_Error  error;\n\n    /* downcast the object pointer */\n    CF2_Outline   outline = (CF2_Outline)callbacks;\n    CFF_Builder*  builder;\n\n\n    FT_ASSERT( outline && outline->decoder );\n    FT_ASSERT( params->op == CF2_PathOpCubeTo );\n\n    builder = &outline->decoder->builder;\n\n    if ( !builder->path_begun )\n    {\n      /* record the move before the line; also check points and set */\n      /* `path_begun'                                               */\n      error = cff_builder_start_point( builder,\n                                       params->pt0.x,\n                                       params->pt0.y );\n      if ( error )\n      {\n        if ( !*callbacks->error )\n          *callbacks->error =  error;\n        return;\n      }\n    }\n\n    /* prepare room for 3 points: 2 off-curve, 1 on-curve */\n    error = cff_check_points( builder, 3 );\n    if ( error )\n    {\n      if ( !*callbacks->error )\n        *callbacks->error =  error;\n      return;\n    }\n\n    cff_builder_add_point( builder,\n                           params->pt1.x,\n                           params->pt1.y, 0 );\n    cff_builder_add_point( builder,\n                           params->pt2.x,\n                           params->pt2.y, 0 );\n    cff_builder_add_point( builder,\n                           params->pt3.x,\n                           params->pt3.y, 1 );\n  }\n\n\n  static void\n  cf2_outline_init( CF2_Outline  outline,\n                    FT_Memory    memory,\n                    FT_Error*    error )\n  {\n    FT_MEM_ZERO( outline, sizeof ( CF2_OutlineRec ) );\n\n    outline->root.memory = memory;\n    outline->root.error  = error;\n\n    outline->root.moveTo = cf2_builder_moveTo;\n    outline->root.lineTo = cf2_builder_lineTo;\n    outline->root.cubeTo = cf2_builder_cubeTo;\n  }\n\n\n  /* get scaling and hint flag from GlyphSlot */\n  static void\n  cf2_getScaleAndHintFlag( CFF_Decoder*  decoder,\n                           CF2_Fixed*    x_scale,\n                           CF2_Fixed*    y_scale,\n                           FT_Bool*      hinted,\n                           FT_Bool*      scaled )\n  {\n    FT_ASSERT( decoder && decoder->builder.glyph );\n\n    /* note: FreeType scale includes a factor of 64 */\n    *hinted = decoder->builder.glyph->hint;\n    *scaled = decoder->builder.glyph->scaled;\n\n    if ( *hinted )\n    {\n      *x_scale = ( decoder->builder.glyph->x_scale + 32 ) / 64;\n      *y_scale = ( decoder->builder.glyph->y_scale + 32 ) / 64;\n    }\n    else\n    {\n      /* for unhinted outlines, `cff_slot_load' does the scaling, */\n      /* thus render at `unity' scale                             */\n\n      *x_scale = 0x0400;   /* 1/64 as 16.16 */\n      *y_scale = 0x0400;\n    }\n  }\n\n\n  /* get units per em from `FT_Face' */\n  /* TODO: should handle font matrix concatenation? */\n  static FT_UShort\n  cf2_getUnitsPerEm( CFF_Decoder*  decoder )\n  {\n    FT_ASSERT( decoder && decoder->builder.face );\n    FT_ASSERT( decoder->builder.face->root.units_per_EM );\n\n    return decoder->builder.face->root.units_per_EM;\n  }\n\n\n  /* Main entry point: Render one glyph. */\n  FT_LOCAL_DEF( FT_Error )\n  cf2_decoder_parse_charstrings( CFF_Decoder*  decoder,\n                                 FT_Byte*      charstring_base,\n                                 FT_ULong      charstring_len )\n  {\n    FT_Memory  memory;\n    FT_Error   error = FT_Err_Ok;\n    CF2_Font   font;\n\n\n    FT_ASSERT( decoder && decoder->cff );\n\n    memory = decoder->builder.memory;\n\n    /* CF2 data is saved here across glyphs */\n    font = (CF2_Font)decoder->cff->cf2_instance.data;\n\n    /* on first glyph, allocate instance structure */\n    if ( decoder->cff->cf2_instance.data == NULL )\n    {\n      decoder->cff->cf2_instance.finalizer =\n        (FT_Generic_Finalizer)cf2_free_instance;\n\n      if ( FT_ALLOC( decoder->cff->cf2_instance.data,\n                     sizeof ( CF2_FontRec ) ) )\n        return FT_THROW( Out_Of_Memory );\n\n      font = (CF2_Font)decoder->cff->cf2_instance.data;\n\n      font->memory = memory;\n\n      /* initialize a client outline, to be shared by each glyph rendered */\n      cf2_outline_init( &font->outline, font->memory, &font->error );\n    }\n\n    /* save decoder; it is a stack variable and will be different on each */\n    /* call                                                               */\n    font->decoder         = decoder;\n    font->outline.decoder = decoder;\n\n    {\n      /* build parameters for Adobe engine */\n\n      CFF_Builder*  builder = &decoder->builder;\n      CFF_Driver    driver  = (CFF_Driver)FT_FACE_DRIVER( builder->face );\n\n      /* local error */\n      FT_Error       error2 = FT_Err_Ok;\n      CF2_BufferRec  buf;\n      CF2_Matrix     transform;\n      CF2_F16Dot16   glyphWidth;\n\n      FT_Bool  hinted;\n      FT_Bool  scaled;\n\n\n      /* FreeType has already looked up the GID; convert to         */\n      /* `RegionBuffer', assuming that the input has been validated */\n      FT_ASSERT( charstring_base + charstring_len >= charstring_base );\n\n      FT_ZERO( &buf );\n      buf.start =\n      buf.ptr   = charstring_base;\n      buf.end   = charstring_base + charstring_len;\n\n      FT_ZERO( &transform );\n\n      cf2_getScaleAndHintFlag( decoder,\n                               &transform.a,\n                               &transform.d,\n                               &hinted,\n                               &scaled );\n\n      font->renderingFlags = 0;\n      if ( hinted )\n        font->renderingFlags |= CF2_FlagsHinted;\n      if ( scaled && !driver->no_stem_darkening )\n        font->renderingFlags |= CF2_FlagsDarkened;\n\n      font->darkenParams[0] = driver->darken_params[0];\n      font->darkenParams[1] = driver->darken_params[1];\n      font->darkenParams[2] = driver->darken_params[2];\n      font->darkenParams[3] = driver->darken_params[3];\n      font->darkenParams[4] = driver->darken_params[4];\n      font->darkenParams[5] = driver->darken_params[5];\n      font->darkenParams[6] = driver->darken_params[6];\n      font->darkenParams[7] = driver->darken_params[7];\n\n      /* now get an outline for this glyph;      */\n      /* also get units per em to validate scale */\n      font->unitsPerEm = (CF2_Int)cf2_getUnitsPerEm( decoder );\n\n      if ( scaled )\n      {\n        error2 = cf2_checkTransform( &transform, font->unitsPerEm );\n        if ( error2 )\n          return error2;\n      }\n\n      error2 = cf2_getGlyphOutline( font, &buf, &transform, &glyphWidth );\n      if ( error2 )\n        return FT_ERR( Invalid_File_Format );\n\n      cf2_setGlyphWidth( &font->outline, glyphWidth );\n\n      return FT_Err_Ok;\n    }\n  }\n\n\n  /* get pointer to current FreeType subfont (based on current glyphID) */\n  FT_LOCAL_DEF( CFF_SubFont )\n  cf2_getSubfont( CFF_Decoder*  decoder )\n  {\n    FT_ASSERT( decoder && decoder->current_subfont );\n\n    return decoder->current_subfont;\n  }\n\n\n  /* get `y_ppem' from `CFF_Size' */\n  FT_LOCAL_DEF( CF2_Fixed )\n  cf2_getPpemY( CFF_Decoder*  decoder )\n  {\n    FT_ASSERT( decoder                          &&\n               decoder->builder.face            &&\n               decoder->builder.face->root.size );\n\n    /*\n     * Note that `y_ppem' can be zero if there wasn't a call to\n     * `FT_Set_Char_Size' or something similar.  However, this isn't a\n     * problem since we come to this place in the code only if\n     * FT_LOAD_NO_SCALE is set (the other case gets caught by\n     * `cf2_checkTransform').  The ppem value is needed to compute the stem\n     * darkening, which is disabled for getting the unscaled outline.\n     *\n     */\n    return cf2_intToFixed(\n             decoder->builder.face->root.size->metrics.y_ppem );\n  }\n\n\n  /* get standard stem widths for the current subfont; */\n  /* FreeType stores these as integer font units       */\n  /* (note: variable names seem swapped)               */\n  FT_LOCAL_DEF( CF2_Fixed )\n  cf2_getStdVW( CFF_Decoder*  decoder )\n  {\n    FT_ASSERT( decoder && decoder->current_subfont );\n\n    return cf2_intToFixed(\n             decoder->current_subfont->private_dict.standard_height );\n  }\n\n\n  FT_LOCAL_DEF( CF2_Fixed )\n  cf2_getStdHW( CFF_Decoder*  decoder )\n  {\n    FT_ASSERT( decoder && decoder->current_subfont );\n\n    return cf2_intToFixed(\n             decoder->current_subfont->private_dict.standard_width );\n  }\n\n\n  /* note: FreeType stores 1000 times the actual value for `BlueScale' */\n  FT_LOCAL_DEF( void )\n  cf2_getBlueMetrics( CFF_Decoder*  decoder,\n                      CF2_Fixed*    blueScale,\n                      CF2_Fixed*    blueShift,\n                      CF2_Fixed*    blueFuzz )\n  {\n    FT_ASSERT( decoder && decoder->current_subfont );\n\n    *blueScale = FT_DivFix(\n                   decoder->current_subfont->private_dict.blue_scale,\n                   cf2_intToFixed( 1000 ) );\n    *blueShift = cf2_intToFixed(\n                   decoder->current_subfont->private_dict.blue_shift );\n    *blueFuzz  = cf2_intToFixed(\n                   decoder->current_subfont->private_dict.blue_fuzz );\n  }\n\n\n  /* get blue values counts and arrays; the FreeType parser has validated */\n  /* the counts and verified that each is an even number                  */\n  FT_LOCAL_DEF( void )\n  cf2_getBlueValues( CFF_Decoder*  decoder,\n                     size_t*       count,\n                     FT_Pos*      *data )\n  {\n    FT_ASSERT( decoder && decoder->current_subfont );\n\n    *count = decoder->current_subfont->private_dict.num_blue_values;\n    *data  = (FT_Pos*)\n               &decoder->current_subfont->private_dict.blue_values;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cf2_getOtherBlues( CFF_Decoder*  decoder,\n                     size_t*       count,\n                     FT_Pos*      *data )\n  {\n    FT_ASSERT( decoder && decoder->current_subfont );\n\n    *count = decoder->current_subfont->private_dict.num_other_blues;\n    *data  = (FT_Pos*)\n               &decoder->current_subfont->private_dict.other_blues;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cf2_getFamilyBlues( CFF_Decoder*  decoder,\n                      size_t*       count,\n                      FT_Pos*      *data )\n  {\n    FT_ASSERT( decoder && decoder->current_subfont );\n\n    *count = decoder->current_subfont->private_dict.num_family_blues;\n    *data  = (FT_Pos*)\n               &decoder->current_subfont->private_dict.family_blues;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cf2_getFamilyOtherBlues( CFF_Decoder*  decoder,\n                           size_t*       count,\n                           FT_Pos*      *data )\n  {\n    FT_ASSERT( decoder && decoder->current_subfont );\n\n    *count = decoder->current_subfont->private_dict.num_family_other_blues;\n    *data  = (FT_Pos*)\n               &decoder->current_subfont->private_dict.family_other_blues;\n  }\n\n\n  FT_LOCAL_DEF( CF2_Int )\n  cf2_getLanguageGroup( CFF_Decoder*  decoder )\n  {\n    FT_ASSERT( decoder && decoder->current_subfont );\n\n    return decoder->current_subfont->private_dict.language_group;\n  }\n\n\n  /* convert unbiased subroutine index to `CF2_Buffer' and */\n  /* return 0 on success                                   */\n  FT_LOCAL_DEF( CF2_Int )\n  cf2_initGlobalRegionBuffer( CFF_Decoder*  decoder,\n                              CF2_UInt      idx,\n                              CF2_Buffer    buf )\n  {\n    FT_ASSERT( decoder );\n\n    FT_ZERO( buf );\n\n    idx += decoder->globals_bias;\n    if ( idx >= decoder->num_globals )\n      return TRUE;     /* error */\n\n    FT_ASSERT( decoder->globals );\n\n    buf->start =\n    buf->ptr   = decoder->globals[idx];\n    buf->end   = decoder->globals[idx + 1];\n\n    return FALSE;      /* success */\n  }\n\n\n  /* convert AdobeStandardEncoding code to CF2_Buffer; */\n  /* used for seac component                           */\n  FT_LOCAL_DEF( FT_Error )\n  cf2_getSeacComponent( CFF_Decoder*  decoder,\n                        CF2_UInt      code,\n                        CF2_Buffer    buf )\n  {\n    CF2_Int   gid;\n    FT_Byte*  charstring;\n    FT_ULong  len;\n    FT_Error  error;\n\n\n    FT_ASSERT( decoder );\n\n    FT_ZERO( buf );\n\n    gid = cff_lookup_glyph_by_stdcharcode( decoder->cff, code );\n    if ( gid < 0 )\n      return FT_THROW( Invalid_Glyph_Format );\n\n    error = cff_get_glyph_data( decoder->builder.face,\n                                gid,\n                                &charstring,\n                                &len );\n    /* TODO: for now, just pass the FreeType error through */\n    if ( error )\n      return error;\n\n    /* assume input has been validated */\n    FT_ASSERT( charstring + len >= charstring );\n\n    buf->start = charstring;\n    buf->end   = charstring + len;\n    buf->ptr   = buf->start;\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cf2_freeSeacComponent( CFF_Decoder*  decoder,\n                         CF2_Buffer    buf )\n  {\n    FT_ASSERT( decoder );\n\n    cff_free_glyph_data( decoder->builder.face,\n                         (FT_Byte**)&buf->start,\n                         (FT_ULong)( buf->end - buf->start ) );\n  }\n\n\n  FT_LOCAL_DEF( CF2_Int )\n  cf2_initLocalRegionBuffer( CFF_Decoder*  decoder,\n                             CF2_UInt      idx,\n                             CF2_Buffer    buf )\n  {\n    FT_ASSERT( decoder );\n\n    FT_ZERO( buf );\n\n    idx += decoder->locals_bias;\n    if ( idx >= decoder->num_locals )\n      return TRUE;     /* error */\n\n    FT_ASSERT( decoder->locals );\n\n    buf->start =\n    buf->ptr   = decoder->locals[idx];\n    buf->end   = decoder->locals[idx + 1];\n\n    return FALSE;      /* success */\n  }\n\n\n  FT_LOCAL_DEF( CF2_Fixed )\n  cf2_getDefaultWidthX( CFF_Decoder*  decoder )\n  {\n    FT_ASSERT( decoder && decoder->current_subfont );\n\n    return cf2_intToFixed(\n             decoder->current_subfont->private_dict.default_width );\n  }\n\n\n  FT_LOCAL_DEF( CF2_Fixed )\n  cf2_getNominalWidthX( CFF_Decoder*  decoder )\n  {\n    FT_ASSERT( decoder && decoder->current_subfont );\n\n    return cf2_intToFixed(\n             decoder->current_subfont->private_dict.nominal_width );\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cf2_outline_reset( CF2_Outline  outline )\n  {\n    CFF_Decoder*  decoder = outline->decoder;\n\n\n    FT_ASSERT( decoder );\n\n    outline->root.windingMomentum = 0;\n\n    FT_GlyphLoader_Rewind( decoder->builder.loader );\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cf2_outline_close( CF2_Outline  outline )\n  {\n    CFF_Decoder*  decoder = outline->decoder;\n\n\n    FT_ASSERT( decoder );\n\n    cff_builder_close_contour( &decoder->builder );\n\n    FT_GlyphLoader_Add( decoder->builder.loader );\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cf2ft.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cf2ft.h                                                                */\n/*                                                                         */\n/*    FreeType Glue Component to Adobe's Interpreter (specification).      */\n/*                                                                         */\n/*  Copyright 2013 Adobe Systems Incorporated.                             */\n/*                                                                         */\n/*  This software, and all works of authorship, whether in source or       */\n/*  object code form as indicated by the copyright notice(s) included      */\n/*  herein (collectively, the \"Work\") is made available, and may only be   */\n/*  used, modified, and distributed under the FreeType Project License,    */\n/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */\n/*  FreeType Project License, each contributor to the Work hereby grants   */\n/*  to any individual or legal entity exercising permissions granted by    */\n/*  the FreeType Project License and this section (hereafter, \"You\" or     */\n/*  \"Your\") a perpetual, worldwide, non-exclusive, no-charge,              */\n/*  royalty-free, irrevocable (except as stated in this section) patent    */\n/*  license to make, have made, use, offer to sell, sell, import, and      */\n/*  otherwise transfer the Work, where such license applies only to those  */\n/*  patent claims licensable by such contributor that are necessarily      */\n/*  infringed by their contribution(s) alone or by combination of their    */\n/*  contribution(s) with the Work to which such contribution(s) was        */\n/*  submitted.  If You institute patent litigation against any entity      */\n/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */\n/*  the Work or a contribution incorporated within the Work constitutes    */\n/*  direct or contributory patent infringement, then any patent licenses   */\n/*  granted to You under this License for that Work shall terminate as of  */\n/*  the date such litigation is filed.                                     */\n/*                                                                         */\n/*  By using, modifying, or distributing the Work you indicate that you    */\n/*  have read and understood the terms and conditions of the               */\n/*  FreeType Project License as well as those provided in this section,    */\n/*  and you accept them fully.                                             */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CF2FT_H__\n#define __CF2FT_H__\n\n\n#include \"cf2types.h\"\n\n\n  /* TODO: disable asserts for now */\n#define CF2_NDEBUG\n\n\n#include FT_SYSTEM_H\n\n#include \"cf2glue.h\"\n#include \"cffgload.h\"    /* for CFF_Decoder */\n\n\nFT_BEGIN_HEADER\n\n\n  FT_LOCAL( FT_Error )\n  cf2_decoder_parse_charstrings( CFF_Decoder*  decoder,\n                                 FT_Byte*      charstring_base,\n                                 FT_ULong      charstring_len );\n\n  FT_LOCAL( CFF_SubFont )\n  cf2_getSubfont( CFF_Decoder*  decoder );\n\n\n  FT_LOCAL( CF2_Fixed )\n  cf2_getPpemY( CFF_Decoder*  decoder );\n  FT_LOCAL( CF2_Fixed )\n  cf2_getStdVW( CFF_Decoder*  decoder );\n  FT_LOCAL( CF2_Fixed )\n  cf2_getStdHW( CFF_Decoder*  decoder );\n\n  FT_LOCAL( void )\n  cf2_getBlueMetrics( CFF_Decoder*  decoder,\n                      CF2_Fixed*    blueScale,\n                      CF2_Fixed*    blueShift,\n                      CF2_Fixed*    blueFuzz );\n  FT_LOCAL( void )\n  cf2_getBlueValues( CFF_Decoder*  decoder,\n                     size_t*       count,\n                     FT_Pos*      *data );\n  FT_LOCAL( void )\n  cf2_getOtherBlues( CFF_Decoder*  decoder,\n                     size_t*       count,\n                     FT_Pos*      *data );\n  FT_LOCAL( void )\n  cf2_getFamilyBlues( CFF_Decoder*  decoder,\n                      size_t*       count,\n                      FT_Pos*      *data );\n  FT_LOCAL( void )\n  cf2_getFamilyOtherBlues( CFF_Decoder*  decoder,\n                           size_t*       count,\n                           FT_Pos*      *data );\n\n  FT_LOCAL( CF2_Int )\n  cf2_getLanguageGroup( CFF_Decoder*  decoder );\n\n  FT_LOCAL( CF2_Int )\n  cf2_initGlobalRegionBuffer( CFF_Decoder*  decoder,\n                              CF2_UInt      idx,\n                              CF2_Buffer    buf );\n  FT_LOCAL( FT_Error )\n  cf2_getSeacComponent( CFF_Decoder*  decoder,\n                        CF2_UInt      code,\n                        CF2_Buffer    buf );\n  FT_LOCAL( void )\n  cf2_freeSeacComponent( CFF_Decoder*  decoder,\n                         CF2_Buffer    buf );\n  FT_LOCAL( CF2_Int )\n  cf2_initLocalRegionBuffer( CFF_Decoder*  decoder,\n                             CF2_UInt      idx,\n                             CF2_Buffer    buf );\n\n  FT_LOCAL( CF2_Fixed )\n  cf2_getDefaultWidthX( CFF_Decoder*  decoder );\n  FT_LOCAL( CF2_Fixed )\n  cf2_getNominalWidthX( CFF_Decoder*  decoder );\n\n\n  /*\n   * FreeType client outline\n   *\n   * process output from the charstring interpreter\n   */\n  typedef struct  CF2_OutlineRec_\n  {\n    CF2_OutlineCallbacksRec  root;        /* base class must be first */\n    CFF_Decoder*             decoder;\n\n  } CF2_OutlineRec, *CF2_Outline;\n\n\n  FT_LOCAL( void )\n  cf2_outline_reset( CF2_Outline  outline );\n  FT_LOCAL( void )\n  cf2_outline_close( CF2_Outline  outline );\n\n\nFT_END_HEADER\n\n\n#endif /* __CF2FT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cf2glue.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cf2glue.h                                                              */\n/*                                                                         */\n/*    Adobe's code for shared stuff (specification only).                  */\n/*                                                                         */\n/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */\n/*                                                                         */\n/*  This software, and all works of authorship, whether in source or       */\n/*  object code form as indicated by the copyright notice(s) included      */\n/*  herein (collectively, the \"Work\") is made available, and may only be   */\n/*  used, modified, and distributed under the FreeType Project License,    */\n/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */\n/*  FreeType Project License, each contributor to the Work hereby grants   */\n/*  to any individual or legal entity exercising permissions granted by    */\n/*  the FreeType Project License and this section (hereafter, \"You\" or     */\n/*  \"Your\") a perpetual, worldwide, non-exclusive, no-charge,              */\n/*  royalty-free, irrevocable (except as stated in this section) patent    */\n/*  license to make, have made, use, offer to sell, sell, import, and      */\n/*  otherwise transfer the Work, where such license applies only to those  */\n/*  patent claims licensable by such contributor that are necessarily      */\n/*  infringed by their contribution(s) alone or by combination of their    */\n/*  contribution(s) with the Work to which such contribution(s) was        */\n/*  submitted.  If You institute patent litigation against any entity      */\n/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */\n/*  the Work or a contribution incorporated within the Work constitutes    */\n/*  direct or contributory patent infringement, then any patent licenses   */\n/*  granted to You under this License for that Work shall terminate as of  */\n/*  the date such litigation is filed.                                     */\n/*                                                                         */\n/*  By using, modifying, or distributing the Work you indicate that you    */\n/*  have read and understood the terms and conditions of the               */\n/*  FreeType Project License as well as those provided in this section,    */\n/*  and you accept them fully.                                             */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CF2GLUE_H__\n#define __CF2GLUE_H__\n\n\n/* common includes for other modules */\n#include \"cf2error.h\"\n#include \"cf2fixed.h\"\n#include \"cf2arrst.h\"\n#include \"cf2read.h\"\n\n\nFT_BEGIN_HEADER\n\n\n  /* rendering parameters */\n\n  /* apply hints to rendered glyphs */\n#define CF2_FlagsHinted    1\n  /* for testing */\n#define CF2_FlagsDarkened  2\n\n  /* type for holding the flags */\n  typedef CF2_Int  CF2_RenderingFlags;\n\n\n  /* elements of a glyph outline */\n  typedef enum  CF2_PathOp_\n  {\n    CF2_PathOpMoveTo = 1,     /* change the current point */\n    CF2_PathOpLineTo = 2,     /* line                     */\n    CF2_PathOpQuadTo = 3,     /* quadratic curve          */\n    CF2_PathOpCubeTo = 4      /* cubic curve              */\n\n  } CF2_PathOp;\n\n\n  /* a matrix of fixed point values */\n  typedef struct  CF2_Matrix_\n  {\n    CF2_F16Dot16  a;\n    CF2_F16Dot16  b;\n    CF2_F16Dot16  c;\n    CF2_F16Dot16  d;\n    CF2_F16Dot16  tx;\n    CF2_F16Dot16  ty;\n\n  } CF2_Matrix;\n\n\n  /* these typedefs are needed by more than one header file */\n  /* and gcc compiler doesn't allow redefinition            */\n  typedef struct CF2_FontRec_  CF2_FontRec, *CF2_Font;\n  typedef struct CF2_HintRec_  CF2_HintRec, *CF2_Hint;\n\n\n  /* A common structure for all callback parameters.                       */\n  /*                                                                       */\n  /* Some members may be unused.  For example, `pt0' is not used for       */\n  /* `moveTo' and `pt3' is not used for `quadTo'.  The initial point `pt0' */\n  /* is included for each path element for generality; curve conversions   */\n  /* need it.  The `op' parameter allows one function to handle multiple   */\n  /* element types.                                                        */\n\n  typedef struct  CF2_CallbackParamsRec_\n  {\n    FT_Vector  pt0;\n    FT_Vector  pt1;\n    FT_Vector  pt2;\n    FT_Vector  pt3;\n\n    CF2_Int  op;\n\n  } CF2_CallbackParamsRec, *CF2_CallbackParams;\n\n\n  /* forward reference */\n  typedef struct CF2_OutlineCallbacksRec_  CF2_OutlineCallbacksRec,\n                                           *CF2_OutlineCallbacks;\n\n  /* callback function pointers */\n  typedef void\n  (*CF2_Callback_Type)( CF2_OutlineCallbacks      callbacks,\n                        const CF2_CallbackParams  params );\n\n\n  struct  CF2_OutlineCallbacksRec_\n  {\n    CF2_Callback_Type  moveTo;\n    CF2_Callback_Type  lineTo;\n    CF2_Callback_Type  quadTo;\n    CF2_Callback_Type  cubeTo;\n\n    CF2_Int  windingMomentum;    /* for winding order detection */\n\n    FT_Memory  memory;\n    FT_Error*  error;\n  };\n\n\nFT_END_HEADER\n\n\n#endif /* __CF2GLUE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cf2hints.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cf2hints.c                                                             */\n/*                                                                         */\n/*    Adobe's code for handling CFF hints (body).                          */\n/*                                                                         */\n/*  Copyright 2007-2014 Adobe Systems Incorporated.                        */\n/*                                                                         */\n/*  This software, and all works of authorship, whether in source or       */\n/*  object code form as indicated by the copyright notice(s) included      */\n/*  herein (collectively, the \"Work\") is made available, and may only be   */\n/*  used, modified, and distributed under the FreeType Project License,    */\n/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */\n/*  FreeType Project License, each contributor to the Work hereby grants   */\n/*  to any individual or legal entity exercising permissions granted by    */\n/*  the FreeType Project License and this section (hereafter, \"You\" or     */\n/*  \"Your\") a perpetual, worldwide, non-exclusive, no-charge,              */\n/*  royalty-free, irrevocable (except as stated in this section) patent    */\n/*  license to make, have made, use, offer to sell, sell, import, and      */\n/*  otherwise transfer the Work, where such license applies only to those  */\n/*  patent claims licensable by such contributor that are necessarily      */\n/*  infringed by their contribution(s) alone or by combination of their    */\n/*  contribution(s) with the Work to which such contribution(s) was        */\n/*  submitted.  If You institute patent litigation against any entity      */\n/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */\n/*  the Work or a contribution incorporated within the Work constitutes    */\n/*  direct or contributory patent infringement, then any patent licenses   */\n/*  granted to You under this License for that Work shall terminate as of  */\n/*  the date such litigation is filed.                                     */\n/*                                                                         */\n/*  By using, modifying, or distributing the Work you indicate that you    */\n/*  have read and understood the terms and conditions of the               */\n/*  FreeType Project License as well as those provided in this section,    */\n/*  and you accept them fully.                                             */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"cf2ft.h\"\n#include FT_INTERNAL_DEBUG_H\n\n#include \"cf2glue.h\"\n#include \"cf2font.h\"\n#include \"cf2hints.h\"\n#include \"cf2intrp.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_cf2hints\n\n\n  typedef struct  CF2_HintMoveRec_\n  {\n    size_t     j;          /* index of upper hint map edge   */\n    CF2_Fixed  moveUp;     /* adjustment to optimum position */\n\n  } CF2_HintMoveRec, *CF2_HintMove;\n\n\n  /* Compute angular momentum for winding order detection.  It is called */\n  /* for all lines and curves, but not necessarily in element order.     */\n  static CF2_Int\n  cf2_getWindingMomentum( CF2_Fixed  x1,\n                          CF2_Fixed  y1,\n                          CF2_Fixed  x2,\n                          CF2_Fixed  y2 )\n  {\n    /* cross product of pt1 position from origin with pt2 position from  */\n    /* pt1; we reduce the precision so that the result fits into 32 bits */\n\n    return ( x1 >> 16 ) * ( ( y2 - y1 ) >> 16 ) -\n           ( y1 >> 16 ) * ( ( x2 - x1 ) >> 16 );\n  }\n\n\n  /*\n   * Construct from a StemHint; this is used as a parameter to\n   * `cf2_blues_capture'.\n   * `hintOrigin' is the character space displacement of a seac accent.\n   * Adjust stem hint for darkening here.\n   *\n   */\n  static void\n  cf2_hint_init( CF2_Hint            hint,\n                 const CF2_ArrStack  stemHintArray,\n                 size_t              indexStemHint,\n                 const CF2_Font      font,\n                 CF2_Fixed           hintOrigin,\n                 CF2_Fixed           scale,\n                 FT_Bool             bottom )\n  {\n    CF2_Fixed               width;\n    const CF2_StemHintRec*  stemHint;\n\n\n    FT_ZERO( hint );\n\n    stemHint = (const CF2_StemHintRec*)cf2_arrstack_getPointer(\n                                         stemHintArray,\n                                         indexStemHint );\n\n    width = stemHint->max - stemHint->min;\n\n    if ( width == cf2_intToFixed( -21 ) )\n    {\n      /* ghost bottom */\n\n      if ( bottom )\n      {\n        hint->csCoord = stemHint->max;\n        hint->flags   = CF2_GhostBottom;\n      }\n      else\n        hint->flags = 0;\n    }\n\n    else if ( width == cf2_intToFixed( -20 ) )\n    {\n      /* ghost top */\n\n      if ( bottom )\n        hint->flags = 0;\n      else\n      {\n        hint->csCoord = stemHint->min;\n        hint->flags   = CF2_GhostTop;\n      }\n    }\n\n    else if ( width < 0 )\n    {\n      /* inverted pair */\n\n      /*\n       * Hints with negative widths were produced by an early version of a\n       * non-Adobe font tool.  The Type 2 spec allows edge (ghost) hints\n       * with negative widths, but says\n       *\n       *   All other negative widths have undefined meaning.\n       *\n       * CoolType has a silent workaround that negates the hint width; for\n       * permissive mode, we do the same here.\n       *\n       * Note: Such fonts cannot use ghost hints, but should otherwise work.\n       * Note: Some poor hints in our faux fonts can produce negative\n       *       widths at some blends.  For example, see a light weight of\n       *       `u' in ASerifMM.\n       *\n       */\n      if ( bottom )\n      {\n        hint->csCoord = stemHint->max;\n        hint->flags   = CF2_PairBottom;\n      }\n      else\n      {\n        hint->csCoord = stemHint->min;\n        hint->flags   = CF2_PairTop;\n      }\n    }\n\n    else\n    {\n      /* normal pair */\n\n      if ( bottom )\n      {\n        hint->csCoord = stemHint->min;\n        hint->flags   = CF2_PairBottom;\n      }\n      else\n      {\n        hint->csCoord = stemHint->max;\n        hint->flags   = CF2_PairTop;\n      }\n    }\n\n    /* Now that ghost hints have been detected, adjust this edge for      */\n    /* darkening.  Bottoms are not changed; tops are incremented by twice */\n    /* `darkenY'.                                                         */\n    if ( cf2_hint_isTop( hint ) )\n      hint->csCoord += 2 * font->darkenY;\n\n    hint->csCoord += hintOrigin;\n    hint->scale    = scale;\n    hint->index    = indexStemHint;   /* index in original stem hint array */\n\n    /* if original stem hint has been used, use the same position */\n    if ( hint->flags != 0 && stemHint->used )\n    {\n      if ( cf2_hint_isTop( hint ) )\n        hint->dsCoord = stemHint->maxDS;\n      else\n        hint->dsCoord = stemHint->minDS;\n\n      cf2_hint_lock( hint );\n    }\n    else\n      hint->dsCoord = FT_MulFix( hint->csCoord, scale );\n  }\n\n\n  /* initialize an invalid hint map element */\n  static void\n  cf2_hint_initZero( CF2_Hint  hint )\n  {\n    FT_ZERO( hint );\n  }\n\n\n  FT_LOCAL_DEF( FT_Bool )\n  cf2_hint_isValid( const CF2_Hint  hint )\n  {\n    return (FT_Bool)( hint->flags != 0 );\n  }\n\n\n  static FT_Bool\n  cf2_hint_isPair( const CF2_Hint  hint )\n  {\n    return (FT_Bool)( ( hint->flags                      &\n                        ( CF2_PairBottom | CF2_PairTop ) ) != 0 );\n  }\n\n\n  static FT_Bool\n  cf2_hint_isPairTop( const CF2_Hint  hint )\n  {\n    return (FT_Bool)( ( hint->flags & CF2_PairTop ) != 0 );\n  }\n\n\n  FT_LOCAL_DEF( FT_Bool )\n  cf2_hint_isTop( const CF2_Hint  hint )\n  {\n    return (FT_Bool)( ( hint->flags                    &\n                        ( CF2_PairTop | CF2_GhostTop ) ) != 0 );\n  }\n\n\n  FT_LOCAL_DEF( FT_Bool )\n  cf2_hint_isBottom( const CF2_Hint  hint )\n  {\n    return (FT_Bool)( ( hint->flags                          &\n                        ( CF2_PairBottom | CF2_GhostBottom ) ) != 0 );\n  }\n\n\n  static FT_Bool\n  cf2_hint_isLocked( const CF2_Hint  hint )\n  {\n    return (FT_Bool)( ( hint->flags & CF2_Locked ) != 0 );\n  }\n\n\n  static FT_Bool\n  cf2_hint_isSynthetic( const CF2_Hint  hint )\n  {\n    return (FT_Bool)( ( hint->flags & CF2_Synthetic ) != 0 );\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cf2_hint_lock( CF2_Hint  hint )\n  {\n    hint->flags |= CF2_Locked;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cf2_hintmap_init( CF2_HintMap   hintmap,\n                    CF2_Font      font,\n                    CF2_HintMap   initialMap,\n                    CF2_ArrStack  hintMoves,\n                    CF2_Fixed     scale )\n  {\n    FT_ZERO( hintmap );\n\n    /* copy parameters from font instance */\n    hintmap->hinted         = font->hinted;\n    hintmap->scale          = scale;\n    hintmap->font           = font;\n    hintmap->initialHintMap = initialMap;\n    /* will clear in `cf2_hintmap_adjustHints' */\n    hintmap->hintMoves      = hintMoves;\n  }\n\n\n  static FT_Bool\n  cf2_hintmap_isValid( const CF2_HintMap  hintmap )\n  {\n    return hintmap->isValid;\n  }\n\n\n  /* transform character space coordinate to device space using hint map */\n  static CF2_Fixed\n  cf2_hintmap_map( CF2_HintMap  hintmap,\n                   CF2_Fixed    csCoord )\n  {\n    if ( hintmap->count == 0 || ! hintmap->hinted )\n    {\n      /* there are no hints; use uniform scale and zero offset */\n      return FT_MulFix( csCoord, hintmap->scale );\n    }\n    else\n    {\n      /* start linear search from last hit */\n      CF2_UInt  i = hintmap->lastIndex;\n\n      FT_ASSERT( hintmap->lastIndex < CF2_MAX_HINT_EDGES );\n\n      /* search up */\n      while ( i < hintmap->count - 1                  &&\n              csCoord >= hintmap->edge[i + 1].csCoord )\n        i += 1;\n\n      /* search down */\n      while ( i > 0 && csCoord < hintmap->edge[i].csCoord )\n        i -= 1;\n\n      hintmap->lastIndex = i;\n\n      if ( i == 0 && csCoord < hintmap->edge[0].csCoord )\n      {\n        /* special case for points below first edge: use uniform scale */\n        return FT_MulFix( csCoord - hintmap->edge[0].csCoord,\n                          hintmap->scale ) +\n                 hintmap->edge[0].dsCoord;\n      }\n      else\n      {\n        /*\n         * Note: entries with duplicate csCoord are allowed.\n         * Use edge[i], the highest entry where csCoord >= entry[i].csCoord\n         */\n        return FT_MulFix( csCoord - hintmap->edge[i].csCoord,\n                          hintmap->edge[i].scale ) +\n                 hintmap->edge[i].dsCoord;\n      }\n    }\n  }\n\n\n  /*\n   * This hinting policy moves a hint pair in device space so that one of\n   * its two edges is on a device pixel boundary (its fractional part is\n   * zero).  `cf2_hintmap_insertHint' guarantees no overlap in CS\n   * space.  Ensure here that there is no overlap in DS.\n   *\n   * In the first pass, edges are adjusted relative to adjacent hints.\n   * Those that are below have already been adjusted.  Those that are\n   * above have not yet been adjusted.  If a hint above blocks an\n   * adjustment to an optimal position, we will try again in a second\n   * pass.  The second pass is top-down.\n   *\n   */\n\n  static void\n  cf2_hintmap_adjustHints( CF2_HintMap  hintmap )\n  {\n    size_t  i, j;\n\n\n    cf2_arrstack_clear( hintmap->hintMoves );      /* working storage */\n\n    /*\n     * First pass is bottom-up (font hint order) without look-ahead.\n     * Locked edges are already adjusted.\n     * Unlocked edges begin with dsCoord from `initialHintMap'.\n     * Save edges that are not optimally adjusted in `hintMoves' array,\n     * and process them in second pass.\n     */\n\n    for ( i = 0; i < hintmap->count; i++ )\n    {\n      FT_Bool  isPair = cf2_hint_isPair( &hintmap->edge[i] );\n\n\n      /* index of upper edge (same value for ghost hint) */\n      j = isPair ? i + 1 : i;\n\n      FT_ASSERT( j < hintmap->count );\n      FT_ASSERT( cf2_hint_isValid( &hintmap->edge[i] ) );\n      FT_ASSERT( cf2_hint_isValid( &hintmap->edge[j] ) );\n      FT_ASSERT( cf2_hint_isLocked( &hintmap->edge[i] ) ==\n                   cf2_hint_isLocked( &hintmap->edge[j] ) );\n\n      if ( !cf2_hint_isLocked( &hintmap->edge[i] ) )\n      {\n        /* hint edge is not locked, we can adjust it */\n        CF2_Fixed  fracDown = cf2_fixedFraction( hintmap->edge[i].dsCoord );\n        CF2_Fixed  fracUp   = cf2_fixedFraction( hintmap->edge[j].dsCoord );\n\n        /* calculate all four possibilities; moves down are negative */\n        CF2_Fixed  downMoveDown = 0 - fracDown;\n        CF2_Fixed  upMoveDown   = 0 - fracUp;\n        CF2_Fixed  downMoveUp   = fracDown == 0\n                                    ? 0\n                                    : cf2_intToFixed( 1 ) - fracDown;\n        CF2_Fixed  upMoveUp     = fracUp == 0\n                                    ? 0\n                                    : cf2_intToFixed( 1 ) - fracUp;\n\n        /* smallest move up */\n        CF2_Fixed  moveUp   = FT_MIN( downMoveUp, upMoveUp );\n        /* smallest move down */\n        CF2_Fixed  moveDown = FT_MAX( downMoveDown, upMoveDown );\n\n        /* final amount to move edge or edge pair */\n        CF2_Fixed  move;\n\n        CF2_Fixed  downMinCounter = CF2_MIN_COUNTER;\n        CF2_Fixed  upMinCounter   = CF2_MIN_COUNTER;\n        FT_Bool    saveEdge       = FALSE;\n\n\n        /* minimum counter constraint doesn't apply when adjacent edges */\n        /* are synthetic                                                */\n        /* TODO: doesn't seem a big effect; for now, reduce the code    */\n#if 0\n        if ( i == 0                                        ||\n             cf2_hint_isSynthetic( &hintmap->edge[i - 1] ) )\n          downMinCounter = 0;\n\n        if ( j >= hintmap->count - 1                       ||\n             cf2_hint_isSynthetic( &hintmap->edge[j + 1] ) )\n          upMinCounter = 0;\n#endif\n\n        /* is there room to move up?                                    */\n        /* there is if we are at top of array or the next edge is at or */\n        /* beyond proposed move up?                                     */\n        if ( j >= hintmap->count - 1                            ||\n             hintmap->edge[j + 1].dsCoord >=\n               hintmap->edge[j].dsCoord + moveUp + upMinCounter )\n        {\n          /* there is room to move up; is there also room to move down? */\n          if ( i == 0                                                 ||\n               hintmap->edge[i - 1].dsCoord <=\n                 hintmap->edge[i].dsCoord + moveDown - downMinCounter )\n          {\n            /* move smaller absolute amount */\n            move = ( -moveDown < moveUp ) ? moveDown : moveUp;  /* optimum */\n          }\n          else\n            move = moveUp;\n        }\n        else\n        {\n          /* is there room to move down? */\n          if ( i == 0                                                 ||\n               hintmap->edge[i - 1].dsCoord <=\n                 hintmap->edge[i].dsCoord + moveDown - downMinCounter )\n          {\n            move     = moveDown;\n            /* true if non-optimum move */\n            saveEdge = (FT_Bool)( moveUp < -moveDown );\n          }\n          else\n          {\n            /* no room to move either way without overlapping or reducing */\n            /* the counter too much                                       */\n            move     = 0;\n            saveEdge = TRUE;\n          }\n        }\n\n        /* Identify non-moves and moves down that aren't optimal, and save */\n        /* them for second pass.                                           */\n        /* Do this only if there is an unlocked edge above (which could    */\n        /* possibly move).                                                 */\n        if ( saveEdge                                    &&\n             j < hintmap->count - 1                      &&\n             !cf2_hint_isLocked( &hintmap->edge[j + 1] ) )\n        {\n          CF2_HintMoveRec  savedMove;\n\n\n          savedMove.j      = j;\n          /* desired adjustment in second pass */\n          savedMove.moveUp = moveUp - move;\n\n          cf2_arrstack_push( hintmap->hintMoves, &savedMove );\n        }\n\n        /* move the edge(s) */\n        hintmap->edge[i].dsCoord += move;\n        if ( isPair )\n          hintmap->edge[j].dsCoord += move;\n      }\n\n      /* assert there are no overlaps in device space */\n      FT_ASSERT( i == 0                                                   ||\n                 hintmap->edge[i - 1].dsCoord <= hintmap->edge[i].dsCoord );\n      FT_ASSERT( i < j                                                ||\n                 hintmap->edge[i].dsCoord <= hintmap->edge[j].dsCoord );\n\n      /* adjust the scales, avoiding divide by zero */\n      if ( i > 0 )\n      {\n        if ( hintmap->edge[i].csCoord != hintmap->edge[i - 1].csCoord )\n          hintmap->edge[i - 1].scale =\n            FT_DivFix(\n              hintmap->edge[i].dsCoord - hintmap->edge[i - 1].dsCoord,\n              hintmap->edge[i].csCoord - hintmap->edge[i - 1].csCoord );\n      }\n\n      if ( isPair )\n      {\n        if ( hintmap->edge[j].csCoord != hintmap->edge[j - 1].csCoord )\n          hintmap->edge[j - 1].scale =\n            FT_DivFix(\n              hintmap->edge[j].dsCoord - hintmap->edge[j - 1].dsCoord,\n              hintmap->edge[j].csCoord - hintmap->edge[j - 1].csCoord );\n\n        i += 1;     /* skip upper edge on next loop */\n      }\n    }\n\n    /* second pass tries to move non-optimal hints up, in case there is */\n    /* room now                                                         */\n    for ( i = cf2_arrstack_size( hintmap->hintMoves ); i > 0; i-- )\n    {\n      CF2_HintMove  hintMove = (CF2_HintMove)\n                      cf2_arrstack_getPointer( hintmap->hintMoves, i - 1 );\n\n\n      j = hintMove->j;\n\n      /* this was tested before the push, above */\n      FT_ASSERT( j < hintmap->count - 1 );\n\n      /* is there room to move up? */\n      if ( hintmap->edge[j + 1].dsCoord >=\n             hintmap->edge[j].dsCoord + hintMove->moveUp + CF2_MIN_COUNTER )\n      {\n        /* there is more room now, move edge up */\n        hintmap->edge[j].dsCoord += hintMove->moveUp;\n\n        if ( cf2_hint_isPair( &hintmap->edge[j] ) )\n        {\n          FT_ASSERT( j > 0 );\n          hintmap->edge[j - 1].dsCoord += hintMove->moveUp;\n        }\n      }\n    }\n  }\n\n\n  /* insert hint edges into map, sorted by csCoord */\n  static void\n  cf2_hintmap_insertHint( CF2_HintMap  hintmap,\n                          CF2_Hint     bottomHintEdge,\n                          CF2_Hint     topHintEdge )\n  {\n    CF2_UInt  indexInsert;\n\n    /* set default values, then check for edge hints */\n    FT_Bool   isPair         = TRUE;\n    CF2_Hint  firstHintEdge  = bottomHintEdge;\n    CF2_Hint  secondHintEdge = topHintEdge;\n\n\n    /* one or none of the input params may be invalid when dealing with */\n    /* edge hints; at least one edge must be valid                      */\n    FT_ASSERT( cf2_hint_isValid( bottomHintEdge ) ||\n               cf2_hint_isValid( topHintEdge )    );\n\n    /* determine how many and which edges to insert */\n    if ( !cf2_hint_isValid( bottomHintEdge ) )\n    {\n      /* insert only the top edge */\n      firstHintEdge = topHintEdge;\n      isPair        = FALSE;\n    }\n    else if ( !cf2_hint_isValid( topHintEdge ) )\n    {\n      /* insert only the bottom edge */\n      isPair = FALSE;\n    }\n\n    /* paired edges must be in proper order */\n    FT_ASSERT( !isPair                                         ||\n               topHintEdge->csCoord >= bottomHintEdge->csCoord );\n\n    /* linear search to find index value of insertion point */\n    indexInsert = 0;\n    for ( ; indexInsert < hintmap->count; indexInsert++ )\n    {\n      if ( hintmap->edge[indexInsert].csCoord >= firstHintEdge->csCoord )\n        break;\n    }\n\n    /*\n     * Discard any hints that overlap in character space.  Most often, this\n     * is while building the initial map, where captured hints from all\n     * zones are combined.  Define overlap to include hints that `touch'\n     * (overlap zero).  Hiragino Sans/Gothic fonts have numerous hints that\n     * touch.  Some fonts have non-ideographic glyphs that overlap our\n     * synthetic hints.\n     *\n     * Overlap also occurs when darkening stem hints that are close.\n     *\n     */\n    if ( indexInsert < hintmap->count )\n    {\n      /* we are inserting before an existing edge:    */\n      /* verify that an existing edge is not the same */\n      if ( hintmap->edge[indexInsert].csCoord == firstHintEdge->csCoord )\n        return; /* ignore overlapping stem hint */\n\n      /* verify that a new pair does not straddle the next edge */\n      if ( isPair                                                        &&\n           hintmap->edge[indexInsert].csCoord <= secondHintEdge->csCoord )\n        return; /* ignore overlapping stem hint */\n\n      /* verify that we are not inserting between paired edges */\n      if ( cf2_hint_isPairTop( &hintmap->edge[indexInsert] ) )\n        return; /* ignore overlapping stem hint */\n    }\n\n    /* recompute device space locations using initial hint map */\n    if ( cf2_hintmap_isValid( hintmap->initialHintMap ) &&\n         !cf2_hint_isLocked( firstHintEdge )            )\n    {\n      if ( isPair )\n      {\n        /* Use hint map to position the center of stem, and nominal scale */\n        /* to position the two edges.  This preserves the stem width.     */\n        CF2_Fixed  midpoint  = cf2_hintmap_map(\n                                 hintmap->initialHintMap,\n                                 ( secondHintEdge->csCoord +\n                                   firstHintEdge->csCoord ) / 2 );\n        CF2_Fixed  halfWidth = FT_MulFix(\n                                 ( secondHintEdge->csCoord -\n                                   firstHintEdge->csCoord ) / 2,\n                                 hintmap->scale );\n\n\n        firstHintEdge->dsCoord  = midpoint - halfWidth;\n        secondHintEdge->dsCoord = midpoint + halfWidth;\n      }\n      else\n        firstHintEdge->dsCoord = cf2_hintmap_map( hintmap->initialHintMap,\n                                                  firstHintEdge->csCoord );\n    }\n\n    /*\n     * Discard any hints that overlap in device space; this can occur\n     * because locked hints have been moved to align with blue zones.\n     *\n     * TODO: Although we might correct this later during adjustment, we\n     * don't currently have a way to delete a conflicting hint once it has\n     * been inserted.  See v2.030 MinionPro-Regular, 12 ppem darkened,\n     * initial hint map for second path, glyph 945 (the perispomeni (tilde)\n     * in U+1F6E, Greek omega with psili and perispomeni).  Darkening is\n     * 25.  Pair 667,747 initially conflicts in design space with top edge\n     * 660.  This is because 667 maps to 7.87, and the top edge was\n     * captured by a zone at 8.0.  The pair is later successfully inserted\n     * in a zone without the top edge.  In this zone it is adjusted to 8.0,\n     * and no longer conflicts with the top edge in design space.  This\n     * means it can be included in yet a later zone which does have the top\n     * edge hint.  This produces a small mismatch between the first and\n     * last points of this path, even though the hint masks are the same.\n     * The density map difference is tiny (1/256).\n     *\n     */\n\n    if ( indexInsert > 0 )\n    {\n      /* we are inserting after an existing edge */\n      if ( firstHintEdge->dsCoord < hintmap->edge[indexInsert - 1].dsCoord )\n        return;\n    }\n\n    if ( indexInsert < hintmap->count )\n    {\n      /* we are inserting before an existing edge */\n      if ( isPair )\n      {\n        if ( secondHintEdge->dsCoord > hintmap->edge[indexInsert].dsCoord )\n          return;\n      }\n      else\n      {\n        if ( firstHintEdge->dsCoord > hintmap->edge[indexInsert].dsCoord )\n          return;\n      }\n    }\n\n    /* make room to insert */\n    {\n      CF2_Int  iSrc = hintmap->count - 1;\n      CF2_Int  iDst = isPair ? hintmap->count + 1 : hintmap->count;\n\n      CF2_Int  count = hintmap->count - indexInsert;\n\n\n      if ( iDst >= CF2_MAX_HINT_EDGES )\n      {\n        FT_TRACE4(( \"cf2_hintmap_insertHint: too many hintmaps\\n\" ));\n        return;\n      }\n\n      while ( count-- )\n        hintmap->edge[iDst--] = hintmap->edge[iSrc--];\n\n      /* insert first edge */\n      hintmap->edge[indexInsert] = *firstHintEdge;         /* copy struct */\n      hintmap->count += 1;\n\n      if ( isPair )\n      {\n        /* insert second edge */\n        hintmap->edge[indexInsert + 1] = *secondHintEdge;  /* copy struct */\n        hintmap->count                += 1;\n      }\n    }\n\n    return;\n  }\n\n\n  /*\n   * Build a map from hints and mask.\n   *\n   * This function may recur one level if `hintmap->initialHintMap' is not yet\n   * valid.\n   * If `initialMap' is true, simply build initial map.\n   *\n   * Synthetic hints are used in two ways.  A hint at zero is inserted, if\n   * needed, in the initial hint map, to prevent translations from\n   * propagating across the origin.  If synthetic em box hints are enabled\n   * for ideographic dictionaries, then they are inserted in all hint\n   * maps, including the initial one.\n   *\n   */\n  FT_LOCAL_DEF( void )\n  cf2_hintmap_build( CF2_HintMap   hintmap,\n                     CF2_ArrStack  hStemHintArray,\n                     CF2_ArrStack  vStemHintArray,\n                     CF2_HintMask  hintMask,\n                     CF2_Fixed     hintOrigin,\n                     FT_Bool       initialMap )\n  {\n    FT_Byte*  maskPtr;\n\n    CF2_Font         font = hintmap->font;\n    CF2_HintMaskRec  tempHintMask;\n\n    size_t   bitCount, i;\n    FT_Byte  maskByte;\n\n\n    /* check whether initial map is constructed */\n    if ( !initialMap && !cf2_hintmap_isValid( hintmap->initialHintMap ) )\n    {\n      /* make recursive call with initialHintMap and temporary mask; */\n      /* temporary mask will get all bits set, below */\n      cf2_hintmask_init( &tempHintMask, hintMask->error );\n      cf2_hintmap_build( hintmap->initialHintMap,\n                         hStemHintArray,\n                         vStemHintArray,\n                         &tempHintMask,\n                         hintOrigin,\n                         TRUE );\n    }\n\n    if ( !cf2_hintmask_isValid( hintMask ) )\n    {\n      /* without a hint mask, assume all hints are active */\n      cf2_hintmask_setAll( hintMask,\n                           cf2_arrstack_size( hStemHintArray ) +\n                             cf2_arrstack_size( vStemHintArray ) );\n      if ( !cf2_hintmask_isValid( hintMask ) )\n          return;                   /* too many stem hints */\n    }\n\n    /* begin by clearing the map */\n    hintmap->count     = 0;\n    hintmap->lastIndex = 0;\n\n    /* make a copy of the hint mask so we can modify it */\n    tempHintMask = *hintMask;\n    maskPtr      = cf2_hintmask_getMaskPtr( &tempHintMask );\n\n    /* use the hStem hints only, which are first in the mask */\n    bitCount = cf2_arrstack_size( hStemHintArray );\n\n    /* Defense-in-depth.  Should never return here. */\n    if ( bitCount > hintMask->bitCount )\n        return;\n\n    /* synthetic embox hints get highest priority */\n    if ( font->blues.doEmBoxHints )\n    {\n      CF2_HintRec  dummy;\n\n\n      cf2_hint_initZero( &dummy );   /* invalid hint map element */\n\n      /* ghost bottom */\n      cf2_hintmap_insertHint( hintmap,\n                              &font->blues.emBoxBottomEdge,\n                              &dummy );\n      /* ghost top */\n      cf2_hintmap_insertHint( hintmap,\n                              &dummy,\n                              &font->blues.emBoxTopEdge );\n    }\n\n    /* insert hints captured by a blue zone or already locked (higher */\n    /* priority)                                                      */\n    for ( i = 0, maskByte = 0x80; i < bitCount; i++ )\n    {\n      if ( maskByte & *maskPtr )\n      {\n        /* expand StemHint into two `CF2_Hint' elements */\n        CF2_HintRec  bottomHintEdge, topHintEdge;\n\n\n        cf2_hint_init( &bottomHintEdge,\n                       hStemHintArray,\n                       i,\n                       font,\n                       hintOrigin,\n                       hintmap->scale,\n                       TRUE /* bottom */ );\n        cf2_hint_init( &topHintEdge,\n                       hStemHintArray,\n                       i,\n                       font,\n                       hintOrigin,\n                       hintmap->scale,\n                       FALSE /* top */ );\n\n        if ( cf2_hint_isLocked( &bottomHintEdge ) ||\n             cf2_hint_isLocked( &topHintEdge )    ||\n             cf2_blues_capture( &font->blues,\n                                &bottomHintEdge,\n                                &topHintEdge )   )\n        {\n          /* insert captured hint into map */\n          cf2_hintmap_insertHint( hintmap, &bottomHintEdge, &topHintEdge );\n\n          *maskPtr &= ~maskByte;      /* turn off the bit for this hint */\n        }\n      }\n\n      if ( ( i & 7 ) == 7 )\n      {\n        /* move to next mask byte */\n        maskPtr++;\n        maskByte = 0x80;\n      }\n      else\n        maskByte >>= 1;\n    }\n\n    /* initial hint map includes only captured hints plus maybe one at 0 */\n\n    /*\n     * TODO: There is a problem here because we are trying to build a\n     *       single hint map containing all captured hints.  It is\n     *       possible for there to be conflicts between captured hints,\n     *       either because of darkening or because the hints are in\n     *       separate hint zones (we are ignoring hint zones for the\n     *       initial map).  An example of the latter is MinionPro-Regular\n     *       v2.030 glyph 883 (Greek Capital Alpha with Psili) at 15ppem.\n     *       A stem hint for the psili conflicts with the top edge hint\n     *       for the base character.  The stem hint gets priority because\n     *       of its sort order.  In glyph 884 (Greek Capital Alpha with\n     *       Psili and Oxia), the top of the base character gets a stem\n     *       hint, and the psili does not.  This creates different initial\n     *       maps for the two glyphs resulting in different renderings of\n     *       the base character.  Will probably defer this either as not\n     *       worth the cost or as a font bug.  I don't think there is any\n     *       good reason for an accent to be captured by an alignment\n     *       zone.  -darnold 2/12/10\n     */\n\n    if ( initialMap )\n    {\n      /* Apply a heuristic that inserts a point for (0,0), unless it's     */\n      /* already covered by a mapping.  This locks the baseline for glyphs */\n      /* that have no baseline hints.                                      */\n\n      if ( hintmap->count == 0                           ||\n           hintmap->edge[0].csCoord > 0                  ||\n           hintmap->edge[hintmap->count - 1].csCoord < 0 )\n      {\n        /* all edges are above 0 or all edges are below 0; */\n        /* construct a locked edge hint at 0               */\n\n        CF2_HintRec  edge, invalid;\n\n\n        cf2_hint_initZero( &edge );\n\n        edge.flags = CF2_GhostBottom |\n                     CF2_Locked      |\n                     CF2_Synthetic;\n        edge.scale = hintmap->scale;\n\n        cf2_hint_initZero( &invalid );\n        cf2_hintmap_insertHint( hintmap, &edge, &invalid );\n      }\n    }\n    else\n    {\n      /* insert remaining hints */\n\n      maskPtr = cf2_hintmask_getMaskPtr( &tempHintMask );\n\n      for ( i = 0, maskByte = 0x80; i < bitCount; i++ )\n      {\n        if ( maskByte & *maskPtr )\n        {\n          CF2_HintRec  bottomHintEdge, topHintEdge;\n\n\n          cf2_hint_init( &bottomHintEdge,\n                         hStemHintArray,\n                         i,\n                         font,\n                         hintOrigin,\n                         hintmap->scale,\n                         TRUE /* bottom */ );\n          cf2_hint_init( &topHintEdge,\n                         hStemHintArray,\n                         i,\n                         font,\n                         hintOrigin,\n                         hintmap->scale,\n                         FALSE /* top */ );\n\n          cf2_hintmap_insertHint( hintmap, &bottomHintEdge, &topHintEdge );\n        }\n\n        if ( ( i & 7 ) == 7 )\n        {\n          /* move to next mask byte */\n          maskPtr++;\n          maskByte = 0x80;\n        }\n        else\n          maskByte >>= 1;\n      }\n    }\n\n    /*\n     * Note: The following line is a convenient place to break when\n     *       debugging hinting.  Examine `hintmap->edge' for the list of\n     *       enabled hints, then step over the call to see the effect of\n     *       adjustment.  We stop here first on the recursive call that\n     *       creates the initial map, and then on each counter group and\n     *       hint zone.\n     */\n\n    /* adjust positions of hint edges that are not locked to blue zones */\n    cf2_hintmap_adjustHints( hintmap );\n\n    /* save the position of all hints that were used in this hint map; */\n    /* if we use them again, we'll locate them in the same position    */\n    if ( !initialMap )\n    {\n      for ( i = 0; i < hintmap->count; i++ )\n      {\n        if ( !cf2_hint_isSynthetic( &hintmap->edge[i] ) )\n        {\n          /* Note: include both valid and invalid edges            */\n          /* Note: top and bottom edges are copied back separately */\n          CF2_StemHint  stemhint = (CF2_StemHint)\n                          cf2_arrstack_getPointer( hStemHintArray,\n                                                   hintmap->edge[i].index );\n\n\n          if ( cf2_hint_isTop( &hintmap->edge[i] ) )\n            stemhint->maxDS = hintmap->edge[i].dsCoord;\n          else\n            stemhint->minDS = hintmap->edge[i].dsCoord;\n\n          stemhint->used = TRUE;\n        }\n      }\n    }\n\n    /* hint map is ready to use */\n    hintmap->isValid = TRUE;\n\n    /* remember this mask has been used */\n    cf2_hintmask_setNew( hintMask, FALSE );\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cf2_glyphpath_init( CF2_GlyphPath         glyphpath,\n                      CF2_Font              font,\n                      CF2_OutlineCallbacks  callbacks,\n                      CF2_Fixed             scaleY,\n                      /* CF2_Fixed  hShift, */\n                      CF2_ArrStack          hStemHintArray,\n                      CF2_ArrStack          vStemHintArray,\n                      CF2_HintMask          hintMask,\n                      CF2_Fixed             hintOriginY,\n                      const CF2_Blues       blues,\n                      const FT_Vector*      fractionalTranslation )\n  {\n    FT_ZERO( glyphpath );\n\n    glyphpath->font      = font;\n    glyphpath->callbacks = callbacks;\n\n    cf2_arrstack_init( &glyphpath->hintMoves,\n                       font->memory,\n                       &font->error,\n                       sizeof ( CF2_HintMoveRec ) );\n\n    cf2_hintmap_init( &glyphpath->initialHintMap,\n                      font,\n                      &glyphpath->initialHintMap,\n                      &glyphpath->hintMoves,\n                      scaleY );\n    cf2_hintmap_init( &glyphpath->firstHintMap,\n                      font,\n                      &glyphpath->initialHintMap,\n                      &glyphpath->hintMoves,\n                      scaleY );\n    cf2_hintmap_init( &glyphpath->hintMap,\n                      font,\n                      &glyphpath->initialHintMap,\n                      &glyphpath->hintMoves,\n                      scaleY );\n\n    glyphpath->scaleX = font->innerTransform.a;\n    glyphpath->scaleC = font->innerTransform.c;\n    glyphpath->scaleY = font->innerTransform.d;\n\n    glyphpath->fractionalTranslation = *fractionalTranslation;\n\n#if 0\n    glyphpath->hShift = hShift;       /* for fauxing */\n#endif\n\n    glyphpath->hStemHintArray = hStemHintArray;\n    glyphpath->vStemHintArray = vStemHintArray;\n    glyphpath->hintMask       = hintMask;      /* ptr to current mask */\n    glyphpath->hintOriginY    = hintOriginY;\n    glyphpath->blues          = blues;\n    glyphpath->darken         = font->darkened; /* TODO: should we make copies? */\n    glyphpath->xOffset        = font->darkenX;\n    glyphpath->yOffset        = font->darkenY;\n    glyphpath->miterLimit     = 2 * FT_MAX(\n                                     cf2_fixedAbs( glyphpath->xOffset ),\n                                     cf2_fixedAbs( glyphpath->yOffset ) );\n\n    /* .1 character space unit */\n    glyphpath->snapThreshold = cf2_floatToFixed( 0.1f );\n\n    glyphpath->moveIsPending = TRUE;\n    glyphpath->pathIsOpen    = FALSE;\n    glyphpath->pathIsClosing = FALSE;\n    glyphpath->elemIsQueued  = FALSE;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cf2_glyphpath_finalize( CF2_GlyphPath  glyphpath )\n  {\n    cf2_arrstack_finalize( &glyphpath->hintMoves );\n  }\n\n\n  /*\n   * Hint point in y-direction and apply outerTransform.\n   * Input `current' hint map (which is actually delayed by one element).\n   * Input x,y point in Character Space.\n   * Output x,y point in Device Space, including translation.\n   */\n  static void\n  cf2_glyphpath_hintPoint( CF2_GlyphPath  glyphpath,\n                           CF2_HintMap    hintmap,\n                           FT_Vector*     ppt,\n                           CF2_Fixed      x,\n                           CF2_Fixed      y )\n  {\n    FT_Vector  pt;   /* hinted point in upright DS */\n\n\n    pt.x = FT_MulFix( glyphpath->scaleX, x ) +\n             FT_MulFix( glyphpath->scaleC, y );\n    pt.y = cf2_hintmap_map( hintmap, y );\n\n    ppt->x = FT_MulFix( glyphpath->font->outerTransform.a, pt.x )   +\n               FT_MulFix( glyphpath->font->outerTransform.c, pt.y ) +\n               glyphpath->fractionalTranslation.x;\n    ppt->y = FT_MulFix( glyphpath->font->outerTransform.b, pt.x )   +\n               FT_MulFix( glyphpath->font->outerTransform.d, pt.y ) +\n               glyphpath->fractionalTranslation.y;\n  }\n\n\n  /*\n   * From two line segments, (u1,u2) and (v1,v2), compute a point of\n   * intersection on the corresponding lines.\n   * Return false if no intersection is found, or if the intersection is\n   * too far away from the ends of the line segments, u2 and v1.\n   *\n   */\n  static FT_Bool\n  cf2_glyphpath_computeIntersection( CF2_GlyphPath     glyphpath,\n                                     const FT_Vector*  u1,\n                                     const FT_Vector*  u2,\n                                     const FT_Vector*  v1,\n                                     const FT_Vector*  v2,\n                                     FT_Vector*        intersection )\n  {\n    /*\n     * Let `u' be a zero-based vector from the first segment, `v' from the\n     * second segment.\n     * Let `w 'be the zero-based vector from `u1' to `v1'.\n     * `perp' is the `perpendicular dot product'; see\n     * http://mathworld.wolfram.com/PerpDotProduct.html.\n     * `s' is the parameter for the parametric line for the first segment\n     * (`u').\n     *\n     * See notation in\n     * http://softsurfer.com/Archive/algorithm_0104/algorithm_0104B.htm.\n     * Calculations are done in 16.16, but must handle the squaring of\n     * line lengths in character space.  We scale all vectors by 1/32 to\n     * avoid overflow.  This allows values up to 4095 to be squared.  The\n     * scale factor cancels in the divide.\n     *\n     * TODO: the scale factor could be computed from UnitsPerEm.\n     *\n     */\n\n#define cf2_perp( a, b )                                    \\\n          ( FT_MulFix( a.x, b.y ) - FT_MulFix( a.y, b.x ) )\n\n  /* round and divide by 32 */\n#define CF2_CS_SCALE( x )         \\\n          ( ( (x) + 0x10 ) >> 5 )\n\n    FT_Vector  u, v, w;      /* scaled vectors */\n    CF2_Fixed  denominator, s;\n\n\n    u.x = CF2_CS_SCALE( u2->x - u1->x );\n    u.y = CF2_CS_SCALE( u2->y - u1->y );\n    v.x = CF2_CS_SCALE( v2->x - v1->x );\n    v.y = CF2_CS_SCALE( v2->y - v1->y );\n    w.x = CF2_CS_SCALE( v1->x - u1->x );\n    w.y = CF2_CS_SCALE( v1->y - u1->y );\n\n    denominator = cf2_perp( u, v );\n\n    if ( denominator == 0 )\n      return FALSE;           /* parallel or coincident lines */\n\n    s = FT_DivFix( cf2_perp( w, v ), denominator );\n\n    intersection->x = u1->x + FT_MulFix( s, u2->x - u1->x );\n    intersection->y = u1->y + FT_MulFix( s, u2->y - u1->y );\n\n    /*\n     * Special case snapping for horizontal and vertical lines.\n     * This cleans up intersections and reduces problems with winding\n     * order detection.\n     * Sample case is sbc cd KozGoPr6N-Medium.otf 20 16685.\n     * Note: these calculations are in character space.\n     *\n     */\n\n    if ( u1->x == u2->x                                                     &&\n         cf2_fixedAbs( intersection->x - u1->x ) < glyphpath->snapThreshold )\n      intersection->x = u1->x;\n    if ( u1->y == u2->y                                                     &&\n         cf2_fixedAbs( intersection->y - u1->y ) < glyphpath->snapThreshold )\n      intersection->y = u1->y;\n\n    if ( v1->x == v2->x                                                     &&\n         cf2_fixedAbs( intersection->x - v1->x ) < glyphpath->snapThreshold )\n      intersection->x = v1->x;\n    if ( v1->y == v2->y                                                     &&\n         cf2_fixedAbs( intersection->y - v1->y ) < glyphpath->snapThreshold )\n      intersection->y = v1->y;\n\n    /* limit the intersection distance from midpoint of u2 and v1 */\n    if ( cf2_fixedAbs( intersection->x - ( u2->x + v1->x ) / 2 ) >\n           glyphpath->miterLimit                                   ||\n         cf2_fixedAbs( intersection->y - ( u2->y + v1->y ) / 2 ) >\n           glyphpath->miterLimit                                   )\n      return FALSE;\n\n    return TRUE;\n  }\n\n\n  /*\n   * Push the cached element (glyphpath->prevElem*) to the outline\n   * consumer.  When a darkening offset is used, the end point of the\n   * cached element may be adjusted to an intersection point or we may\n   * synthesize a connecting line to the current element.  If we are\n   * closing a subpath, we may also generate a connecting line to the start\n   * point.\n   *\n   * This is where Character Space (CS) is converted to Device Space (DS)\n   * using a hint map.  This calculation must use a HintMap that was valid\n   * at the time the element was saved.  For the first point in a subpath,\n   * that is a saved HintMap.  For most elements, it just means the caller\n   * has delayed building a HintMap from the current HintMask.\n   *\n   * Transform each point with outerTransform and call the outline\n   * callbacks.  This is a general 3x3 transform:\n   *\n   *   x' = a*x + c*y + tx, y' = b*x + d*y + ty\n   *\n   * but it uses 4 elements from CF2_Font and the translation part\n   * from CF2_GlyphPath.\n   *\n   */\n  static void\n  cf2_glyphpath_pushPrevElem( CF2_GlyphPath  glyphpath,\n                              CF2_HintMap    hintmap,\n                              FT_Vector*     nextP0,\n                              FT_Vector      nextP1,\n                              FT_Bool        close )\n  {\n    CF2_CallbackParamsRec  params;\n\n    FT_Vector*  prevP0;\n    FT_Vector*  prevP1;\n\n    FT_Vector  intersection    = { 0, 0 };\n    FT_Bool    useIntersection = FALSE;\n\n\n    FT_ASSERT( glyphpath->prevElemOp == CF2_PathOpLineTo ||\n               glyphpath->prevElemOp == CF2_PathOpCubeTo );\n\n    if ( glyphpath->prevElemOp == CF2_PathOpLineTo )\n    {\n      prevP0 = &glyphpath->prevElemP0;\n      prevP1 = &glyphpath->prevElemP1;\n    }\n    else\n    {\n      prevP0 = &glyphpath->prevElemP2;\n      prevP1 = &glyphpath->prevElemP3;\n    }\n\n    /* optimization: if previous and next elements are offset by the same */\n    /* amount, then there will be no gap, and no need to compute an       */\n    /* intersection.                                                      */\n    if ( prevP1->x != nextP0->x || prevP1->y != nextP0->y )\n    {\n      /* previous element does not join next element:             */\n      /* adjust end point of previous element to the intersection */\n      useIntersection = cf2_glyphpath_computeIntersection( glyphpath,\n                                                           prevP0,\n                                                           prevP1,\n                                                           nextP0,\n                                                           &nextP1,\n                                                           &intersection );\n      if ( useIntersection )\n      {\n        /* modify the last point of the cached element (either line or */\n        /* curve)                                                      */\n        *prevP1 = intersection;\n      }\n    }\n\n    params.pt0 = glyphpath->currentDS;\n\n    switch( glyphpath->prevElemOp )\n    {\n    case CF2_PathOpLineTo:\n      params.op = CF2_PathOpLineTo;\n\n      /* note: pt2 and pt3 are unused */\n\n      if ( close )\n      {\n        /* use first hint map if closing */\n        cf2_glyphpath_hintPoint( glyphpath,\n                                 &glyphpath->firstHintMap,\n                                 &params.pt1,\n                                 glyphpath->prevElemP1.x,\n                                 glyphpath->prevElemP1.y );\n      }\n      else\n      {\n        cf2_glyphpath_hintPoint( glyphpath,\n                                 hintmap,\n                                 &params.pt1,\n                                 glyphpath->prevElemP1.x,\n                                 glyphpath->prevElemP1.y );\n      }\n\n      /* output only non-zero length lines */\n      if ( params.pt0.x != params.pt1.x || params.pt0.y != params.pt1.y )\n      {\n        glyphpath->callbacks->lineTo( glyphpath->callbacks, &params );\n\n        glyphpath->currentDS = params.pt1;\n      }\n      break;\n\n    case CF2_PathOpCubeTo:\n      params.op = CF2_PathOpCubeTo;\n\n      /* TODO: should we intersect the interior joins (p1-p2 and p2-p3)? */\n      cf2_glyphpath_hintPoint( glyphpath,\n                               hintmap,\n                               &params.pt1,\n                               glyphpath->prevElemP1.x,\n                               glyphpath->prevElemP1.y );\n      cf2_glyphpath_hintPoint( glyphpath,\n                               hintmap,\n                               &params.pt2,\n                               glyphpath->prevElemP2.x,\n                               glyphpath->prevElemP2.y );\n      cf2_glyphpath_hintPoint( glyphpath,\n                               hintmap,\n                               &params.pt3,\n                               glyphpath->prevElemP3.x,\n                               glyphpath->prevElemP3.y );\n\n      glyphpath->callbacks->cubeTo( glyphpath->callbacks, &params );\n\n      glyphpath->currentDS = params.pt3;\n\n      break;\n    }\n\n    if ( !useIntersection || close )\n    {\n      /* insert connecting line between end of previous element and start */\n      /* of current one                                                   */\n      /* note: at the end of a subpath, we might do both, so use `nextP0' */\n      /* before we change it, below                                       */\n\n      if ( close )\n      {\n        /* if we are closing the subpath, then nextP0 is in the first     */\n        /* hint zone                                                      */\n        cf2_glyphpath_hintPoint( glyphpath,\n                                 &glyphpath->firstHintMap,\n                                 &params.pt1,\n                                 nextP0->x,\n                                 nextP0->y );\n      }\n      else\n      {\n        cf2_glyphpath_hintPoint( glyphpath,\n                                 hintmap,\n                                 &params.pt1,\n                                 nextP0->x,\n                                 nextP0->y );\n      }\n\n      if ( params.pt1.x != glyphpath->currentDS.x ||\n           params.pt1.y != glyphpath->currentDS.y )\n      {\n        /* length is nonzero */\n        params.op  = CF2_PathOpLineTo;\n        params.pt0 = glyphpath->currentDS;\n\n        /* note: pt2 and pt3 are unused */\n        glyphpath->callbacks->lineTo( glyphpath->callbacks, &params );\n\n        glyphpath->currentDS = params.pt1;\n      }\n    }\n\n    if ( useIntersection )\n    {\n      /* return intersection point to caller */\n      *nextP0 = intersection;\n    }\n  }\n\n\n  /* push a MoveTo element based on current point and offset of current */\n  /* element                                                            */\n  static void\n  cf2_glyphpath_pushMove( CF2_GlyphPath  glyphpath,\n                          FT_Vector      start )\n  {\n    CF2_CallbackParamsRec  params;\n\n\n    params.op  = CF2_PathOpMoveTo;\n    params.pt0 = glyphpath->currentDS;\n\n    /* Test if move has really happened yet; it would have called */\n    /* `cf2_hintmap_build' to set `isValid'.                   */\n    if ( !cf2_hintmap_isValid( &glyphpath->hintMap ) )\n    {\n      /* we are here iff first subpath is missing a moveto operator: */\n      /* synthesize first moveTo to finish initialization of hintMap */\n      cf2_glyphpath_moveTo( glyphpath,\n                            glyphpath->start.x,\n                            glyphpath->start.y );\n    }\n\n    cf2_glyphpath_hintPoint( glyphpath,\n                             &glyphpath->hintMap,\n                             &params.pt1,\n                             start.x,\n                             start.y );\n\n    /* note: pt2 and pt3 are unused */\n    glyphpath->callbacks->moveTo( glyphpath->callbacks, &params );\n\n    glyphpath->currentDS    = params.pt1;\n    glyphpath->offsetStart0 = start;\n  }\n\n\n  /*\n   * All coordinates are in character space.\n   * On input, (x1, y1) and (x2, y2) give line segment.\n   * On output, (x, y) give offset vector.\n   * We use a piecewise approximation to trig functions.\n   *\n   * TODO: Offset true perpendicular and proper length\n   *       supply the y-translation for hinting here, too,\n   *       that adds yOffset unconditionally to *y.\n   */\n  static void\n  cf2_glyphpath_computeOffset( CF2_GlyphPath  glyphpath,\n                               CF2_Fixed      x1,\n                               CF2_Fixed      y1,\n                               CF2_Fixed      x2,\n                               CF2_Fixed      y2,\n                               CF2_Fixed*     x,\n                               CF2_Fixed*     y )\n  {\n    CF2_Fixed  dx = x2 - x1;\n    CF2_Fixed  dy = y2 - y1;\n\n\n    /* note: negative offsets don't work here; negate deltas to change */\n    /* quadrants, below                                                */\n    if ( glyphpath->font->reverseWinding )\n    {\n      dx = -dx;\n      dy = -dy;\n    }\n\n    *x = *y = 0;\n\n    if ( !glyphpath->darken )\n        return;\n\n    /* add momentum for this path element */\n    glyphpath->callbacks->windingMomentum +=\n      cf2_getWindingMomentum( x1, y1, x2, y2 );\n\n    /* note: allow mixed integer and fixed multiplication here */\n    if ( dx >= 0 )\n    {\n      if ( dy >= 0 )\n      {\n        /* first quadrant, +x +y */\n\n        if ( dx > 2 * dy )\n        {\n          /* +x */\n          *x = 0;\n          *y = 0;\n        }\n        else if ( dy > 2 * dx )\n        {\n          /* +y */\n          *x = glyphpath->xOffset;\n          *y = glyphpath->yOffset;\n        }\n        else\n        {\n          /* +x +y */\n          *x = FT_MulFix( cf2_floatToFixed( 0.7 ),\n                          glyphpath->xOffset );\n          *y = FT_MulFix( cf2_floatToFixed( 1.0 - 0.7 ),\n                          glyphpath->yOffset );\n        }\n      }\n      else\n      {\n        /* fourth quadrant, +x -y */\n\n        if ( dx > -2 * dy )\n        {\n          /* +x */\n          *x = 0;\n          *y = 0;\n        }\n        else if ( -dy > 2 * dx )\n        {\n          /* -y */\n          *x = -glyphpath->xOffset;\n          *y = glyphpath->yOffset;\n        }\n        else\n        {\n          /* +x -y */\n          *x = FT_MulFix( cf2_floatToFixed( -0.7 ),\n                          glyphpath->xOffset );\n          *y = FT_MulFix( cf2_floatToFixed( 1.0 - 0.7 ),\n                          glyphpath->yOffset );\n        }\n      }\n    }\n    else\n    {\n      if ( dy >= 0 )\n      {\n        /* second quadrant, -x +y */\n\n        if ( -dx > 2 * dy )\n        {\n          /* -x */\n          *x = 0;\n          *y = 2 * glyphpath->yOffset;\n        }\n        else if ( dy > -2 * dx )\n        {\n          /* +y */\n          *x = glyphpath->xOffset;\n          *y = glyphpath->yOffset;\n        }\n        else\n        {\n          /* -x +y */\n          *x = FT_MulFix( cf2_floatToFixed( 0.7 ),\n                          glyphpath->xOffset );\n          *y = FT_MulFix( cf2_floatToFixed( 1.0 + 0.7 ),\n                          glyphpath->yOffset );\n        }\n      }\n      else\n      {\n        /* third quadrant, -x -y */\n\n        if ( -dx > -2 * dy )\n        {\n          /* -x */\n          *x = 0;\n          *y = 2 * glyphpath->yOffset;\n        }\n        else if ( -dy > -2 * dx )\n        {\n          /* -y */\n          *x = -glyphpath->xOffset;\n          *y = glyphpath->yOffset;\n        }\n        else\n        {\n          /* -x -y */\n          *x = FT_MulFix( cf2_floatToFixed( -0.7 ),\n                          glyphpath->xOffset );\n          *y = FT_MulFix( cf2_floatToFixed( 1.0 + 0.7 ),\n                          glyphpath->yOffset );\n        }\n      }\n    }\n  }\n\n\n  /*\n   * The functions cf2_glyphpath_{moveTo,lineTo,curveTo,closeOpenPath} are\n   * called by the interpreter with Character Space (CS) coordinates.  Each\n   * path element is placed into a queue of length one to await the\n   * calculation of the following element.  At that time, the darkening\n   * offset of the following element is known and joins can be computed,\n   * including possible modification of this element, before mapping to\n   * Device Space (DS) and passing it on to the outline consumer.\n   *\n   */\n  FT_LOCAL_DEF( void )\n  cf2_glyphpath_moveTo( CF2_GlyphPath  glyphpath,\n                        CF2_Fixed      x,\n                        CF2_Fixed      y )\n  {\n    cf2_glyphpath_closeOpenPath( glyphpath );\n\n    /* save the parameters of the move for later, when we'll know how to */\n    /* offset it;                                                        */\n    /* also save last move point */\n    glyphpath->currentCS.x = glyphpath->start.x = x;\n    glyphpath->currentCS.y = glyphpath->start.y = y;\n\n    glyphpath->moveIsPending = TRUE;\n\n    /* ensure we have a valid map with current mask */\n    if ( !cf2_hintmap_isValid( &glyphpath->hintMap ) ||\n         cf2_hintmask_isNew( glyphpath->hintMask )   )\n      cf2_hintmap_build( &glyphpath->hintMap,\n                         glyphpath->hStemHintArray,\n                         glyphpath->vStemHintArray,\n                         glyphpath->hintMask,\n                         glyphpath->hintOriginY,\n                         FALSE );\n\n    /* save a copy of current HintMap to use when drawing initial point */\n    glyphpath->firstHintMap = glyphpath->hintMap;     /* structure copy */\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cf2_glyphpath_lineTo( CF2_GlyphPath  glyphpath,\n                        CF2_Fixed      x,\n                        CF2_Fixed      y )\n  {\n    CF2_Fixed  xOffset, yOffset;\n    FT_Vector  P0, P1;\n    FT_Bool    newHintMap;\n\n    /*\n     * New hints will be applied after cf2_glyphpath_pushPrevElem has run.\n     * In case this is a synthesized closing line, any new hints should be\n     * delayed until this path is closed (`cf2_hintmask_isNew' will be\n     * called again before the next line or curve).\n     */\n\n    /* true if new hint map not on close */\n    newHintMap = cf2_hintmask_isNew( glyphpath->hintMask ) &&\n                 !glyphpath->pathIsClosing;\n\n    /*\n     * Zero-length lines may occur in the charstring.  Because we cannot\n     * compute darkening offsets or intersections from zero-length lines,\n     * it is best to remove them and avoid artifacts.  However, zero-length\n     * lines in CS at the start of a new hint map can generate non-zero\n     * lines in DS due to hint substitution.  We detect a change in hint\n     * map here and pass those zero-length lines along.\n     */\n\n    /*\n     * Note: Find explicitly closed paths here with a conditional\n     *       breakpoint using\n     *\n     *         !gp->pathIsClosing && gp->start.x == x && gp->start.y == y\n     *\n     */\n\n    if ( glyphpath->currentCS.x == x &&\n         glyphpath->currentCS.y == y &&\n         !newHintMap                 )\n      /*\n       * Ignore zero-length lines in CS where the hint map is the same\n       * because the line in DS will also be zero length.\n       *\n       * Ignore zero-length lines when we synthesize a closing line because\n       * the close will be handled in cf2_glyphPath_pushPrevElem.\n       */\n      return;\n\n    cf2_glyphpath_computeOffset( glyphpath,\n                                 glyphpath->currentCS.x,\n                                 glyphpath->currentCS.y,\n                                 x,\n                                 y,\n                                 &xOffset,\n                                 &yOffset );\n\n    /* construct offset points */\n    P0.x = glyphpath->currentCS.x + xOffset;\n    P0.y = glyphpath->currentCS.y + yOffset;\n    P1.x = x + xOffset;\n    P1.y = y + yOffset;\n\n    if ( glyphpath->moveIsPending )\n    {\n      /* emit offset 1st point as MoveTo */\n      cf2_glyphpath_pushMove( glyphpath, P0 );\n\n      glyphpath->moveIsPending = FALSE;  /* adjust state machine */\n      glyphpath->pathIsOpen    = TRUE;\n\n      glyphpath->offsetStart1 = P1;              /* record second point */\n    }\n\n    if ( glyphpath->elemIsQueued )\n    {\n      FT_ASSERT( cf2_hintmap_isValid( &glyphpath->hintMap ) ||\n                 glyphpath->hintMap.count == 0              );\n\n      cf2_glyphpath_pushPrevElem( glyphpath,\n                                  &glyphpath->hintMap,\n                                  &P0,\n                                  P1,\n                                  FALSE );\n    }\n\n    /* queue the current element with offset points */\n    glyphpath->elemIsQueued = TRUE;\n    glyphpath->prevElemOp   = CF2_PathOpLineTo;\n    glyphpath->prevElemP0   = P0;\n    glyphpath->prevElemP1   = P1;\n\n    /* update current map */\n    if ( newHintMap )\n      cf2_hintmap_build( &glyphpath->hintMap,\n                         glyphpath->hStemHintArray,\n                         glyphpath->vStemHintArray,\n                         glyphpath->hintMask,\n                         glyphpath->hintOriginY,\n                         FALSE );\n\n    glyphpath->currentCS.x = x;     /* pre-offset current point */\n    glyphpath->currentCS.y = y;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cf2_glyphpath_curveTo( CF2_GlyphPath  glyphpath,\n                         CF2_Fixed      x1,\n                         CF2_Fixed      y1,\n                         CF2_Fixed      x2,\n                         CF2_Fixed      y2,\n                         CF2_Fixed      x3,\n                         CF2_Fixed      y3 )\n  {\n    CF2_Fixed  xOffset1, yOffset1, xOffset3, yOffset3;\n    FT_Vector  P0, P1, P2, P3;\n\n\n    /* TODO: ignore zero length portions of curve?? */\n    cf2_glyphpath_computeOffset( glyphpath,\n                                 glyphpath->currentCS.x,\n                                 glyphpath->currentCS.y,\n                                 x1,\n                                 y1,\n                                 &xOffset1,\n                                 &yOffset1 );\n    cf2_glyphpath_computeOffset( glyphpath,\n                                 x2,\n                                 y2,\n                                 x3,\n                                 y3,\n                                 &xOffset3,\n                                 &yOffset3 );\n\n    /* add momentum from the middle segment */\n    glyphpath->callbacks->windingMomentum +=\n      cf2_getWindingMomentum( x1, y1, x2, y2 );\n\n    /* construct offset points */\n    P0.x = glyphpath->currentCS.x + xOffset1;\n    P0.y = glyphpath->currentCS.y + yOffset1;\n    P1.x = x1 + xOffset1;\n    P1.y = y1 + yOffset1;\n    /* note: preserve angle of final segment by using offset3 at both ends */\n    P2.x = x2 + xOffset3;\n    P2.y = y2 + yOffset3;\n    P3.x = x3 + xOffset3;\n    P3.y = y3 + yOffset3;\n\n    if ( glyphpath->moveIsPending )\n    {\n      /* emit offset 1st point as MoveTo */\n      cf2_glyphpath_pushMove( glyphpath, P0 );\n\n      glyphpath->moveIsPending = FALSE;\n      glyphpath->pathIsOpen    = TRUE;\n\n      glyphpath->offsetStart1 = P1;              /* record second point */\n    }\n\n    if ( glyphpath->elemIsQueued )\n    {\n      FT_ASSERT( cf2_hintmap_isValid( &glyphpath->hintMap ) ||\n                 glyphpath->hintMap.count == 0              );\n\n      cf2_glyphpath_pushPrevElem( glyphpath,\n                                  &glyphpath->hintMap,\n                                  &P0,\n                                  P1,\n                                  FALSE );\n    }\n\n    /* queue the current element with offset points */\n    glyphpath->elemIsQueued = TRUE;\n    glyphpath->prevElemOp   = CF2_PathOpCubeTo;\n    glyphpath->prevElemP0   = P0;\n    glyphpath->prevElemP1   = P1;\n    glyphpath->prevElemP2   = P2;\n    glyphpath->prevElemP3   = P3;\n\n    /* update current map */\n    if ( cf2_hintmask_isNew( glyphpath->hintMask ) )\n      cf2_hintmap_build( &glyphpath->hintMap,\n                         glyphpath->hStemHintArray,\n                         glyphpath->vStemHintArray,\n                         glyphpath->hintMask,\n                         glyphpath->hintOriginY,\n                         FALSE );\n\n    glyphpath->currentCS.x = x3;       /* pre-offset current point */\n    glyphpath->currentCS.y = y3;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cf2_glyphpath_closeOpenPath( CF2_GlyphPath  glyphpath )\n  {\n    if ( glyphpath->pathIsOpen )\n    {\n      /*\n       * A closing line in Character Space line is always generated below\n       * with `cf2_glyphPath_lineTo'.  It may be ignored later if it turns\n       * out to be zero length in Device Space.\n       */\n      glyphpath->pathIsClosing = TRUE;\n\n      cf2_glyphpath_lineTo( glyphpath,\n                            glyphpath->start.x,\n                            glyphpath->start.y );\n\n      /* empty the final element from the queue and close the path */\n      if ( glyphpath->elemIsQueued )\n        cf2_glyphpath_pushPrevElem( glyphpath,\n                                    &glyphpath->hintMap,\n                                    &glyphpath->offsetStart0,\n                                    glyphpath->offsetStart1,\n                                    TRUE );\n\n      /* reset state machine */\n      glyphpath->moveIsPending = TRUE;\n      glyphpath->pathIsOpen    = FALSE;\n      glyphpath->pathIsClosing = FALSE;\n      glyphpath->elemIsQueued  = FALSE;\n    }\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cf2hints.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cf2hints.h                                                             */\n/*                                                                         */\n/*    Adobe's code for handling CFF hints (body).                          */\n/*                                                                         */\n/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */\n/*                                                                         */\n/*  This software, and all works of authorship, whether in source or       */\n/*  object code form as indicated by the copyright notice(s) included      */\n/*  herein (collectively, the \"Work\") is made available, and may only be   */\n/*  used, modified, and distributed under the FreeType Project License,    */\n/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */\n/*  FreeType Project License, each contributor to the Work hereby grants   */\n/*  to any individual or legal entity exercising permissions granted by    */\n/*  the FreeType Project License and this section (hereafter, \"You\" or     */\n/*  \"Your\") a perpetual, worldwide, non-exclusive, no-charge,              */\n/*  royalty-free, irrevocable (except as stated in this section) patent    */\n/*  license to make, have made, use, offer to sell, sell, import, and      */\n/*  otherwise transfer the Work, where such license applies only to those  */\n/*  patent claims licensable by such contributor that are necessarily      */\n/*  infringed by their contribution(s) alone or by combination of their    */\n/*  contribution(s) with the Work to which such contribution(s) was        */\n/*  submitted.  If You institute patent litigation against any entity      */\n/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */\n/*  the Work or a contribution incorporated within the Work constitutes    */\n/*  direct or contributory patent infringement, then any patent licenses   */\n/*  granted to You under this License for that Work shall terminate as of  */\n/*  the date such litigation is filed.                                     */\n/*                                                                         */\n/*  By using, modifying, or distributing the Work you indicate that you    */\n/*  have read and understood the terms and conditions of the               */\n/*  FreeType Project License as well as those provided in this section,    */\n/*  and you accept them fully.                                             */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CF2HINTS_H__\n#define __CF2HINTS_H__\n\n\nFT_BEGIN_HEADER\n\n\n  enum\n  {\n    CF2_MAX_HINTS = 96    /* maximum # of hints */\n  };\n\n\n  /*\n   * A HintMask object stores a bit mask that specifies which hints in the\n   * charstring are active at a given time.  Hints in CFF must be declared\n   * at the start, before any drawing operators, with horizontal hints\n   * preceding vertical hints.  The HintMask is ordered the same way, with\n   * horizontal hints immediately followed by vertical hints.  Clients are\n   * responsible for knowing how many of each type are present.\n   *\n   * The maximum total number of hints is 96, as specified by the CFF\n   * specification.\n   *\n   * A HintMask is built 0 or more times while interpreting a charstring, by\n   * the HintMask operator.  There is only one HintMask, but it is built or\n   * rebuilt each time there is a hint substitution (HintMask operator) in\n   * the charstring.  A default HintMask with all bits set is built if there\n   * has been no HintMask operator prior to the first drawing operator.\n   *\n   */\n\n  typedef struct  CF2_HintMaskRec_\n  {\n    FT_Error*  error;\n\n    FT_Bool  isValid;\n    FT_Bool  isNew;\n\n    size_t  bitCount;\n    size_t  byteCount;\n\n    FT_Byte  mask[( CF2_MAX_HINTS + 7 ) / 8];\n\n  } CF2_HintMaskRec, *CF2_HintMask;\n\n\n  typedef struct  CF2_StemHintRec_\n  {\n    FT_Bool  used;     /* DS positions are valid         */\n\n    CF2_Fixed  min;    /* original character space value */\n    CF2_Fixed  max;\n\n    CF2_Fixed  minDS;  /* DS position after first use    */\n    CF2_Fixed  maxDS;\n\n  } CF2_StemHintRec, *CF2_StemHint;\n\n\n  /*\n   * A HintMap object stores a piecewise linear function for mapping\n   * y-coordinates from character space to device space, providing\n   * appropriate pixel alignment to stem edges.\n   *\n   * The map is implemented as an array of `CF2_Hint' elements, each\n   * representing an edge.  When edges are paired, as from stem hints, the\n   * bottom edge must immediately precede the top edge in the array.\n   * Element character space AND device space positions must both increase\n   * monotonically in the array.  `CF2_Hint' elements are also used as\n   * parameters to `cf2_blues_capture'.\n   *\n   * The `cf2_hintmap_build' method must be called before any drawing\n   * operation (beginning with a Move operator) and at each hint\n   * substitution (HintMask operator).\n   *\n   * The `cf2_hintmap_map' method is called to transform y-coordinates at\n   * each drawing operation (move, line, curve).\n   *\n   */\n\n  /* TODO: make this a CF2_ArrStack and add a deep copy method */\n  enum\n  {\n    CF2_MAX_HINT_EDGES = CF2_MAX_HINTS * 2\n  };\n\n\n  typedef struct  CF2_HintMapRec_\n  {\n    CF2_Font  font;\n\n    /* initial map based on blue zones */\n    struct CF2_HintMapRec_*  initialHintMap;\n\n    /* working storage for 2nd pass adjustHints */\n    CF2_ArrStack  hintMoves;\n\n    FT_Bool  isValid;\n    FT_Bool  hinted;\n\n    CF2_Fixed  scale;\n    CF2_UInt   count;\n\n    /* start search from this index */\n    CF2_UInt  lastIndex;\n\n    CF2_HintRec  edge[CF2_MAX_HINT_EDGES]; /* 192 */\n\n  } CF2_HintMapRec, *CF2_HintMap;\n\n\n  FT_LOCAL( FT_Bool )\n  cf2_hint_isValid( const CF2_Hint  hint );\n  FT_LOCAL( FT_Bool )\n  cf2_hint_isTop( const CF2_Hint  hint );\n  FT_LOCAL( FT_Bool )\n  cf2_hint_isBottom( const CF2_Hint  hint );\n  FT_LOCAL( void )\n  cf2_hint_lock( CF2_Hint  hint );\n\n\n  FT_LOCAL( void )\n  cf2_hintmap_init( CF2_HintMap   hintmap,\n                    CF2_Font      font,\n                    CF2_HintMap   initialMap,\n                    CF2_ArrStack  hintMoves,\n                    CF2_Fixed     scale );\n  FT_LOCAL( void )\n  cf2_hintmap_build( CF2_HintMap   hintmap,\n                     CF2_ArrStack  hStemHintArray,\n                     CF2_ArrStack  vStemHintArray,\n                     CF2_HintMask  hintMask,\n                     CF2_Fixed     hintOrigin,\n                     FT_Bool       initialMap );\n\n\n  /*\n   * GlyphPath is a wrapper for drawing operations that scales the\n   * coordinates according to the render matrix and HintMap.  It also tracks\n   * open paths to control ClosePath and to insert MoveTo for broken fonts.\n   *\n   */\n  typedef struct  CF2_GlyphPathRec_\n  {\n    /* TODO: gather some of these into a hinting context */\n\n    CF2_Font              font;           /* font instance    */\n    CF2_OutlineCallbacks  callbacks;      /* outline consumer */\n\n\n    CF2_HintMapRec  hintMap;        /* current hint map            */\n    CF2_HintMapRec  firstHintMap;   /* saved copy                  */\n    CF2_HintMapRec  initialHintMap; /* based on all captured hints */\n\n    CF2_ArrStackRec  hintMoves;  /* list of hint moves for 2nd pass */\n\n    CF2_Fixed  scaleX;         /* matrix a */\n    CF2_Fixed  scaleC;         /* matrix c */\n    CF2_Fixed  scaleY;         /* matrix d */\n\n    FT_Vector  fractionalTranslation;  /* including deviceXScale */\n#if 0\n    CF2_Fixed  hShift;    /* character space horizontal shift */\n                          /* (for fauxing)                    */\n#endif\n\n    FT_Bool  pathIsOpen;     /* true after MoveTo                     */\n    FT_Bool  pathIsClosing;  /* true when synthesizing closepath line */\n    FT_Bool  darken;         /* true if stem darkening                */\n    FT_Bool  moveIsPending;  /* true between MoveTo and offset MoveTo */\n\n    /* references used to call `cf2_hintmap_build', if necessary */\n    CF2_ArrStack         hStemHintArray;\n    CF2_ArrStack         vStemHintArray;\n    CF2_HintMask         hintMask;     /* ptr to the current mask */\n    CF2_Fixed            hintOriginY;  /* copy of current origin  */\n    const CF2_BluesRec*  blues;\n\n    CF2_Fixed  xOffset;        /* character space offsets */\n    CF2_Fixed  yOffset;\n\n    /* character space miter limit threshold */\n    CF2_Fixed  miterLimit;\n    /* vertical/horzizontal snap distance in character space */\n    CF2_Fixed  snapThreshold;\n\n    FT_Vector  offsetStart0;  /* first and second points of first */\n    FT_Vector  offsetStart1;  /* element with offset applied      */\n\n    /* current point, character space, before offset */\n    FT_Vector  currentCS;\n    /* current point, device space */\n    FT_Vector  currentDS;\n    /* start point of subpath, character space */\n    FT_Vector  start;\n\n    /* the following members constitute the `queue' of one element */\n    FT_Bool  elemIsQueued;\n    CF2_Int  prevElemOp;\n\n    FT_Vector  prevElemP0;\n    FT_Vector  prevElemP1;\n    FT_Vector  prevElemP2;\n    FT_Vector  prevElemP3;\n\n  } CF2_GlyphPathRec, *CF2_GlyphPath;\n\n\n  FT_LOCAL( void )\n  cf2_glyphpath_init( CF2_GlyphPath         glyphpath,\n                      CF2_Font              font,\n                      CF2_OutlineCallbacks  callbacks,\n                      CF2_Fixed             scaleY,\n                      /* CF2_Fixed hShift, */\n                      CF2_ArrStack          hStemHintArray,\n                      CF2_ArrStack          vStemHintArray,\n                      CF2_HintMask          hintMask,\n                      CF2_Fixed             hintOrigin,\n                      const CF2_Blues       blues,\n                      const FT_Vector*      fractionalTranslation );\n  FT_LOCAL( void )\n  cf2_glyphpath_finalize( CF2_GlyphPath  glyphpath );\n\n  FT_LOCAL( void )\n  cf2_glyphpath_moveTo( CF2_GlyphPath  glyphpath,\n                        CF2_Fixed      x,\n                        CF2_Fixed      y );\n  FT_LOCAL( void )\n  cf2_glyphpath_lineTo( CF2_GlyphPath  glyphpath,\n                        CF2_Fixed      x,\n                        CF2_Fixed      y );\n  FT_LOCAL( void )\n  cf2_glyphpath_curveTo( CF2_GlyphPath  glyphpath,\n                         CF2_Fixed      x1,\n                         CF2_Fixed      y1,\n                         CF2_Fixed      x2,\n                         CF2_Fixed      y2,\n                         CF2_Fixed      x3,\n                         CF2_Fixed      y3 );\n  FT_LOCAL( void )\n  cf2_glyphpath_closeOpenPath( CF2_GlyphPath  glyphpath );\n\n\nFT_END_HEADER\n\n\n#endif /* __CF2HINTS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cf2intrp.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cf2intrp.c                                                             */\n/*                                                                         */\n/*    Adobe's CFF Interpreter (body).                                      */\n/*                                                                         */\n/*  Copyright 2007-2014 Adobe Systems Incorporated.                        */\n/*                                                                         */\n/*  This software, and all works of authorship, whether in source or       */\n/*  object code form as indicated by the copyright notice(s) included      */\n/*  herein (collectively, the \"Work\") is made available, and may only be   */\n/*  used, modified, and distributed under the FreeType Project License,    */\n/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */\n/*  FreeType Project License, each contributor to the Work hereby grants   */\n/*  to any individual or legal entity exercising permissions granted by    */\n/*  the FreeType Project License and this section (hereafter, \"You\" or     */\n/*  \"Your\") a perpetual, worldwide, non-exclusive, no-charge,              */\n/*  royalty-free, irrevocable (except as stated in this section) patent    */\n/*  license to make, have made, use, offer to sell, sell, import, and      */\n/*  otherwise transfer the Work, where such license applies only to those  */\n/*  patent claims licensable by such contributor that are necessarily      */\n/*  infringed by their contribution(s) alone or by combination of their    */\n/*  contribution(s) with the Work to which such contribution(s) was        */\n/*  submitted.  If You institute patent litigation against any entity      */\n/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */\n/*  the Work or a contribution incorporated within the Work constitutes    */\n/*  direct or contributory patent infringement, then any patent licenses   */\n/*  granted to You under this License for that Work shall terminate as of  */\n/*  the date such litigation is filed.                                     */\n/*                                                                         */\n/*  By using, modifying, or distributing the Work you indicate that you    */\n/*  have read and understood the terms and conditions of the               */\n/*  FreeType Project License as well as those provided in this section,    */\n/*  and you accept them fully.                                             */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"cf2ft.h\"\n#include FT_INTERNAL_DEBUG_H\n\n#include \"cf2glue.h\"\n#include \"cf2font.h\"\n#include \"cf2stack.h\"\n#include \"cf2hints.h\"\n\n#include \"cf2error.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_cf2interp\n\n\n  /* some operators are not implemented yet */\n#define CF2_FIXME  FT_TRACE4(( \"cf2_interpT2CharString:\"            \\\n                               \" operator not implemented yet\\n\" ))\n\n\n\n  FT_LOCAL_DEF( void )\n  cf2_hintmask_init( CF2_HintMask  hintmask,\n                     FT_Error*     error )\n  {\n    FT_ZERO( hintmask );\n\n    hintmask->error = error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Bool )\n  cf2_hintmask_isValid( const CF2_HintMask  hintmask )\n  {\n    return hintmask->isValid;\n  }\n\n\n  FT_LOCAL_DEF( FT_Bool )\n  cf2_hintmask_isNew( const CF2_HintMask  hintmask )\n  {\n    return hintmask->isNew;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cf2_hintmask_setNew( CF2_HintMask  hintmask,\n                       FT_Bool       val )\n  {\n    hintmask->isNew = val;\n  }\n\n\n  /* clients call `getMaskPtr' in order to iterate */\n  /* through hint mask                             */\n\n  FT_LOCAL_DEF( FT_Byte* )\n  cf2_hintmask_getMaskPtr( CF2_HintMask  hintmask )\n  {\n    return hintmask->mask;\n  }\n\n\n  static size_t\n  cf2_hintmask_setCounts( CF2_HintMask  hintmask,\n                          size_t        bitCount )\n  {\n    if ( bitCount > CF2_MAX_HINTS )\n    {\n      /* total of h and v stems must be <= 96 */\n      CF2_SET_ERROR( hintmask->error, Invalid_Glyph_Format );\n      return 0;\n    }\n\n    hintmask->bitCount  = bitCount;\n    hintmask->byteCount = ( hintmask->bitCount + 7 ) / 8;\n\n    hintmask->isValid = TRUE;\n    hintmask->isNew   = TRUE;\n\n    return bitCount;\n  }\n\n\n  /* consume the hintmask bytes from the charstring, advancing the src */\n  /* pointer                                                           */\n  static void\n  cf2_hintmask_read( CF2_HintMask  hintmask,\n                     CF2_Buffer    charstring,\n                     size_t        bitCount )\n  {\n    size_t  i;\n\n#ifndef CF2_NDEBUG\n    /* these are the bits in the final mask byte that should be zero  */\n    /* Note: this variable is only used in an assert expression below */\n    /* and then only if CF2_NDEBUG is not defined                     */\n    CF2_UInt  mask = ( 1 << ( -(CF2_Int)bitCount & 7 ) ) - 1;\n#endif\n\n\n    /* initialize counts and isValid */\n    if ( cf2_hintmask_setCounts( hintmask, bitCount ) == 0 )\n      return;\n\n    FT_ASSERT( hintmask->byteCount > 0 );\n\n    FT_TRACE4(( \" (maskbytes:\" ));\n\n    /* set mask and advance interpreter's charstring pointer */\n    for ( i = 0; i < hintmask->byteCount; i++ )\n    {\n      hintmask->mask[i] = (FT_Byte)cf2_buf_readByte( charstring );\n      FT_TRACE4(( \" 0x%02X\", hintmask->mask[i] ));\n    }\n\n    FT_TRACE4(( \")\\n\" ));\n\n    /* assert any unused bits in last byte are zero unless there's a prior */\n    /* error                                                               */\n    /* bitCount -> mask, 0 -> 0, 1 -> 7f, 2 -> 3f, ... 6 -> 3, 7 -> 1      */\n#ifndef CF2_NDEBUG\n    FT_ASSERT( ( hintmask->mask[hintmask->byteCount - 1] & mask ) == 0 ||\n               *hintmask->error                                        );\n#endif\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cf2_hintmask_setAll( CF2_HintMask  hintmask,\n                       size_t        bitCount )\n  {\n    size_t    i;\n    CF2_UInt  mask = ( 1 << ( -(CF2_Int)bitCount & 7 ) ) - 1;\n\n\n    /* initialize counts and isValid */\n    if ( cf2_hintmask_setCounts( hintmask, bitCount ) == 0 )\n      return;\n\n    FT_ASSERT( hintmask->byteCount > 0 );\n    FT_ASSERT( hintmask->byteCount <\n                 sizeof ( hintmask->mask ) / sizeof ( hintmask->mask[0] ) );\n\n    /* set mask to all ones */\n    for ( i = 0; i < hintmask->byteCount; i++ )\n      hintmask->mask[i] = 0xFF;\n\n    /* clear unused bits                                              */\n    /* bitCount -> mask, 0 -> 0, 1 -> 7f, 2 -> 3f, ... 6 -> 3, 7 -> 1 */\n    hintmask->mask[hintmask->byteCount - 1] &= ~mask;\n  }\n\n\n  /* Type2 charstring opcodes */\n  enum\n  {\n    cf2_cmdRESERVED_0,   /* 0 */\n    cf2_cmdHSTEM,        /* 1 */\n    cf2_cmdRESERVED_2,   /* 2 */\n    cf2_cmdVSTEM,        /* 3 */\n    cf2_cmdVMOVETO,      /* 4 */\n    cf2_cmdRLINETO,      /* 5 */\n    cf2_cmdHLINETO,      /* 6 */\n    cf2_cmdVLINETO,      /* 7 */\n    cf2_cmdRRCURVETO,    /* 8 */\n    cf2_cmdRESERVED_9,   /* 9 */\n    cf2_cmdCALLSUBR,     /* 10 */\n    cf2_cmdRETURN,       /* 11 */\n    cf2_cmdESC,          /* 12 */\n    cf2_cmdRESERVED_13,  /* 13 */\n    cf2_cmdENDCHAR,      /* 14 */\n    cf2_cmdRESERVED_15,  /* 15 */\n    cf2_cmdRESERVED_16,  /* 16 */\n    cf2_cmdRESERVED_17,  /* 17 */\n    cf2_cmdHSTEMHM,      /* 18 */\n    cf2_cmdHINTMASK,     /* 19 */\n    cf2_cmdCNTRMASK,     /* 20 */\n    cf2_cmdRMOVETO,      /* 21 */\n    cf2_cmdHMOVETO,      /* 22 */\n    cf2_cmdVSTEMHM,      /* 23 */\n    cf2_cmdRCURVELINE,   /* 24 */\n    cf2_cmdRLINECURVE,   /* 25 */\n    cf2_cmdVVCURVETO,    /* 26 */\n    cf2_cmdHHCURVETO,    /* 27 */\n    cf2_cmdEXTENDEDNMBR, /* 28 */\n    cf2_cmdCALLGSUBR,    /* 29 */\n    cf2_cmdVHCURVETO,    /* 30 */\n    cf2_cmdHVCURVETO     /* 31 */\n  };\n\n  enum\n  {\n    cf2_escDOTSECTION,   /* 0 */\n    cf2_escRESERVED_1,   /* 1 */\n    cf2_escRESERVED_2,   /* 2 */\n    cf2_escAND,          /* 3 */\n    cf2_escOR,           /* 4 */\n    cf2_escNOT,          /* 5 */\n    cf2_escRESERVED_6,   /* 6 */\n    cf2_escRESERVED_7,   /* 7 */\n    cf2_escRESERVED_8,   /* 8 */\n    cf2_escABS,          /* 9 */\n    cf2_escADD,          /* 10     like otherADD */\n    cf2_escSUB,          /* 11     like otherSUB */\n    cf2_escDIV,          /* 12 */\n    cf2_escRESERVED_13,  /* 13 */\n    cf2_escNEG,          /* 14 */\n    cf2_escEQ,           /* 15 */\n    cf2_escRESERVED_16,  /* 16 */\n    cf2_escRESERVED_17,  /* 17 */\n    cf2_escDROP,         /* 18 */\n    cf2_escRESERVED_19,  /* 19 */\n    cf2_escPUT,          /* 20     like otherPUT    */\n    cf2_escGET,          /* 21     like otherGET    */\n    cf2_escIFELSE,       /* 22     like otherIFELSE */\n    cf2_escRANDOM,       /* 23     like otherRANDOM */\n    cf2_escMUL,          /* 24     like otherMUL    */\n    cf2_escRESERVED_25,  /* 25 */\n    cf2_escSQRT,         /* 26 */\n    cf2_escDUP,          /* 27     like otherDUP    */\n    cf2_escEXCH,         /* 28     like otherEXCH   */\n    cf2_escINDEX,        /* 29 */\n    cf2_escROLL,         /* 30 */\n    cf2_escRESERVED_31,  /* 31 */\n    cf2_escRESERVED_32,  /* 32 */\n    cf2_escRESERVED_33,  /* 33 */\n    cf2_escHFLEX,        /* 34 */\n    cf2_escFLEX,         /* 35 */\n    cf2_escHFLEX1,       /* 36 */\n    cf2_escFLEX1         /* 37 */\n  };\n\n\n  /* `stemHintArray' does not change once we start drawing the outline. */\n  static void\n  cf2_doStems( const CF2_Font  font,\n               CF2_Stack       opStack,\n               CF2_ArrStack    stemHintArray,\n               CF2_Fixed*      width,\n               FT_Bool*        haveWidth,\n               CF2_Fixed       hintOffset )\n  {\n    CF2_UInt  i;\n    CF2_UInt  count       = cf2_stack_count( opStack );\n    FT_Bool   hasWidthArg = (FT_Bool)( count & 1 );\n\n    /* variable accumulates delta values from operand stack */\n    CF2_Fixed  position = hintOffset;\n\n    if ( hasWidthArg && ! *haveWidth )\n      *width = cf2_stack_getReal( opStack, 0 ) +\n                 cf2_getNominalWidthX( font->decoder );\n\n    if ( font->decoder->width_only )\n      goto exit;\n\n    for ( i = hasWidthArg ? 1 : 0; i < count; i += 2 )\n    {\n      /* construct a CF2_StemHint and push it onto the list */\n      CF2_StemHintRec  stemhint;\n\n\n      stemhint.min  =\n        position   += cf2_stack_getReal( opStack, i );\n      stemhint.max  =\n        position   += cf2_stack_getReal( opStack, i + 1 );\n\n      stemhint.used  = FALSE;\n      stemhint.maxDS =\n      stemhint.minDS = 0;\n\n      cf2_arrstack_push( stemHintArray, &stemhint ); /* defer error check */\n    }\n\n    cf2_stack_clear( opStack );\n\n  exit:\n    /* cf2_doStems must define a width (may be default) */\n    *haveWidth = TRUE;\n  }\n\n\n  static void\n  cf2_doFlex( CF2_Stack       opStack,\n              CF2_Fixed*      curX,\n              CF2_Fixed*      curY,\n              CF2_GlyphPath   glyphPath,\n              const FT_Bool*  readFromStack,\n              FT_Bool         doConditionalLastRead )\n  {\n    CF2_Fixed  vals[14];\n    CF2_UInt   index;\n    FT_Bool    isHFlex;\n    CF2_Int    top, i, j;\n\n\n    vals[0] = *curX;\n    vals[1] = *curY;\n    index   = 0;\n    isHFlex = readFromStack[9] == FALSE;\n    top     = isHFlex ? 9 : 10;\n\n    for ( i = 0; i < top; i++ )\n    {\n      vals[i + 2] = vals[i];\n      if ( readFromStack[i] )\n        vals[i + 2] += cf2_stack_getReal( opStack, index++ );\n    }\n\n    if ( isHFlex )\n      vals[9 + 2] = *curY;\n\n    if ( doConditionalLastRead )\n    {\n      FT_Bool    lastIsX = (FT_Bool)( cf2_fixedAbs( vals[10] - *curX ) >\n                                        cf2_fixedAbs( vals[11] - *curY ) );\n      CF2_Fixed  lastVal = cf2_stack_getReal( opStack, index );\n\n\n      if ( lastIsX )\n      {\n        vals[12] = vals[10] + lastVal;\n        vals[13] = *curY;\n      }\n      else\n      {\n        vals[12] = *curX;\n        vals[13] = vals[11] + lastVal;\n      }\n    }\n    else\n    {\n      if ( readFromStack[10] )\n        vals[12] = vals[10] + cf2_stack_getReal( opStack, index++ );\n      else\n        vals[12] = *curX;\n\n      if ( readFromStack[11] )\n        vals[13] = vals[11] + cf2_stack_getReal( opStack, index );\n      else\n        vals[13] = *curY;\n    }\n\n    for ( j = 0; j < 2; j++ )\n      cf2_glyphpath_curveTo( glyphPath, vals[j * 6 + 2],\n                                        vals[j * 6 + 3],\n                                        vals[j * 6 + 4],\n                                        vals[j * 6 + 5],\n                                        vals[j * 6 + 6],\n                                        vals[j * 6 + 7] );\n\n    cf2_stack_clear( opStack );\n\n    *curX = vals[12];\n    *curY = vals[13];\n  }\n\n\n  /*\n   * `error' is a shared error code used by many objects in this\n   * routine.  Before the code continues from an error, it must check and\n   * record the error in `*error'.  The idea is that this shared\n   * error code will record the first error encountered.  If testing\n   * for an error anyway, the cost of `goto exit' is small, so we do it,\n   * even if continuing would be safe.  In this case, `lastError' is\n   * set, so the testing and storing can be done in one place, at `exit'.\n   *\n   * Continuing after an error is intended for objects which do their own\n   * testing of `*error', e.g., array stack functions.  This allows us to\n   * avoid an extra test after the call.\n   *\n   * Unimplemented opcodes are ignored.\n   *\n   */\n  FT_LOCAL_DEF( void )\n  cf2_interpT2CharString( CF2_Font              font,\n                          CF2_Buffer            buf,\n                          CF2_OutlineCallbacks  callbacks,\n                          const FT_Vector*      translation,\n                          FT_Bool               doingSeac,\n                          CF2_Fixed             curX,\n                          CF2_Fixed             curY,\n                          CF2_Fixed*            width )\n  {\n    /* lastError is used for errors that are immediately tested */\n    FT_Error  lastError = FT_Err_Ok;\n\n    /* pointer to parsed font object */\n    CFF_Decoder*  decoder = font->decoder;\n\n    FT_Error*  error  = &font->error;\n    FT_Memory  memory = font->memory;\n\n    CF2_Fixed  scaleY        = font->innerTransform.d;\n    CF2_Fixed  nominalWidthX = cf2_getNominalWidthX( decoder );\n\n    /* save this for hinting seac accents */\n    CF2_Fixed  hintOriginY = curY;\n\n    CF2_Stack  opStack = NULL;\n    FT_Byte    op1;                       /* first opcode byte */\n\n    /* instruction limit; 20,000,000 matches Avalon */\n    FT_UInt32  instructionLimit = 20000000UL;\n\n    CF2_ArrStackRec  subrStack;\n\n    FT_Bool     haveWidth;\n    CF2_Buffer  charstring = NULL;\n\n    CF2_Int  charstringIndex = -1;       /* initialize to empty */\n\n    /* TODO: placeholders for hint structures */\n\n    /* objects used for hinting */\n    CF2_ArrStackRec  hStemHintArray;\n    CF2_ArrStackRec  vStemHintArray;\n\n    CF2_HintMaskRec   hintMask;\n    CF2_GlyphPathRec  glyphPath;\n\n\n    /* initialize the remaining objects */\n    cf2_arrstack_init( &subrStack,\n                       memory,\n                       error,\n                       sizeof ( CF2_BufferRec ) );\n    cf2_arrstack_init( &hStemHintArray,\n                       memory,\n                       error,\n                       sizeof ( CF2_StemHintRec ) );\n    cf2_arrstack_init( &vStemHintArray,\n                       memory,\n                       error,\n                       sizeof ( CF2_StemHintRec ) );\n\n    /* initialize CF2_StemHint arrays */\n    cf2_hintmask_init( &hintMask, error );\n\n    /* initialize path map to manage drawing operations */\n\n    /* Note: last 4 params are used to handle `MoveToPermissive', which */\n    /*       may need to call `hintMap.Build'                           */\n    /* TODO: MoveToPermissive is gone; are these still needed?          */\n    cf2_glyphpath_init( &glyphPath,\n                        font,\n                        callbacks,\n                        scaleY,\n                        /* hShift, */\n                        &hStemHintArray,\n                        &vStemHintArray,\n                        &hintMask,\n                        hintOriginY,\n                        &font->blues,\n                        translation );\n\n    /*\n     * Initialize state for width parsing.  From the CFF Spec:\n     *\n     *   The first stack-clearing operator, which must be one of hstem,\n     *   hstemhm, vstem, vstemhm, cntrmask, hintmask, hmoveto, vmoveto,\n     *   rmoveto, or endchar, takes an additional argument - the width (as\n     *   described earlier), which may be expressed as zero or one numeric\n     *   argument.\n     *\n     * What we implement here uses the first validly specified width, but\n     * does not detect errors for specifying more than one width.\n     *\n     * If one of the above operators occurs without explicitly specifying\n     * a width, we assume the default width.\n     *\n     */\n    haveWidth = FALSE;\n    *width    = cf2_getDefaultWidthX( decoder );\n\n    /*\n     * Note: at this point, all pointers to resources must be NULL\n     * and all local objects must be initialized.\n     * There must be no branches to exit: above this point.\n     *\n     */\n\n    /* allocate an operand stack */\n    opStack = cf2_stack_init( memory, error );\n    if ( !opStack )\n    {\n      lastError = FT_THROW( Out_Of_Memory );\n      goto exit;\n    }\n\n    /* initialize subroutine stack by placing top level charstring as */\n    /* first element (max depth plus one for the charstring)          */\n    /* Note: Caller owns and must finalize the first charstring.      */\n    /*       Our copy of it does not change that requirement.         */\n    cf2_arrstack_setCount( &subrStack, CF2_MAX_SUBR + 1 );\n\n    charstring  = (CF2_Buffer)cf2_arrstack_getBuffer( &subrStack );\n    *charstring = *buf;    /* structure copy */\n\n    charstringIndex = 0;       /* entry is valid now */\n\n    /* catch errors so far */\n    if ( *error )\n      goto exit;\n\n    /* main interpreter loop */\n    while ( 1 )\n    {\n      if ( cf2_buf_isEnd( charstring ) )\n      {\n        /* If we've reached the end of the charstring, simulate a */\n        /* cf2_cmdRETURN or cf2_cmdENDCHAR.                       */\n        if ( charstringIndex )\n          op1 = cf2_cmdRETURN;  /* end of buffer for subroutine */\n        else\n          op1 = cf2_cmdENDCHAR; /* end of buffer for top level charstring */\n      }\n      else\n        op1 = (FT_Byte)cf2_buf_readByte( charstring );\n\n      /* check for errors once per loop */\n      if ( *error )\n        goto exit;\n\n      instructionLimit--;\n      if ( instructionLimit == 0 )\n      {\n        lastError = FT_THROW( Invalid_Glyph_Format );\n        goto exit;\n      }\n\n      switch( op1 )\n      {\n      case cf2_cmdRESERVED_0:\n      case cf2_cmdRESERVED_2:\n      case cf2_cmdRESERVED_9:\n      case cf2_cmdRESERVED_13:\n      case cf2_cmdRESERVED_15:\n      case cf2_cmdRESERVED_16:\n      case cf2_cmdRESERVED_17:\n        /* we may get here if we have a prior error */\n        FT_TRACE4(( \" unknown op (%d)\\n\", op1 ));\n        break;\n\n      case cf2_cmdHSTEMHM:\n      case cf2_cmdHSTEM:\n        FT_TRACE4(( op1 == cf2_cmdHSTEMHM ? \" hstemhm\\n\" : \" hstem\\n\" ));\n\n        /* never add hints after the mask is computed */\n        if ( cf2_hintmask_isValid( &hintMask ) )\n        {\n          FT_TRACE4(( \"cf2_interpT2CharString:\"\n                      \" invalid horizontal hint mask\\n\" ));\n          break;\n        }\n\n        cf2_doStems( font,\n                     opStack,\n                     &hStemHintArray,\n                     width,\n                     &haveWidth,\n                     0 );\n\n        if ( font->decoder->width_only )\n            goto exit;\n\n        break;\n\n      case cf2_cmdVSTEMHM:\n      case cf2_cmdVSTEM:\n        FT_TRACE4(( op1 == cf2_cmdVSTEMHM ? \" vstemhm\\n\" : \" vstem\\n\" ));\n\n        /* never add hints after the mask is computed */\n        if ( cf2_hintmask_isValid( &hintMask ) )\n        {\n          FT_TRACE4(( \"cf2_interpT2CharString:\"\n                      \" invalid vertical hint mask\\n\" ));\n          break;\n        }\n\n        cf2_doStems( font,\n                     opStack,\n                     &vStemHintArray,\n                     width,\n                     &haveWidth,\n                     0 );\n\n        if ( font->decoder->width_only )\n            goto exit;\n\n        break;\n\n      case cf2_cmdVMOVETO:\n        FT_TRACE4(( \" vmoveto\\n\" ));\n\n        if ( cf2_stack_count( opStack ) > 1 && !haveWidth )\n          *width = cf2_stack_getReal( opStack, 0 ) + nominalWidthX;\n\n        /* width is defined or default after this */\n        haveWidth = TRUE;\n\n        if ( font->decoder->width_only )\n            goto exit;\n\n        curY += cf2_stack_popFixed( opStack );\n\n        cf2_glyphpath_moveTo( &glyphPath, curX, curY );\n\n        break;\n\n      case cf2_cmdRLINETO:\n        {\n          CF2_UInt  index;\n          CF2_UInt  count = cf2_stack_count( opStack );\n\n\n          FT_TRACE4(( \" rlineto\\n\" ));\n\n          for ( index = 0; index < count; index += 2 )\n          {\n            curX += cf2_stack_getReal( opStack, index + 0 );\n            curY += cf2_stack_getReal( opStack, index + 1 );\n\n            cf2_glyphpath_lineTo( &glyphPath, curX, curY );\n          }\n\n          cf2_stack_clear( opStack );\n        }\n        continue; /* no need to clear stack again */\n\n      case cf2_cmdHLINETO:\n      case cf2_cmdVLINETO:\n        {\n          CF2_UInt  index;\n          CF2_UInt  count = cf2_stack_count( opStack );\n\n          FT_Bool  isX = op1 == cf2_cmdHLINETO;\n\n\n          FT_TRACE4(( isX ? \" hlineto\\n\" : \" vlineto\\n\" ));\n\n          for ( index = 0; index < count; index++ )\n          {\n            CF2_Fixed  v = cf2_stack_getReal( opStack, index );\n\n\n            if ( isX )\n              curX += v;\n            else\n              curY += v;\n\n            isX = !isX;\n\n            cf2_glyphpath_lineTo( &glyphPath, curX, curY );\n          }\n\n          cf2_stack_clear( opStack );\n        }\n        continue;\n\n      case cf2_cmdRCURVELINE:\n      case cf2_cmdRRCURVETO:\n        {\n          CF2_UInt  count = cf2_stack_count( opStack );\n          CF2_UInt  index = 0;\n\n\n          FT_TRACE4(( op1 == cf2_cmdRCURVELINE ? \" rcurveline\\n\"\n                                               : \" rrcurveto\\n\" ));\n\n          while ( index + 6 <= count )\n          {\n            CF2_Fixed  x1 = cf2_stack_getReal( opStack, index + 0 ) + curX;\n            CF2_Fixed  y1 = cf2_stack_getReal( opStack, index + 1 ) + curY;\n            CF2_Fixed  x2 = cf2_stack_getReal( opStack, index + 2 ) + x1;\n            CF2_Fixed  y2 = cf2_stack_getReal( opStack, index + 3 ) + y1;\n            CF2_Fixed  x3 = cf2_stack_getReal( opStack, index + 4 ) + x2;\n            CF2_Fixed  y3 = cf2_stack_getReal( opStack, index + 5 ) + y2;\n\n\n            cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );\n\n            curX   = x3;\n            curY   = y3;\n            index += 6;\n          }\n\n          if ( op1 == cf2_cmdRCURVELINE )\n          {\n            curX += cf2_stack_getReal( opStack, index + 0 );\n            curY += cf2_stack_getReal( opStack, index + 1 );\n\n            cf2_glyphpath_lineTo( &glyphPath, curX, curY );\n          }\n\n          cf2_stack_clear( opStack );\n        }\n        continue; /* no need to clear stack again */\n\n      case cf2_cmdCALLGSUBR:\n      case cf2_cmdCALLSUBR:\n        {\n          CF2_UInt  subrIndex;\n\n\n          FT_TRACE4(( op1 == cf2_cmdCALLGSUBR ? \" callgsubr\"\n                                              : \" callsubr\" ));\n\n          if ( charstringIndex > CF2_MAX_SUBR )\n          {\n            /* max subr plus one for charstring */\n            lastError = FT_THROW( Invalid_Glyph_Format );\n            goto exit;                      /* overflow of stack */\n          }\n\n          /* push our current CFF charstring region on subrStack */\n          charstring = (CF2_Buffer)\n                         cf2_arrstack_getPointer( &subrStack,\n                                                  charstringIndex + 1 );\n\n          /* set up the new CFF region and pointer */\n          subrIndex = cf2_stack_popInt( opStack );\n\n          switch ( op1 )\n          {\n          case cf2_cmdCALLGSUBR:\n            FT_TRACE4(( \"(%d)\\n\", subrIndex + decoder->globals_bias ));\n\n            if ( cf2_initGlobalRegionBuffer( decoder,\n                                             subrIndex,\n                                             charstring ) )\n            {\n              lastError = FT_THROW( Invalid_Glyph_Format );\n              goto exit;  /* subroutine lookup or stream error */\n            }\n            break;\n\n          default:\n            /* cf2_cmdCALLSUBR */\n            FT_TRACE4(( \"(%d)\\n\", subrIndex + decoder->locals_bias ));\n\n            if ( cf2_initLocalRegionBuffer( decoder,\n                                            subrIndex,\n                                            charstring ) )\n            {\n              lastError = FT_THROW( Invalid_Glyph_Format );\n              goto exit;  /* subroutine lookup or stream error */\n            }\n          }\n\n          charstringIndex += 1;       /* entry is valid now */\n        }\n        continue; /* do not clear the stack */\n\n      case cf2_cmdRETURN:\n        FT_TRACE4(( \" return\\n\" ));\n\n        if ( charstringIndex < 1 )\n        {\n          /* Note: cannot return from top charstring */\n          lastError = FT_THROW( Invalid_Glyph_Format );\n          goto exit;                      /* underflow of stack */\n        }\n\n        /* restore position in previous charstring */\n        charstring = (CF2_Buffer)\n                       cf2_arrstack_getPointer( &subrStack,\n                                                --charstringIndex );\n        continue;     /* do not clear the stack */\n\n      case cf2_cmdESC:\n        {\n          FT_Byte  op2 = (FT_Byte)cf2_buf_readByte( charstring );\n\n\n          switch ( op2 )\n          {\n          case cf2_escDOTSECTION:\n            /* something about `flip type of locking' -- ignore it */\n            FT_TRACE4(( \" dotsection\\n\" ));\n\n            break;\n\n          /* TODO: should these operators be supported? */\n          case cf2_escAND: /* in spec */\n            FT_TRACE4(( \" and\\n\" ));\n\n            CF2_FIXME;\n            break;\n\n          case cf2_escOR: /* in spec */\n            FT_TRACE4(( \" or\\n\" ));\n\n            CF2_FIXME;\n            break;\n\n          case cf2_escNOT: /* in spec */\n            FT_TRACE4(( \" not\\n\" ));\n\n            CF2_FIXME;\n            break;\n\n          case cf2_escABS: /* in spec */\n            FT_TRACE4(( \" abs\\n\" ));\n\n            CF2_FIXME;\n            break;\n\n          case cf2_escADD: /* in spec */\n            FT_TRACE4(( \" add\\n\" ));\n\n            CF2_FIXME;\n            break;\n\n          case cf2_escSUB: /* in spec */\n            FT_TRACE4(( \" sub\\n\" ));\n\n            CF2_FIXME;\n            break;\n\n          case cf2_escDIV: /* in spec */\n            FT_TRACE4(( \" div\\n\" ));\n\n            CF2_FIXME;\n            break;\n\n          case cf2_escNEG: /* in spec */\n            FT_TRACE4(( \" neg\\n\" ));\n\n            CF2_FIXME;\n            break;\n\n          case cf2_escEQ: /* in spec */\n            FT_TRACE4(( \" eq\\n\" ));\n\n            CF2_FIXME;\n            break;\n\n          case cf2_escDROP: /* in spec */\n            FT_TRACE4(( \" drop\\n\" ));\n\n            CF2_FIXME;\n            break;\n\n          case cf2_escPUT: /* in spec */\n            FT_TRACE4(( \" put\\n\" ));\n\n            CF2_FIXME;\n            break;\n\n          case cf2_escGET: /* in spec */\n            FT_TRACE4(( \" get\\n\" ));\n\n            CF2_FIXME;\n            break;\n\n          case cf2_escIFELSE: /* in spec */\n            FT_TRACE4(( \" ifelse\\n\" ));\n\n            CF2_FIXME;\n            break;\n\n          case cf2_escRANDOM: /* in spec */\n            FT_TRACE4(( \" random\\n\" ));\n\n            CF2_FIXME;\n            break;\n\n          case cf2_escMUL: /* in spec */\n            FT_TRACE4(( \" mul\\n\" ));\n\n            CF2_FIXME;\n            break;\n\n          case cf2_escSQRT: /* in spec */\n            FT_TRACE4(( \" sqrt\\n\" ));\n\n            CF2_FIXME;\n            break;\n\n          case cf2_escDUP: /* in spec */\n            FT_TRACE4(( \" dup\\n\" ));\n\n            CF2_FIXME;\n            break;\n\n          case cf2_escEXCH: /* in spec */\n            FT_TRACE4(( \" exch\\n\" ));\n\n            CF2_FIXME;\n            break;\n\n          case cf2_escINDEX: /* in spec */\n            FT_TRACE4(( \" index\\n\" ));\n\n            CF2_FIXME;\n            break;\n\n          case cf2_escROLL: /* in spec */\n            FT_TRACE4(( \" roll\\n\" ));\n\n            CF2_FIXME;\n            break;\n\n          case cf2_escHFLEX:\n            {\n              static const FT_Bool  readFromStack[12] =\n              {\n                TRUE /* dx1 */, FALSE /* dy1 */,\n                TRUE /* dx2 */, TRUE  /* dy2 */,\n                TRUE /* dx3 */, FALSE /* dy3 */,\n                TRUE /* dx4 */, FALSE /* dy4 */,\n                TRUE /* dx5 */, FALSE /* dy5 */,\n                TRUE /* dx6 */, FALSE /* dy6 */\n              };\n\n\n              FT_TRACE4(( \" hflex\\n\" ));\n\n              cf2_doFlex( opStack,\n                          &curX,\n                          &curY,\n                          &glyphPath,\n                          readFromStack,\n                          FALSE /* doConditionalLastRead */ );\n            }\n            continue;\n\n          case cf2_escFLEX:\n            {\n              static const FT_Bool  readFromStack[12] =\n              {\n                TRUE /* dx1 */, TRUE /* dy1 */,\n                TRUE /* dx2 */, TRUE /* dy2 */,\n                TRUE /* dx3 */, TRUE /* dy3 */,\n                TRUE /* dx4 */, TRUE /* dy4 */,\n                TRUE /* dx5 */, TRUE /* dy5 */,\n                TRUE /* dx6 */, TRUE /* dy6 */\n              };\n\n\n              FT_TRACE4(( \" flex\\n\" ));\n\n              cf2_doFlex( opStack,\n                          &curX,\n                          &curY,\n                          &glyphPath,\n                          readFromStack,\n                          FALSE /* doConditionalLastRead */ );\n            }\n            break;      /* TODO: why is this not a continue? */\n\n          case cf2_escHFLEX1:\n            {\n              static const FT_Bool  readFromStack[12] =\n              {\n                TRUE /* dx1 */, TRUE  /* dy1 */,\n                TRUE /* dx2 */, TRUE  /* dy2 */,\n                TRUE /* dx3 */, FALSE /* dy3 */,\n                TRUE /* dx4 */, FALSE /* dy4 */,\n                TRUE /* dx5 */, TRUE  /* dy5 */,\n                TRUE /* dx6 */, FALSE /* dy6 */\n              };\n\n\n              FT_TRACE4(( \" hflex1\\n\" ));\n\n              cf2_doFlex( opStack,\n                          &curX,\n                          &curY,\n                          &glyphPath,\n                          readFromStack,\n                          FALSE /* doConditionalLastRead */ );\n            }\n            continue;\n\n          case cf2_escFLEX1:\n            {\n              static const FT_Bool  readFromStack[12] =\n              {\n                TRUE  /* dx1 */, TRUE  /* dy1 */,\n                TRUE  /* dx2 */, TRUE  /* dy2 */,\n                TRUE  /* dx3 */, TRUE  /* dy3 */,\n                TRUE  /* dx4 */, TRUE  /* dy4 */,\n                TRUE  /* dx5 */, TRUE  /* dy5 */,\n                FALSE /* dx6 */, FALSE /* dy6 */\n              };\n\n\n              FT_TRACE4(( \" flex1\\n\" ));\n\n              cf2_doFlex( opStack,\n                          &curX,\n                          &curY,\n                          &glyphPath,\n                          readFromStack,\n                          TRUE /* doConditionalLastRead */ );\n            }\n            continue;\n\n          case cf2_escRESERVED_1:\n          case cf2_escRESERVED_2:\n          case cf2_escRESERVED_6:\n          case cf2_escRESERVED_7:\n          case cf2_escRESERVED_8:\n          case cf2_escRESERVED_13:\n          case cf2_escRESERVED_16:\n          case cf2_escRESERVED_17:\n          case cf2_escRESERVED_19:\n          case cf2_escRESERVED_25:\n          case cf2_escRESERVED_31:\n          case cf2_escRESERVED_32:\n          case cf2_escRESERVED_33:\n          default:\n            FT_TRACE4(( \" unknown op (12, %d)\\n\", op2 ));\n\n          }; /* end of switch statement checking `op2' */\n\n        } /* case cf2_cmdESC */\n        break;\n\n      case cf2_cmdENDCHAR:\n        FT_TRACE4(( \" endchar\\n\" ));\n\n        if ( cf2_stack_count( opStack ) == 1 ||\n             cf2_stack_count( opStack ) == 5 )\n        {\n          if ( !haveWidth )\n            *width = cf2_stack_getReal( opStack, 0 ) + nominalWidthX;\n        }\n\n        /* width is defined or default after this */\n        haveWidth = TRUE;\n\n        if ( font->decoder->width_only )\n            goto exit;\n\n        /* close path if still open */\n        cf2_glyphpath_closeOpenPath( &glyphPath );\n\n        if ( cf2_stack_count( opStack ) > 1 )\n        {\n          /* must be either 4 or 5 --                       */\n          /* this is a (deprecated) implied `seac' operator */\n\n          CF2_UInt       achar;\n          CF2_UInt       bchar;\n          CF2_BufferRec  component;\n          CF2_Fixed      dummyWidth;   /* ignore component width */\n          FT_Error       error2;\n\n\n          if ( doingSeac )\n          {\n            lastError = FT_THROW( Invalid_Glyph_Format );\n            goto exit;      /* nested seac */\n          }\n\n          achar = cf2_stack_popInt( opStack );\n          bchar = cf2_stack_popInt( opStack );\n\n          curY = cf2_stack_popFixed( opStack );\n          curX = cf2_stack_popFixed( opStack );\n\n          error2 = cf2_getSeacComponent( decoder, achar, &component );\n          if ( error2 )\n          {\n             lastError = error2;      /* pass FreeType error through */\n             goto exit;\n          }\n          cf2_interpT2CharString( font,\n                                  &component,\n                                  callbacks,\n                                  translation,\n                                  TRUE,\n                                  curX,\n                                  curY,\n                                  &dummyWidth );\n          cf2_freeSeacComponent( decoder, &component );\n\n          error2 = cf2_getSeacComponent( decoder, bchar, &component );\n          if ( error2 )\n          {\n            lastError = error2;      /* pass FreeType error through */\n            goto exit;\n          }\n          cf2_interpT2CharString( font,\n                                  &component,\n                                  callbacks,\n                                  translation,\n                                  TRUE,\n                                  0,\n                                  0,\n                                  &dummyWidth );\n          cf2_freeSeacComponent( decoder, &component );\n        }\n        goto exit;\n\n      case cf2_cmdCNTRMASK:\n      case cf2_cmdHINTMASK:\n        /* the final \\n in the tracing message gets added in      */\n        /* `cf2_hintmask_read' (which also traces the mask bytes) */\n        FT_TRACE4(( op1 == cf2_cmdCNTRMASK ? \" cntrmask\" : \" hintmask\" ));\n\n        /* never add hints after the mask is computed */\n        if ( cf2_stack_count( opStack ) > 1    &&\n             cf2_hintmask_isValid( &hintMask ) )\n        {\n          FT_TRACE4(( \"cf2_interpT2CharString: invalid hint mask\\n\" ));\n          break;\n        }\n\n        /* if there are arguments on the stack, there this is an */\n        /* implied cf2_cmdVSTEMHM                                */\n        cf2_doStems( font,\n                     opStack,\n                     &vStemHintArray,\n                     width,\n                     &haveWidth,\n                     0 );\n\n        if ( font->decoder->width_only )\n            goto exit;\n\n        if ( op1 == cf2_cmdHINTMASK )\n        {\n          /* consume the hint mask bytes which follow the operator */\n          cf2_hintmask_read( &hintMask,\n                             charstring,\n                             cf2_arrstack_size( &hStemHintArray ) +\n                               cf2_arrstack_size( &vStemHintArray ) );\n        }\n        else\n        {\n          /*\n           * Consume the counter mask bytes which follow the operator:\n           * Build a temporary hint map, just to place and lock those\n           * stems participating in the counter mask.  These are most\n           * likely the dominant hstems, and are grouped together in a\n           * few counter groups, not necessarily in correspondence\n           * with the hint groups.  This reduces the chances of\n           * conflicts between hstems that are initially placed in\n           * separate hint groups and then brought together.  The\n           * positions are copied back to `hStemHintArray', so we can\n           * discard `counterMask' and `counterHintMap'.\n           *\n           */\n          CF2_HintMapRec   counterHintMap;\n          CF2_HintMaskRec  counterMask;\n\n\n          cf2_hintmap_init( &counterHintMap,\n                            font,\n                            &glyphPath.initialHintMap,\n                            &glyphPath.hintMoves,\n                            scaleY );\n          cf2_hintmask_init( &counterMask, error );\n\n          cf2_hintmask_read( &counterMask,\n                             charstring,\n                             cf2_arrstack_size( &hStemHintArray ) +\n                               cf2_arrstack_size( &vStemHintArray ) );\n          cf2_hintmap_build( &counterHintMap,\n                             &hStemHintArray,\n                             &vStemHintArray,\n                             &counterMask,\n                             0,\n                             FALSE );\n        }\n        break;\n\n      case cf2_cmdRMOVETO:\n        FT_TRACE4(( \" rmoveto\\n\" ));\n\n        if ( cf2_stack_count( opStack ) > 2 && !haveWidth )\n          *width = cf2_stack_getReal( opStack, 0 ) + nominalWidthX;\n\n        /* width is defined or default after this */\n        haveWidth = TRUE;\n\n        if ( font->decoder->width_only )\n            goto exit;\n\n        curY += cf2_stack_popFixed( opStack );\n        curX += cf2_stack_popFixed( opStack );\n\n        cf2_glyphpath_moveTo( &glyphPath, curX, curY );\n\n        break;\n\n      case cf2_cmdHMOVETO:\n        FT_TRACE4(( \" hmoveto\\n\" ));\n\n        if ( cf2_stack_count( opStack ) > 1 && !haveWidth )\n          *width = cf2_stack_getReal( opStack, 0 ) + nominalWidthX;\n\n        /* width is defined or default after this */\n        haveWidth = TRUE;\n\n        if ( font->decoder->width_only )\n            goto exit;\n\n        curX += cf2_stack_popFixed( opStack );\n\n        cf2_glyphpath_moveTo( &glyphPath, curX, curY );\n\n        break;\n\n      case cf2_cmdRLINECURVE:\n        {\n          CF2_UInt  count = cf2_stack_count( opStack );\n          CF2_UInt  index = 0;\n\n\n          FT_TRACE4(( \" rlinecurve\\n\" ));\n\n          while ( index + 6 < count )\n          {\n            curX += cf2_stack_getReal( opStack, index + 0 );\n            curY += cf2_stack_getReal( opStack, index + 1 );\n\n            cf2_glyphpath_lineTo( &glyphPath, curX, curY );\n            index += 2;\n          }\n\n          while ( index < count )\n          {\n            CF2_Fixed  x1 = cf2_stack_getReal( opStack, index + 0 ) + curX;\n            CF2_Fixed  y1 = cf2_stack_getReal( opStack, index + 1 ) + curY;\n            CF2_Fixed  x2 = cf2_stack_getReal( opStack, index + 2 ) + x1;\n            CF2_Fixed  y2 = cf2_stack_getReal( opStack, index + 3 ) + y1;\n            CF2_Fixed  x3 = cf2_stack_getReal( opStack, index + 4 ) + x2;\n            CF2_Fixed  y3 = cf2_stack_getReal( opStack, index + 5 ) + y2;\n\n\n            cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );\n\n            curX   = x3;\n            curY   = y3;\n            index += 6;\n          }\n\n          cf2_stack_clear( opStack );\n        }\n        continue; /* no need to clear stack again */\n\n      case cf2_cmdVVCURVETO:\n        {\n          CF2_UInt  count = cf2_stack_count( opStack );\n          CF2_UInt  index = 0;\n\n\n          FT_TRACE4(( \" vvcurveto\\n\" ));\n\n          while ( index < count )\n          {\n            CF2_Fixed  x1, y1, x2, y2, x3, y3;\n\n\n            if ( ( count - index ) & 1 )\n            {\n              x1 = cf2_stack_getReal( opStack, index ) + curX;\n\n              ++index;\n            }\n            else\n              x1 = curX;\n\n            y1 = cf2_stack_getReal( opStack, index + 0 ) + curY;\n            x2 = cf2_stack_getReal( opStack, index + 1 ) + x1;\n            y2 = cf2_stack_getReal( opStack, index + 2 ) + y1;\n            x3 = x2;\n            y3 = cf2_stack_getReal( opStack, index + 3 ) + y2;\n\n            cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );\n\n            curX   = x3;\n            curY   = y3;\n            index += 4;\n          }\n\n          cf2_stack_clear( opStack );\n        }\n        continue; /* no need to clear stack again */\n\n      case cf2_cmdHHCURVETO:\n        {\n          CF2_UInt  count = cf2_stack_count( opStack );\n          CF2_UInt  index = 0;\n\n\n          FT_TRACE4(( \" hhcurveto\\n\" ));\n\n          while ( index < count )\n          {\n            CF2_Fixed  x1, y1, x2, y2, x3, y3;\n\n\n            if ( ( count - index ) & 1 )\n            {\n              y1 = cf2_stack_getReal( opStack, index ) + curY;\n\n              ++index;\n            }\n            else\n              y1 = curY;\n\n            x1 = cf2_stack_getReal( opStack, index + 0 ) + curX;\n            x2 = cf2_stack_getReal( opStack, index + 1 ) + x1;\n            y2 = cf2_stack_getReal( opStack, index + 2 ) + y1;\n            x3 = cf2_stack_getReal( opStack, index + 3 ) + x2;\n            y3 = y2;\n\n            cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );\n\n            curX   = x3;\n            curY   = y3;\n            index += 4;\n          }\n\n          cf2_stack_clear( opStack );\n        }\n        continue; /* no need to clear stack again */\n\n      case cf2_cmdVHCURVETO:\n      case cf2_cmdHVCURVETO:\n        {\n          CF2_UInt  count = cf2_stack_count( opStack );\n          CF2_UInt  index = 0;\n\n          FT_Bool  alternate = op1 == cf2_cmdHVCURVETO;\n\n\n          FT_TRACE4(( alternate ? \" hvcurveto\\n\" : \" vhcurveto\\n\" ));\n\n          while ( index < count )\n          {\n            CF2_Fixed x1, x2, x3, y1, y2, y3;\n\n\n            if ( alternate )\n            {\n              x1 = cf2_stack_getReal( opStack, index + 0 ) + curX;\n              y1 = curY;\n              x2 = cf2_stack_getReal( opStack, index + 1 ) + x1;\n              y2 = cf2_stack_getReal( opStack, index + 2 ) + y1;\n              y3 = cf2_stack_getReal( opStack, index + 3 ) + y2;\n\n              if ( count - index == 5 )\n              {\n                x3 = cf2_stack_getReal( opStack, index + 4 ) + x2;\n\n                ++index;\n              }\n              else\n                x3 = x2;\n\n              alternate = FALSE;\n            }\n            else\n            {\n              x1 = curX;\n              y1 = cf2_stack_getReal( opStack, index + 0 ) + curY;\n              x2 = cf2_stack_getReal( opStack, index + 1 ) + x1;\n              y2 = cf2_stack_getReal( opStack, index + 2 ) + y1;\n              x3 = cf2_stack_getReal( opStack, index + 3 ) + x2;\n\n              if ( count - index == 5 )\n              {\n                y3 = cf2_stack_getReal( opStack, index + 4 ) + y2;\n\n                ++index;\n              }\n              else\n                y3 = y2;\n\n              alternate = TRUE;\n            }\n\n            cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );\n\n            curX   = x3;\n            curY   = y3;\n            index += 4;\n          }\n\n          cf2_stack_clear( opStack );\n        }\n        continue;     /* no need to clear stack again */\n\n      case cf2_cmdEXTENDEDNMBR:\n        {\n          CF2_Int  v;\n\n\n          v = (FT_Short)( ( cf2_buf_readByte( charstring ) << 8 ) |\n                            cf2_buf_readByte( charstring )        );\n\n          FT_TRACE4(( \" %d\", v ));\n\n          cf2_stack_pushInt( opStack, v );\n        }\n        continue;\n\n      default:\n        /* numbers */\n        {\n          if ( /* op1 >= 32 && */ op1 <= 246 )\n          {\n            CF2_Int  v;\n\n\n            v = op1 - 139;\n\n            FT_TRACE4(( \" %d\", v ));\n\n            /* -107 .. 107 */\n            cf2_stack_pushInt( opStack, v );\n          }\n\n          else if ( /* op1 >= 247 && */ op1 <= 250 )\n          {\n            CF2_Int  v;\n\n\n            v  = op1;\n            v -= 247;\n            v *= 256;\n            v += cf2_buf_readByte( charstring );\n            v += 108;\n\n            FT_TRACE4(( \" %d\", v ));\n\n            /* 108 .. 1131 */\n            cf2_stack_pushInt( opStack, v );\n          }\n\n          else if ( /* op1 >= 251 && */ op1 <= 254 )\n          {\n            CF2_Int  v;\n\n\n            v  = op1;\n            v -= 251;\n            v *= 256;\n            v += cf2_buf_readByte( charstring );\n            v  = -v - 108;\n\n            FT_TRACE4(( \" %d\", v ));\n\n            /* -1131 .. -108 */\n            cf2_stack_pushInt( opStack, v );\n          }\n\n          else /* op1 == 255 */\n          {\n            CF2_Fixed  v;\n\n\n            v = (CF2_Fixed)\n                  ( ( (FT_UInt32)cf2_buf_readByte( charstring ) << 24 ) |\n                    ( (FT_UInt32)cf2_buf_readByte( charstring ) << 16 ) |\n                    ( (FT_UInt32)cf2_buf_readByte( charstring ) <<  8 ) |\n                      (FT_UInt32)cf2_buf_readByte( charstring )         );\n\n            FT_TRACE4(( \" %.2f\", v / 65536.0 ));\n\n            cf2_stack_pushFixed( opStack, v );\n          }\n        }\n        continue;   /* don't clear stack */\n\n      } /* end of switch statement checking `op1' */\n\n      cf2_stack_clear( opStack );\n\n    } /* end of main interpreter loop */\n\n    /* we get here if the charstring ends without cf2_cmdENDCHAR */\n    FT_TRACE4(( \"cf2_interpT2CharString:\"\n                \"  charstring ends without ENDCHAR\\n\" ));\n\n  exit:\n    /* check whether last error seen is also the first one */\n    cf2_setError( error, lastError );\n\n    /* free resources from objects we've used */\n    cf2_glyphpath_finalize( &glyphPath );\n    cf2_arrstack_finalize( &vStemHintArray );\n    cf2_arrstack_finalize( &hStemHintArray );\n    cf2_arrstack_finalize( &subrStack );\n    cf2_stack_free( opStack );\n\n    FT_TRACE4(( \"\\n\" ));\n\n    return;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cf2intrp.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cf2font.h                                                              */\n/*                                                                         */\n/*    Adobe's CFF Interpreter (specification).                             */\n/*                                                                         */\n/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */\n/*                                                                         */\n/*  This software, and all works of authorship, whether in source or       */\n/*  object code form as indicated by the copyright notice(s) included      */\n/*  herein (collectively, the \"Work\") is made available, and may only be   */\n/*  used, modified, and distributed under the FreeType Project License,    */\n/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */\n/*  FreeType Project License, each contributor to the Work hereby grants   */\n/*  to any individual or legal entity exercising permissions granted by    */\n/*  the FreeType Project License and this section (hereafter, \"You\" or     */\n/*  \"Your\") a perpetual, worldwide, non-exclusive, no-charge,              */\n/*  royalty-free, irrevocable (except as stated in this section) patent    */\n/*  license to make, have made, use, offer to sell, sell, import, and      */\n/*  otherwise transfer the Work, where such license applies only to those  */\n/*  patent claims licensable by such contributor that are necessarily      */\n/*  infringed by their contribution(s) alone or by combination of their    */\n/*  contribution(s) with the Work to which such contribution(s) was        */\n/*  submitted.  If You institute patent litigation against any entity      */\n/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */\n/*  the Work or a contribution incorporated within the Work constitutes    */\n/*  direct or contributory patent infringement, then any patent licenses   */\n/*  granted to You under this License for that Work shall terminate as of  */\n/*  the date such litigation is filed.                                     */\n/*                                                                         */\n/*  By using, modifying, or distributing the Work you indicate that you    */\n/*  have read and understood the terms and conditions of the               */\n/*  FreeType Project License as well as those provided in this section,    */\n/*  and you accept them fully.                                             */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CF2INTRP_H__\n#define __CF2INTRP_H__\n\n\n#include \"cf2ft.h\"\n#include \"cf2hints.h\"\n\n\nFT_BEGIN_HEADER\n\n\n  FT_LOCAL( void )\n  cf2_hintmask_init( CF2_HintMask  hintmask,\n                     FT_Error*     error );\n  FT_LOCAL( FT_Bool )\n  cf2_hintmask_isValid( const CF2_HintMask  hintmask );\n  FT_LOCAL( FT_Bool )\n  cf2_hintmask_isNew( const CF2_HintMask  hintmask );\n  FT_LOCAL( void )\n  cf2_hintmask_setNew( CF2_HintMask  hintmask,\n                       FT_Bool       val );\n  FT_LOCAL( FT_Byte* )\n  cf2_hintmask_getMaskPtr( CF2_HintMask  hintmask );\n  FT_LOCAL( void )\n  cf2_hintmask_setAll( CF2_HintMask  hintmask,\n                       size_t        bitCount );\n\n  FT_LOCAL( void )\n  cf2_interpT2CharString( CF2_Font              font,\n                          CF2_Buffer            charstring,\n                          CF2_OutlineCallbacks  callbacks,\n                          const FT_Vector*      translation,\n                          FT_Bool               doingSeac,\n                          CF2_Fixed             curX,\n                          CF2_Fixed             curY,\n                          CF2_Fixed*            width );\n\n\nFT_END_HEADER\n\n\n#endif /* __CF2INTRP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cf2read.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cf2read.c                                                              */\n/*                                                                         */\n/*    Adobe's code for stream handling (body).                             */\n/*                                                                         */\n/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */\n/*                                                                         */\n/*  This software, and all works of authorship, whether in source or       */\n/*  object code form as indicated by the copyright notice(s) included      */\n/*  herein (collectively, the \"Work\") is made available, and may only be   */\n/*  used, modified, and distributed under the FreeType Project License,    */\n/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */\n/*  FreeType Project License, each contributor to the Work hereby grants   */\n/*  to any individual or legal entity exercising permissions granted by    */\n/*  the FreeType Project License and this section (hereafter, \"You\" or     */\n/*  \"Your\") a perpetual, worldwide, non-exclusive, no-charge,              */\n/*  royalty-free, irrevocable (except as stated in this section) patent    */\n/*  license to make, have made, use, offer to sell, sell, import, and      */\n/*  otherwise transfer the Work, where such license applies only to those  */\n/*  patent claims licensable by such contributor that are necessarily      */\n/*  infringed by their contribution(s) alone or by combination of their    */\n/*  contribution(s) with the Work to which such contribution(s) was        */\n/*  submitted.  If You institute patent litigation against any entity      */\n/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */\n/*  the Work or a contribution incorporated within the Work constitutes    */\n/*  direct or contributory patent infringement, then any patent licenses   */\n/*  granted to You under this License for that Work shall terminate as of  */\n/*  the date such litigation is filed.                                     */\n/*                                                                         */\n/*  By using, modifying, or distributing the Work you indicate that you    */\n/*  have read and understood the terms and conditions of the               */\n/*  FreeType Project License as well as those provided in this section,    */\n/*  and you accept them fully.                                             */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"cf2ft.h\"\n#include FT_INTERNAL_DEBUG_H\n\n#include \"cf2glue.h\"\n\n#include \"cf2error.h\"\n\n\n  /* Define CF2_IO_FAIL as 1 to enable random errors and random */\n  /* value errors in I/O.                                       */\n#define CF2_IO_FAIL  0\n\n\n#if CF2_IO_FAIL\n\n  /* set the .00 value to a nonzero probability */\n  static int\n  randomError2( void )\n  {\n    /* for region buffer ReadByte (interp) function */\n    return (double)rand() / RAND_MAX < .00;\n  }\n\n  /* set the .00 value to a nonzero probability */\n  static CF2_Int\n  randomValue()\n  {\n    return (double)rand() / RAND_MAX < .00 ? rand() : 0;\n  }\n\n#endif /* CF2_IO_FAIL */\n\n\n  /* Region Buffer                                      */\n  /*                                                    */\n  /* Can be constructed from a copied buffer managed by */\n  /* `FCM_getDatablock'.                                */\n  /* Reads bytes with check for end of buffer.          */\n\n  /* reading past the end of the buffer sets error and returns zero */\n  FT_LOCAL_DEF( CF2_Int )\n  cf2_buf_readByte( CF2_Buffer  buf )\n  {\n    if ( buf->ptr < buf->end )\n    {\n#if CF2_IO_FAIL\n      if ( randomError2() )\n      {\n        CF2_SET_ERROR( buf->error, Invalid_Stream_Operation );\n        return 0;\n      }\n\n      return *(buf->ptr)++ + randomValue();\n#else\n      return *(buf->ptr)++;\n#endif\n    }\n    else\n    {\n      CF2_SET_ERROR( buf->error, Invalid_Stream_Operation );\n      return 0;\n    }\n  }\n\n\n  /* note: end condition can occur without error */\n  FT_LOCAL_DEF( FT_Bool )\n  cf2_buf_isEnd( CF2_Buffer  buf )\n  {\n    return (FT_Bool)( buf->ptr >= buf->end );\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cf2read.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cf2read.h                                                              */\n/*                                                                         */\n/*    Adobe's code for stream handling (specification).                    */\n/*                                                                         */\n/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */\n/*                                                                         */\n/*  This software, and all works of authorship, whether in source or       */\n/*  object code form as indicated by the copyright notice(s) included      */\n/*  herein (collectively, the \"Work\") is made available, and may only be   */\n/*  used, modified, and distributed under the FreeType Project License,    */\n/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */\n/*  FreeType Project License, each contributor to the Work hereby grants   */\n/*  to any individual or legal entity exercising permissions granted by    */\n/*  the FreeType Project License and this section (hereafter, \"You\" or     */\n/*  \"Your\") a perpetual, worldwide, non-exclusive, no-charge,              */\n/*  royalty-free, irrevocable (except as stated in this section) patent    */\n/*  license to make, have made, use, offer to sell, sell, import, and      */\n/*  otherwise transfer the Work, where such license applies only to those  */\n/*  patent claims licensable by such contributor that are necessarily      */\n/*  infringed by their contribution(s) alone or by combination of their    */\n/*  contribution(s) with the Work to which such contribution(s) was        */\n/*  submitted.  If You institute patent litigation against any entity      */\n/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */\n/*  the Work or a contribution incorporated within the Work constitutes    */\n/*  direct or contributory patent infringement, then any patent licenses   */\n/*  granted to You under this License for that Work shall terminate as of  */\n/*  the date such litigation is filed.                                     */\n/*                                                                         */\n/*  By using, modifying, or distributing the Work you indicate that you    */\n/*  have read and understood the terms and conditions of the               */\n/*  FreeType Project License as well as those provided in this section,    */\n/*  and you accept them fully.                                             */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CF2READ_H__\n#define __CF2READ_H__\n\n\nFT_BEGIN_HEADER\n\n\n  typedef struct  CF2_BufferRec_\n  {\n    FT_Error*       error;\n    const FT_Byte*  start;\n    const FT_Byte*  end;\n    const FT_Byte*  ptr;\n\n  } CF2_BufferRec, *CF2_Buffer;\n\n\n  FT_LOCAL( CF2_Int )\n  cf2_buf_readByte( CF2_Buffer  buf );\n  FT_LOCAL( FT_Bool )\n  cf2_buf_isEnd( CF2_Buffer  buf );\n\n\nFT_END_HEADER\n\n\n#endif /* __CF2READ_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cf2stack.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cf2stack.c                                                             */\n/*                                                                         */\n/*    Adobe's code for emulating a CFF stack (body).                       */\n/*                                                                         */\n/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */\n/*                                                                         */\n/*  This software, and all works of authorship, whether in source or       */\n/*  object code form as indicated by the copyright notice(s) included      */\n/*  herein (collectively, the \"Work\") is made available, and may only be   */\n/*  used, modified, and distributed under the FreeType Project License,    */\n/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */\n/*  FreeType Project License, each contributor to the Work hereby grants   */\n/*  to any individual or legal entity exercising permissions granted by    */\n/*  the FreeType Project License and this section (hereafter, \"You\" or     */\n/*  \"Your\") a perpetual, worldwide, non-exclusive, no-charge,              */\n/*  royalty-free, irrevocable (except as stated in this section) patent    */\n/*  license to make, have made, use, offer to sell, sell, import, and      */\n/*  otherwise transfer the Work, where such license applies only to those  */\n/*  patent claims licensable by such contributor that are necessarily      */\n/*  infringed by their contribution(s) alone or by combination of their    */\n/*  contribution(s) with the Work to which such contribution(s) was        */\n/*  submitted.  If You institute patent litigation against any entity      */\n/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */\n/*  the Work or a contribution incorporated within the Work constitutes    */\n/*  direct or contributory patent infringement, then any patent licenses   */\n/*  granted to You under this License for that Work shall terminate as of  */\n/*  the date such litigation is filed.                                     */\n/*                                                                         */\n/*  By using, modifying, or distributing the Work you indicate that you    */\n/*  have read and understood the terms and conditions of the               */\n/*  FreeType Project License as well as those provided in this section,    */\n/*  and you accept them fully.                                             */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"cf2ft.h\"\n#include FT_INTERNAL_DEBUG_H\n\n#include \"cf2glue.h\"\n#include \"cf2font.h\"\n#include \"cf2stack.h\"\n\n#include \"cf2error.h\"\n\n\n  /* Allocate and initialize an instance of CF2_Stack.       */\n  /* Note: This function returns NULL on error (does not set */\n  /* `error').                                               */\n  FT_LOCAL_DEF( CF2_Stack )\n  cf2_stack_init( FT_Memory  memory,\n                  FT_Error*  e )\n  {\n    FT_Error  error = FT_Err_Ok;     /* for FT_QNEW */\n\n    CF2_Stack  stack = NULL;\n\n\n    if ( !FT_QNEW( stack ) )\n    {\n      /* initialize the structure; FT_QNEW zeroes it */\n      stack->memory = memory;\n      stack->error  = e;\n      stack->top    = &stack->buffer[0]; /* empty stack */\n    }\n\n    return stack;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cf2_stack_free( CF2_Stack  stack )\n  {\n    if ( stack )\n    {\n      FT_Memory  memory = stack->memory;\n\n\n      /* free the main structure */\n      FT_FREE( stack );\n    }\n  }\n\n\n  FT_LOCAL_DEF( CF2_UInt )\n  cf2_stack_count( CF2_Stack  stack )\n  {\n    return (CF2_UInt)( stack->top - &stack->buffer[0] );\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cf2_stack_pushInt( CF2_Stack  stack,\n                     CF2_Int    val )\n  {\n    if ( stack->top == &stack->buffer[CF2_OPERAND_STACK_SIZE] )\n    {\n      CF2_SET_ERROR( stack->error, Stack_Overflow );\n      return;     /* stack overflow */\n    }\n\n    stack->top->u.i  = val;\n    stack->top->type = CF2_NumberInt;\n    ++stack->top;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cf2_stack_pushFixed( CF2_Stack  stack,\n                       CF2_Fixed  val )\n  {\n    if ( stack->top == &stack->buffer[CF2_OPERAND_STACK_SIZE] )\n    {\n      CF2_SET_ERROR( stack->error, Stack_Overflow );\n      return;     /* stack overflow */\n    }\n\n    stack->top->u.r  = val;\n    stack->top->type = CF2_NumberFixed;\n    ++stack->top;\n  }\n\n\n  /* this function is only allowed to pop an integer type */\n  FT_LOCAL_DEF( CF2_Int )\n  cf2_stack_popInt( CF2_Stack  stack )\n  {\n    if ( stack->top == &stack->buffer[0] )\n    {\n      CF2_SET_ERROR( stack->error, Stack_Underflow );\n      return 0;   /* underflow */\n    }\n    if ( stack->top[-1].type != CF2_NumberInt )\n    {\n      CF2_SET_ERROR( stack->error, Syntax_Error );\n      return 0;   /* type mismatch */\n    }\n\n    --stack->top;\n\n    return stack->top->u.i;\n  }\n\n\n  /* Note: type mismatch is silently cast */\n  /* TODO: check this */\n  FT_LOCAL_DEF( CF2_Fixed )\n  cf2_stack_popFixed( CF2_Stack  stack )\n  {\n    if ( stack->top == &stack->buffer[0] )\n    {\n      CF2_SET_ERROR( stack->error, Stack_Underflow );\n      return cf2_intToFixed( 0 );    /* underflow */\n    }\n\n    --stack->top;\n\n    switch ( stack->top->type )\n    {\n    case CF2_NumberInt:\n      return cf2_intToFixed( stack->top->u.i );\n    case CF2_NumberFrac:\n      return cf2_fracToFixed( stack->top->u.f );\n    default:\n      return stack->top->u.r;\n    }\n  }\n\n\n  /* Note: type mismatch is silently cast */\n  /* TODO: check this */\n  FT_LOCAL_DEF( CF2_Fixed )\n  cf2_stack_getReal( CF2_Stack  stack,\n                     CF2_UInt   idx )\n  {\n    FT_ASSERT( cf2_stack_count( stack ) <= CF2_OPERAND_STACK_SIZE );\n\n    if ( idx >= cf2_stack_count( stack ) )\n    {\n      CF2_SET_ERROR( stack->error, Stack_Overflow );\n      return cf2_intToFixed( 0 );    /* bounds error */\n    }\n\n    switch ( stack->buffer[idx].type )\n    {\n    case CF2_NumberInt:\n      return cf2_intToFixed( stack->buffer[idx].u.i );\n    case CF2_NumberFrac:\n      return cf2_fracToFixed( stack->buffer[idx].u.f );\n    default:\n      return stack->buffer[idx].u.r;\n    }\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cf2_stack_clear( CF2_Stack  stack )\n  {\n    stack->top = &stack->buffer[0];\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cf2stack.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cf2stack.h                                                             */\n/*                                                                         */\n/*    Adobe's code for emulating a CFF stack (specification).              */\n/*                                                                         */\n/*  Copyright 2007-2013 Adobe Systems Incorporated.                        */\n/*                                                                         */\n/*  This software, and all works of authorship, whether in source or       */\n/*  object code form as indicated by the copyright notice(s) included      */\n/*  herein (collectively, the \"Work\") is made available, and may only be   */\n/*  used, modified, and distributed under the FreeType Project License,    */\n/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */\n/*  FreeType Project License, each contributor to the Work hereby grants   */\n/*  to any individual or legal entity exercising permissions granted by    */\n/*  the FreeType Project License and this section (hereafter, \"You\" or     */\n/*  \"Your\") a perpetual, worldwide, non-exclusive, no-charge,              */\n/*  royalty-free, irrevocable (except as stated in this section) patent    */\n/*  license to make, have made, use, offer to sell, sell, import, and      */\n/*  otherwise transfer the Work, where such license applies only to those  */\n/*  patent claims licensable by such contributor that are necessarily      */\n/*  infringed by their contribution(s) alone or by combination of their    */\n/*  contribution(s) with the Work to which such contribution(s) was        */\n/*  submitted.  If You institute patent litigation against any entity      */\n/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */\n/*  the Work or a contribution incorporated within the Work constitutes    */\n/*  direct or contributory patent infringement, then any patent licenses   */\n/*  granted to You under this License for that Work shall terminate as of  */\n/*  the date such litigation is filed.                                     */\n/*                                                                         */\n/*  By using, modifying, or distributing the Work you indicate that you    */\n/*  have read and understood the terms and conditions of the               */\n/*  FreeType Project License as well as those provided in this section,    */\n/*  and you accept them fully.                                             */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CF2STACK_H__\n#define __CF2STACK_H__\n\n\nFT_BEGIN_HEADER\n\n\n  /* CFF operand stack; specified maximum of 48 or 192 values */\n  typedef struct  CF2_StackNumber_\n  {\n    union\n    {\n      CF2_Fixed  r;      /* 16.16 fixed point */\n      CF2_Frac   f;      /* 2.30 fixed point (for font matrix) */\n      CF2_Int    i;\n    } u;\n\n    CF2_NumberType  type;\n\n  } CF2_StackNumber;\n\n\n  typedef struct  CF2_StackRec_\n  {\n    FT_Memory         memory;\n    FT_Error*         error;\n    CF2_StackNumber   buffer[CF2_OPERAND_STACK_SIZE];\n    CF2_StackNumber*  top;\n\n  } CF2_StackRec, *CF2_Stack;\n\n\n  FT_LOCAL( CF2_Stack )\n  cf2_stack_init( FT_Memory  memory,\n                  FT_Error*  error );\n  FT_LOCAL( void )\n  cf2_stack_free( CF2_Stack  stack );\n\n  FT_LOCAL( CF2_UInt )\n  cf2_stack_count( CF2_Stack  stack );\n\n  FT_LOCAL( void )\n  cf2_stack_pushInt( CF2_Stack  stack,\n                     CF2_Int    val );\n  FT_LOCAL( void )\n  cf2_stack_pushFixed( CF2_Stack  stack,\n                       CF2_Fixed  val );\n\n  FT_LOCAL( CF2_Int )\n  cf2_stack_popInt( CF2_Stack  stack );\n  FT_LOCAL( CF2_Fixed )\n  cf2_stack_popFixed( CF2_Stack  stack );\n\n  FT_LOCAL( CF2_Fixed )\n  cf2_stack_getReal( CF2_Stack  stack,\n                     CF2_UInt   idx );\n\n  FT_LOCAL( void )\n  cf2_stack_clear( CF2_Stack  stack );\n\n\nFT_END_HEADER\n\n\n#endif /* __CF2STACK_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cf2types.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cf2types.h                                                             */\n/*                                                                         */\n/*    Adobe's code for defining data types (specification only).           */\n/*                                                                         */\n/*  Copyright 2011-2013 Adobe Systems Incorporated.                        */\n/*                                                                         */\n/*  This software, and all works of authorship, whether in source or       */\n/*  object code form as indicated by the copyright notice(s) included      */\n/*  herein (collectively, the \"Work\") is made available, and may only be   */\n/*  used, modified, and distributed under the FreeType Project License,    */\n/*  LICENSE.TXT.  Additionally, subject to the terms and conditions of the */\n/*  FreeType Project License, each contributor to the Work hereby grants   */\n/*  to any individual or legal entity exercising permissions granted by    */\n/*  the FreeType Project License and this section (hereafter, \"You\" or     */\n/*  \"Your\") a perpetual, worldwide, non-exclusive, no-charge,              */\n/*  royalty-free, irrevocable (except as stated in this section) patent    */\n/*  license to make, have made, use, offer to sell, sell, import, and      */\n/*  otherwise transfer the Work, where such license applies only to those  */\n/*  patent claims licensable by such contributor that are necessarily      */\n/*  infringed by their contribution(s) alone or by combination of their    */\n/*  contribution(s) with the Work to which such contribution(s) was        */\n/*  submitted.  If You institute patent litigation against any entity      */\n/*  (including a cross-claim or counterclaim in a lawsuit) alleging that   */\n/*  the Work or a contribution incorporated within the Work constitutes    */\n/*  direct or contributory patent infringement, then any patent licenses   */\n/*  granted to You under this License for that Work shall terminate as of  */\n/*  the date such litigation is filed.                                     */\n/*                                                                         */\n/*  By using, modifying, or distributing the Work you indicate that you    */\n/*  have read and understood the terms and conditions of the               */\n/*  FreeType Project License as well as those provided in this section,    */\n/*  and you accept them fully.                                             */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CF2TYPES_H__\n#define __CF2TYPES_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*\n   * The data models that we expect to support are as follows:\n   *\n   *   name  char short int long long-long pointer example\n   *  -----------------------------------------------------\n   *   ILP32  8    16    32  32     64*      32    32-bit MacOS, x86\n   *   LLP64  8    16    32  32     64       64    x64\n   *   LP64   8    16    32  64     64       64    64-bit MacOS\n   *\n   *    *) type may be supported by emulation on a 32-bit architecture\n   *\n   */\n\n\n  /* integers at least 32 bits wide */\n#define CF2_UInt  FT_UFast\n#define CF2_Int   FT_Fast\n\n\n  /* fixed-float numbers */\n  typedef FT_Int32  CF2_F16Dot16;\n\n\nFT_END_HEADER\n\n\n#endif /* __CF2TYPES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cff.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cff.c                                                                  */\n/*                                                                         */\n/*    FreeType OpenType driver component (body only).                      */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#define FT_MAKE_OPTION_SINGLE_OBJECT\n\n#include <ft2build.h>\n\n#include \"cffpic.c\"\n#include \"cffdrivr.c\"\n#include \"cffparse.c\"\n#include \"cffload.c\"\n#include \"cffobjs.c\"\n#include \"cffgload.c\"\n#include \"cffcmap.c\"\n\n#include \"cf2arrst.c\"\n#include \"cf2blues.c\"\n#include \"cf2error.c\"\n#include \"cf2font.c\"\n#include \"cf2ft.c\"\n#include \"cf2hints.c\"\n#include \"cf2intrp.c\"\n#include \"cf2read.c\"\n#include \"cf2stack.c\"\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cffcmap.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cffcmap.c                                                              */\n/*                                                                         */\n/*    CFF character mapping table (cmap) support (body).                   */\n/*                                                                         */\n/*  Copyright 2002-2007, 2010, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include \"cffcmap.h\"\n#include \"cffload.h\"\n\n#include \"cfferrs.h\"\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****           CFF STANDARD (AND EXPERT) ENCODING CMAPS            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_CALLBACK_DEF( FT_Error )\n  cff_cmap_encoding_init( CFF_CMapStd  cmap,\n                          FT_Pointer   pointer )\n  {\n    TT_Face       face     = (TT_Face)FT_CMAP_FACE( cmap );\n    CFF_Font      cff      = (CFF_Font)face->extra.data;\n    CFF_Encoding  encoding = &cff->encoding;\n\n    FT_UNUSED( pointer );\n\n\n    cmap->gids  = encoding->codes;\n\n    return 0;\n  }\n\n\n  FT_CALLBACK_DEF( void )\n  cff_cmap_encoding_done( CFF_CMapStd  cmap )\n  {\n    cmap->gids  = NULL;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt )\n  cff_cmap_encoding_char_index( CFF_CMapStd  cmap,\n                                FT_UInt32    char_code )\n  {\n    FT_UInt  result = 0;\n\n\n    if ( char_code < 256 )\n      result = cmap->gids[char_code];\n\n    return result;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt32 )\n  cff_cmap_encoding_char_next( CFF_CMapStd   cmap,\n                               FT_UInt32    *pchar_code )\n  {\n    FT_UInt    result    = 0;\n    FT_UInt32  char_code = *pchar_code;\n\n\n    *pchar_code = 0;\n\n    if ( char_code < 255 )\n    {\n      FT_UInt  code = (FT_UInt)(char_code + 1);\n\n\n      for (;;)\n      {\n        if ( code >= 256 )\n          break;\n\n        result = cmap->gids[code];\n        if ( result != 0 )\n        {\n          *pchar_code = code;\n          break;\n        }\n\n        code++;\n      }\n    }\n    return result;\n  }\n\n\n  FT_DEFINE_CMAP_CLASS(cff_cmap_encoding_class_rec,\n    sizeof ( CFF_CMapStdRec ),\n\n    (FT_CMap_InitFunc)     cff_cmap_encoding_init,\n    (FT_CMap_DoneFunc)     cff_cmap_encoding_done,\n    (FT_CMap_CharIndexFunc)cff_cmap_encoding_char_index,\n    (FT_CMap_CharNextFunc) cff_cmap_encoding_char_next,\n\n    NULL, NULL, NULL, NULL, NULL\n  )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****              CFF SYNTHETIC UNICODE ENCODING CMAP              *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_CALLBACK_DEF( const char* )\n  cff_sid_to_glyph_name( TT_Face  face,\n                         FT_UInt  idx )\n  {\n    CFF_Font     cff     = (CFF_Font)face->extra.data;\n    CFF_Charset  charset = &cff->charset;\n    FT_UInt      sid     = charset->sids[idx];\n\n\n    return cff_index_get_sid_string( cff, sid );\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  cff_cmap_unicode_init( PS_Unicodes  unicodes,\n                         FT_Pointer   pointer )\n  {\n    TT_Face             face    = (TT_Face)FT_CMAP_FACE( unicodes );\n    FT_Memory           memory  = FT_FACE_MEMORY( face );\n    CFF_Font            cff     = (CFF_Font)face->extra.data;\n    CFF_Charset         charset = &cff->charset;\n    FT_Service_PsCMaps  psnames = (FT_Service_PsCMaps)cff->psnames;\n\n    FT_UNUSED( pointer );\n\n\n    /* can't build Unicode map for CID-keyed font */\n    /* because we don't know glyph names.         */\n    if ( !charset->sids )\n      return FT_THROW( No_Unicode_Glyph_Name );\n\n    return psnames->unicodes_init( memory,\n                                   unicodes,\n                                   cff->num_glyphs,\n                                   (PS_GetGlyphNameFunc)&cff_sid_to_glyph_name,\n                                   (PS_FreeGlyphNameFunc)NULL,\n                                   (FT_Pointer)face );\n  }\n\n\n  FT_CALLBACK_DEF( void )\n  cff_cmap_unicode_done( PS_Unicodes  unicodes )\n  {\n    FT_Face    face   = FT_CMAP_FACE( unicodes );\n    FT_Memory  memory = FT_FACE_MEMORY( face );\n\n\n    FT_FREE( unicodes->maps );\n    unicodes->num_maps = 0;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt )\n  cff_cmap_unicode_char_index( PS_Unicodes  unicodes,\n                               FT_UInt32    char_code )\n  {\n    TT_Face             face    = (TT_Face)FT_CMAP_FACE( unicodes );\n    CFF_Font            cff     = (CFF_Font)face->extra.data;\n    FT_Service_PsCMaps  psnames = (FT_Service_PsCMaps)cff->psnames;\n\n\n    return psnames->unicodes_char_index( unicodes, char_code );\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt32 )\n  cff_cmap_unicode_char_next( PS_Unicodes  unicodes,\n                              FT_UInt32   *pchar_code )\n  {\n    TT_Face             face    = (TT_Face)FT_CMAP_FACE( unicodes );\n    CFF_Font            cff     = (CFF_Font)face->extra.data;\n    FT_Service_PsCMaps  psnames = (FT_Service_PsCMaps)cff->psnames;\n\n\n    return psnames->unicodes_char_next( unicodes, pchar_code );\n  }\n\n\n  FT_DEFINE_CMAP_CLASS(cff_cmap_unicode_class_rec,\n    sizeof ( PS_UnicodesRec ),\n\n    (FT_CMap_InitFunc)     cff_cmap_unicode_init,\n    (FT_CMap_DoneFunc)     cff_cmap_unicode_done,\n    (FT_CMap_CharIndexFunc)cff_cmap_unicode_char_index,\n    (FT_CMap_CharNextFunc) cff_cmap_unicode_char_next,\n\n    NULL, NULL, NULL, NULL, NULL\n  )\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cffcmap.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cffcmap.h                                                              */\n/*                                                                         */\n/*    CFF character mapping table (cmap) support (specification).          */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2006 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CFFCMAP_H__\n#define __CFFCMAP_H__\n\n#include \"cffobjs.h\"\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****          TYPE1 STANDARD (AND EXPERT) ENCODING CMAPS           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* standard (and expert) encoding cmaps */\n  typedef struct CFF_CMapStdRec_*  CFF_CMapStd;\n\n  typedef struct  CFF_CMapStdRec_\n  {\n    FT_CMapRec  cmap;\n    FT_UShort*  gids;   /* up to 256 elements */\n\n  } CFF_CMapStdRec;\n\n\n  FT_DECLARE_CMAP_CLASS(cff_cmap_encoding_class_rec)\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****               CFF SYNTHETIC UNICODE ENCODING CMAP             *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* unicode (synthetic) cmaps */\n\n  FT_DECLARE_CMAP_CLASS(cff_cmap_unicode_class_rec)\n\n\nFT_END_HEADER\n\n#endif /* __CFFCMAP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cffdrivr.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cffdrivr.c                                                             */\n/*                                                                         */\n/*    OpenType font driver implementation (body).                          */\n/*                                                                         */\n/*  Copyright 1996-2014 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_SFNT_H\n#include FT_SERVICE_CID_H\n#include FT_SERVICE_POSTSCRIPT_INFO_H\n#include FT_SERVICE_POSTSCRIPT_NAME_H\n#include FT_SERVICE_TT_CMAP_H\n\n#include \"cffdrivr.h\"\n#include \"cffgload.h\"\n#include \"cffload.h\"\n#include \"cffcmap.h\"\n#include \"cffparse.h\"\n\n#include \"cfferrs.h\"\n#include \"cffpic.h\"\n\n#include FT_SERVICE_XFREE86_NAME_H\n#include FT_SERVICE_GLYPH_DICT_H\n#include FT_SERVICE_PROPERTIES_H\n#include FT_CFF_DRIVER_H\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_cffdriver\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                          F A C E S                              ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n#undef  PAIR_TAG\n#define PAIR_TAG( left, right )  ( ( (FT_ULong)left << 16 ) | \\\n                                     (FT_ULong)right        )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    cff_get_kerning                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A driver method used to return the kerning vector between two      */\n  /*    glyphs of the same face.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to the source face object.                 */\n  /*                                                                       */\n  /*    left_glyph  :: The index of the left glyph in the kern pair.       */\n  /*                                                                       */\n  /*    right_glyph :: The index of the right glyph in the kern pair.      */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    kerning     :: The kerning vector.  This is in font units for      */\n  /*                   scalable formats, and in pixels for fixed-sizes     */\n  /*                   formats.                                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Only horizontal layouts (left-to-right & right-to-left) are        */\n  /*    supported by this function.  Other layouts, or more sophisticated  */\n  /*    kernings, are out of scope of this method (the basic driver        */\n  /*    interface is meant to be simple).                                  */\n  /*                                                                       */\n  /*    They can be implemented by format-specific interfaces.             */\n  /*                                                                       */\n  FT_CALLBACK_DEF( FT_Error )\n  cff_get_kerning( FT_Face     ttface,          /* TT_Face */\n                   FT_UInt     left_glyph,\n                   FT_UInt     right_glyph,\n                   FT_Vector*  kerning )\n  {\n    TT_Face       face = (TT_Face)ttface;\n    SFNT_Service  sfnt = (SFNT_Service)face->sfnt;\n\n\n    kerning->x = 0;\n    kerning->y = 0;\n\n    if ( sfnt )\n      kerning->x = sfnt->get_kerning( face, left_glyph, right_glyph );\n\n    return FT_Err_Ok;\n  }\n\n\n#undef PAIR_TAG\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    cff_glyph_load                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A driver method used to load a glyph within a given glyph slot.    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    slot        :: A handle to the target slot object where the glyph  */\n  /*                   will be loaded.                                     */\n  /*                                                                       */\n  /*    size        :: A handle to the source face size at which the glyph */\n  /*                   must be scaled, loaded, etc.                        */\n  /*                                                                       */\n  /*    glyph_index :: The index of the glyph in the font file.            */\n  /*                                                                       */\n  /*    load_flags  :: A flag indicating what to load for this glyph.  The */\n  /*                   FT_LOAD_??? constants can be used to control the    */\n  /*                   glyph loading process (e.g., whether the outline    */\n  /*                   should be scaled, whether to load bitmaps or not,   */\n  /*                   whether to hint the outline, etc).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_CALLBACK_DEF( FT_Error )\n  cff_glyph_load( FT_GlyphSlot  cffslot,      /* CFF_GlyphSlot */\n                  FT_Size       cffsize,      /* CFF_Size      */\n                  FT_UInt       glyph_index,\n                  FT_Int32      load_flags )\n  {\n    FT_Error       error;\n    CFF_GlyphSlot  slot = (CFF_GlyphSlot)cffslot;\n    CFF_Size       size = (CFF_Size)cffsize;\n\n\n    if ( !slot )\n      return FT_THROW( Invalid_Slot_Handle );\n\n    FT_TRACE1(( \"cff_glyph_load: glyph index %d\\n\", glyph_index ));\n\n    /* check whether we want a scaled outline or bitmap */\n    if ( !size )\n      load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;\n\n    /* reset the size object if necessary */\n    if ( load_flags & FT_LOAD_NO_SCALE )\n      size = NULL;\n\n    if ( size )\n    {\n      /* these two objects must have the same parent */\n      if ( cffsize->face != cffslot->face )\n        return FT_THROW( Invalid_Face_Handle );\n    }\n\n    /* now load the glyph outline if necessary */\n    error = cff_slot_load( slot, size, glyph_index, load_flags );\n\n    /* force drop-out mode to 2 - irrelevant now */\n    /* slot->outline.dropout_mode = 2; */\n\n    return error;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  cff_get_advances( FT_Face    face,\n                    FT_UInt    start,\n                    FT_UInt    count,\n                    FT_Int32   flags,\n                    FT_Fixed*  advances )\n  {\n    FT_UInt       nn;\n    FT_Error      error = FT_Err_Ok;\n    FT_GlyphSlot  slot  = face->glyph;\n\n\n    flags |= (FT_UInt32)FT_LOAD_ADVANCE_ONLY;\n\n    for ( nn = 0; nn < count; nn++ )\n    {\n      error = cff_glyph_load( slot, face->size, start + nn, flags );\n      if ( error )\n        break;\n\n      advances[nn] = ( flags & FT_LOAD_VERTICAL_LAYOUT )\n                     ? slot->linearVertAdvance\n                     : slot->linearHoriAdvance;\n    }\n\n    return error;\n  }\n\n\n  /*\n   *  GLYPH DICT SERVICE\n   *\n   */\n\n  static FT_Error\n  cff_get_glyph_name( CFF_Face    face,\n                      FT_UInt     glyph_index,\n                      FT_Pointer  buffer,\n                      FT_UInt     buffer_max )\n  {\n    CFF_Font    font   = (CFF_Font)face->extra.data;\n    FT_String*  gname;\n    FT_UShort   sid;\n    FT_Error    error;\n\n\n    if ( !font->psnames )\n    {\n      FT_ERROR(( \"cff_get_glyph_name:\"\n                 \" cannot get glyph name from CFF & CEF fonts\\n\"\n                 \"                   \"\n                 \" without the `PSNames' module\\n\" ));\n      error = FT_THROW( Missing_Module );\n      goto Exit;\n    }\n\n    /* first, locate the sid in the charset table */\n    sid = font->charset.sids[glyph_index];\n\n    /* now, lookup the name itself */\n    gname = cff_index_get_sid_string( font, sid );\n\n    if ( gname )\n      FT_STRCPYN( buffer, gname, buffer_max );\n\n    error = FT_Err_Ok;\n\n  Exit:\n    return error;\n  }\n\n\n  static FT_UInt\n  cff_get_name_index( CFF_Face    face,\n                      FT_String*  glyph_name )\n  {\n    CFF_Font            cff;\n    CFF_Charset         charset;\n    FT_Service_PsCMaps  psnames;\n    FT_String*          name;\n    FT_UShort           sid;\n    FT_UInt             i;\n\n\n    cff     = (CFF_FontRec *)face->extra.data;\n    charset = &cff->charset;\n\n    FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );\n    if ( !psnames )\n      return 0;\n\n    for ( i = 0; i < cff->num_glyphs; i++ )\n    {\n      sid = charset->sids[i];\n\n      if ( sid > 390 )\n        name = cff_index_get_string( cff, sid - 391 );\n      else\n        name = (FT_String *)psnames->adobe_std_strings( sid );\n\n      if ( !name )\n        continue;\n\n      if ( !ft_strcmp( glyph_name, name ) )\n        return i;\n    }\n\n    return 0;\n  }\n\n\n  FT_DEFINE_SERVICE_GLYPHDICTREC(\n    cff_service_glyph_dict,\n    (FT_GlyphDict_GetNameFunc)  cff_get_glyph_name,\n    (FT_GlyphDict_NameIndexFunc)cff_get_name_index\n  )\n\n\n  /*\n   *  POSTSCRIPT INFO SERVICE\n   *\n   */\n\n  static FT_Int\n  cff_ps_has_glyph_names( FT_Face  face )\n  {\n    return ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES ) > 0;\n  }\n\n\n  static FT_Error\n  cff_ps_get_font_info( CFF_Face         face,\n                        PS_FontInfoRec*  afont_info )\n  {\n    CFF_Font  cff   = (CFF_Font)face->extra.data;\n    FT_Error  error = FT_Err_Ok;\n\n\n    if ( cff && cff->font_info == NULL )\n    {\n      CFF_FontRecDict  dict   = &cff->top_font.font_dict;\n      PS_FontInfoRec  *font_info = NULL;\n      FT_Memory        memory = face->root.memory;\n\n\n      if ( FT_ALLOC( font_info, sizeof ( *font_info ) ) )\n        goto Fail;\n\n      font_info->version     = cff_index_get_sid_string( cff,\n                                                         dict->version );\n      font_info->notice      = cff_index_get_sid_string( cff,\n                                                         dict->notice );\n      font_info->full_name   = cff_index_get_sid_string( cff,\n                                                         dict->full_name );\n      font_info->family_name = cff_index_get_sid_string( cff,\n                                                         dict->family_name );\n      font_info->weight      = cff_index_get_sid_string( cff,\n                                                         dict->weight );\n      font_info->italic_angle        = dict->italic_angle;\n      font_info->is_fixed_pitch      = dict->is_fixed_pitch;\n      font_info->underline_position  = (FT_Short)dict->underline_position;\n      font_info->underline_thickness = (FT_Short)dict->underline_thickness;\n\n      cff->font_info = font_info;\n    }\n\n    if ( cff )\n      *afont_info = *cff->font_info;\n\n  Fail:\n    return error;\n  }\n\n\n  FT_DEFINE_SERVICE_PSINFOREC(\n    cff_service_ps_info,\n    (PS_GetFontInfoFunc)   cff_ps_get_font_info,\n    (PS_GetFontExtraFunc)  NULL,\n    (PS_HasGlyphNamesFunc) cff_ps_has_glyph_names,\n    (PS_GetFontPrivateFunc)NULL,        /* unsupported with CFF fonts */\n    (PS_GetFontValueFunc)  NULL         /* not implemented            */\n  )\n\n\n  /*\n   *  POSTSCRIPT NAME SERVICE\n   *\n   */\n\n  static const char*\n  cff_get_ps_name( CFF_Face  face )\n  {\n    CFF_Font  cff = (CFF_Font)face->extra.data;\n\n\n    return (const char*)cff->font_name;\n  }\n\n\n  FT_DEFINE_SERVICE_PSFONTNAMEREC(\n    cff_service_ps_name,\n    (FT_PsName_GetFunc)cff_get_ps_name\n  )\n\n\n  /*\n   * TT CMAP INFO\n   *\n   * If the charmap is a synthetic Unicode encoding cmap or\n   * a Type 1 standard (or expert) encoding cmap, hide TT CMAP INFO\n   * service defined in SFNT module.\n   *\n   * Otherwise call the service function in the sfnt module.\n   *\n   */\n  static FT_Error\n  cff_get_cmap_info( FT_CharMap    charmap,\n                     TT_CMapInfo  *cmap_info )\n  {\n    FT_CMap   cmap  = FT_CMAP( charmap );\n    FT_Error  error = FT_Err_Ok;\n\n    FT_Face     face    = FT_CMAP_FACE( cmap );\n    FT_Library  library = FT_FACE_LIBRARY( face );\n\n\n    cmap_info->language = 0;\n    cmap_info->format   = 0;\n\n    if ( cmap->clazz != &CFF_CMAP_ENCODING_CLASS_REC_GET &&\n         cmap->clazz != &CFF_CMAP_UNICODE_CLASS_REC_GET  )\n    {\n      FT_Module           sfnt    = FT_Get_Module( library, \"sfnt\" );\n      FT_Service_TTCMaps  service =\n        (FT_Service_TTCMaps)ft_module_get_service( sfnt,\n                                                   FT_SERVICE_ID_TT_CMAP );\n\n\n      if ( service && service->get_cmap_info )\n        error = service->get_cmap_info( charmap, cmap_info );\n    }\n\n    return error;\n  }\n\n\n  FT_DEFINE_SERVICE_TTCMAPSREC(\n    cff_service_get_cmap_info,\n    (TT_CMap_Info_GetFunc)cff_get_cmap_info\n  )\n\n\n  /*\n   *  CID INFO SERVICE\n   *\n   */\n  static FT_Error\n  cff_get_ros( CFF_Face      face,\n               const char*  *registry,\n               const char*  *ordering,\n               FT_Int       *supplement )\n  {\n    FT_Error  error = FT_Err_Ok;\n    CFF_Font  cff   = (CFF_Font)face->extra.data;\n\n\n    if ( cff )\n    {\n      CFF_FontRecDict  dict = &cff->top_font.font_dict;\n\n\n      if ( dict->cid_registry == 0xFFFFU )\n      {\n        error = FT_THROW( Invalid_Argument );\n        goto Fail;\n      }\n\n      if ( registry )\n      {\n        if ( cff->registry == NULL )\n          cff->registry = cff_index_get_sid_string( cff,\n                                                    dict->cid_registry );\n        *registry = cff->registry;\n      }\n\n      if ( ordering )\n      {\n        if ( cff->ordering == NULL )\n          cff->ordering = cff_index_get_sid_string( cff,\n                                                    dict->cid_ordering );\n        *ordering = cff->ordering;\n      }\n\n      /*\n       * XXX: According to Adobe TechNote #5176, the supplement in CFF\n       *      can be a real number. We truncate it to fit public API\n       *      since freetype-2.3.6.\n       */\n      if ( supplement )\n      {\n        if ( dict->cid_supplement < FT_INT_MIN ||\n             dict->cid_supplement > FT_INT_MAX )\n          FT_TRACE1(( \"cff_get_ros: too large supplement %d is truncated\\n\",\n                      dict->cid_supplement ));\n        *supplement = (FT_Int)dict->cid_supplement;\n      }\n    }\n\n  Fail:\n    return error;\n  }\n\n\n  static FT_Error\n  cff_get_is_cid( CFF_Face  face,\n                  FT_Bool  *is_cid )\n  {\n    FT_Error  error = FT_Err_Ok;\n    CFF_Font  cff   = (CFF_Font)face->extra.data;\n\n\n    *is_cid = 0;\n\n    if ( cff )\n    {\n      CFF_FontRecDict  dict = &cff->top_font.font_dict;\n\n\n      if ( dict->cid_registry != 0xFFFFU )\n        *is_cid = 1;\n    }\n\n    return error;\n  }\n\n\n  static FT_Error\n  cff_get_cid_from_glyph_index( CFF_Face  face,\n                                FT_UInt   glyph_index,\n                                FT_UInt  *cid )\n  {\n    FT_Error  error = FT_Err_Ok;\n    CFF_Font  cff;\n\n\n    cff = (CFF_Font)face->extra.data;\n\n    if ( cff )\n    {\n      FT_UInt          c;\n      CFF_FontRecDict  dict = &cff->top_font.font_dict;\n\n\n      if ( dict->cid_registry == 0xFFFFU )\n      {\n        error = FT_THROW( Invalid_Argument );\n        goto Fail;\n      }\n\n      if ( glyph_index > cff->num_glyphs )\n      {\n        error = FT_THROW( Invalid_Argument );\n        goto Fail;\n      }\n\n      c = cff->charset.sids[glyph_index];\n\n      if ( cid )\n        *cid = c;\n    }\n\n  Fail:\n    return error;\n  }\n\n\n  FT_DEFINE_SERVICE_CIDREC(\n    cff_service_cid_info,\n    (FT_CID_GetRegistryOrderingSupplementFunc)cff_get_ros,\n    (FT_CID_GetIsInternallyCIDKeyedFunc)      cff_get_is_cid,\n    (FT_CID_GetCIDFromGlyphIndexFunc)         cff_get_cid_from_glyph_index\n  )\n\n\n  /*\n   *  PROPERTY SERVICE\n   *\n   */\n  static FT_Error\n  cff_property_set( FT_Module    module,         /* CFF_Driver */\n                    const char*  property_name,\n                    const void*  value )\n  {\n    FT_Error    error  = FT_Err_Ok;\n    CFF_Driver  driver = (CFF_Driver)module;\n\n\n    if ( !ft_strcmp( property_name, \"darkening-parameters\" ) )\n    {\n      FT_Int*  darken_params = (FT_Int*)value;\n\n      FT_Int  x1 = darken_params[0];\n      FT_Int  y1 = darken_params[1];\n      FT_Int  x2 = darken_params[2];\n      FT_Int  y2 = darken_params[3];\n      FT_Int  x3 = darken_params[4];\n      FT_Int  y3 = darken_params[5];\n      FT_Int  x4 = darken_params[6];\n      FT_Int  y4 = darken_params[7];\n\n\n      if ( x1 < 0   || x2 < 0   || x3 < 0   || x4 < 0   ||\n           y1 < 0   || y2 < 0   || y3 < 0   || y4 < 0   ||\n           x1 > x2  || x2 > x3  || x3 > x4              ||\n           y1 > 500 || y2 > 500 || y3 > 500 || y4 > 500 )\n        return FT_THROW( Invalid_Argument );\n\n      driver->darken_params[0] = x1;\n      driver->darken_params[1] = y1;\n      driver->darken_params[2] = x2;\n      driver->darken_params[3] = y2;\n      driver->darken_params[4] = x3;\n      driver->darken_params[5] = y3;\n      driver->darken_params[6] = x4;\n      driver->darken_params[7] = y4;\n\n      return error;\n    }\n    else if ( !ft_strcmp( property_name, \"hinting-engine\" ) )\n    {\n      FT_UInt*  hinting_engine = (FT_UInt*)value;\n\n\n#ifndef CFF_CONFIG_OPTION_OLD_ENGINE\n      if ( *hinting_engine != FT_CFF_HINTING_ADOBE )\n        error = FT_ERR( Unimplemented_Feature );\n      else\n#endif\n        driver->hinting_engine = *hinting_engine;\n\n      return error;\n    }\n    else if ( !ft_strcmp( property_name, \"no-stem-darkening\" ) )\n    {\n      FT_Bool*  no_stem_darkening = (FT_Bool*)value;\n\n\n      driver->no_stem_darkening = *no_stem_darkening;\n\n      return error;\n    }\n\n    FT_TRACE0(( \"cff_property_set: missing property `%s'\\n\",\n                property_name ));\n    return FT_THROW( Missing_Property );\n  }\n\n\n  static FT_Error\n  cff_property_get( FT_Module    module,         /* CFF_Driver */\n                    const char*  property_name,\n                    const void*  value )\n  {\n    FT_Error    error  = FT_Err_Ok;\n    CFF_Driver  driver = (CFF_Driver)module;\n\n\n    if ( !ft_strcmp( property_name, \"darkening-parameters\" ) )\n    {\n      FT_Int*  darken_params = driver->darken_params;\n      FT_Int*  val           = (FT_Int*)value;\n\n\n      val[0] = darken_params[0];\n      val[1] = darken_params[1];\n      val[2] = darken_params[2];\n      val[3] = darken_params[3];\n      val[4] = darken_params[4];\n      val[5] = darken_params[5];\n      val[6] = darken_params[6];\n      val[7] = darken_params[7];\n\n      return error;\n    }\n    else if ( !ft_strcmp( property_name, \"hinting-engine\" ) )\n    {\n      FT_UInt   hinting_engine    = driver->hinting_engine;\n      FT_UInt*  val               = (FT_UInt*)value;\n\n\n      *val = hinting_engine;\n\n      return error;\n    }\n    else if ( !ft_strcmp( property_name, \"no-stem-darkening\" ) )\n    {\n      FT_Bool   no_stem_darkening = driver->no_stem_darkening;\n      FT_Bool*  val               = (FT_Bool*)value;\n\n\n      *val = no_stem_darkening;\n\n      return error;\n    }\n\n    FT_TRACE0(( \"cff_property_get: missing property `%s'\\n\",\n                property_name ));\n    return FT_THROW( Missing_Property );\n  }\n\n\n  FT_DEFINE_SERVICE_PROPERTIESREC(\n    cff_service_properties,\n    (FT_Properties_SetFunc)cff_property_set,\n    (FT_Properties_GetFunc)cff_property_get )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                D R I V E R  I N T E R F A C E                   ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES\n  FT_DEFINE_SERVICEDESCREC7(\n    cff_services,\n    FT_SERVICE_ID_XF86_NAME,            FT_XF86_FORMAT_CFF,\n    FT_SERVICE_ID_POSTSCRIPT_INFO,      &CFF_SERVICE_PS_INFO_GET,\n    FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &CFF_SERVICE_PS_NAME_GET,\n    FT_SERVICE_ID_GLYPH_DICT,           &CFF_SERVICE_GLYPH_DICT_GET,\n    FT_SERVICE_ID_TT_CMAP,              &CFF_SERVICE_GET_CMAP_INFO_GET,\n    FT_SERVICE_ID_CID,                  &CFF_SERVICE_CID_INFO_GET,\n    FT_SERVICE_ID_PROPERTIES,           &CFF_SERVICE_PROPERTIES_GET\n  )\n#else\n  FT_DEFINE_SERVICEDESCREC6(\n    cff_services,\n    FT_SERVICE_ID_XF86_NAME,            FT_XF86_FORMAT_CFF,\n    FT_SERVICE_ID_POSTSCRIPT_INFO,      &CFF_SERVICE_PS_INFO_GET,\n    FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &CFF_SERVICE_PS_NAME_GET,\n    FT_SERVICE_ID_TT_CMAP,              &CFF_SERVICE_GET_CMAP_INFO_GET,\n    FT_SERVICE_ID_CID,                  &CFF_SERVICE_CID_INFO_GET,\n    FT_SERVICE_ID_PROPERTIES,           &CFF_SERVICE_PROPERTIES_GET\n  )\n#endif\n\n\n  FT_CALLBACK_DEF( FT_Module_Interface )\n  cff_get_interface( FT_Module    driver,       /* CFF_Driver */\n                     const char*  module_interface )\n  {\n    FT_Library           library;\n    FT_Module            sfnt;\n    FT_Module_Interface  result;\n\n\n    /* CFF_SERVICES_GET dereferences `library' in PIC mode */\n#ifdef FT_CONFIG_OPTION_PIC\n    if ( !driver )\n      return NULL;\n    library = driver->library;\n    if ( !library )\n      return NULL;\n#endif\n\n    result = ft_service_list_lookup( CFF_SERVICES_GET, module_interface );\n    if ( result != NULL )\n      return result;\n\n    /* `driver' is not yet evaluated in non-PIC mode */\n#ifndef FT_CONFIG_OPTION_PIC\n    if ( !driver )\n      return NULL;\n    library = driver->library;\n    if ( !library )\n      return NULL;\n#endif\n\n    /* we pass our request to the `sfnt' module */\n    sfnt = FT_Get_Module( library, \"sfnt\" );\n\n    return sfnt ? sfnt->clazz->get_interface( sfnt, module_interface ) : 0;\n  }\n\n\n  /* The FT_DriverInterface structure is defined in ftdriver.h. */\n\n#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n#define CFF_SIZE_SELECT cff_size_select\n#else\n#define CFF_SIZE_SELECT 0\n#endif\n\n  FT_DEFINE_DRIVER(\n    cff_driver_class,\n\n      FT_MODULE_FONT_DRIVER       |\n      FT_MODULE_DRIVER_SCALABLE   |\n      FT_MODULE_DRIVER_HAS_HINTER,\n\n      sizeof ( CFF_DriverRec ),\n      \"cff\",\n      0x10000L,\n      0x20000L,\n\n      0,   /* module-specific interface */\n\n      cff_driver_init,\n      cff_driver_done,\n      cff_get_interface,\n\n    /* now the specific driver fields */\n    sizeof ( TT_FaceRec ),\n    sizeof ( CFF_SizeRec ),\n    sizeof ( CFF_GlyphSlotRec ),\n\n    cff_face_init,\n    cff_face_done,\n    cff_size_init,\n    cff_size_done,\n    cff_slot_init,\n    cff_slot_done,\n\n    cff_glyph_load,\n\n    cff_get_kerning,\n    0,                       /* FT_Face_AttachFunc */\n    cff_get_advances,\n\n    cff_size_request,\n\n    CFF_SIZE_SELECT\n  )\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cffdrivr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cffdrivr.h                                                             */\n/*                                                                         */\n/*    High-level OpenType driver interface (specification).                */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CFFDRIVER_H__\n#define __CFFDRIVER_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DRIVER_H\n\n\nFT_BEGIN_HEADER\n\n\n  FT_DECLARE_DRIVER( cff_driver_class )\n\n\nFT_END_HEADER\n\n#endif /* __CFFDRIVER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cfferrs.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cfferrs.h                                                              */\n/*                                                                         */\n/*    CFF error codes (specification only).                                */\n/*                                                                         */\n/*  Copyright 2001, 2012 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the CFF error enumeration constants.      */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __CFFERRS_H__\n#define __CFFERRS_H__\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  CFF_Err_\n#define FT_ERR_BASE    FT_Mod_Err_CFF\n\n\n#include FT_ERRORS_H\n\n#endif /* __CFFERRS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cffgload.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cffgload.c                                                             */\n/*                                                                         */\n/*    OpenType Glyph Loader (body).                                        */\n/*                                                                         */\n/*  Copyright 1996-2014 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_SFNT_H\n#include FT_OUTLINE_H\n#include FT_CFF_DRIVER_H\n\n#include \"cffobjs.h\"\n#include \"cffload.h\"\n#include \"cffgload.h\"\n#include \"cf2ft.h\"      /* for cf2_decoder_parse_charstrings */\n\n#include \"cfferrs.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_cffgload\n\n\n#ifdef CFF_CONFIG_OPTION_OLD_ENGINE\n\n  typedef enum  CFF_Operator_\n  {\n    cff_op_unknown = 0,\n\n    cff_op_rmoveto,\n    cff_op_hmoveto,\n    cff_op_vmoveto,\n\n    cff_op_rlineto,\n    cff_op_hlineto,\n    cff_op_vlineto,\n\n    cff_op_rrcurveto,\n    cff_op_hhcurveto,\n    cff_op_hvcurveto,\n    cff_op_rcurveline,\n    cff_op_rlinecurve,\n    cff_op_vhcurveto,\n    cff_op_vvcurveto,\n\n    cff_op_flex,\n    cff_op_hflex,\n    cff_op_hflex1,\n    cff_op_flex1,\n\n    cff_op_endchar,\n\n    cff_op_hstem,\n    cff_op_vstem,\n    cff_op_hstemhm,\n    cff_op_vstemhm,\n\n    cff_op_hintmask,\n    cff_op_cntrmask,\n    cff_op_dotsection,  /* deprecated, acts as no-op */\n\n    cff_op_abs,\n    cff_op_add,\n    cff_op_sub,\n    cff_op_div,\n    cff_op_neg,\n    cff_op_random,\n    cff_op_mul,\n    cff_op_sqrt,\n\n    cff_op_blend,\n\n    cff_op_drop,\n    cff_op_exch,\n    cff_op_index,\n    cff_op_roll,\n    cff_op_dup,\n\n    cff_op_put,\n    cff_op_get,\n    cff_op_store,\n    cff_op_load,\n\n    cff_op_and,\n    cff_op_or,\n    cff_op_not,\n    cff_op_eq,\n    cff_op_ifelse,\n\n    cff_op_callsubr,\n    cff_op_callgsubr,\n    cff_op_return,\n\n    /* Type 1 opcodes: invalid but seen in real life */\n    cff_op_hsbw,\n    cff_op_closepath,\n    cff_op_callothersubr,\n    cff_op_pop,\n    cff_op_seac,\n    cff_op_sbw,\n    cff_op_setcurrentpoint,\n\n    /* do not remove */\n    cff_op_max\n\n  } CFF_Operator;\n\n\n#define CFF_COUNT_CHECK_WIDTH  0x80\n#define CFF_COUNT_EXACT        0x40\n#define CFF_COUNT_CLEAR_STACK  0x20\n\n  /* count values which have the `CFF_COUNT_CHECK_WIDTH' flag set are  */\n  /* used for checking the width and requested numbers of arguments    */\n  /* only; they are set to zero afterwards                             */\n\n  /* the other two flags are informative only and unused currently     */\n\n  static const FT_Byte  cff_argument_counts[] =\n  {\n    0,  /* unknown */\n\n    2 | CFF_COUNT_CHECK_WIDTH | CFF_COUNT_EXACT, /* rmoveto */\n    1 | CFF_COUNT_CHECK_WIDTH | CFF_COUNT_EXACT,\n    1 | CFF_COUNT_CHECK_WIDTH | CFF_COUNT_EXACT,\n\n    0 | CFF_COUNT_CLEAR_STACK, /* rlineto */\n    0 | CFF_COUNT_CLEAR_STACK,\n    0 | CFF_COUNT_CLEAR_STACK,\n\n    0 | CFF_COUNT_CLEAR_STACK, /* rrcurveto */\n    0 | CFF_COUNT_CLEAR_STACK,\n    0 | CFF_COUNT_CLEAR_STACK,\n    0 | CFF_COUNT_CLEAR_STACK,\n    0 | CFF_COUNT_CLEAR_STACK,\n    0 | CFF_COUNT_CLEAR_STACK,\n    0 | CFF_COUNT_CLEAR_STACK,\n\n    13, /* flex */\n    7,\n    9,\n    11,\n\n    0 | CFF_COUNT_CHECK_WIDTH, /* endchar */\n\n    2 | CFF_COUNT_CHECK_WIDTH, /* hstem */\n    2 | CFF_COUNT_CHECK_WIDTH,\n    2 | CFF_COUNT_CHECK_WIDTH,\n    2 | CFF_COUNT_CHECK_WIDTH,\n\n    0 | CFF_COUNT_CHECK_WIDTH, /* hintmask */\n    0 | CFF_COUNT_CHECK_WIDTH, /* cntrmask */\n    0, /* dotsection */\n\n    1, /* abs */\n    2,\n    2,\n    2,\n    1,\n    0,\n    2,\n    1,\n\n    1, /* blend */\n\n    1, /* drop */\n    2,\n    1,\n    2,\n    1,\n\n    2, /* put */\n    1,\n    4,\n    3,\n\n    2, /* and */\n    2,\n    1,\n    2,\n    4,\n\n    1, /* callsubr */\n    1,\n    0,\n\n    2, /* hsbw */\n    0,\n    0,\n    0,\n    5, /* seac */\n    4, /* sbw */\n    2  /* setcurrentpoint */\n  };\n\n#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /**********                                                      *********/\n  /**********                                                      *********/\n  /**********             GENERIC CHARSTRING PARSING               *********/\n  /**********                                                      *********/\n  /**********                                                      *********/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    cff_builder_init                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initializes a given glyph builder.                                 */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    builder :: A pointer to the glyph builder to initialize.           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: The current face object.                                */\n  /*                                                                       */\n  /*    size    :: The current size object.                                */\n  /*                                                                       */\n  /*    glyph   :: The current glyph object.                               */\n  /*                                                                       */\n  /*    hinting :: Whether hinting is active.                              */\n  /*                                                                       */\n  static void\n  cff_builder_init( CFF_Builder*   builder,\n                    TT_Face        face,\n                    CFF_Size       size,\n                    CFF_GlyphSlot  glyph,\n                    FT_Bool        hinting )\n  {\n    builder->path_begun  = 0;\n    builder->load_points = 1;\n\n    builder->face   = face;\n    builder->glyph  = glyph;\n    builder->memory = face->root.memory;\n\n    if ( glyph )\n    {\n      FT_GlyphLoader  loader = glyph->root.internal->loader;\n\n\n      builder->loader  = loader;\n      builder->base    = &loader->base.outline;\n      builder->current = &loader->current.outline;\n      FT_GlyphLoader_Rewind( loader );\n\n      builder->hints_globals = 0;\n      builder->hints_funcs   = 0;\n\n      if ( hinting && size )\n      {\n        CFF_Internal  internal = (CFF_Internal)size->root.internal;\n\n\n        builder->hints_globals = (void *)internal->topfont;\n        builder->hints_funcs   = glyph->root.internal->glyph_hints;\n      }\n    }\n\n    builder->pos_x = 0;\n    builder->pos_y = 0;\n\n    builder->left_bearing.x = 0;\n    builder->left_bearing.y = 0;\n    builder->advance.x      = 0;\n    builder->advance.y      = 0;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    cff_builder_done                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Finalizes a given glyph builder.  Its contents can still be used   */\n  /*    after the call, but the function saves important information       */\n  /*    within the corresponding glyph slot.                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    builder :: A pointer to the glyph builder to finalize.             */\n  /*                                                                       */\n  static void\n  cff_builder_done( CFF_Builder*  builder )\n  {\n    CFF_GlyphSlot  glyph = builder->glyph;\n\n\n    if ( glyph )\n      glyph->root.outline = *builder->base;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    cff_compute_bias                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Computes the bias value in dependence of the number of glyph       */\n  /*    subroutines.                                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    in_charstring_type :: The `CharstringType' value of the top DICT   */\n  /*                          dictionary.                                  */\n  /*                                                                       */\n  /*    num_subrs          :: The number of glyph subroutines.             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The bias value.                                                    */\n  static FT_Int\n  cff_compute_bias( FT_Int   in_charstring_type,\n                    FT_UInt  num_subrs )\n  {\n    FT_Int  result;\n\n\n    if ( in_charstring_type == 1 )\n      result = 0;\n    else if ( num_subrs < 1240 )\n      result = 107;\n    else if ( num_subrs < 33900U )\n      result = 1131;\n    else\n      result = 32768U;\n\n    return result;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    cff_decoder_init                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initializes a given glyph decoder.                                 */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    decoder :: A pointer to the glyph builder to initialize.           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face      :: The current face object.                              */\n  /*                                                                       */\n  /*    size      :: The current size object.                              */\n  /*                                                                       */\n  /*    slot      :: The current glyph object.                             */\n  /*                                                                       */\n  /*    hinting   :: Whether hinting is active.                            */\n  /*                                                                       */\n  /*    hint_mode :: The hinting mode.                                     */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  cff_decoder_init( CFF_Decoder*    decoder,\n                    TT_Face         face,\n                    CFF_Size        size,\n                    CFF_GlyphSlot   slot,\n                    FT_Bool         hinting,\n                    FT_Render_Mode  hint_mode )\n  {\n    CFF_Font  cff = (CFF_Font)face->extra.data;\n\n\n    /* clear everything */\n    FT_MEM_ZERO( decoder, sizeof ( *decoder ) );\n\n    /* initialize builder */\n    cff_builder_init( &decoder->builder, face, size, slot, hinting );\n\n    /* initialize Type2 decoder */\n    decoder->cff          = cff;\n    decoder->num_globals  = cff->global_subrs_index.count;\n    decoder->globals      = cff->global_subrs;\n    decoder->globals_bias = cff_compute_bias(\n                              cff->top_font.font_dict.charstring_type,\n                              decoder->num_globals );\n\n    decoder->hint_mode    = hint_mode;\n  }\n\n\n  /* this function is used to select the subfont */\n  /* and the locals subrs array                  */\n  FT_LOCAL_DEF( FT_Error )\n  cff_decoder_prepare( CFF_Decoder*  decoder,\n                       CFF_Size      size,\n                       FT_UInt       glyph_index )\n  {\n    CFF_Builder  *builder = &decoder->builder;\n    CFF_Font      cff     = (CFF_Font)builder->face->extra.data;\n    CFF_SubFont   sub     = &cff->top_font;\n    FT_Error      error   = FT_Err_Ok;\n\n\n    /* manage CID fonts */\n    if ( cff->num_subfonts )\n    {\n      FT_Byte  fd_index = cff_fd_select_get( &cff->fd_select, glyph_index );\n\n\n      if ( fd_index >= cff->num_subfonts )\n      {\n        FT_TRACE4(( \"cff_decoder_prepare: invalid CID subfont index\\n\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Exit;\n      }\n\n      FT_TRACE3(( \"  in subfont %d:\\n\", fd_index ));\n\n      sub = cff->subfonts[fd_index];\n\n      if ( builder->hints_funcs && size )\n      {\n        CFF_Internal  internal = (CFF_Internal)size->root.internal;\n\n\n        /* for CFFs without subfonts, this value has already been set */\n        builder->hints_globals = (void *)internal->subfonts[fd_index];\n      }\n    }\n\n    decoder->num_locals    = sub->local_subrs_index.count;\n    decoder->locals        = sub->local_subrs;\n    decoder->locals_bias   = cff_compute_bias(\n                               decoder->cff->top_font.font_dict.charstring_type,\n                               decoder->num_locals );\n\n    decoder->glyph_width   = sub->private_dict.default_width;\n    decoder->nominal_width = sub->private_dict.nominal_width;\n\n    decoder->current_subfont = sub;     /* for Adobe's CFF handler */\n\n  Exit:\n    return error;\n  }\n\n\n  /* check that there is enough space for `count' more points */\n  FT_LOCAL_DEF( FT_Error )\n  cff_check_points( CFF_Builder*  builder,\n                    FT_Int        count )\n  {\n    return FT_GLYPHLOADER_CHECK_POINTS( builder->loader, count, 0 );\n  }\n\n\n  /* add a new point, do not check space */\n  FT_LOCAL_DEF( void )\n  cff_builder_add_point( CFF_Builder*  builder,\n                         FT_Pos        x,\n                         FT_Pos        y,\n                         FT_Byte       flag )\n  {\n    FT_Outline*  outline = builder->current;\n\n\n    if ( builder->load_points )\n    {\n      FT_Vector*  point   = outline->points + outline->n_points;\n      FT_Byte*    control = (FT_Byte*)outline->tags + outline->n_points;\n\n#ifdef CFF_CONFIG_OPTION_OLD_ENGINE\n      CFF_Driver  driver  = (CFF_Driver)FT_FACE_DRIVER( builder->face );\n\n\n      if ( driver->hinting_engine == FT_CFF_HINTING_FREETYPE )\n      {\n        point->x = x >> 16;\n        point->y = y >> 16;\n      }\n      else\n#endif\n      {\n        /* cf2_decoder_parse_charstrings uses 16.16 coordinates */\n        point->x = x >> 10;\n        point->y = y >> 10;\n      }\n      *control = (FT_Byte)( flag ? FT_CURVE_TAG_ON : FT_CURVE_TAG_CUBIC );\n    }\n\n    outline->n_points++;\n  }\n\n\n  /* check space for a new on-curve point, then add it */\n  FT_LOCAL_DEF( FT_Error )\n  cff_builder_add_point1( CFF_Builder*  builder,\n                          FT_Pos        x,\n                          FT_Pos        y )\n  {\n    FT_Error  error;\n\n\n    error = cff_check_points( builder, 1 );\n    if ( !error )\n      cff_builder_add_point( builder, x, y, 1 );\n\n    return error;\n  }\n\n\n  /* check space for a new contour, then add it */\n  static FT_Error\n  cff_builder_add_contour( CFF_Builder*  builder )\n  {\n    FT_Outline*  outline = builder->current;\n    FT_Error     error;\n\n\n    if ( !builder->load_points )\n    {\n      outline->n_contours++;\n      return FT_Err_Ok;\n    }\n\n    error = FT_GLYPHLOADER_CHECK_POINTS( builder->loader, 0, 1 );\n    if ( !error )\n    {\n      if ( outline->n_contours > 0 )\n        outline->contours[outline->n_contours - 1] =\n          (short)( outline->n_points - 1 );\n\n      outline->n_contours++;\n    }\n\n    return error;\n  }\n\n\n  /* if a path was begun, add its first on-curve point */\n  FT_LOCAL_DEF( FT_Error )\n  cff_builder_start_point( CFF_Builder*  builder,\n                           FT_Pos        x,\n                           FT_Pos        y )\n  {\n    FT_Error  error = FT_Err_Ok;\n\n\n    /* test whether we are building a new contour */\n    if ( !builder->path_begun )\n    {\n      builder->path_begun = 1;\n      error = cff_builder_add_contour( builder );\n      if ( !error )\n        error = cff_builder_add_point1( builder, x, y );\n    }\n\n    return error;\n  }\n\n\n  /* close the current contour */\n  FT_LOCAL_DEF( void )\n  cff_builder_close_contour( CFF_Builder*  builder )\n  {\n    FT_Outline*  outline = builder->current;\n    FT_Int       first;\n\n\n    if ( !outline )\n      return;\n\n    first = outline->n_contours <= 1\n            ? 0 : outline->contours[outline->n_contours - 2] + 1;\n\n    /* We must not include the last point in the path if it */\n    /* is located on the first point.                       */\n    if ( outline->n_points > 1 )\n    {\n      FT_Vector*  p1      = outline->points + first;\n      FT_Vector*  p2      = outline->points + outline->n_points - 1;\n      FT_Byte*    control = (FT_Byte*)outline->tags + outline->n_points - 1;\n\n\n      /* `delete' last point only if it coincides with the first    */\n      /* point and if it is not a control point (which can happen). */\n      if ( p1->x == p2->x && p1->y == p2->y )\n        if ( *control == FT_CURVE_TAG_ON )\n          outline->n_points--;\n    }\n\n    if ( outline->n_contours > 0 )\n    {\n      /* Don't add contours only consisting of one point, i.e., */\n      /* check whether begin point and last point are the same. */\n      if ( first == outline->n_points - 1 )\n      {\n        outline->n_contours--;\n        outline->n_points--;\n      }\n      else\n        outline->contours[outline->n_contours - 1] =\n          (short)( outline->n_points - 1 );\n    }\n  }\n\n\n  FT_LOCAL_DEF( FT_Int )\n  cff_lookup_glyph_by_stdcharcode( CFF_Font  cff,\n                                   FT_Int    charcode )\n  {\n    FT_UInt    n;\n    FT_UShort  glyph_sid;\n\n\n    /* CID-keyed fonts don't have glyph names */\n    if ( !cff->charset.sids )\n      return -1;\n\n    /* check range of standard char code */\n    if ( charcode < 0 || charcode > 255 )\n      return -1;\n\n    /* Get code to SID mapping from `cff_standard_encoding'. */\n    glyph_sid = cff_get_standard_encoding( (FT_UInt)charcode );\n\n    for ( n = 0; n < cff->num_glyphs; n++ )\n    {\n      if ( cff->charset.sids[n] == glyph_sid )\n        return n;\n    }\n\n    return -1;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  cff_get_glyph_data( TT_Face    face,\n                      FT_UInt    glyph_index,\n                      FT_Byte**  pointer,\n                      FT_ULong*  length )\n  {\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n    /* For incremental fonts get the character data using the */\n    /* callback function.                                     */\n    if ( face->root.internal->incremental_interface )\n    {\n      FT_Data   data;\n      FT_Error  error =\n                  face->root.internal->incremental_interface->funcs->get_glyph_data(\n                    face->root.internal->incremental_interface->object,\n                    glyph_index, &data );\n\n\n      *pointer = (FT_Byte*)data.pointer;\n      *length = data.length;\n\n      return error;\n    }\n    else\n#endif /* FT_CONFIG_OPTION_INCREMENTAL */\n\n    {\n      CFF_Font  cff  = (CFF_Font)(face->extra.data);\n\n\n      return cff_index_access_element( &cff->charstrings_index, glyph_index,\n                                       pointer, length );\n    }\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cff_free_glyph_data( TT_Face    face,\n                       FT_Byte**  pointer,\n                       FT_ULong   length )\n  {\n#ifndef FT_CONFIG_OPTION_INCREMENTAL\n    FT_UNUSED( length );\n#endif\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n    /* For incremental fonts get the character data using the */\n    /* callback function.                                     */\n    if ( face->root.internal->incremental_interface )\n    {\n      FT_Data  data;\n\n\n      data.pointer = *pointer;\n      data.length  = length;\n\n      face->root.internal->incremental_interface->funcs->free_glyph_data(\n        face->root.internal->incremental_interface->object, &data );\n    }\n    else\n#endif /* FT_CONFIG_OPTION_INCREMENTAL */\n\n    {\n      CFF_Font  cff = (CFF_Font)(face->extra.data);\n\n\n      cff_index_forget_element( &cff->charstrings_index, pointer );\n    }\n  }\n\n\n#ifdef CFF_CONFIG_OPTION_OLD_ENGINE\n\n  static FT_Error\n  cff_operator_seac( CFF_Decoder*  decoder,\n                     FT_Pos        asb,\n                     FT_Pos        adx,\n                     FT_Pos        ady,\n                     FT_Int        bchar,\n                     FT_Int        achar )\n  {\n    FT_Error      error;\n    CFF_Builder*  builder = &decoder->builder;\n    FT_Int        bchar_index, achar_index;\n    TT_Face       face = decoder->builder.face;\n    FT_Vector     left_bearing, advance;\n    FT_Byte*      charstring;\n    FT_ULong      charstring_len;\n    FT_Pos        glyph_width;\n\n\n    if ( decoder->seac )\n    {\n      FT_ERROR(( \"cff_operator_seac: invalid nested seac\\n\" ));\n      return FT_THROW( Syntax_Error );\n    }\n\n    adx += decoder->builder.left_bearing.x;\n    ady += decoder->builder.left_bearing.y;\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n    /* Incremental fonts don't necessarily have valid charsets.        */\n    /* They use the character code, not the glyph index, in this case. */\n    if ( face->root.internal->incremental_interface )\n    {\n      bchar_index = bchar;\n      achar_index = achar;\n    }\n    else\n#endif /* FT_CONFIG_OPTION_INCREMENTAL */\n    {\n      CFF_Font cff = (CFF_Font)(face->extra.data);\n\n\n      bchar_index = cff_lookup_glyph_by_stdcharcode( cff, bchar );\n      achar_index = cff_lookup_glyph_by_stdcharcode( cff, achar );\n    }\n\n    if ( bchar_index < 0 || achar_index < 0 )\n    {\n      FT_ERROR(( \"cff_operator_seac:\"\n                 \" invalid seac character code arguments\\n\" ));\n      return FT_THROW( Syntax_Error );\n    }\n\n    /* If we are trying to load a composite glyph, do not load the */\n    /* accent character and return the array of subglyphs.         */\n    if ( builder->no_recurse )\n    {\n      FT_GlyphSlot    glyph  = (FT_GlyphSlot)builder->glyph;\n      FT_GlyphLoader  loader = glyph->internal->loader;\n      FT_SubGlyph     subg;\n\n\n      /* reallocate subglyph array if necessary */\n      error = FT_GlyphLoader_CheckSubGlyphs( loader, 2 );\n      if ( error )\n        goto Exit;\n\n      subg = loader->current.subglyphs;\n\n      /* subglyph 0 = base character */\n      subg->index = bchar_index;\n      subg->flags = FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES |\n                    FT_SUBGLYPH_FLAG_USE_MY_METRICS;\n      subg->arg1  = 0;\n      subg->arg2  = 0;\n      subg++;\n\n      /* subglyph 1 = accent character */\n      subg->index = achar_index;\n      subg->flags = FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES;\n      subg->arg1  = (FT_Int)( adx >> 16 );\n      subg->arg2  = (FT_Int)( ady >> 16 );\n\n      /* set up remaining glyph fields */\n      glyph->num_subglyphs = 2;\n      glyph->subglyphs     = loader->base.subglyphs;\n      glyph->format        = FT_GLYPH_FORMAT_COMPOSITE;\n\n      loader->current.num_subglyphs = 2;\n    }\n\n    FT_GlyphLoader_Prepare( builder->loader );\n\n    /* First load `bchar' in builder */\n    error = cff_get_glyph_data( face, bchar_index,\n                                &charstring, &charstring_len );\n    if ( !error )\n    {\n      /* the seac operator must not be nested */\n      decoder->seac = TRUE;\n      error = cff_decoder_parse_charstrings( decoder, charstring,\n                                             charstring_len );\n      decoder->seac = FALSE;\n\n      cff_free_glyph_data( face, &charstring, charstring_len );\n\n      if ( error )\n        goto Exit;\n    }\n\n    /* Save the left bearing, advance and glyph width of the base */\n    /* character as they will be erased by the next load.         */\n\n    left_bearing = builder->left_bearing;\n    advance      = builder->advance;\n    glyph_width  = decoder->glyph_width;\n\n    builder->left_bearing.x = 0;\n    builder->left_bearing.y = 0;\n\n    builder->pos_x = adx - asb;\n    builder->pos_y = ady;\n\n    /* Now load `achar' on top of the base outline. */\n    error = cff_get_glyph_data( face, achar_index,\n                                &charstring, &charstring_len );\n    if ( !error )\n    {\n      /* the seac operator must not be nested */\n      decoder->seac = TRUE;\n      error = cff_decoder_parse_charstrings( decoder, charstring,\n                                             charstring_len );\n      decoder->seac = FALSE;\n\n      cff_free_glyph_data( face, &charstring, charstring_len );\n\n      if ( error )\n        goto Exit;\n    }\n\n    /* Restore the left side bearing, advance and glyph width */\n    /* of the base character.                                 */\n    builder->left_bearing = left_bearing;\n    builder->advance      = advance;\n    decoder->glyph_width  = glyph_width;\n\n    builder->pos_x = 0;\n    builder->pos_y = 0;\n\n  Exit:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    cff_decoder_parse_charstrings                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Parses a given Type 2 charstrings program.                         */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    decoder         :: The current Type 1 decoder.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    charstring_base :: The base of the charstring stream.              */\n  /*                                                                       */\n  /*    charstring_len  :: The length in bytes of the charstring stream.   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  cff_decoder_parse_charstrings( CFF_Decoder*  decoder,\n                                 FT_Byte*      charstring_base,\n                                 FT_ULong      charstring_len )\n  {\n    FT_Error           error;\n    CFF_Decoder_Zone*  zone;\n    FT_Byte*           ip;\n    FT_Byte*           limit;\n    CFF_Builder*       builder = &decoder->builder;\n    FT_Pos             x, y;\n    FT_Fixed           seed;\n    FT_Fixed*          stack;\n    FT_Int             charstring_type =\n                         decoder->cff->top_font.font_dict.charstring_type;\n\n    T2_Hints_Funcs     hinter;\n\n\n    /* set default width */\n    decoder->num_hints  = 0;\n    decoder->read_width = 1;\n\n    /* compute random seed from stack address of parameter */\n    seed = (FT_Fixed)( ( (FT_PtrDist)(char*)&seed              ^\n                         (FT_PtrDist)(char*)&decoder           ^\n                         (FT_PtrDist)(char*)&charstring_base ) &\n                         FT_ULONG_MAX ) ;\n    seed = ( seed ^ ( seed >> 10 ) ^ ( seed >> 20 ) ) & 0xFFFFL;\n    if ( seed == 0 )\n      seed = 0x7384;\n\n    /* initialize the decoder */\n    decoder->top  = decoder->stack;\n    decoder->zone = decoder->zones;\n    zone          = decoder->zones;\n    stack         = decoder->top;\n\n    hinter = (T2_Hints_Funcs)builder->hints_funcs;\n\n    builder->path_begun = 0;\n\n    zone->base           = charstring_base;\n    limit = zone->limit  = charstring_base + charstring_len;\n    ip    = zone->cursor = zone->base;\n\n    error = FT_Err_Ok;\n\n    x = builder->pos_x;\n    y = builder->pos_y;\n\n    /* begin hints recording session, if any */\n    if ( hinter )\n      hinter->open( hinter->hints );\n\n    /* now execute loop */\n    while ( ip < limit )\n    {\n      CFF_Operator  op;\n      FT_Byte       v;\n\n\n      /********************************************************************/\n      /*                                                                  */\n      /* Decode operator or operand                                       */\n      /*                                                                  */\n      v = *ip++;\n      if ( v >= 32 || v == 28 )\n      {\n        FT_Int    shift = 16;\n        FT_Int32  val;\n\n\n        /* this is an operand, push it on the stack */\n\n        /* if we use shifts, all computations are done with unsigned */\n        /* values; the conversion to a signed value is the last step */\n        if ( v == 28 )\n        {\n          if ( ip + 1 >= limit )\n            goto Syntax_Error;\n          val = (FT_Short)( ( (FT_UShort)ip[0] << 8 ) | ip[1] );\n          ip += 2;\n        }\n        else if ( v < 247 )\n          val = (FT_Int32)v - 139;\n        else if ( v < 251 )\n        {\n          if ( ip >= limit )\n            goto Syntax_Error;\n          val = ( (FT_Int32)v - 247 ) * 256 + *ip++ + 108;\n        }\n        else if ( v < 255 )\n        {\n          if ( ip >= limit )\n            goto Syntax_Error;\n          val = -( (FT_Int32)v - 251 ) * 256 - *ip++ - 108;\n        }\n        else\n        {\n          if ( ip + 3 >= limit )\n            goto Syntax_Error;\n          val = (FT_Int32)( ( (FT_UInt32)ip[0] << 24 ) |\n                            ( (FT_UInt32)ip[1] << 16 ) |\n                            ( (FT_UInt32)ip[2] <<  8 ) |\n                              (FT_UInt32)ip[3]         );\n          ip    += 4;\n          if ( charstring_type == 2 )\n            shift = 0;\n        }\n        if ( decoder->top - stack >= CFF_MAX_OPERANDS )\n          goto Stack_Overflow;\n\n        val             = (FT_Int32)( (FT_UInt32)val << shift );\n        *decoder->top++ = val;\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n        if ( !( val & 0xFFFFL ) )\n          FT_TRACE4(( \" %hd\", (FT_Short)( (FT_UInt32)val >> 16 ) ));\n        else\n          FT_TRACE4(( \" %.2f\", val / 65536.0 ));\n#endif\n\n      }\n      else\n      {\n        /* The specification says that normally arguments are to be taken */\n        /* from the bottom of the stack.  However, this seems not to be   */\n        /* correct, at least for Acroread 7.0.8 on GNU/Linux: It pops the */\n        /* arguments similar to a PS interpreter.                         */\n\n        FT_Fixed*  args     = decoder->top;\n        FT_Int     num_args = (FT_Int)( args - decoder->stack );\n        FT_Int     req_args;\n\n\n        /* find operator */\n        op = cff_op_unknown;\n\n        switch ( v )\n        {\n        case 1:\n          op = cff_op_hstem;\n          break;\n        case 3:\n          op = cff_op_vstem;\n          break;\n        case 4:\n          op = cff_op_vmoveto;\n          break;\n        case 5:\n          op = cff_op_rlineto;\n          break;\n        case 6:\n          op = cff_op_hlineto;\n          break;\n        case 7:\n          op = cff_op_vlineto;\n          break;\n        case 8:\n          op = cff_op_rrcurveto;\n          break;\n        case 9:\n          op = cff_op_closepath;\n          break;\n        case 10:\n          op = cff_op_callsubr;\n          break;\n        case 11:\n          op = cff_op_return;\n          break;\n        case 12:\n          {\n            if ( ip >= limit )\n              goto Syntax_Error;\n            v = *ip++;\n\n            switch ( v )\n            {\n            case 0:\n              op = cff_op_dotsection;\n              break;\n            case 1: /* this is actually the Type1 vstem3 operator */\n              op = cff_op_vstem;\n              break;\n            case 2: /* this is actually the Type1 hstem3 operator */\n              op = cff_op_hstem;\n              break;\n            case 3:\n              op = cff_op_and;\n              break;\n            case 4:\n              op = cff_op_or;\n              break;\n            case 5:\n              op = cff_op_not;\n              break;\n            case 6:\n              op = cff_op_seac;\n              break;\n            case 7:\n              op = cff_op_sbw;\n              break;\n            case 8:\n              op = cff_op_store;\n              break;\n            case 9:\n              op = cff_op_abs;\n              break;\n            case 10:\n              op = cff_op_add;\n              break;\n            case 11:\n              op = cff_op_sub;\n              break;\n            case 12:\n              op = cff_op_div;\n              break;\n            case 13:\n              op = cff_op_load;\n              break;\n            case 14:\n              op = cff_op_neg;\n              break;\n            case 15:\n              op = cff_op_eq;\n              break;\n            case 16:\n              op = cff_op_callothersubr;\n              break;\n            case 17:\n              op = cff_op_pop;\n              break;\n            case 18:\n              op = cff_op_drop;\n              break;\n            case 20:\n              op = cff_op_put;\n              break;\n            case 21:\n              op = cff_op_get;\n              break;\n            case 22:\n              op = cff_op_ifelse;\n              break;\n            case 23:\n              op = cff_op_random;\n              break;\n            case 24:\n              op = cff_op_mul;\n              break;\n            case 26:\n              op = cff_op_sqrt;\n              break;\n            case 27:\n              op = cff_op_dup;\n              break;\n            case 28:\n              op = cff_op_exch;\n              break;\n            case 29:\n              op = cff_op_index;\n              break;\n            case 30:\n              op = cff_op_roll;\n              break;\n            case 33:\n              op = cff_op_setcurrentpoint;\n              break;\n            case 34:\n              op = cff_op_hflex;\n              break;\n            case 35:\n              op = cff_op_flex;\n              break;\n            case 36:\n              op = cff_op_hflex1;\n              break;\n            case 37:\n              op = cff_op_flex1;\n              break;\n            default:\n              FT_TRACE4(( \" unknown op (12, %d)\\n\", v ));\n              break;\n            }\n          }\n          break;\n        case 13:\n          op = cff_op_hsbw;\n          break;\n        case 14:\n          op = cff_op_endchar;\n          break;\n        case 16:\n          op = cff_op_blend;\n          break;\n        case 18:\n          op = cff_op_hstemhm;\n          break;\n        case 19:\n          op = cff_op_hintmask;\n          break;\n        case 20:\n          op = cff_op_cntrmask;\n          break;\n        case 21:\n          op = cff_op_rmoveto;\n          break;\n        case 22:\n          op = cff_op_hmoveto;\n          break;\n        case 23:\n          op = cff_op_vstemhm;\n          break;\n        case 24:\n          op = cff_op_rcurveline;\n          break;\n        case 25:\n          op = cff_op_rlinecurve;\n          break;\n        case 26:\n          op = cff_op_vvcurveto;\n          break;\n        case 27:\n          op = cff_op_hhcurveto;\n          break;\n        case 29:\n          op = cff_op_callgsubr;\n          break;\n        case 30:\n          op = cff_op_vhcurveto;\n          break;\n        case 31:\n          op = cff_op_hvcurveto;\n          break;\n        default:\n          FT_TRACE4(( \" unknown op (%d)\\n\", v ));\n          break;\n        }\n\n        if ( op == cff_op_unknown )\n          continue;\n\n        /* check arguments */\n        req_args = cff_argument_counts[op];\n        if ( req_args & CFF_COUNT_CHECK_WIDTH )\n        {\n          if ( num_args > 0 && decoder->read_width )\n          {\n            /* If `nominal_width' is non-zero, the number is really a      */\n            /* difference against `nominal_width'.  Else, the number here  */\n            /* is truly a width, not a difference against `nominal_width'. */\n            /* If the font does not set `nominal_width', then              */\n            /* `nominal_width' defaults to zero, and so we can set         */\n            /* `glyph_width' to `nominal_width' plus number on the stack   */\n            /* -- for either case.                                         */\n\n            FT_Int  set_width_ok;\n\n\n            switch ( op )\n            {\n            case cff_op_hmoveto:\n            case cff_op_vmoveto:\n              set_width_ok = num_args & 2;\n              break;\n\n            case cff_op_hstem:\n            case cff_op_vstem:\n            case cff_op_hstemhm:\n            case cff_op_vstemhm:\n            case cff_op_rmoveto:\n            case cff_op_hintmask:\n            case cff_op_cntrmask:\n              set_width_ok = num_args & 1;\n              break;\n\n            case cff_op_endchar:\n              /* If there is a width specified for endchar, we either have */\n              /* 1 argument or 5 arguments.  We like to argue.             */\n              set_width_ok = ( num_args == 5 ) || ( num_args == 1 );\n              break;\n\n            default:\n              set_width_ok = 0;\n              break;\n            }\n\n            if ( set_width_ok )\n            {\n              decoder->glyph_width = decoder->nominal_width +\n                                       ( stack[0] >> 16 );\n\n              if ( decoder->width_only )\n              {\n                /* we only want the advance width; stop here */\n                break;\n              }\n\n              /* Consumed an argument. */\n              num_args--;\n            }\n          }\n\n          decoder->read_width = 0;\n          req_args            = 0;\n        }\n\n        req_args &= 0x000F;\n        if ( num_args < req_args )\n          goto Stack_Underflow;\n        args     -= req_args;\n        num_args -= req_args;\n\n        /* At this point, `args' points to the first argument of the  */\n        /* operand in case `req_args' isn't zero.  Otherwise, we have */\n        /* to adjust `args' manually.                                 */\n\n        /* Note that we only pop arguments from the stack which we    */\n        /* really need and can digest so that we can continue in case */\n        /* of superfluous stack elements.                             */\n\n        switch ( op )\n        {\n        case cff_op_hstem:\n        case cff_op_vstem:\n        case cff_op_hstemhm:\n        case cff_op_vstemhm:\n          /* the number of arguments is always even here */\n          FT_TRACE4((\n              op == cff_op_hstem   ? \" hstem\\n\"   :\n            ( op == cff_op_vstem   ? \" vstem\\n\"   :\n            ( op == cff_op_hstemhm ? \" hstemhm\\n\" : \" vstemhm\\n\" ) ) ));\n\n          if ( hinter )\n            hinter->stems( hinter->hints,\n                           ( op == cff_op_hstem || op == cff_op_hstemhm ),\n                           num_args / 2,\n                           args - ( num_args & ~1 ) );\n\n          decoder->num_hints += num_args / 2;\n          args = stack;\n          break;\n\n        case cff_op_hintmask:\n        case cff_op_cntrmask:\n          FT_TRACE4(( op == cff_op_hintmask ? \" hintmask\" : \" cntrmask\" ));\n\n          /* implement vstem when needed --                        */\n          /* the specification doesn't say it, but this also works */\n          /* with the 'cntrmask' operator                          */\n          /*                                                       */\n          if ( num_args > 0 )\n          {\n            if ( hinter )\n              hinter->stems( hinter->hints,\n                             0,\n                             num_args / 2,\n                             args - ( num_args & ~1 ) );\n\n            decoder->num_hints += num_args / 2;\n          }\n\n          /* In a valid charstring there must be at least one byte */\n          /* after `hintmask' or `cntrmask' (e.g., for a `return'  */\n          /* instruction).  Additionally, there must be space for  */\n          /* `num_hints' bits.                                     */\n\n          if ( ( ip + ( ( decoder->num_hints + 7 ) >> 3 ) ) >= limit )\n            goto Syntax_Error;\n\n          if ( hinter )\n          {\n            if ( op == cff_op_hintmask )\n              hinter->hintmask( hinter->hints,\n                                builder->current->n_points,\n                                decoder->num_hints,\n                                ip );\n            else\n              hinter->counter( hinter->hints,\n                               decoder->num_hints,\n                               ip );\n          }\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n          {\n            FT_UInt maskbyte;\n\n\n            FT_TRACE4(( \" (maskbytes:\" ));\n\n            for ( maskbyte = 0;\n                  maskbyte < (FT_UInt)( ( decoder->num_hints + 7 ) >> 3 );\n                  maskbyte++, ip++ )\n              FT_TRACE4(( \" 0x%02X\", *ip ));\n\n            FT_TRACE4(( \")\\n\" ));\n          }\n#else\n          ip += ( decoder->num_hints + 7 ) >> 3;\n#endif\n          args = stack;\n          break;\n\n        case cff_op_rmoveto:\n          FT_TRACE4(( \" rmoveto\\n\" ));\n\n          cff_builder_close_contour( builder );\n          builder->path_begun = 0;\n          x   += args[-2];\n          y   += args[-1];\n          args = stack;\n          break;\n\n        case cff_op_vmoveto:\n          FT_TRACE4(( \" vmoveto\\n\" ));\n\n          cff_builder_close_contour( builder );\n          builder->path_begun = 0;\n          y   += args[-1];\n          args = stack;\n          break;\n\n        case cff_op_hmoveto:\n          FT_TRACE4(( \" hmoveto\\n\" ));\n\n          cff_builder_close_contour( builder );\n          builder->path_begun = 0;\n          x   += args[-1];\n          args = stack;\n          break;\n\n        case cff_op_rlineto:\n          FT_TRACE4(( \" rlineto\\n\" ));\n\n          if ( cff_builder_start_point( builder, x, y )  ||\n               cff_check_points( builder, num_args / 2 ) )\n            goto Fail;\n\n          if ( num_args < 2 )\n            goto Stack_Underflow;\n\n          args -= num_args & ~1;\n          while ( args < decoder->top )\n          {\n            x += args[0];\n            y += args[1];\n            cff_builder_add_point( builder, x, y, 1 );\n            args += 2;\n          }\n          args = stack;\n          break;\n\n        case cff_op_hlineto:\n        case cff_op_vlineto:\n          {\n            FT_Int  phase = ( op == cff_op_hlineto );\n\n\n            FT_TRACE4(( op == cff_op_hlineto ? \" hlineto\\n\"\n                                             : \" vlineto\\n\" ));\n\n            if ( num_args < 0 )\n              goto Stack_Underflow;\n\n            /* there exist subsetted fonts (found in PDFs) */\n            /* which call `hlineto' without arguments      */\n            if ( num_args == 0 )\n              break;\n\n            if ( cff_builder_start_point( builder, x, y ) ||\n                 cff_check_points( builder, num_args )    )\n              goto Fail;\n\n            args = stack;\n            while ( args < decoder->top )\n            {\n              if ( phase )\n                x += args[0];\n              else\n                y += args[0];\n\n              if ( cff_builder_add_point1( builder, x, y ) )\n                goto Fail;\n\n              args++;\n              phase ^= 1;\n            }\n            args = stack;\n          }\n          break;\n\n        case cff_op_rrcurveto:\n          {\n            FT_Int  nargs;\n\n\n            FT_TRACE4(( \" rrcurveto\\n\" ));\n\n            if ( num_args < 6 )\n              goto Stack_Underflow;\n\n            nargs = num_args - num_args % 6;\n\n            if ( cff_builder_start_point( builder, x, y ) ||\n                 cff_check_points( builder, nargs / 2 )   )\n              goto Fail;\n\n            args -= nargs;\n            while ( args < decoder->top )\n            {\n              x += args[0];\n              y += args[1];\n              cff_builder_add_point( builder, x, y, 0 );\n              x += args[2];\n              y += args[3];\n              cff_builder_add_point( builder, x, y, 0 );\n              x += args[4];\n              y += args[5];\n              cff_builder_add_point( builder, x, y, 1 );\n              args += 6;\n            }\n            args = stack;\n          }\n          break;\n\n        case cff_op_vvcurveto:\n          {\n            FT_Int  nargs;\n\n\n            FT_TRACE4(( \" vvcurveto\\n\" ));\n\n            if ( num_args < 4 )\n              goto Stack_Underflow;\n\n            /* if num_args isn't of the form 4n or 4n+1, */\n            /* we enforce it by clearing the second bit  */\n\n            nargs = num_args & ~2;\n\n            if ( cff_builder_start_point( builder, x, y ) )\n              goto Fail;\n\n            args -= nargs;\n\n            if ( nargs & 1 )\n            {\n              x += args[0];\n              args++;\n              nargs--;\n            }\n\n            if ( cff_check_points( builder, 3 * ( nargs / 4 ) ) )\n              goto Fail;\n\n            while ( args < decoder->top )\n            {\n              y += args[0];\n              cff_builder_add_point( builder, x, y, 0 );\n              x += args[1];\n              y += args[2];\n              cff_builder_add_point( builder, x, y, 0 );\n              y += args[3];\n              cff_builder_add_point( builder, x, y, 1 );\n              args += 4;\n            }\n            args = stack;\n          }\n          break;\n\n        case cff_op_hhcurveto:\n          {\n            FT_Int  nargs;\n\n\n            FT_TRACE4(( \" hhcurveto\\n\" ));\n\n            if ( num_args < 4 )\n              goto Stack_Underflow;\n\n            /* if num_args isn't of the form 4n or 4n+1, */\n            /* we enforce it by clearing the second bit  */\n\n            nargs = num_args & ~2;\n\n            if ( cff_builder_start_point( builder, x, y ) )\n              goto Fail;\n\n            args -= nargs;\n            if ( nargs & 1 )\n            {\n              y += args[0];\n              args++;\n              nargs--;\n            }\n\n            if ( cff_check_points( builder, 3 * ( nargs / 4 ) ) )\n              goto Fail;\n\n            while ( args < decoder->top )\n            {\n              x += args[0];\n              cff_builder_add_point( builder, x, y, 0 );\n              x += args[1];\n              y += args[2];\n              cff_builder_add_point( builder, x, y, 0 );\n              x += args[3];\n              cff_builder_add_point( builder, x, y, 1 );\n              args += 4;\n            }\n            args = stack;\n          }\n          break;\n\n        case cff_op_vhcurveto:\n        case cff_op_hvcurveto:\n          {\n            FT_Int  phase;\n            FT_Int  nargs;\n\n\n            FT_TRACE4(( op == cff_op_vhcurveto ? \" vhcurveto\\n\"\n                                               : \" hvcurveto\\n\" ));\n\n            if ( cff_builder_start_point( builder, x, y ) )\n              goto Fail;\n\n            if ( num_args < 4 )\n              goto Stack_Underflow;\n\n            /* if num_args isn't of the form 8n, 8n+1, 8n+4, or 8n+5, */\n            /* we enforce it by clearing the second bit               */\n\n            nargs = num_args & ~2;\n\n            args -= nargs;\n            if ( cff_check_points( builder, ( nargs / 4 ) * 3 ) )\n              goto Stack_Underflow;\n\n            phase = ( op == cff_op_hvcurveto );\n\n            while ( nargs >= 4 )\n            {\n              nargs -= 4;\n              if ( phase )\n              {\n                x += args[0];\n                cff_builder_add_point( builder, x, y, 0 );\n                x += args[1];\n                y += args[2];\n                cff_builder_add_point( builder, x, y, 0 );\n                y += args[3];\n                if ( nargs == 1 )\n                  x += args[4];\n                cff_builder_add_point( builder, x, y, 1 );\n              }\n              else\n              {\n                y += args[0];\n                cff_builder_add_point( builder, x, y, 0 );\n                x += args[1];\n                y += args[2];\n                cff_builder_add_point( builder, x, y, 0 );\n                x += args[3];\n                if ( nargs == 1 )\n                  y += args[4];\n                cff_builder_add_point( builder, x, y, 1 );\n              }\n              args  += 4;\n              phase ^= 1;\n            }\n            args = stack;\n          }\n          break;\n\n        case cff_op_rlinecurve:\n          {\n            FT_Int  num_lines;\n            FT_Int  nargs;\n\n\n            FT_TRACE4(( \" rlinecurve\\n\" ));\n\n            if ( num_args < 8 )\n              goto Stack_Underflow;\n\n            nargs     = num_args & ~1;\n            num_lines = ( nargs - 6 ) / 2;\n\n            if ( cff_builder_start_point( builder, x, y )   ||\n                 cff_check_points( builder, num_lines + 3 ) )\n              goto Fail;\n\n            args -= nargs;\n\n            /* first, add the line segments */\n            while ( num_lines > 0 )\n            {\n              x += args[0];\n              y += args[1];\n              cff_builder_add_point( builder, x, y, 1 );\n              args += 2;\n              num_lines--;\n            }\n\n            /* then the curve */\n            x += args[0];\n            y += args[1];\n            cff_builder_add_point( builder, x, y, 0 );\n            x += args[2];\n            y += args[3];\n            cff_builder_add_point( builder, x, y, 0 );\n            x += args[4];\n            y += args[5];\n            cff_builder_add_point( builder, x, y, 1 );\n            args = stack;\n          }\n          break;\n\n        case cff_op_rcurveline:\n          {\n            FT_Int  num_curves;\n            FT_Int  nargs;\n\n\n            FT_TRACE4(( \" rcurveline\\n\" ));\n\n            if ( num_args < 8 )\n              goto Stack_Underflow;\n\n            nargs      = num_args - 2;\n            nargs      = nargs - nargs % 6 + 2;\n            num_curves = ( nargs - 2 ) / 6;\n\n            if ( cff_builder_start_point( builder, x, y )        ||\n                 cff_check_points( builder, num_curves * 3 + 2 ) )\n              goto Fail;\n\n            args -= nargs;\n\n            /* first, add the curves */\n            while ( num_curves > 0 )\n            {\n              x += args[0];\n              y += args[1];\n              cff_builder_add_point( builder, x, y, 0 );\n              x += args[2];\n              y += args[3];\n              cff_builder_add_point( builder, x, y, 0 );\n              x += args[4];\n              y += args[5];\n              cff_builder_add_point( builder, x, y, 1 );\n              args += 6;\n              num_curves--;\n            }\n\n            /* then the final line */\n            x += args[0];\n            y += args[1];\n            cff_builder_add_point( builder, x, y, 1 );\n            args = stack;\n          }\n          break;\n\n        case cff_op_hflex1:\n          {\n            FT_Pos start_y;\n\n\n            FT_TRACE4(( \" hflex1\\n\" ));\n\n            /* adding five more points: 4 control points, 1 on-curve point */\n            /* -- make sure we have enough space for the start point if it */\n            /* needs to be added                                           */\n            if ( cff_builder_start_point( builder, x, y ) ||\n                 cff_check_points( builder, 6 )           )\n              goto Fail;\n\n            /* record the starting point's y position for later use */\n            start_y = y;\n\n            /* first control point */\n            x += args[0];\n            y += args[1];\n            cff_builder_add_point( builder, x, y, 0 );\n\n            /* second control point */\n            x += args[2];\n            y += args[3];\n            cff_builder_add_point( builder, x, y, 0 );\n\n            /* join point; on curve, with y-value the same as the last */\n            /* control point's y-value                                 */\n            x += args[4];\n            cff_builder_add_point( builder, x, y, 1 );\n\n            /* third control point, with y-value the same as the join */\n            /* point's y-value                                        */\n            x += args[5];\n            cff_builder_add_point( builder, x, y, 0 );\n\n            /* fourth control point */\n            x += args[6];\n            y += args[7];\n            cff_builder_add_point( builder, x, y, 0 );\n\n            /* ending point, with y-value the same as the start   */\n            x += args[8];\n            y  = start_y;\n            cff_builder_add_point( builder, x, y, 1 );\n\n            args = stack;\n            break;\n          }\n\n        case cff_op_hflex:\n          {\n            FT_Pos start_y;\n\n\n            FT_TRACE4(( \" hflex\\n\" ));\n\n            /* adding six more points; 4 control points, 2 on-curve points */\n            if ( cff_builder_start_point( builder, x, y ) ||\n                 cff_check_points( builder, 6 )           )\n              goto Fail;\n\n            /* record the starting point's y-position for later use */\n            start_y = y;\n\n            /* first control point */\n            x += args[0];\n            cff_builder_add_point( builder, x, y, 0 );\n\n            /* second control point */\n            x += args[1];\n            y += args[2];\n            cff_builder_add_point( builder, x, y, 0 );\n\n            /* join point; on curve, with y-value the same as the last */\n            /* control point's y-value                                 */\n            x += args[3];\n            cff_builder_add_point( builder, x, y, 1 );\n\n            /* third control point, with y-value the same as the join */\n            /* point's y-value                                        */\n            x += args[4];\n            cff_builder_add_point( builder, x, y, 0 );\n\n            /* fourth control point */\n            x += args[5];\n            y  = start_y;\n            cff_builder_add_point( builder, x, y, 0 );\n\n            /* ending point, with y-value the same as the start point's */\n            /* y-value -- we don't add this point, though               */\n            x += args[6];\n            cff_builder_add_point( builder, x, y, 1 );\n\n            args = stack;\n            break;\n          }\n\n        case cff_op_flex1:\n          {\n            FT_Pos     start_x, start_y; /* record start x, y values for */\n                                         /* alter use                    */\n            FT_Fixed   dx = 0, dy = 0;   /* used in horizontal/vertical  */\n                                         /* algorithm below              */\n            FT_Int     horizontal, count;\n            FT_Fixed*  temp;\n\n\n            FT_TRACE4(( \" flex1\\n\" ));\n\n            /* adding six more points; 4 control points, 2 on-curve points */\n            if ( cff_builder_start_point( builder, x, y ) ||\n                 cff_check_points( builder, 6 )           )\n              goto Fail;\n\n            /* record the starting point's x, y position for later use */\n            start_x = x;\n            start_y = y;\n\n            /* XXX: figure out whether this is supposed to be a horizontal */\n            /*      or vertical flex; the Type 2 specification is vague... */\n\n            temp = args;\n\n            /* grab up to the last argument */\n            for ( count = 5; count > 0; count-- )\n            {\n              dx += temp[0];\n              dy += temp[1];\n              temp += 2;\n            }\n\n            if ( dx < 0 )\n              dx = -dx;\n            if ( dy < 0 )\n              dy = -dy;\n\n            /* strange test, but here it is... */\n            horizontal = ( dx > dy );\n\n            for ( count = 5; count > 0; count-- )\n            {\n              x += args[0];\n              y += args[1];\n              cff_builder_add_point( builder, x, y,\n                                     (FT_Bool)( count == 3 ) );\n              args += 2;\n            }\n\n            /* is last operand an x- or y-delta? */\n            if ( horizontal )\n            {\n              x += args[0];\n              y  = start_y;\n            }\n            else\n            {\n              x  = start_x;\n              y += args[0];\n            }\n\n            cff_builder_add_point( builder, x, y, 1 );\n\n            args = stack;\n            break;\n           }\n\n        case cff_op_flex:\n          {\n            FT_UInt  count;\n\n\n            FT_TRACE4(( \" flex\\n\" ));\n\n            if ( cff_builder_start_point( builder, x, y ) ||\n                 cff_check_points( builder, 6 )           )\n              goto Fail;\n\n            for ( count = 6; count > 0; count-- )\n            {\n              x += args[0];\n              y += args[1];\n              cff_builder_add_point( builder, x, y,\n                                     (FT_Bool)( count == 4 || count == 1 ) );\n              args += 2;\n            }\n\n            args = stack;\n          }\n          break;\n\n        case cff_op_seac:\n            FT_TRACE4(( \" seac\\n\" ));\n\n            error = cff_operator_seac( decoder,\n                                       args[0], args[1], args[2],\n                                       (FT_Int)( args[3] >> 16 ),\n                                       (FT_Int)( args[4] >> 16 ) );\n\n            /* add current outline to the glyph slot */\n            FT_GlyphLoader_Add( builder->loader );\n\n            /* return now! */\n            FT_TRACE4(( \"\\n\" ));\n            return error;\n\n        case cff_op_endchar:\n          FT_TRACE4(( \" endchar\\n\" ));\n\n          /* We are going to emulate the seac operator. */\n          if ( num_args >= 4 )\n          {\n            /* Save glyph width so that the subglyphs don't overwrite it. */\n            FT_Pos  glyph_width = decoder->glyph_width;\n\n\n            error = cff_operator_seac( decoder,\n                                       0L, args[-4], args[-3],\n                                       (FT_Int)( args[-2] >> 16 ),\n                                       (FT_Int)( args[-1] >> 16 ) );\n\n            decoder->glyph_width = glyph_width;\n          }\n          else\n          {\n            cff_builder_close_contour( builder );\n\n            /* close hints recording session */\n            if ( hinter )\n            {\n              if ( hinter->close( hinter->hints,\n                                  builder->current->n_points ) )\n                goto Syntax_Error;\n\n              /* apply hints to the loaded glyph outline now */\n              error = hinter->apply( hinter->hints,\n                                     builder->current,\n                                     (PSH_Globals)builder->hints_globals,\n                                     decoder->hint_mode );\n              if ( error )\n                goto Fail;\n            }\n\n            /* add current outline to the glyph slot */\n            FT_GlyphLoader_Add( builder->loader );\n          }\n\n          /* return now! */\n          FT_TRACE4(( \"\\n\" ));\n          return error;\n\n        case cff_op_abs:\n          FT_TRACE4(( \" abs\\n\" ));\n\n          if ( args[0] < 0 )\n            args[0] = -args[0];\n          args++;\n          break;\n\n        case cff_op_add:\n          FT_TRACE4(( \" add\\n\" ));\n\n          args[0] += args[1];\n          args++;\n          break;\n\n        case cff_op_sub:\n          FT_TRACE4(( \" sub\\n\" ));\n\n          args[0] -= args[1];\n          args++;\n          break;\n\n        case cff_op_div:\n          FT_TRACE4(( \" div\\n\" ));\n\n          args[0] = FT_DivFix( args[0], args[1] );\n          args++;\n          break;\n\n        case cff_op_neg:\n          FT_TRACE4(( \" neg\\n\" ));\n\n          args[0] = -args[0];\n          args++;\n          break;\n\n        case cff_op_random:\n          {\n            FT_Fixed  Rand;\n\n\n            FT_TRACE4(( \" rand\\n\" ));\n\n            Rand = seed;\n            if ( Rand >= 0x8000L )\n              Rand++;\n\n            args[0] = Rand;\n            seed    = FT_MulFix( seed, 0x10000L - seed );\n            if ( seed == 0 )\n              seed += 0x2873;\n            args++;\n          }\n          break;\n\n        case cff_op_mul:\n          FT_TRACE4(( \" mul\\n\" ));\n\n          args[0] = FT_MulFix( args[0], args[1] );\n          args++;\n          break;\n\n        case cff_op_sqrt:\n          FT_TRACE4(( \" sqrt\\n\" ));\n\n          if ( args[0] > 0 )\n          {\n            FT_Int    count = 9;\n            FT_Fixed  root  = args[0];\n            FT_Fixed  new_root;\n\n\n            for (;;)\n            {\n              new_root = ( root + FT_DivFix( args[0], root ) + 1 ) >> 1;\n              if ( new_root == root || count <= 0 )\n                break;\n              root = new_root;\n            }\n            args[0] = new_root;\n          }\n          else\n            args[0] = 0;\n          args++;\n          break;\n\n        case cff_op_drop:\n          /* nothing */\n          FT_TRACE4(( \" drop\\n\" ));\n\n          break;\n\n        case cff_op_exch:\n          {\n            FT_Fixed  tmp;\n\n\n            FT_TRACE4(( \" exch\\n\" ));\n\n            tmp     = args[0];\n            args[0] = args[1];\n            args[1] = tmp;\n            args   += 2;\n          }\n          break;\n\n        case cff_op_index:\n          {\n            FT_Int  idx = (FT_Int)( args[0] >> 16 );\n\n\n            FT_TRACE4(( \" index\\n\" ));\n\n            if ( idx < 0 )\n              idx = 0;\n            else if ( idx > num_args - 2 )\n              idx = num_args - 2;\n            args[0] = args[-( idx + 1 )];\n            args++;\n          }\n          break;\n\n        case cff_op_roll:\n          {\n            FT_Int  count = (FT_Int)( args[0] >> 16 );\n            FT_Int  idx   = (FT_Int)( args[1] >> 16 );\n\n\n            FT_TRACE4(( \" roll\\n\" ));\n\n            if ( count <= 0 )\n              count = 1;\n\n            args -= count;\n            if ( args < stack )\n              goto Stack_Underflow;\n\n            if ( idx >= 0 )\n            {\n              while ( idx > 0 )\n              {\n                FT_Fixed  tmp = args[count - 1];\n                FT_Int    i;\n\n\n                for ( i = count - 2; i >= 0; i-- )\n                  args[i + 1] = args[i];\n                args[0] = tmp;\n                idx--;\n              }\n            }\n            else\n            {\n              while ( idx < 0 )\n              {\n                FT_Fixed  tmp = args[0];\n                FT_Int    i;\n\n\n                for ( i = 0; i < count - 1; i++ )\n                  args[i] = args[i + 1];\n                args[count - 1] = tmp;\n                idx++;\n              }\n            }\n            args += count;\n          }\n          break;\n\n        case cff_op_dup:\n          FT_TRACE4(( \" dup\\n\" ));\n\n          args[1] = args[0];\n          args += 2;\n          break;\n\n        case cff_op_put:\n          {\n            FT_Fixed  val = args[0];\n            FT_Int    idx = (FT_Int)( args[1] >> 16 );\n\n\n            FT_TRACE4(( \" put\\n\" ));\n\n            if ( idx >= 0 && idx < CFF_MAX_TRANS_ELEMENTS )\n              decoder->buildchar[idx] = val;\n          }\n          break;\n\n        case cff_op_get:\n          {\n            FT_Int    idx = (FT_Int)( args[0] >> 16 );\n            FT_Fixed  val = 0;\n\n\n            FT_TRACE4(( \" get\\n\" ));\n\n            if ( idx >= 0 && idx < CFF_MAX_TRANS_ELEMENTS )\n              val = decoder->buildchar[idx];\n\n            args[0] = val;\n            args++;\n          }\n          break;\n\n        case cff_op_store:\n          FT_TRACE4(( \" store\\n\"));\n\n          goto Unimplemented;\n\n        case cff_op_load:\n          FT_TRACE4(( \" load\\n\" ));\n\n          goto Unimplemented;\n\n        case cff_op_dotsection:\n          /* this operator is deprecated and ignored by the parser */\n          FT_TRACE4(( \" dotsection\\n\" ));\n          break;\n\n        case cff_op_closepath:\n          /* this is an invalid Type 2 operator; however, there        */\n          /* exist fonts which are incorrectly converted from probably */\n          /* Type 1 to CFF, and some parsers seem to accept it         */\n\n          FT_TRACE4(( \" closepath (invalid op)\\n\" ));\n\n          args = stack;\n          break;\n\n        case cff_op_hsbw:\n          /* this is an invalid Type 2 operator; however, there        */\n          /* exist fonts which are incorrectly converted from probably */\n          /* Type 1 to CFF, and some parsers seem to accept it         */\n\n          FT_TRACE4(( \" hsbw (invalid op)\\n\" ));\n\n          decoder->glyph_width = decoder->nominal_width + ( args[1] >> 16 );\n\n          decoder->builder.left_bearing.x = args[0];\n          decoder->builder.left_bearing.y = 0;\n\n          x    = decoder->builder.pos_x + args[0];\n          y    = decoder->builder.pos_y;\n          args = stack;\n          break;\n\n        case cff_op_sbw:\n          /* this is an invalid Type 2 operator; however, there        */\n          /* exist fonts which are incorrectly converted from probably */\n          /* Type 1 to CFF, and some parsers seem to accept it         */\n\n          FT_TRACE4(( \" sbw (invalid op)\\n\" ));\n\n          decoder->glyph_width = decoder->nominal_width + ( args[2] >> 16 );\n\n          decoder->builder.left_bearing.x = args[0];\n          decoder->builder.left_bearing.y = args[1];\n\n          x    = decoder->builder.pos_x + args[0];\n          y    = decoder->builder.pos_y + args[1];\n          args = stack;\n          break;\n\n        case cff_op_setcurrentpoint:\n          /* this is an invalid Type 2 operator; however, there        */\n          /* exist fonts which are incorrectly converted from probably */\n          /* Type 1 to CFF, and some parsers seem to accept it         */\n\n          FT_TRACE4(( \" setcurrentpoint (invalid op)\\n\" ));\n\n          x    = decoder->builder.pos_x + args[0];\n          y    = decoder->builder.pos_y + args[1];\n          args = stack;\n          break;\n\n        case cff_op_callothersubr:\n          /* this is an invalid Type 2 operator; however, there        */\n          /* exist fonts which are incorrectly converted from probably */\n          /* Type 1 to CFF, and some parsers seem to accept it         */\n\n          FT_TRACE4(( \" callothersubr (invalid op)\\n\" ));\n\n          /* subsequent `pop' operands should add the arguments,       */\n          /* this is the implementation described for `unknown' other  */\n          /* subroutines in the Type1 spec.                            */\n          /*                                                           */\n          /* XXX Fix return arguments (see discussion below).          */\n          args -= 2 + ( args[-2] >> 16 );\n          if ( args < stack )\n            goto Stack_Underflow;\n          break;\n\n        case cff_op_pop:\n          /* this is an invalid Type 2 operator; however, there        */\n          /* exist fonts which are incorrectly converted from probably */\n          /* Type 1 to CFF, and some parsers seem to accept it         */\n\n          FT_TRACE4(( \" pop (invalid op)\\n\" ));\n\n          /* XXX Increasing `args' is wrong: After a certain number of */\n          /* `pop's we get a stack overflow.  Reason for doing it is   */\n          /* code like this (actually found in a CFF font):            */\n          /*                                                           */\n          /*   17 1 3 callothersubr                                    */\n          /*   pop                                                     */\n          /*   callsubr                                                */\n          /*                                                           */\n          /* Since we handle `callothersubr' as a no-op, and           */\n          /* `callsubr' needs at least one argument, `pop' can't be a  */\n          /* no-op too as it basically should be.                      */\n          /*                                                           */\n          /* The right solution would be to provide real support for   */\n          /* `callothersubr' as done in `t1decode.c', however, given   */\n          /* the fact that CFF fonts with `pop' are invalid, it is     */\n          /* questionable whether it is worth the time.                */\n          args++;\n          break;\n\n        case cff_op_and:\n          {\n            FT_Fixed  cond = args[0] && args[1];\n\n\n            FT_TRACE4(( \" and\\n\" ));\n\n            args[0] = cond ? 0x10000L : 0;\n            args++;\n          }\n          break;\n\n        case cff_op_or:\n          {\n            FT_Fixed  cond = args[0] || args[1];\n\n\n            FT_TRACE4(( \" or\\n\" ));\n\n            args[0] = cond ? 0x10000L : 0;\n            args++;\n          }\n          break;\n\n        case cff_op_eq:\n          {\n            FT_Fixed  cond = !args[0];\n\n\n            FT_TRACE4(( \" eq\\n\" ));\n\n            args[0] = cond ? 0x10000L : 0;\n            args++;\n          }\n          break;\n\n        case cff_op_ifelse:\n          {\n            FT_Fixed  cond = ( args[2] <= args[3] );\n\n\n            FT_TRACE4(( \" ifelse\\n\" ));\n\n            if ( !cond )\n              args[0] = args[1];\n            args++;\n          }\n          break;\n\n        case cff_op_callsubr:\n          {\n            FT_UInt  idx = (FT_UInt)( ( args[0] >> 16 ) +\n                                      decoder->locals_bias );\n\n\n            FT_TRACE4(( \" callsubr(%d)\\n\", idx ));\n\n            if ( idx >= decoder->num_locals )\n            {\n              FT_ERROR(( \"cff_decoder_parse_charstrings:\"\n                         \" invalid local subr index\\n\" ));\n              goto Syntax_Error;\n            }\n\n            if ( zone - decoder->zones >= CFF_MAX_SUBRS_CALLS )\n            {\n              FT_ERROR(( \"cff_decoder_parse_charstrings:\"\n                         \" too many nested subrs\\n\" ));\n              goto Syntax_Error;\n            }\n\n            zone->cursor = ip;  /* save current instruction pointer */\n\n            zone++;\n            zone->base   = decoder->locals[idx];\n            zone->limit  = decoder->locals[idx + 1];\n            zone->cursor = zone->base;\n\n            if ( !zone->base || zone->limit == zone->base )\n            {\n              FT_ERROR(( \"cff_decoder_parse_charstrings:\"\n                         \" invoking empty subrs\\n\" ));\n              goto Syntax_Error;\n            }\n\n            decoder->zone = zone;\n            ip            = zone->base;\n            limit         = zone->limit;\n          }\n          break;\n\n        case cff_op_callgsubr:\n          {\n            FT_UInt  idx = (FT_UInt)( ( args[0] >> 16 ) +\n                                      decoder->globals_bias );\n\n\n            FT_TRACE4(( \" callgsubr(%d)\\n\", idx ));\n\n            if ( idx >= decoder->num_globals )\n            {\n              FT_ERROR(( \"cff_decoder_parse_charstrings:\"\n                         \" invalid global subr index\\n\" ));\n              goto Syntax_Error;\n            }\n\n            if ( zone - decoder->zones >= CFF_MAX_SUBRS_CALLS )\n            {\n              FT_ERROR(( \"cff_decoder_parse_charstrings:\"\n                         \" too many nested subrs\\n\" ));\n              goto Syntax_Error;\n            }\n\n            zone->cursor = ip;  /* save current instruction pointer */\n\n            zone++;\n            zone->base   = decoder->globals[idx];\n            zone->limit  = decoder->globals[idx + 1];\n            zone->cursor = zone->base;\n\n            if ( !zone->base || zone->limit == zone->base )\n            {\n              FT_ERROR(( \"cff_decoder_parse_charstrings:\"\n                         \" invoking empty subrs\\n\" ));\n              goto Syntax_Error;\n            }\n\n            decoder->zone = zone;\n            ip            = zone->base;\n            limit         = zone->limit;\n          }\n          break;\n\n        case cff_op_return:\n          FT_TRACE4(( \" return\\n\" ));\n\n          if ( decoder->zone <= decoder->zones )\n          {\n            FT_ERROR(( \"cff_decoder_parse_charstrings:\"\n                       \" unexpected return\\n\" ));\n            goto Syntax_Error;\n          }\n\n          decoder->zone--;\n          zone  = decoder->zone;\n          ip    = zone->cursor;\n          limit = zone->limit;\n          break;\n\n        default:\n        Unimplemented:\n          FT_ERROR(( \"Unimplemented opcode: %d\", ip[-1] ));\n\n          if ( ip[-1] == 12 )\n            FT_ERROR(( \" %d\", ip[0] ));\n          FT_ERROR(( \"\\n\" ));\n\n          return FT_THROW( Unimplemented_Feature );\n        }\n\n        decoder->top = args;\n\n        if ( decoder->top - stack >= CFF_MAX_OPERANDS )\n          goto Stack_Overflow;\n\n      } /* general operator processing */\n\n    } /* while ip < limit */\n\n    FT_TRACE4(( \"..end..\\n\\n\" ));\n\n  Fail:\n    return error;\n\n  Syntax_Error:\n    FT_TRACE4(( \"cff_decoder_parse_charstrings: syntax error\\n\" ));\n    return FT_THROW( Invalid_File_Format );\n\n  Stack_Underflow:\n    FT_TRACE4(( \"cff_decoder_parse_charstrings: stack underflow\\n\" ));\n    return FT_THROW( Too_Few_Arguments );\n\n  Stack_Overflow:\n    FT_TRACE4(( \"cff_decoder_parse_charstrings: stack overflow\\n\" ));\n    return FT_THROW( Stack_Overflow );\n  }\n\n#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /**********                                                      *********/\n  /**********                                                      *********/\n  /**********            COMPUTE THE MAXIMUM ADVANCE WIDTH         *********/\n  /**********                                                      *********/\n  /**********    The following code is in charge of computing      *********/\n  /**********    the maximum advance width of the font.  It        *********/\n  /**********    quickly processes each glyph charstring to        *********/\n  /**********    extract the value from either a `sbw' or `seac'   *********/\n  /**********    operator.                                         *********/\n  /**********                                                      *********/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n#if 0 /* unused until we support pure CFF fonts */\n\n\n  FT_LOCAL_DEF( FT_Error )\n  cff_compute_max_advance( TT_Face  face,\n                           FT_Int*  max_advance )\n  {\n    FT_Error     error = FT_Err_Ok;\n    CFF_Decoder  decoder;\n    FT_Int       glyph_index;\n    CFF_Font     cff = (CFF_Font)face->other;\n\n\n    *max_advance = 0;\n\n    /* Initialize load decoder */\n    cff_decoder_init( &decoder, face, 0, 0, 0, 0 );\n\n    decoder.builder.metrics_only = 1;\n    decoder.builder.load_points  = 0;\n\n    /* For each glyph, parse the glyph charstring and extract */\n    /* the advance width.                                     */\n    for ( glyph_index = 0; glyph_index < face->root.num_glyphs;\n          glyph_index++ )\n    {\n      FT_Byte*  charstring;\n      FT_ULong  charstring_len;\n\n\n      /* now get load the unscaled outline */\n      error = cff_get_glyph_data( face, glyph_index,\n                                  &charstring, &charstring_len );\n      if ( !error )\n      {\n        error = cff_decoder_prepare( &decoder, size, glyph_index );\n        if ( !error )\n          error = cff_decoder_parse_charstrings( &decoder,\n                                                 charstring,\n                                                 charstring_len );\n\n        cff_free_glyph_data( face, &charstring, &charstring_len );\n      }\n\n      /* ignore the error if one has occurred -- skip to next glyph */\n      error = FT_Err_Ok;\n    }\n\n    *max_advance = decoder.builder.advance.x;\n\n    return FT_Err_Ok;\n  }\n\n\n#endif /* 0 */\n\n\n  FT_LOCAL_DEF( FT_Error )\n  cff_slot_load( CFF_GlyphSlot  glyph,\n                 CFF_Size       size,\n                 FT_UInt        glyph_index,\n                 FT_Int32       load_flags )\n  {\n    FT_Error     error;\n    CFF_Decoder  decoder;\n    TT_Face      face = (TT_Face)glyph->root.face;\n    FT_Bool      hinting, scaled, force_scaling;\n    CFF_Font     cff  = (CFF_Font)face->extra.data;\n\n    FT_Matrix    font_matrix;\n    FT_Vector    font_offset;\n\n\n    force_scaling = FALSE;\n\n    /* in a CID-keyed font, consider `glyph_index' as a CID and map */\n    /* it immediately to the real glyph_index -- if it isn't a      */\n    /* subsetted font, glyph_indices and CIDs are identical, though */\n    if ( cff->top_font.font_dict.cid_registry != 0xFFFFU &&\n         cff->charset.cids                               )\n    {\n      /* don't handle CID 0 (.notdef) which is directly mapped to GID 0 */\n      if ( glyph_index != 0 )\n      {\n        glyph_index = cff_charset_cid_to_gindex( &cff->charset,\n                                                 glyph_index );\n        if ( glyph_index == 0 )\n          return FT_THROW( Invalid_Argument );\n      }\n    }\n    else if ( glyph_index >= cff->num_glyphs )\n      return FT_THROW( Invalid_Argument );\n\n    if ( load_flags & FT_LOAD_NO_RECURSE )\n      load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;\n\n    glyph->x_scale = 0x10000L;\n    glyph->y_scale = 0x10000L;\n    if ( size )\n    {\n      glyph->x_scale = size->root.metrics.x_scale;\n      glyph->y_scale = size->root.metrics.y_scale;\n    }\n\n#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n\n    /* try to load embedded bitmap if any              */\n    /*                                                 */\n    /* XXX: The convention should be emphasized in     */\n    /*      the documents because it can be confusing. */\n    if ( size )\n    {\n      CFF_Face      cff_face = (CFF_Face)size->root.face;\n      SFNT_Service  sfnt     = (SFNT_Service)cff_face->sfnt;\n      FT_Stream     stream   = cff_face->root.stream;\n\n\n      if ( size->strike_index != 0xFFFFFFFFUL      &&\n           sfnt->load_eblc                         &&\n           ( load_flags & FT_LOAD_NO_BITMAP ) == 0 )\n      {\n        TT_SBit_MetricsRec  metrics;\n\n\n        error = sfnt->load_sbit_image( face,\n                                       size->strike_index,\n                                       glyph_index,\n                                       (FT_Int)load_flags,\n                                       stream,\n                                       &glyph->root.bitmap,\n                                       &metrics );\n\n        if ( !error )\n        {\n          FT_Bool    has_vertical_info;\n          FT_UShort  advance;\n          FT_Short   dummy;\n\n\n          glyph->root.outline.n_points   = 0;\n          glyph->root.outline.n_contours = 0;\n\n          glyph->root.metrics.width  = (FT_Pos)metrics.width  << 6;\n          glyph->root.metrics.height = (FT_Pos)metrics.height << 6;\n\n          glyph->root.metrics.horiBearingX = (FT_Pos)metrics.horiBearingX << 6;\n          glyph->root.metrics.horiBearingY = (FT_Pos)metrics.horiBearingY << 6;\n          glyph->root.metrics.horiAdvance  = (FT_Pos)metrics.horiAdvance  << 6;\n\n          glyph->root.metrics.vertBearingX = (FT_Pos)metrics.vertBearingX << 6;\n          glyph->root.metrics.vertBearingY = (FT_Pos)metrics.vertBearingY << 6;\n          glyph->root.metrics.vertAdvance  = (FT_Pos)metrics.vertAdvance  << 6;\n\n          glyph->root.format = FT_GLYPH_FORMAT_BITMAP;\n\n          if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )\n          {\n            glyph->root.bitmap_left = metrics.vertBearingX;\n            glyph->root.bitmap_top  = metrics.vertBearingY;\n          }\n          else\n          {\n            glyph->root.bitmap_left = metrics.horiBearingX;\n            glyph->root.bitmap_top  = metrics.horiBearingY;\n          }\n\n          /* compute linear advance widths */\n\n          (void)( (SFNT_Service)face->sfnt )->get_metrics( face, 0,\n                                                           glyph_index,\n                                                           &dummy,\n                                                           &advance );\n          glyph->root.linearHoriAdvance = advance;\n\n          has_vertical_info = FT_BOOL(\n                                face->vertical_info                   &&\n                                face->vertical.number_Of_VMetrics > 0 );\n\n          /* get the vertical metrics from the vtmx table if we have one */\n          if ( has_vertical_info )\n          {\n            (void)( (SFNT_Service)face->sfnt )->get_metrics( face, 1,\n                                                             glyph_index,\n                                                             &dummy,\n                                                             &advance );\n            glyph->root.linearVertAdvance = advance;\n          }\n          else\n          {\n            /* make up vertical ones */\n            if ( face->os2.version != 0xFFFFU )\n              glyph->root.linearVertAdvance = (FT_Pos)\n                ( face->os2.sTypoAscender - face->os2.sTypoDescender );\n            else\n              glyph->root.linearVertAdvance = (FT_Pos)\n                ( face->horizontal.Ascender - face->horizontal.Descender );\n          }\n\n          return error;\n        }\n      }\n    }\n\n#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */\n\n    /* return immediately if we only want the embedded bitmaps */\n    if ( load_flags & FT_LOAD_SBITS_ONLY )\n      return FT_THROW( Invalid_Argument );\n\n    /* if we have a CID subfont, use its matrix (which has already */\n    /* been multiplied with the root matrix)                       */\n\n    /* this scaling is only relevant if the PS hinter isn't active */\n    if ( cff->num_subfonts )\n    {\n      FT_ULong  top_upm, sub_upm;\n      FT_Byte   fd_index = cff_fd_select_get( &cff->fd_select,\n                                              glyph_index );\n\n\n      if ( fd_index >= cff->num_subfonts )\n        fd_index = (FT_Byte)( cff->num_subfonts - 1 );\n\n      top_upm = cff->top_font.font_dict.units_per_em;\n      sub_upm = cff->subfonts[fd_index]->font_dict.units_per_em;\n\n\n      font_matrix = cff->subfonts[fd_index]->font_dict.font_matrix;\n      font_offset = cff->subfonts[fd_index]->font_dict.font_offset;\n\n      if ( top_upm != sub_upm )\n      {\n        glyph->x_scale = FT_MulDiv( glyph->x_scale, top_upm, sub_upm );\n        glyph->y_scale = FT_MulDiv( glyph->y_scale, top_upm, sub_upm );\n\n        force_scaling = TRUE;\n      }\n    }\n    else\n    {\n      font_matrix = cff->top_font.font_dict.font_matrix;\n      font_offset = cff->top_font.font_dict.font_offset;\n    }\n\n    glyph->root.outline.n_points   = 0;\n    glyph->root.outline.n_contours = 0;\n\n    /* top-level code ensures that FT_LOAD_NO_HINTING is set */\n    /* if FT_LOAD_NO_SCALE is active                         */\n    hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_HINTING ) == 0 );\n    scaled  = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE   ) == 0 );\n\n    glyph->hint        = hinting;\n    glyph->scaled      = scaled;\n    glyph->root.format = FT_GLYPH_FORMAT_OUTLINE;  /* by default */\n\n    {\n#ifdef CFF_CONFIG_OPTION_OLD_ENGINE\n      CFF_Driver  driver = (CFF_Driver)FT_FACE_DRIVER( face );\n#endif\n\n\n      FT_Byte*  charstring;\n      FT_ULong  charstring_len;\n\n\n      cff_decoder_init( &decoder, face, size, glyph, hinting,\n                        FT_LOAD_TARGET_MODE( load_flags ) );\n\n      if ( load_flags & FT_LOAD_ADVANCE_ONLY )\n        decoder.width_only = TRUE;\n\n      decoder.builder.no_recurse =\n        (FT_Bool)( load_flags & FT_LOAD_NO_RECURSE );\n\n      /* now load the unscaled outline */\n      error = cff_get_glyph_data( face, glyph_index,\n                                  &charstring, &charstring_len );\n      if ( error )\n        goto Glyph_Build_Finished;\n\n      error = cff_decoder_prepare( &decoder, size, glyph_index );\n      if ( error )\n        goto Glyph_Build_Finished;\n\n#ifdef CFF_CONFIG_OPTION_OLD_ENGINE\n      /* choose which CFF renderer to use */\n      if ( driver->hinting_engine == FT_CFF_HINTING_FREETYPE )\n        error = cff_decoder_parse_charstrings( &decoder,\n                                               charstring,\n                                               charstring_len );\n      else\n#endif\n      {\n        error = cf2_decoder_parse_charstrings( &decoder,\n                                               charstring,\n                                               charstring_len );\n\n        /* Adobe's engine uses 16.16 numbers everywhere;              */\n        /* as a consequence, glyphs larger than 2000ppem get rejected */\n        if ( FT_ERR_EQ( error, Glyph_Too_Big ) )\n        {\n          /* this time, we retry unhinted and scale up the glyph later on */\n          /* (the engine uses and sets the hardcoded value 0x10000 / 64 = */\n          /* 0x400 for both `x_scale' and `y_scale' in this case)         */\n          hinting       = FALSE;\n          force_scaling = TRUE;\n          glyph->hint   = hinting;\n\n          error = cf2_decoder_parse_charstrings( &decoder,\n                                                 charstring,\n                                                 charstring_len );\n        }\n      }\n\n      cff_free_glyph_data( face, &charstring, charstring_len );\n\n      if ( error )\n        goto Glyph_Build_Finished;\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n      /* Control data and length may not be available for incremental */\n      /* fonts.                                                       */\n      if ( face->root.internal->incremental_interface )\n      {\n        glyph->root.control_data = 0;\n        glyph->root.control_len = 0;\n      }\n      else\n#endif /* FT_CONFIG_OPTION_INCREMENTAL */\n\n      /* We set control_data and control_len if charstrings is loaded. */\n      /* See how charstring loads at cff_index_access_element() in     */\n      /* cffload.c.                                                    */\n      {\n        CFF_Index  csindex = &cff->charstrings_index;\n\n\n        if ( csindex->offsets )\n        {\n          glyph->root.control_data = csindex->bytes +\n                                     csindex->offsets[glyph_index] - 1;\n          glyph->root.control_len  = charstring_len;\n        }\n      }\n\n  Glyph_Build_Finished:\n      /* save new glyph tables, if no error */\n      if ( !error )\n        cff_builder_done( &decoder.builder );\n      /* XXX: anything to do for broken glyph entry? */\n    }\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n\n    /* Incremental fonts can optionally override the metrics. */\n    if ( !error                                                               &&\n         face->root.internal->incremental_interface                           &&\n         face->root.internal->incremental_interface->funcs->get_glyph_metrics )\n    {\n      FT_Incremental_MetricsRec  metrics;\n\n\n      metrics.bearing_x = decoder.builder.left_bearing.x;\n      metrics.bearing_y = 0;\n      metrics.advance   = decoder.builder.advance.x;\n      metrics.advance_v = decoder.builder.advance.y;\n\n      error = face->root.internal->incremental_interface->funcs->get_glyph_metrics(\n                face->root.internal->incremental_interface->object,\n                glyph_index, FALSE, &metrics );\n\n      decoder.builder.left_bearing.x = metrics.bearing_x;\n      decoder.builder.advance.x      = metrics.advance;\n      decoder.builder.advance.y      = metrics.advance_v;\n    }\n\n#endif /* FT_CONFIG_OPTION_INCREMENTAL */\n\n    if ( !error )\n    {\n      /* Now, set the metrics -- this is rather simple, as   */\n      /* the left side bearing is the xMin, and the top side */\n      /* bearing the yMax.                                   */\n\n      /* For composite glyphs, return only left side bearing and */\n      /* advance width.                                          */\n      if ( load_flags & FT_LOAD_NO_RECURSE )\n      {\n        FT_Slot_Internal  internal = glyph->root.internal;\n\n\n        glyph->root.metrics.horiBearingX = decoder.builder.left_bearing.x;\n        glyph->root.metrics.horiAdvance  = decoder.glyph_width;\n        internal->glyph_matrix           = font_matrix;\n        internal->glyph_delta            = font_offset;\n        internal->glyph_transformed      = 1;\n      }\n      else\n      {\n        FT_BBox            cbox;\n        FT_Glyph_Metrics*  metrics = &glyph->root.metrics;\n        FT_Vector          advance;\n        FT_Bool            has_vertical_info;\n\n\n        /* copy the _unscaled_ advance width */\n        metrics->horiAdvance                    = decoder.glyph_width;\n        glyph->root.linearHoriAdvance           = decoder.glyph_width;\n        glyph->root.internal->glyph_transformed = 0;\n\n        has_vertical_info = FT_BOOL( face->vertical_info                   &&\n                                     face->vertical.number_Of_VMetrics > 0 );\n\n        /* get the vertical metrics from the vtmx table if we have one */\n        if ( has_vertical_info )\n        {\n          FT_Short   vertBearingY = 0;\n          FT_UShort  vertAdvance  = 0;\n\n\n          (void)( (SFNT_Service)face->sfnt )->get_metrics( face, 1,\n                                                           glyph_index,\n                                                           &vertBearingY,\n                                                           &vertAdvance );\n          metrics->vertBearingY = vertBearingY;\n          metrics->vertAdvance  = vertAdvance;\n        }\n        else\n        {\n          /* make up vertical ones */\n          if ( face->os2.version != 0xFFFFU )\n            metrics->vertAdvance = (FT_Pos)( face->os2.sTypoAscender -\n                                             face->os2.sTypoDescender );\n          else\n            metrics->vertAdvance = (FT_Pos)( face->horizontal.Ascender -\n                                             face->horizontal.Descender );\n        }\n\n        glyph->root.linearVertAdvance = metrics->vertAdvance;\n\n        glyph->root.format = FT_GLYPH_FORMAT_OUTLINE;\n\n        glyph->root.outline.flags = 0;\n        if ( size && size->root.metrics.y_ppem < 24 )\n          glyph->root.outline.flags |= FT_OUTLINE_HIGH_PRECISION;\n\n        glyph->root.outline.flags |= FT_OUTLINE_REVERSE_FILL;\n\n        if ( !( font_matrix.xx == 0x10000L &&\n                font_matrix.yy == 0x10000L &&\n                font_matrix.xy == 0        &&\n                font_matrix.yx == 0        ) )\n          FT_Outline_Transform( &glyph->root.outline, &font_matrix );\n\n        if ( !( font_offset.x == 0 &&\n                font_offset.y == 0 ) )\n          FT_Outline_Translate( &glyph->root.outline,\n                                font_offset.x, font_offset.y );\n\n        advance.x = metrics->horiAdvance;\n        advance.y = 0;\n        FT_Vector_Transform( &advance, &font_matrix );\n        metrics->horiAdvance = advance.x + font_offset.x;\n\n        advance.x = 0;\n        advance.y = metrics->vertAdvance;\n        FT_Vector_Transform( &advance, &font_matrix );\n        metrics->vertAdvance = advance.y + font_offset.y;\n\n        if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 || force_scaling )\n        {\n          /* scale the outline and the metrics */\n          FT_Int       n;\n          FT_Outline*  cur     = &glyph->root.outline;\n          FT_Vector*   vec     = cur->points;\n          FT_Fixed     x_scale = glyph->x_scale;\n          FT_Fixed     y_scale = glyph->y_scale;\n\n\n          /* First of all, scale the points */\n          if ( !hinting || !decoder.builder.hints_funcs )\n            for ( n = cur->n_points; n > 0; n--, vec++ )\n            {\n              vec->x = FT_MulFix( vec->x, x_scale );\n              vec->y = FT_MulFix( vec->y, y_scale );\n            }\n\n          /* Then scale the metrics */\n          metrics->horiAdvance = FT_MulFix( metrics->horiAdvance, x_scale );\n          metrics->vertAdvance = FT_MulFix( metrics->vertAdvance, y_scale );\n        }\n\n        /* compute the other metrics */\n        FT_Outline_Get_CBox( &glyph->root.outline, &cbox );\n\n        metrics->width  = cbox.xMax - cbox.xMin;\n        metrics->height = cbox.yMax - cbox.yMin;\n\n        metrics->horiBearingX = cbox.xMin;\n        metrics->horiBearingY = cbox.yMax;\n\n        if ( has_vertical_info )\n          metrics->vertBearingX = metrics->horiBearingX -\n                                    metrics->horiAdvance / 2;\n        else\n        {\n          if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )\n            ft_synthesize_vertical_metrics( metrics,\n                                            metrics->vertAdvance );\n        }\n      }\n    }\n\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cffgload.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cffgload.h                                                             */\n/*                                                                         */\n/*    OpenType Glyph Loader (specification).                               */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006-2009, 2013 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CFFGLOAD_H__\n#define __CFFGLOAD_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include \"cffobjs.h\"\n\n\nFT_BEGIN_HEADER\n\n\n#define CFF_MAX_OPERANDS        48\n#define CFF_MAX_SUBRS_CALLS     32\n#define CFF_MAX_TRANS_ELEMENTS  32\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Structure>                                                           */\n  /*    CFF_Builder                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*     A structure used during glyph loading to store its outline.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    memory        :: The current memory object.                        */\n  /*                                                                       */\n  /*    face          :: The current face object.                          */\n  /*                                                                       */\n  /*    glyph         :: The current glyph slot.                           */\n  /*                                                                       */\n  /*    loader        :: The current glyph loader.                         */\n  /*                                                                       */\n  /*    base          :: The base glyph outline.                           */\n  /*                                                                       */\n  /*    current       :: The current glyph outline.                        */\n  /*                                                                       */\n  /*    pos_x         :: The horizontal translation (if composite glyph).  */\n  /*                                                                       */\n  /*    pos_y         :: The vertical translation (if composite glyph).    */\n  /*                                                                       */\n  /*    left_bearing  :: The left side bearing point.                      */\n  /*                                                                       */\n  /*    advance       :: The horizontal advance vector.                    */\n  /*                                                                       */\n  /*    bbox          :: Unused.                                           */\n  /*                                                                       */\n  /*    path_begun    :: A flag which indicates that a new path has begun. */\n  /*                                                                       */\n  /*    load_points   :: If this flag is not set, no points are loaded.    */\n  /*                                                                       */\n  /*    no_recurse    :: Set but not used.                                 */\n  /*                                                                       */\n  /*    metrics_only  :: A boolean indicating that we only want to compute */\n  /*                     the metrics of a given glyph, not load all of its */\n  /*                     points.                                           */\n  /*                                                                       */\n  /*    hints_funcs   :: Auxiliary pointer for hinting.                    */\n  /*                                                                       */\n  /*    hints_globals :: Auxiliary pointer for hinting.                    */\n  /*                                                                       */\n  typedef struct  CFF_Builder_\n  {\n    FT_Memory       memory;\n    TT_Face         face;\n    CFF_GlyphSlot   glyph;\n    FT_GlyphLoader  loader;\n    FT_Outline*     base;\n    FT_Outline*     current;\n\n    FT_Pos          pos_x;\n    FT_Pos          pos_y;\n\n    FT_Vector       left_bearing;\n    FT_Vector       advance;\n\n    FT_BBox         bbox;          /* bounding box */\n    FT_Bool         path_begun;\n    FT_Bool         load_points;\n    FT_Bool         no_recurse;\n\n    FT_Bool         metrics_only;\n\n    void*           hints_funcs;    /* hinter-specific */\n    void*           hints_globals;  /* hinter-specific */\n\n  } CFF_Builder;\n\n\n  FT_LOCAL( FT_Error )\n  cff_check_points( CFF_Builder*  builder,\n                    FT_Int        count );\n\n  FT_LOCAL( void )\n  cff_builder_add_point( CFF_Builder*  builder,\n                         FT_Pos        x,\n                         FT_Pos        y,\n                         FT_Byte       flag );\n  FT_LOCAL( FT_Error )\n  cff_builder_add_point1( CFF_Builder*  builder,\n                          FT_Pos        x,\n                          FT_Pos        y );\n  FT_LOCAL( FT_Error )\n  cff_builder_start_point( CFF_Builder*  builder,\n                           FT_Pos        x,\n                           FT_Pos        y );\n  FT_LOCAL( void )\n  cff_builder_close_contour( CFF_Builder*  builder );\n\n\n  FT_LOCAL( FT_Int )\n  cff_lookup_glyph_by_stdcharcode( CFF_Font  cff,\n                                   FT_Int    charcode );\n  FT_LOCAL( FT_Error )\n  cff_get_glyph_data( TT_Face    face,\n                      FT_UInt    glyph_index,\n                      FT_Byte**  pointer,\n                      FT_ULong*  length );\n  FT_LOCAL( void )\n  cff_free_glyph_data( TT_Face    face,\n                       FT_Byte**  pointer,\n                       FT_ULong   length );\n\n\n  /* execution context charstring zone */\n\n  typedef struct  CFF_Decoder_Zone_\n  {\n    FT_Byte*  base;\n    FT_Byte*  limit;\n    FT_Byte*  cursor;\n\n  } CFF_Decoder_Zone;\n\n\n  typedef struct  CFF_Decoder_\n  {\n    CFF_Builder        builder;\n    CFF_Font           cff;\n\n    FT_Fixed           stack[CFF_MAX_OPERANDS + 1];\n    FT_Fixed*          top;\n\n    CFF_Decoder_Zone   zones[CFF_MAX_SUBRS_CALLS + 1];\n    CFF_Decoder_Zone*  zone;\n\n    FT_Int             flex_state;\n    FT_Int             num_flex_vectors;\n    FT_Vector          flex_vectors[7];\n\n    FT_Pos             glyph_width;\n    FT_Pos             nominal_width;\n\n    FT_Bool            read_width;\n    FT_Bool            width_only;\n    FT_Int             num_hints;\n    FT_Fixed           buildchar[CFF_MAX_TRANS_ELEMENTS];\n\n    FT_UInt            num_locals;\n    FT_UInt            num_globals;\n\n    FT_Int             locals_bias;\n    FT_Int             globals_bias;\n\n    FT_Byte**          locals;\n    FT_Byte**          globals;\n\n    FT_Byte**          glyph_names;   /* for pure CFF fonts only  */\n    FT_UInt            num_glyphs;    /* number of glyphs in font */\n\n    FT_Render_Mode     hint_mode;\n\n    FT_Bool            seac;\n\n    CFF_SubFont        current_subfont; /* for current glyph_index */\n\n  } CFF_Decoder;\n\n\n  FT_LOCAL( void )\n  cff_decoder_init( CFF_Decoder*    decoder,\n                    TT_Face         face,\n                    CFF_Size        size,\n                    CFF_GlyphSlot   slot,\n                    FT_Bool         hinting,\n                    FT_Render_Mode  hint_mode );\n\n  FT_LOCAL( FT_Error )\n  cff_decoder_prepare( CFF_Decoder*  decoder,\n                       CFF_Size      size,\n                       FT_UInt       glyph_index );\n\n#if 0  /* unused until we support pure CFF fonts */\n\n  /* Compute the maximum advance width of a font through quick parsing */\n  FT_LOCAL( FT_Error )\n  cff_compute_max_advance( TT_Face  face,\n                           FT_Int*  max_advance );\n\n#endif /* 0 */\n\n#ifdef CFF_CONFIG_OPTION_OLD_ENGINE\n  FT_LOCAL( FT_Error )\n  cff_decoder_parse_charstrings( CFF_Decoder*  decoder,\n                                 FT_Byte*      charstring_base,\n                                 FT_ULong      charstring_len );\n#endif\n\n  FT_LOCAL( FT_Error )\n  cff_slot_load( CFF_GlyphSlot  glyph,\n                 CFF_Size       size,\n                 FT_UInt        glyph_index,\n                 FT_Int32       load_flags );\n\n\nFT_END_HEADER\n\n#endif /* __CFFGLOAD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cffload.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cffload.c                                                              */\n/*                                                                         */\n/*    OpenType and CFF data/program tables loader (body).                  */\n/*                                                                         */\n/*  Copyright 1996-2014 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_STREAM_H\n#include FT_TRUETYPE_TAGS_H\n#include FT_TYPE1_TABLES_H\n\n#include \"cffload.h\"\n#include \"cffparse.h\"\n\n#include \"cfferrs.h\"\n\n\n#if 1\n\n  static const FT_UShort  cff_isoadobe_charset[229] =\n  {\n      0,   1,   2,   3,   4,   5,   6,   7,\n      8,   9,  10,  11,  12,  13,  14,  15,\n     16,  17,  18,  19,  20,  21,  22,  23,\n     24,  25,  26,  27,  28,  29,  30,  31,\n     32,  33,  34,  35,  36,  37,  38,  39,\n     40,  41,  42,  43,  44,  45,  46,  47,\n     48,  49,  50,  51,  52,  53,  54,  55,\n     56,  57,  58,  59,  60,  61,  62,  63,\n     64,  65,  66,  67,  68,  69,  70,  71,\n     72,  73,  74,  75,  76,  77,  78,  79,\n     80,  81,  82,  83,  84,  85,  86,  87,\n     88,  89,  90,  91,  92,  93,  94,  95,\n     96,  97,  98,  99, 100, 101, 102, 103,\n    104, 105, 106, 107, 108, 109, 110, 111,\n    112, 113, 114, 115, 116, 117, 118, 119,\n    120, 121, 122, 123, 124, 125, 126, 127,\n    128, 129, 130, 131, 132, 133, 134, 135,\n    136, 137, 138, 139, 140, 141, 142, 143,\n    144, 145, 146, 147, 148, 149, 150, 151,\n    152, 153, 154, 155, 156, 157, 158, 159,\n    160, 161, 162, 163, 164, 165, 166, 167,\n    168, 169, 170, 171, 172, 173, 174, 175,\n    176, 177, 178, 179, 180, 181, 182, 183,\n    184, 185, 186, 187, 188, 189, 190, 191,\n    192, 193, 194, 195, 196, 197, 198, 199,\n    200, 201, 202, 203, 204, 205, 206, 207,\n    208, 209, 210, 211, 212, 213, 214, 215,\n    216, 217, 218, 219, 220, 221, 222, 223,\n    224, 225, 226, 227, 228\n  };\n\n  static const FT_UShort  cff_expert_charset[166] =\n  {\n      0,   1, 229, 230, 231, 232, 233, 234,\n    235, 236, 237, 238,  13,  14,  15,  99,\n    239, 240, 241, 242, 243, 244, 245, 246,\n    247, 248,  27,  28, 249, 250, 251, 252,\n    253, 254, 255, 256, 257, 258, 259, 260,\n    261, 262, 263, 264, 265, 266, 109, 110,\n    267, 268, 269, 270, 271, 272, 273, 274,\n    275, 276, 277, 278, 279, 280, 281, 282,\n    283, 284, 285, 286, 287, 288, 289, 290,\n    291, 292, 293, 294, 295, 296, 297, 298,\n    299, 300, 301, 302, 303, 304, 305, 306,\n    307, 308, 309, 310, 311, 312, 313, 314,\n    315, 316, 317, 318, 158, 155, 163, 319,\n    320, 321, 322, 323, 324, 325, 326, 150,\n    164, 169, 327, 328, 329, 330, 331, 332,\n    333, 334, 335, 336, 337, 338, 339, 340,\n    341, 342, 343, 344, 345, 346, 347, 348,\n    349, 350, 351, 352, 353, 354, 355, 356,\n    357, 358, 359, 360, 361, 362, 363, 364,\n    365, 366, 367, 368, 369, 370, 371, 372,\n    373, 374, 375, 376, 377, 378\n  };\n\n  static const FT_UShort  cff_expertsubset_charset[87] =\n  {\n      0,   1, 231, 232, 235, 236, 237, 238,\n     13,  14,  15,  99, 239, 240, 241, 242,\n    243, 244, 245, 246, 247, 248,  27,  28,\n    249, 250, 251, 253, 254, 255, 256, 257,\n    258, 259, 260, 261, 262, 263, 264, 265,\n    266, 109, 110, 267, 268, 269, 270, 272,\n    300, 301, 302, 305, 314, 315, 158, 155,\n    163, 320, 321, 322, 323, 324, 325, 326,\n    150, 164, 169, 327, 328, 329, 330, 331,\n    332, 333, 334, 335, 336, 337, 338, 339,\n    340, 341, 342, 343, 344, 345, 346\n  };\n\n  static const FT_UShort  cff_standard_encoding[256] =\n  {\n      0,   0,   0,   0,   0,   0,   0,   0,\n      0,   0,   0,   0,   0,   0,   0,   0,\n      0,   0,   0,   0,   0,   0,   0,   0,\n      0,   0,   0,   0,   0,   0,   0,   0,\n      1,   2,   3,   4,   5,   6,   7,   8,\n      9,  10,  11,  12,  13,  14,  15,  16,\n     17,  18,  19,  20,  21,  22,  23,  24,\n     25,  26,  27,  28,  29,  30,  31,  32,\n     33,  34,  35,  36,  37,  38,  39,  40,\n     41,  42,  43,  44,  45,  46,  47,  48,\n     49,  50,  51,  52,  53,  54,  55,  56,\n     57,  58,  59,  60,  61,  62,  63,  64,\n     65,  66,  67,  68,  69,  70,  71,  72,\n     73,  74,  75,  76,  77,  78,  79,  80,\n     81,  82,  83,  84,  85,  86,  87,  88,\n     89,  90,  91,  92,  93,  94,  95,   0,\n      0,   0,   0,   0,   0,   0,   0,   0,\n      0,   0,   0,   0,   0,   0,   0,   0,\n      0,   0,   0,   0,   0,   0,   0,   0,\n      0,   0,   0,   0,   0,   0,   0,   0,\n      0,  96,  97,  98,  99, 100, 101, 102,\n    103, 104, 105, 106, 107, 108, 109, 110,\n      0, 111, 112, 113, 114,   0, 115, 116,\n    117, 118, 119, 120, 121, 122,   0, 123,\n      0, 124, 125, 126, 127, 128, 129, 130,\n    131,   0, 132, 133,   0, 134, 135, 136,\n    137,   0,   0,   0,   0,   0,   0,   0,\n      0,   0,   0,   0,   0,   0,   0,   0,\n      0, 138,   0, 139,   0,   0,   0,   0,\n    140, 141, 142, 143,   0,   0,   0,   0,\n      0, 144,   0,   0,   0, 145,   0,   0,\n    146, 147, 148, 149,   0,   0,   0,   0\n  };\n\n  static const FT_UShort  cff_expert_encoding[256] =\n  {\n      0,   0,   0,   0,   0,   0,   0,   0,\n      0,   0,   0,   0,   0,   0,   0,   0,\n      0,   0,   0,   0,   0,   0,   0,   0,\n      0,   0,   0,   0,   0,   0,   0,   0,\n      1, 229, 230,   0, 231, 232, 233, 234,\n    235, 236, 237, 238,  13,  14,  15,  99,\n    239, 240, 241, 242, 243, 244, 245, 246,\n    247, 248,  27,  28, 249, 250, 251, 252,\n      0, 253, 254, 255, 256, 257,   0,   0,\n      0, 258,   0,   0, 259, 260, 261, 262,\n      0,   0, 263, 264, 265,   0, 266, 109,\n    110, 267, 268, 269,   0, 270, 271, 272,\n    273, 274, 275, 276, 277, 278, 279, 280,\n    281, 282, 283, 284, 285, 286, 287, 288,\n    289, 290, 291, 292, 293, 294, 295, 296,\n    297, 298, 299, 300, 301, 302, 303,   0,\n      0,   0,   0,   0,   0,   0,   0,   0,\n      0,   0,   0,   0,   0,   0,   0,   0,\n      0,   0,   0,   0,   0,   0,   0,   0,\n      0,   0,   0,   0,   0,   0,   0,   0,\n      0, 304, 305, 306,   0,   0, 307, 308,\n    309, 310, 311,   0, 312,   0,   0, 312,\n      0,   0, 314, 315,   0,   0, 316, 317,\n    318,   0,   0,   0, 158, 155, 163, 319,\n    320, 321, 322, 323, 324, 325,   0,   0,\n    326, 150, 164, 169, 327, 328, 329, 330,\n    331, 332, 333, 334, 335, 336, 337, 338,\n    339, 340, 341, 342, 343, 344, 345, 346,\n    347, 348, 349, 350, 351, 352, 353, 354,\n    355, 356, 357, 358, 359, 360, 361, 362,\n    363, 364, 365, 366, 367, 368, 369, 370,\n    371, 372, 373, 374, 375, 376, 377, 378\n  };\n\n#endif /* 1 */\n\n\n  FT_LOCAL_DEF( FT_UShort )\n  cff_get_standard_encoding( FT_UInt  charcode )\n  {\n    return (FT_UShort)( charcode < 256 ? cff_standard_encoding[charcode]\n                                       : 0 );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_cffload\n\n\n  /* read an offset from the index's stream current position */\n  static FT_ULong\n  cff_index_read_offset( CFF_Index  idx,\n                         FT_Error  *errorp )\n  {\n    FT_Error   error;\n    FT_Stream  stream = idx->stream;\n    FT_Byte    tmp[4];\n    FT_ULong   result = 0;\n\n\n    if ( !FT_STREAM_READ( tmp, idx->off_size ) )\n    {\n      FT_Int  nn;\n\n\n      for ( nn = 0; nn < idx->off_size; nn++ )\n        result = ( result << 8 ) | tmp[nn];\n    }\n\n    *errorp = error;\n    return result;\n  }\n\n\n  static FT_Error\n  cff_index_init( CFF_Index  idx,\n                  FT_Stream  stream,\n                  FT_Bool    load )\n  {\n    FT_Error   error;\n    FT_Memory  memory = stream->memory;\n    FT_UShort  count;\n\n\n    FT_MEM_ZERO( idx, sizeof ( *idx ) );\n\n    idx->stream = stream;\n    idx->start  = FT_STREAM_POS();\n    if ( !FT_READ_USHORT( count ) &&\n         count > 0                )\n    {\n      FT_Byte   offsize;\n      FT_ULong  size;\n\n\n      /* there is at least one element; read the offset size,           */\n      /* then access the offset table to compute the index's total size */\n      if ( FT_READ_BYTE( offsize ) )\n        goto Exit;\n\n      if ( offsize < 1 || offsize > 4 )\n      {\n        error = FT_THROW( Invalid_Table );\n        goto Exit;\n      }\n\n      idx->count    = count;\n      idx->off_size = offsize;\n      size          = (FT_ULong)( count + 1 ) * offsize;\n\n      idx->data_offset = idx->start + 3 + size;\n\n      if ( FT_STREAM_SKIP( size - offsize ) )\n        goto Exit;\n\n      size = cff_index_read_offset( idx, &error );\n      if ( error )\n        goto Exit;\n\n      if ( size == 0 )\n      {\n        error = FT_THROW( Invalid_Table );\n        goto Exit;\n      }\n\n      idx->data_size = --size;\n\n      if ( load )\n      {\n        /* load the data */\n        if ( FT_FRAME_EXTRACT( size, idx->bytes ) )\n          goto Exit;\n      }\n      else\n      {\n        /* skip the data */\n        if ( FT_STREAM_SKIP( size ) )\n          goto Exit;\n      }\n    }\n\n  Exit:\n    if ( error )\n      FT_FREE( idx->offsets );\n\n    return error;\n  }\n\n\n  static void\n  cff_index_done( CFF_Index  idx )\n  {\n    if ( idx->stream )\n    {\n      FT_Stream  stream = idx->stream;\n      FT_Memory  memory = stream->memory;\n\n\n      if ( idx->bytes )\n        FT_FRAME_RELEASE( idx->bytes );\n\n      FT_FREE( idx->offsets );\n      FT_MEM_ZERO( idx, sizeof ( *idx ) );\n    }\n  }\n\n\n  static FT_Error\n  cff_index_load_offsets( CFF_Index  idx )\n  {\n    FT_Error   error  = FT_Err_Ok;\n    FT_Stream  stream = idx->stream;\n    FT_Memory  memory = stream->memory;\n\n\n    if ( idx->count > 0 && idx->offsets == NULL )\n    {\n      FT_Byte    offsize = idx->off_size;\n      FT_ULong   data_size;\n      FT_Byte*   p;\n      FT_Byte*   p_end;\n      FT_ULong*  poff;\n\n\n      data_size = (FT_ULong)( idx->count + 1 ) * offsize;\n\n      if ( FT_NEW_ARRAY( idx->offsets, idx->count + 1 ) ||\n           FT_STREAM_SEEK( idx->start + 3 )             ||\n           FT_FRAME_ENTER( data_size )                  )\n        goto Exit;\n\n      poff   = idx->offsets;\n      p      = (FT_Byte*)stream->cursor;\n      p_end  = p + data_size;\n\n      switch ( offsize )\n      {\n      case 1:\n        for ( ; p < p_end; p++, poff++ )\n          poff[0] = p[0];\n        break;\n\n      case 2:\n        for ( ; p < p_end; p += 2, poff++ )\n          poff[0] = FT_PEEK_USHORT( p );\n        break;\n\n      case 3:\n        for ( ; p < p_end; p += 3, poff++ )\n          poff[0] = FT_PEEK_OFF3( p );\n        break;\n\n      default:\n        for ( ; p < p_end; p += 4, poff++ )\n          poff[0] = FT_PEEK_ULONG( p );\n      }\n\n      FT_FRAME_EXIT();\n    }\n\n  Exit:\n    if ( error )\n      FT_FREE( idx->offsets );\n\n    return error;\n  }\n\n\n  /* Allocate a table containing pointers to an index's elements. */\n  /* The `pool' argument makes this function convert the index    */\n  /* entries to C-style strings (this is, NULL-terminated).       */\n  static FT_Error\n  cff_index_get_pointers( CFF_Index   idx,\n                          FT_Byte***  table,\n                          FT_Byte**   pool )\n  {\n    FT_Error   error     = FT_Err_Ok;\n    FT_Memory  memory    = idx->stream->memory;\n\n    FT_Byte**  t         = NULL;\n    FT_Byte*   new_bytes = NULL;\n\n\n    *table = NULL;\n\n    if ( idx->offsets == NULL )\n    {\n      error = cff_index_load_offsets( idx );\n      if ( error )\n        goto Exit;\n    }\n\n    if ( idx->count > 0                                        &&\n         !FT_NEW_ARRAY( t, idx->count + 1 )                    &&\n         ( !pool || !FT_ALLOC( new_bytes,\n                               idx->data_size + idx->count ) ) )\n    {\n      FT_ULong  n, cur_offset;\n      FT_ULong  extra = 0;\n      FT_Byte*  org_bytes = idx->bytes;\n\n\n      /* at this point, `idx->offsets' can't be NULL */\n      cur_offset = idx->offsets[0] - 1;\n\n      /* sanity check */\n      if ( cur_offset != 0 )\n      {\n        FT_TRACE0(( \"cff_index_get_pointers:\"\n                    \" invalid first offset value %d set to zero\\n\",\n                    cur_offset ));\n        cur_offset = 0;\n      }\n\n      if ( !pool )\n        t[0] = org_bytes + cur_offset;\n      else\n        t[0] = new_bytes + cur_offset;\n\n      for ( n = 1; n <= idx->count; n++ )\n      {\n        FT_ULong  next_offset = idx->offsets[n] - 1;\n\n\n        /* two sanity checks for invalid offset tables */\n        if ( next_offset < cur_offset )\n          next_offset = cur_offset;\n        else if ( next_offset > idx->data_size )\n          next_offset = idx->data_size;\n\n        if ( !pool )\n          t[n] = org_bytes + next_offset;\n        else\n        {\n          t[n] = new_bytes + next_offset + extra;\n\n          if ( next_offset != cur_offset )\n          {\n            FT_MEM_COPY( t[n - 1], org_bytes + cur_offset, t[n] - t[n - 1] );\n            t[n][0] = '\\0';\n            t[n]   += 1;\n            extra++;\n          }\n        }\n\n        cur_offset = next_offset;\n      }\n      *table = t;\n\n      if ( pool )\n        *pool = new_bytes;\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  cff_index_access_element( CFF_Index  idx,\n                            FT_UInt    element,\n                            FT_Byte**  pbytes,\n                            FT_ULong*  pbyte_len )\n  {\n    FT_Error  error = FT_Err_Ok;\n\n\n    if ( idx && idx->count > element )\n    {\n      /* compute start and end offsets */\n      FT_Stream  stream = idx->stream;\n      FT_ULong   off1, off2 = 0;\n\n\n      /* load offsets from file or the offset table */\n      if ( !idx->offsets )\n      {\n        FT_ULong  pos = element * idx->off_size;\n\n\n        if ( FT_STREAM_SEEK( idx->start + 3 + pos ) )\n          goto Exit;\n\n        off1 = cff_index_read_offset( idx, &error );\n        if ( error )\n          goto Exit;\n\n        if ( off1 != 0 )\n        {\n          do\n          {\n            element++;\n            off2 = cff_index_read_offset( idx, &error );\n          }\n          while ( off2 == 0 && element < idx->count );\n        }\n      }\n      else   /* use offsets table */\n      {\n        off1 = idx->offsets[element];\n        if ( off1 )\n        {\n          do\n          {\n            element++;\n            off2 = idx->offsets[element];\n\n          } while ( off2 == 0 && element < idx->count );\n        }\n      }\n\n      /* XXX: should check off2 does not exceed the end of this entry; */\n      /*      at present, only truncate off2 at the end of this stream */\n      if ( off2 > stream->size + 1                    ||\n           idx->data_offset > stream->size - off2 + 1 )\n      {\n        FT_ERROR(( \"cff_index_access_element:\"\n                   \" offset to next entry (%d)\"\n                   \" exceeds the end of stream (%d)\\n\",\n                   off2, stream->size - idx->data_offset + 1 ));\n        off2 = stream->size - idx->data_offset + 1;\n      }\n\n      /* access element */\n      if ( off1 && off2 > off1 )\n      {\n        *pbyte_len = off2 - off1;\n\n        if ( idx->bytes )\n        {\n          /* this index was completely loaded in memory, that's easy */\n          *pbytes = idx->bytes + off1 - 1;\n        }\n        else\n        {\n          /* this index is still on disk/file, access it through a frame */\n          if ( FT_STREAM_SEEK( idx->data_offset + off1 - 1 ) ||\n               FT_FRAME_EXTRACT( off2 - off1, *pbytes )      )\n            goto Exit;\n        }\n      }\n      else\n      {\n        /* empty index element */\n        *pbytes    = 0;\n        *pbyte_len = 0;\n      }\n    }\n    else\n      error = FT_THROW( Invalid_Argument );\n\n  Exit:\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cff_index_forget_element( CFF_Index  idx,\n                            FT_Byte**  pbytes )\n  {\n    if ( idx->bytes == 0 )\n    {\n      FT_Stream  stream = idx->stream;\n\n\n      FT_FRAME_RELEASE( *pbytes );\n    }\n  }\n\n\n  /* get an entry from Name INDEX */\n  FT_LOCAL_DEF( FT_String* )\n  cff_index_get_name( CFF_Font  font,\n                      FT_UInt   element )\n  {\n    CFF_Index   idx = &font->name_index;\n    FT_Memory   memory = idx->stream->memory;\n    FT_Byte*    bytes;\n    FT_ULong    byte_len;\n    FT_Error    error;\n    FT_String*  name = 0;\n\n\n    error = cff_index_access_element( idx, element, &bytes, &byte_len );\n    if ( error )\n      goto Exit;\n\n    if ( !FT_ALLOC( name, byte_len + 1 ) )\n    {\n      FT_MEM_COPY( name, bytes, byte_len );\n      name[byte_len] = 0;\n    }\n    cff_index_forget_element( idx, &bytes );\n\n  Exit:\n    return name;\n  }\n\n\n  /* get an entry from String INDEX */\n  FT_LOCAL_DEF( FT_String* )\n  cff_index_get_string( CFF_Font  font,\n                        FT_UInt   element )\n  {\n    return ( element < font->num_strings )\n             ? (FT_String*)font->strings[element]\n             : NULL;\n  }\n\n\n  FT_LOCAL_DEF( FT_String* )\n  cff_index_get_sid_string( CFF_Font  font,\n                            FT_UInt   sid )\n  {\n    /* value 0xFFFFU indicates a missing dictionary entry */\n    if ( sid == 0xFFFFU )\n      return NULL;\n\n    /* if it is not a standard string, return it */\n    if ( sid > 390 )\n      return cff_index_get_string( font, sid - 391 );\n\n    /* CID-keyed CFF fonts don't have glyph names */\n    if ( !font->psnames )\n      return NULL;\n\n    /* this is a standard string */\n    return (FT_String *)font->psnames->adobe_std_strings( sid );\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***   FD Select table support                                         ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  static void\n  CFF_Done_FD_Select( CFF_FDSelect  fdselect,\n                      FT_Stream     stream )\n  {\n    if ( fdselect->data )\n      FT_FRAME_RELEASE( fdselect->data );\n\n    fdselect->data_size   = 0;\n    fdselect->format      = 0;\n    fdselect->range_count = 0;\n  }\n\n\n  static FT_Error\n  CFF_Load_FD_Select( CFF_FDSelect  fdselect,\n                      FT_UInt       num_glyphs,\n                      FT_Stream     stream,\n                      FT_ULong      offset )\n  {\n    FT_Error  error;\n    FT_Byte   format;\n    FT_UInt   num_ranges;\n\n\n    /* read format */\n    if ( FT_STREAM_SEEK( offset ) || FT_READ_BYTE( format ) )\n      goto Exit;\n\n    fdselect->format      = format;\n    fdselect->cache_count = 0;   /* clear cache */\n\n    switch ( format )\n    {\n    case 0:     /* format 0, that's simple */\n      fdselect->data_size = num_glyphs;\n      goto Load_Data;\n\n    case 3:     /* format 3, a tad more complex */\n      if ( FT_READ_USHORT( num_ranges ) )\n        goto Exit;\n\n      if ( !num_ranges )\n      {\n        FT_TRACE0(( \"CFF_Load_FD_Select: empty FDSelect array\\n\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Exit;\n      }\n\n      fdselect->data_size = num_ranges * 3 + 2;\n\n    Load_Data:\n      if ( FT_FRAME_EXTRACT( fdselect->data_size, fdselect->data ) )\n        goto Exit;\n      break;\n\n    default:    /* hmm... that's wrong */\n      error = FT_THROW( Invalid_File_Format );\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Byte )\n  cff_fd_select_get( CFF_FDSelect  fdselect,\n                     FT_UInt       glyph_index )\n  {\n    FT_Byte  fd = 0;\n\n\n    switch ( fdselect->format )\n    {\n    case 0:\n      fd = fdselect->data[glyph_index];\n      break;\n\n    case 3:\n      /* first, compare to the cache */\n      if ( (FT_UInt)( glyph_index - fdselect->cache_first ) <\n                        fdselect->cache_count )\n      {\n        fd = fdselect->cache_fd;\n        break;\n      }\n\n      /* then, look up the ranges array */\n      {\n        FT_Byte*  p       = fdselect->data;\n        FT_Byte*  p_limit = p + fdselect->data_size;\n        FT_Byte   fd2;\n        FT_UInt   first, limit;\n\n\n        first = FT_NEXT_USHORT( p );\n        do\n        {\n          if ( glyph_index < first )\n            break;\n\n          fd2   = *p++;\n          limit = FT_NEXT_USHORT( p );\n\n          if ( glyph_index < limit )\n          {\n            fd = fd2;\n\n            /* update cache */\n            fdselect->cache_first = first;\n            fdselect->cache_count = limit - first;\n            fdselect->cache_fd    = fd2;\n            break;\n          }\n          first = limit;\n\n        } while ( p < p_limit );\n      }\n      break;\n\n    default:\n      ;\n    }\n\n    return fd;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /***                                                                   ***/\n  /***   CFF font support                                                ***/\n  /***                                                                   ***/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static FT_Error\n  cff_charset_compute_cids( CFF_Charset  charset,\n                            FT_UInt      num_glyphs,\n                            FT_Memory    memory )\n  {\n    FT_Error   error   = FT_Err_Ok;\n    FT_UInt    i;\n    FT_Long    j;\n    FT_UShort  max_cid = 0;\n\n\n    if ( charset->max_cid > 0 )\n      goto Exit;\n\n    for ( i = 0; i < num_glyphs; i++ )\n    {\n      if ( charset->sids[i] > max_cid )\n        max_cid = charset->sids[i];\n    }\n\n    if ( FT_NEW_ARRAY( charset->cids, (FT_ULong)max_cid + 1 ) )\n      goto Exit;\n\n    /* When multiple GIDs map to the same CID, we choose the lowest */\n    /* GID.  This is not described in any spec, but it matches the  */\n    /* behaviour of recent Acroread versions.                       */\n    for ( j = num_glyphs - 1; j >= 0 ; j-- )\n      charset->cids[charset->sids[j]] = (FT_UShort)j;\n\n    charset->max_cid    = max_cid;\n    charset->num_glyphs = num_glyphs;\n\n  Exit:\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_UInt )\n  cff_charset_cid_to_gindex( CFF_Charset  charset,\n                             FT_UInt      cid )\n  {\n    FT_UInt  result = 0;\n\n\n    if ( cid <= charset->max_cid )\n      result = charset->cids[cid];\n\n    return result;\n  }\n\n\n  static void\n  cff_charset_free_cids( CFF_Charset  charset,\n                         FT_Memory    memory )\n  {\n    FT_FREE( charset->cids );\n    charset->max_cid = 0;\n  }\n\n\n  static void\n  cff_charset_done( CFF_Charset  charset,\n                    FT_Stream    stream )\n  {\n    FT_Memory  memory = stream->memory;\n\n\n    cff_charset_free_cids( charset, memory );\n\n    FT_FREE( charset->sids );\n    charset->format = 0;\n    charset->offset = 0;\n  }\n\n\n  static FT_Error\n  cff_charset_load( CFF_Charset  charset,\n                    FT_UInt      num_glyphs,\n                    FT_Stream    stream,\n                    FT_ULong     base_offset,\n                    FT_ULong     offset,\n                    FT_Bool      invert )\n  {\n    FT_Memory  memory = stream->memory;\n    FT_Error   error  = FT_Err_Ok;\n    FT_UShort  glyph_sid;\n\n\n    /* If the the offset is greater than 2, we have to parse the */\n    /* charset table.                                            */\n    if ( offset > 2 )\n    {\n      FT_UInt  j;\n\n\n      charset->offset = base_offset + offset;\n\n      /* Get the format of the table. */\n      if ( FT_STREAM_SEEK( charset->offset ) ||\n           FT_READ_BYTE( charset->format )   )\n        goto Exit;\n\n      /* Allocate memory for sids. */\n      if ( FT_NEW_ARRAY( charset->sids, num_glyphs ) )\n        goto Exit;\n\n      /* assign the .notdef glyph */\n      charset->sids[0] = 0;\n\n      switch ( charset->format )\n      {\n      case 0:\n        if ( num_glyphs > 0 )\n        {\n          if ( FT_FRAME_ENTER( ( num_glyphs - 1 ) * 2 ) )\n            goto Exit;\n\n          for ( j = 1; j < num_glyphs; j++ )\n            charset->sids[j] = FT_GET_USHORT();\n\n          FT_FRAME_EXIT();\n        }\n        break;\n\n      case 1:\n      case 2:\n        {\n          FT_UInt  nleft;\n          FT_UInt  i;\n\n\n          j = 1;\n\n          while ( j < num_glyphs )\n          {\n            /* Read the first glyph sid of the range. */\n            if ( FT_READ_USHORT( glyph_sid ) )\n              goto Exit;\n\n            /* Read the number of glyphs in the range.  */\n            if ( charset->format == 2 )\n            {\n              if ( FT_READ_USHORT( nleft ) )\n                goto Exit;\n            }\n            else\n            {\n              if ( FT_READ_BYTE( nleft ) )\n                goto Exit;\n            }\n\n            /* try to rescue some of the SIDs if `nleft' is too large */\n            if ( glyph_sid > 0xFFFFL - nleft )\n            {\n              FT_ERROR(( \"cff_charset_load: invalid SID range trimmed\"\n                         \" nleft=%d -> %d\\n\", nleft, 0xFFFFL - glyph_sid ));\n              nleft = ( FT_UInt )( 0xFFFFL - glyph_sid );\n            }\n\n            /* Fill in the range of sids -- `nleft + 1' glyphs. */\n            for ( i = 0; j < num_glyphs && i <= nleft; i++, j++, glyph_sid++ )\n              charset->sids[j] = glyph_sid;\n          }\n        }\n        break;\n\n      default:\n        FT_ERROR(( \"cff_charset_load: invalid table format\\n\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Exit;\n      }\n    }\n    else\n    {\n      /* Parse default tables corresponding to offset == 0, 1, or 2.  */\n      /* CFF specification intimates the following:                   */\n      /*                                                              */\n      /* In order to use a predefined charset, the following must be  */\n      /* true: The charset constructed for the glyphs in the font's   */\n      /* charstrings dictionary must match the predefined charset in  */\n      /* the first num_glyphs.                                        */\n\n      charset->offset = offset;  /* record charset type */\n\n      switch ( (FT_UInt)offset )\n      {\n      case 0:\n        if ( num_glyphs > 229 )\n        {\n          FT_ERROR(( \"cff_charset_load: implicit charset larger than\\n\"\n                     \"predefined charset (Adobe ISO-Latin)\\n\" ));\n          error = FT_THROW( Invalid_File_Format );\n          goto Exit;\n        }\n\n        /* Allocate memory for sids. */\n        if ( FT_NEW_ARRAY( charset->sids, num_glyphs ) )\n          goto Exit;\n\n        /* Copy the predefined charset into the allocated memory. */\n        FT_ARRAY_COPY( charset->sids, cff_isoadobe_charset, num_glyphs );\n\n        break;\n\n      case 1:\n        if ( num_glyphs > 166 )\n        {\n          FT_ERROR(( \"cff_charset_load: implicit charset larger than\\n\"\n                     \"predefined charset (Adobe Expert)\\n\" ));\n          error = FT_THROW( Invalid_File_Format );\n          goto Exit;\n        }\n\n        /* Allocate memory for sids. */\n        if ( FT_NEW_ARRAY( charset->sids, num_glyphs ) )\n          goto Exit;\n\n        /* Copy the predefined charset into the allocated memory.     */\n        FT_ARRAY_COPY( charset->sids, cff_expert_charset, num_glyphs );\n\n        break;\n\n      case 2:\n        if ( num_glyphs > 87 )\n        {\n          FT_ERROR(( \"cff_charset_load: implicit charset larger than\\n\"\n                     \"predefined charset (Adobe Expert Subset)\\n\" ));\n          error = FT_THROW( Invalid_File_Format );\n          goto Exit;\n        }\n\n        /* Allocate memory for sids. */\n        if ( FT_NEW_ARRAY( charset->sids, num_glyphs ) )\n          goto Exit;\n\n        /* Copy the predefined charset into the allocated memory.     */\n        FT_ARRAY_COPY( charset->sids, cff_expertsubset_charset, num_glyphs );\n\n        break;\n\n      default:\n        error = FT_THROW( Invalid_File_Format );\n        goto Exit;\n      }\n    }\n\n    /* we have to invert the `sids' array for subsetted CID-keyed fonts */\n    if ( invert )\n      error = cff_charset_compute_cids( charset, num_glyphs, memory );\n\n  Exit:\n    /* Clean up if there was an error. */\n    if ( error )\n    {\n      FT_FREE( charset->sids );\n      FT_FREE( charset->cids );\n      charset->format = 0;\n      charset->offset = 0;\n      charset->sids   = 0;\n    }\n\n    return error;\n  }\n\n\n  static void\n  cff_encoding_done( CFF_Encoding  encoding )\n  {\n    encoding->format = 0;\n    encoding->offset = 0;\n    encoding->count  = 0;\n  }\n\n\n  static FT_Error\n  cff_encoding_load( CFF_Encoding  encoding,\n                     CFF_Charset   charset,\n                     FT_UInt       num_glyphs,\n                     FT_Stream     stream,\n                     FT_ULong      base_offset,\n                     FT_ULong      offset )\n  {\n    FT_Error   error = FT_Err_Ok;\n    FT_UInt    count;\n    FT_UInt    j;\n    FT_UShort  glyph_sid;\n    FT_UInt    glyph_code;\n\n\n    /* Check for charset->sids.  If we do not have this, we fail. */\n    if ( !charset->sids )\n    {\n      error = FT_THROW( Invalid_File_Format );\n      goto Exit;\n    }\n\n    /* Zero out the code to gid/sid mappings. */\n    for ( j = 0; j < 256; j++ )\n    {\n      encoding->sids [j] = 0;\n      encoding->codes[j] = 0;\n    }\n\n    /* Note: The encoding table in a CFF font is indexed by glyph index;  */\n    /* the first encoded glyph index is 1.  Hence, we read the character  */\n    /* code (`glyph_code') at index j and make the assignment:            */\n    /*                                                                    */\n    /*    encoding->codes[glyph_code] = j + 1                             */\n    /*                                                                    */\n    /* We also make the assignment:                                       */\n    /*                                                                    */\n    /*    encoding->sids[glyph_code] = charset->sids[j + 1]               */\n    /*                                                                    */\n    /* This gives us both a code to GID and a code to SID mapping.        */\n\n    if ( offset > 1 )\n    {\n      encoding->offset = base_offset + offset;\n\n      /* we need to parse the table to determine its size */\n      if ( FT_STREAM_SEEK( encoding->offset ) ||\n           FT_READ_BYTE( encoding->format )   ||\n           FT_READ_BYTE( count )              )\n        goto Exit;\n\n      switch ( encoding->format & 0x7F )\n      {\n      case 0:\n        {\n          FT_Byte*  p;\n\n\n          /* By convention, GID 0 is always \".notdef\" and is never */\n          /* coded in the font.  Hence, the number of codes found  */\n          /* in the table is `count+1'.                            */\n          /*                                                       */\n          encoding->count = count + 1;\n\n          if ( FT_FRAME_ENTER( count ) )\n            goto Exit;\n\n          p = (FT_Byte*)stream->cursor;\n\n          for ( j = 1; j <= count; j++ )\n          {\n            glyph_code = *p++;\n\n            /* Make sure j is not too big. */\n            if ( j < num_glyphs )\n            {\n              /* Assign code to GID mapping. */\n              encoding->codes[glyph_code] = (FT_UShort)j;\n\n              /* Assign code to SID mapping. */\n              encoding->sids[glyph_code] = charset->sids[j];\n            }\n          }\n\n          FT_FRAME_EXIT();\n        }\n        break;\n\n      case 1:\n        {\n          FT_UInt  nleft;\n          FT_UInt  i = 1;\n          FT_UInt  k;\n\n\n          encoding->count = 0;\n\n          /* Parse the Format1 ranges. */\n          for ( j = 0;  j < count; j++, i += nleft )\n          {\n            /* Read the first glyph code of the range. */\n            if ( FT_READ_BYTE( glyph_code ) )\n              goto Exit;\n\n            /* Read the number of codes in the range. */\n            if ( FT_READ_BYTE( nleft ) )\n              goto Exit;\n\n            /* Increment nleft, so we read `nleft + 1' codes/sids. */\n            nleft++;\n\n            /* compute max number of character codes */\n            if ( (FT_UInt)nleft > encoding->count )\n              encoding->count = nleft;\n\n            /* Fill in the range of codes/sids. */\n            for ( k = i; k < nleft + i; k++, glyph_code++ )\n            {\n              /* Make sure k is not too big. */\n              if ( k < num_glyphs && glyph_code < 256 )\n              {\n                /* Assign code to GID mapping. */\n                encoding->codes[glyph_code] = (FT_UShort)k;\n\n                /* Assign code to SID mapping. */\n                encoding->sids[glyph_code] = charset->sids[k];\n              }\n            }\n          }\n\n          /* simple check; one never knows what can be found in a font */\n          if ( encoding->count > 256 )\n            encoding->count = 256;\n        }\n        break;\n\n      default:\n        FT_ERROR(( \"cff_encoding_load: invalid table format\\n\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Exit;\n      }\n\n      /* Parse supplemental encodings, if any. */\n      if ( encoding->format & 0x80 )\n      {\n        FT_UInt  gindex;\n\n\n        /* count supplements */\n        if ( FT_READ_BYTE( count ) )\n          goto Exit;\n\n        for ( j = 0; j < count; j++ )\n        {\n          /* Read supplemental glyph code. */\n          if ( FT_READ_BYTE( glyph_code ) )\n            goto Exit;\n\n          /* Read the SID associated with this glyph code. */\n          if ( FT_READ_USHORT( glyph_sid ) )\n            goto Exit;\n\n          /* Assign code to SID mapping. */\n          encoding->sids[glyph_code] = glyph_sid;\n\n          /* First, look up GID which has been assigned to */\n          /* SID glyph_sid.                                */\n          for ( gindex = 0; gindex < num_glyphs; gindex++ )\n          {\n            if ( charset->sids[gindex] == glyph_sid )\n            {\n              encoding->codes[glyph_code] = (FT_UShort)gindex;\n              break;\n            }\n          }\n        }\n      }\n    }\n    else\n    {\n      /* We take into account the fact a CFF font can use a predefined */\n      /* encoding without containing all of the glyphs encoded by this */\n      /* encoding (see the note at the end of section 12 in the CFF    */\n      /* specification).                                               */\n\n      switch ( (FT_UInt)offset )\n      {\n      case 0:\n        /* First, copy the code to SID mapping. */\n        FT_ARRAY_COPY( encoding->sids, cff_standard_encoding, 256 );\n        goto Populate;\n\n      case 1:\n        /* First, copy the code to SID mapping. */\n        FT_ARRAY_COPY( encoding->sids, cff_expert_encoding, 256 );\n\n      Populate:\n        /* Construct code to GID mapping from code to SID mapping */\n        /* and charset.                                           */\n\n        encoding->count = 0;\n\n        error = cff_charset_compute_cids( charset, num_glyphs,\n                                          stream->memory );\n        if ( error )\n          goto Exit;\n\n        for ( j = 0; j < 256; j++ )\n        {\n          FT_UInt  sid = encoding->sids[j];\n          FT_UInt  gid = 0;\n\n\n          if ( sid )\n            gid = cff_charset_cid_to_gindex( charset, sid );\n\n          if ( gid != 0 )\n          {\n            encoding->codes[j] = (FT_UShort)gid;\n            encoding->count    = j + 1;\n          }\n          else\n          {\n            encoding->codes[j] = 0;\n            encoding->sids [j] = 0;\n          }\n        }\n        break;\n\n      default:\n        FT_ERROR(( \"cff_encoding_load: invalid table format\\n\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Exit;\n      }\n    }\n\n  Exit:\n\n    /* Clean up if there was an error. */\n    return error;\n  }\n\n\n  static FT_Error\n  cff_subfont_load( CFF_SubFont  font,\n                    CFF_Index    idx,\n                    FT_UInt      font_index,\n                    FT_Stream    stream,\n                    FT_ULong     base_offset,\n                    FT_Library   library )\n  {\n    FT_Error         error;\n    CFF_ParserRec    parser;\n    FT_Byte*         dict = NULL;\n    FT_ULong         dict_len;\n    CFF_FontRecDict  top  = &font->font_dict;\n    CFF_Private      priv = &font->private_dict;\n\n\n    cff_parser_init( &parser, CFF_CODE_TOPDICT, &font->font_dict, library );\n\n    /* set defaults */\n    FT_MEM_ZERO( top, sizeof ( *top ) );\n\n    top->underline_position  = -( 100L << 16 );\n    top->underline_thickness = 50L << 16;\n    top->charstring_type     = 2;\n    top->font_matrix.xx      = 0x10000L;\n    top->font_matrix.yy      = 0x10000L;\n    top->cid_count           = 8720;\n\n    /* we use the implementation specific SID value 0xFFFF to indicate */\n    /* missing entries                                                 */\n    top->version             = 0xFFFFU;\n    top->notice              = 0xFFFFU;\n    top->copyright           = 0xFFFFU;\n    top->full_name           = 0xFFFFU;\n    top->family_name         = 0xFFFFU;\n    top->weight              = 0xFFFFU;\n    top->embedded_postscript = 0xFFFFU;\n\n    top->cid_registry        = 0xFFFFU;\n    top->cid_ordering        = 0xFFFFU;\n    top->cid_font_name       = 0xFFFFU;\n\n    error = cff_index_access_element( idx, font_index, &dict, &dict_len );\n    if ( !error )\n    {\n      FT_TRACE4(( \" top dictionary:\\n\" ));\n      error = cff_parser_run( &parser, dict, dict + dict_len );\n    }\n\n    cff_index_forget_element( idx, &dict );\n\n    if ( error )\n      goto Exit;\n\n    /* if it is a CID font, we stop there */\n    if ( top->cid_registry != 0xFFFFU )\n      goto Exit;\n\n    /* parse the private dictionary, if any */\n    if ( top->private_offset && top->private_size )\n    {\n      /* set defaults */\n      FT_MEM_ZERO( priv, sizeof ( *priv ) );\n\n      priv->blue_shift       = 7;\n      priv->blue_fuzz        = 1;\n      priv->lenIV            = -1;\n      priv->expansion_factor = (FT_Fixed)( 0.06 * 0x10000L );\n      priv->blue_scale       = (FT_Fixed)( 0.039625 * 0x10000L * 1000 );\n\n      cff_parser_init( &parser, CFF_CODE_PRIVATE, priv, library );\n\n      if ( FT_STREAM_SEEK( base_offset + font->font_dict.private_offset ) ||\n           FT_FRAME_ENTER( font->font_dict.private_size )                 )\n        goto Exit;\n\n      FT_TRACE4(( \" private dictionary:\\n\" ));\n      error = cff_parser_run( &parser,\n                              (FT_Byte*)stream->cursor,\n                              (FT_Byte*)stream->limit );\n      FT_FRAME_EXIT();\n      if ( error )\n        goto Exit;\n\n      /* ensure that `num_blue_values' is even */\n      priv->num_blue_values &= ~1;\n    }\n\n    /* read the local subrs, if any */\n    if ( priv->local_subrs_offset )\n    {\n      if ( FT_STREAM_SEEK( base_offset + top->private_offset +\n                           priv->local_subrs_offset ) )\n        goto Exit;\n\n      error = cff_index_init( &font->local_subrs_index, stream, 1 );\n      if ( error )\n        goto Exit;\n\n      error = cff_index_get_pointers( &font->local_subrs_index,\n                                      &font->local_subrs, NULL );\n      if ( error )\n        goto Exit;\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  static void\n  cff_subfont_done( FT_Memory    memory,\n                    CFF_SubFont  subfont )\n  {\n    if ( subfont )\n    {\n      cff_index_done( &subfont->local_subrs_index );\n      FT_FREE( subfont->local_subrs );\n    }\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  cff_font_load( FT_Library library,\n                 FT_Stream  stream,\n                 FT_Int     face_index,\n                 CFF_Font   font,\n                 FT_Bool    pure_cff )\n  {\n    static const FT_Frame_Field  cff_header_fields[] =\n    {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  CFF_FontRec\n\n      FT_FRAME_START( 4 ),\n        FT_FRAME_BYTE( version_major ),\n        FT_FRAME_BYTE( version_minor ),\n        FT_FRAME_BYTE( header_size ),\n        FT_FRAME_BYTE( absolute_offsize ),\n      FT_FRAME_END\n    };\n\n    FT_Error         error;\n    FT_Memory        memory = stream->memory;\n    FT_ULong         base_offset;\n    CFF_FontRecDict  dict;\n    CFF_IndexRec     string_index;\n    FT_Int           subfont_index;\n\n\n    FT_ZERO( font );\n    FT_ZERO( &string_index );\n\n    font->stream = stream;\n    font->memory = memory;\n    dict         = &font->top_font.font_dict;\n    base_offset  = FT_STREAM_POS();\n\n    /* read CFF font header */\n    if ( FT_STREAM_READ_FIELDS( cff_header_fields, font ) )\n      goto Exit;\n\n    /* check format */\n    if ( font->version_major   != 1 ||\n         font->header_size      < 4 ||\n         font->absolute_offsize > 4 )\n    {\n      FT_TRACE2(( \"  not a CFF font header\\n\" ));\n      error = FT_THROW( Unknown_File_Format );\n      goto Exit;\n    }\n\n    /* skip the rest of the header */\n    if ( FT_STREAM_SKIP( font->header_size - 4 ) )\n      goto Exit;\n\n    /* read the name, top dict, string and global subrs index */\n    if ( FT_SET_ERROR( cff_index_init( &font->name_index,\n                                       stream, 0 ) )                  ||\n         FT_SET_ERROR( cff_index_init( &font->font_dict_index,\n                                       stream, 0 ) )                  ||\n         FT_SET_ERROR( cff_index_init( &string_index,\n                                       stream, 1 ) )                  ||\n         FT_SET_ERROR( cff_index_init( &font->global_subrs_index,\n                                       stream, 1 ) )                  ||\n         FT_SET_ERROR( cff_index_get_pointers( &string_index,\n                                               &font->strings,\n                                               &font->string_pool ) ) )\n      goto Exit;\n\n    font->num_strings = string_index.count;\n\n    if ( pure_cff )\n    {\n      /* well, we don't really forget the `disabled' fonts... */\n      subfont_index = face_index;\n\n      if ( subfont_index >= (FT_Int)font->name_index.count )\n      {\n        FT_ERROR(( \"cff_font_load:\"\n                   \" invalid subfont index for pure CFF font (%d)\\n\",\n                   subfont_index ));\n        error = FT_THROW( Invalid_Argument );\n        goto Exit;\n      }\n\n      font->num_faces = font->name_index.count;\n    }\n    else\n    {\n      subfont_index = 0;\n\n      if ( font->name_index.count > 1 )\n      {\n        FT_ERROR(( \"cff_font_load:\"\n                   \" invalid CFF font with multiple subfonts\\n\"\n                   \"              \"\n                   \" in SFNT wrapper\\n\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Exit;\n      }\n    }\n\n    /* in case of a font format check, simply exit now */\n    if ( face_index < 0 )\n      goto Exit;\n\n    /* now, parse the top-level font dictionary */\n    FT_TRACE4(( \"parsing top-level\\n\" ));\n    error = cff_subfont_load( &font->top_font,\n                              &font->font_dict_index,\n                              subfont_index,\n                              stream,\n                              base_offset,\n                              library );\n    if ( error )\n      goto Exit;\n\n    if ( FT_STREAM_SEEK( base_offset + dict->charstrings_offset ) )\n      goto Exit;\n\n    error = cff_index_init( &font->charstrings_index, stream, 0 );\n    if ( error )\n      goto Exit;\n\n    /* now, check for a CID font */\n    if ( dict->cid_registry != 0xFFFFU )\n    {\n      CFF_IndexRec  fd_index;\n      CFF_SubFont   sub = NULL;\n      FT_UInt       idx;\n\n\n      /* this is a CID-keyed font, we must now allocate a table of */\n      /* sub-fonts, then load each of them separately              */\n      if ( FT_STREAM_SEEK( base_offset + dict->cid_fd_array_offset ) )\n        goto Exit;\n\n      error = cff_index_init( &fd_index, stream, 0 );\n      if ( error )\n        goto Exit;\n\n      if ( fd_index.count > CFF_MAX_CID_FONTS )\n      {\n        FT_TRACE0(( \"cff_font_load: FD array too large in CID font\\n\" ));\n        goto Fail_CID;\n      }\n\n      /* allocate & read each font dict independently */\n      font->num_subfonts = fd_index.count;\n      if ( FT_NEW_ARRAY( sub, fd_index.count ) )\n        goto Fail_CID;\n\n      /* set up pointer table */\n      for ( idx = 0; idx < fd_index.count; idx++ )\n        font->subfonts[idx] = sub + idx;\n\n      /* now load each subfont independently */\n      for ( idx = 0; idx < fd_index.count; idx++ )\n      {\n        sub = font->subfonts[idx];\n        FT_TRACE4(( \"parsing subfont %u\\n\", idx ));\n        error = cff_subfont_load( sub, &fd_index, idx,\n                                  stream, base_offset, library );\n        if ( error )\n          goto Fail_CID;\n      }\n\n      /* now load the FD Select array */\n      error = CFF_Load_FD_Select( &font->fd_select,\n                                  font->charstrings_index.count,\n                                  stream,\n                                  base_offset + dict->cid_fd_select_offset );\n\n    Fail_CID:\n      cff_index_done( &fd_index );\n\n      if ( error )\n        goto Exit;\n    }\n    else\n      font->num_subfonts = 0;\n\n    /* read the charstrings index now */\n    if ( dict->charstrings_offset == 0 )\n    {\n      FT_ERROR(( \"cff_font_load: no charstrings offset\\n\" ));\n      error = FT_THROW( Invalid_File_Format );\n      goto Exit;\n    }\n\n    font->num_glyphs = font->charstrings_index.count;\n\n    error = cff_index_get_pointers( &font->global_subrs_index,\n                                    &font->global_subrs, NULL );\n\n    if ( error )\n      goto Exit;\n\n    /* read the Charset and Encoding tables if available */\n    if ( font->num_glyphs > 0 )\n    {\n      FT_Bool  invert = FT_BOOL( dict->cid_registry != 0xFFFFU && pure_cff );\n\n\n      error = cff_charset_load( &font->charset, font->num_glyphs, stream,\n                                base_offset, dict->charset_offset, invert );\n      if ( error )\n        goto Exit;\n\n      /* CID-keyed CFFs don't have an encoding */\n      if ( dict->cid_registry == 0xFFFFU )\n      {\n        error = cff_encoding_load( &font->encoding,\n                                   &font->charset,\n                                   font->num_glyphs,\n                                   stream,\n                                   base_offset,\n                                   dict->encoding_offset );\n        if ( error )\n          goto Exit;\n      }\n    }\n\n    /* get the font name (/CIDFontName for CID-keyed fonts, */\n    /* /FontName otherwise)                                 */\n    font->font_name = cff_index_get_name( font, subfont_index );\n\n  Exit:\n    cff_index_done( &string_index );\n\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cff_font_done( CFF_Font  font )\n  {\n    FT_Memory  memory = font->memory;\n    FT_UInt    idx;\n\n\n    cff_index_done( &font->global_subrs_index );\n    cff_index_done( &font->font_dict_index );\n    cff_index_done( &font->name_index );\n    cff_index_done( &font->charstrings_index );\n\n    /* release font dictionaries, but only if working with */\n    /* a CID keyed CFF font                                */\n    if ( font->num_subfonts > 0 )\n    {\n      for ( idx = 0; idx < font->num_subfonts; idx++ )\n        cff_subfont_done( memory, font->subfonts[idx] );\n\n      /* the subfonts array has been allocated as a single block */\n      FT_FREE( font->subfonts[0] );\n    }\n\n    cff_encoding_done( &font->encoding );\n    cff_charset_done( &font->charset, font->stream );\n\n    cff_subfont_done( memory, &font->top_font );\n\n    CFF_Done_FD_Select( &font->fd_select, font->stream );\n\n    FT_FREE( font->font_info );\n\n    FT_FREE( font->font_name );\n    FT_FREE( font->global_subrs );\n    FT_FREE( font->strings );\n    FT_FREE( font->string_pool );\n\n    if ( font->cf2_instance.finalizer )\n    {\n      font->cf2_instance.finalizer( font->cf2_instance.data );\n      FT_FREE( font->cf2_instance.data );\n    }\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cffload.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cffload.h                                                              */\n/*                                                                         */\n/*    OpenType & CFF data/program tables loader (specification).           */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2007, 2008, 2010 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CFFLOAD_H__\n#define __CFFLOAD_H__\n\n\n#include <ft2build.h>\n#include \"cfftypes.h\"\n\n\nFT_BEGIN_HEADER\n\n  FT_LOCAL( FT_UShort )\n  cff_get_standard_encoding( FT_UInt  charcode );\n\n\n  FT_LOCAL( FT_String* )\n  cff_index_get_string( CFF_Font  font,\n                        FT_UInt   element );\n\n  FT_LOCAL( FT_String* )\n  cff_index_get_sid_string( CFF_Font  font,\n                            FT_UInt   sid );\n\n\n  FT_LOCAL( FT_Error )\n  cff_index_access_element( CFF_Index  idx,\n                            FT_UInt    element,\n                            FT_Byte**  pbytes,\n                            FT_ULong*  pbyte_len );\n\n  FT_LOCAL( void )\n  cff_index_forget_element( CFF_Index  idx,\n                            FT_Byte**  pbytes );\n\n  FT_LOCAL( FT_String* )\n  cff_index_get_name( CFF_Font  font,\n                      FT_UInt   element );\n\n\n  FT_LOCAL( FT_UInt )\n  cff_charset_cid_to_gindex( CFF_Charset  charset,\n                             FT_UInt      cid );\n\n\n  FT_LOCAL( FT_Error )\n  cff_font_load( FT_Library library,\n                 FT_Stream  stream,\n                 FT_Int     face_index,\n                 CFF_Font   font,\n                 FT_Bool    pure_cff );\n\n  FT_LOCAL( void )\n  cff_font_done( CFF_Font  font );\n\n\n  FT_LOCAL( FT_Byte )\n  cff_fd_select_get( CFF_FDSelect  fdselect,\n                     FT_UInt       glyph_index );\n\n\nFT_END_HEADER\n\n#endif /* __CFFLOAD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cffobjs.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cffobjs.c                                                              */\n/*                                                                         */\n/*    OpenType objects manager (body).                                     */\n/*                                                                         */\n/*  Copyright 1996-2014 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_CALC_H\n#include FT_INTERNAL_STREAM_H\n#include FT_ERRORS_H\n#include FT_TRUETYPE_IDS_H\n#include FT_TRUETYPE_TAGS_H\n#include FT_INTERNAL_SFNT_H\n#include FT_CFF_DRIVER_H\n\n#include \"cffobjs.h\"\n#include \"cffload.h\"\n#include \"cffcmap.h\"\n#include \"cffpic.h\"\n\n#include \"cfferrs.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_cffobjs\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                            SIZE FUNCTIONS                             */\n  /*                                                                       */\n  /*  Note that we store the global hints in the size's `internal' root    */\n  /*  field.                                                               */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  static PSH_Globals_Funcs\n  cff_size_get_globals_funcs( CFF_Size  size )\n  {\n    CFF_Face          face     = (CFF_Face)size->root.face;\n    CFF_Font          font     = (CFF_Font)face->extra.data;\n    PSHinter_Service  pshinter = font->pshinter;\n    FT_Module         module;\n\n\n    module = FT_Get_Module( size->root.face->driver->root.library,\n                            \"pshinter\" );\n    return ( module && pshinter && pshinter->get_globals_funcs )\n           ? pshinter->get_globals_funcs( module )\n           : 0;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cff_size_done( FT_Size  cffsize )        /* CFF_Size */\n  {\n    CFF_Size      size     = (CFF_Size)cffsize;\n    CFF_Face      face     = (CFF_Face)size->root.face;\n    CFF_Font      font     = (CFF_Font)face->extra.data;\n    CFF_Internal  internal = (CFF_Internal)cffsize->internal;\n\n\n    if ( internal )\n    {\n      PSH_Globals_Funcs  funcs;\n\n\n      funcs = cff_size_get_globals_funcs( size );\n      if ( funcs )\n      {\n        FT_UInt  i;\n\n\n        funcs->destroy( internal->topfont );\n\n        for ( i = font->num_subfonts; i > 0; i-- )\n          funcs->destroy( internal->subfonts[i - 1] );\n      }\n\n      /* `internal' is freed by destroy_size (in ftobjs.c) */\n    }\n  }\n\n\n  /* CFF and Type 1 private dictionaries have slightly different      */\n  /* structures; we need to synthesize a Type 1 dictionary on the fly */\n\n  static void\n  cff_make_private_dict( CFF_SubFont  subfont,\n                         PS_Private   priv )\n  {\n    CFF_Private  cpriv = &subfont->private_dict;\n    FT_UInt      n, count;\n\n\n    FT_MEM_ZERO( priv, sizeof ( *priv ) );\n\n    count = priv->num_blue_values = cpriv->num_blue_values;\n    for ( n = 0; n < count; n++ )\n      priv->blue_values[n] = (FT_Short)cpriv->blue_values[n];\n\n    count = priv->num_other_blues = cpriv->num_other_blues;\n    for ( n = 0; n < count; n++ )\n      priv->other_blues[n] = (FT_Short)cpriv->other_blues[n];\n\n    count = priv->num_family_blues = cpriv->num_family_blues;\n    for ( n = 0; n < count; n++ )\n      priv->family_blues[n] = (FT_Short)cpriv->family_blues[n];\n\n    count = priv->num_family_other_blues = cpriv->num_family_other_blues;\n    for ( n = 0; n < count; n++ )\n      priv->family_other_blues[n] = (FT_Short)cpriv->family_other_blues[n];\n\n    priv->blue_scale = cpriv->blue_scale;\n    priv->blue_shift = (FT_Int)cpriv->blue_shift;\n    priv->blue_fuzz  = (FT_Int)cpriv->blue_fuzz;\n\n    priv->standard_width[0]  = (FT_UShort)cpriv->standard_width;\n    priv->standard_height[0] = (FT_UShort)cpriv->standard_height;\n\n    count = priv->num_snap_widths = cpriv->num_snap_widths;\n    for ( n = 0; n < count; n++ )\n      priv->snap_widths[n] = (FT_Short)cpriv->snap_widths[n];\n\n    count = priv->num_snap_heights = cpriv->num_snap_heights;\n    for ( n = 0; n < count; n++ )\n      priv->snap_heights[n] = (FT_Short)cpriv->snap_heights[n];\n\n    priv->force_bold     = cpriv->force_bold;\n    priv->language_group = cpriv->language_group;\n    priv->lenIV          = cpriv->lenIV;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  cff_size_init( FT_Size  cffsize )         /* CFF_Size */\n  {\n    CFF_Size           size  = (CFF_Size)cffsize;\n    FT_Error           error = FT_Err_Ok;\n    PSH_Globals_Funcs  funcs = cff_size_get_globals_funcs( size );\n\n\n    if ( funcs )\n    {\n      CFF_Face      face     = (CFF_Face)cffsize->face;\n      CFF_Font      font     = (CFF_Font)face->extra.data;\n      CFF_Internal  internal = NULL;\n\n      PS_PrivateRec  priv;\n      FT_Memory      memory = cffsize->face->memory;\n\n      FT_UInt  i;\n\n\n      if ( FT_NEW( internal ) )\n        goto Exit;\n\n      cff_make_private_dict( &font->top_font, &priv );\n      error = funcs->create( cffsize->face->memory, &priv,\n                             &internal->topfont );\n      if ( error )\n        goto Exit;\n\n      for ( i = font->num_subfonts; i > 0; i-- )\n      {\n        CFF_SubFont  sub = font->subfonts[i - 1];\n\n\n        cff_make_private_dict( sub, &priv );\n        error = funcs->create( cffsize->face->memory, &priv,\n                               &internal->subfonts[i - 1] );\n        if ( error )\n          goto Exit;\n      }\n\n      cffsize->internal = (FT_Size_Internal)(void*)internal;\n    }\n\n    size->strike_index = 0xFFFFFFFFUL;\n\n  Exit:\n    return error;\n  }\n\n\n#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n\n  FT_LOCAL_DEF( FT_Error )\n  cff_size_select( FT_Size   size,\n                   FT_ULong  strike_index )\n  {\n    CFF_Size           cffsize = (CFF_Size)size;\n    PSH_Globals_Funcs  funcs;\n\n\n    cffsize->strike_index = strike_index;\n\n    FT_Select_Metrics( size->face, strike_index );\n\n    funcs = cff_size_get_globals_funcs( cffsize );\n\n    if ( funcs )\n    {\n      CFF_Face      face     = (CFF_Face)size->face;\n      CFF_Font      font     = (CFF_Font)face->extra.data;\n      CFF_Internal  internal = (CFF_Internal)size->internal;\n\n      FT_ULong  top_upm  = font->top_font.font_dict.units_per_em;\n      FT_UInt   i;\n\n\n      funcs->set_scale( internal->topfont,\n                        size->metrics.x_scale, size->metrics.y_scale,\n                        0, 0 );\n\n      for ( i = font->num_subfonts; i > 0; i-- )\n      {\n        CFF_SubFont  sub     = font->subfonts[i - 1];\n        FT_ULong     sub_upm = sub->font_dict.units_per_em;\n        FT_Pos       x_scale, y_scale;\n\n\n        if ( top_upm != sub_upm )\n        {\n          x_scale = FT_MulDiv( size->metrics.x_scale, top_upm, sub_upm );\n          y_scale = FT_MulDiv( size->metrics.y_scale, top_upm, sub_upm );\n        }\n        else\n        {\n          x_scale = size->metrics.x_scale;\n          y_scale = size->metrics.y_scale;\n        }\n\n        funcs->set_scale( internal->subfonts[i - 1],\n                          x_scale, y_scale, 0, 0 );\n      }\n    }\n\n    return FT_Err_Ok;\n  }\n\n#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */\n\n\n  FT_LOCAL_DEF( FT_Error )\n  cff_size_request( FT_Size          size,\n                    FT_Size_Request  req )\n  {\n    CFF_Size           cffsize = (CFF_Size)size;\n    PSH_Globals_Funcs  funcs;\n\n\n#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n\n    if ( FT_HAS_FIXED_SIZES( size->face ) )\n    {\n      CFF_Face      cffface = (CFF_Face)size->face;\n      SFNT_Service  sfnt    = (SFNT_Service)cffface->sfnt;\n      FT_ULong      strike_index;\n\n\n      if ( sfnt->set_sbit_strike( cffface, req, &strike_index ) )\n        cffsize->strike_index = 0xFFFFFFFFUL;\n      else\n        return cff_size_select( size, strike_index );\n    }\n\n#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */\n\n    FT_Request_Metrics( size->face, req );\n\n    funcs = cff_size_get_globals_funcs( cffsize );\n\n    if ( funcs )\n    {\n      CFF_Face      cffface  = (CFF_Face)size->face;\n      CFF_Font      font     = (CFF_Font)cffface->extra.data;\n      CFF_Internal  internal = (CFF_Internal)size->internal;\n\n      FT_ULong  top_upm  = font->top_font.font_dict.units_per_em;\n      FT_UInt   i;\n\n\n      funcs->set_scale( internal->topfont,\n                        size->metrics.x_scale, size->metrics.y_scale,\n                        0, 0 );\n\n      for ( i = font->num_subfonts; i > 0; i-- )\n      {\n        CFF_SubFont  sub     = font->subfonts[i - 1];\n        FT_ULong     sub_upm = sub->font_dict.units_per_em;\n        FT_Pos       x_scale, y_scale;\n\n\n        if ( top_upm != sub_upm )\n        {\n          x_scale = FT_MulDiv( size->metrics.x_scale, top_upm, sub_upm );\n          y_scale = FT_MulDiv( size->metrics.y_scale, top_upm, sub_upm );\n        }\n        else\n        {\n          x_scale = size->metrics.x_scale;\n          y_scale = size->metrics.y_scale;\n        }\n\n        funcs->set_scale( internal->subfonts[i - 1],\n                          x_scale, y_scale, 0, 0 );\n      }\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                            SLOT  FUNCTIONS                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n  FT_LOCAL_DEF( void )\n  cff_slot_done( FT_GlyphSlot  slot )\n  {\n    slot->internal->glyph_hints = 0;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  cff_slot_init( FT_GlyphSlot  slot )\n  {\n    CFF_Face          face     = (CFF_Face)slot->face;\n    CFF_Font          font     = (CFF_Font)face->extra.data;\n    PSHinter_Service  pshinter = font->pshinter;\n\n\n    if ( pshinter )\n    {\n      FT_Module  module;\n\n\n      module = FT_Get_Module( slot->face->driver->root.library,\n                              \"pshinter\" );\n      if ( module )\n      {\n        T2_Hints_Funcs  funcs;\n\n\n        funcs = pshinter->get_t2_funcs( module );\n        slot->internal->glyph_hints = (void*)funcs;\n      }\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                           FACE  FUNCTIONS                             */\n  /*                                                                       */\n  /*************************************************************************/\n\n  static FT_String*\n  cff_strcpy( FT_Memory         memory,\n              const FT_String*  source )\n  {\n    FT_Error    error;\n    FT_String*  result;\n\n\n    (void)FT_STRDUP( result, source );\n\n    FT_UNUSED( error );\n\n    return result;\n  }\n\n\n  /* Strip all subset prefixes of the form `ABCDEF+'.  Usually, there */\n  /* is only one, but font names like `APCOOG+JFABTD+FuturaBQ-Bold'   */\n  /* have been seen in the wild.                                      */\n\n  static void\n  remove_subset_prefix( FT_String*  name )\n  {\n    FT_Int32  idx             = 0;\n    FT_Int32  length          = (FT_Int32)strlen( name ) + 1;\n    FT_Bool   continue_search = 1;\n\n\n    while ( continue_search )\n    {\n      if ( length >= 7 && name[6] == '+' )\n      {\n        for ( idx = 0; idx < 6; idx++ )\n        {\n          /* ASCII uppercase letters */\n          if ( !( 'A' <= name[idx] && name[idx] <= 'Z' ) )\n            continue_search = 0;\n        }\n\n        if ( continue_search )\n        {\n          for ( idx = 7; idx < length; idx++ )\n            name[idx - 7] = name[idx];\n          length -= 7;\n        }\n      }\n      else\n        continue_search = 0;\n    }\n  }\n\n\n  /* Remove the style part from the family name (if present). */\n\n  static void\n  remove_style( FT_String*        family_name,\n                const FT_String*  style_name )\n  {\n    FT_Int32  family_name_length, style_name_length;\n\n\n    family_name_length = (FT_Int32)strlen( family_name );\n    style_name_length  = (FT_Int32)strlen( style_name );\n\n    if ( family_name_length > style_name_length )\n    {\n      FT_Int  idx;\n\n\n      for ( idx = 1; idx <= style_name_length; ++idx )\n      {\n        if ( family_name[family_name_length - idx] !=\n             style_name[style_name_length - idx] )\n          break;\n      }\n\n      if ( idx > style_name_length )\n      {\n        /* family_name ends with style_name; remove it */\n        idx = family_name_length - style_name_length - 1;\n\n        /* also remove special characters     */\n        /* between real family name and style */\n        while ( idx > 0                     &&\n                ( family_name[idx] == '-' ||\n                  family_name[idx] == ' ' ||\n                  family_name[idx] == '_' ||\n                  family_name[idx] == '+' ) )\n          --idx;\n\n        if ( idx > 0 )\n          family_name[idx + 1] = '\\0';\n      }\n    }\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  cff_face_init( FT_Stream      stream,\n                 FT_Face        cffface,        /* CFF_Face */\n                 FT_Int         face_index,\n                 FT_Int         num_params,\n                 FT_Parameter*  params )\n  {\n    CFF_Face            face        = (CFF_Face)cffface;\n    FT_Error            error;\n    SFNT_Service        sfnt;\n    FT_Service_PsCMaps  psnames;\n    PSHinter_Service    pshinter;\n    FT_Bool             pure_cff    = 1;\n    FT_Bool             sfnt_format = 0;\n    FT_Library          library     = cffface->driver->root.library;\n\n\n    sfnt = (SFNT_Service)FT_Get_Module_Interface(\n             library, \"sfnt\" );\n    if ( !sfnt )\n    {\n      FT_ERROR(( \"cff_face_init: cannot access `sfnt' module\\n\" ));\n      error = FT_THROW( Missing_Module );\n      goto Exit;\n    }\n\n    FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );\n\n    pshinter = (PSHinter_Service)FT_Get_Module_Interface(\n                 library, \"pshinter\" );\n\n    FT_TRACE2(( \"CFF driver\\n\" ));\n\n    /* create input stream from resource */\n    if ( FT_STREAM_SEEK( 0 ) )\n      goto Exit;\n\n    /* check whether we have a valid OpenType file */\n    error = sfnt->init_face( stream, face, face_index, num_params, params );\n    if ( !error )\n    {\n      if ( face->format_tag != TTAG_OTTO )  /* `OTTO'; OpenType/CFF font */\n      {\n        FT_TRACE2(( \"  not an OpenType/CFF font\\n\" ));\n        error = FT_THROW( Unknown_File_Format );\n        goto Exit;\n      }\n\n      /* if we are performing a simple font format check, exit immediately */\n      if ( face_index < 0 )\n        return FT_Err_Ok;\n\n      sfnt_format = 1;\n\n      /* now, the font can be either an OpenType/CFF font, or an SVG CEF */\n      /* font; in the latter case it doesn't have a `head' table         */\n      error = face->goto_table( face, TTAG_head, stream, 0 );\n      if ( !error )\n      {\n        pure_cff = 0;\n\n        /* load font directory */\n        error = sfnt->load_face( stream, face, face_index,\n                                 num_params, params );\n        if ( error )\n          goto Exit;\n      }\n      else\n      {\n        /* load the `cmap' table explicitly */\n        error = sfnt->load_cmap( face, stream );\n        if ( error )\n          goto Exit;\n      }\n\n      /* now load the CFF part of the file */\n      error = face->goto_table( face, TTAG_CFF, stream, 0 );\n      if ( error )\n        goto Exit;\n    }\n    else\n    {\n      /* rewind to start of file; we are going to load a pure-CFF font */\n      if ( FT_STREAM_SEEK( 0 ) )\n        goto Exit;\n      error = FT_Err_Ok;\n    }\n\n    /* now load and parse the CFF table in the file */\n    {\n      CFF_Font         cff = NULL;\n      CFF_FontRecDict  dict;\n      FT_Memory        memory = cffface->memory;\n      FT_Int32         flags;\n      FT_UInt          i;\n\n\n      if ( FT_NEW( cff ) )\n        goto Exit;\n\n      face->extra.data = cff;\n      error = cff_font_load( library, stream, face_index, cff, pure_cff );\n      if ( error )\n        goto Exit;\n\n      cff->pshinter = pshinter;\n      cff->psnames  = psnames;\n\n      cffface->face_index = face_index;\n\n      /* Complement the root flags with some interesting information. */\n      /* Note that this is only necessary for pure CFF and CEF fonts; */\n      /* SFNT based fonts use the `name' table instead.               */\n\n      cffface->num_glyphs = cff->num_glyphs;\n\n      dict = &cff->top_font.font_dict;\n\n      /* we need the `PSNames' module for CFF and CEF formats */\n      /* which aren't CID-keyed                               */\n      if ( dict->cid_registry == 0xFFFFU && !psnames )\n      {\n        FT_ERROR(( \"cff_face_init:\"\n                   \" cannot open CFF & CEF fonts\\n\"\n                   \"              \"\n                   \" without the `PSNames' module\\n\" ));\n        error = FT_THROW( Missing_Module );\n        goto Exit;\n      }\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n      {\n        FT_UInt     idx;\n        FT_String*  s;\n\n\n        FT_TRACE4(( \"SIDs\\n\" ));\n\n        /* dump string index, including default strings for convenience */\n        for ( idx = 0; idx < cff->num_strings + 390; idx++ )\n        {\n          s = cff_index_get_sid_string( cff, idx );\n          if ( s )\n            FT_TRACE4((\"  %5d %s\\n\", idx, s ));\n        }\n      }\n#endif /* FT_DEBUG_LEVEL_TRACE */\n\n      if ( !dict->has_font_matrix )\n        dict->units_per_em = pure_cff ? 1000 : face->root.units_per_EM;\n\n      /* Normalize the font matrix so that `matrix->xx' is 1; the */\n      /* scaling is done with `units_per_em' then (at this point, */\n      /* it already contains the scaling factor, but without      */\n      /* normalization of the matrix).                            */\n      /*                                                          */\n      /* Note that the offsets must be expressed in integer font  */\n      /* units.                                                   */\n\n      {\n        FT_Matrix*  matrix = &dict->font_matrix;\n        FT_Vector*  offset = &dict->font_offset;\n        FT_ULong*   upm    = &dict->units_per_em;\n        FT_Fixed    temp   = FT_ABS( matrix->yy );\n\n\n        if ( temp != 0x10000L )\n        {\n          *upm = FT_DivFix( *upm, temp );\n\n          matrix->xx = FT_DivFix( matrix->xx, temp );\n          matrix->yx = FT_DivFix( matrix->yx, temp );\n          matrix->xy = FT_DivFix( matrix->xy, temp );\n          matrix->yy = FT_DivFix( matrix->yy, temp );\n          offset->x  = FT_DivFix( offset->x,  temp );\n          offset->y  = FT_DivFix( offset->y,  temp );\n        }\n\n        offset->x >>= 16;\n        offset->y >>= 16;\n      }\n\n      for ( i = cff->num_subfonts; i > 0; i-- )\n      {\n        CFF_FontRecDict  sub = &cff->subfonts[i - 1]->font_dict;\n        CFF_FontRecDict  top = &cff->top_font.font_dict;\n\n        FT_Matrix*  matrix;\n        FT_Vector*  offset;\n        FT_ULong*   upm;\n        FT_Fixed    temp;\n\n\n        if ( sub->has_font_matrix )\n        {\n          FT_Long  scaling;\n\n\n          /* if we have a top-level matrix, */\n          /* concatenate the subfont matrix */\n\n          if ( top->has_font_matrix )\n          {\n            if ( top->units_per_em > 1 && sub->units_per_em > 1 )\n              scaling = FT_MIN( top->units_per_em, sub->units_per_em );\n            else\n              scaling = 1;\n\n            FT_Matrix_Multiply_Scaled( &top->font_matrix,\n                                       &sub->font_matrix,\n                                       scaling );\n            FT_Vector_Transform_Scaled( &sub->font_offset,\n                                        &top->font_matrix,\n                                        scaling );\n\n            sub->units_per_em = FT_MulDiv( sub->units_per_em,\n                                           top->units_per_em,\n                                           scaling );\n          }\n        }\n        else\n        {\n          sub->font_matrix = top->font_matrix;\n          sub->font_offset = top->font_offset;\n\n          sub->units_per_em = top->units_per_em;\n        }\n\n        matrix = &sub->font_matrix;\n        offset = &sub->font_offset;\n        upm    = &sub->units_per_em;\n        temp   = FT_ABS( matrix->yy );\n\n        if ( temp != 0x10000L )\n        {\n          *upm = FT_DivFix( *upm, temp );\n\n          matrix->xx = FT_DivFix( matrix->xx, temp );\n          matrix->yx = FT_DivFix( matrix->yx, temp );\n          matrix->xy = FT_DivFix( matrix->xy, temp );\n          matrix->yy = FT_DivFix( matrix->yy, temp );\n          offset->x  = FT_DivFix( offset->x,  temp );\n          offset->y  = FT_DivFix( offset->y,  temp );\n        }\n\n        offset->x >>= 16;\n        offset->y >>= 16;\n      }\n\n      if ( pure_cff )\n      {\n        char*  style_name = NULL;\n\n\n        /* set up num_faces */\n        cffface->num_faces = cff->num_faces;\n\n        /* compute number of glyphs */\n        if ( dict->cid_registry != 0xFFFFU )\n          cffface->num_glyphs = cff->charset.max_cid + 1;\n        else\n          cffface->num_glyphs = cff->charstrings_index.count;\n\n        /* set global bbox, as well as EM size */\n        cffface->bbox.xMin =   dict->font_bbox.xMin            >> 16;\n        cffface->bbox.yMin =   dict->font_bbox.yMin            >> 16;\n        /* no `U' suffix here to 0xFFFF! */\n        cffface->bbox.xMax = ( dict->font_bbox.xMax + 0xFFFF ) >> 16;\n        cffface->bbox.yMax = ( dict->font_bbox.yMax + 0xFFFF ) >> 16;\n\n        cffface->units_per_EM = (FT_UShort)( dict->units_per_em );\n\n        cffface->ascender  = (FT_Short)( cffface->bbox.yMax );\n        cffface->descender = (FT_Short)( cffface->bbox.yMin );\n\n        cffface->height = (FT_Short)( ( cffface->units_per_EM * 12 ) / 10 );\n        if ( cffface->height < cffface->ascender - cffface->descender )\n          cffface->height = (FT_Short)( cffface->ascender - cffface->descender );\n\n        cffface->underline_position  =\n          (FT_Short)( dict->underline_position >> 16 );\n        cffface->underline_thickness =\n          (FT_Short)( dict->underline_thickness >> 16 );\n\n        /* retrieve font family & style name */\n        cffface->family_name = cff_index_get_name( cff, face_index );\n        if ( cffface->family_name )\n        {\n          char*  full   = cff_index_get_sid_string( cff,\n                                                    dict->full_name );\n          char*  fullp  = full;\n          char*  family = cffface->family_name;\n          char*  family_name = NULL;\n\n\n          remove_subset_prefix( cffface->family_name );\n\n          if ( dict->family_name )\n          {\n            family_name = cff_index_get_sid_string( cff,\n                                                    dict->family_name );\n            if ( family_name )\n              family = family_name;\n          }\n\n          /* We try to extract the style name from the full name.   */\n          /* We need to ignore spaces and dashes during the search. */\n          if ( full && family )\n          {\n            while ( *fullp )\n            {\n              /* skip common characters at the start of both strings */\n              if ( *fullp == *family )\n              {\n                family++;\n                fullp++;\n                continue;\n              }\n\n              /* ignore spaces and dashes in full name during comparison */\n              if ( *fullp == ' ' || *fullp == '-' )\n              {\n                fullp++;\n                continue;\n              }\n\n              /* ignore spaces and dashes in family name during comparison */\n              if ( *family == ' ' || *family == '-' )\n              {\n                family++;\n                continue;\n              }\n\n              if ( !*family && *fullp )\n              {\n                /* The full name begins with the same characters as the  */\n                /* family name, with spaces and dashes removed.  In this */\n                /* case, the remaining string in `fullp' will be used as */\n                /* the style name.                                       */\n                style_name = cff_strcpy( memory, fullp );\n\n                /* remove the style part from the family name (if present) */\n                remove_style( cffface->family_name, style_name );\n              }\n              break;\n            }\n          }\n        }\n        else\n        {\n          char  *cid_font_name =\n                   cff_index_get_sid_string( cff,\n                                             dict->cid_font_name );\n\n\n          /* do we have a `/FontName' for a CID-keyed font? */\n          if ( cid_font_name )\n            cffface->family_name = cff_strcpy( memory, cid_font_name );\n        }\n\n        if ( style_name )\n          cffface->style_name = style_name;\n        else\n          /* assume \"Regular\" style if we don't know better */\n          cffface->style_name = cff_strcpy( memory, (char *)\"Regular\" );\n\n        /*******************************************************************/\n        /*                                                                 */\n        /* Compute face flags.                                             */\n        /*                                                                 */\n        flags = FT_FACE_FLAG_SCALABLE   | /* scalable outlines */\n                FT_FACE_FLAG_HORIZONTAL | /* horizontal data   */\n                FT_FACE_FLAG_HINTER;      /* has native hinter */\n\n        if ( sfnt_format )\n          flags |= FT_FACE_FLAG_SFNT;\n\n        /* fixed width font? */\n        if ( dict->is_fixed_pitch )\n          flags |= FT_FACE_FLAG_FIXED_WIDTH;\n\n  /* XXX: WE DO NOT SUPPORT KERNING METRICS IN THE GPOS TABLE FOR NOW */\n#if 0\n        /* kerning available? */\n        if ( face->kern_pairs )\n          flags |= FT_FACE_FLAG_KERNING;\n#endif\n\n        cffface->face_flags |= flags;\n\n        /*******************************************************************/\n        /*                                                                 */\n        /* Compute style flags.                                            */\n        /*                                                                 */\n        flags = 0;\n\n        if ( dict->italic_angle )\n          flags |= FT_STYLE_FLAG_ITALIC;\n\n        {\n          char  *weight = cff_index_get_sid_string( cff,\n                                                    dict->weight );\n\n\n          if ( weight )\n            if ( !ft_strcmp( weight, \"Bold\"  ) ||\n                 !ft_strcmp( weight, \"Black\" ) )\n              flags |= FT_STYLE_FLAG_BOLD;\n        }\n\n        /* double check */\n        if ( !(flags & FT_STYLE_FLAG_BOLD) && cffface->style_name )\n          if ( !ft_strncmp( cffface->style_name, \"Bold\", 4 )  ||\n               !ft_strncmp( cffface->style_name, \"Black\", 5 ) )\n            flags |= FT_STYLE_FLAG_BOLD;\n\n        cffface->style_flags = flags;\n      }\n\n\n#ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES\n      /* CID-keyed CFF fonts don't have glyph names -- the SFNT loader */\n      /* has unset this flag because of the 3.0 `post' table.          */\n      if ( dict->cid_registry == 0xFFFFU )\n        cffface->face_flags |= FT_FACE_FLAG_GLYPH_NAMES;\n#endif\n\n      if ( dict->cid_registry != 0xFFFFU && pure_cff )\n        cffface->face_flags |= FT_FACE_FLAG_CID_KEYED;\n\n\n      /*******************************************************************/\n      /*                                                                 */\n      /* Compute char maps.                                              */\n      /*                                                                 */\n\n      /* Try to synthesize a Unicode charmap if there is none available */\n      /* already.  If an OpenType font contains a Unicode \"cmap\", we    */\n      /* will use it, whatever be in the CFF part of the file.          */\n      {\n        FT_CharMapRec  cmaprec;\n        FT_CharMap     cmap;\n        FT_UInt        nn;\n        CFF_Encoding   encoding = &cff->encoding;\n\n\n        for ( nn = 0; nn < (FT_UInt)cffface->num_charmaps; nn++ )\n        {\n          cmap = cffface->charmaps[nn];\n\n          /* Windows Unicode? */\n          if ( cmap->platform_id == TT_PLATFORM_MICROSOFT &&\n               cmap->encoding_id == TT_MS_ID_UNICODE_CS   )\n            goto Skip_Unicode;\n\n          /* Apple Unicode platform id? */\n          if ( cmap->platform_id == TT_PLATFORM_APPLE_UNICODE )\n            goto Skip_Unicode; /* Apple Unicode */\n        }\n\n        /* since CID-keyed fonts don't contain glyph names, we can't */\n        /* construct a cmap                                          */\n        if ( pure_cff && cff->top_font.font_dict.cid_registry != 0xFFFFU )\n          goto Exit;\n\n        /* we didn't find a Unicode charmap -- synthesize one */\n        cmaprec.face        = cffface;\n        cmaprec.platform_id = TT_PLATFORM_MICROSOFT;\n        cmaprec.encoding_id = TT_MS_ID_UNICODE_CS;\n        cmaprec.encoding    = FT_ENCODING_UNICODE;\n\n        nn = (FT_UInt)cffface->num_charmaps;\n\n        error = FT_CMap_New( &CFF_CMAP_UNICODE_CLASS_REC_GET, NULL,\n                             &cmaprec, NULL );\n        if ( error                                      &&\n             FT_ERR_NEQ( error, No_Unicode_Glyph_Name ) )\n          goto Exit;\n        error = FT_Err_Ok;\n\n        /* if no Unicode charmap was previously selected, select this one */\n        if ( cffface->charmap == NULL && nn != (FT_UInt)cffface->num_charmaps )\n          cffface->charmap = cffface->charmaps[nn];\n\n      Skip_Unicode:\n        if ( encoding->count > 0 )\n        {\n          FT_CMap_Class  clazz;\n\n\n          cmaprec.face        = cffface;\n          cmaprec.platform_id = TT_PLATFORM_ADOBE;  /* Adobe platform id */\n\n          if ( encoding->offset == 0 )\n          {\n            cmaprec.encoding_id = TT_ADOBE_ID_STANDARD;\n            cmaprec.encoding    = FT_ENCODING_ADOBE_STANDARD;\n            clazz               = &CFF_CMAP_ENCODING_CLASS_REC_GET;\n          }\n          else if ( encoding->offset == 1 )\n          {\n            cmaprec.encoding_id = TT_ADOBE_ID_EXPERT;\n            cmaprec.encoding    = FT_ENCODING_ADOBE_EXPERT;\n            clazz               = &CFF_CMAP_ENCODING_CLASS_REC_GET;\n          }\n          else\n          {\n            cmaprec.encoding_id = TT_ADOBE_ID_CUSTOM;\n            cmaprec.encoding    = FT_ENCODING_ADOBE_CUSTOM;\n            clazz               = &CFF_CMAP_ENCODING_CLASS_REC_GET;\n          }\n\n          error = FT_CMap_New( clazz, NULL, &cmaprec, NULL );\n        }\n      }\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cff_face_done( FT_Face  cffface )         /* CFF_Face */\n  {\n    CFF_Face      face = (CFF_Face)cffface;\n    FT_Memory     memory;\n    SFNT_Service  sfnt;\n\n\n    if ( !face )\n      return;\n\n    memory = cffface->memory;\n    sfnt   = (SFNT_Service)face->sfnt;\n\n    if ( sfnt )\n      sfnt->done_face( face );\n\n    {\n      CFF_Font  cff = (CFF_Font)face->extra.data;\n\n\n      if ( cff )\n      {\n        cff_font_done( cff );\n        FT_FREE( face->extra.data );\n      }\n    }\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  cff_driver_init( FT_Module  module )        /* CFF_Driver */\n  {\n    CFF_Driver  driver = (CFF_Driver)module;\n\n\n    /* set default property values, cf. `ftcffdrv.h' */\n#ifdef CFF_CONFIG_OPTION_OLD_ENGINE\n    driver->hinting_engine = FT_CFF_HINTING_FREETYPE;\n#else\n    driver->hinting_engine = FT_CFF_HINTING_ADOBE;\n#endif\n\n    driver->no_stem_darkening = FALSE;\n\n    driver->darken_params[0] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1;\n    driver->darken_params[1] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1;\n    driver->darken_params[2] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2;\n    driver->darken_params[3] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2;\n    driver->darken_params[4] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3;\n    driver->darken_params[5] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3;\n    driver->darken_params[6] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4;\n    driver->darken_params[7] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4;\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cff_driver_done( FT_Module  module )        /* CFF_Driver */\n  {\n    FT_UNUSED( module );\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cffobjs.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cffobjs.h                                                              */\n/*                                                                         */\n/*    OpenType objects manager (specification).                            */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006-2008, 2013 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CFFOBJS_H__\n#define __CFFOBJS_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n#include \"cfftypes.h\"\n#include FT_INTERNAL_TRUETYPE_TYPES_H\n#include FT_SERVICE_POSTSCRIPT_CMAPS_H\n#include FT_INTERNAL_POSTSCRIPT_HINTS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    CFF_Driver                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an OpenType driver object.                             */\n  /*                                                                       */\n  typedef struct CFF_DriverRec_*  CFF_Driver;\n\n  typedef TT_Face  CFF_Face;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    CFF_Size                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an OpenType size object.                               */\n  /*                                                                       */\n  typedef struct  CFF_SizeRec_\n  {\n    FT_SizeRec  root;\n    FT_ULong    strike_index;    /* 0xFFFFFFFF to indicate invalid */\n\n  } CFF_SizeRec, *CFF_Size;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    CFF_GlyphSlot                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an OpenType glyph slot object.                         */\n  /*                                                                       */\n  typedef struct  CFF_GlyphSlotRec_\n  {\n    FT_GlyphSlotRec  root;\n\n    FT_Bool          hint;\n    FT_Bool          scaled;\n\n    FT_Fixed         x_scale;\n    FT_Fixed         y_scale;\n\n  } CFF_GlyphSlotRec, *CFF_GlyphSlot;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    CFF_Internal                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The interface to the `internal' field of `FT_Size'.                */\n  /*                                                                       */\n  typedef struct  CFF_InternalRec_\n  {\n    PSH_Globals  topfont;\n    PSH_Globals  subfonts[CFF_MAX_CID_FONTS];\n\n  } CFF_InternalRec, *CFF_Internal;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Subglyph transformation record.                                       */\n  /*                                                                       */\n  typedef struct  CFF_Transform_\n  {\n    FT_Fixed    xx, xy;     /* transformation matrix coefficients */\n    FT_Fixed    yx, yy;\n    FT_F26Dot6  ox, oy;     /* offsets        */\n\n  } CFF_Transform;\n\n\n  /***********************************************************************/\n  /*                                                                     */\n  /* CFF driver class.                                                   */\n  /*                                                                     */\n  typedef struct  CFF_DriverRec_\n  {\n    FT_DriverRec  root;\n\n    FT_UInt  hinting_engine;\n    FT_Bool  no_stem_darkening;\n\n    FT_Int  darken_params[8];\n\n  } CFF_DriverRec;\n\n\n  FT_LOCAL( FT_Error )\n  cff_size_init( FT_Size  size );           /* CFF_Size */\n\n  FT_LOCAL( void )\n  cff_size_done( FT_Size  size );           /* CFF_Size */\n\n  FT_LOCAL( FT_Error )\n  cff_size_request( FT_Size          size,\n                    FT_Size_Request  req );\n\n#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n\n  FT_LOCAL( FT_Error )\n  cff_size_select( FT_Size   size,\n                   FT_ULong  strike_index );\n\n#endif\n\n  FT_LOCAL( void )\n  cff_slot_done( FT_GlyphSlot  slot );\n\n  FT_LOCAL( FT_Error )\n  cff_slot_init( FT_GlyphSlot  slot );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Face functions                                                        */\n  /*                                                                       */\n  FT_LOCAL( FT_Error )\n  cff_face_init( FT_Stream      stream,\n                 FT_Face        face,           /* CFF_Face */\n                 FT_Int         face_index,\n                 FT_Int         num_params,\n                 FT_Parameter*  params );\n\n  FT_LOCAL( void )\n  cff_face_done( FT_Face  face );               /* CFF_Face */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Driver functions                                                      */\n  /*                                                                       */\n  FT_LOCAL( FT_Error )\n  cff_driver_init( FT_Module  module );         /* CFF_Driver */\n\n  FT_LOCAL( void )\n  cff_driver_done( FT_Module  module );         /* CFF_Driver */\n\n\nFT_END_HEADER\n\n#endif /* __CFFOBJS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cffparse.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cffparse.c                                                             */\n/*                                                                         */\n/*    CFF token stream parser (body)                                       */\n/*                                                                         */\n/*  Copyright 1996-2004, 2007-2014 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include \"cffparse.h\"\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_DEBUG_H\n\n#include \"cfferrs.h\"\n#include \"cffpic.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_cffparse\n\n\n  FT_LOCAL_DEF( void )\n  cff_parser_init( CFF_Parser  parser,\n                   FT_UInt     code,\n                   void*       object,\n                   FT_Library  library)\n  {\n    FT_MEM_ZERO( parser, sizeof ( *parser ) );\n\n    parser->top         = parser->stack;\n    parser->object_code = code;\n    parser->object      = object;\n    parser->library     = library;\n  }\n\n\n  /* read an integer */\n  static FT_Long\n  cff_parse_integer( FT_Byte*  start,\n                     FT_Byte*  limit )\n  {\n    FT_Byte*  p   = start;\n    FT_Int    v   = *p++;\n    FT_Long   val = 0;\n\n\n    if ( v == 28 )\n    {\n      if ( p + 2 > limit )\n        goto Bad;\n\n      val = (FT_Short)( ( (FT_UShort)p[0] << 8 ) | p[1] );\n    }\n    else if ( v == 29 )\n    {\n      if ( p + 4 > limit )\n        goto Bad;\n\n      val = (FT_Long)( ( (FT_ULong)p[0] << 24 ) |\n                       ( (FT_ULong)p[1] << 16 ) |\n                       ( (FT_ULong)p[2] <<  8 ) |\n                         (FT_ULong)p[3]         );\n    }\n    else if ( v < 247 )\n    {\n      val = v - 139;\n    }\n    else if ( v < 251 )\n    {\n      if ( p + 1 > limit )\n        goto Bad;\n\n      val = ( v - 247 ) * 256 + p[0] + 108;\n    }\n    else\n    {\n      if ( p + 1 > limit )\n        goto Bad;\n\n      val = -( v - 251 ) * 256 - p[0] - 108;\n    }\n\n  Exit:\n    return val;\n\n  Bad:\n    val = 0;\n    FT_TRACE4(( \"!!!END OF DATA:!!!\" ));\n    goto Exit;\n  }\n\n\n  static const FT_Long power_tens[] =\n  {\n    1L,\n    10L,\n    100L,\n    1000L,\n    10000L,\n    100000L,\n    1000000L,\n    10000000L,\n    100000000L,\n    1000000000L\n  };\n\n\n  /* read a real */\n  static FT_Fixed\n  cff_parse_real( FT_Byte*  start,\n                  FT_Byte*  limit,\n                  FT_Long   power_ten,\n                  FT_Long*  scaling )\n  {\n    FT_Byte*  p = start;\n    FT_UInt   nib;\n    FT_UInt   phase;\n\n    FT_Long   result, number, exponent;\n    FT_Int    sign = 0, exponent_sign = 0, have_overflow = 0;\n    FT_Long   exponent_add, integer_length, fraction_length;\n\n\n    if ( scaling )\n      *scaling = 0;\n\n    result = 0;\n\n    number   = 0;\n    exponent = 0;\n\n    exponent_add    = 0;\n    integer_length  = 0;\n    fraction_length = 0;\n\n    /* First of all, read the integer part. */\n    phase = 4;\n\n    for (;;)\n    {\n      /* If we entered this iteration with phase == 4, we need to */\n      /* read a new byte.  This also skips past the initial 0x1E. */\n      if ( phase )\n      {\n        p++;\n\n        /* Make sure we don't read past the end. */\n        if ( p >= limit )\n          goto Bad;\n      }\n\n      /* Get the nibble. */\n      nib   = ( p[0] >> phase ) & 0xF;\n      phase = 4 - phase;\n\n      if ( nib == 0xE )\n        sign = 1;\n      else if ( nib > 9 )\n        break;\n      else\n      {\n        /* Increase exponent if we can't add the digit. */\n        if ( number >= 0xCCCCCCCL )\n          exponent_add++;\n        /* Skip leading zeros. */\n        else if ( nib || number )\n        {\n          integer_length++;\n          number = number * 10 + nib;\n        }\n      }\n    }\n\n    /* Read fraction part, if any. */\n    if ( nib == 0xA )\n      for (;;)\n      {\n        /* If we entered this iteration with phase == 4, we need */\n        /* to read a new byte.                                   */\n        if ( phase )\n        {\n          p++;\n\n          /* Make sure we don't read past the end. */\n          if ( p >= limit )\n            goto Bad;\n        }\n\n        /* Get the nibble. */\n        nib   = ( p[0] >> phase ) & 0xF;\n        phase = 4 - phase;\n        if ( nib >= 10 )\n          break;\n\n        /* Skip leading zeros if possible. */\n        if ( !nib && !number )\n          exponent_add--;\n        /* Only add digit if we don't overflow. */\n        else if ( number < 0xCCCCCCCL && fraction_length < 9 )\n        {\n          fraction_length++;\n          number = number * 10 + nib;\n        }\n      }\n\n    /* Read exponent, if any. */\n    if ( nib == 12 )\n    {\n      exponent_sign = 1;\n      nib           = 11;\n    }\n\n    if ( nib == 11 )\n    {\n      for (;;)\n      {\n        /* If we entered this iteration with phase == 4, */\n        /* we need to read a new byte.                   */\n        if ( phase )\n        {\n          p++;\n\n          /* Make sure we don't read past the end. */\n          if ( p >= limit )\n            goto Bad;\n        }\n\n        /* Get the nibble. */\n        nib   = ( p[0] >> phase ) & 0xF;\n        phase = 4 - phase;\n        if ( nib >= 10 )\n          break;\n\n        /* Arbitrarily limit exponent. */\n        if ( exponent > 1000 )\n          have_overflow = 1;\n        else\n          exponent = exponent * 10 + nib;\n      }\n\n      if ( exponent_sign )\n        exponent = -exponent;\n    }\n\n    if ( !number )\n      goto Exit;\n\n    if ( have_overflow )\n    {\n      if ( exponent_sign )\n        goto Underflow;\n      else\n        goto Overflow;\n    }\n\n    /* We don't check `power_ten' and `exponent_add'. */\n    exponent += power_ten + exponent_add;\n\n    if ( scaling )\n    {\n      /* Only use `fraction_length'. */\n      fraction_length += integer_length;\n      exponent        += integer_length;\n\n      if ( fraction_length <= 5 )\n      {\n        if ( number > 0x7FFFL )\n        {\n          result   = FT_DivFix( number, 10 );\n          *scaling = exponent - fraction_length + 1;\n        }\n        else\n        {\n          if ( exponent > 0 )\n          {\n            FT_Long  new_fraction_length, shift;\n\n\n            /* Make `scaling' as small as possible. */\n            new_fraction_length = FT_MIN( exponent, 5 );\n            shift               = new_fraction_length - fraction_length;\n\n            if ( shift > 0 )\n            {\n              exponent -= new_fraction_length;\n              number   *= power_tens[shift];\n              if ( number > 0x7FFFL )\n              {\n                number   /= 10;\n                exponent += 1;\n              }\n            }\n            else\n              exponent -= fraction_length;\n          }\n          else\n            exponent -= fraction_length;\n\n          result   = (FT_Long)( (FT_ULong)number << 16 );\n          *scaling = exponent;\n        }\n      }\n      else\n      {\n        if ( ( number / power_tens[fraction_length - 5] ) > 0x7FFFL )\n        {\n          result   = FT_DivFix( number, power_tens[fraction_length - 4] );\n          *scaling = exponent - 4;\n        }\n        else\n        {\n          result   = FT_DivFix( number, power_tens[fraction_length - 5] );\n          *scaling = exponent - 5;\n        }\n      }\n    }\n    else\n    {\n      integer_length  += exponent;\n      fraction_length -= exponent;\n\n      if ( integer_length > 5 )\n        goto Overflow;\n      if ( integer_length < -5 )\n        goto Underflow;\n\n      /* Remove non-significant digits. */\n      if ( integer_length < 0 )\n      {\n        number          /= power_tens[-integer_length];\n        fraction_length += integer_length;\n      }\n\n      /* this can only happen if exponent was non-zero */\n      if ( fraction_length == 10 )\n      {\n        number          /= 10;\n        fraction_length -= 1;\n      }\n\n      /* Convert into 16.16 format. */\n      if ( fraction_length > 0 )\n      {\n        if ( ( number / power_tens[fraction_length] ) > 0x7FFFL )\n          goto Exit;\n\n        result = FT_DivFix( number, power_tens[fraction_length] );\n      }\n      else\n      {\n        number *= power_tens[-fraction_length];\n\n        if ( number > 0x7FFFL )\n          goto Overflow;\n\n        result = (FT_Long)( (FT_ULong)number << 16 );\n      }\n    }\n\n  Exit:\n    if ( sign )\n      result = -result;\n\n    return result;\n\n  Overflow:\n    result = 0x7FFFFFFFL;\n    FT_TRACE4(( \"!!!OVERFLOW:!!!\" ));\n    goto Exit;\n\n  Underflow:\n    result = 0;\n    FT_TRACE4(( \"!!!UNDERFLOW:!!!\" ));\n    goto Exit;\n\n  Bad:\n    result = 0;\n    FT_TRACE4(( \"!!!END OF DATA:!!!\" ));\n    goto Exit;\n  }\n\n\n  /* read a number, either integer or real */\n  static FT_Long\n  cff_parse_num( FT_Byte**  d )\n  {\n    return **d == 30 ? ( cff_parse_real( d[0], d[1], 0, NULL ) >> 16 )\n                     :   cff_parse_integer( d[0], d[1] );\n  }\n\n\n  /* read a floating point number, either integer or real */\n  static FT_Fixed\n  do_fixed( FT_Byte**  d,\n            FT_Long    scaling )\n  {\n    if ( **d == 30 )\n      return cff_parse_real( d[0], d[1], scaling, NULL );\n    else\n    {\n      FT_Long  val = cff_parse_integer( d[0], d[1] );\n\n\n      if ( scaling )\n        val *= power_tens[scaling];\n\n      if ( val > 0x7FFF )\n      {\n        val = 0x7FFFFFFFL;\n        goto Overflow;\n      }\n      else if ( val < -0x7FFF )\n      {\n        val = -0x7FFFFFFFL;\n        goto Overflow;\n      }\n\n      return (FT_Long)( (FT_ULong)val << 16 );\n\n    Overflow:\n      FT_TRACE4(( \"!!!OVERFLOW:!!!\" ));\n      return val;\n    }\n  }\n\n\n  /* read a floating point number, either integer or real */\n  static FT_Fixed\n  cff_parse_fixed( FT_Byte**  d )\n  {\n    return do_fixed( d, 0 );\n  }\n\n\n  /* read a floating point number, either integer or real, */\n  /* but return `10^scaling' times the number read in      */\n  static FT_Fixed\n  cff_parse_fixed_scaled( FT_Byte**  d,\n                          FT_Long    scaling )\n  {\n    return do_fixed( d, scaling );\n  }\n\n\n  /* read a floating point number, either integer or real,     */\n  /* and return it as precise as possible -- `scaling' returns */\n  /* the scaling factor (as a power of 10)                     */\n  static FT_Fixed\n  cff_parse_fixed_dynamic( FT_Byte**  d,\n                           FT_Long*   scaling )\n  {\n    FT_ASSERT( scaling );\n\n    if ( **d == 30 )\n      return cff_parse_real( d[0], d[1], 0, scaling );\n    else\n    {\n      FT_Long  number;\n      FT_Int   integer_length;\n\n\n      number = cff_parse_integer( d[0], d[1] );\n\n      if ( number > 0x7FFFL )\n      {\n        for ( integer_length = 5; integer_length < 10; integer_length++ )\n          if ( number < power_tens[integer_length] )\n            break;\n\n        if ( ( number / power_tens[integer_length - 5] ) > 0x7FFFL )\n        {\n          *scaling = integer_length - 4;\n          return FT_DivFix( number, power_tens[integer_length - 4] );\n        }\n        else\n        {\n          *scaling = integer_length - 5;\n          return FT_DivFix( number, power_tens[integer_length - 5] );\n        }\n      }\n      else\n      {\n        *scaling = 0;\n        return (FT_Long)( (FT_ULong)number << 16 );\n      }\n    }\n  }\n\n\n  static FT_Error\n  cff_parse_font_matrix( CFF_Parser  parser )\n  {\n    CFF_FontRecDict  dict   = (CFF_FontRecDict)parser->object;\n    FT_Matrix*       matrix = &dict->font_matrix;\n    FT_Vector*       offset = &dict->font_offset;\n    FT_ULong*        upm    = &dict->units_per_em;\n    FT_Byte**        data   = parser->stack;\n    FT_Error         error  = FT_ERR( Stack_Underflow );\n\n\n    if ( parser->top >= parser->stack + 6 )\n    {\n      FT_Long  scaling;\n\n\n      error = FT_Err_Ok;\n\n      dict->has_font_matrix = TRUE;\n\n      /* We expect a well-formed font matrix, this is, the matrix elements */\n      /* `xx' and `yy' are of approximately the same magnitude.  To avoid  */\n      /* loss of precision, we use the magnitude of element `xx' to scale  */\n      /* all other elements.  The scaling factor is then contained in the  */\n      /* `units_per_em' value.                                             */\n\n      matrix->xx = cff_parse_fixed_dynamic( data++, &scaling );\n\n      scaling = -scaling;\n\n      if ( scaling < 0 || scaling > 9 )\n      {\n        /* Return default matrix in case of unlikely values. */\n\n        FT_TRACE1(( \"cff_parse_font_matrix:\"\n                    \" strange scaling value for xx element (%d),\\n\"\n                    \"                      \"\n                    \" using default matrix\\n\", scaling ));\n\n        matrix->xx = 0x10000L;\n        matrix->yx = 0;\n        matrix->xy = 0;\n        matrix->yy = 0x10000L;\n        offset->x  = 0;\n        offset->y  = 0;\n        *upm       = 1;\n\n        goto Exit;\n      }\n\n      matrix->yx = cff_parse_fixed_scaled( data++, scaling );\n      matrix->xy = cff_parse_fixed_scaled( data++, scaling );\n      matrix->yy = cff_parse_fixed_scaled( data++, scaling );\n      offset->x  = cff_parse_fixed_scaled( data++, scaling );\n      offset->y  = cff_parse_fixed_scaled( data,   scaling );\n\n      *upm = power_tens[scaling];\n\n      FT_TRACE4(( \" [%f %f %f %f %f %f]\\n\",\n                  (double)matrix->xx / *upm / 65536,\n                  (double)matrix->xy / *upm / 65536,\n                  (double)matrix->yx / *upm / 65536,\n                  (double)matrix->yy / *upm / 65536,\n                  (double)offset->x  / *upm / 65536,\n                  (double)offset->y  / *upm / 65536 ));\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  static FT_Error\n  cff_parse_font_bbox( CFF_Parser  parser )\n  {\n    CFF_FontRecDict  dict = (CFF_FontRecDict)parser->object;\n    FT_BBox*         bbox = &dict->font_bbox;\n    FT_Byte**        data = parser->stack;\n    FT_Error         error;\n\n\n    error = FT_ERR( Stack_Underflow );\n\n    if ( parser->top >= parser->stack + 4 )\n    {\n      bbox->xMin = FT_RoundFix( cff_parse_fixed( data++ ) );\n      bbox->yMin = FT_RoundFix( cff_parse_fixed( data++ ) );\n      bbox->xMax = FT_RoundFix( cff_parse_fixed( data++ ) );\n      bbox->yMax = FT_RoundFix( cff_parse_fixed( data   ) );\n      error = FT_Err_Ok;\n\n      FT_TRACE4(( \" [%d %d %d %d]\\n\",\n                  bbox->xMin / 65536,\n                  bbox->yMin / 65536,\n                  bbox->xMax / 65536,\n                  bbox->yMax / 65536 ));\n    }\n\n    return error;\n  }\n\n\n  static FT_Error\n  cff_parse_private_dict( CFF_Parser  parser )\n  {\n    CFF_FontRecDict  dict = (CFF_FontRecDict)parser->object;\n    FT_Byte**        data = parser->stack;\n    FT_Error         error;\n\n\n    error = FT_ERR( Stack_Underflow );\n\n    if ( parser->top >= parser->stack + 2 )\n    {\n      dict->private_size   = cff_parse_num( data++ );\n      dict->private_offset = cff_parse_num( data   );\n      FT_TRACE4(( \" %lu %lu\\n\",\n                  dict->private_size, dict->private_offset ));\n\n      error = FT_Err_Ok;\n    }\n\n    return error;\n  }\n\n\n  static FT_Error\n  cff_parse_cid_ros( CFF_Parser  parser )\n  {\n    CFF_FontRecDict  dict = (CFF_FontRecDict)parser->object;\n    FT_Byte**        data = parser->stack;\n    FT_Error         error;\n\n\n    error = FT_ERR( Stack_Underflow );\n\n    if ( parser->top >= parser->stack + 3 )\n    {\n      dict->cid_registry = (FT_UInt)cff_parse_num( data++ );\n      dict->cid_ordering = (FT_UInt)cff_parse_num( data++ );\n      if ( **data == 30 )\n        FT_TRACE1(( \"cff_parse_cid_ros: real supplement is rounded\\n\" ));\n      dict->cid_supplement = cff_parse_num( data );\n      if ( dict->cid_supplement < 0 )\n        FT_TRACE1(( \"cff_parse_cid_ros: negative supplement %d is found\\n\",\n                   dict->cid_supplement ));\n      error = FT_Err_Ok;\n\n      FT_TRACE4(( \" %d %d %d\\n\",\n                  dict->cid_registry,\n                  dict->cid_ordering,\n                  dict->cid_supplement ));\n    }\n\n    return error;\n  }\n\n\n#define CFF_FIELD_NUM( code, name, id )             \\\n          CFF_FIELD( code, name, id, cff_kind_num )\n#define CFF_FIELD_FIXED( code, name, id )             \\\n          CFF_FIELD( code, name, id, cff_kind_fixed )\n#define CFF_FIELD_FIXED_1000( code, name, id )                 \\\n          CFF_FIELD( code, name, id, cff_kind_fixed_thousand )\n#define CFF_FIELD_STRING( code, name, id )             \\\n          CFF_FIELD( code, name, id, cff_kind_string )\n#define CFF_FIELD_BOOL( code, name, id )             \\\n          CFF_FIELD( code, name, id, cff_kind_bool )\n\n#define CFFCODE_TOPDICT  0x1000\n#define CFFCODE_PRIVATE  0x2000\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n\n#undef  CFF_FIELD\n#undef  CFF_FIELD_DELTA\n\n\n#ifndef FT_DEBUG_LEVEL_TRACE\n\n\n#define CFF_FIELD_CALLBACK( code, name, id ) \\\n          {                                  \\\n            cff_kind_callback,               \\\n            code | CFFCODE,                  \\\n            0, 0,                            \\\n            cff_parse_ ## name,              \\\n            0, 0                             \\\n          },\n\n#define CFF_FIELD( code, name, id, kind ) \\\n          {                               \\\n            kind,                         \\\n            code | CFFCODE,               \\\n            FT_FIELD_OFFSET( name ),      \\\n            FT_FIELD_SIZE( name ),        \\\n            0, 0, 0                       \\\n          },\n\n#define CFF_FIELD_DELTA( code, name, max, id ) \\\n          {                                    \\\n            cff_kind_delta,                    \\\n            code | CFFCODE,                    \\\n            FT_FIELD_OFFSET( name ),           \\\n            FT_FIELD_SIZE_DELTA( name ),       \\\n            0,                                 \\\n            max,                               \\\n            FT_FIELD_OFFSET( num_ ## name )    \\\n          },\n\n  static const CFF_Field_Handler  cff_field_handlers[] =\n  {\n\n#include \"cfftoken.h\"\n\n    { 0, 0, 0, 0, 0, 0, 0 }\n  };\n\n\n#else /* FT_DEBUG_LEVEL_TRACE */\n\n\n\n#define CFF_FIELD_CALLBACK( code, name, id ) \\\n          {                                  \\\n            cff_kind_callback,               \\\n            code | CFFCODE,                  \\\n            0, 0,                            \\\n            cff_parse_ ## name,              \\\n            0, 0,                            \\\n            id                               \\\n          },\n\n#define CFF_FIELD( code, name, id, kind ) \\\n          {                               \\\n            kind,                         \\\n            code | CFFCODE,               \\\n            FT_FIELD_OFFSET( name ),      \\\n            FT_FIELD_SIZE( name ),        \\\n            0, 0, 0,                      \\\n            id                            \\\n          },\n\n#define CFF_FIELD_DELTA( code, name, max, id ) \\\n          {                                    \\\n            cff_kind_delta,                    \\\n            code | CFFCODE,                    \\\n            FT_FIELD_OFFSET( name ),           \\\n            FT_FIELD_SIZE_DELTA( name ),       \\\n            0,                                 \\\n            max,                               \\\n            FT_FIELD_OFFSET( num_ ## name ),   \\\n            id                                 \\\n          },\n\n  static const CFF_Field_Handler  cff_field_handlers[] =\n  {\n\n#include \"cfftoken.h\"\n\n    { 0, 0, 0, 0, 0, 0, 0, 0 }\n  };\n\n\n#endif /* FT_DEBUG_LEVEL_TRACE */\n\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n\n  void\n  FT_Destroy_Class_cff_field_handlers( FT_Library          library,\n                                       CFF_Field_Handler*  clazz )\n  {\n    FT_Memory  memory = library->memory;\n\n\n    if ( clazz )\n      FT_FREE( clazz );\n  }\n\n\n  FT_Error\n  FT_Create_Class_cff_field_handlers( FT_Library           library,\n                                      CFF_Field_Handler**  output_class )\n  {\n    CFF_Field_Handler*  clazz  = NULL;\n    FT_Error            error;\n    FT_Memory           memory = library->memory;\n\n    int  i = 0;\n\n\n#undef CFF_FIELD\n#define CFF_FIELD( code, name, id, kind ) i++;\n#undef CFF_FIELD_DELTA\n#define CFF_FIELD_DELTA( code, name, max, id ) i++;\n#undef CFF_FIELD_CALLBACK\n#define CFF_FIELD_CALLBACK( code, name, id ) i++;\n\n#include \"cfftoken.h\"\n\n    i++; /* { 0, 0, 0, 0, 0, 0, 0 } */\n\n    if ( FT_ALLOC( clazz, sizeof ( CFF_Field_Handler ) * i ) )\n      return error;\n\n    i = 0;\n\n\n#ifndef FT_DEBUG_LEVEL_TRACE\n\n\n#undef CFF_FIELD_CALLBACK\n#define CFF_FIELD_CALLBACK( code_, name_, id_ )        \\\n          clazz[i].kind         = cff_kind_callback;   \\\n          clazz[i].code         = code_ | CFFCODE;     \\\n          clazz[i].offset       = 0;                   \\\n          clazz[i].size         = 0;                   \\\n          clazz[i].reader       = cff_parse_ ## name_; \\\n          clazz[i].array_max    = 0;                   \\\n          clazz[i].count_offset = 0;                   \\\n          i++;\n\n#undef  CFF_FIELD\n#define CFF_FIELD( code_, name_, id_, kind_ )               \\\n          clazz[i].kind         = kind_;                    \\\n          clazz[i].code         = code_ | CFFCODE;          \\\n          clazz[i].offset       = FT_FIELD_OFFSET( name_ ); \\\n          clazz[i].size         = FT_FIELD_SIZE( name_ );   \\\n          clazz[i].reader       = 0;                        \\\n          clazz[i].array_max    = 0;                        \\\n          clazz[i].count_offset = 0;                        \\\n          i++;                                              \\\n\n#undef  CFF_FIELD_DELTA\n#define CFF_FIELD_DELTA( code_, name_, max_, id_ )                  \\\n          clazz[i].kind         = cff_kind_delta;                   \\\n          clazz[i].code         = code_ | CFFCODE;                  \\\n          clazz[i].offset       = FT_FIELD_OFFSET( name_ );         \\\n          clazz[i].size         = FT_FIELD_SIZE_DELTA( name_ );     \\\n          clazz[i].reader       = 0;                                \\\n          clazz[i].array_max    = max_;                             \\\n          clazz[i].count_offset = FT_FIELD_OFFSET( num_ ## name_ ); \\\n          i++;\n\n#include \"cfftoken.h\"\n\n    clazz[i].kind         = 0;\n    clazz[i].code         = 0;\n    clazz[i].offset       = 0;\n    clazz[i].size         = 0;\n    clazz[i].reader       = 0;\n    clazz[i].array_max    = 0;\n    clazz[i].count_offset = 0;\n\n\n#else /* FT_DEBUG_LEVEL_TRACE */\n\n\n#undef CFF_FIELD_CALLBACK\n#define CFF_FIELD_CALLBACK( code_, name_, id_ )        \\\n          clazz[i].kind         = cff_kind_callback;   \\\n          clazz[i].code         = code_ | CFFCODE;     \\\n          clazz[i].offset       = 0;                   \\\n          clazz[i].size         = 0;                   \\\n          clazz[i].reader       = cff_parse_ ## name_; \\\n          clazz[i].array_max    = 0;                   \\\n          clazz[i].count_offset = 0;                   \\\n          clazz[i].id           = id_;                 \\\n          i++;\n\n#undef  CFF_FIELD\n#define CFF_FIELD( code_, name_, id_, kind_ )               \\\n          clazz[i].kind         = kind_;                    \\\n          clazz[i].code         = code_ | CFFCODE;          \\\n          clazz[i].offset       = FT_FIELD_OFFSET( name_ ); \\\n          clazz[i].size         = FT_FIELD_SIZE( name_ );   \\\n          clazz[i].reader       = 0;                        \\\n          clazz[i].array_max    = 0;                        \\\n          clazz[i].count_offset = 0;                        \\\n          clazz[i].id           = id_;                      \\\n          i++;                                              \\\n\n#undef  CFF_FIELD_DELTA\n#define CFF_FIELD_DELTA( code_, name_, max_, id_ )                  \\\n          clazz[i].kind         = cff_kind_delta;                   \\\n          clazz[i].code         = code_ | CFFCODE;                  \\\n          clazz[i].offset       = FT_FIELD_OFFSET( name_ );         \\\n          clazz[i].size         = FT_FIELD_SIZE_DELTA( name_ );     \\\n          clazz[i].reader       = 0;                                \\\n          clazz[i].array_max    = max_;                             \\\n          clazz[i].count_offset = FT_FIELD_OFFSET( num_ ## name_ ); \\\n          clazz[i].id           = id_;                              \\\n          i++;\n\n#include \"cfftoken.h\"\n\n    clazz[i].kind         = 0;\n    clazz[i].code         = 0;\n    clazz[i].offset       = 0;\n    clazz[i].size         = 0;\n    clazz[i].reader       = 0;\n    clazz[i].array_max    = 0;\n    clazz[i].count_offset = 0;\n    clazz[i].id           = 0;\n\n\n#endif /* FT_DEBUG_LEVEL_TRACE */\n\n\n    *output_class = clazz;\n\n    return FT_Err_Ok;\n  }\n\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  FT_LOCAL_DEF( FT_Error )\n  cff_parser_run( CFF_Parser  parser,\n                  FT_Byte*    start,\n                  FT_Byte*    limit )\n  {\n    FT_Byte*    p       = start;\n    FT_Error    error   = FT_Err_Ok;\n    FT_Library  library = parser->library;\n    FT_UNUSED( library );\n\n\n    parser->top    = parser->stack;\n    parser->start  = start;\n    parser->limit  = limit;\n    parser->cursor = start;\n\n    while ( p < limit )\n    {\n      FT_UInt  v = *p;\n\n\n      if ( v >= 27 && v != 31 )\n      {\n        /* it's a number; we will push its position on the stack */\n        if ( parser->top - parser->stack >= CFF_MAX_STACK_DEPTH )\n          goto Stack_Overflow;\n\n        *parser->top ++ = p;\n\n        /* now, skip it */\n        if ( v == 30 )\n        {\n          /* skip real number */\n          p++;\n          for (;;)\n          {\n            /* An unterminated floating point number at the */\n            /* end of a dictionary is invalid but harmless. */\n            if ( p >= limit )\n              goto Exit;\n            v = p[0] >> 4;\n            if ( v == 15 )\n              break;\n            v = p[0] & 0xF;\n            if ( v == 15 )\n              break;\n            p++;\n          }\n        }\n        else if ( v == 28 )\n          p += 2;\n        else if ( v == 29 )\n          p += 4;\n        else if ( v > 246 )\n          p += 1;\n      }\n      else\n      {\n        /* This is not a number, hence it's an operator.  Compute its code */\n        /* and look for it in our current list.                            */\n\n        FT_UInt                   code;\n        FT_UInt                   num_args = (FT_UInt)\n                                             ( parser->top - parser->stack );\n        const CFF_Field_Handler*  field;\n\n\n        *parser->top = p;\n        code = v;\n        if ( v == 12 )\n        {\n          /* two byte operator */\n          p++;\n          if ( p >= limit )\n            goto Syntax_Error;\n\n          code = 0x100 | p[0];\n        }\n        code = code | parser->object_code;\n\n        for ( field = CFF_FIELD_HANDLERS_GET; field->kind; field++ )\n        {\n          if ( field->code == (FT_Int)code )\n          {\n            /* we found our field's handler; read it */\n            FT_Long   val;\n            FT_Byte*  q = (FT_Byte*)parser->object + field->offset;\n\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n            FT_TRACE4(( \"  %s\", field->id ));\n#endif\n\n            /* check that we have enough arguments -- except for */\n            /* delta encoded arrays, which can be empty          */\n            if ( field->kind != cff_kind_delta && num_args < 1 )\n              goto Stack_Underflow;\n\n            switch ( field->kind )\n            {\n            case cff_kind_bool:\n            case cff_kind_string:\n            case cff_kind_num:\n              val = cff_parse_num( parser->stack );\n              goto Store_Number;\n\n            case cff_kind_fixed:\n              val = cff_parse_fixed( parser->stack );\n              goto Store_Number;\n\n            case cff_kind_fixed_thousand:\n              val = cff_parse_fixed_scaled( parser->stack, 3 );\n\n            Store_Number:\n              switch ( field->size )\n              {\n              case (8 / FT_CHAR_BIT):\n                *(FT_Byte*)q = (FT_Byte)val;\n                break;\n\n              case (16 / FT_CHAR_BIT):\n                *(FT_Short*)q = (FT_Short)val;\n                break;\n\n              case (32 / FT_CHAR_BIT):\n                *(FT_Int32*)q = (FT_Int)val;\n                break;\n\n              default:  /* for 64-bit systems */\n                *(FT_Long*)q = val;\n              }\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n              switch ( field->kind )\n              {\n              case cff_kind_bool:\n                FT_TRACE4(( \" %s\\n\", val ? \"true\" : \"false\" ));\n                break;\n\n              case cff_kind_string:\n                FT_TRACE4(( \" %ld (SID)\\n\", val ));\n                break;\n\n              case cff_kind_num:\n                FT_TRACE4(( \" %ld\\n\", val ));\n                break;\n\n              case cff_kind_fixed:\n                FT_TRACE4(( \" %f\\n\", (double)val / 65536 ));\n                break;\n\n              case cff_kind_fixed_thousand:\n                FT_TRACE4(( \" %f\\n\", (double)val / 65536 / 1000 ));\n\n              default:\n                ; /* never reached */\n              }\n#endif\n\n              break;\n\n            case cff_kind_delta:\n              {\n                FT_Byte*   qcount = (FT_Byte*)parser->object +\n                                      field->count_offset;\n\n                FT_Byte**  data = parser->stack;\n\n\n                if ( num_args > field->array_max )\n                  num_args = field->array_max;\n\n                FT_TRACE4(( \" [\" ));\n\n                /* store count */\n                *qcount = (FT_Byte)num_args;\n\n                val = 0;\n                while ( num_args > 0 )\n                {\n                  val += cff_parse_num( data++ );\n                  switch ( field->size )\n                  {\n                  case (8 / FT_CHAR_BIT):\n                    *(FT_Byte*)q = (FT_Byte)val;\n                    break;\n\n                  case (16 / FT_CHAR_BIT):\n                    *(FT_Short*)q = (FT_Short)val;\n                    break;\n\n                  case (32 / FT_CHAR_BIT):\n                    *(FT_Int32*)q = (FT_Int)val;\n                    break;\n\n                  default:  /* for 64-bit systems */\n                    *(FT_Long*)q = val;\n                  }\n\n                  FT_TRACE4(( \" %ld\", val ));\n\n                  q += field->size;\n                  num_args--;\n                }\n\n                FT_TRACE4(( \"]\\n\" ));\n              }\n              break;\n\n            default:  /* callback */\n              error = field->reader( parser );\n              if ( error )\n                goto Exit;\n            }\n            goto Found;\n          }\n        }\n\n        /* this is an unknown operator, or it is unsupported; */\n        /* we will ignore it for now.                         */\n\n      Found:\n        /* clear stack */\n        parser->top = parser->stack;\n      }\n      p++;\n    }\n\n  Exit:\n    return error;\n\n  Stack_Overflow:\n    error = FT_THROW( Invalid_Argument );\n    goto Exit;\n\n  Stack_Underflow:\n    error = FT_THROW( Invalid_Argument );\n    goto Exit;\n\n  Syntax_Error:\n    error = FT_THROW( Invalid_Argument );\n    goto Exit;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cffparse.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cffparse.h                                                             */\n/*                                                                         */\n/*    CFF token stream parser (specification)                              */\n/*                                                                         */\n/*  Copyright 1996-2003, 2011 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CFF_PARSE_H__\n#define __CFF_PARSE_H__\n\n\n#include <ft2build.h>\n#include \"cfftypes.h\"\n#include FT_INTERNAL_OBJECTS_H\n\n\nFT_BEGIN_HEADER\n\n\n#define CFF_MAX_STACK_DEPTH  96\n\n#define CFF_CODE_TOPDICT  0x1000\n#define CFF_CODE_PRIVATE  0x2000\n\n\n  typedef struct  CFF_ParserRec_\n  {\n    FT_Library library;\n    FT_Byte*   start;\n    FT_Byte*   limit;\n    FT_Byte*   cursor;\n\n    FT_Byte*   stack[CFF_MAX_STACK_DEPTH + 1];\n    FT_Byte**  top;\n\n    FT_UInt    object_code;\n    void*      object;\n\n  } CFF_ParserRec, *CFF_Parser;\n\n\n  FT_LOCAL( void )\n  cff_parser_init( CFF_Parser  parser,\n                   FT_UInt     code,\n                   void*       object,\n                   FT_Library  library);\n\n  FT_LOCAL( FT_Error )\n  cff_parser_run( CFF_Parser  parser,\n                  FT_Byte*    start,\n                  FT_Byte*    limit );\n\n\n  enum\n  {\n    cff_kind_none = 0,\n    cff_kind_num,\n    cff_kind_fixed,\n    cff_kind_fixed_thousand,\n    cff_kind_string,\n    cff_kind_bool,\n    cff_kind_delta,\n    cff_kind_callback,\n\n    cff_kind_max  /* do not remove */\n  };\n\n\n  /* now generate handlers for the most simple fields */\n  typedef FT_Error  (*CFF_Field_Reader)( CFF_Parser  parser );\n\n  typedef struct  CFF_Field_Handler_\n  {\n    int               kind;\n    int               code;\n    FT_UInt           offset;\n    FT_Byte           size;\n    CFF_Field_Reader  reader;\n    FT_UInt           array_max;\n    FT_UInt           count_offset;\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n    const char*       id;\n#endif\n\n  } CFF_Field_Handler;\n\n\nFT_END_HEADER\n\n\n#endif /* __CFF_PARSE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cffpic.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cffpic.c                                                               */\n/*                                                                         */\n/*    The FreeType position independent code services for cff module.      */\n/*                                                                         */\n/*  Copyright 2009, 2010, 2012, 2013 by                                    */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_INTERNAL_OBJECTS_H\n#include \"cffcmap.h\"\n#include \"cffpic.h\"\n#include \"cfferrs.h\"\n\n\n#ifdef FT_CONFIG_OPTION_PIC\n\n  /* forward declaration of PIC init functions from cffdrivr.c */\n  FT_Error\n  FT_Create_Class_cff_services( FT_Library           library,\n                                FT_ServiceDescRec**  output_class );\n  void\n  FT_Destroy_Class_cff_services( FT_Library          library,\n                                 FT_ServiceDescRec*  clazz );\n  void\n  FT_Init_Class_cff_service_ps_info( FT_Library             library,\n                                     FT_Service_PsInfoRec*  clazz );\n  void\n  FT_Init_Class_cff_service_glyph_dict( FT_Library                library,\n                                        FT_Service_GlyphDictRec*  clazz );\n  void\n  FT_Init_Class_cff_service_ps_name( FT_Library                 library,\n                                     FT_Service_PsFontNameRec*  clazz );\n  void\n  FT_Init_Class_cff_service_get_cmap_info( FT_Library              library,\n                                           FT_Service_TTCMapsRec*  clazz );\n  void\n  FT_Init_Class_cff_service_cid_info( FT_Library          library,\n                                      FT_Service_CIDRec*  clazz );\n\n  /* forward declaration of PIC init functions from cffparse.c */\n  FT_Error\n  FT_Create_Class_cff_field_handlers( FT_Library           library,\n                                      CFF_Field_Handler**  output_class );\n  void\n  FT_Destroy_Class_cff_field_handlers( FT_Library          library,\n                                       CFF_Field_Handler*  clazz );\n\n\n  void\n  cff_driver_class_pic_free( FT_Library  library )\n  {\n    FT_PIC_Container*  pic_container = &library->pic_container;\n    FT_Memory          memory        = library->memory;\n\n\n    if ( pic_container->cff )\n    {\n      CffModulePIC*  container = (CffModulePIC*)pic_container->cff;\n\n\n      if ( container->cff_services )\n        FT_Destroy_Class_cff_services( library,\n                                       container->cff_services );\n      container->cff_services = NULL;\n      if ( container->cff_field_handlers )\n        FT_Destroy_Class_cff_field_handlers(\n          library, container->cff_field_handlers );\n      container->cff_field_handlers = NULL;\n      FT_FREE( container );\n      pic_container->cff = NULL;\n    }\n  }\n\n\n  FT_Error\n  cff_driver_class_pic_init( FT_Library  library )\n  {\n    FT_PIC_Container*  pic_container = &library->pic_container;\n    FT_Error           error         = FT_Err_Ok;\n    CffModulePIC*      container     = NULL;\n    FT_Memory          memory        = library->memory;\n\n\n    /* allocate pointer, clear and set global container pointer */\n    if ( FT_ALLOC ( container, sizeof ( *container ) ) )\n      return error;\n    FT_MEM_SET( container, 0, sizeof ( *container ) );\n    pic_container->cff = container;\n\n    /* initialize pointer table -                       */\n    /* this is how the module usually expects this data */\n    error = FT_Create_Class_cff_services( library,\n                                          &container->cff_services );\n    if ( error )\n      goto Exit;\n\n    error = FT_Create_Class_cff_field_handlers(\n              library, &container->cff_field_handlers );\n    if ( error )\n      goto Exit;\n\n    FT_Init_Class_cff_service_ps_info(\n      library, &container->cff_service_ps_info );\n    FT_Init_Class_cff_service_glyph_dict(\n      library, &container->cff_service_glyph_dict );\n    FT_Init_Class_cff_service_ps_name(\n      library, &container->cff_service_ps_name );\n    FT_Init_Class_cff_service_get_cmap_info(\n      library, &container->cff_service_get_cmap_info );\n    FT_Init_Class_cff_service_cid_info(\n      library, &container->cff_service_cid_info );\n    FT_Init_Class_cff_cmap_encoding_class_rec(\n      library, &container->cff_cmap_encoding_class_rec );\n    FT_Init_Class_cff_cmap_unicode_class_rec(\n      library, &container->cff_cmap_unicode_class_rec );\n\n  Exit:\n    if ( error )\n      cff_driver_class_pic_free( library );\n    return error;\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cffpic.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cffpic.h                                                               */\n/*                                                                         */\n/*    The FreeType position independent code services for cff module.      */\n/*                                                                         */\n/*  Copyright 2009, 2012, 2013 by                                          */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CFFPIC_H__\n#define __CFFPIC_H__\n\n\nFT_BEGIN_HEADER\n\n#include FT_INTERNAL_PIC_H\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define CFF_SERVICE_PS_INFO_GET          cff_service_ps_info\n#define CFF_SERVICE_GLYPH_DICT_GET       cff_service_glyph_dict\n#define CFF_SERVICE_PS_NAME_GET          cff_service_ps_name\n#define CFF_SERVICE_GET_CMAP_INFO_GET    cff_service_get_cmap_info\n#define CFF_SERVICE_CID_INFO_GET         cff_service_cid_info\n#define CFF_SERVICE_PROPERTIES_GET       cff_service_properties\n#define CFF_SERVICES_GET                 cff_services\n#define CFF_CMAP_ENCODING_CLASS_REC_GET  cff_cmap_encoding_class_rec\n#define CFF_CMAP_UNICODE_CLASS_REC_GET   cff_cmap_unicode_class_rec\n#define CFF_FIELD_HANDLERS_GET           cff_field_handlers\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#include FT_SERVICE_GLYPH_DICT_H\n#include \"cffparse.h\"\n#include FT_SERVICE_POSTSCRIPT_INFO_H\n#include FT_SERVICE_POSTSCRIPT_NAME_H\n#include FT_SERVICE_TT_CMAP_H\n#include FT_SERVICE_CID_H\n#include FT_SERVICE_PROPERTIES_H\n\n\n  typedef struct  CffModulePIC_\n  {\n    FT_ServiceDescRec*        cff_services;\n    CFF_Field_Handler*        cff_field_handlers;\n    FT_Service_PsInfoRec      cff_service_ps_info;\n    FT_Service_GlyphDictRec   cff_service_glyph_dict;\n    FT_Service_PsFontNameRec  cff_service_ps_name;\n    FT_Service_TTCMapsRec     cff_service_get_cmap_info;\n    FT_Service_CIDRec         cff_service_cid_info;\n    FT_Service_PropertiesRec  cff_service_properties;\n    FT_CMap_ClassRec          cff_cmap_encoding_class_rec;\n    FT_CMap_ClassRec          cff_cmap_unicode_class_rec;\n\n  } CffModulePIC;\n\n\n#define GET_PIC( lib )                                    \\\n          ( (CffModulePIC*)( (lib)->pic_container.cff ) )\n\n#define CFF_SERVICE_PS_INFO_GET                       \\\n          ( GET_PIC( library )->cff_service_ps_info )\n#define CFF_SERVICE_GLYPH_DICT_GET                       \\\n          ( GET_PIC( library )->cff_service_glyph_dict )\n#define CFF_SERVICE_PS_NAME_GET                       \\\n          ( GET_PIC( library )->cff_service_ps_name )\n#define CFF_SERVICE_GET_CMAP_INFO_GET                       \\\n          ( GET_PIC( library )->cff_service_get_cmap_info )\n#define CFF_SERVICE_CID_INFO_GET                       \\\n          ( GET_PIC( library )->cff_service_cid_info )\n#define CFF_SERVICE_PROPERTIES_GET                       \\\n          ( GET_PIC( library )->cff_service_properties )\n#define CFF_SERVICES_GET                       \\\n          ( GET_PIC( library )->cff_services )\n#define CFF_CMAP_ENCODING_CLASS_REC_GET                       \\\n          ( GET_PIC( library )->cff_cmap_encoding_class_rec )\n#define CFF_CMAP_UNICODE_CLASS_REC_GET                       \\\n          ( GET_PIC( library )->cff_cmap_unicode_class_rec )\n#define CFF_FIELD_HANDLERS_GET                       \\\n          ( GET_PIC( library )->cff_field_handlers )\n\n  /* see cffpic.c for the implementation */\n  void\n  cff_driver_class_pic_free( FT_Library  library );\n\n  FT_Error\n  cff_driver_class_pic_init( FT_Library  library );\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __CFFPIC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cfftoken.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cfftoken.h                                                             */\n/*                                                                         */\n/*    CFF token definitions (specification only).                          */\n/*                                                                         */\n/*  Copyright 1996-2003, 2011 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  CFF_FontRecDictRec\n\n#undef  CFFCODE\n#define CFFCODE       CFFCODE_TOPDICT\n\n  CFF_FIELD_STRING  ( 0,     version,             \"Version\" )\n  CFF_FIELD_STRING  ( 1,     notice,              \"Notice\" )\n  CFF_FIELD_STRING  ( 0x100, copyright,           \"Copyright\" )\n  CFF_FIELD_STRING  ( 2,     full_name,           \"FullName\" )\n  CFF_FIELD_STRING  ( 3,     family_name,         \"FamilyName\" )\n  CFF_FIELD_STRING  ( 4,     weight,              \"Weight\" )\n  CFF_FIELD_BOOL    ( 0x101, is_fixed_pitch,      \"isFixedPitch\" )\n  CFF_FIELD_FIXED   ( 0x102, italic_angle,        \"ItalicAngle\" )\n  CFF_FIELD_FIXED   ( 0x103, underline_position,  \"UnderlinePosition\" )\n  CFF_FIELD_FIXED   ( 0x104, underline_thickness, \"UnderlineThickness\" )\n  CFF_FIELD_NUM     ( 0x105, paint_type,          \"PaintType\" )\n  CFF_FIELD_NUM     ( 0x106, charstring_type,     \"CharstringType\" )\n  CFF_FIELD_CALLBACK( 0x107, font_matrix,         \"FontMatrix\" )\n  CFF_FIELD_NUM     ( 13,    unique_id,           \"UniqueID\" )\n  CFF_FIELD_CALLBACK( 5,     font_bbox,           \"FontBBox\" )\n  CFF_FIELD_NUM     ( 0x108, stroke_width,        \"StrokeWidth\" )\n  CFF_FIELD_NUM     ( 15,    charset_offset,      \"charset\" )\n  CFF_FIELD_NUM     ( 16,    encoding_offset,     \"Encoding\" )\n  CFF_FIELD_NUM     ( 17,    charstrings_offset,  \"CharStrings\" )\n  CFF_FIELD_CALLBACK( 18,    private_dict,        \"Private\" )\n  CFF_FIELD_NUM     ( 0x114, synthetic_base,      \"SyntheticBase\" )\n  CFF_FIELD_STRING  ( 0x115, embedded_postscript, \"PostScript\" )\n\n#if 0\n  CFF_FIELD_STRING  ( 0x116, base_font_name,      \"BaseFontName\" )\n  CFF_FIELD_DELTA   ( 0x117, base_font_blend, 16, \"BaseFontBlend\" )\n  CFF_FIELD_CALLBACK( 0x118, multiple_master,     \"MultipleMaster\" )\n  CFF_FIELD_CALLBACK( 0x119, blend_axis_types,    \"BlendAxisTypes\" )\n#endif\n\n  CFF_FIELD_CALLBACK( 0x11E, cid_ros,              \"ROS\" )\n  CFF_FIELD_NUM     ( 0x11F, cid_font_version,     \"CIDFontVersion\" )\n  CFF_FIELD_NUM     ( 0x120, cid_font_revision,    \"CIDFontRevision\" )\n  CFF_FIELD_NUM     ( 0x121, cid_font_type,        \"CIDFontType\" )\n  CFF_FIELD_NUM     ( 0x122, cid_count,            \"CIDCount\" )\n  CFF_FIELD_NUM     ( 0x123, cid_uid_base,         \"UIDBase\" )\n  CFF_FIELD_NUM     ( 0x124, cid_fd_array_offset,  \"FDArray\" )\n  CFF_FIELD_NUM     ( 0x125, cid_fd_select_offset, \"FDSelect\" )\n  CFF_FIELD_STRING  ( 0x126, cid_font_name,        \"FontName\" )\n\n#if 0\n  CFF_FIELD_NUM     ( 0x127, chameleon, \"Chameleon\" )\n#endif\n\n\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  CFF_PrivateRec\n#undef  CFFCODE\n#define CFFCODE       CFFCODE_PRIVATE\n\n  CFF_FIELD_DELTA     ( 6,     blue_values, 14,        \"BlueValues\" )\n  CFF_FIELD_DELTA     ( 7,     other_blues, 10,        \"OtherBlues\" )\n  CFF_FIELD_DELTA     ( 8,     family_blues, 14,       \"FamilyBlues\" )\n  CFF_FIELD_DELTA     ( 9,     family_other_blues, 10, \"FamilyOtherBlues\" )\n  CFF_FIELD_FIXED_1000( 0x109, blue_scale,             \"BlueScale\" )\n  CFF_FIELD_NUM       ( 0x10A, blue_shift,             \"BlueShift\" )\n  CFF_FIELD_NUM       ( 0x10B, blue_fuzz,              \"BlueFuzz\" )\n  CFF_FIELD_NUM       ( 10,    standard_width,         \"StdHW\" )\n  CFF_FIELD_NUM       ( 11,    standard_height,        \"StdVW\" )\n  CFF_FIELD_DELTA     ( 0x10C, snap_widths, 13,        \"StemSnapH\" )\n  CFF_FIELD_DELTA     ( 0x10D, snap_heights, 13,       \"StemSnapV\" )\n  CFF_FIELD_BOOL      ( 0x10E, force_bold,             \"ForceBold\" )\n  CFF_FIELD_FIXED     ( 0x10F, force_bold_threshold,   \"ForceBoldThreshold\" )\n  CFF_FIELD_NUM       ( 0x110, lenIV,                  \"lenIV\" )\n  CFF_FIELD_NUM       ( 0x111, language_group,         \"LanguageGroup\" )\n  CFF_FIELD_FIXED     ( 0x112, expansion_factor,       \"ExpansionFactor\" )\n  CFF_FIELD_NUM       ( 0x113, initial_random_seed,    \"initialRandomSeed\" )\n  CFF_FIELD_NUM       ( 19,    local_subrs_offset,     \"Subrs\" )\n  CFF_FIELD_NUM       ( 20,    default_width,          \"defaultWidthX\" )\n  CFF_FIELD_NUM       ( 21,    nominal_width,          \"nominalWidthX\" )\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/cfftypes.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cfftypes.h                                                             */\n/*                                                                         */\n/*    Basic OpenType/CFF type definitions and interface (specification     */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 1996-2003, 2006-2008, 2010-2011, 2013 by                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CFFTYPES_H__\n#define __CFFTYPES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_TYPE1_TABLES_H\n#include FT_INTERNAL_SERVICE_H\n#include FT_SERVICE_POSTSCRIPT_CMAPS_H\n#include FT_INTERNAL_POSTSCRIPT_HINTS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CFF_IndexRec                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a CFF Index table.                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    stream      :: The source input stream.                            */\n  /*                                                                       */\n  /*    start       :: The position of the first index byte in the         */\n  /*                   input stream.                                       */\n  /*                                                                       */\n  /*    count       :: The number of elements in the index.                */\n  /*                                                                       */\n  /*    off_size    :: The size in bytes of object offsets in index.       */\n  /*                                                                       */\n  /*    data_offset :: The position of first data byte in the index's      */\n  /*                   bytes.                                              */\n  /*                                                                       */\n  /*    data_size   :: The size of the data table in this index.           */\n  /*                                                                       */\n  /*    offsets     :: A table of element offsets in the index.  Must be   */\n  /*                   loaded explicitly.                                  */\n  /*                                                                       */\n  /*    bytes       :: If the index is loaded in memory, its bytes.        */\n  /*                                                                       */\n  typedef struct  CFF_IndexRec_\n  {\n    FT_Stream  stream;\n    FT_ULong   start;\n    FT_UInt    count;\n    FT_Byte    off_size;\n    FT_ULong   data_offset;\n    FT_ULong   data_size;\n\n    FT_ULong*  offsets;\n    FT_Byte*   bytes;\n\n  } CFF_IndexRec, *CFF_Index;\n\n\n  typedef struct  CFF_EncodingRec_\n  {\n    FT_UInt     format;\n    FT_ULong    offset;\n\n    FT_UInt     count;\n    FT_UShort   sids [256];  /* avoid dynamic allocations */\n    FT_UShort   codes[256];\n\n  } CFF_EncodingRec, *CFF_Encoding;\n\n\n  typedef struct  CFF_CharsetRec_\n  {\n\n    FT_UInt     format;\n    FT_ULong    offset;\n\n    FT_UShort*  sids;\n    FT_UShort*  cids;       /* the inverse mapping of `sids'; only needed */\n                            /* for CID-keyed fonts                        */\n    FT_UInt     max_cid;\n    FT_UInt     num_glyphs;\n\n  } CFF_CharsetRec, *CFF_Charset;\n\n\n  typedef struct  CFF_FontRecDictRec_\n  {\n    FT_UInt    version;\n    FT_UInt    notice;\n    FT_UInt    copyright;\n    FT_UInt    full_name;\n    FT_UInt    family_name;\n    FT_UInt    weight;\n    FT_Bool    is_fixed_pitch;\n    FT_Fixed   italic_angle;\n    FT_Fixed   underline_position;\n    FT_Fixed   underline_thickness;\n    FT_Int     paint_type;\n    FT_Int     charstring_type;\n    FT_Matrix  font_matrix;\n    FT_Bool    has_font_matrix;\n    FT_ULong   units_per_em;  /* temporarily used as scaling value also */\n    FT_Vector  font_offset;\n    FT_ULong   unique_id;\n    FT_BBox    font_bbox;\n    FT_Pos     stroke_width;\n    FT_ULong   charset_offset;\n    FT_ULong   encoding_offset;\n    FT_ULong   charstrings_offset;\n    FT_ULong   private_offset;\n    FT_ULong   private_size;\n    FT_Long    synthetic_base;\n    FT_UInt    embedded_postscript;\n\n    /* these should only be used for the top-level font dictionary */\n    FT_UInt    cid_registry;\n    FT_UInt    cid_ordering;\n    FT_Long    cid_supplement;\n\n    FT_Long    cid_font_version;\n    FT_Long    cid_font_revision;\n    FT_Long    cid_font_type;\n    FT_ULong   cid_count;\n    FT_ULong   cid_uid_base;\n    FT_ULong   cid_fd_array_offset;\n    FT_ULong   cid_fd_select_offset;\n    FT_UInt    cid_font_name;\n\n  } CFF_FontRecDictRec, *CFF_FontRecDict;\n\n\n  typedef struct  CFF_PrivateRec_\n  {\n    FT_Byte   num_blue_values;\n    FT_Byte   num_other_blues;\n    FT_Byte   num_family_blues;\n    FT_Byte   num_family_other_blues;\n\n    FT_Pos    blue_values[14];\n    FT_Pos    other_blues[10];\n    FT_Pos    family_blues[14];\n    FT_Pos    family_other_blues[10];\n\n    FT_Fixed  blue_scale;\n    FT_Pos    blue_shift;\n    FT_Pos    blue_fuzz;\n    FT_Pos    standard_width;\n    FT_Pos    standard_height;\n\n    FT_Byte   num_snap_widths;\n    FT_Byte   num_snap_heights;\n    FT_Pos    snap_widths[13];\n    FT_Pos    snap_heights[13];\n    FT_Bool   force_bold;\n    FT_Fixed  force_bold_threshold;\n    FT_Int    lenIV;\n    FT_Int    language_group;\n    FT_Fixed  expansion_factor;\n    FT_Long   initial_random_seed;\n    FT_ULong  local_subrs_offset;\n    FT_Pos    default_width;\n    FT_Pos    nominal_width;\n\n  } CFF_PrivateRec, *CFF_Private;\n\n\n  typedef struct  CFF_FDSelectRec_\n  {\n    FT_Byte   format;\n    FT_UInt   range_count;\n\n    /* that's the table, taken from the file `as is' */\n    FT_Byte*  data;\n    FT_UInt   data_size;\n\n    /* small cache for format 3 only */\n    FT_UInt   cache_first;\n    FT_UInt   cache_count;\n    FT_Byte   cache_fd;\n\n  } CFF_FDSelectRec, *CFF_FDSelect;\n\n\n  /* A SubFont packs a font dict and a private dict together.  They are */\n  /* needed to support CID-keyed CFF fonts.                             */\n  typedef struct  CFF_SubFontRec_\n  {\n    CFF_FontRecDictRec  font_dict;\n    CFF_PrivateRec      private_dict;\n\n    CFF_IndexRec        local_subrs_index;\n    FT_Byte**           local_subrs; /* array of pointers into Local Subrs INDEX data */\n\n  } CFF_SubFontRec, *CFF_SubFont;\n\n\n#define CFF_MAX_CID_FONTS  256\n\n\n  typedef struct  CFF_FontRec_\n  {\n    FT_Stream        stream;\n    FT_Memory        memory;\n    FT_UInt          num_faces;\n    FT_UInt          num_glyphs;\n\n    FT_Byte          version_major;\n    FT_Byte          version_minor;\n    FT_Byte          header_size;\n    FT_Byte          absolute_offsize;\n\n\n    CFF_IndexRec     name_index;\n    CFF_IndexRec     top_dict_index;\n    CFF_IndexRec     global_subrs_index;\n\n    CFF_EncodingRec  encoding;\n    CFF_CharsetRec   charset;\n\n    CFF_IndexRec     charstrings_index;\n    CFF_IndexRec     font_dict_index;\n    CFF_IndexRec     private_index;\n    CFF_IndexRec     local_subrs_index;\n\n    FT_String*       font_name;\n\n    /* array of pointers into Global Subrs INDEX data */\n    FT_Byte**        global_subrs;\n\n    /* array of pointers into String INDEX data stored at string_pool */\n    FT_UInt          num_strings;\n    FT_Byte**        strings;\n    FT_Byte*         string_pool;\n\n    CFF_SubFontRec   top_font;\n    FT_UInt          num_subfonts;\n    CFF_SubFont      subfonts[CFF_MAX_CID_FONTS];\n\n    CFF_FDSelectRec  fd_select;\n\n    /* interface to PostScript hinter */\n    PSHinter_Service  pshinter;\n\n    /* interface to Postscript Names service */\n    FT_Service_PsCMaps  psnames;\n\n    /* since version 2.3.0 */\n    PS_FontInfoRec*  font_info;   /* font info dictionary */\n\n    /* since version 2.3.6 */\n    FT_String*       registry;\n    FT_String*       ordering;\n\n    /* since version 2.4.12 */\n    FT_Generic       cf2_instance;\n\n  } CFF_FontRec, *CFF_Font;\n\n\nFT_END_HEADER\n\n#endif /* __CFFTYPES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cff/module.mk",
    "content": "#\n# FreeType 2 CFF module definition\n#\n\n\n# Copyright 1996-2000, 2006 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\nFTMODULE_H_COMMANDS += CFF_DRIVER\n\ndefine CFF_DRIVER\n$(OPEN_DRIVER) FT_Driver_ClassRec, cff_driver_class $(CLOSE_DRIVER)\n$(ECHO_DRIVER)cff       $(ECHO_DRIVER_DESC)OpenType fonts with extension *.otf$(ECHO_DRIVER_DONE)\nendef\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/cff/rules.mk",
    "content": "#\n# FreeType 2 OpenType/CFF driver configuration rules\n#\n\n\n# Copyright 1996-2001, 2003, 2011, 2013 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\n# OpenType driver directory\n#\nCFF_DIR := $(SRC_DIR)/cff\n\n\nCFF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(CFF_DIR))\n\n\n# CFF driver sources (i.e., C files)\n#\nCFF_DRV_SRC := $(CFF_DIR)/cffcmap.c  \\\n               $(CFF_DIR)/cffdrivr.c \\\n               $(CFF_DIR)/cffgload.c \\\n               $(CFF_DIR)/cffload.c  \\\n               $(CFF_DIR)/cffobjs.c  \\\n               $(CFF_DIR)/cffparse.c \\\n               $(CFF_DIR)/cffpic.c   \\\n               $(CFF_DIR)/cf2arrst.c \\\n               $(CFF_DIR)/cf2blues.c \\\n               $(CFF_DIR)/cf2error.c \\\n               $(CFF_DIR)/cf2font.c  \\\n               $(CFF_DIR)/cf2ft.c    \\\n               $(CFF_DIR)/cf2hints.c \\\n               $(CFF_DIR)/cf2intrp.c \\\n               $(CFF_DIR)/cf2read.c  \\\n               $(CFF_DIR)/cf2stack.c\n\n\n# CFF driver headers\n#\nCFF_DRV_H := $(CFF_DRV_SRC:%.c=%.h) \\\n             $(CFF_DIR)/cfferrs.h   \\\n             $(CFF_DIR)/cfftoken.h  \\\n             $(CFF_DIR)/cfftypes.h  \\\n             $(CFF_DIR)/cf2fixed.h  \\\n             $(CFF_DIR)/cf2glue.h   \\\n             $(CFF_DIR)/cf2types.h\n\n\n# CFF driver object(s)\n#\n#   CFF_DRV_OBJ_M is used during `multi' builds\n#   CFF_DRV_OBJ_S is used during `single' builds\n#\nCFF_DRV_OBJ_M := $(CFF_DRV_SRC:$(CFF_DIR)/%.c=$(OBJ_DIR)/%.$O)\nCFF_DRV_OBJ_S := $(OBJ_DIR)/cff.$O\n\n# CFF driver source file for single build\n#\nCFF_DRV_SRC_S := $(CFF_DIR)/cff.c\n\n\n# CFF driver - single object\n#\n$(CFF_DRV_OBJ_S): $(CFF_DRV_SRC_S) $(CFF_DRV_SRC) $(FREETYPE_H) $(CFF_DRV_H)\n\t$(CFF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(CFF_DRV_SRC_S))\n\n\n# CFF driver - multiple objects\n#\n$(OBJ_DIR)/%.$O: $(CFF_DIR)/%.c $(FREETYPE_H) $(CFF_DRV_H)\n\t$(CFF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\n\n\n# update main driver object lists\n#\nDRV_OBJS_S += $(CFF_DRV_OBJ_S)\nDRV_OBJS_M += $(CFF_DRV_OBJ_M)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/cid/Jamfile",
    "content": "# FreeType 2 src/cid Jamfile\n#\n# Copyright 2001 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) cid ;\n\n{\n  local  _sources ;\n\n  if $(FT2_MULTI)\n  {\n    _sources = cidobjs cidload cidgload cidriver cidparse ;\n  }\n  else\n  {\n    _sources = type1cid ;\n  }\n\n  Library  $(FT2_LIB) : $(_sources).c ;\n}\n\n# end of src/cid Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/cid/ciderrs.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ciderrs.h                                                              */\n/*                                                                         */\n/*    CID error codes (specification only).                                */\n/*                                                                         */\n/*  Copyright 2001, 2012 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the CID error enumeration constants.      */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __CIDERRS_H__\n#define __CIDERRS_H__\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  CID_Err_\n#define FT_ERR_BASE    FT_Mod_Err_CID\n\n#include FT_ERRORS_H\n\n#endif /* __CIDERRS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cid/cidgload.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cidgload.c                                                             */\n/*                                                                         */\n/*    CID-keyed Type1 Glyph Loader (body).                                 */\n/*                                                                         */\n/*  Copyright 1996-2007, 2009, 2010, 2013 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include \"cidload.h\"\n#include \"cidgload.h\"\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_OUTLINE_H\n#include FT_INTERNAL_CALC_H\n\n#include \"ciderrs.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_cidgload\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  cid_load_glyph( T1_Decoder  decoder,\n                  FT_UInt     glyph_index )\n  {\n    CID_Face       face = (CID_Face)decoder->builder.face;\n    CID_FaceInfo   cid  = &face->cid;\n    FT_Byte*       p;\n    FT_UInt        fd_select;\n    FT_Stream      stream       = face->cid_stream;\n    FT_Error       error        = FT_Err_Ok;\n    FT_Byte*       charstring   = 0;\n    FT_Memory      memory       = face->root.memory;\n    FT_ULong       glyph_length = 0;\n    PSAux_Service  psaux        = (PSAux_Service)face->psaux;\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n    FT_Incremental_InterfaceRec *inc =\n                                  face->root.internal->incremental_interface;\n#endif\n\n\n    FT_TRACE1(( \"cid_load_glyph: glyph index %d\\n\", glyph_index ));\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n\n    /* For incremental fonts get the character data using */\n    /* the callback function.                             */\n    if ( inc )\n    {\n      FT_Data  glyph_data;\n\n\n      error = inc->funcs->get_glyph_data( inc->object,\n                                          glyph_index, &glyph_data );\n      if ( error )\n        goto Exit;\n\n      p         = (FT_Byte*)glyph_data.pointer;\n      fd_select = (FT_UInt)cid_get_offset( &p, (FT_Byte)cid->fd_bytes );\n\n      if ( glyph_data.length != 0 )\n      {\n        glyph_length = glyph_data.length - cid->fd_bytes;\n        (void)FT_ALLOC( charstring, glyph_length );\n        if ( !error )\n          ft_memcpy( charstring, glyph_data.pointer + cid->fd_bytes,\n                     glyph_length );\n      }\n\n      inc->funcs->free_glyph_data( inc->object, &glyph_data );\n\n      if ( error )\n        goto Exit;\n    }\n\n    else\n\n#endif /* FT_CONFIG_OPTION_INCREMENTAL */\n\n    /* For ordinary fonts read the CID font dictionary index */\n    /* and charstring offset from the CIDMap.                */\n    {\n      FT_UInt   entry_len = cid->fd_bytes + cid->gd_bytes;\n      FT_ULong  off1;\n\n\n      if ( FT_STREAM_SEEK( cid->data_offset + cid->cidmap_offset +\n                           glyph_index * entry_len )               ||\n           FT_FRAME_ENTER( 2 * entry_len )                         )\n        goto Exit;\n\n      p            = (FT_Byte*)stream->cursor;\n      fd_select    = (FT_UInt) cid_get_offset( &p, (FT_Byte)cid->fd_bytes );\n      off1         = (FT_ULong)cid_get_offset( &p, (FT_Byte)cid->gd_bytes );\n      p           += cid->fd_bytes;\n      glyph_length = cid_get_offset( &p, (FT_Byte)cid->gd_bytes ) - off1;\n      FT_FRAME_EXIT();\n\n      if ( fd_select >= (FT_UInt)cid->num_dicts )\n      {\n        error = FT_THROW( Invalid_Offset );\n        goto Exit;\n      }\n      if ( glyph_length == 0 )\n        goto Exit;\n      if ( FT_ALLOC( charstring, glyph_length ) )\n        goto Exit;\n      if ( FT_STREAM_READ_AT( cid->data_offset + off1,\n                              charstring, glyph_length ) )\n        goto Exit;\n    }\n\n    /* Now set up the subrs array and parse the charstrings. */\n    {\n      CID_FaceDict  dict;\n      CID_Subrs     cid_subrs = face->subrs + fd_select;\n      FT_Int        cs_offset;\n\n\n      /* Set up subrs */\n      decoder->num_subrs = cid_subrs->num_subrs;\n      decoder->subrs     = cid_subrs->code;\n      decoder->subrs_len = 0;\n\n      /* Set up font matrix */\n      dict                 = cid->font_dicts + fd_select;\n\n      decoder->font_matrix = dict->font_matrix;\n      decoder->font_offset = dict->font_offset;\n      decoder->lenIV       = dict->private_dict.lenIV;\n\n      /* Decode the charstring. */\n\n      /* Adjustment for seed bytes. */\n      cs_offset = ( decoder->lenIV >= 0 ? decoder->lenIV : 0 );\n\n      /* Decrypt only if lenIV >= 0. */\n      if ( decoder->lenIV >= 0 )\n        psaux->t1_decrypt( charstring, glyph_length, 4330 );\n\n      error = decoder->funcs.parse_charstrings(\n                decoder, charstring + cs_offset,\n                (FT_Int)glyph_length - cs_offset );\n    }\n\n    FT_FREE( charstring );\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n\n    /* Incremental fonts can optionally override the metrics. */\n    if ( !error && inc && inc->funcs->get_glyph_metrics )\n    {\n      FT_Incremental_MetricsRec  metrics;\n\n\n      metrics.bearing_x = FIXED_TO_INT( decoder->builder.left_bearing.x );\n      metrics.bearing_y = 0;\n      metrics.advance   = FIXED_TO_INT( decoder->builder.advance.x );\n      metrics.advance_v = FIXED_TO_INT( decoder->builder.advance.y );\n\n      error = inc->funcs->get_glyph_metrics( inc->object,\n                                             glyph_index, FALSE, &metrics );\n\n      decoder->builder.left_bearing.x = INT_TO_FIXED( metrics.bearing_x );\n      decoder->builder.advance.x      = INT_TO_FIXED( metrics.advance );\n      decoder->builder.advance.y      = INT_TO_FIXED( metrics.advance_v );\n    }\n\n#endif /* FT_CONFIG_OPTION_INCREMENTAL */\n\n  Exit:\n    return error;\n  }\n\n\n#if 0\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /**********                                                      *********/\n  /**********                                                      *********/\n  /**********            COMPUTE THE MAXIMUM ADVANCE WIDTH         *********/\n  /**********                                                      *********/\n  /**********    The following code is in charge of computing      *********/\n  /**********    the maximum advance width of the font.  It        *********/\n  /**********    quickly processes each glyph charstring to        *********/\n  /**********    extract the value from either a `sbw' or `seac'   *********/\n  /**********    operator.                                         *********/\n  /**********                                                      *********/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  FT_LOCAL_DEF( FT_Error )\n  cid_face_compute_max_advance( CID_Face  face,\n                                FT_Int*   max_advance )\n  {\n    FT_Error       error;\n    T1_DecoderRec  decoder;\n    FT_Int         glyph_index;\n\n    PSAux_Service  psaux = (PSAux_Service)face->psaux;\n\n\n    *max_advance = 0;\n\n    /* Initialize load decoder */\n    error = psaux->t1_decoder_funcs->init( &decoder,\n                                           (FT_Face)face,\n                                           0, /* size       */\n                                           0, /* glyph slot */\n                                           0, /* glyph names! XXX */\n                                           0, /* blend == 0 */\n                                           0, /* hinting == 0 */\n                                           cid_load_glyph );\n    if ( error )\n      return error;\n\n    /* TODO: initialize decoder.len_buildchar and decoder.buildchar */\n    /*       if we ever support CID-keyed multiple master fonts     */\n\n    decoder.builder.metrics_only = 1;\n    decoder.builder.load_points  = 0;\n\n    /* for each glyph, parse the glyph charstring and extract */\n    /* the advance width                                      */\n    for ( glyph_index = 0; glyph_index < face->root.num_glyphs;\n          glyph_index++ )\n    {\n      /* now get load the unscaled outline */\n      error = cid_load_glyph( &decoder, glyph_index );\n      /* ignore the error if one occurred - skip to next glyph */\n    }\n\n    *max_advance = FIXED_TO_INT( decoder.builder.advance.x );\n\n    psaux->t1_decoder_funcs->done( &decoder );\n\n    return FT_Err_Ok;\n  }\n\n\n#endif /* 0 */\n\n\n  FT_LOCAL_DEF( FT_Error )\n  cid_slot_load_glyph( FT_GlyphSlot  cidglyph,      /* CID_GlyphSlot */\n                       FT_Size       cidsize,       /* CID_Size      */\n                       FT_UInt       glyph_index,\n                       FT_Int32      load_flags )\n  {\n    CID_GlyphSlot  glyph = (CID_GlyphSlot)cidglyph;\n    FT_Error       error;\n    T1_DecoderRec  decoder;\n    CID_Face       face = (CID_Face)cidglyph->face;\n    FT_Bool        hinting;\n\n    PSAux_Service  psaux = (PSAux_Service)face->psaux;\n    FT_Matrix      font_matrix;\n    FT_Vector      font_offset;\n\n\n    if ( glyph_index >= (FT_UInt)face->root.num_glyphs )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    if ( load_flags & FT_LOAD_NO_RECURSE )\n      load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;\n\n    glyph->x_scale = cidsize->metrics.x_scale;\n    glyph->y_scale = cidsize->metrics.y_scale;\n\n    cidglyph->outline.n_points   = 0;\n    cidglyph->outline.n_contours = 0;\n\n    hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE   ) == 0 &&\n                       ( load_flags & FT_LOAD_NO_HINTING ) == 0 );\n\n    cidglyph->format = FT_GLYPH_FORMAT_OUTLINE;\n\n    error = psaux->t1_decoder_funcs->init( &decoder,\n                                           cidglyph->face,\n                                           cidsize,\n                                           cidglyph,\n                                           0, /* glyph names -- XXX */\n                                           0, /* blend == 0 */\n                                           hinting,\n                                           FT_LOAD_TARGET_MODE( load_flags ),\n                                           cid_load_glyph );\n    if ( error )\n      goto Exit;\n\n    /* TODO: initialize decoder.len_buildchar and decoder.buildchar */\n    /*       if we ever support CID-keyed multiple master fonts     */\n\n    /* set up the decoder */\n    decoder.builder.no_recurse = FT_BOOL(\n      ( ( load_flags & FT_LOAD_NO_RECURSE ) != 0 ) );\n\n    error = cid_load_glyph( &decoder, glyph_index );\n    if ( error )\n      goto Exit;\n\n    font_matrix = decoder.font_matrix;\n    font_offset = decoder.font_offset;\n\n    /* save new glyph tables */\n    psaux->t1_decoder_funcs->done( &decoder );\n\n    /* now set the metrics -- this is rather simple, as    */\n    /* the left side bearing is the xMin, and the top side */\n    /* bearing the yMax                                    */\n    cidglyph->outline.flags &= FT_OUTLINE_OWNER;\n    cidglyph->outline.flags |= FT_OUTLINE_REVERSE_FILL;\n\n    /* for composite glyphs, return only left side bearing and */\n    /* advance width                                           */\n    if ( load_flags & FT_LOAD_NO_RECURSE )\n    {\n      FT_Slot_Internal  internal = cidglyph->internal;\n\n\n      cidglyph->metrics.horiBearingX =\n        FIXED_TO_INT( decoder.builder.left_bearing.x );\n      cidglyph->metrics.horiAdvance =\n        FIXED_TO_INT( decoder.builder.advance.x );\n\n      internal->glyph_matrix      = font_matrix;\n      internal->glyph_delta       = font_offset;\n      internal->glyph_transformed = 1;\n    }\n    else\n    {\n      FT_BBox            cbox;\n      FT_Glyph_Metrics*  metrics = &cidglyph->metrics;\n      FT_Vector          advance;\n\n\n      /* copy the _unscaled_ advance width */\n      metrics->horiAdvance =\n        FIXED_TO_INT( decoder.builder.advance.x );\n      cidglyph->linearHoriAdvance =\n        FIXED_TO_INT( decoder.builder.advance.x );\n      cidglyph->internal->glyph_transformed = 0;\n\n      /* make up vertical ones */\n      metrics->vertAdvance        = ( face->cid.font_bbox.yMax -\n                                      face->cid.font_bbox.yMin ) >> 16;\n      cidglyph->linearVertAdvance = metrics->vertAdvance;\n\n      cidglyph->format            = FT_GLYPH_FORMAT_OUTLINE;\n\n      if ( cidsize->metrics.y_ppem < 24 )\n        cidglyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION;\n\n      /* apply the font matrix */\n      FT_Outline_Transform( &cidglyph->outline, &font_matrix );\n\n      FT_Outline_Translate( &cidglyph->outline,\n                            font_offset.x,\n                            font_offset.y );\n\n      advance.x = metrics->horiAdvance;\n      advance.y = 0;\n      FT_Vector_Transform( &advance, &font_matrix );\n      metrics->horiAdvance = advance.x + font_offset.x;\n\n      advance.x = 0;\n      advance.y = metrics->vertAdvance;\n      FT_Vector_Transform( &advance, &font_matrix );\n      metrics->vertAdvance = advance.y + font_offset.y;\n\n      if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 )\n      {\n        /* scale the outline and the metrics */\n        FT_Int       n;\n        FT_Outline*  cur = decoder.builder.base;\n        FT_Vector*   vec = cur->points;\n        FT_Fixed     x_scale = glyph->x_scale;\n        FT_Fixed     y_scale = glyph->y_scale;\n\n\n        /* First of all, scale the points */\n        if ( !hinting || !decoder.builder.hints_funcs )\n          for ( n = cur->n_points; n > 0; n--, vec++ )\n          {\n            vec->x = FT_MulFix( vec->x, x_scale );\n            vec->y = FT_MulFix( vec->y, y_scale );\n          }\n\n        /* Then scale the metrics */\n        metrics->horiAdvance = FT_MulFix( metrics->horiAdvance, x_scale );\n        metrics->vertAdvance = FT_MulFix( metrics->vertAdvance, y_scale );\n      }\n\n      /* compute the other metrics */\n      FT_Outline_Get_CBox( &cidglyph->outline, &cbox );\n\n      metrics->width  = cbox.xMax - cbox.xMin;\n      metrics->height = cbox.yMax - cbox.yMin;\n\n      metrics->horiBearingX = cbox.xMin;\n      metrics->horiBearingY = cbox.yMax;\n\n      if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )\n      {\n        /* make up vertical ones */\n        ft_synthesize_vertical_metrics( metrics,\n                                        metrics->vertAdvance );\n      }\n    }\n\n  Exit:\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cid/cidgload.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cidgload.h                                                             */\n/*                                                                         */\n/*    OpenType Glyph Loader (specification).                               */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2004 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CIDGLOAD_H__\n#define __CIDGLOAD_H__\n\n\n#include <ft2build.h>\n#include \"cidobjs.h\"\n\n\nFT_BEGIN_HEADER\n\n\n#if 0\n\n  /* Compute the maximum advance width of a font through quick parsing */\n  FT_LOCAL( FT_Error )\n  cid_face_compute_max_advance( CID_Face  face,\n                                FT_Int*   max_advance );\n\n#endif /* 0 */\n\n  FT_LOCAL( FT_Error )\n  cid_slot_load_glyph( FT_GlyphSlot  glyph,         /* CID_Glyph_Slot */\n                       FT_Size       size,          /* CID_Size       */\n                       FT_UInt       glyph_index,\n                       FT_Int32      load_flags );\n\n\nFT_END_HEADER\n\n#endif /* __CIDGLOAD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cid/cidload.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cidload.c                                                              */\n/*                                                                         */\n/*    CID-keyed Type1 font loader (body).                                  */\n/*                                                                         */\n/*  Copyright 1996-2006, 2009, 2011-2014 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_CONFIG_CONFIG_H\n#include FT_MULTIPLE_MASTERS_H\n#include FT_INTERNAL_TYPE1_TYPES_H\n\n#include \"cidload.h\"\n\n#include \"ciderrs.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_cidload\n\n\n  /* read a single offset */\n  FT_LOCAL_DEF( FT_Long )\n  cid_get_offset( FT_Byte*  *start,\n                  FT_Byte    offsize )\n  {\n    FT_ULong  result;\n    FT_Byte*  p = *start;\n\n\n    for ( result = 0; offsize > 0; offsize-- )\n    {\n      result <<= 8;\n      result  |= *p++;\n    }\n\n    *start = p;\n    return (FT_Long)result;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    TYPE 1 SYMBOL PARSING                      *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  static FT_Error\n  cid_load_keyword( CID_Face        face,\n                    CID_Loader*     loader,\n                    const T1_Field  keyword )\n  {\n    FT_Error      error;\n    CID_Parser*   parser = &loader->parser;\n    FT_Byte*      object;\n    void*         dummy_object;\n    CID_FaceInfo  cid = &face->cid;\n\n\n    /* if the keyword has a dedicated callback, call it */\n    if ( keyword->type == T1_FIELD_TYPE_CALLBACK )\n    {\n      keyword->reader( (FT_Face)face, parser );\n      error = parser->root.error;\n      goto Exit;\n    }\n\n    /* we must now compute the address of our target object */\n    switch ( keyword->location )\n    {\n    case T1_FIELD_LOCATION_CID_INFO:\n      object = (FT_Byte*)cid;\n      break;\n\n    case T1_FIELD_LOCATION_FONT_INFO:\n      object = (FT_Byte*)&cid->font_info;\n      break;\n\n    case T1_FIELD_LOCATION_FONT_EXTRA:\n      object = (FT_Byte*)&face->font_extra;\n      break;\n\n    case T1_FIELD_LOCATION_BBOX:\n      object = (FT_Byte*)&cid->font_bbox;\n      break;\n\n    default:\n      {\n        CID_FaceDict  dict;\n\n\n        if ( parser->num_dict < 0 || parser->num_dict >= cid->num_dicts )\n        {\n          FT_ERROR(( \"cid_load_keyword: invalid use of `%s'\\n\",\n                     keyword->ident ));\n          error = FT_THROW( Syntax_Error );\n          goto Exit;\n        }\n\n        dict = cid->font_dicts + parser->num_dict;\n        switch ( keyword->location )\n        {\n        case T1_FIELD_LOCATION_PRIVATE:\n          object = (FT_Byte*)&dict->private_dict;\n          break;\n\n        default:\n          object = (FT_Byte*)dict;\n        }\n      }\n    }\n\n    dummy_object = object;\n\n    /* now, load the keyword data in the object's field(s) */\n    if ( keyword->type == T1_FIELD_TYPE_INTEGER_ARRAY ||\n         keyword->type == T1_FIELD_TYPE_FIXED_ARRAY   )\n      error = cid_parser_load_field_table( &loader->parser, keyword,\n                                           &dummy_object );\n    else\n      error = cid_parser_load_field( &loader->parser,\n                                     keyword, &dummy_object );\n  Exit:\n    return error;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  cid_parse_font_matrix( CID_Face     face,\n                         CID_Parser*  parser )\n  {\n    CID_FaceDict  dict;\n    FT_Face       root = (FT_Face)&face->root;\n    FT_Fixed      temp[6];\n    FT_Fixed      temp_scale;\n\n\n    if ( parser->num_dict >= 0 && parser->num_dict < face->cid.num_dicts )\n    {\n      FT_Matrix*  matrix;\n      FT_Vector*  offset;\n      FT_Int      result;\n\n\n      dict   = face->cid.font_dicts + parser->num_dict;\n      matrix = &dict->font_matrix;\n      offset = &dict->font_offset;\n\n      result = cid_parser_to_fixed_array( parser, 6, temp, 3 );\n\n      if ( result < 6 )\n        return FT_THROW( Invalid_File_Format );\n\n      temp_scale = FT_ABS( temp[3] );\n\n      if ( temp_scale == 0 )\n      {\n        FT_ERROR(( \"cid_parse_font_matrix: invalid font matrix\\n\" ));\n        return FT_THROW( Invalid_File_Format );\n      }\n\n      /* Set Units per EM based on FontMatrix values.  We set the value to */\n      /* 1000 / temp_scale, because temp_scale was already multiplied by   */\n      /* 1000 (in t1_tofixed, from psobjs.c).                              */\n\n      root->units_per_EM = (FT_UShort)FT_DivFix( 1000, temp_scale );\n\n      /* we need to scale the values by 1.0/temp[3] */\n      if ( temp_scale != 0x10000L )\n      {\n        temp[0] = FT_DivFix( temp[0], temp_scale );\n        temp[1] = FT_DivFix( temp[1], temp_scale );\n        temp[2] = FT_DivFix( temp[2], temp_scale );\n        temp[4] = FT_DivFix( temp[4], temp_scale );\n        temp[5] = FT_DivFix( temp[5], temp_scale );\n        temp[3] = temp[3] < 0 ? -0x10000L : 0x10000L;\n      }\n\n      matrix->xx = temp[0];\n      matrix->yx = temp[1];\n      matrix->xy = temp[2];\n      matrix->yy = temp[3];\n\n      /* note that the font offsets are expressed in integer font units */\n      offset->x  = temp[4] >> 16;\n      offset->y  = temp[5] >> 16;\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  parse_fd_array( CID_Face     face,\n                  CID_Parser*  parser )\n  {\n    CID_FaceInfo  cid    = &face->cid;\n    FT_Memory     memory = face->root.memory;\n    FT_Error      error  = FT_Err_Ok;\n    FT_Long       num_dicts;\n\n\n    num_dicts = cid_parser_to_int( parser );\n\n    if ( !cid->font_dicts )\n    {\n      FT_Int  n;\n\n\n      if ( FT_NEW_ARRAY( cid->font_dicts, num_dicts ) )\n        goto Exit;\n\n      cid->num_dicts = (FT_UInt)num_dicts;\n\n      /* don't forget to set a few defaults */\n      for ( n = 0; n < cid->num_dicts; n++ )\n      {\n        CID_FaceDict  dict = cid->font_dicts + n;\n\n\n        /* default value for lenIV */\n        dict->private_dict.lenIV = 4;\n      }\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /* by mistake, `expansion_factor' appears both in PS_PrivateRec */\n  /* and CID_FaceDictRec (both are public header files and can't  */\n  /* changed); we simply copy the value                           */\n\n  FT_CALLBACK_DEF( FT_Error )\n  parse_expansion_factor( CID_Face     face,\n                          CID_Parser*  parser )\n  {\n    CID_FaceDict  dict;\n\n\n    if ( parser->num_dict >= 0 && parser->num_dict < face->cid.num_dicts )\n    {\n      dict = face->cid.font_dicts + parser->num_dict;\n\n      dict->expansion_factor              = cid_parser_to_fixed( parser, 0 );\n      dict->private_dict.expansion_factor = dict->expansion_factor;\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n  static\n  const T1_FieldRec  cid_field_records[] =\n  {\n\n#include \"cidtoken.h\"\n\n    T1_FIELD_CALLBACK( \"FDArray\",         parse_fd_array, 0 )\n    T1_FIELD_CALLBACK( \"FontMatrix\",      cid_parse_font_matrix, 0 )\n    T1_FIELD_CALLBACK( \"ExpansionFactor\", parse_expansion_factor, 0 )\n\n    { 0, T1_FIELD_LOCATION_CID_INFO, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0, 0 }\n  };\n\n\n  static FT_Error\n  cid_parse_dict( CID_Face     face,\n                  CID_Loader*  loader,\n                  FT_Byte*     base,\n                  FT_Long      size )\n  {\n    CID_Parser*  parser = &loader->parser;\n\n\n    parser->root.cursor = base;\n    parser->root.limit  = base + size;\n    parser->root.error  = FT_Err_Ok;\n\n    {\n      FT_Byte*  cur   = base;\n      FT_Byte*  limit = cur + size;\n\n\n      for (;;)\n      {\n        FT_Byte*  newlimit;\n\n\n        parser->root.cursor = cur;\n        cid_parser_skip_spaces( parser );\n\n        if ( parser->root.cursor >= limit )\n          newlimit = limit - 1 - 17;\n        else\n          newlimit = parser->root.cursor - 17;\n\n        /* look for `%ADOBeginFontDict' */\n        for ( ; cur < newlimit; cur++ )\n        {\n          if ( *cur == '%'                                            &&\n               ft_strncmp( (char*)cur, \"%ADOBeginFontDict\", 17 ) == 0 )\n          {\n            /* if /FDArray was found, then cid->num_dicts is > 0, and */\n            /* we can start increasing parser->num_dict               */\n            if ( face->cid.num_dicts > 0 )\n              parser->num_dict++;\n          }\n        }\n\n        cur = parser->root.cursor;\n        /* no error can occur in cid_parser_skip_spaces */\n        if ( cur >= limit )\n          break;\n\n        cid_parser_skip_PS_token( parser );\n        if ( parser->root.cursor >= limit || parser->root.error )\n          break;\n\n        /* look for immediates */\n        if ( *cur == '/' && cur + 2 < limit )\n        {\n          FT_PtrDist  len;\n\n\n          cur++;\n          len = parser->root.cursor - cur;\n\n          if ( len > 0 && len < 22 )\n          {\n            /* now compare the immediate name to the keyword table */\n            T1_Field  keyword = (T1_Field)cid_field_records;\n\n\n            for (;;)\n            {\n              FT_Byte*  name;\n\n\n              name = (FT_Byte*)keyword->ident;\n              if ( !name )\n                break;\n\n              if ( cur[0] == name[0]                                 &&\n                   len == (FT_PtrDist)ft_strlen( (const char*)name ) )\n              {\n                FT_PtrDist  n;\n\n\n                for ( n = 1; n < len; n++ )\n                  if ( cur[n] != name[n] )\n                    break;\n\n                if ( n >= len )\n                {\n                  /* we found it - run the parsing callback */\n                  parser->root.error = cid_load_keyword( face,\n                                                         loader,\n                                                         keyword );\n                  if ( parser->root.error )\n                    return parser->root.error;\n                  break;\n                }\n              }\n              keyword++;\n            }\n          }\n        }\n\n        cur = parser->root.cursor;\n      }\n    }\n    return parser->root.error;\n  }\n\n\n  /* read the subrmap and the subrs of each font dict */\n  static FT_Error\n  cid_read_subrs( CID_Face  face )\n  {\n    CID_FaceInfo   cid    = &face->cid;\n    FT_Memory      memory = face->root.memory;\n    FT_Stream      stream = face->cid_stream;\n    FT_Error       error;\n    FT_Int         n;\n    CID_Subrs      subr;\n    FT_UInt        max_offsets = 0;\n    FT_ULong*      offsets = 0;\n    PSAux_Service  psaux = (PSAux_Service)face->psaux;\n\n\n    if ( FT_NEW_ARRAY( face->subrs, cid->num_dicts ) )\n      goto Exit;\n\n    subr = face->subrs;\n    for ( n = 0; n < cid->num_dicts; n++, subr++ )\n    {\n      CID_FaceDict  dict  = cid->font_dicts + n;\n      FT_Int        lenIV = dict->private_dict.lenIV;\n      FT_UInt       count, num_subrs = dict->num_subrs;\n      FT_ULong      data_len;\n      FT_Byte*      p;\n\n\n      /* Check for possible overflow. */\n      if ( num_subrs == FT_UINT_MAX )\n      {\n        error = FT_THROW( Syntax_Error );\n        goto Fail;\n      }\n\n      /* reallocate offsets array if needed */\n      if ( num_subrs + 1 > max_offsets )\n      {\n        FT_UInt  new_max = FT_PAD_CEIL( num_subrs + 1, 4 );\n\n\n        if ( new_max <= max_offsets )\n        {\n          error = FT_THROW( Syntax_Error );\n          goto Fail;\n        }\n\n        if ( FT_RENEW_ARRAY( offsets, max_offsets, new_max ) )\n          goto Fail;\n\n        max_offsets = new_max;\n      }\n\n      /* read the subrmap's offsets */\n      if ( FT_STREAM_SEEK( cid->data_offset + dict->subrmap_offset ) ||\n           FT_FRAME_ENTER( ( num_subrs + 1 ) * dict->sd_bytes )      )\n        goto Fail;\n\n      p = (FT_Byte*)stream->cursor;\n      for ( count = 0; count <= num_subrs; count++ )\n        offsets[count] = cid_get_offset( &p, (FT_Byte)dict->sd_bytes );\n\n      FT_FRAME_EXIT();\n\n      /* offsets must be ordered */\n      for ( count = 1; count <= num_subrs; count++ )\n        if ( offsets[count - 1] > offsets[count] )\n          goto Fail;\n\n      /* now, compute the size of subrs charstrings, */\n      /* allocate, and read them                     */\n      data_len = offsets[num_subrs] - offsets[0];\n\n      if ( FT_NEW_ARRAY( subr->code, num_subrs + 1 ) ||\n               FT_ALLOC( subr->code[0], data_len )   )\n        goto Fail;\n\n      if ( FT_STREAM_SEEK( cid->data_offset + offsets[0] ) ||\n           FT_STREAM_READ( subr->code[0], data_len )  )\n        goto Fail;\n\n      /* set up pointers */\n      for ( count = 1; count <= num_subrs; count++ )\n      {\n        FT_ULong  len;\n\n\n        len               = offsets[count] - offsets[count - 1];\n        subr->code[count] = subr->code[count - 1] + len;\n      }\n\n      /* decrypt subroutines, but only if lenIV >= 0 */\n      if ( lenIV >= 0 )\n      {\n        for ( count = 0; count < num_subrs; count++ )\n        {\n          FT_ULong  len;\n\n\n          len = offsets[count + 1] - offsets[count];\n          psaux->t1_decrypt( subr->code[count], len, 4330 );\n        }\n      }\n\n      subr->num_subrs = num_subrs;\n    }\n\n  Exit:\n    FT_FREE( offsets );\n    return error;\n\n  Fail:\n    if ( face->subrs )\n    {\n      for ( n = 0; n < cid->num_dicts; n++ )\n      {\n        if ( face->subrs[n].code )\n          FT_FREE( face->subrs[n].code[0] );\n\n        FT_FREE( face->subrs[n].code );\n      }\n      FT_FREE( face->subrs );\n    }\n    goto Exit;\n  }\n\n\n  static void\n  cid_init_loader( CID_Loader*  loader,\n                   CID_Face     face )\n  {\n    FT_UNUSED( face );\n\n    FT_MEM_ZERO( loader, sizeof ( *loader ) );\n  }\n\n\n  static  void\n  cid_done_loader( CID_Loader*  loader )\n  {\n    CID_Parser*  parser = &loader->parser;\n\n\n    /* finalize parser */\n    cid_parser_done( parser );\n  }\n\n\n  static FT_Error\n  cid_hex_to_binary( FT_Byte*  data,\n                     FT_Long   data_len,\n                     FT_ULong  offset,\n                     CID_Face  face )\n  {\n    FT_Stream  stream = face->root.stream;\n    FT_Error   error;\n\n    FT_Byte    buffer[256];\n    FT_Byte   *p, *plimit;\n    FT_Byte   *d, *dlimit;\n    FT_Byte    val;\n\n    FT_Bool    upper_nibble, done;\n\n\n    if ( FT_STREAM_SEEK( offset ) )\n      goto Exit;\n\n    d      = data;\n    dlimit = d + data_len;\n    p      = buffer;\n    plimit = p;\n\n    upper_nibble = 1;\n    done         = 0;\n\n    while ( d < dlimit )\n    {\n      if ( p >= plimit )\n      {\n        FT_ULong  oldpos = FT_STREAM_POS();\n        FT_ULong  size   = stream->size - oldpos;\n\n\n        if ( size == 0 )\n        {\n          error = FT_THROW( Syntax_Error );\n          goto Exit;\n        }\n\n        if ( FT_STREAM_READ( buffer, 256 > size ? size : 256 ) )\n          goto Exit;\n        p      = buffer;\n        plimit = p + FT_STREAM_POS() - oldpos;\n      }\n\n      if ( ft_isdigit( *p ) )\n        val = (FT_Byte)( *p - '0' );\n      else if ( *p >= 'a' && *p <= 'f' )\n        val = (FT_Byte)( *p - 'a' );\n      else if ( *p >= 'A' && *p <= 'F' )\n        val = (FT_Byte)( *p - 'A' + 10 );\n      else if ( *p == ' '  ||\n                *p == '\\t' ||\n                *p == '\\r' ||\n                *p == '\\n' ||\n                *p == '\\f' ||\n                *p == '\\0' )\n      {\n        p++;\n        continue;\n      }\n      else if ( *p == '>' )\n      {\n        val  = 0;\n        done = 1;\n      }\n      else\n      {\n        error = FT_THROW( Syntax_Error );\n        goto Exit;\n      }\n\n      if ( upper_nibble )\n        *d = (FT_Byte)( val << 4 );\n      else\n      {\n        *d = (FT_Byte)( *d + val );\n        d++;\n      }\n\n      upper_nibble = (FT_Byte)( 1 - upper_nibble );\n\n      if ( done )\n        break;\n\n      p++;\n    }\n\n    error = FT_Err_Ok;\n\n  Exit:\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  cid_face_open( CID_Face  face,\n                 FT_Int    face_index )\n  {\n    CID_Loader   loader;\n    CID_Parser*  parser;\n    FT_Memory    memory = face->root.memory;\n    FT_Error     error;\n\n\n    cid_init_loader( &loader, face );\n\n    parser = &loader.parser;\n    error = cid_parser_new( parser, face->root.stream, face->root.memory,\n                            (PSAux_Service)face->psaux );\n    if ( error )\n      goto Exit;\n\n    error = cid_parse_dict( face, &loader,\n                            parser->postscript,\n                            parser->postscript_len );\n    if ( error )\n      goto Exit;\n\n    if ( face_index < 0 )\n      goto Exit;\n\n    if ( FT_NEW( face->cid_stream ) )\n      goto Exit;\n\n    if ( parser->binary_length )\n    {\n      /* we must convert the data section from hexadecimal to binary */\n      if ( FT_ALLOC( face->binary_data, parser->binary_length )         ||\n           cid_hex_to_binary( face->binary_data, parser->binary_length,\n                              parser->data_offset, face )               )\n        goto Exit;\n\n      FT_Stream_OpenMemory( face->cid_stream,\n                            face->binary_data, parser->binary_length );\n      face->cid.data_offset = 0;\n    }\n    else\n    {\n      *face->cid_stream     = *face->root.stream;\n      face->cid.data_offset = loader.parser.data_offset;\n    }\n\n    error = cid_read_subrs( face );\n\n  Exit:\n    cid_done_loader( &loader );\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cid/cidload.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cidload.h                                                              */\n/*                                                                         */\n/*    CID-keyed Type1 font loader (specification).                         */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CIDLOAD_H__\n#define __CIDLOAD_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_STREAM_H\n#include \"cidparse.h\"\n\n\nFT_BEGIN_HEADER\n\n\n  typedef struct  CID_Loader_\n  {\n    CID_Parser  parser;          /* parser used to read the stream */\n    FT_Int      num_chars;       /* number of characters in encoding */\n\n  } CID_Loader;\n\n\n  FT_LOCAL( FT_Long )\n  cid_get_offset( FT_Byte**  start,\n                  FT_Byte    offsize );\n\n  FT_LOCAL( FT_Error )\n  cid_face_open( CID_Face  face,\n                 FT_Int    face_index );\n\n\nFT_END_HEADER\n\n#endif /* __CIDLOAD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cid/cidobjs.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cidobjs.c                                                              */\n/*                                                                         */\n/*    CID objects manager (body).                                          */\n/*                                                                         */\n/*  Copyright 1996-2006, 2008, 2010-2011, 2013 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n\n#include \"cidgload.h\"\n#include \"cidload.h\"\n\n#include FT_SERVICE_POSTSCRIPT_CMAPS_H\n#include FT_INTERNAL_POSTSCRIPT_AUX_H\n#include FT_INTERNAL_POSTSCRIPT_HINTS_H\n\n#include \"ciderrs.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_cidobjs\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                            SLOT  FUNCTIONS                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n  FT_LOCAL_DEF( void )\n  cid_slot_done( FT_GlyphSlot  slot )\n  {\n    slot->internal->glyph_hints = 0;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  cid_slot_init( FT_GlyphSlot  slot )\n  {\n    CID_Face          face;\n    PSHinter_Service  pshinter;\n\n\n    face     = (CID_Face)slot->face;\n    pshinter = (PSHinter_Service)face->pshinter;\n\n    if ( pshinter )\n    {\n      FT_Module  module;\n\n\n      module = FT_Get_Module( slot->face->driver->root.library,\n                              \"pshinter\" );\n      if ( module )\n      {\n        T1_Hints_Funcs  funcs;\n\n\n        funcs = pshinter->get_t1_funcs( module );\n        slot->internal->glyph_hints = (void*)funcs;\n      }\n    }\n\n    return 0;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                           SIZE  FUNCTIONS                             */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  static PSH_Globals_Funcs\n  cid_size_get_globals_funcs( CID_Size  size )\n  {\n    CID_Face          face     = (CID_Face)size->root.face;\n    PSHinter_Service  pshinter = (PSHinter_Service)face->pshinter;\n    FT_Module         module;\n\n\n    module = FT_Get_Module( size->root.face->driver->root.library,\n                            \"pshinter\" );\n    return ( module && pshinter && pshinter->get_globals_funcs )\n           ? pshinter->get_globals_funcs( module )\n           : 0;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cid_size_done( FT_Size  cidsize )         /* CID_Size */\n  {\n    CID_Size  size = (CID_Size)cidsize;\n\n\n    if ( cidsize->internal )\n    {\n      PSH_Globals_Funcs  funcs;\n\n\n      funcs = cid_size_get_globals_funcs( size );\n      if ( funcs )\n        funcs->destroy( (PSH_Globals)cidsize->internal );\n\n      cidsize->internal = 0;\n    }\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  cid_size_init( FT_Size  cidsize )     /* CID_Size */\n  {\n    CID_Size           size  = (CID_Size)cidsize;\n    FT_Error           error = FT_Err_Ok;\n    PSH_Globals_Funcs  funcs = cid_size_get_globals_funcs( size );\n\n\n    if ( funcs )\n    {\n      PSH_Globals   globals;\n      CID_Face      face = (CID_Face)cidsize->face;\n      CID_FaceDict  dict = face->cid.font_dicts + face->root.face_index;\n      PS_Private    priv = &dict->private_dict;\n\n\n      error = funcs->create( cidsize->face->memory, priv, &globals );\n      if ( !error )\n        cidsize->internal = (FT_Size_Internal)(void*)globals;\n    }\n\n    return error;\n  }\n\n\n  FT_LOCAL( FT_Error )\n  cid_size_request( FT_Size          size,\n                    FT_Size_Request  req )\n  {\n    PSH_Globals_Funcs  funcs;\n\n\n    FT_Request_Metrics( size->face, req );\n\n    funcs = cid_size_get_globals_funcs( (CID_Size)size );\n\n    if ( funcs )\n      funcs->set_scale( (PSH_Globals)size->internal,\n                        size->metrics.x_scale,\n                        size->metrics.y_scale,\n                        0, 0 );\n\n    return FT_Err_Ok;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                           FACE  FUNCTIONS                             */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    cid_face_done                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Finalizes a given face object.                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A pointer to the face object to destroy.                   */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  cid_face_done( FT_Face  cidface )         /* CID_Face */\n  {\n    CID_Face      face = (CID_Face)cidface;\n    FT_Memory     memory;\n    CID_FaceInfo  cid;\n    PS_FontInfo   info;\n\n\n    if ( !face )\n      return;\n\n    cid    = &face->cid;\n    info   = &cid->font_info;\n    memory = cidface->memory;\n\n    /* release subrs */\n    if ( face->subrs )\n    {\n      FT_Int  n;\n\n\n      for ( n = 0; n < cid->num_dicts; n++ )\n      {\n        CID_Subrs  subr = face->subrs + n;\n\n\n        if ( subr->code )\n        {\n          FT_FREE( subr->code[0] );\n          FT_FREE( subr->code );\n        }\n      }\n\n      FT_FREE( face->subrs );\n    }\n\n    /* release FontInfo strings */\n    FT_FREE( info->version );\n    FT_FREE( info->notice );\n    FT_FREE( info->full_name );\n    FT_FREE( info->family_name );\n    FT_FREE( info->weight );\n\n    /* release font dictionaries */\n    FT_FREE( cid->font_dicts );\n    cid->num_dicts = 0;\n\n    /* release other strings */\n    FT_FREE( cid->cid_font_name );\n    FT_FREE( cid->registry );\n    FT_FREE( cid->ordering );\n\n    cidface->family_name = 0;\n    cidface->style_name  = 0;\n\n    FT_FREE( face->binary_data );\n    FT_FREE( face->cid_stream );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    cid_face_init                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initializes a given CID face object.                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream     :: The source font stream.                              */\n  /*                                                                       */\n  /*    face_index :: The index of the font face in the resource.          */\n  /*                                                                       */\n  /*    num_params :: Number of additional generic parameters.  Ignored.   */\n  /*                                                                       */\n  /*    params     :: Additional generic parameters.  Ignored.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: The newly built face object.                         */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  cid_face_init( FT_Stream      stream,\n                 FT_Face        cidface,        /* CID_Face */\n                 FT_Int         face_index,\n                 FT_Int         num_params,\n                 FT_Parameter*  params )\n  {\n    CID_Face          face = (CID_Face)cidface;\n    FT_Error          error;\n    PSAux_Service     psaux;\n    PSHinter_Service  pshinter;\n\n    FT_UNUSED( num_params );\n    FT_UNUSED( params );\n    FT_UNUSED( stream );\n\n\n    cidface->num_faces = 1;\n\n    psaux = (PSAux_Service)face->psaux;\n    if ( !psaux )\n    {\n      psaux = (PSAux_Service)FT_Get_Module_Interface(\n                FT_FACE_LIBRARY( face ), \"psaux\" );\n\n      if ( !psaux )\n      {\n        FT_ERROR(( \"cid_face_init: cannot access `psaux' module\\n\" ));\n        error = FT_THROW( Missing_Module );\n        goto Exit;\n      }\n\n      face->psaux = psaux;\n    }\n\n    pshinter = (PSHinter_Service)face->pshinter;\n    if ( !pshinter )\n    {\n      pshinter = (PSHinter_Service)FT_Get_Module_Interface(\n                   FT_FACE_LIBRARY( face ), \"pshinter\" );\n\n      face->pshinter = pshinter;\n    }\n\n    FT_TRACE2(( \"CID driver\\n\" ));\n\n    /* open the tokenizer; this will also check the font format */\n    if ( FT_STREAM_SEEK( 0 ) )\n      goto Exit;\n\n    error = cid_face_open( face, face_index );\n    if ( error )\n      goto Exit;\n\n    /* if we just wanted to check the format, leave successfully now */\n    if ( face_index < 0 )\n      goto Exit;\n\n    /* check the face index */\n    /* XXX: handle CID fonts with more than a single face */\n    if ( face_index != 0 )\n    {\n      FT_ERROR(( \"cid_face_init: invalid face index\\n\" ));\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    /* now load the font program into the face object */\n\n    /* initialize the face object fields */\n\n    /* set up root face fields */\n    {\n      CID_FaceInfo  cid  = &face->cid;\n      PS_FontInfo   info = &cid->font_info;\n\n\n      cidface->num_glyphs   = cid->cid_count;\n      cidface->num_charmaps = 0;\n\n      cidface->face_index = face_index;\n\n      cidface->face_flags |= FT_FACE_FLAG_SCALABLE   | /* scalable outlines */\n                             FT_FACE_FLAG_HORIZONTAL | /* horizontal data   */\n                             FT_FACE_FLAG_HINTER;      /* has native hinter */\n\n      if ( info->is_fixed_pitch )\n        cidface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;\n\n      /* XXX: TODO: add kerning with .afm support */\n\n      /* get style name -- be careful, some broken fonts only */\n      /* have a /FontName dictionary entry!                   */\n      cidface->family_name = info->family_name;\n      /* assume \"Regular\" style if we don't know better */\n      cidface->style_name = (char *)\"Regular\";\n      if ( cidface->family_name )\n      {\n        char*  full   = info->full_name;\n        char*  family = cidface->family_name;\n\n\n        if ( full )\n        {\n          while ( *full )\n          {\n            if ( *full == *family )\n            {\n              family++;\n              full++;\n            }\n            else\n            {\n              if ( *full == ' ' || *full == '-' )\n                full++;\n              else if ( *family == ' ' || *family == '-' )\n                family++;\n              else\n              {\n                if ( !*family )\n                  cidface->style_name = full;\n                break;\n              }\n            }\n          }\n        }\n      }\n      else\n      {\n        /* do we have a `/FontName'? */\n        if ( cid->cid_font_name )\n          cidface->family_name = cid->cid_font_name;\n      }\n\n      /* compute style flags */\n      cidface->style_flags = 0;\n      if ( info->italic_angle )\n        cidface->style_flags |= FT_STYLE_FLAG_ITALIC;\n      if ( info->weight )\n      {\n        if ( !ft_strcmp( info->weight, \"Bold\"  ) ||\n             !ft_strcmp( info->weight, \"Black\" ) )\n          cidface->style_flags |= FT_STYLE_FLAG_BOLD;\n      }\n\n      /* no embedded bitmap support */\n      cidface->num_fixed_sizes = 0;\n      cidface->available_sizes = 0;\n\n      cidface->bbox.xMin =   cid->font_bbox.xMin            >> 16;\n      cidface->bbox.yMin =   cid->font_bbox.yMin            >> 16;\n      /* no `U' suffix here to 0xFFFF! */\n      cidface->bbox.xMax = ( cid->font_bbox.xMax + 0xFFFF ) >> 16;\n      cidface->bbox.yMax = ( cid->font_bbox.yMax + 0xFFFF ) >> 16;\n\n      if ( !cidface->units_per_EM )\n        cidface->units_per_EM = 1000;\n\n      cidface->ascender  = (FT_Short)( cidface->bbox.yMax );\n      cidface->descender = (FT_Short)( cidface->bbox.yMin );\n\n      cidface->height = (FT_Short)( ( cidface->units_per_EM * 12 ) / 10 );\n      if ( cidface->height < cidface->ascender - cidface->descender )\n        cidface->height = (FT_Short)( cidface->ascender - cidface->descender );\n\n      cidface->underline_position  = (FT_Short)info->underline_position;\n      cidface->underline_thickness = (FT_Short)info->underline_thickness;\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    cid_driver_init                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initializes a given CID driver object.                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    driver :: A handle to the target driver object.                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  cid_driver_init( FT_Module  driver )\n  {\n    FT_UNUSED( driver );\n\n    return FT_Err_Ok;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    cid_driver_done                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Finalizes a given CID driver.                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    driver :: A handle to the target CID driver.                       */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  cid_driver_done( FT_Module  driver )\n  {\n    FT_UNUSED( driver );\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cid/cidobjs.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cidobjs.h                                                              */\n/*                                                                         */\n/*    CID objects manager (specification).                                 */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2004, 2006 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CIDOBJS_H__\n#define __CIDOBJS_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n#include FT_CONFIG_CONFIG_H\n#include FT_INTERNAL_TYPE1_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /* The following structures must be defined by the hinter */\n  typedef struct CID_Size_Hints_   CID_Size_Hints;\n  typedef struct CID_Glyph_Hints_  CID_Glyph_Hints;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    CID_Driver                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a Type 1 driver object.                                */\n  /*                                                                       */\n  typedef struct CID_DriverRec_*  CID_Driver;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    CID_Size                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a Type 1 size object.                                  */\n  /*                                                                       */\n  typedef struct CID_SizeRec_*  CID_Size;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    CID_GlyphSlot                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a Type 1 glyph slot object.                            */\n  /*                                                                       */\n  typedef struct CID_GlyphSlotRec_*  CID_GlyphSlot;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    CID_CharMap                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a Type 1 character mapping object.                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The Type 1 format doesn't use a charmap but an encoding table.     */\n  /*    The driver is responsible for making up charmap objects            */\n  /*    corresponding to these tables.                                     */\n  /*                                                                       */\n  typedef struct CID_CharMapRec_*  CID_CharMap;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* HERE BEGINS THE TYPE 1 SPECIFIC STUFF                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  typedef struct  CID_SizeRec_\n  {\n    FT_SizeRec  root;\n    FT_Bool     valid;\n\n  } CID_SizeRec;\n\n\n  typedef struct  CID_GlyphSlotRec_\n  {\n    FT_GlyphSlotRec  root;\n\n    FT_Bool          hint;\n    FT_Bool          scaled;\n\n    FT_Fixed         x_scale;\n    FT_Fixed         y_scale;\n\n  } CID_GlyphSlotRec;\n\n\n  FT_LOCAL( void )\n  cid_slot_done( FT_GlyphSlot  slot );\n\n  FT_LOCAL( FT_Error )\n  cid_slot_init( FT_GlyphSlot  slot );\n\n\n  FT_LOCAL( void )\n  cid_size_done( FT_Size  size );       /* CID_Size */\n\n  FT_LOCAL( FT_Error )\n  cid_size_init( FT_Size  size );       /* CID_Size */\n\n  FT_LOCAL( FT_Error )\n  cid_size_request( FT_Size          size,      /* CID_Size */\n                    FT_Size_Request  req );\n\n  FT_LOCAL( FT_Error )\n  cid_face_init( FT_Stream      stream,\n                 FT_Face        face,           /* CID_Face */\n                 FT_Int         face_index,\n                 FT_Int         num_params,\n                 FT_Parameter*  params );\n\n  FT_LOCAL( void )\n  cid_face_done( FT_Face  face );               /* CID_Face */\n\n\n  FT_LOCAL( FT_Error )\n  cid_driver_init( FT_Module  driver );\n\n  FT_LOCAL( void )\n  cid_driver_done( FT_Module  driver );\n\n\nFT_END_HEADER\n\n#endif /* __CIDOBJS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cid/cidparse.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cidparse.c                                                             */\n/*                                                                         */\n/*    CID-keyed Type1 parser (body).                                       */\n/*                                                                         */\n/*  Copyright 1996-2007, 2009, 2013, 2014 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_STREAM_H\n\n#include \"cidparse.h\"\n\n#include \"ciderrs.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_cidparse\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    INPUT STREAM PARSER                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  FT_LOCAL_DEF( FT_Error )\n  cid_parser_new( CID_Parser*    parser,\n                  FT_Stream      stream,\n                  FT_Memory      memory,\n                  PSAux_Service  psaux )\n  {\n    FT_Error  error;\n    FT_ULong  base_offset, offset, ps_len;\n    FT_Byte   *cur, *limit;\n    FT_Byte   *arg1, *arg2;\n\n\n    FT_MEM_ZERO( parser, sizeof ( *parser ) );\n    psaux->ps_parser_funcs->init( &parser->root, 0, 0, memory );\n\n    parser->stream = stream;\n\n    base_offset = FT_STREAM_POS();\n\n    /* first of all, check the font format in the header */\n    if ( FT_FRAME_ENTER( 31 ) )\n      goto Exit;\n\n    if ( ft_strncmp( (char *)stream->cursor,\n                     \"%!PS-Adobe-3.0 Resource-CIDFont\", 31 ) )\n    {\n      FT_TRACE2(( \"  not a CID-keyed font\\n\" ));\n      error = FT_THROW( Unknown_File_Format );\n    }\n\n    FT_FRAME_EXIT();\n    if ( error )\n      goto Exit;\n\n  Again:\n    /* now, read the rest of the file until we find */\n    /* `StartData' or `/sfnts'                      */\n    {\n      FT_Byte   buffer[256 + 10];\n      FT_Long   read_len = 256 + 10; /* same as signed FT_Stream->size */\n      FT_Byte*  p        = buffer;\n\n\n      for ( offset = FT_STREAM_POS(); ; offset += 256 )\n      {\n        FT_Long  stream_len; /* same as signed FT_Stream->size */\n\n\n        stream_len = stream->size - FT_STREAM_POS();\n        if ( stream_len == 0 )\n        {\n          FT_TRACE2(( \"cid_parser_new: no `StartData' keyword found\\n\" ));\n          error = FT_THROW( Invalid_File_Format );\n          goto Exit;\n        }\n\n        read_len = FT_MIN( read_len, stream_len );\n        if ( FT_STREAM_READ( p, read_len ) )\n          goto Exit;\n\n        if ( read_len < 256 )\n          p[read_len]  = '\\0';\n\n        limit = p + read_len - 10;\n\n        for ( p = buffer; p < limit; p++ )\n        {\n          if ( p[0] == 'S' && ft_strncmp( (char*)p, \"StartData\", 9 ) == 0 )\n          {\n            /* save offset of binary data after `StartData' */\n            offset += (FT_ULong)( p - buffer + 10 );\n            goto Found;\n          }\n          else if ( p[1] == 's' && ft_strncmp( (char*)p, \"/sfnts\", 6 ) == 0 )\n          {\n            offset += (FT_ULong)( p - buffer + 7 );\n            goto Found;\n          }\n        }\n\n        FT_MEM_MOVE( buffer, p, 10 );\n        read_len = 256;\n        p = buffer + 10;\n      }\n    }\n\n  Found:\n    /* We have found the start of the binary data or the `/sfnts' token. */\n    /* Now rewind and extract the frame corresponding to this PostScript */\n    /* section.                                                          */\n\n    ps_len = offset - base_offset;\n    if ( FT_STREAM_SEEK( base_offset )                  ||\n         FT_FRAME_EXTRACT( ps_len, parser->postscript ) )\n      goto Exit;\n\n    parser->data_offset    = offset;\n    parser->postscript_len = ps_len;\n    parser->root.base      = parser->postscript;\n    parser->root.cursor    = parser->postscript;\n    parser->root.limit     = parser->root.cursor + ps_len;\n    parser->num_dict       = -1;\n\n    /* Finally, we check whether `StartData' or `/sfnts' was real --  */\n    /* it could be in a comment or string.  We also get the arguments */\n    /* of `StartData' to find out whether the data is represented in  */\n    /* binary or hex format.                                          */\n\n    arg1 = parser->root.cursor;\n    cid_parser_skip_PS_token( parser );\n    cid_parser_skip_spaces  ( parser );\n    arg2 = parser->root.cursor;\n    cid_parser_skip_PS_token( parser );\n    cid_parser_skip_spaces  ( parser );\n\n    limit = parser->root.limit;\n    cur   = parser->root.cursor;\n\n    while ( cur < limit )\n    {\n      if ( parser->root.error )\n      {\n        error = parser->root.error;\n        goto Exit;\n      }\n\n      if ( cur[0] == 'S' && ft_strncmp( (char*)cur, \"StartData\", 9 ) == 0 )\n      {\n        if ( ft_strncmp( (char*)arg1, \"(Hex)\", 5 ) == 0 )\n          parser->binary_length = ft_atol( (const char *)arg2 );\n\n        goto Exit;\n      }\n      else if ( cur[1] == 's' && ft_strncmp( (char*)cur, \"/sfnts\", 6 ) == 0 )\n      {\n        FT_TRACE2(( \"cid_parser_new: cannot handle Type 11 fonts\\n\" ));\n        error = FT_THROW( Unknown_File_Format );\n        goto Exit;\n      }\n\n      cid_parser_skip_PS_token( parser );\n      cid_parser_skip_spaces  ( parser );\n      arg1 = arg2;\n      arg2 = cur;\n      cur  = parser->root.cursor;\n    }\n\n    /* we haven't found the correct `StartData'; go back and continue */\n    /* searching                                                      */\n    FT_FRAME_RELEASE( parser->postscript );\n    if ( !FT_STREAM_SEEK( offset ) )\n      goto Again;\n\n  Exit:\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  cid_parser_done( CID_Parser*  parser )\n  {\n    /* always free the private dictionary */\n    if ( parser->postscript )\n    {\n      FT_Stream  stream = parser->stream;\n\n\n      FT_FRAME_RELEASE( parser->postscript );\n    }\n    parser->root.funcs.done( &parser->root );\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cid/cidparse.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cidparse.h                                                             */\n/*                                                                         */\n/*    CID-keyed Type1 parser (specification).                              */\n/*                                                                         */\n/*  Copyright 1996-2004, 2014 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CIDPARSE_H__\n#define __CIDPARSE_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_TYPE1_TYPES_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_POSTSCRIPT_AUX_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_Parser                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A CID_Parser is an object used to parse a Type 1 fonts very        */\n  /*    quickly.                                                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root           :: The root PS_ParserRec fields.                    */\n  /*                                                                       */\n  /*    stream         :: The current input stream.                        */\n  /*                                                                       */\n  /*    postscript     :: A pointer to the data to be parsed.              */\n  /*                                                                       */\n  /*    postscript_len :: The length of the data to be parsed.             */\n  /*                                                                       */\n  /*    data_offset    :: The start position of the binary data (i.e., the */\n  /*                      end of the data to be parsed.                    */\n  /*                                                                       */\n  /*    binary_length  :: The length of the data after the `StartData'     */\n  /*                      command if the data format is hexadecimal.       */\n  /*                                                                       */\n  /*    cid            :: A structure which holds the information about    */\n  /*                      the current font.                                */\n  /*                                                                       */\n  /*    num_dict       :: The number of font dictionaries.                 */\n  /*                                                                       */\n  typedef struct  CID_Parser_\n  {\n    PS_ParserRec  root;\n    FT_Stream     stream;\n\n    FT_Byte*      postscript;\n    FT_Long       postscript_len;\n\n    FT_ULong      data_offset;\n\n    FT_Long       binary_length;\n\n    CID_FaceInfo  cid;\n    FT_Int        num_dict;\n\n  } CID_Parser;\n\n\n  FT_LOCAL( FT_Error )\n  cid_parser_new( CID_Parser*    parser,\n                  FT_Stream      stream,\n                  FT_Memory      memory,\n                  PSAux_Service  psaux );\n\n  FT_LOCAL( void )\n  cid_parser_done( CID_Parser*  parser );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                            PARSING ROUTINES                           */\n  /*                                                                       */\n  /*************************************************************************/\n\n#define cid_parser_skip_spaces( p )                 \\\n          (p)->root.funcs.skip_spaces( &(p)->root )\n#define cid_parser_skip_PS_token( p )                 \\\n          (p)->root.funcs.skip_PS_token( &(p)->root )\n\n#define cid_parser_to_int( p )       (p)->root.funcs.to_int( &(p)->root )\n#define cid_parser_to_fixed( p, t )  (p)->root.funcs.to_fixed( &(p)->root, t )\n\n#define cid_parser_to_coord_array( p, m, c )                 \\\n          (p)->root.funcs.to_coord_array( &(p)->root, m, c )\n#define cid_parser_to_fixed_array( p, m, f, t )                 \\\n          (p)->root.funcs.to_fixed_array( &(p)->root, m, f, t )\n#define cid_parser_to_token( p, t )                 \\\n          (p)->root.funcs.to_token( &(p)->root, t )\n#define cid_parser_to_token_array( p, t, m, c )                 \\\n          (p)->root.funcs.to_token_array( &(p)->root, t, m, c )\n\n#define cid_parser_load_field( p, f, o )                       \\\n          (p)->root.funcs.load_field( &(p)->root, f, o, 0, 0 )\n#define cid_parser_load_field_table( p, f, o )                       \\\n          (p)->root.funcs.load_field_table( &(p)->root, f, o, 0, 0 )\n\n\nFT_END_HEADER\n\n#endif /* __CIDPARSE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cid/cidriver.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cidriver.c                                                             */\n/*                                                                         */\n/*    CID driver interface (body).                                         */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006, 2008, 2009, 2011, 2013 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include \"cidriver.h\"\n#include \"cidgload.h\"\n#include FT_INTERNAL_DEBUG_H\n\n#include \"ciderrs.h\"\n\n#include FT_SERVICE_POSTSCRIPT_NAME_H\n#include FT_SERVICE_XFREE86_NAME_H\n#include FT_SERVICE_POSTSCRIPT_INFO_H\n#include FT_SERVICE_CID_H\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_ciddriver\n\n\n  /*\n   *  POSTSCRIPT NAME SERVICE\n   *\n   */\n\n  static const char*\n  cid_get_postscript_name( CID_Face  face )\n  {\n    const char*  result = face->cid.cid_font_name;\n\n\n    if ( result && result[0] == '/' )\n      result++;\n\n    return result;\n  }\n\n\n  static const FT_Service_PsFontNameRec  cid_service_ps_name =\n  {\n    (FT_PsName_GetFunc) cid_get_postscript_name\n  };\n\n\n  /*\n   *  POSTSCRIPT INFO SERVICE\n   *\n   */\n\n  static FT_Error\n  cid_ps_get_font_info( FT_Face          face,\n                        PS_FontInfoRec*  afont_info )\n  {\n    *afont_info = ((CID_Face)face)->cid.font_info;\n\n    return FT_Err_Ok;\n  }\n\n  static FT_Error\n  cid_ps_get_font_extra( FT_Face          face,\n                        PS_FontExtraRec*  afont_extra )\n  {\n    *afont_extra = ((CID_Face)face)->font_extra;\n\n    return FT_Err_Ok;\n  }\n\n  static const FT_Service_PsInfoRec  cid_service_ps_info =\n  {\n    (PS_GetFontInfoFunc)   cid_ps_get_font_info,\n    (PS_GetFontExtraFunc)  cid_ps_get_font_extra,\n    (PS_HasGlyphNamesFunc) NULL,        /* unsupported with CID fonts */\n    (PS_GetFontPrivateFunc)NULL,        /* unsupported                */\n    (PS_GetFontValueFunc)  NULL         /* not implemented            */\n  };\n\n\n  /*\n   *  CID INFO SERVICE\n   *\n   */\n  static FT_Error\n  cid_get_ros( CID_Face      face,\n               const char*  *registry,\n               const char*  *ordering,\n               FT_Int       *supplement )\n  {\n    CID_FaceInfo  cid = &face->cid;\n\n\n    if ( registry )\n      *registry = cid->registry;\n\n    if ( ordering )\n      *ordering = cid->ordering;\n\n    if ( supplement )\n      *supplement = cid->supplement;\n\n    return FT_Err_Ok;\n  }\n\n\n  static FT_Error\n  cid_get_is_cid( CID_Face  face,\n                  FT_Bool  *is_cid )\n  {\n    FT_Error  error = FT_Err_Ok;\n    FT_UNUSED( face );\n\n\n    if ( is_cid )\n      *is_cid = 1; /* cid driver is only used for CID keyed fonts */\n\n    return error;\n  }\n\n\n  static FT_Error\n  cid_get_cid_from_glyph_index( CID_Face  face,\n                                FT_UInt   glyph_index,\n                                FT_UInt  *cid )\n  {\n    FT_Error  error = FT_Err_Ok;\n    FT_UNUSED( face );\n\n\n    if ( cid )\n      *cid = glyph_index; /* identity mapping */\n\n    return error;\n  }\n\n\n  static const FT_Service_CIDRec  cid_service_cid_info =\n  {\n     (FT_CID_GetRegistryOrderingSupplementFunc)cid_get_ros,\n     (FT_CID_GetIsInternallyCIDKeyedFunc)      cid_get_is_cid,\n     (FT_CID_GetCIDFromGlyphIndexFunc)         cid_get_cid_from_glyph_index\n  };\n\n\n  /*\n   *  SERVICE LIST\n   *\n   */\n\n  static const FT_ServiceDescRec  cid_services[] =\n  {\n    { FT_SERVICE_ID_XF86_NAME,            FT_XF86_FORMAT_CID },\n    { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &cid_service_ps_name },\n    { FT_SERVICE_ID_POSTSCRIPT_INFO,      &cid_service_ps_info },\n    { FT_SERVICE_ID_CID,                  &cid_service_cid_info },\n    { NULL, NULL }\n  };\n\n\n  FT_CALLBACK_DEF( FT_Module_Interface )\n  cid_get_interface( FT_Module    module,\n                     const char*  cid_interface )\n  {\n    FT_UNUSED( module );\n\n    return ft_service_list_lookup( cid_services, cid_interface );\n  }\n\n\n\n  FT_CALLBACK_TABLE_DEF\n  const FT_Driver_ClassRec  t1cid_driver_class =\n  {\n    /* first of all, the FT_Module_Class fields */\n    {\n      FT_MODULE_FONT_DRIVER       |\n      FT_MODULE_DRIVER_SCALABLE   |\n      FT_MODULE_DRIVER_HAS_HINTER,\n\n      sizeof ( FT_DriverRec ),\n      \"t1cid\",   /* module name           */\n      0x10000L,  /* version 1.0 of driver */\n      0x20000L,  /* requires FreeType 2.0 */\n\n      0,\n\n      cid_driver_init,\n      cid_driver_done,\n      cid_get_interface\n    },\n\n    /* then the other font drivers fields */\n    sizeof ( CID_FaceRec ),\n    sizeof ( CID_SizeRec ),\n    sizeof ( CID_GlyphSlotRec ),\n\n    cid_face_init,\n    cid_face_done,\n\n    cid_size_init,\n    cid_size_done,\n    cid_slot_init,\n    cid_slot_done,\n\n    cid_slot_load_glyph,\n\n    0,                      /* FT_Face_GetKerningFunc  */\n    0,                      /* FT_Face_AttachFunc      */\n\n    0,                      /* FT_Face_GetAdvancesFunc */\n\n    cid_size_request,\n    0                       /* FT_Size_SelectFunc      */\n  };\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cid/cidriver.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cidriver.h                                                             */\n/*                                                                         */\n/*    High-level CID driver interface (specification).                     */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __CIDRIVER_H__\n#define __CIDRIVER_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DRIVER_H\n\n\nFT_BEGIN_HEADER\n\n#ifdef FT_CONFIG_OPTION_PIC\n#error \"this module does not support PIC yet\"\n#endif\n\n\n  FT_CALLBACK_TABLE\n  const FT_Driver_ClassRec  t1cid_driver_class;\n\n\nFT_END_HEADER\n\n#endif /* __CIDRIVER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cid/cidtoken.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  cidtoken.h                                                             */\n/*                                                                         */\n/*    CID token definitions (specification only).                          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  CID_FaceInfoRec\n#undef  T1CODE\n#define T1CODE        T1_FIELD_LOCATION_CID_INFO\n\n  T1_FIELD_KEY   ( \"CIDFontName\",    cid_font_name, 0 )\n  T1_FIELD_FIXED ( \"CIDFontVersion\", cid_version,   0 )\n  T1_FIELD_NUM   ( \"CIDFontType\",    cid_font_type, 0 )\n  T1_FIELD_STRING( \"Registry\",       registry,      0 )\n  T1_FIELD_STRING( \"Ordering\",       ordering,      0 )\n  T1_FIELD_NUM   ( \"Supplement\",     supplement,    0 )\n  T1_FIELD_NUM   ( \"UIDBase\",        uid_base,      0 )\n  T1_FIELD_NUM   ( \"CIDMapOffset\",   cidmap_offset, 0 )\n  T1_FIELD_NUM   ( \"FDBytes\",        fd_bytes,      0 )\n  T1_FIELD_NUM   ( \"GDBytes\",        gd_bytes,      0 )\n  T1_FIELD_NUM   ( \"CIDCount\",       cid_count,     0 )\n\n\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  PS_FontInfoRec\n#undef  T1CODE\n#define T1CODE        T1_FIELD_LOCATION_FONT_INFO\n\n  T1_FIELD_STRING( \"version\",            version,             0 )\n  T1_FIELD_STRING( \"Notice\",             notice,              0 )\n  T1_FIELD_STRING( \"FullName\",           full_name,           0 )\n  T1_FIELD_STRING( \"FamilyName\",         family_name,         0 )\n  T1_FIELD_STRING( \"Weight\",             weight,              0 )\n  T1_FIELD_NUM   ( \"ItalicAngle\",        italic_angle,        0 )\n  T1_FIELD_BOOL  ( \"isFixedPitch\",       is_fixed_pitch,      0 )\n  T1_FIELD_NUM   ( \"UnderlinePosition\",  underline_position,  0 )\n  T1_FIELD_NUM   ( \"UnderlineThickness\", underline_thickness, 0 )\n\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  PS_FontExtraRec\n#undef  T1CODE\n#define T1CODE        T1_FIELD_LOCATION_FONT_EXTRA\n\n  T1_FIELD_NUM   ( \"FSType\",             fs_type,             0 )\n\n\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  CID_FaceDictRec\n#undef  T1CODE\n#define T1CODE        T1_FIELD_LOCATION_FONT_DICT\n\n  T1_FIELD_NUM  ( \"PaintType\",          paint_type,          0 )\n  T1_FIELD_NUM  ( \"FontType\",           font_type,           0 )\n  T1_FIELD_NUM  ( \"SubrMapOffset\",      subrmap_offset,      0 )\n  T1_FIELD_NUM  ( \"SDBytes\",            sd_bytes,            0 )\n  T1_FIELD_NUM  ( \"SubrCount\",          num_subrs,           0 )\n  T1_FIELD_NUM  ( \"lenBuildCharArray\",  len_buildchar,       0 )\n  T1_FIELD_FIXED( \"ForceBoldThreshold\", forcebold_threshold, 0 )\n  T1_FIELD_FIXED( \"StrokeWidth\",        stroke_width,        0 )\n\n\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  PS_PrivateRec\n#undef  T1CODE\n#define T1CODE        T1_FIELD_LOCATION_PRIVATE\n\n  T1_FIELD_NUM       ( \"UniqueID\",         unique_id,      0 )\n  T1_FIELD_NUM       ( \"lenIV\",            lenIV,          0 )\n  T1_FIELD_NUM       ( \"LanguageGroup\",    language_group, 0 )\n  T1_FIELD_NUM       ( \"password\",         password,       0 )\n\n  T1_FIELD_FIXED_1000( \"BlueScale\",        blue_scale,     0 )\n  T1_FIELD_NUM       ( \"BlueShift\",        blue_shift,     0 )\n  T1_FIELD_NUM       ( \"BlueFuzz\",         blue_fuzz,      0 )\n\n  T1_FIELD_NUM_TABLE ( \"BlueValues\",       blue_values,        14, 0 )\n  T1_FIELD_NUM_TABLE ( \"OtherBlues\",       other_blues,        10, 0 )\n  T1_FIELD_NUM_TABLE ( \"FamilyBlues\",      family_blues,       14, 0 )\n  T1_FIELD_NUM_TABLE ( \"FamilyOtherBlues\", family_other_blues, 10, 0 )\n\n  T1_FIELD_NUM_TABLE2( \"StdHW\",            standard_width,      1, 0 )\n  T1_FIELD_NUM_TABLE2( \"StdVW\",            standard_height,     1, 0 )\n  T1_FIELD_NUM_TABLE2( \"MinFeature\",       min_feature,         2, 0 )\n\n  T1_FIELD_NUM_TABLE ( \"StemSnapH\",        snap_widths,        12, 0 )\n  T1_FIELD_NUM_TABLE ( \"StemSnapV\",        snap_heights,       12, 0 )\n\n  T1_FIELD_BOOL      ( \"ForceBold\",        force_bold,          0 )\n\n\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  FT_BBox\n#undef  T1CODE\n#define T1CODE        T1_FIELD_LOCATION_BBOX\n\n  T1_FIELD_BBOX( \"FontBBox\", xMin, 0 )\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/cid/module.mk",
    "content": "#\n# FreeType 2 CID module definition\n#\n\n\n# Copyright 1996-2000, 2006 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\nFTMODULE_H_COMMANDS += TYPE1CID_DRIVER\n\ndefine TYPE1CID_DRIVER\n$(OPEN_DRIVER) FT_Driver_ClassRec, t1cid_driver_class $(CLOSE_DRIVER)\n$(ECHO_DRIVER)cid       $(ECHO_DRIVER_DESC)Postscript CID-keyed fonts, no known extension$(ECHO_DRIVER_DONE)\nendef\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/cid/rules.mk",
    "content": "#\n# FreeType 2 CID driver configuration rules\n#\n\n\n# Copyright 1996-2000, 2001, 2003 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\n# CID driver directory\n#\nCID_DIR := $(SRC_DIR)/cid\n\n\nCID_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(CID_DIR))\n\n\n# CID driver sources (i.e., C files)\n#\nCID_DRV_SRC := $(CID_DIR)/cidparse.c \\\n               $(CID_DIR)/cidload.c  \\\n               $(CID_DIR)/cidriver.c \\\n               $(CID_DIR)/cidgload.c \\\n               $(CID_DIR)/cidobjs.c\n\n# CID driver headers\n#\nCID_DRV_H := $(CID_DRV_SRC:%.c=%.h) \\\n             $(CID_DIR)/cidtoken.h  \\\n             $(CID_DIR)/ciderrs.h\n\n\n# CID driver object(s)\n#\n#   CID_DRV_OBJ_M is used during `multi' builds\n#   CID_DRV_OBJ_S is used during `single' builds\n#\nCID_DRV_OBJ_M := $(CID_DRV_SRC:$(CID_DIR)/%.c=$(OBJ_DIR)/%.$O)\nCID_DRV_OBJ_S := $(OBJ_DIR)/type1cid.$O\n\n# CID driver source file for single build\n#\nCID_DRV_SRC_S := $(CID_DIR)/type1cid.c\n\n\n# CID driver - single object\n#\n$(CID_DRV_OBJ_S): $(CID_DRV_SRC_S) $(CID_DRV_SRC) $(FREETYPE_H) $(CID_DRV_H)\n\t$(CID_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(CID_DRV_SRC_S))\n\n\n# CID driver - multiple objects\n#\n$(OBJ_DIR)/%.$O: $(CID_DIR)/%.c $(FREETYPE_H) $(CID_DRV_H)\n\t$(CID_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\n\n\n# update main driver object lists\n#\nDRV_OBJS_S += $(CID_DRV_OBJ_S)\nDRV_OBJS_M += $(CID_DRV_OBJ_M)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/cid/type1cid.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  type1cid.c                                                             */\n/*                                                                         */\n/*    FreeType OpenType driver component (body only).                      */\n/*                                                                         */\n/*  Copyright 1996-2001 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#define FT_MAKE_OPTION_SINGLE_OBJECT\n\n#include <ft2build.h>\n#include \"cidparse.c\"\n#include \"cidload.c\"\n#include \"cidobjs.c\"\n#include \"cidriver.c\"\n#include \"cidgload.c\"\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/Jamfile",
    "content": "# FreeType 2 src/gxvalid Jamfile\n#\n# Copyright 2005 by\n# suzuki toshiya, Masatake YAMATO and Red Hat K.K.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) gxvalid ;\n\n\n{\n  local  _sources ;\n\n  if $(FT2_MULTI)\n  {\n    _sources = gxvcommn gxvfeat  gxvbsln  gxvtrak  gxvopbd  gxvprop\n               gxvmort  gxvmort0 gxvmort1 gxvmort2 gxvmort4 gxvmort5\n               gxvmorx  gxvmorx0 gxvmorx1 gxvmorx2 gxvmorx4 gxvmorx5\n               gxvlcar  gxvkern  gxvmod   gxvjust  ;\n  }\n  else\n  {\n    _sources = gxvalid ;\n  }\n\n  Library  $(FT2_LIB) : $(_sources).c ;\n}\n\n# end of src/gxvalid Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/README",
    "content": "gxvalid: TrueType GX validator\n==============================\n\n\n1. What is this\n---------------\n\n  `gxvalid' is a module to  validate TrueType GX tables: a collection of\n  additional tables  in TrueType  font which are  used by  `QuickDraw GX\n  Text',  Apple Advanced  Typography  (AAT).  In  addition, gxvalid  can\n  validates `kern'  tables which have  been extended for AAT.   Like the\n  otvalid  module,   gxvalid  uses  Freetype   2's  validator  framework\n  (ftvalid).\n\n  You can link gxvalid with your program; before running your own layout\n  engine, gxvalid validates a font  file.  As the result, you can remove\n  error-checking code  from the layout  engine.  It is also  possible to\n  use  gxvalid  as a  stand-alone  font  validator;  the `ftvalid'  test\n  program  included  in the  ft2demo  bundle  calls gxvalid  internally.\n  A stand-alone font validator may be useful for font developers.\n\n  This documents documents the following issues.\n\n  - supported TrueType GX tables\n  - fundamental validation limitations\n  - permissive error handling of broken GX tables\n  - `kern' table issue.\n\n\n2. Supported tables\n-------------------\n\n  The following GX tables are currently supported.\n\n    bsln\n    feat\n    just\n    kern(*)\n    lcar\n    mort\n    morx\n    opbd\n    prop\n    trak\n\n  The following GX tables are currently unsupported.\n\n    cvar\n    fdsc\n    fmtx\n    fvar\n    gvar\n    Zapf\n\n  The following GX tables won't be supported.\n\n    acnt(**)\n    hsty(***)\n\n  The following undocumented tables in TrueType fonts designed for Apple\n  platform aren't handled either.\n\n    addg\n    CVTM\n    TPNM\n    umif\n\n\n  *)   The `kern'  validator handles both  the classic and the  new kern\n       formats;  the former  is supported  on both  Microsoft  and Apple\n       platforms, while the latter is supported on Apple platforms.\n\n  **)  `acnt' tables are not supported by currently available Apple font\n       tools.\n\n  ***) There  is  one more  Apple  extension,  `hsty',  but  it  is  for\n       Newton-OS, not GX  (Newton-OS is a platform by  Apple, but it can\n       use  sfnt- housed bitmap  fonts only).   Therefore, it  should be\n       excluded  from  `Apple  platform'  in the  context  of  TrueType.\n       gxvalid ignores it as Apple font tools do so.\n\n\n  We have  checked 183  fonts bundled with  MacOS 9.1, MacOS  9.2, MacOS\n  10.0, MacOS X 10.1, MSIE  for MacOS, and AppleWorks 6.0.  In addition,\n  we have  checked 67 Dynalab fonts  (designed for MacOS)  and 189 Ricoh\n  fonts (designed for Windows and  MacOS dual platforms).  The number of\n  fonts including TrueType GX tables are as follows.\n\n    bsln:  76\n    feat: 191\n    just:  84\n    kern:  59\n    lcar:   4\n    mort: 326\n    morx:  19\n    opbd:   4\n    prop: 114\n    trak:  16\n\n  Dynalab  and Ricoh fonts  don't have  GX tables  except of  `feat' and\n  `mort'.\n\n\n3. Fundamental validation limitations\n-------------------------------------\n\n  TrueType  GX  provides  layout   information  to  libraries  for  font\n  rasterizers  and text layout.   gxvalid can  check whether  the layout\n  data in  a font is conformant  to the TrueType GX  format specified by\n  Apple.  But gxvalid cannot check  a how QuickDraw GX/AAT renderer uses\n  the stored information.\n\n  3-1. Validation of State Machine activity\n  -----------------------------------------\n\n    QuickDraw GX/AAT uses a `State Machine' to provide `stateful' layout\n    features,  and TrueType GX  stores the  state transition  diagram of\n    this `State  Machine' in a  `StateTable' data structure.   While the\n    State  Machine receives  a series  of glyph  IDs, the  State Machine\n    starts with `start  of text' state, walks around  various states and\n    generates various  layout information  to the  renderer, and finally\n    reaches the `end of text' state.\n\n    gxvalid can check essential errors like:\n\n      - possibility of state transitions to undefined states\n      - existence of glyph  IDs that the State Machine  doesn't know how\n        to handle\n      - the  State Machine  cannot compute  the layout  information from\n        given diagram\n\n    These errors  can be  checked within finite  steps, and  without the\n    State Machine itself, because these are `expression' errors of state\n    transition diagram.\n\n    There  is no  limitation  about  how long  the  State Machine  walks\n    around,  so validation  of  the algorithm  in  the state  transition\n    diagram requires infinite  steps, even if we had  a State Machine in\n    gxvalid.   Therefore, the  following errors  and problems  cannot be\n    checked.\n\n      - existence of states which the State Machine never transits to\n      - the  possibility that the  State Machine  never reaches  `end of\n        text'\n      - the possibility of stack underflow/overflow in the State Machine\n        (in  ligature  and  contextual  glyph substitutions,  the  State\n        Machine can store 16 glyphs onto its stack)\n\n    In addition, gxvalid doesn't check `temporary glyph IDs' used in the\n    chained State Machines  (in `mort' and `morx' tables).   If a layout\n    feature  is  implemented by  a  single  State  Machine, a  glyph  ID\n    converted by the State Machine is passed to the glyph renderer, thus\n    it  should not  point to  an undefined  glyph ID.   But if  a layout\n    feature is implemented by  chained State Machines, a component State\n    Machine  (if it  is  not the  final  one) is  permitted to  generate\n    undefined glyph IDs for temporary use, because it is handled by next\n    component State Machine and not  by the glyph renderer.  To validate\n    such temporary glyph IDs, gxvalid must stack all undefined glyph IDs\n    which  can occur in  the output  of the  previous State  Machine and\n    search  them in  the  `ClassTable' structure  of  the current  State\n    Machine.  It is too complex to  list all possible glyph IDs from the\n    StateTable, especially from a ligature substitution table.\n\n  3-2. Validation of relationship between multiple layout features\n  ----------------------------------------------------------------\n\n    gxvalid does  not validate the relationship  between multiple layout\n    features at all.\n\n    If  multiple layout  features  are defined  in  TrueType GX  tables,\n    possible  interactions,  overrides,  and  conflicts  between  layout\n    features are implicitly  given in the font too.   For example, there\n    are several predefined spacing control features:\n\n      - Text Spacing          (Proportional/Monospace/Half-width/Normal)\n      - Number Spacing        (Monospaced-numbers/Proportional-numbers)\n      - Kana Spacing          (Full-width/Proportional)\n      - Ideographic Spacing   (Full-width/Proportional)\n      - CJK Roman Spacing     (Half-width/Proportional/Default-roman\n                               /Full-width-roman/Proportional)\n\n    If all  layout features are  independently managed, we  can activate\n    inconsistent  typographic rules  like  `Text Spacing=Monospace'  and\n    `Ideographic Spacing=Proportional' at the same time.\n\n    The combinations  of layout features  is managed by a  32bit integer\n    (one bit each for selector  setting), so we can define relationships\n    between  up  to 32  features,  theoretically.   But  if one  feature\n    setting  affects  another   feature  setting,  we  need  typographic\n    priority  rules to  validate the  relationship.   Unfortunately, the\n    TrueType GX format specification does not give such information even\n    for predefined features.\n\n\n4. Permissive error handling of broken GX tables\n------------------------------------------------\n\n  When  Apple's font  rendering system  finds an  inconsistency,  like a\n  specification  violation or  an  unspecified value  in  a TrueType  GX\n  table, it does not always  return error.  In most cases, the rendering\n  engine silently  ignores such wrong  values or even whole  tables.  In\n  fact, MacOS is shipped with  fonts including broken GX/AAT tables, but\n  no harmful  effects due to  `officially broken' fonts are  observed by\n  end-users.\n\n  gxvalid  is designed  to continue  the validation  process as  long as\n  possible.  When gxvalid find wrong  values, gxvalid warns it at least,\n  and takes  a fallback procedure  if possible.  The  fallback procedure\n  depends on the debug level.\n\n  We used the following three tools to investigate Apple's error handling.\n\n    - FontValidator  (for MacOS 8.5 - 9.2)  resource fork font\n    - ftxvalidator   (for MacOS X 10.1 -)   dfont or naked-sfnt\n    - ftxdumperfuser (for MacOS X 10.1 -)   dfont or naked-sfnt\n\n  However, all tests were done on a PowerPC based Macintosh; at present,\n  we have not checked those tools on a m68k-based Macintosh.\n\n  In total, we checked 183 fonts  bundled to MacOS 9.1, MacOS 9.2, MacOS\n  10.0, MacOS X  10.1, MSIE for MacOS, and  AppleWorks 6.0.  These fonts\n  are distributed  officially, but many broken GX/AAT  tables were found\n  by Apple's font tools.  In the following, we list typical violation of\n  the GX specification, in fonts officially distributed with those Apple\n  systems.\n\n  4-1. broken BinSrchHeader (19/183)\n  ----------------------------------\n\n    `BinSrchHeader' is  a header of a  data array for  m68k platforms to\n    access memory efficiently.  Although  there are only two independent\n    parameters  for real  (`unitSize' and  `nUnits'),  BinSrchHeader has\n    three additional parameters which  can be calculated from `unitSize'\n    and  `nUnits',  for  fast  setup.   Apple  font  tools  ignore  them\n    silently, so gxvalid warns if it finds and inconsistency, and always\n    continues  validation.    The  additional  parameters   are  ignored\n    regardless of the consistency.\n\n      19  fonts include  such  inconsistencies; all  breaks  are in  the\n      BinSrchHeader structure of the `kern' table.\n\n  4-2. too-short LookupTable (5/183)\n  ----------------------------------\n\n    LookupTable format 0  is a simple array to get a  value from a given\n    GID (glyph  ID); the index of  this array is a  GID too.  Therefore,\n    the length  of the array is expected  to be same as  the maximum GID\n    value defined  in the `maxp' table,  but there are  some fonts whose\n    LookupTable format 0 is too  short to cover all GIDs.  FontValidator\n    ignores  this error silently,  ftxvalidator and  ftxdumperfuser both\n    warn and continue.  Similar problems are found in format 3 subtables\n    of `kern'.  gxvalid  warns always and abort if  the validation level\n    is set to FT_VALIDATE_PARANOID.\n\n      5 fonts include too-short kern format 0 subtables.\n      1 font includes too-short kern format 3 subtable.\n\n  4-3. broken LookupTable format 2 (1/183)\n  ----------------------------------------\n\n    LookupTable  format  2,  subformat  4  covers the  GID  space  by  a\n    collection  of  segments which  are  specified  by `firstGlyph'  and\n    `lastGlyph'.   Some  fonts  store  `firstGlyph' and  `lastGlyph'  in\n    reverse order,  so the segment specification is  broken.  Apple font\n    tools ignore this error silently;  a broken segment is ignored as if\n    it  did not  exist.   gxvalid  warns and  normalize  the segment  at\n    FT_VALIDATE_DEFAULT, or ignore  the segment at FT_VALIDATE_TIGHT, or\n    abort at FT_VALIDATE_PARANOID.\n\n      1 font includes broken LookupTable format 2, in the `just' table.\n\n    *) It seems  that all fonts manufactured by  ITC for AppleWorks have\n       this error.\n\n  4-4. bad bracketing in glyph property (14/183)\n  ----------------------------------------------\n\n    GX/AAT defines a  `bracketing' property of the glyphs  in the `prop'\n    table,  to control layout  features of  strings enclosed  inside and\n    outside  of   brackets.   Some  fonts   give  inappropriate  bracket\n    properties  to glyphs.   Apple  font tools  warn  about this  error;\n    gxvalid warns too and aborts at FT_VALIDATE_PARANOID.\n\n      14 fonts include wrong bracket properties.\n\n\n  4-5. invalid feature number (117/183)\n  -------------------------------------\n\n    The GX/AAT extension can  include 255 different layout features, but\n    popular      layout      features      are      predefined      (see\n    http://developer.apple.com/fonts/Registry/index.html).   Some  fonts\n    include feature  numbers which are incompatible  with the predefined\n    feature registry.\n\n    In our survey, there are 140 fonts including `feat' table.\n\n    a) 67 fonts use a feature number which should not be used.\n    b) 117 fonts set the wrong feature range (nSetting).  This is mostly\n       found in the `mort' and `morx' tables.\n\n    Apple  font tools give  no warning,  although they  cannot recognize\n    what  the feature  is.   At FT_VALIDATE_DEFAULT,  gxvalid warns  but\n    continues in both cases (a, b).  At FT_VALIDATE_TIGHT, gxvalid warns\n    and aborts for (a), but continues for (b).  At FT_VALIDATE_PARANOID,\n    gxvalid warns and aborts in both cases (a, b).\n\n  4-6. invalid prop version (10/183)\n  ----------------------------------\n\n    As most TrueType GX tables, the `prop' table must start with a 32bit\n    version identifier: 0x00010000,  0x00020000 or 0x00030000.  But some\n    fonts  store nonsense binary  data instead.   When Apple  font tools\n    find them, they abort the processing immediately, and the data which\n    follows is unhandled.  gxvalid does the same.\n\n      10 fonts include broken `prop' version.\n\n    All  of these  fonts are  classic  TrueType fonts  for the  Japanese\n    script, manufactured by Apple.\n\n  4-7. unknown resource name (2/183)\n  ------------------------------------\n\n    NOTE: THIS IS NOT A TRUETYPE GX ERROR.\n\n    If  a TrueType  font is  stored  in the  resource fork  or in  dfont\n    format, the data must be tagged as `sfnt' in the resource fork index\n    to invoke TrueType font handler for the data.  But the TrueType font\n    data  in   `Keyboard.dfont'  is  tagged   as  `kbd',  and   that  in\n    `LastResort.dfont' is tagged as  `lst'.  Apple font tools can detect\n    that the data is in  TrueType format and successfully validate them.\n    Maybe  this is possible  because they  are known  to be  dfont.  The\n    current  implementation  of the  resource  fork  driver of  FreeType\n    cannot do that, thus gxvalid cannot validate them.\n\n      2 fonts use an unknown tag for the TrueType font resource.\n\n5. `kern' table issues\n----------------------\n\n  In common terminology of TrueType, `kern' is classified as a basic and\n  platform-independent table.  But there are Apple extensions of `kern',\n  and  there is  an  extension which  requires  a GX  state machine  for\n  contextual kerning.   Therefore, gxvalid includes  a special validator\n  for  `kern' tables.   Unfortunately, there  is no  exact  algorithm to\n  check Apple's extension, so  gxvalid includes a heuristic algorithm to\n  find  the proper validation  routines for  all possible  data formats,\n  including    the   data    format   for    Microsoft.     By   calling\n  classic_kern_validate() instead of gxv_validate(), you can specify the\n  `kern' format  explicitly.  However, current  FreeType2 uses Microsoft\n  `kern' format  only, others  are ignored (and  should be handled  in a\n  library one level higher than FreeType).\n\n  5-1. History\n  ------------\n\n    The original  16bit version of `kern'  was designed by  Apple in the\n    pre-GX  era, and  it was  also approved  by  Microsoft.  Afterwards,\n    Apple designed a  new 32bit version of the  `kern' table.  According\n    to  the documentation, the  difference between  the 16bit  and 32bit\n    version is only the size of  variables in the `kern' header.  In the\n    following,  we call  the original  16bit version  as  `classic', and\n    32bit version as `new'.\n\n  5-2. Versions and dialects which should be differentiated\n  ---------------------------------------------------------\n\n    The `kern' table  consists of a table header  and several subtables.\n    The version number  which identifies a `classic' or  a `new' version\n    is  explicitly   written  in  the   table  header,  but   there  are\n    undocumented  differences between  Microsoft's and  Apple's formats.\n    It is  called a `dialect' in  the following.  There  are three cases\n    which  should  be  handled:   the  new  Apple-dialect,  the  classic\n    Apple-dialect,  and the classic  Microsoft-dialect.  An  analysis of\n    the formats and the auto detection algorithm of gxvalid is described\n    in the following.\n\n    5-2-1. Version detection: classic and new kern\n    ----------------------------------------------\n\n      According  to Apple  TrueType  specification, there  are only  two\n      differences between the classic and the new:\n\n        - The `kern' table header starts with the version number.\n          The classic version starts with 0x0000 (16bit),\n          the new version starts with 0x00010000 (32bit).\n\n        - In the  `kern' table header,  the number of  subtables follows\n          the version number.\n          In the classic version, it is stored as a 16bit value.\n          In the new version, it is stored as a 32bit value.\n\n      From Apple font tool's output (DumpKERN is also tested in addition\n      to  the  three  Apple  font  tools in  above),  there  is  another\n      undocumented difference.  In the  new version, the subtable header\n      includes a 16bit variable  named `tupleIndex' which does not exist\n      in the classic version.\n\n      The new version  can store all subtable formats (0,  1, 2, and 3),\n      but the Apple TrueType specification does not mention the subtable\n      formats available in the classic version.\n\n    5-2-2. Available subtable formats in classic version\n    ----------------------------------------------------\n\n      Although the  Apple TrueType  specification recommends to  use the\n      classic version in  the case if the font is  designed for both the\n      Apple and Microsoft platforms,  it does not document the available\n      subtable formats in the classic version.\n\n      According  to the Microsoft  TrueType specification,  the subtable\n      format  assured for  Windows  and OS/2  support  is only  subtable\n      format  0.  The  Microsoft TrueType  specification  also describes\n      subtable format  2, but does  not mention which  platforms support\n      it.  Aubtable formats 1, 3,  and higher are documented as reserved\n      for future use.  Therefore, the classic version can store subtable\n      formats 0 and 2, at least.  `ttfdump.exe', a font tool provided by\n      Microsoft,  ignores the  subtable format  written in  the subtable\n      header, and parses the table as if all subtables are in format 0.\n\n      `kern'  subtable format  1  uses  a StateTable,  so  it cannot  be\n      utilized without a GX  State Machine.  Therefore, it is reasonable\n      to assume  that format 1 (and  3) were introduced  after Apple had\n      introduced GX and moved to the new 32bit version.\n\n    5-2-3. Apple and Microsoft dialects\n    -----------------------------------\n\n      The  `kern' subtable  has  a 16bit  `coverage'  field to  describe\n      kerning attributes, but bit interpretations by Apple and Microsoft\n      are different:  For example, Apple  uses bits 0-7 to  identify the\n      subtable, while Microsoft uses bits 8-15.\n\n      In  addition, due  to the  output of  DumpKERN  and FontValidator,\n      Apple's bit interpretations of coverage in classic and new version\n      are  incompatible also.   In  summary, there  are three  dialects:\n      classic Apple  dialect, classic  Microsoft dialect, and  new Apple\n      dialect.  The classic Microsoft  dialect and the new Apple dialect\n      are documented  by each vendors' TrueType  font specification, but\n      the documentation for classic Apple dialect is not available.\n\n      For example,  in the  new Apple dialect,  bit 15 is  documented as\n      `set to  1 if  the kerning  is vertical'.  On  the other  hand, in\n      classic Microsoft dialect, bit 1 is documented as `set to 1 if the\n      kerning  is  horizontal'.   From   the  outputs  of  DumpKERN  and\n      FontValidator, classic  Apple dialect recognizes  15 as `set  to 1\n      when  the kerning  is horizontal'.   From the  results  of similar\n      experiments, classic Apple dialect  seems to be the Endian reverse\n      of the classic Microsoft dialect.\n\n      As a  conclusion it must be  noted that no font  tool can identify\n      classic Apple dialect or classic Microsoft dialect automatically.\n\n    5-2-4. gxvalid auto dialect detection algorithm\n    -----------------------------------------------\n\n      The first 16  bits of the `kern' table are  enough to identify the\n      version:\n\n        - if  the first  16  bits are  0x0000,  the `kern'  table is  in\n          classic Apple dialect or classic Microsoft dialect\n        - if the first 16 bits are  0x0001, and next 16 bits are 0x0000,\n          the kern table is in new Apple dialect.\n\n      If the `kern'  table is a classic one,  the 16bit `coverage' field\n      is checked next.   Firstly, the coverage bits are  decoded for the\n      classic Apple dialect using the following bit masks (this is based\n      on DumpKERN output):\n\n        0x8000: 1=horizontal, 0=vertical\n        0x4000: not used\n        0x2000: 1=cross-stream, 0=normal\n        0x1FF0: reserved\n        0x000F: subtable format\n\n      If  any  of  reserved  bits  are  set  or  the  subtable  bits  is\n      interpreted as format 1 or 3, we take it as `impossible in classic\n      Apple dialect' and retry, using the classic Microsoft dialect.\n\n        The most popular coverage in new Apple-dialect:         0x8000,\n        The most popular coverage in classic Apple-dialect:     0x0000,\n        The most popular coverage in classic Microsoft dialect: 0x0001.\n\n  5-3. Tested fonts\n  -----------------\n\n    We checked  59 fonts  bundled with MacOS  and 38 fonts  bundled with\n    Windows, where all font include a `kern' table.\n\n      - fonts bundled with MacOS\n        * new Apple dialect\n          format 0: 18\n          format 2:  1\n          format 3:  1\n        * classic Apple dialect\n          format 0: 14\n        * classic Microsoft dialect\n          format 0: 15\n\n      - fonts bundled with Windows\n        * classic Microsoft dialect\n          format 0: 38\n\n    It looks strange that classic Microsoft-dialect fonts are bundled to\n    MacOS: they come from MSIE for MacOS, except of MarkerFelt.dfont.\n\n\n  ACKNOWLEDGEMENT\n  ---------------\n\n  Some parts of gxvalid are  derived from both the `gxlayout' module and\n  the `otvalid'  module.  Development of  gxlayout was supported  by the\n  Information-technology Promotion Agency(IPA), Japan.\n\n  The detailed analysis of undefined  glyph ID utilization in `mort' and\n  `morx' tables is provided by George Williams.\n\n------------------------------------------------------------------------\n\nCopyright 2004, 2005, 2007 by\nsuzuki toshiya, Masatake YAMATO, Red hat K.K.,\nDavid Turner, Robert Wilhelm, and Werner Lemberg.\n\nThis  file is  part  of the  FreeType  project, and  may  only be  used,\nmodified,  and  distributed under  the  terms  of  the FreeType  project\nlicense, LICENSE.TXT.  By continuing  to use, modify, or distribute this\nfile  you indicate that  you have  read the  license and  understand and\naccept it fully.\n\n\n--- end of README ---\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvalid.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvalid.c                                                              */\n/*                                                                         */\n/*    FreeType validator for TrueTypeGX/AAT tables (body only).            */\n/*                                                                         */\n/*  Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,       */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#define FT_MAKE_OPTION_SINGLE_OBJECT\n\n#include <ft2build.h>\n\n#include \"gxvfeat.c\"\n#include \"gxvcommn.c\"\n#include \"gxvbsln.c\"\n#include \"gxvtrak.c\"\n#include \"gxvjust.c\"\n#include \"gxvmort.c\"\n#include \"gxvmort0.c\"\n#include \"gxvmort1.c\"\n#include \"gxvmort2.c\"\n#include \"gxvmort4.c\"\n#include \"gxvmort5.c\"\n#include \"gxvmorx.c\"\n#include \"gxvmorx0.c\"\n#include \"gxvmorx1.c\"\n#include \"gxvmorx2.c\"\n#include \"gxvmorx4.c\"\n#include \"gxvmorx5.c\"\n#include \"gxvkern.c\"\n#include \"gxvopbd.c\"\n#include \"gxvprop.c\"\n#include \"gxvlcar.c\"\n#include \"gxvmod.c\"\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvalid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvalid.h                                                              */\n/*                                                                         */\n/*    TrueTyeeGX/AAT table validation (specification only).                */\n/*                                                                         */\n/*  Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,       */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __GXVALID_H__\n#define __GXVALID_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#include \"gxverror.h\"          /* must come before FT_INTERNAL_VALIDATE_H */\n\n#include FT_INTERNAL_VALIDATE_H\n#include FT_INTERNAL_STREAM_H\n\n\nFT_BEGIN_HEADER\n\n\n  FT_LOCAL( void )\n  gxv_feat_validate( FT_Bytes      table,\n                     FT_Face       face,\n                     FT_Validator  valid );\n\n\n  FT_LOCAL( void )\n  gxv_bsln_validate( FT_Bytes      table,\n                     FT_Face       face,\n                     FT_Validator  valid );\n\n\n  FT_LOCAL( void )\n  gxv_trak_validate( FT_Bytes      table,\n                     FT_Face       face,\n                     FT_Validator  valid );\n\n  FT_LOCAL( void )\n  gxv_just_validate( FT_Bytes      table,\n                     FT_Face       face,\n                     FT_Validator  valid );\n\n  FT_LOCAL( void )\n  gxv_mort_validate( FT_Bytes      table,\n                     FT_Face       face,\n                     FT_Validator  valid );\n\n  FT_LOCAL( void )\n  gxv_morx_validate( FT_Bytes      table,\n                     FT_Face       face,\n                     FT_Validator  valid );\n\n  FT_LOCAL( void )\n  gxv_kern_validate( FT_Bytes      table,\n                     FT_Face       face,\n                     FT_Validator  valid );\n\n  FT_LOCAL( void )\n  gxv_kern_validate_classic( FT_Bytes      table,\n                             FT_Face       face,\n                             FT_Int        dialect_flags,\n                             FT_Validator  valid );\n\n  FT_LOCAL( void )\n  gxv_opbd_validate( FT_Bytes      table,\n                     FT_Face       face,\n                     FT_Validator  valid );\n\n  FT_LOCAL( void )\n  gxv_prop_validate( FT_Bytes      table,\n                     FT_Face       face,\n                     FT_Validator  valid );\n\n  FT_LOCAL( void )\n  gxv_lcar_validate( FT_Bytes      table,\n                     FT_Face       face,\n                     FT_Validator  valid );\n\n\nFT_END_HEADER\n\n\n#endif /* __GXVALID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvbsln.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvbsln.c                                                              */\n/*                                                                         */\n/*    TrueTypeGX/AAT bsln table validation (body).                         */\n/*                                                                         */\n/*  Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"gxvalid.h\"\n#include \"gxvcommn.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gxvbsln\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      Data and Types                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#define GXV_BSLN_VALUE_COUNT  32\n#define GXV_BSLN_VALUE_EMPTY  0xFFFFU\n\n\n  typedef struct  GXV_bsln_DataRec_\n  {\n    FT_Bytes   ctlPoints_p;\n    FT_UShort  defaultBaseline;\n\n  } GXV_bsln_DataRec, *GXV_bsln_Data;\n\n\n#define GXV_BSLN_DATA( field )  GXV_TABLE_DATA( bsln, field )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      UTILITY FUNCTIONS                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static void\n  gxv_bsln_LookupValue_validate( FT_UShort            glyph,\n                                 GXV_LookupValueCPtr  value_p,\n                                 GXV_Validator        gxvalid )\n  {\n    FT_UShort     v = value_p->u;\n    FT_UShort*    ctlPoints;\n\n    FT_UNUSED( glyph );\n\n\n    GXV_NAME_ENTER( \"lookup value\" );\n\n    if ( v >= GXV_BSLN_VALUE_COUNT )\n      FT_INVALID_DATA;\n\n    ctlPoints = (FT_UShort*)GXV_BSLN_DATA( ctlPoints_p );\n    if ( ctlPoints && ctlPoints[v] == GXV_BSLN_VALUE_EMPTY )\n      FT_INVALID_DATA;\n\n    GXV_EXIT;\n  }\n\n\n  /*\n    +===============+ --------+\n    | lookup header |         |\n    +===============+         |\n    | BinSrchHeader |         |\n    +===============+         |\n    | lastGlyph[0]  |         |\n    +---------------+         |\n    | firstGlyph[0] |         |    head of lookup table\n    +---------------+         |             +\n    | offset[0]     |    ->   |          offset            [byte]\n    +===============+         |             +\n    | lastGlyph[1]  |         | (glyphID - firstGlyph) * 2 [byte]\n    +---------------+         |\n    | firstGlyph[1] |         |\n    +---------------+         |\n    | offset[1]     |         |\n    +===============+         |\n                              |\n    ...                       |\n                              |\n    16bit value array         |\n    +===============+         |\n    |     value     | <-------+\n    ...\n  */\n\n  static GXV_LookupValueDesc\n  gxv_bsln_LookupFmt4_transit( FT_UShort            relative_gindex,\n                               GXV_LookupValueCPtr  base_value_p,\n                               FT_Bytes             lookuptbl_limit,\n                               GXV_Validator        gxvalid )\n  {\n    FT_Bytes             p;\n    FT_Bytes             limit;\n    FT_UShort            offset;\n    GXV_LookupValueDesc  value;\n\n    /* XXX: check range ? */\n    offset = (FT_UShort)( base_value_p->u +\n                          ( relative_gindex * sizeof ( FT_UShort ) ) );\n\n    p     = gxvalid->lookuptbl_head + offset;\n    limit = lookuptbl_limit;\n    GXV_LIMIT_CHECK( 2 );\n\n    value.u = FT_NEXT_USHORT( p );\n\n    return value;\n  }\n\n\n  static void\n  gxv_bsln_parts_fmt0_validate( FT_Bytes       tables,\n                                FT_Bytes       limit,\n                                GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = tables;\n\n\n    GXV_NAME_ENTER( \"parts format 0\" );\n\n    /* deltas */\n    GXV_LIMIT_CHECK( 2 * GXV_BSLN_VALUE_COUNT );\n\n    gxvalid->table_data = NULL;      /* No ctlPoints here. */\n\n    GXV_EXIT;\n  }\n\n\n  static void\n  gxv_bsln_parts_fmt1_validate( FT_Bytes       tables,\n                                FT_Bytes       limit,\n                                GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = tables;\n\n\n    GXV_NAME_ENTER( \"parts format 1\" );\n\n    /* deltas */\n    gxv_bsln_parts_fmt0_validate( p, limit, gxvalid );\n\n    /* mappingData */\n    gxvalid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;\n    gxvalid->lookupval_func   = gxv_bsln_LookupValue_validate;\n    gxvalid->lookupfmt4_trans = gxv_bsln_LookupFmt4_transit;\n    gxv_LookupTable_validate( p + 2 * GXV_BSLN_VALUE_COUNT,\n                              limit,\n                              gxvalid );\n\n    GXV_EXIT;\n  }\n\n\n  static void\n  gxv_bsln_parts_fmt2_validate( FT_Bytes       tables,\n                                FT_Bytes       limit,\n                                GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p = tables;\n\n    FT_UShort  stdGlyph;\n    FT_UShort  ctlPoint;\n    FT_Int     i;\n\n    FT_UShort  defaultBaseline = GXV_BSLN_DATA( defaultBaseline );\n\n\n    GXV_NAME_ENTER( \"parts format 2\" );\n\n    GXV_LIMIT_CHECK( 2 + ( 2 * GXV_BSLN_VALUE_COUNT ) );\n\n    /* stdGlyph */\n    stdGlyph = FT_NEXT_USHORT( p );\n    GXV_TRACE(( \" (stdGlyph = %u)\\n\", stdGlyph ));\n\n    gxv_glyphid_validate( stdGlyph, gxvalid );\n\n    /* Record the position of ctlPoints */\n    GXV_BSLN_DATA( ctlPoints_p ) = p;\n\n    /* ctlPoints */\n    for ( i = 0; i < GXV_BSLN_VALUE_COUNT; i++ )\n    {\n      ctlPoint = FT_NEXT_USHORT( p );\n      if ( ctlPoint == GXV_BSLN_VALUE_EMPTY )\n      {\n        if ( i == defaultBaseline )\n          FT_INVALID_DATA;\n      }\n      else\n        gxv_ctlPoint_validate( stdGlyph, (FT_Short)ctlPoint, gxvalid );\n    }\n\n    GXV_EXIT;\n  }\n\n\n  static void\n  gxv_bsln_parts_fmt3_validate( FT_Bytes       tables,\n                                FT_Bytes       limit,\n                                GXV_Validator  gxvalid)\n  {\n    FT_Bytes  p = tables;\n\n\n    GXV_NAME_ENTER( \"parts format 3\" );\n\n    /* stdGlyph + ctlPoints */\n    gxv_bsln_parts_fmt2_validate( p, limit, gxvalid );\n\n    /* mappingData */\n    gxvalid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;\n    gxvalid->lookupval_func   = gxv_bsln_LookupValue_validate;\n    gxvalid->lookupfmt4_trans = gxv_bsln_LookupFmt4_transit;\n    gxv_LookupTable_validate( p + ( 2 + 2 * GXV_BSLN_VALUE_COUNT ),\n                              limit,\n                              gxvalid );\n\n    GXV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         bsln TABLE                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL_DEF( void )\n  gxv_bsln_validate( FT_Bytes      table,\n                     FT_Face       face,\n                     FT_Validator  ftvalid )\n  {\n    GXV_ValidatorRec  gxvalidrec;\n    GXV_Validator     gxvalid = &gxvalidrec;\n\n    GXV_bsln_DataRec  bslnrec;\n    GXV_bsln_Data     bsln = &bslnrec;\n\n    FT_Bytes  p     = table;\n    FT_Bytes  limit = 0;\n\n    FT_ULong   version;\n    FT_UShort  format;\n    FT_UShort  defaultBaseline;\n\n    GXV_Validate_Func  fmt_funcs_table [] =\n    {\n      gxv_bsln_parts_fmt0_validate,\n      gxv_bsln_parts_fmt1_validate,\n      gxv_bsln_parts_fmt2_validate,\n      gxv_bsln_parts_fmt3_validate,\n    };\n\n\n    gxvalid->root       = ftvalid;\n    gxvalid->table_data = bsln;\n    gxvalid->face       = face;\n\n    FT_TRACE3(( \"validating `bsln' table\\n\" ));\n    GXV_INIT;\n\n\n    GXV_LIMIT_CHECK( 4 + 2 + 2 );\n    version         = FT_NEXT_ULONG( p );\n    format          = FT_NEXT_USHORT( p );\n    defaultBaseline = FT_NEXT_USHORT( p );\n\n    /* only version 1.0 is defined (1996) */\n    if ( version != 0x00010000UL )\n      FT_INVALID_FORMAT;\n\n    /* only format 1, 2, 3 are defined (1996) */\n    GXV_TRACE(( \" (format = %d)\\n\", format ));\n    if ( format > 3 )\n      FT_INVALID_FORMAT;\n\n    if ( defaultBaseline > 31 )\n      FT_INVALID_FORMAT;\n\n    bsln->defaultBaseline = defaultBaseline;\n\n    fmt_funcs_table[format]( p, limit, gxvalid );\n\n    FT_TRACE4(( \"\\n\" ));\n  }\n\n\n/* arch-tag: ebe81143-fdaa-4c68-a4d1-b57227daa3bc\n   (do not change this comment) */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvcommn.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvcommn.c                                                             */\n/*                                                                         */\n/*    TrueTypeGX/AAT common tables validation (body).                      */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2009, 2010, 2013                                 */\n/*  by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"gxvcommn.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gxvcommon\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       16bit offset sorter                     *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static int\n  gxv_compare_ushort_offset( FT_UShort*  a,\n                             FT_UShort*  b )\n  {\n    if ( *a < *b )\n      return -1;\n    else if ( *a > *b )\n      return 1;\n    else\n      return 0;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  gxv_set_length_by_ushort_offset( FT_UShort*     offset,\n                                   FT_UShort**    length,\n                                   FT_UShort*     buff,\n                                   FT_UInt        nmemb,\n                                   FT_UShort      limit,\n                                   GXV_Validator  gxvalid )\n  {\n    FT_UInt  i;\n\n\n    for ( i = 0; i < nmemb; i++ )\n      *(length[i]) = 0;\n\n    for ( i = 0; i < nmemb; i++ )\n      buff[i] = offset[i];\n    buff[nmemb] = limit;\n\n    ft_qsort( buff, ( nmemb + 1 ), sizeof ( FT_UShort ),\n              ( int(*)(const void*, const void*) )gxv_compare_ushort_offset );\n\n    if ( buff[nmemb] > limit )\n      FT_INVALID_OFFSET;\n\n    for ( i = 0; i < nmemb; i++ )\n    {\n      FT_UInt  j;\n\n\n      for ( j = 0; j < nmemb; j++ )\n        if ( buff[j] == offset[i] )\n          break;\n\n      if ( j == nmemb )\n        FT_INVALID_OFFSET;\n\n      *(length[i]) = (FT_UShort)( buff[j + 1] - buff[j] );\n\n      if ( 0 != offset[i] && 0 == *(length[i]) )\n        FT_INVALID_OFFSET;\n    }\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       32bit offset sorter                     *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static int\n  gxv_compare_ulong_offset( FT_ULong*  a,\n                            FT_ULong*  b )\n  {\n    if ( *a < *b )\n      return -1;\n    else if ( *a > *b )\n      return 1;\n    else\n      return 0;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  gxv_set_length_by_ulong_offset( FT_ULong*      offset,\n                                  FT_ULong**     length,\n                                  FT_ULong*      buff,\n                                  FT_UInt        nmemb,\n                                  FT_ULong       limit,\n                                  GXV_Validator  gxvalid)\n  {\n    FT_UInt  i;\n\n\n    for ( i = 0; i < nmemb; i++ )\n      *(length[i]) = 0;\n\n    for ( i = 0; i < nmemb; i++ )\n      buff[i] = offset[i];\n    buff[nmemb] = limit;\n\n    ft_qsort( buff, ( nmemb + 1 ), sizeof ( FT_ULong ),\n              ( int(*)(const void*, const void*) )gxv_compare_ulong_offset );\n\n    if ( buff[nmemb] > limit )\n      FT_INVALID_OFFSET;\n\n    for ( i = 0; i < nmemb; i++ )\n    {\n      FT_UInt  j;\n\n\n      for ( j = 0; j < nmemb; j++ )\n        if ( buff[j] == offset[i] )\n          break;\n\n      if ( j == nmemb )\n        FT_INVALID_OFFSET;\n\n      *(length[i]) = buff[j + 1] - buff[j];\n\n      if ( 0 != offset[i] && 0 == *(length[i]) )\n        FT_INVALID_OFFSET;\n    }\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****               scan value array and get min & max              *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  FT_LOCAL_DEF( void )\n  gxv_array_getlimits_byte( FT_Bytes       table,\n                            FT_Bytes       limit,\n                            FT_Byte*       min,\n                            FT_Byte*       max,\n                            GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n\n    *min = 0xFF;\n    *max = 0x00;\n\n    while ( p < limit )\n    {\n      FT_Byte  val;\n\n\n      GXV_LIMIT_CHECK( 1 );\n      val = FT_NEXT_BYTE( p );\n\n      *min = (FT_Byte)FT_MIN( *min, val );\n      *max = (FT_Byte)FT_MAX( *max, val );\n    }\n\n    gxvalid->subtable_length = p - table;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  gxv_array_getlimits_ushort( FT_Bytes       table,\n                              FT_Bytes       limit,\n                              FT_UShort*     min,\n                              FT_UShort*     max,\n                              GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n\n    *min = 0xFFFFU;\n    *max = 0x0000;\n\n    while ( p < limit )\n    {\n      FT_UShort  val;\n\n\n      GXV_LIMIT_CHECK( 2 );\n      val = FT_NEXT_USHORT( p );\n\n      *min = (FT_Byte)FT_MIN( *min, val );\n      *max = (FT_Byte)FT_MAX( *max, val );\n    }\n\n    gxvalid->subtable_length = p - table;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       BINSEARCHHEADER                         *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct  GXV_BinSrchHeader_\n  {\n    FT_UShort  unitSize;\n    FT_UShort  nUnits;\n    FT_UShort  searchRange;\n    FT_UShort  entrySelector;\n    FT_UShort  rangeShift;\n\n  } GXV_BinSrchHeader;\n\n\n  static void\n  gxv_BinSrchHeader_check_consistency( GXV_BinSrchHeader*  binSrchHeader,\n                                       GXV_Validator       gxvalid )\n  {\n    FT_UShort  searchRange;\n    FT_UShort  entrySelector;\n    FT_UShort  rangeShift;\n\n\n    if ( binSrchHeader->unitSize == 0 )\n      FT_INVALID_DATA;\n\n    if ( binSrchHeader->nUnits == 0 )\n    {\n      if ( binSrchHeader->searchRange   == 0 &&\n           binSrchHeader->entrySelector == 0 &&\n           binSrchHeader->rangeShift    == 0 )\n        return;\n      else\n        FT_INVALID_DATA;\n    }\n\n    for ( searchRange = 1, entrySelector = 1;\n          ( searchRange * 2 ) <= binSrchHeader->nUnits &&\n            searchRange < 0x8000U;\n          searchRange *= 2, entrySelector++ )\n      ;\n\n    entrySelector--;\n    searchRange = (FT_UShort)( searchRange * binSrchHeader->unitSize );\n    rangeShift  = (FT_UShort)( binSrchHeader->nUnits * binSrchHeader->unitSize\n                               - searchRange );\n\n    if ( searchRange   != binSrchHeader->searchRange   ||\n         entrySelector != binSrchHeader->entrySelector ||\n         rangeShift    != binSrchHeader->rangeShift    )\n    {\n      GXV_TRACE(( \"Inconsistency found in BinSrchHeader\\n\" ));\n      GXV_TRACE(( \"originally: unitSize=%d, nUnits=%d, \"\n                  \"searchRange=%d, entrySelector=%d, \"\n                  \"rangeShift=%d\\n\",\n                  binSrchHeader->unitSize, binSrchHeader->nUnits,\n                  binSrchHeader->searchRange, binSrchHeader->entrySelector,\n                  binSrchHeader->rangeShift ));\n      GXV_TRACE(( \"calculated: unitSize=%d, nUnits=%d, \"\n                  \"searchRange=%d, entrySelector=%d, \"\n                  \"rangeShift=%d\\n\",\n                  binSrchHeader->unitSize, binSrchHeader->nUnits,\n                  searchRange, entrySelector, rangeShift ));\n\n      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );\n    }\n  }\n\n\n  /*\n   * parser & validator of BinSrchHeader\n   * which is used in LookupTable format 2, 4, 6.\n   *\n   * Essential parameters (unitSize, nUnits) are returned by\n   * given pointer, others (searchRange, entrySelector, rangeShift)\n   * can be calculated by essential parameters, so they are just\n   * validated and discarded.\n   *\n   * However, wrong values in searchRange, entrySelector, rangeShift\n   * won't cause fatal errors, because these parameters might be\n   * only used in old m68k font driver in MacOS.\n   *   -- suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>\n   */\n\n  FT_LOCAL_DEF( void )\n  gxv_BinSrchHeader_validate( FT_Bytes       table,\n                              FT_Bytes       limit,\n                              FT_UShort*     unitSize_p,\n                              FT_UShort*     nUnits_p,\n                              GXV_Validator  gxvalid )\n  {\n    FT_Bytes           p = table;\n    GXV_BinSrchHeader  binSrchHeader;\n\n\n    GXV_NAME_ENTER( \"BinSrchHeader validate\" );\n\n    if ( *unitSize_p == 0 )\n    {\n      GXV_LIMIT_CHECK( 2 );\n      binSrchHeader.unitSize =  FT_NEXT_USHORT( p );\n    }\n    else\n      binSrchHeader.unitSize = *unitSize_p;\n\n    if ( *nUnits_p == 0 )\n    {\n      GXV_LIMIT_CHECK( 2 );\n      binSrchHeader.nUnits = FT_NEXT_USHORT( p );\n    }\n    else\n      binSrchHeader.nUnits = *nUnits_p;\n\n    GXV_LIMIT_CHECK( 2 + 2 + 2 );\n    binSrchHeader.searchRange   = FT_NEXT_USHORT( p );\n    binSrchHeader.entrySelector = FT_NEXT_USHORT( p );\n    binSrchHeader.rangeShift    = FT_NEXT_USHORT( p );\n    GXV_TRACE(( \"nUnits %d\\n\", binSrchHeader.nUnits ));\n\n    gxv_BinSrchHeader_check_consistency( &binSrchHeader, gxvalid );\n\n    if ( *unitSize_p == 0 )\n      *unitSize_p = binSrchHeader.unitSize;\n\n    if ( *nUnits_p == 0 )\n      *nUnits_p = binSrchHeader.nUnits;\n\n    gxvalid->subtable_length = p - table;\n    GXV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         LOOKUP TABLE                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#define GXV_LOOKUP_VALUE_LOAD( P, SIGNSPEC )                   \\\n          ( P += 2, gxv_lookup_value_load( P - 2, SIGNSPEC ) )\n\n  static GXV_LookupValueDesc\n  gxv_lookup_value_load( FT_Bytes  p,\n                         int       signspec )\n  {\n    GXV_LookupValueDesc  v;\n\n\n    if ( signspec == GXV_LOOKUPVALUE_UNSIGNED )\n      v.u = FT_NEXT_USHORT( p );\n    else\n      v.s = FT_NEXT_SHORT( p );\n\n    return v;\n  }\n\n\n#define GXV_UNITSIZE_VALIDATE( FORMAT, UNITSIZE, NUNITS, CORRECTSIZE ) \\\n          FT_BEGIN_STMNT                                               \\\n            if ( UNITSIZE != CORRECTSIZE )                             \\\n            {                                                          \\\n              FT_ERROR(( \"unitSize=%d differs from\"                    \\\n                         \" expected unitSize=%d\"                       \\\n                         \" in LookupTable %s\\n\",                       \\\n                          UNITSIZE, CORRECTSIZE, FORMAT ));            \\\n              if ( UNITSIZE != 0 && NUNITS != 0 )                      \\\n              {                                                        \\\n                FT_ERROR(( \" cannot validate anymore\\n\" ));            \\\n                FT_INVALID_FORMAT;                                     \\\n              }                                                        \\\n              else                                                     \\\n                FT_ERROR(( \" forcibly continues\\n\" ));                 \\\n            }                                                          \\\n          FT_END_STMNT\n\n\n  /* ================= Simple Array Format 0 Lookup Table ================ */\n  static void\n  gxv_LookupTable_fmt0_validate( FT_Bytes       table,\n                                 FT_Bytes       limit,\n                                 GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p = table;\n    FT_UShort  i;\n\n    GXV_LookupValueDesc  value;\n\n\n    GXV_NAME_ENTER( \"LookupTable format 0\" );\n\n    GXV_LIMIT_CHECK( 2 * gxvalid->face->num_glyphs );\n\n    for ( i = 0; i < gxvalid->face->num_glyphs; i++ )\n    {\n      GXV_LIMIT_CHECK( 2 );\n      if ( p + 2 >= limit )     /* some fonts have too-short fmt0 array */\n      {\n        GXV_TRACE(( \"too short, glyphs %d - %d are missing\\n\",\n                    i, gxvalid->face->num_glyphs ));\n        GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );\n        break;\n      }\n\n      value = GXV_LOOKUP_VALUE_LOAD( p, gxvalid->lookupval_sign );\n      gxvalid->lookupval_func( i, &value, gxvalid );\n    }\n\n    gxvalid->subtable_length = p - table;\n    GXV_EXIT;\n  }\n\n\n  /* ================= Segment Single Format 2 Loolup Table ============== */\n  /*\n   * Apple spec says:\n   *\n   *   To guarantee that a binary search terminates, you must include one or\n   *   more special `end of search table' values at the end of the data to\n   *   be searched.  The number of termination values that need to be\n   *   included is table-specific.  The value that indicates binary search\n   *   termination is 0xFFFF.\n   *\n   * The problem is that nUnits does not include this end-marker.  It's\n   * quite difficult to discriminate whether the following 0xFFFF comes from\n   * the end-marker or some next data.\n   *\n   *   -- suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>\n   */\n  static void\n  gxv_LookupTable_fmt2_skip_endmarkers( FT_Bytes       table,\n                                        FT_UShort      unitSize,\n                                        GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n\n    while ( ( p + 4 ) < gxvalid->root->limit )\n    {\n      if ( p[0] != 0xFF || p[1] != 0xFF || /* lastGlyph */\n           p[2] != 0xFF || p[3] != 0xFF )  /* firstGlyph */\n        break;\n      p += unitSize;\n    }\n\n    gxvalid->subtable_length = p - table;\n  }\n\n\n  static void\n  gxv_LookupTable_fmt2_validate( FT_Bytes       table,\n                                 FT_Bytes       limit,\n                                 GXV_Validator  gxvalid )\n  {\n    FT_Bytes             p = table;\n    FT_UShort            gid;\n\n    FT_UShort            unitSize;\n    FT_UShort            nUnits;\n    FT_UShort            unit;\n    FT_UShort            lastGlyph;\n    FT_UShort            firstGlyph;\n    GXV_LookupValueDesc  value;\n\n\n    GXV_NAME_ENTER( \"LookupTable format 2\" );\n\n    unitSize = nUnits = 0;\n    gxv_BinSrchHeader_validate( p, limit, &unitSize, &nUnits, gxvalid );\n    p += gxvalid->subtable_length;\n\n    GXV_UNITSIZE_VALIDATE( \"format2\", unitSize, nUnits, 6 );\n\n    for ( unit = 0, gid = 0; unit < nUnits; unit++ )\n    {\n      GXV_LIMIT_CHECK( 2 + 2 + 2 );\n      lastGlyph  = FT_NEXT_USHORT( p );\n      firstGlyph = FT_NEXT_USHORT( p );\n      value      = GXV_LOOKUP_VALUE_LOAD( p, gxvalid->lookupval_sign );\n\n      gxv_glyphid_validate( firstGlyph, gxvalid );\n      gxv_glyphid_validate( lastGlyph, gxvalid );\n\n      if ( lastGlyph < gid )\n      {\n        GXV_TRACE(( \"reverse ordered segment specification:\"\n                    \" lastGlyph[%d]=%d < lastGlyph[%d]=%d\\n\",\n                    unit, lastGlyph, unit - 1 , gid ));\n        GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );\n      }\n\n      if ( lastGlyph < firstGlyph )\n      {\n        GXV_TRACE(( \"reverse ordered range specification at unit %d:\",\n                    \" lastGlyph %d < firstGlyph %d \",\n                    unit, lastGlyph, firstGlyph ));\n        GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );\n\n        if ( gxvalid->root->level == FT_VALIDATE_TIGHT )\n          continue;     /* ftxvalidator silently skips such an entry */\n\n        FT_TRACE4(( \"continuing with exchanged values\\n\" ));\n        gid        = firstGlyph;\n        firstGlyph = lastGlyph;\n        lastGlyph  = gid;\n      }\n\n      for ( gid = firstGlyph; gid <= lastGlyph; gid++ )\n        gxvalid->lookupval_func( gid, &value, gxvalid );\n    }\n\n    gxv_LookupTable_fmt2_skip_endmarkers( p, unitSize, gxvalid );\n    p += gxvalid->subtable_length;\n\n    gxvalid->subtable_length = p - table;\n    GXV_EXIT;\n  }\n\n\n  /* ================= Segment Array Format 4 Lookup Table =============== */\n  static void\n  gxv_LookupTable_fmt4_validate( FT_Bytes       table,\n                                 FT_Bytes       limit,\n                                 GXV_Validator  gxvalid )\n  {\n    FT_Bytes             p = table;\n    FT_UShort            unit;\n    FT_UShort            gid;\n\n    FT_UShort            unitSize;\n    FT_UShort            nUnits;\n    FT_UShort            lastGlyph;\n    FT_UShort            firstGlyph;\n    GXV_LookupValueDesc  base_value;\n    GXV_LookupValueDesc  value;\n\n\n    GXV_NAME_ENTER( \"LookupTable format 4\" );\n\n    unitSize = nUnits = 0;\n    gxv_BinSrchHeader_validate( p, limit, &unitSize, &nUnits, gxvalid );\n    p += gxvalid->subtable_length;\n\n    GXV_UNITSIZE_VALIDATE( \"format4\", unitSize, nUnits, 6 );\n\n    for ( unit = 0, gid = 0; unit < nUnits; unit++ )\n    {\n      GXV_LIMIT_CHECK( 2 + 2 );\n      lastGlyph  = FT_NEXT_USHORT( p );\n      firstGlyph = FT_NEXT_USHORT( p );\n\n      gxv_glyphid_validate( firstGlyph, gxvalid );\n      gxv_glyphid_validate( lastGlyph, gxvalid );\n\n      if ( lastGlyph < gid )\n      {\n        GXV_TRACE(( \"reverse ordered segment specification:\"\n                    \" lastGlyph[%d]=%d < lastGlyph[%d]=%d\\n\",\n                    unit, lastGlyph, unit - 1 , gid ));\n        GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );\n      }\n\n      if ( lastGlyph < firstGlyph )\n      {\n        GXV_TRACE(( \"reverse ordered range specification at unit %d:\",\n                    \" lastGlyph %d < firstGlyph %d \",\n                    unit, lastGlyph, firstGlyph ));\n        GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );\n\n        if ( gxvalid->root->level == FT_VALIDATE_TIGHT )\n          continue; /* ftxvalidator silently skips such an entry */\n\n        FT_TRACE4(( \"continuing with exchanged values\\n\" ));\n        gid        = firstGlyph;\n        firstGlyph = lastGlyph;\n        lastGlyph  = gid;\n      }\n\n      GXV_LIMIT_CHECK( 2 );\n      base_value = GXV_LOOKUP_VALUE_LOAD( p, GXV_LOOKUPVALUE_UNSIGNED );\n\n      for ( gid = firstGlyph; gid <= lastGlyph; gid++ )\n      {\n        value = gxvalid->lookupfmt4_trans( (FT_UShort)( gid - firstGlyph ),\n                                         &base_value,\n                                         limit,\n                                         gxvalid );\n\n        gxvalid->lookupval_func( gid, &value, gxvalid );\n      }\n    }\n\n    gxv_LookupTable_fmt2_skip_endmarkers( p, unitSize, gxvalid );\n    p += gxvalid->subtable_length;\n\n    gxvalid->subtable_length = p - table;\n    GXV_EXIT;\n  }\n\n\n  /* ================= Segment Table Format 6 Lookup Table =============== */\n  static void\n  gxv_LookupTable_fmt6_skip_endmarkers( FT_Bytes       table,\n                                        FT_UShort      unitSize,\n                                        GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n\n    while ( p < gxvalid->root->limit )\n    {\n      if ( p[0] != 0xFF || p[1] != 0xFF )\n        break;\n      p += unitSize;\n    }\n\n    gxvalid->subtable_length = p - table;\n  }\n\n\n  static void\n  gxv_LookupTable_fmt6_validate( FT_Bytes       table,\n                                 FT_Bytes       limit,\n                                 GXV_Validator  gxvalid )\n  {\n    FT_Bytes             p = table;\n    FT_UShort            unit;\n    FT_UShort            prev_glyph;\n\n    FT_UShort            unitSize;\n    FT_UShort            nUnits;\n    FT_UShort            glyph;\n    GXV_LookupValueDesc  value;\n\n\n    GXV_NAME_ENTER( \"LookupTable format 6\" );\n\n    unitSize = nUnits = 0;\n    gxv_BinSrchHeader_validate( p, limit, &unitSize, &nUnits, gxvalid );\n    p += gxvalid->subtable_length;\n\n    GXV_UNITSIZE_VALIDATE( \"format6\", unitSize, nUnits, 4 );\n\n    for ( unit = 0, prev_glyph = 0; unit < nUnits; unit++ )\n    {\n      GXV_LIMIT_CHECK( 2 + 2 );\n      glyph = FT_NEXT_USHORT( p );\n      value = GXV_LOOKUP_VALUE_LOAD( p, gxvalid->lookupval_sign );\n\n      if ( gxv_glyphid_validate( glyph, gxvalid ) )\n        GXV_TRACE(( \" endmarker found within defined range\"\n                    \" (entry %d < nUnits=%d)\\n\",\n                    unit, nUnits ));\n\n      if ( prev_glyph > glyph )\n      {\n        GXV_TRACE(( \"current gid 0x%04x < previous gid 0x%04x\\n\",\n                    glyph, prev_glyph ));\n        GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );\n      }\n      prev_glyph = glyph;\n\n      gxvalid->lookupval_func( glyph, &value, gxvalid );\n    }\n\n    gxv_LookupTable_fmt6_skip_endmarkers( p, unitSize, gxvalid );\n    p += gxvalid->subtable_length;\n\n    gxvalid->subtable_length = p - table;\n    GXV_EXIT;\n  }\n\n\n  /* ================= Trimmed Array Format 8 Lookup Table =============== */\n  static void\n  gxv_LookupTable_fmt8_validate( FT_Bytes       table,\n                                 FT_Bytes       limit,\n                                 GXV_Validator  gxvalid )\n  {\n    FT_Bytes              p = table;\n    FT_UShort             i;\n\n    GXV_LookupValueDesc   value;\n    FT_UShort             firstGlyph;\n    FT_UShort             glyphCount;\n\n\n    GXV_NAME_ENTER( \"LookupTable format 8\" );\n\n    /* firstGlyph + glyphCount */\n    GXV_LIMIT_CHECK( 2 + 2 );\n    firstGlyph = FT_NEXT_USHORT( p );\n    glyphCount = FT_NEXT_USHORT( p );\n\n    gxv_glyphid_validate( firstGlyph, gxvalid );\n    gxv_glyphid_validate( (FT_UShort)( firstGlyph + glyphCount ), gxvalid );\n\n    /* valueArray */\n    for ( i = 0; i < glyphCount; i++ )\n    {\n      GXV_LIMIT_CHECK( 2 );\n      value = GXV_LOOKUP_VALUE_LOAD( p, gxvalid->lookupval_sign );\n      gxvalid->lookupval_func( (FT_UShort)( firstGlyph + i ), &value, gxvalid );\n    }\n\n    gxvalid->subtable_length = p - table;\n    GXV_EXIT;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  gxv_LookupTable_validate( FT_Bytes       table,\n                            FT_Bytes       limit,\n                            GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p = table;\n    FT_UShort  format;\n\n    GXV_Validate_Func  fmt_funcs_table[] =\n    {\n      gxv_LookupTable_fmt0_validate, /* 0 */\n      NULL,                          /* 1 */\n      gxv_LookupTable_fmt2_validate, /* 2 */\n      NULL,                          /* 3 */\n      gxv_LookupTable_fmt4_validate, /* 4 */\n      NULL,                          /* 5 */\n      gxv_LookupTable_fmt6_validate, /* 6 */\n      NULL,                          /* 7 */\n      gxv_LookupTable_fmt8_validate, /* 8 */\n    };\n\n    GXV_Validate_Func  func;\n\n\n    GXV_NAME_ENTER( \"LookupTable\" );\n\n    /* lookuptbl_head may be used in fmt4 transit function. */\n    gxvalid->lookuptbl_head = table;\n\n    /* format */\n    GXV_LIMIT_CHECK( 2 );\n    format = FT_NEXT_USHORT( p );\n    GXV_TRACE(( \" (format %d)\\n\", format ));\n\n    if ( format > 8 )\n      FT_INVALID_FORMAT;\n\n    func = fmt_funcs_table[format];\n    if ( func == NULL )\n      FT_INVALID_FORMAT;\n\n    func( p, limit, gxvalid );\n    p += gxvalid->subtable_length;\n\n    gxvalid->subtable_length = p - table;\n\n    GXV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                          Glyph ID                             *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL_DEF( FT_Int )\n  gxv_glyphid_validate( FT_UShort      gid,\n                        GXV_Validator  gxvalid )\n  {\n    FT_Face  face;\n\n\n    if ( gid == 0xFFFFU )\n    {\n      GXV_EXIT;\n      return 1;\n    }\n\n    face = gxvalid->face;\n    if ( face->num_glyphs < gid )\n    {\n      GXV_TRACE(( \" gxv_glyphid_check() gid overflow: num_glyphs %d < %d\\n\",\n                  face->num_glyphs, gid ));\n      GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );\n    }\n\n    return 0;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                        CONTROL POINT                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL_DEF( void )\n  gxv_ctlPoint_validate( FT_UShort      gid,\n                         FT_Short       ctl_point,\n                         GXV_Validator  gxvalid )\n  {\n    FT_Face       face;\n    FT_Error      error;\n\n    FT_GlyphSlot  glyph;\n    FT_Outline    outline;\n    short         n_points;\n\n\n    face = gxvalid->face;\n\n    error = FT_Load_Glyph( face,\n                           gid,\n                           FT_LOAD_NO_BITMAP | FT_LOAD_IGNORE_TRANSFORM );\n    if ( error )\n      FT_INVALID_GLYPH_ID;\n\n    glyph    = face->glyph;\n    outline  = glyph->outline;\n    n_points = outline.n_points;\n\n\n    if ( !( ctl_point < n_points ) )\n      FT_INVALID_DATA;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                          SFNT NAME                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL_DEF( void )\n  gxv_sfntName_validate( FT_UShort      name_index,\n                         FT_UShort      min_index,\n                         FT_UShort      max_index,\n                         GXV_Validator  gxvalid )\n  {\n    FT_SfntName  name;\n    FT_UInt      i;\n    FT_UInt      nnames;\n\n\n    GXV_NAME_ENTER( \"sfntName\" );\n\n    if ( name_index < min_index || max_index < name_index )\n      FT_INVALID_FORMAT;\n\n    nnames = FT_Get_Sfnt_Name_Count( gxvalid->face );\n    for ( i = 0; i < nnames; i++ )\n    {\n      if ( FT_Get_Sfnt_Name( gxvalid->face, i, &name ) != FT_Err_Ok )\n        continue ;\n\n      if ( name.name_id == name_index )\n        goto Out;\n    }\n\n    GXV_TRACE(( \"  nameIndex = %d (UNTITLED)\\n\", name_index ));\n    FT_INVALID_DATA;\n    goto Exit;  /* make compiler happy */\n\n  Out:\n    FT_TRACE1(( \"  nameIndex = %d (\", name_index ));\n    GXV_TRACE_HEXDUMP_SFNTNAME( name );\n    FT_TRACE1(( \")\\n\" ));\n\n  Exit:\n    GXV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                          STATE TABLE                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* -------------------------- Class Table --------------------------- */\n\n  /*\n   * highestClass specifies how many classes are defined in this\n   * Class Subtable.  Apple spec does not mention whether undefined\n   * holes in the class (e.g.: 0-3 are predefined, 4 is unused, 5 is used)\n   * are permitted.  At present, holes in a defined class are not checked.\n   *   -- suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>\n   */\n\n  static void\n  gxv_ClassTable_validate( FT_Bytes       table,\n                           FT_UShort*     length_p,\n                           FT_UShort      stateSize,\n                           FT_Byte*       maxClassID_p,\n                           GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p     = table;\n    FT_Bytes   limit = table + *length_p;\n    FT_UShort  firstGlyph;\n    FT_UShort  nGlyphs;\n\n\n    GXV_NAME_ENTER( \"ClassTable\" );\n\n    *maxClassID_p = 3;  /* Classes 0, 2, and 3 are predefined */\n\n    GXV_LIMIT_CHECK( 2 + 2 );\n    firstGlyph = FT_NEXT_USHORT( p );\n    nGlyphs    = FT_NEXT_USHORT( p );\n\n    GXV_TRACE(( \" (firstGlyph = %d, nGlyphs = %d)\\n\", firstGlyph, nGlyphs ));\n\n    if ( !nGlyphs )\n      goto Out;\n\n    gxv_glyphid_validate( (FT_UShort)( firstGlyph + nGlyphs ), gxvalid );\n\n    {\n      FT_Byte    nGlyphInClass[256];\n      FT_Byte    classID;\n      FT_UShort  i;\n\n\n      ft_memset( nGlyphInClass, 0, 256 );\n\n\n      for ( i = 0; i < nGlyphs; i++ )\n      {\n        GXV_LIMIT_CHECK( 1 );\n        classID = FT_NEXT_BYTE( p );\n        switch ( classID )\n        {\n          /* following classes should not appear in class array */\n        case 0:             /* end of text */\n        case 2:             /* out of bounds */\n        case 3:             /* end of line */\n          FT_INVALID_DATA;\n          break;\n\n        case 1:             /* out of bounds */\n        default:            /* user-defined: 4 - ( stateSize - 1 ) */\n          if ( classID >= stateSize )\n            FT_INVALID_DATA;   /* assign glyph to undefined state */\n\n          nGlyphInClass[classID]++;\n          break;\n        }\n      }\n      *length_p = (FT_UShort)( p - table );\n\n      /* scan max ClassID in use */\n      for ( i = 0; i < stateSize; i++ )\n        if ( ( 3 < i ) && ( nGlyphInClass[i] > 0 ) )\n          *maxClassID_p = (FT_Byte)i;  /* XXX: Check Range? */\n    }\n\n  Out:\n    GXV_TRACE(( \"Declared stateSize=0x%02x, Used maxClassID=0x%02x\\n\",\n                stateSize, *maxClassID_p ));\n    GXV_EXIT;\n  }\n\n\n  /* --------------------------- State Array ----------------------------- */\n\n  static void\n  gxv_StateArray_validate( FT_Bytes       table,\n                           FT_UShort*     length_p,\n                           FT_Byte        maxClassID,\n                           FT_UShort      stateSize,\n                           FT_Byte*       maxState_p,\n                           FT_Byte*       maxEntry_p,\n                           GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p     = table;\n    FT_Bytes  limit = table + *length_p;\n    FT_Byte   clazz;\n    FT_Byte   entry;\n\n    FT_UNUSED( stateSize ); /* for the non-debugging case */\n\n\n    GXV_NAME_ENTER( \"StateArray\" );\n\n    GXV_TRACE(( \"parse %d bytes by stateSize=%d maxClassID=%d\\n\",\n                (int)(*length_p), stateSize, (int)(maxClassID) ));\n\n    /*\n     * 2 states are predefined and must be described in StateArray:\n     * state 0 (start of text), 1 (start of line)\n     */\n    GXV_LIMIT_CHECK( ( 1 + maxClassID ) * 2 );\n\n    *maxState_p = 0;\n    *maxEntry_p = 0;\n\n    /* read if enough to read another state */\n    while ( p + ( 1 + maxClassID ) <= limit )\n    {\n      (*maxState_p)++;\n      for ( clazz = 0; clazz <= maxClassID; clazz++ )\n      {\n        entry = FT_NEXT_BYTE( p );\n        *maxEntry_p = (FT_Byte)FT_MAX( *maxEntry_p, entry );\n      }\n    }\n    GXV_TRACE(( \"parsed: maxState=%d, maxEntry=%d\\n\",\n                *maxState_p, *maxEntry_p ));\n\n    *length_p = (FT_UShort)( p - table );\n\n    GXV_EXIT;\n  }\n\n\n  /* --------------------------- Entry Table ----------------------------- */\n\n  static void\n  gxv_EntryTable_validate( FT_Bytes       table,\n                           FT_UShort*     length_p,\n                           FT_Byte        maxEntry,\n                           FT_UShort      stateArray,\n                           FT_UShort      stateArray_length,\n                           FT_Byte        maxClassID,\n                           FT_Bytes       statetable_table,\n                           FT_Bytes       statetable_limit,\n                           GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p     = table;\n    FT_Bytes  limit = table + *length_p;\n    FT_Byte   entry;\n    FT_Byte   state;\n    FT_Int    entrySize = 2 + 2 + GXV_GLYPHOFFSET_SIZE( statetable );\n\n    GXV_XStateTable_GlyphOffsetDesc  glyphOffset;\n\n\n    GXV_NAME_ENTER( \"EntryTable\" );\n\n    GXV_TRACE(( \"maxEntry=%d entrySize=%d\\n\", maxEntry, entrySize ));\n\n    if ( ( maxEntry + 1 ) * entrySize > *length_p )\n    {\n      GXV_SET_ERR_IF_PARANOID( FT_INVALID_TOO_SHORT );\n\n      /* ftxvalidator and FontValidator both warn and continue */\n      maxEntry = (FT_Byte)( *length_p / entrySize - 1 );\n      GXV_TRACE(( \"too large maxEntry, shrinking to %d fit EntryTable length\\n\",\n                  maxEntry ));\n    }\n\n    for ( entry = 0; entry <= maxEntry; entry++ )\n    {\n      FT_UShort  newState;\n      FT_UShort  flags;\n\n\n      GXV_LIMIT_CHECK( 2 + 2 );\n      newState = FT_NEXT_USHORT( p );\n      flags    = FT_NEXT_USHORT( p );\n\n\n      if ( newState < stateArray                     ||\n           stateArray + stateArray_length < newState )\n      {\n        GXV_TRACE(( \" newState offset 0x%04x is out of stateArray\\n\",\n                    newState ));\n        GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );\n        continue;\n      }\n\n      if ( 0 != ( ( newState - stateArray ) % ( 1 + maxClassID ) ) )\n      {\n        GXV_TRACE(( \" newState offset 0x%04x is not aligned to %d-classes\\n\",\n                    newState,  1 + maxClassID ));\n        GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );\n        continue;\n      }\n\n      state = (FT_Byte)( ( newState - stateArray ) / ( 1 + maxClassID ) );\n\n      switch ( GXV_GLYPHOFFSET_FMT( statetable ) )\n      {\n      case GXV_GLYPHOFFSET_NONE:\n        glyphOffset.uc = 0;  /* make compiler happy */\n        break;\n\n      case GXV_GLYPHOFFSET_UCHAR:\n        glyphOffset.uc = FT_NEXT_BYTE( p );\n        break;\n\n      case GXV_GLYPHOFFSET_CHAR:\n        glyphOffset.c = FT_NEXT_CHAR( p );\n        break;\n\n      case GXV_GLYPHOFFSET_USHORT:\n        glyphOffset.u = FT_NEXT_USHORT( p );\n        break;\n\n      case GXV_GLYPHOFFSET_SHORT:\n        glyphOffset.s = FT_NEXT_SHORT( p );\n        break;\n\n      case GXV_GLYPHOFFSET_ULONG:\n        glyphOffset.ul = FT_NEXT_ULONG( p );\n        break;\n\n      case GXV_GLYPHOFFSET_LONG:\n        glyphOffset.l = FT_NEXT_LONG( p );\n        break;\n\n      default:\n        GXV_SET_ERR_IF_PARANOID( FT_INVALID_FORMAT );\n        goto Exit;\n      }\n\n      if ( NULL != gxvalid->statetable.entry_validate_func )\n        gxvalid->statetable.entry_validate_func( state,\n                                                 flags,\n                                                 &glyphOffset,\n                                                 statetable_table,\n                                                 statetable_limit,\n                                                 gxvalid );\n    }\n\n  Exit:\n    *length_p = (FT_UShort)( p - table );\n\n    GXV_EXIT;\n  }\n\n\n  /* =========================== State Table ============================= */\n\n  FT_LOCAL_DEF( void )\n  gxv_StateTable_subtable_setup( FT_UShort      table_size,\n                                 FT_UShort      classTable,\n                                 FT_UShort      stateArray,\n                                 FT_UShort      entryTable,\n                                 FT_UShort*     classTable_length_p,\n                                 FT_UShort*     stateArray_length_p,\n                                 FT_UShort*     entryTable_length_p,\n                                 GXV_Validator  gxvalid )\n  {\n    FT_UShort   o[3];\n    FT_UShort*  l[3];\n    FT_UShort   buff[4];\n\n\n    o[0] = classTable;\n    o[1] = stateArray;\n    o[2] = entryTable;\n    l[0] = classTable_length_p;\n    l[1] = stateArray_length_p;\n    l[2] = entryTable_length_p;\n\n    gxv_set_length_by_ushort_offset( o, l, buff, 3, table_size, gxvalid );\n  }\n\n\n  FT_LOCAL_DEF( void )\n  gxv_StateTable_validate( FT_Bytes       table,\n                           FT_Bytes       limit,\n                           GXV_Validator  gxvalid )\n  {\n    FT_UShort   stateSize;\n    FT_UShort   classTable;     /* offset to Class(Sub)Table */\n    FT_UShort   stateArray;     /* offset to StateArray */\n    FT_UShort   entryTable;     /* offset to EntryTable */\n\n    FT_UShort   classTable_length;\n    FT_UShort   stateArray_length;\n    FT_UShort   entryTable_length;\n    FT_Byte     maxClassID;\n    FT_Byte     maxState;\n    FT_Byte     maxEntry;\n\n    GXV_StateTable_Subtable_Setup_Func  setup_func;\n\n    FT_Bytes    p = table;\n\n\n    GXV_NAME_ENTER( \"StateTable\" );\n\n    GXV_TRACE(( \"StateTable header\\n\" ));\n\n    GXV_LIMIT_CHECK( 2 + 2 + 2 + 2 );\n    stateSize  = FT_NEXT_USHORT( p );\n    classTable = FT_NEXT_USHORT( p );\n    stateArray = FT_NEXT_USHORT( p );\n    entryTable = FT_NEXT_USHORT( p );\n\n    GXV_TRACE(( \"stateSize=0x%04x\\n\", stateSize ));\n    GXV_TRACE(( \"offset to classTable=0x%04x\\n\", classTable ));\n    GXV_TRACE(( \"offset to stateArray=0x%04x\\n\", stateArray ));\n    GXV_TRACE(( \"offset to entryTable=0x%04x\\n\", entryTable ));\n\n    if ( stateSize > 0xFF )\n      FT_INVALID_DATA;\n\n    if ( gxvalid->statetable.optdata_load_func != NULL )\n      gxvalid->statetable.optdata_load_func( p, limit, gxvalid );\n\n    if ( gxvalid->statetable.subtable_setup_func != NULL)\n      setup_func = gxvalid->statetable.subtable_setup_func;\n    else\n      setup_func = gxv_StateTable_subtable_setup;\n\n    setup_func( (FT_UShort)( limit - table ),\n                classTable,\n                stateArray,\n                entryTable,\n                &classTable_length,\n                &stateArray_length,\n                &entryTable_length,\n                gxvalid );\n\n    GXV_TRACE(( \"StateTable Subtables\\n\" ));\n\n    if ( classTable != 0 )\n      gxv_ClassTable_validate( table + classTable,\n                               &classTable_length,\n                               stateSize,\n                               &maxClassID,\n                               gxvalid );\n    else\n      maxClassID = (FT_Byte)( stateSize - 1 );\n\n    if ( stateArray != 0 )\n      gxv_StateArray_validate( table + stateArray,\n                               &stateArray_length,\n                               maxClassID,\n                               stateSize,\n                               &maxState,\n                               &maxEntry,\n                               gxvalid );\n    else\n    {\n#if 0\n      maxState = 1;     /* 0:start of text, 1:start of line are predefined */\n#endif\n      maxEntry = 0;\n    }\n\n    if ( maxEntry > 0 && entryTable == 0 )\n      FT_INVALID_OFFSET;\n\n    if ( entryTable != 0 )\n      gxv_EntryTable_validate( table + entryTable,\n                               &entryTable_length,\n                               maxEntry,\n                               stateArray,\n                               stateArray_length,\n                               maxClassID,\n                               table,\n                               limit,\n                               gxvalid );\n\n    GXV_EXIT;\n  }\n\n\n  /* ================= eXtended State Table (for morx) =================== */\n\n  FT_LOCAL_DEF( void )\n  gxv_XStateTable_subtable_setup( FT_ULong       table_size,\n                                  FT_ULong       classTable,\n                                  FT_ULong       stateArray,\n                                  FT_ULong       entryTable,\n                                  FT_ULong*      classTable_length_p,\n                                  FT_ULong*      stateArray_length_p,\n                                  FT_ULong*      entryTable_length_p,\n                                  GXV_Validator  gxvalid )\n  {\n    FT_ULong   o[3];\n    FT_ULong*  l[3];\n    FT_ULong   buff[4];\n\n\n    o[0] = classTable;\n    o[1] = stateArray;\n    o[2] = entryTable;\n    l[0] = classTable_length_p;\n    l[1] = stateArray_length_p;\n    l[2] = entryTable_length_p;\n\n    gxv_set_length_by_ulong_offset( o, l, buff, 3, table_size, gxvalid );\n  }\n\n\n  static void\n  gxv_XClassTable_lookupval_validate( FT_UShort            glyph,\n                                      GXV_LookupValueCPtr  value_p,\n                                      GXV_Validator        gxvalid )\n  {\n    FT_UNUSED( glyph );\n\n    if ( value_p->u >= gxvalid->xstatetable.nClasses )\n      FT_INVALID_DATA;\n    if ( value_p->u > gxvalid->xstatetable.maxClassID )\n      gxvalid->xstatetable.maxClassID = value_p->u;\n  }\n\n\n  /*\n    +===============+ --------+\n    | lookup header |         |\n    +===============+         |\n    | BinSrchHeader |         |\n    +===============+         |\n    | lastGlyph[0]  |         |\n    +---------------+         |\n    | firstGlyph[0] |         |    head of lookup table\n    +---------------+         |             +\n    | offset[0]     |    ->   |          offset            [byte]\n    +===============+         |             +\n    | lastGlyph[1]  |         | (glyphID - firstGlyph) * 2 [byte]\n    +---------------+         |\n    | firstGlyph[1] |         |\n    +---------------+         |\n    | offset[1]     |         |\n    +===============+         |\n                              |\n     ....                     |\n                              |\n    16bit value array         |\n    +===============+         |\n    |     value     | <-------+\n     ....\n  */\n  static GXV_LookupValueDesc\n  gxv_XClassTable_lookupfmt4_transit( FT_UShort            relative_gindex,\n                                      GXV_LookupValueCPtr  base_value_p,\n                                      FT_Bytes             lookuptbl_limit,\n                                      GXV_Validator        gxvalid )\n  {\n    FT_Bytes             p;\n    FT_Bytes             limit;\n    FT_UShort            offset;\n    GXV_LookupValueDesc  value;\n\n    /* XXX: check range? */\n    offset = (FT_UShort)( base_value_p->u +\n                          relative_gindex * sizeof ( FT_UShort ) );\n\n    p     = gxvalid->lookuptbl_head + offset;\n    limit = lookuptbl_limit;\n\n    GXV_LIMIT_CHECK ( 2 );\n    value.u = FT_NEXT_USHORT( p );\n\n    return value;\n  }\n\n\n  static void\n  gxv_XStateArray_validate( FT_Bytes       table,\n                            FT_ULong*      length_p,\n                            FT_UShort      maxClassID,\n                            FT_ULong       stateSize,\n                            FT_UShort*     maxState_p,\n                            FT_UShort*     maxEntry_p,\n                            GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p = table;\n    FT_Bytes   limit = table + *length_p;\n    FT_UShort  clazz;\n    FT_UShort  entry;\n\n    FT_UNUSED( stateSize ); /* for the non-debugging case */\n\n\n    GXV_NAME_ENTER( \"XStateArray\" );\n\n    GXV_TRACE(( \"parse % 3d bytes by stateSize=% 3d maxClassID=% 3d\\n\",\n                (int)(*length_p), stateSize, (int)(maxClassID) ));\n\n    /*\n     * 2 states are predefined and must be described:\n     * state 0 (start of text), 1 (start of line)\n     */\n    GXV_LIMIT_CHECK( ( 1 + maxClassID ) * 2 * 2 );\n\n    *maxState_p = 0;\n    *maxEntry_p = 0;\n\n    /* read if enough to read another state */\n    while ( p + ( ( 1 + maxClassID ) * 2 ) <= limit )\n    {\n      (*maxState_p)++;\n      for ( clazz = 0; clazz <= maxClassID; clazz++ )\n      {\n        entry = FT_NEXT_USHORT( p );\n        *maxEntry_p = (FT_UShort)FT_MAX( *maxEntry_p, entry );\n      }\n    }\n    GXV_TRACE(( \"parsed: maxState=%d, maxEntry=%d\\n\",\n                *maxState_p, *maxEntry_p ));\n\n    *length_p = p - table;\n\n    GXV_EXIT;\n  }\n\n\n  static void\n  gxv_XEntryTable_validate( FT_Bytes       table,\n                            FT_ULong*      length_p,\n                            FT_UShort      maxEntry,\n                            FT_ULong       stateArray_length,\n                            FT_UShort      maxClassID,\n                            FT_Bytes       xstatetable_table,\n                            FT_Bytes       xstatetable_limit,\n                            GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p = table;\n    FT_Bytes   limit = table + *length_p;\n    FT_UShort  entry;\n    FT_UShort  state;\n    FT_Int     entrySize = 2 + 2 + GXV_GLYPHOFFSET_SIZE( xstatetable );\n\n\n    GXV_NAME_ENTER( \"XEntryTable\" );\n    GXV_TRACE(( \"maxEntry=%d entrySize=%d\\n\", maxEntry, entrySize ));\n\n    if ( ( p + ( maxEntry + 1 ) * entrySize ) > limit )\n      FT_INVALID_TOO_SHORT;\n\n    for (entry = 0; entry <= maxEntry ; entry++ )\n    {\n      FT_UShort                        newState_idx;\n      FT_UShort                        flags;\n      GXV_XStateTable_GlyphOffsetDesc  glyphOffset;\n\n\n      GXV_LIMIT_CHECK( 2 + 2 );\n      newState_idx = FT_NEXT_USHORT( p );\n      flags        = FT_NEXT_USHORT( p );\n\n      if ( stateArray_length < (FT_ULong)( newState_idx * 2 ) )\n      {\n        GXV_TRACE(( \"  newState index 0x%04x points out of stateArray\\n\",\n                    newState_idx ));\n        GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );\n      }\n\n      state = (FT_UShort)( newState_idx / ( 1 + maxClassID ) );\n      if ( 0 != ( newState_idx % ( 1 + maxClassID ) ) )\n      {\n        FT_TRACE4(( \"-> new state = %d (supposed)\\n\"\n                    \"but newState index 0x%04x is not aligned to %d-classes\\n\",\n                    state, newState_idx,  1 + maxClassID ));\n        GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );\n      }\n\n      switch ( GXV_GLYPHOFFSET_FMT( xstatetable ) )\n      {\n      case GXV_GLYPHOFFSET_NONE:\n        glyphOffset.uc = 0; /* make compiler happy */\n        break;\n\n      case GXV_GLYPHOFFSET_UCHAR:\n        glyphOffset.uc = FT_NEXT_BYTE( p );\n        break;\n\n      case GXV_GLYPHOFFSET_CHAR:\n        glyphOffset.c = FT_NEXT_CHAR( p );\n        break;\n\n      case GXV_GLYPHOFFSET_USHORT:\n        glyphOffset.u = FT_NEXT_USHORT( p );\n        break;\n\n      case GXV_GLYPHOFFSET_SHORT:\n        glyphOffset.s = FT_NEXT_SHORT( p );\n        break;\n\n      case GXV_GLYPHOFFSET_ULONG:\n        glyphOffset.ul = FT_NEXT_ULONG( p );\n        break;\n\n      case GXV_GLYPHOFFSET_LONG:\n        glyphOffset.l = FT_NEXT_LONG( p );\n        break;\n\n      default:\n        GXV_SET_ERR_IF_PARANOID( FT_INVALID_FORMAT );\n        goto Exit;\n      }\n\n      if ( NULL != gxvalid->xstatetable.entry_validate_func )\n        gxvalid->xstatetable.entry_validate_func( state,\n                                                  flags,\n                                                  &glyphOffset,\n                                                  xstatetable_table,\n                                                  xstatetable_limit,\n                                                  gxvalid );\n    }\n\n  Exit:\n    *length_p = p - table;\n\n    GXV_EXIT;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  gxv_XStateTable_validate( FT_Bytes       table,\n                            FT_Bytes       limit,\n                            GXV_Validator  gxvalid )\n  {\n    /* StateHeader members */\n    FT_ULong   classTable;      /* offset to Class(Sub)Table */\n    FT_ULong   stateArray;      /* offset to StateArray */\n    FT_ULong   entryTable;      /* offset to EntryTable */\n\n    FT_ULong   classTable_length;\n    FT_ULong   stateArray_length;\n    FT_ULong   entryTable_length;\n    FT_UShort  maxState;\n    FT_UShort  maxEntry;\n\n    GXV_XStateTable_Subtable_Setup_Func  setup_func;\n\n    FT_Bytes   p = table;\n\n\n    GXV_NAME_ENTER( \"XStateTable\" );\n\n    GXV_TRACE(( \"XStateTable header\\n\" ));\n\n    GXV_LIMIT_CHECK( 4 + 4 + 4 + 4 );\n    gxvalid->xstatetable.nClasses = FT_NEXT_ULONG( p );\n    classTable = FT_NEXT_ULONG( p );\n    stateArray = FT_NEXT_ULONG( p );\n    entryTable = FT_NEXT_ULONG( p );\n\n    GXV_TRACE(( \"nClasses =0x%08x\\n\", gxvalid->xstatetable.nClasses ));\n    GXV_TRACE(( \"offset to classTable=0x%08x\\n\", classTable ));\n    GXV_TRACE(( \"offset to stateArray=0x%08x\\n\", stateArray ));\n    GXV_TRACE(( \"offset to entryTable=0x%08x\\n\", entryTable ));\n\n    if ( gxvalid->xstatetable.nClasses > 0xFFFFU )\n      FT_INVALID_DATA;\n\n    GXV_TRACE(( \"StateTable Subtables\\n\" ));\n\n    if ( gxvalid->xstatetable.optdata_load_func != NULL )\n      gxvalid->xstatetable.optdata_load_func( p, limit, gxvalid );\n\n    if ( gxvalid->xstatetable.subtable_setup_func != NULL )\n      setup_func = gxvalid->xstatetable.subtable_setup_func;\n    else\n      setup_func = gxv_XStateTable_subtable_setup;\n\n    setup_func( limit - table,\n                classTable,\n                stateArray,\n                entryTable,\n                &classTable_length,\n                &stateArray_length,\n                &entryTable_length,\n                gxvalid );\n\n    if ( classTable != 0 )\n    {\n      gxvalid->xstatetable.maxClassID = 0;\n      gxvalid->lookupval_sign         = GXV_LOOKUPVALUE_UNSIGNED;\n      gxvalid->lookupval_func         = gxv_XClassTable_lookupval_validate;\n      gxvalid->lookupfmt4_trans       = gxv_XClassTable_lookupfmt4_transit;\n      gxv_LookupTable_validate( table + classTable,\n                                table + classTable + classTable_length,\n                                gxvalid );\n#if 0\n      if ( gxvalid->subtable_length < classTable_length )\n        classTable_length = gxvalid->subtable_length;\n#endif\n    }\n    else\n    {\n      /* XXX: check range? */\n      gxvalid->xstatetable.maxClassID =\n        (FT_UShort)( gxvalid->xstatetable.nClasses - 1 );\n    }\n\n    if ( stateArray != 0 )\n      gxv_XStateArray_validate( table + stateArray,\n                                &stateArray_length,\n                                gxvalid->xstatetable.maxClassID,\n                                gxvalid->xstatetable.nClasses,\n                                &maxState,\n                                &maxEntry,\n                                gxvalid );\n    else\n    {\n#if 0\n      maxState = 1; /* 0:start of text, 1:start of line are predefined */\n#endif\n      maxEntry = 0;\n    }\n\n    if ( maxEntry > 0 && entryTable == 0 )\n      FT_INVALID_OFFSET;\n\n    if ( entryTable != 0 )\n      gxv_XEntryTable_validate( table + entryTable,\n                                &entryTable_length,\n                                maxEntry,\n                                stateArray_length,\n                                gxvalid->xstatetable.maxClassID,\n                                table,\n                                limit,\n                                gxvalid );\n\n    GXV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                        Table overlapping                      *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static int\n  gxv_compare_ranges( FT_Bytes  table1_start,\n                      FT_ULong  table1_length,\n                      FT_Bytes  table2_start,\n                      FT_ULong  table2_length )\n  {\n    if ( table1_start == table2_start )\n    {\n      if ( ( table1_length == 0 || table2_length == 0 ) )\n        goto Out;\n    }\n    else if ( table1_start < table2_start )\n    {\n      if ( ( table1_start + table1_length ) <= table2_start )\n        goto Out;\n    }\n    else if ( table1_start > table2_start )\n    {\n      if ( ( table1_start >= table2_start + table2_length ) )\n        goto Out;\n    }\n    return 1;\n\n  Out:\n    return 0;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  gxv_odtect_add_range( FT_Bytes          start,\n                        FT_ULong          length,\n                        const FT_String*  name,\n                        GXV_odtect_Range  odtect )\n  {\n    odtect->range[odtect->nRanges].start  = start;\n    odtect->range[odtect->nRanges].length = length;\n    odtect->range[odtect->nRanges].name   = (FT_String*)name;\n    odtect->nRanges++;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  gxv_odtect_validate( GXV_odtect_Range  odtect,\n                       GXV_Validator     gxvalid )\n  {\n    FT_UInt  i, j;\n\n\n    GXV_NAME_ENTER( \"check overlap among multi ranges\" );\n\n    for ( i = 0; i < odtect->nRanges; i++ )\n      for ( j = 0; j < i; j++ )\n        if ( 0 != gxv_compare_ranges( odtect->range[i].start,\n                                      odtect->range[i].length,\n                                      odtect->range[j].start,\n                                      odtect->range[j].length ) )\n        {\n#ifdef FT_DEBUG_LEVEL_TRACE\n          if ( odtect->range[i].name || odtect->range[j].name )\n            GXV_TRACE(( \"found overlap between range %d and range %d\\n\",\n                        i, j ));\n          else\n            GXV_TRACE(( \"found overlap between `%s' and `%s\\'\\n\",\n                        odtect->range[i].name,\n                        odtect->range[j].name ));\n#endif\n          FT_INVALID_OFFSET;\n        }\n\n    GXV_EXIT;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvcommn.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvcommn.h                                                             */\n/*                                                                         */\n/*    TrueTypeGX/AAT common tables validation (specification).             */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2012, 2014                                       */\n/*  by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*\n   * keywords in variable naming\n   * ---------------------------\n   *  table: Of type FT_Bytes, pointing to the start of this table/subtable.\n   *  limit: Of type FT_Bytes, pointing to the end of this table/subtable,\n   *         including padding for alignment.\n   *  offset: Of type FT_UInt, the number of octets from the start to target.\n   *  length: Of type FT_UInt, the number of octets from the start to the\n   *          end in this table/subtable, including padding for alignment.\n   *\n   *  _MIN, _MAX: Should be added to the tail of macros, as INT_MIN, etc.\n   */\n\n\n#ifndef __GXVCOMMN_H__\n#define __GXVCOMMN_H__\n\n\n#include <ft2build.h>\n#include \"gxvalid.h\"\n#include FT_INTERNAL_DEBUG_H\n#include FT_SFNT_NAMES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /* some variables are not evaluated or only used in trace */\n\n#ifdef  FT_DEBUG_LEVEL_TRACE\n#define GXV_LOAD_TRACE_VARS\n#else\n#undef  GXV_LOAD_TRACE_VARS\n#endif\n\n#undef GXV_LOAD_UNUSED_VARS /* debug purpose */\n\n#define IS_PARANOID_VALIDATION          ( gxvalid->root->level >= FT_VALIDATE_PARANOID )\n#define GXV_SET_ERR_IF_PARANOID( err )  { if ( IS_PARANOID_VALIDATION ) ( err ); }\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         VALIDATION                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct GXV_ValidatorRec_*  GXV_Validator;\n\n\n#define DUMMY_LIMIT 0\n\n  typedef void\n  (*GXV_Validate_Func)( FT_Bytes       table,\n                        FT_Bytes       limit,\n                        GXV_Validator  gxvalid );\n\n\n  /* ====================== LookupTable Validator ======================== */\n\n  typedef union  GXV_LookupValueDesc_\n  {\n    FT_UShort u;\n    FT_Short  s;\n\n  } GXV_LookupValueDesc;\n\n  typedef const GXV_LookupValueDesc* GXV_LookupValueCPtr;\n\n  typedef enum  GXV_LookupValue_SignSpec_\n  {\n    GXV_LOOKUPVALUE_UNSIGNED = 0,\n    GXV_LOOKUPVALUE_SIGNED\n\n  } GXV_LookupValue_SignSpec;\n\n\n  typedef void\n  (*GXV_Lookup_Value_Validate_Func)( FT_UShort            glyph,\n                                     GXV_LookupValueCPtr  value_p,\n                                     GXV_Validator        gxvalid );\n\n  typedef GXV_LookupValueDesc\n  (*GXV_Lookup_Fmt4_Transit_Func)( FT_UShort            relative_gindex,\n                                   GXV_LookupValueCPtr  base_value_p,\n                                   FT_Bytes             lookuptbl_limit,\n                                   GXV_Validator        gxvalid );\n\n\n  /* ====================== StateTable Validator ========================= */\n\n  typedef enum  GXV_GlyphOffset_Format_\n  {\n    GXV_GLYPHOFFSET_NONE   = -1,\n    GXV_GLYPHOFFSET_UCHAR  = 2,\n    GXV_GLYPHOFFSET_CHAR,\n    GXV_GLYPHOFFSET_USHORT = 4,\n    GXV_GLYPHOFFSET_SHORT,\n    GXV_GLYPHOFFSET_ULONG  = 8,\n    GXV_GLYPHOFFSET_LONG\n\n  } GXV_GlyphOffset_Format;\n\n\n#define GXV_GLYPHOFFSET_FMT( table )           \\\n        ( gxvalid->table.entry_glyphoffset_fmt )\n\n#define GXV_GLYPHOFFSET_SIZE( table )              \\\n        ( gxvalid->table.entry_glyphoffset_fmt / 2 )\n\n\n  /* ----------------------- 16bit StateTable ---------------------------- */\n\n  typedef union  GXV_StateTable_GlyphOffsetDesc_\n  {\n    FT_Byte    uc;\n    FT_UShort  u;       /* same as GXV_LookupValueDesc */\n    FT_ULong   ul;\n    FT_Char    c;\n    FT_Short   s;       /* same as GXV_LookupValueDesc */\n    FT_Long    l;\n\n  } GXV_StateTable_GlyphOffsetDesc;\n\n  typedef const GXV_StateTable_GlyphOffsetDesc* GXV_StateTable_GlyphOffsetCPtr;\n\n  typedef void\n  (*GXV_StateTable_Subtable_Setup_Func)( FT_UShort      table_size,\n                                         FT_UShort      classTable,\n                                         FT_UShort      stateArray,\n                                         FT_UShort      entryTable,\n                                         FT_UShort*     classTable_length_p,\n                                         FT_UShort*     stateArray_length_p,\n                                         FT_UShort*     entryTable_length_p,\n                                         GXV_Validator  gxvalid );\n\n  typedef void\n  (*GXV_StateTable_Entry_Validate_Func)(\n     FT_Byte                         state,\n     FT_UShort                       flags,\n     GXV_StateTable_GlyphOffsetCPtr  glyphOffset_p,\n     FT_Bytes                        statetable_table,\n     FT_Bytes                        statetable_limit,\n     GXV_Validator                   gxvalid );\n\n  typedef void\n  (*GXV_StateTable_OptData_Load_Func)( FT_Bytes       table,\n                                       FT_Bytes       limit,\n                                       GXV_Validator  gxvalid );\n\n  typedef struct  GXV_StateTable_ValidatorRec_\n  {\n    GXV_GlyphOffset_Format              entry_glyphoffset_fmt;\n    void*                               optdata;\n\n    GXV_StateTable_Subtable_Setup_Func  subtable_setup_func;\n    GXV_StateTable_Entry_Validate_Func  entry_validate_func;\n    GXV_StateTable_OptData_Load_Func    optdata_load_func;\n\n  } GXV_StateTable_ValidatorRec, *GXV_StateTable_ValidatorRecData;\n\n\n  /* ---------------------- 32bit XStateTable ---------------------------- */\n\n  typedef GXV_StateTable_GlyphOffsetDesc  GXV_XStateTable_GlyphOffsetDesc;\n\n  typedef const GXV_XStateTable_GlyphOffsetDesc* GXV_XStateTable_GlyphOffsetCPtr;\n\n  typedef void\n  (*GXV_XStateTable_Subtable_Setup_Func)( FT_ULong       table_size,\n                                          FT_ULong       classTable,\n                                          FT_ULong       stateArray,\n                                          FT_ULong       entryTable,\n                                          FT_ULong*      classTable_length_p,\n                                          FT_ULong*      stateArray_length_p,\n                                          FT_ULong*      entryTable_length_p,\n                                          GXV_Validator  gxvalid );\n\n  typedef void\n  (*GXV_XStateTable_Entry_Validate_Func)(\n     FT_UShort                       state,\n     FT_UShort                       flags,\n     GXV_StateTable_GlyphOffsetCPtr  glyphOffset_p,\n     FT_Bytes                        xstatetable_table,\n     FT_Bytes                        xstatetable_limit,\n     GXV_Validator                   gxvalid );\n\n\n  typedef GXV_StateTable_OptData_Load_Func  GXV_XStateTable_OptData_Load_Func;\n\n\n  typedef struct  GXV_XStateTable_ValidatorRec_\n  {\n    int                                  entry_glyphoffset_fmt;\n    void*                                optdata;\n\n    GXV_XStateTable_Subtable_Setup_Func  subtable_setup_func;\n    GXV_XStateTable_Entry_Validate_Func  entry_validate_func;\n    GXV_XStateTable_OptData_Load_Func    optdata_load_func;\n\n    FT_ULong                             nClasses;\n    FT_UShort                            maxClassID;\n\n  } GXV_XStateTable_ValidatorRec, *GXV_XStateTable_ValidatorRecData;\n\n\n  /* ===================================================================== */\n\n  typedef struct  GXV_ValidatorRec_\n  {\n    FT_Validator  root;\n\n    FT_Face       face;\n    void*         table_data;\n\n    FT_ULong      subtable_length;\n\n    GXV_LookupValue_SignSpec        lookupval_sign;\n    GXV_Lookup_Value_Validate_Func  lookupval_func;\n    GXV_Lookup_Fmt4_Transit_Func    lookupfmt4_trans;\n    FT_Bytes                        lookuptbl_head;\n\n    FT_UShort  min_gid;\n    FT_UShort  max_gid;\n\n    GXV_StateTable_ValidatorRec     statetable;\n    GXV_XStateTable_ValidatorRec    xstatetable;\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n    FT_UInt             debug_indent;\n    const FT_String*    debug_function_name[3];\n#endif\n\n  } GXV_ValidatorRec;\n\n\n#define GXV_TABLE_DATA( tag, field )                           \\\n        ( ( (GXV_ ## tag ## _Data)gxvalid->table_data )->field )\n\n#undef  FT_INVALID_\n#define FT_INVALID_( _error ) \\\n          ft_validator_error( gxvalid->root, FT_THROW( _error ) )\n\n#define GXV_LIMIT_CHECK( _count )                                     \\\n          FT_BEGIN_STMNT                                              \\\n            if ( p + _count > ( limit? limit : gxvalid->root->limit ) ) \\\n              FT_INVALID_TOO_SHORT;                                   \\\n          FT_END_STMNT\n\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n#define GXV_INIT  gxvalid->debug_indent = 0\n\n#define GXV_NAME_ENTER( name )                             \\\n          FT_BEGIN_STMNT                                   \\\n            gxvalid->debug_indent += 2;                      \\\n            FT_TRACE4(( \"%*.s\", gxvalid->debug_indent, 0 )); \\\n            FT_TRACE4(( \"%s table\\n\", name ));             \\\n          FT_END_STMNT\n\n#define GXV_EXIT  gxvalid->debug_indent -= 2\n\n#define GXV_TRACE( s )                                     \\\n          FT_BEGIN_STMNT                                   \\\n            FT_TRACE4(( \"%*.s\", gxvalid->debug_indent, 0 )); \\\n            FT_TRACE4( s );                                \\\n          FT_END_STMNT\n\n#else /* !FT_DEBUG_LEVEL_TRACE */\n\n#define GXV_INIT                do { } while ( 0 )\n#define GXV_NAME_ENTER( name )  do { } while ( 0 )\n#define GXV_EXIT                do { } while ( 0 )\n\n#define GXV_TRACE( s )          do { } while ( 0 )\n\n#endif  /* !FT_DEBUG_LEVEL_TRACE */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    32bit alignment checking                   *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#define GXV_32BIT_ALIGNMENT_VALIDATE( a ) \\\n          FT_BEGIN_STMNT                  \\\n            {                             \\\n              if ( (a) & 3 )              \\\n                FT_INVALID_OFFSET;        \\\n            }                             \\\n          FT_END_STMNT\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    Dumping Binary Data                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#define GXV_TRACE_HEXDUMP( p, len )                     \\\n          FT_BEGIN_STMNT                                \\\n            {                                           \\\n              FT_Bytes  b;                              \\\n                                                        \\\n                                                        \\\n              for ( b = p; b < (FT_Bytes)p + len; b++ ) \\\n                FT_TRACE1((\"\\\\x%02x\", *b)) ;            \\\n            }                                           \\\n          FT_END_STMNT\n\n#define GXV_TRACE_HEXDUMP_C( p, len )                   \\\n          FT_BEGIN_STMNT                                \\\n            {                                           \\\n              FT_Bytes  b;                              \\\n                                                        \\\n                                                        \\\n              for ( b = p; b < (FT_Bytes)p + len; b++ ) \\\n                if ( 0x40 < *b && *b < 0x7E )           \\\n                  FT_TRACE1((\"%c\", *b)) ;               \\\n                else                                    \\\n                  FT_TRACE1((\"\\\\x%02x\", *b)) ;          \\\n            }                                           \\\n          FT_END_STMNT\n\n#define GXV_TRACE_HEXDUMP_SFNTNAME( n )               \\\n          GXV_TRACE_HEXDUMP( n.string, n.string_len )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         LOOKUP TABLE                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL( void )\n  gxv_BinSrchHeader_validate( FT_Bytes       p,\n                              FT_Bytes       limit,\n                              FT_UShort*     unitSize_p,\n                              FT_UShort*     nUnits_p,\n                              GXV_Validator  gxvalid );\n\n  FT_LOCAL( void )\n  gxv_LookupTable_validate( FT_Bytes       table,\n                            FT_Bytes       limit,\n                            GXV_Validator  gxvalid );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                          Glyph ID                             *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL( FT_Int )\n  gxv_glyphid_validate( FT_UShort      gid,\n                        GXV_Validator  gxvalid );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                        CONTROL POINT                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL( void )\n  gxv_ctlPoint_validate( FT_UShort      gid,\n                         FT_Short       ctl_point,\n                         GXV_Validator  gxvalid );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                          SFNT NAME                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL( void )\n  gxv_sfntName_validate( FT_UShort      name_index,\n                         FT_UShort      min_index,\n                         FT_UShort      max_index,\n                         GXV_Validator  gxvalid );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                          STATE TABLE                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL( void )\n  gxv_StateTable_subtable_setup( FT_UShort      table_size,\n                                 FT_UShort      classTable,\n                                 FT_UShort      stateArray,\n                                 FT_UShort      entryTable,\n                                 FT_UShort*     classTable_length_p,\n                                 FT_UShort*     stateArray_length_p,\n                                 FT_UShort*     entryTable_length_p,\n                                 GXV_Validator  gxvalid );\n\n  FT_LOCAL( void )\n  gxv_XStateTable_subtable_setup( FT_ULong       table_size,\n                                  FT_ULong       classTable,\n                                  FT_ULong       stateArray,\n                                  FT_ULong       entryTable,\n                                  FT_ULong*      classTable_length_p,\n                                  FT_ULong*      stateArray_length_p,\n                                  FT_ULong*      entryTable_length_p,\n                                  GXV_Validator  gxvalid );\n\n  FT_LOCAL( void )\n  gxv_StateTable_validate( FT_Bytes       table,\n                           FT_Bytes       limit,\n                           GXV_Validator  gxvalid );\n\n  FT_LOCAL( void )\n  gxv_XStateTable_validate( FT_Bytes       table,\n                            FT_Bytes       limit,\n                            GXV_Validator  gxvalid );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                 UTILITY MACROS AND FUNCTIONS                  *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL( void )\n  gxv_array_getlimits_byte( FT_Bytes       table,\n                            FT_Bytes       limit,\n                            FT_Byte*       min,\n                            FT_Byte*       max,\n                            GXV_Validator  gxvalid );\n\n  FT_LOCAL( void )\n  gxv_array_getlimits_ushort( FT_Bytes       table,\n                              FT_Bytes       limit,\n                              FT_UShort*     min,\n                              FT_UShort*     max,\n                              GXV_Validator  gxvalid );\n\n  FT_LOCAL( void )\n  gxv_set_length_by_ushort_offset( FT_UShort*     offset,\n                                   FT_UShort**    length,\n                                   FT_UShort*     buff,\n                                   FT_UInt        nmemb,\n                                   FT_UShort      limit,\n                                   GXV_Validator  gxvalid );\n\n  FT_LOCAL( void )\n  gxv_set_length_by_ulong_offset( FT_ULong*      offset,\n                                  FT_ULong**     length,\n                                  FT_ULong*      buff,\n                                  FT_UInt        nmemb,\n                                  FT_ULong       limit,\n                                  GXV_Validator  gxvalid);\n\n\n#define GXV_SUBTABLE_OFFSET_CHECK( _offset )          \\\n          FT_BEGIN_STMNT                              \\\n            if ( (_offset) > gxvalid->subtable_length ) \\\n              FT_INVALID_OFFSET;                      \\\n          FT_END_STMNT\n\n#define GXV_SUBTABLE_LIMIT_CHECK( _count )                  \\\n          FT_BEGIN_STMNT                                    \\\n            if ( ( p + (_count) - gxvalid->subtable_start ) > \\\n                   gxvalid->subtable_length )                 \\\n              FT_INVALID_TOO_SHORT;                         \\\n          FT_END_STMNT\n\n#define GXV_USHORT_TO_SHORT( _us )                                    \\\n          ( ( 0x8000U < ( _us ) ) ? ( ( _us ) - 0x8000U ) : ( _us ) )\n\n#define GXV_STATETABLE_HEADER_SIZE  ( 2 + 2 + 2 + 2 )\n#define GXV_STATEHEADER_SIZE        GXV_STATETABLE_HEADER_SIZE\n\n#define GXV_XSTATETABLE_HEADER_SIZE  ( 4 + 4 + 4 + 4 )\n#define GXV_XSTATEHEADER_SIZE        GXV_XSTATETABLE_HEADER_SIZE\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                        Table overlapping                      *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct  GXV_odtect_DataRec_\n  {\n    FT_Bytes    start;\n    FT_ULong    length;\n    FT_String*  name;\n\n  } GXV_odtect_DataRec,  *GXV_odtect_Data;\n\n  typedef struct  GXV_odtect_RangeRec_\n  {\n    FT_UInt          nRanges;\n    GXV_odtect_Data  range;\n\n  } GXV_odtect_RangeRec, *GXV_odtect_Range;\n\n\n  FT_LOCAL( void )\n  gxv_odtect_add_range( FT_Bytes          start,\n                        FT_ULong          length,\n                        const FT_String*  name,\n                        GXV_odtect_Range  odtect );\n\n  FT_LOCAL( void )\n  gxv_odtect_validate( GXV_odtect_Range  odtect,\n                       GXV_Validator     gxvalid );\n\n\n#define GXV_ODTECT( n, odtect )                              \\\n          GXV_odtect_DataRec   odtect ## _range[n];          \\\n          GXV_odtect_RangeRec  odtect ## _rec = { 0, NULL }; \\\n          GXV_odtect_Range     odtect = NULL\n\n#define GXV_ODTECT_INIT( odtect )                      \\\n          FT_BEGIN_STMNT                               \\\n            odtect ## _rec.nRanges = 0;                \\\n            odtect ## _rec.range   = odtect ## _range; \\\n            odtect                 = & odtect ## _rec; \\\n          FT_END_STMNT\n\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __GXVCOMMN_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxverror.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxverror.h                                                             */\n/*                                                                         */\n/*    TrueTypeGX/AAT validation module error codes (specification only).   */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2012-2013                                        */\n/*    by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the OpenType validation module error      */\n  /* enumeration constants.                                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __GXVERROR_H__\n#define __GXVERROR_H__\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  GXV_Err_\n#define FT_ERR_BASE    FT_Mod_Err_GXvalid\n\n#include FT_ERRORS_H\n\n#endif /* __GXVERROR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvfeat.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvfeat.c                                                              */\n/*                                                                         */\n/*    TrueTypeGX/AAT feat table validation (body).                         */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2008, 2012 by                                    */\n/*  suzuki toshiya, Masatake YAMATO, Red Hat K.K.,                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"gxvalid.h\"\n#include \"gxvcommn.h\"\n#include \"gxvfeat.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gxvfeat\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      Data and Types                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct  GXV_feat_DataRec_\n  {\n    FT_UInt    reserved_size;\n    FT_UShort  feature;\n    FT_UShort  setting;\n\n  } GXV_feat_DataRec, *GXV_feat_Data;\n\n\n#define GXV_FEAT_DATA( field )  GXV_TABLE_DATA( feat, field )\n\n\n  typedef enum  GXV_FeatureFlagsMask_\n  {\n    GXV_FEAT_MASK_EXCLUSIVE_SETTINGS = 0x8000U,\n    GXV_FEAT_MASK_DYNAMIC_DEFAULT    = 0x4000,\n    GXV_FEAT_MASK_UNUSED             = 0x3F00,\n    GXV_FEAT_MASK_DEFAULT_SETTING    = 0x00FF\n\n  } GXV_FeatureFlagsMask;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      UTILITY FUNCTIONS                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static void\n  gxv_feat_registry_validate( FT_UShort      feature,\n                              FT_UShort      nSettings,\n                              FT_Bool        exclusive,\n                              GXV_Validator  gxvalid )\n  {\n    GXV_NAME_ENTER( \"feature in registry\" );\n\n    GXV_TRACE(( \" (feature = %u)\\n\", feature ));\n\n    if ( feature >= gxv_feat_registry_length )\n    {\n      GXV_TRACE(( \"feature number %d is out of range %d\\n\",\n                  feature, gxv_feat_registry_length ));\n      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );\n      goto Exit;\n    }\n\n    if ( gxv_feat_registry[feature].existence == 0 )\n    {\n      GXV_TRACE(( \"feature number %d is in defined range but doesn't exist\\n\",\n                  feature ));\n      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );\n      goto Exit;\n    }\n\n    if ( gxv_feat_registry[feature].apple_reserved )\n    {\n      /* Don't use here. Apple is reserved. */\n      GXV_TRACE(( \"feature number %d is reserved by Apple\\n\", feature ));\n      if ( gxvalid->root->level >= FT_VALIDATE_TIGHT )\n        FT_INVALID_DATA;\n    }\n\n    if ( nSettings != gxv_feat_registry[feature].nSettings )\n    {\n      GXV_TRACE(( \"feature %d: nSettings %d != defined nSettings %d\\n\",\n                  feature, nSettings,\n                  gxv_feat_registry[feature].nSettings ));\n      if ( gxvalid->root->level >= FT_VALIDATE_TIGHT )\n        FT_INVALID_DATA;\n    }\n\n    if ( exclusive != gxv_feat_registry[feature].exclusive )\n    {\n      GXV_TRACE(( \"exclusive flag %d differs from predefined value\\n\",\n                  exclusive ));\n      if ( gxvalid->root->level >= FT_VALIDATE_TIGHT )\n        FT_INVALID_DATA;\n    }\n\n  Exit:\n    GXV_EXIT;\n  }\n\n\n  static void\n  gxv_feat_name_index_validate( FT_Bytes       table,\n                                FT_Bytes       limit,\n                                GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n    FT_Short  nameIndex;\n\n\n    GXV_NAME_ENTER( \"nameIndex\" );\n\n    GXV_LIMIT_CHECK( 2 );\n    nameIndex = FT_NEXT_SHORT ( p );\n    GXV_TRACE(( \" (nameIndex = %d)\\n\", nameIndex ));\n\n    gxv_sfntName_validate( (FT_UShort)nameIndex,\n                           255,\n                           32768U,\n                           gxvalid );\n\n    GXV_EXIT;\n  }\n\n\n  static void\n  gxv_feat_setting_validate( FT_Bytes       table,\n                             FT_Bytes       limit,\n                             FT_Bool        exclusive,\n                             GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p = table;\n    FT_UShort  setting;\n\n\n    GXV_NAME_ENTER( \"setting\" );\n\n    GXV_LIMIT_CHECK( 2 );\n\n    setting = FT_NEXT_USHORT( p );\n\n    /* If we have exclusive setting, the setting should be odd. */\n    if ( exclusive && ( setting & 1 ) == 0 )\n      FT_INVALID_DATA;\n\n    gxv_feat_name_index_validate( p, limit, gxvalid );\n\n    GXV_FEAT_DATA( setting ) = setting;\n\n    GXV_EXIT;\n  }\n\n\n  static void\n  gxv_feat_name_validate( FT_Bytes       table,\n                          FT_Bytes       limit,\n                          GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p             = table;\n    FT_UInt    reserved_size = GXV_FEAT_DATA( reserved_size );\n\n    FT_UShort  feature;\n    FT_UShort  nSettings;\n    FT_ULong   settingTable;\n    FT_UShort  featureFlags;\n\n    FT_Bool    exclusive;\n    FT_Int     last_setting;\n    FT_UInt    i;\n\n\n    GXV_NAME_ENTER( \"name\" );\n\n    /* feature + nSettings + settingTable + featureFlags */\n    GXV_LIMIT_CHECK( 2 + 2 + 4 + 2 );\n\n    feature = FT_NEXT_USHORT( p );\n    GXV_FEAT_DATA( feature ) = feature;\n\n    nSettings    = FT_NEXT_USHORT( p );\n    settingTable = FT_NEXT_ULONG ( p );\n    featureFlags = FT_NEXT_USHORT( p );\n\n    if ( settingTable < reserved_size )\n      FT_INVALID_OFFSET;\n\n    if ( ( featureFlags & GXV_FEAT_MASK_UNUSED ) == 0 )\n      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );\n\n    exclusive = FT_BOOL( featureFlags & GXV_FEAT_MASK_EXCLUSIVE_SETTINGS );\n    if ( exclusive )\n    {\n      FT_Byte  dynamic_default;\n\n\n      if ( featureFlags & GXV_FEAT_MASK_DYNAMIC_DEFAULT )\n        dynamic_default = (FT_Byte)( featureFlags &\n                                     GXV_FEAT_MASK_DEFAULT_SETTING );\n      else\n        dynamic_default = 0;\n\n      /* If exclusive, check whether default setting is in the range. */\n      if ( !( dynamic_default < nSettings ) )\n        FT_INVALID_FORMAT;\n    }\n\n    gxv_feat_registry_validate( feature, nSettings, exclusive, gxvalid );\n\n    gxv_feat_name_index_validate( p, limit, gxvalid );\n\n    p = gxvalid->root->base + settingTable;\n    for ( last_setting = -1, i = 0; i < nSettings; i++ )\n    {\n      gxv_feat_setting_validate( p, limit, exclusive, gxvalid );\n\n      if ( (FT_Int)GXV_FEAT_DATA( setting ) <= last_setting )\n        GXV_SET_ERR_IF_PARANOID( FT_INVALID_FORMAT );\n\n      last_setting = (FT_Int)GXV_FEAT_DATA( setting );\n      /* setting + nameIndex */\n      p += ( 2 + 2 );\n    }\n\n    GXV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         feat TABLE                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL_DEF( void )\n  gxv_feat_validate( FT_Bytes      table,\n                     FT_Face       face,\n                     FT_Validator  ftvalid )\n  {\n    GXV_ValidatorRec  gxvalidrec;\n    GXV_Validator     gxvalid = &gxvalidrec;\n\n    GXV_feat_DataRec  featrec;\n    GXV_feat_Data     feat = &featrec;\n\n    FT_Bytes          p     = table;\n    FT_Bytes          limit = 0;\n\n    FT_UInt           featureNameCount;\n\n    FT_UInt           i;\n    FT_Int            last_feature;\n\n\n    gxvalid->root       = ftvalid;\n    gxvalid->table_data = feat;\n    gxvalid->face       = face;\n\n    FT_TRACE3(( \"validating `feat' table\\n\" ));\n    GXV_INIT;\n\n    feat->reserved_size = 0;\n\n    /* version + featureNameCount + none_0 + none_1  */\n    GXV_LIMIT_CHECK( 4 + 2 + 2 + 4 );\n    feat->reserved_size += 4 + 2 + 2 + 4;\n\n    if ( FT_NEXT_ULONG( p ) != 0x00010000UL ) /* Version */\n      FT_INVALID_FORMAT;\n\n    featureNameCount = FT_NEXT_USHORT( p );\n    GXV_TRACE(( \" (featureNameCount = %d)\\n\", featureNameCount ));\n\n    if ( !( IS_PARANOID_VALIDATION ) )\n      p += 6; /* skip (none) and (none) */\n    else\n    {\n      if ( FT_NEXT_USHORT( p ) != 0 )\n        FT_INVALID_DATA;\n\n      if ( FT_NEXT_ULONG( p )  != 0 )\n        FT_INVALID_DATA;\n    }\n\n    feat->reserved_size += featureNameCount * ( 2 + 2 + 4 + 2 + 2 );\n\n    for ( last_feature = -1, i = 0; i < featureNameCount; i++ )\n    {\n      gxv_feat_name_validate( p, limit, gxvalid );\n\n      if ( (FT_Int)GXV_FEAT_DATA( feature ) <= last_feature )\n        GXV_SET_ERR_IF_PARANOID( FT_INVALID_FORMAT );\n\n      last_feature = GXV_FEAT_DATA( feature );\n      p += 2 + 2 + 4 + 2 + 2;\n    }\n\n    FT_TRACE4(( \"\\n\" ));\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvfeat.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvfeat.h                                                              */\n/*                                                                         */\n/*    TrueTypeGX/AAT feat table validation (specification).                */\n/*                                                                         */\n/*  Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __GXVFEAT_H__\n#define __GXVFEAT_H__\n\n\n#include \"gxvalid.h\"\n#include \"gxvcommn.h\"\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                Registry predefined by Apple                   *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* TODO: More compact format */\n  typedef struct  GXV_Feature_RegistryRec_\n  {\n    FT_Bool  existence;\n    FT_Bool  apple_reserved;\n    FT_Bool  exclusive;\n    FT_Byte  nSettings;\n\n  } GX_Feature_RegistryRec;\n\n\n#define gxv_feat_registry_length                  \\\n          ( sizeof ( gxv_feat_registry ) /        \\\n              sizeof ( GX_Feature_RegistryRec ) )\n\n\n  static GX_Feature_RegistryRec  gxv_feat_registry[] =\n  {\n    /* Generated from gxvfgen.c */\n    {1, 0, 0,  1},   /* All Typographic Features */\n    {1, 0, 0,  8},   /* Ligatures */\n    {1, 0, 1,  3},   /* Cursive Connection */\n    {1, 0, 1,  6},   /* Letter Case */\n    {1, 0, 0,  1},   /* Vertical Substitution */\n    {1, 0, 0,  1},   /* Linguistic Rearrangement */\n    {1, 0, 1,  2},   /* Number Spacing */\n    {1, 1, 0,  0},   /* Apple Reserved 1 */\n    {1, 0, 0,  5},   /* Smart Swashes */\n    {1, 0, 1,  3},   /* Diacritics */\n    {1, 0, 1,  4},   /* Vertical Position */\n    {1, 0, 1,  3},   /* Fractions */\n    {1, 1, 0,  0},   /* Apple Reserved 2 */\n    {1, 0, 0,  1},   /* Overlapping Characters */\n    {1, 0, 0,  6},   /* Typographic Extras */\n    {1, 0, 0,  5},   /* Mathematical Extras */\n    {1, 0, 1,  7},   /* Ornament Sets */\n    {1, 0, 1,  1},   /* Character Alternatives */\n    {1, 0, 1,  5},   /* Design Complexity */\n    {1, 0, 1,  6},   /* Style Options */\n    {1, 0, 1, 11},   /* Character Shape */\n    {1, 0, 1,  2},   /* Number Case */\n    {1, 0, 1,  4},   /* Text Spacing */\n    {1, 0, 1, 10},   /* Transliteration */\n    {1, 0, 1,  9},   /* Annotation */\n    {1, 0, 1,  2},   /* Kana Spacing */\n    {1, 0, 1,  2},   /* Ideographic Spacing */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {0, 0, 0,  0},   /* __EMPTY__ */\n    {1, 0, 1,  4},   /* Text Spacing */\n    {1, 0, 1,  2},   /* Kana Spacing */\n    {1, 0, 1,  2},   /* Ideographic Spacing */\n    {1, 0, 1,  4},   /* CJK Roman Spacing */\n  };\n\n\n#endif /* __GXVFEAT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvfgen.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxfgen.c                                                               */\n/*                                                                         */\n/*    Generate feature registry data for gxv `feat' validator.             */\n/*    This program is derived from gxfeatreg.c in gxlayout.                */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2006 by Masatake YAMATO and Redhat K.K.          */\n/*                                                                         */\n/*  This file may only be used,                                            */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/*  gxfeatreg.c                                                            */\n/*                                                                         */\n/*    Database of font features pre-defined by Apple Computer, Inc.        */\n/*    http://developer.apple.com/fonts/Registry/                           */\n/*    (body).                                                              */\n/*                                                                         */\n/*  Copyright 2003 by                                                      */\n/*  Masatake YAMATO and Redhat K.K.                                        */\n/*                                                                         */\n/*  This file may only be used,                                            */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* Development of gxfeatreg.c is supported by                              */\n/* Information-technology Promotion Agency, Japan.                         */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* This file is compiled as a stand-alone executable.                      */\n/* This file is never compiled into `libfreetype2'.                        */\n/* The output of this file is used in `gxvfeat.c'.                         */\n/* ----------------------------------------------------------------------- */\n/* Compile: gcc `pkg-config --cflags freetype2` gxvfgen.c -o gxvfgen       */\n/* Run: ./gxvfgen > tmp.c                                                  */\n/*                                                                         */\n/***************************************************************************/\n\n  /*******************************************************************/\n  /* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING */\n  /*******************************************************************/\n\n  /*\n   * If you add a new setting to a feature, check the number of settings\n   * in the feature.  If the number is greater than the value defined as\n   * FEATREG_MAX_SETTING, update the value.\n   */\n#define FEATREG_MAX_SETTING  12\n\n  /*******************************************************************/\n  /* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING */\n  /*******************************************************************/\n\n\n#include <stdio.h>\n#include <string.h>\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      Data and Types                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#define APPLE_RESERVED         \"Apple Reserved\"\n#define APPLE_RESERVED_LENGTH  14\n\n  typedef struct  GX_Feature_RegistryRec_\n  {\n    const char*  feat_name;\n    char         exclusive;\n    char*        setting_name[FEATREG_MAX_SETTING];\n\n  } GX_Feature_RegistryRec;\n\n\n#define EMPTYFEAT {0, 0, {NULL}}\n\n\n  static GX_Feature_RegistryRec featreg_table[] = {\n    {                                       /* 0 */\n      \"All Typographic Features\",\n      0,\n      {\n        \"All Type Features\",\n        NULL\n      }\n    }, {                                    /* 1 */\n      \"Ligatures\",\n      0,\n      {\n        \"Required Ligatures\",\n        \"Common Ligatures\",\n        \"Rare Ligatures\",\n        \"Logos\",\n        \"Rebus Pictures\",\n        \"Diphthong Ligatures\",\n        \"Squared Ligatures\",\n        \"Squared Ligatures, Abbreviated\",\n        NULL\n      }\n    }, {                                    /* 2 */\n      \"Cursive Connection\",\n      1,\n      {\n        \"Unconnected\",\n        \"Partially Connected\",\n        \"Cursive\",\n        NULL\n      }\n    }, {                                    /* 3 */\n      \"Letter Case\",\n      1,\n      {\n        \"Upper & Lower Case\",\n        \"All Caps\",\n        \"All Lower Case\",\n        \"Small Caps\",\n        \"Initial Caps\",\n        \"Initial Caps & Small Caps\",\n        NULL\n      }\n    }, {                                    /* 4 */\n      \"Vertical Substitution\",\n      0,\n      {\n        /* \"Substitute Vertical Forms\", */\n        \"Turns on the feature\",\n        NULL\n      }\n    }, {                                    /* 5 */\n      \"Linguistic Rearrangement\",\n      0,\n      {\n        /* \"Linguistic Rearrangement\", */\n        \"Turns on the feature\",\n        NULL\n      }\n    }, {                                    /* 6 */\n      \"Number Spacing\",\n      1,\n      {\n        \"Monospaced Numbers\",\n        \"Proportional Numbers\",\n        NULL\n      }\n    }, {                                    /* 7 */\n      APPLE_RESERVED \" 1\",\n      0,\n      {NULL}\n    }, {                                    /* 8 */\n      \"Smart Swashes\",\n      0,\n      {\n        \"Word Initial Swashes\",\n        \"Word Final Swashes\",\n        \"Line Initial Swashes\",\n        \"Line Final Swashes\",\n        \"Non-Final Swashes\",\n        NULL\n      }\n    }, {                                    /* 9 */\n      \"Diacritics\",\n      1,\n      {\n        \"Show Diacritics\",\n        \"Hide Diacritics\",\n        \"Decompose Diacritics\",\n        NULL\n      }\n    }, {                                    /* 10 */\n      \"Vertical Position\",\n      1,\n      {\n        /* \"Normal Position\", */\n        \"No Vertical Position\",\n        \"Superiors\",\n        \"Inferiors\",\n        \"Ordinals\",\n        NULL\n      }\n    }, {                                    /* 11 */\n      \"Fractions\",\n      1,\n      {\n        \"No Fractions\",\n        \"Vertical Fractions\",\n        \"Diagonal Fractions\",\n        NULL\n      }\n    }, {                                    /* 12 */\n      APPLE_RESERVED \" 2\",\n      0,\n      {NULL}\n    }, {                                    /* 13 */\n      \"Overlapping Characters\",\n      0,\n      {\n        /* \"Prevent Overlap\", */\n        \"Turns on the feature\",\n        NULL\n      }\n    }, {                                    /* 14 */\n      \"Typographic Extras\",\n      0,\n      {\n        \"Hyphens to Em Dash\",\n        \"Hyphens to En Dash\",\n        \"Unslashed Zero\",\n        \"Form Interrobang\",\n        \"Smart Quotes\",\n        \"Periods to Ellipsis\",\n        NULL\n      }\n    }, {                                    /* 15 */\n      \"Mathematical Extras\",\n      0,\n      {\n        \"Hyphens to Minus\",\n        \"Asterisk to Multiply\",\n        \"Slash to Divide\",\n        \"Inequality Ligatures\",\n        \"Exponents\",\n        NULL\n      }\n    }, {                                    /* 16 */\n      \"Ornament Sets\",\n      1,\n      {\n        \"No Ornaments\",\n        \"Dingbats\",\n        \"Pi Characters\",\n        \"Fleurons\",\n        \"Decorative Borders\",\n        \"International Symbols\",\n        \"Math Symbols\",\n        NULL\n      }\n    }, {                                    /* 17 */\n      \"Character Alternatives\",\n      1,\n      {\n        \"No Alternates\",\n        /* TODO */\n        NULL\n      }\n    }, {                                    /* 18 */\n      \"Design Complexity\",\n      1,\n      {\n        \"Design Level 1\",\n        \"Design Level 2\",\n        \"Design Level 3\",\n        \"Design Level 4\",\n        \"Design Level 5\",\n        /* TODO */\n        NULL\n      }\n    }, {                                    /* 19 */\n      \"Style Options\",\n      1,\n      {\n        \"No Style Options\",\n        \"Display Text\",\n        \"Engraved Text\",\n        \"Illuminated Caps\",\n        \"Tilling Caps\",\n        \"Tall Caps\",\n        NULL\n      }\n    }, {                                    /* 20 */\n      \"Character Shape\",\n      1,\n      {\n        \"Traditional Characters\",\n        \"Simplified Characters\",\n        \"JIS 1978 Characters\",\n        \"JIS 1983 Characters\",\n        \"JIS 1990 Characters\",\n        \"Traditional Characters, Alternative Set 1\",\n        \"Traditional Characters, Alternative Set 2\",\n        \"Traditional Characters, Alternative Set 3\",\n        \"Traditional Characters, Alternative Set 4\",\n        \"Traditional Characters, Alternative Set 5\",\n        \"Expert Characters\",\n        NULL                           /* count => 12 */\n      }\n    }, {                                    /* 21 */\n      \"Number Case\",\n      1,\n      {\n        \"Lower Case Numbers\",\n        \"Upper Case Numbers\",\n        NULL\n      }\n    }, {                                    /* 22 */\n      \"Text Spacing\",\n      1,\n      {\n        \"Proportional\",\n        \"Monospaced\",\n        \"Half-width\",\n        \"Normal\",\n        NULL\n      }\n    }, /* Here after Newer */  { /* 23 */\n      \"Transliteration\",\n      1,\n      {\n        \"No Transliteration\",\n        \"Hanja To Hangul\",\n        \"Hiragana to Katakana\",\n        \"Katakana to Hiragana\",\n        \"Kana to Romanization\",\n        \"Romanization to Hiragana\",\n        \"Romanization to Katakana\",\n        \"Hanja to Hangul, Alternative Set 1\",\n        \"Hanja to Hangul, Alternative Set 2\",\n        \"Hanja to Hangul, Alternative Set 3\",\n        NULL\n      }\n    }, {                                    /* 24 */\n      \"Annotation\",\n      1,\n      {\n        \"No Annotation\",\n        \"Box Annotation\",\n        \"Rounded Box Annotation\",\n        \"Circle Annotation\",\n        \"Inverted Circle Annotation\",\n        \"Parenthesis Annotation\",\n        \"Period Annotation\",\n        \"Roman Numeral Annotation\",\n        \"Diamond Annotation\",\n        NULL\n      }\n    }, {                                    /* 25 */\n      \"Kana Spacing\",\n      1,\n      {\n        \"Full Width\",\n        \"Proportional\",\n        NULL\n      }\n    }, {                                    /* 26 */\n      \"Ideographic Spacing\",\n      1,\n      {\n        \"Full Width\",\n        \"Proportional\",\n        NULL\n      }\n    }, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT,         /* 27-30 */\n    EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 31-35 */\n    EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 36-40 */\n    EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 40-45 */\n    EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 46-50 */\n    EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 51-55 */\n    EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 56-60 */\n    EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 61-65 */\n    EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 66-70 */\n    EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 71-75 */\n    EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 76-80 */\n    EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 81-85 */\n    EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 86-90 */\n    EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, EMPTYFEAT, /* 91-95 */\n    EMPTYFEAT, EMPTYFEAT, EMPTYFEAT,                       /* 96-98 */\n    EMPTYFEAT, /* 99 */ {                   /* 100 => 22 */\n      \"Text Spacing\",\n      1,\n      {\n        \"Proportional\",\n        \"Monospaced\",\n        \"Half-width\",\n        \"Normal\",\n        NULL\n      }\n    }, {                                    /* 101 => 25 */\n      \"Kana Spacing\",\n      1,\n      {\n        \"Full Width\",\n        \"Proportional\",\n        NULL\n      }\n    }, {                                    /* 102 => 26 */\n      \"Ideographic Spacing\",\n      1,\n      {\n        \"Full Width\",\n        \"Proportional\",\n        NULL\n      }\n    }, {                                    /* 103 */\n      \"CJK Roman Spacing\",\n      1,\n      {\n        \"Half-width\",\n        \"Proportional\",\n        \"Default Roman\",\n        \"Full-width Roman\",\n        NULL\n      }\n    }, {                                    /* 104 => 1 */\n      \"All Typographic Features\",\n      0,\n      {\n        \"All Type Features\",\n        NULL\n      }\n    }\n  };\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         Generator                             *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  int\n  main( void )\n  {\n    int  i;\n\n\n    printf( \"  {\\n\" );\n    printf( \"   /* Generated from %s */\\n\", __FILE__ );\n\n    for ( i = 0;\n          i < sizeof ( featreg_table ) / sizeof ( GX_Feature_RegistryRec );\n          i++ )\n    {\n      const char*  feat_name;\n      int          nSettings;\n\n\n      feat_name = featreg_table[i].feat_name;\n      for ( nSettings = 0;\n            featreg_table[i].setting_name[nSettings];\n            nSettings++)\n        ;                                   /* Do nothing */\n\n      printf( \"    {%1d, %1d, %1d, %2d},   /* %s */\\n\",\n              feat_name ? 1 : 0,\n              ( feat_name                                                  &&\n                ( ft_strncmp( feat_name,\n                              APPLE_RESERVED, APPLE_RESERVED_LENGTH ) == 0 )\n              ) ? 1 : 0,\n              featreg_table[i].exclusive ? 1 : 0,\n              nSettings,\n              feat_name ? feat_name : \"__EMPTY__\" );\n    }\n\n    printf( \"  };\\n\" );\n\n    return 0;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvjust.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvjust.c                                                              */\n/*                                                                         */\n/*    TrueTypeGX/AAT just table validation (body).                         */\n/*                                                                         */\n/*  Copyright 2005, 2014 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"gxvalid.h\"\n#include \"gxvcommn.h\"\n\n#include FT_SFNT_NAMES_H\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gxvjust\n\n  /*\n   * referred `just' table format specification:\n   * http://developer.apple.com/fonts/TTRefMan/RM06/Chap6just.html\n   * last updated 2000.\n   * ----------------------------------------------\n   * [JUST HEADER]: GXV_JUST_HEADER_SIZE\n   * version     (fixed:  32bit) = 0x00010000\n   * format      (uint16: 16bit) = 0 is only defined (2000)\n   * horizOffset (uint16: 16bit)\n   * vertOffset  (uint16: 16bit)\n   * ----------------------------------------------\n   */\n\n  typedef struct  GXV_just_DataRec_\n  {\n    FT_UShort  wdc_offset_max;\n    FT_UShort  wdc_offset_min;\n    FT_UShort  pc_offset_max;\n    FT_UShort  pc_offset_min;\n\n  } GXV_just_DataRec, *GXV_just_Data;\n\n\n#define  GXV_JUST_DATA( a )  GXV_TABLE_DATA( just, a )\n\n\n  /* GX just table does not define their subset of GID */\n  static void\n  gxv_just_check_max_gid( FT_UShort         gid,\n                          const FT_String*  msg_tag,\n                          GXV_Validator     gxvalid )\n  {\n    if ( gid < gxvalid->face->num_glyphs )\n      return;\n\n    GXV_TRACE(( \"just table includes too large %s\"\n                \" GID=%d > %d (in maxp)\\n\",\n                msg_tag, gid, gxvalid->face->num_glyphs ));\n    GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );\n  }\n\n\n  static void\n  gxv_just_wdp_entry_validate( FT_Bytes       table,\n                               FT_Bytes       limit,\n                               GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p = table;\n    FT_ULong   justClass;\n#ifdef GXV_LOAD_UNUSED_VARS\n    FT_Fixed   beforeGrowLimit;\n    FT_Fixed   beforeShrinkGrowLimit;\n    FT_Fixed   afterGrowLimit;\n    FT_Fixed   afterShrinkGrowLimit;\n    FT_UShort  growFlags;\n    FT_UShort  shrinkFlags;\n#endif\n\n\n    GXV_LIMIT_CHECK( 4 + 4 + 4 + 4 + 4 + 2 + 2 );\n    justClass             = FT_NEXT_ULONG( p );\n#ifndef GXV_LOAD_UNUSED_VARS\n    p += 4 + 4 + 4 + 4 + 2 + 2;\n#else\n    beforeGrowLimit       = FT_NEXT_ULONG( p );\n    beforeShrinkGrowLimit = FT_NEXT_ULONG( p );\n    afterGrowLimit        = FT_NEXT_ULONG( p );\n    afterShrinkGrowLimit  = FT_NEXT_ULONG( p );\n    growFlags             = FT_NEXT_USHORT( p );\n    shrinkFlags           = FT_NEXT_USHORT( p );\n#endif\n\n    /* According to Apple spec, only 7bits in justClass is used */\n    if ( ( justClass & 0xFFFFFF80UL ) != 0 )\n    {\n      GXV_TRACE(( \"just table includes non-zero value\"\n                  \" in unused justClass higher bits\"\n                  \" of WidthDeltaPair\" ));\n      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );\n    }\n\n    gxvalid->subtable_length = p - table;\n  }\n\n\n  static void\n  gxv_just_wdc_entry_validate( FT_Bytes       table,\n                               FT_Bytes       limit,\n                               GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n    FT_ULong  count, i;\n\n\n    GXV_LIMIT_CHECK( 4 );\n    count = FT_NEXT_ULONG( p );\n    for ( i = 0; i < count; i++ )\n    {\n      GXV_TRACE(( \"validating wdc pair %d/%d\\n\", i + 1, count ));\n      gxv_just_wdp_entry_validate( p, limit, gxvalid );\n      p += gxvalid->subtable_length;\n    }\n\n    gxvalid->subtable_length = p - table;\n  }\n\n\n  static void\n  gxv_just_widthDeltaClusters_validate( FT_Bytes       table,\n                                        FT_Bytes       limit,\n                                        GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p         = table ;\n    FT_Bytes  wdc_end   = table + GXV_JUST_DATA( wdc_offset_max );\n    FT_UInt   i;\n\n\n    GXV_NAME_ENTER( \"just justDeltaClusters\" );\n\n    if ( limit <= wdc_end )\n      FT_INVALID_OFFSET;\n\n    for ( i = 0; p <= wdc_end; i++ )\n    {\n      gxv_just_wdc_entry_validate( p, limit, gxvalid );\n      p += gxvalid->subtable_length;\n    }\n\n    gxvalid->subtable_length = p - table;\n\n    GXV_EXIT;\n  }\n\n\n  static void\n  gxv_just_actSubrecord_type0_validate( FT_Bytes       table,\n                                        FT_Bytes       limit,\n                                        GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p = table;\n\n    FT_Fixed   lowerLimit;\n    FT_Fixed   upperLimit;\n#ifdef GXV_LOAD_UNUSED_VARS\n    FT_UShort  order;\n#endif\n    FT_UShort  decomposedCount;\n\n    FT_UInt    i;\n\n\n    GXV_LIMIT_CHECK( 4 + 4 + 2 + 2 );\n    lowerLimit      = FT_NEXT_ULONG( p );\n    upperLimit      = FT_NEXT_ULONG( p );\n#ifdef GXV_LOAD_UNUSED_VARS\n    order           = FT_NEXT_USHORT( p );\n#else\n    p += 2;\n#endif\n    decomposedCount = FT_NEXT_USHORT( p );\n\n    if ( lowerLimit >= upperLimit )\n    {\n      GXV_TRACE(( \"just table includes invalid range spec:\"\n                  \" lowerLimit(%d) > upperLimit(%d)\\n\"     ));\n      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );\n    }\n\n    for ( i = 0; i < decomposedCount; i++ )\n    {\n      FT_UShort glyphs;\n\n\n      GXV_LIMIT_CHECK( 2 );\n      glyphs = FT_NEXT_USHORT( p );\n      gxv_just_check_max_gid( glyphs, \"type0:glyphs\", gxvalid );\n    }\n\n    gxvalid->subtable_length = p - table;\n  }\n\n\n  static void\n  gxv_just_actSubrecord_type1_validate( FT_Bytes       table,\n                                        FT_Bytes       limit,\n                                        GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p = table;\n    FT_UShort  addGlyph;\n\n\n    GXV_LIMIT_CHECK( 2 );\n    addGlyph = FT_NEXT_USHORT( p );\n\n    gxv_just_check_max_gid( addGlyph, \"type1:addGlyph\", gxvalid );\n\n    gxvalid->subtable_length = p - table;\n  }\n\n\n  static void\n  gxv_just_actSubrecord_type2_validate( FT_Bytes       table,\n                                        FT_Bytes       limit,\n                                        GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p = table;\n#ifdef GXV_LOAD_UNUSED_VARS\n    FT_Fixed      substThreshhold; /* Apple misspelled \"Threshhold\" */\n#endif\n    FT_UShort  addGlyph;\n    FT_UShort  substGlyph;\n\n\n    GXV_LIMIT_CHECK( 4 + 2 + 2 );\n#ifdef GXV_LOAD_UNUSED_VARS\n    substThreshhold = FT_NEXT_ULONG( p );\n#else\n    p += 4;\n#endif\n    addGlyph        = FT_NEXT_USHORT( p );\n    substGlyph      = FT_NEXT_USHORT( p );\n\n    if ( addGlyph != 0xFFFF )\n      gxv_just_check_max_gid( addGlyph, \"type2:addGlyph\", gxvalid );\n\n    gxv_just_check_max_gid( substGlyph, \"type2:substGlyph\", gxvalid );\n\n    gxvalid->subtable_length = p - table;\n  }\n\n\n  static void\n  gxv_just_actSubrecord_type4_validate( FT_Bytes       table,\n                                        FT_Bytes       limit,\n                                        GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n    FT_ULong  variantsAxis;\n    FT_Fixed  minimumLimit;\n    FT_Fixed  noStretchValue;\n    FT_Fixed  maximumLimit;\n\n\n    GXV_LIMIT_CHECK( 4 + 4 + 4 + 4 );\n    variantsAxis   = FT_NEXT_ULONG( p );\n    minimumLimit   = FT_NEXT_ULONG( p );\n    noStretchValue = FT_NEXT_ULONG( p );\n    maximumLimit   = FT_NEXT_ULONG( p );\n\n    gxvalid->subtable_length = p - table;\n\n    if ( variantsAxis != 0x64756374L ) /* 'duct' */\n      GXV_TRACE(( \"variantsAxis 0x%08x is non default value\",\n                   variantsAxis ));\n\n    if ( minimumLimit > noStretchValue )\n      GXV_TRACE(( \"type4:minimumLimit 0x%08x > noStretchValue 0x%08x\\n\",\n                  minimumLimit, noStretchValue ));\n    else if ( noStretchValue > maximumLimit )\n      GXV_TRACE(( \"type4:noStretchValue 0x%08x > maximumLimit 0x%08x\\n\",\n                  noStretchValue, maximumLimit ));\n    else if ( !IS_PARANOID_VALIDATION )\n      return;\n\n    FT_INVALID_DATA;\n  }\n\n\n  static void\n  gxv_just_actSubrecord_type5_validate( FT_Bytes       table,\n                                        FT_Bytes       limit,\n                                        GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p = table;\n    FT_UShort  flags;\n    FT_UShort  glyph;\n\n\n    GXV_LIMIT_CHECK( 2 + 2 );\n    flags = FT_NEXT_USHORT( p );\n    glyph = FT_NEXT_USHORT( p );\n\n    if ( flags )\n      GXV_TRACE(( \"type5: nonzero value 0x%04x in unused flags\\n\",\n                   flags ));\n    gxv_just_check_max_gid( glyph, \"type5:glyph\", gxvalid );\n\n    gxvalid->subtable_length = p - table;\n  }\n\n\n  /* parse single actSubrecord */\n  static void\n  gxv_just_actSubrecord_validate( FT_Bytes       table,\n                                  FT_Bytes       limit,\n                                  GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p = table;\n    FT_UShort  actionClass;\n    FT_UShort  actionType;\n    FT_ULong   actionLength;\n\n\n    GXV_NAME_ENTER( \"just actSubrecord\" );\n\n    GXV_LIMIT_CHECK( 2 + 2 + 4 );\n    actionClass  = FT_NEXT_USHORT( p );\n    actionType   = FT_NEXT_USHORT( p );\n    actionLength = FT_NEXT_ULONG( p );\n\n    /* actionClass is related with justClass using 7bit only */\n    if ( ( actionClass & 0xFF80 ) != 0 )\n      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );\n\n    if ( actionType == 0 )\n      gxv_just_actSubrecord_type0_validate( p, limit, gxvalid );\n    else if ( actionType == 1 )\n      gxv_just_actSubrecord_type1_validate( p, limit, gxvalid );\n    else if ( actionType == 2 )\n      gxv_just_actSubrecord_type2_validate( p, limit, gxvalid );\n    else if ( actionType == 3 )\n      ;                         /* Stretch glyph action: no actionData */\n    else if ( actionType == 4 )\n      gxv_just_actSubrecord_type4_validate( p, limit, gxvalid );\n    else if ( actionType == 5 )\n      gxv_just_actSubrecord_type5_validate( p, limit, gxvalid );\n    else\n      FT_INVALID_DATA;\n\n    gxvalid->subtable_length = actionLength;\n\n    GXV_EXIT;\n  }\n\n\n  static void\n  gxv_just_pcActionRecord_validate( FT_Bytes       table,\n                                    FT_Bytes       limit,\n                                    GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n    FT_ULong  actionCount;\n    FT_ULong  i;\n\n\n    GXV_LIMIT_CHECK( 4 );\n    actionCount = FT_NEXT_ULONG( p );\n    GXV_TRACE(( \"actionCount = %d\\n\", actionCount ));\n\n    for ( i = 0; i < actionCount; i++ )\n    {\n      gxv_just_actSubrecord_validate( p, limit, gxvalid );\n      p += gxvalid->subtable_length;\n    }\n\n    gxvalid->subtable_length = p - table;\n\n    GXV_EXIT;\n  }\n\n\n  static void\n  gxv_just_pcTable_LookupValue_entry_validate( FT_UShort            glyph,\n                                               GXV_LookupValueCPtr  value_p,\n                                               GXV_Validator        gxvalid )\n  {\n    FT_UNUSED( glyph );\n\n    if ( value_p->u > GXV_JUST_DATA( pc_offset_max ) )\n      GXV_JUST_DATA( pc_offset_max ) = value_p->u;\n    if ( value_p->u < GXV_JUST_DATA( pc_offset_max ) )\n      GXV_JUST_DATA( pc_offset_min ) = value_p->u;\n  }\n\n\n  static void\n  gxv_just_pcLookupTable_validate( FT_Bytes       table,\n                                   FT_Bytes       limit,\n                                   GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n\n    GXV_NAME_ENTER( \"just pcLookupTable\" );\n    GXV_JUST_DATA( pc_offset_max ) = 0x0000;\n    GXV_JUST_DATA( pc_offset_min ) = 0xFFFFU;\n\n    gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;\n    gxvalid->lookupval_func = gxv_just_pcTable_LookupValue_entry_validate;\n\n    gxv_LookupTable_validate( p, limit, gxvalid );\n\n    /* subtable_length is set by gxv_LookupTable_validate() */\n\n    GXV_EXIT;\n  }\n\n\n  static void\n  gxv_just_postcompTable_validate( FT_Bytes       table,\n                                   FT_Bytes       limit,\n                                   GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n\n    GXV_NAME_ENTER( \"just postcompTable\" );\n\n    gxv_just_pcLookupTable_validate( p, limit, gxvalid );\n    p += gxvalid->subtable_length;\n\n    gxv_just_pcActionRecord_validate( p, limit, gxvalid );\n    p += gxvalid->subtable_length;\n\n    gxvalid->subtable_length = p - table;\n\n    GXV_EXIT;\n  }\n\n\n  static void\n  gxv_just_classTable_entry_validate(\n    FT_Byte                         state,\n    FT_UShort                       flags,\n    GXV_StateTable_GlyphOffsetCPtr  glyphOffset_p,\n    FT_Bytes                        table,\n    FT_Bytes                        limit,\n    GXV_Validator                   gxvalid )\n  {\n#ifdef GXV_LOAD_UNUSED_VARS\n    /* TODO: validate markClass & currentClass */\n    FT_UShort  setMark;\n    FT_UShort  dontAdvance;\n    FT_UShort  markClass;\n    FT_UShort  currentClass;\n#endif\n\n    FT_UNUSED( state );\n    FT_UNUSED( glyphOffset_p );\n    FT_UNUSED( table );\n    FT_UNUSED( limit );\n    FT_UNUSED( gxvalid );\n\n#ifndef GXV_LOAD_UNUSED_VARS\n    FT_UNUSED( flags );\n#else\n    setMark      = (FT_UShort)( ( flags >> 15 ) & 1    );\n    dontAdvance  = (FT_UShort)( ( flags >> 14 ) & 1    );\n    markClass    = (FT_UShort)( ( flags >> 7  ) & 0x7F );\n    currentClass = (FT_UShort)(   flags         & 0x7F );\n#endif\n  }\n\n\n  static void\n  gxv_just_justClassTable_validate ( FT_Bytes       table,\n                                     FT_Bytes       limit,\n                                     GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p = table;\n    FT_UShort  length;\n    FT_UShort  coverage;\n    FT_ULong   subFeatureFlags;\n\n\n    GXV_NAME_ENTER( \"just justClassTable\" );\n\n    GXV_LIMIT_CHECK( 2 + 2 + 4 );\n    length          = FT_NEXT_USHORT( p );\n    coverage        = FT_NEXT_USHORT( p );\n    subFeatureFlags = FT_NEXT_ULONG( p );\n\n    GXV_TRACE(( \"  justClassTable: coverage = 0x%04x (%s) \", coverage ));\n    if ( ( coverage & 0x4000 ) == 0  )\n      GXV_TRACE(( \"ascending\\n\" ));\n    else\n      GXV_TRACE(( \"descending\\n\" ));\n\n    if ( subFeatureFlags )\n      GXV_TRACE(( \"  justClassTable: nonzero value (0x%08x)\"\n                  \" in unused subFeatureFlags\\n\", subFeatureFlags ));\n\n    gxvalid->statetable.optdata               = NULL;\n    gxvalid->statetable.optdata_load_func     = NULL;\n    gxvalid->statetable.subtable_setup_func   = NULL;\n    gxvalid->statetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE;\n    gxvalid->statetable.entry_validate_func   =\n      gxv_just_classTable_entry_validate;\n\n    gxv_StateTable_validate( p, table + length, gxvalid );\n\n    /* subtable_length is set by gxv_LookupTable_validate() */\n\n    GXV_EXIT;\n  }\n\n\n  static void\n  gxv_just_wdcTable_LookupValue_validate( FT_UShort            glyph,\n                                          GXV_LookupValueCPtr  value_p,\n                                          GXV_Validator        gxvalid )\n  {\n    FT_UNUSED( glyph );\n\n    if ( value_p->u > GXV_JUST_DATA( wdc_offset_max ) )\n      GXV_JUST_DATA( wdc_offset_max ) = value_p->u;\n    if ( value_p->u < GXV_JUST_DATA( wdc_offset_min ) )\n      GXV_JUST_DATA( wdc_offset_min ) = value_p->u;\n  }\n\n\n  static void\n  gxv_just_justData_lookuptable_validate( FT_Bytes       table,\n                                          FT_Bytes       limit,\n                                          GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n\n    GXV_JUST_DATA( wdc_offset_max ) = 0x0000;\n    GXV_JUST_DATA( wdc_offset_min ) = 0xFFFFU;\n\n    gxvalid->lookupval_sign = GXV_LOOKUPVALUE_UNSIGNED;\n    gxvalid->lookupval_func = gxv_just_wdcTable_LookupValue_validate;\n\n    gxv_LookupTable_validate( p, limit, gxvalid );\n\n    /* subtable_length is set by gxv_LookupTable_validate() */\n\n    GXV_EXIT;\n  }\n\n\n  /*\n   * gxv_just_justData_validate() parses and validates horizData, vertData.\n   */\n  static void\n  gxv_just_justData_validate( FT_Bytes       table,\n                              FT_Bytes       limit,\n                              GXV_Validator  gxvalid )\n  {\n    /*\n     * following 3 offsets are measured from the start of `just'\n     * (which table points to), not justData\n     */\n    FT_UShort  justClassTableOffset;\n    FT_UShort  wdcTableOffset;\n    FT_UShort  pcTableOffset;\n    FT_Bytes   p = table;\n\n    GXV_ODTECT( 4, odtect );\n\n\n    GXV_NAME_ENTER( \"just justData\" );\n\n    GXV_ODTECT_INIT( odtect );\n    GXV_LIMIT_CHECK( 2 + 2 + 2 );\n    justClassTableOffset = FT_NEXT_USHORT( p );\n    wdcTableOffset       = FT_NEXT_USHORT( p );\n    pcTableOffset        = FT_NEXT_USHORT( p );\n\n    GXV_TRACE(( \" (justClassTableOffset = 0x%04x)\\n\", justClassTableOffset ));\n    GXV_TRACE(( \" (wdcTableOffset = 0x%04x)\\n\", wdcTableOffset ));\n    GXV_TRACE(( \" (pcTableOffset = 0x%04x)\\n\", pcTableOffset ));\n\n    gxv_just_justData_lookuptable_validate( p, limit, gxvalid );\n    gxv_odtect_add_range( p, gxvalid->subtable_length,\n                          \"just_LookupTable\", odtect );\n\n    if ( wdcTableOffset )\n    {\n      gxv_just_widthDeltaClusters_validate(\n        gxvalid->root->base + wdcTableOffset, limit, gxvalid );\n      gxv_odtect_add_range( gxvalid->root->base + wdcTableOffset,\n                            gxvalid->subtable_length, \"just_wdcTable\", odtect );\n    }\n\n    if ( pcTableOffset )\n    {\n      gxv_just_postcompTable_validate( gxvalid->root->base + pcTableOffset,\n                                       limit, gxvalid );\n      gxv_odtect_add_range( gxvalid->root->base + pcTableOffset,\n                            gxvalid->subtable_length, \"just_pcTable\", odtect );\n    }\n\n    if ( justClassTableOffset )\n    {\n      gxv_just_justClassTable_validate(\n        gxvalid->root->base + justClassTableOffset, limit, gxvalid );\n      gxv_odtect_add_range( gxvalid->root->base + justClassTableOffset,\n                            gxvalid->subtable_length, \"just_justClassTable\",\n                            odtect );\n    }\n\n    gxv_odtect_validate( odtect, gxvalid );\n\n    GXV_EXIT;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  gxv_just_validate( FT_Bytes      table,\n                     FT_Face       face,\n                     FT_Validator  ftvalid )\n  {\n    FT_Bytes           p     = table;\n    FT_Bytes           limit = 0;\n\n    GXV_ValidatorRec   gxvalidrec;\n    GXV_Validator      gxvalid = &gxvalidrec;\n    GXV_just_DataRec   justrec;\n    GXV_just_Data      just = &justrec;\n\n    FT_ULong           version;\n    FT_UShort          format;\n    FT_UShort          horizOffset;\n    FT_UShort          vertOffset;\n\n    GXV_ODTECT( 3, odtect );\n\n\n    GXV_ODTECT_INIT( odtect );\n\n    gxvalid->root       = ftvalid;\n    gxvalid->table_data = just;\n    gxvalid->face       = face;\n\n    FT_TRACE3(( \"validating `just' table\\n\" ));\n    GXV_INIT;\n\n    limit      = gxvalid->root->limit;\n\n    GXV_LIMIT_CHECK( 4 + 2 + 2 + 2 );\n    version     = FT_NEXT_ULONG( p );\n    format      = FT_NEXT_USHORT( p );\n    horizOffset = FT_NEXT_USHORT( p );\n    vertOffset  = FT_NEXT_USHORT( p );\n    gxv_odtect_add_range( table, p - table, \"just header\", odtect );\n\n\n    /* Version 1.0 (always:2000) */\n    GXV_TRACE(( \" (version = 0x%08x)\\n\", version ));\n    if ( version != 0x00010000UL )\n      FT_INVALID_FORMAT;\n\n    /* format 0 (always:2000) */\n    GXV_TRACE(( \" (format = 0x%04x)\\n\", format ));\n    if ( format != 0x0000 )\n        FT_INVALID_FORMAT;\n\n    GXV_TRACE(( \" (horizOffset = %d)\\n\", horizOffset  ));\n    GXV_TRACE(( \" (vertOffset = %d)\\n\", vertOffset  ));\n\n\n    /* validate justData */\n    if ( 0 < horizOffset )\n    {\n      gxv_just_justData_validate( table + horizOffset, limit, gxvalid );\n      gxv_odtect_add_range( table + horizOffset, gxvalid->subtable_length,\n                            \"horizJustData\", odtect );\n    }\n\n    if ( 0 < vertOffset )\n    {\n      gxv_just_justData_validate( table + vertOffset, limit, gxvalid );\n      gxv_odtect_add_range( table + vertOffset, gxvalid->subtable_length,\n                            \"vertJustData\", odtect );\n    }\n\n    gxv_odtect_validate( odtect, gxvalid );\n\n    FT_TRACE4(( \"\\n\" ));\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvkern.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvkern.c                                                              */\n/*                                                                         */\n/*    TrueTypeGX/AAT kern table validation (body).                         */\n/*                                                                         */\n/*  Copyright 2004-2007, 2013                                              */\n/*  by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"gxvalid.h\"\n#include \"gxvcommn.h\"\n\n#include FT_SFNT_NAMES_H\n#include FT_SERVICE_GX_VALIDATE_H\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gxvkern\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      Data and Types                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef enum  GXV_kern_Version_\n  {\n    KERN_VERSION_CLASSIC = 0x0000,\n    KERN_VERSION_NEW     = 0x0001\n\n  } GXV_kern_Version;\n\n\n  typedef enum GXV_kern_Dialect_\n  {\n    KERN_DIALECT_UNKNOWN = 0,\n    KERN_DIALECT_MS      = FT_VALIDATE_MS,\n    KERN_DIALECT_APPLE   = FT_VALIDATE_APPLE,\n    KERN_DIALECT_ANY     = FT_VALIDATE_CKERN\n\n  } GXV_kern_Dialect;\n\n\n  typedef struct  GXV_kern_DataRec_\n  {\n    GXV_kern_Version  version;\n    void             *subtable_data;\n    GXV_kern_Dialect  dialect_request;\n\n  } GXV_kern_DataRec, *GXV_kern_Data;\n\n\n#define GXV_KERN_DATA( field )  GXV_TABLE_DATA( kern, field )\n\n#define KERN_IS_CLASSIC( gxvalid )                               \\\n          ( KERN_VERSION_CLASSIC == GXV_KERN_DATA( version ) )\n#define KERN_IS_NEW( gxvalid )                                   \\\n          ( KERN_VERSION_NEW     == GXV_KERN_DATA( version ) )\n\n#define KERN_DIALECT( gxvalid )              \\\n          GXV_KERN_DATA( dialect_request )\n#define KERN_ALLOWS_MS( gxvalid )                       \\\n          ( KERN_DIALECT( gxvalid ) & KERN_DIALECT_MS )\n#define KERN_ALLOWS_APPLE( gxvalid )                       \\\n          ( KERN_DIALECT( gxvalid ) & KERN_DIALECT_APPLE )\n\n#define GXV_KERN_HEADER_SIZE           ( KERN_IS_NEW( gxvalid ) ? 8 : 4 )\n#define GXV_KERN_SUBTABLE_HEADER_SIZE  ( KERN_IS_NEW( gxvalid ) ? 8 : 6 )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      SUBTABLE VALIDATORS                      *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* ============================= format 0 ============================== */\n\n  static void\n  gxv_kern_subtable_fmt0_pairs_validate( FT_Bytes       table,\n                                         FT_Bytes       limit,\n                                         FT_UShort      nPairs,\n                                         GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p = table;\n    FT_UShort  i;\n\n    FT_UShort  last_gid_left  = 0;\n    FT_UShort  last_gid_right = 0;\n\n    FT_UNUSED( limit );\n\n\n    GXV_NAME_ENTER( \"kern format 0 pairs\" );\n\n    for ( i = 0; i < nPairs; i++ )\n    {\n      FT_UShort  gid_left;\n      FT_UShort  gid_right;\n#ifdef GXV_LOAD_UNUSED_VARS\n      FT_Short   kernValue;\n#endif\n\n\n      /* left */\n      gid_left  = FT_NEXT_USHORT( p );\n      gxv_glyphid_validate( gid_left, gxvalid );\n\n      /* right */\n      gid_right = FT_NEXT_USHORT( p );\n      gxv_glyphid_validate( gid_right, gxvalid );\n\n      /* Pairs of left and right GIDs must be unique and sorted. */\n      GXV_TRACE(( \"left gid = %u, right gid = %u\\n\", gid_left, gid_right ));\n      if ( gid_left == last_gid_left )\n      {\n        if ( last_gid_right < gid_right )\n          last_gid_right = gid_right;\n        else\n          FT_INVALID_DATA;\n      }\n      else if ( last_gid_left < gid_left )\n      {\n        last_gid_left  = gid_left;\n        last_gid_right = gid_right;\n      }\n      else\n        FT_INVALID_DATA;\n\n      /* skip the kern value */\n#ifdef GXV_LOAD_UNUSED_VARS\n      kernValue = FT_NEXT_SHORT( p );\n#else\n      p += 2;\n#endif\n    }\n\n    GXV_EXIT;\n  }\n\n  static void\n  gxv_kern_subtable_fmt0_validate( FT_Bytes       table,\n                                   FT_Bytes       limit,\n                                   GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p = table + GXV_KERN_SUBTABLE_HEADER_SIZE;\n\n    FT_UShort  nPairs;\n    FT_UShort  unitSize;\n\n\n    GXV_NAME_ENTER( \"kern subtable format 0\" );\n\n    unitSize = 2 + 2 + 2;\n    nPairs   = 0;\n\n    /* nPairs, searchRange, entrySelector, rangeShift */\n    GXV_LIMIT_CHECK( 2 + 2 + 2 + 2 );\n    gxv_BinSrchHeader_validate( p, limit, &unitSize, &nPairs, gxvalid );\n    p += 2 + 2 + 2 + 2;\n\n    gxv_kern_subtable_fmt0_pairs_validate( p, limit, nPairs, gxvalid );\n\n    GXV_EXIT;\n  }\n\n\n  /* ============================= format 1 ============================== */\n\n\n  typedef struct  GXV_kern_fmt1_StateOptRec_\n  {\n    FT_UShort  valueTable;\n    FT_UShort  valueTable_length;\n\n  } GXV_kern_fmt1_StateOptRec, *GXV_kern_fmt1_StateOptRecData;\n\n\n  static void\n  gxv_kern_subtable_fmt1_valueTable_load( FT_Bytes       table,\n                                          FT_Bytes       limit,\n                                          GXV_Validator  gxvalid )\n  {\n    FT_Bytes                       p = table;\n    GXV_kern_fmt1_StateOptRecData  optdata =\n      (GXV_kern_fmt1_StateOptRecData)gxvalid->statetable.optdata;\n\n\n    GXV_LIMIT_CHECK( 2 );\n    optdata->valueTable = FT_NEXT_USHORT( p );\n  }\n\n\n  /*\n   * passed tables_size covers whole StateTable, including kern fmt1 header\n   */\n  static void\n  gxv_kern_subtable_fmt1_subtable_setup( FT_UShort      table_size,\n                                         FT_UShort      classTable,\n                                         FT_UShort      stateArray,\n                                         FT_UShort      entryTable,\n                                         FT_UShort*     classTable_length_p,\n                                         FT_UShort*     stateArray_length_p,\n                                         FT_UShort*     entryTable_length_p,\n                                         GXV_Validator  gxvalid )\n  {\n    FT_UShort  o[4];\n    FT_UShort  *l[4];\n    FT_UShort  buff[5];\n\n    GXV_kern_fmt1_StateOptRecData  optdata =\n      (GXV_kern_fmt1_StateOptRecData)gxvalid->statetable.optdata;\n\n\n    o[0] = classTable;\n    o[1] = stateArray;\n    o[2] = entryTable;\n    o[3] = optdata->valueTable;\n    l[0] = classTable_length_p;\n    l[1] = stateArray_length_p;\n    l[2] = entryTable_length_p;\n    l[3] = &(optdata->valueTable_length);\n\n    gxv_set_length_by_ushort_offset( o, l, buff, 4, table_size, gxvalid );\n  }\n\n\n  /*\n   * passed table & limit are of whole StateTable, not including subtables\n   */\n  static void\n  gxv_kern_subtable_fmt1_entry_validate(\n    FT_Byte                         state,\n    FT_UShort                       flags,\n    GXV_StateTable_GlyphOffsetCPtr  glyphOffset_p,\n    FT_Bytes                        table,\n    FT_Bytes                        limit,\n    GXV_Validator                   gxvalid )\n  {\n#ifdef GXV_LOAD_UNUSED_VARS\n    FT_UShort  push;\n    FT_UShort  dontAdvance;\n#endif\n    FT_UShort  valueOffset;\n#ifdef GXV_LOAD_UNUSED_VARS\n    FT_UShort  kernAction;\n    FT_UShort  kernValue;\n#endif\n\n    FT_UNUSED( state );\n    FT_UNUSED( glyphOffset_p );\n\n\n#ifdef GXV_LOAD_UNUSED_VARS\n    push        = (FT_UShort)( ( flags >> 15 ) & 1      );\n    dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1      );\n#endif\n    valueOffset = (FT_UShort)(   flags         & 0x3FFF );\n\n    {\n      GXV_kern_fmt1_StateOptRecData  vt_rec =\n        (GXV_kern_fmt1_StateOptRecData)gxvalid->statetable.optdata;\n      FT_Bytes  p;\n\n\n      if ( valueOffset < vt_rec->valueTable )\n        FT_INVALID_OFFSET;\n\n      p     = table + valueOffset;\n      limit = table + vt_rec->valueTable + vt_rec->valueTable_length;\n\n      GXV_LIMIT_CHECK( 2 + 2 );\n#ifdef GXV_LOAD_UNUSED_VARS\n      kernAction = FT_NEXT_USHORT( p );\n      kernValue  = FT_NEXT_USHORT( p );\n#endif\n    }\n  }\n\n\n  static void\n  gxv_kern_subtable_fmt1_validate( FT_Bytes       table,\n                                   FT_Bytes       limit,\n                                   GXV_Validator  gxvalid )\n  {\n    FT_Bytes                   p = table;\n    GXV_kern_fmt1_StateOptRec  vt_rec;\n\n\n    GXV_NAME_ENTER( \"kern subtable format 1\" );\n\n    gxvalid->statetable.optdata =\n      &vt_rec;\n    gxvalid->statetable.optdata_load_func =\n      gxv_kern_subtable_fmt1_valueTable_load;\n    gxvalid->statetable.subtable_setup_func =\n      gxv_kern_subtable_fmt1_subtable_setup;\n    gxvalid->statetable.entry_glyphoffset_fmt =\n      GXV_GLYPHOFFSET_NONE;\n    gxvalid->statetable.entry_validate_func =\n      gxv_kern_subtable_fmt1_entry_validate;\n\n    gxv_StateTable_validate( p, limit, gxvalid );\n\n    GXV_EXIT;\n  }\n\n\n  /* ================ Data for Class-Based Subtables 2, 3 ================ */\n\n  typedef enum  GXV_kern_ClassSpec_\n  {\n    GXV_KERN_CLS_L = 0,\n    GXV_KERN_CLS_R\n\n  } GXV_kern_ClassSpec;\n\n\n  /* ============================= format 2 ============================== */\n\n  /* ---------------------- format 2 specific data ----------------------- */\n\n  typedef struct  GXV_kern_subtable_fmt2_DataRec_\n  {\n    FT_UShort         rowWidth;\n    FT_UShort         array;\n    FT_UShort         offset_min[2];\n    FT_UShort         offset_max[2];\n    const FT_String*  class_tag[2];\n    GXV_odtect_Range  odtect;\n\n  } GXV_kern_subtable_fmt2_DataRec, *GXV_kern_subtable_fmt2_Data;\n\n\n#define GXV_KERN_FMT2_DATA( field )                         \\\n        ( ( (GXV_kern_subtable_fmt2_DataRec *)              \\\n              ( GXV_KERN_DATA( subtable_data ) ) )->field )\n\n\n  /* -------------------------- utility functions ----------------------- */\n\n  static void\n  gxv_kern_subtable_fmt2_clstbl_validate( FT_Bytes            table,\n                                          FT_Bytes            limit,\n                                          GXV_kern_ClassSpec  spec,\n                                          GXV_Validator       gxvalid )\n  {\n    const FT_String*  tag    = GXV_KERN_FMT2_DATA( class_tag[spec] );\n    GXV_odtect_Range  odtect = GXV_KERN_FMT2_DATA( odtect );\n\n    FT_Bytes   p = table;\n    FT_UShort  firstGlyph;\n    FT_UShort  nGlyphs;\n\n\n    GXV_NAME_ENTER( \"kern format 2 classTable\" );\n\n    GXV_LIMIT_CHECK( 2 + 2 );\n    firstGlyph = FT_NEXT_USHORT( p );\n    nGlyphs    = FT_NEXT_USHORT( p );\n    GXV_TRACE(( \" %s firstGlyph=%d, nGlyphs=%d\\n\",\n                tag, firstGlyph, nGlyphs ));\n\n    gxv_glyphid_validate( firstGlyph, gxvalid );\n    gxv_glyphid_validate( (FT_UShort)( firstGlyph + nGlyphs - 1 ), gxvalid );\n\n    gxv_array_getlimits_ushort( p, p + ( 2 * nGlyphs ),\n                                &( GXV_KERN_FMT2_DATA( offset_min[spec] ) ),\n                                &( GXV_KERN_FMT2_DATA( offset_max[spec] ) ),\n                                gxvalid );\n\n    gxv_odtect_add_range( table, 2 * nGlyphs, tag, odtect );\n\n    GXV_EXIT;\n  }\n\n\n  static void\n  gxv_kern_subtable_fmt2_validate( FT_Bytes       table,\n                                   FT_Bytes       limit,\n                                   GXV_Validator  gxvalid )\n  {\n    GXV_ODTECT( 3, odtect );\n    GXV_kern_subtable_fmt2_DataRec  fmt2_rec =\n      { 0, 0, { 0, 0 }, { 0, 0 }, { \"leftClass\", \"rightClass\" }, NULL };\n\n    FT_Bytes   p = table + GXV_KERN_SUBTABLE_HEADER_SIZE;\n    FT_UShort  leftOffsetTable;\n    FT_UShort  rightOffsetTable;\n\n\n    GXV_NAME_ENTER( \"kern subtable format 2\" );\n\n    GXV_ODTECT_INIT( odtect );\n    fmt2_rec.odtect = odtect;\n    GXV_KERN_DATA( subtable_data ) = &fmt2_rec;\n\n    GXV_LIMIT_CHECK( 2 + 2 + 2 + 2 );\n    GXV_KERN_FMT2_DATA( rowWidth ) = FT_NEXT_USHORT( p );\n    leftOffsetTable                = FT_NEXT_USHORT( p );\n    rightOffsetTable               = FT_NEXT_USHORT( p );\n    GXV_KERN_FMT2_DATA( array )    = FT_NEXT_USHORT( p );\n\n    GXV_TRACE(( \"rowWidth = %d\\n\", GXV_KERN_FMT2_DATA( rowWidth ) ));\n\n\n    GXV_LIMIT_CHECK( leftOffsetTable );\n    GXV_LIMIT_CHECK( rightOffsetTable );\n    GXV_LIMIT_CHECK( GXV_KERN_FMT2_DATA( array ) );\n\n    gxv_kern_subtable_fmt2_clstbl_validate( table + leftOffsetTable, limit,\n                                            GXV_KERN_CLS_L, gxvalid );\n\n    gxv_kern_subtable_fmt2_clstbl_validate( table + rightOffsetTable, limit,\n                                            GXV_KERN_CLS_R, gxvalid );\n\n    if ( GXV_KERN_FMT2_DATA( offset_min[GXV_KERN_CLS_L] ) +\n           GXV_KERN_FMT2_DATA( offset_min[GXV_KERN_CLS_R] )\n         < GXV_KERN_FMT2_DATA( array )                      )\n      FT_INVALID_OFFSET;\n\n    gxv_odtect_add_range( table + GXV_KERN_FMT2_DATA( array ),\n                          GXV_KERN_FMT2_DATA( offset_max[GXV_KERN_CLS_L] )\n                            + GXV_KERN_FMT2_DATA( offset_max[GXV_KERN_CLS_R] )\n                            - GXV_KERN_FMT2_DATA( array ),\n                          \"array\", odtect );\n\n    gxv_odtect_validate( odtect, gxvalid );\n\n    GXV_EXIT;\n  }\n\n\n  /* ============================= format 3 ============================== */\n\n  static void\n  gxv_kern_subtable_fmt3_validate( FT_Bytes       table,\n                                   FT_Bytes       limit,\n                                   GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p = table + GXV_KERN_SUBTABLE_HEADER_SIZE;\n    FT_UShort  glyphCount;\n    FT_Byte    kernValueCount;\n    FT_Byte    leftClassCount;\n    FT_Byte    rightClassCount;\n    FT_Byte    flags;\n\n\n    GXV_NAME_ENTER( \"kern subtable format 3\" );\n\n    GXV_LIMIT_CHECK( 2 + 1 + 1 + 1 + 1 );\n    glyphCount      = FT_NEXT_USHORT( p );\n    kernValueCount  = FT_NEXT_BYTE( p );\n    leftClassCount  = FT_NEXT_BYTE( p );\n    rightClassCount = FT_NEXT_BYTE( p );\n    flags           = FT_NEXT_BYTE( p );\n\n    if ( gxvalid->face->num_glyphs != glyphCount )\n    {\n      GXV_TRACE(( \"maxGID=%d, but glyphCount=%d\\n\",\n                  gxvalid->face->num_glyphs, glyphCount ));\n      GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );\n    }\n\n    if ( flags != 0 )\n      GXV_TRACE(( \"kern subtable fmt3 has nonzero value\"\n                  \" (%d) in unused flag\\n\", flags ));\n    /*\n     * just skip kernValue[kernValueCount]\n     */\n    GXV_LIMIT_CHECK( 2 * kernValueCount );\n    p += 2 * kernValueCount;\n\n    /*\n     * check leftClass[gid] < leftClassCount\n     */\n    {\n      FT_Byte  min, max;\n\n\n      GXV_LIMIT_CHECK( glyphCount );\n      gxv_array_getlimits_byte( p, p + glyphCount, &min, &max, gxvalid );\n      p += gxvalid->subtable_length;\n\n      if ( leftClassCount < max )\n        FT_INVALID_DATA;\n    }\n\n    /*\n     * check rightClass[gid] < rightClassCount\n     */\n    {\n      FT_Byte  min, max;\n\n\n      GXV_LIMIT_CHECK( glyphCount );\n      gxv_array_getlimits_byte( p, p + glyphCount, &min, &max, gxvalid );\n      p += gxvalid->subtable_length;\n\n      if ( rightClassCount < max )\n        FT_INVALID_DATA;\n    }\n\n    /*\n     * check kernIndex[i, j] < kernValueCount\n     */\n    {\n      FT_UShort  i, j;\n\n\n      for ( i = 0; i < leftClassCount; i++ )\n      {\n        for ( j = 0; j < rightClassCount; j++ )\n        {\n          GXV_LIMIT_CHECK( 1 );\n          if ( kernValueCount < FT_NEXT_BYTE( p ) )\n            FT_INVALID_OFFSET;\n        }\n      }\n    }\n\n    gxvalid->subtable_length = p - table;\n\n    GXV_EXIT;\n  }\n\n\n  static FT_Bool\n  gxv_kern_coverage_new_apple_validate( FT_UShort      coverage,\n                                        FT_UShort*     format,\n                                        GXV_Validator  gxvalid )\n  {\n    /* new Apple-dialect */\n#ifdef GXV_LOAD_TRACE_VARS\n    FT_Bool  kernVertical;\n    FT_Bool  kernCrossStream;\n    FT_Bool  kernVariation;\n#endif\n\n    FT_UNUSED( gxvalid );\n\n\n    /* reserved bits = 0 */\n    if ( coverage & 0x1FFC )\n      return FALSE;\n\n#ifdef GXV_LOAD_TRACE_VARS\n    kernVertical    = FT_BOOL( ( coverage >> 15 ) & 1 );\n    kernCrossStream = FT_BOOL( ( coverage >> 14 ) & 1 );\n    kernVariation   = FT_BOOL( ( coverage >> 13 ) & 1 );\n#endif\n\n    *format = (FT_UShort)( coverage & 0x0003 );\n\n    GXV_TRACE(( \"new Apple-dialect: \"\n                \"horizontal=%d, cross-stream=%d, variation=%d, format=%d\\n\",\n                 !kernVertical, kernCrossStream, kernVariation, *format ));\n\n    GXV_TRACE(( \"kerning values in Apple format subtable are ignored\\n\" ));\n\n    return TRUE;\n  }\n\n\n  static FT_Bool\n  gxv_kern_coverage_classic_apple_validate( FT_UShort      coverage,\n                                            FT_UShort*     format,\n                                            GXV_Validator  gxvalid )\n  {\n    /* classic Apple-dialect */\n#ifdef GXV_LOAD_TRACE_VARS\n    FT_Bool  horizontal;\n    FT_Bool  cross_stream;\n#endif\n\n\n    /* check expected flags, but don't check if MS-dialect is impossible */\n    if ( !( coverage & 0xFD00 ) && KERN_ALLOWS_MS( gxvalid ) )\n      return FALSE;\n\n    /* reserved bits = 0 */\n    if ( coverage & 0x02FC )\n      return FALSE;\n\n#ifdef GXV_LOAD_TRACE_VARS\n    horizontal   = FT_BOOL( ( coverage >> 15 ) & 1 );\n    cross_stream = FT_BOOL( ( coverage >> 13 ) & 1 );\n#endif\n\n    *format = (FT_UShort)( coverage & 0x0003 );\n\n    GXV_TRACE(( \"classic Apple-dialect: \"\n                \"horizontal=%d, cross-stream=%d, format=%d\\n\",\n                 horizontal, cross_stream, *format ));\n\n    /* format 1 requires GX State Machine, too new for classic */\n    if ( *format == 1 )\n      return FALSE;\n\n    GXV_TRACE(( \"kerning values in Apple format subtable are ignored\\n\" ));\n\n    return TRUE;\n  }\n\n\n  static FT_Bool\n  gxv_kern_coverage_classic_microsoft_validate( FT_UShort      coverage,\n                                                FT_UShort*     format,\n                                                GXV_Validator  gxvalid )\n  {\n    /* classic Microsoft-dialect */\n#ifdef GXV_LOAD_TRACE_VARS\n    FT_Bool  horizontal;\n    FT_Bool  minimum;\n    FT_Bool  cross_stream;\n    FT_Bool  override;\n#endif\n\n    FT_UNUSED( gxvalid );\n\n\n    /* reserved bits = 0 */\n    if ( coverage & 0xFDF0 )\n      return FALSE;\n\n#ifdef GXV_LOAD_TRACE_VARS\n    horizontal   = FT_BOOL(   coverage        & 1 );\n    minimum      = FT_BOOL( ( coverage >> 1 ) & 1 );\n    cross_stream = FT_BOOL( ( coverage >> 2 ) & 1 );\n    override     = FT_BOOL( ( coverage >> 3 ) & 1 );\n#endif\n\n    *format = (FT_UShort)( ( coverage >> 8 ) & 0x0003 );\n\n    GXV_TRACE(( \"classic Microsoft-dialect: \"\n                \"horizontal=%d, minimum=%d, cross-stream=%d, \"\n                \"override=%d, format=%d\\n\",\n                horizontal, minimum, cross_stream, override, *format ));\n\n    if ( *format == 2 )\n      GXV_TRACE((\n        \"kerning values in Microsoft format 2 subtable are ignored\\n\" ));\n\n    return TRUE;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                            MAIN                               *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static GXV_kern_Dialect\n  gxv_kern_coverage_validate( FT_UShort      coverage,\n                              FT_UShort*     format,\n                              GXV_Validator  gxvalid )\n  {\n    GXV_kern_Dialect  result = KERN_DIALECT_UNKNOWN;\n\n\n    GXV_NAME_ENTER( \"validating coverage\" );\n\n    GXV_TRACE(( \"interprete coverage 0x%04x by Apple style\\n\", coverage ));\n\n    if ( KERN_IS_NEW( gxvalid ) )\n    {\n      if ( gxv_kern_coverage_new_apple_validate( coverage,\n                                                 format,\n                                                 gxvalid ) )\n      {\n        result = KERN_DIALECT_APPLE;\n        goto Exit;\n      }\n    }\n\n    if ( KERN_IS_CLASSIC( gxvalid ) && KERN_ALLOWS_APPLE( gxvalid ) )\n    {\n      if ( gxv_kern_coverage_classic_apple_validate( coverage,\n                                                     format,\n                                                     gxvalid ) )\n      {\n        result = KERN_DIALECT_APPLE;\n        goto Exit;\n      }\n    }\n\n    if ( KERN_IS_CLASSIC( gxvalid ) && KERN_ALLOWS_MS( gxvalid ) )\n    {\n      if ( gxv_kern_coverage_classic_microsoft_validate( coverage,\n                                                         format,\n                                                         gxvalid ) )\n      {\n        result = KERN_DIALECT_MS;\n        goto Exit;\n      }\n    }\n\n    GXV_TRACE(( \"cannot interprete coverage, broken kern subtable\\n\" ));\n\n  Exit:\n    GXV_EXIT;\n    return result;\n  }\n\n\n  static void\n  gxv_kern_subtable_validate( FT_Bytes       table,\n                              FT_Bytes       limit,\n                              GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p = table;\n#ifdef GXV_LOAD_TRACE_VARS\n    FT_UShort  version = 0;    /* MS only: subtable version, unused */\n#endif\n    FT_ULong   length;         /* MS: 16bit, Apple: 32bit*/\n    FT_UShort  coverage;\n#ifdef GXV_LOAD_TRACE_VARS\n    FT_UShort  tupleIndex = 0; /* Apple only */\n#endif\n    FT_UShort  u16[2];\n    FT_UShort  format = 255;   /* subtable format */\n\n\n    GXV_NAME_ENTER( \"kern subtable\" );\n\n    GXV_LIMIT_CHECK( 2 + 2 + 2 );\n    u16[0]   = FT_NEXT_USHORT( p ); /* Apple: length_hi MS: version */\n    u16[1]   = FT_NEXT_USHORT( p ); /* Apple: length_lo MS: length */\n    coverage = FT_NEXT_USHORT( p );\n\n    switch ( gxv_kern_coverage_validate( coverage, &format, gxvalid ) )\n    {\n    case KERN_DIALECT_MS:\n#ifdef GXV_LOAD_TRACE_VARS\n      version    = u16[0];\n#endif\n      length     = u16[1];\n#ifdef GXV_LOAD_TRACE_VARS\n      tupleIndex = 0;\n#endif\n      GXV_TRACE(( \"Subtable version = %d\\n\", version ));\n      GXV_TRACE(( \"Subtable length = %d\\n\", length ));\n      break;\n\n    case KERN_DIALECT_APPLE:\n#ifdef GXV_LOAD_TRACE_VARS\n      version    = 0;\n#endif\n      length     = ( u16[0] << 16 ) + u16[1];\n#ifdef GXV_LOAD_TRACE_VARS\n      tupleIndex = 0;\n#endif\n      GXV_TRACE(( \"Subtable length = %d\\n\", length ));\n\n      if ( KERN_IS_NEW( gxvalid ) )\n      {\n        GXV_LIMIT_CHECK( 2 );\n#ifdef GXV_LOAD_TRACE_VARS\n        tupleIndex = FT_NEXT_USHORT( p );\n#else\n        p += 2;\n#endif\n        GXV_TRACE(( \"Subtable tupleIndex = %d\\n\", tupleIndex ));\n      }\n      break;\n\n    default:\n      length = u16[1];\n      GXV_TRACE(( \"cannot detect subtable dialect, \"\n                  \"just skip %d byte\\n\", length ));\n      goto Exit;\n    }\n\n    /* formats 1, 2, 3 require the position of the start of this subtable */\n    if ( format == 0 )\n      gxv_kern_subtable_fmt0_validate( table, table + length, gxvalid );\n    else if ( format == 1 )\n      gxv_kern_subtable_fmt1_validate( table, table + length, gxvalid );\n    else if ( format == 2 )\n      gxv_kern_subtable_fmt2_validate( table, table + length, gxvalid );\n    else if ( format == 3 )\n      gxv_kern_subtable_fmt3_validate( table, table + length, gxvalid );\n    else\n      FT_INVALID_DATA;\n\n  Exit:\n    gxvalid->subtable_length = length;\n    GXV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         kern TABLE                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static void\n  gxv_kern_validate_generic( FT_Bytes          table,\n                             FT_Face           face,\n                             FT_Bool           classic_only,\n                             GXV_kern_Dialect  dialect_request,\n                             FT_Validator      ftvalid )\n  {\n    GXV_ValidatorRec   gxvalidrec;\n    GXV_Validator      gxvalid = &gxvalidrec;\n\n    GXV_kern_DataRec   kernrec;\n    GXV_kern_Data      kern = &kernrec;\n\n    FT_Bytes           p     = table;\n    FT_Bytes           limit = 0;\n\n    FT_ULong           nTables = 0;\n    FT_UInt            i;\n\n\n    gxvalid->root       = ftvalid;\n    gxvalid->table_data = kern;\n    gxvalid->face       = face;\n\n    FT_TRACE3(( \"validating `kern' table\\n\" ));\n    GXV_INIT;\n    KERN_DIALECT( gxvalid ) = dialect_request;\n\n    GXV_LIMIT_CHECK( 2 );\n    GXV_KERN_DATA( version ) = (GXV_kern_Version)FT_NEXT_USHORT( p );\n    GXV_TRACE(( \"version 0x%04x (higher 16bit)\\n\",\n                GXV_KERN_DATA( version ) ));\n\n    if ( 0x0001 < GXV_KERN_DATA( version ) )\n      FT_INVALID_FORMAT;\n    else if ( KERN_IS_CLASSIC( gxvalid ) )\n    {\n      GXV_LIMIT_CHECK( 2 );\n      nTables = FT_NEXT_USHORT( p );\n    }\n    else if ( KERN_IS_NEW( gxvalid ) )\n    {\n      if ( classic_only )\n        FT_INVALID_FORMAT;\n\n      if ( 0x0000 != FT_NEXT_USHORT( p ) )\n        FT_INVALID_FORMAT;\n\n      GXV_LIMIT_CHECK( 4 );\n      nTables = FT_NEXT_ULONG( p );\n    }\n\n    for ( i = 0; i < nTables; i++ )\n    {\n      GXV_TRACE(( \"validating subtable %d/%d\\n\", i, nTables ));\n      /* p should be 32bit-aligned? */\n      gxv_kern_subtable_validate( p, 0, gxvalid );\n      p += gxvalid->subtable_length;\n    }\n\n    FT_TRACE4(( \"\\n\" ));\n  }\n\n\n  FT_LOCAL_DEF( void )\n  gxv_kern_validate( FT_Bytes      table,\n                     FT_Face       face,\n                     FT_Validator  ftvalid )\n  {\n    gxv_kern_validate_generic( table, face, 0, KERN_DIALECT_ANY, ftvalid );\n  }\n\n\n  FT_LOCAL_DEF( void )\n  gxv_kern_validate_classic( FT_Bytes      table,\n                             FT_Face       face,\n                             FT_Int        dialect_flags,\n                             FT_Validator  ftvalid )\n  {\n    GXV_kern_Dialect  dialect_request;\n\n\n    dialect_request = (GXV_kern_Dialect)dialect_flags;\n    gxv_kern_validate_generic( table, face, 1, dialect_request, ftvalid );\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvlcar.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvlcar.c                                                              */\n/*                                                                         */\n/*    TrueTypeGX/AAT lcar table validation (body).                         */\n/*                                                                         */\n/*  Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"gxvalid.h\"\n#include \"gxvcommn.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gxvlcar\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      Data and Types                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct  GXV_lcar_DataRec_\n  {\n    FT_UShort  format;\n\n  } GXV_lcar_DataRec, *GXV_lcar_Data;\n\n\n#define GXV_LCAR_DATA( FIELD )  GXV_TABLE_DATA( lcar, FIELD )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      UTILITY FUNCTIONS                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static void\n  gxv_lcar_partial_validate( FT_UShort      partial,\n                             FT_UShort      glyph,\n                             GXV_Validator  gxvalid )\n  {\n    GXV_NAME_ENTER( \"partial\" );\n\n    if ( GXV_LCAR_DATA( format ) != 1 )\n      goto Exit;\n\n    gxv_ctlPoint_validate( glyph, partial, gxvalid );\n\n  Exit:\n    GXV_EXIT;\n  }\n\n\n  static void\n  gxv_lcar_LookupValue_validate( FT_UShort            glyph,\n                                 GXV_LookupValueCPtr  value_p,\n                                 GXV_Validator        gxvalid )\n  {\n    FT_Bytes   p     = gxvalid->root->base + value_p->u;\n    FT_Bytes   limit = gxvalid->root->limit;\n    FT_UShort  count;\n    FT_Short   partial;\n    FT_UShort  i;\n\n\n    GXV_NAME_ENTER( \"element in lookupTable\" );\n\n    GXV_LIMIT_CHECK( 2 );\n    count = FT_NEXT_USHORT( p );\n\n    GXV_LIMIT_CHECK( 2 * count );\n    for ( i = 0; i < count; i++ )\n    {\n      partial = FT_NEXT_SHORT( p );\n      gxv_lcar_partial_validate( partial, glyph, gxvalid );\n    }\n\n    GXV_EXIT;\n  }\n\n\n  /*\n    +------ lcar --------------------+\n    |                                |\n    |      +===============+         |\n    |      | looup header  |         |\n    |      +===============+         |\n    |      | BinSrchHeader |         |\n    |      +===============+         |\n    |      | lastGlyph[0]  |         |\n    |      +---------------+         |\n    |      | firstGlyph[0] |         |  head of lcar sfnt table\n    |      +---------------+         |             +\n    |      | offset[0]     |    ->   |          offset            [byte]\n    |      +===============+         |             +\n    |      | lastGlyph[1]  |         | (glyphID - firstGlyph) * 2 [byte]\n    |      +---------------+         |\n    |      | firstGlyph[1] |         |\n    |      +---------------+         |\n    |      | offset[1]     |         |\n    |      +===============+         |\n    |                                |\n    |       ....                     |\n    |                                |\n    |      16bit value array         |\n    |      +===============+         |\n    +------|     value     | <-------+\n    |       ....\n    |\n    |\n    |\n    |\n    |\n    +---->  lcar values...handled by lcar callback function\n  */\n\n  static GXV_LookupValueDesc\n  gxv_lcar_LookupFmt4_transit( FT_UShort            relative_gindex,\n                               GXV_LookupValueCPtr  base_value_p,\n                               FT_Bytes             lookuptbl_limit,\n                               GXV_Validator        gxvalid )\n  {\n    FT_Bytes             p;\n    FT_Bytes             limit;\n    FT_UShort            offset;\n    GXV_LookupValueDesc  value;\n\n    FT_UNUSED( lookuptbl_limit );\n\n    /* XXX: check range? */\n    offset = (FT_UShort)( base_value_p->u +\n                          relative_gindex * sizeof ( FT_UShort ) );\n    p      = gxvalid->root->base + offset;\n    limit  = gxvalid->root->limit;\n\n    GXV_LIMIT_CHECK ( 2 );\n    value.u = FT_NEXT_USHORT( p );\n\n    return value;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                          lcar TABLE                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL_DEF( void )\n  gxv_lcar_validate( FT_Bytes      table,\n                     FT_Face       face,\n                     FT_Validator  ftvalid )\n  {\n    FT_Bytes          p     = table;\n    FT_Bytes          limit = 0;\n    GXV_ValidatorRec  gxvalidrec;\n    GXV_Validator     gxvalid = &gxvalidrec;\n\n    GXV_lcar_DataRec  lcarrec;\n    GXV_lcar_Data     lcar = &lcarrec;\n\n    FT_Fixed          version;\n\n\n    gxvalid->root       = ftvalid;\n    gxvalid->table_data = lcar;\n    gxvalid->face       = face;\n\n    FT_TRACE3(( \"validating `lcar' table\\n\" ));\n    GXV_INIT;\n\n    GXV_LIMIT_CHECK( 4 + 2 );\n    version = FT_NEXT_ULONG( p );\n    GXV_LCAR_DATA( format ) = FT_NEXT_USHORT( p );\n\n    if ( version != 0x00010000UL)\n      FT_INVALID_FORMAT;\n\n    if ( GXV_LCAR_DATA( format ) > 1 )\n      FT_INVALID_FORMAT;\n\n    gxvalid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;\n    gxvalid->lookupval_func   = gxv_lcar_LookupValue_validate;\n    gxvalid->lookupfmt4_trans = gxv_lcar_LookupFmt4_transit;\n    gxv_LookupTable_validate( p, limit, gxvalid );\n\n    FT_TRACE4(( \"\\n\" ));\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvmod.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvmod.c                                                               */\n/*                                                                         */\n/*    FreeType's TrueTypeGX/AAT validation module implementation (body).   */\n/*                                                                         */\n/*  Copyright 2004-2006, 2013                                              */\n/*  by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_TRUETYPE_TABLES_H\n#include FT_TRUETYPE_TAGS_H\n#include FT_GX_VALIDATE_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_SERVICE_GX_VALIDATE_H\n\n#include \"gxvmod.h\"\n#include \"gxvalid.h\"\n#include \"gxvcommn.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gxvmodule\n\n\n  static FT_Error\n  gxv_load_table( FT_Face             face,\n                  FT_Tag              tag,\n                  FT_Byte* volatile*  table,\n                  FT_ULong*           table_len )\n  {\n    FT_Error   error;\n    FT_Memory  memory = FT_FACE_MEMORY( face );\n\n\n    error = FT_Load_Sfnt_Table( face, tag, 0, NULL, table_len );\n    if ( FT_ERR_EQ( error, Table_Missing ) )\n      return FT_Err_Ok;\n    if ( error )\n      goto Exit;\n\n    if ( FT_ALLOC( *table, *table_len ) )\n      goto Exit;\n\n    error = FT_Load_Sfnt_Table( face, tag, 0, *table, table_len );\n\n  Exit:\n    return error;\n  }\n\n\n#define GXV_TABLE_DECL( _sfnt )                     \\\n          FT_Byte* volatile  _sfnt          = NULL; \\\n          FT_ULong            len_ ## _sfnt = 0\n\n#define GXV_TABLE_LOAD( _sfnt )                                     \\\n          if ( ( FT_VALIDATE_ ## _sfnt ## _INDEX < table_count ) && \\\n               ( gx_flags & FT_VALIDATE_ ## _sfnt )            )    \\\n          {                                                         \\\n            error = gxv_load_table( face, TTAG_ ## _sfnt,           \\\n                                    &_sfnt, &len_ ## _sfnt );       \\\n            if ( error )                                            \\\n              goto Exit;                                            \\\n          }\n\n#define GXV_TABLE_VALIDATE( _sfnt )                                  \\\n          if ( _sfnt )                                               \\\n          {                                                          \\\n            ft_validator_init( &valid, _sfnt, _sfnt + len_ ## _sfnt, \\\n                               FT_VALIDATE_DEFAULT );                \\\n            if ( ft_setjmp( valid.jump_buffer ) == 0 )               \\\n              gxv_ ## _sfnt ## _validate( _sfnt, face, &valid );     \\\n            error = valid.error;                                     \\\n            if ( error )                                             \\\n              goto Exit;                                             \\\n          }\n\n#define GXV_TABLE_SET( _sfnt )                                        \\\n          if ( FT_VALIDATE_ ## _sfnt ## _INDEX < table_count )        \\\n            tables[FT_VALIDATE_ ## _sfnt ## _INDEX] = (FT_Bytes)_sfnt\n\n\n  static FT_Error\n  gxv_validate( FT_Face   face,\n                FT_UInt   gx_flags,\n                FT_Bytes  tables[FT_VALIDATE_GX_LENGTH],\n                FT_UInt   table_count )\n  {\n    FT_Memory volatile        memory = FT_FACE_MEMORY( face );\n\n    FT_Error                  error = FT_Err_Ok;\n    FT_ValidatorRec volatile  valid;\n\n    FT_UInt  i;\n\n\n    GXV_TABLE_DECL( feat );\n    GXV_TABLE_DECL( bsln );\n    GXV_TABLE_DECL( trak );\n    GXV_TABLE_DECL( just );\n    GXV_TABLE_DECL( mort );\n    GXV_TABLE_DECL( morx );\n    GXV_TABLE_DECL( kern );\n    GXV_TABLE_DECL( opbd );\n    GXV_TABLE_DECL( prop );\n    GXV_TABLE_DECL( lcar );\n\n    for ( i = 0; i < table_count; i++ )\n      tables[i] = 0;\n\n    /* load tables */\n    GXV_TABLE_LOAD( feat );\n    GXV_TABLE_LOAD( bsln );\n    GXV_TABLE_LOAD( trak );\n    GXV_TABLE_LOAD( just );\n    GXV_TABLE_LOAD( mort );\n    GXV_TABLE_LOAD( morx );\n    GXV_TABLE_LOAD( kern );\n    GXV_TABLE_LOAD( opbd );\n    GXV_TABLE_LOAD( prop );\n    GXV_TABLE_LOAD( lcar );\n\n    /* validate tables */\n    GXV_TABLE_VALIDATE( feat );\n    GXV_TABLE_VALIDATE( bsln );\n    GXV_TABLE_VALIDATE( trak );\n    GXV_TABLE_VALIDATE( just );\n    GXV_TABLE_VALIDATE( mort );\n    GXV_TABLE_VALIDATE( morx );\n    GXV_TABLE_VALIDATE( kern );\n    GXV_TABLE_VALIDATE( opbd );\n    GXV_TABLE_VALIDATE( prop );\n    GXV_TABLE_VALIDATE( lcar );\n\n    /* Set results */\n    GXV_TABLE_SET( feat );\n    GXV_TABLE_SET( mort );\n    GXV_TABLE_SET( morx );\n    GXV_TABLE_SET( bsln );\n    GXV_TABLE_SET( just );\n    GXV_TABLE_SET( kern );\n    GXV_TABLE_SET( opbd );\n    GXV_TABLE_SET( trak );\n    GXV_TABLE_SET( prop );\n    GXV_TABLE_SET( lcar );\n\n  Exit:\n    if ( error )\n    {\n      FT_FREE( feat );\n      FT_FREE( bsln );\n      FT_FREE( trak );\n      FT_FREE( just );\n      FT_FREE( mort );\n      FT_FREE( morx );\n      FT_FREE( kern );\n      FT_FREE( opbd );\n      FT_FREE( prop );\n      FT_FREE( lcar );\n    }\n\n    return error;\n  }\n\n\n  static FT_Error\n  classic_kern_validate( FT_Face    face,\n                         FT_UInt    ckern_flags,\n                         FT_Bytes*  ckern_table )\n  {\n    FT_Memory volatile        memory = FT_FACE_MEMORY( face );\n\n    FT_Byte* volatile         ckern     = NULL;\n    FT_ULong                  len_ckern = 0;\n\n    /* without volatile on `error' GCC 4.1.1. emits:                         */\n    /*  warning: variable 'error' might be clobbered by 'longjmp' or 'vfork' */\n    /* this warning seems spurious but ---                                   */\n    FT_Error volatile         error;\n    FT_ValidatorRec volatile  valid;\n\n\n    *ckern_table = NULL;\n\n    error = gxv_load_table( face, TTAG_kern, &ckern, &len_ckern );\n    if ( error )\n      goto Exit;\n\n    if ( ckern )\n    {\n      ft_validator_init( &valid, ckern, ckern + len_ckern,\n                         FT_VALIDATE_DEFAULT );\n      if ( ft_setjmp( valid.jump_buffer ) == 0 )\n        gxv_kern_validate_classic( ckern, face,\n                                   ckern_flags & FT_VALIDATE_CKERN, &valid );\n      error = valid.error;\n      if ( error )\n        goto Exit;\n    }\n\n    *ckern_table = ckern;\n\n  Exit:\n    if ( error )\n      FT_FREE( ckern );\n\n    return error;\n  }\n\n\n  static\n  const FT_Service_GXvalidateRec  gxvalid_interface =\n  {\n    gxv_validate\n  };\n\n\n  static\n  const FT_Service_CKERNvalidateRec  ckernvalid_interface =\n  {\n    classic_kern_validate\n  };\n\n\n  static\n  const FT_ServiceDescRec  gxvalid_services[] =\n  {\n    { FT_SERVICE_ID_GX_VALIDATE,          &gxvalid_interface },\n    { FT_SERVICE_ID_CLASSICKERN_VALIDATE, &ckernvalid_interface },\n    { NULL, NULL }\n  };\n\n\n  static FT_Pointer\n  gxvalid_get_service( FT_Module    module,\n                       const char*  service_id )\n  {\n    FT_UNUSED( module );\n\n    return ft_service_list_lookup( gxvalid_services, service_id );\n  }\n\n\n  FT_CALLBACK_TABLE_DEF\n  const FT_Module_Class  gxv_module_class =\n  {\n    0,\n    sizeof ( FT_ModuleRec ),\n    \"gxvalid\",\n    0x10000L,\n    0x20000L,\n\n    0,              /* module-specific interface */\n\n    (FT_Module_Constructor)0,\n    (FT_Module_Destructor) 0,\n    (FT_Module_Requester)  gxvalid_get_service\n  };\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvmod.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvmod.h                                                               */\n/*                                                                         */\n/*    FreeType's TrueTypeGX/AAT validation module implementation           */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __GXVMOD_H__\n#define __GXVMOD_H__\n\n#include <ft2build.h>\n#include FT_MODULE_H\n\n\nFT_BEGIN_HEADER\n\n#ifdef FT_CONFIG_OPTION_PIC\n#error \"this module does not support PIC yet\"\n#endif\n\n\n  FT_EXPORT_VAR( const FT_Module_Class )  gxv_module_class;\n\n\nFT_END_HEADER\n\n#endif /* __GXVMOD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvmort.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvmort.c                                                              */\n/*                                                                         */\n/*    TrueTypeGX/AAT mort table validation (body).                         */\n/*                                                                         */\n/*  Copyright 2005, 2013 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"gxvmort.h\"\n#include \"gxvfeat.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gxvmort\n\n\n  static void\n  gxv_mort_feature_validate( GXV_mort_feature  f,\n                             GXV_Validator     gxvalid )\n  {\n    if ( f->featureType >= gxv_feat_registry_length )\n    {\n      GXV_TRACE(( \"featureType %d is out of registered range, \"\n                  \"setting %d is unchecked\\n\",\n                  f->featureType, f->featureSetting ));\n      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );\n    }\n    else if ( !gxv_feat_registry[f->featureType].existence )\n    {\n      GXV_TRACE(( \"featureType %d is within registered area \"\n                  \"but undefined, setting %d is unchecked\\n\",\n                  f->featureType, f->featureSetting ));\n      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );\n    }\n    else\n    {\n      FT_Byte  nSettings_max;\n\n\n      /* nSettings in gxvfeat.c is halved for exclusive on/off settings */\n      nSettings_max = gxv_feat_registry[f->featureType].nSettings;\n      if ( gxv_feat_registry[f->featureType].exclusive )\n        nSettings_max = (FT_Byte)( 2 * nSettings_max );\n\n      GXV_TRACE(( \"featureType %d is registered\", f->featureType ));\n      GXV_TRACE(( \"setting %d\", f->featureSetting ));\n\n      if ( f->featureSetting > nSettings_max )\n      {\n        GXV_TRACE(( \"out of defined range %d\", nSettings_max ));\n        GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );\n      }\n      GXV_TRACE(( \"\\n\" ));\n    }\n\n    /* TODO: enableFlags must be unique value in specified chain?  */\n  }\n\n\n  /*\n   * nFeatureFlags is typed to FT_ULong to accept that in\n   * mort (typed FT_UShort) and morx (typed FT_ULong).\n   */\n  FT_LOCAL_DEF( void )\n  gxv_mort_featurearray_validate( FT_Bytes       table,\n                                  FT_Bytes       limit,\n                                  FT_ULong       nFeatureFlags,\n                                  GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n    FT_ULong  i;\n\n    GXV_mort_featureRec  f = GXV_MORT_FEATURE_OFF;\n\n\n    GXV_NAME_ENTER( \"mort feature list\" );\n    for ( i = 0; i < nFeatureFlags; i++ )\n    {\n      GXV_LIMIT_CHECK( 2 + 2 + 4 + 4 );\n      f.featureType    = FT_NEXT_USHORT( p );\n      f.featureSetting = FT_NEXT_USHORT( p );\n      f.enableFlags    = FT_NEXT_ULONG( p );\n      f.disableFlags   = FT_NEXT_ULONG( p );\n\n      gxv_mort_feature_validate( &f, gxvalid );\n    }\n\n    if ( !IS_GXV_MORT_FEATURE_OFF( f ) )\n      FT_INVALID_DATA;\n\n    gxvalid->subtable_length = p - table;\n    GXV_EXIT;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  gxv_mort_coverage_validate( FT_UShort      coverage,\n                              GXV_Validator  gxvalid )\n  {\n    FT_UNUSED( gxvalid );\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n    if ( coverage & 0x8000U )\n      GXV_TRACE(( \" this subtable is for vertical text only\\n\" ));\n    else\n      GXV_TRACE(( \" this subtable is for horizontal text only\\n\" ));\n\n    if ( coverage & 0x4000 )\n      GXV_TRACE(( \" this subtable is applied to glyph array \"\n                  \"in descending order\\n\" ));\n    else\n      GXV_TRACE(( \" this subtable is applied to glyph array \"\n                  \"in ascending order\\n\" ));\n\n    if ( coverage & 0x2000 )\n      GXV_TRACE(( \" this subtable is forcibly applied to \"\n                  \"vertical/horizontal text\\n\" ));\n\n    if ( coverage & 0x1FF8 )\n      GXV_TRACE(( \" coverage has non-zero bits in reserved area\\n\" ));\n#endif\n  }\n\n\n  static void\n  gxv_mort_subtables_validate( FT_Bytes       table,\n                               FT_Bytes       limit,\n                               FT_UShort      nSubtables,\n                               GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n    GXV_Validate_Func fmt_funcs_table[] =\n    {\n      gxv_mort_subtable_type0_validate, /* 0 */\n      gxv_mort_subtable_type1_validate, /* 1 */\n      gxv_mort_subtable_type2_validate, /* 2 */\n      NULL,                             /* 3 */\n      gxv_mort_subtable_type4_validate, /* 4 */\n      gxv_mort_subtable_type5_validate, /* 5 */\n\n    };\n\n    FT_UShort  i;\n\n\n    GXV_NAME_ENTER( \"subtables in a chain\" );\n\n    for ( i = 0; i < nSubtables; i++ )\n    {\n      GXV_Validate_Func  func;\n\n      FT_UShort  length;\n      FT_UShort  coverage;\n#ifdef GXV_LOAD_UNUSED_VARS\n      FT_ULong   subFeatureFlags;\n#endif\n      FT_UInt    type;\n      FT_UInt    rest;\n\n\n      GXV_LIMIT_CHECK( 2 + 2 + 4 );\n      length          = FT_NEXT_USHORT( p );\n      coverage        = FT_NEXT_USHORT( p );\n#ifdef GXV_LOAD_UNUSED_VARS\n      subFeatureFlags = FT_NEXT_ULONG( p );\n#else\n      p += 4;\n#endif\n\n      GXV_TRACE(( \"validating chain subtable %d/%d (%d bytes)\\n\",\n                  i + 1, nSubtables, length ));\n      type = coverage & 0x0007;\n      rest = length - ( 2 + 2 + 4 );\n\n      GXV_LIMIT_CHECK( rest );\n      gxv_mort_coverage_validate( coverage, gxvalid );\n\n      if ( type > 5 )\n        FT_INVALID_FORMAT;\n\n      func = fmt_funcs_table[type];\n      if ( func == NULL )\n        GXV_TRACE(( \"morx type %d is reserved\\n\", type ));\n\n      func( p, p + rest, gxvalid );\n\n      p += rest;\n      /* TODO: validate subFeatureFlags */\n    }\n\n    gxvalid->subtable_length = p - table;\n\n    GXV_EXIT;\n  }\n\n\n  static void\n  gxv_mort_chain_validate( FT_Bytes       table,\n                           FT_Bytes       limit,\n                           GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p = table;\n#ifdef GXV_LOAD_UNUSED_VARS\n    FT_ULong   defaultFlags;\n#endif\n    FT_ULong   chainLength;\n    FT_UShort  nFeatureFlags;\n    FT_UShort  nSubtables;\n\n\n    GXV_NAME_ENTER( \"mort chain header\" );\n\n    GXV_LIMIT_CHECK( 4 + 4 + 2 + 2 );\n#ifdef GXV_LOAD_UNUSED_VARS\n    defaultFlags  = FT_NEXT_ULONG( p );\n#else\n    p += 4;\n#endif\n    chainLength   = FT_NEXT_ULONG( p );\n    nFeatureFlags = FT_NEXT_USHORT( p );\n    nSubtables    = FT_NEXT_USHORT( p );\n\n    gxv_mort_featurearray_validate( p, table + chainLength,\n                                    nFeatureFlags, gxvalid );\n    p += gxvalid->subtable_length;\n    gxv_mort_subtables_validate( p, table + chainLength, nSubtables, gxvalid );\n    gxvalid->subtable_length = chainLength;\n\n    /* TODO: validate defaultFlags */\n    GXV_EXIT;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  gxv_mort_validate( FT_Bytes      table,\n                     FT_Face       face,\n                     FT_Validator  ftvalid )\n  {\n    GXV_ValidatorRec  gxvalidrec;\n    GXV_Validator     gxvalid = &gxvalidrec;\n    FT_Bytes          p     = table;\n    FT_Bytes          limit = 0;\n    FT_ULong          version;\n    FT_ULong          nChains;\n    FT_ULong          i;\n\n\n    gxvalid->root = ftvalid;\n    gxvalid->face = face;\n    limit         = gxvalid->root->limit;\n\n    FT_TRACE3(( \"validating `mort' table\\n\" ));\n    GXV_INIT;\n\n    GXV_LIMIT_CHECK( 4 + 4 );\n    version = FT_NEXT_ULONG( p );\n    nChains = FT_NEXT_ULONG( p );\n\n    if (version != 0x00010000UL)\n      FT_INVALID_FORMAT;\n\n    for ( i = 0; i < nChains; i++ )\n    {\n      GXV_TRACE(( \"validating chain %d/%d\\n\", i + 1, nChains ));\n      GXV_32BIT_ALIGNMENT_VALIDATE( p - table );\n      gxv_mort_chain_validate( p, limit, gxvalid );\n      p += gxvalid->subtable_length;\n    }\n\n    FT_TRACE4(( \"\\n\" ));\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvmort.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvmort.h                                                              */\n/*                                                                         */\n/*    TrueTypeGX/AAT common definition for mort table (specification).     */\n/*                                                                         */\n/*  Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __GXVMORT_H__\n#define __GXVMORT_H__\n\n#include \"gxvalid.h\"\n#include \"gxvcommn.h\"\n\n#include FT_SFNT_NAMES_H\n\n\n  typedef struct  GXV_mort_featureRec_\n  {\n    FT_UShort  featureType;\n    FT_UShort  featureSetting;\n    FT_ULong   enableFlags;\n    FT_ULong   disableFlags;\n\n  } GXV_mort_featureRec, *GXV_mort_feature;\n\n#define GXV_MORT_FEATURE_OFF  {0, 1, 0x00000000UL, 0x00000000UL}\n\n#define IS_GXV_MORT_FEATURE_OFF( f )              \\\n          ( (f).featureType    == 0            || \\\n            (f).featureSetting == 1            || \\\n            (f).enableFlags    == 0x00000000UL || \\\n            (f).disableFlags   == 0x00000000UL )\n\n\n  FT_LOCAL( void )\n  gxv_mort_featurearray_validate( FT_Bytes       table,\n                                  FT_Bytes       limit,\n                                  FT_ULong       nFeatureFlags,\n                                  GXV_Validator  gxvalid );\n\n  FT_LOCAL( void )\n  gxv_mort_coverage_validate( FT_UShort      coverage,\n                              GXV_Validator  gxvalid );\n\n  FT_LOCAL( void )\n  gxv_mort_subtable_type0_validate( FT_Bytes       table,\n                                    FT_Bytes       limit,\n                                    GXV_Validator  gxvalid );\n\n  FT_LOCAL( void )\n  gxv_mort_subtable_type1_validate( FT_Bytes       table,\n                                    FT_Bytes       limit,\n                                    GXV_Validator  gxvalid );\n\n  FT_LOCAL( void )\n  gxv_mort_subtable_type2_validate( FT_Bytes       table,\n                                    FT_Bytes       limit,\n                                    GXV_Validator  gxvalid );\n\n  FT_LOCAL( void )\n  gxv_mort_subtable_type4_validate( FT_Bytes       table,\n                                    FT_Bytes       limit,\n                                    GXV_Validator  gxvalid );\n\n  FT_LOCAL( void )\n  gxv_mort_subtable_type5_validate( FT_Bytes       table,\n                                    FT_Bytes       limit,\n                                    GXV_Validator  gxvalid );\n\n\n#endif /* __GXVMORT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvmort0.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvmort0.c                                                             */\n/*                                                                         */\n/*    TrueTypeGX/AAT mort table validation                                 */\n/*    body for type0 (Indic Script Rearrangement) subtable.                */\n/*                                                                         */\n/*  Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,       */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"gxvmort.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gxvmort\n\n\n  static const char* GXV_Mort_IndicScript_Msg[] =\n  {\n    \"no change\",\n    \"Ax => xA\",\n    \"xD => Dx\",\n    \"AxD => DxA\",\n    \"ABx => xAB\",\n    \"ABx => xBA\",\n    \"xCD => CDx\",\n    \"xCD => DCx\",\n    \"AxCD => CDxA\",\n    \"AxCD => DCxA\",\n    \"ABxD => DxAB\",\n    \"ABxD => DxBA\",\n    \"ABxCD => CDxAB\",\n    \"ABxCD => CDxBA\",\n    \"ABxCD => DCxAB\",\n    \"ABxCD => DCxBA\",\n\n  };\n\n\n  static void\n  gxv_mort_subtable_type0_entry_validate(\n    FT_Byte                         state,\n    FT_UShort                       flags,\n    GXV_StateTable_GlyphOffsetCPtr  glyphOffset_p,\n    FT_Bytes                        table,\n    FT_Bytes                        limit,\n    GXV_Validator                   gxvalid )\n  {\n    FT_UShort  markFirst;\n    FT_UShort  dontAdvance;\n    FT_UShort  markLast;\n    FT_UShort  reserved;\n    FT_UShort  verb = 0;\n\n    FT_UNUSED( state );\n    FT_UNUSED( table );\n    FT_UNUSED( limit );\n\n    FT_UNUSED( GXV_Mort_IndicScript_Msg[verb] ); /* for the non-debugging */\n    FT_UNUSED( glyphOffset_p );                  /* case                  */\n\n\n    markFirst   = (FT_UShort)( ( flags >> 15 ) & 1 );\n    dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 );\n    markLast    = (FT_UShort)( ( flags >> 13 ) & 1 );\n\n    reserved = (FT_UShort)( flags & 0x1FF0 );\n    verb     = (FT_UShort)( flags & 0x000F );\n\n    GXV_TRACE(( \"  IndicScript MorphRule for glyphOffset 0x%04x\",\n                glyphOffset_p->u ));\n    GXV_TRACE(( \" markFirst=%01d\", markFirst ));\n    GXV_TRACE(( \" dontAdvance=%01d\", dontAdvance ));\n    GXV_TRACE(( \" markLast=%01d\", markLast ));\n    GXV_TRACE(( \" %02d\", verb ));\n    GXV_TRACE(( \" %s\\n\", GXV_Mort_IndicScript_Msg[verb] ));\n\n    if ( markFirst > 0 && markLast > 0 )\n    {\n      GXV_TRACE(( \"  [odd] a glyph is marked as the first and last\"\n                  \"  in Indic rearrangement\\n\" ));\n      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );\n    }\n\n    if ( markFirst > 0 && dontAdvance > 0 )\n    {\n      GXV_TRACE(( \"  [odd] the first glyph is marked as dontAdvance\"\n                  \" in Indic rearrangement\\n\" ));\n      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );\n    }\n\n    if ( 0 < reserved )\n    {\n      GXV_TRACE(( \" non-zero bits found in reserved range\\n\" ));\n      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );\n    }\n    else\n      GXV_TRACE(( \"\\n\" ));\n  }\n\n\n  FT_LOCAL_DEF( void )\n  gxv_mort_subtable_type0_validate( FT_Bytes       table,\n                                    FT_Bytes       limit,\n                                    GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n\n    GXV_NAME_ENTER(\n      \"mort chain subtable type0 (Indic-Script Rearrangement)\" );\n\n    GXV_LIMIT_CHECK( GXV_STATETABLE_HEADER_SIZE );\n\n    gxvalid->statetable.optdata               = NULL;\n    gxvalid->statetable.optdata_load_func     = NULL;\n    gxvalid->statetable.subtable_setup_func   = NULL;\n    gxvalid->statetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE;\n    gxvalid->statetable.entry_validate_func =\n      gxv_mort_subtable_type0_entry_validate;\n\n    gxv_StateTable_validate( p, limit, gxvalid );\n\n    GXV_EXIT;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvmort1.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvmort1.c                                                             */\n/*                                                                         */\n/*    TrueTypeGX/AAT mort table validation                                 */\n/*    body for type1 (Contextual Substitution) subtable.                   */\n/*                                                                         */\n/*  Copyright 2005, 2007 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"gxvmort.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gxvmort\n\n\n  typedef struct  GXV_mort_subtable_type1_StateOptRec_\n  {\n    FT_UShort  substitutionTable;\n    FT_UShort  substitutionTable_length;\n\n  }  GXV_mort_subtable_type1_StateOptRec,\n    *GXV_mort_subtable_type1_StateOptRecData;\n\n#define GXV_MORT_SUBTABLE_TYPE1_HEADER_SIZE \\\n          ( GXV_STATETABLE_HEADER_SIZE + 2 )\n\n\n  static void\n  gxv_mort_subtable_type1_substitutionTable_load( FT_Bytes       table,\n                                                  FT_Bytes       limit,\n                                                  GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n    GXV_mort_subtable_type1_StateOptRecData  optdata =\n      (GXV_mort_subtable_type1_StateOptRecData)gxvalid->statetable.optdata;\n\n\n    GXV_LIMIT_CHECK( 2 );\n    optdata->substitutionTable = FT_NEXT_USHORT( p );\n  }\n\n\n  static void\n  gxv_mort_subtable_type1_subtable_setup( FT_UShort      table_size,\n                                          FT_UShort      classTable,\n                                          FT_UShort      stateArray,\n                                          FT_UShort      entryTable,\n                                          FT_UShort*     classTable_length_p,\n                                          FT_UShort*     stateArray_length_p,\n                                          FT_UShort*     entryTable_length_p,\n                                          GXV_Validator  gxvalid )\n  {\n    FT_UShort  o[4];\n    FT_UShort  *l[4];\n    FT_UShort  buff[5];\n\n    GXV_mort_subtable_type1_StateOptRecData  optdata =\n      (GXV_mort_subtable_type1_StateOptRecData)gxvalid->statetable.optdata;\n\n\n    o[0] = classTable;\n    o[1] = stateArray;\n    o[2] = entryTable;\n    o[3] = optdata->substitutionTable;\n    l[0] = classTable_length_p;\n    l[1] = stateArray_length_p;\n    l[2] = entryTable_length_p;\n    l[3] = &( optdata->substitutionTable_length );\n\n    gxv_set_length_by_ushort_offset( o, l, buff, 4, table_size, gxvalid );\n  }\n\n\n  static void\n  gxv_mort_subtable_type1_offset_to_subst_validate(\n    FT_Short          wordOffset,\n    const FT_String*  tag,\n    FT_Byte           state,\n    GXV_Validator     gxvalid )\n  {\n    FT_UShort  substTable;\n    FT_UShort  substTable_limit;\n\n    FT_UNUSED( tag );\n    FT_UNUSED( state );\n\n\n    substTable =\n      ((GXV_mort_subtable_type1_StateOptRec *)\n       (gxvalid->statetable.optdata))->substitutionTable;\n    substTable_limit =\n      (FT_UShort)( substTable +\n                   ((GXV_mort_subtable_type1_StateOptRec *)\n                    (gxvalid->statetable.optdata))->substitutionTable_length );\n\n    gxvalid->min_gid = (FT_UShort)( ( substTable       - wordOffset * 2 ) / 2 );\n    gxvalid->max_gid = (FT_UShort)( ( substTable_limit - wordOffset * 2 ) / 2 );\n    gxvalid->max_gid = (FT_UShort)( FT_MAX( gxvalid->max_gid,\n                                            gxvalid->face->num_glyphs ) );\n\n    /* XXX: check range? */\n\n    /* TODO: min_gid & max_gid comparison with ClassTable contents */\n  }\n\n\n  static void\n  gxv_mort_subtable_type1_entry_validate(\n    FT_Byte                         state,\n    FT_UShort                       flags,\n    GXV_StateTable_GlyphOffsetCPtr  glyphOffset_p,\n    FT_Bytes                        table,\n    FT_Bytes                        limit,\n    GXV_Validator                   gxvalid )\n  {\n#ifdef GXV_LOAD_UNUSED_VARS\n    FT_UShort  setMark;\n    FT_UShort  dontAdvance;\n#endif\n    FT_UShort  reserved;\n    FT_Short   markOffset;\n    FT_Short   currentOffset;\n\n    FT_UNUSED( table );\n    FT_UNUSED( limit );\n\n\n#ifdef GXV_LOAD_UNUSED_VARS\n    setMark       = (FT_UShort)(   flags >> 15            );\n    dontAdvance   = (FT_UShort)( ( flags >> 14 ) & 1      );\n#endif\n    reserved      = (FT_Short)(    flags         & 0x3FFF );\n\n    markOffset    = (FT_Short)( glyphOffset_p->ul >> 16 );\n    currentOffset = (FT_Short)( glyphOffset_p->ul       );\n\n    if ( 0 < reserved )\n    {\n      GXV_TRACE(( \" non-zero bits found in reserved range\\n\" ));\n      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );\n    }\n\n    gxv_mort_subtable_type1_offset_to_subst_validate( markOffset,\n                                                      \"markOffset\",\n                                                      state,\n                                                      gxvalid );\n\n    gxv_mort_subtable_type1_offset_to_subst_validate( currentOffset,\n                                                      \"currentOffset\",\n                                                      state,\n                                                      gxvalid );\n  }\n\n\n  static void\n  gxv_mort_subtable_type1_substTable_validate( FT_Bytes       table,\n                                               FT_Bytes       limit,\n                                               GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p = table;\n    FT_UShort  num_gids = (FT_UShort)(\n                 ((GXV_mort_subtable_type1_StateOptRec *)\n                  (gxvalid->statetable.optdata))->substitutionTable_length / 2 );\n    FT_UShort  i;\n\n\n    GXV_NAME_ENTER( \"validating contents of substitutionTable\" );\n    for ( i = 0; i < num_gids ; i ++ )\n    {\n      FT_UShort  dst_gid;\n\n\n      GXV_LIMIT_CHECK( 2 );\n      dst_gid = FT_NEXT_USHORT( p );\n\n      if ( dst_gid >= 0xFFFFU )\n        continue;\n\n      if ( dst_gid < gxvalid->min_gid || gxvalid->max_gid < dst_gid )\n      {\n        GXV_TRACE(( \"substTable include a strange gid[%d]=%d >\"\n                    \" out of define range (%d..%d)\\n\",\n                    i, dst_gid, gxvalid->min_gid, gxvalid->max_gid ));\n        GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );\n      }\n    }\n\n    GXV_EXIT;\n  }\n\n\n  /*\n   * subtable for Contextual glyph substitution is a modified StateTable.\n   * In addition to classTable, stateArray, and entryTable, the field\n   * `substitutionTable' is added.\n   */\n  FT_LOCAL_DEF( void )\n  gxv_mort_subtable_type1_validate( FT_Bytes       table,\n                                    FT_Bytes       limit,\n                                    GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n    GXV_mort_subtable_type1_StateOptRec  st_rec;\n\n\n    GXV_NAME_ENTER( \"mort chain subtable type1 (Contextual Glyph Subst)\" );\n\n    GXV_LIMIT_CHECK( GXV_MORT_SUBTABLE_TYPE1_HEADER_SIZE );\n\n    gxvalid->statetable.optdata =\n      &st_rec;\n    gxvalid->statetable.optdata_load_func =\n      gxv_mort_subtable_type1_substitutionTable_load;\n    gxvalid->statetable.subtable_setup_func =\n      gxv_mort_subtable_type1_subtable_setup;\n    gxvalid->statetable.entry_glyphoffset_fmt =\n      GXV_GLYPHOFFSET_ULONG;\n    gxvalid->statetable.entry_validate_func =\n\n      gxv_mort_subtable_type1_entry_validate;\n    gxv_StateTable_validate( p, limit, gxvalid );\n\n    gxv_mort_subtable_type1_substTable_validate(\n      table + st_rec.substitutionTable,\n      table + st_rec.substitutionTable + st_rec.substitutionTable_length,\n      gxvalid );\n\n    GXV_EXIT;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvmort2.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvmort2.c                                                             */\n/*                                                                         */\n/*    TrueTypeGX/AAT mort table validation                                 */\n/*    body for type2 (Ligature Substitution) subtable.                     */\n/*                                                                         */\n/*  Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,       */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"gxvmort.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gxvmort\n\n\n  typedef struct  GXV_mort_subtable_type2_StateOptRec_\n  {\n    FT_UShort  ligActionTable;\n    FT_UShort  componentTable;\n    FT_UShort  ligatureTable;\n    FT_UShort  ligActionTable_length;\n    FT_UShort  componentTable_length;\n    FT_UShort  ligatureTable_length;\n\n  }  GXV_mort_subtable_type2_StateOptRec,\n    *GXV_mort_subtable_type2_StateOptRecData;\n\n#define GXV_MORT_SUBTABLE_TYPE2_HEADER_SIZE \\\n          ( GXV_STATETABLE_HEADER_SIZE + 2 + 2 + 2 )\n\n\n  static void\n  gxv_mort_subtable_type2_opttable_load( FT_Bytes       table,\n                                         FT_Bytes       limit,\n                                         GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n    GXV_mort_subtable_type2_StateOptRecData  optdata =\n      (GXV_mort_subtable_type2_StateOptRecData)gxvalid->statetable.optdata;\n\n\n    GXV_LIMIT_CHECK( 2 + 2 + 2 );\n    optdata->ligActionTable = FT_NEXT_USHORT( p );\n    optdata->componentTable = FT_NEXT_USHORT( p );\n    optdata->ligatureTable  = FT_NEXT_USHORT( p );\n\n    GXV_TRACE(( \"offset to ligActionTable=0x%04x\\n\",\n                optdata->ligActionTable ));\n    GXV_TRACE(( \"offset to componentTable=0x%04x\\n\",\n                optdata->componentTable ));\n    GXV_TRACE(( \"offset to ligatureTable=0x%04x\\n\",\n                optdata->ligatureTable ));\n  }\n\n\n  static void\n  gxv_mort_subtable_type2_subtable_setup( FT_UShort      table_size,\n                                          FT_UShort      classTable,\n                                          FT_UShort      stateArray,\n                                          FT_UShort      entryTable,\n                                          FT_UShort      *classTable_length_p,\n                                          FT_UShort      *stateArray_length_p,\n                                          FT_UShort      *entryTable_length_p,\n                                          GXV_Validator  gxvalid )\n  {\n    FT_UShort  o[6];\n    FT_UShort  *l[6];\n    FT_UShort  buff[7];\n\n    GXV_mort_subtable_type2_StateOptRecData  optdata =\n      (GXV_mort_subtable_type2_StateOptRecData)gxvalid->statetable.optdata;\n\n\n    GXV_NAME_ENTER( \"subtable boundaries setup\" );\n\n    o[0] = classTable;\n    o[1] = stateArray;\n    o[2] = entryTable;\n    o[3] = optdata->ligActionTable;\n    o[4] = optdata->componentTable;\n    o[5] = optdata->ligatureTable;\n    l[0] = classTable_length_p;\n    l[1] = stateArray_length_p;\n    l[2] = entryTable_length_p;\n    l[3] = &(optdata->ligActionTable_length);\n    l[4] = &(optdata->componentTable_length);\n    l[5] = &(optdata->ligatureTable_length);\n\n    gxv_set_length_by_ushort_offset( o, l, buff, 6, table_size, gxvalid );\n\n    GXV_TRACE(( \"classTable: offset=0x%04x length=0x%04x\\n\",\n                classTable, *classTable_length_p ));\n    GXV_TRACE(( \"stateArray: offset=0x%04x length=0x%04x\\n\",\n                stateArray, *stateArray_length_p ));\n    GXV_TRACE(( \"entryTable: offset=0x%04x length=0x%04x\\n\",\n                entryTable, *entryTable_length_p ));\n    GXV_TRACE(( \"ligActionTable: offset=0x%04x length=0x%04x\\n\",\n                optdata->ligActionTable,\n                optdata->ligActionTable_length ));\n    GXV_TRACE(( \"componentTable: offset=0x%04x length=0x%04x\\n\",\n                optdata->componentTable,\n                optdata->componentTable_length ));\n    GXV_TRACE(( \"ligatureTable:  offset=0x%04x length=0x%04x\\n\",\n                optdata->ligatureTable,\n                optdata->ligatureTable_length ));\n\n    GXV_EXIT;\n  }\n\n\n  static void\n  gxv_mort_subtable_type2_ligActionOffset_validate(\n    FT_Bytes       table,\n    FT_UShort      ligActionOffset,\n    GXV_Validator  gxvalid )\n  {\n    /* access ligActionTable */\n    GXV_mort_subtable_type2_StateOptRecData  optdata =\n      (GXV_mort_subtable_type2_StateOptRecData)gxvalid->statetable.optdata;\n\n    FT_Bytes lat_base  = table + optdata->ligActionTable;\n    FT_Bytes p         = table + ligActionOffset;\n    FT_Bytes lat_limit = lat_base + optdata->ligActionTable;\n\n\n    GXV_32BIT_ALIGNMENT_VALIDATE( ligActionOffset );\n    if ( p < lat_base )\n    {\n      GXV_TRACE(( \"too short offset 0x%04x: p < lat_base (%d byte rewind)\\n\",\n                  ligActionOffset, lat_base - p ));\n\n      /* FontValidator, ftxvalidator, ftxdumperfuser warn but continue */\n      GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );\n    }\n    else if ( lat_limit < p )\n    {\n      GXV_TRACE(( \"too large offset 0x%04x: lat_limit < p (%d byte overrun)\\n\",\n                  ligActionOffset, p - lat_limit ));\n\n      /* FontValidator, ftxvalidator, ftxdumperfuser warn but continue */\n      GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );\n    }\n    else\n    {\n      /* validate entry in ligActionTable */\n      FT_ULong   lig_action;\n#ifdef GXV_LOAD_UNUSED_VARS\n      FT_UShort  last;\n      FT_UShort  store;\n#endif\n      FT_ULong   offset;\n\n\n      lig_action = FT_NEXT_ULONG( p );\n#ifdef GXV_LOAD_UNUSED_VARS\n      last   = (FT_UShort)( ( lig_action >> 31 ) & 1 );\n      store  = (FT_UShort)( ( lig_action >> 30 ) & 1 );\n#endif\n\n      /* Apple spec defines this offset as a word offset */\n      offset = lig_action & 0x3FFFFFFFUL;\n      if ( offset * 2 < optdata->ligatureTable )\n      {\n        GXV_TRACE(( \"too short offset 0x%08x:\"\n                    \" 2 x offset < ligatureTable (%d byte rewind)\\n\",\n                     offset, optdata->ligatureTable - offset * 2 ));\n\n        GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );\n      } else if ( offset * 2 >\n                  optdata->ligatureTable + optdata->ligatureTable_length )\n      {\n        GXV_TRACE(( \"too long offset 0x%08x:\"\n                    \" 2 x offset > ligatureTable + ligatureTable_length\"\n                    \" (%d byte overrun)\\n\",\n                     offset,\n                     optdata->ligatureTable + optdata->ligatureTable_length\n                     - offset * 2 ));\n\n        GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );\n      }\n    }\n  }\n\n\n  static void\n  gxv_mort_subtable_type2_entry_validate(\n    FT_Byte                         state,\n    FT_UShort                       flags,\n    GXV_StateTable_GlyphOffsetCPtr  glyphOffset_p,\n    FT_Bytes                        table,\n    FT_Bytes                        limit,\n    GXV_Validator                   gxvalid )\n  {\n#ifdef GXV_LOAD_UNUSED_VARS\n    FT_UShort setComponent;\n    FT_UShort dontAdvance;\n#endif\n    FT_UShort offset;\n\n    FT_UNUSED( state );\n    FT_UNUSED( glyphOffset_p );\n    FT_UNUSED( limit );\n\n\n#ifdef GXV_LOAD_UNUSED_VARS\n    setComponent = (FT_UShort)( ( flags >> 15 ) & 1 );\n    dontAdvance  = (FT_UShort)( ( flags >> 14 ) & 1 );\n#endif\n\n    offset = (FT_UShort)( flags & 0x3FFFU );\n\n    if ( 0 < offset )\n      gxv_mort_subtable_type2_ligActionOffset_validate( table, offset,\n                                                        gxvalid );\n  }\n\n\n  static void\n  gxv_mort_subtable_type2_ligatureTable_validate( FT_Bytes       table,\n                                                  GXV_Validator  gxvalid )\n  {\n    GXV_mort_subtable_type2_StateOptRecData  optdata =\n      (GXV_mort_subtable_type2_StateOptRecData)gxvalid->statetable.optdata;\n\n    FT_Bytes p     = table + optdata->ligatureTable;\n    FT_Bytes limit = table + optdata->ligatureTable\n                           + optdata->ligatureTable_length;\n\n\n    GXV_NAME_ENTER( \"mort chain subtable type2 - substitutionTable\" );\n    if ( 0 != optdata->ligatureTable )\n    {\n      /* Apple does not give specification of ligatureTable format */\n      while ( p < limit )\n      {\n        FT_UShort  lig_gid;\n\n\n        GXV_LIMIT_CHECK( 2 );\n        lig_gid = FT_NEXT_USHORT( p );\n\n        if ( gxvalid->face->num_glyphs < lig_gid )\n          GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );\n      }\n    }\n    GXV_EXIT;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  gxv_mort_subtable_type2_validate( FT_Bytes       table,\n                                    FT_Bytes       limit,\n                                    GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n    GXV_mort_subtable_type2_StateOptRec  lig_rec;\n\n\n    GXV_NAME_ENTER( \"mort chain subtable type2 (Ligature Substitution)\" );\n\n    GXV_LIMIT_CHECK( GXV_MORT_SUBTABLE_TYPE2_HEADER_SIZE );\n\n    gxvalid->statetable.optdata =\n      &lig_rec;\n    gxvalid->statetable.optdata_load_func =\n      gxv_mort_subtable_type2_opttable_load;\n    gxvalid->statetable.subtable_setup_func =\n      gxv_mort_subtable_type2_subtable_setup;\n    gxvalid->statetable.entry_glyphoffset_fmt =\n      GXV_GLYPHOFFSET_NONE;\n    gxvalid->statetable.entry_validate_func =\n      gxv_mort_subtable_type2_entry_validate;\n\n    gxv_StateTable_validate( p, limit, gxvalid );\n\n    p += gxvalid->subtable_length;\n    gxv_mort_subtable_type2_ligatureTable_validate( table, gxvalid );\n\n    gxvalid->subtable_length = p - table;\n\n    GXV_EXIT;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvmort4.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvmort4.c                                                             */\n/*                                                                         */\n/*    TrueTypeGX/AAT mort table validation                                 */\n/*    body for type4 (Non-Contextual Glyph Substitution) subtable.         */\n/*                                                                         */\n/*  Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,       */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"gxvmort.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gxvmort\n\n\n  static void\n  gxv_mort_subtable_type4_lookupval_validate( FT_UShort            glyph,\n                                              GXV_LookupValueCPtr  value_p,\n                                              GXV_Validator        gxvalid )\n  {\n    FT_UNUSED( glyph );\n\n    gxv_glyphid_validate( value_p->u, gxvalid );\n  }\n\n  /*\n    +===============+ --------+\n    | lookup header |         |\n    +===============+         |\n    | BinSrchHeader |         |\n    +===============+         |\n    | lastGlyph[0]  |         |\n    +---------------+         |\n    | firstGlyph[0] |         |    head of lookup table\n    +---------------+         |             +\n    | offset[0]     |    ->   |          offset            [byte]\n    +===============+         |             +\n    | lastGlyph[1]  |         | (glyphID - firstGlyph) * 2 [byte]\n    +---------------+         |\n    | firstGlyph[1] |         |\n    +---------------+         |\n    | offset[1]     |         |\n    +===============+         |\n                              |\n     ....                     |\n                              |\n    16bit value array         |\n    +===============+         |\n    |     value     | <-------+\n     ....\n  */\n\n  static GXV_LookupValueDesc\n  gxv_mort_subtable_type4_lookupfmt4_transit(\n    FT_UShort            relative_gindex,\n    GXV_LookupValueCPtr  base_value_p,\n    FT_Bytes             lookuptbl_limit,\n    GXV_Validator        gxvalid )\n  {\n    FT_Bytes             p;\n    FT_Bytes             limit;\n    FT_UShort            offset;\n    GXV_LookupValueDesc  value;\n\n    /* XXX: check range? */\n    offset = (FT_UShort)( base_value_p->u +\n                          relative_gindex * sizeof ( FT_UShort ) );\n\n    p     = gxvalid->lookuptbl_head + offset;\n    limit = lookuptbl_limit;\n\n    GXV_LIMIT_CHECK( 2 );\n    value.u = FT_NEXT_USHORT( p );\n\n    return value;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  gxv_mort_subtable_type4_validate( FT_Bytes       table,\n                                    FT_Bytes       limit,\n                                    GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n\n    GXV_NAME_ENTER( \"mort chain subtable type4 \"\n                    \"(Non-Contextual Glyph Substitution)\" );\n\n    gxvalid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;\n    gxvalid->lookupval_func   = gxv_mort_subtable_type4_lookupval_validate;\n    gxvalid->lookupfmt4_trans = gxv_mort_subtable_type4_lookupfmt4_transit;\n\n    gxv_LookupTable_validate( p, limit, gxvalid );\n\n    GXV_EXIT;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvmort5.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvmort5.c                                                             */\n/*                                                                         */\n/*    TrueTypeGX/AAT mort table validation                                 */\n/*    body for type5 (Contextual Glyph Insertion) subtable.                */\n/*                                                                         */\n/*  Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,       */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"gxvmort.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gxvmort\n\n\n  /*\n   * mort subtable type5 (Contextual Glyph Insertion)\n   * has the format of StateTable with insertion-glyph-list,\n   * but without name.  The offset is given by glyphOffset in\n   * entryTable.  There is no table location declaration\n   * like xxxTable.\n   */\n\n  typedef struct  GXV_mort_subtable_type5_StateOptRec_\n  {\n    FT_UShort   classTable;\n    FT_UShort   stateArray;\n    FT_UShort   entryTable;\n\n#define GXV_MORT_SUBTABLE_TYPE5_HEADER_SIZE  GXV_STATETABLE_HEADER_SIZE\n\n    FT_UShort*  classTable_length_p;\n    FT_UShort*  stateArray_length_p;\n    FT_UShort*  entryTable_length_p;\n\n  }  GXV_mort_subtable_type5_StateOptRec,\n    *GXV_mort_subtable_type5_StateOptRecData;\n\n\n  FT_LOCAL_DEF( void )\n  gxv_mort_subtable_type5_subtable_setup( FT_UShort      table_size,\n                                          FT_UShort      classTable,\n                                          FT_UShort      stateArray,\n                                          FT_UShort      entryTable,\n                                          FT_UShort*     classTable_length_p,\n                                          FT_UShort*     stateArray_length_p,\n                                          FT_UShort*     entryTable_length_p,\n                                          GXV_Validator  gxvalid )\n  {\n    GXV_mort_subtable_type5_StateOptRecData  optdata =\n      (GXV_mort_subtable_type5_StateOptRecData)gxvalid->statetable.optdata;\n\n\n    gxv_StateTable_subtable_setup( table_size,\n                                   classTable,\n                                   stateArray,\n                                   entryTable,\n                                   classTable_length_p,\n                                   stateArray_length_p,\n                                   entryTable_length_p,\n                                   gxvalid );\n\n    optdata->classTable = classTable;\n    optdata->stateArray = stateArray;\n    optdata->entryTable = entryTable;\n\n    optdata->classTable_length_p = classTable_length_p;\n    optdata->stateArray_length_p = stateArray_length_p;\n    optdata->entryTable_length_p = entryTable_length_p;\n  }\n\n\n  static void\n  gxv_mort_subtable_type5_InsertList_validate( FT_UShort      offset,\n                                               FT_UShort      count,\n                                               FT_Bytes       table,\n                                               FT_Bytes       limit,\n                                               GXV_Validator  gxvalid )\n  {\n    /*\n     * We don't know the range of insertion-glyph-list.\n     * Set range by whole of state table.\n     */\n    FT_Bytes  p = table + offset;\n\n    GXV_mort_subtable_type5_StateOptRecData  optdata =\n      (GXV_mort_subtable_type5_StateOptRecData)gxvalid->statetable.optdata;\n\n    if ( optdata->classTable < offset                                   &&\n         offset < optdata->classTable + *(optdata->classTable_length_p) )\n      GXV_TRACE(( \" offset runs into ClassTable\" ));\n    if ( optdata->stateArray < offset                                   &&\n         offset < optdata->stateArray + *(optdata->stateArray_length_p) )\n      GXV_TRACE(( \" offset runs into StateArray\" ));\n    if ( optdata->entryTable < offset                                   &&\n         offset < optdata->entryTable + *(optdata->entryTable_length_p) )\n      GXV_TRACE(( \" offset runs into EntryTable\" ));\n\n#ifndef GXV_LOAD_TRACE_VARS\n    GXV_LIMIT_CHECK( count * 2 );\n#else\n    while ( p < table + offset + ( count * 2 ) )\n    {\n      FT_UShort insert_glyphID;\n\n\n      GXV_LIMIT_CHECK( 2 );\n      insert_glyphID = FT_NEXT_USHORT( p );\n      GXV_TRACE(( \" 0x%04x\", insert_glyphID ));\n    }\n    GXV_TRACE(( \"\\n\" ));\n#endif\n  }\n\n\n  static void\n  gxv_mort_subtable_type5_entry_validate(\n    FT_Byte                         state,\n    FT_UShort                       flags,\n    GXV_StateTable_GlyphOffsetCPtr  glyphOffset,\n    FT_Bytes                        table,\n    FT_Bytes                        limit,\n    GXV_Validator                   gxvalid )\n  {\n#ifdef GXV_LOAD_UNUSED_VARS\n    FT_Bool    setMark;\n    FT_Bool    dontAdvance;\n    FT_Bool    currentIsKashidaLike;\n    FT_Bool    markedIsKashidaLike;\n    FT_Bool    currentInsertBefore;\n    FT_Bool    markedInsertBefore;\n#endif\n    FT_Byte    currentInsertCount;\n    FT_Byte    markedInsertCount;\n    FT_UShort  currentInsertList;\n    FT_UShort  markedInsertList;\n\n    FT_UNUSED( state );\n\n\n#ifdef GXV_LOAD_UNUSED_VARS\n    setMark              = FT_BOOL( ( flags >> 15 ) & 1 );\n    dontAdvance          = FT_BOOL( ( flags >> 14 ) & 1 );\n    currentIsKashidaLike = FT_BOOL( ( flags >> 13 ) & 1 );\n    markedIsKashidaLike  = FT_BOOL( ( flags >> 12 ) & 1 );\n    currentInsertBefore  = FT_BOOL( ( flags >> 11 ) & 1 );\n    markedInsertBefore   = FT_BOOL( ( flags >> 10 ) & 1 );\n#endif\n\n    currentInsertCount   = (FT_Byte)( ( flags >> 5 ) & 0x1F   );\n    markedInsertCount    = (FT_Byte)(   flags        & 0x001F );\n\n    currentInsertList    = (FT_UShort)( glyphOffset->ul >> 16 );\n    markedInsertList     = (FT_UShort)( glyphOffset->ul       );\n\n    if ( 0 != currentInsertList && 0 != currentInsertCount )\n    {\n      gxv_mort_subtable_type5_InsertList_validate( currentInsertList,\n                                                   currentInsertCount,\n                                                   table,\n                                                   limit,\n                                                   gxvalid );\n    }\n\n    if ( 0 != markedInsertList && 0 != markedInsertCount )\n    {\n      gxv_mort_subtable_type5_InsertList_validate( markedInsertList,\n                                                   markedInsertCount,\n                                                   table,\n                                                   limit,\n                                                   gxvalid );\n    }\n  }\n\n\n  FT_LOCAL_DEF( void )\n  gxv_mort_subtable_type5_validate( FT_Bytes       table,\n                                    FT_Bytes       limit,\n                                    GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n    GXV_mort_subtable_type5_StateOptRec      et_rec;\n    GXV_mort_subtable_type5_StateOptRecData  et = &et_rec;\n\n\n    GXV_NAME_ENTER( \"mort chain subtable type5 (Glyph Insertion)\" );\n\n    GXV_LIMIT_CHECK( GXV_MORT_SUBTABLE_TYPE5_HEADER_SIZE );\n\n    gxvalid->statetable.optdata =\n      et;\n    gxvalid->statetable.optdata_load_func =\n      NULL;\n    gxvalid->statetable.subtable_setup_func =\n      gxv_mort_subtable_type5_subtable_setup;\n    gxvalid->statetable.entry_glyphoffset_fmt =\n      GXV_GLYPHOFFSET_ULONG;\n    gxvalid->statetable.entry_validate_func =\n      gxv_mort_subtable_type5_entry_validate;\n\n    gxv_StateTable_validate( p, limit, gxvalid );\n\n    GXV_EXIT;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvmorx.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvmorx.c                                                              */\n/*                                                                         */\n/*    TrueTypeGX/AAT morx table validation (body).                         */\n/*                                                                         */\n/*  Copyright 2005, 2008, 2013 by                                          */\n/*  suzuki toshiya, Masatake YAMATO, Red Hat K.K.,                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"gxvmorx.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gxvmorx\n\n\n  static void\n  gxv_morx_subtables_validate( FT_Bytes       table,\n                               FT_Bytes       limit,\n                               FT_UShort      nSubtables,\n                               GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n    GXV_Validate_Func fmt_funcs_table[] =\n    {\n      gxv_morx_subtable_type0_validate, /* 0 */\n      gxv_morx_subtable_type1_validate, /* 1 */\n      gxv_morx_subtable_type2_validate, /* 2 */\n      NULL,                             /* 3 */\n      gxv_morx_subtable_type4_validate, /* 4 */\n      gxv_morx_subtable_type5_validate, /* 5 */\n\n    };\n\n    FT_UShort  i;\n\n\n    GXV_NAME_ENTER( \"subtables in a chain\" );\n\n    for ( i = 0; i < nSubtables; i++ )\n    {\n      GXV_Validate_Func  func;\n\n      FT_ULong  length;\n      FT_ULong  coverage;\n#ifdef GXV_LOAD_UNUSED_VARS\n      FT_ULong  subFeatureFlags;\n#endif\n      FT_ULong  type;\n      FT_ULong  rest;\n\n\n      GXV_LIMIT_CHECK( 4 + 4 + 4 );\n      length          = FT_NEXT_ULONG( p );\n      coverage        = FT_NEXT_ULONG( p );\n#ifdef GXV_LOAD_UNUSED_VARS\n      subFeatureFlags = FT_NEXT_ULONG( p );\n#else\n      p += 4;\n#endif\n\n      GXV_TRACE(( \"validating chain subtable %d/%d (%d bytes)\\n\",\n                  i + 1, nSubtables, length ));\n\n      type = coverage & 0x0007;\n      rest = length - ( 4 + 4 + 4 );\n      GXV_LIMIT_CHECK( rest );\n\n      /* morx coverage consists of mort_coverage & 16bit padding */\n      gxv_mort_coverage_validate( (FT_UShort)( ( coverage >> 16 ) | coverage ),\n                                  gxvalid );\n      if ( type > 5 )\n        FT_INVALID_FORMAT;\n\n      func = fmt_funcs_table[type];\n      if ( func == NULL )\n        GXV_TRACE(( \"morx type %d is reserved\\n\", type ));\n\n      func( p, p + rest, gxvalid );\n\n      /* TODO: subFeatureFlags should be unique in a table? */\n      p += rest;\n    }\n\n    gxvalid->subtable_length = p - table;\n\n    GXV_EXIT;\n  }\n\n\n  static void\n  gxv_morx_chain_validate( FT_Bytes       table,\n                           FT_Bytes       limit,\n                           GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n#ifdef GXV_LOAD_UNUSED_VARS\n    FT_ULong  defaultFlags;\n#endif\n    FT_ULong  chainLength;\n    FT_ULong  nFeatureFlags;\n    FT_ULong  nSubtables;\n\n\n    GXV_NAME_ENTER( \"morx chain header\" );\n\n    GXV_LIMIT_CHECK( 4 + 4 + 4 + 4 );\n#ifdef GXV_LOAD_UNUSED_VARS\n    defaultFlags  = FT_NEXT_ULONG( p );\n#else\n    p += 4;\n#endif\n    chainLength   = FT_NEXT_ULONG( p );\n    nFeatureFlags = FT_NEXT_ULONG( p );\n    nSubtables    = FT_NEXT_ULONG( p );\n\n    /* feature-array of morx is same with that of mort */\n    gxv_mort_featurearray_validate( p, limit, nFeatureFlags, gxvalid );\n    p += gxvalid->subtable_length;\n\n    if ( nSubtables >= 0x10000L )\n      FT_INVALID_DATA;\n\n    gxv_morx_subtables_validate( p, table + chainLength,\n                                 (FT_UShort)nSubtables, gxvalid );\n\n    gxvalid->subtable_length = chainLength;\n\n    /* TODO: defaultFlags should be compared with the flags in tables */\n\n    GXV_EXIT;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  gxv_morx_validate( FT_Bytes      table,\n                     FT_Face       face,\n                     FT_Validator  ftvalid )\n  {\n    GXV_ValidatorRec  gxvalidrec;\n    GXV_Validator     gxvalid = &gxvalidrec;\n    FT_Bytes          p     = table;\n    FT_Bytes          limit = 0;\n    FT_ULong          version;\n    FT_ULong          nChains;\n    FT_ULong          i;\n\n\n    gxvalid->root = ftvalid;\n    gxvalid->face = face;\n\n    FT_TRACE3(( \"validating `morx' table\\n\" ));\n    GXV_INIT;\n\n    GXV_LIMIT_CHECK( 4 + 4 );\n    version = FT_NEXT_ULONG( p );\n    nChains = FT_NEXT_ULONG( p );\n\n    if ( version != 0x00020000UL )\n      FT_INVALID_FORMAT;\n\n    for ( i = 0; i < nChains; i++ )\n    {\n      GXV_TRACE(( \"validating chain %d/%d\\n\", i + 1, nChains ));\n      GXV_32BIT_ALIGNMENT_VALIDATE( p - table );\n      gxv_morx_chain_validate( p, limit, gxvalid );\n      p += gxvalid->subtable_length;\n    }\n\n    FT_TRACE4(( \"\\n\" ));\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvmorx.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvmorx.h                                                              */\n/*                                                                         */\n/*    TrueTypeGX/AAT common definition for morx table (specification).     */\n/*                                                                         */\n/*  Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,       */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __GXVMORX_H__\n#define __GXVMORX_H__\n\n\n#include \"gxvalid.h\"\n#include \"gxvcommn.h\"\n#include \"gxvmort.h\"\n\n#include FT_SFNT_NAMES_H\n\n\n  FT_LOCAL( void )\n  gxv_morx_subtable_type0_validate( FT_Bytes       table,\n                                    FT_Bytes       limit,\n                                    GXV_Validator  gxvalid );\n\n  FT_LOCAL( void )\n  gxv_morx_subtable_type1_validate( FT_Bytes       table,\n                                    FT_Bytes       limit,\n                                    GXV_Validator  gxvalid );\n\n  FT_LOCAL( void )\n  gxv_morx_subtable_type2_validate( FT_Bytes       table,\n                                    FT_Bytes       limit,\n                                    GXV_Validator  gxvalid );\n\n  FT_LOCAL( void )\n  gxv_morx_subtable_type4_validate( FT_Bytes       table,\n                                    FT_Bytes       limit,\n                                    GXV_Validator  gxvalid );\n\n  FT_LOCAL( void )\n  gxv_morx_subtable_type5_validate( FT_Bytes       table,\n                                    FT_Bytes       limit,\n                                    GXV_Validator  gxvalid );\n\n\n#endif /* __GXVMORX_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvmorx0.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvmorx0.c                                                             */\n/*                                                                         */\n/*    TrueTypeGX/AAT morx table validation                                 */\n/*    body for type0 (Indic Script Rearrangement) subtable.                */\n/*                                                                         */\n/*  Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,       */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"gxvmorx.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gxvmorx\n\n\n  static void\n  gxv_morx_subtable_type0_entry_validate(\n    FT_UShort                        state,\n    FT_UShort                        flags,\n    GXV_XStateTable_GlyphOffsetCPtr  glyphOffset_p,\n    FT_Bytes                         table,\n    FT_Bytes                         limit,\n    GXV_Validator                    gxvalid )\n  {\n#ifdef GXV_LOAD_UNUSED_VARS\n    FT_UShort  markFirst;\n    FT_UShort  dontAdvance;\n    FT_UShort  markLast;\n#endif\n    FT_UShort  reserved;\n#ifdef GXV_LOAD_UNUSED_VARS\n    FT_UShort  verb;\n#endif\n\n    FT_UNUSED( state );\n    FT_UNUSED( glyphOffset_p );\n    FT_UNUSED( table );\n    FT_UNUSED( limit );\n\n\n#ifdef GXV_LOAD_UNUSED_VARS\n    markFirst   = (FT_UShort)( ( flags >> 15 ) & 1 );\n    dontAdvance = (FT_UShort)( ( flags >> 14 ) & 1 );\n    markLast    = (FT_UShort)( ( flags >> 13 ) & 1 );\n#endif\n\n    reserved = (FT_UShort)( flags & 0x1FF0 );\n#ifdef GXV_LOAD_UNUSED_VARS\n    verb     = (FT_UShort)( flags & 0x000F );\n#endif\n\n    if ( 0 < reserved )\n    {\n      GXV_TRACE(( \" non-zero bits found in reserved range\\n\" ));\n      FT_INVALID_DATA;\n    }\n  }\n\n\n  FT_LOCAL_DEF( void )\n  gxv_morx_subtable_type0_validate( FT_Bytes       table,\n                                    FT_Bytes       limit,\n                                    GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n\n    GXV_NAME_ENTER(\n      \"morx chain subtable type0 (Indic-Script Rearrangement)\" );\n\n    GXV_LIMIT_CHECK( GXV_STATETABLE_HEADER_SIZE );\n\n    gxvalid->xstatetable.optdata               = NULL;\n    gxvalid->xstatetable.optdata_load_func     = NULL;\n    gxvalid->xstatetable.subtable_setup_func   = NULL;\n    gxvalid->xstatetable.entry_glyphoffset_fmt = GXV_GLYPHOFFSET_NONE;\n    gxvalid->xstatetable.entry_validate_func =\n      gxv_morx_subtable_type0_entry_validate;\n\n    gxv_XStateTable_validate( p, limit, gxvalid );\n\n    GXV_EXIT;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvmorx1.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvmorx1.c                                                             */\n/*                                                                         */\n/*    TrueTypeGX/AAT morx table validation                                 */\n/*    body for type1 (Contextual Substitution) subtable.                   */\n/*                                                                         */\n/*  Copyright 2005, 2007 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"gxvmorx.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gxvmorx\n\n\n  typedef struct  GXV_morx_subtable_type1_StateOptRec_\n  {\n    FT_ULong   substitutionTable;\n    FT_ULong   substitutionTable_length;\n    FT_UShort  substitutionTable_num_lookupTables;\n\n  }  GXV_morx_subtable_type1_StateOptRec,\n    *GXV_morx_subtable_type1_StateOptRecData;\n\n\n#define GXV_MORX_SUBTABLE_TYPE1_HEADER_SIZE \\\n          ( GXV_STATETABLE_HEADER_SIZE + 2 )\n\n\n  static void\n  gxv_morx_subtable_type1_substitutionTable_load( FT_Bytes       table,\n                                                  FT_Bytes       limit,\n                                                  GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n    GXV_morx_subtable_type1_StateOptRecData  optdata =\n      (GXV_morx_subtable_type1_StateOptRecData)gxvalid->xstatetable.optdata;\n\n\n    GXV_LIMIT_CHECK( 2 );\n    optdata->substitutionTable = FT_NEXT_USHORT( p );\n  }\n\n\n  static void\n  gxv_morx_subtable_type1_subtable_setup( FT_ULong       table_size,\n                                          FT_ULong       classTable,\n                                          FT_ULong       stateArray,\n                                          FT_ULong       entryTable,\n                                          FT_ULong*      classTable_length_p,\n                                          FT_ULong*      stateArray_length_p,\n                                          FT_ULong*      entryTable_length_p,\n                                          GXV_Validator  gxvalid )\n  {\n    FT_ULong  o[4];\n    FT_ULong  *l[4];\n    FT_ULong  buff[5];\n\n    GXV_morx_subtable_type1_StateOptRecData  optdata =\n      (GXV_morx_subtable_type1_StateOptRecData)gxvalid->xstatetable.optdata;\n\n\n    o[0] = classTable;\n    o[1] = stateArray;\n    o[2] = entryTable;\n    o[3] = optdata->substitutionTable;\n    l[0] = classTable_length_p;\n    l[1] = stateArray_length_p;\n    l[2] = entryTable_length_p;\n    l[3] = &(optdata->substitutionTable_length);\n\n    gxv_set_length_by_ulong_offset( o, l, buff, 4, table_size, gxvalid );\n  }\n\n\n  static void\n  gxv_morx_subtable_type1_entry_validate(\n    FT_UShort                       state,\n    FT_UShort                       flags,\n    GXV_StateTable_GlyphOffsetCPtr  glyphOffset_p,\n    FT_Bytes                        table,\n    FT_Bytes                        limit,\n    GXV_Validator                   gxvalid )\n  {\n#ifdef GXV_LOAD_TRACE_VARS\n    FT_UShort  setMark;\n    FT_UShort  dontAdvance;\n#endif\n    FT_UShort  reserved;\n    FT_Short   markIndex;\n    FT_Short   currentIndex;\n\n    GXV_morx_subtable_type1_StateOptRecData  optdata =\n      (GXV_morx_subtable_type1_StateOptRecData)gxvalid->xstatetable.optdata;\n\n    FT_UNUSED( state );\n    FT_UNUSED( table );\n    FT_UNUSED( limit );\n\n\n#ifdef GXV_LOAD_TRACE_VARS\n    setMark      = (FT_UShort)( ( flags >> 15 ) & 1 );\n    dontAdvance  = (FT_UShort)( ( flags >> 14 ) & 1 );\n#endif\n\n    reserved = (FT_UShort)( flags & 0x3FFF );\n\n    markIndex    = (FT_Short)( glyphOffset_p->ul >> 16 );\n    currentIndex = (FT_Short)( glyphOffset_p->ul       );\n\n    GXV_TRACE(( \" setMark=%01d dontAdvance=%01d\\n\",\n                setMark, dontAdvance ));\n\n    if ( 0 < reserved )\n    {\n      GXV_TRACE(( \" non-zero bits found in reserved range\\n\" ));\n      GXV_SET_ERR_IF_PARANOID( FT_INVALID_DATA );\n    }\n\n    GXV_TRACE(( \"markIndex = %d, currentIndex = %d\\n\",\n                markIndex, currentIndex ));\n\n    if ( optdata->substitutionTable_num_lookupTables < markIndex + 1 )\n      optdata->substitutionTable_num_lookupTables =\n        (FT_Short)( markIndex + 1 );\n\n    if ( optdata->substitutionTable_num_lookupTables < currentIndex + 1 )\n      optdata->substitutionTable_num_lookupTables =\n        (FT_Short)( currentIndex + 1 );\n  }\n\n\n  static void\n  gxv_morx_subtable_type1_LookupValue_validate( FT_UShort            glyph,\n                                                GXV_LookupValueCPtr  value_p,\n                                                GXV_Validator        gxvalid )\n  {\n    FT_UNUSED( glyph ); /* for the non-debugging case */\n\n    GXV_TRACE(( \"morx subtable type1 subst.: %d -> %d\\n\", glyph, value_p->u ));\n\n    if ( value_p->u > gxvalid->face->num_glyphs )\n      FT_INVALID_GLYPH_ID;\n  }\n\n\n  static GXV_LookupValueDesc\n  gxv_morx_subtable_type1_LookupFmt4_transit(\n    FT_UShort            relative_gindex,\n    GXV_LookupValueCPtr  base_value_p,\n    FT_Bytes             lookuptbl_limit,\n    GXV_Validator        gxvalid )\n  {\n    FT_Bytes             p;\n    FT_Bytes             limit;\n    FT_UShort            offset;\n    GXV_LookupValueDesc  value;\n\n    /* XXX: check range? */\n    offset = (FT_UShort)( base_value_p->u +\n                          relative_gindex * sizeof ( FT_UShort ) );\n\n    p     = gxvalid->lookuptbl_head + offset;\n    limit = lookuptbl_limit;\n\n    GXV_LIMIT_CHECK ( 2 );\n    value.u = FT_NEXT_USHORT( p );\n\n    return value;\n  }\n\n\n  /*\n   * TODO: length should be limit?\n   **/\n  static void\n  gxv_morx_subtable_type1_substitutionTable_validate( FT_Bytes       table,\n                                                      FT_Bytes       limit,\n                                                      GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p = table;\n    FT_UShort  i;\n\n    GXV_morx_subtable_type1_StateOptRecData  optdata =\n      (GXV_morx_subtable_type1_StateOptRecData)gxvalid->xstatetable.optdata;\n\n\n    /* TODO: calculate offset/length for each lookupTables */\n    gxvalid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;\n    gxvalid->lookupval_func   = gxv_morx_subtable_type1_LookupValue_validate;\n    gxvalid->lookupfmt4_trans = gxv_morx_subtable_type1_LookupFmt4_transit;\n\n    for ( i = 0; i < optdata->substitutionTable_num_lookupTables; i++ )\n    {\n      FT_ULong  offset;\n\n\n      GXV_LIMIT_CHECK( 4 );\n      offset = FT_NEXT_ULONG( p );\n\n      gxv_LookupTable_validate( table + offset, limit, gxvalid );\n    }\n\n    /* TODO: overlapping of lookupTables in substitutionTable */\n  }\n\n\n  /*\n   * subtable for Contextual glyph substitution is a modified StateTable.\n   * In addition to classTable, stateArray, entryTable, the field\n   * `substitutionTable' is added.\n   */\n  FT_LOCAL_DEF( void )\n  gxv_morx_subtable_type1_validate( FT_Bytes       table,\n                                    FT_Bytes       limit,\n                                    GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n    GXV_morx_subtable_type1_StateOptRec  st_rec;\n\n\n    GXV_NAME_ENTER( \"morx chain subtable type1 (Contextual Glyph Subst)\" );\n\n    GXV_LIMIT_CHECK( GXV_MORX_SUBTABLE_TYPE1_HEADER_SIZE );\n\n    st_rec.substitutionTable_num_lookupTables = 0;\n\n    gxvalid->xstatetable.optdata =\n      &st_rec;\n    gxvalid->xstatetable.optdata_load_func =\n      gxv_morx_subtable_type1_substitutionTable_load;\n    gxvalid->xstatetable.subtable_setup_func =\n      gxv_morx_subtable_type1_subtable_setup;\n    gxvalid->xstatetable.entry_glyphoffset_fmt =\n      GXV_GLYPHOFFSET_ULONG;\n    gxvalid->xstatetable.entry_validate_func =\n      gxv_morx_subtable_type1_entry_validate;\n\n    gxv_XStateTable_validate( p, limit, gxvalid );\n\n    gxv_morx_subtable_type1_substitutionTable_validate(\n      table + st_rec.substitutionTable,\n      table + st_rec.substitutionTable + st_rec.substitutionTable_length,\n      gxvalid );\n\n    GXV_EXIT;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvmorx2.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvmorx2.c                                                             */\n/*                                                                         */\n/*    TrueTypeGX/AAT morx table validation                                 */\n/*    body for type2 (Ligature Substitution) subtable.                     */\n/*                                                                         */\n/*  Copyright 2005, 2013 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"gxvmorx.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gxvmorx\n\n\n  typedef struct  GXV_morx_subtable_type2_StateOptRec_\n  {\n    FT_ULong  ligActionTable;\n    FT_ULong  componentTable;\n    FT_ULong  ligatureTable;\n    FT_ULong  ligActionTable_length;\n    FT_ULong  componentTable_length;\n    FT_ULong  ligatureTable_length;\n\n  }  GXV_morx_subtable_type2_StateOptRec,\n    *GXV_morx_subtable_type2_StateOptRecData;\n\n\n#define GXV_MORX_SUBTABLE_TYPE2_HEADER_SIZE \\\n          ( GXV_XSTATETABLE_HEADER_SIZE + 4 + 4 + 4 )\n\n\n  static void\n  gxv_morx_subtable_type2_opttable_load( FT_Bytes       table,\n                                         FT_Bytes       limit,\n                                         GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n    GXV_morx_subtable_type2_StateOptRecData  optdata =\n      (GXV_morx_subtable_type2_StateOptRecData)gxvalid->xstatetable.optdata;\n\n\n    GXV_LIMIT_CHECK( 4 + 4 + 4 );\n    optdata->ligActionTable = FT_NEXT_ULONG( p );\n    optdata->componentTable = FT_NEXT_ULONG( p );\n    optdata->ligatureTable  = FT_NEXT_ULONG( p );\n\n    GXV_TRACE(( \"offset to ligActionTable=0x%08x\\n\",\n                optdata->ligActionTable ));\n    GXV_TRACE(( \"offset to componentTable=0x%08x\\n\",\n                optdata->componentTable ));\n    GXV_TRACE(( \"offset to ligatureTable=0x%08x\\n\",\n                optdata->ligatureTable ));\n  }\n\n\n  static void\n  gxv_morx_subtable_type2_subtable_setup( FT_ULong       table_size,\n                                          FT_ULong       classTable,\n                                          FT_ULong       stateArray,\n                                          FT_ULong       entryTable,\n                                          FT_ULong*      classTable_length_p,\n                                          FT_ULong*      stateArray_length_p,\n                                          FT_ULong*      entryTable_length_p,\n                                          GXV_Validator  gxvalid )\n  {\n    FT_ULong   o[6];\n    FT_ULong*  l[6];\n    FT_ULong   buff[7];\n\n    GXV_morx_subtable_type2_StateOptRecData  optdata =\n      (GXV_morx_subtable_type2_StateOptRecData)gxvalid->xstatetable.optdata;\n\n\n    GXV_NAME_ENTER( \"subtable boundaries setup\" );\n\n    o[0] = classTable;\n    o[1] = stateArray;\n    o[2] = entryTable;\n    o[3] = optdata->ligActionTable;\n    o[4] = optdata->componentTable;\n    o[5] = optdata->ligatureTable;\n    l[0] = classTable_length_p;\n    l[1] = stateArray_length_p;\n    l[2] = entryTable_length_p;\n    l[3] = &(optdata->ligActionTable_length);\n    l[4] = &(optdata->componentTable_length);\n    l[5] = &(optdata->ligatureTable_length);\n\n    gxv_set_length_by_ulong_offset( o, l, buff, 6, table_size, gxvalid );\n\n    GXV_TRACE(( \"classTable: offset=0x%08x length=0x%08x\\n\",\n                classTable, *classTable_length_p ));\n    GXV_TRACE(( \"stateArray: offset=0x%08x length=0x%08x\\n\",\n                stateArray, *stateArray_length_p ));\n    GXV_TRACE(( \"entryTable: offset=0x%08x length=0x%08x\\n\",\n                entryTable, *entryTable_length_p ));\n    GXV_TRACE(( \"ligActionTable: offset=0x%08x length=0x%08x\\n\",\n                optdata->ligActionTable,\n                optdata->ligActionTable_length ));\n    GXV_TRACE(( \"componentTable: offset=0x%08x length=0x%08x\\n\",\n                optdata->componentTable,\n                optdata->componentTable_length ));\n    GXV_TRACE(( \"ligatureTable:  offset=0x%08x length=0x%08x\\n\",\n                optdata->ligatureTable,\n                optdata->ligatureTable_length ));\n\n    GXV_EXIT;\n  }\n\n\n#define GXV_MORX_LIGACTION_ENTRY_SIZE  4\n\n\n  static void\n  gxv_morx_subtable_type2_ligActionIndex_validate(\n    FT_Bytes       table,\n    FT_UShort      ligActionIndex,\n    GXV_Validator  gxvalid )\n  {\n    /* access ligActionTable */\n    GXV_morx_subtable_type2_StateOptRecData optdata =\n      (GXV_morx_subtable_type2_StateOptRecData)gxvalid->xstatetable.optdata;\n\n    FT_Bytes lat_base  = table + optdata->ligActionTable;\n    FT_Bytes p         = lat_base +\n                         ligActionIndex * GXV_MORX_LIGACTION_ENTRY_SIZE;\n    FT_Bytes lat_limit = lat_base + optdata->ligActionTable;\n\n\n    if ( p < lat_base )\n    {\n      GXV_TRACE(( \"p < lat_base (%d byte rewind)\\n\", lat_base - p ));\n      FT_INVALID_OFFSET;\n    }\n    else if ( lat_limit < p )\n    {\n      GXV_TRACE(( \"lat_limit < p (%d byte overrun)\\n\", p - lat_limit ));\n      FT_INVALID_OFFSET;\n    }\n\n    {\n      /* validate entry in ligActionTable */\n      FT_ULong   lig_action;\n#ifdef GXV_LOAD_UNUSED_VARS\n      FT_UShort  last;\n      FT_UShort  store;\n#endif\n      FT_ULong   offset;\n      FT_Long    gid_limit;\n\n\n      lig_action = FT_NEXT_ULONG( p );\n#ifdef GXV_LOAD_UNUSED_VARS\n      last       = (FT_UShort)( ( lig_action >> 31 ) & 1 );\n      store      = (FT_UShort)( ( lig_action >> 30 ) & 1 );\n#endif\n\n      offset = lig_action & 0x3FFFFFFFUL;\n\n      /* this offset is 30-bit signed value to add to GID */\n      /* it is different from the location offset in mort */\n      if ( ( offset & 0x3FFF0000UL ) == 0x3FFF0000UL )\n      { /* negative offset */\n        gid_limit = gxvalid->face->num_glyphs - ( offset & 0x0000FFFFUL );\n        if ( gid_limit > 0 )\n          return;\n\n        GXV_TRACE(( \"ligature action table includes\"\n                    \" too negative offset moving all GID\"\n                    \" below defined range: 0x%04x\\n\",\n                    offset & 0xFFFFU ));\n        GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );\n      }\n      else if ( ( offset & 0x3FFF0000UL ) == 0x00000000UL )\n      { /* positive offset */\n        if ( (FT_Long)offset < gxvalid->face->num_glyphs )\n          return;\n\n        GXV_TRACE(( \"ligature action table includes\"\n                    \" too large offset moving all GID\"\n                    \" over defined range: 0x%04x\\n\",\n                    offset & 0xFFFFU ));\n        GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );\n      }\n\n      GXV_TRACE(( \"ligature action table includes\"\n                  \" invalid offset to add to 16-bit GID:\"\n                  \" 0x%08x\\n\", offset ));\n      GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );\n    }\n  }\n\n\n  static void\n  gxv_morx_subtable_type2_entry_validate(\n    FT_UShort                       state,\n    FT_UShort                       flags,\n    GXV_StateTable_GlyphOffsetCPtr  glyphOffset_p,\n    FT_Bytes                        table,\n    FT_Bytes                        limit,\n    GXV_Validator                   gxvalid )\n  {\n#ifdef GXV_LOAD_UNUSED_VARS\n    FT_UShort  setComponent;\n    FT_UShort  dontAdvance;\n    FT_UShort  performAction;\n#endif\n    FT_UShort  reserved;\n    FT_UShort  ligActionIndex;\n\n    FT_UNUSED( state );\n    FT_UNUSED( limit );\n\n\n#ifdef GXV_LOAD_UNUSED_VARS\n    setComponent   = (FT_UShort)( ( flags >> 15 ) & 1 );\n    dontAdvance    = (FT_UShort)( ( flags >> 14 ) & 1 );\n    performAction  = (FT_UShort)( ( flags >> 13 ) & 1 );\n#endif\n\n    reserved       = (FT_UShort)( flags & 0x1FFF );\n    ligActionIndex = glyphOffset_p->u;\n\n    if ( reserved > 0 )\n      GXV_TRACE(( \"  reserved 14bit is non-zero\\n\" ));\n\n    if ( 0 < ligActionIndex )\n      gxv_morx_subtable_type2_ligActionIndex_validate(\n        table, ligActionIndex, gxvalid );\n  }\n\n\n  static void\n  gxv_morx_subtable_type2_ligatureTable_validate( FT_Bytes       table,\n                                                  GXV_Validator  gxvalid )\n  {\n    GXV_morx_subtable_type2_StateOptRecData  optdata =\n      (GXV_morx_subtable_type2_StateOptRecData)gxvalid->xstatetable.optdata;\n\n    FT_Bytes p     = table + optdata->ligatureTable;\n    FT_Bytes limit = table + optdata->ligatureTable\n                           + optdata->ligatureTable_length;\n\n\n    GXV_NAME_ENTER( \"morx chain subtable type2 - substitutionTable\" );\n\n    if ( 0 != optdata->ligatureTable )\n    {\n      /* Apple does not give specification of ligatureTable format */\n      while ( p < limit )\n      {\n        FT_UShort  lig_gid;\n\n\n        GXV_LIMIT_CHECK( 2 );\n        lig_gid = FT_NEXT_USHORT( p );\n        if ( lig_gid < gxvalid->face->num_glyphs )\n          GXV_SET_ERR_IF_PARANOID( FT_INVALID_GLYPH_ID );\n      }\n    }\n\n    GXV_EXIT;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  gxv_morx_subtable_type2_validate( FT_Bytes       table,\n                                    FT_Bytes       limit,\n                                    GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n    GXV_morx_subtable_type2_StateOptRec  lig_rec;\n\n\n    GXV_NAME_ENTER( \"morx chain subtable type2 (Ligature Substitution)\" );\n\n    GXV_LIMIT_CHECK( GXV_MORX_SUBTABLE_TYPE2_HEADER_SIZE );\n\n    gxvalid->xstatetable.optdata =\n      &lig_rec;\n    gxvalid->xstatetable.optdata_load_func =\n      gxv_morx_subtable_type2_opttable_load;\n    gxvalid->xstatetable.subtable_setup_func =\n      gxv_morx_subtable_type2_subtable_setup;\n    gxvalid->xstatetable.entry_glyphoffset_fmt =\n      GXV_GLYPHOFFSET_USHORT;\n    gxvalid->xstatetable.entry_validate_func =\n      gxv_morx_subtable_type2_entry_validate;\n\n    gxv_XStateTable_validate( p, limit, gxvalid );\n\n#if 0\n    p += gxvalid->subtable_length;\n#endif\n    gxv_morx_subtable_type2_ligatureTable_validate( table, gxvalid );\n\n    GXV_EXIT;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvmorx4.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvmorx4.c                                                             */\n/*                                                                         */\n/*    TrueTypeGX/AAT morx table validation                                 */\n/*    body for \"morx\" type4 (Non-Contextual Glyph Substitution) subtable.  */\n/*                                                                         */\n/*  Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,       */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"gxvmorx.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gxvmorx\n\n\n  FT_LOCAL_DEF( void )\n  gxv_morx_subtable_type4_validate( FT_Bytes       table,\n                                    FT_Bytes       limit,\n                                    GXV_Validator  gxvalid )\n  {\n    GXV_NAME_ENTER( \"morx chain subtable type4 \"\n                    \"(Non-Contextual Glyph Substitution)\" );\n\n    gxv_mort_subtable_type4_validate( table, limit, gxvalid );\n\n    GXV_EXIT;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvmorx5.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvmorx5.c                                                             */\n/*                                                                         */\n/*    TrueTypeGX/AAT morx table validation                                 */\n/*    body for type5 (Contextual Glyph Insertion) subtable.                */\n/*                                                                         */\n/*  Copyright 2005, 2007 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"gxvmorx.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gxvmorx\n\n\n  /*\n   * `morx' subtable type5 (Contextual Glyph Insertion)\n   * has format of a StateTable with insertion-glyph-list\n   * without name.  However, the 32bit offset from the head\n   * of subtable to the i-g-l is given after `entryTable',\n   * without variable name specification (the existence of\n   * this offset to the table is different from mort type5).\n   */\n\n\n  typedef struct  GXV_morx_subtable_type5_StateOptRec_\n  {\n    FT_ULong  insertionGlyphList;\n    FT_ULong  insertionGlyphList_length;\n\n  }  GXV_morx_subtable_type5_StateOptRec,\n    *GXV_morx_subtable_type5_StateOptRecData;\n\n\n#define GXV_MORX_SUBTABLE_TYPE5_HEADER_SIZE \\\n          ( GXV_STATETABLE_HEADER_SIZE + 4 )\n\n\n  static void\n  gxv_morx_subtable_type5_insertionGlyphList_load( FT_Bytes       table,\n                                                   FT_Bytes       limit,\n                                                   GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n    GXV_morx_subtable_type5_StateOptRecData  optdata =\n      (GXV_morx_subtable_type5_StateOptRecData)gxvalid->xstatetable.optdata;\n\n\n    GXV_LIMIT_CHECK( 4 );\n    optdata->insertionGlyphList = FT_NEXT_ULONG( p );\n  }\n\n\n  static void\n  gxv_morx_subtable_type5_subtable_setup( FT_ULong       table_size,\n                                          FT_ULong       classTable,\n                                          FT_ULong       stateArray,\n                                          FT_ULong       entryTable,\n                                          FT_ULong*      classTable_length_p,\n                                          FT_ULong*      stateArray_length_p,\n                                          FT_ULong*      entryTable_length_p,\n                                          GXV_Validator  gxvalid )\n  {\n    FT_ULong   o[4];\n    FT_ULong*  l[4];\n    FT_ULong   buff[5];\n\n    GXV_morx_subtable_type5_StateOptRecData  optdata =\n      (GXV_morx_subtable_type5_StateOptRecData)gxvalid->xstatetable.optdata;\n\n\n    o[0] = classTable;\n    o[1] = stateArray;\n    o[2] = entryTable;\n    o[3] = optdata->insertionGlyphList;\n    l[0] = classTable_length_p;\n    l[1] = stateArray_length_p;\n    l[2] = entryTable_length_p;\n    l[3] = &(optdata->insertionGlyphList_length);\n\n    gxv_set_length_by_ulong_offset( o, l, buff, 4, table_size, gxvalid );\n  }\n\n\n  static void\n  gxv_morx_subtable_type5_InsertList_validate( FT_UShort      table_index,\n                                               FT_UShort      count,\n                                               FT_Bytes       table,\n                                               FT_Bytes       limit,\n                                               GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table + table_index * 2;\n\n\n#ifndef GXV_LOAD_TRACE_VARS\n    GXV_LIMIT_CHECK( count * 2 );\n#else\n    while ( p < table + count * 2 + table_index * 2 )\n    {\n      FT_UShort  insert_glyphID;\n\n\n      GXV_LIMIT_CHECK( 2 );\n      insert_glyphID = FT_NEXT_USHORT( p );\n      GXV_TRACE(( \" 0x%04x\", insert_glyphID ));\n    }\n\n    GXV_TRACE(( \"\\n\" ));\n#endif\n  }\n\n\n  static void\n  gxv_morx_subtable_type5_entry_validate(\n    FT_UShort                       state,\n    FT_UShort                       flags,\n    GXV_StateTable_GlyphOffsetCPtr  glyphOffset_p,\n    FT_Bytes                        table,\n    FT_Bytes                        limit,\n    GXV_Validator                   gxvalid )\n  {\n#ifdef GXV_LOAD_UNUSED_VARS\n    FT_Bool    setMark;\n    FT_Bool    dontAdvance;\n    FT_Bool    currentIsKashidaLike;\n    FT_Bool    markedIsKashidaLike;\n    FT_Bool    currentInsertBefore;\n    FT_Bool    markedInsertBefore;\n#endif\n    FT_Byte    currentInsertCount;\n    FT_Byte    markedInsertCount;\n    FT_Byte    currentInsertList;\n    FT_UShort  markedInsertList;\n\n    FT_UNUSED( state );\n\n\n#ifdef GXV_LOAD_UNUSED_VARS\n    setMark              = FT_BOOL( ( flags >> 15 ) & 1 );\n    dontAdvance          = FT_BOOL( ( flags >> 14 ) & 1 );\n    currentIsKashidaLike = FT_BOOL( ( flags >> 13 ) & 1 );\n    markedIsKashidaLike  = FT_BOOL( ( flags >> 12 ) & 1 );\n    currentInsertBefore  = FT_BOOL( ( flags >> 11 ) & 1 );\n    markedInsertBefore   = FT_BOOL( ( flags >> 10 ) & 1 );\n#endif\n\n    currentInsertCount = (FT_Byte)( ( flags >> 5 ) & 0x1F   );\n    markedInsertCount  = (FT_Byte)(   flags        & 0x001F );\n\n    currentInsertList = (FT_Byte)  ( glyphOffset_p->ul >> 16 );\n    markedInsertList  = (FT_UShort)( glyphOffset_p->ul       );\n\n    if ( currentInsertList && 0 != currentInsertCount )\n      gxv_morx_subtable_type5_InsertList_validate( currentInsertList,\n                                                   currentInsertCount,\n                                                   table, limit,\n                                                   gxvalid );\n\n    if ( markedInsertList && 0 != markedInsertCount )\n      gxv_morx_subtable_type5_InsertList_validate( markedInsertList,\n                                                   markedInsertCount,\n                                                   table, limit,\n                                                   gxvalid );\n  }\n\n\n  FT_LOCAL_DEF( void )\n  gxv_morx_subtable_type5_validate( FT_Bytes       table,\n                                    FT_Bytes       limit,\n                                    GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n    GXV_morx_subtable_type5_StateOptRec      et_rec;\n    GXV_morx_subtable_type5_StateOptRecData  et = &et_rec;\n\n\n    GXV_NAME_ENTER( \"morx chain subtable type5 (Glyph Insertion)\" );\n\n    GXV_LIMIT_CHECK( GXV_MORX_SUBTABLE_TYPE5_HEADER_SIZE );\n\n    gxvalid->xstatetable.optdata =\n      et;\n    gxvalid->xstatetable.optdata_load_func =\n      gxv_morx_subtable_type5_insertionGlyphList_load;\n    gxvalid->xstatetable.subtable_setup_func =\n      gxv_morx_subtable_type5_subtable_setup;\n    gxvalid->xstatetable.entry_glyphoffset_fmt =\n      GXV_GLYPHOFFSET_ULONG;\n    gxvalid->xstatetable.entry_validate_func =\n      gxv_morx_subtable_type5_entry_validate;\n\n    gxv_XStateTable_validate( p, limit, gxvalid );\n\n    GXV_EXIT;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvopbd.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvopbd.c                                                              */\n/*                                                                         */\n/*    TrueTypeGX/AAT opbd table validation (body).                         */\n/*                                                                         */\n/*  Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"gxvalid.h\"\n#include \"gxvcommn.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gxvopbd\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      Data and Types                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct  GXV_opbd_DataRec_\n  {\n    FT_UShort  format;\n    FT_UShort  valueOffset_min;\n\n  } GXV_opbd_DataRec, *GXV_opbd_Data;\n\n\n#define GXV_OPBD_DATA( FIELD )  GXV_TABLE_DATA( opbd, FIELD )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      UTILITY FUNCTIONS                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static void\n  gxv_opbd_LookupValue_validate( FT_UShort            glyph,\n                                 GXV_LookupValueCPtr  value_p,\n                                 GXV_Validator        gxvalid )\n  {\n    /* offset in LookupTable is measured from the head of opbd table */\n    FT_Bytes   p     = gxvalid->root->base + value_p->u;\n    FT_Bytes   limit = gxvalid->root->limit;\n    FT_Short   delta_value;\n    int        i;\n\n\n    if ( value_p->u < GXV_OPBD_DATA( valueOffset_min ) )\n      GXV_OPBD_DATA( valueOffset_min ) = value_p->u;\n\n    for ( i = 0; i < 4; i++ )\n    {\n      GXV_LIMIT_CHECK( 2 );\n      delta_value = FT_NEXT_SHORT( p );\n\n      if ( GXV_OPBD_DATA( format ) )    /* format 1, value is ctrl pt. */\n      {\n        if ( delta_value == -1 )\n          continue;\n\n        gxv_ctlPoint_validate( glyph, delta_value, gxvalid );\n      }\n      else                              /* format 0, value is distance */\n        continue;\n    }\n  }\n\n\n  /*\n    opbd ---------------------+\n                              |\n    +===============+         |\n    | lookup header |         |\n    +===============+         |\n    | BinSrchHeader |         |\n    +===============+         |\n    | lastGlyph[0]  |         |\n    +---------------+         |\n    | firstGlyph[0] |         |  head of opbd sfnt table\n    +---------------+         |             +\n    | offset[0]     |    ->   |          offset            [byte]\n    +===============+         |             +\n    | lastGlyph[1]  |         | (glyphID - firstGlyph) * 4 * sizeof(FT_Short) [byte]\n    +---------------+         |\n    | firstGlyph[1] |         |\n    +---------------+         |\n    | offset[1]     |         |\n    +===============+         |\n                              |\n     ....                     |\n                              |\n    48bit value array         |\n    +===============+         |\n    |     value     | <-------+\n    |               |\n    |               |\n    |               |\n    +---------------+\n    .... */\n\n  static GXV_LookupValueDesc\n  gxv_opbd_LookupFmt4_transit( FT_UShort            relative_gindex,\n                               GXV_LookupValueCPtr  base_value_p,\n                               FT_Bytes             lookuptbl_limit,\n                               GXV_Validator        gxvalid )\n  {\n    GXV_LookupValueDesc  value;\n\n    FT_UNUSED( lookuptbl_limit );\n    FT_UNUSED( gxvalid );\n\n    /* XXX: check range? */\n    value.u = (FT_UShort)( base_value_p->u +\n                           relative_gindex * 4 * sizeof ( FT_Short ) );\n\n    return value;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         opbd TABLE                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL_DEF( void )\n  gxv_opbd_validate( FT_Bytes      table,\n                     FT_Face       face,\n                     FT_Validator  ftvalid )\n  {\n    GXV_ValidatorRec  gxvalidrec;\n    GXV_Validator     gxvalid = &gxvalidrec;\n    GXV_opbd_DataRec  opbdrec;\n    GXV_opbd_Data     opbd  = &opbdrec;\n    FT_Bytes          p     = table;\n    FT_Bytes          limit = 0;\n\n    FT_ULong  version;\n\n\n    gxvalid->root       = ftvalid;\n    gxvalid->table_data = opbd;\n    gxvalid->face       = face;\n\n    FT_TRACE3(( \"validating `opbd' table\\n\" ));\n    GXV_INIT;\n    GXV_OPBD_DATA( valueOffset_min ) = 0xFFFFU;\n\n\n    GXV_LIMIT_CHECK( 4 + 2 );\n    version                 = FT_NEXT_ULONG( p );\n    GXV_OPBD_DATA( format ) = FT_NEXT_USHORT( p );\n\n\n    /* only 0x00010000 is defined (1996) */\n    GXV_TRACE(( \"(version=0x%08x)\\n\", version ));\n    if ( 0x00010000UL != version )\n      FT_INVALID_FORMAT;\n\n    /* only values 0 and 1 are defined (1996) */\n    GXV_TRACE(( \"(format=0x%04x)\\n\", GXV_OPBD_DATA( format ) ));\n    if ( 0x0001 < GXV_OPBD_DATA( format ) )\n      FT_INVALID_FORMAT;\n\n    gxvalid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;\n    gxvalid->lookupval_func   = gxv_opbd_LookupValue_validate;\n    gxvalid->lookupfmt4_trans = gxv_opbd_LookupFmt4_transit;\n\n    gxv_LookupTable_validate( p, limit, gxvalid );\n    p += gxvalid->subtable_length;\n\n    if ( p > table + GXV_OPBD_DATA( valueOffset_min ) )\n    {\n      GXV_TRACE((\n        \"found overlap between LookupTable and opbd_value array\\n\" ));\n      FT_INVALID_OFFSET;\n    }\n\n    FT_TRACE4(( \"\\n\" ));\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvprop.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvprop.c                                                              */\n/*                                                                         */\n/*    TrueTypeGX/AAT prop table validation (body).                         */\n/*                                                                         */\n/*  Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"gxvalid.h\"\n#include \"gxvcommn.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gxvprop\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      Data and Types                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#define GXV_PROP_HEADER_SIZE  ( 4 + 2 + 2 )\n#define GXV_PROP_SIZE_MIN     GXV_PROP_HEADER_SIZE\n\n  typedef struct  GXV_prop_DataRec_\n  {\n    FT_Fixed  version;\n\n  } GXV_prop_DataRec, *GXV_prop_Data;\n\n#define GXV_PROP_DATA( field )  GXV_TABLE_DATA( prop, field )\n\n#define GXV_PROP_FLOATER                      0x8000U\n#define GXV_PROP_USE_COMPLEMENTARY_BRACKET    0x1000U\n#define GXV_PROP_COMPLEMENTARY_BRACKET_OFFSET 0x0F00U\n#define GXV_PROP_ATTACHING_TO_RIGHT           0x0080U\n#define GXV_PROP_RESERVED                     0x0060U\n#define GXV_PROP_DIRECTIONALITY_CLASS         0x001FU\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      UTILITY FUNCTIONS                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static void\n  gxv_prop_zero_advance_validate( FT_UShort      gid,\n                                  GXV_Validator  gxvalid )\n  {\n    FT_Face       face;\n    FT_Error      error;\n    FT_GlyphSlot  glyph;\n\n\n    GXV_NAME_ENTER( \"zero advance\" );\n\n    face = gxvalid->face;\n\n    error = FT_Load_Glyph( face,\n                           gid,\n                           FT_LOAD_IGNORE_TRANSFORM );\n    if ( error )\n      FT_INVALID_GLYPH_ID;\n\n    glyph = face->glyph;\n\n    if ( glyph->advance.x != (FT_Pos)0 ||\n         glyph->advance.y != (FT_Pos)0 )\n    {\n      GXV_TRACE(( \"  found non-zero advance in zero-advance glyph\\n\" ));\n      FT_INVALID_DATA;\n    }\n\n    GXV_EXIT;\n  }\n\n\n  /* Pass 0 as GLYPH to check the default property */\n  static void\n  gxv_prop_property_validate( FT_UShort      property,\n                              FT_UShort      glyph,\n                              GXV_Validator  gxvalid )\n  {\n    if ( glyph != 0 && ( property & GXV_PROP_FLOATER ) )\n      gxv_prop_zero_advance_validate( glyph, gxvalid );\n\n    if ( property & GXV_PROP_USE_COMPLEMENTARY_BRACKET )\n    {\n      FT_UShort  offset;\n      char       complement;\n\n\n      offset = (FT_UShort)( property & GXV_PROP_COMPLEMENTARY_BRACKET_OFFSET );\n      if ( offset == 0 )\n      {\n        GXV_TRACE(( \"  found zero offset to property\\n\" ));\n        FT_INVALID_OFFSET;\n      }\n\n      complement = (char)( offset >> 8 );\n      if ( complement & 0x08 )\n      {\n        /* Top bit is set: negative */\n\n        /* Calculate the absolute offset */\n        complement = (char)( ( complement & 0x07 ) + 1 );\n\n        /* The gid for complement must be greater than 0 */\n        if ( glyph <= complement )\n        {\n          GXV_TRACE(( \"  found non-positive glyph complement\\n\" ));\n          FT_INVALID_DATA;\n        }\n      }\n      else\n      {\n        /* The gid for complement must be the face. */\n        gxv_glyphid_validate( (FT_UShort)( glyph + complement ), gxvalid );\n      }\n    }\n    else\n    {\n      if ( property & GXV_PROP_COMPLEMENTARY_BRACKET_OFFSET )\n        GXV_TRACE(( \"glyph %d cannot have complementary bracketing\\n\",\n                    glyph ));\n    }\n\n    /* this is introduced in version 2.0 */\n    if ( property & GXV_PROP_ATTACHING_TO_RIGHT )\n    {\n      if ( GXV_PROP_DATA( version ) == 0x00010000UL )\n      {\n        GXV_TRACE(( \"  found older version (1.0) in new version table\\n\" ));\n        FT_INVALID_DATA;\n      }\n    }\n\n    if ( property & GXV_PROP_RESERVED )\n    {\n      GXV_TRACE(( \"  found non-zero bits in reserved bits\\n\" ));\n      FT_INVALID_DATA;\n    }\n\n    if ( ( property & GXV_PROP_DIRECTIONALITY_CLASS ) > 11 )\n    {\n      /* TODO: Too restricted. Use the validation level. */\n      if ( GXV_PROP_DATA( version ) == 0x00010000UL ||\n           GXV_PROP_DATA( version ) == 0x00020000UL )\n      {\n        GXV_TRACE(( \"  found too old version in directionality class\\n\" ));\n        FT_INVALID_DATA;\n      }\n    }\n  }\n\n\n  static void\n  gxv_prop_LookupValue_validate( FT_UShort            glyph,\n                                 GXV_LookupValueCPtr  value_p,\n                                 GXV_Validator        gxvalid )\n  {\n    gxv_prop_property_validate( value_p->u, glyph, gxvalid );\n  }\n\n\n  /*\n    +===============+ --------+\n    | lookup header |         |\n    +===============+         |\n    | BinSrchHeader |         |\n    +===============+         |\n    | lastGlyph[0]  |         |\n    +---------------+         |\n    | firstGlyph[0] |         |    head of lookup table\n    +---------------+         |             +\n    | offset[0]     |    ->   |          offset            [byte]\n    +===============+         |             +\n    | lastGlyph[1]  |         | (glyphID - firstGlyph) * 2 [byte]\n    +---------------+         |\n    | firstGlyph[1] |         |\n    +---------------+         |\n    | offset[1]     |         |\n    +===============+         |\n                              |\n     ...                      |\n                              |\n    16bit value array         |\n    +===============+         |\n    |     value     | <-------+\n    ...\n  */\n\n  static GXV_LookupValueDesc\n  gxv_prop_LookupFmt4_transit( FT_UShort            relative_gindex,\n                               GXV_LookupValueCPtr  base_value_p,\n                               FT_Bytes             lookuptbl_limit,\n                               GXV_Validator        gxvalid )\n  {\n    FT_Bytes             p;\n    FT_Bytes             limit;\n    FT_UShort            offset;\n    GXV_LookupValueDesc  value;\n\n    /* XXX: check range? */\n    offset = (FT_UShort)( base_value_p->u +\n                          relative_gindex * sizeof ( FT_UShort ) );\n    p      = gxvalid->lookuptbl_head + offset;\n    limit  = lookuptbl_limit;\n\n    GXV_LIMIT_CHECK ( 2 );\n    value.u = FT_NEXT_USHORT( p );\n\n    return value;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         prop TABLE                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL_DEF( void )\n  gxv_prop_validate( FT_Bytes      table,\n                     FT_Face       face,\n                     FT_Validator  ftvalid )\n  {\n    FT_Bytes          p     = table;\n    FT_Bytes          limit = 0;\n    GXV_ValidatorRec  gxvalidrec;\n    GXV_Validator     gxvalid = &gxvalidrec;\n\n    GXV_prop_DataRec  proprec;\n    GXV_prop_Data     prop = &proprec;\n\n    FT_Fixed          version;\n    FT_UShort         format;\n    FT_UShort         defaultProp;\n\n\n    gxvalid->root       = ftvalid;\n    gxvalid->table_data = prop;\n    gxvalid->face       = face;\n\n    FT_TRACE3(( \"validating `prop' table\\n\" ));\n    GXV_INIT;\n\n    GXV_LIMIT_CHECK( 4 + 2 + 2 );\n    version     = FT_NEXT_ULONG( p );\n    format      = FT_NEXT_USHORT( p );\n    defaultProp = FT_NEXT_USHORT( p );\n\n    GXV_TRACE(( \"  version 0x%08x\\n\", version ));\n    GXV_TRACE(( \"  format  0x%04x\\n\", format ));\n    GXV_TRACE(( \"  defaultProp  0x%04x\\n\", defaultProp ));\n\n    /* only versions 1.0, 2.0, 3.0 are defined (1996) */\n    if ( version != 0x00010000UL &&\n         version != 0x00020000UL &&\n         version != 0x00030000UL )\n    {\n      GXV_TRACE(( \"  found unknown version\\n\" ));\n      FT_INVALID_FORMAT;\n    }\n\n\n    /* only formats 0x0000, 0x0001 are defined (1996) */\n    if ( format > 1 )\n    {\n      GXV_TRACE(( \"  found unknown format\\n\" ));\n      FT_INVALID_FORMAT;\n    }\n\n    gxv_prop_property_validate( defaultProp, 0, gxvalid );\n\n    if ( format == 0 )\n    {\n      FT_TRACE3(( \"(format 0, no per-glyph properties, \"\n                  \"remaining %d bytes are skipped)\", limit - p ));\n      goto Exit;\n    }\n\n    /* format == 1 */\n    GXV_PROP_DATA( version ) = version;\n\n    gxvalid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;\n    gxvalid->lookupval_func   = gxv_prop_LookupValue_validate;\n    gxvalid->lookupfmt4_trans = gxv_prop_LookupFmt4_transit;\n\n    gxv_LookupTable_validate( p, limit, gxvalid );\n\n  Exit:\n    FT_TRACE4(( \"\\n\" ));\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/gxvtrak.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  gxvtrak.c                                                              */\n/*                                                                         */\n/*    TrueTypeGX/AAT trak table validation (body).                         */\n/*                                                                         */\n/*  Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"gxvalid.h\"\n#include \"gxvcommn.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_gxvtrak\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      Data and Types                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n    /*\n     * referred track table format specification:\n     * http://developer.apple.com/fonts/TTRefMan/RM06/Chap6trak.html\n     * last update was 1996.\n     * ----------------------------------------------\n     * [MINIMUM HEADER]: GXV_TRAK_SIZE_MIN\n     * version          (fixed:  32bit) = 0x00010000\n     * format           (uint16: 16bit) = 0 is only defined (1996)\n     * horizOffset      (uint16: 16bit)\n     * vertOffset       (uint16: 16bit)\n     * reserved         (uint16: 16bit) = 0\n     * ----------------------------------------------\n     * [VARIABLE BODY]:\n     * horizData\n     *   header         ( 2 + 2 + 4\n     *   trackTable       + nTracks * ( 4 + 2 + 2 )\n     *   sizeTable        + nSizes * 4 )\n     * ----------------------------------------------\n     * vertData\n     *   header         ( 2 + 2 + 4\n     *   trackTable       + nTracks * ( 4 + 2 + 2 )\n     *   sizeTable        + nSizes * 4 )\n     * ----------------------------------------------\n     */\n  typedef struct  GXV_trak_DataRec_\n  {\n    FT_UShort  trackValueOffset_min;\n    FT_UShort  trackValueOffset_max;\n\n  } GXV_trak_DataRec, *GXV_trak_Data;\n\n\n#define GXV_TRAK_DATA( FIELD )  GXV_TABLE_DATA( trak, FIELD )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      UTILITY FUNCTIONS                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static void\n  gxv_trak_trackTable_validate( FT_Bytes       table,\n                                FT_Bytes       limit,\n                                FT_UShort      nTracks,\n                                GXV_Validator  gxvalid )\n  {\n    FT_Bytes  p = table;\n\n    FT_Fixed   track, t;\n    FT_UShort  nameIndex;\n    FT_UShort  offset;\n    FT_UShort  i, j;\n\n\n    GXV_NAME_ENTER( \"trackTable\" );\n\n    GXV_TRAK_DATA( trackValueOffset_min ) = 0xFFFFU;\n    GXV_TRAK_DATA( trackValueOffset_max ) = 0x0000;\n\n    GXV_LIMIT_CHECK( nTracks * ( 4 + 2 + 2 ) );\n\n    for ( i = 0; i < nTracks; i ++ )\n    {\n      p = table + i * ( 4 + 2 + 2 );\n      track     = FT_NEXT_LONG( p );\n      nameIndex = FT_NEXT_USHORT( p );\n      offset    = FT_NEXT_USHORT( p );\n\n      if ( offset < GXV_TRAK_DATA( trackValueOffset_min ) )\n        GXV_TRAK_DATA( trackValueOffset_min ) = offset;\n      if ( offset > GXV_TRAK_DATA( trackValueOffset_max ) )\n        GXV_TRAK_DATA( trackValueOffset_max ) = offset;\n\n      gxv_sfntName_validate( nameIndex, 256, 32767, gxvalid );\n\n      for ( j = i; j < nTracks; j ++ )\n      {\n         p = table + j * ( 4 + 2 + 2 );\n         t = FT_NEXT_LONG( p );\n         if ( t == track )\n           GXV_TRACE(( \"duplicated entries found for track value 0x%x\\n\",\n                        track ));\n      }\n    }\n\n    gxvalid->subtable_length = p - table;\n    GXV_EXIT;\n  }\n\n\n  static void\n  gxv_trak_trackData_validate( FT_Bytes       table,\n                               FT_Bytes       limit,\n                               GXV_Validator  gxvalid )\n  {\n    FT_Bytes   p = table;\n    FT_UShort  nTracks;\n    FT_UShort  nSizes;\n    FT_ULong   sizeTableOffset;\n\n    GXV_ODTECT( 4, odtect );\n\n\n    GXV_ODTECT_INIT( odtect );\n    GXV_NAME_ENTER( \"trackData\" );\n\n    /* read the header of trackData */\n    GXV_LIMIT_CHECK( 2 + 2 + 4 );\n    nTracks         = FT_NEXT_USHORT( p );\n    nSizes          = FT_NEXT_USHORT( p );\n    sizeTableOffset = FT_NEXT_ULONG( p );\n\n    gxv_odtect_add_range( table, p - table, \"trackData header\", odtect );\n\n    /* validate trackTable */\n    gxv_trak_trackTable_validate( p, limit, nTracks, gxvalid );\n    gxv_odtect_add_range( p, gxvalid->subtable_length,\n                          \"trackTable\", odtect );\n\n    /* sizeTable is array of FT_Fixed, don't check contents */\n    p = gxvalid->root->base + sizeTableOffset;\n    GXV_LIMIT_CHECK( nSizes * 4 );\n    gxv_odtect_add_range( p, nSizes * 4, \"sizeTable\", odtect );\n\n    /* validate trackValueOffet */\n    p = gxvalid->root->base + GXV_TRAK_DATA( trackValueOffset_min );\n    if ( limit - p < nTracks * nSizes * 2 )\n      GXV_TRACE(( \"too short trackValue array\\n\" ));\n\n    p = gxvalid->root->base + GXV_TRAK_DATA( trackValueOffset_max );\n    GXV_LIMIT_CHECK( nSizes * 2 );\n\n    gxv_odtect_add_range( gxvalid->root->base\n                            + GXV_TRAK_DATA( trackValueOffset_min ),\n                          GXV_TRAK_DATA( trackValueOffset_max )\n                            - GXV_TRAK_DATA( trackValueOffset_min )\n                            + nSizes * 2,\n                          \"trackValue array\", odtect );\n\n    gxv_odtect_validate( odtect, gxvalid );\n\n    GXV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                          trak TABLE                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL_DEF( void )\n  gxv_trak_validate( FT_Bytes      table,\n                     FT_Face       face,\n                     FT_Validator  ftvalid )\n  {\n    FT_Bytes          p = table;\n    FT_Bytes          limit = 0;\n\n    GXV_ValidatorRec  gxvalidrec;\n    GXV_Validator     gxvalid = &gxvalidrec;\n    GXV_trak_DataRec  trakrec;\n    GXV_trak_Data     trak = &trakrec;\n\n    FT_ULong   version;\n    FT_UShort  format;\n    FT_UShort  horizOffset;\n    FT_UShort  vertOffset;\n    FT_UShort  reserved;\n\n\n    GXV_ODTECT( 3, odtect );\n\n    GXV_ODTECT_INIT( odtect );\n    gxvalid->root       = ftvalid;\n    gxvalid->table_data = trak;\n    gxvalid->face       = face;\n\n    limit      = gxvalid->root->limit;\n\n    FT_TRACE3(( \"validating `trak' table\\n\" ));\n    GXV_INIT;\n\n    GXV_LIMIT_CHECK( 4 + 2 + 2 + 2 + 2 );\n    version     = FT_NEXT_ULONG( p );\n    format      = FT_NEXT_USHORT( p );\n    horizOffset = FT_NEXT_USHORT( p );\n    vertOffset  = FT_NEXT_USHORT( p );\n    reserved    = FT_NEXT_USHORT( p );\n\n    GXV_TRACE(( \" (version = 0x%08x)\\n\", version ));\n    GXV_TRACE(( \" (format = 0x%04x)\\n\", format ));\n    GXV_TRACE(( \" (horizOffset = 0x%04x)\\n\", horizOffset ));\n    GXV_TRACE(( \" (vertOffset = 0x%04x)\\n\", vertOffset ));\n    GXV_TRACE(( \" (reserved = 0x%04x)\\n\", reserved ));\n\n    /* Version 1.0 (always:1996) */\n    if ( version != 0x00010000UL )\n      FT_INVALID_FORMAT;\n\n    /* format 0 (always:1996) */\n    if ( format != 0x0000 )\n      FT_INVALID_FORMAT;\n\n    GXV_32BIT_ALIGNMENT_VALIDATE( horizOffset );\n    GXV_32BIT_ALIGNMENT_VALIDATE( vertOffset );\n\n    /* Reserved Fixed Value (always) */\n    if ( reserved != 0x0000 )\n      FT_INVALID_DATA;\n\n    /* validate trackData */\n    if ( 0 < horizOffset )\n    {\n      gxv_trak_trackData_validate( table + horizOffset, limit, gxvalid );\n      gxv_odtect_add_range( table + horizOffset, gxvalid->subtable_length,\n                            \"horizJustData\", odtect );\n    }\n\n    if ( 0 < vertOffset )\n    {\n      gxv_trak_trackData_validate( table + vertOffset, limit, gxvalid );\n      gxv_odtect_add_range( table + vertOffset, gxvalid->subtable_length,\n                            \"vertJustData\", odtect );\n    }\n\n    gxv_odtect_validate( odtect, gxvalid );\n\n    FT_TRACE4(( \"\\n\" ));\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/module.mk",
    "content": "#\n# FreeType 2 gxvalid module definition\n#\n\n# Copyright 2004, 2005, 2006\n#   by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,\n#   David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\nFTMODULE_H_COMMANDS += GXVALID_MODULE\n\ndefine GXVALID_MODULE\n$(OPEN_DRIVER) FT_Module_Class, gxv_module_class $(CLOSE_DRIVER)\n$(ECHO_DRIVER)gxvalid   $(ECHO_DRIVER_DESC)TrueTypeGX/AAT validation module$(ECHO_DRIVER_DONE)\nendef\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/gxvalid/rules.mk",
    "content": "#\n# FreeType 2 TrueTypeGX/AAT validation driver configuration rules\n#\n\n\n# Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\n# GXV driver directory\n#\nGXV_DIR := $(SRC_DIR)/gxvalid\n\n\n# compilation flags for the driver\n#\nGXV_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(GXV_DIR))\n\n\n# GXV driver sources (i.e., C files)\n#\nGXV_DRV_SRC := $(GXV_DIR)/gxvcommn.c \\\n               $(GXV_DIR)/gxvfeat.c  \\\n               $(GXV_DIR)/gxvbsln.c  \\\n               $(GXV_DIR)/gxvtrak.c  \\\n               $(GXV_DIR)/gxvopbd.c  \\\n               $(GXV_DIR)/gxvprop.c  \\\n               $(GXV_DIR)/gxvjust.c  \\\n               $(GXV_DIR)/gxvmort.c  \\\n               $(GXV_DIR)/gxvmort0.c \\\n               $(GXV_DIR)/gxvmort1.c \\\n               $(GXV_DIR)/gxvmort2.c \\\n               $(GXV_DIR)/gxvmort4.c \\\n               $(GXV_DIR)/gxvmort5.c \\\n               $(GXV_DIR)/gxvmorx.c  \\\n               $(GXV_DIR)/gxvmorx0.c \\\n               $(GXV_DIR)/gxvmorx1.c \\\n               $(GXV_DIR)/gxvmorx2.c \\\n               $(GXV_DIR)/gxvmorx4.c \\\n               $(GXV_DIR)/gxvmorx5.c \\\n               $(GXV_DIR)/gxvlcar.c  \\\n               $(GXV_DIR)/gxvkern.c  \\\n               $(GXV_DIR)/gxvmod.c\n\n# GXV driver headers\n#\nGXV_DRV_H := $(GXV_DIR)/gxvalid.h  \\\n             $(GXV_DIR)/gxverror.h \\\n             $(GXV_DIR)/gxvcommn.h \\\n             $(GXV_DIR)/gxvfeat.h  \\\n             $(GXV_DIR)/gxvmod.h   \\\n             $(GXV_DIR)/gxvmort.h  \\\n             $(GXV_DIR)/gxvmorx.h\n\n\n# GXV driver object(s)\n#\n#   GXV_DRV_OBJ_M is used during `multi' builds.\n#   GXV_DRV_OBJ_S is used during `single' builds.\n#\nGXV_DRV_OBJ_M := $(GXV_DRV_SRC:$(GXV_DIR)/%.c=$(OBJ_DIR)/%.$O)\nGXV_DRV_OBJ_S := $(OBJ_DIR)/gxvalid.$O\n\n# GXV driver source file for single build\n#\nGXV_DRV_SRC_S := $(GXV_DIR)/gxvalid.c\n\n\n# GXV driver - single object\n#\n$(GXV_DRV_OBJ_S): $(GXV_DRV_SRC_S) $(GXV_DRV_SRC) \\\n                   $(FREETYPE_H) $(GXV_DRV_H)\n\t$(GXV_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(GXV_DRV_SRC_S))\n\n\n# GXV driver - multiple objects\n#\n$(OBJ_DIR)/%.$O: $(GXV_DIR)/%.c $(FREETYPE_H) $(GXV_DRV_H)\n\t$(GXV_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\n\n\n# update main driver object lists\n#\nDRV_OBJS_S += $(GXV_DRV_OBJ_S)\nDRV_OBJS_M += $(GXV_DRV_OBJ_M)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/gzip/Jamfile",
    "content": "# FreeType 2 src/gzip Jamfile\n#\n# Copyright 2001 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) gzip ;\n\nLibrary  $(FT2_LIB) : ftgzip.c ;\n\n# end of src/pcf Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/gzip/adler32.c",
    "content": "/* adler32.c -- compute the Adler-32 checksum of a data stream\n * Copyright (C) 1995-2002 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/* @(#) $Id$ */\n\n#include \"zlib.h\"\n\n#define BASE 65521L /* largest prime smaller than 65536 */\n#define NMAX 5552\n/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */\n\n#define DO1(buf,i)  {s1 += buf[i]; s2 += s1;}\n#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);\n#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);\n#define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);\n#define DO16(buf)   DO8(buf,0); DO8(buf,8);\n\n/* ========================================================================= */\nZEXPORT(uLong) adler32( /* adler, buf, len) */\n    uLong adler,\n    const Bytef *buf,\n    uInt len )\n{\n    unsigned long s1 = adler & 0xffff;\n    unsigned long s2 = (adler >> 16) & 0xffff;\n    int k;\n\n    if (buf == Z_NULL) return 1L;\n\n    while (len > 0) {\n        k = len < NMAX ? len : NMAX;\n        len -= k;\n        while (k >= 16) {\n            DO16(buf);\n            buf += 16;\n            k -= 16;\n        }\n        if (k != 0) do {\n            s1 += *buf++;\n            s2 += s1;\n        } while (--k);\n        s1 %= BASE;\n        s2 %= BASE;\n    }\n    return (s2 << 16) | s1;\n}\n"
  },
  {
    "path": "ext/freetype2/src/gzip/ftgzip.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgzip.c                                                               */\n/*                                                                         */\n/*    FreeType support for .gz compressed files.                           */\n/*                                                                         */\n/*  This optional component relies on zlib.  It should mainly be used to   */\n/*  parse compressed PCF fonts, as found with many X11 server              */\n/*  distributions.                                                         */\n/*                                                                         */\n/*  Copyright 2002-2006, 2009-2014 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_MEMORY_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_GZIP_H\n#include FT_CONFIG_STANDARD_LIBRARY_H\n\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  Gzip_Err_\n#define FT_ERR_BASE    FT_Mod_Err_Gzip\n\n#include FT_ERRORS_H\n\n\n#ifdef FT_CONFIG_OPTION_USE_ZLIB\n\n#ifdef FT_CONFIG_OPTION_PIC\n#error \"gzip code does not support PIC yet\"\n#endif\n\n#ifdef FT_CONFIG_OPTION_SYSTEM_ZLIB\n\n#include <zlib.h>\n\n#else /* !FT_CONFIG_OPTION_SYSTEM_ZLIB */\n\n /* In this case, we include our own modified sources of the ZLib    */\n /* within the \"ftgzip\" component.  The modifications were necessary */\n /* to #include all files without conflicts, as well as preventing   */\n /* the definition of \"extern\" functions that may cause linking      */\n /* conflicts when a program is linked with both FreeType and the    */\n /* original ZLib.                                                   */\n\n#define NO_DUMMY_DECL\n#ifndef USE_ZLIB_ZCALLOC\n#define MY_ZCALLOC /* prevent all zcalloc() & zfree() in zutils.c */\n#endif\n\n#include \"zlib.h\"\n\n#undef  SLOW\n#define SLOW  1  /* we can't use asm-optimized sources here! */\n\n#if defined( _MSC_VER )      /* Visual C++ (and Intel C++)   */\n  /* We disable the warning `conversion from XXX to YYY,     */\n  /* possible loss of data' in order to compile cleanly with */\n  /* the maximum level of warnings: zlib is non-FreeType     */\n  /* code.                                                   */\n#pragma warning( push )\n#pragma warning( disable : 4244 )\n#endif /* _MSC_VER */\n\n  /* Urgh.  `inflate_mask' must not be declared twice -- C++ doesn't like\n     this.  We temporarily disable it and load all necessary header files. */\n#define NO_INFLATE_MASK\n#include \"zutil.h\"\n#include \"inftrees.h\"\n#include \"infblock.h\"\n#include \"infcodes.h\"\n#include \"infutil.h\"\n#undef  NO_INFLATE_MASK\n\n  /* infutil.c must be included before infcodes.c */\n#include \"zutil.c\"\n#include \"inftrees.c\"\n#include \"infutil.c\"\n#include \"infcodes.c\"\n#include \"infblock.c\"\n#include \"inflate.c\"\n#include \"adler32.c\"\n\n#if defined( _MSC_VER )\n#pragma warning( pop )\n#endif\n\n#endif /* !FT_CONFIG_OPTION_SYSTEM_ZLIB */\n\n\n/***************************************************************************/\n/***************************************************************************/\n/*****                                                                 *****/\n/*****            Z L I B   M E M O R Y   M A N A G E M E N T          *****/\n/*****                                                                 *****/\n/***************************************************************************/\n/***************************************************************************/\n\n  /* it is better to use FreeType memory routines instead of raw\n     'malloc/free' */\n\n  static voidpf\n  ft_gzip_alloc( FT_Memory  memory,\n                 uInt       items,\n                 uInt       size )\n  {\n    FT_ULong    sz = (FT_ULong)size * items;\n    FT_Error    error;\n    FT_Pointer  p  = NULL;\n\n\n    (void)FT_ALLOC( p, sz );\n    return p;\n  }\n\n\n  static void\n  ft_gzip_free( FT_Memory  memory,\n                voidpf     address )\n  {\n    FT_MEM_FREE( address );\n  }\n\n\n#if !defined( FT_CONFIG_OPTION_SYSTEM_ZLIB ) && !defined( USE_ZLIB_ZCALLOC )\n\n  local voidpf\n  zcalloc ( voidpf    opaque,\n            unsigned  items,\n            unsigned  size )\n  {\n    return ft_gzip_alloc( (FT_Memory)opaque, items, size );\n  }\n\n  local void\n  zcfree( voidpf  opaque,\n          voidpf  ptr )\n  {\n    ft_gzip_free( (FT_Memory)opaque, ptr );\n  }\n\n#endif /* !SYSTEM_ZLIB && !USE_ZLIB_ZCALLOC */\n\n\n/***************************************************************************/\n/***************************************************************************/\n/*****                                                                 *****/\n/*****               Z L I B   F I L E   D E S C R I P T O R           *****/\n/*****                                                                 *****/\n/***************************************************************************/\n/***************************************************************************/\n\n#define FT_GZIP_BUFFER_SIZE  4096\n\n  typedef struct  FT_GZipFileRec_\n  {\n    FT_Stream  source;         /* parent/source stream        */\n    FT_Stream  stream;         /* embedding stream            */\n    FT_Memory  memory;         /* memory allocator            */\n    z_stream   zstream;        /* zlib input stream           */\n\n    FT_ULong   start;          /* starting position, after .gz header */\n    FT_Byte    input[FT_GZIP_BUFFER_SIZE];   /* input read buffer  */\n\n    FT_Byte    buffer[FT_GZIP_BUFFER_SIZE];  /* output buffer      */\n    FT_ULong   pos;                          /* position in output */\n    FT_Byte*   cursor;\n    FT_Byte*   limit;\n\n  } FT_GZipFileRec, *FT_GZipFile;\n\n\n  /* gzip flag byte */\n#define FT_GZIP_ASCII_FLAG   0x01 /* bit 0 set: file probably ascii text */\n#define FT_GZIP_HEAD_CRC     0x02 /* bit 1 set: header CRC present */\n#define FT_GZIP_EXTRA_FIELD  0x04 /* bit 2 set: extra field present */\n#define FT_GZIP_ORIG_NAME    0x08 /* bit 3 set: original file name present */\n#define FT_GZIP_COMMENT      0x10 /* bit 4 set: file comment present */\n#define FT_GZIP_RESERVED     0xE0 /* bits 5..7: reserved */\n\n\n  /* check and skip .gz header - we don't support `transparent' compression */\n  static FT_Error\n  ft_gzip_check_header( FT_Stream  stream )\n  {\n    FT_Error  error;\n    FT_Byte   head[4];\n\n\n    if ( FT_STREAM_SEEK( 0 )       ||\n         FT_STREAM_READ( head, 4 ) )\n      goto Exit;\n\n    /* head[0] && head[1] are the magic numbers;    */\n    /* head[2] is the method, and head[3] the flags */\n    if ( head[0] != 0x1F              ||\n         head[1] != 0x8B              ||\n         head[2] != Z_DEFLATED        ||\n        (head[3] & FT_GZIP_RESERVED)  )\n    {\n      error = FT_THROW( Invalid_File_Format );\n      goto Exit;\n    }\n\n    /* skip time, xflags and os code */\n    (void)FT_STREAM_SKIP( 6 );\n\n    /* skip the extra field */\n    if ( head[3] & FT_GZIP_EXTRA_FIELD )\n    {\n      FT_UInt  len;\n\n\n      if ( FT_READ_USHORT_LE( len ) ||\n           FT_STREAM_SKIP( len )    )\n        goto Exit;\n    }\n\n    /* skip original file name */\n    if ( head[3] & FT_GZIP_ORIG_NAME )\n      for (;;)\n      {\n        FT_UInt  c;\n\n\n        if ( FT_READ_BYTE( c ) )\n          goto Exit;\n\n        if ( c == 0 )\n          break;\n      }\n\n    /* skip .gz comment */\n    if ( head[3] & FT_GZIP_COMMENT )\n      for (;;)\n      {\n        FT_UInt  c;\n\n\n        if ( FT_READ_BYTE( c ) )\n          goto Exit;\n\n        if ( c == 0 )\n          break;\n      }\n\n    /* skip CRC */\n    if ( head[3] & FT_GZIP_HEAD_CRC )\n      if ( FT_STREAM_SKIP( 2 ) )\n        goto Exit;\n\n  Exit:\n    return error;\n  }\n\n\n  static FT_Error\n  ft_gzip_file_init( FT_GZipFile  zip,\n                     FT_Stream    stream,\n                     FT_Stream    source )\n  {\n    z_stream*  zstream = &zip->zstream;\n    FT_Error   error   = FT_Err_Ok;\n\n\n    zip->stream = stream;\n    zip->source = source;\n    zip->memory = stream->memory;\n\n    zip->limit  = zip->buffer + FT_GZIP_BUFFER_SIZE;\n    zip->cursor = zip->limit;\n    zip->pos    = 0;\n\n    /* check and skip .gz header */\n    {\n      stream = source;\n\n      error = ft_gzip_check_header( stream );\n      if ( error )\n        goto Exit;\n\n      zip->start = FT_STREAM_POS();\n    }\n\n    /* initialize zlib -- there is no zlib header in the compressed stream */\n    zstream->zalloc = (alloc_func)ft_gzip_alloc;\n    zstream->zfree  = (free_func) ft_gzip_free;\n    zstream->opaque = stream->memory;\n\n    zstream->avail_in = 0;\n    zstream->next_in  = zip->buffer;\n\n    if ( inflateInit2( zstream, -MAX_WBITS ) != Z_OK ||\n         zstream->next_in == NULL                     )\n      error = FT_THROW( Invalid_File_Format );\n\n  Exit:\n    return error;\n  }\n\n\n  static void\n  ft_gzip_file_done( FT_GZipFile  zip )\n  {\n    z_stream*  zstream = &zip->zstream;\n\n\n    inflateEnd( zstream );\n\n    /* clear the rest */\n    zstream->zalloc    = NULL;\n    zstream->zfree     = NULL;\n    zstream->opaque    = NULL;\n    zstream->next_in   = NULL;\n    zstream->next_out  = NULL;\n    zstream->avail_in  = 0;\n    zstream->avail_out = 0;\n\n    zip->memory = NULL;\n    zip->source = NULL;\n    zip->stream = NULL;\n  }\n\n\n  static FT_Error\n  ft_gzip_file_reset( FT_GZipFile  zip )\n  {\n    FT_Stream  stream = zip->source;\n    FT_Error   error;\n\n\n    if ( !FT_STREAM_SEEK( zip->start ) )\n    {\n      z_stream*  zstream = &zip->zstream;\n\n\n      inflateReset( zstream );\n\n      zstream->avail_in  = 0;\n      zstream->next_in   = zip->input;\n      zstream->avail_out = 0;\n      zstream->next_out  = zip->buffer;\n\n      zip->limit  = zip->buffer + FT_GZIP_BUFFER_SIZE;\n      zip->cursor = zip->limit;\n      zip->pos    = 0;\n    }\n\n    return error;\n  }\n\n\n  static FT_Error\n  ft_gzip_file_fill_input( FT_GZipFile  zip )\n  {\n    z_stream*  zstream = &zip->zstream;\n    FT_Stream  stream  = zip->source;\n    FT_ULong   size;\n\n\n    if ( stream->read )\n    {\n      size = stream->read( stream, stream->pos, zip->input,\n                           FT_GZIP_BUFFER_SIZE );\n      if ( size == 0 )\n        return FT_THROW( Invalid_Stream_Operation );\n    }\n    else\n    {\n      size = stream->size - stream->pos;\n      if ( size > FT_GZIP_BUFFER_SIZE )\n        size = FT_GZIP_BUFFER_SIZE;\n\n      if ( size == 0 )\n        return FT_THROW( Invalid_Stream_Operation );\n\n      FT_MEM_COPY( zip->input, stream->base + stream->pos, size );\n    }\n    stream->pos += size;\n\n    zstream->next_in  = zip->input;\n    zstream->avail_in = size;\n\n    return FT_Err_Ok;\n  }\n\n\n  static FT_Error\n  ft_gzip_file_fill_output( FT_GZipFile  zip )\n  {\n    z_stream*  zstream = &zip->zstream;\n    FT_Error   error   = FT_Err_Ok;\n\n\n    zip->cursor        = zip->buffer;\n    zstream->next_out  = zip->cursor;\n    zstream->avail_out = FT_GZIP_BUFFER_SIZE;\n\n    while ( zstream->avail_out > 0 )\n    {\n      int  err;\n\n\n      if ( zstream->avail_in == 0 )\n      {\n        error = ft_gzip_file_fill_input( zip );\n        if ( error )\n          break;\n      }\n\n      err = inflate( zstream, Z_NO_FLUSH );\n\n      if ( err == Z_STREAM_END )\n      {\n        zip->limit = zstream->next_out;\n        if ( zip->limit == zip->cursor )\n          error = FT_THROW( Invalid_Stream_Operation );\n        break;\n      }\n      else if ( err != Z_OK )\n      {\n        error = FT_THROW( Invalid_Stream_Operation );\n        break;\n      }\n    }\n\n    return error;\n  }\n\n\n  /* fill output buffer; `count' must be <= FT_GZIP_BUFFER_SIZE */\n  static FT_Error\n  ft_gzip_file_skip_output( FT_GZipFile  zip,\n                            FT_ULong     count )\n  {\n    FT_Error  error = FT_Err_Ok;\n    FT_ULong  delta;\n\n\n    for (;;)\n    {\n      delta = (FT_ULong)( zip->limit - zip->cursor );\n      if ( delta >= count )\n        delta = count;\n\n      zip->cursor += delta;\n      zip->pos    += delta;\n\n      count -= delta;\n      if ( count == 0 )\n        break;\n\n      error = ft_gzip_file_fill_output( zip );\n      if ( error )\n        break;\n    }\n\n    return error;\n  }\n\n\n  static FT_ULong\n  ft_gzip_file_io( FT_GZipFile  zip,\n                   FT_ULong     pos,\n                   FT_Byte*     buffer,\n                   FT_ULong     count )\n  {\n    FT_ULong  result = 0;\n    FT_Error  error;\n\n\n    /* Reset inflate stream if we're seeking backwards.        */\n    /* Yes, that is not too efficient, but it saves memory :-) */\n    if ( pos < zip->pos )\n    {\n      error = ft_gzip_file_reset( zip );\n      if ( error )\n        goto Exit;\n    }\n\n    /* skip unwanted bytes */\n    if ( pos > zip->pos )\n    {\n      error = ft_gzip_file_skip_output( zip, (FT_ULong)( pos - zip->pos ) );\n      if ( error )\n        goto Exit;\n    }\n\n    if ( count == 0 )\n      goto Exit;\n\n    /* now read the data */\n    for (;;)\n    {\n      FT_ULong  delta;\n\n\n      delta = (FT_ULong)( zip->limit - zip->cursor );\n      if ( delta >= count )\n        delta = count;\n\n      FT_MEM_COPY( buffer, zip->cursor, delta );\n      buffer      += delta;\n      result      += delta;\n      zip->cursor += delta;\n      zip->pos    += delta;\n\n      count -= delta;\n      if ( count == 0 )\n        break;\n\n      error = ft_gzip_file_fill_output( zip );\n      if ( error )\n        break;\n    }\n\n  Exit:\n    return result;\n  }\n\n\n/***************************************************************************/\n/***************************************************************************/\n/*****                                                                 *****/\n/*****               G Z   E M B E D D I N G   S T R E A M             *****/\n/*****                                                                 *****/\n/***************************************************************************/\n/***************************************************************************/\n\n  static void\n  ft_gzip_stream_close( FT_Stream  stream )\n  {\n    FT_GZipFile  zip    = (FT_GZipFile)stream->descriptor.pointer;\n    FT_Memory    memory = stream->memory;\n\n\n    if ( zip )\n    {\n      /* finalize gzip file descriptor */\n      ft_gzip_file_done( zip );\n\n      FT_FREE( zip );\n\n      stream->descriptor.pointer = NULL;\n    }\n  }\n\n\n  static FT_ULong\n  ft_gzip_stream_io( FT_Stream  stream,\n                     FT_ULong   pos,\n                     FT_Byte*   buffer,\n                     FT_ULong   count )\n  {\n    FT_GZipFile  zip = (FT_GZipFile)stream->descriptor.pointer;\n\n\n    return ft_gzip_file_io( zip, pos, buffer, count );\n  }\n\n\n  static FT_ULong\n  ft_gzip_get_uncompressed_size( FT_Stream  stream )\n  {\n    FT_Error  error;\n    FT_ULong  old_pos;\n    FT_ULong  result = 0;\n\n\n    old_pos = stream->pos;\n    if ( !FT_Stream_Seek( stream, stream->size - 4 ) )\n    {\n      result = FT_Stream_ReadULong( stream, &error );\n      if ( error )\n        result = 0;\n\n      (void)FT_Stream_Seek( stream, old_pos );\n    }\n\n    return result;\n  }\n\n\n  /* documentation is in ftgzip.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Stream_OpenGzip( FT_Stream  stream,\n                      FT_Stream  source )\n  {\n    FT_Error     error;\n    FT_Memory    memory;\n    FT_GZipFile  zip = NULL;\n\n\n    if ( !stream || !source )\n    {\n      error = FT_THROW( Invalid_Stream_Handle );\n      goto Exit;\n    }\n\n    memory = source->memory;\n\n    /*\n     *  check the header right now; this prevents allocating un-necessary\n     *  objects when we don't need them\n     */\n    error = ft_gzip_check_header( source );\n    if ( error )\n      goto Exit;\n\n    FT_ZERO( stream );\n    stream->memory = memory;\n\n    if ( !FT_QNEW( zip ) )\n    {\n      error = ft_gzip_file_init( zip, stream, source );\n      if ( error )\n      {\n        FT_FREE( zip );\n        goto Exit;\n      }\n\n      stream->descriptor.pointer = zip;\n    }\n\n    /*\n     *  We use the following trick to try to dramatically improve the\n     *  performance while dealing with small files.  If the original stream\n     *  size is less than a certain threshold, we try to load the whole font\n     *  file into memory.  This saves us from using the 32KB buffer needed\n     *  to inflate the file, plus the two 4KB intermediate input/output\n     *  buffers used in the `FT_GZipFile' structure.\n     */\n    {\n      FT_ULong  zip_size = ft_gzip_get_uncompressed_size( source );\n\n\n      if ( zip_size != 0 && zip_size < 40 * 1024 )\n      {\n        FT_Byte*  zip_buff = NULL;\n\n\n        if ( !FT_ALLOC( zip_buff, zip_size ) )\n        {\n          FT_ULong  count;\n\n\n          count = ft_gzip_file_io( zip, 0, zip_buff, zip_size );\n          if ( count == zip_size )\n          {\n            ft_gzip_file_done( zip );\n            FT_FREE( zip );\n\n            stream->descriptor.pointer = NULL;\n\n            stream->size  = zip_size;\n            stream->pos   = 0;\n            stream->base  = zip_buff;\n            stream->read  = NULL;\n            stream->close = ft_gzip_stream_close;\n\n            goto Exit;\n          }\n\n          ft_gzip_file_io( zip, 0, NULL, 0 );\n          FT_FREE( zip_buff );\n        }\n        error = FT_Err_Ok;\n      }\n    }\n\n    stream->size  = 0x7FFFFFFFL;  /* don't know the real size! */\n    stream->pos   = 0;\n    stream->base  = 0;\n    stream->read  = ft_gzip_stream_io;\n    stream->close = ft_gzip_stream_close;\n\n  Exit:\n    return error;\n  }\n\n\n  /* documentation is in ftgzip.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Gzip_Uncompress( FT_Memory       memory,\n                      FT_Byte*        output,\n                      FT_ULong*       output_len,\n                      const FT_Byte*  input,\n                      FT_ULong        input_len )\n  {\n    z_stream  stream;\n    int       err;\n\n\n    /* check for `input' delayed to `inflate' */\n\n    if ( !memory || ! output_len || !output )\n      return FT_THROW( Invalid_Argument );\n\n    /* this function is modeled after zlib's `uncompress' function */\n\n    stream.next_in  = (Bytef*)input;\n    stream.avail_in = (uInt)input_len;\n\n    stream.next_out  = output;\n    stream.avail_out = (uInt)*output_len;\n\n    stream.zalloc = (alloc_func)ft_gzip_alloc;\n    stream.zfree  = (free_func) ft_gzip_free;\n    stream.opaque = memory;\n\n    err = inflateInit2( &stream, MAX_WBITS );\n    if ( err != Z_OK )\n      return FT_THROW( Invalid_Argument );\n\n    err = inflate( &stream, Z_FINISH );\n    if ( err != Z_STREAM_END )\n    {\n      inflateEnd( &stream );\n      if ( err == Z_OK )\n        err = Z_BUF_ERROR;\n    }\n    else\n    {\n      *output_len = stream.total_out;\n\n      err = inflateEnd( &stream );\n    }\n\n    if ( err == Z_MEM_ERROR )\n      return FT_THROW( Out_Of_Memory );\n\n    if ( err == Z_BUF_ERROR )\n      return FT_THROW( Array_Too_Large );\n\n    if ( err == Z_DATA_ERROR )\n      return FT_THROW( Invalid_Table );\n\n    return FT_Err_Ok;\n  }\n\n\n#else /* !FT_CONFIG_OPTION_USE_ZLIB */\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Stream_OpenGzip( FT_Stream  stream,\n                      FT_Stream  source )\n  {\n    FT_UNUSED( stream );\n    FT_UNUSED( source );\n\n    return FT_THROW( Unimplemented_Feature );\n  }\n\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Gzip_Uncompress( FT_Memory       memory,\n                      FT_Byte*        output,\n                      FT_ULong*       output_len,\n                      const FT_Byte*  input,\n                      FT_ULong        input_len )\n  {\n    FT_UNUSED( memory );\n    FT_UNUSED( output );\n    FT_UNUSED( output_len );\n    FT_UNUSED( input );\n    FT_UNUSED( input_len );\n\n    return FT_THROW( Unimplemented_Feature );\n  }\n\n#endif /* !FT_CONFIG_OPTION_USE_ZLIB */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/gzip/infblock.c",
    "content": "/* infblock.c -- interpret and process block types to last block\n * Copyright (C) 1995-2002 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n#include \"zutil.h\"\n#include \"infblock.h\"\n#include \"inftrees.h\"\n#include \"infcodes.h\"\n#include \"infutil.h\"\n\n\n/* simplify the use of the inflate_huft type with some defines */\n#define exop word.what.Exop\n#define bits word.what.Bits\n\n/* Table for deflate from PKZIP's appnote.txt. */\nlocal const uInt border[] = { /* Order of the bit length code lengths */\n        16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};\n\n/*\n   Notes beyond the 1.93a appnote.txt:\n\n   1. Distance pointers never point before the beginning of the output\n      stream.\n   2. Distance pointers can point back across blocks, up to 32k away.\n   3. There is an implied maximum of 7 bits for the bit length table and\n      15 bits for the actual data.\n   4. If only one code exists, then it is encoded using one bit.  (Zero\n      would be more efficient, but perhaps a little confusing.)  If two\n      codes exist, they are coded using one bit each (0 and 1).\n   5. There is no way of sending zero distance codes--a dummy must be\n      sent if there are none.  (History: a pre 2.0 version of PKZIP would\n      store blocks with no distance codes, but this was discovered to be\n      too harsh a criterion.)  Valid only for 1.93a.  2.04c does allow\n      zero distance codes, which is sent as one code of zero bits in\n      length.\n   6. There are up to 286 literal/length codes.  Code 256 represents the\n      end-of-block.  Note however that the static length tree defines\n      288 codes just to fill out the Huffman codes.  Codes 286 and 287\n      cannot be used though, since there is no length base or extra bits\n      defined for them.  Similarily, there are up to 30 distance codes.\n      However, static trees define 32 codes (all 5 bits) to fill out the\n      Huffman codes, but the last two had better not show up in the data.\n   7. Unzip can check dynamic Huffman blocks for complete code sets.\n      The exception is that a single code would not be complete (see #4).\n   8. The five bits following the block type is really the number of\n      literal codes sent minus 257.\n   9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits\n      (1+6+6).  Therefore, to output three times the length, you output\n      three codes (1+1+1), whereas to output four times the same length,\n      you only need two codes (1+3).  Hmm.\n  10. In the tree reconstruction algorithm, Code = Code + Increment\n      only if BitLength(i) is not zero.  (Pretty obvious.)\n  11. Correction: 4 Bits: # of Bit Length codes - 4     (4 - 19)\n  12. Note: length code 284 can represent 227-258, but length code 285\n      really is 258.  The last length deserves its own, short code\n      since it gets used a lot in very redundant files.  The length\n      258 is special since 258 - 3 (the min match length) is 255.\n  13. The literal/length and distance code bit lengths are read as a\n      single stream of lengths.  It is possible (and advantageous) for\n      a repeat code (16, 17, or 18) to go across the boundary between\n      the two sets of lengths.\n */\n\n\nlocal void inflate_blocks_reset( /* s, z, c) */\ninflate_blocks_statef *s,\nz_streamp z,\nuLongf *c )\n{\n  if (c != Z_NULL)\n    *c = s->check;\n  if (s->mode == BTREE || s->mode == DTREE)\n    ZFREE(z, s->sub.trees.blens);\n  if (s->mode == CODES)\n    inflate_codes_free(s->sub.decode.codes, z);\n  s->mode = TYPE;\n  s->bitk = 0;\n  s->bitb = 0;\n  s->read = s->write = s->window;\n  if (s->checkfn != Z_NULL)\n    z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)Z_NULL, 0);\n  Tracev((stderr, \"inflate:   blocks reset\\n\"));\n}\n\n\nlocal inflate_blocks_statef *inflate_blocks_new( /* z, c, w) */\nz_streamp z,\ncheck_func c,\nuInt w )\n{\n  inflate_blocks_statef *s;\n\n  if ((s = (inflate_blocks_statef *)ZALLOC\n       (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL)\n    return s;\n  if ((s->hufts =\n       (inflate_huft *)ZALLOC(z, sizeof(inflate_huft), MANY)) == Z_NULL)\n  {\n    ZFREE(z, s);\n    return Z_NULL;\n  }\n  if ((s->window = (Bytef *)ZALLOC(z, 1, w)) == Z_NULL)\n  {\n    ZFREE(z, s->hufts);\n    ZFREE(z, s);\n    return Z_NULL;\n  }\n  s->end = s->window + w;\n  s->checkfn = c;\n  s->mode = TYPE;\n  Tracev((stderr, \"inflate:   blocks allocated\\n\"));\n  inflate_blocks_reset(s, z, Z_NULL);\n  return s;\n}\n\n\nlocal int inflate_blocks( /* s, z, r) */\ninflate_blocks_statef *s,\nz_streamp z,\nint r )\n{\n  uInt t;               /* temporary storage */\n  uLong b;              /* bit buffer */\n  uInt k;               /* bits in bit buffer */\n  Bytef *p;             /* input data pointer */\n  uInt n;               /* bytes available there */\n  Bytef *q;             /* output window write pointer */\n  uInt m;               /* bytes to end of window or read pointer */\n\n  /* copy input/output information to locals (UPDATE macro restores) */\n  LOAD\n\n  /* process input based on current state */\n  while (1) switch (s->mode)\n  {\n    case TYPE:\n      NEEDBITS(3)\n      t = (uInt)b & 7;\n      s->last = t & 1;\n      switch (t >> 1)\n      {\n        case 0:                         /* stored */\n          Tracev((stderr, \"inflate:     stored block%s\\n\",\n                 s->last ? \" (last)\" : \"\"));\n          DUMPBITS(3)\n          t = k & 7;                    /* go to byte boundary */\n          DUMPBITS(t)\n          s->mode = LENS;               /* get length of stored block */\n          break;\n        case 1:                         /* fixed */\n          Tracev((stderr, \"inflate:     fixed codes block%s\\n\",\n                 s->last ? \" (last)\" : \"\"));\n          {\n            uInt bl, bd;\n            inflate_huft *tl, *td;\n\n            inflate_trees_fixed(&bl, &bd, (const inflate_huft**)&tl,\n                                          (const inflate_huft**)&td, z);\n            s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z);\n            if (s->sub.decode.codes == Z_NULL)\n            {\n              r = Z_MEM_ERROR;\n              LEAVE\n            }\n          }\n          DUMPBITS(3)\n          s->mode = CODES;\n          break;\n        case 2:                         /* dynamic */\n          Tracev((stderr, \"inflate:     dynamic codes block%s\\n\",\n                 s->last ? \" (last)\" : \"\"));\n          DUMPBITS(3)\n          s->mode = TABLE;\n          break;\n        case 3:                         /* illegal */\n          DUMPBITS(3)\n          s->mode = BAD;\n          z->msg = (char*)\"invalid block type\";\n          r = Z_DATA_ERROR;\n          LEAVE\n      }\n      break;\n    case LENS:\n      NEEDBITS(32)\n      if ((((~b) >> 16) & 0xffff) != (b & 0xffff))\n      {\n        s->mode = BAD;\n        z->msg = (char*)\"invalid stored block lengths\";\n        r = Z_DATA_ERROR;\n        LEAVE\n      }\n      s->sub.left = (uInt)b & 0xffff;\n      b = k = 0;                      /* dump bits */\n      Tracev((stderr, \"inflate:       stored length %u\\n\", s->sub.left));\n      s->mode = s->sub.left ? STORED : (s->last ? DRY : TYPE);\n      break;\n    case STORED:\n      if (n == 0)\n        LEAVE\n      NEEDOUT\n      t = s->sub.left;\n      if (t > n) t = n;\n      if (t > m) t = m;\n      zmemcpy(q, p, t);\n      p += t;  n -= t;\n      q += t;  m -= t;\n      if ((s->sub.left -= t) != 0)\n        break;\n      Tracev((stderr, \"inflate:       stored end, %lu total out\\n\",\n              z->total_out + (q >= s->read ? q - s->read :\n              (s->end - s->read) + (q - s->window))));\n      s->mode = s->last ? DRY : TYPE;\n      break;\n    case TABLE:\n      NEEDBITS(14)\n      s->sub.trees.table = t = (uInt)b & 0x3fff;\n#ifndef PKZIP_BUG_WORKAROUND\n      if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29)\n      {\n        s->mode = BAD;\n        z->msg = (char*)\"too many length or distance symbols\";\n        r = Z_DATA_ERROR;\n        LEAVE\n      }\n#endif\n      t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);\n      if ((s->sub.trees.blens = (uIntf*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL)\n      {\n        r = Z_MEM_ERROR;\n        LEAVE\n      }\n      DUMPBITS(14)\n      s->sub.trees.index = 0;\n      Tracev((stderr, \"inflate:       table sizes ok\\n\"));\n      s->mode = BTREE;\n    case BTREE:\n      while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10))\n      {\n        NEEDBITS(3)\n        s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7;\n        DUMPBITS(3)\n      }\n      while (s->sub.trees.index < 19)\n        s->sub.trees.blens[border[s->sub.trees.index++]] = 0;\n      s->sub.trees.bb = 7;\n      t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb,\n                             &s->sub.trees.tb, s->hufts, z);\n      if (t != Z_OK)\n      {\n        r = t;\n        if (r == Z_DATA_ERROR)\n        {\n          ZFREE(z, s->sub.trees.blens);\n          s->mode = BAD;\n        }\n        LEAVE\n      }\n      s->sub.trees.index = 0;\n      Tracev((stderr, \"inflate:       bits tree ok\\n\"));\n      s->mode = DTREE;\n    case DTREE:\n      while (t = s->sub.trees.table,\n             s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))\n      {\n        inflate_huft *h;\n        uInt i, j, c;\n\n        t = s->sub.trees.bb;\n        NEEDBITS(t)\n        h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]);\n        t = h->bits;\n        c = h->base;\n        if (c < 16)\n        {\n          DUMPBITS(t)\n          s->sub.trees.blens[s->sub.trees.index++] = c;\n        }\n        else /* c == 16..18 */\n        {\n          i = c == 18 ? 7 : c - 14;\n          j = c == 18 ? 11 : 3;\n          NEEDBITS(t + i)\n          DUMPBITS(t)\n          j += (uInt)b & inflate_mask[i];\n          DUMPBITS(i)\n          i = s->sub.trees.index;\n          t = s->sub.trees.table;\n          if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) ||\n              (c == 16 && i < 1))\n          {\n            ZFREE(z, s->sub.trees.blens);\n            s->mode = BAD;\n            z->msg = (char*)\"invalid bit length repeat\";\n            r = Z_DATA_ERROR;\n            LEAVE\n          }\n          c = c == 16 ? s->sub.trees.blens[i - 1] : 0;\n          do {\n            s->sub.trees.blens[i++] = c;\n          } while (--j);\n          s->sub.trees.index = i;\n        }\n      }\n      s->sub.trees.tb = Z_NULL;\n      {\n        uInt bl, bd;\n        inflate_huft *tl, *td;\n        inflate_codes_statef *c;\n\n        bl = 9;         /* must be <= 9 for lookahead assumptions */\n        bd = 6;         /* must be <= 9 for lookahead assumptions */\n        t = s->sub.trees.table;\n        t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),\n                                  s->sub.trees.blens, &bl, &bd, &tl, &td,\n                                  s->hufts, z);\n        if (t != Z_OK)\n        {\n          if (t == (uInt)Z_DATA_ERROR)\n          {\n            ZFREE(z, s->sub.trees.blens);\n            s->mode = BAD;\n          }\n          r = t;\n          LEAVE\n        }\n        Tracev((stderr, \"inflate:       trees ok\\n\"));\n        if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)\n        {\n          r = Z_MEM_ERROR;\n          LEAVE\n        }\n        s->sub.decode.codes = c;\n      }\n      ZFREE(z, s->sub.trees.blens);\n      s->mode = CODES;\n    case CODES:\n      UPDATE\n      if ((r = inflate_codes(s, z, r)) != Z_STREAM_END)\n        return inflate_flush(s, z, r);\n      r = Z_OK;\n      inflate_codes_free(s->sub.decode.codes, z);\n      LOAD\n      Tracev((stderr, \"inflate:       codes end, %lu total out\\n\",\n              z->total_out + (q >= s->read ? q - s->read :\n              (s->end - s->read) + (q - s->window))));\n      if (!s->last)\n      {\n        s->mode = TYPE;\n        break;\n      }\n      s->mode = DRY;\n    case DRY:\n      FLUSH\n      if (s->read != s->write)\n        LEAVE\n      s->mode = DONE;\n    case DONE:\n      r = Z_STREAM_END;\n      LEAVE\n    case BAD:\n      r = Z_DATA_ERROR;\n      LEAVE\n    default:\n      r = Z_STREAM_ERROR;\n      LEAVE\n  }\n#ifdef NEED_DUMMY_RETURN\n  return 0;\n#endif\n}\n\n\nlocal int inflate_blocks_free( /* s, z) */\ninflate_blocks_statef *s,\nz_streamp z )\n{\n  inflate_blocks_reset(s, z, Z_NULL);\n  ZFREE(z, s->window);\n  ZFREE(z, s->hufts);\n  ZFREE(z, s);\n  Tracev((stderr, \"inflate:   blocks freed\\n\"));\n  return Z_OK;\n}\n\n\n"
  },
  {
    "path": "ext/freetype2/src/gzip/infblock.h",
    "content": "/* infblock.h -- header to use infblock.c\n * Copyright (C) 1995-2002 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/* WARNING: this file should *not* be used by applications. It is\n   part of the implementation of the compression library and is\n   subject to change. Applications should only use zlib.h.\n */\n\n#ifndef _INFBLOCK_H\n#define _INFBLOCK_H\n\nstruct inflate_blocks_state;\ntypedef struct inflate_blocks_state FAR inflate_blocks_statef;\n\nlocal  inflate_blocks_statef * inflate_blocks_new OF((\n    z_streamp z,\n    check_func c,               /* check function */\n    uInt w));                   /* window size */\n\nlocal  int inflate_blocks OF((\n    inflate_blocks_statef *,\n    z_streamp ,\n    int));                      /* initial return code */\n\nlocal  void inflate_blocks_reset OF((\n    inflate_blocks_statef *,\n    z_streamp ,\n    uLongf *));                  /* check value on output */\n\nlocal  int inflate_blocks_free OF((\n    inflate_blocks_statef *,\n    z_streamp));\n\n#endif /* _INFBLOCK_H */\n"
  },
  {
    "path": "ext/freetype2/src/gzip/infcodes.c",
    "content": "/* infcodes.c -- process literals and length/distance pairs\n * Copyright (C) 1995-2002 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n#include \"zutil.h\"\n#include \"inftrees.h\"\n#include \"infblock.h\"\n#include \"infcodes.h\"\n#include \"infutil.h\"\n\n/* simplify the use of the inflate_huft type with some defines */\n#define exop word.what.Exop\n#define bits word.what.Bits\n\ntypedef enum {        /* waiting for \"i:\"=input, \"o:\"=output, \"x:\"=nothing */\n      START,    /* x: set up for LEN */\n      LEN,      /* i: get length/literal/eob next */\n      LENEXT,   /* i: getting length extra (have base) */\n      DIST,     /* i: get distance next */\n      DISTEXT,  /* i: getting distance extra */\n      COPY,     /* o: copying bytes in window, waiting for space */\n      LIT,      /* o: got literal, waiting for output space */\n      WASH,     /* o: got eob, possibly still output waiting */\n      END,      /* x: got eob and all data flushed */\n      BADCODE}  /* x: got error */\ninflate_codes_mode;\n\n/* inflate codes private state */\nstruct inflate_codes_state {\n\n  /* mode */\n  inflate_codes_mode mode;      /* current inflate_codes mode */\n\n  /* mode dependent information */\n  uInt len;\n  union {\n    struct {\n      inflate_huft *tree;       /* pointer into tree */\n      uInt need;                /* bits needed */\n    } code;             /* if LEN or DIST, where in tree */\n    uInt lit;           /* if LIT, literal */\n    struct {\n      uInt get;                 /* bits to get for extra */\n      uInt dist;                /* distance back to copy from */\n    } copy;             /* if EXT or COPY, where and how much */\n  } sub;                /* submode */\n\n  /* mode independent information */\n  Byte lbits;           /* ltree bits decoded per branch */\n  Byte dbits;           /* dtree bits decoder per branch */\n  inflate_huft *ltree;          /* literal/length/eob tree */\n  inflate_huft *dtree;          /* distance tree */\n\n};\n\n\nlocal inflate_codes_statef *inflate_codes_new( /* bl, bd, tl, td, z) */\nuInt bl, uInt bd,\ninflate_huft *tl,\ninflate_huft *td, /* need separate declaration for Borland C++ */\nz_streamp z )\n{\n  inflate_codes_statef *c;\n\n  if ((c = (inflate_codes_statef *)\n       ZALLOC(z,1,sizeof(struct inflate_codes_state))) != Z_NULL)\n  {\n    c->mode = START;\n    c->lbits = (Byte)bl;\n    c->dbits = (Byte)bd;\n    c->ltree = tl;\n    c->dtree = td;\n    Tracev((stderr, \"inflate:       codes new\\n\"));\n  }\n  return c;\n}\n\n\nlocal int inflate_codes( /* s, z, r) */\ninflate_blocks_statef *s,\nz_streamp z,\nint r )\n{\n  uInt j;               /* temporary storage */\n  inflate_huft *t;      /* temporary pointer */\n  uInt e;               /* extra bits or operation */\n  uLong b;              /* bit buffer */\n  uInt k;               /* bits in bit buffer */\n  Bytef *p;             /* input data pointer */\n  uInt n;               /* bytes available there */\n  Bytef *q;             /* output window write pointer */\n  uInt m;               /* bytes to end of window or read pointer */\n  Bytef *f;             /* pointer to copy strings from */\n  inflate_codes_statef *c = s->sub.decode.codes;  /* codes state */\n\n  /* copy input/output information to locals (UPDATE macro restores) */\n  LOAD\n\n  /* process input and output based on current state */\n  while (1) switch (c->mode)\n  {             /* waiting for \"i:\"=input, \"o:\"=output, \"x:\"=nothing */\n    case START:         /* x: set up for LEN */\n#ifndef SLOW\n      if (m >= 258 && n >= 10)\n      {\n        UPDATE\n        r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z);\n        LOAD\n        if (r != Z_OK)\n        {\n          c->mode = r == Z_STREAM_END ? WASH : BADCODE;\n          break;\n        }\n      }\n#endif /* !SLOW */\n      c->sub.code.need = c->lbits;\n      c->sub.code.tree = c->ltree;\n      c->mode = LEN;\n    case LEN:           /* i: get length/literal/eob next */\n      j = c->sub.code.need;\n      NEEDBITS(j)\n      t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);\n      DUMPBITS(t->bits)\n      e = (uInt)(t->exop);\n      if (e == 0)               /* literal */\n      {\n        c->sub.lit = t->base;\n        Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?\n                 \"inflate:         literal '%c'\\n\" :\n                 \"inflate:         literal 0x%02x\\n\", t->base));\n        c->mode = LIT;\n        break;\n      }\n      if (e & 16)               /* length */\n      {\n        c->sub.copy.get = e & 15;\n        c->len = t->base;\n        c->mode = LENEXT;\n        break;\n      }\n      if ((e & 64) == 0)        /* next table */\n      {\n        c->sub.code.need = e;\n        c->sub.code.tree = t + t->base;\n        break;\n      }\n      if (e & 32)               /* end of block */\n      {\n        Tracevv((stderr, \"inflate:         end of block\\n\"));\n        c->mode = WASH;\n        break;\n      }\n      c->mode = BADCODE;        /* invalid code */\n      z->msg = (char*)\"invalid literal/length code\";\n      r = Z_DATA_ERROR;\n      LEAVE\n    case LENEXT:        /* i: getting length extra (have base) */\n      j = c->sub.copy.get;\n      NEEDBITS(j)\n      c->len += (uInt)b & inflate_mask[j];\n      DUMPBITS(j)\n      c->sub.code.need = c->dbits;\n      c->sub.code.tree = c->dtree;\n      Tracevv((stderr, \"inflate:         length %u\\n\", c->len));\n      c->mode = DIST;\n    case DIST:          /* i: get distance next */\n      j = c->sub.code.need;\n      NEEDBITS(j)\n      t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);\n      DUMPBITS(t->bits)\n      e = (uInt)(t->exop);\n      if (e & 16)               /* distance */\n      {\n        c->sub.copy.get = e & 15;\n        c->sub.copy.dist = t->base;\n        c->mode = DISTEXT;\n        break;\n      }\n      if ((e & 64) == 0)        /* next table */\n      {\n        c->sub.code.need = e;\n        c->sub.code.tree = t + t->base;\n        break;\n      }\n      c->mode = BADCODE;        /* invalid code */\n      z->msg = (char*)\"invalid distance code\";\n      r = Z_DATA_ERROR;\n      LEAVE\n    case DISTEXT:       /* i: getting distance extra */\n      j = c->sub.copy.get;\n      NEEDBITS(j)\n      c->sub.copy.dist += (uInt)b & inflate_mask[j];\n      DUMPBITS(j)\n      Tracevv((stderr, \"inflate:         distance %u\\n\", c->sub.copy.dist));\n      c->mode = COPY;\n    case COPY:          /* o: copying bytes in window, waiting for space */\n      f = q - c->sub.copy.dist;\n      while (f < s->window)             /* modulo window size-\"while\" instead */\n        f += s->end - s->window;        /* of \"if\" handles invalid distances */\n      while (c->len)\n      {\n        NEEDOUT\n        OUTBYTE(*f++)\n        if (f == s->end)\n          f = s->window;\n        c->len--;\n      }\n      c->mode = START;\n      break;\n    case LIT:           /* o: got literal, waiting for output space */\n      NEEDOUT\n      OUTBYTE(c->sub.lit)\n      c->mode = START;\n      break;\n    case WASH:          /* o: got eob, possibly more output */\n      if (k > 7)        /* return unused byte, if any */\n      {\n        Assert(k < 16, \"inflate_codes grabbed too many bytes\")\n        k -= 8;\n        n++;\n        p--;            /* can always return one */\n      }\n      FLUSH\n      if (s->read != s->write)\n        LEAVE\n      c->mode = END;\n    case END:\n      r = Z_STREAM_END;\n      LEAVE\n    case BADCODE:       /* x: got error */\n      r = Z_DATA_ERROR;\n      LEAVE\n    default:\n      r = Z_STREAM_ERROR;\n      LEAVE\n  }\n#ifdef NEED_DUMMY_RETURN\n  return Z_STREAM_ERROR;  /* Some dumb compilers complain without this */\n#endif\n}\n\n\nlocal void inflate_codes_free( /* c, z) */\ninflate_codes_statef *c,\nz_streamp z )\n{\n  ZFREE(z, c);\n  Tracev((stderr, \"inflate:       codes free\\n\"));\n}\n"
  },
  {
    "path": "ext/freetype2/src/gzip/infcodes.h",
    "content": "/* infcodes.h -- header to use infcodes.c\n * Copyright (C) 1995-2002 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/* WARNING: this file should *not* be used by applications. It is\n   part of the implementation of the compression library and is\n   subject to change. Applications should only use zlib.h.\n */\n\n#ifndef _INFCODES_H\n#define _INFCODES_H\n\nstruct inflate_codes_state;\ntypedef struct inflate_codes_state FAR inflate_codes_statef;\n\nlocal inflate_codes_statef *inflate_codes_new OF((\n    uInt, uInt,\n    inflate_huft *, inflate_huft *,\n    z_streamp ));\n\nlocal int inflate_codes OF((\n    inflate_blocks_statef *,\n    z_streamp ,\n    int));\n\nlocal void inflate_codes_free OF((\n    inflate_codes_statef *,\n    z_streamp ));\n\n#endif /* _INFCODES_H */\n"
  },
  {
    "path": "ext/freetype2/src/gzip/inffixed.h",
    "content": "/* inffixed.h -- table for decoding fixed codes\n * Generated automatically by the maketree.c program\n */\n\n/* WARNING: this file should *not* be used by applications. It is\n   part of the implementation of the compression library and is\n   subject to change. Applications should only use zlib.h.\n */\n\nlocal const uInt fixed_bl = 9;\nlocal const uInt fixed_bd = 5;\nlocal const inflate_huft fixed_tl[] = {\n    {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},\n    {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192},\n    {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160},\n    {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},224},\n    {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},144},\n    {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},208},\n    {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},176},\n    {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},240},\n    {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},\n    {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},200},\n    {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},168},\n    {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},232},\n    {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},152},\n    {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},216},\n    {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},184},\n    {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},248},\n    {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},\n    {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},196},\n    {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},164},\n    {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},228},\n    {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},148},\n    {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},212},\n    {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},180},\n    {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},244},\n    {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},\n    {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},204},\n    {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},172},\n    {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},236},\n    {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},156},\n    {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},220},\n    {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},188},\n    {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},252},\n    {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},\n    {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},194},\n    {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},162},\n    {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},226},\n    {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},146},\n    {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},210},\n    {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},178},\n    {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},242},\n    {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},\n    {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},202},\n    {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},170},\n    {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},234},\n    {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},154},\n    {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},218},\n    {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},186},\n    {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},250},\n    {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},\n    {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},198},\n    {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},166},\n    {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},230},\n    {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},150},\n    {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},214},\n    {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},182},\n    {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},246},\n    {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},\n    {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},206},\n    {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},174},\n    {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},238},\n    {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},158},\n    {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},222},\n    {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},190},\n    {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},254},\n    {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},\n    {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},193},\n    {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},161},\n    {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},225},\n    {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},145},\n    {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},209},\n    {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},177},\n    {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},241},\n    {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},\n    {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},201},\n    {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},169},\n    {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},233},\n    {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},153},\n    {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},217},\n    {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},185},\n    {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},249},\n    {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},\n    {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},197},\n    {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},165},\n    {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},229},\n    {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},149},\n    {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},213},\n    {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},181},\n    {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},245},\n    {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},\n    {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},205},\n    {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},173},\n    {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},237},\n    {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},157},\n    {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},221},\n    {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},189},\n    {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},253},\n    {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},\n    {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},195},\n    {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},163},\n    {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},227},\n    {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},147},\n    {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},211},\n    {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},179},\n    {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},243},\n    {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},\n    {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},203},\n    {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},171},\n    {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},235},\n    {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},155},\n    {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},219},\n    {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},187},\n    {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},251},\n    {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},\n    {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},199},\n    {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},167},\n    {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},231},\n    {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},151},\n    {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},215},\n    {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},183},\n    {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},247},\n    {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},\n    {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},207},\n    {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},175},\n    {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},239},\n    {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},159},\n    {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},223},\n    {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191},\n    {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255}\n  };\nlocal const inflate_huft fixed_td[] = {\n    {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097},\n    {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385},\n    {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193},\n    {{{82,5}},9}, {{{90,5}},2049}, {{{86,5}},129}, {{{192,5}},24577},\n    {{{80,5}},2}, {{{87,5}},385}, {{{83,5}},25}, {{{91,5}},6145},\n    {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577},\n    {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289},\n    {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577}\n  };\n"
  },
  {
    "path": "ext/freetype2/src/gzip/inflate.c",
    "content": "/* inflate.c -- zlib interface to inflate modules\n * Copyright (C) 1995-2002 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n#include \"zutil.h\"\n#include \"infblock.h\"\n\n#define  DONE  INFLATE_DONE\n#define  BAD   INFLATE_BAD\n\ntypedef enum {\n      METHOD,   /* waiting for method byte */\n      FLAG,     /* waiting for flag byte */\n      DICT4,    /* four dictionary check bytes to go */\n      DICT3,    /* three dictionary check bytes to go */\n      DICT2,    /* two dictionary check bytes to go */\n      DICT1,    /* one dictionary check byte to go */\n      DICT0,    /* waiting for inflateSetDictionary */\n      BLOCKS,   /* decompressing blocks */\n      CHECK4,   /* four check bytes to go */\n      CHECK3,   /* three check bytes to go */\n      CHECK2,   /* two check bytes to go */\n      CHECK1,   /* one check byte to go */\n      DONE,     /* finished check, done */\n      BAD}      /* got an error--stay here */\ninflate_mode;\n\n/* inflate private state */\nstruct internal_state {\n\n  /* mode */\n  inflate_mode  mode;   /* current inflate mode */\n\n  /* mode dependent information */\n  union {\n    uInt method;        /* if FLAGS, method byte */\n    struct {\n      uLong was;                /* computed check value */\n      uLong need;               /* stream check value */\n    } check;            /* if CHECK, check values to compare */\n    uInt marker;        /* if BAD, inflateSync's marker bytes count */\n  } sub;        /* submode */\n\n  /* mode independent information */\n  int  nowrap;          /* flag for no wrapper */\n  uInt wbits;           /* log2(window size)  (8..15, defaults to 15) */\n  inflate_blocks_statef\n    *blocks;            /* current inflate_blocks state */\n\n};\n\n\nZEXPORT(int) inflateReset( /* z) */\nz_streamp z )\n{\n  if (z == Z_NULL || z->state == Z_NULL)\n    return Z_STREAM_ERROR;\n  z->total_in = z->total_out = 0;\n  z->msg = Z_NULL;\n  z->state->mode = z->state->nowrap ? BLOCKS : METHOD;\n  inflate_blocks_reset(z->state->blocks, z, Z_NULL);\n  Tracev((stderr, \"inflate: reset\\n\"));\n  return Z_OK;\n}\n\n\nZEXPORT(int) inflateEnd( /* z) */\nz_streamp z )\n{\n  if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL)\n    return Z_STREAM_ERROR;\n  if (z->state->blocks != Z_NULL)\n    inflate_blocks_free(z->state->blocks, z);\n  ZFREE(z, z->state);\n  z->state = Z_NULL;\n  Tracev((stderr, \"inflate: end\\n\"));\n  return Z_OK;\n}\n\n\nZEXPORT(int) inflateInit2_( /* z, w, version, stream_size) */\nz_streamp z,\nint w,\nconst char *version,\nint stream_size )\n{\n  if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||\n      stream_size != sizeof(z_stream))\n      return Z_VERSION_ERROR;\n\n  /* initialize state */\n  if (z == Z_NULL)\n    return Z_STREAM_ERROR;\n  z->msg = Z_NULL;\n  if (z->zalloc == Z_NULL)\n  {\n    z->zalloc = zcalloc;\n    z->opaque = (voidpf)0;\n  }\n  if (z->zfree == Z_NULL) z->zfree = zcfree;\n  if ((z->state = (struct internal_state FAR *)\n       ZALLOC(z,1,sizeof(struct internal_state))) == Z_NULL)\n    return Z_MEM_ERROR;\n  z->state->blocks = Z_NULL;\n\n  /* handle undocumented nowrap option (no zlib header or check) */\n  z->state->nowrap = 0;\n  if (w < 0)\n  {\n    w = - w;\n    z->state->nowrap = 1;\n  }\n\n  /* set window size */\n  if (w < 8 || w > 15)\n  {\n    inflateEnd(z);\n    return Z_STREAM_ERROR;\n  }\n  z->state->wbits = (uInt)w;\n\n  /* create inflate_blocks state */\n  if ((z->state->blocks =\n      inflate_blocks_new(z, z->state->nowrap ? Z_NULL : adler32, (uInt)1 << w))\n      == Z_NULL)\n  {\n    inflateEnd(z);\n    return Z_MEM_ERROR;\n  }\n  Tracev((stderr, \"inflate: allocated\\n\"));\n\n  /* reset state */\n  inflateReset(z);\n  return Z_OK;\n}\n\n\n\n#undef  NEEDBYTE\n#define NEEDBYTE {if(z->avail_in==0)return r;r=f;}\n\n#undef  NEXTBYTE\n#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++)\n\n\nZEXPORT(int) inflate( /* z, f) */\nz_streamp z,\nint f )\n{\n  int r;\n  uInt b;\n\n  if (z == Z_NULL || z->state == Z_NULL || z->next_in == Z_NULL)\n    return Z_STREAM_ERROR;\n  f = f == Z_FINISH ? Z_BUF_ERROR : Z_OK;\n  r = Z_BUF_ERROR;\n  while (1) switch (z->state->mode)\n  {\n    case METHOD:\n      NEEDBYTE\n      if (((z->state->sub.method = NEXTBYTE) & 0xf) != Z_DEFLATED)\n      {\n        z->state->mode = BAD;\n        z->msg = (char*)\"unknown compression method\";\n        z->state->sub.marker = 5;       /* can't try inflateSync */\n        break;\n      }\n      if ((z->state->sub.method >> 4) + 8 > z->state->wbits)\n      {\n        z->state->mode = BAD;\n        z->msg = (char*)\"invalid window size\";\n        z->state->sub.marker = 5;       /* can't try inflateSync */\n        break;\n      }\n      z->state->mode = FLAG;\n    case FLAG:\n      NEEDBYTE\n      b = NEXTBYTE;\n      if (((z->state->sub.method << 8) + b) % 31)\n      {\n        z->state->mode = BAD;\n        z->msg = (char*)\"incorrect header check\";\n        z->state->sub.marker = 5;       /* can't try inflateSync */\n        break;\n      }\n      Tracev((stderr, \"inflate: zlib header ok\\n\"));\n      if (!(b & PRESET_DICT))\n      {\n        z->state->mode = BLOCKS;\n        break;\n      }\n      z->state->mode = DICT4;\n    case DICT4:\n      NEEDBYTE\n      z->state->sub.check.need = (uLong)NEXTBYTE << 24;\n      z->state->mode = DICT3;\n    case DICT3:\n      NEEDBYTE\n      z->state->sub.check.need += (uLong)NEXTBYTE << 16;\n      z->state->mode = DICT2;\n    case DICT2:\n      NEEDBYTE\n      z->state->sub.check.need += (uLong)NEXTBYTE << 8;\n      z->state->mode = DICT1;\n    case DICT1:\n      NEEDBYTE\n      z->state->sub.check.need += (uLong)NEXTBYTE;\n      z->adler = z->state->sub.check.need;\n      z->state->mode = DICT0;\n      return Z_NEED_DICT;\n    case DICT0:\n      z->state->mode = BAD;\n      z->msg = (char*)\"need dictionary\";\n      z->state->sub.marker = 0;       /* can try inflateSync */\n      return Z_STREAM_ERROR;\n    case BLOCKS:\n      r = inflate_blocks(z->state->blocks, z, r);\n      if (r == Z_DATA_ERROR)\n      {\n        z->state->mode = BAD;\n        z->state->sub.marker = 0;       /* can try inflateSync */\n        break;\n      }\n      if (r == Z_OK)\n        r = f;\n      if (r != Z_STREAM_END)\n        return r;\n      r = f;\n      inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was);\n      if (z->state->nowrap)\n      {\n        z->state->mode = DONE;\n        break;\n      }\n      z->state->mode = CHECK4;\n    case CHECK4:\n      NEEDBYTE\n      z->state->sub.check.need = (uLong)NEXTBYTE << 24;\n      z->state->mode = CHECK3;\n    case CHECK3:\n      NEEDBYTE\n      z->state->sub.check.need += (uLong)NEXTBYTE << 16;\n      z->state->mode = CHECK2;\n    case CHECK2:\n      NEEDBYTE\n      z->state->sub.check.need += (uLong)NEXTBYTE << 8;\n      z->state->mode = CHECK1;\n    case CHECK1:\n      NEEDBYTE\n      z->state->sub.check.need += (uLong)NEXTBYTE;\n\n      if (z->state->sub.check.was != z->state->sub.check.need)\n      {\n        z->state->mode = BAD;\n        z->msg = (char*)\"incorrect data check\";\n        z->state->sub.marker = 5;       /* can't try inflateSync */\n        break;\n      }\n      Tracev((stderr, \"inflate: zlib check ok\\n\"));\n      z->state->mode = DONE;\n    case DONE:\n      return Z_STREAM_END;\n    case BAD:\n      return Z_DATA_ERROR;\n    default:\n      return Z_STREAM_ERROR;\n  }\n#ifdef NEED_DUMMY_RETURN\n  return Z_STREAM_ERROR;  /* Some dumb compilers complain without this */\n#endif\n}\n\n"
  },
  {
    "path": "ext/freetype2/src/gzip/inftrees.c",
    "content": "/* inftrees.c -- generate Huffman trees for efficient decoding\n * Copyright (C) 1995-2002 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n#include \"zutil.h\"\n#include \"inftrees.h\"\n\n#if !defined(BUILDFIXED) && !defined(STDC)\n#  define BUILDFIXED   /* non ANSI compilers may not accept inffixed.h */\n#endif\n\n\n#if 0\nlocal const char inflate_copyright[] =\n   \" inflate 1.1.4 Copyright 1995-2002 Mark Adler \";\n#endif\n/*\n  If you use the zlib library in a product, an acknowledgment is welcome\n  in the documentation of your product. If for some reason you cannot\n  include such an acknowledgment, I would appreciate that you keep this\n  copyright string in the executable of your product.\n */\n\n/* simplify the use of the inflate_huft type with some defines */\n#define exop word.what.Exop\n#define bits word.what.Bits\n\n\nlocal int huft_build OF((\n    uIntf *,            /* code lengths in bits */\n    uInt,               /* number of codes */\n    uInt,               /* number of \"simple\" codes */\n    const uIntf *,      /* list of base values for non-simple codes */\n    const uIntf *,      /* list of extra bits for non-simple codes */\n    inflate_huft * FAR*,/* result: starting table */\n    uIntf *,            /* maximum lookup bits (returns actual) */\n    inflate_huft *,     /* space for trees */\n    uInt *,             /* hufts used in space */\n    uIntf * ));         /* space for values */\n\n/* Tables for deflate from PKZIP's appnote.txt. */\nlocal const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */\n        3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n        35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};\n        /* see note #13 above about 258 */\nlocal const uInt cplext[31] = { /* Extra bits for literal codes 257..285 */\n        0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,\n        3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; /* 112==invalid */\nlocal const uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */\n        1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n        257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n        8193, 12289, 16385, 24577};\nlocal const uInt cpdext[30] = { /* Extra bits for distance codes */\n        0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,\n        7, 7, 8, 8, 9, 9, 10, 10, 11, 11,\n        12, 12, 13, 13};\n\n/*\n   Huffman code decoding is performed using a multi-level table lookup.\n   The fastest way to decode is to simply build a lookup table whose\n   size is determined by the longest code.  However, the time it takes\n   to build this table can also be a factor if the data being decoded\n   is not very long.  The most common codes are necessarily the\n   shortest codes, so those codes dominate the decoding time, and hence\n   the speed.  The idea is you can have a shorter table that decodes the\n   shorter, more probable codes, and then point to subsidiary tables for\n   the longer codes.  The time it costs to decode the longer codes is\n   then traded against the time it takes to make longer tables.\n\n   This results of this trade are in the variables lbits and dbits\n   below.  lbits is the number of bits the first level table for literal/\n   length codes can decode in one step, and dbits is the same thing for\n   the distance codes.  Subsequent tables are also less than or equal to\n   those sizes.  These values may be adjusted either when all of the\n   codes are shorter than that, in which case the longest code length in\n   bits is used, or when the shortest code is *longer* than the requested\n   table size, in which case the length of the shortest code in bits is\n   used.\n\n   There are two different values for the two tables, since they code a\n   different number of possibilities each.  The literal/length table\n   codes 286 possible values, or in a flat code, a little over eight\n   bits.  The distance table codes 30 possible values, or a little less\n   than five bits, flat.  The optimum values for speed end up being\n   about one bit more than those, so lbits is 8+1 and dbits is 5+1.\n   The optimum values may differ though from machine to machine, and\n   possibly even between compilers.  Your mileage may vary.\n */\n\n\n/* If BMAX needs to be larger than 16, then h and x[] should be uLong. */\n#define BMAX 15         /* maximum bit length of any code */\n\nlocal int huft_build( /* b, n, s, d, e, t, m, hp, hn, v) */\nuIntf *b,               /* code lengths in bits (all assumed <= BMAX) */\nuInt n,                 /* number of codes (assumed <= 288) */\nuInt s,                 /* number of simple-valued codes (0..s-1) */\nconst uIntf *d,         /* list of base values for non-simple codes */\nconst uIntf *e,         /* list of extra bits for non-simple codes */\ninflate_huft * FAR *t,  /* result: starting table */\nuIntf *m,               /* maximum lookup bits, returns actual */\ninflate_huft *hp,       /* space for trees */\nuInt *hn,               /* hufts used in space */\nuIntf *v                /* working area: values in order of bit length */\n/* Given a list of code lengths and a maximum table size, make a set of\n   tables to decode that set of codes.  Return Z_OK on success, Z_BUF_ERROR\n   if the given code set is incomplete (the tables are still built in this\n   case), or Z_DATA_ERROR if the input is invalid. */\n)\n{\n\n  uInt a;                       /* counter for codes of length k */\n  uInt c[BMAX+1];               /* bit length count table */\n  uInt f;                       /* i repeats in table every f entries */\n  int g;                        /* maximum code length */\n  int h;                        /* table level */\n  uInt i;                       /* counter, current code */\n  uInt j;                       /* counter */\n  int k;                        /* number of bits in current code */\n  int l;                        /* bits per table (returned in m) */\n  uInt mask;                    /* (1 << w) - 1, to avoid cc -O bug on HP */\n  uIntf *p;                     /* pointer into c[], b[], or v[] */\n  inflate_huft *q;              /* points to current table */\n  struct inflate_huft_s r;      /* table entry for structure assignment */\n  inflate_huft *u[BMAX];        /* table stack */\n  int w;                        /* bits before this table == (l * h) */\n  uInt x[BMAX+1];               /* bit offsets, then code stack */\n  uIntf *xp;                    /* pointer into x */\n  int y;                        /* number of dummy codes added */\n  uInt z;                       /* number of entries in current table */\n\n\n  /* Make compiler happy */\n  r.base = 0;\n\n  /* Generate counts for each bit length */\n  p = c;\n#define C0 *p++ = 0;\n#define C2 C0 C0 C0 C0\n#define C4 C2 C2 C2 C2\n  C4                            /* clear c[]--assume BMAX+1 is 16 */\n  p = b;  i = n;\n  do {\n    c[*p++]++;                  /* assume all entries <= BMAX */\n  } while (--i);\n  if (c[0] == n)                /* null input--all zero length codes */\n  {\n    *t = (inflate_huft *)Z_NULL;\n    *m = 0;\n    return Z_OK;\n  }\n\n\n  /* Find minimum and maximum length, bound *m by those */\n  l = *m;\n  for (j = 1; j <= BMAX; j++)\n    if (c[j])\n      break;\n  k = j;                        /* minimum code length */\n  if ((uInt)l < j)\n    l = j;\n  for (i = BMAX; i; i--)\n    if (c[i])\n      break;\n  g = i;                        /* maximum code length */\n  if ((uInt)l > i)\n    l = i;\n  *m = l;\n\n\n  /* Adjust last length count to fill out codes, if needed */\n  for (y = 1 << j; j < i; j++, y <<= 1)\n    if ((y -= c[j]) < 0)\n      return Z_DATA_ERROR;\n  if ((y -= c[i]) < 0)\n    return Z_DATA_ERROR;\n  c[i] += y;\n\n\n  /* Generate starting offsets into the value table for each length */\n  x[1] = j = 0;\n  p = c + 1;  xp = x + 2;\n  while (--i) {                 /* note that i == g from above */\n    *xp++ = (j += *p++);\n  }\n\n\n  /* Make a table of values in order of bit lengths */\n  p = b;  i = 0;\n  do {\n    if ((j = *p++) != 0)\n      v[x[j]++] = i;\n  } while (++i < n);\n  n = x[g];                     /* set n to length of v */\n\n\n  /* Generate the Huffman codes and for each, make the table entries */\n  x[0] = i = 0;                 /* first Huffman code is zero */\n  p = v;                        /* grab values in bit order */\n  h = -1;                       /* no tables yet--level -1 */\n  w = -l;                       /* bits decoded == (l * h) */\n  u[0] = (inflate_huft *)Z_NULL;        /* just to keep compilers happy */\n  q = (inflate_huft *)Z_NULL;   /* ditto */\n  z = 0;                        /* ditto */\n\n  /* go through the bit lengths (k already is bits in shortest code) */\n  for (; k <= g; k++)\n  {\n    a = c[k];\n    while (a--)\n    {\n      /* here i is the Huffman code of length k bits for value *p */\n      /* make tables up to required level */\n      while (k > w + l)\n      {\n        h++;\n        w += l;                 /* previous table always l bits */\n\n        /* compute minimum size table less than or equal to l bits */\n        z = g - w;\n        z = z > (uInt)l ? (uInt)l : z;        /* table size upper limit */\n        if ((f = 1 << (j = k - w)) > a + 1)     /* try a k-w bit table */\n        {                       /* too few codes for k-w bit table */\n          f -= a + 1;           /* deduct codes from patterns left */\n          xp = c + k;\n          if (j < z)\n            while (++j < z)     /* try smaller tables up to z bits */\n            {\n              if ((f <<= 1) <= *++xp)\n                break;          /* enough codes to use up j bits */\n              f -= *xp;         /* else deduct codes from patterns */\n            }\n        }\n        z = 1 << j;             /* table entries for j-bit table */\n\n        /* allocate new table */\n        if (*hn + z > MANY)     /* (note: doesn't matter for fixed) */\n          return Z_DATA_ERROR;  /* overflow of MANY */\n        u[h] = q = hp + *hn;\n        *hn += z;\n\n        /* connect to last table, if there is one */\n        if (h)\n        {\n          x[h] = i;             /* save pattern for backing up */\n          r.bits = (Byte)l;     /* bits to dump before this table */\n          r.exop = (Byte)j;     /* bits in this table */\n          j = i >> (w - l);\n          r.base = (uInt)(q - u[h-1] - j);   /* offset to this table */\n          u[h-1][j] = r;        /* connect to last table */\n        }\n        else\n          *t = q;               /* first table is returned result */\n      }\n\n      /* set up table entry in r */\n      r.bits = (Byte)(k - w);\n      if (p >= v + n)\n        r.exop = 128 + 64;      /* out of values--invalid code */\n      else if (*p < s)\n      {\n        r.exop = (Byte)(*p < 256 ? 0 : 32 + 64);     /* 256 is end-of-block */\n        r.base = *p++;          /* simple code is just the value */\n      }\n      else\n      {\n        r.exop = (Byte)(e[*p - s] + 16 + 64);/* non-simple--look up in lists */\n        r.base = d[*p++ - s];\n      }\n\n      /* fill code-like entries with r */\n      f = 1 << (k - w);\n      for (j = i >> w; j < z; j += f)\n        q[j] = r;\n\n      /* backwards increment the k-bit code i */\n      for (j = 1 << (k - 1); i & j; j >>= 1)\n        i ^= j;\n      i ^= j;\n\n      /* backup over finished tables */\n      mask = (1 << w) - 1;      /* needed on HP, cc -O bug */\n      while ((i & mask) != x[h])\n      {\n        h--;                    /* don't need to update q */\n        w -= l;\n        mask = (1 << w) - 1;\n      }\n    }\n  }\n\n\n  /* Return Z_BUF_ERROR if we were given an incomplete table */\n  return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK;\n}\n\n\nlocal int inflate_trees_bits( /* c, bb, tb, hp, z) */\nuIntf *c,               /* 19 code lengths */\nuIntf *bb,              /* bits tree desired/actual depth */\ninflate_huft * FAR *tb, /* bits tree result */\ninflate_huft *hp,       /* space for trees */\nz_streamp z             /* for messages */\n)\n{\n  int r;\n  uInt hn = 0;          /* hufts used in space */\n  uIntf *v;             /* work area for huft_build */\n\n  if ((v = (uIntf*)ZALLOC(z, 19, sizeof(uInt))) == Z_NULL)\n    return Z_MEM_ERROR;\n  r = huft_build(c, 19, 19, (uIntf*)Z_NULL, (uIntf*)Z_NULL,\n                 tb, bb, hp, &hn, v);\n  if (r == Z_DATA_ERROR)\n    z->msg = (char*)\"oversubscribed dynamic bit lengths tree\";\n  else if (r == Z_BUF_ERROR || *bb == 0)\n  {\n    z->msg = (char*)\"incomplete dynamic bit lengths tree\";\n    r = Z_DATA_ERROR;\n  }\n  ZFREE(z, v);\n  return r;\n}\n\n\nlocal int inflate_trees_dynamic( /* nl, nd, c, bl, bd, tl, td, hp, z) */\nuInt nl,                /* number of literal/length codes */\nuInt nd,                /* number of distance codes */\nuIntf *c,               /* that many (total) code lengths */\nuIntf *bl,              /* literal desired/actual bit depth */\nuIntf *bd,              /* distance desired/actual bit depth */\ninflate_huft * FAR *tl, /* literal/length tree result */\ninflate_huft * FAR *td, /* distance tree result */\ninflate_huft *hp,       /* space for trees */\nz_streamp z             /* for messages */\n)\n{\n  int r;\n  uInt hn = 0;          /* hufts used in space */\n  uIntf *v;             /* work area for huft_build */\n\n  /* allocate work area */\n  if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)\n    return Z_MEM_ERROR;\n\n  /* build literal/length tree */\n  r = huft_build(c, nl, 257, cplens, cplext, tl, bl, hp, &hn, v);\n  if (r != Z_OK || *bl == 0)\n  {\n    if (r == Z_DATA_ERROR)\n      z->msg = (char*)\"oversubscribed literal/length tree\";\n    else if (r != Z_MEM_ERROR)\n    {\n      z->msg = (char*)\"incomplete literal/length tree\";\n      r = Z_DATA_ERROR;\n    }\n    ZFREE(z, v);\n    return r;\n  }\n\n  /* build distance tree */\n  r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, hp, &hn, v);\n  if (r != Z_OK || (*bd == 0 && nl > 257))\n  {\n    if (r == Z_DATA_ERROR)\n      z->msg = (char*)\"oversubscribed distance tree\";\n    else if (r == Z_BUF_ERROR) {\n#if 0\n    {\n#endif\n#ifdef PKZIP_BUG_WORKAROUND\n      r = Z_OK;\n    }\n#else\n      z->msg = (char*)\"incomplete distance tree\";\n      r = Z_DATA_ERROR;\n    }\n    else if (r != Z_MEM_ERROR)\n    {\n      z->msg = (char*)\"empty distance tree with lengths\";\n      r = Z_DATA_ERROR;\n    }\n    ZFREE(z, v);\n    return r;\n#endif\n  }\n\n  /* done */\n  ZFREE(z, v);\n  return Z_OK;\n}\n\n\n/* build fixed tables only once--keep them here */\n#ifdef BUILDFIXED\nlocal int fixed_built = 0;\n#define FIXEDH 544      /* number of hufts used by fixed tables */\nlocal inflate_huft fixed_mem[FIXEDH];\nlocal uInt fixed_bl;\nlocal uInt fixed_bd;\nlocal inflate_huft *fixed_tl;\nlocal inflate_huft *fixed_td;\n#else\n#include \"inffixed.h\"\n#endif\n\n\nlocal int inflate_trees_fixed( /* bl, bd, tl, td, z) */\nuIntf *bl,                      /* literal desired/actual bit depth */\nuIntf *bd,                      /* distance desired/actual bit depth */\nconst inflate_huft * FAR *tl,   /* literal/length tree result */\nconst inflate_huft * FAR *td,   /* distance tree result */\nz_streamp z                     /* for memory allocation */\n)\n{\n#ifdef BUILDFIXED\n  /* build fixed tables if not already */\n  if (!fixed_built)\n  {\n    int k;              /* temporary variable */\n    uInt f = 0;         /* number of hufts used in fixed_mem */\n    uIntf *c;           /* length list for huft_build */\n    uIntf *v;           /* work area for huft_build */\n\n    /* allocate memory */\n    if ((c = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)\n      return Z_MEM_ERROR;\n    if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)\n    {\n      ZFREE(z, c);\n      return Z_MEM_ERROR;\n    }\n\n    /* literal table */\n    for (k = 0; k < 144; k++)\n      c[k] = 8;\n    for (; k < 256; k++)\n      c[k] = 9;\n    for (; k < 280; k++)\n      c[k] = 7;\n    for (; k < 288; k++)\n      c[k] = 8;\n    fixed_bl = 9;\n    huft_build(c, 288, 257, cplens, cplext, &fixed_tl, &fixed_bl,\n               fixed_mem, &f, v);\n\n    /* distance table */\n    for (k = 0; k < 30; k++)\n      c[k] = 5;\n    fixed_bd = 5;\n    huft_build(c, 30, 0, cpdist, cpdext, &fixed_td, &fixed_bd,\n               fixed_mem, &f, v);\n\n    /* done */\n    ZFREE(z, v);\n    ZFREE(z, c);\n    fixed_built = 1;\n  }\n#else\n  FT_UNUSED(z);\n#endif\n  *bl = fixed_bl;\n  *bd = fixed_bd;\n  *tl = fixed_tl;\n  *td = fixed_td;\n  return Z_OK;\n}\n"
  },
  {
    "path": "ext/freetype2/src/gzip/inftrees.h",
    "content": "/* inftrees.h -- header to use inftrees.c\n * Copyright (C) 1995-2002 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/* WARNING: this file should *not* be used by applications. It is\n   part of the implementation of the compression library and is\n   subject to change. Applications should only use zlib.h.\n */\n\n/* Huffman code lookup table entry--this entry is four bytes for machines\n   that have 16-bit pointers (e.g. PC's in the small or medium model). */\n\n#ifndef _INFTREES_H\n#define _INFTREES_H\n\ntypedef struct inflate_huft_s FAR inflate_huft;\n\nstruct inflate_huft_s {\n  union {\n    struct {\n      Byte Exop;        /* number of extra bits or operation */\n      Byte Bits;        /* number of bits in this code or subcode */\n    } what;\n    uInt pad;           /* pad structure to a power of 2 (4 bytes for */\n  } word;               /*  16-bit, 8 bytes for 32-bit int's) */\n  uInt base;            /* literal, length base, distance base,\n                           or table offset */\n};\n\n/* Maximum size of dynamic tree.  The maximum found in a long but non-\n   exhaustive search was 1004 huft structures (850 for length/literals\n   and 154 for distances, the latter actually the result of an\n   exhaustive search).  The actual maximum is not known, but the\n   value below is more than safe. */\n#define MANY 1440\n\nlocal  int inflate_trees_bits OF((\n    uIntf *,                    /* 19 code lengths */\n    uIntf *,                    /* bits tree desired/actual depth */\n    inflate_huft * FAR *,       /* bits tree result */\n    inflate_huft *,             /* space for trees */\n    z_streamp));                /* for messages */\n\nlocal  int inflate_trees_dynamic OF((\n    uInt,                       /* number of literal/length codes */\n    uInt,                       /* number of distance codes */\n    uIntf *,                    /* that many (total) code lengths */\n    uIntf *,                    /* literal desired/actual bit depth */\n    uIntf *,                    /* distance desired/actual bit depth */\n    inflate_huft * FAR *,       /* literal/length tree result */\n    inflate_huft * FAR *,       /* distance tree result */\n    inflate_huft *,             /* space for trees */\n    z_streamp));                /* for messages */\n\nlocal  int inflate_trees_fixed OF((\n    uIntf *,                    /* literal desired/actual bit depth */\n    uIntf *,                    /* distance desired/actual bit depth */\n    const inflate_huft * FAR *, /* literal/length tree result */\n    const inflate_huft * FAR *, /* distance tree result */\n    z_streamp));                /* for memory allocation */\n\n#endif /* _INFTREES_H */\n"
  },
  {
    "path": "ext/freetype2/src/gzip/infutil.c",
    "content": "/* inflate_util.c -- data and routines common to blocks and codes\n * Copyright (C) 1995-2002 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n#include \"zutil.h\"\n#include \"infblock.h\"\n#include \"inftrees.h\"\n#include \"infcodes.h\"\n#include \"infutil.h\"\n\n\n/* And'ing with mask[n] masks the lower n bits */\nlocal const uInt inflate_mask[17] = {\n    0x0000,\n    0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,\n    0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff\n};\n\n\n/* copy as much as possible from the sliding window to the output area */\nlocal int inflate_flush( /* s, z, r) */\ninflate_blocks_statef *s,\nz_streamp z,\nint r )\n{\n  uInt n;\n  Bytef *p;\n  Bytef *q;\n\n  /* local copies of source and destination pointers */\n  p = z->next_out;\n  q = s->read;\n\n  /* compute number of bytes to copy as far as end of window */\n  n = (uInt)((q <= s->write ? s->write : s->end) - q);\n  if (n > z->avail_out) n = z->avail_out;\n  if (n && r == Z_BUF_ERROR) r = Z_OK;\n\n  /* update counters */\n  z->avail_out -= n;\n  z->total_out += n;\n\n  /* update check information */\n  if (s->checkfn != Z_NULL)\n    z->adler = s->check = (*s->checkfn)(s->check, q, n);\n\n  /* copy as far as end of window */\n  zmemcpy(p, q, n);\n  p += n;\n  q += n;\n\n  /* see if more to copy at beginning of window */\n  if (q == s->end)\n  {\n    /* wrap pointers */\n    q = s->window;\n    if (s->write == s->end)\n      s->write = s->window;\n\n    /* compute bytes to copy */\n    n = (uInt)(s->write - q);\n    if (n > z->avail_out) n = z->avail_out;\n    if (n && r == Z_BUF_ERROR) r = Z_OK;\n\n    /* update counters */\n    z->avail_out -= n;\n    z->total_out += n;\n\n    /* update check information */\n    if (s->checkfn != Z_NULL)\n      z->adler = s->check = (*s->checkfn)(s->check, q, n);\n\n    /* copy */\n    zmemcpy(p, q, n);\n    p += n;\n    q += n;\n  }\n\n  /* update pointers */\n  z->next_out = p;\n  s->read = q;\n\n  /* done */\n  return r;\n}\n"
  },
  {
    "path": "ext/freetype2/src/gzip/infutil.h",
    "content": "/* infutil.h -- types and macros common to blocks and codes\n * Copyright (C) 1995-2002 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/* WARNING: this file should *not* be used by applications. It is\n   part of the implementation of the compression library and is\n   subject to change. Applications should only use zlib.h.\n */\n\n#ifndef _INFUTIL_H\n#define _INFUTIL_H\n\ntypedef enum {\n      TYPE,     /* get type bits (3, including end bit) */\n      LENS,     /* get lengths for stored */\n      STORED,   /* processing stored block */\n      TABLE,    /* get table lengths */\n      BTREE,    /* get bit lengths tree for a dynamic block */\n      DTREE,    /* get length, distance trees for a dynamic block */\n      CODES,    /* processing fixed or dynamic block */\n      DRY,      /* output remaining window bytes */\n      DONE,     /* finished last block, done */\n      BAD}      /* got a data error--stuck here */\ninflate_block_mode;\n\n/* inflate blocks semi-private state */\nstruct inflate_blocks_state {\n\n  /* mode */\n  inflate_block_mode  mode;     /* current inflate_block mode */\n\n  /* mode dependent information */\n  union {\n    uInt left;          /* if STORED, bytes left to copy */\n    struct {\n      uInt table;               /* table lengths (14 bits) */\n      uInt index;               /* index into blens (or border) */\n      uIntf *blens;             /* bit lengths of codes */\n      uInt bb;                  /* bit length tree depth */\n      inflate_huft *tb;         /* bit length decoding tree */\n    } trees;            /* if DTREE, decoding info for trees */\n    struct {\n      inflate_codes_statef\n         *codes;\n    } decode;           /* if CODES, current state */\n  } sub;                /* submode */\n  uInt last;            /* true if this block is the last block */\n\n  /* mode independent information */\n  uInt bitk;            /* bits in bit buffer */\n  uLong bitb;           /* bit buffer */\n  inflate_huft *hufts;  /* single malloc for tree space */\n  Bytef *window;        /* sliding window */\n  Bytef *end;           /* one byte after sliding window */\n  Bytef *read;          /* window read pointer */\n  Bytef *write;         /* window write pointer */\n  check_func checkfn;   /* check function */\n  uLong check;          /* check on output */\n\n};\n\n\n/* defines for inflate input/output */\n/*   update pointers and return */\n#define UPDBITS {s->bitb=b;s->bitk=k;}\n#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;}\n#define UPDOUT {s->write=q;}\n#define UPDATE {UPDBITS UPDIN UPDOUT}\n#define LEAVE {UPDATE return inflate_flush(s,z,r);}\n/*   get bytes and bits */\n#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;}\n#define NEEDBYTE {if(n)r=Z_OK;else LEAVE}\n#define NEXTBYTE (n--,*p++)\n#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<<k;k+=8;}}\n#define DUMPBITS(j) {b>>=(j);k-=(j);}\n/*   output bytes */\n#define WAVAIL (uInt)(q<s->read?s->read-q-1:s->end-q)\n#define LOADOUT {q=s->write;m=(uInt)WAVAIL;}\n#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}}\n#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT}\n#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;}\n#define OUTBYTE(a) {*q++=(Byte)(a);m--;}\n/*   load local pointers */\n#define LOAD {LOADIN LOADOUT}\n\n/* masks for lower bits (size given to avoid silly warnings with Visual C++) */\n#ifndef NO_INFLATE_MASK\nlocal uInt inflate_mask[17];\n#endif\n\n/* copy as much as possible from the sliding window to the output area */\nlocal int inflate_flush OF((\n    inflate_blocks_statef *,\n    z_streamp ,\n    int));\n\n#endif\n"
  },
  {
    "path": "ext/freetype2/src/gzip/rules.mk",
    "content": "#\n# FreeType 2 GZip support configuration rules\n#\n\n\n# Copyright 2002, 2003, 2013 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\n# gzip driver directory\n#\nGZIP_DIR := $(SRC_DIR)/gzip\n\n\n# compilation flags for the driver\n#\nifeq ($(SYSTEM_ZLIB),)\n  GZIP_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(GZIP_DIR))\nelse\n  GZIP_COMPILE := $(FT_COMPILE)\nendif\n\n\n# gzip support sources\n#\n# All source and header files get loaded by `ftgzip.c' only if SYTEM_ZLIB is\n# not defined (regardless whether we have a `single' or a `multi' build).\n# However, it doesn't harm if we add everything as a dependency\n# unconditionally.\n#\nGZIP_DRV_SRCS := $(GZIP_DIR)/adler32.c  \\\n                 $(GZIP_DIR)/infblock.c \\\n                 $(GZIP_DIR)/infblock.h \\\n                 $(GZIP_DIR)/infcodes.c \\\n                 $(GZIP_DIR)/infcodes.h \\\n                 $(GZIP_DIR)/inffixed.h \\\n                 $(GZIP_DIR)/inflate.c  \\\n                 $(GZIP_DIR)/inftrees.c \\\n                 $(GZIP_DIR)/inftrees.h \\\n                 $(GZIP_DIR)/infutil.c  \\\n                 $(GZIP_DIR)/infutil.h  \\\n                 $(GZIP_DIR)/zconf.h    \\\n                 $(GZIP_DIR)/zlib.h     \\\n                 $(GZIP_DIR)/zutil.c    \\\n                 $(GZIP_DIR)/zutil.h\n\n\n# gzip driver object(s)\n#\n#   GZIP_DRV_OBJ is used during both `single' and `multi' builds\n#\nGZIP_DRV_OBJ := $(OBJ_DIR)/ftgzip.$O\n\n\n# gzip main source file\n#\nGZIP_DRV_SRC := $(GZIP_DIR)/ftgzip.c\n\n\n# gzip support - object\n#\n$(GZIP_DRV_OBJ): $(GZIP_DRV_SRC) $(GZIP_DRV_SRCS) $(FREETYPE_H)\n\t$(GZIP_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(GZIP_DRV_SRC))\n\n\n# update main driver object lists\n#\nDRV_OBJS_S += $(GZIP_DRV_OBJ)\nDRV_OBJS_M += $(GZIP_DRV_OBJ)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/gzip/zconf.h",
    "content": "/* zconf.h -- configuration of the zlib compression library\n * Copyright (C) 1995-2002 Jean-loup Gailly.\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/* @(#) $Id$ */\n\n#ifndef _ZCONF_H\n#define _ZCONF_H\n\n/*\n * If you *really* need a unique prefix for all types and library functions,\n * compile with -DZ_PREFIX. The \"standard\" zlib should be compiled without it.\n */\n#ifdef Z_PREFIX\n#  define deflateInit_         z_deflateInit_\n#  define deflate              z_deflate\n#  define deflateEnd           z_deflateEnd\n#  define inflateInit_         z_inflateInit_\n#  define inflate              z_inflate\n#  define inflateEnd           z_inflateEnd\n#  define deflateInit2_        z_deflateInit2_\n#  define deflateSetDictionary z_deflateSetDictionary\n#  define deflateCopy          z_deflateCopy\n#  define deflateReset         z_deflateReset\n#  define deflateParams        z_deflateParams\n#  define inflateInit2_        z_inflateInit2_\n#  define inflateSetDictionary z_inflateSetDictionary\n#  define inflateSync          z_inflateSync\n#  define inflateSyncPoint     z_inflateSyncPoint\n#  define inflateReset         z_inflateReset\n#  define compress             z_compress\n#  define compress2            z_compress2\n#  define uncompress           z_uncompress\n#  define adler32              z_adler32\n#  define crc32                z_crc32\n#  define get_crc_table        z_get_crc_table\n\n#  define Byte   z_Byte\n#  define uInt   z_uInt\n#  define uLong  z_uLong\n#  define Bytef  z_Bytef\n#  define charf  z_charf\n#  define intf   z_intf\n#  define uIntf  z_uIntf\n#  define uLongf z_uLongf\n#  define voidpf z_voidpf\n#  define voidp  z_voidp\n#endif\n\n#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)\n#  define WIN32\n#endif\n#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)\n#  ifndef __32BIT__\n#    define __32BIT__\n#  endif\n#endif\n#if defined(__MSDOS__) && !defined(MSDOS)\n#  define MSDOS\n#endif\n\n/* WinCE doesn't have errno.h */\n#ifdef _WIN32_WCE\n#  define NO_ERRNO_H\n#endif\n\n\n/*\n * Compile with -DMAXSEG_64K if the alloc function cannot allocate more\n * than 64k bytes at a time (needed on systems with 16-bit int).\n */\n#if defined(MSDOS) && !defined(__32BIT__)\n#  define MAXSEG_64K\n#endif\n#ifdef MSDOS\n#  define UNALIGNED_OK\n#endif\n\n#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32))  && !defined(STDC)\n#  define STDC\n#endif\n#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)\n#  ifndef STDC\n#    define STDC\n#  endif\n#endif\n\n#ifndef STDC\n#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */\n#    define const\n#  endif\n#endif\n\n/* Some Mac compilers merge all .h files incorrectly: */\n#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)\n#  define NO_DUMMY_DECL\n#endif\n\n/* Old Borland C and LCC incorrectly complains about missing returns: */\n#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)\n#  define NEED_DUMMY_RETURN\n#endif\n\n#if defined(__LCC__)\n#  define  NEED_DUMMY_RETURN\n#endif\n\n/* Maximum value for memLevel in deflateInit2 */\n#ifndef MAX_MEM_LEVEL\n#  ifdef MAXSEG_64K\n#    define MAX_MEM_LEVEL 8\n#  else\n#    define MAX_MEM_LEVEL 9\n#  endif\n#endif\n\n/* Maximum value for windowBits in deflateInit2 and inflateInit2.\n * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files\n * created by gzip. (Files created by minigzip can still be extracted by\n * gzip.)\n */\n#ifndef MAX_WBITS\n#  define MAX_WBITS   15 /* 32K LZ77 window */\n#endif\n\n/* The memory requirements for deflate are (in bytes):\n            (1 << (windowBits+2)) +  (1 << (memLevel+9))\n that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)\n plus a few kilobytes for small objects. For example, if you want to reduce\n the default memory requirements from 256K to 128K, compile with\n     make CFLAGS=\"-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7\"\n Of course this will generally degrade compression (there's no free lunch).\n\n   The memory requirements for inflate are (in bytes) 1 << windowBits\n that is, 32K for windowBits=15 (default value) plus a few kilobytes\n for small objects.\n*/\n\n                        /* Type declarations */\n\n#ifndef OF /* function prototypes */\n#  ifdef STDC\n#    define OF(args)  args\n#  else\n#    define OF(args)  ()\n#  endif\n#endif\n\n/* The following definitions for FAR are needed only for MSDOS mixed\n * model programming (small or medium model with some far allocations).\n * This was tested only with MSC; for other MSDOS compilers you may have\n * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,\n * just define FAR to be empty.\n */\n#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)\n   /* MSC small or medium model */\n#  define SMALL_MEDIUM\n#  ifdef _MSC_VER\n#    define FAR _far\n#  else\n#    define FAR far\n#  endif\n#endif\n#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))\n#  ifndef __32BIT__\n#    define SMALL_MEDIUM\n#    define FAR _far\n#  endif\n#endif\n\n/* Compile with -DZLIB_DLL for Windows DLL support */\n#if defined(ZLIB_DLL)\n#  if defined(_WINDOWS) || defined(WINDOWS)\n#    ifdef FAR\n#      undef FAR\n#    endif\n#    include <windows.h>\n#    define ZEXPORT(x)  x WINAPI\n#    ifdef WIN32\n#      define ZEXPORTVA(x)  x WINAPIV\n#    else\n#      define ZEXPORTVA(x)  x FAR _cdecl _export\n#    endif\n#  endif\n#  if defined (__BORLANDC__)\n#    if (__BORLANDC__ >= 0x0500) && defined (WIN32)\n#      include <windows.h>\n#      define ZEXPORT(x) x __declspec(dllexport) WINAPI\n#      define ZEXPORTRVA(x)  x __declspec(dllexport) WINAPIV\n#    else\n#      if defined (_Windows) && defined (__DLL__)\n#        define ZEXPORT(x) x _export\n#        define ZEXPORTVA(x) x _export\n#      endif\n#    endif\n#  endif\n#endif\n\n\n#ifndef ZEXPORT\n#  define ZEXPORT(x)   static x\n#endif\n#ifndef ZEXPORTVA\n#  define ZEXPORTVA(x)   static x\n#endif\n#ifndef ZEXTERN\n#  define ZEXTERN(x) static x\n#endif\n#ifndef ZEXTERNDEF\n#  define ZEXTERNDEF(x)  static x\n#endif\n\n#ifndef FAR\n#   define FAR\n#endif\n\n#if !defined(MACOS) && !defined(TARGET_OS_MAC)\ntypedef unsigned char  Byte;  /* 8 bits */\n#endif\ntypedef unsigned int   uInt;  /* 16 bits or more */\ntypedef unsigned long  uLong; /* 32 bits or more */\n\n#ifdef SMALL_MEDIUM\n   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */\n#  define Bytef Byte FAR\n#else\n   typedef Byte  FAR Bytef;\n#endif\ntypedef char  FAR charf;\ntypedef int   FAR intf;\ntypedef uInt  FAR uIntf;\ntypedef uLong FAR uLongf;\n\n#ifdef STDC\n   typedef void FAR *voidpf;\n   typedef void     *voidp;\n#else\n   typedef Byte FAR *voidpf;\n   typedef Byte     *voidp;\n#endif\n\n#ifdef HAVE_UNISTD_H\n#  include <sys/types.h> /* for off_t */\n#  include <unistd.h>    /* for SEEK_* and off_t */\n#  define z_off_t  off_t\n#endif\n#ifndef SEEK_SET\n#  define SEEK_SET        0       /* Seek from beginning of file.  */\n#  define SEEK_CUR        1       /* Seek from current position.  */\n#  define SEEK_END        2       /* Set file pointer to EOF plus \"offset\" */\n#endif\n#ifndef z_off_t\n#  define  z_off_t long\n#endif\n\n/* MVS linker does not support external names larger than 8 bytes */\n#if defined(__MVS__)\n#   pragma map(deflateInit_,\"DEIN\")\n#   pragma map(deflateInit2_,\"DEIN2\")\n#   pragma map(deflateEnd,\"DEEND\")\n#   pragma map(inflateInit_,\"ININ\")\n#   pragma map(inflateInit2_,\"ININ2\")\n#   pragma map(inflateEnd,\"INEND\")\n#   pragma map(inflateSync,\"INSY\")\n#   pragma map(inflateSetDictionary,\"INSEDI\")\n#   pragma map(inflate_blocks,\"INBL\")\n#   pragma map(inflate_blocks_new,\"INBLNE\")\n#   pragma map(inflate_blocks_free,\"INBLFR\")\n#   pragma map(inflate_blocks_reset,\"INBLRE\")\n#   pragma map(inflate_codes_free,\"INCOFR\")\n#   pragma map(inflate_codes,\"INCO\")\n#   pragma map(inflate_fast,\"INFA\")\n#   pragma map(inflate_flush,\"INFLU\")\n#   pragma map(inflate_mask,\"INMA\")\n#   pragma map(inflate_set_dictionary,\"INSEDI2\")\n#   pragma map(inflate_copyright,\"INCOPY\")\n#   pragma map(inflate_trees_bits,\"INTRBI\")\n#   pragma map(inflate_trees_dynamic,\"INTRDY\")\n#   pragma map(inflate_trees_fixed,\"INTRFI\")\n#   pragma map(inflate_trees_free,\"INTRFR\")\n#endif\n\n#endif /* _ZCONF_H */\n"
  },
  {
    "path": "ext/freetype2/src/gzip/zlib.h",
    "content": "/* zlib.h -- interface of the 'zlib' general purpose compression library\n  version 1.1.4, March 11th, 2002\n\n  Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler\n\n  This software is provided 'as-is', without any express or implied\n  warranty.  In no event will the authors be held liable for any damages\n  arising from the use of this software.\n\n  Permission is granted to anyone to use this software for any purpose,\n  including commercial applications, and to alter it and redistribute it\n  freely, subject to the following restrictions:\n\n  1. The origin of this software must not be misrepresented; you must not\n     claim that you wrote the original software. If you use this software\n     in a product, an acknowledgment in the product documentation would be\n     appreciated but is not required.\n  2. Altered source versions must be plainly marked as such, and must not be\n     misrepresented as being the original software.\n  3. This notice may not be removed or altered from any source distribution.\n\n  Jean-loup Gailly        Mark Adler\n  jloup@gzip.org          madler@alumni.caltech.edu\n\n\n  The data format used by the zlib library is described by RFCs (Request for\n  Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt\n  (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).\n*/\n\n#ifndef _ZLIB_H\n#define _ZLIB_H\n\n#include \"zconf.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#define ZLIB_VERSION \"1.1.4\"\n\n/*\n     The 'zlib' compression library provides in-memory compression and\n  decompression functions, including integrity checks of the uncompressed\n  data.  This version of the library supports only one compression method\n  (deflation) but other algorithms will be added later and will have the same\n  stream interface.\n\n     Compression can be done in a single step if the buffers are large\n  enough (for example if an input file is mmap'ed), or can be done by\n  repeated calls of the compression function.  In the latter case, the\n  application must provide more input and/or consume the output\n  (providing more output space) before each call.\n\n     The library also supports reading and writing files in gzip (.gz) format\n  with an interface similar to that of stdio.\n\n     The library does not install any signal handler. The decoder checks\n  the consistency of the compressed data, so the library should never\n  crash even in case of corrupted input.\n*/\n\ntypedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));\ntypedef void   (*free_func)  OF((voidpf opaque, voidpf address));\n\nstruct internal_state;\n\ntypedef struct z_stream_s {\n    Bytef    *next_in;  /* next input byte */\n    uInt     avail_in;  /* number of bytes available at next_in */\n    uLong    total_in;  /* total nb of input bytes read so far */\n\n    Bytef    *next_out; /* next output byte should be put there */\n    uInt     avail_out; /* remaining free space at next_out */\n    uLong    total_out; /* total nb of bytes output so far */\n\n    char     *msg;      /* last error message, NULL if no error */\n    struct internal_state FAR *state; /* not visible by applications */\n\n    alloc_func zalloc;  /* used to allocate the internal state */\n    free_func  zfree;   /* used to free the internal state */\n    voidpf     opaque;  /* private data object passed to zalloc and zfree */\n\n    int     data_type;  /* best guess about the data type: ascii or binary */\n    uLong   adler;      /* adler32 value of the uncompressed data */\n    uLong   reserved;   /* reserved for future use */\n} z_stream;\n\ntypedef z_stream FAR *z_streamp;\n\n/*\n   The application must update next_in and avail_in when avail_in has\n   dropped to zero. It must update next_out and avail_out when avail_out\n   has dropped to zero. The application must initialize zalloc, zfree and\n   opaque before calling the init function. All other fields are set by the\n   compression library and must not be updated by the application.\n\n   The opaque value provided by the application will be passed as the first\n   parameter for calls of zalloc and zfree. This can be useful for custom\n   memory management. The compression library attaches no meaning to the\n   opaque value.\n\n   zalloc must return Z_NULL if there is not enough memory for the object.\n   If zlib is used in a multi-threaded application, zalloc and zfree must be\n   thread safe.\n\n   On 16-bit systems, the functions zalloc and zfree must be able to allocate\n   exactly 65536 bytes, but will not be required to allocate more than this\n   if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,\n   pointers returned by zalloc for objects of exactly 65536 bytes *must*\n   have their offset normalized to zero. The default allocation function\n   provided by this library ensures this (see zutil.c). To reduce memory\n   requirements and avoid any allocation of 64K objects, at the expense of\n   compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).\n\n   The fields total_in and total_out can be used for statistics or\n   progress reports. After compression, total_in holds the total size of\n   the uncompressed data and may be saved for use in the decompressor\n   (particularly if the decompressor wants to decompress everything in\n   a single step).\n*/\n\n                        /* constants */\n\n#define Z_NO_FLUSH      0\n#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */\n#define Z_SYNC_FLUSH    2\n#define Z_FULL_FLUSH    3\n#define Z_FINISH        4\n/* Allowed flush values; see deflate() below for details */\n\n#define Z_OK            0\n#define Z_STREAM_END    1\n#define Z_NEED_DICT     2\n#define Z_ERRNO        (-1)\n#define Z_STREAM_ERROR (-2)\n#define Z_DATA_ERROR   (-3)\n#define Z_MEM_ERROR    (-4)\n#define Z_BUF_ERROR    (-5)\n#define Z_VERSION_ERROR (-6)\n/* Return codes for the compression/decompression functions. Negative\n * values are errors, positive values are used for special but normal events.\n */\n\n#define Z_NO_COMPRESSION         0\n#define Z_BEST_SPEED             1\n#define Z_BEST_COMPRESSION       9\n#define Z_DEFAULT_COMPRESSION  (-1)\n/* compression levels */\n\n#define Z_FILTERED            1\n#define Z_HUFFMAN_ONLY        2\n#define Z_DEFAULT_STRATEGY    0\n/* compression strategy; see deflateInit2() below for details */\n\n#define Z_BINARY   0\n#define Z_ASCII    1\n#define Z_UNKNOWN  2\n/* Possible values of the data_type field */\n\n#define Z_DEFLATED   8\n/* The deflate compression method (the only one supported in this version) */\n\n#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */\n\n\n                        /* basic functions */\n\n/* The application can compare zlibVersion and ZLIB_VERSION for consistency.\n   If the first character differs, the library code actually used is\n   not compatible with the zlib.h header file used by the application.\n   This check is automatically made by deflateInit and inflateInit.\n */\n\n/*\nZEXTERN(int)  deflateInit OF((z_streamp strm, int level));\n\n     Initializes the internal stream state for compression. The fields\n   zalloc, zfree and opaque must be initialized before by the caller.\n   If zalloc and zfree are set to Z_NULL, deflateInit updates them to\n   use default allocation functions.\n\n     The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:\n   1 gives best speed, 9 gives best compression, 0 gives no compression at\n   all (the input data is simply copied a block at a time).\n   Z_DEFAULT_COMPRESSION requests a default compromise between speed and\n   compression (currently equivalent to level 6).\n\n     deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not\n   enough memory, Z_STREAM_ERROR if level is not a valid compression level,\n   Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible\n   with the version assumed by the caller (ZLIB_VERSION).\n   msg is set to null if there is no error message.  deflateInit does not\n   perform any compression: this will be done by deflate().\n*/\n\n\n/*\n    deflate compresses as much data as possible, and stops when the input\n  buffer becomes empty or the output buffer becomes full. It may introduce some\n  output latency (reading input without producing any output) except when\n  forced to flush.\n\n    The detailed semantics are as follows. deflate performs one or both of the\n  following actions:\n\n  - Compress more input starting at next_in and update next_in and avail_in\n    accordingly. If not all input can be processed (because there is not\n    enough room in the output buffer), next_in and avail_in are updated and\n    processing will resume at this point for the next call of deflate().\n\n  - Provide more output starting at next_out and update next_out and avail_out\n    accordingly. This action is forced if the parameter flush is non zero.\n    Forcing flush frequently degrades the compression ratio, so this parameter\n    should be set only when necessary (in interactive applications).\n    Some output may be provided even if flush is not set.\n\n  Before the call of deflate(), the application should ensure that at least\n  one of the actions is possible, by providing more input and/or consuming\n  more output, and updating avail_in or avail_out accordingly; avail_out\n  should never be zero before the call. The application can consume the\n  compressed output when it wants, for example when the output buffer is full\n  (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK\n  and with zero avail_out, it must be called again after making room in the\n  output buffer because there might be more output pending.\n\n    If the parameter flush is set to Z_SYNC_FLUSH, all pending output is\n  flushed to the output buffer and the output is aligned on a byte boundary, so\n  that the decompressor can get all input data available so far. (In particular\n  avail_in is zero after the call if enough output space has been provided\n  before the call.)  Flushing may degrade compression for some compression\n  algorithms and so it should be used only when necessary.\n\n    If flush is set to Z_FULL_FLUSH, all output is flushed as with\n  Z_SYNC_FLUSH, and the compression state is reset so that decompression can\n  restart from this point if previous compressed data has been damaged or if\n  random access is desired. Using Z_FULL_FLUSH too often can seriously degrade\n  the compression.\n\n    If deflate returns with avail_out == 0, this function must be called again\n  with the same value of the flush parameter and more output space (updated\n  avail_out), until the flush is complete (deflate returns with non-zero\n  avail_out).\n\n    If the parameter flush is set to Z_FINISH, pending input is processed,\n  pending output is flushed and deflate returns with Z_STREAM_END if there\n  was enough output space; if deflate returns with Z_OK, this function must be\n  called again with Z_FINISH and more output space (updated avail_out) but no\n  more input data, until it returns with Z_STREAM_END or an error. After\n  deflate has returned Z_STREAM_END, the only possible operations on the\n  stream are deflateReset or deflateEnd.\n\n    Z_FINISH can be used immediately after deflateInit if all the compression\n  is to be done in a single step. In this case, avail_out must be at least\n  0.1% larger than avail_in plus 12 bytes.  If deflate does not return\n  Z_STREAM_END, then it must be called again as described above.\n\n    deflate() sets strm->adler to the adler32 checksum of all input read\n  so far (that is, total_in bytes).\n\n    deflate() may update data_type if it can make a good guess about\n  the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered\n  binary. This field is only for information purposes and does not affect\n  the compression algorithm in any manner.\n\n    deflate() returns Z_OK if some progress has been made (more input\n  processed or more output produced), Z_STREAM_END if all input has been\n  consumed and all output has been produced (only when flush is set to\n  Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example\n  if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible\n  (for example avail_in or avail_out was zero).\n*/\n\n\n/*\n     All dynamically allocated data structures for this stream are freed.\n   This function discards any unprocessed input and does not flush any\n   pending output.\n\n     deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the\n   stream state was inconsistent, Z_DATA_ERROR if the stream was freed\n   prematurely (some input or output was discarded). In the error case,\n   msg may be set but then points to a static string (which must not be\n   deallocated).\n*/\n\n\n/*\nZEXTERN(int)  inflateInit OF((z_streamp strm));\n\n     Initializes the internal stream state for decompression. The fields\n   next_in, avail_in, zalloc, zfree and opaque must be initialized before by\n   the caller. If next_in is not Z_NULL and avail_in is large enough (the exact\n   value depends on the compression method), inflateInit determines the\n   compression method from the zlib header and allocates all data structures\n   accordingly; otherwise the allocation will be deferred to the first call of\n   inflate.  If zalloc and zfree are set to Z_NULL, inflateInit updates them to\n   use default allocation functions.\n\n     inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough\n   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the\n   version assumed by the caller.  msg is set to null if there is no error\n   message. inflateInit does not perform any decompression apart from reading\n   the zlib header if present: this will be done by inflate().  (So next_in and\n   avail_in may be modified, but next_out and avail_out are unchanged.)\n*/\n\n\nZEXTERN(int) inflate OF((z_streamp strm, int flush));\n/*\n    inflate decompresses as much data as possible, and stops when the input\n  buffer becomes empty or the output buffer becomes full. It may some\n  introduce some output latency (reading input without producing any output)\n  except when forced to flush.\n\n  The detailed semantics are as follows. inflate performs one or both of the\n  following actions:\n\n  - Decompress more input starting at next_in and update next_in and avail_in\n    accordingly. If not all input can be processed (because there is not\n    enough room in the output buffer), next_in is updated and processing\n    will resume at this point for the next call of inflate().\n\n  - Provide more output starting at next_out and update next_out and avail_out\n    accordingly.  inflate() provides as much output as possible, until there\n    is no more input data or no more space in the output buffer (see below\n    about the flush parameter).\n\n  Before the call of inflate(), the application should ensure that at least\n  one of the actions is possible, by providing more input and/or consuming\n  more output, and updating the next_* and avail_* values accordingly.\n  The application can consume the uncompressed output when it wants, for\n  example when the output buffer is full (avail_out == 0), or after each\n  call of inflate(). If inflate returns Z_OK and with zero avail_out, it\n  must be called again after making room in the output buffer because there\n  might be more output pending.\n\n    If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much\n  output as possible to the output buffer. The flushing behavior of inflate is\n  not specified for values of the flush parameter other than Z_SYNC_FLUSH\n  and Z_FINISH, but the current implementation actually flushes as much output\n  as possible anyway.\n\n    inflate() should normally be called until it returns Z_STREAM_END or an\n  error. However if all decompression is to be performed in a single step\n  (a single call of inflate), the parameter flush should be set to\n  Z_FINISH. In this case all pending input is processed and all pending\n  output is flushed; avail_out must be large enough to hold all the\n  uncompressed data. (The size of the uncompressed data may have been saved\n  by the compressor for this purpose.) The next operation on this stream must\n  be inflateEnd to deallocate the decompression state. The use of Z_FINISH\n  is never required, but can be used to inform inflate that a faster routine\n  may be used for the single inflate() call.\n\n     If a preset dictionary is needed at this point (see inflateSetDictionary\n  below), inflate sets strm-adler to the adler32 checksum of the\n  dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise\n  it sets strm->adler to the adler32 checksum of all output produced\n  so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or\n  an error code as described below. At the end of the stream, inflate()\n  checks that its computed adler32 checksum is equal to that saved by the\n  compressor and returns Z_STREAM_END only if the checksum is correct.\n\n    inflate() returns Z_OK if some progress has been made (more input processed\n  or more output produced), Z_STREAM_END if the end of the compressed data has\n  been reached and all uncompressed output has been produced, Z_NEED_DICT if a\n  preset dictionary is needed at this point, Z_DATA_ERROR if the input data was\n  corrupted (input stream not conforming to the zlib format or incorrect\n  adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent\n  (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not\n  enough memory, Z_BUF_ERROR if no progress is possible or if there was not\n  enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR\n  case, the application may then call inflateSync to look for a good\n  compression block.\n*/\n\n\nZEXTERN(int)  inflateEnd OF((z_streamp strm));\n/*\n     All dynamically allocated data structures for this stream are freed.\n   This function discards any unprocessed input and does not flush any\n   pending output.\n\n     inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state\n   was inconsistent. In the error case, msg may be set but then points to a\n   static string (which must not be deallocated).\n*/\n\n                        /* Advanced functions */\n\n/*\n    The following functions are needed only in some special applications.\n*/\n\n/*\nZEXTERN(int)  deflateInit2 OF((z_streamp strm,\n                                     int  level,\n                                     int  method,\n                                     int  windowBits,\n                                     int  memLevel,\n                                     int  strategy));\n\n     This is another version of deflateInit with more compression options. The\n   fields next_in, zalloc, zfree and opaque must be initialized before by\n   the caller.\n\n     The method parameter is the compression method. It must be Z_DEFLATED in\n   this version of the library.\n\n     The windowBits parameter is the base two logarithm of the window size\n   (the size of the history buffer).  It should be in the range 8..15 for this\n   version of the library. Larger values of this parameter result in better\n   compression at the expense of memory usage. The default value is 15 if\n   deflateInit is used instead.\n\n     The memLevel parameter specifies how much memory should be allocated\n   for the internal compression state. memLevel=1 uses minimum memory but\n   is slow and reduces compression ratio; memLevel=9 uses maximum memory\n   for optimal speed. The default value is 8. See zconf.h for total memory\n   usage as a function of windowBits and memLevel.\n\n     The strategy parameter is used to tune the compression algorithm. Use the\n   value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a\n   filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no\n   string match).  Filtered data consists mostly of small values with a\n   somewhat random distribution. In this case, the compression algorithm is\n   tuned to compress them better. The effect of Z_FILTERED is to force more\n   Huffman coding and less string matching; it is somewhat intermediate\n   between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects\n   the compression ratio but not the correctness of the compressed output even\n   if it is not set appropriately.\n\n      deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough\n   memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid\n   method). msg is set to null if there is no error message.  deflateInit2 does\n   not perform any compression: this will be done by deflate().\n*/\n\n/*\n     Initializes the compression dictionary from the given byte sequence\n   without producing any compressed output. This function must be called\n   immediately after deflateInit, deflateInit2 or deflateReset, before any\n   call of deflate. The compressor and decompressor must use exactly the same\n   dictionary (see inflateSetDictionary).\n\n     The dictionary should consist of strings (byte sequences) that are likely\n   to be encountered later in the data to be compressed, with the most commonly\n   used strings preferably put towards the end of the dictionary. Using a\n   dictionary is most useful when the data to be compressed is short and can be\n   predicted with good accuracy; the data can then be compressed better than\n   with the default empty dictionary.\n\n     Depending on the size of the compression data structures selected by\n   deflateInit or deflateInit2, a part of the dictionary may in effect be\n   discarded, for example if the dictionary is larger than the window size in\n   deflate or deflate2. Thus the strings most likely to be useful should be\n   put at the end of the dictionary, not at the front.\n\n     Upon return of this function, strm->adler is set to the Adler32 value\n   of the dictionary; the decompressor may later use this value to determine\n   which dictionary has been used by the compressor. (The Adler32 value\n   applies to the whole dictionary even if only a subset of the dictionary is\n   actually used by the compressor.)\n\n     deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a\n   parameter is invalid (such as NULL dictionary) or the stream state is\n   inconsistent (for example if deflate has already been called for this stream\n   or if the compression method is bsort). deflateSetDictionary does not\n   perform any compression: this will be done by deflate().\n*/\n\n/*\n     Sets the destination stream as a complete copy of the source stream.\n\n     This function can be useful when several compression strategies will be\n   tried, for example when there are several ways of pre-processing the input\n   data with a filter. The streams that will be discarded should then be freed\n   by calling deflateEnd.  Note that deflateCopy duplicates the internal\n   compression state which can be quite large, so this strategy is slow and\n   can consume lots of memory.\n\n     deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not\n   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent\n   (such as zalloc being NULL). msg is left unchanged in both source and\n   destination.\n*/\n\n/*\n     This function is equivalent to deflateEnd followed by deflateInit,\n   but does not free and reallocate all the internal compression state.\n   The stream will keep the same compression level and any other attributes\n   that may have been set by deflateInit2.\n\n      deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent (such as zalloc or state being NULL).\n*/\n\n/*\n     Dynamically update the compression level and compression strategy.  The\n   interpretation of level and strategy is as in deflateInit2.  This can be\n   used to switch between compression and straight copy of the input data, or\n   to switch to a different kind of input data requiring a different\n   strategy. If the compression level is changed, the input available so far\n   is compressed with the old level (and may be flushed); the new level will\n   take effect only at the next call of deflate().\n\n     Before the call of deflateParams, the stream state must be set as for\n   a call of deflate(), since the currently available input may have to\n   be compressed and flushed. In particular, strm->avail_out must be non-zero.\n\n     deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source\n   stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR\n   if strm->avail_out was zero.\n*/\n\n/*\nZEXTERN(int)  inflateInit2 OF((z_streamp strm,\n                                     int  windowBits));\n\n     This is another version of inflateInit with an extra parameter. The\n   fields next_in, avail_in, zalloc, zfree and opaque must be initialized\n   before by the caller.\n\n     The windowBits parameter is the base two logarithm of the maximum window\n   size (the size of the history buffer).  It should be in the range 8..15 for\n   this version of the library. The default value is 15 if inflateInit is used\n   instead. If a compressed stream with a larger window size is given as\n   input, inflate() will return with the error code Z_DATA_ERROR instead of\n   trying to allocate a larger window.\n\n      inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough\n   memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative\n   memLevel). msg is set to null if there is no error message.  inflateInit2\n   does not perform any decompression apart from reading the zlib header if\n   present: this will be done by inflate(). (So next_in and avail_in may be\n   modified, but next_out and avail_out are unchanged.)\n*/\n\n/*\n     Initializes the decompression dictionary from the given uncompressed byte\n   sequence. This function must be called immediately after a call of inflate\n   if this call returned Z_NEED_DICT. The dictionary chosen by the compressor\n   can be determined from the Adler32 value returned by this call of\n   inflate. The compressor and decompressor must use exactly the same\n   dictionary (see deflateSetDictionary).\n\n     inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a\n   parameter is invalid (such as NULL dictionary) or the stream state is\n   inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the\n   expected one (incorrect Adler32 value). inflateSetDictionary does not\n   perform any decompression: this will be done by subsequent calls of\n   inflate().\n*/\n\n/*\n    Skips invalid compressed data until a full flush point (see above the\n  description of deflate with Z_FULL_FLUSH) can be found, or until all\n  available input is skipped. No output is provided.\n\n    inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR\n  if no more input was provided, Z_DATA_ERROR if no flush point has been found,\n  or Z_STREAM_ERROR if the stream structure was inconsistent. In the success\n  case, the application may save the current current value of total_in which\n  indicates where valid compressed data was found. In the error case, the\n  application may repeatedly call inflateSync, providing more input each time,\n  until success or end of the input data.\n*/\n\nZEXTERN(int)  inflateReset OF((z_streamp strm));\n/*\n     This function is equivalent to inflateEnd followed by inflateInit,\n   but does not free and reallocate all the internal decompression state.\n   The stream will keep attributes that may have been set by inflateInit2.\n\n      inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent (such as zalloc or state being NULL).\n*/\n\n\n                        /* utility functions */\n\n/*\n     The following utility functions are implemented on top of the\n   basic stream-oriented functions. To simplify the interface, some\n   default options are assumed (compression level and memory usage,\n   standard memory allocation functions). The source code of these\n   utility functions can easily be modified if you need special options.\n*/\n\n/*\n     Compresses the source buffer into the destination buffer.  sourceLen is\n   the byte length of the source buffer. Upon entry, destLen is the total\n   size of the destination buffer, which must be at least 0.1% larger than\n   sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the\n   compressed buffer.\n     This function can be used to compress a whole file at once if the\n   input file is mmap'ed.\n     compress returns Z_OK if success, Z_MEM_ERROR if there was not\n   enough memory, Z_BUF_ERROR if there was not enough room in the output\n   buffer.\n*/\n\n/*\n     Compresses the source buffer into the destination buffer. The level\n   parameter has the same meaning as in deflateInit.  sourceLen is the byte\n   length of the source buffer. Upon entry, destLen is the total size of the\n   destination buffer, which must be at least 0.1% larger than sourceLen plus\n   12 bytes. Upon exit, destLen is the actual size of the compressed buffer.\n\n     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough\n   memory, Z_BUF_ERROR if there was not enough room in the output buffer,\n   Z_STREAM_ERROR if the level parameter is invalid.\n*/\n\n/*\n     Decompresses the source buffer into the destination buffer.  sourceLen is\n   the byte length of the source buffer. Upon entry, destLen is the total\n   size of the destination buffer, which must be large enough to hold the\n   entire uncompressed data. (The size of the uncompressed data must have\n   been saved previously by the compressor and transmitted to the decompressor\n   by some mechanism outside the scope of this compression library.)\n   Upon exit, destLen is the actual size of the compressed buffer.\n     This function can be used to decompress a whole file at once if the\n   input file is mmap'ed.\n\n     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not\n   enough memory, Z_BUF_ERROR if there was not enough room in the output\n   buffer, or Z_DATA_ERROR if the input data was corrupted.\n*/\n\n\n/*\n     Opens a gzip (.gz) file for reading or writing. The mode parameter\n   is as in fopen (\"rb\" or \"wb\") but can also include a compression level\n   (\"wb9\") or a strategy: 'f' for filtered data as in \"wb6f\", 'h' for\n   Huffman only compression as in \"wb1h\". (See the description\n   of deflateInit2 for more information about the strategy parameter.)\n\n     gzopen can be used to read a file which is not in gzip format; in this\n   case gzread will directly read from the file without decompression.\n\n     gzopen returns NULL if the file could not be opened or if there was\n   insufficient memory to allocate the (de)compression state; errno\n   can be checked to distinguish the two cases (if errno is zero, the\n   zlib error is Z_MEM_ERROR).  */\n\n/*\n     gzdopen() associates a gzFile with the file descriptor fd.  File\n   descriptors are obtained from calls like open, dup, creat, pipe or\n   fileno (in the file has been previously opened with fopen).\n   The mode parameter is as in gzopen.\n     The next call of gzclose on the returned gzFile will also close the\n   file descriptor fd, just like fclose(fdopen(fd), mode) closes the file\n   descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).\n     gzdopen returns NULL if there was insufficient memory to allocate\n   the (de)compression state.\n*/\n\n/*\n     Dynamically update the compression level or strategy. See the description\n   of deflateInit2 for the meaning of these parameters.\n     gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not\n   opened for writing.\n*/\n\n/*\n     Reads the given number of uncompressed bytes from the compressed file.\n   If the input file was not in gzip format, gzread copies the given number\n   of bytes into the buffer.\n     gzread returns the number of uncompressed bytes actually read (0 for\n   end of file, -1 for error). */\n\n/*\n     Writes the given number of uncompressed bytes into the compressed file.\n   gzwrite returns the number of uncompressed bytes actually written\n   (0 in case of error).\n*/\n\n/*\n     Converts, formats, and writes the args to the compressed file under\n   control of the format string, as in fprintf. gzprintf returns the number of\n   uncompressed bytes actually written (0 in case of error).\n*/\n\n/*\n      Writes the given null-terminated string to the compressed file, excluding\n   the terminating null character.\n      gzputs returns the number of characters written, or -1 in case of error.\n*/\n\n/*\n      Reads bytes from the compressed file until len-1 characters are read, or\n   a newline character is read and transferred to buf, or an end-of-file\n   condition is encountered.  The string is then terminated with a null\n   character.\n      gzgets returns buf, or Z_NULL in case of error.\n*/\n\n/*\n      Writes c, converted to an unsigned char, into the compressed file.\n   gzputc returns the value that was written, or -1 in case of error.\n*/\n\n/*\n      Reads one byte from the compressed file. gzgetc returns this byte\n   or -1 in case of end of file or error.\n*/\n\n/*\n     Flushes all pending output into the compressed file. The parameter\n   flush is as in the deflate() function. The return value is the zlib\n   error number (see function gzerror below). gzflush returns Z_OK if\n   the flush parameter is Z_FINISH and all output could be flushed.\n     gzflush should be called only when strictly necessary because it can\n   degrade compression.\n*/\n\n/*\n      Sets the starting position for the next gzread or gzwrite on the\n   given compressed file. The offset represents a number of bytes in the\n   uncompressed data stream. The whence parameter is defined as in lseek(2);\n   the value SEEK_END is not supported.\n     If the file is opened for reading, this function is emulated but can be\n   extremely slow. If the file is opened for writing, only forward seeks are\n   supported; gzseek then compresses a sequence of zeroes up to the new\n   starting position.\n\n      gzseek returns the resulting offset location as measured in bytes from\n   the beginning of the uncompressed stream, or -1 in case of error, in\n   particular if the file is opened for writing and the new starting position\n   would be before the current position.\n*/\n\n/*\n     Rewinds the given file. This function is supported only for reading.\n\n   gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)\n*/\n\n/*\n     Returns the starting position for the next gzread or gzwrite on the\n   given compressed file. This position represents a number of bytes in the\n   uncompressed data stream.\n\n   gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)\n*/\n\n/*\n     Returns 1 when EOF has previously been detected reading the given\n   input stream, otherwise zero.\n*/\n\n/*\n     Flushes all pending output if necessary, closes the compressed file\n   and deallocates all the (de)compression state. The return value is the zlib\n   error number (see function gzerror below).\n*/\n\n/*\n     Returns the error message for the last error which occurred on the\n   given compressed file. errnum is set to zlib error number. If an\n   error occurred in the file system and not in the compression library,\n   errnum is set to Z_ERRNO and the application may consult errno\n   to get the exact error code.\n*/\n\n                        /* checksum functions */\n\n/*\n     These functions are not related to compression but are exported\n   anyway because they might be useful in applications using the\n   compression library.\n*/\n\nZEXTERN(uLong)  adler32 OF((uLong adler, const Bytef *buf, uInt len));\n\n/*\n     Update a running Adler-32 checksum with the bytes buf[0..len-1] and\n   return the updated checksum. If buf is NULL, this function returns\n   the required initial value for the checksum.\n   An Adler-32 checksum is almost as reliable as a CRC32 but can be computed\n   much faster. Usage example:\n\n     uLong adler = adler32(0L, Z_NULL, 0);\n\n     while (read_buffer(buffer, length) != EOF) {\n       adler = adler32(adler, buffer, length);\n     }\n     if (adler != original_adler) error();\n*/\n\n/*\n     Update a running crc with the bytes buf[0..len-1] and return the updated\n   crc. If buf is NULL, this function returns the required initial value\n   for the crc. Pre- and post-conditioning (one's complement) is performed\n   within this function so it shouldn't be done by the application.\n   Usage example:\n\n     uLong crc = crc32(0L, Z_NULL, 0);\n\n     while (read_buffer(buffer, length) != EOF) {\n       crc = crc32(crc, buffer, length);\n     }\n     if (crc != original_crc) error();\n*/\n\n\n                        /* various hacks, don't look :) */\n\n/* deflateInit and inflateInit are macros to allow checking the zlib version\n * and the compiler's view of z_stream:\n */\nZEXTERN(int)  inflateInit2_ OF((z_streamp strm, int  windowBits,\n                                      const char *version, int stream_size));\n#define deflateInit(strm, level) \\\n        deflateInit_((strm), (level),       ZLIB_VERSION, sizeof(z_stream))\n#define inflateInit(strm) \\\n        inflateInit_((strm),                ZLIB_VERSION, sizeof(z_stream))\n#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \\\n        deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\\\n                      (strategy),           ZLIB_VERSION, sizeof(z_stream))\n#define inflateInit2(strm, windowBits) \\\n        inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* _ZLIB_H */\n"
  },
  {
    "path": "ext/freetype2/src/gzip/zutil.c",
    "content": "/* zutil.c -- target dependent utility functions for the compression library\n * Copyright (C) 1995-2002 Jean-loup Gailly.\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/* @(#) $Id$ */\n\n#include \"zutil.h\"\n\n#ifndef STDC\nextern void exit OF((int));\n#endif\n\n\n#ifndef HAVE_MEMCPY\n\nvoid zmemcpy(dest, source, len)\n    Bytef* dest;\n    const Bytef* source;\n    uInt  len;\n{\n    if (len == 0) return;\n    do {\n        *dest++ = *source++; /* ??? to be unrolled */\n    } while (--len != 0);\n}\n\nint zmemcmp(s1, s2, len)\n    const Bytef* s1;\n    const Bytef* s2;\n    uInt  len;\n{\n    uInt j;\n\n    for (j = 0; j < len; j++) {\n        if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;\n    }\n    return 0;\n}\n\nvoid zmemzero(dest, len)\n    Bytef* dest;\n    uInt  len;\n{\n    if (len == 0) return;\n    do {\n        *dest++ = 0;  /* ??? to be unrolled */\n    } while (--len != 0);\n}\n#endif\n\n#if defined( MSDOS ) && defined( __TURBOC__ ) && !defined( MY_ZCALLOC )\n#if (defined( __BORLANDC__) || !defined(SMALL_MEDIUM)) && !defined(__32BIT__)\n/* Small and medium model in Turbo C are for now limited to near allocation\n * with reduced MAX_WBITS and MAX_MEM_LEVEL\n */\n#  define MY_ZCALLOC\n\n/* Turbo C malloc() does not allow dynamic allocation of 64K bytes\n * and farmalloc(64K) returns a pointer with an offset of 8, so we\n * must fix the pointer. Warning: the pointer must be put back to its\n * original form in order to free it, use zcfree().\n */\n\n#define MAX_PTR 10\n/* 10*64K = 640K */\n\nlocal int next_ptr = 0;\n\ntypedef struct ptr_table_s {\n    voidpf org_ptr;\n    voidpf new_ptr;\n} ptr_table;\n\nlocal ptr_table table[MAX_PTR];\n/* This table is used to remember the original form of pointers\n * to large buffers (64K). Such pointers are normalized with a zero offset.\n * Since MSDOS is not a preemptive multitasking OS, this table is not\n * protected from concurrent access. This hack doesn't work anyway on\n * a protected system like OS/2. Use Microsoft C instead.\n */\n\nvoidpf zcalloc (voidpf opaque, unsigned items, unsigned size)\n{\n    voidpf buf = opaque; /* just to make some compilers happy */\n    ulg bsize = (ulg)items*size;\n\n    /* If we allocate less than 65520 bytes, we assume that farmalloc\n     * will return a usable pointer which doesn't have to be normalized.\n     */\n    if (bsize < 65520L) {\n        buf = farmalloc(bsize);\n        if (*(ush*)&buf != 0) return buf;\n    } else {\n        buf = farmalloc(bsize + 16L);\n    }\n    if (buf == NULL || next_ptr >= MAX_PTR) return NULL;\n    table[next_ptr].org_ptr = buf;\n\n    /* Normalize the pointer to seg:0 */\n    *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4;\n    *(ush*)&buf = 0;\n    table[next_ptr++].new_ptr = buf;\n    return buf;\n}\n\nvoid  zcfree (voidpf opaque, voidpf ptr)\n{\n    int n;\n    if (*(ush*)&ptr != 0) { /* object < 64K */\n        farfree(ptr);\n        return;\n    }\n    /* Find the original pointer */\n    for (n = 0; n < next_ptr; n++) {\n        if (ptr != table[n].new_ptr) continue;\n\n        farfree(table[n].org_ptr);\n        while (++n < next_ptr) {\n            table[n-1] = table[n];\n        }\n        next_ptr--;\n        return;\n    }\n    ptr = opaque; /* just to make some compilers happy */\n    Assert(0, \"zcfree: ptr not found\");\n}\n#endif\n#endif /* MSDOS && __TURBOC__ */\n\n\n#if defined(M_I86) && !defined(__32BIT__) && !defined( MY_ZCALLOC )\n/* Microsoft C in 16-bit mode */\n\n#  define MY_ZCALLOC\n\n#if (!defined(_MSC_VER) || (_MSC_VER <= 600))\n#  define _halloc  halloc\n#  define _hfree   hfree\n#endif\n\nvoidpf zcalloc (voidpf opaque, unsigned items, unsigned size)\n{\n    if (opaque) opaque = 0; /* to make compiler happy */\n    return _halloc((long)items, size);\n}\n\nvoid  zcfree (voidpf opaque, voidpf ptr)\n{\n    if (opaque) opaque = 0; /* to make compiler happy */\n    _hfree(ptr);\n}\n\n#endif /* MSC */\n\n\n#ifndef MY_ZCALLOC /* Any system without a special alloc function */\n\n#ifndef STDC\nextern voidp  ft_scalloc OF((uInt items, uInt size));\nextern void   ft_sfree   OF((voidpf ptr));\n#endif\n\nvoidpf zcalloc (opaque, items, size)\n    voidpf opaque;\n    unsigned items;\n    unsigned size;\n{\n    if (opaque) items += size - size; /* make compiler happy */\n    return (voidpf)ft_scalloc(items, size);\n}\n\nvoid  zcfree (opaque, ptr)\n    voidpf opaque;\n    voidpf ptr;\n{\n    ft_sfree(ptr);\n    if (opaque) return; /* make compiler happy */\n}\n\n#endif /* MY_ZCALLOC */\n"
  },
  {
    "path": "ext/freetype2/src/gzip/zutil.h",
    "content": "/* zutil.h -- internal interface and configuration of the compression library\n * Copyright (C) 1995-2002 Jean-loup Gailly.\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/* WARNING: this file should *not* be used by applications. It is\n   part of the implementation of the compression library and is\n   subject to change. Applications should only use zlib.h.\n */\n\n/* @(#) $Id$ */\n\n#ifndef _Z_UTIL_H\n#define _Z_UTIL_H\n\n#include \"zlib.h\"\n\n#ifdef STDC\n#  include <stddef.h>\n#  include <string.h>\n#  include <stdlib.h>\n#endif\n#ifdef NO_ERRNO_H\n    extern int errno;\n#else\n#   include <errno.h>\n#endif\n\n#ifndef local\n#  define local static\n#endif\n/* compile with -Dlocal if your debugger can't find static symbols */\n\ntypedef unsigned char  uch;\ntypedef uch FAR uchf;\ntypedef unsigned short ush;\ntypedef ush FAR ushf;\ntypedef unsigned long  ulg;\n\n\n#define ERR_RETURN(strm,err) \\\n  return (strm->msg = (char*)ERR_MSG(err), (err))\n/* To be used only when the state is known to be valid */\n\n        /* common constants */\n\n#ifndef DEF_WBITS\n#  define DEF_WBITS MAX_WBITS\n#endif\n/* default windowBits for decompression. MAX_WBITS is for compression only */\n\n#if MAX_MEM_LEVEL >= 8\n#  define DEF_MEM_LEVEL 8\n#else\n#  define DEF_MEM_LEVEL  MAX_MEM_LEVEL\n#endif\n/* default memLevel */\n\n#define STORED_BLOCK 0\n#define STATIC_TREES 1\n#define DYN_TREES    2\n/* The three kinds of block type */\n\n#define MIN_MATCH  3\n#define MAX_MATCH  258\n/* The minimum and maximum match lengths */\n\n#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */\n\n        /* target dependencies */\n\n#ifdef MSDOS\n#  define OS_CODE  0x00\n#  if defined(__TURBOC__) || defined(__BORLANDC__)\n#    if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))\n       /* Allow compilation with ANSI keywords only enabled */\n       void _Cdecl farfree( void *block );\n       void *_Cdecl farmalloc( unsigned long nbytes );\n#    else\n#     include <alloc.h>\n#    endif\n#  else /* MSC or DJGPP */\n#  endif\n#endif\n\n#ifdef OS2\n#  define OS_CODE  0x06\n#endif\n\n#ifdef WIN32 /* Window 95 & Windows NT */\n#  define OS_CODE  0x0b\n#endif\n\n#if defined(VAXC) || defined(VMS)\n#  define OS_CODE  0x02\n#  define F_OPEN(name, mode) \\\n     ft_fopen((name), (mode), \"mbc=60\", \"ctx=stm\", \"rfm=fix\", \"mrs=512\")\n#endif\n\n#ifdef AMIGA\n#  define OS_CODE  0x01\n#endif\n\n#if defined(ATARI) || defined(atarist)\n#  define OS_CODE  0x05\n#endif\n\n#if defined(MACOS) || defined(TARGET_OS_MAC)\n#  define OS_CODE  0x07\n#  if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os\n#    include <unix.h> /* for fdopen */\n#  else\n#    ifndef fdopen\n#      define fdopen(fd,mode) NULL /* No fdopen() */\n#    endif\n#  endif\n#endif\n\n#ifdef __50SERIES /* Prime/PRIMOS */\n#  define OS_CODE  0x0F\n#endif\n\n#ifdef TOPS20\n#  define OS_CODE  0x0a\n#endif\n\n#if defined(_BEOS_) || defined(RISCOS)\n#  define fdopen(fd,mode) NULL /* No fdopen() */\n#endif\n\n#if (defined(_MSC_VER) && (_MSC_VER > 600))\n#  define fdopen(fd,type)  _fdopen(fd,type)\n#endif\n\n\n        /* Common defaults */\n\n#ifndef OS_CODE\n#  define OS_CODE  0x03  /* assume Unix */\n#endif\n\n#ifndef F_OPEN\n#  define F_OPEN(name, mode) ft_fopen((name), (mode))\n#endif\n\n         /* functions */\n\n#ifdef HAVE_STRERROR\n   extern char *strerror OF((int));\n#  define zstrerror(errnum) strerror(errnum)\n#else\n#  define zstrerror(errnum) \"\"\n#endif\n\n#if defined(pyr)\n#  define NO_MEMCPY\n#endif\n#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)\n /* Use our own functions for small and medium model with MSC <= 5.0.\n  * You may have to use the same strategy for Borland C (untested).\n  * The __SC__ check is for Symantec.\n  */\n#  define NO_MEMCPY\n#endif\n#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)\n#  define HAVE_MEMCPY\n#endif\n#ifdef HAVE_MEMCPY\n#  ifdef SMALL_MEDIUM /* MSDOS small or medium model */\n#    define zmemcpy _fmemcpy\n#    define zmemcmp _fmemcmp\n#    define zmemzero(dest, len) _fmemset(dest, 0, len)\n#  else\n#    define zmemcpy ft_memcpy\n#    define zmemcmp ft_memcmp\n#    define zmemzero(dest, len) ft_memset(dest, 0, len)\n#  endif\n#else\n   extern void zmemcpy  OF((Bytef* dest, const Bytef* source, uInt len));\n   extern int  zmemcmp  OF((const Bytef* s1, const Bytef* s2, uInt len));\n   extern void zmemzero OF((Bytef* dest, uInt len));\n#endif\n\n/* Diagnostic functions */\n#ifdef DEBUG\n#  include <stdio.h>\n   extern int z_verbose;\n   extern void z_error    OF((char *m));\n#  define Assert(cond,msg) {if(!(cond)) z_error(msg);}\n#  define Trace(x) {if (z_verbose>=0) fprintf x ;}\n#  define Tracev(x) {if (z_verbose>0) fprintf x ;}\n#  define Tracevv(x) {if (z_verbose>1) fprintf x ;}\n#  define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}\n#  define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}\n#else\n#  define Assert(cond,msg)\n#  define Trace(x)\n#  define Tracev(x)\n#  define Tracevv(x)\n#  define Tracec(c,x)\n#  define Tracecv(c,x)\n#endif\n\n\ntypedef uLong (*check_func) OF((uLong check, const Bytef *buf,\n                                uInt len));\nlocal voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));\nlocal void   zcfree  OF((voidpf opaque, voidpf ptr));\n\n#define ZALLOC(strm, items, size) \\\n           (*((strm)->zalloc))((strm)->opaque, (items), (size))\n#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))\n#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}\n\n#endif /* _Z_UTIL_H */\n"
  },
  {
    "path": "ext/freetype2/src/lzw/Jamfile",
    "content": "# FreeType 2 src/lzw Jamfile\n#\n# Copyright 2004, 2006 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) lzw ;\n\nLibrary  $(FT2_LIB) : ftlzw.c ;\n\n# end of src/lzw Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/lzw/ftlzw.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlzw.c                                                                */\n/*                                                                         */\n/*    FreeType support for .Z compressed files.                            */\n/*                                                                         */\n/*  This optional component relies on NetBSD's zopen().  It should mainly  */\n/*  be used to parse compressed PCF fonts, as found with many X11 server   */\n/*  distributions.                                                         */\n/*                                                                         */\n/*  Copyright 2004-2006, 2009, 2010, 2012-2014 by                          */\n/*  Albert Chin-A-Young.                                                   */\n/*                                                                         */\n/*  Based on code in src/gzip/ftgzip.c, Copyright 2004 by                  */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#include <ft2build.h>\n#include FT_INTERNAL_MEMORY_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_LZW_H\n#include FT_CONFIG_STANDARD_LIBRARY_H\n\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  LZW_Err_\n#define FT_ERR_BASE    FT_Mod_Err_LZW\n\n#include FT_ERRORS_H\n\n\n#ifdef FT_CONFIG_OPTION_USE_LZW\n\n#ifdef FT_CONFIG_OPTION_PIC\n#error \"lzw code does not support PIC yet\"\n#endif\n\n#include \"ftzopen.h\"\n\n\n/***************************************************************************/\n/***************************************************************************/\n/*****                                                                 *****/\n/*****                  M E M O R Y   M A N A G E M E N T              *****/\n/*****                                                                 *****/\n/***************************************************************************/\n/***************************************************************************/\n\n/***************************************************************************/\n/***************************************************************************/\n/*****                                                                 *****/\n/*****                   F I L E   D E S C R I P T O R                 *****/\n/*****                                                                 *****/\n/***************************************************************************/\n/***************************************************************************/\n\n#define FT_LZW_BUFFER_SIZE  4096\n\n  typedef struct  FT_LZWFileRec_\n  {\n    FT_Stream       source;         /* parent/source stream        */\n    FT_Stream       stream;         /* embedding stream            */\n    FT_Memory       memory;         /* memory allocator            */\n    FT_LzwStateRec  lzw;            /* lzw decompressor state      */\n\n    FT_Byte         buffer[FT_LZW_BUFFER_SIZE]; /* output buffer      */\n    FT_ULong        pos;                        /* position in output */\n    FT_Byte*        cursor;\n    FT_Byte*        limit;\n\n  } FT_LZWFileRec, *FT_LZWFile;\n\n\n  /* check and skip .Z header */\n  static FT_Error\n  ft_lzw_check_header( FT_Stream  stream )\n  {\n    FT_Error  error;\n    FT_Byte   head[2];\n\n\n    if ( FT_STREAM_SEEK( 0 )       ||\n         FT_STREAM_READ( head, 2 ) )\n      goto Exit;\n\n    /* head[0] && head[1] are the magic numbers */\n    if ( head[0] != 0x1F ||\n         head[1] != 0x9D )\n      error = FT_THROW( Invalid_File_Format );\n\n  Exit:\n    return error;\n  }\n\n\n  static FT_Error\n  ft_lzw_file_init( FT_LZWFile  zip,\n                    FT_Stream   stream,\n                    FT_Stream   source )\n  {\n    FT_LzwState  lzw   = &zip->lzw;\n    FT_Error     error;\n\n\n    zip->stream = stream;\n    zip->source = source;\n    zip->memory = stream->memory;\n\n    zip->limit  = zip->buffer + FT_LZW_BUFFER_SIZE;\n    zip->cursor = zip->limit;\n    zip->pos    = 0;\n\n    /* check and skip .Z header */\n    error = ft_lzw_check_header( source );\n    if ( error )\n      goto Exit;\n\n    /* initialize internal lzw variable */\n    ft_lzwstate_init( lzw, source );\n\n  Exit:\n    return error;\n  }\n\n\n  static void\n  ft_lzw_file_done( FT_LZWFile  zip )\n  {\n    /* clear the rest */\n    ft_lzwstate_done( &zip->lzw );\n\n    zip->memory = NULL;\n    zip->source = NULL;\n    zip->stream = NULL;\n  }\n\n\n  static FT_Error\n  ft_lzw_file_reset( FT_LZWFile  zip )\n  {\n    FT_Stream  stream = zip->source;\n    FT_Error   error;\n\n\n    if ( !FT_STREAM_SEEK( 0 ) )\n    {\n      ft_lzwstate_reset( &zip->lzw );\n\n      zip->limit  = zip->buffer + FT_LZW_BUFFER_SIZE;\n      zip->cursor = zip->limit;\n      zip->pos    = 0;\n    }\n\n    return error;\n  }\n\n\n  static FT_Error\n  ft_lzw_file_fill_output( FT_LZWFile  zip )\n  {\n    FT_LzwState  lzw = &zip->lzw;\n    FT_ULong     count;\n    FT_Error     error = FT_Err_Ok;\n\n\n    zip->cursor = zip->buffer;\n\n    count = ft_lzwstate_io( lzw, zip->buffer, FT_LZW_BUFFER_SIZE );\n\n    zip->limit = zip->cursor + count;\n\n    if ( count == 0 )\n      error = FT_THROW( Invalid_Stream_Operation );\n\n    return error;\n  }\n\n\n  /* fill output buffer; `count' must be <= FT_LZW_BUFFER_SIZE */\n  static FT_Error\n  ft_lzw_file_skip_output( FT_LZWFile  zip,\n                           FT_ULong    count )\n  {\n    FT_Error  error = FT_Err_Ok;\n\n\n    /* first, we skip what we can from the output buffer */\n    {\n      FT_ULong  delta = (FT_ULong)( zip->limit - zip->cursor );\n\n\n      if ( delta >= count )\n        delta = count;\n\n      zip->cursor += delta;\n      zip->pos    += delta;\n\n      count -= delta;\n    }\n\n    /* next, we skip as many bytes remaining as possible */\n    while ( count > 0 )\n    {\n      FT_ULong  delta = FT_LZW_BUFFER_SIZE;\n      FT_ULong  numread;\n\n\n      if ( delta > count )\n        delta = count;\n\n      numread = ft_lzwstate_io( &zip->lzw, NULL, delta );\n      if ( numread < delta )\n      {\n        /* not enough bytes */\n        error = FT_THROW( Invalid_Stream_Operation );\n        break;\n      }\n\n      zip->pos += delta;\n      count    -= delta;\n    }\n\n    return error;\n  }\n\n\n  static FT_ULong\n  ft_lzw_file_io( FT_LZWFile  zip,\n                  FT_ULong    pos,\n                  FT_Byte*    buffer,\n                  FT_ULong    count )\n  {\n    FT_ULong  result = 0;\n    FT_Error  error;\n\n\n    /* seeking backwards. */\n    if ( pos < zip->pos )\n    {\n      /* If the new position is within the output buffer, simply       */\n      /* decrement pointers, otherwise we reset the stream completely! */\n      if ( ( zip->pos - pos ) <= (FT_ULong)( zip->cursor - zip->buffer ) )\n      {\n        zip->cursor -= zip->pos - pos;\n        zip->pos     = pos;\n      }\n      else\n      {\n        error = ft_lzw_file_reset( zip );\n        if ( error )\n          goto Exit;\n      }\n    }\n\n    /* skip unwanted bytes */\n    if ( pos > zip->pos )\n    {\n      error = ft_lzw_file_skip_output( zip, (FT_ULong)( pos - zip->pos ) );\n      if ( error )\n        goto Exit;\n    }\n\n    if ( count == 0 )\n      goto Exit;\n\n    /* now read the data */\n    for (;;)\n    {\n      FT_ULong  delta;\n\n\n      delta = (FT_ULong)( zip->limit - zip->cursor );\n      if ( delta >= count )\n        delta = count;\n\n      FT_MEM_COPY( buffer + result, zip->cursor, delta );\n      result      += delta;\n      zip->cursor += delta;\n      zip->pos    += delta;\n\n      count -= delta;\n      if ( count == 0 )\n        break;\n\n      error = ft_lzw_file_fill_output( zip );\n      if ( error )\n        break;\n    }\n\n  Exit:\n    return result;\n  }\n\n\n/***************************************************************************/\n/***************************************************************************/\n/*****                                                                 *****/\n/*****            L Z W   E M B E D D I N G   S T R E A M              *****/\n/*****                                                                 *****/\n/***************************************************************************/\n/***************************************************************************/\n\n  static void\n  ft_lzw_stream_close( FT_Stream  stream )\n  {\n    FT_LZWFile  zip    = (FT_LZWFile)stream->descriptor.pointer;\n    FT_Memory   memory = stream->memory;\n\n\n    if ( zip )\n    {\n      /* finalize lzw file descriptor */\n      ft_lzw_file_done( zip );\n\n      FT_FREE( zip );\n\n      stream->descriptor.pointer = NULL;\n    }\n  }\n\n\n  static FT_ULong\n  ft_lzw_stream_io( FT_Stream  stream,\n                    FT_ULong   pos,\n                    FT_Byte*   buffer,\n                    FT_ULong   count )\n  {\n    FT_LZWFile  zip = (FT_LZWFile)stream->descriptor.pointer;\n\n\n    return ft_lzw_file_io( zip, pos, buffer, count );\n  }\n\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Stream_OpenLZW( FT_Stream  stream,\n                     FT_Stream  source )\n  {\n    FT_Error    error;\n    FT_Memory   memory;\n    FT_LZWFile  zip = NULL;\n\n\n    if ( !stream || !source )\n    {\n      error = FT_THROW( Invalid_Stream_Handle );\n      goto Exit;\n    }\n\n    memory = source->memory;\n\n    /*\n     *  Check the header right now; this prevents allocation of a huge\n     *  LZWFile object (400 KByte of heap memory) if not necessary.\n     *\n     *  Did I mention that you should never use .Z compressed font\n     *  files?\n     */\n    error = ft_lzw_check_header( source );\n    if ( error )\n      goto Exit;\n\n    FT_ZERO( stream );\n    stream->memory = memory;\n\n    if ( !FT_NEW( zip ) )\n    {\n      error = ft_lzw_file_init( zip, stream, source );\n      if ( error )\n      {\n        FT_FREE( zip );\n        goto Exit;\n      }\n\n      stream->descriptor.pointer = zip;\n    }\n\n    stream->size  = 0x7FFFFFFFL;  /* don't know the real size! */\n    stream->pos   = 0;\n    stream->base  = 0;\n    stream->read  = ft_lzw_stream_io;\n    stream->close = ft_lzw_stream_close;\n\n  Exit:\n    return error;\n  }\n\n\n#include \"ftzopen.c\"\n\n\n#else  /* !FT_CONFIG_OPTION_USE_LZW */\n\n\n  FT_EXPORT_DEF( FT_Error )\n  FT_Stream_OpenLZW( FT_Stream  stream,\n                     FT_Stream  source )\n  {\n    FT_UNUSED( stream );\n    FT_UNUSED( source );\n\n    return FT_THROW( Unimplemented_Feature );\n  }\n\n\n#endif /* !FT_CONFIG_OPTION_USE_LZW */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/lzw/ftzopen.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftzopen.c                                                              */\n/*                                                                         */\n/*    FreeType support for .Z compressed files.                            */\n/*                                                                         */\n/*  This optional component relies on NetBSD's zopen().  It should mainly  */\n/*  be used to parse compressed PCF fonts, as found with many X11 server   */\n/*  distributions.                                                         */\n/*                                                                         */\n/*  Copyright 2005-2007, 2009, 2011 by David Turner.                       */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#include \"ftzopen.h\"\n#include FT_INTERNAL_MEMORY_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_DEBUG_H\n\n\n  static int\n  ft_lzwstate_refill( FT_LzwState  state )\n  {\n    FT_ULong  count;\n\n\n    if ( state->in_eof )\n      return -1;\n\n    count = FT_Stream_TryRead( state->source,\n                               state->buf_tab,\n                               state->num_bits );  /* WHY? */\n\n    state->buf_size   = (FT_UInt)count;\n    state->buf_total += count;\n    state->in_eof     = FT_BOOL( count < state->num_bits );\n    state->buf_offset = 0;\n    state->buf_size   = ( state->buf_size << 3 ) - ( state->num_bits - 1 );\n\n    if ( count == 0 )  /* end of file */\n      return -1;\n\n    return 0;\n  }\n\n\n  static FT_Int32\n  ft_lzwstate_get_code( FT_LzwState  state )\n  {\n    FT_UInt   num_bits = state->num_bits;\n    FT_Int    offset   = state->buf_offset;\n    FT_Byte*  p;\n    FT_Int    result;\n\n\n    if ( state->buf_clear                    ||\n         offset >= state->buf_size           ||\n         state->free_ent >= state->free_bits )\n    {\n      if ( state->free_ent >= state->free_bits )\n      {\n        state->num_bits  = ++num_bits;\n        state->free_bits = state->num_bits < state->max_bits\n                           ? (FT_UInt)( ( 1UL << num_bits ) - 256 )\n                           : state->max_free + 1;\n      }\n\n      if ( state->buf_clear )\n      {\n        state->num_bits  = num_bits = LZW_INIT_BITS;\n        state->free_bits = (FT_UInt)( ( 1UL << num_bits ) - 256 );\n        state->buf_clear = 0;\n      }\n\n      if ( ft_lzwstate_refill( state ) < 0 )\n        return -1;\n\n      offset = 0;\n    }\n\n    state->buf_offset = offset + num_bits;\n\n    p         = &state->buf_tab[offset >> 3];\n    offset   &= 7;\n    result    = *p++ >> offset;\n    offset    = 8 - offset;\n    num_bits -= offset;\n\n    if ( num_bits >= 8 )\n    {\n      result   |= *p++ << offset;\n      offset   += 8;\n      num_bits -= 8;\n    }\n    if ( num_bits > 0 )\n      result |= ( *p & LZW_MASK( num_bits ) ) << offset;\n\n    return result;\n  }\n\n\n  /* grow the character stack */\n  static int\n  ft_lzwstate_stack_grow( FT_LzwState  state )\n  {\n    if ( state->stack_top >= state->stack_size )\n    {\n      FT_Memory  memory = state->memory;\n      FT_Error   error;\n      FT_Offset  old_size = state->stack_size;\n      FT_Offset  new_size = old_size;\n\n      new_size = new_size + ( new_size >> 1 ) + 4;\n\n      if ( state->stack == state->stack_0 )\n      {\n        state->stack = NULL;\n        old_size     = 0;\n      }\n\n      /* requirement of the character stack larger than 1<<LZW_MAX_BITS */\n      /* implies bug in the decompression code                          */\n      if ( new_size > ( 1 << LZW_MAX_BITS ) )\n      {\n        new_size = 1 << LZW_MAX_BITS;\n        if ( new_size == old_size )\n          return -1;\n      }\n\n      if ( FT_RENEW_ARRAY( state->stack, old_size, new_size ) )\n        return -1;\n\n      state->stack_size = new_size;\n    }\n    return 0;\n  }\n\n\n  /* grow the prefix/suffix arrays */\n  static int\n  ft_lzwstate_prefix_grow( FT_LzwState  state )\n  {\n    FT_UInt    old_size = state->prefix_size;\n    FT_UInt    new_size = old_size;\n    FT_Memory  memory   = state->memory;\n    FT_Error   error;\n\n\n    if ( new_size == 0 )  /* first allocation -> 9 bits */\n      new_size = 512;\n    else\n      new_size += new_size >> 2;  /* don't grow too fast */\n\n    /*\n     *  Note that the `suffix' array is located in the same memory block\n     *  pointed to by `prefix'.\n     *\n     *  I know that sizeof(FT_Byte) == 1 by definition, but it is clearer\n     *  to write it literally.\n     *\n     */\n    if ( FT_REALLOC_MULT( state->prefix, old_size, new_size,\n                          sizeof ( FT_UShort ) + sizeof ( FT_Byte ) ) )\n      return -1;\n\n    /* now adjust `suffix' and move the data accordingly */\n    state->suffix = (FT_Byte*)( state->prefix + new_size );\n\n    FT_MEM_MOVE( state->suffix,\n                 state->prefix + old_size,\n                 old_size * sizeof ( FT_Byte ) );\n\n    state->prefix_size = new_size;\n    return 0;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  ft_lzwstate_reset( FT_LzwState  state )\n  {\n    state->in_eof     = 0;\n    state->buf_offset = 0;\n    state->buf_size   = 0;\n    state->buf_clear  = 0;\n    state->buf_total  = 0;\n    state->stack_top  = 0;\n    state->num_bits   = LZW_INIT_BITS;\n    state->phase      = FT_LZW_PHASE_START;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  ft_lzwstate_init( FT_LzwState  state,\n                    FT_Stream    source )\n  {\n    FT_ZERO( state );\n\n    state->source = source;\n    state->memory = source->memory;\n\n    state->prefix      = NULL;\n    state->suffix      = NULL;\n    state->prefix_size = 0;\n\n    state->stack      = state->stack_0;\n    state->stack_size = sizeof ( state->stack_0 );\n\n    ft_lzwstate_reset( state );\n  }\n\n\n  FT_LOCAL_DEF( void )\n  ft_lzwstate_done( FT_LzwState  state )\n  {\n    FT_Memory  memory = state->memory;\n\n\n    ft_lzwstate_reset( state );\n\n    if ( state->stack != state->stack_0 )\n      FT_FREE( state->stack );\n\n    FT_FREE( state->prefix );\n    state->suffix = NULL;\n\n    FT_ZERO( state );\n  }\n\n\n#define FTLZW_STACK_PUSH( c )                        \\\n  FT_BEGIN_STMNT                                     \\\n    if ( state->stack_top >= state->stack_size &&    \\\n         ft_lzwstate_stack_grow( state ) < 0   )     \\\n      goto Eof;                                      \\\n                                                     \\\n    state->stack[state->stack_top++] = (FT_Byte)(c); \\\n  FT_END_STMNT\n\n\n  FT_LOCAL_DEF( FT_ULong )\n  ft_lzwstate_io( FT_LzwState  state,\n                  FT_Byte*     buffer,\n                  FT_ULong     out_size )\n  {\n    FT_ULong  result = 0;\n\n    FT_UInt  old_char = state->old_char;\n    FT_UInt  old_code = state->old_code;\n    FT_UInt  in_code  = state->in_code;\n\n\n    if ( out_size == 0 )\n      goto Exit;\n\n    switch ( state->phase )\n    {\n    case FT_LZW_PHASE_START:\n      {\n        FT_Byte   max_bits;\n        FT_Int32  c;\n\n\n        /* skip magic bytes, and read max_bits + block_flag */\n        if ( FT_Stream_Seek( state->source, 2 ) != 0               ||\n             FT_Stream_TryRead( state->source, &max_bits, 1 ) != 1 )\n          goto Eof;\n\n        state->max_bits   = max_bits & LZW_BIT_MASK;\n        state->block_mode = max_bits & LZW_BLOCK_MASK;\n        state->max_free   = (FT_UInt)( ( 1UL << state->max_bits ) - 256 );\n\n        if ( state->max_bits > LZW_MAX_BITS )\n          goto Eof;\n\n        state->num_bits = LZW_INIT_BITS;\n        state->free_ent = ( state->block_mode ? LZW_FIRST\n                                              : LZW_CLEAR ) - 256;\n        in_code  = 0;\n\n        state->free_bits = state->num_bits < state->max_bits\n                           ? (FT_UInt)( ( 1UL << state->num_bits ) - 256 )\n                           : state->max_free + 1;\n\n        c = ft_lzwstate_get_code( state );\n        if ( c < 0 || c > 255 )\n          goto Eof;\n\n        old_code = old_char = (FT_UInt)c;\n\n        if ( buffer )\n          buffer[result] = (FT_Byte)old_char;\n\n        if ( ++result >= out_size )\n          goto Exit;\n\n        state->phase = FT_LZW_PHASE_CODE;\n      }\n      /* fall-through */\n\n    case FT_LZW_PHASE_CODE:\n      {\n        FT_Int32  c;\n        FT_UInt   code;\n\n\n      NextCode:\n        c = ft_lzwstate_get_code( state );\n        if ( c < 0 )\n          goto Eof;\n\n        code = (FT_UInt)c;\n\n        if ( code == LZW_CLEAR && state->block_mode )\n        {\n          /* why not LZW_FIRST-256 ? */\n          state->free_ent  = ( LZW_FIRST - 1 ) - 256;\n          state->buf_clear = 1;\n\n          /* not quite right, but at least more predictable */\n          old_code = 0;\n          old_char = 0;\n\n          goto NextCode;\n        }\n\n        in_code = code; /* save code for later */\n\n        if ( code >= 256U )\n        {\n          /* special case for KwKwKwK */\n          if ( code - 256U >= state->free_ent )\n          {\n            /* corrupted LZW stream */\n            if ( code - 256U > state->free_ent )\n              goto Eof;\n\n            FTLZW_STACK_PUSH( old_char );\n            code = old_code;\n          }\n\n          while ( code >= 256U )\n          {\n            if ( !state->prefix )\n              goto Eof;\n\n            FTLZW_STACK_PUSH( state->suffix[code - 256] );\n            code = state->prefix[code - 256];\n          }\n        }\n\n        old_char = code;\n        FTLZW_STACK_PUSH( old_char );\n\n        state->phase = FT_LZW_PHASE_STACK;\n      }\n      /* fall-through */\n\n    case FT_LZW_PHASE_STACK:\n      {\n        while ( state->stack_top > 0 )\n        {\n          --state->stack_top;\n\n          if ( buffer )\n            buffer[result] = state->stack[state->stack_top];\n\n          if ( ++result == out_size )\n            goto Exit;\n        }\n\n        /* now create new entry */\n        if ( state->free_ent < state->max_free )\n        {\n          if ( state->free_ent >= state->prefix_size &&\n               ft_lzwstate_prefix_grow( state ) < 0  )\n            goto Eof;\n\n          FT_ASSERT( state->free_ent < state->prefix_size );\n\n          state->prefix[state->free_ent] = (FT_UShort)old_code;\n          state->suffix[state->free_ent] = (FT_Byte)  old_char;\n\n          state->free_ent += 1;\n        }\n\n        old_code = in_code;\n\n        state->phase = FT_LZW_PHASE_CODE;\n        goto NextCode;\n      }\n\n    default:  /* state == EOF */\n      ;\n    }\n\n  Exit:\n    state->old_code = old_code;\n    state->old_char = old_char;\n    state->in_code  = in_code;\n\n    return result;\n\n  Eof:\n    state->phase = FT_LZW_PHASE_EOF;\n    goto Exit;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/lzw/ftzopen.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftzopen.h                                                              */\n/*                                                                         */\n/*    FreeType support for .Z compressed files.                            */\n/*                                                                         */\n/*  This optional component relies on NetBSD's zopen().  It should mainly  */\n/*  be used to parse compressed PCF fonts, as found with many X11 server   */\n/*  distributions.                                                         */\n/*                                                                         */\n/*  Copyright 2005, 2006, 2007, 2008 by David Turner.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#ifndef __FT_ZOPEN_H__\n#define __FT_ZOPEN_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n\n  /*\n   *  This is a complete re-implementation of the LZW file reader,\n   *  since the old one was incredibly badly written, using\n   *  400 KByte of heap memory before decompressing anything.\n   *\n   */\n\n#define FT_LZW_IN_BUFF_SIZE        64\n#define FT_LZW_DEFAULT_STACK_SIZE  64\n\n#define LZW_INIT_BITS     9\n#define LZW_MAX_BITS      16\n\n#define LZW_CLEAR         256\n#define LZW_FIRST         257\n\n#define LZW_BIT_MASK      0x1F\n#define LZW_BLOCK_MASK    0x80\n#define LZW_MASK( n )     ( ( 1U << (n) ) - 1U )\n\n\n  typedef enum  FT_LzwPhase_\n  {\n    FT_LZW_PHASE_START = 0,\n    FT_LZW_PHASE_CODE,\n    FT_LZW_PHASE_STACK,\n    FT_LZW_PHASE_EOF\n\n  } FT_LzwPhase;\n\n\n  /*\n   *  state of LZW decompressor\n   *\n   *  small technical note\n   *  --------------------\n   *\n   *  We use a few tricks in this implementation that are explained here to\n   *  ease debugging and maintenance.\n   *\n   *  - First of all, the `prefix' and `suffix' arrays contain the suffix\n   *    and prefix for codes over 256; this means that\n   *\n   *      prefix_of(code) == state->prefix[code-256]\n   *      suffix_of(code) == state->suffix[code-256]\n   *\n   *    Each prefix is a 16-bit code, and each suffix an 8-bit byte.\n   *\n   *    Both arrays are stored in a single memory block, pointed to by\n   *    `state->prefix'.  This means that the following equality is always\n   *    true:\n   *\n   *      state->suffix == (FT_Byte*)(state->prefix + state->prefix_size)\n   *\n   *    Of course, state->prefix_size is the number of prefix/suffix slots\n   *    in the arrays, corresponding to codes 256..255+prefix_size.\n   *\n   *  - `free_ent' is the index of the next free entry in the `prefix'\n   *    and `suffix' arrays.  This means that the corresponding `next free\n   *    code' is really `256+free_ent'.\n   *\n   *    Moreover, `max_free' is the maximum value that `free_ent' can reach.\n   *\n   *    `max_free' corresponds to `(1 << max_bits) - 256'.  Note that this\n   *    value is always <= 0xFF00, which means that both `free_ent' and\n   *    `max_free' can be stored in an FT_UInt variable, even on 16-bit\n   *    machines.\n   *\n   *    If `free_ent == max_free', you cannot add new codes to the\n   *    prefix/suffix table.\n   *\n   *  - `num_bits' is the current number of code bits, starting at 9 and\n   *    growing each time `free_ent' reaches the value of `free_bits'.  The\n   *    latter is computed as follows\n   *\n   *      if num_bits < max_bits:\n   *         free_bits = (1 << num_bits)-256\n   *      else:\n   *         free_bits = max_free + 1\n   *\n   *    Since the value of `max_free + 1' can never be reached by\n   *    `free_ent', `num_bits' cannot grow larger than `max_bits'.\n   */\n\n  typedef struct  FT_LzwStateRec_\n  {\n    FT_LzwPhase  phase;\n    FT_Int       in_eof;\n\n    FT_Byte      buf_tab[16];\n    FT_Int       buf_offset;\n    FT_Int       buf_size;\n    FT_Bool      buf_clear;\n    FT_Offset    buf_total;\n\n    FT_UInt      max_bits;    /* max code bits, from file header   */\n    FT_Int       block_mode;  /* block mode flag, from file header */\n    FT_UInt      max_free;    /* (1 << max_bits) - 256             */\n\n    FT_UInt      num_bits;    /* current code bit number */\n    FT_UInt      free_ent;    /* index of next free entry */\n    FT_UInt      free_bits;   /* if reached by free_ent, increment num_bits */\n    FT_UInt      old_code;\n    FT_UInt      old_char;\n    FT_UInt      in_code;\n\n    FT_UShort*   prefix;      /* always dynamically allocated / reallocated */\n    FT_Byte*     suffix;      /* suffix = (FT_Byte*)(prefix + prefix_size)  */\n    FT_UInt      prefix_size; /* number of slots in `prefix' or `suffix'    */\n\n    FT_Byte*     stack;       /* character stack */\n    FT_UInt      stack_top;\n    FT_Offset    stack_size;\n    FT_Byte      stack_0[FT_LZW_DEFAULT_STACK_SIZE]; /* minimize heap alloc */\n\n    FT_Stream    source;      /* source stream */\n    FT_Memory    memory;\n\n  } FT_LzwStateRec, *FT_LzwState;\n\n\n  FT_LOCAL( void )\n  ft_lzwstate_init( FT_LzwState  state,\n                    FT_Stream    source );\n\n  FT_LOCAL( void )\n  ft_lzwstate_done( FT_LzwState  state );\n\n\n  FT_LOCAL( void )\n  ft_lzwstate_reset( FT_LzwState  state );\n\n\n  FT_LOCAL( FT_ULong )\n  ft_lzwstate_io( FT_LzwState  state,\n                  FT_Byte*     buffer,\n                  FT_ULong     out_size );\n\n/* */\n\n#endif /* __FT_ZOPEN_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/lzw/rules.mk",
    "content": "#\n# FreeType 2 LZW support configuration rules\n#\n\n\n# Copyright 2004, 2005, 2006 by\n# Albert Chin-A-Young.\n#\n# Based on src/lzw/rules.mk, Copyright 2002 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\n# LZW driver directory\n#\nLZW_DIR := $(SRC_DIR)/lzw\n\n\n# compilation flags for the driver\n#\nLZW_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(LZW_DIR))\n\n\n# LZW support sources (i.e., C files)\n#\nLZW_DRV_SRC := $(LZW_DIR)/ftlzw.c\n\n# LZW support headers\n#\nLZW_DRV_H := $(LZW_DIR)/ftzopen.h \\\n             $(LZW_DIR)/ftzopen.c\n\n\n# LZW driver object(s)\n#\n#   LZW_DRV_OBJ_M is used during `multi' builds\n#   LZW_DRV_OBJ_S is used during `single' builds\n#\nLZW_DRV_OBJ_M := $(OBJ_DIR)/ftlzw.$O\nLZW_DRV_OBJ_S := $(OBJ_DIR)/ftlzw.$O\n\n# LZW support source file for single build\n#\nLZW_DRV_SRC_S := $(LZW_DIR)/ftlzw.c\n\n\n# LZW support - single object\n#\n$(LZW_DRV_OBJ_S): $(LZW_DRV_SRC_S) $(LZW_DRV_SRC) $(FREETYPE_H) $(LZW_DRV_H)\n\t$(LZW_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(LZW_DRV_SRC_S))\n\n\n# LZW support - multiple objects\n#\n$(OBJ_DIR)/%.$O: $(LZW_DIR)/%.c $(FREETYPE_H) $(LZW_DRV_H)\n\t$(LZW_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\n\n\n# update main driver object lists\n#\nDRV_OBJS_S += $(LZW_DRV_OBJ_S)\nDRV_OBJS_M += $(LZW_DRV_OBJ_M)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/otvalid/Jamfile",
    "content": "# FreeType 2 src/otvalid Jamfile\n#\n# Copyright 2004 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) otvalid ;\n\n{\n  local  _sources ;\n\n  if $(FT2_MULTI)\n  {\n    _sources = otvbase otvcommn otvgdef otvgpos otvgsub otvjstf otvmod otvmath ;\n  }\n  else\n  {\n    _sources = otvalid ;\n  }\n\n  Library  $(FT2_LIB) : $(_sources).c ;\n}\n\n# end of src/otvalid Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/otvalid/module.mk",
    "content": "#\n# FreeType 2 otvalid module definition\n#\n\n\n# Copyright 2004, 2006 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\nFTMODULE_H_COMMANDS += OTVALID_MODULE\n\ndefine OTVALID_MODULE\n$(OPEN_DRIVER) FT_Module_Class, otv_module_class $(CLOSE_DRIVER)\n$(ECHO_DRIVER)otvalid   $(ECHO_DRIVER_DESC)OpenType validation module$(ECHO_DRIVER_DONE)\nendef\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/otvalid/otvalid.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  otvalid.c                                                              */\n/*                                                                         */\n/*    FreeType validator for OpenType tables (body only).                  */\n/*                                                                         */\n/*  Copyright 2004, 2007 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#define FT_MAKE_OPTION_SINGLE_OBJECT\n\n#include <ft2build.h>\n\n#include \"otvbase.c\"\n#include \"otvcommn.c\"\n#include \"otvgdef.c\"\n#include \"otvgpos.c\"\n#include \"otvgsub.c\"\n#include \"otvjstf.c\"\n#include \"otvmath.c\"\n#include \"otvmod.c\"\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/otvalid/otvalid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  otvalid.h                                                              */\n/*                                                                         */\n/*    OpenType table validation (specification only).                      */\n/*                                                                         */\n/*  Copyright 2004, 2008 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __OTVALID_H__\n#define __OTVALID_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#include \"otverror.h\"           /* must come before FT_INTERNAL_VALIDATE_H */\n\n#include FT_INTERNAL_VALIDATE_H\n#include FT_INTERNAL_STREAM_H\n\n\nFT_BEGIN_HEADER\n\n\n  FT_LOCAL( void )\n  otv_BASE_validate( FT_Bytes      table,\n                     FT_Validator  valid );\n\n  /* GSUB and GPOS tables should already be validated; */\n  /* if missing, set corresponding argument to 0       */\n  FT_LOCAL( void )\n  otv_GDEF_validate( FT_Bytes      table,\n                     FT_Bytes      gsub,\n                     FT_Bytes      gpos,\n                     FT_UInt       glyph_count,\n                     FT_Validator  valid );\n\n  FT_LOCAL( void )\n  otv_GPOS_validate( FT_Bytes      table,\n                     FT_UInt       glyph_count,\n                     FT_Validator  valid );\n\n  FT_LOCAL( void )\n  otv_GSUB_validate( FT_Bytes      table,\n                     FT_UInt       glyph_count,\n                     FT_Validator  valid );\n\n  /* GSUB and GPOS tables should already be validated; */\n  /* if missing, set corresponding argument to 0       */\n  FT_LOCAL( void )\n  otv_JSTF_validate( FT_Bytes      table,\n                     FT_Bytes      gsub,\n                     FT_Bytes      gpos,\n                     FT_UInt       glyph_count,\n                     FT_Validator  valid );\n\n  FT_LOCAL( void )\n  otv_MATH_validate( FT_Bytes      table,\n                     FT_UInt       glyph_count,\n                     FT_Validator  ftvalid );\n\n\nFT_END_HEADER\n\n#endif /* __OTVALID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/otvalid/otvbase.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  otvbase.c                                                              */\n/*                                                                         */\n/*    OpenType BASE table validation (body).                               */\n/*                                                                         */\n/*  Copyright 2004, 2007 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"otvalid.h\"\n#include \"otvcommn.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_otvbase\n\n\n  static void\n  otv_BaseCoord_validate( FT_Bytes       table,\n                          OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   BaseCoordFormat;\n\n\n    OTV_NAME_ENTER( \"BaseCoord\" );\n\n    OTV_LIMIT_CHECK( 4 );\n    BaseCoordFormat = FT_NEXT_USHORT( p );\n    p += 2;     /* skip Coordinate */\n\n    OTV_TRACE(( \" (format %d)\\n\", BaseCoordFormat ));\n\n    switch ( BaseCoordFormat )\n    {\n    case 1:     /* BaseCoordFormat1 */\n      break;\n\n    case 2:     /* BaseCoordFormat2 */\n      OTV_LIMIT_CHECK( 4 );   /* ReferenceGlyph, BaseCoordPoint */\n      break;\n\n    case 3:     /* BaseCoordFormat3 */\n      OTV_LIMIT_CHECK( 2 );\n      /* DeviceTable */\n      otv_Device_validate( table + FT_NEXT_USHORT( p ), otvalid );\n      break;\n\n    default:\n      FT_INVALID_FORMAT;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  static void\n  otv_BaseTagList_validate( FT_Bytes       table,\n                            OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   BaseTagCount;\n\n\n    OTV_NAME_ENTER( \"BaseTagList\" );\n\n    OTV_LIMIT_CHECK( 2 );\n\n    BaseTagCount = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (BaseTagCount = %d)\\n\", BaseTagCount ));\n\n    OTV_LIMIT_CHECK( BaseTagCount * 4 );          /* BaselineTag */\n\n    OTV_EXIT;\n  }\n\n\n  static void\n  otv_BaseValues_validate( FT_Bytes       table,\n                           OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   BaseCoordCount;\n\n\n    OTV_NAME_ENTER( \"BaseValues\" );\n\n    OTV_LIMIT_CHECK( 4 );\n\n    p             += 2;                     /* skip DefaultIndex */\n    BaseCoordCount = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (BaseCoordCount = %d)\\n\", BaseCoordCount ));\n\n    OTV_LIMIT_CHECK( BaseCoordCount * 2 );\n\n    /* BaseCoord */\n    for ( ; BaseCoordCount > 0; BaseCoordCount-- )\n      otv_BaseCoord_validate( table + FT_NEXT_USHORT( p ), otvalid );\n\n    OTV_EXIT;\n  }\n\n\n  static void\n  otv_MinMax_validate( FT_Bytes       table,\n                       OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   table_size;\n    FT_UInt   FeatMinMaxCount;\n\n    OTV_OPTIONAL_TABLE( MinCoord );\n    OTV_OPTIONAL_TABLE( MaxCoord );\n\n\n    OTV_NAME_ENTER( \"MinMax\" );\n\n    OTV_LIMIT_CHECK( 6 );\n\n    OTV_OPTIONAL_OFFSET( MinCoord );\n    OTV_OPTIONAL_OFFSET( MaxCoord );\n    FeatMinMaxCount = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (FeatMinMaxCount = %d)\\n\", FeatMinMaxCount ));\n\n    table_size = FeatMinMaxCount * 8 + 6;\n\n    OTV_SIZE_CHECK( MinCoord );\n    if ( MinCoord )\n      otv_BaseCoord_validate( table + MinCoord, otvalid );\n\n    OTV_SIZE_CHECK( MaxCoord );\n    if ( MaxCoord )\n      otv_BaseCoord_validate( table + MaxCoord, otvalid );\n\n    OTV_LIMIT_CHECK( FeatMinMaxCount * 8 );\n\n    /* FeatMinMaxRecord */\n    for ( ; FeatMinMaxCount > 0; FeatMinMaxCount-- )\n    {\n      p += 4;                           /* skip FeatureTableTag */\n\n      OTV_OPTIONAL_OFFSET( MinCoord );\n      OTV_OPTIONAL_OFFSET( MaxCoord );\n\n      OTV_SIZE_CHECK( MinCoord );\n      if ( MinCoord )\n        otv_BaseCoord_validate( table + MinCoord, otvalid );\n\n      OTV_SIZE_CHECK( MaxCoord );\n      if ( MaxCoord )\n        otv_BaseCoord_validate( table + MaxCoord, otvalid );\n    }\n\n    OTV_EXIT;\n  }\n\n\n  static void\n  otv_BaseScript_validate( FT_Bytes       table,\n                           OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   table_size;\n    FT_UInt   BaseLangSysCount;\n\n    OTV_OPTIONAL_TABLE( BaseValues    );\n    OTV_OPTIONAL_TABLE( DefaultMinMax );\n\n\n    OTV_NAME_ENTER( \"BaseScript\" );\n\n    OTV_LIMIT_CHECK( 6 );\n    OTV_OPTIONAL_OFFSET( BaseValues    );\n    OTV_OPTIONAL_OFFSET( DefaultMinMax );\n    BaseLangSysCount = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (BaseLangSysCount = %d)\\n\", BaseLangSysCount ));\n\n    table_size = BaseLangSysCount * 6 + 6;\n\n    OTV_SIZE_CHECK( BaseValues );\n    if ( BaseValues )\n      otv_BaseValues_validate( table + BaseValues, otvalid );\n\n    OTV_SIZE_CHECK( DefaultMinMax );\n    if ( DefaultMinMax )\n      otv_MinMax_validate( table + DefaultMinMax, otvalid );\n\n    OTV_LIMIT_CHECK( BaseLangSysCount * 6 );\n\n    /* BaseLangSysRecord */\n    for ( ; BaseLangSysCount > 0; BaseLangSysCount-- )\n    {\n      p += 4;       /* skip BaseLangSysTag */\n\n      otv_MinMax_validate( table + FT_NEXT_USHORT( p ), otvalid );\n    }\n\n    OTV_EXIT;\n  }\n\n\n  static void\n  otv_BaseScriptList_validate( FT_Bytes       table,\n                               OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   BaseScriptCount;\n\n\n    OTV_NAME_ENTER( \"BaseScriptList\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    BaseScriptCount = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (BaseScriptCount = %d)\\n\", BaseScriptCount ));\n\n    OTV_LIMIT_CHECK( BaseScriptCount * 6 );\n\n    /* BaseScriptRecord */\n    for ( ; BaseScriptCount > 0; BaseScriptCount-- )\n    {\n      p += 4;       /* skip BaseScriptTag */\n\n      /* BaseScript */\n      otv_BaseScript_validate( table + FT_NEXT_USHORT( p ), otvalid );\n    }\n\n    OTV_EXIT;\n  }\n\n\n  static void\n  otv_Axis_validate( FT_Bytes       table,\n                     OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   table_size;\n\n    OTV_OPTIONAL_TABLE( BaseTagList );\n\n\n    OTV_NAME_ENTER( \"Axis\" );\n\n    OTV_LIMIT_CHECK( 4 );\n    OTV_OPTIONAL_OFFSET( BaseTagList );\n\n    table_size = 4;\n\n    OTV_SIZE_CHECK( BaseTagList );\n    if ( BaseTagList )\n      otv_BaseTagList_validate( table + BaseTagList, otvalid );\n\n    /* BaseScriptList */\n    otv_BaseScriptList_validate( table + FT_NEXT_USHORT( p ), otvalid );\n\n    OTV_EXIT;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  otv_BASE_validate( FT_Bytes      table,\n                     FT_Validator  ftvalid )\n  {\n    OTV_ValidatorRec  otvalidrec;\n    OTV_Validator     otvalid = &otvalidrec;\n    FT_Bytes          p       = table;\n    FT_UInt           table_size;\n\n    OTV_OPTIONAL_TABLE( HorizAxis );\n    OTV_OPTIONAL_TABLE( VertAxis  );\n\n\n    otvalid->root = ftvalid;\n\n    FT_TRACE3(( \"validating BASE table\\n\" ));\n    OTV_INIT;\n\n    OTV_LIMIT_CHECK( 6 );\n\n    if ( FT_NEXT_ULONG( p ) != 0x10000UL )      /* Version */\n      FT_INVALID_FORMAT;\n\n    table_size = 6;\n\n    OTV_OPTIONAL_OFFSET( HorizAxis );\n    OTV_SIZE_CHECK( HorizAxis );\n    if ( HorizAxis )\n      otv_Axis_validate( table + HorizAxis, otvalid );\n\n    OTV_OPTIONAL_OFFSET( VertAxis );\n    OTV_SIZE_CHECK( VertAxis );\n    if ( VertAxis )\n      otv_Axis_validate( table + VertAxis, otvalid );\n\n    FT_TRACE4(( \"\\n\" ));\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/otvalid/otvcommn.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  otvcommn.c                                                             */\n/*                                                                         */\n/*    OpenType common tables validation (body).                            */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2006, 2007 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"otvcommn.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_otvcommon\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       COVERAGE TABLE                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL_DEF( void )\n  otv_Coverage_validate( FT_Bytes       table,\n                         OTV_Validator  otvalid,\n                         FT_Int         expected_count )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   CoverageFormat;\n    FT_UInt   total = 0;\n\n\n    OTV_NAME_ENTER( \"Coverage\" );\n\n    OTV_LIMIT_CHECK( 4 );\n    CoverageFormat = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (format %d)\\n\", CoverageFormat ));\n\n    switch ( CoverageFormat )\n    {\n    case 1:     /* CoverageFormat1 */\n      {\n        FT_UInt  GlyphCount;\n        FT_UInt  i;\n\n\n        GlyphCount = FT_NEXT_USHORT( p );\n\n        OTV_TRACE(( \" (GlyphCount = %d)\\n\", GlyphCount ));\n\n        OTV_LIMIT_CHECK( GlyphCount * 2 );        /* GlyphArray */\n\n        for ( i = 0; i < GlyphCount; ++i )\n        {\n          FT_UInt  gid;\n\n\n          gid = FT_NEXT_USHORT( p );\n          if ( gid >= otvalid->glyph_count )\n            FT_INVALID_GLYPH_ID;\n        }\n\n        total = GlyphCount;\n      }\n      break;\n\n    case 2:     /* CoverageFormat2 */\n      {\n        FT_UInt  n, RangeCount;\n        FT_UInt  Start, End, StartCoverageIndex, last = 0;\n\n\n        RangeCount = FT_NEXT_USHORT( p );\n\n        OTV_TRACE(( \" (RangeCount = %d)\\n\", RangeCount ));\n\n        OTV_LIMIT_CHECK( RangeCount * 6 );\n\n        /* RangeRecord */\n        for ( n = 0; n < RangeCount; n++ )\n        {\n          Start              = FT_NEXT_USHORT( p );\n          End                = FT_NEXT_USHORT( p );\n          StartCoverageIndex = FT_NEXT_USHORT( p );\n\n          if ( Start > End || StartCoverageIndex != total )\n            FT_INVALID_DATA;\n\n          if ( End >= otvalid->glyph_count )\n            FT_INVALID_GLYPH_ID;\n\n          if ( n > 0 && Start <= last )\n            FT_INVALID_DATA;\n\n          total += End - Start + 1;\n          last   = End;\n        }\n      }\n      break;\n\n    default:\n      FT_INVALID_FORMAT;\n    }\n\n    /* Generally, a coverage table offset has an associated count field.  */\n    /* The number of glyphs in the table should match this field.  If     */\n    /* there is no associated count, a value of -1 tells us not to check. */\n    if ( expected_count != -1 && (FT_UInt)expected_count != total )\n      FT_INVALID_DATA;\n\n    OTV_EXIT;\n  }\n\n\n  FT_LOCAL_DEF( FT_UInt )\n  otv_Coverage_get_first( FT_Bytes  table )\n  {\n    FT_Bytes  p = table;\n\n\n    p += 4;     /* skip CoverageFormat and Glyph/RangeCount */\n\n    return FT_NEXT_USHORT( p );\n  }\n\n\n  FT_LOCAL_DEF( FT_UInt )\n  otv_Coverage_get_last( FT_Bytes  table )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   CoverageFormat = FT_NEXT_USHORT( p );\n    FT_UInt   count          = FT_NEXT_USHORT( p );     /* Glyph/RangeCount */\n    FT_UInt   result = 0;\n\n\n    switch ( CoverageFormat )\n    {\n    case 1:\n      p += ( count - 1 ) * 2;\n      result = FT_NEXT_USHORT( p );\n      break;\n\n    case 2:\n      p += ( count - 1 ) * 6 + 2;\n      result = FT_NEXT_USHORT( p );\n      break;\n\n    default:\n      ;\n    }\n\n    return result;\n  }\n\n\n  FT_LOCAL_DEF( FT_UInt )\n  otv_Coverage_get_count( FT_Bytes  table )\n  {\n    FT_Bytes  p              = table;\n    FT_UInt   CoverageFormat = FT_NEXT_USHORT( p );\n    FT_UInt   count          = FT_NEXT_USHORT( p );     /* Glyph/RangeCount */\n    FT_UInt   result         = 0;\n\n\n    switch ( CoverageFormat )\n    {\n    case 1:\n      return count;\n\n    case 2:\n      {\n        FT_UInt  Start, End;\n\n\n        for ( ; count > 0; count-- )\n        {\n          Start = FT_NEXT_USHORT( p );\n          End   = FT_NEXT_USHORT( p );\n          p    += 2;                    /* skip StartCoverageIndex */\n\n          result += End - Start + 1;\n        }\n      }\n      break;\n\n    default:\n      ;\n    }\n\n    return result;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                   CLASS DEFINITION TABLE                      *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL_DEF( void )\n  otv_ClassDef_validate( FT_Bytes       table,\n                         OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   ClassFormat;\n\n\n    OTV_NAME_ENTER( \"ClassDef\" );\n\n    OTV_LIMIT_CHECK( 4 );\n    ClassFormat = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (format %d)\\n\", ClassFormat ));\n\n    switch ( ClassFormat )\n    {\n    case 1:     /* ClassDefFormat1 */\n      {\n        FT_UInt  StartGlyph;\n        FT_UInt  GlyphCount;\n\n\n        OTV_LIMIT_CHECK( 4 );\n\n        StartGlyph = FT_NEXT_USHORT( p );\n        GlyphCount = FT_NEXT_USHORT( p );\n\n        OTV_TRACE(( \" (GlyphCount = %d)\\n\", GlyphCount ));\n\n        OTV_LIMIT_CHECK( GlyphCount * 2 );    /* ClassValueArray */\n\n        if ( StartGlyph + GlyphCount - 1 >= otvalid->glyph_count )\n          FT_INVALID_GLYPH_ID;\n      }\n      break;\n\n    case 2:     /* ClassDefFormat2 */\n      {\n        FT_UInt  n, ClassRangeCount;\n        FT_UInt  Start, End, last = 0;\n\n\n        ClassRangeCount = FT_NEXT_USHORT( p );\n\n        OTV_TRACE(( \" (ClassRangeCount = %d)\\n\", ClassRangeCount ));\n\n        OTV_LIMIT_CHECK( ClassRangeCount * 6 );\n\n        /* ClassRangeRecord */\n        for ( n = 0; n < ClassRangeCount; n++ )\n        {\n          Start = FT_NEXT_USHORT( p );\n          End   = FT_NEXT_USHORT( p );\n          p    += 2;                        /* skip Class */\n\n          if ( Start > End || ( n > 0 && Start <= last ) )\n            FT_INVALID_DATA;\n\n          if ( End >= otvalid->glyph_count )\n            FT_INVALID_GLYPH_ID;\n\n          last = End;\n        }\n      }\n      break;\n\n    default:\n      FT_INVALID_FORMAT;\n    }\n\n    /* no need to check glyph indices used as input to class definition   */\n    /* tables since even invalid glyph indices return a meaningful result */\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      DEVICE TABLE                             *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL_DEF( void )\n  otv_Device_validate( FT_Bytes       table,\n                       OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   StartSize, EndSize, DeltaFormat, count;\n\n\n    OTV_NAME_ENTER( \"Device\" );\n\n    OTV_LIMIT_CHECK( 8 );\n    StartSize   = FT_NEXT_USHORT( p );\n    EndSize     = FT_NEXT_USHORT( p );\n    DeltaFormat = FT_NEXT_USHORT( p );\n\n    if ( DeltaFormat < 1 || DeltaFormat > 3 )\n      FT_INVALID_FORMAT;\n\n    if ( EndSize < StartSize )\n      FT_INVALID_DATA;\n\n    count = EndSize - StartSize + 1;\n    OTV_LIMIT_CHECK( ( 1 << DeltaFormat ) * count / 8 );  /* DeltaValue */\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         LOOKUPS                               *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* uses otvalid->type_count */\n  /* uses otvalid->type_funcs */\n\n  FT_LOCAL_DEF( void )\n  otv_Lookup_validate( FT_Bytes       table,\n                       OTV_Validator  otvalid )\n  {\n    FT_Bytes           p = table;\n    FT_UInt            LookupType, SubTableCount;\n    OTV_Validate_Func  validate;\n\n\n    OTV_NAME_ENTER( \"Lookup\" );\n\n    OTV_LIMIT_CHECK( 6 );\n    LookupType    = FT_NEXT_USHORT( p );\n    p            += 2;                      /* skip LookupFlag */\n    SubTableCount = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (type %d)\\n\", LookupType ));\n\n    if ( LookupType == 0 || LookupType > otvalid->type_count )\n      FT_INVALID_DATA;\n\n    validate = otvalid->type_funcs[LookupType - 1];\n\n    OTV_TRACE(( \" (SubTableCount = %d)\\n\", SubTableCount ));\n\n    OTV_LIMIT_CHECK( SubTableCount * 2 );\n\n    /* SubTable */\n    for ( ; SubTableCount > 0; SubTableCount-- )\n      validate( table + FT_NEXT_USHORT( p ), otvalid );\n\n    OTV_EXIT;\n  }\n\n\n  /* uses valid->lookup_count */\n\n  FT_LOCAL_DEF( void )\n  otv_LookupList_validate( FT_Bytes       table,\n                           OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   LookupCount;\n\n\n    OTV_NAME_ENTER( \"LookupList\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    LookupCount = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (LookupCount = %d)\\n\", LookupCount ));\n\n    OTV_LIMIT_CHECK( LookupCount * 2 );\n\n    otvalid->lookup_count = LookupCount;\n\n    /* Lookup */\n    for ( ; LookupCount > 0; LookupCount-- )\n      otv_Lookup_validate( table + FT_NEXT_USHORT( p ), otvalid );\n\n    OTV_EXIT;\n  }\n\n\n  static FT_UInt\n  otv_LookupList_get_count( FT_Bytes  table )\n  {\n    return FT_NEXT_USHORT( table );\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                        FEATURES                               *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* uses otvalid->lookup_count */\n\n  FT_LOCAL_DEF( void )\n  otv_Feature_validate( FT_Bytes       table,\n                        OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   LookupCount;\n\n\n    OTV_NAME_ENTER( \"Feature\" );\n\n    OTV_LIMIT_CHECK( 4 );\n    p           += 2;                   /* skip FeatureParams (unused) */\n    LookupCount  = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (LookupCount = %d)\\n\", LookupCount ));\n\n    OTV_LIMIT_CHECK( LookupCount * 2 );\n\n    /* LookupListIndex */\n    for ( ; LookupCount > 0; LookupCount-- )\n      if ( FT_NEXT_USHORT( p ) >= otvalid->lookup_count )\n        FT_INVALID_DATA;\n\n    OTV_EXIT;\n  }\n\n\n  static FT_UInt\n  otv_Feature_get_count( FT_Bytes  table )\n  {\n    return FT_NEXT_USHORT( table );\n  }\n\n\n  /* sets otvalid->lookup_count */\n\n  FT_LOCAL_DEF( void )\n  otv_FeatureList_validate( FT_Bytes       table,\n                            FT_Bytes       lookups,\n                            OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   FeatureCount;\n\n\n    OTV_NAME_ENTER( \"FeatureList\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    FeatureCount = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (FeatureCount = %d)\\n\", FeatureCount ));\n\n    OTV_LIMIT_CHECK( FeatureCount * 2 );\n\n    otvalid->lookup_count = otv_LookupList_get_count( lookups );\n\n    /* FeatureRecord */\n    for ( ; FeatureCount > 0; FeatureCount-- )\n    {\n      p += 4;       /* skip FeatureTag */\n\n      /* Feature */\n      otv_Feature_validate( table + FT_NEXT_USHORT( p ), otvalid );\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       LANGUAGE SYSTEM                         *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* uses otvalid->extra1 (number of features) */\n\n  FT_LOCAL_DEF( void )\n  otv_LangSys_validate( FT_Bytes       table,\n                        OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   ReqFeatureIndex;\n    FT_UInt   FeatureCount;\n\n\n    OTV_NAME_ENTER( \"LangSys\" );\n\n    OTV_LIMIT_CHECK( 6 );\n    p              += 2;                    /* skip LookupOrder (unused) */\n    ReqFeatureIndex = FT_NEXT_USHORT( p );\n    FeatureCount    = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (ReqFeatureIndex = %d)\\n\", ReqFeatureIndex ));\n    OTV_TRACE(( \" (FeatureCount = %d)\\n\",    FeatureCount    ));\n\n    if ( ReqFeatureIndex != 0xFFFFU && ReqFeatureIndex >= otvalid->extra1 )\n      FT_INVALID_DATA;\n\n    OTV_LIMIT_CHECK( FeatureCount * 2 );\n\n    /* FeatureIndex */\n    for ( ; FeatureCount > 0; FeatureCount-- )\n      if ( FT_NEXT_USHORT( p ) >= otvalid->extra1 )\n        FT_INVALID_DATA;\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                           SCRIPTS                             *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL_DEF( void )\n  otv_Script_validate( FT_Bytes       table,\n                       OTV_Validator  otvalid )\n  {\n    FT_UInt   DefaultLangSys, LangSysCount;\n    FT_Bytes  p = table;\n\n\n    OTV_NAME_ENTER( \"Script\" );\n\n    OTV_LIMIT_CHECK( 4 );\n    DefaultLangSys = FT_NEXT_USHORT( p );\n    LangSysCount   = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (LangSysCount = %d)\\n\", LangSysCount ));\n\n    if ( DefaultLangSys != 0 )\n      otv_LangSys_validate( table + DefaultLangSys, otvalid );\n\n    OTV_LIMIT_CHECK( LangSysCount * 6 );\n\n    /* LangSysRecord */\n    for ( ; LangSysCount > 0; LangSysCount-- )\n    {\n      p += 4;       /* skip LangSysTag */\n\n      /* LangSys */\n      otv_LangSys_validate( table + FT_NEXT_USHORT( p ), otvalid );\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /* sets otvalid->extra1 (number of features) */\n\n  FT_LOCAL_DEF( void )\n  otv_ScriptList_validate( FT_Bytes       table,\n                           FT_Bytes       features,\n                           OTV_Validator  otvalid )\n  {\n    FT_UInt   ScriptCount;\n    FT_Bytes  p = table;\n\n\n    OTV_NAME_ENTER( \"ScriptList\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    ScriptCount = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (ScriptCount = %d)\\n\", ScriptCount ));\n\n    OTV_LIMIT_CHECK( ScriptCount * 6 );\n\n    otvalid->extra1 = otv_Feature_get_count( features );\n\n    /* ScriptRecord */\n    for ( ; ScriptCount > 0; ScriptCount-- )\n    {\n      p += 4;       /* skip ScriptTag */\n\n      otv_Script_validate( table + FT_NEXT_USHORT( p ), otvalid ); /* Script */\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      UTILITY FUNCTIONS                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*\n     u:   uint16\n     ux:  unit16 [x]\n\n     s:   struct\n     sx:  struct [x]\n     sxy: struct [x], using external y count\n\n     x:   uint16 x\n\n     C:   Coverage\n\n     O:   Offset\n     On:  Offset (NULL)\n     Ox:  Offset [x]\n     Onx: Offset (NULL) [x]\n  */\n\n  FT_LOCAL_DEF( void )\n  otv_x_Ox( FT_Bytes       table,\n            OTV_Validator  otvalid )\n  {\n    FT_Bytes           p = table;\n    FT_UInt            Count;\n    OTV_Validate_Func  func;\n\n\n    OTV_ENTER;\n\n    OTV_LIMIT_CHECK( 2 );\n    Count = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (Count = %d)\\n\", Count ));\n\n    OTV_LIMIT_CHECK( Count * 2 );\n\n    otvalid->nesting_level++;\n    func = otvalid->func[otvalid->nesting_level];\n\n    for ( ; Count > 0; Count-- )\n      func( table + FT_NEXT_USHORT( p ), otvalid );\n\n    otvalid->nesting_level--;\n\n    OTV_EXIT;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  otv_u_C_x_Ox( FT_Bytes       table,\n                OTV_Validator  otvalid )\n  {\n    FT_Bytes           p = table;\n    FT_UInt            Count, Coverage;\n    OTV_Validate_Func  func;\n\n\n    OTV_ENTER;\n\n    p += 2;     /* skip Format */\n\n    OTV_LIMIT_CHECK( 4 );\n    Coverage = FT_NEXT_USHORT( p );\n    Count    = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (Count = %d)\\n\", Count ));\n\n    otv_Coverage_validate( table + Coverage, otvalid, Count );\n\n    OTV_LIMIT_CHECK( Count * 2 );\n\n    otvalid->nesting_level++;\n    func = otvalid->func[otvalid->nesting_level];\n\n    for ( ; Count > 0; Count-- )\n      func( table + FT_NEXT_USHORT( p ), otvalid );\n\n    otvalid->nesting_level--;\n\n    OTV_EXIT;\n  }\n\n\n  /* uses otvalid->extra1 (if > 0: array value limit) */\n\n  FT_LOCAL_DEF( void )\n  otv_x_ux( FT_Bytes       table,\n            OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   Count;\n\n\n    OTV_ENTER;\n\n    OTV_LIMIT_CHECK( 2 );\n    Count = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (Count = %d)\\n\", Count ));\n\n    OTV_LIMIT_CHECK( Count * 2 );\n\n    if ( otvalid->extra1 )\n    {\n      for ( ; Count > 0; Count-- )\n        if ( FT_NEXT_USHORT( p ) >= otvalid->extra1 )\n          FT_INVALID_DATA;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /* `ux' in the function's name is not really correct since only x-1 */\n  /* elements are tested                                              */\n\n  /* uses otvalid->extra1 (array value limit) */\n\n  FT_LOCAL_DEF( void )\n  otv_x_y_ux_sy( FT_Bytes       table,\n                 OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   Count1, Count2;\n\n\n    OTV_ENTER;\n\n    OTV_LIMIT_CHECK( 4 );\n    Count1 = FT_NEXT_USHORT( p );\n    Count2 = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (Count1 = %d)\\n\", Count1 ));\n    OTV_TRACE(( \" (Count2 = %d)\\n\", Count2 ));\n\n    if ( Count1 == 0 )\n      FT_INVALID_DATA;\n\n    OTV_LIMIT_CHECK( ( Count1 - 1 ) * 2 + Count2 * 4 );\n    p += ( Count1 - 1 ) * 2;\n\n    for ( ; Count2 > 0; Count2-- )\n    {\n      if ( FT_NEXT_USHORT( p ) >= Count1 )\n        FT_INVALID_DATA;\n\n      if ( FT_NEXT_USHORT( p ) >= otvalid->extra1 )\n        FT_INVALID_DATA;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /* `uy' in the function's name is not really correct since only y-1 */\n  /* elements are tested                                              */\n\n  /* uses otvalid->extra1 (array value limit) */\n\n  FT_LOCAL_DEF( void )\n  otv_x_ux_y_uy_z_uz_p_sp( FT_Bytes       table,\n                           OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   BacktrackCount, InputCount, LookaheadCount;\n    FT_UInt   Count;\n\n\n    OTV_ENTER;\n\n    OTV_LIMIT_CHECK( 2 );\n    BacktrackCount = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (BacktrackCount = %d)\\n\", BacktrackCount ));\n\n    OTV_LIMIT_CHECK( BacktrackCount * 2 + 2 );\n    p += BacktrackCount * 2;\n\n    InputCount = FT_NEXT_USHORT( p );\n    if ( InputCount == 0 )\n      FT_INVALID_DATA;\n\n    OTV_TRACE(( \" (InputCount = %d)\\n\", InputCount ));\n\n    OTV_LIMIT_CHECK( InputCount * 2 );\n    p += ( InputCount - 1 ) * 2;\n\n    LookaheadCount = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (LookaheadCount = %d)\\n\", LookaheadCount ));\n\n    OTV_LIMIT_CHECK( LookaheadCount * 2 + 2 );\n    p += LookaheadCount * 2;\n\n    Count = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (Count = %d)\\n\", Count ));\n\n    OTV_LIMIT_CHECK( Count * 4 );\n\n    for ( ; Count > 0; Count-- )\n    {\n      if ( FT_NEXT_USHORT( p ) >= InputCount )\n        FT_INVALID_DATA;\n\n      if ( FT_NEXT_USHORT( p ) >= otvalid->extra1 )\n        FT_INVALID_DATA;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /* sets otvalid->extra1 (valid->lookup_count) */\n\n  FT_LOCAL_DEF( void )\n  otv_u_O_O_x_Onx( FT_Bytes       table,\n                   OTV_Validator  otvalid )\n  {\n    FT_Bytes           p = table;\n    FT_UInt            Coverage, ClassDef, ClassSetCount;\n    OTV_Validate_Func  func;\n\n\n    OTV_ENTER;\n\n    p += 2;     /* skip Format */\n\n    OTV_LIMIT_CHECK( 6 );\n    Coverage      = FT_NEXT_USHORT( p );\n    ClassDef      = FT_NEXT_USHORT( p );\n    ClassSetCount = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (ClassSetCount = %d)\\n\", ClassSetCount ));\n\n    otv_Coverage_validate( table + Coverage, otvalid, -1 );\n    otv_ClassDef_validate( table + ClassDef, otvalid );\n\n    OTV_LIMIT_CHECK( ClassSetCount * 2 );\n\n    otvalid->nesting_level++;\n    func          = otvalid->func[otvalid->nesting_level];\n    otvalid->extra1 = otvalid->lookup_count;\n\n    for ( ; ClassSetCount > 0; ClassSetCount-- )\n    {\n      FT_UInt  offset = FT_NEXT_USHORT( p );\n\n\n      if ( offset )\n        func( table + offset, otvalid );\n    }\n\n    otvalid->nesting_level--;\n\n    OTV_EXIT;\n  }\n\n\n  /* uses otvalid->lookup_count */\n\n  FT_LOCAL_DEF( void )\n  otv_u_x_y_Ox_sy( FT_Bytes       table,\n                   OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   GlyphCount, Count, count1;\n\n\n    OTV_ENTER;\n\n    p += 2;     /* skip Format */\n\n    OTV_LIMIT_CHECK( 4 );\n    GlyphCount = FT_NEXT_USHORT( p );\n    Count      = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (GlyphCount = %d)\\n\", GlyphCount ));\n    OTV_TRACE(( \" (Count = %d)\\n\",      Count      ));\n\n    OTV_LIMIT_CHECK( GlyphCount * 2 + Count * 4 );\n\n    for ( count1 = GlyphCount; count1 > 0; count1-- )\n      otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 );\n\n    for ( ; Count > 0; Count-- )\n    {\n      if ( FT_NEXT_USHORT( p ) >= GlyphCount )\n        FT_INVALID_DATA;\n\n      if ( FT_NEXT_USHORT( p ) >= otvalid->lookup_count )\n        FT_INVALID_DATA;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /* sets otvalid->extra1 (valid->lookup_count)    */\n\n  FT_LOCAL_DEF( void )\n  otv_u_O_O_O_O_x_Onx( FT_Bytes       table,\n                       OTV_Validator  otvalid )\n  {\n    FT_Bytes           p = table;\n    FT_UInt            Coverage;\n    FT_UInt            BacktrackClassDef, InputClassDef, LookaheadClassDef;\n    FT_UInt            ChainClassSetCount;\n    OTV_Validate_Func  func;\n\n\n    OTV_ENTER;\n\n    p += 2;     /* skip Format */\n\n    OTV_LIMIT_CHECK( 10 );\n    Coverage           = FT_NEXT_USHORT( p );\n    BacktrackClassDef  = FT_NEXT_USHORT( p );\n    InputClassDef      = FT_NEXT_USHORT( p );\n    LookaheadClassDef  = FT_NEXT_USHORT( p );\n    ChainClassSetCount = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (ChainClassSetCount = %d)\\n\", ChainClassSetCount ));\n\n    otv_Coverage_validate( table + Coverage, otvalid, -1 );\n\n    otv_ClassDef_validate( table + BacktrackClassDef,  otvalid );\n    otv_ClassDef_validate( table + InputClassDef, otvalid );\n    otv_ClassDef_validate( table + LookaheadClassDef, otvalid );\n\n    OTV_LIMIT_CHECK( ChainClassSetCount * 2 );\n\n    otvalid->nesting_level++;\n    func          = otvalid->func[otvalid->nesting_level];\n    otvalid->extra1 = otvalid->lookup_count;\n\n    for ( ; ChainClassSetCount > 0; ChainClassSetCount-- )\n    {\n      FT_UInt  offset = FT_NEXT_USHORT( p );\n\n\n      if ( offset )\n        func( table + offset, otvalid );\n    }\n\n    otvalid->nesting_level--;\n\n    OTV_EXIT;\n  }\n\n\n  /* uses otvalid->lookup_count */\n\n  FT_LOCAL_DEF( void )\n  otv_u_x_Ox_y_Oy_z_Oz_p_sp( FT_Bytes       table,\n                             OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   BacktrackGlyphCount, InputGlyphCount, LookaheadGlyphCount;\n    FT_UInt   count1, count2;\n\n\n    OTV_ENTER;\n\n    p += 2;     /* skip Format */\n\n    OTV_LIMIT_CHECK( 2 );\n    BacktrackGlyphCount = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (BacktrackGlyphCount = %d)\\n\", BacktrackGlyphCount ));\n\n    OTV_LIMIT_CHECK( BacktrackGlyphCount * 2 + 2 );\n\n    for ( ; BacktrackGlyphCount > 0; BacktrackGlyphCount-- )\n      otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 );\n\n    InputGlyphCount = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (InputGlyphCount = %d)\\n\", InputGlyphCount ));\n\n    OTV_LIMIT_CHECK( InputGlyphCount * 2 + 2 );\n\n    for ( count1 = InputGlyphCount; count1 > 0; count1-- )\n      otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 );\n\n    LookaheadGlyphCount = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (LookaheadGlyphCount = %d)\\n\", LookaheadGlyphCount ));\n\n    OTV_LIMIT_CHECK( LookaheadGlyphCount * 2 + 2 );\n\n    for ( ; LookaheadGlyphCount > 0; LookaheadGlyphCount-- )\n      otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 );\n\n    count2 = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (Count = %d)\\n\", count2 ));\n\n    OTV_LIMIT_CHECK( count2 * 4 );\n\n    for ( ; count2 > 0; count2-- )\n    {\n      if ( FT_NEXT_USHORT( p ) >= InputGlyphCount )\n        FT_INVALID_DATA;\n\n      if ( FT_NEXT_USHORT( p ) >= otvalid->lookup_count )\n        FT_INVALID_DATA;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  FT_LOCAL_DEF( FT_UInt )\n  otv_GSUBGPOS_get_Lookup_count( FT_Bytes  table )\n  {\n    FT_Bytes  p = table + 8;\n\n\n    return otv_LookupList_get_count( table + FT_NEXT_USHORT( p ) );\n  }\n\n\n  FT_LOCAL_DEF( FT_UInt )\n  otv_GSUBGPOS_have_MarkAttachmentType_flag( FT_Bytes  table )\n  {\n    FT_Bytes  p, lookup;\n    FT_UInt   count;\n\n\n    if ( !table )\n      return 0;\n\n    /* LookupList */\n    p      = table + 8;\n    table += FT_NEXT_USHORT( p );\n\n    /* LookupCount */\n    p     = table;\n    count = FT_NEXT_USHORT( p );\n\n    for ( ; count > 0; count-- )\n    {\n      FT_Bytes  oldp;\n\n\n      /* Lookup */\n      lookup = table + FT_NEXT_USHORT( p );\n\n      oldp = p;\n\n      /* LookupFlag */\n      p = lookup + 2;\n      if ( FT_NEXT_USHORT( p ) & 0xFF00U )\n        return 1;\n\n      p = oldp;\n    }\n\n    return 0;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/otvalid/otvcommn.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  otvcommn.h                                                             */\n/*                                                                         */\n/*    OpenType common tables validation (specification).                   */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2007, 2009, 2014 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __OTVCOMMN_H__\n#define __OTVCOMMN_H__\n\n\n#include <ft2build.h>\n#include \"otvalid.h\"\n#include FT_INTERNAL_DEBUG_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         VALIDATION                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct OTV_ValidatorRec_*  OTV_Validator;\n\n  typedef void  (*OTV_Validate_Func)( FT_Bytes       table,\n                                      OTV_Validator  otvalid );\n\n  typedef struct  OTV_ValidatorRec_\n  {\n    FT_Validator        root;\n    FT_UInt             type_count;\n    OTV_Validate_Func*  type_funcs;\n\n    FT_UInt             lookup_count;\n    FT_UInt             glyph_count;\n\n    FT_UInt             nesting_level;\n\n    OTV_Validate_Func   func[3];\n\n    FT_UInt             extra1;     /* for passing parameters */\n    FT_UInt             extra2;\n    FT_Bytes            extra3;\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n    FT_UInt             debug_indent;\n    const FT_String*    debug_function_name[3];\n#endif\n\n  } OTV_ValidatorRec;\n\n\n#undef  FT_INVALID_\n#define FT_INVALID_( _error ) \\\n          ft_validator_error( otvalid->root, FT_THROW( _error ) )\n\n#define OTV_OPTIONAL_TABLE( _table )  FT_UShort  _table;      \\\n                                      FT_Bytes   _table ## _p\n\n#define OTV_OPTIONAL_OFFSET( _offset )           \\\n          FT_BEGIN_STMNT                         \\\n            _offset ## _p = p;                   \\\n            _offset       = FT_NEXT_USHORT( p ); \\\n          FT_END_STMNT\n\n#define OTV_LIMIT_CHECK( _count )                    \\\n          FT_BEGIN_STMNT                             \\\n            if ( p + (_count) > otvalid->root->limit ) \\\n              FT_INVALID_TOO_SHORT;                  \\\n          FT_END_STMNT\n\n#define OTV_SIZE_CHECK( _size )                                     \\\n          FT_BEGIN_STMNT                                            \\\n            if ( _size > 0 && _size < table_size )                  \\\n            {                                                       \\\n              if ( otvalid->root->level == FT_VALIDATE_PARANOID )     \\\n                FT_INVALID_OFFSET;                                  \\\n              else                                                  \\\n              {                                                     \\\n                /* strip off `const' */                             \\\n                FT_Byte*  pp = (FT_Byte*)_size ## _p;               \\\n                                                                    \\\n                                                                    \\\n                FT_TRACE3(( \"\\n\"                                    \\\n                            \"Invalid offset to optional table `%s'\" \\\n                            \" set to zero.\\n\"                       \\\n                            \"\\n\", #_size ));                        \\\n                                                                    \\\n                /* always assume 16bit entities */                  \\\n                _size = pp[0] = pp[1] = 0;                          \\\n              }                                                     \\\n            }                                                       \\\n          FT_END_STMNT\n\n\n#define  OTV_NAME_(x)  #x\n#define  OTV_NAME(x)   OTV_NAME_(x)\n\n#define  OTV_FUNC_(x)  x##Func\n#define  OTV_FUNC(x)   OTV_FUNC_(x)\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n#define OTV_NEST1( x )                                       \\\n          FT_BEGIN_STMNT                                     \\\n            otvalid->nesting_level          = 0;             \\\n            otvalid->func[0]                = OTV_FUNC( x ); \\\n            otvalid->debug_function_name[0] = OTV_NAME( x ); \\\n          FT_END_STMNT\n\n#define OTV_NEST2( x, y )                                    \\\n          FT_BEGIN_STMNT                                     \\\n            otvalid->nesting_level          = 0;             \\\n            otvalid->func[0]                = OTV_FUNC( x ); \\\n            otvalid->func[1]                = OTV_FUNC( y ); \\\n            otvalid->debug_function_name[0] = OTV_NAME( x ); \\\n            otvalid->debug_function_name[1] = OTV_NAME( y ); \\\n          FT_END_STMNT\n\n#define OTV_NEST3( x, y, z )                                 \\\n          FT_BEGIN_STMNT                                     \\\n            otvalid->nesting_level          = 0;             \\\n            otvalid->func[0]                = OTV_FUNC( x ); \\\n            otvalid->func[1]                = OTV_FUNC( y ); \\\n            otvalid->func[2]                = OTV_FUNC( z ); \\\n            otvalid->debug_function_name[0] = OTV_NAME( x ); \\\n            otvalid->debug_function_name[1] = OTV_NAME( y ); \\\n            otvalid->debug_function_name[2] = OTV_NAME( z ); \\\n          FT_END_STMNT\n\n#define OTV_INIT  otvalid->debug_indent = 0\n\n#define OTV_ENTER                                                              \\\n          FT_BEGIN_STMNT                                                       \\\n            otvalid->debug_indent += 2;                                        \\\n            FT_TRACE4(( \"%*.s\", otvalid->debug_indent, 0 ));                   \\\n            FT_TRACE4(( \"%s table\\n\",                                          \\\n                        otvalid->debug_function_name[otvalid->nesting_level] )); \\\n          FT_END_STMNT\n\n#define OTV_NAME_ENTER( name )                               \\\n          FT_BEGIN_STMNT                                     \\\n            otvalid->debug_indent += 2;                      \\\n            FT_TRACE4(( \"%*.s\", otvalid->debug_indent, 0 )); \\\n            FT_TRACE4(( \"%s table\\n\", name ));               \\\n          FT_END_STMNT\n\n#define OTV_EXIT  otvalid->debug_indent -= 2\n\n#define OTV_TRACE( s )                                       \\\n          FT_BEGIN_STMNT                                     \\\n            FT_TRACE4(( \"%*.s\", otvalid->debug_indent, 0 )); \\\n            FT_TRACE4( s );                                  \\\n          FT_END_STMNT\n\n#else   /* !FT_DEBUG_LEVEL_TRACE */\n\n#define OTV_NEST1( x )                              \\\n          FT_BEGIN_STMNT                            \\\n            otvalid->nesting_level = 0;             \\\n            otvalid->func[0]       = OTV_FUNC( x ); \\\n          FT_END_STMNT\n\n#define OTV_NEST2( x, y )                           \\\n          FT_BEGIN_STMNT                            \\\n            otvalid->nesting_level = 0;             \\\n            otvalid->func[0]       = OTV_FUNC( x ); \\\n            otvalid->func[1]       = OTV_FUNC( y ); \\\n          FT_END_STMNT\n\n#define OTV_NEST3( x, y, z )                        \\\n          FT_BEGIN_STMNT                            \\\n            otvalid->nesting_level = 0;             \\\n            otvalid->func[0]       = OTV_FUNC( x ); \\\n            otvalid->func[1]       = OTV_FUNC( y ); \\\n            otvalid->func[2]       = OTV_FUNC( z ); \\\n          FT_END_STMNT\n\n#define OTV_INIT                do { } while ( 0 )\n#define OTV_ENTER               do { } while ( 0 )\n#define OTV_NAME_ENTER( name )  do { } while ( 0 )\n#define OTV_EXIT                do { } while ( 0 )\n\n#define OTV_TRACE( s )          do { } while ( 0 )\n\n#endif  /* !FT_DEBUG_LEVEL_TRACE */\n\n\n#define OTV_RUN  otvalid->func[0]\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       COVERAGE TABLE                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL( void )\n  otv_Coverage_validate( FT_Bytes       table,\n                         OTV_Validator  otvalid,\n                         FT_Int         expected_count );\n\n  /* return first covered glyph */\n  FT_LOCAL( FT_UInt )\n  otv_Coverage_get_first( FT_Bytes  table );\n\n  /* return last covered glyph */\n  FT_LOCAL( FT_UInt )\n  otv_Coverage_get_last( FT_Bytes  table );\n\n  /* return number of covered glyphs */\n  FT_LOCAL( FT_UInt )\n  otv_Coverage_get_count( FT_Bytes  table );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                  CLASS DEFINITION TABLE                       *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL( void )\n  otv_ClassDef_validate( FT_Bytes       table,\n                         OTV_Validator  otvalid );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      DEVICE TABLE                             *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL( void )\n  otv_Device_validate( FT_Bytes       table,\n                       OTV_Validator  otvalid );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                           LOOKUPS                             *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL( void )\n  otv_Lookup_validate( FT_Bytes       table,\n                       OTV_Validator  otvalid );\n\n  FT_LOCAL( void )\n  otv_LookupList_validate( FT_Bytes       table,\n                           OTV_Validator  otvalid );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                        FEATURES                               *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL( void )\n  otv_Feature_validate( FT_Bytes       table,\n                        OTV_Validator  otvalid );\n\n  /* lookups must already be validated */\n  FT_LOCAL( void )\n  otv_FeatureList_validate( FT_Bytes       table,\n                            FT_Bytes       lookups,\n                            OTV_Validator  otvalid );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       LANGUAGE SYSTEM                         *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL( void )\n  otv_LangSys_validate( FT_Bytes       table,\n                        OTV_Validator  otvalid );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                           SCRIPTS                             *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL( void )\n  otv_Script_validate( FT_Bytes       table,\n                       OTV_Validator  otvalid );\n\n  /* features must already be validated */\n  FT_LOCAL( void )\n  otv_ScriptList_validate( FT_Bytes       table,\n                           FT_Bytes       features,\n                           OTV_Validator  otvalid );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      UTILITY FUNCTIONS                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#define ChainPosClassSetFunc  otv_x_Ox\n#define ChainPosRuleSetFunc   otv_x_Ox\n#define ChainSubClassSetFunc  otv_x_Ox\n#define ChainSubRuleSetFunc   otv_x_Ox\n#define JstfLangSysFunc       otv_x_Ox\n#define JstfMaxFunc           otv_x_Ox\n#define LigGlyphFunc          otv_x_Ox\n#define LigatureArrayFunc     otv_x_Ox\n#define LigatureSetFunc       otv_x_Ox\n#define PosClassSetFunc       otv_x_Ox\n#define PosRuleSetFunc        otv_x_Ox\n#define SubClassSetFunc       otv_x_Ox\n#define SubRuleSetFunc        otv_x_Ox\n\n  FT_LOCAL( void )\n  otv_x_Ox ( FT_Bytes       table,\n             OTV_Validator  otvalid );\n\n#define AlternateSubstFormat1Func     otv_u_C_x_Ox\n#define ChainContextPosFormat1Func    otv_u_C_x_Ox\n#define ChainContextSubstFormat1Func  otv_u_C_x_Ox\n#define ContextPosFormat1Func         otv_u_C_x_Ox\n#define ContextSubstFormat1Func       otv_u_C_x_Ox\n#define LigatureSubstFormat1Func      otv_u_C_x_Ox\n#define MultipleSubstFormat1Func      otv_u_C_x_Ox\n\n  FT_LOCAL( void )\n  otv_u_C_x_Ox( FT_Bytes       table,\n                OTV_Validator  otvalid );\n\n#define AlternateSetFunc     otv_x_ux\n#define AttachPointFunc      otv_x_ux\n#define ExtenderGlyphFunc    otv_x_ux\n#define JstfGPOSModListFunc  otv_x_ux\n#define JstfGSUBModListFunc  otv_x_ux\n#define SequenceFunc         otv_x_ux\n\n  FT_LOCAL( void )\n  otv_x_ux( FT_Bytes       table,\n            OTV_Validator  otvalid );\n\n#define PosClassRuleFunc  otv_x_y_ux_sy\n#define PosRuleFunc       otv_x_y_ux_sy\n#define SubClassRuleFunc  otv_x_y_ux_sy\n#define SubRuleFunc       otv_x_y_ux_sy\n\n  FT_LOCAL( void )\n  otv_x_y_ux_sy( FT_Bytes       table,\n                 OTV_Validator  otvalid );\n\n#define ChainPosClassRuleFunc  otv_x_ux_y_uy_z_uz_p_sp\n#define ChainPosRuleFunc       otv_x_ux_y_uy_z_uz_p_sp\n#define ChainSubClassRuleFunc  otv_x_ux_y_uy_z_uz_p_sp\n#define ChainSubRuleFunc       otv_x_ux_y_uy_z_uz_p_sp\n\n  FT_LOCAL( void )\n  otv_x_ux_y_uy_z_uz_p_sp( FT_Bytes       table,\n                           OTV_Validator  otvalid );\n\n#define ContextPosFormat2Func    otv_u_O_O_x_Onx\n#define ContextSubstFormat2Func  otv_u_O_O_x_Onx\n\n  FT_LOCAL( void )\n  otv_u_O_O_x_Onx( FT_Bytes       table,\n                   OTV_Validator  otvalid );\n\n#define ContextPosFormat3Func    otv_u_x_y_Ox_sy\n#define ContextSubstFormat3Func  otv_u_x_y_Ox_sy\n\n  FT_LOCAL( void )\n  otv_u_x_y_Ox_sy( FT_Bytes       table,\n                   OTV_Validator  otvalid );\n\n#define ChainContextPosFormat2Func    otv_u_O_O_O_O_x_Onx\n#define ChainContextSubstFormat2Func  otv_u_O_O_O_O_x_Onx\n\n  FT_LOCAL( void )\n  otv_u_O_O_O_O_x_Onx( FT_Bytes       table,\n                       OTV_Validator  otvalid );\n\n#define ChainContextPosFormat3Func    otv_u_x_Ox_y_Oy_z_Oz_p_sp\n#define ChainContextSubstFormat3Func  otv_u_x_Ox_y_Oy_z_Oz_p_sp\n\n  FT_LOCAL( void )\n  otv_u_x_Ox_y_Oy_z_Oz_p_sp( FT_Bytes       table,\n                             OTV_Validator  otvalid );\n\n\n  FT_LOCAL( FT_UInt )\n  otv_GSUBGPOS_get_Lookup_count( FT_Bytes  table );\n\n  FT_LOCAL( FT_UInt )\n  otv_GSUBGPOS_have_MarkAttachmentType_flag( FT_Bytes  table );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __OTVCOMMN_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/otvalid/otverror.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  otverror.h                                                             */\n/*                                                                         */\n/*    OpenType validation module error codes (specification only).         */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2012, 2013 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the OpenType validation module error      */\n  /* enumeration constants.                                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __OTVERROR_H__\n#define __OTVERROR_H__\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  OTV_Err_\n#define FT_ERR_BASE    FT_Mod_Err_OTvalid\n\n#include FT_ERRORS_H\n\n#endif /* __OTVERROR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/otvalid/otvgdef.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  otvgdef.c                                                              */\n/*                                                                         */\n/*    OpenType GDEF table validation (body).                               */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2007 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"otvalid.h\"\n#include \"otvcommn.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_otvgdef\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      UTILITY FUNCTIONS                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#define AttachListFunc    otv_O_x_Ox\n#define LigCaretListFunc  otv_O_x_Ox\n\n  /* sets valid->extra1 (0)           */\n\n  static void\n  otv_O_x_Ox( FT_Bytes       table,\n              OTV_Validator  otvalid )\n  {\n    FT_Bytes           p = table;\n    FT_Bytes           Coverage;\n    FT_UInt            GlyphCount;\n    OTV_Validate_Func  func;\n\n\n    OTV_ENTER;\n\n    OTV_LIMIT_CHECK( 4 );\n    Coverage   = table + FT_NEXT_USHORT( p );\n    GlyphCount = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (GlyphCount = %d)\\n\", GlyphCount ));\n\n    otv_Coverage_validate( Coverage, otvalid, GlyphCount );\n    if ( GlyphCount != otv_Coverage_get_count( Coverage ) )\n      FT_INVALID_DATA;\n\n    OTV_LIMIT_CHECK( GlyphCount * 2 );\n\n    otvalid->nesting_level++;\n    func          = otvalid->func[otvalid->nesting_level];\n    otvalid->extra1 = 0;\n\n    for ( ; GlyphCount > 0; GlyphCount-- )\n      func( table + FT_NEXT_USHORT( p ), otvalid );\n\n    otvalid->nesting_level--;\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       LIGATURE CARETS                         *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#define CaretValueFunc  otv_CaretValue_validate\n\n  static void\n  otv_CaretValue_validate( FT_Bytes       table,\n                           OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   CaretValueFormat;\n\n\n    OTV_ENTER;\n\n    OTV_LIMIT_CHECK( 4 );\n\n    CaretValueFormat = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (format = %d)\\n\", CaretValueFormat ));\n\n    switch ( CaretValueFormat )\n    {\n    case 1:     /* CaretValueFormat1 */\n      /* skip Coordinate, no test */\n      break;\n\n    case 2:     /* CaretValueFormat2 */\n      /* skip CaretValuePoint, no test */\n      break;\n\n    case 3:     /* CaretValueFormat3 */\n      p += 2;   /* skip Coordinate */\n\n      OTV_LIMIT_CHECK( 2 );\n\n      /* DeviceTable */\n      otv_Device_validate( table + FT_NEXT_USHORT( p ), otvalid );\n      break;\n\n    default:\n      FT_INVALID_FORMAT;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         GDEF TABLE                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* sets otvalid->glyph_count */\n\n  FT_LOCAL_DEF( void )\n  otv_GDEF_validate( FT_Bytes      table,\n                     FT_Bytes      gsub,\n                     FT_Bytes      gpos,\n                     FT_UInt       glyph_count,\n                     FT_Validator  ftvalid )\n  {\n    OTV_ValidatorRec  otvalidrec;\n    OTV_Validator     otvalid = &otvalidrec;\n    FT_Bytes          p     = table;\n    FT_UInt           table_size;\n    FT_Bool           need_MarkAttachClassDef;\n\n    OTV_OPTIONAL_TABLE( GlyphClassDef );\n    OTV_OPTIONAL_TABLE( AttachListOffset );\n    OTV_OPTIONAL_TABLE( LigCaretListOffset );\n    OTV_OPTIONAL_TABLE( MarkAttachClassDef );\n\n\n    otvalid->root = ftvalid;\n\n    FT_TRACE3(( \"validating GDEF table\\n\" ));\n    OTV_INIT;\n\n    OTV_LIMIT_CHECK( 12 );\n\n    if ( FT_NEXT_ULONG( p ) != 0x10000UL )          /* Version */\n      FT_INVALID_FORMAT;\n\n    /* MarkAttachClassDef has been added to the OpenType */\n    /* specification without increasing GDEF's version,  */\n    /* so we use this ugly hack to find out whether the  */\n    /* table is needed actually.                         */\n\n    need_MarkAttachClassDef = FT_BOOL(\n      otv_GSUBGPOS_have_MarkAttachmentType_flag( gsub ) ||\n      otv_GSUBGPOS_have_MarkAttachmentType_flag( gpos ) );\n\n    if ( need_MarkAttachClassDef )\n      table_size = 12;              /* OpenType >= 1.2 */\n    else\n      table_size = 10;              /* OpenType < 1.2  */\n\n    otvalid->glyph_count = glyph_count;\n\n    OTV_OPTIONAL_OFFSET( GlyphClassDef );\n    OTV_SIZE_CHECK( GlyphClassDef );\n    if ( GlyphClassDef )\n      otv_ClassDef_validate( table + GlyphClassDef, otvalid );\n\n    OTV_OPTIONAL_OFFSET( AttachListOffset );\n    OTV_SIZE_CHECK( AttachListOffset );\n    if ( AttachListOffset )\n    {\n      OTV_NEST2( AttachList, AttachPoint );\n      OTV_RUN( table + AttachListOffset, otvalid );\n    }\n\n    OTV_OPTIONAL_OFFSET( LigCaretListOffset );\n    OTV_SIZE_CHECK( LigCaretListOffset );\n    if ( LigCaretListOffset )\n    {\n      OTV_NEST3( LigCaretList, LigGlyph, CaretValue );\n      OTV_RUN( table + LigCaretListOffset, otvalid );\n    }\n\n    if ( need_MarkAttachClassDef )\n    {\n      OTV_OPTIONAL_OFFSET( MarkAttachClassDef );\n      OTV_SIZE_CHECK( MarkAttachClassDef );\n      if ( MarkAttachClassDef )\n        otv_ClassDef_validate( table + MarkAttachClassDef, otvalid );\n    }\n\n    FT_TRACE4(( \"\\n\" ));\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/otvalid/otvgpos.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  otvgpos.c                                                              */\n/*                                                                         */\n/*    OpenType GPOS table validation (body).                               */\n/*                                                                         */\n/*  Copyright 2002, 2004, 2005, 2006, 2007, 2008 by                        */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"otvalid.h\"\n#include \"otvcommn.h\"\n#include \"otvgpos.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_otvgpos\n\n\n  static void\n  otv_Anchor_validate( FT_Bytes       table,\n                       OTV_Validator  valid );\n\n  static void\n  otv_MarkArray_validate( FT_Bytes       table,\n                          OTV_Validator  valid );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      UTILITY FUNCTIONS                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#define BaseArrayFunc       otv_x_sxy\n#define LigatureAttachFunc  otv_x_sxy\n#define Mark2ArrayFunc      otv_x_sxy\n\n  /* uses valid->extra1 (counter)                             */\n  /* uses valid->extra2 (boolean to handle NULL anchor field) */\n\n  static void\n  otv_x_sxy( FT_Bytes       table,\n             OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   Count, count1, table_size;\n\n\n    OTV_ENTER;\n\n    OTV_LIMIT_CHECK( 2 );\n\n    Count = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (Count = %d)\\n\", Count ));\n\n    OTV_LIMIT_CHECK( Count * otvalid->extra1 * 2 );\n\n    table_size = Count * otvalid->extra1 * 2 + 2;\n\n    for ( ; Count > 0; Count-- )\n      for ( count1 = otvalid->extra1; count1 > 0; count1-- )\n      {\n        OTV_OPTIONAL_TABLE( anchor_offset );\n\n\n        OTV_OPTIONAL_OFFSET( anchor_offset );\n\n        if ( otvalid->extra2 )\n        {\n          OTV_SIZE_CHECK( anchor_offset );\n          if ( anchor_offset )\n            otv_Anchor_validate( table + anchor_offset, otvalid );\n        }\n        else\n          otv_Anchor_validate( table + anchor_offset, otvalid );\n      }\n\n    OTV_EXIT;\n  }\n\n\n#define MarkBasePosFormat1Func  otv_u_O_O_u_O_O\n#define MarkLigPosFormat1Func   otv_u_O_O_u_O_O\n#define MarkMarkPosFormat1Func  otv_u_O_O_u_O_O\n\n  /* sets otvalid->extra1 (class count) */\n\n  static void\n  otv_u_O_O_u_O_O( FT_Bytes       table,\n                   OTV_Validator  otvalid )\n  {\n    FT_Bytes           p = table;\n    FT_UInt            Coverage1, Coverage2, ClassCount;\n    FT_UInt            Array1, Array2;\n    OTV_Validate_Func  func;\n\n\n    OTV_ENTER;\n\n    p += 2;     /* skip PosFormat */\n\n    OTV_LIMIT_CHECK( 10 );\n    Coverage1  = FT_NEXT_USHORT( p );\n    Coverage2  = FT_NEXT_USHORT( p );\n    ClassCount = FT_NEXT_USHORT( p );\n    Array1     = FT_NEXT_USHORT( p );\n    Array2     = FT_NEXT_USHORT( p );\n\n    otv_Coverage_validate( table + Coverage1, otvalid, -1 );\n    otv_Coverage_validate( table + Coverage2, otvalid, -1 );\n\n    otv_MarkArray_validate( table + Array1, otvalid );\n\n    otvalid->nesting_level++;\n    func          = otvalid->func[otvalid->nesting_level];\n    otvalid->extra1 = ClassCount;\n\n    func( table + Array2, otvalid );\n\n    otvalid->nesting_level--;\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                        VALUE RECORDS                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static FT_UInt\n  otv_value_length( FT_UInt  format )\n  {\n    FT_UInt  count;\n\n\n    count = ( ( format & 0xAA ) >> 1 ) + ( format & 0x55 );\n    count = ( ( count  & 0xCC ) >> 2 ) + ( count  & 0x33 );\n    count = ( ( count  & 0xF0 ) >> 4 ) + ( count  & 0x0F );\n\n    return count * 2;\n  }\n\n\n  /* uses otvalid->extra3 (pointer to base table) */\n\n  static void\n  otv_ValueRecord_validate( FT_Bytes       table,\n                            FT_UInt        format,\n                            OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   count;\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n    FT_Int    loop;\n    FT_ULong  res = 0;\n\n\n    OTV_NAME_ENTER( \"ValueRecord\" );\n\n    /* display `format' in dual representation */\n    for ( loop = 7; loop >= 0; loop-- )\n    {\n      res <<= 4;\n      res  += ( format >> loop ) & 1;\n    }\n\n    OTV_TRACE(( \" (format 0b%08lx)\\n\", res ));\n#endif\n\n    if ( format >= 0x100 )\n      FT_INVALID_FORMAT;\n\n    for ( count = 4; count > 0; count-- )\n    {\n      if ( format & 1 )\n      {\n        /* XPlacement, YPlacement, XAdvance, YAdvance */\n        OTV_LIMIT_CHECK( 2 );\n        p += 2;\n      }\n\n      format >>= 1;\n    }\n\n    for ( count = 4; count > 0; count-- )\n    {\n      if ( format & 1 )\n      {\n        FT_PtrDist  table_size;\n\n        OTV_OPTIONAL_TABLE( device );\n\n\n        /* XPlaDevice, YPlaDevice, XAdvDevice, YAdvDevice */\n        OTV_LIMIT_CHECK( 2 );\n        OTV_OPTIONAL_OFFSET( device );\n\n        /* XXX: this value is usually too small, especially if the current */\n        /* ValueRecord is part of an array -- getting the correct table    */\n        /* size is probably not worth the trouble                          */\n\n        table_size = p - otvalid->extra3;\n\n        OTV_SIZE_CHECK( device );\n        if ( device )\n          otv_Device_validate( otvalid->extra3 + device, otvalid );\n      }\n      format >>= 1;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                           ANCHORS                             *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static void\n  otv_Anchor_validate( FT_Bytes       table,\n                       OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   AnchorFormat;\n\n\n    OTV_NAME_ENTER( \"Anchor\");\n\n    OTV_LIMIT_CHECK( 6 );\n    AnchorFormat = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (format %d)\\n\", AnchorFormat ));\n\n    p += 4;     /* skip XCoordinate and YCoordinate */\n\n    switch ( AnchorFormat )\n    {\n    case 1:\n      break;\n\n    case 2:\n      OTV_LIMIT_CHECK( 2 );  /* AnchorPoint */\n      break;\n\n    case 3:\n      {\n        FT_UInt   table_size;\n\n        OTV_OPTIONAL_TABLE( XDeviceTable );\n        OTV_OPTIONAL_TABLE( YDeviceTable );\n\n\n        OTV_LIMIT_CHECK( 4 );\n        OTV_OPTIONAL_OFFSET( XDeviceTable );\n        OTV_OPTIONAL_OFFSET( YDeviceTable );\n\n        table_size = 6 + 4;\n\n        OTV_SIZE_CHECK( XDeviceTable );\n        if ( XDeviceTable )\n          otv_Device_validate( table + XDeviceTable, otvalid );\n\n        OTV_SIZE_CHECK( YDeviceTable );\n        if ( YDeviceTable )\n          otv_Device_validate( table + YDeviceTable, otvalid );\n      }\n      break;\n\n    default:\n      FT_INVALID_FORMAT;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         MARK ARRAYS                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static void\n  otv_MarkArray_validate( FT_Bytes       table,\n                          OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   MarkCount;\n\n\n    OTV_NAME_ENTER( \"MarkArray\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    MarkCount = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (MarkCount = %d)\\n\", MarkCount ));\n\n    OTV_LIMIT_CHECK( MarkCount * 4 );\n\n    /* MarkRecord */\n    for ( ; MarkCount > 0; MarkCount-- )\n    {\n      p += 2;   /* skip Class */\n      /* MarkAnchor */\n      otv_Anchor_validate( table + FT_NEXT_USHORT( p ), otvalid );\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                     GPOS LOOKUP TYPE 1                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* sets otvalid->extra3 (pointer to base table) */\n\n  static void\n  otv_SinglePos_validate( FT_Bytes       table,\n                          OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   PosFormat;\n\n\n    OTV_NAME_ENTER( \"SinglePos\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    PosFormat = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (format %d)\\n\", PosFormat ));\n\n    otvalid->extra3 = table;\n\n    switch ( PosFormat )\n    {\n    case 1:     /* SinglePosFormat1 */\n      {\n        FT_UInt  Coverage, ValueFormat;\n\n\n        OTV_LIMIT_CHECK( 4 );\n        Coverage    = FT_NEXT_USHORT( p );\n        ValueFormat = FT_NEXT_USHORT( p );\n\n        otv_Coverage_validate( table + Coverage, otvalid, -1 );\n        otv_ValueRecord_validate( p, ValueFormat, otvalid ); /* Value */\n      }\n      break;\n\n    case 2:     /* SinglePosFormat2 */\n      {\n        FT_UInt  Coverage, ValueFormat, ValueCount, len_value;\n\n\n        OTV_LIMIT_CHECK( 6 );\n        Coverage    = FT_NEXT_USHORT( p );\n        ValueFormat = FT_NEXT_USHORT( p );\n        ValueCount  = FT_NEXT_USHORT( p );\n\n        OTV_TRACE(( \" (ValueCount = %d)\\n\", ValueCount ));\n\n        len_value = otv_value_length( ValueFormat );\n\n        otv_Coverage_validate( table + Coverage, otvalid, ValueCount );\n\n        OTV_LIMIT_CHECK( ValueCount * len_value );\n\n        /* Value */\n        for ( ; ValueCount > 0; ValueCount-- )\n        {\n          otv_ValueRecord_validate( p, ValueFormat, otvalid );\n          p += len_value;\n        }\n      }\n      break;\n\n    default:\n      FT_INVALID_FORMAT;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                     GPOS LOOKUP TYPE 2                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static void\n  otv_PairSet_validate( FT_Bytes       table,\n                        FT_UInt        format1,\n                        FT_UInt        format2,\n                        OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   value_len1, value_len2, PairValueCount;\n\n\n    OTV_NAME_ENTER( \"PairSet\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    PairValueCount = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (PairValueCount = %d)\\n\", PairValueCount ));\n\n    value_len1 = otv_value_length( format1 );\n    value_len2 = otv_value_length( format2 );\n\n    OTV_LIMIT_CHECK( PairValueCount * ( value_len1 + value_len2 + 2 ) );\n\n    /* PairValueRecord */\n    for ( ; PairValueCount > 0; PairValueCount-- )\n    {\n      p += 2;       /* skip SecondGlyph */\n\n      if ( format1 )\n        otv_ValueRecord_validate( p, format1, otvalid ); /* Value1 */\n      p += value_len1;\n\n      if ( format2 )\n        otv_ValueRecord_validate( p, format2, otvalid ); /* Value2 */\n      p += value_len2;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /* sets otvalid->extra3 (pointer to base table) */\n\n  static void\n  otv_PairPos_validate( FT_Bytes       table,\n                        OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   PosFormat;\n\n\n    OTV_NAME_ENTER( \"PairPos\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    PosFormat = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (format %d)\\n\", PosFormat ));\n\n    otvalid->extra3 = table;\n\n    switch ( PosFormat )\n    {\n    case 1:     /* PairPosFormat1 */\n      {\n        FT_UInt  Coverage, ValueFormat1, ValueFormat2, PairSetCount;\n\n\n        OTV_LIMIT_CHECK( 8 );\n        Coverage     = FT_NEXT_USHORT( p );\n        ValueFormat1 = FT_NEXT_USHORT( p );\n        ValueFormat2 = FT_NEXT_USHORT( p );\n        PairSetCount = FT_NEXT_USHORT( p );\n\n        OTV_TRACE(( \" (PairSetCount = %d)\\n\", PairSetCount ));\n\n        otv_Coverage_validate( table + Coverage, otvalid, -1 );\n\n        OTV_LIMIT_CHECK( PairSetCount * 2 );\n\n        /* PairSetOffset */\n        for ( ; PairSetCount > 0; PairSetCount-- )\n          otv_PairSet_validate( table + FT_NEXT_USHORT( p ),\n                                ValueFormat1, ValueFormat2, otvalid );\n      }\n      break;\n\n    case 2:     /* PairPosFormat2 */\n      {\n        FT_UInt  Coverage, ValueFormat1, ValueFormat2, ClassDef1, ClassDef2;\n        FT_UInt  ClassCount1, ClassCount2, len_value1, len_value2, count;\n\n\n        OTV_LIMIT_CHECK( 14 );\n        Coverage     = FT_NEXT_USHORT( p );\n        ValueFormat1 = FT_NEXT_USHORT( p );\n        ValueFormat2 = FT_NEXT_USHORT( p );\n        ClassDef1    = FT_NEXT_USHORT( p );\n        ClassDef2    = FT_NEXT_USHORT( p );\n        ClassCount1  = FT_NEXT_USHORT( p );\n        ClassCount2  = FT_NEXT_USHORT( p );\n\n        OTV_TRACE(( \" (ClassCount1 = %d)\\n\", ClassCount1 ));\n        OTV_TRACE(( \" (ClassCount2 = %d)\\n\", ClassCount2 ));\n\n        len_value1 = otv_value_length( ValueFormat1 );\n        len_value2 = otv_value_length( ValueFormat2 );\n\n        otv_Coverage_validate( table + Coverage, otvalid, -1 );\n        otv_ClassDef_validate( table + ClassDef1, otvalid );\n        otv_ClassDef_validate( table + ClassDef2, otvalid );\n\n        OTV_LIMIT_CHECK( ClassCount1 * ClassCount2 *\n                     ( len_value1 + len_value2 ) );\n\n        /* Class1Record */\n        for ( ; ClassCount1 > 0; ClassCount1-- )\n        {\n          /* Class2Record */\n          for ( count = ClassCount2; count > 0; count-- )\n          {\n            if ( ValueFormat1 )\n              /* Value1 */\n              otv_ValueRecord_validate( p, ValueFormat1, otvalid );\n            p += len_value1;\n\n            if ( ValueFormat2 )\n              /* Value2 */\n              otv_ValueRecord_validate( p, ValueFormat2, otvalid );\n            p += len_value2;\n          }\n        }\n      }\n      break;\n\n    default:\n      FT_INVALID_FORMAT;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                     GPOS LOOKUP TYPE 3                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static void\n  otv_CursivePos_validate( FT_Bytes       table,\n                           OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   PosFormat;\n\n\n    OTV_NAME_ENTER( \"CursivePos\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    PosFormat = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (format %d)\\n\", PosFormat ));\n\n    switch ( PosFormat )\n    {\n    case 1:     /* CursivePosFormat1 */\n      {\n        FT_UInt   table_size;\n        FT_UInt   Coverage, EntryExitCount;\n\n        OTV_OPTIONAL_TABLE( EntryAnchor );\n        OTV_OPTIONAL_TABLE( ExitAnchor  );\n\n\n        OTV_LIMIT_CHECK( 4 );\n        Coverage       = FT_NEXT_USHORT( p );\n        EntryExitCount = FT_NEXT_USHORT( p );\n\n        OTV_TRACE(( \" (EntryExitCount = %d)\\n\", EntryExitCount ));\n\n        otv_Coverage_validate( table + Coverage, otvalid, EntryExitCount );\n\n        OTV_LIMIT_CHECK( EntryExitCount * 4 );\n\n        table_size = EntryExitCount * 4 + 4;\n\n        /* EntryExitRecord */\n        for ( ; EntryExitCount > 0; EntryExitCount-- )\n        {\n          OTV_OPTIONAL_OFFSET( EntryAnchor );\n          OTV_OPTIONAL_OFFSET( ExitAnchor  );\n\n          OTV_SIZE_CHECK( EntryAnchor );\n          if ( EntryAnchor )\n            otv_Anchor_validate( table + EntryAnchor, otvalid );\n\n          OTV_SIZE_CHECK( ExitAnchor );\n          if ( ExitAnchor )\n            otv_Anchor_validate( table + ExitAnchor, otvalid );\n        }\n      }\n      break;\n\n    default:\n      FT_INVALID_FORMAT;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                     GPOS LOOKUP TYPE 4                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* UNDOCUMENTED (in OpenType 1.5):              */\n  /* BaseRecord tables can contain NULL pointers. */\n\n  /* sets otvalid->extra2 (1) */\n\n  static void\n  otv_MarkBasePos_validate( FT_Bytes       table,\n                            OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   PosFormat;\n\n\n    OTV_NAME_ENTER( \"MarkBasePos\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    PosFormat = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (format %d)\\n\", PosFormat ));\n\n    switch ( PosFormat )\n    {\n    case 1:\n      otvalid->extra2 = 1;\n      OTV_NEST2( MarkBasePosFormat1, BaseArray );\n      OTV_RUN( table, otvalid );\n      break;\n\n    default:\n      FT_INVALID_FORMAT;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                     GPOS LOOKUP TYPE 5                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* sets otvalid->extra2 (1) */\n\n  static void\n  otv_MarkLigPos_validate( FT_Bytes       table,\n                           OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   PosFormat;\n\n\n    OTV_NAME_ENTER( \"MarkLigPos\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    PosFormat = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (format %d)\\n\", PosFormat ));\n\n    switch ( PosFormat )\n    {\n    case 1:\n      otvalid->extra2 = 1;\n      OTV_NEST3( MarkLigPosFormat1, LigatureArray, LigatureAttach );\n      OTV_RUN( table, otvalid );\n      break;\n\n    default:\n      FT_INVALID_FORMAT;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                     GPOS LOOKUP TYPE 6                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* sets otvalid->extra2 (0) */\n\n  static void\n  otv_MarkMarkPos_validate( FT_Bytes       table,\n                            OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   PosFormat;\n\n\n    OTV_NAME_ENTER( \"MarkMarkPos\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    PosFormat = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (format %d)\\n\", PosFormat ));\n\n    switch ( PosFormat )\n    {\n    case 1:\n      otvalid->extra2 = 0;\n      OTV_NEST2( MarkMarkPosFormat1, Mark2Array );\n      OTV_RUN( table, otvalid );\n      break;\n\n    default:\n      FT_INVALID_FORMAT;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                     GPOS LOOKUP TYPE 7                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* sets otvalid->extra1 (lookup count) */\n\n  static void\n  otv_ContextPos_validate( FT_Bytes       table,\n                           OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   PosFormat;\n\n\n    OTV_NAME_ENTER( \"ContextPos\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    PosFormat = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (format %d)\\n\", PosFormat ));\n\n    switch ( PosFormat )\n    {\n    case 1:\n      /* no need to check glyph indices/classes used as input for these */\n      /* context rules since even invalid glyph indices/classes return  */\n      /* meaningful results                                             */\n\n      otvalid->extra1 = otvalid->lookup_count;\n      OTV_NEST3( ContextPosFormat1, PosRuleSet, PosRule );\n      OTV_RUN( table, otvalid );\n      break;\n\n    case 2:\n      /* no need to check glyph indices/classes used as input for these */\n      /* context rules since even invalid glyph indices/classes return  */\n      /* meaningful results                                             */\n\n      OTV_NEST3( ContextPosFormat2, PosClassSet, PosClassRule );\n      OTV_RUN( table, otvalid );\n      break;\n\n    case 3:\n      OTV_NEST1( ContextPosFormat3 );\n      OTV_RUN( table, otvalid );\n      break;\n\n    default:\n      FT_INVALID_FORMAT;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                     GPOS LOOKUP TYPE 8                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* sets otvalid->extra1 (lookup count) */\n\n  static void\n  otv_ChainContextPos_validate( FT_Bytes       table,\n                                OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   PosFormat;\n\n\n    OTV_NAME_ENTER( \"ChainContextPos\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    PosFormat = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (format %d)\\n\", PosFormat ));\n\n    switch ( PosFormat )\n    {\n    case 1:\n      /* no need to check glyph indices/classes used as input for these */\n      /* context rules since even invalid glyph indices/classes return  */\n      /* meaningful results                                             */\n\n      otvalid->extra1 = otvalid->lookup_count;\n      OTV_NEST3( ChainContextPosFormat1,\n                 ChainPosRuleSet, ChainPosRule );\n      OTV_RUN( table, otvalid );\n      break;\n\n    case 2:\n      /* no need to check glyph indices/classes used as input for these */\n      /* context rules since even invalid glyph indices/classes return  */\n      /* meaningful results                                             */\n\n      OTV_NEST3( ChainContextPosFormat2,\n                 ChainPosClassSet, ChainPosClassRule );\n      OTV_RUN( table, otvalid );\n      break;\n\n    case 3:\n      OTV_NEST1( ChainContextPosFormat3 );\n      OTV_RUN( table, otvalid );\n      break;\n\n    default:\n      FT_INVALID_FORMAT;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                     GPOS LOOKUP TYPE 9                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* uses otvalid->type_funcs */\n\n  static void\n  otv_ExtensionPos_validate( FT_Bytes       table,\n                             OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   PosFormat;\n\n\n    OTV_NAME_ENTER( \"ExtensionPos\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    PosFormat = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (format %d)\\n\", PosFormat ));\n\n    switch ( PosFormat )\n    {\n    case 1:     /* ExtensionPosFormat1 */\n      {\n        FT_UInt            ExtensionLookupType;\n        FT_ULong           ExtensionOffset;\n        OTV_Validate_Func  validate;\n\n\n        OTV_LIMIT_CHECK( 6 );\n        ExtensionLookupType = FT_NEXT_USHORT( p );\n        ExtensionOffset     = FT_NEXT_ULONG( p );\n\n        if ( ExtensionLookupType == 0 || ExtensionLookupType >= 9 )\n          FT_INVALID_DATA;\n\n        validate = otvalid->type_funcs[ExtensionLookupType - 1];\n        validate( table + ExtensionOffset, otvalid );\n      }\n      break;\n\n    default:\n      FT_INVALID_FORMAT;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  static const OTV_Validate_Func  otv_gpos_validate_funcs[9] =\n  {\n    otv_SinglePos_validate,\n    otv_PairPos_validate,\n    otv_CursivePos_validate,\n    otv_MarkBasePos_validate,\n    otv_MarkLigPos_validate,\n    otv_MarkMarkPos_validate,\n    otv_ContextPos_validate,\n    otv_ChainContextPos_validate,\n    otv_ExtensionPos_validate\n  };\n\n\n  /* sets otvalid->type_count */\n  /* sets otvalid->type_funcs */\n\n  FT_LOCAL_DEF( void )\n  otv_GPOS_subtable_validate( FT_Bytes       table,\n                              OTV_Validator  otvalid )\n  {\n    otvalid->type_count = 9;\n    otvalid->type_funcs = (OTV_Validate_Func*)otv_gpos_validate_funcs;\n\n    otv_Lookup_validate( table, otvalid );\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                          GPOS TABLE                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* sets otvalid->glyph_count */\n\n  FT_LOCAL_DEF( void )\n  otv_GPOS_validate( FT_Bytes      table,\n                     FT_UInt       glyph_count,\n                     FT_Validator  ftvalid )\n  {\n    OTV_ValidatorRec  validrec;\n    OTV_Validator     otvalid = &validrec;\n    FT_Bytes          p     = table;\n    FT_UInt           ScriptList, FeatureList, LookupList;\n\n\n    otvalid->root = ftvalid;\n\n    FT_TRACE3(( \"validating GPOS table\\n\" ));\n    OTV_INIT;\n\n    OTV_LIMIT_CHECK( 10 );\n\n    if ( FT_NEXT_ULONG( p ) != 0x10000UL )      /* Version */\n      FT_INVALID_FORMAT;\n\n    ScriptList  = FT_NEXT_USHORT( p );\n    FeatureList = FT_NEXT_USHORT( p );\n    LookupList  = FT_NEXT_USHORT( p );\n\n    otvalid->type_count  = 9;\n    otvalid->type_funcs  = (OTV_Validate_Func*)otv_gpos_validate_funcs;\n    otvalid->glyph_count = glyph_count;\n\n    otv_LookupList_validate( table + LookupList,\n                             otvalid );\n    otv_FeatureList_validate( table + FeatureList, table + LookupList,\n                              otvalid );\n    otv_ScriptList_validate( table + ScriptList, table + FeatureList,\n                             otvalid );\n\n    FT_TRACE4(( \"\\n\" ));\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/otvalid/otvgpos.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  otvgpos.h                                                              */\n/*                                                                         */\n/*    OpenType GPOS table validator (specification).                       */\n/*                                                                         */\n/*  Copyright 2004 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __OTVGPOS_H__\n#define __OTVGPOS_H__\n\n\nFT_BEGIN_HEADER\n\n\n  FT_LOCAL( void )\n  otv_GPOS_subtable_validate( FT_Bytes       table,\n                              OTV_Validator  valid );\n\n\nFT_END_HEADER\n\n#endif /* __OTVGPOS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/otvalid/otvgsub.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  otvgsub.c                                                              */\n/*                                                                         */\n/*    OpenType GSUB table validation (body).                               */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2007 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"otvalid.h\"\n#include \"otvcommn.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_otvgsub\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                  GSUB LOOKUP TYPE 1                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* uses otvalid->glyph_count */\n\n  static void\n  otv_SingleSubst_validate( FT_Bytes       table,\n                            OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   SubstFormat;\n\n\n    OTV_NAME_ENTER( \"SingleSubst\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    SubstFormat = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (format %d)\\n\", SubstFormat ));\n\n    switch ( SubstFormat )\n    {\n    case 1:     /* SingleSubstFormat1 */\n      {\n        FT_Bytes  Coverage;\n        FT_Int    DeltaGlyphID;\n        FT_Long   idx;\n\n\n        OTV_LIMIT_CHECK( 4 );\n        Coverage     = table + FT_NEXT_USHORT( p );\n        DeltaGlyphID = FT_NEXT_SHORT( p );\n\n        otv_Coverage_validate( Coverage, otvalid, -1 );\n\n        idx = otv_Coverage_get_first( Coverage ) + DeltaGlyphID;\n        if ( idx < 0 )\n          FT_INVALID_DATA;\n\n        idx = otv_Coverage_get_last( Coverage ) + DeltaGlyphID;\n        if ( (FT_UInt)idx >= otvalid->glyph_count )\n          FT_INVALID_DATA;\n      }\n      break;\n\n    case 2:     /* SingleSubstFormat2 */\n      {\n        FT_UInt  Coverage, GlyphCount;\n\n\n        OTV_LIMIT_CHECK( 4 );\n        Coverage   = FT_NEXT_USHORT( p );\n        GlyphCount = FT_NEXT_USHORT( p );\n\n        OTV_TRACE(( \" (GlyphCount = %d)\\n\", GlyphCount ));\n\n        otv_Coverage_validate( table + Coverage, otvalid, GlyphCount );\n\n        OTV_LIMIT_CHECK( GlyphCount * 2 );\n\n        /* Substitute */\n        for ( ; GlyphCount > 0; GlyphCount-- )\n          if ( FT_NEXT_USHORT( p ) >= otvalid->glyph_count )\n            FT_INVALID_GLYPH_ID;\n      }\n      break;\n\n    default:\n      FT_INVALID_FORMAT;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                  GSUB LOOKUP TYPE 2                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* sets otvalid->extra1 (glyph count) */\n\n  static void\n  otv_MultipleSubst_validate( FT_Bytes       table,\n                              OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   SubstFormat;\n\n\n    OTV_NAME_ENTER( \"MultipleSubst\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    SubstFormat = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (format %d)\\n\", SubstFormat ));\n\n    switch ( SubstFormat )\n    {\n    case 1:\n      otvalid->extra1 = otvalid->glyph_count;\n      OTV_NEST2( MultipleSubstFormat1, Sequence );\n      OTV_RUN( table, otvalid );\n      break;\n\n    default:\n      FT_INVALID_FORMAT;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    GSUB LOOKUP TYPE 3                         *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* sets otvalid->extra1 (glyph count) */\n\n  static void\n  otv_AlternateSubst_validate( FT_Bytes       table,\n                               OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   SubstFormat;\n\n\n    OTV_NAME_ENTER( \"AlternateSubst\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    SubstFormat = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (format %d)\\n\", SubstFormat ));\n\n    switch ( SubstFormat )\n    {\n    case 1:\n      otvalid->extra1 = otvalid->glyph_count;\n      OTV_NEST2( AlternateSubstFormat1, AlternateSet );\n      OTV_RUN( table, otvalid );\n      break;\n\n    default:\n      FT_INVALID_FORMAT;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    GSUB LOOKUP TYPE 4                         *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#define LigatureFunc  otv_Ligature_validate\n\n  /* uses otvalid->glyph_count */\n\n  static void\n  otv_Ligature_validate( FT_Bytes       table,\n                         OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   LigatureGlyph, CompCount;\n\n\n    OTV_ENTER;\n\n    OTV_LIMIT_CHECK( 4 );\n    LigatureGlyph = FT_NEXT_USHORT( p );\n    if ( LigatureGlyph >= otvalid->glyph_count )\n      FT_INVALID_DATA;\n\n    CompCount = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (CompCount = %d)\\n\", CompCount ));\n\n    if ( CompCount == 0 )\n      FT_INVALID_DATA;\n\n    CompCount--;\n\n    OTV_LIMIT_CHECK( CompCount * 2 );     /* Component */\n\n    /* no need to check the Component glyph indices */\n\n    OTV_EXIT;\n  }\n\n\n  static void\n  otv_LigatureSubst_validate( FT_Bytes       table,\n                              OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   SubstFormat;\n\n\n    OTV_NAME_ENTER( \"LigatureSubst\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    SubstFormat = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (format %d)\\n\", SubstFormat ));\n\n    switch ( SubstFormat )\n    {\n    case 1:\n      OTV_NEST3( LigatureSubstFormat1, LigatureSet, Ligature );\n      OTV_RUN( table, otvalid );\n      break;\n\n    default:\n      FT_INVALID_FORMAT;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                  GSUB LOOKUP TYPE 5                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* sets otvalid->extra1 (lookup count) */\n\n  static void\n  otv_ContextSubst_validate( FT_Bytes       table,\n                             OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   SubstFormat;\n\n\n    OTV_NAME_ENTER( \"ContextSubst\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    SubstFormat = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (format %d)\\n\", SubstFormat ));\n\n    switch ( SubstFormat )\n    {\n    case 1:\n      /* no need to check glyph indices/classes used as input for these */\n      /* context rules since even invalid glyph indices/classes return  */\n      /* meaningful results                                             */\n\n      otvalid->extra1 = otvalid->lookup_count;\n      OTV_NEST3( ContextSubstFormat1, SubRuleSet, SubRule );\n      OTV_RUN( table, otvalid );\n      break;\n\n    case 2:\n      /* no need to check glyph indices/classes used as input for these */\n      /* context rules since even invalid glyph indices/classes return  */\n      /* meaningful results                                             */\n\n      OTV_NEST3( ContextSubstFormat2, SubClassSet, SubClassRule );\n      OTV_RUN( table, otvalid );\n      break;\n\n    case 3:\n      OTV_NEST1( ContextSubstFormat3 );\n      OTV_RUN( table, otvalid );\n      break;\n\n    default:\n      FT_INVALID_FORMAT;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    GSUB LOOKUP TYPE 6                         *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* sets otvalid->extra1 (lookup count)            */\n\n  static void\n  otv_ChainContextSubst_validate( FT_Bytes       table,\n                                  OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   SubstFormat;\n\n\n    OTV_NAME_ENTER( \"ChainContextSubst\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    SubstFormat = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (format %d)\\n\", SubstFormat ));\n\n    switch ( SubstFormat )\n    {\n    case 1:\n      /* no need to check glyph indices/classes used as input for these */\n      /* context rules since even invalid glyph indices/classes return  */\n      /* meaningful results                                             */\n\n      otvalid->extra1 = otvalid->lookup_count;\n      OTV_NEST3( ChainContextSubstFormat1,\n                 ChainSubRuleSet, ChainSubRule );\n      OTV_RUN( table, otvalid );\n      break;\n\n    case 2:\n      /* no need to check glyph indices/classes used as input for these */\n      /* context rules since even invalid glyph indices/classes return  */\n      /* meaningful results                                             */\n\n      OTV_NEST3( ChainContextSubstFormat2,\n                 ChainSubClassSet, ChainSubClassRule );\n      OTV_RUN( table, otvalid );\n      break;\n\n    case 3:\n      OTV_NEST1( ChainContextSubstFormat3 );\n      OTV_RUN( table, otvalid );\n      break;\n\n    default:\n      FT_INVALID_FORMAT;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    GSUB LOOKUP TYPE 7                         *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* uses otvalid->type_funcs */\n\n  static void\n  otv_ExtensionSubst_validate( FT_Bytes       table,\n                               OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   SubstFormat;\n\n\n    OTV_NAME_ENTER( \"ExtensionSubst\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    SubstFormat = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (format %d)\\n\", SubstFormat ));\n\n    switch ( SubstFormat )\n    {\n    case 1:     /* ExtensionSubstFormat1 */\n      {\n        FT_UInt            ExtensionLookupType;\n        FT_ULong           ExtensionOffset;\n        OTV_Validate_Func  validate;\n\n\n        OTV_LIMIT_CHECK( 6 );\n        ExtensionLookupType = FT_NEXT_USHORT( p );\n        ExtensionOffset     = FT_NEXT_ULONG( p );\n\n        if ( ExtensionLookupType == 0 ||\n             ExtensionLookupType == 7 ||\n             ExtensionLookupType > 8  )\n          FT_INVALID_DATA;\n\n        validate = otvalid->type_funcs[ExtensionLookupType - 1];\n        validate( table + ExtensionOffset, otvalid );\n      }\n      break;\n\n    default:\n      FT_INVALID_FORMAT;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    GSUB LOOKUP TYPE 8                         *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* uses otvalid->glyph_count */\n\n  static void\n  otv_ReverseChainSingleSubst_validate( FT_Bytes       table,\n                                        OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table, Coverage;\n    FT_UInt   SubstFormat;\n    FT_UInt   BacktrackGlyphCount, LookaheadGlyphCount, GlyphCount;\n\n\n    OTV_NAME_ENTER( \"ReverseChainSingleSubst\" );\n\n    OTV_LIMIT_CHECK( 2 );\n    SubstFormat = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (format %d)\\n\", SubstFormat ));\n\n    switch ( SubstFormat )\n    {\n    case 1:     /* ReverseChainSingleSubstFormat1 */\n      OTV_LIMIT_CHECK( 4 );\n      Coverage            = table + FT_NEXT_USHORT( p );\n      BacktrackGlyphCount = FT_NEXT_USHORT( p );\n\n      OTV_TRACE(( \" (BacktrackGlyphCount = %d)\\n\", BacktrackGlyphCount ));\n\n      otv_Coverage_validate( Coverage, otvalid, -1 );\n\n      OTV_LIMIT_CHECK( BacktrackGlyphCount * 2 + 2 );\n\n      for ( ; BacktrackGlyphCount > 0; BacktrackGlyphCount-- )\n        otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 );\n\n      LookaheadGlyphCount = FT_NEXT_USHORT( p );\n\n      OTV_TRACE(( \" (LookaheadGlyphCount = %d)\\n\", LookaheadGlyphCount ));\n\n      OTV_LIMIT_CHECK( LookaheadGlyphCount * 2 + 2 );\n\n      for ( ; LookaheadGlyphCount > 0; LookaheadGlyphCount-- )\n        otv_Coverage_validate( table + FT_NEXT_USHORT( p ), otvalid, -1 );\n\n      GlyphCount = FT_NEXT_USHORT( p );\n\n      OTV_TRACE(( \" (GlyphCount = %d)\\n\", GlyphCount ));\n\n      if ( GlyphCount != otv_Coverage_get_count( Coverage ) )\n        FT_INVALID_DATA;\n\n      OTV_LIMIT_CHECK( GlyphCount * 2 );\n\n      /* Substitute */\n      for ( ; GlyphCount > 0; GlyphCount-- )\n        if ( FT_NEXT_USHORT( p ) >= otvalid->glyph_count )\n          FT_INVALID_DATA;\n\n      break;\n\n    default:\n      FT_INVALID_FORMAT;\n    }\n\n    OTV_EXIT;\n  }\n\n\n  static const OTV_Validate_Func  otv_gsub_validate_funcs[8] =\n  {\n    otv_SingleSubst_validate,\n    otv_MultipleSubst_validate,\n    otv_AlternateSubst_validate,\n    otv_LigatureSubst_validate,\n    otv_ContextSubst_validate,\n    otv_ChainContextSubst_validate,\n    otv_ExtensionSubst_validate,\n    otv_ReverseChainSingleSubst_validate\n  };\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                          GSUB TABLE                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* sets otvalid->type_count  */\n  /* sets otvalid->type_funcs  */\n  /* sets otvalid->glyph_count */\n\n  FT_LOCAL_DEF( void )\n  otv_GSUB_validate( FT_Bytes      table,\n                     FT_UInt       glyph_count,\n                     FT_Validator  ftvalid )\n  {\n    OTV_ValidatorRec  otvalidrec;\n    OTV_Validator     otvalid = &otvalidrec;\n    FT_Bytes          p       = table;\n    FT_UInt           ScriptList, FeatureList, LookupList;\n\n\n    otvalid->root = ftvalid;\n\n    FT_TRACE3(( \"validating GSUB table\\n\" ));\n    OTV_INIT;\n\n    OTV_LIMIT_CHECK( 10 );\n\n    if ( FT_NEXT_ULONG( p ) != 0x10000UL )      /* Version */\n      FT_INVALID_FORMAT;\n\n    ScriptList  = FT_NEXT_USHORT( p );\n    FeatureList = FT_NEXT_USHORT( p );\n    LookupList  = FT_NEXT_USHORT( p );\n\n    otvalid->type_count  = 8;\n    otvalid->type_funcs  = (OTV_Validate_Func*)otv_gsub_validate_funcs;\n    otvalid->glyph_count = glyph_count;\n\n    otv_LookupList_validate( table + LookupList,\n                             otvalid );\n    otv_FeatureList_validate( table + FeatureList, table + LookupList,\n                              otvalid );\n    otv_ScriptList_validate( table + ScriptList, table + FeatureList,\n                             otvalid );\n\n    FT_TRACE4(( \"\\n\" ));\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/otvalid/otvjstf.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  otvjstf.c                                                              */\n/*                                                                         */\n/*    OpenType JSTF table validation (body).                               */\n/*                                                                         */\n/*  Copyright 2004, 2007 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"otvalid.h\"\n#include \"otvcommn.h\"\n#include \"otvgpos.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_otvjstf\n\n\n#define JstfPriorityFunc  otv_JstfPriority_validate\n#define JstfLookupFunc    otv_GPOS_subtable_validate\n\n  /* uses otvalid->extra1 (GSUB lookup count) */\n  /* uses otvalid->extra2 (GPOS lookup count) */\n  /* sets otvalid->extra1 (counter)           */\n\n  static void\n  otv_JstfPriority_validate( FT_Bytes       table,\n                             OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   table_size;\n    FT_UInt   gsub_lookup_count, gpos_lookup_count;\n\n    OTV_OPTIONAL_TABLE( ShrinkageEnableGSUB  );\n    OTV_OPTIONAL_TABLE( ShrinkageDisableGSUB );\n    OTV_OPTIONAL_TABLE( ShrinkageEnableGPOS  );\n    OTV_OPTIONAL_TABLE( ShrinkageDisableGPOS );\n    OTV_OPTIONAL_TABLE( ExtensionEnableGSUB  );\n    OTV_OPTIONAL_TABLE( ExtensionDisableGSUB );\n    OTV_OPTIONAL_TABLE( ExtensionEnableGPOS  );\n    OTV_OPTIONAL_TABLE( ExtensionDisableGPOS );\n    OTV_OPTIONAL_TABLE( ShrinkageJstfMax );\n    OTV_OPTIONAL_TABLE( ExtensionJstfMax );\n\n\n    OTV_ENTER;\n    OTV_TRACE(( \"JstfPriority table\\n\" ));\n\n    OTV_LIMIT_CHECK( 20 );\n\n    gsub_lookup_count = otvalid->extra1;\n    gpos_lookup_count = otvalid->extra2;\n\n    table_size = 20;\n\n    otvalid->extra1 = gsub_lookup_count;\n\n    OTV_OPTIONAL_OFFSET( ShrinkageEnableGSUB );\n    OTV_SIZE_CHECK( ShrinkageEnableGSUB );\n    if ( ShrinkageEnableGSUB )\n      otv_x_ux( table + ShrinkageEnableGSUB, otvalid );\n\n    OTV_OPTIONAL_OFFSET( ShrinkageDisableGSUB );\n    OTV_SIZE_CHECK( ShrinkageDisableGSUB );\n    if ( ShrinkageDisableGSUB )\n      otv_x_ux( table + ShrinkageDisableGSUB, otvalid );\n\n    otvalid->extra1 = gpos_lookup_count;\n\n    OTV_OPTIONAL_OFFSET( ShrinkageEnableGPOS );\n    OTV_SIZE_CHECK( ShrinkageEnableGPOS );\n    if ( ShrinkageEnableGPOS )\n      otv_x_ux( table + ShrinkageEnableGPOS, otvalid );\n\n    OTV_OPTIONAL_OFFSET( ShrinkageDisableGPOS );\n    OTV_SIZE_CHECK( ShrinkageDisableGPOS );\n    if ( ShrinkageDisableGPOS )\n      otv_x_ux( table + ShrinkageDisableGPOS, otvalid );\n\n    OTV_OPTIONAL_OFFSET( ShrinkageJstfMax );\n    OTV_SIZE_CHECK( ShrinkageJstfMax );\n    if ( ShrinkageJstfMax )\n    {\n      /* XXX: check lookup types? */\n      OTV_NEST2( JstfMax, JstfLookup );\n      OTV_RUN( table + ShrinkageJstfMax, otvalid );\n    }\n\n    otvalid->extra1 = gsub_lookup_count;\n\n    OTV_OPTIONAL_OFFSET( ExtensionEnableGSUB );\n    OTV_SIZE_CHECK( ExtensionEnableGSUB );\n    if ( ExtensionEnableGSUB )\n      otv_x_ux( table + ExtensionEnableGSUB, otvalid );\n\n    OTV_OPTIONAL_OFFSET( ExtensionDisableGSUB );\n    OTV_SIZE_CHECK( ExtensionDisableGSUB );\n    if ( ExtensionDisableGSUB )\n      otv_x_ux( table + ExtensionDisableGSUB, otvalid );\n\n    otvalid->extra1 = gpos_lookup_count;\n\n    OTV_OPTIONAL_OFFSET( ExtensionEnableGPOS );\n    OTV_SIZE_CHECK( ExtensionEnableGPOS );\n    if ( ExtensionEnableGPOS )\n      otv_x_ux( table + ExtensionEnableGPOS, otvalid );\n\n    OTV_OPTIONAL_OFFSET( ExtensionDisableGPOS );\n    OTV_SIZE_CHECK( ExtensionDisableGPOS );\n    if ( ExtensionDisableGPOS )\n      otv_x_ux( table + ExtensionDisableGPOS, otvalid );\n\n    OTV_OPTIONAL_OFFSET( ExtensionJstfMax );\n    OTV_SIZE_CHECK( ExtensionJstfMax );\n    if ( ExtensionJstfMax )\n    {\n      /* XXX: check lookup types? */\n      OTV_NEST2( JstfMax, JstfLookup );\n      OTV_RUN( table + ExtensionJstfMax, otvalid );\n    }\n\n    otvalid->extra1 = gsub_lookup_count;\n    otvalid->extra2 = gpos_lookup_count;\n\n    OTV_EXIT;\n  }\n\n\n  /* sets otvalid->extra (glyph count)               */\n  /* sets otvalid->func1 (otv_JstfPriority_validate) */\n\n  static void\n  otv_JstfScript_validate( FT_Bytes       table,\n                           OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   table_size;\n    FT_UInt   JstfLangSysCount;\n\n    OTV_OPTIONAL_TABLE( ExtGlyph );\n    OTV_OPTIONAL_TABLE( DefJstfLangSys );\n\n\n    OTV_NAME_ENTER( \"JstfScript\" );\n\n    OTV_LIMIT_CHECK( 6 );\n    OTV_OPTIONAL_OFFSET( ExtGlyph );\n    OTV_OPTIONAL_OFFSET( DefJstfLangSys );\n    JstfLangSysCount = FT_NEXT_USHORT( p );\n\n    OTV_TRACE(( \" (JstfLangSysCount = %d)\\n\", JstfLangSysCount ));\n\n    table_size = JstfLangSysCount * 6 + 6;\n\n    OTV_SIZE_CHECK( ExtGlyph );\n    if ( ExtGlyph )\n    {\n      otvalid->extra1 = otvalid->glyph_count;\n      OTV_NEST1( ExtenderGlyph );\n      OTV_RUN( table + ExtGlyph, otvalid );\n    }\n\n    OTV_SIZE_CHECK( DefJstfLangSys );\n    if ( DefJstfLangSys )\n    {\n      OTV_NEST2( JstfLangSys, JstfPriority );\n      OTV_RUN( table + DefJstfLangSys, otvalid );\n    }\n\n    OTV_LIMIT_CHECK( 6 * JstfLangSysCount );\n\n    /* JstfLangSysRecord */\n    OTV_NEST2( JstfLangSys, JstfPriority );\n    for ( ; JstfLangSysCount > 0; JstfLangSysCount-- )\n    {\n      p += 4;       /* skip JstfLangSysTag */\n\n      OTV_RUN( table + FT_NEXT_USHORT( p ), otvalid );\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /* sets otvalid->extra1 (GSUB lookup count) */\n  /* sets otvalid->extra2 (GPOS lookup count) */\n  /* sets otvalid->glyph_count                */\n\n  FT_LOCAL_DEF( void )\n  otv_JSTF_validate( FT_Bytes      table,\n                     FT_Bytes      gsub,\n                     FT_Bytes      gpos,\n                     FT_UInt       glyph_count,\n                     FT_Validator  ftvalid )\n  {\n    OTV_ValidatorRec  otvalidrec;\n    OTV_Validator     otvalid = &otvalidrec;\n    FT_Bytes          p     = table;\n    FT_UInt           JstfScriptCount;\n\n\n    otvalid->root = ftvalid;\n\n\n    FT_TRACE3(( \"validating JSTF table\\n\" ));\n    OTV_INIT;\n\n    OTV_LIMIT_CHECK( 6 );\n\n    if ( FT_NEXT_ULONG( p ) != 0x10000UL )      /* Version */\n      FT_INVALID_FORMAT;\n\n    JstfScriptCount = FT_NEXT_USHORT( p );\n\n    FT_TRACE3(( \" (JstfScriptCount = %d)\\n\", JstfScriptCount ));\n\n    OTV_LIMIT_CHECK( JstfScriptCount * 6 );\n\n    if ( gsub )\n      otvalid->extra1 = otv_GSUBGPOS_get_Lookup_count( gsub );\n    else\n      otvalid->extra1 = 0;\n\n    if ( gpos )\n      otvalid->extra2 = otv_GSUBGPOS_get_Lookup_count( gpos );\n    else\n      otvalid->extra2 = 0;\n\n    otvalid->glyph_count = glyph_count;\n\n    /* JstfScriptRecord */\n    for ( ; JstfScriptCount > 0; JstfScriptCount-- )\n    {\n      p += 4;       /* skip JstfScriptTag */\n\n      /* JstfScript */\n      otv_JstfScript_validate( table + FT_NEXT_USHORT( p ), otvalid );\n    }\n\n    FT_TRACE4(( \"\\n\" ));\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/otvalid/otvmath.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  otvmath.c                                                              */\n/*                                                                         */\n/*    OpenType MATH table validation (body).                               */\n/*                                                                         */\n/*  Copyright 2007, 2008 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  Written by George Williams.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"otvalid.h\"\n#include \"otvcommn.h\"\n#include \"otvgpos.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_otvmath\n\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                  MATH TYPOGRAPHIC CONSTANTS                   *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static void\n  otv_MathConstants_validate( FT_Bytes       table,\n                              OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   i;\n    FT_UInt   table_size;\n\n    OTV_OPTIONAL_TABLE( DeviceTableOffset );\n\n\n    OTV_NAME_ENTER( \"MathConstants\" );\n\n    /* 56 constants, 51 have device tables */\n    OTV_LIMIT_CHECK( 2 * ( 56 + 51 ) );\n    table_size = 2 * ( 56 + 51 );\n\n    p += 4 * 2;                 /* First 4 constants have no device tables */\n    for ( i = 0; i < 51; ++i )\n    {\n      p += 2;                                            /* skip the value */\n      OTV_OPTIONAL_OFFSET( DeviceTableOffset );\n      OTV_SIZE_CHECK( DeviceTableOffset );\n      if ( DeviceTableOffset )\n        otv_Device_validate( table + DeviceTableOffset, otvalid );\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                   MATH ITALICS CORRECTION                     *****/\n  /*****                 MATH TOP ACCENT ATTACHMENT                    *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static void\n  otv_MathItalicsCorrectionInfo_validate( FT_Bytes       table,\n                                          OTV_Validator  otvalid,\n                                          FT_Int         isItalic )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   i, cnt, table_size ;\n\n    OTV_OPTIONAL_TABLE( Coverage );\n    OTV_OPTIONAL_TABLE( DeviceTableOffset );\n\n    FT_UNUSED( isItalic );  /* only used if tracing is active */\n\n\n    OTV_NAME_ENTER( isItalic ? \"MathItalicsCorrectionInfo\"\n                             : \"MathTopAccentAttachment\" );\n\n    OTV_LIMIT_CHECK( 4 );\n\n    OTV_OPTIONAL_OFFSET( Coverage );\n    cnt = FT_NEXT_USHORT( p );\n\n    OTV_LIMIT_CHECK( 4 * cnt );\n    table_size = 4 + 4 * cnt;\n\n    OTV_SIZE_CHECK( Coverage );\n    otv_Coverage_validate( table + Coverage, otvalid, cnt );\n\n    for ( i = 0; i < cnt; ++i )\n    {\n      p += 2;                                            /* Skip the value */\n      OTV_OPTIONAL_OFFSET( DeviceTableOffset );\n      OTV_SIZE_CHECK( DeviceTableOffset );\n      if ( DeviceTableOffset )\n        otv_Device_validate( table + DeviceTableOffset, otvalid );\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                           MATH KERNING                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static void\n  otv_MathKern_validate( FT_Bytes       table,\n                         OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   i, cnt, table_size;\n\n    OTV_OPTIONAL_TABLE( DeviceTableOffset );\n\n\n    /* OTV_NAME_ENTER( \"MathKern\" );*/\n\n    OTV_LIMIT_CHECK( 2 );\n\n    cnt = FT_NEXT_USHORT( p );\n\n    OTV_LIMIT_CHECK( 4 * cnt + 2 );\n    table_size = 4 + 4 * cnt;\n\n    /* Heights */\n    for ( i = 0; i < cnt; ++i )\n    {\n      p += 2;                                            /* Skip the value */\n      OTV_OPTIONAL_OFFSET( DeviceTableOffset );\n      OTV_SIZE_CHECK( DeviceTableOffset );\n      if ( DeviceTableOffset )\n        otv_Device_validate( table + DeviceTableOffset, otvalid );\n    }\n\n    /* One more Kerning value */\n    for ( i = 0; i < cnt + 1; ++i )\n    {\n      p += 2;                                            /* Skip the value */\n      OTV_OPTIONAL_OFFSET( DeviceTableOffset );\n      OTV_SIZE_CHECK( DeviceTableOffset );\n      if ( DeviceTableOffset )\n        otv_Device_validate( table + DeviceTableOffset, otvalid );\n    }\n\n    OTV_EXIT;\n  }\n\n\n  static void\n  otv_MathKernInfo_validate( FT_Bytes       table,\n                             OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   i, j, cnt, table_size;\n\n    OTV_OPTIONAL_TABLE( Coverage );\n    OTV_OPTIONAL_TABLE( MKRecordOffset );\n\n\n    OTV_NAME_ENTER( \"MathKernInfo\" );\n\n    OTV_LIMIT_CHECK( 4 );\n\n    OTV_OPTIONAL_OFFSET( Coverage );\n    cnt = FT_NEXT_USHORT( p );\n\n    OTV_LIMIT_CHECK( 8 * cnt );\n    table_size = 4 + 8 * cnt;\n\n    OTV_SIZE_CHECK( Coverage );\n    otv_Coverage_validate( table + Coverage, otvalid, cnt );\n\n    for ( i = 0; i < cnt; ++i )\n    {\n      for ( j = 0; j < 4; ++j )\n      {\n        OTV_OPTIONAL_OFFSET( MKRecordOffset );\n        OTV_SIZE_CHECK( MKRecordOffset );\n        if ( MKRecordOffset )\n          otv_MathKern_validate( table + MKRecordOffset, otvalid );\n      }\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                         MATH GLYPH INFO                       *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static void\n  otv_MathGlyphInfo_validate( FT_Bytes       table,\n                              OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   MathItalicsCorrectionInfo, MathTopAccentAttachment;\n    FT_UInt   ExtendedShapeCoverage, MathKernInfo;\n\n\n    OTV_NAME_ENTER( \"MathGlyphInfo\" );\n\n    OTV_LIMIT_CHECK( 8 );\n\n    MathItalicsCorrectionInfo = FT_NEXT_USHORT( p );\n    MathTopAccentAttachment   = FT_NEXT_USHORT( p );\n    ExtendedShapeCoverage     = FT_NEXT_USHORT( p );\n    MathKernInfo              = FT_NEXT_USHORT( p );\n\n    if ( MathItalicsCorrectionInfo )\n      otv_MathItalicsCorrectionInfo_validate(\n        table + MathItalicsCorrectionInfo, otvalid, TRUE );\n\n    /* Italic correction and Top Accent Attachment have the same format */\n    if ( MathTopAccentAttachment )\n      otv_MathItalicsCorrectionInfo_validate(\n        table + MathTopAccentAttachment, otvalid, FALSE );\n\n    if ( ExtendedShapeCoverage )\n    {\n      OTV_NAME_ENTER( \"ExtendedShapeCoverage\" );\n      otv_Coverage_validate( table + ExtendedShapeCoverage, otvalid, -1 );\n      OTV_EXIT;\n    }\n\n    if ( MathKernInfo )\n      otv_MathKernInfo_validate( table + MathKernInfo, otvalid );\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    MATH GLYPH CONSTRUCTION                    *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static void\n  otv_GlyphAssembly_validate( FT_Bytes       table,\n                              OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   pcnt, table_size;\n    FT_UInt   i;\n\n    OTV_OPTIONAL_TABLE( DeviceTableOffset );\n\n\n    /* OTV_NAME_ENTER( \"GlyphAssembly\" ); */\n\n    OTV_LIMIT_CHECK( 6 );\n\n    p += 2;                           /* Skip the Italics Correction value */\n    OTV_OPTIONAL_OFFSET( DeviceTableOffset );\n    pcnt = FT_NEXT_USHORT( p );\n\n    OTV_LIMIT_CHECK( 8 * pcnt );\n    table_size = 6 + 8 * pcnt;\n\n    OTV_SIZE_CHECK( DeviceTableOffset );\n    if ( DeviceTableOffset )\n      otv_Device_validate( table + DeviceTableOffset, otvalid );\n\n    for ( i = 0; i < pcnt; ++i )\n    {\n      FT_UInt  gid;\n\n\n      gid = FT_NEXT_USHORT( p );\n      if ( gid >= otvalid->glyph_count )\n        FT_INVALID_GLYPH_ID;\n      p += 2*4;             /* skip the Start, End, Full, and Flags fields */\n    }\n\n    /* OTV_EXIT; */\n  }\n\n\n  static void\n  otv_MathGlyphConstruction_validate( FT_Bytes       table,\n                                      OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   vcnt, table_size;\n    FT_UInt   i;\n\n    OTV_OPTIONAL_TABLE( GlyphAssembly );\n\n\n    /* OTV_NAME_ENTER( \"MathGlyphConstruction\" ); */\n\n    OTV_LIMIT_CHECK( 4 );\n\n    OTV_OPTIONAL_OFFSET( GlyphAssembly );\n    vcnt = FT_NEXT_USHORT( p );\n\n    OTV_LIMIT_CHECK( 4 * vcnt );\n    table_size = 4 + 4 * vcnt;\n\n    for ( i = 0; i < vcnt; ++i )\n    {\n      FT_UInt  gid;\n\n\n      gid = FT_NEXT_USHORT( p );\n      if ( gid >= otvalid->glyph_count )\n        FT_INVALID_GLYPH_ID;\n      p += 2;                          /* skip the size */\n    }\n\n    OTV_SIZE_CHECK( GlyphAssembly );\n    if ( GlyphAssembly )\n      otv_GlyphAssembly_validate( table+GlyphAssembly, otvalid );\n\n    /* OTV_EXIT; */\n  }\n\n\n  static void\n  otv_MathVariants_validate( FT_Bytes       table,\n                             OTV_Validator  otvalid )\n  {\n    FT_Bytes  p = table;\n    FT_UInt   vcnt, hcnt, i, table_size;\n\n    OTV_OPTIONAL_TABLE( VCoverage );\n    OTV_OPTIONAL_TABLE( HCoverage );\n    OTV_OPTIONAL_TABLE( Offset );\n\n\n    OTV_NAME_ENTER( \"MathVariants\" );\n\n    OTV_LIMIT_CHECK( 10 );\n\n    p += 2;                       /* Skip the MinConnectorOverlap constant */\n    OTV_OPTIONAL_OFFSET( VCoverage );\n    OTV_OPTIONAL_OFFSET( HCoverage );\n    vcnt = FT_NEXT_USHORT( p );\n    hcnt = FT_NEXT_USHORT( p );\n\n    OTV_LIMIT_CHECK( 2 * vcnt + 2 * hcnt );\n    table_size = 10 + 2 * vcnt + 2 * hcnt;\n\n    OTV_SIZE_CHECK( VCoverage );\n    if ( VCoverage )\n      otv_Coverage_validate( table + VCoverage, otvalid, vcnt );\n\n    OTV_SIZE_CHECK( HCoverage );\n    if ( HCoverage )\n      otv_Coverage_validate( table + HCoverage, otvalid, hcnt );\n\n    for ( i = 0; i < vcnt; ++i )\n    {\n      OTV_OPTIONAL_OFFSET( Offset );\n      OTV_SIZE_CHECK( Offset );\n      otv_MathGlyphConstruction_validate( table + Offset, otvalid );\n    }\n\n    for ( i = 0; i < hcnt; ++i )\n    {\n      OTV_OPTIONAL_OFFSET( Offset );\n      OTV_SIZE_CHECK( Offset );\n      otv_MathGlyphConstruction_validate( table + Offset, otvalid );\n    }\n\n    OTV_EXIT;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                          MATH TABLE                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* sets otvalid->glyph_count */\n\n  FT_LOCAL_DEF( void )\n  otv_MATH_validate( FT_Bytes      table,\n                     FT_UInt       glyph_count,\n                     FT_Validator  ftvalid )\n  {\n    OTV_ValidatorRec  otvalidrec;\n    OTV_Validator     otvalid = &otvalidrec;\n    FT_Bytes          p       = table;\n    FT_UInt           MathConstants, MathGlyphInfo, MathVariants;\n\n\n    otvalid->root = ftvalid;\n\n    FT_TRACE3(( \"validating MATH table\\n\" ));\n    OTV_INIT;\n\n    OTV_LIMIT_CHECK( 10 );\n\n    if ( FT_NEXT_ULONG( p ) != 0x10000UL )      /* Version */\n      FT_INVALID_FORMAT;\n\n    MathConstants = FT_NEXT_USHORT( p );\n    MathGlyphInfo = FT_NEXT_USHORT( p );\n    MathVariants  = FT_NEXT_USHORT( p );\n\n    otvalid->glyph_count = glyph_count;\n\n    otv_MathConstants_validate( table + MathConstants,\n                                otvalid );\n    otv_MathGlyphInfo_validate( table + MathGlyphInfo,\n                                otvalid );\n    otv_MathVariants_validate ( table + MathVariants,\n                                otvalid );\n\n    FT_TRACE4(( \"\\n\" ));\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/otvalid/otvmod.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  otvmod.c                                                               */\n/*                                                                         */\n/*    FreeType's OpenType validation module implementation (body).         */\n/*                                                                         */\n/*  Copyright 2004-2008, 2013 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_TRUETYPE_TABLES_H\n#include FT_TRUETYPE_TAGS_H\n#include FT_OPENTYPE_VALIDATE_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_SERVICE_OPENTYPE_VALIDATE_H\n\n#include \"otvmod.h\"\n#include \"otvalid.h\"\n#include \"otvcommn.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_otvmodule\n\n\n  static FT_Error\n  otv_load_table( FT_Face             face,\n                  FT_Tag              tag,\n                  FT_Byte* volatile*  table,\n                  FT_ULong*           table_len )\n  {\n    FT_Error   error;\n    FT_Memory  memory = FT_FACE_MEMORY( face );\n\n\n    error = FT_Load_Sfnt_Table( face, tag, 0, NULL, table_len );\n    if ( FT_ERR_EQ( error, Table_Missing ) )\n      return FT_Err_Ok;\n    if ( error )\n      goto Exit;\n\n    if ( FT_ALLOC( *table, *table_len ) )\n      goto Exit;\n\n    error = FT_Load_Sfnt_Table( face, tag, 0, *table, table_len );\n\n  Exit:\n    return error;\n  }\n\n\n  static FT_Error\n  otv_validate( FT_Face volatile   face,\n                FT_UInt            ot_flags,\n                FT_Bytes          *ot_base,\n                FT_Bytes          *ot_gdef,\n                FT_Bytes          *ot_gpos,\n                FT_Bytes          *ot_gsub,\n                FT_Bytes          *ot_jstf )\n  {\n    FT_Error                  error = FT_Err_Ok;\n    FT_Byte* volatile         base;\n    FT_Byte* volatile         gdef;\n    FT_Byte* volatile         gpos;\n    FT_Byte* volatile         gsub;\n    FT_Byte* volatile         jstf;\n    FT_Byte* volatile         math;\n    FT_ULong                  len_base, len_gdef, len_gpos, len_gsub, len_jstf;\n    FT_ULong                  len_math;\n    FT_UInt                   num_glyphs = (FT_UInt)face->num_glyphs;\n    FT_ValidatorRec volatile  valid;\n\n\n    base     = gdef     = gpos     = gsub     = jstf     = math     = NULL;\n    len_base = len_gdef = len_gpos = len_gsub = len_jstf = len_math = 0;\n\n    /*\n     * XXX: OpenType tables cannot handle 32-bit glyph index,\n     *      although broken TrueType can have 32-bit glyph index.\n     */\n    if ( face->num_glyphs > 0xFFFFL )\n    {\n      FT_TRACE1(( \"otv_validate: Invalid glyphs index (0x0000FFFF - 0x%08x) \",\n                  face->num_glyphs ));\n      FT_TRACE1(( \"are not handled by OpenType tables\\n\" ));\n      num_glyphs = 0xFFFF;\n    }\n\n    /* load tables */\n\n    if ( ot_flags & FT_VALIDATE_BASE )\n    {\n      error = otv_load_table( face, TTAG_BASE, &base, &len_base );\n      if ( error )\n        goto Exit;\n    }\n\n    if ( ot_flags & FT_VALIDATE_GDEF )\n    {\n      error = otv_load_table( face, TTAG_GDEF, &gdef, &len_gdef );\n      if ( error )\n        goto Exit;\n    }\n\n    if ( ot_flags & FT_VALIDATE_GPOS )\n    {\n      error = otv_load_table( face, TTAG_GPOS, &gpos, &len_gpos );\n      if ( error )\n        goto Exit;\n    }\n\n    if ( ot_flags & FT_VALIDATE_GSUB )\n    {\n      error = otv_load_table( face, TTAG_GSUB, &gsub, &len_gsub );\n      if ( error )\n        goto Exit;\n    }\n\n    if ( ot_flags & FT_VALIDATE_JSTF )\n    {\n      error = otv_load_table( face, TTAG_JSTF, &jstf, &len_jstf );\n      if ( error )\n        goto Exit;\n    }\n\n    if ( ot_flags & FT_VALIDATE_MATH )\n    {\n      error = otv_load_table( face, TTAG_MATH, &math, &len_math );\n      if ( error )\n        goto Exit;\n    }\n\n    /* validate tables */\n\n    if ( base )\n    {\n      ft_validator_init( &valid, base, base + len_base, FT_VALIDATE_DEFAULT );\n      if ( ft_setjmp( valid.jump_buffer ) == 0 )\n        otv_BASE_validate( base, &valid );\n      error = valid.error;\n      if ( error )\n        goto Exit;\n    }\n\n    if ( gpos )\n    {\n      ft_validator_init( &valid, gpos, gpos + len_gpos, FT_VALIDATE_DEFAULT );\n      if ( ft_setjmp( valid.jump_buffer ) == 0 )\n        otv_GPOS_validate( gpos, num_glyphs, &valid );\n      error = valid.error;\n      if ( error )\n        goto Exit;\n    }\n\n    if ( gsub )\n    {\n      ft_validator_init( &valid, gsub, gsub + len_gsub, FT_VALIDATE_DEFAULT );\n      if ( ft_setjmp( valid.jump_buffer ) == 0 )\n        otv_GSUB_validate( gsub, num_glyphs, &valid );\n      error = valid.error;\n      if ( error )\n        goto Exit;\n    }\n\n    if ( gdef )\n    {\n      ft_validator_init( &valid, gdef, gdef + len_gdef, FT_VALIDATE_DEFAULT );\n      if ( ft_setjmp( valid.jump_buffer ) == 0 )\n        otv_GDEF_validate( gdef, gsub, gpos, num_glyphs, &valid );\n      error = valid.error;\n      if ( error )\n        goto Exit;\n    }\n\n    if ( jstf )\n    {\n      ft_validator_init( &valid, jstf, jstf + len_jstf, FT_VALIDATE_DEFAULT );\n      if ( ft_setjmp( valid.jump_buffer ) == 0 )\n        otv_JSTF_validate( jstf, gsub, gpos, num_glyphs, &valid );\n      error = valid.error;\n      if ( error )\n        goto Exit;\n    }\n\n    if ( math )\n    {\n      ft_validator_init( &valid, math, math + len_math, FT_VALIDATE_DEFAULT );\n      if ( ft_setjmp( valid.jump_buffer ) == 0 )\n        otv_MATH_validate( math, num_glyphs, &valid );\n      error = valid.error;\n      if ( error )\n        goto Exit;\n    }\n\n    *ot_base = (FT_Bytes)base;\n    *ot_gdef = (FT_Bytes)gdef;\n    *ot_gpos = (FT_Bytes)gpos;\n    *ot_gsub = (FT_Bytes)gsub;\n    *ot_jstf = (FT_Bytes)jstf;\n\n  Exit:\n    if ( error )\n    {\n      FT_Memory  memory = FT_FACE_MEMORY( face );\n\n\n      FT_FREE( base );\n      FT_FREE( gdef );\n      FT_FREE( gpos );\n      FT_FREE( gsub );\n      FT_FREE( jstf );\n    }\n\n    {\n      FT_Memory  memory = FT_FACE_MEMORY( face );\n\n\n      FT_FREE( math );                 /* Can't return this as API is frozen */\n    }\n\n    return error;\n  }\n\n\n  static\n  const FT_Service_OTvalidateRec  otvalid_interface =\n  {\n    otv_validate\n  };\n\n\n  static\n  const FT_ServiceDescRec  otvalid_services[] =\n  {\n    { FT_SERVICE_ID_OPENTYPE_VALIDATE, &otvalid_interface },\n    { NULL, NULL }\n  };\n\n\n  static FT_Pointer\n  otvalid_get_service( FT_Module    module,\n                       const char*  service_id )\n  {\n    FT_UNUSED( module );\n\n    return ft_service_list_lookup( otvalid_services, service_id );\n  }\n\n\n  FT_CALLBACK_TABLE_DEF\n  const FT_Module_Class  otv_module_class =\n  {\n    0,\n    sizeof ( FT_ModuleRec ),\n    \"otvalid\",\n    0x10000L,\n    0x20000L,\n\n    0,              /* module-specific interface */\n\n    (FT_Module_Constructor)0,\n    (FT_Module_Destructor) 0,\n    (FT_Module_Requester)  otvalid_get_service\n  };\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/otvalid/otvmod.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  otvmod.h                                                               */\n/*                                                                         */\n/*    FreeType's OpenType validation module implementation                 */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 2004 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __OTVMOD_H__\n#define __OTVMOD_H__\n\n\n#include <ft2build.h>\n#include FT_MODULE_H\n\n\nFT_BEGIN_HEADER\n\n#ifdef FT_CONFIG_OPTION_PIC\n#error \"this module does not support PIC yet\"\n#endif\n\n\n  FT_EXPORT_VAR( const FT_Module_Class )  otv_module_class;\n\n\nFT_END_HEADER\n\n#endif /* __OTVMOD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/otvalid/rules.mk",
    "content": "#\n# FreeType 2 OpenType validation driver configuration rules\n#\n\n\n# Copyright 2004, 2007 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\n# OTV driver directory\n#\nOTV_DIR := $(SRC_DIR)/otvalid\n\n\n# compilation flags for the driver\n#\nOTV_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(OTV_DIR))\n\n\n# OTV driver sources (i.e., C files)\n#\nOTV_DRV_SRC := $(OTV_DIR)/otvbase.c  \\\n               $(OTV_DIR)/otvcommn.c \\\n               $(OTV_DIR)/otvgdef.c  \\\n               $(OTV_DIR)/otvgpos.c  \\\n               $(OTV_DIR)/otvgsub.c  \\\n               $(OTV_DIR)/otvjstf.c  \\\n               $(OTV_DIR)/otvmath.c  \\\n               $(OTV_DIR)/otvmod.c\n\n# OTV driver headers\n#\nOTV_DRV_H := $(OTV_DIR)/otvalid.h  \\\n             $(OTV_DIR)/otvcommn.h \\\n             $(OTV_DIR)/otverror.h \\\n             $(OTV_DIR)/otvgpos.h  \\\n             $(OTV_DIR)/otvmod.h\n\n\n# OTV driver object(s)\n#\n#   OTV_DRV_OBJ_M is used during `multi' builds.\n#   OTV_DRV_OBJ_S is used during `single' builds.\n#\nOTV_DRV_OBJ_M := $(OTV_DRV_SRC:$(OTV_DIR)/%.c=$(OBJ_DIR)/%.$O)\nOTV_DRV_OBJ_S := $(OBJ_DIR)/otvalid.$O\n\n# OTV driver source file for single build\n#\nOTV_DRV_SRC_S := $(OTV_DIR)/otvalid.c\n\n\n# OTV driver - single object\n#\n$(OTV_DRV_OBJ_S): $(OTV_DRV_SRC_S) $(OTV_DRV_SRC) \\\n                   $(FREETYPE_H) $(OTV_DRV_H)\n\t$(OTV_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(OTV_DRV_SRC_S))\n\n\n# OTV driver - multiple objects\n#\n$(OBJ_DIR)/%.$O: $(OTV_DIR)/%.c $(FREETYPE_H) $(OTV_DRV_H)\n\t$(OTV_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\n\n\n# update main driver object lists\n#\nDRV_OBJS_S += $(OTV_DRV_OBJ_S)\nDRV_OBJS_M += $(OTV_DRV_OBJ_M)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/pcf/Jamfile",
    "content": "# FreeType 2 src/pcf Jamfile\n#\n# Copyright 2001, 2003 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) pcf ;\n\n{\n  local  _sources ;\n\n  if $(FT2_MULTI)\n  {\n    _sources = pcfdrivr pcfread pcfutil ;\n  }\n  else\n  {\n    _sources = pcf ;\n  }\n\n  Library  $(FT2_LIB) : $(_sources).c ;\n}\n\n# end of src/pcf Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/pcf/README",
    "content": "                  FreeType font driver for PCF fonts\n\n                       Francesco Zappa Nardelli\n                  <francesco.zappa.nardelli@ens.fr>\n\n\nIntroduction\n************\n\nPCF (Portable Compiled Format) is a binary bitmap font format, largely used\nin X world. This code implements a PCF driver for the FreeType library.\nGlyph images are loaded into memory only on demand, thus leading to a small\nmemory footprint.\n\nInformation on the PCF font format can only be worked out from\n`pcfread.c', and `pcfwrite.c', to be found, for instance, in the XFree86\n(www.xfree86.org) source tree (xc/lib/font/bitmap/).\n\nMany good bitmap fonts in bdf format come with XFree86: they can be\ncompiled into the pcf format using the `bdftopcf' utility.\n\n\nSupported hardware\n******************\n\nThe driver has been tested on linux/x86 and sunos5.5/sparc.  In both\ncases the compiler was gcc.  When back in Paris, I will test it also\non linux/alpha.\n\n\nEncodings\n*********\n\nUse `FT_Get_BDF_Charset_ID' to access the encoding and registry.\n\nThe driver always exports `ft_encoding_none' as face->charmap.encoding.\nFT_Get_Char_Index() behavior is unmodified, that is, it converts the ULong\nvalue given as argument into the corresponding glyph number.\n\n\nKnown problems\n**************\n\n- dealing explicitly with encodings breaks the uniformity of freetype2\n  api.\n\n- except for encodings properties, client applications have no\n  visibility of the PCF_Face object.  This means that applications\n  cannot directly access font tables and are obliged to trust\n  FreeType.\n\n- currently, glyph names and ink_metrics are ignored.\n\nI plan to give full visibility of the PCF_Face object in the next\nrelease of the driver, thus implementing also glyph names and\nink_metrics.\n\n- height is defined as (ascent - descent).  Is this correct?\n\n- if unable to read size information from the font, PCF_Init_Face\n  sets available_size->width and available_size->height to 12.\n\n- too many english grammar errors in the readme file :-(\n\n\nLicense\n*******\n\nCopyright (C) 2000 by Francesco Zappa Nardelli\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\nCredits\n*******\n\nKeith Packard wrote the pcf driver found in XFree86.  His work is at\nthe same time the specification and the sample implementation of the\nPCF format.  Undoubtedly, this driver is inspired from his work.\n"
  },
  {
    "path": "ext/freetype2/src/pcf/module.mk",
    "content": "#\n# FreeType 2 PCF module definition\n#\n\n# Copyright 2000, 2006 by\n# Francesco Zappa Nardelli\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n\nFTMODULE_H_COMMANDS += PCF_DRIVER\n\ndefine PCF_DRIVER\n$(OPEN_DRIVER) FT_Driver_ClassRec, pcf_driver_class $(CLOSE_DRIVER)\n$(ECHO_DRIVER)pcf       $(ECHO_DRIVER_DESC)pcf bitmap fonts$(ECHO_DRIVER_DONE)\nendef\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/pcf/pcf.c",
    "content": "/*  pcf.c\n\n    FreeType font driver for pcf fonts\n\n  Copyright 2000-2001, 2003 by\n  Francesco Zappa Nardelli\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\n\n\n#define FT_MAKE_OPTION_SINGLE_OBJECT\n\n\n#include <ft2build.h>\n#include \"pcfutil.c\"\n#include \"pcfread.c\"\n#include \"pcfdrivr.c\"\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pcf/pcf.h",
    "content": "/*  pcf.h\n\n  FreeType font driver for pcf fonts\n\n  Copyright (C) 2000, 2001, 2002, 2003, 2006, 2010 by\n  Francesco Zappa Nardelli\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\n\n\n#ifndef __PCF_H__\n#define __PCF_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DRIVER_H\n#include FT_INTERNAL_STREAM_H\n\n\nFT_BEGIN_HEADER\n\n  typedef struct  PCF_TableRec_\n  {\n    FT_ULong  type;\n    FT_ULong  format;\n    FT_ULong  size;\n    FT_ULong  offset;\n\n  } PCF_TableRec, *PCF_Table;\n\n\n  typedef struct  PCF_TocRec_\n  {\n    FT_ULong   version;\n    FT_ULong   count;\n    PCF_Table  tables;\n\n  } PCF_TocRec, *PCF_Toc;\n\n\n  typedef struct  PCF_ParsePropertyRec_\n  {\n    FT_Long  name;\n    FT_Byte  isString;\n    FT_Long  value;\n\n  } PCF_ParsePropertyRec, *PCF_ParseProperty;\n\n\n  typedef struct  PCF_PropertyRec_\n  {\n    FT_String*  name;\n    FT_Byte     isString;\n\n    union\n    {\n      FT_String*  atom;\n      FT_Long     l;\n      FT_ULong    ul;\n\n    } value;\n\n  } PCF_PropertyRec, *PCF_Property;\n\n\n  typedef struct  PCF_Compressed_MetricRec_\n  {\n    FT_Byte  leftSideBearing;\n    FT_Byte  rightSideBearing;\n    FT_Byte  characterWidth;\n    FT_Byte  ascent;\n    FT_Byte  descent;\n\n  } PCF_Compressed_MetricRec, *PCF_Compressed_Metric;\n\n\n  typedef struct  PCF_MetricRec_\n  {\n    FT_Short  leftSideBearing;\n    FT_Short  rightSideBearing;\n    FT_Short  characterWidth;\n    FT_Short  ascent;\n    FT_Short  descent;\n    FT_Short  attributes;\n    FT_ULong  bits;\n\n  } PCF_MetricRec, *PCF_Metric;\n\n\n  typedef struct  PCF_AccelRec_\n  {\n    FT_Byte        noOverlap;\n    FT_Byte        constantMetrics;\n    FT_Byte        terminalFont;\n    FT_Byte        constantWidth;\n    FT_Byte        inkInside;\n    FT_Byte        inkMetrics;\n    FT_Byte        drawDirection;\n    FT_Long        fontAscent;\n    FT_Long        fontDescent;\n    FT_Long        maxOverlap;\n    PCF_MetricRec  minbounds;\n    PCF_MetricRec  maxbounds;\n    PCF_MetricRec  ink_minbounds;\n    PCF_MetricRec  ink_maxbounds;\n\n  } PCF_AccelRec, *PCF_Accel;\n\n\n  typedef struct  PCF_EncodingRec_\n  {\n    FT_Long    enc;\n    FT_UShort  glyph;\n\n  } PCF_EncodingRec, *PCF_Encoding;\n\n\n  typedef struct  PCF_FaceRec_\n  {\n    FT_FaceRec     root;\n\n    FT_StreamRec   comp_stream;\n    FT_Stream      comp_source;\n\n    char*          charset_encoding;\n    char*          charset_registry;\n\n    PCF_TocRec     toc;\n    PCF_AccelRec   accel;\n\n    int            nprops;\n    PCF_Property   properties;\n\n    FT_Long        nmetrics;\n    PCF_Metric     metrics;\n    FT_Long        nencodings;\n    PCF_Encoding   encodings;\n\n    FT_Short       defaultChar;\n\n    FT_ULong       bitmapsFormat;\n\n    FT_CharMap     charmap_handle;\n    FT_CharMapRec  charmap;  /* a single charmap per face */\n\n  } PCF_FaceRec, *PCF_Face;\n\n\n  /* macros for pcf font format */\n\n#define LSBFirst  0\n#define MSBFirst  1\n\n#define PCF_FILE_VERSION        ( ( 'p' << 24 ) | \\\n                                  ( 'c' << 16 ) | \\\n                                  ( 'f' <<  8 ) | 1 )\n#define PCF_FORMAT_MASK         0xFFFFFF00UL\n\n#define PCF_DEFAULT_FORMAT      0x00000000UL\n#define PCF_INKBOUNDS           0x00000200UL\n#define PCF_ACCEL_W_INKBOUNDS   0x00000100UL\n#define PCF_COMPRESSED_METRICS  0x00000100UL\n\n#define PCF_FORMAT_MATCH( a, b ) \\\n          ( ( (a) & PCF_FORMAT_MASK ) == ( (b) & PCF_FORMAT_MASK ) )\n\n#define PCF_GLYPH_PAD_MASK  ( 3 << 0 )\n#define PCF_BYTE_MASK       ( 1 << 2 )\n#define PCF_BIT_MASK        ( 1 << 3 )\n#define PCF_SCAN_UNIT_MASK  ( 3 << 4 )\n\n#define PCF_BYTE_ORDER( f ) \\\n          ( ( (f) & PCF_BYTE_MASK ) ? MSBFirst : LSBFirst )\n#define PCF_BIT_ORDER( f ) \\\n          ( ( (f) & PCF_BIT_MASK ) ? MSBFirst : LSBFirst )\n#define PCF_GLYPH_PAD_INDEX( f ) \\\n          ( (f) & PCF_GLYPH_PAD_MASK )\n#define PCF_GLYPH_PAD( f ) \\\n          ( 1 << PCF_GLYPH_PAD_INDEX( f ) )\n#define PCF_SCAN_UNIT_INDEX( f ) \\\n          ( ( (f) & PCF_SCAN_UNIT_MASK ) >> 4 )\n#define PCF_SCAN_UNIT( f ) \\\n          ( 1 << PCF_SCAN_UNIT_INDEX( f ) )\n#define PCF_FORMAT_BITS( f )             \\\n          ( (f) & ( PCF_GLYPH_PAD_MASK | \\\n                    PCF_BYTE_MASK      | \\\n                    PCF_BIT_MASK       | \\\n                    PCF_SCAN_UNIT_MASK ) )\n\n#define PCF_SIZE_TO_INDEX( s )  ( (s) == 4 ? 2 : (s) == 2 ? 1 : 0 )\n#define PCF_INDEX_TO_SIZE( b )  ( 1 << b )\n\n#define PCF_FORMAT( bit, byte, glyph, scan )          \\\n          ( ( PCF_SIZE_TO_INDEX( scan )      << 4 ) | \\\n            ( ( (bit)  == MSBFirst ? 1 : 0 ) << 3 ) | \\\n            ( ( (byte) == MSBFirst ? 1 : 0 ) << 2 ) | \\\n            ( PCF_SIZE_TO_INDEX( glyph )     << 0 ) )\n\n#define PCF_PROPERTIES        ( 1 << 0 )\n#define PCF_ACCELERATORS      ( 1 << 1 )\n#define PCF_METRICS           ( 1 << 2 )\n#define PCF_BITMAPS           ( 1 << 3 )\n#define PCF_INK_METRICS       ( 1 << 4 )\n#define PCF_BDF_ENCODINGS     ( 1 << 5 )\n#define PCF_SWIDTHS           ( 1 << 6 )\n#define PCF_GLYPH_NAMES       ( 1 << 7 )\n#define PCF_BDF_ACCELERATORS  ( 1 << 8 )\n\n#define GLYPHPADOPTIONS  4 /* I'm not sure about this */\n\n  FT_LOCAL( FT_Error )\n  pcf_load_font( FT_Stream,\n                 PCF_Face );\n\nFT_END_HEADER\n\n#endif /* __PCF_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pcf/pcfdrivr.c",
    "content": "/*  pcfdrivr.c\n\n    FreeType font driver for pcf files\n\n    Copyright (C) 2000-2004, 2006-2011, 2013, 2014 by\n    Francesco Zappa Nardelli\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\n\n\n#include <ft2build.h>\n\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_GZIP_H\n#include FT_LZW_H\n#include FT_BZIP2_H\n#include FT_ERRORS_H\n#include FT_BDF_H\n#include FT_TRUETYPE_IDS_H\n\n#include \"pcf.h\"\n#include \"pcfdrivr.h\"\n#include \"pcfread.h\"\n\n#include \"pcferror.h\"\n#include \"pcfutil.h\"\n\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_pcfread\n\n#include FT_SERVICE_BDF_H\n#include FT_SERVICE_XFREE86_NAME_H\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_pcfdriver\n\n\n  typedef struct  PCF_CMapRec_\n  {\n    FT_CMapRec    root;\n    FT_UInt       num_encodings;\n    PCF_Encoding  encodings;\n\n  } PCF_CMapRec, *PCF_CMap;\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  pcf_cmap_init( FT_CMap     pcfcmap,   /* PCF_CMap */\n                 FT_Pointer  init_data )\n  {\n    PCF_CMap  cmap = (PCF_CMap)pcfcmap;\n    PCF_Face  face = (PCF_Face)FT_CMAP_FACE( pcfcmap );\n\n    FT_UNUSED( init_data );\n\n\n    cmap->num_encodings = (FT_UInt)face->nencodings;\n    cmap->encodings     = face->encodings;\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_CALLBACK_DEF( void )\n  pcf_cmap_done( FT_CMap  pcfcmap )         /* PCF_CMap */\n  {\n    PCF_CMap  cmap = (PCF_CMap)pcfcmap;\n\n\n    cmap->encodings     = NULL;\n    cmap->num_encodings = 0;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt )\n  pcf_cmap_char_index( FT_CMap    pcfcmap,  /* PCF_CMap */\n                       FT_UInt32  charcode )\n  {\n    PCF_CMap      cmap      = (PCF_CMap)pcfcmap;\n    PCF_Encoding  encodings = cmap->encodings;\n    FT_UInt       min, max, mid;\n    FT_UInt       result    = 0;\n\n\n    min = 0;\n    max = cmap->num_encodings;\n\n    while ( min < max )\n    {\n      FT_ULong  code;\n\n\n      mid  = ( min + max ) >> 1;\n      code = encodings[mid].enc;\n\n      if ( charcode == code )\n      {\n        result = encodings[mid].glyph + 1;\n        break;\n      }\n\n      if ( charcode < code )\n        max = mid;\n      else\n        min = mid + 1;\n    }\n\n    return result;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt )\n  pcf_cmap_char_next( FT_CMap    pcfcmap,   /* PCF_CMap */\n                      FT_UInt32  *acharcode )\n  {\n    PCF_CMap      cmap      = (PCF_CMap)pcfcmap;\n    PCF_Encoding  encodings = cmap->encodings;\n    FT_UInt       min, max, mid;\n    FT_ULong      charcode  = *acharcode + 1;\n    FT_UInt       result    = 0;\n\n\n    min = 0;\n    max = cmap->num_encodings;\n\n    while ( min < max )\n    {\n      FT_ULong  code;\n\n\n      mid  = ( min + max ) >> 1;\n      code = encodings[mid].enc;\n\n      if ( charcode == code )\n      {\n        result = encodings[mid].glyph + 1;\n        goto Exit;\n      }\n\n      if ( charcode < code )\n        max = mid;\n      else\n        min = mid + 1;\n    }\n\n    charcode = 0;\n    if ( min < cmap->num_encodings )\n    {\n      charcode = encodings[min].enc;\n      result   = encodings[min].glyph + 1;\n    }\n\n  Exit:\n    if ( charcode > 0xFFFFFFFFUL )\n    {\n      FT_TRACE1(( \"pcf_cmap_char_next: charcode 0x%x > 32bit API\" ));\n      *acharcode = 0;\n      /* XXX: result should be changed to indicate an overflow error */\n    }\n    else\n      *acharcode = (FT_UInt32)charcode;\n    return result;\n  }\n\n\n  static\n  const FT_CMap_ClassRec  pcf_cmap_class =\n  {\n    sizeof ( PCF_CMapRec ),\n    pcf_cmap_init,\n    pcf_cmap_done,\n    pcf_cmap_char_index,\n    pcf_cmap_char_next,\n\n    NULL, NULL, NULL, NULL, NULL\n  };\n\n\n  FT_CALLBACK_DEF( void )\n  PCF_Face_Done( FT_Face  pcfface )         /* PCF_Face */\n  {\n    PCF_Face   face = (PCF_Face)pcfface;\n    FT_Memory  memory;\n\n\n    if ( !face )\n      return;\n\n    memory = FT_FACE_MEMORY( face );\n\n    FT_FREE( face->encodings );\n    FT_FREE( face->metrics );\n\n    /* free properties */\n    if ( face->properties )\n    {\n      FT_Int  i;\n\n\n      for ( i = 0; i < face->nprops; i++ )\n      {\n        PCF_Property  prop = &face->properties[i];\n\n\n        if ( prop )\n        {\n          FT_FREE( prop->name );\n          if ( prop->isString )\n            FT_FREE( prop->value.atom );\n        }\n      }\n\n      FT_FREE( face->properties );\n    }\n\n    FT_FREE( face->toc.tables );\n    FT_FREE( pcfface->family_name );\n    FT_FREE( pcfface->style_name );\n    FT_FREE( pcfface->available_sizes );\n    FT_FREE( face->charset_encoding );\n    FT_FREE( face->charset_registry );\n\n    /* close compressed stream if any */\n    if ( pcfface->stream == &face->comp_stream )\n    {\n      FT_Stream_Close( &face->comp_stream );\n      pcfface->stream = face->comp_source;\n    }\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  PCF_Face_Init( FT_Stream      stream,\n                 FT_Face        pcfface,        /* PCF_Face */\n                 FT_Int         face_index,\n                 FT_Int         num_params,\n                 FT_Parameter*  params )\n  {\n    PCF_Face  face  = (PCF_Face)pcfface;\n    FT_Error  error;\n\n    FT_UNUSED( num_params );\n    FT_UNUSED( params );\n\n\n    FT_TRACE2(( \"PCF driver\\n\" ));\n\n    error = pcf_load_font( stream, face );\n    if ( error )\n    {\n      PCF_Face_Done( pcfface );\n\n#if defined( FT_CONFIG_OPTION_USE_ZLIB )  || \\\n    defined( FT_CONFIG_OPTION_USE_LZW )   || \\\n    defined( FT_CONFIG_OPTION_USE_BZIP2 )\n\n#ifdef FT_CONFIG_OPTION_USE_ZLIB\n      {\n        FT_Error  error2;\n\n\n        /* this didn't work, try gzip support! */\n        error2 = FT_Stream_OpenGzip( &face->comp_stream, stream );\n        if ( FT_ERR_EQ( error2, Unimplemented_Feature ) )\n          goto Fail;\n\n        error = error2;\n      }\n#endif /* FT_CONFIG_OPTION_USE_ZLIB */\n\n#ifdef FT_CONFIG_OPTION_USE_LZW\n      if ( error )\n      {\n        FT_Error  error3;\n\n\n        /* this didn't work, try LZW support! */\n        error3 = FT_Stream_OpenLZW( &face->comp_stream, stream );\n        if ( FT_ERR_EQ( error3, Unimplemented_Feature ) )\n          goto Fail;\n\n        error = error3;\n      }\n#endif /* FT_CONFIG_OPTION_USE_LZW */\n\n#ifdef FT_CONFIG_OPTION_USE_BZIP2\n      if ( error )\n      {\n        FT_Error  error4;\n\n\n        /* this didn't work, try Bzip2 support! */\n        error4 = FT_Stream_OpenBzip2( &face->comp_stream, stream );\n        if ( FT_ERR_EQ( error4, Unimplemented_Feature ) )\n          goto Fail;\n\n        error = error4;\n      }\n#endif /* FT_CONFIG_OPTION_USE_BZIP2 */\n\n      if ( error )\n        goto Fail;\n\n      face->comp_source = stream;\n      pcfface->stream   = &face->comp_stream;\n\n      stream = pcfface->stream;\n\n      error = pcf_load_font( stream, face );\n      if ( error )\n        goto Fail;\n\n#else /* !(FT_CONFIG_OPTION_USE_ZLIB ||\n           FT_CONFIG_OPTION_USE_LZW ||\n           FT_CONFIG_OPTION_USE_BZIP2) */\n\n      goto Fail;\n\n#endif\n    }\n\n    /* PCF could not have multiple face in single font file.\n     * XXX: non-zero face_index is already invalid argument, but\n     *      Type1, Type42 driver has a convention to return\n     *      an invalid argument error when the font could be\n     *      opened by the specified driver.\n     */\n    if ( face_index > 0 ) {\n      FT_ERROR(( \"PCF_Face_Init: invalid face index\\n\" ));\n      PCF_Face_Done( pcfface );\n      return FT_THROW( Invalid_Argument );\n    }\n\n    /* set up charmap */\n    {\n      FT_String  *charset_registry = face->charset_registry;\n      FT_String  *charset_encoding = face->charset_encoding;\n      FT_Bool     unicode_charmap  = 0;\n\n\n      if ( charset_registry && charset_encoding )\n      {\n        char*  s = charset_registry;\n\n\n        /* Uh, oh, compare first letters manually to avoid dependency\n           on locales. */\n        if ( ( s[0] == 'i' || s[0] == 'I' ) &&\n             ( s[1] == 's' || s[1] == 'S' ) &&\n             ( s[2] == 'o' || s[2] == 'O' ) )\n        {\n          s += 3;\n          if ( !ft_strcmp( s, \"10646\" )                      ||\n               ( !ft_strcmp( s, \"8859\" ) &&\n                 !ft_strcmp( face->charset_encoding, \"1\" ) ) )\n          unicode_charmap = 1;\n        }\n      }\n\n      {\n        FT_CharMapRec  charmap;\n\n\n        charmap.face        = FT_FACE( face );\n        charmap.encoding    = FT_ENCODING_NONE;\n        /* initial platform/encoding should indicate unset status? */\n        charmap.platform_id = TT_PLATFORM_APPLE_UNICODE;\n        charmap.encoding_id = TT_APPLE_ID_DEFAULT;\n\n        if ( unicode_charmap )\n        {\n          charmap.encoding    = FT_ENCODING_UNICODE;\n          charmap.platform_id = TT_PLATFORM_MICROSOFT;\n          charmap.encoding_id = TT_MS_ID_UNICODE_CS;\n        }\n\n        error = FT_CMap_New( &pcf_cmap_class, NULL, &charmap, NULL );\n\n#if 0\n        /* Select default charmap */\n        if ( pcfface->num_charmaps )\n          pcfface->charmap = pcfface->charmaps[0];\n#endif\n      }\n    }\n\n  Exit:\n    return error;\n\n  Fail:\n    FT_TRACE2(( \"  not a PCF file\\n\" ));\n    PCF_Face_Done( pcfface );\n    error = FT_THROW( Unknown_File_Format );  /* error */\n    goto Exit;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  PCF_Size_Select( FT_Size   size,\n                   FT_ULong  strike_index )\n  {\n    PCF_Accel  accel = &( (PCF_Face)size->face )->accel;\n\n\n    FT_Select_Metrics( size->face, strike_index );\n\n    size->metrics.ascender    =  accel->fontAscent << 6;\n    size->metrics.descender   = -accel->fontDescent << 6;\n    size->metrics.max_advance =  accel->maxbounds.characterWidth << 6;\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  PCF_Size_Request( FT_Size          size,\n                    FT_Size_Request  req )\n  {\n    PCF_Face         face  = (PCF_Face)size->face;\n    FT_Bitmap_Size*  bsize = size->face->available_sizes;\n    FT_Error         error = FT_ERR( Invalid_Pixel_Size );\n    FT_Long          height;\n\n\n    height = FT_REQUEST_HEIGHT( req );\n    height = ( height + 32 ) >> 6;\n\n    switch ( req->type )\n    {\n    case FT_SIZE_REQUEST_TYPE_NOMINAL:\n      if ( height == ( ( bsize->y_ppem + 32 ) >> 6 ) )\n        error = FT_Err_Ok;\n      break;\n\n    case FT_SIZE_REQUEST_TYPE_REAL_DIM:\n      if ( height == ( face->accel.fontAscent +\n                       face->accel.fontDescent ) )\n        error = FT_Err_Ok;\n      break;\n\n    default:\n      error = FT_THROW( Unimplemented_Feature );\n      break;\n    }\n\n    if ( error )\n      return error;\n    else\n      return PCF_Size_Select( size, 0 );\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  PCF_Glyph_Load( FT_GlyphSlot  slot,\n                  FT_Size       size,\n                  FT_UInt       glyph_index,\n                  FT_Int32      load_flags )\n  {\n    PCF_Face    face   = (PCF_Face)FT_SIZE_FACE( size );\n    FT_Stream   stream;\n    FT_Error    error  = FT_Err_Ok;\n    FT_Bitmap*  bitmap = &slot->bitmap;\n    PCF_Metric  metric;\n    FT_Offset   bytes;\n\n    FT_UNUSED( load_flags );\n\n\n    FT_TRACE1(( \"PCF_Glyph_Load: glyph index %d\\n\", glyph_index ));\n\n    if ( !face )\n    {\n      error = FT_THROW( Invalid_Face_Handle );\n      goto Exit;\n    }\n\n    if ( glyph_index >= (FT_UInt)face->root.num_glyphs )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    stream = face->root.stream;\n\n    if ( glyph_index > 0 )\n      glyph_index--;\n\n    metric = face->metrics + glyph_index;\n\n    bitmap->rows       = metric->ascent + metric->descent;\n    bitmap->width      = metric->rightSideBearing - metric->leftSideBearing;\n    bitmap->num_grays  = 1;\n    bitmap->pixel_mode = FT_PIXEL_MODE_MONO;\n\n    FT_TRACE6(( \"BIT_ORDER %d ; BYTE_ORDER %d ; GLYPH_PAD %d\\n\",\n                  PCF_BIT_ORDER( face->bitmapsFormat ),\n                  PCF_BYTE_ORDER( face->bitmapsFormat ),\n                  PCF_GLYPH_PAD( face->bitmapsFormat ) ));\n\n    switch ( PCF_GLYPH_PAD( face->bitmapsFormat ) )\n    {\n    case 1:\n      bitmap->pitch = ( bitmap->width + 7 ) >> 3;\n      break;\n\n    case 2:\n      bitmap->pitch = ( ( bitmap->width + 15 ) >> 4 ) << 1;\n      break;\n\n    case 4:\n      bitmap->pitch = ( ( bitmap->width + 31 ) >> 5 ) << 2;\n      break;\n\n    case 8:\n      bitmap->pitch = ( ( bitmap->width + 63 ) >> 6 ) << 3;\n      break;\n\n    default:\n      return FT_THROW( Invalid_File_Format );\n    }\n\n    /* XXX: to do: are there cases that need repadding the bitmap? */\n    bytes = bitmap->pitch * bitmap->rows;\n\n    error = ft_glyphslot_alloc_bitmap( slot, (FT_ULong)bytes );\n    if ( error )\n      goto Exit;\n\n    if ( FT_STREAM_SEEK( metric->bits )          ||\n         FT_STREAM_READ( bitmap->buffer, bytes ) )\n      goto Exit;\n\n    if ( PCF_BIT_ORDER( face->bitmapsFormat ) != MSBFirst )\n      BitOrderInvert( bitmap->buffer, bytes );\n\n    if ( ( PCF_BYTE_ORDER( face->bitmapsFormat ) !=\n           PCF_BIT_ORDER( face->bitmapsFormat )  ) )\n    {\n      switch ( PCF_SCAN_UNIT( face->bitmapsFormat ) )\n      {\n      case 1:\n        break;\n\n      case 2:\n        TwoByteSwap( bitmap->buffer, bytes );\n        break;\n\n      case 4:\n        FourByteSwap( bitmap->buffer, bytes );\n        break;\n      }\n    }\n\n    slot->format      = FT_GLYPH_FORMAT_BITMAP;\n    slot->bitmap_left = metric->leftSideBearing;\n    slot->bitmap_top  = metric->ascent;\n\n    slot->metrics.horiAdvance  = metric->characterWidth << 6;\n    slot->metrics.horiBearingX = metric->leftSideBearing << 6;\n    slot->metrics.horiBearingY = metric->ascent << 6;\n    slot->metrics.width        = ( metric->rightSideBearing -\n                                   metric->leftSideBearing ) << 6;\n    slot->metrics.height       = bitmap->rows << 6;\n\n    ft_synthesize_vertical_metrics( &slot->metrics,\n                                    ( face->accel.fontAscent +\n                                      face->accel.fontDescent ) << 6 );\n\n  Exit:\n    return error;\n  }\n\n\n /*\n  *\n  *  BDF SERVICE\n  *\n  */\n\n  static FT_Error\n  pcf_get_bdf_property( PCF_Face          face,\n                        const char*       prop_name,\n                        BDF_PropertyRec  *aproperty )\n  {\n    PCF_Property  prop;\n\n\n    prop = pcf_find_property( face, prop_name );\n    if ( prop != NULL )\n    {\n      if ( prop->isString )\n      {\n        aproperty->type   = BDF_PROPERTY_TYPE_ATOM;\n        aproperty->u.atom = prop->value.atom;\n      }\n      else\n      {\n        if ( prop->value.l > 0x7FFFFFFFL || prop->value.l < ( -1 - 0x7FFFFFFFL ) )\n        {\n          FT_TRACE1(( \"pcf_get_bdf_property: \" ));\n          FT_TRACE1(( \"too large integer 0x%x is truncated\\n\" ));\n        }\n        /* Apparently, the PCF driver loads all properties as signed integers!\n         * This really doesn't seem to be a problem, because this is\n         * sufficient for any meaningful values.\n         */\n        aproperty->type      = BDF_PROPERTY_TYPE_INTEGER;\n        aproperty->u.integer = (FT_Int32)prop->value.l;\n      }\n      return 0;\n    }\n\n    return FT_THROW( Invalid_Argument );\n  }\n\n\n  static FT_Error\n  pcf_get_charset_id( PCF_Face      face,\n                      const char*  *acharset_encoding,\n                      const char*  *acharset_registry )\n  {\n    *acharset_encoding = face->charset_encoding;\n    *acharset_registry = face->charset_registry;\n\n    return 0;\n  }\n\n\n  static const FT_Service_BDFRec  pcf_service_bdf =\n  {\n    (FT_BDF_GetCharsetIdFunc)pcf_get_charset_id,\n    (FT_BDF_GetPropertyFunc) pcf_get_bdf_property\n  };\n\n\n /*\n  *\n  *  SERVICE LIST\n  *\n  */\n\n  static const FT_ServiceDescRec  pcf_services[] =\n  {\n    { FT_SERVICE_ID_BDF,       &pcf_service_bdf },\n    { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_PCF },\n    { NULL, NULL }\n  };\n\n\n  FT_CALLBACK_DEF( FT_Module_Interface )\n  pcf_driver_requester( FT_Module    module,\n                        const char*  name )\n  {\n    FT_UNUSED( module );\n\n    return ft_service_list_lookup( pcf_services, name );\n  }\n\n\n  FT_CALLBACK_TABLE_DEF\n  const FT_Driver_ClassRec  pcf_driver_class =\n  {\n    {\n      FT_MODULE_FONT_DRIVER        |\n      FT_MODULE_DRIVER_NO_OUTLINES,\n      sizeof ( FT_DriverRec ),\n\n      \"pcf\",\n      0x10000L,\n      0x20000L,\n\n      0,\n\n      0,                    /* FT_Module_Constructor */\n      0,                    /* FT_Module_Destructor  */\n      pcf_driver_requester\n    },\n\n    sizeof ( PCF_FaceRec ),\n    sizeof ( FT_SizeRec ),\n    sizeof ( FT_GlyphSlotRec ),\n\n    PCF_Face_Init,\n    PCF_Face_Done,\n    0,                      /* FT_Size_InitFunc */\n    0,                      /* FT_Size_DoneFunc */\n    0,                      /* FT_Slot_InitFunc */\n    0,                      /* FT_Slot_DoneFunc */\n\n    PCF_Glyph_Load,\n\n    0,                      /* FT_Face_GetKerningFunc  */\n    0,                      /* FT_Face_AttachFunc      */\n    0,                      /* FT_Face_GetAdvancesFunc */\n\n    PCF_Size_Request,\n    PCF_Size_Select\n  };\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pcf/pcfdrivr.h",
    "content": "/*  pcfdrivr.h\n\n    FreeType font driver for pcf fonts\n\n  Copyright 2000-2001, 2002 by\n  Francesco Zappa Nardelli\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\n\n\n#ifndef __PCFDRIVR_H__\n#define __PCFDRIVR_H__\n\n#include <ft2build.h>\n#include FT_INTERNAL_DRIVER_H\n\nFT_BEGIN_HEADER\n\n#ifdef FT_CONFIG_OPTION_PIC\n#error \"this module does not support PIC yet\"\n#endif\n\n  FT_EXPORT_VAR( const FT_Driver_ClassRec )  pcf_driver_class;\n\nFT_END_HEADER\n\n\n#endif /* __PCFDRIVR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pcf/pcferror.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pcferror.h                                                             */\n/*                                                                         */\n/*    PCF error codes (specification only).                                */\n/*                                                                         */\n/*  Copyright 2001, 2012 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the PCF error enumeration constants.      */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __PCFERROR_H__\n#define __PCFERROR_H__\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  PCF_Err_\n#define FT_ERR_BASE    FT_Mod_Err_PCF\n\n#include FT_ERRORS_H\n\n#endif /* __PCFERROR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pcf/pcfread.c",
    "content": "/*  pcfread.c\n\n    FreeType font driver for pcf fonts\n\n  Copyright 2000-2010, 2012-2014 by\n  Francesco Zappa Nardelli\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\n\n\n#include <ft2build.h>\n\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_OBJECTS_H\n\n#include \"pcf.h\"\n#include \"pcfread.h\"\n\n#include \"pcferror.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_pcfread\n\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n  static const char* const  tableNames[] =\n  {\n    \"prop\", \"accl\", \"mtrcs\", \"bmps\", \"imtrcs\",\n    \"enc\", \"swidth\", \"names\", \"accel\"\n  };\n#endif\n\n\n  static\n  const FT_Frame_Field  pcf_toc_header[] =\n  {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  PCF_TocRec\n\n    FT_FRAME_START( 8 ),\n      FT_FRAME_ULONG_LE( version ),\n      FT_FRAME_ULONG_LE( count ),\n    FT_FRAME_END\n  };\n\n\n  static\n  const FT_Frame_Field  pcf_table_header[] =\n  {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  PCF_TableRec\n\n    FT_FRAME_START( 16  ),\n      FT_FRAME_ULONG_LE( type ),\n      FT_FRAME_ULONG_LE( format ),\n      FT_FRAME_ULONG_LE( size ),   /* rounded up to a multiple of 4 */\n      FT_FRAME_ULONG_LE( offset ),\n    FT_FRAME_END\n  };\n\n\n  static FT_Error\n  pcf_read_TOC( FT_Stream  stream,\n                PCF_Face   face )\n  {\n    FT_Error   error;\n    PCF_Toc    toc = &face->toc;\n    PCF_Table  tables;\n\n    FT_Memory  memory = FT_FACE( face )->memory;\n    FT_UInt    n;\n\n    FT_ULong   size;\n\n\n    if ( FT_STREAM_SEEK( 0 )                          ||\n         FT_STREAM_READ_FIELDS( pcf_toc_header, toc ) )\n      return FT_THROW( Cannot_Open_Resource );\n\n    if ( toc->version != PCF_FILE_VERSION                 ||\n         toc->count   >  FT_ARRAY_MAX( face->toc.tables ) ||\n         toc->count   == 0                                )\n      return FT_THROW( Invalid_File_Format );\n\n    if ( FT_NEW_ARRAY( face->toc.tables, toc->count ) )\n      return FT_THROW( Out_Of_Memory );\n\n    tables = face->toc.tables;\n    for ( n = 0; n < toc->count; n++ )\n    {\n      if ( FT_STREAM_READ_FIELDS( pcf_table_header, tables ) )\n        goto Exit;\n      tables++;\n    }\n\n    /* Sort tables and check for overlaps.  Because they are almost      */\n    /* always ordered already, an in-place bubble sort with simultaneous */\n    /* boundary checking seems appropriate.                              */\n    tables = face->toc.tables;\n\n    for ( n = 0; n < toc->count - 1; n++ )\n    {\n      FT_UInt  i, have_change;\n\n\n      have_change = 0;\n\n      for ( i = 0; i < toc->count - 1 - n; i++ )\n      {\n        PCF_TableRec  tmp;\n\n\n        if ( tables[i].offset > tables[i + 1].offset )\n        {\n          tmp           = tables[i];\n          tables[i]     = tables[i + 1];\n          tables[i + 1] = tmp;\n\n          have_change = 1;\n        }\n\n        if ( ( tables[i].size   > tables[i + 1].offset )                  ||\n             ( tables[i].offset > tables[i + 1].offset - tables[i].size ) )\n        {\n          error = FT_THROW( Invalid_Offset );\n          goto Exit;\n        }\n      }\n\n      if ( !have_change )\n        break;\n    }\n\n    /*\n     *  We now check whether the `size' and `offset' values are reasonable:\n     *  `offset' + `size' must not exceed the stream size.\n     *\n     *  Note, however, that X11's `pcfWriteFont' routine (used by the\n     *  `bdftopcf' program to create PDF font files) has two special\n     *  features.\n     *\n     *  - It always assigns the accelerator table a size of 100 bytes in the\n     *    TOC, regardless of its real size, which can vary between 34 and 72\n     *    bytes.\n     *\n     *  - Due to the way the routine is designed, it ships out the last font\n     *    table with its real size, ignoring the TOC's size value.  Since\n     *    the TOC size values are always rounded up to a multiple of 4, the\n     *    difference can be up to three bytes for all tables except the\n     *    accelerator table, for which the difference can be as large as 66\n     *    bytes.\n     *\n     */\n\n    tables = face->toc.tables;\n    size   = stream->size;\n\n    for ( n = 0; n < toc->count - 1; n++ )\n    {\n      /* we need two checks to avoid overflow */\n      if ( ( tables->size   > size                ) ||\n           ( tables->offset > size - tables->size ) )\n      {\n        error = FT_THROW( Invalid_Table );\n        goto Exit;\n      }\n      tables++;\n    }\n\n    /* only check `tables->offset' for last table element ... */\n    if ( ( tables->offset > size ) )\n    {\n      error = FT_THROW( Invalid_Table );\n      goto Exit;\n    }\n    /* ... and adjust `tables->size' to the real value if necessary */\n    if ( tables->size > size - tables->offset )\n      tables->size = size - tables->offset;\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n    {\n      FT_UInt      i, j;\n      const char*  name = \"?\";\n\n\n      FT_TRACE4(( \"pcf_read_TOC:\\n\" ));\n\n      FT_TRACE4(( \"  number of tables: %ld\\n\", face->toc.count ));\n\n      tables = face->toc.tables;\n      for ( i = 0; i < toc->count; i++ )\n      {\n        for ( j = 0; j < sizeof ( tableNames ) / sizeof ( tableNames[0] );\n              j++ )\n          if ( tables[i].type == (FT_UInt)( 1 << j ) )\n            name = tableNames[j];\n\n        FT_TRACE4(( \"  %d: type=%s, format=0x%X, \"\n                    \"size=%ld (0x%lX), offset=%ld (0x%lX)\\n\",\n                    i, name,\n                    tables[i].format,\n                    tables[i].size, tables[i].size,\n                    tables[i].offset, tables[i].offset ));\n      }\n    }\n\n#endif\n\n    return FT_Err_Ok;\n\n  Exit:\n    FT_FREE( face->toc.tables );\n    return error;\n  }\n\n\n#define PCF_METRIC_SIZE  12\n\n  static\n  const FT_Frame_Field  pcf_metric_header[] =\n  {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  PCF_MetricRec\n\n    FT_FRAME_START( PCF_METRIC_SIZE ),\n      FT_FRAME_SHORT_LE( leftSideBearing ),\n      FT_FRAME_SHORT_LE( rightSideBearing ),\n      FT_FRAME_SHORT_LE( characterWidth ),\n      FT_FRAME_SHORT_LE( ascent ),\n      FT_FRAME_SHORT_LE( descent ),\n      FT_FRAME_SHORT_LE( attributes ),\n    FT_FRAME_END\n  };\n\n\n  static\n  const FT_Frame_Field  pcf_metric_msb_header[] =\n  {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  PCF_MetricRec\n\n    FT_FRAME_START( PCF_METRIC_SIZE ),\n      FT_FRAME_SHORT( leftSideBearing ),\n      FT_FRAME_SHORT( rightSideBearing ),\n      FT_FRAME_SHORT( characterWidth ),\n      FT_FRAME_SHORT( ascent ),\n      FT_FRAME_SHORT( descent ),\n      FT_FRAME_SHORT( attributes ),\n    FT_FRAME_END\n  };\n\n\n#define PCF_COMPRESSED_METRIC_SIZE  5\n\n  static\n  const FT_Frame_Field  pcf_compressed_metric_header[] =\n  {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  PCF_Compressed_MetricRec\n\n    FT_FRAME_START( PCF_COMPRESSED_METRIC_SIZE ),\n      FT_FRAME_BYTE( leftSideBearing ),\n      FT_FRAME_BYTE( rightSideBearing ),\n      FT_FRAME_BYTE( characterWidth ),\n      FT_FRAME_BYTE( ascent ),\n      FT_FRAME_BYTE( descent ),\n    FT_FRAME_END\n  };\n\n\n  static FT_Error\n  pcf_get_metric( FT_Stream   stream,\n                  FT_ULong    format,\n                  PCF_Metric  metric )\n  {\n    FT_Error  error = FT_Err_Ok;\n\n\n    if ( PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )\n    {\n      const FT_Frame_Field*  fields;\n\n\n      /* parsing normal metrics */\n      fields = PCF_BYTE_ORDER( format ) == MSBFirst\n               ? pcf_metric_msb_header\n               : pcf_metric_header;\n\n      /* the following sets `error' but doesn't return in case of failure */\n      (void)FT_STREAM_READ_FIELDS( fields, metric );\n    }\n    else\n    {\n      PCF_Compressed_MetricRec  compr;\n\n\n      /* parsing compressed metrics */\n      if ( FT_STREAM_READ_FIELDS( pcf_compressed_metric_header, &compr ) )\n        goto Exit;\n\n      metric->leftSideBearing  = (FT_Short)( compr.leftSideBearing  - 0x80 );\n      metric->rightSideBearing = (FT_Short)( compr.rightSideBearing - 0x80 );\n      metric->characterWidth   = (FT_Short)( compr.characterWidth   - 0x80 );\n      metric->ascent           = (FT_Short)( compr.ascent           - 0x80 );\n      metric->descent          = (FT_Short)( compr.descent          - 0x80 );\n      metric->attributes       = 0;\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  static FT_Error\n  pcf_seek_to_table_type( FT_Stream  stream,\n                          PCF_Table  tables,\n                          FT_ULong   ntables, /* same as PCF_Toc->count */\n                          FT_ULong   type,\n                          FT_ULong  *aformat,\n                          FT_ULong  *asize )\n  {\n    FT_Error  error = FT_ERR( Invalid_File_Format );\n    FT_ULong  i;\n\n\n    for ( i = 0; i < ntables; i++ )\n      if ( tables[i].type == type )\n      {\n        if ( stream->pos > tables[i].offset )\n        {\n          error = FT_THROW( Invalid_Stream_Skip );\n          goto Fail;\n        }\n\n        if ( FT_STREAM_SKIP( tables[i].offset - stream->pos ) )\n        {\n          error = FT_THROW( Invalid_Stream_Skip );\n          goto Fail;\n        }\n\n        *asize   = tables[i].size;\n        *aformat = tables[i].format;\n\n        return FT_Err_Ok;\n      }\n\n  Fail:\n    *asize = 0;\n    return error;\n  }\n\n\n  static FT_Bool\n  pcf_has_table_type( PCF_Table  tables,\n                      FT_ULong   ntables, /* same as PCF_Toc->count */\n                      FT_ULong   type )\n  {\n    FT_ULong  i;\n\n\n    for ( i = 0; i < ntables; i++ )\n      if ( tables[i].type == type )\n        return TRUE;\n\n    return FALSE;\n  }\n\n\n#define PCF_PROPERTY_SIZE  9\n\n  static\n  const FT_Frame_Field  pcf_property_header[] =\n  {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  PCF_ParsePropertyRec\n\n    FT_FRAME_START( PCF_PROPERTY_SIZE ),\n      FT_FRAME_LONG_LE( name ),\n      FT_FRAME_BYTE   ( isString ),\n      FT_FRAME_LONG_LE( value ),\n    FT_FRAME_END\n  };\n\n\n  static\n  const FT_Frame_Field  pcf_property_msb_header[] =\n  {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  PCF_ParsePropertyRec\n\n    FT_FRAME_START( PCF_PROPERTY_SIZE ),\n      FT_FRAME_LONG( name ),\n      FT_FRAME_BYTE( isString ),\n      FT_FRAME_LONG( value ),\n    FT_FRAME_END\n  };\n\n\n  FT_LOCAL_DEF( PCF_Property )\n  pcf_find_property( PCF_Face          face,\n                     const FT_String*  prop )\n  {\n    PCF_Property  properties = face->properties;\n    FT_Bool       found      = 0;\n    int           i;\n\n\n    for ( i = 0 ; i < face->nprops && !found; i++ )\n    {\n      if ( !ft_strcmp( properties[i].name, prop ) )\n        found = 1;\n    }\n\n    if ( found )\n      return properties + i - 1;\n    else\n      return NULL;\n  }\n\n\n  static FT_Error\n  pcf_get_properties( FT_Stream  stream,\n                      PCF_Face   face )\n  {\n    PCF_ParseProperty  props      = 0;\n    PCF_Property       properties = NULL;\n    FT_ULong           nprops, i;\n    FT_ULong           format, size;\n    FT_Error           error;\n    FT_Memory          memory     = FT_FACE( face )->memory;\n    FT_ULong           string_size;\n    FT_String*         strings    = 0;\n\n\n    error = pcf_seek_to_table_type( stream,\n                                    face->toc.tables,\n                                    face->toc.count,\n                                    PCF_PROPERTIES,\n                                    &format,\n                                    &size );\n    if ( error )\n      goto Bail;\n\n    if ( FT_READ_ULONG_LE( format ) )\n      goto Bail;\n\n    FT_TRACE4(( \"pcf_get_properties:\\n\" ));\n\n    FT_TRACE4(( \"  format = %ld\\n\", format ));\n\n    if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )\n      goto Bail;\n\n    if ( PCF_BYTE_ORDER( format ) == MSBFirst )\n      (void)FT_READ_ULONG( nprops );\n    else\n      (void)FT_READ_ULONG_LE( nprops );\n    if ( error )\n      goto Bail;\n\n    FT_TRACE4(( \"  nprop = %d (truncate %d props)\\n\",\n                (int)nprops, nprops - (int)nprops ));\n\n    nprops = (int)nprops;\n\n    /* rough estimate */\n    if ( nprops > size / PCF_PROPERTY_SIZE )\n    {\n      error = FT_THROW( Invalid_Table );\n      goto Bail;\n    }\n\n    face->nprops = (int)nprops;\n\n    if ( FT_NEW_ARRAY( props, nprops ) )\n      goto Bail;\n\n    for ( i = 0; i < nprops; i++ )\n    {\n      if ( PCF_BYTE_ORDER( format ) == MSBFirst )\n      {\n        if ( FT_STREAM_READ_FIELDS( pcf_property_msb_header, props + i ) )\n          goto Bail;\n      }\n      else\n      {\n        if ( FT_STREAM_READ_FIELDS( pcf_property_header, props + i ) )\n          goto Bail;\n      }\n    }\n\n    /* pad the property array                                            */\n    /*                                                                   */\n    /* clever here - nprops is the same as the number of odd-units read, */\n    /* as only isStringProp are odd length   (Keith Packard)             */\n    /*                                                                   */\n    if ( nprops & 3 )\n    {\n      i = 4 - ( nprops & 3 );\n      if ( FT_STREAM_SKIP( i ) )\n      {\n        error = FT_THROW( Invalid_Stream_Skip );\n        goto Bail;\n      }\n    }\n\n    if ( PCF_BYTE_ORDER( format ) == MSBFirst )\n      (void)FT_READ_ULONG( string_size );\n    else\n      (void)FT_READ_ULONG_LE( string_size );\n    if ( error )\n      goto Bail;\n\n    FT_TRACE4(( \"  string_size = %ld\\n\", string_size ));\n\n    /* rough estimate */\n    if ( string_size > size - nprops * PCF_PROPERTY_SIZE )\n    {\n      error = FT_THROW( Invalid_Table );\n      goto Bail;\n    }\n\n    /* allocate one more byte so that we have a final null byte */\n    if ( FT_NEW_ARRAY( strings, string_size + 1 ) )\n      goto Bail;\n\n    error = FT_Stream_Read( stream, (FT_Byte*)strings, string_size );\n    if ( error )\n      goto Bail;\n\n    if ( FT_NEW_ARRAY( properties, nprops ) )\n      goto Bail;\n\n    face->properties = properties;\n\n    for ( i = 0; i < nprops; i++ )\n    {\n      FT_Long  name_offset = props[i].name;\n\n\n      if ( ( name_offset < 0 )                     ||\n           ( (FT_ULong)name_offset > string_size ) )\n      {\n        error = FT_THROW( Invalid_Offset );\n        goto Bail;\n      }\n\n      if ( FT_STRDUP( properties[i].name, strings + name_offset ) )\n        goto Bail;\n\n      FT_TRACE4(( \"  %s:\", properties[i].name ));\n\n      properties[i].isString = props[i].isString;\n\n      if ( props[i].isString )\n      {\n        FT_Long  value_offset = props[i].value;\n\n\n        if ( ( value_offset < 0 )                     ||\n             ( (FT_ULong)value_offset > string_size ) )\n        {\n          error = FT_THROW( Invalid_Offset );\n          goto Bail;\n        }\n\n        if ( FT_STRDUP( properties[i].value.atom, strings + value_offset ) )\n          goto Bail;\n\n        FT_TRACE4(( \" `%s'\\n\", properties[i].value.atom ));\n      }\n      else\n      {\n        properties[i].value.l = props[i].value;\n\n        FT_TRACE4(( \" %d\\n\", properties[i].value.l ));\n      }\n    }\n\n    error = FT_Err_Ok;\n\n  Bail:\n    FT_FREE( props );\n    FT_FREE( strings );\n\n    return error;\n  }\n\n\n  static FT_Error\n  pcf_get_metrics( FT_Stream  stream,\n                   PCF_Face   face )\n  {\n    FT_Error    error;\n    FT_Memory   memory  = FT_FACE( face )->memory;\n    FT_ULong    format, size;\n    PCF_Metric  metrics = 0;\n    FT_ULong    nmetrics, i;\n\n\n    error = pcf_seek_to_table_type( stream,\n                                    face->toc.tables,\n                                    face->toc.count,\n                                    PCF_METRICS,\n                                    &format,\n                                    &size );\n    if ( error )\n      return error;\n\n    if ( FT_READ_ULONG_LE( format ) )\n      goto Bail;\n\n    if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT )     &&\n         !PCF_FORMAT_MATCH( format, PCF_COMPRESSED_METRICS ) )\n      return FT_THROW( Invalid_File_Format );\n\n    if ( PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )\n    {\n      if ( PCF_BYTE_ORDER( format ) == MSBFirst )\n        (void)FT_READ_ULONG( nmetrics );\n      else\n        (void)FT_READ_ULONG_LE( nmetrics );\n    }\n    else\n    {\n      if ( PCF_BYTE_ORDER( format ) == MSBFirst )\n        (void)FT_READ_USHORT( nmetrics );\n      else\n        (void)FT_READ_USHORT_LE( nmetrics );\n    }\n    if ( error )\n      return FT_THROW( Invalid_File_Format );\n\n    face->nmetrics = nmetrics;\n\n    if ( !nmetrics )\n      return FT_THROW( Invalid_Table );\n\n    FT_TRACE4(( \"pcf_get_metrics:\\n\" ));\n\n    FT_TRACE4(( \"  number of metrics: %d\\n\", nmetrics ));\n\n    /* rough estimate */\n    if ( PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )\n    {\n      if ( nmetrics > size / PCF_METRIC_SIZE )\n        return FT_THROW( Invalid_Table );\n    }\n    else\n    {\n      if ( nmetrics > size / PCF_COMPRESSED_METRIC_SIZE )\n        return FT_THROW( Invalid_Table );\n    }\n\n    if ( FT_NEW_ARRAY( face->metrics, nmetrics ) )\n      return FT_THROW( Out_Of_Memory );\n\n    metrics = face->metrics;\n    for ( i = 0; i < nmetrics; i++, metrics++ )\n    {\n      error = pcf_get_metric( stream, format, metrics );\n\n      metrics->bits = 0;\n\n      FT_TRACE5(( \"  idx %d: width=%d, \"\n                  \"lsb=%d, rsb=%d, ascent=%d, descent=%d, swidth=%d\\n\",\n                  i,\n                  metrics->characterWidth,\n                  metrics->leftSideBearing,\n                  metrics->rightSideBearing,\n                  metrics->ascent,\n                  metrics->descent,\n                  metrics->attributes ));\n\n      if ( error )\n        break;\n\n      /* sanity checks -- those values are used in `PCF_Glyph_Load' to     */\n      /* compute a glyph's bitmap dimensions, thus setting them to zero in */\n      /* case of an error disables this particular glyph only              */\n      if ( metrics->rightSideBearing < metrics->leftSideBearing ||\n           metrics->ascent + metrics->descent < 0               )\n      {\n        metrics->characterWidth   = 0;\n        metrics->leftSideBearing  = 0;\n        metrics->rightSideBearing = 0;\n        metrics->ascent           = 0;\n        metrics->descent          = 0;\n\n        FT_TRACE0(( \"pcf_get_metrics:\"\n                    \" invalid metrics for glyph %d\\n\", i ));\n      }\n    }\n\n    if ( error )\n      FT_FREE( face->metrics );\n\n  Bail:\n    return error;\n  }\n\n\n  static FT_Error\n  pcf_get_bitmaps( FT_Stream  stream,\n                   PCF_Face   face )\n  {\n    FT_Error   error;\n    FT_Memory  memory  = FT_FACE( face )->memory;\n    FT_Long*   offsets = NULL;\n    FT_Long    bitmapSizes[GLYPHPADOPTIONS];\n    FT_ULong   format, size;\n    FT_ULong   nbitmaps, i, sizebitmaps = 0;\n\n\n    error = pcf_seek_to_table_type( stream,\n                                    face->toc.tables,\n                                    face->toc.count,\n                                    PCF_BITMAPS,\n                                    &format,\n                                    &size );\n    if ( error )\n      return error;\n\n    error = FT_Stream_EnterFrame( stream, 8 );\n    if ( error )\n      return error;\n\n    format = FT_GET_ULONG_LE();\n    if ( PCF_BYTE_ORDER( format ) == MSBFirst )\n      nbitmaps  = FT_GET_ULONG();\n    else\n      nbitmaps  = FT_GET_ULONG_LE();\n\n    FT_Stream_ExitFrame( stream );\n\n    if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )\n      return FT_THROW( Invalid_File_Format );\n\n    FT_TRACE4(( \"pcf_get_bitmaps:\\n\" ));\n\n    FT_TRACE4(( \"  number of bitmaps: %d\\n\", nbitmaps ));\n\n    /* XXX: PCF_Face->nmetrics is signed FT_Long, see pcf.h */\n    if ( face->nmetrics < 0 || nbitmaps != (FT_ULong)face->nmetrics )\n      return FT_THROW( Invalid_File_Format );\n\n    if ( FT_NEW_ARRAY( offsets, nbitmaps ) )\n      return error;\n\n    for ( i = 0; i < nbitmaps; i++ )\n    {\n      if ( PCF_BYTE_ORDER( format ) == MSBFirst )\n        (void)FT_READ_LONG( offsets[i] );\n      else\n        (void)FT_READ_LONG_LE( offsets[i] );\n\n      FT_TRACE5(( \"  bitmap %d: offset %ld (0x%lX)\\n\",\n                  i, offsets[i], offsets[i] ));\n    }\n    if ( error )\n      goto Bail;\n\n    for ( i = 0; i < GLYPHPADOPTIONS; i++ )\n    {\n      if ( PCF_BYTE_ORDER( format ) == MSBFirst )\n        (void)FT_READ_LONG( bitmapSizes[i] );\n      else\n        (void)FT_READ_LONG_LE( bitmapSizes[i] );\n      if ( error )\n        goto Bail;\n\n      sizebitmaps = bitmapSizes[PCF_GLYPH_PAD_INDEX( format )];\n\n      FT_TRACE4(( \"  padding %d implies a size of %ld\\n\", i, bitmapSizes[i] ));\n    }\n\n    FT_TRACE4(( \"  %d bitmaps, padding index %ld\\n\",\n                nbitmaps,\n                PCF_GLYPH_PAD_INDEX( format ) ));\n    FT_TRACE4(( \"  bitmap size = %d\\n\", sizebitmaps ));\n\n    FT_UNUSED( sizebitmaps );       /* only used for debugging */\n\n    for ( i = 0; i < nbitmaps; i++ )\n    {\n      /* rough estimate */\n      if ( ( offsets[i] < 0 )              ||\n           ( (FT_ULong)offsets[i] > size ) )\n      {\n        FT_TRACE0(( \"pcf_get_bitmaps:\"\n                    \" invalid offset to bitmap data of glyph %d\\n\", i ));\n      }\n      else\n        face->metrics[i].bits = stream->pos + offsets[i];\n    }\n\n    face->bitmapsFormat = format;\n\n  Bail:\n    FT_FREE( offsets );\n    return error;\n  }\n\n\n  static FT_Error\n  pcf_get_encodings( FT_Stream  stream,\n                     PCF_Face   face )\n  {\n    FT_Error      error;\n    FT_Memory     memory = FT_FACE( face )->memory;\n    FT_ULong      format, size;\n    int           firstCol, lastCol;\n    int           firstRow, lastRow;\n    int           nencoding, encodingOffset;\n    int           i, j, k;\n    PCF_Encoding  encoding = NULL;\n\n\n    error = pcf_seek_to_table_type( stream,\n                                    face->toc.tables,\n                                    face->toc.count,\n                                    PCF_BDF_ENCODINGS,\n                                    &format,\n                                    &size );\n    if ( error )\n      return error;\n\n    error = FT_Stream_EnterFrame( stream, 14 );\n    if ( error )\n      return error;\n\n    format = FT_GET_ULONG_LE();\n\n    if ( PCF_BYTE_ORDER( format ) == MSBFirst )\n    {\n      firstCol          = FT_GET_SHORT();\n      lastCol           = FT_GET_SHORT();\n      firstRow          = FT_GET_SHORT();\n      lastRow           = FT_GET_SHORT();\n      face->defaultChar = FT_GET_SHORT();\n    }\n    else\n    {\n      firstCol          = FT_GET_SHORT_LE();\n      lastCol           = FT_GET_SHORT_LE();\n      firstRow          = FT_GET_SHORT_LE();\n      lastRow           = FT_GET_SHORT_LE();\n      face->defaultChar = FT_GET_SHORT_LE();\n    }\n\n    FT_Stream_ExitFrame( stream );\n\n    if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )\n      return FT_THROW( Invalid_File_Format );\n\n    /* sanity checks */\n    if ( firstCol < 0       ||\n         firstCol > lastCol ||\n         lastCol  > 0xFF    ||\n         firstRow < 0       ||\n         firstRow > lastRow ||\n         lastRow  > 0xFF    )\n      return FT_THROW( Invalid_Table );\n\n    FT_TRACE4(( \"pdf_get_encodings:\\n\" ));\n\n    FT_TRACE4(( \"  firstCol %d, lastCol %d, firstRow %d, lastRow %d\\n\",\n                firstCol, lastCol, firstRow, lastRow ));\n\n    nencoding = ( lastCol - firstCol + 1 ) * ( lastRow - firstRow + 1 );\n\n    if ( FT_NEW_ARRAY( encoding, nencoding ) )\n      return FT_THROW( Out_Of_Memory );\n\n    error = FT_Stream_EnterFrame( stream, 2 * nencoding );\n    if ( error )\n      goto Bail;\n\n    k = 0;\n    for ( i = firstRow; i <= lastRow; i++ )\n    {\n      for ( j = firstCol; j <= lastCol; j++ )\n      {\n        if ( PCF_BYTE_ORDER( format ) == MSBFirst )\n          encodingOffset = FT_GET_SHORT();\n        else\n          encodingOffset = FT_GET_SHORT_LE();\n\n        if ( encodingOffset != -1 )\n        {\n          encoding[k].enc   = i * 256 + j;\n          encoding[k].glyph = (FT_Short)encodingOffset;\n\n          FT_TRACE5(( \"  code %d (0x%04X): idx %d\\n\",\n                      encoding[k].enc, encoding[k].enc, encoding[k].glyph ));\n\n          k++;\n        }\n      }\n    }\n    FT_Stream_ExitFrame( stream );\n\n    if ( FT_RENEW_ARRAY( encoding, nencoding, k ) )\n      goto Bail;\n\n    face->nencodings = k;\n    face->encodings  = encoding;\n\n    return error;\n\n  Bail:\n    FT_FREE( encoding );\n    return error;\n  }\n\n\n  static\n  const FT_Frame_Field  pcf_accel_header[] =\n  {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  PCF_AccelRec\n\n    FT_FRAME_START( 20 ),\n      FT_FRAME_BYTE      ( noOverlap ),\n      FT_FRAME_BYTE      ( constantMetrics ),\n      FT_FRAME_BYTE      ( terminalFont ),\n      FT_FRAME_BYTE      ( constantWidth ),\n      FT_FRAME_BYTE      ( inkInside ),\n      FT_FRAME_BYTE      ( inkMetrics ),\n      FT_FRAME_BYTE      ( drawDirection ),\n      FT_FRAME_SKIP_BYTES( 1 ),\n      FT_FRAME_LONG_LE   ( fontAscent ),\n      FT_FRAME_LONG_LE   ( fontDescent ),\n      FT_FRAME_LONG_LE   ( maxOverlap ),\n    FT_FRAME_END\n  };\n\n\n  static\n  const FT_Frame_Field  pcf_accel_msb_header[] =\n  {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  PCF_AccelRec\n\n    FT_FRAME_START( 20 ),\n      FT_FRAME_BYTE      ( noOverlap ),\n      FT_FRAME_BYTE      ( constantMetrics ),\n      FT_FRAME_BYTE      ( terminalFont ),\n      FT_FRAME_BYTE      ( constantWidth ),\n      FT_FRAME_BYTE      ( inkInside ),\n      FT_FRAME_BYTE      ( inkMetrics ),\n      FT_FRAME_BYTE      ( drawDirection ),\n      FT_FRAME_SKIP_BYTES( 1 ),\n      FT_FRAME_LONG      ( fontAscent ),\n      FT_FRAME_LONG      ( fontDescent ),\n      FT_FRAME_LONG      ( maxOverlap ),\n    FT_FRAME_END\n  };\n\n\n  static FT_Error\n  pcf_get_accel( FT_Stream  stream,\n                 PCF_Face   face,\n                 FT_ULong   type )\n  {\n    FT_ULong   format, size;\n    FT_Error   error;\n    PCF_Accel  accel = &face->accel;\n\n\n    error = pcf_seek_to_table_type( stream,\n                                    face->toc.tables,\n                                    face->toc.count,\n                                    type,\n                                    &format,\n                                    &size );\n    if ( error )\n      goto Bail;\n\n    if ( FT_READ_ULONG_LE( format ) )\n      goto Bail;\n\n    if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT )    &&\n         !PCF_FORMAT_MATCH( format, PCF_ACCEL_W_INKBOUNDS ) )\n      goto Bail;\n\n    if ( PCF_BYTE_ORDER( format ) == MSBFirst )\n    {\n      if ( FT_STREAM_READ_FIELDS( pcf_accel_msb_header, accel ) )\n        goto Bail;\n    }\n    else\n    {\n      if ( FT_STREAM_READ_FIELDS( pcf_accel_header, accel ) )\n        goto Bail;\n    }\n\n    error = pcf_get_metric( stream,\n                            format & ( ~PCF_FORMAT_MASK ),\n                            &(accel->minbounds) );\n    if ( error )\n      goto Bail;\n\n    error = pcf_get_metric( stream,\n                            format & ( ~PCF_FORMAT_MASK ),\n                            &(accel->maxbounds) );\n    if ( error )\n      goto Bail;\n\n    if ( PCF_FORMAT_MATCH( format, PCF_ACCEL_W_INKBOUNDS ) )\n    {\n      error = pcf_get_metric( stream,\n                              format & ( ~PCF_FORMAT_MASK ),\n                              &(accel->ink_minbounds) );\n      if ( error )\n        goto Bail;\n\n      error = pcf_get_metric( stream,\n                              format & ( ~PCF_FORMAT_MASK ),\n                              &(accel->ink_maxbounds) );\n      if ( error )\n        goto Bail;\n    }\n    else\n    {\n      accel->ink_minbounds = accel->minbounds; /* I'm not sure about this */\n      accel->ink_maxbounds = accel->maxbounds;\n    }\n\n  Bail:\n    return error;\n  }\n\n\n  static FT_Error\n  pcf_interpret_style( PCF_Face  pcf )\n  {\n    FT_Error   error  = FT_Err_Ok;\n    FT_Face    face   = FT_FACE( pcf );\n    FT_Memory  memory = face->memory;\n\n    PCF_Property  prop;\n\n    size_t  nn, len;\n    char*   strings[4] = { NULL, NULL, NULL, NULL };\n    size_t  lengths[4];\n\n\n    face->style_flags = 0;\n\n    prop = pcf_find_property( pcf, \"SLANT\" );\n    if ( prop && prop->isString                                       &&\n         ( *(prop->value.atom) == 'O' || *(prop->value.atom) == 'o' ||\n           *(prop->value.atom) == 'I' || *(prop->value.atom) == 'i' ) )\n    {\n      face->style_flags |= FT_STYLE_FLAG_ITALIC;\n      strings[2] = ( *(prop->value.atom) == 'O' ||\n                     *(prop->value.atom) == 'o' ) ? (char *)\"Oblique\"\n                                                  : (char *)\"Italic\";\n    }\n\n    prop = pcf_find_property( pcf, \"WEIGHT_NAME\" );\n    if ( prop && prop->isString                                       &&\n         ( *(prop->value.atom) == 'B' || *(prop->value.atom) == 'b' ) )\n    {\n      face->style_flags |= FT_STYLE_FLAG_BOLD;\n      strings[1] = (char*)\"Bold\";\n    }\n\n    prop = pcf_find_property( pcf, \"SETWIDTH_NAME\" );\n    if ( prop && prop->isString                                        &&\n         *(prop->value.atom)                                           &&\n         !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) )\n      strings[3] = (char*)( prop->value.atom );\n\n    prop = pcf_find_property( pcf, \"ADD_STYLE_NAME\" );\n    if ( prop && prop->isString                                        &&\n         *(prop->value.atom)                                           &&\n         !( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) )\n      strings[0] = (char*)( prop->value.atom );\n\n    for ( len = 0, nn = 0; nn < 4; nn++ )\n    {\n      lengths[nn] = 0;\n      if ( strings[nn] )\n      {\n        lengths[nn] = ft_strlen( strings[nn] );\n        len        += lengths[nn] + 1;\n      }\n    }\n\n    if ( len == 0 )\n    {\n      strings[0] = (char*)\"Regular\";\n      lengths[0] = ft_strlen( strings[0] );\n      len        = lengths[0] + 1;\n    }\n\n    {\n      char*  s;\n\n\n      if ( FT_ALLOC( face->style_name, len ) )\n        return error;\n\n      s = face->style_name;\n\n      for ( nn = 0; nn < 4; nn++ )\n      {\n        char*  src = strings[nn];\n\n\n        len = lengths[nn];\n\n        if ( src == NULL )\n          continue;\n\n        /* separate elements with a space */\n        if ( s != face->style_name )\n          *s++ = ' ';\n\n        ft_memcpy( s, src, len );\n\n        /* need to convert spaces to dashes for */\n        /* add_style_name and setwidth_name     */\n        if ( nn == 0 || nn == 3 )\n        {\n          size_t  mm;\n\n\n          for ( mm = 0; mm < len; mm++ )\n            if ( s[mm] == ' ' )\n              s[mm] = '-';\n        }\n\n        s += len;\n      }\n      *s = 0;\n    }\n\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  pcf_load_font( FT_Stream  stream,\n                 PCF_Face   face )\n  {\n    FT_Error   error;\n    FT_Memory  memory = FT_FACE( face )->memory;\n    FT_Bool    hasBDFAccelerators;\n\n\n    error = pcf_read_TOC( stream, face );\n    if ( error )\n      goto Exit;\n\n    error = pcf_get_properties( stream, face );\n    if ( error )\n      goto Exit;\n\n    /* Use the old accelerators if no BDF accelerators are in the file. */\n    hasBDFAccelerators = pcf_has_table_type( face->toc.tables,\n                                             face->toc.count,\n                                             PCF_BDF_ACCELERATORS );\n    if ( !hasBDFAccelerators )\n    {\n      error = pcf_get_accel( stream, face, PCF_ACCELERATORS );\n      if ( error )\n        goto Exit;\n    }\n\n    /* metrics */\n    error = pcf_get_metrics( stream, face );\n    if ( error )\n      goto Exit;\n\n    /* bitmaps */\n    error = pcf_get_bitmaps( stream, face );\n    if ( error )\n      goto Exit;\n\n    /* encodings */\n    error = pcf_get_encodings( stream, face );\n    if ( error )\n      goto Exit;\n\n    /* BDF style accelerators (i.e. bounds based on encoded glyphs) */\n    if ( hasBDFAccelerators )\n    {\n      error = pcf_get_accel( stream, face, PCF_BDF_ACCELERATORS );\n      if ( error )\n        goto Exit;\n    }\n\n    /* XXX: TO DO: inkmetrics and glyph_names are missing */\n\n    /* now construct the face object */\n    {\n      FT_Face       root = FT_FACE( face );\n      PCF_Property  prop;\n\n\n      root->num_faces  = 1;\n      root->face_index = 0;\n\n      root->face_flags |= FT_FACE_FLAG_FIXED_SIZES |\n                          FT_FACE_FLAG_HORIZONTAL  |\n                          FT_FACE_FLAG_FAST_GLYPHS;\n\n      if ( face->accel.constantWidth )\n        root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;\n\n      if ( ( error = pcf_interpret_style( face ) ) != 0 )\n         goto Exit;\n\n      prop = pcf_find_property( face, \"FAMILY_NAME\" );\n      if ( prop && prop->isString )\n      {\n        if ( FT_STRDUP( root->family_name, prop->value.atom ) )\n          goto Exit;\n      }\n      else\n        root->family_name = NULL;\n\n      /*\n       * Note: We shift all glyph indices by +1 since we must\n       * respect the convention that glyph 0 always corresponds\n       * to the `missing glyph'.\n       *\n       * This implies bumping the number of `available' glyphs by 1.\n       */\n      root->num_glyphs = face->nmetrics + 1;\n\n      root->num_fixed_sizes = 1;\n      if ( FT_NEW_ARRAY( root->available_sizes, 1 ) )\n        goto Exit;\n\n      {\n        FT_Bitmap_Size*  bsize = root->available_sizes;\n        FT_Short         resolution_x = 0, resolution_y = 0;\n\n\n        FT_MEM_ZERO( bsize, sizeof ( FT_Bitmap_Size ) );\n\n#if 0\n        bsize->height = face->accel.maxbounds.ascent << 6;\n#endif\n        bsize->height = (FT_Short)( face->accel.fontAscent +\n                                    face->accel.fontDescent );\n\n        prop = pcf_find_property( face, \"AVERAGE_WIDTH\" );\n        if ( prop )\n          bsize->width = (FT_Short)( ( prop->value.l + 5 ) / 10 );\n        else\n          bsize->width = (FT_Short)( bsize->height * 2/3 );\n\n        prop = pcf_find_property( face, \"POINT_SIZE\" );\n        if ( prop )\n          /* convert from 722.7 decipoints to 72 points per inch */\n          bsize->size =\n            (FT_Pos)( ( prop->value.l * 64 * 7200 + 36135L ) / 72270L );\n\n        prop = pcf_find_property( face, \"PIXEL_SIZE\" );\n        if ( prop )\n          bsize->y_ppem = (FT_Short)prop->value.l << 6;\n\n        prop = pcf_find_property( face, \"RESOLUTION_X\" );\n        if ( prop )\n          resolution_x = (FT_Short)prop->value.l;\n\n        prop = pcf_find_property( face, \"RESOLUTION_Y\" );\n        if ( prop )\n          resolution_y = (FT_Short)prop->value.l;\n\n        if ( bsize->y_ppem == 0 )\n        {\n          bsize->y_ppem = bsize->size;\n          if ( resolution_y )\n            bsize->y_ppem = bsize->y_ppem * resolution_y / 72;\n        }\n        if ( resolution_x && resolution_y )\n          bsize->x_ppem = bsize->y_ppem * resolution_x / resolution_y;\n        else\n          bsize->x_ppem = bsize->y_ppem;\n      }\n\n      /* set up charset */\n      {\n        PCF_Property  charset_registry = 0, charset_encoding = 0;\n\n\n        charset_registry = pcf_find_property( face, \"CHARSET_REGISTRY\" );\n        charset_encoding = pcf_find_property( face, \"CHARSET_ENCODING\" );\n\n        if ( charset_registry && charset_registry->isString &&\n             charset_encoding && charset_encoding->isString )\n        {\n          if ( FT_STRDUP( face->charset_encoding,\n                          charset_encoding->value.atom ) ||\n               FT_STRDUP( face->charset_registry,\n                          charset_registry->value.atom ) )\n            goto Exit;\n        }\n      }\n    }\n\n  Exit:\n    if ( error )\n    {\n      /* This is done to respect the behaviour of the original */\n      /* PCF font driver.                                      */\n      error = FT_THROW( Invalid_File_Format );\n    }\n\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pcf/pcfread.h",
    "content": "/*  pcfread.h\n\n    FreeType font driver for pcf fonts\n\n  Copyright 2003 by\n  Francesco Zappa Nardelli\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\n\n\n#ifndef __PCFREAD_H__\n#define __PCFREAD_H__\n\n\n#include <ft2build.h>\n\nFT_BEGIN_HEADER\n\n  FT_LOCAL( PCF_Property )\n  pcf_find_property( PCF_Face          face,\n                     const FT_String*  prop );\n\nFT_END_HEADER\n\n#endif /* __PCFREAD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pcf/pcfutil.c",
    "content": "/*\n\nCopyright 1990, 1994, 1998  The Open Group\n\nPermission to use, copy, modify, distribute, and sell this software and its\ndocumentation for any purpose is hereby granted without fee, provided that\nthe above copyright notice appear in all copies and that both that\ncopyright notice and this permission notice appear in supporting\ndocumentation.\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\nAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name of The Open Group shall not be\nused in advertising or otherwise to promote the sale, use or other dealings\nin this Software without prior written authorization from The Open Group.\n\n*/\n/* $XFree86: xc/lib/font/util/utilbitmap.c,v 1.3 1999/08/22 08:58:58 dawes Exp $ */\n\n/*\n * Author:  Keith Packard, MIT X Consortium\n */\n\n/* Modified for use with FreeType */\n\n\n#include <ft2build.h>\n#include \"pcfutil.h\"\n\n\n  /*\n   *  Invert bit order within each BYTE of an array.\n   */\n\n  FT_LOCAL_DEF( void )\n  BitOrderInvert( unsigned char*  buf,\n                  size_t          nbytes )\n  {\n    for ( ; nbytes > 0; nbytes--, buf++ )\n    {\n      unsigned int  val = *buf;\n\n\n      val = ( ( val >> 1 ) & 0x55 ) | ( ( val << 1 ) & 0xAA );\n      val = ( ( val >> 2 ) & 0x33 ) | ( ( val << 2 ) & 0xCC );\n      val = ( ( val >> 4 ) & 0x0F ) | ( ( val << 4 ) & 0xF0 );\n\n      *buf = (unsigned char)val;\n    }\n  }\n\n\n  /*\n   *  Invert byte order within each 16-bits of an array.\n   */\n\n  FT_LOCAL_DEF( void )\n  TwoByteSwap( unsigned char*  buf,\n               size_t          nbytes )\n  {\n    for ( ; nbytes >= 2; nbytes -= 2, buf += 2 )\n    {\n      unsigned char  c;\n\n\n      c      = buf[0];\n      buf[0] = buf[1];\n      buf[1] = c;\n    }\n  }\n\n  /*\n   *  Invert byte order within each 32-bits of an array.\n   */\n\n  FT_LOCAL_DEF( void )\n  FourByteSwap( unsigned char*  buf,\n                size_t          nbytes )\n  {\n    for ( ; nbytes >= 4; nbytes -= 4, buf += 4 )\n    {\n      unsigned char  c;\n\n\n      c      = buf[0];\n      buf[0] = buf[3];\n      buf[3] = c;\n\n      c      = buf[1];\n      buf[1] = buf[2];\n      buf[2] = c;\n    }\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pcf/pcfutil.h",
    "content": "/*  pcfutil.h\n\n    FreeType font driver for pcf fonts\n\n  Copyright 2000, 2001, 2004 by\n  Francesco Zappa Nardelli\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\n\n\n#ifndef __PCFUTIL_H__\n#define __PCFUTIL_H__\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n\n\nFT_BEGIN_HEADER\n\n  FT_LOCAL( void )\n  BitOrderInvert( unsigned char*  buf,\n                  size_t          nbytes );\n\n  FT_LOCAL( void )\n  TwoByteSwap( unsigned char*  buf,\n               size_t          nbytes );\n\n  FT_LOCAL( void )\n  FourByteSwap( unsigned char*  buf,\n                size_t          nbytes );\n\nFT_END_HEADER\n\n#endif /* __PCFUTIL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pcf/rules.mk",
    "content": "#\n# FreeType 2 pcf driver configuration rules\n#\n\n\n# Copyright (C) 2000, 2001, 2003, 2008 by\n# Francesco Zappa Nardelli\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\n\n# pcf driver directory\n#\nPCF_DIR := $(SRC_DIR)/pcf\n\n\nPCF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PCF_DIR))\n\n\n# pcf driver sources (i.e., C files)\n#\nPCF_DRV_SRC := $(PCF_DIR)/pcfdrivr.c \\\n               $(PCF_DIR)/pcfread.c  \\\n               $(PCF_DIR)/pcfutil.c\n\n# pcf driver headers\n#\nPCF_DRV_H := $(PCF_DRV_SRC:%.c=%.h) \\\n             $(PCF_DIR)/pcf.h       \\\n             $(PCF_DIR)/pcferror.h\n\n# pcf driver object(s)\n#\n#   PCF_DRV_OBJ_M is used during `multi' builds\n#   PCF_DRV_OBJ_S is used during `single' builds\n#\nPCF_DRV_OBJ_M := $(PCF_DRV_SRC:$(PCF_DIR)/%.c=$(OBJ_DIR)/%.$O)\nPCF_DRV_OBJ_S := $(OBJ_DIR)/pcf.$O\n\n# pcf driver source file for single build\n#\nPCF_DRV_SRC_S := $(PCF_DIR)/pcf.c\n\n\n# pcf driver - single object\n#\n$(PCF_DRV_OBJ_S): $(PCF_DRV_SRC_S) $(PCF_DRV_SRC) $(FREETYPE_H) $(PCF_DRV_H)\n\t$(PCF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PCF_DRV_SRC_S))\n\n\n# pcf driver - multiple objects\n#\n$(OBJ_DIR)/%.$O: $(PCF_DIR)/%.c $(FREETYPE_H) $(PCF_DRV_H)\n\t$(PCF_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\n\n\n# update main driver object lists\n#\nDRV_OBJS_S += $(PCF_DRV_OBJ_S)\nDRV_OBJS_M += $(PCF_DRV_OBJ_M)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/pfr/Jamfile",
    "content": "# FreeType 2 src/pfr Jamfile\n#\n# Copyright 2002 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) pfr ;\n\n{\n  local  _sources ;\n\n  if $(FT2_MULTI)\n  {\n    _sources = pfrdrivr pfrgload pfrload pfrobjs pfrcmap pfrsbit ;\n  }\n  else\n  {\n    _sources = pfr ;\n  }\n\n  Library  $(FT2_LIB) : $(_sources).c ;\n}\n\n# end of src/pfr Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/pfr/module.mk",
    "content": "#\n# FreeType 2 PFR module definition\n#\n\n\n# Copyright 2002, 2006 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\nFTMODULE_H_COMMANDS += PFR_DRIVER\n\ndefine PFR_DRIVER\n$(OPEN_DRIVER) FT_Driver_ClassRec, pfr_driver_class $(CLOSE_DRIVER)\n$(ECHO_DRIVER)pfr       $(ECHO_DRIVER_DESC)PFR/TrueDoc font files with extension *.pfr$(ECHO_DRIVER_DONE)\nendef\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/pfr/pfr.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pfr.c                                                                  */\n/*                                                                         */\n/*    FreeType PFR driver component.                                       */\n/*                                                                         */\n/*  Copyright 2002 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#define FT_MAKE_OPTION_SINGLE_OBJECT\n\n#include <ft2build.h>\n\n#include \"pfrload.c\"\n#include \"pfrgload.c\"\n#include \"pfrcmap.c\"\n#include \"pfrobjs.c\"\n#include \"pfrdrivr.c\"\n#include \"pfrsbit.c\"\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pfr/pfrcmap.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pfrcmap.c                                                              */\n/*                                                                         */\n/*    FreeType PFR cmap handling (body).                                   */\n/*                                                                         */\n/*  Copyright 2002, 2007, 2009, 2013 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include \"pfrcmap.h\"\n#include \"pfrobjs.h\"\n\n#include \"pfrerror.h\"\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  pfr_cmap_init( PFR_CMap    cmap,\n                 FT_Pointer  pointer )\n  {\n    FT_Error  error = FT_Err_Ok;\n    PFR_Face  face  = (PFR_Face)FT_CMAP_FACE( cmap );\n\n    FT_UNUSED( pointer );\n\n\n    cmap->num_chars = face->phy_font.num_chars;\n    cmap->chars     = face->phy_font.chars;\n\n    /* just for safety, check that the character entries are correctly */\n    /* sorted in increasing character code order                       */\n    {\n      FT_UInt  n;\n\n\n      for ( n = 1; n < cmap->num_chars; n++ )\n      {\n        if ( cmap->chars[n - 1].char_code >= cmap->chars[n].char_code )\n        {\n          error = FT_THROW( Invalid_Table );\n          goto Exit;\n        }\n      }\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  FT_CALLBACK_DEF( void )\n  pfr_cmap_done( PFR_CMap  cmap )\n  {\n    cmap->chars     = NULL;\n    cmap->num_chars = 0;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt )\n  pfr_cmap_char_index( PFR_CMap   cmap,\n                       FT_UInt32  char_code )\n  {\n    FT_UInt  min = 0;\n    FT_UInt  max = cmap->num_chars;\n\n\n    while ( min < max )\n    {\n      PFR_Char  gchar;\n      FT_UInt   mid;\n\n\n      mid   = min + ( max - min ) / 2;\n      gchar = cmap->chars + mid;\n\n      if ( gchar->char_code == char_code )\n        return mid + 1;\n\n      if ( gchar->char_code < char_code )\n        min = mid + 1;\n      else\n        max = mid;\n    }\n    return 0;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt32 )\n  pfr_cmap_char_next( PFR_CMap    cmap,\n                      FT_UInt32  *pchar_code )\n  {\n    FT_UInt    result    = 0;\n    FT_UInt32  char_code = *pchar_code + 1;\n\n\n  Restart:\n    {\n      FT_UInt   min = 0;\n      FT_UInt   max = cmap->num_chars;\n      FT_UInt   mid;\n      PFR_Char  gchar;\n\n\n      while ( min < max )\n      {\n        mid   = min + ( ( max - min ) >> 1 );\n        gchar = cmap->chars + mid;\n\n        if ( gchar->char_code == char_code )\n        {\n          result = mid;\n          if ( result != 0 )\n          {\n            result++;\n            goto Exit;\n          }\n\n          char_code++;\n          goto Restart;\n        }\n\n        if ( gchar->char_code < char_code )\n          min = mid+1;\n        else\n          max = mid;\n      }\n\n      /* we didn't find it, but we have a pair just above it */\n      char_code = 0;\n\n      if ( min < cmap->num_chars )\n      {\n        gchar  = cmap->chars + min;\n        result = min;\n        if ( result != 0 )\n        {\n          result++;\n          char_code = gchar->char_code;\n        }\n      }\n    }\n\n  Exit:\n    *pchar_code = char_code;\n    return result;\n  }\n\n\n  FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec\n  pfr_cmap_class_rec =\n  {\n    sizeof ( PFR_CMapRec ),\n\n    (FT_CMap_InitFunc)     pfr_cmap_init,\n    (FT_CMap_DoneFunc)     pfr_cmap_done,\n    (FT_CMap_CharIndexFunc)pfr_cmap_char_index,\n    (FT_CMap_CharNextFunc) pfr_cmap_char_next,\n\n    NULL, NULL, NULL, NULL, NULL\n  };\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pfr/pfrcmap.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pfrcmap.h                                                              */\n/*                                                                         */\n/*    FreeType PFR cmap handling (specification).                          */\n/*                                                                         */\n/*  Copyright 2002 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PFRCMAP_H__\n#define __PFRCMAP_H__\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n#include \"pfrtypes.h\"\n\n\nFT_BEGIN_HEADER\n\n  typedef struct  PFR_CMapRec_\n  {\n    FT_CMapRec  cmap;\n    FT_UInt     num_chars;\n    PFR_Char    chars;\n\n  } PFR_CMapRec, *PFR_CMap;\n\n\n  FT_CALLBACK_TABLE const FT_CMap_ClassRec  pfr_cmap_class_rec;\n\nFT_END_HEADER\n\n\n#endif /* __PFRCMAP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pfr/pfrdrivr.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pfrdrivr.c                                                             */\n/*                                                                         */\n/*    FreeType PFR driver interface (body).                                */\n/*                                                                         */\n/*  Copyright 2002-2004, 2006, 2008, 2010, 2011, 2013, 2014 by             */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_SERVICE_PFR_H\n#include FT_SERVICE_XFREE86_NAME_H\n#include \"pfrdrivr.h\"\n#include \"pfrobjs.h\"\n\n#include \"pfrerror.h\"\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  pfr_get_kerning( FT_Face     pfrface,     /* PFR_Face */\n                   FT_UInt     left,\n                   FT_UInt     right,\n                   FT_Vector  *avector )\n  {\n    PFR_Face     face = (PFR_Face)pfrface;\n    PFR_PhyFont  phys = &face->phy_font;\n\n\n    (void)pfr_face_get_kerning( pfrface, left, right, avector );\n\n    /* convert from metrics to outline units when necessary */\n    if ( phys->outline_resolution != phys->metrics_resolution )\n    {\n      if ( avector->x != 0 )\n        avector->x = FT_MulDiv( avector->x, phys->outline_resolution,\n                                            phys->metrics_resolution );\n\n      if ( avector->y != 0 )\n        avector->y = FT_MulDiv( avector->x, phys->outline_resolution,\n                                            phys->metrics_resolution );\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n /*\n  *  PFR METRICS SERVICE\n  *\n  */\n\n  FT_CALLBACK_DEF( FT_Error )\n  pfr_get_advance( FT_Face   pfrface,       /* PFR_Face */\n                   FT_UInt   gindex,\n                   FT_Pos   *anadvance )\n  {\n    PFR_Face  face  = (PFR_Face)pfrface;\n    FT_Error  error = FT_ERR( Invalid_Argument );\n\n\n    *anadvance = 0;\n\n    if ( !gindex )\n      goto Exit;\n\n    gindex--;\n\n    if ( face )\n    {\n      PFR_PhyFont  phys = &face->phy_font;\n\n\n      if ( gindex < phys->num_chars )\n      {\n        *anadvance = phys->chars[gindex].advance;\n        error      = FT_Err_Ok;\n      }\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  pfr_get_metrics( FT_Face    pfrface,      /* PFR_Face */\n                   FT_UInt   *anoutline_resolution,\n                   FT_UInt   *ametrics_resolution,\n                   FT_Fixed  *ametrics_x_scale,\n                   FT_Fixed  *ametrics_y_scale )\n  {\n    PFR_Face     face = (PFR_Face)pfrface;\n    PFR_PhyFont  phys = &face->phy_font;\n    FT_Fixed     x_scale, y_scale;\n    FT_Size      size = face->root.size;\n\n\n    if ( anoutline_resolution )\n      *anoutline_resolution = phys->outline_resolution;\n\n    if ( ametrics_resolution )\n      *ametrics_resolution = phys->metrics_resolution;\n\n    x_scale = 0x10000L;\n    y_scale = 0x10000L;\n\n    if ( size )\n    {\n      x_scale = FT_DivFix( size->metrics.x_ppem << 6,\n                           phys->metrics_resolution );\n\n      y_scale = FT_DivFix( size->metrics.y_ppem << 6,\n                           phys->metrics_resolution );\n    }\n\n    if ( ametrics_x_scale )\n      *ametrics_x_scale = x_scale;\n\n    if ( ametrics_y_scale )\n      *ametrics_y_scale = y_scale;\n\n    return FT_Err_Ok;\n  }\n\n\n  static\n  const FT_Service_PfrMetricsRec  pfr_metrics_service_rec =\n  {\n    pfr_get_metrics,\n    pfr_face_get_kerning,\n    pfr_get_advance\n  };\n\n\n /*\n  *  SERVICE LIST\n  *\n  */\n\n  static const FT_ServiceDescRec  pfr_services[] =\n  {\n    { FT_SERVICE_ID_PFR_METRICS, &pfr_metrics_service_rec },\n    { FT_SERVICE_ID_XF86_NAME,   FT_XF86_FORMAT_PFR },\n    { NULL, NULL }\n  };\n\n\n  FT_CALLBACK_DEF( FT_Module_Interface )\n  pfr_get_service( FT_Module         module,\n                   const FT_String*  service_id )\n  {\n    FT_UNUSED( module );\n\n    return ft_service_list_lookup( pfr_services, service_id );\n  }\n\n\n  FT_CALLBACK_TABLE_DEF\n  const FT_Driver_ClassRec  pfr_driver_class =\n  {\n    {\n      FT_MODULE_FONT_DRIVER     |\n      FT_MODULE_DRIVER_SCALABLE,\n\n      sizeof ( FT_DriverRec ),\n\n      \"pfr\",\n      0x10000L,\n      0x20000L,\n\n      NULL,\n\n      0,                /* FT_Module_Constructor */\n      0,                /* FT_Module_Destructor  */\n      pfr_get_service\n    },\n\n    sizeof ( PFR_FaceRec ),\n    sizeof ( PFR_SizeRec ),\n    sizeof ( PFR_SlotRec ),\n\n    pfr_face_init,\n    pfr_face_done,\n    0,                  /* FT_Size_InitFunc */\n    0,                  /* FT_Size_DoneFunc */\n    pfr_slot_init,\n    pfr_slot_done,\n\n    pfr_slot_load,\n\n    pfr_get_kerning,\n    0,                  /* FT_Face_AttachFunc      */\n    0,                  /* FT_Face_GetAdvancesFunc */\n    0,                  /* FT_Size_RequestFunc     */\n    0,                  /* FT_Size_SelectFunc      */\n  };\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pfr/pfrdrivr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pfrdrivr.h                                                             */\n/*                                                                         */\n/*    High-level Type PFR driver interface (specification).                */\n/*                                                                         */\n/*  Copyright 2002 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PFRDRIVR_H__\n#define __PFRDRIVR_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DRIVER_H\n\n\nFT_BEGIN_HEADER\n\n#ifdef FT_CONFIG_OPTION_PIC\n#error \"this module does not support PIC yet\"\n#endif\n\n\n  FT_EXPORT_VAR( const FT_Driver_ClassRec )  pfr_driver_class;\n\n\nFT_END_HEADER\n\n\n#endif /* __PFRDRIVR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pfr/pfrerror.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pfrerror.h                                                             */\n/*                                                                         */\n/*    PFR error codes (specification only).                                */\n/*                                                                         */\n/*  Copyright 2002, 2012 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the PFR error enumeration constants.      */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __PFRERROR_H__\n#define __PFRERROR_H__\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  PFR_Err_\n#define FT_ERR_BASE    FT_Mod_Err_PFR\n\n#include FT_ERRORS_H\n\n#endif /* __PFRERROR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pfr/pfrgload.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pfrgload.c                                                             */\n/*                                                                         */\n/*    FreeType PFR glyph loader (body).                                    */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2005, 2007, 2010, 2013 by                        */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"pfrgload.h\"\n#include \"pfrsbit.h\"\n#include \"pfrload.h\"            /* for macro definitions */\n#include FT_INTERNAL_DEBUG_H\n\n#include \"pfrerror.h\"\n\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_pfr\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      PFR GLYPH BUILDER                        *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  FT_LOCAL_DEF( void )\n  pfr_glyph_init( PFR_Glyph       glyph,\n                  FT_GlyphLoader  loader )\n  {\n    FT_ZERO( glyph );\n\n    glyph->loader     = loader;\n    glyph->path_begun = 0;\n\n    FT_GlyphLoader_Rewind( loader );\n  }\n\n\n  FT_LOCAL_DEF( void )\n  pfr_glyph_done( PFR_Glyph  glyph )\n  {\n    FT_Memory  memory = glyph->loader->memory;\n\n\n    FT_FREE( glyph->x_control );\n    glyph->y_control = NULL;\n\n    glyph->max_xy_control = 0;\n#if 0\n    glyph->num_x_control  = 0;\n    glyph->num_y_control  = 0;\n#endif\n\n    FT_FREE( glyph->subs );\n\n    glyph->max_subs = 0;\n    glyph->num_subs = 0;\n\n    glyph->loader     = NULL;\n    glyph->path_begun = 0;\n  }\n\n\n  /* close current contour, if any */\n  static void\n  pfr_glyph_close_contour( PFR_Glyph  glyph )\n  {\n    FT_GlyphLoader  loader  = glyph->loader;\n    FT_Outline*     outline = &loader->current.outline;\n    FT_Int          last, first;\n\n\n    if ( !glyph->path_begun )\n      return;\n\n    /* compute first and last point indices in current glyph outline */\n    last  = outline->n_points - 1;\n    first = 0;\n    if ( outline->n_contours > 0 )\n      first = outline->contours[outline->n_contours - 1];\n\n    /* if the last point falls on the same location than the first one */\n    /* we need to delete it                                            */\n    if ( last > first )\n    {\n      FT_Vector*  p1 = outline->points + first;\n      FT_Vector*  p2 = outline->points + last;\n\n\n      if ( p1->x == p2->x && p1->y == p2->y )\n      {\n        outline->n_points--;\n        last--;\n      }\n    }\n\n    /* don't add empty contours */\n    if ( last >= first )\n      outline->contours[outline->n_contours++] = (short)last;\n\n    glyph->path_begun = 0;\n  }\n\n\n  /* reset glyph to start the loading of a new glyph */\n  static void\n  pfr_glyph_start( PFR_Glyph  glyph )\n  {\n    glyph->path_begun = 0;\n  }\n\n\n  static FT_Error\n  pfr_glyph_line_to( PFR_Glyph   glyph,\n                     FT_Vector*  to )\n  {\n    FT_GlyphLoader  loader  = glyph->loader;\n    FT_Outline*     outline = &loader->current.outline;\n    FT_Error        error;\n\n\n    /* check that we have begun a new path */\n    if ( !glyph->path_begun )\n    {\n      error = FT_THROW( Invalid_Table );\n      FT_ERROR(( \"pfr_glyph_line_to: invalid glyph data\\n\" ));\n      goto Exit;\n    }\n\n    error = FT_GLYPHLOADER_CHECK_POINTS( loader, 1, 0 );\n    if ( !error )\n    {\n      FT_UInt  n = outline->n_points;\n\n\n      outline->points[n] = *to;\n      outline->tags  [n] = FT_CURVE_TAG_ON;\n\n      outline->n_points++;\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  static FT_Error\n  pfr_glyph_curve_to( PFR_Glyph   glyph,\n                      FT_Vector*  control1,\n                      FT_Vector*  control2,\n                      FT_Vector*  to )\n  {\n    FT_GlyphLoader  loader  = glyph->loader;\n    FT_Outline*     outline = &loader->current.outline;\n    FT_Error        error;\n\n\n    /* check that we have begun a new path */\n    if ( !glyph->path_begun )\n    {\n      error = FT_THROW( Invalid_Table );\n      FT_ERROR(( \"pfr_glyph_line_to: invalid glyph data\\n\" ));\n      goto Exit;\n    }\n\n    error = FT_GLYPHLOADER_CHECK_POINTS( loader, 3, 0 );\n    if ( !error )\n    {\n      FT_Vector*  vec = outline->points         + outline->n_points;\n      FT_Byte*    tag = (FT_Byte*)outline->tags + outline->n_points;\n\n\n      vec[0] = *control1;\n      vec[1] = *control2;\n      vec[2] = *to;\n      tag[0] = FT_CURVE_TAG_CUBIC;\n      tag[1] = FT_CURVE_TAG_CUBIC;\n      tag[2] = FT_CURVE_TAG_ON;\n\n      outline->n_points = (FT_Short)( outline->n_points + 3 );\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  static FT_Error\n  pfr_glyph_move_to( PFR_Glyph   glyph,\n                     FT_Vector*  to )\n  {\n    FT_GlyphLoader  loader  = glyph->loader;\n    FT_Error        error;\n\n\n    /* close current contour if any */\n    pfr_glyph_close_contour( glyph );\n\n    /* indicate that a new contour has started */\n    glyph->path_begun = 1;\n\n    /* check that there is space for a new contour and a new point */\n    error = FT_GLYPHLOADER_CHECK_POINTS( loader, 1, 1 );\n    if ( !error )\n      /* add new start point */\n      error = pfr_glyph_line_to( glyph, to );\n\n    return error;\n  }\n\n\n  static void\n  pfr_glyph_end( PFR_Glyph  glyph )\n  {\n    /* close current contour if any */\n    pfr_glyph_close_contour( glyph );\n\n    /* merge the current glyph into the stack */\n    FT_GlyphLoader_Add( glyph->loader );\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      PFR GLYPH LOADER                         *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* load a simple glyph */\n  static FT_Error\n  pfr_glyph_load_simple( PFR_Glyph  glyph,\n                         FT_Byte*   p,\n                         FT_Byte*   limit )\n  {\n    FT_Error   error  = FT_Err_Ok;\n    FT_Memory  memory = glyph->loader->memory;\n    FT_UInt    flags, x_count, y_count, i, count, mask;\n    FT_Int     x;\n\n\n    PFR_CHECK( 1 );\n    flags = PFR_NEXT_BYTE( p );\n\n    /* test for composite glyphs */\n    if ( flags & PFR_GLYPH_IS_COMPOUND )\n      goto Failure;\n\n    x_count = 0;\n    y_count = 0;\n\n    if ( flags & PFR_GLYPH_1BYTE_XYCOUNT )\n    {\n      PFR_CHECK( 1 );\n      count   = PFR_NEXT_BYTE( p );\n      x_count = count & 15;\n      y_count = count >> 4;\n    }\n    else\n    {\n      if ( flags & PFR_GLYPH_XCOUNT )\n      {\n        PFR_CHECK( 1 );\n        x_count = PFR_NEXT_BYTE( p );\n      }\n\n      if ( flags & PFR_GLYPH_YCOUNT )\n      {\n        PFR_CHECK( 1 );\n        y_count = PFR_NEXT_BYTE( p );\n      }\n    }\n\n    count = x_count + y_count;\n\n    /* re-allocate array when necessary */\n    if ( count > glyph->max_xy_control )\n    {\n      FT_UInt  new_max = FT_PAD_CEIL( count, 8 );\n\n\n      if ( FT_RENEW_ARRAY( glyph->x_control,\n                           glyph->max_xy_control,\n                           new_max ) )\n        goto Exit;\n\n      glyph->max_xy_control = new_max;\n    }\n\n    glyph->y_control = glyph->x_control + x_count;\n\n    mask  = 0;\n    x     = 0;\n\n    for ( i = 0; i < count; i++ )\n    {\n      if ( ( i & 7 ) == 0 )\n      {\n        PFR_CHECK( 1 );\n        mask = PFR_NEXT_BYTE( p );\n      }\n\n      if ( mask & 1 )\n      {\n        PFR_CHECK( 2 );\n        x = PFR_NEXT_SHORT( p );\n      }\n      else\n      {\n        PFR_CHECK( 1 );\n        x += PFR_NEXT_BYTE( p );\n      }\n\n      glyph->x_control[i] = x;\n\n      mask >>= 1;\n    }\n\n    /* XXX: for now we ignore the secondary stroke and edge definitions */\n    /*      since we don't want to support native PFR hinting           */\n    /*                                                                  */\n    if ( flags & PFR_GLYPH_EXTRA_ITEMS )\n    {\n      error = pfr_extra_items_skip( &p, limit );\n      if ( error )\n        goto Exit;\n    }\n\n    pfr_glyph_start( glyph );\n\n    /* now load a simple glyph */\n    {\n      FT_Vector   pos[4];\n      FT_Vector*  cur;\n\n\n      pos[0].x = pos[0].y = 0;\n      pos[3]   = pos[0];\n\n      for (;;)\n      {\n        FT_UInt  format, format_low, args_format = 0, args_count, n;\n\n\n        /***************************************************************/\n        /*  read instruction                                           */\n        /*                                                             */\n        PFR_CHECK( 1 );\n        format     = PFR_NEXT_BYTE( p );\n        format_low = format & 15;\n\n        switch ( format >> 4 )\n        {\n        case 0:                             /* end glyph */\n          FT_TRACE6(( \"- end glyph\" ));\n          args_count = 0;\n          break;\n\n        case 1:                             /* general line operation */\n          FT_TRACE6(( \"- general line\" ));\n          goto Line1;\n\n        case 4:                             /* move to inside contour  */\n          FT_TRACE6(( \"- move to inside\" ));\n          goto Line1;\n\n        case 5:                             /* move to outside contour */\n          FT_TRACE6(( \"- move to outside\" ));\n        Line1:\n          args_format = format_low;\n          args_count  = 1;\n          break;\n\n        case 2:                             /* horizontal line to */\n          FT_TRACE6(( \"- horizontal line to cx.%d\", format_low ));\n          if ( format_low >= x_count )\n            goto Failure;\n          pos[0].x   = glyph->x_control[format_low];\n          pos[0].y   = pos[3].y;\n          pos[3]     = pos[0];\n          args_count = 0;\n          break;\n\n        case 3:                             /* vertical line to */\n          FT_TRACE6(( \"- vertical line to cy.%d\", format_low ));\n          if ( format_low >= y_count )\n            goto Failure;\n          pos[0].x   = pos[3].x;\n          pos[0].y   = glyph->y_control[format_low];\n          pos[3]     = pos[0];\n          args_count = 0;\n          break;\n\n        case 6:                             /* horizontal to vertical curve */\n          FT_TRACE6(( \"- hv curve \" ));\n          args_format = 0xB8E;\n          args_count  = 3;\n          break;\n\n        case 7:                             /* vertical to horizontal curve */\n          FT_TRACE6(( \"- vh curve\" ));\n          args_format = 0xE2B;\n          args_count  = 3;\n          break;\n\n        default:                            /* general curve to */\n          FT_TRACE6(( \"- general curve\" ));\n          args_count  = 4;\n          args_format = format_low;\n        }\n\n        /***********************************************************/\n        /*  now read arguments                                     */\n        /*                                                         */\n        cur = pos;\n        for ( n = 0; n < args_count; n++ )\n        {\n          FT_UInt  idx;\n          FT_Int   delta;\n\n\n          /* read the X argument */\n          switch ( args_format & 3 )\n          {\n          case 0:                           /* 8-bit index */\n            PFR_CHECK( 1 );\n            idx  = PFR_NEXT_BYTE( p );\n            if ( idx >= x_count )\n              goto Failure;\n            cur->x = glyph->x_control[idx];\n            FT_TRACE7(( \" cx#%d\", idx ));\n            break;\n\n          case 1:                           /* 16-bit value */\n            PFR_CHECK( 2 );\n            cur->x = PFR_NEXT_SHORT( p );\n            FT_TRACE7(( \" x.%d\", cur->x ));\n            break;\n\n          case 2:                           /* 8-bit delta */\n            PFR_CHECK( 1 );\n            delta  = PFR_NEXT_INT8( p );\n            cur->x = pos[3].x + delta;\n            FT_TRACE7(( \" dx.%d\", delta ));\n            break;\n\n          default:\n            FT_TRACE7(( \" |\" ));\n            cur->x = pos[3].x;\n          }\n\n          /* read the Y argument */\n          switch ( ( args_format >> 2 ) & 3 )\n          {\n          case 0:                           /* 8-bit index */\n            PFR_CHECK( 1 );\n            idx  = PFR_NEXT_BYTE( p );\n            if ( idx >= y_count )\n              goto Failure;\n            cur->y = glyph->y_control[idx];\n            FT_TRACE7(( \" cy#%d\", idx ));\n            break;\n\n          case 1:                           /* 16-bit absolute value */\n            PFR_CHECK( 2 );\n            cur->y = PFR_NEXT_SHORT( p );\n            FT_TRACE7(( \" y.%d\", cur->y ));\n            break;\n\n          case 2:                           /* 8-bit delta */\n            PFR_CHECK( 1 );\n            delta  = PFR_NEXT_INT8( p );\n            cur->y = pos[3].y + delta;\n            FT_TRACE7(( \" dy.%d\", delta ));\n            break;\n\n          default:\n            FT_TRACE7(( \" -\" ));\n            cur->y = pos[3].y;\n          }\n\n          /* read the additional format flag for the general curve */\n          if ( n == 0 && args_count == 4 )\n          {\n            PFR_CHECK( 1 );\n            args_format = PFR_NEXT_BYTE( p );\n            args_count--;\n          }\n          else\n            args_format >>= 4;\n\n          /* save the previous point */\n          pos[3] = cur[0];\n          cur++;\n        }\n\n        FT_TRACE7(( \"\\n\" ));\n\n        /***********************************************************/\n        /*  finally, execute instruction                           */\n        /*                                                         */\n        switch ( format >> 4 )\n        {\n        case 0:                             /* end glyph => EXIT */\n          pfr_glyph_end( glyph );\n          goto Exit;\n\n        case 1:                             /* line operations */\n        case 2:\n        case 3:\n          error = pfr_glyph_line_to( glyph, pos );\n          goto Test_Error;\n\n        case 4:                             /* move to inside contour  */\n        case 5:                             /* move to outside contour */\n          error = pfr_glyph_move_to( glyph, pos );\n          goto Test_Error;\n\n        default:                            /* curve operations */\n          error = pfr_glyph_curve_to( glyph, pos, pos + 1, pos + 2 );\n\n        Test_Error:  /* test error condition */\n          if ( error )\n            goto Exit;\n        }\n      } /* for (;;) */\n    }\n\n  Exit:\n    return error;\n\n  Failure:\n  Too_Short:\n    error = FT_THROW( Invalid_Table );\n    FT_ERROR(( \"pfr_glyph_load_simple: invalid glyph data\\n\" ));\n    goto Exit;\n  }\n\n\n  /* load a composite/compound glyph */\n  static FT_Error\n  pfr_glyph_load_compound( PFR_Glyph  glyph,\n                           FT_Byte*   p,\n                           FT_Byte*   limit )\n  {\n    FT_Error        error  = FT_Err_Ok;\n    FT_GlyphLoader  loader = glyph->loader;\n    FT_Memory       memory = loader->memory;\n    PFR_SubGlyph    subglyph;\n    FT_UInt         flags, i, count, org_count;\n    FT_Int          x_pos, y_pos;\n\n\n    PFR_CHECK( 1 );\n    flags = PFR_NEXT_BYTE( p );\n\n    /* test for composite glyphs */\n    if ( !( flags & PFR_GLYPH_IS_COMPOUND ) )\n      goto Failure;\n\n    count = flags & 0x3F;\n\n    /* ignore extra items when present */\n    /*                                 */\n    if ( flags & PFR_GLYPH_EXTRA_ITEMS )\n    {\n      error = pfr_extra_items_skip( &p, limit );\n      if (error) goto Exit;\n    }\n\n    /* we can't rely on the FT_GlyphLoader to load sub-glyphs, because   */\n    /* the PFR format is dumb, using direct file offsets to point to the */\n    /* sub-glyphs (instead of glyph indices).  Sigh.                     */\n    /*                                                                   */\n    /* For now, we load the list of sub-glyphs into a different array    */\n    /* but this will prevent us from using the auto-hinter at its best   */\n    /* quality.                                                          */\n    /*                                                                   */\n    org_count = glyph->num_subs;\n\n    if ( org_count + count > glyph->max_subs )\n    {\n      FT_UInt  new_max = ( org_count + count + 3 ) & (FT_UInt)-4;\n\n\n      /* we arbitrarily limit the number of subglyphs */\n      /* to avoid endless recursion                   */\n      if ( new_max > 64 )\n      {\n        error = FT_THROW( Invalid_Table );\n        FT_ERROR(( \"pfr_glyph_load_compound:\"\n                   \" too many compound glyphs components\\n\" ));\n        goto Exit;\n      }\n\n      if ( FT_RENEW_ARRAY( glyph->subs, glyph->max_subs, new_max ) )\n        goto Exit;\n\n      glyph->max_subs = new_max;\n    }\n\n    subglyph = glyph->subs + org_count;\n\n    for ( i = 0; i < count; i++, subglyph++ )\n    {\n      FT_UInt  format;\n\n\n      x_pos = 0;\n      y_pos = 0;\n\n      PFR_CHECK( 1 );\n      format = PFR_NEXT_BYTE( p );\n\n      /* read scale when available */\n      subglyph->x_scale = 0x10000L;\n      if ( format & PFR_SUBGLYPH_XSCALE )\n      {\n        PFR_CHECK( 2 );\n        subglyph->x_scale = PFR_NEXT_SHORT( p ) << 4;\n      }\n\n      subglyph->y_scale = 0x10000L;\n      if ( format & PFR_SUBGLYPH_YSCALE )\n      {\n        PFR_CHECK( 2 );\n        subglyph->y_scale = PFR_NEXT_SHORT( p ) << 4;\n      }\n\n      /* read offset */\n      switch ( format & 3 )\n      {\n      case 1:\n        PFR_CHECK( 2 );\n        x_pos = PFR_NEXT_SHORT( p );\n        break;\n\n      case 2:\n        PFR_CHECK( 1 );\n        x_pos += PFR_NEXT_INT8( p );\n        break;\n\n      default:\n        ;\n      }\n\n      switch ( ( format >> 2 ) & 3 )\n      {\n      case 1:\n        PFR_CHECK( 2 );\n        y_pos = PFR_NEXT_SHORT( p );\n        break;\n\n      case 2:\n        PFR_CHECK( 1 );\n        y_pos += PFR_NEXT_INT8( p );\n        break;\n\n      default:\n        ;\n      }\n\n      subglyph->x_delta = x_pos;\n      subglyph->y_delta = y_pos;\n\n      /* read glyph position and size now */\n      if ( format & PFR_SUBGLYPH_2BYTE_SIZE )\n      {\n        PFR_CHECK( 2 );\n        subglyph->gps_size = PFR_NEXT_USHORT( p );\n      }\n      else\n      {\n        PFR_CHECK( 1 );\n        subglyph->gps_size = PFR_NEXT_BYTE( p );\n      }\n\n      if ( format & PFR_SUBGLYPH_3BYTE_OFFSET )\n      {\n        PFR_CHECK( 3 );\n        subglyph->gps_offset = PFR_NEXT_LONG( p );\n      }\n      else\n      {\n        PFR_CHECK( 2 );\n        subglyph->gps_offset = PFR_NEXT_USHORT( p );\n      }\n\n      glyph->num_subs++;\n    }\n\n  Exit:\n    return error;\n\n  Failure:\n  Too_Short:\n    error = FT_THROW( Invalid_Table );\n    FT_ERROR(( \"pfr_glyph_load_compound: invalid glyph data\\n\" ));\n    goto Exit;\n  }\n\n\n  static FT_Error\n  pfr_glyph_load_rec( PFR_Glyph  glyph,\n                      FT_Stream  stream,\n                      FT_ULong   gps_offset,\n                      FT_ULong   offset,\n                      FT_ULong   size )\n  {\n    FT_Error  error;\n    FT_Byte*  p;\n    FT_Byte*  limit;\n\n\n    if ( FT_STREAM_SEEK( gps_offset + offset ) ||\n         FT_FRAME_ENTER( size )                )\n      goto Exit;\n\n    p     = (FT_Byte*)stream->cursor;\n    limit = p + size;\n\n    if ( size > 0 && *p & PFR_GLYPH_IS_COMPOUND )\n    {\n      FT_Int          n, old_count, count;\n      FT_GlyphLoader  loader = glyph->loader;\n      FT_Outline*     base   = &loader->base.outline;\n\n\n      old_count = glyph->num_subs;\n\n      /* this is a compound glyph - load it */\n      error = pfr_glyph_load_compound( glyph, p, limit );\n\n      FT_FRAME_EXIT();\n\n      if ( error )\n        goto Exit;\n\n      count = glyph->num_subs - old_count;\n\n      FT_TRACE4(( \"compound glyph with %d elements (offset %lu):\\n\",\n                  count, offset ));\n\n      /* now, load each individual glyph */\n      for ( n = 0; n < count; n++ )\n      {\n        FT_Int        i, old_points, num_points;\n        PFR_SubGlyph  subglyph;\n\n\n        FT_TRACE4(( \"  subglyph %d:\\n\", n ));\n\n        subglyph   = glyph->subs + old_count + n;\n        old_points = base->n_points;\n\n        error = pfr_glyph_load_rec( glyph, stream, gps_offset,\n                                    subglyph->gps_offset,\n                                    subglyph->gps_size );\n        if ( error )\n          break;\n\n        /* note that `glyph->subs' might have been re-allocated */\n        subglyph   = glyph->subs + old_count + n;\n        num_points = base->n_points - old_points;\n\n        /* translate and eventually scale the new glyph points */\n        if ( subglyph->x_scale != 0x10000L || subglyph->y_scale != 0x10000L )\n        {\n          FT_Vector*  vec = base->points + old_points;\n\n\n          for ( i = 0; i < num_points; i++, vec++ )\n          {\n            vec->x = FT_MulFix( vec->x, subglyph->x_scale ) +\n                       subglyph->x_delta;\n            vec->y = FT_MulFix( vec->y, subglyph->y_scale ) +\n                       subglyph->y_delta;\n          }\n        }\n        else\n        {\n          FT_Vector*  vec = loader->base.outline.points + old_points;\n\n\n          for ( i = 0; i < num_points; i++, vec++ )\n          {\n            vec->x += subglyph->x_delta;\n            vec->y += subglyph->y_delta;\n          }\n        }\n\n        /* proceed to next sub-glyph */\n      }\n\n      FT_TRACE4(( \"end compound glyph with %d elements\\n\", count ));\n    }\n    else\n    {\n      FT_TRACE4(( \"simple glyph (offset %lu)\\n\", offset ));\n\n      /* load a simple glyph */\n      error = pfr_glyph_load_simple( glyph, p, limit );\n\n      FT_FRAME_EXIT();\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  pfr_glyph_load( PFR_Glyph  glyph,\n                  FT_Stream  stream,\n                  FT_ULong   gps_offset,\n                  FT_ULong   offset,\n                  FT_ULong   size )\n  {\n    /* initialize glyph loader */\n    FT_GlyphLoader_Rewind( glyph->loader );\n\n    glyph->num_subs = 0;\n\n    /* load the glyph, recursively when needed */\n    return pfr_glyph_load_rec( glyph, stream, gps_offset, offset, size );\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pfr/pfrgload.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pfrgload.h                                                             */\n/*                                                                         */\n/*    FreeType PFR glyph loader (specification).                           */\n/*                                                                         */\n/*  Copyright 2002 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PFRGLOAD_H__\n#define __PFRGLOAD_H__\n\n#include \"pfrtypes.h\"\n\nFT_BEGIN_HEADER\n\n\n  FT_LOCAL( void )\n  pfr_glyph_init( PFR_Glyph       glyph,\n                  FT_GlyphLoader  loader );\n\n  FT_LOCAL( void )\n  pfr_glyph_done( PFR_Glyph  glyph );\n\n\n  FT_LOCAL( FT_Error )\n  pfr_glyph_load( PFR_Glyph  glyph,\n                  FT_Stream  stream,\n                  FT_ULong   gps_offset,\n                  FT_ULong   offset,\n                  FT_ULong   size );\n\n\nFT_END_HEADER\n\n\n#endif /* __PFRGLOAD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pfr/pfrload.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pfrload.c                                                              */\n/*                                                                         */\n/*    FreeType PFR loader (body).                                          */\n/*                                                                         */\n/*  Copyright 2002-2005, 2007, 2009, 2010, 2013, 2014 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"pfrload.h\"\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n\n#include \"pfrerror.h\"\n\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_pfr\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                          EXTRA ITEMS                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  FT_LOCAL_DEF( FT_Error )\n  pfr_extra_items_skip( FT_Byte*  *pp,\n                        FT_Byte*   limit )\n  {\n    return pfr_extra_items_parse( pp, limit, NULL, NULL );\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  pfr_extra_items_parse( FT_Byte*       *pp,\n                         FT_Byte*        limit,\n                         PFR_ExtraItem   item_list,\n                         FT_Pointer      item_data )\n  {\n    FT_Error  error = FT_Err_Ok;\n    FT_Byte*  p     = *pp;\n    FT_UInt   num_items, item_type, item_size;\n\n\n    PFR_CHECK( 1 );\n    num_items = PFR_NEXT_BYTE( p );\n\n    for ( ; num_items > 0; num_items-- )\n    {\n      PFR_CHECK( 2 );\n      item_size = PFR_NEXT_BYTE( p );\n      item_type = PFR_NEXT_BYTE( p );\n\n      PFR_CHECK( item_size );\n\n      if ( item_list )\n      {\n        PFR_ExtraItem  extra = item_list;\n\n\n        for ( extra = item_list; extra->parser != NULL; extra++ )\n        {\n          if ( extra->type == item_type )\n          {\n            error = extra->parser( p, p + item_size, item_data );\n            if ( error ) goto Exit;\n\n            break;\n          }\n        }\n      }\n\n      p += item_size;\n    }\n\n  Exit:\n    *pp = p;\n    return error;\n\n  Too_Short:\n    FT_ERROR(( \"pfr_extra_items_parse: invalid extra items table\\n\" ));\n    error = FT_THROW( Invalid_Table );\n    goto Exit;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                          PFR HEADER                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n   static const FT_Frame_Field  pfr_header_fields[] =\n   {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  PFR_HeaderRec\n\n     FT_FRAME_START( 58 ),\n       FT_FRAME_ULONG ( signature ),\n       FT_FRAME_USHORT( version ),\n       FT_FRAME_USHORT( signature2 ),\n       FT_FRAME_USHORT( header_size ),\n\n       FT_FRAME_USHORT( log_dir_size ),\n       FT_FRAME_USHORT( log_dir_offset ),\n\n       FT_FRAME_USHORT( log_font_max_size ),\n       FT_FRAME_UOFF3 ( log_font_section_size ),\n       FT_FRAME_UOFF3 ( log_font_section_offset ),\n\n       FT_FRAME_USHORT( phy_font_max_size ),\n       FT_FRAME_UOFF3 ( phy_font_section_size ),\n       FT_FRAME_UOFF3 ( phy_font_section_offset ),\n\n       FT_FRAME_USHORT( gps_max_size ),\n       FT_FRAME_UOFF3 ( gps_section_size ),\n       FT_FRAME_UOFF3 ( gps_section_offset ),\n\n       FT_FRAME_BYTE  ( max_blue_values ),\n       FT_FRAME_BYTE  ( max_x_orus ),\n       FT_FRAME_BYTE  ( max_y_orus ),\n\n       FT_FRAME_BYTE  ( phy_font_max_size_high ),\n       FT_FRAME_BYTE  ( color_flags ),\n\n       FT_FRAME_UOFF3 ( bct_max_size ),\n       FT_FRAME_UOFF3 ( bct_set_max_size ),\n       FT_FRAME_UOFF3 ( phy_bct_set_max_size ),\n\n       FT_FRAME_USHORT( num_phy_fonts ),\n       FT_FRAME_BYTE  ( max_vert_stem_snap ),\n       FT_FRAME_BYTE  ( max_horz_stem_snap ),\n       FT_FRAME_USHORT( max_chars ),\n     FT_FRAME_END\n   };\n\n\n  FT_LOCAL_DEF( FT_Error )\n  pfr_header_load( PFR_Header  header,\n                   FT_Stream   stream )\n  {\n    FT_Error  error;\n\n\n    /* read header directly */\n    if ( !FT_STREAM_SEEK( 0 )                                &&\n         !FT_STREAM_READ_FIELDS( pfr_header_fields, header ) )\n    {\n      /* make a few adjustments to the header */\n      header->phy_font_max_size +=\n        (FT_UInt32)header->phy_font_max_size_high << 16;\n    }\n\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Bool )\n  pfr_header_check( PFR_Header  header )\n  {\n    FT_Bool  result = 1;\n\n\n    /* check signature and header size */\n    if ( header->signature  != 0x50465230L ||   /* \"PFR0\" */\n         header->version     > 4           ||\n         header->header_size < 58          ||\n         header->signature2 != 0x0D0A      )    /* CR/LF  */\n    {\n      result = 0;\n    }\n    return  result;\n  }\n\n\n  /***********************************************************************/\n  /***********************************************************************/\n  /*****                                                             *****/\n  /*****                    PFR LOGICAL FONTS                        *****/\n  /*****                                                             *****/\n  /***********************************************************************/\n  /***********************************************************************/\n\n\n  FT_LOCAL_DEF( FT_Error )\n  pfr_log_font_count( FT_Stream  stream,\n                      FT_UInt32  section_offset,\n                      FT_UInt   *acount )\n  {\n    FT_Error  error;\n    FT_UInt   count;\n    FT_UInt   result = 0;\n\n\n    if ( FT_STREAM_SEEK( section_offset ) || FT_READ_USHORT( count ) )\n      goto Exit;\n\n    result = count;\n\n  Exit:\n    *acount = result;\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  pfr_log_font_load( PFR_LogFont  log_font,\n                     FT_Stream    stream,\n                     FT_UInt      idx,\n                     FT_UInt32    section_offset,\n                     FT_Bool      size_increment )\n  {\n    FT_UInt    num_log_fonts;\n    FT_UInt    flags;\n    FT_UInt32  offset;\n    FT_UInt32  size;\n    FT_Error   error;\n\n\n    if ( FT_STREAM_SEEK( section_offset ) ||\n         FT_READ_USHORT( num_log_fonts )  )\n      goto Exit;\n\n    if ( idx >= num_log_fonts )\n      return FT_THROW( Invalid_Argument );\n\n    if ( FT_STREAM_SKIP( idx * 5 ) ||\n         FT_READ_USHORT( size )    ||\n         FT_READ_UOFF3 ( offset )  )\n      goto Exit;\n\n    /* save logical font size and offset */\n    log_font->size   = size;\n    log_font->offset = offset;\n\n    /* now, check the rest of the table before loading it */\n    {\n      FT_Byte*  p;\n      FT_Byte*  limit;\n      FT_UInt   local;\n\n\n      if ( FT_STREAM_SEEK( offset ) || FT_FRAME_ENTER( size ) )\n        goto Exit;\n\n      p     = stream->cursor;\n      limit = p + size;\n\n      PFR_CHECK(13);\n\n      log_font->matrix[0] = PFR_NEXT_LONG( p );\n      log_font->matrix[1] = PFR_NEXT_LONG( p );\n      log_font->matrix[2] = PFR_NEXT_LONG( p );\n      log_font->matrix[3] = PFR_NEXT_LONG( p );\n\n      flags = PFR_NEXT_BYTE( p );\n\n      local = 0;\n      if ( flags & PFR_LOG_STROKE )\n      {\n        local++;\n        if ( flags & PFR_LOG_2BYTE_STROKE )\n          local++;\n\n        if ( (flags & PFR_LINE_JOIN_MASK) == PFR_LINE_JOIN_MITER )\n          local += 3;\n      }\n      if ( flags & PFR_LOG_BOLD )\n      {\n        local++;\n        if ( flags & PFR_LOG_2BYTE_BOLD )\n          local++;\n      }\n\n      PFR_CHECK( local );\n\n      if ( flags & PFR_LOG_STROKE )\n      {\n        log_font->stroke_thickness = ( flags & PFR_LOG_2BYTE_STROKE )\n                                     ? PFR_NEXT_SHORT( p )\n                                     : PFR_NEXT_BYTE( p );\n\n        if ( ( flags & PFR_LINE_JOIN_MASK ) == PFR_LINE_JOIN_MITER )\n          log_font->miter_limit = PFR_NEXT_LONG( p );\n      }\n\n      if ( flags & PFR_LOG_BOLD )\n      {\n        log_font->bold_thickness = ( flags & PFR_LOG_2BYTE_BOLD )\n                                   ? PFR_NEXT_SHORT( p )\n                                   : PFR_NEXT_BYTE( p );\n      }\n\n      if ( flags & PFR_LOG_EXTRA_ITEMS )\n      {\n        error = pfr_extra_items_skip( &p, limit );\n        if (error) goto Fail;\n      }\n\n      PFR_CHECK(5);\n      log_font->phys_size   = PFR_NEXT_USHORT( p );\n      log_font->phys_offset = PFR_NEXT_ULONG( p );\n      if ( size_increment )\n      {\n        PFR_CHECK( 1 );\n        log_font->phys_size += (FT_UInt32)PFR_NEXT_BYTE( p ) << 16;\n      }\n    }\n\n  Fail:\n    FT_FRAME_EXIT();\n\n  Exit:\n    return error;\n\n  Too_Short:\n    FT_ERROR(( \"pfr_log_font_load: invalid logical font table\\n\" ));\n    error = FT_THROW( Invalid_Table );\n    goto Fail;\n  }\n\n\n  /***********************************************************************/\n  /***********************************************************************/\n  /*****                                                             *****/\n  /*****                    PFR PHYSICAL FONTS                       *****/\n  /*****                                                             *****/\n  /***********************************************************************/\n  /***********************************************************************/\n\n\n  /* load bitmap strikes lists */\n  FT_CALLBACK_DEF( FT_Error )\n  pfr_extra_item_load_bitmap_info( FT_Byte*     p,\n                                   FT_Byte*     limit,\n                                   PFR_PhyFont  phy_font )\n  {\n    FT_Memory   memory = phy_font->memory;\n    PFR_Strike  strike;\n    FT_UInt     flags0;\n    FT_UInt     n, count, size1;\n    FT_Error    error = FT_Err_Ok;\n\n\n    PFR_CHECK( 5 );\n\n    p += 3;  /* skip bctSize */\n    flags0 = PFR_NEXT_BYTE( p );\n    count  = PFR_NEXT_BYTE( p );\n\n    /* re-allocate when needed */\n    if ( phy_font->num_strikes + count > phy_font->max_strikes )\n    {\n      FT_UInt  new_max = FT_PAD_CEIL( phy_font->num_strikes + count, 4 );\n\n\n      if ( FT_RENEW_ARRAY( phy_font->strikes,\n                           phy_font->num_strikes,\n                           new_max ) )\n        goto Exit;\n\n      phy_font->max_strikes = new_max;\n    }\n\n    size1 = 1 + 1 + 1 + 2 + 2 + 1;\n    if ( flags0 & PFR_STRIKE_2BYTE_XPPM )\n      size1++;\n\n    if ( flags0 & PFR_STRIKE_2BYTE_YPPM )\n      size1++;\n\n    if ( flags0 & PFR_STRIKE_3BYTE_SIZE )\n      size1++;\n\n    if ( flags0 & PFR_STRIKE_3BYTE_OFFSET )\n      size1++;\n\n    if ( flags0 & PFR_STRIKE_2BYTE_COUNT )\n      size1++;\n\n    strike = phy_font->strikes + phy_font->num_strikes;\n\n    PFR_CHECK( count * size1 );\n\n    for ( n = 0; n < count; n++, strike++ )\n    {\n      strike->x_ppm       = ( flags0 & PFR_STRIKE_2BYTE_XPPM )\n                            ? PFR_NEXT_USHORT( p )\n                            : PFR_NEXT_BYTE( p );\n\n      strike->y_ppm       = ( flags0 & PFR_STRIKE_2BYTE_YPPM )\n                            ? PFR_NEXT_USHORT( p )\n                            : PFR_NEXT_BYTE( p );\n\n      strike->flags       = PFR_NEXT_BYTE( p );\n\n      strike->bct_size    = ( flags0 & PFR_STRIKE_3BYTE_SIZE )\n                            ? PFR_NEXT_ULONG( p )\n                            : PFR_NEXT_USHORT( p );\n\n      strike->bct_offset  = ( flags0 & PFR_STRIKE_3BYTE_OFFSET )\n                            ? PFR_NEXT_ULONG( p )\n                            : PFR_NEXT_USHORT( p );\n\n      strike->num_bitmaps = ( flags0 & PFR_STRIKE_2BYTE_COUNT )\n                            ? PFR_NEXT_USHORT( p )\n                            : PFR_NEXT_BYTE( p );\n    }\n\n    phy_font->num_strikes += count;\n\n  Exit:\n    return error;\n\n  Too_Short:\n    error = FT_THROW( Invalid_Table );\n    FT_ERROR(( \"pfr_extra_item_load_bitmap_info:\"\n               \" invalid bitmap info table\\n\" ));\n    goto Exit;\n  }\n\n\n  /* Load font ID.  This is a so-called \"unique\" name that is rather\n   * long and descriptive (like \"Tiresias ScreenFont v7.51\").\n   *\n   * Note that a PFR font's family name is contained in an *undocumented*\n   * string of the \"auxiliary data\" portion of a physical font record.  This\n   * may also contain the \"real\" style name!\n   *\n   * If no family name is present, the font ID is used instead for the\n   * family.\n   */\n  FT_CALLBACK_DEF( FT_Error )\n  pfr_extra_item_load_font_id( FT_Byte*     p,\n                               FT_Byte*     limit,\n                               PFR_PhyFont  phy_font )\n  {\n    FT_Error    error  = FT_Err_Ok;\n    FT_Memory   memory = phy_font->memory;\n    FT_PtrDist  len    = limit - p;\n\n\n    if ( phy_font->font_id != NULL )\n      goto Exit;\n\n    if ( FT_ALLOC( phy_font->font_id, len + 1 ) )\n      goto Exit;\n\n    /* copy font ID name, and terminate it for safety */\n    FT_MEM_COPY( phy_font->font_id, p, len );\n    phy_font->font_id[len] = 0;\n\n  Exit:\n    return error;\n  }\n\n\n  /* load stem snap tables */\n  FT_CALLBACK_DEF( FT_Error )\n  pfr_extra_item_load_stem_snaps( FT_Byte*     p,\n                                  FT_Byte*     limit,\n                                  PFR_PhyFont  phy_font )\n  {\n    FT_UInt    count, num_vert, num_horz;\n    FT_Int*    snaps  = NULL;\n    FT_Error   error  = FT_Err_Ok;\n    FT_Memory  memory = phy_font->memory;\n\n\n    if ( phy_font->vertical.stem_snaps != NULL )\n      goto Exit;\n\n    PFR_CHECK( 1 );\n    count = PFR_NEXT_BYTE( p );\n\n    num_vert = count & 15;\n    num_horz = count >> 4;\n    count    = num_vert + num_horz;\n\n    PFR_CHECK( count * 2 );\n\n    if ( FT_NEW_ARRAY( snaps, count ) )\n      goto Exit;\n\n    phy_font->vertical.stem_snaps = snaps;\n    phy_font->horizontal.stem_snaps = snaps + num_vert;\n\n    for ( ; count > 0; count--, snaps++ )\n      *snaps = FT_NEXT_SHORT( p );\n\n  Exit:\n    return error;\n\n  Too_Short:\n    error = FT_THROW( Invalid_Table );\n    FT_ERROR(( \"pfr_exta_item_load_stem_snaps:\"\n               \" invalid stem snaps table\\n\" ));\n    goto Exit;\n  }\n\n\n\n  /* load kerning pair data */\n  FT_CALLBACK_DEF( FT_Error )\n  pfr_extra_item_load_kerning_pairs( FT_Byte*     p,\n                                     FT_Byte*     limit,\n                                     PFR_PhyFont  phy_font )\n  {\n    PFR_KernItem  item   = NULL;\n    FT_Error      error  = FT_Err_Ok;\n    FT_Memory     memory = phy_font->memory;\n\n\n    FT_TRACE2(( \"pfr_extra_item_load_kerning_pairs()\\n\" ));\n\n    if ( FT_NEW( item ) )\n      goto Exit;\n\n    PFR_CHECK( 4 );\n\n    item->pair_count = PFR_NEXT_BYTE( p );\n    item->base_adj   = PFR_NEXT_SHORT( p );\n    item->flags      = PFR_NEXT_BYTE( p );\n    item->offset     = phy_font->offset + ( p - phy_font->cursor );\n\n#ifndef PFR_CONFIG_NO_CHECKS\n    item->pair_size = 3;\n\n    if ( item->flags & PFR_KERN_2BYTE_CHAR )\n      item->pair_size += 2;\n\n    if ( item->flags & PFR_KERN_2BYTE_ADJ )\n      item->pair_size += 1;\n\n    PFR_CHECK( item->pair_count * item->pair_size );\n#endif\n\n    /* load first and last pairs into the item to speed up */\n    /* lookup later...                                     */\n    if ( item->pair_count > 0 )\n    {\n      FT_UInt   char1, char2;\n      FT_Byte*  q;\n\n\n      if ( item->flags & PFR_KERN_2BYTE_CHAR )\n      {\n        q     = p;\n        char1 = PFR_NEXT_USHORT( q );\n        char2 = PFR_NEXT_USHORT( q );\n\n        item->pair1 = PFR_KERN_INDEX( char1, char2 );\n\n        q = p + item->pair_size * ( item->pair_count - 1 );\n        char1 = PFR_NEXT_USHORT( q );\n        char2 = PFR_NEXT_USHORT( q );\n\n        item->pair2 = PFR_KERN_INDEX( char1, char2 );\n      }\n      else\n      {\n        q     = p;\n        char1 = PFR_NEXT_BYTE( q );\n        char2 = PFR_NEXT_BYTE( q );\n\n        item->pair1 = PFR_KERN_INDEX( char1, char2 );\n\n        q = p + item->pair_size * ( item->pair_count - 1 );\n        char1 = PFR_NEXT_BYTE( q );\n        char2 = PFR_NEXT_BYTE( q );\n\n        item->pair2 = PFR_KERN_INDEX( char1, char2 );\n      }\n\n      /* add new item to the current list */\n      item->next                 = NULL;\n      *phy_font->kern_items_tail = item;\n      phy_font->kern_items_tail  = &item->next;\n      phy_font->num_kern_pairs  += item->pair_count;\n    }\n    else\n    {\n      /* empty item! */\n      FT_FREE( item );\n    }\n\n  Exit:\n    return error;\n\n  Too_Short:\n    FT_FREE( item );\n\n    error = FT_THROW( Invalid_Table );\n    FT_ERROR(( \"pfr_extra_item_load_kerning_pairs:\"\n               \" invalid kerning pairs table\\n\" ));\n    goto Exit;\n  }\n\n\n\n  static const PFR_ExtraItemRec  pfr_phy_font_extra_items[] =\n  {\n    { 1, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_bitmap_info },\n    { 2, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_font_id },\n    { 3, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_stem_snaps },\n    { 4, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_kerning_pairs },\n    { 0, NULL }\n  };\n\n\n  /* Loads a name from the auxiliary data.  Since this extracts undocumented\n   * strings from the font file, we need to be careful here.\n   */\n  static FT_Error\n  pfr_aux_name_load( FT_Byte*     p,\n                     FT_UInt      len,\n                     FT_Memory    memory,\n                     FT_String*  *astring )\n  {\n    FT_Error    error  = FT_Err_Ok;\n    FT_String*  result = NULL;\n    FT_UInt     n, ok;\n\n\n    if ( len > 0 && p[len - 1] == 0 )\n      len--;\n\n    /* check that each character is ASCII for making sure not to\n       load garbage\n     */\n    ok = ( len > 0 );\n    for ( n = 0; n < len; n++ )\n      if ( p[n] < 32 || p[n] > 127 )\n      {\n        ok = 0;\n        break;\n      }\n\n    if ( ok )\n    {\n      if ( FT_ALLOC( result, len + 1 ) )\n        goto Exit;\n\n      FT_MEM_COPY( result, p, len );\n      result[len] = 0;\n    }\n  Exit:\n    *astring = result;\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  pfr_phy_font_done( PFR_PhyFont  phy_font,\n                     FT_Memory    memory )\n  {\n    FT_FREE( phy_font->font_id );\n    FT_FREE( phy_font->family_name );\n    FT_FREE( phy_font->style_name );\n\n    FT_FREE( phy_font->vertical.stem_snaps );\n    phy_font->vertical.num_stem_snaps = 0;\n\n    phy_font->horizontal.stem_snaps     = NULL;\n    phy_font->horizontal.num_stem_snaps = 0;\n\n    FT_FREE( phy_font->strikes );\n    phy_font->num_strikes = 0;\n    phy_font->max_strikes = 0;\n\n    FT_FREE( phy_font->chars );\n    phy_font->num_chars    = 0;\n    phy_font->chars_offset = 0;\n\n    FT_FREE( phy_font->blue_values );\n    phy_font->num_blue_values = 0;\n\n    {\n      PFR_KernItem  item, next;\n\n\n      item = phy_font->kern_items;\n      while ( item )\n      {\n        next = item->next;\n        FT_FREE( item );\n        item = next;\n      }\n      phy_font->kern_items      = NULL;\n      phy_font->kern_items_tail = NULL;\n    }\n\n    phy_font->num_kern_pairs = 0;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  pfr_phy_font_load( PFR_PhyFont  phy_font,\n                     FT_Stream    stream,\n                     FT_UInt32    offset,\n                     FT_UInt32    size )\n  {\n    FT_Error   error;\n    FT_Memory  memory = stream->memory;\n    FT_UInt    flags;\n    FT_ULong   num_aux;\n    FT_Byte*   p;\n    FT_Byte*   limit;\n\n\n    phy_font->memory = memory;\n    phy_font->offset = offset;\n\n    phy_font->kern_items      = NULL;\n    phy_font->kern_items_tail = &phy_font->kern_items;\n\n    if ( FT_STREAM_SEEK( offset ) || FT_FRAME_ENTER( size ) )\n      goto Exit;\n\n    phy_font->cursor = stream->cursor;\n\n    p     = stream->cursor;\n    limit = p + size;\n\n    PFR_CHECK( 15 );\n    phy_font->font_ref_number    = PFR_NEXT_USHORT( p );\n    phy_font->outline_resolution = PFR_NEXT_USHORT( p );\n    phy_font->metrics_resolution = PFR_NEXT_USHORT( p );\n    phy_font->bbox.xMin          = PFR_NEXT_SHORT( p );\n    phy_font->bbox.yMin          = PFR_NEXT_SHORT( p );\n    phy_font->bbox.xMax          = PFR_NEXT_SHORT( p );\n    phy_font->bbox.yMax          = PFR_NEXT_SHORT( p );\n    phy_font->flags      = flags = PFR_NEXT_BYTE( p );\n\n    /* get the standard advance for non-proportional fonts */\n    if ( !(flags & PFR_PHY_PROPORTIONAL) )\n    {\n      PFR_CHECK( 2 );\n      phy_font->standard_advance = PFR_NEXT_SHORT( p );\n    }\n\n    /* load the extra items when present */\n    if ( flags & PFR_PHY_EXTRA_ITEMS )\n    {\n      error =  pfr_extra_items_parse( &p, limit,\n                                      pfr_phy_font_extra_items, phy_font );\n\n      if ( error )\n        goto Fail;\n    }\n\n    /* In certain fonts, the auxiliary bytes contain interesting  */\n    /* information. These are not in the specification but can be */\n    /* guessed by looking at the content of a few PFR0 fonts.     */\n    PFR_CHECK( 3 );\n    num_aux = PFR_NEXT_ULONG( p );\n\n    if ( num_aux > 0 )\n    {\n      FT_Byte*  q = p;\n      FT_Byte*  q2;\n\n\n      PFR_CHECK( num_aux );\n      p += num_aux;\n\n      while ( num_aux > 0 )\n      {\n        FT_UInt  length, type;\n\n\n        if ( q + 4 > p )\n          break;\n\n        length = PFR_NEXT_USHORT( q );\n        if ( length < 4 || length > num_aux )\n          break;\n\n        q2   = q + length - 2;\n        type = PFR_NEXT_USHORT( q );\n\n        switch ( type )\n        {\n        case 1:\n          /* this seems to correspond to the font's family name,\n           * padded to 16-bits with one zero when necessary\n           */\n          error = pfr_aux_name_load( q, length - 4U, memory,\n                                     &phy_font->family_name );\n          if ( error )\n            goto Exit;\n          break;\n\n        case 2:\n          if ( q + 32 > q2 )\n            break;\n\n          q += 10;\n          phy_font->ascent  = PFR_NEXT_SHORT( q );\n          phy_font->descent = PFR_NEXT_SHORT( q );\n          phy_font->leading = PFR_NEXT_SHORT( q );\n          break;\n\n        case 3:\n          /* this seems to correspond to the font's style name,\n           * padded to 16-bits with one zero when necessary\n           */\n          error = pfr_aux_name_load( q, length - 4U, memory,\n                                     &phy_font->style_name );\n          if ( error )\n            goto Exit;\n          break;\n\n        default:\n          ;\n        }\n\n        q        = q2;\n        num_aux -= length;\n      }\n    }\n\n    /* read the blue values */\n    {\n      FT_UInt  n, count;\n\n\n      PFR_CHECK( 1 );\n      phy_font->num_blue_values = count = PFR_NEXT_BYTE( p );\n\n      PFR_CHECK( count * 2 );\n\n      if ( FT_NEW_ARRAY( phy_font->blue_values, count ) )\n        goto Fail;\n\n      for ( n = 0; n < count; n++ )\n        phy_font->blue_values[n] = PFR_NEXT_SHORT( p );\n    }\n\n    PFR_CHECK( 8 );\n    phy_font->blue_fuzz  = PFR_NEXT_BYTE( p );\n    phy_font->blue_scale = PFR_NEXT_BYTE( p );\n\n    phy_font->vertical.standard   = PFR_NEXT_USHORT( p );\n    phy_font->horizontal.standard = PFR_NEXT_USHORT( p );\n\n    /* read the character descriptors */\n    {\n      FT_UInt  n, count, Size;\n\n\n      phy_font->num_chars    = count = PFR_NEXT_USHORT( p );\n      phy_font->chars_offset = offset + ( p - stream->cursor );\n\n      if ( FT_NEW_ARRAY( phy_font->chars, count ) )\n        goto Fail;\n\n      Size = 1 + 1 + 2;\n      if ( flags & PFR_PHY_2BYTE_CHARCODE )\n        Size += 1;\n\n      if ( flags & PFR_PHY_PROPORTIONAL )\n        Size += 2;\n\n      if ( flags & PFR_PHY_ASCII_CODE )\n        Size += 1;\n\n      if ( flags & PFR_PHY_2BYTE_GPS_SIZE )\n        Size += 1;\n\n      if ( flags & PFR_PHY_3BYTE_GPS_OFFSET )\n        Size += 1;\n\n      PFR_CHECK( count * Size );\n\n      for ( n = 0; n < count; n++ )\n      {\n        PFR_Char  cur = &phy_font->chars[n];\n\n\n        cur->char_code = ( flags & PFR_PHY_2BYTE_CHARCODE )\n                         ? PFR_NEXT_USHORT( p )\n                         : PFR_NEXT_BYTE( p );\n\n        cur->advance   = ( flags & PFR_PHY_PROPORTIONAL )\n                         ? PFR_NEXT_SHORT( p )\n                         : (FT_Int) phy_font->standard_advance;\n\n#if 0\n        cur->ascii     = ( flags & PFR_PHY_ASCII_CODE )\n                         ? PFR_NEXT_BYTE( p )\n                         : 0;\n#else\n        if ( flags & PFR_PHY_ASCII_CODE )\n          p += 1;\n#endif\n        cur->gps_size  = ( flags & PFR_PHY_2BYTE_GPS_SIZE )\n                         ? PFR_NEXT_USHORT( p )\n                         : PFR_NEXT_BYTE( p );\n\n        cur->gps_offset = ( flags & PFR_PHY_3BYTE_GPS_OFFSET )\n                          ? PFR_NEXT_ULONG( p )\n                          : PFR_NEXT_USHORT( p );\n      }\n    }\n\n    /* that's it! */\n\n  Fail:\n    FT_FRAME_EXIT();\n\n    /* save position of bitmap info */\n    phy_font->bct_offset = FT_STREAM_POS();\n    phy_font->cursor     = NULL;\n\n  Exit:\n    return error;\n\n  Too_Short:\n    error = FT_THROW( Invalid_Table );\n    FT_ERROR(( \"pfr_phy_font_load: invalid physical font table\\n\" ));\n    goto Fail;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pfr/pfrload.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pfrload.h                                                              */\n/*                                                                         */\n/*    FreeType PFR loader (specification).                                 */\n/*                                                                         */\n/*  Copyright 2002 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PFRLOAD_H__\n#define __PFRLOAD_H__\n\n#include \"pfrobjs.h\"\n#include FT_INTERNAL_STREAM_H\n\n\nFT_BEGIN_HEADER\n\n#ifdef PFR_CONFIG_NO_CHECKS\n#define PFR_CHECK( x )  do { } while ( 0 )\n#else\n#define PFR_CHECK( x )  do                       \\\n                        {                        \\\n                          if ( p + (x) > limit ) \\\n                            goto Too_Short;      \\\n                        } while ( 0 )\n#endif\n\n#define PFR_NEXT_BYTE( p )    FT_NEXT_BYTE( p )\n#define PFR_NEXT_INT8( p )    FT_NEXT_CHAR( p )\n#define PFR_NEXT_SHORT( p )   FT_NEXT_SHORT( p )\n#define PFR_NEXT_USHORT( p )  FT_NEXT_USHORT( p )\n#define PFR_NEXT_LONG( p )    FT_NEXT_OFF3( p )\n#define PFR_NEXT_ULONG( p )   FT_NEXT_UOFF3( p )\n\n\n /* handling extra items */\n\n  typedef FT_Error\n  (*PFR_ExtraItem_ParseFunc)( FT_Byte*    p,\n                              FT_Byte*    limit,\n                              FT_Pointer  data );\n\n  typedef struct  PFR_ExtraItemRec_\n  {\n    FT_UInt                  type;\n    PFR_ExtraItem_ParseFunc  parser;\n\n  } PFR_ExtraItemRec;\n\n  typedef const struct PFR_ExtraItemRec_*  PFR_ExtraItem;\n\n\n  FT_LOCAL( FT_Error )\n  pfr_extra_items_skip( FT_Byte*  *pp,\n                        FT_Byte*  limit );\n\n  FT_LOCAL( FT_Error )\n  pfr_extra_items_parse( FT_Byte*      *pp,\n                         FT_Byte*       limit,\n                         PFR_ExtraItem  item_list,\n                         FT_Pointer     item_data );\n\n\n  /* load a PFR header */\n  FT_LOCAL( FT_Error )\n  pfr_header_load( PFR_Header  header,\n                   FT_Stream   stream );\n\n  /* check a PFR header */\n  FT_LOCAL( FT_Bool )\n  pfr_header_check( PFR_Header  header );\n\n\n  /* return number of logical fonts in this file */\n  FT_LOCAL( FT_Error )\n  pfr_log_font_count( FT_Stream   stream,\n                      FT_UInt32   log_section_offset,\n                      FT_UInt    *acount );\n\n  /* load a pfr logical font entry */\n  FT_LOCAL( FT_Error )\n  pfr_log_font_load( PFR_LogFont  log_font,\n                     FT_Stream    stream,\n                     FT_UInt      face_index,\n                     FT_UInt32    section_offset,\n                     FT_Bool      size_increment );\n\n\n  /* load a physical font entry */\n  FT_LOCAL( FT_Error )\n  pfr_phy_font_load( PFR_PhyFont  phy_font,\n                     FT_Stream    stream,\n                     FT_UInt32    offset,\n                     FT_UInt32    size );\n\n  /* finalize a physical font */\n  FT_LOCAL( void )\n  pfr_phy_font_done( PFR_PhyFont  phy_font,\n                     FT_Memory    memory );\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __PFRLOAD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pfr/pfrobjs.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pfrobjs.c                                                              */\n/*                                                                         */\n/*    FreeType PFR object methods (body).                                  */\n/*                                                                         */\n/*  Copyright 2002-2008, 2010-2011, 2013, 2014 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"pfrobjs.h\"\n#include \"pfrload.h\"\n#include \"pfrgload.h\"\n#include \"pfrcmap.h\"\n#include \"pfrsbit.h\"\n#include FT_OUTLINE_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_CALC_H\n#include FT_TRUETYPE_IDS_H\n\n#include \"pfrerror.h\"\n\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_pfr\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                     FACE OBJECT METHODS                       *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL_DEF( void )\n  pfr_face_done( FT_Face  pfrface )     /* PFR_Face */\n  {\n    PFR_Face   face = (PFR_Face)pfrface;\n    FT_Memory  memory;\n\n\n    if ( !face )\n      return;\n\n    memory = pfrface->driver->root.memory;\n\n    /* we don't want dangling pointers */\n    pfrface->family_name = NULL;\n    pfrface->style_name  = NULL;\n\n    /* finalize the physical font record */\n    pfr_phy_font_done( &face->phy_font, FT_FACE_MEMORY( face ) );\n\n    /* no need to finalize the logical font or the header */\n    FT_FREE( pfrface->available_sizes );\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  pfr_face_init( FT_Stream      stream,\n                 FT_Face        pfrface,\n                 FT_Int         face_index,\n                 FT_Int         num_params,\n                 FT_Parameter*  params )\n  {\n    PFR_Face  face = (PFR_Face)pfrface;\n    FT_Error  error;\n\n    FT_UNUSED( num_params );\n    FT_UNUSED( params );\n\n\n    FT_TRACE2(( \"PFR driver\\n\" ));\n\n    /* load the header and check it */\n    error = pfr_header_load( &face->header, stream );\n    if ( error )\n      goto Exit;\n\n    if ( !pfr_header_check( &face->header ) )\n    {\n      FT_TRACE2(( \"  not a PFR font\\n\" ));\n      error = FT_THROW( Unknown_File_Format );\n      goto Exit;\n    }\n\n    /* check face index */\n    {\n      FT_UInt  num_faces;\n\n\n      error = pfr_log_font_count( stream,\n                                  face->header.log_dir_offset,\n                                  &num_faces );\n      if ( error )\n        goto Exit;\n\n      pfrface->num_faces = num_faces;\n    }\n\n    if ( face_index < 0 )\n      goto Exit;\n\n    if ( face_index >= pfrface->num_faces )\n    {\n      FT_ERROR(( \"pfr_face_init: invalid face index\\n\" ));\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    /* load the face */\n    error = pfr_log_font_load(\n               &face->log_font, stream, face_index,\n               face->header.log_dir_offset,\n               FT_BOOL( face->header.phy_font_max_size_high != 0 ) );\n    if ( error )\n      goto Exit;\n\n    /* now load the physical font descriptor */\n    error = pfr_phy_font_load( &face->phy_font, stream,\n                               face->log_font.phys_offset,\n                               face->log_font.phys_size );\n    if ( error )\n      goto Exit;\n\n    /* now set up all root face fields */\n    {\n      PFR_PhyFont  phy_font = &face->phy_font;\n\n\n      pfrface->face_index = face_index;\n      pfrface->num_glyphs = phy_font->num_chars + 1;\n\n      pfrface->face_flags |= FT_FACE_FLAG_SCALABLE;\n\n      /* if all characters point to the same gps_offset 0, we */\n      /* assume that the font only contains bitmaps           */\n      {\n        FT_UInt  nn;\n\n\n        for ( nn = 0; nn < phy_font->num_chars; nn++ )\n          if ( phy_font->chars[nn].gps_offset != 0 )\n            break;\n\n        if ( nn == phy_font->num_chars )\n        {\n          if ( phy_font->num_strikes > 0 )\n            pfrface->face_flags = 0;        /* not scalable */\n          else\n          {\n            FT_ERROR(( \"pfr_face_init: font doesn't contain glyphs\\n\" ));\n            error = FT_THROW( Invalid_File_Format );\n            goto Exit;\n          }\n        }\n      }\n\n      if ( (phy_font->flags & PFR_PHY_PROPORTIONAL) == 0 )\n        pfrface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;\n\n      if ( phy_font->flags & PFR_PHY_VERTICAL )\n        pfrface->face_flags |= FT_FACE_FLAG_VERTICAL;\n      else\n        pfrface->face_flags |= FT_FACE_FLAG_HORIZONTAL;\n\n      if ( phy_font->num_strikes > 0 )\n        pfrface->face_flags |= FT_FACE_FLAG_FIXED_SIZES;\n\n      if ( phy_font->num_kern_pairs > 0 )\n        pfrface->face_flags |= FT_FACE_FLAG_KERNING;\n\n      /* If no family name was found in the \"undocumented\" auxiliary\n       * data, use the font ID instead.  This sucks but is better than\n       * nothing.\n       */\n      pfrface->family_name = phy_font->family_name;\n      if ( pfrface->family_name == NULL )\n        pfrface->family_name = phy_font->font_id;\n\n      /* note that the style name can be NULL in certain PFR fonts,\n       * probably meaning \"Regular\"\n       */\n      pfrface->style_name = phy_font->style_name;\n\n      pfrface->num_fixed_sizes = 0;\n      pfrface->available_sizes = 0;\n\n      pfrface->bbox         = phy_font->bbox;\n      pfrface->units_per_EM = (FT_UShort)phy_font->outline_resolution;\n      pfrface->ascender     = (FT_Short) phy_font->bbox.yMax;\n      pfrface->descender    = (FT_Short) phy_font->bbox.yMin;\n\n      pfrface->height = (FT_Short)( ( pfrface->units_per_EM * 12 ) / 10 );\n      if ( pfrface->height < pfrface->ascender - pfrface->descender )\n        pfrface->height = (FT_Short)(pfrface->ascender - pfrface->descender);\n\n      if ( phy_font->num_strikes > 0 )\n      {\n        FT_UInt          n, count = phy_font->num_strikes;\n        FT_Bitmap_Size*  size;\n        PFR_Strike       strike;\n        FT_Memory        memory = pfrface->stream->memory;\n\n\n        if ( FT_NEW_ARRAY( pfrface->available_sizes, count ) )\n          goto Exit;\n\n        size   = pfrface->available_sizes;\n        strike = phy_font->strikes;\n        for ( n = 0; n < count; n++, size++, strike++ )\n        {\n          size->height = (FT_UShort)strike->y_ppm;\n          size->width  = (FT_UShort)strike->x_ppm;\n          size->size   = strike->y_ppm << 6;\n          size->x_ppem = strike->x_ppm << 6;\n          size->y_ppem = strike->y_ppm << 6;\n        }\n        pfrface->num_fixed_sizes = count;\n      }\n\n      /* now compute maximum advance width */\n      if ( ( phy_font->flags & PFR_PHY_PROPORTIONAL ) == 0 )\n        pfrface->max_advance_width = (FT_Short)phy_font->standard_advance;\n      else\n      {\n        FT_Int    max = 0;\n        FT_UInt   count = phy_font->num_chars;\n        PFR_Char  gchar = phy_font->chars;\n\n\n        for ( ; count > 0; count--, gchar++ )\n        {\n          if ( max < gchar->advance )\n            max = gchar->advance;\n        }\n\n        pfrface->max_advance_width = (FT_Short)max;\n      }\n\n      pfrface->max_advance_height = pfrface->height;\n\n      pfrface->underline_position  = (FT_Short)( -pfrface->units_per_EM / 10 );\n      pfrface->underline_thickness = (FT_Short)(  pfrface->units_per_EM / 30 );\n\n      /* create charmap */\n      {\n        FT_CharMapRec  charmap;\n\n\n        charmap.face        = pfrface;\n        charmap.platform_id = TT_PLATFORM_MICROSOFT;\n        charmap.encoding_id = TT_MS_ID_UNICODE_CS;\n        charmap.encoding    = FT_ENCODING_UNICODE;\n\n        error = FT_CMap_New( &pfr_cmap_class_rec, NULL, &charmap, NULL );\n\n#if 0\n        /* Select default charmap */\n        if ( pfrface->num_charmaps )\n          pfrface->charmap = pfrface->charmaps[0];\n#endif\n      }\n\n      /* check whether we've loaded any kerning pairs */\n      if ( phy_font->num_kern_pairs )\n        pfrface->face_flags |= FT_FACE_FLAG_KERNING;\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    SLOT OBJECT METHOD                         *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL_DEF( FT_Error )\n  pfr_slot_init( FT_GlyphSlot  pfrslot )        /* PFR_Slot */\n  {\n    PFR_Slot        slot   = (PFR_Slot)pfrslot;\n    FT_GlyphLoader  loader = pfrslot->internal->loader;\n\n\n    pfr_glyph_init( &slot->glyph, loader );\n\n    return 0;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  pfr_slot_done( FT_GlyphSlot  pfrslot )        /* PFR_Slot */\n  {\n    PFR_Slot  slot = (PFR_Slot)pfrslot;\n\n\n    pfr_glyph_done( &slot->glyph );\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  pfr_slot_load( FT_GlyphSlot  pfrslot,         /* PFR_Slot */\n                 FT_Size       pfrsize,         /* PFR_Size */\n                 FT_UInt       gindex,\n                 FT_Int32      load_flags )\n  {\n    PFR_Slot     slot    = (PFR_Slot)pfrslot;\n    PFR_Size     size    = (PFR_Size)pfrsize;\n    FT_Error     error;\n    PFR_Face     face    = (PFR_Face)pfrslot->face;\n    PFR_Char     gchar;\n    FT_Outline*  outline = &pfrslot->outline;\n    FT_ULong     gps_offset;\n\n\n    FT_TRACE1(( \"pfr_slot_load: glyph index %d\\n\", gindex ));\n\n    if ( gindex > 0 )\n      gindex--;\n\n    if ( !face || gindex >= face->phy_font.num_chars )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    /* try to load an embedded bitmap */\n    if ( ( load_flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP ) ) == 0 )\n    {\n      error = pfr_slot_load_bitmap( slot, size, gindex );\n      if ( error == 0 )\n        goto Exit;\n    }\n\n    if ( load_flags & FT_LOAD_SBITS_ONLY )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    gchar               = face->phy_font.chars + gindex;\n    pfrslot->format     = FT_GLYPH_FORMAT_OUTLINE;\n    outline->n_points   = 0;\n    outline->n_contours = 0;\n    gps_offset          = face->header.gps_section_offset;\n\n    /* load the glyph outline (FT_LOAD_NO_RECURSE isn't supported) */\n    error = pfr_glyph_load( &slot->glyph, face->root.stream,\n                            gps_offset, gchar->gps_offset, gchar->gps_size );\n\n    if ( !error )\n    {\n      FT_BBox            cbox;\n      FT_Glyph_Metrics*  metrics = &pfrslot->metrics;\n      FT_Pos             advance;\n      FT_Int             em_metrics, em_outline;\n      FT_Bool            scaling;\n\n\n      scaling = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 );\n\n      /* copy outline data */\n      *outline = slot->glyph.loader->base.outline;\n\n      outline->flags &= ~FT_OUTLINE_OWNER;\n      outline->flags |= FT_OUTLINE_REVERSE_FILL;\n\n      if ( size && pfrsize->metrics.y_ppem < 24 )\n        outline->flags |= FT_OUTLINE_HIGH_PRECISION;\n\n      /* compute the advance vector */\n      metrics->horiAdvance = 0;\n      metrics->vertAdvance = 0;\n\n      advance    = gchar->advance;\n      em_metrics = face->phy_font.metrics_resolution;\n      em_outline = face->phy_font.outline_resolution;\n\n      if ( em_metrics != em_outline )\n        advance = FT_MulDiv( advance, em_outline, em_metrics );\n\n      if ( face->phy_font.flags & PFR_PHY_VERTICAL )\n        metrics->vertAdvance = advance;\n      else\n        metrics->horiAdvance = advance;\n\n      pfrslot->linearHoriAdvance = metrics->horiAdvance;\n      pfrslot->linearVertAdvance = metrics->vertAdvance;\n\n      /* make-up vertical metrics(?) */\n      metrics->vertBearingX = 0;\n      metrics->vertBearingY = 0;\n\n#if 0 /* some fonts seem to be broken here! */\n\n      /* Apply the font matrix, if any.                 */\n      /* TODO: Test existing fonts with unusual matrix  */\n      /* whether we have to adjust Units per EM.        */\n      {\n        FT_Matrix font_matrix;\n\n\n        font_matrix.xx = face->log_font.matrix[0] << 8;\n        font_matrix.yx = face->log_font.matrix[1] << 8;\n        font_matrix.xy = face->log_font.matrix[2] << 8;\n        font_matrix.yy = face->log_font.matrix[3] << 8;\n\n        FT_Outline_Transform( outline, &font_matrix );\n      }\n#endif\n\n      /* scale when needed */\n      if ( scaling )\n      {\n        FT_Int      n;\n        FT_Fixed    x_scale = pfrsize->metrics.x_scale;\n        FT_Fixed    y_scale = pfrsize->metrics.y_scale;\n        FT_Vector*  vec     = outline->points;\n\n\n        /* scale outline points */\n        for ( n = 0; n < outline->n_points; n++, vec++ )\n        {\n          vec->x = FT_MulFix( vec->x, x_scale );\n          vec->y = FT_MulFix( vec->y, y_scale );\n        }\n\n        /* scale the advance */\n        metrics->horiAdvance = FT_MulFix( metrics->horiAdvance, x_scale );\n        metrics->vertAdvance = FT_MulFix( metrics->vertAdvance, y_scale );\n      }\n\n      /* compute the rest of the metrics */\n      FT_Outline_Get_CBox( outline, &cbox );\n\n      metrics->width        = cbox.xMax - cbox.xMin;\n      metrics->height       = cbox.yMax - cbox.yMin;\n      metrics->horiBearingX = cbox.xMin;\n      metrics->horiBearingY = cbox.yMax - metrics->height;\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      KERNING METHOD                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL_DEF( FT_Error )\n  pfr_face_get_kerning( FT_Face     pfrface,        /* PFR_Face */\n                        FT_UInt     glyph1,\n                        FT_UInt     glyph2,\n                        FT_Vector*  kerning )\n  {\n    PFR_Face     face     = (PFR_Face)pfrface;\n    FT_Error     error    = FT_Err_Ok;\n    PFR_PhyFont  phy_font = &face->phy_font;\n    FT_UInt32    code1, code2, pair;\n\n\n    kerning->x = 0;\n    kerning->y = 0;\n\n    if ( glyph1 > 0 )\n      glyph1--;\n\n    if ( glyph2 > 0 )\n      glyph2--;\n\n    /* convert glyph indices to character codes */\n    if ( glyph1 > phy_font->num_chars ||\n         glyph2 > phy_font->num_chars )\n      goto Exit;\n\n    code1 = phy_font->chars[glyph1].char_code;\n    code2 = phy_font->chars[glyph2].char_code;\n    pair  = PFR_KERN_INDEX( code1, code2 );\n\n    /* now search the list of kerning items */\n    {\n      PFR_KernItem  item   = phy_font->kern_items;\n      FT_Stream     stream = pfrface->stream;\n\n\n      for ( ; item; item = item->next )\n      {\n        if ( pair >= item->pair1 && pair <= item->pair2 )\n          goto FoundPair;\n      }\n      goto Exit;\n\n    FoundPair: /* we found an item, now parse it and find the value if any */\n      if ( FT_STREAM_SEEK( item->offset )                       ||\n           FT_FRAME_ENTER( item->pair_count * item->pair_size ) )\n        goto Exit;\n\n      {\n        FT_UInt    count       = item->pair_count;\n        FT_UInt    size        = item->pair_size;\n        FT_UInt    power       = 1 << FT_MSB( count );\n        FT_UInt    probe       = power * size;\n        FT_UInt    extra       = count - power;\n        FT_Byte*   base        = stream->cursor;\n        FT_Bool    twobytes    = FT_BOOL( item->flags & 1 );\n        FT_Bool    twobyte_adj = FT_BOOL( item->flags & 2 );\n        FT_Byte*   p;\n        FT_UInt32  cpair;\n\n\n        if ( extra > 0 )\n        {\n          p = base + extra * size;\n\n          if ( twobytes )\n            cpair = FT_NEXT_ULONG( p );\n          else\n            cpair = PFR_NEXT_KPAIR( p );\n\n          if ( cpair == pair )\n            goto Found;\n\n          if ( cpair < pair )\n          {\n            if ( twobyte_adj )\n              p += 2;\n            else\n              p++;\n            base = p;\n          }\n        }\n\n        while ( probe > size )\n        {\n          probe >>= 1;\n          p       = base + probe;\n\n          if ( twobytes )\n            cpair = FT_NEXT_ULONG( p );\n          else\n            cpair = PFR_NEXT_KPAIR( p );\n\n          if ( cpair == pair )\n            goto Found;\n\n          if ( cpair < pair )\n            base += probe;\n        }\n\n        p = base;\n\n        if ( twobytes )\n          cpair = FT_NEXT_ULONG( p );\n        else\n          cpair = PFR_NEXT_KPAIR( p );\n\n        if ( cpair == pair )\n        {\n          FT_Int  value;\n\n\n        Found:\n          if ( twobyte_adj )\n            value = FT_PEEK_SHORT( p );\n          else\n            value = p[0];\n\n          kerning->x = item->base_adj + value;\n        }\n      }\n\n      FT_FRAME_EXIT();\n    }\n\n  Exit:\n    return error;\n  }\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pfr/pfrobjs.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pfrobjs.h                                                              */\n/*                                                                         */\n/*    FreeType PFR object methods (specification).                         */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PFROBJS_H__\n#define __PFROBJS_H__\n\n#include \"pfrtypes.h\"\n\n\nFT_BEGIN_HEADER\n\n  typedef struct PFR_FaceRec_*  PFR_Face;\n\n  typedef struct PFR_SizeRec_*  PFR_Size;\n\n  typedef struct PFR_SlotRec_*  PFR_Slot;\n\n\n  typedef struct  PFR_FaceRec_\n  {\n    FT_FaceRec      root;\n    PFR_HeaderRec   header;\n    PFR_LogFontRec  log_font;\n    PFR_PhyFontRec  phy_font;\n\n  } PFR_FaceRec;\n\n\n  typedef struct  PFR_SizeRec_\n  {\n    FT_SizeRec  root;\n\n  } PFR_SizeRec;\n\n\n  typedef struct  PFR_SlotRec_\n  {\n    FT_GlyphSlotRec  root;\n    PFR_GlyphRec     glyph;\n\n  } PFR_SlotRec;\n\n\n  FT_LOCAL( FT_Error )\n  pfr_face_init( FT_Stream      stream,\n                 FT_Face        face,           /* PFR_Face */\n                 FT_Int         face_index,\n                 FT_Int         num_params,\n                 FT_Parameter*  params );\n\n  FT_LOCAL( void )\n  pfr_face_done( FT_Face  face );               /* PFR_Face */\n\n\n  FT_LOCAL( FT_Error )\n  pfr_face_get_kerning( FT_Face     face,       /* PFR_Face */\n                        FT_UInt     glyph1,\n                        FT_UInt     glyph2,\n                        FT_Vector*  kerning );\n\n\n  FT_LOCAL( FT_Error )\n  pfr_slot_init( FT_GlyphSlot  slot );          /* PFR_Slot */\n\n  FT_LOCAL( void )\n  pfr_slot_done( FT_GlyphSlot  slot );          /* PFR_Slot */\n\n\n  FT_LOCAL( FT_Error )\n  pfr_slot_load( FT_GlyphSlot  slot,            /* PFR_Slot */\n                 FT_Size       size,            /* PFR_Size */\n                 FT_UInt       gindex,\n                 FT_Int32      load_flags );\n\n\nFT_END_HEADER\n\n#endif /* __PFROBJS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pfr/pfrsbit.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pfrsbit.c                                                              */\n/*                                                                         */\n/*    FreeType PFR bitmap loader (body).                                   */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2006, 2009, 2010, 2013 by                        */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"pfrsbit.h\"\n#include \"pfrload.h\"\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n\n#include \"pfrerror.h\"\n\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_pfr\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      PFR BIT WRITER                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct  PFR_BitWriter_\n  {\n    FT_Byte*  line;      /* current line start                    */\n    FT_Int    pitch;     /* line size in bytes                    */\n    FT_Int    width;     /* width in pixels/bits                  */\n    FT_Int    rows;      /* number of remaining rows to scan      */\n    FT_Int    total;     /* total number of bits to draw          */\n\n  } PFR_BitWriterRec, *PFR_BitWriter;\n\n\n  static void\n  pfr_bitwriter_init( PFR_BitWriter  writer,\n                      FT_Bitmap*     target,\n                      FT_Bool        decreasing )\n  {\n    writer->line   = target->buffer;\n    writer->pitch  = target->pitch;\n    writer->width  = target->width;\n    writer->rows   = target->rows;\n    writer->total  = writer->width * writer->rows;\n\n    if ( !decreasing )\n    {\n      writer->line += writer->pitch * ( target->rows - 1 );\n      writer->pitch = -writer->pitch;\n    }\n  }\n\n\n  static void\n  pfr_bitwriter_decode_bytes( PFR_BitWriter  writer,\n                              FT_Byte*       p,\n                              FT_Byte*       limit )\n  {\n    FT_Int    n, reload;\n    FT_Int    left = writer->width;\n    FT_Byte*  cur  = writer->line;\n    FT_UInt   mask = 0x80;\n    FT_UInt   val  = 0;\n    FT_UInt   c    = 0;\n\n\n    n = (FT_Int)( limit - p ) * 8;\n    if ( n > writer->total )\n      n = writer->total;\n\n    reload = n & 7;\n\n    for ( ; n > 0; n-- )\n    {\n      if ( ( n & 7 ) == reload )\n        val = *p++;\n\n      if ( val & 0x80 )\n        c |= mask;\n\n      val  <<= 1;\n      mask >>= 1;\n\n      if ( --left <= 0 )\n      {\n        cur[0] = (FT_Byte)c;\n        left   = writer->width;\n        mask   = 0x80;\n\n        writer->line += writer->pitch;\n        cur           = writer->line;\n        c             = 0;\n      }\n      else if ( mask == 0 )\n      {\n        cur[0] = (FT_Byte)c;\n        mask   = 0x80;\n        c      = 0;\n        cur ++;\n      }\n    }\n\n    if ( mask != 0x80 )\n      cur[0] = (FT_Byte)c;\n  }\n\n\n  static void\n  pfr_bitwriter_decode_rle1( PFR_BitWriter  writer,\n                             FT_Byte*       p,\n                             FT_Byte*       limit )\n  {\n    FT_Int    n, phase, count, counts[2], reload;\n    FT_Int    left = writer->width;\n    FT_Byte*  cur  = writer->line;\n    FT_UInt   mask = 0x80;\n    FT_UInt   c    = 0;\n\n\n    n = writer->total;\n\n    phase     = 1;\n    counts[0] = 0;\n    counts[1] = 0;\n    count     = 0;\n    reload    = 1;\n\n    for ( ; n > 0; n-- )\n    {\n      if ( reload )\n      {\n        do\n        {\n          if ( phase )\n          {\n            FT_Int  v;\n\n\n            if ( p >= limit )\n              break;\n\n            v         = *p++;\n            counts[0] = v >> 4;\n            counts[1] = v & 15;\n            phase     = 0;\n            count     = counts[0];\n          }\n          else\n          {\n            phase = 1;\n            count = counts[1];\n          }\n\n        } while ( count == 0 );\n      }\n\n      if ( phase )\n        c |= mask;\n\n      mask >>= 1;\n\n      if ( --left <= 0 )\n      {\n        cur[0] = (FT_Byte) c;\n        left   = writer->width;\n        mask   = 0x80;\n\n        writer->line += writer->pitch;\n        cur           = writer->line;\n        c             = 0;\n      }\n      else if ( mask == 0 )\n      {\n        cur[0] = (FT_Byte)c;\n        mask   = 0x80;\n        c      = 0;\n        cur ++;\n      }\n\n      reload = ( --count <= 0 );\n    }\n\n    if ( mask != 0x80 )\n      cur[0] = (FT_Byte) c;\n  }\n\n\n  static void\n  pfr_bitwriter_decode_rle2( PFR_BitWriter  writer,\n                             FT_Byte*       p,\n                             FT_Byte*       limit )\n  {\n    FT_Int    n, phase, count, reload;\n    FT_Int    left = writer->width;\n    FT_Byte*  cur  = writer->line;\n    FT_UInt   mask = 0x80;\n    FT_UInt   c    = 0;\n\n\n    n = writer->total;\n\n    phase  = 1;\n    count  = 0;\n    reload = 1;\n\n    for ( ; n > 0; n-- )\n    {\n      if ( reload )\n      {\n        do\n        {\n          if ( p >= limit )\n            break;\n\n          count = *p++;\n          phase = phase ^ 1;\n\n        } while ( count == 0 );\n      }\n\n      if ( phase )\n        c |= mask;\n\n      mask >>= 1;\n\n      if ( --left <= 0 )\n      {\n        cur[0] = (FT_Byte) c;\n        c      = 0;\n        mask   = 0x80;\n        left   = writer->width;\n\n        writer->line += writer->pitch;\n        cur           = writer->line;\n      }\n      else if ( mask == 0 )\n      {\n        cur[0] = (FT_Byte)c;\n        c      = 0;\n        mask   = 0x80;\n        cur ++;\n      }\n\n      reload = ( --count <= 0 );\n    }\n\n    if ( mask != 0x80 )\n      cur[0] = (FT_Byte) c;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                  BITMAP DATA DECODING                         *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static void\n  pfr_lookup_bitmap_data( FT_Byte*   base,\n                          FT_Byte*   limit,\n                          FT_UInt    count,\n                          FT_UInt    flags,\n                          FT_UInt    char_code,\n                          FT_ULong*  found_offset,\n                          FT_ULong*  found_size )\n  {\n    FT_UInt   left, right, char_len;\n    FT_Bool   two = FT_BOOL( flags & 1 );\n    FT_Byte*  buff;\n\n\n    char_len = 4;\n    if ( two )       char_len += 1;\n    if ( flags & 2 ) char_len += 1;\n    if ( flags & 4 ) char_len += 1;\n\n    left  = 0;\n    right = count;\n\n    while ( left < right )\n    {\n      FT_UInt  middle, code;\n\n\n      middle = ( left + right ) >> 1;\n      buff   = base + middle * char_len;\n\n      /* check that we are not outside of the table -- */\n      /* this is possible with broken fonts...         */\n      if ( buff + char_len > limit )\n        goto Fail;\n\n      if ( two )\n        code = PFR_NEXT_USHORT( buff );\n      else\n        code = PFR_NEXT_BYTE( buff );\n\n      if ( code == char_code )\n        goto Found_It;\n\n      if ( code < char_code )\n        left = middle;\n      else\n        right = middle;\n    }\n\n  Fail:\n    /* Not found */\n    *found_size   = 0;\n    *found_offset = 0;\n    return;\n\n  Found_It:\n    if ( flags & 2 )\n      *found_size = PFR_NEXT_USHORT( buff );\n    else\n      *found_size = PFR_NEXT_BYTE( buff );\n\n    if ( flags & 4 )\n      *found_offset = PFR_NEXT_ULONG( buff );\n    else\n      *found_offset = PFR_NEXT_USHORT( buff );\n  }\n\n\n  /* load bitmap metrics.  \"*padvance\" must be set to the default value */\n  /* before calling this function...                                    */\n  /*                                                                    */\n  static FT_Error\n  pfr_load_bitmap_metrics( FT_Byte**  pdata,\n                           FT_Byte*   limit,\n                           FT_Long    scaled_advance,\n                           FT_Long   *axpos,\n                           FT_Long   *aypos,\n                           FT_UInt   *axsize,\n                           FT_UInt   *aysize,\n                           FT_Long   *aadvance,\n                           FT_UInt   *aformat )\n  {\n    FT_Error  error = FT_Err_Ok;\n    FT_Byte   flags;\n    FT_Char   b;\n    FT_Byte*  p = *pdata;\n    FT_Long   xpos, ypos, advance;\n    FT_UInt   xsize, ysize;\n\n\n    PFR_CHECK( 1 );\n    flags = PFR_NEXT_BYTE( p );\n\n    xpos    = 0;\n    ypos    = 0;\n    xsize   = 0;\n    ysize   = 0;\n    advance = 0;\n\n    switch ( flags & 3 )\n    {\n    case 0:\n      PFR_CHECK( 1 );\n      b    = PFR_NEXT_INT8( p );\n      xpos = b >> 4;\n      ypos = ( (FT_Char)( b << 4 ) ) >> 4;\n      break;\n\n    case 1:\n      PFR_CHECK( 2 );\n      xpos = PFR_NEXT_INT8( p );\n      ypos = PFR_NEXT_INT8( p );\n      break;\n\n    case 2:\n      PFR_CHECK( 4 );\n      xpos = PFR_NEXT_SHORT( p );\n      ypos = PFR_NEXT_SHORT( p );\n      break;\n\n    case 3:\n      PFR_CHECK( 6 );\n      xpos = PFR_NEXT_LONG( p );\n      ypos = PFR_NEXT_LONG( p );\n      break;\n\n    default:\n      ;\n    }\n\n    flags >>= 2;\n    switch ( flags & 3 )\n    {\n    case 0:\n      /* blank image */\n      xsize = 0;\n      ysize = 0;\n      break;\n\n    case 1:\n      PFR_CHECK( 1 );\n      b     = PFR_NEXT_BYTE( p );\n      xsize = ( b >> 4 ) & 0xF;\n      ysize = b & 0xF;\n      break;\n\n    case 2:\n      PFR_CHECK( 2 );\n      xsize = PFR_NEXT_BYTE( p );\n      ysize = PFR_NEXT_BYTE( p );\n      break;\n\n    case 3:\n      PFR_CHECK( 4 );\n      xsize = PFR_NEXT_USHORT( p );\n      ysize = PFR_NEXT_USHORT( p );\n      break;\n\n    default:\n      ;\n    }\n\n    flags >>= 2;\n    switch ( flags & 3 )\n    {\n    case 0:\n      advance = scaled_advance;\n      break;\n\n    case 1:\n      PFR_CHECK( 1 );\n      advance = PFR_NEXT_INT8( p ) << 8;\n      break;\n\n    case 2:\n      PFR_CHECK( 2 );\n      advance = PFR_NEXT_SHORT( p );\n      break;\n\n    case 3:\n      PFR_CHECK( 3 );\n      advance = PFR_NEXT_LONG( p );\n      break;\n\n    default:\n      ;\n    }\n\n    *axpos    = xpos;\n    *aypos    = ypos;\n    *axsize   = xsize;\n    *aysize   = ysize;\n    *aadvance = advance;\n    *aformat  = flags >> 2;\n    *pdata    = p;\n\n  Exit:\n    return error;\n\n  Too_Short:\n    error = FT_THROW( Invalid_Table );\n    FT_ERROR(( \"pfr_load_bitmap_metrics: invalid glyph data\\n\" ));\n    goto Exit;\n  }\n\n\n  static FT_Error\n  pfr_load_bitmap_bits( FT_Byte*    p,\n                        FT_Byte*    limit,\n                        FT_UInt     format,\n                        FT_Bool     decreasing,\n                        FT_Bitmap*  target )\n  {\n    FT_Error          error = FT_Err_Ok;\n    PFR_BitWriterRec  writer;\n\n\n    if ( target->rows > 0 && target->width > 0 )\n    {\n      pfr_bitwriter_init( &writer, target, decreasing );\n\n      switch ( format )\n      {\n      case 0: /* packed bits */\n        pfr_bitwriter_decode_bytes( &writer, p, limit );\n        break;\n\n      case 1: /* RLE1 */\n        pfr_bitwriter_decode_rle1( &writer, p, limit );\n        break;\n\n      case 2: /* RLE2 */\n        pfr_bitwriter_decode_rle2( &writer, p, limit );\n        break;\n\n      default:\n        FT_ERROR(( \"pfr_read_bitmap_data: invalid image type\\n\" ));\n        error = FT_THROW( Invalid_File_Format );\n      }\n    }\n\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                     BITMAP LOADING                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL( FT_Error )\n  pfr_slot_load_bitmap( PFR_Slot  glyph,\n                        PFR_Size  size,\n                        FT_UInt   glyph_index )\n  {\n    FT_Error     error;\n    PFR_Face     face   = (PFR_Face) glyph->root.face;\n    FT_Stream    stream = face->root.stream;\n    PFR_PhyFont  phys   = &face->phy_font;\n    FT_ULong     gps_offset;\n    FT_ULong     gps_size;\n    PFR_Char     character;\n    PFR_Strike   strike;\n\n\n    character = &phys->chars[glyph_index];\n\n    /* Look-up a bitmap strike corresponding to the current */\n    /* character dimensions                                 */\n    {\n      FT_UInt  n;\n\n\n      strike = phys->strikes;\n      for ( n = 0; n < phys->num_strikes; n++ )\n      {\n        if ( strike->x_ppm == (FT_UInt)size->root.metrics.x_ppem &&\n             strike->y_ppm == (FT_UInt)size->root.metrics.y_ppem )\n        {\n          goto Found_Strike;\n        }\n\n        strike++;\n      }\n\n      /* couldn't find it */\n      return FT_THROW( Invalid_Argument );\n    }\n\n  Found_Strike:\n\n    /* Now lookup the glyph's position within the file */\n    {\n      FT_UInt  char_len;\n\n\n      char_len = 4;\n      if ( strike->flags & 1 ) char_len += 1;\n      if ( strike->flags & 2 ) char_len += 1;\n      if ( strike->flags & 4 ) char_len += 1;\n\n      /* Access data directly in the frame to speed lookups */\n      if ( FT_STREAM_SEEK( phys->bct_offset + strike->bct_offset ) ||\n           FT_FRAME_ENTER( char_len * strike->num_bitmaps )        )\n        goto Exit;\n\n      pfr_lookup_bitmap_data( stream->cursor,\n                              stream->limit,\n                              strike->num_bitmaps,\n                              strike->flags,\n                              character->char_code,\n                              &gps_offset,\n                              &gps_size );\n\n      FT_FRAME_EXIT();\n\n      if ( gps_size == 0 )\n      {\n        /* Could not find a bitmap program string for this glyph */\n        error = FT_THROW( Invalid_Argument );\n        goto Exit;\n      }\n    }\n\n    /* get the bitmap metrics */\n    {\n      FT_Long   xpos = 0, ypos = 0, advance = 0;\n      FT_UInt   xsize = 0, ysize = 0, format = 0;\n      FT_Byte*  p;\n\n\n      /* compute linear advance */\n      advance = character->advance;\n      if ( phys->metrics_resolution != phys->outline_resolution )\n        advance = FT_MulDiv( advance,\n                             phys->outline_resolution,\n                             phys->metrics_resolution );\n\n      glyph->root.linearHoriAdvance = advance;\n\n      /* compute default advance, i.e., scaled advance.  This can be */\n      /* overridden in the bitmap header of certain glyphs.          */\n      advance = FT_MulDiv( (FT_Fixed)size->root.metrics.x_ppem << 8,\n                           character->advance,\n                           phys->metrics_resolution );\n\n      if ( FT_STREAM_SEEK( face->header.gps_section_offset + gps_offset ) ||\n           FT_FRAME_ENTER( gps_size )                                     )\n        goto Exit;\n\n      p     = stream->cursor;\n      error = pfr_load_bitmap_metrics( &p, stream->limit,\n                                       advance,\n                                       &xpos, &ypos,\n                                       &xsize, &ysize,\n                                       &advance, &format );\n\n      /*\n       * XXX: on 16bit system, we return an error for huge bitmap\n       *      which causes a size truncation, because truncated\n       *      size properties makes bitmap glyph broken.\n       */\n      if ( xpos > FT_INT_MAX  || xpos < FT_INT_MIN         ||\n           ysize > FT_INT_MAX || ypos + ysize > FT_INT_MAX ||\n           ypos + (FT_Long)ysize < FT_INT_MIN )\n      {\n        FT_TRACE1(( \"pfr_slot_load_bitmap:\" ));\n        FT_TRACE1(( \"huge bitmap glyph %dx%d over FT_GlyphSlot\\n\",\n                     xpos, ypos ));\n        error = FT_THROW( Invalid_Pixel_Size );\n      }\n\n      if ( !error )\n      {\n        glyph->root.format = FT_GLYPH_FORMAT_BITMAP;\n\n        /* Set up glyph bitmap and metrics */\n\n        /* XXX: needs casts to fit FT_Bitmap.{width|rows|pitch} */\n        glyph->root.bitmap.width      = (FT_Int)xsize;\n        glyph->root.bitmap.rows       = (FT_Int)ysize;\n        glyph->root.bitmap.pitch      = (FT_Int)( xsize + 7 ) >> 3;\n        glyph->root.bitmap.pixel_mode = FT_PIXEL_MODE_MONO;\n\n        /* XXX: needs casts to fit FT_Glyph_Metrics.{width|height} */\n        glyph->root.metrics.width        = (FT_Pos)xsize << 6;\n        glyph->root.metrics.height       = (FT_Pos)ysize << 6;\n        glyph->root.metrics.horiBearingX = xpos << 6;\n        glyph->root.metrics.horiBearingY = ypos << 6;\n        glyph->root.metrics.horiAdvance  = FT_PIX_ROUND( ( advance >> 2 ) );\n        glyph->root.metrics.vertBearingX = - glyph->root.metrics.width >> 1;\n        glyph->root.metrics.vertBearingY = 0;\n        glyph->root.metrics.vertAdvance  = size->root.metrics.height;\n\n        /* XXX: needs casts fit FT_GlyphSlotRec.bitmap_{left|top} */\n        glyph->root.bitmap_left = (FT_Int)xpos;\n        glyph->root.bitmap_top  = (FT_Int)(ypos + ysize);\n\n        /* Allocate and read bitmap data */\n        {\n          FT_ULong  len = glyph->root.bitmap.pitch * ysize;\n\n\n          error = ft_glyphslot_alloc_bitmap( &glyph->root, len );\n          if ( !error )\n          {\n            error = pfr_load_bitmap_bits(\n                      p,\n                      stream->limit,\n                      format,\n                      FT_BOOL(face->header.color_flags & 2),\n                      &glyph->root.bitmap );\n          }\n        }\n      }\n\n      FT_FRAME_EXIT();\n    }\n\n  Exit:\n    return error;\n  }\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pfr/pfrsbit.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pfrsbit.h                                                              */\n/*                                                                         */\n/*    FreeType PFR bitmap loader (specification).                          */\n/*                                                                         */\n/*  Copyright 2002 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PFRSBIT_H__\n#define __PFRSBIT_H__\n\n#include \"pfrobjs.h\"\n\nFT_BEGIN_HEADER\n\n  FT_LOCAL( FT_Error )\n  pfr_slot_load_bitmap( PFR_Slot  glyph,\n                        PFR_Size  size,\n                        FT_UInt   glyph_index );\n\nFT_END_HEADER\n\n#endif /* __PFR_SBIT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pfr/pfrtypes.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pfrtypes.h                                                             */\n/*                                                                         */\n/*    FreeType PFR data structures (specification only).                   */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2005, 2007 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PFRTYPES_H__\n#define __PFRTYPES_H__\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n\nFT_BEGIN_HEADER\n\n  /************************************************************************/\n\n  /* the PFR Header structure */\n  typedef struct  PFR_HeaderRec_\n  {\n    FT_UInt32  signature;\n    FT_UInt    version;\n    FT_UInt    signature2;\n    FT_UInt    header_size;\n\n    FT_UInt    log_dir_size;\n    FT_UInt    log_dir_offset;\n\n    FT_UInt    log_font_max_size;\n    FT_UInt32  log_font_section_size;\n    FT_UInt32  log_font_section_offset;\n\n    FT_UInt32  phy_font_max_size;\n    FT_UInt32  phy_font_section_size;\n    FT_UInt32  phy_font_section_offset;\n\n    FT_UInt    gps_max_size;\n    FT_UInt32  gps_section_size;\n    FT_UInt32  gps_section_offset;\n\n    FT_UInt    max_blue_values;\n    FT_UInt    max_x_orus;\n    FT_UInt    max_y_orus;\n\n    FT_UInt    phy_font_max_size_high;\n    FT_UInt    color_flags;\n\n    FT_UInt32  bct_max_size;\n    FT_UInt32  bct_set_max_size;\n    FT_UInt32  phy_bct_set_max_size;\n\n    FT_UInt    num_phy_fonts;\n    FT_UInt    max_vert_stem_snap;\n    FT_UInt    max_horz_stem_snap;\n    FT_UInt    max_chars;\n\n  } PFR_HeaderRec, *PFR_Header;\n\n\n  /* used in `color_flags' field of the PFR_Header */\n  typedef enum  PFR_HeaderFlags_\n  {\n    PFR_FLAG_BLACK_PIXEL   = 1,\n    PFR_FLAG_INVERT_BITMAP = 2\n\n  } PFR_HeaderFlags;\n\n\n  /************************************************************************/\n\n  typedef struct  PFR_LogFontRec_\n  {\n    FT_UInt32  size;\n    FT_UInt32  offset;\n\n    FT_Int32   matrix[4];\n    FT_UInt    stroke_flags;\n    FT_Int     stroke_thickness;\n    FT_Int     bold_thickness;\n    FT_Int32   miter_limit;\n\n    FT_UInt32  phys_size;\n    FT_UInt32  phys_offset;\n\n  } PFR_LogFontRec, *PFR_LogFont;\n\n\n  typedef enum  PFR_LogFlags_\n  {\n    PFR_LOG_EXTRA_ITEMS  = 0x40,\n    PFR_LOG_2BYTE_BOLD   = 0x20,\n    PFR_LOG_BOLD         = 0x10,\n    PFR_LOG_2BYTE_STROKE = 8,\n    PFR_LOG_STROKE       = 4,\n    PFR_LINE_JOIN_MASK   = 3\n\n  } PFR_LogFlags;\n\n\n  typedef enum  PFR_LineJoinFlags_\n  {\n    PFR_LINE_JOIN_MITER = 0,\n    PFR_LINE_JOIN_ROUND = 1,\n    PFR_LINE_JOIN_BEVEL = 2\n\n  } PFR_LineJoinFlags;\n\n\n  /************************************************************************/\n\n  typedef enum  PFR_BitmapFlags_\n  {\n    PFR_BITMAP_3BYTE_OFFSET   = 4,\n    PFR_BITMAP_2BYTE_SIZE     = 2,\n    PFR_BITMAP_2BYTE_CHARCODE = 1\n\n  } PFR_BitmapFlags;\n\n\n  typedef struct  PFR_BitmapCharRec_\n  {\n    FT_UInt    char_code;\n    FT_UInt    gps_size;\n    FT_UInt32  gps_offset;\n\n  } PFR_BitmapCharRec, *PFR_BitmapChar;\n\n\n  typedef enum  PFR_StrikeFlags_\n  {\n    PFR_STRIKE_2BYTE_COUNT  = 0x10,\n    PFR_STRIKE_3BYTE_OFFSET = 0x08,\n    PFR_STRIKE_3BYTE_SIZE   = 0x04,\n    PFR_STRIKE_2BYTE_YPPM   = 0x02,\n    PFR_STRIKE_2BYTE_XPPM   = 0x01\n\n  } PFR_StrikeFlags;\n\n\n  typedef struct  PFR_StrikeRec_\n  {\n    FT_UInt         x_ppm;\n    FT_UInt         y_ppm;\n    FT_UInt         flags;\n\n    FT_UInt32       gps_size;\n    FT_UInt32       gps_offset;\n\n    FT_UInt32       bct_size;\n    FT_UInt32       bct_offset;\n\n    /* optional */\n    FT_UInt         num_bitmaps;\n    PFR_BitmapChar  bitmaps;\n\n  } PFR_StrikeRec, *PFR_Strike;\n\n\n  /************************************************************************/\n\n  typedef struct  PFR_CharRec_\n  {\n    FT_UInt    char_code;\n    FT_Int     advance;\n    FT_UInt    gps_size;\n    FT_UInt32  gps_offset;\n\n  } PFR_CharRec, *PFR_Char;\n\n\n  /************************************************************************/\n\n  typedef struct  PFR_DimensionRec_\n  {\n    FT_UInt  standard;\n    FT_UInt  num_stem_snaps;\n    FT_Int*  stem_snaps;\n\n  } PFR_DimensionRec, *PFR_Dimension;\n\n  /************************************************************************/\n\n  typedef struct PFR_KernItemRec_*  PFR_KernItem;\n\n  typedef struct  PFR_KernItemRec_\n  {\n    PFR_KernItem  next;\n    FT_Byte       pair_count;\n    FT_Byte       flags;\n    FT_Short      base_adj;\n    FT_UInt       pair_size;\n    FT_Offset     offset;\n    FT_UInt32     pair1;\n    FT_UInt32     pair2;\n\n  } PFR_KernItemRec;\n\n\n#define PFR_KERN_INDEX( g1, g2 )                          \\\n          ( ( (FT_UInt32)(g1) << 16 ) | (FT_UInt16)(g2) )\n\n#define PFR_KERN_PAIR_INDEX( pair )                        \\\n          PFR_KERN_INDEX( (pair)->glyph1, (pair)->glyph2 )\n\n#define PFR_NEXT_KPAIR( p )  ( p += 2,                              \\\n                               ( (FT_UInt32)p[-2] << 16 ) | p[-1] )\n\n\n  /************************************************************************/\n\n  typedef struct  PFR_PhyFontRec_\n  {\n    FT_Memory          memory;\n    FT_UInt32          offset;\n\n    FT_UInt            font_ref_number;\n    FT_UInt            outline_resolution;\n    FT_UInt            metrics_resolution;\n    FT_BBox            bbox;\n    FT_UInt            flags;\n    FT_UInt            standard_advance;\n\n    FT_Int             ascent;   /* optional, bbox.yMax if not present */\n    FT_Int             descent;  /* optional, bbox.yMin if not present */\n    FT_Int             leading;  /* optional, 0 if not present         */\n\n    PFR_DimensionRec   horizontal;\n    PFR_DimensionRec   vertical;\n\n    FT_String*         font_id;\n    FT_String*         family_name;\n    FT_String*         style_name;\n\n    FT_UInt            num_strikes;\n    FT_UInt            max_strikes;\n    PFR_StrikeRec*     strikes;\n\n    FT_UInt            num_blue_values;\n    FT_Int            *blue_values;\n    FT_UInt            blue_fuzz;\n    FT_UInt            blue_scale;\n\n    FT_UInt            num_chars;\n    FT_Offset          chars_offset;\n    PFR_Char           chars;\n\n    FT_UInt            num_kern_pairs;\n    PFR_KernItem       kern_items;\n    PFR_KernItem*      kern_items_tail;\n\n    /* not part of the spec, but used during load */\n    FT_Long            bct_offset;\n    FT_Byte*           cursor;\n\n  } PFR_PhyFontRec, *PFR_PhyFont;\n\n\n  typedef enum  PFR_PhyFlags_\n  {\n    PFR_PHY_EXTRA_ITEMS      = 0x80,\n    PFR_PHY_3BYTE_GPS_OFFSET = 0x20,\n    PFR_PHY_2BYTE_GPS_SIZE   = 0x10,\n    PFR_PHY_ASCII_CODE       = 0x08,\n    PFR_PHY_PROPORTIONAL     = 0x04,\n    PFR_PHY_2BYTE_CHARCODE   = 0x02,\n    PFR_PHY_VERTICAL         = 0x01\n\n  } PFR_PhyFlags;\n\n\n  typedef enum PFR_KernFlags_\n  {\n    PFR_KERN_2BYTE_CHAR  = 0x01,\n    PFR_KERN_2BYTE_ADJ   = 0x02\n\n  } PFR_KernFlags;\n\n\n  /************************************************************************/\n\n  typedef enum  PFR_GlyphFlags_\n  {\n    PFR_GLYPH_IS_COMPOUND   = 0x80,\n    PFR_GLYPH_EXTRA_ITEMS   = 0x08,\n    PFR_GLYPH_1BYTE_XYCOUNT = 0x04,\n    PFR_GLYPH_XCOUNT        = 0x02,\n    PFR_GLYPH_YCOUNT        = 0x01\n\n  } PFR_GlyphFlags;\n\n\n  /* controlled coordinate */\n  typedef struct  PFR_CoordRec_\n  {\n    FT_UInt  org;\n    FT_UInt  cur;\n\n  } PFR_CoordRec, *PFR_Coord;\n\n\n  typedef struct  PFR_SubGlyphRec_\n  {\n    FT_Fixed   x_scale;\n    FT_Fixed   y_scale;\n    FT_Int     x_delta;\n    FT_Int     y_delta;\n    FT_UInt32  gps_offset;\n    FT_UInt    gps_size;\n\n  } PFR_SubGlyphRec, *PFR_SubGlyph;\n\n\n  typedef enum  PFR_SubgGlyphFlags_\n  {\n    PFR_SUBGLYPH_3BYTE_OFFSET = 0x80,\n    PFR_SUBGLYPH_2BYTE_SIZE   = 0x40,\n    PFR_SUBGLYPH_YSCALE       = 0x20,\n    PFR_SUBGLYPH_XSCALE       = 0x10\n\n  } PFR_SubGlyphFlags;\n\n\n  typedef struct  PFR_GlyphRec_\n  {\n    FT_Byte           format;\n\n#if 0\n    FT_UInt           num_x_control;\n    FT_UInt           num_y_control;\n#endif\n    FT_UInt           max_xy_control;\n    FT_Pos*           x_control;\n    FT_Pos*           y_control;\n\n\n    FT_UInt           num_subs;\n    FT_UInt           max_subs;\n    PFR_SubGlyphRec*  subs;\n\n    FT_GlyphLoader    loader;\n    FT_Bool           path_begun;\n\n  } PFR_GlyphRec, *PFR_Glyph;\n\n\nFT_END_HEADER\n\n#endif /* __PFRTYPES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pfr/rules.mk",
    "content": "#\n# FreeType 2 PFR driver configuration rules\n#\n\n\n# Copyright 2002, 2003 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\n# pfr driver directory\n#\nPFR_DIR := $(SRC_DIR)/pfr\n\n\n# compilation flags for the driver\n#\nPFR_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PFR_DIR))\n\n\n# pfr driver sources (i.e., C files)\n#\nPFR_DRV_SRC := $(PFR_DIR)/pfrload.c  \\\n               $(PFR_DIR)/pfrgload.c \\\n               $(PFR_DIR)/pfrcmap.c  \\\n               $(PFR_DIR)/pfrdrivr.c \\\n               $(PFR_DIR)/pfrsbit.c  \\\n               $(PFR_DIR)/pfrobjs.c\n\n# pfr driver headers\n#\nPFR_DRV_H := $(PFR_DRV_SRC:%.c=%.h) \\\n             $(PFR_DIR)/pfrerror.h  \\\n             $(PFR_DIR)/pfrtypes.h\n\n\n# Pfr driver object(s)\n#\n#   PFR_DRV_OBJ_M is used during `multi' builds\n#   PFR_DRV_OBJ_S is used during `single' builds\n#\nPFR_DRV_OBJ_M := $(PFR_DRV_SRC:$(PFR_DIR)/%.c=$(OBJ_DIR)/%.$O)\nPFR_DRV_OBJ_S := $(OBJ_DIR)/pfr.$O\n\n# pfr driver source file for single build\n#\nPFR_DRV_SRC_S := $(PFR_DIR)/pfr.c\n\n\n# pfr driver - single object\n#\n$(PFR_DRV_OBJ_S): $(PFR_DRV_SRC_S) $(PFR_DRV_SRC) $(FREETYPE_H) $(PFR_DRV_H)\n\t$(PFR_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PFR_DRV_SRC_S))\n\n\n# pfr driver - multiple objects\n#\n$(OBJ_DIR)/%.$O: $(PFR_DIR)/%.c $(FREETYPE_H) $(PFR_DRV_H)\n\t$(PFR_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\n\n\n# update main driver object lists\n#\nDRV_OBJS_S += $(PFR_DRV_OBJ_S)\nDRV_OBJS_M += $(PFR_DRV_OBJ_M)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/psaux/Jamfile",
    "content": "# FreeType 2 src/psaux Jamfile\n#\n# Copyright 2001, 2002 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) psaux ;\n\n{\n  local  _sources ;\n\n  if $(FT2_MULTI)\n  {\n    _sources = psauxmod psobjs   t1decode t1cmap\n               psconv   afmparse\n               ;\n  }\n  else\n  {\n    _sources = psaux ;\n  }\n\n  Library  $(FT2_LIB) : $(_sources).c ;\n}\n\n# end of src/psaux Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/psaux/afmparse.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afmparse.c                                                             */\n/*                                                                         */\n/*    AFM parser (body).                                                   */\n/*                                                                         */\n/*  Copyright 2006-2010, 2012, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_POSTSCRIPT_AUX_H\n\n#include \"afmparse.h\"\n#include \"psconv.h\"\n\n#include \"psauxerr.h\"\n\n\n/***************************************************************************/\n/*                                                                         */\n/*    AFM_Stream                                                           */\n/*                                                                         */\n/* The use of AFM_Stream is largely inspired by parseAFM.[ch] from t1lib.  */\n/*                                                                         */\n/*                                                                         */\n\n  enum\n  {\n    AFM_STREAM_STATUS_NORMAL,\n    AFM_STREAM_STATUS_EOC,\n    AFM_STREAM_STATUS_EOL,\n    AFM_STREAM_STATUS_EOF\n  };\n\n\n  typedef struct  AFM_StreamRec_\n  {\n    FT_Byte*  cursor;\n    FT_Byte*  base;\n    FT_Byte*  limit;\n\n    FT_Int    status;\n\n  } AFM_StreamRec;\n\n\n#ifndef EOF\n#define EOF -1\n#endif\n\n\n  /* this works because empty lines are ignored */\n#define AFM_IS_NEWLINE( ch )  ( (ch) == '\\r' || (ch) == '\\n' )\n\n#define AFM_IS_EOF( ch )      ( (ch) == EOF  || (ch) == '\\x1a' )\n#define AFM_IS_SPACE( ch )    ( (ch) == ' '  || (ch) == '\\t' )\n\n  /* column separator; there is no `column' in the spec actually */\n#define AFM_IS_SEP( ch )      ( (ch) == ';' )\n\n#define AFM_GETC()                                                       \\\n          ( ( (stream)->cursor < (stream)->limit ) ? *(stream)->cursor++ \\\n                                                   : EOF )\n\n#define AFM_STREAM_KEY_BEGIN( stream )    \\\n          (char*)( (stream)->cursor - 1 )\n\n#define AFM_STREAM_KEY_LEN( stream, key )       \\\n          ( (char*)(stream)->cursor - key - 1 )\n\n#define AFM_STATUS_EOC( stream ) \\\n          ( (stream)->status >= AFM_STREAM_STATUS_EOC )\n\n#define AFM_STATUS_EOL( stream ) \\\n          ( (stream)->status >= AFM_STREAM_STATUS_EOL )\n\n#define AFM_STATUS_EOF( stream ) \\\n          ( (stream)->status >= AFM_STREAM_STATUS_EOF )\n\n\n  static int\n  afm_stream_skip_spaces( AFM_Stream  stream )\n  {\n    int  ch = 0;  /* make stupid compiler happy */\n\n\n    if ( AFM_STATUS_EOC( stream ) )\n      return ';';\n\n    while ( 1 )\n    {\n      ch = AFM_GETC();\n      if ( !AFM_IS_SPACE( ch ) )\n        break;\n    }\n\n    if ( AFM_IS_NEWLINE( ch ) )\n      stream->status = AFM_STREAM_STATUS_EOL;\n    else if ( AFM_IS_SEP( ch ) )\n      stream->status = AFM_STREAM_STATUS_EOC;\n    else if ( AFM_IS_EOF( ch ) )\n      stream->status = AFM_STREAM_STATUS_EOF;\n\n    return ch;\n  }\n\n\n  /* read a key or value in current column */\n  static char*\n  afm_stream_read_one( AFM_Stream  stream )\n  {\n    char*  str;\n\n\n    afm_stream_skip_spaces( stream );\n    if ( AFM_STATUS_EOC( stream ) )\n      return NULL;\n\n    str = AFM_STREAM_KEY_BEGIN( stream );\n\n    while ( 1 )\n    {\n      int  ch = AFM_GETC();\n\n\n      if ( AFM_IS_SPACE( ch ) )\n        break;\n      else if ( AFM_IS_NEWLINE( ch ) )\n      {\n        stream->status = AFM_STREAM_STATUS_EOL;\n        break;\n      }\n      else if ( AFM_IS_SEP( ch ) )\n      {\n        stream->status = AFM_STREAM_STATUS_EOC;\n        break;\n      }\n      else if ( AFM_IS_EOF( ch ) )\n      {\n        stream->status = AFM_STREAM_STATUS_EOF;\n        break;\n      }\n    }\n\n    return str;\n  }\n\n\n  /* read a string (i.e., read to EOL) */\n  static char*\n  afm_stream_read_string( AFM_Stream  stream )\n  {\n    char*  str;\n\n\n    afm_stream_skip_spaces( stream );\n    if ( AFM_STATUS_EOL( stream ) )\n      return NULL;\n\n    str = AFM_STREAM_KEY_BEGIN( stream );\n\n    /* scan to eol */\n    while ( 1 )\n    {\n      int  ch = AFM_GETC();\n\n\n      if ( AFM_IS_NEWLINE( ch ) )\n      {\n        stream->status = AFM_STREAM_STATUS_EOL;\n        break;\n      }\n      else if ( AFM_IS_EOF( ch ) )\n      {\n        stream->status = AFM_STREAM_STATUS_EOF;\n        break;\n      }\n    }\n\n    return str;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*    AFM_Parser                                                         */\n  /*                                                                       */\n  /*                                                                       */\n\n  /* all keys defined in Ch. 7-10 of 5004.AFM_Spec.pdf */\n  typedef enum  AFM_Token_\n  {\n    AFM_TOKEN_ASCENDER,\n    AFM_TOKEN_AXISLABEL,\n    AFM_TOKEN_AXISTYPE,\n    AFM_TOKEN_B,\n    AFM_TOKEN_BLENDAXISTYPES,\n    AFM_TOKEN_BLENDDESIGNMAP,\n    AFM_TOKEN_BLENDDESIGNPOSITIONS,\n    AFM_TOKEN_C,\n    AFM_TOKEN_CC,\n    AFM_TOKEN_CH,\n    AFM_TOKEN_CAPHEIGHT,\n    AFM_TOKEN_CHARWIDTH,\n    AFM_TOKEN_CHARACTERSET,\n    AFM_TOKEN_CHARACTERS,\n    AFM_TOKEN_DESCENDER,\n    AFM_TOKEN_ENCODINGSCHEME,\n    AFM_TOKEN_ENDAXIS,\n    AFM_TOKEN_ENDCHARMETRICS,\n    AFM_TOKEN_ENDCOMPOSITES,\n    AFM_TOKEN_ENDDIRECTION,\n    AFM_TOKEN_ENDFONTMETRICS,\n    AFM_TOKEN_ENDKERNDATA,\n    AFM_TOKEN_ENDKERNPAIRS,\n    AFM_TOKEN_ENDTRACKKERN,\n    AFM_TOKEN_ESCCHAR,\n    AFM_TOKEN_FAMILYNAME,\n    AFM_TOKEN_FONTBBOX,\n    AFM_TOKEN_FONTNAME,\n    AFM_TOKEN_FULLNAME,\n    AFM_TOKEN_ISBASEFONT,\n    AFM_TOKEN_ISCIDFONT,\n    AFM_TOKEN_ISFIXEDPITCH,\n    AFM_TOKEN_ISFIXEDV,\n    AFM_TOKEN_ITALICANGLE,\n    AFM_TOKEN_KP,\n    AFM_TOKEN_KPH,\n    AFM_TOKEN_KPX,\n    AFM_TOKEN_KPY,\n    AFM_TOKEN_L,\n    AFM_TOKEN_MAPPINGSCHEME,\n    AFM_TOKEN_METRICSSETS,\n    AFM_TOKEN_N,\n    AFM_TOKEN_NOTICE,\n    AFM_TOKEN_PCC,\n    AFM_TOKEN_STARTAXIS,\n    AFM_TOKEN_STARTCHARMETRICS,\n    AFM_TOKEN_STARTCOMPOSITES,\n    AFM_TOKEN_STARTDIRECTION,\n    AFM_TOKEN_STARTFONTMETRICS,\n    AFM_TOKEN_STARTKERNDATA,\n    AFM_TOKEN_STARTKERNPAIRS,\n    AFM_TOKEN_STARTKERNPAIRS0,\n    AFM_TOKEN_STARTKERNPAIRS1,\n    AFM_TOKEN_STARTTRACKKERN,\n    AFM_TOKEN_STDHW,\n    AFM_TOKEN_STDVW,\n    AFM_TOKEN_TRACKKERN,\n    AFM_TOKEN_UNDERLINEPOSITION,\n    AFM_TOKEN_UNDERLINETHICKNESS,\n    AFM_TOKEN_VV,\n    AFM_TOKEN_VVECTOR,\n    AFM_TOKEN_VERSION,\n    AFM_TOKEN_W,\n    AFM_TOKEN_W0,\n    AFM_TOKEN_W0X,\n    AFM_TOKEN_W0Y,\n    AFM_TOKEN_W1,\n    AFM_TOKEN_W1X,\n    AFM_TOKEN_W1Y,\n    AFM_TOKEN_WX,\n    AFM_TOKEN_WY,\n    AFM_TOKEN_WEIGHT,\n    AFM_TOKEN_WEIGHTVECTOR,\n    AFM_TOKEN_XHEIGHT,\n    N_AFM_TOKENS,\n    AFM_TOKEN_UNKNOWN\n\n  } AFM_Token;\n\n\n  static const char*  const afm_key_table[N_AFM_TOKENS] =\n  {\n    \"Ascender\",\n    \"AxisLabel\",\n    \"AxisType\",\n    \"B\",\n    \"BlendAxisTypes\",\n    \"BlendDesignMap\",\n    \"BlendDesignPositions\",\n    \"C\",\n    \"CC\",\n    \"CH\",\n    \"CapHeight\",\n    \"CharWidth\",\n    \"CharacterSet\",\n    \"Characters\",\n    \"Descender\",\n    \"EncodingScheme\",\n    \"EndAxis\",\n    \"EndCharMetrics\",\n    \"EndComposites\",\n    \"EndDirection\",\n    \"EndFontMetrics\",\n    \"EndKernData\",\n    \"EndKernPairs\",\n    \"EndTrackKern\",\n    \"EscChar\",\n    \"FamilyName\",\n    \"FontBBox\",\n    \"FontName\",\n    \"FullName\",\n    \"IsBaseFont\",\n    \"IsCIDFont\",\n    \"IsFixedPitch\",\n    \"IsFixedV\",\n    \"ItalicAngle\",\n    \"KP\",\n    \"KPH\",\n    \"KPX\",\n    \"KPY\",\n    \"L\",\n    \"MappingScheme\",\n    \"MetricsSets\",\n    \"N\",\n    \"Notice\",\n    \"PCC\",\n    \"StartAxis\",\n    \"StartCharMetrics\",\n    \"StartComposites\",\n    \"StartDirection\",\n    \"StartFontMetrics\",\n    \"StartKernData\",\n    \"StartKernPairs\",\n    \"StartKernPairs0\",\n    \"StartKernPairs1\",\n    \"StartTrackKern\",\n    \"StdHW\",\n    \"StdVW\",\n    \"TrackKern\",\n    \"UnderlinePosition\",\n    \"UnderlineThickness\",\n    \"VV\",\n    \"VVector\",\n    \"Version\",\n    \"W\",\n    \"W0\",\n    \"W0X\",\n    \"W0Y\",\n    \"W1\",\n    \"W1X\",\n    \"W1Y\",\n    \"WX\",\n    \"WY\",\n    \"Weight\",\n    \"WeightVector\",\n    \"XHeight\"\n  };\n\n\n  /*\n   * `afm_parser_read_vals' and `afm_parser_next_key' provide\n   * high-level operations to an AFM_Stream.  The rest of the\n   * parser functions should use them without accessing the\n   * AFM_Stream directly.\n   */\n\n  FT_LOCAL_DEF( FT_Int )\n  afm_parser_read_vals( AFM_Parser  parser,\n                        AFM_Value   vals,\n                        FT_UInt     n )\n  {\n    AFM_Stream  stream = parser->stream;\n    char*       str;\n    FT_UInt     i;\n\n\n    if ( n > AFM_MAX_ARGUMENTS )\n      return 0;\n\n    for ( i = 0; i < n; i++ )\n    {\n      FT_Offset  len;\n      AFM_Value  val = vals + i;\n\n\n      if ( val->type == AFM_VALUE_TYPE_STRING )\n        str = afm_stream_read_string( stream );\n      else\n        str = afm_stream_read_one( stream );\n\n      if ( !str )\n        break;\n\n      len = AFM_STREAM_KEY_LEN( stream, str );\n\n      switch ( val->type )\n      {\n      case AFM_VALUE_TYPE_STRING:\n      case AFM_VALUE_TYPE_NAME:\n        {\n          FT_Memory  memory = parser->memory;\n          FT_Error   error;\n\n\n          if ( !FT_QALLOC( val->u.s, len + 1 ) )\n          {\n            ft_memcpy( val->u.s, str, len );\n            val->u.s[len] = '\\0';\n          }\n        }\n        break;\n\n      case AFM_VALUE_TYPE_FIXED:\n        val->u.f = PS_Conv_ToFixed( (FT_Byte**)(void*)&str,\n                                    (FT_Byte*)str + len, 0 );\n        break;\n\n      case AFM_VALUE_TYPE_INTEGER:\n        val->u.i = PS_Conv_ToInt( (FT_Byte**)(void*)&str,\n                                  (FT_Byte*)str + len );\n        break;\n\n      case AFM_VALUE_TYPE_BOOL:\n        val->u.b = FT_BOOL( len == 4                      &&\n                            !ft_strncmp( str, \"true\", 4 ) );\n        break;\n\n      case AFM_VALUE_TYPE_INDEX:\n        if ( parser->get_index )\n          val->u.i = parser->get_index( str, len, parser->user_data );\n        else\n          val->u.i = 0;\n        break;\n      }\n    }\n\n    return i;\n  }\n\n\n  FT_LOCAL_DEF( char* )\n  afm_parser_next_key( AFM_Parser  parser,\n                       FT_Bool     line,\n                       FT_Offset*  len )\n  {\n    AFM_Stream  stream = parser->stream;\n    char*       key    = 0;  /* make stupid compiler happy */\n\n\n    if ( line )\n    {\n      while ( 1 )\n      {\n        /* skip current line */\n        if ( !AFM_STATUS_EOL( stream ) )\n          afm_stream_read_string( stream );\n\n        stream->status = AFM_STREAM_STATUS_NORMAL;\n        key = afm_stream_read_one( stream );\n\n        /* skip empty line */\n        if ( !key                      &&\n             !AFM_STATUS_EOF( stream ) &&\n             AFM_STATUS_EOL( stream )  )\n          continue;\n\n        break;\n      }\n    }\n    else\n    {\n      while ( 1 )\n      {\n        /* skip current column */\n        while ( !AFM_STATUS_EOC( stream ) )\n          afm_stream_read_one( stream );\n\n        stream->status = AFM_STREAM_STATUS_NORMAL;\n        key = afm_stream_read_one( stream );\n\n        /* skip empty column */\n        if ( !key                      &&\n             !AFM_STATUS_EOF( stream ) &&\n             AFM_STATUS_EOC( stream )  )\n          continue;\n\n        break;\n      }\n    }\n\n    if ( len )\n      *len = ( key ) ? (FT_Offset)AFM_STREAM_KEY_LEN( stream, key )\n                     : 0;\n\n    return key;\n  }\n\n\n  static AFM_Token\n  afm_tokenize( const char*  key,\n                FT_Offset    len )\n  {\n    int  n;\n\n\n    for ( n = 0; n < N_AFM_TOKENS; n++ )\n    {\n      if ( *( afm_key_table[n] ) == *key )\n      {\n        for ( ; n < N_AFM_TOKENS; n++ )\n        {\n          if ( *( afm_key_table[n] ) != *key )\n            return AFM_TOKEN_UNKNOWN;\n\n          if ( ft_strncmp( afm_key_table[n], key, len ) == 0 )\n            return (AFM_Token) n;\n        }\n      }\n    }\n\n    return AFM_TOKEN_UNKNOWN;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  afm_parser_init( AFM_Parser  parser,\n                   FT_Memory   memory,\n                   FT_Byte*    base,\n                   FT_Byte*    limit )\n  {\n    AFM_Stream  stream = NULL;\n    FT_Error    error;\n\n\n    if ( FT_NEW( stream ) )\n      return error;\n\n    stream->cursor = stream->base = base;\n    stream->limit  = limit;\n\n    /* don't skip the first line during the first call */\n    stream->status = AFM_STREAM_STATUS_EOL;\n\n    parser->memory    = memory;\n    parser->stream    = stream;\n    parser->FontInfo  = NULL;\n    parser->get_index = NULL;\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_LOCAL( void )\n  afm_parser_done( AFM_Parser  parser )\n  {\n    FT_Memory  memory = parser->memory;\n\n\n    FT_FREE( parser->stream );\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  afm_parser_read_int( AFM_Parser  parser,\n                       FT_Int*     aint )\n  {\n    AFM_ValueRec  val;\n\n\n    val.type = AFM_VALUE_TYPE_INTEGER;\n\n    if ( afm_parser_read_vals( parser, &val, 1 ) == 1 )\n    {\n      *aint = val.u.i;\n\n      return FT_Err_Ok;\n    }\n    else\n      return FT_THROW( Syntax_Error );\n  }\n\n\n  static FT_Error\n  afm_parse_track_kern( AFM_Parser  parser )\n  {\n    AFM_FontInfo   fi = parser->FontInfo;\n    AFM_TrackKern  tk;\n    char*          key;\n    FT_Offset      len;\n    int            n = -1;\n\n\n    if ( afm_parser_read_int( parser, &fi->NumTrackKern ) )\n        goto Fail;\n\n    if ( fi->NumTrackKern )\n    {\n      FT_Memory  memory = parser->memory;\n      FT_Error   error;\n\n\n      if ( FT_QNEW_ARRAY( fi->TrackKerns, fi->NumTrackKern ) )\n        return error;\n    }\n\n    while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 )\n    {\n      AFM_ValueRec  shared_vals[5];\n\n\n      switch ( afm_tokenize( key, len ) )\n      {\n      case AFM_TOKEN_TRACKKERN:\n        n++;\n\n        if ( n >= fi->NumTrackKern )\n          goto Fail;\n\n        tk = fi->TrackKerns + n;\n\n        shared_vals[0].type = AFM_VALUE_TYPE_INTEGER;\n        shared_vals[1].type = AFM_VALUE_TYPE_FIXED;\n        shared_vals[2].type = AFM_VALUE_TYPE_FIXED;\n        shared_vals[3].type = AFM_VALUE_TYPE_FIXED;\n        shared_vals[4].type = AFM_VALUE_TYPE_FIXED;\n        if ( afm_parser_read_vals( parser, shared_vals, 5 ) != 5 )\n          goto Fail;\n\n        tk->degree     = shared_vals[0].u.i;\n        tk->min_ptsize = shared_vals[1].u.f;\n        tk->min_kern   = shared_vals[2].u.f;\n        tk->max_ptsize = shared_vals[3].u.f;\n        tk->max_kern   = shared_vals[4].u.f;\n\n        break;\n\n      case AFM_TOKEN_ENDTRACKKERN:\n      case AFM_TOKEN_ENDKERNDATA:\n      case AFM_TOKEN_ENDFONTMETRICS:\n        fi->NumTrackKern = n + 1;\n        return FT_Err_Ok;\n\n      case AFM_TOKEN_UNKNOWN:\n        break;\n\n      default:\n        goto Fail;\n      }\n    }\n\n  Fail:\n    return FT_THROW( Syntax_Error );\n  }\n\n\n#undef  KERN_INDEX\n#define KERN_INDEX( g1, g2 )  ( ( (FT_ULong)g1 << 16 ) | g2 )\n\n\n  /* compare two kerning pairs */\n  FT_CALLBACK_DEF( int )\n  afm_compare_kern_pairs( const void*  a,\n                          const void*  b )\n  {\n    AFM_KernPair  kp1 = (AFM_KernPair)a;\n    AFM_KernPair  kp2 = (AFM_KernPair)b;\n\n    FT_ULong  index1 = KERN_INDEX( kp1->index1, kp1->index2 );\n    FT_ULong  index2 = KERN_INDEX( kp2->index1, kp2->index2 );\n\n\n    if ( index1 > index2 )\n      return 1;\n    else if ( index1 < index2 )\n      return -1;\n    else\n      return 0;\n  }\n\n\n  static FT_Error\n  afm_parse_kern_pairs( AFM_Parser  parser )\n  {\n    AFM_FontInfo  fi = parser->FontInfo;\n    AFM_KernPair  kp;\n    char*         key;\n    FT_Offset     len;\n    int           n = -1;\n\n\n    if ( afm_parser_read_int( parser, &fi->NumKernPair ) )\n      goto Fail;\n\n    if ( fi->NumKernPair )\n    {\n      FT_Memory  memory = parser->memory;\n      FT_Error   error;\n\n\n      if ( FT_QNEW_ARRAY( fi->KernPairs, fi->NumKernPair ) )\n        return error;\n    }\n\n    while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 )\n    {\n      AFM_Token  token = afm_tokenize( key, len );\n\n\n      switch ( token )\n      {\n      case AFM_TOKEN_KP:\n      case AFM_TOKEN_KPX:\n      case AFM_TOKEN_KPY:\n        {\n          FT_Int        r;\n          AFM_ValueRec  shared_vals[4];\n\n\n          n++;\n\n          if ( n >= fi->NumKernPair )\n            goto Fail;\n\n          kp = fi->KernPairs + n;\n\n          shared_vals[0].type = AFM_VALUE_TYPE_INDEX;\n          shared_vals[1].type = AFM_VALUE_TYPE_INDEX;\n          shared_vals[2].type = AFM_VALUE_TYPE_INTEGER;\n          shared_vals[3].type = AFM_VALUE_TYPE_INTEGER;\n          r = afm_parser_read_vals( parser, shared_vals, 4 );\n          if ( r < 3 )\n            goto Fail;\n\n          kp->index1 = shared_vals[0].u.i;\n          kp->index2 = shared_vals[1].u.i;\n          if ( token == AFM_TOKEN_KPY )\n          {\n            kp->x = 0;\n            kp->y = shared_vals[2].u.i;\n          }\n          else\n          {\n            kp->x = shared_vals[2].u.i;\n            kp->y = ( token == AFM_TOKEN_KP && r == 4 )\n                      ? shared_vals[3].u.i : 0;\n          }\n        }\n        break;\n\n      case AFM_TOKEN_ENDKERNPAIRS:\n      case AFM_TOKEN_ENDKERNDATA:\n      case AFM_TOKEN_ENDFONTMETRICS:\n        fi->NumKernPair = n + 1;\n        ft_qsort( fi->KernPairs, fi->NumKernPair,\n                  sizeof ( AFM_KernPairRec ),\n                  afm_compare_kern_pairs );\n        return FT_Err_Ok;\n\n      case AFM_TOKEN_UNKNOWN:\n        break;\n\n      default:\n        goto Fail;\n      }\n    }\n\n  Fail:\n    return FT_THROW( Syntax_Error );\n  }\n\n\n  static FT_Error\n  afm_parse_kern_data( AFM_Parser  parser )\n  {\n    FT_Error   error;\n    char*      key;\n    FT_Offset  len;\n\n\n    while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 )\n    {\n      switch ( afm_tokenize( key, len ) )\n      {\n      case AFM_TOKEN_STARTTRACKKERN:\n        error = afm_parse_track_kern( parser );\n        if ( error )\n          return error;\n        break;\n\n      case AFM_TOKEN_STARTKERNPAIRS:\n      case AFM_TOKEN_STARTKERNPAIRS0:\n        error = afm_parse_kern_pairs( parser );\n        if ( error )\n          return error;\n        break;\n\n      case AFM_TOKEN_ENDKERNDATA:\n      case AFM_TOKEN_ENDFONTMETRICS:\n        return FT_Err_Ok;\n\n      case AFM_TOKEN_UNKNOWN:\n        break;\n\n      default:\n        goto Fail;\n      }\n    }\n\n  Fail:\n    return FT_THROW( Syntax_Error );\n  }\n\n\n  static FT_Error\n  afm_parser_skip_section( AFM_Parser  parser,\n                           FT_UInt     n,\n                           AFM_Token   end_section )\n  {\n    char*      key;\n    FT_Offset  len;\n\n\n    while ( n-- > 0 )\n    {\n      key = afm_parser_next_key( parser, 1, NULL );\n      if ( !key )\n        goto Fail;\n    }\n\n    while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 )\n    {\n      AFM_Token  token = afm_tokenize( key, len );\n\n\n      if ( token == end_section || token == AFM_TOKEN_ENDFONTMETRICS )\n        return FT_Err_Ok;\n    }\n\n  Fail:\n    return FT_THROW( Syntax_Error );\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  afm_parser_parse( AFM_Parser  parser )\n  {\n    FT_Memory     memory = parser->memory;\n    AFM_FontInfo  fi     = parser->FontInfo;\n    FT_Error      error  = FT_ERR( Syntax_Error );\n    char*         key;\n    FT_Offset     len;\n    FT_Int        metrics_sets = 0;\n\n\n    if ( !fi )\n      return FT_THROW( Invalid_Argument );\n\n    key = afm_parser_next_key( parser, 1, &len );\n    if ( !key || len != 16                              ||\n         ft_strncmp( key, \"StartFontMetrics\", 16 ) != 0 )\n      return FT_THROW( Unknown_File_Format );\n\n    while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 )\n    {\n      AFM_ValueRec  shared_vals[4];\n\n\n      switch ( afm_tokenize( key, len ) )\n      {\n      case AFM_TOKEN_METRICSSETS:\n        if ( afm_parser_read_int( parser, &metrics_sets ) )\n          goto Fail;\n\n        if ( metrics_sets != 0 && metrics_sets != 2 )\n        {\n          error = FT_THROW( Unimplemented_Feature );\n\n          goto Fail;\n        }\n        break;\n\n      case AFM_TOKEN_ISCIDFONT:\n        shared_vals[0].type = AFM_VALUE_TYPE_BOOL;\n        if ( afm_parser_read_vals( parser, shared_vals, 1 ) != 1 )\n          goto Fail;\n\n        fi->IsCIDFont = shared_vals[0].u.b;\n        break;\n\n      case AFM_TOKEN_FONTBBOX:\n        shared_vals[0].type = AFM_VALUE_TYPE_FIXED;\n        shared_vals[1].type = AFM_VALUE_TYPE_FIXED;\n        shared_vals[2].type = AFM_VALUE_TYPE_FIXED;\n        shared_vals[3].type = AFM_VALUE_TYPE_FIXED;\n        if ( afm_parser_read_vals( parser, shared_vals, 4 ) != 4 )\n          goto Fail;\n\n        fi->FontBBox.xMin = shared_vals[0].u.f;\n        fi->FontBBox.yMin = shared_vals[1].u.f;\n        fi->FontBBox.xMax = shared_vals[2].u.f;\n        fi->FontBBox.yMax = shared_vals[3].u.f;\n        break;\n\n      case AFM_TOKEN_ASCENDER:\n        shared_vals[0].type = AFM_VALUE_TYPE_FIXED;\n        if ( afm_parser_read_vals( parser, shared_vals, 1 ) != 1 )\n          goto Fail;\n\n        fi->Ascender = shared_vals[0].u.f;\n        break;\n\n      case AFM_TOKEN_DESCENDER:\n        shared_vals[0].type = AFM_VALUE_TYPE_FIXED;\n        if ( afm_parser_read_vals( parser, shared_vals, 1 ) != 1 )\n          goto Fail;\n\n        fi->Descender = shared_vals[0].u.f;\n        break;\n\n      case AFM_TOKEN_STARTCHARMETRICS:\n        {\n          FT_Int  n = 0;\n\n\n          if ( afm_parser_read_int( parser, &n ) )\n            goto Fail;\n\n          error = afm_parser_skip_section( parser, n,\n                                           AFM_TOKEN_ENDCHARMETRICS );\n          if ( error )\n            return error;\n        }\n        break;\n\n      case AFM_TOKEN_STARTKERNDATA:\n        error = afm_parse_kern_data( parser );\n        if ( error )\n          goto Fail;\n        /* fall through since we only support kern data */\n\n      case AFM_TOKEN_ENDFONTMETRICS:\n        return FT_Err_Ok;\n\n      default:\n        break;\n      }\n    }\n\n  Fail:\n    FT_FREE( fi->TrackKerns );\n    fi->NumTrackKern = 0;\n\n    FT_FREE( fi->KernPairs );\n    fi->NumKernPair = 0;\n\n    fi->IsCIDFont = 0;\n\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/psaux/afmparse.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  afmparse.h                                                             */\n/*                                                                         */\n/*    AFM parser (specification).                                          */\n/*                                                                         */\n/*  Copyright 2006 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __AFMPARSE_H__\n#define __AFMPARSE_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_POSTSCRIPT_AUX_H\n\n\nFT_BEGIN_HEADER\n\n\n  FT_LOCAL( FT_Error )\n  afm_parser_init( AFM_Parser  parser,\n                   FT_Memory   memory,\n                   FT_Byte*    base,\n                   FT_Byte*    limit );\n\n\n  FT_LOCAL( void )\n  afm_parser_done( AFM_Parser  parser );\n\n\n  FT_LOCAL( FT_Error )\n  afm_parser_parse( AFM_Parser  parser );\n\n\n  enum  AFM_ValueType_\n  {\n    AFM_VALUE_TYPE_STRING,\n    AFM_VALUE_TYPE_NAME,\n    AFM_VALUE_TYPE_FIXED,   /* real number */\n    AFM_VALUE_TYPE_INTEGER,\n    AFM_VALUE_TYPE_BOOL,\n    AFM_VALUE_TYPE_INDEX    /* glyph index */\n  };\n\n\n  typedef struct  AFM_ValueRec_\n  {\n    enum AFM_ValueType_  type;\n    union\n    {\n      char*     s;\n      FT_Fixed  f;\n      FT_Int    i;\n      FT_Bool   b;\n\n    } u;\n\n  } AFM_ValueRec, *AFM_Value;\n\n#define  AFM_MAX_ARGUMENTS  5\n\n  FT_LOCAL( FT_Int )\n  afm_parser_read_vals( AFM_Parser  parser,\n                        AFM_Value   vals,\n                        FT_UInt     n );\n\n  /* read the next key from the next line or column */\n  FT_LOCAL( char* )\n  afm_parser_next_key( AFM_Parser  parser,\n                       FT_Bool     line,\n                       FT_Offset*  len );\n\nFT_END_HEADER\n\n#endif /* __AFMPARSE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/psaux/module.mk",
    "content": "#\n# FreeType 2 PSaux module definition\n#\n\n\n# Copyright 1996-2000, 2006 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\nFTMODULE_H_COMMANDS += PSAUX_MODULE\n\ndefine PSAUX_MODULE\n$(OPEN_DRIVER) FT_Module_Class, psaux_module_class $(CLOSE_DRIVER)\n$(ECHO_DRIVER)psaux     $(ECHO_DRIVER_DESC)Postscript Type 1 & Type 2 helper module$(ECHO_DRIVER_DONE)\nendef\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/psaux/psaux.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  psaux.c                                                                */\n/*                                                                         */\n/*    FreeType auxiliary PostScript driver component (body only).          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2006 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#define FT_MAKE_OPTION_SINGLE_OBJECT\n\n#include <ft2build.h>\n#include \"psobjs.c\"\n#include \"psauxmod.c\"\n#include \"t1decode.c\"\n#include \"t1cmap.c\"\n\n#ifndef T1_CONFIG_OPTION_NO_AFM\n#include \"afmparse.c\"\n#endif\n\n#include \"psconv.c\"\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/psaux/psauxerr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  psauxerr.h                                                             */\n/*                                                                         */\n/*    PS auxiliary module error codes (specification only).                */\n/*                                                                         */\n/*  Copyright 2001, 2012 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the PS auxiliary module error enumeration */\n  /* constants.                                                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __PSAUXERR_H__\n#define __PSAUXERR_H__\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  PSaux_Err_\n#define FT_ERR_BASE    FT_Mod_Err_PSaux\n\n#include FT_ERRORS_H\n\n#endif /* __PSAUXERR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/psaux/psauxmod.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  psauxmod.c                                                             */\n/*                                                                         */\n/*    FreeType auxiliary PostScript module implementation (body).          */\n/*                                                                         */\n/*  Copyright 2000-2001, 2002, 2003, 2006 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include \"psauxmod.h\"\n#include \"psobjs.h\"\n#include \"t1decode.h\"\n#include \"t1cmap.h\"\n\n#ifndef T1_CONFIG_OPTION_NO_AFM\n#include \"afmparse.h\"\n#endif\n\n\n  FT_CALLBACK_TABLE_DEF\n  const PS_Table_FuncsRec  ps_table_funcs =\n  {\n    ps_table_new,\n    ps_table_done,\n    ps_table_add,\n    ps_table_release\n  };\n\n\n  FT_CALLBACK_TABLE_DEF\n  const PS_Parser_FuncsRec  ps_parser_funcs =\n  {\n    ps_parser_init,\n    ps_parser_done,\n    ps_parser_skip_spaces,\n    ps_parser_skip_PS_token,\n    ps_parser_to_int,\n    ps_parser_to_fixed,\n    ps_parser_to_bytes,\n    ps_parser_to_coord_array,\n    ps_parser_to_fixed_array,\n    ps_parser_to_token,\n    ps_parser_to_token_array,\n    ps_parser_load_field,\n    ps_parser_load_field_table\n  };\n\n\n  FT_CALLBACK_TABLE_DEF\n  const T1_Builder_FuncsRec  t1_builder_funcs =\n  {\n    t1_builder_init,\n    t1_builder_done,\n    t1_builder_check_points,\n    t1_builder_add_point,\n    t1_builder_add_point1,\n    t1_builder_add_contour,\n    t1_builder_start_point,\n    t1_builder_close_contour\n  };\n\n\n  FT_CALLBACK_TABLE_DEF\n  const T1_Decoder_FuncsRec  t1_decoder_funcs =\n  {\n    t1_decoder_init,\n    t1_decoder_done,\n    t1_decoder_parse_charstrings\n  };\n\n\n#ifndef T1_CONFIG_OPTION_NO_AFM\n  FT_CALLBACK_TABLE_DEF\n  const AFM_Parser_FuncsRec  afm_parser_funcs =\n  {\n    afm_parser_init,\n    afm_parser_done,\n    afm_parser_parse\n  };\n#endif\n\n\n  FT_CALLBACK_TABLE_DEF\n  const T1_CMap_ClassesRec  t1_cmap_classes =\n  {\n    &t1_cmap_standard_class_rec,\n    &t1_cmap_expert_class_rec,\n    &t1_cmap_custom_class_rec,\n    &t1_cmap_unicode_class_rec\n  };\n\n\n  static\n  const PSAux_Interface  psaux_interface =\n  {\n    &ps_table_funcs,\n    &ps_parser_funcs,\n    &t1_builder_funcs,\n    &t1_decoder_funcs,\n    t1_decrypt,\n\n    (const T1_CMap_ClassesRec*) &t1_cmap_classes,\n\n#ifndef T1_CONFIG_OPTION_NO_AFM\n    &afm_parser_funcs,\n#else\n    0,\n#endif\n  };\n\n\n  FT_CALLBACK_TABLE_DEF\n  const FT_Module_Class  psaux_module_class =\n  {\n    0,\n    sizeof ( FT_ModuleRec ),\n    \"psaux\",\n    0x20000L,\n    0x20000L,\n\n    &psaux_interface,  /* module-specific interface */\n\n    (FT_Module_Constructor)0,\n    (FT_Module_Destructor) 0,\n    (FT_Module_Requester)  0\n  };\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/psaux/psauxmod.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  psauxmod.h                                                             */\n/*                                                                         */\n/*    FreeType auxiliary PostScript module implementation (specification). */\n/*                                                                         */\n/*  Copyright 2000-2001 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PSAUXMOD_H__\n#define __PSAUXMOD_H__\n\n\n#include <ft2build.h>\n#include FT_MODULE_H\n\n\nFT_BEGIN_HEADER\n\n#ifdef FT_CONFIG_OPTION_PIC\n#error \"this module does not support PIC yet\"\n#endif\n\n\n  FT_EXPORT_VAR( const FT_Module_Class )  psaux_driver_class;\n\n\nFT_END_HEADER\n\n#endif /* __PSAUXMOD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/psaux/psconv.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  psconv.c                                                               */\n/*                                                                         */\n/*    Some convenience conversions (body).                                 */\n/*                                                                         */\n/*  Copyright 2006, 2008, 2009, 2012-2013 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_POSTSCRIPT_AUX_H\n#include FT_INTERNAL_DEBUG_H\n\n#include \"psconv.h\"\n#include \"psauxerr.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_psconv\n\n\n  /* The following array is used by various functions to quickly convert */\n  /* digits (both decimal and non-decimal) into numbers.                 */\n\n#if 'A' == 65\n  /* ASCII */\n\n  static const FT_Char  ft_char_table[128] =\n  {\n    /* 0x00 */\n    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n     0,  1,  2,  3,  4,  5,  6,  7,  8,  9, -1, -1, -1, -1, -1, -1,\n    -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,\n    25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1,\n    -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,\n    25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1,\n  };\n\n  /* no character >= 0x80 can represent a valid number */\n#define OP  >=\n\n#endif /* 'A' == 65 */\n\n#if 'A' == 193\n  /* EBCDIC */\n\n  static const FT_Char  ft_char_table[128] =\n  {\n    /* 0x80 */\n    -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, -1, -1, -1, -1, -1, -1,\n    -1, 19, 20, 21, 22, 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, -1,\n    -1, -1, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, -1,\n    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n    -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, -1, -1, -1, -1, -1, -1,\n    -1, 19, 20, 21, 22, 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, -1,\n    -1, -1, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, -1,\n     0,  1,  2,  3,  4,  5,  6,  7,  8,  9, -1, -1, -1, -1, -1, -1,\n  };\n\n  /* no character < 0x80 can represent a valid number */\n#define OP  <\n\n#endif /* 'A' == 193 */\n\n\n  FT_LOCAL_DEF( FT_Long )\n  PS_Conv_Strtol( FT_Byte**  cursor,\n                  FT_Byte*   limit,\n                  FT_Long    base )\n  {\n    FT_Byte*  p = *cursor;\n\n    FT_Long   num           = 0;\n    FT_Bool   sign          = 0;\n    FT_Bool   have_overflow = 0;\n\n    FT_Long   num_limit;\n    FT_Char   c_limit;\n\n\n    if ( p >= limit )\n      goto Bad;\n\n    if ( base < 2 || base > 36 )\n    {\n      FT_TRACE4(( \"!!!INVALID BASE:!!!\" ));\n      return 0;\n    }\n\n    if ( *p == '-' || *p == '+' )\n    {\n      sign = FT_BOOL( *p == '-' );\n\n      p++;\n      if ( p == limit )\n        goto Bad;\n    }\n\n    num_limit = 0x7FFFFFFFL / base;\n    c_limit   = (FT_Char)( 0x7FFFFFFFL % base );\n\n    for ( ; p < limit; p++ )\n    {\n      FT_Char  c;\n\n\n      if ( IS_PS_SPACE( *p ) || *p OP 0x80 )\n        break;\n\n      c = ft_char_table[*p & 0x7F];\n\n      if ( c < 0 || c >= base )\n        break;\n\n      if ( num > num_limit || ( num == num_limit && c > c_limit ) )\n        have_overflow = 1;\n      else\n        num = num * base + c;\n    }\n\n    *cursor = p;\n\n    if ( have_overflow )\n    {\n      num = 0x7FFFFFFFL;\n      FT_TRACE4(( \"!!!OVERFLOW:!!!\" ));\n    }\n\n    if ( sign )\n      num = -num;\n\n    return num;\n\n  Bad:\n    FT_TRACE4(( \"!!!END OF DATA:!!!\" ));\n    return 0;\n  }\n\n\n  FT_LOCAL_DEF( FT_Long )\n  PS_Conv_ToInt( FT_Byte**  cursor,\n                 FT_Byte*   limit )\n\n  {\n    FT_Byte*  p = *cursor;\n    FT_Byte*  curp;\n\n    FT_Long   num;\n\n\n    curp = p;\n    num  = PS_Conv_Strtol( &p, limit, 10 );\n\n    if ( p == curp )\n      return 0;\n\n    if ( p < limit && *p == '#' )\n    {\n      p++;\n\n      curp = p;\n      num  = PS_Conv_Strtol( &p, limit, num );\n\n      if ( p == curp )\n        return 0;\n    }\n\n    *cursor = p;\n\n    return num;\n  }\n\n\n  FT_LOCAL_DEF( FT_Fixed )\n  PS_Conv_ToFixed( FT_Byte**  cursor,\n                   FT_Byte*   limit,\n                   FT_Long    power_ten )\n  {\n    FT_Byte*  p = *cursor;\n    FT_Byte*  curp;\n\n    FT_Fixed  integral = 0;\n    FT_Long   decimal  = 0;\n    FT_Long   divider  = 1;\n\n    FT_Bool   sign           = 0;\n    FT_Bool   have_overflow  = 0;\n    FT_Bool   have_underflow = 0;\n\n\n    if ( p >= limit )\n      goto Bad;\n\n    if ( *p == '-' || *p == '+' )\n    {\n      sign = FT_BOOL( *p == '-' );\n\n      p++;\n      if ( p == limit )\n        goto Bad;\n    }\n\n    /* read the integer part */\n    if ( *p != '.' )\n    {\n      curp     = p;\n      integral = PS_Conv_ToInt( &p, limit );\n\n      if ( p == curp )\n        return 0;\n\n      if ( integral > 0x7FFF )\n        have_overflow = 1;\n      else\n        integral = (FT_Fixed)( (FT_UInt32)integral << 16 );\n    }\n\n    /* read the decimal part */\n    if ( p < limit && *p == '.' )\n    {\n      p++;\n\n      for ( ; p < limit; p++ )\n      {\n        FT_Char  c;\n\n\n        if ( IS_PS_SPACE( *p ) || *p OP 0x80 )\n          break;\n\n        c = ft_char_table[*p & 0x7F];\n\n        if ( c < 0 || c >= 10 )\n          break;\n\n        /* only add digit if we don't overflow */\n        if ( divider < 0xCCCCCCCL && decimal < 0xCCCCCCCL )\n        {\n          decimal = decimal * 10 + c;\n\n          if ( !integral && power_ten > 0 )\n            power_ten--;\n          else\n            divider *= 10;\n        }\n      }\n    }\n\n    /* read exponent, if any */\n    if ( p + 1 < limit && ( *p == 'e' || *p == 'E' ) )\n    {\n      FT_Long  exponent;\n\n\n      p++;\n\n      curp     = p;\n      exponent = PS_Conv_ToInt( &p, limit );\n\n      if ( curp == p )\n        return 0;\n\n      /* arbitrarily limit exponent */\n      if ( exponent > 1000 )\n        have_overflow = 1;\n      else if ( exponent < -1000 )\n        have_underflow = 1;\n      else\n        power_ten += exponent;\n    }\n\n    *cursor = p;\n\n    if ( !integral && !decimal )\n      return 0;\n\n    if ( have_overflow )\n      goto Overflow;\n    if ( have_underflow )\n      goto Underflow;\n\n    while ( power_ten > 0 )\n    {\n      if ( integral >= 0xCCCCCCCL )\n        goto Overflow;\n      integral *= 10;\n\n      if ( decimal >= 0xCCCCCCCL )\n      {\n        if ( divider == 1 )\n          goto Overflow;\n        divider /= 10;\n      }\n      else\n        decimal *= 10;\n\n      power_ten--;\n    }\n\n    while ( power_ten < 0 )\n    {\n      integral /= 10;\n      if ( divider < 0xCCCCCCCL )\n        divider *= 10;\n      else\n        decimal /= 10;\n\n      if ( !integral && !decimal )\n        goto Underflow;\n\n      power_ten++;\n    }\n\n    if ( decimal )\n    {\n      decimal = FT_DivFix( decimal, divider );\n      /* it's not necessary to check this addition for overflow */\n      /* due to the structure of the real number representation */\n      integral += decimal;\n    }\n\n  Exit:\n    if ( sign )\n      integral = -integral;\n\n    return integral;\n\n  Bad:\n    FT_TRACE4(( \"!!!END OF DATA:!!!\" ));\n    return 0;\n\n  Overflow:\n    integral = 0x7FFFFFFFL;\n    FT_TRACE4(( \"!!!OVERFLOW:!!!\" ));\n    goto Exit;\n\n  Underflow:\n    FT_TRACE4(( \"!!!UNDERFLOW:!!!\" ));\n    return 0;\n  }\n\n\n#if 0\n  FT_LOCAL_DEF( FT_UInt )\n  PS_Conv_StringDecode( FT_Byte**  cursor,\n                        FT_Byte*   limit,\n                        FT_Byte*   buffer,\n                        FT_Offset  n )\n  {\n    FT_Byte*  p;\n    FT_UInt   r = 0;\n\n\n    for ( p = *cursor; r < n && p < limit; p++ )\n    {\n      FT_Byte  b;\n\n\n      if ( *p != '\\\\' )\n      {\n        buffer[r++] = *p;\n\n        continue;\n      }\n\n      p++;\n\n      switch ( *p )\n      {\n      case 'n':\n        b = '\\n';\n        break;\n      case 'r':\n        b = '\\r';\n        break;\n      case 't':\n        b = '\\t';\n        break;\n      case 'b':\n        b = '\\b';\n        break;\n      case 'f':\n        b = '\\f';\n        break;\n      case '\\r':\n        p++;\n        if ( *p != '\\n' )\n        {\n          b = *p;\n\n          break;\n        }\n        /* no break */\n      case '\\n':\n        continue;\n        break;\n      default:\n        if ( IS_PS_DIGIT( *p ) )\n        {\n          b = *p - '0';\n\n          p++;\n\n          if ( IS_PS_DIGIT( *p ) )\n          {\n            b = b * 8 + *p - '0';\n\n            p++;\n\n            if ( IS_PS_DIGIT( *p ) )\n              b = b * 8 + *p - '0';\n            else\n            {\n              buffer[r++] = b;\n              b = *p;\n            }\n          }\n          else\n          {\n            buffer[r++] = b;\n            b = *p;\n          }\n        }\n        else\n          b = *p;\n        break;\n      }\n\n      buffer[r++] = b;\n    }\n\n    *cursor = p;\n\n    return r;\n  }\n#endif /* 0 */\n\n\n  FT_LOCAL_DEF( FT_UInt )\n  PS_Conv_ASCIIHexDecode( FT_Byte**  cursor,\n                          FT_Byte*   limit,\n                          FT_Byte*   buffer,\n                          FT_Offset  n )\n  {\n    FT_Byte*  p;\n    FT_UInt   r   = 0;\n    FT_UInt   w   = 0;\n    FT_UInt   pad = 0x01;\n\n\n    n *= 2;\n\n#if 1\n\n    p = *cursor;\n\n    if ( p >= limit )\n      return 0;\n\n    if ( n > (FT_UInt)( limit - p ) )\n      n = (FT_UInt)( limit - p );\n\n    /* we try to process two nibbles at a time to be as fast as possible */\n    for ( ; r < n; r++ )\n    {\n      FT_UInt  c = p[r];\n\n\n      if ( IS_PS_SPACE( c ) )\n        continue;\n\n      if ( c OP 0x80 )\n        break;\n\n      c = ft_char_table[c & 0x7F];\n      if ( (unsigned)c >= 16 )\n        break;\n\n      pad = ( pad << 4 ) | c;\n      if ( pad & 0x100 )\n      {\n        buffer[w++] = (FT_Byte)pad;\n        pad         = 0x01;\n      }\n    }\n\n    if ( pad != 0x01 )\n      buffer[w++] = (FT_Byte)( pad << 4 );\n\n    *cursor = p + r;\n\n    return w;\n\n#else /* 0 */\n\n    for ( r = 0; r < n; r++ )\n    {\n      FT_Char  c;\n\n\n      if ( IS_PS_SPACE( *p ) )\n        continue;\n\n      if ( *p OP 0x80 )\n        break;\n\n      c = ft_char_table[*p & 0x7F];\n\n      if ( (unsigned)c >= 16 )\n        break;\n\n      if ( r & 1 )\n      {\n        *buffer = (FT_Byte)(*buffer + c);\n        buffer++;\n      }\n      else\n        *buffer = (FT_Byte)(c << 4);\n\n      r++;\n    }\n\n    *cursor = p;\n\n    return ( r + 1 ) / 2;\n\n#endif /* 0 */\n\n  }\n\n\n  FT_LOCAL_DEF( FT_UInt )\n  PS_Conv_EexecDecode( FT_Byte**   cursor,\n                       FT_Byte*    limit,\n                       FT_Byte*    buffer,\n                       FT_Offset   n,\n                       FT_UShort*  seed )\n  {\n    FT_Byte*  p;\n    FT_UInt   r;\n    FT_UInt   s = *seed;\n\n\n#if 1\n\n    p = *cursor;\n\n    if ( p >= limit )\n      return 0;\n\n    if ( n > (FT_UInt)(limit - p) )\n      n = (FT_UInt)(limit - p);\n\n    for ( r = 0; r < n; r++ )\n    {\n      FT_UInt  val = p[r];\n      FT_UInt  b   = ( val ^ ( s >> 8 ) );\n\n\n      s         = ( (val + s)*52845U + 22719 ) & 0xFFFFU;\n      buffer[r] = (FT_Byte) b;\n    }\n\n    *cursor = p + n;\n    *seed   = (FT_UShort)s;\n\n#else /* 0 */\n\n    for ( r = 0, p = *cursor; r < n && p < limit; r++, p++ )\n    {\n      FT_Byte  b = (FT_Byte)( *p ^ ( s >> 8 ) );\n\n\n      s = (FT_UShort)( ( *p + s ) * 52845U + 22719 );\n      *buffer++ = b;\n    }\n    *cursor = p;\n    *seed   = s;\n\n#endif /* 0 */\n\n    return r;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/psaux/psconv.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  psconv.h                                                               */\n/*                                                                         */\n/*    Some convenience conversions (specification).                        */\n/*                                                                         */\n/*  Copyright 2006, 2012 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PSCONV_H__\n#define __PSCONV_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_POSTSCRIPT_AUX_H\n\nFT_BEGIN_HEADER\n\n\n  FT_LOCAL( FT_Long )\n  PS_Conv_Strtol( FT_Byte**  cursor,\n                  FT_Byte*   limit,\n                  FT_Long    base );\n\n\n  FT_LOCAL( FT_Long )\n  PS_Conv_ToInt( FT_Byte**  cursor,\n                 FT_Byte*   limit );\n\n  FT_LOCAL( FT_Fixed )\n  PS_Conv_ToFixed( FT_Byte**  cursor,\n                   FT_Byte*   limit,\n                   FT_Long    power_ten );\n\n#if 0\n  FT_LOCAL( FT_UInt )\n  PS_Conv_StringDecode( FT_Byte**  cursor,\n                        FT_Byte*   limit,\n                        FT_Byte*   buffer,\n                        FT_Offset  n );\n#endif\n\n  FT_LOCAL( FT_UInt )\n  PS_Conv_ASCIIHexDecode( FT_Byte**  cursor,\n                          FT_Byte*   limit,\n                          FT_Byte*   buffer,\n                          FT_Offset  n );\n\n  FT_LOCAL( FT_UInt )\n  PS_Conv_EexecDecode( FT_Byte**   cursor,\n                       FT_Byte*    limit,\n                       FT_Byte*    buffer,\n                       FT_Offset   n,\n                       FT_UShort*  seed );\n\n\nFT_END_HEADER\n\n#endif /* __PSCONV_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/psaux/psobjs.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  psobjs.c                                                               */\n/*                                                                         */\n/*    Auxiliary functions for PostScript fonts (body).                     */\n/*                                                                         */\n/*  Copyright 1996-2014 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_POSTSCRIPT_AUX_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_CALC_H\n\n#include \"psobjs.h\"\n#include \"psconv.h\"\n\n#include \"psauxerr.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_psobjs\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                             PS_TABLE                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    ps_table_new                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initializes a PS_Table.                                            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    table  :: The address of the target table.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    count  :: The table size = the maximum number of elements.         */\n  /*                                                                       */\n  /*    memory :: The memory object to use for all subsequent              */\n  /*              reallocations.                                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  ps_table_new( PS_Table   table,\n                FT_Int     count,\n                FT_Memory  memory )\n  {\n    FT_Error  error;\n\n\n    table->memory = memory;\n    if ( FT_NEW_ARRAY( table->elements, count ) ||\n         FT_NEW_ARRAY( table->lengths,  count ) )\n      goto Exit;\n\n    table->max_elems = count;\n    table->init      = 0xDEADBEEFUL;\n    table->num_elems = 0;\n    table->block     = 0;\n    table->capacity  = 0;\n    table->cursor    = 0;\n\n    *(PS_Table_FuncsRec*)&table->funcs = ps_table_funcs;\n\n  Exit:\n    if ( error )\n      FT_FREE( table->elements );\n\n    return error;\n  }\n\n\n  static void\n  shift_elements( PS_Table  table,\n                  FT_Byte*  old_base )\n  {\n    FT_PtrDist  delta  = table->block - old_base;\n    FT_Byte**   offset = table->elements;\n    FT_Byte**   limit  = offset + table->max_elems;\n\n\n    for ( ; offset < limit; offset++ )\n    {\n      if ( offset[0] )\n        offset[0] += delta;\n    }\n  }\n\n\n  static FT_Error\n  reallocate_t1_table( PS_Table   table,\n                       FT_Offset  new_size )\n  {\n    FT_Memory  memory   = table->memory;\n    FT_Byte*   old_base = table->block;\n    FT_Error   error;\n\n\n    /* allocate new base block */\n    if ( FT_ALLOC( table->block, new_size ) )\n    {\n      table->block = old_base;\n      return error;\n    }\n\n    /* copy elements and shift offsets */\n    if ( old_base )\n    {\n      FT_MEM_COPY( table->block, old_base, table->capacity );\n      shift_elements( table, old_base );\n      FT_FREE( old_base );\n    }\n\n    table->capacity = new_size;\n\n    return FT_Err_Ok;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    ps_table_add                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Adds an object to a PS_Table, possibly growing its memory block.   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    table  :: The target table.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    idx    :: The index of the object in the table.                    */\n  /*                                                                       */\n  /*    object :: The address of the object to copy in memory.             */\n  /*                                                                       */\n  /*    length :: The length in bytes of the source object.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.  An error is returned if a  */\n  /*    reallocation fails.                                                */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  ps_table_add( PS_Table    table,\n                FT_Int      idx,\n                void*       object,\n                FT_PtrDist  length )\n  {\n    if ( idx < 0 || idx >= table->max_elems )\n    {\n      FT_ERROR(( \"ps_table_add: invalid index\\n\" ));\n      return FT_THROW( Invalid_Argument );\n    }\n\n    if ( length < 0 )\n    {\n      FT_ERROR(( \"ps_table_add: invalid length\\n\" ));\n      return FT_THROW( Invalid_Argument );\n    }\n\n    /* grow the base block if needed */\n    if ( table->cursor + length > table->capacity )\n    {\n      FT_Error    error;\n      FT_Offset   new_size = table->capacity;\n      FT_PtrDist  in_offset;\n\n\n      in_offset = (FT_Byte*)object - table->block;\n      if ( in_offset < 0 || (FT_Offset)in_offset >= table->capacity )\n        in_offset = -1;\n\n      while ( new_size < table->cursor + length )\n      {\n        /* increase size by 25% and round up to the nearest multiple\n           of 1024 */\n        new_size += ( new_size >> 2 ) + 1;\n        new_size  = FT_PAD_CEIL( new_size, 1024 );\n      }\n\n      error = reallocate_t1_table( table, new_size );\n      if ( error )\n        return error;\n\n      if ( in_offset >= 0 )\n        object = table->block + in_offset;\n    }\n\n    /* add the object to the base block and adjust offset */\n    table->elements[idx] = table->block + table->cursor;\n    table->lengths [idx] = length;\n    FT_MEM_COPY( table->block + table->cursor, object, length );\n\n    table->cursor += length;\n    return FT_Err_Ok;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    ps_table_done                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Finalizes a PS_TableRec (i.e., reallocate it to its current        */\n  /*    cursor).                                                           */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    table :: The target table.                                         */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function does NOT release the heap's memory block.  It is up  */\n  /*    to the caller to clean it, or reference it in its own structures.  */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  ps_table_done( PS_Table  table )\n  {\n    FT_Memory  memory = table->memory;\n    FT_Error   error;\n    FT_Byte*   old_base = table->block;\n\n\n    /* should never fail, because rec.cursor <= rec.size */\n    if ( !old_base )\n      return;\n\n    if ( FT_ALLOC( table->block, table->cursor ) )\n      return;\n    FT_MEM_COPY( table->block, old_base, table->cursor );\n    shift_elements( table, old_base );\n\n    table->capacity = table->cursor;\n    FT_FREE( old_base );\n\n    FT_UNUSED( error );\n  }\n\n\n  FT_LOCAL_DEF( void )\n  ps_table_release( PS_Table  table )\n  {\n    FT_Memory  memory = table->memory;\n\n\n    if ( (FT_ULong)table->init == 0xDEADBEEFUL )\n    {\n      FT_FREE( table->block );\n      FT_FREE( table->elements );\n      FT_FREE( table->lengths );\n      table->init = 0;\n    }\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                            T1 PARSER                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* first character must be already part of the comment */\n\n  static void\n  skip_comment( FT_Byte*  *acur,\n                FT_Byte*   limit )\n  {\n    FT_Byte*  cur = *acur;\n\n\n    while ( cur < limit )\n    {\n      if ( IS_PS_NEWLINE( *cur ) )\n        break;\n      cur++;\n    }\n\n    *acur = cur;\n  }\n\n\n  static void\n  skip_spaces( FT_Byte*  *acur,\n               FT_Byte*   limit )\n  {\n    FT_Byte*  cur = *acur;\n\n\n    while ( cur < limit )\n    {\n      if ( !IS_PS_SPACE( *cur ) )\n      {\n        if ( *cur == '%' )\n          /* According to the PLRM, a comment is equal to a space. */\n          skip_comment( &cur, limit );\n        else\n          break;\n      }\n      cur++;\n    }\n\n    *acur = cur;\n  }\n\n\n#define IS_OCTAL_DIGIT( c ) ( '0' <= (c) && (c) <= '7' )\n\n\n  /* first character must be `(';                               */\n  /* *acur is positioned at the character after the closing `)' */\n\n  static FT_Error\n  skip_literal_string( FT_Byte*  *acur,\n                       FT_Byte*   limit )\n  {\n    FT_Byte*      cur   = *acur;\n    FT_Int        embed = 0;\n    FT_Error      error = FT_ERR( Invalid_File_Format );\n    unsigned int  i;\n\n\n    while ( cur < limit )\n    {\n      FT_Byte  c = *cur;\n\n\n      ++cur;\n\n      if ( c == '\\\\' )\n      {\n        /* Red Book 3rd ed., section `Literal Text Strings', p. 29:     */\n        /* A backslash can introduce three different types              */\n        /* of escape sequences:                                         */\n        /*   - a special escaped char like \\r, \\n, etc.                 */\n        /*   - a one-, two-, or three-digit octal number                */\n        /*   - none of the above in which case the backslash is ignored */\n\n        if ( cur == limit )\n          /* error (or to be ignored?) */\n          break;\n\n        switch ( *cur )\n        {\n          /* skip `special' escape */\n        case 'n':\n        case 'r':\n        case 't':\n        case 'b':\n        case 'f':\n        case '\\\\':\n        case '(':\n        case ')':\n          ++cur;\n          break;\n\n        default:\n          /* skip octal escape or ignore backslash */\n          for ( i = 0; i < 3 && cur < limit; ++i )\n          {\n            if ( !IS_OCTAL_DIGIT( *cur ) )\n              break;\n\n            ++cur;\n          }\n        }\n      }\n      else if ( c == '(' )\n        embed++;\n      else if ( c == ')' )\n      {\n        embed--;\n        if ( embed == 0 )\n        {\n          error = FT_Err_Ok;\n          break;\n        }\n      }\n    }\n\n    *acur = cur;\n\n    return error;\n  }\n\n\n  /* first character must be `<' */\n\n  static FT_Error\n  skip_string( FT_Byte*  *acur,\n               FT_Byte*   limit )\n  {\n    FT_Byte*  cur = *acur;\n    FT_Error  err =  FT_Err_Ok;\n\n\n    while ( ++cur < limit )\n    {\n      /* All whitespace characters are ignored. */\n      skip_spaces( &cur, limit );\n      if ( cur >= limit )\n        break;\n\n      if ( !IS_PS_XDIGIT( *cur ) )\n        break;\n    }\n\n    if ( cur < limit && *cur != '>' )\n    {\n      FT_ERROR(( \"skip_string: missing closing delimiter `>'\\n\" ));\n      err = FT_THROW( Invalid_File_Format );\n    }\n    else\n      cur++;\n\n    *acur = cur;\n    return err;\n  }\n\n\n  /* first character must be the opening brace that */\n  /* starts the procedure                           */\n\n  /* NB: [ and ] need not match:                    */\n  /* `/foo {[} def' is a valid PostScript fragment, */\n  /* even within a Type1 font                       */\n\n  static FT_Error\n  skip_procedure( FT_Byte*  *acur,\n                  FT_Byte*   limit )\n  {\n    FT_Byte*  cur;\n    FT_Int    embed = 0;\n    FT_Error  error = FT_Err_Ok;\n\n\n    FT_ASSERT( **acur == '{' );\n\n    for ( cur = *acur; cur < limit && error == FT_Err_Ok; ++cur )\n    {\n      switch ( *cur )\n      {\n      case '{':\n        ++embed;\n        break;\n\n      case '}':\n        --embed;\n        if ( embed == 0 )\n        {\n          ++cur;\n          goto end;\n        }\n        break;\n\n      case '(':\n        error = skip_literal_string( &cur, limit );\n        break;\n\n      case '<':\n        error = skip_string( &cur, limit );\n        break;\n\n      case '%':\n        skip_comment( &cur, limit );\n        break;\n      }\n    }\n\n  end:\n    if ( embed != 0 )\n      error = FT_THROW( Invalid_File_Format );\n\n    *acur = cur;\n\n    return error;\n  }\n\n\n  /***********************************************************************/\n  /*                                                                     */\n  /* All exported parsing routines handle leading whitespace and stop at */\n  /* the first character which isn't part of the just handled token.     */\n  /*                                                                     */\n  /***********************************************************************/\n\n\n  FT_LOCAL_DEF( void )\n  ps_parser_skip_PS_token( PS_Parser  parser )\n  {\n    /* Note: PostScript allows any non-delimiting, non-whitespace        */\n    /*       character in a name (PS Ref Manual, 3rd ed, p31).           */\n    /*       PostScript delimiters are (, ), <, >, [, ], {, }, /, and %. */\n\n    FT_Byte*  cur   = parser->cursor;\n    FT_Byte*  limit = parser->limit;\n    FT_Error  error = FT_Err_Ok;\n\n\n    skip_spaces( &cur, limit );             /* this also skips comments */\n    if ( cur >= limit )\n      goto Exit;\n\n    /* self-delimiting, single-character tokens */\n    if ( *cur == '[' || *cur == ']' )\n    {\n      cur++;\n      goto Exit;\n    }\n\n    /* skip balanced expressions (procedures and strings) */\n\n    if ( *cur == '{' )                              /* {...} */\n    {\n      error = skip_procedure( &cur, limit );\n      goto Exit;\n    }\n\n    if ( *cur == '(' )                              /* (...) */\n    {\n      error = skip_literal_string( &cur, limit );\n      goto Exit;\n    }\n\n    if ( *cur == '<' )                              /* <...> */\n    {\n      if ( cur + 1 < limit && *(cur + 1) == '<' )   /* << */\n      {\n        cur++;\n        cur++;\n      }\n      else\n        error = skip_string( &cur, limit );\n\n      goto Exit;\n    }\n\n    if ( *cur == '>' )\n    {\n      cur++;\n      if ( cur >= limit || *cur != '>' )             /* >> */\n      {\n        FT_ERROR(( \"ps_parser_skip_PS_token:\"\n                   \" unexpected closing delimiter `>'\\n\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Exit;\n      }\n      cur++;\n      goto Exit;\n    }\n\n    if ( *cur == '/' )\n      cur++;\n\n    /* anything else */\n    while ( cur < limit )\n    {\n      /* *cur might be invalid (e.g., ')' or '}'), but this   */\n      /* is handled by the test `cur == parser->cursor' below */\n      if ( IS_PS_DELIM( *cur ) )\n        break;\n\n      cur++;\n    }\n\n  Exit:\n    if ( cur < limit && cur == parser->cursor )\n    {\n      FT_ERROR(( \"ps_parser_skip_PS_token:\"\n                 \" current token is `%c' which is self-delimiting\\n\"\n                 \"                        \"\n                 \" but invalid at this point\\n\",\n                 *cur ));\n\n      error = FT_THROW( Invalid_File_Format );\n    }\n\n    parser->error  = error;\n    parser->cursor = cur;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  ps_parser_skip_spaces( PS_Parser  parser )\n  {\n    skip_spaces( &parser->cursor, parser->limit );\n  }\n\n\n  /* `token' here means either something between balanced delimiters */\n  /* or the next token; the delimiters are not removed.              */\n\n  FT_LOCAL_DEF( void )\n  ps_parser_to_token( PS_Parser  parser,\n                      T1_Token   token )\n  {\n    FT_Byte*  cur;\n    FT_Byte*  limit;\n    FT_Int    embed;\n\n\n    token->type  = T1_TOKEN_TYPE_NONE;\n    token->start = 0;\n    token->limit = 0;\n\n    /* first of all, skip leading whitespace */\n    ps_parser_skip_spaces( parser );\n\n    cur   = parser->cursor;\n    limit = parser->limit;\n\n    if ( cur >= limit )\n      return;\n\n    switch ( *cur )\n    {\n      /************* check for literal string *****************/\n    case '(':\n      token->type  = T1_TOKEN_TYPE_STRING;\n      token->start = cur;\n\n      if ( skip_literal_string( &cur, limit ) == FT_Err_Ok )\n        token->limit = cur;\n      break;\n\n      /************* check for programs/array *****************/\n    case '{':\n      token->type  = T1_TOKEN_TYPE_ARRAY;\n      token->start = cur;\n\n      if ( skip_procedure( &cur, limit ) == FT_Err_Ok )\n        token->limit = cur;\n      break;\n\n      /************* check for table/array ********************/\n      /* XXX: in theory we should also look for \"<<\"          */\n      /*      since this is semantically equivalent to \"[\";   */\n      /*      in practice it doesn't matter (?)               */\n    case '[':\n      token->type  = T1_TOKEN_TYPE_ARRAY;\n      embed        = 1;\n      token->start = cur++;\n\n      /* we need this to catch `[ ]' */\n      parser->cursor = cur;\n      ps_parser_skip_spaces( parser );\n      cur = parser->cursor;\n\n      while ( cur < limit && !parser->error )\n      {\n        /* XXX: this is wrong because it does not      */\n        /*      skip comments, procedures, and strings */\n        if ( *cur == '[' )\n          embed++;\n        else if ( *cur == ']' )\n        {\n          embed--;\n          if ( embed <= 0 )\n          {\n            token->limit = ++cur;\n            break;\n          }\n        }\n\n        parser->cursor = cur;\n        ps_parser_skip_PS_token( parser );\n        /* we need this to catch `[XXX ]' */\n        ps_parser_skip_spaces  ( parser );\n        cur = parser->cursor;\n      }\n      break;\n\n      /* ************ otherwise, it is any token **************/\n    default:\n      token->start = cur;\n      token->type  = ( *cur == '/' ? T1_TOKEN_TYPE_KEY : T1_TOKEN_TYPE_ANY );\n      ps_parser_skip_PS_token( parser );\n      cur = parser->cursor;\n      if ( !parser->error )\n        token->limit = cur;\n    }\n\n    if ( !token->limit )\n    {\n      token->start = 0;\n      token->type  = T1_TOKEN_TYPE_NONE;\n    }\n\n    parser->cursor = cur;\n  }\n\n\n  /* NB: `tokens' can be NULL if we only want to count */\n  /* the number of array elements                      */\n\n  FT_LOCAL_DEF( void )\n  ps_parser_to_token_array( PS_Parser  parser,\n                            T1_Token   tokens,\n                            FT_UInt    max_tokens,\n                            FT_Int*    pnum_tokens )\n  {\n    T1_TokenRec  master;\n\n\n    *pnum_tokens = -1;\n\n    /* this also handles leading whitespace */\n    ps_parser_to_token( parser, &master );\n\n    if ( master.type == T1_TOKEN_TYPE_ARRAY )\n    {\n      FT_Byte*  old_cursor = parser->cursor;\n      FT_Byte*  old_limit  = parser->limit;\n      T1_Token  cur        = tokens;\n      T1_Token  limit      = cur + max_tokens;\n\n\n      /* don't include outermost delimiters */\n      parser->cursor = master.start + 1;\n      parser->limit  = master.limit - 1;\n\n      while ( parser->cursor < parser->limit )\n      {\n        T1_TokenRec  token;\n\n\n        ps_parser_to_token( parser, &token );\n        if ( !token.type )\n          break;\n\n        if ( tokens != NULL && cur < limit )\n          *cur = token;\n\n        cur++;\n      }\n\n      *pnum_tokens = (FT_Int)( cur - tokens );\n\n      parser->cursor = old_cursor;\n      parser->limit  = old_limit;\n    }\n  }\n\n\n  /* first character must be a delimiter or a part of a number */\n  /* NB: `coords' can be NULL if we just want to skip the      */\n  /*     array; in this case we ignore `max_coords'            */\n\n  static FT_Int\n  ps_tocoordarray( FT_Byte*  *acur,\n                   FT_Byte*   limit,\n                   FT_Int     max_coords,\n                   FT_Short*  coords )\n  {\n    FT_Byte*  cur   = *acur;\n    FT_Int    count = 0;\n    FT_Byte   c, ender;\n\n\n    if ( cur >= limit )\n      goto Exit;\n\n    /* check for the beginning of an array; otherwise, only one number */\n    /* will be read                                                    */\n    c     = *cur;\n    ender = 0;\n\n    if ( c == '[' )\n      ender = ']';\n    else if ( c == '{' )\n      ender = '}';\n\n    if ( ender )\n      cur++;\n\n    /* now, read the coordinates */\n    while ( cur < limit )\n    {\n      FT_Short  dummy;\n      FT_Byte*  old_cur;\n\n\n      /* skip whitespace in front of data */\n      skip_spaces( &cur, limit );\n      if ( cur >= limit )\n        goto Exit;\n\n      if ( *cur == ender )\n      {\n        cur++;\n        break;\n      }\n\n      old_cur = cur;\n\n      if ( coords != NULL && count >= max_coords )\n        break;\n\n      /* call PS_Conv_ToFixed() even if coords == NULL */\n      /* to properly parse number at `cur'             */\n      *( coords != NULL ? &coords[count] : &dummy ) =\n        (FT_Short)( PS_Conv_ToFixed( &cur, limit, 0 ) >> 16 );\n\n      if ( old_cur == cur )\n      {\n        count = -1;\n        goto Exit;\n      }\n      else\n        count++;\n\n      if ( !ender )\n        break;\n    }\n\n  Exit:\n    *acur = cur;\n    return count;\n  }\n\n\n  /* first character must be a delimiter or a part of a number */\n  /* NB: `values' can be NULL if we just want to skip the      */\n  /*     array; in this case we ignore `max_values'            */\n  /*                                                           */\n  /* return number of successfully parsed values               */\n\n  static FT_Int\n  ps_tofixedarray( FT_Byte*  *acur,\n                   FT_Byte*   limit,\n                   FT_Int     max_values,\n                   FT_Fixed*  values,\n                   FT_Int     power_ten )\n  {\n    FT_Byte*  cur   = *acur;\n    FT_Int    count = 0;\n    FT_Byte   c, ender;\n\n\n    if ( cur >= limit )\n      goto Exit;\n\n    /* Check for the beginning of an array.  Otherwise, only one number */\n    /* will be read.                                                    */\n    c     = *cur;\n    ender = 0;\n\n    if ( c == '[' )\n      ender = ']';\n    else if ( c == '{' )\n      ender = '}';\n\n    if ( ender )\n      cur++;\n\n    /* now, read the values */\n    while ( cur < limit )\n    {\n      FT_Fixed  dummy;\n      FT_Byte*  old_cur;\n\n\n      /* skip whitespace in front of data */\n      skip_spaces( &cur, limit );\n      if ( cur >= limit )\n        goto Exit;\n\n      if ( *cur == ender )\n      {\n        cur++;\n        break;\n      }\n\n      old_cur = cur;\n\n      if ( values != NULL && count >= max_values )\n        break;\n\n      /* call PS_Conv_ToFixed() even if coords == NULL */\n      /* to properly parse number at `cur'             */\n      *( values != NULL ? &values[count] : &dummy ) =\n        PS_Conv_ToFixed( &cur, limit, power_ten );\n\n      if ( old_cur == cur )\n      {\n        count = -1;\n        goto Exit;\n      }\n      else\n        count++;\n\n      if ( !ender )\n        break;\n    }\n\n  Exit:\n    *acur = cur;\n    return count;\n  }\n\n\n#if 0\n\n  static FT_String*\n  ps_tostring( FT_Byte**  cursor,\n               FT_Byte*   limit,\n               FT_Memory  memory )\n  {\n    FT_Byte*    cur = *cursor;\n    FT_PtrDist  len = 0;\n    FT_Int      count;\n    FT_String*  result;\n    FT_Error    error;\n\n\n    /* XXX: some stupid fonts have a `Notice' or `Copyright' string     */\n    /*      that simply doesn't begin with an opening parenthesis, even */\n    /*      though they have a closing one!  E.g. \"amuncial.pfb\"        */\n    /*                                                                  */\n    /*      We must deal with these ill-fated cases there.  Note that   */\n    /*      these fonts didn't work with the old Type 1 driver as the   */\n    /*      notice/copyright was not recognized as a valid string token */\n    /*      and made the old token parser commit errors.                */\n\n    while ( cur < limit && ( *cur == ' ' || *cur == '\\t' ) )\n      cur++;\n    if ( cur + 1 >= limit )\n      return 0;\n\n    if ( *cur == '(' )\n      cur++;  /* skip the opening parenthesis, if there is one */\n\n    *cursor = cur;\n    count   = 0;\n\n    /* then, count its length */\n    for ( ; cur < limit; cur++ )\n    {\n      if ( *cur == '(' )\n        count++;\n\n      else if ( *cur == ')' )\n      {\n        count--;\n        if ( count < 0 )\n          break;\n      }\n    }\n\n    len = cur - *cursor;\n    if ( cur >= limit || FT_ALLOC( result, len + 1 ) )\n      return 0;\n\n    /* now copy the string */\n    FT_MEM_COPY( result, *cursor, len );\n    result[len] = '\\0';\n    *cursor = cur;\n    return result;\n  }\n\n#endif /* 0 */\n\n\n  static int\n  ps_tobool( FT_Byte*  *acur,\n             FT_Byte*   limit )\n  {\n    FT_Byte*  cur    = *acur;\n    FT_Bool   result = 0;\n\n\n    /* return 1 if we find `true', 0 otherwise */\n    if ( cur + 3 < limit &&\n         cur[0] == 't'   &&\n         cur[1] == 'r'   &&\n         cur[2] == 'u'   &&\n         cur[3] == 'e'   )\n    {\n      result = 1;\n      cur   += 5;\n    }\n    else if ( cur + 4 < limit &&\n              cur[0] == 'f'   &&\n              cur[1] == 'a'   &&\n              cur[2] == 'l'   &&\n              cur[3] == 's'   &&\n              cur[4] == 'e'   )\n    {\n      result = 0;\n      cur   += 6;\n    }\n\n    *acur = cur;\n    return result;\n  }\n\n\n  /* load a simple field (i.e. non-table) into the current list of objects */\n\n  FT_LOCAL_DEF( FT_Error )\n  ps_parser_load_field( PS_Parser       parser,\n                        const T1_Field  field,\n                        void**          objects,\n                        FT_UInt         max_objects,\n                        FT_ULong*       pflags )\n  {\n    T1_TokenRec   token;\n    FT_Byte*      cur;\n    FT_Byte*      limit;\n    FT_UInt       count;\n    FT_UInt       idx;\n    FT_Error      error;\n    T1_FieldType  type;\n\n\n    /* this also skips leading whitespace */\n    ps_parser_to_token( parser, &token );\n    if ( !token.type )\n      goto Fail;\n\n    count = 1;\n    idx   = 0;\n    cur   = token.start;\n    limit = token.limit;\n\n    type = field->type;\n\n    /* we must detect arrays in /FontBBox */\n    if ( type == T1_FIELD_TYPE_BBOX )\n    {\n      T1_TokenRec  token2;\n      FT_Byte*     old_cur   = parser->cursor;\n      FT_Byte*     old_limit = parser->limit;\n\n\n      /* don't include delimiters */\n      parser->cursor = token.start + 1;\n      parser->limit  = token.limit - 1;\n\n      ps_parser_to_token( parser, &token2 );\n      parser->cursor = old_cur;\n      parser->limit  = old_limit;\n\n      if ( token2.type == T1_TOKEN_TYPE_ARRAY )\n      {\n        type = T1_FIELD_TYPE_MM_BBOX;\n        goto FieldArray;\n      }\n    }\n    else if ( token.type == T1_TOKEN_TYPE_ARRAY )\n    {\n      count = max_objects;\n\n    FieldArray:\n      /* if this is an array and we have no blend, an error occurs */\n      if ( max_objects == 0 )\n        goto Fail;\n\n      idx = 1;\n\n      /* don't include delimiters */\n      cur++;\n      limit--;\n    }\n\n    for ( ; count > 0; count--, idx++ )\n    {\n      FT_Byte*    q = (FT_Byte*)objects[idx] + field->offset;\n      FT_Long     val;\n      FT_String*  string;\n\n\n      skip_spaces( &cur, limit );\n\n      switch ( type )\n      {\n      case T1_FIELD_TYPE_BOOL:\n        val = ps_tobool( &cur, limit );\n        goto Store_Integer;\n\n      case T1_FIELD_TYPE_FIXED:\n        val = PS_Conv_ToFixed( &cur, limit, 0 );\n        goto Store_Integer;\n\n      case T1_FIELD_TYPE_FIXED_1000:\n        val = PS_Conv_ToFixed( &cur, limit, 3 );\n        goto Store_Integer;\n\n      case T1_FIELD_TYPE_INTEGER:\n        val = PS_Conv_ToInt( &cur, limit );\n        /* fall through */\n\n      Store_Integer:\n        switch ( field->size )\n        {\n        case (8 / FT_CHAR_BIT):\n          *(FT_Byte*)q = (FT_Byte)val;\n          break;\n\n        case (16 / FT_CHAR_BIT):\n          *(FT_UShort*)q = (FT_UShort)val;\n          break;\n\n        case (32 / FT_CHAR_BIT):\n          *(FT_UInt32*)q = (FT_UInt32)val;\n          break;\n\n        default:                /* for 64-bit systems */\n          *(FT_Long*)q = val;\n        }\n        break;\n\n      case T1_FIELD_TYPE_STRING:\n      case T1_FIELD_TYPE_KEY:\n        {\n          FT_Memory  memory = parser->memory;\n          FT_UInt    len    = (FT_UInt)( limit - cur );\n\n\n          if ( cur >= limit )\n            break;\n\n          /* we allow both a string or a name   */\n          /* for cases like /FontName (foo) def */\n          if ( token.type == T1_TOKEN_TYPE_KEY )\n          {\n            /* don't include leading `/' */\n            len--;\n            cur++;\n          }\n          else if ( token.type == T1_TOKEN_TYPE_STRING )\n          {\n            /* don't include delimiting parentheses    */\n            /* XXX we don't handle <<...>> here        */\n            /* XXX should we convert octal escapes?    */\n            /*     if so, what encoding should we use? */\n            cur++;\n            len -= 2;\n          }\n          else\n          {\n            FT_ERROR(( \"ps_parser_load_field:\"\n                       \" expected a name or string\\n\"\n                       \"                     \"\n                       \" but found token of type %d instead\\n\",\n                       token.type ));\n            error = FT_THROW( Invalid_File_Format );\n            goto Exit;\n          }\n\n          /* for this to work (FT_String**)q must have been */\n          /* initialized to NULL                            */\n          if ( *(FT_String**)q != NULL )\n          {\n            FT_TRACE0(( \"ps_parser_load_field: overwriting field %s\\n\",\n                        field->ident ));\n            FT_FREE( *(FT_String**)q );\n            *(FT_String**)q = NULL;\n          }\n\n          if ( FT_ALLOC( string, len + 1 ) )\n            goto Exit;\n\n          FT_MEM_COPY( string, cur, len );\n          string[len] = 0;\n\n          *(FT_String**)q = string;\n        }\n        break;\n\n      case T1_FIELD_TYPE_BBOX:\n        {\n          FT_Fixed  temp[4];\n          FT_BBox*  bbox = (FT_BBox*)q;\n          FT_Int    result;\n\n\n          result = ps_tofixedarray( &cur, limit, 4, temp, 0 );\n\n          if ( result < 4 )\n          {\n            FT_ERROR(( \"ps_parser_load_field:\"\n                       \" expected four integers in bounding box\\n\" ));\n            error = FT_THROW( Invalid_File_Format );\n            goto Exit;\n          }\n\n          bbox->xMin = FT_RoundFix( temp[0] );\n          bbox->yMin = FT_RoundFix( temp[1] );\n          bbox->xMax = FT_RoundFix( temp[2] );\n          bbox->yMax = FT_RoundFix( temp[3] );\n        }\n        break;\n\n      case T1_FIELD_TYPE_MM_BBOX:\n        {\n          FT_Memory  memory = parser->memory;\n          FT_Fixed*  temp;\n          FT_Int     result;\n          FT_UInt    i;\n\n\n          if ( FT_NEW_ARRAY( temp, max_objects * 4 ) )\n            goto Exit;\n\n          for ( i = 0; i < 4; i++ )\n          {\n            result = ps_tofixedarray( &cur, limit, max_objects,\n                                      temp + i * max_objects, 0 );\n            if ( result < 0 || (FT_UInt)result < max_objects )\n            {\n              FT_ERROR(( \"ps_parser_load_field:\"\n                         \" expected %d integers in the %s subarray\\n\"\n                         \"                     \"\n                         \" of /FontBBox in the /Blend dictionary\\n\",\n                         max_objects,\n                         i == 0 ? \"first\"\n                                : ( i == 1 ? \"second\"\n                                           : ( i == 2 ? \"third\"\n                                                      : \"fourth\" ) ) ));\n              error = FT_THROW( Invalid_File_Format );\n              goto Exit;\n            }\n\n            skip_spaces( &cur, limit );\n          }\n\n          for ( i = 0; i < max_objects; i++ )\n          {\n            FT_BBox*  bbox = (FT_BBox*)objects[i];\n\n\n            bbox->xMin = FT_RoundFix( temp[i                  ] );\n            bbox->yMin = FT_RoundFix( temp[i +     max_objects] );\n            bbox->xMax = FT_RoundFix( temp[i + 2 * max_objects] );\n            bbox->yMax = FT_RoundFix( temp[i + 3 * max_objects] );\n          }\n\n          FT_FREE( temp );\n        }\n        break;\n\n      default:\n        /* an error occurred */\n        goto Fail;\n      }\n    }\n\n#if 0  /* obsolete -- keep for reference */\n    if ( pflags )\n      *pflags |= 1L << field->flag_bit;\n#else\n    FT_UNUSED( pflags );\n#endif\n\n    error = FT_Err_Ok;\n\n  Exit:\n    return error;\n\n  Fail:\n    error = FT_THROW( Invalid_File_Format );\n    goto Exit;\n  }\n\n\n#define T1_MAX_TABLE_ELEMENTS  32\n\n\n  FT_LOCAL_DEF( FT_Error )\n  ps_parser_load_field_table( PS_Parser       parser,\n                              const T1_Field  field,\n                              void**          objects,\n                              FT_UInt         max_objects,\n                              FT_ULong*       pflags )\n  {\n    T1_TokenRec  elements[T1_MAX_TABLE_ELEMENTS];\n    T1_Token     token;\n    FT_Int       num_elements;\n    FT_Error     error = FT_Err_Ok;\n    FT_Byte*     old_cursor;\n    FT_Byte*     old_limit;\n    T1_FieldRec  fieldrec = *(T1_Field)field;\n\n\n    fieldrec.type = T1_FIELD_TYPE_INTEGER;\n    if ( field->type == T1_FIELD_TYPE_FIXED_ARRAY ||\n         field->type == T1_FIELD_TYPE_BBOX        )\n      fieldrec.type = T1_FIELD_TYPE_FIXED;\n\n    ps_parser_to_token_array( parser, elements,\n                              T1_MAX_TABLE_ELEMENTS, &num_elements );\n    if ( num_elements < 0 )\n    {\n      error = FT_ERR( Ignore );\n      goto Exit;\n    }\n    if ( (FT_UInt)num_elements > field->array_max )\n      num_elements = field->array_max;\n\n    old_cursor = parser->cursor;\n    old_limit  = parser->limit;\n\n    /* we store the elements count if necessary;           */\n    /* we further assume that `count_offset' can't be zero */\n    if ( field->type != T1_FIELD_TYPE_BBOX && field->count_offset != 0 )\n      *(FT_Byte*)( (FT_Byte*)objects[0] + field->count_offset ) =\n        (FT_Byte)num_elements;\n\n    /* we now load each element, adjusting the field.offset on each one */\n    token = elements;\n    for ( ; num_elements > 0; num_elements--, token++ )\n    {\n      parser->cursor = token->start;\n      parser->limit  = token->limit;\n\n      error = ps_parser_load_field( parser,\n                                    &fieldrec,\n                                    objects,\n                                    max_objects,\n                                    0 );\n      if ( error )\n        break;\n\n      fieldrec.offset += fieldrec.size;\n    }\n\n#if 0  /* obsolete -- keep for reference */\n    if ( pflags )\n      *pflags |= 1L << field->flag_bit;\n#else\n    FT_UNUSED( pflags );\n#endif\n\n    parser->cursor = old_cursor;\n    parser->limit  = old_limit;\n\n  Exit:\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Long )\n  ps_parser_to_int( PS_Parser  parser )\n  {\n    ps_parser_skip_spaces( parser );\n    return PS_Conv_ToInt( &parser->cursor, parser->limit );\n  }\n\n\n  /* first character must be `<' if `delimiters' is non-zero */\n\n  FT_LOCAL_DEF( FT_Error )\n  ps_parser_to_bytes( PS_Parser  parser,\n                      FT_Byte*   bytes,\n                      FT_Offset  max_bytes,\n                      FT_Long*   pnum_bytes,\n                      FT_Bool    delimiters )\n  {\n    FT_Error  error = FT_Err_Ok;\n    FT_Byte*  cur;\n\n\n    ps_parser_skip_spaces( parser );\n    cur = parser->cursor;\n\n    if ( cur >= parser->limit )\n      goto Exit;\n\n    if ( delimiters )\n    {\n      if ( *cur != '<' )\n      {\n        FT_ERROR(( \"ps_parser_to_bytes: Missing starting delimiter `<'\\n\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Exit;\n      }\n\n      cur++;\n    }\n\n    *pnum_bytes = PS_Conv_ASCIIHexDecode( &cur,\n                                          parser->limit,\n                                          bytes,\n                                          max_bytes );\n\n    if ( delimiters )\n    {\n      if ( cur < parser->limit && *cur != '>' )\n      {\n        FT_ERROR(( \"ps_parser_to_bytes: Missing closing delimiter `>'\\n\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Exit;\n      }\n\n      cur++;\n    }\n\n    parser->cursor = cur;\n\n  Exit:\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Fixed )\n  ps_parser_to_fixed( PS_Parser  parser,\n                      FT_Int     power_ten )\n  {\n    ps_parser_skip_spaces( parser );\n    return PS_Conv_ToFixed( &parser->cursor, parser->limit, power_ten );\n  }\n\n\n  FT_LOCAL_DEF( FT_Int )\n  ps_parser_to_coord_array( PS_Parser  parser,\n                            FT_Int     max_coords,\n                            FT_Short*  coords )\n  {\n    ps_parser_skip_spaces( parser );\n    return ps_tocoordarray( &parser->cursor, parser->limit,\n                            max_coords, coords );\n  }\n\n\n  FT_LOCAL_DEF( FT_Int )\n  ps_parser_to_fixed_array( PS_Parser  parser,\n                            FT_Int     max_values,\n                            FT_Fixed*  values,\n                            FT_Int     power_ten )\n  {\n    ps_parser_skip_spaces( parser );\n    return ps_tofixedarray( &parser->cursor, parser->limit,\n                            max_values, values, power_ten );\n  }\n\n\n#if 0\n\n  FT_LOCAL_DEF( FT_String* )\n  T1_ToString( PS_Parser  parser )\n  {\n    return ps_tostring( &parser->cursor, parser->limit, parser->memory );\n  }\n\n\n  FT_LOCAL_DEF( FT_Bool )\n  T1_ToBool( PS_Parser  parser )\n  {\n    return ps_tobool( &parser->cursor, parser->limit );\n  }\n\n#endif /* 0 */\n\n\n  FT_LOCAL_DEF( void )\n  ps_parser_init( PS_Parser  parser,\n                  FT_Byte*   base,\n                  FT_Byte*   limit,\n                  FT_Memory  memory )\n  {\n    parser->error  = FT_Err_Ok;\n    parser->base   = base;\n    parser->limit  = limit;\n    parser->cursor = base;\n    parser->memory = memory;\n    parser->funcs  = ps_parser_funcs;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  ps_parser_done( PS_Parser  parser )\n  {\n    FT_UNUSED( parser );\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                            T1 BUILDER                         *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    t1_builder_init                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initializes a given glyph builder.                                 */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    builder :: A pointer to the glyph builder to initialize.           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: The current face object.                                */\n  /*                                                                       */\n  /*    size    :: The current size object.                                */\n  /*                                                                       */\n  /*    glyph   :: The current glyph object.                               */\n  /*                                                                       */\n  /*    hinting :: Whether hinting should be applied.                      */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  t1_builder_init( T1_Builder    builder,\n                   FT_Face       face,\n                   FT_Size       size,\n                   FT_GlyphSlot  glyph,\n                   FT_Bool       hinting )\n  {\n    builder->parse_state = T1_Parse_Start;\n    builder->load_points = 1;\n\n    builder->face   = face;\n    builder->glyph  = glyph;\n    builder->memory = face->memory;\n\n    if ( glyph )\n    {\n      FT_GlyphLoader  loader = glyph->internal->loader;\n\n\n      builder->loader  = loader;\n      builder->base    = &loader->base.outline;\n      builder->current = &loader->current.outline;\n      FT_GlyphLoader_Rewind( loader );\n\n      builder->hints_globals = size->internal;\n      builder->hints_funcs   = 0;\n\n      if ( hinting )\n        builder->hints_funcs = glyph->internal->glyph_hints;\n    }\n\n    builder->pos_x = 0;\n    builder->pos_y = 0;\n\n    builder->left_bearing.x = 0;\n    builder->left_bearing.y = 0;\n    builder->advance.x      = 0;\n    builder->advance.y      = 0;\n\n    builder->funcs = t1_builder_funcs;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    t1_builder_done                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Finalizes a given glyph builder.  Its contents can still be used   */\n  /*    after the call, but the function saves important information       */\n  /*    within the corresponding glyph slot.                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    builder :: A pointer to the glyph builder to finalize.             */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  t1_builder_done( T1_Builder  builder )\n  {\n    FT_GlyphSlot  glyph = builder->glyph;\n\n\n    if ( glyph )\n      glyph->outline = *builder->base;\n  }\n\n\n  /* check that there is enough space for `count' more points */\n  FT_LOCAL_DEF( FT_Error )\n  t1_builder_check_points( T1_Builder  builder,\n                           FT_Int      count )\n  {\n    return FT_GLYPHLOADER_CHECK_POINTS( builder->loader, count, 0 );\n  }\n\n\n  /* add a new point, do not check space */\n  FT_LOCAL_DEF( void )\n  t1_builder_add_point( T1_Builder  builder,\n                        FT_Pos      x,\n                        FT_Pos      y,\n                        FT_Byte     flag )\n  {\n    FT_Outline*  outline = builder->current;\n\n\n    if ( builder->load_points )\n    {\n      FT_Vector*  point   = outline->points + outline->n_points;\n      FT_Byte*    control = (FT_Byte*)outline->tags + outline->n_points;\n\n\n      point->x = FIXED_TO_INT( x );\n      point->y = FIXED_TO_INT( y );\n      *control = (FT_Byte)( flag ? FT_CURVE_TAG_ON : FT_CURVE_TAG_CUBIC );\n    }\n    outline->n_points++;\n  }\n\n\n  /* check space for a new on-curve point, then add it */\n  FT_LOCAL_DEF( FT_Error )\n  t1_builder_add_point1( T1_Builder  builder,\n                         FT_Pos      x,\n                         FT_Pos      y )\n  {\n    FT_Error  error;\n\n\n    error = t1_builder_check_points( builder, 1 );\n    if ( !error )\n      t1_builder_add_point( builder, x, y, 1 );\n\n    return error;\n  }\n\n\n  /* check space for a new contour, then add it */\n  FT_LOCAL_DEF( FT_Error )\n  t1_builder_add_contour( T1_Builder  builder )\n  {\n    FT_Outline*  outline = builder->current;\n    FT_Error     error;\n\n\n    /* this might happen in invalid fonts */\n    if ( !outline )\n    {\n      FT_ERROR(( \"t1_builder_add_contour: no outline to add points to\\n\" ));\n      return FT_THROW( Invalid_File_Format );\n    }\n\n    if ( !builder->load_points )\n    {\n      outline->n_contours++;\n      return FT_Err_Ok;\n    }\n\n    error = FT_GLYPHLOADER_CHECK_POINTS( builder->loader, 0, 1 );\n    if ( !error )\n    {\n      if ( outline->n_contours > 0 )\n        outline->contours[outline->n_contours - 1] =\n          (short)( outline->n_points - 1 );\n\n      outline->n_contours++;\n    }\n\n    return error;\n  }\n\n\n  /* if a path was begun, add its first on-curve point */\n  FT_LOCAL_DEF( FT_Error )\n  t1_builder_start_point( T1_Builder  builder,\n                          FT_Pos      x,\n                          FT_Pos      y )\n  {\n    FT_Error  error = FT_ERR( Invalid_File_Format );\n\n\n    /* test whether we are building a new contour */\n\n    if ( builder->parse_state == T1_Parse_Have_Path )\n      error = FT_Err_Ok;\n    else\n    {\n      builder->parse_state = T1_Parse_Have_Path;\n      error = t1_builder_add_contour( builder );\n      if ( !error )\n        error = t1_builder_add_point1( builder, x, y );\n    }\n\n    return error;\n  }\n\n\n  /* close the current contour */\n  FT_LOCAL_DEF( void )\n  t1_builder_close_contour( T1_Builder  builder )\n  {\n    FT_Outline*  outline = builder->current;\n    FT_Int       first;\n\n\n    if ( !outline )\n      return;\n\n    first = outline->n_contours <= 1\n            ? 0 : outline->contours[outline->n_contours - 2] + 1;\n\n    /* We must not include the last point in the path if it */\n    /* is located on the first point.                       */\n    if ( outline->n_points > 1 )\n    {\n      FT_Vector*  p1      = outline->points + first;\n      FT_Vector*  p2      = outline->points + outline->n_points - 1;\n      FT_Byte*    control = (FT_Byte*)outline->tags + outline->n_points - 1;\n\n\n      /* `delete' last point only if it coincides with the first */\n      /* point and it is not a control point (which can happen). */\n      if ( p1->x == p2->x && p1->y == p2->y )\n        if ( *control == FT_CURVE_TAG_ON )\n          outline->n_points--;\n    }\n\n    if ( outline->n_contours > 0 )\n    {\n      /* Don't add contours only consisting of one point, i.e.,  */\n      /* check whether the first and the last point is the same. */\n      if ( first == outline->n_points - 1 )\n      {\n        outline->n_contours--;\n        outline->n_points--;\n      }\n      else\n        outline->contours[outline->n_contours - 1] =\n          (short)( outline->n_points - 1 );\n    }\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                            OTHER                              *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL_DEF( void )\n  t1_decrypt( FT_Byte*   buffer,\n              FT_Offset  length,\n              FT_UShort  seed )\n  {\n    PS_Conv_EexecDecode( &buffer,\n                         buffer + length,\n                         buffer,\n                         length,\n                         &seed );\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/psaux/psobjs.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  psobjs.h                                                               */\n/*                                                                         */\n/*    Auxiliary functions for PostScript fonts (specification).            */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PSOBJS_H__\n#define __PSOBJS_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_POSTSCRIPT_AUX_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                             T1_TABLE                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  FT_CALLBACK_TABLE\n  const PS_Table_FuncsRec    ps_table_funcs;\n\n  FT_CALLBACK_TABLE\n  const PS_Parser_FuncsRec   ps_parser_funcs;\n\n  FT_CALLBACK_TABLE\n  const T1_Builder_FuncsRec  t1_builder_funcs;\n\n\n  FT_LOCAL( FT_Error )\n  ps_table_new( PS_Table   table,\n                FT_Int     count,\n                FT_Memory  memory );\n\n  FT_LOCAL( FT_Error )\n  ps_table_add( PS_Table    table,\n                FT_Int      idx,\n                void*       object,\n                FT_PtrDist  length );\n\n  FT_LOCAL( void )\n  ps_table_done( PS_Table  table );\n\n\n  FT_LOCAL( void )\n  ps_table_release( PS_Table  table );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                            T1 PARSER                          *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  FT_LOCAL( void )\n  ps_parser_skip_spaces( PS_Parser  parser );\n\n  FT_LOCAL( void )\n  ps_parser_skip_PS_token( PS_Parser  parser );\n\n  FT_LOCAL( void )\n  ps_parser_to_token( PS_Parser  parser,\n                      T1_Token   token );\n\n  FT_LOCAL( void )\n  ps_parser_to_token_array( PS_Parser  parser,\n                            T1_Token   tokens,\n                            FT_UInt    max_tokens,\n                            FT_Int*    pnum_tokens );\n\n  FT_LOCAL( FT_Error )\n  ps_parser_load_field( PS_Parser       parser,\n                        const T1_Field  field,\n                        void**          objects,\n                        FT_UInt         max_objects,\n                        FT_ULong*       pflags );\n\n  FT_LOCAL( FT_Error )\n  ps_parser_load_field_table( PS_Parser       parser,\n                              const T1_Field  field,\n                              void**          objects,\n                              FT_UInt         max_objects,\n                              FT_ULong*       pflags );\n\n  FT_LOCAL( FT_Long )\n  ps_parser_to_int( PS_Parser  parser );\n\n\n  FT_LOCAL( FT_Error )\n  ps_parser_to_bytes( PS_Parser  parser,\n                      FT_Byte*   bytes,\n                      FT_Offset  max_bytes,\n                      FT_Long*   pnum_bytes,\n                      FT_Bool    delimiters );\n\n\n  FT_LOCAL( FT_Fixed )\n  ps_parser_to_fixed( PS_Parser  parser,\n                      FT_Int     power_ten );\n\n\n  FT_LOCAL( FT_Int )\n  ps_parser_to_coord_array( PS_Parser  parser,\n                            FT_Int     max_coords,\n                            FT_Short*  coords );\n\n  FT_LOCAL( FT_Int )\n  ps_parser_to_fixed_array( PS_Parser  parser,\n                            FT_Int     max_values,\n                            FT_Fixed*  values,\n                            FT_Int     power_ten );\n\n\n  FT_LOCAL( void )\n  ps_parser_init( PS_Parser  parser,\n                  FT_Byte*   base,\n                  FT_Byte*   limit,\n                  FT_Memory  memory );\n\n  FT_LOCAL( void )\n  ps_parser_done( PS_Parser  parser );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                            T1 BUILDER                         *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL( void )\n  t1_builder_init( T1_Builder    builder,\n                   FT_Face       face,\n                   FT_Size       size,\n                   FT_GlyphSlot  glyph,\n                   FT_Bool       hinting );\n\n  FT_LOCAL( void )\n  t1_builder_done( T1_Builder  builder );\n\n  FT_LOCAL( FT_Error )\n  t1_builder_check_points( T1_Builder  builder,\n                           FT_Int      count );\n\n  FT_LOCAL( void )\n  t1_builder_add_point( T1_Builder  builder,\n                        FT_Pos      x,\n                        FT_Pos      y,\n                        FT_Byte     flag );\n\n  FT_LOCAL( FT_Error )\n  t1_builder_add_point1( T1_Builder  builder,\n                         FT_Pos      x,\n                         FT_Pos      y );\n\n  FT_LOCAL( FT_Error )\n  t1_builder_add_contour( T1_Builder  builder );\n\n\n  FT_LOCAL( FT_Error )\n  t1_builder_start_point( T1_Builder  builder,\n                          FT_Pos      x,\n                          FT_Pos      y );\n\n\n  FT_LOCAL( void )\n  t1_builder_close_contour( T1_Builder  builder );\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                            OTHER                              *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_LOCAL( void )\n  t1_decrypt( FT_Byte*   buffer,\n              FT_Offset  length,\n              FT_UShort  seed );\n\n\nFT_END_HEADER\n\n#endif /* __PSOBJS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/psaux/rules.mk",
    "content": "#\n# FreeType 2 PSaux driver configuration rules\n#\n\n\n# Copyright 1996-2000, 2002, 2003, 2006 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\n# PSAUX driver directory\n#\nPSAUX_DIR := $(SRC_DIR)/psaux\n\n\n# compilation flags for the driver\n#\nPSAUX_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PSAUX_DIR))\n\n\n# PSAUX driver sources (i.e., C files)\n#\nPSAUX_DRV_SRC := $(PSAUX_DIR)/psobjs.c   \\\n                 $(PSAUX_DIR)/t1decode.c \\\n                 $(PSAUX_DIR)/t1cmap.c   \\\n                 $(PSAUX_DIR)/afmparse.c \\\n                 $(PSAUX_DIR)/psconv.c   \\\n                 $(PSAUX_DIR)/psauxmod.c\n\n# PSAUX driver headers\n#\nPSAUX_DRV_H := $(PSAUX_DRV_SRC:%c=%h)  \\\n               $(PSAUX_DIR)/psauxerr.h\n\n\n# PSAUX driver object(s)\n#\n#   PSAUX_DRV_OBJ_M is used during `multi' builds.\n#   PSAUX_DRV_OBJ_S is used during `single' builds.\n#\nPSAUX_DRV_OBJ_M := $(PSAUX_DRV_SRC:$(PSAUX_DIR)/%.c=$(OBJ_DIR)/%.$O)\nPSAUX_DRV_OBJ_S := $(OBJ_DIR)/psaux.$O\n\n# PSAUX driver source file for single build\n#\nPSAUX_DRV_SRC_S := $(PSAUX_DIR)/psaux.c\n\n\n# PSAUX driver - single object\n#\n$(PSAUX_DRV_OBJ_S): $(PSAUX_DRV_SRC_S) $(PSAUX_DRV_SRC) \\\n                   $(FREETYPE_H) $(PSAUX_DRV_H)\n\t$(PSAUX_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PSAUX_DRV_SRC_S))\n\n\n# PSAUX driver - multiple objects\n#\n$(OBJ_DIR)/%.$O: $(PSAUX_DIR)/%.c $(FREETYPE_H) $(PSAUX_DRV_H)\n\t$(PSAUX_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\n\n\n# update main driver object lists\n#\nDRV_OBJS_S += $(PSAUX_DRV_OBJ_S)\nDRV_OBJS_M += $(PSAUX_DRV_OBJ_M)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/psaux/t1cmap.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1cmap.c                                                               */\n/*                                                                         */\n/*    Type 1 character map support (body).                                 */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2006, 2007, 2012 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"t1cmap.h\"\n\n#include FT_INTERNAL_DEBUG_H\n\n#include \"psauxerr.h\"\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****          TYPE1 STANDARD (AND EXPERT) ENCODING CMAPS           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static void\n  t1_cmap_std_init( T1_CMapStd  cmap,\n                    FT_Int      is_expert )\n  {\n    T1_Face             face    = (T1_Face)FT_CMAP_FACE( cmap );\n    FT_Service_PsCMaps  psnames = (FT_Service_PsCMaps)face->psnames;\n\n\n    cmap->num_glyphs    = face->type1.num_glyphs;\n    cmap->glyph_names   = (const char* const*)face->type1.glyph_names;\n    cmap->sid_to_string = psnames->adobe_std_strings;\n    cmap->code_to_sid   = is_expert ? psnames->adobe_expert_encoding\n                                    : psnames->adobe_std_encoding;\n\n    FT_ASSERT( cmap->code_to_sid != NULL );\n  }\n\n\n  FT_CALLBACK_DEF( void )\n  t1_cmap_std_done( T1_CMapStd  cmap )\n  {\n    cmap->num_glyphs    = 0;\n    cmap->glyph_names   = NULL;\n    cmap->sid_to_string = NULL;\n    cmap->code_to_sid   = NULL;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt )\n  t1_cmap_std_char_index( T1_CMapStd  cmap,\n                          FT_UInt32   char_code )\n  {\n    FT_UInt  result = 0;\n\n\n    if ( char_code < 256 )\n    {\n      FT_UInt      code, n;\n      const char*  glyph_name;\n\n\n      /* convert character code to Adobe SID string */\n      code       = cmap->code_to_sid[char_code];\n      glyph_name = cmap->sid_to_string( code );\n\n      /* look for the corresponding glyph name */\n      for ( n = 0; n < cmap->num_glyphs; n++ )\n      {\n        const char* gname = cmap->glyph_names[n];\n\n\n        if ( gname && gname[0] == glyph_name[0]  &&\n             ft_strcmp( gname, glyph_name ) == 0 )\n        {\n          result = n;\n          break;\n        }\n      }\n    }\n\n    return result;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt32 )\n  t1_cmap_std_char_next( T1_CMapStd   cmap,\n                         FT_UInt32   *pchar_code )\n  {\n    FT_UInt    result    = 0;\n    FT_UInt32  char_code = *pchar_code + 1;\n\n\n    while ( char_code < 256 )\n    {\n      result = t1_cmap_std_char_index( cmap, char_code );\n      if ( result != 0 )\n        goto Exit;\n\n      char_code++;\n    }\n    char_code = 0;\n\n  Exit:\n    *pchar_code = char_code;\n    return result;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  t1_cmap_standard_init( T1_CMapStd  cmap,\n                         FT_Pointer  pointer )\n  {\n    FT_UNUSED( pointer );\n\n\n    t1_cmap_std_init( cmap, 0 );\n    return 0;\n  }\n\n\n  FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec\n  t1_cmap_standard_class_rec =\n  {\n    sizeof ( T1_CMapStdRec ),\n\n    (FT_CMap_InitFunc)     t1_cmap_standard_init,\n    (FT_CMap_DoneFunc)     t1_cmap_std_done,\n    (FT_CMap_CharIndexFunc)t1_cmap_std_char_index,\n    (FT_CMap_CharNextFunc) t1_cmap_std_char_next,\n\n    NULL, NULL, NULL, NULL, NULL\n  };\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  t1_cmap_expert_init( T1_CMapStd  cmap,\n                       FT_Pointer  pointer )\n  {\n    FT_UNUSED( pointer );\n\n\n    t1_cmap_std_init( cmap, 1 );\n    return 0;\n  }\n\n  FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec\n  t1_cmap_expert_class_rec =\n  {\n    sizeof ( T1_CMapStdRec ),\n\n    (FT_CMap_InitFunc)     t1_cmap_expert_init,\n    (FT_CMap_DoneFunc)     t1_cmap_std_done,\n    (FT_CMap_CharIndexFunc)t1_cmap_std_char_index,\n    (FT_CMap_CharNextFunc) t1_cmap_std_char_next,\n\n    NULL, NULL, NULL, NULL, NULL\n  };\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    TYPE1 CUSTOM ENCODING CMAP                 *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  t1_cmap_custom_init( T1_CMapCustom  cmap,\n                       FT_Pointer     pointer )\n  {\n    T1_Face      face     = (T1_Face)FT_CMAP_FACE( cmap );\n    T1_Encoding  encoding = &face->type1.encoding;\n\n    FT_UNUSED( pointer );\n\n\n    cmap->first   = encoding->code_first;\n    cmap->count   = (FT_UInt)( encoding->code_last - cmap->first );\n    cmap->indices = encoding->char_index;\n\n    FT_ASSERT( cmap->indices != NULL );\n    FT_ASSERT( encoding->code_first <= encoding->code_last );\n\n    return 0;\n  }\n\n\n  FT_CALLBACK_DEF( void )\n  t1_cmap_custom_done( T1_CMapCustom  cmap )\n  {\n    cmap->indices = NULL;\n    cmap->first   = 0;\n    cmap->count   = 0;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt )\n  t1_cmap_custom_char_index( T1_CMapCustom  cmap,\n                             FT_UInt32      char_code )\n  {\n    FT_UInt    result = 0;\n\n\n    if ( ( char_code >= cmap->first )                  &&\n         ( char_code < ( cmap->first + cmap->count ) ) )\n      result = cmap->indices[char_code];\n\n    return result;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt32 )\n  t1_cmap_custom_char_next( T1_CMapCustom  cmap,\n                            FT_UInt32     *pchar_code )\n  {\n    FT_UInt    result = 0;\n    FT_UInt32  char_code = *pchar_code;\n\n\n    ++char_code;\n\n    if ( char_code < cmap->first )\n      char_code = cmap->first;\n\n    for ( ; char_code < ( cmap->first + cmap->count ); char_code++ )\n    {\n      result = cmap->indices[char_code];\n      if ( result != 0 )\n        goto Exit;\n    }\n\n    char_code = 0;\n\n  Exit:\n    *pchar_code = char_code;\n    return result;\n  }\n\n\n  FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec\n  t1_cmap_custom_class_rec =\n  {\n    sizeof ( T1_CMapCustomRec ),\n\n    (FT_CMap_InitFunc)     t1_cmap_custom_init,\n    (FT_CMap_DoneFunc)     t1_cmap_custom_done,\n    (FT_CMap_CharIndexFunc)t1_cmap_custom_char_index,\n    (FT_CMap_CharNextFunc) t1_cmap_custom_char_next,\n\n    NULL, NULL, NULL, NULL, NULL\n  };\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****            TYPE1 SYNTHETIC UNICODE ENCODING CMAP              *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_CALLBACK_DEF( const char * )\n  psaux_get_glyph_name( T1_Face  face,\n                        FT_UInt  idx )\n  {\n    return face->type1.glyph_names[idx];\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  t1_cmap_unicode_init( PS_Unicodes  unicodes,\n                        FT_Pointer   pointer )\n  {\n    T1_Face             face    = (T1_Face)FT_CMAP_FACE( unicodes );\n    FT_Memory           memory  = FT_FACE_MEMORY( face );\n    FT_Service_PsCMaps  psnames = (FT_Service_PsCMaps)face->psnames;\n\n    FT_UNUSED( pointer );\n\n\n    return psnames->unicodes_init( memory,\n                                   unicodes,\n                                   face->type1.num_glyphs,\n                                   (PS_GetGlyphNameFunc)&psaux_get_glyph_name,\n                                   (PS_FreeGlyphNameFunc)NULL,\n                                   (FT_Pointer)face );\n  }\n\n\n  FT_CALLBACK_DEF( void )\n  t1_cmap_unicode_done( PS_Unicodes  unicodes )\n  {\n    FT_Face    face   = FT_CMAP_FACE( unicodes );\n    FT_Memory  memory = FT_FACE_MEMORY( face );\n\n\n    FT_FREE( unicodes->maps );\n    unicodes->num_maps = 0;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt )\n  t1_cmap_unicode_char_index( PS_Unicodes  unicodes,\n                              FT_UInt32    char_code )\n  {\n    T1_Face             face    = (T1_Face)FT_CMAP_FACE( unicodes );\n    FT_Service_PsCMaps  psnames = (FT_Service_PsCMaps)face->psnames;\n\n\n    return psnames->unicodes_char_index( unicodes, char_code );\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt32 )\n  t1_cmap_unicode_char_next( PS_Unicodes  unicodes,\n                             FT_UInt32   *pchar_code )\n  {\n    T1_Face             face    = (T1_Face)FT_CMAP_FACE( unicodes );\n    FT_Service_PsCMaps  psnames = (FT_Service_PsCMaps)face->psnames;\n\n\n    return psnames->unicodes_char_next( unicodes, pchar_code );\n  }\n\n\n  FT_CALLBACK_TABLE_DEF const FT_CMap_ClassRec\n  t1_cmap_unicode_class_rec =\n  {\n    sizeof ( PS_UnicodesRec ),\n\n    (FT_CMap_InitFunc)     t1_cmap_unicode_init,\n    (FT_CMap_DoneFunc)     t1_cmap_unicode_done,\n    (FT_CMap_CharIndexFunc)t1_cmap_unicode_char_index,\n    (FT_CMap_CharNextFunc) t1_cmap_unicode_char_next,\n\n    NULL, NULL, NULL, NULL, NULL\n  };\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/psaux/t1cmap.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1cmap.h                                                               */\n/*                                                                         */\n/*    Type 1 character map support (specification).                        */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2006 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T1CMAP_H__\n#define __T1CMAP_H__\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_TYPE1_TYPES_H\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****          TYPE1 STANDARD (AND EXPERT) ENCODING CMAPS           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* standard (and expert) encoding cmaps */\n  typedef struct T1_CMapStdRec_*  T1_CMapStd;\n\n  typedef struct  T1_CMapStdRec_\n  {\n    FT_CMapRec                cmap;\n\n    const FT_UShort*          code_to_sid;\n    PS_Adobe_Std_StringsFunc  sid_to_string;\n\n    FT_UInt                   num_glyphs;\n    const char* const*        glyph_names;\n\n  } T1_CMapStdRec;\n\n\n  FT_CALLBACK_TABLE const FT_CMap_ClassRec\n  t1_cmap_standard_class_rec;\n\n  FT_CALLBACK_TABLE const FT_CMap_ClassRec\n  t1_cmap_expert_class_rec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                  TYPE1 CUSTOM ENCODING CMAP                   *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef struct T1_CMapCustomRec_*  T1_CMapCustom;\n\n  typedef struct  T1_CMapCustomRec_\n  {\n    FT_CMapRec  cmap;\n    FT_UInt     first;\n    FT_UInt     count;\n    FT_UShort*  indices;\n\n  } T1_CMapCustomRec;\n\n\n  FT_CALLBACK_TABLE const FT_CMap_ClassRec\n  t1_cmap_custom_class_rec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****             TYPE1 SYNTHETIC UNICODE ENCODING CMAP             *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* unicode (synthetic) cmaps */\n\n  FT_CALLBACK_TABLE const FT_CMap_ClassRec\n  t1_cmap_unicode_class_rec;\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __T1CMAP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/psaux/t1decode.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1decode.c                                                             */\n/*                                                                         */\n/*    PostScript Type 1 decoding routines (body).                          */\n/*                                                                         */\n/*  Copyright 2000-2014 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_CALC_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_POSTSCRIPT_HINTS_H\n#include FT_OUTLINE_H\n\n#include \"t1decode.h\"\n#include \"psobjs.h\"\n\n#include \"psauxerr.h\"\n\n/* ensure proper sign extension */\n#define Fix2Int( f )  ( (FT_Int)(FT_Short)( (f) >> 16 ) )\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_t1decode\n\n\n  typedef enum  T1_Operator_\n  {\n    op_none = 0,\n    op_endchar,\n    op_hsbw,\n    op_seac,\n    op_sbw,\n    op_closepath,\n    op_hlineto,\n    op_hmoveto,\n    op_hvcurveto,\n    op_rlineto,\n    op_rmoveto,\n    op_rrcurveto,\n    op_vhcurveto,\n    op_vlineto,\n    op_vmoveto,\n    op_dotsection,\n    op_hstem,\n    op_hstem3,\n    op_vstem,\n    op_vstem3,\n    op_div,\n    op_callothersubr,\n    op_callsubr,\n    op_pop,\n    op_return,\n    op_setcurrentpoint,\n    op_unknown15,\n\n    op_max    /* never remove this one */\n\n  } T1_Operator;\n\n\n  static\n  const FT_Int  t1_args_count[op_max] =\n  {\n    0, /* none */\n    0, /* endchar */\n    2, /* hsbw */\n    5, /* seac */\n    4, /* sbw */\n    0, /* closepath */\n    1, /* hlineto */\n    1, /* hmoveto */\n    4, /* hvcurveto */\n    2, /* rlineto */\n    2, /* rmoveto */\n    6, /* rrcurveto */\n    4, /* vhcurveto */\n    1, /* vlineto */\n    1, /* vmoveto */\n    0, /* dotsection */\n    2, /* hstem */\n    6, /* hstem3 */\n    2, /* vstem */\n    6, /* vstem3 */\n    2, /* div */\n   -1, /* callothersubr */\n    1, /* callsubr */\n    0, /* pop */\n    0, /* return */\n    2, /* setcurrentpoint */\n    2  /* opcode 15 (undocumented and obsolete) */\n  };\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    t1_lookup_glyph_by_stdcharcode                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Looks up a given glyph by its StandardEncoding charcode.  Used to  */\n  /*    implement the SEAC Type 1 operator.                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face     :: The current face object.                               */\n  /*                                                                       */\n  /*    charcode :: The character code to look for.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A glyph index in the font face.  Returns -1 if the corresponding   */\n  /*    glyph wasn't found.                                                */\n  /*                                                                       */\n  static FT_Int\n  t1_lookup_glyph_by_stdcharcode( T1_Decoder  decoder,\n                                  FT_Int      charcode )\n  {\n    FT_UInt             n;\n    const FT_String*    glyph_name;\n    FT_Service_PsCMaps  psnames = decoder->psnames;\n\n\n    /* check range of standard char code */\n    if ( charcode < 0 || charcode > 255 )\n      return -1;\n\n    glyph_name = psnames->adobe_std_strings(\n                   psnames->adobe_std_encoding[charcode]);\n\n    for ( n = 0; n < decoder->num_glyphs; n++ )\n    {\n      FT_String*  name = (FT_String*)decoder->glyph_names[n];\n\n\n      if ( name                               &&\n           name[0] == glyph_name[0]           &&\n           ft_strcmp( name, glyph_name ) == 0 )\n        return n;\n    }\n\n    return -1;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    t1operator_seac                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Implements the `seac' Type 1 operator for a Type 1 decoder.        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    decoder :: The current CID decoder.                                */\n  /*                                                                       */\n  /*    asb     :: The accent's side bearing.                              */\n  /*                                                                       */\n  /*    adx     :: The horizontal offset of the accent.                    */\n  /*                                                                       */\n  /*    ady     :: The vertical offset of the accent.                      */\n  /*                                                                       */\n  /*    bchar   :: The base character's StandardEncoding charcode.         */\n  /*                                                                       */\n  /*    achar   :: The accent character's StandardEncoding charcode.       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  static FT_Error\n  t1operator_seac( T1_Decoder  decoder,\n                   FT_Pos      asb,\n                   FT_Pos      adx,\n                   FT_Pos      ady,\n                   FT_Int      bchar,\n                   FT_Int      achar )\n  {\n    FT_Error     error;\n    FT_Int       bchar_index, achar_index;\n#if 0\n    FT_Int       n_base_points;\n    FT_Outline*  base = decoder->builder.base;\n#endif\n    FT_Vector    left_bearing, advance;\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n    T1_Face      face  = (T1_Face)decoder->builder.face;\n#endif\n\n\n    if ( decoder->seac )\n    {\n      FT_ERROR(( \"t1operator_seac: invalid nested seac\\n\" ));\n      return FT_THROW( Syntax_Error );\n    }\n\n    if ( decoder->builder.metrics_only )\n    {\n      FT_ERROR(( \"t1operator_seac: unexpected seac\\n\" ));\n      return FT_THROW( Syntax_Error );\n    }\n\n    /* seac weirdness */\n    adx += decoder->builder.left_bearing.x;\n\n    /* `glyph_names' is set to 0 for CID fonts which do not */\n    /* include an encoding.  How can we deal with these?    */\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n    if ( decoder->glyph_names == 0                   &&\n         !face->root.internal->incremental_interface )\n#else\n    if ( decoder->glyph_names == 0 )\n#endif /* FT_CONFIG_OPTION_INCREMENTAL */\n    {\n      FT_ERROR(( \"t1operator_seac:\"\n                 \" glyph names table not available in this font\\n\" ));\n      return FT_THROW( Syntax_Error );\n    }\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n    if ( face->root.internal->incremental_interface )\n    {\n      /* the caller must handle the font encoding also */\n      bchar_index = bchar;\n      achar_index = achar;\n    }\n    else\n#endif\n    {\n      bchar_index = t1_lookup_glyph_by_stdcharcode( decoder, bchar );\n      achar_index = t1_lookup_glyph_by_stdcharcode( decoder, achar );\n    }\n\n    if ( bchar_index < 0 || achar_index < 0 )\n    {\n      FT_ERROR(( \"t1operator_seac:\"\n                 \" invalid seac character code arguments\\n\" ));\n      return FT_THROW( Syntax_Error );\n    }\n\n    /* if we are trying to load a composite glyph, do not load the */\n    /* accent character and return the array of subglyphs.         */\n    if ( decoder->builder.no_recurse )\n    {\n      FT_GlyphSlot    glyph  = (FT_GlyphSlot)decoder->builder.glyph;\n      FT_GlyphLoader  loader = glyph->internal->loader;\n      FT_SubGlyph     subg;\n\n\n      /* reallocate subglyph array if necessary */\n      error = FT_GlyphLoader_CheckSubGlyphs( loader, 2 );\n      if ( error )\n        goto Exit;\n\n      subg = loader->current.subglyphs;\n\n      /* subglyph 0 = base character */\n      subg->index = bchar_index;\n      subg->flags = FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES |\n                    FT_SUBGLYPH_FLAG_USE_MY_METRICS;\n      subg->arg1  = 0;\n      subg->arg2  = 0;\n      subg++;\n\n      /* subglyph 1 = accent character */\n      subg->index = achar_index;\n      subg->flags = FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES;\n      subg->arg1  = (FT_Int)FIXED_TO_INT( adx - asb );\n      subg->arg2  = (FT_Int)FIXED_TO_INT( ady );\n\n      /* set up remaining glyph fields */\n      glyph->num_subglyphs = 2;\n      glyph->subglyphs     = loader->base.subglyphs;\n      glyph->format        = FT_GLYPH_FORMAT_COMPOSITE;\n\n      loader->current.num_subglyphs = 2;\n      goto Exit;\n    }\n\n    /* First load `bchar' in builder */\n    /* now load the unscaled outline */\n\n    FT_GlyphLoader_Prepare( decoder->builder.loader );  /* prepare loader */\n\n    /* the seac operator must not be nested */\n    decoder->seac = TRUE;\n    error = t1_decoder_parse_glyph( decoder, bchar_index );\n    decoder->seac = FALSE;\n    if ( error )\n      goto Exit;\n\n    /* save the left bearing and width of the base character */\n    /* as they will be erased by the next load.              */\n\n    left_bearing = decoder->builder.left_bearing;\n    advance      = decoder->builder.advance;\n\n    decoder->builder.left_bearing.x = 0;\n    decoder->builder.left_bearing.y = 0;\n\n    decoder->builder.pos_x = adx - asb;\n    decoder->builder.pos_y = ady;\n\n    /* Now load `achar' on top of */\n    /* the base outline           */\n\n    /* the seac operator must not be nested */\n    decoder->seac = TRUE;\n    error = t1_decoder_parse_glyph( decoder, achar_index );\n    decoder->seac = FALSE;\n    if ( error )\n      goto Exit;\n\n    /* restore the left side bearing and   */\n    /* advance width of the base character */\n\n    decoder->builder.left_bearing = left_bearing;\n    decoder->builder.advance      = advance;\n\n    decoder->builder.pos_x = 0;\n    decoder->builder.pos_y = 0;\n\n  Exit:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    t1_decoder_parse_charstrings                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Parses a given Type 1 charstrings program.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    decoder         :: The current Type 1 decoder.                     */\n  /*                                                                       */\n  /*    charstring_base :: The base address of the charstring stream.      */\n  /*                                                                       */\n  /*    charstring_len  :: The length in bytes of the charstring stream.   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  t1_decoder_parse_charstrings( T1_Decoder  decoder,\n                                FT_Byte*    charstring_base,\n                                FT_UInt     charstring_len )\n  {\n    FT_Error         error;\n    T1_Decoder_Zone  zone;\n    FT_Byte*         ip;\n    FT_Byte*         limit;\n    T1_Builder       builder = &decoder->builder;\n    FT_Pos           x, y, orig_x, orig_y;\n    FT_Int           known_othersubr_result_cnt   = 0;\n    FT_Int           unknown_othersubr_result_cnt = 0;\n    FT_Bool          large_int;\n    FT_Fixed         seed;\n\n    T1_Hints_Funcs   hinter;\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n    FT_Bool          bol = TRUE;\n#endif\n\n\n    /* compute random seed from stack address of parameter */\n    seed = (FT_Fixed)( ( (FT_PtrDist)(char*)&seed              ^\n                         (FT_PtrDist)(char*)&decoder           ^\n                         (FT_PtrDist)(char*)&charstring_base ) &\n                         FT_ULONG_MAX ) ;\n    seed = ( seed ^ ( seed >> 10 ) ^ ( seed >> 20 ) ) & 0xFFFFL;\n    if ( seed == 0 )\n      seed = 0x7384;\n\n    /* First of all, initialize the decoder */\n    decoder->top  = decoder->stack;\n    decoder->zone = decoder->zones;\n    zone          = decoder->zones;\n\n    builder->parse_state = T1_Parse_Start;\n\n    hinter = (T1_Hints_Funcs)builder->hints_funcs;\n\n    /* a font that reads BuildCharArray without setting */\n    /* its values first is buggy, but ...               */\n    FT_ASSERT( ( decoder->len_buildchar == 0 ) ==\n               ( decoder->buildchar == NULL )  );\n\n    if ( decoder->buildchar && decoder->len_buildchar > 0 )\n      ft_memset( &decoder->buildchar[0],\n                 0,\n                 sizeof ( decoder->buildchar[0] ) * decoder->len_buildchar );\n\n    FT_TRACE4(( \"\\n\"\n                \"Start charstring\\n\" ));\n\n    zone->base           = charstring_base;\n    limit = zone->limit  = charstring_base + charstring_len;\n    ip    = zone->cursor = zone->base;\n\n    error = FT_Err_Ok;\n\n    x = orig_x = builder->pos_x;\n    y = orig_y = builder->pos_y;\n\n    /* begin hints recording session, if any */\n    if ( hinter )\n      hinter->open( hinter->hints );\n\n    large_int = FALSE;\n\n    /* now, execute loop */\n    while ( ip < limit )\n    {\n      FT_Long*     top   = decoder->top;\n      T1_Operator  op    = op_none;\n      FT_Int32     value = 0;\n\n\n      FT_ASSERT( known_othersubr_result_cnt == 0   ||\n                 unknown_othersubr_result_cnt == 0 );\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n      if ( bol )\n      {\n        FT_TRACE5(( \" (%d)\", decoder->top - decoder->stack ));\n        bol = FALSE;\n      }\n#endif\n\n      /*********************************************************************/\n      /*                                                                   */\n      /* Decode operator or operand                                        */\n      /*                                                                   */\n      /*                                                                   */\n\n      /* first of all, decompress operator or value */\n      switch ( *ip++ )\n      {\n      case 1:\n        op = op_hstem;\n        break;\n\n      case 3:\n        op = op_vstem;\n        break;\n      case 4:\n        op = op_vmoveto;\n        break;\n      case 5:\n        op = op_rlineto;\n        break;\n      case 6:\n        op = op_hlineto;\n        break;\n      case 7:\n        op = op_vlineto;\n        break;\n      case 8:\n        op = op_rrcurveto;\n        break;\n      case 9:\n        op = op_closepath;\n        break;\n      case 10:\n        op = op_callsubr;\n        break;\n      case 11:\n        op = op_return;\n        break;\n\n      case 13:\n        op = op_hsbw;\n        break;\n      case 14:\n        op = op_endchar;\n        break;\n\n      case 15:          /* undocumented, obsolete operator */\n        op = op_unknown15;\n        break;\n\n      case 21:\n        op = op_rmoveto;\n        break;\n      case 22:\n        op = op_hmoveto;\n        break;\n\n      case 30:\n        op = op_vhcurveto;\n        break;\n      case 31:\n        op = op_hvcurveto;\n        break;\n\n      case 12:\n        if ( ip > limit )\n        {\n          FT_ERROR(( \"t1_decoder_parse_charstrings:\"\n                     \" invalid escape (12+EOF)\\n\" ));\n          goto Syntax_Error;\n        }\n\n        switch ( *ip++ )\n        {\n        case 0:\n          op = op_dotsection;\n          break;\n        case 1:\n          op = op_vstem3;\n          break;\n        case 2:\n          op = op_hstem3;\n          break;\n        case 6:\n          op = op_seac;\n          break;\n        case 7:\n          op = op_sbw;\n          break;\n        case 12:\n          op = op_div;\n          break;\n        case 16:\n          op = op_callothersubr;\n          break;\n        case 17:\n          op = op_pop;\n          break;\n        case 33:\n          op = op_setcurrentpoint;\n          break;\n\n        default:\n          FT_ERROR(( \"t1_decoder_parse_charstrings:\"\n                     \" invalid escape (12+%d)\\n\",\n                     ip[-1] ));\n          goto Syntax_Error;\n        }\n        break;\n\n      case 255:    /* four bytes integer */\n        if ( ip + 4 > limit )\n        {\n          FT_ERROR(( \"t1_decoder_parse_charstrings:\"\n                     \" unexpected EOF in integer\\n\" ));\n          goto Syntax_Error;\n        }\n\n        value = (FT_Int32)( ( (FT_UInt32)ip[0] << 24 ) |\n                            ( (FT_UInt32)ip[1] << 16 ) |\n                            ( (FT_UInt32)ip[2] << 8  ) |\n                              (FT_UInt32)ip[3]         );\n        ip += 4;\n\n        /* According to the specification, values > 32000 or < -32000 must */\n        /* be followed by a `div' operator to make the result be in the    */\n        /* range [-32000;32000].  We expect that the second argument of    */\n        /* `div' is not a large number.  Additionally, we don't handle     */\n        /* stuff like `<large1> <large2> <num> div <num> div' or           */\n        /* <large1> <large2> <num> div div'.  This is probably not allowed */\n        /* anyway.                                                         */\n        if ( value > 32000 || value < -32000 )\n        {\n          if ( large_int )\n          {\n            FT_ERROR(( \"t1_decoder_parse_charstrings:\"\n                       \" no `div' after large integer\\n\" ));\n          }\n          else\n            large_int = TRUE;\n        }\n        else\n        {\n          if ( !large_int )\n            value = (FT_Int32)( (FT_UInt32)value << 16 );\n        }\n\n        break;\n\n      default:\n        if ( ip[-1] >= 32 )\n        {\n          if ( ip[-1] < 247 )\n            value = (FT_Int32)ip[-1] - 139;\n          else\n          {\n            if ( ++ip > limit )\n            {\n              FT_ERROR(( \"t1_decoder_parse_charstrings:\"\n                         \" unexpected EOF in integer\\n\" ));\n              goto Syntax_Error;\n            }\n\n            if ( ip[-2] < 251 )\n              value =    ( ( ip[-2] - 247 ) * 256 ) + ip[-1] + 108;\n            else\n              value = -( ( ( ip[-2] - 251 ) * 256 ) + ip[-1] + 108 );\n          }\n\n          if ( !large_int )\n            value = (FT_Int32)( (FT_UInt32)value << 16 );\n        }\n        else\n        {\n          FT_ERROR(( \"t1_decoder_parse_charstrings:\"\n                     \" invalid byte (%d)\\n\", ip[-1] ));\n          goto Syntax_Error;\n        }\n      }\n\n      if ( unknown_othersubr_result_cnt > 0 )\n      {\n        switch ( op )\n        {\n        case op_callsubr:\n        case op_return:\n        case op_none:\n        case op_pop:\n          break;\n\n        default:\n          /* all operands have been transferred by previous pops */\n          unknown_othersubr_result_cnt = 0;\n          break;\n        }\n      }\n\n      if ( large_int && !( op == op_none || op == op_div ) )\n      {\n        FT_ERROR(( \"t1_decoder_parse_charstrings:\"\n                   \" no `div' after large integer\\n\" ));\n\n        large_int = FALSE;\n      }\n\n      /*********************************************************************/\n      /*                                                                   */\n      /*  Push value on stack, or process operator                         */\n      /*                                                                   */\n      /*                                                                   */\n      if ( op == op_none )\n      {\n        if ( top - decoder->stack >= T1_MAX_CHARSTRINGS_OPERANDS )\n        {\n          FT_ERROR(( \"t1_decoder_parse_charstrings: stack overflow\\n\" ));\n          goto Syntax_Error;\n        }\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n        if ( large_int )\n          FT_TRACE4(( \" %ld\", value ));\n        else\n          FT_TRACE4(( \" %ld\", Fix2Int( value ) ));\n#endif\n\n        *top++       = value;\n        decoder->top = top;\n      }\n      else if ( op == op_callothersubr )  /* callothersubr */\n      {\n        FT_Int  subr_no;\n        FT_Int  arg_cnt;\n\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n        FT_TRACE4(( \" callothersubr\\n\" ));\n        bol = TRUE;\n#endif\n\n        if ( top - decoder->stack < 2 )\n          goto Stack_Underflow;\n\n        top -= 2;\n\n        subr_no = Fix2Int( top[1] );\n        arg_cnt = Fix2Int( top[0] );\n\n        /***********************************************************/\n        /*                                                         */\n        /* remove all operands to callothersubr from the stack     */\n        /*                                                         */\n        /* for handled othersubrs, where we know the number of     */\n        /* arguments, we increase the stack by the value of        */\n        /* known_othersubr_result_cnt                              */\n        /*                                                         */\n        /* for unhandled othersubrs the following pops adjust the  */\n        /* stack pointer as necessary                              */\n\n        if ( arg_cnt > top - decoder->stack )\n          goto Stack_Underflow;\n\n        top -= arg_cnt;\n\n        known_othersubr_result_cnt   = 0;\n        unknown_othersubr_result_cnt = 0;\n\n        /* XXX TODO: The checks to `arg_count == <whatever>'       */\n        /* might not be correct; an othersubr expects a certain    */\n        /* number of operands on the PostScript stack (as opposed  */\n        /* to the T1 stack) but it doesn't have to put them there  */\n        /* by itself; previous othersubrs might have left the      */\n        /* operands there if they were not followed by an          */\n        /* appropriate number of pops                              */\n        /*                                                         */\n        /* On the other hand, Adobe Reader 7.0.8 for Linux doesn't */\n        /* accept a font that contains charstrings like            */\n        /*                                                         */\n        /*     100 200 2 20 callothersubr                          */\n        /*     300 1 20 callothersubr pop                          */\n        /*                                                         */\n        /* Perhaps this is the reason why BuildCharArray exists.   */\n\n        switch ( subr_no )\n        {\n        case 0:                     /* end flex feature */\n          if ( arg_cnt != 3 )\n            goto Unexpected_OtherSubr;\n\n          if ( decoder->flex_state       == 0 ||\n               decoder->num_flex_vectors != 7 )\n          {\n            FT_ERROR(( \"t1_decoder_parse_charstrings:\"\n                       \" unexpected flex end\\n\" ));\n            goto Syntax_Error;\n          }\n\n          /* the two `results' are popped by the following setcurrentpoint */\n          top[0] = x;\n          top[1] = y;\n          known_othersubr_result_cnt = 2;\n          break;\n\n        case 1:                     /* start flex feature */\n          if ( arg_cnt != 0 )\n            goto Unexpected_OtherSubr;\n\n          decoder->flex_state        = 1;\n          decoder->num_flex_vectors  = 0;\n          if ( ( error = t1_builder_start_point( builder, x, y ) )\n                 != FT_Err_Ok                                   ||\n               ( error = t1_builder_check_points( builder, 6 ) )\n                 != FT_Err_Ok                                   )\n            goto Fail;\n          break;\n\n        case 2:                     /* add flex vectors */\n          {\n            FT_Int  idx;\n\n\n            if ( arg_cnt != 0 )\n              goto Unexpected_OtherSubr;\n\n            if ( decoder->flex_state == 0 )\n            {\n              FT_ERROR(( \"t1_decoder_parse_charstrings:\"\n                         \" missing flex start\\n\" ));\n              goto Syntax_Error;\n            }\n\n            /* note that we should not add a point for index 0; */\n            /* this will move our current position to the flex  */\n            /* point without adding any point to the outline    */\n            idx = decoder->num_flex_vectors++;\n            if ( idx > 0 && idx < 7 )\n              t1_builder_add_point( builder,\n                                    x,\n                                    y,\n                                    (FT_Byte)( idx == 3 || idx == 6 ) );\n          }\n          break;\n\n        case 3:                     /* change hints */\n          if ( arg_cnt != 1 )\n            goto Unexpected_OtherSubr;\n\n          known_othersubr_result_cnt = 1;\n\n          if ( hinter )\n            hinter->reset( hinter->hints, builder->current->n_points );\n          break;\n\n        case 12:\n        case 13:\n          /* counter control hints, clear stack */\n          top = decoder->stack;\n          break;\n\n        case 14:\n        case 15:\n        case 16:\n        case 17:\n        case 18:                    /* multiple masters */\n          {\n            PS_Blend  blend = decoder->blend;\n            FT_UInt   num_points, nn, mm;\n            FT_Long*  delta;\n            FT_Long*  values;\n\n\n            if ( !blend )\n            {\n              FT_ERROR(( \"t1_decoder_parse_charstrings:\"\n                         \" unexpected multiple masters operator\\n\" ));\n              goto Syntax_Error;\n            }\n\n            num_points = (FT_UInt)subr_no - 13 + ( subr_no == 18 );\n            if ( arg_cnt != (FT_Int)( num_points * blend->num_designs ) )\n            {\n              FT_ERROR(( \"t1_decoder_parse_charstrings:\"\n                         \" incorrect number of multiple masters arguments\\n\" ));\n              goto Syntax_Error;\n            }\n\n            /* We want to compute                                    */\n            /*                                                       */\n            /*   a0*w0 + a1*w1 + ... + ak*wk                         */\n            /*                                                       */\n            /* but we only have a0, a1-a0, a2-a0, ..., ak-a0.        */\n            /*                                                       */\n            /* However, given that w0 + w1 + ... + wk == 1, we can   */\n            /* rewrite it easily as                                  */\n            /*                                                       */\n            /*   a0 + (a1-a0)*w1 + (a2-a0)*w2 + ... + (ak-a0)*wk     */\n            /*                                                       */\n            /* where k == num_designs-1.                             */\n            /*                                                       */\n            /* I guess that's why it's written in this `compact'     */\n            /* form.                                                 */\n            /*                                                       */\n            delta  = top + num_points;\n            values = top;\n            for ( nn = 0; nn < num_points; nn++ )\n            {\n              FT_Long  tmp = values[0];\n\n\n              for ( mm = 1; mm < blend->num_designs; mm++ )\n                tmp += FT_MulFix( *delta++, blend->weight_vector[mm] );\n\n              *values++ = tmp;\n            }\n\n            known_othersubr_result_cnt = num_points;\n            break;\n          }\n\n        case 19:\n          /* <idx> 1 19 callothersubr                             */\n          /* => replace elements starting from index cvi( <idx> ) */\n          /*    of BuildCharArray with WeightVector               */\n          {\n            FT_Int    idx;\n            PS_Blend  blend = decoder->blend;\n\n\n            if ( arg_cnt != 1 || blend == NULL )\n              goto Unexpected_OtherSubr;\n\n            idx = Fix2Int( top[0] );\n\n            if ( idx < 0                                           ||\n                 idx + blend->num_designs > decoder->len_buildchar )\n              goto Unexpected_OtherSubr;\n\n            ft_memcpy( &decoder->buildchar[idx],\n                       blend->weight_vector,\n                       blend->num_designs *\n                         sizeof ( blend->weight_vector[0] ) );\n          }\n          break;\n\n        case 20:\n          /* <arg1> <arg2> 2 20 callothersubr pop   */\n          /* ==> push <arg1> + <arg2> onto T1 stack */\n          if ( arg_cnt != 2 )\n            goto Unexpected_OtherSubr;\n\n          top[0] += top[1]; /* XXX (over|under)flow */\n\n          known_othersubr_result_cnt = 1;\n          break;\n\n        case 21:\n          /* <arg1> <arg2> 2 21 callothersubr pop   */\n          /* ==> push <arg1> - <arg2> onto T1 stack */\n          if ( arg_cnt != 2 )\n            goto Unexpected_OtherSubr;\n\n          top[0] -= top[1]; /* XXX (over|under)flow */\n\n          known_othersubr_result_cnt = 1;\n          break;\n\n        case 22:\n          /* <arg1> <arg2> 2 22 callothersubr pop   */\n          /* ==> push <arg1> * <arg2> onto T1 stack */\n          if ( arg_cnt != 2 )\n            goto Unexpected_OtherSubr;\n\n          top[0] = FT_MulFix( top[0], top[1] );\n\n          known_othersubr_result_cnt = 1;\n          break;\n\n        case 23:\n          /* <arg1> <arg2> 2 23 callothersubr pop   */\n          /* ==> push <arg1> / <arg2> onto T1 stack */\n          if ( arg_cnt != 2 || top[1] == 0 )\n            goto Unexpected_OtherSubr;\n\n          top[0] = FT_DivFix( top[0], top[1] );\n\n          known_othersubr_result_cnt = 1;\n          break;\n\n        case 24:\n          /* <val> <idx> 2 24 callothersubr               */\n          /* ==> set BuildCharArray[cvi( <idx> )] = <val> */\n          {\n            FT_Int    idx;\n            PS_Blend  blend = decoder->blend;\n\n\n            if ( arg_cnt != 2 || blend == NULL )\n              goto Unexpected_OtherSubr;\n\n            idx = Fix2Int( top[1] );\n\n            if ( idx < 0 || (FT_UInt) idx >= decoder->len_buildchar )\n              goto Unexpected_OtherSubr;\n\n            decoder->buildchar[idx] = top[0];\n          }\n          break;\n\n        case 25:\n          /* <idx> 1 25 callothersubr pop        */\n          /* ==> push BuildCharArray[cvi( idx )] */\n          /*     onto T1 stack                   */\n          {\n            FT_Int    idx;\n            PS_Blend  blend = decoder->blend;\n\n\n            if ( arg_cnt != 1 || blend == NULL )\n              goto Unexpected_OtherSubr;\n\n            idx = Fix2Int( top[0] );\n\n            if ( idx < 0 || (FT_UInt) idx >= decoder->len_buildchar )\n              goto Unexpected_OtherSubr;\n\n            top[0] = decoder->buildchar[idx];\n          }\n\n          known_othersubr_result_cnt = 1;\n          break;\n\n#if 0\n        case 26:\n          /* <val> mark <idx> ==> set BuildCharArray[cvi( <idx> )] = <val>, */\n          /*                      leave mark on T1 stack                    */\n          /* <val> <idx>      ==> set BuildCharArray[cvi( <idx> )] = <val>  */\n          XXX which routine has left its mark on the (PostScript) stack?;\n          break;\n#endif\n\n        case 27:\n          /* <res1> <res2> <val1> <val2> 4 27 callothersubr pop */\n          /* ==> push <res1> onto T1 stack if <val1> <= <val2>, */\n          /*     otherwise push <res2>                          */\n          if ( arg_cnt != 4 )\n            goto Unexpected_OtherSubr;\n\n          if ( top[2] > top[3] )\n            top[0] = top[1];\n\n          known_othersubr_result_cnt = 1;\n          break;\n\n        case 28:\n          /* 0 28 callothersubr pop                               */\n          /* => push random value from interval [0, 1) onto stack */\n          if ( arg_cnt != 0 )\n            goto Unexpected_OtherSubr;\n\n          {\n            FT_Fixed  Rand;\n\n\n            Rand = seed;\n            if ( Rand >= 0x8000L )\n              Rand++;\n\n            top[0] = Rand;\n\n            seed = FT_MulFix( seed, 0x10000L - seed );\n            if ( seed == 0 )\n              seed += 0x2873;\n          }\n\n          known_othersubr_result_cnt = 1;\n          break;\n\n        default:\n          if ( arg_cnt >= 0 && subr_no >= 0 )\n          {\n            FT_ERROR(( \"t1_decoder_parse_charstrings:\"\n                       \" unknown othersubr [%d %d], wish me luck\\n\",\n                       arg_cnt, subr_no ));\n            unknown_othersubr_result_cnt = arg_cnt;\n            break;\n          }\n          /* fall through */\n\n        Unexpected_OtherSubr:\n          FT_ERROR(( \"t1_decoder_parse_charstrings:\"\n                     \" invalid othersubr [%d %d]\\n\", arg_cnt, subr_no ));\n          goto Syntax_Error;\n        }\n\n        top += known_othersubr_result_cnt;\n\n        decoder->top = top;\n      }\n      else  /* general operator */\n      {\n        FT_Int  num_args = t1_args_count[op];\n\n\n        FT_ASSERT( num_args >= 0 );\n\n        if ( top - decoder->stack < num_args )\n          goto Stack_Underflow;\n\n        /* XXX Operators usually take their operands from the        */\n        /*     bottom of the stack, i.e., the operands are           */\n        /*     decoder->stack[0], ..., decoder->stack[num_args - 1]; */\n        /*     only div, callsubr, and callothersubr are different.  */\n        /*     In practice it doesn't matter (?).                    */\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n        switch ( op )\n        {\n        case op_callsubr:\n        case op_div:\n        case op_callothersubr:\n        case op_pop:\n        case op_return:\n          break;\n\n        default:\n          if ( top - decoder->stack != num_args )\n            FT_TRACE0(( \"t1_decoder_parse_charstrings:\"\n                        \" too much operands on the stack\"\n                        \" (seen %d, expected %d)\\n\",\n                        top - decoder->stack, num_args ));\n            break;\n        }\n\n#endif /* FT_DEBUG_LEVEL_TRACE */\n\n        top -= num_args;\n\n        switch ( op )\n        {\n        case op_endchar:\n          FT_TRACE4(( \" endchar\\n\" ));\n\n          t1_builder_close_contour( builder );\n\n          /* close hints recording session */\n          if ( hinter )\n          {\n            if ( hinter->close( hinter->hints, builder->current->n_points ) )\n              goto Syntax_Error;\n\n            /* apply hints to the loaded glyph outline now */\n            error = hinter->apply( hinter->hints,\n                                   builder->current,\n                                   (PSH_Globals)builder->hints_globals,\n                                   decoder->hint_mode );\n            if ( error )\n              goto Fail;\n          }\n\n          /* add current outline to the glyph slot */\n          FT_GlyphLoader_Add( builder->loader );\n\n          /* the compiler should optimize away this empty loop but ... */\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n          if ( decoder->len_buildchar > 0 )\n          {\n            FT_UInt  i;\n\n\n            FT_TRACE4(( \"BuildCharArray = [ \" ));\n\n            for ( i = 0; i < decoder->len_buildchar; ++i )\n              FT_TRACE4(( \"%d \", decoder->buildchar[i] ));\n\n            FT_TRACE4(( \"]\\n\" ));\n          }\n\n#endif /* FT_DEBUG_LEVEL_TRACE */\n\n          FT_TRACE4(( \"\\n\" ));\n\n          /* return now! */\n          return FT_Err_Ok;\n\n        case op_hsbw:\n          FT_TRACE4(( \" hsbw\" ));\n\n          builder->parse_state = T1_Parse_Have_Width;\n\n          builder->left_bearing.x += top[0];\n          builder->advance.x       = top[1];\n          builder->advance.y       = 0;\n\n          orig_x = x = builder->pos_x + top[0];\n          orig_y = y = builder->pos_y;\n\n          FT_UNUSED( orig_y );\n\n          /* the `metrics_only' indicates that we only want to compute */\n          /* the glyph's metrics (lsb + advance width), not load the   */\n          /* rest of it; so exit immediately                           */\n          if ( builder->metrics_only )\n            return FT_Err_Ok;\n\n          break;\n\n        case op_seac:\n          return t1operator_seac( decoder,\n                                  top[0],\n                                  top[1],\n                                  top[2],\n                                  Fix2Int( top[3] ),\n                                  Fix2Int( top[4] ) );\n\n        case op_sbw:\n          FT_TRACE4(( \" sbw\" ));\n\n          builder->parse_state = T1_Parse_Have_Width;\n\n          builder->left_bearing.x += top[0];\n          builder->left_bearing.y += top[1];\n          builder->advance.x       = top[2];\n          builder->advance.y       = top[3];\n\n          x = builder->pos_x + top[0];\n          y = builder->pos_y + top[1];\n\n          /* the `metrics_only' indicates that we only want to compute */\n          /* the glyph's metrics (lsb + advance width), not load the   */\n          /* rest of it; so exit immediately                           */\n          if ( builder->metrics_only )\n            return FT_Err_Ok;\n\n          break;\n\n        case op_closepath:\n          FT_TRACE4(( \" closepath\" ));\n\n          /* if there is no path, `closepath' is a no-op */\n          if ( builder->parse_state == T1_Parse_Have_Path   ||\n               builder->parse_state == T1_Parse_Have_Moveto )\n            t1_builder_close_contour( builder );\n\n          builder->parse_state = T1_Parse_Have_Width;\n          break;\n\n        case op_hlineto:\n          FT_TRACE4(( \" hlineto\" ));\n\n          if ( ( error = t1_builder_start_point( builder, x, y ) )\n                 != FT_Err_Ok )\n            goto Fail;\n\n          x += top[0];\n          goto Add_Line;\n\n        case op_hmoveto:\n          FT_TRACE4(( \" hmoveto\" ));\n\n          x += top[0];\n          if ( !decoder->flex_state )\n          {\n            if ( builder->parse_state == T1_Parse_Start )\n              goto Syntax_Error;\n            builder->parse_state = T1_Parse_Have_Moveto;\n          }\n          break;\n\n        case op_hvcurveto:\n          FT_TRACE4(( \" hvcurveto\" ));\n\n          if ( ( error = t1_builder_start_point( builder, x, y ) )\n                 != FT_Err_Ok                                   ||\n               ( error = t1_builder_check_points( builder, 3 ) )\n                 != FT_Err_Ok                                   )\n            goto Fail;\n\n          x += top[0];\n          t1_builder_add_point( builder, x, y, 0 );\n          x += top[1];\n          y += top[2];\n          t1_builder_add_point( builder, x, y, 0 );\n          y += top[3];\n          t1_builder_add_point( builder, x, y, 1 );\n          break;\n\n        case op_rlineto:\n          FT_TRACE4(( \" rlineto\" ));\n\n          if ( ( error = t1_builder_start_point( builder, x, y ) )\n                 != FT_Err_Ok )\n            goto Fail;\n\n          x += top[0];\n          y += top[1];\n\n        Add_Line:\n          if ( ( error = t1_builder_add_point1( builder, x, y ) )\n                 != FT_Err_Ok )\n            goto Fail;\n          break;\n\n        case op_rmoveto:\n          FT_TRACE4(( \" rmoveto\" ));\n\n          x += top[0];\n          y += top[1];\n          if ( !decoder->flex_state )\n          {\n            if ( builder->parse_state == T1_Parse_Start )\n              goto Syntax_Error;\n            builder->parse_state = T1_Parse_Have_Moveto;\n          }\n          break;\n\n        case op_rrcurveto:\n          FT_TRACE4(( \" rrcurveto\" ));\n\n          if ( ( error = t1_builder_start_point( builder, x, y ) )\n                 != FT_Err_Ok                                   ||\n               ( error = t1_builder_check_points( builder, 3 ) )\n                 != FT_Err_Ok                                   )\n            goto Fail;\n\n          x += top[0];\n          y += top[1];\n          t1_builder_add_point( builder, x, y, 0 );\n\n          x += top[2];\n          y += top[3];\n          t1_builder_add_point( builder, x, y, 0 );\n\n          x += top[4];\n          y += top[5];\n          t1_builder_add_point( builder, x, y, 1 );\n          break;\n\n        case op_vhcurveto:\n          FT_TRACE4(( \" vhcurveto\" ));\n\n          if ( ( error = t1_builder_start_point( builder, x, y ) )\n                 != FT_Err_Ok                                   ||\n               ( error = t1_builder_check_points( builder, 3 ) )\n                 != FT_Err_Ok                                   )\n            goto Fail;\n\n          y += top[0];\n          t1_builder_add_point( builder, x, y, 0 );\n          x += top[1];\n          y += top[2];\n          t1_builder_add_point( builder, x, y, 0 );\n          x += top[3];\n          t1_builder_add_point( builder, x, y, 1 );\n          break;\n\n        case op_vlineto:\n          FT_TRACE4(( \" vlineto\" ));\n\n          if ( ( error = t1_builder_start_point( builder, x, y ) )\n                 != FT_Err_Ok )\n            goto Fail;\n\n          y += top[0];\n          goto Add_Line;\n\n        case op_vmoveto:\n          FT_TRACE4(( \" vmoveto\" ));\n\n          y += top[0];\n          if ( !decoder->flex_state )\n          {\n            if ( builder->parse_state == T1_Parse_Start )\n              goto Syntax_Error;\n            builder->parse_state = T1_Parse_Have_Moveto;\n          }\n          break;\n\n        case op_div:\n          FT_TRACE4(( \" div\" ));\n\n          /* if `large_int' is set, we divide unscaled numbers; */\n          /* otherwise, we divide numbers in 16.16 format --    */\n          /* in both cases, it is the same operation            */\n          *top = FT_DivFix( top[0], top[1] );\n          ++top;\n\n          large_int = FALSE;\n          break;\n\n        case op_callsubr:\n          {\n            FT_Int  idx;\n\n\n            FT_TRACE4(( \" callsubr\" ));\n\n            idx = Fix2Int( top[0] );\n            if ( idx < 0 || idx >= (FT_Int)decoder->num_subrs )\n            {\n              FT_ERROR(( \"t1_decoder_parse_charstrings:\"\n                         \" invalid subrs index\\n\" ));\n              goto Syntax_Error;\n            }\n\n            if ( zone - decoder->zones >= T1_MAX_SUBRS_CALLS )\n            {\n              FT_ERROR(( \"t1_decoder_parse_charstrings:\"\n                         \" too many nested subrs\\n\" ));\n              goto Syntax_Error;\n            }\n\n            zone->cursor = ip;  /* save current instruction pointer */\n\n            zone++;\n\n            /* The Type 1 driver stores subroutines without the seed bytes. */\n            /* The CID driver stores subroutines with seed bytes.  This     */\n            /* case is taken care of when decoder->subrs_len == 0.          */\n            zone->base = decoder->subrs[idx];\n\n            if ( decoder->subrs_len )\n              zone->limit = zone->base + decoder->subrs_len[idx];\n            else\n            {\n              /* We are using subroutines from a CID font.  We must adjust */\n              /* for the seed bytes.                                       */\n              zone->base  += ( decoder->lenIV >= 0 ? decoder->lenIV : 0 );\n              zone->limit  = decoder->subrs[idx + 1];\n            }\n\n            zone->cursor = zone->base;\n\n            if ( !zone->base )\n            {\n              FT_ERROR(( \"t1_decoder_parse_charstrings:\"\n                         \" invoking empty subrs\\n\" ));\n              goto Syntax_Error;\n            }\n\n            decoder->zone = zone;\n            ip            = zone->base;\n            limit         = zone->limit;\n            break;\n          }\n\n        case op_pop:\n          FT_TRACE4(( \" pop\" ));\n\n          if ( known_othersubr_result_cnt > 0 )\n          {\n            known_othersubr_result_cnt--;\n            /* ignore, we pushed the operands ourselves */\n            break;\n          }\n\n          if ( unknown_othersubr_result_cnt == 0 )\n          {\n            FT_ERROR(( \"t1_decoder_parse_charstrings:\"\n                       \" no more operands for othersubr\\n\" ));\n            goto Syntax_Error;\n          }\n\n          unknown_othersubr_result_cnt--;\n          top++;   /* `push' the operand to callothersubr onto the stack */\n          break;\n\n        case op_return:\n          FT_TRACE4(( \" return\" ));\n\n          if ( zone <= decoder->zones )\n          {\n            FT_ERROR(( \"t1_decoder_parse_charstrings:\"\n                       \" unexpected return\\n\" ));\n            goto Syntax_Error;\n          }\n\n          zone--;\n          ip            = zone->cursor;\n          limit         = zone->limit;\n          decoder->zone = zone;\n          break;\n\n        case op_dotsection:\n          FT_TRACE4(( \" dotsection\" ));\n\n          break;\n\n        case op_hstem:\n          FT_TRACE4(( \" hstem\" ));\n\n          /* record horizontal hint */\n          if ( hinter )\n          {\n            /* top[0] += builder->left_bearing.y; */\n            hinter->stem( hinter->hints, 1, top );\n          }\n          break;\n\n        case op_hstem3:\n          FT_TRACE4(( \" hstem3\" ));\n\n          /* record horizontal counter-controlled hints */\n          if ( hinter )\n            hinter->stem3( hinter->hints, 1, top );\n          break;\n\n        case op_vstem:\n          FT_TRACE4(( \" vstem\" ));\n\n          /* record vertical hint */\n          if ( hinter )\n          {\n            top[0] += orig_x;\n            hinter->stem( hinter->hints, 0, top );\n          }\n          break;\n\n        case op_vstem3:\n          FT_TRACE4(( \" vstem3\" ));\n\n          /* record vertical counter-controlled hints */\n          if ( hinter )\n          {\n            FT_Pos  dx = orig_x;\n\n\n            top[0] += dx;\n            top[2] += dx;\n            top[4] += dx;\n            hinter->stem3( hinter->hints, 0, top );\n          }\n          break;\n\n        case op_setcurrentpoint:\n          FT_TRACE4(( \" setcurrentpoint\" ));\n\n          /* From the T1 specification, section 6.4:                */\n          /*                                                        */\n          /*   The setcurrentpoint command is used only in          */\n          /*   conjunction with results from OtherSubrs procedures. */\n\n          /* known_othersubr_result_cnt != 0 is already handled     */\n          /* above.                                                 */\n\n          /* Note, however, that both Ghostscript and Adobe         */\n          /* Distiller handle this situation by silently ignoring   */\n          /* the inappropriate `setcurrentpoint' instruction.  So   */\n          /* we do the same.                                        */\n#if 0\n\n          if ( decoder->flex_state != 1 )\n          {\n            FT_ERROR(( \"t1_decoder_parse_charstrings:\"\n                       \" unexpected `setcurrentpoint'\\n\" ));\n            goto Syntax_Error;\n          }\n          else\n            ...\n#endif\n\n          x = top[0];\n          y = top[1];\n          decoder->flex_state = 0;\n          break;\n\n        case op_unknown15:\n          FT_TRACE4(( \" opcode_15\" ));\n          /* nothing to do except to pop the two arguments */\n          break;\n\n        default:\n          FT_ERROR(( \"t1_decoder_parse_charstrings:\"\n                     \" unhandled opcode %d\\n\", op ));\n          goto Syntax_Error;\n        }\n\n        /* XXX Operators usually clear the operand stack;  */\n        /*     only div, callsubr, callothersubr, pop, and */\n        /*     return are different.                       */\n        /*     In practice it doesn't matter (?).          */\n\n        decoder->top = top;\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n        FT_TRACE4(( \"\\n\" ));\n        bol = TRUE;\n#endif\n\n      } /* general operator processing */\n\n    } /* while ip < limit */\n\n    FT_TRACE4(( \"..end..\\n\\n\" ));\n\n  Fail:\n    return error;\n\n  Syntax_Error:\n    return FT_THROW( Syntax_Error );\n\n  Stack_Underflow:\n    return FT_THROW( Stack_Underflow );\n  }\n\n\n  /* parse a single Type 1 glyph */\n  FT_LOCAL_DEF( FT_Error )\n  t1_decoder_parse_glyph( T1_Decoder  decoder,\n                          FT_UInt     glyph )\n  {\n    return decoder->parse_callback( decoder, glyph );\n  }\n\n\n  /* initialize T1 decoder */\n  FT_LOCAL_DEF( FT_Error )\n  t1_decoder_init( T1_Decoder           decoder,\n                   FT_Face              face,\n                   FT_Size              size,\n                   FT_GlyphSlot         slot,\n                   FT_Byte**            glyph_names,\n                   PS_Blend             blend,\n                   FT_Bool              hinting,\n                   FT_Render_Mode       hint_mode,\n                   T1_Decoder_Callback  parse_callback )\n  {\n    FT_MEM_ZERO( decoder, sizeof ( *decoder ) );\n\n    /* retrieve PSNames interface from list of current modules */\n    {\n      FT_Service_PsCMaps  psnames = 0;\n\n\n      FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );\n      if ( !psnames )\n      {\n        FT_ERROR(( \"t1_decoder_init:\"\n                   \" the `psnames' module is not available\\n\" ));\n        return FT_THROW( Unimplemented_Feature );\n      }\n\n      decoder->psnames = psnames;\n    }\n\n    t1_builder_init( &decoder->builder, face, size, slot, hinting );\n\n    /* decoder->buildchar and decoder->len_buildchar have to be  */\n    /* initialized by the caller since we cannot know the length */\n    /* of the BuildCharArray                                     */\n\n    decoder->num_glyphs     = (FT_UInt)face->num_glyphs;\n    decoder->glyph_names    = glyph_names;\n    decoder->hint_mode      = hint_mode;\n    decoder->blend          = blend;\n    decoder->parse_callback = parse_callback;\n\n    decoder->funcs          = t1_decoder_funcs;\n\n    return FT_Err_Ok;\n  }\n\n\n  /* finalize T1 decoder */\n  FT_LOCAL_DEF( void )\n  t1_decoder_done( T1_Decoder  decoder )\n  {\n    t1_builder_done( &decoder->builder );\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/psaux/t1decode.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1decode.h                                                             */\n/*                                                                         */\n/*    PostScript Type 1 decoding routines (specification).                 */\n/*                                                                         */\n/*  Copyright 2000-2001, 2002, 2003 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T1DECODE_H__\n#define __T1DECODE_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_POSTSCRIPT_AUX_H\n#include FT_INTERNAL_TYPE1_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n  FT_CALLBACK_TABLE\n  const T1_Decoder_FuncsRec  t1_decoder_funcs;\n\n\n  FT_LOCAL( FT_Error )\n  t1_decoder_parse_glyph( T1_Decoder  decoder,\n                          FT_UInt     glyph_index );\n\n  FT_LOCAL( FT_Error )\n  t1_decoder_parse_charstrings( T1_Decoder  decoder,\n                                FT_Byte*    base,\n                                FT_UInt     len );\n\n  FT_LOCAL( FT_Error )\n  t1_decoder_init( T1_Decoder           decoder,\n                   FT_Face              face,\n                   FT_Size              size,\n                   FT_GlyphSlot         slot,\n                   FT_Byte**            glyph_names,\n                   PS_Blend             blend,\n                   FT_Bool              hinting,\n                   FT_Render_Mode       hint_mode,\n                   T1_Decoder_Callback  parse_glyph );\n\n  FT_LOCAL( void )\n  t1_decoder_done( T1_Decoder  decoder );\n\n\nFT_END_HEADER\n\n#endif /* __T1DECODE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pshinter/Jamfile",
    "content": "# FreeType 2 src/pshinter Jamfile\n#\n# Copyright 2001, 2003 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) pshinter ;\n\n{\n  local  _sources ;\n\n  if $(FT2_MULTI)\n  {\n    _sources = pshrec pshglob pshalgo pshmod pshpic ;\n  }\n  else\n  {\n    _sources = pshinter ;\n  }\n\n  Library  $(FT2_LIB) : $(_sources).c ;\n}\n\n# end of src/pshinter Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/pshinter/module.mk",
    "content": "#\n# FreeType 2 PSHinter module definition\n#\n\n\n# Copyright 1996-2001, 2006 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\nFTMODULE_H_COMMANDS += PSHINTER_MODULE\n\ndefine PSHINTER_MODULE\n$(OPEN_DRIVER) FT_Module_Class, pshinter_module_class $(CLOSE_DRIVER)\n$(ECHO_DRIVER)pshinter  $(ECHO_DRIVER_DESC)Postscript hinter module$(ECHO_DRIVER_DONE)\nendef\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/pshinter/pshalgo.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pshalgo.c                                                              */\n/*                                                                         */\n/*    PostScript hinting algorithm (body).                                 */\n/*                                                                         */\n/*  Copyright 2001-2010, 2012-2014 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used        */\n/*  modified and distributed under the terms of the FreeType project       */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_CALC_H\n#include \"pshalgo.h\"\n\n#include \"pshnterr.h\"\n\n\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_pshalgo2\n\n\n#ifdef DEBUG_HINTER\n  PSH_Hint_Table  ps_debug_hint_table = 0;\n  PSH_HintFunc    ps_debug_hint_func  = 0;\n  PSH_Glyph       ps_debug_glyph      = 0;\n#endif\n\n\n#define  COMPUTE_INFLEXS  /* compute inflection points to optimize `S' */\n                          /* and similar glyphs                        */\n#define  STRONGER         /* slightly increase the contrast of smooth  */\n                          /* hinting                                   */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                  BASIC HINTS RECORDINGS                       *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* return true if two stem hints overlap */\n  static FT_Int\n  psh_hint_overlap( PSH_Hint  hint1,\n                    PSH_Hint  hint2 )\n  {\n    return hint1->org_pos + hint1->org_len >= hint2->org_pos &&\n           hint2->org_pos + hint2->org_len >= hint1->org_pos;\n  }\n\n\n  /* destroy hints table */\n  static void\n  psh_hint_table_done( PSH_Hint_Table  table,\n                       FT_Memory       memory )\n  {\n    FT_FREE( table->zones );\n    table->num_zones = 0;\n    table->zone      = 0;\n\n    FT_FREE( table->sort );\n    FT_FREE( table->hints );\n    table->num_hints   = 0;\n    table->max_hints   = 0;\n    table->sort_global = 0;\n  }\n\n\n  /* deactivate all hints in a table */\n  static void\n  psh_hint_table_deactivate( PSH_Hint_Table  table )\n  {\n    FT_UInt   count = table->max_hints;\n    PSH_Hint  hint  = table->hints;\n\n\n    for ( ; count > 0; count--, hint++ )\n    {\n      psh_hint_deactivate( hint );\n      hint->order = -1;\n    }\n  }\n\n\n  /* internal function to record a new hint */\n  static void\n  psh_hint_table_record( PSH_Hint_Table  table,\n                         FT_UInt         idx )\n  {\n    PSH_Hint  hint = table->hints + idx;\n\n\n    if ( idx >= table->max_hints )\n    {\n      FT_TRACE0(( \"psh_hint_table_record: invalid hint index %d\\n\", idx ));\n      return;\n    }\n\n    /* ignore active hints */\n    if ( psh_hint_is_active( hint ) )\n      return;\n\n    psh_hint_activate( hint );\n\n    /* now scan the current active hint set to check */\n    /* whether `hint' overlaps with another hint     */\n    {\n      PSH_Hint*  sorted = table->sort_global;\n      FT_UInt    count  = table->num_hints;\n      PSH_Hint   hint2;\n\n\n      hint->parent = 0;\n      for ( ; count > 0; count--, sorted++ )\n      {\n        hint2 = sorted[0];\n\n        if ( psh_hint_overlap( hint, hint2 ) )\n        {\n          hint->parent = hint2;\n          break;\n        }\n      }\n    }\n\n    if ( table->num_hints < table->max_hints )\n      table->sort_global[table->num_hints++] = hint;\n    else\n      FT_TRACE0(( \"psh_hint_table_record: too many sorted hints!  BUG!\\n\" ));\n  }\n\n\n  static void\n  psh_hint_table_record_mask( PSH_Hint_Table  table,\n                              PS_Mask         hint_mask )\n  {\n    FT_Int    mask = 0, val = 0;\n    FT_Byte*  cursor = hint_mask->bytes;\n    FT_UInt   idx, limit;\n\n\n    limit = hint_mask->num_bits;\n\n    for ( idx = 0; idx < limit; idx++ )\n    {\n      if ( mask == 0 )\n      {\n        val  = *cursor++;\n        mask = 0x80;\n      }\n\n      if ( val & mask )\n        psh_hint_table_record( table, idx );\n\n      mask >>= 1;\n    }\n  }\n\n\n  /* create hints table */\n  static FT_Error\n  psh_hint_table_init( PSH_Hint_Table  table,\n                       PS_Hint_Table   hints,\n                       PS_Mask_Table   hint_masks,\n                       PS_Mask_Table   counter_masks,\n                       FT_Memory       memory )\n  {\n    FT_UInt   count;\n    FT_Error  error;\n\n    FT_UNUSED( counter_masks );\n\n\n    count = hints->num_hints;\n\n    /* allocate our tables */\n    if ( FT_NEW_ARRAY( table->sort,  2 * count     ) ||\n         FT_NEW_ARRAY( table->hints,     count     ) ||\n         FT_NEW_ARRAY( table->zones, 2 * count + 1 ) )\n      goto Exit;\n\n    table->max_hints   = count;\n    table->sort_global = table->sort + count;\n    table->num_hints   = 0;\n    table->num_zones   = 0;\n    table->zone        = 0;\n\n    /* initialize the `table->hints' array */\n    {\n      PSH_Hint  write = table->hints;\n      PS_Hint   read  = hints->hints;\n\n\n      for ( ; count > 0; count--, write++, read++ )\n      {\n        write->org_pos = read->pos;\n        write->org_len = read->len;\n        write->flags   = read->flags;\n      }\n    }\n\n    /* we now need to determine the initial `parent' stems; first  */\n    /* activate the hints that are given by the initial hint masks */\n    if ( hint_masks )\n    {\n      PS_Mask  mask = hint_masks->masks;\n\n\n      count             = hint_masks->num_masks;\n      table->hint_masks = hint_masks;\n\n      for ( ; count > 0; count--, mask++ )\n        psh_hint_table_record_mask( table, mask );\n    }\n\n    /* finally, do a linear parse in case some hints were left alone */\n    if ( table->num_hints != table->max_hints )\n    {\n      FT_UInt  idx;\n\n\n      FT_TRACE0(( \"psh_hint_table_init: missing/incorrect hint masks\\n\" ));\n\n      count = table->max_hints;\n      for ( idx = 0; idx < count; idx++ )\n        psh_hint_table_record( table, idx );\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  static void\n  psh_hint_table_activate_mask( PSH_Hint_Table  table,\n                                PS_Mask         hint_mask )\n  {\n    FT_Int    mask = 0, val = 0;\n    FT_Byte*  cursor = hint_mask->bytes;\n    FT_UInt   idx, limit, count;\n\n\n    limit = hint_mask->num_bits;\n    count = 0;\n\n    psh_hint_table_deactivate( table );\n\n    for ( idx = 0; idx < limit; idx++ )\n    {\n      if ( mask == 0 )\n      {\n        val  = *cursor++;\n        mask = 0x80;\n      }\n\n      if ( val & mask )\n      {\n        PSH_Hint  hint = &table->hints[idx];\n\n\n        if ( !psh_hint_is_active( hint ) )\n        {\n          FT_UInt     count2;\n\n#if 0\n          PSH_Hint*  sort = table->sort;\n          PSH_Hint   hint2;\n\n\n          for ( count2 = count; count2 > 0; count2--, sort++ )\n          {\n            hint2 = sort[0];\n            if ( psh_hint_overlap( hint, hint2 ) )\n              FT_TRACE0(( \"psh_hint_table_activate_mask:\"\n                          \" found overlapping hints\\n\" ))\n          }\n#else\n          count2 = 0;\n#endif\n\n          if ( count2 == 0 )\n          {\n            psh_hint_activate( hint );\n            if ( count < table->max_hints )\n              table->sort[count++] = hint;\n            else\n              FT_TRACE0(( \"psh_hint_tableactivate_mask:\"\n                          \" too many active hints\\n\" ));\n          }\n        }\n      }\n\n      mask >>= 1;\n    }\n    table->num_hints = count;\n\n    /* now, sort the hints; they are guaranteed to not overlap */\n    /* so we can compare their \"org_pos\" field directly        */\n    {\n      FT_Int     i1, i2;\n      PSH_Hint   hint1, hint2;\n      PSH_Hint*  sort = table->sort;\n\n\n      /* a simple bubble sort will do, since in 99% of cases, the hints */\n      /* will be already sorted -- and the sort will be linear          */\n      for ( i1 = 1; i1 < (FT_Int)count; i1++ )\n      {\n        hint1 = sort[i1];\n        for ( i2 = i1 - 1; i2 >= 0; i2-- )\n        {\n          hint2 = sort[i2];\n\n          if ( hint2->org_pos < hint1->org_pos )\n            break;\n\n          sort[i2 + 1] = hint2;\n          sort[i2]     = hint1;\n        }\n      }\n    }\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****               HINTS GRID-FITTING AND OPTIMIZATION             *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#if 1\n  static FT_Pos\n  psh_dimension_quantize_len( PSH_Dimension  dim,\n                              FT_Pos         len,\n                              FT_Bool        do_snapping )\n  {\n    if ( len <= 64 )\n      len = 64;\n    else\n    {\n      FT_Pos  delta = len - dim->stdw.widths[0].cur;\n\n\n      if ( delta < 0 )\n        delta = -delta;\n\n      if ( delta < 40 )\n      {\n        len = dim->stdw.widths[0].cur;\n        if ( len < 48 )\n          len = 48;\n      }\n\n      if ( len < 3 * 64 )\n      {\n        delta = ( len & 63 );\n        len  &= -64;\n\n        if ( delta < 10 )\n          len += delta;\n\n        else if ( delta < 32 )\n          len += 10;\n\n        else if ( delta < 54 )\n          len += 54;\n\n        else\n          len += delta;\n      }\n      else\n        len = FT_PIX_ROUND( len );\n    }\n\n    if ( do_snapping )\n      len = FT_PIX_ROUND( len );\n\n    return  len;\n  }\n#endif /* 0 */\n\n\n#ifdef DEBUG_HINTER\n\n  static void\n  ps_simple_scale( PSH_Hint_Table  table,\n                   FT_Fixed        scale,\n                   FT_Fixed        delta,\n                   FT_Int          dimension )\n  {\n    FT_UInt  count;\n\n\n    for ( count = 0; count < table->max_hints; count++ )\n    {\n      PSH_Hint  hint = table->hints + count;\n\n\n      hint->cur_pos = FT_MulFix( hint->org_pos, scale ) + delta;\n      hint->cur_len = FT_MulFix( hint->org_len, scale );\n\n      if ( ps_debug_hint_func )\n        ps_debug_hint_func( hint, dimension );\n    }\n  }\n\n#endif /* DEBUG_HINTER */\n\n\n  static FT_Fixed\n  psh_hint_snap_stem_side_delta( FT_Fixed  pos,\n                                 FT_Fixed  len )\n  {\n    FT_Fixed  delta1 = FT_PIX_ROUND( pos ) - pos;\n    FT_Fixed  delta2 = FT_PIX_ROUND( pos + len ) - pos - len;\n\n\n    if ( FT_ABS( delta1 ) <= FT_ABS( delta2 ) )\n      return delta1;\n    else\n      return delta2;\n  }\n\n\n  static void\n  psh_hint_align( PSH_Hint     hint,\n                  PSH_Globals  globals,\n                  FT_Int       dimension,\n                  PSH_Glyph    glyph )\n  {\n    PSH_Dimension  dim   = &globals->dimension[dimension];\n    FT_Fixed       scale = dim->scale_mult;\n    FT_Fixed       delta = dim->scale_delta;\n\n\n    if ( !psh_hint_is_fitted( hint ) )\n    {\n      FT_Pos  pos = FT_MulFix( hint->org_pos, scale ) + delta;\n      FT_Pos  len = FT_MulFix( hint->org_len, scale );\n\n      FT_Int            do_snapping;\n      FT_Pos            fit_len;\n      PSH_AlignmentRec  align;\n\n\n      /* ignore stem alignments when requested through the hint flags */\n      if ( ( dimension == 0 && !glyph->do_horz_hints ) ||\n           ( dimension == 1 && !glyph->do_vert_hints ) )\n      {\n        hint->cur_pos = pos;\n        hint->cur_len = len;\n\n        psh_hint_set_fitted( hint );\n        return;\n      }\n\n      /* perform stem snapping when requested - this is necessary\n       * for monochrome and LCD hinting modes only\n       */\n      do_snapping = ( dimension == 0 && glyph->do_horz_snapping ) ||\n                    ( dimension == 1 && glyph->do_vert_snapping );\n\n      hint->cur_len = fit_len = len;\n\n      /* check blue zones for horizontal stems */\n      align.align     = PSH_BLUE_ALIGN_NONE;\n      align.align_bot = align.align_top = 0;\n\n      if ( dimension == 1 )\n        psh_blues_snap_stem( &globals->blues,\n                             hint->org_pos + hint->org_len,\n                             hint->org_pos,\n                             &align );\n\n      switch ( align.align )\n      {\n      case PSH_BLUE_ALIGN_TOP:\n        /* the top of the stem is aligned against a blue zone */\n        hint->cur_pos = align.align_top - fit_len;\n        break;\n\n      case PSH_BLUE_ALIGN_BOT:\n        /* the bottom of the stem is aligned against a blue zone */\n        hint->cur_pos = align.align_bot;\n        break;\n\n      case PSH_BLUE_ALIGN_TOP | PSH_BLUE_ALIGN_BOT:\n        /* both edges of the stem are aligned against blue zones */\n        hint->cur_pos = align.align_bot;\n        hint->cur_len = align.align_top - align.align_bot;\n        break;\n\n      default:\n        {\n          PSH_Hint  parent = hint->parent;\n\n\n          if ( parent )\n          {\n            FT_Pos  par_org_center, par_cur_center;\n            FT_Pos  cur_org_center, cur_delta;\n\n\n            /* ensure that parent is already fitted */\n            if ( !psh_hint_is_fitted( parent ) )\n              psh_hint_align( parent, globals, dimension, glyph );\n\n            /* keep original relation between hints, this is, use the */\n            /* scaled distance between the centers of the hints to    */\n            /* compute the new position                               */\n            par_org_center = parent->org_pos + ( parent->org_len >> 1 );\n            par_cur_center = parent->cur_pos + ( parent->cur_len >> 1 );\n            cur_org_center = hint->org_pos   + ( hint->org_len   >> 1 );\n\n            cur_delta = FT_MulFix( cur_org_center - par_org_center, scale );\n            pos       = par_cur_center + cur_delta - ( len >> 1 );\n          }\n\n          hint->cur_pos = pos;\n          hint->cur_len = fit_len;\n\n          /* Stem adjustment tries to snap stem widths to standard\n           * ones.  This is important to prevent unpleasant rounding\n           * artefacts.\n           */\n          if ( glyph->do_stem_adjust )\n          {\n            if ( len <= 64 )\n            {\n              /* the stem is less than one pixel; we will center it\n               * around the nearest pixel center\n               */\n              if ( len >= 32 )\n              {\n                /* This is a special case where we also widen the stem\n                 * and align it to the pixel grid.\n                 *\n                 *   stem_center          = pos + (len/2)\n                 *   nearest_pixel_center = FT_ROUND(stem_center-32)+32\n                 *   new_pos              = nearest_pixel_center-32\n                 *                        = FT_ROUND(stem_center-32)\n                 *                        = FT_FLOOR(stem_center-32+32)\n                 *                        = FT_FLOOR(stem_center)\n                 *   new_len              = 64\n                 */\n                pos = FT_PIX_FLOOR( pos + ( len >> 1 ) );\n                len = 64;\n              }\n              else if ( len > 0 )\n              {\n                /* This is a very small stem; we simply align it to the\n                 * pixel grid, trying to find the minimum displacement.\n                 *\n                 * left               = pos\n                 * right              = pos + len\n                 * left_nearest_edge  = ROUND(pos)\n                 * right_nearest_edge = ROUND(right)\n                 *\n                 * if ( ABS(left_nearest_edge - left) <=\n                 *      ABS(right_nearest_edge - right) )\n                 *    new_pos = left\n                 * else\n                 *    new_pos = right\n                 */\n                FT_Pos  left_nearest  = FT_PIX_ROUND( pos );\n                FT_Pos  right_nearest = FT_PIX_ROUND( pos + len );\n                FT_Pos  left_disp     = left_nearest - pos;\n                FT_Pos  right_disp    = right_nearest - ( pos + len );\n\n\n                if ( left_disp < 0 )\n                  left_disp = -left_disp;\n                if ( right_disp < 0 )\n                  right_disp = -right_disp;\n                if ( left_disp <= right_disp )\n                  pos = left_nearest;\n                else\n                  pos = right_nearest;\n              }\n              else\n              {\n                /* this is a ghost stem; we simply round it */\n                pos = FT_PIX_ROUND( pos );\n              }\n            }\n            else\n            {\n              len = psh_dimension_quantize_len( dim, len, 0 );\n            }\n          }\n\n          /* now that we have a good hinted stem width, try to position */\n          /* the stem along a pixel grid integer coordinate             */\n          hint->cur_pos = pos + psh_hint_snap_stem_side_delta( pos, len );\n          hint->cur_len = len;\n        }\n      }\n\n      if ( do_snapping )\n      {\n        pos = hint->cur_pos;\n        len = hint->cur_len;\n\n        if ( len < 64 )\n          len = 64;\n        else\n          len = FT_PIX_ROUND( len );\n\n        switch ( align.align )\n        {\n          case PSH_BLUE_ALIGN_TOP:\n            hint->cur_pos = align.align_top - len;\n            hint->cur_len = len;\n            break;\n\n          case PSH_BLUE_ALIGN_BOT:\n            hint->cur_len = len;\n            break;\n\n          case PSH_BLUE_ALIGN_BOT | PSH_BLUE_ALIGN_TOP:\n            /* don't touch */\n            break;\n\n\n          default:\n            hint->cur_len = len;\n            if ( len & 64 )\n              pos = FT_PIX_FLOOR( pos + ( len >> 1 ) ) + 32;\n            else\n              pos = FT_PIX_ROUND( pos + ( len >> 1 ) );\n\n            hint->cur_pos = pos - ( len >> 1 );\n            hint->cur_len = len;\n        }\n      }\n\n      psh_hint_set_fitted( hint );\n\n#ifdef DEBUG_HINTER\n      if ( ps_debug_hint_func )\n        ps_debug_hint_func( hint, dimension );\n#endif\n    }\n  }\n\n\n#if 0  /* not used for now, experimental */\n\n /*\n  *  A variant to perform \"light\" hinting (i.e. FT_RENDER_MODE_LIGHT)\n  *  of stems\n  */\n  static void\n  psh_hint_align_light( PSH_Hint     hint,\n                        PSH_Globals  globals,\n                        FT_Int       dimension,\n                        PSH_Glyph    glyph )\n  {\n    PSH_Dimension  dim   = &globals->dimension[dimension];\n    FT_Fixed       scale = dim->scale_mult;\n    FT_Fixed       delta = dim->scale_delta;\n\n\n    if ( !psh_hint_is_fitted( hint ) )\n    {\n      FT_Pos  pos = FT_MulFix( hint->org_pos, scale ) + delta;\n      FT_Pos  len = FT_MulFix( hint->org_len, scale );\n\n      FT_Pos  fit_len;\n\n      PSH_AlignmentRec  align;\n\n\n      /* ignore stem alignments when requested through the hint flags */\n      if ( ( dimension == 0 && !glyph->do_horz_hints ) ||\n           ( dimension == 1 && !glyph->do_vert_hints ) )\n      {\n        hint->cur_pos = pos;\n        hint->cur_len = len;\n\n        psh_hint_set_fitted( hint );\n        return;\n      }\n\n      fit_len = len;\n\n      hint->cur_len = fit_len;\n\n      /* check blue zones for horizontal stems */\n      align.align = PSH_BLUE_ALIGN_NONE;\n      align.align_bot = align.align_top = 0;\n\n      if ( dimension == 1 )\n        psh_blues_snap_stem( &globals->blues,\n                             hint->org_pos + hint->org_len,\n                             hint->org_pos,\n                             &align );\n\n      switch ( align.align )\n      {\n      case PSH_BLUE_ALIGN_TOP:\n        /* the top of the stem is aligned against a blue zone */\n        hint->cur_pos = align.align_top - fit_len;\n        break;\n\n      case PSH_BLUE_ALIGN_BOT:\n        /* the bottom of the stem is aligned against a blue zone */\n        hint->cur_pos = align.align_bot;\n        break;\n\n      case PSH_BLUE_ALIGN_TOP | PSH_BLUE_ALIGN_BOT:\n        /* both edges of the stem are aligned against blue zones */\n        hint->cur_pos = align.align_bot;\n        hint->cur_len = align.align_top - align.align_bot;\n        break;\n\n      default:\n        {\n          PSH_Hint  parent = hint->parent;\n\n\n          if ( parent )\n          {\n            FT_Pos  par_org_center, par_cur_center;\n            FT_Pos  cur_org_center, cur_delta;\n\n\n            /* ensure that parent is already fitted */\n            if ( !psh_hint_is_fitted( parent ) )\n              psh_hint_align_light( parent, globals, dimension, glyph );\n\n            par_org_center = parent->org_pos + ( parent->org_len / 2 );\n            par_cur_center = parent->cur_pos + ( parent->cur_len / 2 );\n            cur_org_center = hint->org_pos   + ( hint->org_len   / 2 );\n\n            cur_delta = FT_MulFix( cur_org_center - par_org_center, scale );\n            pos       = par_cur_center + cur_delta - ( len >> 1 );\n          }\n\n          /* Stems less than one pixel wide are easy -- we want to\n           * make them as dark as possible, so they must fall within\n           * one pixel.  If the stem is split between two pixels\n           * then snap the edge that is nearer to the pixel boundary\n           * to the pixel boundary.\n           */\n          if ( len <= 64 )\n          {\n            if ( ( pos + len + 63 ) / 64  != pos / 64 + 1 )\n              pos += psh_hint_snap_stem_side_delta ( pos, len );\n          }\n\n          /* Position stems other to minimize the amount of mid-grays.\n           * There are, in general, two positions that do this,\n           * illustrated as A) and B) below.\n           *\n           *   +                   +                   +                   +\n           *\n           * A)             |--------------------------------|\n           * B)   |--------------------------------|\n           * C)       |--------------------------------|\n           *\n           * Position A) (split the excess stem equally) should be better\n           * for stems of width N + f where f < 0.5.\n           *\n           * Position B) (split the deficiency equally) should be better\n           * for stems of width N + f where f > 0.5.\n           *\n           * It turns out though that minimizing the total number of lit\n           * pixels is also important, so position C), with one edge\n           * aligned with a pixel boundary is actually preferable\n           * to A).  There are also more possibile positions for C) than\n           * for A) or B), so it involves less distortion of the overall\n           * character shape.\n           */\n          else /* len > 64 */\n          {\n            FT_Fixed  frac_len = len & 63;\n            FT_Fixed  center = pos + ( len >> 1 );\n            FT_Fixed  delta_a, delta_b;\n\n\n            if ( ( len / 64 ) & 1 )\n            {\n              delta_a = FT_PIX_FLOOR( center ) + 32 - center;\n              delta_b = FT_PIX_ROUND( center ) - center;\n            }\n            else\n            {\n              delta_a = FT_PIX_ROUND( center ) - center;\n              delta_b = FT_PIX_FLOOR( center ) + 32 - center;\n            }\n\n            /* We choose between B) and C) above based on the amount\n             * of fractinal stem width; for small amounts, choose\n             * C) always, for large amounts, B) always, and inbetween,\n             * pick whichever one involves less stem movement.\n             */\n            if ( frac_len < 32 )\n            {\n              pos += psh_hint_snap_stem_side_delta ( pos, len );\n            }\n            else if ( frac_len < 48 )\n            {\n              FT_Fixed  side_delta = psh_hint_snap_stem_side_delta ( pos,\n                                                                     len );\n\n              if ( FT_ABS( side_delta ) < FT_ABS( delta_b ) )\n                pos += side_delta;\n              else\n                pos += delta_b;\n            }\n            else\n            {\n              pos += delta_b;\n            }\n          }\n\n          hint->cur_pos = pos;\n        }\n      }  /* switch */\n\n      psh_hint_set_fitted( hint );\n\n#ifdef DEBUG_HINTER\n      if ( ps_debug_hint_func )\n        ps_debug_hint_func( hint, dimension );\n#endif\n    }\n  }\n\n#endif /* 0 */\n\n\n  static void\n  psh_hint_table_align_hints( PSH_Hint_Table  table,\n                              PSH_Globals     globals,\n                              FT_Int          dimension,\n                              PSH_Glyph       glyph )\n  {\n    PSH_Hint       hint;\n    FT_UInt        count;\n\n#ifdef DEBUG_HINTER\n\n    PSH_Dimension  dim   = &globals->dimension[dimension];\n    FT_Fixed       scale = dim->scale_mult;\n    FT_Fixed       delta = dim->scale_delta;\n\n\n    if ( ps_debug_no_vert_hints && dimension == 0 )\n    {\n      ps_simple_scale( table, scale, delta, dimension );\n      return;\n    }\n\n    if ( ps_debug_no_horz_hints && dimension == 1 )\n    {\n      ps_simple_scale( table, scale, delta, dimension );\n      return;\n    }\n\n#endif /* DEBUG_HINTER*/\n\n    hint  = table->hints;\n    count = table->max_hints;\n\n    for ( ; count > 0; count--, hint++ )\n      psh_hint_align( hint, globals, dimension, glyph );\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                POINTS INTERPOLATION ROUTINES                  *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#define PSH_ZONE_MIN  -3200000L\n#define PSH_ZONE_MAX  +3200000L\n\n#define xxDEBUG_ZONES\n\n\n#ifdef DEBUG_ZONES\n\n#include FT_CONFIG_STANDARD_LIBRARY_H\n\n  static void\n  psh_print_zone( PSH_Zone  zone )\n  {\n    printf( \"zone [scale,delta,min,max] = [%.3f,%.3f,%d,%d]\\n\",\n             zone->scale / 65536.0,\n             zone->delta / 64.0,\n             zone->min,\n             zone->max );\n  }\n\n#else\n\n#define psh_print_zone( x )  do { } while ( 0 )\n\n#endif /* DEBUG_ZONES */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    HINTER GLYPH MANAGEMENT                    *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#if 1\n\n#define  psh_corner_is_flat      ft_corner_is_flat\n#define  psh_corner_orientation  ft_corner_orientation\n\n#else\n\n  FT_LOCAL_DEF( FT_Int )\n  psh_corner_is_flat( FT_Pos  x_in,\n                      FT_Pos  y_in,\n                      FT_Pos  x_out,\n                      FT_Pos  y_out )\n  {\n    FT_Pos  ax = x_in;\n    FT_Pos  ay = y_in;\n\n    FT_Pos  d_in, d_out, d_corner;\n\n\n    if ( ax < 0 )\n      ax = -ax;\n    if ( ay < 0 )\n      ay = -ay;\n    d_in = ax + ay;\n\n    ax = x_out;\n    if ( ax < 0 )\n      ax = -ax;\n    ay = y_out;\n    if ( ay < 0 )\n      ay = -ay;\n    d_out = ax + ay;\n\n    ax = x_out + x_in;\n    if ( ax < 0 )\n      ax = -ax;\n    ay = y_out + y_in;\n    if ( ay < 0 )\n      ay = -ay;\n    d_corner = ax + ay;\n\n    return ( d_in + d_out - d_corner ) < ( d_corner >> 4 );\n  }\n\n  static FT_Int\n  psh_corner_orientation( FT_Pos  in_x,\n                          FT_Pos  in_y,\n                          FT_Pos  out_x,\n                          FT_Pos  out_y )\n  {\n    FT_Int  result;\n\n\n    /* deal with the trivial cases quickly */\n    if ( in_y == 0 )\n    {\n      if ( in_x >= 0 )\n        result = out_y;\n      else\n        result = -out_y;\n    }\n    else if ( in_x == 0 )\n    {\n      if ( in_y >= 0 )\n        result = -out_x;\n      else\n        result = out_x;\n    }\n    else if ( out_y == 0 )\n    {\n      if ( out_x >= 0 )\n        result = in_y;\n      else\n        result = -in_y;\n    }\n    else if ( out_x == 0 )\n    {\n      if ( out_y >= 0 )\n        result = -in_x;\n      else\n        result =  in_x;\n    }\n    else /* general case */\n    {\n      long long  delta = (long long)in_x * out_y - (long long)in_y * out_x;\n\n      if ( delta == 0 )\n        result = 0;\n      else\n        result = 1 - 2 * ( delta < 0 );\n    }\n\n    return result;\n  }\n\n#endif /* !1 */\n\n\n#ifdef COMPUTE_INFLEXS\n\n  /* compute all inflex points in a given glyph */\n  static void\n  psh_glyph_compute_inflections( PSH_Glyph  glyph )\n  {\n    FT_UInt  n;\n\n\n    for ( n = 0; n < glyph->num_contours; n++ )\n    {\n      PSH_Point  first, start, end, before, after;\n      FT_Pos     in_x, in_y, out_x, out_y;\n      FT_Int     orient_prev, orient_cur;\n      FT_Int     finished = 0;\n\n\n      /* we need at least 4 points to create an inflection point */\n      if ( glyph->contours[n].count < 4 )\n        continue;\n\n      /* compute first segment in contour */\n      first = glyph->contours[n].start;\n\n      start = end = first;\n      do\n      {\n        end = end->next;\n        if ( end == first )\n          goto Skip;\n\n        in_x = end->org_u - start->org_u;\n        in_y = end->org_v - start->org_v;\n\n      } while ( in_x == 0 && in_y == 0 );\n\n      /* extend the segment start whenever possible */\n      before = start;\n      do\n      {\n        do\n        {\n          start  = before;\n          before = before->prev;\n          if ( before == first )\n            goto Skip;\n\n          out_x = start->org_u - before->org_u;\n          out_y = start->org_v - before->org_v;\n\n        } while ( out_x == 0 && out_y == 0 );\n\n        orient_prev = psh_corner_orientation( in_x, in_y, out_x, out_y );\n\n      } while ( orient_prev == 0 );\n\n      first = start;\n      in_x  = out_x;\n      in_y  = out_y;\n\n      /* now, process all segments in the contour */\n      do\n      {\n        /* first, extend current segment's end whenever possible */\n        after = end;\n        do\n        {\n          do\n          {\n            end   = after;\n            after = after->next;\n            if ( after == first )\n              finished = 1;\n\n            out_x = after->org_u - end->org_u;\n            out_y = after->org_v - end->org_v;\n\n          } while ( out_x == 0 && out_y == 0 );\n\n          orient_cur = psh_corner_orientation( in_x, in_y, out_x, out_y );\n\n        } while ( orient_cur == 0 );\n\n        if ( ( orient_cur ^ orient_prev ) < 0 )\n        {\n          do\n          {\n            psh_point_set_inflex( start );\n            start = start->next;\n          }\n          while ( start != end );\n\n          psh_point_set_inflex( start );\n        }\n\n        start       = end;\n        end         = after;\n        orient_prev = orient_cur;\n        in_x        = out_x;\n        in_y        = out_y;\n\n      } while ( !finished );\n\n    Skip:\n      ;\n    }\n  }\n\n#endif /* COMPUTE_INFLEXS */\n\n\n  static void\n  psh_glyph_done( PSH_Glyph  glyph )\n  {\n    FT_Memory  memory = glyph->memory;\n\n\n    psh_hint_table_done( &glyph->hint_tables[1], memory );\n    psh_hint_table_done( &glyph->hint_tables[0], memory );\n\n    FT_FREE( glyph->points );\n    FT_FREE( glyph->contours );\n\n    glyph->num_points   = 0;\n    glyph->num_contours = 0;\n\n    glyph->memory = 0;\n  }\n\n\n  static int\n  psh_compute_dir( FT_Pos  dx,\n                   FT_Pos  dy )\n  {\n    FT_Pos  ax, ay;\n    int     result = PSH_DIR_NONE;\n\n\n    ax = FT_ABS( dx );\n    ay = FT_ABS( dy );\n\n    if ( ay * 12 < ax )\n    {\n      /* |dy| <<< |dx|  means a near-horizontal segment */\n      result = ( dx >= 0 ) ? PSH_DIR_RIGHT : PSH_DIR_LEFT;\n    }\n    else if ( ax * 12 < ay )\n    {\n      /* |dx| <<< |dy|  means a near-vertical segment */\n      result = ( dy >= 0 ) ? PSH_DIR_UP : PSH_DIR_DOWN;\n    }\n\n    return result;\n  }\n\n\n  /* load outline point coordinates into hinter glyph */\n  static void\n  psh_glyph_load_points( PSH_Glyph  glyph,\n                         FT_Int     dimension )\n  {\n    FT_Vector*  vec   = glyph->outline->points;\n    PSH_Point   point = glyph->points;\n    FT_UInt     count = glyph->num_points;\n\n\n    for ( ; count > 0; count--, point++, vec++ )\n    {\n      point->flags2 = 0;\n      point->hint   = NULL;\n      if ( dimension == 0 )\n      {\n        point->org_u = vec->x;\n        point->org_v = vec->y;\n      }\n      else\n      {\n        point->org_u = vec->y;\n        point->org_v = vec->x;\n      }\n\n#ifdef DEBUG_HINTER\n      point->org_x = vec->x;\n      point->org_y = vec->y;\n#endif\n\n    }\n  }\n\n\n  /* save hinted point coordinates back to outline */\n  static void\n  psh_glyph_save_points( PSH_Glyph  glyph,\n                         FT_Int     dimension )\n  {\n    FT_UInt     n;\n    PSH_Point   point = glyph->points;\n    FT_Vector*  vec   = glyph->outline->points;\n    char*       tags  = glyph->outline->tags;\n\n\n    for ( n = 0; n < glyph->num_points; n++ )\n    {\n      if ( dimension == 0 )\n        vec[n].x = point->cur_u;\n      else\n        vec[n].y = point->cur_u;\n\n      if ( psh_point_is_strong( point ) )\n        tags[n] |= (char)( ( dimension == 0 ) ? 32 : 64 );\n\n#ifdef DEBUG_HINTER\n\n      if ( dimension == 0 )\n      {\n        point->cur_x   = point->cur_u;\n        point->flags_x = point->flags2 | point->flags;\n      }\n      else\n      {\n        point->cur_y   = point->cur_u;\n        point->flags_y = point->flags2 | point->flags;\n      }\n\n#endif\n\n      point++;\n    }\n  }\n\n\n  static FT_Error\n  psh_glyph_init( PSH_Glyph    glyph,\n                  FT_Outline*  outline,\n                  PS_Hints     ps_hints,\n                  PSH_Globals  globals )\n  {\n    FT_Error   error;\n    FT_Memory  memory;\n\n\n    /* clear all fields */\n    FT_MEM_ZERO( glyph, sizeof ( *glyph ) );\n\n    memory = glyph->memory = globals->memory;\n\n    /* allocate and setup points + contours arrays */\n    if ( FT_NEW_ARRAY( glyph->points,   outline->n_points   ) ||\n         FT_NEW_ARRAY( glyph->contours, outline->n_contours ) )\n      goto Exit;\n\n    glyph->num_points   = outline->n_points;\n    glyph->num_contours = outline->n_contours;\n\n    {\n      FT_UInt      first = 0, next, n;\n      PSH_Point    points  = glyph->points;\n      PSH_Contour  contour = glyph->contours;\n\n\n      for ( n = 0; n < glyph->num_contours; n++ )\n      {\n        FT_Int     count;\n        PSH_Point  point;\n\n\n        next  = outline->contours[n] + 1;\n        count = next - first;\n\n        contour->start = points + first;\n        contour->count = (FT_UInt)count;\n\n        if ( count > 0 )\n        {\n          point = points + first;\n\n          point->prev    = points + next - 1;\n          point->contour = contour;\n\n          for ( ; count > 1; count-- )\n          {\n            point[0].next = point + 1;\n            point[1].prev = point;\n            point++;\n            point->contour = contour;\n          }\n          point->next = points + first;\n        }\n\n        contour++;\n        first = next;\n      }\n    }\n\n    {\n      PSH_Point   points = glyph->points;\n      PSH_Point   point  = points;\n      FT_Vector*  vec    = outline->points;\n      FT_UInt     n;\n\n\n      for ( n = 0; n < glyph->num_points; n++, point++ )\n      {\n        FT_Int  n_prev = (FT_Int)( point->prev - points );\n        FT_Int  n_next = (FT_Int)( point->next - points );\n        FT_Pos  dxi, dyi, dxo, dyo;\n\n\n        if ( !( outline->tags[n] & FT_CURVE_TAG_ON ) )\n          point->flags = PSH_POINT_OFF;\n\n        dxi = vec[n].x - vec[n_prev].x;\n        dyi = vec[n].y - vec[n_prev].y;\n\n        point->dir_in = (FT_Char)psh_compute_dir( dxi, dyi );\n\n        dxo = vec[n_next].x - vec[n].x;\n        dyo = vec[n_next].y - vec[n].y;\n\n        point->dir_out = (FT_Char)psh_compute_dir( dxo, dyo );\n\n        /* detect smooth points */\n        if ( point->flags & PSH_POINT_OFF )\n          point->flags |= PSH_POINT_SMOOTH;\n\n        else if ( point->dir_in == point->dir_out )\n        {\n          if ( point->dir_out != PSH_DIR_NONE           ||\n               psh_corner_is_flat( dxi, dyi, dxo, dyo ) )\n            point->flags |= PSH_POINT_SMOOTH;\n        }\n      }\n    }\n\n    glyph->outline = outline;\n    glyph->globals = globals;\n\n#ifdef COMPUTE_INFLEXS\n    psh_glyph_load_points( glyph, 0 );\n    psh_glyph_compute_inflections( glyph );\n#endif /* COMPUTE_INFLEXS */\n\n    /* now deal with hints tables */\n    error = psh_hint_table_init( &glyph->hint_tables [0],\n                                 &ps_hints->dimension[0].hints,\n                                 &ps_hints->dimension[0].masks,\n                                 &ps_hints->dimension[0].counters,\n                                 memory );\n    if ( error )\n      goto Exit;\n\n    error = psh_hint_table_init( &glyph->hint_tables [1],\n                                 &ps_hints->dimension[1].hints,\n                                 &ps_hints->dimension[1].masks,\n                                 &ps_hints->dimension[1].counters,\n                                 memory );\n    if ( error )\n      goto Exit;\n\n  Exit:\n    return error;\n  }\n\n\n  /* compute all extrema in a glyph for a given dimension */\n  static void\n  psh_glyph_compute_extrema( PSH_Glyph  glyph )\n  {\n    FT_UInt  n;\n\n\n    /* first of all, compute all local extrema */\n    for ( n = 0; n < glyph->num_contours; n++ )\n    {\n      PSH_Point  first = glyph->contours[n].start;\n      PSH_Point  point, before, after;\n\n\n      if ( glyph->contours[n].count == 0 )\n        continue;\n\n      point  = first;\n      before = point;\n\n      do\n      {\n        before = before->prev;\n        if ( before == first )\n          goto Skip;\n\n      } while ( before->org_u == point->org_u );\n\n      first = point = before->next;\n\n      for (;;)\n      {\n        after = point;\n        do\n        {\n          after = after->next;\n          if ( after == first )\n            goto Next;\n\n        } while ( after->org_u == point->org_u );\n\n        if ( before->org_u < point->org_u )\n        {\n          if ( after->org_u < point->org_u )\n          {\n            /* local maximum */\n            goto Extremum;\n          }\n        }\n        else /* before->org_u > point->org_u */\n        {\n          if ( after->org_u > point->org_u )\n          {\n            /* local minimum */\n          Extremum:\n            do\n            {\n              psh_point_set_extremum( point );\n              point = point->next;\n\n            } while ( point != after );\n          }\n        }\n\n        before = after->prev;\n        point  = after;\n\n      } /* for  */\n\n    Next:\n      ;\n    }\n\n    /* for each extremum, determine its direction along the */\n    /* orthogonal axis                                      */\n    for ( n = 0; n < glyph->num_points; n++ )\n    {\n      PSH_Point  point, before, after;\n\n\n      point  = &glyph->points[n];\n      before = point;\n      after  = point;\n\n      if ( psh_point_is_extremum( point ) )\n      {\n        do\n        {\n          before = before->prev;\n          if ( before == point )\n            goto Skip;\n\n        } while ( before->org_v == point->org_v );\n\n        do\n        {\n          after = after->next;\n          if ( after == point )\n            goto Skip;\n\n        } while ( after->org_v == point->org_v );\n      }\n\n      if ( before->org_v < point->org_v &&\n           after->org_v  > point->org_v )\n      {\n        psh_point_set_positive( point );\n      }\n      else if ( before->org_v > point->org_v &&\n                after->org_v  < point->org_v )\n      {\n        psh_point_set_negative( point );\n      }\n\n    Skip:\n      ;\n    }\n  }\n\n\n  /* major_dir is the direction for points on the bottom/left of the stem; */\n  /* Points on the top/right of the stem will have a direction of          */\n  /* -major_dir.                                                           */\n\n  static void\n  psh_hint_table_find_strong_points( PSH_Hint_Table  table,\n                                     PSH_Point       point,\n                                     FT_UInt         count,\n                                     FT_Int          threshold,\n                                     FT_Int          major_dir )\n  {\n    PSH_Hint*  sort      = table->sort;\n    FT_UInt    num_hints = table->num_hints;\n\n\n    for ( ; count > 0; count--, point++ )\n    {\n      FT_Int  point_dir = 0;\n      FT_Pos  org_u     = point->org_u;\n\n\n      if ( psh_point_is_strong( point ) )\n        continue;\n\n      if ( PSH_DIR_COMPARE( point->dir_in, major_dir ) )\n        point_dir = point->dir_in;\n\n      else if ( PSH_DIR_COMPARE( point->dir_out, major_dir ) )\n        point_dir = point->dir_out;\n\n      if ( point_dir )\n      {\n        if ( point_dir == major_dir )\n        {\n          FT_UInt  nn;\n\n\n          for ( nn = 0; nn < num_hints; nn++ )\n          {\n            PSH_Hint  hint = sort[nn];\n            FT_Pos    d    = org_u - hint->org_pos;\n\n\n            if ( d < threshold && -d < threshold )\n            {\n              psh_point_set_strong( point );\n              point->flags2 |= PSH_POINT_EDGE_MIN;\n              point->hint    = hint;\n              break;\n            }\n          }\n        }\n        else if ( point_dir == -major_dir )\n        {\n          FT_UInt  nn;\n\n\n          for ( nn = 0; nn < num_hints; nn++ )\n          {\n            PSH_Hint  hint = sort[nn];\n            FT_Pos    d    = org_u - hint->org_pos - hint->org_len;\n\n\n            if ( d < threshold && -d < threshold )\n            {\n              psh_point_set_strong( point );\n              point->flags2 |= PSH_POINT_EDGE_MAX;\n              point->hint    = hint;\n              break;\n            }\n          }\n        }\n      }\n\n#if 1\n      else if ( psh_point_is_extremum( point ) )\n      {\n        /* treat extrema as special cases for stem edge alignment */\n        FT_UInt  nn, min_flag, max_flag;\n\n\n        if ( major_dir == PSH_DIR_HORIZONTAL )\n        {\n          min_flag = PSH_POINT_POSITIVE;\n          max_flag = PSH_POINT_NEGATIVE;\n        }\n        else\n        {\n          min_flag = PSH_POINT_NEGATIVE;\n          max_flag = PSH_POINT_POSITIVE;\n        }\n\n        if ( point->flags2 & min_flag )\n        {\n          for ( nn = 0; nn < num_hints; nn++ )\n          {\n            PSH_Hint  hint = sort[nn];\n            FT_Pos    d    = org_u - hint->org_pos;\n\n\n            if ( d < threshold && -d < threshold )\n            {\n              point->flags2 |= PSH_POINT_EDGE_MIN;\n              point->hint    = hint;\n              psh_point_set_strong( point );\n              break;\n            }\n          }\n        }\n        else if ( point->flags2 & max_flag )\n        {\n          for ( nn = 0; nn < num_hints; nn++ )\n          {\n            PSH_Hint  hint = sort[nn];\n            FT_Pos    d    = org_u - hint->org_pos - hint->org_len;\n\n\n            if ( d < threshold && -d < threshold )\n            {\n              point->flags2 |= PSH_POINT_EDGE_MAX;\n              point->hint    = hint;\n              psh_point_set_strong( point );\n              break;\n            }\n          }\n        }\n\n        if ( point->hint == NULL )\n        {\n          for ( nn = 0; nn < num_hints; nn++ )\n          {\n            PSH_Hint  hint = sort[nn];\n\n\n            if ( org_u >= hint->org_pos                 &&\n                org_u <= hint->org_pos + hint->org_len )\n            {\n              point->hint = hint;\n              break;\n            }\n          }\n        }\n      }\n\n#endif /* 1 */\n    }\n  }\n\n\n  /* the accepted shift for strong points in fractional pixels */\n#define PSH_STRONG_THRESHOLD  32\n\n  /* the maximum shift value in font units */\n#define PSH_STRONG_THRESHOLD_MAXIMUM  30\n\n\n  /* find strong points in a glyph */\n  static void\n  psh_glyph_find_strong_points( PSH_Glyph  glyph,\n                                FT_Int     dimension )\n  {\n    /* a point is `strong' if it is located on a stem edge and       */\n    /* has an `in' or `out' tangent parallel to the hint's direction */\n\n    PSH_Hint_Table  table     = &glyph->hint_tables[dimension];\n    PS_Mask         mask      = table->hint_masks->masks;\n    FT_UInt         num_masks = table->hint_masks->num_masks;\n    FT_UInt         first     = 0;\n    FT_Int          major_dir = dimension == 0 ? PSH_DIR_VERTICAL\n                                               : PSH_DIR_HORIZONTAL;\n    PSH_Dimension   dim       = &glyph->globals->dimension[dimension];\n    FT_Fixed        scale     = dim->scale_mult;\n    FT_Int          threshold;\n\n\n    threshold = (FT_Int)FT_DivFix( PSH_STRONG_THRESHOLD, scale );\n    if ( threshold > PSH_STRONG_THRESHOLD_MAXIMUM )\n      threshold = PSH_STRONG_THRESHOLD_MAXIMUM;\n\n    /* process secondary hints to `selected' points */\n    if ( num_masks > 1 && glyph->num_points > 0 )\n    {\n      /* the `endchar' op can reduce the number of points */\n      first = mask->end_point > glyph->num_points\n                ? glyph->num_points\n                : mask->end_point;\n      mask++;\n      for ( ; num_masks > 1; num_masks--, mask++ )\n      {\n        FT_UInt  next;\n        FT_Int   count;\n\n\n        next  = mask->end_point > glyph->num_points\n                  ? glyph->num_points\n                  : mask->end_point;\n        count = next - first;\n        if ( count > 0 )\n        {\n          PSH_Point  point = glyph->points + first;\n\n\n          psh_hint_table_activate_mask( table, mask );\n\n          psh_hint_table_find_strong_points( table, point, count,\n                                             threshold, major_dir );\n        }\n        first = next;\n      }\n    }\n\n    /* process primary hints for all points */\n    if ( num_masks == 1 )\n    {\n      FT_UInt    count = glyph->num_points;\n      PSH_Point  point = glyph->points;\n\n\n      psh_hint_table_activate_mask( table, table->hint_masks->masks );\n\n      psh_hint_table_find_strong_points( table, point, count,\n                                         threshold, major_dir );\n    }\n\n    /* now, certain points may have been attached to a hint and */\n    /* not marked as strong; update their flags then            */\n    {\n      FT_UInt    count = glyph->num_points;\n      PSH_Point  point = glyph->points;\n\n\n      for ( ; count > 0; count--, point++ )\n        if ( point->hint && !psh_point_is_strong( point ) )\n          psh_point_set_strong( point );\n    }\n  }\n\n\n  /* find points in a glyph which are in a blue zone and have `in' or */\n  /* `out' tangents parallel to the horizontal axis                   */\n  static void\n  psh_glyph_find_blue_points( PSH_Blues  blues,\n                              PSH_Glyph  glyph )\n  {\n    PSH_Blue_Table  table;\n    PSH_Blue_Zone   zone;\n    FT_UInt         glyph_count = glyph->num_points;\n    FT_UInt         blue_count;\n    PSH_Point       point = glyph->points;\n\n\n    for ( ; glyph_count > 0; glyph_count--, point++ )\n    {\n      FT_Pos  y;\n\n\n      /* check tangents */\n      if ( !PSH_DIR_COMPARE( point->dir_in,  PSH_DIR_HORIZONTAL ) &&\n           !PSH_DIR_COMPARE( point->dir_out, PSH_DIR_HORIZONTAL ) )\n        continue;\n\n      /* skip strong points */\n      if ( psh_point_is_strong( point ) )\n        continue;\n\n      y = point->org_u;\n\n      /* look up top zones */\n      table      = &blues->normal_top;\n      blue_count = table->count;\n      zone       = table->zones;\n\n      for ( ; blue_count > 0; blue_count--, zone++ )\n      {\n        FT_Pos  delta = y - zone->org_bottom;\n\n\n        if ( delta < -blues->blue_fuzz )\n          break;\n\n        if ( y <= zone->org_top + blues->blue_fuzz )\n          if ( blues->no_overshoots || delta <= blues->blue_threshold )\n          {\n            point->cur_u = zone->cur_bottom;\n            psh_point_set_strong( point );\n            psh_point_set_fitted( point );\n          }\n      }\n\n      /* look up bottom zones */\n      table      = &blues->normal_bottom;\n      blue_count = table->count;\n      zone       = table->zones + blue_count - 1;\n\n      for ( ; blue_count > 0; blue_count--, zone-- )\n      {\n        FT_Pos  delta = zone->org_top - y;\n\n\n        if ( delta < -blues->blue_fuzz )\n          break;\n\n        if ( y >= zone->org_bottom - blues->blue_fuzz )\n          if ( blues->no_overshoots || delta < blues->blue_threshold )\n          {\n            point->cur_u = zone->cur_top;\n            psh_point_set_strong( point );\n            psh_point_set_fitted( point );\n          }\n      }\n    }\n  }\n\n\n  /* interpolate strong points with the help of hinted coordinates */\n  static void\n  psh_glyph_interpolate_strong_points( PSH_Glyph  glyph,\n                                       FT_Int     dimension )\n  {\n    PSH_Dimension  dim   = &glyph->globals->dimension[dimension];\n    FT_Fixed       scale = dim->scale_mult;\n\n    FT_UInt        count = glyph->num_points;\n    PSH_Point      point = glyph->points;\n\n\n    for ( ; count > 0; count--, point++ )\n    {\n      PSH_Hint  hint = point->hint;\n\n\n      if ( hint )\n      {\n        FT_Pos  delta;\n\n\n        if ( psh_point_is_edge_min( point ) )\n          point->cur_u = hint->cur_pos;\n\n        else if ( psh_point_is_edge_max( point ) )\n          point->cur_u = hint->cur_pos + hint->cur_len;\n\n        else\n        {\n          delta = point->org_u - hint->org_pos;\n\n          if ( delta <= 0 )\n            point->cur_u = hint->cur_pos + FT_MulFix( delta, scale );\n\n          else if ( delta >= hint->org_len )\n            point->cur_u = hint->cur_pos + hint->cur_len +\n                             FT_MulFix( delta - hint->org_len, scale );\n\n          else /* hint->org_len > 0 */\n            point->cur_u = hint->cur_pos +\n                             FT_MulDiv( delta, hint->cur_len,\n                                        hint->org_len );\n        }\n        psh_point_set_fitted( point );\n      }\n    }\n  }\n\n\n#define  PSH_MAX_STRONG_INTERNAL  16\n\n  static void\n  psh_glyph_interpolate_normal_points( PSH_Glyph  glyph,\n                                       FT_Int     dimension )\n  {\n\n#if 1\n    /* first technique: a point is strong if it is a local extremum */\n\n    PSH_Dimension  dim    = &glyph->globals->dimension[dimension];\n    FT_Fixed       scale  = dim->scale_mult;\n    FT_Memory      memory = glyph->memory;\n\n    PSH_Point*     strongs     = NULL;\n    PSH_Point      strongs_0[PSH_MAX_STRONG_INTERNAL];\n    FT_UInt        num_strongs = 0;\n\n    PSH_Point      points = glyph->points;\n    PSH_Point      points_end = points + glyph->num_points;\n    PSH_Point      point;\n\n\n    /* first count the number of strong points */\n    for ( point = points; point < points_end; point++ )\n    {\n      if ( psh_point_is_strong( point ) )\n        num_strongs++;\n    }\n\n    if ( num_strongs == 0 )  /* nothing to do here */\n      return;\n\n    /* allocate an array to store a list of points, */\n    /* stored in increasing org_u order             */\n    if ( num_strongs <= PSH_MAX_STRONG_INTERNAL )\n      strongs = strongs_0;\n    else\n    {\n      FT_Error  error;\n\n\n      if ( FT_NEW_ARRAY( strongs, num_strongs ) )\n        return;\n    }\n\n    num_strongs = 0;\n    for ( point = points; point < points_end; point++ )\n    {\n      PSH_Point*  insert;\n\n\n      if ( !psh_point_is_strong( point ) )\n        continue;\n\n      for ( insert = strongs + num_strongs; insert > strongs; insert-- )\n      {\n        if ( insert[-1]->org_u <= point->org_u )\n          break;\n\n        insert[0] = insert[-1];\n      }\n      insert[0] = point;\n      num_strongs++;\n    }\n\n    /* now try to interpolate all normal points */\n    for ( point = points; point < points_end; point++ )\n    {\n      if ( psh_point_is_strong( point ) )\n        continue;\n\n      /* sometimes, some local extrema are smooth points */\n      if ( psh_point_is_smooth( point ) )\n      {\n        if ( point->dir_in == PSH_DIR_NONE   ||\n             point->dir_in != point->dir_out )\n          continue;\n\n        if ( !psh_point_is_extremum( point ) &&\n             !psh_point_is_inflex( point )   )\n          continue;\n\n        point->flags &= ~PSH_POINT_SMOOTH;\n      }\n\n      /* find best enclosing point coordinates then interpolate */\n      {\n        PSH_Point   before, after;\n        FT_UInt     nn;\n\n\n        for ( nn = 0; nn < num_strongs; nn++ )\n          if ( strongs[nn]->org_u > point->org_u )\n            break;\n\n        if ( nn == 0 )  /* point before the first strong point */\n        {\n          after = strongs[0];\n\n          point->cur_u = after->cur_u +\n                           FT_MulFix( point->org_u - after->org_u,\n                                      scale );\n        }\n        else\n        {\n          before = strongs[nn - 1];\n\n          for ( nn = num_strongs; nn > 0; nn-- )\n            if ( strongs[nn - 1]->org_u < point->org_u )\n              break;\n\n          if ( nn == num_strongs )  /* point is after last strong point */\n          {\n            before = strongs[nn - 1];\n\n            point->cur_u = before->cur_u +\n                             FT_MulFix( point->org_u - before->org_u,\n                                        scale );\n          }\n          else\n          {\n            FT_Pos  u;\n\n\n            after = strongs[nn];\n\n            /* now interpolate point between before and after */\n            u = point->org_u;\n\n            if ( u == before->org_u )\n              point->cur_u = before->cur_u;\n\n            else if ( u == after->org_u )\n              point->cur_u = after->cur_u;\n\n            else\n              point->cur_u = before->cur_u +\n                               FT_MulDiv( u - before->org_u,\n                                          after->cur_u - before->cur_u,\n                                          after->org_u - before->org_u );\n          }\n        }\n        psh_point_set_fitted( point );\n      }\n    }\n\n    if ( strongs != strongs_0 )\n      FT_FREE( strongs );\n\n#endif /* 1 */\n\n  }\n\n\n  /* interpolate other points */\n  static void\n  psh_glyph_interpolate_other_points( PSH_Glyph  glyph,\n                                      FT_Int     dimension )\n  {\n    PSH_Dimension  dim          = &glyph->globals->dimension[dimension];\n    FT_Fixed       scale        = dim->scale_mult;\n    FT_Fixed       delta        = dim->scale_delta;\n    PSH_Contour    contour      = glyph->contours;\n    FT_UInt        num_contours = glyph->num_contours;\n\n\n    for ( ; num_contours > 0; num_contours--, contour++ )\n    {\n      PSH_Point  start = contour->start;\n      PSH_Point  first, next, point;\n      FT_UInt    fit_count;\n\n\n      /* count the number of strong points in this contour */\n      next      = start + contour->count;\n      fit_count = 0;\n      first     = 0;\n\n      for ( point = start; point < next; point++ )\n        if ( psh_point_is_fitted( point ) )\n        {\n          if ( !first )\n            first = point;\n\n          fit_count++;\n        }\n\n      /* if there are less than 2 fitted points in the contour, we */\n      /* simply scale and eventually translate the contour points  */\n      if ( fit_count < 2 )\n      {\n        if ( fit_count == 1 )\n          delta = first->cur_u - FT_MulFix( first->org_u, scale );\n\n        for ( point = start; point < next; point++ )\n          if ( point != first )\n            point->cur_u = FT_MulFix( point->org_u, scale ) + delta;\n\n        goto Next_Contour;\n      }\n\n      /* there are more than 2 strong points in this contour; we */\n      /* need to interpolate weak points between them            */\n      start = first;\n      do\n      {\n        /* skip consecutive fitted points */\n        for (;;)\n        {\n          next = first->next;\n          if ( next == start )\n            goto Next_Contour;\n\n          if ( !psh_point_is_fitted( next ) )\n            break;\n\n          first = next;\n        }\n\n        /* find next fitted point after unfitted one */\n        for (;;)\n        {\n          next = next->next;\n          if ( psh_point_is_fitted( next ) )\n            break;\n        }\n\n        /* now interpolate between them */\n        {\n          FT_Pos    org_a, org_ab, cur_a, cur_ab;\n          FT_Pos    org_c, org_ac, cur_c;\n          FT_Fixed  scale_ab;\n\n\n          if ( first->org_u <= next->org_u )\n          {\n            org_a  = first->org_u;\n            cur_a  = first->cur_u;\n            org_ab = next->org_u - org_a;\n            cur_ab = next->cur_u - cur_a;\n          }\n          else\n          {\n            org_a  = next->org_u;\n            cur_a  = next->cur_u;\n            org_ab = first->org_u - org_a;\n            cur_ab = first->cur_u - cur_a;\n          }\n\n          scale_ab = 0x10000L;\n          if ( org_ab > 0 )\n            scale_ab = FT_DivFix( cur_ab, org_ab );\n\n          point = first->next;\n          do\n          {\n            org_c  = point->org_u;\n            org_ac = org_c - org_a;\n\n            if ( org_ac <= 0 )\n            {\n              /* on the left of the interpolation zone */\n              cur_c = cur_a + FT_MulFix( org_ac, scale );\n            }\n            else if ( org_ac >= org_ab )\n            {\n              /* on the right on the interpolation zone */\n              cur_c = cur_a + cur_ab + FT_MulFix( org_ac - org_ab, scale );\n            }\n            else\n            {\n              /* within the interpolation zone */\n              cur_c = cur_a + FT_MulFix( org_ac, scale_ab );\n            }\n\n            point->cur_u = cur_c;\n\n            point = point->next;\n\n          } while ( point != next );\n        }\n\n        /* keep going until all points in the contours have been processed */\n        first = next;\n\n      } while ( first != start );\n\n    Next_Contour:\n      ;\n    }\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                     HIGH-LEVEL INTERFACE                      *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  FT_Error\n  ps_hints_apply( PS_Hints        ps_hints,\n                  FT_Outline*     outline,\n                  PSH_Globals     globals,\n                  FT_Render_Mode  hint_mode )\n  {\n    PSH_GlyphRec  glyphrec;\n    PSH_Glyph     glyph = &glyphrec;\n    FT_Error      error;\n#ifdef DEBUG_HINTER\n    FT_Memory     memory;\n#endif\n    FT_Int        dimension;\n\n\n    /* something to do? */\n    if ( outline->n_points == 0 || outline->n_contours == 0 )\n      return FT_Err_Ok;\n\n#ifdef DEBUG_HINTER\n\n    memory = globals->memory;\n\n    if ( ps_debug_glyph )\n    {\n      psh_glyph_done( ps_debug_glyph );\n      FT_FREE( ps_debug_glyph );\n    }\n\n    if ( FT_NEW( glyph ) )\n      return error;\n\n    ps_debug_glyph = glyph;\n\n#endif /* DEBUG_HINTER */\n\n    error = psh_glyph_init( glyph, outline, ps_hints, globals );\n    if ( error )\n      goto Exit;\n\n    /* try to optimize the y_scale so that the top of non-capital letters\n     * is aligned on a pixel boundary whenever possible\n     */\n    {\n      PSH_Dimension  dim_x = &glyph->globals->dimension[0];\n      PSH_Dimension  dim_y = &glyph->globals->dimension[1];\n\n      FT_Fixed  x_scale = dim_x->scale_mult;\n      FT_Fixed  y_scale = dim_y->scale_mult;\n\n      FT_Fixed  old_x_scale = x_scale;\n      FT_Fixed  old_y_scale = y_scale;\n\n      FT_Fixed  scaled;\n      FT_Fixed  fitted;\n\n      FT_Bool  rescale = FALSE;\n\n\n      scaled = FT_MulFix( globals->blues.normal_top.zones->org_ref, y_scale );\n      fitted = FT_PIX_ROUND( scaled );\n\n      if ( fitted != 0 && scaled != fitted )\n      {\n        rescale = TRUE;\n\n        y_scale = FT_MulDiv( y_scale, fitted, scaled );\n\n        if ( fitted < scaled )\n          x_scale -= x_scale / 50;\n\n        psh_globals_set_scale( glyph->globals, x_scale, y_scale, 0, 0 );\n      }\n\n      glyph->do_horz_hints = 1;\n      glyph->do_vert_hints = 1;\n\n      glyph->do_horz_snapping = FT_BOOL( hint_mode == FT_RENDER_MODE_MONO ||\n                                         hint_mode == FT_RENDER_MODE_LCD  );\n\n      glyph->do_vert_snapping = FT_BOOL( hint_mode == FT_RENDER_MODE_MONO  ||\n                                         hint_mode == FT_RENDER_MODE_LCD_V );\n\n      glyph->do_stem_adjust   = FT_BOOL( hint_mode != FT_RENDER_MODE_LIGHT );\n\n      for ( dimension = 0; dimension < 2; dimension++ )\n      {\n        /* load outline coordinates into glyph */\n        psh_glyph_load_points( glyph, dimension );\n\n        /* compute local extrema */\n        psh_glyph_compute_extrema( glyph );\n\n        /* compute aligned stem/hints positions */\n        psh_hint_table_align_hints( &glyph->hint_tables[dimension],\n                                    glyph->globals,\n                                    dimension,\n                                    glyph );\n\n        /* find strong points, align them, then interpolate others */\n        psh_glyph_find_strong_points( glyph, dimension );\n        if ( dimension == 1 )\n          psh_glyph_find_blue_points( &globals->blues, glyph );\n        psh_glyph_interpolate_strong_points( glyph, dimension );\n        psh_glyph_interpolate_normal_points( glyph, dimension );\n        psh_glyph_interpolate_other_points( glyph, dimension );\n\n        /* save hinted coordinates back to outline */\n        psh_glyph_save_points( glyph, dimension );\n\n        if ( rescale )\n          psh_globals_set_scale( glyph->globals,\n                                 old_x_scale, old_y_scale, 0, 0 );\n      }\n    }\n\n  Exit:\n\n#ifndef DEBUG_HINTER\n    psh_glyph_done( glyph );\n#endif\n\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pshinter/pshalgo.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pshalgo.h                                                              */\n/*                                                                         */\n/*    PostScript hinting algorithm (specification).                        */\n/*                                                                         */\n/*  Copyright 2001-2003, 2008, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PSHALGO_H__\n#define __PSHALGO_H__\n\n\n#include \"pshrec.h\"\n#include \"pshglob.h\"\n\n\nFT_BEGIN_HEADER\n\n\n  /* handle to Hint structure */\n  typedef struct PSH_HintRec_*  PSH_Hint;\n\n  /* hint bit-flags */\n  typedef enum  PSH_Hint_Flags_\n  {\n    PSH_HINT_GHOST  = PS_HINT_FLAG_GHOST,\n    PSH_HINT_BOTTOM = PS_HINT_FLAG_BOTTOM,\n    PSH_HINT_ACTIVE = 4,\n    PSH_HINT_FITTED = 8\n\n  } PSH_Hint_Flags;\n\n\n#define psh_hint_is_active( x )  ( ( (x)->flags & PSH_HINT_ACTIVE ) != 0 )\n#define psh_hint_is_ghost( x )   ( ( (x)->flags & PSH_HINT_GHOST  ) != 0 )\n#define psh_hint_is_fitted( x )  ( ( (x)->flags & PSH_HINT_FITTED ) != 0 )\n\n#define psh_hint_activate( x )    (x)->flags |=  PSH_HINT_ACTIVE\n#define psh_hint_deactivate( x )  (x)->flags &= ~PSH_HINT_ACTIVE\n#define psh_hint_set_fitted( x )  (x)->flags |=  PSH_HINT_FITTED\n\n  /* hint structure */\n  typedef struct  PSH_HintRec_\n  {\n    FT_Int    org_pos;\n    FT_Int    org_len;\n    FT_Pos    cur_pos;\n    FT_Pos    cur_len;\n    FT_UInt   flags;\n    PSH_Hint  parent;\n    FT_Int    order;\n\n  } PSH_HintRec;\n\n\n  /* this is an interpolation zone used for strong points;  */\n  /* weak points are interpolated according to their strong */\n  /* neighbours                                             */\n  typedef struct  PSH_ZoneRec_\n  {\n    FT_Fixed  scale;\n    FT_Fixed  delta;\n    FT_Pos    min;\n    FT_Pos    max;\n\n  } PSH_ZoneRec, *PSH_Zone;\n\n\n  typedef struct  PSH_Hint_TableRec_\n  {\n    FT_UInt        max_hints;\n    FT_UInt        num_hints;\n    PSH_Hint       hints;\n    PSH_Hint*      sort;\n    PSH_Hint*      sort_global;\n    FT_UInt        num_zones;\n    PSH_ZoneRec*   zones;\n    PSH_Zone       zone;\n    PS_Mask_Table  hint_masks;\n    PS_Mask_Table  counter_masks;\n\n  } PSH_Hint_TableRec, *PSH_Hint_Table;\n\n\n  typedef struct PSH_PointRec_*    PSH_Point;\n  typedef struct PSH_ContourRec_*  PSH_Contour;\n\n  enum\n  {\n    PSH_DIR_NONE  =  4,\n    PSH_DIR_UP    = -1,\n    PSH_DIR_DOWN  =  1,\n    PSH_DIR_LEFT  = -2,\n    PSH_DIR_RIGHT =  2\n  };\n\n#define PSH_DIR_HORIZONTAL  2\n#define PSH_DIR_VERTICAL    1\n\n#define PSH_DIR_COMPARE( d1, d2 )   ( (d1) == (d2) || (d1) == -(d2) )\n#define PSH_DIR_IS_HORIZONTAL( d )  PSH_DIR_COMPARE( d, PSH_DIR_HORIZONTAL )\n#define PSH_DIR_IS_VERTICAL( d )    PSH_DIR_COMPARE( d, PSH_DIR_VERTICAL )\n\n\n /* the following bit-flags are computed once by the glyph */\n /* analyzer, for both dimensions                          */\n  enum\n  {\n    PSH_POINT_OFF    = 1,   /* point is off the curve */\n    PSH_POINT_SMOOTH = 2,   /* point is smooth        */\n    PSH_POINT_INFLEX = 4    /* point is inflection    */\n  };\n\n#define psh_point_is_smooth( p )  ( (p)->flags & PSH_POINT_SMOOTH )\n#define psh_point_is_off( p )     ( (p)->flags & PSH_POINT_OFF    )\n#define psh_point_is_inflex( p )  ( (p)->flags & PSH_POINT_INFLEX )\n\n#define psh_point_set_smooth( p )  (p)->flags |= PSH_POINT_SMOOTH\n#define psh_point_set_off( p )     (p)->flags |= PSH_POINT_OFF\n#define psh_point_set_inflex( p )  (p)->flags |= PSH_POINT_INFLEX\n\n  /* the following bit-flags are re-computed for each dimension */\n  enum\n  {\n    PSH_POINT_STRONG   = 16,   /* point is strong                           */\n    PSH_POINT_FITTED   = 32,   /* point is already fitted                   */\n    PSH_POINT_EXTREMUM = 64,   /* point is local extremum                   */\n    PSH_POINT_POSITIVE = 128,  /* extremum has positive contour flow        */\n    PSH_POINT_NEGATIVE = 256,  /* extremum has negative contour flow        */\n    PSH_POINT_EDGE_MIN = 512,  /* point is aligned to left/bottom stem edge */\n    PSH_POINT_EDGE_MAX = 1024  /* point is aligned to top/right stem edge   */\n  };\n\n#define psh_point_is_strong( p )    ( (p)->flags2 & PSH_POINT_STRONG )\n#define psh_point_is_fitted( p )    ( (p)->flags2 & PSH_POINT_FITTED )\n#define psh_point_is_extremum( p )  ( (p)->flags2 & PSH_POINT_EXTREMUM )\n#define psh_point_is_positive( p )  ( (p)->flags2 & PSH_POINT_POSITIVE )\n#define psh_point_is_negative( p )  ( (p)->flags2 & PSH_POINT_NEGATIVE )\n#define psh_point_is_edge_min( p )  ( (p)->flags2 & PSH_POINT_EDGE_MIN )\n#define psh_point_is_edge_max( p )  ( (p)->flags2 & PSH_POINT_EDGE_MAX )\n\n#define psh_point_set_strong( p )    (p)->flags2 |= PSH_POINT_STRONG\n#define psh_point_set_fitted( p )    (p)->flags2 |= PSH_POINT_FITTED\n#define psh_point_set_extremum( p )  (p)->flags2 |= PSH_POINT_EXTREMUM\n#define psh_point_set_positive( p )  (p)->flags2 |= PSH_POINT_POSITIVE\n#define psh_point_set_negative( p )  (p)->flags2 |= PSH_POINT_NEGATIVE\n#define psh_point_set_edge_min( p )  (p)->flags2 |= PSH_POINT_EDGE_MIN\n#define psh_point_set_edge_max( p )  (p)->flags2 |= PSH_POINT_EDGE_MAX\n\n\n  typedef struct  PSH_PointRec_\n  {\n    PSH_Point    prev;\n    PSH_Point    next;\n    PSH_Contour  contour;\n    FT_UInt      flags;\n    FT_UInt      flags2;\n    FT_Char      dir_in;\n    FT_Char      dir_out;\n    PSH_Hint     hint;\n    FT_Pos       org_u;\n    FT_Pos       org_v;\n    FT_Pos       cur_u;\n#ifdef DEBUG_HINTER\n    FT_Pos       org_x;\n    FT_Pos       cur_x;\n    FT_Pos       org_y;\n    FT_Pos       cur_y;\n    FT_UInt      flags_x;\n    FT_UInt      flags_y;\n#endif\n\n  } PSH_PointRec;\n\n\n  typedef struct  PSH_ContourRec_\n  {\n    PSH_Point  start;\n    FT_UInt    count;\n\n  } PSH_ContourRec;\n\n\n  typedef struct  PSH_GlyphRec_\n  {\n    FT_UInt            num_points;\n    FT_UInt            num_contours;\n\n    PSH_Point          points;\n    PSH_Contour        contours;\n\n    FT_Memory          memory;\n    FT_Outline*        outline;\n    PSH_Globals        globals;\n    PSH_Hint_TableRec  hint_tables[2];\n\n    FT_Bool            vertical;\n    FT_Int             major_dir;\n    FT_Int             minor_dir;\n\n    FT_Bool            do_horz_hints;\n    FT_Bool            do_vert_hints;\n    FT_Bool            do_horz_snapping;\n    FT_Bool            do_vert_snapping;\n    FT_Bool            do_stem_adjust;\n\n  } PSH_GlyphRec, *PSH_Glyph;\n\n\n#ifdef DEBUG_HINTER\n  extern PSH_Hint_Table  ps_debug_hint_table;\n\n  typedef void\n  (*PSH_HintFunc)( PSH_Hint  hint,\n                   FT_Bool   vertical );\n\n  extern PSH_HintFunc    ps_debug_hint_func;\n\n  extern PSH_Glyph       ps_debug_glyph;\n#endif\n\n\n  extern FT_Error\n  ps_hints_apply( PS_Hints        ps_hints,\n                  FT_Outline*     outline,\n                  PSH_Globals     globals,\n                  FT_Render_Mode  hint_mode );\n\n\nFT_END_HEADER\n\n\n#endif /* __PSHALGO_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pshinter/pshglob.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pshglob.c                                                              */\n/*                                                                         */\n/*    PostScript hinter global hinting management (body).                  */\n/*    Inspired by the new auto-hinter module.                              */\n/*                                                                         */\n/*  Copyright 2001-2004, 2006, 2010, 2012-2014 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used        */\n/*  modified and distributed under the terms of the FreeType project       */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_INTERNAL_OBJECTS_H\n#include \"pshglob.h\"\n\n#ifdef DEBUG_HINTER\n  PSH_Globals  ps_debug_globals = 0;\n#endif\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       STANDARD WIDTHS                         *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* scale the widths/heights table */\n  static void\n  psh_globals_scale_widths( PSH_Globals  globals,\n                            FT_UInt      direction )\n  {\n    PSH_Dimension  dim   = &globals->dimension[direction];\n    PSH_Widths     stdw  = &dim->stdw;\n    FT_UInt        count = stdw->count;\n    PSH_Width      width = stdw->widths;\n    PSH_Width      stand = width;               /* standard width/height */\n    FT_Fixed       scale = dim->scale_mult;\n\n\n    if ( count > 0 )\n    {\n      width->cur = FT_MulFix( width->org, scale );\n      width->fit = FT_PIX_ROUND( width->cur );\n\n      width++;\n      count--;\n\n      for ( ; count > 0; count--, width++ )\n      {\n        FT_Pos  w, dist;\n\n\n        w    = FT_MulFix( width->org, scale );\n        dist = w - stand->cur;\n\n        if ( dist < 0 )\n          dist = -dist;\n\n        if ( dist < 128 )\n          w = stand->cur;\n\n        width->cur = w;\n        width->fit = FT_PIX_ROUND( w );\n      }\n    }\n  }\n\n\n#if 0\n\n  /* org_width is is font units, result in device pixels, 26.6 format */\n  FT_LOCAL_DEF( FT_Pos )\n  psh_dimension_snap_width( PSH_Dimension  dimension,\n                            FT_Int         org_width )\n  {\n    FT_UInt  n;\n    FT_Pos   width     = FT_MulFix( org_width, dimension->scale_mult );\n    FT_Pos   best      = 64 + 32 + 2;\n    FT_Pos   reference = width;\n\n\n    for ( n = 0; n < dimension->stdw.count; n++ )\n    {\n      FT_Pos  w;\n      FT_Pos  dist;\n\n\n      w = dimension->stdw.widths[n].cur;\n      dist = width - w;\n      if ( dist < 0 )\n        dist = -dist;\n      if ( dist < best )\n      {\n        best      = dist;\n        reference = w;\n      }\n    }\n\n    if ( width >= reference )\n    {\n      width -= 0x21;\n      if ( width < reference )\n        width = reference;\n    }\n    else\n    {\n      width += 0x21;\n      if ( width > reference )\n        width = reference;\n    }\n\n    return width;\n  }\n\n#endif /* 0 */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       BLUE ZONES                              *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static void\n  psh_blues_set_zones_0( PSH_Blues       target,\n                         FT_Bool         is_others,\n                         FT_UInt         read_count,\n                         FT_Short*       read,\n                         PSH_Blue_Table  top_table,\n                         PSH_Blue_Table  bot_table )\n  {\n    FT_UInt  count_top = top_table->count;\n    FT_UInt  count_bot = bot_table->count;\n    FT_Bool  first     = 1;\n\n    FT_UNUSED( target );\n\n\n    for ( ; read_count > 1; read_count -= 2 )\n    {\n      FT_Int         reference, delta;\n      FT_UInt        count;\n      PSH_Blue_Zone  zones, zone;\n      FT_Bool        top;\n\n\n      /* read blue zone entry, and select target top/bottom zone */\n      top = 0;\n      if ( first || is_others )\n      {\n        reference = read[1];\n        delta     = read[0] - reference;\n\n        zones = bot_table->zones;\n        count = count_bot;\n        first = 0;\n      }\n      else\n      {\n        reference = read[0];\n        delta     = read[1] - reference;\n\n        zones = top_table->zones;\n        count = count_top;\n        top   = 1;\n      }\n\n      /* insert into sorted table */\n      zone = zones;\n      for ( ; count > 0; count--, zone++ )\n      {\n        if ( reference < zone->org_ref )\n          break;\n\n        if ( reference == zone->org_ref )\n        {\n          FT_Int  delta0 = zone->org_delta;\n\n\n          /* we have two zones on the same reference position -- */\n          /* only keep the largest one                           */\n          if ( delta < 0 )\n          {\n            if ( delta < delta0 )\n              zone->org_delta = delta;\n          }\n          else\n          {\n            if ( delta > delta0 )\n              zone->org_delta = delta;\n          }\n          goto Skip;\n        }\n      }\n\n      for ( ; count > 0; count-- )\n        zone[count] = zone[count-1];\n\n      zone->org_ref   = reference;\n      zone->org_delta = delta;\n\n      if ( top )\n        count_top++;\n      else\n        count_bot++;\n\n    Skip:\n      read += 2;\n    }\n\n    top_table->count = count_top;\n    bot_table->count = count_bot;\n  }\n\n\n  /* Re-read blue zones from the original fonts and store them into out */\n  /* private structure.  This function re-orders, sanitizes and         */\n  /* fuzz-expands the zones as well.                                    */\n  static void\n  psh_blues_set_zones( PSH_Blues  target,\n                       FT_UInt    count,\n                       FT_Short*  blues,\n                       FT_UInt    count_others,\n                       FT_Short*  other_blues,\n                       FT_Int     fuzz,\n                       FT_Int     family )\n  {\n    PSH_Blue_Table  top_table, bot_table;\n    FT_Int          count_top, count_bot;\n\n\n    if ( family )\n    {\n      top_table = &target->family_top;\n      bot_table = &target->family_bottom;\n    }\n    else\n    {\n      top_table = &target->normal_top;\n      bot_table = &target->normal_bottom;\n    }\n\n    /* read the input blue zones, and build two sorted tables  */\n    /* (one for the top zones, the other for the bottom zones) */\n    top_table->count = 0;\n    bot_table->count = 0;\n\n    /* first, the blues */\n    psh_blues_set_zones_0( target, 0,\n                           count, blues, top_table, bot_table );\n    psh_blues_set_zones_0( target, 1,\n                           count_others, other_blues, top_table, bot_table );\n\n    count_top = top_table->count;\n    count_bot = bot_table->count;\n\n    /* sanitize top table */\n    if ( count_top > 0 )\n    {\n      PSH_Blue_Zone  zone = top_table->zones;\n\n\n      for ( count = count_top; count > 0; count--, zone++ )\n      {\n        FT_Int  delta;\n\n\n        if ( count > 1 )\n        {\n          delta = zone[1].org_ref - zone[0].org_ref;\n          if ( zone->org_delta > delta )\n            zone->org_delta = delta;\n        }\n\n        zone->org_bottom = zone->org_ref;\n        zone->org_top    = zone->org_delta + zone->org_ref;\n      }\n    }\n\n    /* sanitize bottom table */\n    if ( count_bot > 0 )\n    {\n      PSH_Blue_Zone  zone = bot_table->zones;\n\n\n      for ( count = count_bot; count > 0; count--, zone++ )\n      {\n        FT_Int  delta;\n\n\n        if ( count > 1 )\n        {\n          delta = zone[0].org_ref - zone[1].org_ref;\n          if ( zone->org_delta < delta )\n            zone->org_delta = delta;\n        }\n\n        zone->org_top    = zone->org_ref;\n        zone->org_bottom = zone->org_delta + zone->org_ref;\n      }\n    }\n\n    /* expand top and bottom tables with blue fuzz */\n    {\n      FT_Int         dim, top, bot, delta;\n      PSH_Blue_Zone  zone;\n\n\n      zone  = top_table->zones;\n      count = count_top;\n\n      for ( dim = 1; dim >= 0; dim-- )\n      {\n        if ( count > 0 )\n        {\n          /* expand the bottom of the lowest zone normally */\n          zone->org_bottom -= fuzz;\n\n          /* expand the top and bottom of intermediate zones;    */\n          /* checking that the interval is smaller than the fuzz */\n          top = zone->org_top;\n\n          for ( count--; count > 0; count-- )\n          {\n            bot   = zone[1].org_bottom;\n            delta = bot - top;\n\n            if ( delta < 2 * fuzz )\n              zone[0].org_top = zone[1].org_bottom = top + delta / 2;\n            else\n            {\n              zone[0].org_top    = top + fuzz;\n              zone[1].org_bottom = bot - fuzz;\n            }\n\n            zone++;\n            top = zone->org_top;\n          }\n\n          /* expand the top of the highest zone normally */\n          zone->org_top = top + fuzz;\n        }\n        zone  = bot_table->zones;\n        count = count_bot;\n      }\n    }\n  }\n\n\n  /* reset the blues table when the device transform changes */\n  static void\n  psh_blues_scale_zones( PSH_Blues  blues,\n                         FT_Fixed   scale,\n                         FT_Pos     delta )\n  {\n    FT_UInt         count;\n    FT_UInt         num;\n    PSH_Blue_Table  table = 0;\n\n    /*                                                        */\n    /* Determine whether we need to suppress overshoots or    */\n    /* not.  We simply need to compare the vertical scale     */\n    /* parameter to the raw bluescale value.  Here is why:    */\n    /*                                                        */\n    /*   We need to suppress overshoots for all pointsizes.   */\n    /*   At 300dpi that satisfies:                            */\n    /*                                                        */\n    /*      pointsize < 240*bluescale + 0.49                  */\n    /*                                                        */\n    /*   This corresponds to:                                 */\n    /*                                                        */\n    /*      pixelsize < 1000*bluescale + 49/24                */\n    /*                                                        */\n    /*      scale*EM_Size < 1000*bluescale + 49/24            */\n    /*                                                        */\n    /*   However, for normal Type 1 fonts, EM_Size is 1000!   */\n    /*   We thus only check:                                  */\n    /*                                                        */\n    /*      scale < bluescale + 49/24000                      */\n    /*                                                        */\n    /*   which we shorten to                                  */\n    /*                                                        */\n    /*      \"scale < bluescale\"                               */\n    /*                                                        */\n    /* Note that `blue_scale' is stored 1000 times its real   */\n    /* value, and that `scale' converts from font units to    */\n    /* fractional pixels.                                     */\n    /*                                                        */\n\n    /* 1000 / 64 = 125 / 8 */\n    if ( scale >= 0x20C49BAL )\n      blues->no_overshoots = FT_BOOL( scale < blues->blue_scale * 8 / 125 );\n    else\n      blues->no_overshoots = FT_BOOL( scale * 125 < blues->blue_scale * 8 );\n\n    /*                                                        */\n    /*  The blue threshold is the font units distance under   */\n    /*  which overshoots are suppressed due to the BlueShift  */\n    /*  even if the scale is greater than BlueScale.          */\n    /*                                                        */\n    /*  It is the smallest distance such that                 */\n    /*                                                        */\n    /*    dist <= BlueShift && dist*scale <= 0.5 pixels       */\n    /*                                                        */\n    {\n      FT_Int  threshold = blues->blue_shift;\n\n\n      while ( threshold > 0 && FT_MulFix( threshold, scale ) > 32 )\n        threshold--;\n\n      blues->blue_threshold = threshold;\n    }\n\n    for ( num = 0; num < 4; num++ )\n    {\n      PSH_Blue_Zone  zone;\n\n\n      switch ( num )\n      {\n      case 0:\n        table = &blues->normal_top;\n        break;\n      case 1:\n        table = &blues->normal_bottom;\n        break;\n      case 2:\n        table = &blues->family_top;\n        break;\n      default:\n        table = &blues->family_bottom;\n        break;\n      }\n\n      zone  = table->zones;\n      count = table->count;\n      for ( ; count > 0; count--, zone++ )\n      {\n        zone->cur_top    = FT_MulFix( zone->org_top,    scale ) + delta;\n        zone->cur_bottom = FT_MulFix( zone->org_bottom, scale ) + delta;\n        zone->cur_ref    = FT_MulFix( zone->org_ref,    scale ) + delta;\n        zone->cur_delta  = FT_MulFix( zone->org_delta,  scale );\n\n        /* round scaled reference position */\n        zone->cur_ref = FT_PIX_ROUND( zone->cur_ref );\n\n#if 0\n        if ( zone->cur_ref > zone->cur_top )\n          zone->cur_ref -= 64;\n        else if ( zone->cur_ref < zone->cur_bottom )\n          zone->cur_ref += 64;\n#endif\n      }\n    }\n\n    /* process the families now */\n\n    for ( num = 0; num < 2; num++ )\n    {\n      PSH_Blue_Zone   zone1, zone2;\n      FT_UInt         count1, count2;\n      PSH_Blue_Table  normal, family;\n\n\n      switch ( num )\n      {\n      case 0:\n        normal = &blues->normal_top;\n        family = &blues->family_top;\n        break;\n\n      default:\n        normal = &blues->normal_bottom;\n        family = &blues->family_bottom;\n      }\n\n      zone1  = normal->zones;\n      count1 = normal->count;\n\n      for ( ; count1 > 0; count1--, zone1++ )\n      {\n        /* try to find a family zone whose reference position is less */\n        /* than 1 pixel far from the current zone                     */\n        zone2  = family->zones;\n        count2 = family->count;\n\n        for ( ; count2 > 0; count2--, zone2++ )\n        {\n          FT_Pos  Delta;\n\n\n          Delta = zone1->org_ref - zone2->org_ref;\n          if ( Delta < 0 )\n            Delta = -Delta;\n\n          if ( FT_MulFix( Delta, scale ) < 64 )\n          {\n            zone1->cur_top    = zone2->cur_top;\n            zone1->cur_bottom = zone2->cur_bottom;\n            zone1->cur_ref    = zone2->cur_ref;\n            zone1->cur_delta  = zone2->cur_delta;\n            break;\n          }\n        }\n      }\n    }\n  }\n\n\n  /* calculate the maximum height of given blue zones */\n  static FT_Short\n  psh_calc_max_height( FT_UInt          num,\n                       const FT_Short*  values,\n                       FT_Short         cur_max )\n  {\n    FT_UInt  count;\n\n\n    for ( count = 0; count < num; count += 2 )\n    {\n      FT_Short  cur_height = values[count + 1] - values[count];\n\n\n      if ( cur_height > cur_max )\n        cur_max = cur_height;\n    }\n\n    return cur_max;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  psh_blues_snap_stem( PSH_Blues      blues,\n                       FT_Int         stem_top,\n                       FT_Int         stem_bot,\n                       PSH_Alignment  alignment )\n  {\n    PSH_Blue_Table  table;\n    FT_UInt         count;\n    FT_Pos          delta;\n    PSH_Blue_Zone   zone;\n    FT_Int          no_shoots;\n\n\n    alignment->align = PSH_BLUE_ALIGN_NONE;\n\n    no_shoots = blues->no_overshoots;\n\n    /* look up stem top in top zones table */\n    table = &blues->normal_top;\n    count = table->count;\n    zone  = table->zones;\n\n    for ( ; count > 0; count--, zone++ )\n    {\n      delta = stem_top - zone->org_bottom;\n      if ( delta < -blues->blue_fuzz )\n        break;\n\n      if ( stem_top <= zone->org_top + blues->blue_fuzz )\n      {\n        if ( no_shoots || delta <= blues->blue_threshold )\n        {\n          alignment->align    |= PSH_BLUE_ALIGN_TOP;\n          alignment->align_top = zone->cur_ref;\n        }\n        break;\n      }\n    }\n\n    /* look up stem bottom in bottom zones table */\n    table = &blues->normal_bottom;\n    count = table->count;\n    zone  = table->zones + count-1;\n\n    for ( ; count > 0; count--, zone-- )\n    {\n      delta = zone->org_top - stem_bot;\n      if ( delta < -blues->blue_fuzz )\n        break;\n\n      if ( stem_bot >= zone->org_bottom - blues->blue_fuzz )\n      {\n        if ( no_shoots || delta < blues->blue_threshold )\n        {\n          alignment->align    |= PSH_BLUE_ALIGN_BOT;\n          alignment->align_bot = zone->cur_ref;\n        }\n        break;\n      }\n    }\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                        GLOBAL HINTS                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static void\n  psh_globals_destroy( PSH_Globals  globals )\n  {\n    if ( globals )\n    {\n      FT_Memory  memory;\n\n\n      memory = globals->memory;\n      globals->dimension[0].stdw.count = 0;\n      globals->dimension[1].stdw.count = 0;\n\n      globals->blues.normal_top.count    = 0;\n      globals->blues.normal_bottom.count = 0;\n      globals->blues.family_top.count    = 0;\n      globals->blues.family_bottom.count = 0;\n\n      FT_FREE( globals );\n\n#ifdef DEBUG_HINTER\n      ps_debug_globals = 0;\n#endif\n    }\n  }\n\n\n  static FT_Error\n  psh_globals_new( FT_Memory     memory,\n                   T1_Private*   priv,\n                   PSH_Globals  *aglobals )\n  {\n    PSH_Globals  globals = NULL;\n    FT_Error     error;\n\n\n    if ( !FT_NEW( globals ) )\n    {\n      FT_UInt    count;\n      FT_Short*  read;\n\n\n      globals->memory = memory;\n\n      /* copy standard widths */\n      {\n        PSH_Dimension  dim   = &globals->dimension[1];\n        PSH_Width      write = dim->stdw.widths;\n\n\n        write->org = priv->standard_width[0];\n        write++;\n\n        read = priv->snap_widths;\n        for ( count = priv->num_snap_widths; count > 0; count-- )\n        {\n          write->org = *read;\n          write++;\n          read++;\n        }\n\n        dim->stdw.count = priv->num_snap_widths + 1;\n      }\n\n      /* copy standard heights */\n      {\n        PSH_Dimension  dim = &globals->dimension[0];\n        PSH_Width      write = dim->stdw.widths;\n\n\n        write->org = priv->standard_height[0];\n        write++;\n        read = priv->snap_heights;\n        for ( count = priv->num_snap_heights; count > 0; count-- )\n        {\n          write->org = *read;\n          write++;\n          read++;\n        }\n\n        dim->stdw.count = priv->num_snap_heights + 1;\n      }\n\n      /* copy blue zones */\n      psh_blues_set_zones( &globals->blues, priv->num_blue_values,\n                           priv->blue_values, priv->num_other_blues,\n                           priv->other_blues, priv->blue_fuzz, 0 );\n\n      psh_blues_set_zones( &globals->blues, priv->num_family_blues,\n                           priv->family_blues, priv->num_family_other_blues,\n                           priv->family_other_blues, priv->blue_fuzz, 1 );\n\n      /* limit the BlueScale value to `1 / max_of_blue_zone_heights' */\n      {\n        FT_Fixed  max_scale;\n        FT_Short  max_height = 1;\n\n\n        max_height = psh_calc_max_height( priv->num_blue_values,\n                                          priv->blue_values,\n                                          max_height );\n        max_height = psh_calc_max_height( priv->num_other_blues,\n                                          priv->other_blues,\n                                          max_height );\n        max_height = psh_calc_max_height( priv->num_family_blues,\n                                          priv->family_blues,\n                                          max_height );\n        max_height = psh_calc_max_height( priv->num_family_other_blues,\n                                          priv->family_other_blues,\n                                          max_height );\n\n        /* BlueScale is scaled 1000 times */\n        max_scale = FT_DivFix( 1000, max_height );\n        globals->blues.blue_scale = priv->blue_scale < max_scale\n                                      ? priv->blue_scale\n                                      : max_scale;\n      }\n\n      globals->blues.blue_shift = priv->blue_shift;\n      globals->blues.blue_fuzz  = priv->blue_fuzz;\n\n      globals->dimension[0].scale_mult  = 0;\n      globals->dimension[0].scale_delta = 0;\n      globals->dimension[1].scale_mult  = 0;\n      globals->dimension[1].scale_delta = 0;\n\n#ifdef DEBUG_HINTER\n      ps_debug_globals = globals;\n#endif\n    }\n\n    *aglobals = globals;\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  psh_globals_set_scale( PSH_Globals  globals,\n                         FT_Fixed     x_scale,\n                         FT_Fixed     y_scale,\n                         FT_Fixed     x_delta,\n                         FT_Fixed     y_delta )\n  {\n    PSH_Dimension  dim;\n\n\n    dim = &globals->dimension[0];\n    if ( x_scale != dim->scale_mult  ||\n         x_delta != dim->scale_delta )\n    {\n      dim->scale_mult  = x_scale;\n      dim->scale_delta = x_delta;\n\n      psh_globals_scale_widths( globals, 0 );\n    }\n\n    dim = &globals->dimension[1];\n    if ( y_scale != dim->scale_mult  ||\n         y_delta != dim->scale_delta )\n    {\n      dim->scale_mult  = y_scale;\n      dim->scale_delta = y_delta;\n\n      psh_globals_scale_widths( globals, 1 );\n      psh_blues_scale_zones( &globals->blues, y_scale, y_delta );\n    }\n  }\n\n\n  FT_LOCAL_DEF( void )\n  psh_globals_funcs_init( PSH_Globals_FuncsRec*  funcs )\n  {\n    funcs->create    = psh_globals_new;\n    funcs->set_scale = psh_globals_set_scale;\n    funcs->destroy   = psh_globals_destroy;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pshinter/pshglob.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pshglob.h                                                              */\n/*                                                                         */\n/*    PostScript hinter global hinting management.                         */\n/*                                                                         */\n/*  Copyright 2001, 2002, 2003, 2014 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PSHGLOB_H__\n#define __PSHGLOB_H__\n\n\n#include FT_FREETYPE_H\n#include FT_INTERNAL_POSTSCRIPT_HINTS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    GLOBAL HINTS INTERNALS                     *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* @constant:                                                            */\n  /*    PS_GLOBALS_MAX_BLUE_ZONES                                          */\n  /*                                                                       */\n  /* @description:                                                         */\n  /*    The maximum number of blue zones in a font global hints structure. */\n  /*    See @PS_Globals_BluesRec.                                          */\n  /*                                                                       */\n#define PS_GLOBALS_MAX_BLUE_ZONES  16\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* @constant:                                                            */\n  /*    PS_GLOBALS_MAX_STD_WIDTHS                                          */\n  /*                                                                       */\n  /* @description:                                                         */\n  /*    The maximum number of standard and snap widths in either the       */\n  /*    horizontal or vertical direction.  See @PS_Globals_WidthsRec.      */\n  /*                                                                       */\n#define PS_GLOBALS_MAX_STD_WIDTHS  16\n\n\n  /* standard and snap width */\n  typedef struct  PSH_WidthRec_\n  {\n    FT_Int  org;\n    FT_Pos  cur;\n    FT_Pos  fit;\n\n  } PSH_WidthRec, *PSH_Width;\n\n\n  /* standard and snap widths table */\n  typedef struct  PSH_WidthsRec_\n  {\n    FT_UInt       count;\n    PSH_WidthRec  widths[PS_GLOBALS_MAX_STD_WIDTHS];\n\n  } PSH_WidthsRec, *PSH_Widths;\n\n\n  typedef struct  PSH_DimensionRec_\n  {\n    PSH_WidthsRec  stdw;\n    FT_Fixed       scale_mult;\n    FT_Fixed       scale_delta;\n\n  } PSH_DimensionRec, *PSH_Dimension;\n\n\n  /* blue zone descriptor */\n  typedef struct  PSH_Blue_ZoneRec_\n  {\n    FT_Int  org_ref;\n    FT_Int  org_delta;\n    FT_Int  org_top;\n    FT_Int  org_bottom;\n\n    FT_Pos  cur_ref;\n    FT_Pos  cur_delta;\n    FT_Pos  cur_bottom;\n    FT_Pos  cur_top;\n\n  } PSH_Blue_ZoneRec, *PSH_Blue_Zone;\n\n\n  typedef struct  PSH_Blue_TableRec_\n  {\n    FT_UInt           count;\n    PSH_Blue_ZoneRec  zones[PS_GLOBALS_MAX_BLUE_ZONES];\n\n  } PSH_Blue_TableRec, *PSH_Blue_Table;\n\n\n  /* blue zones table */\n  typedef struct  PSH_BluesRec_\n  {\n    PSH_Blue_TableRec  normal_top;\n    PSH_Blue_TableRec  normal_bottom;\n    PSH_Blue_TableRec  family_top;\n    PSH_Blue_TableRec  family_bottom;\n\n    FT_Fixed           blue_scale;\n    FT_Int             blue_shift;\n    FT_Int             blue_threshold;\n    FT_Int             blue_fuzz;\n    FT_Bool            no_overshoots;\n\n  } PSH_BluesRec, *PSH_Blues;\n\n\n  /* font globals.                                         */\n  /* dimension 0 => X coordinates + vertical hints/stems   */\n  /* dimension 1 => Y coordinates + horizontal hints/stems */\n  typedef struct  PSH_GlobalsRec_\n  {\n    FT_Memory         memory;\n    PSH_DimensionRec  dimension[2];\n    PSH_BluesRec      blues;\n\n  } PSH_GlobalsRec;\n\n\n#define PSH_BLUE_ALIGN_NONE  0\n#define PSH_BLUE_ALIGN_TOP   1\n#define PSH_BLUE_ALIGN_BOT   2\n\n\n  typedef struct  PSH_AlignmentRec_\n  {\n    int     align;\n    FT_Pos  align_top;\n    FT_Pos  align_bot;\n\n  } PSH_AlignmentRec, *PSH_Alignment;\n\n\n  FT_LOCAL( void )\n  psh_globals_funcs_init( PSH_Globals_FuncsRec*  funcs );\n\n\n#if 0\n  /* snap a stem width to fitter coordinates.  `org_width' is in font */\n  /* units.  The result is in device pixels (26.6 format).            */\n  FT_LOCAL( FT_Pos )\n  psh_dimension_snap_width( PSH_Dimension  dimension,\n                            FT_Int         org_width );\n#endif\n\n  FT_LOCAL( void )\n  psh_globals_set_scale( PSH_Globals  globals,\n                         FT_Fixed     x_scale,\n                         FT_Fixed     y_scale,\n                         FT_Fixed     x_delta,\n                         FT_Fixed     y_delta );\n\n  /* snap a stem to one or two blue zones */\n  FT_LOCAL( void )\n  psh_blues_snap_stem( PSH_Blues      blues,\n                       FT_Int         stem_top,\n                       FT_Int         stem_bot,\n                       PSH_Alignment  alignment );\n  /* */\n\n#ifdef DEBUG_HINTER\n  extern PSH_Globals  ps_debug_globals;\n#endif\n\n\nFT_END_HEADER\n\n\n#endif /* __PSHGLOB_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pshinter/pshinter.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pshinter.c                                                             */\n/*                                                                         */\n/*    FreeType PostScript Hinting module                                   */\n/*                                                                         */\n/*  Copyright 2001, 2003 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#define FT_MAKE_OPTION_SINGLE_OBJECT\n\n#include <ft2build.h>\n#include \"pshpic.c\"\n#include \"pshrec.c\"\n#include \"pshglob.c\"\n#include \"pshalgo.c\"\n#include \"pshmod.c\"\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pshinter/pshmod.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pshmod.c                                                               */\n/*                                                                         */\n/*    FreeType PostScript hinter module implementation (body).             */\n/*                                                                         */\n/*  Copyright 2001, 2002, 2007, 2009, 2012 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n#include \"pshrec.h\"\n#include \"pshalgo.h\"\n#include \"pshpic.h\"\n\n\n  /* the Postscript Hinter module structure */\n  typedef struct  PS_Hinter_Module_Rec_\n  {\n    FT_ModuleRec          root;\n    PS_HintsRec           ps_hints;\n\n    PSH_Globals_FuncsRec  globals_funcs;\n    T1_Hints_FuncsRec     t1_funcs;\n    T2_Hints_FuncsRec     t2_funcs;\n\n  } PS_Hinter_ModuleRec, *PS_Hinter_Module;\n\n\n  /* finalize module */\n  FT_CALLBACK_DEF( void )\n  ps_hinter_done( PS_Hinter_Module  module )\n  {\n    module->t1_funcs.hints = NULL;\n    module->t2_funcs.hints = NULL;\n\n    ps_hints_done( &module->ps_hints );\n  }\n\n\n  /* initialize module, create hints recorder and the interface */\n  FT_CALLBACK_DEF( FT_Error )\n  ps_hinter_init( PS_Hinter_Module  module )\n  {\n    FT_Memory  memory = module->root.memory;\n    void*      ph     = &module->ps_hints;\n\n\n    ps_hints_init( &module->ps_hints, memory );\n\n    psh_globals_funcs_init( &module->globals_funcs );\n\n    t1_hints_funcs_init( &module->t1_funcs );\n    module->t1_funcs.hints = (T1_Hints)ph;\n\n    t2_hints_funcs_init( &module->t2_funcs );\n    module->t2_funcs.hints = (T2_Hints)ph;\n\n    return 0;\n  }\n\n\n  /* returns global hints interface */\n  FT_CALLBACK_DEF( PSH_Globals_Funcs )\n  pshinter_get_globals_funcs( FT_Module  module )\n  {\n    return &((PS_Hinter_Module)module)->globals_funcs;\n  }\n\n\n  /* return Type 1 hints interface */\n  FT_CALLBACK_DEF( T1_Hints_Funcs )\n  pshinter_get_t1_funcs( FT_Module  module )\n  {\n    return &((PS_Hinter_Module)module)->t1_funcs;\n  }\n\n\n  /* return Type 2 hints interface */\n  FT_CALLBACK_DEF( T2_Hints_Funcs )\n  pshinter_get_t2_funcs( FT_Module  module )\n  {\n    return &((PS_Hinter_Module)module)->t2_funcs;\n  }\n\n\n  FT_DEFINE_PSHINTER_INTERFACE(\n    pshinter_interface,\n    pshinter_get_globals_funcs,\n    pshinter_get_t1_funcs,\n    pshinter_get_t2_funcs )\n\n\n  FT_DEFINE_MODULE(\n    pshinter_module_class,\n\n    0,\n    sizeof ( PS_Hinter_ModuleRec ),\n    \"pshinter\",\n    0x10000L,\n    0x20000L,\n\n    &PSHINTER_INTERFACE_GET,              /* module-specific interface */\n\n    (FT_Module_Constructor)ps_hinter_init,\n    (FT_Module_Destructor) ps_hinter_done,\n    (FT_Module_Requester)  NULL )   /* no additional interface for now */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pshinter/pshmod.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pshmod.h                                                               */\n/*                                                                         */\n/*    PostScript hinter module interface (specification).                  */\n/*                                                                         */\n/*  Copyright 2001 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PSHMOD_H__\n#define __PSHMOD_H__\n\n\n#include <ft2build.h>\n#include FT_MODULE_H\n\n\nFT_BEGIN_HEADER\n\n\n  FT_DECLARE_MODULE( pshinter_module_class )\n\n\nFT_END_HEADER\n\n\n#endif /* __PSHMOD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pshinter/pshnterr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pshnterr.h                                                             */\n/*                                                                         */\n/*    PS Hinter error codes (specification only).                          */\n/*                                                                         */\n/*  Copyright 2003, 2012 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the PSHinter error enumeration constants. */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __PSHNTERR_H__\n#define __PSHNTERR_H__\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  PSH_Err_\n#define FT_ERR_BASE    FT_Mod_Err_PShinter\n\n#include FT_ERRORS_H\n\n#endif /* __PSHNTERR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pshinter/pshpic.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pshpic.c                                                               */\n/*                                                                         */\n/*    The FreeType position independent code services for pshinter module. */\n/*                                                                         */\n/*  Copyright 2009, 2010, 2012, 2013 by                                    */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_INTERNAL_OBJECTS_H\n#include \"pshpic.h\"\n#include \"pshnterr.h\"\n\n\n#ifdef FT_CONFIG_OPTION_PIC\n\n  /* forward declaration of PIC init functions from pshmod.c */\n  void\n  FT_Init_Class_pshinter_interface( FT_Library           library,\n                                    PSHinter_Interface*  clazz );\n\n  void\n  pshinter_module_class_pic_free( FT_Library  library )\n  {\n    FT_PIC_Container*  pic_container = &library->pic_container;\n    FT_Memory          memory        = library->memory;\n\n\n    if ( pic_container->pshinter )\n    {\n      FT_FREE( pic_container->pshinter );\n      pic_container->pshinter = NULL;\n    }\n  }\n\n\n  FT_Error\n  pshinter_module_class_pic_init( FT_Library  library )\n  {\n    FT_PIC_Container*  pic_container = &library->pic_container;\n    FT_Error           error         = FT_Err_Ok;\n    PSHinterPIC*       container     = NULL;\n    FT_Memory          memory        = library->memory;\n\n\n    /* allocate pointer, clear and set global container pointer */\n    if ( FT_ALLOC( container, sizeof ( *container ) ) )\n      return error;\n    FT_MEM_SET( container, 0, sizeof ( *container ) );\n    pic_container->pshinter = container;\n\n    /* add call to initialization function when you add new scripts */\n    FT_Init_Class_pshinter_interface(\n      library, &container->pshinter_interface );\n\n    if ( error )\n      pshinter_module_class_pic_free( library );\n\n    return error;\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pshinter/pshpic.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pshpic.h                                                               */\n/*                                                                         */\n/*    The FreeType position independent code services for pshinter module. */\n/*                                                                         */\n/*  Copyright 2009, 2012, 2013 by                                          */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PSHPIC_H__\n#define __PSHPIC_H__\n\n\nFT_BEGIN_HEADER\n\n#include FT_INTERNAL_PIC_H\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define PSHINTER_INTERFACE_GET  pshinter_interface\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#include FT_INTERNAL_POSTSCRIPT_HINTS_H\n\n  typedef struct  PSHinterPIC_\n  {\n    PSHinter_Interface  pshinter_interface;\n\n  } PSHinterPIC;\n\n\n#define GET_PIC( lib )  ( (PSHinterPIC*)( (lib)->pic_container.pshinter ) )\n\n#define PSHINTER_INTERFACE_GET  ( GET_PIC( library )->pshinter_interface )\n\n  /* see pshpic.c for the implementation */\n  void\n  pshinter_module_class_pic_free( FT_Library  library );\n\n  FT_Error\n  pshinter_module_class_pic_init( FT_Library  library );\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __PSHPIC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pshinter/pshrec.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pshrec.c                                                               */\n/*                                                                         */\n/*    FreeType PostScript hints recorder (body).                           */\n/*                                                                         */\n/*  Copyright 2001-2004, 2007, 2009, 2013, 2014 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_CALC_H\n\n#include \"pshrec.h\"\n#include \"pshalgo.h\"\n\n#include \"pshnterr.h\"\n\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_pshrec\n\n#ifdef DEBUG_HINTER\n  PS_Hints  ps_debug_hints         = 0;\n  int       ps_debug_no_horz_hints = 0;\n  int       ps_debug_no_vert_hints = 0;\n#endif\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      PS_HINT MANAGEMENT                       *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* destroy hints table */\n  static void\n  ps_hint_table_done( PS_Hint_Table  table,\n                      FT_Memory      memory )\n  {\n    FT_FREE( table->hints );\n    table->num_hints = 0;\n    table->max_hints = 0;\n  }\n\n\n  /* ensure that a table can contain \"count\" elements */\n  static FT_Error\n  ps_hint_table_ensure( PS_Hint_Table  table,\n                        FT_UInt        count,\n                        FT_Memory      memory )\n  {\n    FT_UInt   old_max = table->max_hints;\n    FT_UInt   new_max = count;\n    FT_Error  error   = FT_Err_Ok;\n\n\n    if ( new_max > old_max )\n    {\n      /* try to grow the table */\n      new_max = FT_PAD_CEIL( new_max, 8 );\n      if ( !FT_RENEW_ARRAY( table->hints, old_max, new_max ) )\n        table->max_hints = new_max;\n    }\n    return error;\n  }\n\n\n  static FT_Error\n  ps_hint_table_alloc( PS_Hint_Table  table,\n                       FT_Memory      memory,\n                       PS_Hint       *ahint )\n  {\n    FT_Error  error = FT_Err_Ok;\n    FT_UInt   count;\n    PS_Hint   hint = 0;\n\n\n    count = table->num_hints;\n    count++;\n\n    if ( count >= table->max_hints )\n    {\n      error = ps_hint_table_ensure( table, count, memory );\n      if ( error )\n        goto Exit;\n    }\n\n    hint        = table->hints + count - 1;\n    hint->pos   = 0;\n    hint->len   = 0;\n    hint->flags = 0;\n\n    table->num_hints = count;\n\n  Exit:\n    *ahint = hint;\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      PS_MASK MANAGEMENT                       *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* destroy mask */\n  static void\n  ps_mask_done( PS_Mask    mask,\n                FT_Memory  memory )\n  {\n    FT_FREE( mask->bytes );\n    mask->num_bits  = 0;\n    mask->max_bits  = 0;\n    mask->end_point = 0;\n  }\n\n\n  /* ensure that a mask can contain \"count\" bits */\n  static FT_Error\n  ps_mask_ensure( PS_Mask    mask,\n                  FT_UInt    count,\n                  FT_Memory  memory )\n  {\n    FT_UInt   old_max = ( mask->max_bits + 7 ) >> 3;\n    FT_UInt   new_max = ( count          + 7 ) >> 3;\n    FT_Error  error   = FT_Err_Ok;\n\n\n    if ( new_max > old_max )\n    {\n      new_max = FT_PAD_CEIL( new_max, 8 );\n      if ( !FT_RENEW_ARRAY( mask->bytes, old_max, new_max ) )\n        mask->max_bits = new_max * 8;\n    }\n    return error;\n  }\n\n\n  /* test a bit value in a given mask */\n  static FT_Int\n  ps_mask_test_bit( PS_Mask  mask,\n                    FT_Int   idx )\n  {\n    if ( (FT_UInt)idx >= mask->num_bits )\n      return 0;\n\n    return mask->bytes[idx >> 3] & ( 0x80 >> ( idx & 7 ) );\n  }\n\n\n  /* clear a given bit */\n  static void\n  ps_mask_clear_bit( PS_Mask  mask,\n                     FT_Int   idx )\n  {\n    FT_Byte*  p;\n\n\n    if ( (FT_UInt)idx >= mask->num_bits )\n      return;\n\n    p    = mask->bytes + ( idx >> 3 );\n    p[0] = (FT_Byte)( p[0] & ~( 0x80 >> ( idx & 7 ) ) );\n  }\n\n\n  /* set a given bit, possibly grow the mask */\n  static FT_Error\n  ps_mask_set_bit( PS_Mask    mask,\n                   FT_Int     idx,\n                   FT_Memory  memory )\n  {\n    FT_Error  error = FT_Err_Ok;\n    FT_Byte*  p;\n\n\n    if ( idx < 0 )\n      goto Exit;\n\n    if ( (FT_UInt)idx >= mask->num_bits )\n    {\n      error = ps_mask_ensure( mask, idx + 1, memory );\n      if ( error )\n        goto Exit;\n\n      mask->num_bits = idx + 1;\n    }\n\n    p    = mask->bytes + ( idx >> 3 );\n    p[0] = (FT_Byte)( p[0] | ( 0x80 >> ( idx & 7 ) ) );\n\n  Exit:\n    return error;\n  }\n\n\n  /* destroy mask table */\n  static void\n  ps_mask_table_done( PS_Mask_Table  table,\n                      FT_Memory      memory )\n  {\n    FT_UInt  count = table->max_masks;\n    PS_Mask  mask  = table->masks;\n\n\n    for ( ; count > 0; count--, mask++ )\n      ps_mask_done( mask, memory );\n\n    FT_FREE( table->masks );\n    table->num_masks = 0;\n    table->max_masks = 0;\n  }\n\n\n  /* ensure that a mask table can contain \"count\" masks */\n  static FT_Error\n  ps_mask_table_ensure( PS_Mask_Table  table,\n                        FT_UInt        count,\n                        FT_Memory      memory )\n  {\n    FT_UInt   old_max = table->max_masks;\n    FT_UInt   new_max = count;\n    FT_Error  error   = FT_Err_Ok;\n\n\n    if ( new_max > old_max )\n    {\n      new_max = FT_PAD_CEIL( new_max, 8 );\n      if ( !FT_RENEW_ARRAY( table->masks, old_max, new_max ) )\n        table->max_masks = new_max;\n    }\n    return error;\n  }\n\n\n  /* allocate a new mask in a table */\n  static FT_Error\n  ps_mask_table_alloc( PS_Mask_Table  table,\n                       FT_Memory      memory,\n                       PS_Mask       *amask )\n  {\n    FT_UInt   count;\n    FT_Error  error = FT_Err_Ok;\n    PS_Mask   mask  = 0;\n\n\n    count = table->num_masks;\n    count++;\n\n    if ( count > table->max_masks )\n    {\n      error = ps_mask_table_ensure( table, count, memory );\n      if ( error )\n        goto Exit;\n    }\n\n    mask             = table->masks + count - 1;\n    mask->num_bits   = 0;\n    mask->end_point  = 0;\n    table->num_masks = count;\n\n  Exit:\n    *amask = mask;\n    return error;\n  }\n\n\n  /* return last hint mask in a table, create one if the table is empty */\n  static FT_Error\n  ps_mask_table_last( PS_Mask_Table  table,\n                      FT_Memory      memory,\n                      PS_Mask       *amask )\n  {\n    FT_Error  error = FT_Err_Ok;\n    FT_UInt   count;\n    PS_Mask   mask;\n\n\n    count = table->num_masks;\n    if ( count == 0 )\n    {\n      error = ps_mask_table_alloc( table, memory, &mask );\n      if ( error )\n        goto Exit;\n    }\n    else\n      mask = table->masks + count - 1;\n\n  Exit:\n    *amask = mask;\n    return error;\n  }\n\n\n  /* set a new mask to a given bit range */\n  static FT_Error\n  ps_mask_table_set_bits( PS_Mask_Table   table,\n                          const FT_Byte*  source,\n                          FT_UInt         bit_pos,\n                          FT_UInt         bit_count,\n                          FT_Memory       memory )\n  {\n    FT_Error  error;\n    PS_Mask   mask;\n\n\n    error = ps_mask_table_last( table, memory, &mask );\n    if ( error )\n      goto Exit;\n\n    error = ps_mask_ensure( mask, bit_count, memory );\n    if ( error )\n      goto Exit;\n\n    mask->num_bits = bit_count;\n\n    /* now, copy bits */\n    {\n      FT_Byte*  read  = (FT_Byte*)source + ( bit_pos >> 3 );\n      FT_Int    rmask = 0x80 >> ( bit_pos & 7 );\n      FT_Byte*  write = mask->bytes;\n      FT_Int    wmask = 0x80;\n      FT_Int    val;\n\n\n      for ( ; bit_count > 0; bit_count-- )\n      {\n        val = write[0] & ~wmask;\n\n        if ( read[0] & rmask )\n          val |= wmask;\n\n        write[0] = (FT_Byte)val;\n\n        rmask >>= 1;\n        if ( rmask == 0 )\n        {\n          read++;\n          rmask = 0x80;\n        }\n\n        wmask >>= 1;\n        if ( wmask == 0 )\n        {\n          write++;\n          wmask = 0x80;\n        }\n      }\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /* test whether two masks in a table intersect */\n  static FT_Int\n  ps_mask_table_test_intersect( PS_Mask_Table  table,\n                                FT_Int         index1,\n                                FT_Int         index2 )\n  {\n    PS_Mask   mask1  = table->masks + index1;\n    PS_Mask   mask2  = table->masks + index2;\n    FT_Byte*  p1     = mask1->bytes;\n    FT_Byte*  p2     = mask2->bytes;\n    FT_UInt   count1 = mask1->num_bits;\n    FT_UInt   count2 = mask2->num_bits;\n    FT_UInt   count;\n\n\n    count = FT_MIN( count1, count2 );\n    for ( ; count >= 8; count -= 8 )\n    {\n      if ( p1[0] & p2[0] )\n        return 1;\n\n      p1++;\n      p2++;\n    }\n\n    if ( count == 0 )\n      return 0;\n\n    return ( p1[0] & p2[0] ) & ~( 0xFF >> count );\n  }\n\n\n  /* merge two masks, used by ps_mask_table_merge_all */\n  static FT_Error\n  ps_mask_table_merge( PS_Mask_Table  table,\n                       FT_Int         index1,\n                       FT_Int         index2,\n                       FT_Memory      memory )\n  {\n    FT_UInt   temp;\n    FT_Error  error = FT_Err_Ok;\n\n\n    /* swap index1 and index2 so that index1 < index2 */\n    if ( index1 > index2 )\n    {\n      temp   = index1;\n      index1 = index2;\n      index2 = temp;\n    }\n\n    if ( index1 < index2 && index1 >= 0 && index2 < (FT_Int)table->num_masks )\n    {\n      /* we need to merge the bitsets of index1 and index2 with a */\n      /* simple union                                             */\n      PS_Mask  mask1  = table->masks + index1;\n      PS_Mask  mask2  = table->masks + index2;\n      FT_UInt  count1 = mask1->num_bits;\n      FT_UInt  count2 = mask2->num_bits;\n      FT_Int   delta;\n\n\n      if ( count2 > 0 )\n      {\n        FT_UInt   pos;\n        FT_Byte*  read;\n        FT_Byte*  write;\n\n\n        /* if \"count2\" is greater than \"count1\", we need to grow the */\n        /* first bitset, and clear the highest bits                  */\n        if ( count2 > count1 )\n        {\n          error = ps_mask_ensure( mask1, count2, memory );\n          if ( error )\n            goto Exit;\n\n          for ( pos = count1; pos < count2; pos++ )\n            ps_mask_clear_bit( mask1, pos );\n        }\n\n        /* merge (unite) the bitsets */\n        read  = mask2->bytes;\n        write = mask1->bytes;\n        pos   = (FT_UInt)( ( count2 + 7 ) >> 3 );\n\n        for ( ; pos > 0; pos-- )\n        {\n          write[0] = (FT_Byte)( write[0] | read[0] );\n          write++;\n          read++;\n        }\n      }\n\n      /* Now, remove \"mask2\" from the list.  We need to keep the masks */\n      /* sorted in order of importance, so move table elements.        */\n      mask2->num_bits  = 0;\n      mask2->end_point = 0;\n\n      delta = table->num_masks - 1 - index2; /* number of masks to move */\n      if ( delta > 0 )\n      {\n        /* move to end of table for reuse */\n        PS_MaskRec  dummy = *mask2;\n\n\n        ft_memmove( mask2, mask2 + 1, delta * sizeof ( PS_MaskRec ) );\n\n        mask2[delta] = dummy;\n      }\n\n      table->num_masks--;\n    }\n    else\n      FT_TRACE0(( \"ps_mask_table_merge: ignoring invalid indices (%d,%d)\\n\",\n                  index1, index2 ));\n\n  Exit:\n    return error;\n  }\n\n\n  /* Try to merge all masks in a given table.  This is used to merge */\n  /* all counter masks into independent counter \"paths\".             */\n  /*                                                                 */\n  static FT_Error\n  ps_mask_table_merge_all( PS_Mask_Table  table,\n                           FT_Memory      memory )\n  {\n    FT_Int    index1, index2;\n    FT_Error  error = FT_Err_Ok;\n\n\n    for ( index1 = table->num_masks - 1; index1 > 0; index1-- )\n    {\n      for ( index2 = index1 - 1; index2 >= 0; index2-- )\n      {\n        if ( ps_mask_table_test_intersect( table, index1, index2 ) )\n        {\n          error = ps_mask_table_merge( table, index2, index1, memory );\n          if ( error )\n            goto Exit;\n\n          break;\n        }\n      }\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    PS_DIMENSION MANAGEMENT                    *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* finalize a given dimension */\n  static void\n  ps_dimension_done( PS_Dimension  dimension,\n                     FT_Memory     memory )\n  {\n    ps_mask_table_done( &dimension->counters, memory );\n    ps_mask_table_done( &dimension->masks,    memory );\n    ps_hint_table_done( &dimension->hints,    memory );\n  }\n\n\n  /* initialize a given dimension */\n  static void\n  ps_dimension_init( PS_Dimension  dimension )\n  {\n    dimension->hints.num_hints    = 0;\n    dimension->masks.num_masks    = 0;\n    dimension->counters.num_masks = 0;\n  }\n\n\n#if 0\n\n  /* set a bit at a given index in the current hint mask */\n  static FT_Error\n  ps_dimension_set_mask_bit( PS_Dimension  dim,\n                             FT_UInt       idx,\n                             FT_Memory     memory )\n  {\n    PS_Mask   mask;\n    FT_Error  error = FT_Err_Ok;\n\n\n    /* get last hint mask */\n    error = ps_mask_table_last( &dim->masks, memory, &mask );\n    if ( error )\n      goto Exit;\n\n    error = ps_mask_set_bit( mask, idx, memory );\n\n  Exit:\n    return error;\n  }\n\n#endif\n\n  /* set the end point in a mask, called from \"End\" & \"Reset\" methods */\n  static void\n  ps_dimension_end_mask( PS_Dimension  dim,\n                         FT_UInt       end_point )\n  {\n    FT_UInt  count = dim->masks.num_masks;\n\n\n    if ( count > 0 )\n    {\n      PS_Mask  mask = dim->masks.masks + count - 1;\n\n\n      mask->end_point = end_point;\n    }\n  }\n\n\n  /* set the end point in the current mask, then create a new empty one */\n  /* (called by \"Reset\" method)                                         */\n  static FT_Error\n  ps_dimension_reset_mask( PS_Dimension  dim,\n                           FT_UInt       end_point,\n                           FT_Memory     memory )\n  {\n    PS_Mask  mask;\n\n\n    /* end current mask */\n    ps_dimension_end_mask( dim, end_point );\n\n    /* allocate new one */\n    return ps_mask_table_alloc( &dim->masks, memory, &mask );\n  }\n\n\n  /* set a new mask, called from the \"T2Stem\" method */\n  static FT_Error\n  ps_dimension_set_mask_bits( PS_Dimension    dim,\n                              const FT_Byte*  source,\n                              FT_UInt         source_pos,\n                              FT_UInt         source_bits,\n                              FT_UInt         end_point,\n                              FT_Memory       memory )\n  {\n    FT_Error  error;\n\n\n    /* reset current mask, if any */\n    error = ps_dimension_reset_mask( dim, end_point, memory );\n    if ( error )\n      goto Exit;\n\n    /* set bits in new mask */\n    error = ps_mask_table_set_bits( &dim->masks, source,\n                                    source_pos, source_bits, memory );\n\n  Exit:\n    return error;\n  }\n\n\n  /* add a new single stem (called from \"T1Stem\" method) */\n  static FT_Error\n  ps_dimension_add_t1stem( PS_Dimension  dim,\n                           FT_Int        pos,\n                           FT_Int        len,\n                           FT_Memory     memory,\n                           FT_Int       *aindex )\n  {\n    FT_Error  error = FT_Err_Ok;\n    FT_UInt   flags = 0;\n\n\n    /* detect ghost stem */\n    if ( len < 0 )\n    {\n      flags |= PS_HINT_FLAG_GHOST;\n      if ( len == -21 )\n      {\n        flags |= PS_HINT_FLAG_BOTTOM;\n        pos   += len;\n      }\n      len = 0;\n    }\n\n    if ( aindex )\n      *aindex = -1;\n\n    /* now, lookup stem in the current hints table */\n    {\n      PS_Mask  mask;\n      FT_UInt  idx;\n      FT_UInt  max   = dim->hints.num_hints;\n      PS_Hint  hint  = dim->hints.hints;\n\n\n      for ( idx = 0; idx < max; idx++, hint++ )\n      {\n        if ( hint->pos == pos && hint->len == len )\n          break;\n      }\n\n      /* we need to create a new hint in the table */\n      if ( idx >= max )\n      {\n        error = ps_hint_table_alloc( &dim->hints, memory, &hint );\n        if ( error )\n          goto Exit;\n\n        hint->pos   = pos;\n        hint->len   = len;\n        hint->flags = flags;\n      }\n\n      /* now, store the hint in the current mask */\n      error = ps_mask_table_last( &dim->masks, memory, &mask );\n      if ( error )\n        goto Exit;\n\n      error = ps_mask_set_bit( mask, idx, memory );\n      if ( error )\n        goto Exit;\n\n      if ( aindex )\n        *aindex = (FT_Int)idx;\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /* add a \"hstem3/vstem3\" counter to our dimension table */\n  static FT_Error\n  ps_dimension_add_counter( PS_Dimension  dim,\n                            FT_Int        hint1,\n                            FT_Int        hint2,\n                            FT_Int        hint3,\n                            FT_Memory     memory )\n  {\n    FT_Error  error   = FT_Err_Ok;\n    FT_UInt   count   = dim->counters.num_masks;\n    PS_Mask   counter = dim->counters.masks;\n\n\n    /* try to find an existing counter mask that already uses */\n    /* one of these stems here                                */\n    for ( ; count > 0; count--, counter++ )\n    {\n      if ( ps_mask_test_bit( counter, hint1 ) ||\n           ps_mask_test_bit( counter, hint2 ) ||\n           ps_mask_test_bit( counter, hint3 ) )\n        break;\n    }\n\n    /* create a new counter when needed */\n    if ( count == 0 )\n    {\n      error = ps_mask_table_alloc( &dim->counters, memory, &counter );\n      if ( error )\n        goto Exit;\n    }\n\n    /* now, set the bits for our hints in the counter mask */\n    error = ps_mask_set_bit( counter, hint1, memory );\n    if ( error )\n      goto Exit;\n\n    error = ps_mask_set_bit( counter, hint2, memory );\n    if ( error )\n      goto Exit;\n\n    error = ps_mask_set_bit( counter, hint3, memory );\n    if ( error )\n      goto Exit;\n\n  Exit:\n    return error;\n  }\n\n\n  /* end of recording session for a given dimension */\n  static FT_Error\n  ps_dimension_end( PS_Dimension  dim,\n                    FT_UInt       end_point,\n                    FT_Memory     memory )\n  {\n    /* end hint mask table */\n    ps_dimension_end_mask( dim, end_point );\n\n    /* merge all counter masks into independent \"paths\" */\n    return ps_mask_table_merge_all( &dim->counters, memory );\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    PS_RECORDER MANAGEMENT                     *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* destroy hints */\n  FT_LOCAL( void )\n  ps_hints_done( PS_Hints  hints )\n  {\n    FT_Memory  memory = hints->memory;\n\n\n    ps_dimension_done( &hints->dimension[0], memory );\n    ps_dimension_done( &hints->dimension[1], memory );\n\n    hints->error  = FT_Err_Ok;\n    hints->memory = 0;\n  }\n\n\n  FT_LOCAL( void )\n  ps_hints_init( PS_Hints   hints,\n                 FT_Memory  memory )\n  {\n    FT_MEM_ZERO( hints, sizeof ( *hints ) );\n    hints->memory = memory;\n  }\n\n\n  /* initialize a hints for a new session */\n  static void\n  ps_hints_open( PS_Hints      hints,\n                 PS_Hint_Type  hint_type )\n  {\n    switch ( hint_type )\n    {\n    case PS_HINT_TYPE_1:\n    case PS_HINT_TYPE_2:\n      hints->error     = FT_Err_Ok;\n      hints->hint_type = hint_type;\n\n      ps_dimension_init( &hints->dimension[0] );\n      ps_dimension_init( &hints->dimension[1] );\n      break;\n\n    default:\n      hints->error     = FT_THROW( Invalid_Argument );\n      hints->hint_type = hint_type;\n\n      FT_TRACE0(( \"ps_hints_open: invalid charstring type\\n\" ));\n      break;\n    }\n  }\n\n\n  /* add one or more stems to the current hints table */\n  static void\n  ps_hints_stem( PS_Hints  hints,\n                 FT_Int    dimension,\n                 FT_UInt   count,\n                 FT_Long*  stems )\n  {\n    if ( !hints->error )\n    {\n      /* limit \"dimension\" to 0..1 */\n      if ( dimension < 0 || dimension > 1 )\n      {\n        FT_TRACE0(( \"ps_hints_stem: invalid dimension (%d) used\\n\",\n                    dimension ));\n        dimension = ( dimension != 0 );\n      }\n\n      /* record the stems in the current hints/masks table */\n      switch ( hints->hint_type )\n      {\n      case PS_HINT_TYPE_1:  /* Type 1 \"hstem\" or \"vstem\" operator */\n      case PS_HINT_TYPE_2:  /* Type 2 \"hstem\" or \"vstem\" operator */\n        {\n          PS_Dimension  dim = &hints->dimension[dimension];\n\n\n          for ( ; count > 0; count--, stems += 2 )\n          {\n            FT_Error   error;\n            FT_Memory  memory = hints->memory;\n\n\n            error = ps_dimension_add_t1stem(\n                      dim, (FT_Int)stems[0], (FT_Int)stems[1],\n                      memory, NULL );\n            if ( error )\n            {\n              FT_ERROR(( \"ps_hints_stem: could not add stem\"\n                         \" (%d,%d) to hints table\\n\", stems[0], stems[1] ));\n\n              hints->error = error;\n              return;\n            }\n          }\n          break;\n        }\n\n      default:\n        FT_TRACE0(( \"ps_hints_stem: called with invalid hint type (%d)\\n\",\n                    hints->hint_type ));\n        break;\n      }\n    }\n  }\n\n\n  /* add one Type1 counter stem to the current hints table */\n  static void\n  ps_hints_t1stem3( PS_Hints   hints,\n                    FT_Int     dimension,\n                    FT_Fixed*  stems )\n  {\n    FT_Error  error = FT_Err_Ok;\n\n\n    if ( !hints->error )\n    {\n      PS_Dimension  dim;\n      FT_Memory     memory = hints->memory;\n      FT_Int        count;\n      FT_Int        idx[3];\n\n\n      /* limit \"dimension\" to 0..1 */\n      if ( dimension < 0 || dimension > 1 )\n      {\n        FT_TRACE0(( \"ps_hints_t1stem3: invalid dimension (%d) used\\n\",\n                    dimension ));\n        dimension = ( dimension != 0 );\n      }\n\n      dim = &hints->dimension[dimension];\n\n      /* there must be 6 elements in the 'stem' array */\n      if ( hints->hint_type == PS_HINT_TYPE_1 )\n      {\n        /* add the three stems to our hints/masks table */\n        for ( count = 0; count < 3; count++, stems += 2 )\n        {\n          error = ps_dimension_add_t1stem( dim,\n                                           (FT_Int)FIXED_TO_INT( stems[0] ),\n                                           (FT_Int)FIXED_TO_INT( stems[1] ),\n                                           memory, &idx[count] );\n          if ( error )\n            goto Fail;\n        }\n\n        /* now, add the hints to the counters table */\n        error = ps_dimension_add_counter( dim, idx[0], idx[1], idx[2],\n                                          memory );\n        if ( error )\n          goto Fail;\n      }\n      else\n      {\n        FT_ERROR(( \"ps_hints_t1stem3: called with invalid hint type\\n\" ));\n        error = FT_THROW( Invalid_Argument );\n        goto Fail;\n      }\n    }\n\n    return;\n\n  Fail:\n    FT_ERROR(( \"ps_hints_t1stem3: could not add counter stems to table\\n\" ));\n    hints->error = error;\n  }\n\n\n  /* reset hints (only with Type 1 hints) */\n  static void\n  ps_hints_t1reset( PS_Hints  hints,\n                    FT_UInt   end_point )\n  {\n    FT_Error  error = FT_Err_Ok;\n\n\n    if ( !hints->error )\n    {\n      FT_Memory  memory = hints->memory;\n\n\n      if ( hints->hint_type == PS_HINT_TYPE_1 )\n      {\n        error = ps_dimension_reset_mask( &hints->dimension[0],\n                                         end_point, memory );\n        if ( error )\n          goto Fail;\n\n        error = ps_dimension_reset_mask( &hints->dimension[1],\n                                         end_point, memory );\n        if ( error )\n          goto Fail;\n      }\n      else\n      {\n        /* invalid hint type */\n        error = FT_THROW( Invalid_Argument );\n        goto Fail;\n      }\n    }\n    return;\n\n  Fail:\n    hints->error = error;\n  }\n\n\n  /* Type2 \"hintmask\" operator, add a new hintmask to each direction */\n  static void\n  ps_hints_t2mask( PS_Hints        hints,\n                   FT_UInt         end_point,\n                   FT_UInt         bit_count,\n                   const FT_Byte*  bytes )\n  {\n    FT_Error  error;\n\n\n    if ( !hints->error )\n    {\n      PS_Dimension  dim    = hints->dimension;\n      FT_Memory     memory = hints->memory;\n      FT_UInt       count1 = dim[0].hints.num_hints;\n      FT_UInt       count2 = dim[1].hints.num_hints;\n\n\n      /* check bit count; must be equal to current total hint count */\n      if ( bit_count !=  count1 + count2 )\n      {\n        FT_TRACE0(( \"ps_hints_t2mask:\"\n                    \" called with invalid bitcount %d (instead of %d)\\n\",\n                   bit_count, count1 + count2 ));\n\n        /* simply ignore the operator */\n        return;\n      }\n\n      /* set-up new horizontal and vertical hint mask now */\n      error = ps_dimension_set_mask_bits( &dim[0], bytes, count2, count1,\n                                          end_point, memory );\n      if ( error )\n        goto Fail;\n\n      error = ps_dimension_set_mask_bits( &dim[1], bytes, 0, count2,\n                                          end_point, memory );\n      if ( error )\n        goto Fail;\n    }\n    return;\n\n  Fail:\n    hints->error = error;\n  }\n\n\n  static void\n  ps_hints_t2counter( PS_Hints        hints,\n                      FT_UInt         bit_count,\n                      const FT_Byte*  bytes )\n  {\n    FT_Error  error;\n\n\n    if ( !hints->error )\n    {\n      PS_Dimension  dim    = hints->dimension;\n      FT_Memory     memory = hints->memory;\n      FT_UInt       count1 = dim[0].hints.num_hints;\n      FT_UInt       count2 = dim[1].hints.num_hints;\n\n\n      /* check bit count, must be equal to current total hint count */\n      if ( bit_count !=  count1 + count2 )\n      {\n        FT_TRACE0(( \"ps_hints_t2counter:\"\n                    \" called with invalid bitcount %d (instead of %d)\\n\",\n                   bit_count, count1 + count2 ));\n\n        /* simply ignore the operator */\n        return;\n      }\n\n      /* set-up new horizontal and vertical hint mask now */\n      error = ps_dimension_set_mask_bits( &dim[0], bytes, 0, count1,\n                                          0, memory );\n      if ( error )\n        goto Fail;\n\n      error = ps_dimension_set_mask_bits( &dim[1], bytes, count1, count2,\n                                          0, memory );\n      if ( error )\n        goto Fail;\n    }\n    return;\n\n  Fail:\n    hints->error = error;\n  }\n\n\n  /* end recording session */\n  static FT_Error\n  ps_hints_close( PS_Hints  hints,\n                  FT_UInt   end_point )\n  {\n    FT_Error  error;\n\n\n    error = hints->error;\n    if ( !error )\n    {\n      FT_Memory     memory = hints->memory;\n      PS_Dimension  dim    = hints->dimension;\n\n\n      error = ps_dimension_end( &dim[0], end_point, memory );\n      if ( !error )\n      {\n        error = ps_dimension_end( &dim[1], end_point, memory );\n      }\n    }\n\n#ifdef DEBUG_HINTER\n    if ( !error )\n      ps_debug_hints = hints;\n#endif\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                TYPE 1 HINTS RECORDING INTERFACE               *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static void\n  t1_hints_open( T1_Hints  hints )\n  {\n    ps_hints_open( (PS_Hints)hints, PS_HINT_TYPE_1 );\n  }\n\n  static void\n  t1_hints_stem( T1_Hints   hints,\n                 FT_Int     dimension,\n                 FT_Fixed*  coords )\n  {\n    FT_Pos  stems[2];\n\n\n    stems[0] = FIXED_TO_INT( coords[0] );\n    stems[1] = FIXED_TO_INT( coords[1] );\n\n    ps_hints_stem( (PS_Hints)hints, dimension, 1, stems );\n  }\n\n\n  FT_LOCAL_DEF( void )\n  t1_hints_funcs_init( T1_Hints_FuncsRec*  funcs )\n  {\n    FT_MEM_ZERO( (char*)funcs, sizeof ( *funcs ) );\n\n    funcs->open  = (T1_Hints_OpenFunc)    t1_hints_open;\n    funcs->close = (T1_Hints_CloseFunc)   ps_hints_close;\n    funcs->stem  = (T1_Hints_SetStemFunc) t1_hints_stem;\n    funcs->stem3 = (T1_Hints_SetStem3Func)ps_hints_t1stem3;\n    funcs->reset = (T1_Hints_ResetFunc)   ps_hints_t1reset;\n    funcs->apply = (T1_Hints_ApplyFunc)   ps_hints_apply;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                TYPE 2 HINTS RECORDING INTERFACE               *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static void\n  t2_hints_open( T2_Hints  hints )\n  {\n    ps_hints_open( (PS_Hints)hints, PS_HINT_TYPE_2 );\n  }\n\n\n  static void\n  t2_hints_stems( T2_Hints   hints,\n                  FT_Int     dimension,\n                  FT_Int     count,\n                  FT_Fixed*  coords )\n  {\n    FT_Pos  stems[32], y, n;\n    FT_Int  total = count;\n\n\n    y = 0;\n    while ( total > 0 )\n    {\n      /* determine number of stems to write */\n      count = total;\n      if ( count > 16 )\n        count = 16;\n\n      /* compute integer stem positions in font units */\n      for ( n = 0; n < count * 2; n++ )\n      {\n        y       += coords[n];\n        stems[n] = FIXED_TO_INT( y );\n      }\n\n      /* compute lengths */\n      for ( n = 0; n < count * 2; n += 2 )\n        stems[n + 1] = stems[n + 1] - stems[n];\n\n      /* add them to the current dimension */\n      ps_hints_stem( (PS_Hints)hints, dimension, count, stems );\n\n      total -= count;\n    }\n  }\n\n\n  FT_LOCAL_DEF( void )\n  t2_hints_funcs_init( T2_Hints_FuncsRec*  funcs )\n  {\n    FT_MEM_ZERO( funcs, sizeof ( *funcs ) );\n\n    funcs->open    = (T2_Hints_OpenFunc)   t2_hints_open;\n    funcs->close   = (T2_Hints_CloseFunc)  ps_hints_close;\n    funcs->stems   = (T2_Hints_StemsFunc)  t2_hints_stems;\n    funcs->hintmask= (T2_Hints_MaskFunc)   ps_hints_t2mask;\n    funcs->counter = (T2_Hints_CounterFunc)ps_hints_t2counter;\n    funcs->apply   = (T2_Hints_ApplyFunc)  ps_hints_apply;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pshinter/pshrec.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pshrec.h                                                               */\n/*                                                                         */\n/*    Postscript (Type1/Type2) hints recorder (specification).             */\n/*                                                                         */\n/*  Copyright 2001, 2002, 2003, 2006, 2008, 2014 by                        */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /**************************************************************************/\n  /*                                                                        */\n  /*  The functions defined here are called from the Type 1, CID and CFF    */\n  /*  font drivers to record the hints of a given character/glyph.          */\n  /*                                                                        */\n  /*  The hints are recorded in a unified format, and are later processed   */\n  /*  by the `optimizer' and `fitter' to adjust the outlines to the pixel   */\n  /*  grid.                                                                 */\n  /*                                                                        */\n  /**************************************************************************/\n\n\n#ifndef __PSHREC_H__\n#define __PSHREC_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_POSTSCRIPT_HINTS_H\n#include \"pshglob.h\"\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                 GLYPH HINTS RECORDER INTERNALS                *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* handle to hint record */\n  typedef struct PS_HintRec_*  PS_Hint;\n\n  /* hint types */\n  typedef enum  PS_Hint_Type_\n  {\n    PS_HINT_TYPE_1 = 1,\n    PS_HINT_TYPE_2 = 2\n\n  } PS_Hint_Type;\n\n\n  /* hint flags */\n  typedef enum  PS_Hint_Flags_\n  {\n    PS_HINT_FLAG_GHOST  = 1,\n    PS_HINT_FLAG_BOTTOM = 2\n\n  } PS_Hint_Flags;\n\n\n  /* hint descriptor */\n  typedef struct  PS_HintRec_\n  {\n    FT_Int   pos;\n    FT_Int   len;\n    FT_UInt  flags;\n\n  } PS_HintRec;\n\n\n#define ps_hint_is_active( x )  ( (x)->flags & PS_HINT_FLAG_ACTIVE )\n#define ps_hint_is_ghost( x )   ( (x)->flags & PS_HINT_FLAG_GHOST  )\n#define ps_hint_is_bottom( x )  ( (x)->flags & PS_HINT_FLAG_BOTTOM )\n\n\n  /* hints table descriptor */\n  typedef struct  PS_Hint_TableRec_\n  {\n    FT_UInt  num_hints;\n    FT_UInt  max_hints;\n    PS_Hint  hints;\n\n  } PS_Hint_TableRec, *PS_Hint_Table;\n\n\n  /* hint and counter mask descriptor */\n  typedef struct  PS_MaskRec_\n  {\n    FT_UInt   num_bits;\n    FT_UInt   max_bits;\n    FT_Byte*  bytes;\n    FT_UInt   end_point;\n\n  } PS_MaskRec, *PS_Mask;\n\n\n  /* masks and counters table descriptor */\n  typedef struct  PS_Mask_TableRec_\n  {\n    FT_UInt  num_masks;\n    FT_UInt  max_masks;\n    PS_Mask  masks;\n\n  } PS_Mask_TableRec, *PS_Mask_Table;\n\n\n /* dimension-specific hints descriptor */\n  typedef struct  PS_DimensionRec_\n  {\n    PS_Hint_TableRec  hints;\n    PS_Mask_TableRec  masks;\n    PS_Mask_TableRec  counters;\n\n  } PS_DimensionRec, *PS_Dimension;\n\n\n  /* glyph hints descriptor                                */\n  /* dimension 0 => X coordinates + vertical hints/stems   */\n  /* dimension 1 => Y coordinates + horizontal hints/stems */\n  typedef struct  PS_HintsRec_\n  {\n    FT_Memory        memory;\n    FT_Error         error;\n    FT_UInt32        magic;\n    PS_Hint_Type     hint_type;\n    PS_DimensionRec  dimension[2];\n\n  } PS_HintsRec, *PS_Hints;\n\n  /* */\n\n  /* initialize hints recorder */\n  FT_LOCAL( void )\n  ps_hints_init( PS_Hints   hints,\n                 FT_Memory  memory );\n\n  /* finalize hints recorder */\n  FT_LOCAL( void )\n  ps_hints_done( PS_Hints  hints );\n\n  /* initialize Type1 hints recorder interface */\n  FT_LOCAL( void )\n  t1_hints_funcs_init( T1_Hints_FuncsRec*  funcs );\n\n  /* initialize Type2 hints recorder interface */\n  FT_LOCAL( void )\n  t2_hints_funcs_init( T2_Hints_FuncsRec*  funcs );\n\n\n#ifdef DEBUG_HINTER\n  extern PS_Hints  ps_debug_hints;\n  extern  int      ps_debug_no_horz_hints;\n  extern  int      ps_debug_no_vert_hints;\n#endif\n\n /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __PS_HINTER_RECORD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/pshinter/rules.mk",
    "content": "#\n# FreeType 2 PSHinter driver configuration rules\n#\n\n\n# Copyright 2001, 2003, 2011 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\n# PSHINTER driver directory\n#\nPSHINTER_DIR := $(SRC_DIR)/pshinter\n\n\n# compilation flags for the driver\n#\nPSHINTER_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PSHINTER_DIR))\n\n\n# PSHINTER driver sources (i.e., C files)\n#\nPSHINTER_DRV_SRC := $(PSHINTER_DIR)/pshalgo.c \\\n                    $(PSHINTER_DIR)/pshglob.c \\\n                    $(PSHINTER_DIR)/pshmod.c  \\\n                    $(PSHINTER_DIR)/pshpic.c  \\\n                    $(PSHINTER_DIR)/pshrec.c\n\n\n# PSHINTER driver headers\n#\nPSHINTER_DRV_H := $(PSHINTER_DRV_SRC:%c=%h) \\\n                  $(PSHINTER_DIR)/pshnterr.h\n\n\n# PSHINTER driver object(s)\n#\n#   PSHINTER_DRV_OBJ_M is used during `multi' builds.\n#   PSHINTER_DRV_OBJ_S is used during `single' builds.\n#\nPSHINTER_DRV_OBJ_M := $(PSHINTER_DRV_SRC:$(PSHINTER_DIR)/%.c=$(OBJ_DIR)/%.$O)\nPSHINTER_DRV_OBJ_S := $(OBJ_DIR)/pshinter.$O\n\n# PSHINTER driver source file for single build\n#\nPSHINTER_DRV_SRC_S := $(PSHINTER_DIR)/pshinter.c\n\n\n# PSHINTER driver - single object\n#\n$(PSHINTER_DRV_OBJ_S): $(PSHINTER_DRV_SRC_S) $(PSHINTER_DRV_SRC) \\\n                       $(FREETYPE_H) $(PSHINTER_DRV_H)\n\t$(PSHINTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PSHINTER_DRV_SRC_S))\n\n\n# PSHINTER driver - multiple objects\n#\n$(OBJ_DIR)/%.$O: $(PSHINTER_DIR)/%.c $(FREETYPE_H) $(PSHINTER_DRV_H)\n\t$(PSHINTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\n\n\n# update main driver object lists\n#\nDRV_OBJS_S += $(PSHINTER_DRV_OBJ_S)\nDRV_OBJS_M += $(PSHINTER_DRV_OBJ_M)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/psnames/Jamfile",
    "content": "# FreeType 2 src/psnames Jamfile\n#\n# Copyright 2001 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) psnames ;\n\n{\n  local  _sources ;\n\n  if $(FT2_MULTI)\n  {\n    _sources = psmodule pspic ;\n  }\n  else\n  {\n    _sources = psnames ;\n  }\n\n  Library  $(FT2_LIB) : $(_sources).c ;\n}\n\n# end of src/psnames Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/psnames/module.mk",
    "content": "#\n# FreeType 2 PSnames module definition\n#\n\n\n# Copyright 1996-2000, 2006 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\nFTMODULE_H_COMMANDS += PSNAMES_MODULE\n\ndefine PSNAMES_MODULE\n$(OPEN_DRIVER) FT_Module_Class, psnames_module_class $(CLOSE_DRIVER)\n$(ECHO_DRIVER)psnames   $(ECHO_DRIVER_DESC)Postscript & Unicode Glyph name handling$(ECHO_DRIVER_DONE)\nendef\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/psnames/psmodule.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  psmodule.c                                                             */\n/*                                                                         */\n/*    PSNames module implementation (body).                                */\n/*                                                                         */\n/*  Copyright 1996-2003, 2005-2008, 2012-2014 by                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_SERVICE_POSTSCRIPT_CMAPS_H\n\n#include \"psmodule.h\"\n#include \"pstables.h\"\n\n#include \"psnamerr.h\"\n#include \"pspic.h\"\n\n\n#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES\n\n\n#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST\n\n\n#define VARIANT_BIT         0x80000000UL\n#define BASE_GLYPH( code )  ( (FT_UInt32)( (code) & ~VARIANT_BIT ) )\n\n\n  /* Return the Unicode value corresponding to a given glyph.  Note that */\n  /* we do deal with glyph variants by detecting a non-initial dot in    */\n  /* the name, as in `A.swash' or `e.final'; in this case, the           */\n  /* VARIANT_BIT is set in the return value.                             */\n  /*                                                                     */\n  static FT_UInt32\n  ps_unicode_value( const char*  glyph_name )\n  {\n    /* If the name begins with `uni', then the glyph name may be a */\n    /* hard-coded unicode character code.                          */\n    if ( glyph_name[0] == 'u' &&\n         glyph_name[1] == 'n' &&\n         glyph_name[2] == 'i' )\n    {\n      /* determine whether the next four characters following are */\n      /* hexadecimal.                                             */\n\n      /* XXX: Add code to deal with ligatures, i.e. glyph names like */\n      /*      `uniXXXXYYYYZZZZ'...                                   */\n\n      FT_Int       count;\n      FT_UInt32    value = 0;\n      const char*  p     = glyph_name + 3;\n\n\n      for ( count = 4; count > 0; count--, p++ )\n      {\n        char          c = *p;\n        unsigned int  d;\n\n\n        d = (unsigned char)c - '0';\n        if ( d >= 10 )\n        {\n          d = (unsigned char)c - 'A';\n          if ( d >= 6 )\n            d = 16;\n          else\n            d += 10;\n        }\n\n        /* Exit if a non-uppercase hexadecimal character was found   */\n        /* -- this also catches character codes below `0' since such */\n        /* negative numbers cast to `unsigned int' are far too big.  */\n        if ( d >= 16 )\n          break;\n\n        value = ( value << 4 ) + d;\n      }\n\n      /* there must be exactly four hex digits */\n      if ( count == 0 )\n      {\n        if ( *p == '\\0' )\n          return value;\n        if ( *p == '.' )\n          return (FT_UInt32)( value | VARIANT_BIT );\n      }\n    }\n\n    /* If the name begins with `u', followed by four to six uppercase */\n    /* hexadecimal digits, it is a hard-coded unicode character code. */\n    if ( glyph_name[0] == 'u' )\n    {\n      FT_Int       count;\n      FT_UInt32    value = 0;\n      const char*  p     = glyph_name + 1;\n\n\n      for ( count = 6; count > 0; count--, p++ )\n      {\n        char          c = *p;\n        unsigned int  d;\n\n\n        d = (unsigned char)c - '0';\n        if ( d >= 10 )\n        {\n          d = (unsigned char)c - 'A';\n          if ( d >= 6 )\n            d = 16;\n          else\n            d += 10;\n        }\n\n        if ( d >= 16 )\n          break;\n\n        value = ( value << 4 ) + d;\n      }\n\n      if ( count <= 2 )\n      {\n        if ( *p == '\\0' )\n          return value;\n        if ( *p == '.' )\n          return (FT_UInt32)( value | VARIANT_BIT );\n      }\n    }\n\n    /* Look for a non-initial dot in the glyph name in order to */\n    /* find variants like `A.swash', `e.final', etc.            */\n    {\n      const char*  p   = glyph_name;\n      const char*  dot = NULL;\n\n\n      for ( ; *p; p++ )\n      {\n        if ( *p == '.' && p > glyph_name )\n        {\n          dot = p;\n          break;\n        }\n      }\n\n      /* now look up the glyph in the Adobe Glyph List */\n      if ( !dot )\n        return (FT_UInt32)ft_get_adobe_glyph_index( glyph_name, p );\n      else\n        return (FT_UInt32)( ft_get_adobe_glyph_index( glyph_name, dot ) |\n                            VARIANT_BIT );\n    }\n  }\n\n\n  /* ft_qsort callback to sort the unicode map */\n  FT_CALLBACK_DEF( int )\n  compare_uni_maps( const void*  a,\n                    const void*  b )\n  {\n    PS_UniMap*  map1 = (PS_UniMap*)a;\n    PS_UniMap*  map2 = (PS_UniMap*)b;\n    FT_UInt32   unicode1 = BASE_GLYPH( map1->unicode );\n    FT_UInt32   unicode2 = BASE_GLYPH( map2->unicode );\n\n\n    /* sort base glyphs before glyph variants */\n    if ( unicode1 == unicode2 )\n    {\n      if ( map1->unicode > map2->unicode )\n        return 1;\n      else if ( map1->unicode < map2->unicode )\n        return -1;\n      else\n        return 0;\n    }\n    else\n    {\n      if ( unicode1 > unicode2 )\n        return 1;\n      else if ( unicode1 < unicode2 )\n        return -1;\n      else\n        return 0;\n    }\n  }\n\n\n  /* support for extra glyphs not handled (well) in AGL; */\n  /* we add extra mappings for them if necessary         */\n\n#define EXTRA_GLYPH_LIST_SIZE  10\n\n  static const FT_UInt32  ft_extra_glyph_unicodes[EXTRA_GLYPH_LIST_SIZE] =\n  {\n    /* WGL 4 */\n    0x0394,\n    0x03A9,\n    0x2215,\n    0x00AD,\n    0x02C9,\n    0x03BC,\n    0x2219,\n    0x00A0,\n    /* Romanian */\n    0x021A,\n    0x021B\n  };\n\n  static const char  ft_extra_glyph_names[] =\n  {\n    'D','e','l','t','a',0,\n    'O','m','e','g','a',0,\n    'f','r','a','c','t','i','o','n',0,\n    'h','y','p','h','e','n',0,\n    'm','a','c','r','o','n',0,\n    'm','u',0,\n    'p','e','r','i','o','d','c','e','n','t','e','r','e','d',0,\n    's','p','a','c','e',0,\n    'T','c','o','m','m','a','a','c','c','e','n','t',0,\n    't','c','o','m','m','a','a','c','c','e','n','t',0\n  };\n\n  static const FT_Int\n  ft_extra_glyph_name_offsets[EXTRA_GLYPH_LIST_SIZE] =\n  {\n     0,\n     6,\n    12,\n    21,\n    28,\n    35,\n    38,\n    53,\n    59,\n    72\n  };\n\n\n  static void\n  ps_check_extra_glyph_name( const char*  gname,\n                             FT_UInt      glyph,\n                             FT_UInt*     extra_glyphs,\n                             FT_UInt     *states )\n  {\n    FT_UInt  n;\n\n\n    for ( n = 0; n < EXTRA_GLYPH_LIST_SIZE; n++ )\n    {\n      if ( ft_strcmp( ft_extra_glyph_names +\n                        ft_extra_glyph_name_offsets[n], gname ) == 0 )\n      {\n        if ( states[n] == 0 )\n        {\n          /* mark this extra glyph as a candidate for the cmap */\n          states[n]     = 1;\n          extra_glyphs[n] = glyph;\n        }\n\n        return;\n      }\n    }\n  }\n\n\n  static void\n  ps_check_extra_glyph_unicode( FT_UInt32  uni_char,\n                                FT_UInt   *states )\n  {\n    FT_UInt  n;\n\n\n    for ( n = 0; n < EXTRA_GLYPH_LIST_SIZE; n++ )\n    {\n      if ( uni_char == ft_extra_glyph_unicodes[n] )\n      {\n        /* disable this extra glyph from being added to the cmap */\n        states[n] = 2;\n\n        return;\n      }\n    }\n  }\n\n\n  /* Build a table that maps Unicode values to glyph indices. */\n  static FT_Error\n  ps_unicodes_init( FT_Memory             memory,\n                    PS_Unicodes           table,\n                    FT_UInt               num_glyphs,\n                    PS_GetGlyphNameFunc   get_glyph_name,\n                    PS_FreeGlyphNameFunc  free_glyph_name,\n                    FT_Pointer            glyph_data )\n  {\n    FT_Error  error;\n\n    FT_UInt  extra_glyph_list_states[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };\n    FT_UInt  extra_glyphs[EXTRA_GLYPH_LIST_SIZE];\n\n\n    /* we first allocate the table */\n    table->num_maps = 0;\n    table->maps     = 0;\n\n    if ( !FT_NEW_ARRAY( table->maps, num_glyphs + EXTRA_GLYPH_LIST_SIZE ) )\n    {\n      FT_UInt     n;\n      FT_UInt     count;\n      PS_UniMap*  map;\n      FT_UInt32   uni_char;\n\n\n      map = table->maps;\n\n      for ( n = 0; n < num_glyphs; n++ )\n      {\n        const char*  gname = get_glyph_name( glyph_data, n );\n\n\n        if ( gname )\n        {\n          ps_check_extra_glyph_name( gname, n,\n                                     extra_glyphs, extra_glyph_list_states );\n          uni_char = ps_unicode_value( gname );\n\n          if ( BASE_GLYPH( uni_char ) != 0 )\n          {\n            ps_check_extra_glyph_unicode( uni_char,\n                                          extra_glyph_list_states );\n            map->unicode     = uni_char;\n            map->glyph_index = n;\n            map++;\n          }\n\n          if ( free_glyph_name )\n            free_glyph_name( glyph_data, gname );\n        }\n      }\n\n      for ( n = 0; n < EXTRA_GLYPH_LIST_SIZE; n++ )\n      {\n        if ( extra_glyph_list_states[n] == 1 )\n        {\n          /* This glyph name has an additional representation. */\n          /* Add it to the cmap.                               */\n\n          map->unicode     = ft_extra_glyph_unicodes[n];\n          map->glyph_index = extra_glyphs[n];\n          map++;\n        }\n      }\n\n      /* now compress the table a bit */\n      count = (FT_UInt)( map - table->maps );\n\n      if ( count == 0 )\n      {\n        /* No unicode chars here! */\n        FT_FREE( table->maps );\n        if ( !error )\n          error = FT_THROW( No_Unicode_Glyph_Name );\n      }\n      else\n      {\n        /* Reallocate if the number of used entries is much smaller. */\n        if ( count < num_glyphs / 2 )\n        {\n          (void)FT_RENEW_ARRAY( table->maps, num_glyphs, count );\n          error = FT_Err_Ok;\n        }\n\n        /* Sort the table in increasing order of unicode values, */\n        /* taking care of glyph variants.                        */\n        ft_qsort( table->maps, count, sizeof ( PS_UniMap ),\n                  compare_uni_maps );\n      }\n\n      table->num_maps = count;\n    }\n\n    return error;\n  }\n\n\n  static FT_UInt\n  ps_unicodes_char_index( PS_Unicodes  table,\n                          FT_UInt32    unicode )\n  {\n    PS_UniMap  *min, *max, *mid, *result = NULL;\n\n\n    /* Perform a binary search on the table. */\n\n    min = table->maps;\n    max = min + table->num_maps - 1;\n\n    while ( min <= max )\n    {\n      FT_UInt32  base_glyph;\n\n\n      mid = min + ( ( max - min ) >> 1 );\n\n      if ( mid->unicode == unicode )\n      {\n        result = mid;\n        break;\n      }\n\n      base_glyph = BASE_GLYPH( mid->unicode );\n\n      if ( base_glyph == unicode )\n        result = mid; /* remember match but continue search for base glyph */\n\n      if ( min == max )\n        break;\n\n      if ( base_glyph < unicode )\n        min = mid + 1;\n      else\n        max = mid - 1;\n    }\n\n    if ( result )\n      return result->glyph_index;\n    else\n      return 0;\n  }\n\n\n  static FT_UInt32\n  ps_unicodes_char_next( PS_Unicodes  table,\n                         FT_UInt32   *unicode )\n  {\n    FT_UInt    result    = 0;\n    FT_UInt32  char_code = *unicode + 1;\n\n\n    {\n      FT_UInt     min = 0;\n      FT_UInt     max = table->num_maps;\n      FT_UInt     mid;\n      PS_UniMap*  map;\n      FT_UInt32   base_glyph;\n\n\n      while ( min < max )\n      {\n        mid = min + ( ( max - min ) >> 1 );\n        map = table->maps + mid;\n\n        if ( map->unicode == char_code )\n        {\n          result = map->glyph_index;\n          goto Exit;\n        }\n\n        base_glyph = BASE_GLYPH( map->unicode );\n\n        if ( base_glyph == char_code )\n          result = map->glyph_index;\n\n        if ( base_glyph < char_code )\n          min = mid + 1;\n        else\n          max = mid;\n      }\n\n      if ( result )\n        goto Exit;               /* we have a variant glyph */\n\n      /* we didn't find it; check whether we have a map just above it */\n      char_code = 0;\n\n      if ( min < table->num_maps )\n      {\n        map       = table->maps + min;\n        result    = map->glyph_index;\n        char_code = BASE_GLYPH( map->unicode );\n      }\n    }\n\n  Exit:\n    *unicode = char_code;\n    return result;\n  }\n\n\n#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */\n\n\n  static const char*\n  ps_get_macintosh_name( FT_UInt  name_index )\n  {\n    if ( name_index >= FT_NUM_MAC_NAMES )\n      name_index = 0;\n\n    return ft_standard_glyph_names + ft_mac_names[name_index];\n  }\n\n\n  static const char*\n  ps_get_standard_strings( FT_UInt  sid )\n  {\n    if ( sid >= FT_NUM_SID_NAMES )\n      return 0;\n\n    return ft_standard_glyph_names + ft_sid_names[sid];\n  }\n\n\n#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST\n\n  FT_DEFINE_SERVICE_PSCMAPSREC(\n    pscmaps_interface,\n    (PS_Unicode_ValueFunc)     ps_unicode_value,\n    (PS_Unicodes_InitFunc)     ps_unicodes_init,\n    (PS_Unicodes_CharIndexFunc)ps_unicodes_char_index,\n    (PS_Unicodes_CharNextFunc) ps_unicodes_char_next,\n\n    (PS_Macintosh_NameFunc)    ps_get_macintosh_name,\n    (PS_Adobe_Std_StringsFunc) ps_get_standard_strings,\n\n    t1_standard_encoding,\n    t1_expert_encoding )\n\n#else\n\n  FT_DEFINE_SERVICE_PSCMAPSREC(\n    pscmaps_interface,\n    NULL,\n    NULL,\n    NULL,\n    NULL,\n\n    (PS_Macintosh_NameFunc)    ps_get_macintosh_name,\n    (PS_Adobe_Std_StringsFunc) ps_get_standard_strings,\n\n    t1_standard_encoding,\n    t1_expert_encoding )\n\n#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */\n\n\n  FT_DEFINE_SERVICEDESCREC1(\n    pscmaps_services,\n    FT_SERVICE_ID_POSTSCRIPT_CMAPS, &PSCMAPS_INTERFACE_GET )\n\n\n  static FT_Pointer\n  psnames_get_service( FT_Module    module,\n                       const char*  service_id )\n  {\n    /* PSCMAPS_SERVICES_GET dereferences `library' in PIC mode */\n#ifdef FT_CONFIG_OPTION_PIC\n    FT_Library  library;\n\n\n    if ( !module )\n      return NULL;\n    library = module->library;\n    if ( !library )\n      return NULL;\n#else\n    FT_UNUSED( module );\n#endif\n\n    return ft_service_list_lookup( PSCMAPS_SERVICES_GET, service_id );\n  }\n\n#endif /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */\n\n\n#ifndef FT_CONFIG_OPTION_POSTSCRIPT_NAMES\n#define PUT_PS_NAMES_SERVICE( a )  NULL\n#else\n#define PUT_PS_NAMES_SERVICE( a )  a\n#endif\n\n  FT_DEFINE_MODULE(\n    psnames_module_class,\n\n    0,  /* this is not a font driver, nor a renderer */\n    sizeof ( FT_ModuleRec ),\n\n    \"psnames\",  /* driver name                         */\n    0x10000L,   /* driver version                      */\n    0x20000L,   /* driver requires FreeType 2 or above */\n\n    PUT_PS_NAMES_SERVICE(\n      (void*)&PSCMAPS_INTERFACE_GET ),   /* module specific interface */\n    (FT_Module_Constructor)NULL,\n    (FT_Module_Destructor) NULL,\n    (FT_Module_Requester)  PUT_PS_NAMES_SERVICE( psnames_get_service ) )\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/psnames/psmodule.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  psmodule.h                                                             */\n/*                                                                         */\n/*    High-level PSNames module interface (specification).                 */\n/*                                                                         */\n/*  Copyright 1996-2001 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PSMODULE_H__\n#define __PSMODULE_H__\n\n\n#include <ft2build.h>\n#include FT_MODULE_H\n\n\nFT_BEGIN_HEADER\n\n\n  FT_DECLARE_MODULE( psnames_module_class )\n\n\nFT_END_HEADER\n\n#endif /* __PSMODULE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/psnames/psnamerr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  psnamerr.h                                                             */\n/*                                                                         */\n/*    PS names module error codes (specification only).                    */\n/*                                                                         */\n/*  Copyright 2001, 2012 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the PS names module error enumeration     */\n  /* constants.                                                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __PSNAMERR_H__\n#define __PSNAMERR_H__\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  PSnames_Err_\n#define FT_ERR_BASE    FT_Mod_Err_PSnames\n\n#include FT_ERRORS_H\n\n#endif /* __PSNAMERR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/psnames/psnames.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  psnames.c                                                              */\n/*                                                                         */\n/*    FreeType PSNames module component (body only).                       */\n/*                                                                         */\n/*  Copyright 1996-2001 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#define FT_MAKE_OPTION_SINGLE_OBJECT\n\n#include <ft2build.h>\n#include \"pspic.c\"\n#include \"psmodule.c\"\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/psnames/pspic.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pspic.c                                                                */\n/*                                                                         */\n/*    The FreeType position independent code services for psnames module.  */\n/*                                                                         */\n/*  Copyright 2009, 2010, 2012, 2013 by                                    */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_INTERNAL_OBJECTS_H\n#include \"pspic.h\"\n#include \"psnamerr.h\"\n\n\n#ifdef FT_CONFIG_OPTION_PIC\n\n  /* forward declaration of PIC init functions from psmodule.c */\n  FT_Error\n  FT_Create_Class_pscmaps_services( FT_Library           library,\n                                    FT_ServiceDescRec**  output_class );\n  void\n  FT_Destroy_Class_pscmaps_services( FT_Library          library,\n                                     FT_ServiceDescRec*  clazz );\n\n  void\n  FT_Init_Class_pscmaps_interface( FT_Library              library,\n                                   FT_Service_PsCMapsRec*  clazz );\n\n\n  void\n  psnames_module_class_pic_free( FT_Library  library )\n  {\n    FT_PIC_Container*  pic_container = &library->pic_container;\n    FT_Memory          memory        = library->memory;\n\n\n    if ( pic_container->psnames )\n    {\n      PSModulePIC*  container = (PSModulePIC*)pic_container->psnames;\n\n\n      if ( container->pscmaps_services )\n        FT_Destroy_Class_pscmaps_services( library,\n                                           container->pscmaps_services );\n      container->pscmaps_services = NULL;\n      FT_FREE( container );\n      pic_container->psnames = NULL;\n    }\n  }\n\n\n  FT_Error\n  psnames_module_class_pic_init( FT_Library  library )\n  {\n    FT_PIC_Container*  pic_container = &library->pic_container;\n    FT_Error           error         = FT_Err_Ok;\n    PSModulePIC*       container     = NULL;\n    FT_Memory          memory        = library->memory;\n\n\n    /* allocate pointer, clear and set global container pointer */\n    if ( FT_ALLOC( container, sizeof ( *container ) ) )\n      return error;\n    FT_MEM_SET( container, 0, sizeof ( *container ) );\n    pic_container->psnames = container;\n\n    /* initialize pointer table -                       */\n    /* this is how the module usually expects this data */\n    error = FT_Create_Class_pscmaps_services(\n              library, &container->pscmaps_services );\n    if ( error )\n      goto Exit;\n    FT_Init_Class_pscmaps_interface( library,\n                                     &container->pscmaps_interface );\n\n  Exit:\n    if ( error )\n      psnames_module_class_pic_free( library );\n    return error;\n  }\n\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/psnames/pspic.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pspic.h                                                                */\n/*                                                                         */\n/*    The FreeType position independent code services for psnames module.  */\n/*                                                                         */\n/*  Copyright 2009, 2012 by                                                */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PSPIC_H__\n#define __PSPIC_H__\n\n\nFT_BEGIN_HEADER\n\n#include FT_INTERNAL_PIC_H\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define PSCMAPS_SERVICES_GET   pscmaps_services\n#define PSCMAPS_INTERFACE_GET  pscmaps_interface\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#include FT_SERVICE_POSTSCRIPT_CMAPS_H\n\n  typedef struct  PSModulePIC_\n  {\n    FT_ServiceDescRec*     pscmaps_services;\n    FT_Service_PsCMapsRec  pscmaps_interface;\n\n  } PSModulePIC;\n\n\n#define GET_PIC( lib )                                     \\\n          ( (PSModulePIC*)((lib)->pic_container.psnames) )\n#define PSCMAPS_SERVICES_GET   ( GET_PIC( library )->pscmaps_services )\n#define PSCMAPS_INTERFACE_GET  ( GET_PIC( library )->pscmaps_interface )\n\n\n  /* see pspic.c for the implementation */\n  void\n  psnames_module_class_pic_free( FT_Library  library );\n\n  FT_Error\n  psnames_module_class_pic_init( FT_Library  library );\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __PSPIC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/psnames/pstables.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pstables.h                                                             */\n/*                                                                         */\n/*    PostScript glyph names.                                              */\n/*                                                                         */\n/*  Copyright 2005, 2008, 2011 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /* This file has been generated automatically -- do not edit! */\n\n\n  static const char  ft_standard_glyph_names[3696] =\n  {\n    '.','n','u','l','l', 0,\n    'n','o','n','m','a','r','k','i','n','g','r','e','t','u','r','n', 0,\n    'n','o','t','e','q','u','a','l', 0,\n    'i','n','f','i','n','i','t','y', 0,\n    'l','e','s','s','e','q','u','a','l', 0,\n    'g','r','e','a','t','e','r','e','q','u','a','l', 0,\n    'p','a','r','t','i','a','l','d','i','f','f', 0,\n    's','u','m','m','a','t','i','o','n', 0,\n    'p','r','o','d','u','c','t', 0,\n    'p','i', 0,\n    'i','n','t','e','g','r','a','l', 0,\n    'O','m','e','g','a', 0,\n    'r','a','d','i','c','a','l', 0,\n    'a','p','p','r','o','x','e','q','u','a','l', 0,\n    'D','e','l','t','a', 0,\n    'n','o','n','b','r','e','a','k','i','n','g','s','p','a','c','e', 0,\n    'l','o','z','e','n','g','e', 0,\n    'a','p','p','l','e', 0,\n    'f','r','a','n','c', 0,\n    'G','b','r','e','v','e', 0,\n    'g','b','r','e','v','e', 0,\n    'I','d','o','t','a','c','c','e','n','t', 0,\n    'S','c','e','d','i','l','l','a', 0,\n    's','c','e','d','i','l','l','a', 0,\n    'C','a','c','u','t','e', 0,\n    'c','a','c','u','t','e', 0,\n    'C','c','a','r','o','n', 0,\n    'c','c','a','r','o','n', 0,\n    'd','c','r','o','a','t', 0,\n    '.','n','o','t','d','e','f', 0,\n    's','p','a','c','e', 0,\n    'e','x','c','l','a','m', 0,\n    'q','u','o','t','e','d','b','l', 0,\n    'n','u','m','b','e','r','s','i','g','n', 0,\n    'd','o','l','l','a','r', 0,\n    'p','e','r','c','e','n','t', 0,\n    'a','m','p','e','r','s','a','n','d', 0,\n    'q','u','o','t','e','r','i','g','h','t', 0,\n    'p','a','r','e','n','l','e','f','t', 0,\n    'p','a','r','e','n','r','i','g','h','t', 0,\n    'a','s','t','e','r','i','s','k', 0,\n    'p','l','u','s', 0,\n    'c','o','m','m','a', 0,\n    'h','y','p','h','e','n', 0,\n    'p','e','r','i','o','d', 0,\n    's','l','a','s','h', 0,\n    'z','e','r','o', 0,\n    'o','n','e', 0,\n    't','w','o', 0,\n    't','h','r','e','e', 0,\n    'f','o','u','r', 0,\n    'f','i','v','e', 0,\n    's','i','x', 0,\n    's','e','v','e','n', 0,\n    'e','i','g','h','t', 0,\n    'n','i','n','e', 0,\n    'c','o','l','o','n', 0,\n    's','e','m','i','c','o','l','o','n', 0,\n    'l','e','s','s', 0,\n    'e','q','u','a','l', 0,\n    'g','r','e','a','t','e','r', 0,\n    'q','u','e','s','t','i','o','n', 0,\n    'a','t', 0,\n    'A', 0,\n    'B', 0,\n    'C', 0,\n    'D', 0,\n    'E', 0,\n    'F', 0,\n    'G', 0,\n    'H', 0,\n    'I', 0,\n    'J', 0,\n    'K', 0,\n    'L', 0,\n    'M', 0,\n    'N', 0,\n    'O', 0,\n    'P', 0,\n    'Q', 0,\n    'R', 0,\n    'S', 0,\n    'T', 0,\n    'U', 0,\n    'V', 0,\n    'W', 0,\n    'X', 0,\n    'Y', 0,\n    'Z', 0,\n    'b','r','a','c','k','e','t','l','e','f','t', 0,\n    'b','a','c','k','s','l','a','s','h', 0,\n    'b','r','a','c','k','e','t','r','i','g','h','t', 0,\n    'a','s','c','i','i','c','i','r','c','u','m', 0,\n    'u','n','d','e','r','s','c','o','r','e', 0,\n    'q','u','o','t','e','l','e','f','t', 0,\n    'a', 0,\n    'b', 0,\n    'c', 0,\n    'd', 0,\n    'e', 0,\n    'f', 0,\n    'g', 0,\n    'h', 0,\n    'i', 0,\n    'j', 0,\n    'k', 0,\n    'l', 0,\n    'm', 0,\n    'n', 0,\n    'o', 0,\n    'p', 0,\n    'q', 0,\n    'r', 0,\n    's', 0,\n    't', 0,\n    'u', 0,\n    'v', 0,\n    'w', 0,\n    'x', 0,\n    'y', 0,\n    'z', 0,\n    'b','r','a','c','e','l','e','f','t', 0,\n    'b','a','r', 0,\n    'b','r','a','c','e','r','i','g','h','t', 0,\n    'a','s','c','i','i','t','i','l','d','e', 0,\n    'e','x','c','l','a','m','d','o','w','n', 0,\n    'c','e','n','t', 0,\n    's','t','e','r','l','i','n','g', 0,\n    'f','r','a','c','t','i','o','n', 0,\n    'y','e','n', 0,\n    'f','l','o','r','i','n', 0,\n    's','e','c','t','i','o','n', 0,\n    'c','u','r','r','e','n','c','y', 0,\n    'q','u','o','t','e','s','i','n','g','l','e', 0,\n    'q','u','o','t','e','d','b','l','l','e','f','t', 0,\n    'g','u','i','l','l','e','m','o','t','l','e','f','t', 0,\n    'g','u','i','l','s','i','n','g','l','l','e','f','t', 0,\n    'g','u','i','l','s','i','n','g','l','r','i','g','h','t', 0,\n    'f','i', 0,\n    'f','l', 0,\n    'e','n','d','a','s','h', 0,\n    'd','a','g','g','e','r', 0,\n    'd','a','g','g','e','r','d','b','l', 0,\n    'p','e','r','i','o','d','c','e','n','t','e','r','e','d', 0,\n    'p','a','r','a','g','r','a','p','h', 0,\n    'b','u','l','l','e','t', 0,\n    'q','u','o','t','e','s','i','n','g','l','b','a','s','e', 0,\n    'q','u','o','t','e','d','b','l','b','a','s','e', 0,\n    'q','u','o','t','e','d','b','l','r','i','g','h','t', 0,\n    'g','u','i','l','l','e','m','o','t','r','i','g','h','t', 0,\n    'e','l','l','i','p','s','i','s', 0,\n    'p','e','r','t','h','o','u','s','a','n','d', 0,\n    'q','u','e','s','t','i','o','n','d','o','w','n', 0,\n    'g','r','a','v','e', 0,\n    'a','c','u','t','e', 0,\n    'c','i','r','c','u','m','f','l','e','x', 0,\n    't','i','l','d','e', 0,\n    'm','a','c','r','o','n', 0,\n    'b','r','e','v','e', 0,\n    'd','o','t','a','c','c','e','n','t', 0,\n    'd','i','e','r','e','s','i','s', 0,\n    'r','i','n','g', 0,\n    'c','e','d','i','l','l','a', 0,\n    'h','u','n','g','a','r','u','m','l','a','u','t', 0,\n    'o','g','o','n','e','k', 0,\n    'c','a','r','o','n', 0,\n    'e','m','d','a','s','h', 0,\n    'A','E', 0,\n    'o','r','d','f','e','m','i','n','i','n','e', 0,\n    'L','s','l','a','s','h', 0,\n    'O','s','l','a','s','h', 0,\n    'O','E', 0,\n    'o','r','d','m','a','s','c','u','l','i','n','e', 0,\n    'a','e', 0,\n    'd','o','t','l','e','s','s','i', 0,\n    'l','s','l','a','s','h', 0,\n    'o','s','l','a','s','h', 0,\n    'o','e', 0,\n    'g','e','r','m','a','n','d','b','l','s', 0,\n    'o','n','e','s','u','p','e','r','i','o','r', 0,\n    'l','o','g','i','c','a','l','n','o','t', 0,\n    'm','u', 0,\n    't','r','a','d','e','m','a','r','k', 0,\n    'E','t','h', 0,\n    'o','n','e','h','a','l','f', 0,\n    'p','l','u','s','m','i','n','u','s', 0,\n    'T','h','o','r','n', 0,\n    'o','n','e','q','u','a','r','t','e','r', 0,\n    'd','i','v','i','d','e', 0,\n    'b','r','o','k','e','n','b','a','r', 0,\n    'd','e','g','r','e','e', 0,\n    't','h','o','r','n', 0,\n    't','h','r','e','e','q','u','a','r','t','e','r','s', 0,\n    't','w','o','s','u','p','e','r','i','o','r', 0,\n    'r','e','g','i','s','t','e','r','e','d', 0,\n    'm','i','n','u','s', 0,\n    'e','t','h', 0,\n    'm','u','l','t','i','p','l','y', 0,\n    't','h','r','e','e','s','u','p','e','r','i','o','r', 0,\n    'c','o','p','y','r','i','g','h','t', 0,\n    'A','a','c','u','t','e', 0,\n    'A','c','i','r','c','u','m','f','l','e','x', 0,\n    'A','d','i','e','r','e','s','i','s', 0,\n    'A','g','r','a','v','e', 0,\n    'A','r','i','n','g', 0,\n    'A','t','i','l','d','e', 0,\n    'C','c','e','d','i','l','l','a', 0,\n    'E','a','c','u','t','e', 0,\n    'E','c','i','r','c','u','m','f','l','e','x', 0,\n    'E','d','i','e','r','e','s','i','s', 0,\n    'E','g','r','a','v','e', 0,\n    'I','a','c','u','t','e', 0,\n    'I','c','i','r','c','u','m','f','l','e','x', 0,\n    'I','d','i','e','r','e','s','i','s', 0,\n    'I','g','r','a','v','e', 0,\n    'N','t','i','l','d','e', 0,\n    'O','a','c','u','t','e', 0,\n    'O','c','i','r','c','u','m','f','l','e','x', 0,\n    'O','d','i','e','r','e','s','i','s', 0,\n    'O','g','r','a','v','e', 0,\n    'O','t','i','l','d','e', 0,\n    'S','c','a','r','o','n', 0,\n    'U','a','c','u','t','e', 0,\n    'U','c','i','r','c','u','m','f','l','e','x', 0,\n    'U','d','i','e','r','e','s','i','s', 0,\n    'U','g','r','a','v','e', 0,\n    'Y','a','c','u','t','e', 0,\n    'Y','d','i','e','r','e','s','i','s', 0,\n    'Z','c','a','r','o','n', 0,\n    'a','a','c','u','t','e', 0,\n    'a','c','i','r','c','u','m','f','l','e','x', 0,\n    'a','d','i','e','r','e','s','i','s', 0,\n    'a','g','r','a','v','e', 0,\n    'a','r','i','n','g', 0,\n    'a','t','i','l','d','e', 0,\n    'c','c','e','d','i','l','l','a', 0,\n    'e','a','c','u','t','e', 0,\n    'e','c','i','r','c','u','m','f','l','e','x', 0,\n    'e','d','i','e','r','e','s','i','s', 0,\n    'e','g','r','a','v','e', 0,\n    'i','a','c','u','t','e', 0,\n    'i','c','i','r','c','u','m','f','l','e','x', 0,\n    'i','d','i','e','r','e','s','i','s', 0,\n    'i','g','r','a','v','e', 0,\n    'n','t','i','l','d','e', 0,\n    'o','a','c','u','t','e', 0,\n    'o','c','i','r','c','u','m','f','l','e','x', 0,\n    'o','d','i','e','r','e','s','i','s', 0,\n    'o','g','r','a','v','e', 0,\n    'o','t','i','l','d','e', 0,\n    's','c','a','r','o','n', 0,\n    'u','a','c','u','t','e', 0,\n    'u','c','i','r','c','u','m','f','l','e','x', 0,\n    'u','d','i','e','r','e','s','i','s', 0,\n    'u','g','r','a','v','e', 0,\n    'y','a','c','u','t','e', 0,\n    'y','d','i','e','r','e','s','i','s', 0,\n    'z','c','a','r','o','n', 0,\n    'e','x','c','l','a','m','s','m','a','l','l', 0,\n    'H','u','n','g','a','r','u','m','l','a','u','t','s','m','a','l','l', 0,\n    'd','o','l','l','a','r','o','l','d','s','t','y','l','e', 0,\n    'd','o','l','l','a','r','s','u','p','e','r','i','o','r', 0,\n    'a','m','p','e','r','s','a','n','d','s','m','a','l','l', 0,\n    'A','c','u','t','e','s','m','a','l','l', 0,\n    'p','a','r','e','n','l','e','f','t','s','u','p','e','r','i','o','r', 0,\n    'p','a','r','e','n','r','i','g','h','t','s','u','p','e','r','i','o','r', 0,\n    't','w','o','d','o','t','e','n','l','e','a','d','e','r', 0,\n    'o','n','e','d','o','t','e','n','l','e','a','d','e','r', 0,\n    'z','e','r','o','o','l','d','s','t','y','l','e', 0,\n    'o','n','e','o','l','d','s','t','y','l','e', 0,\n    't','w','o','o','l','d','s','t','y','l','e', 0,\n    't','h','r','e','e','o','l','d','s','t','y','l','e', 0,\n    'f','o','u','r','o','l','d','s','t','y','l','e', 0,\n    'f','i','v','e','o','l','d','s','t','y','l','e', 0,\n    's','i','x','o','l','d','s','t','y','l','e', 0,\n    's','e','v','e','n','o','l','d','s','t','y','l','e', 0,\n    'e','i','g','h','t','o','l','d','s','t','y','l','e', 0,\n    'n','i','n','e','o','l','d','s','t','y','l','e', 0,\n    'c','o','m','m','a','s','u','p','e','r','i','o','r', 0,\n    't','h','r','e','e','q','u','a','r','t','e','r','s','e','m','d','a','s','h', 0,\n    'p','e','r','i','o','d','s','u','p','e','r','i','o','r', 0,\n    'q','u','e','s','t','i','o','n','s','m','a','l','l', 0,\n    'a','s','u','p','e','r','i','o','r', 0,\n    'b','s','u','p','e','r','i','o','r', 0,\n    'c','e','n','t','s','u','p','e','r','i','o','r', 0,\n    'd','s','u','p','e','r','i','o','r', 0,\n    'e','s','u','p','e','r','i','o','r', 0,\n    'i','s','u','p','e','r','i','o','r', 0,\n    'l','s','u','p','e','r','i','o','r', 0,\n    'm','s','u','p','e','r','i','o','r', 0,\n    'n','s','u','p','e','r','i','o','r', 0,\n    'o','s','u','p','e','r','i','o','r', 0,\n    'r','s','u','p','e','r','i','o','r', 0,\n    's','s','u','p','e','r','i','o','r', 0,\n    't','s','u','p','e','r','i','o','r', 0,\n    'f','f', 0,\n    'f','f','i', 0,\n    'f','f','l', 0,\n    'p','a','r','e','n','l','e','f','t','i','n','f','e','r','i','o','r', 0,\n    'p','a','r','e','n','r','i','g','h','t','i','n','f','e','r','i','o','r', 0,\n    'C','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0,\n    'h','y','p','h','e','n','s','u','p','e','r','i','o','r', 0,\n    'G','r','a','v','e','s','m','a','l','l', 0,\n    'A','s','m','a','l','l', 0,\n    'B','s','m','a','l','l', 0,\n    'C','s','m','a','l','l', 0,\n    'D','s','m','a','l','l', 0,\n    'E','s','m','a','l','l', 0,\n    'F','s','m','a','l','l', 0,\n    'G','s','m','a','l','l', 0,\n    'H','s','m','a','l','l', 0,\n    'I','s','m','a','l','l', 0,\n    'J','s','m','a','l','l', 0,\n    'K','s','m','a','l','l', 0,\n    'L','s','m','a','l','l', 0,\n    'M','s','m','a','l','l', 0,\n    'N','s','m','a','l','l', 0,\n    'O','s','m','a','l','l', 0,\n    'P','s','m','a','l','l', 0,\n    'Q','s','m','a','l','l', 0,\n    'R','s','m','a','l','l', 0,\n    'S','s','m','a','l','l', 0,\n    'T','s','m','a','l','l', 0,\n    'U','s','m','a','l','l', 0,\n    'V','s','m','a','l','l', 0,\n    'W','s','m','a','l','l', 0,\n    'X','s','m','a','l','l', 0,\n    'Y','s','m','a','l','l', 0,\n    'Z','s','m','a','l','l', 0,\n    'c','o','l','o','n','m','o','n','e','t','a','r','y', 0,\n    'o','n','e','f','i','t','t','e','d', 0,\n    'r','u','p','i','a','h', 0,\n    'T','i','l','d','e','s','m','a','l','l', 0,\n    'e','x','c','l','a','m','d','o','w','n','s','m','a','l','l', 0,\n    'c','e','n','t','o','l','d','s','t','y','l','e', 0,\n    'L','s','l','a','s','h','s','m','a','l','l', 0,\n    'S','c','a','r','o','n','s','m','a','l','l', 0,\n    'Z','c','a','r','o','n','s','m','a','l','l', 0,\n    'D','i','e','r','e','s','i','s','s','m','a','l','l', 0,\n    'B','r','e','v','e','s','m','a','l','l', 0,\n    'C','a','r','o','n','s','m','a','l','l', 0,\n    'D','o','t','a','c','c','e','n','t','s','m','a','l','l', 0,\n    'M','a','c','r','o','n','s','m','a','l','l', 0,\n    'f','i','g','u','r','e','d','a','s','h', 0,\n    'h','y','p','h','e','n','i','n','f','e','r','i','o','r', 0,\n    'O','g','o','n','e','k','s','m','a','l','l', 0,\n    'R','i','n','g','s','m','a','l','l', 0,\n    'C','e','d','i','l','l','a','s','m','a','l','l', 0,\n    'q','u','e','s','t','i','o','n','d','o','w','n','s','m','a','l','l', 0,\n    'o','n','e','e','i','g','h','t','h', 0,\n    't','h','r','e','e','e','i','g','h','t','h','s', 0,\n    'f','i','v','e','e','i','g','h','t','h','s', 0,\n    's','e','v','e','n','e','i','g','h','t','h','s', 0,\n    'o','n','e','t','h','i','r','d', 0,\n    't','w','o','t','h','i','r','d','s', 0,\n    'z','e','r','o','s','u','p','e','r','i','o','r', 0,\n    'f','o','u','r','s','u','p','e','r','i','o','r', 0,\n    'f','i','v','e','s','u','p','e','r','i','o','r', 0,\n    's','i','x','s','u','p','e','r','i','o','r', 0,\n    's','e','v','e','n','s','u','p','e','r','i','o','r', 0,\n    'e','i','g','h','t','s','u','p','e','r','i','o','r', 0,\n    'n','i','n','e','s','u','p','e','r','i','o','r', 0,\n    'z','e','r','o','i','n','f','e','r','i','o','r', 0,\n    'o','n','e','i','n','f','e','r','i','o','r', 0,\n    't','w','o','i','n','f','e','r','i','o','r', 0,\n    't','h','r','e','e','i','n','f','e','r','i','o','r', 0,\n    'f','o','u','r','i','n','f','e','r','i','o','r', 0,\n    'f','i','v','e','i','n','f','e','r','i','o','r', 0,\n    's','i','x','i','n','f','e','r','i','o','r', 0,\n    's','e','v','e','n','i','n','f','e','r','i','o','r', 0,\n    'e','i','g','h','t','i','n','f','e','r','i','o','r', 0,\n    'n','i','n','e','i','n','f','e','r','i','o','r', 0,\n    'c','e','n','t','i','n','f','e','r','i','o','r', 0,\n    'd','o','l','l','a','r','i','n','f','e','r','i','o','r', 0,\n    'p','e','r','i','o','d','i','n','f','e','r','i','o','r', 0,\n    'c','o','m','m','a','i','n','f','e','r','i','o','r', 0,\n    'A','g','r','a','v','e','s','m','a','l','l', 0,\n    'A','a','c','u','t','e','s','m','a','l','l', 0,\n    'A','c','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0,\n    'A','t','i','l','d','e','s','m','a','l','l', 0,\n    'A','d','i','e','r','e','s','i','s','s','m','a','l','l', 0,\n    'A','r','i','n','g','s','m','a','l','l', 0,\n    'A','E','s','m','a','l','l', 0,\n    'C','c','e','d','i','l','l','a','s','m','a','l','l', 0,\n    'E','g','r','a','v','e','s','m','a','l','l', 0,\n    'E','a','c','u','t','e','s','m','a','l','l', 0,\n    'E','c','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0,\n    'E','d','i','e','r','e','s','i','s','s','m','a','l','l', 0,\n    'I','g','r','a','v','e','s','m','a','l','l', 0,\n    'I','a','c','u','t','e','s','m','a','l','l', 0,\n    'I','c','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0,\n    'I','d','i','e','r','e','s','i','s','s','m','a','l','l', 0,\n    'E','t','h','s','m','a','l','l', 0,\n    'N','t','i','l','d','e','s','m','a','l','l', 0,\n    'O','g','r','a','v','e','s','m','a','l','l', 0,\n    'O','a','c','u','t','e','s','m','a','l','l', 0,\n    'O','c','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0,\n    'O','t','i','l','d','e','s','m','a','l','l', 0,\n    'O','d','i','e','r','e','s','i','s','s','m','a','l','l', 0,\n    'O','E','s','m','a','l','l', 0,\n    'O','s','l','a','s','h','s','m','a','l','l', 0,\n    'U','g','r','a','v','e','s','m','a','l','l', 0,\n    'U','a','c','u','t','e','s','m','a','l','l', 0,\n    'U','c','i','r','c','u','m','f','l','e','x','s','m','a','l','l', 0,\n    'U','d','i','e','r','e','s','i','s','s','m','a','l','l', 0,\n    'Y','a','c','u','t','e','s','m','a','l','l', 0,\n    'T','h','o','r','n','s','m','a','l','l', 0,\n    'Y','d','i','e','r','e','s','i','s','s','m','a','l','l', 0,\n    '0','0','1','.','0','0','0', 0,\n    '0','0','1','.','0','0','1', 0,\n    '0','0','1','.','0','0','2', 0,\n    '0','0','1','.','0','0','3', 0,\n    'B','l','a','c','k', 0,\n    'B','o','l','d', 0,\n    'B','o','o','k', 0,\n    'L','i','g','h','t', 0,\n    'M','e','d','i','u','m', 0,\n    'R','e','g','u','l','a','r', 0,\n    'R','o','m','a','n', 0,\n    'S','e','m','i','b','o','l','d', 0,\n  };\n\n\n#define FT_NUM_MAC_NAMES  258\n\n  /* Values are offsets into the `ft_standard_glyph_names' table */\n\n  static const short  ft_mac_names[FT_NUM_MAC_NAMES] =\n  {\n     253,   0,   6, 261, 267, 274, 283, 294, 301, 309, 758, 330, 340, 351,\n     360, 365, 371, 378, 385, 391, 396, 400, 404, 410, 415, 420, 424, 430,\n     436, 441, 447, 457, 462, 468, 476, 485, 488, 490, 492, 494, 496, 498,\n     500, 502, 504, 506, 508, 510, 512, 514, 516, 518, 520, 522, 524, 526,\n     528, 530, 532, 534, 536, 538, 540, 552, 562, 575, 587, 979, 608, 610,\n     612, 614, 616, 618, 620, 622, 624, 626, 628, 630, 632, 634, 636, 638,\n     640, 642, 644, 646, 648, 650, 652, 654, 656, 658, 660, 670, 674, 685,\n    1375,1392,1405,1414,1486,1512,1562,1603,1632,1610,1622,1645,1639,1652,\n    1661,1690,1668,1680,1697,1726,1704,1716,1733,1740,1769,1747,1759,1776,\n    1790,1819,1797,1809, 839,1263, 707, 712, 741, 881, 871,1160,1302,1346,\n    1197, 985,1031,  23,1086,1108,  32,1219,  41,  51, 730,1194,  64,  76,\n      86,  94,  97,1089,1118, 106,1131,1150, 966, 696,1183, 112, 734, 120,\n     132, 783, 930, 945, 138,1385,1398,1529,1115,1157, 832,1079, 770, 916,\n     598, 319,1246, 155,1833,1586, 721, 749, 797, 811, 826, 829, 846, 856,\n     888, 903, 954,1363,1421,1356,1433,1443,1450,1457,1469,1479,1493,1500,\n     163,1522,1543,1550,1572,1134, 991,1002,1008,1015,1021,1040,1045,1053,\n    1066,1073,1101,1143,1536,1783,1596,1843,1253,1207,1319,1579,1826,1229,\n    1270,1313,1323,1171,1290,1332,1211,1235,1276, 169, 175, 182, 189, 200,\n     209, 218, 225, 232, 239, 246\n  };\n\n\n#define FT_NUM_SID_NAMES  391\n\n  /* Values are offsets into the `ft_standard_glyph_names' table */\n\n  static const short  ft_sid_names[FT_NUM_SID_NAMES] =\n  {\n     253, 261, 267, 274, 283, 294, 301, 309, 319, 330, 340, 351, 360, 365,\n     371, 378, 385, 391, 396, 400, 404, 410, 415, 420, 424, 430, 436, 441,\n     447, 457, 462, 468, 476, 485, 488, 490, 492, 494, 496, 498, 500, 502,\n     504, 506, 508, 510, 512, 514, 516, 518, 520, 522, 524, 526, 528, 530,\n     532, 534, 536, 538, 540, 552, 562, 575, 587, 598, 608, 610, 612, 614,\n     616, 618, 620, 622, 624, 626, 628, 630, 632, 634, 636, 638, 640, 642,\n     644, 646, 648, 650, 652, 654, 656, 658, 660, 670, 674, 685, 696, 707,\n     712, 721, 730, 734, 741, 749, 758, 770, 783, 797, 811, 826, 829, 832,\n     839, 846, 856, 871, 881, 888, 903, 916, 930, 945, 954, 966, 979, 985,\n     991,1002,1008,1015,1021,1031,1040,1045,1053,1066,1073,1079,1086,1089,\n    1101,1108,1115,1118,1131,1134,1143,1150,1157,1160,1171,1183,1194,1197,\n    1207,1211,1219,1229,1235,1246,1253,1263,1270,1276,1290,1302,1313,1319,\n    1323,1332,1346,1356,1363,1375,1385,1392,1398,1405,1414,1421,1433,1443,\n    1450,1457,1469,1479,1486,1493,1500,1512,1522,1529,1536,1543,1550,1562,\n    1572,1579,1586,1596,1603,1610,1622,1632,1639,1645,1652,1661,1668,1680,\n    1690,1697,1704,1716,1726,1733,1740,1747,1759,1769,1776,1783,1790,1797,\n    1809,1819,1826,1833,1843,1850,1862,1880,1895,1910,1925,1936,1954,1973,\n    1988,2003,2016,2028,2040,2054,2067,2080,2092,2106,2120,2133,2147,2167,\n    2182,2196,2206,2216,2229,2239,2249,2259,2269,2279,2289,2299,2309,2319,\n    2329,2332,2336,2340,2358,2377,2393,2408,2419,2426,2433,2440,2447,2454,\n    2461,2468,2475,2482,2489,2496,2503,2510,2517,2524,2531,2538,2545,2552,\n    2559,2566,2573,2580,2587,2594,2601,2615,2625,2632,2643,2659,2672,2684,\n    2696,2708,2722,2733,2744,2759,2771,2782,2797,2809,2819,2832,2850,2860,\n    2873,2885,2898,2907,2917,2930,2943,2956,2968,2982,2996,3009,3022,3034,\n    3046,3060,3073,3086,3098,3112,3126,3139,3152,3167,3182,3196,3208,3220,\n    3237,3249,3264,3275,3283,3297,3309,3321,3338,3353,3365,3377,3394,3409,\n    3418,3430,3442,3454,3471,3483,3498,3506,3518,3530,3542,3559,3574,3586,\n    3597,3612,3620,3628,3636,3644,3650,3655,3660,3666,3673,3681,3687\n  };\n\n\n  /* the following are indices into the SID name table */\n  static const unsigned short  t1_standard_encoding[256] =\n  {\n      0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\n      0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\n      1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,\n     17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,\n     33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,\n     49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,\n     65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,\n     81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,  0,\n      0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\n      0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\n      0, 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,\n      0,111,112,113,114,  0,115,116,117,118,119,120,121,122,  0,123,\n      0,124,125,126,127,128,129,130,131,  0,132,133,  0,134,135,136,\n    137,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\n      0,138,  0,139,  0,  0,  0,  0,140,141,142,143,  0,  0,  0,  0,\n      0,144,  0,  0,  0,145,  0,  0,146,147,148,149,  0,  0,  0,  0\n  };\n\n\n  /* the following are indices into the SID name table */\n  static const unsigned short  t1_expert_encoding[256] =\n  {\n      0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\n      0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\n      1,229,230,  0,231,232,233,234,235,236,237,238, 13, 14, 15, 99,\n    239,240,241,242,243,244,245,246,247,248, 27, 28,249,250,251,252,\n      0,253,254,255,256,257,  0,  0,  0,258,  0,  0,259,260,261,262,\n      0,  0,263,264,265,  0,266,109,110,267,268,269,  0,270,271,272,\n    273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,\n    289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,  0,\n      0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\n      0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,\n      0,304,305,306,  0,  0,307,308,309,310,311,  0,312,  0,  0,313,\n      0,  0,314,315,  0,  0,316,317,318,  0,  0,  0,158,155,163,319,\n    320,321,322,323,324,325,  0,  0,326,150,164,169,327,328,329,330,\n    331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,\n    347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,\n    363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378\n  };\n\n\n  /*\n   *  This table is a compressed version of the Adobe Glyph List (AGL),\n   *  optimized for efficient searching.  It has been generated by the\n   *  `glnames.py' python script located in the `src/tools' directory.\n   *\n   *  The lookup function to get the Unicode value for a given string\n   *  is defined below the table.\n   */\n\n#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST\n\n  static const unsigned char  ft_adobe_glyph_list[55997L] =\n  {\n      0, 52,  0,106,  2,167,  3, 63,  4,220,  6,125,  9,143, 10, 23,\n     11,137, 12,199, 14,246, 15, 87, 16,233, 17,219, 18,104, 19, 88,\n     22,110, 23, 32, 23, 71, 24, 77, 27,156, 29, 73, 31,247, 32,107,\n     32,222, 33, 55, 34,154, 35,218, 58, 10, 64,122, 72,188, 80,109,\n     88,104, 93, 61, 98,168,106, 91,114,111,115,237,122,180,127,255,\n    135,164,143,132,149,213,158,108,161,115,168,175,183,147,197,199,\n    202, 25,204,166,208,209,209, 81,215, 26, 65,143,  0, 65,  0,140,\n      0,175,  0,193,  1, 15,  1,147,  1,233,  1,251,  2,  7,  2, 40,\n      2, 57,  2, 82,  2, 91,  2,128,  2,136,  2,154, 69,131,  0,198,\n      0,150,  0,158,  0,167,225,227,245,244,101,128,  1,252,237,225,\n    227,242,239,110,128,  1,226,243,237,225,236,108,128,247,230,225,\n    227,245,244,101,129,  0,193,  0,185,243,237,225,236,108,128,247,\n    225,226,242,229,246,101,134,  1,  2,  0,213,  0,221,  0,232,  0,\n    243,  0,251,  1,  7,225,227,245,244,101,128, 30,174,227,249,242,\n    233,236,236,233, 99,128,  4,208,228,239,244,226,229,236,239,119,\n    128, 30,182,231,242,225,246,101,128, 30,176,232,239,239,235,225,\n    226,239,246,101,128, 30,178,244,233,236,228,101,128, 30,180, 99,\n      4,  1, 25,  1, 32,  1,121,  1,137,225,242,239,110,128,  1,205,\n    233,242, 99,  2,  1, 40,  1, 45,236,101,128, 36,182,245,237,230,\n    236,229,120,134,  0,194,  1, 66,  1, 74,  1, 85,  1, 93,  1,105,\n      1,113,225,227,245,244,101,128, 30,164,228,239,244,226,229,236,\n    239,119,128, 30,172,231,242,225,246,101,128, 30,166,232,239,239,\n    235,225,226,239,246,101,128, 30,168,243,237,225,236,108,128,247,\n    226,244,233,236,228,101,128, 30,170,245,244,101,129,246,201,  1,\n    129,243,237,225,236,108,128,247,180,249,242,233,236,236,233, 99,\n    128,  4, 16,100,  3,  1,155,  1,165,  1,209,226,236,231,242,225,\n    246,101,128,  2,  0,233,229,242,229,243,233,115,131,  0,196,  1,\n    181,  1,192,  1,201,227,249,242,233,236,236,233, 99,128,  4,210,\n    237,225,227,242,239,110,128,  1,222,243,237,225,236,108,128,247,\n    228,239,116,  2,  1,216,  1,224,226,229,236,239,119,128, 30,160,\n    237,225,227,242,239,110,128,  1,224,231,242,225,246,101,129,  0,\n    192,  1,243,243,237,225,236,108,128,247,224,232,239,239,235,225,\n    226,239,246,101,128, 30,162,105,  2,  2, 13,  2, 25,229,227,249,\n    242,233,236,236,233, 99,128,  4,212,238,246,229,242,244,229,228,\n    226,242,229,246,101,128,  2,  2,236,240,232, 97,129,  3,145,  2,\n     49,244,239,238,239,115,128,  3,134,109,  2,  2, 63,  2, 71,225,\n    227,242,239,110,128,  1,  0,239,238,239,243,240,225,227,101,128,\n    255, 33,239,231,239,238,229,107,128,  1,  4,242,233,238,103,131,\n      0,197,  2,104,  2,112,  2,120,225,227,245,244,101,128,  1,250,\n    226,229,236,239,119,128, 30,  0,243,237,225,236,108,128,247,229,\n    243,237,225,236,108,128,247, 97,244,233,236,228,101,129,  0,195,\n      2,146,243,237,225,236,108,128,247,227,249,226,225,242,237,229,\n    238,233,225,110,128,  5, 49, 66,137,  0, 66,  2,189,  2,198,  2,\n    223,  3,  3,  3, 10,  3, 22,  3, 34,  3, 46,  3, 54,227,233,242,\n    227,236,101,128, 36,183,228,239,116,  2,  2,206,  2,215,225,227,\n    227,229,238,116,128, 30,  2,226,229,236,239,119,128, 30,  4,101,\n      3,  2,231,  2,242,  2,254,227,249,242,233,236,236,233, 99,128,\n      4, 17,238,225,242,237,229,238,233,225,110,128,  5, 50,244, 97,\n    128,  3,146,232,239,239,107,128,  1,129,236,233,238,229,226,229,\n    236,239,119,128, 30,  6,237,239,238,239,243,240,225,227,101,128,\n    255, 34,242,229,246,229,243,237,225,236,108,128,246,244,243,237,\n    225,236,108,128,247, 98,244,239,240,226,225,114,128,  1,130, 67,\n    137,  0, 67,  3, 85,  3,127,  3,193,  3,210,  3,224,  4,171,  4,\n    188,  4,200,  4,212, 97,  3,  3, 93,  3,104,  3,111,225,242,237,\n    229,238,233,225,110,128,  5, 62,227,245,244,101,128,  1,  6,242,\n    239,110,129,246,202,  3,119,243,237,225,236,108,128,246,245, 99,\n      3,  3,135,  3,142,  3,171,225,242,239,110,128,  1, 12,229,228,\n    233,236,236, 97,130,  0,199,  3,155,  3,163,225,227,245,244,101,\n    128, 30,  8,243,237,225,236,108,128,247,231,233,242, 99,  2,  3,\n    179,  3,184,236,101,128, 36,184,245,237,230,236,229,120,128,  1,\n      8,228,239,116,129,  1, 10,  3,201,225,227,227,229,238,116,128,\n      1, 10,229,228,233,236,236,225,243,237,225,236,108,128,247,184,\n    104,  4,  3,234,  3,246,  4,161,  4,165,225,225,242,237,229,238,\n    233,225,110,128,  5, 73,101,  6,  4,  4,  4, 24,  4, 35,  4,103,\n      4,115,  4,136,225,226,235,232,225,243,233,225,238,227,249,242,\n    233,236,236,233, 99,128,  4,188,227,249,242,233,236,236,233, 99,\n    128,  4, 39,100,  2,  4, 41,  4, 85,229,243,227,229,238,228,229,\n    114,  2,  4, 54,  4, 74,225,226,235,232,225,243,233,225,238,227,\n    249,242,233,236,236,233, 99,128,  4,190,227,249,242,233,236,236,\n    233, 99,128,  4,182,233,229,242,229,243,233,243,227,249,242,233,\n    236,236,233, 99,128,  4,244,232,225,242,237,229,238,233,225,110,\n    128,  5, 67,235,232,225,235,225,243,243,233,225,238,227,249,242,\n    233,236,236,233, 99,128,  4,203,246,229,242,244,233,227,225,236,\n    243,244,242,239,235,229,227,249,242,233,236,236,233, 99,128,  4,\n    184,105,128,  3,167,239,239,107,128,  1,135,233,242,227,245,237,\n    230,236,229,248,243,237,225,236,108,128,246,246,237,239,238,239,\n    243,240,225,227,101,128,255, 35,239,225,242,237,229,238,233,225,\n    110,128,  5, 81,243,237,225,236,108,128,247, 99, 68,142,  0, 68,\n      4,252,  5, 10,  5, 36,  5, 96,  5,121,  5,166,  5,173,  5,231,\n      5,244,  6,  0,  6, 12,  6, 28,  6, 48,  6, 57, 90,129,  1,241,\n      5,  2,227,225,242,239,110,128,  1,196, 97,  2,  5, 16,  5, 27,\n    225,242,237,229,238,233,225,110,128,  5, 52,230,242,233,227,225,\n    110,128,  1,137, 99,  4,  5, 46,  5, 53,  5, 62,  5, 89,225,242,\n    239,110,128,  1, 14,229,228,233,236,236, 97,128, 30, 16,233,242,\n     99,  2,  5, 70,  5, 75,236,101,128, 36,185,245,237,230,236,229,\n    248,226,229,236,239,119,128, 30, 18,242,239,225,116,128,  1, 16,\n    228,239,116,  2,  5,104,  5,113,225,227,227,229,238,116,128, 30,\n     10,226,229,236,239,119,128, 30, 12,101,  3,  5,129,  5,140,  5,\n    150,227,249,242,233,236,236,233, 99,128,  4, 20,233,227,239,240,\n    244,233, 99,128,  3,238,236,244, 97,129, 34,  6,  5,158,231,242,\n    229,229,107,128,  3,148,232,239,239,107,128,  1,138,105,  2,  5,\n    179,  5,218,229,242,229,243,233,115,131,246,203,  5,194,  5,202,\n      5,210,193,227,245,244,101,128,246,204,199,242,225,246,101,128,\n    246,205,243,237,225,236,108,128,247,168,231,225,237,237,225,231,\n    242,229,229,107,128,  3,220,234,229,227,249,242,233,236,236,233,\n     99,128,  4,  2,236,233,238,229,226,229,236,239,119,128, 30, 14,\n    237,239,238,239,243,240,225,227,101,128,255, 36,239,244,225,227,\n    227,229,238,244,243,237,225,236,108,128,246,247,115,  2,  6, 34,\n      6, 41,236,225,243,104,128,  1, 16,237,225,236,108,128,247,100,\n    244,239,240,226,225,114,128,  1,139,122,131,  1,242,  6, 67,  6,\n     75,  6,112,227,225,242,239,110,128,  1,197,101,  2,  6, 81,  6,\n    101,225,226,235,232,225,243,233,225,238,227,249,242,233,236,236,\n    233, 99,128,  4,224,227,249,242,233,236,236,233, 99,128,  4,  5,\n    232,229,227,249,242,233,236,236,233, 99,128,  4, 15, 69,146,  0,\n     69,  6,165,  6,183,  6,191,  7, 89,  7,153,  7,165,  7,183,  7,\n    211,  8,  7,  8, 36,  8, 94,  8,169,  8,189,  8,208,  8,248,  9,\n     44,  9,109,  9,115,225,227,245,244,101,129,  0,201,  6,175,243,\n    237,225,236,108,128,247,233,226,242,229,246,101,128,  1, 20, 99,\n      5,  6,203,  6,210,  6,224,  6,236,  7, 79,225,242,239,110,128,\n      1, 26,229,228,233,236,236,225,226,242,229,246,101,128, 30, 28,\n    232,225,242,237,229,238,233,225,110,128,  5, 53,233,242, 99,  2,\n      6,244,  6,249,236,101,128, 36,186,245,237,230,236,229,120,135,\n      0,202,  7, 16,  7, 24,  7, 32,  7, 43,  7, 51,  7, 63,  7, 71,\n    225,227,245,244,101,128, 30,190,226,229,236,239,119,128, 30, 24,\n    228,239,244,226,229,236,239,119,128, 30,198,231,242,225,246,101,\n    128, 30,192,232,239,239,235,225,226,239,246,101,128, 30,194,243,\n    237,225,236,108,128,247,234,244,233,236,228,101,128, 30,196,249,\n    242,233,236,236,233, 99,128,  4,  4,100,  3,  7, 97,  7,107,  7,\n    127,226,236,231,242,225,246,101,128,  2,  4,233,229,242,229,243,\n    233,115,129,  0,203,  7,119,243,237,225,236,108,128,247,235,239,\n    116,130,  1, 22,  7,136,  7,145,225,227,227,229,238,116,128,  1,\n     22,226,229,236,239,119,128, 30,184,230,227,249,242,233,236,236,\n    233, 99,128,  4, 36,231,242,225,246,101,129,  0,200,  7,175,243,\n    237,225,236,108,128,247,232,104,  2,  7,189,  7,200,225,242,237,\n    229,238,233,225,110,128,  5, 55,239,239,235,225,226,239,246,101,\n    128, 30,186,105,  3,  7,219,  7,230,  7,245,231,232,244,242,239,\n    237,225,110,128, 33,103,238,246,229,242,244,229,228,226,242,229,\n    246,101,128,  2,  6,239,244,233,230,233,229,228,227,249,242,233,\n    236,236,233, 99,128,  4,100,108,  2,  8, 13,  8, 24,227,249,242,\n    233,236,236,233, 99,128,  4, 27,229,246,229,238,242,239,237,225,\n    110,128, 33,106,109,  3,  8, 44,  8, 72,  8, 83,225,227,242,239,\n    110,130,  1, 18,  8, 56,  8, 64,225,227,245,244,101,128, 30, 22,\n    231,242,225,246,101,128, 30, 20,227,249,242,233,236,236,233, 99,\n    128,  4, 28,239,238,239,243,240,225,227,101,128,255, 37,110,  4,\n      8,104,  8,115,  8,135,  8,154,227,249,242,233,236,236,233, 99,\n    128,  4, 29,228,229,243,227,229,238,228,229,242,227,249,242,233,\n    236,236,233, 99,128,  4,162,103,129,  1, 74,  8,141,232,229,227,\n    249,242,233,236,236,233, 99,128,  4,164,232,239,239,235,227,249,\n    242,233,236,236,233, 99,128,  4,199,111,  2,  8,175,  8,183,231,\n    239,238,229,107,128,  1, 24,240,229,110,128,  1,144,240,243,233,\n    236,239,110,129,  3,149,  8,200,244,239,238,239,115,128,  3,136,\n    114,  2,  8,214,  8,225,227,249,242,233,236,236,233, 99,128,  4,\n     32,229,246,229,242,243,229,100,129,  1,142,  8,237,227,249,242,\n    233,236,236,233, 99,128,  4, 45,115,  4,  9,  2,  9, 13,  9, 33,\n      9, 37,227,249,242,233,236,236,233, 99,128,  4, 33,228,229,243,\n    227,229,238,228,229,242,227,249,242,233,236,236,233, 99,128,  4,\n    170,104,128,  1,169,237,225,236,108,128,247,101,116,  3,  9, 52,\n      9, 78,  9, 92, 97,130,  3,151,  9, 60,  9, 70,242,237,229,238,\n    233,225,110,128,  5, 56,244,239,238,239,115,128,  3,137,104,129,\n      0,208,  9, 84,243,237,225,236,108,128,247,240,233,236,228,101,\n    129, 30,188,  9,101,226,229,236,239,119,128, 30, 26,245,242,111,\n    128, 32,172,250,104,130,  1,183,  9,124,  9,132,227,225,242,239,\n    110,128,  1,238,242,229,246,229,242,243,229,100,128,  1,184, 70,\n    136,  0, 70,  9,163,  9,172,  9,184,  9,212,  9,219,  9,248, 10,\n      4, 10, 15,227,233,242,227,236,101,128, 36,187,228,239,244,225,\n    227,227,229,238,116,128, 30, 30,101,  2,  9,190,  9,202,232,225,\n    242,237,229,238,233,225,110,128,  5, 86,233,227,239,240,244,233,\n     99,128,  3,228,232,239,239,107,128,  1,145,105,  2,  9,225,  9,\n    238,244,225,227,249,242,233,236,236,233, 99,128,  4,114,246,229,\n    242,239,237,225,110,128, 33,100,237,239,238,239,243,240,225,227,\n    101,128,255, 38,239,245,242,242,239,237,225,110,128, 33, 99,243,\n    237,225,236,108,128,247,102, 71,140,  0, 71, 10, 51, 10, 61, 10,\n    107, 10,115, 10,176, 10,193, 10,205, 11, 39, 11, 52, 11, 65, 11,\n     90, 11,107,194,243,241,245,225,242,101,128, 51,135, 97,  3, 10,\n     69, 10, 76, 10, 94,227,245,244,101,128,  1,244,237,237, 97,129,\n      3,147, 10, 84,225,230,242,233,227,225,110,128,  1,148,238,231,\n    233,225,227,239,240,244,233, 99,128,  3,234,226,242,229,246,101,\n    128,  1, 30, 99,  4, 10,125, 10,132, 10,141, 10,163,225,242,239,\n    110,128,  1,230,229,228,233,236,236, 97,128,  1, 34,233,242, 99,\n      2, 10,149, 10,154,236,101,128, 36,188,245,237,230,236,229,120,\n    128,  1, 28,239,237,237,225,225,227,227,229,238,116,128,  1, 34,\n    228,239,116,129,  1, 32, 10,184,225,227,227,229,238,116,128,  1,\n     32,229,227,249,242,233,236,236,233, 99,128,  4, 19,104,  3, 10,\n    213, 10,226, 11, 33,225,228,225,242,237,229,238,233,225,110,128,\n      5, 66,101,  3, 10,234, 10,255, 11, 16,237,233,228,228,236,229,\n    232,239,239,235,227,249,242,233,236,236,233, 99,128,  4,148,243,\n    244,242,239,235,229,227,249,242,233,236,236,233, 99,128,  4,146,\n    245,240,244,245,242,238,227,249,242,233,236,236,233, 99,128,  4,\n    144,239,239,107,128,  1,147,233,237,225,242,237,229,238,233,225,\n    110,128,  5, 51,234,229,227,249,242,233,236,236,233, 99,128,  4,\n      3,109,  2, 11, 71, 11, 79,225,227,242,239,110,128, 30, 32,239,\n    238,239,243,240,225,227,101,128,255, 39,242,225,246,101,129,246,\n    206, 11, 99,243,237,225,236,108,128,247, 96,115,  2, 11,113, 11,\n    129,237,225,236,108,129,247,103, 11,122,232,239,239,107,128,  2,\n    155,244,242,239,235,101,128,  1,228, 72,140,  0, 72, 11,165, 11,\n    190, 11,198, 11,208, 12, 17, 12, 40, 12, 77, 12,117, 12,129, 12,\n    157, 12,165, 12,189,177,184, 53,  3, 11,175, 11,180, 11,185,179,\n     51,128, 37,207,180, 51,128, 37,170,181, 49,128, 37,171,178,178,\n    176,183, 51,128, 37,161,208,243,241,245,225,242,101,128, 51,203,\n     97,  3, 11,216, 11,236, 12,  0,225,226,235,232,225,243,233,225,\n    238,227,249,242,233,236,236,233, 99,128,  4,168,228,229,243,227,\n    229,238,228,229,242,227,249,242,233,236,236,233, 99,128,  4,178,\n    242,228,243,233,231,238,227,249,242,233,236,236,233, 99,128,  4,\n     42, 98,  2, 12, 23, 12, 28,225,114,128,  1, 38,242,229,246,229,\n    226,229,236,239,119,128, 30, 42, 99,  2, 12, 46, 12, 55,229,228,\n    233,236,236, 97,128, 30, 40,233,242, 99,  2, 12, 63, 12, 68,236,\n    101,128, 36,189,245,237,230,236,229,120,128,  1, 36,100,  2, 12,\n     83, 12, 93,233,229,242,229,243,233,115,128, 30, 38,239,116,  2,\n     12,100, 12,109,225,227,227,229,238,116,128, 30, 34,226,229,236,\n    239,119,128, 30, 36,237,239,238,239,243,240,225,227,101,128,255,\n     40,111,  2, 12,135, 12,146,225,242,237,229,238,233,225,110,128,\n      5, 64,242,233,227,239,240,244,233, 99,128,  3,232,243,237,225,\n    236,108,128,247,104,245,238,231,225,242,245,237,236,225,245,116,\n    129,246,207, 12,181,243,237,225,236,108,128,246,248,250,243,241,\n    245,225,242,101,128, 51,144, 73,146,  0, 73, 12,239, 12,251, 12,\n    255, 13, 11, 13, 29, 13, 37, 13, 94, 13,181, 13,214, 13,224, 13,\n    242, 13,254, 14, 48, 14, 86, 14, 99, 14,166, 14,187, 14,205,193,\n    227,249,242,233,236,236,233, 99,128,  4, 47, 74,128,  1, 50,213,\n    227,249,242,233,236,236,233, 99,128,  4, 46,225,227,245,244,101,\n    129,  0,205, 13, 21,243,237,225,236,108,128,247,237,226,242,229,\n    246,101,128,  1, 44, 99,  3, 13, 45, 13, 52, 13, 84,225,242,239,\n    110,128,  1,207,233,242, 99,  2, 13, 60, 13, 65,236,101,128, 36,\n    190,245,237,230,236,229,120,129,  0,206, 13, 76,243,237,225,236,\n    108,128,247,238,249,242,233,236,236,233, 99,128,  4,  6,100,  3,\n     13,102, 13,112, 13,155,226,236,231,242,225,246,101,128,  2,  8,\n    233,229,242,229,243,233,115,131,  0,207, 13,128, 13,136, 13,147,\n    225,227,245,244,101,128, 30, 46,227,249,242,233,236,236,233, 99,\n    128,  4,228,243,237,225,236,108,128,247,239,239,116,130,  1, 48,\n     13,164, 13,173,225,227,227,229,238,116,128,  1, 48,226,229,236,\n    239,119,128, 30,202,101,  2, 13,187, 13,203,226,242,229,246,229,\n    227,249,242,233,236,236,233, 99,128,  4,214,227,249,242,233,236,\n    236,233, 99,128,  4, 21,230,242,225,235,244,245,114,128, 33, 17,\n    231,242,225,246,101,129,  0,204, 13,234,243,237,225,236,108,128,\n    247,236,232,239,239,235,225,226,239,246,101,128, 30,200,105,  3,\n     14,  6, 14, 17, 14, 32,227,249,242,233,236,236,233, 99,128,  4,\n     24,238,246,229,242,244,229,228,226,242,229,246,101,128,  2, 10,\n    243,232,239,242,244,227,249,242,233,236,236,233, 99,128,  4, 25,\n    109,  2, 14, 54, 14, 75,225,227,242,239,110,129,  1, 42, 14, 64,\n    227,249,242,233,236,236,233, 99,128,  4,226,239,238,239,243,240,\n    225,227,101,128,255, 41,238,233,225,242,237,229,238,233,225,110,\n    128,  5, 59,111,  3, 14,107, 14,118, 14,126,227,249,242,233,236,\n    236,233, 99,128,  4,  1,231,239,238,229,107,128,  1, 46,244, 97,\n    131,  3,153, 14,137, 14,147, 14,158,225,230,242,233,227,225,110,\n    128,  1,150,228,233,229,242,229,243,233,115,128,  3,170,244,239,\n    238,239,115,128,  3,138,115,  2, 14,172, 14,179,237,225,236,108,\n    128,247,105,244,242,239,235,101,128,  1,151,244,233,236,228,101,\n    129,  1, 40, 14,197,226,229,236,239,119,128, 30, 44,250,232,233,\n    244,243, 97,  2, 14,216, 14,227,227,249,242,233,236,236,233, 99,\n    128,  4,116,228,226,236,231,242,225,246,229,227,249,242,233,236,\n    236,233, 99,128,  4,118, 74,134,  0, 74, 15,  6, 15, 18, 15, 41,\n     15, 53, 15, 67, 15, 79,225,225,242,237,229,238,233,225,110,128,\n      5, 65,227,233,242, 99,  2, 15, 27, 15, 32,236,101,128, 36,191,\n    245,237,230,236,229,120,128,  1, 52,229,227,249,242,233,236,236,\n    233, 99,128,  4,  8,232,229,232,225,242,237,229,238,233,225,110,\n    128,  5, 75,237,239,238,239,243,240,225,227,101,128,255, 42,243,\n    237,225,236,108,128,247,106, 75,140,  0, 75, 15,115, 15,125, 15,\n    135, 16, 18, 16, 65, 16, 76, 16,106, 16,143, 16,156, 16,168, 16,\n    180, 16,208,194,243,241,245,225,242,101,128, 51,133,203,243,241,\n    245,225,242,101,128, 51,205, 97,  7, 15,151, 15,169, 15,191, 15,\n    211, 15,226, 15,232, 15,249,226,225,243,232,235,233,242,227,249,\n    242,233,236,236,233, 99,128,  4,160, 99,  2, 15,175, 15,181,245,\n    244,101,128, 30, 48,249,242,233,236,236,233, 99,128,  4, 26,228,\n    229,243,227,229,238,228,229,242,227,249,242,233,236,236,233, 99,\n    128,  4,154,232,239,239,235,227,249,242,233,236,236,233, 99,128,\n      4,195,240,240, 97,128,  3,154,243,244,242,239,235,229,227,249,\n    242,233,236,236,233, 99,128,  4,158,246,229,242,244,233,227,225,\n    236,243,244,242,239,235,229,227,249,242,233,236,236,233, 99,128,\n      4,156, 99,  4, 16, 28, 16, 35, 16, 44, 16, 52,225,242,239,110,\n    128,  1,232,229,228,233,236,236, 97,128,  1, 54,233,242,227,236,\n    101,128, 36,192,239,237,237,225,225,227,227,229,238,116,128,  1,\n     54,228,239,244,226,229,236,239,119,128, 30, 50,101,  2, 16, 82,\n     16, 94,232,225,242,237,229,238,233,225,110,128,  5, 84,238,225,\n    242,237,229,238,233,225,110,128,  5, 63,104,  3, 16,114, 16,126,\n     16,137,225,227,249,242,233,236,236,233, 99,128,  4, 37,229,233,\n    227,239,240,244,233, 99,128,  3,230,239,239,107,128,  1,152,234,\n    229,227,249,242,233,236,236,233, 99,128,  4, 12,236,233,238,229,\n    226,229,236,239,119,128, 30, 52,237,239,238,239,243,240,225,227,\n    101,128,255, 43,239,240,240, 97,  2, 16,189, 16,200,227,249,242,\n    233,236,236,233, 99,128,  4,128,231,242,229,229,107,128,  3,222,\n    115,  2, 16,214, 16,226,233,227,249,242,233,236,236,233, 99,128,\n      4,110,237,225,236,108,128,247,107, 76,138,  0, 76, 17,  1, 17,\n      5, 17,  9, 17, 29, 17, 95, 17,133, 17,147, 17,165, 17,177, 17,\n    189, 74,128,  1,199, 76,128,246,191, 97,  2, 17, 15, 17, 22,227,\n    245,244,101,128,  1, 57,237,226,228, 97,128,  3,155, 99,  4, 17,\n     39, 17, 46, 17, 55, 17, 82,225,242,239,110,128,  1, 61,229,228,\n    233,236,236, 97,128,  1, 59,233,242, 99,  2, 17, 63, 17, 68,236,\n    101,128, 36,193,245,237,230,236,229,248,226,229,236,239,119,128,\n     30, 60,239,237,237,225,225,227,227,229,238,116,128,  1, 59,228,\n    239,116,130,  1, 63, 17,105, 17,114,225,227,227,229,238,116,128,\n      1, 63,226,229,236,239,119,129, 30, 54, 17,124,237,225,227,242,\n    239,110,128, 30, 56,233,247,238,225,242,237,229,238,233,225,110,\n    128,  5, 60,106,129,  1,200, 17,153,229,227,249,242,233,236,236,\n    233, 99,128,  4,  9,236,233,238,229,226,229,236,239,119,128, 30,\n     58,237,239,238,239,243,240,225,227,101,128,255, 44,115,  2, 17,\n    195, 17,212,236,225,243,104,129,  1, 65, 17,204,243,237,225,236,\n    108,128,246,249,237,225,236,108,128,247,108, 77,137,  0, 77, 17,\n    241, 17,251, 18, 24, 18, 33, 18, 58, 18, 71, 18, 83, 18, 91, 18,\n    100,194,243,241,245,225,242,101,128, 51,134,225, 99,  2, 18,  2,\n     18, 18,242,239,110,129,246,208, 18, 10,243,237,225,236,108,128,\n    247,175,245,244,101,128, 30, 62,227,233,242,227,236,101,128, 36,\n    194,228,239,116,  2, 18, 41, 18, 50,225,227,227,229,238,116,128,\n     30, 64,226,229,236,239,119,128, 30, 66,229,238,225,242,237,229,\n    238,233,225,110,128,  5, 68,237,239,238,239,243,240,225,227,101,\n    128,255, 45,243,237,225,236,108,128,247,109,244,245,242,238,229,\n    100,128,  1,156,117,128,  3,156, 78,141,  0, 78, 18,134, 18,138,\n     18,146, 18,212, 18,237, 18,248, 19,  3, 19, 21, 19, 33, 19, 45,\n     19, 58, 19, 66, 19, 84, 74,128,  1,202,225,227,245,244,101,128,\n      1, 67, 99,  4, 18,156, 18,163, 18,172, 18,199,225,242,239,110,\n    128,  1, 71,229,228,233,236,236, 97,128,  1, 69,233,242, 99,  2,\n     18,180, 18,185,236,101,128, 36,195,245,237,230,236,229,248,226,\n    229,236,239,119,128, 30, 74,239,237,237,225,225,227,227,229,238,\n    116,128,  1, 69,228,239,116,  2, 18,220, 18,229,225,227,227,229,\n    238,116,128, 30, 68,226,229,236,239,119,128, 30, 70,232,239,239,\n    235,236,229,230,116,128,  1,157,233,238,229,242,239,237,225,110,\n    128, 33,104,106,129,  1,203, 19,  9,229,227,249,242,233,236,236,\n    233, 99,128,  4, 10,236,233,238,229,226,229,236,239,119,128, 30,\n     72,237,239,238,239,243,240,225,227,101,128,255, 46,239,247,225,\n    242,237,229,238,233,225,110,128,  5, 70,243,237,225,236,108,128,\n    247,110,244,233,236,228,101,129,  0,209, 19, 76,243,237,225,236,\n    108,128,247,241,117,128,  3,157, 79,141,  0, 79, 19,118, 19,132,\n     19,150, 19,203, 20, 78, 20,152, 20,187, 21, 48, 21, 69, 21,213,\n     21,223, 21,254, 22, 53, 69,129,  1, 82, 19,124,243,237,225,236,\n    108,128,246,250,225,227,245,244,101,129,  0,211, 19,142,243,237,\n    225,236,108,128,247,243, 98,  2, 19,156, 19,196,225,242,242,229,\n    100,  2, 19,166, 19,177,227,249,242,233,236,236,233, 99,128,  4,\n    232,228,233,229,242,229,243,233,243,227,249,242,233,236,236,233,\n     99,128,  4,234,242,229,246,101,128,  1, 78, 99,  4, 19,213, 19,\n    220, 19,235, 20, 68,225,242,239,110,128,  1,209,229,238,244,229,\n    242,229,228,244,233,236,228,101,128,  1,159,233,242, 99,  2, 19,\n    243, 19,248,236,101,128, 36,196,245,237,230,236,229,120,134,  0,\n    212, 20, 13, 20, 21, 20, 32, 20, 40, 20, 52, 20, 60,225,227,245,\n    244,101,128, 30,208,228,239,244,226,229,236,239,119,128, 30,216,\n    231,242,225,246,101,128, 30,210,232,239,239,235,225,226,239,246,\n    101,128, 30,212,243,237,225,236,108,128,247,244,244,233,236,228,\n    101,128, 30,214,249,242,233,236,236,233, 99,128,  4, 30,100,  3,\n     20, 86, 20,109, 20,142,226,108,  2, 20, 93, 20,101,225,227,245,\n    244,101,128,  1, 80,231,242,225,246,101,128,  2, 12,233,229,242,\n    229,243,233,115,130,  0,214, 20,123, 20,134,227,249,242,233,236,\n    236,233, 99,128,  4,230,243,237,225,236,108,128,247,246,239,244,\n    226,229,236,239,119,128, 30,204,103,  2, 20,158, 20,170,239,238,\n    229,235,243,237,225,236,108,128,246,251,242,225,246,101,129,  0,\n    210, 20,179,243,237,225,236,108,128,247,242,104,  4, 20,197, 20,\n    208, 20,212, 21, 34,225,242,237,229,238,233,225,110,128,  5, 85,\n    109,128, 33, 38,111,  2, 20,218, 20,228,239,235,225,226,239,246,\n    101,128, 30,206,242,110,133,  1,160, 20,243, 20,251, 21,  6, 21,\n     14, 21, 26,225,227,245,244,101,128, 30,218,228,239,244,226,229,\n    236,239,119,128, 30,226,231,242,225,246,101,128, 30,220,232,239,\n    239,235,225,226,239,246,101,128, 30,222,244,233,236,228,101,128,\n     30,224,245,238,231,225,242,245,237,236,225,245,116,128,  1, 80,\n    105,129,  1,162, 21, 54,238,246,229,242,244,229,228,226,242,229,\n    246,101,128,  2, 14,109,  4, 21, 79, 21,107, 21,184, 21,202,225,\n    227,242,239,110,130,  1, 76, 21, 91, 21, 99,225,227,245,244,101,\n    128, 30, 82,231,242,225,246,101,128, 30, 80,229,231, 97,132, 33,\n     38, 21,121, 21,132, 21,140, 21,156,227,249,242,233,236,236,233,\n     99,128,  4, 96,231,242,229,229,107,128,  3,169,242,239,245,238,\n    228,227,249,242,233,236,236,233, 99,128,  4,122,116,  2, 21,162,\n     21,177,233,244,236,239,227,249,242,233,236,236,233, 99,128,  4,\n    124,239,238,239,115,128,  3,143,233,227,242,239,110,129,  3,159,\n     21,194,244,239,238,239,115,128,  3,140,239,238,239,243,240,225,\n    227,101,128,255, 47,238,229,242,239,237,225,110,128, 33, 96,111,\n      2, 21,229, 21,248,231,239,238,229,107,129,  1,234, 21,239,237,\n    225,227,242,239,110,128,  1,236,240,229,110,128,  1,134,115,  3,\n     22,  6, 22, 33, 22, 40,236,225,243,104,130,  0,216, 22, 17, 22,\n     25,225,227,245,244,101,128,  1,254,243,237,225,236,108,128,247,\n    248,237,225,236,108,128,247,111,244,242,239,235,229,225,227,245,\n    244,101,128,  1,254,116,  2, 22, 59, 22, 70,227,249,242,233,236,\n    236,233, 99,128,  4,126,233,236,228,101,131,  0,213, 22, 83, 22,\n     91, 22,102,225,227,245,244,101,128, 30, 76,228,233,229,242,229,\n    243,233,115,128, 30, 78,243,237,225,236,108,128,247,245, 80,136,\n      0, 80, 22,130, 22,138, 22,147, 22,159, 22,211, 22,227, 22,246,\n     23,  2,225,227,245,244,101,128, 30, 84,227,233,242,227,236,101,\n    128, 36,197,228,239,244,225,227,227,229,238,116,128, 30, 86,101,\n      3, 22,167, 22,178, 22,190,227,249,242,233,236,236,233, 99,128,\n      4, 31,232,225,242,237,229,238,233,225,110,128,  5, 74,237,233,\n    228,228,236,229,232,239,239,235,227,249,242,233,236,236,233, 99,\n    128,  4,166,104,  2, 22,217, 22,221,105,128,  3,166,239,239,107,\n    128,  1,164,105,129,  3,160, 22,233,247,242,225,242,237,229,238,\n    233,225,110,128,  5, 83,237,239,238,239,243,240,225,227,101,128,\n    255, 48,115,  2, 23,  8, 23, 25,105,129,  3,168, 23, 14,227,249,\n    242,233,236,236,233, 99,128,  4,112,237,225,236,108,128,247,112,\n     81,131,  0, 81, 23, 42, 23, 51, 23, 63,227,233,242,227,236,101,\n    128, 36,198,237,239,238,239,243,240,225,227,101,128,255, 49,243,\n    237,225,236,108,128,247,113, 82,138,  0, 82, 23, 95, 23,119, 23,\n    166, 23,217, 23,230, 23,240, 23,245, 24, 19, 24, 31, 24, 43, 97,\n      2, 23,101, 23,112,225,242,237,229,238,233,225,110,128,  5, 76,\n    227,245,244,101,128,  1, 84, 99,  4, 23,129, 23,136, 23,145, 23,\n    153,225,242,239,110,128,  1, 88,229,228,233,236,236, 97,128,  1,\n     86,233,242,227,236,101,128, 36,199,239,237,237,225,225,227,227,\n    229,238,116,128,  1, 86,100,  2, 23,172, 23,182,226,236,231,242,\n    225,246,101,128,  2, 16,239,116,  2, 23,189, 23,198,225,227,227,\n    229,238,116,128, 30, 88,226,229,236,239,119,129, 30, 90, 23,208,\n    237,225,227,242,239,110,128, 30, 92,229,232,225,242,237,229,238,\n    233,225,110,128,  5, 80,230,242,225,235,244,245,114,128, 33, 28,\n    232,111,128,  3,161,233,110,  2, 23,252, 24,  5,231,243,237,225,\n    236,108,128,246,252,246,229,242,244,229,228,226,242,229,246,101,\n    128,  2, 18,236,233,238,229,226,229,236,239,119,128, 30, 94,237,\n    239,238,239,243,240,225,227,101,128,255, 50,243,237,225,236,108,\n    129,247,114, 24, 53,233,238,246,229,242,244,229,100,129,  2,129,\n     24, 66,243,245,240,229,242,233,239,114,128,  2,182, 83,139,  0,\n     83, 24,103, 26, 17, 26, 55, 26,182, 26,221, 26,250, 27, 84, 27,\n    105, 27,117, 27,135, 27,143, 70,  6, 24,117, 24,209, 24,241, 25,\n     77, 25,119, 25,221, 48,  9, 24,137, 24,145, 24,153, 24,161, 24,\n    169, 24,177, 24,185, 24,193, 24,201,177,176,176,176, 48,128, 37,\n     12,178,176,176,176, 48,128, 37, 20,179,176,176,176, 48,128, 37,\n     16,180,176,176,176, 48,128, 37, 24,181,176,176,176, 48,128, 37,\n     60,182,176,176,176, 48,128, 37, 44,183,176,176,176, 48,128, 37,\n     52,184,176,176,176, 48,128, 37, 28,185,176,176,176, 48,128, 37,\n     36, 49,  3, 24,217, 24,225, 24,233,176,176,176,176, 48,128, 37,\n      0,177,176,176,176, 48,128, 37,  2,185,176,176,176, 48,128, 37,\n     97, 50,  9, 25,  5, 25, 13, 25, 21, 25, 29, 25, 37, 25, 45, 25,\n     53, 25, 61, 25, 69,176,176,176,176, 48,128, 37, 98,177,176,176,\n    176, 48,128, 37, 86,178,176,176,176, 48,128, 37, 85,179,176,176,\n    176, 48,128, 37, 99,180,176,176,176, 48,128, 37, 81,181,176,176,\n    176, 48,128, 37, 87,182,176,176,176, 48,128, 37, 93,183,176,176,\n    176, 48,128, 37, 92,184,176,176,176, 48,128, 37, 91, 51,  4, 25,\n     87, 25, 95, 25,103, 25,111,182,176,176,176, 48,128, 37, 94,183,\n    176,176,176, 48,128, 37, 95,184,176,176,176, 48,128, 37, 90,185,\n    176,176,176, 48,128, 37, 84, 52, 10, 25,141, 25,149, 25,157, 25,\n    165, 25,173, 25,181, 25,189, 25,197, 25,205, 25,213,176,176,176,\n    176, 48,128, 37,105,177,176,176,176, 48,128, 37,102,178,176,176,\n    176, 48,128, 37, 96,179,176,176,176, 48,128, 37, 80,180,176,176,\n    176, 48,128, 37,108,181,176,176,176, 48,128, 37,103,182,176,176,\n    176, 48,128, 37,104,183,176,176,176, 48,128, 37,100,184,176,176,\n    176, 48,128, 37,101,185,176,176,176, 48,128, 37, 89, 53,  5, 25,\n    233, 25,241, 25,249, 26,  1, 26,  9,176,176,176,176, 48,128, 37,\n     88,177,176,176,176, 48,128, 37, 82,178,176,176,176, 48,128, 37,\n     83,179,176,176,176, 48,128, 37,107,180,176,176,176, 48,128, 37,\n    106, 97,  2, 26, 23, 26, 44,227,245,244,101,129,  1, 90, 26, 32,\n    228,239,244,225,227,227,229,238,116,128, 30,100,237,240,233,231,\n    242,229,229,107,128,  3,224, 99,  5, 26, 67, 26, 98, 26,107, 26,\n    147, 26,169,225,242,239,110,130,  1, 96, 26, 78, 26, 90,228,239,\n    244,225,227,227,229,238,116,128, 30,102,243,237,225,236,108,128,\n    246,253,229,228,233,236,236, 97,128,  1, 94,232,247, 97,130,  1,\n    143, 26,117, 26,128,227,249,242,233,236,236,233, 99,128,  4,216,\n    228,233,229,242,229,243,233,243,227,249,242,233,236,236,233, 99,\n    128,  4,218,233,242, 99,  2, 26,155, 26,160,236,101,128, 36,200,\n    245,237,230,236,229,120,128,  1, 92,239,237,237,225,225,227,227,\n    229,238,116,128,  2, 24,228,239,116,  2, 26,190, 26,199,225,227,\n    227,229,238,116,128, 30, 96,226,229,236,239,119,129, 30, 98, 26,\n    209,228,239,244,225,227,227,229,238,116,128, 30,104,101,  2, 26,\n    227, 26,239,232,225,242,237,229,238,233,225,110,128,  5, 77,246,\n    229,238,242,239,237,225,110,128, 33,102,104,  5, 27,  6, 27, 34,\n     27, 48, 27, 59, 27, 72, 97,  2, 27, 12, 27, 23,225,242,237,229,\n    238,233,225,110,128,  5, 71,227,249,242,233,236,236,233, 99,128,\n      4, 40,227,232,225,227,249,242,233,236,236,233, 99,128,  4, 41,\n    229,233,227,239,240,244,233, 99,128,  3,226,232,225,227,249,242,\n    233,236,236,233, 99,128,  4,186,233,237,225,227,239,240,244,233,\n     99,128,  3,236,105,  2, 27, 90, 27, 96,231,237, 97,128,  3,163,\n    248,242,239,237,225,110,128, 33,101,237,239,238,239,243,240,225,\n    227,101,128,255, 51,239,230,244,243,233,231,238,227,249,242,233,\n    236,236,233, 99,128,  4, 44,243,237,225,236,108,128,247,115,244,\n    233,231,237,225,231,242,229,229,107,128,  3,218, 84,141,  0, 84,\n     27,186, 27,191, 27,197, 28,  7, 28, 32, 28, 96, 28,147, 28,177,\n     28,189, 28,201, 28,246, 29,  6, 29, 46,225,117,128,  3,164,226,\n    225,114,128,  1,102, 99,  4, 27,207, 27,214, 27,223, 27,250,225,\n    242,239,110,128,  1,100,229,228,233,236,236, 97,128,  1, 98,233,\n    242, 99,  2, 27,231, 27,236,236,101,128, 36,201,245,237,230,236,\n    229,248,226,229,236,239,119,128, 30,112,239,237,237,225,225,227,\n    227,229,238,116,128,  1, 98,228,239,116,  2, 28, 15, 28, 24,225,\n    227,227,229,238,116,128, 30,106,226,229,236,239,119,128, 30,108,\n    101,  4, 28, 42, 28, 53, 28, 73, 28, 82,227,249,242,233,236,236,\n    233, 99,128,  4, 34,228,229,243,227,229,238,228,229,242,227,249,\n    242,233,236,236,233, 99,128,  4,172,238,242,239,237,225,110,128,\n     33,105,244,243,229,227,249,242,233,236,236,233, 99,128,  4,180,\n    104,  3, 28,104, 28,110, 28,136,229,244, 97,128,  3,152,111,  2,\n     28,116, 28,121,239,107,128,  1,172,242,110,129,  0,222, 28,128,\n    243,237,225,236,108,128,247,254,242,229,229,242,239,237,225,110,\n    128, 33, 98,105,  2, 28,153, 28,164,236,228,229,243,237,225,236,\n    108,128,246,254,247,238,225,242,237,229,238,233,225,110,128,  5,\n     79,236,233,238,229,226,229,236,239,119,128, 30,110,237,239,238,\n    239,243,240,225,227,101,128,255, 52,111,  2, 28,207, 28,218,225,\n    242,237,229,238,233,225,110,128,  5, 57,238,101,  3, 28,227, 28,\n    234, 28,240,230,233,246,101,128,  1,188,243,233,120,128,  1,132,\n    244,247,111,128,  1,167,242,229,244,242,239,230,236,229,248,232,\n    239,239,107,128,  1,174,115,  3, 29, 14, 29, 26, 29, 39,229,227,\n    249,242,233,236,236,233, 99,128,  4, 38,232,229,227,249,242,233,\n    236,236,233, 99,128,  4, 11,237,225,236,108,128,247,116,119,  2,\n     29, 52, 29, 64,229,236,246,229,242,239,237,225,110,128, 33,107,\n    239,242,239,237,225,110,128, 33, 97, 85,142,  0, 85, 29,105, 29,\n    123, 29,131, 29,198, 30, 69, 30, 87, 30,198, 30,214, 30,226, 31,\n     21, 31, 30, 31,142, 31,149, 31,219,225,227,245,244,101,129,  0,\n    218, 29,115,243,237,225,236,108,128,247,250,226,242,229,246,101,\n    128,  1,108, 99,  3, 29,139, 29,146, 29,188,225,242,239,110,128,\n      1,211,233,242, 99,  2, 29,154, 29,159,236,101,128, 36,202,245,\n    237,230,236,229,120,130,  0,219, 29,172, 29,180,226,229,236,239,\n    119,128, 30,118,243,237,225,236,108,128,247,251,249,242,233,236,\n    236,233, 99,128,  4, 35,100,  3, 29,206, 29,229, 30, 59,226,108,\n      2, 29,213, 29,221,225,227,245,244,101,128,  1,112,231,242,225,\n    246,101,128,  2, 20,233,229,242,229,243,233,115,134,  0,220, 29,\n    251, 30,  3, 30, 11, 30, 34, 30, 42, 30, 51,225,227,245,244,101,\n    128,  1,215,226,229,236,239,119,128, 30,114, 99,  2, 30, 17, 30,\n     24,225,242,239,110,128,  1,217,249,242,233,236,236,233, 99,128,\n      4,240,231,242,225,246,101,128,  1,219,237,225,227,242,239,110,\n    128,  1,213,243,237,225,236,108,128,247,252,239,244,226,229,236,\n    239,119,128, 30,228,231,242,225,246,101,129,  0,217, 30, 79,243,\n    237,225,236,108,128,247,249,104,  2, 30, 93, 30,171,111,  2, 30,\n     99, 30,109,239,235,225,226,239,246,101,128, 30,230,242,110,133,\n      1,175, 30,124, 30,132, 30,143, 30,151, 30,163,225,227,245,244,\n    101,128, 30,232,228,239,244,226,229,236,239,119,128, 30,240,231,\n    242,225,246,101,128, 30,234,232,239,239,235,225,226,239,246,101,\n    128, 30,236,244,233,236,228,101,128, 30,238,245,238,231,225,242,\n    245,237,236,225,245,116,129,  1,112, 30,187,227,249,242,233,236,\n    236,233, 99,128,  4,242,233,238,246,229,242,244,229,228,226,242,\n    229,246,101,128,  2, 22,235,227,249,242,233,236,236,233, 99,128,\n      4,120,109,  2, 30,232, 31, 10,225,227,242,239,110,130,  1,106,\n     30,244, 30,255,227,249,242,233,236,236,233, 99,128,  4,238,228,\n    233,229,242,229,243,233,115,128, 30,122,239,238,239,243,240,225,\n    227,101,128,255, 53,239,231,239,238,229,107,128,  1,114,240,243,\n    233,236,239,110,133,  3,165, 31, 49, 31, 53, 31, 90, 31,121, 31,\n    134, 49,128,  3,210, 97,  2, 31, 59, 31, 81,227,245,244,229,232,\n    239,239,235,243,249,237,226,239,236,231,242,229,229,107,128,  3,\n    211,230,242,233,227,225,110,128,  1,177,228,233,229,242,229,243,\n    233,115,129,  3,171, 31,103,232,239,239,235,243,249,237,226,239,\n    236,231,242,229,229,107,128,  3,212,232,239,239,235,243,249,237,\n    226,239,108,128,  3,210,244,239,238,239,115,128,  3,142,242,233,\n    238,103,128,  1,110,115,  3, 31,157, 31,172, 31,179,232,239,242,\n    244,227,249,242,233,236,236,233, 99,128,  4, 14,237,225,236,108,\n    128,247,117,244,242,225,233,231,232,116,  2, 31,191, 31,202,227,\n    249,242,233,236,236,233, 99,128,  4,174,243,244,242,239,235,229,\n    227,249,242,233,236,236,233, 99,128,  4,176,244,233,236,228,101,\n    130,  1,104, 31,231, 31,239,225,227,245,244,101,128, 30,120,226,\n    229,236,239,119,128, 30,116, 86,136,  0, 86, 32, 11, 32, 20, 32,\n     31, 32, 60, 32, 67, 32, 79, 32, 91, 32, 99,227,233,242,227,236,\n    101,128, 36,203,228,239,244,226,229,236,239,119,128, 30,126,101,\n      2, 32, 37, 32, 48,227,249,242,233,236,236,233, 99,128,  4, 18,\n    247,225,242,237,229,238,233,225,110,128,  5, 78,232,239,239,107,\n    128,  1,178,237,239,238,239,243,240,225,227,101,128,255, 54,239,\n    225,242,237,229,238,233,225,110,128,  5, 72,243,237,225,236,108,\n    128,247,118,244,233,236,228,101,128, 30,124, 87,134,  0, 87, 32,\n    123, 32,131, 32,154, 32,194, 32,202, 32,214,225,227,245,244,101,\n    128, 30,130,227,233,242, 99,  2, 32,140, 32,145,236,101,128, 36,\n    204,245,237,230,236,229,120,128,  1,116,100,  2, 32,160, 32,170,\n    233,229,242,229,243,233,115,128, 30,132,239,116,  2, 32,177, 32,\n    186,225,227,227,229,238,116,128, 30,134,226,229,236,239,119,128,\n     30,136,231,242,225,246,101,128, 30,128,237,239,238,239,243,240,\n    225,227,101,128,255, 55,243,237,225,236,108,128,247,119, 88,134,\n      0, 88, 32,238, 32,247, 33, 18, 33, 31, 33, 35, 33, 47,227,233,\n    242,227,236,101,128, 36,205,100,  2, 32,253, 33,  7,233,229,242,\n    229,243,233,115,128, 30,140,239,244,225,227,227,229,238,116,128,\n     30,138,229,232,225,242,237,229,238,233,225,110,128,  5, 61,105,\n    128,  3,158,237,239,238,239,243,240,225,227,101,128,255, 56,243,\n    237,225,236,108,128,247,120, 89,139,  0, 89, 33, 81, 33,116, 33,\n    139, 33,189, 33,228, 33,236, 33,253, 34, 40, 34, 52, 34, 60, 34,\n     68, 97,  2, 33, 87, 33,104,227,245,244,101,129,  0,221, 33, 96,\n    243,237,225,236,108,128,247,253,244,227,249,242,233,236,236,233,\n     99,128,  4, 98,227,233,242, 99,  2, 33,125, 33,130,236,101,128,\n     36,206,245,237,230,236,229,120,128,  1,118,100,  2, 33,145, 33,\n    165,233,229,242,229,243,233,115,129,  1,120, 33,157,243,237,225,\n    236,108,128,247,255,239,116,  2, 33,172, 33,181,225,227,227,229,\n    238,116,128, 30,142,226,229,236,239,119,128, 30,244,229,114,  2,\n     33,196, 33,208,233,227,249,242,233,236,236,233, 99,128,  4, 43,\n    245,228,233,229,242,229,243,233,243,227,249,242,233,236,236,233,\n     99,128,  4,248,231,242,225,246,101,128, 30,242,232,239,239,107,\n    129,  1,179, 33,245,225,226,239,246,101,128, 30,246,105,  3, 34,\n      5, 34, 16, 34, 27,225,242,237,229,238,233,225,110,128,  5, 69,\n    227,249,242,233,236,236,233, 99,128,  4,  7,247,238,225,242,237,\n    229,238,233,225,110,128,  5, 82,237,239,238,239,243,240,225,227,\n    101,128,255, 57,243,237,225,236,108,128,247,121,244,233,236,228,\n    101,128, 30,248,245,115,  2, 34, 75, 34,113,226,233,103,  2, 34,\n     83, 34, 94,227,249,242,233,236,236,233, 99,128,  4,106,233,239,\n    244,233,230,233,229,228,227,249,242,233,236,236,233, 99,128,  4,\n    108,236,233,244,244,236,101,  2, 34,124, 34,135,227,249,242,233,\n    236,236,233, 99,128,  4,102,233,239,244,233,230,233,229,228,227,\n    249,242,233,236,236,233, 99,128,  4,104, 90,136,  0, 90, 34,174,\n     34,198, 34,243, 35, 14, 35, 81, 35,173, 35,185, 35,197, 97,  2,\n     34,180, 34,191,225,242,237,229,238,233,225,110,128,  5, 54,227,\n    245,244,101,128,  1,121, 99,  2, 34,204, 34,221,225,242,239,110,\n    129,  1,125, 34,213,243,237,225,236,108,128,246,255,233,242, 99,\n      2, 34,229, 34,234,236,101,128, 36,207,245,237,230,236,229,120,\n    128, 30,144,228,239,116,130,  1,123, 34,253, 35,  6,225,227,227,\n    229,238,116,128,  1,123,226,229,236,239,119,128, 30,146,101,  3,\n     35, 22, 35, 33, 35, 76,227,249,242,233,236,236,233, 99,128,  4,\n     23,100,  2, 35, 39, 35, 58,229,243,227,229,238,228,229,242,227,\n    249,242,233,236,236,233, 99,128,  4,152,233,229,242,229,243,233,\n    243,227,249,242,233,236,236,233, 99,128,  4,222,244, 97,128,  3,\n    150,232,101,  4, 35, 92, 35,103, 35,119, 35,130,225,242,237,229,\n    238,233,225,110,128,  5, 58,226,242,229,246,229,227,249,242,233,\n    236,236,233, 99,128,  4,193,227,249,242,233,236,236,233, 99,128,\n      4, 22,100,  2, 35,136, 35,155,229,243,227,229,238,228,229,242,\n    227,249,242,233,236,236,233, 99,128,  4,150,233,229,242,229,243,\n    233,243,227,249,242,233,236,236,233, 99,128,  4,220,236,233,238,\n    229,226,229,236,239,119,128, 30,148,237,239,238,239,243,240,225,\n    227,101,128,255, 58,115,  2, 35,203, 35,210,237,225,236,108,128,\n    247,122,244,242,239,235,101,128,  1,181, 97,158,  0, 97, 36, 26,\n     38,154, 39,  4, 39, 68, 39,132, 39,196, 40,  4, 40, 68, 40,126,\n     40,190, 41, 70, 41,217, 42,137, 42,237, 43, 17, 49,192, 49,229,\n     50,  0, 50,225, 51,  7, 52, 96, 52,168, 53,123, 53,132, 54,  5,\n     56, 13, 57,  3, 57, 50, 57,201, 57,215, 49,138, 39,  1, 36, 50,\n     36,114, 36,154, 36,218, 37, 26, 37, 90, 37,154, 37,218, 38, 26,\n     38, 90, 48,138, 39, 33, 36, 74, 36, 78, 36, 82, 36, 86, 36, 90,\n     36, 94, 36, 98, 36,102, 36,106, 36,110, 48,128, 39, 94, 49,128,\n     39, 97, 50,128, 39, 98, 51,128, 39, 99, 52,128, 39,100, 53,128,\n     39, 16, 54,128, 39,101, 55,128, 39,102, 56,128, 39,103, 57,128,\n     38, 96, 49,134, 38, 27, 36,130, 36,134, 36,138, 36,142, 36,146,\n     36,150, 48,128, 38,101, 49,128, 38,102, 50,128, 38, 99, 55,128,\n     39,  9, 56,128, 39,  8, 57,128, 39,  7, 50,138, 38, 30, 36,178,\n     36,182, 36,186, 36,190, 36,194, 36,198, 36,202, 36,206, 36,210,\n     36,214, 48,128, 36, 96, 49,128, 36, 97, 50,128, 36, 98, 51,128,\n     36, 99, 52,128, 36,100, 53,128, 36,101, 54,128, 36,102, 55,128,\n     36,103, 56,128, 36,104, 57,128, 36,105, 51,138, 39, 12, 36,242,\n     36,246, 36,250, 36,254, 37,  2, 37,  6, 37, 10, 37, 14, 37, 18,\n     37, 22, 48,128, 39,118, 49,128, 39,119, 50,128, 39,120, 51,128,\n     39,121, 52,128, 39,122, 53,128, 39,123, 54,128, 39,124, 55,128,\n     39,125, 56,128, 39,126, 57,128, 39,127, 52,138, 39, 13, 37, 50,\n     37, 54, 37, 58, 37, 62, 37, 66, 37, 70, 37, 74, 37, 78, 37, 82,\n     37, 86, 48,128, 39,128, 49,128, 39,129, 50,128, 39,130, 51,128,\n     39,131, 52,128, 39,132, 53,128, 39,133, 54,128, 39,134, 55,128,\n     39,135, 56,128, 39,136, 57,128, 39,137, 53,138, 39, 14, 37,114,\n     37,118, 37,122, 37,126, 37,130, 37,134, 37,138, 37,142, 37,146,\n     37,150, 48,128, 39,138, 49,128, 39,139, 50,128, 39,140, 51,128,\n     39,141, 52,128, 39,142, 53,128, 39,143, 54,128, 39,144, 55,128,\n     39,145, 56,128, 39,146, 57,128, 39,147, 54,138, 39, 15, 37,178,\n     37,182, 37,186, 37,190, 37,194, 37,198, 37,202, 37,206, 37,210,\n     37,214, 48,128, 39,148, 49,128, 33,146, 50,128, 39,163, 51,128,\n     33,148, 52,128, 33,149, 53,128, 39,153, 54,128, 39,155, 55,128,\n     39,156, 56,128, 39,157, 57,128, 39,158, 55,138, 39, 17, 37,242,\n     37,246, 37,250, 37,254, 38,  2, 38,  6, 38, 10, 38, 14, 38, 18,\n     38, 22, 48,128, 39,159, 49,128, 39,160, 50,128, 39,161, 51,128,\n     39,162, 52,128, 39,164, 53,128, 39,165, 54,128, 39,166, 55,128,\n     39,167, 56,128, 39,168, 57,128, 39,169, 56,138, 39, 18, 38, 50,\n     38, 54, 38, 58, 38, 62, 38, 66, 38, 70, 38, 74, 38, 78, 38, 82,\n     38, 86, 48,128, 39,171, 49,128, 39,173, 50,128, 39,175, 51,128,\n     39,178, 52,128, 39,179, 53,128, 39,181, 54,128, 39,184, 55,128,\n     39,186, 56,128, 39,187, 57,128, 39,188, 57,138, 39, 19, 38,114,\n     38,118, 38,122, 38,126, 38,130, 38,134, 38,138, 38,142, 38,146,\n     38,150, 48,128, 39,189, 49,128, 39,190, 50,128, 39,154, 51,128,\n     39,170, 52,128, 39,182, 53,128, 39,185, 54,128, 39,152, 55,128,\n     39,180, 56,128, 39,183, 57,128, 39,172, 50,138, 39,  2, 38,178,\n     38,224, 38,228, 38,232, 38,236, 38,240, 38,244, 38,248, 38,252,\n     39,  0, 48,135, 39, 20, 38,196, 38,200, 38,204, 38,208, 38,212,\n     38,216, 38,220, 48,128, 39,174, 49,128, 39,177, 50,128, 39,  3,\n     51,128, 39, 80, 52,128, 39, 82, 53,128, 39,110, 54,128, 39,112,\n     49,128, 39, 21, 50,128, 39, 22, 51,128, 39, 23, 52,128, 39, 24,\n     53,128, 39, 25, 54,128, 39, 26, 55,128, 39, 27, 56,128, 39, 28,\n     57,128, 39, 34, 51,138, 39,  4, 39, 28, 39, 32, 39, 36, 39, 40,\n     39, 44, 39, 48, 39, 52, 39, 56, 39, 60, 39, 64, 48,128, 39, 35,\n     49,128, 39, 36, 50,128, 39, 37, 51,128, 39, 38, 52,128, 39, 39,\n     53,128, 38,  5, 54,128, 39, 41, 55,128, 39, 42, 56,128, 39, 43,\n     57,128, 39, 44, 52,138, 38, 14, 39, 92, 39, 96, 39,100, 39,104,\n     39,108, 39,112, 39,116, 39,120, 39,124, 39,128, 48,128, 39, 45,\n     49,128, 39, 46, 50,128, 39, 47, 51,128, 39, 48, 52,128, 39, 49,\n     53,128, 39, 50, 54,128, 39, 51, 55,128, 39, 52, 56,128, 39, 53,\n     57,128, 39, 54, 53,138, 39,  6, 39,156, 39,160, 39,164, 39,168,\n     39,172, 39,176, 39,180, 39,184, 39,188, 39,192, 48,128, 39, 55,\n     49,128, 39, 56, 50,128, 39, 57, 51,128, 39, 58, 52,128, 39, 59,\n     53,128, 39, 60, 54,128, 39, 61, 55,128, 39, 62, 56,128, 39, 63,\n     57,128, 39, 64, 54,138, 39, 29, 39,220, 39,224, 39,228, 39,232,\n     39,236, 39,240, 39,244, 39,248, 39,252, 40,  0, 48,128, 39, 65,\n     49,128, 39, 66, 50,128, 39, 67, 51,128, 39, 68, 52,128, 39, 69,\n     53,128, 39, 70, 54,128, 39, 71, 55,128, 39, 72, 56,128, 39, 73,\n     57,128, 39, 74, 55,138, 39, 30, 40, 28, 40, 32, 40, 36, 40, 40,\n     40, 44, 40, 48, 40, 52, 40, 56, 40, 60, 40, 64, 48,128, 39, 75,\n     49,128, 37,207, 50,128, 39, 77, 51,128, 37,160, 52,128, 39, 79,\n     53,128, 39, 81, 54,128, 37,178, 55,128, 37,188, 56,128, 37,198,\n     57,128, 39, 86, 56,137, 39, 31, 40, 90, 40, 94, 40, 98, 40,102,\n     40,106, 40,110, 40,114, 40,118, 40,122, 49,128, 37,215, 50,128,\n     39, 88, 51,128, 39, 89, 52,128, 39, 90, 53,128, 39,111, 54,128,\n     39,113, 55,128, 39,114, 56,128, 39,115, 57,128, 39,104, 57,138,\n     39, 32, 40,150, 40,154, 40,158, 40,162, 40,166, 40,170, 40,174,\n     40,178, 40,182, 40,186, 48,128, 39,105, 49,128, 39,108, 50,128,\n     39,109, 51,128, 39,106, 52,128, 39,107, 53,128, 39,116, 54,128,\n     39,117, 55,128, 39, 91, 56,128, 39, 92, 57,128, 39, 93, 97,  7,\n     40,206, 40,216, 40,223, 40,230, 40,255, 41, 15, 41, 26,226,229,\n    238,231,225,236,105,128,  9,134,227,245,244,101,128,  0,225,228,\n    229,246, 97,128,  9,  6,231,117,  2, 40,237, 40,246,234,225,242,\n    225,244,105,128, 10,134,242,237,245,235,232,105,128, 10,  6,237,\n    225,244,242,225,231,245,242,237,245,235,232,105,128, 10, 62,242,\n    245,243,241,245,225,242,101,128, 51,  3,246,239,247,229,236,243,\n    233,231,110,  3, 41, 42, 41, 52, 41, 59,226,229,238,231,225,236,\n    105,128,  9,190,228,229,246, 97,128,  9, 62,231,245,234,225,242,\n    225,244,105,128, 10,190, 98,  4, 41, 80, 41,121, 41,130, 41,140,\n    226,242,229,246,233,225,244,233,239,110,  2, 41, 95, 41,110,237,\n    225,242,235,225,242,237,229,238,233,225,110,128,  5, 95,243,233,\n    231,238,228,229,246, 97,128,  9,112,229,238,231,225,236,105,128,\n      9,133,239,240,239,237,239,230,111,128, 49, 26,242,229,246,101,\n    134,  1,  3, 41,159, 41,167, 41,178, 41,189, 41,197, 41,209,225,\n    227,245,244,101,128, 30,175,227,249,242,233,236,236,233, 99,128,\n      4,209,228,239,244,226,229,236,239,119,128, 30,183,231,242,225,\n    246,101,128, 30,177,232,239,239,235,225,226,239,246,101,128, 30,\n    179,244,233,236,228,101,128, 30,181, 99,  4, 41,227, 41,234, 42,\n     57, 42,127,225,242,239,110,128,  1,206,233,242, 99,  2, 41,242,\n     41,247,236,101,128, 36,208,245,237,230,236,229,120,133,  0,226,\n     42, 10, 42, 18, 42, 29, 42, 37, 42, 49,225,227,245,244,101,128,\n     30,165,228,239,244,226,229,236,239,119,128, 30,173,231,242,225,\n    246,101,128, 30,167,232,239,239,235,225,226,239,246,101,128, 30,\n    169,244,233,236,228,101,128, 30,171,245,244,101,133,  0,180, 42,\n     73, 42, 84, 42,101, 42,108, 42,117,226,229,236,239,247,227,237,\n     98,128,  3, 23, 99,  2, 42, 90, 42, 95,237, 98,128,  3,  1,239,\n    237, 98,128,  3,  1,228,229,246, 97,128,  9, 84,236,239,247,237,\n    239,100,128,  2,207,244,239,238,229,227,237, 98,128,  3, 65,249,\n    242,233,236,236,233, 99,128,  4, 48,100,  5, 42,149, 42,159, 42,\n    173, 42,179, 42,213,226,236,231,242,225,246,101,128,  2,  1,228,\n    225,235,231,245,242,237,245,235,232,105,128, 10,113,229,246, 97,\n    128,  9,  5,233,229,242,229,243,233,115,130,  0,228, 42,193, 42,\n    204,227,249,242,233,236,236,233, 99,128,  4,211,237,225,227,242,\n    239,110,128,  1,223,239,116,  2, 42,220, 42,228,226,229,236,239,\n    119,128, 30,161,237,225,227,242,239,110,128,  1,225,101,131,  0,\n    230, 42,247, 42,255, 43,  8,225,227,245,244,101,128,  1,253,235,\n    239,242,229,225,110,128, 49, 80,237,225,227,242,239,110,128,  1,\n    227,230,233,105,  6, 43, 33, 43, 53, 45,246, 45,252, 46, 11, 49,\n    111, 48,  2, 43, 39, 43, 46,176,178,176, 56,128, 32, 21,184,185,\n    180, 49,128, 32,164,177, 48,  3, 43, 62, 45, 86, 45,221, 48,  9,\n     43, 82, 43,102, 43,164, 43,226, 44, 32, 44, 94, 44,156, 44,218,\n     45, 24, 49,  3, 43, 90, 43, 94, 43, 98, 55,128,  4, 16, 56,128,\n      4, 17, 57,128,  4, 18, 50, 10, 43,124, 43,128, 43,132, 43,136,\n     43,140, 43,144, 43,148, 43,152, 43,156, 43,160, 48,128,  4, 19,\n     49,128,  4, 20, 50,128,  4, 21, 51,128,  4,  1, 52,128,  4, 22,\n     53,128,  4, 23, 54,128,  4, 24, 55,128,  4, 25, 56,128,  4, 26,\n     57,128,  4, 27, 51, 10, 43,186, 43,190, 43,194, 43,198, 43,202,\n     43,206, 43,210, 43,214, 43,218, 43,222, 48,128,  4, 28, 49,128,\n      4, 29, 50,128,  4, 30, 51,128,  4, 31, 52,128,  4, 32, 53,128,\n      4, 33, 54,128,  4, 34, 55,128,  4, 35, 56,128,  4, 36, 57,128,\n      4, 37, 52, 10, 43,248, 43,252, 44,  0, 44,  4, 44,  8, 44, 12,\n     44, 16, 44, 20, 44, 24, 44, 28, 48,128,  4, 38, 49,128,  4, 39,\n     50,128,  4, 40, 51,128,  4, 41, 52,128,  4, 42, 53,128,  4, 43,\n     54,128,  4, 44, 55,128,  4, 45, 56,128,  4, 46, 57,128,  4, 47,\n     53, 10, 44, 54, 44, 58, 44, 62, 44, 66, 44, 70, 44, 74, 44, 78,\n     44, 82, 44, 86, 44, 90, 48,128,  4,144, 49,128,  4,  2, 50,128,\n      4,  3, 51,128,  4,  4, 52,128,  4,  5, 53,128,  4,  6, 54,128,\n      4,  7, 55,128,  4,  8, 56,128,  4,  9, 57,128,  4, 10, 54, 10,\n     44,116, 44,120, 44,124, 44,128, 44,132, 44,136, 44,140, 44,144,\n     44,148, 44,152, 48,128,  4, 11, 49,128,  4, 12, 50,128,  4, 14,\n     51,128,246,196, 52,128,246,197, 53,128,  4, 48, 54,128,  4, 49,\n     55,128,  4, 50, 56,128,  4, 51, 57,128,  4, 52, 55, 10, 44,178,\n     44,182, 44,186, 44,190, 44,194, 44,198, 44,202, 44,206, 44,210,\n     44,214, 48,128,  4, 53, 49,128,  4, 81, 50,128,  4, 54, 51,128,\n      4, 55, 52,128,  4, 56, 53,128,  4, 57, 54,128,  4, 58, 55,128,\n      4, 59, 56,128,  4, 60, 57,128,  4, 61, 56, 10, 44,240, 44,244,\n     44,248, 44,252, 45,  0, 45,  4, 45,  8, 45, 12, 45, 16, 45, 20,\n     48,128,  4, 62, 49,128,  4, 63, 50,128,  4, 64, 51,128,  4, 65,\n     52,128,  4, 66, 53,128,  4, 67, 54,128,  4, 68, 55,128,  4, 69,\n     56,128,  4, 70, 57,128,  4, 71, 57, 10, 45, 46, 45, 50, 45, 54,\n     45, 58, 45, 62, 45, 66, 45, 70, 45, 74, 45, 78, 45, 82, 48,128,\n      4, 72, 49,128,  4, 73, 50,128,  4, 74, 51,128,  4, 75, 52,128,\n      4, 76, 53,128,  4, 77, 54,128,  4, 78, 55,128,  4, 79, 56,128,\n      4,145, 57,128,  4, 82, 49,  4, 45, 96, 45,158, 45,163, 45,189,\n     48, 10, 45,118, 45,122, 45,126, 45,130, 45,134, 45,138, 45,142,\n     45,146, 45,150, 45,154, 48,128,  4, 83, 49,128,  4, 84, 50,128,\n      4, 85, 51,128,  4, 86, 52,128,  4, 87, 53,128,  4, 88, 54,128,\n      4, 89, 55,128,  4, 90, 56,128,  4, 91, 57,128,  4, 92,177, 48,\n    128,  4, 94, 52,  4, 45,173, 45,177, 45,181, 45,185, 53,128,  4,\n     15, 54,128,  4, 98, 55,128,  4,114, 56,128,  4,116, 57,  5, 45,\n    201, 45,205, 45,209, 45,213, 45,217, 50,128,246,198, 51,128,  4,\n     95, 52,128,  4, 99, 53,128,  4,115, 54,128,  4,117, 56,  2, 45,\n    227, 45,241, 51,  2, 45,233, 45,237, 49,128,246,199, 50,128,246,\n    200,180, 54,128,  4,217,178,185, 57,128, 32, 14,179, 48,  2, 46,\n      3, 46,  7, 48,128, 32, 15, 49,128, 32, 13,181, 55,  7, 46, 28,\n     46, 98, 47,163, 47,240, 48,197, 49, 34, 49,105, 51,  2, 46, 34,\n     46, 48, 56,  2, 46, 40, 46, 44, 49,128,  6,106, 56,128,  6, 12,\n     57,  8, 46, 66, 46, 70, 46, 74, 46, 78, 46, 82, 46, 86, 46, 90,\n     46, 94, 50,128,  6, 96, 51,128,  6, 97, 52,128,  6, 98, 53,128,\n      6, 99, 54,128,  6,100, 55,128,  6,101, 56,128,  6,102, 57,128,\n      6,103, 52,  7, 46,114, 46,146, 46,208, 47, 14, 47, 46, 47,102,\n     47,158, 48,  5, 46,126, 46,130, 46,134, 46,138, 46,142, 48,128,\n      6,104, 49,128,  6,105, 51,128,  6, 27, 55,128,  6, 31, 57,128,\n      6, 33, 49, 10, 46,168, 46,172, 46,176, 46,180, 46,184, 46,188,\n     46,192, 46,196, 46,200, 46,204, 48,128,  6, 34, 49,128,  6, 35,\n     50,128,  6, 36, 51,128,  6, 37, 52,128,  6, 38, 53,128,  6, 39,\n     54,128,  6, 40, 55,128,  6, 41, 56,128,  6, 42, 57,128,  6, 43,\n     50, 10, 46,230, 46,234, 46,238, 46,242, 46,246, 46,250, 46,254,\n     47,  2, 47,  6, 47, 10, 48,128,  6, 44, 49,128,  6, 45, 50,128,\n      6, 46, 51,128,  6, 47, 52,128,  6, 48, 53,128,  6, 49, 54,128,\n      6, 50, 55,128,  6, 51, 56,128,  6, 52, 57,128,  6, 53, 51,  5,\n     47, 26, 47, 30, 47, 34, 47, 38, 47, 42, 48,128,  6, 54, 49,128,\n      6, 55, 50,128,  6, 56, 51,128,  6, 57, 52,128,  6, 58, 52,  9,\n     47, 66, 47, 70, 47, 74, 47, 78, 47, 82, 47, 86, 47, 90, 47, 94,\n     47, 98, 48,128,  6, 64, 49,128,  6, 65, 50,128,  6, 66, 51,128,\n      6, 67, 52,128,  6, 68, 53,128,  6, 69, 54,128,  6, 70, 56,128,\n      6, 72, 57,128,  6, 73, 53,  9, 47,122, 47,126, 47,130, 47,134,\n     47,138, 47,142, 47,146, 47,150, 47,154, 48,128,  6, 74, 49,128,\n      6, 75, 50,128,  6, 76, 51,128,  6, 77, 52,128,  6, 78, 53,128,\n      6, 79, 54,128,  6, 80, 55,128,  6, 81, 56,128,  6, 82,183, 48,\n    128,  6, 71, 53,  3, 47,171, 47,203, 47,235, 48,  5, 47,183, 47,\n    187, 47,191, 47,195, 47,199, 53,128,  6,164, 54,128,  6,126, 55,\n    128,  6,134, 56,128,  6,152, 57,128,  6,175, 49,  5, 47,215, 47,\n    219, 47,223, 47,227, 47,231, 49,128,  6,121, 50,128,  6,136, 51,\n    128,  6,145, 52,128,  6,186, 57,128,  6,210,179, 52,128,  6,213,\n     54,  7, 48,  0, 48,  5, 48, 10, 48, 15, 48, 53, 48,115, 48,177,\n    179, 54,128, 32,170,180, 53,128,  5,190,181, 56,128,  5,195, 54,\n      6, 48, 29, 48, 33, 48, 37, 48, 41, 48, 45, 48, 49, 52,128,  5,\n    208, 53,128,  5,209, 54,128,  5,210, 55,128,  5,211, 56,128,  5,\n    212, 57,128,  5,213, 55, 10, 48, 75, 48, 79, 48, 83, 48, 87, 48,\n     91, 48, 95, 48, 99, 48,103, 48,107, 48,111, 48,128,  5,214, 49,\n    128,  5,215, 50,128,  5,216, 51,128,  5,217, 52,128,  5,218, 53,\n    128,  5,219, 54,128,  5,220, 55,128,  5,221, 56,128,  5,222, 57,\n    128,  5,223, 56, 10, 48,137, 48,141, 48,145, 48,149, 48,153, 48,\n    157, 48,161, 48,165, 48,169, 48,173, 48,128,  5,224, 49,128,  5,\n    225, 50,128,  5,226, 51,128,  5,227, 52,128,  5,228, 53,128,  5,\n    229, 54,128,  5,230, 55,128,  5,231, 56,128,  5,232, 57,128,  5,\n    233, 57,  3, 48,185, 48,189, 48,193, 48,128,  5,234, 52,128,251,\n     42, 53,128,251, 43, 55,  4, 48,207, 48,221, 48,241, 48,246, 48,\n      2, 48,213, 48,217, 48,128,251, 75, 53,128,251, 31, 49,  3, 48,\n    229, 48,233, 48,237, 54,128,  5,240, 55,128,  5,241, 56,128,  5,\n    242,178, 51,128,251, 53, 57,  7, 49,  6, 49, 10, 49, 14, 49, 18,\n     49, 22, 49, 26, 49, 30, 51,128,  5,180, 52,128,  5,181, 53,128,\n      5,182, 54,128,  5,187, 55,128,  5,184, 56,128,  5,183, 57,128,\n      5,176, 56,  3, 49, 42, 49, 86, 49, 91, 48,  7, 49, 58, 49, 62,\n     49, 66, 49, 70, 49, 74, 49, 78, 49, 82, 48,128,  5,178, 49,128,\n      5,177, 50,128,  5,179, 51,128,  5,194, 52,128,  5,193, 54,128,\n      5,185, 55,128,  5,188,179, 57,128,  5,189, 52,  2, 49, 97, 49,\n    101, 49,128,  5,191, 50,128,  5,192,185,178, 57,128,  2,188, 54,\n      3, 49,119, 49,178, 49,185, 49,  4, 49,129, 49,145, 49,151, 49,\n    172, 50,  2, 49,135, 49,140,180, 56,128, 33,  5,184, 57,128, 33,\n     19,179,181, 50,128, 33, 22,181, 55,  3, 49,160, 49,164, 49,168,\n     51,128, 32, 44, 52,128, 32, 45, 53,128, 32, 46,182,182, 52,128,\n     32, 12,179,177,182, 55,128,  6,109,180,185,179, 55,128,  2,189,\n    103,  2, 49,198, 49,205,242,225,246,101,128,  0,224,117,  2, 49,\n    211, 49,220,234,225,242,225,244,105,128, 10,133,242,237,245,235,\n    232,105,128, 10,  5,104,  2, 49,235, 49,245,233,242,225,231,225,\n    238, 97,128, 48, 66,239,239,235,225,226,239,246,101,128, 30,163,\n    105,  7, 50, 16, 50, 41, 50, 48, 50, 60, 50, 85, 50,101, 50,181,\n     98,  2, 50, 22, 50, 31,229,238,231,225,236,105,128,  9,144,239,\n    240,239,237,239,230,111,128, 49, 30,228,229,246, 97,128,  9, 16,\n    229,227,249,242,233,236,236,233, 99,128,  4,213,231,117,  2, 50,\n     67, 50, 76,234,225,242,225,244,105,128, 10,144,242,237,245,235,\n    232,105,128, 10, 16,237,225,244,242,225,231,245,242,237,245,235,\n    232,105,128, 10, 72,110,  5, 50,113, 50,122, 50,136, 50,152, 50,\n    167,225,242,225,226,233, 99,128,  6, 57,230,233,238,225,236,225,\n    242,225,226,233, 99,128,254,202,233,238,233,244,233,225,236,225,\n    242,225,226,233, 99,128,254,203,237,229,228,233,225,236,225,242,\n    225,226,233, 99,128,254,204,246,229,242,244,229,228,226,242,229,\n    246,101,128,  2,  3,246,239,247,229,236,243,233,231,110,  3, 50,\n    197, 50,207, 50,214,226,229,238,231,225,236,105,128,  9,200,228,\n    229,246, 97,128,  9, 72,231,245,234,225,242,225,244,105,128, 10,\n    200,107,  2, 50,231, 50,255,225,244,225,235,225,238, 97,129, 48,\n    162, 50,243,232,225,236,230,247,233,228,244,104,128,255,113,239,\n    242,229,225,110,128, 49, 79,108,  3, 51, 15, 52, 71, 52, 80,101,\n      2, 51, 21, 52, 66,102,136,  5,208, 51, 41, 51, 50, 51, 65, 51,\n     79, 51,168, 51,182, 52, 37, 52, 51,225,242,225,226,233, 99,128,\n      6, 39,228,225,231,229,243,232,232,229,226,242,229,119,128,251,\n     48,230,233,238,225,236,225,242,225,226,233, 99,128,254,142,104,\n      2, 51, 85, 51,160,225,237,250, 97,  2, 51, 94, 51,127,225,226,\n    239,246,101,  2, 51,104, 51,113,225,242,225,226,233, 99,128,  6,\n     35,230,233,238,225,236,225,242,225,226,233, 99,128,254,132,226,\n    229,236,239,119,  2, 51,137, 51,146,225,242,225,226,233, 99,128,\n      6, 37,230,233,238,225,236,225,242,225,226,233, 99,128,254,136,\n    229,226,242,229,119,128,  5,208,236,225,237,229,228,232,229,226,\n    242,229,119,128,251, 79,237, 97,  2, 51,189, 51,225,228,228,225,\n    225,226,239,246,101,  2, 51,202, 51,211,225,242,225,226,233, 99,\n    128,  6, 34,230,233,238,225,236,225,242,225,226,233, 99,128,254,\n    130,235,243,245,242, 97,  4, 51,239, 51,248, 52,  6, 52, 22,225,\n    242,225,226,233, 99,128,  6, 73,230,233,238,225,236,225,242,225,\n    226,233, 99,128,254,240,233,238,233,244,233,225,236,225,242,225,\n    226,233, 99,128,254,243,237,229,228,233,225,236,225,242,225,226,\n    233, 99,128,254,244,240,225,244,225,232,232,229,226,242,229,119,\n    128,251, 46,241,225,237,225,244,243,232,229,226,242,229,119,128,\n    251, 47,240,104,128, 33, 53,236,229,241,245,225,108,128, 34, 76,\n    240,232, 97,129,  3,177, 52, 88,244,239,238,239,115,128,  3,172,\n    109,  4, 52,106, 52,114, 52,125, 52,159,225,227,242,239,110,128,\n      1,  1,239,238,239,243,240,225,227,101,128,255, 65,240,229,242,\n    243,225,238,100,130,  0, 38, 52,139, 52,151,237,239,238,239,243,\n    240,225,227,101,128,255,  6,243,237,225,236,108,128,247, 38,243,\n    241,245,225,242,101,128, 51,194,110,  4, 52,178, 52,189, 53, 55,\n     53, 65,226,239,240,239,237,239,230,111,128, 49, 34,103,  4, 52,\n    199, 52,210, 52,224, 53, 47,226,239,240,239,237,239,230,111,128,\n     49, 36,235,232,225,238,235,232,245,244,232,225,105,128, 14, 90,\n    236,101,131, 34, 32, 52,235, 53, 32, 53, 39,226,242,225,227,235,\n    229,116,  2, 52,247, 53, 11,236,229,230,116,129, 48,  8, 53,  0,\n    246,229,242,244,233,227,225,108,128,254, 63,242,233,231,232,116,\n    129, 48,  9, 53, 21,246,229,242,244,233,227,225,108,128,254, 64,\n    236,229,230,116,128, 35, 41,242,233,231,232,116,128, 35, 42,243,\n    244,242,239,109,128, 33, 43,239,244,229,236,229,233, 97,128,  3,\n    135,117,  2, 53, 71, 53, 83,228,225,244,244,225,228,229,246, 97,\n    128,  9, 82,243,246,225,242, 97,  3, 53, 95, 53,105, 53,112,226,\n    229,238,231,225,236,105,128,  9,130,228,229,246, 97,128,  9,  2,\n    231,245,234,225,242,225,244,105,128, 10,130,239,231,239,238,229,\n    107,128,  1,  5,112,  3, 53,140, 53,164, 53,194, 97,  2, 53,146,\n     53,158,225,244,239,243,241,245,225,242,101,128, 51,  0,242,229,\n    110,128, 36,156,239,243,244,242,239,240,232,101,  2, 53,177, 53,\n    188,225,242,237,229,238,233,225,110,128,  5, 90,237,239,100,128,\n      2,188,112,  2, 53,200, 53,205,236,101,128,248,255,242,111,  2,\n     53,212, 53,220,225,227,232,229,115,128, 34, 80,120,  2, 53,226,\n     53,246,229,241,245,225,108,129, 34, 72, 53,236,239,242,233,237,\n    225,231,101,128, 34, 82,233,237,225,244,229,236,249,229,241,245,\n    225,108,128, 34, 69,114,  4, 54, 15, 54, 42, 54, 46, 54, 91,225,\n    229, 97,  2, 54, 23, 54, 33,229,235,239,242,229,225,110,128, 49,\n    142,235,239,242,229,225,110,128, 49,141, 99,128, 35, 18,105,  2,\n     54, 52, 54, 66,231,232,244,232,225,236,230,242,233,238,103,128,\n     30,154,238,103,130,  0,229, 54, 75, 54, 83,225,227,245,244,101,\n    128,  1,251,226,229,236,239,119,128, 30,  1,242,239,119,  8, 54,\n    111, 54,118, 54,247, 55, 57, 55,107, 55,162, 55,185, 56,  4,226,\n    239,244,104,128, 33,148,100,  3, 54,126, 54,165, 54,212,225,243,\n    104,  4, 54,138, 54,145, 54,152, 54,160,228,239,247,110,128, 33,\n    227,236,229,230,116,128, 33,224,242,233,231,232,116,128, 33,226,\n    245,112,128, 33,225,226,108,  5, 54,178, 54,185, 54,192, 54,199,\n     54,207,226,239,244,104,128, 33,212,228,239,247,110,128, 33,211,\n    236,229,230,116,128, 33,208,242,233,231,232,116,128, 33,210,245,\n    112,128, 33,209,239,247,110,131, 33,147, 54,224, 54,231, 54,239,\n    236,229,230,116,128, 33,153,242,233,231,232,116,128, 33,152,247,\n    232,233,244,101,128, 33,233,104,  2, 54,253, 55, 48,229,225,100,\n      4, 55,  9, 55, 19, 55, 29, 55, 40,228,239,247,238,237,239,100,\n    128,  2,197,236,229,230,244,237,239,100,128,  2,194,242,233,231,\n    232,244,237,239,100,128,  2,195,245,240,237,239,100,128,  2,196,\n    239,242,233,250,229,120,128,248,231,236,229,230,116,131, 33,144,\n     55, 70, 55, 87, 55, 99,228,226,108,129, 33,208, 55, 78,243,244,\n    242,239,235,101,128, 33,205,239,246,229,242,242,233,231,232,116,\n    128, 33,198,247,232,233,244,101,128, 33,230,242,233,231,232,116,\n    132, 33,146, 55,123, 55,135, 55,143, 55,154,228,226,236,243,244,\n    242,239,235,101,128, 33,207,232,229,225,246,121,128, 39,158,239,\n    246,229,242,236,229,230,116,128, 33,196,247,232,233,244,101,128,\n     33,232,244,225, 98,  2, 55,170, 55,177,236,229,230,116,128, 33,\n    228,242,233,231,232,116,128, 33,229,245,112,132, 33,145, 55,198,\n     55,226, 55,244, 55,252,100,  2, 55,204, 55,216,110,129, 33,149,\n     55,210,226,243,101,128, 33,168,239,247,238,226,225,243,101,128,\n     33,168,236,229,230,116,129, 33,150, 55,235,239,230,228,239,247,\n    110,128, 33,197,242,233,231,232,116,128, 33,151,247,232,233,244,\n    101,128, 33,231,246,229,242,244,229,120,128,248,230,115,  5, 56,\n     25, 56,101, 56,146, 56,229, 56,239, 99,  2, 56, 31, 56, 83,233,\n    105,  2, 56, 38, 56, 61,227,233,242,227,245,109,129,  0, 94, 56,\n     49,237,239,238,239,243,240,225,227,101,128,255, 62,244,233,236,\n    228,101,129,  0,126, 56, 71,237,239,238,239,243,240,225,227,101,\n    128,255, 94,242,233,240,116,129,  2, 81, 56, 92,244,245,242,238,\n    229,100,128,  2, 82,237,225,236,108,  2, 56,110, 56,121,232,233,\n    242,225,231,225,238, 97,128, 48, 65,235,225,244,225,235,225,238,\n     97,129, 48,161, 56,134,232,225,236,230,247,233,228,244,104,128,\n    255,103,244,229,242,233,115,  2, 56,156, 56,225,107,131,  0, 42,\n     56,166, 56,194, 56,217, 97,  2, 56,172, 56,186,236,244,239,238,\n    229,225,242,225,226,233, 99,128,  6,109,242,225,226,233, 99,128,\n      6,109,109,  2, 56,200, 56,206,225,244,104,128, 34, 23,239,238,\n    239,243,240,225,227,101,128,255, 10,243,237,225,236,108,128,254,\n     97,109,128, 32, 66,245,240,229,242,233,239,114,128,246,233,249,\n    237,240,244,239,244,233,227,225,236,236,249,229,241,245,225,108,\n    128, 34, 67,116,132,  0, 64, 57, 15, 57, 22, 57, 34, 57, 42,233,\n    236,228,101,128,  0,227,237,239,238,239,243,240,225,227,101,128,\n    255, 32,243,237,225,236,108,128,254,107,245,242,238,229,100,128,\n      2, 80,117,  6, 57, 64, 57, 89, 57, 96, 57,121, 57,141, 57,157,\n     98,  2, 57, 70, 57, 79,229,238,231,225,236,105,128,  9,148,239,\n    240,239,237,239,230,111,128, 49, 32,228,229,246, 97,128,  9, 20,\n    231,117,  2, 57,103, 57,112,234,225,242,225,244,105,128, 10,148,\n    242,237,245,235,232,105,128, 10, 20,236,229,238,231,244,232,237,\n    225,242,235,226,229,238,231,225,236,105,128,  9,215,237,225,244,\n    242,225,231,245,242,237,245,235,232,105,128, 10, 76,246,239,247,\n    229,236,243,233,231,110,  3, 57,173, 57,183, 57,190,226,229,238,\n    231,225,236,105,128,  9,204,228,229,246, 97,128,  9, 76,231,245,\n    234,225,242,225,244,105,128, 10,204,246,225,231,242,225,232,225,\n    228,229,246, 97,128,  9, 61,121,  2, 57,221, 57,233,226,225,242,\n    237,229,238,233,225,110,128,  5, 97,233,110,130,  5,226, 57,242,\n     58,  1,225,236,244,239,238,229,232,229,226,242,229,119,128,251,\n     32,232,229,226,242,229,119,128,  5,226, 98,144,  0, 98, 58, 46,\n     58,181, 58,192, 58,201, 58,226, 60, 11, 60, 73, 60,146, 62, 72,\n     62, 84, 62,127, 62,135, 62,145, 64, 15, 64, 39, 64, 48, 97,  7,\n     58, 62, 58, 72, 58, 96, 58,103, 58,128, 58,152, 58,163,226,229,\n    238,231,225,236,105,128,  9,172,227,235,243,236,225,243,104,129,\n      0, 92, 58, 84,237,239,238,239,243,240,225,227,101,128,255, 60,\n    228,229,246, 97,128,  9, 44,231,117,  2, 58,110, 58,119,234,225,\n    242,225,244,105,128, 10,172,242,237,245,235,232,105,128, 10, 44,\n    104,  2, 58,134, 58,144,233,242,225,231,225,238, 97,128, 48,112,\n    244,244,232,225,105,128, 14, 63,235,225,244,225,235,225,238, 97,\n    128, 48,208,114,129,  0,124, 58,169,237,239,238,239,243,240,225,\n    227,101,128,255, 92,226,239,240,239,237,239,230,111,128, 49,  5,\n    227,233,242,227,236,101,128, 36,209,228,239,116,  2, 58,209, 58,\n    218,225,227,227,229,238,116,128, 30,  3,226,229,236,239,119,128,\n     30,  5,101,  6, 58,240, 59,  5, 59, 28, 59,170, 59,181, 59,193,\n    225,237,229,228,243,233,248,244,229,229,238,244,232,238,239,244,\n    229,115,128, 38,108, 99,  2, 59, 11, 59, 18,225,245,243,101,128,\n     34, 53,249,242,233,236,236,233, 99,128,  4, 49,104,  5, 59, 40,\n     59, 49, 59, 63, 59, 93, 59,152,225,242,225,226,233, 99,128,  6,\n     40,230,233,238,225,236,225,242,225,226,233, 99,128,254,144,105,\n      2, 59, 69, 59, 84,238,233,244,233,225,236,225,242,225,226,233,\n     99,128,254,145,242,225,231,225,238, 97,128, 48,121,237,101,  2,\n     59,100, 59,113,228,233,225,236,225,242,225,226,233, 99,128,254,\n    146,229,237,105,  2, 59,121, 59,136,238,233,244,233,225,236,225,\n    242,225,226,233, 99,128,252,159,243,239,236,225,244,229,228,225,\n    242,225,226,233, 99,128,252,  8,238,239,239,238,230,233,238,225,\n    236,225,242,225,226,233, 99,128,252,109,235,225,244,225,235,225,\n    238, 97,128, 48,217,238,225,242,237,229,238,233,225,110,128,  5,\n     98,116,132,  5,209, 59,205, 59,225, 59,245, 59,254, 97,129,  3,\n    178, 59,211,243,249,237,226,239,236,231,242,229,229,107,128,  3,\n    208,228,225,231,229,243,104,129,251, 49, 59,236,232,229,226,242,\n    229,119,128,251, 49,232,229,226,242,229,119,128,  5,209,242,225,\n    230,229,232,229,226,242,229,119,128,251, 76,104,  2, 60, 17, 60,\n     67, 97,  3, 60, 25, 60, 35, 60, 42,226,229,238,231,225,236,105,\n    128,  9,173,228,229,246, 97,128,  9, 45,231,117,  2, 60, 49, 60,\n     58,234,225,242,225,244,105,128, 10,173,242,237,245,235,232,105,\n    128, 10, 45,239,239,107,128,  2, 83,105,  5, 60, 85, 60, 96, 60,\n    107, 60,121, 60,135,232,233,242,225,231,225,238, 97,128, 48,115,\n    235,225,244,225,235,225,238, 97,128, 48,211,236,225,226,233,225,\n    236,227,236,233,227,107,128,  2,152,238,228,233,231,245,242,237,\n    245,235,232,105,128, 10,  2,242,245,243,241,245,225,242,101,128,\n     51, 49,108,  3, 60,154, 62, 55, 62, 66, 97,  2, 60,160, 62, 50,\n    227,107,  6, 60,175, 60,184, 60,221, 61,114, 61,169, 61,221,227,\n    233,242,227,236,101,128, 37,207,100,  2, 60,190, 60,199,233,225,\n    237,239,238,100,128, 37,198,239,247,238,240,239,233,238,244,233,\n    238,231,244,242,233,225,238,231,236,101,128, 37,188,108,  2, 60,\n    227, 61, 74,101,  2, 60,233, 61, 13,230,244,240,239,233,238,244,\n    233,238,103,  2, 60,248, 61,  2,240,239,233,238,244,229,114,128,\n     37,196,244,242,233,225,238,231,236,101,128, 37,192,238,244,233,\n    227,245,236,225,242,226,242,225,227,235,229,116,  2, 61, 33, 61,\n     53,236,229,230,116,129, 48, 16, 61, 42,246,229,242,244,233,227,\n    225,108,128,254, 59,242,233,231,232,116,129, 48, 17, 61, 63,246,\n    229,242,244,233,227,225,108,128,254, 60,239,247,229,114,  2, 61,\n     83, 61, 98,236,229,230,244,244,242,233,225,238,231,236,101,128,\n     37,227,242,233,231,232,244,244,242,233,225,238,231,236,101,128,\n     37,226,114,  2, 61,120, 61,131,229,227,244,225,238,231,236,101,\n    128, 37,172,233,231,232,244,240,239,233,238,244,233,238,103,  2,\n     61,148, 61,158,240,239,233,238,244,229,114,128, 37,186,244,242,\n    233,225,238,231,236,101,128, 37,182,115,  3, 61,177, 61,207, 61,\n    215,109,  2, 61,183, 61,195,225,236,236,243,241,245,225,242,101,\n    128, 37,170,233,236,233,238,231,230,225,227,101,128, 38, 59,241,\n    245,225,242,101,128, 37,160,244,225,114,128, 38,  5,245,240,112,\n      2, 61,229, 62, 11,229,114,  2, 61,236, 61,251,236,229,230,244,\n    244,242,233,225,238,231,236,101,128, 37,228,242,233,231,232,244,\n    244,242,233,225,238,231,236,101,128, 37,229,239,233,238,244,233,\n    238,103,  2, 62, 23, 62, 39,243,237,225,236,236,244,242,233,225,\n    238,231,236,101,128, 37,180,244,242,233,225,238,231,236,101,128,\n     37,178,238,107,128, 36, 35,233,238,229,226,229,236,239,119,128,\n     30,  7,239,227,107,128, 37,136,237,239,238,239,243,240,225,227,\n    101,128,255, 66,111,  3, 62, 92, 62,105, 62,116,226,225,233,237,\n    225,233,244,232,225,105,128, 14, 26,232,233,242,225,231,225,238,\n     97,128, 48,124,235,225,244,225,235,225,238, 97,128, 48,220,240,\n    225,242,229,110,128, 36,157,241,243,241,245,225,242,101,128, 51,\n    195,114,  4, 62,155, 63,149, 63,222, 64,  5,225, 99,  2, 62,162,\n     63, 56,101,  3, 62,170, 62,175, 62,243,229,120,128,248,244,236,\n    229,230,116,133,  0,123, 62,192, 62,197, 62,219, 62,227, 62,232,\n    226,116,128,248,243,109,  2, 62,203, 62,208,233,100,128,248,242,\n    239,238,239,243,240,225,227,101,128,255, 91,243,237,225,236,108,\n    128,254, 91,244,112,128,248,241,246,229,242,244,233,227,225,108,\n    128,254, 55,242,233,231,232,116,133,  0,125, 63,  5, 63, 10, 63,\n     32, 63, 40, 63, 45,226,116,128,248,254,109,  2, 63, 16, 63, 21,\n    233,100,128,248,253,239,238,239,243,240,225,227,101,128,255, 93,\n    243,237,225,236,108,128,254, 92,244,112,128,248,252,246,229,242,\n    244,233,227,225,108,128,254, 56,235,229,116,  2, 63, 64, 63,106,\n    236,229,230,116,132,  0, 91, 63, 79, 63, 84, 63, 89, 63,101,226,\n    116,128,248,240,229,120,128,248,239,237,239,238,239,243,240,225,\n    227,101,128,255, 59,244,112,128,248,238,242,233,231,232,116,132,\n      0, 93, 63,122, 63,127, 63,132, 63,144,226,116,128,248,251,229,\n    120,128,248,250,237,239,238,239,243,240,225,227,101,128,255, 61,\n    244,112,128,248,249,229,246,101,131,  2,216, 63,161, 63,172, 63,\n    178,226,229,236,239,247,227,237, 98,128,  3, 46,227,237, 98,128,\n      3,  6,233,238,246,229,242,244,229,100,  3, 63,193, 63,204, 63,\n    210,226,229,236,239,247,227,237, 98,128,  3, 47,227,237, 98,128,\n      3, 17,228,239,245,226,236,229,227,237, 98,128,  3, 97,233,228,\n    231,101,  2, 63,231, 63,242,226,229,236,239,247,227,237, 98,128,\n      3, 42,233,238,246,229,242,244,229,228,226,229,236,239,247,227,\n    237, 98,128,  3, 58,239,235,229,238,226,225,114,128,  0,166,115,\n      2, 64, 21, 64, 29,244,242,239,235,101,128,  1,128,245,240,229,\n    242,233,239,114,128,246,234,244,239,240,226,225,114,128,  1,131,\n    117,  3, 64, 56, 64, 67, 64, 78,232,233,242,225,231,225,238, 97,\n    128, 48,118,235,225,244,225,235,225,238, 97,128, 48,214,236,108,\n      2, 64, 85, 64,115,229,116,130, 32, 34, 64, 94, 64,104,233,238,\n    246,229,242,243,101,128, 37,216,239,240,229,242,225,244,239,114,\n    128, 34, 25,243,229,249,101,128, 37,206, 99,143,  0, 99, 64,156,\n     65,105, 65,116, 65,180, 65,211, 66, 48, 67,215, 68,199, 69, 43,\n     69, 92, 72, 84, 72, 92, 72,102, 72,114, 72,147, 97,  9, 64,176,\n     64,187, 64,197, 64,204, 64,211, 64,236, 64,246, 65, 42, 65, 51,\n    225,242,237,229,238,233,225,110,128,  5,110,226,229,238,231,225,\n    236,105,128,  9,154,227,245,244,101,128,  1,  7,228,229,246, 97,\n    128,  9, 26,231,117,  2, 64,218, 64,227,234,225,242,225,244,105,\n    128, 10,154,242,237,245,235,232,105,128, 10, 26,236,243,241,245,\n    225,242,101,128, 51,136,238,228,242,225,226,233,238,228,117,  4,\n     65,  8, 65, 18, 65, 24, 65, 31,226,229,238,231,225,236,105,128,\n      9,129,227,237, 98,128,  3, 16,228,229,246, 97,128,  9,  1,231,\n    245,234,225,242,225,244,105,128, 10,129,240,243,236,239,227,107,\n    128, 33,234,114,  3, 65, 59, 65, 65, 65, 91,229,239,102,128, 33,\n      5,239,110,130,  2,199, 65, 74, 65, 85,226,229,236,239,247,227,\n    237, 98,128,  3, 44,227,237, 98,128,  3, 12,242,233,225,231,229,\n    242,229,244,245,242,110,128, 33,181,226,239,240,239,237,239,230,\n    111,128, 49, 24, 99,  4, 65,126, 65,133, 65,152, 65,174,225,242,\n    239,110,128,  1, 13,229,228,233,236,236, 97,129,  0,231, 65,144,\n    225,227,245,244,101,128, 30,  9,233,242, 99,  2, 65,160, 65,165,\n    236,101,128, 36,210,245,237,230,236,229,120,128,  1,  9,245,242,\n    108,128,  2, 85,100,  2, 65,186, 65,202,239,116,129,  1, 11, 65,\n    193,225,227,227,229,238,116,128,  1, 11,243,241,245,225,242,101,\n    128, 51,197,101,  2, 65,217, 65,233,228,233,236,236, 97,129,  0,\n    184, 65,227,227,237, 98,128,  3, 39,238,116,132,  0,162, 65,246,\n     66, 14, 66, 26, 66, 37,105,  2, 65,252, 66,  4,231,242,225,228,\n    101,128, 33,  3,238,230,229,242,233,239,114,128,246,223,237,239,\n    238,239,243,240,225,227,101,128,255,224,239,236,228,243,244,249,\n    236,101,128,247,162,243,245,240,229,242,233,239,114,128,246,224,\n    104,  5, 66, 60, 66,123, 66,134, 67, 62, 67,154, 97,  4, 66, 70,\n     66, 81, 66, 91, 66, 98,225,242,237,229,238,233,225,110,128,  5,\n    121,226,229,238,231,225,236,105,128,  9,155,228,229,246, 97,128,\n      9, 27,231,117,  2, 66,105, 66,114,234,225,242,225,244,105,128,\n     10,155,242,237,245,235,232,105,128, 10, 27,226,239,240,239,237,\n    239,230,111,128, 49, 20,101,  6, 66,148, 66,168, 66,192, 67,  4,\n     67, 16, 67, 37,225,226,235,232,225,243,233,225,238,227,249,242,\n    233,236,236,233, 99,128,  4,189, 99,  2, 66,174, 66,182,235,237,\n    225,242,107,128, 39, 19,249,242,233,236,236,233, 99,128,  4, 71,\n    100,  2, 66,198, 66,242,229,243,227,229,238,228,229,114,  2, 66,\n    211, 66,231,225,226,235,232,225,243,233,225,238,227,249,242,233,\n    236,236,233, 99,128,  4,191,227,249,242,233,236,236,233, 99,128,\n      4,183,233,229,242,229,243,233,243,227,249,242,233,236,236,233,\n     99,128,  4,245,232,225,242,237,229,238,233,225,110,128,  5,115,\n    235,232,225,235,225,243,243,233,225,238,227,249,242,233,236,236,\n    233, 99,128,  4,204,246,229,242,244,233,227,225,236,243,244,242,\n    239,235,229,227,249,242,233,236,236,233, 99,128,  4,185,105,129,\n      3,199, 67, 68,229,245,227,104,  4, 67, 81, 67,116, 67,131, 67,\n    140, 97,  2, 67, 87, 67,102,227,233,242,227,236,229,235,239,242,\n    229,225,110,128, 50,119,240,225,242,229,238,235,239,242,229,225,\n    110,128, 50, 23,227,233,242,227,236,229,235,239,242,229,225,110,\n    128, 50,105,235,239,242,229,225,110,128, 49, 74,240,225,242,229,\n    238,235,239,242,229,225,110,128, 50,  9,111,  2, 67,160, 67,210,\n    227,104,  3, 67,169, 67,191, 67,201,225,110,  2, 67,176, 67,184,\n    231,244,232,225,105,128, 14, 10,244,232,225,105,128, 14,  8,233,\n    238,231,244,232,225,105,128, 14,  9,239,229,244,232,225,105,128,\n     14, 12,239,107,128,  1,136,105,  2, 67,221, 68, 67,229,245, 99,\n      5, 67,235, 68, 14, 68, 29, 68, 38, 68, 52, 97,  2, 67,241, 68,\n      0,227,233,242,227,236,229,235,239,242,229,225,110,128, 50,118,\n    240,225,242,229,238,235,239,242,229,225,110,128, 50, 22,227,233,\n    242,227,236,229,235,239,242,229,225,110,128, 50,104,235,239,242,\n    229,225,110,128, 49, 72,240,225,242,229,238,235,239,242,229,225,\n    110,128, 50,  8,245,240,225,242,229,238,235,239,242,229,225,110,\n    128, 50, 28,242, 99,  2, 68, 74, 68,169,236,101,132, 37,203, 68,\n     87, 68, 98, 68,103, 68,127,237,245,236,244,233,240,236,121,128,\n     34,151,239,116,128, 34,153,112,  2, 68,109, 68,115,236,245,115,\n    128, 34,149,239,243,244,225,236,237,225,242,107,128, 48, 54,247,\n    233,244,104,  2, 68,136, 68,152,236,229,230,244,232,225,236,230,\n    226,236,225,227,107,128, 37,208,242,233,231,232,244,232,225,236,\n    230,226,236,225,227,107,128, 37,209,245,237,230,236,229,120,130,\n      2,198, 68,182, 68,193,226,229,236,239,247,227,237, 98,128,  3,\n     45,227,237, 98,128,  3,  2,108,  3, 68,207, 68,213, 69, 11,229,\n    225,114,128, 35, 39,233,227,107,  4, 68,225, 68,236, 68,245, 68,\n    255,225,236,246,229,239,236,225,114,128,  1,194,228,229,238,244,\n    225,108,128,  1,192,236,225,244,229,242,225,108,128,  1,193,242,\n    229,244,242,239,230,236,229,120,128,  1,195,245, 98,129, 38, 99,\n     69, 18,243,245,233,116,  2, 69, 27, 69, 35,226,236,225,227,107,\n    128, 38, 99,247,232,233,244,101,128, 38,103,109,  3, 69, 51, 69,\n     65, 69, 76,227,245,226,229,228,243,241,245,225,242,101,128, 51,\n    164,239,238,239,243,240,225,227,101,128,255, 67,243,241,245,225,\n    242,229,228,243,241,245,225,242,101,128, 51,160,111,  8, 69,110,\n     69,121, 69,208, 70,150, 71,179, 71,210, 72, 61, 72, 70,225,242,\n    237,229,238,233,225,110,128,  5,129,236,239,110,131,  0, 58, 69,\n    133, 69,158, 69,177,237,239,110,  2, 69,141, 69,149,229,244,225,\n    242,121,128, 32,161,239,243,240,225,227,101,128,255, 26,115,  2,\n     69,164, 69,170,233,231,110,128, 32,161,237,225,236,108,128,254,\n     85,244,242,233,225,238,231,245,236,225,114,  2, 69,192, 69,202,\n    232,225,236,230,237,239,100,128,  2,209,237,239,100,128,  2,208,\n    109,  2, 69,214, 70,143,237, 97,134,  0, 44, 69,231, 70, 39, 70,\n     50, 70, 62, 70, 92, 70,115, 97,  3, 69,239, 70,  9, 70, 17,226,\n    239,246,101,  2, 69,248, 69,254,227,237, 98,128,  3, 19,242,233,\n    231,232,244,227,237, 98,128,  3, 21,227,227,229,238,116,128,246,\n    195,114,  2, 70, 23, 70, 30,225,226,233, 99,128,  6, 12,237,229,\n    238,233,225,110,128,  5, 93,233,238,230,229,242,233,239,114,128,\n    246,225,237,239,238,239,243,240,225,227,101,128,255, 12,242,229,\n    246,229,242,243,229,100,  2, 70, 75, 70, 86,225,226,239,246,229,\n    227,237, 98,128,  3, 20,237,239,100,128,  2,189,115,  2, 70, 98,\n     70,105,237,225,236,108,128,254, 80,245,240,229,242,233,239,114,\n    128,246,226,244,245,242,238,229,100,  2, 70,126, 70,137,225,226,\n    239,246,229,227,237, 98,128,  3, 18,237,239,100,128,  2,187,240,\n    225,243,115,128, 38, 60,110,  2, 70,156, 70,165,231,242,245,229,\n    238,116,128, 34, 69,116,  2, 70,171, 70,185,239,245,242,233,238,\n    244,229,231,242,225,108,128, 34, 46,242,239,108,142, 35,  3, 70,\n    219, 70,225, 70,240, 70,255, 71, 43, 71, 88, 71,102, 71,107, 71,\n    112, 71,117, 71,123, 71,128, 71,169, 71,174,193,195, 75,128,  0,\n      6, 66,  2, 70,231, 70,236,197, 76,128,  0,  7, 83,128,  0,  8,\n     67,  2, 70,246, 70,251,193, 78,128,  0, 24, 82,128,  0, 13, 68,\n      3, 71,  7, 71, 33, 71, 38, 67,  4, 71, 17, 71, 21, 71, 25, 71,\n     29, 49,128,  0, 17, 50,128,  0, 18, 51,128,  0, 19, 52,128,  0,\n     20,197, 76,128,  0,127,204, 69,128,  0, 16, 69,  5, 71, 55, 71,\n     59, 71, 64, 71, 69, 71, 74, 77,128,  0, 25,206, 81,128,  0,  5,\n    207, 84,128,  0,  4,211, 67,128,  0, 27, 84,  2, 71, 80, 71, 84,\n     66,128,  0, 23, 88,128,  0,  3, 70,  2, 71, 94, 71, 98, 70,128,\n      0, 12, 83,128,  0, 28,199, 83,128,  0, 29,200, 84,128,  0,  9,\n    204, 70,128,  0, 10,206,193, 75,128,  0, 21,210, 83,128,  0, 30,\n     83,  5, 71,140, 71,144, 71,154, 71,159, 71,164, 73,128,  0, 15,\n     79,129,  0, 14, 71,150, 84,128,  0,  2,212, 88,128,  0,  1,213,\n     66,128,  0, 26,217, 78,128,  0, 22,213, 83,128,  0, 31,214, 84,\n    128,  0, 11,240,249,242,233,231,232,116,129,  0,169, 71,191,115,\n      2, 71,197, 71,203,225,238,115,128,248,233,229,242,233,102,128,\n    246,217,114,  2, 71,216, 72, 44,238,229,242,226,242,225,227,235,\n    229,116,  2, 71,231, 72,  9,236,229,230,116,130, 48, 12, 71,242,\n     71,254,232,225,236,230,247,233,228,244,104,128,255, 98,246,229,\n    242,244,233,227,225,108,128,254, 65,242,233,231,232,116,130, 48,\n     13, 72, 21, 72, 33,232,225,236,230,247,233,228,244,104,128,255,\n     99,246,229,242,244,233,227,225,108,128,254, 66,240,239,242,225,\n    244,233,239,238,243,241,245,225,242,101,128, 51,127,243,241,245,\n    225,242,101,128, 51,199,246,229,242,235,231,243,241,245,225,242,\n    101,128, 51,198,240,225,242,229,110,128, 36,158,242,245,250,229,\n    233,242,111,128, 32,162,243,244,242,229,244,227,232,229,100,128,\n      2,151,245,114,  2, 72,121, 72,139,236,121,  2, 72,128, 72,134,\n    225,238,100,128, 34,207,239,114,128, 34,206,242,229,238,227,121,\n    128,  0,164,249,114,  4, 72,158, 72,166, 72,173, 72,181,194,242,\n    229,246,101,128,246,209,198,236,229,120,128,246,210,226,242,229,\n    246,101,128,246,212,230,236,229,120,128,246,213,100,146,  0,100,\n     72,228, 74,110, 75,134, 75,194, 76,114, 77, 68, 77,130, 78, 59,\n     78, 72, 78, 81, 78,107, 78,132, 78,141, 79,208, 79,216, 79,227,\n     79,247, 80, 19, 97, 11, 72,252, 73,  7, 73, 17, 73, 89, 73,152,\n     73,163, 73,174, 73,243, 74, 49, 74, 55, 74, 85,225,242,237,229,\n    238,233,225,110,128,  5,100,226,229,238,231,225,236,105,128,  9,\n    166,100,  5, 73, 29, 73, 38, 73, 44, 73, 58, 73, 74,225,242,225,\n    226,233, 99,128,  6, 54,229,246, 97,128,  9, 38,230,233,238,225,\n    236,225,242,225,226,233, 99,128,254,190,233,238,233,244,233,225,\n    236,225,242,225,226,233, 99,128,254,191,237,229,228,233,225,236,\n    225,242,225,226,233, 99,128,254,192,103,  3, 73, 97, 73,114, 73,\n    128,229,243,104,129,  5,188, 73,105,232,229,226,242,229,119,128,\n      5,188,231,229,114,129, 32, 32, 73,122,228,226,108,128, 32, 33,\n    117,  2, 73,134, 73,143,234,225,242,225,244,105,128, 10,166,242,\n    237,245,235,232,105,128, 10, 38,232,233,242,225,231,225,238, 97,\n    128, 48, 96,235,225,244,225,235,225,238, 97,128, 48,192,108,  3,\n     73,182, 73,191, 73,229,225,242,225,226,233, 99,128,  6, 47,229,\n    116,130,  5,211, 73,200, 73,220,228,225,231,229,243,104,129,251,\n     51, 73,211,232,229,226,242,229,119,128,251, 51,232,229,226,242,\n    229,119,128,  5,211,230,233,238,225,236,225,242,225,226,233, 99,\n    128,254,170,237,237, 97,  3, 73,253, 74,  6, 74, 18,225,242,225,\n    226,233, 99,128,  6, 79,236,239,247,225,242,225,226,233, 99,128,\n      6, 79,244,225,238, 97,  2, 74, 27, 74, 41,236,244,239,238,229,\n    225,242,225,226,233, 99,128,  6, 76,242,225,226,233, 99,128,  6,\n     76,238,228, 97,128,  9,100,242,231, 97,  2, 74, 63, 74, 72,232,\n    229,226,242,229,119,128,  5,167,236,229,230,244,232,229,226,242,\n    229,119,128,  5,167,243,233,225,240,238,229,245,237,225,244,225,\n    227,249,242,233,236,236,233,227,227,237, 98,128,  4,133, 98,  3,\n     74,118, 75,115, 75,125,108,  9, 74,138, 74,146, 75,  3, 75, 11,\n     75, 27, 75, 38, 75, 56, 75, 70, 75, 81,199,242,225,246,101,128,\n    246,211, 97,  2, 74,152, 74,209,238,231,236,229,226,242,225,227,\n    235,229,116,  2, 74,168, 74,188,236,229,230,116,129, 48, 10, 74,\n    177,246,229,242,244,233,227,225,108,128,254, 61,242,233,231,232,\n    116,129, 48, 11, 74,198,246,229,242,244,233,227,225,108,128,254,\n     62,114,  2, 74,215, 74,236,227,232,233,238,246,229,242,244,229,\n    228,226,229,236,239,247,227,237, 98,128,  3, 43,242,239,119,  2,\n     74,244, 74,251,236,229,230,116,128, 33,212,242,233,231,232,116,\n    128, 33,210,228,225,238,228, 97,128,  9,101,231,242,225,246,101,\n    129,246,214, 75, 21,227,237, 98,128,  3, 15,233,238,244,229,231,\n    242,225,108,128, 34, 44,236,239,247,236,233,238,101,129, 32, 23,\n     75, 50,227,237, 98,128,  3, 51,239,246,229,242,236,233,238,229,\n    227,237, 98,128,  3, 63,240,242,233,237,229,237,239,100,128,  2,\n    186,246,229,242,244,233,227,225,108,  2, 75, 94, 75,100,226,225,\n    114,128, 32, 22,236,233,238,229,225,226,239,246,229,227,237, 98,\n    128,  3, 14,239,240,239,237,239,230,111,128, 49,  9,243,241,245,\n    225,242,101,128, 51,200, 99,  4, 75,144, 75,151, 75,160, 75,187,\n    225,242,239,110,128,  1, 15,229,228,233,236,236, 97,128, 30, 17,\n    233,242, 99,  2, 75,168, 75,173,236,101,128, 36,211,245,237,230,\n    236,229,248,226,229,236,239,119,128, 30, 19,242,239,225,116,128,\n      1, 17,100,  4, 75,204, 76, 29, 76, 39, 76, 90, 97,  4, 75,214,\n     75,224, 75,231, 76,  0,226,229,238,231,225,236,105,128,  9,161,\n    228,229,246, 97,128,  9, 33,231,117,  2, 75,238, 75,247,234,225,\n    242,225,244,105,128, 10,161,242,237,245,235,232,105,128, 10, 33,\n    108,  2, 76,  6, 76, 15,225,242,225,226,233, 99,128,  6,136,230,\n    233,238,225,236,225,242,225,226,233, 99,128,251,137,228,232,225,\n    228,229,246, 97,128,  9, 92,232, 97,  3, 76, 48, 76, 58, 76, 65,\n    226,229,238,231,225,236,105,128,  9,162,228,229,246, 97,128,  9,\n     34,231,117,  2, 76, 72, 76, 81,234,225,242,225,244,105,128, 10,\n    162,242,237,245,235,232,105,128, 10, 34,239,116,  2, 76, 97, 76,\n    106,225,227,227,229,238,116,128, 30, 11,226,229,236,239,119,128,\n     30, 13,101,  8, 76,132, 76,185, 76,192, 76,217, 76,227, 76,238,\n     77, 27, 77, 63, 99,  2, 76,138, 76,175,233,237,225,236,243,229,\n    240,225,242,225,244,239,114,  2, 76,156, 76,165,225,242,225,226,\n    233, 99,128,  6,107,240,229,242,243,233,225,110,128,  6,107,249,\n    242,233,236,236,233, 99,128,  4, 52,231,242,229,101,128,  0,176,\n    232,105,  2, 76,199, 76,208,232,229,226,242,229,119,128,  5,173,\n    242,225,231,225,238, 97,128, 48,103,233,227,239,240,244,233, 99,\n    128,  3,239,235,225,244,225,235,225,238, 97,128, 48,199,108,  2,\n     76,244, 77, 11,229,244,101,  2, 76,252, 77,  3,236,229,230,116,\n    128, 35, 43,242,233,231,232,116,128, 35, 38,244, 97,129,  3,180,\n     77, 18,244,245,242,238,229,100,128,  1,141,238,239,237,233,238,\n    225,244,239,242,237,233,238,245,243,239,238,229,238,245,237,229,\n    242,225,244,239,242,226,229,238,231,225,236,105,128,  9,248,250,\n    104,128,  2,164,104,  2, 77, 74, 77,124, 97,  3, 77, 82, 77, 92,\n     77, 99,226,229,238,231,225,236,105,128,  9,167,228,229,246, 97,\n    128,  9, 39,231,117,  2, 77,106, 77,115,234,225,242,225,244,105,\n    128, 10,167,242,237,245,235,232,105,128, 10, 39,239,239,107,128,\n      2, 87,105,  6, 77,144, 77,193, 77,253, 78,  8, 78, 19, 78, 29,\n     97,  2, 77,150, 77,172,236,249,244,233,235,225,244,239,238,239,\n    115,129,  3,133, 77,166,227,237, 98,128,  3, 68,237,239,238,100,\n    129, 38,102, 77,181,243,245,233,244,247,232,233,244,101,128, 38,\n     98,229,242,229,243,233,115,133,  0,168, 77,212, 77,220, 77,231,\n     77,237, 77,245,225,227,245,244,101,128,246,215,226,229,236,239,\n    247,227,237, 98,128,  3, 36,227,237, 98,128,  3,  8,231,242,225,\n    246,101,128,246,216,244,239,238,239,115,128,  3,133,232,233,242,\n    225,231,225,238, 97,128, 48, 98,235,225,244,225,235,225,238, 97,\n    128, 48,194,244,244,239,237,225,242,107,128, 48,  3,246,105,  2,\n     78, 36, 78, 47,228,101,129,  0,247, 78, 43,115,128, 34, 35,243,\n    233,239,238,243,236,225,243,104,128, 34, 21,234,229,227,249,242,\n    233,236,236,233, 99,128,  4, 82,235,243,232,225,228,101,128, 37,\n    147,108,  2, 78, 87, 78, 98,233,238,229,226,229,236,239,119,128,\n     30, 15,243,241,245,225,242,101,128, 51,151,109,  2, 78,113, 78,\n    121,225,227,242,239,110,128,  1, 17,239,238,239,243,240,225,227,\n    101,128,255, 68,238,226,236,239,227,107,128, 37,132,111, 10, 78,\n    163, 78,175, 78,185, 78,196, 78,207, 79, 23, 79, 28, 79, 39, 79,\n    154, 79,180,227,232,225,228,225,244,232,225,105,128, 14, 14,228,\n    229,235,244,232,225,105,128, 14, 20,232,233,242,225,231,225,238,\n     97,128, 48,105,235,225,244,225,235,225,238, 97,128, 48,201,236,\n    236,225,114,132,  0, 36, 78,222, 78,233, 78,245, 79,  0,233,238,\n    230,229,242,233,239,114,128,246,227,237,239,238,239,243,240,225,\n    227,101,128,255,  4,239,236,228,243,244,249,236,101,128,247, 36,\n    115,  2, 79,  6, 79, 13,237,225,236,108,128,254,105,245,240,229,\n    242,233,239,114,128,246,228,238,103,128, 32,171,242,245,243,241,\n    245,225,242,101,128, 51, 38,116,  6, 79, 53, 79, 70, 79, 92, 79,\n    103, 79,135, 79,142,225,227,227,229,238,116,129,  2,217, 79, 64,\n    227,237, 98,128,  3,  7,226,229,236,239,247, 99,  2, 79, 81, 79,\n     86,237, 98,128,  3, 35,239,237, 98,128,  3, 35,235,225,244,225,\n    235,225,238, 97,128, 48,251,236,229,243,115,  2, 79,112, 79,116,\n    105,128,  1, 49,106,129,246,190, 79,122,243,244,242,239,235,229,\n    232,239,239,107,128,  2,132,237,225,244,104,128, 34,197,244,229,\n    228,227,233,242,227,236,101,128, 37,204,245,226,236,229,249,239,\n    228,240,225,244,225,104,129,251, 31, 79,171,232,229,226,242,229,\n    119,128,251, 31,247,238,244,225,227,107,  2, 79,191, 79,202,226,\n    229,236,239,247,227,237, 98,128,  3, 30,237,239,100,128,  2,213,\n    240,225,242,229,110,128, 36,159,243,245,240,229,242,233,239,114,\n    128,246,235,116,  2, 79,233, 79,239,225,233,108,128,  2, 86,239,\n    240,226,225,114,128,  1,140,117,  2, 79,253, 80,  8,232,233,242,\n    225,231,225,238, 97,128, 48,101,235,225,244,225,235,225,238, 97,\n    128, 48,197,122,132,  1,243, 80, 31, 80, 40, 80, 59, 80, 96,225,\n    236,244,239,238,101,128,  2,163, 99,  2, 80, 46, 80, 53,225,242,\n    239,110,128,  1,198,245,242,108,128,  2,165,101,  2, 80, 65, 80,\n     85,225,226,235,232,225,243,233,225,238,227,249,242,233,236,236,\n    233, 99,128,  4,225,227,249,242,233,236,236,233, 99,128,  4, 85,\n    232,229,227,249,242,233,236,236,233, 99,128,  4, 95,101,151,  0,\n    101, 80,159, 80,178, 80,212, 81,186, 81,248, 82, 25, 82, 37, 82,\n     60, 82,113, 83,225, 84, 27, 84,129, 84,245, 85,124, 85,199, 85,\n    230, 86, 36, 86, 89, 87, 24, 87,157, 87,177, 87,221, 88, 56, 97,\n      2, 80,165, 80,172,227,245,244,101,128,  0,233,242,244,104,128,\n     38, 65, 98,  3, 80,186, 80,195, 80,205,229,238,231,225,236,105,\n    128,  9,143,239,240,239,237,239,230,111,128, 49, 28,242,229,246,\n    101,128,  1, 21, 99,  5, 80,224, 81, 41, 81, 55, 81, 87, 81,176,\n     97,  2, 80,230, 81, 35,238,228,242, 97,  3, 80,241, 80,248, 81,\n      3,228,229,246, 97,128,  9, 13,231,245,234,225,242,225,244,105,\n    128, 10,141,246,239,247,229,236,243,233,231,110,  2, 81, 17, 81,\n     24,228,229,246, 97,128,  9, 69,231,245,234,225,242,225,244,105,\n    128, 10,197,242,239,110,128,  1, 27,229,228,233,236,236,225,226,\n    242,229,246,101,128, 30, 29,104,  2, 81, 61, 81, 72,225,242,237,\n    229,238,233,225,110,128,  5,101,249,233,247,238,225,242,237,229,\n    238,233,225,110,128,  5,135,233,242, 99,  2, 81, 95, 81,100,236,\n    101,128, 36,212,245,237,230,236,229,120,134,  0,234, 81,121, 81,\n    129, 81,137, 81,148, 81,156, 81,168,225,227,245,244,101,128, 30,\n    191,226,229,236,239,119,128, 30, 25,228,239,244,226,229,236,239,\n    119,128, 30,199,231,242,225,246,101,128, 30,193,232,239,239,235,\n    225,226,239,246,101,128, 30,195,244,233,236,228,101,128, 30,197,\n    249,242,233,236,236,233, 99,128,  4, 84,100,  4, 81,196, 81,206,\n     81,212, 81,222,226,236,231,242,225,246,101,128,  2,  5,229,246,\n     97,128,  9, 15,233,229,242,229,243,233,115,128,  0,235,239,116,\n    130,  1, 23, 81,231, 81,240,225,227,227,229,238,116,128,  1, 23,\n    226,229,236,239,119,128, 30,185,101,  2, 81,254, 82,  9,231,245,\n    242,237,245,235,232,105,128, 10, 15,237,225,244,242,225,231,245,\n    242,237,245,235,232,105,128, 10, 71,230,227,249,242,233,236,236,\n    233, 99,128,  4, 68,103,  2, 82, 43, 82, 50,242,225,246,101,128,\n      0,232,245,234,225,242,225,244,105,128, 10,143,104,  4, 82, 70,\n     82, 81, 82, 92, 82,102,225,242,237,229,238,233,225,110,128,  5,\n    103,226,239,240,239,237,239,230,111,128, 49, 29,233,242,225,231,\n    225,238, 97,128, 48, 72,239,239,235,225,226,239,246,101,128, 30,\n    187,105,  4, 82,123, 82,134, 83,192, 83,207,226,239,240,239,237,\n    239,230,111,128, 49, 31,231,232,116,142,  0, 56, 82,168, 82,177,\n     82,187, 82,217, 82,224, 83,  6, 83, 31, 83, 76, 83,110, 83,122,\n     83,133, 83,166, 83,174, 83,185,225,242,225,226,233, 99,128,  6,\n    104,226,229,238,231,225,236,105,128,  9,238,227,233,242,227,236,\n    101,129, 36,103, 82,198,233,238,246,229,242,243,229,243,225,238,\n    243,243,229,242,233,102,128, 39,145,228,229,246, 97,128,  9,110,\n    229,229,110,  2, 82,232, 82,241,227,233,242,227,236,101,128, 36,\n    113,112,  2, 82,247, 82,254,225,242,229,110,128, 36,133,229,242,\n    233,239,100,128, 36,153,231,117,  2, 83, 13, 83, 22,234,225,242,\n    225,244,105,128, 10,238,242,237,245,235,232,105,128, 10,110,104,\n      2, 83, 37, 83, 63, 97,  2, 83, 43, 83, 54,227,235,225,242,225,\n    226,233, 99,128,  6,104,238,231,250,232,239,117,128, 48, 40,238,\n    239,244,229,226,229,225,237,229,100,128, 38,107,105,  2, 83, 82,\n     83,100,228,229,239,231,242,225,240,232,233,227,240,225,242,229,\n    110,128, 50, 39,238,230,229,242,233,239,114,128, 32,136,237,239,\n    238,239,243,240,225,227,101,128,255, 24,239,236,228,243,244,249,\n    236,101,128,247, 56,112,  2, 83,139, 83,146,225,242,229,110,128,\n     36,123,229,114,  2, 83,153, 83,159,233,239,100,128, 36,143,243,\n    233,225,110,128,  6,248,242,239,237,225,110,128, 33,119,243,245,\n    240,229,242,233,239,114,128, 32,120,244,232,225,105,128, 14, 88,\n    238,246,229,242,244,229,228,226,242,229,246,101,128,  2,  7,239,\n    244,233,230,233,229,228,227,249,242,233,236,236,233, 99,128,  4,\n    101,107,  2, 83,231, 83,255,225,244,225,235,225,238, 97,129, 48,\n    168, 83,243,232,225,236,230,247,233,228,244,104,128,255,116,111,\n      2, 84,  5, 84, 20,238,235,225,242,231,245,242,237,245,235,232,\n    105,128, 10,116,242,229,225,110,128, 49, 84,108,  3, 84, 35, 84,\n     46, 84,107,227,249,242,233,236,236,233, 99,128,  4, 59,101,  2,\n     84, 52, 84, 59,237,229,238,116,128, 34,  8,246,229,110,  3, 84,\n     69, 84, 78, 84, 99,227,233,242,227,236,101,128, 36,106,112,  2,\n     84, 84, 84, 91,225,242,229,110,128, 36,126,229,242,233,239,100,\n    128, 36,146,242,239,237,225,110,128, 33,122,236,233,240,243,233,\n    115,129, 32, 38, 84,118,246,229,242,244,233,227,225,108,128, 34,\n    238,109,  5, 84,141, 84,169, 84,180, 84,200, 84,211,225,227,242,\n    239,110,130,  1, 19, 84,153, 84,161,225,227,245,244,101,128, 30,\n     23,231,242,225,246,101,128, 30, 21,227,249,242,233,236,236,233,\n     99,128,  4, 60,228,225,243,104,129, 32, 20, 84,189,246,229,242,\n    244,233,227,225,108,128,254, 49,239,238,239,243,240,225,227,101,\n    128,255, 69,112,  2, 84,217, 84,237,232,225,243,233,243,237,225,\n    242,235,225,242,237,229,238,233,225,110,128,  5, 91,244,249,243,\n    229,116,128, 34,  5,110,  6, 85,  3, 85, 14, 85, 25, 85, 69, 85,\n    101, 85,116,226,239,240,239,237,239,230,111,128, 49, 35,227,249,\n    242,233,236,236,233, 99,128,  4, 61,100,  2, 85, 31, 85, 50,225,\n    243,104,129, 32, 19, 85, 39,246,229,242,244,233,227,225,108,128,\n    254, 50,229,243,227,229,238,228,229,242,227,249,242,233,236,236,\n    233, 99,128,  4,163,103,130,  1, 75, 85, 77, 85, 88,226,239,240,\n    239,237,239,230,111,128, 49, 37,232,229,227,249,242,233,236,236,\n    233, 99,128,  4,165,232,239,239,235,227,249,242,233,236,236,233,\n     99,128,  4,200,243,240,225,227,101,128, 32,  2,111,  3, 85,132,\n     85,140, 85,149,231,239,238,229,107,128,  1, 25,235,239,242,229,\n    225,110,128, 49, 83,240,229,110,130,  2, 91, 85,159, 85,168,227,\n    236,239,243,229,100,128,  2,154,242,229,246,229,242,243,229,100,\n    130,  2, 92, 85,183, 85,192,227,236,239,243,229,100,128,  2, 94,\n    232,239,239,107,128,  2, 93,112,  2, 85,205, 85,212,225,242,229,\n    110,128, 36,160,243,233,236,239,110,129,  3,181, 85,222,244,239,\n    238,239,115,128,  3,173,241,117,  2, 85,237, 86, 25,225,108,130,\n      0, 61, 85,246, 86,  2,237,239,238,239,243,240,225,227,101,128,\n    255, 29,115,  2, 86,  8, 86, 15,237,225,236,108,128,254,102,245,\n    240,229,242,233,239,114,128, 32,124,233,246,225,236,229,238,227,\n    101,128, 34, 97,114,  3, 86, 44, 86, 55, 86, 66,226,239,240,239,\n    237,239,230,111,128, 49, 38,227,249,242,233,236,236,233, 99,128,\n      4, 64,229,246,229,242,243,229,100,129,  2, 88, 86, 78,227,249,\n    242,233,236,236,233, 99,128,  4, 77,115,  6, 86,103, 86,114, 86,\n    134, 86,215, 87,  4, 87, 14,227,249,242,233,236,236,233, 99,128,\n      4, 65,228,229,243,227,229,238,228,229,242,227,249,242,233,236,\n    236,233, 99,128,  4,171,104,132,  2,131, 86,146, 86,153, 86,184,\n     86,199,227,245,242,108,128,  2,134,239,242,116,  2, 86,161, 86,\n    168,228,229,246, 97,128,  9, 14,246,239,247,229,236,243,233,231,\n    238,228,229,246, 97,128,  9, 70,242,229,246,229,242,243,229,228,\n    236,239,239,112,128,  1,170,243,241,245,225,244,242,229,246,229,\n    242,243,229,100,128,  2,133,237,225,236,108,  2, 86,224, 86,235,\n    232,233,242,225,231,225,238, 97,128, 48, 71,235,225,244,225,235,\n    225,238, 97,129, 48,167, 86,248,232,225,236,230,247,233,228,244,\n    104,128,255,106,244,233,237,225,244,229,100,128, 33, 46,245,240,\n    229,242,233,239,114,128,246,236,116,  5, 87, 36, 87, 62, 87, 66,\n     87, 83, 87,149, 97,130,  3,183, 87, 44, 87, 54,242,237,229,238,\n    233,225,110,128,  5,104,244,239,238,239,115,128,  3,174,104,128,\n      0,240,233,236,228,101,129, 30,189, 87, 75,226,229,236,239,119,\n    128, 30, 27,238,225,232,244, 97,  3, 87, 95, 87,127, 87,136,230,\n    239,245,235,104,  2, 87,105, 87,114,232,229,226,242,229,119,128,\n      5,145,236,229,230,244,232,229,226,242,229,119,128,  5,145,232,\n    229,226,242,229,119,128,  5,145,236,229,230,244,232,229,226,242,\n    229,119,128,  5,145,245,242,238,229,100,128,  1,221,117,  2, 87,\n    163, 87,172,235,239,242,229,225,110,128, 49, 97,242,111,128, 32,\n    172,246,239,247,229,236,243,233,231,110,  3, 87,193, 87,203, 87,\n    210,226,229,238,231,225,236,105,128,  9,199,228,229,246, 97,128,\n      9, 71,231,245,234,225,242,225,244,105,128, 10,199,120,  2, 87,\n    227, 88, 44,227,236,225,109,132,  0, 33, 87,242, 87,253, 88, 24,\n     88, 36,225,242,237,229,238,233,225,110,128,  5, 92,100,  2, 88,\n      3, 88,  8,226,108,128, 32, 60,239,247,110,129,  0,161, 88, 16,\n    243,237,225,236,108,128,247,161,237,239,238,239,243,240,225,227,\n    101,128,255,  1,243,237,225,236,108,128,247, 33,233,243,244,229,\n    238,244,233,225,108,128, 34,  3,250,104,131,  2,146, 88, 67, 88,\n     86, 88, 97, 99,  2, 88, 73, 88, 80,225,242,239,110,128,  1,239,\n    245,242,108,128,  2,147,242,229,246,229,242,243,229,100,128,  1,\n    185,244,225,233,108,128,  1,186,102,140,  0,102, 88,132, 88,214,\n     88,225, 88,234, 88,246, 89, 93, 89,109, 91,117, 91,130, 91,156,\n     93, 33, 93, 41, 97,  4, 88,142, 88,149, 88,160, 88,171,228,229,\n    246, 97,128,  9, 94,231,245,242,237,245,235,232,105,128, 10, 94,\n    232,242,229,238,232,229,233,116,128, 33,  9,244,232, 97,  3, 88,\n    181, 88,190, 88,202,225,242,225,226,233, 99,128,  6, 78,236,239,\n    247,225,242,225,226,233, 99,128,  6, 78,244,225,238,225,242,225,\n    226,233, 99,128,  6, 75,226,239,240,239,237,239,230,111,128, 49,\n      8,227,233,242,227,236,101,128, 36,213,228,239,244,225,227,227,\n    229,238,116,128, 30, 31,101,  3, 88,254, 89, 76, 89, 86,104,  4,\n     89,  8, 89, 31, 89, 45, 89, 61,225,114,  2, 89, 15, 89, 22,225,\n    226,233, 99,128,  6, 65,237,229,238,233,225,110,128,  5,134,230,\n    233,238,225,236,225,242,225,226,233, 99,128,254,210,233,238,233,\n    244,233,225,236,225,242,225,226,233, 99,128,254,211,237,229,228,\n    233,225,236,225,242,225,226,233, 99,128,254,212,233,227,239,240,\n    244,233, 99,128,  3,229,237,225,236,101,128, 38, 64,102,130,251,\n      0, 89,101, 89,105,105,128,251,  3,108,128,251,  4,105,136,251,\n      1, 89,129, 89,169, 89,180, 89,202, 90, 68, 90, 85, 90, 93, 90,\n    106,230,244,229,229,110,  2, 89,139, 89,148,227,233,242,227,236,\n    101,128, 36,110,112,  2, 89,154, 89,161,225,242,229,110,128, 36,\n    130,229,242,233,239,100,128, 36,150,231,245,242,229,228,225,243,\n    104,128, 32, 18,236,236,229,100,  2, 89,189, 89,195,226,239,120,\n    128, 37,160,242,229,227,116,128, 37,172,238,225,108,  5, 89,216,\n     89,255, 90, 16, 90, 33, 90, 49,235,225,102,130,  5,218, 89,226,\n     89,246,228,225,231,229,243,104,129,251, 58, 89,237,232,229,226,\n    242,229,119,128,251, 58,232,229,226,242,229,119,128,  5,218,237,\n    229,109,129,  5,221, 90,  7,232,229,226,242,229,119,128,  5,221,\n    238,245,110,129,  5,223, 90, 24,232,229,226,242,229,119,128,  5,\n    223,240,101,129,  5,227, 90, 40,232,229,226,242,229,119,128,  5,\n    227,244,243,225,228,105,129,  5,229, 90, 59,232,229,226,242,229,\n    119,128,  5,229,242,243,244,244,239,238,229,227,232,233,238,229,\n    243,101,128,  2,201,243,232,229,249,101,128, 37,201,244,225,227,\n    249,242,233,236,236,233, 99,128,  4,115,246,101,142,  0, 53, 90,\n    139, 90,148, 90,158, 90,188, 90,195, 90,205, 90,230, 91,  1, 91,\n     35, 91, 47, 91, 58, 91, 91, 91, 99, 91,110,225,242,225,226,233,\n     99,128,  6,101,226,229,238,231,225,236,105,128,  9,235,227,233,\n    242,227,236,101,129, 36,100, 90,169,233,238,246,229,242,243,229,\n    243,225,238,243,243,229,242,233,102,128, 39,142,228,229,246, 97,\n    128,  9,107,229,233,231,232,244,232,115,128, 33, 93,231,117,  2,\n     90,212, 90,221,234,225,242,225,244,105,128, 10,235,242,237,245,\n    235,232,105,128, 10,107,232, 97,  2, 90,237, 90,248,227,235,225,\n    242,225,226,233, 99,128,  6,101,238,231,250,232,239,117,128, 48,\n     37,105,  2, 91,  7, 91, 25,228,229,239,231,242,225,240,232,233,\n    227,240,225,242,229,110,128, 50, 36,238,230,229,242,233,239,114,\n    128, 32,133,237,239,238,239,243,240,225,227,101,128,255, 21,239,\n    236,228,243,244,249,236,101,128,247, 53,112,  2, 91, 64, 91, 71,\n    225,242,229,110,128, 36,120,229,114,  2, 91, 78, 91, 84,233,239,\n    100,128, 36,140,243,233,225,110,128,  6,245,242,239,237,225,110,\n    128, 33,116,243,245,240,229,242,233,239,114,128, 32,117,244,232,\n    225,105,128, 14, 85,108,129,251,  2, 91,123,239,242,233,110,128,\n      1,146,109,  2, 91,136, 91,147,239,238,239,243,240,225,227,101,\n    128,255, 70,243,241,245,225,242,101,128, 51,153,111,  4, 91,166,\n     91,188, 91,200, 91,207,230, 97,  2, 91,173, 91,181,238,244,232,\n    225,105,128, 14, 31,244,232,225,105,128, 14, 29,238,231,237,225,\n    238,244,232,225,105,128, 14, 79,242,225,236,108,128, 34,  0,245,\n    114,142,  0, 52, 91,240, 91,249, 92,  3, 92, 33, 92, 40, 92, 65,\n     92, 92, 92,126, 92,138, 92,157, 92,168, 92,201, 92,209, 92,220,\n    225,242,225,226,233, 99,128,  6,100,226,229,238,231,225,236,105,\n    128,  9,234,227,233,242,227,236,101,129, 36, 99, 92, 14,233,238,\n    246,229,242,243,229,243,225,238,243,243,229,242,233,102,128, 39,\n    141,228,229,246, 97,128,  9,106,231,117,  2, 92, 47, 92, 56,234,\n    225,242,225,244,105,128, 10,234,242,237,245,235,232,105,128, 10,\n    106,232, 97,  2, 92, 72, 92, 83,227,235,225,242,225,226,233, 99,\n    128,  6,100,238,231,250,232,239,117,128, 48, 36,105,  2, 92, 98,\n     92,116,228,229,239,231,242,225,240,232,233,227,240,225,242,229,\n    110,128, 50, 35,238,230,229,242,233,239,114,128, 32,132,237,239,\n    238,239,243,240,225,227,101,128,255, 20,238,245,237,229,242,225,\n    244,239,242,226,229,238,231,225,236,105,128,  9,247,239,236,228,\n    243,244,249,236,101,128,247, 52,112,  2, 92,174, 92,181,225,242,\n    229,110,128, 36,119,229,114,  2, 92,188, 92,194,233,239,100,128,\n     36,139,243,233,225,110,128,  6,244,242,239,237,225,110,128, 33,\n    115,243,245,240,229,242,233,239,114,128, 32,116,116,  2, 92,226,\n     93,  8,229,229,110,  2, 92,234, 92,243,227,233,242,227,236,101,\n    128, 36,109,112,  2, 92,249, 93,  0,225,242,229,110,128, 36,129,\n    229,242,233,239,100,128, 36,149,104,  2, 93, 14, 93, 19,225,105,\n    128, 14, 84,244,239,238,229,227,232,233,238,229,243,101,128,  2,\n    203,240,225,242,229,110,128, 36,161,242, 97,  2, 93, 48, 93, 56,\n    227,244,233,239,110,128, 32, 68,238, 99,128, 32,163,103,144,  0,\n    103, 93, 97, 94, 43, 94, 66, 94,127, 94,144, 95, 65, 96, 58, 96,\n    143, 96,156, 97, 14, 97, 39, 97, 67, 97, 89, 98, 34, 98, 56, 98,\n    158, 97,  9, 93,117, 93,127, 93,134, 93,141, 93,205, 93,230, 93,\n    241, 93,252, 94, 30,226,229,238,231,225,236,105,128,  9,151,227,\n    245,244,101,128,  1,245,228,229,246, 97,128,  9, 23,102,  4, 93,\n    151, 93,160, 93,174, 93,190,225,242,225,226,233, 99,128,  6,175,\n    230,233,238,225,236,225,242,225,226,233, 99,128,251,147,233,238,\n    233,244,233,225,236,225,242,225,226,233, 99,128,251,148,237,229,\n    228,233,225,236,225,242,225,226,233, 99,128,251,149,231,117,  2,\n     93,212, 93,221,234,225,242,225,244,105,128, 10,151,242,237,245,\n    235,232,105,128, 10, 23,232,233,242,225,231,225,238, 97,128, 48,\n     76,235,225,244,225,235,225,238, 97,128, 48,172,237,237, 97,130,\n      3,179, 94,  6, 94, 19,236,225,244,233,238,243,237,225,236,108,\n    128,  2, 99,243,245,240,229,242,233,239,114,128,  2,224,238,231,\n    233,225,227,239,240,244,233, 99,128,  3,235, 98,  2, 94, 49, 94,\n     59,239,240,239,237,239,230,111,128, 49, 13,242,229,246,101,128,\n      1, 31, 99,  4, 94, 76, 94, 83, 94, 92, 94,114,225,242,239,110,\n    128,  1,231,229,228,233,236,236, 97,128,  1, 35,233,242, 99,  2,\n     94,100, 94,105,236,101,128, 36,214,245,237,230,236,229,120,128,\n      1, 29,239,237,237,225,225,227,227,229,238,116,128,  1, 35,228,\n    239,116,129,  1, 33, 94,135,225,227,227,229,238,116,128,  1, 33,\n    101,  6, 94,158, 94,169, 94,180, 94,191, 94,210, 95, 56,227,249,\n    242,233,236,236,233, 99,128,  4, 51,232,233,242,225,231,225,238,\n     97,128, 48, 82,235,225,244,225,235,225,238, 97,128, 48,178,239,\n    237,229,244,242,233,227,225,236,236,249,229,241,245,225,108,128,\n     34, 81,114,  3, 94,218, 95, 11, 95, 21,229,243,104,  3, 94,228,\n     94,243, 94,252,225,227,227,229,238,244,232,229,226,242,229,119,\n    128,  5,156,232,229,226,242,229,119,128,  5,243,237,245,241,228,\n    225,237,232,229,226,242,229,119,128,  5,157,237,225,238,228,226,\n    236,115,128,  0,223,243,232,225,249,233,109,  2, 95, 32, 95, 47,\n    225,227,227,229,238,244,232,229,226,242,229,119,128,  5,158,232,\n    229,226,242,229,119,128,  5,244,244,225,237,225,242,107,128, 48,\n     19,104,  5, 95, 77, 95,210, 96, 17, 96, 42, 96, 48, 97,  4, 95,\n     87, 95, 97, 95,120, 95,145,226,229,238,231,225,236,105,128,  9,\n    152,100,  2, 95,103, 95,114,225,242,237,229,238,233,225,110,128,\n      5,114,229,246, 97,128,  9, 24,231,117,  2, 95,127, 95,136,234,\n    225,242,225,244,105,128, 10,152,242,237,245,235,232,105,128, 10,\n     24,233,110,  4, 95,156, 95,165, 95,179, 95,195,225,242,225,226,\n    233, 99,128,  6, 58,230,233,238,225,236,225,242,225,226,233, 99,\n    128,254,206,233,238,233,244,233,225,236,225,242,225,226,233, 99,\n    128,254,207,237,229,228,233,225,236,225,242,225,226,233, 99,128,\n    254,208,101,  3, 95,218, 95,239, 96,  0,237,233,228,228,236,229,\n    232,239,239,235,227,249,242,233,236,236,233, 99,128,  4,149,243,\n    244,242,239,235,229,227,249,242,233,236,236,233, 99,128,  4,147,\n    245,240,244,245,242,238,227,249,242,233,236,236,233, 99,128,  4,\n    145,232, 97,  2, 96, 24, 96, 31,228,229,246, 97,128,  9, 90,231,\n    245,242,237,245,235,232,105,128, 10, 90,239,239,107,128,  2, 96,\n    250,243,241,245,225,242,101,128, 51,147,105,  3, 96, 66, 96, 77,\n     96, 88,232,233,242,225,231,225,238, 97,128, 48, 78,235,225,244,\n    225,235,225,238, 97,128, 48,174,109,  2, 96, 94, 96,105,225,242,\n    237,229,238,233,225,110,128,  5, 99,229,108,130,  5,210, 96,114,\n     96,134,228,225,231,229,243,104,129,251, 50, 96,125,232,229,226,\n    242,229,119,128,251, 50,232,229,226,242,229,119,128,  5,210,234,\n    229,227,249,242,233,236,236,233, 99,128,  4, 83,236,239,244,244,\n    225,108,  2, 96,167, 96,184,233,238,246,229,242,244,229,228,243,\n    244,242,239,235,101,128,  1,190,243,244,239,112,132,  2,148, 96,\n    199, 96,210, 96,216, 96,248,233,238,246,229,242,244,229,100,128,\n      2,150,237,239,100,128,  2,192,242,229,246,229,242,243,229,100,\n    130,  2,149, 96,231, 96,237,237,239,100,128,  2,193,243,245,240,\n    229,242,233,239,114,128,  2,228,243,244,242,239,235,101,129,  2,\n    161, 97,  3,242,229,246,229,242,243,229,100,128,  2,162,109,  2,\n     97, 20, 97, 28,225,227,242,239,110,128, 30, 33,239,238,239,243,\n    240,225,227,101,128,255, 71,111,  2, 97, 45, 97, 56,232,233,242,\n    225,231,225,238, 97,128, 48, 84,235,225,244,225,235,225,238, 97,\n    128, 48,180,240, 97,  2, 97, 74, 97, 80,242,229,110,128, 36,162,\n    243,241,245,225,242,101,128, 51,172,114,  2, 97, 95, 97,192, 97,\n      2, 97,101, 97,109,228,233,229,238,116,128, 34,  7,246,101,134,\n      0, 96, 97,126, 97,137, 97,154, 97,161, 97,170, 97,182,226,229,\n    236,239,247,227,237, 98,128,  3, 22, 99,  2, 97,143, 97,148,237,\n     98,128,  3,  0,239,237, 98,128,  3,  0,228,229,246, 97,128,  9,\n     83,236,239,247,237,239,100,128,  2,206,237,239,238,239,243,240,\n    225,227,101,128,255, 64,244,239,238,229,227,237, 98,128,  3, 64,\n    229,225,244,229,114,132,  0, 62, 97,208, 97,227, 97,239, 98, 26,\n    229,241,245,225,108,129, 34,101, 97,218,239,242,236,229,243,115,\n    128, 34,219,237,239,238,239,243,240,225,227,101,128,255, 30,111,\n      2, 97,245, 98, 15,114,  2, 97,251, 98,  8,229,241,245,233,246,\n    225,236,229,238,116,128, 34,115,236,229,243,115,128, 34,119,246,\n    229,242,229,241,245,225,108,128, 34,103,243,237,225,236,108,128,\n    254,101,115,  2, 98, 40, 98, 48,227,242,233,240,116,128,  2, 97,\n    244,242,239,235,101,128,  1,229,117,  4, 98, 66, 98, 77, 98,134,\n     98,145,232,233,242,225,231,225,238, 97,128, 48, 80,233,108,  2,\n     98, 84, 98,109,236,229,237,239,116,  2, 98, 94, 98,101,236,229,\n    230,116,128,  0,171,242,233,231,232,116,128,  0,187,243,233,238,\n    231,108,  2, 98,119, 98,126,236,229,230,116,128, 32, 57,242,233,\n    231,232,116,128, 32, 58,235,225,244,225,235,225,238, 97,128, 48,\n    176,242,225,237,245,243,241,245,225,242,101,128, 51, 24,249,243,\n    241,245,225,242,101,128, 51,201,104,144,  0,104, 98,204,101, 90,\n    101,125,101,162,101,202,103, 90,103,110,104, 75,104, 87,104, 99,\n    105,167,105,175,105,186,105,195,106, 19,106, 23, 97, 13, 98,232,\n     99, 15, 99, 25, 99, 55, 99, 80, 99,158, 99,170, 99,195, 99,210,\n     99,239, 99,252,100, 54,100, 63, 97,  2, 98,238, 99,  1,226,235,\n    232,225,243,233,225,238,227,249,242,233,236,236,233, 99,128,  4,\n    169,236,244,239,238,229,225,242,225,226,233, 99,128,  6,193,226,\n    229,238,231,225,236,105,128,  9,185,228,101,  2, 99, 32, 99, 50,\n    243,227,229,238,228,229,242,227,249,242,233,236,236,233, 99,128,\n      4,179,246, 97,128,  9, 57,231,117,  2, 99, 62, 99, 71,234,225,\n    242,225,244,105,128, 10,185,242,237,245,235,232,105,128, 10, 57,\n    104,  4, 99, 90, 99, 99, 99,113, 99,143,225,242,225,226,233, 99,\n    128,  6, 45,230,233,238,225,236,225,242,225,226,233, 99,128,254,\n    162,105,  2, 99,119, 99,134,238,233,244,233,225,236,225,242,225,\n    226,233, 99,128,254,163,242,225,231,225,238, 97,128, 48,111,237,\n    229,228,233,225,236,225,242,225,226,233, 99,128,254,164,233,244,\n    245,243,241,245,225,242,101,128, 51, 42,235,225,244,225,235,225,\n    238, 97,129, 48,207, 99,183,232,225,236,230,247,233,228,244,104,\n    128,255,138,236,225,238,244,231,245,242,237,245,235,232,105,128,\n     10, 77,237,250, 97,  2, 99,218, 99,227,225,242,225,226,233, 99,\n    128,  6, 33,236,239,247,225,242,225,226,233, 99,128,  6, 33,238,\n    231,245,236,230,233,236,236,229,114,128, 49,100,114,  2,100,  2,\n    100, 18,228,243,233,231,238,227,249,242,233,236,236,233, 99,128,\n      4, 74,240,239,239,110,  2,100, 27,100, 40,236,229,230,244,226,\n    225,242,226,245,112,128, 33,188,242,233,231,232,244,226,225,242,\n    226,245,112,128, 33,192,243,241,245,225,242,101,128, 51,202,244,\n    225,102,  3,100, 73,100,165,101,  0,240,225,244,225,104,134,  5,\n    178,100, 93,100, 98,100,112,100,121,100,136,100,152,177, 54,128,\n      5,178, 50,  2,100,104,100,108, 51,128,  5,178,102,128,  5,178,\n    232,229,226,242,229,119,128,  5,178,238,225,242,242,239,247,232,\n    229,226,242,229,119,128,  5,178,241,245,225,242,244,229,242,232,\n    229,226,242,229,119,128,  5,178,247,233,228,229,232,229,226,242,\n    229,119,128,  5,178,241,225,237,225,244,115,135,  5,179,100,188,\n    100,193,100,198,100,203,100,212,100,227,100,243,177, 98,128,  5,\n    179,178, 56,128,  5,179,179, 52,128,  5,179,232,229,226,242,229,\n    119,128,  5,179,238,225,242,242,239,247,232,229,226,242,229,119,\n    128,  5,179,241,245,225,242,244,229,242,232,229,226,242,229,119,\n    128,  5,179,247,233,228,229,232,229,226,242,229,119,128,  5,179,\n    243,229,231,239,108,135,  5,177,101, 22,101, 27,101, 32,101, 37,\n    101, 46,101, 61,101, 77,177, 55,128,  5,177,178, 52,128,  5,177,\n    179, 48,128,  5,177,232,229,226,242,229,119,128,  5,177,238,225,\n    242,242,239,247,232,229,226,242,229,119,128,  5,177,241,245,225,\n    242,244,229,242,232,229,226,242,229,119,128,  5,177,247,233,228,\n    229,232,229,226,242,229,119,128,  5,177, 98,  3,101, 98,101,103,\n    101,113,225,114,128,  1, 39,239,240,239,237,239,230,111,128, 49,\n     15,242,229,246,229,226,229,236,239,119,128, 30, 43, 99,  2,101,\n    131,101,140,229,228,233,236,236, 97,128, 30, 41,233,242, 99,  2,\n    101,148,101,153,236,101,128, 36,215,245,237,230,236,229,120,128,\n      1, 37,100,  2,101,168,101,178,233,229,242,229,243,233,115,128,\n     30, 39,239,116,  2,101,185,101,194,225,227,227,229,238,116,128,\n     30, 35,226,229,236,239,119,128, 30, 37,101,136,  5,212,101,222,\n    101,255,102, 19,102,248,103,  8,103, 53,103, 62,103, 75,225,242,\n    116,129, 38,101,101,230,243,245,233,116,  2,101,239,101,247,226,\n    236,225,227,107,128, 38,101,247,232,233,244,101,128, 38, 97,228,\n    225,231,229,243,104,129,251, 52,102, 10,232,229,226,242,229,119,\n    128,251, 52,104,  6,102, 33,102, 61,102, 69,102,119,102,165,102,\n    214, 97,  2,102, 39,102, 53,236,244,239,238,229,225,242,225,226,\n    233, 99,128,  6,193,242,225,226,233, 99,128,  6, 71,229,226,242,\n    229,119,128,  5,212,230,233,238,225,236, 97,  2,102, 80,102,111,\n    236,116,  2,102, 87,102, 99,239,238,229,225,242,225,226,233, 99,\n    128,251,167,244,247,239,225,242,225,226,233, 99,128,254,234,242,\n    225,226,233, 99,128,254,234,232,225,237,250,225,225,226,239,246,\n    101,  2,102,134,102,148,230,233,238,225,236,225,242,225,226,233,\n     99,128,251,165,233,243,239,236,225,244,229,228,225,242,225,226,\n    233, 99,128,251,164,105,  2,102,171,102,205,238,233,244,233,225,\n    236, 97,  2,102,183,102,197,236,244,239,238,229,225,242,225,226,\n    233, 99,128,251,168,242,225,226,233, 99,128,254,235,242,225,231,\n    225,238, 97,128, 48,120,237,229,228,233,225,236, 97,  2,102,226,\n    102,240,236,244,239,238,229,225,242,225,226,233, 99,128,251,169,\n    242,225,226,233, 99,128,254,236,233,243,229,233,229,242,225,243,\n    241,245,225,242,101,128, 51,123,107,  2,103, 14,103, 38,225,244,\n    225,235,225,238, 97,129, 48,216,103, 26,232,225,236,230,247,233,\n    228,244,104,128,255,141,245,244,225,225,242,245,243,241,245,225,\n    242,101,128, 51, 54,238,231,232,239,239,107,128,  2,103,242,245,\n    244,245,243,241,245,225,242,101,128, 51, 57,116,129,  5,215,103,\n     81,232,229,226,242,229,119,128,  5,215,232,239,239,107,129,  2,\n    102,103, 99,243,245,240,229,242,233,239,114,128,  2,177,105,  4,\n    103,120,103,205,103,216,103,241,229,245,104,  4,103,132,103,167,\n    103,182,103,191, 97,  2,103,138,103,153,227,233,242,227,236,229,\n    235,239,242,229,225,110,128, 50,123,240,225,242,229,238,235,239,\n    242,229,225,110,128, 50, 27,227,233,242,227,236,229,235,239,242,\n    229,225,110,128, 50,109,235,239,242,229,225,110,128, 49, 78,240,\n    225,242,229,238,235,239,242,229,225,110,128, 50, 13,232,233,242,\n    225,231,225,238, 97,128, 48,114,235,225,244,225,235,225,238, 97,\n    129, 48,210,103,229,232,225,236,230,247,233,228,244,104,128,255,\n    139,242,233,113,134,  5,180,104,  3,104,  8,104, 22,104, 31,104,\n     46,104, 62,177, 52,128,  5,180, 50,  2,104, 14,104, 18, 49,128,\n      5,180,100,128,  5,180,232,229,226,242,229,119,128,  5,180,238,\n    225,242,242,239,247,232,229,226,242,229,119,128,  5,180,241,245,\n    225,242,244,229,242,232,229,226,242,229,119,128,  5,180,247,233,\n    228,229,232,229,226,242,229,119,128,  5,180,236,233,238,229,226,\n    229,236,239,119,128, 30,150,237,239,238,239,243,240,225,227,101,\n    128,255, 72,111,  9,104,119,104,130,104,154,104,179,105, 11,105,\n     24,105,110,105,150,105,161,225,242,237,229,238,233,225,110,128,\n      5,112,232,105,  2,104,137,104,145,240,244,232,225,105,128, 14,\n     43,242,225,231,225,238, 97,128, 48,123,235,225,244,225,235,225,\n    238, 97,129, 48,219,104,167,232,225,236,230,247,233,228,244,104,\n    128,255,142,236,225,109,135,  5,185,104,199,104,204,104,209,104,\n    214,104,223,104,238,104,254,177, 57,128,  5,185,178, 54,128,  5,\n    185,179, 50,128,  5,185,232,229,226,242,229,119,128,  5,185,238,\n    225,242,242,239,247,232,229,226,242,229,119,128,  5,185,241,245,\n    225,242,244,229,242,232,229,226,242,229,119,128,  5,185,247,233,\n    228,229,232,229,226,242,229,119,128,  5,185,238,239,235,232,245,\n    235,244,232,225,105,128, 14, 46,111,  2,105, 30,105,100,107,  4,\n    105, 40,105, 52,105, 58,105, 80,225,226,239,246,229,227,239,237,\n     98,128,  3,  9,227,237, 98,128,  3,  9,240,225,236,225,244,225,\n    236,233,250,229,228,226,229,236,239,247,227,237, 98,128,  3, 33,\n    242,229,244,242,239,230,236,229,248,226,229,236,239,247,227,237,\n     98,128,  3, 34,238,243,241,245,225,242,101,128, 51, 66,114,  2,\n    105,116,105,143,105,  2,105,122,105,131,227,239,240,244,233, 99,\n    128,  3,233,250,239,238,244,225,236,226,225,114,128, 32, 21,238,\n    227,237, 98,128,  3, 27,244,243,240,242,233,238,231,115,128, 38,\n    104,245,243,101,128, 35,  2,240,225,242,229,110,128, 36,163,243,\n    245,240,229,242,233,239,114,128,  2,176,244,245,242,238,229,100,\n    128,  2,101,117,  4,105,205,105,216,105,229,105,254,232,233,242,\n    225,231,225,238, 97,128, 48,117,233,233,244,239,243,241,245,225,\n    242,101,128, 51, 51,235,225,244,225,235,225,238, 97,129, 48,213,\n    105,242,232,225,236,230,247,233,228,244,104,128,255,140,238,231,\n    225,242,245,237,236,225,245,116,129,  2,221,106, 13,227,237, 98,\n    128,  3, 11,118,128,  1,149,249,240,232,229,110,132,  0, 45,106,\n     39,106, 50,106, 62,106, 85,233,238,230,229,242,233,239,114,128,\n    246,229,237,239,238,239,243,240,225,227,101,128,255, 13,115,  2,\n    106, 68,106, 75,237,225,236,108,128,254, 99,245,240,229,242,233,\n    239,114,128,246,230,244,247,111,128, 32, 16,105,149,  0,105,106,\n    137,106,160,106,194,106,241,110,123,110,243,111, 24,111, 51,111,\n    213,111,217,111,255,112, 21,112,105,113, 14,113, 89,113, 97,113,\n    110,113,197,113,254,114, 26,114, 70,225, 99,  2,106,144,106,150,\n    245,244,101,128,  0,237,249,242,233,236,236,233, 99,128,  4, 79,\n     98,  3,106,168,106,177,106,187,229,238,231,225,236,105,128,  9,\n    135,239,240,239,237,239,230,111,128, 49, 39,242,229,246,101,128,\n      1, 45, 99,  3,106,202,106,209,106,231,225,242,239,110,128,  1,\n    208,233,242, 99,  2,106,217,106,222,236,101,128, 36,216,245,237,\n    230,236,229,120,128,  0,238,249,242,233,236,236,233, 99,128,  4,\n     86,100,  4,106,251,107,  5,110, 80,110,113,226,236,231,242,225,\n    246,101,128,  2,  9,101,  2,107, 11,110, 75,239,231,242,225,240,\n    104,  7,107, 32,107, 46,107, 59,109,244,110, 19,110, 32,110, 44,\n    229,225,242,244,232,227,233,242,227,236,101,128, 50,143,230,233,\n    242,229,227,233,242,227,236,101,128, 50,139,233, 99, 14,107, 90,\n    107,106,107,205,108,  3,108, 69,108, 98,108,114,108,171,108,220,\n    108,232,109,  3,109, 70,109,208,109,237,225,236,236,233,225,238,\n    227,229,240,225,242,229,110,128, 50, 63, 99,  4,107,116,107,127,\n    107,141,107,148,225,236,236,240,225,242,229,110,128, 50, 58,229,\n    238,244,242,229,227,233,242,227,236,101,128, 50,165,236,239,243,\n    101,128, 48,  6,111,  3,107,156,107,171,107,191,237,237, 97,129,\n     48,  1,107,164,236,229,230,116,128,255,100,238,231,242,225,244,\n    245,236,225,244,233,239,238,240,225,242,229,110,128, 50, 55,242,\n    242,229,227,244,227,233,242,227,236,101,128, 50,163,101,  3,107,\n    213,107,225,107,242,225,242,244,232,240,225,242,229,110,128, 50,\n     47,238,244,229,242,240,242,233,243,229,240,225,242,229,110,128,\n     50, 61,248,227,229,236,236,229,238,244,227,233,242,227,236,101,\n    128, 50,157,102,  2,108,  9,108, 24,229,243,244,233,246,225,236,\n    240,225,242,229,110,128, 50, 64,105,  2,108, 30,108, 59,238,225,\n    238,227,233,225,108,  2,108, 42,108, 51,227,233,242,227,236,101,\n    128, 50,150,240,225,242,229,110,128, 50, 54,242,229,240,225,242,\n    229,110,128, 50, 43,104,  2,108, 75,108, 86,225,246,229,240,225,\n    242,229,110,128, 50, 50,233,231,232,227,233,242,227,236,101,128,\n     50,164,233,244,229,242,225,244,233,239,238,237,225,242,107,128,\n     48,  5,108,  3,108,122,108,148,108,160,225,226,239,114,  2,108,\n    131,108,140,227,233,242,227,236,101,128, 50,152,240,225,242,229,\n    110,128, 50, 56,229,230,244,227,233,242,227,236,101,128, 50,167,\n    239,247,227,233,242,227,236,101,128, 50,166,109,  2,108,177,108,\n    209,101,  2,108,183,108,198,228,233,227,233,238,229,227,233,242,\n    227,236,101,128, 50,169,244,225,236,240,225,242,229,110,128, 50,\n     46,239,239,238,240,225,242,229,110,128, 50, 42,238,225,237,229,\n    240,225,242,229,110,128, 50, 52,112,  2,108,238,108,246,229,242,\n    233,239,100,128, 48,  2,242,233,238,244,227,233,242,227,236,101,\n    128, 50,158,114,  2,109,  9,109, 57,101,  3,109, 17,109, 28,109,\n     43,225,227,232,240,225,242,229,110,128, 50, 67,240,242,229,243,\n    229,238,244,240,225,242,229,110,128, 50, 57,243,239,245,242,227,\n    229,240,225,242,229,110,128, 50, 62,233,231,232,244,227,233,242,\n    227,236,101,128, 50,168,115,  5,109, 82,109,111,109,125,109,150,\n    109,178,101,  2,109, 88,109,101,227,242,229,244,227,233,242,227,\n    236,101,128, 50,153,236,230,240,225,242,229,110,128, 50, 66,239,\n    227,233,229,244,249,240,225,242,229,110,128, 50, 51,112,  2,109,\n    131,109,137,225,227,101,128, 48,  0,229,227,233,225,236,240,225,\n    242,229,110,128, 50, 53,116,  2,109,156,109,167,239,227,235,240,\n    225,242,229,110,128, 50, 49,245,228,249,240,225,242,229,110,128,\n     50, 59,117,  2,109,184,109,193,238,240,225,242,229,110,128, 50,\n     48,240,229,242,246,233,243,229,240,225,242,229,110,128, 50, 60,\n    119,  2,109,214,109,226,225,244,229,242,240,225,242,229,110,128,\n     50, 44,239,239,228,240,225,242,229,110,128, 50, 45,250,229,242,\n    111,128, 48,  7,109,  2,109,250,110,  7,229,244,225,236,227,233,\n    242,227,236,101,128, 50,142,239,239,238,227,233,242,227,236,101,\n    128, 50,138,238,225,237,229,227,233,242,227,236,101,128, 50,148,\n    243,245,238,227,233,242,227,236,101,128, 50,144,119,  2,110, 50,\n    110, 63,225,244,229,242,227,233,242,227,236,101,128, 50,140,239,\n    239,228,227,233,242,227,236,101,128, 50,141,246, 97,128,  9,  7,\n    233,229,242,229,243,233,115,130,  0,239,110, 94,110,102,225,227,\n    245,244,101,128, 30, 47,227,249,242,233,236,236,233, 99,128,  4,\n    229,239,244,226,229,236,239,119,128, 30,203,101,  3,110,131,110,\n    147,110,158,226,242,229,246,229,227,249,242,233,236,236,233, 99,\n    128,  4,215,227,249,242,233,236,236,233, 99,128,  4, 53,245,238,\n    103,  4,110,170,110,205,110,220,110,229, 97,  2,110,176,110,191,\n    227,233,242,227,236,229,235,239,242,229,225,110,128, 50,117,240,\n    225,242,229,238,235,239,242,229,225,110,128, 50, 21,227,233,242,\n    227,236,229,235,239,242,229,225,110,128, 50,103,235,239,242,229,\n    225,110,128, 49, 71,240,225,242,229,238,235,239,242,229,225,110,\n    128, 50,  7,103,  2,110,249,111,  0,242,225,246,101,128,  0,236,\n    117,  2,111,  6,111, 15,234,225,242,225,244,105,128, 10,135,242,\n    237,245,235,232,105,128, 10,  7,104,  2,111, 30,111, 40,233,242,\n    225,231,225,238, 97,128, 48, 68,239,239,235,225,226,239,246,101,\n    128, 30,201,105,  8,111, 69,111, 79,111, 90,111, 97,111,122,111,\n    138,111,153,111,169,226,229,238,231,225,236,105,128,  9,136,227,\n    249,242,233,236,236,233, 99,128,  4, 56,228,229,246, 97,128,  9,\n      8,231,117,  2,111,104,111,113,234,225,242,225,244,105,128, 10,\n    136,242,237,245,235,232,105,128, 10,  8,237,225,244,242,225,231,\n    245,242,237,245,235,232,105,128, 10, 64,238,246,229,242,244,229,\n    228,226,242,229,246,101,128,  2, 11,243,232,239,242,244,227,249,\n    242,233,236,236,233, 99,128,  4, 57,246,239,247,229,236,243,233,\n    231,110,  3,111,185,111,195,111,202,226,229,238,231,225,236,105,\n    128,  9,192,228,229,246, 97,128,  9, 64,231,245,234,225,242,225,\n    244,105,128, 10,192,106,128,  1, 51,107,  2,111,223,111,247,225,\n    244,225,235,225,238, 97,129, 48,164,111,235,232,225,236,230,247,\n    233,228,244,104,128,255,114,239,242,229,225,110,128, 49, 99,108,\n      2,112,  5,112, 10,228,101,128,  2,220,245,249,232,229,226,242,\n    229,119,128,  5,172,109,  2,112, 27,112, 94, 97,  3,112, 35,112,\n     55,112, 80,227,242,239,110,129,  1, 43,112, 44,227,249,242,233,\n    236,236,233, 99,128,  4,227,231,229,239,242,225,240,240,242,239,\n    248,233,237,225,244,229,236,249,229,241,245,225,108,128, 34, 83,\n    244,242,225,231,245,242,237,245,235,232,105,128, 10, 63,239,238,\n    239,243,240,225,227,101,128,255, 73,110,  5,112,117,112,127,112,\n    136,112,148,112,232,227,242,229,237,229,238,116,128, 34,  6,230,\n    233,238,233,244,121,128, 34, 30,233,225,242,237,229,238,233,225,\n    110,128,  5,107,116,  2,112,154,112,222,101,  2,112,160,112,211,\n    231,242,225,108,131, 34, 43,112,173,112,191,112,196, 98,  2,112,\n    179,112,187,239,244,244,239,109,128, 35, 33,116,128, 35, 33,229,\n    120,128,248,245,116,  2,112,202,112,207,239,112,128, 35, 32,112,\n    128, 35, 32,242,243,229,227,244,233,239,110,128, 34, 41,233,243,\n    241,245,225,242,101,128, 51,  5,118,  3,112,240,112,249,113,  2,\n    226,245,236,236,229,116,128, 37,216,227,233,242,227,236,101,128,\n     37,217,243,237,233,236,229,230,225,227,101,128, 38, 59,111,  3,\n    113, 22,113, 33,113, 41,227,249,242,233,236,236,233, 99,128,  4,\n     81,231,239,238,229,107,128,  1, 47,244, 97,131,  3,185,113, 52,\n    113, 73,113, 81,228,233,229,242,229,243,233,115,129,  3,202,113,\n     65,244,239,238,239,115,128,  3,144,236,225,244,233,110,128,  2,\n    105,244,239,238,239,115,128,  3,175,240,225,242,229,110,128, 36,\n    164,242,233,231,245,242,237,245,235,232,105,128, 10,114,115,  4,\n    113,120,113,165,113,179,113,187,237,225,236,108,  2,113,129,113,\n    140,232,233,242,225,231,225,238, 97,128, 48, 67,235,225,244,225,\n    235,225,238, 97,129, 48,163,113,153,232,225,236,230,247,233,228,\n    244,104,128,255,104,243,232,225,242,226,229,238,231,225,236,105,\n    128,  9,250,244,242,239,235,101,128,  2,104,245,240,229,242,233,\n    239,114,128,246,237,116,  2,113,203,113,237,229,242,225,244,233,\n    239,110,  2,113,215,113,226,232,233,242,225,231,225,238, 97,128,\n     48,157,235,225,244,225,235,225,238, 97,128, 48,253,233,236,228,\n    101,129,  1, 41,113,246,226,229,236,239,119,128, 30, 45,117,  2,\n    114,  4,114, 15,226,239,240,239,237,239,230,111,128, 49, 41,227,\n    249,242,233,236,236,233, 99,128,  4, 78,246,239,247,229,236,243,\n    233,231,110,  3,114, 42,114, 52,114, 59,226,229,238,231,225,236,\n    105,128,  9,191,228,229,246, 97,128,  9, 63,231,245,234,225,242,\n    225,244,105,128, 10,191,250,232,233,244,243, 97,  2,114, 81,114,\n     92,227,249,242,233,236,236,233, 99,128,  4,117,228,226,236,231,\n    242,225,246,229,227,249,242,233,236,236,233, 99,128,  4,119,106,\n    138,  0,106,114,135,114,198,114,209,115,  3,115, 19,115,132,115,\n    201,115,206,115,218,115,226, 97,  4,114,145,114,156,114,166,114,\n    173,225,242,237,229,238,233,225,110,128,  5,113,226,229,238,231,\n    225,236,105,128,  9,156,228,229,246, 97,128,  9, 28,231,117,  2,\n    114,180,114,189,234,225,242,225,244,105,128, 10,156,242,237,245,\n    235,232,105,128, 10, 28,226,239,240,239,237,239,230,111,128, 49,\n     16, 99,  3,114,217,114,224,114,246,225,242,239,110,128,  1,240,\n    233,242, 99,  2,114,232,114,237,236,101,128, 36,217,245,237,230,\n    236,229,120,128,  1, 53,242,239,243,243,229,228,244,225,233,108,\n    128,  2,157,228,239,244,236,229,243,243,243,244,242,239,235,101,\n    128,  2, 95,101,  3,115, 27,115, 38,115,103,227,249,242,233,236,\n    236,233, 99,128,  4, 88,229,109,  4,115, 49,115, 58,115, 72,115,\n     88,225,242,225,226,233, 99,128,  6, 44,230,233,238,225,236,225,\n    242,225,226,233, 99,128,254,158,233,238,233,244,233,225,236,225,\n    242,225,226,233, 99,128,254,159,237,229,228,233,225,236,225,242,\n    225,226,233, 99,128,254,160,104,  2,115,109,115,118,225,242,225,\n    226,233, 99,128,  6,152,230,233,238,225,236,225,242,225,226,233,\n     99,128,251,139,104,  2,115,138,115,188, 97,  3,115,146,115,156,\n    115,163,226,229,238,231,225,236,105,128,  9,157,228,229,246, 97,\n    128,  9, 29,231,117,  2,115,170,115,179,234,225,242,225,244,105,\n    128, 10,157,242,237,245,235,232,105,128, 10, 29,229,232,225,242,\n    237,229,238,233,225,110,128,  5,123,233,115,128, 48,  4,237,239,\n    238,239,243,240,225,227,101,128,255, 74,240,225,242,229,110,128,\n     36,165,243,245,240,229,242,233,239,114,128,  2,178,107,146,  0,\n    107,116, 21,118,110,118,121,118,183,118,194,119, 28,119, 42,120,\n    150,121, 90,121,103,121,129,121,178,122, 60,122, 82,122, 95,122,\n    118,122,160,122,170, 97, 12,116, 47,116, 79,116,101,116,131,116,\n    245,117, 14,117, 44,117, 69,117,175,117,189,118, 56,118, 85, 98,\n      2,116, 53,116, 70,225,243,232,235,233,242,227,249,242,233,236,\n    236,233, 99,128,  4,161,229,238,231,225,236,105,128,  9,149, 99,\n      2,116, 85,116, 91,245,244,101,128, 30, 49,249,242,233,236,236,\n    233, 99,128,  4, 58,228,101,  2,116,108,116,126,243,227,229,238,\n    228,229,242,227,249,242,233,236,236,233, 99,128,  4,155,246, 97,\n    128,  9, 21,102,135,  5,219,116,149,116,158,116,178,116,192,116,\n    201,116,217,116,232,225,242,225,226,233, 99,128,  6, 67,228,225,\n    231,229,243,104,129,251, 59,116,169,232,229,226,242,229,119,128,\n    251, 59,230,233,238,225,236,225,242,225,226,233, 99,128,254,218,\n    232,229,226,242,229,119,128,  5,219,233,238,233,244,233,225,236,\n    225,242,225,226,233, 99,128,254,219,237,229,228,233,225,236,225,\n    242,225,226,233, 99,128,254,220,242,225,230,229,232,229,226,242,\n    229,119,128,251, 77,231,117,  2,116,252,117,  5,234,225,242,225,\n    244,105,128, 10,149,242,237,245,235,232,105,128, 10, 21,104,  2,\n    117, 20,117, 30,233,242,225,231,225,238, 97,128, 48, 75,239,239,\n    235,227,249,242,233,236,236,233, 99,128,  4,196,235,225,244,225,\n    235,225,238, 97,129, 48,171,117, 57,232,225,236,230,247,233,228,\n    244,104,128,255,118,112,  2,117, 75,117, 96,240, 97,129,  3,186,\n    117, 82,243,249,237,226,239,236,231,242,229,229,107,128,  3,240,\n    249,229,239,245,110,  3,117,108,117,122,117,156,237,233,229,245,\n    237,235,239,242,229,225,110,128, 49,113,112,  2,117,128,117,143,\n    232,233,229,245,240,232,235,239,242,229,225,110,128, 49,132,233,\n    229,245,240,235,239,242,229,225,110,128, 49,120,243,243,225,238,\n    231,240,233,229,245,240,235,239,242,229,225,110,128, 49,121,242,\n    239,242,233,233,243,241,245,225,242,101,128, 51, 13,115,  5,117,\n    201,117,245,118,  4,118, 12,118, 40,232,233,228,225,225,245,244,\n    111,  2,117,214,117,223,225,242,225,226,233, 99,128,  6, 64,238,\n    239,243,233,228,229,226,229,225,242,233,238,231,225,242,225,226,\n    233, 99,128,  6, 64,237,225,236,236,235,225,244,225,235,225,238,\n     97,128, 48,245,241,245,225,242,101,128, 51,132,242, 97,  2,118,\n     19,118, 28,225,242,225,226,233, 99,128,  6, 80,244,225,238,225,\n    242,225,226,233, 99,128,  6, 77,244,242,239,235,229,227,249,242,\n    233,236,236,233, 99,128,  4,159,244,225,232,233,242,225,240,242,\n    239,236,239,238,231,237,225,242,235,232,225,236,230,247,233,228,\n    244,104,128,255,112,246,229,242,244,233,227,225,236,243,244,242,\n    239,235,229,227,249,242,233,236,236,233, 99,128,  4,157,226,239,\n    240,239,237,239,230,111,128, 49, 14, 99,  4,118,131,118,153,118,\n    162,118,170, 97,  2,118,137,118,147,236,243,241,245,225,242,101,\n    128, 51,137,242,239,110,128,  1,233,229,228,233,236,236, 97,128,\n      1, 55,233,242,227,236,101,128, 36,218,239,237,237,225,225,227,\n    227,229,238,116,128,  1, 55,228,239,244,226,229,236,239,119,128,\n     30, 51,101,  4,118,204,118,231,119,  0,119, 12,104,  2,118,210,\n    118,221,225,242,237,229,238,233,225,110,128,  5,132,233,242,225,\n    231,225,238, 97,128, 48, 81,235,225,244,225,235,225,238, 97,129,\n     48,177,118,244,232,225,236,230,247,233,228,244,104,128,255,121,\n    238,225,242,237,229,238,233,225,110,128,  5,111,243,237,225,236,\n    236,235,225,244,225,235,225,238, 97,128, 48,246,231,242,229,229,\n    238,236,225,238,228,233, 99,128,  1, 56,104,  6,119, 56,119,185,\n    119,196,119,221,120, 52,120,140, 97,  5,119, 68,119, 78,119, 89,\n    119, 96,119,121,226,229,238,231,225,236,105,128,  9,150,227,249,\n    242,233,236,236,233, 99,128,  4, 69,228,229,246, 97,128,  9, 22,\n    231,117,  2,119,103,119,112,234,225,242,225,244,105,128, 10,150,\n    242,237,245,235,232,105,128, 10, 22,104,  4,119,131,119,140,119,\n    154,119,170,225,242,225,226,233, 99,128,  6, 46,230,233,238,225,\n    236,225,242,225,226,233, 99,128,254,166,233,238,233,244,233,225,\n    236,225,242,225,226,233, 99,128,254,167,237,229,228,233,225,236,\n    225,242,225,226,233, 99,128,254,168,229,233,227,239,240,244,233,\n     99,128,  3,231,232, 97,  2,119,203,119,210,228,229,246, 97,128,\n      9, 89,231,245,242,237,245,235,232,105,128, 10, 89,233,229,245,\n    235,104,  4,119,235,120, 14,120, 29,120, 38, 97,  2,119,241,120,\n      0,227,233,242,227,236,229,235,239,242,229,225,110,128, 50,120,\n    240,225,242,229,238,235,239,242,229,225,110,128, 50, 24,227,233,\n    242,227,236,229,235,239,242,229,225,110,128, 50,106,235,239,242,\n    229,225,110,128, 49, 75,240,225,242,229,238,235,239,242,229,225,\n    110,128, 50, 10,111,  4,120, 62,120,111,120,121,120,126,235,104,\n      4,120, 73,120, 82,120, 91,120,101,225,233,244,232,225,105,128,\n     14,  2,239,238,244,232,225,105,128, 14,  5,245,225,244,244,232,\n    225,105,128, 14,  3,247,225,233,244,232,225,105,128, 14,  4,237,\n    245,244,244,232,225,105,128, 14, 91,239,107,128,  1,153,242,225,\n    235,232,225,238,231,244,232,225,105,128, 14,  6,250,243,241,245,\n    225,242,101,128, 51,145,105,  4,120,160,120,171,120,196,120,245,\n    232,233,242,225,231,225,238, 97,128, 48, 77,235,225,244,225,235,\n    225,238, 97,129, 48,173,120,184,232,225,236,230,247,233,228,244,\n    104,128,255,119,242,111,  3,120,205,120,220,120,236,231,245,242,\n    225,237,245,243,241,245,225,242,101,128, 51, 21,237,229,229,244,\n    239,242,245,243,241,245,225,242,101,128, 51, 22,243,241,245,225,\n    242,101,128, 51, 20,249,229,239,107,  5,121,  4,121, 39,121, 54,\n    121, 63,121, 77, 97,  2,121, 10,121, 25,227,233,242,227,236,229,\n    235,239,242,229,225,110,128, 50,110,240,225,242,229,238,235,239,\n    242,229,225,110,128, 50, 14,227,233,242,227,236,229,235,239,242,\n    229,225,110,128, 50, 96,235,239,242,229,225,110,128, 49, 49,240,\n    225,242,229,238,235,239,242,229,225,110,128, 50,  0,243,233,239,\n    243,235,239,242,229,225,110,128, 49, 51,234,229,227,249,242,233,\n    236,236,233, 99,128,  4, 92,108,  2,121,109,121,120,233,238,229,\n    226,229,236,239,119,128, 30, 53,243,241,245,225,242,101,128, 51,\n    152,109,  3,121,137,121,151,121,162,227,245,226,229,228,243,241,\n    245,225,242,101,128, 51,166,239,238,239,243,240,225,227,101,128,\n    255, 75,243,241,245,225,242,229,228,243,241,245,225,242,101,128,\n     51,162,111,  5,121,190,121,216,121,254,122, 10,122, 24,104,  2,\n    121,196,121,206,233,242,225,231,225,238, 97,128, 48, 83,237,243,\n    241,245,225,242,101,128, 51,192,235, 97,  2,121,223,121,231,233,\n    244,232,225,105,128, 14,  1,244,225,235,225,238, 97,129, 48,179,\n    121,242,232,225,236,230,247,233,228,244,104,128,255,122,239,240,\n    239,243,241,245,225,242,101,128, 51, 30,240,240,225,227,249,242,\n    233,236,236,233, 99,128,  4,129,114,  2,122, 30,122, 50,229,225,\n    238,243,244,225,238,228,225,242,228,243,249,237,226,239,108,128,\n     50,127,239,238,233,243,227,237, 98,128,  3, 67,240, 97,  2,122,\n     67,122, 73,242,229,110,128, 36,166,243,241,245,225,242,101,128,\n     51,170,243,233,227,249,242,233,236,236,233, 99,128,  4,111,116,\n      2,122,101,122,110,243,241,245,225,242,101,128, 51,207,245,242,\n    238,229,100,128,  2,158,117,  2,122,124,122,135,232,233,242,225,\n    231,225,238, 97,128, 48, 79,235,225,244,225,235,225,238, 97,129,\n     48,175,122,148,232,225,236,230,247,233,228,244,104,128,255,120,\n    246,243,241,245,225,242,101,128, 51,184,247,243,241,245,225,242,\n    101,128, 51,190,108,146,  0,108,122,220,124,247,125, 20,125, 86,\n    125,124,126, 20,126, 29,126, 45,126, 69,126, 87,126,205,126,246,\n    127,125,127,133,127,166,127,175,127,183,127,245, 97,  7,122,236,\n    122,246,122,253,123,  4,123, 29,123, 45,124,235,226,229,238,231,\n    225,236,105,128,  9,178,227,245,244,101,128,  1, 58,228,229,246,\n     97,128,  9, 50,231,117,  2,123, 11,123, 20,234,225,242,225,244,\n    105,128, 10,178,242,237,245,235,232,105,128, 10, 50,235,235,232,\n    225,238,231,249,225,239,244,232,225,105,128, 14, 69,109, 10,123,\n     67,124,  6,124, 23,124, 61,124, 75,124, 94,124,110,124,130,124,\n    150,124,173, 97,  2,123, 73,123,254,236,229,102,  4,123, 85,123,\n     99,123,191,123,208,230,233,238,225,236,225,242,225,226,233, 99,\n    128,254,252,232,225,237,250, 97,  2,123,109,123,150,225,226,239,\n    246,101,  2,123,119,123,133,230,233,238,225,236,225,242,225,226,\n    233, 99,128,254,248,233,243,239,236,225,244,229,228,225,242,225,\n    226,233, 99,128,254,247,226,229,236,239,119,  2,123,160,123,174,\n    230,233,238,225,236,225,242,225,226,233, 99,128,254,250,233,243,\n    239,236,225,244,229,228,225,242,225,226,233, 99,128,254,249,233,\n    243,239,236,225,244,229,228,225,242,225,226,233, 99,128,254,251,\n    237,225,228,228,225,225,226,239,246,101,  2,123,223,123,237,230,\n    233,238,225,236,225,242,225,226,233, 99,128,254,246,233,243,239,\n    236,225,244,229,228,225,242,225,226,233, 99,128,254,245,242,225,\n    226,233, 99,128,  6, 68,226,228, 97,129,  3,187,124, 14,243,244,\n    242,239,235,101,128,  1,155,229,100,130,  5,220,124, 32,124, 52,\n    228,225,231,229,243,104,129,251, 60,124, 43,232,229,226,242,229,\n    119,128,251, 60,232,229,226,242,229,119,128,  5,220,230,233,238,\n    225,236,225,242,225,226,233, 99,128,254,222,232,225,232,233,238,\n    233,244,233,225,236,225,242,225,226,233, 99,128,252,202,233,238,\n    233,244,233,225,236,225,242,225,226,233, 99,128,254,223,234,229,\n    229,237,233,238,233,244,233,225,236,225,242,225,226,233, 99,128,\n    252,201,235,232,225,232,233,238,233,244,233,225,236,225,242,225,\n    226,233, 99,128,252,203,236,225,237,232,229,232,233,243,239,236,\n    225,244,229,228,225,242,225,226,233, 99,128,253,242,237,101,  2,\n    124,180,124,193,228,233,225,236,225,242,225,226,233, 99,128,254,\n    224,229,109,  2,124,200,124,219,232,225,232,233,238,233,244,233,\n    225,236,225,242,225,226,233, 99,128,253,136,233,238,233,244,233,\n    225,236,225,242,225,226,233, 99,128,252,204,242,231,229,227,233,\n    242,227,236,101,128, 37,239, 98,  3,124,255,125,  4,125, 10,225,\n    114,128,  1,154,229,236,116,128,  2,108,239,240,239,237,239,230,\n    111,128, 49, 12, 99,  4,125, 30,125, 37,125, 46,125, 73,225,242,\n    239,110,128,  1, 62,229,228,233,236,236, 97,128,  1, 60,233,242,\n     99,  2,125, 54,125, 59,236,101,128, 36,219,245,237,230,236,229,\n    248,226,229,236,239,119,128, 30, 61,239,237,237,225,225,227,227,\n    229,238,116,128,  1, 60,228,239,116,130,  1, 64,125, 96,125,105,\n    225,227,227,229,238,116,128,  1, 64,226,229,236,239,119,129, 30,\n     55,125,115,237,225,227,242,239,110,128, 30, 57,101,  3,125,132,\n    125,170,126, 15,230,116,  2,125,139,125,155,225,238,231,236,229,\n    225,226,239,246,229,227,237, 98,128,  3, 26,244,225,227,235,226,\n    229,236,239,247,227,237, 98,128,  3, 24,243,115,132,  0, 60,125,\n    183,125,205,125,217,126,  7,229,241,245,225,108,129, 34,100,125,\n    193,239,242,231,242,229,225,244,229,114,128, 34,218,237,239,238,\n    239,243,240,225,227,101,128,255, 28,111,  2,125,223,125,252,114,\n      2,125,229,125,242,229,241,245,233,246,225,236,229,238,116,128,\n     34,114,231,242,229,225,244,229,114,128, 34,118,246,229,242,229,\n    241,245,225,108,128, 34,102,243,237,225,236,108,128,254,100,250,\n    104,128,  2,110,230,226,236,239,227,107,128, 37,140,232,239,239,\n    235,242,229,244,242,239,230,236,229,120,128,  2,109,105,  2,126,\n     51,126, 56,242, 97,128, 32,164,247,238,225,242,237,229,238,233,\n    225,110,128,  5,108,106,129,  1,201,126, 75,229,227,249,242,233,\n    236,236,233, 99,128,  4, 89,108,132,246,192,126, 99,126,123,126,\n    134,126,143, 97,  2,126,105,126,112,228,229,246, 97,128,  9, 51,\n    231,245,234,225,242,225,244,105,128, 10,179,233,238,229,226,229,\n    236,239,119,128, 30, 59,236,225,228,229,246, 97,128,  9, 52,246,\n    239,227,225,236,233, 99,  3,126,157,126,167,126,174,226,229,238,\n    231,225,236,105,128,  9,225,228,229,246, 97,128,  9, 97,246,239,\n    247,229,236,243,233,231,110,  2,126,188,126,198,226,229,238,231,\n    225,236,105,128,  9,227,228,229,246, 97,128,  9, 99,109,  3,126,\n    213,126,226,126,237,233,228,228,236,229,244,233,236,228,101,128,\n      2,107,239,238,239,243,240,225,227,101,128,255, 76,243,241,245,\n    225,242,101,128, 51,208,111,  6,127,  4,127, 16,127, 58,127, 69,\n    127, 75,127,117,227,232,245,236,225,244,232,225,105,128, 14, 44,\n    231,233,227,225,108,  3,127, 28,127, 34,127, 53,225,238,100,128,\n     34, 39,238,239,116,129,  0,172,127, 42,242,229,246,229,242,243,\n    229,100,128, 35, 16,239,114,128, 34, 40,236,233,238,231,244,232,\n    225,105,128, 14, 37,238,231,115,128,  1,127,247,236,233,238,101,\n      2,127, 85,127,108, 99,  2,127, 91,127,103,229,238,244,229,242,\n    236,233,238,101,128,254, 78,237, 98,128,  3, 50,228,225,243,232,\n    229,100,128,254, 77,250,229,238,231,101,128, 37,202,240,225,242,\n    229,110,128, 36,167,115,  3,127,141,127,148,127,156,236,225,243,\n    104,128,  1, 66,241,245,225,242,101,128, 33, 19,245,240,229,242,\n    233,239,114,128,246,238,244,243,232,225,228,101,128, 37,145,245,\n    244,232,225,105,128, 14, 38,246,239,227,225,236,233, 99,  3,127,\n    197,127,207,127,214,226,229,238,231,225,236,105,128,  9,140,228,\n    229,246, 97,128,  9, 12,246,239,247,229,236,243,233,231,110,  2,\n    127,228,127,238,226,229,238,231,225,236,105,128,  9,226,228,229,\n    246, 97,128,  9, 98,248,243,241,245,225,242,101,128, 51,211,109,\n    144,  0,109,128, 35,130,144,130,169,130,196,130,221,132, 18,132,\n     40,133, 95,133,125,133,174,134, 25,134, 47,134, 72,134, 81,135,\n    108,135,136, 97, 12,128, 61,128, 71,128,135,128,142,128,167,128,\n    215,130, 51,130, 76,130, 81,130, 95,130,107,130,112,226,229,238,\n    231,225,236,105,128,  9,174, 99,  2,128, 77,128,129,242,239,110,\n    132,  0,175,128, 91,128,102,128,108,128,117,226,229,236,239,247,\n    227,237, 98,128,  3, 49,227,237, 98,128,  3,  4,236,239,247,237,\n    239,100,128,  2,205,237,239,238,239,243,240,225,227,101,128,255,\n    227,245,244,101,128, 30, 63,228,229,246, 97,128,  9, 46,231,117,\n      2,128,149,128,158,234,225,242,225,244,105,128, 10,174,242,237,\n    245,235,232,105,128, 10, 46,104,  2,128,173,128,205,225,240,225,\n    235,104,  2,128,183,128,192,232,229,226,242,229,119,128,  5,164,\n    236,229,230,244,232,229,226,242,229,119,128,  5,164,233,242,225,\n    231,225,238, 97,128, 48,126,105,  5,128,227,129, 40,129,103,129,\n    133,130, 39,227,232,225,244,244,225,247, 97,  3,128,242,129, 17,\n    129, 24,236,239,119,  2,128,250,129,  5,236,229,230,244,244,232,\n    225,105,128,248,149,242,233,231,232,244,244,232,225,105,128,248,\n    148,244,232,225,105,128, 14, 75,245,240,240,229,242,236,229,230,\n    244,244,232,225,105,128,248,147,229,107,  3,129, 49,129, 80,129,\n     87,236,239,119,  2,129, 57,129, 68,236,229,230,244,244,232,225,\n    105,128,248,140,242,233,231,232,244,244,232,225,105,128,248,139,\n    244,232,225,105,128, 14, 72,245,240,240,229,242,236,229,230,244,\n    244,232,225,105,128,248,138,232,225,238,225,235,225,116,  2,129,\n    115,129,126,236,229,230,244,244,232,225,105,128,248,132,244,232,\n    225,105,128, 14, 49,116,  3,129,141,129,169,129,232,225,233,235,\n    232,117,  2,129,151,129,162,236,229,230,244,244,232,225,105,128,\n    248,137,244,232,225,105,128, 14, 71,232,111,  3,129,178,129,209,\n    129,216,236,239,119,  2,129,186,129,197,236,229,230,244,244,232,\n    225,105,128,248,143,242,233,231,232,244,244,232,225,105,128,248,\n    142,244,232,225,105,128, 14, 73,245,240,240,229,242,236,229,230,\n    244,244,232,225,105,128,248,141,242,105,  3,129,241,130, 16,130,\n     23,236,239,119,  2,129,249,130,  4,236,229,230,244,244,232,225,\n    105,128,248,146,242,233,231,232,244,244,232,225,105,128,248,145,\n    244,232,225,105,128, 14, 74,245,240,240,229,242,236,229,230,244,\n    244,232,225,105,128,248,144,249,225,237,239,235,244,232,225,105,\n    128, 14, 70,235,225,244,225,235,225,238, 97,129, 48,222,130, 64,\n    232,225,236,230,247,233,228,244,104,128,255,143,236,101,128, 38,\n     66,238,243,249,239,238,243,241,245,225,242,101,128, 51, 71,241,\n    225,230,232,229,226,242,229,119,128,  5,190,242,115,128, 38, 66,\n    115,  2,130,118,130,136,239,242,225,227,233,242,227,236,229,232,\n    229,226,242,229,119,128,  5,175,241,245,225,242,101,128, 51,131,\n     98,  2,130,150,130,160,239,240,239,237,239,230,111,128, 49,  7,\n    243,241,245,225,242,101,128, 51,212, 99,  2,130,175,130,183,233,\n    242,227,236,101,128, 36,220,245,226,229,228,243,241,245,225,242,\n    101,128, 51,165,228,239,116,  2,130,204,130,213,225,227,227,229,\n    238,116,128, 30, 65,226,229,236,239,119,128, 30, 67,101,  7,130,\n    237,131,108,131,119,131,134,131,159,131,196,131,208,101,  2,130,\n    243,131, 95,109,  4,130,253,131,  6,131, 20,131, 36,225,242,225,\n    226,233, 99,128,  6, 69,230,233,238,225,236,225,242,225,226,233,\n     99,128,254,226,233,238,233,244,233,225,236,225,242,225,226,233,\n     99,128,254,227,237,101,  2,131, 43,131, 56,228,233,225,236,225,\n    242,225,226,233, 99,128,254,228,229,237,105,  2,131, 64,131, 79,\n    238,233,244,233,225,236,225,242,225,226,233, 99,128,252,209,243,\n    239,236,225,244,229,228,225,242,225,226,233, 99,128,252, 72,244,\n    239,242,245,243,241,245,225,242,101,128, 51, 77,232,233,242,225,\n    231,225,238, 97,128, 48,129,233,250,233,229,242,225,243,241,245,\n    225,242,101,128, 51,126,235,225,244,225,235,225,238, 97,129, 48,\n    225,131,147,232,225,236,230,247,233,228,244,104,128,255,146,109,\n    130,  5,222,131,167,131,187,228,225,231,229,243,104,129,251, 62,\n    131,178,232,229,226,242,229,119,128,251, 62,232,229,226,242,229,\n    119,128,  5,222,238,225,242,237,229,238,233,225,110,128,  5,116,\n    242,235,232, 97,  3,131,219,131,228,132,  5,232,229,226,242,229,\n    119,128,  5,165,235,229,230,245,236, 97,  2,131,239,131,248,232,\n    229,226,242,229,119,128,  5,166,236,229,230,244,232,229,226,242,\n    229,119,128,  5,166,236,229,230,244,232,229,226,242,229,119,128,\n      5,165,104,  2,132, 24,132, 30,239,239,107,128,  2,113,250,243,\n    241,245,225,242,101,128, 51,146,105,  6,132, 54,132, 91,132,228,\n    132,239,133,  8,133, 65,228,100,  2,132, 61,132, 86,236,229,228,\n    239,244,235,225,244,225,235,225,238,225,232,225,236,230,247,233,\n    228,244,104,128,255,101,239,116,128,  0,183,229,245,109,  5,132,\n    105,132,140,132,155,132,164,132,215, 97,  2,132,111,132,126,227,\n    233,242,227,236,229,235,239,242,229,225,110,128, 50,114,240,225,\n    242,229,238,235,239,242,229,225,110,128, 50, 18,227,233,242,227,\n    236,229,235,239,242,229,225,110,128, 50,100,235,239,242,229,225,\n    110,128, 49, 65,112,  2,132,170,132,202, 97,  2,132,176,132,190,\n    238,243,233,239,243,235,239,242,229,225,110,128, 49,112,242,229,\n    238,235,239,242,229,225,110,128, 50,  4,233,229,245,240,235,239,\n    242,229,225,110,128, 49,110,243,233,239,243,235,239,242,229,225,\n    110,128, 49,111,232,233,242,225,231,225,238, 97,128, 48,127,235,\n    225,244,225,235,225,238, 97,129, 48,223,132,252,232,225,236,230,\n    247,233,228,244,104,128,255,144,238,117,  2,133, 15,133, 60,115,\n    132, 34, 18,133, 27,133, 38,133, 47,133, 53,226,229,236,239,247,\n    227,237, 98,128,  3, 32,227,233,242,227,236,101,128, 34,150,237,\n    239,100,128,  2,215,240,236,245,115,128, 34, 19,244,101,128, 32,\n     50,242,105,  2,133, 72,133, 86,226,225,225,242,245,243,241,245,\n    225,242,101,128, 51, 74,243,241,245,225,242,101,128, 51, 73,108,\n      2,133,101,133,116,239,238,231,236,229,231,244,245,242,238,229,\n    100,128,  2,112,243,241,245,225,242,101,128, 51,150,109,  3,133,\n    133,133,147,133,158,227,245,226,229,228,243,241,245,225,242,101,\n    128, 51,163,239,238,239,243,240,225,227,101,128,255, 77,243,241,\n    245,225,242,229,228,243,241,245,225,242,101,128, 51,159,111,  5,\n    133,186,133,212,133,237,133,247,134,  0,104,  2,133,192,133,202,\n    233,242,225,231,225,238, 97,128, 48,130,237,243,241,245,225,242,\n    101,128, 51,193,235,225,244,225,235,225,238, 97,129, 48,226,133,\n    225,232,225,236,230,247,233,228,244,104,128,255,147,236,243,241,\n    245,225,242,101,128, 51,214,237,225,244,232,225,105,128, 14, 33,\n    246,229,242,243,243,241,245,225,242,101,129, 51,167,134, 15,228,\n    243,241,245,225,242,101,128, 51,168,240, 97,  2,134, 32,134, 38,\n    242,229,110,128, 36,168,243,241,245,225,242,101,128, 51,171,115,\n      2,134, 53,134, 62,243,241,245,225,242,101,128, 51,179,245,240,\n    229,242,233,239,114,128,246,239,244,245,242,238,229,100,128,  2,\n    111,117,141,  0,181,134,111,134,115,134,125,134,149,134,159,134,\n    181,134,192,134,217,134,240,134,250,135, 24,135, 88,135, 98, 49,\n    128,  0,181,225,243,241,245,225,242,101,128, 51,130,227,104,  2,\n    134,132,134,142,231,242,229,225,244,229,114,128, 34,107,236,229,\n    243,115,128, 34,106,230,243,241,245,225,242,101,128, 51,140,103,\n      2,134,165,134,172,242,229,229,107,128,  3,188,243,241,245,225,\n    242,101,128, 51,141,232,233,242,225,231,225,238, 97,128, 48,128,\n    235,225,244,225,235,225,238, 97,129, 48,224,134,205,232,225,236,\n    230,247,233,228,244,104,128,255,145,108,  2,134,223,134,232,243,\n    241,245,225,242,101,128, 51,149,244,233,240,236,121,128,  0,215,\n    237,243,241,245,225,242,101,128, 51,155,238,225,104,  2,135,  2,\n    135, 11,232,229,226,242,229,119,128,  5,163,236,229,230,244,232,\n    229,226,242,229,119,128,  5,163,115,  2,135, 30,135, 79,233, 99,\n      3,135, 39,135, 56,135, 67,225,236,238,239,244,101,129, 38,106,\n    135, 50,228,226,108,128, 38,107,230,236,225,244,243,233,231,110,\n    128, 38,109,243,232,225,242,240,243,233,231,110,128, 38,111,243,\n    241,245,225,242,101,128, 51,178,246,243,241,245,225,242,101,128,\n     51,182,247,243,241,245,225,242,101,128, 51,188,118,  2,135,114,\n    135,127,237,229,231,225,243,241,245,225,242,101,128, 51,185,243,\n    241,245,225,242,101,128, 51,183,119,  2,135,142,135,155,237,229,\n    231,225,243,241,245,225,242,101,128, 51,191,243,241,245,225,242,\n    101,128, 51,189,110,150,  0,110,135,212,136, 90,136,114,136,180,\n    136,205,137,  7,137, 17,137, 84,137,127,139,161,139,179,139,204,\n    139,235,140,  5,140, 70,142, 52,142, 60,142, 85,142, 93,143, 61,\n    143, 71,143, 81, 97,  8,135,230,135,250,136,  1,136,  8,136, 33,\n    136, 44,136, 69,136, 81, 98,  2,135,236,135,245,229,238,231,225,\n    236,105,128,  9,168,236, 97,128, 34,  7,227,245,244,101,128,  1,\n     68,228,229,246, 97,128,  9, 40,231,117,  2,136, 15,136, 24,234,\n    225,242,225,244,105,128, 10,168,242,237,245,235,232,105,128, 10,\n     40,232,233,242,225,231,225,238, 97,128, 48,106,235,225,244,225,\n    235,225,238, 97,129, 48,202,136, 57,232,225,236,230,247,233,228,\n    244,104,128,255,133,240,239,243,244,242,239,240,232,101,128,  1,\n     73,243,241,245,225,242,101,128, 51,129, 98,  2,136, 96,136,106,\n    239,240,239,237,239,230,111,128, 49, 11,243,240,225,227,101,128,\n      0,160, 99,  4,136,124,136,131,136,140,136,167,225,242,239,110,\n    128,  1, 72,229,228,233,236,236, 97,128,  1, 70,233,242, 99,  2,\n    136,148,136,153,236,101,128, 36,221,245,237,230,236,229,248,226,\n    229,236,239,119,128, 30, 75,239,237,237,225,225,227,227,229,238,\n    116,128,  1, 70,228,239,116,  2,136,188,136,197,225,227,227,229,\n    238,116,128, 30, 69,226,229,236,239,119,128, 30, 71,101,  3,136,\n    213,136,224,136,249,232,233,242,225,231,225,238, 97,128, 48,109,\n    235,225,244,225,235,225,238, 97,129, 48,205,136,237,232,225,236,\n    230,247,233,228,244,104,128,255,136,247,243,232,229,241,229,236,\n    243,233,231,110,128, 32,170,230,243,241,245,225,242,101,128, 51,\n    139,103,  2,137, 23,137, 73, 97,  3,137, 31,137, 41,137, 48,226,\n    229,238,231,225,236,105,128,  9,153,228,229,246, 97,128,  9, 25,\n    231,117,  2,137, 55,137, 64,234,225,242,225,244,105,128, 10,153,\n    242,237,245,235,232,105,128, 10, 25,239,238,231,245,244,232,225,\n    105,128, 14,  7,104,  2,137, 90,137,100,233,242,225,231,225,238,\n     97,128, 48,147,239,239,107,  2,137,108,137,115,236,229,230,116,\n    128,  2,114,242,229,244,242,239,230,236,229,120,128,  2,115,105,\n      4,137,137,138, 50,138, 61,138,119,229,245,110,  7,137,155,137,\n    190,137,222,137,236,137,245,138, 22,138, 35, 97,  2,137,161,137,\n    176,227,233,242,227,236,229,235,239,242,229,225,110,128, 50,111,\n    240,225,242,229,238,235,239,242,229,225,110,128, 50, 15,227,105,\n      2,137,197,137,209,229,245,227,235,239,242,229,225,110,128, 49,\n     53,242,227,236,229,235,239,242,229,225,110,128, 50, 97,232,233,\n    229,245,232,235,239,242,229,225,110,128, 49, 54,235,239,242,229,\n    225,110,128, 49, 52,240, 97,  2,137,252,138, 10,238,243,233,239,\n    243,235,239,242,229,225,110,128, 49,104,242,229,238,235,239,242,\n    229,225,110,128, 50,  1,243,233,239,243,235,239,242,229,225,110,\n    128, 49,103,244,233,235,229,245,244,235,239,242,229,225,110,128,\n     49,102,232,233,242,225,231,225,238, 97,128, 48,107,107,  2,138,\n     67,138, 91,225,244,225,235,225,238, 97,129, 48,203,138, 79,232,\n    225,236,230,247,233,228,244,104,128,255,134,232,225,232,233,116,\n      2,138,101,138,112,236,229,230,244,244,232,225,105,128,248,153,\n    244,232,225,105,128, 14, 77,238,101,141,  0, 57,138,150,138,159,\n    138,169,138,199,138,206,138,231,139,  2,139, 36,139, 48,139, 59,\n    139, 92,139,100,139,111,225,242,225,226,233, 99,128,  6,105,226,\n    229,238,231,225,236,105,128,  9,239,227,233,242,227,236,101,129,\n     36,104,138,180,233,238,246,229,242,243,229,243,225,238,243,243,\n    229,242,233,102,128, 39,146,228,229,246, 97,128,  9,111,231,117,\n      2,138,213,138,222,234,225,242,225,244,105,128, 10,239,242,237,\n    245,235,232,105,128, 10,111,232, 97,  2,138,238,138,249,227,235,\n    225,242,225,226,233, 99,128,  6,105,238,231,250,232,239,117,128,\n     48, 41,105,  2,139,  8,139, 26,228,229,239,231,242,225,240,232,\n    233,227,240,225,242,229,110,128, 50, 40,238,230,229,242,233,239,\n    114,128, 32,137,237,239,238,239,243,240,225,227,101,128,255, 25,\n    239,236,228,243,244,249,236,101,128,247, 57,112,  2,139, 65,139,\n     72,225,242,229,110,128, 36,124,229,114,  2,139, 79,139, 85,233,\n    239,100,128, 36,144,243,233,225,110,128,  6,249,242,239,237,225,\n    110,128, 33,120,243,245,240,229,242,233,239,114,128, 32,121,116,\n      2,139,117,139,155,229,229,110,  2,139,125,139,134,227,233,242,\n    227,236,101,128, 36,114,112,  2,139,140,139,147,225,242,229,110,\n    128, 36,134,229,242,233,239,100,128, 36,154,232,225,105,128, 14,\n     89,106,129,  1,204,139,167,229,227,249,242,233,236,236,233, 99,\n    128,  4, 90,235,225,244,225,235,225,238, 97,129, 48,243,139,192,\n    232,225,236,230,247,233,228,244,104,128,255,157,108,  2,139,210,\n    139,224,229,231,242,233,231,232,244,236,239,238,103,128,  1,158,\n    233,238,229,226,229,236,239,119,128, 30, 73,109,  2,139,241,139,\n    252,239,238,239,243,240,225,227,101,128,255, 78,243,241,245,225,\n    242,101,128, 51,154,110,  2,140, 11,140, 61, 97,  3,140, 19,140,\n     29,140, 36,226,229,238,231,225,236,105,128,  9,163,228,229,246,\n     97,128,  9, 35,231,117,  2,140, 43,140, 52,234,225,242,225,244,\n    105,128, 10,163,242,237,245,235,232,105,128, 10, 35,238,225,228,\n    229,246, 97,128,  9, 41,111,  6,140, 84,140, 95,140,120,140,161,\n    141,113,142, 40,232,233,242,225,231,225,238, 97,128, 48,110,235,\n    225,244,225,235,225,238, 97,129, 48,206,140,108,232,225,236,230,\n    247,233,228,244,104,128,255,137,110,  3,140,128,140,144,140,153,\n    226,242,229,225,235,233,238,231,243,240,225,227,101,128,  0,160,\n    229,238,244,232,225,105,128, 14, 19,245,244,232,225,105,128, 14,\n     25,239,110,  7,140,178,140,187,140,201,140,235,140,251,141, 36,\n    141, 95,225,242,225,226,233, 99,128,  6, 70,230,233,238,225,236,\n    225,242,225,226,233, 99,128,254,230,231,232,245,238,238, 97,  2,\n    140,212,140,221,225,242,225,226,233, 99,128,  6,186,230,233,238,\n    225,236,225,242,225,226,233, 99,128,251,159,233,238,233,244,233,\n    225,236,225,242,225,226,233, 99,128,254,231,234,229,229,237,105,\n      2,141,  5,141, 20,238,233,244,233,225,236,225,242,225,226,233,\n     99,128,252,210,243,239,236,225,244,229,228,225,242,225,226,233,\n     99,128,252, 75,237,101,  2,141, 43,141, 56,228,233,225,236,225,\n    242,225,226,233, 99,128,254,232,229,237,105,  2,141, 64,141, 79,\n    238,233,244,233,225,236,225,242,225,226,233, 99,128,252,213,243,\n    239,236,225,244,229,228,225,242,225,226,233, 99,128,252, 78,238,\n    239,239,238,230,233,238,225,236,225,242,225,226,233, 99,128,252,\n    141,116,  7,141,129,141,140,141,169,141,204,141,216,141,236,142,\n      6,227,239,238,244,225,233,238,115,128, 34, 12,101,  2,141,146,\n    141,162,236,229,237,229,238,116,129, 34,  9,141,157,239,102,128,\n     34,  9,241,245,225,108,128, 34, 96,231,242,229,225,244,229,114,\n    129, 34,111,141,181,238,239,114,  2,141,189,141,197,229,241,245,\n    225,108,128, 34,113,236,229,243,115,128, 34,121,233,228,229,238,\n    244,233,227,225,108,128, 34, 98,236,229,243,115,129, 34,110,141,\n    225,238,239,242,229,241,245,225,108,128, 34,112,112,  2,141,242,\n    141,252,225,242,225,236,236,229,108,128, 34, 38,242,229,227,229,\n    228,229,115,128, 34,128,243,117,  3,142, 15,142, 22,142, 31,226,\n    243,229,116,128, 34,132,227,227,229,229,228,115,128, 34,129,240,\n    229,242,243,229,116,128, 34,133,247,225,242,237,229,238,233,225,\n    110,128,  5,118,240,225,242,229,110,128, 36,169,115,  2,142, 66,\n    142, 75,243,241,245,225,242,101,128, 51,177,245,240,229,242,233,\n    239,114,128, 32,127,244,233,236,228,101,128,  0,241,117,132,  3,\n    189,142,105,142,116,142,197,143, 24,232,233,242,225,231,225,238,\n     97,128, 48,108,107,  2,142,122,142,146,225,244,225,235,225,238,\n     97,129, 48,204,142,134,232,225,236,230,247,233,228,244,104,128,\n    255,135,244, 97,  3,142,155,142,165,142,172,226,229,238,231,225,\n    236,105,128,  9,188,228,229,246, 97,128,  9, 60,231,117,  2,142,\n    179,142,188,234,225,242,225,244,105,128, 10,188,242,237,245,235,\n    232,105,128, 10, 60,109,  2,142,203,142,237,226,229,242,243,233,\n    231,110,130,  0, 35,142,217,142,229,237,239,238,239,243,240,225,\n    227,101,128,255,  3,243,237,225,236,108,128,254, 95,229,114,  2,\n    142,244,143, 20,225,236,243,233,231,110,  2,142,255,143,  7,231,\n    242,229,229,107,128,  3,116,236,239,247,229,242,231,242,229,229,\n    107,128,  3,117,111,128, 33, 22,110,130,  5,224,143, 32,143, 52,\n    228,225,231,229,243,104,129,251, 64,143, 43,232,229,226,242,229,\n    119,128,251, 64,232,229,226,242,229,119,128,  5,224,246,243,241,\n    245,225,242,101,128, 51,181,247,243,241,245,225,242,101,128, 51,\n    187,249, 97,  3,143, 90,143,100,143,107,226,229,238,231,225,236,\n    105,128,  9,158,228,229,246, 97,128,  9, 30,231,117,  2,143,114,\n    143,123,234,225,242,225,244,105,128, 10,158,242,237,245,235,232,\n    105,128, 10, 30,111,147,  0,111,143,174,143,196,144, 18,144,188,\n    145,  4,145, 19,145, 59,145,182,145,203,145,241,145,252,146,174,\n    148,  8,148, 72,148,105,148,151,149, 24,149, 71,149, 83, 97,  2,\n    143,180,143,187,227,245,244,101,128,  0,243,238,231,244,232,225,\n    105,128, 14, 45, 98,  4,143,206,143,248,144,  1,144, 11,225,242,\n    242,229,100,130,  2,117,143,218,143,229,227,249,242,233,236,236,\n    233, 99,128,  4,233,228,233,229,242,229,243,233,243,227,249,242,\n    233,236,236,233, 99,128,  4,235,229,238,231,225,236,105,128,  9,\n    147,239,240,239,237,239,230,111,128, 49, 27,242,229,246,101,128,\n      1, 79, 99,  3,144, 26,144, 99,144,178, 97,  2,144, 32,144, 93,\n    238,228,242, 97,  3,144, 43,144, 50,144, 61,228,229,246, 97,128,\n      9, 17,231,245,234,225,242,225,244,105,128, 10,145,246,239,247,\n    229,236,243,233,231,110,  2,144, 75,144, 82,228,229,246, 97,128,\n      9, 73,231,245,234,225,242,225,244,105,128, 10,201,242,239,110,\n    128,  1,210,233,242, 99,  2,144,107,144,112,236,101,128, 36,222,\n    245,237,230,236,229,120,133,  0,244,144,131,144,139,144,150,144,\n    158,144,170,225,227,245,244,101,128, 30,209,228,239,244,226,229,\n    236,239,119,128, 30,217,231,242,225,246,101,128, 30,211,232,239,\n    239,235,225,226,239,246,101,128, 30,213,244,233,236,228,101,128,\n     30,215,249,242,233,236,236,233, 99,128,  4, 62,100,  4,144,198,\n    144,221,144,227,144,250,226,108,  2,144,205,144,213,225,227,245,\n    244,101,128,  1, 81,231,242,225,246,101,128,  2, 13,229,246, 97,\n    128,  9, 19,233,229,242,229,243,233,115,129,  0,246,144,239,227,\n    249,242,233,236,236,233, 99,128,  4,231,239,244,226,229,236,239,\n    119,128, 30,205,101,129,  1, 83,145, 10,235,239,242,229,225,110,\n    128, 49, 90,103,  3,145, 27,145, 42,145, 49,239,238,229,107,129,\n      2,219,145, 36,227,237, 98,128,  3, 40,242,225,246,101,128,  0,\n    242,245,234,225,242,225,244,105,128, 10,147,104,  4,145, 69,145,\n     80,145, 90,145,168,225,242,237,229,238,233,225,110,128,  5,133,\n    233,242,225,231,225,238, 97,128, 48, 74,111,  2,145, 96,145,106,\n    239,235,225,226,239,246,101,128, 30,207,242,110,133,  1,161,145,\n    121,145,129,145,140,145,148,145,160,225,227,245,244,101,128, 30,\n    219,228,239,244,226,229,236,239,119,128, 30,227,231,242,225,246,\n    101,128, 30,221,232,239,239,235,225,226,239,246,101,128, 30,223,\n    244,233,236,228,101,128, 30,225,245,238,231,225,242,245,237,236,\n    225,245,116,128,  1, 81,105,129,  1,163,145,188,238,246,229,242,\n    244,229,228,226,242,229,246,101,128,  2, 15,107,  2,145,209,145,\n    233,225,244,225,235,225,238, 97,129, 48,170,145,221,232,225,236,\n    230,247,233,228,244,104,128,255,117,239,242,229,225,110,128, 49,\n     87,236,229,232,229,226,242,229,119,128,  5,171,109,  6,146, 10,\n    146, 38,146, 45,146,134,146,145,146,163,225,227,242,239,110,130,\n      1, 77,146, 22,146, 30,225,227,245,244,101,128, 30, 83,231,242,\n    225,246,101,128, 30, 81,228,229,246, 97,128,  9, 80,229,231, 97,\n    133,  3,201,146, 61,146, 65,146, 76,146, 90,146,106, 49,128,  3,\n    214,227,249,242,233,236,236,233, 99,128,  4, 97,236,225,244,233,\n    238,227,236,239,243,229,100,128,  2,119,242,239,245,238,228,227,\n    249,242,233,236,236,233, 99,128,  4,123,116,  2,146,112,146,127,\n    233,244,236,239,227,249,242,233,236,236,233, 99,128,  4,125,239,\n    238,239,115,128,  3,206,231,245,234,225,242,225,244,105,128, 10,\n    208,233,227,242,239,110,129,  3,191,146,155,244,239,238,239,115,\n    128,  3,204,239,238,239,243,240,225,227,101,128,255, 79,238,101,\n    145,  0, 49,146,213,146,222,146,232,147,  6,147, 31,147, 40,147,\n     49,147, 74,147,108,147,142,147,154,147,173,147,184,147,217,147,\n    227,147,235,147,246,225,242,225,226,233, 99,128,  6, 97,226,229,\n    238,231,225,236,105,128,  9,231,227,233,242,227,236,101,129, 36,\n     96,146,243,233,238,246,229,242,243,229,243,225,238,243,243,229,\n    242,233,102,128, 39,138,100,  2,147, 12,147, 18,229,246, 97,128,\n      9,103,239,244,229,238,236,229,225,228,229,114,128, 32, 36,229,\n    233,231,232,244,104,128, 33, 91,230,233,244,244,229,100,128,246,\n    220,231,117,  2,147, 56,147, 65,234,225,242,225,244,105,128, 10,\n    231,242,237,245,235,232,105,128, 10,103,232, 97,  3,147, 83,147,\n     94,147, 99,227,235,225,242,225,226,233, 99,128,  6, 97,236,102,\n    128,  0,189,238,231,250,232,239,117,128, 48, 33,105,  2,147,114,\n    147,132,228,229,239,231,242,225,240,232,233,227,240,225,242,229,\n    110,128, 50, 32,238,230,229,242,233,239,114,128, 32,129,237,239,\n    238,239,243,240,225,227,101,128,255, 17,238,245,237,229,242,225,\n    244,239,242,226,229,238,231,225,236,105,128,  9,244,239,236,228,\n    243,244,249,236,101,128,247, 49,112,  2,147,190,147,197,225,242,\n    229,110,128, 36,116,229,114,  2,147,204,147,210,233,239,100,128,\n     36,136,243,233,225,110,128,  6,241,241,245,225,242,244,229,114,\n    128,  0,188,242,239,237,225,110,128, 33,112,243,245,240,229,242,\n    233,239,114,128,  0,185,244,104,  2,147,253,148,  2,225,105,128,\n     14, 81,233,242,100,128, 33, 83,111,  3,148, 16,148, 50,148, 66,\n    103,  2,148, 22,148, 40,239,238,229,107,129,  1,235,148, 31,237,\n    225,227,242,239,110,128,  1,237,245,242,237,245,235,232,105,128,\n     10, 19,237,225,244,242,225,231,245,242,237,245,235,232,105,128,\n     10, 75,240,229,110,128,  2, 84,112,  3,148, 80,148, 87,148, 98,\n    225,242,229,110,128, 36,170,229,238,226,245,236,236,229,116,128,\n     37,230,244,233,239,110,128, 35, 37,114,  2,148,111,148,140,100,\n      2,148,117,148,128,230,229,237,233,238,233,238,101,128,  0,170,\n    237,225,243,227,245,236,233,238,101,128,  0,186,244,232,239,231,\n    239,238,225,108,128, 34, 31,115,  5,148,163,148,195,148,212,149,\n      1,149, 14,232,239,242,116,  2,148,172,148,179,228,229,246, 97,\n    128,  9, 18,246,239,247,229,236,243,233,231,238,228,229,246, 97,\n    128,  9, 74,236,225,243,104,129,  0,248,148,204,225,227,245,244,\n    101,128,  1,255,237,225,236,108,  2,148,221,148,232,232,233,242,\n    225,231,225,238, 97,128, 48, 73,235,225,244,225,235,225,238, 97,\n    129, 48,169,148,245,232,225,236,230,247,233,228,244,104,128,255,\n    107,244,242,239,235,229,225,227,245,244,101,128,  1,255,245,240,\n    229,242,233,239,114,128,246,240,116,  2,149, 30,149, 41,227,249,\n    242,233,236,236,233, 99,128,  4,127,233,236,228,101,130,  0,245,\n    149, 52,149, 60,225,227,245,244,101,128, 30, 77,228,233,229,242,\n    229,243,233,115,128, 30, 79,245,226,239,240,239,237,239,230,111,\n    128, 49, 33,118,  2,149, 89,149,170,229,114,  2,149, 96,149,162,\n    236,233,238,101,131, 32, 62,149,109,149,132,149,155, 99,  2,149,\n    115,149,127,229,238,244,229,242,236,233,238,101,128,254, 74,237,\n     98,128,  3,  5,100,  2,149,138,149,146,225,243,232,229,100,128,\n    254, 73,226,236,247,225,246,121,128,254, 76,247,225,246,121,128,\n    254, 75,243,227,239,242,101,128,  0,175,239,247,229,236,243,233,\n    231,110,  3,149,185,149,195,149,202,226,229,238,231,225,236,105,\n    128,  9,203,228,229,246, 97,128,  9, 75,231,245,234,225,242,225,\n    244,105,128, 10,203,112,145,  0,112,149,251,152,123,152,134,152,\n    143,152,155,154, 80,154, 90,155, 82,156,101,156,191,156,217,157,\n     92,157,100,158,  2,158, 60,158, 88,158, 98, 97, 14,150, 25,150,\n     57,150, 67,150, 74,150, 81,150,129,150,140,150,154,150,165,150,\n    212,150,226,151,238,152, 21,152,111, 97,  2,150, 31,150, 43,237,\n    240,243,243,241,245,225,242,101,128, 51,128,243,229,238,244,239,\n    243,241,245,225,242,101,128, 51, 43,226,229,238,231,225,236,105,\n    128,  9,170,227,245,244,101,128, 30, 85,228,229,246, 97,128,  9,\n     42,103,  2,150, 87,150,105,101,  2,150, 93,150,100,228,239,247,\n    110,128, 33,223,245,112,128, 33,222,117,  2,150,111,150,120,234,\n    225,242,225,244,105,128, 10,170,242,237,245,235,232,105,128, 10,\n     42,232,233,242,225,231,225,238, 97,128, 48,113,233,249,225,238,\n    238,239,233,244,232,225,105,128, 14, 47,235,225,244,225,235,225,\n    238, 97,128, 48,209,108,  2,150,171,150,196,225,244,225,236,233,\n    250,225,244,233,239,238,227,249,242,233,236,236,233,227,227,237,\n     98,128,  4,132,239,227,232,235,225,227,249,242,233,236,236,233,\n     99,128,  4,192,238,243,233,239,243,235,239,242,229,225,110,128,\n     49,127,114,  3,150,234,150,255,151,227, 97,  2,150,240,150,248,\n    231,242,225,240,104,128,  0,182,236,236,229,108,128, 34, 37,229,\n    110,  2,151,  6,151,116,236,229,230,116,136,  0, 40,151, 29,151,\n     44,151, 49,151, 54,151, 65,151, 77,151,100,151,105,225,236,244,\n    239,238,229,225,242,225,226,233, 99,128,253, 62,226,116,128,248,\n    237,229,120,128,248,236,233,238,230,229,242,233,239,114,128, 32,\n    141,237,239,238,239,243,240,225,227,101,128,255,  8,115,  2,151,\n     83,151, 90,237,225,236,108,128,254, 89,245,240,229,242,233,239,\n    114,128, 32,125,244,112,128,248,235,246,229,242,244,233,227,225,\n    108,128,254, 53,242,233,231,232,116,136,  0, 41,151,140,151,155,\n    151,160,151,165,151,176,151,188,151,211,151,216,225,236,244,239,\n    238,229,225,242,225,226,233, 99,128,253, 63,226,116,128,248,248,\n    229,120,128,248,247,233,238,230,229,242,233,239,114,128, 32,142,\n    237,239,238,239,243,240,225,227,101,128,255,  9,115,  2,151,194,\n    151,201,237,225,236,108,128,254, 90,245,240,229,242,233,239,114,\n    128, 32,126,244,112,128,248,246,246,229,242,244,233,227,225,108,\n    128,254, 54,244,233,225,236,228,233,230,102,128, 34,  2,115,  3,\n    151,246,152,  1,152, 13,229,241,232,229,226,242,229,119,128,  5,\n    192,232,244,225,232,229,226,242,229,119,128,  5,153,241,245,225,\n    242,101,128, 51,169,244,225,104,134,  5,183,152, 39,152, 53,152,\n     58,152, 67,152, 82,152, 98, 49,  2,152, 45,152, 49, 49,128,  5,\n    183,100,128,  5,183,178, 97,128,  5,183,232,229,226,242,229,119,\n    128,  5,183,238,225,242,242,239,247,232,229,226,242,229,119,128,\n      5,183,241,245,225,242,244,229,242,232,229,226,242,229,119,128,\n      5,183,247,233,228,229,232,229,226,242,229,119,128,  5,183,250,\n    229,242,232,229,226,242,229,119,128,  5,161,226,239,240,239,237,\n    239,230,111,128, 49,  6,227,233,242,227,236,101,128, 36,223,228,\n    239,244,225,227,227,229,238,116,128, 30, 87,101,137,  5,228,152,\n    177,152,188,152,208,152,220,152,240,153, 86,153, 97,153,118,154,\n     73,227,249,242,233,236,236,233, 99,128,  4, 63,228,225,231,229,\n    243,104,129,251, 68,152,199,232,229,226,242,229,119,128,251, 68,\n    229,250,233,243,241,245,225,242,101,128, 51, 59,230,233,238,225,\n    236,228,225,231,229,243,232,232,229,226,242,229,119,128,251, 67,\n    104,  5,152,252,153, 19,153, 27,153, 41,153, 71,225,114,  2,153,\n      3,153, 10,225,226,233, 99,128,  6,126,237,229,238,233,225,110,\n    128,  5,122,229,226,242,229,119,128,  5,228,230,233,238,225,236,\n    225,242,225,226,233, 99,128,251, 87,105,  2,153, 47,153, 62,238,\n    233,244,233,225,236,225,242,225,226,233, 99,128,251, 88,242,225,\n    231,225,238, 97,128, 48,122,237,229,228,233,225,236,225,242,225,\n    226,233, 99,128,251, 89,235,225,244,225,235,225,238, 97,128, 48,\n    218,237,233,228,228,236,229,232,239,239,235,227,249,242,233,236,\n    236,233, 99,128,  4,167,114,  5,153,130,153,142,153,184,154, 49,\n    154, 62,225,230,229,232,229,226,242,229,119,128,251, 78,227,229,\n    238,116,131,  0, 37,153,155,153,164,153,176,225,242,225,226,233,\n     99,128,  6,106,237,239,238,239,243,240,225,227,101,128,255,  5,\n    243,237,225,236,108,128,254,106,105,  2,153,190,154, 31,239,100,\n    134,  0, 46,153,207,153,218,153,229,153,241,153,252,154,  8,225,\n    242,237,229,238,233,225,110,128,  5,137,227,229,238,244,229,242,\n    229,100,128,  0,183,232,225,236,230,247,233,228,244,104,128,255,\n     97,233,238,230,229,242,233,239,114,128,246,231,237,239,238,239,\n    243,240,225,227,101,128,255, 14,115,  2,154, 14,154, 21,237,225,\n    236,108,128,254, 82,245,240,229,242,233,239,114,128,246,232,243,\n    240,239,237,229,238,233,231,242,229,229,235,227,237, 98,128,  3,\n     66,240,229,238,228,233,227,245,236,225,114,128, 34,165,244,232,\n    239,245,243,225,238,100,128, 32, 48,243,229,244, 97,128, 32,167,\n    230,243,241,245,225,242,101,128, 51,138,104,  3,154, 98,154,148,\n    155, 29, 97,  3,154,106,154,116,154,123,226,229,238,231,225,236,\n    105,128,  9,171,228,229,246, 97,128,  9, 43,231,117,  2,154,130,\n    154,139,234,225,242,225,244,105,128, 10,171,242,237,245,235,232,\n    105,128, 10, 43,105,133,  3,198,154,162,154,166,154,252,155,  4,\n    155, 15, 49,128,  3,213,229,245,240,104,  4,154,179,154,214,154,\n    229,154,238, 97,  2,154,185,154,200,227,233,242,227,236,229,235,\n    239,242,229,225,110,128, 50,122,240,225,242,229,238,235,239,242,\n    229,225,110,128, 50, 26,227,233,242,227,236,229,235,239,242,229,\n    225,110,128, 50,108,235,239,242,229,225,110,128, 49, 77,240,225,\n    242,229,238,235,239,242,229,225,110,128, 50, 12,236,225,244,233,\n    110,128,  2,120,238,244,232,245,244,232,225,105,128, 14, 58,243,\n    249,237,226,239,236,231,242,229,229,107,128,  3,213,111,  3,155,\n     37,155, 42,155, 68,239,107,128,  1,165,240,104,  2,155, 49,155,\n     58,225,238,244,232,225,105,128, 14, 30,245,238,231,244,232,225,\n    105,128, 14, 28,243,225,237,240,232,225,239,244,232,225,105,128,\n     14, 32,105,133,  3,192,155, 96,156, 52,156, 63,156, 74,156, 88,\n    229,245,112,  6,155,112,155,147,155,179,155,207,155,221,156, 17,\n     97,  2,155,118,155,133,227,233,242,227,236,229,235,239,242,229,\n    225,110,128, 50,115,240,225,242,229,238,235,239,242,229,225,110,\n    128, 50, 19,227,105,  2,155,154,155,166,229,245,227,235,239,242,\n    229,225,110,128, 49,118,242,227,236,229,235,239,242,229,225,110,\n    128, 50,101,107,  2,155,185,155,199,233,249,229,239,235,235,239,\n    242,229,225,110,128, 49,114,239,242,229,225,110,128, 49, 66,240,\n    225,242,229,238,235,239,242,229,225,110,128, 50,  5,243,233,239,\n    115,  2,155,230,156,  2,107,  2,155,236,155,250,233,249,229,239,\n    235,235,239,242,229,225,110,128, 49,116,239,242,229,225,110,128,\n     49, 68,244,233,235,229,245,244,235,239,242,229,225,110,128, 49,\n    117,116,  2,156, 23,156, 38,232,233,229,245,244,232,235,239,242,\n    229,225,110,128, 49,119,233,235,229,245,244,235,239,242,229,225,\n    110,128, 49,115,232,233,242,225,231,225,238, 97,128, 48,116,235,\n    225,244,225,235,225,238, 97,128, 48,212,243,249,237,226,239,236,\n    231,242,229,229,107,128,  3,214,247,242,225,242,237,229,238,233,\n    225,110,128,  5,131,236,245,115,132,  0, 43,156,115,156,126,156,\n    135,156,168,226,229,236,239,247,227,237, 98,128,  3, 31,227,233,\n    242,227,236,101,128, 34,149,109,  2,156,141,156,148,233,238,245,\n    115,128,  0,177,111,  2,156,154,156,158,100,128,  2,214,238,239,\n    243,240,225,227,101,128,255, 11,115,  2,156,174,156,181,237,225,\n    236,108,128,254, 98,245,240,229,242,233,239,114,128, 32,122,109,\n      2,156,197,156,208,239,238,239,243,240,225,227,101,128,255, 80,\n    243,241,245,225,242,101,128, 51,216,111,  5,156,229,156,240,157,\n     51,157, 62,157, 72,232,233,242,225,231,225,238, 97,128, 48,125,\n    233,238,244,233,238,231,233,238,228,229,120,  4,157,  4,157, 16,\n    157, 28,157, 41,228,239,247,238,247,232,233,244,101,128, 38, 31,\n    236,229,230,244,247,232,233,244,101,128, 38, 28,242,233,231,232,\n    244,247,232,233,244,101,128, 38, 30,245,240,247,232,233,244,101,\n    128, 38, 29,235,225,244,225,235,225,238, 97,128, 48,221,240,236,\n    225,244,232,225,105,128, 14, 27,243,244,225,236,237,225,242,107,\n    129, 48, 18,157, 85,230,225,227,101,128, 48, 32,240,225,242,229,\n    110,128, 36,171,114,  3,157,108,157,134,157,159,101,  2,157,114,\n    157,122,227,229,228,229,115,128, 34,122,243,227,242,233,240,244,\n    233,239,110,128, 33, 30,233,237,101,  2,157,142,157,148,237,239,\n    100,128,  2,185,242,229,246,229,242,243,229,100,128, 32, 53,111,\n      4,157,169,157,176,157,186,157,199,228,245,227,116,128, 34, 15,\n    234,229,227,244,233,246,101,128, 35,  5,236,239,238,231,229,228,\n    235,225,238, 97,128, 48,252,112,  2,157,205,157,242,101,  2,157,\n    211,157,218,236,236,239,114,128, 35, 24,242,243,117,  2,157,226,\n    157,233,226,243,229,116,128, 34,130,240,229,242,243,229,116,128,\n     34,131,239,242,244,233,239,110,129, 34, 55,157,253,225,108,128,\n     34, 29,115,  2,158,  8,158, 51,105,130,  3,200,158, 16,158, 27,\n    227,249,242,233,236,236,233, 99,128,  4,113,236,233,240,238,229,\n    245,237,225,244,225,227,249,242,233,236,236,233,227,227,237, 98,\n    128,  4,134,243,241,245,225,242,101,128, 51,176,117,  2,158, 66,\n    158, 77,232,233,242,225,231,225,238, 97,128, 48,119,235,225,244,\n    225,235,225,238, 97,128, 48,215,246,243,241,245,225,242,101,128,\n     51,180,247,243,241,245,225,242,101,128, 51,186,113,136,  0,113,\n    158,128,159,177,159,188,159,197,159,204,159,216,159,254,160,  6,\n     97,  4,158,138,158,161,158,225,159,160,100,  2,158,144,158,150,\n    229,246, 97,128,  9, 88,237,225,232,229,226,242,229,119,128,  5,\n    168,102,  4,158,171,158,180,158,194,158,210,225,242,225,226,233,\n     99,128,  6, 66,230,233,238,225,236,225,242,225,226,233, 99,128,\n    254,214,233,238,233,244,233,225,236,225,242,225,226,233, 99,128,\n    254,215,237,229,228,233,225,236,225,242,225,226,233, 99,128,254,\n    216,237,225,244,115,136,  5,184,158,248,159, 12,159, 26,159, 31,\n    159, 36,159, 45,159, 60,159,147, 49,  3,159,  0,159,  4,159,  8,\n     48,128,  5,184, 97,128,  5,184, 99,128,  5,184, 50,  2,159, 18,\n    159, 22, 55,128,  5,184, 57,128,  5,184,179, 51,128,  5,184,228,\n    101,128,  5,184,232,229,226,242,229,119,128,  5,184,238,225,242,\n    242,239,247,232,229,226,242,229,119,128,  5,184,113,  2,159, 66,\n    159,132,225,244,225,110,  4,159, 79,159, 88,159,103,159,119,232,\n    229,226,242,229,119,128,  5,184,238,225,242,242,239,247,232,229,\n    226,242,229,119,128,  5,184,241,245,225,242,244,229,242,232,229,\n    226,242,229,119,128,  5,184,247,233,228,229,232,229,226,242,229,\n    119,128,  5,184,245,225,242,244,229,242,232,229,226,242,229,119,\n    128,  5,184,247,233,228,229,232,229,226,242,229,119,128,  5,184,\n    242,238,229,249,240,225,242,225,232,229,226,242,229,119,128,  5,\n    159,226,239,240,239,237,239,230,111,128, 49, 17,227,233,242,227,\n    236,101,128, 36,224,232,239,239,107,128,  2,160,237,239,238,239,\n    243,240,225,227,101,128,255, 81,239,102,130,  5,231,159,225,159,\n    245,228,225,231,229,243,104,129,251, 71,159,236,232,229,226,242,\n    229,119,128,251, 71,232,229,226,242,229,119,128,  5,231,240,225,\n    242,229,110,128, 36,172,117,  4,160, 16,160, 28,160,117,160,204,\n    225,242,244,229,242,238,239,244,101,128, 38,105,226,245,244,115,\n    135,  5,187,160, 49,160, 54,160, 59,160, 64,160, 73,160, 88,160,\n    104,177, 56,128,  5,187,178, 53,128,  5,187,179, 49,128,  5,187,\n    232,229,226,242,229,119,128,  5,187,238,225,242,242,239,247,232,\n    229,226,242,229,119,128,  5,187,241,245,225,242,244,229,242,232,\n    229,226,242,229,119,128,  5,187,247,233,228,229,232,229,226,242,\n    229,119,128,  5,187,229,243,244,233,239,110,133,  0, 63,160,136,\n    160,159,160,176,160,184,160,196,225,114,  2,160,143,160,150,225,\n    226,233, 99,128,  6, 31,237,229,238,233,225,110,128,  5, 94,228,\n    239,247,110,129,  0,191,160,168,243,237,225,236,108,128,247,191,\n    231,242,229,229,107,128,  3,126,237,239,238,239,243,240,225,227,\n    101,128,255, 31,243,237,225,236,108,128,247, 63,239,244,101,  4,\n    160,216,161, 31,161, 51,161, 80,228,226,108,133,  0, 34,160,232,\n    160,239,160,246,161,  2,161, 23,226,225,243,101,128, 32, 30,236,\n    229,230,116,128, 32, 28,237,239,238,239,243,240,225,227,101,128,\n    255,  2,240,242,233,237,101,129, 48, 30,161, 12,242,229,246,229,\n    242,243,229,100,128, 48, 29,242,233,231,232,116,128, 32, 29,236,\n    229,230,116,129, 32, 24,161, 40,242,229,246,229,242,243,229,100,\n    128, 32, 27,114,  2,161, 57,161, 67,229,246,229,242,243,229,100,\n    128, 32, 27,233,231,232,116,129, 32, 25,161, 76,110,128,  1, 73,\n    243,233,238,231,108,  2,161, 90,161, 97,226,225,243,101,128, 32,\n     26,101,129,  0, 39,161,103,237,239,238,239,243,240,225,227,101,\n    128,255,  7,114,145,  0,114,161,153,162,157,162,168,162,215,163,\n     10,164, 27,164, 51,164,146,166,180,166,217,166,229,167, 27,167,\n     35,167,197,167,208,167,243,168, 87, 97, 11,161,177,161,188,161,\n    198,161,205,162, 14,162, 30,162, 55,162, 66,162, 91,162,114,162,\n    151,225,242,237,229,238,233,225,110,128,  5,124,226,229,238,231,\n    225,236,105,128,  9,176,227,245,244,101,128,  1, 85,100,  4,161,\n    215,161,221,161,235,162,  5,229,246, 97,128,  9, 48,233,227,225,\n    108,129, 34, 26,161,230,229,120,128,248,229,239,246,229,242,243,\n    243,241,245,225,242,101,129, 51,174,161,251,228,243,241,245,225,\n    242,101,128, 51,175,243,241,245,225,242,101,128, 51,173,230,101,\n    129,  5,191,162, 21,232,229,226,242,229,119,128,  5,191,231,117,\n      2,162, 37,162, 46,234,225,242,225,244,105,128, 10,176,242,237,\n    245,235,232,105,128, 10, 48,232,233,242,225,231,225,238, 97,128,\n     48,137,235,225,244,225,235,225,238, 97,129, 48,233,162, 79,232,\n    225,236,230,247,233,228,244,104,128,255,151,236,239,247,229,242,\n    228,233,225,231,239,238,225,236,226,229,238,231,225,236,105,128,\n      9,241,109,  2,162,120,162,143,233,228,228,236,229,228,233,225,\n    231,239,238,225,236,226,229,238,231,225,236,105,128,  9,240,243,\n    232,239,242,110,128,  2,100,244,233,111,128, 34, 54,226,239,240,\n    239,237,239,230,111,128, 49, 22, 99,  4,162,178,162,185,162,194,\n    162,202,225,242,239,110,128,  1, 89,229,228,233,236,236, 97,128,\n      1, 87,233,242,227,236,101,128, 36,225,239,237,237,225,225,227,\n    227,229,238,116,128,  1, 87,100,  2,162,221,162,231,226,236,231,\n    242,225,246,101,128,  2, 17,239,116,  2,162,238,162,247,225,227,\n    227,229,238,116,128, 30, 89,226,229,236,239,119,129, 30, 91,163,\n      1,237,225,227,242,239,110,128, 30, 93,101,  6,163, 24,163, 69,\n    163,104,163,159,163,184,163,217,102,  2,163, 30,163, 43,229,242,\n    229,238,227,229,237,225,242,107,128, 32, 59,236,229,248,243,117,\n      2,163, 53,163, 60,226,243,229,116,128, 34,134,240,229,242,243,\n    229,116,128, 34,135,231,233,243,244,229,114,  2,163, 80,163, 85,\n    229,100,128,  0,174,115,  2,163, 91,163, 97,225,238,115,128,248,\n    232,229,242,233,102,128,246,218,104,  3,163,112,163,135,163,149,\n    225,114,  2,163,119,163,126,225,226,233, 99,128,  6, 49,237,229,\n    238,233,225,110,128,  5,128,230,233,238,225,236,225,242,225,226,\n    233, 99,128,254,174,233,242,225,231,225,238, 97,128, 48,140,235,\n    225,244,225,235,225,238, 97,129, 48,236,163,172,232,225,236,230,\n    247,233,228,244,104,128,255,154,243,104,130,  5,232,163,193,163,\n    208,228,225,231,229,243,232,232,229,226,242,229,119,128,251, 72,\n    232,229,226,242,229,119,128,  5,232,118,  3,163,225,163,238,164,\n     14,229,242,243,229,228,244,233,236,228,101,128, 34, 61,233, 97,\n      2,163,245,163,254,232,229,226,242,229,119,128,  5,151,237,245,\n    231,242,225,243,232,232,229,226,242,229,119,128,  5,151,236,239,\n    231,233,227,225,236,238,239,116,128, 35, 16,230,233,243,232,232,\n    239,239,107,129,  2,126,164, 40,242,229,246,229,242,243,229,100,\n    128,  2,127,104,  2,164, 57,164, 80, 97,  2,164, 63,164, 73,226,\n    229,238,231,225,236,105,128,  9,221,228,229,246, 97,128,  9, 93,\n    111,131,  3,193,164, 90,164,119,164,133,239,107,129,  2,125,164,\n     97,244,245,242,238,229,100,129,  2,123,164,108,243,245,240,229,\n    242,233,239,114,128,  2,181,243,249,237,226,239,236,231,242,229,\n    229,107,128,  3,241,244,233,227,232,239,239,235,237,239,100,128,\n      2,222,105,  6,164,160,165,204,165,250,166,  5,166, 30,166,166,\n    229,245,108,  9,164,182,164,217,164,232,164,246,165, 36,165, 50,\n    165,136,165,149,165,184, 97,  2,164,188,164,203,227,233,242,227,\n    236,229,235,239,242,229,225,110,128, 50,113,240,225,242,229,238,\n    235,239,242,229,225,110,128, 50, 17,227,233,242,227,236,229,235,\n    239,242,229,225,110,128, 50, 99,232,233,229,245,232,235,239,242,\n    229,225,110,128, 49, 64,107,  2,164,252,165, 28,233,249,229,239,\n    107,  2,165,  6,165, 15,235,239,242,229,225,110,128, 49, 58,243,\n    233,239,243,235,239,242,229,225,110,128, 49,105,239,242,229,225,\n    110,128, 49, 57,237,233,229,245,237,235,239,242,229,225,110,128,\n     49, 59,112,  3,165, 58,165, 90,165,105, 97,  2,165, 64,165, 78,\n    238,243,233,239,243,235,239,242,229,225,110,128, 49,108,242,229,\n    238,235,239,242,229,225,110,128, 50,  3,232,233,229,245,240,232,\n    235,239,242,229,225,110,128, 49, 63,233,229,245,112,  2,165,114,\n    165,123,235,239,242,229,225,110,128, 49, 60,243,233,239,243,235,\n    239,242,229,225,110,128, 49,107,243,233,239,243,235,239,242,229,\n    225,110,128, 49, 61,116,  2,165,155,165,170,232,233,229,245,244,\n    232,235,239,242,229,225,110,128, 49, 62,233,235,229,245,244,235,\n    239,242,229,225,110,128, 49,106,249,229,239,242,233,238,232,233,\n    229,245,232,235,239,242,229,225,110,128, 49,109,231,232,116,  2,\n    165,212,165,220,225,238,231,236,101,128, 34, 31,116,  2,165,226,\n    165,240,225,227,235,226,229,236,239,247,227,237, 98,128,  3, 25,\n    242,233,225,238,231,236,101,128, 34,191,232,233,242,225,231,225,\n    238, 97,128, 48,138,235,225,244,225,235,225,238, 97,129, 48,234,\n    166, 18,232,225,236,230,247,233,228,244,104,128,255,152,110,  2,\n    166, 36,166,152,103,131,  2,218,166, 46,166, 57,166, 63,226,229,\n    236,239,247,227,237, 98,128,  3, 37,227,237, 98,128,  3, 10,232,\n    225,236,102,  2,166, 72,166,118,236,229,230,116,131,  2,191,166,\n     85,166, 96,166,107,225,242,237,229,238,233,225,110,128,  5, 89,\n    226,229,236,239,247,227,237, 98,128,  3, 28,227,229,238,244,229,\n    242,229,100,128,  2,211,242,233,231,232,116,130,  2,190,166,130,\n    166,141,226,229,236,239,247,227,237, 98,128,  3, 57,227,229,238,\n    244,229,242,229,100,128,  2,210,246,229,242,244,229,228,226,242,\n    229,246,101,128,  2, 19,244,244,239,242,245,243,241,245,225,242,\n    101,128, 51, 81,108,  2,166,186,166,197,233,238,229,226,229,236,\n    239,119,128, 30, 95,239,238,231,236,229,103,129,  2,124,166,208,\n    244,245,242,238,229,100,128,  2,122,237,239,238,239,243,240,225,\n    227,101,128,255, 82,111,  3,166,237,166,248,167, 17,232,233,242,\n    225,231,225,238, 97,128, 48,141,235,225,244,225,235,225,238, 97,\n    129, 48,237,167,  5,232,225,236,230,247,233,228,244,104,128,255,\n    155,242,245,225,244,232,225,105,128, 14, 35,240,225,242,229,110,\n    128, 36,173,114,  3,167, 43,167, 79,167,109, 97,  3,167, 51,167,\n     61,167, 68,226,229,238,231,225,236,105,128,  9,220,228,229,246,\n     97,128,  9, 49,231,245,242,237,245,235,232,105,128, 10, 92,229,\n    104,  2,167, 86,167, 95,225,242,225,226,233, 99,128,  6,145,230,\n    233,238,225,236,225,242,225,226,233, 99,128,251,141,246,239,227,\n    225,236,233, 99,  4,167,125,167,135,167,142,167,153,226,229,238,\n    231,225,236,105,128,  9,224,228,229,246, 97,128,  9, 96,231,245,\n    234,225,242,225,244,105,128, 10,224,246,239,247,229,236,243,233,\n    231,110,  3,167,169,167,179,167,186,226,229,238,231,225,236,105,\n    128,  9,196,228,229,246, 97,128,  9, 68,231,245,234,225,242,225,\n    244,105,128, 10,196,243,245,240,229,242,233,239,114,128,246,241,\n    116,  2,167,214,167,222,226,236,239,227,107,128, 37,144,245,242,\n    238,229,100,129,  2,121,167,232,243,245,240,229,242,233,239,114,\n    128,  2,180,117,  4,167,253,168,  8,168, 33,168, 80,232,233,242,\n    225,231,225,238, 97,128, 48,139,235,225,244,225,235,225,238, 97,\n    129, 48,235,168, 21,232,225,236,230,247,233,228,244,104,128,255,\n    153,112,  2,168, 39,168, 74,229,101,  2,168, 46,168, 60,237,225,\n    242,235,226,229,238,231,225,236,105,128,  9,242,243,233,231,238,\n    226,229,238,231,225,236,105,128,  9,243,233,225,104,128,246,221,\n    244,232,225,105,128, 14, 36,246,239,227,225,236,233, 99,  4,168,\n    103,168,113,168,120,168,131,226,229,238,231,225,236,105,128,  9,\n    139,228,229,246, 97,128,  9, 11,231,245,234,225,242,225,244,105,\n    128, 10,139,246,239,247,229,236,243,233,231,110,  3,168,147,168,\n    157,168,164,226,229,238,231,225,236,105,128,  9,195,228,229,246,\n     97,128,  9, 67,231,245,234,225,242,225,244,105,128, 10,195,115,\n    147,  0,115,168,217,170,187,170,198,171, 68,171,107,174, 49,174,\n     60,176,203,179, 85,179,131,179,158,180, 93,180,160,181,193,181,\n    203,182,133,182,206,183,120,183,130, 97,  9,168,237,168,247,169,\n     12,169, 84,169,109,169,120,169,145,169,177,169,217,226,229,238,\n    231,225,236,105,128,  9,184,227,245,244,101,129,  1, 91,169,  0,\n    228,239,244,225,227,227,229,238,116,128, 30,101,100,  5,169, 24,\n    169, 33,169, 39,169, 53,169, 69,225,242,225,226,233, 99,128,  6,\n     53,229,246, 97,128,  9, 56,230,233,238,225,236,225,242,225,226,\n    233, 99,128,254,186,233,238,233,244,233,225,236,225,242,225,226,\n    233, 99,128,254,187,237,229,228,233,225,236,225,242,225,226,233,\n     99,128,254,188,231,117,  2,169, 91,169,100,234,225,242,225,244,\n    105,128, 10,184,242,237,245,235,232,105,128, 10, 56,232,233,242,\n    225,231,225,238, 97,128, 48, 85,235,225,244,225,235,225,238, 97,\n    129, 48,181,169,133,232,225,236,230,247,233,228,244,104,128,255,\n    123,236,236,225,236,236,225,232,239,245,225,236,225,249,232,229,\n    247,225,243,225,236,236,225,237,225,242,225,226,233, 99,128,253,\n    250,237,229,235,104,130,  5,225,169,188,169,208,228,225,231,229,\n    243,104,129,251, 65,169,199,232,229,226,242,229,119,128,251, 65,\n    232,229,226,242,229,119,128,  5,225,242, 97,  5,169,230,170, 48,\n    170, 56,170,106,170,114, 97,  5,169,242,169,250,170,  2,170, 33,\n    170, 41,225,244,232,225,105,128, 14, 50,229,244,232,225,105,128,\n     14, 65,233,237,225,233,109,  2,170, 12,170, 23,225,236,225,233,\n    244,232,225,105,128, 14, 68,245,225,238,244,232,225,105,128, 14,\n     67,237,244,232,225,105,128, 14, 51,244,232,225,105,128, 14, 48,\n    229,244,232,225,105,128, 14, 64,105,  3,170, 64,170, 88,170, 99,\n    105,  2,170, 70,170, 81,236,229,230,244,244,232,225,105,128,248,\n    134,244,232,225,105,128, 14, 53,236,229,230,244,244,232,225,105,\n    128,248,133,244,232,225,105,128, 14, 52,239,244,232,225,105,128,\n     14, 66,117,  3,170,122,170,172,170,179,101,  3,170,130,170,154,\n    170,165,101,  2,170,136,170,147,236,229,230,244,244,232,225,105,\n    128,248,136,244,232,225,105,128, 14, 55,236,229,230,244,244,232,\n    225,105,128,248,135,244,232,225,105,128, 14, 54,244,232,225,105,\n    128, 14, 56,245,244,232,225,105,128, 14, 57,226,239,240,239,237,\n    239,230,111,128, 49, 25, 99,  5,170,210,170,231,170,240,171, 33,\n    171, 55,225,242,239,110,129,  1, 97,170,219,228,239,244,225,227,\n    227,229,238,116,128, 30,103,229,228,233,236,236, 97,128,  1, 95,\n    232,247, 97,131,  2, 89,170,252,171,  7,171, 26,227,249,242,233,\n    236,236,233, 99,128,  4,217,228,233,229,242,229,243,233,243,227,\n    249,242,233,236,236,233, 99,128,  4,219,232,239,239,107,128,  2,\n     90,233,242, 99,  2,171, 41,171, 46,236,101,128, 36,226,245,237,\n    230,236,229,120,128,  1, 93,239,237,237,225,225,227,227,229,238,\n    116,128,  2, 25,228,239,116,  2,171, 76,171, 85,225,227,227,229,\n    238,116,128, 30, 97,226,229,236,239,119,129, 30, 99,171, 95,228,\n    239,244,225,227,227,229,238,116,128, 30,105,101,  9,171,127,171,\n    143,171,178,171,243,172, 90,172,117,172,142,172,223,172,250,225,\n    231,245,236,236,226,229,236,239,247,227,237, 98,128,  3, 60, 99,\n      2,171,149,171,171,239,238,100,129, 32, 51,171,157,244,239,238,\n    229,227,232,233,238,229,243,101,128,  2,202,244,233,239,110,128,\n      0,167,229,110,  4,171,189,171,198,171,212,171,228,225,242,225,\n    226,233, 99,128,  6, 51,230,233,238,225,236,225,242,225,226,233,\n     99,128,254,178,233,238,233,244,233,225,236,225,242,225,226,233,\n     99,128,254,179,237,229,228,233,225,236,225,242,225,226,233, 99,\n    128,254,180,231,239,108,135,  5,182,172,  7,172, 21,172, 26,172,\n     35,172, 50,172, 66,172, 77, 49,  2,172, 13,172, 17, 51,128,  5,\n    182,102,128,  5,182,178, 99,128,  5,182,232,229,226,242,229,119,\n    128,  5,182,238,225,242,242,239,247,232,229,226,242,229,119,128,\n      5,182,241,245,225,242,244,229,242,232,229,226,242,229,119,128,\n      5,182,244,225,232,229,226,242,229,119,128,  5,146,247,233,228,\n    229,232,229,226,242,229,119,128,  5,182,104,  2,172, 96,172,107,\n    225,242,237,229,238,233,225,110,128,  5,125,233,242,225,231,225,\n    238, 97,128, 48, 91,235,225,244,225,235,225,238, 97,129, 48,187,\n    172,130,232,225,236,230,247,233,228,244,104,128,255,126,237,105,\n      2,172,149,172,192,227,239,236,239,110,131,  0, 59,172,163,172,\n    172,172,184,225,242,225,226,233, 99,128,  6, 27,237,239,238,239,\n    243,240,225,227,101,128,255, 27,243,237,225,236,108,128,254, 84,\n    246,239,233,227,229,228,237,225,242,235,235,225,238, 97,129, 48,\n    156,172,211,232,225,236,230,247,233,228,244,104,128,255,159,238,\n    116,  2,172,230,172,240,233,243,241,245,225,242,101,128, 51, 34,\n    239,243,241,245,225,242,101,128, 51, 35,246,229,110,142,  0, 55,\n    173, 28,173, 37,173, 47,173, 77,173, 84,173, 94,173,119,173,146,\n    173,180,173,192,173,203,173,236,173,244,173,255,225,242,225,226,\n    233, 99,128,  6,103,226,229,238,231,225,236,105,128,  9,237,227,\n    233,242,227,236,101,129, 36,102,173, 58,233,238,246,229,242,243,\n    229,243,225,238,243,243,229,242,233,102,128, 39,144,228,229,246,\n     97,128,  9,109,229,233,231,232,244,232,115,128, 33, 94,231,117,\n      2,173,101,173,110,234,225,242,225,244,105,128, 10,237,242,237,\n    245,235,232,105,128, 10,109,232, 97,  2,173,126,173,137,227,235,\n    225,242,225,226,233, 99,128,  6,103,238,231,250,232,239,117,128,\n     48, 39,105,  2,173,152,173,170,228,229,239,231,242,225,240,232,\n    233,227,240,225,242,229,110,128, 50, 38,238,230,229,242,233,239,\n    114,128, 32,135,237,239,238,239,243,240,225,227,101,128,255, 23,\n    239,236,228,243,244,249,236,101,128,247, 55,112,  2,173,209,173,\n    216,225,242,229,110,128, 36,122,229,114,  2,173,223,173,229,233,\n    239,100,128, 36,142,243,233,225,110,128,  6,247,242,239,237,225,\n    110,128, 33,118,243,245,240,229,242,233,239,114,128, 32,119,116,\n      2,174,  5,174, 43,229,229,110,  2,174, 13,174, 22,227,233,242,\n    227,236,101,128, 36,112,112,  2,174, 28,174, 35,225,242,229,110,\n    128, 36,132,229,242,233,239,100,128, 36,152,232,225,105,128, 14,\n     87,230,244,232,249,240,232,229,110,128,  0,173,104,  7,174, 76,\n    175, 50,175, 61,175, 75,176, 20,176, 33,176,197, 97,  6,174, 90,\n    174,101,174,111,174,122,175,  9,175, 34,225,242,237,229,238,233,\n    225,110,128,  5,119,226,229,238,231,225,236,105,128,  9,182,227,\n    249,242,233,236,236,233, 99,128,  4, 72,100,  2,174,128,174,224,\n    228, 97,  4,174,139,174,148,174,179,174,193,225,242,225,226,233,\n     99,128,  6, 81,228,225,237,237, 97,  2,174,158,174,167,225,242,\n    225,226,233, 99,128,252, 97,244,225,238,225,242,225,226,233, 99,\n    128,252, 94,230,225,244,232,225,225,242,225,226,233, 99,128,252,\n     96,235,225,243,242, 97,  2,174,203,174,212,225,242,225,226,233,\n     99,128,252, 98,244,225,238,225,242,225,226,233, 99,128,252, 95,\n    101,132, 37,146,174,236,174,243,174,251,175,  4,228,225,242,107,\n    128, 37,147,236,233,231,232,116,128, 37,145,237,229,228,233,245,\n    109,128, 37,146,246, 97,128,  9, 54,231,117,  2,175, 16,175, 25,\n    234,225,242,225,244,105,128, 10,182,242,237,245,235,232,105,128,\n     10, 54,236,243,232,229,236,229,244,232,229,226,242,229,119,128,\n      5,147,226,239,240,239,237,239,230,111,128, 49, 21,227,232,225,\n    227,249,242,233,236,236,233, 99,128,  4, 73,101,  4,175, 85,175,\n    150,175,160,175,177,229,110,  4,175, 96,175,105,175,119,175,135,\n    225,242,225,226,233, 99,128,  6, 52,230,233,238,225,236,225,242,\n    225,226,233, 99,128,254,182,233,238,233,244,233,225,236,225,242,\n    225,226,233, 99,128,254,183,237,229,228,233,225,236,225,242,225,\n    226,233, 99,128,254,184,233,227,239,240,244,233, 99,128,  3,227,\n    241,229,108,129, 32,170,175,168,232,229,226,242,229,119,128, 32,\n    170,246, 97,134,  5,176,175,194,175,209,175,223,175,232,175,247,\n    176,  7, 49,  2,175,200,175,205,177, 53,128,  5,176, 53,128,  5,\n    176, 50,  2,175,215,175,219, 50,128,  5,176,101,128,  5,176,232,\n    229,226,242,229,119,128,  5,176,238,225,242,242,239,247,232,229,\n    226,242,229,119,128,  5,176,241,245,225,242,244,229,242,232,229,\n    226,242,229,119,128,  5,176,247,233,228,229,232,229,226,242,229,\n    119,128,  5,176,232,225,227,249,242,233,236,236,233, 99,128,  4,\n    187,105,  2,176, 39,176, 50,237,225,227,239,240,244,233, 99,128,\n      3,237,110,131,  5,233,176, 60,176,143,176,152,100,  2,176, 66,\n    176,132,225,231,229,243,104,130,251, 73,176, 78,176, 87,232,229,\n    226,242,229,119,128,251, 73,115,  2,176, 93,176,113,232,233,238,\n    228,239,116,129,251, 44,176,104,232,229,226,242,229,119,128,251,\n     44,233,238,228,239,116,129,251, 45,176,123,232,229,226,242,229,\n    119,128,251, 45,239,244,232,229,226,242,229,119,128,  5,193,232,\n    229,226,242,229,119,128,  5,233,115,  2,176,158,176,178,232,233,\n    238,228,239,116,129,251, 42,176,169,232,229,226,242,229,119,128,\n    251, 42,233,238,228,239,116,129,251, 43,176,188,232,229,226,242,\n    229,119,128,251, 43,239,239,107,128,  2,130,105,  8,176,221,177,\n      9,177, 20,177, 45,177, 75,177, 83,177, 96,178, 11,231,237, 97,\n    131,  3,195,176,233,176,237,176,245, 49,128,  3,194,230,233,238,\n    225,108,128,  3,194,236,245,238,225,244,229,243,249,237,226,239,\n    236,231,242,229,229,107,128,  3,242,232,233,242,225,231,225,238,\n     97,128, 48, 87,235,225,244,225,235,225,238, 97,129, 48,183,177,\n     33,232,225,236,230,247,233,228,244,104,128,255,124,236,245,113,\n      2,177, 53,177, 62,232,229,226,242,229,119,128,  5,189,236,229,\n    230,244,232,229,226,242,229,119,128,  5,189,237,233,236,225,114,\n    128, 34, 60,238,228,239,244,232,229,226,242,229,119,128,  5,194,\n    239,115,  6,177,111,177,146,177,178,177,206,177,220,177,252, 97,\n      2,177,117,177,132,227,233,242,227,236,229,235,239,242,229,225,\n    110,128, 50,116,240,225,242,229,238,235,239,242,229,225,110,128,\n     50, 20,227,105,  2,177,153,177,165,229,245,227,235,239,242,229,\n    225,110,128, 49,126,242,227,236,229,235,239,242,229,225,110,128,\n     50,102,107,  2,177,184,177,198,233,249,229,239,235,235,239,242,\n    229,225,110,128, 49,122,239,242,229,225,110,128, 49, 69,238,233,\n    229,245,238,235,239,242,229,225,110,128, 49,123,112,  2,177,226,\n    177,239,225,242,229,238,235,239,242,229,225,110,128, 50,  6,233,\n    229,245,240,235,239,242,229,225,110,128, 49,125,244,233,235,229,\n    245,244,235,239,242,229,225,110,128, 49,124,120,141,  0, 54,178,\n     41,178, 50,178, 60,178, 90,178, 97,178,122,178,149,178,183,178,\n    195,178,206,178,239,178,247,179,  2,225,242,225,226,233, 99,128,\n      6,102,226,229,238,231,225,236,105,128,  9,236,227,233,242,227,\n    236,101,129, 36,101,178, 71,233,238,246,229,242,243,229,243,225,\n    238,243,243,229,242,233,102,128, 39,143,228,229,246, 97,128,  9,\n    108,231,117,  2,178,104,178,113,234,225,242,225,244,105,128, 10,\n    236,242,237,245,235,232,105,128, 10,108,232, 97,  2,178,129,178,\n    140,227,235,225,242,225,226,233, 99,128,  6,102,238,231,250,232,\n    239,117,128, 48, 38,105,  2,178,155,178,173,228,229,239,231,242,\n    225,240,232,233,227,240,225,242,229,110,128, 50, 37,238,230,229,\n    242,233,239,114,128, 32,134,237,239,238,239,243,240,225,227,101,\n    128,255, 22,239,236,228,243,244,249,236,101,128,247, 54,112,  2,\n    178,212,178,219,225,242,229,110,128, 36,121,229,114,  2,178,226,\n    178,232,233,239,100,128, 36,141,243,233,225,110,128,  6,246,242,\n    239,237,225,110,128, 33,117,243,245,240,229,242,233,239,114,128,\n     32,118,116,  2,179,  8,179, 79,229,229,110,  2,179, 16,179, 58,\n     99,  2,179, 22,179, 30,233,242,227,236,101,128, 36,111,245,242,\n    242,229,238,227,249,228,229,238,239,237,233,238,225,244,239,242,\n    226,229,238,231,225,236,105,128,  9,249,112,  2,179, 64,179, 71,\n    225,242,229,110,128, 36,131,229,242,233,239,100,128, 36,151,232,\n    225,105,128, 14, 86,108,  2,179, 91,179,111,225,243,104,129,  0,\n     47,179, 99,237,239,238,239,243,240,225,227,101,128,255, 15,239,\n    238,103,129,  1,127,179,119,228,239,244,225,227,227,229,238,116,\n    128, 30,155,109,  2,179,137,179,147,233,236,229,230,225,227,101,\n    128, 38, 58,239,238,239,243,240,225,227,101,128,255, 83,111,  6,\n    179,172,179,222,179,233,180,  2,180, 47,180, 58,102,  2,179,178,\n    179,192,240,225,243,245,241,232,229,226,242,229,119,128,  5,195,\n    116,  2,179,198,179,207,232,249,240,232,229,110,128,  0,173,243,\n    233,231,238,227,249,242,233,236,236,233, 99,128,  4, 76,232,233,\n    242,225,231,225,238, 97,128, 48, 93,235,225,244,225,235,225,238,\n     97,129, 48,189,179,246,232,225,236,230,247,233,228,244,104,128,\n    255,127,236,233,228,245,115,  2,180, 12,180, 29,236,239,238,231,\n    239,246,229,242,236,225,249,227,237, 98,128,  3, 56,243,232,239,\n    242,244,239,246,229,242,236,225,249,227,237, 98,128,  3, 55,242,\n    245,243,233,244,232,225,105,128, 14, 41,115,  3,180, 66,180, 76,\n    180, 84,225,236,225,244,232,225,105,128, 14, 40,239,244,232,225,\n    105,128, 14, 11,245,225,244,232,225,105,128, 14, 42,240, 97,  3,\n    180,102,180,122,180,154,227,101,129,  0, 32,180,109,232,225,227,\n    235,225,242,225,226,233, 99,128,  0, 32,228,101,129, 38, 96,180,\n    129,243,245,233,116,  2,180,138,180,146,226,236,225,227,107,128,\n     38, 96,247,232,233,244,101,128, 38,100,242,229,110,128, 36,174,\n    241,245,225,242,101, 11,180,188,180,199,180,213,180,238,180,255,\n    181, 25,181, 40,181, 73,181,100,181,156,181,171,226,229,236,239,\n    247,227,237, 98,128,  3, 59, 99,  2,180,205,180,209, 99,128, 51,\n    196,109,128, 51,157,228,233,225,231,239,238,225,236,227,242,239,\n    243,243,232,225,244,227,232,230,233,236,108,128, 37,169,232,239,\n    242,233,250,239,238,244,225,236,230,233,236,108,128, 37,164,107,\n      2,181,  5,181,  9,103,128, 51,143,109,129, 51,158,181, 15,227,\n    225,240,233,244,225,108,128, 51,206,108,  2,181, 31,181, 35,110,\n    128, 51,209,239,103,128, 51,210,109,  4,181, 50,181, 54,181, 59,\n    181, 63,103,128, 51,142,233,108,128, 51,213,109,128, 51,156,243,\n    241,245,225,242,229,100,128, 51,161,239,242,244,232,239,231,239,\n    238,225,236,227,242,239,243,243,232,225,244,227,232,230,233,236,\n    108,128, 37,166,245,240,240,229,114,  2,181,110,181,133,236,229,\n    230,244,244,239,236,239,247,229,242,242,233,231,232,244,230,233,\n    236,108,128, 37,167,242,233,231,232,244,244,239,236,239,247,229,\n    242,236,229,230,244,230,233,236,108,128, 37,168,246,229,242,244,\n    233,227,225,236,230,233,236,108,128, 37,165,247,232,233,244,229,\n    247,233,244,232,243,237,225,236,236,226,236,225,227,107,128, 37,\n    163,242,243,241,245,225,242,101,128, 51,219,115,  2,181,209,182,\n    123, 97,  4,181,219,181,229,181,236,181,247,226,229,238,231,225,\n    236,105,128,  9,183,228,229,246, 97,128,  9, 55,231,245,234,225,\n    242,225,244,105,128, 10,183,238,103,  8,182, 10,182, 24,182, 38,\n    182, 52,182, 67,182, 81,182, 95,182,108,227,233,229,245,227,235,\n    239,242,229,225,110,128, 49, 73,232,233,229,245,232,235,239,242,\n    229,225,110,128, 49,133,233,229,245,238,231,235,239,242,229,225,\n    110,128, 49,128,235,233,249,229,239,235,235,239,242,229,225,110,\n    128, 49, 50,238,233,229,245,238,235,239,242,229,225,110,128, 49,\n    101,240,233,229,245,240,235,239,242,229,225,110,128, 49, 67,243,\n    233,239,243,235,239,242,229,225,110,128, 49, 70,244,233,235,229,\n    245,244,235,239,242,229,225,110,128, 49, 56,245,240,229,242,233,\n    239,114,128,246,242,116,  2,182,139,182,162,229,242,236,233,238,\n    103,129,  0,163,182,150,237,239,238,239,243,240,225,227,101,128,\n    255,225,242,239,235,101,  2,182,171,182,188,236,239,238,231,239,\n    246,229,242,236,225,249,227,237, 98,128,  3, 54,243,232,239,242,\n    244,239,246,229,242,236,225,249,227,237, 98,128,  3, 53,117,  7,\n    182,222,182,254,183, 20,183, 31,183, 72,183, 82,183, 86,226,243,\n    229,116,130, 34,130,182,233,182,244,238,239,244,229,241,245,225,\n    108,128, 34,138,239,242,229,241,245,225,108,128, 34,134, 99,  2,\n    183,  4,183, 12,227,229,229,228,115,128, 34,123,232,244,232,225,\n    116,128, 34, 11,232,233,242,225,231,225,238, 97,128, 48, 89,107,\n      2,183, 37,183, 61,225,244,225,235,225,238, 97,129, 48,185,183,\n     49,232,225,236,230,247,233,228,244,104,128,255,125,245,238,225,\n    242,225,226,233, 99,128,  6, 82,237,237,225,244,233,239,110,128,\n     34, 17,110,128, 38, 60,240,229,242,243,229,116,130, 34,131,183,\n     99,183,110,238,239,244,229,241,245,225,108,128, 34,139,239,242,\n    229,241,245,225,108,128, 34,135,246,243,241,245,225,242,101,128,\n     51,220,249,239,245,247,225,229,242,225,243,241,245,225,242,101,\n    128, 51,124,116,144,  0,116,183,183,184,192,184,213,185,100,185,\n    140,187,188,191, 70,192,145,192,157,192,169,193,202,193,227,194,\n     57,194,237,195,165,195,255, 97, 10,183,205,183,215,183,236,183,\n    243,184, 12,184, 90,184,107,184,132,184,146,184,150,226,229,238,\n    231,225,236,105,128,  9,164,227,107,  2,183,222,183,229,228,239,\n    247,110,128, 34,164,236,229,230,116,128, 34,163,228,229,246, 97,\n    128,  9, 36,231,117,  2,183,250,184,  3,234,225,242,225,244,105,\n    128, 10,164,242,237,245,235,232,105,128, 10, 36,104,  4,184, 22,\n    184, 31,184, 45,184, 75,225,242,225,226,233, 99,128,  6, 55,230,\n    233,238,225,236,225,242,225,226,233, 99,128,254,194,105,  2,184,\n     51,184, 66,238,233,244,233,225,236,225,242,225,226,233, 99,128,\n    254,195,242,225,231,225,238, 97,128, 48, 95,237,229,228,233,225,\n    236,225,242,225,226,233, 99,128,254,196,233,243,249,239,245,229,\n    242,225,243,241,245,225,242,101,128, 51,125,235,225,244,225,235,\n    225,238, 97,129, 48,191,184,120,232,225,236,230,247,233,228,244,\n    104,128,255,128,244,247,229,229,236,225,242,225,226,233, 99,128,\n      6, 64,117,128,  3,196,118,130,  5,234,184,158,184,183,228,225,\n    231,229,115,129,251, 74,184,168,104,129,251, 74,184,174,232,229,\n    226,242,229,119,128,251, 74,232,229,226,242,229,119,128,  5,234,\n     98,  2,184,198,184,203,225,114,128,  1,103,239,240,239,237,239,\n    230,111,128, 49, 10, 99,  6,184,227,184,234,184,241,184,250,185,\n     60,185, 87,225,242,239,110,128,  1,101,227,245,242,108,128,  2,\n    168,229,228,233,236,236, 97,128,  1, 99,232,229,104,  4,185,  6,\n    185, 15,185, 29,185, 45,225,242,225,226,233, 99,128,  6,134,230,\n    233,238,225,236,225,242,225,226,233, 99,128,251,123,233,238,233,\n    244,233,225,236,225,242,225,226,233, 99,128,251,124,237,229,228,\n    233,225,236,225,242,225,226,233, 99,128,251,125,233,242, 99,  2,\n    185, 68,185, 73,236,101,128, 36,227,245,237,230,236,229,248,226,\n    229,236,239,119,128, 30,113,239,237,237,225,225,227,227,229,238,\n    116,128,  1, 99,100,  2,185,106,185,116,233,229,242,229,243,233,\n    115,128, 30,151,239,116,  2,185,123,185,132,225,227,227,229,238,\n    116,128, 30,107,226,229,236,239,119,128, 30,109,101,  9,185,160,\n    185,171,185,191,186,201,186,226,187, 34,187,101,187,106,187,158,\n    227,249,242,233,236,236,233, 99,128,  4, 66,228,229,243,227,229,\n    238,228,229,242,227,249,242,233,236,236,233, 99,128,  4,173,104,\n      7,185,207,185,216,185,230,186, 14,186, 44,186, 85,186,183,225,\n    242,225,226,233, 99,128,  6, 42,230,233,238,225,236,225,242,225,\n    226,233, 99,128,254,150,232,225,232,105,  2,185,239,185,254,238,\n    233,244,233,225,236,225,242,225,226,233, 99,128,252,162,243,239,\n    236,225,244,229,228,225,242,225,226,233, 99,128,252, 12,105,  2,\n    186, 20,186, 35,238,233,244,233,225,236,225,242,225,226,233, 99,\n    128,254,151,242,225,231,225,238, 97,128, 48,102,234,229,229,237,\n    105,  2,186, 54,186, 69,238,233,244,233,225,236,225,242,225,226,\n    233, 99,128,252,161,243,239,236,225,244,229,228,225,242,225,226,\n    233, 99,128,252, 11,109,  2,186, 91,186,125,225,242,226,245,244,\n     97,  2,186,102,186,111,225,242,225,226,233, 99,128,  6, 41,230,\n    233,238,225,236,225,242,225,226,233, 99,128,254,148,101,  2,186,\n    131,186,144,228,233,225,236,225,242,225,226,233, 99,128,254,152,\n    229,237,105,  2,186,152,186,167,238,233,244,233,225,236,225,242,\n    225,226,233, 99,128,252,164,243,239,236,225,244,229,228,225,242,\n    225,226,233, 99,128,252, 14,238,239,239,238,230,233,238,225,236,\n    225,242,225,226,233, 99,128,252,115,235,225,244,225,235,225,238,\n     97,129, 48,198,186,214,232,225,236,230,247,233,228,244,104,128,\n    255,131,108,  2,186,232,186,251,229,240,232,239,238,101,129, 33,\n     33,186,243,226,236,225,227,107,128, 38, 14,233,243,232, 97,  2,\n    187,  4,187, 19,231,229,228,239,236,225,232,229,226,242,229,119,\n    128,  5,160,241,229,244,225,238,225,232,229,226,242,229,119,128,\n      5,169,110,  4,187, 44,187, 53,187, 72,187, 93,227,233,242,227,\n    236,101,128, 36,105,233,228,229,239,231,242,225,240,232,233,227,\n    240,225,242,229,110,128, 50, 41,112,  2,187, 78,187, 85,225,242,\n    229,110,128, 36,125,229,242,233,239,100,128, 36,145,242,239,237,\n    225,110,128, 33,121,243,104,128,  2,167,116,131,  5,216,187,116,\n    187,136,187,145,228,225,231,229,243,104,129,251, 56,187,127,232,\n    229,226,242,229,119,128,251, 56,232,229,226,242,229,119,128,  5,\n    216,243,229,227,249,242,233,236,236,233, 99,128,  4,181,246,233,\n    114,  2,187,166,187,175,232,229,226,242,229,119,128,  5,155,236,\n    229,230,244,232,229,226,242,229,119,128,  5,155,104,  6,187,202,\n    188, 98,188,220,189, 96,190,  3,191, 60, 97,  5,187,214,187,224,\n    187,231,188,  0,188, 29,226,229,238,231,225,236,105,128,  9,165,\n    228,229,246, 97,128,  9, 37,231,117,  2,187,238,187,247,234,225,\n    242,225,244,105,128, 10,165,242,237,245,235,232,105,128, 10, 37,\n    108,  2,188,  6,188, 15,225,242,225,226,233, 99,128,  6, 48,230,\n    233,238,225,236,225,242,225,226,233, 99,128,254,172,238,244,232,\n    225,235,232,225,116,  3,188, 44,188, 75,188, 82,236,239,119,  2,\n    188, 52,188, 63,236,229,230,244,244,232,225,105,128,248,152,242,\n    233,231,232,244,244,232,225,105,128,248,151,244,232,225,105,128,\n     14, 76,245,240,240,229,242,236,229,230,244,244,232,225,105,128,\n    248,150,101,  3,188,106,188,170,188,193,104,  4,188,116,188,125,\n    188,139,188,155,225,242,225,226,233, 99,128,  6, 43,230,233,238,\n    225,236,225,242,225,226,233, 99,128,254,154,233,238,233,244,233,\n    225,236,225,242,225,226,233, 99,128,254,155,237,229,228,233,225,\n    236,225,242,225,226,233, 99,128,254,156,242,101,  2,188,177,188,\n    186,229,248,233,243,244,115,128, 34,  3,230,239,242,101,128, 34,\n     52,244, 97,130,  3,184,188,202,188,206, 49,128,  3,209,243,249,\n    237,226,239,236,231,242,229,229,107,128,  3,209,105,  2,188,226,\n    189, 56,229,245,244,104,  4,188,239,189, 18,189, 33,189, 42, 97,\n      2,188,245,189,  4,227,233,242,227,236,229,235,239,242,229,225,\n    110,128, 50,121,240,225,242,229,238,235,239,242,229,225,110,128,\n     50, 25,227,233,242,227,236,229,235,239,242,229,225,110,128, 50,\n    107,235,239,242,229,225,110,128, 49, 76,240,225,242,229,238,235,\n    239,242,229,225,110,128, 50, 11,242,244,229,229,110,  2,189, 66,\n    189, 75,227,233,242,227,236,101,128, 36,108,112,  2,189, 81,189,\n     88,225,242,229,110,128, 36,128,229,242,233,239,100,128, 36,148,\n    111,  6,189,110,189,127,189,132,189,146,189,151,189,204,238,225,\n    238,231,237,239,238,244,232,239,244,232,225,105,128, 14, 17,239,\n    107,128,  1,173,240,232,245,244,232,225,239,244,232,225,105,128,\n     14, 18,242,110,128,  0,254,244,104,  3,189,160,189,184,189,194,\n     97,  2,189,166,189,176,232,225,238,244,232,225,105,128, 14, 23,\n    238,244,232,225,105,128, 14, 16,239,238,231,244,232,225,105,128,\n     14, 24,245,238,231,244,232,225,105,128, 14, 22,245,243,225,238,\n    100,  2,189,214,189,225,227,249,242,233,236,236,233, 99,128,  4,\n    130,243,243,229,240,225,242,225,244,239,114,  2,189,240,189,249,\n    225,242,225,226,233, 99,128,  6,108,240,229,242,243,233,225,110,\n    128,  6,108,242,229,101,144,  0, 51,190, 41,190, 50,190, 60,190,\n     90,190, 97,190,107,190,132,190,159,190,193,190,205,190,224,190,\n    235,191, 12,191, 34,191, 42,191, 53,225,242,225,226,233, 99,128,\n      6, 99,226,229,238,231,225,236,105,128,  9,233,227,233,242,227,\n    236,101,129, 36, 98,190, 71,233,238,246,229,242,243,229,243,225,\n    238,243,243,229,242,233,102,128, 39,140,228,229,246, 97,128,  9,\n    105,229,233,231,232,244,232,115,128, 33, 92,231,117,  2,190,114,\n    190,123,234,225,242,225,244,105,128, 10,233,242,237,245,235,232,\n    105,128, 10,105,232, 97,  2,190,139,190,150,227,235,225,242,225,\n    226,233, 99,128,  6, 99,238,231,250,232,239,117,128, 48, 35,105,\n      2,190,165,190,183,228,229,239,231,242,225,240,232,233,227,240,\n    225,242,229,110,128, 50, 34,238,230,229,242,233,239,114,128, 32,\n    131,237,239,238,239,243,240,225,227,101,128,255, 19,238,245,237,\n    229,242,225,244,239,242,226,229,238,231,225,236,105,128,  9,246,\n    239,236,228,243,244,249,236,101,128,247, 51,112,  2,190,241,190,\n    248,225,242,229,110,128, 36,118,229,114,  2,190,255,191,  5,233,\n    239,100,128, 36,138,243,233,225,110,128,  6,243,241,245,225,242,\n    244,229,242,115,129,  0,190,191, 25,229,237,228,225,243,104,128,\n    246,222,242,239,237,225,110,128, 33,114,243,245,240,229,242,233,\n    239,114,128,  0,179,244,232,225,105,128, 14, 83,250,243,241,245,\n    225,242,101,128, 51,148,105,  7,191, 86,191, 97,191,212,192, 54,\n    192, 66,192,115,192,132,232,233,242,225,231,225,238, 97,128, 48,\n     97,107,  2,191,103,191,127,225,244,225,235,225,238, 97,129, 48,\n    193,191,115,232,225,236,230,247,233,228,244,104,128,255,129,229,\n    245,116,  4,191,139,191,174,191,189,191,198, 97,  2,191,145,191,\n    160,227,233,242,227,236,229,235,239,242,229,225,110,128, 50,112,\n    240,225,242,229,238,235,239,242,229,225,110,128, 50, 16,227,233,\n    242,227,236,229,235,239,242,229,225,110,128, 50, 98,235,239,242,\n    229,225,110,128, 49, 55,240,225,242,229,238,235,239,242,229,225,\n    110,128, 50,  2,236,228,101,133,  2,220,191,228,191,239,192,  0,\n    192, 12,192, 40,226,229,236,239,247,227,237, 98,128,  3, 48, 99,\n      2,191,245,191,250,237, 98,128,  3,  3,239,237, 98,128,  3,  3,\n    228,239,245,226,236,229,227,237, 98,128,  3, 96,111,  2,192, 18,\n    192, 28,240,229,242,225,244,239,114,128, 34, 60,246,229,242,236,\n    225,249,227,237, 98,128,  3, 52,246,229,242,244,233,227,225,236,\n    227,237, 98,128,  3, 62,237,229,243,227,233,242,227,236,101,128,\n     34,151,112,  2,192, 72,192,102,229,232, 97,  2,192, 80,192, 89,\n    232,229,226,242,229,119,128,  5,150,236,229,230,244,232,229,226,\n    242,229,119,128,  5,150,240,233,231,245,242,237,245,235,232,105,\n    128, 10,112,244,236,239,227,249,242,233,236,236,233,227,227,237,\n     98,128,  4,131,247,238,225,242,237,229,238,233,225,110,128,  5,\n    127,236,233,238,229,226,229,236,239,119,128, 30,111,237,239,238,\n    239,243,240,225,227,101,128,255, 84,111,  7,192,185,192,196,192,\n    207,192,232,193, 96,193,108,193,192,225,242,237,229,238,233,225,\n    110,128,  5,105,232,233,242,225,231,225,238, 97,128, 48,104,235,\n    225,244,225,235,225,238, 97,129, 48,200,192,220,232,225,236,230,\n    247,233,228,244,104,128,255,132,110,  3,192,240,193, 82,193, 87,\n    101,  4,192,250,193, 63,193, 70,193, 76,226,225,114,  4,193,  6,\n    193, 35,193, 45,193, 54,229,248,244,242, 97,  2,193, 16,193, 26,\n    232,233,231,232,237,239,100,128,  2,229,236,239,247,237,239,100,\n    128,  2,233,232,233,231,232,237,239,100,128,  2,230,236,239,247,\n    237,239,100,128,  2,232,237,233,228,237,239,100,128,  2,231,230,\n    233,246,101,128,  1,189,243,233,120,128,  1,133,244,247,111,128,\n      1,168,239,115,128,  3,132,243,241,245,225,242,101,128, 51, 39,\n    240,225,244,225,235,244,232,225,105,128, 14, 15,242,244,239,233,\n    243,229,243,232,229,236,236,226,242,225,227,235,229,116,  2,193,\n    131,193,161,236,229,230,116,130, 48, 20,193,142,193,150,243,237,\n    225,236,108,128,254, 93,246,229,242,244,233,227,225,108,128,254,\n     57,242,233,231,232,116,130, 48, 21,193,173,193,181,243,237,225,\n    236,108,128,254, 94,246,229,242,244,233,227,225,108,128,254, 58,\n    244,225,239,244,232,225,105,128, 14, 21,240, 97,  2,193,209,193,\n    221,236,225,244,225,236,232,239,239,107,128,  1,171,242,229,110,\n    128, 36,175,114,  3,193,235,194, 10,194, 25,225,228,229,237,225,\n    242,107,129, 33, 34,193,247,115,  2,193,253,194,  3,225,238,115,\n    128,248,234,229,242,233,102,128,246,219,229,244,242,239,230,236,\n    229,248,232,239,239,107,128,  2,136,233,225,103,  4,194, 37,194,\n     42,194, 47,194, 52,228,110,128, 37,188,236,102,128, 37,196,242,\n    116,128, 37,186,245,112,128, 37,178,115,132,  2,166,194, 69,194,\n    108,194,214,194,227,225,228,105,130,  5,230,194, 79,194, 99,228,\n    225,231,229,243,104,129,251, 70,194, 90,232,229,226,242,229,119,\n    128,251, 70,232,229,226,242,229,119,128,  5,230,101,  2,194,114,\n    194,125,227,249,242,233,236,236,233, 99,128,  4, 70,242,101,134,\n      5,181,194,142,194,156,194,161,194,170,194,185,194,201, 49,  2,\n    194,148,194,152, 50,128,  5,181,101,128,  5,181,178, 98,128,  5,\n    181,232,229,226,242,229,119,128,  5,181,238,225,242,242,239,247,\n    232,229,226,242,229,119,128,  5,181,241,245,225,242,244,229,242,\n    232,229,226,242,229,119,128,  5,181,247,233,228,229,232,229,226,\n    242,229,119,128,  5,181,232,229,227,249,242,233,236,236,233, 99,\n    128,  4, 91,245,240,229,242,233,239,114,128,246,243,116,  4,194,\n    247,195, 41,195,106,195,157, 97,  3,194,255,195,  9,195, 16,226,\n    229,238,231,225,236,105,128,  9,159,228,229,246, 97,128,  9, 31,\n    231,117,  2,195, 23,195, 32,234,225,242,225,244,105,128, 10,159,\n    242,237,245,235,232,105,128, 10, 31,229,104,  4,195, 52,195, 61,\n    195, 75,195, 91,225,242,225,226,233, 99,128,  6,121,230,233,238,\n    225,236,225,242,225,226,233, 99,128,251,103,233,238,233,244,233,\n    225,236,225,242,225,226,233, 99,128,251,104,237,229,228,233,225,\n    236,225,242,225,226,233, 99,128,251,105,232, 97,  3,195,115,195,\n    125,195,132,226,229,238,231,225,236,105,128,  9,160,228,229,246,\n     97,128,  9, 32,231,117,  2,195,139,195,148,234,225,242,225,244,\n    105,128, 10,160,242,237,245,235,232,105,128, 10, 32,245,242,238,\n    229,100,128,  2,135,117,  3,195,173,195,184,195,209,232,233,242,\n    225,231,225,238, 97,128, 48,100,235,225,244,225,235,225,238, 97,\n    129, 48,196,195,197,232,225,236,230,247,233,228,244,104,128,255,\n    130,243,237,225,236,108,  2,195,219,195,230,232,233,242,225,231,\n    225,238, 97,128, 48, 99,235,225,244,225,235,225,238, 97,129, 48,\n    195,195,243,232,225,236,230,247,233,228,244,104,128,255,111,119,\n      2,196,  5,196,110,101,  2,196, 11,196, 59,236,246,101,  3,196,\n     21,196, 30,196, 51,227,233,242,227,236,101,128, 36,107,112,  2,\n    196, 36,196, 43,225,242,229,110,128, 36,127,229,242,233,239,100,\n    128, 36,147,242,239,237,225,110,128, 33,123,238,244,121,  3,196,\n     69,196, 78,196, 89,227,233,242,227,236,101,128, 36,115,232,225,\n    238,231,250,232,239,117,128, 83, 68,112,  2,196, 95,196,102,225,\n    242,229,110,128, 36,135,229,242,233,239,100,128, 36,155,111,142,\n      0, 50,196,142,196,151,196,161,196,191,196,243,197, 12,197, 39,\n    197, 73,197, 85,197,104,197,115,197,148,197,156,197,180,225,242,\n    225,226,233, 99,128,  6, 98,226,229,238,231,225,236,105,128,  9,\n    232,227,233,242,227,236,101,129, 36, 97,196,172,233,238,246,229,\n    242,243,229,243,225,238,243,243,229,242,233,102,128, 39,139,100,\n      2,196,197,196,203,229,246, 97,128,  9,104,239,116,  2,196,210,\n    196,221,229,238,236,229,225,228,229,114,128, 32, 37,236,229,225,\n    228,229,114,129, 32, 37,196,232,246,229,242,244,233,227,225,108,\n    128,254, 48,231,117,  2,196,250,197,  3,234,225,242,225,244,105,\n    128, 10,232,242,237,245,235,232,105,128, 10,104,232, 97,  2,197,\n     19,197, 30,227,235,225,242,225,226,233, 99,128,  6, 98,238,231,\n    250,232,239,117,128, 48, 34,105,  2,197, 45,197, 63,228,229,239,\n    231,242,225,240,232,233,227,240,225,242,229,110,128, 50, 33,238,\n    230,229,242,233,239,114,128, 32,130,237,239,238,239,243,240,225,\n    227,101,128,255, 18,238,245,237,229,242,225,244,239,242,226,229,\n    238,231,225,236,105,128,  9,245,239,236,228,243,244,249,236,101,\n    128,247, 50,112,  2,197,121,197,128,225,242,229,110,128, 36,117,\n    229,114,  2,197,135,197,141,233,239,100,128, 36,137,243,233,225,\n    110,128,  6,242,242,239,237,225,110,128, 33,113,115,  2,197,162,\n    197,170,244,242,239,235,101,128,  1,187,245,240,229,242,233,239,\n    114,128,  0,178,244,104,  2,197,187,197,192,225,105,128, 14, 82,\n    233,242,228,115,128, 33, 84,117,145,  0,117,197,237,197,245,198,\n     30,198, 87,198,225,199,  6,199,129,199,145,199,196,200, 10,200,\n     91,200,100,200,219,200,243,201, 95,201,123,201,237,225,227,245,\n    244,101,128,  0,250, 98,  4,197,255,198,  4,198, 13,198, 23,225,\n    114,128,  2,137,229,238,231,225,236,105,128,  9,137,239,240,239,\n    237,239,230,111,128, 49, 40,242,229,246,101,128,  1,109, 99,  3,\n    198, 38,198, 45,198, 77,225,242,239,110,128,  1,212,233,242, 99,\n      2,198, 53,198, 58,236,101,128, 36,228,245,237,230,236,229,120,\n    129,  0,251,198, 69,226,229,236,239,119,128, 30,119,249,242,233,\n    236,236,233, 99,128,  4, 67,100,  5,198, 99,198,110,198,133,198,\n    139,198,215,225,244,244,225,228,229,246, 97,128,  9, 81,226,108,\n      2,198,117,198,125,225,227,245,244,101,128,  1,113,231,242,225,\n    246,101,128,  2, 21,229,246, 97,128,  9,  9,233,229,242,229,243,\n    233,115,133,  0,252,198,159,198,167,198,175,198,198,198,206,225,\n    227,245,244,101,128,  1,216,226,229,236,239,119,128, 30,115, 99,\n      2,198,181,198,188,225,242,239,110,128,  1,218,249,242,233,236,\n    236,233, 99,128,  4,241,231,242,225,246,101,128,  1,220,237,225,\n    227,242,239,110,128,  1,214,239,244,226,229,236,239,119,128, 30,\n    229,103,  2,198,231,198,238,242,225,246,101,128,  0,249,117,  2,\n    198,244,198,253,234,225,242,225,244,105,128, 10,137,242,237,245,\n    235,232,105,128, 10,  9,104,  3,199, 14,199, 24,199,102,233,242,\n    225,231,225,238, 97,128, 48, 70,111,  2,199, 30,199, 40,239,235,\n    225,226,239,246,101,128, 30,231,242,110,133,  1,176,199, 55,199,\n     63,199, 74,199, 82,199, 94,225,227,245,244,101,128, 30,233,228,\n    239,244,226,229,236,239,119,128, 30,241,231,242,225,246,101,128,\n     30,235,232,239,239,235,225,226,239,246,101,128, 30,237,244,233,\n    236,228,101,128, 30,239,245,238,231,225,242,245,237,236,225,245,\n    116,129,  1,113,199,118,227,249,242,233,236,236,233, 99,128,  4,\n    243,233,238,246,229,242,244,229,228,226,242,229,246,101,128,  2,\n     23,107,  3,199,153,199,177,199,188,225,244,225,235,225,238, 97,\n    129, 48,166,199,165,232,225,236,230,247,233,228,244,104,128,255,\n    115,227,249,242,233,236,236,233, 99,128,  4,121,239,242,229,225,\n    110,128, 49, 92,109,  2,199,202,199,255, 97,  2,199,208,199,241,\n    227,242,239,110,130,  1,107,199,219,199,230,227,249,242,233,236,\n    236,233, 99,128,  4,239,228,233,229,242,229,243,233,115,128, 30,\n    123,244,242,225,231,245,242,237,245,235,232,105,128, 10, 65,239,\n    238,239,243,240,225,227,101,128,255, 85,110,  2,200, 16,200, 71,\n    228,229,242,243,227,239,242,101,132,  0, 95,200, 35,200, 41,200,\n     53,200, 64,228,226,108,128, 32, 23,237,239,238,239,243,240,225,\n    227,101,128,255, 63,246,229,242,244,233,227,225,108,128,254, 51,\n    247,225,246,121,128,254, 79,105,  2,200, 77,200, 82,239,110,128,\n     34, 42,246,229,242,243,225,108,128, 34,  0,239,231,239,238,229,\n    107,128,  1,115,112,  5,200,112,200,119,200,127,200,142,200,193,\n    225,242,229,110,128, 36,176,226,236,239,227,107,128, 37,128,240,\n    229,242,228,239,244,232,229,226,242,229,119,128,  5,196,243,233,\n    236,239,110,131,  3,197,200,156,200,177,200,185,228,233,229,242,\n    229,243,233,115,129,  3,203,200,169,244,239,238,239,115,128,  3,\n    176,236,225,244,233,110,128,  2,138,244,239,238,239,115,128,  3,\n    205,244,225,227,107,  2,200,202,200,213,226,229,236,239,247,227,\n    237, 98,128,  3, 29,237,239,100,128,  2,212,114,  2,200,225,200,\n    237,225,231,245,242,237,245,235,232,105,128, 10,115,233,238,103,\n    128,  1,111,115,  3,200,251,201, 10,201, 55,232,239,242,244,227,\n    249,242,233,236,236,233, 99,128,  4, 94,237,225,236,108,  2,201,\n     19,201, 30,232,233,242,225,231,225,238, 97,128, 48, 69,235,225,\n    244,225,235,225,238, 97,129, 48,165,201, 43,232,225,236,230,247,\n    233,228,244,104,128,255,105,244,242,225,233,231,232,116,  2,201,\n     67,201, 78,227,249,242,233,236,236,233, 99,128,  4,175,243,244,\n    242,239,235,229,227,249,242,233,236,236,233, 99,128,  4,177,244,\n    233,236,228,101,130,  1,105,201,107,201,115,225,227,245,244,101,\n    128, 30,121,226,229,236,239,119,128, 30,117,117,  5,201,135,201,\n    145,201,152,201,177,201,193,226,229,238,231,225,236,105,128,  9,\n    138,228,229,246, 97,128,  9, 10,231,117,  2,201,159,201,168,234,\n    225,242,225,244,105,128, 10,138,242,237,245,235,232,105,128, 10,\n     10,237,225,244,242,225,231,245,242,237,245,235,232,105,128, 10,\n     66,246,239,247,229,236,243,233,231,110,  3,201,209,201,219,201,\n    226,226,229,238,231,225,236,105,128,  9,194,228,229,246, 97,128,\n      9, 66,231,245,234,225,242,225,244,105,128, 10,194,246,239,247,\n    229,236,243,233,231,110,  3,201,253,202,  7,202, 14,226,229,238,\n    231,225,236,105,128,  9,193,228,229,246, 97,128,  9, 65,231,245,\n    234,225,242,225,244,105,128, 10,193,118,139,  0,118,202, 51,202,\n    199,202,208,202,219,203,148,203,155,203,253,204,  9,204,109,204,\n    117,204,138, 97,  4,202, 61,202, 68,202, 93,202,104,228,229,246,\n     97,128,  9, 53,231,117,  2,202, 75,202, 84,234,225,242,225,244,\n    105,128, 10,181,242,237,245,235,232,105,128, 10, 53,235,225,244,\n    225,235,225,238, 97,128, 48,247,118,132,  5,213,202,116,202,143,\n    202,175,202,187,228,225,231,229,243,104,130,251, 53,202,129,202,\n    134,182, 53,128,251, 53,232,229,226,242,229,119,128,251, 53,104,\n      2,202,149,202,157,229,226,242,229,119,128,  5,213,239,236,225,\n    109,129,251, 75,202,166,232,229,226,242,229,119,128,251, 75,246,\n    225,246,232,229,226,242,229,119,128,  5,240,249,239,228,232,229,\n    226,242,229,119,128,  5,241,227,233,242,227,236,101,128, 36,229,\n    228,239,244,226,229,236,239,119,128, 30,127,101,  6,202,233,202,\n    244,203, 52,203, 63,203, 69,203,136,227,249,242,233,236,236,233,\n     99,128,  4, 50,104,  4,202,254,203,  7,203, 21,203, 37,225,242,\n    225,226,233, 99,128,  6,164,230,233,238,225,236,225,242,225,226,\n    233, 99,128,251,107,233,238,233,244,233,225,236,225,242,225,226,\n    233, 99,128,251,108,237,229,228,233,225,236,225,242,225,226,233,\n     99,128,251,109,235,225,244,225,235,225,238, 97,128, 48,249,238,\n    245,115,128, 38, 64,242,244,233,227,225,108,  2,203, 80,203, 86,\n    226,225,114,128,  0,124,236,233,238,101,  4,203, 99,203,110,203,\n    121,203,130,225,226,239,246,229,227,237, 98,128,  3, 13,226,229,\n    236,239,247,227,237, 98,128,  3, 41,236,239,247,237,239,100,128,\n      2,204,237,239,100,128,  2,200,247,225,242,237,229,238,233,225,\n    110,128,  5,126,232,239,239,107,128,  2,139,105,  3,203,163,203,\n    174,203,213,235,225,244,225,235,225,238, 97,128, 48,248,242,225,\n    237, 97,  3,203,185,203,195,203,202,226,229,238,231,225,236,105,\n    128,  9,205,228,229,246, 97,128,  9, 77,231,245,234,225,242,225,\n    244,105,128, 10,205,243,225,242,231, 97,  3,203,225,203,235,203,\n    242,226,229,238,231,225,236,105,128,  9,131,228,229,246, 97,128,\n      9,  3,231,245,234,225,242,225,244,105,128, 10,131,237,239,238,\n    239,243,240,225,227,101,128,255, 86,111,  3,204, 17,204, 28,204,\n     98,225,242,237,229,238,233,225,110,128,  5,120,233,227,229,100,\n      2,204, 37,204, 73,233,244,229,242,225,244,233,239,110,  2,204,\n     51,204, 62,232,233,242,225,231,225,238, 97,128, 48,158,235,225,\n    244,225,235,225,238, 97,128, 48,254,237,225,242,235,235,225,238,\n     97,129, 48,155,204, 86,232,225,236,230,247,233,228,244,104,128,\n    255,158,235,225,244,225,235,225,238, 97,128, 48,250,240,225,242,\n    229,110,128, 36,177,116,  2,204,123,204,130,233,236,228,101,128,\n     30,125,245,242,238,229,100,128,  2,140,117,  2,204,144,204,155,\n    232,233,242,225,231,225,238, 97,128, 48,148,235,225,244,225,235,\n    225,238, 97,128, 48,244,119,143,  0,119,204,200,205,177,205,187,\n    205,210,205,250,206, 61,206, 69,208, 40,208, 81,208, 93,208,168,\n    208,176,208,183,208,194,208,203, 97,  8,204,218,204,225,204,235,\n    204,246,205, 28,205, 60,205, 72,205,108,227,245,244,101,128, 30,\n    131,229,235,239,242,229,225,110,128, 49, 89,232,233,242,225,231,\n    225,238, 97,128, 48,143,107,  2,204,252,205, 20,225,244,225,235,\n    225,238, 97,129, 48,239,205,  8,232,225,236,230,247,233,228,244,\n    104,128,255,156,239,242,229,225,110,128, 49, 88,243,237,225,236,\n    108,  2,205, 38,205, 49,232,233,242,225,231,225,238, 97,128, 48,\n    142,235,225,244,225,235,225,238, 97,128, 48,238,244,244,239,243,\n    241,245,225,242,101,128, 51, 87,118,  2,205, 78,205, 86,229,228,\n    225,243,104,128, 48, 28,249,245,238,228,229,242,243,227,239,242,\n    229,246,229,242,244,233,227,225,108,128,254, 52,119,  3,205,116,\n    205,125,205,139,225,242,225,226,233, 99,128,  6, 72,230,233,238,\n    225,236,225,242,225,226,233, 99,128,254,238,232,225,237,250,225,\n    225,226,239,246,101,  2,205,154,205,163,225,242,225,226,233, 99,\n    128,  6, 36,230,233,238,225,236,225,242,225,226,233, 99,128,254,\n    134,226,243,241,245,225,242,101,128, 51,221,227,233,242, 99,  2,\n    205,196,205,201,236,101,128, 36,230,245,237,230,236,229,120,128,\n      1,117,100,  2,205,216,205,226,233,229,242,229,243,233,115,128,\n     30,133,239,116,  2,205,233,205,242,225,227,227,229,238,116,128,\n     30,135,226,229,236,239,119,128, 30,137,101,  4,206,  4,206, 15,\n    206, 27,206, 51,232,233,242,225,231,225,238, 97,128, 48,145,233,\n    229,242,243,244,242,225,243,115,128, 33, 24,107,  2,206, 33,206,\n     43,225,244,225,235,225,238, 97,128, 48,241,239,242,229,225,110,\n    128, 49, 94,239,235,239,242,229,225,110,128, 49, 93,231,242,225,\n    246,101,128, 30,129,232,233,244,101,  8,206, 90,206, 99,206,183,\n    207, 17,207,101,207,146,207,198,207,254,226,245,236,236,229,116,\n    128, 37,230, 99,  2,206,105,206,125,233,242,227,236,101,129, 37,\n    203,206,115,233,238,246,229,242,243,101,128, 37,217,239,242,238,\n    229,242,226,242,225,227,235,229,116,  2,206,142,206,162,236,229,\n    230,116,129, 48, 14,206,151,246,229,242,244,233,227,225,108,128,\n    254, 67,242,233,231,232,116,129, 48, 15,206,172,246,229,242,244,\n    233,227,225,108,128,254, 68,100,  2,206,189,206,230,233,225,237,\n    239,238,100,129, 37,199,206,200,227,239,238,244,225,233,238,233,\n    238,231,226,236,225,227,235,243,237,225,236,236,228,233,225,237,\n    239,238,100,128, 37,200,239,247,238,240,239,233,238,244,233,238,\n    103,  2,206,246,207,  6,243,237,225,236,236,244,242,233,225,238,\n    231,236,101,128, 37,191,244,242,233,225,238,231,236,101,128, 37,\n    189,236,101,  2,207, 24,207, 66,230,244,240,239,233,238,244,233,\n    238,103,  2,207, 39,207, 55,243,237,225,236,236,244,242,233,225,\n    238,231,236,101,128, 37,195,244,242,233,225,238,231,236,101,128,\n     37,193,238,244,233,227,245,236,225,242,226,242,225,227,235,229,\n    116,  2,207, 86,207, 93,236,229,230,116,128, 48, 22,242,233,231,\n    232,116,128, 48, 23,242,233,231,232,244,240,239,233,238,244,233,\n    238,103,  2,207,119,207,135,243,237,225,236,236,244,242,233,225,\n    238,231,236,101,128, 37,185,244,242,233,225,238,231,236,101,128,\n     37,183,115,  3,207,154,207,184,207,192,109,  2,207,160,207,172,\n    225,236,236,243,241,245,225,242,101,128, 37,171,233,236,233,238,\n    231,230,225,227,101,128, 38, 58,241,245,225,242,101,128, 37,161,\n    244,225,114,128, 38,  6,116,  2,207,204,207,215,229,236,229,240,\n    232,239,238,101,128, 38, 15,239,242,244,239,233,243,229,243,232,\n    229,236,236,226,242,225,227,235,229,116,  2,207,239,207,246,236,\n    229,230,116,128, 48, 24,242,233,231,232,116,128, 48, 25,245,240,\n    240,239,233,238,244,233,238,103,  2,208, 13,208, 29,243,237,225,\n    236,236,244,242,233,225,238,231,236,101,128, 37,181,244,242,233,\n    225,238,231,236,101,128, 37,179,105,  2,208, 46,208, 57,232,233,\n    242,225,231,225,238, 97,128, 48,144,107,  2,208, 63,208, 73,225,\n    244,225,235,225,238, 97,128, 48,240,239,242,229,225,110,128, 49,\n     95,237,239,238,239,243,240,225,227,101,128,255, 87,111,  4,208,\n    103,208,114,208,139,208,157,232,233,242,225,231,225,238, 97,128,\n     48,146,235,225,244,225,235,225,238, 97,129, 48,242,208,127,232,\n    225,236,230,247,233,228,244,104,128,255,102,110,129, 32,169,208,\n    145,237,239,238,239,243,240,225,227,101,128,255,230,247,225,229,\n    238,244,232,225,105,128, 14, 39,240,225,242,229,110,128, 36,178,\n    242,233,238,103,128, 30,152,243,245,240,229,242,233,239,114,128,\n      2,183,244,245,242,238,229,100,128,  2,141,249,238,110,128,  1,\n    191,120,137,  0,120,208,231,208,242,208,253,209,  6,209, 33,209,\n     46,209, 50,209, 62,209, 70,225,226,239,246,229,227,237, 98,128,\n      3, 61,226,239,240,239,237,239,230,111,128, 49, 18,227,233,242,\n    227,236,101,128, 36,231,100,  2,209, 12,209, 22,233,229,242,229,\n    243,233,115,128, 30,141,239,244,225,227,227,229,238,116,128, 30,\n    139,229,232,225,242,237,229,238,233,225,110,128,  5,109,105,128,\n      3,190,237,239,238,239,243,240,225,227,101,128,255, 88,240,225,\n    242,229,110,128, 36,179,243,245,240,229,242,233,239,114,128,  2,\n    227,121,143,  0,121,209,115,210, 74,210, 97,210,137,212,103,212,\n    111,212,128,212,192,212,204,213,201,213,241,213,253,214,  8,214,\n     29,215,  2, 97, 11,209,139,209,151,209,161,209,168,209,175,209,\n    185,209,210,209,221,210,  3,210, 16,210, 62,225,228,239,243,241,\n    245,225,242,101,128, 51, 78,226,229,238,231,225,236,105,128,  9,\n    175,227,245,244,101,128,  0,253,228,229,246, 97,128,  9, 47,229,\n    235,239,242,229,225,110,128, 49, 82,231,117,  2,209,192,209,201,\n    234,225,242,225,244,105,128, 10,175,242,237,245,235,232,105,128,\n     10, 47,232,233,242,225,231,225,238, 97,128, 48,132,107,  2,209,\n    227,209,251,225,244,225,235,225,238, 97,129, 48,228,209,239,232,\n    225,236,230,247,233,228,244,104,128,255,148,239,242,229,225,110,\n    128, 49, 81,237,225,235,235,225,238,244,232,225,105,128, 14, 78,\n    243,237,225,236,108,  2,210, 26,210, 37,232,233,242,225,231,225,\n    238, 97,128, 48,131,235,225,244,225,235,225,238, 97,129, 48,227,\n    210, 50,232,225,236,230,247,233,228,244,104,128,255,108,244,227,\n    249,242,233,236,236,233, 99,128,  4, 99,227,233,242, 99,  2,210,\n     83,210, 88,236,101,128, 36,232,245,237,230,236,229,120,128,  1,\n    119,100,  2,210,103,210,113,233,229,242,229,243,233,115,128,  0,\n    255,239,116,  2,210,120,210,129,225,227,227,229,238,116,128, 30,\n    143,226,229,236,239,119,128, 30,245,101,  7,210,153,211,161,211,\n    170,211,188,211,220,212, 40,212, 91,104,  8,210,171,210,180,210,\n    214,210,228,211, 45,211, 61,211,120,211,138,225,242,225,226,233,\n     99,128,  6, 74,226,225,242,242,229,101,  2,210,191,210,200,225,\n    242,225,226,233, 99,128,  6,210,230,233,238,225,236,225,242,225,\n    226,233, 99,128,251,175,230,233,238,225,236,225,242,225,226,233,\n     99,128,254,242,232,225,237,250,225,225,226,239,246,101,  4,210,\n    247,211,  0,211, 14,211, 30,225,242,225,226,233, 99,128,  6, 38,\n    230,233,238,225,236,225,242,225,226,233, 99,128,254,138,233,238,\n    233,244,233,225,236,225,242,225,226,233, 99,128,254,139,237,229,\n    228,233,225,236,225,242,225,226,233, 99,128,254,140,233,238,233,\n    244,233,225,236,225,242,225,226,233, 99,128,254,243,237,101,  2,\n    211, 68,211, 81,228,233,225,236,225,242,225,226,233, 99,128,254,\n    244,229,237,105,  2,211, 89,211,104,238,233,244,233,225,236,225,\n    242,225,226,233, 99,128,252,221,243,239,236,225,244,229,228,225,\n    242,225,226,233, 99,128,252, 88,238,239,239,238,230,233,238,225,\n    236,225,242,225,226,233, 99,128,252,148,244,232,242,229,229,228,\n    239,244,243,226,229,236,239,247,225,242,225,226,233, 99,128,  6,\n    209,235,239,242,229,225,110,128, 49, 86,110,129,  0,165,211,176,\n    237,239,238,239,243,240,225,227,101,128,255,229,111,  2,211,194,\n    211,203,235,239,242,229,225,110,128, 49, 85,242,233,238,232,233,\n    229,245,232,235,239,242,229,225,110,128, 49,134,114,  3,211,228,\n    212,  8,212, 20,225,232,226,229,238,249,239,237,111,  2,211,242,\n    211,251,232,229,226,242,229,119,128,  5,170,236,229,230,244,232,\n    229,226,242,229,119,128,  5,170,233,227,249,242,233,236,236,233,\n     99,128,  4, 75,245,228,233,229,242,229,243,233,243,227,249,242,\n    233,236,236,233, 99,128,  4,249,243,233,229,245,238,103,  3,212,\n     53,212, 62,212, 78,235,239,242,229,225,110,128, 49,129,240,225,\n    238,243,233,239,243,235,239,242,229,225,110,128, 49,131,243,233,\n    239,243,235,239,242,229,225,110,128, 49,130,244,233,246,232,229,\n    226,242,229,119,128,  5,154,231,242,225,246,101,128, 30,243,232,\n    239,239,107,129,  1,180,212,120,225,226,239,246,101,128, 30,247,\n    105,  5,212,140,212,151,212,162,212,171,212,179,225,242,237,229,\n    238,233,225,110,128,  5,117,227,249,242,233,236,236,233, 99,128,\n      4, 87,235,239,242,229,225,110,128, 49, 98,238,249,225,238,103,\n    128, 38, 47,247,238,225,242,237,229,238,233,225,110,128,  5,130,\n    237,239,238,239,243,240,225,227,101,128,255, 89,111,  7,212,220,\n    213, 34,213, 45,213, 55,213, 93,213,139,213,148,100,131,  5,217,\n    212,230,212,250,213,  3,228,225,231,229,243,104,129,251, 57,212,\n    241,232,229,226,242,229,119,128,251, 57,232,229,226,242,229,119,\n    128,  5,217,249,239,100,  2,213, 11,213, 20,232,229,226,242,229,\n    119,128,  5,242,240,225,244,225,232,232,229,226,242,229,119,128,\n    251, 31,232,233,242,225,231,225,238, 97,128, 48,136,233,235,239,\n    242,229,225,110,128, 49,137,107,  2,213, 61,213, 85,225,244,225,\n    235,225,238, 97,129, 48,232,213, 73,232,225,236,230,247,233,228,\n    244,104,128,255,150,239,242,229,225,110,128, 49, 91,243,237,225,\n    236,108,  2,213,103,213,114,232,233,242,225,231,225,238, 97,128,\n     48,135,235,225,244,225,235,225,238, 97,129, 48,231,213,127,232,\n    225,236,230,247,233,228,244,104,128,255,110,244,231,242,229,229,\n    107,128,  3,243,121,  2,213,154,213,191, 97,  2,213,160,213,170,\n    229,235,239,242,229,225,110,128, 49,136,107,  2,213,176,213,184,\n    239,242,229,225,110,128, 49,135,244,232,225,105,128, 14, 34,233,\n    238,231,244,232,225,105,128, 14, 13,112,  2,213,207,213,214,225,\n    242,229,110,128, 36,180,239,231,229,231,242,225,237,237,229,238,\n    105,129,  3,122,213,230,231,242,229,229,235,227,237, 98,128,  3,\n     69,114,129,  1,166,213,247,233,238,103,128, 30,153,243,245,240,\n    229,242,233,239,114,128,  2,184,116,  2,214, 14,214, 21,233,236,\n    228,101,128, 30,249,245,242,238,229,100,128,  2,142,117,  5,214,\n     41,214, 52,214, 62,214,100,214,232,232,233,242,225,231,225,238,\n     97,128, 48,134,233,235,239,242,229,225,110,128, 49,140,107,  2,\n    214, 68,214, 92,225,244,225,235,225,238, 97,129, 48,230,214, 80,\n    232,225,236,230,247,233,228,244,104,128,255,149,239,242,229,225,\n    110,128, 49, 96,115,  3,214,108,214,146,214,187,226,233,103,  2,\n    214,116,214,127,227,249,242,233,236,236,233, 99,128,  4,107,233,\n    239,244,233,230,233,229,228,227,249,242,233,236,236,233, 99,128,\n      4,109,236,233,244,244,236,101,  2,214,157,214,168,227,249,242,\n    233,236,236,233, 99,128,  4,103,233,239,244,233,230,233,229,228,\n    227,249,242,233,236,236,233, 99,128,  4,105,237,225,236,108,  2,\n    214,196,214,207,232,233,242,225,231,225,238, 97,128, 48,133,235,\n    225,244,225,235,225,238, 97,129, 48,229,214,220,232,225,236,230,\n    247,233,228,244,104,128,255,109,249,101,  2,214,239,214,248,235,\n    239,242,229,225,110,128, 49,139,239,235,239,242,229,225,110,128,\n     49,138,249, 97,  2,215,  9,215, 19,226,229,238,231,225,236,105,\n    128,  9,223,228,229,246, 97,128,  9, 95,122,142,  0,122,215, 58,\n    216, 66,216, 77,216,120,216,147,217,182,218, 34,218, 76,218, 88,\n    218,100,218,128,218,136,218,152,218,161, 97, 10,215, 80,215, 91,\n    215, 98,215,105,215,116,215,194,215,224,215,235,216, 15,216, 27,\n    225,242,237,229,238,233,225,110,128,  5,102,227,245,244,101,128,\n      1,122,228,229,246, 97,128,  9, 91,231,245,242,237,245,235,232,\n    105,128, 10, 91,104,  4,215,126,215,135,215,149,215,179,225,242,\n    225,226,233, 99,128,  6, 56,230,233,238,225,236,225,242,225,226,\n    233, 99,128,254,198,105,  2,215,155,215,170,238,233,244,233,225,\n    236,225,242,225,226,233, 99,128,254,199,242,225,231,225,238, 97,\n    128, 48, 86,237,229,228,233,225,236,225,242,225,226,233, 99,128,\n    254,200,233,110,  2,215,201,215,210,225,242,225,226,233, 99,128,\n      6, 50,230,233,238,225,236,225,242,225,226,233, 99,128,254,176,\n    235,225,244,225,235,225,238, 97,128, 48,182,241,229,102,  2,215,\n    243,216,  1,231,225,228,239,236,232,229,226,242,229,119,128,  5,\n    149,241,225,244,225,238,232,229,226,242,229,119,128,  5,148,242,\n    241,225,232,229,226,242,229,119,128,  5,152,249,233,110,130,  5,\n    214,216, 37,216, 57,228,225,231,229,243,104,129,251, 54,216, 48,\n    232,229,226,242,229,119,128,251, 54,232,229,226,242,229,119,128,\n      5,214,226,239,240,239,237,239,230,111,128, 49, 23, 99,  3,216,\n     85,216, 92,216,114,225,242,239,110,128,  1,126,233,242, 99,  2,\n    216,100,216,105,236,101,128, 36,233,245,237,230,236,229,120,128,\n     30,145,245,242,108,128,  2,145,228,239,116,130,  1,124,216,130,\n    216,139,225,227,227,229,238,116,128,  1,124,226,229,236,239,119,\n    128, 30,147,101,  6,216,161,216,172,216,215,216,226,216,237,217,\n    177,227,249,242,233,236,236,233, 99,128,  4, 55,100,  2,216,178,\n    216,197,229,243,227,229,238,228,229,242,227,249,242,233,236,236,\n    233, 99,128,  4,153,233,229,242,229,243,233,243,227,249,242,233,\n    236,236,233, 99,128,  4,223,232,233,242,225,231,225,238, 97,128,\n     48, 92,235,225,244,225,235,225,238, 97,128, 48,188,242,111,140,\n      0, 48,217, 10,217, 19,217, 29,217, 36,217, 61,217, 74,217, 85,\n    217, 97,217,108,217,118,217,129,217,136,225,242,225,226,233, 99,\n    128,  6, 96,226,229,238,231,225,236,105,128,  9,230,228,229,246,\n     97,128,  9,102,231,117,  2,217, 43,217, 52,234,225,242,225,244,\n    105,128, 10,230,242,237,245,235,232,105,128, 10,102,232,225,227,\n    235,225,242,225,226,233, 99,128,  6, 96,233,238,230,229,242,233,\n    239,114,128, 32,128,237,239,238,239,243,240,225,227,101,128,255,\n     16,239,236,228,243,244,249,236,101,128,247, 48,240,229,242,243,\n    233,225,110,128,  6,240,243,245,240,229,242,233,239,114,128, 32,\n    112,244,232,225,105,128, 14, 80,247,233,228,244,104,  3,217,148,\n    217,157,217,169,234,239,233,238,229,114,128,254,255,238,239,238,\n    234,239,233,238,229,114,128, 32, 12,243,240,225,227,101,128, 32,\n     11,244, 97,128,  3,182,104,  2,217,188,217,199,226,239,240,239,\n    237,239,230,111,128, 49, 19,101,  4,217,209,217,220,217,236,217,\n    247,225,242,237,229,238,233,225,110,128,  5,106,226,242,229,246,\n    229,227,249,242,233,236,236,233, 99,128,  4,194,227,249,242,233,\n    236,236,233, 99,128,  4, 54,100,  2,217,253,218, 16,229,243,227,\n    229,238,228,229,242,227,249,242,233,236,236,233, 99,128,  4,151,\n    233,229,242,229,243,233,243,227,249,242,233,236,236,233, 99,128,\n      4,221,105,  3,218, 42,218, 53,218, 64,232,233,242,225,231,225,\n    238, 97,128, 48, 88,235,225,244,225,235,225,238, 97,128, 48,184,\n    238,239,242,232,229,226,242,229,119,128,  5,174,236,233,238,229,\n    226,229,236,239,119,128, 30,149,237,239,238,239,243,240,225,227,\n    101,128,255, 90,111,  2,218,106,218,117,232,233,242,225,231,225,\n    238, 97,128, 48, 94,235,225,244,225,235,225,238, 97,128, 48,190,\n    240,225,242,229,110,128, 36,181,242,229,244,242,239,230,236,229,\n    248,232,239,239,107,128,  2,144,243,244,242,239,235,101,128,  1,\n    182,117,  2,218,167,218,178,232,233,242,225,231,225,238, 97,128,\n     48, 90,235,225,244,225,235,225,238, 97,128, 48,186\n  };\n\n\n  /*\n   *  This function searches the compressed table efficiently.\n   */\n  static unsigned long\n  ft_get_adobe_glyph_index( const char*  name,\n                            const char*  limit )\n  {\n    int                   c = 0;\n    int                   count, min, max;\n    const unsigned char*  p = ft_adobe_glyph_list;\n\n\n    if ( name == 0 || name >= limit )\n      goto NotFound;\n\n    c     = *name++;\n    count = p[1];\n    p    += 2;\n\n    min = 0;\n    max = count;\n\n    while ( min < max )\n    {\n      int                   mid = ( min + max ) >> 1;\n      const unsigned char*  q   = p + mid * 2;\n      int                   c2;\n\n\n      q = ft_adobe_glyph_list + ( ( (int)q[0] << 8 ) | q[1] );\n\n      c2 = q[0] & 127;\n      if ( c2 == c )\n      {\n        p = q;\n        goto Found;\n      }\n      if ( c2 < c )\n        min = mid + 1;\n      else\n        max = mid;\n    }\n    goto NotFound;\n\n  Found:\n    for (;;)\n    {\n      /* assert (*p & 127) == c */\n\n      if ( name >= limit )\n      {\n        if ( (p[0] & 128) == 0 &&\n             (p[1] & 128) != 0 )\n          return (unsigned long)( ( (int)p[2] << 8 ) | p[3] );\n\n        goto NotFound;\n      }\n      c = *name++;\n      if ( p[0] & 128 )\n      {\n        p++;\n        if ( c != (p[0] & 127) )\n          goto NotFound;\n\n        continue;\n      }\n\n      p++;\n      count = p[0] & 127;\n      if ( p[0] & 128 )\n        p += 2;\n\n      p++;\n\n      for ( ; count > 0; count--, p += 2 )\n      {\n        int                   offset = ( (int)p[0] << 8 ) | p[1];\n        const unsigned char*  q      = ft_adobe_glyph_list + offset;\n\n        if ( c == ( q[0] & 127 ) )\n        {\n          p = q;\n          goto NextIter;\n        }\n      }\n      goto NotFound;\n\n    NextIter:\n      ;\n    }\n\n  NotFound:\n    return 0;\n  }\n\n#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/psnames/rules.mk",
    "content": "#\n# FreeType 2 PSNames driver configuration rules\n#\n\n\n# Copyright 1996-2001, 2003, 2011, 2013 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\n# PSNames driver directory\n#\nPSNAMES_DIR := $(SRC_DIR)/psnames\n\n\n# compilation flags for the driver\n#\nPSNAMES_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PSNAMES_DIR))\n\n\n# PSNames driver sources (i.e., C files)\n#\nPSNAMES_DRV_SRC := $(PSNAMES_DIR)/psmodule.c \\\n                   $(PSNAMES_DIR)/pspic.c\n\n\n# PSNames driver headers\n#\nPSNAMES_DRV_H := $(PSNAMES_DRV_SRC:%.c=%.h) \\\n                 $(PSNAMES_DIR)/psnamerr.h  \\\n                 $(PSNAMES_DIR)/pstables.h\n\n\n# PSNames driver object(s)\n#\n#   PSNAMES_DRV_OBJ_M is used during `multi' builds\n#   PSNAMES_DRV_OBJ_S is used during `single' builds\n#\nPSNAMES_DRV_OBJ_M := $(PSNAMES_DRV_SRC:$(PSNAMES_DIR)/%.c=$(OBJ_DIR)/%.$O)\nPSNAMES_DRV_OBJ_S := $(OBJ_DIR)/psnames.$O\n\n# PSNames driver source file for single build\n#\nPSNAMES_DRV_SRC_S := $(PSNAMES_DIR)/psnames.c\n\n\n# PSNames driver - single object\n#\n$(PSNAMES_DRV_OBJ_S): $(PSNAMES_DRV_SRC_S) $(PSNAMES_DRV_SRC) \\\n                      $(FREETYPE_H) $(PSNAMES_DRV_H)\n\t$(PSNAMES_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PSNAMES_DRV_SRC_S))\n\n\n# PSNames driver - multiple objects\n#\n$(OBJ_DIR)/%.$O: $(PSNAMES_DIR)/%.c $(FREETYPE_H) $(PSNAMES_DRV_H)\n\t$(PSNAMES_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\n\n\n# update main driver object lists\n#\nDRV_OBJS_S += $(PSNAMES_DRV_OBJ_S)\nDRV_OBJS_M += $(PSNAMES_DRV_OBJ_M)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/raster/Jamfile",
    "content": "# FreeType 2 src/raster Jamfile\n#\n# Copyright 2001 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) raster ;\n\n{\n  local  _sources ;\n\n  if $(FT2_MULTI)\n  {\n    _sources = ftraster ftrend1 rastpic ;\n  }\n  else\n  {\n    _sources = raster ;\n  }\n\n  Library  $(FT2_LIB) : $(_sources).c ;\n}\n\n# end of src/raster Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/raster/ftmisc.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmisc.h                                                               */\n/*                                                                         */\n/*    Miscellaneous macros for stand-alone rasterizer (specification       */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 2005, 2009, 2010 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used        */\n/*  modified and distributed under the terms of the FreeType project       */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /***************************************************/\n  /*                                                 */\n  /* This file is *not* portable!  You have to adapt */\n  /* its definitions to your platform.               */\n  /*                                                 */\n  /***************************************************/\n\n#ifndef __FTMISC_H__\n#define __FTMISC_H__\n\n\n  /* memset */\n#include FT_CONFIG_STANDARD_LIBRARY_H\n\n#define FT_BEGIN_HEADER\n#define FT_END_HEADER\n\n#define FT_LOCAL_DEF( x )   static x\n\n\n  /* from include/freetype2/fttypes.h */\n\n  typedef unsigned char  FT_Byte;\n  typedef signed int     FT_Int;\n  typedef unsigned int   FT_UInt;\n  typedef signed long    FT_Long;\n  typedef unsigned long  FT_ULong;\n  typedef signed long    FT_F26Dot6;\n  typedef int            FT_Error;\n\n#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \\\n          ( ( (FT_ULong)_x1 << 24 ) |     \\\n            ( (FT_ULong)_x2 << 16 ) |     \\\n            ( (FT_ULong)_x3 <<  8 ) |     \\\n              (FT_ULong)_x4         )\n\n\n  /* from include/freetype2/ftsystem.h */\n\n  typedef struct FT_MemoryRec_*  FT_Memory;\n\n  typedef void* (*FT_Alloc_Func)( FT_Memory  memory,\n                                  long       size );\n\n  typedef void (*FT_Free_Func)( FT_Memory  memory,\n                                void*      block );\n\n  typedef void* (*FT_Realloc_Func)( FT_Memory  memory,\n                                    long       cur_size,\n                                    long       new_size,\n                                    void*      block );\n\n  typedef struct FT_MemoryRec_\n  {\n    void*            user;\n\n    FT_Alloc_Func    alloc;\n    FT_Free_Func     free;\n    FT_Realloc_Func  realloc;\n\n  } FT_MemoryRec;\n\n\n  /* from src/ftcalc.c */\n\n#if ( defined _WIN32 || defined _WIN64 )\n\n  typedef __int64  FT_Int64;\n\n#else\n\n#include \"inttypes.h\"\n\n  typedef int64_t  FT_Int64;\n\n#endif\n\n\n  static FT_Long\n  FT_MulDiv( FT_Long  a,\n             FT_Long  b,\n             FT_Long  c )\n  {\n    FT_Int   s;\n    FT_Long  d;\n\n\n    s = 1;\n    if ( a < 0 ) { a = -a; s = -1; }\n    if ( b < 0 ) { b = -b; s = -s; }\n    if ( c < 0 ) { c = -c; s = -s; }\n\n    d = (FT_Long)( c > 0 ? ( (FT_Int64)a * b + ( c >> 1 ) ) / c\n                         : 0x7FFFFFFFL );\n\n    return ( s > 0 ) ? d : -d;\n  }\n\n\n  static FT_Long\n  FT_MulDiv_No_Round( FT_Long  a,\n                      FT_Long  b,\n                      FT_Long  c )\n  {\n    FT_Int   s;\n    FT_Long  d;\n\n\n    s = 1;\n    if ( a < 0 ) { a = -a; s = -1; }\n    if ( b < 0 ) { b = -b; s = -s; }\n    if ( c < 0 ) { c = -c; s = -s; }\n\n    d = (FT_Long)( c > 0 ? (FT_Int64)a * b / c\n                         : 0x7FFFFFFFL );\n\n    return ( s > 0 ) ? d : -d;\n  }\n\n#endif /* __FTMISC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/raster/ftraster.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftraster.c                                                             */\n/*                                                                         */\n/*    The FreeType glyph rasterizer (body).                                */\n/*                                                                         */\n/*  Copyright 1996-2003, 2005, 2007-2014 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file can be compiled without the rest of the FreeType engine, by */\n  /* defining the _STANDALONE_ macro when compiling it.  You also need to  */\n  /* put the files `ftimage.h' and `ftmisc.h' into the $(incdir)           */\n  /* directory.  Typically, you should do something like                   */\n  /*                                                                       */\n  /* - copy `src/raster/ftraster.c' (this file) to your current directory  */\n  /*                                                                       */\n  /* - copy `include/ftimage.h' and `src/raster/ftmisc.h' to your current  */\n  /*   directory                                                           */\n  /*                                                                       */\n  /* - compile `ftraster' with the _STANDALONE_ macro defined, as in       */\n  /*                                                                       */\n  /*     cc -c -D_STANDALONE_ ftraster.c                                   */\n  /*                                                                       */\n  /* The renderer can be initialized with a call to                        */\n  /* `ft_standard_raster.raster_new'; a bitmap can be generated            */\n  /* with a call to `ft_standard_raster.raster_render'.                    */\n  /*                                                                       */\n  /* See the comments and documentation in the file `ftimage.h' for more   */\n  /* details on how the raster works.                                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This is a rewrite of the FreeType 1.x scan-line converter             */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef _STANDALONE_\n\n#define FT_CONFIG_STANDARD_LIBRARY_H  <stdlib.h>\n\n#include <string.h>           /* for memset */\n\n#include \"ftmisc.h\"\n#include \"ftimage.h\"\n\n#else /* !_STANDALONE_ */\n\n#include <ft2build.h>\n#include \"ftraster.h\"\n#include FT_INTERNAL_CALC_H   /* for FT_MulDiv and FT_MulDiv_No_Round */\n\n#include \"rastpic.h\"\n\n#endif /* !_STANDALONE_ */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* A simple technical note on how the raster works                       */\n  /* -----------------------------------------------                       */\n  /*                                                                       */\n  /*   Converting an outline into a bitmap is achieved in several steps:   */\n  /*                                                                       */\n  /*   1 - Decomposing the outline into successive `profiles'.  Each       */\n  /*       profile is simply an array of scanline intersections on a given */\n  /*       dimension.  A profile's main attributes are                     */\n  /*                                                                       */\n  /*       o its scanline position boundaries, i.e. `Ymin' and `Ymax'      */\n  /*                                                                       */\n  /*       o an array of intersection coordinates for each scanline        */\n  /*         between `Ymin' and `Ymax'                                     */\n  /*                                                                       */\n  /*       o a direction, indicating whether it was built going `up' or    */\n  /*         `down', as this is very important for filling rules           */\n  /*                                                                       */\n  /*       o its drop-out mode                                             */\n  /*                                                                       */\n  /*   2 - Sweeping the target map's scanlines in order to compute segment */\n  /*       `spans' which are then filled.  Additionally, this pass         */\n  /*       performs drop-out control.                                      */\n  /*                                                                       */\n  /*   The outline data is parsed during step 1 only.  The profiles are    */\n  /*   built from the bottom of the render pool, used as a stack.  The     */\n  /*   following graphics shows the profile list under construction:       */\n  /*                                                                       */\n  /*     __________________________________________________________ _ _    */\n  /*    |         |                 |         |                 |          */\n  /*    | profile | coordinates for | profile | coordinates for |-->       */\n  /*    |    1    |  profile 1      |    2    |  profile 2      |-->       */\n  /*    |_________|_________________|_________|_________________|__ _ _    */\n  /*                                                                       */\n  /*    ^                                                       ^          */\n  /*    |                                                       |          */\n  /* start of render pool                                      top         */\n  /*                                                                       */\n  /*   The top of the profile stack is kept in the `top' variable.         */\n  /*                                                                       */\n  /*   As you can see, a profile record is pushed on top of the render     */\n  /*   pool, which is then followed by its coordinates/intersections.  If  */\n  /*   a change of direction is detected in the outline, a new profile is  */\n  /*   generated until the end of the outline.                             */\n  /*                                                                       */\n  /*   Note that when all profiles have been generated, the function       */\n  /*   Finalize_Profile_Table() is used to record, for each profile, its   */\n  /*   bottom-most scanline as well as the scanline above its upmost       */\n  /*   boundary.  These positions are called `y-turns' because they (sort  */\n  /*   of) correspond to local extrema.  They are stored in a sorted list  */\n  /*   built from the top of the render pool as a downwards stack:         */\n  /*                                                                       */\n  /*      _ _ _______________________________________                      */\n  /*                            |                    |                     */\n  /*                         <--| sorted list of     |                     */\n  /*                         <--|  extrema scanlines |                     */\n  /*      _ _ __________________|____________________|                     */\n  /*                                                                       */\n  /*                            ^                    ^                     */\n  /*                            |                    |                     */\n  /*                         maxBuff           sizeBuff = end of pool      */\n  /*                                                                       */\n  /*   This list is later used during the sweep phase in order to          */\n  /*   optimize performance (see technical note on the sweep below).       */\n  /*                                                                       */\n  /*   Of course, the raster detects whether the two stacks collide and    */\n  /*   handles the situation properly.                                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /**                                                                     **/\n  /**  CONFIGURATION MACROS                                               **/\n  /**                                                                     **/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /* define DEBUG_RASTER if you want to compile a debugging version */\n/* #define DEBUG_RASTER */\n\n  /* define FT_RASTER_OPTION_ANTI_ALIASING if you want to support */\n  /* 5-levels anti-aliasing                                       */\n/* #define FT_RASTER_OPTION_ANTI_ALIASING */\n\n  /* The size of the two-lines intermediate bitmap used */\n  /* for anti-aliasing, in bytes.                       */\n#define RASTER_GRAY_LINES  2048\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /**                                                                     **/\n  /**  OTHER MACROS (do not change)                                       **/\n  /**                                                                     **/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_raster\n\n\n#ifdef _STANDALONE_\n\n  /* Auxiliary macros for token concatenation. */\n#define FT_ERR_XCAT( x, y )  x ## y\n#define FT_ERR_CAT( x, y )   FT_ERR_XCAT( x, y )\n\n  /* This macro is used to indicate that a function parameter is unused. */\n  /* Its purpose is simply to reduce compiler warnings.  Note also that  */\n  /* simply defining it as `(void)x' doesn't avoid warnings with certain */\n  /* ANSI compilers (e.g. LCC).                                          */\n#define FT_UNUSED( x )  (x) = (x)\n\n  /* Disable the tracing mechanism for simplicity -- developers can      */\n  /* activate it easily by redefining these macros.                      */\n#ifndef FT_ERROR\n#define FT_ERROR( x )  do { } while ( 0 )     /* nothing */\n#endif\n\n#ifndef FT_TRACE\n#define FT_TRACE( x )   do { } while ( 0 )    /* nothing */\n#define FT_TRACE1( x )  do { } while ( 0 )    /* nothing */\n#define FT_TRACE6( x )  do { } while ( 0 )    /* nothing */\n#endif\n\n#ifndef FT_THROW\n#define FT_THROW( e )  FT_ERR_CAT( Raster_Err_, e )\n#endif\n\n#define Raster_Err_None          0\n#define Raster_Err_Not_Ini      -1\n#define Raster_Err_Overflow     -2\n#define Raster_Err_Neg_Height   -3\n#define Raster_Err_Invalid      -4\n#define Raster_Err_Unsupported  -5\n\n#define ft_memset  memset\n\n#define FT_DEFINE_RASTER_FUNCS( class_, glyph_format_, raster_new_, \\\n                                raster_reset_, raster_set_mode_,    \\\n                                raster_render_, raster_done_ )      \\\n          const FT_Raster_Funcs class_ =                            \\\n          {                                                         \\\n            glyph_format_,                                          \\\n            raster_new_,                                            \\\n            raster_reset_,                                          \\\n            raster_set_mode_,                                       \\\n            raster_render_,                                         \\\n            raster_done_                                            \\\n         };\n\n#else /* !_STANDALONE_ */\n\n\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_DEBUG_H       /* for FT_TRACE, FT_ERROR, and FT_THROW */\n\n#include \"rasterrs.h\"\n\n#define Raster_Err_None         FT_Err_Ok\n#define Raster_Err_Not_Ini      Raster_Err_Raster_Uninitialized\n#define Raster_Err_Overflow     Raster_Err_Raster_Overflow\n#define Raster_Err_Neg_Height   Raster_Err_Raster_Negative_Height\n#define Raster_Err_Invalid      Raster_Err_Invalid_Outline\n#define Raster_Err_Unsupported  Raster_Err_Cannot_Render_Glyph\n\n\n#endif /* !_STANDALONE_ */\n\n\n#ifndef FT_MEM_SET\n#define FT_MEM_SET( d, s, c )  ft_memset( d, s, c )\n#endif\n\n#ifndef FT_MEM_ZERO\n#define FT_MEM_ZERO( dest, count )  FT_MEM_SET( dest, 0, count )\n#endif\n\n  /* FMulDiv means `Fast MulDiv'; it is used in case where `b' is       */\n  /* typically a small value and the result of a*b is known to fit into */\n  /* 32 bits.                                                           */\n#define FMulDiv( a, b, c )  ( (a) * (b) / (c) )\n\n  /* On the other hand, SMulDiv means `Slow MulDiv', and is used typically */\n  /* for clipping computations.  It simply uses the FT_MulDiv() function   */\n  /* defined in `ftcalc.h'.                                                */\n#define SMulDiv           FT_MulDiv\n#define SMulDiv_No_Round  FT_MulDiv_No_Round\n\n  /* The rasterizer is a very general purpose component; please leave */\n  /* the following redefinitions there (you never know your target    */\n  /* environment).                                                    */\n\n#ifndef TRUE\n#define TRUE   1\n#endif\n\n#ifndef FALSE\n#define FALSE  0\n#endif\n\n#ifndef NULL\n#define NULL  (void*)0\n#endif\n\n#ifndef SUCCESS\n#define SUCCESS  0\n#endif\n\n#ifndef FAILURE\n#define FAILURE  1\n#endif\n\n\n#define MaxBezier  32   /* The maximum number of stacked Bezier curves. */\n                        /* Setting this constant to more than 32 is a   */\n                        /* pure waste of space.                         */\n\n#define Pixel_Bits  6   /* fractional bits of *input* coordinates */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /**                                                                     **/\n  /**  SIMPLE TYPE DECLARATIONS                                           **/\n  /**                                                                     **/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  typedef int             Int;\n  typedef unsigned int    UInt;\n  typedef short           Short;\n  typedef unsigned short  UShort, *PUShort;\n  typedef long            Long, *PLong;\n  typedef unsigned long   ULong;\n\n  typedef unsigned char   Byte, *PByte;\n  typedef char            Bool;\n\n\n  typedef union  Alignment_\n  {\n    long    l;\n    void*   p;\n    void  (*f)(void);\n\n  } Alignment, *PAlignment;\n\n\n  typedef struct  TPoint_\n  {\n    Long  x;\n    Long  y;\n\n  } TPoint;\n\n\n  /* values for the `flags' bit field */\n#define Flow_Up           0x8\n#define Overshoot_Top     0x10\n#define Overshoot_Bottom  0x20\n\n\n  /* States of each line, arc, and profile */\n  typedef enum  TStates_\n  {\n    Unknown_State,\n    Ascending_State,\n    Descending_State,\n    Flat_State\n\n  } TStates;\n\n\n  typedef struct TProfile_  TProfile;\n  typedef TProfile*         PProfile;\n\n  struct  TProfile_\n  {\n    FT_F26Dot6  X;           /* current coordinate during sweep          */\n    PProfile    link;        /* link to next profile (various purposes)  */\n    PLong       offset;      /* start of profile's data in render pool   */\n    unsigned    flags;       /* Bit 0-2: drop-out mode                   */\n                             /* Bit 3: profile orientation (up/down)     */\n                             /* Bit 4: is top profile?                   */\n                             /* Bit 5: is bottom profile?                */\n    long        height;      /* profile's height in scanlines            */\n    long        start;       /* profile's starting scanline              */\n\n    unsigned    countL;      /* number of lines to step before this      */\n                             /* profile becomes drawable                 */\n\n    PProfile    next;        /* next profile in same contour, used       */\n                             /* during drop-out control                  */\n  };\n\n  typedef PProfile   TProfileList;\n  typedef PProfile*  PProfileList;\n\n\n  /* Simple record used to implement a stack of bands, required */\n  /* by the sub-banding mechanism                               */\n  typedef struct  black_TBand_\n  {\n    Short  y_min;   /* band's minimum */\n    Short  y_max;   /* band's maximum */\n\n  } black_TBand;\n\n\n#define AlignProfileSize \\\n  ( ( sizeof ( TProfile ) + sizeof ( Alignment ) - 1 ) / sizeof ( long ) )\n\n\n#undef RAS_ARG\n#undef RAS_ARGS\n#undef RAS_VAR\n#undef RAS_VARS\n\n#ifdef FT_STATIC_RASTER\n\n\n#define RAS_ARGS       /* void */\n#define RAS_ARG        /* void */\n\n#define RAS_VARS       /* void */\n#define RAS_VAR        /* void */\n\n#define FT_UNUSED_RASTER  do { } while ( 0 )\n\n\n#else /* !FT_STATIC_RASTER */\n\n\n#define RAS_ARGS       black_PWorker  worker,\n#define RAS_ARG        black_PWorker  worker\n\n#define RAS_VARS       worker,\n#define RAS_VAR        worker\n\n#define FT_UNUSED_RASTER  FT_UNUSED( worker )\n\n\n#endif /* !FT_STATIC_RASTER */\n\n\n  typedef struct black_TWorker_  black_TWorker, *black_PWorker;\n\n\n  /* prototypes used for sweep function dispatch */\n  typedef void\n  Function_Sweep_Init( RAS_ARGS Short*  min,\n                                Short*  max );\n\n  typedef void\n  Function_Sweep_Span( RAS_ARGS Short       y,\n                                FT_F26Dot6  x1,\n                                FT_F26Dot6  x2,\n                                PProfile    left,\n                                PProfile    right );\n\n  typedef void\n  Function_Sweep_Step( RAS_ARG );\n\n\n  /* NOTE: These operations are only valid on 2's complement processors */\n#undef FLOOR\n#undef CEILING\n#undef TRUNC\n#undef SCALED\n\n#define FLOOR( x )    ( (x) & -ras.precision )\n#define CEILING( x )  ( ( (x) + ras.precision - 1 ) & -ras.precision )\n#define TRUNC( x )    ( (Long)(x) >> ras.precision_bits )\n#define FRAC( x )     ( (x) & ( ras.precision - 1 ) )\n#define SCALED( x )   ( ( (ULong)(x) << ras.scale_shift ) - ras.precision_half )\n\n#define IS_BOTTOM_OVERSHOOT( x ) \\\n          (Bool)( CEILING( x ) - x >= ras.precision_half )\n#define IS_TOP_OVERSHOOT( x )    \\\n          (Bool)( x - FLOOR( x ) >= ras.precision_half )\n\n  /* The most used variables are positioned at the top of the structure. */\n  /* Thus, their offset can be coded with less opcodes, resulting in a   */\n  /* smaller executable.                                                 */\n\n  struct  black_TWorker_\n  {\n    Int         precision_bits;     /* precision related variables         */\n    Int         precision;\n    Int         precision_half;\n    Int         precision_shift;\n    Int         precision_step;\n    Int         precision_jitter;\n\n    Int         scale_shift;        /* == precision_shift   for bitmaps    */\n                                    /* == precision_shift+1 for pixmaps    */\n\n    PLong       buff;               /* The profiles buffer                 */\n    PLong       sizeBuff;           /* Render pool size                    */\n    PLong       maxBuff;            /* Profiles buffer size                */\n    PLong       top;                /* Current cursor in buffer            */\n\n    FT_Error    error;\n\n    Int         numTurns;           /* number of Y-turns in outline        */\n\n    TPoint*     arc;                /* current Bezier arc pointer          */\n\n    UShort      bWidth;             /* target bitmap width                 */\n    PByte       bTarget;            /* target bitmap buffer                */\n    PByte       gTarget;            /* target pixmap buffer                */\n\n    Long        lastX, lastY;\n    Long        minY, maxY;\n\n    UShort      num_Profs;          /* current number of profiles          */\n\n    Bool        fresh;              /* signals a fresh new profile which   */\n                                    /* `start' field must be completed     */\n    Bool        joint;              /* signals that the last arc ended     */\n                                    /* exactly on a scanline.  Allows      */\n                                    /* removal of doublets                 */\n    PProfile    cProfile;           /* current profile                     */\n    PProfile    fProfile;           /* head of linked list of profiles     */\n    PProfile    gProfile;           /* contour's first profile in case     */\n                                    /* of impact                           */\n\n    TStates     state;              /* rendering state                     */\n\n    FT_Bitmap   target;             /* description of target bit/pixmap    */\n    FT_Outline  outline;\n\n    Long        traceOfs;           /* current offset in target bitmap     */\n    Long        traceG;             /* current offset in target pixmap     */\n\n    Short       traceIncr;          /* sweep's increment in target bitmap  */\n\n    Short       gray_min_x;         /* current min x during gray rendering */\n    Short       gray_max_x;         /* current max x during gray rendering */\n\n    /* dispatch variables */\n\n    Function_Sweep_Init*  Proc_Sweep_Init;\n    Function_Sweep_Span*  Proc_Sweep_Span;\n    Function_Sweep_Span*  Proc_Sweep_Drop;\n    Function_Sweep_Step*  Proc_Sweep_Step;\n\n    Byte        dropOutControl;     /* current drop_out control method     */\n\n    Bool        second_pass;        /* indicates whether a horizontal pass */\n                                    /* should be performed to control      */\n                                    /* drop-out accurately when calling    */\n                                    /* Render_Glyph.  Note that there is   */\n                                    /* no horizontal pass during gray      */\n                                    /* rendering.                          */\n\n    TPoint      arcs[3 * MaxBezier + 1]; /* The Bezier stack               */\n\n    black_TBand  band_stack[16];    /* band stack used for sub-banding     */\n    Int          band_top;          /* band stack top                      */\n\n#ifdef FT_RASTER_OPTION_ANTI_ALIASING\n\n    Byte*       grays;\n\n    Byte        gray_lines[RASTER_GRAY_LINES];\n                                /* Intermediate table used to render the   */\n                                /* graylevels pixmaps.                     */\n                                /* gray_lines is a buffer holding two      */\n                                /* monochrome scanlines                    */\n\n    Short       gray_width;     /* width in bytes of one monochrome        */\n                                /* intermediate scanline of gray_lines.    */\n                                /* Each gray pixel takes 2 bits long there */\n\n                       /* The gray_lines must hold 2 lines, thus with size */\n                       /* in bytes of at least `gray_width*2'.             */\n\n#endif /* FT_RASTER_ANTI_ALIASING */\n\n  };\n\n\n  typedef struct  black_TRaster_\n  {\n    char*          buffer;\n    long           buffer_size;\n    void*          memory;\n    black_PWorker  worker;\n    Byte           grays[5];\n    Short          gray_width;\n\n  } black_TRaster, *black_PRaster;\n\n#ifdef FT_STATIC_RASTER\n\n  static black_TWorker  cur_ras;\n#define ras  cur_ras\n\n#else /* !FT_STATIC_RASTER */\n\n#define ras  (*worker)\n\n#endif /* !FT_STATIC_RASTER */\n\n\n#ifdef FT_RASTER_OPTION_ANTI_ALIASING\n\n  /* A lookup table used to quickly count set bits in four gray 2x2 */\n  /* cells.  The values of the table have been produced with the    */\n  /* following code:                                                */\n  /*                                                                */\n  /*   for ( i = 0; i < 256; i++ )                                  */\n  /*   {                                                            */\n  /*     l = 0;                                                     */\n  /*     j = i;                                                     */\n  /*                                                                */\n  /*     for ( c = 0; c < 4; c++ )                                  */\n  /*     {                                                          */\n  /*       l <<= 4;                                                 */\n  /*                                                                */\n  /*       if ( j & 0x80 ) l++;                                     */\n  /*       if ( j & 0x40 ) l++;                                     */\n  /*                                                                */\n  /*       j = ( j << 2 ) & 0xFF;                                   */\n  /*     }                                                          */\n  /*     printf( \"0x%04X\", l );                                     */\n  /*   }                                                            */\n  /*                                                                */\n\n  static const short  count_table[256] =\n  {\n    0x0000, 0x0001, 0x0001, 0x0002, 0x0010, 0x0011, 0x0011, 0x0012,\n    0x0010, 0x0011, 0x0011, 0x0012, 0x0020, 0x0021, 0x0021, 0x0022,\n    0x0100, 0x0101, 0x0101, 0x0102, 0x0110, 0x0111, 0x0111, 0x0112,\n    0x0110, 0x0111, 0x0111, 0x0112, 0x0120, 0x0121, 0x0121, 0x0122,\n    0x0100, 0x0101, 0x0101, 0x0102, 0x0110, 0x0111, 0x0111, 0x0112,\n    0x0110, 0x0111, 0x0111, 0x0112, 0x0120, 0x0121, 0x0121, 0x0122,\n    0x0200, 0x0201, 0x0201, 0x0202, 0x0210, 0x0211, 0x0211, 0x0212,\n    0x0210, 0x0211, 0x0211, 0x0212, 0x0220, 0x0221, 0x0221, 0x0222,\n    0x1000, 0x1001, 0x1001, 0x1002, 0x1010, 0x1011, 0x1011, 0x1012,\n    0x1010, 0x1011, 0x1011, 0x1012, 0x1020, 0x1021, 0x1021, 0x1022,\n    0x1100, 0x1101, 0x1101, 0x1102, 0x1110, 0x1111, 0x1111, 0x1112,\n    0x1110, 0x1111, 0x1111, 0x1112, 0x1120, 0x1121, 0x1121, 0x1122,\n    0x1100, 0x1101, 0x1101, 0x1102, 0x1110, 0x1111, 0x1111, 0x1112,\n    0x1110, 0x1111, 0x1111, 0x1112, 0x1120, 0x1121, 0x1121, 0x1122,\n    0x1200, 0x1201, 0x1201, 0x1202, 0x1210, 0x1211, 0x1211, 0x1212,\n    0x1210, 0x1211, 0x1211, 0x1212, 0x1220, 0x1221, 0x1221, 0x1222,\n    0x1000, 0x1001, 0x1001, 0x1002, 0x1010, 0x1011, 0x1011, 0x1012,\n    0x1010, 0x1011, 0x1011, 0x1012, 0x1020, 0x1021, 0x1021, 0x1022,\n    0x1100, 0x1101, 0x1101, 0x1102, 0x1110, 0x1111, 0x1111, 0x1112,\n    0x1110, 0x1111, 0x1111, 0x1112, 0x1120, 0x1121, 0x1121, 0x1122,\n    0x1100, 0x1101, 0x1101, 0x1102, 0x1110, 0x1111, 0x1111, 0x1112,\n    0x1110, 0x1111, 0x1111, 0x1112, 0x1120, 0x1121, 0x1121, 0x1122,\n    0x1200, 0x1201, 0x1201, 0x1202, 0x1210, 0x1211, 0x1211, 0x1212,\n    0x1210, 0x1211, 0x1211, 0x1212, 0x1220, 0x1221, 0x1221, 0x1222,\n    0x2000, 0x2001, 0x2001, 0x2002, 0x2010, 0x2011, 0x2011, 0x2012,\n    0x2010, 0x2011, 0x2011, 0x2012, 0x2020, 0x2021, 0x2021, 0x2022,\n    0x2100, 0x2101, 0x2101, 0x2102, 0x2110, 0x2111, 0x2111, 0x2112,\n    0x2110, 0x2111, 0x2111, 0x2112, 0x2120, 0x2121, 0x2121, 0x2122,\n    0x2100, 0x2101, 0x2101, 0x2102, 0x2110, 0x2111, 0x2111, 0x2112,\n    0x2110, 0x2111, 0x2111, 0x2112, 0x2120, 0x2121, 0x2121, 0x2122,\n    0x2200, 0x2201, 0x2201, 0x2202, 0x2210, 0x2211, 0x2211, 0x2212,\n    0x2210, 0x2211, 0x2211, 0x2212, 0x2220, 0x2221, 0x2221, 0x2222\n  };\n\n#endif /* FT_RASTER_OPTION_ANTI_ALIASING */\n\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /**                                                                     **/\n  /**  PROFILES COMPUTATION                                               **/\n  /**                                                                     **/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Set_High_Precision                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Set precision variables according to param flag.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    High :: Set to True for high precision (typically for ppem < 24),  */\n  /*            false otherwise.                                           */\n  /*                                                                       */\n  static void\n  Set_High_Precision( RAS_ARGS Int  High )\n  {\n    /*\n     * `precision_step' is used in `Bezier_Up' to decide when to split a\n     * given y-monotonous Bezier arc that crosses a scanline before\n     * approximating it as a straight segment.  The default value of 32 (for\n     * low accuracy) corresponds to\n     *\n     *   32 / 64 == 0.5 pixels ,\n     *\n     * while for the high accuracy case we have\n     *\n     *   256/ (1 << 12) = 0.0625 pixels .\n     *\n     * `precision_jitter' is an epsilon threshold used in\n     * `Vertical_Sweep_Span' to deal with small imperfections in the Bezier\n     * decomposition (after all, we are working with approximations only);\n     * it avoids switching on additional pixels which would cause artifacts\n     * otherwise.\n     *\n     * The value of `precision_jitter' has been determined heuristically.\n     *\n     */\n\n    if ( High )\n    {\n      ras.precision_bits   = 12;\n      ras.precision_step   = 256;\n      ras.precision_jitter = 30;\n    }\n    else\n    {\n      ras.precision_bits   = 6;\n      ras.precision_step   = 32;\n      ras.precision_jitter = 2;\n    }\n\n    FT_TRACE6(( \"Set_High_Precision(%s)\\n\", High ? \"true\" : \"false\" ));\n\n    ras.precision       = 1 << ras.precision_bits;\n    ras.precision_half  = ras.precision / 2;\n    ras.precision_shift = ras.precision_bits - Pixel_Bits;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    New_Profile                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new profile in the render pool.                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    aState    :: The state/orientation of the new profile.             */\n  /*                                                                       */\n  /*    overshoot :: Whether the profile's unrounded start position        */\n  /*                 differs by at least a half pixel.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*   SUCCESS on success.  FAILURE in case of overflow or of incoherent   */\n  /*   profile.                                                            */\n  /*                                                                       */\n  static Bool\n  New_Profile( RAS_ARGS TStates  aState,\n                        Bool     overshoot )\n  {\n    if ( !ras.fProfile )\n    {\n      ras.cProfile  = (PProfile)ras.top;\n      ras.fProfile  = ras.cProfile;\n      ras.top      += AlignProfileSize;\n    }\n\n    if ( ras.top >= ras.maxBuff )\n    {\n      ras.error = FT_THROW( Overflow );\n      return FAILURE;\n    }\n\n    ras.cProfile->flags  = 0;\n    ras.cProfile->start  = 0;\n    ras.cProfile->height = 0;\n    ras.cProfile->offset = ras.top;\n    ras.cProfile->link   = (PProfile)0;\n    ras.cProfile->next   = (PProfile)0;\n    ras.cProfile->flags  = ras.dropOutControl;\n\n    switch ( aState )\n    {\n    case Ascending_State:\n      ras.cProfile->flags |= Flow_Up;\n      if ( overshoot )\n        ras.cProfile->flags |= Overshoot_Bottom;\n\n      FT_TRACE6(( \"New ascending profile = %p\\n\", ras.cProfile ));\n      break;\n\n    case Descending_State:\n      if ( overshoot )\n        ras.cProfile->flags |= Overshoot_Top;\n      FT_TRACE6(( \"New descending profile = %p\\n\", ras.cProfile ));\n      break;\n\n    default:\n      FT_ERROR(( \"New_Profile: invalid profile direction\\n\" ));\n      ras.error = FT_THROW( Invalid );\n      return FAILURE;\n    }\n\n    if ( !ras.gProfile )\n      ras.gProfile = ras.cProfile;\n\n    ras.state = aState;\n    ras.fresh = TRUE;\n    ras.joint = FALSE;\n\n    return SUCCESS;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    End_Profile                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Finalize the current profile.                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    overshoot :: Whether the profile's unrounded end position differs  */\n  /*                 by at least a half pixel.                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    SUCCESS on success.  FAILURE in case of overflow or incoherency.   */\n  /*                                                                       */\n  static Bool\n  End_Profile( RAS_ARGS Bool  overshoot )\n  {\n    Long  h;\n\n\n    h = (Long)( ras.top - ras.cProfile->offset );\n\n    if ( h < 0 )\n    {\n      FT_ERROR(( \"End_Profile: negative height encountered\\n\" ));\n      ras.error = FT_THROW( Neg_Height );\n      return FAILURE;\n    }\n\n    if ( h > 0 )\n    {\n      PProfile  oldProfile;\n\n\n      FT_TRACE6(( \"Ending profile %p, start = %ld, height = %ld\\n\",\n                  ras.cProfile, ras.cProfile->start, h ));\n\n      ras.cProfile->height = h;\n      if ( overshoot )\n      {\n        if ( ras.cProfile->flags & Flow_Up )\n          ras.cProfile->flags |= Overshoot_Top;\n        else\n          ras.cProfile->flags |= Overshoot_Bottom;\n      }\n\n      oldProfile   = ras.cProfile;\n      ras.cProfile = (PProfile)ras.top;\n\n      ras.top += AlignProfileSize;\n\n      ras.cProfile->height = 0;\n      ras.cProfile->offset = ras.top;\n\n      oldProfile->next = ras.cProfile;\n      ras.num_Profs++;\n    }\n\n    if ( ras.top >= ras.maxBuff )\n    {\n      FT_TRACE1(( \"overflow in End_Profile\\n\" ));\n      ras.error = FT_THROW( Overflow );\n      return FAILURE;\n    }\n\n    ras.joint = FALSE;\n\n    return SUCCESS;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Insert_Y_Turn                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Insert a salient into the sorted list placed on top of the render  */\n  /*    pool.                                                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    New y scanline position.                                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    SUCCESS on success.  FAILURE in case of overflow.                  */\n  /*                                                                       */\n  static Bool\n  Insert_Y_Turn( RAS_ARGS Int  y )\n  {\n    PLong  y_turns;\n    Int    n;\n\n\n    n       = ras.numTurns - 1;\n    y_turns = ras.sizeBuff - ras.numTurns;\n\n    /* look for first y value that is <= */\n    while ( n >= 0 && y < y_turns[n] )\n      n--;\n\n    /* if it is <, simply insert it, ignore if == */\n    if ( n >= 0 && y > y_turns[n] )\n      while ( n >= 0 )\n      {\n        Int  y2 = (Int)y_turns[n];\n\n\n        y_turns[n] = y;\n        y = y2;\n        n--;\n      }\n\n    if ( n < 0 )\n    {\n      ras.maxBuff--;\n      if ( ras.maxBuff <= ras.top )\n      {\n        ras.error = FT_THROW( Overflow );\n        return FAILURE;\n      }\n      ras.numTurns++;\n      ras.sizeBuff[-ras.numTurns] = y;\n    }\n\n    return SUCCESS;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Finalize_Profile_Table                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Adjust all links in the profiles list.                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    SUCCESS on success.  FAILURE in case of overflow.                  */\n  /*                                                                       */\n  static Bool\n  Finalize_Profile_Table( RAS_ARG )\n  {\n    UShort    n;\n    PProfile  p;\n\n\n    n = ras.num_Profs;\n    p = ras.fProfile;\n\n    if ( n > 1 && p )\n    {\n      while ( n > 0 )\n      {\n        Int  bottom, top;\n\n\n        if ( n > 1 )\n          p->link = (PProfile)( p->offset + p->height );\n        else\n          p->link = NULL;\n\n        if ( p->flags & Flow_Up )\n        {\n          bottom = (Int)p->start;\n          top    = (Int)( p->start + p->height - 1 );\n        }\n        else\n        {\n          bottom     = (Int)( p->start - p->height + 1 );\n          top        = (Int)p->start;\n          p->start   = bottom;\n          p->offset += p->height - 1;\n        }\n\n        if ( Insert_Y_Turn( RAS_VARS bottom )  ||\n             Insert_Y_Turn( RAS_VARS top + 1 ) )\n          return FAILURE;\n\n        p = p->link;\n        n--;\n      }\n    }\n    else\n      ras.fProfile = NULL;\n\n    return SUCCESS;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Split_Conic                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Subdivide one conic Bezier into two joint sub-arcs in the Bezier   */\n  /*    stack.                                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    None (subdivided Bezier is taken from the top of the stack).       */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This routine is the `beef' of this component.  It is  _the_ inner  */\n  /*    loop that should be optimized to hell to get the best performance. */\n  /*                                                                       */\n  static void\n  Split_Conic( TPoint*  base )\n  {\n    Long  a, b;\n\n\n    base[4].x = base[2].x;\n    b = base[1].x;\n    a = base[3].x = ( base[2].x + b ) / 2;\n    b = base[1].x = ( base[0].x + b ) / 2;\n    base[2].x = ( a + b ) / 2;\n\n    base[4].y = base[2].y;\n    b = base[1].y;\n    a = base[3].y = ( base[2].y + b ) / 2;\n    b = base[1].y = ( base[0].y + b ) / 2;\n    base[2].y = ( a + b ) / 2;\n\n    /* hand optimized.  gcc doesn't seem to be too good at common      */\n    /* expression substitution and instruction scheduling ;-)          */\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Split_Cubic                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Subdivide a third-order Bezier arc into two joint sub-arcs in the  */\n  /*    Bezier stack.                                                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This routine is the `beef' of the component.  It is one of _the_   */\n  /*    inner loops that should be optimized like hell to get the best     */\n  /*    performance.                                                       */\n  /*                                                                       */\n  static void\n  Split_Cubic( TPoint*  base )\n  {\n    Long  a, b, c, d;\n\n\n    base[6].x = base[3].x;\n    c = base[1].x;\n    d = base[2].x;\n    base[1].x = a = ( base[0].x + c + 1 ) >> 1;\n    base[5].x = b = ( base[3].x + d + 1 ) >> 1;\n    c = ( c + d + 1 ) >> 1;\n    base[2].x = a = ( a + c + 1 ) >> 1;\n    base[4].x = b = ( b + c + 1 ) >> 1;\n    base[3].x = ( a + b + 1 ) >> 1;\n\n    base[6].y = base[3].y;\n    c = base[1].y;\n    d = base[2].y;\n    base[1].y = a = ( base[0].y + c + 1 ) >> 1;\n    base[5].y = b = ( base[3].y + d + 1 ) >> 1;\n    c = ( c + d + 1 ) >> 1;\n    base[2].y = a = ( a + c + 1 ) >> 1;\n    base[4].y = b = ( b + c + 1 ) >> 1;\n    base[3].y = ( a + b + 1 ) >> 1;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Line_Up                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Compute the x-coordinates of an ascending line segment and store   */\n  /*    them in the render pool.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    x1   :: The x-coordinate of the segment's start point.             */\n  /*                                                                       */\n  /*    y1   :: The y-coordinate of the segment's start point.             */\n  /*                                                                       */\n  /*    x2   :: The x-coordinate of the segment's end point.               */\n  /*                                                                       */\n  /*    y2   :: The y-coordinate of the segment's end point.               */\n  /*                                                                       */\n  /*    miny :: A lower vertical clipping bound value.                     */\n  /*                                                                       */\n  /*    maxy :: An upper vertical clipping bound value.                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    SUCCESS on success, FAILURE on render pool overflow.               */\n  /*                                                                       */\n  static Bool\n  Line_Up( RAS_ARGS Long  x1,\n                    Long  y1,\n                    Long  x2,\n                    Long  y2,\n                    Long  miny,\n                    Long  maxy )\n  {\n    Long   Dx, Dy;\n    Int    e1, e2, f1, f2, size;     /* XXX: is `Short' sufficient? */\n    Long   Ix, Rx, Ax;\n\n    PLong  top;\n\n\n    Dx = x2 - x1;\n    Dy = y2 - y1;\n\n    if ( Dy <= 0 || y2 < miny || y1 > maxy )\n      return SUCCESS;\n\n    if ( y1 < miny )\n    {\n      /* Take care: miny-y1 can be a very large value; we use     */\n      /*            a slow MulDiv function to avoid clipping bugs */\n      x1 += SMulDiv( Dx, miny - y1, Dy );\n      e1  = (Int)TRUNC( miny );\n      f1  = 0;\n    }\n    else\n    {\n      e1 = (Int)TRUNC( y1 );\n      f1 = (Int)FRAC( y1 );\n    }\n\n    if ( y2 > maxy )\n    {\n      /* x2 += FMulDiv( Dx, maxy - y2, Dy );  UNNECESSARY */\n      e2  = (Int)TRUNC( maxy );\n      f2  = 0;\n    }\n    else\n    {\n      e2 = (Int)TRUNC( y2 );\n      f2 = (Int)FRAC( y2 );\n    }\n\n    if ( f1 > 0 )\n    {\n      if ( e1 == e2 )\n        return SUCCESS;\n      else\n      {\n        x1 += SMulDiv( Dx, ras.precision - f1, Dy );\n        e1 += 1;\n      }\n    }\n    else\n      if ( ras.joint )\n      {\n        ras.top--;\n        ras.joint = FALSE;\n      }\n\n    ras.joint = (char)( f2 == 0 );\n\n    if ( ras.fresh )\n    {\n      ras.cProfile->start = e1;\n      ras.fresh           = FALSE;\n    }\n\n    size = e2 - e1 + 1;\n    if ( ras.top + size >= ras.maxBuff )\n    {\n      ras.error = FT_THROW( Overflow );\n      return FAILURE;\n    }\n\n    if ( Dx > 0 )\n    {\n      Ix = SMulDiv_No_Round( ras.precision, Dx, Dy );\n      Rx = ( ras.precision * Dx ) % Dy;\n      Dx = 1;\n    }\n    else\n    {\n      Ix = -SMulDiv_No_Round( ras.precision, -Dx, Dy );\n      Rx = ( ras.precision * -Dx ) % Dy;\n      Dx = -1;\n    }\n\n    Ax  = -Dy;\n    top = ras.top;\n\n    while ( size > 0 )\n    {\n      *top++ = x1;\n\n      x1 += Ix;\n      Ax += Rx;\n      if ( Ax >= 0 )\n      {\n        Ax -= Dy;\n        x1 += Dx;\n      }\n      size--;\n    }\n\n    ras.top = top;\n    return SUCCESS;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Line_Down                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Compute the x-coordinates of an descending line segment and store  */\n  /*    them in the render pool.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    x1   :: The x-coordinate of the segment's start point.             */\n  /*                                                                       */\n  /*    y1   :: The y-coordinate of the segment's start point.             */\n  /*                                                                       */\n  /*    x2   :: The x-coordinate of the segment's end point.               */\n  /*                                                                       */\n  /*    y2   :: The y-coordinate of the segment's end point.               */\n  /*                                                                       */\n  /*    miny :: A lower vertical clipping bound value.                     */\n  /*                                                                       */\n  /*    maxy :: An upper vertical clipping bound value.                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    SUCCESS on success, FAILURE on render pool overflow.               */\n  /*                                                                       */\n  static Bool\n  Line_Down( RAS_ARGS Long  x1,\n                      Long  y1,\n                      Long  x2,\n                      Long  y2,\n                      Long  miny,\n                      Long  maxy )\n  {\n    Bool  result, fresh;\n\n\n    fresh  = ras.fresh;\n\n    result = Line_Up( RAS_VARS x1, -y1, x2, -y2, -maxy, -miny );\n\n    if ( fresh && !ras.fresh )\n      ras.cProfile->start = -ras.cProfile->start;\n\n    return result;\n  }\n\n\n  /* A function type describing the functions used to split Bezier arcs */\n  typedef void  (*TSplitter)( TPoint*  base );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Bezier_Up                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Compute the x-coordinates of an ascending Bezier arc and store     */\n  /*    them in the render pool.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    degree   :: The degree of the Bezier arc (either 2 or 3).          */\n  /*                                                                       */\n  /*    splitter :: The function to split Bezier arcs.                     */\n  /*                                                                       */\n  /*    miny     :: A lower vertical clipping bound value.                 */\n  /*                                                                       */\n  /*    maxy     :: An upper vertical clipping bound value.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    SUCCESS on success, FAILURE on render pool overflow.               */\n  /*                                                                       */\n  static Bool\n  Bezier_Up( RAS_ARGS Int        degree,\n                      TSplitter  splitter,\n                      Long       miny,\n                      Long       maxy )\n  {\n    Long   y1, y2, e, e2, e0;\n    Short  f1;\n\n    TPoint*  arc;\n    TPoint*  start_arc;\n\n    PLong top;\n\n\n    arc = ras.arc;\n    y1  = arc[degree].y;\n    y2  = arc[0].y;\n    top = ras.top;\n\n    if ( y2 < miny || y1 > maxy )\n      goto Fin;\n\n    e2 = FLOOR( y2 );\n\n    if ( e2 > maxy )\n      e2 = maxy;\n\n    e0 = miny;\n\n    if ( y1 < miny )\n      e = miny;\n    else\n    {\n      e  = CEILING( y1 );\n      f1 = (Short)( FRAC( y1 ) );\n      e0 = e;\n\n      if ( f1 == 0 )\n      {\n        if ( ras.joint )\n        {\n          top--;\n          ras.joint = FALSE;\n        }\n\n        *top++ = arc[degree].x;\n\n        e += ras.precision;\n      }\n    }\n\n    if ( ras.fresh )\n    {\n      ras.cProfile->start = TRUNC( e0 );\n      ras.fresh = FALSE;\n    }\n\n    if ( e2 < e )\n      goto Fin;\n\n    if ( ( top + TRUNC( e2 - e ) + 1 ) >= ras.maxBuff )\n    {\n      ras.top   = top;\n      ras.error = FT_THROW( Overflow );\n      return FAILURE;\n    }\n\n    start_arc = arc;\n\n    while ( arc >= start_arc && e <= e2 )\n    {\n      ras.joint = FALSE;\n\n      y2 = arc[0].y;\n\n      if ( y2 > e )\n      {\n        y1 = arc[degree].y;\n        if ( y2 - y1 >= ras.precision_step )\n        {\n          splitter( arc );\n          arc += degree;\n        }\n        else\n        {\n          *top++ = arc[degree].x + FMulDiv( arc[0].x - arc[degree].x,\n                                            e - y1, y2 - y1 );\n          arc -= degree;\n          e   += ras.precision;\n        }\n      }\n      else\n      {\n        if ( y2 == e )\n        {\n          ras.joint  = TRUE;\n          *top++     = arc[0].x;\n\n          e += ras.precision;\n        }\n        arc -= degree;\n      }\n    }\n\n  Fin:\n    ras.top  = top;\n    ras.arc -= degree;\n    return SUCCESS;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Bezier_Down                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Compute the x-coordinates of an descending Bezier arc and store    */\n  /*    them in the render pool.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    degree   :: The degree of the Bezier arc (either 2 or 3).          */\n  /*                                                                       */\n  /*    splitter :: The function to split Bezier arcs.                     */\n  /*                                                                       */\n  /*    miny     :: A lower vertical clipping bound value.                 */\n  /*                                                                       */\n  /*    maxy     :: An upper vertical clipping bound value.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    SUCCESS on success, FAILURE on render pool overflow.               */\n  /*                                                                       */\n  static Bool\n  Bezier_Down( RAS_ARGS Int        degree,\n                        TSplitter  splitter,\n                        Long       miny,\n                        Long       maxy )\n  {\n    TPoint*  arc = ras.arc;\n    Bool     result, fresh;\n\n\n    arc[0].y = -arc[0].y;\n    arc[1].y = -arc[1].y;\n    arc[2].y = -arc[2].y;\n    if ( degree > 2 )\n      arc[3].y = -arc[3].y;\n\n    fresh = ras.fresh;\n\n    result = Bezier_Up( RAS_VARS degree, splitter, -maxy, -miny );\n\n    if ( fresh && !ras.fresh )\n      ras.cProfile->start = -ras.cProfile->start;\n\n    arc[0].y = -arc[0].y;\n    return result;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Line_To                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Inject a new line segment and adjust the Profiles list.            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*   x :: The x-coordinate of the segment's end point (its start point   */\n  /*        is stored in `lastX').                                         */\n  /*                                                                       */\n  /*   y :: The y-coordinate of the segment's end point (its start point   */\n  /*        is stored in `lastY').                                         */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*   SUCCESS on success, FAILURE on render pool overflow or incorrect    */\n  /*   profile.                                                            */\n  /*                                                                       */\n  static Bool\n  Line_To( RAS_ARGS Long  x,\n                    Long  y )\n  {\n    /* First, detect a change of direction */\n\n    switch ( ras.state )\n    {\n    case Unknown_State:\n      if ( y > ras.lastY )\n      {\n        if ( New_Profile( RAS_VARS Ascending_State,\n                                   IS_BOTTOM_OVERSHOOT( ras.lastY ) ) )\n          return FAILURE;\n      }\n      else\n      {\n        if ( y < ras.lastY )\n          if ( New_Profile( RAS_VARS Descending_State,\n                                     IS_TOP_OVERSHOOT( ras.lastY ) ) )\n            return FAILURE;\n      }\n      break;\n\n    case Ascending_State:\n      if ( y < ras.lastY )\n      {\n        if ( End_Profile( RAS_VARS IS_TOP_OVERSHOOT( ras.lastY ) ) ||\n             New_Profile( RAS_VARS Descending_State,\n                                   IS_TOP_OVERSHOOT( ras.lastY ) ) )\n          return FAILURE;\n      }\n      break;\n\n    case Descending_State:\n      if ( y > ras.lastY )\n      {\n        if ( End_Profile( RAS_VARS IS_BOTTOM_OVERSHOOT( ras.lastY ) ) ||\n             New_Profile( RAS_VARS Ascending_State,\n                                   IS_BOTTOM_OVERSHOOT( ras.lastY ) ) )\n          return FAILURE;\n      }\n      break;\n\n    default:\n      ;\n    }\n\n    /* Then compute the lines */\n\n    switch ( ras.state )\n    {\n    case Ascending_State:\n      if ( Line_Up( RAS_VARS ras.lastX, ras.lastY,\n                             x, y, ras.minY, ras.maxY ) )\n        return FAILURE;\n      break;\n\n    case Descending_State:\n      if ( Line_Down( RAS_VARS ras.lastX, ras.lastY,\n                               x, y, ras.minY, ras.maxY ) )\n        return FAILURE;\n      break;\n\n    default:\n      ;\n    }\n\n    ras.lastX = x;\n    ras.lastY = y;\n\n    return SUCCESS;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Conic_To                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Inject a new conic arc and adjust the profile list.                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*   cx :: The x-coordinate of the arc's new control point.              */\n  /*                                                                       */\n  /*   cy :: The y-coordinate of the arc's new control point.              */\n  /*                                                                       */\n  /*   x  :: The x-coordinate of the arc's end point (its start point is   */\n  /*         stored in `lastX').                                           */\n  /*                                                                       */\n  /*   y  :: The y-coordinate of the arc's end point (its start point is   */\n  /*         stored in `lastY').                                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*   SUCCESS on success, FAILURE on render pool overflow or incorrect    */\n  /*   profile.                                                            */\n  /*                                                                       */\n  static Bool\n  Conic_To( RAS_ARGS Long  cx,\n                     Long  cy,\n                     Long  x,\n                     Long  y )\n  {\n    Long     y1, y2, y3, x3, ymin, ymax;\n    TStates  state_bez;\n\n\n    ras.arc      = ras.arcs;\n    ras.arc[2].x = ras.lastX;\n    ras.arc[2].y = ras.lastY;\n    ras.arc[1].x = cx;\n    ras.arc[1].y = cy;\n    ras.arc[0].x = x;\n    ras.arc[0].y = y;\n\n    do\n    {\n      y1 = ras.arc[2].y;\n      y2 = ras.arc[1].y;\n      y3 = ras.arc[0].y;\n      x3 = ras.arc[0].x;\n\n      /* first, categorize the Bezier arc */\n\n      if ( y1 <= y3 )\n      {\n        ymin = y1;\n        ymax = y3;\n      }\n      else\n      {\n        ymin = y3;\n        ymax = y1;\n      }\n\n      if ( y2 < ymin || y2 > ymax )\n      {\n        /* this arc has no given direction, split it! */\n        Split_Conic( ras.arc );\n        ras.arc += 2;\n      }\n      else if ( y1 == y3 )\n      {\n        /* this arc is flat, ignore it and pop it from the Bezier stack */\n        ras.arc -= 2;\n      }\n      else\n      {\n        /* the arc is y-monotonous, either ascending or descending */\n        /* detect a change of direction                            */\n        state_bez = y1 < y3 ? Ascending_State : Descending_State;\n        if ( ras.state != state_bez )\n        {\n          Bool  o = state_bez == Ascending_State ? IS_BOTTOM_OVERSHOOT( y1 )\n                                                 : IS_TOP_OVERSHOOT( y1 );\n\n\n          /* finalize current profile if any */\n          if ( ras.state != Unknown_State &&\n               End_Profile( RAS_VARS o )  )\n            goto Fail;\n\n          /* create a new profile */\n          if ( New_Profile( RAS_VARS state_bez, o ) )\n            goto Fail;\n        }\n\n        /* now call the appropriate routine */\n        if ( state_bez == Ascending_State )\n        {\n          if ( Bezier_Up( RAS_VARS 2, Split_Conic, ras.minY, ras.maxY ) )\n            goto Fail;\n        }\n        else\n          if ( Bezier_Down( RAS_VARS 2, Split_Conic, ras.minY, ras.maxY ) )\n            goto Fail;\n      }\n\n    } while ( ras.arc >= ras.arcs );\n\n    ras.lastX = x3;\n    ras.lastY = y3;\n\n    return SUCCESS;\n\n  Fail:\n    return FAILURE;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Cubic_To                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Inject a new cubic arc and adjust the profile list.                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*   cx1 :: The x-coordinate of the arc's first new control point.       */\n  /*                                                                       */\n  /*   cy1 :: The y-coordinate of the arc's first new control point.       */\n  /*                                                                       */\n  /*   cx2 :: The x-coordinate of the arc's second new control point.      */\n  /*                                                                       */\n  /*   cy2 :: The y-coordinate of the arc's second new control point.      */\n  /*                                                                       */\n  /*   x   :: The x-coordinate of the arc's end point (its start point is  */\n  /*          stored in `lastX').                                          */\n  /*                                                                       */\n  /*   y   :: The y-coordinate of the arc's end point (its start point is  */\n  /*          stored in `lastY').                                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*   SUCCESS on success, FAILURE on render pool overflow or incorrect    */\n  /*   profile.                                                            */\n  /*                                                                       */\n  static Bool\n  Cubic_To( RAS_ARGS Long  cx1,\n                     Long  cy1,\n                     Long  cx2,\n                     Long  cy2,\n                     Long  x,\n                     Long  y )\n  {\n    Long     y1, y2, y3, y4, x4, ymin1, ymax1, ymin2, ymax2;\n    TStates  state_bez;\n\n\n    ras.arc      = ras.arcs;\n    ras.arc[3].x = ras.lastX;\n    ras.arc[3].y = ras.lastY;\n    ras.arc[2].x = cx1;\n    ras.arc[2].y = cy1;\n    ras.arc[1].x = cx2;\n    ras.arc[1].y = cy2;\n    ras.arc[0].x = x;\n    ras.arc[0].y = y;\n\n    do\n    {\n      y1 = ras.arc[3].y;\n      y2 = ras.arc[2].y;\n      y3 = ras.arc[1].y;\n      y4 = ras.arc[0].y;\n      x4 = ras.arc[0].x;\n\n      /* first, categorize the Bezier arc */\n\n      if ( y1 <= y4 )\n      {\n        ymin1 = y1;\n        ymax1 = y4;\n      }\n      else\n      {\n        ymin1 = y4;\n        ymax1 = y1;\n      }\n\n      if ( y2 <= y3 )\n      {\n        ymin2 = y2;\n        ymax2 = y3;\n      }\n      else\n      {\n        ymin2 = y3;\n        ymax2 = y2;\n      }\n\n      if ( ymin2 < ymin1 || ymax2 > ymax1 )\n      {\n        /* this arc has no given direction, split it! */\n        Split_Cubic( ras.arc );\n        ras.arc += 3;\n      }\n      else if ( y1 == y4 )\n      {\n        /* this arc is flat, ignore it and pop it from the Bezier stack */\n        ras.arc -= 3;\n      }\n      else\n      {\n        state_bez = ( y1 <= y4 ) ? Ascending_State : Descending_State;\n\n        /* detect a change of direction */\n        if ( ras.state != state_bez )\n        {\n          Bool  o = state_bez == Ascending_State ? IS_BOTTOM_OVERSHOOT( y1 )\n                                                 : IS_TOP_OVERSHOOT( y1 );\n\n\n          /* finalize current profile if any */\n          if ( ras.state != Unknown_State &&\n               End_Profile( RAS_VARS o )  )\n            goto Fail;\n\n          if ( New_Profile( RAS_VARS state_bez, o ) )\n            goto Fail;\n        }\n\n        /* compute intersections */\n        if ( state_bez == Ascending_State )\n        {\n          if ( Bezier_Up( RAS_VARS 3, Split_Cubic, ras.minY, ras.maxY ) )\n            goto Fail;\n        }\n        else\n          if ( Bezier_Down( RAS_VARS 3, Split_Cubic, ras.minY, ras.maxY ) )\n            goto Fail;\n      }\n\n    } while ( ras.arc >= ras.arcs );\n\n    ras.lastX = x4;\n    ras.lastY = y4;\n\n    return SUCCESS;\n\n  Fail:\n    return FAILURE;\n  }\n\n\n#undef  SWAP_\n#define SWAP_( x, y )  do                \\\n                       {                 \\\n                         Long  swap = x; \\\n                                         \\\n                                         \\\n                         x = y;          \\\n                         y = swap;       \\\n                       } while ( 0 )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Decompose_Curve                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Scan the outline arrays in order to emit individual segments and   */\n  /*    Beziers by calling Line_To() and Bezier_To().  It handles all      */\n  /*    weird cases, like when the first point is off the curve, or when   */\n  /*    there are simply no `on' points in the contour!                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    first   :: The index of the first point in the contour.            */\n  /*                                                                       */\n  /*    last    :: The index of the last point in the contour.             */\n  /*                                                                       */\n  /*    flipped :: If set, flip the direction of the curve.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    SUCCESS on success, FAILURE on error.                              */\n  /*                                                                       */\n  static Bool\n  Decompose_Curve( RAS_ARGS UShort  first,\n                            UShort  last,\n                            int     flipped )\n  {\n    FT_Vector   v_last;\n    FT_Vector   v_control;\n    FT_Vector   v_start;\n\n    FT_Vector*  points;\n    FT_Vector*  point;\n    FT_Vector*  limit;\n    char*       tags;\n\n    unsigned    tag;       /* current point's state           */\n\n\n    points = ras.outline.points;\n    limit  = points + last;\n\n    v_start.x = SCALED( points[first].x );\n    v_start.y = SCALED( points[first].y );\n    v_last.x  = SCALED( points[last].x );\n    v_last.y  = SCALED( points[last].y );\n\n    if ( flipped )\n    {\n      SWAP_( v_start.x, v_start.y );\n      SWAP_( v_last.x, v_last.y );\n    }\n\n    v_control = v_start;\n\n    point = points + first;\n    tags  = ras.outline.tags + first;\n\n    /* set scan mode if necessary */\n    if ( tags[0] & FT_CURVE_TAG_HAS_SCANMODE )\n      ras.dropOutControl = (Byte)tags[0] >> 5;\n\n    tag = FT_CURVE_TAG( tags[0] );\n\n    /* A contour cannot start with a cubic control point! */\n    if ( tag == FT_CURVE_TAG_CUBIC )\n      goto Invalid_Outline;\n\n    /* check first point to determine origin */\n    if ( tag == FT_CURVE_TAG_CONIC )\n    {\n      /* first point is conic control.  Yes, this happens. */\n      if ( FT_CURVE_TAG( ras.outline.tags[last] ) == FT_CURVE_TAG_ON )\n      {\n        /* start at last point if it is on the curve */\n        v_start = v_last;\n        limit--;\n      }\n      else\n      {\n        /* if both first and last points are conic,         */\n        /* start at their middle and record its position    */\n        /* for closure                                      */\n        v_start.x = ( v_start.x + v_last.x ) / 2;\n        v_start.y = ( v_start.y + v_last.y ) / 2;\n\n     /* v_last = v_start; */\n      }\n      point--;\n      tags--;\n    }\n\n    ras.lastX = v_start.x;\n    ras.lastY = v_start.y;\n\n    while ( point < limit )\n    {\n      point++;\n      tags++;\n\n      tag = FT_CURVE_TAG( tags[0] );\n\n      switch ( tag )\n      {\n      case FT_CURVE_TAG_ON:  /* emit a single line_to */\n        {\n          Long  x, y;\n\n\n          x = SCALED( point->x );\n          y = SCALED( point->y );\n          if ( flipped )\n            SWAP_( x, y );\n\n          if ( Line_To( RAS_VARS x, y ) )\n            goto Fail;\n          continue;\n        }\n\n      case FT_CURVE_TAG_CONIC:  /* consume conic arcs */\n        v_control.x = SCALED( point[0].x );\n        v_control.y = SCALED( point[0].y );\n\n        if ( flipped )\n          SWAP_( v_control.x, v_control.y );\n\n      Do_Conic:\n        if ( point < limit )\n        {\n          FT_Vector  v_middle;\n          Long       x, y;\n\n\n          point++;\n          tags++;\n          tag = FT_CURVE_TAG( tags[0] );\n\n          x = SCALED( point[0].x );\n          y = SCALED( point[0].y );\n\n          if ( flipped )\n            SWAP_( x, y );\n\n          if ( tag == FT_CURVE_TAG_ON )\n          {\n            if ( Conic_To( RAS_VARS v_control.x, v_control.y, x, y ) )\n              goto Fail;\n            continue;\n          }\n\n          if ( tag != FT_CURVE_TAG_CONIC )\n            goto Invalid_Outline;\n\n          v_middle.x = ( v_control.x + x ) / 2;\n          v_middle.y = ( v_control.y + y ) / 2;\n\n          if ( Conic_To( RAS_VARS v_control.x, v_control.y,\n                                  v_middle.x,  v_middle.y ) )\n            goto Fail;\n\n          v_control.x = x;\n          v_control.y = y;\n\n          goto Do_Conic;\n        }\n\n        if ( Conic_To( RAS_VARS v_control.x, v_control.y,\n                                v_start.x,   v_start.y ) )\n          goto Fail;\n\n        goto Close;\n\n      default:  /* FT_CURVE_TAG_CUBIC */\n        {\n          Long  x1, y1, x2, y2, x3, y3;\n\n\n          if ( point + 1 > limit                             ||\n               FT_CURVE_TAG( tags[1] ) != FT_CURVE_TAG_CUBIC )\n            goto Invalid_Outline;\n\n          point += 2;\n          tags  += 2;\n\n          x1 = SCALED( point[-2].x );\n          y1 = SCALED( point[-2].y );\n          x2 = SCALED( point[-1].x );\n          y2 = SCALED( point[-1].y );\n\n          if ( flipped )\n          {\n            SWAP_( x1, y1 );\n            SWAP_( x2, y2 );\n          }\n\n          if ( point <= limit )\n          {\n            x3 = SCALED( point[0].x );\n            y3 = SCALED( point[0].y );\n\n            if ( flipped )\n              SWAP_( x3, y3 );\n\n            if ( Cubic_To( RAS_VARS x1, y1, x2, y2, x3, y3 ) )\n              goto Fail;\n            continue;\n          }\n\n          if ( Cubic_To( RAS_VARS x1, y1, x2, y2, v_start.x, v_start.y ) )\n            goto Fail;\n          goto Close;\n        }\n      }\n    }\n\n    /* close the contour with a line segment */\n    if ( Line_To( RAS_VARS v_start.x, v_start.y ) )\n      goto Fail;\n\n  Close:\n    return SUCCESS;\n\n  Invalid_Outline:\n    ras.error = FT_THROW( Invalid );\n\n  Fail:\n    return FAILURE;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Convert_Glyph                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Convert a glyph into a series of segments and arcs and make a      */\n  /*    profiles list with them.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    flipped :: If set, flip the direction of curve.                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    SUCCESS on success, FAILURE if any error was encountered during    */\n  /*    rendering.                                                         */\n  /*                                                                       */\n  static Bool\n  Convert_Glyph( RAS_ARGS int  flipped )\n  {\n    int       i;\n    unsigned  start;\n\n\n    ras.fProfile = NULL;\n    ras.joint    = FALSE;\n    ras.fresh    = FALSE;\n\n    ras.maxBuff  = ras.sizeBuff - AlignProfileSize;\n\n    ras.numTurns = 0;\n\n    ras.cProfile         = (PProfile)ras.top;\n    ras.cProfile->offset = ras.top;\n    ras.num_Profs        = 0;\n\n    start = 0;\n\n    for ( i = 0; i < ras.outline.n_contours; i++ )\n    {\n      PProfile  lastProfile;\n      Bool      o;\n\n\n      ras.state    = Unknown_State;\n      ras.gProfile = NULL;\n\n      if ( Decompose_Curve( RAS_VARS (unsigned short)start,\n                                     ras.outline.contours[i],\n                                     flipped ) )\n        return FAILURE;\n\n      start = ras.outline.contours[i] + 1;\n\n      /* we must now check whether the extreme arcs join or not */\n      if ( FRAC( ras.lastY ) == 0 &&\n           ras.lastY >= ras.minY  &&\n           ras.lastY <= ras.maxY  )\n        if ( ras.gProfile                        &&\n             ( ras.gProfile->flags & Flow_Up ) ==\n               ( ras.cProfile->flags & Flow_Up ) )\n          ras.top--;\n        /* Note that ras.gProfile can be nil if the contour was too small */\n        /* to be drawn.                                                   */\n\n      lastProfile = ras.cProfile;\n      if ( ras.cProfile->flags & Flow_Up )\n        o = IS_TOP_OVERSHOOT( ras.lastY );\n      else\n        o = IS_BOTTOM_OVERSHOOT( ras.lastY );\n      if ( End_Profile( RAS_VARS o ) )\n        return FAILURE;\n\n      /* close the `next profile in contour' linked list */\n      if ( ras.gProfile )\n        lastProfile->next = ras.gProfile;\n    }\n\n    if ( Finalize_Profile_Table( RAS_VAR ) )\n      return FAILURE;\n\n    return (Bool)( ras.top < ras.maxBuff ? SUCCESS : FAILURE );\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /**                                                                     **/\n  /**  SCAN-LINE SWEEPS AND DRAWING                                       **/\n  /**                                                                     **/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  Init_Linked                                                          */\n  /*                                                                       */\n  /*    Initializes an empty linked list.                                  */\n  /*                                                                       */\n  static void\n  Init_Linked( TProfileList*  l )\n  {\n    *l = NULL;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  InsNew                                                               */\n  /*                                                                       */\n  /*    Inserts a new profile in a linked list.                            */\n  /*                                                                       */\n  static void\n  InsNew( PProfileList  list,\n          PProfile      profile )\n  {\n    PProfile  *old, current;\n    Long       x;\n\n\n    old     = list;\n    current = *old;\n    x       = profile->X;\n\n    while ( current )\n    {\n      if ( x < current->X )\n        break;\n      old     = &current->link;\n      current = *old;\n    }\n\n    profile->link = current;\n    *old          = profile;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  DelOld                                                               */\n  /*                                                                       */\n  /*    Removes an old profile from a linked list.                         */\n  /*                                                                       */\n  static void\n  DelOld( PProfileList  list,\n          PProfile      profile )\n  {\n    PProfile  *old, current;\n\n\n    old     = list;\n    current = *old;\n\n    while ( current )\n    {\n      if ( current == profile )\n      {\n        *old = current->link;\n        return;\n      }\n\n      old     = &current->link;\n      current = *old;\n    }\n\n    /* we should never get there, unless the profile was not part of */\n    /* the list.                                                     */\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  Sort                                                                 */\n  /*                                                                       */\n  /*    Sorts a trace list.  In 95%, the list is already sorted.  We need  */\n  /*    an algorithm which is fast in this case.  Bubble sort is enough    */\n  /*    and simple.                                                        */\n  /*                                                                       */\n  static void\n  Sort( PProfileList  list )\n  {\n    PProfile  *old, current, next;\n\n\n    /* First, set the new X coordinate of each profile */\n    current = *list;\n    while ( current )\n    {\n      current->X       = *current->offset;\n      current->offset += current->flags & Flow_Up ? 1 : -1;\n      current->height--;\n      current = current->link;\n    }\n\n    /* Then sort them */\n    old     = list;\n    current = *old;\n\n    if ( !current )\n      return;\n\n    next = current->link;\n\n    while ( next )\n    {\n      if ( current->X <= next->X )\n      {\n        old     = &current->link;\n        current = *old;\n\n        if ( !current )\n          return;\n      }\n      else\n      {\n        *old          = next;\n        current->link = next->link;\n        next->link    = current;\n\n        old     = list;\n        current = *old;\n      }\n\n      next = current->link;\n    }\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  Vertical Sweep Procedure Set                                         */\n  /*                                                                       */\n  /*  These four routines are used during the vertical black/white sweep   */\n  /*  phase by the generic Draw_Sweep() function.                          */\n  /*                                                                       */\n  /*************************************************************************/\n\n  static void\n  Vertical_Sweep_Init( RAS_ARGS Short*  min,\n                                Short*  max )\n  {\n    Long  pitch = ras.target.pitch;\n\n    FT_UNUSED( max );\n\n\n    ras.traceIncr = (Short)-pitch;\n    ras.traceOfs  = -*min * pitch;\n    if ( pitch > 0 )\n      ras.traceOfs += ( ras.target.rows - 1 ) * pitch;\n\n    ras.gray_min_x = 0;\n    ras.gray_max_x = 0;\n  }\n\n\n  static void\n  Vertical_Sweep_Span( RAS_ARGS Short       y,\n                                FT_F26Dot6  x1,\n                                FT_F26Dot6  x2,\n                                PProfile    left,\n                                PProfile    right )\n  {\n    Long   e1, e2;\n    Byte*  target;\n\n    Int  dropOutControl = left->flags & 7;\n\n    FT_UNUSED( y );\n    FT_UNUSED( left );\n    FT_UNUSED( right );\n\n\n    /* Drop-out control */\n\n    e1 = TRUNC( CEILING( x1 ) );\n\n    if ( dropOutControl != 2                             &&\n         x2 - x1 - ras.precision <= ras.precision_jitter )\n      e2 = e1;\n    else\n      e2 = TRUNC( FLOOR( x2 ) );\n\n    if ( e2 >= 0 && e1 < ras.bWidth )\n    {\n      int   c1, c2;\n      Byte  f1, f2;\n\n\n      if ( e1 < 0 )\n        e1 = 0;\n      if ( e2 >= ras.bWidth )\n        e2 = ras.bWidth - 1;\n\n      c1 = (Short)( e1 >> 3 );\n      c2 = (Short)( e2 >> 3 );\n\n      f1 = (Byte)  ( 0xFF >> ( e1 & 7 ) );\n      f2 = (Byte) ~( 0x7F >> ( e2 & 7 ) );\n\n      if ( ras.gray_min_x > c1 )\n        ras.gray_min_x = (short)c1;\n      if ( ras.gray_max_x < c2 )\n        ras.gray_max_x = (short)c2;\n\n      target = ras.bTarget + ras.traceOfs + c1;\n      c2 -= c1;\n\n      if ( c2 > 0 )\n      {\n        target[0] |= f1;\n\n        /* memset() is slower than the following code on many platforms. */\n        /* This is due to the fact that, in the vast majority of cases,  */\n        /* the span length in bytes is relatively small.                 */\n        c2--;\n        while ( c2 > 0 )\n        {\n          *(++target) = 0xFF;\n          c2--;\n        }\n        target[1] |= f2;\n      }\n      else\n        *target |= ( f1 & f2 );\n    }\n  }\n\n\n  static void\n  Vertical_Sweep_Drop( RAS_ARGS Short       y,\n                                FT_F26Dot6  x1,\n                                FT_F26Dot6  x2,\n                                PProfile    left,\n                                PProfile    right )\n  {\n    Long   e1, e2, pxl;\n    Short  c1, f1;\n\n\n    /* Drop-out control */\n\n    /*   e2            x2                    x1           e1   */\n    /*                                                         */\n    /*                 ^                     |                 */\n    /*                 |                     |                 */\n    /*   +-------------+---------------------+------------+    */\n    /*                 |                     |                 */\n    /*                 |                     v                 */\n    /*                                                         */\n    /* pixel         contour              contour       pixel  */\n    /* center                                           center */\n\n    /* drop-out mode    scan conversion rules (as defined in OpenType) */\n    /* --------------------------------------------------------------- */\n    /*  0                1, 2, 3                                       */\n    /*  1                1, 2, 4                                       */\n    /*  2                1, 2                                          */\n    /*  3                same as mode 2                                */\n    /*  4                1, 2, 5                                       */\n    /*  5                1, 2, 6                                       */\n    /*  6, 7             same as mode 2                                */\n\n    e1  = CEILING( x1 );\n    e2  = FLOOR  ( x2 );\n    pxl = e1;\n\n    if ( e1 > e2 )\n    {\n      Int  dropOutControl = left->flags & 7;\n\n\n      if ( e1 == e2 + ras.precision )\n      {\n        switch ( dropOutControl )\n        {\n        case 0: /* simple drop-outs including stubs */\n          pxl = e2;\n          break;\n\n        case 4: /* smart drop-outs including stubs */\n          pxl = FLOOR( ( x1 + x2 - 1 ) / 2 + ras.precision_half );\n          break;\n\n        case 1: /* simple drop-outs excluding stubs */\n        case 5: /* smart drop-outs excluding stubs  */\n\n          /* Drop-out Control Rules #4 and #6 */\n\n          /* The specification neither provides an exact definition */\n          /* of a `stub' nor gives exact rules to exclude them.     */\n          /*                                                        */\n          /* Here the constraints we use to recognize a stub.       */\n          /*                                                        */\n          /*  upper stub:                                           */\n          /*                                                        */\n          /*   - P_Left and P_Right are in the same contour         */\n          /*   - P_Right is the successor of P_Left in that contour */\n          /*   - y is the top of P_Left and P_Right                 */\n          /*                                                        */\n          /*  lower stub:                                           */\n          /*                                                        */\n          /*   - P_Left and P_Right are in the same contour         */\n          /*   - P_Left is the successor of P_Right in that contour */\n          /*   - y is the bottom of P_Left                          */\n          /*                                                        */\n          /* We draw a stub if the following constraints are met.   */\n          /*                                                        */\n          /*   - for an upper or lower stub, there is top or bottom */\n          /*     overshoot, respectively                            */\n          /*   - the covered interval is greater or equal to a half */\n          /*     pixel                                              */\n\n          /* upper stub test */\n          if ( left->next == right                &&\n               left->height <= 0                  &&\n               !( left->flags & Overshoot_Top   &&\n                  x2 - x1 >= ras.precision_half ) )\n            return;\n\n          /* lower stub test */\n          if ( right->next == left                 &&\n               left->start == y                    &&\n               !( left->flags & Overshoot_Bottom &&\n                  x2 - x1 >= ras.precision_half  ) )\n            return;\n\n          if ( dropOutControl == 1 )\n            pxl = e2;\n          else\n            pxl = FLOOR( ( x1 + x2 - 1 ) / 2 + ras.precision_half );\n          break;\n\n        default: /* modes 2, 3, 6, 7 */\n          return;  /* no drop-out control */\n        }\n\n        /* undocumented but confirmed: If the drop-out would result in a  */\n        /* pixel outside of the bounding box, use the pixel inside of the */\n        /* bounding box instead                                           */\n        if ( pxl < 0 )\n          pxl = e1;\n        else if ( TRUNC( pxl ) >= ras.bWidth )\n          pxl = e2;\n\n        /* check that the other pixel isn't set */\n        e1 = pxl == e1 ? e2 : e1;\n\n        e1 = TRUNC( e1 );\n\n        c1 = (Short)( e1 >> 3 );\n        f1 = (Short)( e1 &  7 );\n\n        if ( e1 >= 0 && e1 < ras.bWidth                      &&\n             ras.bTarget[ras.traceOfs + c1] & ( 0x80 >> f1 ) )\n          return;\n      }\n      else\n        return;\n    }\n\n    e1 = TRUNC( pxl );\n\n    if ( e1 >= 0 && e1 < ras.bWidth )\n    {\n      c1 = (Short)( e1 >> 3 );\n      f1 = (Short)( e1 & 7 );\n\n      if ( ras.gray_min_x > c1 )\n        ras.gray_min_x = c1;\n      if ( ras.gray_max_x < c1 )\n        ras.gray_max_x = c1;\n\n      ras.bTarget[ras.traceOfs + c1] |= (char)( 0x80 >> f1 );\n    }\n  }\n\n\n  static void\n  Vertical_Sweep_Step( RAS_ARG )\n  {\n    ras.traceOfs += ras.traceIncr;\n  }\n\n\n  /***********************************************************************/\n  /*                                                                     */\n  /*  Horizontal Sweep Procedure Set                                     */\n  /*                                                                     */\n  /*  These four routines are used during the horizontal black/white     */\n  /*  sweep phase by the generic Draw_Sweep() function.                  */\n  /*                                                                     */\n  /***********************************************************************/\n\n  static void\n  Horizontal_Sweep_Init( RAS_ARGS Short*  min,\n                                  Short*  max )\n  {\n    /* nothing, really */\n    FT_UNUSED_RASTER;\n    FT_UNUSED( min );\n    FT_UNUSED( max );\n  }\n\n\n  static void\n  Horizontal_Sweep_Span( RAS_ARGS Short       y,\n                                  FT_F26Dot6  x1,\n                                  FT_F26Dot6  x2,\n                                  PProfile    left,\n                                  PProfile    right )\n  {\n    FT_UNUSED( left );\n    FT_UNUSED( right );\n\n\n    if ( x2 - x1 < ras.precision )\n    {\n      Long  e1, e2;\n\n\n      e1 = CEILING( x1 );\n      e2 = FLOOR  ( x2 );\n\n      if ( e1 == e2 )\n      {\n        Byte   f1;\n        PByte  bits;\n\n\n        bits = ras.bTarget + ( y >> 3 );\n        f1   = (Byte)( 0x80 >> ( y & 7 ) );\n\n        e1 = TRUNC( e1 );\n\n        if ( e1 >= 0 && (ULong)e1 < ras.target.rows )\n        {\n          PByte  p;\n\n\n          p = bits - e1 * ras.target.pitch;\n          if ( ras.target.pitch > 0 )\n            p += ( ras.target.rows - 1 ) * ras.target.pitch;\n\n          p[0] |= f1;\n        }\n      }\n    }\n  }\n\n\n  static void\n  Horizontal_Sweep_Drop( RAS_ARGS Short       y,\n                                  FT_F26Dot6  x1,\n                                  FT_F26Dot6  x2,\n                                  PProfile    left,\n                                  PProfile    right )\n  {\n    Long   e1, e2, pxl;\n    PByte  bits;\n    Byte   f1;\n\n\n    /* During the horizontal sweep, we only take care of drop-outs */\n\n    /* e1     +       <-- pixel center */\n    /*        |                        */\n    /* x1  ---+-->    <-- contour      */\n    /*        |                        */\n    /*        |                        */\n    /* x2  <--+---    <-- contour      */\n    /*        |                        */\n    /*        |                        */\n    /* e2     +       <-- pixel center */\n\n    e1  = CEILING( x1 );\n    e2  = FLOOR  ( x2 );\n    pxl = e1;\n\n    if ( e1 > e2 )\n    {\n      Int  dropOutControl = left->flags & 7;\n\n\n      if ( e1 == e2 + ras.precision )\n      {\n        switch ( dropOutControl )\n        {\n        case 0: /* simple drop-outs including stubs */\n          pxl = e2;\n          break;\n\n        case 4: /* smart drop-outs including stubs */\n          pxl = FLOOR( ( x1 + x2 - 1 ) / 2 + ras.precision_half );\n          break;\n\n        case 1: /* simple drop-outs excluding stubs */\n        case 5: /* smart drop-outs excluding stubs  */\n          /* see Vertical_Sweep_Drop for details */\n\n          /* rightmost stub test */\n          if ( left->next == right                &&\n               left->height <= 0                  &&\n               !( left->flags & Overshoot_Top   &&\n                  x2 - x1 >= ras.precision_half ) )\n            return;\n\n          /* leftmost stub test */\n          if ( right->next == left                 &&\n               left->start == y                    &&\n               !( left->flags & Overshoot_Bottom &&\n                  x2 - x1 >= ras.precision_half  ) )\n            return;\n\n          if ( dropOutControl == 1 )\n            pxl = e2;\n          else\n            pxl = FLOOR( ( x1 + x2 - 1 ) / 2 + ras.precision_half );\n          break;\n\n        default: /* modes 2, 3, 6, 7 */\n          return;  /* no drop-out control */\n        }\n\n        /* undocumented but confirmed: If the drop-out would result in a  */\n        /* pixel outside of the bounding box, use the pixel inside of the */\n        /* bounding box instead                                           */\n        if ( pxl < 0 )\n          pxl = e1;\n        else if ( (ULong)( TRUNC( pxl ) ) >= ras.target.rows )\n          pxl = e2;\n\n        /* check that the other pixel isn't set */\n        e1 = pxl == e1 ? e2 : e1;\n\n        e1 = TRUNC( e1 );\n\n        bits = ras.bTarget + ( y >> 3 );\n        f1   = (Byte)( 0x80 >> ( y & 7 ) );\n\n        bits -= e1 * ras.target.pitch;\n        if ( ras.target.pitch > 0 )\n          bits += ( ras.target.rows - 1 ) * ras.target.pitch;\n\n        if ( e1 >= 0                     &&\n             (ULong)e1 < ras.target.rows &&\n             *bits & f1                  )\n          return;\n      }\n      else\n        return;\n    }\n\n    bits = ras.bTarget + ( y >> 3 );\n    f1   = (Byte)( 0x80 >> ( y & 7 ) );\n\n    e1 = TRUNC( pxl );\n\n    if ( e1 >= 0 && (ULong)e1 < ras.target.rows )\n    {\n      bits -= e1 * ras.target.pitch;\n      if ( ras.target.pitch > 0 )\n        bits += ( ras.target.rows - 1 ) * ras.target.pitch;\n\n      bits[0] |= f1;\n    }\n  }\n\n\n  static void\n  Horizontal_Sweep_Step( RAS_ARG )\n  {\n    /* Nothing, really */\n    FT_UNUSED_RASTER;\n  }\n\n\n#ifdef FT_RASTER_OPTION_ANTI_ALIASING\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  Vertical Gray Sweep Procedure Set                                    */\n  /*                                                                       */\n  /*  These two routines are used during the vertical gray-levels sweep    */\n  /*  phase by the generic Draw_Sweep() function.                          */\n  /*                                                                       */\n  /*  NOTES                                                                */\n  /*                                                                       */\n  /*  - The target pixmap's width *must* be a multiple of 4.               */\n  /*                                                                       */\n  /*  - You have to use the function Vertical_Sweep_Span() for the gray    */\n  /*    span call.                                                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n  static void\n  Vertical_Gray_Sweep_Init( RAS_ARGS Short*  min,\n                                     Short*  max )\n  {\n    Long  pitch, byte_len;\n\n\n    *min = *min & -2;\n    *max = ( *max + 3 ) & -2;\n\n    ras.traceOfs  = 0;\n    pitch         = ras.target.pitch;\n    byte_len      = -pitch;\n    ras.traceIncr = (Short)byte_len;\n    ras.traceG    = ( *min / 2 ) * byte_len;\n\n    if ( pitch > 0 )\n    {\n      ras.traceG += ( ras.target.rows - 1 ) * pitch;\n      byte_len    = -byte_len;\n    }\n\n    ras.gray_min_x =  (Short)byte_len;\n    ras.gray_max_x = -(Short)byte_len;\n  }\n\n\n  static void\n  Vertical_Gray_Sweep_Step( RAS_ARG )\n  {\n    short*  count = (short*)count_table;\n    Byte*   grays;\n\n\n    ras.traceOfs += ras.gray_width;\n\n    if ( ras.traceOfs > ras.gray_width )\n    {\n      PByte  pix;\n\n\n      pix   = ras.gTarget + ras.traceG + ras.gray_min_x * 4;\n      grays = ras.grays;\n\n      if ( ras.gray_max_x >= 0 )\n      {\n        Long  last_pixel = ras.target.width - 1;\n        Int   last_cell  = last_pixel >> 2;\n        Int   last_bit   = last_pixel & 3;\n        Bool  over       = 0;\n\n        Int    c1, c2;\n        PByte  bit, bit2;\n\n\n        if ( ras.gray_max_x >= last_cell && last_bit != 3 )\n        {\n          ras.gray_max_x = last_cell - 1;\n          over = 1;\n        }\n\n        if ( ras.gray_min_x < 0 )\n          ras.gray_min_x = 0;\n\n        bit  = ras.bTarget + ras.gray_min_x;\n        bit2 = bit + ras.gray_width;\n\n        c1 = ras.gray_max_x - ras.gray_min_x;\n\n        while ( c1 >= 0 )\n        {\n          c2 = count[*bit] + count[*bit2];\n\n          if ( c2 )\n          {\n            pix[0] = grays[(c2 >> 12) & 0x000F];\n            pix[1] = grays[(c2 >> 8 ) & 0x000F];\n            pix[2] = grays[(c2 >> 4 ) & 0x000F];\n            pix[3] = grays[ c2        & 0x000F];\n\n            *bit  = 0;\n            *bit2 = 0;\n          }\n\n          bit++;\n          bit2++;\n          pix += 4;\n          c1--;\n        }\n\n        if ( over )\n        {\n          c2 = count[*bit] + count[*bit2];\n          if ( c2 )\n          {\n            switch ( last_bit )\n            {\n            case 2:\n              pix[2] = grays[(c2 >> 4 ) & 0x000F];\n            case 1:\n              pix[1] = grays[(c2 >> 8 ) & 0x000F];\n            default:\n              pix[0] = grays[(c2 >> 12) & 0x000F];\n            }\n\n            *bit  = 0;\n            *bit2 = 0;\n          }\n        }\n      }\n\n      ras.traceOfs = 0;\n      ras.traceG  += ras.traceIncr;\n\n      ras.gray_min_x =  32000;\n      ras.gray_max_x = -32000;\n    }\n  }\n\n\n  static void\n  Horizontal_Gray_Sweep_Span( RAS_ARGS Short       y,\n                                       FT_F26Dot6  x1,\n                                       FT_F26Dot6  x2,\n                                       PProfile    left,\n                                       PProfile    right )\n  {\n    /* nothing, really */\n    FT_UNUSED_RASTER;\n    FT_UNUSED( y );\n    FT_UNUSED( x1 );\n    FT_UNUSED( x2 );\n    FT_UNUSED( left );\n    FT_UNUSED( right );\n  }\n\n\n  static void\n  Horizontal_Gray_Sweep_Drop( RAS_ARGS Short       y,\n                                       FT_F26Dot6  x1,\n                                       FT_F26Dot6  x2,\n                                       PProfile    left,\n                                       PProfile    right )\n  {\n    Long   e1, e2;\n    PByte  pixel;\n\n\n    /* During the horizontal sweep, we only take care of drop-outs */\n\n    e1 = CEILING( x1 );\n    e2 = FLOOR  ( x2 );\n\n    if ( e1 > e2 )\n    {\n      Int  dropOutControl = left->flags & 7;\n\n\n      if ( e1 == e2 + ras.precision )\n      {\n        switch ( dropOutControl )\n        {\n        case 0: /* simple drop-outs including stubs */\n          e1 = e2;\n          break;\n\n        case 4: /* smart drop-outs including stubs */\n          e1 = FLOOR( ( x1 + x2 - 1 ) / 2 + ras.precision_half );\n          break;\n\n        case 1: /* simple drop-outs excluding stubs */\n        case 5: /* smart drop-outs excluding stubs  */\n          /* see Vertical_Sweep_Drop for details */\n\n          /* rightmost stub test */\n          if ( left->next == right && left->height <= 0 )\n            return;\n\n          /* leftmost stub test */\n          if ( right->next == left && left->start == y )\n            return;\n\n          if ( dropOutControl == 1 )\n            e1 = e2;\n          else\n            e1 = FLOOR( ( x1 + x2 - 1 ) / 2 + ras.precision_half );\n\n          break;\n\n        default: /* modes 2, 3, 6, 7 */\n          return;  /* no drop-out control */\n        }\n      }\n      else\n        return;\n    }\n\n    if ( e1 >= 0 )\n    {\n      Byte  color;\n\n\n      if ( x2 - x1 >= ras.precision_half )\n        color = ras.grays[2];\n      else\n        color = ras.grays[1];\n\n      e1 = TRUNC( e1 ) / 2;\n      if ( e1 < ras.target.rows )\n      {\n        pixel = ras.gTarget - e1 * ras.target.pitch + y / 2;\n        if ( ras.target.pitch > 0 )\n          pixel += ( ras.target.rows - 1 ) * ras.target.pitch;\n\n        if ( pixel[0] == ras.grays[0] )\n          pixel[0] = color;\n      }\n    }\n  }\n\n\n#endif /* FT_RASTER_OPTION_ANTI_ALIASING */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  Generic Sweep Drawing routine                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n  static Bool\n  Draw_Sweep( RAS_ARG )\n  {\n    Short         y, y_change, y_height;\n\n    PProfile      P, Q, P_Left, P_Right;\n\n    Short         min_Y, max_Y, top, bottom, dropouts;\n\n    Long          x1, x2, xs, e1, e2;\n\n    TProfileList  waiting;\n    TProfileList  draw_left, draw_right;\n\n\n    /* initialize empty linked lists */\n\n    Init_Linked( &waiting );\n\n    Init_Linked( &draw_left  );\n    Init_Linked( &draw_right );\n\n    /* first, compute min and max Y */\n\n    P     = ras.fProfile;\n    max_Y = (Short)TRUNC( ras.minY );\n    min_Y = (Short)TRUNC( ras.maxY );\n\n    while ( P )\n    {\n      Q = P->link;\n\n      bottom = (Short)P->start;\n      top    = (Short)( P->start + P->height - 1 );\n\n      if ( min_Y > bottom )\n        min_Y = bottom;\n      if ( max_Y < top )\n        max_Y = top;\n\n      P->X = 0;\n      InsNew( &waiting, P );\n\n      P = Q;\n    }\n\n    /* check the Y-turns */\n    if ( ras.numTurns == 0 )\n    {\n      ras.error = FT_THROW( Invalid );\n      return FAILURE;\n    }\n\n    /* now initialize the sweep */\n\n    ras.Proc_Sweep_Init( RAS_VARS &min_Y, &max_Y );\n\n    /* then compute the distance of each profile from min_Y */\n\n    P = waiting;\n\n    while ( P )\n    {\n      P->countL = (UShort)( P->start - min_Y );\n      P = P->link;\n    }\n\n    /* let's go */\n\n    y        = min_Y;\n    y_height = 0;\n\n    if ( ras.numTurns > 0                     &&\n         ras.sizeBuff[-ras.numTurns] == min_Y )\n      ras.numTurns--;\n\n    while ( ras.numTurns > 0 )\n    {\n      /* check waiting list for new activations */\n\n      P = waiting;\n\n      while ( P )\n      {\n        Q = P->link;\n        P->countL -= y_height;\n        if ( P->countL == 0 )\n        {\n          DelOld( &waiting, P );\n\n          if ( P->flags & Flow_Up )\n            InsNew( &draw_left,  P );\n          else\n            InsNew( &draw_right, P );\n        }\n\n        P = Q;\n      }\n\n      /* sort the drawing lists */\n\n      Sort( &draw_left );\n      Sort( &draw_right );\n\n      y_change = (Short)ras.sizeBuff[-ras.numTurns--];\n      y_height = (Short)( y_change - y );\n\n      while ( y < y_change )\n      {\n        /* let's trace */\n\n        dropouts = 0;\n\n        P_Left  = draw_left;\n        P_Right = draw_right;\n\n        while ( P_Left )\n        {\n          x1 = P_Left ->X;\n          x2 = P_Right->X;\n\n          if ( x1 > x2 )\n          {\n            xs = x1;\n            x1 = x2;\n            x2 = xs;\n          }\n\n          e1 = FLOOR( x1 );\n          e2 = CEILING( x2 );\n\n          if ( x2 - x1 <= ras.precision &&\n               e1 != x1 && e2 != x2     )\n          {\n            if ( e1 > e2 || e2 == e1 + ras.precision )\n            {\n              Int  dropOutControl = P_Left->flags & 7;\n\n\n              if ( dropOutControl != 2 )\n              {\n                /* a drop-out was detected */\n\n                P_Left ->X = x1;\n                P_Right->X = x2;\n\n                /* mark profile for drop-out processing */\n                P_Left->countL = 1;\n                dropouts++;\n              }\n\n              goto Skip_To_Next;\n            }\n          }\n\n          ras.Proc_Sweep_Span( RAS_VARS y, x1, x2, P_Left, P_Right );\n\n        Skip_To_Next:\n\n          P_Left  = P_Left->link;\n          P_Right = P_Right->link;\n        }\n\n        /* handle drop-outs _after_ the span drawing --       */\n        /* drop-out processing has been moved out of the loop */\n        /* for performance tuning                             */\n        if ( dropouts > 0 )\n          goto Scan_DropOuts;\n\n      Next_Line:\n\n        ras.Proc_Sweep_Step( RAS_VAR );\n\n        y++;\n\n        if ( y < y_change )\n        {\n          Sort( &draw_left  );\n          Sort( &draw_right );\n        }\n      }\n\n      /* now finalize the profiles that need it */\n\n      P = draw_left;\n      while ( P )\n      {\n        Q = P->link;\n        if ( P->height == 0 )\n          DelOld( &draw_left, P );\n        P = Q;\n      }\n\n      P = draw_right;\n      while ( P )\n      {\n        Q = P->link;\n        if ( P->height == 0 )\n          DelOld( &draw_right, P );\n        P = Q;\n      }\n    }\n\n    /* for gray-scaling, flush the bitmap scanline cache */\n    while ( y <= max_Y )\n    {\n      ras.Proc_Sweep_Step( RAS_VAR );\n      y++;\n    }\n\n    return SUCCESS;\n\n  Scan_DropOuts:\n\n    P_Left  = draw_left;\n    P_Right = draw_right;\n\n    while ( P_Left )\n    {\n      if ( P_Left->countL )\n      {\n        P_Left->countL = 0;\n#if 0\n        dropouts--;  /* -- this is useful when debugging only */\n#endif\n        ras.Proc_Sweep_Drop( RAS_VARS y,\n                                      P_Left->X,\n                                      P_Right->X,\n                                      P_Left,\n                                      P_Right );\n      }\n\n      P_Left  = P_Left->link;\n      P_Right = P_Right->link;\n    }\n\n    goto Next_Line;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Render_Single_Pass                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Perform one sweep with sub-banding.                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    flipped :: If set, flip the direction of the outline.              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Renderer error code.                                               */\n  /*                                                                       */\n  static int\n  Render_Single_Pass( RAS_ARGS Bool  flipped )\n  {\n    Short  i, j, k;\n\n\n    while ( ras.band_top >= 0 )\n    {\n      ras.maxY = (Long)ras.band_stack[ras.band_top].y_max * ras.precision;\n      ras.minY = (Long)ras.band_stack[ras.band_top].y_min * ras.precision;\n\n      ras.top = ras.buff;\n\n      ras.error = Raster_Err_None;\n\n      if ( Convert_Glyph( RAS_VARS flipped ) )\n      {\n        if ( ras.error != Raster_Err_Overflow )\n          return FAILURE;\n\n        ras.error = Raster_Err_None;\n\n        /* sub-banding */\n\n#ifdef DEBUG_RASTER\n        ClearBand( RAS_VARS TRUNC( ras.minY ), TRUNC( ras.maxY ) );\n#endif\n\n        i = ras.band_stack[ras.band_top].y_min;\n        j = ras.band_stack[ras.band_top].y_max;\n\n        k = (Short)( ( i + j ) / 2 );\n\n        if ( ras.band_top >= 7 || k < i )\n        {\n          ras.band_top = 0;\n          ras.error    = FT_THROW( Invalid );\n\n          return ras.error;\n        }\n\n        ras.band_stack[ras.band_top + 1].y_min = k;\n        ras.band_stack[ras.band_top + 1].y_max = j;\n\n        ras.band_stack[ras.band_top].y_max = (Short)( k - 1 );\n\n        ras.band_top++;\n      }\n      else\n      {\n        if ( ras.fProfile )\n          if ( Draw_Sweep( RAS_VAR ) )\n             return ras.error;\n        ras.band_top--;\n      }\n    }\n\n    return SUCCESS;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Render_Glyph                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Render a glyph in a bitmap.  Sub-banding if needed.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  Render_Glyph( RAS_ARG )\n  {\n    FT_Error  error;\n\n\n    Set_High_Precision( RAS_VARS ras.outline.flags &\n                                 FT_OUTLINE_HIGH_PRECISION );\n    ras.scale_shift = ras.precision_shift;\n\n    if ( ras.outline.flags & FT_OUTLINE_IGNORE_DROPOUTS )\n      ras.dropOutControl = 2;\n    else\n    {\n      if ( ras.outline.flags & FT_OUTLINE_SMART_DROPOUTS )\n        ras.dropOutControl = 4;\n      else\n        ras.dropOutControl = 0;\n\n      if ( !( ras.outline.flags & FT_OUTLINE_INCLUDE_STUBS ) )\n        ras.dropOutControl += 1;\n    }\n\n    ras.second_pass = (FT_Byte)( !( ras.outline.flags &\n                                    FT_OUTLINE_SINGLE_PASS ) );\n\n    /* Vertical Sweep */\n    ras.Proc_Sweep_Init = Vertical_Sweep_Init;\n    ras.Proc_Sweep_Span = Vertical_Sweep_Span;\n    ras.Proc_Sweep_Drop = Vertical_Sweep_Drop;\n    ras.Proc_Sweep_Step = Vertical_Sweep_Step;\n\n    ras.band_top            = 0;\n    ras.band_stack[0].y_min = 0;\n    ras.band_stack[0].y_max = (short)( ras.target.rows - 1 );\n\n    ras.bWidth  = (unsigned short)ras.target.width;\n    ras.bTarget = (Byte*)ras.target.buffer;\n\n    if ( ( error = Render_Single_Pass( RAS_VARS 0 ) ) != 0 )\n      return error;\n\n    /* Horizontal Sweep */\n    if ( ras.second_pass && ras.dropOutControl != 2 )\n    {\n      ras.Proc_Sweep_Init = Horizontal_Sweep_Init;\n      ras.Proc_Sweep_Span = Horizontal_Sweep_Span;\n      ras.Proc_Sweep_Drop = Horizontal_Sweep_Drop;\n      ras.Proc_Sweep_Step = Horizontal_Sweep_Step;\n\n      ras.band_top            = 0;\n      ras.band_stack[0].y_min = 0;\n      ras.band_stack[0].y_max = (short)( ras.target.width - 1 );\n\n      if ( ( error = Render_Single_Pass( RAS_VARS 1 ) ) != 0 )\n        return error;\n    }\n\n    return Raster_Err_None;\n  }\n\n\n#ifdef FT_RASTER_OPTION_ANTI_ALIASING\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Render_Gray_Glyph                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Render a glyph with grayscaling.  Sub-banding if needed.           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  Render_Gray_Glyph( RAS_ARG )\n  {\n    Long      pixel_width;\n    FT_Error  error;\n\n\n    Set_High_Precision( RAS_VARS ras.outline.flags &\n                                 FT_OUTLINE_HIGH_PRECISION );\n    ras.scale_shift = ras.precision_shift + 1;\n\n    if ( ras.outline.flags & FT_OUTLINE_IGNORE_DROPOUTS )\n      ras.dropOutControl = 2;\n    else\n    {\n      if ( ras.outline.flags & FT_OUTLINE_SMART_DROPOUTS )\n        ras.dropOutControl = 4;\n      else\n        ras.dropOutControl = 0;\n\n      if ( !( ras.outline.flags & FT_OUTLINE_INCLUDE_STUBS ) )\n        ras.dropOutControl += 1;\n    }\n\n    ras.second_pass = !( ras.outline.flags & FT_OUTLINE_SINGLE_PASS );\n\n    /* Vertical Sweep */\n\n    ras.band_top            = 0;\n    ras.band_stack[0].y_min = 0;\n    ras.band_stack[0].y_max = 2 * ras.target.rows - 1;\n\n    ras.bWidth  = ras.gray_width;\n    pixel_width = 2 * ( ( ras.target.width + 3 ) >> 2 );\n\n    if ( ras.bWidth > pixel_width )\n      ras.bWidth = pixel_width;\n\n    ras.bWidth  = ras.bWidth * 8;\n    ras.bTarget = (Byte*)ras.gray_lines;\n    ras.gTarget = (Byte*)ras.target.buffer;\n\n    ras.Proc_Sweep_Init = Vertical_Gray_Sweep_Init;\n    ras.Proc_Sweep_Span = Vertical_Sweep_Span;\n    ras.Proc_Sweep_Drop = Vertical_Sweep_Drop;\n    ras.Proc_Sweep_Step = Vertical_Gray_Sweep_Step;\n\n    error = Render_Single_Pass( RAS_VARS 0 );\n    if ( error )\n      return error;\n\n    /* Horizontal Sweep */\n    if ( ras.second_pass && ras.dropOutControl != 2 )\n    {\n      ras.Proc_Sweep_Init = Horizontal_Sweep_Init;\n      ras.Proc_Sweep_Span = Horizontal_Gray_Sweep_Span;\n      ras.Proc_Sweep_Drop = Horizontal_Gray_Sweep_Drop;\n      ras.Proc_Sweep_Step = Horizontal_Sweep_Step;\n\n      ras.band_top            = 0;\n      ras.band_stack[0].y_min = 0;\n      ras.band_stack[0].y_max = ras.target.width * 2 - 1;\n\n      error = Render_Single_Pass( RAS_VARS 1 );\n      if ( error )\n        return error;\n    }\n\n    return Raster_Err_None;\n  }\n\n#else /* !FT_RASTER_OPTION_ANTI_ALIASING */\n\n  FT_LOCAL_DEF( FT_Error )\n  Render_Gray_Glyph( RAS_ARG )\n  {\n    FT_UNUSED_RASTER;\n\n    return FT_THROW( Unsupported );\n  }\n\n#endif /* !FT_RASTER_OPTION_ANTI_ALIASING */\n\n\n  static void\n  ft_black_init( black_PRaster  raster )\n  {\n#ifdef FT_RASTER_OPTION_ANTI_ALIASING\n    FT_UInt  n;\n\n\n    /* set default 5-levels gray palette */\n    for ( n = 0; n < 5; n++ )\n      raster->grays[n] = n * 255 / 4;\n\n    raster->gray_width = RASTER_GRAY_LINES / 2;\n#else\n    FT_UNUSED( raster );\n#endif\n  }\n\n\n  /**** RASTER OBJECT CREATION: In standalone mode, we simply use *****/\n  /****                         a static object.                  *****/\n\n\n#ifdef _STANDALONE_\n\n\n  static int\n  ft_black_new( void*       memory,\n                FT_Raster  *araster )\n  {\n     static black_TRaster  the_raster;\n     FT_UNUSED( memory );\n\n\n     *araster = (FT_Raster)&the_raster;\n     FT_MEM_ZERO( &the_raster, sizeof ( the_raster ) );\n     ft_black_init( &the_raster );\n\n     return 0;\n  }\n\n\n  static void\n  ft_black_done( FT_Raster  raster )\n  {\n    /* nothing */\n    FT_UNUSED( raster );\n  }\n\n\n#else /* !_STANDALONE_ */\n\n\n  static int\n  ft_black_new( FT_Memory       memory,\n                black_PRaster  *araster )\n  {\n    FT_Error       error;\n    black_PRaster  raster = NULL;\n\n\n    *araster = 0;\n    if ( !FT_NEW( raster ) )\n    {\n      raster->memory = memory;\n      ft_black_init( raster );\n\n      *araster = raster;\n    }\n\n    return error;\n  }\n\n\n  static void\n  ft_black_done( black_PRaster  raster )\n  {\n    FT_Memory  memory = (FT_Memory)raster->memory;\n\n\n    FT_FREE( raster );\n  }\n\n\n#endif /* !_STANDALONE_ */\n\n\n  static void\n  ft_black_reset( black_PRaster  raster,\n                  char*          pool_base,\n                  long           pool_size )\n  {\n    if ( raster )\n    {\n      if ( pool_base && pool_size >= (long)sizeof ( black_TWorker ) + 2048 )\n      {\n        black_PWorker  worker = (black_PWorker)pool_base;\n\n\n        raster->buffer      = pool_base + ( ( sizeof ( *worker ) + 7 ) & ~7 );\n        raster->buffer_size = (long)( pool_base + pool_size -\n                                        (char*)raster->buffer );\n        raster->worker      = worker;\n      }\n      else\n      {\n        raster->buffer      = NULL;\n        raster->buffer_size = 0;\n        raster->worker      = NULL;\n      }\n    }\n  }\n\n\n  static int\n  ft_black_set_mode( black_PRaster  raster,\n                     unsigned long  mode,\n                     const char*    palette )\n  {\n#ifdef FT_RASTER_OPTION_ANTI_ALIASING\n\n    if ( mode == FT_MAKE_TAG( 'p', 'a', 'l', '5' ) )\n    {\n      /* set 5-levels gray palette */\n      raster->grays[0] = palette[0];\n      raster->grays[1] = palette[1];\n      raster->grays[2] = palette[2];\n      raster->grays[3] = palette[3];\n      raster->grays[4] = palette[4];\n    }\n\n#else\n\n    FT_UNUSED( raster );\n    FT_UNUSED( mode );\n    FT_UNUSED( palette );\n\n#endif\n\n    return 0;\n  }\n\n\n  static int\n  ft_black_render( black_PRaster            raster,\n                   const FT_Raster_Params*  params )\n  {\n    const FT_Outline*  outline    = (const FT_Outline*)params->source;\n    const FT_Bitmap*   target_map = params->target;\n    black_PWorker      worker;\n\n\n    if ( !raster || !raster->buffer || !raster->buffer_size )\n      return FT_THROW( Not_Ini );\n\n    if ( !outline )\n      return FT_THROW( Invalid );\n\n    /* return immediately if the outline is empty */\n    if ( outline->n_points == 0 || outline->n_contours <= 0 )\n      return Raster_Err_None;\n\n    if ( !outline->contours || !outline->points )\n      return FT_THROW( Invalid );\n\n    if ( outline->n_points !=\n           outline->contours[outline->n_contours - 1] + 1 )\n      return FT_THROW( Invalid );\n\n    worker = raster->worker;\n\n    /* this version of the raster does not support direct rendering, sorry */\n    if ( params->flags & FT_RASTER_FLAG_DIRECT )\n      return FT_THROW( Unsupported );\n\n    if ( !target_map )\n      return FT_THROW( Invalid );\n\n    /* nothing to do */\n    if ( !target_map->width || !target_map->rows )\n      return Raster_Err_None;\n\n    if ( !target_map->buffer )\n      return FT_THROW( Invalid );\n\n    ras.outline = *outline;\n    ras.target  = *target_map;\n\n    worker->buff       = (PLong) raster->buffer;\n    worker->sizeBuff   = worker->buff +\n                           raster->buffer_size / sizeof ( Long );\n#ifdef FT_RASTER_OPTION_ANTI_ALIASING\n    worker->grays      = raster->grays;\n    worker->gray_width = raster->gray_width;\n\n    FT_MEM_ZERO( worker->gray_lines, worker->gray_width * 2 );\n#endif\n\n    return ( params->flags & FT_RASTER_FLAG_AA )\n           ? Render_Gray_Glyph( RAS_VAR )\n           : Render_Glyph( RAS_VAR );\n  }\n\n\n  FT_DEFINE_RASTER_FUNCS( ft_standard_raster,\n    FT_GLYPH_FORMAT_OUTLINE,\n    (FT_Raster_New_Func)     ft_black_new,\n    (FT_Raster_Reset_Func)   ft_black_reset,\n    (FT_Raster_Set_Mode_Func)ft_black_set_mode,\n    (FT_Raster_Render_Func)  ft_black_render,\n    (FT_Raster_Done_Func)    ft_black_done\n  )\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/raster/ftraster.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftraster.h                                                             */\n/*                                                                         */\n/*    The FreeType glyph rasterizer (specification).                       */\n/*                                                                         */\n/*  Copyright 1996-2001 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used        */\n/*  modified and distributed under the terms of the FreeType project       */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTRASTER_H__\n#define __FTRASTER_H__\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_IMAGE_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Uncomment the following line if you are using ftraster.c as a         */\n  /* standalone module, fully independent of FreeType.                     */\n  /*                                                                       */\n/* #define _STANDALONE_ */\n\n  FT_EXPORT_VAR( const FT_Raster_Funcs )  ft_standard_raster;\n\n\nFT_END_HEADER\n\n#endif /* __FTRASTER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/raster/ftrend1.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftrend1.c                                                              */\n/*                                                                         */\n/*    The FreeType glyph rasterizer interface (body).                      */\n/*                                                                         */\n/*  Copyright 1996-2003, 2005, 2006, 2011, 2013 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_OUTLINE_H\n#include \"ftrend1.h\"\n#include \"ftraster.h\"\n#include \"rastpic.h\"\n\n#include \"rasterrs.h\"\n\n\n  /* initialize renderer -- init its raster */\n  static FT_Error\n  ft_raster1_init( FT_Renderer  render )\n  {\n    FT_Library  library = FT_MODULE_LIBRARY( render );\n\n\n    render->clazz->raster_class->raster_reset( render->raster,\n                                               library->raster_pool,\n                                               library->raster_pool_size );\n\n    return FT_Err_Ok;\n  }\n\n\n  /* set render-specific mode */\n  static FT_Error\n  ft_raster1_set_mode( FT_Renderer  render,\n                       FT_ULong     mode_tag,\n                       FT_Pointer   data )\n  {\n    /* we simply pass it to the raster */\n    return render->clazz->raster_class->raster_set_mode( render->raster,\n                                                         mode_tag,\n                                                         data );\n  }\n\n\n  /* transform a given glyph image */\n  static FT_Error\n  ft_raster1_transform( FT_Renderer       render,\n                        FT_GlyphSlot      slot,\n                        const FT_Matrix*  matrix,\n                        const FT_Vector*  delta )\n  {\n    FT_Error error = FT_Err_Ok;\n\n\n    if ( slot->format != render->glyph_format )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    if ( matrix )\n      FT_Outline_Transform( &slot->outline, matrix );\n\n    if ( delta )\n      FT_Outline_Translate( &slot->outline, delta->x, delta->y );\n\n  Exit:\n    return error;\n  }\n\n\n  /* return the glyph's control box */\n  static void\n  ft_raster1_get_cbox( FT_Renderer   render,\n                       FT_GlyphSlot  slot,\n                       FT_BBox*      cbox )\n  {\n    FT_MEM_ZERO( cbox, sizeof ( *cbox ) );\n\n    if ( slot->format == render->glyph_format )\n      FT_Outline_Get_CBox( &slot->outline, cbox );\n  }\n\n\n  /* convert a slot's glyph image into a bitmap */\n  static FT_Error\n  ft_raster1_render( FT_Renderer       render,\n                     FT_GlyphSlot      slot,\n                     FT_Render_Mode    mode,\n                     const FT_Vector*  origin )\n  {\n    FT_Error     error;\n    FT_Outline*  outline;\n    FT_BBox      cbox;\n    FT_UInt      width, height, pitch;\n    FT_Bitmap*   bitmap;\n    FT_Memory    memory;\n\n    FT_Raster_Params  params;\n\n\n    /* check glyph image format */\n    if ( slot->format != render->glyph_format )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    /* check rendering mode */\n#ifndef FT_CONFIG_OPTION_PIC\n    if ( mode != FT_RENDER_MODE_MONO )\n    {\n      /* raster1 is only capable of producing monochrome bitmaps */\n      if ( render->clazz == &ft_raster1_renderer_class )\n        return FT_THROW( Cannot_Render_Glyph );\n    }\n    else\n    {\n      /* raster5 is only capable of producing 5-gray-levels bitmaps */\n      if ( render->clazz == &ft_raster5_renderer_class )\n        return FT_THROW( Cannot_Render_Glyph );\n    }\n#else /* FT_CONFIG_OPTION_PIC */\n    /* When PIC is enabled, we cannot get to the class object      */\n    /* so instead we check the final character in the class name   */\n    /* (\"raster5\" or \"raster1\"). Yes this is a hack.               */\n    /* The \"correct\" thing to do is have different render function */\n    /* for each of the classes.                                    */\n    if ( mode != FT_RENDER_MODE_MONO )\n    {\n      /* raster1 is only capable of producing monochrome bitmaps */\n      if ( render->clazz->root.module_name[6] == '1' )\n        return FT_THROW( Cannot_Render_Glyph );\n    }\n    else\n    {\n      /* raster5 is only capable of producing 5-gray-levels bitmaps */\n      if ( render->clazz->root.module_name[6] == '5' )\n        return FT_THROW( Cannot_Render_Glyph );\n    }\n#endif /* FT_CONFIG_OPTION_PIC */\n\n    outline = &slot->outline;\n\n    /* translate the outline to the new origin if needed */\n    if ( origin )\n      FT_Outline_Translate( outline, origin->x, origin->y );\n\n    /* compute the control box, and grid fit it */\n    FT_Outline_Get_CBox( outline, &cbox );\n\n    /* undocumented but confirmed: bbox values get rounded */\n#if 1\n    cbox.xMin = FT_PIX_ROUND( cbox.xMin );\n    cbox.yMin = FT_PIX_ROUND( cbox.yMin );\n    cbox.xMax = FT_PIX_ROUND( cbox.xMax );\n    cbox.yMax = FT_PIX_ROUND( cbox.yMax );\n#else\n    cbox.xMin = FT_PIX_FLOOR( cbox.xMin );\n    cbox.yMin = FT_PIX_FLOOR( cbox.yMin );\n    cbox.xMax = FT_PIX_CEIL( cbox.xMax );\n    cbox.yMax = FT_PIX_CEIL( cbox.yMax );\n#endif\n\n    width  = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 );\n    height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 );\n\n    if ( width > FT_USHORT_MAX || height > FT_USHORT_MAX )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    bitmap = &slot->bitmap;\n    memory = render->root.memory;\n\n    /* release old bitmap buffer */\n    if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )\n    {\n      FT_FREE( bitmap->buffer );\n      slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;\n    }\n\n    /* allocate new one, depends on pixel format */\n    if ( !( mode & FT_RENDER_MODE_MONO ) )\n    {\n      /* we pad to 32 bits, only for backwards compatibility with FT 1.x */\n      pitch              = FT_PAD_CEIL( width, 4 );\n      bitmap->pixel_mode = FT_PIXEL_MODE_GRAY;\n      bitmap->num_grays  = 256;\n    }\n    else\n    {\n      pitch              = ( ( width + 15 ) >> 4 ) << 1;\n      bitmap->pixel_mode = FT_PIXEL_MODE_MONO;\n    }\n\n    bitmap->width = width;\n    bitmap->rows  = height;\n    bitmap->pitch = pitch;\n\n    if ( FT_ALLOC_MULT( bitmap->buffer, pitch, height ) )\n      goto Exit;\n\n    slot->internal->flags |= FT_GLYPH_OWN_BITMAP;\n\n    /* translate outline to render it into the bitmap */\n    FT_Outline_Translate( outline, -cbox.xMin, -cbox.yMin );\n\n    /* set up parameters */\n    params.target = bitmap;\n    params.source = outline;\n    params.flags  = 0;\n\n    if ( bitmap->pixel_mode == FT_PIXEL_MODE_GRAY )\n      params.flags |= FT_RASTER_FLAG_AA;\n\n    /* render outline into the bitmap */\n    error = render->raster_render( render->raster, &params );\n\n    FT_Outline_Translate( outline, cbox.xMin, cbox.yMin );\n\n    if ( error )\n      goto Exit;\n\n    slot->format      = FT_GLYPH_FORMAT_BITMAP;\n    slot->bitmap_left = (FT_Int)( cbox.xMin >> 6 );\n    slot->bitmap_top  = (FT_Int)( cbox.yMax >> 6 );\n\n  Exit:\n    return error;\n  }\n\n\n  FT_DEFINE_RENDERER( ft_raster1_renderer_class,\n\n      FT_MODULE_RENDERER,\n      sizeof ( FT_RendererRec ),\n\n      \"raster1\",\n      0x10000L,\n      0x20000L,\n\n      0,    /* module specific interface */\n\n      (FT_Module_Constructor)ft_raster1_init,\n      (FT_Module_Destructor) 0,\n      (FT_Module_Requester)  0\n    ,\n\n    FT_GLYPH_FORMAT_OUTLINE,\n\n    (FT_Renderer_RenderFunc)   ft_raster1_render,\n    (FT_Renderer_TransformFunc)ft_raster1_transform,\n    (FT_Renderer_GetCBoxFunc)  ft_raster1_get_cbox,\n    (FT_Renderer_SetModeFunc)  ft_raster1_set_mode,\n\n    (FT_Raster_Funcs*)    &FT_STANDARD_RASTER_GET\n  )\n\n\n  /* This renderer is _NOT_ part of the default modules; you will need */\n  /* to register it by hand in your application.  It should only be    */\n  /* used for backwards-compatibility with FT 1.x anyway.              */\n  /*                                                                   */\n  FT_DEFINE_RENDERER( ft_raster5_renderer_class,\n\n      FT_MODULE_RENDERER,\n      sizeof ( FT_RendererRec ),\n\n      \"raster5\",\n      0x10000L,\n      0x20000L,\n\n      0,    /* module specific interface */\n\n      (FT_Module_Constructor)ft_raster1_init,\n      (FT_Module_Destructor) 0,\n      (FT_Module_Requester)  0\n    ,\n\n    FT_GLYPH_FORMAT_OUTLINE,\n\n    (FT_Renderer_RenderFunc)   ft_raster1_render,\n    (FT_Renderer_TransformFunc)ft_raster1_transform,\n    (FT_Renderer_GetCBoxFunc)  ft_raster1_get_cbox,\n    (FT_Renderer_SetModeFunc)  ft_raster1_set_mode,\n\n    (FT_Raster_Funcs*)    &FT_STANDARD_RASTER_GET\n  )\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/raster/ftrend1.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftrend1.h                                                              */\n/*                                                                         */\n/*    The FreeType glyph rasterizer interface (specification).             */\n/*                                                                         */\n/*  Copyright 1996-2001 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTREND1_H__\n#define __FTREND1_H__\n\n\n#include <ft2build.h>\n#include FT_RENDER_H\n\n\nFT_BEGIN_HEADER\n\n\n  FT_DECLARE_RENDERER( ft_raster1_renderer_class )\n\n  /* this renderer is _NOT_ part of the default modules, you'll need */\n  /* to register it by hand in your application.  It should only be  */\n  /* used for backwards-compatibility with FT 1.x anyway.            */\n  /*                                                                 */\n  FT_DECLARE_RENDERER( ft_raster5_renderer_class )\n\n\nFT_END_HEADER\n\n#endif /* __FTREND1_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/raster/module.mk",
    "content": "#\n# FreeType 2 renderer module definition\n#\n\n\n# Copyright 1996-2000, 2006 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\nFTMODULE_H_COMMANDS += RASTER_MODULE\n\ndefine RASTER_MODULE\n$(OPEN_DRIVER) FT_Renderer_Class, ft_raster1_renderer_class $(CLOSE_DRIVER)\n$(ECHO_DRIVER)raster    $(ECHO_DRIVER_DESC)monochrome bitmap renderer$(ECHO_DRIVER_DONE)\nendef\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/raster/raster.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  raster.c                                                               */\n/*                                                                         */\n/*    FreeType monochrome rasterer module component (body only).           */\n/*                                                                         */\n/*  Copyright 1996-2001 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#define FT_MAKE_OPTION_SINGLE_OBJECT\n\n#include <ft2build.h>\n#include \"rastpic.c\"\n#include \"ftraster.c\"\n#include \"ftrend1.c\"\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/raster/rasterrs.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  rasterrs.h                                                             */\n/*                                                                         */\n/*    monochrome renderer error codes (specification only).                */\n/*                                                                         */\n/*  Copyright 2001, 2012 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the monochrome renderer error enumeration */\n  /* constants.                                                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __RASTERRS_H__\n#define __RASTERRS_H__\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  Raster_Err_\n#define FT_ERR_BASE    FT_Mod_Err_Raster\n\n#include FT_ERRORS_H\n\n#endif /* __RASTERRS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/raster/rastpic.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  rastpic.c                                                              */\n/*                                                                         */\n/*    The FreeType position independent code services for raster module.   */\n/*                                                                         */\n/*  Copyright 2009, 2010, 2012, 2013 by                                    */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_INTERNAL_OBJECTS_H\n#include \"rastpic.h\"\n#include \"rasterrs.h\"\n\n\n#ifdef FT_CONFIG_OPTION_PIC\n\n  /* forward declaration of PIC init functions from ftraster.c */\n  void\n  FT_Init_Class_ft_standard_raster( FT_Raster_Funcs*  funcs );\n\n\n  void\n  ft_raster1_renderer_class_pic_free( FT_Library  library )\n  {\n    FT_PIC_Container*  pic_container = &library->pic_container;\n    FT_Memory          memory        = library->memory;\n\n\n    if ( pic_container->raster )\n    {\n      RasterPIC*  container = (RasterPIC*)pic_container->raster;\n\n\n      if ( --container->ref_count )\n        return;\n      FT_FREE( container );\n      pic_container->raster = NULL;\n    }\n  }\n\n\n  FT_Error\n  ft_raster1_renderer_class_pic_init( FT_Library  library )\n  {\n    FT_PIC_Container*  pic_container = &library->pic_container;\n    FT_Error           error         = FT_Err_Ok;\n    RasterPIC*         container     = NULL;\n    FT_Memory          memory        = library->memory;\n\n\n    /* since this function also serves raster5 renderer, */\n    /* it implements reference counting                  */\n    if ( pic_container->raster )\n    {\n      ((RasterPIC*)pic_container->raster)->ref_count++;\n      return error;\n    }\n\n    /* allocate pointer, clear and set global container pointer */\n    if ( FT_ALLOC( container, sizeof ( *container ) ) )\n      return error;\n    FT_MEM_SET( container, 0, sizeof ( *container ) );\n    pic_container->raster = container;\n\n    container->ref_count = 1;\n\n    /* initialize pointer table -                       */\n    /* this is how the module usually expects this data */\n    FT_Init_Class_ft_standard_raster( &container->ft_standard_raster );\n\n    return error;\n  }\n\n\n  /* re-route these init and free functions to the above functions */\n  FT_Error\n  ft_raster5_renderer_class_pic_init( FT_Library  library )\n  {\n    return ft_raster1_renderer_class_pic_init( library );\n  }\n\n\n  void\n  ft_raster5_renderer_class_pic_free( FT_Library  library )\n  {\n    ft_raster1_renderer_class_pic_free( library );\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/raster/rastpic.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  rastpic.h                                                              */\n/*                                                                         */\n/*    The FreeType position independent code services for raster module.   */\n/*                                                                         */\n/*  Copyright 2009 by                                                      */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __RASTPIC_H__\n#define __RASTPIC_H__\n\n\nFT_BEGIN_HEADER\n\n#include FT_INTERNAL_PIC_H\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_STANDARD_RASTER_GET  ft_standard_raster\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n  typedef struct  RasterPIC_\n  {\n    int              ref_count;\n    FT_Raster_Funcs  ft_standard_raster;\n\n  } RasterPIC;\n\n\n#define GET_PIC( lib )                                    \\\n          ( (RasterPIC*)( (lib)->pic_container.raster ) )\n#define FT_STANDARD_RASTER_GET  ( GET_PIC( library )->ft_standard_raster )\n\n\n  /* see rastpic.c for the implementation */\n  void\n  ft_raster1_renderer_class_pic_free( FT_Library  library );\n\n  void\n  ft_raster5_renderer_class_pic_free( FT_Library  library );\n\n  FT_Error\n  ft_raster1_renderer_class_pic_init( FT_Library  library );\n\n  FT_Error\n  ft_raster5_renderer_class_pic_init( FT_Library  library );\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __RASTPIC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/raster/rules.mk",
    "content": "#\n# FreeType 2 renderer module build rules\n#\n\n\n# Copyright 1996-2000, 2001, 2003, 2008, 2009, 2011 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\n# raster driver directory\n#\nRASTER_DIR := $(SRC_DIR)/raster\n\n# compilation flags for the driver\n#\nRASTER_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(RASTER_DIR))\n\n\n# raster driver sources (i.e., C files)\n#\nRASTER_DRV_SRC := $(RASTER_DIR)/ftraster.c \\\n                  $(RASTER_DIR)/ftrend1.c  \\\n                  $(RASTER_DIR)/rastpic.c\n\n\n# raster driver headers\n#\nRASTER_DRV_H := $(RASTER_DRV_SRC:%.c=%.h) \\\n                $(RASTER_DIR)/rasterrs.h\n\n\n# raster driver object(s)\n#\n#   RASTER_DRV_OBJ_M is used during `multi' builds.\n#   RASTER_DRV_OBJ_S is used during `single' builds.\n#\nRASTER_DRV_OBJ_M := $(RASTER_DRV_SRC:$(RASTER_DIR)/%.c=$(OBJ_DIR)/%.$O)\nRASTER_DRV_OBJ_S := $(OBJ_DIR)/raster.$O\n\n# raster driver source file for single build\n#\nRASTER_DRV_SRC_S := $(RASTER_DIR)/raster.c\n\n\n# raster driver - single object\n#\n$(RASTER_DRV_OBJ_S): $(RASTER_DRV_SRC_S) $(RASTER_DRV_SRC) \\\n                     $(FREETYPE_H) $(RASTER_DRV_H)\n\t$(RASTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(RASTER_DRV_SRC_S))\n\n\n# raster driver - multiple objects\n#\n$(OBJ_DIR)/%.$O: $(RASTER_DIR)/%.c $(FREETYPE_H) $(RASTER_DRV_H)\n\t$(RASTER_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\n\n\n# update main driver object lists\n#\nDRV_OBJS_S += $(RASTER_DRV_OBJ_S)\nDRV_OBJS_M += $(RASTER_DRV_OBJ_M)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/Jamfile",
    "content": "# FreeType 2 src/sfnt Jamfile\n#\n# Copyright 2001, 2002, 2004, 2005 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) sfnt ;\n\n{\n  local  _sources ;\n\n  if $(FT2_MULTI)\n  {\n    _sources = sfobjs sfdriver ttcmap ttmtx ttpost ttload ttsbit ttkern ttbdf sfntpic ;\n  }\n  else\n  {\n    _sources = sfnt ;\n  }\n\n  Library  $(FT2_LIB) : $(_sources).c ;\n}\n\n# end of src/sfnt Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/module.mk",
    "content": "#\n# FreeType 2 SFNT module definition\n#\n\n\n# Copyright 1996-2000, 2006 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\nFTMODULE_H_COMMANDS += SFNT_MODULE\n\ndefine SFNT_MODULE\n$(OPEN_DRIVER) FT_Module_Class, sfnt_module_class $(CLOSE_DRIVER)\n$(ECHO_DRIVER)sfnt      $(ECHO_DRIVER_DESC)helper module for TrueType & OpenType formats$(ECHO_DRIVER_DONE)\nendef\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/pngshim.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pngshim.c                                                              */\n/*                                                                         */\n/*    PNG Bitmap glyph support.                                            */\n/*                                                                         */\n/*  Copyright 2013, 2014 by Google, Inc.                                   */\n/*  Written by Stuart Gill and Behdad Esfahbod.                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_TRUETYPE_TAGS_H\n#include FT_CONFIG_STANDARD_LIBRARY_H\n\n\n#ifdef FT_CONFIG_OPTION_USE_PNG\n\n  /* We always include <stjmp.h>, so make libpng shut up! */\n#define PNG_SKIP_SETJMP_CHECK 1\n#include <png.h>\n#include \"pngshim.h\"\n\n#include \"sferrors.h\"\n\n\n  /* This code is freely based on cairo-png.c.  There's so many ways */\n  /* to call libpng, and the way cairo does it is defacto standard.  */\n\n  static int\n  multiply_alpha( int  alpha,\n                  int  color )\n  {\n    int  temp = ( alpha * color ) + 0x80;\n\n\n    return ( temp + ( temp >> 8 ) ) >> 8;\n  }\n\n\n  /* Premultiplies data and converts RGBA bytes => native endian. */\n  static void\n  premultiply_data( png_structp    png,\n                    png_row_infop  row_info,\n                    png_bytep      data )\n  {\n    unsigned int  i;\n\n    FT_UNUSED( png );\n\n\n    for ( i = 0; i < row_info->rowbytes; i += 4 )\n    {\n      unsigned char*  base  = &data[i];\n      unsigned int    alpha = base[3];\n\n\n      if ( alpha == 0 )\n        base[0] = base[1] = base[2] = base[3] = 0;\n\n      else\n      {\n        unsigned int  red   = base[0];\n        unsigned int  green = base[1];\n        unsigned int  blue  = base[2];\n\n\n        if ( alpha != 0xFF )\n        {\n          red   = multiply_alpha( alpha, red   );\n          green = multiply_alpha( alpha, green );\n          blue  = multiply_alpha( alpha, blue  );\n        }\n\n        base[0] = blue;\n        base[1] = green;\n        base[2] = red;\n        base[3] = alpha;\n      }\n    }\n  }\n\n\n  /* Converts RGBx bytes to BGRA. */\n  static void\n  convert_bytes_to_data( png_structp    png,\n                         png_row_infop  row_info,\n                         png_bytep      data )\n  {\n    unsigned int  i;\n\n    FT_UNUSED( png );\n\n\n    for ( i = 0; i < row_info->rowbytes; i += 4 )\n    {\n      unsigned char*  base  = &data[i];\n      unsigned int    red   = base[0];\n      unsigned int    green = base[1];\n      unsigned int    blue  = base[2];\n\n\n      base[0] = blue;\n      base[1] = green;\n      base[2] = red;\n      base[3] = 0xFF;\n    }\n  }\n\n\n  /* Use error callback to avoid png writing to stderr. */\n  static void\n  error_callback( png_structp      png,\n                  png_const_charp  error_msg )\n  {\n    FT_Error*  error = (FT_Error*)png_get_error_ptr( png );\n\n    FT_UNUSED( error_msg );\n\n\n    *error = FT_THROW( Out_Of_Memory );\n#ifdef PNG_SETJMP_SUPPORTED\n    ft_longjmp( png_jmpbuf( png ), 1 );\n#endif\n    /* if we get here, then we have no choice but to abort ... */\n  }\n\n\n  /* Use warning callback to avoid png writing to stderr. */\n  static void\n  warning_callback( png_structp      png,\n                    png_const_charp  error_msg )\n  {\n    FT_UNUSED( png );\n    FT_UNUSED( error_msg );\n\n    /* Just ignore warnings. */\n  }\n\n\n  static void\n  read_data_from_FT_Stream( png_structp  png,\n                            png_bytep    data,\n                            png_size_t   length )\n  {\n    FT_Error   error;\n    png_voidp  p      = png_get_io_ptr( png );\n    FT_Stream  stream = (FT_Stream)p;\n\n\n    if ( FT_FRAME_ENTER( length ) )\n    {\n      FT_Error*  e = (FT_Error*)png_get_error_ptr( png );\n\n\n      *e = FT_THROW( Invalid_Stream_Read );\n      png_error( png, NULL );\n\n      return;\n    }\n\n    memcpy( data, stream->cursor, length );\n\n    FT_FRAME_EXIT();\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  Load_SBit_Png( FT_GlyphSlot     slot,\n                 FT_Int           x_offset,\n                 FT_Int           y_offset,\n                 FT_Int           pix_bits,\n                 TT_SBit_Metrics  metrics,\n                 FT_Memory        memory,\n                 FT_Byte*         data,\n                 FT_UInt          png_len,\n                 FT_Bool          populate_map_and_metrics )\n  {\n    FT_Bitmap    *map   = &slot->bitmap;\n    FT_Error      error = FT_Err_Ok;\n    FT_StreamRec  stream;\n\n    png_structp  png;\n    png_infop    info;\n    png_uint_32  imgWidth, imgHeight;\n\n    int         bitdepth, color_type, interlace;\n    FT_Int      i;\n    png_byte*  *rows = NULL; /* pacify compiler */\n\n\n    if ( x_offset < 0 ||\n         y_offset < 0 )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    if ( !populate_map_and_metrics                            &&\n         ( (FT_UInt)x_offset + metrics->width  > map->width ||\n           (FT_UInt)y_offset + metrics->height > map->rows  ||\n           pix_bits != 32                                   ||\n           map->pixel_mode != FT_PIXEL_MODE_BGRA            ) )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    FT_Stream_OpenMemory( &stream, data, png_len );\n\n    png = png_create_read_struct( PNG_LIBPNG_VER_STRING,\n                                  &error,\n                                  error_callback,\n                                  warning_callback );\n    if ( !png )\n    {\n      error = FT_THROW( Out_Of_Memory );\n      goto Exit;\n    }\n\n    info = png_create_info_struct( png );\n    if ( !info )\n    {\n      error = FT_THROW( Out_Of_Memory );\n      png_destroy_read_struct( &png, NULL, NULL );\n      goto Exit;\n    }\n\n    if ( ft_setjmp( png_jmpbuf( png ) ) )\n    {\n      error = FT_THROW( Invalid_File_Format );\n      goto DestroyExit;\n    }\n\n    png_set_read_fn( png, &stream, read_data_from_FT_Stream );\n\n    png_read_info( png, info );\n    png_get_IHDR( png, info,\n                  &imgWidth, &imgHeight,\n                  &bitdepth, &color_type, &interlace,\n                  NULL, NULL );\n\n    if ( error                                        ||\n         ( !populate_map_and_metrics                &&\n           ( (FT_Int)imgWidth  != metrics->width  ||\n             (FT_Int)imgHeight != metrics->height ) ) )\n      goto DestroyExit;\n\n    if ( populate_map_and_metrics )\n    {\n      FT_Long  size;\n\n\n      metrics->width  = (FT_Int)imgWidth;\n      metrics->height = (FT_Int)imgHeight;\n\n      map->width      = metrics->width;\n      map->rows       = metrics->height;\n      map->pixel_mode = FT_PIXEL_MODE_BGRA;\n      map->pitch      = map->width * 4;\n      map->num_grays  = 256;\n\n      /* reject too large bitmaps similarly to the rasterizer */\n      if ( map->rows > 0x7FFF || map->width > 0x7FFF )\n      {\n        error = FT_THROW( Array_Too_Large );\n        goto DestroyExit;\n      }\n\n      /* this doesn't overflow: 0x7FFF * 0x7FFF * 4 < 2^32 */\n      size = map->rows * map->pitch;\n\n      error = ft_glyphslot_alloc_bitmap( slot, size );\n      if ( error )\n        goto DestroyExit;\n    }\n\n    /* convert palette/gray image to rgb */\n    if ( color_type == PNG_COLOR_TYPE_PALETTE )\n      png_set_palette_to_rgb( png );\n\n    /* expand gray bit depth if needed */\n    if ( color_type == PNG_COLOR_TYPE_GRAY )\n    {\n#if PNG_LIBPNG_VER >= 10209\n      png_set_expand_gray_1_2_4_to_8( png );\n#else\n      png_set_gray_1_2_4_to_8( png );\n#endif\n    }\n\n    /* transform transparency to alpha */\n    if ( png_get_valid(png, info, PNG_INFO_tRNS ) )\n      png_set_tRNS_to_alpha( png );\n\n    if ( bitdepth == 16 )\n      png_set_strip_16( png );\n\n    if ( bitdepth < 8 )\n      png_set_packing( png );\n\n    /* convert grayscale to RGB */\n    if ( color_type == PNG_COLOR_TYPE_GRAY       ||\n         color_type == PNG_COLOR_TYPE_GRAY_ALPHA )\n      png_set_gray_to_rgb( png );\n\n    if ( interlace != PNG_INTERLACE_NONE )\n      png_set_interlace_handling( png );\n\n    png_set_filler( png, 0xFF, PNG_FILLER_AFTER );\n\n    /* recheck header after setting EXPAND options */\n    png_read_update_info(png, info );\n    png_get_IHDR( png, info,\n                  &imgWidth, &imgHeight,\n                  &bitdepth, &color_type, &interlace,\n                  NULL, NULL );\n\n    if ( bitdepth != 8                              ||\n        !( color_type == PNG_COLOR_TYPE_RGB       ||\n           color_type == PNG_COLOR_TYPE_RGB_ALPHA ) )\n    {\n      error = FT_THROW( Invalid_File_Format );\n      goto DestroyExit;\n    }\n\n    switch ( color_type )\n    {\n    default:\n      /* Shouldn't happen, but fall through. */\n\n    case PNG_COLOR_TYPE_RGB_ALPHA:\n      png_set_read_user_transform_fn( png, premultiply_data );\n      break;\n\n    case PNG_COLOR_TYPE_RGB:\n      /* Humm, this smells.  Carry on though. */\n      png_set_read_user_transform_fn( png, convert_bytes_to_data );\n      break;\n    }\n\n    if ( FT_NEW_ARRAY( rows, imgHeight ) )\n    {\n      error = FT_THROW( Out_Of_Memory );\n      goto DestroyExit;\n    }\n\n    for ( i = 0; i < (FT_Int)imgHeight; i++ )\n      rows[i] = map->buffer + ( y_offset + i ) * map->pitch + x_offset * 4;\n\n    png_read_image( png, rows );\n\n    FT_FREE( rows );\n\n    png_read_end( png, info );\n\n  DestroyExit:\n    png_destroy_read_struct( &png, &info, NULL );\n    FT_Stream_Close( &stream );\n\n  Exit:\n    return error;\n  }\n\n#endif /* FT_CONFIG_OPTION_USE_PNG */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/pngshim.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  pngshim.h                                                              */\n/*                                                                         */\n/*    PNG Bitmap glyph support.                                            */\n/*                                                                         */\n/*  Copyright 2013 by Google, Inc.                                         */\n/*  Written by Stuart Gill and Behdad Esfahbod.                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __PNGSHIM_H__\n#define __PNGSHIM_H__\n\n\n#include <ft2build.h>\n#include \"ttload.h\"\n\n\nFT_BEGIN_HEADER\n\n#ifdef FT_CONFIG_OPTION_USE_PNG\n\n  FT_LOCAL( FT_Error )\n  Load_SBit_Png( FT_GlyphSlot     slot,\n                 FT_Int           x_offset,\n                 FT_Int           y_offset,\n                 FT_Int           pix_bits,\n                 TT_SBit_Metrics  metrics,\n                 FT_Memory        memory,\n                 FT_Byte*         data,\n                 FT_UInt          png_len,\n                 FT_Bool          populate_map_and_metrics );\n\n#endif\n\nFT_END_HEADER\n\n#endif /* __PNGSHIM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/rules.mk",
    "content": "#\n# FreeType 2 SFNT driver configuration rules\n#\n\n\n# Copyright 1996-2000, 2002-2007, 2009, 2011, 2013 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\n# SFNT driver directory\n#\nSFNT_DIR := $(SRC_DIR)/sfnt\n\n\n# compilation flags for the driver\n#\nSFNT_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SFNT_DIR))\n\n\n# SFNT driver sources (i.e., C files)\n#\nSFNT_DRV_SRC := $(SFNT_DIR)/ttload.c   \\\n                $(SFNT_DIR)/ttmtx.c    \\\n                $(SFNT_DIR)/ttcmap.c   \\\n                $(SFNT_DIR)/ttsbit.c   \\\n                $(SFNT_DIR)/ttpost.c   \\\n                $(SFNT_DIR)/ttkern.c   \\\n                $(SFNT_DIR)/ttbdf.c    \\\n                $(SFNT_DIR)/sfobjs.c   \\\n                $(SFNT_DIR)/sfdriver.c \\\n                $(SFNT_DIR)/sfntpic.c  \\\n                $(SFNT_DIR)/pngshim.c\n\n# SFNT driver headers\n#\nSFNT_DRV_H := $(SFNT_DRV_SRC:%c=%h)  \\\n              $(SFNT_DIR)/sferrors.h\n\n\n# SFNT driver object(s)\n#\n#   SFNT_DRV_OBJ_M is used during `multi' builds.\n#   SFNT_DRV_OBJ_S is used during `single' builds.\n#\nSFNT_DRV_OBJ_M := $(SFNT_DRV_SRC:$(SFNT_DIR)/%.c=$(OBJ_DIR)/%.$O)\nSFNT_DRV_OBJ_S := $(OBJ_DIR)/sfnt.$O\n\n# SFNT driver source file for single build\n#\nSFNT_DRV_SRC_S := $(SFNT_DIR)/sfnt.c\n\n\n# SFNT driver - single object\n#\n$(SFNT_DRV_OBJ_S): $(SFNT_DRV_SRC_S) $(SFNT_DRV_SRC) \\\n                   $(FREETYPE_H) $(SFNT_DRV_H)\n\t$(SFNT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(SFNT_DRV_SRC_S))\n\n\n# SFNT driver - multiple objects\n#\n$(OBJ_DIR)/%.$O: $(SFNT_DIR)/%.c $(FREETYPE_H) $(SFNT_DRV_H)\n\t$(SFNT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\n\n\n# update main driver object lists\n#\nDRV_OBJS_S += $(SFNT_DRV_OBJ_S)\nDRV_OBJS_M += $(SFNT_DRV_OBJ_M)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/sfdriver.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  sfdriver.c                                                             */\n/*                                                                         */\n/*    High-level SFNT driver interface (body).                             */\n/*                                                                         */\n/*  Copyright 1996-2007, 2009-2014 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_SFNT_H\n#include FT_INTERNAL_OBJECTS_H\n\n#include \"sfdriver.h\"\n#include \"ttload.h\"\n#include \"sfobjs.h\"\n#include \"sfntpic.h\"\n\n#include \"sferrors.h\"\n\n#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n#include \"ttsbit.h\"\n#endif\n\n#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES\n#include \"ttpost.h\"\n#endif\n\n#ifdef TT_CONFIG_OPTION_BDF\n#include \"ttbdf.h\"\n#include FT_SERVICE_BDF_H\n#endif\n\n#include \"ttcmap.h\"\n#include \"ttkern.h\"\n#include \"ttmtx.h\"\n\n#include FT_SERVICE_GLYPH_DICT_H\n#include FT_SERVICE_POSTSCRIPT_NAME_H\n#include FT_SERVICE_SFNT_H\n#include FT_SERVICE_TT_CMAP_H\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_sfdriver\n\n\n  /*\n   *  SFNT TABLE SERVICE\n   *\n   */\n\n  static void*\n  get_sfnt_table( TT_Face      face,\n                  FT_Sfnt_Tag  tag )\n  {\n    void*  table;\n\n\n    switch ( tag )\n    {\n    case FT_SFNT_HEAD:\n      table = &face->header;\n      break;\n\n    case FT_SFNT_HHEA:\n      table = &face->horizontal;\n      break;\n\n    case FT_SFNT_VHEA:\n      table = face->vertical_info ? &face->vertical : NULL;\n      break;\n\n    case FT_SFNT_OS2:\n      table = face->os2.version == 0xFFFFU ? NULL : &face->os2;\n      break;\n\n    case FT_SFNT_POST:\n      table = &face->postscript;\n      break;\n\n    case FT_SFNT_MAXP:\n      table = &face->max_profile;\n      break;\n\n    case FT_SFNT_PCLT:\n      table = face->pclt.Version ? &face->pclt : NULL;\n      break;\n\n    default:\n      table = NULL;\n    }\n\n    return table;\n  }\n\n\n  static FT_Error\n  sfnt_table_info( TT_Face    face,\n                   FT_UInt    idx,\n                   FT_ULong  *tag,\n                   FT_ULong  *offset,\n                   FT_ULong  *length )\n  {\n    if ( !offset || !length )\n      return FT_THROW( Invalid_Argument );\n\n    if ( !tag )\n      *length = face->num_tables;\n    else\n    {\n      if ( idx >= face->num_tables )\n        return FT_THROW( Table_Missing );\n\n      *tag    = face->dir_tables[idx].Tag;\n      *offset = face->dir_tables[idx].Offset;\n      *length = face->dir_tables[idx].Length;\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_DEFINE_SERVICE_SFNT_TABLEREC(\n    sfnt_service_sfnt_table,\n    (FT_SFNT_TableLoadFunc)tt_face_load_any,\n    (FT_SFNT_TableGetFunc) get_sfnt_table,\n    (FT_SFNT_TableInfoFunc)sfnt_table_info )\n\n\n#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES\n\n  /*\n   *  GLYPH DICT SERVICE\n   *\n   */\n\n  static FT_Error\n  sfnt_get_glyph_name( TT_Face     face,\n                       FT_UInt     glyph_index,\n                       FT_Pointer  buffer,\n                       FT_UInt     buffer_max )\n  {\n    FT_String*  gname;\n    FT_Error    error;\n\n\n    error = tt_face_get_ps_name( face, glyph_index, &gname );\n    if ( !error )\n      FT_STRCPYN( buffer, gname, buffer_max );\n\n    return error;\n  }\n\n\n  static FT_UInt\n  sfnt_get_name_index( TT_Face     face,\n                       FT_String*  glyph_name )\n  {\n    FT_Face  root = &face->root;\n\n    FT_UInt  i, max_gid = FT_UINT_MAX;\n\n\n    if ( root->num_glyphs < 0 )\n      return 0;\n    else if ( (FT_ULong)root->num_glyphs < FT_UINT_MAX )\n      max_gid = (FT_UInt)root->num_glyphs;\n    else\n      FT_TRACE0(( \"Ignore glyph names for invalid GID 0x%08x - 0x%08x\\n\",\n                  FT_UINT_MAX, root->num_glyphs ));\n\n    for ( i = 0; i < max_gid; i++ )\n    {\n      FT_String*  gname;\n      FT_Error    error = tt_face_get_ps_name( face, i, &gname );\n\n\n      if ( error )\n        continue;\n\n      if ( !ft_strcmp( glyph_name, gname ) )\n        return i;\n    }\n\n    return 0;\n  }\n\n\n  FT_DEFINE_SERVICE_GLYPHDICTREC(\n    sfnt_service_glyph_dict,\n    (FT_GlyphDict_GetNameFunc)  sfnt_get_glyph_name,\n    (FT_GlyphDict_NameIndexFunc)sfnt_get_name_index )\n\n\n#endif /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES */\n\n\n  /*\n   *  POSTSCRIPT NAME SERVICE\n   *\n   */\n\n  static const char*\n  sfnt_get_ps_name( TT_Face  face )\n  {\n    FT_Int       n, found_win, found_apple;\n    const char*  result = NULL;\n\n\n    /* shouldn't happen, but just in case to avoid memory leaks */\n    if ( face->postscript_name )\n      return face->postscript_name;\n\n    /* scan the name table to see whether we have a Postscript name here, */\n    /* either in Macintosh or Windows platform encodings                  */\n    found_win   = -1;\n    found_apple = -1;\n\n    for ( n = 0; n < face->num_names; n++ )\n    {\n      TT_NameEntryRec*  name = face->name_table.names + n;\n\n\n      if ( name->nameID == 6 && name->stringLength > 0 )\n      {\n        if ( name->platformID == 3     &&\n             name->encodingID == 1     &&\n             name->languageID == 0x409 )\n          found_win = n;\n\n        if ( name->platformID == 1 &&\n             name->encodingID == 0 &&\n             name->languageID == 0 )\n          found_apple = n;\n      }\n    }\n\n    if ( found_win != -1 )\n    {\n      FT_Memory         memory = face->root.memory;\n      TT_NameEntryRec*  name   = face->name_table.names + found_win;\n      FT_UInt           len    = name->stringLength / 2;\n      FT_Error          error  = FT_Err_Ok;\n\n      FT_UNUSED( error );\n\n\n      if ( !FT_ALLOC( result, name->stringLength + 1 ) )\n      {\n        FT_Stream   stream = face->name_table.stream;\n        FT_String*  r      = (FT_String*)result;\n        FT_Byte*    p;\n\n\n        if ( FT_STREAM_SEEK( name->stringOffset ) ||\n             FT_FRAME_ENTER( name->stringLength ) )\n        {\n          FT_FREE( result );\n          name->stringLength = 0;\n          name->stringOffset = 0;\n          FT_FREE( name->string );\n\n          goto Exit;\n        }\n\n        p = (FT_Byte*)stream->cursor;\n\n        for ( ; len > 0; len--, p += 2 )\n        {\n          if ( p[0] == 0 && p[1] >= 32 && p[1] < 128 )\n            *r++ = p[1];\n        }\n        *r = '\\0';\n\n        FT_FRAME_EXIT();\n      }\n      goto Exit;\n    }\n\n    if ( found_apple != -1 )\n    {\n      FT_Memory         memory = face->root.memory;\n      TT_NameEntryRec*  name   = face->name_table.names + found_apple;\n      FT_UInt           len    = name->stringLength;\n      FT_Error          error  = FT_Err_Ok;\n\n      FT_UNUSED( error );\n\n\n      if ( !FT_ALLOC( result, len + 1 ) )\n      {\n        FT_Stream  stream = face->name_table.stream;\n\n\n        if ( FT_STREAM_SEEK( name->stringOffset ) ||\n             FT_STREAM_READ( result, len )        )\n        {\n          name->stringOffset = 0;\n          name->stringLength = 0;\n          FT_FREE( name->string );\n          FT_FREE( result );\n          goto Exit;\n        }\n        ((char*)result)[len] = '\\0';\n      }\n    }\n\n  Exit:\n    face->postscript_name = result;\n    return result;\n  }\n\n\n  FT_DEFINE_SERVICE_PSFONTNAMEREC(\n    sfnt_service_ps_name,\n    (FT_PsName_GetFunc)sfnt_get_ps_name )\n\n\n  /*\n   *  TT CMAP INFO\n   */\n  FT_DEFINE_SERVICE_TTCMAPSREC(\n    tt_service_get_cmap_info,\n    (TT_CMap_Info_GetFunc)tt_get_cmap_info )\n\n\n#ifdef TT_CONFIG_OPTION_BDF\n\n  static FT_Error\n  sfnt_get_charset_id( TT_Face       face,\n                       const char*  *acharset_encoding,\n                       const char*  *acharset_registry )\n  {\n    BDF_PropertyRec  encoding, registry;\n    FT_Error         error;\n\n\n    /* XXX: I don't know whether this is correct, since\n     *      tt_face_find_bdf_prop only returns something correct if we have\n     *      previously selected a size that is listed in the BDF table.\n     *      Should we change the BDF table format to include single offsets\n     *      for `CHARSET_REGISTRY' and `CHARSET_ENCODING'?\n     */\n    error = tt_face_find_bdf_prop( face, \"CHARSET_REGISTRY\", &registry );\n    if ( !error )\n    {\n      error = tt_face_find_bdf_prop( face, \"CHARSET_ENCODING\", &encoding );\n      if ( !error )\n      {\n        if ( registry.type == BDF_PROPERTY_TYPE_ATOM &&\n             encoding.type == BDF_PROPERTY_TYPE_ATOM )\n        {\n          *acharset_encoding = encoding.u.atom;\n          *acharset_registry = registry.u.atom;\n        }\n        else\n          error = FT_THROW( Invalid_Argument );\n      }\n    }\n\n    return error;\n  }\n\n\n  FT_DEFINE_SERVICE_BDFRec(\n    sfnt_service_bdf,\n    (FT_BDF_GetCharsetIdFunc)sfnt_get_charset_id,\n    (FT_BDF_GetPropertyFunc) tt_face_find_bdf_prop )\n\n\n#endif /* TT_CONFIG_OPTION_BDF */\n\n\n  /*\n   *  SERVICE LIST\n   */\n\n#if defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES && defined TT_CONFIG_OPTION_BDF\n  FT_DEFINE_SERVICEDESCREC5(\n    sfnt_services,\n    FT_SERVICE_ID_SFNT_TABLE,           &SFNT_SERVICE_SFNT_TABLE_GET,\n    FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,\n    FT_SERVICE_ID_GLYPH_DICT,           &SFNT_SERVICE_GLYPH_DICT_GET,\n    FT_SERVICE_ID_BDF,                  &SFNT_SERVICE_BDF_GET,\n    FT_SERVICE_ID_TT_CMAP,              &TT_SERVICE_CMAP_INFO_GET )\n#elif defined TT_CONFIG_OPTION_POSTSCRIPT_NAMES\n  FT_DEFINE_SERVICEDESCREC4(\n    sfnt_services,\n    FT_SERVICE_ID_SFNT_TABLE,           &SFNT_SERVICE_SFNT_TABLE_GET,\n    FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,\n    FT_SERVICE_ID_GLYPH_DICT,           &SFNT_SERVICE_GLYPH_DICT_GET,\n    FT_SERVICE_ID_TT_CMAP,              &TT_SERVICE_CMAP_INFO_GET )\n#elif defined TT_CONFIG_OPTION_BDF\n  FT_DEFINE_SERVICEDESCREC4(\n    sfnt_services,\n    FT_SERVICE_ID_SFNT_TABLE,           &SFNT_SERVICE_SFNT_TABLE_GET,\n    FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,\n    FT_SERVICE_ID_BDF,                  &SFNT_SERVICE_BDF_GET,\n    FT_SERVICE_ID_TT_CMAP,              &TT_SERVICE_CMAP_INFO_GET )\n#else\n  FT_DEFINE_SERVICEDESCREC3(\n    sfnt_services,\n    FT_SERVICE_ID_SFNT_TABLE,           &SFNT_SERVICE_SFNT_TABLE_GET,\n    FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &SFNT_SERVICE_PS_NAME_GET,\n    FT_SERVICE_ID_TT_CMAP,              &TT_SERVICE_CMAP_INFO_GET )\n#endif\n\n\n  FT_CALLBACK_DEF( FT_Module_Interface )\n  sfnt_get_interface( FT_Module    module,\n                      const char*  module_interface )\n  {\n    /* SFNT_SERVICES_GET dereferences `library' in PIC mode */\n#ifdef FT_CONFIG_OPTION_PIC\n    FT_Library  library;\n\n\n    if ( !module )\n      return NULL;\n    library = module->library;\n    if ( !library )\n      return NULL;\n#else\n    FT_UNUSED( module );\n#endif\n\n    return ft_service_list_lookup( SFNT_SERVICES_GET, module_interface );\n  }\n\n\n#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n#define PUT_EMBEDDED_BITMAPS( a )  a\n#else\n#define PUT_EMBEDDED_BITMAPS( a )  NULL\n#endif\n\n#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES\n#define PUT_PS_NAMES( a )  a\n#else\n#define PUT_PS_NAMES( a )  NULL\n#endif\n\n  FT_DEFINE_SFNT_INTERFACE(\n    sfnt_interface,\n    tt_face_goto_table,\n\n    sfnt_init_face,\n    sfnt_load_face,\n    sfnt_done_face,\n    sfnt_get_interface,\n\n    tt_face_load_any,\n\n    tt_face_load_head,\n    tt_face_load_hhea,\n    tt_face_load_cmap,\n    tt_face_load_maxp,\n    tt_face_load_os2,\n    tt_face_load_post,\n\n    tt_face_load_name,\n    tt_face_free_name,\n\n    tt_face_load_kern,\n    tt_face_load_gasp,\n    tt_face_load_pclt,\n\n    /* see `ttload.h' */\n    PUT_EMBEDDED_BITMAPS( tt_face_load_bhed ),\n\n    PUT_EMBEDDED_BITMAPS( tt_face_load_sbit_image ),\n\n    /* see `ttpost.h' */\n    PUT_PS_NAMES( tt_face_get_ps_name   ),\n    PUT_PS_NAMES( tt_face_free_ps_names ),\n\n    /* since version 2.1.8 */\n    tt_face_get_kerning,\n\n    /* since version 2.2 */\n    tt_face_load_font_dir,\n    tt_face_load_hmtx,\n\n    /* see `ttsbit.h' and `sfnt.h' */\n    PUT_EMBEDDED_BITMAPS( tt_face_load_sbit ),\n    PUT_EMBEDDED_BITMAPS( tt_face_free_sbit ),\n\n    PUT_EMBEDDED_BITMAPS( tt_face_set_sbit_strike     ),\n    PUT_EMBEDDED_BITMAPS( tt_face_load_strike_metrics ),\n\n    tt_face_get_metrics\n  )\n\n\n  FT_DEFINE_MODULE(\n    sfnt_module_class,\n\n    0,  /* not a font driver or renderer */\n    sizeof ( FT_ModuleRec ),\n\n    \"sfnt\",     /* driver name                            */\n    0x10000L,   /* driver version 1.0                     */\n    0x20000L,   /* driver requires FreeType 2.0 or higher */\n\n    (const void*)&SFNT_INTERFACE_GET,  /* module specific interface */\n\n    (FT_Module_Constructor)0,\n    (FT_Module_Destructor) 0,\n    (FT_Module_Requester)  sfnt_get_interface )\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/sfdriver.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  sfdriver.h                                                             */\n/*                                                                         */\n/*    High-level SFNT driver interface (specification).                    */\n/*                                                                         */\n/*  Copyright 1996-2001 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SFDRIVER_H__\n#define __SFDRIVER_H__\n\n\n#include <ft2build.h>\n#include FT_MODULE_H\n\n\nFT_BEGIN_HEADER\n\n\n  FT_DECLARE_MODULE( sfnt_module_class )\n\n\nFT_END_HEADER\n\n#endif /* __SFDRIVER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/sferrors.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  sferrors.h                                                             */\n/*                                                                         */\n/*    SFNT error codes (specification only).                               */\n/*                                                                         */\n/*  Copyright 2001, 2004, 2012, 2013 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the SFNT error enumeration constants.     */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __SFERRORS_H__\n#define __SFERRORS_H__\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  SFNT_Err_\n#define FT_ERR_BASE    FT_Mod_Err_SFNT\n\n#include FT_ERRORS_H\n\n#endif /* __SFERRORS_H__ */\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/sfnt.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  sfnt.c                                                                 */\n/*                                                                         */\n/*    Single object library component.                                     */\n/*                                                                         */\n/*  Copyright 1996-2006, 2013 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#define FT_MAKE_OPTION_SINGLE_OBJECT\n\n#include <ft2build.h>\n#include \"sfntpic.c\"\n#include \"ttload.c\"\n#include \"ttmtx.c\"\n#include \"ttcmap.c\"\n#include \"ttkern.c\"\n#include \"sfobjs.c\"\n#include \"sfdriver.c\"\n\n#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n#include \"pngshim.c\"\n#include \"ttsbit.c\"\n#endif\n\n#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES\n#include \"ttpost.c\"\n#endif\n\n#ifdef TT_CONFIG_OPTION_BDF\n#include \"ttbdf.c\"\n#endif\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/sfntpic.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  sfntpic.c                                                              */\n/*                                                                         */\n/*    The FreeType position independent code services for sfnt module.     */\n/*                                                                         */\n/*  Copyright 2009, 2010, 2012, 2013 by                                    */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_INTERNAL_OBJECTS_H\n#include \"sfntpic.h\"\n#include \"sferrors.h\"\n\n\n#ifdef FT_CONFIG_OPTION_PIC\n\n  /* forward declaration of PIC init functions from sfdriver.c */\n  FT_Error\n  FT_Create_Class_sfnt_services( FT_Library           library,\n                                 FT_ServiceDescRec**  output_class );\n  void\n  FT_Destroy_Class_sfnt_services( FT_Library          library,\n                                  FT_ServiceDescRec*  clazz );\n  void\n  FT_Init_Class_sfnt_service_bdf( FT_Service_BDFRec*  clazz );\n  void\n  FT_Init_Class_sfnt_interface( FT_Library       library,\n                                SFNT_Interface*  clazz );\n  void\n  FT_Init_Class_sfnt_service_glyph_dict(\n    FT_Library                library,\n    FT_Service_GlyphDictRec*  clazz );\n  void\n  FT_Init_Class_sfnt_service_ps_name(\n    FT_Library                 library,\n    FT_Service_PsFontNameRec*  clazz );\n  void\n  FT_Init_Class_tt_service_get_cmap_info(\n    FT_Library              library,\n    FT_Service_TTCMapsRec*  clazz );\n  void\n  FT_Init_Class_sfnt_service_sfnt_table(\n    FT_Service_SFNT_TableRec*  clazz );\n\n\n  /* forward declaration of PIC init functions from ttcmap.c */\n  FT_Error\n  FT_Create_Class_tt_cmap_classes( FT_Library       library,\n                                   TT_CMap_Class**  output_class );\n  void\n  FT_Destroy_Class_tt_cmap_classes( FT_Library      library,\n                                    TT_CMap_Class*  clazz );\n\n\n  void\n  sfnt_module_class_pic_free( FT_Library  library )\n  {\n    FT_PIC_Container*  pic_container = &library->pic_container;\n    FT_Memory          memory        = library->memory;\n\n\n    if ( pic_container->sfnt )\n    {\n      sfntModulePIC*  container = (sfntModulePIC*)pic_container->sfnt;\n\n\n      if ( container->sfnt_services )\n        FT_Destroy_Class_sfnt_services( library,\n                                        container->sfnt_services );\n      container->sfnt_services = NULL;\n\n      if ( container->tt_cmap_classes )\n        FT_Destroy_Class_tt_cmap_classes( library,\n                                          container->tt_cmap_classes );\n      container->tt_cmap_classes = NULL;\n\n      FT_FREE( container );\n      pic_container->sfnt = NULL;\n    }\n  }\n\n\n  FT_Error\n  sfnt_module_class_pic_init( FT_Library  library )\n  {\n    FT_PIC_Container*  pic_container = &library->pic_container;\n    FT_Error           error         = FT_Err_Ok;\n    sfntModulePIC*     container     = NULL;\n    FT_Memory          memory        = library->memory;\n\n\n    /* allocate pointer, clear and set global container pointer */\n    if ( FT_ALLOC( container, sizeof ( *container ) ) )\n      return error;\n    FT_MEM_SET( container, 0, sizeof ( *container ) );\n    pic_container->sfnt = container;\n\n    /* initialize pointer table -                       */\n    /* this is how the module usually expects this data */\n    error = FT_Create_Class_sfnt_services( library,\n                                           &container->sfnt_services );\n    if ( error )\n      goto Exit;\n\n    error = FT_Create_Class_tt_cmap_classes( library,\n                                             &container->tt_cmap_classes );\n    if ( error )\n      goto Exit;\n\n    FT_Init_Class_sfnt_service_glyph_dict(\n      library, &container->sfnt_service_glyph_dict );\n    FT_Init_Class_sfnt_service_ps_name(\n      library, &container->sfnt_service_ps_name );\n    FT_Init_Class_tt_service_get_cmap_info(\n      library, &container->tt_service_get_cmap_info );\n    FT_Init_Class_sfnt_service_sfnt_table(\n      &container->sfnt_service_sfnt_table );\n#ifdef TT_CONFIG_OPTION_BDF\n    FT_Init_Class_sfnt_service_bdf( &container->sfnt_service_bdf );\n#endif\n    FT_Init_Class_sfnt_interface( library, &container->sfnt_interface );\n\n  Exit:\n    if ( error )\n      sfnt_module_class_pic_free( library );\n    return error;\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/sfntpic.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  sfntpic.h                                                              */\n/*                                                                         */\n/*    The FreeType position independent code services for sfnt module.     */\n/*                                                                         */\n/*  Copyright 2009, 2012 by                                                */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SFNTPIC_H__\n#define __SFNTPIC_H__\n\n\nFT_BEGIN_HEADER\n\n#include FT_INTERNAL_PIC_H\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define SFNT_SERVICES_GET            sfnt_services\n#define SFNT_SERVICE_GLYPH_DICT_GET  sfnt_service_glyph_dict\n#define SFNT_SERVICE_PS_NAME_GET     sfnt_service_ps_name\n#define TT_SERVICE_CMAP_INFO_GET     tt_service_get_cmap_info\n#define SFNT_SERVICES_GET            sfnt_services\n#define TT_CMAP_CLASSES_GET          tt_cmap_classes\n#define SFNT_SERVICE_SFNT_TABLE_GET  sfnt_service_sfnt_table\n#define SFNT_SERVICE_BDF_GET         sfnt_service_bdf\n#define SFNT_INTERFACE_GET           sfnt_interface\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n  /* some include files required for members of sfntModulePIC */\n#include FT_SERVICE_GLYPH_DICT_H\n#include FT_SERVICE_POSTSCRIPT_NAME_H\n#include FT_SERVICE_SFNT_H\n#include FT_SERVICE_TT_CMAP_H\n\n#ifdef TT_CONFIG_OPTION_BDF\n#include \"ttbdf.h\"\n#include FT_SERVICE_BDF_H\n#endif\n\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_SFNT_H\n#include \"ttcmap.h\"\n\n\n  typedef struct  sfntModulePIC_\n  {\n    FT_ServiceDescRec*        sfnt_services;\n    FT_Service_GlyphDictRec   sfnt_service_glyph_dict;\n    FT_Service_PsFontNameRec  sfnt_service_ps_name;\n    FT_Service_TTCMapsRec     tt_service_get_cmap_info;\n    TT_CMap_Class*            tt_cmap_classes;\n    FT_Service_SFNT_TableRec  sfnt_service_sfnt_table;\n#ifdef TT_CONFIG_OPTION_BDF\n    FT_Service_BDFRec         sfnt_service_bdf;\n#endif\n    SFNT_Interface            sfnt_interface;\n\n  } sfntModulePIC;\n\n\n#define GET_PIC( lib )                                      \\\n          ( (sfntModulePIC*)( (lib)->pic_container.sfnt ) )\n\n#define SFNT_SERVICES_GET                       \\\n          ( GET_PIC( library )->sfnt_services )\n#define SFNT_SERVICE_GLYPH_DICT_GET                       \\\n          ( GET_PIC( library )->sfnt_service_glyph_dict )\n#define SFNT_SERVICE_PS_NAME_GET                       \\\n          ( GET_PIC( library )->sfnt_service_ps_name )\n#define TT_SERVICE_CMAP_INFO_GET                           \\\n          ( GET_PIC( library )->tt_service_get_cmap_info )\n#define SFNT_SERVICES_GET                       \\\n          ( GET_PIC( library )->sfnt_services )\n#define TT_CMAP_CLASSES_GET                       \\\n          ( GET_PIC( library )->tt_cmap_classes )\n#define SFNT_SERVICE_SFNT_TABLE_GET                       \\\n          ( GET_PIC( library )->sfnt_service_sfnt_table )\n#define SFNT_SERVICE_BDF_GET                       \\\n          ( GET_PIC( library )->sfnt_service_bdf )\n#define SFNT_INTERFACE_GET                       \\\n          ( GET_PIC( library )->sfnt_interface )\n\n\n  /* see sfntpic.c for the implementation */\n  void\n  sfnt_module_class_pic_free( FT_Library  library );\n\n  FT_Error\n  sfnt_module_class_pic_init( FT_Library  library );\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n  /* */\n\nFT_END_HEADER\n\n#endif /* __SFNTPIC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/sfobjs.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  sfobjs.c                                                               */\n/*                                                                         */\n/*    SFNT object management (base).                                       */\n/*                                                                         */\n/*  Copyright 1996-2008, 2010-2014 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include \"sfobjs.h\"\n#include \"ttload.h\"\n#include \"ttcmap.h\"\n#include \"ttkern.h\"\n#include FT_INTERNAL_SFNT_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_TRUETYPE_IDS_H\n#include FT_TRUETYPE_TAGS_H\n#include FT_SERVICE_POSTSCRIPT_CMAPS_H\n#include FT_SFNT_NAMES_H\n#include FT_GZIP_H\n#include \"sferrors.h\"\n\n#ifdef TT_CONFIG_OPTION_BDF\n#include \"ttbdf.h\"\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_sfobjs\n\n\n\n  /* convert a UTF-16 name entry to ASCII */\n  static FT_String*\n  tt_name_entry_ascii_from_utf16( TT_NameEntry  entry,\n                                  FT_Memory     memory )\n  {\n    FT_String*  string = NULL;\n    FT_UInt     len, code, n;\n    FT_Byte*    read   = (FT_Byte*)entry->string;\n    FT_Error    error;\n\n\n    len = (FT_UInt)entry->stringLength / 2;\n\n    if ( FT_NEW_ARRAY( string, len + 1 ) )\n      return NULL;\n\n    for ( n = 0; n < len; n++ )\n    {\n      code = FT_NEXT_USHORT( read );\n\n      if ( code == 0 )\n        break;\n\n      if ( code < 32 || code > 127 )\n        code = '?';\n\n      string[n] = (char)code;\n    }\n\n    string[n] = 0;\n\n    return string;\n  }\n\n\n  /* convert an Apple Roman or symbol name entry to ASCII */\n  static FT_String*\n  tt_name_entry_ascii_from_other( TT_NameEntry  entry,\n                                  FT_Memory     memory )\n  {\n    FT_String*  string = NULL;\n    FT_UInt     len, code, n;\n    FT_Byte*    read   = (FT_Byte*)entry->string;\n    FT_Error    error;\n\n\n    len = (FT_UInt)entry->stringLength;\n\n    if ( FT_NEW_ARRAY( string, len + 1 ) )\n      return NULL;\n\n    for ( n = 0; n < len; n++ )\n    {\n      code = *read++;\n\n      if ( code == 0 )\n        break;\n\n      if ( code < 32 || code > 127 )\n        code = '?';\n\n      string[n] = (char)code;\n    }\n\n    string[n] = 0;\n\n    return string;\n  }\n\n\n  typedef FT_String*  (*TT_NameEntry_ConvertFunc)( TT_NameEntry  entry,\n                                                   FT_Memory     memory );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_get_name                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Returns a given ENGLISH name record in ASCII.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the source face object.                      */\n  /*                                                                       */\n  /*    nameid :: The name id of the name record to return.                */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    name   :: The address of a string pointer.  NULL if no name is     */\n  /*              present.                                                 */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  static FT_Error\n  tt_face_get_name( TT_Face      face,\n                    FT_UShort    nameid,\n                    FT_String**  name )\n  {\n    FT_Memory         memory = face->root.memory;\n    FT_Error          error  = FT_Err_Ok;\n    FT_String*        result = NULL;\n    FT_UShort         n;\n    TT_NameEntryRec*  rec;\n    FT_Int            found_apple         = -1;\n    FT_Int            found_apple_roman   = -1;\n    FT_Int            found_apple_english = -1;\n    FT_Int            found_win           = -1;\n    FT_Int            found_unicode       = -1;\n\n    FT_Bool           is_english = 0;\n\n    TT_NameEntry_ConvertFunc  convert;\n\n\n    FT_ASSERT( name );\n\n    rec = face->name_table.names;\n    for ( n = 0; n < face->num_names; n++, rec++ )\n    {\n      /* According to the OpenType 1.3 specification, only Microsoft or  */\n      /* Apple platform IDs might be used in the `name' table.  The      */\n      /* `Unicode' platform is reserved for the `cmap' table, and the    */\n      /* `ISO' one is deprecated.                                        */\n      /*                                                                 */\n      /* However, the Apple TrueType specification doesn't say the same  */\n      /* thing and goes to suggest that all Unicode `name' table entries */\n      /* should be coded in UTF-16 (in big-endian format I suppose).     */\n      /*                                                                 */\n      if ( rec->nameID == nameid && rec->stringLength > 0 )\n      {\n        switch ( rec->platformID )\n        {\n        case TT_PLATFORM_APPLE_UNICODE:\n        case TT_PLATFORM_ISO:\n          /* there is `languageID' to check there.  We should use this */\n          /* field only as a last solution when nothing else is        */\n          /* available.                                                */\n          /*                                                           */\n          found_unicode = n;\n          break;\n\n        case TT_PLATFORM_MACINTOSH:\n          /* This is a bit special because some fonts will use either    */\n          /* an English language id, or a Roman encoding id, to indicate */\n          /* the English version of its font name.                       */\n          /*                                                             */\n          if ( rec->languageID == TT_MAC_LANGID_ENGLISH )\n            found_apple_english = n;\n          else if ( rec->encodingID == TT_MAC_ID_ROMAN )\n            found_apple_roman = n;\n          break;\n\n        case TT_PLATFORM_MICROSOFT:\n          /* we only take a non-English name when there is nothing */\n          /* else available in the font                            */\n          /*                                                       */\n          if ( found_win == -1 || ( rec->languageID & 0x3FF ) == 0x009 )\n          {\n            switch ( rec->encodingID )\n            {\n            case TT_MS_ID_SYMBOL_CS:\n            case TT_MS_ID_UNICODE_CS:\n            case TT_MS_ID_UCS_4:\n              is_english = FT_BOOL( ( rec->languageID & 0x3FF ) == 0x009 );\n              found_win  = n;\n              break;\n\n            default:\n              ;\n            }\n          }\n          break;\n\n        default:\n          ;\n        }\n      }\n    }\n\n    found_apple = found_apple_roman;\n    if ( found_apple_english >= 0 )\n      found_apple = found_apple_english;\n\n    /* some fonts contain invalid Unicode or Macintosh formatted entries; */\n    /* we will thus favor names encoded in Windows formats if available   */\n    /* (provided it is an English name)                                   */\n    /*                                                                    */\n    convert = NULL;\n    if ( found_win >= 0 && !( found_apple >= 0 && !is_english ) )\n    {\n      rec = face->name_table.names + found_win;\n      switch ( rec->encodingID )\n      {\n        /* all Unicode strings are encoded using UTF-16BE */\n      case TT_MS_ID_UNICODE_CS:\n      case TT_MS_ID_SYMBOL_CS:\n        convert = tt_name_entry_ascii_from_utf16;\n        break;\n\n      case TT_MS_ID_UCS_4:\n        /* Apparently, if this value is found in a name table entry, it is */\n        /* documented as `full Unicode repertoire'.  Experience with the   */\n        /* MsGothic font shipped with Windows Vista shows that this really */\n        /* means UTF-16 encoded names (UCS-4 values are only used within   */\n        /* charmaps).                                                      */\n        convert = tt_name_entry_ascii_from_utf16;\n        break;\n\n      default:\n        ;\n      }\n    }\n    else if ( found_apple >= 0 )\n    {\n      rec     = face->name_table.names + found_apple;\n      convert = tt_name_entry_ascii_from_other;\n    }\n    else if ( found_unicode >= 0 )\n    {\n      rec     = face->name_table.names + found_unicode;\n      convert = tt_name_entry_ascii_from_utf16;\n    }\n\n    if ( rec && convert )\n    {\n      if ( rec->string == NULL )\n      {\n        FT_Stream  stream = face->name_table.stream;\n\n\n        if ( FT_QNEW_ARRAY ( rec->string, rec->stringLength ) ||\n             FT_STREAM_SEEK( rec->stringOffset )              ||\n             FT_STREAM_READ( rec->string, rec->stringLength ) )\n        {\n          FT_FREE( rec->string );\n          rec->stringLength = 0;\n          result            = NULL;\n          goto Exit;\n        }\n      }\n\n      result = convert( rec, memory );\n    }\n\n  Exit:\n    *name = result;\n    return error;\n  }\n\n\n  static FT_Encoding\n  sfnt_find_encoding( int  platform_id,\n                      int  encoding_id )\n  {\n    typedef struct  TEncoding_\n    {\n      int          platform_id;\n      int          encoding_id;\n      FT_Encoding  encoding;\n\n    } TEncoding;\n\n    static\n    const TEncoding  tt_encodings[] =\n    {\n      { TT_PLATFORM_ISO,           -1,                  FT_ENCODING_UNICODE },\n\n      { TT_PLATFORM_APPLE_UNICODE, -1,                  FT_ENCODING_UNICODE },\n\n      { TT_PLATFORM_MACINTOSH,     TT_MAC_ID_ROMAN,     FT_ENCODING_APPLE_ROMAN },\n\n      { TT_PLATFORM_MICROSOFT,     TT_MS_ID_SYMBOL_CS,  FT_ENCODING_MS_SYMBOL },\n      { TT_PLATFORM_MICROSOFT,     TT_MS_ID_UCS_4,      FT_ENCODING_UNICODE },\n      { TT_PLATFORM_MICROSOFT,     TT_MS_ID_UNICODE_CS, FT_ENCODING_UNICODE },\n      { TT_PLATFORM_MICROSOFT,     TT_MS_ID_SJIS,       FT_ENCODING_SJIS },\n      { TT_PLATFORM_MICROSOFT,     TT_MS_ID_GB2312,     FT_ENCODING_GB2312 },\n      { TT_PLATFORM_MICROSOFT,     TT_MS_ID_BIG_5,      FT_ENCODING_BIG5 },\n      { TT_PLATFORM_MICROSOFT,     TT_MS_ID_WANSUNG,    FT_ENCODING_WANSUNG },\n      { TT_PLATFORM_MICROSOFT,     TT_MS_ID_JOHAB,      FT_ENCODING_JOHAB }\n    };\n\n    const TEncoding  *cur, *limit;\n\n\n    cur   = tt_encodings;\n    limit = cur + sizeof ( tt_encodings ) / sizeof ( tt_encodings[0] );\n\n    for ( ; cur < limit; cur++ )\n    {\n      if ( cur->platform_id == platform_id )\n      {\n        if ( cur->encoding_id == encoding_id ||\n             cur->encoding_id == -1          )\n          return cur->encoding;\n      }\n    }\n\n    return FT_ENCODING_NONE;\n  }\n\n\n#define WRITE_USHORT( p, v )                \\\n          do                                \\\n          {                                 \\\n            *(p)++ = (FT_Byte)( (v) >> 8 ); \\\n            *(p)++ = (FT_Byte)( (v) >> 0 ); \\\n                                            \\\n          } while ( 0 )\n\n#define WRITE_ULONG( p, v )                  \\\n          do                                 \\\n          {                                  \\\n            *(p)++ = (FT_Byte)( (v) >> 24 ); \\\n            *(p)++ = (FT_Byte)( (v) >> 16 ); \\\n            *(p)++ = (FT_Byte)( (v) >>  8 ); \\\n            *(p)++ = (FT_Byte)( (v) >>  0 ); \\\n                                             \\\n          } while ( 0 )\n\n\n  static void\n  sfnt_stream_close( FT_Stream  stream )\n  {\n    FT_Memory  memory = stream->memory;\n\n\n    FT_FREE( stream->base );\n\n    stream->size  = 0;\n    stream->base  = 0;\n    stream->close = 0;\n  }\n\n\n  FT_CALLBACK_DEF( int )\n  compare_offsets( const void*  a,\n                   const void*  b )\n  {\n    WOFF_Table  table1 = *(WOFF_Table*)a;\n    WOFF_Table  table2 = *(WOFF_Table*)b;\n\n    FT_ULong  offset1 = table1->Offset;\n    FT_ULong  offset2 = table2->Offset;\n\n\n    if ( offset1 > offset2 )\n      return 1;\n    else if ( offset1 < offset2 )\n      return -1;\n    else\n      return 0;\n  }\n\n\n  /* Replace `face->root.stream' with a stream containing the extracted */\n  /* SFNT of a WOFF font.                                               */\n\n  static FT_Error\n  woff_open_font( FT_Stream  stream,\n                  TT_Face    face )\n  {\n    FT_Memory       memory = stream->memory;\n    FT_Error        error  = FT_Err_Ok;\n\n    WOFF_HeaderRec  woff;\n    WOFF_Table      tables  = NULL;\n    WOFF_Table*     indices = NULL;\n\n    FT_ULong        woff_offset;\n\n    FT_Byte*        sfnt        = NULL;\n    FT_Stream       sfnt_stream = NULL;\n\n    FT_Byte*        sfnt_header;\n    FT_ULong        sfnt_offset;\n\n    FT_Int          nn;\n    FT_ULong        old_tag = 0;\n\n    static const FT_Frame_Field  woff_header_fields[] =\n    {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  WOFF_HeaderRec\n\n      FT_FRAME_START( 44 ),\n        FT_FRAME_ULONG ( signature ),\n        FT_FRAME_ULONG ( flavor ),\n        FT_FRAME_ULONG ( length ),\n        FT_FRAME_USHORT( num_tables ),\n        FT_FRAME_USHORT( reserved ),\n        FT_FRAME_ULONG ( totalSfntSize ),\n        FT_FRAME_USHORT( majorVersion ),\n        FT_FRAME_USHORT( minorVersion ),\n        FT_FRAME_ULONG ( metaOffset ),\n        FT_FRAME_ULONG ( metaLength ),\n        FT_FRAME_ULONG ( metaOrigLength ),\n        FT_FRAME_ULONG ( privOffset ),\n        FT_FRAME_ULONG ( privLength ),\n      FT_FRAME_END\n    };\n\n\n    FT_ASSERT( stream == face->root.stream );\n    FT_ASSERT( FT_STREAM_POS() == 0 );\n\n    if ( FT_STREAM_READ_FIELDS( woff_header_fields, &woff ) )\n      return error;\n\n    /* Make sure we don't recurse back here or hit TTC code. */\n    if ( woff.flavor == TTAG_wOFF || woff.flavor == TTAG_ttcf )\n      return FT_THROW( Invalid_Table );\n\n    /* Miscellaneous checks. */\n    if ( woff.length != stream->size                              ||\n         woff.num_tables == 0                                     ||\n         44 + woff.num_tables * 20UL >= woff.length               ||\n         12 + woff.num_tables * 16UL >= woff.totalSfntSize        ||\n         ( woff.totalSfntSize & 3 ) != 0                          ||\n         ( woff.metaOffset == 0 && ( woff.metaLength != 0     ||\n                                     woff.metaOrigLength != 0 ) ) ||\n         ( woff.metaLength != 0 && woff.metaOrigLength == 0 )     ||\n         ( woff.privOffset == 0 && woff.privLength != 0 )         )\n      return FT_THROW( Invalid_Table );\n\n    if ( FT_ALLOC( sfnt, woff.totalSfntSize ) ||\n         FT_NEW( sfnt_stream )                )\n      goto Exit;\n\n    sfnt_header = sfnt;\n\n    /* Write sfnt header. */\n    {\n      FT_UInt  searchRange, entrySelector, rangeShift, x;\n\n\n      x             = woff.num_tables;\n      entrySelector = 0;\n      while ( x )\n      {\n        x            >>= 1;\n        entrySelector += 1;\n      }\n      entrySelector--;\n\n      searchRange = ( 1 << entrySelector ) * 16;\n      rangeShift  = woff.num_tables * 16 - searchRange;\n\n      WRITE_ULONG ( sfnt_header, woff.flavor );\n      WRITE_USHORT( sfnt_header, woff.num_tables );\n      WRITE_USHORT( sfnt_header, searchRange );\n      WRITE_USHORT( sfnt_header, entrySelector );\n      WRITE_USHORT( sfnt_header, rangeShift );\n    }\n\n    /* While the entries in the sfnt header must be sorted by the */\n    /* tag value, the tables themselves are not.  We thus have to */\n    /* sort them by offset and check that they don't overlap.     */\n\n    if ( FT_NEW_ARRAY( tables, woff.num_tables )  ||\n         FT_NEW_ARRAY( indices, woff.num_tables ) )\n      goto Exit;\n\n    FT_TRACE2(( \"\\n\"\n                \"  tag    offset    compLen  origLen  checksum\\n\"\n                \"  -------------------------------------------\\n\" ));\n\n    if ( FT_FRAME_ENTER( 20L * woff.num_tables ) )\n      goto Exit;\n\n    for ( nn = 0; nn < woff.num_tables; nn++ )\n    {\n      WOFF_Table  table = tables + nn;\n\n      table->Tag        = FT_GET_TAG4();\n      table->Offset     = FT_GET_ULONG();\n      table->CompLength = FT_GET_ULONG();\n      table->OrigLength = FT_GET_ULONG();\n      table->CheckSum   = FT_GET_ULONG();\n\n      FT_TRACE2(( \"  %c%c%c%c  %08lx  %08lx  %08lx  %08lx\\n\",\n                  (FT_Char)( table->Tag >> 24 ),\n                  (FT_Char)( table->Tag >> 16 ),\n                  (FT_Char)( table->Tag >> 8  ),\n                  (FT_Char)( table->Tag       ),\n                  table->Offset,\n                  table->CompLength,\n                  table->OrigLength,\n                  table->CheckSum ));\n\n      if ( table->Tag <= old_tag )\n      {\n        FT_FRAME_EXIT();\n        error = FT_THROW( Invalid_Table );\n        goto Exit;\n      }\n\n      old_tag     = table->Tag;\n      indices[nn] = table;\n    }\n\n    FT_FRAME_EXIT();\n\n    /* Sort by offset. */\n\n    ft_qsort( indices,\n              woff.num_tables,\n              sizeof ( WOFF_Table ),\n              compare_offsets );\n\n    /* Check offsets and lengths. */\n\n    woff_offset = 44 + woff.num_tables * 20L;\n    sfnt_offset = 12 + woff.num_tables * 16L;\n\n    for ( nn = 0; nn < woff.num_tables; nn++ )\n    {\n      WOFF_Table  table = indices[nn];\n\n\n      if ( table->Offset != woff_offset                         ||\n           table->CompLength > woff.length                      ||\n           table->Offset > woff.length - table->CompLength      ||\n           table->OrigLength > woff.totalSfntSize               ||\n           sfnt_offset > woff.totalSfntSize - table->OrigLength ||\n           table->CompLength > table->OrigLength                )\n      {\n        error = FT_THROW( Invalid_Table );\n        goto Exit;\n      }\n\n      table->OrigOffset = sfnt_offset;\n\n      /* The offsets must be multiples of 4. */\n      woff_offset += ( table->CompLength + 3 ) & ~3;\n      sfnt_offset += ( table->OrigLength + 3 ) & ~3;\n    }\n\n    /*\n     * Final checks!\n     *\n     * We don't decode and check the metadata block.\n     * We don't check table checksums either.\n     * But other than those, I think we implement all\n     * `MUST' checks from the spec.\n     */\n\n    if ( woff.metaOffset )\n    {\n      if ( woff.metaOffset != woff_offset                  ||\n           woff.metaOffset + woff.metaLength > woff.length )\n      {\n        error = FT_THROW( Invalid_Table );\n        goto Exit;\n      }\n\n      /* We have padding only ... */\n      woff_offset += woff.metaLength;\n    }\n\n    if ( woff.privOffset )\n    {\n      /* ... if it isn't the last block. */\n      woff_offset = ( woff_offset + 3 ) & ~3;\n\n      if ( woff.privOffset != woff_offset                  ||\n           woff.privOffset + woff.privLength > woff.length )\n      {\n        error = FT_THROW( Invalid_Table );\n        goto Exit;\n      }\n\n      /* No padding for the last block. */\n      woff_offset += woff.privLength;\n    }\n\n    if ( sfnt_offset != woff.totalSfntSize ||\n         woff_offset != woff.length        )\n    {\n      error = FT_THROW( Invalid_Table );\n      goto Exit;\n    }\n\n    /* Write the tables. */\n\n    for ( nn = 0; nn < woff.num_tables; nn++ )\n    {\n      WOFF_Table  table = tables + nn;\n\n\n      /* Write SFNT table entry. */\n      WRITE_ULONG( sfnt_header, table->Tag );\n      WRITE_ULONG( sfnt_header, table->CheckSum );\n      WRITE_ULONG( sfnt_header, table->OrigOffset );\n      WRITE_ULONG( sfnt_header, table->OrigLength );\n\n      /* Write table data. */\n      if ( FT_STREAM_SEEK( table->Offset )     ||\n           FT_FRAME_ENTER( table->CompLength ) )\n        goto Exit;\n\n      if ( table->CompLength == table->OrigLength )\n      {\n        /* Uncompressed data; just copy. */\n        ft_memcpy( sfnt + table->OrigOffset,\n                   stream->cursor,\n                   table->OrigLength );\n      }\n      else\n      {\n#ifdef FT_CONFIG_OPTION_USE_ZLIB\n\n        /* Uncompress with zlib. */\n        FT_ULong  output_len = table->OrigLength;\n\n\n        error = FT_Gzip_Uncompress( memory,\n                                    sfnt + table->OrigOffset, &output_len,\n                                    stream->cursor, table->CompLength );\n        if ( error )\n          goto Exit;\n        if ( output_len != table->OrigLength )\n        {\n          error = FT_THROW( Invalid_Table );\n          goto Exit;\n        }\n\n#else /* !FT_CONFIG_OPTION_USE_ZLIB */\n\n        error = FT_THROW( Unimplemented_Feature );\n        goto Exit;\n\n#endif /* !FT_CONFIG_OPTION_USE_ZLIB */\n      }\n\n      FT_FRAME_EXIT();\n\n      /* We don't check whether the padding bytes in the WOFF file are     */\n      /* actually '\\0'.  For the output, however, we do set them properly. */\n      sfnt_offset = table->OrigOffset + table->OrigLength;\n      while ( sfnt_offset & 3 )\n      {\n        sfnt[sfnt_offset] = '\\0';\n        sfnt_offset++;\n      }\n    }\n\n    /* Ok!  Finally ready.  Swap out stream and return. */\n    FT_Stream_OpenMemory( sfnt_stream, sfnt, woff.totalSfntSize );\n    sfnt_stream->memory = stream->memory;\n    sfnt_stream->close  = sfnt_stream_close;\n\n    FT_Stream_Free(\n      face->root.stream,\n      ( face->root.face_flags & FT_FACE_FLAG_EXTERNAL_STREAM ) != 0 );\n\n    face->root.stream = sfnt_stream;\n\n    face->root.face_flags &= ~FT_FACE_FLAG_EXTERNAL_STREAM;\n\n  Exit:\n    FT_FREE( tables );\n    FT_FREE( indices );\n\n    if ( error )\n    {\n      FT_FREE( sfnt );\n      FT_Stream_Close( sfnt_stream );\n      FT_FREE( sfnt_stream );\n    }\n\n    return error;\n  }\n\n\n#undef WRITE_USHORT\n#undef WRITE_ULONG\n\n\n  /* Fill in face->ttc_header.  If the font is not a TTC, it is */\n  /* synthesized into a TTC with one offset table.              */\n  static FT_Error\n  sfnt_open_font( FT_Stream  stream,\n                  TT_Face    face )\n  {\n    FT_Memory  memory = stream->memory;\n    FT_Error   error;\n    FT_ULong   tag, offset;\n\n    static const FT_Frame_Field  ttc_header_fields[] =\n    {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  TTC_HeaderRec\n\n      FT_FRAME_START( 8 ),\n        FT_FRAME_LONG( version ),\n        FT_FRAME_LONG( count   ),  /* this is ULong in the specs */\n      FT_FRAME_END\n    };\n\n\n    face->ttc_header.tag     = 0;\n    face->ttc_header.version = 0;\n    face->ttc_header.count   = 0;\n\n  retry:\n    offset = FT_STREAM_POS();\n\n    if ( FT_READ_ULONG( tag ) )\n      return error;\n\n    if ( tag == TTAG_wOFF )\n    {\n      FT_TRACE2(( \"sfnt_open_font: file is a WOFF; synthesizing SFNT\\n\" ));\n\n      if ( FT_STREAM_SEEK( offset ) )\n        return error;\n\n      error = woff_open_font( stream, face );\n      if ( error )\n        return error;\n\n      /* Swap out stream and retry! */\n      stream = face->root.stream;\n      goto retry;\n    }\n\n    if ( tag != 0x00010000UL &&\n         tag != TTAG_ttcf    &&\n         tag != TTAG_OTTO    &&\n         tag != TTAG_true    &&\n         tag != TTAG_typ1    &&\n         tag != 0x00020000UL )\n    {\n      FT_TRACE2(( \"  not a font using the SFNT container format\\n\" ));\n      return FT_THROW( Unknown_File_Format );\n    }\n\n    face->ttc_header.tag = TTAG_ttcf;\n\n    if ( tag == TTAG_ttcf )\n    {\n      FT_Int  n;\n\n\n      FT_TRACE3(( \"sfnt_open_font: file is a collection\\n\" ));\n\n      if ( FT_STREAM_READ_FIELDS( ttc_header_fields, &face->ttc_header ) )\n        return error;\n\n      if ( face->ttc_header.count == 0 )\n        return FT_THROW( Invalid_Table );\n\n      /* a rough size estimate: let's conservatively assume that there   */\n      /* is just a single table info in each subfont header (12 + 16*1 = */\n      /* 28 bytes), thus we have (at least) `12 + 4*count' bytes for the */\n      /* size of the TTC header plus `28*count' bytes for all subfont    */\n      /* headers                                                         */\n      if ( (FT_ULong)face->ttc_header.count > stream->size / ( 28 + 4 ) )\n        return FT_THROW( Array_Too_Large );\n\n      /* now read the offsets of each font in the file */\n      if ( FT_NEW_ARRAY( face->ttc_header.offsets, face->ttc_header.count ) )\n        return error;\n\n      if ( FT_FRAME_ENTER( face->ttc_header.count * 4L ) )\n        return error;\n\n      for ( n = 0; n < face->ttc_header.count; n++ )\n        face->ttc_header.offsets[n] = FT_GET_ULONG();\n\n      FT_FRAME_EXIT();\n    }\n    else\n    {\n      FT_TRACE3(( \"sfnt_open_font: synthesize TTC\\n\" ));\n\n      face->ttc_header.version = 1 << 16;\n      face->ttc_header.count   = 1;\n\n      if ( FT_NEW( face->ttc_header.offsets ) )\n        return error;\n\n      face->ttc_header.offsets[0] = offset;\n    }\n\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  sfnt_init_face( FT_Stream      stream,\n                  TT_Face        face,\n                  FT_Int         face_index,\n                  FT_Int         num_params,\n                  FT_Parameter*  params )\n  {\n    FT_Error        error;\n    FT_Library      library = face->root.driver->root.library;\n    SFNT_Service    sfnt;\n\n\n    /* for now, parameters are unused */\n    FT_UNUSED( num_params );\n    FT_UNUSED( params );\n\n\n    sfnt = (SFNT_Service)face->sfnt;\n    if ( !sfnt )\n    {\n      sfnt = (SFNT_Service)FT_Get_Module_Interface( library, \"sfnt\" );\n      if ( !sfnt )\n      {\n        FT_ERROR(( \"sfnt_init_face: cannot access `sfnt' module\\n\" ));\n        return FT_THROW( Missing_Module );\n      }\n\n      face->sfnt       = sfnt;\n      face->goto_table = sfnt->goto_table;\n    }\n\n    FT_FACE_FIND_GLOBAL_SERVICE( face, face->psnames, POSTSCRIPT_CMAPS );\n\n    FT_TRACE2(( \"SFNT driver\\n\" ));\n\n    error = sfnt_open_font( stream, face );\n    if ( error )\n      return error;\n\n    /* Stream may have changed in sfnt_open_font. */\n    stream = face->root.stream;\n\n    FT_TRACE2(( \"sfnt_init_face: %08p, %ld\\n\", face, face_index ));\n\n    if ( face_index < 0 )\n      face_index = 0;\n\n    if ( face_index >= face->ttc_header.count )\n      return FT_THROW( Invalid_Argument );\n\n    if ( FT_STREAM_SEEK( face->ttc_header.offsets[face_index] ) )\n      return error;\n\n    /* check that we have a valid TrueType file */\n    error = sfnt->load_font_dir( face, stream );\n    if ( error )\n      return error;\n\n    face->root.num_faces  = face->ttc_header.count;\n    face->root.face_index = face_index;\n\n    return error;\n  }\n\n\n#define LOAD_( x )                                          \\\n  do                                                        \\\n  {                                                         \\\n    FT_TRACE2(( \"`\" #x \"' \" ));                             \\\n    FT_TRACE3(( \"-->\\n\" ));                                 \\\n                                                            \\\n    error = sfnt->load_ ## x( face, stream );               \\\n                                                            \\\n    FT_TRACE2(( \"%s\\n\", ( !error )                          \\\n                        ? \"loaded\"                          \\\n                        : FT_ERR_EQ( error, Table_Missing ) \\\n                          ? \"missing\"                       \\\n                          : \"failed to load\" ));            \\\n    FT_TRACE3(( \"\\n\" ));                                    \\\n  } while ( 0 )\n\n#define LOADM_( x, vertical )                               \\\n  do                                                        \\\n  {                                                         \\\n    FT_TRACE2(( \"`%s\" #x \"' \",                              \\\n                vertical ? \"vertical \" : \"\" ));             \\\n    FT_TRACE3(( \"-->\\n\" ));                                 \\\n                                                            \\\n    error = sfnt->load_ ## x( face, stream, vertical );     \\\n                                                            \\\n    FT_TRACE2(( \"%s\\n\", ( !error )                          \\\n                        ? \"loaded\"                          \\\n                        : FT_ERR_EQ( error, Table_Missing ) \\\n                          ? \"missing\"                       \\\n                          : \"failed to load\" ));            \\\n    FT_TRACE3(( \"\\n\" ));                                    \\\n  } while ( 0 )\n\n#define GET_NAME( id, field )                                   \\\n  do                                                            \\\n  {                                                             \\\n    error = tt_face_get_name( face, TT_NAME_ID_ ## id, field ); \\\n    if ( error )                                                \\\n      goto Exit;                                                \\\n  } while ( 0 )\n\n\n  FT_LOCAL_DEF( FT_Error )\n  sfnt_load_face( FT_Stream      stream,\n                  TT_Face        face,\n                  FT_Int         face_index,\n                  FT_Int         num_params,\n                  FT_Parameter*  params )\n  {\n    FT_Error      error;\n#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES\n    FT_Error      psnames_error;\n#endif\n    FT_Bool       has_outline;\n    FT_Bool       is_apple_sbit;\n    FT_Bool       is_apple_sbix;\n    FT_Bool       ignore_preferred_family    = FALSE;\n    FT_Bool       ignore_preferred_subfamily = FALSE;\n\n    SFNT_Service  sfnt = (SFNT_Service)face->sfnt;\n\n    FT_UNUSED( face_index );\n\n\n    /* Check parameters */\n\n    {\n      FT_Int  i;\n\n\n      for ( i = 0; i < num_params; i++ )\n      {\n        if ( params[i].tag == FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY )\n          ignore_preferred_family = TRUE;\n        else if ( params[i].tag == FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY )\n          ignore_preferred_subfamily = TRUE;\n      }\n    }\n\n    /* Load tables */\n\n    /* We now support two SFNT-based bitmapped font formats.  They */\n    /* are recognized easily as they do not include a `glyf'       */\n    /* table.                                                      */\n    /*                                                             */\n    /* The first format comes from Apple, and uses a table named   */\n    /* `bhed' instead of `head' to store the font header (using    */\n    /* the same format).  It also doesn't include horizontal and   */\n    /* vertical metrics tables (i.e. `hhea' and `vhea' tables are  */\n    /* missing).                                                   */\n    /*                                                             */\n    /* The other format comes from Microsoft, and is used with     */\n    /* WinCE/PocketPC.  It looks like a standard TTF, except that  */\n    /* it doesn't contain outlines.                                */\n    /*                                                             */\n\n    FT_TRACE2(( \"sfnt_load_face: %08p\\n\\n\", face ));\n\n    /* do we have outlines in there? */\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n    has_outline = FT_BOOL( face->root.internal->incremental_interface != 0 ||\n                           tt_face_lookup_table( face, TTAG_glyf )    != 0 ||\n                           tt_face_lookup_table( face, TTAG_CFF )     != 0 );\n#else\n    has_outline = FT_BOOL( tt_face_lookup_table( face, TTAG_glyf ) != 0 ||\n                           tt_face_lookup_table( face, TTAG_CFF )  != 0 );\n#endif\n\n    is_apple_sbit = 0;\n    is_apple_sbix = !face->goto_table( face, TTAG_sbix, stream, 0 );\n\n    /* Apple 'sbix' color bitmaps are rendered scaled and then the 'glyf'\n     * outline rendered on top.  We don't support that yet, so just ignore\n     * the 'glyf' outline and advertise it as a bitmap-only font. */\n    if ( is_apple_sbix )\n      has_outline = FALSE;\n\n    /* if this font doesn't contain outlines, we try to load */\n    /* a `bhed' table                                        */\n    if ( !has_outline && sfnt->load_bhed )\n    {\n      LOAD_( bhed );\n      is_apple_sbit = FT_BOOL( !error );\n    }\n\n    /* load the font header (`head' table) if this isn't an Apple */\n    /* sbit font file                                             */\n    if ( !is_apple_sbit || is_apple_sbix )\n    {\n      LOAD_( head );\n      if ( error )\n        goto Exit;\n    }\n\n    if ( face->header.Units_Per_EM == 0 )\n    {\n      error = FT_THROW( Invalid_Table );\n\n      goto Exit;\n    }\n\n    /* the following tables are often not present in embedded TrueType */\n    /* fonts within PDF documents, so don't check for them.            */\n    LOAD_( maxp );\n    LOAD_( cmap );\n\n    /* the following tables are optional in PCL fonts -- */\n    /* don't check for errors                            */\n    LOAD_( name );\n    LOAD_( post );\n\n#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES\n    psnames_error = error;\n#endif\n\n    /* do not load the metrics headers and tables if this is an Apple */\n    /* sbit font file                                                 */\n    if ( !is_apple_sbit )\n    {\n      /* load the `hhea' and `hmtx' tables */\n      LOADM_( hhea, 0 );\n      if ( !error )\n      {\n        LOADM_( hmtx, 0 );\n        if ( FT_ERR_EQ( error, Table_Missing ) )\n        {\n          error = FT_THROW( Hmtx_Table_Missing );\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n          /* If this is an incrementally loaded font and there are */\n          /* overriding metrics, tolerate a missing `hmtx' table.  */\n          if ( face->root.internal->incremental_interface          &&\n               face->root.internal->incremental_interface->funcs->\n                 get_glyph_metrics                                 )\n          {\n            face->horizontal.number_Of_HMetrics = 0;\n            error                               = FT_Err_Ok;\n          }\n#else /* cf. https://code.google.com/p/sumatrapdf/issues/detail?id=2778 */\n          FT_ERROR((\"sfnt_load_face: horizontal metrics (hmtx) table missing\\n\"));\n          face->horizontal.number_Of_HMetrics = 0;\n          error                               = FT_Err_Ok;\n#endif\n        }\n      }\n      else if ( FT_ERR_EQ( error, Table_Missing ) )\n      {\n        /* No `hhea' table necessary for SFNT Mac fonts. */\n        if ( face->format_tag == TTAG_true )\n        {\n          FT_TRACE2(( \"This is an SFNT Mac font.\\n\" ));\n\n          has_outline = 0;\n          error       = FT_Err_Ok;\n        }\n        else\n        {\n          error = FT_THROW( Horiz_Header_Missing );\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n          /* If this is an incrementally loaded font and there are */\n          /* overriding metrics, tolerate a missing `hhea' table.  */\n          if ( face->root.internal->incremental_interface          &&\n               face->root.internal->incremental_interface->funcs->\n                 get_glyph_metrics                                 )\n          {\n            face->horizontal.number_Of_HMetrics = 0;\n            error                               = FT_Err_Ok;\n          }\n#endif\n\n        }\n      }\n\n      if ( error )\n        goto Exit;\n\n      /* try to load the `vhea' and `vmtx' tables */\n      LOADM_( hhea, 1 );\n      if ( !error )\n      {\n        LOADM_( hmtx, 1 );\n        if ( !error )\n          face->vertical_info = 1;\n      }\n\n      if ( error && FT_ERR_NEQ( error, Table_Missing ) )\n        goto Exit;\n\n      LOAD_( os2 );\n      if ( error )\n      {\n        /* we treat the table as missing if there are any errors */\n        face->os2.version = 0xFFFFU;\n      }\n    }\n\n    /* the optional tables */\n\n    /* embedded bitmap support */\n    if ( sfnt->load_eblc )\n    {\n      LOAD_( eblc );\n      if ( error )\n      {\n        /* a font which contains neither bitmaps nor outlines is */\n        /* still valid (although rather useless in most cases);  */\n        /* however, you can find such stripped fonts in PDFs     */\n        if ( FT_ERR_EQ( error, Table_Missing ) )\n          error = FT_Err_Ok;\n        else\n          goto Exit;\n      }\n    }\n\n    LOAD_( pclt );\n    if ( error )\n    {\n      if ( FT_ERR_NEQ( error, Table_Missing ) )\n        goto Exit;\n\n      face->pclt.Version = 0;\n    }\n\n    /* consider the kerning and gasp tables as optional */\n    LOAD_( gasp );\n    LOAD_( kern );\n\n    face->root.num_glyphs = face->max_profile.numGlyphs;\n\n    /* Bit 8 of the `fsSelection' field in the `OS/2' table denotes  */\n    /* a WWS-only font face.  `WWS' stands for `weight', width', and */\n    /* `slope', a term used by Microsoft's Windows Presentation      */\n    /* Foundation (WPF).  This flag has been introduced in version   */\n    /* 1.5 of the OpenType specification (May 2008).                 */\n\n    face->root.family_name = NULL;\n    face->root.style_name  = NULL;\n    if ( face->os2.version != 0xFFFFU && face->os2.fsSelection & 256 )\n    {\n      if ( !ignore_preferred_family )\n        GET_NAME( PREFERRED_FAMILY, &face->root.family_name );\n      if ( !face->root.family_name )\n        GET_NAME( FONT_FAMILY, &face->root.family_name );\n\n      if ( !ignore_preferred_subfamily )\n        GET_NAME( PREFERRED_SUBFAMILY, &face->root.style_name );\n      if ( !face->root.style_name )\n        GET_NAME( FONT_SUBFAMILY, &face->root.style_name );\n    }\n    else\n    {\n      GET_NAME( WWS_FAMILY, &face->root.family_name );\n      if ( !face->root.family_name && !ignore_preferred_family )\n        GET_NAME( PREFERRED_FAMILY, &face->root.family_name );\n      if ( !face->root.family_name )\n        GET_NAME( FONT_FAMILY, &face->root.family_name );\n\n      GET_NAME( WWS_SUBFAMILY, &face->root.style_name );\n      if ( !face->root.style_name && !ignore_preferred_subfamily )\n        GET_NAME( PREFERRED_SUBFAMILY, &face->root.style_name );\n      if ( !face->root.style_name )\n        GET_NAME( FONT_SUBFAMILY, &face->root.style_name );\n    }\n\n    /* now set up root fields */\n    {\n      FT_Face  root  = &face->root;\n      FT_Long  flags = root->face_flags;\n\n\n      /*********************************************************************/\n      /*                                                                   */\n      /* Compute face flags.                                               */\n      /*                                                                   */\n      if ( face->sbit_table_type == TT_SBIT_TABLE_TYPE_CBLC ||\n           face->sbit_table_type == TT_SBIT_TABLE_TYPE_SBIX )\n        flags |= FT_FACE_FLAG_COLOR;      /* color glyphs */\n\n      if ( has_outline == TRUE )\n        flags |= FT_FACE_FLAG_SCALABLE;   /* scalable outlines */\n\n      /* The sfnt driver only supports bitmap fonts natively, thus we */\n      /* don't set FT_FACE_FLAG_HINTER.                               */\n      flags |= FT_FACE_FLAG_SFNT       |  /* SFNT file format  */\n               FT_FACE_FLAG_HORIZONTAL;   /* horizontal data   */\n\n#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES\n      if ( !psnames_error                             &&\n           face->postscript.FormatType != 0x00030000L )\n        flags |= FT_FACE_FLAG_GLYPH_NAMES;\n#endif\n\n      /* fixed width font? */\n      if ( face->postscript.isFixedPitch )\n        flags |= FT_FACE_FLAG_FIXED_WIDTH;\n\n      /* vertical information? */\n      if ( face->vertical_info )\n        flags |= FT_FACE_FLAG_VERTICAL;\n\n      /* kerning available ? */\n      if ( TT_FACE_HAS_KERNING( face ) )\n        flags |= FT_FACE_FLAG_KERNING;\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n      /* Don't bother to load the tables unless somebody asks for them. */\n      /* No need to do work which will (probably) not be used.          */\n      if ( tt_face_lookup_table( face, TTAG_glyf ) != 0 &&\n           tt_face_lookup_table( face, TTAG_fvar ) != 0 &&\n           tt_face_lookup_table( face, TTAG_gvar ) != 0 )\n        flags |= FT_FACE_FLAG_MULTIPLE_MASTERS;\n#endif\n\n      root->face_flags = flags;\n\n      /*********************************************************************/\n      /*                                                                   */\n      /* Compute style flags.                                              */\n      /*                                                                   */\n\n      flags = 0;\n      if ( has_outline == TRUE && face->os2.version != 0xFFFFU )\n      {\n        /* We have an OS/2 table; use the `fsSelection' field.  Bit 9 */\n        /* indicates an oblique font face.  This flag has been        */\n        /* introduced in version 1.5 of the OpenType specification.   */\n\n        if ( face->os2.fsSelection & 512 )       /* bit 9 */\n          flags |= FT_STYLE_FLAG_ITALIC;\n        else if ( face->os2.fsSelection & 1 )    /* bit 0 */\n          flags |= FT_STYLE_FLAG_ITALIC;\n\n        if ( face->os2.fsSelection & 32 )        /* bit 5 */\n          flags |= FT_STYLE_FLAG_BOLD;\n      }\n      else\n      {\n        /* this is an old Mac font, use the header field */\n\n        if ( face->header.Mac_Style & 1 )\n          flags |= FT_STYLE_FLAG_BOLD;\n\n        if ( face->header.Mac_Style & 2 )\n          flags |= FT_STYLE_FLAG_ITALIC;\n      }\n\n      root->style_flags = flags;\n\n      /*********************************************************************/\n      /*                                                                   */\n      /* Polish the charmaps.                                              */\n      /*                                                                   */\n      /*   Try to set the charmap encoding according to the platform &     */\n      /*   encoding ID of each charmap.                                    */\n      /*                                                                   */\n\n      tt_face_build_cmaps( face );  /* ignore errors */\n\n\n      /* set the encoding fields */\n      {\n        FT_Int  m;\n\n\n        for ( m = 0; m < root->num_charmaps; m++ )\n        {\n          FT_CharMap  charmap = root->charmaps[m];\n\n\n          charmap->encoding = sfnt_find_encoding( charmap->platform_id,\n                                                  charmap->encoding_id );\n\n#if 0\n          if ( root->charmap     == NULL &&\n               charmap->encoding == FT_ENCODING_UNICODE )\n          {\n            /* set 'root->charmap' to the first Unicode encoding we find */\n            root->charmap = charmap;\n          }\n#endif\n        }\n      }\n\n#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n\n      /*\n       *  Now allocate the root array of FT_Bitmap_Size records and\n       *  populate them.  Unfortunately, it isn't possible to indicate bit\n       *  depths in the FT_Bitmap_Size record.  This is a design error.\n       */\n      {\n        FT_UInt  i, count;\n\n\n        count = face->sbit_num_strikes;\n\n        if ( count > 0 )\n        {\n          FT_Memory        memory   = face->root.stream->memory;\n          FT_UShort        em_size  = face->header.Units_Per_EM;\n          FT_Short         avgwidth = face->os2.xAvgCharWidth;\n          FT_Size_Metrics  metrics;\n\n\n          if ( em_size == 0 || face->os2.version == 0xFFFFU )\n          {\n            avgwidth = 1;\n            em_size = 1;\n          }\n\n          if ( FT_NEW_ARRAY( root->available_sizes, count ) )\n            goto Exit;\n\n          for ( i = 0; i < count; i++ )\n          {\n            FT_Bitmap_Size*  bsize = root->available_sizes + i;\n\n\n            error = sfnt->load_strike_metrics( face, i, &metrics );\n            if ( error )\n              goto Exit;\n\n            bsize->height = (FT_Short)( metrics.height >> 6 );\n            bsize->width = (FT_Short)(\n                ( avgwidth * metrics.x_ppem + em_size / 2 ) / em_size );\n\n            bsize->x_ppem = metrics.x_ppem << 6;\n            bsize->y_ppem = metrics.y_ppem << 6;\n\n            /* assume 72dpi */\n            bsize->size   = metrics.y_ppem << 6;\n          }\n\n          root->face_flags     |= FT_FACE_FLAG_FIXED_SIZES;\n          root->num_fixed_sizes = (FT_Int)count;\n        }\n      }\n\n#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */\n\n      /* a font with no bitmaps and no outlines is scalable; */\n      /* it has only empty glyphs then                       */\n      if ( !FT_HAS_FIXED_SIZES( root ) && !FT_IS_SCALABLE( root ) )\n        root->face_flags |= FT_FACE_FLAG_SCALABLE;\n\n\n      /*********************************************************************/\n      /*                                                                   */\n      /*  Set up metrics.                                                  */\n      /*                                                                   */\n      if ( FT_IS_SCALABLE( root ) )\n      {\n        /* XXX What about if outline header is missing */\n        /*     (e.g. sfnt wrapped bitmap)?             */\n        root->bbox.xMin    = face->header.xMin;\n        root->bbox.yMin    = face->header.yMin;\n        root->bbox.xMax    = face->header.xMax;\n        root->bbox.yMax    = face->header.yMax;\n        root->units_per_EM = face->header.Units_Per_EM;\n\n\n        /* XXX: Computing the ascender/descender/height is very different */\n        /*      from what the specification tells you.  Apparently, we    */\n        /*      must be careful because                                   */\n        /*                                                                */\n        /*      - not all fonts have an OS/2 table; in this case, we take */\n        /*        the values in the horizontal header.  However, these    */\n        /*        values very often are not reliable.                     */\n        /*                                                                */\n        /*      - otherwise, the correct typographic values are in the    */\n        /*        sTypoAscender, sTypoDescender & sTypoLineGap fields.    */\n        /*                                                                */\n        /*        However, certain fonts have these fields set to 0.      */\n        /*        Rather, they have usWinAscent & usWinDescent correctly  */\n        /*        set (but with different values).                        */\n        /*                                                                */\n        /*      As an example, Arial Narrow is implemented through four   */\n        /*      files ARIALN.TTF, ARIALNI.TTF, ARIALNB.TTF & ARIALNBI.TTF */\n        /*                                                                */\n        /*      Strangely, all fonts have the same values in their        */\n        /*      sTypoXXX fields, except ARIALNB which sets them to 0.     */\n        /*                                                                */\n        /*      On the other hand, they all have different                */\n        /*      usWinAscent/Descent values -- as a conclusion, the OS/2   */\n        /*      table cannot be used to compute the text height reliably! */\n        /*                                                                */\n\n        /* The ascender and descender are taken from the `hhea' table. */\n        /* If zero, they are taken from the `OS/2' table.              */\n\n        root->ascender  = face->horizontal.Ascender;\n        root->descender = face->horizontal.Descender;\n\n        root->height = (FT_Short)( root->ascender - root->descender +\n                                   face->horizontal.Line_Gap );\n\n        if ( !( root->ascender || root->descender ) )\n        {\n          if ( face->os2.version != 0xFFFFU )\n          {\n            if ( face->os2.sTypoAscender || face->os2.sTypoDescender )\n            {\n              root->ascender  = face->os2.sTypoAscender;\n              root->descender = face->os2.sTypoDescender;\n\n              root->height = (FT_Short)( root->ascender - root->descender +\n                                         face->os2.sTypoLineGap );\n            }\n            else\n            {\n              root->ascender  =  (FT_Short)face->os2.usWinAscent;\n              root->descender = -(FT_Short)face->os2.usWinDescent;\n\n              root->height = (FT_UShort)( root->ascender - root->descender );\n            }\n          }\n        }\n\n        root->max_advance_width  = face->horizontal.advance_Width_Max;\n        root->max_advance_height = (FT_Short)( face->vertical_info\n                                     ? face->vertical.advance_Height_Max\n                                     : root->height );\n\n        /* See http://www.microsoft.com/OpenType/OTSpec/post.htm -- */\n        /* Adjust underline position from top edge to centre of     */\n        /* stroke to convert TrueType meaning to FreeType meaning.  */\n        root->underline_position  = face->postscript.underlinePosition -\n                                    face->postscript.underlineThickness / 2;\n        root->underline_thickness = face->postscript.underlineThickness;\n      }\n\n    }\n\n  Exit:\n    FT_TRACE2(( \"sfnt_load_face: done\\n\" ));\n\n    return error;\n  }\n\n\n#undef LOAD_\n#undef LOADM_\n#undef GET_NAME\n\n\n  FT_LOCAL_DEF( void )\n  sfnt_done_face( TT_Face  face )\n  {\n    FT_Memory     memory;\n    SFNT_Service  sfnt;\n\n\n    if ( !face )\n      return;\n\n    memory = face->root.memory;\n    sfnt   = (SFNT_Service)face->sfnt;\n\n    if ( sfnt )\n    {\n      /* destroy the postscript names table if it is loaded */\n      if ( sfnt->free_psnames )\n        sfnt->free_psnames( face );\n\n      /* destroy the embedded bitmaps table if it is loaded */\n      if ( sfnt->free_eblc )\n        sfnt->free_eblc( face );\n    }\n\n#ifdef TT_CONFIG_OPTION_BDF\n    /* freeing the embedded BDF properties */\n    tt_face_free_bdf_props( face );\n#endif\n\n    /* freeing the kerning table */\n    tt_face_done_kern( face );\n\n    /* freeing the collection table */\n    FT_FREE( face->ttc_header.offsets );\n    face->ttc_header.count = 0;\n\n    /* freeing table directory */\n    FT_FREE( face->dir_tables );\n    face->num_tables = 0;\n\n    {\n      FT_Stream  stream = FT_FACE_STREAM( face );\n\n\n      /* simply release the 'cmap' table frame */\n      FT_FRAME_RELEASE( face->cmap_table );\n      face->cmap_size = 0;\n    }\n\n    /* freeing the horizontal metrics */\n    {\n      FT_Stream  stream = FT_FACE_STREAM( face );\n\n\n      FT_FRAME_RELEASE( face->horz_metrics );\n      FT_FRAME_RELEASE( face->vert_metrics );\n      face->horz_metrics_size = 0;\n      face->vert_metrics_size = 0;\n    }\n\n    /* freeing the vertical ones, if any */\n    if ( face->vertical_info )\n    {\n      FT_FREE( face->vertical.long_metrics  );\n      FT_FREE( face->vertical.short_metrics );\n      face->vertical_info = 0;\n    }\n\n    /* freeing the gasp table */\n    FT_FREE( face->gasp.gaspRanges );\n    face->gasp.numRanges = 0;\n\n    /* freeing the name table */\n    if ( sfnt )\n      sfnt->free_name( face );\n\n    /* freeing family and style name */\n    FT_FREE( face->root.family_name );\n    FT_FREE( face->root.style_name );\n\n    /* freeing sbit size table */\n    FT_FREE( face->root.available_sizes );\n    face->root.num_fixed_sizes = 0;\n\n    FT_FREE( face->postscript_name );\n\n    face->sfnt = 0;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/sfobjs.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  sfobjs.h                                                               */\n/*                                                                         */\n/*    SFNT object management (specification).                              */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __SFOBJS_H__\n#define __SFOBJS_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_SFNT_H\n#include FT_INTERNAL_OBJECTS_H\n\n\nFT_BEGIN_HEADER\n\n\n  FT_LOCAL( FT_Error )\n  sfnt_init_face( FT_Stream      stream,\n                  TT_Face        face,\n                  FT_Int         face_index,\n                  FT_Int         num_params,\n                  FT_Parameter*  params );\n\n  FT_LOCAL( FT_Error )\n  sfnt_load_face( FT_Stream      stream,\n                  TT_Face        face,\n                  FT_Int         face_index,\n                  FT_Int         num_params,\n                  FT_Parameter*  params );\n\n  FT_LOCAL( void )\n  sfnt_done_face( TT_Face  face );\n\n\nFT_END_HEADER\n\n#endif /* __SFDRIVER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/ttbdf.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttbdf.c                                                                */\n/*                                                                         */\n/*    TrueType and OpenType embedded BDF properties (body).                */\n/*                                                                         */\n/*  Copyright 2005, 2006, 2010, 2013 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_TRUETYPE_TAGS_H\n#include \"ttbdf.h\"\n\n#include \"sferrors.h\"\n\n\n#ifdef TT_CONFIG_OPTION_BDF\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_ttbdf\n\n\n  FT_LOCAL_DEF( void )\n  tt_face_free_bdf_props( TT_Face  face )\n  {\n    TT_BDF  bdf = &face->bdf;\n\n\n    if ( bdf->loaded )\n    {\n      FT_Stream  stream = FT_FACE(face)->stream;\n\n\n      if ( bdf->table != NULL )\n        FT_FRAME_RELEASE( bdf->table );\n\n      bdf->table_end    = NULL;\n      bdf->strings      = NULL;\n      bdf->strings_size = 0;\n    }\n  }\n\n\n  static FT_Error\n  tt_face_load_bdf_props( TT_Face    face,\n                          FT_Stream  stream )\n  {\n    TT_BDF    bdf = &face->bdf;\n    FT_ULong  length;\n    FT_Error  error;\n\n\n    FT_ZERO( bdf );\n\n    error = tt_face_goto_table( face, TTAG_BDF, stream, &length );\n    if ( error                                  ||\n         length < 8                             ||\n         FT_FRAME_EXTRACT( length, bdf->table ) )\n    {\n      error = FT_THROW( Invalid_Table );\n      goto Exit;\n    }\n\n    bdf->table_end = bdf->table + length;\n\n    {\n      FT_Byte*   p           = bdf->table;\n      FT_UInt    version     = FT_NEXT_USHORT( p );\n      FT_UInt    num_strikes = FT_NEXT_USHORT( p );\n      FT_ULong   strings     = FT_NEXT_ULONG ( p );\n      FT_UInt    count;\n      FT_Byte*   strike;\n\n\n      if ( version != 0x0001                 ||\n           strings < 8                       ||\n           ( strings - 8 ) / 4 < num_strikes ||\n           strings + 1 > length              )\n      {\n        goto BadTable;\n      }\n\n      bdf->num_strikes  = num_strikes;\n      bdf->strings      = bdf->table + strings;\n      bdf->strings_size = length - strings;\n\n      count  = bdf->num_strikes;\n      p      = bdf->table + 8;\n      strike = p + count * 4;\n\n\n      for ( ; count > 0; count-- )\n      {\n        FT_UInt  num_items = FT_PEEK_USHORT( p + 2 );\n\n        /*\n         *  We don't need to check the value sets themselves, since this\n         *  is done later.\n         */\n        strike += 10 * num_items;\n\n        p += 4;\n      }\n\n      if ( strike > bdf->strings )\n        goto BadTable;\n    }\n\n    bdf->loaded = 1;\n\n  Exit:\n    return error;\n\n  BadTable:\n    FT_FRAME_RELEASE( bdf->table );\n    FT_ZERO( bdf );\n    error = FT_THROW( Invalid_Table );\n    goto Exit;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_find_bdf_prop( TT_Face           face,\n                         const char*       property_name,\n                         BDF_PropertyRec  *aprop )\n  {\n    TT_BDF     bdf   = &face->bdf;\n    FT_Size    size  = FT_FACE(face)->size;\n    FT_Error   error = FT_Err_Ok;\n    FT_Byte*   p;\n    FT_UInt    count;\n    FT_Byte*   strike;\n    FT_Offset  property_len;\n\n\n    aprop->type = BDF_PROPERTY_TYPE_NONE;\n\n    if ( bdf->loaded == 0 )\n    {\n      error = tt_face_load_bdf_props( face, FT_FACE( face )->stream );\n      if ( error )\n        goto Exit;\n    }\n\n    count  = bdf->num_strikes;\n    p      = bdf->table + 8;\n    strike = p + 4 * count;\n\n    error = FT_ERR( Invalid_Argument );\n\n    if ( size == NULL || property_name == NULL )\n      goto Exit;\n\n    property_len = ft_strlen( property_name );\n    if ( property_len == 0 )\n      goto Exit;\n\n    for ( ; count > 0; count-- )\n    {\n      FT_UInt  _ppem  = FT_NEXT_USHORT( p );\n      FT_UInt  _count = FT_NEXT_USHORT( p );\n\n      if ( _ppem == size->metrics.y_ppem )\n      {\n        count = _count;\n        goto FoundStrike;\n      }\n\n      strike += 10 * _count;\n    }\n    goto Exit;\n\n  FoundStrike:\n    p = strike;\n    for ( ; count > 0; count-- )\n    {\n      FT_UInt  type = FT_PEEK_USHORT( p + 4 );\n\n      if ( ( type & 0x10 ) != 0 )\n      {\n        FT_UInt32  name_offset = FT_PEEK_ULONG( p     );\n        FT_UInt32  value       = FT_PEEK_ULONG( p + 6 );\n\n        /* be a bit paranoid for invalid entries here */\n        if ( name_offset < bdf->strings_size                    &&\n             property_len < bdf->strings_size - name_offset     &&\n             ft_strncmp( property_name,\n                         (const char*)bdf->strings + name_offset,\n                         bdf->strings_size - name_offset ) == 0 )\n        {\n          switch ( type & 0x0F )\n          {\n          case 0x00:  /* string */\n          case 0x01:  /* atoms */\n            /* check that the content is really 0-terminated */\n            if ( value < bdf->strings_size &&\n                 ft_memchr( bdf->strings + value, 0, bdf->strings_size ) )\n            {\n              aprop->type   = BDF_PROPERTY_TYPE_ATOM;\n              aprop->u.atom = (const char*)bdf->strings + value;\n              error         = FT_Err_Ok;\n              goto Exit;\n            }\n            break;\n\n          case 0x02:\n            aprop->type      = BDF_PROPERTY_TYPE_INTEGER;\n            aprop->u.integer = (FT_Int32)value;\n            error            = FT_Err_Ok;\n            goto Exit;\n\n          case 0x03:\n            aprop->type       = BDF_PROPERTY_TYPE_CARDINAL;\n            aprop->u.cardinal = value;\n            error             = FT_Err_Ok;\n            goto Exit;\n\n          default:\n            ;\n          }\n        }\n      }\n      p += 10;\n    }\n\n  Exit:\n    return error;\n  }\n\n#endif /* TT_CONFIG_OPTION_BDF */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/ttbdf.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttbdf.h                                                                */\n/*                                                                         */\n/*    TrueType and OpenType embedded BDF properties (specification).       */\n/*                                                                         */\n/*  Copyright 2005 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTBDF_H__\n#define __TTBDF_H__\n\n\n#include <ft2build.h>\n#include \"ttload.h\"\n#include FT_BDF_H\n\n\nFT_BEGIN_HEADER\n\n\n  FT_LOCAL( void )\n  tt_face_free_bdf_props( TT_Face  face );\n\n\n  FT_LOCAL( FT_Error )\n  tt_face_find_bdf_prop( TT_Face           face,\n                         const char*       property_name,\n                         BDF_PropertyRec  *aprop );\n\n\nFT_END_HEADER\n\n#endif /* __TTBDF_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/ttcmap.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttcmap.c                                                               */\n/*                                                                         */\n/*    TrueType character mapping table (cmap) support (body).              */\n/*                                                                         */\n/*  Copyright 2002-2010, 2012-2014 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n\n#include \"sferrors.h\"           /* must come before FT_INTERNAL_VALIDATE_H */\n\n#include FT_INTERNAL_VALIDATE_H\n#include FT_INTERNAL_STREAM_H\n#include \"ttload.h\"\n#include \"ttcmap.h\"\n#include \"sfntpic.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_ttcmap\n\n\n#define TT_PEEK_SHORT   FT_PEEK_SHORT\n#define TT_PEEK_USHORT  FT_PEEK_USHORT\n#define TT_PEEK_UINT24  FT_PEEK_UOFF3\n#define TT_PEEK_LONG    FT_PEEK_LONG\n#define TT_PEEK_ULONG   FT_PEEK_ULONG\n\n#define TT_NEXT_SHORT   FT_NEXT_SHORT\n#define TT_NEXT_USHORT  FT_NEXT_USHORT\n#define TT_NEXT_UINT24  FT_NEXT_UOFF3\n#define TT_NEXT_LONG    FT_NEXT_LONG\n#define TT_NEXT_ULONG   FT_NEXT_ULONG\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap_init( TT_CMap   cmap,\n                FT_Byte*  table )\n  {\n    cmap->data = table;\n    return FT_Err_Ok;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                           FORMAT 0                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* TABLE OVERVIEW                                                        */\n  /* --------------                                                        */\n  /*                                                                       */\n  /*   NAME        OFFSET         TYPE          DESCRIPTION                */\n  /*                                                                       */\n  /*   format      0              USHORT        must be 0                  */\n  /*   length      2              USHORT        table length in bytes      */\n  /*   language    4              USHORT        Mac language code          */\n  /*   glyph_ids   6              BYTE[256]     array of glyph indices     */\n  /*               262                                                     */\n  /*                                                                       */\n\n#ifdef TT_CONFIG_CMAP_FORMAT_0\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap0_validate( FT_Byte*      table,\n                     FT_Validator  valid )\n  {\n    FT_Byte*  p;\n    FT_UInt   length;\n\n\n    if ( table + 2 + 2 > valid->limit )\n      FT_INVALID_TOO_SHORT;\n\n    p      = table + 2;           /* skip format */\n    length = TT_NEXT_USHORT( p );\n\n    if ( table + length > valid->limit || length < 262 )\n      FT_INVALID_TOO_SHORT;\n\n    /* check glyph indices whenever necessary */\n    if ( valid->level >= FT_VALIDATE_TIGHT )\n    {\n      FT_UInt  n, idx;\n\n\n      p = table + 6;\n      for ( n = 0; n < 256; n++ )\n      {\n        idx = *p++;\n        if ( idx >= TT_VALID_GLYPH_COUNT( valid ) )\n          FT_INVALID_GLYPH_ID;\n      }\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt )\n  tt_cmap0_char_index( TT_CMap    cmap,\n                       FT_UInt32  char_code )\n  {\n    FT_Byte*  table = cmap->data;\n\n\n    return char_code < 256 ? table[6 + char_code] : 0;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt32 )\n  tt_cmap0_char_next( TT_CMap     cmap,\n                      FT_UInt32  *pchar_code )\n  {\n    FT_Byte*   table    = cmap->data;\n    FT_UInt32  charcode = *pchar_code;\n    FT_UInt32  result   = 0;\n    FT_UInt    gindex   = 0;\n\n\n    table += 6;  /* go to glyph IDs */\n    while ( ++charcode < 256 )\n    {\n      gindex = table[charcode];\n      if ( gindex != 0 )\n      {\n        result = charcode;\n        break;\n      }\n    }\n\n    *pchar_code = result;\n    return gindex;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap0_get_info( TT_CMap       cmap,\n                     TT_CMapInfo  *cmap_info )\n  {\n    FT_Byte*  p = cmap->data + 4;\n\n\n    cmap_info->format   = 0;\n    cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_DEFINE_TT_CMAP(\n    tt_cmap0_class_rec,\n    sizeof ( TT_CMapRec ),\n\n    (FT_CMap_InitFunc)     tt_cmap_init,\n    (FT_CMap_DoneFunc)     NULL,\n    (FT_CMap_CharIndexFunc)tt_cmap0_char_index,\n    (FT_CMap_CharNextFunc) tt_cmap0_char_next,\n\n    NULL,\n    NULL,\n    NULL,\n    NULL,\n    NULL,\n\n    0,\n    (TT_CMap_ValidateFunc)tt_cmap0_validate,\n    (TT_CMap_Info_GetFunc)tt_cmap0_get_info )\n\n#endif /* TT_CONFIG_CMAP_FORMAT_0 */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                          FORMAT 2                             *****/\n  /*****                                                               *****/\n  /***** This is used for certain CJK encodings that encode text in a  *****/\n  /***** mixed 8/16 bits encoding along the following lines:           *****/\n  /*****                                                               *****/\n  /***** * Certain byte values correspond to an 8-bit character code   *****/\n  /*****   (typically in the range 0..127 for ASCII compatibility).    *****/\n  /*****                                                               *****/\n  /***** * Certain byte values signal the first byte of a 2-byte       *****/\n  /*****   character code (but these values are also valid as the      *****/\n  /*****   second byte of a 2-byte character).                         *****/\n  /*****                                                               *****/\n  /***** The following charmap lookup and iteration functions all      *****/\n  /***** assume that the value \"charcode\" correspond to following:     *****/\n  /*****                                                               *****/\n  /*****   - For one byte characters, \"charcode\" is simply the         *****/\n  /*****     character code.                                           *****/\n  /*****                                                               *****/\n  /*****   - For two byte characters, \"charcode\" is the 2-byte         *****/\n  /*****     character code in big endian format.  More exactly:       *****/\n  /*****                                                               *****/\n  /*****       (charcode >> 8)    is the first byte value              *****/\n  /*****       (charcode & 0xFF)  is the second byte value             *****/\n  /*****                                                               *****/\n  /***** Note that not all values of \"charcode\" are valid according    *****/\n  /***** to these rules, and the function moderately check the         *****/\n  /***** arguments.                                                    *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* TABLE OVERVIEW                                                        */\n  /* --------------                                                        */\n  /*                                                                       */\n  /*   NAME        OFFSET         TYPE            DESCRIPTION              */\n  /*                                                                       */\n  /*   format      0              USHORT          must be 2                */\n  /*   length      2              USHORT          table length in bytes    */\n  /*   language    4              USHORT          Mac language code        */\n  /*   keys        6              USHORT[256]     sub-header keys          */\n  /*   subs        518            SUBHEAD[NSUBS]  sub-headers array        */\n  /*   glyph_ids   518+NSUB*8     USHORT[]        glyph ID array           */\n  /*                                                                       */\n  /* The `keys' table is used to map charcode high-bytes to sub-headers.   */\n  /* The value of `NSUBS' is the number of sub-headers defined in the      */\n  /* table and is computed by finding the maximum of the `keys' table.     */\n  /*                                                                       */\n  /* Note that for any n, `keys[n]' is a byte offset within the `subs'     */\n  /* table, i.e., it is the corresponding sub-header index multiplied      */\n  /* by 8.                                                                 */\n  /*                                                                       */\n  /* Each sub-header has the following format:                             */\n  /*                                                                       */\n  /*   NAME        OFFSET      TYPE            DESCRIPTION                 */\n  /*                                                                       */\n  /*   first       0           USHORT          first valid low-byte        */\n  /*   count       2           USHORT          number of valid low-bytes   */\n  /*   delta       4           SHORT           see below                   */\n  /*   offset      6           USHORT          see below                   */\n  /*                                                                       */\n  /* A sub-header defines, for each high-byte, the range of valid          */\n  /* low-bytes within the charmap.  Note that the range defined by `first' */\n  /* and `count' must be completely included in the interval [0..255]      */\n  /* according to the specification.                                       */\n  /*                                                                       */\n  /* If a character code is contained within a given sub-header, then      */\n  /* mapping it to a glyph index is done as follows:                       */\n  /*                                                                       */\n  /* * The value of `offset' is read.  This is a _byte_ distance from the  */\n  /*   location of the `offset' field itself into a slice of the           */\n  /*   `glyph_ids' table.  Let's call it `slice' (it is a USHORT[] too).   */\n  /*                                                                       */\n  /* * The value `slice[char.lo - first]' is read.  If it is 0, there is   */\n  /*   no glyph for the charcode.  Otherwise, the value of `delta' is      */\n  /*   added to it (modulo 65536) to form a new glyph index.               */\n  /*                                                                       */\n  /* It is up to the validation routine to check that all offsets fall     */\n  /* within the glyph IDs table (and not within the `subs' table itself or */\n  /* outside of the CMap).                                                 */\n  /*                                                                       */\n\n#ifdef TT_CONFIG_CMAP_FORMAT_2\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap2_validate( FT_Byte*      table,\n                     FT_Validator  valid )\n  {\n    FT_Byte*  p;\n    FT_UInt   length;\n\n    FT_UInt   n, max_subs;\n    FT_Byte*  keys;        /* keys table     */\n    FT_Byte*  subs;        /* sub-headers    */\n    FT_Byte*  glyph_ids;   /* glyph ID array */\n\n\n    if ( table + 2 + 2 > valid->limit )\n      FT_INVALID_TOO_SHORT;\n\n    p      = table + 2;           /* skip format */\n    length = TT_NEXT_USHORT( p );\n\n    if ( table + length > valid->limit || length < 6 + 512 )\n      FT_INVALID_TOO_SHORT;\n\n    keys = table + 6;\n\n    /* parse keys to compute sub-headers count */\n    p        = keys;\n    max_subs = 0;\n    for ( n = 0; n < 256; n++ )\n    {\n      FT_UInt  idx = TT_NEXT_USHORT( p );\n\n\n      /* value must be multiple of 8 */\n      if ( valid->level >= FT_VALIDATE_PARANOID && ( idx & 7 ) != 0 )\n        FT_INVALID_DATA;\n\n      idx >>= 3;\n\n      if ( idx > max_subs )\n        max_subs = idx;\n    }\n\n    FT_ASSERT( p == table + 518 );\n\n    subs      = p;\n    glyph_ids = subs + (max_subs + 1) * 8;\n    if ( glyph_ids > valid->limit )\n      FT_INVALID_TOO_SHORT;\n\n    /* parse sub-headers */\n    for ( n = 0; n <= max_subs; n++ )\n    {\n      FT_UInt  first_code, code_count, offset;\n      FT_Int   delta;\n\n\n      first_code = TT_NEXT_USHORT( p );\n      code_count = TT_NEXT_USHORT( p );\n      delta      = TT_NEXT_SHORT( p );\n      offset     = TT_NEXT_USHORT( p );\n\n      /* many Dynalab fonts have empty sub-headers */\n      if ( code_count == 0 )\n        continue;\n\n      /* check range within 0..255 */\n      if ( valid->level >= FT_VALIDATE_PARANOID )\n      {\n        if ( first_code >= 256 || first_code + code_count > 256 )\n          FT_INVALID_DATA;\n      }\n\n      /* check offset */\n      if ( offset != 0 )\n      {\n        FT_Byte*  ids;\n\n\n        ids = p - 2 + offset;\n        if ( ids < glyph_ids || ids + code_count*2 > table + length )\n          FT_INVALID_OFFSET;\n\n        /* check glyph IDs */\n        if ( valid->level >= FT_VALIDATE_TIGHT )\n        {\n          FT_Byte*  limit = p + code_count * 2;\n          FT_UInt   idx;\n\n\n          for ( ; p < limit; )\n          {\n            idx = TT_NEXT_USHORT( p );\n            if ( idx != 0 )\n            {\n              idx = ( idx + delta ) & 0xFFFFU;\n              if ( idx >= TT_VALID_GLYPH_COUNT( valid ) )\n                FT_INVALID_GLYPH_ID;\n            }\n          }\n        }\n      }\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n  /* return sub header corresponding to a given character code */\n  /* NULL on invalid charcode                                  */\n  static FT_Byte*\n  tt_cmap2_get_subheader( FT_Byte*   table,\n                          FT_UInt32  char_code )\n  {\n    FT_Byte*  result = NULL;\n\n\n    if ( char_code < 0x10000UL )\n    {\n      FT_UInt   char_lo = (FT_UInt)( char_code & 0xFF );\n      FT_UInt   char_hi = (FT_UInt)( char_code >> 8 );\n      FT_Byte*  p       = table + 6;    /* keys table */\n      FT_Byte*  subs    = table + 518;  /* subheaders table */\n      FT_Byte*  sub;\n\n\n      if ( char_hi == 0 )\n      {\n        /* an 8-bit character code -- we use subHeader 0 in this case */\n        /* to test whether the character code is in the charmap       */\n        /*                                                            */\n        sub = subs;  /* jump to first sub-header */\n\n        /* check that the sub-header for this byte is 0, which */\n        /* indicates that it is really a valid one-byte value  */\n        /* Otherwise, return 0                                 */\n        /*                                                     */\n        p += char_lo * 2;\n        if ( TT_PEEK_USHORT( p ) != 0 )\n          goto Exit;\n      }\n      else\n      {\n        /* a 16-bit character code */\n\n        /* jump to key entry  */\n        p  += char_hi * 2;\n        /* jump to sub-header */\n        sub = subs + ( FT_PAD_FLOOR( TT_PEEK_USHORT( p ), 8 ) );\n\n        /* check that the high byte isn't a valid one-byte value */\n        if ( sub == subs )\n          goto Exit;\n      }\n      result = sub;\n    }\n  Exit:\n    return result;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt )\n  tt_cmap2_char_index( TT_CMap    cmap,\n                       FT_UInt32  char_code )\n  {\n    FT_Byte*  table   = cmap->data;\n    FT_UInt   result  = 0;\n    FT_Byte*  subheader;\n\n\n    subheader = tt_cmap2_get_subheader( table, char_code );\n    if ( subheader )\n    {\n      FT_Byte*  p   = subheader;\n      FT_UInt   idx = (FT_UInt)(char_code & 0xFF);\n      FT_UInt   start, count;\n      FT_Int    delta;\n      FT_UInt   offset;\n\n\n      start  = TT_NEXT_USHORT( p );\n      count  = TT_NEXT_USHORT( p );\n      delta  = TT_NEXT_SHORT ( p );\n      offset = TT_PEEK_USHORT( p );\n\n      idx -= start;\n      if ( idx < count && offset != 0 )\n      {\n        p  += offset + 2 * idx;\n        idx = TT_PEEK_USHORT( p );\n\n        if ( idx != 0 )\n          result = (FT_UInt)( idx + delta ) & 0xFFFFU;\n      }\n    }\n    return result;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt32 )\n  tt_cmap2_char_next( TT_CMap     cmap,\n                      FT_UInt32  *pcharcode )\n  {\n    FT_Byte*   table    = cmap->data;\n    FT_UInt    gindex   = 0;\n    FT_UInt32  result   = 0;\n    FT_UInt32  charcode = *pcharcode + 1;\n    FT_Byte*   subheader;\n\n\n    while ( charcode < 0x10000UL )\n    {\n      subheader = tt_cmap2_get_subheader( table, charcode );\n      if ( subheader )\n      {\n        FT_Byte*  p       = subheader;\n        FT_UInt   start   = TT_NEXT_USHORT( p );\n        FT_UInt   count   = TT_NEXT_USHORT( p );\n        FT_Int    delta   = TT_NEXT_SHORT ( p );\n        FT_UInt   offset  = TT_PEEK_USHORT( p );\n        FT_UInt   char_lo = (FT_UInt)( charcode & 0xFF );\n        FT_UInt   pos, idx;\n\n\n        if ( offset == 0 )\n          goto Next_SubHeader;\n\n        if ( char_lo < start )\n        {\n          char_lo = start;\n          pos     = 0;\n        }\n        else\n          pos = (FT_UInt)( char_lo - start );\n\n        p       += offset + pos * 2;\n        charcode = FT_PAD_FLOOR( charcode, 256 ) + char_lo;\n\n        for ( ; pos < count; pos++, charcode++ )\n        {\n          idx = TT_NEXT_USHORT( p );\n\n          if ( idx != 0 )\n          {\n            gindex = ( idx + delta ) & 0xFFFFU;\n            if ( gindex != 0 )\n            {\n              result = charcode;\n              goto Exit;\n            }\n          }\n        }\n      }\n\n      /* jump to next sub-header, i.e. higher byte value */\n    Next_SubHeader:\n      charcode = FT_PAD_FLOOR( charcode, 256 ) + 256;\n    }\n\n  Exit:\n    *pcharcode = result;\n\n    return gindex;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap2_get_info( TT_CMap       cmap,\n                     TT_CMapInfo  *cmap_info )\n  {\n    FT_Byte*  p = cmap->data + 4;\n\n\n    cmap_info->format   = 2;\n    cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_DEFINE_TT_CMAP(\n    tt_cmap2_class_rec,\n    sizeof ( TT_CMapRec ),\n\n    (FT_CMap_InitFunc)     tt_cmap_init,\n    (FT_CMap_DoneFunc)     NULL,\n    (FT_CMap_CharIndexFunc)tt_cmap2_char_index,\n    (FT_CMap_CharNextFunc) tt_cmap2_char_next,\n\n    NULL,\n    NULL,\n    NULL,\n    NULL,\n    NULL,\n\n    2,\n    (TT_CMap_ValidateFunc)tt_cmap2_validate,\n    (TT_CMap_Info_GetFunc)tt_cmap2_get_info )\n\n#endif /* TT_CONFIG_CMAP_FORMAT_2 */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                           FORMAT 4                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* TABLE OVERVIEW                                                        */\n  /* --------------                                                        */\n  /*                                                                       */\n  /*   NAME          OFFSET         TYPE              DESCRIPTION          */\n  /*                                                                       */\n  /*   format        0              USHORT            must be 4            */\n  /*   length        2              USHORT            table length         */\n  /*                                                  in bytes             */\n  /*   language      4              USHORT            Mac language code    */\n  /*                                                                       */\n  /*   segCountX2    6              USHORT            2*NUM_SEGS           */\n  /*   searchRange   8              USHORT            2*(1 << LOG_SEGS)    */\n  /*   entrySelector 10             USHORT            LOG_SEGS             */\n  /*   rangeShift    12             USHORT            segCountX2 -         */\n  /*                                                    searchRange        */\n  /*                                                                       */\n  /*   endCount      14             USHORT[NUM_SEGS]  end charcode for     */\n  /*                                                  each segment; last   */\n  /*                                                  is 0xFFFF            */\n  /*                                                                       */\n  /*   pad           14+NUM_SEGS*2  USHORT            padding              */\n  /*                                                                       */\n  /*   startCount    16+NUM_SEGS*2  USHORT[NUM_SEGS]  first charcode for   */\n  /*                                                  each segment         */\n  /*                                                                       */\n  /*   idDelta       16+NUM_SEGS*4  SHORT[NUM_SEGS]   delta for each       */\n  /*                                                  segment              */\n  /*   idOffset      16+NUM_SEGS*6  SHORT[NUM_SEGS]   range offset for     */\n  /*                                                  each segment; can be */\n  /*                                                  zero                 */\n  /*                                                                       */\n  /*   glyphIds      16+NUM_SEGS*8  USHORT[]          array of glyph ID    */\n  /*                                                  ranges               */\n  /*                                                                       */\n  /* Character codes are modelled by a series of ordered (increasing)      */\n  /* intervals called segments.  Each segment has start and end codes,     */\n  /* provided by the `startCount' and `endCount' arrays.  Segments must    */\n  /* not overlap, and the last segment should always contain the value     */\n  /* 0xFFFF for `endCount'.                                                */\n  /*                                                                       */\n  /* The fields `searchRange', `entrySelector' and `rangeShift' are better */\n  /* ignored (they are traces of over-engineering in the TrueType          */\n  /* specification).                                                       */\n  /*                                                                       */\n  /* Each segment also has a signed `delta', as well as an optional offset */\n  /* within the `glyphIds' table.                                          */\n  /*                                                                       */\n  /* If a segment's idOffset is 0, the glyph index corresponding to any    */\n  /* charcode within the segment is obtained by adding the value of        */\n  /* `idDelta' directly to the charcode, modulo 65536.                     */\n  /*                                                                       */\n  /* Otherwise, a glyph index is taken from the glyph IDs sub-array for    */\n  /* the segment, and the value of `idDelta' is added to it.               */\n  /*                                                                       */\n  /*                                                                       */\n  /* Finally, note that a lot of fonts contain an invalid last segment,    */\n  /* where `start' and `end' are correctly set to 0xFFFF but both `delta'  */\n  /* and `offset' are incorrect (e.g., `opens___.ttf' which comes with     */\n  /* OpenOffice.org).  We need special code to deal with them correctly.   */\n  /*                                                                       */\n\n#ifdef TT_CONFIG_CMAP_FORMAT_4\n\n  typedef struct  TT_CMap4Rec_\n  {\n    TT_CMapRec  cmap;\n    FT_UInt32   cur_charcode;   /* current charcode */\n    FT_UInt     cur_gindex;     /* current glyph index */\n\n    FT_UInt     num_ranges;\n    FT_UInt     cur_range;\n    FT_UInt     cur_start;\n    FT_UInt     cur_end;\n    FT_Int      cur_delta;\n    FT_Byte*    cur_values;\n\n  } TT_CMap4Rec, *TT_CMap4;\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap4_init( TT_CMap4  cmap,\n                 FT_Byte*  table )\n  {\n    FT_Byte*  p;\n\n\n    cmap->cmap.data    = table;\n\n    p                  = table + 6;\n    cmap->num_ranges   = FT_PEEK_USHORT( p ) >> 1;\n    cmap->cur_charcode = (FT_UInt32)0xFFFFFFFFUL;\n    cmap->cur_gindex   = 0;\n\n    return FT_Err_Ok;\n  }\n\n\n  static FT_Int\n  tt_cmap4_set_range( TT_CMap4  cmap,\n                      FT_UInt   range_index )\n  {\n    FT_Byte*  table = cmap->cmap.data;\n    FT_Byte*  p;\n    FT_UInt   num_ranges = cmap->num_ranges;\n\n\n    while ( range_index < num_ranges )\n    {\n      FT_UInt  offset;\n\n\n      p             = table + 14 + range_index * 2;\n      cmap->cur_end = FT_PEEK_USHORT( p );\n\n      p              += 2 + num_ranges * 2;\n      cmap->cur_start = FT_PEEK_USHORT( p );\n\n      p              += num_ranges * 2;\n      cmap->cur_delta = FT_PEEK_SHORT( p );\n\n      p     += num_ranges * 2;\n      offset = FT_PEEK_USHORT( p );\n\n      /* some fonts have an incorrect last segment; */\n      /* we have to catch it                        */\n      if ( range_index     >= num_ranges - 1 &&\n           cmap->cur_start == 0xFFFFU        &&\n           cmap->cur_end   == 0xFFFFU        )\n      {\n        TT_Face   face  = (TT_Face)cmap->cmap.cmap.charmap.face;\n        FT_Byte*  limit = face->cmap_table + face->cmap_size;\n\n\n        if ( offset && p + offset + 2 > limit )\n        {\n          cmap->cur_delta = 1;\n          offset          = 0;\n        }\n      }\n\n      if ( offset != 0xFFFFU )\n      {\n        cmap->cur_values = offset ? p + offset : NULL;\n        cmap->cur_range  = range_index;\n        return 0;\n      }\n\n      /* we skip empty segments */\n      range_index++;\n    }\n\n    return -1;\n  }\n\n\n  /* search the index of the charcode next to cmap->cur_charcode; */\n  /* caller should call tt_cmap4_set_range with proper range      */\n  /* before calling this function                                 */\n  /*                                                              */\n  static void\n  tt_cmap4_next( TT_CMap4  cmap )\n  {\n    FT_UInt  charcode;\n\n\n    if ( cmap->cur_charcode >= 0xFFFFUL )\n      goto Fail;\n\n    charcode = (FT_UInt)cmap->cur_charcode + 1;\n\n    if ( charcode < cmap->cur_start )\n      charcode = cmap->cur_start;\n\n    for ( ;; )\n    {\n      FT_Byte*  values = cmap->cur_values;\n      FT_UInt   end    = cmap->cur_end;\n      FT_Int    delta  = cmap->cur_delta;\n\n\n      if ( charcode <= end )\n      {\n        if ( values )\n        {\n          FT_Byte*  p = values + 2 * ( charcode - cmap->cur_start );\n\n\n          do\n          {\n            FT_UInt  gindex = FT_NEXT_USHORT( p );\n\n\n            if ( gindex != 0 )\n            {\n              gindex = (FT_UInt)( ( gindex + delta ) & 0xFFFFU );\n              if ( gindex != 0 )\n              {\n                cmap->cur_charcode = charcode;\n                cmap->cur_gindex   = gindex;\n                return;\n              }\n            }\n          } while ( ++charcode <= end );\n        }\n        else\n        {\n          do\n          {\n            FT_UInt  gindex = (FT_UInt)( ( charcode + delta ) & 0xFFFFU );\n\n\n            if ( gindex != 0 )\n            {\n              cmap->cur_charcode = charcode;\n              cmap->cur_gindex   = gindex;\n              return;\n            }\n          } while ( ++charcode <= end );\n        }\n      }\n\n      /* we need to find another range */\n      if ( tt_cmap4_set_range( cmap, cmap->cur_range + 1 ) < 0 )\n        break;\n\n      if ( charcode < cmap->cur_start )\n        charcode = cmap->cur_start;\n    }\n\n  Fail:\n    cmap->cur_charcode = (FT_UInt32)0xFFFFFFFFUL;\n    cmap->cur_gindex   = 0;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap4_validate( FT_Byte*      table,\n                     FT_Validator  valid )\n  {\n    FT_Byte*  p;\n    FT_UInt   length;\n\n    FT_Byte   *ends, *starts, *offsets, *deltas, *glyph_ids;\n    FT_UInt   num_segs;\n    FT_Error  error = FT_Err_Ok;\n\n\n    if ( table + 2 + 2 > valid->limit )\n      FT_INVALID_TOO_SHORT;\n\n    p      = table + 2;           /* skip format */\n    length = TT_NEXT_USHORT( p );\n\n    /* in certain fonts, the `length' field is invalid and goes */\n    /* out of bound.  We try to correct this here...            */\n    if ( table + length > valid->limit )\n    {\n      if ( valid->level >= FT_VALIDATE_TIGHT )\n        FT_INVALID_TOO_SHORT;\n\n      length = (FT_UInt)( valid->limit - table );\n    }\n\n    if ( length < 16 )\n      FT_INVALID_TOO_SHORT;\n\n    p        = table + 6;\n    num_segs = TT_NEXT_USHORT( p );   /* read segCountX2 */\n\n    if ( valid->level >= FT_VALIDATE_PARANOID )\n    {\n      /* check that we have an even value here */\n      if ( num_segs & 1 )\n        FT_INVALID_DATA;\n    }\n\n    num_segs /= 2;\n\n    if ( length < 16 + num_segs * 2 * 4 )\n      FT_INVALID_TOO_SHORT;\n\n    /* check the search parameters - even though we never use them */\n    /*                                                             */\n    if ( valid->level >= FT_VALIDATE_PARANOID )\n    {\n      /* check the values of `searchRange', `entrySelector', `rangeShift' */\n      FT_UInt  search_range   = TT_NEXT_USHORT( p );\n      FT_UInt  entry_selector = TT_NEXT_USHORT( p );\n      FT_UInt  range_shift    = TT_NEXT_USHORT( p );\n\n\n      if ( ( search_range | range_shift ) & 1 )  /* must be even values */\n        FT_INVALID_DATA;\n\n      search_range /= 2;\n      range_shift  /= 2;\n\n      /* `search range' is the greatest power of 2 that is <= num_segs */\n\n      if ( search_range                > num_segs                 ||\n           search_range * 2            < num_segs                 ||\n           search_range + range_shift != num_segs                 ||\n           search_range               != ( 1U << entry_selector ) )\n        FT_INVALID_DATA;\n    }\n\n    ends      = table   + 14;\n    starts    = table   + 16 + num_segs * 2;\n    deltas    = starts  + num_segs * 2;\n    offsets   = deltas  + num_segs * 2;\n    glyph_ids = offsets + num_segs * 2;\n\n    /* check last segment; its end count value must be 0xFFFF */\n    if ( valid->level >= FT_VALIDATE_PARANOID )\n    {\n      p = ends + ( num_segs - 1 ) * 2;\n      if ( TT_PEEK_USHORT( p ) != 0xFFFFU )\n        FT_INVALID_DATA;\n    }\n\n    {\n      FT_UInt   start, end, offset, n;\n      FT_UInt   last_start = 0, last_end = 0;\n      FT_Int    delta;\n      FT_Byte*  p_start   = starts;\n      FT_Byte*  p_end     = ends;\n      FT_Byte*  p_delta   = deltas;\n      FT_Byte*  p_offset  = offsets;\n\n\n      for ( n = 0; n < num_segs; n++ )\n      {\n        p      = p_offset;\n        start  = TT_NEXT_USHORT( p_start );\n        end    = TT_NEXT_USHORT( p_end );\n        delta  = TT_NEXT_SHORT( p_delta );\n        offset = TT_NEXT_USHORT( p_offset );\n\n        if ( start > end )\n          FT_INVALID_DATA;\n\n        /* this test should be performed at default validation level; */\n        /* unfortunately, some popular Asian fonts have overlapping   */\n        /* ranges in their charmaps                                   */\n        /*                                                            */\n        if ( start <= last_end && n > 0 )\n        {\n          if ( valid->level >= FT_VALIDATE_TIGHT )\n            FT_INVALID_DATA;\n          else\n          {\n            /* allow overlapping segments, provided their start points */\n            /* and end points, respectively, are in ascending order    */\n            /*                                                         */\n            if ( last_start > start || last_end > end )\n              error |= TT_CMAP_FLAG_UNSORTED;\n            else\n              error |= TT_CMAP_FLAG_OVERLAPPING;\n          }\n        }\n\n        if ( offset && offset != 0xFFFFU )\n        {\n          p += offset;  /* start of glyph ID array */\n\n          /* check that we point within the glyph IDs table only */\n          if ( valid->level >= FT_VALIDATE_TIGHT )\n          {\n            if ( p < glyph_ids                                ||\n                 p + ( end - start + 1 ) * 2 > table + length )\n              FT_INVALID_DATA;\n          }\n          /* Some fonts handle the last segment incorrectly.  In */\n          /* theory, 0xFFFF might point to an ordinary glyph --  */\n          /* a cmap 4 is versatile and could be used for any     */\n          /* encoding, not only Unicode.  However, reality shows */\n          /* that far too many fonts are sloppy and incorrectly  */\n          /* set all fields but `start' and `end' for the last   */\n          /* segment if it contains only a single character.     */\n          /*                                                     */\n          /* We thus omit the test here, delaying it to the      */\n          /* routines which actually access the cmap.            */\n          else if ( n != num_segs - 1                       ||\n                    !( start == 0xFFFFU && end == 0xFFFFU ) )\n          {\n            if ( p < glyph_ids                              ||\n                 p + ( end - start + 1 ) * 2 > valid->limit )\n              FT_INVALID_DATA;\n          }\n\n          /* check glyph indices within the segment range */\n          if ( valid->level >= FT_VALIDATE_TIGHT )\n          {\n            FT_UInt  i, idx;\n\n\n            for ( i = start; i < end; i++ )\n            {\n              idx = FT_NEXT_USHORT( p );\n              if ( idx != 0 )\n              {\n                idx = (FT_UInt)( idx + delta ) & 0xFFFFU;\n\n                if ( idx >= TT_VALID_GLYPH_COUNT( valid ) )\n                  FT_INVALID_GLYPH_ID;\n              }\n            }\n          }\n        }\n        else if ( offset == 0xFFFFU )\n        {\n          /* some fonts (erroneously?) use a range offset of 0xFFFF */\n          /* to mean missing glyph in cmap table                    */\n          /*                                                        */\n          if ( valid->level >= FT_VALIDATE_PARANOID    ||\n               n != num_segs - 1                       ||\n               !( start == 0xFFFFU && end == 0xFFFFU ) )\n            FT_INVALID_DATA;\n        }\n\n        last_start = start;\n        last_end   = end;\n      }\n    }\n\n    return error;\n  }\n\n\n  static FT_UInt\n  tt_cmap4_char_map_linear( TT_CMap     cmap,\n                            FT_UInt32*  pcharcode,\n                            FT_Bool     next )\n  {\n    FT_UInt    num_segs2, start, end, offset;\n    FT_Int     delta;\n    FT_UInt    i, num_segs;\n    FT_UInt32  charcode = *pcharcode;\n    FT_UInt    gindex   = 0;\n    FT_Byte*   p;\n\n\n    p = cmap->data + 6;\n    num_segs2 = FT_PAD_FLOOR( TT_PEEK_USHORT( p ), 2 );\n\n    num_segs = num_segs2 >> 1;\n\n    if ( !num_segs )\n      return 0;\n\n    if ( next )\n      charcode++;\n\n    /* linear search */\n    for ( ; charcode <= 0xFFFFU; charcode++ )\n    {\n      FT_Byte*  q;\n\n\n      p = cmap->data + 14;               /* ends table   */\n      q = cmap->data + 16 + num_segs2;   /* starts table */\n\n      for ( i = 0; i < num_segs; i++ )\n      {\n        end   = TT_NEXT_USHORT( p );\n        start = TT_NEXT_USHORT( q );\n\n        if ( charcode >= start && charcode <= end )\n        {\n          p       = q - 2 + num_segs2;\n          delta   = TT_PEEK_SHORT( p );\n          p      += num_segs2;\n          offset  = TT_PEEK_USHORT( p );\n\n          /* some fonts have an incorrect last segment; */\n          /* we have to catch it                        */\n          if ( i >= num_segs - 1                  &&\n               start == 0xFFFFU && end == 0xFFFFU )\n          {\n            TT_Face   face  = (TT_Face)cmap->cmap.charmap.face;\n            FT_Byte*  limit = face->cmap_table + face->cmap_size;\n\n\n            if ( offset && p + offset + 2 > limit )\n            {\n              delta  = 1;\n              offset = 0;\n            }\n          }\n\n          if ( offset == 0xFFFFU )\n            continue;\n\n          if ( offset )\n          {\n            p += offset + ( charcode - start ) * 2;\n            gindex = TT_PEEK_USHORT( p );\n            if ( gindex != 0 )\n              gindex = (FT_UInt)( gindex + delta ) & 0xFFFFU;\n          }\n          else\n            gindex = (FT_UInt)( charcode + delta ) & 0xFFFFU;\n\n          break;\n        }\n      }\n\n      if ( !next || gindex )\n        break;\n    }\n\n    if ( next && gindex )\n      *pcharcode = charcode;\n\n    return gindex;\n  }\n\n\n  static FT_UInt\n  tt_cmap4_char_map_binary( TT_CMap     cmap,\n                            FT_UInt32*  pcharcode,\n                            FT_Bool     next )\n  {\n    FT_UInt   num_segs2, start, end, offset;\n    FT_Int    delta;\n    FT_UInt   max, min, mid, num_segs;\n    FT_UInt   charcode = (FT_UInt)*pcharcode;\n    FT_UInt   gindex   = 0;\n    FT_Byte*  p;\n\n\n    p = cmap->data + 6;\n    num_segs2 = FT_PAD_FLOOR( TT_PEEK_USHORT( p ), 2 );\n\n    if ( !num_segs2 )\n      return 0;\n\n    num_segs = num_segs2 >> 1;\n\n    /* make compiler happy */\n    mid = num_segs;\n    end = 0xFFFFU;\n\n    if ( next )\n      charcode++;\n\n    min = 0;\n    max = num_segs;\n\n    /* binary search */\n    while ( min < max )\n    {\n      mid    = ( min + max ) >> 1;\n      p      = cmap->data + 14 + mid * 2;\n      end    = TT_PEEK_USHORT( p );\n      p     += 2 + num_segs2;\n      start  = TT_PEEK_USHORT( p );\n\n      if ( charcode < start )\n        max = mid;\n      else if ( charcode > end )\n        min = mid + 1;\n      else\n      {\n        p     += num_segs2;\n        delta  = TT_PEEK_SHORT( p );\n        p     += num_segs2;\n        offset = TT_PEEK_USHORT( p );\n\n        /* some fonts have an incorrect last segment; */\n        /* we have to catch it                        */\n        if ( mid >= num_segs - 1                &&\n             start == 0xFFFFU && end == 0xFFFFU )\n        {\n          TT_Face   face  = (TT_Face)cmap->cmap.charmap.face;\n          FT_Byte*  limit = face->cmap_table + face->cmap_size;\n\n\n          if ( offset && p + offset + 2 > limit )\n          {\n            delta  = 1;\n            offset = 0;\n          }\n        }\n\n        /* search the first segment containing `charcode' */\n        if ( cmap->flags & TT_CMAP_FLAG_OVERLAPPING )\n        {\n          FT_UInt  i;\n\n\n          /* call the current segment `max' */\n          max = mid;\n\n          if ( offset == 0xFFFFU )\n            mid = max + 1;\n\n          /* search in segments before the current segment */\n          for ( i = max ; i > 0; i-- )\n          {\n            FT_UInt   prev_end;\n            FT_Byte*  old_p;\n\n\n            old_p    = p;\n            p        = cmap->data + 14 + ( i - 1 ) * 2;\n            prev_end = TT_PEEK_USHORT( p );\n\n            if ( charcode > prev_end )\n            {\n              p = old_p;\n              break;\n            }\n\n            end    = prev_end;\n            p     += 2 + num_segs2;\n            start  = TT_PEEK_USHORT( p );\n            p     += num_segs2;\n            delta  = TT_PEEK_SHORT( p );\n            p     += num_segs2;\n            offset = TT_PEEK_USHORT( p );\n\n            if ( offset != 0xFFFFU )\n              mid = i - 1;\n          }\n\n          /* no luck */\n          if ( mid == max + 1 )\n          {\n            if ( i != max )\n            {\n              p      = cmap->data + 14 + max * 2;\n              end    = TT_PEEK_USHORT( p );\n              p     += 2 + num_segs2;\n              start  = TT_PEEK_USHORT( p );\n              p     += num_segs2;\n              delta  = TT_PEEK_SHORT( p );\n              p     += num_segs2;\n              offset = TT_PEEK_USHORT( p );\n            }\n\n            mid = max;\n\n            /* search in segments after the current segment */\n            for ( i = max + 1; i < num_segs; i++ )\n            {\n              FT_UInt  next_end, next_start;\n\n\n              p          = cmap->data + 14 + i * 2;\n              next_end   = TT_PEEK_USHORT( p );\n              p         += 2 + num_segs2;\n              next_start = TT_PEEK_USHORT( p );\n\n              if ( charcode < next_start )\n                break;\n\n              end    = next_end;\n              start  = next_start;\n              p     += num_segs2;\n              delta  = TT_PEEK_SHORT( p );\n              p     += num_segs2;\n              offset = TT_PEEK_USHORT( p );\n\n              if ( offset != 0xFFFFU )\n                mid = i;\n            }\n            i--;\n\n            /* still no luck */\n            if ( mid == max )\n            {\n              mid = i;\n\n              break;\n            }\n          }\n\n          /* end, start, delta, and offset are for the i'th segment */\n          if ( mid != i )\n          {\n            p      = cmap->data + 14 + mid * 2;\n            end    = TT_PEEK_USHORT( p );\n            p     += 2 + num_segs2;\n            start  = TT_PEEK_USHORT( p );\n            p     += num_segs2;\n            delta  = TT_PEEK_SHORT( p );\n            p     += num_segs2;\n            offset = TT_PEEK_USHORT( p );\n          }\n        }\n        else\n        {\n          if ( offset == 0xFFFFU )\n            break;\n        }\n\n        if ( offset )\n        {\n          p += offset + ( charcode - start ) * 2;\n          gindex = TT_PEEK_USHORT( p );\n          if ( gindex != 0 )\n            gindex = (FT_UInt)( gindex + delta ) & 0xFFFFU;\n        }\n        else\n          gindex = (FT_UInt)( charcode + delta ) & 0xFFFFU;\n\n        break;\n      }\n    }\n\n    if ( next )\n    {\n      TT_CMap4  cmap4 = (TT_CMap4)cmap;\n\n\n      /* if `charcode' is not in any segment, then `mid' is */\n      /* the segment nearest to `charcode'                  */\n      /*                                                    */\n\n      if ( charcode > end )\n      {\n        mid++;\n        if ( mid == num_segs )\n          return 0;\n      }\n\n      if ( tt_cmap4_set_range( cmap4, mid ) )\n      {\n        if ( gindex )\n          *pcharcode = charcode;\n      }\n      else\n      {\n        cmap4->cur_charcode = charcode;\n\n        if ( gindex )\n          cmap4->cur_gindex = gindex;\n        else\n        {\n          cmap4->cur_charcode = charcode;\n          tt_cmap4_next( cmap4 );\n          gindex = cmap4->cur_gindex;\n        }\n\n        if ( gindex )\n          *pcharcode = cmap4->cur_charcode;\n      }\n    }\n\n    return gindex;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt )\n  tt_cmap4_char_index( TT_CMap    cmap,\n                       FT_UInt32  char_code )\n  {\n    if ( char_code >= 0x10000UL )\n      return 0;\n\n    if ( cmap->flags & TT_CMAP_FLAG_UNSORTED )\n      return tt_cmap4_char_map_linear( cmap, &char_code, 0 );\n    else\n      return tt_cmap4_char_map_binary( cmap, &char_code, 0 );\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt32 )\n  tt_cmap4_char_next( TT_CMap     cmap,\n                      FT_UInt32  *pchar_code )\n  {\n    FT_UInt  gindex;\n\n\n    if ( *pchar_code >= 0xFFFFU )\n      return 0;\n\n    if ( cmap->flags & TT_CMAP_FLAG_UNSORTED )\n      gindex = tt_cmap4_char_map_linear( cmap, pchar_code, 1 );\n    else\n    {\n      TT_CMap4  cmap4 = (TT_CMap4)cmap;\n\n\n      /* no need to search */\n      if ( *pchar_code == cmap4->cur_charcode )\n      {\n        tt_cmap4_next( cmap4 );\n        gindex = cmap4->cur_gindex;\n        if ( gindex )\n          *pchar_code = cmap4->cur_charcode;\n      }\n      else\n        gindex = tt_cmap4_char_map_binary( cmap, pchar_code, 1 );\n    }\n\n    return gindex;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap4_get_info( TT_CMap       cmap,\n                     TT_CMapInfo  *cmap_info )\n  {\n    FT_Byte*  p = cmap->data + 4;\n\n\n    cmap_info->format   = 4;\n    cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_DEFINE_TT_CMAP(\n    tt_cmap4_class_rec,\n    sizeof ( TT_CMap4Rec ),\n    (FT_CMap_InitFunc)     tt_cmap4_init,\n    (FT_CMap_DoneFunc)     NULL,\n    (FT_CMap_CharIndexFunc)tt_cmap4_char_index,\n    (FT_CMap_CharNextFunc) tt_cmap4_char_next,\n\n    NULL,\n    NULL,\n    NULL,\n    NULL,\n    NULL,\n\n    4,\n    (TT_CMap_ValidateFunc)tt_cmap4_validate,\n    (TT_CMap_Info_GetFunc)tt_cmap4_get_info )\n\n#endif /* TT_CONFIG_CMAP_FORMAT_4 */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                          FORMAT 6                             *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* TABLE OVERVIEW                                                        */\n  /* --------------                                                        */\n  /*                                                                       */\n  /*   NAME        OFFSET          TYPE             DESCRIPTION            */\n  /*                                                                       */\n  /*   format       0              USHORT           must be 4              */\n  /*   length       2              USHORT           table length in bytes  */\n  /*   language     4              USHORT           Mac language code      */\n  /*                                                                       */\n  /*   first        6              USHORT           first segment code     */\n  /*   count        8              USHORT           segment size in chars  */\n  /*   glyphIds     10             USHORT[count]    glyph IDs              */\n  /*                                                                       */\n  /* A very simplified segment mapping.                                    */\n  /*                                                                       */\n\n#ifdef TT_CONFIG_CMAP_FORMAT_6\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap6_validate( FT_Byte*      table,\n                     FT_Validator  valid )\n  {\n    FT_Byte*  p;\n    FT_UInt   length, count;\n\n\n    if ( table + 10 > valid->limit )\n      FT_INVALID_TOO_SHORT;\n\n    p      = table + 2;\n    length = TT_NEXT_USHORT( p );\n\n    p      = table + 8;             /* skip language and start index */\n    count  = TT_NEXT_USHORT( p );\n\n    if ( table + length > valid->limit || length < 10 + count * 2 )\n      FT_INVALID_TOO_SHORT;\n\n    /* check glyph indices */\n    if ( valid->level >= FT_VALIDATE_TIGHT )\n    {\n      FT_UInt  gindex;\n\n\n      for ( ; count > 0; count-- )\n      {\n        gindex = TT_NEXT_USHORT( p );\n        if ( gindex >= TT_VALID_GLYPH_COUNT( valid ) )\n          FT_INVALID_GLYPH_ID;\n      }\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt )\n  tt_cmap6_char_index( TT_CMap    cmap,\n                       FT_UInt32  char_code )\n  {\n    FT_Byte*  table  = cmap->data;\n    FT_UInt   result = 0;\n    FT_Byte*  p      = table + 6;\n    FT_UInt   start  = TT_NEXT_USHORT( p );\n    FT_UInt   count  = TT_NEXT_USHORT( p );\n    FT_UInt   idx    = (FT_UInt)( char_code - start );\n\n\n    if ( idx < count )\n    {\n      p += 2 * idx;\n      result = TT_PEEK_USHORT( p );\n    }\n    return result;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt32 )\n  tt_cmap6_char_next( TT_CMap     cmap,\n                      FT_UInt32  *pchar_code )\n  {\n    FT_Byte*   table     = cmap->data;\n    FT_UInt32  result    = 0;\n    FT_UInt32  char_code = *pchar_code + 1;\n    FT_UInt    gindex    = 0;\n\n    FT_Byte*   p         = table + 6;\n    FT_UInt    start     = TT_NEXT_USHORT( p );\n    FT_UInt    count     = TT_NEXT_USHORT( p );\n    FT_UInt    idx;\n\n\n    if ( char_code >= 0x10000UL )\n      goto Exit;\n\n    if ( char_code < start )\n      char_code = start;\n\n    idx = (FT_UInt)( char_code - start );\n    p  += 2 * idx;\n\n    for ( ; idx < count; idx++ )\n    {\n      gindex = TT_NEXT_USHORT( p );\n      if ( gindex != 0 )\n      {\n        result = char_code;\n        break;\n      }\n      char_code++;\n    }\n\n  Exit:\n    *pchar_code = result;\n    return gindex;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap6_get_info( TT_CMap       cmap,\n                     TT_CMapInfo  *cmap_info )\n  {\n    FT_Byte*  p = cmap->data + 4;\n\n\n    cmap_info->format   = 6;\n    cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_DEFINE_TT_CMAP(\n    tt_cmap6_class_rec,\n    sizeof ( TT_CMapRec ),\n\n    (FT_CMap_InitFunc)     tt_cmap_init,\n    (FT_CMap_DoneFunc)     NULL,\n    (FT_CMap_CharIndexFunc)tt_cmap6_char_index,\n    (FT_CMap_CharNextFunc) tt_cmap6_char_next,\n\n    NULL,\n    NULL,\n    NULL,\n    NULL,\n    NULL,\n\n    6,\n    (TT_CMap_ValidateFunc)tt_cmap6_validate,\n    (TT_CMap_Info_GetFunc)tt_cmap6_get_info )\n\n#endif /* TT_CONFIG_CMAP_FORMAT_6 */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                          FORMAT 8                             *****/\n  /*****                                                               *****/\n  /***** It is hard to completely understand what the OpenType spec    *****/\n  /***** says about this format, but here is my conclusion.            *****/\n  /*****                                                               *****/\n  /***** The purpose of this format is to easily map UTF-16 text to    *****/\n  /***** glyph indices.  Basically, the `char_code' must be in one of  *****/\n  /***** the following formats:                                        *****/\n  /*****                                                               *****/\n  /*****   - A 16-bit value that isn't part of the Unicode Surrogates  *****/\n  /*****     Area (i.e. U+D800-U+DFFF).                                *****/\n  /*****                                                               *****/\n  /*****   - A 32-bit value, made of two surrogate values, i.e.. if    *****/\n  /*****     `char_code = (char_hi << 16) | char_lo', then both        *****/\n  /*****     `char_hi' and `char_lo' must be in the Surrogates Area.   *****/\n  /*****      Area.                                                    *****/\n  /*****                                                               *****/\n  /***** The `is32' table embedded in the charmap indicates whether a  *****/\n  /***** given 16-bit value is in the surrogates area or not.          *****/\n  /*****                                                               *****/\n  /***** So, for any given `char_code', we can assert the following:   *****/\n  /*****                                                               *****/\n  /*****   If `char_hi == 0' then we must have `is32[char_lo] == 0'.   *****/\n  /*****                                                               *****/\n  /*****   If `char_hi != 0' then we must have both                    *****/\n  /*****   `is32[char_hi] != 0' and `is32[char_lo] != 0'.              *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* TABLE OVERVIEW                                                        */\n  /* --------------                                                        */\n  /*                                                                       */\n  /*   NAME        OFFSET         TYPE        DESCRIPTION                  */\n  /*                                                                       */\n  /*   format      0              USHORT      must be 8                    */\n  /*   reserved    2              USHORT      reserved                     */\n  /*   length      4              ULONG       length in bytes              */\n  /*   language    8              ULONG       Mac language code            */\n  /*   is32        12             BYTE[8192]  32-bitness bitmap            */\n  /*   count       8204           ULONG       number of groups             */\n  /*                                                                       */\n  /* This header is followed by `count' groups of the following format:    */\n  /*                                                                       */\n  /*   start       0              ULONG       first charcode               */\n  /*   end         4              ULONG       last charcode                */\n  /*   startId     8              ULONG       start glyph ID for the group */\n  /*                                                                       */\n\n#ifdef TT_CONFIG_CMAP_FORMAT_8\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap8_validate( FT_Byte*      table,\n                     FT_Validator  valid )\n  {\n    FT_Byte*   p = table + 4;\n    FT_Byte*   is32;\n    FT_UInt32  length;\n    FT_UInt32  num_groups;\n\n\n    if ( table + 16 + 8192 > valid->limit )\n      FT_INVALID_TOO_SHORT;\n\n    length = TT_NEXT_ULONG( p );\n    if ( length > (FT_UInt32)( valid->limit - table ) || length < 8192 + 16 )\n      FT_INVALID_TOO_SHORT;\n\n    is32       = table + 12;\n    p          = is32  + 8192;          /* skip `is32' array */\n    num_groups = TT_NEXT_ULONG( p );\n\n    /* p + num_groups * 12 > valid->limit ? */\n    if ( num_groups > (FT_UInt32)( valid->limit - p ) / 12 )\n      FT_INVALID_TOO_SHORT;\n\n    /* check groups, they must be in increasing order */\n    {\n      FT_UInt32  n, start, end, start_id, count, last = 0;\n\n\n      for ( n = 0; n < num_groups; n++ )\n      {\n        FT_UInt   hi, lo;\n\n\n        start    = TT_NEXT_ULONG( p );\n        end      = TT_NEXT_ULONG( p );\n        start_id = TT_NEXT_ULONG( p );\n\n        if ( start > end )\n          FT_INVALID_DATA;\n\n        if ( n > 0 && start <= last )\n          FT_INVALID_DATA;\n\n        if ( valid->level >= FT_VALIDATE_TIGHT )\n        {\n          FT_UInt32  d = end - start;\n\n\n          /* start_id + end - start >= TT_VALID_GLYPH_COUNT( valid ) ? */\n          if ( d > TT_VALID_GLYPH_COUNT( valid )             ||\n               start_id >= TT_VALID_GLYPH_COUNT( valid ) - d )\n            FT_INVALID_GLYPH_ID;\n\n          count = (FT_UInt32)( end - start + 1 );\n\n          if ( start & ~0xFFFFU )\n          {\n            /* start_hi != 0; check that is32[i] is 1 for each i in */\n            /* the `hi' and `lo' of the range [start..end]          */\n            for ( ; count > 0; count--, start++ )\n            {\n              hi = (FT_UInt)( start >> 16 );\n              lo = (FT_UInt)( start & 0xFFFFU );\n\n              if ( (is32[hi >> 3] & ( 0x80 >> ( hi & 7 ) ) ) == 0 )\n                FT_INVALID_DATA;\n\n              if ( (is32[lo >> 3] & ( 0x80 >> ( lo & 7 ) ) ) == 0 )\n                FT_INVALID_DATA;\n            }\n          }\n          else\n          {\n            /* start_hi == 0; check that is32[i] is 0 for each i in */\n            /* the range [start..end]                               */\n\n            /* end_hi cannot be != 0! */\n            if ( end & ~0xFFFFU )\n              FT_INVALID_DATA;\n\n            for ( ; count > 0; count--, start++ )\n            {\n              lo = (FT_UInt)( start & 0xFFFFU );\n\n              if ( (is32[lo >> 3] & ( 0x80 >> ( lo & 7 ) ) ) != 0 )\n                FT_INVALID_DATA;\n            }\n          }\n        }\n\n        last = end;\n      }\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt )\n  tt_cmap8_char_index( TT_CMap    cmap,\n                       FT_UInt32  char_code )\n  {\n    FT_Byte*   table      = cmap->data;\n    FT_UInt    result     = 0;\n    FT_Byte*   p          = table + 8204;\n    FT_UInt32  num_groups = TT_NEXT_ULONG( p );\n    FT_UInt32  start, end, start_id;\n\n\n    for ( ; num_groups > 0; num_groups-- )\n    {\n      start    = TT_NEXT_ULONG( p );\n      end      = TT_NEXT_ULONG( p );\n      start_id = TT_NEXT_ULONG( p );\n\n      if ( char_code < start )\n        break;\n\n      if ( char_code <= end )\n      {\n        result = (FT_UInt)( start_id + char_code - start );\n        break;\n      }\n    }\n    return result;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt32 )\n  tt_cmap8_char_next( TT_CMap     cmap,\n                      FT_UInt32  *pchar_code )\n  {\n    FT_UInt32  result     = 0;\n    FT_UInt32  char_code  = *pchar_code + 1;\n    FT_UInt    gindex     = 0;\n    FT_Byte*   table      = cmap->data;\n    FT_Byte*   p          = table + 8204;\n    FT_UInt32  num_groups = TT_NEXT_ULONG( p );\n    FT_UInt32  start, end, start_id;\n\n\n    p = table + 8208;\n\n    for ( ; num_groups > 0; num_groups-- )\n    {\n      start    = TT_NEXT_ULONG( p );\n      end      = TT_NEXT_ULONG( p );\n      start_id = TT_NEXT_ULONG( p );\n\n      if ( char_code < start )\n        char_code = start;\n\n      if ( char_code <= end )\n      {\n        gindex = (FT_UInt)( char_code - start + start_id );\n        if ( gindex != 0 )\n        {\n          result = char_code;\n          goto Exit;\n        }\n      }\n    }\n\n  Exit:\n    *pchar_code = result;\n    return gindex;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap8_get_info( TT_CMap       cmap,\n                     TT_CMapInfo  *cmap_info )\n  {\n    FT_Byte*  p = cmap->data + 8;\n\n\n    cmap_info->format   = 8;\n    cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p );\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_DEFINE_TT_CMAP(\n    tt_cmap8_class_rec,\n    sizeof ( TT_CMapRec ),\n\n    (FT_CMap_InitFunc)     tt_cmap_init,\n    (FT_CMap_DoneFunc)     NULL,\n    (FT_CMap_CharIndexFunc)tt_cmap8_char_index,\n    (FT_CMap_CharNextFunc) tt_cmap8_char_next,\n\n    NULL,\n    NULL,\n    NULL,\n    NULL,\n    NULL,\n\n    8,\n    (TT_CMap_ValidateFunc)tt_cmap8_validate,\n    (TT_CMap_Info_GetFunc)tt_cmap8_get_info )\n\n#endif /* TT_CONFIG_CMAP_FORMAT_8 */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                          FORMAT 10                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* TABLE OVERVIEW                                                        */\n  /* --------------                                                        */\n  /*                                                                       */\n  /*   NAME      OFFSET  TYPE               DESCRIPTION                    */\n  /*                                                                       */\n  /*   format     0      USHORT             must be 10                     */\n  /*   reserved   2      USHORT             reserved                       */\n  /*   length     4      ULONG              length in bytes                */\n  /*   language   8      ULONG              Mac language code              */\n  /*                                                                       */\n  /*   start     12      ULONG              first char in range            */\n  /*   count     16      ULONG              number of chars in range       */\n  /*   glyphIds  20      USHORT[count]      glyph indices covered          */\n  /*                                                                       */\n\n#ifdef TT_CONFIG_CMAP_FORMAT_10\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap10_validate( FT_Byte*      table,\n                      FT_Validator  valid )\n  {\n    FT_Byte*  p = table + 4;\n    FT_ULong  length, count;\n\n\n    if ( table + 20 > valid->limit )\n      FT_INVALID_TOO_SHORT;\n\n    length = TT_NEXT_ULONG( p );\n    p      = table + 16;\n    count  = TT_NEXT_ULONG( p );\n\n    if ( length > (FT_ULong)( valid->limit - table ) ||\n         /* length < 20 + count * 2 ? */\n         length < 20                                 ||\n         ( length - 20 ) / 2 < count                 )\n      FT_INVALID_TOO_SHORT;\n\n    /* check glyph indices */\n    if ( valid->level >= FT_VALIDATE_TIGHT )\n    {\n      FT_UInt  gindex;\n\n\n      for ( ; count > 0; count-- )\n      {\n        gindex = TT_NEXT_USHORT( p );\n        if ( gindex >= TT_VALID_GLYPH_COUNT( valid ) )\n          FT_INVALID_GLYPH_ID;\n      }\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt )\n  tt_cmap10_char_index( TT_CMap    cmap,\n                        FT_UInt32  char_code )\n  {\n    FT_Byte*   table  = cmap->data;\n    FT_UInt    result = 0;\n    FT_Byte*   p      = table + 12;\n    FT_UInt32  start  = TT_NEXT_ULONG( p );\n    FT_UInt32  count  = TT_NEXT_ULONG( p );\n    FT_UInt32  idx    = (FT_ULong)( char_code - start );\n\n\n    if ( idx < count )\n    {\n      p     += 2 * idx;\n      result = TT_PEEK_USHORT( p );\n    }\n    return result;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt32 )\n  tt_cmap10_char_next( TT_CMap     cmap,\n                       FT_UInt32  *pchar_code )\n  {\n    FT_Byte*   table     = cmap->data;\n    FT_UInt32  char_code = *pchar_code + 1;\n    FT_UInt    gindex    = 0;\n    FT_Byte*   p         = table + 12;\n    FT_UInt32  start     = TT_NEXT_ULONG( p );\n    FT_UInt32  count     = TT_NEXT_ULONG( p );\n    FT_UInt32  idx;\n\n\n    if ( char_code < start )\n      char_code = start;\n\n    idx = (FT_UInt32)( char_code - start );\n    p  += 2 * idx;\n\n    for ( ; idx < count; idx++ )\n    {\n      gindex = TT_NEXT_USHORT( p );\n      if ( gindex != 0 )\n        break;\n      char_code++;\n    }\n\n    *pchar_code = char_code;\n    return gindex;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap10_get_info( TT_CMap       cmap,\n                      TT_CMapInfo  *cmap_info )\n  {\n    FT_Byte*  p = cmap->data + 8;\n\n\n    cmap_info->format   = 10;\n    cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p );\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_DEFINE_TT_CMAP(\n    tt_cmap10_class_rec,\n    sizeof ( TT_CMapRec ),\n\n    (FT_CMap_InitFunc)     tt_cmap_init,\n    (FT_CMap_DoneFunc)     NULL,\n    (FT_CMap_CharIndexFunc)tt_cmap10_char_index,\n    (FT_CMap_CharNextFunc) tt_cmap10_char_next,\n\n    NULL,\n    NULL,\n    NULL,\n    NULL,\n    NULL,\n\n    10,\n    (TT_CMap_ValidateFunc)tt_cmap10_validate,\n    (TT_CMap_Info_GetFunc)tt_cmap10_get_info )\n\n#endif /* TT_CONFIG_CMAP_FORMAT_10 */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                          FORMAT 12                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* TABLE OVERVIEW                                                        */\n  /* --------------                                                        */\n  /*                                                                       */\n  /*   NAME        OFFSET     TYPE       DESCRIPTION                       */\n  /*                                                                       */\n  /*   format      0          USHORT     must be 12                        */\n  /*   reserved    2          USHORT     reserved                          */\n  /*   length      4          ULONG      length in bytes                   */\n  /*   language    8          ULONG      Mac language code                 */\n  /*   count       12         ULONG      number of groups                  */\n  /*               16                                                      */\n  /*                                                                       */\n  /* This header is followed by `count' groups of the following format:    */\n  /*                                                                       */\n  /*   start       0          ULONG      first charcode                    */\n  /*   end         4          ULONG      last charcode                     */\n  /*   startId     8          ULONG      start glyph ID for the group      */\n  /*                                                                       */\n\n#ifdef TT_CONFIG_CMAP_FORMAT_12\n\n  typedef struct  TT_CMap12Rec_\n  {\n    TT_CMapRec  cmap;\n    FT_Bool     valid;\n    FT_ULong    cur_charcode;\n    FT_UInt     cur_gindex;\n    FT_ULong    cur_group;\n    FT_ULong    num_groups;\n\n  } TT_CMap12Rec, *TT_CMap12;\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap12_init( TT_CMap12  cmap,\n                  FT_Byte*   table )\n  {\n    cmap->cmap.data  = table;\n\n    table           += 12;\n    cmap->num_groups = FT_PEEK_ULONG( table );\n\n    cmap->valid      = 0;\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap12_validate( FT_Byte*      table,\n                      FT_Validator  valid )\n  {\n    FT_Byte*  p;\n    FT_ULong  length;\n    FT_ULong  num_groups;\n\n\n    if ( table + 16 > valid->limit )\n      FT_INVALID_TOO_SHORT;\n\n    p      = table + 4;\n    length = TT_NEXT_ULONG( p );\n\n    p          = table + 12;\n    num_groups = TT_NEXT_ULONG( p );\n\n    if ( length > (FT_ULong)( valid->limit - table ) ||\n         /* length < 16 + 12 * num_groups ? */\n         length < 16                                 ||\n         ( length - 16 ) / 12 < num_groups           )\n      FT_INVALID_TOO_SHORT;\n\n    /* check groups, they must be in increasing order */\n    {\n      FT_ULong  n, start, end, start_id, last = 0;\n\n\n      for ( n = 0; n < num_groups; n++ )\n      {\n        start    = TT_NEXT_ULONG( p );\n        end      = TT_NEXT_ULONG( p );\n        start_id = TT_NEXT_ULONG( p );\n\n        if ( start > end )\n          FT_INVALID_DATA;\n\n        if ( n > 0 && start <= last )\n          FT_INVALID_DATA;\n\n        if ( valid->level >= FT_VALIDATE_TIGHT )\n        {\n          FT_UInt32  d = end - start;\n\n\n          /* start_id + end - start >= TT_VALID_GLYPH_COUNT( valid ) ? */\n          if ( d > TT_VALID_GLYPH_COUNT( valid )             ||\n               start_id >= TT_VALID_GLYPH_COUNT( valid ) - d )\n            FT_INVALID_GLYPH_ID;\n        }\n\n        last = end;\n      }\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n  /* search the index of the charcode next to cmap->cur_charcode */\n  /* cmap->cur_group should be set up properly by caller         */\n  /*                                                             */\n  static void\n  tt_cmap12_next( TT_CMap12  cmap )\n  {\n    FT_Byte*  p;\n    FT_ULong  start, end, start_id, char_code;\n    FT_ULong  n;\n    FT_UInt   gindex;\n\n\n    if ( cmap->cur_charcode >= 0xFFFFFFFFUL )\n      goto Fail;\n\n    char_code = cmap->cur_charcode + 1;\n\n    for ( n = cmap->cur_group; n < cmap->num_groups; n++ )\n    {\n      p        = cmap->cmap.data + 16 + 12 * n;\n      start    = TT_NEXT_ULONG( p );\n      end      = TT_NEXT_ULONG( p );\n      start_id = TT_PEEK_ULONG( p );\n\n      if ( char_code < start )\n        char_code = start;\n\n      for ( ; char_code <= end; char_code++ )\n      {\n        gindex = (FT_UInt)( start_id + char_code - start );\n\n        if ( gindex )\n        {\n          cmap->cur_charcode = char_code;;\n          cmap->cur_gindex   = gindex;\n          cmap->cur_group    = n;\n\n          return;\n        }\n      }\n    }\n\n  Fail:\n    cmap->valid = 0;\n  }\n\n\n  static FT_UInt\n  tt_cmap12_char_map_binary( TT_CMap     cmap,\n                             FT_UInt32*  pchar_code,\n                             FT_Bool     next )\n  {\n    FT_UInt    gindex     = 0;\n    FT_Byte*   p          = cmap->data + 12;\n    FT_UInt32  num_groups = TT_PEEK_ULONG( p );\n    FT_UInt32  char_code  = *pchar_code;\n    FT_UInt32  start, end, start_id;\n    FT_UInt32  max, min, mid;\n\n\n    if ( !num_groups )\n      return 0;\n\n    /* make compiler happy */\n    mid = num_groups;\n    end = 0xFFFFFFFFUL;\n\n    if ( next )\n      char_code++;\n\n    min = 0;\n    max = num_groups;\n\n    /* binary search */\n    while ( min < max )\n    {\n      mid = ( min + max ) >> 1;\n      p   = cmap->data + 16 + 12 * mid;\n\n      start = TT_NEXT_ULONG( p );\n      end   = TT_NEXT_ULONG( p );\n\n      if ( char_code < start )\n        max = mid;\n      else if ( char_code > end )\n        min = mid + 1;\n      else\n      {\n        start_id = TT_PEEK_ULONG( p );\n        gindex = (FT_UInt)( start_id + char_code - start );\n\n        break;\n      }\n    }\n\n    if ( next )\n    {\n      TT_CMap12  cmap12 = (TT_CMap12)cmap;\n\n\n      /* if `char_code' is not in any group, then `mid' is */\n      /* the group nearest to `char_code'                  */\n      /*                                                   */\n\n      if ( char_code > end )\n      {\n        mid++;\n        if ( mid == num_groups )\n          return 0;\n      }\n\n      cmap12->valid        = 1;\n      cmap12->cur_charcode = char_code;\n      cmap12->cur_group    = mid;\n\n      if ( !gindex )\n      {\n        tt_cmap12_next( cmap12 );\n\n        if ( cmap12->valid )\n          gindex = cmap12->cur_gindex;\n      }\n      else\n        cmap12->cur_gindex = gindex;\n\n      if ( gindex )\n        *pchar_code = cmap12->cur_charcode;\n    }\n\n    return gindex;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt )\n  tt_cmap12_char_index( TT_CMap    cmap,\n                        FT_UInt32  char_code )\n  {\n    return tt_cmap12_char_map_binary( cmap, &char_code, 0 );\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt32 )\n  tt_cmap12_char_next( TT_CMap     cmap,\n                       FT_UInt32  *pchar_code )\n  {\n    TT_CMap12  cmap12 = (TT_CMap12)cmap;\n    FT_ULong   gindex;\n\n\n    if ( cmap12->cur_charcode >= 0xFFFFFFFFUL )\n      return 0;\n\n    /* no need to search */\n    if ( cmap12->valid && cmap12->cur_charcode == *pchar_code )\n    {\n      tt_cmap12_next( cmap12 );\n      if ( cmap12->valid )\n      {\n        gindex = cmap12->cur_gindex;\n\n        /* XXX: check cur_charcode overflow is expected */\n        if ( gindex )\n          *pchar_code = (FT_UInt32)cmap12->cur_charcode;\n      }\n      else\n        gindex = 0;\n    }\n    else\n      gindex = tt_cmap12_char_map_binary( cmap, pchar_code, 1 );\n\n    /* XXX: check gindex overflow is expected */\n    return (FT_UInt32)gindex;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap12_get_info( TT_CMap       cmap,\n                      TT_CMapInfo  *cmap_info )\n  {\n    FT_Byte*  p = cmap->data + 8;\n\n\n    cmap_info->format   = 12;\n    cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p );\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_DEFINE_TT_CMAP(\n    tt_cmap12_class_rec,\n    sizeof ( TT_CMap12Rec ),\n\n    (FT_CMap_InitFunc)     tt_cmap12_init,\n    (FT_CMap_DoneFunc)     NULL,\n    (FT_CMap_CharIndexFunc)tt_cmap12_char_index,\n    (FT_CMap_CharNextFunc) tt_cmap12_char_next,\n\n    NULL,\n    NULL,\n    NULL,\n    NULL,\n    NULL,\n\n    12,\n    (TT_CMap_ValidateFunc)tt_cmap12_validate,\n    (TT_CMap_Info_GetFunc)tt_cmap12_get_info )\n\n#endif /* TT_CONFIG_CMAP_FORMAT_12 */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                          FORMAT 13                            *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* TABLE OVERVIEW                                                        */\n  /* --------------                                                        */\n  /*                                                                       */\n  /*   NAME        OFFSET     TYPE       DESCRIPTION                       */\n  /*                                                                       */\n  /*   format      0          USHORT     must be 13                        */\n  /*   reserved    2          USHORT     reserved                          */\n  /*   length      4          ULONG      length in bytes                   */\n  /*   language    8          ULONG      Mac language code                 */\n  /*   count       12         ULONG      number of groups                  */\n  /*               16                                                      */\n  /*                                                                       */\n  /* This header is followed by `count' groups of the following format:    */\n  /*                                                                       */\n  /*   start       0          ULONG      first charcode                    */\n  /*   end         4          ULONG      last charcode                     */\n  /*   glyphId     8          ULONG      glyph ID for the whole group      */\n  /*                                                                       */\n\n#ifdef TT_CONFIG_CMAP_FORMAT_13\n\n  typedef struct  TT_CMap13Rec_\n  {\n    TT_CMapRec  cmap;\n    FT_Bool     valid;\n    FT_ULong    cur_charcode;\n    FT_UInt     cur_gindex;\n    FT_ULong    cur_group;\n    FT_ULong    num_groups;\n\n  } TT_CMap13Rec, *TT_CMap13;\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap13_init( TT_CMap13  cmap,\n                  FT_Byte*   table )\n  {\n    cmap->cmap.data  = table;\n\n    table           += 12;\n    cmap->num_groups = FT_PEEK_ULONG( table );\n\n    cmap->valid      = 0;\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap13_validate( FT_Byte*      table,\n                      FT_Validator  valid )\n  {\n    FT_Byte*  p;\n    FT_ULong  length;\n    FT_ULong  num_groups;\n\n\n    if ( table + 16 > valid->limit )\n      FT_INVALID_TOO_SHORT;\n\n    p      = table + 4;\n    length = TT_NEXT_ULONG( p );\n\n    p          = table + 12;\n    num_groups = TT_NEXT_ULONG( p );\n\n    if ( length > (FT_ULong)( valid->limit - table ) ||\n         /* length < 16 + 12 * num_groups ? */\n         length < 16                                 ||\n         ( length - 16 ) / 12 < num_groups           )\n      FT_INVALID_TOO_SHORT;\n\n    /* check groups, they must be in increasing order */\n    {\n      FT_ULong  n, start, end, glyph_id, last = 0;\n\n\n      for ( n = 0; n < num_groups; n++ )\n      {\n        start    = TT_NEXT_ULONG( p );\n        end      = TT_NEXT_ULONG( p );\n        glyph_id = TT_NEXT_ULONG( p );\n\n        if ( start > end )\n          FT_INVALID_DATA;\n\n        if ( n > 0 && start <= last )\n          FT_INVALID_DATA;\n\n        if ( valid->level >= FT_VALIDATE_TIGHT )\n        {\n          if ( glyph_id >= TT_VALID_GLYPH_COUNT( valid ) )\n            FT_INVALID_GLYPH_ID;\n        }\n\n        last = end;\n      }\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n  /* search the index of the charcode next to cmap->cur_charcode */\n  /* cmap->cur_group should be set up properly by caller         */\n  /*                                                             */\n  static void\n  tt_cmap13_next( TT_CMap13  cmap )\n  {\n    FT_Byte*  p;\n    FT_ULong  start, end, glyph_id, char_code;\n    FT_ULong  n;\n    FT_UInt   gindex;\n\n\n    if ( cmap->cur_charcode >= 0xFFFFFFFFUL )\n      goto Fail;\n\n    char_code = cmap->cur_charcode + 1;\n\n    for ( n = cmap->cur_group; n < cmap->num_groups; n++ )\n    {\n      p        = cmap->cmap.data + 16 + 12 * n;\n      start    = TT_NEXT_ULONG( p );\n      end      = TT_NEXT_ULONG( p );\n      glyph_id = TT_PEEK_ULONG( p );\n\n      if ( char_code < start )\n        char_code = start;\n\n      if ( char_code <= end )\n      {\n        gindex = (FT_UInt)glyph_id;\n\n        if ( gindex )\n        {\n          cmap->cur_charcode = char_code;;\n          cmap->cur_gindex   = gindex;\n          cmap->cur_group    = n;\n\n          return;\n        }\n      }\n    }\n\n  Fail:\n    cmap->valid = 0;\n  }\n\n\n  static FT_UInt\n  tt_cmap13_char_map_binary( TT_CMap     cmap,\n                             FT_UInt32*  pchar_code,\n                             FT_Bool     next )\n  {\n    FT_UInt    gindex     = 0;\n    FT_Byte*   p          = cmap->data + 12;\n    FT_UInt32  num_groups = TT_PEEK_ULONG( p );\n    FT_UInt32  char_code  = *pchar_code;\n    FT_UInt32  start, end;\n    FT_UInt32  max, min, mid;\n\n\n    if ( !num_groups )\n      return 0;\n\n    /* make compiler happy */\n    mid = num_groups;\n    end = 0xFFFFFFFFUL;\n\n    if ( next )\n      char_code++;\n\n    min = 0;\n    max = num_groups;\n\n    /* binary search */\n    while ( min < max )\n    {\n      mid = ( min + max ) >> 1;\n      p   = cmap->data + 16 + 12 * mid;\n\n      start = TT_NEXT_ULONG( p );\n      end   = TT_NEXT_ULONG( p );\n\n      if ( char_code < start )\n        max = mid;\n      else if ( char_code > end )\n        min = mid + 1;\n      else\n      {\n        gindex = (FT_UInt)TT_PEEK_ULONG( p );\n\n        break;\n      }\n    }\n\n    if ( next )\n    {\n      TT_CMap13  cmap13 = (TT_CMap13)cmap;\n\n\n      /* if `char_code' is not in any group, then `mid' is */\n      /* the group nearest to `char_code'                  */\n\n      if ( char_code > end )\n      {\n        mid++;\n        if ( mid == num_groups )\n          return 0;\n      }\n\n      cmap13->valid        = 1;\n      cmap13->cur_charcode = char_code;\n      cmap13->cur_group    = mid;\n\n      if ( !gindex )\n      {\n        tt_cmap13_next( cmap13 );\n\n        if ( cmap13->valid )\n          gindex = cmap13->cur_gindex;\n      }\n      else\n        cmap13->cur_gindex = gindex;\n\n      if ( gindex )\n        *pchar_code = cmap13->cur_charcode;\n    }\n\n    return gindex;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt )\n  tt_cmap13_char_index( TT_CMap    cmap,\n                        FT_UInt32  char_code )\n  {\n    return tt_cmap13_char_map_binary( cmap, &char_code, 0 );\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt32 )\n  tt_cmap13_char_next( TT_CMap     cmap,\n                       FT_UInt32  *pchar_code )\n  {\n    TT_CMap13  cmap13 = (TT_CMap13)cmap;\n    FT_UInt    gindex;\n\n\n    if ( cmap13->cur_charcode >= 0xFFFFFFFFUL )\n      return 0;\n\n    /* no need to search */\n    if ( cmap13->valid && cmap13->cur_charcode == *pchar_code )\n    {\n      tt_cmap13_next( cmap13 );\n      if ( cmap13->valid )\n      {\n        gindex = cmap13->cur_gindex;\n        if ( gindex )\n          *pchar_code = cmap13->cur_charcode;\n      }\n      else\n        gindex = 0;\n    }\n    else\n      gindex = tt_cmap13_char_map_binary( cmap, pchar_code, 1 );\n\n    return gindex;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap13_get_info( TT_CMap       cmap,\n                      TT_CMapInfo  *cmap_info )\n  {\n    FT_Byte*  p = cmap->data + 8;\n\n\n    cmap_info->format   = 13;\n    cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p );\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_DEFINE_TT_CMAP(\n    tt_cmap13_class_rec,\n    sizeof ( TT_CMap13Rec ),\n\n    (FT_CMap_InitFunc)     tt_cmap13_init,\n    (FT_CMap_DoneFunc)     NULL,\n    (FT_CMap_CharIndexFunc)tt_cmap13_char_index,\n    (FT_CMap_CharNextFunc) tt_cmap13_char_next,\n\n    NULL,\n    NULL,\n    NULL,\n    NULL,\n    NULL,\n\n    13,\n    (TT_CMap_ValidateFunc)tt_cmap13_validate,\n    (TT_CMap_Info_GetFunc)tt_cmap13_get_info )\n\n#endif /* TT_CONFIG_CMAP_FORMAT_13 */\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                           FORMAT 14                           *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* TABLE OVERVIEW                                                        */\n  /* --------------                                                        */\n  /*                                                                       */\n  /*   NAME         OFFSET  TYPE    DESCRIPTION                            */\n  /*                                                                       */\n  /*   format         0     USHORT  must be 14                             */\n  /*   length         2     ULONG   table length in bytes                  */\n  /*   numSelector    6     ULONG   number of variation sel. records       */\n  /*                                                                       */\n  /* Followed by numSelector records, each of which looks like             */\n  /*                                                                       */\n  /*   varSelector    0     UINT24  Unicode codepoint of sel.              */\n  /*   defaultOff     3     ULONG   offset to a default UVS table          */\n  /*                                describing any variants to be found in */\n  /*                                the normal Unicode subtable.           */\n  /*   nonDefOff      7     ULONG   offset to a non-default UVS table      */\n  /*                                describing any variants not in the     */\n  /*                                standard cmap, with GIDs here          */\n  /* (either offset may be 0 NULL)                                         */\n  /*                                                                       */\n  /* Selectors are sorted by code point.                                   */\n  /*                                                                       */\n  /* A default Unicode Variation Selector (UVS) subtable is just a list of */\n  /* ranges of code points which are to be found in the standard cmap.  No */\n  /* glyph IDs (GIDs) here.                                                */\n  /*                                                                       */\n  /*   numRanges      0     ULONG   number of ranges following             */\n  /*                                                                       */\n  /* A range looks like                                                    */\n  /*                                                                       */\n  /*   uniStart       0     UINT24  code point of the first character in   */\n  /*                                this range                             */\n  /*   additionalCnt  3     UBYTE   count of additional characters in this */\n  /*                                range (zero means a range of a single  */\n  /*                                character)                             */\n  /*                                                                       */\n  /* Ranges are sorted by `uniStart'.                                      */\n  /*                                                                       */\n  /* A non-default Unicode Variation Selector (UVS) subtable is a list of  */\n  /* mappings from codepoint to GID.                                       */\n  /*                                                                       */\n  /*   numMappings    0     ULONG   number of mappings                     */\n  /*                                                                       */\n  /* A range looks like                                                    */\n  /*                                                                       */\n  /*   uniStart       0     UINT24  code point of the first character in   */\n  /*                                this range                             */\n  /*   GID            3     USHORT  and its GID                            */\n  /*                                                                       */\n  /* Ranges are sorted by `uniStart'.                                      */\n\n#ifdef TT_CONFIG_CMAP_FORMAT_14\n\n  typedef struct  TT_CMap14Rec_\n  {\n    TT_CMapRec  cmap;\n    FT_ULong    num_selectors;\n\n    /* This array is used to store the results of various\n     * cmap 14 query functions.  The data is overwritten\n     * on each call to these functions.\n     */\n    FT_UInt32   max_results;\n    FT_UInt32*  results;\n    FT_Memory   memory;\n\n  } TT_CMap14Rec, *TT_CMap14;\n\n\n  FT_CALLBACK_DEF( void )\n  tt_cmap14_done( TT_CMap14  cmap )\n  {\n    FT_Memory  memory = cmap->memory;\n\n\n    cmap->max_results = 0;\n    if ( memory != NULL && cmap->results != NULL )\n      FT_FREE( cmap->results );\n  }\n\n\n  static FT_Error\n  tt_cmap14_ensure( TT_CMap14  cmap,\n                    FT_UInt32  num_results,\n                    FT_Memory  memory )\n  {\n    FT_UInt32  old_max = cmap->max_results;\n    FT_Error   error   = FT_Err_Ok;\n\n\n    if ( num_results > cmap->max_results )\n    {\n       cmap->memory = memory;\n\n       if ( FT_QRENEW_ARRAY( cmap->results, old_max, num_results ) )\n         return error;\n\n       cmap->max_results = num_results;\n    }\n\n    return error;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap14_init( TT_CMap14  cmap,\n                  FT_Byte*   table )\n  {\n    cmap->cmap.data = table;\n\n    table               += 6;\n    cmap->num_selectors  = FT_PEEK_ULONG( table );\n    cmap->max_results    = 0;\n    cmap->results        = NULL;\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap14_validate( FT_Byte*      table,\n                      FT_Validator  valid )\n  {\n    FT_Byte*  p;\n    FT_ULong  length;\n    FT_ULong  num_selectors;\n\n\n    if ( table + 2 + 4 + 4 > valid->limit )\n      FT_INVALID_TOO_SHORT;\n\n    p             = table + 2;\n    length        = TT_NEXT_ULONG( p );\n    num_selectors = TT_NEXT_ULONG( p );\n\n    if ( length > (FT_ULong)( valid->limit - table ) ||\n         /* length < 10 + 11 * num_selectors ? */\n         length < 10                                 ||\n         ( length - 10 ) / 11 < num_selectors        )\n      FT_INVALID_TOO_SHORT;\n\n    /* check selectors, they must be in increasing order */\n    {\n      /* we start lastVarSel at 1 because a variant selector value of 0\n       * isn't valid.\n       */\n      FT_ULong  n, lastVarSel = 1;\n\n\n      for ( n = 0; n < num_selectors; n++ )\n      {\n        FT_ULong  varSel    = TT_NEXT_UINT24( p );\n        FT_ULong  defOff    = TT_NEXT_ULONG( p );\n        FT_ULong  nondefOff = TT_NEXT_ULONG( p );\n\n\n        if ( defOff >= length || nondefOff >= length )\n          FT_INVALID_TOO_SHORT;\n\n        if ( varSel < lastVarSel )\n          FT_INVALID_DATA;\n\n        lastVarSel = varSel + 1;\n\n        /* check the default table (these glyphs should be reached     */\n        /* through the normal Unicode cmap, no GIDs, just check order) */\n        if ( defOff != 0 )\n        {\n          FT_Byte*  defp      = table + defOff;\n          FT_ULong  numRanges = TT_NEXT_ULONG( defp );\n          FT_ULong  i;\n          FT_ULong  lastBase  = 0;\n\n\n          /* defp + numRanges * 4 > valid->limit ? */\n          if ( numRanges > (FT_ULong)( valid->limit - defp ) / 4 )\n            FT_INVALID_TOO_SHORT;\n\n          for ( i = 0; i < numRanges; ++i )\n          {\n            FT_ULong  base = TT_NEXT_UINT24( defp );\n            FT_ULong  cnt  = FT_NEXT_BYTE( defp );\n\n\n            if ( base + cnt >= 0x110000UL )              /* end of Unicode */\n              FT_INVALID_DATA;\n\n            if ( base < lastBase )\n              FT_INVALID_DATA;\n\n            lastBase = base + cnt + 1U;\n          }\n        }\n\n        /* and the non-default table (these glyphs are specified here) */\n        if ( nondefOff != 0 )\n        {\n          FT_Byte*  ndp         = table + nondefOff;\n          FT_ULong  numMappings = TT_NEXT_ULONG( ndp );\n          FT_ULong  i, lastUni  = 0;\n\n\n          /* numMappings * 4 > (FT_ULong)( valid->limit - ndp ) ? */\n          if ( numMappings > ( (FT_ULong)( valid->limit - ndp ) ) / 4 )\n            FT_INVALID_TOO_SHORT;\n\n          for ( i = 0; i < numMappings; ++i )\n          {\n            FT_ULong  uni = TT_NEXT_UINT24( ndp );\n            FT_ULong  gid = TT_NEXT_USHORT( ndp );\n\n\n            if ( uni >= 0x110000UL )                     /* end of Unicode */\n              FT_INVALID_DATA;\n\n            if ( uni < lastUni )\n              FT_INVALID_DATA;\n\n            lastUni = uni + 1U;\n\n            if ( valid->level >= FT_VALIDATE_TIGHT    &&\n                 gid >= TT_VALID_GLYPH_COUNT( valid ) )\n              FT_INVALID_GLYPH_ID;\n          }\n        }\n      }\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt )\n  tt_cmap14_char_index( TT_CMap    cmap,\n                        FT_UInt32  char_code )\n  {\n    FT_UNUSED( cmap );\n    FT_UNUSED( char_code );\n\n    /* This can't happen */\n    return 0;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt32 )\n  tt_cmap14_char_next( TT_CMap     cmap,\n                       FT_UInt32  *pchar_code )\n  {\n    FT_UNUSED( cmap );\n\n    /* This can't happen */\n    *pchar_code = 0;\n    return 0;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  tt_cmap14_get_info( TT_CMap       cmap,\n                      TT_CMapInfo  *cmap_info )\n  {\n    FT_UNUSED( cmap );\n\n    cmap_info->format   = 14;\n    /* subtable 14 does not define a language field */\n    cmap_info->language = 0xFFFFFFFFUL;\n\n    return FT_Err_Ok;\n  }\n\n\n  static FT_UInt\n  tt_cmap14_char_map_def_binary( FT_Byte    *base,\n                                 FT_UInt32   char_code )\n  {\n    FT_UInt32  numRanges = TT_PEEK_ULONG( base );\n    FT_UInt32  max, min;\n\n\n    min = 0;\n    max = numRanges;\n\n    base += 4;\n\n    /* binary search */\n    while ( min < max )\n    {\n      FT_UInt32  mid   = ( min + max ) >> 1;\n      FT_Byte*   p     = base + 4 * mid;\n      FT_ULong   start = TT_NEXT_UINT24( p );\n      FT_UInt    cnt   = FT_NEXT_BYTE( p );\n\n\n      if ( char_code < start )\n        max = mid;\n      else if ( char_code > start+cnt )\n        min = mid + 1;\n      else\n        return TRUE;\n    }\n\n    return FALSE;\n  }\n\n\n  static FT_UInt\n  tt_cmap14_char_map_nondef_binary( FT_Byte    *base,\n                                    FT_UInt32   char_code )\n  {\n    FT_UInt32  numMappings = TT_PEEK_ULONG( base );\n    FT_UInt32  max, min;\n\n\n    min = 0;\n    max = numMappings;\n\n    base += 4;\n\n    /* binary search */\n    while ( min < max )\n    {\n      FT_UInt32  mid = ( min + max ) >> 1;\n      FT_Byte*   p   = base + 5 * mid;\n      FT_UInt32  uni = (FT_UInt32)TT_NEXT_UINT24( p );\n\n\n      if ( char_code < uni )\n        max = mid;\n      else if ( char_code > uni )\n        min = mid + 1;\n      else\n        return TT_PEEK_USHORT( p );\n    }\n\n    return 0;\n  }\n\n\n  static FT_Byte*\n  tt_cmap14_find_variant( FT_Byte    *base,\n                          FT_UInt32   variantCode )\n  {\n    FT_UInt32  numVar = TT_PEEK_ULONG( base );\n    FT_UInt32  max, min;\n\n\n    min = 0;\n    max = numVar;\n\n    base += 4;\n\n    /* binary search */\n    while ( min < max )\n    {\n      FT_UInt32  mid    = ( min + max ) >> 1;\n      FT_Byte*   p      = base + 11 * mid;\n      FT_ULong   varSel = TT_NEXT_UINT24( p );\n\n\n      if ( variantCode < varSel )\n        max = mid;\n      else if ( variantCode > varSel )\n        min = mid + 1;\n      else\n        return p;\n    }\n\n    return NULL;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt )\n  tt_cmap14_char_var_index( TT_CMap    cmap,\n                            TT_CMap    ucmap,\n                            FT_UInt32  charcode,\n                            FT_UInt32  variantSelector )\n  {\n    FT_Byte*  p = tt_cmap14_find_variant( cmap->data + 6, variantSelector );\n    FT_ULong  defOff;\n    FT_ULong  nondefOff;\n\n\n    if ( !p )\n      return 0;\n\n    defOff    = TT_NEXT_ULONG( p );\n    nondefOff = TT_PEEK_ULONG( p );\n\n    if ( defOff != 0                                                    &&\n         tt_cmap14_char_map_def_binary( cmap->data + defOff, charcode ) )\n    {\n      /* This is the default variant of this charcode.  GID not stored */\n      /* here; stored in the normal Unicode charmap instead.           */\n      return ucmap->cmap.clazz->char_index( &ucmap->cmap, charcode );\n    }\n\n    if ( nondefOff != 0 )\n      return tt_cmap14_char_map_nondef_binary( cmap->data + nondefOff,\n                                               charcode );\n\n    return 0;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Int )\n  tt_cmap14_char_var_isdefault( TT_CMap    cmap,\n                                FT_UInt32  charcode,\n                                FT_UInt32  variantSelector )\n  {\n    FT_Byte*  p = tt_cmap14_find_variant( cmap->data + 6, variantSelector );\n    FT_ULong  defOff;\n    FT_ULong  nondefOff;\n\n\n    if ( !p )\n      return -1;\n\n    defOff    = TT_NEXT_ULONG( p );\n    nondefOff = TT_NEXT_ULONG( p );\n\n    if ( defOff != 0                                                    &&\n         tt_cmap14_char_map_def_binary( cmap->data + defOff, charcode ) )\n      return 1;\n\n    if ( nondefOff != 0                                            &&\n         tt_cmap14_char_map_nondef_binary( cmap->data + nondefOff,\n                                           charcode ) != 0         )\n      return 0;\n\n    return -1;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt32* )\n  tt_cmap14_variants( TT_CMap    cmap,\n                      FT_Memory  memory )\n  {\n    TT_CMap14   cmap14 = (TT_CMap14)cmap;\n    FT_UInt32   count  = cmap14->num_selectors;\n    FT_Byte*    p      = cmap->data + 10;\n    FT_UInt32*  result;\n    FT_UInt32   i;\n\n\n    if ( tt_cmap14_ensure( cmap14, ( count + 1 ), memory ) )\n      return NULL;\n\n    result = cmap14->results;\n    for ( i = 0; i < count; ++i )\n    {\n      result[i] = (FT_UInt32)TT_NEXT_UINT24( p );\n      p        += 8;\n    }\n    result[i] = 0;\n\n    return result;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt32 * )\n  tt_cmap14_char_variants( TT_CMap    cmap,\n                           FT_Memory  memory,\n                           FT_UInt32  charCode )\n  {\n    TT_CMap14   cmap14 = (TT_CMap14)  cmap;\n    FT_UInt32   count  = cmap14->num_selectors;\n    FT_Byte*    p      = cmap->data + 10;\n    FT_UInt32*  q;\n\n\n    if ( tt_cmap14_ensure( cmap14, ( count + 1 ), memory ) )\n      return NULL;\n\n    for ( q = cmap14->results; count > 0; --count )\n    {\n      FT_UInt32  varSel    = TT_NEXT_UINT24( p );\n      FT_ULong   defOff    = TT_NEXT_ULONG( p );\n      FT_ULong   nondefOff = TT_NEXT_ULONG( p );\n\n\n      if ( ( defOff != 0                                               &&\n             tt_cmap14_char_map_def_binary( cmap->data + defOff,\n                                            charCode )                 ) ||\n           ( nondefOff != 0                                            &&\n             tt_cmap14_char_map_nondef_binary( cmap->data + nondefOff,\n                                               charCode ) != 0         ) )\n      {\n        q[0] = varSel;\n        q++;\n      }\n    }\n    q[0] = 0;\n\n    return cmap14->results;\n  }\n\n\n  static FT_UInt\n  tt_cmap14_def_char_count( FT_Byte  *p )\n  {\n    FT_UInt32  numRanges = (FT_UInt32)TT_NEXT_ULONG( p );\n    FT_UInt    tot       = 0;\n\n\n    p += 3;  /* point to the first `cnt' field */\n    for ( ; numRanges > 0; numRanges-- )\n    {\n      tot += 1 + p[0];\n      p   += 4;\n    }\n\n    return tot;\n  }\n\n\n  static FT_UInt32*\n  tt_cmap14_get_def_chars( TT_CMap    cmap,\n                           FT_Byte*   p,\n                           FT_Memory  memory )\n  {\n    TT_CMap14   cmap14 = (TT_CMap14) cmap;\n    FT_UInt32   numRanges;\n    FT_UInt     cnt;\n    FT_UInt32*  q;\n\n\n    cnt       = tt_cmap14_def_char_count( p );\n    numRanges = (FT_UInt32)TT_NEXT_ULONG( p );\n\n    if ( tt_cmap14_ensure( cmap14, ( cnt + 1 ), memory ) )\n      return NULL;\n\n    for ( q = cmap14->results; numRanges > 0; --numRanges )\n    {\n      FT_UInt32  uni = (FT_UInt32)TT_NEXT_UINT24( p );\n\n\n      cnt = FT_NEXT_BYTE( p ) + 1;\n      do\n      {\n        q[0]  = uni;\n        uni  += 1;\n        q    += 1;\n\n      } while ( --cnt != 0 );\n    }\n    q[0] = 0;\n\n    return cmap14->results;\n  }\n\n\n  static FT_UInt32*\n  tt_cmap14_get_nondef_chars( TT_CMap     cmap,\n                              FT_Byte    *p,\n                              FT_Memory   memory )\n  {\n    TT_CMap14   cmap14 = (TT_CMap14) cmap;\n    FT_UInt32   numMappings;\n    FT_UInt     i;\n    FT_UInt32  *ret;\n\n\n    numMappings = (FT_UInt32)TT_NEXT_ULONG( p );\n\n    if ( tt_cmap14_ensure( cmap14, ( numMappings + 1 ), memory ) )\n      return NULL;\n\n    ret = cmap14->results;\n    for ( i = 0; i < numMappings; ++i )\n    {\n      ret[i] = (FT_UInt32)TT_NEXT_UINT24( p );\n      p += 2;\n    }\n    ret[i] = 0;\n\n    return ret;\n  }\n\n\n  FT_CALLBACK_DEF( FT_UInt32 * )\n  tt_cmap14_variant_chars( TT_CMap    cmap,\n                           FT_Memory  memory,\n                           FT_UInt32  variantSelector )\n  {\n    FT_Byte    *p  = tt_cmap14_find_variant( cmap->data + 6,\n                                             variantSelector );\n    FT_Int      i;\n    FT_ULong    defOff;\n    FT_ULong    nondefOff;\n\n\n    if ( !p )\n      return NULL;\n\n    defOff    = TT_NEXT_ULONG( p );\n    nondefOff = TT_NEXT_ULONG( p );\n\n    if ( defOff == 0 && nondefOff == 0 )\n      return NULL;\n\n    if ( defOff == 0 )\n      return tt_cmap14_get_nondef_chars( cmap, cmap->data + nondefOff,\n                                         memory );\n    else if ( nondefOff == 0 )\n      return tt_cmap14_get_def_chars( cmap, cmap->data + defOff,\n                                      memory );\n    else\n    {\n      /* Both a default and a non-default glyph set?  That's probably not */\n      /* good font design, but the spec allows for it...                  */\n      TT_CMap14  cmap14 = (TT_CMap14) cmap;\n      FT_UInt32  numRanges;\n      FT_UInt32  numMappings;\n      FT_UInt32  duni;\n      FT_UInt32  dcnt;\n      FT_UInt32  nuni;\n      FT_Byte*   dp;\n      FT_UInt    di, ni, k;\n\n      FT_UInt32  *ret;\n\n\n      p  = cmap->data + nondefOff;\n      dp = cmap->data + defOff;\n\n      numMappings = (FT_UInt32)TT_NEXT_ULONG( p );\n      dcnt        = tt_cmap14_def_char_count( dp );\n      numRanges   = (FT_UInt32)TT_NEXT_ULONG( dp );\n\n      if ( numMappings == 0 )\n        return tt_cmap14_get_def_chars( cmap, cmap->data + defOff,\n                                        memory );\n      if ( dcnt == 0 )\n        return tt_cmap14_get_nondef_chars( cmap, cmap->data + nondefOff,\n                                           memory );\n\n      if ( tt_cmap14_ensure( cmap14, ( dcnt + numMappings + 1 ), memory ) )\n        return NULL;\n\n      ret  = cmap14->results;\n      duni = (FT_UInt32)TT_NEXT_UINT24( dp );\n      dcnt = FT_NEXT_BYTE( dp );\n      di   = 1;\n      nuni = (FT_UInt32)TT_NEXT_UINT24( p );\n      p   += 2;\n      ni   = 1;\n      i    = 0;\n\n      for ( ;; )\n      {\n        if ( nuni > duni + dcnt )\n        {\n          for ( k = 0; k <= dcnt; ++k )\n            ret[i++] = duni + k;\n\n          ++di;\n\n          if ( di > numRanges )\n            break;\n\n          duni = (FT_UInt32)TT_NEXT_UINT24( dp );\n          dcnt = FT_NEXT_BYTE( dp );\n        }\n        else\n        {\n          if ( nuni < duni )\n            ret[i++] = nuni;\n          /* If it is within the default range then ignore it -- */\n          /* that should not have happened                       */\n          ++ni;\n          if ( ni > numMappings )\n            break;\n\n          nuni = (FT_UInt32)TT_NEXT_UINT24( p );\n          p += 2;\n        }\n      }\n\n      if ( ni <= numMappings )\n      {\n        /* If we get here then we have run out of all default ranges.   */\n        /* We have read one non-default mapping which we haven't stored */\n        /* and there may be others that need to be read.                */\n        ret[i++] = nuni;\n        while ( ni < numMappings )\n        {\n          ret[i++] = (FT_UInt32)TT_NEXT_UINT24( p );\n          p += 2;\n          ++ni;\n        }\n      }\n      else if ( di <= numRanges )\n      {\n        /* If we get here then we have run out of all non-default     */\n        /* mappings.  We have read one default range which we haven't */\n        /* stored and there may be others that need to be read.       */\n        for ( k = 0; k <= dcnt; ++k )\n          ret[i++] = duni + k;\n\n        while ( di < numRanges )\n        {\n          duni = (FT_UInt32)TT_NEXT_UINT24( dp );\n          dcnt = FT_NEXT_BYTE( dp );\n\n          for ( k = 0; k <= dcnt; ++k )\n            ret[i++] = duni + k;\n          ++di;\n        }\n      }\n\n      ret[i] = 0;\n\n      return ret;\n    }\n  }\n\n\n  FT_DEFINE_TT_CMAP(\n    tt_cmap14_class_rec,\n    sizeof ( TT_CMap14Rec ),\n\n    (FT_CMap_InitFunc)     tt_cmap14_init,\n    (FT_CMap_DoneFunc)     tt_cmap14_done,\n    (FT_CMap_CharIndexFunc)tt_cmap14_char_index,\n    (FT_CMap_CharNextFunc) tt_cmap14_char_next,\n\n    /* Format 14 extension functions */\n    (FT_CMap_CharVarIndexFunc)    tt_cmap14_char_var_index,\n    (FT_CMap_CharVarIsDefaultFunc)tt_cmap14_char_var_isdefault,\n    (FT_CMap_VariantListFunc)     tt_cmap14_variants,\n    (FT_CMap_CharVariantListFunc) tt_cmap14_char_variants,\n    (FT_CMap_VariantCharListFunc) tt_cmap14_variant_chars,\n\n    14,\n    (TT_CMap_ValidateFunc)tt_cmap14_validate,\n    (TT_CMap_Info_GetFunc)tt_cmap14_get_info )\n\n#endif /* TT_CONFIG_CMAP_FORMAT_14 */\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n  static const TT_CMap_Class  tt_cmap_classes[] =\n  {\n#define TTCMAPCITEM( a )  &a,\n#include \"ttcmapc.h\"\n    NULL,\n  };\n\n#else /*FT_CONFIG_OPTION_PIC*/\n\n  void\n  FT_Destroy_Class_tt_cmap_classes( FT_Library      library,\n                                    TT_CMap_Class*  clazz )\n  {\n    FT_Memory  memory = library->memory;\n\n\n    if ( clazz )\n      FT_FREE( clazz );\n  }\n\n\n  FT_Error\n  FT_Create_Class_tt_cmap_classes( FT_Library       library,\n                                   TT_CMap_Class**  output_class )\n  {\n    TT_CMap_Class*     clazz  = NULL;\n    TT_CMap_ClassRec*  recs;\n    FT_Error           error;\n    FT_Memory          memory = library->memory;\n\n    int  i = 0;\n\n\n#define TTCMAPCITEM( a ) i++;\n#include \"ttcmapc.h\"\n\n    /* allocate enough space for both the pointers */\n    /* plus terminator and the class instances     */\n    if ( FT_ALLOC( clazz, sizeof ( *clazz ) * ( i + 1 ) +\n                          sizeof ( TT_CMap_ClassRec ) * i ) )\n      return error;\n\n    /* the location of the class instances follows the array of pointers */\n    recs = (TT_CMap_ClassRec*)( (char*)clazz +\n                                sizeof ( *clazz ) * ( i + 1 ) );\n    i    = 0;\n\n#undef TTCMAPCITEM\n#define  TTCMAPCITEM( a )             \\\n    FT_Init_Class_ ## a( &recs[i] );  \\\n    clazz[i] = &recs[i];              \\\n    i++;\n#include \"ttcmapc.h\"\n\n    clazz[i] = NULL;\n\n    *output_class = clazz;\n    return FT_Err_Ok;\n  }\n\n#endif /*FT_CONFIG_OPTION_PIC*/\n\n\n  /* parse the `cmap' table and build the corresponding TT_CMap objects */\n  /* in the current face                                                */\n  /*                                                                    */\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_build_cmaps( TT_Face  face )\n  {\n    FT_Byte*           table = face->cmap_table;\n    FT_Byte*           limit = table + face->cmap_size;\n    FT_UInt volatile   num_cmaps;\n    FT_Byte* volatile  p     = table;\n    FT_Library         library = FT_FACE_LIBRARY( face );\n\n    FT_UNUSED( library );\n\n\n    if ( !p || p + 4 > limit )\n      return FT_THROW( Invalid_Table );\n\n    /* only recognize format 0 */\n    if ( TT_NEXT_USHORT( p ) != 0 )\n    {\n      FT_ERROR(( \"tt_face_build_cmaps:\"\n                 \" unsupported `cmap' table format = %d\\n\",\n                 TT_PEEK_USHORT( p - 2 ) ));\n      return FT_THROW( Invalid_Table );\n    }\n\n    num_cmaps = TT_NEXT_USHORT( p );\n\n    for ( ; num_cmaps > 0 && p + 8 <= limit; num_cmaps-- )\n    {\n      FT_CharMapRec  charmap;\n      FT_UInt32      offset;\n\n\n      charmap.platform_id = TT_NEXT_USHORT( p );\n      charmap.encoding_id = TT_NEXT_USHORT( p );\n      charmap.face        = FT_FACE( face );\n      charmap.encoding    = FT_ENCODING_NONE;  /* will be filled later */\n      offset              = TT_NEXT_ULONG( p );\n\n      if ( offset && offset <= face->cmap_size - 2 )\n      {\n        FT_Byte* volatile              cmap   = table + offset;\n        volatile FT_UInt               format = TT_PEEK_USHORT( cmap );\n        const TT_CMap_Class* volatile  pclazz = TT_CMAP_CLASSES_GET;\n        TT_CMap_Class volatile         clazz;\n\n\n        for ( ; *pclazz; pclazz++ )\n        {\n          clazz = *pclazz;\n          if ( clazz->format == format )\n          {\n            volatile TT_ValidatorRec  valid;\n            volatile FT_Error         error = FT_Err_Ok;\n\n\n            ft_validator_init( FT_VALIDATOR( &valid ), cmap, limit,\n                               FT_VALIDATE_DEFAULT );\n\n            valid.num_glyphs = (FT_UInt)face->max_profile.numGlyphs;\n\n            if ( ft_setjmp( FT_VALIDATOR( &valid )->jump_buffer) == 0 )\n            {\n              /* validate this cmap sub-table */\n              error = clazz->validate( cmap, FT_VALIDATOR( &valid ) );\n            }\n\n            if ( valid.validator.error == 0 )\n            {\n              FT_CMap  ttcmap;\n\n\n              /* It might make sense to store the single variation         */\n              /* selector cmap somewhere special.  But it would have to be */\n              /* in the public FT_FaceRec, and we can't change that.       */\n\n              if ( !FT_CMap_New( (FT_CMap_Class)clazz,\n                                 cmap, &charmap, &ttcmap ) )\n              {\n                /* it is simpler to directly set `flags' than adding */\n                /* a parameter to FT_CMap_New                        */\n                ((TT_CMap)ttcmap)->flags = (FT_Int)error;\n              }\n            }\n            else\n            {\n              FT_TRACE0(( \"tt_face_build_cmaps:\"\n                          \" broken cmap sub-table ignored\\n\" ));\n            }\n            break;\n          }\n        }\n\n        if ( *pclazz == NULL )\n        {\n          FT_TRACE0(( \"tt_face_build_cmaps:\"\n                      \" unsupported cmap sub-table ignored\\n\" ));\n        }\n      }\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_LOCAL( FT_Error )\n  tt_get_cmap_info( FT_CharMap    charmap,\n                    TT_CMapInfo  *cmap_info )\n  {\n    FT_CMap        cmap  = (FT_CMap)charmap;\n    TT_CMap_Class  clazz = (TT_CMap_Class)cmap->clazz;\n\n\n    return clazz->get_cmap_info( charmap, cmap_info );\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/ttcmap.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttcmap.h                                                               */\n/*                                                                         */\n/*    TrueType character mapping table (cmap) support (specification).     */\n/*                                                                         */\n/*  Copyright 2002-2005, 2009, 2012 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTCMAP_H__\n#define __TTCMAP_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_TRUETYPE_TYPES_H\n#include FT_INTERNAL_VALIDATE_H\n#include FT_SERVICE_TT_CMAP_H\n\nFT_BEGIN_HEADER\n\n\n#define TT_CMAP_FLAG_UNSORTED     1\n#define TT_CMAP_FLAG_OVERLAPPING  2\n\n  typedef struct  TT_CMapRec_\n  {\n    FT_CMapRec  cmap;\n    FT_Byte*    data;           /* pointer to in-memory cmap table */\n    FT_Int      flags;          /* for format 4 only               */\n\n  } TT_CMapRec, *TT_CMap;\n\n  typedef const struct TT_CMap_ClassRec_*  TT_CMap_Class;\n\n\n  typedef FT_Error\n  (*TT_CMap_ValidateFunc)( FT_Byte*      data,\n                           FT_Validator  valid );\n\n  typedef struct  TT_CMap_ClassRec_\n  {\n    FT_CMap_ClassRec      clazz;\n    FT_UInt               format;\n    TT_CMap_ValidateFunc  validate;\n    TT_CMap_Info_GetFunc  get_cmap_info;\n\n  } TT_CMap_ClassRec;\n\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_DEFINE_TT_CMAP( class_,             \\\n                           size_,              \\\n                           init_,              \\\n                           done_,              \\\n                           char_index_,        \\\n                           char_next_,         \\\n                           char_var_index_,    \\\n                           char_var_default_,  \\\n                           variant_list_,      \\\n                           charvariant_list_,  \\\n                           variantchar_list_,  \\\n                           format_,            \\\n                           validate_,          \\\n                           get_cmap_info_ )    \\\n  FT_CALLBACK_TABLE_DEF                        \\\n  const TT_CMap_ClassRec  class_ =             \\\n  {                                            \\\n    { size_,                                   \\\n      init_,                                   \\\n      done_,                                   \\\n      char_index_,                             \\\n      char_next_,                              \\\n      char_var_index_,                         \\\n      char_var_default_,                       \\\n      variant_list_,                           \\\n      charvariant_list_,                       \\\n      variantchar_list_                        \\\n    },                                         \\\n                                               \\\n    format_,                                   \\\n    validate_,                                 \\\n    get_cmap_info_                             \\\n  };\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#define FT_DEFINE_TT_CMAP( class_,                      \\\n                           size_,                       \\\n                           init_,                       \\\n                           done_,                       \\\n                           char_index_,                 \\\n                           char_next_,                  \\\n                           char_var_index_,             \\\n                           char_var_default_,           \\\n                           variant_list_,               \\\n                           charvariant_list_,           \\\n                           variantchar_list_,           \\\n                           format_,                     \\\n                           validate_,                   \\\n                           get_cmap_info_ )             \\\n  void                                                  \\\n  FT_Init_Class_ ## class_( TT_CMap_ClassRec*  clazz )  \\\n  {                                                     \\\n    clazz->clazz.size             = size_;              \\\n    clazz->clazz.init             = init_;              \\\n    clazz->clazz.done             = done_;              \\\n    clazz->clazz.char_index       = char_index_;        \\\n    clazz->clazz.char_next        = char_next_;         \\\n    clazz->clazz.char_var_index   = char_var_index_;    \\\n    clazz->clazz.char_var_default = char_var_default_;  \\\n    clazz->clazz.variant_list     = variant_list_;      \\\n    clazz->clazz.charvariant_list = charvariant_list_;  \\\n    clazz->clazz.variantchar_list = variantchar_list_;  \\\n    clazz->format                 = format_;            \\\n    clazz->validate               = validate_;          \\\n    clazz->get_cmap_info          = get_cmap_info_;     \\\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n  typedef struct  TT_ValidatorRec_\n  {\n    FT_ValidatorRec  validator;\n    FT_UInt          num_glyphs;\n\n  } TT_ValidatorRec, *TT_Validator;\n\n\n#define TT_VALIDATOR( x )          ( (TT_Validator)( x ) )\n#define TT_VALID_GLYPH_COUNT( x )  TT_VALIDATOR( x )->num_glyphs\n\n\n  FT_LOCAL( FT_Error )\n  tt_face_build_cmaps( TT_Face  face );\n\n  /* used in tt-cmaps service */\n  FT_LOCAL( FT_Error )\n  tt_get_cmap_info( FT_CharMap    charmap,\n                    TT_CMapInfo  *cmap_info );\n\n\nFT_END_HEADER\n\n#endif /* __TTCMAP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/ttcmapc.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttcmapc.h                                                              */\n/*                                                                         */\n/*    TT CMAP classes definitions (specification only).                    */\n/*                                                                         */\n/*  Copyright 2009 by                                                      */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifdef TT_CONFIG_CMAP_FORMAT_0\n  TTCMAPCITEM( tt_cmap0_class_rec )\n#endif\n\n#ifdef TT_CONFIG_CMAP_FORMAT_2\n  TTCMAPCITEM( tt_cmap2_class_rec )\n#endif\n\n#ifdef TT_CONFIG_CMAP_FORMAT_4\n  TTCMAPCITEM( tt_cmap4_class_rec )\n#endif\n\n#ifdef TT_CONFIG_CMAP_FORMAT_6\n  TTCMAPCITEM( tt_cmap6_class_rec )\n#endif\n\n#ifdef TT_CONFIG_CMAP_FORMAT_8\n  TTCMAPCITEM( tt_cmap8_class_rec )\n#endif\n\n#ifdef TT_CONFIG_CMAP_FORMAT_10\n  TTCMAPCITEM( tt_cmap10_class_rec )\n#endif\n\n#ifdef TT_CONFIG_CMAP_FORMAT_12\n  TTCMAPCITEM( tt_cmap12_class_rec )\n#endif\n\n#ifdef TT_CONFIG_CMAP_FORMAT_13\n  TTCMAPCITEM( tt_cmap13_class_rec )\n#endif\n\n#ifdef TT_CONFIG_CMAP_FORMAT_14\n  TTCMAPCITEM( tt_cmap14_class_rec )\n#endif\n\n\n  /* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/ttkern.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttkern.c                                                               */\n/*                                                                         */\n/*    Load the basic TrueType kerning table.  This doesn't handle          */\n/*    kerning data within the GPOS table at the moment.                    */\n/*                                                                         */\n/*  Copyright 1996-2007, 2009, 2010, 2013 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_TRUETYPE_TAGS_H\n#include \"ttkern.h\"\n\n#include \"sferrors.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_ttkern\n\n\n#undef  TT_KERN_INDEX\n#define TT_KERN_INDEX( g1, g2 )  ( ( (FT_ULong)(g1) << 16 ) | (g2) )\n\n\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_load_kern( TT_Face    face,\n                     FT_Stream  stream )\n  {\n    FT_Error   error;\n    FT_ULong   table_size;\n    FT_Byte*   p;\n    FT_Byte*   p_limit;\n    FT_UInt    nn, num_tables;\n    FT_UInt32  avail = 0, ordered = 0;\n\n\n    /* the kern table is optional; exit silently if it is missing */\n    error = face->goto_table( face, TTAG_kern, stream, &table_size );\n    if ( error )\n      goto Exit;\n\n    if ( table_size < 4 )  /* the case of a malformed table */\n    {\n      FT_ERROR(( \"tt_face_load_kern:\"\n                 \" kerning table is too small - ignored\\n\" ));\n      error = FT_THROW( Table_Missing );\n      goto Exit;\n    }\n\n    if ( FT_FRAME_EXTRACT( table_size, face->kern_table ) )\n    {\n      FT_ERROR(( \"tt_face_load_kern:\"\n                 \" could not extract kerning table\\n\" ));\n      goto Exit;\n    }\n\n    face->kern_table_size = table_size;\n\n    p       = face->kern_table;\n    p_limit = p + table_size;\n\n    p         += 2; /* skip version */\n    num_tables = FT_NEXT_USHORT( p );\n\n    if ( num_tables > 32 ) /* we only support up to 32 sub-tables */\n      num_tables = 32;\n\n    for ( nn = 0; nn < num_tables; nn++ )\n    {\n      FT_UInt    num_pairs, length, coverage;\n      FT_Byte*   p_next;\n      FT_UInt32  mask = (FT_UInt32)1UL << nn;\n\n\n      if ( p + 6 > p_limit )\n        break;\n\n      p_next = p;\n\n      p += 2; /* skip version */\n      length   = FT_NEXT_USHORT( p );\n      coverage = FT_NEXT_USHORT( p );\n\n      if ( length <= 6 + 8 )\n        break;\n\n      p_next += length;\n\n      if ( p_next > p_limit )  /* handle broken table */\n        p_next = p_limit;\n\n      /* only use horizontal kerning tables */\n      if ( ( coverage & ~8 ) != 0x0001 ||\n           p + 8 > p_limit             )\n        goto NextTable;\n\n      num_pairs = FT_NEXT_USHORT( p );\n      p        += 6;\n\n      if ( ( p_next - p ) < 6 * (int)num_pairs ) /* handle broken count */\n        num_pairs = (FT_UInt)( ( p_next - p ) / 6 );\n\n      avail |= mask;\n\n      /*\n       *  Now check whether the pairs in this table are ordered.\n       *  We then can use binary search.\n       */\n      if ( num_pairs > 0 )\n      {\n        FT_ULong  count;\n        FT_ULong  old_pair;\n\n\n        old_pair = FT_NEXT_ULONG( p );\n        p       += 2;\n\n        for ( count = num_pairs - 1; count > 0; count-- )\n        {\n          FT_UInt32  cur_pair;\n\n\n          cur_pair = FT_NEXT_ULONG( p );\n          if ( cur_pair <= old_pair )\n            break;\n\n          p += 2;\n          old_pair = cur_pair;\n        }\n\n        if ( count == 0 )\n          ordered |= mask;\n      }\n\n    NextTable:\n      p = p_next;\n    }\n\n    face->num_kern_tables = nn;\n    face->kern_avail_bits = avail;\n    face->kern_order_bits = ordered;\n\n  Exit:\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  tt_face_done_kern( TT_Face  face )\n  {\n    FT_Stream  stream = face->root.stream;\n\n\n    FT_FRAME_RELEASE( face->kern_table );\n    face->kern_table_size = 0;\n    face->num_kern_tables = 0;\n    face->kern_avail_bits = 0;\n    face->kern_order_bits = 0;\n  }\n\n\n  FT_LOCAL_DEF( FT_Int )\n  tt_face_get_kerning( TT_Face  face,\n                       FT_UInt  left_glyph,\n                       FT_UInt  right_glyph )\n  {\n    FT_Int    result = 0;\n    FT_UInt   count, mask;\n    FT_Byte*  p       = face->kern_table;\n    FT_Byte*  p_limit = p + face->kern_table_size;\n\n\n    p   += 4;\n    mask = 0x0001;\n\n    for ( count = face->num_kern_tables;\n          count > 0 && p + 6 <= p_limit;\n          count--, mask <<= 1 )\n    {\n      FT_Byte* base     = p;\n      FT_Byte* next;\n      FT_UInt  version  = FT_NEXT_USHORT( p );\n      FT_UInt  length   = FT_NEXT_USHORT( p );\n      FT_UInt  coverage = FT_NEXT_USHORT( p );\n      FT_UInt  num_pairs;\n      FT_Int   value    = 0;\n\n      FT_UNUSED( version );\n\n\n      next = base + length;\n\n      if ( next > p_limit )  /* handle broken table */\n        next = p_limit;\n\n      if ( ( face->kern_avail_bits & mask ) == 0 )\n        goto NextTable;\n\n      if ( p + 8 > next )\n        goto NextTable;\n\n      num_pairs = FT_NEXT_USHORT( p );\n      p        += 6;\n\n      if ( ( next - p ) < 6 * (int)num_pairs )  /* handle broken count  */\n        num_pairs = (FT_UInt)( ( next - p ) / 6 );\n\n      switch ( coverage >> 8 )\n      {\n      case 0:\n        {\n          FT_ULong  key0 = TT_KERN_INDEX( left_glyph, right_glyph );\n\n\n          if ( face->kern_order_bits & mask )   /* binary search */\n          {\n            FT_UInt   min = 0;\n            FT_UInt   max = num_pairs;\n\n\n            while ( min < max )\n            {\n              FT_UInt   mid = ( min + max ) >> 1;\n              FT_Byte*  q   = p + 6 * mid;\n              FT_ULong  key;\n\n\n              key = FT_NEXT_ULONG( q );\n\n              if ( key == key0 )\n              {\n                value = FT_PEEK_SHORT( q );\n                goto Found;\n              }\n              if ( key < key0 )\n                min = mid + 1;\n              else\n                max = mid;\n            }\n          }\n          else /* linear search */\n          {\n            FT_UInt  count2;\n\n\n            for ( count2 = num_pairs; count2 > 0; count2-- )\n            {\n              FT_ULong  key = FT_NEXT_ULONG( p );\n\n\n              if ( key == key0 )\n              {\n                value = FT_PEEK_SHORT( p );\n                goto Found;\n              }\n              p += 2;\n            }\n          }\n        }\n        break;\n\n       /*\n        *  We don't support format 2 because we haven't seen a single font\n        *  using it in real life...\n        */\n\n      default:\n        ;\n      }\n\n      goto NextTable;\n\n    Found:\n      if ( coverage & 8 ) /* override or add */\n        result = value;\n      else\n        result += value;\n\n    NextTable:\n      p = next;\n    }\n\n    return result;\n  }\n\n#undef TT_KERN_INDEX\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/ttkern.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttkern.h                                                               */\n/*                                                                         */\n/*    Load the basic TrueType kerning table.  This doesn't handle          */\n/*    kerning data within the GPOS table at the moment.                    */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2005, 2007 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTKERN_H__\n#define __TTKERN_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_TRUETYPE_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n  FT_LOCAL( FT_Error  )\n  tt_face_load_kern( TT_Face    face,\n                     FT_Stream  stream );\n\n  FT_LOCAL( void )\n  tt_face_done_kern( TT_Face  face );\n\n  FT_LOCAL( FT_Int )\n  tt_face_get_kerning( TT_Face     face,\n                       FT_UInt     left_glyph,\n                       FT_UInt     right_glyph );\n\n#define TT_FACE_HAS_KERNING( face )  ( (face)->kern_avail_bits != 0 )\n\n\nFT_END_HEADER\n\n#endif /* __TTKERN_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/ttload.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttload.c                                                               */\n/*                                                                         */\n/*    Load the basic TrueType tables, i.e., tables that can be either in   */\n/*    TTF or OTF fonts (body).                                             */\n/*                                                                         */\n/*  Copyright 1996-2010, 2012-2014 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_TRUETYPE_TAGS_H\n#include \"ttload.h\"\n\n#include \"sferrors.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_ttload\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_lookup_table                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Looks for a TrueType table by name.                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A face object handle.                                      */\n  /*                                                                       */\n  /*    tag  :: The searched tag.                                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to the table directory entry.  0 if not found.           */\n  /*                                                                       */\n  FT_LOCAL_DEF( TT_Table  )\n  tt_face_lookup_table( TT_Face   face,\n                        FT_ULong  tag  )\n  {\n    TT_Table  entry;\n    TT_Table  limit;\n#ifdef FT_DEBUG_LEVEL_TRACE\n    FT_Bool   zero_length = FALSE;\n#endif\n\n\n    FT_TRACE4(( \"tt_face_lookup_table: %08p, `%c%c%c%c' -- \",\n                face,\n                (FT_Char)( tag >> 24 ),\n                (FT_Char)( tag >> 16 ),\n                (FT_Char)( tag >> 8  ),\n                (FT_Char)( tag       ) ));\n\n    entry = face->dir_tables;\n    limit = entry + face->num_tables;\n\n    for ( ; entry < limit; entry++ )\n    {\n      /* For compatibility with Windows, we consider    */\n      /* zero-length tables the same as missing tables. */\n      if ( entry->Tag == tag )\n      {\n        if ( entry->Length != 0 )\n        {\n          FT_TRACE4(( \"found table.\\n\" ));\n          return entry;\n        }\n#ifdef FT_DEBUG_LEVEL_TRACE\n        zero_length = TRUE;\n#endif\n      }\n    }\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n    if ( zero_length )\n      FT_TRACE4(( \"ignoring empty table\\n\" ));\n    else\n      FT_TRACE4(( \"could not find table\\n\" ));\n#endif\n\n    return NULL;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_goto_table                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Looks for a TrueType table by name, then seek a stream to it.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A face object handle.                                    */\n  /*                                                                       */\n  /*    tag    :: The searched tag.                                        */\n  /*                                                                       */\n  /*    stream :: The stream to seek when the table is found.              */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    length :: The length of the table if found, undefined otherwise.   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_goto_table( TT_Face    face,\n                      FT_ULong   tag,\n                      FT_Stream  stream,\n                      FT_ULong*  length )\n  {\n    TT_Table  table;\n    FT_Error  error;\n\n\n    table = tt_face_lookup_table( face, tag );\n    if ( table )\n    {\n      if ( length )\n        *length = table->Length;\n\n      if ( FT_STREAM_SEEK( table->Offset ) )\n        goto Exit;\n    }\n    else\n      error = FT_THROW( Table_Missing );\n\n  Exit:\n    return error;\n  }\n\n\n  /* Here, we                                                         */\n  /*                                                                  */\n  /* - check that `num_tables' is valid (and adjust it if necessary)  */\n  /*                                                                  */\n  /* - look for a `head' table, check its size, and parse it to check */\n  /*   whether its `magic' field is correctly set                     */\n  /*                                                                  */\n  /* - errors (except errors returned by stream handling)             */\n  /*                                                                  */\n  /*     SFNT_Err_Unknown_File_Format:                                */\n  /*       no table is defined in directory, it is not sfnt-wrapped   */\n  /*       data                                                       */\n  /*     SFNT_Err_Table_Missing:                                      */\n  /*       table directory is valid, but essential tables             */\n  /*       (head/bhed/SING) are missing                               */\n  /*                                                                  */\n  static FT_Error\n  check_table_dir( SFNT_Header  sfnt,\n                   FT_Stream    stream )\n  {\n    FT_Error   error;\n    FT_UShort  nn, valid_entries = 0;\n    FT_UInt    has_head = 0, has_sing = 0, has_meta = 0;\n    FT_ULong   offset = sfnt->offset + 12;\n\n    static const FT_Frame_Field  table_dir_entry_fields[] =\n    {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  TT_TableRec\n\n      FT_FRAME_START( 16 ),\n        FT_FRAME_ULONG( Tag ),\n        FT_FRAME_ULONG( CheckSum ),\n        FT_FRAME_ULONG( Offset ),\n        FT_FRAME_ULONG( Length ),\n      FT_FRAME_END\n    };\n\n\n    if ( FT_STREAM_SEEK( offset ) )\n      goto Exit;\n\n    for ( nn = 0; nn < sfnt->num_tables; nn++ )\n    {\n      TT_TableRec  table;\n\n\n      if ( FT_STREAM_READ_FIELDS( table_dir_entry_fields, &table ) )\n      {\n        nn--;\n        FT_TRACE2(( \"check_table_dir:\"\n                    \" can read only %d table%s in font (instead of %d)\\n\",\n                    nn, nn == 1 ? \"\" : \"s\", sfnt->num_tables ));\n        sfnt->num_tables = nn;\n        break;\n      }\n\n      /* we ignore invalid tables */\n\n      /* table.Offset + table.Length > stream->size ? */\n      if ( table.Length > stream->size                ||\n           table.Offset > stream->size - table.Length )\n      {\n        FT_TRACE2(( \"check_table_dir: table entry %d invalid\\n\", nn ));\n        continue;\n      }\n      else\n        valid_entries++;\n\n      if ( table.Tag == TTAG_head || table.Tag == TTAG_bhed )\n      {\n        FT_UInt32  magic;\n\n\n#ifndef TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n        if ( table.Tag == TTAG_head )\n#endif\n          has_head = 1;\n\n        /*\n         * The table length should be 0x36, but certain font tools make it\n         * 0x38, so we will just check that it is greater.\n         *\n         * Note that according to the specification, the table must be\n         * padded to 32-bit lengths, but this doesn't apply to the value of\n         * its `Length' field!\n         *\n         */\n        if ( table.Length < 0x36 )\n        {\n          FT_TRACE2(( \"check_table_dir:\"\n                      \" `head' or `bhed' table too small\\n\" ));\n          error = FT_THROW( Table_Missing );\n          goto Exit;\n        }\n\n        if ( FT_STREAM_SEEK( table.Offset + 12 ) ||\n             FT_READ_ULONG( magic )              )\n          goto Exit;\n\n        if ( magic != 0x5F0F3CF5UL )\n          FT_TRACE2(( \"check_table_dir:\"\n                      \" invalid magic number in `head' or `bhed' table\\n\"));\n\n        if ( FT_STREAM_SEEK( offset + ( nn + 1 ) * 16 ) )\n          goto Exit;\n      }\n      else if ( table.Tag == TTAG_SING )\n        has_sing = 1;\n      else if ( table.Tag == TTAG_META )\n        has_meta = 1;\n    }\n\n    sfnt->num_tables = valid_entries;\n\n    if ( sfnt->num_tables == 0 )\n    {\n      FT_TRACE2(( \"check_table_dir: no tables found\\n\" ));\n      error = FT_THROW( Unknown_File_Format );\n      goto Exit;\n    }\n\n    /* if `sing' and `meta' tables are present, there is no `head' table */\n    if ( has_head || ( has_sing && has_meta ) )\n    {\n      error = FT_Err_Ok;\n      goto Exit;\n    }\n    else\n    {\n      FT_TRACE2(( \"check_table_dir:\" ));\n#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n      FT_TRACE2(( \" neither `head', `bhed', nor `sing' table found\\n\" ));\n#else\n      FT_TRACE2(( \" neither `head' nor `sing' table found\\n\" ));\n#endif\n      error = FT_THROW( Table_Missing );\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_load_font_dir                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Loads the header of a SFNT font file.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face       :: A handle to the target face object.                  */\n  /*                                                                       */\n  /*    stream     :: The input stream.                                    */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    sfnt       :: The SFNT header.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream cursor must be at the beginning of the font directory.  */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_load_font_dir( TT_Face    face,\n                         FT_Stream  stream )\n  {\n    SFNT_HeaderRec  sfnt;\n    FT_Error        error;\n    FT_Memory       memory = stream->memory;\n    TT_TableRec*    entry;\n    FT_Int          nn;\n\n    static const FT_Frame_Field  offset_table_fields[] =\n    {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  SFNT_HeaderRec\n\n      FT_FRAME_START( 8 ),\n        FT_FRAME_USHORT( num_tables ),\n        FT_FRAME_USHORT( search_range ),\n        FT_FRAME_USHORT( entry_selector ),\n        FT_FRAME_USHORT( range_shift ),\n      FT_FRAME_END\n    };\n\n\n    FT_TRACE2(( \"tt_face_load_font_dir: %08p\\n\", face ));\n\n    /* read the offset table */\n\n    sfnt.offset = FT_STREAM_POS();\n\n    if ( FT_READ_ULONG( sfnt.format_tag )                    ||\n         FT_STREAM_READ_FIELDS( offset_table_fields, &sfnt ) )\n      goto Exit;\n\n    /* many fonts don't have these fields set correctly */\n#if 0\n    if ( sfnt.search_range != 1 << ( sfnt.entry_selector + 4 )        ||\n         sfnt.search_range + sfnt.range_shift != sfnt.num_tables << 4 )\n      return FT_THROW( Unknown_File_Format );\n#endif\n\n    /* load the table directory */\n\n    FT_TRACE2(( \"-- Number of tables: %10u\\n\",    sfnt.num_tables ));\n    FT_TRACE2(( \"-- Format version:   0x%08lx\\n\", sfnt.format_tag ));\n\n    if ( sfnt.format_tag != TTAG_OTTO )\n    {\n      /* check first */\n      error = check_table_dir( &sfnt, stream );\n      if ( error )\n      {\n        FT_TRACE2(( \"tt_face_load_font_dir:\"\n                    \" invalid table directory for TrueType\\n\" ));\n\n        goto Exit;\n      }\n    }\n\n    face->num_tables = sfnt.num_tables;\n    face->format_tag = sfnt.format_tag;\n\n    if ( FT_QNEW_ARRAY( face->dir_tables, face->num_tables ) )\n      goto Exit;\n\n    if ( FT_STREAM_SEEK( sfnt.offset + 12 )       ||\n         FT_FRAME_ENTER( face->num_tables * 16L ) )\n      goto Exit;\n\n    entry = face->dir_tables;\n\n    FT_TRACE2(( \"\\n\"\n                \"  tag    offset    length   checksum\\n\"\n                \"  ----------------------------------\\n\" ));\n\n    for ( nn = 0; nn < sfnt.num_tables; nn++ )\n    {\n      entry->Tag      = FT_GET_TAG4();\n      entry->CheckSum = FT_GET_ULONG();\n      entry->Offset   = FT_GET_ULONG();\n      entry->Length   = FT_GET_ULONG();\n\n      /* ignore invalid tables */\n\n      /* entry->Offset + entry->Length > stream->size ? */\n      if ( entry->Length > stream->size                 ||\n           entry->Offset > stream->size - entry->Length )\n        continue;\n      else\n      {\n        FT_TRACE2(( \"  %c%c%c%c  %08lx  %08lx  %08lx\\n\",\n                    (FT_Char)( entry->Tag >> 24 ),\n                    (FT_Char)( entry->Tag >> 16 ),\n                    (FT_Char)( entry->Tag >> 8  ),\n                    (FT_Char)( entry->Tag       ),\n                    entry->Offset,\n                    entry->Length,\n                    entry->CheckSum ));\n        entry++;\n      }\n    }\n\n    FT_FRAME_EXIT();\n\n    FT_TRACE2(( \"table directory loaded\\n\\n\" ));\n\n  Exit:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_load_any                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Loads any font table into client memory.                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: The face object to look for.                             */\n  /*                                                                       */\n  /*    tag    :: The tag of table to load.  Use the value 0 if you want   */\n  /*              to access the whole font file, else set this parameter   */\n  /*              to a valid TrueType table tag that you can forge with    */\n  /*              the MAKE_TT_TAG macro.                                   */\n  /*                                                                       */\n  /*    offset :: The starting offset in the table (or the file if         */\n  /*              tag == 0).                                               */\n  /*                                                                       */\n  /*    length :: The address of the decision variable:                    */\n  /*                                                                       */\n  /*                If length == NULL:                                     */\n  /*                  Loads the whole table.  Returns an error if          */\n  /*                  `offset' == 0!                                       */\n  /*                                                                       */\n  /*                If *length == 0:                                       */\n  /*                  Exits immediately; returning the length of the given */\n  /*                  table or of the font file, depending on the value of */\n  /*                  `tag'.                                               */\n  /*                                                                       */\n  /*                If *length != 0:                                       */\n  /*                  Loads the next `length' bytes of table or font,      */\n  /*                  starting at offset `offset' (in table or font too).  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    buffer :: The address of target buffer.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_load_any( TT_Face    face,\n                    FT_ULong   tag,\n                    FT_Long    offset,\n                    FT_Byte*   buffer,\n                    FT_ULong*  length )\n  {\n    FT_Error   error;\n    FT_Stream  stream;\n    TT_Table   table;\n    FT_ULong   size;\n\n\n    if ( tag != 0 )\n    {\n      /* look for tag in font directory */\n      table = tt_face_lookup_table( face, tag );\n      if ( !table )\n      {\n        error = FT_THROW( Table_Missing );\n        goto Exit;\n      }\n\n      offset += table->Offset;\n      size    = table->Length;\n    }\n    else\n      /* tag == 0 -- the user wants to access the font file directly */\n      size = face->root.stream->size;\n\n    if ( length && *length == 0 )\n    {\n      *length = size;\n\n      return FT_Err_Ok;\n    }\n\n    if ( length )\n      size = *length;\n\n    stream = face->root.stream;\n    /* the `if' is syntactic sugar for picky compilers */\n    if ( FT_STREAM_READ_AT( offset, buffer, size ) )\n      goto Exit;\n\n  Exit:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_load_generic_header                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Loads the TrueType table `head' or `bhed'.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /*    stream :: The input stream.                                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  static FT_Error\n  tt_face_load_generic_header( TT_Face    face,\n                               FT_Stream  stream,\n                               FT_ULong   tag )\n  {\n    FT_Error    error;\n    TT_Header*  header;\n\n    static const FT_Frame_Field  header_fields[] =\n    {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  TT_Header\n\n      FT_FRAME_START( 54 ),\n        FT_FRAME_ULONG ( Table_Version ),\n        FT_FRAME_ULONG ( Font_Revision ),\n        FT_FRAME_LONG  ( CheckSum_Adjust ),\n        FT_FRAME_LONG  ( Magic_Number ),\n        FT_FRAME_USHORT( Flags ),\n        FT_FRAME_USHORT( Units_Per_EM ),\n        FT_FRAME_LONG  ( Created[0] ),\n        FT_FRAME_LONG  ( Created[1] ),\n        FT_FRAME_LONG  ( Modified[0] ),\n        FT_FRAME_LONG  ( Modified[1] ),\n        FT_FRAME_SHORT ( xMin ),\n        FT_FRAME_SHORT ( yMin ),\n        FT_FRAME_SHORT ( xMax ),\n        FT_FRAME_SHORT ( yMax ),\n        FT_FRAME_USHORT( Mac_Style ),\n        FT_FRAME_USHORT( Lowest_Rec_PPEM ),\n        FT_FRAME_SHORT ( Font_Direction ),\n        FT_FRAME_SHORT ( Index_To_Loc_Format ),\n        FT_FRAME_SHORT ( Glyph_Data_Format ),\n      FT_FRAME_END\n    };\n\n\n    error = face->goto_table( face, tag, stream, 0 );\n    if ( error )\n      goto Exit;\n\n    header = &face->header;\n\n    if ( FT_STREAM_READ_FIELDS( header_fields, header ) )\n      goto Exit;\n\n    FT_TRACE3(( \"Units per EM: %4u\\n\", header->Units_Per_EM ));\n    FT_TRACE3(( \"IndexToLoc:   %4d\\n\", header->Index_To_Loc_Format ));\n\n  Exit:\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_load_head( TT_Face    face,\n                     FT_Stream  stream )\n  {\n    return tt_face_load_generic_header( face, stream, TTAG_head );\n  }\n\n\n#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_load_bhed( TT_Face    face,\n                     FT_Stream  stream )\n  {\n    return tt_face_load_generic_header( face, stream, TTAG_bhed );\n  }\n\n#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_load_max_profile                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Loads the maximum profile into a face object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /*    stream :: The input stream.                                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_load_maxp( TT_Face    face,\n                     FT_Stream  stream )\n  {\n    FT_Error        error;\n    TT_MaxProfile*  maxProfile = &face->max_profile;\n\n    static const FT_Frame_Field  maxp_fields[] =\n    {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  TT_MaxProfile\n\n      FT_FRAME_START( 6 ),\n        FT_FRAME_LONG  ( version ),\n        FT_FRAME_USHORT( numGlyphs ),\n      FT_FRAME_END\n    };\n\n    static const FT_Frame_Field  maxp_fields_extra[] =\n    {\n      FT_FRAME_START( 26 ),\n        FT_FRAME_USHORT( maxPoints ),\n        FT_FRAME_USHORT( maxContours ),\n        FT_FRAME_USHORT( maxCompositePoints ),\n        FT_FRAME_USHORT( maxCompositeContours ),\n        FT_FRAME_USHORT( maxZones ),\n        FT_FRAME_USHORT( maxTwilightPoints ),\n        FT_FRAME_USHORT( maxStorage ),\n        FT_FRAME_USHORT( maxFunctionDefs ),\n        FT_FRAME_USHORT( maxInstructionDefs ),\n        FT_FRAME_USHORT( maxStackElements ),\n        FT_FRAME_USHORT( maxSizeOfInstructions ),\n        FT_FRAME_USHORT( maxComponentElements ),\n        FT_FRAME_USHORT( maxComponentDepth ),\n      FT_FRAME_END\n    };\n\n\n    error = face->goto_table( face, TTAG_maxp, stream, 0 );\n    if ( error )\n      goto Exit;\n\n    if ( FT_STREAM_READ_FIELDS( maxp_fields, maxProfile ) )\n      goto Exit;\n\n    maxProfile->maxPoints             = 0;\n    maxProfile->maxContours           = 0;\n    maxProfile->maxCompositePoints    = 0;\n    maxProfile->maxCompositeContours  = 0;\n    maxProfile->maxZones              = 0;\n    maxProfile->maxTwilightPoints     = 0;\n    maxProfile->maxStorage            = 0;\n    maxProfile->maxFunctionDefs       = 0;\n    maxProfile->maxInstructionDefs    = 0;\n    maxProfile->maxStackElements      = 0;\n    maxProfile->maxSizeOfInstructions = 0;\n    maxProfile->maxComponentElements  = 0;\n    maxProfile->maxComponentDepth     = 0;\n\n    if ( maxProfile->version >= 0x10000L )\n    {\n      if ( FT_STREAM_READ_FIELDS( maxp_fields_extra, maxProfile ) )\n        goto Exit;\n\n      /* XXX: an adjustment that is necessary to load certain */\n      /*      broken fonts like `Keystrokes MT' :-(           */\n      /*                                                      */\n      /*   We allocate 64 function entries by default when    */\n      /*   the maxFunctionDefs value is smaller.              */\n\n      if ( maxProfile->maxFunctionDefs < 64 )\n        maxProfile->maxFunctionDefs = 64;\n\n      /* we add 4 phantom points later */\n      if ( maxProfile->maxTwilightPoints > ( 0xFFFFU - 4 ) )\n      {\n        FT_TRACE0(( \"tt_face_load_maxp:\"\n                    \" too much twilight points in `maxp' table;\\n\"\n                    \"                  \"\n                    \" some glyphs might be rendered incorrectly\\n\" ));\n\n        maxProfile->maxTwilightPoints = 0xFFFFU - 4;\n      }\n\n      /* we arbitrarily limit recursion to avoid stack exhaustion */\n      if ( maxProfile->maxComponentDepth > 100 )\n      {\n        FT_TRACE0(( \"tt_face_load_maxp:\"\n                    \" abnormally large component depth (%d) set to 100\\n\",\n                    maxProfile->maxComponentDepth ));\n        maxProfile->maxComponentDepth = 100;\n      }\n    }\n\n    FT_TRACE3(( \"numGlyphs: %u\\n\", maxProfile->numGlyphs ));\n\n  Exit:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_load_name                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Loads the name records.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /*    stream :: The input stream.                                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_load_name( TT_Face    face,\n                     FT_Stream  stream )\n  {\n    FT_Error      error;\n    FT_Memory     memory = stream->memory;\n    FT_ULong      table_pos, table_len;\n    FT_ULong      storage_start, storage_limit;\n    FT_UInt       count;\n    TT_NameTable  table;\n\n    static const FT_Frame_Field  name_table_fields[] =\n    {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  TT_NameTableRec\n\n      FT_FRAME_START( 6 ),\n        FT_FRAME_USHORT( format ),\n        FT_FRAME_USHORT( numNameRecords ),\n        FT_FRAME_USHORT( storageOffset ),\n      FT_FRAME_END\n    };\n\n    static const FT_Frame_Field  name_record_fields[] =\n    {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  TT_NameEntryRec\n\n      /* no FT_FRAME_START */\n        FT_FRAME_USHORT( platformID ),\n        FT_FRAME_USHORT( encodingID ),\n        FT_FRAME_USHORT( languageID ),\n        FT_FRAME_USHORT( nameID ),\n        FT_FRAME_USHORT( stringLength ),\n        FT_FRAME_USHORT( stringOffset ),\n      FT_FRAME_END\n    };\n\n\n    table         = &face->name_table;\n    table->stream = stream;\n\n    error = face->goto_table( face, TTAG_name, stream, &table_len );\n    if ( error )\n      goto Exit;\n\n    table_pos = FT_STREAM_POS();\n\n\n    if ( FT_STREAM_READ_FIELDS( name_table_fields, table ) )\n      goto Exit;\n\n    /* Some popular Asian fonts have an invalid `storageOffset' value   */\n    /* (it should be at least \"6 + 12*num_names\").  However, the string */\n    /* offsets, computed as \"storageOffset + entry->stringOffset\", are  */\n    /* valid pointers within the name table...                          */\n    /*                                                                  */\n    /* We thus can't check `storageOffset' right now.                   */\n    /*                                                                  */\n    storage_start = table_pos + 6 + 12*table->numNameRecords;\n    storage_limit = table_pos + table_len;\n\n    if ( storage_start > storage_limit )\n    {\n      FT_ERROR(( \"tt_face_load_name: invalid `name' table\\n\" ));\n      error = FT_THROW( Name_Table_Missing );\n      goto Exit;\n    }\n\n    /* Allocate the array of name records. */\n    count                 = table->numNameRecords;\n    table->numNameRecords = 0;\n\n    if ( FT_NEW_ARRAY( table->names, count ) ||\n         FT_FRAME_ENTER( count * 12 )        )\n      goto Exit;\n\n    /* Load the name records and determine how much storage is needed */\n    /* to hold the strings themselves.                                */\n    {\n      TT_NameEntryRec*  entry = table->names;\n\n\n      for ( ; count > 0; count-- )\n      {\n        if ( FT_STREAM_READ_FIELDS( name_record_fields, entry ) )\n          continue;\n\n        /* check that the name is not empty */\n        if ( entry->stringLength == 0 )\n          continue;\n\n        /* check that the name string is within the table */\n        entry->stringOffset += table_pos + table->storageOffset;\n        if ( entry->stringOffset                       < storage_start ||\n             entry->stringOffset + entry->stringLength > storage_limit )\n        {\n          /* invalid entry - ignore it */\n          entry->stringOffset = 0;\n          entry->stringLength = 0;\n          continue;\n        }\n\n        entry++;\n      }\n\n      table->numNameRecords = (FT_UInt)( entry - table->names );\n    }\n\n    FT_FRAME_EXIT();\n\n    /* everything went well, update face->num_names */\n    face->num_names = (FT_UShort) table->numNameRecords;\n\n  Exit:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_free_names                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Frees the name records.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the target face object.                        */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  tt_face_free_name( TT_Face  face )\n  {\n    FT_Memory     memory = face->root.driver->root.memory;\n    TT_NameTable  table  = &face->name_table;\n    TT_NameEntry  entry  = table->names;\n    FT_UInt       count  = table->numNameRecords;\n\n\n    if ( table->names )\n    {\n      for ( ; count > 0; count--, entry++ )\n      {\n        FT_FREE( entry->string );\n        entry->stringLength = 0;\n      }\n\n      /* free strings table */\n      FT_FREE( table->names );\n    }\n\n    table->numNameRecords = 0;\n    table->format         = 0;\n    table->storageOffset  = 0;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_load_cmap                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Loads the cmap directory in a face object.  The cmaps themselves   */\n  /*    are loaded on demand in the `ttcmap.c' module.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /*    stream :: A handle to the input stream.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_load_cmap( TT_Face    face,\n                     FT_Stream  stream )\n  {\n    FT_Error  error;\n\n\n    error = face->goto_table( face, TTAG_cmap, stream, &face->cmap_size );\n    if ( error )\n      goto Exit;\n\n    if ( FT_FRAME_EXTRACT( face->cmap_size, face->cmap_table ) )\n      face->cmap_size = 0;\n\n  Exit:\n    return error;\n  }\n\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_load_os2                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Loads the OS2 table.                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /*    stream :: A handle to the input stream.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_load_os2( TT_Face    face,\n                    FT_Stream  stream )\n  {\n    FT_Error  error;\n    TT_OS2*   os2;\n\n    static const FT_Frame_Field  os2_fields[] =\n    {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  TT_OS2\n\n      FT_FRAME_START( 78 ),\n        FT_FRAME_USHORT( version ),\n        FT_FRAME_SHORT ( xAvgCharWidth ),\n        FT_FRAME_USHORT( usWeightClass ),\n        FT_FRAME_USHORT( usWidthClass ),\n        FT_FRAME_SHORT ( fsType ),\n        FT_FRAME_SHORT ( ySubscriptXSize ),\n        FT_FRAME_SHORT ( ySubscriptYSize ),\n        FT_FRAME_SHORT ( ySubscriptXOffset ),\n        FT_FRAME_SHORT ( ySubscriptYOffset ),\n        FT_FRAME_SHORT ( ySuperscriptXSize ),\n        FT_FRAME_SHORT ( ySuperscriptYSize ),\n        FT_FRAME_SHORT ( ySuperscriptXOffset ),\n        FT_FRAME_SHORT ( ySuperscriptYOffset ),\n        FT_FRAME_SHORT ( yStrikeoutSize ),\n        FT_FRAME_SHORT ( yStrikeoutPosition ),\n        FT_FRAME_SHORT ( sFamilyClass ),\n        FT_FRAME_BYTE  ( panose[0] ),\n        FT_FRAME_BYTE  ( panose[1] ),\n        FT_FRAME_BYTE  ( panose[2] ),\n        FT_FRAME_BYTE  ( panose[3] ),\n        FT_FRAME_BYTE  ( panose[4] ),\n        FT_FRAME_BYTE  ( panose[5] ),\n        FT_FRAME_BYTE  ( panose[6] ),\n        FT_FRAME_BYTE  ( panose[7] ),\n        FT_FRAME_BYTE  ( panose[8] ),\n        FT_FRAME_BYTE  ( panose[9] ),\n        FT_FRAME_ULONG ( ulUnicodeRange1 ),\n        FT_FRAME_ULONG ( ulUnicodeRange2 ),\n        FT_FRAME_ULONG ( ulUnicodeRange3 ),\n        FT_FRAME_ULONG ( ulUnicodeRange4 ),\n        FT_FRAME_BYTE  ( achVendID[0] ),\n        FT_FRAME_BYTE  ( achVendID[1] ),\n        FT_FRAME_BYTE  ( achVendID[2] ),\n        FT_FRAME_BYTE  ( achVendID[3] ),\n\n        FT_FRAME_USHORT( fsSelection ),\n        FT_FRAME_USHORT( usFirstCharIndex ),\n        FT_FRAME_USHORT( usLastCharIndex ),\n        FT_FRAME_SHORT ( sTypoAscender ),\n        FT_FRAME_SHORT ( sTypoDescender ),\n        FT_FRAME_SHORT ( sTypoLineGap ),\n        FT_FRAME_USHORT( usWinAscent ),\n        FT_FRAME_USHORT( usWinDescent ),\n      FT_FRAME_END\n    };\n\n    /* `OS/2' version 1 and newer */\n    static const FT_Frame_Field  os2_fields_extra1[] =\n    {\n      FT_FRAME_START( 8 ),\n        FT_FRAME_ULONG( ulCodePageRange1 ),\n        FT_FRAME_ULONG( ulCodePageRange2 ),\n      FT_FRAME_END\n    };\n\n    /* `OS/2' version 2 and newer */\n    static const FT_Frame_Field  os2_fields_extra2[] =\n    {\n      FT_FRAME_START( 10 ),\n        FT_FRAME_SHORT ( sxHeight ),\n        FT_FRAME_SHORT ( sCapHeight ),\n        FT_FRAME_USHORT( usDefaultChar ),\n        FT_FRAME_USHORT( usBreakChar ),\n        FT_FRAME_USHORT( usMaxContext ),\n      FT_FRAME_END\n    };\n\n    /* `OS/2' version 5 and newer */\n    static const FT_Frame_Field  os2_fields_extra5[] =\n    {\n      FT_FRAME_START( 4 ),\n        FT_FRAME_USHORT( usLowerOpticalPointSize ),\n        FT_FRAME_USHORT( usUpperOpticalPointSize ),\n      FT_FRAME_END\n    };\n\n\n    /* We now support old Mac fonts where the OS/2 table doesn't  */\n    /* exist.  Simply put, we set the `version' field to 0xFFFF   */\n    /* and test this value each time we need to access the table. */\n    error = face->goto_table( face, TTAG_OS2, stream, 0 );\n    if ( error )\n      goto Exit;\n\n    os2 = &face->os2;\n\n    if ( FT_STREAM_READ_FIELDS( os2_fields, os2 ) )\n      goto Exit;\n\n    os2->ulCodePageRange1        = 0;\n    os2->ulCodePageRange2        = 0;\n    os2->sxHeight                = 0;\n    os2->sCapHeight              = 0;\n    os2->usDefaultChar           = 0;\n    os2->usBreakChar             = 0;\n    os2->usMaxContext            = 0;\n    os2->usLowerOpticalPointSize = 0;\n    os2->usUpperOpticalPointSize = 0xFFFF;\n\n    if ( os2->version >= 0x0001 )\n    {\n      /* only version 1 tables */\n      if ( FT_STREAM_READ_FIELDS( os2_fields_extra1, os2 ) )\n        goto Exit;\n\n      if ( os2->version >= 0x0002 )\n      {\n        /* only version 2 tables */\n        if ( FT_STREAM_READ_FIELDS( os2_fields_extra2, os2 ) )\n          goto Exit;\n\n        if ( os2->version >= 0x0005 )\n        {\n          /* only version 5 tables */\n          if ( FT_STREAM_READ_FIELDS( os2_fields_extra5, os2 ) )\n            goto Exit;\n        }\n      }\n    }\n\n    FT_TRACE3(( \"sTypoAscender:  %4d\\n\",   os2->sTypoAscender ));\n    FT_TRACE3(( \"sTypoDescender: %4d\\n\",   os2->sTypoDescender ));\n    FT_TRACE3(( \"usWinAscent:    %4u\\n\",   os2->usWinAscent ));\n    FT_TRACE3(( \"usWinDescent:   %4u\\n\",   os2->usWinDescent ));\n    FT_TRACE3(( \"fsSelection:    0x%2x\\n\", os2->fsSelection ));\n\n  Exit:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_load_postscript                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Loads the Postscript table.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /*    stream :: A handle to the input stream.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_load_post( TT_Face    face,\n                     FT_Stream  stream )\n  {\n    FT_Error        error;\n    TT_Postscript*  post = &face->postscript;\n\n    static const FT_Frame_Field  post_fields[] =\n    {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  TT_Postscript\n\n      FT_FRAME_START( 32 ),\n        FT_FRAME_ULONG( FormatType ),\n        FT_FRAME_ULONG( italicAngle ),\n        FT_FRAME_SHORT( underlinePosition ),\n        FT_FRAME_SHORT( underlineThickness ),\n        FT_FRAME_ULONG( isFixedPitch ),\n        FT_FRAME_ULONG( minMemType42 ),\n        FT_FRAME_ULONG( maxMemType42 ),\n        FT_FRAME_ULONG( minMemType1 ),\n        FT_FRAME_ULONG( maxMemType1 ),\n      FT_FRAME_END\n    };\n\n\n    error = face->goto_table( face, TTAG_post, stream, 0 );\n    if ( error )\n      return error;\n\n    if ( FT_STREAM_READ_FIELDS( post_fields, post ) )\n      return error;\n\n    /* we don't load the glyph names, we do that in another */\n    /* module (ttpost).                                     */\n\n    FT_TRACE3(( \"FormatType:   0x%x\\n\", post->FormatType ));\n    FT_TRACE3(( \"isFixedPitch:   %s\\n\", post->isFixedPitch\n                                        ? \"  yes\" : \"   no\" ));\n\n    return FT_Err_Ok;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_load_pclt                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Loads the PCL 5 Table.                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /*    stream :: A handle to the input stream.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_load_pclt( TT_Face    face,\n                     FT_Stream  stream )\n  {\n    static const FT_Frame_Field  pclt_fields[] =\n    {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  TT_PCLT\n\n      FT_FRAME_START( 54 ),\n        FT_FRAME_ULONG ( Version ),\n        FT_FRAME_ULONG ( FontNumber ),\n        FT_FRAME_USHORT( Pitch ),\n        FT_FRAME_USHORT( xHeight ),\n        FT_FRAME_USHORT( Style ),\n        FT_FRAME_USHORT( TypeFamily ),\n        FT_FRAME_USHORT( CapHeight ),\n        FT_FRAME_USHORT( SymbolSet ),\n        FT_FRAME_BYTES ( TypeFace, 16 ),\n        FT_FRAME_BYTES ( CharacterComplement, 8 ),\n        FT_FRAME_BYTES ( FileName, 6 ),\n        FT_FRAME_CHAR  ( StrokeWeight ),\n        FT_FRAME_CHAR  ( WidthType ),\n        FT_FRAME_BYTE  ( SerifStyle ),\n        FT_FRAME_BYTE  ( Reserved ),\n      FT_FRAME_END\n    };\n\n    FT_Error  error;\n    TT_PCLT*  pclt = &face->pclt;\n\n\n    /* optional table */\n    error = face->goto_table( face, TTAG_PCLT, stream, 0 );\n    if ( error )\n      goto Exit;\n\n    if ( FT_STREAM_READ_FIELDS( pclt_fields, pclt ) )\n      goto Exit;\n\n  Exit:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_load_gasp                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Loads the `gasp' table into a face object.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /*    stream :: The input stream.                                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_load_gasp( TT_Face    face,\n                     FT_Stream  stream )\n  {\n    FT_Error   error;\n    FT_Memory  memory = stream->memory;\n\n    FT_UInt        j,num_ranges;\n    TT_GaspRange   gaspranges = NULL;\n\n\n    /* the gasp table is optional */\n    error = face->goto_table( face, TTAG_gasp, stream, 0 );\n    if ( error )\n      goto Exit;\n\n    if ( FT_FRAME_ENTER( 4L ) )\n      goto Exit;\n\n    face->gasp.version   = FT_GET_USHORT();\n    face->gasp.numRanges = FT_GET_USHORT();\n\n    FT_FRAME_EXIT();\n\n    /* only support versions 0 and 1 of the table */\n    if ( face->gasp.version >= 2 )\n    {\n      face->gasp.numRanges = 0;\n      error = FT_THROW( Invalid_Table );\n      goto Exit;\n    }\n\n    num_ranges = face->gasp.numRanges;\n    FT_TRACE3(( \"numRanges: %u\\n\", num_ranges ));\n\n    if ( FT_QNEW_ARRAY( face->gasp.gaspRanges, num_ranges ) ||\n         FT_FRAME_ENTER( num_ranges * 4L )                  )\n      goto Exit;\n\n    gaspranges = face->gasp.gaspRanges;\n\n    for ( j = 0; j < num_ranges; j++ )\n    {\n      gaspranges[j].maxPPEM  = FT_GET_USHORT();\n      gaspranges[j].gaspFlag = FT_GET_USHORT();\n\n      FT_TRACE3(( \"gaspRange %d: rangeMaxPPEM %5d, rangeGaspBehavior 0x%x\\n\",\n                  j,\n                  gaspranges[j].maxPPEM,\n                  gaspranges[j].gaspFlag ));\n    }\n\n    FT_FRAME_EXIT();\n\n  Exit:\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/ttload.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttload.h                                                               */\n/*                                                                         */\n/*    Load the basic TrueType tables, i.e., tables that can be either in   */\n/*    TTF or OTF fonts (specification).                                    */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2005, 2006 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTLOAD_H__\n#define __TTLOAD_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_TRUETYPE_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n  FT_LOCAL( TT_Table  )\n  tt_face_lookup_table( TT_Face   face,\n                        FT_ULong  tag );\n\n  FT_LOCAL( FT_Error )\n  tt_face_goto_table( TT_Face    face,\n                      FT_ULong   tag,\n                      FT_Stream  stream,\n                      FT_ULong*  length );\n\n\n  FT_LOCAL( FT_Error )\n  tt_face_load_font_dir( TT_Face    face,\n                         FT_Stream  stream );\n\n\n  FT_LOCAL( FT_Error )\n  tt_face_load_any( TT_Face    face,\n                    FT_ULong   tag,\n                    FT_Long    offset,\n                    FT_Byte*   buffer,\n                    FT_ULong*  length );\n\n\n  FT_LOCAL( FT_Error )\n  tt_face_load_head( TT_Face    face,\n                     FT_Stream  stream );\n\n\n  FT_LOCAL( FT_Error )\n  tt_face_load_cmap( TT_Face    face,\n                     FT_Stream  stream );\n\n\n  FT_LOCAL( FT_Error )\n  tt_face_load_maxp( TT_Face    face,\n                     FT_Stream  stream );\n\n\n  FT_LOCAL( FT_Error )\n  tt_face_load_name( TT_Face    face,\n                     FT_Stream  stream );\n\n\n  FT_LOCAL( FT_Error )\n  tt_face_load_os2( TT_Face    face,\n                    FT_Stream  stream );\n\n\n  FT_LOCAL( FT_Error )\n  tt_face_load_post( TT_Face    face,\n                     FT_Stream  stream );\n\n\n  FT_LOCAL( FT_Error )\n  tt_face_load_pclt( TT_Face    face,\n                     FT_Stream  stream );\n\n  FT_LOCAL( void )\n  tt_face_free_name( TT_Face  face );\n\n\n  FT_LOCAL( FT_Error )\n  tt_face_load_gasp( TT_Face    face,\n                     FT_Stream  stream );\n\n#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n\n  FT_LOCAL( FT_Error )\n  tt_face_load_bhed( TT_Face    face,\n                     FT_Stream  stream );\n\n#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */\n\n\nFT_END_HEADER\n\n#endif /* __TTLOAD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/ttmtx.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttmtx.c                                                                */\n/*                                                                         */\n/*    Load the metrics tables common to TTF and OTF fonts (body).          */\n/*                                                                         */\n/*  Copyright 2006-2009, 2011-2014 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_TRUETYPE_TAGS_H\n#include \"ttmtx.h\"\n\n#include \"sferrors.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_ttmtx\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_load_hmtx                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load the `hmtx' or `vmtx' table into a face object.                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face     :: A handle to the target face object.                    */\n  /*                                                                       */\n  /*    stream   :: The input stream.                                      */\n  /*                                                                       */\n  /*    vertical :: A boolean flag.  If set, load `vmtx'.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_load_hmtx( TT_Face    face,\n                     FT_Stream  stream,\n                     FT_Bool    vertical )\n  {\n    FT_Error   error;\n    FT_ULong   tag, table_size;\n    FT_ULong*  ptable_offset;\n    FT_ULong*  ptable_size;\n\n\n    if ( vertical )\n    {\n      tag           = TTAG_vmtx;\n      ptable_offset = &face->vert_metrics_offset;\n      ptable_size   = &face->vert_metrics_size;\n    }\n    else\n    {\n      tag           = TTAG_hmtx;\n      ptable_offset = &face->horz_metrics_offset;\n      ptable_size   = &face->horz_metrics_size;\n    }\n\n    error = face->goto_table( face, tag, stream, &table_size );\n    if ( error )\n      goto Fail;\n\n    *ptable_size   = table_size;\n    *ptable_offset = FT_STREAM_POS();\n\n  Fail:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_load_hhea                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load the `hhea' or 'vhea' table into a face object.                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face     :: A handle to the target face object.                    */\n  /*                                                                       */\n  /*    stream   :: The input stream.                                      */\n  /*                                                                       */\n  /*    vertical :: A boolean flag.  If set, load `vhea'.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_load_hhea( TT_Face    face,\n                     FT_Stream  stream,\n                     FT_Bool    vertical )\n  {\n    FT_Error        error;\n    TT_HoriHeader*  header;\n\n    static const FT_Frame_Field  metrics_header_fields[] =\n    {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  TT_HoriHeader\n\n      FT_FRAME_START( 36 ),\n        FT_FRAME_ULONG ( Version ),\n        FT_FRAME_SHORT ( Ascender ),\n        FT_FRAME_SHORT ( Descender ),\n        FT_FRAME_SHORT ( Line_Gap ),\n        FT_FRAME_USHORT( advance_Width_Max ),\n        FT_FRAME_SHORT ( min_Left_Side_Bearing ),\n        FT_FRAME_SHORT ( min_Right_Side_Bearing ),\n        FT_FRAME_SHORT ( xMax_Extent ),\n        FT_FRAME_SHORT ( caret_Slope_Rise ),\n        FT_FRAME_SHORT ( caret_Slope_Run ),\n        FT_FRAME_SHORT ( caret_Offset ),\n        FT_FRAME_SHORT ( Reserved[0] ),\n        FT_FRAME_SHORT ( Reserved[1] ),\n        FT_FRAME_SHORT ( Reserved[2] ),\n        FT_FRAME_SHORT ( Reserved[3] ),\n        FT_FRAME_SHORT ( metric_Data_Format ),\n        FT_FRAME_USHORT( number_Of_HMetrics ),\n      FT_FRAME_END\n    };\n\n\n    if ( vertical )\n    {\n      void  *v = &face->vertical;\n\n\n      error = face->goto_table( face, TTAG_vhea, stream, 0 );\n      if ( error )\n        goto Fail;\n\n      header = (TT_HoriHeader*)v;\n    }\n    else\n    {\n      error = face->goto_table( face, TTAG_hhea, stream, 0 );\n      if ( error )\n        goto Fail;\n\n      header = &face->horizontal;\n    }\n\n    if ( FT_STREAM_READ_FIELDS( metrics_header_fields, header ) )\n      goto Fail;\n\n    FT_TRACE3(( \"Ascender:          %5d\\n\", header->Ascender ));\n    FT_TRACE3(( \"Descender:         %5d\\n\", header->Descender ));\n    FT_TRACE3(( \"number_Of_Metrics: %5u\\n\", header->number_Of_HMetrics ));\n\n    header->long_metrics  = NULL;\n    header->short_metrics = NULL;\n\n  Fail:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_get_metrics                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the horizontal or vertical metrics in font units for a      */\n  /*    given glyph.  The values are the left side bearing (top side       */\n  /*    bearing for vertical metrics) and advance width (advance height    */\n  /*    for vertical metrics).                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face     :: A pointer to the TrueType face structure.              */\n  /*                                                                       */\n  /*    vertical :: If set to TRUE, get vertical metrics.                  */\n  /*                                                                       */\n  /*    gindex   :: The glyph index.                                       */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    abearing :: The bearing, either left side or top side.             */\n  /*                                                                       */\n  /*    aadvance :: The advance width or advance height, depending on      */\n  /*                the `vertical' flag.                                   */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  tt_face_get_metrics( TT_Face     face,\n                       FT_Bool     vertical,\n                       FT_UInt     gindex,\n                       FT_Short   *abearing,\n                       FT_UShort  *aadvance )\n  {\n    FT_Error        error;\n    FT_Stream       stream = face->root.stream;\n    TT_HoriHeader*  header;\n    FT_ULong        table_pos, table_size, table_end;\n    FT_UShort       k;\n\n\n    if ( vertical )\n    {\n      void*  v = &face->vertical;\n\n\n      header     = (TT_HoriHeader*)v;\n      table_pos  = face->vert_metrics_offset;\n      table_size = face->vert_metrics_size;\n    }\n    else\n    {\n      header     = &face->horizontal;\n      table_pos  = face->horz_metrics_offset;\n      table_size = face->horz_metrics_size;\n    }\n\n    table_end = table_pos + table_size;\n\n    k = header->number_Of_HMetrics;\n\n    if ( k > 0 )\n    {\n      if ( gindex < (FT_UInt)k )\n      {\n        table_pos += 4 * gindex;\n        if ( table_pos + 4 > table_end )\n          goto NoData;\n\n        if ( FT_STREAM_SEEK( table_pos ) ||\n             FT_READ_USHORT( *aadvance ) ||\n             FT_READ_SHORT( *abearing )  )\n          goto NoData;\n      }\n      else\n      {\n        table_pos += 4 * ( k - 1 );\n        if ( table_pos + 4 > table_end )\n          goto NoData;\n\n        if ( FT_STREAM_SEEK( table_pos ) ||\n             FT_READ_USHORT( *aadvance ) )\n          goto NoData;\n\n        table_pos += 4 + 2 * ( gindex - k );\n        if ( table_pos + 2 > table_end )\n          *abearing = 0;\n        else\n        {\n          if ( !FT_STREAM_SEEK( table_pos ) )\n            (void)FT_READ_SHORT( *abearing );\n        }\n      }\n    }\n    else\n    {\n    NoData:\n      *abearing = 0;\n      *aadvance = 0;\n    }\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/ttmtx.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttmtx.h                                                                */\n/*                                                                         */\n/*    Load the metrics tables common to TTF and OTF fonts (specification). */\n/*                                                                         */\n/*  Copyright 2006, 2014 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTMTX_H__\n#define __TTMTX_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_TRUETYPE_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n  FT_LOCAL( FT_Error )\n  tt_face_load_hhea( TT_Face    face,\n                     FT_Stream  stream,\n                     FT_Bool    vertical );\n\n\n  FT_LOCAL( FT_Error )\n  tt_face_load_hmtx( TT_Face    face,\n                     FT_Stream  stream,\n                     FT_Bool    vertical );\n\n\n  FT_LOCAL( void )\n  tt_face_get_metrics( TT_Face     face,\n                       FT_Bool     vertical,\n                       FT_UInt     gindex,\n                       FT_Short*   abearing,\n                       FT_UShort*  aadvance );\n\nFT_END_HEADER\n\n#endif /* __TTMTX_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/ttpost.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttpost.c                                                               */\n/*                                                                         */\n/*    Postcript name table processing for TrueType and OpenType fonts      */\n/*    (body).                                                              */\n/*                                                                         */\n/*  Copyright 1996-2003, 2006-2010, 2013, 2014 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The post table is not completely loaded by the core engine.  This     */\n  /* file loads the missing PS glyph names and implements an API to access */\n  /* them.                                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_TRUETYPE_TAGS_H\n#include \"ttpost.h\"\n\n#include \"sferrors.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_ttpost\n\n\n  /* If this configuration macro is defined, we rely on the `PSNames' */\n  /* module to grab the glyph names.                                  */\n\n#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES\n\n\n#include FT_SERVICE_POSTSCRIPT_CMAPS_H\n\n#define MAC_NAME( x )  ( (FT_String*)psnames->macintosh_name( x ) )\n\n\n#else /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */\n\n\n   /* Otherwise, we ignore the `PSNames' module, and provide our own  */\n   /* table of Mac names.  Thus, it is possible to build a version of */\n   /* FreeType without the Type 1 driver & PSNames module.            */\n\n#define MAC_NAME( x )  ( (FT_String*)tt_post_default_names[x] )\n\n  /* the 258 default Mac PS glyph names; see file `tools/glnames.py' */\n\n  static const FT_String* const  tt_post_default_names[258] =\n  {\n    /*   0 */\n    \".notdef\", \".null\", \"nonmarkingreturn\", \"space\", \"exclam\",\n    \"quotedbl\", \"numbersign\", \"dollar\", \"percent\", \"ampersand\",\n    /*  10 */\n    \"quotesingle\", \"parenleft\", \"parenright\", \"asterisk\", \"plus\",\n    \"comma\", \"hyphen\", \"period\", \"slash\", \"zero\",\n    /*  20 */\n    \"one\", \"two\", \"three\", \"four\", \"five\",\n    \"six\", \"seven\", \"eight\", \"nine\", \"colon\",\n    /*  30 */\n    \"semicolon\", \"less\", \"equal\", \"greater\", \"question\",\n    \"at\", \"A\", \"B\", \"C\", \"D\",\n    /*  40 */\n    \"E\", \"F\", \"G\", \"H\", \"I\",\n    \"J\", \"K\", \"L\", \"M\", \"N\",\n    /*  50 */\n    \"O\", \"P\", \"Q\", \"R\", \"S\",\n    \"T\", \"U\", \"V\", \"W\", \"X\",\n    /*  60 */\n    \"Y\", \"Z\", \"bracketleft\", \"backslash\", \"bracketright\",\n    \"asciicircum\", \"underscore\", \"grave\", \"a\", \"b\",\n    /*  70 */\n    \"c\", \"d\", \"e\", \"f\", \"g\",\n    \"h\", \"i\", \"j\", \"k\", \"l\",\n    /*  80 */\n    \"m\", \"n\", \"o\", \"p\", \"q\",\n    \"r\", \"s\", \"t\", \"u\", \"v\",\n    /*  90 */\n    \"w\", \"x\", \"y\", \"z\", \"braceleft\",\n    \"bar\", \"braceright\", \"asciitilde\", \"Adieresis\", \"Aring\",\n    /* 100 */\n    \"Ccedilla\", \"Eacute\", \"Ntilde\", \"Odieresis\", \"Udieresis\",\n    \"aacute\", \"agrave\", \"acircumflex\", \"adieresis\", \"atilde\",\n    /* 110 */\n    \"aring\", \"ccedilla\", \"eacute\", \"egrave\", \"ecircumflex\",\n    \"edieresis\", \"iacute\", \"igrave\", \"icircumflex\", \"idieresis\",\n    /* 120 */\n    \"ntilde\", \"oacute\", \"ograve\", \"ocircumflex\", \"odieresis\",\n    \"otilde\", \"uacute\", \"ugrave\", \"ucircumflex\", \"udieresis\",\n    /* 130 */\n    \"dagger\", \"degree\", \"cent\", \"sterling\", \"section\",\n    \"bullet\", \"paragraph\", \"germandbls\", \"registered\", \"copyright\",\n    /* 140 */\n    \"trademark\", \"acute\", \"dieresis\", \"notequal\", \"AE\",\n    \"Oslash\", \"infinity\", \"plusminus\", \"lessequal\", \"greaterequal\",\n    /* 150 */\n    \"yen\", \"mu\", \"partialdiff\", \"summation\", \"product\",\n    \"pi\", \"integral\", \"ordfeminine\", \"ordmasculine\", \"Omega\",\n    /* 160 */\n    \"ae\", \"oslash\", \"questiondown\", \"exclamdown\", \"logicalnot\",\n    \"radical\", \"florin\", \"approxequal\", \"Delta\", \"guillemotleft\",\n    /* 170 */\n    \"guillemotright\", \"ellipsis\", \"nonbreakingspace\", \"Agrave\", \"Atilde\",\n    \"Otilde\", \"OE\", \"oe\", \"endash\", \"emdash\",\n    /* 180 */\n    \"quotedblleft\", \"quotedblright\", \"quoteleft\", \"quoteright\", \"divide\",\n    \"lozenge\", \"ydieresis\", \"Ydieresis\", \"fraction\", \"currency\",\n    /* 190 */\n    \"guilsinglleft\", \"guilsinglright\", \"fi\", \"fl\", \"daggerdbl\",\n    \"periodcentered\", \"quotesinglbase\", \"quotedblbase\", \"perthousand\", \"Acircumflex\",\n    /* 200 */\n    \"Ecircumflex\", \"Aacute\", \"Edieresis\", \"Egrave\", \"Iacute\",\n    \"Icircumflex\", \"Idieresis\", \"Igrave\", \"Oacute\", \"Ocircumflex\",\n    /* 210 */\n    \"apple\", \"Ograve\", \"Uacute\", \"Ucircumflex\", \"Ugrave\",\n    \"dotlessi\", \"circumflex\", \"tilde\", \"macron\", \"breve\",\n    /* 220 */\n    \"dotaccent\", \"ring\", \"cedilla\", \"hungarumlaut\", \"ogonek\",\n    \"caron\", \"Lslash\", \"lslash\", \"Scaron\", \"scaron\",\n    /* 230 */\n    \"Zcaron\", \"zcaron\", \"brokenbar\", \"Eth\", \"eth\",\n    \"Yacute\", \"yacute\", \"Thorn\", \"thorn\", \"minus\",\n    /* 240 */\n    \"multiply\", \"onesuperior\", \"twosuperior\", \"threesuperior\", \"onehalf\",\n    \"onequarter\", \"threequarters\", \"franc\", \"Gbreve\", \"gbreve\",\n    /* 250 */\n    \"Idotaccent\", \"Scedilla\", \"scedilla\", \"Cacute\", \"cacute\",\n    \"Ccaron\", \"ccaron\", \"dcroat\",\n  };\n\n\n#endif /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */\n\n\n  static FT_Error\n  load_format_20( TT_Face    face,\n                  FT_Stream  stream,\n                  FT_Long    post_limit )\n  {\n    FT_Memory   memory = stream->memory;\n    FT_Error    error;\n\n    FT_Int      num_glyphs;\n    FT_UShort   num_names;\n\n    FT_UShort*  glyph_indices = 0;\n    FT_Char**   name_strings  = 0;\n\n\n    if ( FT_READ_USHORT( num_glyphs ) )\n      goto Exit;\n\n    /* UNDOCUMENTED!  The number of glyphs in this table can be smaller */\n    /* than the value in the maxp table (cf. cyberbit.ttf).             */\n\n    /* There already exist fonts which have more than 32768 glyph names */\n    /* in this table, so the test for this threshold has been dropped.  */\n\n    if ( num_glyphs > face->max_profile.numGlyphs )\n    {\n      error = FT_THROW( Invalid_File_Format );\n      goto Exit;\n    }\n\n    /* load the indices */\n    {\n      FT_Int  n;\n\n\n      if ( FT_NEW_ARRAY ( glyph_indices, num_glyphs ) ||\n           FT_FRAME_ENTER( num_glyphs * 2L )          )\n        goto Fail;\n\n      for ( n = 0; n < num_glyphs; n++ )\n        glyph_indices[n] = FT_GET_USHORT();\n\n      FT_FRAME_EXIT();\n    }\n\n    /* compute number of names stored in table */\n    {\n      FT_Int  n;\n\n\n      num_names = 0;\n\n      for ( n = 0; n < num_glyphs; n++ )\n      {\n        FT_Int  idx;\n\n\n        idx = glyph_indices[n];\n        if ( idx >= 258 )\n        {\n          idx -= 257;\n          if ( idx > num_names )\n            num_names = (FT_UShort)idx;\n        }\n      }\n    }\n\n    /* now load the name strings */\n    {\n      FT_UShort  n;\n\n\n      if ( FT_NEW_ARRAY( name_strings, num_names ) )\n        goto Fail;\n\n      for ( n = 0; n < num_names; n++ )\n      {\n        FT_UInt  len;\n\n\n        if ( FT_STREAM_POS() >= post_limit )\n          break;\n        else\n        {\n          FT_TRACE6(( \"load_format_20: %d byte left in post table\\n\",\n                      post_limit - FT_STREAM_POS() ));\n\n          if ( FT_READ_BYTE( len ) )\n            goto Fail1;\n        }\n\n        if ( (FT_Int)len > post_limit                   ||\n             FT_STREAM_POS() > post_limit - (FT_Int)len )\n        {\n          FT_ERROR(( \"load_format_20:\"\n                     \" exceeding string length (%d),\"\n                     \" truncating at end of post table (%d byte left)\\n\",\n                     len, post_limit - FT_STREAM_POS() ));\n          len = FT_MAX( 0, post_limit - FT_STREAM_POS() );\n        }\n\n        if ( FT_NEW_ARRAY( name_strings[n], len + 1 ) ||\n             FT_STREAM_READ( name_strings[n], len   ) )\n          goto Fail1;\n\n        name_strings[n][len] = '\\0';\n      }\n\n      if ( n < num_names )\n      {\n        FT_ERROR(( \"load_format_20:\"\n                   \" all entries in post table are already parsed,\"\n                   \" using NULL names for gid %d - %d\\n\",\n                    n, num_names - 1 ));\n        for ( ; n < num_names; n++ )\n          if ( FT_NEW_ARRAY( name_strings[n], 1 ) )\n            goto Fail1;\n          else\n            name_strings[n][0] = '\\0';\n      }\n    }\n\n    /* all right, set table fields and exit successfully */\n    {\n      TT_Post_20  table = &face->postscript_names.names.format_20;\n\n\n      table->num_glyphs    = (FT_UShort)num_glyphs;\n      table->num_names     = (FT_UShort)num_names;\n      table->glyph_indices = glyph_indices;\n      table->glyph_names   = name_strings;\n    }\n    return FT_Err_Ok;\n\n  Fail1:\n    {\n      FT_UShort  n;\n\n\n      for ( n = 0; n < num_names; n++ )\n        FT_FREE( name_strings[n] );\n    }\n\n  Fail:\n    FT_FREE( name_strings );\n    FT_FREE( glyph_indices );\n\n  Exit:\n    return error;\n  }\n\n\n  static FT_Error\n  load_format_25( TT_Face    face,\n                  FT_Stream  stream,\n                  FT_Long    post_limit )\n  {\n    FT_Memory  memory = stream->memory;\n    FT_Error   error;\n\n    FT_Int     num_glyphs;\n    FT_Char*   offset_table = 0;\n\n    FT_UNUSED( post_limit );\n\n\n    /* UNDOCUMENTED!  This value appears only in the Apple TT specs. */\n    if ( FT_READ_USHORT( num_glyphs ) )\n      goto Exit;\n\n    /* check the number of glyphs */\n    if ( num_glyphs > face->max_profile.numGlyphs || num_glyphs > 258 )\n    {\n      error = FT_THROW( Invalid_File_Format );\n      goto Exit;\n    }\n\n    if ( FT_NEW_ARRAY( offset_table, num_glyphs )   ||\n         FT_STREAM_READ( offset_table, num_glyphs ) )\n      goto Fail;\n\n    /* now check the offset table */\n    {\n      FT_Int  n;\n\n\n      for ( n = 0; n < num_glyphs; n++ )\n      {\n        FT_Long  idx = (FT_Long)n + offset_table[n];\n\n\n        if ( idx < 0 || idx > num_glyphs )\n        {\n          error = FT_THROW( Invalid_File_Format );\n          goto Fail;\n        }\n      }\n    }\n\n    /* OK, set table fields and exit successfully */\n    {\n      TT_Post_25  table = &face->postscript_names.names.format_25;\n\n\n      table->num_glyphs = (FT_UShort)num_glyphs;\n      table->offsets    = offset_table;\n    }\n\n    return FT_Err_Ok;\n\n  Fail:\n    FT_FREE( offset_table );\n\n  Exit:\n    return error;\n  }\n\n\n  static FT_Error\n  load_post_names( TT_Face  face )\n  {\n    FT_Stream  stream;\n    FT_Error   error;\n    FT_Fixed   format;\n    FT_ULong   post_len;\n    FT_Long    post_limit;\n\n\n    /* get a stream for the face's resource */\n    stream = face->root.stream;\n\n    /* seek to the beginning of the PS names table */\n    error = face->goto_table( face, TTAG_post, stream, &post_len );\n    if ( error )\n      goto Exit;\n\n    post_limit = FT_STREAM_POS() + post_len;\n\n    format = face->postscript.FormatType;\n\n    /* go to beginning of subtable */\n    if ( FT_STREAM_SKIP( 32 ) )\n      goto Exit;\n\n    /* now read postscript table */\n    if ( format == 0x00020000L )\n      error = load_format_20( face, stream, post_limit );\n    else if ( format == 0x00028000L )\n      error = load_format_25( face, stream, post_limit );\n    else\n      error = FT_THROW( Invalid_File_Format );\n\n    face->postscript_names.loaded = 1;\n\n  Exit:\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  tt_face_free_ps_names( TT_Face  face )\n  {\n    FT_Memory      memory = face->root.memory;\n    TT_Post_Names  names  = &face->postscript_names;\n    FT_Fixed       format;\n\n\n    if ( names->loaded )\n    {\n      format = face->postscript.FormatType;\n\n      if ( format == 0x00020000L )\n      {\n        TT_Post_20  table = &names->names.format_20;\n        FT_UShort   n;\n\n\n        FT_FREE( table->glyph_indices );\n        table->num_glyphs = 0;\n\n        for ( n = 0; n < table->num_names; n++ )\n          FT_FREE( table->glyph_names[n] );\n\n        FT_FREE( table->glyph_names );\n        table->num_names = 0;\n      }\n      else if ( format == 0x00028000L )\n      {\n        TT_Post_25  table = &names->names.format_25;\n\n\n        FT_FREE( table->offsets );\n        table->num_glyphs = 0;\n      }\n    }\n    names->loaded = 0;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_get_ps_name                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Get the PostScript glyph name of a glyph.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the parent face.                             */\n  /*                                                                       */\n  /*    idx    :: The glyph index.                                         */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    PSname :: The address of a string pointer.  Will be NULL in case   */\n  /*              of error, otherwise it is a pointer to the glyph name.   */\n  /*                                                                       */\n  /*              You must not modify the returned string!                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_get_ps_name( TT_Face      face,\n                       FT_UInt      idx,\n                       FT_String**  PSname )\n  {\n    FT_Error       error;\n    TT_Post_Names  names;\n    FT_Fixed       format;\n\n#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES\n    FT_Service_PsCMaps  psnames;\n#endif\n\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n    if ( idx >= (FT_UInt)face->max_profile.numGlyphs )\n      return FT_THROW( Invalid_Glyph_Index );\n\n#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES\n    psnames = (FT_Service_PsCMaps)face->psnames;\n    if ( !psnames )\n      return FT_THROW( Unimplemented_Feature );\n#endif\n\n    names = &face->postscript_names;\n\n    /* `.notdef' by default */\n    *PSname = MAC_NAME( 0 );\n\n    format = face->postscript.FormatType;\n\n    if ( format == 0x00010000L )\n    {\n      if ( idx < 258 )                    /* paranoid checking */\n        *PSname = MAC_NAME( idx );\n    }\n    else if ( format == 0x00020000L )\n    {\n      TT_Post_20  table = &names->names.format_20;\n\n\n      if ( !names->loaded )\n      {\n        error = load_post_names( face );\n        if ( error )\n          goto End;\n      }\n\n      if ( idx < (FT_UInt)table->num_glyphs )\n      {\n        FT_UShort  name_index = table->glyph_indices[idx];\n\n\n        if ( name_index < 258 )\n          *PSname = MAC_NAME( name_index );\n        else\n          *PSname = (FT_String*)table->glyph_names[name_index - 258];\n      }\n    }\n    else if ( format == 0x00028000L )\n    {\n      TT_Post_25  table = &names->names.format_25;\n\n\n      if ( !names->loaded )\n      {\n        error = load_post_names( face );\n        if ( error )\n          goto End;\n      }\n\n      if ( idx < (FT_UInt)table->num_glyphs )    /* paranoid checking */\n      {\n        idx    += table->offsets[idx];\n        *PSname = MAC_NAME( idx );\n      }\n    }\n\n    /* nothing to do for format == 0x00030000L */\n\n  End:\n    return FT_Err_Ok;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/ttpost.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttpost.h                                                               */\n/*                                                                         */\n/*    Postcript name table processing for TrueType and OpenType fonts      */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTPOST_H__\n#define __TTPOST_H__\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_INTERNAL_TRUETYPE_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n  FT_LOCAL( FT_Error )\n  tt_face_get_ps_name( TT_Face      face,\n                       FT_UInt      idx,\n                       FT_String**  PSname );\n\n  FT_LOCAL( void )\n  tt_face_free_ps_names( TT_Face  face );\n\n\nFT_END_HEADER\n\n#endif /* __TTPOST_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/ttsbit.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttsbit.c                                                               */\n/*                                                                         */\n/*    TrueType and OpenType embedded bitmap support (body).                */\n/*                                                                         */\n/*  Copyright 2005-2009, 2013, 2014 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  Copyright 2013 by Google, Inc.                                         */\n/*  Google Author(s): Behdad Esfahbod.                                     */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_TRUETYPE_TAGS_H\n#include FT_BITMAP_H\n#include \"ttsbit.h\"\n\n#include \"sferrors.h\"\n\n#include \"ttmtx.h\"\n#include \"pngshim.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_ttsbit\n\n\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_load_sbit( TT_Face    face,\n                     FT_Stream  stream )\n  {\n    FT_Error  error;\n    FT_ULong  table_size;\n\n\n    face->sbit_table       = NULL;\n    face->sbit_table_size  = 0;\n    face->sbit_table_type  = TT_SBIT_TABLE_TYPE_NONE;\n    face->sbit_num_strikes = 0;\n\n    error = face->goto_table( face, TTAG_CBLC, stream, &table_size );\n    if ( !error )\n      face->sbit_table_type = TT_SBIT_TABLE_TYPE_CBLC;\n    else\n    {\n      error = face->goto_table( face, TTAG_EBLC, stream, &table_size );\n      if ( error )\n        error = face->goto_table( face, TTAG_bloc, stream, &table_size );\n      if ( !error )\n        face->sbit_table_type = TT_SBIT_TABLE_TYPE_EBLC;\n    }\n\n    if ( error )\n    {\n      error = face->goto_table( face, TTAG_sbix, stream, &table_size );\n      if ( !error )\n        face->sbit_table_type = TT_SBIT_TABLE_TYPE_SBIX;\n    }\n    if ( error )\n      goto Exit;\n\n    if ( table_size < 8 )\n    {\n      FT_ERROR(( \"tt_face_load_sbit_strikes: table too short\\n\" ));\n      error = FT_THROW( Invalid_File_Format );\n      goto Exit;\n    }\n\n    switch ( (FT_UInt)face->sbit_table_type )\n    {\n    case TT_SBIT_TABLE_TYPE_EBLC:\n    case TT_SBIT_TABLE_TYPE_CBLC:\n      {\n        FT_Byte*  p;\n        FT_Fixed  version;\n        FT_ULong  num_strikes;\n        FT_UInt   count;\n\n\n        if ( FT_FRAME_EXTRACT( table_size, face->sbit_table ) )\n          goto Exit;\n\n        face->sbit_table_size = table_size;\n\n        p = face->sbit_table;\n\n        version     = FT_NEXT_ULONG( p );\n        num_strikes = FT_NEXT_ULONG( p );\n\n        if ( ( version & 0xFFFF0000UL ) != 0x00020000UL )\n        {\n          error = FT_THROW( Unknown_File_Format );\n          goto Exit;\n        }\n\n        if ( num_strikes >= 0x10000UL )\n        {\n          error = FT_THROW( Invalid_File_Format );\n          goto Exit;\n        }\n\n        /*\n         *  Count the number of strikes available in the table.  We are a bit\n         *  paranoid there and don't trust the data.\n         */\n        count = (FT_UInt)num_strikes;\n        if ( 8 + 48UL * count > table_size )\n          count = (FT_UInt)( ( table_size - 8 ) / 48 );\n\n        face->sbit_num_strikes = count;\n      }\n      break;\n\n    case TT_SBIT_TABLE_TYPE_SBIX:\n      {\n        FT_UShort  version;\n        FT_UShort  flags;\n        FT_ULong   num_strikes;\n        FT_UInt    count;\n\n\n        if ( FT_FRAME_ENTER( 8 ) )\n          goto Exit;\n\n        version     = FT_GET_USHORT();\n        flags       = FT_GET_USHORT();\n        num_strikes = FT_GET_ULONG();\n\n        FT_FRAME_EXIT();\n\n        if ( version < 1 )\n        {\n          error = FT_THROW( Unknown_File_Format );\n          goto Exit;\n        }\n\n        /* Bit 0 must always be `1'.                            */\n        /* Bit 1 controls the overlay of bitmaps with outlines. */\n        /* All other bits should be zero.                       */\n        if ( !( flags == 1 || flags == 3 ) ||\n             num_strikes >= 0x10000UL      )\n        {\n          error = FT_THROW( Invalid_File_Format );\n          goto Exit;\n        }\n\n        /* we currently don't support bit 1; however, it is better to */\n        /* draw at least something...                                 */\n        if ( flags == 3 )\n          FT_TRACE1(( \"tt_face_load_sbit_strikes:\"\n                      \" sbix overlay not supported yet\\n\"\n                      \"                          \"\n                      \" expect bad rendering results\\n\" ));\n\n        /*\n         *  Count the number of strikes available in the table.  We are a bit\n         *  paranoid there and don't trust the data.\n         */\n        count = (FT_UInt)num_strikes;\n        if ( 8 + 4UL * count > table_size )\n          count = (FT_UInt)( ( table_size - 8 ) / 4 );\n\n        if ( FT_STREAM_SEEK( FT_STREAM_POS() - 8 ) )\n          goto Exit;\n\n        face->sbit_table_size = 8 + count * 4;\n        if ( FT_FRAME_EXTRACT( face->sbit_table_size, face->sbit_table ) )\n          goto Exit;\n\n        face->sbit_num_strikes = count;\n      }\n      break;\n\n    default:\n      error = FT_THROW( Unknown_File_Format );\n      break;\n    }\n\n    if ( !error )\n      FT_TRACE3(( \"sbit_num_strikes: %u\\n\", face->sbit_num_strikes ));\n\n    return FT_Err_Ok;\n\n  Exit:\n    if ( error )\n    {\n      if ( face->sbit_table )\n        FT_FRAME_RELEASE( face->sbit_table );\n      face->sbit_table_size = 0;\n      face->sbit_table_type = TT_SBIT_TABLE_TYPE_NONE;\n    }\n\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  tt_face_free_sbit( TT_Face  face )\n  {\n    FT_Stream  stream = face->root.stream;\n\n\n    FT_FRAME_RELEASE( face->sbit_table );\n    face->sbit_table_size  = 0;\n    face->sbit_table_type  = TT_SBIT_TABLE_TYPE_NONE;\n    face->sbit_num_strikes = 0;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_set_sbit_strike( TT_Face          face,\n                           FT_Size_Request  req,\n                           FT_ULong*        astrike_index )\n  {\n    return FT_Match_Size( (FT_Face)face, req, 0, astrike_index );\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_load_strike_metrics( TT_Face           face,\n                               FT_ULong          strike_index,\n                               FT_Size_Metrics*  metrics )\n  {\n    if ( strike_index >= (FT_ULong)face->sbit_num_strikes )\n      return FT_THROW( Invalid_Argument );\n\n    switch ( (FT_UInt)face->sbit_table_type )\n    {\n    case TT_SBIT_TABLE_TYPE_EBLC:\n    case TT_SBIT_TABLE_TYPE_CBLC:\n      {\n        FT_Byte*  strike;\n\n\n        strike = face->sbit_table + 8 + strike_index * 48;\n\n        metrics->x_ppem = (FT_UShort)strike[44];\n        metrics->y_ppem = (FT_UShort)strike[45];\n\n        metrics->ascender  = (FT_Char)strike[16] << 6;  /* hori.ascender  */\n        metrics->descender = (FT_Char)strike[17] << 6;  /* hori.descender */\n        metrics->height    = metrics->ascender - metrics->descender;\n\n        /* Is this correct? */\n        metrics->max_advance = ( (FT_Char)strike[22] + /* min_origin_SB  */\n                                          strike[18] + /* max_width      */\n                                 (FT_Char)strike[23]   /* min_advance_SB */\n                                                     ) << 6;\n        return FT_Err_Ok;\n      }\n\n    case TT_SBIT_TABLE_TYPE_SBIX:\n      {\n        FT_Stream       stream = face->root.stream;\n        FT_UInt         offset, upem;\n        FT_UShort       ppem, resolution;\n        TT_HoriHeader  *hori;\n        FT_ULong        table_size;\n\n        FT_Error  error;\n        FT_Byte*  p;\n\n\n        p      = face->sbit_table + 8 + 4 * strike_index;\n        offset = FT_NEXT_ULONG( p );\n\n        error = face->goto_table( face, TTAG_sbix, stream, &table_size );\n        if ( error )\n          return error;\n\n        if ( offset + 4  > table_size )\n          return FT_THROW( Invalid_File_Format );\n\n        if ( FT_STREAM_SEEK( FT_STREAM_POS() + offset ) ||\n             FT_FRAME_ENTER( 4 )                        )\n          return error;\n\n        ppem       = FT_GET_USHORT();\n        resolution = FT_GET_USHORT();\n\n        FT_UNUSED( resolution ); /* What to do with this? */\n\n        FT_FRAME_EXIT();\n\n        upem = face->header.Units_Per_EM;\n        hori = &face->horizontal;\n\n        metrics->x_ppem = ppem;\n        metrics->y_ppem = ppem;\n\n        metrics->ascender    = ppem * hori->Ascender * 64 / upem;\n        metrics->descender   = ppem * hori->Descender * 64 / upem;\n        metrics->height      = ppem * ( hori->Ascender -\n                                        hori->Descender +\n                                        hori->Line_Gap ) * 64 / upem;\n        metrics->max_advance = ppem * hori->advance_Width_Max * 64 / upem;\n\n        return error;\n      }\n\n    default:\n      return FT_THROW( Unknown_File_Format );\n    }\n  }\n\n\n  typedef struct  TT_SBitDecoderRec_\n  {\n    TT_Face          face;\n    FT_Stream        stream;\n    FT_Bitmap*       bitmap;\n    TT_SBit_Metrics  metrics;\n    FT_Bool          metrics_loaded;\n    FT_Bool          bitmap_allocated;\n    FT_Byte          bit_depth;\n\n    FT_ULong         ebdt_start;\n    FT_ULong         ebdt_size;\n\n    FT_ULong         strike_index_array;\n    FT_ULong         strike_index_count;\n    FT_Byte*         eblc_base;\n    FT_Byte*         eblc_limit;\n\n  } TT_SBitDecoderRec, *TT_SBitDecoder;\n\n\n  static FT_Error\n  tt_sbit_decoder_init( TT_SBitDecoder       decoder,\n                        TT_Face              face,\n                        FT_ULong             strike_index,\n                        TT_SBit_MetricsRec*  metrics )\n  {\n    FT_Error   error;\n    FT_Stream  stream = face->root.stream;\n    FT_ULong   ebdt_size;\n\n\n    error = face->goto_table( face, TTAG_CBDT, stream, &ebdt_size );\n    if ( error )\n      error = face->goto_table( face, TTAG_EBDT, stream, &ebdt_size );\n    if ( error )\n      error = face->goto_table( face, TTAG_bdat, stream, &ebdt_size );\n    if ( error )\n      goto Exit;\n\n    decoder->face    = face;\n    decoder->stream  = stream;\n    decoder->bitmap  = &face->root.glyph->bitmap;\n    decoder->metrics = metrics;\n\n    decoder->metrics_loaded   = 0;\n    decoder->bitmap_allocated = 0;\n\n    decoder->ebdt_start = FT_STREAM_POS();\n    decoder->ebdt_size  = ebdt_size;\n\n    decoder->eblc_base  = face->sbit_table;\n    decoder->eblc_limit = face->sbit_table + face->sbit_table_size;\n\n    /* now find the strike corresponding to the index */\n    {\n      FT_Byte*  p;\n\n\n      if ( 8 + 48 * strike_index + 3 * 4 + 34 + 1 > face->sbit_table_size )\n      {\n        error = FT_THROW( Invalid_File_Format );\n        goto Exit;\n      }\n\n      p = decoder->eblc_base + 8 + 48 * strike_index;\n\n      decoder->strike_index_array = FT_NEXT_ULONG( p );\n      p                          += 4;\n      decoder->strike_index_count = FT_NEXT_ULONG( p );\n      p                          += 34;\n      decoder->bit_depth          = *p;\n\n      /* decoder->strike_index_array +                               */\n      /*   8 * decoder->strike_index_count > face->sbit_table_size ? */\n      if ( decoder->strike_index_array > face->sbit_table_size           ||\n           decoder->strike_index_count >\n             ( face->sbit_table_size - decoder->strike_index_array ) / 8 )\n        error = FT_THROW( Invalid_File_Format );\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  static void\n  tt_sbit_decoder_done( TT_SBitDecoder  decoder )\n  {\n    FT_UNUSED( decoder );\n  }\n\n\n  static FT_Error\n  tt_sbit_decoder_alloc_bitmap( TT_SBitDecoder  decoder )\n  {\n    FT_Error    error = FT_Err_Ok;\n    FT_UInt     width, height;\n    FT_Bitmap*  map = decoder->bitmap;\n    FT_Long     size;\n\n\n    if ( !decoder->metrics_loaded )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    width  = decoder->metrics->width;\n    height = decoder->metrics->height;\n\n    map->width = (int)width;\n    map->rows  = (int)height;\n\n    switch ( decoder->bit_depth )\n    {\n    case 1:\n      map->pixel_mode = FT_PIXEL_MODE_MONO;\n      map->pitch      = ( map->width + 7 ) >> 3;\n      map->num_grays  = 2;\n      break;\n\n    case 2:\n      map->pixel_mode = FT_PIXEL_MODE_GRAY2;\n      map->pitch      = ( map->width + 3 ) >> 2;\n      map->num_grays  = 4;\n      break;\n\n    case 4:\n      map->pixel_mode = FT_PIXEL_MODE_GRAY4;\n      map->pitch      = ( map->width + 1 ) >> 1;\n      map->num_grays  = 16;\n      break;\n\n    case 8:\n      map->pixel_mode = FT_PIXEL_MODE_GRAY;\n      map->pitch      = map->width;\n      map->num_grays  = 256;\n      break;\n\n    case 32:\n      map->pixel_mode = FT_PIXEL_MODE_BGRA;\n      map->pitch      = map->width * 4;\n      map->num_grays  = 256;\n      break;\n\n    default:\n      error = FT_THROW( Invalid_File_Format );\n      goto Exit;\n    }\n\n    size = map->rows * map->pitch;\n\n    /* check that there is no empty image */\n    if ( size == 0 )\n      goto Exit;     /* exit successfully! */\n\n    error = ft_glyphslot_alloc_bitmap( decoder->face->root.glyph, size );\n    if ( error )\n      goto Exit;\n\n    decoder->bitmap_allocated = 1;\n\n  Exit:\n    return error;\n  }\n\n\n  static FT_Error\n  tt_sbit_decoder_load_metrics( TT_SBitDecoder  decoder,\n                                FT_Byte*       *pp,\n                                FT_Byte*        limit,\n                                FT_Bool         big )\n  {\n    FT_Byte*         p       = *pp;\n    TT_SBit_Metrics  metrics = decoder->metrics;\n\n\n    if ( p + 5 > limit )\n      goto Fail;\n\n    metrics->height       = p[0];\n    metrics->width        = p[1];\n    metrics->horiBearingX = (FT_Char)p[2];\n    metrics->horiBearingY = (FT_Char)p[3];\n    metrics->horiAdvance  = p[4];\n\n    p += 5;\n    if ( big )\n    {\n      if ( p + 3 > limit )\n        goto Fail;\n\n      metrics->vertBearingX = (FT_Char)p[0];\n      metrics->vertBearingY = (FT_Char)p[1];\n      metrics->vertAdvance  = p[2];\n\n      p += 3;\n    }\n    else\n    {\n      /* avoid uninitialized data in case there is no vertical info -- */\n      metrics->vertBearingX = 0;\n      metrics->vertBearingY = 0;\n      metrics->vertAdvance  = 0;\n    }\n\n    decoder->metrics_loaded = 1;\n    *pp = p;\n    return FT_Err_Ok;\n\n  Fail:\n    FT_TRACE1(( \"tt_sbit_decoder_load_metrics: broken table\\n\" ));\n    return FT_THROW( Invalid_Argument );\n  }\n\n\n  /* forward declaration */\n  static FT_Error\n  tt_sbit_decoder_load_image( TT_SBitDecoder  decoder,\n                              FT_UInt         glyph_index,\n                              FT_Int          x_pos,\n                              FT_Int          y_pos );\n\n  typedef FT_Error  (*TT_SBitDecoder_LoadFunc)( TT_SBitDecoder  decoder,\n                                                FT_Byte*        p,\n                                                FT_Byte*        plimit,\n                                                FT_Int          x_pos,\n                                                FT_Int          y_pos );\n\n\n  static FT_Error\n  tt_sbit_decoder_load_byte_aligned( TT_SBitDecoder  decoder,\n                                     FT_Byte*        p,\n                                     FT_Byte*        limit,\n                                     FT_Int          x_pos,\n                                     FT_Int          y_pos )\n  {\n    FT_Error    error = FT_Err_Ok;\n    FT_Byte*    line;\n    FT_Int      bit_height, bit_width, pitch, width, height, line_bits, h;\n    FT_Bitmap*  bitmap;\n\n\n    /* check that we can write the glyph into the bitmap */\n    bitmap     = decoder->bitmap;\n    bit_width  = bitmap->width;\n    bit_height = bitmap->rows;\n    pitch      = bitmap->pitch;\n    line       = bitmap->buffer;\n\n    width  = decoder->metrics->width;\n    height = decoder->metrics->height;\n\n    line_bits = width * decoder->bit_depth;\n\n    if ( x_pos < 0 || x_pos + width > bit_width   ||\n         y_pos < 0 || y_pos + height > bit_height )\n    {\n      FT_TRACE1(( \"tt_sbit_decoder_load_byte_aligned:\"\n                  \" invalid bitmap dimensions\\n\" ));\n      error = FT_THROW( Invalid_File_Format );\n      goto Exit;\n    }\n\n    if ( p + ( ( line_bits + 7 ) >> 3 ) * height > limit )\n    {\n      FT_TRACE1(( \"tt_sbit_decoder_load_byte_aligned: broken bitmap\\n\" ));\n      error = FT_THROW( Invalid_File_Format );\n      goto Exit;\n    }\n\n    /* now do the blit */\n    line  += y_pos * pitch + ( x_pos >> 3 );\n    x_pos &= 7;\n\n    if ( x_pos == 0 )  /* the easy one */\n    {\n      for ( h = height; h > 0; h--, line += pitch )\n      {\n        FT_Byte*  pwrite = line;\n        FT_Int    w;\n\n\n        for ( w = line_bits; w >= 8; w -= 8 )\n        {\n          pwrite[0] = (FT_Byte)( pwrite[0] | *p++ );\n          pwrite   += 1;\n        }\n\n        if ( w > 0 )\n          pwrite[0] = (FT_Byte)( pwrite[0] | ( *p++ & ( 0xFF00U >> w ) ) );\n      }\n    }\n    else  /* x_pos > 0 */\n    {\n      for ( h = height; h > 0; h--, line += pitch )\n      {\n        FT_Byte*  pwrite = line;\n        FT_Int    w;\n        FT_UInt   wval = 0;\n\n\n        for ( w = line_bits; w >= 8; w -= 8 )\n        {\n          wval       = (FT_UInt)( wval | *p++ );\n          pwrite[0]  = (FT_Byte)( pwrite[0] | ( wval >> x_pos ) );\n          pwrite    += 1;\n          wval     <<= 8;\n        }\n\n        if ( w > 0 )\n          wval = (FT_UInt)( wval | ( *p++ & ( 0xFF00U >> w ) ) );\n\n        /* all bits read and there are `x_pos + w' bits to be written */\n\n        pwrite[0] = (FT_Byte)( pwrite[0] | ( wval >> x_pos ) );\n\n        if ( x_pos + w > 8 )\n        {\n          pwrite++;\n          wval     <<= 8;\n          pwrite[0]  = (FT_Byte)( pwrite[0] | ( wval >> x_pos ) );\n        }\n      }\n    }\n\n  Exit:\n    if ( !error )\n      FT_TRACE3(( \"tt_sbit_decoder_load_byte_aligned: loaded\\n\" ));\n    return error;\n  }\n\n\n  /*\n   * Load a bit-aligned bitmap (with pointer `p') into a line-aligned bitmap\n   * (with pointer `pwrite').  In the example below, the width is 3 pixel,\n   * and `x_pos' is 1 pixel.\n   *\n   *       p                               p+1\n   *     |                               |                               |\n   *     | 7   6   5   4   3   2   1   0 | 7   6   5   4   3   2   1   0 |...\n   *     |                               |                               |\n   *       +-------+   +-------+   +-------+ ...\n   *           .           .           .\n   *           .           .           .\n   *           v           .           .\n   *       +-------+       .           .\n   * |                               | .\n   * | 7   6   5   4   3   2   1   0 | .\n   * |                               | .\n   *   pwrite              .           .\n   *                       .           .\n   *                       v           .\n   *                   +-------+       .\n   *             |                               |\n   *             | 7   6   5   4   3   2   1   0 |\n   *             |                               |\n   *               pwrite+1            .\n   *                                   .\n   *                                   v\n   *                               +-------+\n   *                         |                               |\n   *                         | 7   6   5   4   3   2   1   0 |\n   *                         |                               |\n   *                           pwrite+2\n   *\n   */\n\n  static FT_Error\n  tt_sbit_decoder_load_bit_aligned( TT_SBitDecoder  decoder,\n                                    FT_Byte*        p,\n                                    FT_Byte*        limit,\n                                    FT_Int          x_pos,\n                                    FT_Int          y_pos )\n  {\n    FT_Error    error = FT_Err_Ok;\n    FT_Byte*    line;\n    FT_Int      bit_height, bit_width, pitch, width, height, line_bits, h, nbits;\n    FT_Bitmap*  bitmap;\n    FT_UShort   rval;\n\n\n    /* check that we can write the glyph into the bitmap */\n    bitmap     = decoder->bitmap;\n    bit_width  = bitmap->width;\n    bit_height = bitmap->rows;\n    pitch      = bitmap->pitch;\n    line       = bitmap->buffer;\n\n    width  = decoder->metrics->width;\n    height = decoder->metrics->height;\n\n    line_bits = width * decoder->bit_depth;\n\n    if ( x_pos < 0 || x_pos + width  > bit_width  ||\n         y_pos < 0 || y_pos + height > bit_height )\n    {\n      FT_TRACE1(( \"tt_sbit_decoder_load_bit_aligned:\"\n                  \" invalid bitmap dimensions\\n\" ));\n      error = FT_THROW( Invalid_File_Format );\n      goto Exit;\n    }\n\n    if ( p + ( ( line_bits * height + 7 ) >> 3 ) > limit )\n    {\n      FT_TRACE1(( \"tt_sbit_decoder_load_bit_aligned: broken bitmap\\n\" ));\n      error = FT_THROW( Invalid_File_Format );\n      goto Exit;\n    }\n\n    /* now do the blit */\n\n    /* adjust `line' to point to the first byte of the bitmap */\n    line  += y_pos * pitch + ( x_pos >> 3 );\n    x_pos &= 7;\n\n    /* the higher byte of `rval' is used as a buffer */\n    rval  = 0;\n    nbits = 0;\n\n    for ( h = height; h > 0; h--, line += pitch )\n    {\n      FT_Byte*  pwrite = line;\n      FT_Int    w      = line_bits;\n\n\n      /* handle initial byte (in target bitmap) specially if necessary */\n      if ( x_pos )\n      {\n        w = ( line_bits < 8 - x_pos ) ? line_bits : 8 - x_pos;\n\n        if ( h == height )\n        {\n          rval  = *p++;\n          nbits = x_pos;\n        }\n        else if ( nbits < w )\n        {\n          if ( p < limit )\n            rval |= *p++;\n          nbits += 8 - w;\n        }\n        else\n        {\n          rval  >>= 8;\n          nbits  -= w;\n        }\n\n        *pwrite++ |= ( ( rval >> nbits ) & 0xFF ) &\n                     ( ~( 0xFF << w ) << ( 8 - w - x_pos ) );\n        rval     <<= 8;\n\n        w = line_bits - w;\n      }\n\n      /* handle medial bytes */\n      for ( ; w >= 8; w -= 8 )\n      {\n        rval      |= *p++;\n        *pwrite++ |= ( rval >> nbits ) & 0xFF;\n\n        rval <<= 8;\n      }\n\n      /* handle final byte if necessary */\n      if ( w > 0 )\n      {\n        if ( nbits < w )\n        {\n          if ( p < limit )\n            rval |= *p++;\n          *pwrite |= ( ( rval >> nbits ) & 0xFF ) & ( 0xFF00U >> w );\n          nbits   += 8 - w;\n\n          rval <<= 8;\n        }\n        else\n        {\n          *pwrite |= ( ( rval >> nbits ) & 0xFF ) & ( 0xFF00U >> w );\n          nbits   -= w;\n        }\n      }\n    }\n\n  Exit:\n    if ( !error )\n      FT_TRACE3(( \"tt_sbit_decoder_load_bit_aligned: loaded\\n\" ));\n    return error;\n  }\n\n\n  static FT_Error\n  tt_sbit_decoder_load_compound( TT_SBitDecoder  decoder,\n                                 FT_Byte*        p,\n                                 FT_Byte*        limit,\n                                 FT_Int          x_pos,\n                                 FT_Int          y_pos )\n  {\n    FT_Error  error = FT_Err_Ok;\n    FT_UInt   num_components, nn;\n\n    FT_Char  horiBearingX = (FT_Char)decoder->metrics->horiBearingX;\n    FT_Char  horiBearingY = (FT_Char)decoder->metrics->horiBearingY;\n    FT_Byte  horiAdvance  = (FT_Byte)decoder->metrics->horiAdvance;\n    FT_Char  vertBearingX = (FT_Char)decoder->metrics->vertBearingX;\n    FT_Char  vertBearingY = (FT_Char)decoder->metrics->vertBearingY;\n    FT_Byte  vertAdvance  = (FT_Byte)decoder->metrics->vertAdvance;\n\n\n    if ( p + 2 > limit )\n      goto Fail;\n\n    num_components = FT_NEXT_USHORT( p );\n    if ( p + 4 * num_components > limit )\n    {\n      FT_TRACE1(( \"tt_sbit_decoder_load_compound: broken table\\n\" ));\n      goto Fail;\n    }\n\n    FT_TRACE3(( \"tt_sbit_decoder_load_compound: loading %d components\\n\",\n                num_components ));\n\n    for ( nn = 0; nn < num_components; nn++ )\n    {\n      FT_UInt  gindex = FT_NEXT_USHORT( p );\n      FT_Byte  dx     = FT_NEXT_BYTE( p );\n      FT_Byte  dy     = FT_NEXT_BYTE( p );\n\n\n      /* NB: a recursive call */\n      error = tt_sbit_decoder_load_image( decoder, gindex,\n                                          x_pos + dx, y_pos + dy );\n      if ( error )\n        break;\n    }\n\n    FT_TRACE3(( \"tt_sbit_decoder_load_compound: done\\n\" ));\n\n    decoder->metrics->horiBearingX = horiBearingX;\n    decoder->metrics->horiBearingY = horiBearingY;\n    decoder->metrics->horiAdvance  = horiAdvance;\n    decoder->metrics->vertBearingX = vertBearingX;\n    decoder->metrics->vertBearingY = vertBearingY;\n    decoder->metrics->vertAdvance  = vertAdvance;\n    decoder->metrics->width        = (FT_Byte)decoder->bitmap->width;\n    decoder->metrics->height       = (FT_Byte)decoder->bitmap->rows;\n\n  Exit:\n    return error;\n\n  Fail:\n    error = FT_THROW( Invalid_File_Format );\n    goto Exit;\n  }\n\n\n#ifdef FT_CONFIG_OPTION_USE_PNG\n\n  static FT_Error\n  tt_sbit_decoder_load_png( TT_SBitDecoder  decoder,\n                            FT_Byte*        p,\n                            FT_Byte*        limit,\n                            FT_Int          x_pos,\n                            FT_Int          y_pos )\n  {\n    FT_Error  error = FT_Err_Ok;\n    FT_ULong  png_len;\n\n\n    if ( limit - p < 4 )\n    {\n      FT_TRACE1(( \"tt_sbit_decoder_load_png: broken bitmap\\n\" ));\n      error = FT_THROW( Invalid_File_Format );\n      goto Exit;\n    }\n\n    png_len = FT_NEXT_ULONG( p );\n    if ( (FT_ULong)( limit - p ) < png_len )\n    {\n      FT_TRACE1(( \"tt_sbit_decoder_load_png: broken bitmap\\n\" ));\n      error = FT_THROW( Invalid_File_Format );\n      goto Exit;\n    }\n\n    error = Load_SBit_Png( decoder->face->root.glyph,\n                           x_pos,\n                           y_pos,\n                           decoder->bit_depth,\n                           decoder->metrics,\n                           decoder->stream->memory,\n                           p,\n                           png_len,\n                           FALSE );\n\n  Exit:\n    if ( !error )\n      FT_TRACE3(( \"tt_sbit_decoder_load_png: loaded\\n\" ));\n    return error;\n  }\n\n#endif /* FT_CONFIG_OPTION_USE_PNG */\n\n\n  static FT_Error\n  tt_sbit_decoder_load_bitmap( TT_SBitDecoder  decoder,\n                               FT_UInt         glyph_format,\n                               FT_ULong        glyph_start,\n                               FT_ULong        glyph_size,\n                               FT_Int          x_pos,\n                               FT_Int          y_pos )\n  {\n    FT_Error   error;\n    FT_Stream  stream = decoder->stream;\n    FT_Byte*   p;\n    FT_Byte*   p_limit;\n    FT_Byte*   data;\n\n\n    /* seek into the EBDT table now */\n    if ( glyph_start + glyph_size > decoder->ebdt_size )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    if ( FT_STREAM_SEEK( decoder->ebdt_start + glyph_start ) ||\n         FT_FRAME_EXTRACT( glyph_size, data )                )\n      goto Exit;\n\n    p       = data;\n    p_limit = p + glyph_size;\n\n    /* read the data, depending on the glyph format */\n    switch ( glyph_format )\n    {\n    case 1:\n    case 2:\n    case 8:\n    case 17:\n      error = tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 0 );\n      break;\n\n    case 6:\n    case 7:\n    case 9:\n    case 18:\n      error = tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 1 );\n      break;\n\n    default:\n      error = FT_Err_Ok;\n    }\n\n    if ( error )\n      goto Fail;\n\n    {\n      TT_SBitDecoder_LoadFunc  loader;\n\n\n      switch ( glyph_format )\n      {\n      case 1:\n      case 6:\n        loader = tt_sbit_decoder_load_byte_aligned;\n        break;\n\n      case 2:\n      case 7:\n        {\n          /* Don't trust `glyph_format'.  For example, Apple's main Korean */\n          /* system font, `AppleMyungJo.ttf' (version 7.0d2e6), uses glyph */\n          /* format 7, but the data is format 6.  We check whether we have */\n          /* an excessive number of bytes in the image: If it is equal to  */\n          /* the value for a byte-aligned glyph, use the other loading     */\n          /* routine.                                                      */\n          /*                                                               */\n          /* Note that for some (width,height) combinations, where the     */\n          /* width is not a multiple of 8, the sizes for bit- and          */\n          /* byte-aligned data are equal, for example (7,7) or (15,6).  We */\n          /* then prefer what `glyph_format' specifies.                    */\n\n          FT_UInt  width  = decoder->metrics->width;\n          FT_UInt  height = decoder->metrics->height;\n\n          FT_UInt  bit_size  = ( width * height + 7 ) >> 3;\n          FT_UInt  byte_size = height * ( ( width + 7 ) >> 3 );\n\n\n          if ( bit_size < byte_size                  &&\n               byte_size == (FT_UInt)( p_limit - p ) )\n            loader = tt_sbit_decoder_load_byte_aligned;\n          else\n            loader = tt_sbit_decoder_load_bit_aligned;\n        }\n        break;\n\n      case 5:\n        loader = tt_sbit_decoder_load_bit_aligned;\n        break;\n\n      case 8:\n        if ( p + 1 > p_limit )\n          goto Fail;\n\n        p += 1;  /* skip padding */\n        /* fall-through */\n\n      case 9:\n        loader = tt_sbit_decoder_load_compound;\n        break;\n\n      case 17: /* small metrics, PNG image data   */\n      case 18: /* big metrics, PNG image data     */\n      case 19: /* metrics in EBLC, PNG image data */\n#ifdef FT_CONFIG_OPTION_USE_PNG\n        loader = tt_sbit_decoder_load_png;\n        break;\n#else\n        error = FT_THROW( Unimplemented_Feature );\n        goto Fail;\n#endif /* FT_CONFIG_OPTION_USE_PNG */\n\n      default:\n        error = FT_THROW( Invalid_Table );\n        goto Fail;\n      }\n\n      if ( !decoder->bitmap_allocated )\n      {\n        error = tt_sbit_decoder_alloc_bitmap( decoder );\n        if ( error )\n          goto Fail;\n      }\n\n      error = loader( decoder, p, p_limit, x_pos, y_pos );\n    }\n\n  Fail:\n    FT_FRAME_RELEASE( data );\n\n  Exit:\n    return error;\n  }\n\n\n  static FT_Error\n  tt_sbit_decoder_load_image( TT_SBitDecoder  decoder,\n                              FT_UInt         glyph_index,\n                              FT_Int          x_pos,\n                              FT_Int          y_pos )\n  {\n    /*\n     *  First, we find the correct strike range that applies to this\n     *  glyph index.\n     */\n\n    FT_Byte*  p          = decoder->eblc_base + decoder->strike_index_array;\n    FT_Byte*  p_limit    = decoder->eblc_limit;\n    FT_ULong  num_ranges = decoder->strike_index_count;\n    FT_UInt   start, end, index_format, image_format;\n    FT_ULong  image_start = 0, image_end = 0, image_offset;\n\n\n    for ( ; num_ranges > 0; num_ranges-- )\n    {\n      start = FT_NEXT_USHORT( p );\n      end   = FT_NEXT_USHORT( p );\n\n      if ( glyph_index >= start && glyph_index <= end )\n        goto FoundRange;\n\n      p += 4;  /* ignore index offset */\n    }\n    goto NoBitmap;\n\n  FoundRange:\n    image_offset = FT_NEXT_ULONG( p );\n\n    /* overflow check */\n    p = decoder->eblc_base + decoder->strike_index_array;\n    if ( image_offset > (FT_ULong)( p_limit - p ) )\n      goto Failure;\n\n    p += image_offset;\n    if ( p + 8 > p_limit )\n      goto NoBitmap;\n\n    /* now find the glyph's location and extend within the ebdt table */\n    index_format = FT_NEXT_USHORT( p );\n    image_format = FT_NEXT_USHORT( p );\n    image_offset = FT_NEXT_ULONG ( p );\n\n    switch ( index_format )\n    {\n    case 1: /* 4-byte offsets relative to `image_offset' */\n      p += 4 * ( glyph_index - start );\n      if ( p + 8 > p_limit )\n        goto NoBitmap;\n\n      image_start = FT_NEXT_ULONG( p );\n      image_end   = FT_NEXT_ULONG( p );\n\n      if ( image_start == image_end )  /* missing glyph */\n        goto NoBitmap;\n      break;\n\n    case 2: /* big metrics, constant image size */\n      {\n        FT_ULong  image_size;\n\n\n        if ( p + 12 > p_limit )\n          goto NoBitmap;\n\n        image_size = FT_NEXT_ULONG( p );\n\n        if ( tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 1 ) )\n          goto NoBitmap;\n\n        image_start = image_size * ( glyph_index - start );\n        image_end   = image_start + image_size;\n      }\n      break;\n\n    case 3: /* 2-byte offsets relative to 'image_offset' */\n      p += 2 * ( glyph_index - start );\n      if ( p + 4 > p_limit )\n        goto NoBitmap;\n\n      image_start = FT_NEXT_USHORT( p );\n      image_end   = FT_NEXT_USHORT( p );\n\n      if ( image_start == image_end )  /* missing glyph */\n        goto NoBitmap;\n      break;\n\n    case 4: /* sparse glyph array with (glyph,offset) pairs */\n      {\n        FT_ULong  mm, num_glyphs;\n\n\n        if ( p + 4 > p_limit )\n          goto NoBitmap;\n\n        num_glyphs = FT_NEXT_ULONG( p );\n\n        /* overflow check for p + ( num_glyphs + 1 ) * 4 */\n        if ( p + 4 > p_limit                                         ||\n             num_glyphs > (FT_ULong)( ( ( p_limit - p ) >> 2 ) - 1 ) )\n          goto NoBitmap;\n\n        for ( mm = 0; mm < num_glyphs; mm++ )\n        {\n          FT_UInt  gindex = FT_NEXT_USHORT( p );\n\n\n          if ( gindex == glyph_index )\n          {\n            image_start = FT_NEXT_USHORT( p );\n            p          += 2;\n            image_end   = FT_PEEK_USHORT( p );\n            break;\n          }\n          p += 2;\n        }\n\n        if ( mm >= num_glyphs )\n          goto NoBitmap;\n      }\n      break;\n\n    case 5: /* constant metrics with sparse glyph codes */\n    case 19:\n      {\n        FT_ULong  image_size, mm, num_glyphs;\n\n\n        if ( p + 16 > p_limit )\n          goto NoBitmap;\n\n        image_size = FT_NEXT_ULONG( p );\n\n        if ( tt_sbit_decoder_load_metrics( decoder, &p, p_limit, 1 ) )\n          goto NoBitmap;\n\n        num_glyphs = FT_NEXT_ULONG( p );\n\n        /* overflow check for p + 2 * num_glyphs */\n        if ( num_glyphs > (FT_ULong)( ( p_limit - p ) >> 1 ) )\n          goto NoBitmap;\n\n        for ( mm = 0; mm < num_glyphs; mm++ )\n        {\n          FT_UInt  gindex = FT_NEXT_USHORT( p );\n\n\n          if ( gindex == glyph_index )\n            break;\n        }\n\n        if ( mm >= num_glyphs )\n          goto NoBitmap;\n\n        image_start = image_size * mm;\n        image_end   = image_start + image_size;\n      }\n      break;\n\n    default:\n      goto NoBitmap;\n    }\n\n    if ( image_start > image_end )\n      goto NoBitmap;\n\n    image_end  -= image_start;\n    image_start = image_offset + image_start;\n\n    FT_TRACE3(( \"tt_sbit_decoder_load_image:\"\n                \" found sbit (format %d) for glyph index %d\\n\",\n                image_format, glyph_index ));\n\n    return tt_sbit_decoder_load_bitmap( decoder,\n                                        image_format,\n                                        image_start,\n                                        image_end,\n                                        x_pos,\n                                        y_pos );\n\n  Failure:\n    return FT_THROW( Invalid_Table );\n\n  NoBitmap:\n    FT_TRACE4(( \"tt_sbit_decoder_load_image:\"\n                \" no sbit found for glyph index %d\\n\", glyph_index ));\n\n    return FT_THROW( Invalid_Argument );\n  }\n\n\n  static FT_Error\n  tt_face_load_sbix_image( TT_Face              face,\n                           FT_ULong             strike_index,\n                           FT_UInt              glyph_index,\n                           FT_Stream            stream,\n                           FT_Bitmap           *map,\n                           TT_SBit_MetricsRec  *metrics )\n  {\n    FT_UInt   sbix_pos, strike_offset, glyph_start, glyph_end;\n    FT_ULong  table_size;\n    FT_Int    originOffsetX, originOffsetY;\n    FT_Tag    graphicType;\n    FT_Int    recurse_depth = 0;\n\n    FT_Error  error;\n    FT_Byte*  p;\n\n    FT_UNUSED( map );\n\n\n    metrics->width  = 0;\n    metrics->height = 0;\n\n    p = face->sbit_table + 8 + 4 * strike_index;\n    strike_offset = FT_NEXT_ULONG( p );\n\n    error = face->goto_table( face, TTAG_sbix, stream, &table_size );\n    if ( error )\n      return error;\n    sbix_pos = FT_STREAM_POS();\n\n  retry:\n    if ( glyph_index > (FT_UInt)face->root.num_glyphs )\n      return FT_THROW( Invalid_Argument );\n\n    if ( strike_offset >= table_size                          ||\n         table_size - strike_offset < 4 + glyph_index * 4 + 8 )\n      return FT_THROW( Invalid_File_Format );\n\n    if ( FT_STREAM_SEEK( sbix_pos + strike_offset + 4 + glyph_index * 4 ) ||\n         FT_FRAME_ENTER( 8 )                                              )\n      return error;\n\n    glyph_start = FT_GET_ULONG();\n    glyph_end   = FT_GET_ULONG();\n\n    FT_FRAME_EXIT();\n\n    if ( glyph_start == glyph_end )\n      return FT_THROW( Invalid_Argument );\n    if ( glyph_start > glyph_end                ||\n         glyph_end - glyph_start < 8            ||\n         table_size - strike_offset < glyph_end )\n      return FT_THROW( Invalid_File_Format );\n\n    if ( FT_STREAM_SEEK( sbix_pos + strike_offset + glyph_start ) ||\n         FT_FRAME_ENTER( glyph_end - glyph_start )                )\n      return error;\n\n    originOffsetX = FT_GET_SHORT();\n    originOffsetY = FT_GET_SHORT();\n\n    graphicType = FT_GET_TAG4();\n\n    switch ( graphicType )\n    {\n    case FT_MAKE_TAG( 'd', 'u', 'p', 'e' ):\n      if ( recurse_depth < 4 )\n      {\n        glyph_index = FT_GET_USHORT();\n        FT_FRAME_EXIT();\n        recurse_depth++;\n        goto retry;\n      }\n      error = FT_THROW( Invalid_File_Format );\n      break;\n\n    case FT_MAKE_TAG( 'p', 'n', 'g', ' ' ):\n#ifdef FT_CONFIG_OPTION_USE_PNG\n      error = Load_SBit_Png( face->root.glyph,\n                             0,\n                             0,\n                             32,\n                             metrics,\n                             stream->memory,\n                             stream->cursor,\n                             glyph_end - glyph_start - 8,\n                             TRUE );\n#else\n      error = FT_THROW( Unimplemented_Feature );\n#endif\n      break;\n\n    case FT_MAKE_TAG( 'j', 'p', 'g', ' ' ):\n    case FT_MAKE_TAG( 't', 'i', 'f', 'f' ):\n    case FT_MAKE_TAG( 'r', 'g', 'b', 'l' ): /* used on iOS 7.1 */\n      error = FT_THROW( Unknown_File_Format );\n      break;\n\n    default:\n      error = FT_THROW( Unimplemented_Feature );\n      break;\n    }\n\n    FT_FRAME_EXIT();\n\n    if ( !error )\n    {\n      FT_Short   abearing;\n      FT_UShort  aadvance;\n\n\n      tt_face_get_metrics( face, FALSE, glyph_index, &abearing, &aadvance );\n\n      metrics->horiBearingX = (FT_Short)originOffsetX;\n      metrics->horiBearingY = (FT_Short)( -originOffsetY + metrics->height );\n      metrics->horiAdvance  = (FT_Short)( aadvance *\n                                          face->root.size->metrics.x_ppem /\n                                          face->header.Units_Per_EM );\n    }\n\n    return error;\n  }\n\n  FT_LOCAL( FT_Error )\n  tt_face_load_sbit_image( TT_Face              face,\n                           FT_ULong             strike_index,\n                           FT_UInt              glyph_index,\n                           FT_UInt              load_flags,\n                           FT_Stream            stream,\n                           FT_Bitmap           *map,\n                           TT_SBit_MetricsRec  *metrics )\n  {\n    FT_Error  error = FT_Err_Ok;\n\n\n    switch ( (FT_UInt)face->sbit_table_type )\n    {\n    case TT_SBIT_TABLE_TYPE_EBLC:\n    case TT_SBIT_TABLE_TYPE_CBLC:\n      {\n        TT_SBitDecoderRec  decoder[1];\n\n\n        error = tt_sbit_decoder_init( decoder, face, strike_index, metrics );\n        if ( !error )\n        {\n          error = tt_sbit_decoder_load_image( decoder,\n                                              glyph_index,\n                                              0,\n                                              0 );\n          tt_sbit_decoder_done( decoder );\n        }\n      }\n      break;\n\n    case TT_SBIT_TABLE_TYPE_SBIX:\n      error = tt_face_load_sbix_image( face,\n                                       strike_index,\n                                       glyph_index,\n                                       stream,\n                                       map,\n                                       metrics );\n      break;\n\n    default:\n      error = FT_THROW( Unknown_File_Format );\n      break;\n    }\n\n    /* Flatten color bitmaps if color was not requested. */\n    if ( !error                                &&\n         !( load_flags & FT_LOAD_COLOR )       &&\n         map->pixel_mode == FT_PIXEL_MODE_BGRA )\n    {\n      FT_Bitmap   new_map;\n      FT_Library  library = face->root.glyph->library;\n\n\n      FT_Bitmap_New( &new_map );\n\n      /* Convert to 8bit grayscale. */\n      error = FT_Bitmap_Convert( library, map, &new_map, 1 );\n      if ( error )\n        FT_Bitmap_Done( library, &new_map );\n      else\n      {\n        map->pixel_mode = new_map.pixel_mode;\n        map->pitch      = new_map.pitch;\n        map->num_grays  = new_map.num_grays;\n\n        ft_glyphslot_set_bitmap( face->root.glyph, new_map.buffer );\n        face->root.glyph->internal->flags |= FT_GLYPH_OWN_BITMAP;\n      }\n    }\n\n    return error;\n  }\n\n\n/* EOF */\n"
  },
  {
    "path": "ext/freetype2/src/sfnt/ttsbit.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttsbit.h                                                               */\n/*                                                                         */\n/*    TrueType and OpenType embedded bitmap support (specification).       */\n/*                                                                         */\n/*  Copyright 1996-2008, 2013 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTSBIT_H__\n#define __TTSBIT_H__\n\n\n#include <ft2build.h>\n#include \"ttload.h\"\n\n\nFT_BEGIN_HEADER\n\n\n  FT_LOCAL( FT_Error )\n  tt_face_load_sbit( TT_Face    face,\n                     FT_Stream  stream );\n\n  FT_LOCAL( void )\n  tt_face_free_sbit( TT_Face  face );\n\n\n  FT_LOCAL( FT_Error )\n  tt_face_set_sbit_strike( TT_Face          face,\n                           FT_Size_Request  req,\n                           FT_ULong*        astrike_index );\n\n  FT_LOCAL( FT_Error )\n  tt_face_load_strike_metrics( TT_Face           face,\n                               FT_ULong          strike_index,\n                               FT_Size_Metrics*  metrics );\n\n  FT_LOCAL( FT_Error )\n  tt_face_load_sbit_image( TT_Face              face,\n                           FT_ULong             strike_index,\n                           FT_UInt              glyph_index,\n                           FT_UInt              load_flags,\n                           FT_Stream            stream,\n                           FT_Bitmap           *map,\n                           TT_SBit_MetricsRec  *metrics );\n\n\nFT_END_HEADER\n\n#endif /* __TTSBIT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/smooth/Jamfile",
    "content": "# FreeType 2 src/smooth Jamfile\n#\n# Copyright 2001 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) smooth ;\n\n{\n  local  _sources ;\n\n  if $(FT2_MULTI)\n  {\n    _sources = ftgrays ftsmooth ftspic ;\n  }\n  else\n  {\n    _sources = smooth ;\n  }\n\n  Library  $(FT2_LIB) : $(_sources).c ;\n}\n\n# end of src/smooth Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/smooth/ftgrays.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgrays.c                                                              */\n/*                                                                         */\n/*    A new `perfect' anti-aliasing renderer (body).                       */\n/*                                                                         */\n/*  Copyright 2000-2003, 2005-2014 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file can be compiled without the rest of the FreeType engine, by */\n  /* defining the _STANDALONE_ macro when compiling it.  You also need to  */\n  /* put the files `ftgrays.h' and `ftimage.h' into the current            */\n  /* compilation directory.  Typically, you could do something like        */\n  /*                                                                       */\n  /* - copy `src/smooth/ftgrays.c' (this file) to your current directory   */\n  /*                                                                       */\n  /* - copy `include/ftimage.h' and `src/smooth/ftgrays.h' to the same     */\n  /*   directory                                                           */\n  /*                                                                       */\n  /* - compile `ftgrays' with the _STANDALONE_ macro defined, as in        */\n  /*                                                                       */\n  /*     cc -c -D_STANDALONE_ ftgrays.c                                    */\n  /*                                                                       */\n  /* The renderer can be initialized with a call to                        */\n  /* `ft_gray_raster.raster_new'; an anti-aliased bitmap can be generated  */\n  /* with a call to `ft_gray_raster.raster_render'.                        */\n  /*                                                                       */\n  /* See the comments and documentation in the file `ftimage.h' for more   */\n  /* details on how the raster works.                                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This is a new anti-aliasing scan-converter for FreeType 2.  The       */\n  /* algorithm used here is _very_ different from the one in the standard  */\n  /* `ftraster' module.  Actually, `ftgrays' computes the _exact_          */\n  /* coverage of the outline on each pixel cell.                           */\n  /*                                                                       */\n  /* It is based on ideas that I initially found in Raph Levien's          */\n  /* excellent LibArt graphics library (see http://www.levien.com/libart   */\n  /* for more information, though the web pages do not tell anything       */\n  /* about the renderer; you'll have to dive into the source code to       */\n  /* understand how it works).                                             */\n  /*                                                                       */\n  /* Note, however, that this is a _very_ different implementation         */\n  /* compared to Raph's.  Coverage information is stored in a very         */\n  /* different way, and I don't use sorted vector paths.  Also, it doesn't */\n  /* use floating point values.                                            */\n  /*                                                                       */\n  /* This renderer has the following advantages:                           */\n  /*                                                                       */\n  /* - It doesn't need an intermediate bitmap.  Instead, one can supply a  */\n  /*   callback function that will be called by the renderer to draw gray  */\n  /*   spans on any target surface.  You can thus do direct composition on */\n  /*   any kind of bitmap, provided that you give the renderer the right   */\n  /*   callback.                                                           */\n  /*                                                                       */\n  /* - A perfect anti-aliaser, i.e., it computes the _exact_ coverage on   */\n  /*   each pixel cell.                                                    */\n  /*                                                                       */\n  /* - It performs a single pass on the outline (the `standard' FT2        */\n  /*   renderer makes two passes).                                         */\n  /*                                                                       */\n  /* - It can easily be modified to render to _any_ number of gray levels  */\n  /*   cheaply.                                                            */\n  /*                                                                       */\n  /* - For small (< 20) pixel sizes, it is faster than the standard        */\n  /*   renderer.                                                           */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_smooth\n\n\n#ifdef _STANDALONE_\n\n\n  /* Auxiliary macros for token concatenation. */\n#define FT_ERR_XCAT( x, y )  x ## y\n#define FT_ERR_CAT( x, y )   FT_ERR_XCAT( x, y )\n\n#define FT_BEGIN_STMNT  do {\n#define FT_END_STMNT    } while ( 0 )\n\n\n  /* define this to dump debugging information */\n/* #define FT_DEBUG_LEVEL_TRACE */\n\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n#include <stdio.h>\n#include <stdarg.h>\n#endif\n\n#include <stddef.h>\n#include <string.h>\n#include <setjmp.h>\n#include <limits.h>\n#define FT_UINT_MAX  UINT_MAX\n#define FT_INT_MAX   INT_MAX\n\n#define ft_memset   memset\n\n#define ft_setjmp   setjmp\n#define ft_longjmp  longjmp\n#define ft_jmp_buf  jmp_buf\n\ntypedef ptrdiff_t  FT_PtrDist;\n\n\n#define ErrRaster_Invalid_Mode      -2\n#define ErrRaster_Invalid_Outline   -1\n#define ErrRaster_Invalid_Argument  -3\n#define ErrRaster_Memory_Overflow   -4\n\n#define FT_BEGIN_HEADER\n#define FT_END_HEADER\n\n#include \"ftimage.h\"\n#include \"ftgrays.h\"\n\n\n  /* This macro is used to indicate that a function parameter is unused. */\n  /* Its purpose is simply to reduce compiler warnings.  Note also that  */\n  /* simply defining it as `(void)x' doesn't avoid warnings with certain */\n  /* ANSI compilers (e.g. LCC).                                          */\n#define FT_UNUSED( x )  (x) = (x)\n\n\n  /* we only use level 5 & 7 tracing messages; cf. ftdebug.h */\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n  void\n  FT_Message( const char*  fmt,\n              ... )\n  {\n    va_list  ap;\n\n\n    va_start( ap, fmt );\n    vfprintf( stderr, fmt, ap );\n    va_end( ap );\n  }\n\n\n  /* empty function useful for setting a breakpoint to catch errors */\n  int\n  FT_Throw( int          error,\n            int          line,\n            const char*  file )\n  {\n    FT_UNUSED( error );\n    FT_UNUSED( line );\n    FT_UNUSED( file );\n\n    return 0;\n  }\n\n\n  /* we don't handle tracing levels in stand-alone mode; */\n#ifndef FT_TRACE5\n#define FT_TRACE5( varformat )  FT_Message varformat\n#endif\n#ifndef FT_TRACE7\n#define FT_TRACE7( varformat )  FT_Message varformat\n#endif\n#ifndef FT_ERROR\n#define FT_ERROR( varformat )   FT_Message varformat\n#endif\n\n#define FT_THROW( e )                               \\\n          ( FT_Throw( FT_ERR_CAT( ErrRaster, e ),   \\\n                      __LINE__,                     \\\n                      __FILE__ )                  | \\\n            FT_ERR_CAT( ErrRaster, e )            )\n\n#else /* !FT_DEBUG_LEVEL_TRACE */\n\n#define FT_TRACE5( x )  do { } while ( 0 )     /* nothing */\n#define FT_TRACE7( x )  do { } while ( 0 )     /* nothing */\n#define FT_ERROR( x )   do { } while ( 0 )     /* nothing */\n#define FT_THROW( e )   FT_ERR_CAT( ErrRaster_, e )\n\n\n#endif /* !FT_DEBUG_LEVEL_TRACE */\n\n\n#define FT_DEFINE_OUTLINE_FUNCS( class_,               \\\n                                 move_to_, line_to_,   \\\n                                 conic_to_, cubic_to_, \\\n                                 shift_, delta_ )      \\\n          static const FT_Outline_Funcs class_ =       \\\n          {                                            \\\n            move_to_,                                  \\\n            line_to_,                                  \\\n            conic_to_,                                 \\\n            cubic_to_,                                 \\\n            shift_,                                    \\\n            delta_                                     \\\n         };\n\n#define FT_DEFINE_RASTER_FUNCS( class_, glyph_format_,            \\\n                                raster_new_, raster_reset_,       \\\n                                raster_set_mode_, raster_render_, \\\n                                raster_done_ )                    \\\n          const FT_Raster_Funcs class_ =                          \\\n          {                                                       \\\n            glyph_format_,                                        \\\n            raster_new_,                                          \\\n            raster_reset_,                                        \\\n            raster_set_mode_,                                     \\\n            raster_render_,                                       \\\n            raster_done_                                          \\\n         };\n\n\n#else /* !_STANDALONE_ */\n\n\n#include <ft2build.h>\n#include \"ftgrays.h\"\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_OUTLINE_H\n\n#include \"ftsmerrs.h\"\n\n#include \"ftspic.h\"\n\n#define Smooth_Err_Invalid_Mode     Smooth_Err_Cannot_Render_Glyph\n#define Smooth_Err_Memory_Overflow  Smooth_Err_Out_Of_Memory\n#define ErrRaster_Memory_Overflow   Smooth_Err_Out_Of_Memory\n\n\n#endif /* !_STANDALONE_ */\n\n\n#ifndef FT_MEM_SET\n#define FT_MEM_SET( d, s, c )  ft_memset( d, s, c )\n#endif\n\n#ifndef FT_MEM_ZERO\n#define FT_MEM_ZERO( dest, count )  FT_MEM_SET( dest, 0, count )\n#endif\n\n  /* as usual, for the speed hungry :-) */\n\n#undef RAS_ARG\n#undef RAS_ARG_\n#undef RAS_VAR\n#undef RAS_VAR_\n\n#ifndef FT_STATIC_RASTER\n\n#define RAS_ARG   gray_PWorker  worker\n#define RAS_ARG_  gray_PWorker  worker,\n\n#define RAS_VAR   worker\n#define RAS_VAR_  worker,\n\n#else /* FT_STATIC_RASTER */\n\n#define RAS_ARG   /* empty */\n#define RAS_ARG_  /* empty */\n#define RAS_VAR   /* empty */\n#define RAS_VAR_  /* empty */\n\n#endif /* FT_STATIC_RASTER */\n\n\n  /* must be at least 6 bits! */\n#define PIXEL_BITS  8\n\n#undef FLOOR\n#undef CEILING\n#undef TRUNC\n#undef SCALED\n\n#define ONE_PIXEL       ( 1L << PIXEL_BITS )\n#define PIXEL_MASK      ( -1L << PIXEL_BITS )\n#define TRUNC( x )      ( (TCoord)( (x) >> PIXEL_BITS ) )\n#define SUBPIXELS( x )  ( (TPos)(x) << PIXEL_BITS )\n#define FLOOR( x )      ( (x) & -ONE_PIXEL )\n#define CEILING( x )    ( ( (x) + ONE_PIXEL - 1 ) & -ONE_PIXEL )\n#define ROUND( x )      ( ( (x) + ONE_PIXEL / 2 ) & -ONE_PIXEL )\n\n#if PIXEL_BITS >= 6\n#define UPSCALE( x )    ( (x) << ( PIXEL_BITS - 6 ) )\n#define DOWNSCALE( x )  ( (x) >> ( PIXEL_BITS - 6 ) )\n#else\n#define UPSCALE( x )    ( (x) >> ( 6 - PIXEL_BITS ) )\n#define DOWNSCALE( x )  ( (x) << ( 6 - PIXEL_BITS ) )\n#endif\n\n\n  /* Compute `dividend / divisor' and return both its quotient and     */\n  /* remainder, cast to a specific type.  This macro also ensures that */\n  /* the remainder is always positive.                                 */\n#define FT_DIV_MOD( type, dividend, divisor, quotient, remainder ) \\\n  FT_BEGIN_STMNT                                                   \\\n    (quotient)  = (type)( (dividend) / (divisor) );                \\\n    (remainder) = (type)( (dividend) % (divisor) );                \\\n    if ( (remainder) < 0 )                                         \\\n    {                                                              \\\n      (quotient)--;                                                \\\n      (remainder) += (type)(divisor);                              \\\n    }                                                              \\\n  FT_END_STMNT\n\n#ifdef  __arm__\n  /* Work around a bug specific to GCC which make the compiler fail to */\n  /* optimize a division and modulo operation on the same parameters   */\n  /* into a single call to `__aeabi_idivmod'.  See                     */\n  /*                                                                   */\n  /*  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43721                */\n#undef FT_DIV_MOD\n#define FT_DIV_MOD( type, dividend, divisor, quotient, remainder ) \\\n  FT_BEGIN_STMNT                                                   \\\n    (quotient)  = (type)( (dividend) / (divisor) );                \\\n    (remainder) = (type)( (dividend) - (quotient) * (divisor) );   \\\n    if ( (remainder) < 0 )                                         \\\n    {                                                              \\\n      (quotient)--;                                                \\\n      (remainder) += (type)(divisor);                              \\\n    }                                                              \\\n  FT_END_STMNT\n#endif /* __arm__ */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*   TYPE DEFINITIONS                                                    */\n  /*                                                                       */\n\n  /* don't change the following types to FT_Int or FT_Pos, since we might */\n  /* need to define them to \"float\" or \"double\" when experimenting with   */\n  /* new algorithms                                                       */\n\n  typedef long  TCoord;   /* integer scanline/pixel coordinate */\n  typedef long  TPos;     /* sub-pixel coordinate              */\n\n  /* determine the type used to store cell areas.  This normally takes at */\n  /* least PIXEL_BITS*2 + 1 bits.  On 16-bit systems, we need to use      */\n  /* `long' instead of `int', otherwise bad things happen                 */\n\n#if PIXEL_BITS <= 7\n\n  typedef int  TArea;\n\n#else /* PIXEL_BITS >= 8 */\n\n  /* approximately determine the size of integers using an ANSI-C header */\n#if FT_UINT_MAX == 0xFFFFU\n  typedef long  TArea;\n#else\n  typedef int   TArea;\n#endif\n\n#endif /* PIXEL_BITS >= 8 */\n\n\n  /* maximum number of gray spans in a call to the span callback */\n#define FT_MAX_GRAY_SPANS  32\n\n\n  typedef struct TCell_*  PCell;\n\n  typedef struct  TCell_\n  {\n    TPos    x;     /* same with gray_TWorker.ex    */\n    TCoord  cover; /* same with gray_TWorker.cover */\n    TArea   area;\n    PCell   next;\n\n  } TCell;\n\n\n#if defined( _MSC_VER )      /* Visual C++ (and Intel C++) */\n  /* We disable the warning `structure was padded due to   */\n  /* __declspec(align())' in order to compile cleanly with */\n  /* the maximum level of warnings.                        */\n#pragma warning( push )\n#pragma warning( disable : 4324 )\n#endif /* _MSC_VER */\n\n  typedef struct  gray_TWorker_\n  {\n    ft_jmp_buf  jump_buffer;\n\n    TCoord  ex, ey;\n    TPos    min_ex, max_ex;\n    TPos    min_ey, max_ey;\n    TPos    count_ex, count_ey;\n\n    TArea   area;\n    TCoord  cover;\n    int     invalid;\n\n    PCell       cells;\n    FT_PtrDist  max_cells;\n    FT_PtrDist  num_cells;\n\n    TCoord  cx, cy;\n    TPos    x,  y;\n\n    TPos    last_ey;\n\n    FT_Vector   bez_stack[32 * 3 + 1];\n    int         lev_stack[32];\n\n    FT_Outline  outline;\n    FT_Bitmap   target;\n    FT_BBox     clip_box;\n\n    FT_Span     gray_spans[FT_MAX_GRAY_SPANS];\n    int         num_gray_spans;\n\n    FT_Raster_Span_Func  render_span;\n    void*                render_span_data;\n    int                  span_y;\n\n    int  band_size;\n    int  band_shoot;\n\n    void*       buffer;\n    long        buffer_size;\n\n    PCell*     ycells;\n    TPos       ycount;\n\n  } gray_TWorker, *gray_PWorker;\n\n#if defined( _MSC_VER )\n#pragma warning( pop )\n#endif\n\n\n#ifndef FT_STATIC_RASTER\n#define ras  (*worker)\n#else\n  static gray_TWorker  ras;\n#endif\n\n\n  typedef struct gray_TRaster_\n  {\n    void*         buffer;\n    long          buffer_size;\n    int           band_size;\n    void*         memory;\n    gray_PWorker  worker;\n\n  } gray_TRaster, *gray_PRaster;\n\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Initialize the cells table.                                           */\n  /*                                                                       */\n  static void\n  gray_init_cells( RAS_ARG_ void*  buffer,\n                   long            byte_size )\n  {\n    ras.buffer      = buffer;\n    ras.buffer_size = byte_size;\n\n    ras.ycells      = (PCell*) buffer;\n    ras.cells       = NULL;\n    ras.max_cells   = 0;\n    ras.num_cells   = 0;\n    ras.area        = 0;\n    ras.cover       = 0;\n    ras.invalid     = 1;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Compute the outline bounding box.                                     */\n  /*                                                                       */\n  static void\n  gray_compute_cbox( RAS_ARG )\n  {\n    FT_Outline*  outline = &ras.outline;\n    FT_Vector*   vec     = outline->points;\n    FT_Vector*   limit   = vec + outline->n_points;\n\n\n    if ( outline->n_points <= 0 )\n    {\n      ras.min_ex = ras.max_ex = 0;\n      ras.min_ey = ras.max_ey = 0;\n      return;\n    }\n\n    ras.min_ex = ras.max_ex = vec->x;\n    ras.min_ey = ras.max_ey = vec->y;\n\n    vec++;\n\n    for ( ; vec < limit; vec++ )\n    {\n      TPos  x = vec->x;\n      TPos  y = vec->y;\n\n\n      if ( x < ras.min_ex ) ras.min_ex = x;\n      if ( x > ras.max_ex ) ras.max_ex = x;\n      if ( y < ras.min_ey ) ras.min_ey = y;\n      if ( y > ras.max_ey ) ras.max_ey = y;\n    }\n\n    /* truncate the bounding box to integer pixels */\n    ras.min_ex = ras.min_ex >> 6;\n    ras.min_ey = ras.min_ey >> 6;\n    ras.max_ex = ( ras.max_ex + 63 ) >> 6;\n    ras.max_ey = ( ras.max_ey + 63 ) >> 6;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Record the current cell in the table.                                 */\n  /*                                                                       */\n  static PCell\n  gray_find_cell( RAS_ARG )\n  {\n    PCell  *pcell, cell;\n    TPos    x = ras.ex;\n\n\n    if ( x > ras.count_ex )\n      x = ras.count_ex;\n\n    pcell = &ras.ycells[ras.ey];\n    for (;;)\n    {\n      cell = *pcell;\n      if ( cell == NULL || cell->x > x )\n        break;\n\n      if ( cell->x == x )\n        goto Exit;\n\n      pcell = &cell->next;\n    }\n\n    if ( ras.num_cells >= ras.max_cells )\n      ft_longjmp( ras.jump_buffer, 1 );\n\n    cell        = ras.cells + ras.num_cells++;\n    cell->x     = x;\n    cell->area  = 0;\n    cell->cover = 0;\n\n    cell->next  = *pcell;\n    *pcell      = cell;\n\n  Exit:\n    return cell;\n  }\n\n\n  static void\n  gray_record_cell( RAS_ARG )\n  {\n    if ( ras.area | ras.cover )\n    {\n      PCell  cell = gray_find_cell( RAS_VAR );\n\n\n      cell->area  += ras.area;\n      cell->cover += ras.cover;\n    }\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Set the current cell to a new position.                               */\n  /*                                                                       */\n  static void\n  gray_set_cell( RAS_ARG_ TCoord  ex,\n                          TCoord  ey )\n  {\n    /* Move the cell pointer to a new position.  We set the `invalid'      */\n    /* flag to indicate that the cell isn't part of those we're interested */\n    /* in during the render phase.  This means that:                       */\n    /*                                                                     */\n    /* . the new vertical position must be within min_ey..max_ey-1.        */\n    /* . the new horizontal position must be strictly less than max_ex     */\n    /*                                                                     */\n    /* Note that if a cell is to the left of the clipping region, it is    */\n    /* actually set to the (min_ex-1) horizontal position.                 */\n\n    /* All cells that are on the left of the clipping region go to the */\n    /* min_ex - 1 horizontal position.                                 */\n    ey -= ras.min_ey;\n\n    if ( ex > ras.max_ex )\n      ex = ras.max_ex;\n\n    ex -= ras.min_ex;\n    if ( ex < 0 )\n      ex = -1;\n\n    /* are we moving to a different cell ? */\n    if ( ex != ras.ex || ey != ras.ey )\n    {\n      /* record the current one if it is valid */\n      if ( !ras.invalid )\n        gray_record_cell( RAS_VAR );\n\n      ras.area  = 0;\n      ras.cover = 0;\n      ras.ex    = ex;\n      ras.ey    = ey;\n    }\n\n    ras.invalid = ( (unsigned)ey >= (unsigned)ras.count_ey ||\n                              ex >= ras.count_ex           );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Start a new contour at a given cell.                                  */\n  /*                                                                       */\n  static void\n  gray_start_cell( RAS_ARG_ TCoord  ex,\n                            TCoord  ey )\n  {\n    if ( ex > ras.max_ex )\n      ex = (TCoord)( ras.max_ex );\n\n    if ( ex < ras.min_ex )\n      ex = (TCoord)( ras.min_ex - 1 );\n\n    ras.area    = 0;\n    ras.cover   = 0;\n    ras.ex      = ex - ras.min_ex;\n    ras.ey      = ey - ras.min_ey;\n    ras.last_ey = SUBPIXELS( ey );\n    ras.invalid = 0;\n\n    gray_set_cell( RAS_VAR_ ex, ey );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Render a scanline as one or more cells.                               */\n  /*                                                                       */\n  static void\n  gray_render_scanline( RAS_ARG_ TCoord  ey,\n                                 TPos    x1,\n                                 TCoord  y1,\n                                 TPos    x2,\n                                 TCoord  y2 )\n  {\n    TCoord  ex1, ex2, fx1, fx2, delta, mod;\n    long    p, first, dx;\n    int     incr;\n\n\n    dx = x2 - x1;\n\n    ex1 = TRUNC( x1 );\n    ex2 = TRUNC( x2 );\n    fx1 = (TCoord)( x1 - SUBPIXELS( ex1 ) );\n    fx2 = (TCoord)( x2 - SUBPIXELS( ex2 ) );\n\n    /* trivial case.  Happens often */\n    if ( y1 == y2 )\n    {\n      gray_set_cell( RAS_VAR_ ex2, ey );\n      return;\n    }\n\n    /* everything is located in a single cell.  That is easy! */\n    /*                                                        */\n    if ( ex1 == ex2 )\n    {\n      delta      = y2 - y1;\n      ras.area  += (TArea)(( fx1 + fx2 ) * delta);\n      ras.cover += delta;\n      return;\n    }\n\n    /* ok, we'll have to render a run of adjacent cells on the same */\n    /* scanline...                                                  */\n    /*                                                              */\n    p     = ( ONE_PIXEL - fx1 ) * ( y2 - y1 );\n    first = ONE_PIXEL;\n    incr  = 1;\n\n    if ( dx < 0 )\n    {\n      p     = fx1 * ( y2 - y1 );\n      first = 0;\n      incr  = -1;\n      dx    = -dx;\n    }\n\n    FT_DIV_MOD( TCoord, p, dx, delta, mod );\n\n    ras.area  += (TArea)(( fx1 + first ) * delta);\n    ras.cover += delta;\n\n    ex1 += incr;\n    gray_set_cell( RAS_VAR_ ex1, ey );\n    y1  += delta;\n\n    if ( ex1 != ex2 )\n    {\n      TCoord  lift, rem;\n\n\n      p = ONE_PIXEL * ( y2 - y1 + delta );\n      FT_DIV_MOD( TCoord, p, dx, lift, rem );\n\n      mod -= (int)dx;\n\n      while ( ex1 != ex2 )\n      {\n        delta = lift;\n        mod  += rem;\n        if ( mod >= 0 )\n        {\n          mod -= (TCoord)dx;\n          delta++;\n        }\n\n        ras.area  += (TArea)(ONE_PIXEL * delta);\n        ras.cover += delta;\n        y1        += delta;\n        ex1       += incr;\n        gray_set_cell( RAS_VAR_ ex1, ey );\n      }\n    }\n\n    delta      = y2 - y1;\n    ras.area  += (TArea)(( fx2 + ONE_PIXEL - first ) * delta);\n    ras.cover += delta;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Render a given line as a series of scanlines.                         */\n  /*                                                                       */\n  static void\n  gray_render_line( RAS_ARG_ TPos  to_x,\n                             TPos  to_y )\n  {\n    TCoord  ey1, ey2, fy1, fy2, mod;\n    TPos    dx, dy, x, x2;\n    long    p, first;\n    int     delta, rem, lift, incr;\n\n\n    ey1 = TRUNC( ras.last_ey );\n    ey2 = TRUNC( to_y );     /* if (ey2 >= ras.max_ey) ey2 = ras.max_ey-1; */\n    fy1 = (TCoord)( ras.y - ras.last_ey );\n    fy2 = (TCoord)( to_y - SUBPIXELS( ey2 ) );\n\n    dx = to_x - ras.x;\n    dy = to_y - ras.y;\n\n    /* perform vertical clipping */\n    {\n      TCoord  min, max;\n\n\n      min = ey1;\n      max = ey2;\n      if ( ey1 > ey2 )\n      {\n        min = ey2;\n        max = ey1;\n      }\n      if ( min >= ras.max_ey || max < ras.min_ey )\n        goto End;\n    }\n\n    /* everything is on a single scanline */\n    if ( ey1 == ey2 )\n    {\n      gray_render_scanline( RAS_VAR_ ey1, ras.x, fy1, to_x, fy2 );\n      goto End;\n    }\n\n    /* vertical line - avoid calling gray_render_scanline */\n    incr = 1;\n\n    if ( dx == 0 )\n    {\n      TCoord  ex     = TRUNC( ras.x );\n      TCoord  two_fx = (TCoord)( ( ras.x - SUBPIXELS( ex ) ) << 1 );\n      TArea   area;\n\n\n      first = ONE_PIXEL;\n      if ( dy < 0 )\n      {\n        first = 0;\n        incr  = -1;\n      }\n\n      delta      = (int)( first - fy1 );\n      ras.area  += (TArea)two_fx * delta;\n      ras.cover += delta;\n      ey1       += incr;\n\n      gray_set_cell( RAS_VAR_ ex, ey1 );\n\n      delta = (int)( first + first - ONE_PIXEL );\n      area  = (TArea)two_fx * delta;\n      while ( ey1 != ey2 )\n      {\n        ras.area  += area;\n        ras.cover += delta;\n        ey1       += incr;\n\n        gray_set_cell( RAS_VAR_ ex, ey1 );\n      }\n\n      delta      = (int)( fy2 - ONE_PIXEL + first );\n      ras.area  += (TArea)two_fx * delta;\n      ras.cover += delta;\n\n      goto End;\n    }\n\n    /* ok, we have to render several scanlines */\n    p     = ( ONE_PIXEL - fy1 ) * dx;\n    first = ONE_PIXEL;\n    incr  = 1;\n\n    if ( dy < 0 )\n    {\n      p     = fy1 * dx;\n      first = 0;\n      incr  = -1;\n      dy    = -dy;\n    }\n\n    FT_DIV_MOD( int, p, dy, delta, mod );\n\n    x = ras.x + delta;\n    gray_render_scanline( RAS_VAR_ ey1, ras.x, fy1, x, (TCoord)first );\n\n    ey1 += incr;\n    gray_set_cell( RAS_VAR_ TRUNC( x ), ey1 );\n\n    if ( ey1 != ey2 )\n    {\n      p     = ONE_PIXEL * dx;\n      FT_DIV_MOD( int, p, dy, lift, rem );\n      mod -= (int)dy;\n\n      while ( ey1 != ey2 )\n      {\n        delta = lift;\n        mod  += rem;\n        if ( mod >= 0 )\n        {\n          mod -= (int)dy;\n          delta++;\n        }\n\n        x2 = x + delta;\n        gray_render_scanline( RAS_VAR_ ey1, x,\n                                       (TCoord)( ONE_PIXEL - first ), x2,\n                                       (TCoord)first );\n        x = x2;\n\n        ey1 += incr;\n        gray_set_cell( RAS_VAR_ TRUNC( x ), ey1 );\n      }\n    }\n\n    gray_render_scanline( RAS_VAR_ ey1, x,\n                                   (TCoord)( ONE_PIXEL - first ), to_x,\n                                   fy2 );\n\n  End:\n    ras.x       = to_x;\n    ras.y       = to_y;\n    ras.last_ey = SUBPIXELS( ey2 );\n  }\n\n\n  static void\n  gray_split_conic( FT_Vector*  base )\n  {\n    TPos  a, b;\n\n\n    base[4].x = base[2].x;\n    b = base[1].x;\n    a = base[3].x = ( base[2].x + b ) / 2;\n    b = base[1].x = ( base[0].x + b ) / 2;\n    base[2].x = ( a + b ) / 2;\n\n    base[4].y = base[2].y;\n    b = base[1].y;\n    a = base[3].y = ( base[2].y + b ) / 2;\n    b = base[1].y = ( base[0].y + b ) / 2;\n    base[2].y = ( a + b ) / 2;\n  }\n\n\n  static void\n  gray_render_conic( RAS_ARG_ const FT_Vector*  control,\n                              const FT_Vector*  to )\n  {\n    TPos        dx, dy;\n    TPos        min, max, y;\n    int         top, level;\n    int*        levels;\n    FT_Vector*  arc;\n\n\n    levels = ras.lev_stack;\n\n    arc      = ras.bez_stack;\n    arc[0].x = UPSCALE( to->x );\n    arc[0].y = UPSCALE( to->y );\n    arc[1].x = UPSCALE( control->x );\n    arc[1].y = UPSCALE( control->y );\n    arc[2].x = ras.x;\n    arc[2].y = ras.y;\n    top      = 0;\n\n    dx = FT_ABS( arc[2].x + arc[0].x - 2 * arc[1].x );\n    dy = FT_ABS( arc[2].y + arc[0].y - 2 * arc[1].y );\n    if ( dx < dy )\n      dx = dy;\n\n    if ( dx < ONE_PIXEL / 4 )\n      goto Draw;\n\n    /* short-cut the arc that crosses the current band */\n    min = max = arc[0].y;\n\n    y = arc[1].y;\n    if ( y < min ) min = y;\n    if ( y > max ) max = y;\n\n    y = arc[2].y;\n    if ( y < min ) min = y;\n    if ( y > max ) max = y;\n\n    if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < ras.min_ey )\n      goto Draw;\n\n    level = 0;\n    do\n    {\n      dx >>= 2;\n      level++;\n    } while ( dx > ONE_PIXEL / 4 );\n\n    levels[0] = level;\n\n    do\n    {\n      level = levels[top];\n      if ( level > 0 )\n      {\n        gray_split_conic( arc );\n        arc += 2;\n        top++;\n        levels[top] = levels[top - 1] = level - 1;\n        continue;\n      }\n\n    Draw:\n      gray_render_line( RAS_VAR_ arc[0].x, arc[0].y );\n      top--;\n      arc -= 2;\n\n    } while ( top >= 0 );\n  }\n\n\n  static void\n  gray_split_cubic( FT_Vector*  base )\n  {\n    TPos  a, b, c, d;\n\n\n    base[6].x = base[3].x;\n    c = base[1].x;\n    d = base[2].x;\n    base[1].x = a = ( base[0].x + c ) / 2;\n    base[5].x = b = ( base[3].x + d ) / 2;\n    c = ( c + d ) / 2;\n    base[2].x = a = ( a + c ) / 2;\n    base[4].x = b = ( b + c ) / 2;\n    base[3].x = ( a + b ) / 2;\n\n    base[6].y = base[3].y;\n    c = base[1].y;\n    d = base[2].y;\n    base[1].y = a = ( base[0].y + c ) / 2;\n    base[5].y = b = ( base[3].y + d ) / 2;\n    c = ( c + d ) / 2;\n    base[2].y = a = ( a + c ) / 2;\n    base[4].y = b = ( b + c ) / 2;\n    base[3].y = ( a + b ) / 2;\n  }\n\n\n  static void\n  gray_render_cubic( RAS_ARG_ const FT_Vector*  control1,\n                              const FT_Vector*  control2,\n                              const FT_Vector*  to )\n  {\n    FT_Vector*  arc;\n    TPos        min, max, y;\n\n\n    arc      = ras.bez_stack;\n    arc[0].x = UPSCALE( to->x );\n    arc[0].y = UPSCALE( to->y );\n    arc[1].x = UPSCALE( control2->x );\n    arc[1].y = UPSCALE( control2->y );\n    arc[2].x = UPSCALE( control1->x );\n    arc[2].y = UPSCALE( control1->y );\n    arc[3].x = ras.x;\n    arc[3].y = ras.y;\n\n    /* Short-cut the arc that crosses the current band. */\n    min = max = arc[0].y;\n\n    y = arc[1].y;\n    if ( y < min )\n      min = y;\n    if ( y > max )\n      max = y;\n\n    y = arc[2].y;\n    if ( y < min )\n      min = y;\n    if ( y > max )\n      max = y;\n\n    y = arc[3].y;\n    if ( y < min )\n      min = y;\n    if ( y > max )\n      max = y;\n\n    if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < ras.min_ey )\n      goto Draw;\n\n    for (;;)\n    {\n      /* Decide whether to split or draw. See `Rapid Termination          */\n      /* Evaluation for Recursive Subdivision of Bezier Curves' by Thomas */\n      /* F. Hain, at                                                      */\n      /* http://www.cis.southalabama.edu/~hain/general/Publications/Bezier/Camera-ready%20CISST02%202.pdf */\n\n      {\n        TPos  dx, dy, dx_, dy_;\n        TPos  dx1, dy1, dx2, dy2;\n        TPos  L, s, s_limit;\n\n\n        /* dx and dy are x and y components of the P0-P3 chord vector. */\n        dx = dx_ = arc[3].x - arc[0].x;\n        dy = dy_ = arc[3].y - arc[0].y;\n\n        L = FT_HYPOT( dx_, dy_ );\n\n        /* Avoid possible arithmetic overflow below by splitting. */\n        if ( L > 32767 )\n          goto Split;\n\n        /* Max deviation may be as much as (s/L) * 3/4 (if Hain's v = 1). */\n        s_limit = L * (TPos)( ONE_PIXEL / 6 );\n\n        /* s is L * the perpendicular distance from P1 to the line P0-P3. */\n        dx1 = arc[1].x - arc[0].x;\n        dy1 = arc[1].y - arc[0].y;\n        s = FT_ABS( dy * dx1 - dx * dy1 );\n\n        if ( s > s_limit )\n          goto Split;\n\n        /* s is L * the perpendicular distance from P2 to the line P0-P3. */\n        dx2 = arc[2].x - arc[0].x;\n        dy2 = arc[2].y - arc[0].y;\n        s = FT_ABS( dy * dx2 - dx * dy2 );\n\n        if ( s > s_limit )\n          goto Split;\n\n        /* Split super curvy segments where the off points are so far\n           from the chord that the angles P0-P1-P3 or P0-P2-P3 become\n           acute as detected by appropriate dot products. */\n        if ( dx1 * ( dx1 - dx ) + dy1 * ( dy1 - dy ) > 0 ||\n             dx2 * ( dx2 - dx ) + dy2 * ( dy2 - dy ) > 0 )\n          goto Split;\n\n        /* No reason to split. */\n        goto Draw;\n      }\n\n    Split:\n      gray_split_cubic( arc );\n      arc += 3;\n      continue;\n\n    Draw:\n      gray_render_line( RAS_VAR_ arc[0].x, arc[0].y );\n\n      if ( arc == ras.bez_stack )\n        return;\n\n      arc -= 3;\n    }\n  }\n\n\n  static int\n  gray_move_to( const FT_Vector*  to,\n                gray_PWorker      worker )\n  {\n    TPos  x, y;\n\n\n    /* record current cell, if any */\n    if ( !ras.invalid )\n      gray_record_cell( RAS_VAR );\n\n    /* start to a new position */\n    x = UPSCALE( to->x );\n    y = UPSCALE( to->y );\n\n    gray_start_cell( RAS_VAR_ TRUNC( x ), TRUNC( y ) );\n\n    worker->x = x;\n    worker->y = y;\n    return 0;\n  }\n\n\n  static int\n  gray_line_to( const FT_Vector*  to,\n                gray_PWorker      worker )\n  {\n    gray_render_line( RAS_VAR_ UPSCALE( to->x ), UPSCALE( to->y ) );\n    return 0;\n  }\n\n\n  static int\n  gray_conic_to( const FT_Vector*  control,\n                 const FT_Vector*  to,\n                 gray_PWorker      worker )\n  {\n    gray_render_conic( RAS_VAR_ control, to );\n    return 0;\n  }\n\n\n  static int\n  gray_cubic_to( const FT_Vector*  control1,\n                 const FT_Vector*  control2,\n                 const FT_Vector*  to,\n                 gray_PWorker      worker )\n  {\n    gray_render_cubic( RAS_VAR_ control1, control2, to );\n    return 0;\n  }\n\n\n  static void\n  gray_render_span( int             y,\n                    int             count,\n                    const FT_Span*  spans,\n                    gray_PWorker    worker )\n  {\n    unsigned char*  p;\n    FT_Bitmap*      map = &worker->target;\n\n\n    /* first of all, compute the scanline offset */\n    p = (unsigned char*)map->buffer - y * map->pitch;\n    if ( map->pitch >= 0 )\n      p += (unsigned)( ( map->rows - 1 ) * map->pitch );\n\n    for ( ; count > 0; count--, spans++ )\n    {\n      unsigned char  coverage = spans->coverage;\n\n\n      if ( coverage )\n      {\n        /* For small-spans it is faster to do it by ourselves than\n         * calling `memset'.  This is mainly due to the cost of the\n         * function call.\n         */\n        if ( spans->len >= 8 )\n          FT_MEM_SET( p + spans->x, (unsigned char)coverage, spans->len );\n        else\n        {\n          unsigned char*  q = p + spans->x;\n\n\n          switch ( spans->len )\n          {\n          case 7: *q++ = (unsigned char)coverage;\n          case 6: *q++ = (unsigned char)coverage;\n          case 5: *q++ = (unsigned char)coverage;\n          case 4: *q++ = (unsigned char)coverage;\n          case 3: *q++ = (unsigned char)coverage;\n          case 2: *q++ = (unsigned char)coverage;\n          case 1: *q   = (unsigned char)coverage;\n          default:\n            ;\n          }\n        }\n      }\n    }\n  }\n\n\n  static void\n  gray_hline( RAS_ARG_ TCoord  x,\n                       TCoord  y,\n                       TPos    area,\n                       TCoord  acount )\n  {\n    int  coverage;\n\n\n    /* compute the coverage line's coverage, depending on the    */\n    /* outline fill rule                                         */\n    /*                                                           */\n    /* the coverage percentage is area/(PIXEL_BITS*PIXEL_BITS*2) */\n    /*                                                           */\n    coverage = (int)( area >> ( PIXEL_BITS * 2 + 1 - 8 ) );\n                                                    /* use range 0..256 */\n    if ( coverage < 0 )\n      coverage = -coverage;\n\n    if ( ras.outline.flags & FT_OUTLINE_EVEN_ODD_FILL )\n    {\n      coverage &= 511;\n\n      if ( coverage > 256 )\n        coverage = 512 - coverage;\n      else if ( coverage == 256 )\n        coverage = 255;\n    }\n    else\n    {\n      /* normal non-zero winding rule */\n      if ( coverage >= 256 )\n        coverage = 255;\n    }\n\n    y += (TCoord)ras.min_ey;\n    x += (TCoord)ras.min_ex;\n\n    /* FT_Span.x is a 16-bit short, so limit our coordinates appropriately */\n    if ( x >= 32767 )\n      x = 32767;\n\n    /* FT_Span.y is an integer, so limit our coordinates appropriately */\n    if ( y >= FT_INT_MAX )\n      y = FT_INT_MAX;\n\n    if ( coverage )\n    {\n      FT_Span*  span;\n      int       count;\n\n\n      /* see whether we can add this span to the current list */\n      count = ras.num_gray_spans;\n      span  = ras.gray_spans + count - 1;\n      if ( count > 0                          &&\n           ras.span_y == y                    &&\n           (int)span->x + span->len == (int)x &&\n           span->coverage == coverage         )\n      {\n        span->len = (unsigned short)( span->len + acount );\n        return;\n      }\n\n      if ( ras.span_y != y || count >= FT_MAX_GRAY_SPANS )\n      {\n        if ( ras.render_span && count > 0 )\n          ras.render_span( ras.span_y, count, ras.gray_spans,\n                           ras.render_span_data );\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n        if ( count > 0 )\n        {\n          int  n;\n\n\n          FT_TRACE7(( \"y = %3d \", ras.span_y ));\n          span = ras.gray_spans;\n          for ( n = 0; n < count; n++, span++ )\n            FT_TRACE7(( \"[%d..%d]:%02x \",\n                        span->x, span->x + span->len - 1, span->coverage ));\n          FT_TRACE7(( \"\\n\" ));\n        }\n\n#endif /* FT_DEBUG_LEVEL_TRACE */\n\n        ras.num_gray_spans = 0;\n        ras.span_y         = (int)y;\n\n        span  = ras.gray_spans;\n      }\n      else\n        span++;\n\n      /* add a gray span to the current list */\n      span->x        = (short)x;\n      span->len      = (unsigned short)acount;\n      span->coverage = (unsigned char)coverage;\n\n      ras.num_gray_spans++;\n    }\n  }\n\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n  /* to be called while in the debugger --                                */\n  /* this function causes a compiler warning since it is unused otherwise */\n  static void\n  gray_dump_cells( RAS_ARG )\n  {\n    int  yindex;\n\n\n    for ( yindex = 0; yindex < ras.ycount; yindex++ )\n    {\n      PCell  cell;\n\n\n      printf( \"%3d:\", yindex );\n\n      for ( cell = ras.ycells[yindex]; cell != NULL; cell = cell->next )\n        printf( \" (%3ld, c:%4ld, a:%6d)\", cell->x, cell->cover, cell->area );\n      printf( \"\\n\" );\n    }\n  }\n\n#endif /* FT_DEBUG_LEVEL_TRACE */\n\n\n  static void\n  gray_sweep( RAS_ARG_ const FT_Bitmap*  target )\n  {\n    int  yindex;\n\n    FT_UNUSED( target );\n\n\n    if ( ras.num_cells == 0 )\n      return;\n\n    ras.num_gray_spans = 0;\n\n    FT_TRACE7(( \"gray_sweep: start\\n\" ));\n\n    for ( yindex = 0; yindex < ras.ycount; yindex++ )\n    {\n      PCell   cell  = ras.ycells[yindex];\n      TCoord  cover = 0;\n      TCoord  x     = 0;\n\n\n      for ( ; cell != NULL; cell = cell->next )\n      {\n        TPos  area;\n\n\n        if ( cell->x > x && cover != 0 )\n          gray_hline( RAS_VAR_ x, yindex, cover * ( ONE_PIXEL * 2 ),\n                      cell->x - x );\n\n        cover += cell->cover;\n        area   = cover * ( ONE_PIXEL * 2 ) - cell->area;\n\n        if ( area != 0 && cell->x >= 0 )\n          gray_hline( RAS_VAR_ cell->x, yindex, area, 1 );\n\n        x = cell->x + 1;\n      }\n\n      if ( cover != 0 )\n        gray_hline( RAS_VAR_ x, yindex, cover * ( ONE_PIXEL * 2 ),\n                    ras.count_ex - x );\n    }\n\n    if ( ras.render_span && ras.num_gray_spans > 0 )\n      ras.render_span( ras.span_y, ras.num_gray_spans,\n                       ras.gray_spans, ras.render_span_data );\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n    if ( ras.num_gray_spans > 0 )\n    {\n      FT_Span*  span;\n      int       n;\n\n\n      FT_TRACE7(( \"y = %3d \", ras.span_y ));\n      span = ras.gray_spans;\n      for ( n = 0; n < ras.num_gray_spans; n++, span++ )\n        FT_TRACE7(( \"[%d..%d]:%02x \",\n                    span->x, span->x + span->len - 1, span->coverage ));\n      FT_TRACE7(( \"\\n\" ));\n    }\n\n    FT_TRACE7(( \"gray_sweep: end\\n\" ));\n\n#endif /* FT_DEBUG_LEVEL_TRACE */\n\n  }\n\n\n#ifdef _STANDALONE_\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  The following function should only compile in stand-alone mode,      */\n  /*  i.e., when building this component without the rest of FreeType.     */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Decompose                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Walk over an outline's structure to decompose it into individual   */\n  /*    segments and Bézier arcs.  This function is also able to emit      */\n  /*    `move to' and `close to' operations to indicate the start and end  */\n  /*    of new contours in the outline.                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline        :: A pointer to the source target.                  */\n  /*                                                                       */\n  /*    func_interface :: A table of `emitters', i.e., function pointers   */\n  /*                      called during decomposition to indicate path     */\n  /*                      operations.                                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    user           :: A typeless pointer which is passed to each       */\n  /*                      emitter during the decomposition.  It can be     */\n  /*                      used to store the state during the               */\n  /*                      decomposition.                                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0 means success.                                      */\n  /*                                                                       */\n  static int\n  FT_Outline_Decompose( const FT_Outline*        outline,\n                        const FT_Outline_Funcs*  func_interface,\n                        void*                    user )\n  {\n#undef SCALED\n#define SCALED( x )  ( ( (x) << shift ) - delta )\n\n    FT_Vector   v_last;\n    FT_Vector   v_control;\n    FT_Vector   v_start;\n\n    FT_Vector*  point;\n    FT_Vector*  limit;\n    char*       tags;\n\n    int         error;\n\n    int   n;         /* index of contour in outline     */\n    int   first;     /* index of first point in contour */\n    char  tag;       /* current point's state           */\n\n    int   shift;\n    TPos  delta;\n\n\n    if ( !outline )\n      return FT_THROW( Invalid_Outline );\n\n    if ( !func_interface )\n      return FT_THROW( Invalid_Argument );\n\n    shift = func_interface->shift;\n    delta = func_interface->delta;\n    first = 0;\n\n    for ( n = 0; n < outline->n_contours; n++ )\n    {\n      int  last;  /* index of last point in contour */\n\n\n      FT_TRACE5(( \"FT_Outline_Decompose: Outline %d\\n\", n ));\n\n      last  = outline->contours[n];\n      if ( last < 0 )\n        goto Invalid_Outline;\n      limit = outline->points + last;\n\n      v_start   = outline->points[first];\n      v_start.x = SCALED( v_start.x );\n      v_start.y = SCALED( v_start.y );\n\n      v_last   = outline->points[last];\n      v_last.x = SCALED( v_last.x );\n      v_last.y = SCALED( v_last.y );\n\n      v_control = v_start;\n\n      point = outline->points + first;\n      tags  = outline->tags   + first;\n      tag   = FT_CURVE_TAG( tags[0] );\n\n      /* A contour cannot start with a cubic control point! */\n      if ( tag == FT_CURVE_TAG_CUBIC )\n        goto Invalid_Outline;\n\n      /* check first point to determine origin */\n      if ( tag == FT_CURVE_TAG_CONIC )\n      {\n        /* first point is conic control.  Yes, this happens. */\n        if ( FT_CURVE_TAG( outline->tags[last] ) == FT_CURVE_TAG_ON )\n        {\n          /* start at last point if it is on the curve */\n          v_start = v_last;\n          limit--;\n        }\n        else\n        {\n          /* if both first and last points are conic,         */\n          /* start at their middle and record its position    */\n          /* for closure                                      */\n          v_start.x = ( v_start.x + v_last.x ) / 2;\n          v_start.y = ( v_start.y + v_last.y ) / 2;\n\n          v_last = v_start;\n        }\n        point--;\n        tags--;\n      }\n\n      FT_TRACE5(( \"  move to (%.2f, %.2f)\\n\",\n                  v_start.x / 64.0, v_start.y / 64.0 ));\n      error = func_interface->move_to( &v_start, user );\n      if ( error )\n        goto Exit;\n\n      while ( point < limit )\n      {\n        point++;\n        tags++;\n\n        tag = FT_CURVE_TAG( tags[0] );\n        switch ( tag )\n        {\n        case FT_CURVE_TAG_ON:  /* emit a single line_to */\n          {\n            FT_Vector  vec;\n\n\n            vec.x = SCALED( point->x );\n            vec.y = SCALED( point->y );\n\n            FT_TRACE5(( \"  line to (%.2f, %.2f)\\n\",\n                        vec.x / 64.0, vec.y / 64.0 ));\n            error = func_interface->line_to( &vec, user );\n            if ( error )\n              goto Exit;\n            continue;\n          }\n\n        case FT_CURVE_TAG_CONIC:  /* consume conic arcs */\n          v_control.x = SCALED( point->x );\n          v_control.y = SCALED( point->y );\n\n        Do_Conic:\n          if ( point < limit )\n          {\n            FT_Vector  vec;\n            FT_Vector  v_middle;\n\n\n            point++;\n            tags++;\n            tag = FT_CURVE_TAG( tags[0] );\n\n            vec.x = SCALED( point->x );\n            vec.y = SCALED( point->y );\n\n            if ( tag == FT_CURVE_TAG_ON )\n            {\n              FT_TRACE5(( \"  conic to (%.2f, %.2f)\"\n                          \" with control (%.2f, %.2f)\\n\",\n                          vec.x / 64.0, vec.y / 64.0,\n                          v_control.x / 64.0, v_control.y / 64.0 ));\n              error = func_interface->conic_to( &v_control, &vec, user );\n              if ( error )\n                goto Exit;\n              continue;\n            }\n\n            if ( tag != FT_CURVE_TAG_CONIC )\n              goto Invalid_Outline;\n\n            v_middle.x = ( v_control.x + vec.x ) / 2;\n            v_middle.y = ( v_control.y + vec.y ) / 2;\n\n            FT_TRACE5(( \"  conic to (%.2f, %.2f)\"\n                        \" with control (%.2f, %.2f)\\n\",\n                        v_middle.x / 64.0, v_middle.y / 64.0,\n                        v_control.x / 64.0, v_control.y / 64.0 ));\n            error = func_interface->conic_to( &v_control, &v_middle, user );\n            if ( error )\n              goto Exit;\n\n            v_control = vec;\n            goto Do_Conic;\n          }\n\n          FT_TRACE5(( \"  conic to (%.2f, %.2f)\"\n                      \" with control (%.2f, %.2f)\\n\",\n                      v_start.x / 64.0, v_start.y / 64.0,\n                      v_control.x / 64.0, v_control.y / 64.0 ));\n          error = func_interface->conic_to( &v_control, &v_start, user );\n          goto Close;\n\n        default:  /* FT_CURVE_TAG_CUBIC */\n          {\n            FT_Vector  vec1, vec2;\n\n\n            if ( point + 1 > limit                             ||\n                 FT_CURVE_TAG( tags[1] ) != FT_CURVE_TAG_CUBIC )\n              goto Invalid_Outline;\n\n            point += 2;\n            tags  += 2;\n\n            vec1.x = SCALED( point[-2].x );\n            vec1.y = SCALED( point[-2].y );\n\n            vec2.x = SCALED( point[-1].x );\n            vec2.y = SCALED( point[-1].y );\n\n            if ( point <= limit )\n            {\n              FT_Vector  vec;\n\n\n              vec.x = SCALED( point->x );\n              vec.y = SCALED( point->y );\n\n              FT_TRACE5(( \"  cubic to (%.2f, %.2f)\"\n                          \" with controls (%.2f, %.2f) and (%.2f, %.2f)\\n\",\n                          vec.x / 64.0, vec.y / 64.0,\n                          vec1.x / 64.0, vec1.y / 64.0,\n                          vec2.x / 64.0, vec2.y / 64.0 ));\n              error = func_interface->cubic_to( &vec1, &vec2, &vec, user );\n              if ( error )\n                goto Exit;\n              continue;\n            }\n\n            FT_TRACE5(( \"  cubic to (%.2f, %.2f)\"\n                        \" with controls (%.2f, %.2f) and (%.2f, %.2f)\\n\",\n                        v_start.x / 64.0, v_start.y / 64.0,\n                        vec1.x / 64.0, vec1.y / 64.0,\n                        vec2.x / 64.0, vec2.y / 64.0 ));\n            error = func_interface->cubic_to( &vec1, &vec2, &v_start, user );\n            goto Close;\n          }\n        }\n      }\n\n      /* close the contour with a line segment */\n      FT_TRACE5(( \"  line to (%.2f, %.2f)\\n\",\n                  v_start.x / 64.0, v_start.y / 64.0 ));\n      error = func_interface->line_to( &v_start, user );\n\n   Close:\n      if ( error )\n        goto Exit;\n\n      first = last + 1;\n    }\n\n    FT_TRACE5(( \"FT_Outline_Decompose: Done\\n\", n ));\n    return 0;\n\n  Exit:\n    FT_TRACE5(( \"FT_Outline_Decompose: Error %d\\n\", error ));\n    return error;\n\n  Invalid_Outline:\n    return FT_THROW( Invalid_Outline );\n  }\n\n#endif /* _STANDALONE_ */\n\n\n  typedef struct  gray_TBand_\n  {\n    TPos  min, max;\n\n  } gray_TBand;\n\n    FT_DEFINE_OUTLINE_FUNCS(func_interface,\n      (FT_Outline_MoveTo_Func) gray_move_to,\n      (FT_Outline_LineTo_Func) gray_line_to,\n      (FT_Outline_ConicTo_Func)gray_conic_to,\n      (FT_Outline_CubicTo_Func)gray_cubic_to,\n      0,\n      0\n    )\n\n  static int\n  gray_convert_glyph_inner( RAS_ARG )\n  {\n\n    volatile int  error = 0;\n\n#ifdef FT_CONFIG_OPTION_PIC\n      FT_Outline_Funcs func_interface;\n      Init_Class_func_interface(&func_interface);\n#endif\n\n    if ( ft_setjmp( ras.jump_buffer ) == 0 )\n    {\n      error = FT_Outline_Decompose( &ras.outline, &func_interface, &ras );\n      if ( !ras.invalid )\n        gray_record_cell( RAS_VAR );\n    }\n    else\n      error = FT_THROW( Memory_Overflow );\n\n    return error;\n  }\n\n\n  static int\n  gray_convert_glyph( RAS_ARG )\n  {\n    gray_TBand            bands[40];\n    gray_TBand* volatile  band;\n    int volatile          n, num_bands;\n    TPos volatile         min, max, max_y;\n    FT_BBox*              clip;\n\n\n    /* Set up state in the raster object */\n    gray_compute_cbox( RAS_VAR );\n\n    /* clip to target bitmap, exit if nothing to do */\n    clip = &ras.clip_box;\n\n    if ( ras.max_ex <= clip->xMin || ras.min_ex >= clip->xMax ||\n         ras.max_ey <= clip->yMin || ras.min_ey >= clip->yMax )\n      return 0;\n\n    if ( ras.min_ex < clip->xMin ) ras.min_ex = clip->xMin;\n    if ( ras.min_ey < clip->yMin ) ras.min_ey = clip->yMin;\n\n    if ( ras.max_ex > clip->xMax ) ras.max_ex = clip->xMax;\n    if ( ras.max_ey > clip->yMax ) ras.max_ey = clip->yMax;\n\n    ras.count_ex = ras.max_ex - ras.min_ex;\n    ras.count_ey = ras.max_ey - ras.min_ey;\n\n    /* set up vertical bands */\n    num_bands = (int)( ( ras.max_ey - ras.min_ey ) / ras.band_size );\n    if ( num_bands == 0 )\n      num_bands = 1;\n    if ( num_bands >= 39 )\n      num_bands = 39;\n\n    ras.band_shoot = 0;\n\n    min   = ras.min_ey;\n    max_y = ras.max_ey;\n\n    for ( n = 0; n < num_bands; n++, min = max )\n    {\n      max = min + ras.band_size;\n      if ( n == num_bands - 1 || max > max_y )\n        max = max_y;\n\n      bands[0].min = min;\n      bands[0].max = max;\n      band         = bands;\n\n      while ( band >= bands )\n      {\n        TPos  bottom, top, middle;\n        int   error;\n\n        {\n          PCell  cells_max;\n          int    yindex;\n          long   cell_start, cell_end, cell_mod;\n\n\n          ras.ycells = (PCell*)ras.buffer;\n          ras.ycount = band->max - band->min;\n\n          cell_start = sizeof ( PCell ) * ras.ycount;\n          cell_mod   = cell_start % sizeof ( TCell );\n          if ( cell_mod > 0 )\n            cell_start += sizeof ( TCell ) - cell_mod;\n\n          cell_end  = ras.buffer_size;\n          cell_end -= cell_end % sizeof ( TCell );\n\n          cells_max = (PCell)( (char*)ras.buffer + cell_end );\n          ras.cells = (PCell)( (char*)ras.buffer + cell_start );\n          if ( ras.cells >= cells_max )\n            goto ReduceBands;\n\n          ras.max_cells = cells_max - ras.cells;\n          if ( ras.max_cells < 2 )\n            goto ReduceBands;\n\n          for ( yindex = 0; yindex < ras.ycount; yindex++ )\n            ras.ycells[yindex] = NULL;\n        }\n\n        ras.num_cells = 0;\n        ras.invalid   = 1;\n        ras.min_ey    = band->min;\n        ras.max_ey    = band->max;\n        ras.count_ey  = band->max - band->min;\n\n        error = gray_convert_glyph_inner( RAS_VAR );\n\n        if ( !error )\n        {\n          gray_sweep( RAS_VAR_ &ras.target );\n          band--;\n          continue;\n        }\n        else if ( error != ErrRaster_Memory_Overflow )\n          return 1;\n\n      ReduceBands:\n        /* render pool overflow; we will reduce the render band by half */\n        bottom = band->min;\n        top    = band->max;\n        middle = bottom + ( ( top - bottom ) >> 1 );\n\n        /* This is too complex for a single scanline; there must */\n        /* be some problems.                                     */\n        if ( middle == bottom )\n        {\n#ifdef FT_DEBUG_LEVEL_TRACE\n          FT_TRACE7(( \"gray_convert_glyph: rotten glyph\\n\" ));\n#endif\n          return 1;\n        }\n\n        if ( bottom-top >= ras.band_size )\n          ras.band_shoot++;\n\n        band[1].min = bottom;\n        band[1].max = middle;\n        band[0].min = middle;\n        band[0].max = top;\n        band++;\n      }\n    }\n\n    if ( ras.band_shoot > 8 && ras.band_size > 16 )\n      ras.band_size = ras.band_size / 2;\n\n    return 0;\n  }\n\n\n  static int\n  gray_raster_render( gray_PRaster             raster,\n                      const FT_Raster_Params*  params )\n  {\n    const FT_Outline*  outline    = (const FT_Outline*)params->source;\n    const FT_Bitmap*   target_map = params->target;\n    gray_PWorker       worker;\n\n\n    if ( !raster || !raster->buffer || !raster->buffer_size )\n      return FT_THROW( Invalid_Argument );\n\n    if ( !outline )\n      return FT_THROW( Invalid_Outline );\n\n    /* return immediately if the outline is empty */\n    if ( outline->n_points == 0 || outline->n_contours <= 0 )\n      return 0;\n\n    if ( !outline->contours || !outline->points )\n      return FT_THROW( Invalid_Outline );\n\n    if ( outline->n_points !=\n           outline->contours[outline->n_contours - 1] + 1 )\n      return FT_THROW( Invalid_Outline );\n\n    worker = raster->worker;\n\n    /* if direct mode is not set, we must have a target bitmap */\n    if ( !( params->flags & FT_RASTER_FLAG_DIRECT ) )\n    {\n      if ( !target_map )\n        return FT_THROW( Invalid_Argument );\n\n      /* nothing to do */\n      if ( !target_map->width || !target_map->rows )\n        return 0;\n\n      if ( !target_map->buffer )\n        return FT_THROW( Invalid_Argument );\n    }\n\n    /* this version does not support monochrome rendering */\n    if ( !( params->flags & FT_RASTER_FLAG_AA ) )\n      return FT_THROW( Invalid_Mode );\n\n    /* compute clipping box */\n    if ( !( params->flags & FT_RASTER_FLAG_DIRECT ) )\n    {\n      /* compute clip box from target pixmap */\n      ras.clip_box.xMin = 0;\n      ras.clip_box.yMin = 0;\n      ras.clip_box.xMax = target_map->width;\n      ras.clip_box.yMax = target_map->rows;\n    }\n    else if ( params->flags & FT_RASTER_FLAG_CLIP )\n      ras.clip_box = params->clip_box;\n    else\n    {\n      ras.clip_box.xMin = -32768L;\n      ras.clip_box.yMin = -32768L;\n      ras.clip_box.xMax =  32767L;\n      ras.clip_box.yMax =  32767L;\n    }\n\n    gray_init_cells( RAS_VAR_ raster->buffer, raster->buffer_size );\n\n    ras.outline        = *outline;\n    ras.num_cells      = 0;\n    ras.invalid        = 1;\n    ras.band_size      = raster->band_size;\n    ras.num_gray_spans = 0;\n\n    if ( params->flags & FT_RASTER_FLAG_DIRECT )\n    {\n      ras.render_span      = (FT_Raster_Span_Func)params->gray_spans;\n      ras.render_span_data = params->user;\n    }\n    else\n    {\n      ras.target           = *target_map;\n      ras.render_span      = (FT_Raster_Span_Func)gray_render_span;\n      ras.render_span_data = &ras;\n    }\n\n    return gray_convert_glyph( RAS_VAR );\n  }\n\n\n  /**** RASTER OBJECT CREATION: In stand-alone mode, we simply use *****/\n  /****                         a static object.                   *****/\n\n#ifdef _STANDALONE_\n\n  static int\n  gray_raster_new( void*       memory,\n                   FT_Raster*  araster )\n  {\n    static gray_TRaster  the_raster;\n\n    FT_UNUSED( memory );\n\n\n    *araster = (FT_Raster)&the_raster;\n    FT_MEM_ZERO( &the_raster, sizeof ( the_raster ) );\n\n    return 0;\n  }\n\n\n  static void\n  gray_raster_done( FT_Raster  raster )\n  {\n    /* nothing */\n    FT_UNUSED( raster );\n  }\n\n#else /* !_STANDALONE_ */\n\n  static int\n  gray_raster_new( FT_Memory   memory,\n                   FT_Raster*  araster )\n  {\n    FT_Error      error;\n    gray_PRaster  raster = NULL;\n\n\n    *araster = 0;\n    if ( !FT_ALLOC( raster, sizeof ( gray_TRaster ) ) )\n    {\n      raster->memory = memory;\n      *araster       = (FT_Raster)raster;\n    }\n\n    return error;\n  }\n\n\n  static void\n  gray_raster_done( FT_Raster  raster )\n  {\n    FT_Memory  memory = (FT_Memory)((gray_PRaster)raster)->memory;\n\n\n    FT_FREE( raster );\n  }\n\n#endif /* !_STANDALONE_ */\n\n\n  static void\n  gray_raster_reset( FT_Raster  raster,\n                     char*      pool_base,\n                     long       pool_size )\n  {\n    gray_PRaster  rast = (gray_PRaster)raster;\n\n\n    if ( raster )\n    {\n      if ( pool_base && pool_size >= (long)sizeof ( gray_TWorker ) + 2048 )\n      {\n        gray_PWorker  worker = (gray_PWorker)pool_base;\n\n\n        rast->worker      = worker;\n        rast->buffer      = pool_base +\n                              ( ( sizeof ( gray_TWorker ) +\n                                  sizeof ( TCell ) - 1 )  &\n                                ~( sizeof ( TCell ) - 1 ) );\n        rast->buffer_size = (long)( ( pool_base + pool_size ) -\n                                    (char*)rast->buffer ) &\n                                      ~( sizeof ( TCell ) - 1 );\n        rast->band_size   = (int)( rast->buffer_size /\n                                     ( sizeof ( TCell ) * 8 ) );\n      }\n      else\n      {\n        rast->buffer      = NULL;\n        rast->buffer_size = 0;\n        rast->worker      = NULL;\n      }\n    }\n  }\n\n\n  static int\n  gray_raster_set_mode( FT_Raster      raster,\n                        unsigned long  mode,\n                        void*          args )\n  {\n    FT_UNUSED( raster );\n    FT_UNUSED( mode );\n    FT_UNUSED( args );\n\n\n    return 0; /* nothing to do */\n  }\n\n\n  FT_DEFINE_RASTER_FUNCS(ft_grays_raster,\n    FT_GLYPH_FORMAT_OUTLINE,\n\n    (FT_Raster_New_Func)     gray_raster_new,\n    (FT_Raster_Reset_Func)   gray_raster_reset,\n    (FT_Raster_Set_Mode_Func)gray_raster_set_mode,\n    (FT_Raster_Render_Func)  gray_raster_render,\n    (FT_Raster_Done_Func)    gray_raster_done\n  )\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "ext/freetype2/src/smooth/ftgrays.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgrays.h                                                              */\n/*                                                                         */\n/*    FreeType smooth renderer declaration                                 */\n/*                                                                         */\n/*  Copyright 1996-2001 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTGRAYS_H__\n#define __FTGRAYS_H__\n\n#ifdef __cplusplus\n  extern \"C\" {\n#endif\n\n\n#ifdef _STANDALONE_\n#include \"ftimage.h\"\n#else\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H /* for FT_CONFIG_OPTION_PIC */\n#include FT_IMAGE_H\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* To make ftgrays.h independent from configuration files we check       */\n  /* whether FT_EXPORT_VAR has been defined already.                       */\n  /*                                                                       */\n  /* On some systems and compilers (Win32 mostly), an extra keyword is     */\n  /* necessary to compile the library as a DLL.                            */\n  /*                                                                       */\n#ifndef FT_EXPORT_VAR\n#define FT_EXPORT_VAR( x )  extern  x\n#endif\n\n  FT_EXPORT_VAR( const FT_Raster_Funcs )  ft_grays_raster;\n\n\n#ifdef __cplusplus\n  }\n#endif\n\n#endif /* __FTGRAYS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/smooth/ftsmerrs.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsmerrs.h                                                             */\n/*                                                                         */\n/*    smooth renderer error codes (specification only).                    */\n/*                                                                         */\n/*  Copyright 2001, 2012 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the smooth renderer error enumeration     */\n  /* constants.                                                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __FTSMERRS_H__\n#define __FTSMERRS_H__\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  Smooth_Err_\n#define FT_ERR_BASE    FT_Mod_Err_Smooth\n\n#include FT_ERRORS_H\n\n#endif /* __FTSMERRS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/smooth/ftsmooth.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsmooth.c                                                             */\n/*                                                                         */\n/*    Anti-aliasing renderer interface (body).                             */\n/*                                                                         */\n/*  Copyright 2000-2006, 2009-2013 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_OUTLINE_H\n#include \"ftsmooth.h\"\n#include \"ftgrays.h\"\n#include \"ftspic.h\"\n\n#include \"ftsmerrs.h\"\n\n\n  /* initialize renderer -- init its raster */\n  static FT_Error\n  ft_smooth_init( FT_Renderer  render )\n  {\n    FT_Library  library = FT_MODULE_LIBRARY( render );\n\n\n    render->clazz->raster_class->raster_reset( render->raster,\n                                               library->raster_pool,\n                                               library->raster_pool_size );\n\n    return 0;\n  }\n\n\n  /* sets render-specific mode */\n  static FT_Error\n  ft_smooth_set_mode( FT_Renderer  render,\n                      FT_ULong     mode_tag,\n                      FT_Pointer   data )\n  {\n    /* we simply pass it to the raster */\n    return render->clazz->raster_class->raster_set_mode( render->raster,\n                                                         mode_tag,\n                                                         data );\n  }\n\n  /* transform a given glyph image */\n  static FT_Error\n  ft_smooth_transform( FT_Renderer       render,\n                       FT_GlyphSlot      slot,\n                       const FT_Matrix*  matrix,\n                       const FT_Vector*  delta )\n  {\n    FT_Error  error = FT_Err_Ok;\n\n\n    if ( slot->format != render->glyph_format )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    if ( matrix )\n      FT_Outline_Transform( &slot->outline, matrix );\n\n    if ( delta )\n      FT_Outline_Translate( &slot->outline, delta->x, delta->y );\n\n  Exit:\n    return error;\n  }\n\n\n  /* return the glyph's control box */\n  static void\n  ft_smooth_get_cbox( FT_Renderer   render,\n                      FT_GlyphSlot  slot,\n                      FT_BBox*      cbox )\n  {\n    FT_MEM_ZERO( cbox, sizeof ( *cbox ) );\n\n    if ( slot->format == render->glyph_format )\n      FT_Outline_Get_CBox( &slot->outline, cbox );\n  }\n\n\n  /* convert a slot's glyph image into a bitmap */\n  static FT_Error\n  ft_smooth_render_generic( FT_Renderer       render,\n                            FT_GlyphSlot      slot,\n                            FT_Render_Mode    mode,\n                            const FT_Vector*  origin,\n                            FT_Render_Mode    required_mode )\n  {\n    FT_Error     error;\n    FT_Outline*  outline = &slot->outline;\n    FT_Bitmap*   bitmap  = &slot->bitmap;\n    FT_Memory    memory  = render->root.memory;\n    FT_BBox      cbox;\n    FT_Pos       x_shift = 0;\n    FT_Pos       y_shift = 0;\n    FT_Pos       x_left, y_top;\n    FT_Pos       width, height, pitch;\n#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING\n    FT_Pos       height_org, width_org;\n#endif\n    FT_Int       hmul    = mode == FT_RENDER_MODE_LCD;\n    FT_Int       vmul    = mode == FT_RENDER_MODE_LCD_V;\n\n    FT_Raster_Params  params;\n\n    FT_Bool  have_outline_shifted = FALSE;\n    FT_Bool  have_buffer          = FALSE;\n\n\n    /* check glyph image format */\n    if ( slot->format != render->glyph_format )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    /* check mode */\n    if ( mode != required_mode )\n    {\n      error = FT_THROW( Cannot_Render_Glyph );\n      goto Exit;\n    }\n\n    if ( origin )\n    {\n      x_shift = origin->x;\n      y_shift = origin->y;\n    }\n\n    /* compute the control box, and grid fit it */\n    /* taking into account the origin shift     */\n    FT_Outline_Get_CBox( outline, &cbox );\n\n    cbox.xMin = FT_PIX_FLOOR( cbox.xMin + x_shift );\n    cbox.yMin = FT_PIX_FLOOR( cbox.yMin + y_shift );\n    cbox.xMax = FT_PIX_CEIL( cbox.xMax + x_shift );\n    cbox.yMax = FT_PIX_CEIL( cbox.yMax + y_shift );\n\n    x_shift -= cbox.xMin;\n    y_shift -= cbox.yMin;\n\n    x_left  = cbox.xMin >> 6;\n    y_top   = cbox.yMax >> 6;\n\n    width  = (FT_ULong)( cbox.xMax - cbox.xMin ) >> 6;\n    height = (FT_ULong)( cbox.yMax - cbox.yMin ) >> 6;\n\n#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING\n    width_org  = width;\n    height_org = height;\n#endif\n\n    pitch = width;\n    if ( hmul )\n    {\n      width *= 3;\n      pitch  = FT_PAD_CEIL( width, 4 );\n    }\n\n    if ( vmul )\n      height *= 3;\n\n#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING\n\n    if ( slot->library->lcd_filter_func )\n    {\n      FT_Int  extra = slot->library->lcd_extra;\n\n\n      if ( hmul )\n      {\n        x_shift += 64 * ( extra >> 1 );\n        x_left  -= extra >> 1;\n        width   += 3 * extra;\n        pitch    = FT_PAD_CEIL( width, 4 );\n      }\n\n      if ( vmul )\n      {\n        y_shift += 64 * ( extra >> 1 );\n        y_top   += extra >> 1;\n        height  += 3 * extra;\n      }\n    }\n\n#endif\n\n    /*\n     * XXX: on 16bit system, we return an error for huge bitmap\n     * to prevent an overflow.\n     */\n    if ( x_left > FT_INT_MAX || y_top > FT_INT_MAX ||\n         x_left < FT_INT_MIN || y_top < FT_INT_MIN )\n    {\n      error = FT_THROW( Invalid_Pixel_Size );\n      goto Exit;\n    }\n\n    /* Required check is (pitch * height < FT_ULONG_MAX),        */\n    /* but we care realistic cases only.  Always pitch <= width. */\n    if ( width > 0x7FFF || height > 0x7FFF )\n    {\n      FT_ERROR(( \"ft_smooth_render_generic: glyph too large: %u x %u\\n\",\n                 width, height ));\n      error = FT_THROW( Raster_Overflow );\n      goto Exit;\n    }\n\n    /* release old bitmap buffer */\n    if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )\n    {\n      FT_FREE( bitmap->buffer );\n      slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;\n    }\n\n    /* allocate new one */\n    if ( FT_ALLOC( bitmap->buffer, (FT_ULong)pitch * height ) )\n      goto Exit;\n    else\n      have_buffer = TRUE;\n\n    slot->internal->flags |= FT_GLYPH_OWN_BITMAP;\n\n    slot->format      = FT_GLYPH_FORMAT_BITMAP;\n    slot->bitmap_left = (FT_Int)x_left;\n    slot->bitmap_top  = (FT_Int)y_top;\n\n    bitmap->pixel_mode = FT_PIXEL_MODE_GRAY;\n    bitmap->num_grays  = 256;\n    bitmap->width      = width;\n    bitmap->rows       = height;\n    bitmap->pitch      = pitch;\n\n    /* translate outline to render it into the bitmap */\n    if ( x_shift || y_shift )\n    {\n      FT_Outline_Translate( outline, x_shift, y_shift );\n      have_outline_shifted = TRUE;\n    }\n\n    /* set up parameters */\n    params.target = bitmap;\n    params.source = outline;\n    params.flags  = FT_RASTER_FLAG_AA;\n\n#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING\n\n    /* implode outline if needed */\n    {\n      FT_Vector*  points     = outline->points;\n      FT_Vector*  points_end = points + outline->n_points;\n      FT_Vector*  vec;\n\n\n      if ( hmul )\n        for ( vec = points; vec < points_end; vec++ )\n          vec->x *= 3;\n\n      if ( vmul )\n        for ( vec = points; vec < points_end; vec++ )\n          vec->y *= 3;\n    }\n\n    /* render outline into the bitmap */\n    error = render->raster_render( render->raster, &params );\n\n    /* deflate outline if needed */\n    {\n      FT_Vector*  points     = outline->points;\n      FT_Vector*  points_end = points + outline->n_points;\n      FT_Vector*  vec;\n\n\n      if ( hmul )\n        for ( vec = points; vec < points_end; vec++ )\n          vec->x /= 3;\n\n      if ( vmul )\n        for ( vec = points; vec < points_end; vec++ )\n          vec->y /= 3;\n    }\n\n    if ( error )\n      goto Exit;\n\n    if ( slot->library->lcd_filter_func )\n      slot->library->lcd_filter_func( bitmap, mode, slot->library );\n\n#else /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */\n\n    /* render outline into bitmap */\n    error = render->raster_render( render->raster, &params );\n    if ( error )\n      goto Exit;\n\n    /* expand it horizontally */\n    if ( hmul )\n    {\n      FT_Byte*  line = bitmap->buffer;\n      FT_UInt   hh;\n\n\n      for ( hh = height_org; hh > 0; hh--, line += pitch )\n      {\n        FT_UInt   xx;\n        FT_Byte*  end = line + width;\n\n\n        for ( xx = width_org; xx > 0; xx-- )\n        {\n          FT_UInt  pixel = line[xx-1];\n\n\n          end[-3] = (FT_Byte)pixel;\n          end[-2] = (FT_Byte)pixel;\n          end[-1] = (FT_Byte)pixel;\n          end    -= 3;\n        }\n      }\n    }\n\n    /* expand it vertically */\n    if ( vmul )\n    {\n      FT_Byte*  read  = bitmap->buffer + ( height - height_org ) * pitch;\n      FT_Byte*  write = bitmap->buffer;\n      FT_UInt   hh;\n\n\n      for ( hh = height_org; hh > 0; hh-- )\n      {\n        ft_memcpy( write, read, pitch );\n        write += pitch;\n\n        ft_memcpy( write, read, pitch );\n        write += pitch;\n\n        ft_memcpy( write, read, pitch );\n        write += pitch;\n        read  += pitch;\n      }\n    }\n\n#endif /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */\n\n    /* everything is fine; don't deallocate buffer */\n    have_buffer = FALSE;\n\n    error = FT_Err_Ok;\n\n  Exit:\n    if ( have_outline_shifted )\n      FT_Outline_Translate( outline, -x_shift, -y_shift );\n    if ( have_buffer )\n    {\n      FT_FREE( bitmap->buffer );\n      slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;\n    }\n\n    return error;\n  }\n\n\n  /* convert a slot's glyph image into a bitmap */\n  static FT_Error\n  ft_smooth_render( FT_Renderer       render,\n                    FT_GlyphSlot      slot,\n                    FT_Render_Mode    mode,\n                    const FT_Vector*  origin )\n  {\n    if ( mode == FT_RENDER_MODE_LIGHT )\n      mode = FT_RENDER_MODE_NORMAL;\n\n    return ft_smooth_render_generic( render, slot, mode, origin,\n                                     FT_RENDER_MODE_NORMAL );\n  }\n\n\n  /* convert a slot's glyph image into a horizontal LCD bitmap */\n  static FT_Error\n  ft_smooth_render_lcd( FT_Renderer       render,\n                        FT_GlyphSlot      slot,\n                        FT_Render_Mode    mode,\n                        const FT_Vector*  origin )\n  {\n    FT_Error  error;\n\n    error = ft_smooth_render_generic( render, slot, mode, origin,\n                                      FT_RENDER_MODE_LCD );\n    if ( !error )\n      slot->bitmap.pixel_mode = FT_PIXEL_MODE_LCD;\n\n    return error;\n  }\n\n\n  /* convert a slot's glyph image into a vertical LCD bitmap */\n  static FT_Error\n  ft_smooth_render_lcd_v( FT_Renderer       render,\n                          FT_GlyphSlot      slot,\n                          FT_Render_Mode    mode,\n                          const FT_Vector*  origin )\n  {\n    FT_Error  error;\n\n    error = ft_smooth_render_generic( render, slot, mode, origin,\n                                      FT_RENDER_MODE_LCD_V );\n    if ( !error )\n      slot->bitmap.pixel_mode = FT_PIXEL_MODE_LCD_V;\n\n    return error;\n  }\n\n\n  FT_DEFINE_RENDERER( ft_smooth_renderer_class,\n\n      FT_MODULE_RENDERER,\n      sizeof ( FT_RendererRec ),\n\n      \"smooth\",\n      0x10000L,\n      0x20000L,\n\n      0,    /* module specific interface */\n\n      (FT_Module_Constructor)ft_smooth_init,\n      (FT_Module_Destructor) 0,\n      (FT_Module_Requester)  0\n    ,\n\n    FT_GLYPH_FORMAT_OUTLINE,\n\n    (FT_Renderer_RenderFunc)   ft_smooth_render,\n    (FT_Renderer_TransformFunc)ft_smooth_transform,\n    (FT_Renderer_GetCBoxFunc)  ft_smooth_get_cbox,\n    (FT_Renderer_SetModeFunc)  ft_smooth_set_mode,\n\n    (FT_Raster_Funcs*)    &FT_GRAYS_RASTER_GET\n  )\n\n\n  FT_DEFINE_RENDERER( ft_smooth_lcd_renderer_class,\n\n      FT_MODULE_RENDERER,\n      sizeof ( FT_RendererRec ),\n\n      \"smooth-lcd\",\n      0x10000L,\n      0x20000L,\n\n      0,    /* module specific interface */\n\n      (FT_Module_Constructor)ft_smooth_init,\n      (FT_Module_Destructor) 0,\n      (FT_Module_Requester)  0\n    ,\n\n    FT_GLYPH_FORMAT_OUTLINE,\n\n    (FT_Renderer_RenderFunc)   ft_smooth_render_lcd,\n    (FT_Renderer_TransformFunc)ft_smooth_transform,\n    (FT_Renderer_GetCBoxFunc)  ft_smooth_get_cbox,\n    (FT_Renderer_SetModeFunc)  ft_smooth_set_mode,\n\n    (FT_Raster_Funcs*)    &FT_GRAYS_RASTER_GET\n  )\n\n  FT_DEFINE_RENDERER( ft_smooth_lcdv_renderer_class,\n\n      FT_MODULE_RENDERER,\n      sizeof ( FT_RendererRec ),\n\n      \"smooth-lcdv\",\n      0x10000L,\n      0x20000L,\n\n      0,    /* module specific interface */\n\n      (FT_Module_Constructor)ft_smooth_init,\n      (FT_Module_Destructor) 0,\n      (FT_Module_Requester)  0\n    ,\n\n    FT_GLYPH_FORMAT_OUTLINE,\n\n    (FT_Renderer_RenderFunc)   ft_smooth_render_lcd_v,\n    (FT_Renderer_TransformFunc)ft_smooth_transform,\n    (FT_Renderer_GetCBoxFunc)  ft_smooth_get_cbox,\n    (FT_Renderer_SetModeFunc)  ft_smooth_set_mode,\n\n    (FT_Raster_Funcs*)    &FT_GRAYS_RASTER_GET\n  )\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/smooth/ftsmooth.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsmooth.h                                                             */\n/*                                                                         */\n/*    Anti-aliasing renderer interface (specification).                    */\n/*                                                                         */\n/*  Copyright 1996-2001 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTSMOOTH_H__\n#define __FTSMOOTH_H__\n\n\n#include <ft2build.h>\n#include FT_RENDER_H\n\n\nFT_BEGIN_HEADER\n\n\n#ifndef FT_CONFIG_OPTION_NO_STD_RASTER\n  FT_DECLARE_RENDERER( ft_std_renderer_class )\n#endif\n\n#ifndef FT_CONFIG_OPTION_NO_SMOOTH_RASTER\n  FT_DECLARE_RENDERER( ft_smooth_renderer_class )\n\n  FT_DECLARE_RENDERER( ft_smooth_lcd_renderer_class )\n\n  FT_DECLARE_RENDERER( ft_smooth_lcd_v_renderer_class )\n#endif\n\n\n\nFT_END_HEADER\n\n#endif /* __FTSMOOTH_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/smooth/ftspic.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftspic.c                                                               */\n/*                                                                         */\n/*    The FreeType position independent code services for smooth module.   */\n/*                                                                         */\n/*  Copyright 2009, 2010, 2012, 2013 by                                    */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_INTERNAL_OBJECTS_H\n#include \"ftspic.h\"\n#include \"ftsmerrs.h\"\n\n\n#ifdef FT_CONFIG_OPTION_PIC\n\n  /* forward declaration of PIC init functions from ftgrays.c */\n  void\n  FT_Init_Class_ft_grays_raster( FT_Raster_Funcs*  funcs );\n\n\n  void\n  ft_smooth_renderer_class_pic_free( FT_Library  library )\n  {\n    FT_PIC_Container*  pic_container = &library->pic_container;\n    FT_Memory          memory        = library->memory;\n\n\n    if ( pic_container->smooth )\n    {\n      SmoothPIC*  container = (SmoothPIC*)pic_container->smooth;\n\n\n      if ( --container->ref_count )\n        return;\n\n      FT_FREE( container );\n      pic_container->smooth = NULL;\n    }\n  }\n\n\n  FT_Error\n  ft_smooth_renderer_class_pic_init( FT_Library  library )\n  {\n    FT_PIC_Container*  pic_container = &library->pic_container;\n    FT_Error           error         = FT_Err_Ok;\n    SmoothPIC*         container     = NULL;\n    FT_Memory          memory        = library->memory;\n\n\n    /* since this function also serve smooth_lcd and smooth_lcdv renderers,\n       it implements reference counting */\n    if ( pic_container->smooth )\n    {\n      ((SmoothPIC*)pic_container->smooth)->ref_count++;\n      return error;\n    }\n\n    /* allocate pointer, clear and set global container pointer */\n    if ( FT_ALLOC( container, sizeof ( *container ) ) )\n      return error;\n    FT_MEM_SET( container, 0, sizeof ( *container ) );\n    pic_container->smooth = container;\n\n    container->ref_count = 1;\n\n    /* initialize pointer table -                       */\n    /* this is how the module usually expects this data */\n    FT_Init_Class_ft_grays_raster( &container->ft_grays_raster );\n\n    return error;\n  }\n\n\n  /* re-route these init and free functions to the above functions */\n  FT_Error\n  ft_smooth_lcd_renderer_class_pic_init( FT_Library  library )\n  {\n    return ft_smooth_renderer_class_pic_init( library );\n  }\n\n\n  void\n  ft_smooth_lcd_renderer_class_pic_free( FT_Library  library )\n  {\n    ft_smooth_renderer_class_pic_free( library );\n  }\n\n\n  FT_Error\n  ft_smooth_lcdv_renderer_class_pic_init( FT_Library  library )\n  {\n    return ft_smooth_renderer_class_pic_init( library );\n  }\n\n\n  void\n  ft_smooth_lcdv_renderer_class_pic_free( FT_Library  library )\n  {\n    ft_smooth_renderer_class_pic_free( library );\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/smooth/ftspic.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftspic.h                                                               */\n/*                                                                         */\n/*    The FreeType position independent code services for smooth module.   */\n/*                                                                         */\n/*  Copyright 2009 by                                                      */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTSPIC_H__\n#define __FTSPIC_H__\n\n\nFT_BEGIN_HEADER\n\n#include FT_INTERNAL_PIC_H\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define FT_GRAYS_RASTER_GET  ft_grays_raster\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n  typedef struct  SmoothPIC_\n  {\n    int              ref_count;\n    FT_Raster_Funcs  ft_grays_raster;\n\n  } SmoothPIC;\n\n\n#define GET_PIC( lib ) \\\n          ( (SmoothPIC*)( (lib)->pic_container.smooth ) )\n#define FT_GRAYS_RASTER_GET  ( GET_PIC( library )->ft_grays_raster )\n\n\n  /* see ftspic.c for the implementation */\n  void\n  ft_smooth_renderer_class_pic_free( FT_Library  library );\n\n  void\n  ft_smooth_lcd_renderer_class_pic_free( FT_Library  library );\n\n  void\n  ft_smooth_lcdv_renderer_class_pic_free( FT_Library  library );\n\n  FT_Error\n  ft_smooth_renderer_class_pic_init( FT_Library  library );\n\n  FT_Error\n  ft_smooth_lcd_renderer_class_pic_init( FT_Library  library );\n\n  FT_Error\n  ft_smooth_lcdv_renderer_class_pic_init( FT_Library  library );\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTSPIC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/smooth/module.mk",
    "content": "#\n# FreeType 2 smooth renderer module definition\n#\n\n\n# Copyright 1996-2000, 2006 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\nFTMODULE_H_COMMANDS += SMOOTH_RENDERER\n\ndefine SMOOTH_RENDERER\n$(OPEN_DRIVER) FT_Renderer_Class, ft_smooth_renderer_class $(CLOSE_DRIVER)\n$(ECHO_DRIVER)smooth    $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer$(ECHO_DRIVER_DONE)\n$(OPEN_DRIVER) FT_Renderer_Class, ft_smooth_lcd_renderer_class $(CLOSE_DRIVER)\n$(ECHO_DRIVER)smooth    $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer for LCDs$(ECHO_DRIVER_DONE)\n$(OPEN_DRIVER) FT_Renderer_Class, ft_smooth_lcdv_renderer_class $(CLOSE_DRIVER)\n$(ECHO_DRIVER)smooth    $(ECHO_DRIVER_DESC)anti-aliased bitmap renderer for vertical LCDs$(ECHO_DRIVER_DONE)\nendef\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/smooth/rules.mk",
    "content": "#\n# FreeType 2 smooth renderer module build rules\n#\n\n\n# Copyright 1996-2000, 2001, 2003, 2011 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\n# smooth driver directory\n#\nSMOOTH_DIR := $(SRC_DIR)/smooth\n\n# compilation flags for the driver\n#\nSMOOTH_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SMOOTH_DIR))\n\n\n# smooth driver sources (i.e., C files)\n#\nSMOOTH_DRV_SRC := $(SMOOTH_DIR)/ftgrays.c  \\\n                  $(SMOOTH_DIR)/ftsmooth.c \\\n                  $(SMOOTH_DIR)/ftspic.c\n\n\n# smooth driver headers\n#\nSMOOTH_DRV_H := $(SMOOTH_DRV_SRC:%c=%h)  \\\n                $(SMOOTH_DIR)/ftsmerrs.h\n\n\n# smooth driver object(s)\n#\n#   SMOOTH_DRV_OBJ_M is used during `multi' builds.\n#   SMOOTH_DRV_OBJ_S is used during `single' builds.\n#\nSMOOTH_DRV_OBJ_M := $(SMOOTH_DRV_SRC:$(SMOOTH_DIR)/%.c=$(OBJ_DIR)/%.$O)\nSMOOTH_DRV_OBJ_S := $(OBJ_DIR)/smooth.$O\n\n# smooth driver source file for single build\n#\nSMOOTH_DRV_SRC_S := $(SMOOTH_DIR)/smooth.c\n\n\n# smooth driver - single object\n#\n$(SMOOTH_DRV_OBJ_S): $(SMOOTH_DRV_SRC_S) $(SMOOTH_DRV_SRC) \\\n                     $(FREETYPE_H) $(SMOOTH_DRV_H)\n\t$(SMOOTH_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(SMOOTH_DRV_SRC_S))\n\n\n# smooth driver - multiple objects\n#\n$(OBJ_DIR)/%.$O: $(SMOOTH_DIR)/%.c $(FREETYPE_H) $(SMOOTH_DRV_H)\n\t$(SMOOTH_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\n\n\n# update main driver object lists\n#\nDRV_OBJS_S += $(SMOOTH_DRV_OBJ_S)\nDRV_OBJS_M += $(SMOOTH_DRV_OBJ_M)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/smooth/smooth.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  smooth.c                                                               */\n/*                                                                         */\n/*    FreeType anti-aliasing rasterer module component (body only).        */\n/*                                                                         */\n/*  Copyright 1996-2001 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#define FT_MAKE_OPTION_SINGLE_OBJECT\n\n#include <ft2build.h>\n#include \"ftspic.c\"\n#include \"ftgrays.c\"\n#include \"ftsmooth.c\"\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/tools/Jamfile",
    "content": "# Jamfile for src/tools\n#\nSubDir FT2_TOP src tools ;\n\nMain  apinames : apinames.c ;\n"
  },
  {
    "path": "ext/freetype2/src/tools/afblue.pl",
    "content": "#! /usr/bin/perl -w\n# -*- Perl -*-\n#\n# afblue.pl\n#\n# Process a blue zone character data file.\n#\n# Copyright 2013, 2014 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used,\n# modified, and distributed under the terms of the FreeType project\n# license, LICENSE.TXT.  By continuing to use, modify, or distribute\n# this file you indicate that you have read the license and\n# understand and accept it fully.\n\nuse strict;\nuse warnings;\nuse English '-no_match_vars';\nuse open ':std', ':encoding(UTF-8)';\n\n\nmy $prog = $PROGRAM_NAME;\n$prog =~ s| .* / ||x;      # Remove path.\n\ndie \"usage: $prog datafile < infile > outfile\\n\" if $#ARGV != 0;\n\n\nmy $datafile = $ARGV[0];\n\nmy %diversions;        # The extracted and massaged data from `datafile'.\nmy @else_stack;        # Booleans to track else-clauses.\nmy @name_stack;        # Stack of integers used for names of aux. variables.\n\nmy $curr_enum;         # Name of the current enumeration.\nmy $curr_array;        # Name of the current array.\nmy $curr_max;          # Name of the current maximum value.\n\nmy $curr_enum_element; # Name of the current enumeration element.\nmy $curr_offset;       # The offset relative to current aux. variable.\nmy $curr_elem_size;    # The size of the current string or block.\n\nmy $have_sections = 0; # Boolean; set if start of a section has been seen.\nmy $have_strings;      # Boolean; set if current section contains strings.\nmy $have_blocks;       # Boolean; set if current section contains blocks.\n\nmy $have_enum_element; # Boolean; set if we have an enumeration element.\nmy $in_string;         # Boolean; set if a string has been parsed.\n\nmy $num_sections = 0;  # Number of sections seen so far.\n\nmy $last_aux;          # Name of last auxiliary variable.\n\n\n# Regular expressions.\n\n# [<ws>] <enum_name> <ws> <array_name> <ws> <max_name> [<ws>] ':' [<ws>] '\\n'\nmy $section_re = qr/ ^ \\s* (\\S+) \\s+ (\\S+) \\s+ (\\S+) \\s* : \\s* $ /x;\n\n# [<ws>] <enum_element_name> [<ws>] '\\n'\nmy $enum_element_re = qr/ ^ \\s* ( [A-Za-z0-9_]+ ) \\s* $ /x;\n\n# '#' <preprocessor directive> '\\n'\nmy $preprocessor_re = qr/ ^ \\# /x;\n\n# [<ws>] '/' '/' <comment> '\\n'\nmy $comment_re = qr| ^ \\s* // |x;\n\n# empty line\nmy $whitespace_only_re = qr/ ^ \\s* $ /x;\n\n# [<ws>] '\"' <string> '\"' [<ws>] '\\n'  (<string> doesn't contain newlines)\nmy $string_re = qr/ ^ \\s*\n                       \" ( (?> (?: (?> [^\"\\\\]+ ) | \\\\. )* ) ) \"\n                       \\s* $ /x;\n\n# [<ws>] '{' <block> '}' [<ws>] '\\n'  (<block> can contain newlines)\nmy $block_start_re = qr/ ^ \\s* \\{ /x;\n\n# We need the capturing group for `split' to make it return the separator\n# tokens (i.e., the opening and closing brace) also.\nmy $brace_re = qr/ ( [{}] ) /x;\n\n\nsub Warn\n{\n  my $message = shift;\n  warn \"$datafile:$INPUT_LINE_NUMBER: warning: $message\\n\";\n}\n\n\nsub Die\n{\n  my $message = shift;\n  die \"$datafile:$INPUT_LINE_NUMBER: error: $message\\n\";\n}\n\n\nmy $warned_before = 0;\n\nsub warn_before\n{\n  Warn(\"data before first section gets ignored\") unless $warned_before;\n  $warned_before = 1;\n}\n\n\nsub strip_newline\n{\n  chomp;\n  s/ \\x0D $ //x;\n}\n\n\nsub end_curr_string\n{\n  # Append final null byte to string.\n  if ($have_strings)\n  {\n    push @{$diversions{$curr_array}}, \"    '\\\\0',\\n\" if $in_string;\n\n    $curr_offset++;\n    $in_string = 0;\n  }\n}\n\n\nsub update_max_elem_size\n{\n  if ($curr_elem_size)\n  {\n    my $max = pop @{$diversions{$curr_max}};\n    $max = $curr_elem_size if $curr_elem_size > $max;\n    push @{$diversions{$curr_max}}, $max;\n  }\n}\n\n\nsub convert_non_ascii_char\n{\n  # A UTF-8 character outside of the printable ASCII range, with possibly a\n  # leading backslash character.\n  my $s = shift;\n\n  # Here we count characters, not bytes.\n  $curr_elem_size += length $s;\n\n  utf8::encode($s);\n  $s = uc unpack 'H*', $s;\n\n  $curr_offset += $s =~ s/\\G(..)/'\\\\x$1', /sg;\n\n  return $s;\n}\n\n\nsub convert_ascii_chars\n{\n  # A series of ASCII characters in the printable range.\n  my $s = shift;\n\n  # We ignore spaces.\n  $s =~ s/ //g;\n\n  my $count = $s =~ s/\\G(.)/'$1', /g;\n  $curr_offset += $count;\n  $curr_elem_size += $count;\n\n  return $s;\n}\n\n\nsub convert_literal\n{\n  my $s = shift;\n  my $orig = $s;\n\n  # ASCII printables and space\n  my $safe_re = '\\x20-\\x7E';\n  # ASCII printables and space, no backslash\n  my $safe_no_backslash_re = '\\x20-\\x5B\\x5D-\\x7E';\n\n  $s =~ s{\n           (?: \\\\? ( [^$safe_re] )\n               | ( (?: [$safe_no_backslash_re]\n                       | \\\\ [$safe_re] )+ ) )\n         }\n         {\n           defined($1) ? convert_non_ascii_char($1)\n                       : convert_ascii_chars($2)\n         }egx;\n\n   # We assume that `$orig' doesn't contain `*/'\n   return $s . \" /* $orig */\";\n}\n\n\nsub aux_name\n{\n  return \"af_blue_\" . $num_sections. \"_\" . join('_', @name_stack);\n}\n\n\nsub aux_name_next\n{\n  $name_stack[$#name_stack]++;\n  my $name = aux_name();\n  $name_stack[$#name_stack]--;\n\n  return $name;\n}\n\n\nsub enum_val_string\n{\n  # Build string that holds code to save the current offset in an\n  # enumeration element.\n  my $aux = shift;\n\n  my $add = ($last_aux eq \"af_blue_\" . $num_sections . \"_0\" )\n              ? \"\"\n              : \"$last_aux + \";\n\n  return \"    $aux = $add$curr_offset,\\n\";\n}\n\n\n\n# Process data file.\n\nopen(DATA, $datafile) || die \"$prog: can't open \\`$datafile': $OS_ERROR\\n\";\n\nwhile (<DATA>)\n{\n  strip_newline();\n\n  next if /$comment_re/;\n  next if /$whitespace_only_re/;\n\n  if (/$section_re/)\n  {\n    Warn(\"previous section is empty\") if ($have_sections\n                                          && !$have_strings\n                                          && !$have_blocks);\n\n    end_curr_string();\n    update_max_elem_size();\n\n    # Save captured groups from `section_re'.\n    $curr_enum = $1;\n    $curr_array = $2;\n    $curr_max = $3;\n\n    $curr_enum_element = \"\";\n    $curr_offset = 0;\n\n    Warn(\"overwriting already defined enumeration \\`$curr_enum'\")\n      if exists($diversions{$curr_enum});\n    Warn(\"overwriting already defined array \\`$curr_array'\")\n      if exists($diversions{$curr_array});\n    Warn(\"overwriting already defined maximum value \\`$curr_max'\")\n      if exists($diversions{$curr_max});\n\n    $diversions{$curr_enum} = [];\n    $diversions{$curr_array} = [];\n    $diversions{$curr_max} = [];\n\n    push @{$diversions{$curr_max}}, 0;\n\n    @name_stack = ();\n    push @name_stack, 0;\n\n    $have_sections = 1;\n    $have_strings = 0;\n    $have_blocks = 0;\n\n    $have_enum_element = 0;\n    $in_string = 0;\n\n    $num_sections++;\n    $curr_elem_size = 0;\n\n    $last_aux = aux_name();\n\n    next;\n  }\n\n  if (/$preprocessor_re/)\n  {\n    if ($have_sections)\n    {\n      # Having preprocessor conditionals complicates the computation of\n      # correct offset values.  We have to introduce auxiliary enumeration\n      # elements with the name `af_blue_<s>_<n1>_<n2>_...' that store\n      # offsets to be used in conditional clauses.  `<s>' is the number of\n      # sections seen so far, `<n1>' is the number of `#if' and `#endif'\n      # conditionals seen so far in the topmost level, `<n2>' the number of\n      # `#if' and `#endif' conditionals seen so far one level deeper, etc.\n      # As a consequence, uneven values are used within a clause, and even\n      # values after a clause, since the C standard doesn't allow the\n      # redefinition of an enumeration value.  For example, the name\n      # `af_blue_5_1_6' is used to construct enumeration values in the fifth\n      # section after the third (second-level) if-clause within the first\n      # (top-level) if-clause.  After the first top-level clause has\n      # finished, `af_blue_5_2' is used.  The current offset is then\n      # relative to the value stored in the current auxiliary element.\n\n      if (/ ^ \\# \\s* if /x)\n      {\n        push @else_stack, 0;\n\n        $name_stack[$#name_stack]++;\n\n        push @{$diversions{$curr_enum}}, enum_val_string(aux_name());\n        $last_aux = aux_name();\n\n        push @name_stack, 0;\n\n        $curr_offset = 0;\n      }\n      elsif (/ ^ \\# \\s* elif /x)\n      {\n        Die(\"unbalanced #elif\") unless @else_stack;\n\n        pop @name_stack;\n\n        push @{$diversions{$curr_enum}}, enum_val_string(aux_name_next());\n        $last_aux = aux_name();\n\n        push @name_stack, 0;\n\n        $curr_offset = 0;\n      }\n      elsif (/ ^ \\# \\s* else /x)\n      {\n        my $prev_else = pop @else_stack;\n        Die(\"unbalanced #else\") unless defined($prev_else);\n        Die(\"#else already seen\") if $prev_else;\n        push @else_stack, 1;\n\n        pop @name_stack;\n\n        push @{$diversions{$curr_enum}}, enum_val_string(aux_name_next());\n        $last_aux = aux_name();\n\n        push @name_stack, 0;\n\n        $curr_offset = 0;\n      }\n      elsif (/ ^ (\\# \\s*) endif /x)\n      {\n        my $prev_else = pop @else_stack;\n        Die(\"unbalanced #endif\") unless defined($prev_else);\n\n        pop @name_stack;\n\n        # If there is no else-clause for an if-clause, we add one.  This is\n        # necessary to have correct offsets.\n        if (!$prev_else)\n        {\n          # Use amount of whitespace from `endif'.\n          push @{$diversions{$curr_enum}}, enum_val_string(aux_name_next())\n                                           . $1 . \"else\\n\";\n          $last_aux = aux_name();\n\n          $curr_offset = 0;\n        }\n\n        $name_stack[$#name_stack]++;\n\n        push @{$diversions{$curr_enum}}, enum_val_string(aux_name());\n        $last_aux = aux_name();\n\n        $curr_offset = 0;\n      }\n\n      # Handle (probably continued) preprocessor lines.\n    CONTINUED_LOOP:\n      {\n        do\n        {\n          strip_newline();\n\n          push @{$diversions{$curr_enum}}, $ARG . \"\\n\";\n          push @{$diversions{$curr_array}}, $ARG . \"\\n\";\n\n          last CONTINUED_LOOP unless / \\\\ $ /x;\n\n        } while (<DATA>);\n      }\n    }\n    else\n    {\n      warn_before();\n    }\n\n    next;\n  }\n\n  if (/$enum_element_re/)\n  {\n    end_curr_string();\n    update_max_elem_size();\n\n    $curr_enum_element = $1;\n    $have_enum_element = 1;\n    $curr_elem_size = 0;\n\n    next;\n  }\n\n  if (/$string_re/)\n  {\n    if ($have_sections)\n    {\n      Die(\"strings and blocks can't be mixed in a section\") if $have_blocks;\n\n      # Save captured group from `string_re'.\n      my $string = $1;\n\n      if ($have_enum_element)\n      {\n        push @{$diversions{$curr_enum}}, enum_val_string($curr_enum_element);\n        $have_enum_element = 0;\n      }\n\n      $string = convert_literal($string);\n\n      push @{$diversions{$curr_array}}, \"    $string\\n\";\n\n      $have_strings = 1;\n      $in_string = 1;\n    }\n    else\n    {\n      warn_before();\n    }\n\n    next;\n  }\n\n  if (/$block_start_re/)\n  {\n    if ($have_sections)\n    {\n      Die(\"strings and blocks can't be mixed in a section\") if $have_strings;\n\n      my $depth = 0;\n      my $block = \"\";\n      my $block_end = 0;\n\n      # Count braces while getting the block.\n    BRACE_LOOP:\n      {\n        do\n        {\n          strip_newline();\n\n          foreach my $substring (split(/$brace_re/))\n          {\n            if ($block_end)\n            {\n              Die(\"invalid data after last matching closing brace\")\n                if $substring !~ /$whitespace_only_re/;\n            }\n\n            $block .= $substring;\n\n            if ($substring eq '{')\n            {\n              $depth++;\n            }\n            elsif ($substring eq '}')\n            {\n              $depth--;\n\n              $block_end = 1 if $depth == 0;\n            }\n          }\n\n          # If we are here, we have run out of substrings, so get next line\n          # or exit.\n          last BRACE_LOOP if $block_end;\n\n          $block .= \"\\n\";\n\n        } while (<DATA>);\n      }\n\n      if ($have_enum_element)\n      {\n        push @{$diversions{$curr_enum}}, enum_val_string($curr_enum_element);\n        $have_enum_element = 0;\n      }\n\n      push @{$diversions{$curr_array}}, $block . \",\\n\";\n\n      $curr_offset++;\n      $curr_elem_size++;\n\n      $have_blocks = 1;\n    }\n    else\n    {\n      warn_before();\n    }\n\n    next;\n  }\n\n  # Garbage.  We weren't able to parse the data.\n  Die(\"syntax error\");\n}\n\n# Finalize data.\nend_curr_string();\nupdate_max_elem_size();\n\n\n# Filter stdin to stdout, replacing `@...@' templates.\n\nsub emit_diversion\n{\n  my $diversion_name = shift;\n  return (exists($diversions{$1})) ? \"@{$diversions{$1}}\"\n                                   : \"@\" . $diversion_name . \"@\";\n}\n\n\n$LIST_SEPARATOR = '';\n\nmy $s1 = \"This file has been generated by the Perl script \\`$prog',\";\nmy $s1len = length $s1;\nmy $s2 = \"using data from file \\`$datafile'.\";\nmy $s2len = length $s2;\nmy $slen = ($s1len > $s2len) ? $s1len : $s2len;\n\nprint \"/* \" . $s1 . \" \" x ($slen - $s1len) . \" */\\n\"\n      . \"/* \" . $s2 . \" \" x ($slen - $s2len) . \" */\\n\"\n      . \"\\n\";\n\nwhile (<STDIN>)\n{\n  s/ @ ( [A-Za-z0-9_]+? ) @ / emit_diversion($1) /egx;\n  print;\n}\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/tools/apinames.c",
    "content": "/*\n * This little program is used to parse the FreeType headers and\n * find the declaration of all public APIs.  This is easy, because\n * they all look like the following:\n *\n *   FT_EXPORT( return_type )\n *   function_name( function arguments );\n *\n * You must pass the list of header files as arguments.  Wildcards are\n * accepted if you are using GCC for compilation (and probably by\n * other compilers too).\n *\n * Author: David Turner, 2005, 2006, 2008-2013\n *\n * This code is explicitly placed into the public domain.\n *\n */\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <ctype.h>\n\n#define  PROGRAM_NAME     \"apinames\"\n#define  PROGRAM_VERSION  \"0.2\"\n\n#define  LINEBUFF_SIZE  1024\n\ntypedef enum  OutputFormat_\n{\n  OUTPUT_LIST = 0,      /* output the list of names, one per line             */\n  OUTPUT_WINDOWS_DEF,   /* output a Windows .DEF file for Visual C++ or Mingw */\n  OUTPUT_BORLAND_DEF,   /* output a Windows .DEF file for Borland C++         */\n  OUTPUT_WATCOM_LBC,    /* output a Watcom Linker Command File                */\n  OUTPUT_NETWARE_IMP    /* output a NetWare ImportFile                        */\n\n} OutputFormat;\n\n\nstatic void\npanic( const char*  message )\n{\n  fprintf( stderr, \"PANIC: %s\\n\", message );\n  exit(2);\n}\n\n\ntypedef struct  NameRec_\n{\n  char*         name;\n  unsigned int  hash;\n\n} NameRec, *Name;\n\nstatic Name  the_names;\nstatic int   num_names;\nstatic int   max_names;\n\nstatic void\nnames_add( const char*  name,\n           const char*  end )\n{\n  unsigned int  h;\n  int           nn, len;\n  Name          nm;\n\n  if ( end <= name )\n    return;\n\n  /* compute hash value */\n  len = (int)(end - name);\n  h   = 0;\n  for ( nn = 0; nn < len; nn++ )\n    h = h*33 + name[nn];\n\n  /* check for an pre-existing name */\n  for ( nn = 0; nn < num_names; nn++ )\n  {\n    nm = the_names + nn;\n\n    if ( (int)nm->hash                 == h &&\n         memcmp( name, nm->name, len ) == 0 &&\n         nm->name[len]                 == 0 )\n      return;\n  }\n\n  /* add new name */\n  if ( num_names >= max_names )\n  {\n    max_names += (max_names >> 1) + 4;\n    the_names  = (NameRec*)realloc( the_names,\n                                    sizeof ( the_names[0] ) * max_names );\n    if ( the_names == NULL )\n      panic( \"not enough memory\" );\n  }\n  nm = &the_names[num_names++];\n\n  nm->hash = h;\n  nm->name = (char*)malloc( len+1 );\n  if ( nm->name == NULL )\n    panic( \"not enough memory\" );\n\n  memcpy( nm->name, name, len );\n  nm->name[len] = 0;\n}\n\n\nstatic int\nname_compare( const void*  name1,\n              const void*  name2 )\n{\n  Name  n1 = (Name)name1;\n  Name  n2 = (Name)name2;\n\n  return strcmp( n1->name, n2->name );\n}\n\nstatic void\nnames_sort( void )\n{\n  qsort( the_names, (size_t)num_names,\n         sizeof ( the_names[0] ), name_compare );\n}\n\n\nstatic void\nnames_dump( FILE*         out,\n            OutputFormat  format,\n            const char*   dll_name )\n{\n  int  nn;\n\n\n  switch ( format )\n  {\n    case OUTPUT_WINDOWS_DEF:\n      if ( dll_name )\n        fprintf( out, \"LIBRARY %s\\n\", dll_name );\n\n      fprintf( out, \"DESCRIPTION  FreeType 2 DLL\\n\" );\n      fprintf( out, \"EXPORTS\\n\" );\n      for ( nn = 0; nn < num_names; nn++ )\n        fprintf( out, \"  %s\\n\", the_names[nn].name );\n      break;\n\n    case OUTPUT_BORLAND_DEF:\n      if ( dll_name )\n        fprintf( out, \"LIBRARY %s\\n\", dll_name );\n\n      fprintf( out, \"DESCRIPTION  FreeType 2 DLL\\n\" );\n      fprintf( out, \"EXPORTS\\n\" );\n      for ( nn = 0; nn < num_names; nn++ )\n        fprintf( out, \"  _%s\\n\", the_names[nn].name );\n      break;\n\n    case OUTPUT_WATCOM_LBC:\n      {\n        const char*  dot;\n\n\n        if ( dll_name == NULL )\n        {\n          fprintf( stderr,\n                   \"you must provide a DLL name with the -d option!\\n\" );\n          exit( 4 );\n        }\n\n        /* we must omit the .dll suffix from the library name */\n        dot = strchr( dll_name, '.' );\n        if ( dot != NULL )\n        {\n          char  temp[512];\n          int   len = dot - dll_name;\n\n\n          if ( len > (int)( sizeof ( temp ) - 1 ) )\n            len = sizeof ( temp ) - 1;\n\n          memcpy( temp, dll_name, len );\n          temp[len] = 0;\n\n          dll_name = (const char*)temp;\n        }\n\n        for ( nn = 0; nn < num_names; nn++ )\n          fprintf( out, \"++_%s.%s.%s\\n\", the_names[nn].name, dll_name,\n                        the_names[nn].name );\n      }\n      break;\n\n    case OUTPUT_NETWARE_IMP:\n      {\n        if ( dll_name != NULL )\n          fprintf( out, \"  (%s)\\n\", dll_name );\n        for ( nn = 0; nn < num_names - 1; nn++ )\n          fprintf( out, \"  %s,\\n\", the_names[nn].name );\n        fprintf( out, \"  %s\\n\", the_names[num_names - 1].name );\n      }\n      break;\n\n    default:  /* LIST */\n      for ( nn = 0; nn < num_names; nn++ )\n        fprintf( out, \"%s\\n\", the_names[nn].name );\n  }\n}\n\n\n\n\n/* states of the line parser */\n\ntypedef enum  State_\n{\n  STATE_START = 0,  /* waiting for FT_EXPORT keyword and return type */\n  STATE_TYPE        /* type was read, waiting for function name      */\n\n} State;\n\nstatic int\nread_header_file( FILE*  file, int  verbose )\n{\n  static char  buff[LINEBUFF_SIZE + 1];\n  State        state = STATE_START;\n\n  while ( !feof( file ) )\n  {\n    char*  p;\n\n    if ( !fgets( buff, LINEBUFF_SIZE, file ) )\n      break;\n\n    p = buff;\n\n    while ( *p && (*p == ' ' || *p == '\\\\') )  /* skip leading whitespace */\n      p++;\n\n    if ( *p == '\\n' || *p == '\\r' )  /* skip empty lines */\n      continue;\n\n    switch ( state )\n    {\n      case STATE_START:\n        {\n          if ( memcmp( p, \"FT_EXPORT(\", 10 ) != 0 )\n            break;\n\n          p += 10;\n          for (;;)\n          {\n            if ( *p == 0 || *p == '\\n' || *p == '\\r' )\n              goto NextLine;\n\n            if ( *p == ')' )\n            {\n              p++;\n              break;\n            }\n\n            p++;\n          }\n\n          state = STATE_TYPE;\n\n         /* sometimes, the name is just after the FT_EXPORT(...), so\n          * skip whitespace, and fall-through if we find an alphanumeric\n          * character\n          */\n          while ( *p == ' ' || *p == '\\t' )\n            p++;\n\n          if ( !isalpha(*p) )\n            break;\n        }\n        /* fall-through */\n\n      case STATE_TYPE:\n        {\n          char*   name = p;\n\n          while ( isalnum(*p) || *p == '_' )\n            p++;\n\n          if ( p > name )\n          {\n            if ( verbose )\n              fprintf( stderr, \">>> %.*s\\n\", (int)(p - name), name );\n\n            names_add( name, p );\n          }\n\n          state = STATE_START;\n        }\n        break;\n\n      default:\n        ;\n    }\n\n  NextLine:\n    ;\n  }\n\n  return 0;\n}\n\n\nstatic void\nusage( void )\n{\n  static const char* const  format =\n   \"%s %s: extract FreeType API names from header files\\n\\n\"\n   \"this program is used to extract the list of public FreeType API\\n\"\n   \"functions. It receives the list of header files as argument and\\n\"\n   \"generates a sorted list of unique identifiers\\n\\n\"\n\n   \"usage: %s header1 [options] [header2 ...]\\n\\n\"\n\n   \"options:   -      : parse the content of stdin, ignore arguments\\n\"\n   \"           -v     : verbose mode, output sent to standard error\\n\"\n   \"           -oFILE : write output to FILE instead of standard output\\n\"\n   \"           -dNAME : indicate DLL file name, 'freetype.dll' by default\\n\"\n   \"           -w     : output .DEF file for Visual C++ and Mingw\\n\"\n   \"           -wB    : output .DEF file for Borland C++\\n\"\n   \"           -wW    : output Watcom Linker Response File\\n\"\n   \"           -wN    : output NetWare Import File\\n\"\n   \"\\n\";\n\n  fprintf( stderr,\n           format,\n           PROGRAM_NAME,\n           PROGRAM_VERSION,\n           PROGRAM_NAME\n           );\n  exit(1);\n}\n\n\nint  main( int argc, const char* const*  argv )\n{\n  int           from_stdin = 0;\n  int           verbose = 0;\n  OutputFormat  format = OUTPUT_LIST;  /* the default */\n  FILE*         out    = stdout;\n  const char*   library_name = NULL;\n\n  if ( argc < 2 )\n    usage();\n\n  /* '-' used as a single argument means read source file from stdin */\n  while ( argc > 1 && argv[1][0] == '-' )\n  {\n    const char*  arg = argv[1];\n\n    switch ( arg[1] )\n    {\n      case 'v':\n        verbose = 1;\n        break;\n\n      case 'o':\n        if ( arg[2] == 0 )\n        {\n          if ( argc < 2 )\n            usage();\n\n          arg = argv[2];\n          argv++;\n          argc--;\n        }\n        else\n          arg += 2;\n\n        out = fopen( arg, \"wt\" );\n        if ( out == NULL )\n        {\n          fprintf( stderr, \"could not open '%s' for writing\\n\", argv[2] );\n          exit(3);\n        }\n        break;\n\n      case 'd':\n        if ( arg[2] == 0 )\n        {\n          if ( argc < 2 )\n            usage();\n\n          arg = argv[2];\n          argv++;\n          argc--;\n        }\n        else\n          arg += 2;\n\n        library_name = arg;\n        break;\n\n      case 'w':\n        format = OUTPUT_WINDOWS_DEF;\n        switch ( arg[2] )\n        {\n          case 'B':\n            format = OUTPUT_BORLAND_DEF;\n            break;\n\n          case 'W':\n            format = OUTPUT_WATCOM_LBC;\n            break;\n\n          case 'N':\n            format = OUTPUT_NETWARE_IMP;\n            break;\n\n          case 0:\n            break;\n\n          default:\n            usage();\n        }\n        break;\n\n      case 0:\n        from_stdin = 1;\n        break;\n\n      default:\n        usage();\n    }\n\n    argc--;\n    argv++;\n  }\n\n  if ( from_stdin )\n  {\n    read_header_file( stdin, verbose );\n  }\n  else\n  {\n    for ( --argc, argv++; argc > 0; argc--, argv++ )\n    {\n      FILE*  file = fopen( argv[0], \"rb\" );\n\n      if ( file == NULL )\n        fprintf( stderr, \"unable to open '%s'\\n\", argv[0] );\n      else\n      {\n        if ( verbose )\n          fprintf( stderr, \"opening '%s'\\n\", argv[0] );\n\n        read_header_file( file, verbose );\n        fclose( file );\n      }\n    }\n  }\n\n  if ( num_names == 0 )\n    panic( \"could not find exported functions !!\\n\" );\n\n  names_sort();\n  names_dump( out, format, library_name );\n\n  if ( out != stdout )\n    fclose( out );\n\n  return 0;\n}\n"
  },
  {
    "path": "ext/freetype2/src/tools/chktrcmp.py",
    "content": "#!/usr/bin/env python\n#\n# Check trace components in FreeType 2 source.\n# Author: suzuki toshiya, 2009, 2013\n#\n# This code is explicitly into the public domain.\n\n\nimport sys\nimport os\nimport re\n\nSRC_FILE_LIST   = []\nUSED_COMPONENT  = {}\nKNOWN_COMPONENT = {}\n\nSRC_FILE_DIRS   = [ \"src\" ]\nTRACE_DEF_FILES = [ \"include/internal/fttrace.h\" ]\n\n\n# --------------------------------------------------------------\n# Parse command line options\n#\n\nfor i in range( 1, len( sys.argv ) ):\n  if sys.argv[i].startswith( \"--help\" ):\n    print \"Usage: %s [option]\" % sys.argv[0]\n    print \"Search used-but-defined and defined-but-not-used trace_XXX macros\"\n    print \"\"\n    print \"  --help:\"\n    print \"        Show this help\"\n    print \"\"\n    print \"  --src-dirs=dir1:dir2:...\"\n    print \"        Specify the directories of C source files to be checked\"\n    print \"        Default is %s\" % \":\".join( SRC_FILE_DIRS )\n    print \"\"\n    print \"  --def-files=file1:file2:...\"\n    print \"        Specify the header files including FT_TRACE_DEF()\"\n    print \"        Default is %s\" % \":\".join( TRACE_DEF_FILES )\n    print \"\"\n    exit(0)\n  if sys.argv[i].startswith( \"--src-dirs=\" ):\n    SRC_FILE_DIRS = sys.argv[i].replace( \"--src-dirs=\", \"\", 1 ).split( \":\" )\n  elif sys.argv[i].startswith( \"--def-files=\" ):\n    TRACE_DEF_FILES = sys.argv[i].replace( \"--def-files=\", \"\", 1 ).split( \":\" )\n\n\n# --------------------------------------------------------------\n# Scan C source and header files using trace macros.\n#\n\nc_pathname_pat = re.compile( '^.*\\.[ch]$', re.IGNORECASE )\ntrace_use_pat  = re.compile( '^[ \\t]*#define[ \\t]+FT_COMPONENT[ \\t]+trace_' )\n\nfor d in SRC_FILE_DIRS:\n  for ( p, dlst, flst ) in os.walk( d ):\n    for f in flst:\n      if c_pathname_pat.match( f ) != None:\n        src_pathname = os.path.join( p, f )\n\n        line_num = 0\n        for src_line in open( src_pathname, 'r' ):\n          line_num = line_num + 1\n          src_line = src_line.strip()\n          if trace_use_pat.match( src_line ) != None:\n            component_name = trace_use_pat.sub( '', src_line )\n            if component_name in USED_COMPONENT:\n              USED_COMPONENT[component_name].append( \"%s:%d\" % ( src_pathname, line_num ) )\n            else:\n              USED_COMPONENT[component_name] = [ \"%s:%d\" % ( src_pathname, line_num ) ]\n\n\n# --------------------------------------------------------------\n# Scan header file(s) defining trace macros.\n#\n\ntrace_def_pat_opn = re.compile( '^.*FT_TRACE_DEF[ \\t]*\\([ \\t]*' )\ntrace_def_pat_cls = re.compile( '[ \\t\\)].*$' )\n\nfor f in TRACE_DEF_FILES:\n  line_num = 0\n  for hdr_line in open( f, 'r' ):\n    line_num = line_num + 1\n    hdr_line = hdr_line.strip()\n    if trace_def_pat_opn.match( hdr_line ) != None:\n      component_name = trace_def_pat_opn.sub( '', hdr_line )\n      component_name = trace_def_pat_cls.sub( '', component_name )\n      if component_name in KNOWN_COMPONENT:\n        print \"trace component %s is defined twice, see %s and fttrace.h:%d\" % \\\n          ( component_name, KNOWN_COMPONENT[component_name], line_num )\n      else:\n        KNOWN_COMPONENT[component_name] = \"%s:%d\" % \\\n          ( os.path.basename( f ), line_num )\n\n\n# --------------------------------------------------------------\n# Compare the used and defined trace macros.\n#\n\nprint \"# Trace component used in the implementations but not defined in fttrace.h.\"\ncmpnt = USED_COMPONENT.keys()\ncmpnt.sort()\nfor c in cmpnt:\n  if c not in KNOWN_COMPONENT:\n    print \"Trace component %s (used in %s) is not defined.\" % ( c, \", \".join( USED_COMPONENT[c] ) )\n\nprint \"# Trace component is defined but not used in the implementations.\"\ncmpnt = KNOWN_COMPONENT.keys()\ncmpnt.sort()\nfor c in cmpnt:\n  if c not in USED_COMPONENT:\n    if c != \"any\":\n      print \"Trace component %s (defined in %s) is not used.\" % ( c, KNOWN_COMPONENT[c] )\n\n"
  },
  {
    "path": "ext/freetype2/src/tools/cordic.py",
    "content": "# compute arctangent table for CORDIC computations in fttrigon.c\nimport sys, math\n\n#units  = 64*65536.0   # don't change !!\nunits  = 180 * 2**16\nscale  = units/math.pi\nshrink = 1.0\ncomma  = \"\"\n\nprint \"\"\nprint \"table of arctan( 1/2^n ) for PI = \" + repr(units/65536.0) + \" units\"\n\nfor n in range(1,32):\n\n    x = 0.5**n                      # tangent value\n\n    angle  = math.atan(x)           # arctangent\n    angle2 = round(angle*scale)     # arctangent in FT_Angle units\n\n    if angle2 <= 0:\n        break\n\n    sys.stdout.write( comma + repr( int(angle2) ) )\n    comma = \", \"\n\n    shrink /= math.sqrt( 1 + x*x )\n\nprint\nprint \"shrink factor    = \" + repr( shrink )\nprint \"shrink factor 2  = \" + repr( int( shrink * (2**32) ) )\nprint \"expansion factor = \" + repr( 1/shrink )\nprint \"\"\n\n"
  },
  {
    "path": "ext/freetype2/src/tools/docmaker/content.py",
    "content": "#\n#  content.py\n#\n#    Parse comment blocks to build content blocks (library file).\n#\n#  Copyright 2002, 2004, 2006-2009, 2012-2014 by\n#  David Turner.\n#\n#  This file is part of the FreeType project, and may only be used,\n#  modified, and distributed under the terms of the FreeType project\n#  license, LICENSE.TXT.  By continuing to use, modify, or distribute\n#  this file you indicate that you have read the license and\n#  understand and accept it fully.\n\n#\n# This file contains routines to parse documentation comment blocks,\n# building more structured objects out of them.\n#\n\n\nfrom sources import *\nfrom utils   import *\n\nimport string, re\n\n\n#\n# Regular expressions to detect code sequences.  `Code sequences' are simply\n# code fragments embedded in '{' and '}', as demonstrated in the following\n# example.\n#\n#   {\n#     x = y + z;\n#     if ( zookoo == 2 )\n#     {\n#       foobar();\n#     }\n#   }\n#\n# Note that the indentation of the first opening brace and the last closing\n# brace must be exactly the same.  The code sequence itself should have a\n# larger indentation than the surrounding braces.\n#\nre_code_start = re.compile( r\"(\\s*){\\s*$\" )\nre_code_end   = re.compile( r\"(\\s*)}\\s*$\" )\n\n\n#\n# A regular expression to isolate identifiers from other text.\n#\nre_identifier = re.compile( r'((?:\\w|-)*)' )\n\n\n#\n# We collect macro names ending in `_H' (group 1), as defined in\n# `config/ftheader.h'.  While outputting the object data, we use this info\n# together with the object's file location (group 2) to emit the appropriate\n# header file macro and its associated file name before the object itself.\n#\n# Example:\n#\n#   #define FT_FREETYPE_H <freetype.h>\n#\nre_header_macro = re.compile( r'^#define\\s{1,}(\\w{1,}_H)\\s{1,}<(.*)>' )\n\n\n################################################################\n##\n##  DOC CODE CLASS\n##\n##  The `DocCode' class is used to store source code lines.\n##\n##  `self.lines' contains a set of source code lines that will be dumped as\n##  HTML in a <PRE> tag.\n##\n##  The object is filled line by line by the parser; it strips the leading\n##  `margin' space from each input line before storing it in `self.lines'.\n##\nclass  DocCode:\n\n    def  __init__( self, margin, lines ):\n        self.lines = []\n        self.words = None\n\n        # remove margin spaces\n        for l in lines:\n            if string.strip( l[:margin] ) == \"\":\n                l = l[margin:]\n            self.lines.append( l )\n\n    def  dump( self, prefix = \"\", width = 60 ):\n        lines = self.dump_lines( 0, width )\n        for l in lines:\n            print prefix + l\n\n    def  dump_lines( self, margin = 0, width = 60 ):\n        result = []\n        for l in self.lines:\n            result.append( \" \" * margin + l )\n        return result\n\n\n\n################################################################\n##\n##  DOC PARA CLASS\n##\n##  `Normal' text paragraphs are stored in the `DocPara' class.\n##\n##  `self.words' contains the list of words that make up the paragraph.\n##\nclass  DocPara:\n\n    def  __init__( self, lines ):\n        self.lines = None\n        self.words = []\n        for l in lines:\n            l = string.strip( l )\n            self.words.extend( string.split( l ) )\n\n    def  dump( self, prefix = \"\", width = 60 ):\n        lines = self.dump_lines( 0, width )\n        for l in lines:\n            print prefix + l\n\n    def  dump_lines( self, margin = 0, width = 60 ):\n        cur    = \"\"  # current line\n        col    = 0   # current width\n        result = []\n\n        for word in self.words:\n            ln = len( word )\n            if col > 0:\n                ln = ln + 1\n\n            if col + ln > width:\n                result.append( \" \" * margin + cur )\n                cur = word\n                col = len( word )\n            else:\n                if col > 0:\n                    cur = cur + \" \"\n                cur = cur + word\n                col = col + ln\n\n        if col > 0:\n            result.append( \" \" * margin + cur )\n\n        return result\n\n\n################################################################\n##\n##  DOC FIELD CLASS\n##\n##  The `DocField' class stores a list containing either `DocPara' or\n##  `DocCode' objects.  Each DocField object also has an optional `name'\n##  that is used when the object corresponds to a field or value definition.\n##\nclass  DocField:\n\n    def  __init__( self, name, lines ):\n        self.name  = name  # can be `None' for normal paragraphs/sources\n        self.items = []    # list of items\n\n        mode_none  = 0     # start parsing mode\n        mode_code  = 1     # parsing code sequences\n        mode_para  = 3     # parsing normal paragraph\n\n        margin     = -1    # current code sequence indentation\n        cur_lines  = []\n\n        # analyze the markup lines to check whether they contain paragraphs,\n        # code sequences, or fields definitions\n        #\n        start = 0\n        mode  = mode_none\n\n        for l in lines:\n            # are we parsing a code sequence?\n            if mode == mode_code:\n                m = re_code_end.match( l )\n                if m and len( m.group( 1 ) ) <= margin:\n                    # that's it, we finished the code sequence\n                    code = DocCode( 0, cur_lines )\n                    self.items.append( code )\n                    margin    = -1\n                    cur_lines = []\n                    mode      = mode_none\n                else:\n                    # otherwise continue the code sequence\n                    cur_lines.append( l[margin:] )\n            else:\n                # start of code sequence?\n                m = re_code_start.match( l )\n                if m:\n                    # save current lines\n                    if cur_lines:\n                        para = DocPara( cur_lines )\n                        self.items.append( para )\n                        cur_lines = []\n\n                    # switch to code extraction mode\n                    margin = len( m.group( 1 ) )\n                    mode   = mode_code\n                else:\n                    if not string.split( l ) and cur_lines:\n                        # if the line is empty, we end the current paragraph,\n                        # if any\n                        para = DocPara( cur_lines )\n                        self.items.append( para )\n                        cur_lines = []\n                    else:\n                        # otherwise, simply add the line to the current\n                        # paragraph\n                        cur_lines.append( l )\n\n        if mode == mode_code:\n            # unexpected end of code sequence\n            code = DocCode( margin, cur_lines )\n            self.items.append( code )\n        elif cur_lines:\n            para = DocPara( cur_lines )\n            self.items.append( para )\n\n    def  dump( self, prefix = \"\" ):\n        if self.field:\n            print prefix + self.field + \" ::\"\n            prefix = prefix + \"----\"\n\n        first = 1\n        for p in self.items:\n            if not first:\n                print \"\"\n            p.dump( prefix )\n            first = 0\n\n    def  dump_lines( self, margin = 0, width = 60 ):\n        result = []\n        nl     = None\n\n        for p in self.items:\n            if nl:\n                result.append( \"\" )\n\n            result.extend( p.dump_lines( margin, width ) )\n            nl = 1\n\n        return result\n\n\n#\n# A regular expression to detect field definitions.\n#\n# Examples:\n#\n#   foo     ::\n#   foo.bar ::\n#\nre_field = re.compile( r\"\"\"\n                         \\s*\n                           (\n                             \\w*\n                           |\n                             \\w (\\w | \\.)* \\w\n                           )\n                         \\s* ::\n                       \"\"\", re.VERBOSE )\n\n\n################################################################\n##\n##  DOC MARKUP CLASS\n##\nclass  DocMarkup:\n\n    def  __init__( self, tag, lines ):\n        self.tag    = string.lower( tag )\n        self.fields = []\n\n        cur_lines = []\n        field     = None\n        mode      = 0\n\n        for l in lines:\n            m = re_field.match( l )\n            if m:\n                # We detected the start of a new field definition.\n\n                # first, save the current one\n                if cur_lines:\n                    f = DocField( field, cur_lines )\n                    self.fields.append( f )\n                    cur_lines = []\n                    field     = None\n\n                field     = m.group( 1 )   # record field name\n                ln        = len( m.group( 0 ) )\n                l         = \" \" * ln + l[ln:]\n                cur_lines = [l]\n            else:\n                cur_lines.append( l )\n\n        if field or cur_lines:\n            f = DocField( field, cur_lines )\n            self.fields.append( f )\n\n    def  get_name( self ):\n        try:\n            return self.fields[0].items[0].words[0]\n        except:\n            return None\n\n    def  dump( self, margin ):\n        print \" \" * margin + \"<\" + self.tag + \">\"\n        for f in self.fields:\n            f.dump( \"  \" )\n        print \" \" * margin + \"</\" + self.tag + \">\"\n\n\n################################################################\n##\n##  DOC CHAPTER CLASS\n##\nclass  DocChapter:\n\n    def  __init__( self, block ):\n        self.block    = block\n        self.sections = []\n        if block:\n            self.name  = block.name\n            self.title = block.get_markup_words( \"title\" )\n            self.order = block.get_markup_words( \"sections\" )\n        else:\n            self.name  = \"Other\"\n            self.title = string.split( \"Miscellaneous\" )\n            self.order = []\n\n\n################################################################\n##\n##  DOC SECTION CLASS\n##\nclass  DocSection:\n\n    def  __init__( self, name = \"Other\" ):\n        self.name        = name\n        self.blocks      = {}\n        self.block_names = []  # ordered block names in section\n        self.defs        = []\n        self.abstract    = \"\"\n        self.description = \"\"\n        self.order       = []\n        self.title       = \"ERROR\"\n        self.chapter     = None\n\n    def  add_def( self, block ):\n        self.defs.append( block )\n\n    def  add_block( self, block ):\n        self.block_names.append( block.name )\n        self.blocks[block.name] = block\n\n    def  process( self ):\n        # look up one block that contains a valid section description\n        for block in self.defs:\n            title = block.get_markup_text( \"title\" )\n            if title:\n                self.title       = title\n                self.abstract    = block.get_markup_words( \"abstract\" )\n                self.description = block.get_markup_items( \"description\" )\n                self.order       = block.get_markup_words_all( \"order\" )\n                return\n\n    def  reorder( self ):\n        self.block_names = sort_order_list( self.block_names, self.order )\n\n\n################################################################\n##\n##  CONTENT PROCESSOR CLASS\n##\nclass  ContentProcessor:\n\n    def  __init__( self ):\n        \"\"\"Initialize a block content processor.\"\"\"\n        self.reset()\n\n        self.sections = {}    # dictionary of documentation sections\n        self.section  = None  # current documentation section\n\n        self.chapters = []    # list of chapters\n\n        self.headers  = {}    # dictionary of header macros\n\n    def  set_section( self, section_name ):\n        \"\"\"Set current section during parsing.\"\"\"\n        if not section_name in self.sections:\n            section = DocSection( section_name )\n            self.sections[section_name] = section\n            self.section                = section\n        else:\n            self.section = self.sections[section_name]\n\n    def  add_chapter( self, block ):\n        chapter = DocChapter( block )\n        self.chapters.append( chapter )\n\n    def  reset( self ):\n        \"\"\"Reset the content processor for a new block.\"\"\"\n        self.markups      = []\n        self.markup       = None\n        self.markup_lines = []\n\n    def  add_markup( self ):\n        \"\"\"Add a new markup section.\"\"\"\n        if self.markup and self.markup_lines:\n\n            # get rid of last line of markup if it's empty\n            marks = self.markup_lines\n            if len( marks ) > 0 and not string.strip( marks[-1] ):\n                self.markup_lines = marks[:-1]\n\n            m = DocMarkup( self.markup, self.markup_lines )\n\n            self.markups.append( m )\n\n            self.markup       = None\n            self.markup_lines = []\n\n    def  process_content( self, content ):\n        \"\"\"Process a block content and return a list of DocMarkup objects\n           corresponding to it.\"\"\"\n        markup       = None\n        markup_lines = []\n        first        = 1\n\n        for line in content:\n            found = None\n            for t in re_markup_tags:\n                m = t.match( line )\n                if m:\n                    found  = string.lower( m.group( 1 ) )\n                    prefix = len( m.group( 0 ) )\n                    line   = \" \" * prefix + line[prefix:]   # remove markup from line\n                    break\n\n            # is it the start of a new markup section ?\n            if found:\n                first = 0\n                self.add_markup()  # add current markup content\n                self.markup = found\n                if len( string.strip( line ) ) > 0:\n                    self.markup_lines.append( line )\n            elif first == 0:\n                self.markup_lines.append( line )\n\n        self.add_markup()\n\n        return self.markups\n\n    def  parse_sources( self, source_processor ):\n        blocks = source_processor.blocks\n        count  = len( blocks )\n\n        for n in range( count ):\n            source = blocks[n]\n            if source.content:\n                # this is a documentation comment, we need to catch\n                # all following normal blocks in the \"follow\" list\n                #\n                follow = []\n                m = n + 1\n                while m < count and not blocks[m].content:\n                    follow.append( blocks[m] )\n                    m = m + 1\n\n                doc_block = DocBlock( source, follow, self )\n\n    def  finish( self ):\n        # process all sections to extract their abstract, description\n        # and ordered list of items\n        #\n        for sec in self.sections.values():\n            sec.process()\n\n        # process chapters to check that all sections are correctly\n        # listed there\n        for chap in self.chapters:\n            for sec in chap.order:\n                if sec in self.sections:\n                    section = self.sections[sec]\n                    section.chapter = chap\n                    section.reorder()\n                    chap.sections.append( section )\n                else:\n                    sys.stderr.write( \"WARNING: chapter '\" +          \\\n                        chap.name + \"' in \" + chap.block.location() + \\\n                        \" lists unknown section '\" + sec + \"'\\n\" )\n\n        # check that all sections are in a chapter\n        #\n        others = []\n        for sec in self.sections.values():\n            if not sec.chapter:\n                sec.reorder()\n                others.append( sec )\n\n        # create a new special chapter for all remaining sections\n        # when necessary\n        #\n        if others:\n            chap = DocChapter( None )\n            chap.sections = others\n            self.chapters.append( chap )\n\n\n################################################################\n##\n##  DOC BLOCK CLASS\n##\nclass  DocBlock:\n\n    def  __init__( self, source, follow, processor ):\n        processor.reset()\n\n        self.source  = source\n        self.code    = []\n        self.type    = \"ERRTYPE\"\n        self.name    = \"ERRNAME\"\n        self.section = processor.section\n        self.markups = processor.process_content( source.content )\n\n        # compute block type from first markup tag\n        try:\n            self.type = self.markups[0].tag\n        except:\n            pass\n\n        # compute block name from first markup paragraph\n        try:\n            markup = self.markups[0]\n            para   = markup.fields[0].items[0]\n            name   = para.words[0]\n            m = re_identifier.match( name )\n            if m:\n                name = m.group( 1 )\n            self.name = name\n        except:\n            pass\n\n        if self.type == \"section\":\n            # detect new section starts\n            processor.set_section( self.name )\n            processor.section.add_def( self )\n        elif self.type == \"chapter\":\n            # detect new chapter\n            processor.add_chapter( self )\n        else:\n            processor.section.add_block( self )\n\n        # now, compute the source lines relevant to this documentation\n        # block. We keep normal comments in for obvious reasons (??)\n        source = []\n        for b in follow:\n            if b.format:\n                break\n            for l in b.lines:\n                # collect header macro definitions\n                m = re_header_macro.match( l )\n                if m:\n                    processor.headers[m.group( 2 )] = m.group( 1 );\n\n                # we use \"/* */\" as a separator\n                if re_source_sep.match( l ):\n                    break\n                source.append( l )\n\n        # now strip the leading and trailing empty lines from the sources\n        start = 0\n        end   = len( source ) - 1\n\n        while start < end and not string.strip( source[start] ):\n            start = start + 1\n\n        while start < end and not string.strip( source[end] ):\n            end = end - 1\n\n        if start == end and not string.strip( source[start] ):\n            self.code = []\n        else:\n            self.code = source[start:end + 1]\n\n    def  location( self ):\n        return self.source.location()\n\n    def  get_markup( self, tag_name ):\n        \"\"\"Return the DocMarkup corresponding to a given tag in a block.\"\"\"\n        for m in self.markups:\n            if m.tag == string.lower( tag_name ):\n                return m\n        return None\n\n    def  get_markup_words( self, tag_name ):\n        try:\n            m = self.get_markup( tag_name )\n            return m.fields[0].items[0].words\n        except:\n            return []\n\n    def  get_markup_words_all( self, tag_name ):\n        try:\n            m = self.get_markup( tag_name )\n            words = []\n            for item in m.fields[0].items:\n                # We honour empty lines in an `<Order>' section element by\n                # adding the sentinel `/empty/'.  The formatter should then\n                # convert it to an appropriate representation in the\n                # `section_enter' function.\n                words += item.words\n                words.append( \"/empty/\" )\n            return words\n        except:\n            return []\n\n    def  get_markup_text( self, tag_name ):\n        result = self.get_markup_words( tag_name )\n        return string.join( result )\n\n    def  get_markup_items( self, tag_name ):\n        try:\n            m = self.get_markup( tag_name )\n            return m.fields[0].items\n        except:\n            return None\n\n# eof\n"
  },
  {
    "path": "ext/freetype2/src/tools/docmaker/docbeauty.py",
    "content": "#!/usr/bin/env python\n#\n#  DocBeauty (c) 2003, 2004, 2008 David Turner <david@freetype.org>\n#\n# This program is used to beautify the documentation comments used\n# in the FreeType 2 public headers.\n#\n\nfrom sources import *\nfrom content import *\nfrom utils   import *\n\nimport utils\n\nimport sys, os, time, string, getopt\n\n\ncontent_processor = ContentProcessor()\n\n\ndef  beautify_block( block ):\n    if block.content:\n        content_processor.reset()\n\n        markups = content_processor.process_content( block.content )\n        text    = []\n        first   = 1\n\n        for markup in markups:\n            text.extend( markup.beautify( first ) )\n            first = 0\n\n        # now beautify the documentation \"borders\" themselves\n        lines = [\" /*************************************************************************\"]\n        for l in text:\n            lines.append( \"  *\" + l )\n        lines.append( \"  */\" )\n\n        block.lines = lines\n\n\ndef  usage():\n    print \"\\nDocBeauty 0.1 Usage information\\n\"\n    print \"  docbeauty [options] file1 [file2 ...]\\n\"\n    print \"using the following options:\\n\"\n    print \"  -h : print this page\"\n    print \"  -b : backup original files with the 'orig' extension\"\n    print \"\"\n    print \"  --backup : same as -b\"\n\n\ndef  main( argv ):\n    \"\"\"main program loop\"\"\"\n\n    global output_dir\n\n    try:\n        opts, args = getopt.getopt( sys.argv[1:], \\\n                                    \"hb\",         \\\n                                    [\"help\", \"backup\"] )\n    except getopt.GetoptError:\n        usage()\n        sys.exit( 2 )\n\n    if args == []:\n        usage()\n        sys.exit( 1 )\n\n    # process options\n    #\n    output_dir = None\n    do_backup  = None\n\n    for opt in opts:\n        if opt[0] in ( \"-h\", \"--help\" ):\n            usage()\n            sys.exit( 0 )\n\n        if opt[0] in ( \"-b\", \"--backup\" ):\n            do_backup = 1\n\n    # create context and processor\n    source_processor = SourceProcessor()\n\n    # retrieve the list of files to process\n    file_list = make_file_list( args )\n    for filename in file_list:\n        source_processor.parse_file( filename )\n\n        for block in source_processor.blocks:\n            beautify_block( block )\n\n        new_name = filename + \".new\"\n        ok       = None\n\n        try:\n            file = open( new_name, \"wt\" )\n            for block in source_processor.blocks:\n                for line in block.lines:\n                    file.write( line )\n                    file.write( \"\\n\" )\n            file.close()\n        except:\n            ok = 0\n\n\n# if called from the command line\n#\nif __name__ == '__main__':\n    main( sys.argv )\n\n\n# eof\n"
  },
  {
    "path": "ext/freetype2/src/tools/docmaker/docmaker.py",
    "content": "#!/usr/bin/env python\n#\n#  docmaker.py\n#\n#    Convert source code markup to HTML documentation.\n#\n#  Copyright 2002, 2004, 2008, 2013, 2014 by\n#  David Turner.\n#\n#  This file is part of the FreeType project, and may only be used,\n#  modified, and distributed under the terms of the FreeType project\n#  license, LICENSE.TXT.  By continuing to use, modify, or distribute\n#  this file you indicate that you have read the license and\n#  understand and accept it fully.\n\n#\n# This program is a re-write of the original DocMaker tool used to generate\n# the API Reference of the FreeType font rendering engine by converting\n# in-source comments into structured HTML.\n#\n# This new version is capable of outputting XML data as well as accepting\n# more liberal formatting options.  It also uses regular expression matching\n# and substitution to speed up operation significantly.\n#\n\nfrom sources   import *\nfrom content   import *\nfrom utils     import *\nfrom formatter import *\nfrom tohtml    import *\n\nimport utils\n\nimport sys, os, time, string, glob, getopt\n\n\ndef  usage():\n    print \"\\nDocMaker Usage information\\n\"\n    print \"  docmaker [options] file1 [file2 ...]\\n\"\n    print \"using the following options:\\n\"\n    print \"  -h : print this page\"\n    print \"  -t : set project title, as in '-t \\\"My Project\\\"'\"\n    print \"  -o : set output directory, as in '-o mydir'\"\n    print \"  -p : set documentation prefix, as in '-p ft2'\"\n    print \"\"\n    print \"  --title  : same as -t, as in '--title=\\\"My Project\\\"'\"\n    print \"  --output : same as -o, as in '--output=mydir'\"\n    print \"  --prefix : same as -p, as in '--prefix=ft2'\"\n\n\ndef  main( argv ):\n    \"\"\"Main program loop.\"\"\"\n\n    global output_dir\n\n    try:\n        opts, args = getopt.getopt( sys.argv[1:],\n                                    \"ht:o:p:\",\n                                    [\"help\", \"title=\", \"output=\", \"prefix=\"] )\n    except getopt.GetoptError:\n        usage()\n        sys.exit( 2 )\n\n    if args == []:\n        usage()\n        sys.exit( 1 )\n\n    # process options\n    project_title  = \"Project\"\n    project_prefix = None\n    output_dir     = None\n\n    for opt in opts:\n        if opt[0] in ( \"-h\", \"--help\" ):\n            usage()\n            sys.exit( 0 )\n\n        if opt[0] in ( \"-t\", \"--title\" ):\n            project_title = opt[1]\n\n        if opt[0] in ( \"-o\", \"--output\" ):\n            utils.output_dir = opt[1]\n\n        if opt[0] in ( \"-p\", \"--prefix\" ):\n            project_prefix = opt[1]\n\n    check_output()\n\n    # create context and processor\n    source_processor  = SourceProcessor()\n    content_processor = ContentProcessor()\n\n    # retrieve the list of files to process\n    file_list = make_file_list( args )\n    for filename in file_list:\n        source_processor.parse_file( filename )\n        content_processor.parse_sources( source_processor )\n\n    # process sections\n    content_processor.finish()\n\n    formatter = HtmlFormatter( content_processor,\n                               project_title,\n                               project_prefix )\n\n    formatter.toc_dump()\n    formatter.index_dump()\n    formatter.section_dump_all()\n\n\n# if called from the command line\nif __name__ == '__main__':\n    main( sys.argv )\n\n# eof\n"
  },
  {
    "path": "ext/freetype2/src/tools/docmaker/formatter.py",
    "content": "#\n#  formatter.py\n#\n#    Convert parsed content blocks to a structured document (library file).\n#\n#  Copyright 2002, 2004, 2007, 2008, 2014 by\n#  David Turner.\n#\n#  This file is part of the FreeType project, and may only be used,\n#  modified, and distributed under the terms of the FreeType project\n#  license, LICENSE.TXT.  By continuing to use, modify, or distribute\n#  this file you indicate that you have read the license and\n#  understand and accept it fully.\n\n#\n# This is the base Formatter class.  Its purpose is to convert a content\n# processor's data into specific documents (i.e., table of contents, global\n# index, and individual API reference indices).\n#\n# You need to sub-class it to output anything sensible.  For example, the\n# file `tohtml.py' contains the definition of the `HtmlFormatter' sub-class\n# to output HTML.\n#\n\n\nfrom sources import *\nfrom content import *\nfrom utils   import *\n\n\n################################################################\n##\n##  FORMATTER CLASS\n##\nclass  Formatter:\n\n    def  __init__( self, processor ):\n        self.processor   = processor\n        self.identifiers = {}\n        self.chapters    = processor.chapters\n        self.sections    = processor.sections.values()\n        self.block_index = []\n\n        # store all blocks in a dictionary\n        self.blocks = []\n        for section in self.sections:\n            for block in section.blocks.values():\n                self.add_identifier( block.name, block )\n\n                # add enumeration values to the index, since this is useful\n                for markup in block.markups:\n                    if markup.tag == 'values':\n                        for field in markup.fields:\n                            self.add_identifier( field.name, block )\n\n        self.block_index = self.identifiers.keys()\n        self.block_index.sort( key = index_key )\n\n    def  add_identifier( self, name, block ):\n        if name in self.identifiers:\n            # duplicate name!\n            sys.stderr.write( \"WARNING: duplicate definition for\"\n                              + \" '\" + name + \"' \"\n                              + \"in \" + block.location() + \", \"\n                              + \"previous definition in \"\n                              + self.identifiers[name].location()\n                              + \"\\n\" )\n        else:\n            self.identifiers[name] = block\n\n    #\n    # formatting the table of contents\n    #\n    def  toc_enter( self ):\n        pass\n\n    def  toc_chapter_enter( self, chapter ):\n        pass\n\n    def  toc_section_enter( self, section ):\n        pass\n\n    def  toc_section_exit( self, section ):\n        pass\n\n    def  toc_chapter_exit( self, chapter ):\n        pass\n\n    def  toc_index( self, index_filename ):\n        pass\n\n    def  toc_exit( self ):\n        pass\n\n    def  toc_dump( self, toc_filename = None, index_filename = None ):\n        output = None\n        if toc_filename:\n            output = open_output( toc_filename )\n\n        self.toc_enter()\n\n        for chap in self.processor.chapters:\n\n            self.toc_chapter_enter( chap )\n\n            for section in chap.sections:\n                self.toc_section_enter( section )\n                self.toc_section_exit( section )\n\n            self.toc_chapter_exit( chap )\n\n        self.toc_index( index_filename )\n\n        self.toc_exit()\n\n        if output:\n            close_output( output )\n\n    #\n    # formatting the index\n    #\n    def  index_enter( self ):\n        pass\n\n    def  index_name_enter( self, name ):\n        pass\n\n    def  index_name_exit( self, name ):\n        pass\n\n    def  index_exit( self ):\n        pass\n\n    def  index_dump( self, index_filename = None ):\n        output = None\n        if index_filename:\n            output = open_output( index_filename )\n\n        self.index_enter()\n\n        for name in self.block_index:\n            self.index_name_enter( name )\n            self.index_name_exit( name )\n\n        self.index_exit()\n\n        if output:\n            close_output( output )\n\n    #\n    # formatting a section\n    #\n    def  section_enter( self, section ):\n        pass\n\n    def  block_enter( self, block ):\n        pass\n\n    def  markup_enter( self, markup, block = None ):\n        pass\n\n    def  field_enter( self, field, markup = None, block = None ):\n        pass\n\n    def  field_exit( self, field, markup = None, block = None ):\n        pass\n\n    def  markup_exit( self, markup, block = None ):\n        pass\n\n    def  block_exit( self, block ):\n        pass\n\n    def  section_exit( self, section ):\n        pass\n\n    def  section_dump( self, section, section_filename = None ):\n        output = None\n        if section_filename:\n            output = open_output( section_filename )\n\n        self.section_enter( section )\n\n        for name in section.block_names:\n            skip_entry = 0\n            try:\n                block = self.identifiers[name]\n                # `block_names' can contain field names also,\n                # which we filter out\n                for markup in block.markups:\n                    if markup.tag == 'values':\n                        for field in markup.fields:\n                            if field.name == name:\n                                skip_entry = 1\n            except:\n                skip_entry = 1   # this happens e.g. for `/empty/' entries\n\n            if skip_entry:\n              continue\n\n            self.block_enter( block )\n\n            for markup in block.markups[1:]:   # always ignore first markup!\n                self.markup_enter( markup, block )\n\n                for field in markup.fields:\n                    self.field_enter( field, markup, block )\n                    self.field_exit( field, markup, block )\n\n                self.markup_exit( markup, block )\n\n            self.block_exit( block )\n\n        self.section_exit( section )\n\n        if output:\n            close_output( output )\n\n    def  section_dump_all( self ):\n        for section in self.sections:\n            self.section_dump( section )\n\n# eof\n"
  },
  {
    "path": "ext/freetype2/src/tools/docmaker/sources.py",
    "content": "#\n#  sources.py\n#\n#    Convert source code comments to multi-line blocks (library file).\n#\n#  Copyright 2002-2004, 2006-2009, 2012-2014 by\n#  David Turner.\n#\n#  This file is part of the FreeType project, and may only be used,\n#  modified, and distributed under the terms of the FreeType project\n#  license, LICENSE.TXT.  By continuing to use, modify, or distribute\n#  this file you indicate that you have read the license and\n#  understand and accept it fully.\n\n#\n# This library file contains definitions of classes needed to decompose C\n# source code files into a series of multi-line `blocks'.  There are two\n# kinds of blocks.\n#\n#   - Normal blocks, which contain source code or ordinary comments.\n#\n#   - Documentation blocks, which have restricted formatting, and whose text\n#     always start with a documentation markup tag like `<Function>',\n#     `<Type>', etc.\n#\n# The routines to process the content of documentation blocks are contained\n# in file `content.py'; the classes and methods found here only deal with\n# text parsing and basic documentation block extraction.\n#\n\n\nimport fileinput, re, sys, os, string\n\n\n################################################################\n##\n##  SOURCE BLOCK FORMAT CLASS\n##\n##  A simple class containing compiled regular expressions to detect\n##  potential documentation format block comments within C source code.\n##\n##  The `column' pattern must contain a group to `unbox' the content of\n##  documentation comment blocks.\n##\n##  Later on, paragraphs are converted to long lines, which simplifies the\n##  regular expressions that act upon the text.\n##\nclass  SourceBlockFormat:\n\n    def  __init__( self, id, start, column, end ):\n        \"\"\"Create a block pattern, used to recognize special documentation\n           blocks.\"\"\"\n        self.id     = id\n        self.start  = re.compile( start, re.VERBOSE )\n        self.column = re.compile( column, re.VERBOSE )\n        self.end    = re.compile( end, re.VERBOSE )\n\n\n#\n# Format 1 documentation comment blocks.\n#\n#    /************************************/ (at least 2 asterisks)\n#    /*                                  */\n#    /*                                  */\n#    /*                                  */\n#    /************************************/ (at least 2 asterisks)\n#\nstart = r'''\n  \\s*      # any number of whitespace\n  /\\*{2,}/ # followed by '/' and at least two asterisks then '/'\n  \\s*$     # probably followed by whitespace\n'''\n\ncolumn = r'''\n  \\s*      # any number of whitespace\n  /\\*{1}   # followed by '/' and precisely one asterisk\n  ([^*].*) # followed by anything (group 1)\n  \\*{1}/   # followed by one asterisk and a '/'\n  \\s*$     # probably followed by whitespace\n'''\n\nre_source_block_format1 = SourceBlockFormat( 1, start, column, start )\n\n\n#\n# Format 2 documentation comment blocks.\n#\n#    /************************************ (at least 2 asterisks)\n#     *\n#     *                                    (1 asterisk)\n#     *\n#     */                                   (1 or more asterisks)\n#\nstart = r'''\n  \\s*     # any number of whitespace\n  /\\*{2,} # followed by '/' and at least two asterisks\n  \\s*$    # probably followed by whitespace\n'''\n\ncolumn = r'''\n  \\s*           # any number of whitespace\n  \\*{1}(?![*/]) # followed by precisely one asterisk not followed by `/'\n  (.*)          # then anything (group1)\n'''\n\nend = r'''\n  \\s*  # any number of whitespace\n  \\*+/ # followed by at least one asterisk, then '/'\n'''\n\nre_source_block_format2 = SourceBlockFormat( 2, start, column, end )\n\n\n#\n# The list of supported documentation block formats.  We could add new ones\n# quite easily.\n#\nre_source_block_formats = [re_source_block_format1, re_source_block_format2]\n\n\n#\n# The following regular expressions correspond to markup tags within the\n# documentation comment blocks.  They are equivalent despite their different\n# syntax.\n#\n# A markup tag consists of letters or character `-', to be found in group 1.\n#\n# Notice that a markup tag _must_ begin a new paragraph.\n#\nre_markup_tag1 = re.compile( r'''\\s*<((?:\\w|-)*)>''' )  # <xxxx> format\nre_markup_tag2 = re.compile( r'''\\s*@((?:\\w|-)*):''' )  # @xxxx: format\n\n#\n# The list of supported markup tags.  We could add new ones quite easily.\n#\nre_markup_tags = [re_markup_tag1, re_markup_tag2]\n\n\n#\n# A regular expression to detect a cross reference, after markup tags have\n# been stripped off.  Group 1 is the reference, group 2 the rest of the\n# line.\n#\n# A cross reference consists of letters, digits, or characters `-' and `_'.\n#\nre_crossref = re.compile( r'@((?:\\w|-)*)(.*)' )    #  @foo\n\n#\n# Two regular expressions to detect italic and bold markup, respectively.\n# Group 1 is the markup, group 2 the rest of the line.\n#\n# Note that the markup is limited to words consisting of letters, digits,\n# the character `_', or an apostrophe (but not as the first character).\n#\nre_italic = re.compile( r\"_(\\w(?:\\w|')*)_(.*)\" )     #  _italic_\nre_bold   = re.compile( r\"\\*(\\w(?:\\w|')*)\\*(.*)\" )   #  *bold*\n\n#\n# This regular expression code to identify an URL has been taken from\n#\n#   http://mail.python.org/pipermail/tutor/2002-September/017228.html\n#\n# (with slight modifications).\n#\nurls = r'(?:https?|telnet|gopher|file|wais|ftp)'\nltrs = r'\\w'\ngunk = r'/#~:.?+=&%@!\\-'\npunc = r'.:?\\-'\nany  = \"%(ltrs)s%(gunk)s%(punc)s\" % { 'ltrs' : ltrs,\n                                      'gunk' : gunk,\n                                      'punc' : punc }\nurl  = r\"\"\"\n         (\n           \\b                    # start at word boundary\n           %(urls)s :            # need resource and a colon\n           [%(any)s] +?          # followed by one or more of any valid\n                                 # character, but be conservative and\n                                 # take only what you need to...\n           (?=                   # [look-ahead non-consumptive assertion]\n             [%(punc)s]*         # either 0 or more punctuation\n             (?:                 # [non-grouping parentheses]\n               [^%(any)s] | $    # followed by a non-url char\n                                 # or end of the string\n             )\n           )\n         )\n        \"\"\" % {'urls' : urls,\n               'any'  : any,\n               'punc' : punc }\n\nre_url = re.compile( url, re.VERBOSE | re.MULTILINE )\n\n#\n# A regular expression that stops collection of comments for the current\n# block.\n#\nre_source_sep = re.compile( r'\\s*/\\*\\s*\\*/' )   #  /* */\n\n#\n# A regular expression to find possible C identifiers while outputting\n# source code verbatim, covering things like `*foo' or `(bar'.  Group 1 is\n# the prefix, group 2 the identifier -- since we scan lines from left to\n# right, sequentially splitting the source code into prefix and identifier\n# is fully sufficient for our purposes.\n#\nre_source_crossref = re.compile( r'(\\W*)(\\w*)' )\n\n#\n# A regular expression that matches a list of reserved C source keywords.\n#\nre_source_keywords = re.compile( '''\\\\b ( typedef   |\n                                          struct    |\n                                          enum      |\n                                          union     |\n                                          const     |\n                                          char      |\n                                          int       |\n                                          short     |\n                                          long      |\n                                          void      |\n                                          signed    |\n                                          unsigned  |\n                                          \\#include |\n                                          \\#define  |\n                                          \\#undef   |\n                                          \\#if      |\n                                          \\#ifdef   |\n                                          \\#ifndef  |\n                                          \\#else    |\n                                          \\#endif   ) \\\\b''', re.VERBOSE )\n\n\n################################################################\n##\n##  SOURCE BLOCK CLASS\n##\n##  There are two important fields in a `SourceBlock' object.\n##\n##    self.lines\n##      A list of text lines for the corresponding block.\n##\n##    self.content\n##      For documentation comment blocks only, this is the block content\n##      that has been `unboxed' from its decoration.  This is `None' for all\n##      other blocks (i.e., sources or ordinary comments with no starting\n##      markup tag)\n##\nclass  SourceBlock:\n\n    def  __init__( self, processor, filename, lineno, lines ):\n        self.processor = processor\n        self.filename  = filename\n        self.lineno    = lineno\n        self.lines     = lines[:]\n        self.format    = processor.format\n        self.content   = []\n\n        if self.format == None:\n            return\n\n        words = []\n\n        # extract comment lines\n        lines = []\n\n        for line0 in self.lines:\n            m = self.format.column.match( line0 )\n            if m:\n                lines.append( m.group( 1 ) )\n\n        # now, look for a markup tag\n        for l in lines:\n            l = string.strip( l )\n            if len( l ) > 0:\n                for tag in re_markup_tags:\n                    if tag.match( l ):\n                        self.content = lines\n                        return\n\n    def  location( self ):\n        return \"(\" + self.filename + \":\" + repr( self.lineno ) + \")\"\n\n    # debugging only -- not used in normal operations\n    def  dump( self ):\n        if self.content:\n            print \"{{{content start---\"\n            for l in self.content:\n                print l\n            print \"---content end}}}\"\n            return\n\n        fmt = \"\"\n        if self.format:\n            fmt = repr( self.format.id ) + \" \"\n\n        for line in self.lines:\n            print line\n\n\n################################################################\n##\n##  SOURCE PROCESSOR CLASS\n##\n##  The `SourceProcessor' is in charge of reading a C source file and\n##  decomposing it into a series of different `SourceBlock' objects.\n##\n##  A SourceBlock object consists of the following data.\n##\n##    - A documentation comment block using one of the layouts above.  Its\n##      exact format will be discussed later.\n##\n##    - Normal sources lines, including comments.\n##\n##\nclass  SourceProcessor:\n\n    def  __init__( self ):\n        \"\"\"Initialize a source processor.\"\"\"\n        self.blocks   = []\n        self.filename = None\n        self.format   = None\n        self.lines    = []\n\n    def  reset( self ):\n        \"\"\"Reset a block processor and clean up all its blocks.\"\"\"\n        self.blocks = []\n        self.format = None\n\n    def  parse_file( self, filename ):\n        \"\"\"Parse a C source file and add its blocks to the processor's\n           list.\"\"\"\n        self.reset()\n\n        self.filename = filename\n\n        fileinput.close()\n        self.format = None\n        self.lineno = 0\n        self.lines  = []\n\n        for line in fileinput.input( filename ):\n            # strip trailing newlines, important on Windows machines!\n            if line[-1] == '\\012':\n                line = line[0:-1]\n\n            if self.format == None:\n                self.process_normal_line( line )\n            else:\n                if self.format.end.match( line ):\n                    # A normal block end.  Add it to `lines' and create a\n                    # new block\n                    self.lines.append( line )\n                    self.add_block_lines()\n                elif self.format.column.match( line ):\n                    # A normal column line.  Add it to `lines'.\n                    self.lines.append( line )\n                else:\n                    # An unexpected block end.  Create a new block, but\n                    # don't process the line.\n                    self.add_block_lines()\n\n                    # we need to process the line again\n                    self.process_normal_line( line )\n\n        # record the last lines\n        self.add_block_lines()\n\n    def  process_normal_line( self, line ):\n        \"\"\"Process a normal line and check whether it is the start of a new\n           block.\"\"\"\n        for f in re_source_block_formats:\n            if f.start.match( line ):\n                self.add_block_lines()\n                self.format = f\n                self.lineno = fileinput.filelineno()\n\n        self.lines.append( line )\n\n    def  add_block_lines( self ):\n        \"\"\"Add the current accumulated lines and create a new block.\"\"\"\n        if self.lines != []:\n            block = SourceBlock( self,\n                                 self.filename,\n                                 self.lineno,\n                                 self.lines )\n\n            self.blocks.append( block )\n            self.format = None\n            self.lines  = []\n\n    # debugging only, not used in normal operations\n    def  dump( self ):\n        \"\"\"Print all blocks in a processor.\"\"\"\n        for b in self.blocks:\n            b.dump()\n\n# eof\n"
  },
  {
    "path": "ext/freetype2/src/tools/docmaker/tohtml.py",
    "content": "#\n#  tohtml.py\n#\n#    A sub-class container of the `Formatter' class to produce HTML.\n#\n#  Copyright 2002, 2003, 2005-2008, 2013, 2014 by\n#  David Turner.\n#\n#  This file is part of the FreeType project, and may only be used,\n#  modified, and distributed under the terms of the FreeType project\n#  license, LICENSE.TXT.  By continuing to use, modify, or distribute\n#  this file you indicate that you have read the license and\n#  understand and accept it fully.\n\n# The parent class is contained in file `formatter.py'.\n\n\nfrom sources import *\nfrom content import *\nfrom formatter import *\n\nimport time\n\n\n# The following strings define the HTML header used by all generated pages.\nhtml_header_1 = \"\"\"\\\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n\"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n<title>\\\n\"\"\"\n\nhtml_header_2 = \"\"\"\\\n API Reference</title>\n<style type=\"text/css\">\n  a:link { color: #0000EF; }\n  a:visited { color: #51188E; }\n  a:hover { color: #FF0000; }\n\n  body { font-family: Verdana, Geneva, Arial, Helvetica, serif;\n         color: #000000;\n         background: #FFFFFF;\n         width: 87%;\n         margin: auto; }\n\n  div.section { width: 75%;\n                margin: auto; }\n  div.section hr { margin: 4ex 0 1ex 0; }\n  div.section h4 { background-color: #EEEEFF;\n                   font-size: medium;\n                   font-style: oblique;\n                   font-weight: bold;\n                   margin: 3ex 0 1.5ex 9%;\n                   padding: 0.3ex 0 0.3ex 1%; }\n  div.section p { margin: 1.5ex 0 1.5ex 10%; }\n  div.section pre { margin: 3ex 0 3ex 9%;\n                    background-color: #D6E8FF;\n                    padding: 2ex 0 2ex 1%; }\n  div.section table.fields { width: 90%;\n                             margin: 1.5ex 0 1.5ex 10%; }\n  div.section table.toc { width: 95%;\n                          margin: 1.5ex 0 1.5ex 5%; }\n  div.timestamp { text-align: center;\n                  font-size: 69%;\n                  margin: 1.5ex 0 1.5ex 0; }\n\n  h1 { text-align: center; }\n  h3 { font-size: medium;\n       margin: 4ex 0 1.5ex 0; }\n\n  p { text-align: justify; }\n\n  pre.colored { color: blue; }\n\n  span.keyword { font-family: monospace;\n                 text-align: left;\n                 white-space: pre;\n                 color: darkblue; }\n\n  table.fields td.val { font-weight: bold;\n                        text-align: right;\n                        width: 30%;\n                        vertical-align: baseline;\n                        padding: 1ex 1em 1ex 0; }\n  table.fields td.desc { vertical-align: baseline;\n                         padding: 1ex 0 1ex 1em; }\n  table.fields td.desc p:first-child { margin: 0; }\n  table.fields td.desc p { margin: 1.5ex 0 0 0; }\n  table.index { margin: 6ex auto 6ex auto;\n                border: 0;\n                border-collapse: separate;\n                border-spacing: 1em 0.3ex; }\n  table.index tr { padding: 0; }\n  table.index td { padding: 0; }\n  table.index-toc-link { width: 100%;\n                         border: 0;\n                         border-spacing: 0;\n                         margin: 1ex 0 1ex 0; }\n  table.index-toc-link td.left { padding: 0 0.5em 0 0.5em;\n                                 font-size: 83%;\n                                 text-align: left; }\n  table.index-toc-link td.middle { padding: 0 0.5em 0 0.5em;\n                                   font-size: 83%;\n                                   text-align: center; }\n  table.index-toc-link td.right { padding: 0 0.5em 0 0.5em;\n                                  font-size: 83%;\n                                  text-align: right; }\n  table.synopsis { margin: 6ex auto 6ex auto;\n                   border: 0;\n                   border-collapse: separate;\n                   border-spacing: 2em 0.6ex; }\n  table.synopsis tr { padding: 0; }\n  table.synopsis td { padding: 0; }\n  table.toc td.link { width: 30%;\n                      text-align: right;\n                      vertical-align: baseline;\n                      padding: 1ex 1em 1ex 0; }\n  table.toc td.desc { vertical-align: baseline;\n                      padding: 1ex 0 1ex 1em;\n                      text-align: left; }\n  table.toc td.desc p:first-child { margin: 0;\n                                    text-align: left; }\n  table.toc td.desc p { margin: 1.5ex 0 0 0;\n                        text-align: left; }\n\n</style>\n</head>\n<body>\n\"\"\"\n\nhtml_header_3l = \"\"\"\n<table class=\"index-toc-link\"><tr><td class=\"left\">[<a href=\"\\\n\"\"\"\n\nhtml_header_3r = \"\"\"\n<table class=\"index-toc-link\"><tr><td class=\"right\">[<a href=\"\\\n\"\"\"\n\nhtml_header_4 = \"\"\"\\\n\">Index</a>]</td><td class=\"right\">[<a href=\"\\\n\"\"\"\n\nhtml_header_5t = \"\"\"\\\n\">TOC</a>]</td></tr></table>\n<h1>\\\n\"\"\"\n\nhtml_header_5i = \"\"\"\\\n\">Index</a>]</td></tr></table>\n<h1>\\\n\"\"\"\n\nhtml_header_6 = \"\"\"\\\n API Reference</h1>\n\"\"\"\n\n\n# The HTML footer used by all generated pages.\nhtml_footer = \"\"\"\\\n</body>\n</html>\\\n\"\"\"\n\n# The header and footer used for each section.\nsection_title_header = \"<h1>\"\nsection_title_footer = \"</h1>\"\n\n# The header and footer used for code segments.\ncode_header = '<pre class=\"colored\">'\ncode_footer = '</pre>'\n\n# Paragraph header and footer.\npara_header = \"<p>\"\npara_footer = \"</p>\"\n\n# Block header and footer.\nblock_header        = '<div class=\"section\">'\nblock_footer_start  = \"\"\"\\\n<hr>\n<table class=\"index-toc-link\"><tr><td class=\"left\">[<a href=\"\\\n\"\"\"\nblock_footer_middle = \"\"\"\\\n\">Index</a>]</td>\\\n<td class=\"middle\">[<a href=\"#\">Top</a>]</td>\\\n<td class=\"right\">[<a href=\"\\\n\"\"\"\nblock_footer_end    = \"\"\"\\\n\">TOC</a>]</td></tr></table></div>\n\"\"\"\n\n# Description header/footer.\ndescription_header = \"\"\ndescription_footer = \"\"\n\n# Marker header/inter/footer combination.\nmarker_header = \"<h4>\"\nmarker_inter  = \"</h4>\"\nmarker_footer = \"\"\n\n# Header location header/footer.\nheader_location_header = \"<p>\"\nheader_location_footer = \"</p>\"\n\n# Source code extracts header/footer.\nsource_header = \"<pre>\"\nsource_footer = \"</pre>\"\n\n# Chapter header/inter/footer.\nchapter_header = \"\"\"\\\n<div class=\"section\">\n<h2>\\\n\"\"\"\nchapter_inter  = '</h2>'\nchapter_footer = '</div>'\n\n# Index footer.\nindex_footer_start = \"\"\"\\\n<hr>\n<table class=\"index-toc-link\"><tr><td class=\"right\">[<a href=\"\\\n\"\"\"\nindex_footer_end = \"\"\"\\\n\">TOC</a>]</td></tr></table>\n\"\"\"\n\n# TOC footer.\ntoc_footer_start = \"\"\"\\\n<hr>\n<table class=\"index-toc-link\"><tr><td class=\"left\">[<a href=\"\\\n\"\"\"\ntoc_footer_end = \"\"\"\\\n\">Index</a>]</td></tr></table>\n\"\"\"\n\n\n# Source language keyword coloration and styling.\nkeyword_prefix = '<span class=\"keyword\">'\nkeyword_suffix = '</span>'\n\nsection_synopsis_header = '<h2>Synopsis</h2>'\nsection_synopsis_footer = ''\n\n\n# Translate a single line of source to HTML.  This converts `<', `>', and\n# `&' into `&lt;',`&gt;', and `&amp;'.\n#\ndef  html_quote( line ):\n    result = string.replace( line,   \"&\", \"&amp;\" )\n    result = string.replace( result, \"<\", \"&lt;\"  )\n    result = string.replace( result, \">\", \"&gt;\"  )\n    return result\n\n\n################################################################\n##\n##  HTML FORMATTER CLASS\n##\nclass  HtmlFormatter( Formatter ):\n\n    def  __init__( self, processor, project_title, file_prefix ):\n        Formatter.__init__( self, processor )\n\n        global html_header_1\n        global html_header_2\n        global html_header_3l, html_header_3r\n        global html_header_4\n        global html_header_5t, html_header_5i\n        global html_header_6\n        global html_footer\n\n        if file_prefix:\n            file_prefix = file_prefix + \"-\"\n        else:\n            file_prefix = \"\"\n\n        self.headers       = processor.headers\n        self.project_title = project_title\n        self.file_prefix   = file_prefix\n        self.html_header   = (\n          html_header_1 + project_title\n          + html_header_2\n          + html_header_3l + file_prefix + \"index.html\"\n          + html_header_4 + file_prefix + \"toc.html\"\n          + html_header_5t + project_title\n          + html_header_6 )\n        self.html_index_header = (\n          html_header_1 + project_title\n          + html_header_2\n          + html_header_3r + file_prefix + \"toc.html\"\n          + html_header_5t + project_title\n          + html_header_6 )\n        self.html_toc_header = (\n          html_header_1 + project_title\n          + html_header_2\n          + html_header_3l + file_prefix + \"index.html\"\n          + html_header_5i + project_title\n          + html_header_6 )\n        self.html_footer = (\n          '<div class=\"timestamp\">generated on '\n          + time.asctime( time.localtime( time.time() ) )\n          + \"</div>\" + html_footer )\n\n        self.columns = 3\n\n    def  make_section_url( self, section ):\n        return self.file_prefix + section.name + \".html\"\n\n    def  make_block_url( self, block, name = None ):\n        if name == None:\n            name = block.name\n        return self.make_section_url( block.section ) + \"#\" + name\n\n    def  make_html_word( self, word ):\n        \"\"\"Analyze a simple word to detect cross-references and markup.\"\"\"\n        # handle cross-references\n        m = re_crossref.match( word )\n        if m:\n            try:\n                name = m.group( 1 )\n                rest = m.group( 2 )\n                block = self.identifiers[name]\n                url   = self.make_block_url( block )\n                return '<a href=\"' + url + '\">' + name + '</a>' + rest\n            except:\n                # we detected a cross-reference to an unknown item\n                sys.stderr.write( \"WARNING: undefined cross reference\"\n                                  + \" '\" + name + \"'.\\n\" )\n                return '?' + name + '?' + rest\n\n        # handle markup for italic and bold\n        m = re_italic.match( word )\n        if m:\n            name = m.group( 1 )\n            rest = m.group( 2 )\n            return '<i>' + name + '</i>' + rest\n\n        m = re_bold.match( word )\n        if m:\n            name = m.group( 1 )\n            rest = m.group( 2 )\n            return '<b>' + name + '</b>' + rest\n\n        return html_quote( word )\n\n    def  make_html_para( self, words ):\n        \"\"\"Convert words of a paragraph into tagged HTML text.  Also handle\n           cross references.\"\"\"\n        line = \"\"\n        if words:\n            line = self.make_html_word( words[0] )\n            for word in words[1:]:\n                line = line + \" \" + self.make_html_word( word )\n            # handle hyperlinks\n            line = re_url.sub( r'<a href=\"\\1\">\\1</a>', line )\n            # convert `...' quotations into real left and right single quotes\n            line = re.sub( r\"(^|\\W)`(.*?)'(\\W|$)\",\n                           r'\\1&lsquo;\\2&rsquo;\\3',\n                           line )\n            # convert tilde into non-breakable space\n            line = string.replace( line, \"~\", \"&nbsp;\" )\n\n        return para_header + line + para_footer\n\n    def  make_html_code( self, lines ):\n        \"\"\"Convert a code sequence to HTML.\"\"\"\n        line = code_header + '\\n'\n        for l in lines:\n            line = line + html_quote( l ) + '\\n'\n\n        return line + code_footer\n\n    def  make_html_items( self, items ):\n        \"\"\"Convert a field's content into HTML.\"\"\"\n        lines = []\n        for item in items:\n            if item.lines:\n                lines.append( self.make_html_code( item.lines ) )\n            else:\n                lines.append( self.make_html_para( item.words ) )\n\n        return string.join( lines, '\\n' )\n\n    def  print_html_items( self, items ):\n        print self.make_html_items( items )\n\n    def  print_html_field( self, field ):\n        if field.name:\n            print( '<table><tr valign=\"top\"><td><b>'\n                   + field.name\n                   + \"</b></td><td>\" )\n\n        print self.make_html_items( field.items )\n\n        if field.name:\n            print \"</td></tr></table>\"\n\n    def  html_source_quote( self, line, block_name = None ):\n        result = \"\"\n        while line:\n            m = re_source_crossref.match( line )\n            if m:\n                name   = m.group( 2 )\n                prefix = html_quote( m.group( 1 ) )\n                length = len( m.group( 0 ) )\n\n                if name == block_name:\n                    # this is the current block name, if any\n                    result = result + prefix + '<b>' + name + '</b>'\n                elif re_source_keywords.match( name ):\n                    # this is a C keyword\n                    result = ( result + prefix\n                               + keyword_prefix + name + keyword_suffix )\n                elif name in self.identifiers:\n                    # this is a known identifier\n                    block = self.identifiers[name]\n                    id = block.name\n\n                    # link to a field ID if possible\n                    for markup in block.markups:\n                        if markup.tag == 'values':\n                            for field in markup.fields:\n                                if field.name:\n                                    id = name\n\n                    result = ( result + prefix\n                               + '<a href=\"'\n                               + self.make_block_url( block, id )\n                               + '\">' + name + '</a>' )\n                else:\n                    result = result + html_quote( line[:length] )\n\n                line = line[length:]\n            else:\n                result = result + html_quote( line )\n                line   = []\n\n        return result\n\n    def  print_html_field_list( self, fields ):\n        print '<table class=\"fields\">'\n        for field in fields:\n            print ( '<tr><td class=\"val\" id=\"' + field.name + '\">'\n                    + field.name\n                    + '</td><td class=\"desc\">' )\n            self.print_html_items( field.items )\n            print \"</td></tr>\"\n        print \"</table>\"\n\n    def  print_html_markup( self, markup ):\n        table_fields = []\n        for field in markup.fields:\n            if field.name:\n                # We begin a new series of field or value definitions.  We\n                # record them in the `table_fields' list before outputting\n                # all of them as a single table.\n                table_fields.append( field )\n            else:\n                if table_fields:\n                    self.print_html_field_list( table_fields )\n                    table_fields = []\n\n                self.print_html_items( field.items )\n\n        if table_fields:\n            self.print_html_field_list( table_fields )\n\n    #\n    # formatting the index\n    #\n    def  index_enter( self ):\n        print self.html_index_header\n        self.index_items = {}\n\n    def  index_name_enter( self, name ):\n        block = self.identifiers[name]\n        url   = self.make_block_url( block )\n        self.index_items[name] = url\n\n    def  index_exit( self ):\n        # `block_index' already contains the sorted list of index names\n        count = len( self.block_index )\n        rows  = ( count + self.columns - 1 ) // self.columns\n\n        print '<table class=\"index\">'\n        for r in range( rows ):\n            line = \"<tr>\"\n            for c in range( self.columns ):\n                i = r + c * rows\n                if i < count:\n                    bname = self.block_index[r + c * rows]\n                    url   = self.index_items[bname]\n                    line  = ( line + '<td><a href=\"' + url + '\">'\n                              + bname + '</a></td>' )\n                else:\n                    line = line + '<td></td>'\n            line = line + \"</tr>\"\n            print line\n\n        print \"</table>\"\n\n        print( index_footer_start\n               + self.file_prefix + \"toc.html\"\n               + index_footer_end )\n\n        print self.html_footer\n\n        self.index_items = {}\n\n    def  index_dump( self, index_filename = None ):\n        if index_filename == None:\n            index_filename = self.file_prefix + \"index.html\"\n\n        Formatter.index_dump( self, index_filename )\n\n    #\n    # formatting the table of contents\n    #\n    def  toc_enter( self ):\n        print self.html_toc_header\n        print \"<h1>Table of Contents</h1>\"\n\n    def  toc_chapter_enter( self, chapter ):\n        print chapter_header + string.join( chapter.title ) + chapter_inter\n        print '<table class=\"toc\">'\n\n    def  toc_section_enter( self, section ):\n        print ( '<tr><td class=\"link\">'\n                + '<a href=\"' + self.make_section_url( section ) + '\">'\n                + section.title + '</a></td><td class=\"desc\">' )\n        print self.make_html_para( section.abstract )\n\n    def  toc_section_exit( self, section ):\n        print \"</td></tr>\"\n\n    def  toc_chapter_exit( self, chapter ):\n        print \"</table>\"\n        print chapter_footer\n\n    def  toc_index( self, index_filename ):\n        print( chapter_header\n               + '<a href=\"' + index_filename + '\">Global Index</a>'\n               + chapter_inter + chapter_footer )\n\n    def  toc_exit( self ):\n        print( toc_footer_start\n               + self.file_prefix + \"index.html\"\n               + toc_footer_end )\n\n        print self.html_footer\n\n    def  toc_dump( self, toc_filename = None, index_filename = None ):\n        if toc_filename == None:\n            toc_filename = self.file_prefix + \"toc.html\"\n\n        if index_filename == None:\n            index_filename = self.file_prefix + \"index.html\"\n\n        Formatter.toc_dump( self, toc_filename, index_filename )\n\n    #\n    # formatting sections\n    #\n    def  section_enter( self, section ):\n        print self.html_header\n\n        print section_title_header + section.title + section_title_footer\n\n        maxwidth = 0\n        for b in section.blocks.values():\n            if len( b.name ) > maxwidth:\n                maxwidth = len( b.name )\n\n        width = 70  # XXX magic number\n        if maxwidth > 0:\n            # print section synopsis\n            print section_synopsis_header\n            print '<table class=\"synopsis\">'\n\n            columns = width // maxwidth\n            if columns < 1:\n                columns = 1\n\n            count = len( section.block_names )\n            # don't handle last entry if it is empty\n            if section.block_names[-1] == \"/empty/\":\n                count -= 1\n            rows  = ( count + columns - 1 ) // columns\n\n            for r in range( rows ):\n                line = \"<tr>\"\n                for c in range( columns ):\n                    i = r + c * rows\n                    line = line + '<td>'\n                    if i < count:\n                        name = section.block_names[i]\n                        if name == \"/empty/\":\n                            # it can happen that a complete row is empty, and\n                            # without a proper `filler' the browser might\n                            # collapse the row to a much smaller height (or\n                            # even omit it completely)\n                            line = line + \"&nbsp;\"\n                        else:\n                            line = ( line + '<a href=\"#' + name + '\">'\n                                     + name + '</a>' )\n\n                    line = line + '</td>'\n                line = line + \"</tr>\"\n                print line\n\n            print \"</table>\"\n            print section_synopsis_footer\n\n        print description_header\n        print self.make_html_items( section.description )\n        print description_footer\n\n    def  block_enter( self, block ):\n        print block_header\n\n        # place html anchor if needed\n        if block.name:\n            print( '<h3 id=\"' + block.name + '\">' + block.name + '</h3>' )\n\n        # dump the block C source lines now\n        if block.code:\n            header = ''\n            for f in self.headers.keys():\n                if block.source.filename.find( f ) >= 0:\n                    header = self.headers[f] + ' (' + f + ')'\n                    break\n\n#           if not header:\n#               sys.stderr.write(\n#                 \"WARNING: No header macro for\"\n#                 + \" '\" + block.source.filename + \"'.\\n\" )\n\n            if header:\n                print ( header_location_header\n                        + 'Defined in ' + header + '.'\n                        + header_location_footer )\n\n            print source_header\n            for l in block.code:\n                print self.html_source_quote( l, block.name )\n            print source_footer\n\n    def  markup_enter( self, markup, block ):\n        if markup.tag == \"description\":\n            print description_header\n        else:\n            print marker_header + markup.tag + marker_inter\n\n        self.print_html_markup( markup )\n\n    def  markup_exit( self, markup, block ):\n        if markup.tag == \"description\":\n            print description_footer\n        else:\n            print marker_footer\n\n    def  block_exit( self, block ):\n        print( block_footer_start + self.file_prefix + \"index.html\"\n               + block_footer_middle + self.file_prefix + \"toc.html\"\n               + block_footer_end )\n\n    def  section_exit( self, section ):\n        print html_footer\n\n    def  section_dump_all( self ):\n        for section in self.sections:\n            self.section_dump( section,\n                               self.file_prefix + section.name + '.html' )\n\n# eof\n"
  },
  {
    "path": "ext/freetype2/src/tools/docmaker/utils.py",
    "content": "#\n#  utils.py\n#\n#    Auxiliary functions for the `docmaker' tool (library file).\n#\n#  Copyright 2002, 2004, 2007, 2008, 2014 by\n#  David Turner.\n#\n#  This file is part of the FreeType project, and may only be used,\n#  modified, and distributed under the terms of the FreeType project\n#  license, LICENSE.TXT.  By continuing to use, modify, or distribute\n#  this file you indicate that you have read the license and\n#  understand and accept it fully.\n\n\nimport string, sys, os, glob, itertools\n\n\n# current output directory\n#\noutput_dir = None\n\n\n# A function that generates a sorting key.  We want lexicographical order\n# (primary key) except that capital letters are sorted before lowercase\n# ones (secondary key).\n#\n# The primary key is implemented by lowercasing the input.  The secondary\n# key is simply the original data appended, character by character.  For\n# example, the sort key for `FT_x' is `fFtT__xx', while the sort key for\n# `ft_X' is `fftt__xX'.  Since ASCII codes of uppercase letters are\n# numerically smaller than the codes of lowercase letters, `fFtT__xx' gets\n# sorted before `fftt__xX'.\n#\ndef  index_key( s ):\n    return string.join( itertools.chain( *zip( s.lower(), s ) ) )\n\n\n# Sort `input_list', placing the elements of `order_list' in front.\n#\ndef  sort_order_list( input_list, order_list ):\n    new_list = order_list[:]\n    for id in input_list:\n        if not id in order_list:\n            new_list.append( id )\n    return new_list\n\n\n# Divert standard output to a given project documentation file.  Use\n# `output_dir' to determine the filename location if necessary and save the\n# old stdout handle in a tuple that is returned by this function.\n#\ndef  open_output( filename ):\n    global output_dir\n\n    if output_dir and output_dir != \"\":\n        filename = output_dir + os.sep + filename\n\n    old_stdout = sys.stdout\n    new_file   = open( filename, \"w\" )\n    sys.stdout = new_file\n\n    return ( new_file, old_stdout )\n\n\n# Close the output that was returned by `open_output'.\n#\ndef  close_output( output ):\n    output[0].close()\n    sys.stdout = output[1]\n\n\n# Check output directory.\n#\ndef  check_output():\n    global output_dir\n    if output_dir:\n        if output_dir != \"\":\n            if not os.path.isdir( output_dir ):\n                sys.stderr.write( \"argument\"\n                                  + \" '\" + output_dir + \"' \"\n                                  + \"is not a valid directory\" )\n                sys.exit( 2 )\n        else:\n            output_dir = None\n\n\ndef  file_exists( pathname ):\n    \"\"\"Check that a given file exists.\"\"\"\n    result = 1\n    try:\n        file = open( pathname, \"r\" )\n        file.close()\n    except:\n        result = None\n        sys.stderr.write( pathname + \" couldn't be accessed\\n\" )\n\n    return result\n\n\ndef  make_file_list( args = None ):\n    \"\"\"Build a list of input files from command-line arguments.\"\"\"\n    file_list = []\n    # sys.stderr.write( repr( sys.argv[1 :] ) + '\\n' )\n\n    if not args:\n        args = sys.argv[1:]\n\n    for pathname in args:\n        if string.find( pathname, '*' ) >= 0:\n            newpath = glob.glob( pathname )\n            newpath.sort()  # sort files -- this is important because\n                            # of the order of files\n        else:\n            newpath = [pathname]\n\n        file_list.extend( newpath )\n\n    if len( file_list ) == 0:\n        file_list = None\n    else:\n        # now filter the file list to remove non-existing ones\n        file_list = filter( file_exists, file_list )\n\n    return file_list\n\n# eof\n"
  },
  {
    "path": "ext/freetype2/src/tools/ftrandom/Makefile",
    "content": "# TOP_DIR and OBJ_DIR should be set by the user to the right directories,\n# if necessary.\n\nTOP_DIR ?= ../../..\nOBJ_DIR ?= $(TOP_DIR)/objs\n\n\n# The setup below is for gcc on a Unix-like platform.\n\nSRC_DIR = $(TOP_DIR)/src/tools/ftrandom\n\nCC = gcc\nWFLAGS = -Wmissing-prototypes \\\n         -Wunused \\\n         -Wimplicit \\\n         -Wreturn-type \\\n         -Wparentheses \\\n         -pedantic \\\n         -Wformat \\\n         -Wchar-subscripts \\\n         -Wsequence-point\nCFLAGS = $(WFLAGS) \\\n         -g \\\n         -I $(TOP_DIR)/include\nLIBS = -lm \\\n       -L $(OBJ_DIR) \\\n       -lfreetype \\\n       -lz\n\nall: $(OBJ_DIR)/ftrandom\n\n$(OBJ_DIR)/ftrandom: $(SRC_DIR)/ftrandom.c $(OBJ_DIR)/libfreetype.a\n\t$(CC) -o $(OBJ_DIR)/ftrandom $(CFLAGS) $(SRC_DIR)/ftrandom.c $(LIBS)\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/tools/ftrandom/README",
    "content": "ftrandom\n--------\n\nThis program expects a set of directories containing good fonts, and a set\nof extensions of fonts to be tested.  It will randomly pick a font, copy it,\nintroduce and error and then test it.\n\nThe FreeType tests are quite basic:\n\n  For each erroneous font it\n    forks off a new tester;\n    initializes the library;\n    opens each font in the file;\n    loads each glyph;\n      (optionally reviewing the contours of the glyph)\n      (optionally rasterizing)\n    closes the face.\n\nIf the tester exits with a signal, or takes longer than 20 seconds then\nftrandom saves the erroneous font and continues.  If the tester exits\nnormally or with an error, then the superstructure removes the test font and\ncontinues.\n\nArguments are:\n\n  --all                    Test every font in the directory(ies) no matter\n                           what its extension (some CID-keyed fonts have no\n                           extension).\n  --check-outlines         Call FT_Outline_Decompose on each glyph.\n  --dir <dir>              Append <dir> to the list of directories to search\n                           for good fonts.\n  --error-count <cnt>      Introduce <cnt> single-byte errors into the\n                           erroneous fonts.\n  --error-fraction <frac>  Multiply the file size of the font by <frac> and\n                           introduce that many errors into the erroneous\n                           font file.\n  --ext <ext>              Add <ext> to the set of font types tested.  Known\n                           extensions are `ttf', `otf', `ttc', `cid', `pfb',\n                           `pfa', `bdf', `pcf', `pfr', `fon', `otb', and\n                           `cff'.\n  --help                   Print out this list of options.\n  --nohints                Specify FT_LOAD_NO_HINTING when loading glyphs.\n  --rasterize              Call FT_Render_Glyph as well as loading it.\n  --result <dir>           This is the directory in which test files are\n                           placed.\n  --test <file>            Run a single test on a pre-generated testcase.\n                           Done in the current process so it can be debugged\n                           more easily.\n"
  },
  {
    "path": "ext/freetype2/src/tools/ftrandom/ftrandom.c",
    "content": "/* Copyright (C) 2005, 2007, 2008, 2013 by George Williams */\n/*\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n\n * The name of the author may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\n * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* modified by Werner Lemberg <wl@gnu.org>       */\n/* This file is now part of the FreeType library */\n\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <strings.h>\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <sys/wait.h>\n#include <unistd.h>\n#include <dirent.h>\n#include <math.h>\n#include <signal.h>\n#include <time.h>\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_OUTLINE_H\n\n#define true     1\n#define false    0\n#define forever  for (;;)\n\n\n  static int    check_outlines = false;\n  static int    nohints        = false;\n  static int    rasterize      = false;\n  static char*  results_dir    = \"results\";\n\n#define GOOD_FONTS_DIR  \"/home/wl/freetype-testfonts\"\n\n  static char*  default_dir_list[] =\n  {\n    GOOD_FONTS_DIR,\n    NULL\n  };\n\n  static char*  default_ext_list[] =\n  {\n    \"ttf\",\n    \"otf\",\n    \"ttc\",\n    \"cid\",\n    \"pfb\",\n    \"pfa\",\n    \"bdf\",\n    \"pcf\",\n    \"pfr\",\n    \"fon\",\n    \"otb\",\n    \"cff\",\n    NULL\n  };\n\n  static int  error_count    = 1;\n  static int  error_fraction = 0;\n\n  static FT_F26Dot6  font_size = 12 * 64;\n\n  static struct fontlist\n  {\n    char*         name;\n    int           len;\n    unsigned int  isbinary: 1;\n    unsigned int  isascii: 1;\n    unsigned int  ishex: 1;\n\n  } *fontlist;\n\n  static int  fcnt;\n\n\n  static int\n  FT_MoveTo( const FT_Vector  *to,\n             void             *user )\n  {\n    return 0;\n  }\n\n\n  static int\n  FT_LineTo( const FT_Vector  *to,\n             void             *user )\n  {\n    return 0;\n  }\n\n\n  static int\n  FT_ConicTo( const FT_Vector  *_cp,\n              const FT_Vector  *to,\n              void             *user )\n  {\n    return 0;\n  }\n\n\n  static int\n  FT_CubicTo( const FT_Vector  *cp1,\n              const FT_Vector  *cp2,\n              const FT_Vector  *to,\n              void             *user )\n  {\n    return 0;\n  }\n\n\n  static FT_Outline_Funcs outlinefuncs =\n  {\n    FT_MoveTo,\n    FT_LineTo,\n    FT_ConicTo,\n    FT_CubicTo,\n    0, 0          /* No shift, no delta */\n  };\n\n\n  static void\n  TestFace( FT_Face  face )\n  {\n    int  gid;\n    int  load_flags = FT_LOAD_DEFAULT;\n\n\n    if ( check_outlines         &&\n         FT_IS_SCALABLE( face ) )\n      load_flags = FT_LOAD_NO_BITMAP;\n\n    if ( nohints )\n      load_flags |= FT_LOAD_NO_HINTING;\n\n    FT_Set_Char_Size( face, 0, font_size, 72, 72 );\n\n    for ( gid = 0; gid < face->num_glyphs; ++gid )\n    {\n      if ( check_outlines         &&\n           FT_IS_SCALABLE( face ) )\n      {\n        if ( !FT_Load_Glyph( face, gid, load_flags ) )\n          FT_Outline_Decompose( &face->glyph->outline, &outlinefuncs, NULL );\n      }\n      else\n        FT_Load_Glyph( face, gid, load_flags );\n\n      if ( rasterize )\n        FT_Render_Glyph( face->glyph, ft_render_mode_normal );\n    }\n\n    FT_Done_Face( face );\n  }\n\n\n  static void\n  ExecuteTest( char*  testfont )\n  {\n    FT_Library  context;\n    FT_Face     face;\n\n\n    if ( FT_Init_FreeType( &context ) )\n    {\n      fprintf( stderr, \"Can't initialize FreeType.\\n\" );\n      exit( 1 );\n    }\n\n    if ( FT_New_Face( context, testfont, 0, &face ) )\n    {\n      /* The font is erroneous, so if this fails that's ok. */\n      exit( 0 );\n    }\n\n    if ( face->num_faces == 1 )\n      TestFace( face );\n    else\n    {\n      int  i, num;\n\n\n      num = face->num_faces;\n      FT_Done_Face( face );\n\n      for ( i = 0; i < num; ++i )\n      {\n        if ( !FT_New_Face( context, testfont, i, &face ) )\n          TestFace( face );\n      }\n    }\n\n    exit( 0 );\n  }\n\n\n  static int\n  extmatch( char*   filename,\n            char**  extensions )\n  {\n    int    i;\n    char*  pt;\n\n\n    if ( extensions == NULL )\n      return true;\n\n    pt = strrchr( filename, '.' );\n    if ( pt == NULL )\n      return false;\n    if ( pt < strrchr( filename, '/' ) )\n      return false;\n\n    for ( i = 0; extensions[i] != NULL; ++i )\n      if ( strcasecmp( pt + 1, extensions[i] ) == 0 ||\n           strcasecmp( pt,     extensions[i] ) == 0 )\n        return true;\n\n    return false;\n  }\n\n\n  static void\n  figurefiletype( struct fontlist*  item )\n  {\n    FILE*  foo;\n\n\n    item->isbinary = item->isascii = item->ishex = false;\n\n    foo = fopen( item->name, \"rb\" );\n    if ( foo != NULL )\n    {\n      /* Try to guess the file type from the first few characters... */\n      int  ch1 = getc( foo );\n      int  ch2 = getc( foo );\n      int  ch3 = getc( foo );\n      int  ch4 = getc( foo );\n\n\n      fclose( foo );\n\n      if ( ( ch1 == 0   && ch2 == 1   && ch3 == 0   && ch4 == 0   ) ||\n           ( ch1 == 'O' && ch2 == 'T' && ch3 == 'T' && ch4 == 'O' ) ||\n           ( ch1 == 't' && ch2 == 'r' && ch3 == 'u' && ch4 == 'e' ) ||\n           ( ch1 == 't' && ch2 == 't' && ch3 == 'c' && ch4 == 'f' ) )\n      {\n        /* ttf, otf, ttc files */\n        item->isbinary = true;\n      }\n      else if ( ch1 == 0x80 && ch2 == '\\01' )\n      {\n        /* PFB header */\n        item->isbinary = true;\n      }\n      else if ( ch1 == '%' && ch2 == '!' )\n      {\n        /* Random PostScript */\n        if ( strstr( item->name, \".pfa\" ) != NULL ||\n             strstr( item->name, \".PFA\" ) != NULL )\n          item->ishex = true;\n        else\n          item->isascii = true;\n      }\n      else if ( ch1 == 1 && ch2 == 0 && ch3 == 4 )\n      {\n        /* Bare CFF */\n        item->isbinary = true;\n      }\n      else if ( ch1 == 'S' && ch2 == 'T' && ch3 == 'A' && ch4 == 'R' )\n      {\n        /* BDF */\n        item->ishex = true;\n      }\n      else if ( ch1 == 'P' && ch2 == 'F' && ch3 == 'R' && ch4 == '0' )\n      {\n        /* PFR */\n        item->isbinary = true;\n      }\n      else if ( ( ch1 == '\\1' && ch2 == 'f' && ch3 == 'c' && ch4 == 'p' ) ||\n                ( ch1 == 'M'  && ch2 == 'Z' )                             )\n      {\n        /* Windows FON */\n        item->isbinary = true;\n      }\n      else\n      {\n        fprintf( stderr,\n                 \"Can't recognize file type of `%s', assuming binary\\n\",\n                 item->name );\n        item->isbinary = true;\n      }\n    }\n    else\n    {\n      fprintf( stderr, \"Can't open `%s' for typing the file.\\n\",\n               item->name );\n      item->isbinary = true;\n    }\n  }\n\n\n  static void\n  FindFonts( char**  fontdirs,\n             char**  extensions )\n  {\n    int          i, max;\n    char         buffer[1025];\n    struct stat  statb;\n\n\n    max  = 0;\n    fcnt = 0;\n\n    for ( i = 0; fontdirs[i] != NULL; ++i )\n    {\n      DIR*            examples;\n      struct dirent*  ent;\n\n\n      examples = opendir( fontdirs[i] );\n      if ( examples == NULL )\n      {\n        fprintf( stderr,\n                 \"Can't open example font directory `%s'\\n\",\n                 fontdirs[i] );\n        exit( 1 );\n      }\n\n      while ( ( ent = readdir( examples ) ) != NULL )\n      {\n        snprintf( buffer, sizeof ( buffer ),\n                  \"%s/%s\", fontdirs[i], ent->d_name );\n        if ( stat( buffer, &statb ) == -1 || S_ISDIR( statb.st_mode ) )\n          continue;\n        if ( extensions == NULL || extmatch( buffer, extensions ) )\n        {\n          if ( fcnt >= max )\n          {\n            max += 100;\n            fontlist = realloc( fontlist, max * sizeof ( struct fontlist ) );\n            if ( fontlist == NULL )\n            {\n              fprintf( stderr, \"Can't allocate memory\\n\" );\n              exit( 1 );\n            }\n          }\n\n          fontlist[fcnt].name = strdup( buffer );\n          fontlist[fcnt].len  = statb.st_size;\n\n          figurefiletype( &fontlist[fcnt] );\n          ++fcnt;\n        }\n      }\n\n      closedir( examples );\n    }\n\n    if ( fcnt == 0 )\n    {\n      fprintf( stderr, \"Can't find matching font files.\\n\" );\n      exit( 1 );\n    }\n\n    fontlist[fcnt].name = NULL;\n  }\n\n\n  static int\n  getErrorCnt( struct fontlist*  item )\n  {\n    if ( error_count == 0 && error_fraction == 0 )\n      return 0;\n\n    return error_count + ceil( error_fraction * item->len );\n  }\n\n\n  static int\n  getRandom( int  low,\n             int  high )\n  {\n    if ( low - high < 0x10000L )\n      return low + ( ( random() >> 8 ) % ( high + 1 - low ) );\n\n    return low + ( random() % ( high + 1 - low ) );\n  }\n\n\n  static int\n  copyfont( struct fontlist*  item,\n            char*             newfont )\n  {\n    static char  buffer[8096];\n    FILE         *good, *new;\n    int          len;\n    int          i, err_cnt;\n\n\n    good = fopen( item->name, \"r\" );\n    if ( good == NULL )\n    {\n      fprintf( stderr, \"Can't open `%s'\\n\", item->name );\n      return false;\n    }\n\n    new = fopen( newfont, \"w+\" );\n    if ( new == NULL )\n    {\n      fprintf( stderr, \"Can't create temporary output file `%s'\\n\",\n               newfont );\n      exit( 1 );\n    }\n\n    while ( ( len = fread( buffer, 1, sizeof ( buffer ), good ) ) > 0 )\n      fwrite( buffer, 1, len, new );\n\n    fclose( good );\n\n    err_cnt = getErrorCnt( item );\n    for ( i = 0; i < err_cnt; ++i )\n    {\n      fseek( new, getRandom( 0, item->len - 1 ), SEEK_SET );\n\n      if ( item->isbinary )\n        putc( getRandom( 0, 0xFF ), new );\n      else if ( item->isascii )\n        putc( getRandom( 0x20, 0x7E ), new );\n      else\n      {\n        int  hex = getRandom( 0, 15 );\n\n\n        if ( hex < 10 )\n          hex += '0';\n        else\n          hex += 'A' - 10;\n\n        putc( hex, new );\n      }\n    }\n\n    if ( ferror( new ) )\n    {\n      fclose( new );\n      unlink( newfont );\n      return false;\n    }\n\n    fclose( new );\n\n    return true;\n  }\n\n\n  static int  child_pid;\n\n  static void\n  abort_test( int  sig )\n  {\n    /* If a time-out happens, then kill the child */\n    kill( child_pid, SIGFPE );\n    write( 2, \"Timeout... \", 11 );\n  }\n\n\n  static void\n  do_test( void )\n  {\n    int         i        = getRandom( 0, fcnt - 1 );\n    static int  test_num = 0;\n    char        buffer[1024];\n\n\n    sprintf( buffer, \"%s/test%d\", results_dir, test_num++ );\n\n    if ( copyfont ( &fontlist[i], buffer ) )\n    {\n      signal( SIGALRM, abort_test );\n      /* Anything that takes more than 20 seconds */\n      /* to parse and/or rasterize is an error.   */\n      alarm( 20 );\n      if ( ( child_pid = fork() ) == 0 )\n        ExecuteTest( buffer );\n      else if ( child_pid != -1 )\n      {\n        int  status;\n\n\n        waitpid( child_pid, &status, 0 );\n        alarm( 0 );\n        if ( WIFSIGNALED ( status ) )\n          printf( \"Error found in file `%s'\\n\", buffer );\n        else\n          unlink( buffer );\n      }\n      else\n      {\n        fprintf( stderr, \"Can't fork test case.\\n\" );\n        exit( 1 );\n      }\n      alarm( 0 );\n    }\n  }\n\n\n  static void\n  usage( FILE*  out,\n         char*  name )\n  {\n    fprintf( out, \"%s [options] -- Generate random erroneous fonts\\n\"\n                  \"  and attempt to parse them with FreeType.\\n\\n\", name );\n\n    fprintf( out, \"  --all                    All non-directory files are assumed to be fonts.\\n\" );\n    fprintf( out, \"  --check-outlines         Make sure we can parse the outlines of each glyph.\\n\" );\n    fprintf( out, \"  --dir <path>             Append <path> to list of font search directories.\\n\" );\n    fprintf( out, \"  --error-count <cnt>      Introduce <cnt> single byte errors into each font.\\n\" );\n    fprintf( out, \"  --error-fraction <frac>  Introduce <frac>*filesize single byte errors\\n\"\n                  \"                           into each font.\\n\" );\n    fprintf( out, \"  --ext <ext>              Add <ext> to list of extensions indicating fonts.\\n\" );\n    fprintf( out, \"  --help                   Print this.\\n\" );\n    fprintf( out, \"  --nohints                Turn off hinting.\\n\" );\n    fprintf( out, \"  --rasterize              Attempt to rasterize each glyph.\\n\" );\n    fprintf( out, \"  --results <dir>          Directory in which to place the test fonts.\\n\" );\n    fprintf( out, \"  --size <float>           Use the given font size for the tests.\\n\" );\n    fprintf( out, \"  --test <file>            Run a single test on an already existing file.\\n\" );\n  }\n\n\n  int\n  main( int     argc,\n        char**  argv )\n  {\n    char    **dirs, **exts;\n    int     dcnt = 0, ecnt = 0, rset = false, allexts = false;\n    int     i;\n    time_t  now;\n    char*   testfile = NULL;\n\n\n    dirs = calloc( argc + 1, sizeof ( char ** ) );\n    exts = calloc( argc + 1, sizeof ( char ** ) );\n\n    for ( i = 1; i < argc; ++i )\n    {\n      char*  pt = argv[i];\n      char*  end;\n\n\n      if ( pt[0] == '-' && pt[1] == '-' )\n        ++pt;\n\n      if ( strcmp( pt, \"-all\" ) == 0 )\n        allexts = true;\n      else if ( strcmp( pt, \"-check-outlines\" ) == 0 )\n        check_outlines = true;\n      else if ( strcmp( pt, \"-dir\" ) == 0 )\n        dirs[dcnt++] = argv[++i];\n      else if ( strcmp( pt, \"-error-count\" ) == 0 )\n      {\n        if ( !rset )\n          error_fraction = 0;\n        rset = true;\n        error_count = strtol( argv[++i], &end, 10 );\n        if ( *end != '\\0' )\n        {\n          fprintf( stderr, \"Bad value for error-count: %s\\n\", argv[i] );\n          exit( 1 );\n        }\n      }\n      else if ( strcmp( pt, \"-error-fraction\" ) == 0 )\n      {\n        if ( !rset )\n          error_count = 0;\n        rset = true;\n        error_fraction = strtod( argv[++i], &end );\n        if ( *end != '\\0' )\n        {\n          fprintf( stderr, \"Bad value for error-fraction: %s\\n\", argv[i] );\n          exit( 1 );\n        }\n      }\n      else if ( strcmp( pt, \"-ext\" ) == 0 )\n        exts[ecnt++] = argv[++i];\n      else if ( strcmp( pt, \"-help\" ) == 0 )\n      {\n        usage( stdout, argv[0] );\n        exit( 0 );\n      }\n      else if ( strcmp( pt, \"-nohints\" ) == 0 )\n        nohints = true;\n      else if ( strcmp( pt, \"-rasterize\" ) == 0 )\n        rasterize = true;\n      else if ( strcmp( pt, \"-results\" ) == 0 )\n        results_dir = argv[++i];\n      else if ( strcmp( pt, \"-size\" ) == 0 )\n      {\n        font_size = (FT_F26Dot6)( strtod( argv[++i], &end ) * 64 );\n        if ( *end != '\\0' || font_size < 64 )\n        {\n          fprintf( stderr, \"Bad value for size: %s\\n\", argv[i] );\n          exit( 1 );\n        }\n      }\n      else if ( strcmp( pt, \"-test\" ) == 0 )\n        testfile = argv[++i];\n      else\n      {\n        usage( stderr, argv[0] );\n        exit( 1 );\n      }\n    }\n\n    if ( allexts )\n    {\n      free( exts );\n      exts = NULL;\n    }\n    else if ( ecnt == 0 )\n    {\n      free( exts );\n      exts = default_ext_list;\n    }\n\n    if ( dcnt == 0 )\n    {\n      free( dirs );\n      dirs = default_dir_list;\n    }\n\n    if ( testfile != NULL )\n      ExecuteTest( testfile );         /* This should never return */\n\n    time( &now );\n    srandom( now );\n\n    FindFonts( dirs, exts );\n    mkdir( results_dir, 0755 );\n\n    forever\n      do_test();\n\n    return 0;\n  }\n\n\n/* EOF */\n"
  },
  {
    "path": "ext/freetype2/src/tools/glnames.py",
    "content": "#!/usr/bin/env python\n#\n\n#\n# FreeType 2 glyph name builder\n#\n\n\n# Copyright 1996-2000, 2003, 2005, 2007, 2008, 2011 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\n\"\"\"\\\n\nusage: %s <output-file>\n\n  This python script generates the glyph names tables defined in the\n  `psnames' module.\n\n  Its single argument is the name of the header file to be created.\n\"\"\"\n\n\nimport sys, string, struct, re, os.path\n\n\n# This table lists the glyphs according to the Macintosh specification.\n# It is used by the TrueType Postscript names table.\n#\n# See\n#\n#   http://fonts.apple.com/TTRefMan/RM06/Chap6post.html\n#\n# for the official list.\n#\nmac_standard_names = \\\n[\n  # 0\n  \".notdef\", \".null\", \"nonmarkingreturn\", \"space\", \"exclam\",\n  \"quotedbl\", \"numbersign\", \"dollar\", \"percent\", \"ampersand\",\n\n  # 10\n  \"quotesingle\", \"parenleft\", \"parenright\", \"asterisk\", \"plus\",\n  \"comma\", \"hyphen\", \"period\", \"slash\", \"zero\",\n\n  # 20\n  \"one\", \"two\", \"three\", \"four\", \"five\",\n  \"six\", \"seven\", \"eight\", \"nine\", \"colon\",\n\n  # 30\n  \"semicolon\", \"less\", \"equal\", \"greater\", \"question\",\n  \"at\", \"A\", \"B\", \"C\", \"D\",\n\n  # 40\n  \"E\", \"F\", \"G\", \"H\", \"I\",\n  \"J\", \"K\", \"L\", \"M\", \"N\",\n\n  # 50\n  \"O\", \"P\", \"Q\", \"R\", \"S\",\n  \"T\", \"U\", \"V\", \"W\", \"X\",\n\n  # 60\n  \"Y\", \"Z\", \"bracketleft\", \"backslash\", \"bracketright\",\n  \"asciicircum\", \"underscore\", \"grave\", \"a\", \"b\",\n\n  # 70\n  \"c\", \"d\", \"e\", \"f\", \"g\",\n  \"h\", \"i\", \"j\", \"k\", \"l\",\n\n  # 80\n  \"m\", \"n\", \"o\", \"p\", \"q\",\n  \"r\", \"s\", \"t\", \"u\", \"v\",\n\n  # 90\n  \"w\", \"x\", \"y\", \"z\", \"braceleft\",\n  \"bar\", \"braceright\", \"asciitilde\", \"Adieresis\", \"Aring\",\n\n  # 100\n  \"Ccedilla\", \"Eacute\", \"Ntilde\", \"Odieresis\", \"Udieresis\",\n  \"aacute\", \"agrave\", \"acircumflex\", \"adieresis\", \"atilde\",\n\n  # 110\n  \"aring\", \"ccedilla\", \"eacute\", \"egrave\", \"ecircumflex\",\n  \"edieresis\", \"iacute\", \"igrave\", \"icircumflex\", \"idieresis\",\n\n  # 120\n  \"ntilde\", \"oacute\", \"ograve\", \"ocircumflex\", \"odieresis\",\n  \"otilde\", \"uacute\", \"ugrave\", \"ucircumflex\", \"udieresis\",\n\n  # 130\n  \"dagger\", \"degree\", \"cent\", \"sterling\", \"section\",\n  \"bullet\", \"paragraph\", \"germandbls\", \"registered\", \"copyright\",\n\n  # 140\n  \"trademark\", \"acute\", \"dieresis\", \"notequal\", \"AE\",\n  \"Oslash\", \"infinity\", \"plusminus\", \"lessequal\", \"greaterequal\",\n\n  # 150\n  \"yen\", \"mu\", \"partialdiff\", \"summation\", \"product\",\n  \"pi\", \"integral\", \"ordfeminine\", \"ordmasculine\", \"Omega\",\n\n  # 160\n  \"ae\", \"oslash\", \"questiondown\", \"exclamdown\", \"logicalnot\",\n  \"radical\", \"florin\", \"approxequal\", \"Delta\", \"guillemotleft\",\n\n  # 170\n  \"guillemotright\", \"ellipsis\", \"nonbreakingspace\", \"Agrave\", \"Atilde\",\n  \"Otilde\", \"OE\", \"oe\", \"endash\", \"emdash\",\n\n  # 180\n  \"quotedblleft\", \"quotedblright\", \"quoteleft\", \"quoteright\", \"divide\",\n  \"lozenge\", \"ydieresis\", \"Ydieresis\", \"fraction\", \"currency\",\n\n  # 190\n  \"guilsinglleft\", \"guilsinglright\", \"fi\", \"fl\", \"daggerdbl\",\n  \"periodcentered\", \"quotesinglbase\", \"quotedblbase\", \"perthousand\",\n    \"Acircumflex\",\n\n  # 200\n  \"Ecircumflex\", \"Aacute\", \"Edieresis\", \"Egrave\", \"Iacute\",\n  \"Icircumflex\", \"Idieresis\", \"Igrave\", \"Oacute\", \"Ocircumflex\",\n\n  # 210\n  \"apple\", \"Ograve\", \"Uacute\", \"Ucircumflex\", \"Ugrave\",\n  \"dotlessi\", \"circumflex\", \"tilde\", \"macron\", \"breve\",\n\n  # 220\n  \"dotaccent\", \"ring\", \"cedilla\", \"hungarumlaut\", \"ogonek\",\n  \"caron\", \"Lslash\", \"lslash\", \"Scaron\", \"scaron\",\n\n  # 230\n  \"Zcaron\", \"zcaron\", \"brokenbar\", \"Eth\", \"eth\",\n  \"Yacute\", \"yacute\", \"Thorn\", \"thorn\", \"minus\",\n\n  # 240\n  \"multiply\", \"onesuperior\", \"twosuperior\", \"threesuperior\", \"onehalf\",\n  \"onequarter\", \"threequarters\", \"franc\", \"Gbreve\", \"gbreve\",\n\n  # 250\n  \"Idotaccent\", \"Scedilla\", \"scedilla\", \"Cacute\", \"cacute\",\n  \"Ccaron\", \"ccaron\", \"dcroat\"\n]\n\n\n# The list of standard `SID' glyph names.  For the official list,\n# see Annex A of document at\n#\n#   http://partners.adobe.com/public/developer/en/font/5176.CFF.pdf  .\n#\nsid_standard_names = \\\n[\n  # 0\n  \".notdef\", \"space\", \"exclam\", \"quotedbl\", \"numbersign\",\n  \"dollar\", \"percent\", \"ampersand\", \"quoteright\", \"parenleft\",\n\n  # 10\n  \"parenright\", \"asterisk\", \"plus\", \"comma\", \"hyphen\",\n  \"period\", \"slash\", \"zero\", \"one\", \"two\",\n\n  # 20\n  \"three\", \"four\", \"five\", \"six\", \"seven\",\n  \"eight\", \"nine\", \"colon\", \"semicolon\", \"less\",\n\n  # 30\n  \"equal\", \"greater\", \"question\", \"at\", \"A\",\n  \"B\", \"C\", \"D\", \"E\", \"F\",\n\n  # 40\n  \"G\", \"H\", \"I\", \"J\", \"K\",\n  \"L\", \"M\", \"N\", \"O\", \"P\",\n\n  # 50\n  \"Q\", \"R\", \"S\", \"T\", \"U\",\n  \"V\", \"W\", \"X\", \"Y\", \"Z\",\n\n  # 60\n  \"bracketleft\", \"backslash\", \"bracketright\", \"asciicircum\", \"underscore\",\n  \"quoteleft\", \"a\", \"b\", \"c\", \"d\",\n\n  # 70\n  \"e\", \"f\", \"g\", \"h\", \"i\",\n  \"j\", \"k\", \"l\", \"m\", \"n\",\n\n  # 80\n  \"o\", \"p\", \"q\", \"r\", \"s\",\n  \"t\", \"u\", \"v\", \"w\", \"x\",\n\n  # 90\n  \"y\", \"z\", \"braceleft\", \"bar\", \"braceright\",\n  \"asciitilde\", \"exclamdown\", \"cent\", \"sterling\", \"fraction\",\n\n  # 100\n  \"yen\", \"florin\", \"section\", \"currency\", \"quotesingle\",\n  \"quotedblleft\", \"guillemotleft\", \"guilsinglleft\", \"guilsinglright\", \"fi\",\n\n  # 110\n  \"fl\", \"endash\", \"dagger\", \"daggerdbl\", \"periodcentered\",\n  \"paragraph\", \"bullet\", \"quotesinglbase\", \"quotedblbase\", \"quotedblright\",\n\n  # 120\n  \"guillemotright\", \"ellipsis\", \"perthousand\", \"questiondown\", \"grave\",\n  \"acute\", \"circumflex\", \"tilde\", \"macron\", \"breve\",\n\n  # 130\n  \"dotaccent\", \"dieresis\", \"ring\", \"cedilla\", \"hungarumlaut\",\n  \"ogonek\", \"caron\", \"emdash\", \"AE\", \"ordfeminine\",\n\n  # 140\n  \"Lslash\", \"Oslash\", \"OE\", \"ordmasculine\", \"ae\",\n  \"dotlessi\", \"lslash\", \"oslash\", \"oe\", \"germandbls\",\n\n  # 150\n  \"onesuperior\", \"logicalnot\", \"mu\", \"trademark\", \"Eth\",\n  \"onehalf\", \"plusminus\", \"Thorn\", \"onequarter\", \"divide\",\n\n  # 160\n  \"brokenbar\", \"degree\", \"thorn\", \"threequarters\", \"twosuperior\",\n  \"registered\", \"minus\", \"eth\", \"multiply\", \"threesuperior\",\n\n  # 170\n  \"copyright\", \"Aacute\", \"Acircumflex\", \"Adieresis\", \"Agrave\",\n  \"Aring\", \"Atilde\", \"Ccedilla\", \"Eacute\", \"Ecircumflex\",\n\n  # 180\n  \"Edieresis\", \"Egrave\", \"Iacute\", \"Icircumflex\", \"Idieresis\",\n  \"Igrave\", \"Ntilde\", \"Oacute\", \"Ocircumflex\", \"Odieresis\",\n\n  # 190\n  \"Ograve\", \"Otilde\", \"Scaron\", \"Uacute\", \"Ucircumflex\",\n  \"Udieresis\", \"Ugrave\", \"Yacute\", \"Ydieresis\", \"Zcaron\",\n\n  # 200\n  \"aacute\", \"acircumflex\", \"adieresis\", \"agrave\", \"aring\",\n  \"atilde\", \"ccedilla\", \"eacute\", \"ecircumflex\", \"edieresis\",\n\n  # 210\n  \"egrave\", \"iacute\", \"icircumflex\", \"idieresis\", \"igrave\",\n  \"ntilde\", \"oacute\", \"ocircumflex\", \"odieresis\", \"ograve\",\n\n  # 220\n  \"otilde\", \"scaron\", \"uacute\", \"ucircumflex\", \"udieresis\",\n  \"ugrave\", \"yacute\", \"ydieresis\", \"zcaron\", \"exclamsmall\",\n\n  # 230\n  \"Hungarumlautsmall\", \"dollaroldstyle\", \"dollarsuperior\", \"ampersandsmall\",\n    \"Acutesmall\",\n  \"parenleftsuperior\", \"parenrightsuperior\", \"twodotenleader\",\n    \"onedotenleader\", \"zerooldstyle\",\n\n  # 240\n  \"oneoldstyle\", \"twooldstyle\", \"threeoldstyle\", \"fouroldstyle\",\n    \"fiveoldstyle\",\n  \"sixoldstyle\", \"sevenoldstyle\", \"eightoldstyle\", \"nineoldstyle\",\n    \"commasuperior\",\n\n  # 250\n  \"threequartersemdash\", \"periodsuperior\", \"questionsmall\", \"asuperior\",\n    \"bsuperior\",\n  \"centsuperior\", \"dsuperior\", \"esuperior\", \"isuperior\", \"lsuperior\",\n\n  # 260\n  \"msuperior\", \"nsuperior\", \"osuperior\", \"rsuperior\", \"ssuperior\",\n  \"tsuperior\", \"ff\", \"ffi\", \"ffl\", \"parenleftinferior\",\n\n  # 270\n  \"parenrightinferior\", \"Circumflexsmall\", \"hyphensuperior\", \"Gravesmall\",\n    \"Asmall\",\n  \"Bsmall\", \"Csmall\", \"Dsmall\", \"Esmall\", \"Fsmall\",\n\n  # 280\n  \"Gsmall\", \"Hsmall\", \"Ismall\", \"Jsmall\", \"Ksmall\",\n  \"Lsmall\", \"Msmall\", \"Nsmall\", \"Osmall\", \"Psmall\",\n\n  # 290\n  \"Qsmall\", \"Rsmall\", \"Ssmall\", \"Tsmall\", \"Usmall\",\n  \"Vsmall\", \"Wsmall\", \"Xsmall\", \"Ysmall\", \"Zsmall\",\n\n  # 300\n  \"colonmonetary\", \"onefitted\", \"rupiah\", \"Tildesmall\", \"exclamdownsmall\",\n  \"centoldstyle\", \"Lslashsmall\", \"Scaronsmall\", \"Zcaronsmall\",\n    \"Dieresissmall\",\n\n  # 310\n  \"Brevesmall\", \"Caronsmall\", \"Dotaccentsmall\", \"Macronsmall\", \"figuredash\",\n  \"hypheninferior\", \"Ogoneksmall\", \"Ringsmall\", \"Cedillasmall\",\n    \"questiondownsmall\",\n\n  # 320\n  \"oneeighth\", \"threeeighths\", \"fiveeighths\", \"seveneighths\", \"onethird\",\n  \"twothirds\", \"zerosuperior\", \"foursuperior\", \"fivesuperior\",\n    \"sixsuperior\",\n\n  # 330\n  \"sevensuperior\", \"eightsuperior\", \"ninesuperior\", \"zeroinferior\",\n    \"oneinferior\",\n  \"twoinferior\", \"threeinferior\", \"fourinferior\", \"fiveinferior\",\n    \"sixinferior\",\n\n  # 340\n  \"seveninferior\", \"eightinferior\", \"nineinferior\", \"centinferior\",\n    \"dollarinferior\",\n  \"periodinferior\", \"commainferior\", \"Agravesmall\", \"Aacutesmall\",\n    \"Acircumflexsmall\",\n\n  # 350\n  \"Atildesmall\", \"Adieresissmall\", \"Aringsmall\", \"AEsmall\", \"Ccedillasmall\",\n  \"Egravesmall\", \"Eacutesmall\", \"Ecircumflexsmall\", \"Edieresissmall\",\n    \"Igravesmall\",\n\n  # 360\n  \"Iacutesmall\", \"Icircumflexsmall\", \"Idieresissmall\", \"Ethsmall\",\n    \"Ntildesmall\",\n  \"Ogravesmall\", \"Oacutesmall\", \"Ocircumflexsmall\", \"Otildesmall\",\n    \"Odieresissmall\",\n\n  # 370\n  \"OEsmall\", \"Oslashsmall\", \"Ugravesmall\", \"Uacutesmall\",\n    \"Ucircumflexsmall\",\n  \"Udieresissmall\", \"Yacutesmall\", \"Thornsmall\", \"Ydieresissmall\",\n    \"001.000\",\n\n  # 380\n  \"001.001\", \"001.002\", \"001.003\", \"Black\", \"Bold\",\n  \"Book\", \"Light\", \"Medium\", \"Regular\", \"Roman\",\n\n  # 390\n  \"Semibold\"\n]\n\n\n# This table maps character codes of the Adobe Standard Type 1\n# encoding to glyph indices in the sid_standard_names table.\n#\nt1_standard_encoding = \\\n[\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   1,   2,   3,   4,   5,   6,   7,   8,\n    9,  10,  11,  12,  13,  14,  15,  16,  17,  18,\n\n   19,  20,  21,  22,  23,  24,  25,  26,  27,  28,\n   29,  30,  31,  32,  33,  34,  35,  36,  37,  38,\n   39,  40,  41,  42,  43,  44,  45,  46,  47,  48,\n   49,  50,  51,  52,  53,  54,  55,  56,  57,  58,\n   59,  60,  61,  62,  63,  64,  65,  66,  67,  68,\n\n   69,  70,  71,  72,  73,  74,  75,  76,  77,  78,\n   79,  80,  81,  82,  83,  84,  85,  86,  87,  88,\n   89,  90,  91,  92,  93,  94,  95,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,  96,  97,  98,  99, 100, 101, 102, 103, 104,\n  105, 106, 107, 108, 109, 110,   0, 111, 112, 113,\n  114,   0, 115, 116, 117, 118, 119, 120, 121, 122,\n    0, 123,   0, 124, 125, 126, 127, 128, 129, 130,\n\n  131,   0, 132, 133,   0, 134, 135, 136, 137,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0, 138,   0, 139,   0,   0,\n    0,   0, 140, 141, 142, 143,   0,   0,   0,   0,\n    0, 144,   0,   0,   0, 145,   0,   0, 146, 147,\n\n  148, 149,   0,   0,   0,   0\n]\n\n\n# This table maps character codes of the Adobe Expert Type 1\n# encoding to glyph indices in the sid_standard_names table.\n#\nt1_expert_encoding = \\\n[\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   1, 229, 230,   0, 231, 232, 233, 234,\n  235, 236, 237, 238,  13,  14,  15,  99, 239, 240,\n\n  241, 242, 243, 244, 245, 246, 247, 248,  27,  28,\n  249, 250, 251, 252,   0, 253, 254, 255, 256, 257,\n    0,   0,   0, 258,   0,   0, 259, 260, 261, 262,\n    0,   0, 263, 264, 265,   0, 266, 109, 110, 267,\n  268, 269,   0, 270, 271, 272, 273, 274, 275, 276,\n\n  277, 278, 279, 280, 281, 282, 283, 284, 285, 286,\n  287, 288, 289, 290, 291, 292, 293, 294, 295, 296,\n  297, 298, 299, 300, 301, 302, 303,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n\n    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n    0, 304, 305, 306,   0,   0, 307, 308, 309, 310,\n  311,   0, 312,   0,   0, 313,   0,   0, 314, 315,\n    0,   0, 316, 317, 318,   0,   0,   0, 158, 155,\n  163, 319, 320, 321, 322, 323, 324, 325,   0,   0,\n\n  326, 150, 164, 169, 327, 328, 329, 330, 331, 332,\n  333, 334, 335, 336, 337, 338, 339, 340, 341, 342,\n  343, 344, 345, 346, 347, 348, 349, 350, 351, 352,\n  353, 354, 355, 356, 357, 358, 359, 360, 361, 362,\n  363, 364, 365, 366, 367, 368, 369, 370, 371, 372,\n\n  373, 374, 375, 376, 377, 378\n]\n\n\n# This data has been taken literally from the files `glyphlist.txt'\n# and `zapfdingbats.txt' version 2.0, Sept 2002.  It is available from\n#\n#   http://sourceforge.net/adobe/aglfn/\n#\nadobe_glyph_list = \"\"\"\\\nA;0041\nAE;00C6\nAEacute;01FC\nAEmacron;01E2\nAEsmall;F7E6\nAacute;00C1\nAacutesmall;F7E1\nAbreve;0102\nAbreveacute;1EAE\nAbrevecyrillic;04D0\nAbrevedotbelow;1EB6\nAbrevegrave;1EB0\nAbrevehookabove;1EB2\nAbrevetilde;1EB4\nAcaron;01CD\nAcircle;24B6\nAcircumflex;00C2\nAcircumflexacute;1EA4\nAcircumflexdotbelow;1EAC\nAcircumflexgrave;1EA6\nAcircumflexhookabove;1EA8\nAcircumflexsmall;F7E2\nAcircumflextilde;1EAA\nAcute;F6C9\nAcutesmall;F7B4\nAcyrillic;0410\nAdblgrave;0200\nAdieresis;00C4\nAdieresiscyrillic;04D2\nAdieresismacron;01DE\nAdieresissmall;F7E4\nAdotbelow;1EA0\nAdotmacron;01E0\nAgrave;00C0\nAgravesmall;F7E0\nAhookabove;1EA2\nAiecyrillic;04D4\nAinvertedbreve;0202\nAlpha;0391\nAlphatonos;0386\nAmacron;0100\nAmonospace;FF21\nAogonek;0104\nAring;00C5\nAringacute;01FA\nAringbelow;1E00\nAringsmall;F7E5\nAsmall;F761\nAtilde;00C3\nAtildesmall;F7E3\nAybarmenian;0531\nB;0042\nBcircle;24B7\nBdotaccent;1E02\nBdotbelow;1E04\nBecyrillic;0411\nBenarmenian;0532\nBeta;0392\nBhook;0181\nBlinebelow;1E06\nBmonospace;FF22\nBrevesmall;F6F4\nBsmall;F762\nBtopbar;0182\nC;0043\nCaarmenian;053E\nCacute;0106\nCaron;F6CA\nCaronsmall;F6F5\nCcaron;010C\nCcedilla;00C7\nCcedillaacute;1E08\nCcedillasmall;F7E7\nCcircle;24B8\nCcircumflex;0108\nCdot;010A\nCdotaccent;010A\nCedillasmall;F7B8\nChaarmenian;0549\nCheabkhasiancyrillic;04BC\nChecyrillic;0427\nChedescenderabkhasiancyrillic;04BE\nChedescendercyrillic;04B6\nChedieresiscyrillic;04F4\nCheharmenian;0543\nChekhakassiancyrillic;04CB\nCheverticalstrokecyrillic;04B8\nChi;03A7\nChook;0187\nCircumflexsmall;F6F6\nCmonospace;FF23\nCoarmenian;0551\nCsmall;F763\nD;0044\nDZ;01F1\nDZcaron;01C4\nDaarmenian;0534\nDafrican;0189\nDcaron;010E\nDcedilla;1E10\nDcircle;24B9\nDcircumflexbelow;1E12\nDcroat;0110\nDdotaccent;1E0A\nDdotbelow;1E0C\nDecyrillic;0414\nDeicoptic;03EE\nDelta;2206\nDeltagreek;0394\nDhook;018A\nDieresis;F6CB\nDieresisAcute;F6CC\nDieresisGrave;F6CD\nDieresissmall;F7A8\nDigammagreek;03DC\nDjecyrillic;0402\nDlinebelow;1E0E\nDmonospace;FF24\nDotaccentsmall;F6F7\nDslash;0110\nDsmall;F764\nDtopbar;018B\nDz;01F2\nDzcaron;01C5\nDzeabkhasiancyrillic;04E0\nDzecyrillic;0405\nDzhecyrillic;040F\nE;0045\nEacute;00C9\nEacutesmall;F7E9\nEbreve;0114\nEcaron;011A\nEcedillabreve;1E1C\nEcharmenian;0535\nEcircle;24BA\nEcircumflex;00CA\nEcircumflexacute;1EBE\nEcircumflexbelow;1E18\nEcircumflexdotbelow;1EC6\nEcircumflexgrave;1EC0\nEcircumflexhookabove;1EC2\nEcircumflexsmall;F7EA\nEcircumflextilde;1EC4\nEcyrillic;0404\nEdblgrave;0204\nEdieresis;00CB\nEdieresissmall;F7EB\nEdot;0116\nEdotaccent;0116\nEdotbelow;1EB8\nEfcyrillic;0424\nEgrave;00C8\nEgravesmall;F7E8\nEharmenian;0537\nEhookabove;1EBA\nEightroman;2167\nEinvertedbreve;0206\nEiotifiedcyrillic;0464\nElcyrillic;041B\nElevenroman;216A\nEmacron;0112\nEmacronacute;1E16\nEmacrongrave;1E14\nEmcyrillic;041C\nEmonospace;FF25\nEncyrillic;041D\nEndescendercyrillic;04A2\nEng;014A\nEnghecyrillic;04A4\nEnhookcyrillic;04C7\nEogonek;0118\nEopen;0190\nEpsilon;0395\nEpsilontonos;0388\nErcyrillic;0420\nEreversed;018E\nEreversedcyrillic;042D\nEscyrillic;0421\nEsdescendercyrillic;04AA\nEsh;01A9\nEsmall;F765\nEta;0397\nEtarmenian;0538\nEtatonos;0389\nEth;00D0\nEthsmall;F7F0\nEtilde;1EBC\nEtildebelow;1E1A\nEuro;20AC\nEzh;01B7\nEzhcaron;01EE\nEzhreversed;01B8\nF;0046\nFcircle;24BB\nFdotaccent;1E1E\nFeharmenian;0556\nFeicoptic;03E4\nFhook;0191\nFitacyrillic;0472\nFiveroman;2164\nFmonospace;FF26\nFourroman;2163\nFsmall;F766\nG;0047\nGBsquare;3387\nGacute;01F4\nGamma;0393\nGammaafrican;0194\nGangiacoptic;03EA\nGbreve;011E\nGcaron;01E6\nGcedilla;0122\nGcircle;24BC\nGcircumflex;011C\nGcommaaccent;0122\nGdot;0120\nGdotaccent;0120\nGecyrillic;0413\nGhadarmenian;0542\nGhemiddlehookcyrillic;0494\nGhestrokecyrillic;0492\nGheupturncyrillic;0490\nGhook;0193\nGimarmenian;0533\nGjecyrillic;0403\nGmacron;1E20\nGmonospace;FF27\nGrave;F6CE\nGravesmall;F760\nGsmall;F767\nGsmallhook;029B\nGstroke;01E4\nH;0048\nH18533;25CF\nH18543;25AA\nH18551;25AB\nH22073;25A1\nHPsquare;33CB\nHaabkhasiancyrillic;04A8\nHadescendercyrillic;04B2\nHardsigncyrillic;042A\nHbar;0126\nHbrevebelow;1E2A\nHcedilla;1E28\nHcircle;24BD\nHcircumflex;0124\nHdieresis;1E26\nHdotaccent;1E22\nHdotbelow;1E24\nHmonospace;FF28\nHoarmenian;0540\nHoricoptic;03E8\nHsmall;F768\nHungarumlaut;F6CF\nHungarumlautsmall;F6F8\nHzsquare;3390\nI;0049\nIAcyrillic;042F\nIJ;0132\nIUcyrillic;042E\nIacute;00CD\nIacutesmall;F7ED\nIbreve;012C\nIcaron;01CF\nIcircle;24BE\nIcircumflex;00CE\nIcircumflexsmall;F7EE\nIcyrillic;0406\nIdblgrave;0208\nIdieresis;00CF\nIdieresisacute;1E2E\nIdieresiscyrillic;04E4\nIdieresissmall;F7EF\nIdot;0130\nIdotaccent;0130\nIdotbelow;1ECA\nIebrevecyrillic;04D6\nIecyrillic;0415\nIfraktur;2111\nIgrave;00CC\nIgravesmall;F7EC\nIhookabove;1EC8\nIicyrillic;0418\nIinvertedbreve;020A\nIishortcyrillic;0419\nImacron;012A\nImacroncyrillic;04E2\nImonospace;FF29\nIniarmenian;053B\nIocyrillic;0401\nIogonek;012E\nIota;0399\nIotaafrican;0196\nIotadieresis;03AA\nIotatonos;038A\nIsmall;F769\nIstroke;0197\nItilde;0128\nItildebelow;1E2C\nIzhitsacyrillic;0474\nIzhitsadblgravecyrillic;0476\nJ;004A\nJaarmenian;0541\nJcircle;24BF\nJcircumflex;0134\nJecyrillic;0408\nJheharmenian;054B\nJmonospace;FF2A\nJsmall;F76A\nK;004B\nKBsquare;3385\nKKsquare;33CD\nKabashkircyrillic;04A0\nKacute;1E30\nKacyrillic;041A\nKadescendercyrillic;049A\nKahookcyrillic;04C3\nKappa;039A\nKastrokecyrillic;049E\nKaverticalstrokecyrillic;049C\nKcaron;01E8\nKcedilla;0136\nKcircle;24C0\nKcommaaccent;0136\nKdotbelow;1E32\nKeharmenian;0554\nKenarmenian;053F\nKhacyrillic;0425\nKheicoptic;03E6\nKhook;0198\nKjecyrillic;040C\nKlinebelow;1E34\nKmonospace;FF2B\nKoppacyrillic;0480\nKoppagreek;03DE\nKsicyrillic;046E\nKsmall;F76B\nL;004C\nLJ;01C7\nLL;F6BF\nLacute;0139\nLambda;039B\nLcaron;013D\nLcedilla;013B\nLcircle;24C1\nLcircumflexbelow;1E3C\nLcommaaccent;013B\nLdot;013F\nLdotaccent;013F\nLdotbelow;1E36\nLdotbelowmacron;1E38\nLiwnarmenian;053C\nLj;01C8\nLjecyrillic;0409\nLlinebelow;1E3A\nLmonospace;FF2C\nLslash;0141\nLslashsmall;F6F9\nLsmall;F76C\nM;004D\nMBsquare;3386\nMacron;F6D0\nMacronsmall;F7AF\nMacute;1E3E\nMcircle;24C2\nMdotaccent;1E40\nMdotbelow;1E42\nMenarmenian;0544\nMmonospace;FF2D\nMsmall;F76D\nMturned;019C\nMu;039C\nN;004E\nNJ;01CA\nNacute;0143\nNcaron;0147\nNcedilla;0145\nNcircle;24C3\nNcircumflexbelow;1E4A\nNcommaaccent;0145\nNdotaccent;1E44\nNdotbelow;1E46\nNhookleft;019D\nNineroman;2168\nNj;01CB\nNjecyrillic;040A\nNlinebelow;1E48\nNmonospace;FF2E\nNowarmenian;0546\nNsmall;F76E\nNtilde;00D1\nNtildesmall;F7F1\nNu;039D\nO;004F\nOE;0152\nOEsmall;F6FA\nOacute;00D3\nOacutesmall;F7F3\nObarredcyrillic;04E8\nObarreddieresiscyrillic;04EA\nObreve;014E\nOcaron;01D1\nOcenteredtilde;019F\nOcircle;24C4\nOcircumflex;00D4\nOcircumflexacute;1ED0\nOcircumflexdotbelow;1ED8\nOcircumflexgrave;1ED2\nOcircumflexhookabove;1ED4\nOcircumflexsmall;F7F4\nOcircumflextilde;1ED6\nOcyrillic;041E\nOdblacute;0150\nOdblgrave;020C\nOdieresis;00D6\nOdieresiscyrillic;04E6\nOdieresissmall;F7F6\nOdotbelow;1ECC\nOgoneksmall;F6FB\nOgrave;00D2\nOgravesmall;F7F2\nOharmenian;0555\nOhm;2126\nOhookabove;1ECE\nOhorn;01A0\nOhornacute;1EDA\nOhorndotbelow;1EE2\nOhorngrave;1EDC\nOhornhookabove;1EDE\nOhorntilde;1EE0\nOhungarumlaut;0150\nOi;01A2\nOinvertedbreve;020E\nOmacron;014C\nOmacronacute;1E52\nOmacrongrave;1E50\nOmega;2126\nOmegacyrillic;0460\nOmegagreek;03A9\nOmegaroundcyrillic;047A\nOmegatitlocyrillic;047C\nOmegatonos;038F\nOmicron;039F\nOmicrontonos;038C\nOmonospace;FF2F\nOneroman;2160\nOogonek;01EA\nOogonekmacron;01EC\nOopen;0186\nOslash;00D8\nOslashacute;01FE\nOslashsmall;F7F8\nOsmall;F76F\nOstrokeacute;01FE\nOtcyrillic;047E\nOtilde;00D5\nOtildeacute;1E4C\nOtildedieresis;1E4E\nOtildesmall;F7F5\nP;0050\nPacute;1E54\nPcircle;24C5\nPdotaccent;1E56\nPecyrillic;041F\nPeharmenian;054A\nPemiddlehookcyrillic;04A6\nPhi;03A6\nPhook;01A4\nPi;03A0\nPiwrarmenian;0553\nPmonospace;FF30\nPsi;03A8\nPsicyrillic;0470\nPsmall;F770\nQ;0051\nQcircle;24C6\nQmonospace;FF31\nQsmall;F771\nR;0052\nRaarmenian;054C\nRacute;0154\nRcaron;0158\nRcedilla;0156\nRcircle;24C7\nRcommaaccent;0156\nRdblgrave;0210\nRdotaccent;1E58\nRdotbelow;1E5A\nRdotbelowmacron;1E5C\nReharmenian;0550\nRfraktur;211C\nRho;03A1\nRingsmall;F6FC\nRinvertedbreve;0212\nRlinebelow;1E5E\nRmonospace;FF32\nRsmall;F772\nRsmallinverted;0281\nRsmallinvertedsuperior;02B6\nS;0053\nSF010000;250C\nSF020000;2514\nSF030000;2510\nSF040000;2518\nSF050000;253C\nSF060000;252C\nSF070000;2534\nSF080000;251C\nSF090000;2524\nSF100000;2500\nSF110000;2502\nSF190000;2561\nSF200000;2562\nSF210000;2556\nSF220000;2555\nSF230000;2563\nSF240000;2551\nSF250000;2557\nSF260000;255D\nSF270000;255C\nSF280000;255B\nSF360000;255E\nSF370000;255F\nSF380000;255A\nSF390000;2554\nSF400000;2569\nSF410000;2566\nSF420000;2560\nSF430000;2550\nSF440000;256C\nSF450000;2567\nSF460000;2568\nSF470000;2564\nSF480000;2565\nSF490000;2559\nSF500000;2558\nSF510000;2552\nSF520000;2553\nSF530000;256B\nSF540000;256A\nSacute;015A\nSacutedotaccent;1E64\nSampigreek;03E0\nScaron;0160\nScarondotaccent;1E66\nScaronsmall;F6FD\nScedilla;015E\nSchwa;018F\nSchwacyrillic;04D8\nSchwadieresiscyrillic;04DA\nScircle;24C8\nScircumflex;015C\nScommaaccent;0218\nSdotaccent;1E60\nSdotbelow;1E62\nSdotbelowdotaccent;1E68\nSeharmenian;054D\nSevenroman;2166\nShaarmenian;0547\nShacyrillic;0428\nShchacyrillic;0429\nSheicoptic;03E2\nShhacyrillic;04BA\nShimacoptic;03EC\nSigma;03A3\nSixroman;2165\nSmonospace;FF33\nSoftsigncyrillic;042C\nSsmall;F773\nStigmagreek;03DA\nT;0054\nTau;03A4\nTbar;0166\nTcaron;0164\nTcedilla;0162\nTcircle;24C9\nTcircumflexbelow;1E70\nTcommaaccent;0162\nTdotaccent;1E6A\nTdotbelow;1E6C\nTecyrillic;0422\nTedescendercyrillic;04AC\nTenroman;2169\nTetsecyrillic;04B4\nTheta;0398\nThook;01AC\nThorn;00DE\nThornsmall;F7FE\nThreeroman;2162\nTildesmall;F6FE\nTiwnarmenian;054F\nTlinebelow;1E6E\nTmonospace;FF34\nToarmenian;0539\nTonefive;01BC\nTonesix;0184\nTonetwo;01A7\nTretroflexhook;01AE\nTsecyrillic;0426\nTshecyrillic;040B\nTsmall;F774\nTwelveroman;216B\nTworoman;2161\nU;0055\nUacute;00DA\nUacutesmall;F7FA\nUbreve;016C\nUcaron;01D3\nUcircle;24CA\nUcircumflex;00DB\nUcircumflexbelow;1E76\nUcircumflexsmall;F7FB\nUcyrillic;0423\nUdblacute;0170\nUdblgrave;0214\nUdieresis;00DC\nUdieresisacute;01D7\nUdieresisbelow;1E72\nUdieresiscaron;01D9\nUdieresiscyrillic;04F0\nUdieresisgrave;01DB\nUdieresismacron;01D5\nUdieresissmall;F7FC\nUdotbelow;1EE4\nUgrave;00D9\nUgravesmall;F7F9\nUhookabove;1EE6\nUhorn;01AF\nUhornacute;1EE8\nUhorndotbelow;1EF0\nUhorngrave;1EEA\nUhornhookabove;1EEC\nUhorntilde;1EEE\nUhungarumlaut;0170\nUhungarumlautcyrillic;04F2\nUinvertedbreve;0216\nUkcyrillic;0478\nUmacron;016A\nUmacroncyrillic;04EE\nUmacrondieresis;1E7A\nUmonospace;FF35\nUogonek;0172\nUpsilon;03A5\nUpsilon1;03D2\nUpsilonacutehooksymbolgreek;03D3\nUpsilonafrican;01B1\nUpsilondieresis;03AB\nUpsilondieresishooksymbolgreek;03D4\nUpsilonhooksymbol;03D2\nUpsilontonos;038E\nUring;016E\nUshortcyrillic;040E\nUsmall;F775\nUstraightcyrillic;04AE\nUstraightstrokecyrillic;04B0\nUtilde;0168\nUtildeacute;1E78\nUtildebelow;1E74\nV;0056\nVcircle;24CB\nVdotbelow;1E7E\nVecyrillic;0412\nVewarmenian;054E\nVhook;01B2\nVmonospace;FF36\nVoarmenian;0548\nVsmall;F776\nVtilde;1E7C\nW;0057\nWacute;1E82\nWcircle;24CC\nWcircumflex;0174\nWdieresis;1E84\nWdotaccent;1E86\nWdotbelow;1E88\nWgrave;1E80\nWmonospace;FF37\nWsmall;F777\nX;0058\nXcircle;24CD\nXdieresis;1E8C\nXdotaccent;1E8A\nXeharmenian;053D\nXi;039E\nXmonospace;FF38\nXsmall;F778\nY;0059\nYacute;00DD\nYacutesmall;F7FD\nYatcyrillic;0462\nYcircle;24CE\nYcircumflex;0176\nYdieresis;0178\nYdieresissmall;F7FF\nYdotaccent;1E8E\nYdotbelow;1EF4\nYericyrillic;042B\nYerudieresiscyrillic;04F8\nYgrave;1EF2\nYhook;01B3\nYhookabove;1EF6\nYiarmenian;0545\nYicyrillic;0407\nYiwnarmenian;0552\nYmonospace;FF39\nYsmall;F779\nYtilde;1EF8\nYusbigcyrillic;046A\nYusbigiotifiedcyrillic;046C\nYuslittlecyrillic;0466\nYuslittleiotifiedcyrillic;0468\nZ;005A\nZaarmenian;0536\nZacute;0179\nZcaron;017D\nZcaronsmall;F6FF\nZcircle;24CF\nZcircumflex;1E90\nZdot;017B\nZdotaccent;017B\nZdotbelow;1E92\nZecyrillic;0417\nZedescendercyrillic;0498\nZedieresiscyrillic;04DE\nZeta;0396\nZhearmenian;053A\nZhebrevecyrillic;04C1\nZhecyrillic;0416\nZhedescendercyrillic;0496\nZhedieresiscyrillic;04DC\nZlinebelow;1E94\nZmonospace;FF3A\nZsmall;F77A\nZstroke;01B5\na;0061\naabengali;0986\naacute;00E1\naadeva;0906\naagujarati;0A86\naagurmukhi;0A06\naamatragurmukhi;0A3E\naarusquare;3303\naavowelsignbengali;09BE\naavowelsigndeva;093E\naavowelsigngujarati;0ABE\nabbreviationmarkarmenian;055F\nabbreviationsigndeva;0970\nabengali;0985\nabopomofo;311A\nabreve;0103\nabreveacute;1EAF\nabrevecyrillic;04D1\nabrevedotbelow;1EB7\nabrevegrave;1EB1\nabrevehookabove;1EB3\nabrevetilde;1EB5\nacaron;01CE\nacircle;24D0\nacircumflex;00E2\nacircumflexacute;1EA5\nacircumflexdotbelow;1EAD\nacircumflexgrave;1EA7\nacircumflexhookabove;1EA9\nacircumflextilde;1EAB\nacute;00B4\nacutebelowcmb;0317\nacutecmb;0301\nacutecomb;0301\nacutedeva;0954\nacutelowmod;02CF\nacutetonecmb;0341\nacyrillic;0430\nadblgrave;0201\naddakgurmukhi;0A71\nadeva;0905\nadieresis;00E4\nadieresiscyrillic;04D3\nadieresismacron;01DF\nadotbelow;1EA1\nadotmacron;01E1\nae;00E6\naeacute;01FD\naekorean;3150\naemacron;01E3\nafii00208;2015\nafii08941;20A4\nafii10017;0410\nafii10018;0411\nafii10019;0412\nafii10020;0413\nafii10021;0414\nafii10022;0415\nafii10023;0401\nafii10024;0416\nafii10025;0417\nafii10026;0418\nafii10027;0419\nafii10028;041A\nafii10029;041B\nafii10030;041C\nafii10031;041D\nafii10032;041E\nafii10033;041F\nafii10034;0420\nafii10035;0421\nafii10036;0422\nafii10037;0423\nafii10038;0424\nafii10039;0425\nafii10040;0426\nafii10041;0427\nafii10042;0428\nafii10043;0429\nafii10044;042A\nafii10045;042B\nafii10046;042C\nafii10047;042D\nafii10048;042E\nafii10049;042F\nafii10050;0490\nafii10051;0402\nafii10052;0403\nafii10053;0404\nafii10054;0405\nafii10055;0406\nafii10056;0407\nafii10057;0408\nafii10058;0409\nafii10059;040A\nafii10060;040B\nafii10061;040C\nafii10062;040E\nafii10063;F6C4\nafii10064;F6C5\nafii10065;0430\nafii10066;0431\nafii10067;0432\nafii10068;0433\nafii10069;0434\nafii10070;0435\nafii10071;0451\nafii10072;0436\nafii10073;0437\nafii10074;0438\nafii10075;0439\nafii10076;043A\nafii10077;043B\nafii10078;043C\nafii10079;043D\nafii10080;043E\nafii10081;043F\nafii10082;0440\nafii10083;0441\nafii10084;0442\nafii10085;0443\nafii10086;0444\nafii10087;0445\nafii10088;0446\nafii10089;0447\nafii10090;0448\nafii10091;0449\nafii10092;044A\nafii10093;044B\nafii10094;044C\nafii10095;044D\nafii10096;044E\nafii10097;044F\nafii10098;0491\nafii10099;0452\nafii10100;0453\nafii10101;0454\nafii10102;0455\nafii10103;0456\nafii10104;0457\nafii10105;0458\nafii10106;0459\nafii10107;045A\nafii10108;045B\nafii10109;045C\nafii10110;045E\nafii10145;040F\nafii10146;0462\nafii10147;0472\nafii10148;0474\nafii10192;F6C6\nafii10193;045F\nafii10194;0463\nafii10195;0473\nafii10196;0475\nafii10831;F6C7\nafii10832;F6C8\nafii10846;04D9\nafii299;200E\nafii300;200F\nafii301;200D\nafii57381;066A\nafii57388;060C\nafii57392;0660\nafii57393;0661\nafii57394;0662\nafii57395;0663\nafii57396;0664\nafii57397;0665\nafii57398;0666\nafii57399;0667\nafii57400;0668\nafii57401;0669\nafii57403;061B\nafii57407;061F\nafii57409;0621\nafii57410;0622\nafii57411;0623\nafii57412;0624\nafii57413;0625\nafii57414;0626\nafii57415;0627\nafii57416;0628\nafii57417;0629\nafii57418;062A\nafii57419;062B\nafii57420;062C\nafii57421;062D\nafii57422;062E\nafii57423;062F\nafii57424;0630\nafii57425;0631\nafii57426;0632\nafii57427;0633\nafii57428;0634\nafii57429;0635\nafii57430;0636\nafii57431;0637\nafii57432;0638\nafii57433;0639\nafii57434;063A\nafii57440;0640\nafii57441;0641\nafii57442;0642\nafii57443;0643\nafii57444;0644\nafii57445;0645\nafii57446;0646\nafii57448;0648\nafii57449;0649\nafii57450;064A\nafii57451;064B\nafii57452;064C\nafii57453;064D\nafii57454;064E\nafii57455;064F\nafii57456;0650\nafii57457;0651\nafii57458;0652\nafii57470;0647\nafii57505;06A4\nafii57506;067E\nafii57507;0686\nafii57508;0698\nafii57509;06AF\nafii57511;0679\nafii57512;0688\nafii57513;0691\nafii57514;06BA\nafii57519;06D2\nafii57534;06D5\nafii57636;20AA\nafii57645;05BE\nafii57658;05C3\nafii57664;05D0\nafii57665;05D1\nafii57666;05D2\nafii57667;05D3\nafii57668;05D4\nafii57669;05D5\nafii57670;05D6\nafii57671;05D7\nafii57672;05D8\nafii57673;05D9\nafii57674;05DA\nafii57675;05DB\nafii57676;05DC\nafii57677;05DD\nafii57678;05DE\nafii57679;05DF\nafii57680;05E0\nafii57681;05E1\nafii57682;05E2\nafii57683;05E3\nafii57684;05E4\nafii57685;05E5\nafii57686;05E6\nafii57687;05E7\nafii57688;05E8\nafii57689;05E9\nafii57690;05EA\nafii57694;FB2A\nafii57695;FB2B\nafii57700;FB4B\nafii57705;FB1F\nafii57716;05F0\nafii57717;05F1\nafii57718;05F2\nafii57723;FB35\nafii57793;05B4\nafii57794;05B5\nafii57795;05B6\nafii57796;05BB\nafii57797;05B8\nafii57798;05B7\nafii57799;05B0\nafii57800;05B2\nafii57801;05B1\nafii57802;05B3\nafii57803;05C2\nafii57804;05C1\nafii57806;05B9\nafii57807;05BC\nafii57839;05BD\nafii57841;05BF\nafii57842;05C0\nafii57929;02BC\nafii61248;2105\nafii61289;2113\nafii61352;2116\nafii61573;202C\nafii61574;202D\nafii61575;202E\nafii61664;200C\nafii63167;066D\nafii64937;02BD\nagrave;00E0\nagujarati;0A85\nagurmukhi;0A05\nahiragana;3042\nahookabove;1EA3\naibengali;0990\naibopomofo;311E\naideva;0910\naiecyrillic;04D5\naigujarati;0A90\naigurmukhi;0A10\naimatragurmukhi;0A48\nainarabic;0639\nainfinalarabic;FECA\naininitialarabic;FECB\nainmedialarabic;FECC\nainvertedbreve;0203\naivowelsignbengali;09C8\naivowelsigndeva;0948\naivowelsigngujarati;0AC8\nakatakana;30A2\nakatakanahalfwidth;FF71\nakorean;314F\nalef;05D0\nalefarabic;0627\nalefdageshhebrew;FB30\naleffinalarabic;FE8E\nalefhamzaabovearabic;0623\nalefhamzaabovefinalarabic;FE84\nalefhamzabelowarabic;0625\nalefhamzabelowfinalarabic;FE88\nalefhebrew;05D0\naleflamedhebrew;FB4F\nalefmaddaabovearabic;0622\nalefmaddaabovefinalarabic;FE82\nalefmaksuraarabic;0649\nalefmaksurafinalarabic;FEF0\nalefmaksurainitialarabic;FEF3\nalefmaksuramedialarabic;FEF4\nalefpatahhebrew;FB2E\nalefqamatshebrew;FB2F\naleph;2135\nallequal;224C\nalpha;03B1\nalphatonos;03AC\namacron;0101\namonospace;FF41\nampersand;0026\nampersandmonospace;FF06\nampersandsmall;F726\namsquare;33C2\nanbopomofo;3122\nangbopomofo;3124\nangkhankhuthai;0E5A\nangle;2220\nanglebracketleft;3008\nanglebracketleftvertical;FE3F\nanglebracketright;3009\nanglebracketrightvertical;FE40\nangleleft;2329\nangleright;232A\nangstrom;212B\nanoteleia;0387\nanudattadeva;0952\nanusvarabengali;0982\nanusvaradeva;0902\nanusvaragujarati;0A82\naogonek;0105\napaatosquare;3300\naparen;249C\napostrophearmenian;055A\napostrophemod;02BC\napple;F8FF\napproaches;2250\napproxequal;2248\napproxequalorimage;2252\napproximatelyequal;2245\naraeaekorean;318E\naraeakorean;318D\narc;2312\narighthalfring;1E9A\naring;00E5\naringacute;01FB\naringbelow;1E01\narrowboth;2194\narrowdashdown;21E3\narrowdashleft;21E0\narrowdashright;21E2\narrowdashup;21E1\narrowdblboth;21D4\narrowdbldown;21D3\narrowdblleft;21D0\narrowdblright;21D2\narrowdblup;21D1\narrowdown;2193\narrowdownleft;2199\narrowdownright;2198\narrowdownwhite;21E9\narrowheaddownmod;02C5\narrowheadleftmod;02C2\narrowheadrightmod;02C3\narrowheadupmod;02C4\narrowhorizex;F8E7\narrowleft;2190\narrowleftdbl;21D0\narrowleftdblstroke;21CD\narrowleftoverright;21C6\narrowleftwhite;21E6\narrowright;2192\narrowrightdblstroke;21CF\narrowrightheavy;279E\narrowrightoverleft;21C4\narrowrightwhite;21E8\narrowtableft;21E4\narrowtabright;21E5\narrowup;2191\narrowupdn;2195\narrowupdnbse;21A8\narrowupdownbase;21A8\narrowupleft;2196\narrowupleftofdown;21C5\narrowupright;2197\narrowupwhite;21E7\narrowvertex;F8E6\nasciicircum;005E\nasciicircummonospace;FF3E\nasciitilde;007E\nasciitildemonospace;FF5E\nascript;0251\nascriptturned;0252\nasmallhiragana;3041\nasmallkatakana;30A1\nasmallkatakanahalfwidth;FF67\nasterisk;002A\nasteriskaltonearabic;066D\nasteriskarabic;066D\nasteriskmath;2217\nasteriskmonospace;FF0A\nasterisksmall;FE61\nasterism;2042\nasuperior;F6E9\nasymptoticallyequal;2243\nat;0040\natilde;00E3\natmonospace;FF20\natsmall;FE6B\naturned;0250\naubengali;0994\naubopomofo;3120\naudeva;0914\naugujarati;0A94\naugurmukhi;0A14\naulengthmarkbengali;09D7\naumatragurmukhi;0A4C\nauvowelsignbengali;09CC\nauvowelsigndeva;094C\nauvowelsigngujarati;0ACC\navagrahadeva;093D\naybarmenian;0561\nayin;05E2\nayinaltonehebrew;FB20\nayinhebrew;05E2\nb;0062\nbabengali;09AC\nbackslash;005C\nbackslashmonospace;FF3C\nbadeva;092C\nbagujarati;0AAC\nbagurmukhi;0A2C\nbahiragana;3070\nbahtthai;0E3F\nbakatakana;30D0\nbar;007C\nbarmonospace;FF5C\nbbopomofo;3105\nbcircle;24D1\nbdotaccent;1E03\nbdotbelow;1E05\nbeamedsixteenthnotes;266C\nbecause;2235\nbecyrillic;0431\nbeharabic;0628\nbehfinalarabic;FE90\nbehinitialarabic;FE91\nbehiragana;3079\nbehmedialarabic;FE92\nbehmeeminitialarabic;FC9F\nbehmeemisolatedarabic;FC08\nbehnoonfinalarabic;FC6D\nbekatakana;30D9\nbenarmenian;0562\nbet;05D1\nbeta;03B2\nbetasymbolgreek;03D0\nbetdagesh;FB31\nbetdageshhebrew;FB31\nbethebrew;05D1\nbetrafehebrew;FB4C\nbhabengali;09AD\nbhadeva;092D\nbhagujarati;0AAD\nbhagurmukhi;0A2D\nbhook;0253\nbihiragana;3073\nbikatakana;30D3\nbilabialclick;0298\nbindigurmukhi;0A02\nbirusquare;3331\nblackcircle;25CF\nblackdiamond;25C6\nblackdownpointingtriangle;25BC\nblackleftpointingpointer;25C4\nblackleftpointingtriangle;25C0\nblacklenticularbracketleft;3010\nblacklenticularbracketleftvertical;FE3B\nblacklenticularbracketright;3011\nblacklenticularbracketrightvertical;FE3C\nblacklowerlefttriangle;25E3\nblacklowerrighttriangle;25E2\nblackrectangle;25AC\nblackrightpointingpointer;25BA\nblackrightpointingtriangle;25B6\nblacksmallsquare;25AA\nblacksmilingface;263B\nblacksquare;25A0\nblackstar;2605\nblackupperlefttriangle;25E4\nblackupperrighttriangle;25E5\nblackuppointingsmalltriangle;25B4\nblackuppointingtriangle;25B2\nblank;2423\nblinebelow;1E07\nblock;2588\nbmonospace;FF42\nbobaimaithai;0E1A\nbohiragana;307C\nbokatakana;30DC\nbparen;249D\nbqsquare;33C3\nbraceex;F8F4\nbraceleft;007B\nbraceleftbt;F8F3\nbraceleftmid;F8F2\nbraceleftmonospace;FF5B\nbraceleftsmall;FE5B\nbracelefttp;F8F1\nbraceleftvertical;FE37\nbraceright;007D\nbracerightbt;F8FE\nbracerightmid;F8FD\nbracerightmonospace;FF5D\nbracerightsmall;FE5C\nbracerighttp;F8FC\nbracerightvertical;FE38\nbracketleft;005B\nbracketleftbt;F8F0\nbracketleftex;F8EF\nbracketleftmonospace;FF3B\nbracketlefttp;F8EE\nbracketright;005D\nbracketrightbt;F8FB\nbracketrightex;F8FA\nbracketrightmonospace;FF3D\nbracketrighttp;F8F9\nbreve;02D8\nbrevebelowcmb;032E\nbrevecmb;0306\nbreveinvertedbelowcmb;032F\nbreveinvertedcmb;0311\nbreveinverteddoublecmb;0361\nbridgebelowcmb;032A\nbridgeinvertedbelowcmb;033A\nbrokenbar;00A6\nbstroke;0180\nbsuperior;F6EA\nbtopbar;0183\nbuhiragana;3076\nbukatakana;30D6\nbullet;2022\nbulletinverse;25D8\nbulletoperator;2219\nbullseye;25CE\nc;0063\ncaarmenian;056E\ncabengali;099A\ncacute;0107\ncadeva;091A\ncagujarati;0A9A\ncagurmukhi;0A1A\ncalsquare;3388\ncandrabindubengali;0981\ncandrabinducmb;0310\ncandrabindudeva;0901\ncandrabindugujarati;0A81\ncapslock;21EA\ncareof;2105\ncaron;02C7\ncaronbelowcmb;032C\ncaroncmb;030C\ncarriagereturn;21B5\ncbopomofo;3118\nccaron;010D\nccedilla;00E7\nccedillaacute;1E09\nccircle;24D2\nccircumflex;0109\nccurl;0255\ncdot;010B\ncdotaccent;010B\ncdsquare;33C5\ncedilla;00B8\ncedillacmb;0327\ncent;00A2\ncentigrade;2103\ncentinferior;F6DF\ncentmonospace;FFE0\ncentoldstyle;F7A2\ncentsuperior;F6E0\nchaarmenian;0579\nchabengali;099B\nchadeva;091B\nchagujarati;0A9B\nchagurmukhi;0A1B\nchbopomofo;3114\ncheabkhasiancyrillic;04BD\ncheckmark;2713\nchecyrillic;0447\nchedescenderabkhasiancyrillic;04BF\nchedescendercyrillic;04B7\nchedieresiscyrillic;04F5\ncheharmenian;0573\nchekhakassiancyrillic;04CC\ncheverticalstrokecyrillic;04B9\nchi;03C7\nchieuchacirclekorean;3277\nchieuchaparenkorean;3217\nchieuchcirclekorean;3269\nchieuchkorean;314A\nchieuchparenkorean;3209\nchochangthai;0E0A\nchochanthai;0E08\nchochingthai;0E09\nchochoethai;0E0C\nchook;0188\ncieucacirclekorean;3276\ncieucaparenkorean;3216\ncieuccirclekorean;3268\ncieuckorean;3148\ncieucparenkorean;3208\ncieucuparenkorean;321C\ncircle;25CB\ncirclemultiply;2297\ncircleot;2299\ncircleplus;2295\ncirclepostalmark;3036\ncirclewithlefthalfblack;25D0\ncirclewithrighthalfblack;25D1\ncircumflex;02C6\ncircumflexbelowcmb;032D\ncircumflexcmb;0302\nclear;2327\nclickalveolar;01C2\nclickdental;01C0\nclicklateral;01C1\nclickretroflex;01C3\nclub;2663\nclubsuitblack;2663\nclubsuitwhite;2667\ncmcubedsquare;33A4\ncmonospace;FF43\ncmsquaredsquare;33A0\ncoarmenian;0581\ncolon;003A\ncolonmonetary;20A1\ncolonmonospace;FF1A\ncolonsign;20A1\ncolonsmall;FE55\ncolontriangularhalfmod;02D1\ncolontriangularmod;02D0\ncomma;002C\ncommaabovecmb;0313\ncommaaboverightcmb;0315\ncommaaccent;F6C3\ncommaarabic;060C\ncommaarmenian;055D\ncommainferior;F6E1\ncommamonospace;FF0C\ncommareversedabovecmb;0314\ncommareversedmod;02BD\ncommasmall;FE50\ncommasuperior;F6E2\ncommaturnedabovecmb;0312\ncommaturnedmod;02BB\ncompass;263C\ncongruent;2245\ncontourintegral;222E\ncontrol;2303\ncontrolACK;0006\ncontrolBEL;0007\ncontrolBS;0008\ncontrolCAN;0018\ncontrolCR;000D\ncontrolDC1;0011\ncontrolDC2;0012\ncontrolDC3;0013\ncontrolDC4;0014\ncontrolDEL;007F\ncontrolDLE;0010\ncontrolEM;0019\ncontrolENQ;0005\ncontrolEOT;0004\ncontrolESC;001B\ncontrolETB;0017\ncontrolETX;0003\ncontrolFF;000C\ncontrolFS;001C\ncontrolGS;001D\ncontrolHT;0009\ncontrolLF;000A\ncontrolNAK;0015\ncontrolRS;001E\ncontrolSI;000F\ncontrolSO;000E\ncontrolSOT;0002\ncontrolSTX;0001\ncontrolSUB;001A\ncontrolSYN;0016\ncontrolUS;001F\ncontrolVT;000B\ncopyright;00A9\ncopyrightsans;F8E9\ncopyrightserif;F6D9\ncornerbracketleft;300C\ncornerbracketlefthalfwidth;FF62\ncornerbracketleftvertical;FE41\ncornerbracketright;300D\ncornerbracketrighthalfwidth;FF63\ncornerbracketrightvertical;FE42\ncorporationsquare;337F\ncosquare;33C7\ncoverkgsquare;33C6\ncparen;249E\ncruzeiro;20A2\ncstretched;0297\ncurlyand;22CF\ncurlyor;22CE\ncurrency;00A4\ncyrBreve;F6D1\ncyrFlex;F6D2\ncyrbreve;F6D4\ncyrflex;F6D5\nd;0064\ndaarmenian;0564\ndabengali;09A6\ndadarabic;0636\ndadeva;0926\ndadfinalarabic;FEBE\ndadinitialarabic;FEBF\ndadmedialarabic;FEC0\ndagesh;05BC\ndageshhebrew;05BC\ndagger;2020\ndaggerdbl;2021\ndagujarati;0AA6\ndagurmukhi;0A26\ndahiragana;3060\ndakatakana;30C0\ndalarabic;062F\ndalet;05D3\ndaletdagesh;FB33\ndaletdageshhebrew;FB33\ndalethatafpatah;05D3 05B2\ndalethatafpatahhebrew;05D3 05B2\ndalethatafsegol;05D3 05B1\ndalethatafsegolhebrew;05D3 05B1\ndalethebrew;05D3\ndalethiriq;05D3 05B4\ndalethiriqhebrew;05D3 05B4\ndaletholam;05D3 05B9\ndaletholamhebrew;05D3 05B9\ndaletpatah;05D3 05B7\ndaletpatahhebrew;05D3 05B7\ndaletqamats;05D3 05B8\ndaletqamatshebrew;05D3 05B8\ndaletqubuts;05D3 05BB\ndaletqubutshebrew;05D3 05BB\ndaletsegol;05D3 05B6\ndaletsegolhebrew;05D3 05B6\ndaletsheva;05D3 05B0\ndaletshevahebrew;05D3 05B0\ndalettsere;05D3 05B5\ndalettserehebrew;05D3 05B5\ndalfinalarabic;FEAA\ndammaarabic;064F\ndammalowarabic;064F\ndammatanaltonearabic;064C\ndammatanarabic;064C\ndanda;0964\ndargahebrew;05A7\ndargalefthebrew;05A7\ndasiapneumatacyrilliccmb;0485\ndblGrave;F6D3\ndblanglebracketleft;300A\ndblanglebracketleftvertical;FE3D\ndblanglebracketright;300B\ndblanglebracketrightvertical;FE3E\ndblarchinvertedbelowcmb;032B\ndblarrowleft;21D4\ndblarrowright;21D2\ndbldanda;0965\ndblgrave;F6D6\ndblgravecmb;030F\ndblintegral;222C\ndbllowline;2017\ndbllowlinecmb;0333\ndbloverlinecmb;033F\ndblprimemod;02BA\ndblverticalbar;2016\ndblverticallineabovecmb;030E\ndbopomofo;3109\ndbsquare;33C8\ndcaron;010F\ndcedilla;1E11\ndcircle;24D3\ndcircumflexbelow;1E13\ndcroat;0111\nddabengali;09A1\nddadeva;0921\nddagujarati;0AA1\nddagurmukhi;0A21\nddalarabic;0688\nddalfinalarabic;FB89\ndddhadeva;095C\nddhabengali;09A2\nddhadeva;0922\nddhagujarati;0AA2\nddhagurmukhi;0A22\nddotaccent;1E0B\nddotbelow;1E0D\ndecimalseparatorarabic;066B\ndecimalseparatorpersian;066B\ndecyrillic;0434\ndegree;00B0\ndehihebrew;05AD\ndehiragana;3067\ndeicoptic;03EF\ndekatakana;30C7\ndeleteleft;232B\ndeleteright;2326\ndelta;03B4\ndeltaturned;018D\ndenominatorminusonenumeratorbengali;09F8\ndezh;02A4\ndhabengali;09A7\ndhadeva;0927\ndhagujarati;0AA7\ndhagurmukhi;0A27\ndhook;0257\ndialytikatonos;0385\ndialytikatonoscmb;0344\ndiamond;2666\ndiamondsuitwhite;2662\ndieresis;00A8\ndieresisacute;F6D7\ndieresisbelowcmb;0324\ndieresiscmb;0308\ndieresisgrave;F6D8\ndieresistonos;0385\ndihiragana;3062\ndikatakana;30C2\ndittomark;3003\ndivide;00F7\ndivides;2223\ndivisionslash;2215\ndjecyrillic;0452\ndkshade;2593\ndlinebelow;1E0F\ndlsquare;3397\ndmacron;0111\ndmonospace;FF44\ndnblock;2584\ndochadathai;0E0E\ndodekthai;0E14\ndohiragana;3069\ndokatakana;30C9\ndollar;0024\ndollarinferior;F6E3\ndollarmonospace;FF04\ndollaroldstyle;F724\ndollarsmall;FE69\ndollarsuperior;F6E4\ndong;20AB\ndorusquare;3326\ndotaccent;02D9\ndotaccentcmb;0307\ndotbelowcmb;0323\ndotbelowcomb;0323\ndotkatakana;30FB\ndotlessi;0131\ndotlessj;F6BE\ndotlessjstrokehook;0284\ndotmath;22C5\ndottedcircle;25CC\ndoubleyodpatah;FB1F\ndoubleyodpatahhebrew;FB1F\ndowntackbelowcmb;031E\ndowntackmod;02D5\ndparen;249F\ndsuperior;F6EB\ndtail;0256\ndtopbar;018C\nduhiragana;3065\ndukatakana;30C5\ndz;01F3\ndzaltone;02A3\ndzcaron;01C6\ndzcurl;02A5\ndzeabkhasiancyrillic;04E1\ndzecyrillic;0455\ndzhecyrillic;045F\ne;0065\neacute;00E9\nearth;2641\nebengali;098F\nebopomofo;311C\nebreve;0115\necandradeva;090D\necandragujarati;0A8D\necandravowelsigndeva;0945\necandravowelsigngujarati;0AC5\necaron;011B\necedillabreve;1E1D\necharmenian;0565\nechyiwnarmenian;0587\necircle;24D4\necircumflex;00EA\necircumflexacute;1EBF\necircumflexbelow;1E19\necircumflexdotbelow;1EC7\necircumflexgrave;1EC1\necircumflexhookabove;1EC3\necircumflextilde;1EC5\necyrillic;0454\nedblgrave;0205\nedeva;090F\nedieresis;00EB\nedot;0117\nedotaccent;0117\nedotbelow;1EB9\neegurmukhi;0A0F\neematragurmukhi;0A47\nefcyrillic;0444\negrave;00E8\negujarati;0A8F\neharmenian;0567\nehbopomofo;311D\nehiragana;3048\nehookabove;1EBB\neibopomofo;311F\neight;0038\neightarabic;0668\neightbengali;09EE\neightcircle;2467\neightcircleinversesansserif;2791\neightdeva;096E\neighteencircle;2471\neighteenparen;2485\neighteenperiod;2499\neightgujarati;0AEE\neightgurmukhi;0A6E\neighthackarabic;0668\neighthangzhou;3028\neighthnotebeamed;266B\neightideographicparen;3227\neightinferior;2088\neightmonospace;FF18\neightoldstyle;F738\neightparen;247B\neightperiod;248F\neightpersian;06F8\neightroman;2177\neightsuperior;2078\neightthai;0E58\neinvertedbreve;0207\neiotifiedcyrillic;0465\nekatakana;30A8\nekatakanahalfwidth;FF74\nekonkargurmukhi;0A74\nekorean;3154\nelcyrillic;043B\nelement;2208\nelevencircle;246A\nelevenparen;247E\nelevenperiod;2492\nelevenroman;217A\nellipsis;2026\nellipsisvertical;22EE\nemacron;0113\nemacronacute;1E17\nemacrongrave;1E15\nemcyrillic;043C\nemdash;2014\nemdashvertical;FE31\nemonospace;FF45\nemphasismarkarmenian;055B\nemptyset;2205\nenbopomofo;3123\nencyrillic;043D\nendash;2013\nendashvertical;FE32\nendescendercyrillic;04A3\neng;014B\nengbopomofo;3125\nenghecyrillic;04A5\nenhookcyrillic;04C8\nenspace;2002\neogonek;0119\neokorean;3153\neopen;025B\neopenclosed;029A\neopenreversed;025C\neopenreversedclosed;025E\neopenreversedhook;025D\neparen;24A0\nepsilon;03B5\nepsilontonos;03AD\nequal;003D\nequalmonospace;FF1D\nequalsmall;FE66\nequalsuperior;207C\nequivalence;2261\nerbopomofo;3126\nercyrillic;0440\nereversed;0258\nereversedcyrillic;044D\nescyrillic;0441\nesdescendercyrillic;04AB\nesh;0283\neshcurl;0286\neshortdeva;090E\neshortvowelsigndeva;0946\neshreversedloop;01AA\neshsquatreversed;0285\nesmallhiragana;3047\nesmallkatakana;30A7\nesmallkatakanahalfwidth;FF6A\nestimated;212E\nesuperior;F6EC\neta;03B7\netarmenian;0568\netatonos;03AE\neth;00F0\netilde;1EBD\netildebelow;1E1B\netnahtafoukhhebrew;0591\netnahtafoukhlefthebrew;0591\netnahtahebrew;0591\netnahtalefthebrew;0591\neturned;01DD\neukorean;3161\neuro;20AC\nevowelsignbengali;09C7\nevowelsigndeva;0947\nevowelsigngujarati;0AC7\nexclam;0021\nexclamarmenian;055C\nexclamdbl;203C\nexclamdown;00A1\nexclamdownsmall;F7A1\nexclammonospace;FF01\nexclamsmall;F721\nexistential;2203\nezh;0292\nezhcaron;01EF\nezhcurl;0293\nezhreversed;01B9\nezhtail;01BA\nf;0066\nfadeva;095E\nfagurmukhi;0A5E\nfahrenheit;2109\nfathaarabic;064E\nfathalowarabic;064E\nfathatanarabic;064B\nfbopomofo;3108\nfcircle;24D5\nfdotaccent;1E1F\nfeharabic;0641\nfeharmenian;0586\nfehfinalarabic;FED2\nfehinitialarabic;FED3\nfehmedialarabic;FED4\nfeicoptic;03E5\nfemale;2640\nff;FB00\nffi;FB03\nffl;FB04\nfi;FB01\nfifteencircle;246E\nfifteenparen;2482\nfifteenperiod;2496\nfiguredash;2012\nfilledbox;25A0\nfilledrect;25AC\nfinalkaf;05DA\nfinalkafdagesh;FB3A\nfinalkafdageshhebrew;FB3A\nfinalkafhebrew;05DA\nfinalkafqamats;05DA 05B8\nfinalkafqamatshebrew;05DA 05B8\nfinalkafsheva;05DA 05B0\nfinalkafshevahebrew;05DA 05B0\nfinalmem;05DD\nfinalmemhebrew;05DD\nfinalnun;05DF\nfinalnunhebrew;05DF\nfinalpe;05E3\nfinalpehebrew;05E3\nfinaltsadi;05E5\nfinaltsadihebrew;05E5\nfirsttonechinese;02C9\nfisheye;25C9\nfitacyrillic;0473\nfive;0035\nfivearabic;0665\nfivebengali;09EB\nfivecircle;2464\nfivecircleinversesansserif;278E\nfivedeva;096B\nfiveeighths;215D\nfivegujarati;0AEB\nfivegurmukhi;0A6B\nfivehackarabic;0665\nfivehangzhou;3025\nfiveideographicparen;3224\nfiveinferior;2085\nfivemonospace;FF15\nfiveoldstyle;F735\nfiveparen;2478\nfiveperiod;248C\nfivepersian;06F5\nfiveroman;2174\nfivesuperior;2075\nfivethai;0E55\nfl;FB02\nflorin;0192\nfmonospace;FF46\nfmsquare;3399\nfofanthai;0E1F\nfofathai;0E1D\nfongmanthai;0E4F\nforall;2200\nfour;0034\nfourarabic;0664\nfourbengali;09EA\nfourcircle;2463\nfourcircleinversesansserif;278D\nfourdeva;096A\nfourgujarati;0AEA\nfourgurmukhi;0A6A\nfourhackarabic;0664\nfourhangzhou;3024\nfourideographicparen;3223\nfourinferior;2084\nfourmonospace;FF14\nfournumeratorbengali;09F7\nfouroldstyle;F734\nfourparen;2477\nfourperiod;248B\nfourpersian;06F4\nfourroman;2173\nfoursuperior;2074\nfourteencircle;246D\nfourteenparen;2481\nfourteenperiod;2495\nfourthai;0E54\nfourthtonechinese;02CB\nfparen;24A1\nfraction;2044\nfranc;20A3\ng;0067\ngabengali;0997\ngacute;01F5\ngadeva;0917\ngafarabic;06AF\ngaffinalarabic;FB93\ngafinitialarabic;FB94\ngafmedialarabic;FB95\ngagujarati;0A97\ngagurmukhi;0A17\ngahiragana;304C\ngakatakana;30AC\ngamma;03B3\ngammalatinsmall;0263\ngammasuperior;02E0\ngangiacoptic;03EB\ngbopomofo;310D\ngbreve;011F\ngcaron;01E7\ngcedilla;0123\ngcircle;24D6\ngcircumflex;011D\ngcommaaccent;0123\ngdot;0121\ngdotaccent;0121\ngecyrillic;0433\ngehiragana;3052\ngekatakana;30B2\ngeometricallyequal;2251\ngereshaccenthebrew;059C\ngereshhebrew;05F3\ngereshmuqdamhebrew;059D\ngermandbls;00DF\ngershayimaccenthebrew;059E\ngershayimhebrew;05F4\ngetamark;3013\nghabengali;0998\nghadarmenian;0572\nghadeva;0918\nghagujarati;0A98\nghagurmukhi;0A18\nghainarabic;063A\nghainfinalarabic;FECE\nghaininitialarabic;FECF\nghainmedialarabic;FED0\nghemiddlehookcyrillic;0495\nghestrokecyrillic;0493\ngheupturncyrillic;0491\nghhadeva;095A\nghhagurmukhi;0A5A\nghook;0260\nghzsquare;3393\ngihiragana;304E\ngikatakana;30AE\ngimarmenian;0563\ngimel;05D2\ngimeldagesh;FB32\ngimeldageshhebrew;FB32\ngimelhebrew;05D2\ngjecyrillic;0453\nglottalinvertedstroke;01BE\nglottalstop;0294\nglottalstopinverted;0296\nglottalstopmod;02C0\nglottalstopreversed;0295\nglottalstopreversedmod;02C1\nglottalstopreversedsuperior;02E4\nglottalstopstroke;02A1\nglottalstopstrokereversed;02A2\ngmacron;1E21\ngmonospace;FF47\ngohiragana;3054\ngokatakana;30B4\ngparen;24A2\ngpasquare;33AC\ngradient;2207\ngrave;0060\ngravebelowcmb;0316\ngravecmb;0300\ngravecomb;0300\ngravedeva;0953\ngravelowmod;02CE\ngravemonospace;FF40\ngravetonecmb;0340\ngreater;003E\ngreaterequal;2265\ngreaterequalorless;22DB\ngreatermonospace;FF1E\ngreaterorequivalent;2273\ngreaterorless;2277\ngreateroverequal;2267\ngreatersmall;FE65\ngscript;0261\ngstroke;01E5\nguhiragana;3050\nguillemotleft;00AB\nguillemotright;00BB\nguilsinglleft;2039\nguilsinglright;203A\ngukatakana;30B0\nguramusquare;3318\ngysquare;33C9\nh;0068\nhaabkhasiancyrillic;04A9\nhaaltonearabic;06C1\nhabengali;09B9\nhadescendercyrillic;04B3\nhadeva;0939\nhagujarati;0AB9\nhagurmukhi;0A39\nhaharabic;062D\nhahfinalarabic;FEA2\nhahinitialarabic;FEA3\nhahiragana;306F\nhahmedialarabic;FEA4\nhaitusquare;332A\nhakatakana;30CF\nhakatakanahalfwidth;FF8A\nhalantgurmukhi;0A4D\nhamzaarabic;0621\nhamzadammaarabic;0621 064F\nhamzadammatanarabic;0621 064C\nhamzafathaarabic;0621 064E\nhamzafathatanarabic;0621 064B\nhamzalowarabic;0621\nhamzalowkasraarabic;0621 0650\nhamzalowkasratanarabic;0621 064D\nhamzasukunarabic;0621 0652\nhangulfiller;3164\nhardsigncyrillic;044A\nharpoonleftbarbup;21BC\nharpoonrightbarbup;21C0\nhasquare;33CA\nhatafpatah;05B2\nhatafpatah16;05B2\nhatafpatah23;05B2\nhatafpatah2f;05B2\nhatafpatahhebrew;05B2\nhatafpatahnarrowhebrew;05B2\nhatafpatahquarterhebrew;05B2\nhatafpatahwidehebrew;05B2\nhatafqamats;05B3\nhatafqamats1b;05B3\nhatafqamats28;05B3\nhatafqamats34;05B3\nhatafqamatshebrew;05B3\nhatafqamatsnarrowhebrew;05B3\nhatafqamatsquarterhebrew;05B3\nhatafqamatswidehebrew;05B3\nhatafsegol;05B1\nhatafsegol17;05B1\nhatafsegol24;05B1\nhatafsegol30;05B1\nhatafsegolhebrew;05B1\nhatafsegolnarrowhebrew;05B1\nhatafsegolquarterhebrew;05B1\nhatafsegolwidehebrew;05B1\nhbar;0127\nhbopomofo;310F\nhbrevebelow;1E2B\nhcedilla;1E29\nhcircle;24D7\nhcircumflex;0125\nhdieresis;1E27\nhdotaccent;1E23\nhdotbelow;1E25\nhe;05D4\nheart;2665\nheartsuitblack;2665\nheartsuitwhite;2661\nhedagesh;FB34\nhedageshhebrew;FB34\nhehaltonearabic;06C1\nheharabic;0647\nhehebrew;05D4\nhehfinalaltonearabic;FBA7\nhehfinalalttwoarabic;FEEA\nhehfinalarabic;FEEA\nhehhamzaabovefinalarabic;FBA5\nhehhamzaaboveisolatedarabic;FBA4\nhehinitialaltonearabic;FBA8\nhehinitialarabic;FEEB\nhehiragana;3078\nhehmedialaltonearabic;FBA9\nhehmedialarabic;FEEC\nheiseierasquare;337B\nhekatakana;30D8\nhekatakanahalfwidth;FF8D\nhekutaarusquare;3336\nhenghook;0267\nherutusquare;3339\nhet;05D7\nhethebrew;05D7\nhhook;0266\nhhooksuperior;02B1\nhieuhacirclekorean;327B\nhieuhaparenkorean;321B\nhieuhcirclekorean;326D\nhieuhkorean;314E\nhieuhparenkorean;320D\nhihiragana;3072\nhikatakana;30D2\nhikatakanahalfwidth;FF8B\nhiriq;05B4\nhiriq14;05B4\nhiriq21;05B4\nhiriq2d;05B4\nhiriqhebrew;05B4\nhiriqnarrowhebrew;05B4\nhiriqquarterhebrew;05B4\nhiriqwidehebrew;05B4\nhlinebelow;1E96\nhmonospace;FF48\nhoarmenian;0570\nhohipthai;0E2B\nhohiragana;307B\nhokatakana;30DB\nhokatakanahalfwidth;FF8E\nholam;05B9\nholam19;05B9\nholam26;05B9\nholam32;05B9\nholamhebrew;05B9\nholamnarrowhebrew;05B9\nholamquarterhebrew;05B9\nholamwidehebrew;05B9\nhonokhukthai;0E2E\nhookabovecomb;0309\nhookcmb;0309\nhookpalatalizedbelowcmb;0321\nhookretroflexbelowcmb;0322\nhoonsquare;3342\nhoricoptic;03E9\nhorizontalbar;2015\nhorncmb;031B\nhotsprings;2668\nhouse;2302\nhparen;24A3\nhsuperior;02B0\nhturned;0265\nhuhiragana;3075\nhuiitosquare;3333\nhukatakana;30D5\nhukatakanahalfwidth;FF8C\nhungarumlaut;02DD\nhungarumlautcmb;030B\nhv;0195\nhyphen;002D\nhypheninferior;F6E5\nhyphenmonospace;FF0D\nhyphensmall;FE63\nhyphensuperior;F6E6\nhyphentwo;2010\ni;0069\niacute;00ED\niacyrillic;044F\nibengali;0987\nibopomofo;3127\nibreve;012D\nicaron;01D0\nicircle;24D8\nicircumflex;00EE\nicyrillic;0456\nidblgrave;0209\nideographearthcircle;328F\nideographfirecircle;328B\nideographicallianceparen;323F\nideographiccallparen;323A\nideographiccentrecircle;32A5\nideographicclose;3006\nideographiccomma;3001\nideographiccommaleft;FF64\nideographiccongratulationparen;3237\nideographiccorrectcircle;32A3\nideographicearthparen;322F\nideographicenterpriseparen;323D\nideographicexcellentcircle;329D\nideographicfestivalparen;3240\nideographicfinancialcircle;3296\nideographicfinancialparen;3236\nideographicfireparen;322B\nideographichaveparen;3232\nideographichighcircle;32A4\nideographiciterationmark;3005\nideographiclaborcircle;3298\nideographiclaborparen;3238\nideographicleftcircle;32A7\nideographiclowcircle;32A6\nideographicmedicinecircle;32A9\nideographicmetalparen;322E\nideographicmoonparen;322A\nideographicnameparen;3234\nideographicperiod;3002\nideographicprintcircle;329E\nideographicreachparen;3243\nideographicrepresentparen;3239\nideographicresourceparen;323E\nideographicrightcircle;32A8\nideographicsecretcircle;3299\nideographicselfparen;3242\nideographicsocietyparen;3233\nideographicspace;3000\nideographicspecialparen;3235\nideographicstockparen;3231\nideographicstudyparen;323B\nideographicsunparen;3230\nideographicsuperviseparen;323C\nideographicwaterparen;322C\nideographicwoodparen;322D\nideographiczero;3007\nideographmetalcircle;328E\nideographmooncircle;328A\nideographnamecircle;3294\nideographsuncircle;3290\nideographwatercircle;328C\nideographwoodcircle;328D\nideva;0907\nidieresis;00EF\nidieresisacute;1E2F\nidieresiscyrillic;04E5\nidotbelow;1ECB\niebrevecyrillic;04D7\niecyrillic;0435\nieungacirclekorean;3275\nieungaparenkorean;3215\nieungcirclekorean;3267\nieungkorean;3147\nieungparenkorean;3207\nigrave;00EC\nigujarati;0A87\nigurmukhi;0A07\nihiragana;3044\nihookabove;1EC9\niibengali;0988\niicyrillic;0438\niideva;0908\niigujarati;0A88\niigurmukhi;0A08\niimatragurmukhi;0A40\niinvertedbreve;020B\niishortcyrillic;0439\niivowelsignbengali;09C0\niivowelsigndeva;0940\niivowelsigngujarati;0AC0\nij;0133\nikatakana;30A4\nikatakanahalfwidth;FF72\nikorean;3163\nilde;02DC\niluyhebrew;05AC\nimacron;012B\nimacroncyrillic;04E3\nimageorapproximatelyequal;2253\nimatragurmukhi;0A3F\nimonospace;FF49\nincrement;2206\ninfinity;221E\niniarmenian;056B\nintegral;222B\nintegralbottom;2321\nintegralbt;2321\nintegralex;F8F5\nintegraltop;2320\nintegraltp;2320\nintersection;2229\nintisquare;3305\ninvbullet;25D8\ninvcircle;25D9\ninvsmileface;263B\niocyrillic;0451\niogonek;012F\niota;03B9\niotadieresis;03CA\niotadieresistonos;0390\niotalatin;0269\niotatonos;03AF\niparen;24A4\nirigurmukhi;0A72\nismallhiragana;3043\nismallkatakana;30A3\nismallkatakanahalfwidth;FF68\nissharbengali;09FA\nistroke;0268\nisuperior;F6ED\niterationhiragana;309D\niterationkatakana;30FD\nitilde;0129\nitildebelow;1E2D\niubopomofo;3129\niucyrillic;044E\nivowelsignbengali;09BF\nivowelsigndeva;093F\nivowelsigngujarati;0ABF\nizhitsacyrillic;0475\nizhitsadblgravecyrillic;0477\nj;006A\njaarmenian;0571\njabengali;099C\njadeva;091C\njagujarati;0A9C\njagurmukhi;0A1C\njbopomofo;3110\njcaron;01F0\njcircle;24D9\njcircumflex;0135\njcrossedtail;029D\njdotlessstroke;025F\njecyrillic;0458\njeemarabic;062C\njeemfinalarabic;FE9E\njeeminitialarabic;FE9F\njeemmedialarabic;FEA0\njeharabic;0698\njehfinalarabic;FB8B\njhabengali;099D\njhadeva;091D\njhagujarati;0A9D\njhagurmukhi;0A1D\njheharmenian;057B\njis;3004\njmonospace;FF4A\njparen;24A5\njsuperior;02B2\nk;006B\nkabashkircyrillic;04A1\nkabengali;0995\nkacute;1E31\nkacyrillic;043A\nkadescendercyrillic;049B\nkadeva;0915\nkaf;05DB\nkafarabic;0643\nkafdagesh;FB3B\nkafdageshhebrew;FB3B\nkaffinalarabic;FEDA\nkafhebrew;05DB\nkafinitialarabic;FEDB\nkafmedialarabic;FEDC\nkafrafehebrew;FB4D\nkagujarati;0A95\nkagurmukhi;0A15\nkahiragana;304B\nkahookcyrillic;04C4\nkakatakana;30AB\nkakatakanahalfwidth;FF76\nkappa;03BA\nkappasymbolgreek;03F0\nkapyeounmieumkorean;3171\nkapyeounphieuphkorean;3184\nkapyeounpieupkorean;3178\nkapyeounssangpieupkorean;3179\nkaroriisquare;330D\nkashidaautoarabic;0640\nkashidaautonosidebearingarabic;0640\nkasmallkatakana;30F5\nkasquare;3384\nkasraarabic;0650\nkasratanarabic;064D\nkastrokecyrillic;049F\nkatahiraprolongmarkhalfwidth;FF70\nkaverticalstrokecyrillic;049D\nkbopomofo;310E\nkcalsquare;3389\nkcaron;01E9\nkcedilla;0137\nkcircle;24DA\nkcommaaccent;0137\nkdotbelow;1E33\nkeharmenian;0584\nkehiragana;3051\nkekatakana;30B1\nkekatakanahalfwidth;FF79\nkenarmenian;056F\nkesmallkatakana;30F6\nkgreenlandic;0138\nkhabengali;0996\nkhacyrillic;0445\nkhadeva;0916\nkhagujarati;0A96\nkhagurmukhi;0A16\nkhaharabic;062E\nkhahfinalarabic;FEA6\nkhahinitialarabic;FEA7\nkhahmedialarabic;FEA8\nkheicoptic;03E7\nkhhadeva;0959\nkhhagurmukhi;0A59\nkhieukhacirclekorean;3278\nkhieukhaparenkorean;3218\nkhieukhcirclekorean;326A\nkhieukhkorean;314B\nkhieukhparenkorean;320A\nkhokhaithai;0E02\nkhokhonthai;0E05\nkhokhuatthai;0E03\nkhokhwaithai;0E04\nkhomutthai;0E5B\nkhook;0199\nkhorakhangthai;0E06\nkhzsquare;3391\nkihiragana;304D\nkikatakana;30AD\nkikatakanahalfwidth;FF77\nkiroguramusquare;3315\nkiromeetorusquare;3316\nkirosquare;3314\nkiyeokacirclekorean;326E\nkiyeokaparenkorean;320E\nkiyeokcirclekorean;3260\nkiyeokkorean;3131\nkiyeokparenkorean;3200\nkiyeoksioskorean;3133\nkjecyrillic;045C\nklinebelow;1E35\nklsquare;3398\nkmcubedsquare;33A6\nkmonospace;FF4B\nkmsquaredsquare;33A2\nkohiragana;3053\nkohmsquare;33C0\nkokaithai;0E01\nkokatakana;30B3\nkokatakanahalfwidth;FF7A\nkooposquare;331E\nkoppacyrillic;0481\nkoreanstandardsymbol;327F\nkoroniscmb;0343\nkparen;24A6\nkpasquare;33AA\nksicyrillic;046F\nktsquare;33CF\nkturned;029E\nkuhiragana;304F\nkukatakana;30AF\nkukatakanahalfwidth;FF78\nkvsquare;33B8\nkwsquare;33BE\nl;006C\nlabengali;09B2\nlacute;013A\nladeva;0932\nlagujarati;0AB2\nlagurmukhi;0A32\nlakkhangyaothai;0E45\nlamaleffinalarabic;FEFC\nlamalefhamzaabovefinalarabic;FEF8\nlamalefhamzaaboveisolatedarabic;FEF7\nlamalefhamzabelowfinalarabic;FEFA\nlamalefhamzabelowisolatedarabic;FEF9\nlamalefisolatedarabic;FEFB\nlamalefmaddaabovefinalarabic;FEF6\nlamalefmaddaaboveisolatedarabic;FEF5\nlamarabic;0644\nlambda;03BB\nlambdastroke;019B\nlamed;05DC\nlameddagesh;FB3C\nlameddageshhebrew;FB3C\nlamedhebrew;05DC\nlamedholam;05DC 05B9\nlamedholamdagesh;05DC 05B9 05BC\nlamedholamdageshhebrew;05DC 05B9 05BC\nlamedholamhebrew;05DC 05B9\nlamfinalarabic;FEDE\nlamhahinitialarabic;FCCA\nlaminitialarabic;FEDF\nlamjeeminitialarabic;FCC9\nlamkhahinitialarabic;FCCB\nlamlamhehisolatedarabic;FDF2\nlammedialarabic;FEE0\nlammeemhahinitialarabic;FD88\nlammeeminitialarabic;FCCC\nlammeemjeeminitialarabic;FEDF FEE4 FEA0\nlammeemkhahinitialarabic;FEDF FEE4 FEA8\nlargecircle;25EF\nlbar;019A\nlbelt;026C\nlbopomofo;310C\nlcaron;013E\nlcedilla;013C\nlcircle;24DB\nlcircumflexbelow;1E3D\nlcommaaccent;013C\nldot;0140\nldotaccent;0140\nldotbelow;1E37\nldotbelowmacron;1E39\nleftangleabovecmb;031A\nlefttackbelowcmb;0318\nless;003C\nlessequal;2264\nlessequalorgreater;22DA\nlessmonospace;FF1C\nlessorequivalent;2272\nlessorgreater;2276\nlessoverequal;2266\nlesssmall;FE64\nlezh;026E\nlfblock;258C\nlhookretroflex;026D\nlira;20A4\nliwnarmenian;056C\nlj;01C9\nljecyrillic;0459\nll;F6C0\nlladeva;0933\nllagujarati;0AB3\nllinebelow;1E3B\nllladeva;0934\nllvocalicbengali;09E1\nllvocalicdeva;0961\nllvocalicvowelsignbengali;09E3\nllvocalicvowelsigndeva;0963\nlmiddletilde;026B\nlmonospace;FF4C\nlmsquare;33D0\nlochulathai;0E2C\nlogicaland;2227\nlogicalnot;00AC\nlogicalnotreversed;2310\nlogicalor;2228\nlolingthai;0E25\nlongs;017F\nlowlinecenterline;FE4E\nlowlinecmb;0332\nlowlinedashed;FE4D\nlozenge;25CA\nlparen;24A7\nlslash;0142\nlsquare;2113\nlsuperior;F6EE\nltshade;2591\nluthai;0E26\nlvocalicbengali;098C\nlvocalicdeva;090C\nlvocalicvowelsignbengali;09E2\nlvocalicvowelsigndeva;0962\nlxsquare;33D3\nm;006D\nmabengali;09AE\nmacron;00AF\nmacronbelowcmb;0331\nmacroncmb;0304\nmacronlowmod;02CD\nmacronmonospace;FFE3\nmacute;1E3F\nmadeva;092E\nmagujarati;0AAE\nmagurmukhi;0A2E\nmahapakhhebrew;05A4\nmahapakhlefthebrew;05A4\nmahiragana;307E\nmaichattawalowleftthai;F895\nmaichattawalowrightthai;F894\nmaichattawathai;0E4B\nmaichattawaupperleftthai;F893\nmaieklowleftthai;F88C\nmaieklowrightthai;F88B\nmaiekthai;0E48\nmaiekupperleftthai;F88A\nmaihanakatleftthai;F884\nmaihanakatthai;0E31\nmaitaikhuleftthai;F889\nmaitaikhuthai;0E47\nmaitholowleftthai;F88F\nmaitholowrightthai;F88E\nmaithothai;0E49\nmaithoupperleftthai;F88D\nmaitrilowleftthai;F892\nmaitrilowrightthai;F891\nmaitrithai;0E4A\nmaitriupperleftthai;F890\nmaiyamokthai;0E46\nmakatakana;30DE\nmakatakanahalfwidth;FF8F\nmale;2642\nmansyonsquare;3347\nmaqafhebrew;05BE\nmars;2642\nmasoracirclehebrew;05AF\nmasquare;3383\nmbopomofo;3107\nmbsquare;33D4\nmcircle;24DC\nmcubedsquare;33A5\nmdotaccent;1E41\nmdotbelow;1E43\nmeemarabic;0645\nmeemfinalarabic;FEE2\nmeeminitialarabic;FEE3\nmeemmedialarabic;FEE4\nmeemmeeminitialarabic;FCD1\nmeemmeemisolatedarabic;FC48\nmeetorusquare;334D\nmehiragana;3081\nmeizierasquare;337E\nmekatakana;30E1\nmekatakanahalfwidth;FF92\nmem;05DE\nmemdagesh;FB3E\nmemdageshhebrew;FB3E\nmemhebrew;05DE\nmenarmenian;0574\nmerkhahebrew;05A5\nmerkhakefulahebrew;05A6\nmerkhakefulalefthebrew;05A6\nmerkhalefthebrew;05A5\nmhook;0271\nmhzsquare;3392\nmiddledotkatakanahalfwidth;FF65\nmiddot;00B7\nmieumacirclekorean;3272\nmieumaparenkorean;3212\nmieumcirclekorean;3264\nmieumkorean;3141\nmieumpansioskorean;3170\nmieumparenkorean;3204\nmieumpieupkorean;316E\nmieumsioskorean;316F\nmihiragana;307F\nmikatakana;30DF\nmikatakanahalfwidth;FF90\nminus;2212\nminusbelowcmb;0320\nminuscircle;2296\nminusmod;02D7\nminusplus;2213\nminute;2032\nmiribaarusquare;334A\nmirisquare;3349\nmlonglegturned;0270\nmlsquare;3396\nmmcubedsquare;33A3\nmmonospace;FF4D\nmmsquaredsquare;339F\nmohiragana;3082\nmohmsquare;33C1\nmokatakana;30E2\nmokatakanahalfwidth;FF93\nmolsquare;33D6\nmomathai;0E21\nmoverssquare;33A7\nmoverssquaredsquare;33A8\nmparen;24A8\nmpasquare;33AB\nmssquare;33B3\nmsuperior;F6EF\nmturned;026F\nmu;00B5\nmu1;00B5\nmuasquare;3382\nmuchgreater;226B\nmuchless;226A\nmufsquare;338C\nmugreek;03BC\nmugsquare;338D\nmuhiragana;3080\nmukatakana;30E0\nmukatakanahalfwidth;FF91\nmulsquare;3395\nmultiply;00D7\nmumsquare;339B\nmunahhebrew;05A3\nmunahlefthebrew;05A3\nmusicalnote;266A\nmusicalnotedbl;266B\nmusicflatsign;266D\nmusicsharpsign;266F\nmussquare;33B2\nmuvsquare;33B6\nmuwsquare;33BC\nmvmegasquare;33B9\nmvsquare;33B7\nmwmegasquare;33BF\nmwsquare;33BD\nn;006E\nnabengali;09A8\nnabla;2207\nnacute;0144\nnadeva;0928\nnagujarati;0AA8\nnagurmukhi;0A28\nnahiragana;306A\nnakatakana;30CA\nnakatakanahalfwidth;FF85\nnapostrophe;0149\nnasquare;3381\nnbopomofo;310B\nnbspace;00A0\nncaron;0148\nncedilla;0146\nncircle;24DD\nncircumflexbelow;1E4B\nncommaaccent;0146\nndotaccent;1E45\nndotbelow;1E47\nnehiragana;306D\nnekatakana;30CD\nnekatakanahalfwidth;FF88\nnewsheqelsign;20AA\nnfsquare;338B\nngabengali;0999\nngadeva;0919\nngagujarati;0A99\nngagurmukhi;0A19\nngonguthai;0E07\nnhiragana;3093\nnhookleft;0272\nnhookretroflex;0273\nnieunacirclekorean;326F\nnieunaparenkorean;320F\nnieuncieuckorean;3135\nnieuncirclekorean;3261\nnieunhieuhkorean;3136\nnieunkorean;3134\nnieunpansioskorean;3168\nnieunparenkorean;3201\nnieunsioskorean;3167\nnieuntikeutkorean;3166\nnihiragana;306B\nnikatakana;30CB\nnikatakanahalfwidth;FF86\nnikhahitleftthai;F899\nnikhahitthai;0E4D\nnine;0039\nninearabic;0669\nninebengali;09EF\nninecircle;2468\nninecircleinversesansserif;2792\nninedeva;096F\nninegujarati;0AEF\nninegurmukhi;0A6F\nninehackarabic;0669\nninehangzhou;3029\nnineideographicparen;3228\nnineinferior;2089\nninemonospace;FF19\nnineoldstyle;F739\nnineparen;247C\nnineperiod;2490\nninepersian;06F9\nnineroman;2178\nninesuperior;2079\nnineteencircle;2472\nnineteenparen;2486\nnineteenperiod;249A\nninethai;0E59\nnj;01CC\nnjecyrillic;045A\nnkatakana;30F3\nnkatakanahalfwidth;FF9D\nnlegrightlong;019E\nnlinebelow;1E49\nnmonospace;FF4E\nnmsquare;339A\nnnabengali;09A3\nnnadeva;0923\nnnagujarati;0AA3\nnnagurmukhi;0A23\nnnnadeva;0929\nnohiragana;306E\nnokatakana;30CE\nnokatakanahalfwidth;FF89\nnonbreakingspace;00A0\nnonenthai;0E13\nnonuthai;0E19\nnoonarabic;0646\nnoonfinalarabic;FEE6\nnoonghunnaarabic;06BA\nnoonghunnafinalarabic;FB9F\nnoonhehinitialarabic;FEE7 FEEC\nnooninitialarabic;FEE7\nnoonjeeminitialarabic;FCD2\nnoonjeemisolatedarabic;FC4B\nnoonmedialarabic;FEE8\nnoonmeeminitialarabic;FCD5\nnoonmeemisolatedarabic;FC4E\nnoonnoonfinalarabic;FC8D\nnotcontains;220C\nnotelement;2209\nnotelementof;2209\nnotequal;2260\nnotgreater;226F\nnotgreaternorequal;2271\nnotgreaternorless;2279\nnotidentical;2262\nnotless;226E\nnotlessnorequal;2270\nnotparallel;2226\nnotprecedes;2280\nnotsubset;2284\nnotsucceeds;2281\nnotsuperset;2285\nnowarmenian;0576\nnparen;24A9\nnssquare;33B1\nnsuperior;207F\nntilde;00F1\nnu;03BD\nnuhiragana;306C\nnukatakana;30CC\nnukatakanahalfwidth;FF87\nnuktabengali;09BC\nnuktadeva;093C\nnuktagujarati;0ABC\nnuktagurmukhi;0A3C\nnumbersign;0023\nnumbersignmonospace;FF03\nnumbersignsmall;FE5F\nnumeralsigngreek;0374\nnumeralsignlowergreek;0375\nnumero;2116\nnun;05E0\nnundagesh;FB40\nnundageshhebrew;FB40\nnunhebrew;05E0\nnvsquare;33B5\nnwsquare;33BB\nnyabengali;099E\nnyadeva;091E\nnyagujarati;0A9E\nnyagurmukhi;0A1E\no;006F\noacute;00F3\noangthai;0E2D\nobarred;0275\nobarredcyrillic;04E9\nobarreddieresiscyrillic;04EB\nobengali;0993\nobopomofo;311B\nobreve;014F\nocandradeva;0911\nocandragujarati;0A91\nocandravowelsigndeva;0949\nocandravowelsigngujarati;0AC9\nocaron;01D2\nocircle;24DE\nocircumflex;00F4\nocircumflexacute;1ED1\nocircumflexdotbelow;1ED9\nocircumflexgrave;1ED3\nocircumflexhookabove;1ED5\nocircumflextilde;1ED7\nocyrillic;043E\nodblacute;0151\nodblgrave;020D\nodeva;0913\nodieresis;00F6\nodieresiscyrillic;04E7\nodotbelow;1ECD\noe;0153\noekorean;315A\nogonek;02DB\nogonekcmb;0328\nograve;00F2\nogujarati;0A93\noharmenian;0585\nohiragana;304A\nohookabove;1ECF\nohorn;01A1\nohornacute;1EDB\nohorndotbelow;1EE3\nohorngrave;1EDD\nohornhookabove;1EDF\nohorntilde;1EE1\nohungarumlaut;0151\noi;01A3\noinvertedbreve;020F\nokatakana;30AA\nokatakanahalfwidth;FF75\nokorean;3157\nolehebrew;05AB\nomacron;014D\nomacronacute;1E53\nomacrongrave;1E51\nomdeva;0950\nomega;03C9\nomega1;03D6\nomegacyrillic;0461\nomegalatinclosed;0277\nomegaroundcyrillic;047B\nomegatitlocyrillic;047D\nomegatonos;03CE\nomgujarati;0AD0\nomicron;03BF\nomicrontonos;03CC\nomonospace;FF4F\none;0031\nonearabic;0661\nonebengali;09E7\nonecircle;2460\nonecircleinversesansserif;278A\nonedeva;0967\nonedotenleader;2024\noneeighth;215B\nonefitted;F6DC\nonegujarati;0AE7\nonegurmukhi;0A67\nonehackarabic;0661\nonehalf;00BD\nonehangzhou;3021\noneideographicparen;3220\noneinferior;2081\nonemonospace;FF11\nonenumeratorbengali;09F4\noneoldstyle;F731\noneparen;2474\noneperiod;2488\nonepersian;06F1\nonequarter;00BC\noneroman;2170\nonesuperior;00B9\nonethai;0E51\nonethird;2153\noogonek;01EB\noogonekmacron;01ED\noogurmukhi;0A13\noomatragurmukhi;0A4B\noopen;0254\noparen;24AA\nopenbullet;25E6\noption;2325\nordfeminine;00AA\nordmasculine;00BA\northogonal;221F\noshortdeva;0912\noshortvowelsigndeva;094A\noslash;00F8\noslashacute;01FF\nosmallhiragana;3049\nosmallkatakana;30A9\nosmallkatakanahalfwidth;FF6B\nostrokeacute;01FF\nosuperior;F6F0\notcyrillic;047F\notilde;00F5\notildeacute;1E4D\notildedieresis;1E4F\noubopomofo;3121\noverline;203E\noverlinecenterline;FE4A\noverlinecmb;0305\noverlinedashed;FE49\noverlinedblwavy;FE4C\noverlinewavy;FE4B\noverscore;00AF\novowelsignbengali;09CB\novowelsigndeva;094B\novowelsigngujarati;0ACB\np;0070\npaampssquare;3380\npaasentosquare;332B\npabengali;09AA\npacute;1E55\npadeva;092A\npagedown;21DF\npageup;21DE\npagujarati;0AAA\npagurmukhi;0A2A\npahiragana;3071\npaiyannoithai;0E2F\npakatakana;30D1\npalatalizationcyrilliccmb;0484\npalochkacyrillic;04C0\npansioskorean;317F\nparagraph;00B6\nparallel;2225\nparenleft;0028\nparenleftaltonearabic;FD3E\nparenleftbt;F8ED\nparenleftex;F8EC\nparenleftinferior;208D\nparenleftmonospace;FF08\nparenleftsmall;FE59\nparenleftsuperior;207D\nparenlefttp;F8EB\nparenleftvertical;FE35\nparenright;0029\nparenrightaltonearabic;FD3F\nparenrightbt;F8F8\nparenrightex;F8F7\nparenrightinferior;208E\nparenrightmonospace;FF09\nparenrightsmall;FE5A\nparenrightsuperior;207E\nparenrighttp;F8F6\nparenrightvertical;FE36\npartialdiff;2202\npaseqhebrew;05C0\npashtahebrew;0599\npasquare;33A9\npatah;05B7\npatah11;05B7\npatah1d;05B7\npatah2a;05B7\npatahhebrew;05B7\npatahnarrowhebrew;05B7\npatahquarterhebrew;05B7\npatahwidehebrew;05B7\npazerhebrew;05A1\npbopomofo;3106\npcircle;24DF\npdotaccent;1E57\npe;05E4\npecyrillic;043F\npedagesh;FB44\npedageshhebrew;FB44\npeezisquare;333B\npefinaldageshhebrew;FB43\npeharabic;067E\npeharmenian;057A\npehebrew;05E4\npehfinalarabic;FB57\npehinitialarabic;FB58\npehiragana;307A\npehmedialarabic;FB59\npekatakana;30DA\npemiddlehookcyrillic;04A7\nperafehebrew;FB4E\npercent;0025\npercentarabic;066A\npercentmonospace;FF05\npercentsmall;FE6A\nperiod;002E\nperiodarmenian;0589\nperiodcentered;00B7\nperiodhalfwidth;FF61\nperiodinferior;F6E7\nperiodmonospace;FF0E\nperiodsmall;FE52\nperiodsuperior;F6E8\nperispomenigreekcmb;0342\nperpendicular;22A5\nperthousand;2030\npeseta;20A7\npfsquare;338A\nphabengali;09AB\nphadeva;092B\nphagujarati;0AAB\nphagurmukhi;0A2B\nphi;03C6\nphi1;03D5\nphieuphacirclekorean;327A\nphieuphaparenkorean;321A\nphieuphcirclekorean;326C\nphieuphkorean;314D\nphieuphparenkorean;320C\nphilatin;0278\nphinthuthai;0E3A\nphisymbolgreek;03D5\nphook;01A5\nphophanthai;0E1E\nphophungthai;0E1C\nphosamphaothai;0E20\npi;03C0\npieupacirclekorean;3273\npieupaparenkorean;3213\npieupcieuckorean;3176\npieupcirclekorean;3265\npieupkiyeokkorean;3172\npieupkorean;3142\npieupparenkorean;3205\npieupsioskiyeokkorean;3174\npieupsioskorean;3144\npieupsiostikeutkorean;3175\npieupthieuthkorean;3177\npieuptikeutkorean;3173\npihiragana;3074\npikatakana;30D4\npisymbolgreek;03D6\npiwrarmenian;0583\nplus;002B\nplusbelowcmb;031F\npluscircle;2295\nplusminus;00B1\nplusmod;02D6\nplusmonospace;FF0B\nplussmall;FE62\nplussuperior;207A\npmonospace;FF50\npmsquare;33D8\npohiragana;307D\npointingindexdownwhite;261F\npointingindexleftwhite;261C\npointingindexrightwhite;261E\npointingindexupwhite;261D\npokatakana;30DD\npoplathai;0E1B\npostalmark;3012\npostalmarkface;3020\npparen;24AB\nprecedes;227A\nprescription;211E\nprimemod;02B9\nprimereversed;2035\nproduct;220F\nprojective;2305\nprolongedkana;30FC\npropellor;2318\npropersubset;2282\npropersuperset;2283\nproportion;2237\nproportional;221D\npsi;03C8\npsicyrillic;0471\npsilipneumatacyrilliccmb;0486\npssquare;33B0\npuhiragana;3077\npukatakana;30D7\npvsquare;33B4\npwsquare;33BA\nq;0071\nqadeva;0958\nqadmahebrew;05A8\nqafarabic;0642\nqaffinalarabic;FED6\nqafinitialarabic;FED7\nqafmedialarabic;FED8\nqamats;05B8\nqamats10;05B8\nqamats1a;05B8\nqamats1c;05B8\nqamats27;05B8\nqamats29;05B8\nqamats33;05B8\nqamatsde;05B8\nqamatshebrew;05B8\nqamatsnarrowhebrew;05B8\nqamatsqatanhebrew;05B8\nqamatsqatannarrowhebrew;05B8\nqamatsqatanquarterhebrew;05B8\nqamatsqatanwidehebrew;05B8\nqamatsquarterhebrew;05B8\nqamatswidehebrew;05B8\nqarneyparahebrew;059F\nqbopomofo;3111\nqcircle;24E0\nqhook;02A0\nqmonospace;FF51\nqof;05E7\nqofdagesh;FB47\nqofdageshhebrew;FB47\nqofhatafpatah;05E7 05B2\nqofhatafpatahhebrew;05E7 05B2\nqofhatafsegol;05E7 05B1\nqofhatafsegolhebrew;05E7 05B1\nqofhebrew;05E7\nqofhiriq;05E7 05B4\nqofhiriqhebrew;05E7 05B4\nqofholam;05E7 05B9\nqofholamhebrew;05E7 05B9\nqofpatah;05E7 05B7\nqofpatahhebrew;05E7 05B7\nqofqamats;05E7 05B8\nqofqamatshebrew;05E7 05B8\nqofqubuts;05E7 05BB\nqofqubutshebrew;05E7 05BB\nqofsegol;05E7 05B6\nqofsegolhebrew;05E7 05B6\nqofsheva;05E7 05B0\nqofshevahebrew;05E7 05B0\nqoftsere;05E7 05B5\nqoftserehebrew;05E7 05B5\nqparen;24AC\nquarternote;2669\nqubuts;05BB\nqubuts18;05BB\nqubuts25;05BB\nqubuts31;05BB\nqubutshebrew;05BB\nqubutsnarrowhebrew;05BB\nqubutsquarterhebrew;05BB\nqubutswidehebrew;05BB\nquestion;003F\nquestionarabic;061F\nquestionarmenian;055E\nquestiondown;00BF\nquestiondownsmall;F7BF\nquestiongreek;037E\nquestionmonospace;FF1F\nquestionsmall;F73F\nquotedbl;0022\nquotedblbase;201E\nquotedblleft;201C\nquotedblmonospace;FF02\nquotedblprime;301E\nquotedblprimereversed;301D\nquotedblright;201D\nquoteleft;2018\nquoteleftreversed;201B\nquotereversed;201B\nquoteright;2019\nquoterightn;0149\nquotesinglbase;201A\nquotesingle;0027\nquotesinglemonospace;FF07\nr;0072\nraarmenian;057C\nrabengali;09B0\nracute;0155\nradeva;0930\nradical;221A\nradicalex;F8E5\nradoverssquare;33AE\nradoverssquaredsquare;33AF\nradsquare;33AD\nrafe;05BF\nrafehebrew;05BF\nragujarati;0AB0\nragurmukhi;0A30\nrahiragana;3089\nrakatakana;30E9\nrakatakanahalfwidth;FF97\nralowerdiagonalbengali;09F1\nramiddlediagonalbengali;09F0\nramshorn;0264\nratio;2236\nrbopomofo;3116\nrcaron;0159\nrcedilla;0157\nrcircle;24E1\nrcommaaccent;0157\nrdblgrave;0211\nrdotaccent;1E59\nrdotbelow;1E5B\nrdotbelowmacron;1E5D\nreferencemark;203B\nreflexsubset;2286\nreflexsuperset;2287\nregistered;00AE\nregistersans;F8E8\nregisterserif;F6DA\nreharabic;0631\nreharmenian;0580\nrehfinalarabic;FEAE\nrehiragana;308C\nrehyehaleflamarabic;0631 FEF3 FE8E 0644\nrekatakana;30EC\nrekatakanahalfwidth;FF9A\nresh;05E8\nreshdageshhebrew;FB48\nreshhatafpatah;05E8 05B2\nreshhatafpatahhebrew;05E8 05B2\nreshhatafsegol;05E8 05B1\nreshhatafsegolhebrew;05E8 05B1\nreshhebrew;05E8\nreshhiriq;05E8 05B4\nreshhiriqhebrew;05E8 05B4\nreshholam;05E8 05B9\nreshholamhebrew;05E8 05B9\nreshpatah;05E8 05B7\nreshpatahhebrew;05E8 05B7\nreshqamats;05E8 05B8\nreshqamatshebrew;05E8 05B8\nreshqubuts;05E8 05BB\nreshqubutshebrew;05E8 05BB\nreshsegol;05E8 05B6\nreshsegolhebrew;05E8 05B6\nreshsheva;05E8 05B0\nreshshevahebrew;05E8 05B0\nreshtsere;05E8 05B5\nreshtserehebrew;05E8 05B5\nreversedtilde;223D\nreviahebrew;0597\nreviamugrashhebrew;0597\nrevlogicalnot;2310\nrfishhook;027E\nrfishhookreversed;027F\nrhabengali;09DD\nrhadeva;095D\nrho;03C1\nrhook;027D\nrhookturned;027B\nrhookturnedsuperior;02B5\nrhosymbolgreek;03F1\nrhotichookmod;02DE\nrieulacirclekorean;3271\nrieulaparenkorean;3211\nrieulcirclekorean;3263\nrieulhieuhkorean;3140\nrieulkiyeokkorean;313A\nrieulkiyeoksioskorean;3169\nrieulkorean;3139\nrieulmieumkorean;313B\nrieulpansioskorean;316C\nrieulparenkorean;3203\nrieulphieuphkorean;313F\nrieulpieupkorean;313C\nrieulpieupsioskorean;316B\nrieulsioskorean;313D\nrieulthieuthkorean;313E\nrieultikeutkorean;316A\nrieulyeorinhieuhkorean;316D\nrightangle;221F\nrighttackbelowcmb;0319\nrighttriangle;22BF\nrihiragana;308A\nrikatakana;30EA\nrikatakanahalfwidth;FF98\nring;02DA\nringbelowcmb;0325\nringcmb;030A\nringhalfleft;02BF\nringhalfleftarmenian;0559\nringhalfleftbelowcmb;031C\nringhalfleftcentered;02D3\nringhalfright;02BE\nringhalfrightbelowcmb;0339\nringhalfrightcentered;02D2\nrinvertedbreve;0213\nrittorusquare;3351\nrlinebelow;1E5F\nrlongleg;027C\nrlonglegturned;027A\nrmonospace;FF52\nrohiragana;308D\nrokatakana;30ED\nrokatakanahalfwidth;FF9B\nroruathai;0E23\nrparen;24AD\nrrabengali;09DC\nrradeva;0931\nrragurmukhi;0A5C\nrreharabic;0691\nrrehfinalarabic;FB8D\nrrvocalicbengali;09E0\nrrvocalicdeva;0960\nrrvocalicgujarati;0AE0\nrrvocalicvowelsignbengali;09C4\nrrvocalicvowelsigndeva;0944\nrrvocalicvowelsigngujarati;0AC4\nrsuperior;F6F1\nrtblock;2590\nrturned;0279\nrturnedsuperior;02B4\nruhiragana;308B\nrukatakana;30EB\nrukatakanahalfwidth;FF99\nrupeemarkbengali;09F2\nrupeesignbengali;09F3\nrupiah;F6DD\nruthai;0E24\nrvocalicbengali;098B\nrvocalicdeva;090B\nrvocalicgujarati;0A8B\nrvocalicvowelsignbengali;09C3\nrvocalicvowelsigndeva;0943\nrvocalicvowelsigngujarati;0AC3\ns;0073\nsabengali;09B8\nsacute;015B\nsacutedotaccent;1E65\nsadarabic;0635\nsadeva;0938\nsadfinalarabic;FEBA\nsadinitialarabic;FEBB\nsadmedialarabic;FEBC\nsagujarati;0AB8\nsagurmukhi;0A38\nsahiragana;3055\nsakatakana;30B5\nsakatakanahalfwidth;FF7B\nsallallahoualayhewasallamarabic;FDFA\nsamekh;05E1\nsamekhdagesh;FB41\nsamekhdageshhebrew;FB41\nsamekhhebrew;05E1\nsaraaathai;0E32\nsaraaethai;0E41\nsaraaimaimalaithai;0E44\nsaraaimaimuanthai;0E43\nsaraamthai;0E33\nsaraathai;0E30\nsaraethai;0E40\nsaraiileftthai;F886\nsaraiithai;0E35\nsaraileftthai;F885\nsaraithai;0E34\nsaraothai;0E42\nsaraueeleftthai;F888\nsaraueethai;0E37\nsaraueleftthai;F887\nsarauethai;0E36\nsarauthai;0E38\nsarauuthai;0E39\nsbopomofo;3119\nscaron;0161\nscarondotaccent;1E67\nscedilla;015F\nschwa;0259\nschwacyrillic;04D9\nschwadieresiscyrillic;04DB\nschwahook;025A\nscircle;24E2\nscircumflex;015D\nscommaaccent;0219\nsdotaccent;1E61\nsdotbelow;1E63\nsdotbelowdotaccent;1E69\nseagullbelowcmb;033C\nsecond;2033\nsecondtonechinese;02CA\nsection;00A7\nseenarabic;0633\nseenfinalarabic;FEB2\nseeninitialarabic;FEB3\nseenmedialarabic;FEB4\nsegol;05B6\nsegol13;05B6\nsegol1f;05B6\nsegol2c;05B6\nsegolhebrew;05B6\nsegolnarrowhebrew;05B6\nsegolquarterhebrew;05B6\nsegoltahebrew;0592\nsegolwidehebrew;05B6\nseharmenian;057D\nsehiragana;305B\nsekatakana;30BB\nsekatakanahalfwidth;FF7E\nsemicolon;003B\nsemicolonarabic;061B\nsemicolonmonospace;FF1B\nsemicolonsmall;FE54\nsemivoicedmarkkana;309C\nsemivoicedmarkkanahalfwidth;FF9F\nsentisquare;3322\nsentosquare;3323\nseven;0037\nsevenarabic;0667\nsevenbengali;09ED\nsevencircle;2466\nsevencircleinversesansserif;2790\nsevendeva;096D\nseveneighths;215E\nsevengujarati;0AED\nsevengurmukhi;0A6D\nsevenhackarabic;0667\nsevenhangzhou;3027\nsevenideographicparen;3226\nseveninferior;2087\nsevenmonospace;FF17\nsevenoldstyle;F737\nsevenparen;247A\nsevenperiod;248E\nsevenpersian;06F7\nsevenroman;2176\nsevensuperior;2077\nseventeencircle;2470\nseventeenparen;2484\nseventeenperiod;2498\nseventhai;0E57\nsfthyphen;00AD\nshaarmenian;0577\nshabengali;09B6\nshacyrillic;0448\nshaddaarabic;0651\nshaddadammaarabic;FC61\nshaddadammatanarabic;FC5E\nshaddafathaarabic;FC60\nshaddafathatanarabic;0651 064B\nshaddakasraarabic;FC62\nshaddakasratanarabic;FC5F\nshade;2592\nshadedark;2593\nshadelight;2591\nshademedium;2592\nshadeva;0936\nshagujarati;0AB6\nshagurmukhi;0A36\nshalshelethebrew;0593\nshbopomofo;3115\nshchacyrillic;0449\nsheenarabic;0634\nsheenfinalarabic;FEB6\nsheeninitialarabic;FEB7\nsheenmedialarabic;FEB8\nsheicoptic;03E3\nsheqel;20AA\nsheqelhebrew;20AA\nsheva;05B0\nsheva115;05B0\nsheva15;05B0\nsheva22;05B0\nsheva2e;05B0\nshevahebrew;05B0\nshevanarrowhebrew;05B0\nshevaquarterhebrew;05B0\nshevawidehebrew;05B0\nshhacyrillic;04BB\nshimacoptic;03ED\nshin;05E9\nshindagesh;FB49\nshindageshhebrew;FB49\nshindageshshindot;FB2C\nshindageshshindothebrew;FB2C\nshindageshsindot;FB2D\nshindageshsindothebrew;FB2D\nshindothebrew;05C1\nshinhebrew;05E9\nshinshindot;FB2A\nshinshindothebrew;FB2A\nshinsindot;FB2B\nshinsindothebrew;FB2B\nshook;0282\nsigma;03C3\nsigma1;03C2\nsigmafinal;03C2\nsigmalunatesymbolgreek;03F2\nsihiragana;3057\nsikatakana;30B7\nsikatakanahalfwidth;FF7C\nsiluqhebrew;05BD\nsiluqlefthebrew;05BD\nsimilar;223C\nsindothebrew;05C2\nsiosacirclekorean;3274\nsiosaparenkorean;3214\nsioscieuckorean;317E\nsioscirclekorean;3266\nsioskiyeokkorean;317A\nsioskorean;3145\nsiosnieunkorean;317B\nsiosparenkorean;3206\nsiospieupkorean;317D\nsiostikeutkorean;317C\nsix;0036\nsixarabic;0666\nsixbengali;09EC\nsixcircle;2465\nsixcircleinversesansserif;278F\nsixdeva;096C\nsixgujarati;0AEC\nsixgurmukhi;0A6C\nsixhackarabic;0666\nsixhangzhou;3026\nsixideographicparen;3225\nsixinferior;2086\nsixmonospace;FF16\nsixoldstyle;F736\nsixparen;2479\nsixperiod;248D\nsixpersian;06F6\nsixroman;2175\nsixsuperior;2076\nsixteencircle;246F\nsixteencurrencydenominatorbengali;09F9\nsixteenparen;2483\nsixteenperiod;2497\nsixthai;0E56\nslash;002F\nslashmonospace;FF0F\nslong;017F\nslongdotaccent;1E9B\nsmileface;263A\nsmonospace;FF53\nsofpasuqhebrew;05C3\nsofthyphen;00AD\nsoftsigncyrillic;044C\nsohiragana;305D\nsokatakana;30BD\nsokatakanahalfwidth;FF7F\nsoliduslongoverlaycmb;0338\nsolidusshortoverlaycmb;0337\nsorusithai;0E29\nsosalathai;0E28\nsosothai;0E0B\nsosuathai;0E2A\nspace;0020\nspacehackarabic;0020\nspade;2660\nspadesuitblack;2660\nspadesuitwhite;2664\nsparen;24AE\nsquarebelowcmb;033B\nsquarecc;33C4\nsquarecm;339D\nsquarediagonalcrosshatchfill;25A9\nsquarehorizontalfill;25A4\nsquarekg;338F\nsquarekm;339E\nsquarekmcapital;33CE\nsquareln;33D1\nsquarelog;33D2\nsquaremg;338E\nsquaremil;33D5\nsquaremm;339C\nsquaremsquared;33A1\nsquareorthogonalcrosshatchfill;25A6\nsquareupperlefttolowerrightfill;25A7\nsquareupperrighttolowerleftfill;25A8\nsquareverticalfill;25A5\nsquarewhitewithsmallblack;25A3\nsrsquare;33DB\nssabengali;09B7\nssadeva;0937\nssagujarati;0AB7\nssangcieuckorean;3149\nssanghieuhkorean;3185\nssangieungkorean;3180\nssangkiyeokkorean;3132\nssangnieunkorean;3165\nssangpieupkorean;3143\nssangsioskorean;3146\nssangtikeutkorean;3138\nssuperior;F6F2\nsterling;00A3\nsterlingmonospace;FFE1\nstrokelongoverlaycmb;0336\nstrokeshortoverlaycmb;0335\nsubset;2282\nsubsetnotequal;228A\nsubsetorequal;2286\nsucceeds;227B\nsuchthat;220B\nsuhiragana;3059\nsukatakana;30B9\nsukatakanahalfwidth;FF7D\nsukunarabic;0652\nsummation;2211\nsun;263C\nsuperset;2283\nsupersetnotequal;228B\nsupersetorequal;2287\nsvsquare;33DC\nsyouwaerasquare;337C\nt;0074\ntabengali;09A4\ntackdown;22A4\ntackleft;22A3\ntadeva;0924\ntagujarati;0AA4\ntagurmukhi;0A24\ntaharabic;0637\ntahfinalarabic;FEC2\ntahinitialarabic;FEC3\ntahiragana;305F\ntahmedialarabic;FEC4\ntaisyouerasquare;337D\ntakatakana;30BF\ntakatakanahalfwidth;FF80\ntatweelarabic;0640\ntau;03C4\ntav;05EA\ntavdages;FB4A\ntavdagesh;FB4A\ntavdageshhebrew;FB4A\ntavhebrew;05EA\ntbar;0167\ntbopomofo;310A\ntcaron;0165\ntccurl;02A8\ntcedilla;0163\ntcheharabic;0686\ntchehfinalarabic;FB7B\ntchehinitialarabic;FB7C\ntchehmedialarabic;FB7D\ntchehmeeminitialarabic;FB7C FEE4\ntcircle;24E3\ntcircumflexbelow;1E71\ntcommaaccent;0163\ntdieresis;1E97\ntdotaccent;1E6B\ntdotbelow;1E6D\ntecyrillic;0442\ntedescendercyrillic;04AD\nteharabic;062A\ntehfinalarabic;FE96\ntehhahinitialarabic;FCA2\ntehhahisolatedarabic;FC0C\ntehinitialarabic;FE97\ntehiragana;3066\ntehjeeminitialarabic;FCA1\ntehjeemisolatedarabic;FC0B\ntehmarbutaarabic;0629\ntehmarbutafinalarabic;FE94\ntehmedialarabic;FE98\ntehmeeminitialarabic;FCA4\ntehmeemisolatedarabic;FC0E\ntehnoonfinalarabic;FC73\ntekatakana;30C6\ntekatakanahalfwidth;FF83\ntelephone;2121\ntelephoneblack;260E\ntelishagedolahebrew;05A0\ntelishaqetanahebrew;05A9\ntencircle;2469\ntenideographicparen;3229\ntenparen;247D\ntenperiod;2491\ntenroman;2179\ntesh;02A7\ntet;05D8\ntetdagesh;FB38\ntetdageshhebrew;FB38\ntethebrew;05D8\ntetsecyrillic;04B5\ntevirhebrew;059B\ntevirlefthebrew;059B\nthabengali;09A5\nthadeva;0925\nthagujarati;0AA5\nthagurmukhi;0A25\nthalarabic;0630\nthalfinalarabic;FEAC\nthanthakhatlowleftthai;F898\nthanthakhatlowrightthai;F897\nthanthakhatthai;0E4C\nthanthakhatupperleftthai;F896\ntheharabic;062B\nthehfinalarabic;FE9A\nthehinitialarabic;FE9B\nthehmedialarabic;FE9C\nthereexists;2203\ntherefore;2234\ntheta;03B8\ntheta1;03D1\nthetasymbolgreek;03D1\nthieuthacirclekorean;3279\nthieuthaparenkorean;3219\nthieuthcirclekorean;326B\nthieuthkorean;314C\nthieuthparenkorean;320B\nthirteencircle;246C\nthirteenparen;2480\nthirteenperiod;2494\nthonangmonthothai;0E11\nthook;01AD\nthophuthaothai;0E12\nthorn;00FE\nthothahanthai;0E17\nthothanthai;0E10\nthothongthai;0E18\nthothungthai;0E16\nthousandcyrillic;0482\nthousandsseparatorarabic;066C\nthousandsseparatorpersian;066C\nthree;0033\nthreearabic;0663\nthreebengali;09E9\nthreecircle;2462\nthreecircleinversesansserif;278C\nthreedeva;0969\nthreeeighths;215C\nthreegujarati;0AE9\nthreegurmukhi;0A69\nthreehackarabic;0663\nthreehangzhou;3023\nthreeideographicparen;3222\nthreeinferior;2083\nthreemonospace;FF13\nthreenumeratorbengali;09F6\nthreeoldstyle;F733\nthreeparen;2476\nthreeperiod;248A\nthreepersian;06F3\nthreequarters;00BE\nthreequartersemdash;F6DE\nthreeroman;2172\nthreesuperior;00B3\nthreethai;0E53\nthzsquare;3394\ntihiragana;3061\ntikatakana;30C1\ntikatakanahalfwidth;FF81\ntikeutacirclekorean;3270\ntikeutaparenkorean;3210\ntikeutcirclekorean;3262\ntikeutkorean;3137\ntikeutparenkorean;3202\ntilde;02DC\ntildebelowcmb;0330\ntildecmb;0303\ntildecomb;0303\ntildedoublecmb;0360\ntildeoperator;223C\ntildeoverlaycmb;0334\ntildeverticalcmb;033E\ntimescircle;2297\ntipehahebrew;0596\ntipehalefthebrew;0596\ntippigurmukhi;0A70\ntitlocyrilliccmb;0483\ntiwnarmenian;057F\ntlinebelow;1E6F\ntmonospace;FF54\ntoarmenian;0569\ntohiragana;3068\ntokatakana;30C8\ntokatakanahalfwidth;FF84\ntonebarextrahighmod;02E5\ntonebarextralowmod;02E9\ntonebarhighmod;02E6\ntonebarlowmod;02E8\ntonebarmidmod;02E7\ntonefive;01BD\ntonesix;0185\ntonetwo;01A8\ntonos;0384\ntonsquare;3327\ntopatakthai;0E0F\ntortoiseshellbracketleft;3014\ntortoiseshellbracketleftsmall;FE5D\ntortoiseshellbracketleftvertical;FE39\ntortoiseshellbracketright;3015\ntortoiseshellbracketrightsmall;FE5E\ntortoiseshellbracketrightvertical;FE3A\ntotaothai;0E15\ntpalatalhook;01AB\ntparen;24AF\ntrademark;2122\ntrademarksans;F8EA\ntrademarkserif;F6DB\ntretroflexhook;0288\ntriagdn;25BC\ntriaglf;25C4\ntriagrt;25BA\ntriagup;25B2\nts;02A6\ntsadi;05E6\ntsadidagesh;FB46\ntsadidageshhebrew;FB46\ntsadihebrew;05E6\ntsecyrillic;0446\ntsere;05B5\ntsere12;05B5\ntsere1e;05B5\ntsere2b;05B5\ntserehebrew;05B5\ntserenarrowhebrew;05B5\ntserequarterhebrew;05B5\ntserewidehebrew;05B5\ntshecyrillic;045B\ntsuperior;F6F3\nttabengali;099F\nttadeva;091F\nttagujarati;0A9F\nttagurmukhi;0A1F\ntteharabic;0679\nttehfinalarabic;FB67\nttehinitialarabic;FB68\nttehmedialarabic;FB69\ntthabengali;09A0\ntthadeva;0920\ntthagujarati;0AA0\ntthagurmukhi;0A20\ntturned;0287\ntuhiragana;3064\ntukatakana;30C4\ntukatakanahalfwidth;FF82\ntusmallhiragana;3063\ntusmallkatakana;30C3\ntusmallkatakanahalfwidth;FF6F\ntwelvecircle;246B\ntwelveparen;247F\ntwelveperiod;2493\ntwelveroman;217B\ntwentycircle;2473\ntwentyhangzhou;5344\ntwentyparen;2487\ntwentyperiod;249B\ntwo;0032\ntwoarabic;0662\ntwobengali;09E8\ntwocircle;2461\ntwocircleinversesansserif;278B\ntwodeva;0968\ntwodotenleader;2025\ntwodotleader;2025\ntwodotleadervertical;FE30\ntwogujarati;0AE8\ntwogurmukhi;0A68\ntwohackarabic;0662\ntwohangzhou;3022\ntwoideographicparen;3221\ntwoinferior;2082\ntwomonospace;FF12\ntwonumeratorbengali;09F5\ntwooldstyle;F732\ntwoparen;2475\ntwoperiod;2489\ntwopersian;06F2\ntworoman;2171\ntwostroke;01BB\ntwosuperior;00B2\ntwothai;0E52\ntwothirds;2154\nu;0075\nuacute;00FA\nubar;0289\nubengali;0989\nubopomofo;3128\nubreve;016D\nucaron;01D4\nucircle;24E4\nucircumflex;00FB\nucircumflexbelow;1E77\nucyrillic;0443\nudattadeva;0951\nudblacute;0171\nudblgrave;0215\nudeva;0909\nudieresis;00FC\nudieresisacute;01D8\nudieresisbelow;1E73\nudieresiscaron;01DA\nudieresiscyrillic;04F1\nudieresisgrave;01DC\nudieresismacron;01D6\nudotbelow;1EE5\nugrave;00F9\nugujarati;0A89\nugurmukhi;0A09\nuhiragana;3046\nuhookabove;1EE7\nuhorn;01B0\nuhornacute;1EE9\nuhorndotbelow;1EF1\nuhorngrave;1EEB\nuhornhookabove;1EED\nuhorntilde;1EEF\nuhungarumlaut;0171\nuhungarumlautcyrillic;04F3\nuinvertedbreve;0217\nukatakana;30A6\nukatakanahalfwidth;FF73\nukcyrillic;0479\nukorean;315C\numacron;016B\numacroncyrillic;04EF\numacrondieresis;1E7B\numatragurmukhi;0A41\numonospace;FF55\nunderscore;005F\nunderscoredbl;2017\nunderscoremonospace;FF3F\nunderscorevertical;FE33\nunderscorewavy;FE4F\nunion;222A\nuniversal;2200\nuogonek;0173\nuparen;24B0\nupblock;2580\nupperdothebrew;05C4\nupsilon;03C5\nupsilondieresis;03CB\nupsilondieresistonos;03B0\nupsilonlatin;028A\nupsilontonos;03CD\nuptackbelowcmb;031D\nuptackmod;02D4\nuragurmukhi;0A73\nuring;016F\nushortcyrillic;045E\nusmallhiragana;3045\nusmallkatakana;30A5\nusmallkatakanahalfwidth;FF69\nustraightcyrillic;04AF\nustraightstrokecyrillic;04B1\nutilde;0169\nutildeacute;1E79\nutildebelow;1E75\nuubengali;098A\nuudeva;090A\nuugujarati;0A8A\nuugurmukhi;0A0A\nuumatragurmukhi;0A42\nuuvowelsignbengali;09C2\nuuvowelsigndeva;0942\nuuvowelsigngujarati;0AC2\nuvowelsignbengali;09C1\nuvowelsigndeva;0941\nuvowelsigngujarati;0AC1\nv;0076\nvadeva;0935\nvagujarati;0AB5\nvagurmukhi;0A35\nvakatakana;30F7\nvav;05D5\nvavdagesh;FB35\nvavdagesh65;FB35\nvavdageshhebrew;FB35\nvavhebrew;05D5\nvavholam;FB4B\nvavholamhebrew;FB4B\nvavvavhebrew;05F0\nvavyodhebrew;05F1\nvcircle;24E5\nvdotbelow;1E7F\nvecyrillic;0432\nveharabic;06A4\nvehfinalarabic;FB6B\nvehinitialarabic;FB6C\nvehmedialarabic;FB6D\nvekatakana;30F9\nvenus;2640\nverticalbar;007C\nverticallineabovecmb;030D\nverticallinebelowcmb;0329\nverticallinelowmod;02CC\nverticallinemod;02C8\nvewarmenian;057E\nvhook;028B\nvikatakana;30F8\nviramabengali;09CD\nviramadeva;094D\nviramagujarati;0ACD\nvisargabengali;0983\nvisargadeva;0903\nvisargagujarati;0A83\nvmonospace;FF56\nvoarmenian;0578\nvoicediterationhiragana;309E\nvoicediterationkatakana;30FE\nvoicedmarkkana;309B\nvoicedmarkkanahalfwidth;FF9E\nvokatakana;30FA\nvparen;24B1\nvtilde;1E7D\nvturned;028C\nvuhiragana;3094\nvukatakana;30F4\nw;0077\nwacute;1E83\nwaekorean;3159\nwahiragana;308F\nwakatakana;30EF\nwakatakanahalfwidth;FF9C\nwakorean;3158\nwasmallhiragana;308E\nwasmallkatakana;30EE\nwattosquare;3357\nwavedash;301C\nwavyunderscorevertical;FE34\nwawarabic;0648\nwawfinalarabic;FEEE\nwawhamzaabovearabic;0624\nwawhamzaabovefinalarabic;FE86\nwbsquare;33DD\nwcircle;24E6\nwcircumflex;0175\nwdieresis;1E85\nwdotaccent;1E87\nwdotbelow;1E89\nwehiragana;3091\nweierstrass;2118\nwekatakana;30F1\nwekorean;315E\nweokorean;315D\nwgrave;1E81\nwhitebullet;25E6\nwhitecircle;25CB\nwhitecircleinverse;25D9\nwhitecornerbracketleft;300E\nwhitecornerbracketleftvertical;FE43\nwhitecornerbracketright;300F\nwhitecornerbracketrightvertical;FE44\nwhitediamond;25C7\nwhitediamondcontainingblacksmalldiamond;25C8\nwhitedownpointingsmalltriangle;25BF\nwhitedownpointingtriangle;25BD\nwhiteleftpointingsmalltriangle;25C3\nwhiteleftpointingtriangle;25C1\nwhitelenticularbracketleft;3016\nwhitelenticularbracketright;3017\nwhiterightpointingsmalltriangle;25B9\nwhiterightpointingtriangle;25B7\nwhitesmallsquare;25AB\nwhitesmilingface;263A\nwhitesquare;25A1\nwhitestar;2606\nwhitetelephone;260F\nwhitetortoiseshellbracketleft;3018\nwhitetortoiseshellbracketright;3019\nwhiteuppointingsmalltriangle;25B5\nwhiteuppointingtriangle;25B3\nwihiragana;3090\nwikatakana;30F0\nwikorean;315F\nwmonospace;FF57\nwohiragana;3092\nwokatakana;30F2\nwokatakanahalfwidth;FF66\nwon;20A9\nwonmonospace;FFE6\nwowaenthai;0E27\nwparen;24B2\nwring;1E98\nwsuperior;02B7\nwturned;028D\nwynn;01BF\nx;0078\nxabovecmb;033D\nxbopomofo;3112\nxcircle;24E7\nxdieresis;1E8D\nxdotaccent;1E8B\nxeharmenian;056D\nxi;03BE\nxmonospace;FF58\nxparen;24B3\nxsuperior;02E3\ny;0079\nyaadosquare;334E\nyabengali;09AF\nyacute;00FD\nyadeva;092F\nyaekorean;3152\nyagujarati;0AAF\nyagurmukhi;0A2F\nyahiragana;3084\nyakatakana;30E4\nyakatakanahalfwidth;FF94\nyakorean;3151\nyamakkanthai;0E4E\nyasmallhiragana;3083\nyasmallkatakana;30E3\nyasmallkatakanahalfwidth;FF6C\nyatcyrillic;0463\nycircle;24E8\nycircumflex;0177\nydieresis;00FF\nydotaccent;1E8F\nydotbelow;1EF5\nyeharabic;064A\nyehbarreearabic;06D2\nyehbarreefinalarabic;FBAF\nyehfinalarabic;FEF2\nyehhamzaabovearabic;0626\nyehhamzaabovefinalarabic;FE8A\nyehhamzaaboveinitialarabic;FE8B\nyehhamzaabovemedialarabic;FE8C\nyehinitialarabic;FEF3\nyehmedialarabic;FEF4\nyehmeeminitialarabic;FCDD\nyehmeemisolatedarabic;FC58\nyehnoonfinalarabic;FC94\nyehthreedotsbelowarabic;06D1\nyekorean;3156\nyen;00A5\nyenmonospace;FFE5\nyeokorean;3155\nyeorinhieuhkorean;3186\nyerahbenyomohebrew;05AA\nyerahbenyomolefthebrew;05AA\nyericyrillic;044B\nyerudieresiscyrillic;04F9\nyesieungkorean;3181\nyesieungpansioskorean;3183\nyesieungsioskorean;3182\nyetivhebrew;059A\nygrave;1EF3\nyhook;01B4\nyhookabove;1EF7\nyiarmenian;0575\nyicyrillic;0457\nyikorean;3162\nyinyang;262F\nyiwnarmenian;0582\nymonospace;FF59\nyod;05D9\nyoddagesh;FB39\nyoddageshhebrew;FB39\nyodhebrew;05D9\nyodyodhebrew;05F2\nyodyodpatahhebrew;FB1F\nyohiragana;3088\nyoikorean;3189\nyokatakana;30E8\nyokatakanahalfwidth;FF96\nyokorean;315B\nyosmallhiragana;3087\nyosmallkatakana;30E7\nyosmallkatakanahalfwidth;FF6E\nyotgreek;03F3\nyoyaekorean;3188\nyoyakorean;3187\nyoyakthai;0E22\nyoyingthai;0E0D\nyparen;24B4\nypogegrammeni;037A\nypogegrammenigreekcmb;0345\nyr;01A6\nyring;1E99\nysuperior;02B8\nytilde;1EF9\nyturned;028E\nyuhiragana;3086\nyuikorean;318C\nyukatakana;30E6\nyukatakanahalfwidth;FF95\nyukorean;3160\nyusbigcyrillic;046B\nyusbigiotifiedcyrillic;046D\nyuslittlecyrillic;0467\nyuslittleiotifiedcyrillic;0469\nyusmallhiragana;3085\nyusmallkatakana;30E5\nyusmallkatakanahalfwidth;FF6D\nyuyekorean;318B\nyuyeokorean;318A\nyyabengali;09DF\nyyadeva;095F\nz;007A\nzaarmenian;0566\nzacute;017A\nzadeva;095B\nzagurmukhi;0A5B\nzaharabic;0638\nzahfinalarabic;FEC6\nzahinitialarabic;FEC7\nzahiragana;3056\nzahmedialarabic;FEC8\nzainarabic;0632\nzainfinalarabic;FEB0\nzakatakana;30B6\nzaqefgadolhebrew;0595\nzaqefqatanhebrew;0594\nzarqahebrew;0598\nzayin;05D6\nzayindagesh;FB36\nzayindageshhebrew;FB36\nzayinhebrew;05D6\nzbopomofo;3117\nzcaron;017E\nzcircle;24E9\nzcircumflex;1E91\nzcurl;0291\nzdot;017C\nzdotaccent;017C\nzdotbelow;1E93\nzecyrillic;0437\nzedescendercyrillic;0499\nzedieresiscyrillic;04DF\nzehiragana;305C\nzekatakana;30BC\nzero;0030\nzeroarabic;0660\nzerobengali;09E6\nzerodeva;0966\nzerogujarati;0AE6\nzerogurmukhi;0A66\nzerohackarabic;0660\nzeroinferior;2080\nzeromonospace;FF10\nzerooldstyle;F730\nzeropersian;06F0\nzerosuperior;2070\nzerothai;0E50\nzerowidthjoiner;FEFF\nzerowidthnonjoiner;200C\nzerowidthspace;200B\nzeta;03B6\nzhbopomofo;3113\nzhearmenian;056A\nzhebrevecyrillic;04C2\nzhecyrillic;0436\nzhedescendercyrillic;0497\nzhedieresiscyrillic;04DD\nzihiragana;3058\nzikatakana;30B8\nzinorhebrew;05AE\nzlinebelow;1E95\nzmonospace;FF5A\nzohiragana;305E\nzokatakana;30BE\nzparen;24B5\nzretroflexhook;0290\nzstroke;01B6\nzuhiragana;305A\nzukatakana;30BA\na100;275E\na101;2761\na102;2762\na103;2763\na104;2764\na105;2710\na106;2765\na107;2766\na108;2767\na109;2660\na10;2721\na110;2665\na111;2666\na112;2663\na117;2709\na118;2708\na119;2707\na11;261B\na120;2460\na121;2461\na122;2462\na123;2463\na124;2464\na125;2465\na126;2466\na127;2467\na128;2468\na129;2469\na12;261E\na130;2776\na131;2777\na132;2778\na133;2779\na134;277A\na135;277B\na136;277C\na137;277D\na138;277E\na139;277F\na13;270C\na140;2780\na141;2781\na142;2782\na143;2783\na144;2784\na145;2785\na146;2786\na147;2787\na148;2788\na149;2789\na14;270D\na150;278A\na151;278B\na152;278C\na153;278D\na154;278E\na155;278F\na156;2790\na157;2791\na158;2792\na159;2793\na15;270E\na160;2794\na161;2192\na162;27A3\na163;2194\na164;2195\na165;2799\na166;279B\na167;279C\na168;279D\na169;279E\na16;270F\na170;279F\na171;27A0\na172;27A1\na173;27A2\na174;27A4\na175;27A5\na176;27A6\na177;27A7\na178;27A8\na179;27A9\na17;2711\na180;27AB\na181;27AD\na182;27AF\na183;27B2\na184;27B3\na185;27B5\na186;27B8\na187;27BA\na188;27BB\na189;27BC\na18;2712\na190;27BD\na191;27BE\na192;279A\na193;27AA\na194;27B6\na195;27B9\na196;2798\na197;27B4\na198;27B7\na199;27AC\na19;2713\na1;2701\na200;27AE\na201;27B1\na202;2703\na203;2750\na204;2752\na205;276E\na206;2770\na20;2714\na21;2715\na22;2716\na23;2717\na24;2718\na25;2719\na26;271A\na27;271B\na28;271C\na29;2722\na2;2702\na30;2723\na31;2724\na32;2725\na33;2726\na34;2727\na35;2605\na36;2729\na37;272A\na38;272B\na39;272C\na3;2704\na40;272D\na41;272E\na42;272F\na43;2730\na44;2731\na45;2732\na46;2733\na47;2734\na48;2735\na49;2736\na4;260E\na50;2737\na51;2738\na52;2739\na53;273A\na54;273B\na55;273C\na56;273D\na57;273E\na58;273F\na59;2740\na5;2706\na60;2741\na61;2742\na62;2743\na63;2744\na64;2745\na65;2746\na66;2747\na67;2748\na68;2749\na69;274A\na6;271D\na70;274B\na71;25CF\na72;274D\na73;25A0\na74;274F\na75;2751\na76;25B2\na77;25BC\na78;25C6\na79;2756\na7;271E\na81;25D7\na82;2758\na83;2759\na84;275A\na85;276F\na86;2771\na87;2772\na88;2773\na89;2768\na8;271F\na90;2769\na91;276C\na92;276D\na93;276A\na94;276B\na95;2774\na96;2775\na97;275B\na98;275C\na99;275D\na9;2720\n\"\"\"\n\n\n# string table management\n#\nclass StringTable:\n  def __init__( self, name_list, master_table_name ):\n    self.names        = name_list\n    self.master_table = master_table_name\n    self.indices      = {}\n    index             = 0\n\n    for name in name_list:\n      self.indices[name] = index\n      index += len( name ) + 1\n\n    self.total = index\n\n  def dump( self, file ):\n    write = file.write\n    write( \"  static const char  \" + self.master_table +\n           \"[\" + repr( self.total ) + \"] =\\n\" )\n    write( \"  {\\n\" )\n\n    line = \"\"\n    for name in self.names:\n      line += \"    '\"\n      line += string.join( ( re.findall( \".\", name ) ), \"','\" )\n      line += \"', 0,\\n\"\n\n    write( line + \"  };\\n\\n\\n\" )\n\n  def dump_sublist( self, file, table_name, macro_name, sublist ):\n    write = file.write\n    write( \"#define \" + macro_name + \"  \" + repr( len( sublist ) ) + \"\\n\\n\" )\n\n    write( \"  /* Values are offsets into the `\" +\n           self.master_table + \"' table */\\n\\n\" )\n    write( \"  static const short  \" + table_name +\n           \"[\" + macro_name + \"] =\\n\" )\n    write( \"  {\\n\" )\n\n    line  = \"    \"\n    comma = \"\"\n    col   = 0\n\n    for name in sublist:\n      line += comma\n      line += \"%4d\" % self.indices[name]\n      col  += 1\n      comma = \",\"\n      if col == 14:\n        col   = 0\n        comma = \",\\n    \"\n\n    write( line + \"\\n  };\\n\\n\\n\" )\n\n\n# We now store the Adobe Glyph List in compressed form.  The list is put\n# into a data structure called `trie' (because it has a tree-like\n# appearance).  Consider, for example, that you want to store the\n# following name mapping:\n#\n#   A        => 1\n#   Aacute   => 6\n#   Abalon   => 2\n#   Abstract => 4\n#\n# It is possible to store the entries as follows.\n#\n#   A => 1\n#   |\n#   +-acute => 6\n#   |\n#   +-b\n#     |\n#     +-alon => 2\n#     |\n#     +-stract => 4\n#\n# We see that each node in the trie has:\n#\n# - one or more `letters'\n# - an optional value\n# - zero or more child nodes\n#\n# The first step is to call\n#\n#   root = StringNode( \"\", 0 )\n#   for word in map.values():\n#     root.add( word, map[word] )\n#\n# which creates a large trie where each node has only one children.\n#\n# Executing\n#\n#   root = root.optimize()\n#\n# optimizes the trie by merging the letters of successive nodes whenever\n# possible.\n#\n# Each node of the trie is stored as follows.\n#\n# - First the node's letter, according to the following scheme.  We\n#   use the fact that in the AGL no name contains character codes > 127.\n#\n#     name         bitsize     description\n#     ----------------------------------------------------------------\n#     notlast            1     Set to 1 if this is not the last letter\n#                              in the word.\n#     ascii              7     The letter's ASCII value.\n#\n# - The letter is followed by a children count and the value of the\n#   current key (if any).  Again we can do some optimization because all\n#   AGL entries are from the BMP; this means that 16 bits are sufficient\n#   to store its Unicode values.  Additionally, no node has more than\n#   127 children.\n#\n#     name         bitsize     description\n#     -----------------------------------------\n#     hasvalue           1     Set to 1 if a 16-bit Unicode value follows.\n#     num_children       7     Number of children.  Can be 0 only if\n#                              `hasvalue' is set to 1.\n#     value             16     Optional Unicode value.\n#\n# - A node is finished by a list of 16bit absolute offsets to the\n#   children, which must be sorted in increasing order of their first\n#   letter.\n#\n# For simplicity, all 16bit quantities are stored in big-endian order.\n#\n# The root node has first letter = 0, and no value.\n#\nclass StringNode:\n  def __init__( self, letter, value ):\n    self.letter   = letter\n    self.value    = value\n    self.children = {}\n\n  def __cmp__( self, other ):\n    return ord( self.letter[0] ) - ord( other.letter[0] )\n\n  def add( self, word, value ):\n    if len( word ) == 0:\n      self.value = value\n      return\n\n    letter = word[0]\n    word   = word[1:]\n\n    if self.children.has_key( letter ):\n      child = self.children[letter]\n    else:\n      child = StringNode( letter, 0 )\n      self.children[letter] = child\n\n    child.add( word, value )\n\n  def optimize( self ):\n    # optimize all children first\n    children      = self.children.values()\n    self.children = {}\n\n    for child in children:\n      self.children[child.letter[0]] = child.optimize()\n\n    # don't optimize if there's a value,\n    # if we don't have any child or if we\n    # have more than one child\n    if ( self.value != 0 ) or ( not children ) or len( children ) > 1:\n      return self\n\n    child = children[0]\n\n    self.letter  += child.letter\n    self.value    = child.value\n    self.children = child.children\n\n    return self\n\n  def dump_debug( self, write, margin ):\n    # this is used during debugging\n    line = margin + \"+-\"\n    if len( self.letter ) == 0:\n      line += \"<NOLETTER>\"\n    else:\n      line += self.letter\n\n    if self.value:\n      line += \" => \" + repr( self.value )\n\n    write( line + \"\\n\" )\n\n    if self.children:\n      margin += \"| \"\n      for child in self.children.values():\n        child.dump_debug( write, margin )\n\n  def locate( self, index ):\n    self.index = index\n    if len( self.letter ) > 0:\n      index += len( self.letter ) + 1\n    else:\n      index += 2\n\n    if self.value != 0:\n      index += 2\n\n    children = self.children.values()\n    children.sort()\n\n    index += 2 * len( children )\n    for child in children:\n      index = child.locate( index )\n\n    return index\n\n  def store( self, storage ):\n    # write the letters\n    l = len( self.letter )\n    if l == 0:\n      storage += struct.pack( \"B\", 0 )\n    else:\n      for n in range( l ):\n        val = ord( self.letter[n] )\n        if n < l - 1:\n          val += 128\n        storage += struct.pack( \"B\", val )\n\n    # write the count\n    children = self.children.values()\n    children.sort()\n\n    count = len( children )\n\n    if self.value != 0:\n      storage += struct.pack( \"!BH\", count + 128, self.value )\n    else:\n      storage += struct.pack( \"B\", count )\n\n    for child in children:\n      storage += struct.pack( \"!H\", child.index )\n\n    for child in children:\n      storage = child.store( storage )\n\n    return storage\n\n\ndef adobe_glyph_values():\n  \"\"\"return the list of glyph names and their unicode values\"\"\"\n\n  lines  = string.split( adobe_glyph_list, '\\n' )\n  glyphs = []\n  values = []\n\n  for line in lines:\n    if line:\n      fields = string.split( line, ';' )\n#     print fields[1] + ' - ' + fields[0]\n      subfields = string.split( fields[1], ' ' )\n      if len( subfields ) == 1:\n        glyphs.append( fields[0] )\n        values.append( fields[1] )\n\n  return glyphs, values\n\n\ndef filter_glyph_names( alist, filter ):\n  \"\"\"filter `alist' by taking _out_ all glyph names that are in `filter'\"\"\"\n\n  count  = 0\n  extras = []\n\n  for name in alist:\n    try:\n      filtered_index = filter.index( name )\n    except:\n      extras.append( name )\n\n  return extras\n\n\ndef dump_encoding( file, encoding_name, encoding_list ):\n  \"\"\"dump a given encoding\"\"\"\n\n  write = file.write\n  write( \"  /* the following are indices into the SID name table */\\n\" )\n  write( \"  static const unsigned short  \" + encoding_name +\n         \"[\" + repr( len( encoding_list ) ) + \"] =\\n\" )\n  write( \"  {\\n\" )\n\n  line  = \"    \"\n  comma = \"\"\n  col   = 0\n  for value in encoding_list:\n    line += comma\n    line += \"%3d\" % value\n    comma = \",\"\n    col  += 1\n    if col == 16:\n      col = 0\n      comma = \",\\n    \"\n\n  write( line + \"\\n  };\\n\\n\\n\" )\n\n\ndef dump_array( the_array, write, array_name ):\n  \"\"\"dumps a given encoding\"\"\"\n\n  write( \"  static const unsigned char  \" + array_name +\n         \"[\" + repr( len( the_array ) ) + \"L] =\\n\" )\n  write( \"  {\\n\" )\n\n  line  = \"\"\n  comma = \"    \"\n  col   = 0\n\n  for value in the_array:\n    line += comma\n    line += \"%3d\" % ord( value )\n    comma = \",\"\n    col  += 1\n\n    if col == 16:\n      col   = 0\n      comma = \",\\n    \"\n\n    if len( line ) > 1024:\n      write( line )\n      line = \"\"\n\n  write( line + \"\\n  };\\n\\n\\n\" )\n\n\ndef main():\n  \"\"\"main program body\"\"\"\n\n  if len( sys.argv ) != 2:\n    print __doc__ % sys.argv[0]\n    sys.exit( 1 )\n\n  file  = open( sys.argv[1], \"w\\n\" )\n  write = file.write\n\n  count_sid = len( sid_standard_names )\n\n  # `mac_extras' contains the list of glyph names in the Macintosh standard\n  # encoding which are not in the SID Standard Names.\n  #\n  mac_extras = filter_glyph_names( mac_standard_names, sid_standard_names )\n\n  # `base_list' contains the names of our final glyph names table.\n  # It consists of the `mac_extras' glyph names, followed by the SID\n  # standard names.\n  #\n  mac_extras_count = len( mac_extras )\n  base_list        = mac_extras + sid_standard_names\n\n  write( \"/***************************************************************************/\\n\" )\n  write( \"/*                                                                         */\\n\" )\n\n  write( \"/*  %-71s*/\\n\" % os.path.basename( sys.argv[1] ) )\n\n  write( \"/*                                                                         */\\n\" )\n  write( \"/*    PostScript glyph names.                                              */\\n\" )\n  write( \"/*                                                                         */\\n\" )\n  write( \"/*  Copyright 2005, 2008, 2011 by                                          */\\n\" )\n  write( \"/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\\n\" )\n  write( \"/*                                                                         */\\n\" )\n  write( \"/*  This file is part of the FreeType project, and may only be used,       */\\n\" )\n  write( \"/*  modified, and distributed under the terms of the FreeType project      */\\n\" )\n  write( \"/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\\n\" )\n  write( \"/*  this file you indicate that you have read the license and              */\\n\" )\n  write( \"/*  understand and accept it fully.                                        */\\n\" )\n  write( \"/*                                                                         */\\n\" )\n  write( \"/***************************************************************************/\\n\" )\n  write( \"\\n\" )\n  write( \"\\n\" )\n  write( \"  /* This file has been generated automatically -- do not edit! */\\n\" )\n  write( \"\\n\" )\n  write( \"\\n\" )\n\n  # dump final glyph list (mac extras + sid standard names)\n  #\n  st = StringTable( base_list, \"ft_standard_glyph_names\" )\n\n  st.dump( file )\n  st.dump_sublist( file, \"ft_mac_names\",\n                   \"FT_NUM_MAC_NAMES\", mac_standard_names )\n  st.dump_sublist( file, \"ft_sid_names\",\n                   \"FT_NUM_SID_NAMES\", sid_standard_names )\n\n  dump_encoding( file, \"t1_standard_encoding\", t1_standard_encoding )\n  dump_encoding( file, \"t1_expert_encoding\", t1_expert_encoding )\n\n  # dump the AGL in its compressed form\n  #\n  agl_glyphs, agl_values = adobe_glyph_values()\n  dict = StringNode( \"\", 0 )\n\n  for g in range( len( agl_glyphs ) ):\n    dict.add( agl_glyphs[g], eval( \"0x\" + agl_values[g] ) )\n\n  dict       = dict.optimize()\n  dict_len   = dict.locate( 0 )\n  dict_array = dict.store( \"\" )\n\n  write( \"\"\"\\\n  /*\n   *  This table is a compressed version of the Adobe Glyph List (AGL),\n   *  optimized for efficient searching.  It has been generated by the\n   *  `glnames.py' python script located in the `src/tools' directory.\n   *\n   *  The lookup function to get the Unicode value for a given string\n   *  is defined below the table.\n   */\n\n#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST\n\n\"\"\" )\n\n  dump_array( dict_array, write, \"ft_adobe_glyph_list\" )\n\n  # write the lookup routine now\n  #\n  write( \"\"\"\\\n  /*\n   *  This function searches the compressed table efficiently.\n   */\n  static unsigned long\n  ft_get_adobe_glyph_index( const char*  name,\n                            const char*  limit )\n  {\n    int                   c = 0;\n    int                   count, min, max;\n    const unsigned char*  p = ft_adobe_glyph_list;\n\n\n    if ( name == 0 || name >= limit )\n      goto NotFound;\n\n    c     = *name++;\n    count = p[1];\n    p    += 2;\n\n    min = 0;\n    max = count;\n\n    while ( min < max )\n    {\n      int                   mid = ( min + max ) >> 1;\n      const unsigned char*  q   = p + mid * 2;\n      int                   c2;\n\n\n      q = ft_adobe_glyph_list + ( ( (int)q[0] << 8 ) | q[1] );\n\n      c2 = q[0] & 127;\n      if ( c2 == c )\n      {\n        p = q;\n        goto Found;\n      }\n      if ( c2 < c )\n        min = mid + 1;\n      else\n        max = mid;\n    }\n    goto NotFound;\n\n  Found:\n    for (;;)\n    {\n      /* assert (*p & 127) == c */\n\n      if ( name >= limit )\n      {\n        if ( (p[0] & 128) == 0 &&\n             (p[1] & 128) != 0 )\n          return (unsigned long)( ( (int)p[2] << 8 ) | p[3] );\n\n        goto NotFound;\n      }\n      c = *name++;\n      if ( p[0] & 128 )\n      {\n        p++;\n        if ( c != (p[0] & 127) )\n          goto NotFound;\n\n        continue;\n      }\n\n      p++;\n      count = p[0] & 127;\n      if ( p[0] & 128 )\n        p += 2;\n\n      p++;\n\n      for ( ; count > 0; count--, p += 2 )\n      {\n        int                   offset = ( (int)p[0] << 8 ) | p[1];\n        const unsigned char*  q      = ft_adobe_glyph_list + offset;\n\n        if ( c == ( q[0] & 127 ) )\n        {\n          p = q;\n          goto NextIter;\n        }\n      }\n      goto NotFound;\n\n    NextIter:\n      ;\n    }\n\n  NotFound:\n    return 0;\n  }\n\n#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */\n\n\"\"\" )\n\n  if 0:  # generate unit test, or don't\n    #\n    # now write the unit test to check that everything works OK\n    #\n    write( \"#ifdef TEST\\n\\n\" )\n\n    write( \"static const char* const  the_names[] = {\\n\" )\n    for name in agl_glyphs:\n      write( '  \"' + name + '\",\\n' )\n    write( \"  0\\n};\\n\" )\n\n    write( \"static const unsigned long  the_values[] = {\\n\" )\n    for val in agl_values:\n      write( '  0x' + val + ',\\n' )\n    write( \"  0\\n};\\n\" )\n\n    write( \"\"\"\n#include <stdlib.h>\n#include <stdio.h>\n\n  int\n  main( void )\n  {\n    int                   result = 0;\n    const char* const*    names  = the_names;\n    const unsigned long*  values = the_values;\n\n\n    for ( ; *names; names++, values++ )\n    {\n      const char*    name      = *names;\n      unsigned long  reference = *values;\n      unsigned long  value;\n\n\n      value = ft_get_adobe_glyph_index( name, name + strlen( name ) );\n      if ( value != reference )\n      {\n        result = 1;\n        fprintf( stderr, \"name '%s' => %04x instead of %04x\\\\n\",\n                         name, value, reference );\n      }\n    }\n\n    return result;\n  }\n\"\"\" )\n\n    write( \"#endif /* TEST */\\n\" )\n\n  write(\"\\n/* END */\\n\")\n\n\n# Now run the main routine\n#\nmain()\n\n\n# END\n"
  },
  {
    "path": "ext/freetype2/src/tools/test_afm.c",
    "content": "/*\n * gcc -DFT2_BUILD_LIBRARY -I../../include -o test_afm test_afm.c \\\n *     -L../../objs/.libs -lfreetype -lz -static\n */\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_POSTSCRIPT_AUX_H\n\n  void dump_fontinfo( AFM_FontInfo  fi )\n  {\n    FT_Int  i;\n\n\n    printf( \"This AFM is for %sCID font.\\n\\n\",\n            ( fi->IsCIDFont ) ? \"\" : \"non-\" );\n\n    printf( \"FontBBox: %.2f %.2f %.2f %.2f\\n\", fi->FontBBox.xMin / 65536.,\n                                               fi->FontBBox.yMin / 65536.,\n                                               fi->FontBBox.xMax / 65536.,\n                                               fi->FontBBox.yMax / 65536. );\n    printf( \"Ascender: %.2f\\n\", fi->Ascender / 65536. );\n    printf( \"Descender: %.2f\\n\\n\", fi->Descender / 65536. );\n\n    if ( fi->NumTrackKern )\n      printf( \"There are %d sets of track kernings:\\n\",\n              fi->NumTrackKern );\n    else\n      printf( \"There is no track kerning.\\n\" );\n\n    for ( i = 0; i < fi->NumTrackKern; i++ )\n    {\n      AFM_TrackKern  tk = fi->TrackKerns + i;\n\n\n      printf( \"\\t%2d: %5.2f %5.2f %5.2f %5.2f\\n\", tk->degree,\n                                                  tk->min_ptsize / 65536.,\n                                                  tk->min_kern / 65536.,\n                                                  tk->max_ptsize / 65536.,\n                                                  tk->max_kern / 65536. );\n    }\n\n    printf( \"\\n\" );\n\n    if ( fi->NumKernPair )\n      printf( \"There are %d kerning pairs:\\n\",\n              fi->NumKernPair );\n    else\n      printf( \"There is no kerning pair.\\n\" );\n\n    for ( i = 0; i < fi->NumKernPair; i++ )\n    {\n      AFM_KernPair  kp = fi->KernPairs + i;\n\n\n      printf( \"\\t%3d + %3d => (%4d, %4d)\\n\", kp->index1,\n                                             kp->index2,\n                                             kp->x,\n                                             kp->y );\n    }\n\n  }\n\n  int\n  dummy_get_index( const char*  name,\n                   FT_Offset    len,\n                   void*        user_data )\n  {\n    if ( len )\n      return name[0];\n    else\n      return 0;\n  }\n\n  FT_Error\n  parse_afm( FT_Library    library,\n             FT_Stream     stream,\n             AFM_FontInfo  fi )\n  {\n    PSAux_Service  psaux;\n    AFM_ParserRec  parser;\n    FT_Error       error = FT_Err_Ok;\n\n\n    psaux = (PSAux_Service)FT_Get_Module_Interface( library, \"psaux\" );\n    if ( !psaux || !psaux->afm_parser_funcs )\n      return -1;\n\n    error = FT_Stream_EnterFrame( stream, stream->size );\n    if ( error )\n      return error;\n\n    error = psaux->afm_parser_funcs->init( &parser,\n                                           library->memory,\n                                           stream->cursor,\n                                           stream->limit );\n    if ( error )\n      return error;\n\n    parser.FontInfo = fi;\n    parser.get_index = dummy_get_index;\n\n    error = psaux->afm_parser_funcs->parse( &parser );\n\n    psaux->afm_parser_funcs->done( &parser );\n\n    return error;\n  }\n\n\n  int main( int    argc,\n            char** argv )\n  {\n    FT_Library       library;\n    FT_StreamRec     stream;\n    FT_Error         error = FT_Err_Ok;\n    AFM_FontInfoRec  fi;\n\n\n    if ( argc < 2 )\n      return FT_ERR( Invalid_Argument );\n\n    error = FT_Init_FreeType( &library );\n    if ( error )\n      return error;\n\n    FT_ZERO( &stream );\n    error = FT_Stream_Open( &stream, argv[1] );\n    if ( error )\n      goto Exit;\n    stream.memory = library->memory;\n\n    FT_ZERO( &fi );\n    error = parse_afm( library, &stream, &fi );\n\n    if ( !error )\n    {\n      FT_Memory  memory = library->memory;\n\n\n      dump_fontinfo( &fi );\n\n      if ( fi.KernPairs )\n        FT_FREE( fi.KernPairs );\n      if ( fi.TrackKerns )\n        FT_FREE( fi.TrackKerns );\n    }\n    else\n      printf( \"parse error\\n\" );\n\n    FT_Stream_Close( &stream );\n\n  Exit:\n    FT_Done_FreeType( library );\n\n    return error;\n  }\n"
  },
  {
    "path": "ext/freetype2/src/tools/test_bbox.c",
    "content": "#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_BBOX_H\n\n\n#include <time.h>    /* for clock() */\n\n/* SunOS 4.1.* does not define CLOCKS_PER_SEC, so include <sys/param.h> */\n/* to get the HZ macro which is the equivalent.                         */\n#if defined(__sun__) && !defined(SVR4) && !defined(__SVR4)\n#include <sys/param.h>\n#define CLOCKS_PER_SEC HZ\n#endif\n\n  static long\n  get_time( void )\n  {\n    return clock() * 10000L / CLOCKS_PER_SEC;\n  }\n\n\n\n\n  /* test bbox computations */\n\n#define  XSCALE    65536\n#define  XX(x)     ((FT_Pos)(x*XSCALE))\n#define  XVEC(x,y)  { XX(x), XX(y) }\n#define  XVAL(x)   ((x)/(1.0*XSCALE))\n\n  /* dummy outline #1 */\n  static FT_Vector  dummy_vec_1[4] =\n  {\n#if 1\n    XVEC( 408.9111, 535.3164 ),\n    XVEC( 455.8887, 634.396  ),\n    XVEC( -37.8765, 786.2207 ),\n    XVEC( 164.6074, 535.3164 )\n#else\n    { (FT_Int32)0x0198E93DL , (FT_Int32)0x021750FFL },  /* 408.9111, 535.3164 */\n    { (FT_Int32)0x01C7E312L , (FT_Int32)0x027A6560L },  /* 455.8887, 634.3960 */\n    { (FT_Int32)0xFFDA1F9EL , (FT_Int32)0x0312387FL },  /* -37.8765, 786.2207 */\n    { (FT_Int32)0x00A49B7EL , (FT_Int32)0x021750FFL }   /* 164.6074, 535.3164 */\n#endif\n   };\n\n  static char  dummy_tag_1[4] =\n  {\n    FT_CURVE_TAG_ON,\n    FT_CURVE_TAG_CUBIC,\n    FT_CURVE_TAG_CUBIC,\n    FT_CURVE_TAG_ON\n  };\n\n  static short  dummy_contour_1[1] =\n  {\n    3\n  };\n\n  static FT_Outline  dummy_outline_1 =\n  {\n    1,\n    4,\n    dummy_vec_1,\n    dummy_tag_1,\n    dummy_contour_1,\n    0\n  };\n\n\n  /* dummy outline #2 */\n  static FT_Vector  dummy_vec_2[4] =\n  {\n    XVEC( 100.0, 100.0 ),\n    XVEC( 100.0, 200.0 ),\n    XVEC( 200.0, 200.0 ),\n    XVEC( 200.0, 133.0 )\n  };\n\n  static FT_Outline  dummy_outline_2 =\n  {\n    1,\n    4,\n    dummy_vec_2,\n    dummy_tag_1,\n    dummy_contour_1,\n    0\n  };\n\n\n  /* dummy outline #3 with bbox of [0 100 128 128] precisely */\n  static FT_Vector  dummy_vec_3[4] =\n  {\n    XVEC( 100.0, 127.0 ),\n    XVEC( 200.0, 127.0 ),\n    XVEC(   0.0, 136.0 ),\n    XVEC(   0.0, 100.0 )\n  };\n\n  static FT_Outline  dummy_outline_3 =\n  {\n    1,\n    4,\n    dummy_vec_3,\n    dummy_tag_1,\n    dummy_contour_1,\n    0\n  };\n\n\n  static void\n  dump_outline( FT_Outline*  outline )\n  {\n    FT_BBox  bbox;\n\n    /* compute and display cbox */\n    FT_Outline_Get_CBox( outline, &bbox );\n    printf( \"cbox = [%.2f %.2f %.2f %.2f]\\n\",\n             XVAL( bbox.xMin ),\n             XVAL( bbox.yMin ),\n             XVAL( bbox.xMax ),\n             XVAL( bbox.yMax ) );\n\n    /* compute and display bbox */\n    FT_Outline_Get_BBox( outline, &bbox );\n    printf( \"bbox = [%.2f %.2f %.2f %.2f]\\n\",\n             XVAL( bbox.xMin ),\n             XVAL( bbox.yMin ),\n             XVAL( bbox.xMax ),\n             XVAL( bbox.yMax ) );\n  }\n\n\n\n  static void\n  profile_outline( FT_Outline*   outline,\n                   long          repeat )\n  {\n    FT_BBox  bbox;\n    long     count;\n    long     time0;\n\n    time0 = get_time();\n    for ( count = repeat; count > 0; count-- )\n      FT_Outline_Get_CBox( outline, &bbox );\n\n    time0 = get_time() - time0;\n    printf( \"time = %6.3f cbox = [%8.4f %8.4f %8.4f %8.4f]\\n\",\n             ((double)time0/10000.0),\n             XVAL( bbox.xMin ),\n             XVAL( bbox.yMin ),\n             XVAL( bbox.xMax ),\n             XVAL( bbox.yMax ) );\n    printf( \"cbox_hex = [%08X %08X %08X %08X]\\n\",\n             bbox.xMin, bbox.yMin, bbox.xMax, bbox.yMax );\n\n\n    time0 = get_time();\n    for ( count = repeat; count > 0; count-- )\n      FT_Outline_Get_BBox( outline, &bbox );\n\n    time0 = get_time() - time0;\n    printf( \"time = %6.3f bbox = [%8.4f %8.4f %8.4f %8.4f]\\n\",\n             ((double)time0/10000.0),\n             XVAL( bbox.xMin ),\n             XVAL( bbox.yMin ),\n             XVAL( bbox.xMax ),\n             XVAL( bbox.yMax ) );\n    printf( \"bbox_hex = [%08X %08X %08X %08X]\\n\",\n             bbox.xMin, bbox.yMin, bbox.xMax, bbox.yMax );\n  }\n\n#define REPEAT  1000000L\n\n  int  main( int  argc, char**  argv )\n  {\n    printf( \"outline #1\\n\" );\n    profile_outline( &dummy_outline_1, REPEAT );\n\n    printf( \"outline #2\\n\" );\n    profile_outline( &dummy_outline_2, REPEAT );\n\n    printf( \"outline #3\\n\" );\n    profile_outline( &dummy_outline_3, REPEAT );\n\n    return 0;\n  }\n\n"
  },
  {
    "path": "ext/freetype2/src/tools/test_trig.c",
    "content": "#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_TRIGONOMETRY_H\n\n#include <math.h>\n#include <stdio.h>\n\n#define  PI   3.14159265358979323846\n#define  SPI  (PI/FT_ANGLE_PI)\n\n/* the precision in 16.16 fixed-point checks. Expect between 2 and 5 */\n/* noise LSB bits during operations, due to rounding errors..        */\n#define  THRESHOLD  64\n\n  static  error = 0;\n\n  static void\n  test_cos( void )\n  {\n    int  i;\n\n\n    for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000L )\n    {\n      FT_Fixed  f1, f2;\n      double    d2;\n\n\n      f1 = FT_Cos(i);\n      d2 = cos( i*SPI );\n      f2 = (FT_Fixed)(d2*65536.0);\n\n      if ( abs( f2-f1 ) > THRESHOLD )\n      {\n        error = 1;\n        printf( \"FT_Cos[%3d] = %.7f  cos[%3d] = %.7f\\n\",\n                (i >> 16), f1/65536.0, (i >> 16), d2 );\n      }\n    }\n  }\n\n\n  static void\n  test_sin( void )\n  {\n    int  i;\n\n\n    for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000L )\n    {\n      FT_Fixed  f1, f2;\n      double    d2;\n\n\n      f1 = FT_Sin(i);\n      d2 = sin( i*SPI );\n      f2 = (FT_Fixed)(d2*65536.0);\n\n      if ( abs( f2-f1 ) > THRESHOLD )\n      {\n        error = 1;\n        printf( \"FT_Sin[%3d] = %.7f  sin[%3d] = %.7f\\n\",\n                (i >> 16), f1/65536.0, (i >> 16), d2 );\n      }\n    }\n  }\n\n\n  static void\n  test_tan( void )\n  {\n    int  i;\n\n\n    for ( i = 0; i < FT_ANGLE_PI2 - 0x2000000L; i += 0x10000L )\n    {\n      FT_Fixed  f1, f2;\n      double    d2;\n\n\n      f1 = FT_Tan(i);\n      d2 = tan( i*SPI );\n      f2 = (FT_Fixed)(d2*65536.0);\n\n      if ( abs( f2-f1 ) > THRESHOLD )\n      {\n        error = 1;\n        printf( \"FT_Tan[%3d] = %.7f  tan[%3d] = %.7f\\n\",\n                (i >> 16), f1/65536.0, (i >> 16), d2 );\n      }\n    }\n  }\n\n\n  static void\n  test_atan2( void )\n  {\n    int  i;\n\n\n    for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000L )\n    {\n      FT_Fixed  c2, s2;\n      double    l, a, c1, s1;\n      int       j;\n\n\n      l  = 5.0;\n      a  = i*SPI;\n\n      c1 = l * cos(a);\n      s1 = l * sin(a);\n\n      c2 = (FT_Fixed)(c1*65536.0);\n      s2 = (FT_Fixed)(s1*65536.0);\n\n      j  = FT_Atan2( c2, s2 );\n      if ( j < 0 )\n        j += FT_ANGLE_2PI;\n\n      if ( abs( i - j ) > 1 )\n      {\n        printf( \"FT_Atan2( %.7f, %.7f ) = %.5f, atan = %.5f\\n\",\n                c2/65536.0, s2/65536.0, j/65536.0, i/65536.0 );\n      }\n    }\n  }\n\n\n  static void\n  test_unit( void )\n  {\n    int  i;\n\n\n    for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000L )\n    {\n      FT_Vector  v;\n      double     a, c1, s1;\n      FT_Fixed   c2, s2;\n\n\n      FT_Vector_Unit( &v, i );\n      a  = ( i*SPI );\n      c1 = cos(a);\n      s1 = sin(a);\n      c2 = (FT_Fixed)(c1*65536.0);\n      s2 = (FT_Fixed)(s1*65536.0);\n\n      if ( abs( v.x-c2 ) > THRESHOLD ||\n           abs( v.y-s2 ) > THRESHOLD )\n      {\n        error = 1;\n        printf( \"FT_Vector_Unit[%3d] = ( %.7f, %.7f )  vec = ( %.7f, %.7f )\\n\",\n                (i >> 16),\n                v.x/65536.0, v.y/65536.0,\n                c1, s1 );\n      }\n    }\n  }\n\n\n  static void\n  test_length( void )\n  {\n    int  i;\n\n\n    for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000L )\n    {\n      FT_Vector  v;\n      FT_Fixed   l, l2;\n\n\n      l   = (FT_Fixed)(500.0*65536.0);\n      v.x = (FT_Fixed)( l * cos( i*SPI ) );\n      v.y = (FT_Fixed)( l * sin( i*SPI ) );\n      l2  = FT_Vector_Length( &v );\n\n      if ( abs( l2-l ) > THRESHOLD )\n      {\n        error = 1;\n        printf( \"FT_Length( %.7f, %.7f ) = %.5f, length = %.5f\\n\",\n                v.x/65536.0, v.y/65536.0, l2/65536.0, l/65536.0 );\n      }\n    }\n  }\n\n\n  static void\n  test_rotate( void )\n  {\n    int  rotate;\n\n\n    for ( rotate = 0; rotate < FT_ANGLE_2PI; rotate += 0x10000L )\n    {\n      double  ra, cra, sra;\n      int     i;\n\n\n      ra  = rotate*SPI;\n      cra = cos( ra );\n      sra = sin( ra );\n\n      for ( i = 0; i < FT_ANGLE_2PI; i += 0x10000L )\n      {\n        FT_Fixed   c2, s2, c4, s4;\n        FT_Vector  v;\n        double     l, a, c1, s1, c3, s3;\n\n\n        l  = 500.0;\n        a  = i*SPI;\n\n        c1 = l * cos(a);\n        s1 = l * sin(a);\n\n        v.x = c2 = (FT_Fixed)(c1*65536.0);\n        v.y = s2 = (FT_Fixed)(s1*65536.0);\n\n        FT_Vector_Rotate( &v, rotate );\n\n        c3 = c1 * cra - s1 * sra;\n        s3 = c1 * sra + s1 * cra;\n\n        c4 = (FT_Fixed)(c3*65536.0);\n        s4 = (FT_Fixed)(s3*65536.0);\n\n        if ( abs( c4 - v.x ) > THRESHOLD ||\n             abs( s4 - v.y ) > THRESHOLD )\n        {\n          error = 1;\n          printf( \"FT_Rotate( (%.7f,%.7f), %.5f ) = ( %.7f, %.7f ), rot = ( %.7f, %.7f )\\n\",\n                  c1, s1, ra,\n                  c2/65536.0, s2/65536.0,\n                  c4/65536.0, s4/65536.0 );\n        }\n      }\n    }\n  }\n\n\n  int main( void )\n  {\n    test_cos();\n    test_sin();\n    test_tan();\n    test_atan2();\n    test_unit();\n    test_length();\n    test_rotate();\n\n    if (!error)\n      printf( \"trigonometry test ok !\\n\" );\n\n    return !error;\n  }\n"
  },
  {
    "path": "ext/freetype2/src/truetype/Jamfile",
    "content": "# FreeType 2 src/truetype Jamfile\n#\n# Copyright 2001, 2004 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) truetype ;\n\n{\n  local  _sources ;\n\n  if $(FT2_MULTI)\n  {\n    _sources = ttdriver ttobjs ttpload ttgload ttinterp ttgxvar ttpic ;\n  }\n  else\n  {\n    _sources = truetype ;\n  }\n\n  Library  $(FT2_LIB) : $(_sources).c ;\n}\n\n# end of src/truetype Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/truetype/module.mk",
    "content": "#\n# FreeType 2 TrueType module definition\n#\n\n\n# Copyright 1996-2000, 2006 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\nFTMODULE_H_COMMANDS += TRUETYPE_DRIVER\n\ndefine TRUETYPE_DRIVER\n$(OPEN_DRIVER) FT_Driver_ClassRec, tt_driver_class $(CLOSE_DRIVER)\n$(ECHO_DRIVER)truetype  $(ECHO_DRIVER_DESC)Windows/Mac font files with extension *.ttf or *.ttc$(ECHO_DRIVER_DONE)\nendef\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/truetype/rules.mk",
    "content": "#\n# FreeType 2 TrueType driver configuration rules\n#\n\n\n# Copyright 1996-2001, 2003-2004, 2011-2012 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\n# TrueType driver directory\n#\nTT_DIR := $(SRC_DIR)/truetype\n\n\n# compilation flags for the driver\n#\nTT_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(TT_DIR))\n\n\n# TrueType driver sources (i.e., C files)\n#\nTT_DRV_SRC := $(TT_DIR)/ttdriver.c \\\n              $(TT_DIR)/ttgload.c  \\\n              $(TT_DIR)/ttgxvar.c  \\\n              $(TT_DIR)/ttinterp.c \\\n              $(TT_DIR)/ttobjs.c   \\\n              $(TT_DIR)/ttpic.c    \\\n              $(TT_DIR)/ttpload.c  \\\n              $(TT_DIR)/ttsubpix.c\n\n# TrueType driver headers\n#\nTT_DRV_H := $(TT_DRV_SRC:%.c=%.h) \\\n            $(TT_DIR)/tterrors.h\n\n\n# TrueType driver object(s)\n#\n#   TT_DRV_OBJ_M is used during `multi' builds\n#   TT_DRV_OBJ_S is used during `single' builds\n#\nTT_DRV_OBJ_M := $(TT_DRV_SRC:$(TT_DIR)/%.c=$(OBJ_DIR)/%.$O)\nTT_DRV_OBJ_S := $(OBJ_DIR)/truetype.$O\n\n# TrueType driver source file for single build\n#\nTT_DRV_SRC_S := $(TT_DIR)/truetype.c\n\n\n# TrueType driver - single object\n#\n$(TT_DRV_OBJ_S): $(TT_DRV_SRC_S) $(TT_DRV_SRC) $(FREETYPE_H) $(TT_DRV_H)\n\t$(TT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(TT_DRV_SRC_S))\n\n\n# driver - multiple objects\n#\n$(OBJ_DIR)/%.$O: $(TT_DIR)/%.c $(FREETYPE_H) $(TT_DRV_H)\n\t$(TT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\n\n\n# update main driver object lists\n#\nDRV_OBJS_S += $(TT_DRV_OBJ_S)\nDRV_OBJS_M += $(TT_DRV_OBJ_M)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/truetype/truetype.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  truetype.c                                                             */\n/*                                                                         */\n/*    FreeType TrueType driver component (body only).                      */\n/*                                                                         */\n/*  Copyright 1996-2001, 2004, 2006, 2012 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#define FT_MAKE_OPTION_SINGLE_OBJECT\n\n#include <ft2build.h>\n#include \"ttpic.c\"\n#include \"ttdriver.c\"   /* driver interface    */\n#include \"ttpload.c\"    /* tables loader       */\n#include \"ttgload.c\"    /* glyph loader        */\n#include \"ttobjs.c\"     /* object manager      */\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n#include \"ttinterp.c\"\n#include \"ttsubpix.c\"\n#endif\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n#include \"ttgxvar.c\"    /* gx distortable font */\n#endif\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/truetype/ttdriver.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttdriver.c                                                             */\n/*                                                                         */\n/*    TrueType font driver implementation (body).                          */\n/*                                                                         */\n/*  Copyright 1996-2014 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_SFNT_H\n#include FT_SERVICE_XFREE86_NAME_H\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n#include FT_MULTIPLE_MASTERS_H\n#include FT_SERVICE_MULTIPLE_MASTERS_H\n#endif\n\n#include FT_SERVICE_TRUETYPE_ENGINE_H\n#include FT_SERVICE_TRUETYPE_GLYF_H\n#include FT_SERVICE_PROPERTIES_H\n#include FT_TRUETYPE_DRIVER_H\n\n#include \"ttdriver.h\"\n#include \"ttgload.h\"\n#include \"ttpload.h\"\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n#include \"ttgxvar.h\"\n#endif\n\n#include \"tterrors.h\"\n\n#include \"ttpic.h\"\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_ttdriver\n\n\n  /*\n   *  PROPERTY SERVICE\n   *\n   */\n  static FT_Error\n  tt_property_set( FT_Module    module,         /* TT_Driver */\n                   const char*  property_name,\n                   const void*  value )\n  {\n    FT_Error   error  = FT_Err_Ok;\n    TT_Driver  driver = (TT_Driver)module;\n\n\n    if ( !ft_strcmp( property_name, \"interpreter-version\" ) )\n    {\n      FT_UInt*  interpreter_version = (FT_UInt*)value;\n\n\n#ifndef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n      if ( *interpreter_version != TT_INTERPRETER_VERSION_35 )\n        error = FT_ERR( Unimplemented_Feature );\n      else\n#endif\n        driver->interpreter_version = *interpreter_version;\n\n      return error;\n    }\n\n    FT_TRACE0(( \"tt_property_set: missing property `%s'\\n\",\n                property_name ));\n    return FT_THROW( Missing_Property );\n  }\n\n\n  static FT_Error\n  tt_property_get( FT_Module    module,         /* TT_Driver */\n                   const char*  property_name,\n                   const void*  value )\n  {\n    FT_Error   error  = FT_Err_Ok;\n    TT_Driver  driver = (TT_Driver)module;\n\n    FT_UInt  interpreter_version = driver->interpreter_version;\n\n\n    if ( !ft_strcmp( property_name, \"interpreter-version\" ) )\n    {\n      FT_UInt*  val = (FT_UInt*)value;\n\n\n      *val = interpreter_version;\n\n      return error;\n    }\n\n    FT_TRACE0(( \"tt_property_get: missing property `%s'\\n\",\n                property_name ));\n    return FT_THROW( Missing_Property );\n  }\n\n\n  FT_DEFINE_SERVICE_PROPERTIESREC(\n    tt_service_properties,\n    (FT_Properties_SetFunc)tt_property_set,\n    (FT_Properties_GetFunc)tt_property_get )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                          F A C E S                              ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n#undef  PAIR_TAG\n#define PAIR_TAG( left, right )  ( ( (FT_ULong)left << 16 ) | \\\n                                     (FT_ULong)right        )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_get_kerning                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A driver method used to return the kerning vector between two      */\n  /*    glyphs of the same face.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to the source face object.                 */\n  /*                                                                       */\n  /*    left_glyph  :: The index of the left glyph in the kern pair.       */\n  /*                                                                       */\n  /*    right_glyph :: The index of the right glyph in the kern pair.      */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    kerning     :: The kerning vector.  This is in font units for      */\n  /*                   scalable formats, and in pixels for fixed-sizes     */\n  /*                   formats.                                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Only horizontal layouts (left-to-right & right-to-left) are        */\n  /*    supported by this function.  Other layouts, or more sophisticated  */\n  /*    kernings, are out of scope of this method (the basic driver        */\n  /*    interface is meant to be simple).                                  */\n  /*                                                                       */\n  /*    They can be implemented by format-specific interfaces.             */\n  /*                                                                       */\n  static FT_Error\n  tt_get_kerning( FT_Face     ttface,          /* TT_Face */\n                  FT_UInt     left_glyph,\n                  FT_UInt     right_glyph,\n                  FT_Vector*  kerning )\n  {\n    TT_Face       face = (TT_Face)ttface;\n    SFNT_Service  sfnt = (SFNT_Service)face->sfnt;\n\n\n    kerning->x = 0;\n    kerning->y = 0;\n\n    if ( sfnt )\n      kerning->x = sfnt->get_kerning( face, left_glyph, right_glyph );\n\n    return 0;\n  }\n\n\n#undef PAIR_TAG\n\n\n  static FT_Error\n  tt_get_advances( FT_Face    ttface,\n                   FT_UInt    start,\n                   FT_UInt    count,\n                   FT_Int32   flags,\n                   FT_Fixed  *advances )\n  {\n    FT_UInt  nn;\n    TT_Face  face  = (TT_Face) ttface;\n\n\n    /* XXX: TODO: check for sbits */\n\n    if ( flags & FT_LOAD_VERTICAL_LAYOUT )\n    {\n      for ( nn = 0; nn < count; nn++ )\n      {\n        FT_Short   tsb;\n        FT_UShort  ah;\n\n\n        /* since we don't need `tsb', we use zero for `yMax' parameter */\n        TT_Get_VMetrics( face, start + nn, 0, &tsb, &ah );\n        advances[nn] = ah;\n      }\n    }\n    else\n    {\n      for ( nn = 0; nn < count; nn++ )\n      {\n        FT_Short   lsb;\n        FT_UShort  aw;\n\n\n        TT_Get_HMetrics( face, start + nn, &lsb, &aw );\n        advances[nn] = aw;\n      }\n    }\n\n    return FT_Err_Ok;\n  }\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                           S I Z E S                             ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n\n  static FT_Error\n  tt_size_select( FT_Size   size,\n                  FT_ULong  strike_index )\n  {\n    TT_Face   ttface = (TT_Face)size->face;\n    TT_Size   ttsize = (TT_Size)size;\n    FT_Error  error  = FT_Err_Ok;\n\n\n    ttsize->strike_index = strike_index;\n\n    if ( FT_IS_SCALABLE( size->face ) )\n    {\n      /* use the scaled metrics, even when tt_size_reset fails */\n      FT_Select_Metrics( size->face, strike_index );\n\n      tt_size_reset( ttsize ); /* ignore return value */\n    }\n    else\n    {\n      SFNT_Service      sfnt    = (SFNT_Service) ttface->sfnt;\n      FT_Size_Metrics*  metrics = &size->metrics;\n\n\n      error = sfnt->load_strike_metrics( ttface, strike_index, metrics );\n      if ( error )\n        ttsize->strike_index = 0xFFFFFFFFUL;\n    }\n\n    return error;\n  }\n\n#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */\n\n\n  static FT_Error\n  tt_size_request( FT_Size          size,\n                   FT_Size_Request  req )\n  {\n    TT_Size   ttsize = (TT_Size)size;\n    FT_Error  error  = FT_Err_Ok;\n\n\n#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n\n    if ( FT_HAS_FIXED_SIZES( size->face ) )\n    {\n      TT_Face       ttface = (TT_Face)size->face;\n      SFNT_Service  sfnt   = (SFNT_Service) ttface->sfnt;\n      FT_ULong      strike_index;\n\n\n      error = sfnt->set_sbit_strike( ttface, req, &strike_index );\n\n      if ( error )\n        ttsize->strike_index = 0xFFFFFFFFUL;\n      else\n        return tt_size_select( size, strike_index );\n    }\n\n#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */\n\n    FT_Request_Metrics( size->face, req );\n\n    if ( FT_IS_SCALABLE( size->face ) )\n    {\n      error = tt_size_reset( ttsize );\n      ttsize->root.metrics = ttsize->metrics;\n    }\n\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_glyph_load                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A driver method used to load a glyph within a given glyph slot.    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    slot        :: A handle to the target slot object where the glyph  */\n  /*                   will be loaded.                                     */\n  /*                                                                       */\n  /*    size        :: A handle to the source face size at which the glyph */\n  /*                   must be scaled, loaded, etc.                        */\n  /*                                                                       */\n  /*    glyph_index :: The index of the glyph in the font file.            */\n  /*                                                                       */\n  /*    load_flags  :: A flag indicating what to load for this glyph.  The */\n  /*                   FT_LOAD_XXX constants can be used to control the    */\n  /*                   glyph loading process (e.g., whether the outline    */\n  /*                   should be scaled, whether to load bitmaps or not,   */\n  /*                   whether to hint the outline, etc).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  static FT_Error\n  tt_glyph_load( FT_GlyphSlot  ttslot,      /* TT_GlyphSlot */\n                 FT_Size       ttsize,      /* TT_Size      */\n                 FT_UInt       glyph_index,\n                 FT_Int32      load_flags )\n  {\n    TT_GlyphSlot  slot = (TT_GlyphSlot)ttslot;\n    TT_Size       size = (TT_Size)ttsize;\n    FT_Face       face = ttslot->face;\n    FT_Error      error;\n\n\n    if ( !slot )\n      return FT_THROW( Invalid_Slot_Handle );\n\n    if ( !size )\n      return FT_THROW( Invalid_Size_Handle );\n\n    if ( !face )\n      return FT_THROW( Invalid_Face_Handle );\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n    if ( glyph_index >= (FT_UInt)face->num_glyphs &&\n         !face->internal->incremental_interface   )\n#else\n    if ( glyph_index >= (FT_UInt)face->num_glyphs )\n#endif\n      return FT_THROW( Invalid_Argument );\n\n    if ( load_flags & FT_LOAD_NO_HINTING )\n    {\n      /* both FT_LOAD_NO_HINTING and FT_LOAD_NO_AUTOHINT   */\n      /* are necessary to disable hinting for tricky fonts */\n\n      if ( FT_IS_TRICKY( face ) )\n        load_flags &= ~FT_LOAD_NO_HINTING;\n\n      if ( load_flags & FT_LOAD_NO_AUTOHINT )\n        load_flags |= FT_LOAD_NO_HINTING;\n    }\n\n    if ( load_flags & ( FT_LOAD_NO_RECURSE | FT_LOAD_NO_SCALE ) )\n    {\n      load_flags |= FT_LOAD_NO_BITMAP | FT_LOAD_NO_SCALE;\n\n      if ( !FT_IS_TRICKY( face ) )\n        load_flags |= FT_LOAD_NO_HINTING;\n    }\n\n    /* now load the glyph outline if necessary */\n    error = TT_Load_Glyph( size, slot, glyph_index, load_flags );\n\n    /* force drop-out mode to 2 - irrelevant now */\n    /* slot->outline.dropout_mode = 2; */\n\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /****                D R I V E R  I N T E R F A C E                   ****/\n  /****                                                                 ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n  FT_DEFINE_SERVICE_MULTIMASTERSREC(\n    tt_service_gx_multi_masters,\n    (FT_Get_MM_Func)        NULL,\n    (FT_Set_MM_Design_Func) NULL,\n    (FT_Set_MM_Blend_Func)  TT_Set_MM_Blend,\n    (FT_Get_MM_Var_Func)    TT_Get_MM_Var,\n    (FT_Set_Var_Design_Func)TT_Set_Var_Design )\n#endif\n\n  static const FT_Service_TrueTypeEngineRec  tt_service_truetype_engine =\n  {\n#ifdef TT_USE_BYTECODE_INTERPRETER\n\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n    FT_TRUETYPE_ENGINE_TYPE_UNPATENTED\n#else\n    FT_TRUETYPE_ENGINE_TYPE_PATENTED\n#endif\n\n#else /* !TT_USE_BYTECODE_INTERPRETER */\n\n    FT_TRUETYPE_ENGINE_TYPE_NONE\n\n#endif /* TT_USE_BYTECODE_INTERPRETER */\n  };\n\n  FT_DEFINE_SERVICE_TTGLYFREC(\n    tt_service_truetype_glyf,\n    (TT_Glyf_GetLocationFunc)tt_face_get_location )\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n  FT_DEFINE_SERVICEDESCREC5(\n    tt_services,\n    FT_SERVICE_ID_XF86_NAME,       FT_XF86_FORMAT_TRUETYPE,\n    FT_SERVICE_ID_MULTI_MASTERS,   &TT_SERVICE_GX_MULTI_MASTERS_GET,\n    FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine,\n    FT_SERVICE_ID_TT_GLYF,         &TT_SERVICE_TRUETYPE_GLYF_GET,\n    FT_SERVICE_ID_PROPERTIES,      &TT_SERVICE_PROPERTIES_GET )\n#else\n  FT_DEFINE_SERVICEDESCREC4(\n    tt_services,\n    FT_SERVICE_ID_XF86_NAME,       FT_XF86_FORMAT_TRUETYPE,\n    FT_SERVICE_ID_TRUETYPE_ENGINE, &tt_service_truetype_engine,\n    FT_SERVICE_ID_TT_GLYF,         &TT_SERVICE_TRUETYPE_GLYF_GET,\n    FT_SERVICE_ID_PROPERTIES,      &TT_SERVICE_PROPERTIES_GET )\n#endif\n\n\n  FT_CALLBACK_DEF( FT_Module_Interface )\n  tt_get_interface( FT_Module    driver,    /* TT_Driver */\n                    const char*  tt_interface )\n  {\n    FT_Library           library;\n    FT_Module_Interface  result;\n    FT_Module            sfntd;\n    SFNT_Service         sfnt;\n\n\n    /* TT_SERVICES_GET dereferences `library' in PIC mode */\n#ifdef FT_CONFIG_OPTION_PIC\n    if ( !driver )\n      return NULL;\n    library = driver->library;\n    if ( !library )\n      return NULL;\n#endif\n\n    result = ft_service_list_lookup( TT_SERVICES_GET, tt_interface );\n    if ( result != NULL )\n      return result;\n\n#ifndef FT_CONFIG_OPTION_PIC\n    if ( !driver )\n      return NULL;\n    library = driver->library;\n    if ( !library )\n      return NULL;\n#endif\n\n    /* only return the default interface from the SFNT module */\n    sfntd = FT_Get_Module( library, \"sfnt\" );\n    if ( sfntd )\n    {\n      sfnt = (SFNT_Service)( sfntd->clazz->module_interface );\n      if ( sfnt )\n        return sfnt->get_interface( driver, tt_interface );\n    }\n\n    return 0;\n  }\n\n\n  /* The FT_DriverInterface structure is defined in ftdriver.h. */\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n#define TT_HINTER_FLAG  FT_MODULE_DRIVER_HAS_HINTER\n#else\n#define TT_HINTER_FLAG  0\n#endif\n\n#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n#define TT_SIZE_SELECT  tt_size_select\n#else\n#define TT_SIZE_SELECT  0\n#endif\n\n  FT_DEFINE_DRIVER(\n    tt_driver_class,\n\n      FT_MODULE_FONT_DRIVER     |\n      FT_MODULE_DRIVER_SCALABLE |\n      TT_HINTER_FLAG,\n\n      sizeof ( TT_DriverRec ),\n\n      \"truetype\",      /* driver name                           */\n      0x10000L,        /* driver version == 1.0                 */\n      0x20000L,        /* driver requires FreeType 2.0 or above */\n\n      (void*)0,        /* driver specific interface */\n\n      tt_driver_init,\n      tt_driver_done,\n      tt_get_interface,\n\n    sizeof ( TT_FaceRec ),\n    sizeof ( TT_SizeRec ),\n    sizeof ( FT_GlyphSlotRec ),\n\n    tt_face_init,\n    tt_face_done,\n    tt_size_init,\n    tt_size_done,\n    tt_slot_init,\n    0,                       /* FT_Slot_DoneFunc */\n\n    tt_glyph_load,\n\n    tt_get_kerning,\n    0,                       /* FT_Face_AttachFunc */\n    tt_get_advances,\n\n    tt_size_request,\n    TT_SIZE_SELECT\n  )\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/truetype/ttdriver.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttdriver.h                                                             */\n/*                                                                         */\n/*    High-level TrueType driver interface (specification).                */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTDRIVER_H__\n#define __TTDRIVER_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DRIVER_H\n\n\nFT_BEGIN_HEADER\n\n\n  FT_DECLARE_DRIVER( tt_driver_class )\n\n\nFT_END_HEADER\n\n#endif /* __TTDRIVER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/truetype/tterrors.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  tterrors.h                                                             */\n/*                                                                         */\n/*    TrueType error codes (specification only).                           */\n/*                                                                         */\n/*  Copyright 2001, 2012 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the TrueType error enumeration            */\n  /* constants.                                                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __TTERRORS_H__\n#define __TTERRORS_H__\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  TT_Err_\n#define FT_ERR_BASE    FT_Mod_Err_TrueType\n\n#include FT_ERRORS_H\n\n#endif /* __TTERRORS_H__ */\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/truetype/ttgload.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttgload.c                                                              */\n/*                                                                         */\n/*    TrueType Glyph Loader (body).                                        */\n/*                                                                         */\n/*  Copyright 1996-2014                                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_CALC_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_SFNT_H\n#include FT_TRUETYPE_TAGS_H\n#include FT_OUTLINE_H\n#include FT_TRUETYPE_DRIVER_H\n\n#include \"ttgload.h\"\n#include \"ttpload.h\"\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n#include \"ttgxvar.h\"\n#endif\n\n#include \"tterrors.h\"\n#include \"ttsubpix.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_ttgload\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Composite glyph flags.                                                */\n  /*                                                                       */\n#define ARGS_ARE_WORDS             0x0001\n#define ARGS_ARE_XY_VALUES         0x0002\n#define ROUND_XY_TO_GRID           0x0004\n#define WE_HAVE_A_SCALE            0x0008\n/* reserved                        0x0010 */\n#define MORE_COMPONENTS            0x0020\n#define WE_HAVE_AN_XY_SCALE        0x0040\n#define WE_HAVE_A_2X2              0x0080\n#define WE_HAVE_INSTR              0x0100\n#define USE_MY_METRICS             0x0200\n#define OVERLAP_COMPOUND           0x0400\n#define SCALED_COMPONENT_OFFSET    0x0800\n#define UNSCALED_COMPONENT_OFFSET  0x1000\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Return the horizontal metrics in font units for a given glyph.        */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  TT_Get_HMetrics( TT_Face     face,\n                   FT_UInt     idx,\n                   FT_Short*   lsb,\n                   FT_UShort*  aw )\n  {\n    ( (SFNT_Service)face->sfnt )->get_metrics( face, 0, idx, lsb, aw );\n\n    FT_TRACE5(( \"  advance width (font units): %d\\n\", *aw ));\n    FT_TRACE5(( \"  left side bearing (font units): %d\\n\", *lsb ));\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Return the vertical metrics in font units for a given glyph.          */\n  /* See macro `TT_LOADER_SET_PP' below for explanations.                  */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  TT_Get_VMetrics( TT_Face     face,\n                   FT_UInt     idx,\n                   FT_Pos      yMax,\n                   FT_Short*   tsb,\n                   FT_UShort*  ah )\n  {\n    if ( face->vertical_info )\n      ( (SFNT_Service)face->sfnt )->get_metrics( face, 1, idx, tsb, ah );\n\n    else if ( face->os2.version != 0xFFFFU )\n    {\n      *tsb = (FT_Short)( face->os2.sTypoAscender - yMax );\n      *ah  = face->os2.sTypoAscender - face->os2.sTypoDescender;\n    }\n\n    else\n    {\n      *tsb = (FT_Short)( face->horizontal.Ascender - yMax );\n      *ah  = face->horizontal.Ascender - face->horizontal.Descender;\n    }\n\n    FT_TRACE5(( \"  advance height (font units): %d\\n\", *ah ));\n    FT_TRACE5(( \"  top side bearing (font units): %d\\n\", *tsb ));\n  }\n\n\n  static FT_Error\n  tt_get_metrics( TT_Loader  loader,\n                  FT_UInt    glyph_index )\n  {\n    TT_Face    face   = (TT_Face)loader->face;\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    TT_Driver  driver = (TT_Driver)FT_FACE_DRIVER( face );\n#endif\n\n    FT_Error   error;\n    FT_Stream  stream = loader->stream;\n\n    FT_Short   left_bearing = 0, top_bearing = 0;\n    FT_UShort  advance_width = 0, advance_height = 0;\n\n    /* we must preserve the stream position          */\n    /* (which gets altered by the metrics functions) */\n    FT_ULong  pos = FT_STREAM_POS();\n\n\n    TT_Get_HMetrics( face, glyph_index,\n                     &left_bearing,\n                     &advance_width );\n    TT_Get_VMetrics( face, glyph_index,\n                     loader->bbox.yMax,\n                     &top_bearing,\n                     &advance_height );\n\n    if ( FT_STREAM_SEEK( pos ) )\n      return error;\n\n    loader->left_bearing = left_bearing;\n    loader->advance      = advance_width;\n    loader->top_bearing  = top_bearing;\n    loader->vadvance     = advance_height;\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )\n    {\n      if ( loader->exec )\n        loader->exec->sph_tweak_flags = 0;\n\n      /* this may not be the right place for this, but it works */\n      if ( loader->exec && loader->exec->ignore_x_mode )\n        sph_set_tweaks( loader, glyph_index );\n    }\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n    if ( !loader->linear_def )\n    {\n      loader->linear_def = 1;\n      loader->linear     = advance_width;\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n\n  static void\n  tt_get_metrics_incr_overrides( TT_Loader  loader,\n                                 FT_UInt    glyph_index )\n  {\n    TT_Face  face = (TT_Face)loader->face;\n\n    FT_Short   left_bearing = 0, top_bearing = 0;\n    FT_UShort  advance_width = 0, advance_height = 0;\n\n\n    /* If this is an incrementally loaded font check whether there are */\n    /* overriding metrics for this glyph.                              */\n    if ( face->root.internal->incremental_interface                           &&\n         face->root.internal->incremental_interface->funcs->get_glyph_metrics )\n    {\n      FT_Incremental_MetricsRec  metrics;\n      FT_Error                   error;\n\n\n      metrics.bearing_x = loader->left_bearing;\n      metrics.bearing_y = 0;\n      metrics.advance   = loader->advance;\n      metrics.advance_v = 0;\n\n      error = face->root.internal->incremental_interface->funcs->get_glyph_metrics(\n                face->root.internal->incremental_interface->object,\n                glyph_index, FALSE, &metrics );\n      if ( error )\n        goto Exit;\n\n      left_bearing  = (FT_Short)metrics.bearing_x;\n      advance_width = (FT_UShort)metrics.advance;\n\n#if 0\n\n      /* GWW: Do I do the same for vertical metrics? */\n      metrics.bearing_x = 0;\n      metrics.bearing_y = loader->top_bearing;\n      metrics.advance   = loader->vadvance;\n\n      error = face->root.internal->incremental_interface->funcs->get_glyph_metrics(\n                face->root.internal->incremental_interface->object,\n                glyph_index, TRUE, &metrics );\n      if ( error )\n        goto Exit;\n\n      top_bearing    = (FT_Short)metrics.bearing_y;\n      advance_height = (FT_UShort)metrics.advance;\n\n#endif /* 0 */\n\n      loader->left_bearing = left_bearing;\n      loader->advance      = advance_width;\n      loader->top_bearing  = top_bearing;\n      loader->vadvance     = advance_height;\n\n      if ( !loader->linear_def )\n      {\n        loader->linear_def = 1;\n        loader->linear     = advance_width;\n      }\n    }\n\n  Exit:\n    return;\n  }\n\n#endif /* FT_CONFIG_OPTION_INCREMENTAL */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Translates an array of coordinates.                                   */\n  /*                                                                       */\n  static void\n  translate_array( FT_UInt     n,\n                   FT_Vector*  coords,\n                   FT_Pos      delta_x,\n                   FT_Pos      delta_y )\n  {\n    FT_UInt  k;\n\n\n    if ( delta_x )\n      for ( k = 0; k < n; k++ )\n        coords[k].x += delta_x;\n\n    if ( delta_y )\n      for ( k = 0; k < n; k++ )\n        coords[k].y += delta_y;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The following functions are used by default with TrueType fonts.      */\n  /* However, they can be replaced by alternatives if we need to support   */\n  /* TrueType-compressed formats (like MicroType) in the future.           */\n  /*                                                                       */\n  /*************************************************************************/\n\n  FT_CALLBACK_DEF( FT_Error )\n  TT_Access_Glyph_Frame( TT_Loader  loader,\n                         FT_UInt    glyph_index,\n                         FT_ULong   offset,\n                         FT_UInt    byte_count )\n  {\n    FT_Error   error;\n    FT_Stream  stream = loader->stream;\n\n    /* for non-debug mode */\n    FT_UNUSED( glyph_index );\n\n\n    FT_TRACE4(( \"Glyph %ld\\n\", glyph_index ));\n\n    /* the following line sets the `error' variable through macros! */\n    if ( FT_STREAM_SEEK( offset ) || FT_FRAME_ENTER( byte_count ) )\n      return error;\n\n    loader->cursor = stream->cursor;\n    loader->limit  = stream->limit;\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_CALLBACK_DEF( void )\n  TT_Forget_Glyph_Frame( TT_Loader  loader )\n  {\n    FT_Stream  stream = loader->stream;\n\n\n    FT_FRAME_EXIT();\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  TT_Load_Glyph_Header( TT_Loader  loader )\n  {\n    FT_Byte*  p     = loader->cursor;\n    FT_Byte*  limit = loader->limit;\n\n\n    if ( p + 10 > limit )\n      return FT_THROW( Invalid_Outline );\n\n    loader->n_contours = FT_NEXT_SHORT( p );\n\n    loader->bbox.xMin = FT_NEXT_SHORT( p );\n    loader->bbox.yMin = FT_NEXT_SHORT( p );\n    loader->bbox.xMax = FT_NEXT_SHORT( p );\n    loader->bbox.yMax = FT_NEXT_SHORT( p );\n\n    FT_TRACE5(( \"  # of contours: %d\\n\", loader->n_contours ));\n    FT_TRACE5(( \"  xMin: %4d  xMax: %4d\\n\", loader->bbox.xMin,\n                                            loader->bbox.xMax ));\n    FT_TRACE5(( \"  yMin: %4d  yMax: %4d\\n\", loader->bbox.yMin,\n                                            loader->bbox.yMax ));\n    loader->cursor = p;\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  TT_Load_Simple_Glyph( TT_Loader  load )\n  {\n    FT_Error        error;\n    FT_Byte*        p          = load->cursor;\n    FT_Byte*        limit      = load->limit;\n    FT_GlyphLoader  gloader    = load->gloader;\n    FT_Int          n_contours = load->n_contours;\n    FT_Outline*     outline;\n    FT_UShort       n_ins;\n    FT_Int          n_points;\n    FT_ULong        tmp;\n\n    FT_Byte         *flag, *flag_limit;\n    FT_Byte         c, count;\n    FT_Vector       *vec, *vec_limit;\n    FT_Pos          x;\n    FT_Short        *cont, *cont_limit, prev_cont;\n    FT_Int          xy_size = 0;\n\n\n    /* check that we can add the contours to the glyph */\n    error = FT_GLYPHLOADER_CHECK_POINTS( gloader, 0, n_contours );\n    if ( error )\n      goto Fail;\n\n    /* reading the contours' endpoints & number of points */\n    cont       = gloader->current.outline.contours;\n    cont_limit = cont + n_contours;\n\n    /* check space for contours array + instructions count */\n    if ( n_contours >= 0xFFF || p + ( n_contours + 1 ) * 2 > limit )\n      goto Invalid_Outline;\n\n    prev_cont = FT_NEXT_SHORT( p );\n\n    if ( n_contours > 0 )\n      cont[0] = prev_cont;\n\n    if ( prev_cont < 0 )\n      goto Invalid_Outline;\n\n    for ( cont++; cont < cont_limit; cont++ )\n    {\n      cont[0] = FT_NEXT_SHORT( p );\n      if ( cont[0] <= prev_cont )\n      {\n        /* unordered contours: this is invalid */\n        goto Invalid_Outline;\n      }\n      prev_cont = cont[0];\n    }\n\n    n_points = 0;\n    if ( n_contours > 0 )\n    {\n      n_points = cont[-1] + 1;\n      if ( n_points < 0 )\n        goto Invalid_Outline;\n    }\n\n    /* note that we will add four phantom points later */\n    error = FT_GLYPHLOADER_CHECK_POINTS( gloader, n_points + 4, 0 );\n    if ( error )\n      goto Fail;\n\n    /* reading the bytecode instructions */\n    load->glyph->control_len  = 0;\n    load->glyph->control_data = 0;\n\n    if ( p + 2 > limit )\n      goto Invalid_Outline;\n\n    n_ins = FT_NEXT_USHORT( p );\n\n    FT_TRACE5(( \"  Instructions size: %u\\n\", n_ins ));\n\n    /* check it */\n    if ( ( limit - p ) < n_ins )\n    {\n      FT_TRACE0(( \"TT_Load_Simple_Glyph: instruction count mismatch\\n\" ));\n      error = FT_THROW( Too_Many_Hints );\n      goto Fail;\n    }\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n\n    if ( IS_HINTED( load->load_flags ) )\n    {\n      /* we don't trust `maxSizeOfInstructions' in the `maxp' table */\n      /* and thus update the bytecode array size by ourselves       */\n\n      tmp   = load->exec->glyphSize;\n      error = Update_Max( load->exec->memory,\n                          &tmp,\n                          sizeof ( FT_Byte ),\n                          (void*)&load->exec->glyphIns,\n                          n_ins );\n\n      load->exec->glyphSize = (FT_UShort)tmp;\n      if ( error )\n        return error;\n\n      load->glyph->control_len  = n_ins;\n      load->glyph->control_data = load->exec->glyphIns;\n\n      FT_MEM_COPY( load->exec->glyphIns, p, (FT_Long)n_ins );\n    }\n\n#endif /* TT_USE_BYTECODE_INTERPRETER */\n\n    p += n_ins;\n\n    outline = &gloader->current.outline;\n\n    /* reading the point tags */\n    flag       = (FT_Byte*)outline->tags;\n    flag_limit = flag + n_points;\n\n    FT_ASSERT( flag != NULL );\n\n    while ( flag < flag_limit )\n    {\n      if ( p + 1 > limit )\n        goto Invalid_Outline;\n\n      *flag++ = c = FT_NEXT_BYTE( p );\n      if ( c & 8 )\n      {\n        if ( p + 1 > limit )\n          goto Invalid_Outline;\n\n        count = FT_NEXT_BYTE( p );\n        if ( flag + (FT_Int)count > flag_limit )\n          goto Invalid_Outline;\n\n        for ( ; count > 0; count-- )\n          *flag++ = c;\n      }\n    }\n\n    /* reading the X coordinates */\n\n    vec       = outline->points;\n    vec_limit = vec + n_points;\n    flag      = (FT_Byte*)outline->tags;\n    x         = 0;\n\n    if ( p + xy_size > limit )\n      goto Invalid_Outline;\n\n    for ( ; vec < vec_limit; vec++, flag++ )\n    {\n      FT_Pos   y = 0;\n      FT_Byte  f = *flag;\n\n\n      if ( f & 2 )\n      {\n        if ( p + 1 > limit )\n          goto Invalid_Outline;\n\n        y = (FT_Pos)FT_NEXT_BYTE( p );\n        if ( ( f & 16 ) == 0 )\n          y = -y;\n      }\n      else if ( ( f & 16 ) == 0 )\n      {\n        if ( p + 2 > limit )\n          goto Invalid_Outline;\n\n        y = (FT_Pos)FT_NEXT_SHORT( p );\n      }\n\n      x     += y;\n      vec->x = x;\n      /* the cast is for stupid compilers */\n      *flag  = (FT_Byte)( f & ~( 2 | 16 ) );\n    }\n\n    /* reading the Y coordinates */\n\n    vec       = gloader->current.outline.points;\n    vec_limit = vec + n_points;\n    flag      = (FT_Byte*)outline->tags;\n    x         = 0;\n\n    for ( ; vec < vec_limit; vec++, flag++ )\n    {\n      FT_Pos   y = 0;\n      FT_Byte  f = *flag;\n\n\n      if ( f & 4 )\n      {\n        if ( p + 1 > limit )\n          goto Invalid_Outline;\n\n        y = (FT_Pos)FT_NEXT_BYTE( p );\n        if ( ( f & 32 ) == 0 )\n          y = -y;\n      }\n      else if ( ( f & 32 ) == 0 )\n      {\n        if ( p + 2 > limit )\n          goto Invalid_Outline;\n\n        y = (FT_Pos)FT_NEXT_SHORT( p );\n      }\n\n      x     += y;\n      vec->y = x;\n      /* the cast is for stupid compilers */\n      *flag  = (FT_Byte)( f & FT_CURVE_TAG_ON );\n    }\n\n    outline->n_points   = (FT_UShort)n_points;\n    outline->n_contours = (FT_Short) n_contours;\n\n    load->cursor = p;\n\n  Fail:\n    return error;\n\n  Invalid_Outline:\n    error = FT_THROW( Invalid_Outline );\n    goto Fail;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  TT_Load_Composite_Glyph( TT_Loader  loader )\n  {\n    FT_Error        error;\n    FT_Byte*        p       = loader->cursor;\n    FT_Byte*        limit   = loader->limit;\n    FT_GlyphLoader  gloader = loader->gloader;\n    FT_SubGlyph     subglyph;\n    FT_UInt         num_subglyphs;\n\n\n    num_subglyphs = 0;\n\n    do\n    {\n      FT_Fixed  xx, xy, yy, yx;\n      FT_UInt   count;\n\n\n      /* check that we can load a new subglyph */\n      error = FT_GlyphLoader_CheckSubGlyphs( gloader, num_subglyphs + 1 );\n      if ( error )\n        goto Fail;\n\n      /* check space */\n      if ( p + 4 > limit )\n        goto Invalid_Composite;\n\n      subglyph = gloader->current.subglyphs + num_subglyphs;\n\n      subglyph->arg1 = subglyph->arg2 = 0;\n\n      subglyph->flags = FT_NEXT_USHORT( p );\n      subglyph->index = FT_NEXT_USHORT( p );\n\n      /* check space */\n      count = 2;\n      if ( subglyph->flags & ARGS_ARE_WORDS )\n        count += 2;\n      if ( subglyph->flags & WE_HAVE_A_SCALE )\n        count += 2;\n      else if ( subglyph->flags & WE_HAVE_AN_XY_SCALE )\n        count += 4;\n      else if ( subglyph->flags & WE_HAVE_A_2X2 )\n        count += 8;\n\n      if ( p + count > limit )\n        goto Invalid_Composite;\n\n      /* read arguments */\n      if ( subglyph->flags & ARGS_ARE_WORDS )\n      {\n        subglyph->arg1 = FT_NEXT_SHORT( p );\n        subglyph->arg2 = FT_NEXT_SHORT( p );\n      }\n      else\n      {\n        subglyph->arg1 = FT_NEXT_CHAR( p );\n        subglyph->arg2 = FT_NEXT_CHAR( p );\n      }\n\n      /* read transform */\n      xx = yy = 0x10000L;\n      xy = yx = 0;\n\n      if ( subglyph->flags & WE_HAVE_A_SCALE )\n      {\n        xx = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;\n        yy = xx;\n      }\n      else if ( subglyph->flags & WE_HAVE_AN_XY_SCALE )\n      {\n        xx = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;\n        yy = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;\n      }\n      else if ( subglyph->flags & WE_HAVE_A_2X2 )\n      {\n        xx = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;\n        yx = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;\n        xy = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;\n        yy = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;\n      }\n\n      subglyph->transform.xx = xx;\n      subglyph->transform.xy = xy;\n      subglyph->transform.yx = yx;\n      subglyph->transform.yy = yy;\n\n      num_subglyphs++;\n\n    } while ( subglyph->flags & MORE_COMPONENTS );\n\n    gloader->current.num_subglyphs = num_subglyphs;\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n\n    {\n      FT_Stream  stream = loader->stream;\n\n\n      /* we must undo the FT_FRAME_ENTER in order to point */\n      /* to the composite instructions, if we find some.   */\n      /* We will process them later.                       */\n      /*                                                   */\n      loader->ins_pos = (FT_ULong)( FT_STREAM_POS() +\n                                    p - limit );\n    }\n\n#endif\n\n    loader->cursor = p;\n\n  Fail:\n    return error;\n\n  Invalid_Composite:\n    error = FT_THROW( Invalid_Composite );\n    goto Fail;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  TT_Init_Glyph_Loading( TT_Face  face )\n  {\n    face->access_glyph_frame   = TT_Access_Glyph_Frame;\n    face->read_glyph_header    = TT_Load_Glyph_Header;\n    face->read_simple_glyph    = TT_Load_Simple_Glyph;\n    face->read_composite_glyph = TT_Load_Composite_Glyph;\n    face->forget_glyph_frame   = TT_Forget_Glyph_Frame;\n  }\n\n\n  static void\n  tt_prepare_zone( TT_GlyphZone  zone,\n                   FT_GlyphLoad  load,\n                   FT_UInt       start_point,\n                   FT_UInt       start_contour )\n  {\n    zone->n_points    = (FT_UShort)( load->outline.n_points - start_point );\n    zone->n_contours  = (FT_Short) ( load->outline.n_contours -\n                                       start_contour );\n    zone->org         = load->extra_points + start_point;\n    zone->cur         = load->outline.points + start_point;\n    zone->orus        = load->extra_points2 + start_point;\n    zone->tags        = (FT_Byte*)load->outline.tags + start_point;\n    zone->contours    = (FT_UShort*)load->outline.contours + start_contour;\n    zone->first_point = (FT_UShort)start_point;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    TT_Hint_Glyph                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Hint the glyph using the zone prepared by the caller.  Note that   */\n  /*    the zone is supposed to include four phantom points.               */\n  /*                                                                       */\n  static FT_Error\n  TT_Hint_Glyph( TT_Loader  loader,\n                 FT_Bool    is_composite )\n  {\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    TT_Face    face   = (TT_Face)loader->face;\n    TT_Driver  driver = (TT_Driver)FT_FACE_DRIVER( face );\n#endif\n\n    TT_GlyphZone  zone = &loader->zone;\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n    FT_UInt       n_ins;\n#else\n    FT_UNUSED( is_composite );\n#endif\n\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n    if ( loader->glyph->control_len > 0xFFFFL )\n    {\n      FT_TRACE1(( \"TT_Hint_Glyph: too long instructions\" ));\n      FT_TRACE1(( \" (0x%lx byte) is truncated\\n\",\n                 loader->glyph->control_len ));\n    }\n    n_ins = (FT_UInt)( loader->glyph->control_len );\n\n    /* save original point position in org */\n    if ( n_ins > 0 )\n      FT_ARRAY_COPY( zone->org, zone->cur, zone->n_points );\n\n    /* Reset graphics state. */\n    loader->exec->GS = ((TT_Size)loader->size)->GS;\n\n    /* XXX: UNDOCUMENTED! Hinting instructions of a composite glyph */\n    /*      completely refer to the (already) hinted subglyphs.     */\n    if ( is_composite )\n    {\n      loader->exec->metrics.x_scale = 1 << 16;\n      loader->exec->metrics.y_scale = 1 << 16;\n\n      FT_ARRAY_COPY( zone->orus, zone->cur, zone->n_points );\n    }\n    else\n    {\n      loader->exec->metrics.x_scale =\n        ((TT_Size)loader->size)->metrics.x_scale;\n      loader->exec->metrics.y_scale =\n        ((TT_Size)loader->size)->metrics.y_scale;\n    }\n#endif\n\n    /* round phantom points */\n    zone->cur[zone->n_points - 4].x =\n      FT_PIX_ROUND( zone->cur[zone->n_points - 4].x );\n    zone->cur[zone->n_points - 3].x =\n      FT_PIX_ROUND( zone->cur[zone->n_points - 3].x );\n    zone->cur[zone->n_points - 2].y =\n      FT_PIX_ROUND( zone->cur[zone->n_points - 2].y );\n    zone->cur[zone->n_points - 1].y =\n      FT_PIX_ROUND( zone->cur[zone->n_points - 1].y );\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n\n    if ( n_ins > 0 )\n    {\n      FT_Bool   debug;\n      FT_Error  error;\n\n      FT_GlyphLoader  gloader         = loader->gloader;\n      FT_Outline      current_outline = gloader->current.outline;\n\n\n      TT_Set_CodeRange( loader->exec, tt_coderange_glyph,\n                        loader->exec->glyphIns, n_ins );\n\n      loader->exec->is_composite = is_composite;\n      loader->exec->pts          = *zone;\n\n      debug = FT_BOOL( !( loader->load_flags & FT_LOAD_NO_SCALE ) &&\n                       ((TT_Size)loader->size)->debug             );\n\n      error = TT_Run_Context( loader->exec, debug );\n      if ( error && loader->exec->pedantic_hinting )\n        return error;\n\n      /* store drop-out mode in bits 5-7; set bit 2 also as a marker */\n      current_outline.tags[0] |=\n        ( loader->exec->GS.scan_type << 5 ) | FT_CURVE_TAG_HAS_SCANMODE;\n    }\n\n#endif\n\n    /* save glyph phantom points */\n    loader->pp1 = zone->cur[zone->n_points - 4];\n    loader->pp2 = zone->cur[zone->n_points - 3];\n    loader->pp3 = zone->cur[zone->n_points - 2];\n    loader->pp4 = zone->cur[zone->n_points - 1];\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )\n    {\n      if ( loader->exec->sph_tweak_flags & SPH_TWEAK_DEEMBOLDEN )\n        FT_Outline_EmboldenXY( &loader->gloader->current.outline, -24, 0 );\n\n      else if ( loader->exec->sph_tweak_flags & SPH_TWEAK_EMBOLDEN )\n        FT_Outline_EmboldenXY( &loader->gloader->current.outline, 24, 0 );\n    }\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n    return FT_Err_Ok;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    TT_Process_Simple_Glyph                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Once a simple glyph has been loaded, it needs to be processed.     */\n  /*    Usually, this means scaling and hinting through bytecode           */\n  /*    interpretation.                                                    */\n  /*                                                                       */\n  static FT_Error\n  TT_Process_Simple_Glyph( TT_Loader  loader )\n  {\n    FT_GlyphLoader  gloader = loader->gloader;\n    FT_Error        error   = FT_Err_Ok;\n    FT_Outline*     outline;\n    FT_Int          n_points;\n\n\n    outline  = &gloader->current.outline;\n    n_points = outline->n_points;\n\n    /* set phantom points */\n\n    outline->points[n_points    ] = loader->pp1;\n    outline->points[n_points + 1] = loader->pp2;\n    outline->points[n_points + 2] = loader->pp3;\n    outline->points[n_points + 3] = loader->pp4;\n\n    outline->tags[n_points    ] = 0;\n    outline->tags[n_points + 1] = 0;\n    outline->tags[n_points + 2] = 0;\n    outline->tags[n_points + 3] = 0;\n\n    n_points += 4;\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n\n    if ( ((TT_Face)loader->face)->doblend )\n    {\n      /* Deltas apply to the unscaled data. */\n      FT_Vector*  deltas;\n      FT_Memory   memory = loader->face->memory;\n      FT_Int      i;\n\n\n      error = TT_Vary_Get_Glyph_Deltas( (TT_Face)(loader->face),\n                                        loader->glyph_index,\n                                        &deltas,\n                                        n_points );\n      if ( error )\n        return error;\n\n      for ( i = 0; i < n_points; ++i )\n      {\n        outline->points[i].x += deltas[i].x;\n        outline->points[i].y += deltas[i].y;\n      }\n\n      FT_FREE( deltas );\n    }\n\n#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */\n\n    if ( IS_HINTED( loader->load_flags ) )\n    {\n      tt_prepare_zone( &loader->zone, &gloader->current, 0, 0 );\n\n      FT_ARRAY_COPY( loader->zone.orus, loader->zone.cur,\n                     loader->zone.n_points + 4 );\n    }\n\n    {\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n      TT_Face    face   = (TT_Face)loader->face;\n      TT_Driver  driver = (TT_Driver)FT_FACE_DRIVER( face );\n\n      FT_String*  family         = face->root.family_name;\n      FT_Int      ppem           = loader->size->metrics.x_ppem;\n      FT_String*  style          = face->root.style_name;\n      FT_Int      x_scale_factor = 1000;\n#endif\n\n      FT_Vector*  vec   = outline->points;\n      FT_Vector*  limit = outline->points + n_points;\n\n      FT_Fixed  x_scale = 0; /* pacify compiler */\n      FT_Fixed  y_scale = 0;\n\n      FT_Bool  do_scale = FALSE;\n\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n\n      if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )\n      {\n        /* scale, but only if enabled and only if TT hinting is being used */\n        if ( IS_HINTED( loader->load_flags ) )\n          x_scale_factor = sph_test_tweak_x_scaling( face,\n                                                     family,\n                                                     ppem,\n                                                     style,\n                                                     loader->glyph_index );\n        /* scale the glyph */\n        if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 ||\n             x_scale_factor != 1000                         )\n        {\n          x_scale = FT_MulDiv( ((TT_Size)loader->size)->metrics.x_scale,\n                               x_scale_factor, 1000 );\n          y_scale = ((TT_Size)loader->size)->metrics.y_scale;\n\n          /* compensate for any scaling by de/emboldening; */\n          /* the amount was determined via experimentation */\n          if ( x_scale_factor != 1000 && ppem > 11 )\n            FT_Outline_EmboldenXY( outline,\n                                   FT_MulFix( 1280 * ppem,\n                                              1000 - x_scale_factor ),\n                                   0 );\n          do_scale = TRUE;\n        }\n      }\n      else\n\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n      {\n        /* scale the glyph */\n        if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )\n        {\n          x_scale = ((TT_Size)loader->size)->metrics.x_scale;\n          y_scale = ((TT_Size)loader->size)->metrics.y_scale;\n\n          do_scale = TRUE;\n        }\n      }\n\n      if ( do_scale )\n      {\n        for ( ; vec < limit; vec++ )\n        {\n          vec->x = FT_MulFix( vec->x, x_scale );\n          vec->y = FT_MulFix( vec->y, y_scale );\n        }\n\n        loader->pp1 = outline->points[n_points - 4];\n        loader->pp2 = outline->points[n_points - 3];\n        loader->pp3 = outline->points[n_points - 2];\n        loader->pp4 = outline->points[n_points - 1];\n      }\n    }\n\n    if ( IS_HINTED( loader->load_flags ) )\n    {\n      loader->zone.n_points += 4;\n\n      error = TT_Hint_Glyph( loader, 0 );\n    }\n\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    TT_Process_Composite_Component                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Once a composite component has been loaded, it needs to be         */\n  /*    processed.  Usually, this means transforming and translating.      */\n  /*                                                                       */\n  static FT_Error\n  TT_Process_Composite_Component( TT_Loader    loader,\n                                  FT_SubGlyph  subglyph,\n                                  FT_UInt      start_point,\n                                  FT_UInt      num_base_points )\n  {\n    FT_GlyphLoader  gloader    = loader->gloader;\n    FT_Vector*      base_vec   = gloader->base.outline.points;\n    FT_UInt         num_points = gloader->base.outline.n_points;\n    FT_Bool         have_scale;\n    FT_Pos          x, y;\n\n\n    have_scale = FT_BOOL( subglyph->flags & ( WE_HAVE_A_SCALE     |\n                                              WE_HAVE_AN_XY_SCALE |\n                                              WE_HAVE_A_2X2       ) );\n\n    /* perform the transform required for this subglyph */\n    if ( have_scale )\n    {\n      FT_UInt  i;\n\n\n      for ( i = num_base_points; i < num_points; i++ )\n        FT_Vector_Transform( base_vec + i, &subglyph->transform );\n    }\n\n    /* get offset */\n    if ( !( subglyph->flags & ARGS_ARE_XY_VALUES ) )\n    {\n      FT_UInt     k = subglyph->arg1;\n      FT_UInt     l = subglyph->arg2;\n      FT_Vector*  p1;\n      FT_Vector*  p2;\n\n\n      /* match l-th point of the newly loaded component to the k-th point */\n      /* of the previously loaded components.                             */\n\n      /* change to the point numbers used by our outline */\n      k += start_point;\n      l += num_base_points;\n      if ( k >= num_base_points ||\n           l >= num_points      )\n        return FT_THROW( Invalid_Composite );\n\n      p1 = gloader->base.outline.points + k;\n      p2 = gloader->base.outline.points + l;\n\n      x = p1->x - p2->x;\n      y = p1->y - p2->y;\n    }\n    else\n    {\n      x = subglyph->arg1;\n      y = subglyph->arg2;\n\n      if ( !x && !y )\n        return FT_Err_Ok;\n\n      /* Use a default value dependent on                                  */\n      /* TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED.  This is useful for old */\n      /* TT fonts which don't set the xxx_COMPONENT_OFFSET bit.            */\n\n      if ( have_scale &&\n#ifdef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED\n           !( subglyph->flags & UNSCALED_COMPONENT_OFFSET ) )\n#else\n            ( subglyph->flags & SCALED_COMPONENT_OFFSET ) )\n#endif\n      {\n\n#if 0\n\n        /*******************************************************************/\n        /*                                                                 */\n        /* This algorithm is what Apple documents.  But it doesn't work.   */\n        /*                                                                 */\n        int  a = subglyph->transform.xx > 0 ?  subglyph->transform.xx\n                                            : -subglyph->transform.xx;\n        int  b = subglyph->transform.yx > 0 ?  subglyph->transform.yx\n                                            : -subglyph->transform.yx;\n        int  c = subglyph->transform.xy > 0 ?  subglyph->transform.xy\n                                            : -subglyph->transform.xy;\n        int  d = subglyph->transform.yy > 0 ? subglyph->transform.yy\n                                            : -subglyph->transform.yy;\n        int  m = a > b ? a : b;\n        int  n = c > d ? c : d;\n\n\n        if ( a - b <= 33 && a - b >= -33 )\n          m *= 2;\n        if ( c - d <= 33 && c - d >= -33 )\n          n *= 2;\n        x = FT_MulFix( x, m );\n        y = FT_MulFix( y, n );\n\n#else /* 1 */\n\n        /*******************************************************************/\n        /*                                                                 */\n        /* This algorithm is a guess and works much better than the above. */\n        /*                                                                 */\n        FT_Fixed  mac_xscale = FT_Hypot( subglyph->transform.xx,\n                                         subglyph->transform.xy );\n        FT_Fixed  mac_yscale = FT_Hypot( subglyph->transform.yy,\n                                         subglyph->transform.yx );\n\n\n        x = FT_MulFix( x, mac_xscale );\n        y = FT_MulFix( y, mac_yscale );\n\n#endif /* 1 */\n\n      }\n\n      if ( !( loader->load_flags & FT_LOAD_NO_SCALE ) )\n      {\n        FT_Fixed  x_scale = ((TT_Size)loader->size)->metrics.x_scale;\n        FT_Fixed  y_scale = ((TT_Size)loader->size)->metrics.y_scale;\n\n\n        x = FT_MulFix( x, x_scale );\n        y = FT_MulFix( y, y_scale );\n\n        if ( subglyph->flags & ROUND_XY_TO_GRID )\n        {\n          x = FT_PIX_ROUND( x );\n          y = FT_PIX_ROUND( y );\n        }\n      }\n    }\n\n    if ( x || y )\n      translate_array( num_points - num_base_points,\n                       base_vec + num_base_points,\n                       x, y );\n\n    return FT_Err_Ok;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    TT_Process_Composite_Glyph                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is slightly different from TT_Process_Simple_Glyph, in that   */\n  /*    its sole purpose is to hint the glyph.  Thus this function is      */\n  /*    only available when bytecode interpreter is enabled.               */\n  /*                                                                       */\n  static FT_Error\n  TT_Process_Composite_Glyph( TT_Loader  loader,\n                              FT_UInt    start_point,\n                              FT_UInt    start_contour )\n  {\n    FT_Error     error;\n    FT_Outline*  outline;\n    FT_UInt      i;\n\n\n    outline = &loader->gloader->base.outline;\n\n    /* make room for phantom points */\n    error = FT_GLYPHLOADER_CHECK_POINTS( loader->gloader,\n                                         outline->n_points + 4,\n                                         0 );\n    if ( error )\n      return error;\n\n    outline->points[outline->n_points    ] = loader->pp1;\n    outline->points[outline->n_points + 1] = loader->pp2;\n    outline->points[outline->n_points + 2] = loader->pp3;\n    outline->points[outline->n_points + 3] = loader->pp4;\n\n    outline->tags[outline->n_points    ] = 0;\n    outline->tags[outline->n_points + 1] = 0;\n    outline->tags[outline->n_points + 2] = 0;\n    outline->tags[outline->n_points + 3] = 0;\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n\n    {\n      FT_Stream  stream = loader->stream;\n      FT_UShort  n_ins, max_ins;\n      FT_ULong   tmp;\n\n\n      /* TT_Load_Composite_Glyph only gives us the offset of instructions */\n      /* so we read them here                                             */\n      if ( FT_STREAM_SEEK( loader->ins_pos ) ||\n           FT_READ_USHORT( n_ins )           )\n        return error;\n\n      FT_TRACE5(( \"  Instructions size = %d\\n\", n_ins ));\n\n      /* check it */\n      max_ins = ((TT_Face)loader->face)->max_profile.maxSizeOfInstructions;\n      if ( n_ins > max_ins )\n      {\n        /* don't trust `maxSizeOfInstructions'; */\n        /* only do a rough safety check         */\n        if ( (FT_Int)n_ins > loader->byte_len )\n        {\n          FT_TRACE1(( \"TT_Process_Composite_Glyph:\"\n                      \" too many instructions (%d) for glyph with length %d\\n\",\n                      n_ins, loader->byte_len ));\n          return FT_THROW( Too_Many_Hints );\n        }\n\n        tmp   = loader->exec->glyphSize;\n        error = Update_Max( loader->exec->memory,\n                            &tmp,\n                            sizeof ( FT_Byte ),\n                            (void*)&loader->exec->glyphIns,\n                            n_ins );\n\n        loader->exec->glyphSize = (FT_UShort)tmp;\n        if ( error )\n          return error;\n      }\n      else if ( n_ins == 0 )\n        return FT_Err_Ok;\n\n      if ( FT_STREAM_READ( loader->exec->glyphIns, n_ins ) )\n        return error;\n\n      loader->glyph->control_data = loader->exec->glyphIns;\n      loader->glyph->control_len  = n_ins;\n    }\n\n#endif\n\n    tt_prepare_zone( &loader->zone, &loader->gloader->base,\n                     start_point, start_contour );\n\n    /* Some points are likely touched during execution of  */\n    /* instructions on components.  So let's untouch them. */\n    for ( i = 0; i < loader->zone.n_points; i++ )\n      loader->zone.tags[i] &= ~FT_CURVE_TAG_TOUCH_BOTH;\n\n    loader->zone.n_points += 4;\n\n    return TT_Hint_Glyph( loader, 1 );\n  }\n\n\n  /*\n   * Calculate the phantom points\n   *\n   * Defining the right side bearing (rsb) as\n   *\n   *   rsb = aw - (lsb + xmax - xmin)\n   *\n   * (with `aw' the advance width, `lsb' the left side bearing, and `xmin'\n   * and `xmax' the glyph's minimum and maximum x value), the OpenType\n   * specification defines the initial position of horizontal phantom points\n   * as\n   *\n   *   pp1 = (round(xmin - lsb), 0)      ,\n   *   pp2 = (round(pp1 + aw), 0)        .\n   *\n   * Note that the rounding to the grid (in the device space) is not\n   * documented currently in the specification.\n   *\n   * However, the specification lacks the precise definition of vertical\n   * phantom points.  Greg Hitchcock provided the following explanation.\n   *\n   * - a `vmtx' table is present\n   *\n   *   For any glyph, the minimum and maximum y values (`ymin' and `ymax')\n   *   are given in the `glyf' table, the top side bearing (tsb) and advance\n   *   height (ah) are given in the `vmtx' table.  The bottom side bearing\n   *   (bsb) is then calculated as\n   *\n   *     bsb = ah - (tsb + ymax - ymin)       ,\n   *\n   *   and the initial position of vertical phantom points is\n   *\n   *     pp3 = (x, round(ymax + tsb))       ,\n   *     pp4 = (x, round(pp3 - ah))         .\n   *\n   *   See below for value `x'.\n   *\n   * - no `vmtx' table in the font\n   *\n   *   If there is an `OS/2' table, we set\n   *\n   *     DefaultAscender = sTypoAscender       ,\n   *     DefaultDescender = sTypoDescender     ,\n   *\n   *   otherwise we use data from the `hhea' table:\n   *\n   *     DefaultAscender = Ascender         ,\n   *     DefaultDescender = Descender       .\n   *\n   *   With these two variables we can now set\n   *\n   *     ah = DefaultAscender - sDefaultDescender    ,\n   *     tsb = DefaultAscender - yMax                ,\n   *\n   *   and proceed as if a `vmtx' table was present.\n   *\n   * Usually we have\n   *\n   *   x = aw / 2      ,                                                (1)\n   *\n   * but there is one compatibility case where it can be set to\n   *\n   *   x = -DefaultDescender -\n   *         ((DefaultAscender - DefaultDescender - aw) / 2)     .      (2)\n   *\n   * and another one with\n   *\n   *   x = 0     .                                                      (3)\n   *\n   * In Windows, the history of those values is quite complicated,\n   * depending on the hinting engine (that is, the graphics framework).\n   *\n   *   framework        from                 to       formula\n   *  ----------------------------------------------------------\n   *    GDI       Windows 98               current      (1)\n   *              (Windows 2000 for NT)\n   *    GDI+      Windows XP               Windows 7    (2)\n   *    GDI+      Windows 8                current      (3)\n   *    DWrite    Windows 7                current      (3)\n   *\n   * For simplicity, FreeType uses (1) for grayscale subpixel hinting and\n   * (3) for everything else.\n   *\n   */\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n\n#define TT_LOADER_SET_PP( loader )                                          \\\n          do                                                                \\\n          {                                                                 \\\n            FT_Bool  subpixel_  = loader->exec ? loader->exec->subpixel     \\\n                                               : 0;                         \\\n            FT_Bool  grayscale_ = loader->exec ? loader->exec->grayscale    \\\n                                               : 0;                         \\\n            FT_Bool  use_aw_2_  = (FT_Bool)( subpixel_ && grayscale_ );     \\\n                                                                            \\\n                                                                            \\\n            (loader)->pp1.x = (loader)->bbox.xMin - (loader)->left_bearing; \\\n            (loader)->pp1.y = 0;                                            \\\n            (loader)->pp2.x = (loader)->pp1.x + (loader)->advance;          \\\n            (loader)->pp2.y = 0;                                            \\\n                                                                            \\\n            (loader)->pp3.x = use_aw_2_ ? (loader)->advance / 2 : 0;        \\\n            (loader)->pp3.y = (loader)->bbox.yMax + (loader)->top_bearing;  \\\n            (loader)->pp4.x = use_aw_2_ ? (loader)->advance / 2 : 0;        \\\n            (loader)->pp4.y = (loader)->pp3.y - (loader)->vadvance;         \\\n          } while ( 0 )\n\n#else /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n#define TT_LOADER_SET_PP( loader )                                          \\\n          do                                                                \\\n          {                                                                 \\\n            (loader)->pp1.x = (loader)->bbox.xMin - (loader)->left_bearing; \\\n            (loader)->pp1.y = 0;                                            \\\n            (loader)->pp2.x = (loader)->pp1.x + (loader)->advance;          \\\n            (loader)->pp2.y = 0;                                            \\\n                                                                            \\\n            (loader)->pp3.x = 0;                                            \\\n            (loader)->pp3.y = (loader)->bbox.yMax + (loader)->top_bearing;  \\\n            (loader)->pp4.x = 0;                                            \\\n            (loader)->pp4.y = (loader)->pp3.y - (loader)->vadvance;         \\\n          } while ( 0 )\n\n#endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    load_truetype_glyph                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Loads a given truetype glyph.  Handles composites and uses a       */\n  /*    TT_Loader object.                                                  */\n  /*                                                                       */\n  static FT_Error\n  load_truetype_glyph( TT_Loader  loader,\n                       FT_UInt    glyph_index,\n                       FT_UInt    recurse_count,\n                       FT_Bool    header_only )\n  {\n    FT_Error        error        = FT_Err_Ok;\n    FT_Fixed        x_scale, y_scale;\n    FT_ULong        offset;\n    TT_Face         face         = (TT_Face)loader->face;\n    FT_GlyphLoader  gloader      = loader->gloader;\n    FT_Bool         opened_frame = 0;\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n    FT_Vector*      deltas       = NULL;\n#endif\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n    FT_StreamRec    inc_stream;\n    FT_Data         glyph_data;\n    FT_Bool         glyph_data_loaded = 0;\n#endif\n\n\n    /* some fonts have an incorrect value of `maxComponentDepth', */\n    /* thus we allow depth 1 to catch the majority of them        */\n    if ( recurse_count > 1                                   &&\n         recurse_count > face->max_profile.maxComponentDepth )\n    {\n      error = FT_THROW( Invalid_Composite );\n      goto Exit;\n    }\n\n    /* check glyph index */\n    if ( glyph_index >= (FT_UInt)face->root.num_glyphs )\n    {\n      error = FT_THROW( Invalid_Glyph_Index );\n      goto Exit;\n    }\n\n    loader->glyph_index = glyph_index;\n\n    if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )\n    {\n      x_scale = ((TT_Size)loader->size)->metrics.x_scale;\n      y_scale = ((TT_Size)loader->size)->metrics.y_scale;\n    }\n    else\n    {\n      x_scale = 0x10000L;\n      y_scale = 0x10000L;\n    }\n\n    /* Set `offset' to the start of the glyph relative to the start of */\n    /* the `glyf' table, and `byte_len' to the length of the glyph in  */\n    /* bytes.                                                          */\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n\n    /* If we are loading glyph data via the incremental interface, set */\n    /* the loader stream to a memory stream reading the data returned  */\n    /* by the interface.                                               */\n    if ( face->root.internal->incremental_interface )\n    {\n      error = face->root.internal->incremental_interface->funcs->get_glyph_data(\n                face->root.internal->incremental_interface->object,\n                glyph_index, &glyph_data );\n      if ( error )\n        goto Exit;\n\n      glyph_data_loaded = 1;\n      offset            = 0;\n      loader->byte_len  = glyph_data.length;\n\n      FT_MEM_ZERO( &inc_stream, sizeof ( inc_stream ) );\n      FT_Stream_OpenMemory( &inc_stream,\n                            glyph_data.pointer, glyph_data.length );\n\n      loader->stream = &inc_stream;\n    }\n    else\n\n#endif /* FT_CONFIG_OPTION_INCREMENTAL */\n\n      offset = tt_face_get_location( face, glyph_index,\n                                     (FT_UInt*)&loader->byte_len );\n\n    if ( loader->byte_len > 0 )\n    {\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n      /* for the incremental interface, `glyf_offset' is always zero */\n      if ( !loader->glyf_offset                        &&\n           !face->root.internal->incremental_interface )\n#else\n      if ( !loader->glyf_offset )\n#endif /* FT_CONFIG_OPTION_INCREMENTAL */\n      {\n        FT_TRACE2(( \"no `glyf' table but non-zero `loca' entry\\n\" ));\n        error = FT_THROW( Invalid_Table );\n        goto Exit;\n      }\n\n      error = face->access_glyph_frame( loader, glyph_index,\n                                        loader->glyf_offset + offset,\n                                        loader->byte_len );\n      if ( error )\n        goto Exit;\n\n      opened_frame = 1;\n\n      /* read glyph header first */\n      error = face->read_glyph_header( loader );\n      if ( error )\n        goto Exit;\n\n      /* the metrics must be computed after loading the glyph header */\n      /* since we need the glyph's `yMax' value in case the vertical */\n      /* metrics must be emulated                                    */\n      error = tt_get_metrics( loader, glyph_index );\n      if ( error )\n        goto Exit;\n\n      if ( header_only )\n        goto Exit;\n    }\n\n    if ( loader->byte_len == 0 || loader->n_contours == 0 )\n    {\n      loader->bbox.xMin = 0;\n      loader->bbox.xMax = 0;\n      loader->bbox.yMin = 0;\n      loader->bbox.yMax = 0;\n\n      error = tt_get_metrics( loader, glyph_index );\n      if ( error )\n        goto Exit;\n\n      if ( header_only )\n        goto Exit;\n\n      /* must initialize points before (possibly) overriding */\n      /* glyph metrics from the incremental interface        */\n      TT_LOADER_SET_PP( loader );\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n      tt_get_metrics_incr_overrides( loader, glyph_index );\n#endif\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n\n      if ( ((TT_Face)(loader->face))->doblend )\n      {\n        /* this must be done before scaling */\n        FT_Memory  memory = loader->face->memory;\n\n\n        error = TT_Vary_Get_Glyph_Deltas( (TT_Face)(loader->face),\n                                          glyph_index, &deltas, 4 );\n        if ( error )\n          goto Exit;\n\n        loader->pp1.x += deltas[0].x;\n        loader->pp1.y += deltas[0].y;\n        loader->pp2.x += deltas[1].x;\n        loader->pp2.y += deltas[1].y;\n\n        loader->pp3.x += deltas[2].x;\n        loader->pp3.y += deltas[2].y;\n        loader->pp4.x += deltas[3].x;\n        loader->pp4.y += deltas[3].y;\n\n        FT_FREE( deltas );\n      }\n\n#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */\n\n      /* scale phantom points, if necessary; */\n      /* they get rounded in `TT_Hint_Glyph' */\n      if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )\n      {\n        loader->pp1.x = FT_MulFix( loader->pp1.x, x_scale );\n        loader->pp2.x = FT_MulFix( loader->pp2.x, x_scale );\n        /* pp1.y and pp2.y are always zero */\n\n        loader->pp3.x = FT_MulFix( loader->pp3.x, x_scale );\n        loader->pp3.y = FT_MulFix( loader->pp3.y, y_scale );\n        loader->pp4.x = FT_MulFix( loader->pp4.x, x_scale );\n        loader->pp4.y = FT_MulFix( loader->pp4.y, y_scale );\n      }\n\n      error = FT_Err_Ok;\n      goto Exit;\n    }\n\n    /* must initialize phantom points before (possibly) overriding */\n    /* glyph metrics from the incremental interface                */\n    TT_LOADER_SET_PP( loader );\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n    tt_get_metrics_incr_overrides( loader, glyph_index );\n#endif\n\n    /***********************************************************************/\n    /***********************************************************************/\n    /***********************************************************************/\n\n    /* if it is a simple glyph, load it */\n\n    if ( loader->n_contours > 0 )\n    {\n      error = face->read_simple_glyph( loader );\n      if ( error )\n        goto Exit;\n\n      /* all data have been read */\n      face->forget_glyph_frame( loader );\n      opened_frame = 0;\n\n      error = TT_Process_Simple_Glyph( loader );\n      if ( error )\n        goto Exit;\n\n      FT_GlyphLoader_Add( gloader );\n    }\n\n    /***********************************************************************/\n    /***********************************************************************/\n    /***********************************************************************/\n\n    /* otherwise, load a composite! */\n    else if ( loader->n_contours == -1 )\n    {\n      FT_UInt   start_point;\n      FT_UInt   start_contour;\n      FT_ULong  ins_pos;  /* position of composite instructions, if any */\n\n\n      start_point   = gloader->base.outline.n_points;\n      start_contour = gloader->base.outline.n_contours;\n\n      /* for each subglyph, read composite header */\n      error = face->read_composite_glyph( loader );\n      if ( error )\n        goto Exit;\n\n      /* store the offset of instructions */\n      ins_pos = loader->ins_pos;\n\n      /* all data we need are read */\n      face->forget_glyph_frame( loader );\n      opened_frame = 0;\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n\n      if ( face->doblend )\n      {\n        FT_Int       i, limit;\n        FT_SubGlyph  subglyph;\n        FT_Memory    memory = face->root.memory;\n\n\n        /* this provides additional offsets */\n        /* for each component's translation */\n\n        if ( ( error = TT_Vary_Get_Glyph_Deltas(\n                         face,\n                         glyph_index,\n                         &deltas,\n                         gloader->current.num_subglyphs + 4 ) ) != 0 )\n          goto Exit;\n\n        subglyph = gloader->current.subglyphs + gloader->base.num_subglyphs;\n        limit    = gloader->current.num_subglyphs;\n\n        for ( i = 0; i < limit; ++i, ++subglyph )\n        {\n          if ( subglyph->flags & ARGS_ARE_XY_VALUES )\n          {\n            /* XXX: overflow check for subglyph->{arg1,arg2}.   */\n            /* deltas[i].{x,y} must be within signed 16-bit,    */\n            /* but the restriction of summed delta is not clear */\n            subglyph->arg1 += (FT_Int16)deltas[i].x;\n            subglyph->arg2 += (FT_Int16)deltas[i].y;\n          }\n        }\n\n        loader->pp1.x += deltas[i + 0].x;\n        loader->pp1.y += deltas[i + 0].y;\n        loader->pp2.x += deltas[i + 1].x;\n        loader->pp2.y += deltas[i + 1].y;\n\n        loader->pp3.x += deltas[i + 2].x;\n        loader->pp3.y += deltas[i + 2].y;\n        loader->pp4.x += deltas[i + 3].x;\n        loader->pp4.y += deltas[i + 3].y;\n\n        FT_FREE( deltas );\n      }\n\n#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */\n\n      /* scale phantom points, if necessary; */\n      /* they get rounded in `TT_Hint_Glyph' */\n      if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )\n      {\n        loader->pp1.x = FT_MulFix( loader->pp1.x, x_scale );\n        loader->pp2.x = FT_MulFix( loader->pp2.x, x_scale );\n        /* pp1.y and pp2.y are always zero */\n\n        loader->pp3.x = FT_MulFix( loader->pp3.x, x_scale );\n        loader->pp3.y = FT_MulFix( loader->pp3.y, y_scale );\n        loader->pp4.x = FT_MulFix( loader->pp4.x, x_scale );\n        loader->pp4.y = FT_MulFix( loader->pp4.y, y_scale );\n      }\n\n      /* if the flag FT_LOAD_NO_RECURSE is set, we return the subglyph */\n      /* `as is' in the glyph slot (the client application will be     */\n      /* responsible for interpreting these data)...                   */\n      if ( loader->load_flags & FT_LOAD_NO_RECURSE )\n      {\n        FT_GlyphLoader_Add( gloader );\n        loader->glyph->format = FT_GLYPH_FORMAT_COMPOSITE;\n\n        goto Exit;\n      }\n\n      /*********************************************************************/\n      /*********************************************************************/\n      /*********************************************************************/\n\n      {\n        FT_UInt      n, num_base_points;\n        FT_SubGlyph  subglyph       = 0;\n\n        FT_UInt      num_points     = start_point;\n        FT_UInt      num_subglyphs  = gloader->current.num_subglyphs;\n        FT_UInt      num_base_subgs = gloader->base.num_subglyphs;\n\n        FT_Stream    old_stream     = loader->stream;\n        FT_Int       old_byte_len   = loader->byte_len;\n\n\n        FT_GlyphLoader_Add( gloader );\n\n        /* read each subglyph independently */\n        for ( n = 0; n < num_subglyphs; n++ )\n        {\n          FT_Vector  pp[4];\n\n\n          /* Each time we call load_truetype_glyph in this loop, the   */\n          /* value of `gloader.base.subglyphs' can change due to table */\n          /* reallocations.  We thus need to recompute the subglyph    */\n          /* pointer on each iteration.                                */\n          subglyph = gloader->base.subglyphs + num_base_subgs + n;\n\n          pp[0] = loader->pp1;\n          pp[1] = loader->pp2;\n          pp[2] = loader->pp3;\n          pp[3] = loader->pp4;\n\n          num_base_points = gloader->base.outline.n_points;\n\n          error = load_truetype_glyph( loader, subglyph->index,\n                                       recurse_count + 1, FALSE );\n          if ( error )\n            goto Exit;\n\n          /* restore subglyph pointer */\n          subglyph = gloader->base.subglyphs + num_base_subgs + n;\n\n          /* restore phantom points if necessary */\n          if ( !( subglyph->flags & USE_MY_METRICS ) )\n          {\n            loader->pp1 = pp[0];\n            loader->pp2 = pp[1];\n            loader->pp3 = pp[2];\n            loader->pp4 = pp[3];\n          }\n\n          num_points = gloader->base.outline.n_points;\n\n          if ( num_points == num_base_points )\n            continue;\n\n          /* gloader->base.outline consists of three parts:               */\n          /* 0 -(1)-> start_point -(2)-> num_base_points -(3)-> n_points. */\n          /*                                                              */\n          /* (1): exists from the beginning                               */\n          /* (2): components that have been loaded so far                 */\n          /* (3): the newly loaded component                              */\n          error = TT_Process_Composite_Component( loader,\n                                                  subglyph,\n                                                  start_point,\n                                                  num_base_points );\n          if ( error )\n            goto Exit;\n        }\n\n        loader->stream   = old_stream;\n        loader->byte_len = old_byte_len;\n\n        /* process the glyph */\n        loader->ins_pos = ins_pos;\n        if ( IS_HINTED( loader->load_flags ) &&\n#ifdef TT_USE_BYTECODE_INTERPRETER\n             subglyph->flags & WE_HAVE_INSTR &&\n#endif\n             num_points > start_point )\n        {\n          error = TT_Process_Composite_Glyph( loader,\n                                              start_point,\n                                              start_contour );\n          if ( error )\n            goto Exit;\n        }\n      }\n    }\n    else\n    {\n      /* invalid composite count (negative but not -1) */\n      error = FT_THROW( Invalid_Outline );\n      goto Exit;\n    }\n\n    /***********************************************************************/\n    /***********************************************************************/\n    /***********************************************************************/\n\n  Exit:\n\n    if ( opened_frame )\n      face->forget_glyph_frame( loader );\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n\n    if ( glyph_data_loaded )\n      face->root.internal->incremental_interface->funcs->free_glyph_data(\n        face->root.internal->incremental_interface->object,\n        &glyph_data );\n\n#endif\n\n    return error;\n  }\n\n\n  static FT_Error\n  compute_glyph_metrics( TT_Loader  loader,\n                         FT_UInt    glyph_index )\n  {\n    TT_Face    face   = (TT_Face)loader->face;\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    TT_Driver  driver = (TT_Driver)FT_FACE_DRIVER( face );\n#endif\n\n    FT_BBox       bbox;\n    FT_Fixed      y_scale;\n    TT_GlyphSlot  glyph = loader->glyph;\n    TT_Size       size  = (TT_Size)loader->size;\n\n\n    y_scale = 0x10000L;\n    if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )\n      y_scale = size->root.metrics.y_scale;\n\n    if ( glyph->format != FT_GLYPH_FORMAT_COMPOSITE )\n      FT_Outline_Get_CBox( &glyph->outline, &bbox );\n    else\n      bbox = loader->bbox;\n\n    /* get the device-independent horizontal advance; it is scaled later */\n    /* by the base layer.                                                */\n    glyph->linearHoriAdvance = loader->linear;\n\n    glyph->metrics.horiBearingX = bbox.xMin;\n    glyph->metrics.horiBearingY = bbox.yMax;\n    glyph->metrics.horiAdvance  = loader->pp2.x - loader->pp1.x;\n\n    /* adjust advance width to the value contained in the hdmx table */\n    if ( !face->postscript.isFixedPitch  &&\n         IS_HINTED( loader->load_flags ) )\n    {\n      FT_Byte*  widthp;\n\n\n      widthp = tt_face_get_device_metrics( face,\n                                           size->root.metrics.x_ppem,\n                                           glyph_index );\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n\n      if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )\n      {\n        FT_Bool  ignore_x_mode;\n\n\n        ignore_x_mode = FT_BOOL( FT_LOAD_TARGET_MODE( loader->load_flags ) !=\n                                 FT_RENDER_MODE_MONO );\n\n        if ( widthp                                                   &&\n             ( ( ignore_x_mode && loader->exec->compatible_widths ) ||\n                !ignore_x_mode                                      ||\n                SPH_OPTION_BITMAP_WIDTHS                            ) )\n          glyph->metrics.horiAdvance = *widthp << 6;\n      }\n      else\n\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n      {\n        if ( widthp )\n          glyph->metrics.horiAdvance = *widthp << 6;\n      }\n    }\n\n    /* set glyph dimensions */\n    glyph->metrics.width  = bbox.xMax - bbox.xMin;\n    glyph->metrics.height = bbox.yMax - bbox.yMin;\n\n    /* Now take care of vertical metrics.  In the case where there is */\n    /* no vertical information within the font (relatively common),   */\n    /* create some metrics manually                                   */\n    {\n      FT_Pos  top;      /* scaled vertical top side bearing  */\n      FT_Pos  advance;  /* scaled vertical advance height    */\n\n\n      /* Get the unscaled top bearing and advance height. */\n      if ( face->vertical_info                   &&\n           face->vertical.number_Of_VMetrics > 0 )\n      {\n        top = (FT_Short)FT_DivFix( loader->pp3.y - bbox.yMax,\n                                   y_scale );\n\n        if ( loader->pp3.y <= loader->pp4.y )\n          advance = 0;\n        else\n          advance = (FT_UShort)FT_DivFix( loader->pp3.y - loader->pp4.y,\n                                          y_scale );\n      }\n      else\n      {\n        FT_Pos  height;\n\n\n        /* XXX Compute top side bearing and advance height in  */\n        /*     Get_VMetrics instead of here.                   */\n\n        /* NOTE: The OS/2 values are the only `portable' ones, */\n        /*       which is why we use them, if there is an OS/2 */\n        /*       table in the font.  Otherwise, we use the     */\n        /*       values defined in the horizontal header.      */\n\n        height = (FT_Short)FT_DivFix( bbox.yMax - bbox.yMin,\n                                      y_scale );\n        if ( face->os2.version != 0xFFFFU )\n          advance = (FT_Pos)( face->os2.sTypoAscender -\n                              face->os2.sTypoDescender );\n        else\n          advance = (FT_Pos)( face->horizontal.Ascender -\n                              face->horizontal.Descender );\n\n        top = ( advance - height ) / 2;\n      }\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n      {\n        FT_Incremental_InterfaceRec*  incr;\n        FT_Incremental_MetricsRec     metrics;\n        FT_Error                      error;\n\n\n        incr = face->root.internal->incremental_interface;\n\n        /* If this is an incrementally loaded font see if there are */\n        /* overriding metrics for this glyph.                       */\n        if ( incr && incr->funcs->get_glyph_metrics )\n        {\n          metrics.bearing_x = 0;\n          metrics.bearing_y = top;\n          metrics.advance   = advance;\n\n          error = incr->funcs->get_glyph_metrics( incr->object,\n                                                  glyph_index,\n                                                  TRUE,\n                                                  &metrics );\n          if ( error )\n            return error;\n\n          top     = metrics.bearing_y;\n          advance = metrics.advance;\n        }\n      }\n\n      /* GWW: Do vertical metrics get loaded incrementally too? */\n\n#endif /* FT_CONFIG_OPTION_INCREMENTAL */\n\n      glyph->linearVertAdvance = advance;\n\n      /* scale the metrics */\n      if ( !( loader->load_flags & FT_LOAD_NO_SCALE ) )\n      {\n        top     = FT_MulFix( top,     y_scale );\n        advance = FT_MulFix( advance, y_scale );\n      }\n\n      /* XXX: for now, we have no better algorithm for the lsb, but it */\n      /*      should work fine.                                        */\n      /*                                                               */\n      glyph->metrics.vertBearingX = glyph->metrics.horiBearingX -\n                                      glyph->metrics.horiAdvance / 2;\n      glyph->metrics.vertBearingY = top;\n      glyph->metrics.vertAdvance  = advance;\n    }\n\n    return 0;\n  }\n\n\n#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n\n  static FT_Error\n  load_sbit_image( TT_Size       size,\n                   TT_GlyphSlot  glyph,\n                   FT_UInt       glyph_index,\n                   FT_Int32      load_flags )\n  {\n    TT_Face             face;\n    SFNT_Service        sfnt;\n    FT_Stream           stream;\n    FT_Error            error;\n    TT_SBit_MetricsRec  metrics;\n\n\n    face   = (TT_Face)glyph->face;\n    sfnt   = (SFNT_Service)face->sfnt;\n    stream = face->root.stream;\n\n    error = sfnt->load_sbit_image( face,\n                                   size->strike_index,\n                                   glyph_index,\n                                   (FT_Int)load_flags,\n                                   stream,\n                                   &glyph->bitmap,\n                                   &metrics );\n    if ( !error )\n    {\n      glyph->outline.n_points   = 0;\n      glyph->outline.n_contours = 0;\n\n      glyph->metrics.width  = (FT_Pos)metrics.width  << 6;\n      glyph->metrics.height = (FT_Pos)metrics.height << 6;\n\n      glyph->metrics.horiBearingX = (FT_Pos)metrics.horiBearingX << 6;\n      glyph->metrics.horiBearingY = (FT_Pos)metrics.horiBearingY << 6;\n      glyph->metrics.horiAdvance  = (FT_Pos)metrics.horiAdvance  << 6;\n\n      glyph->metrics.vertBearingX = (FT_Pos)metrics.vertBearingX << 6;\n      glyph->metrics.vertBearingY = (FT_Pos)metrics.vertBearingY << 6;\n      glyph->metrics.vertAdvance  = (FT_Pos)metrics.vertAdvance  << 6;\n\n      glyph->format = FT_GLYPH_FORMAT_BITMAP;\n\n      if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )\n      {\n        glyph->bitmap_left = metrics.vertBearingX;\n        glyph->bitmap_top  = metrics.vertBearingY;\n      }\n      else\n      {\n        glyph->bitmap_left = metrics.horiBearingX;\n        glyph->bitmap_top  = metrics.horiBearingY;\n      }\n    }\n\n    return error;\n  }\n\n#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */\n\n\n  static FT_Error\n  tt_loader_init( TT_Loader     loader,\n                  TT_Size       size,\n                  TT_GlyphSlot  glyph,\n                  FT_Int32      load_flags,\n                  FT_Bool       glyf_table_only )\n  {\n    FT_Error  error;\n\n    TT_Face    face;\n    FT_Stream  stream;\n#ifdef TT_USE_BYTECODE_INTERPRETER\n    FT_Bool    pedantic = FT_BOOL( load_flags & FT_LOAD_PEDANTIC );\n#endif\n\n\n    face   = (TT_Face)glyph->face;\n    stream = face->root.stream;\n\n    FT_MEM_ZERO( loader, sizeof ( TT_LoaderRec ) );\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n\n    /* load execution context */\n    if ( IS_HINTED( load_flags ) && !glyf_table_only )\n    {\n      TT_ExecContext  exec;\n      FT_Bool         grayscale;\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n      TT_Driver  driver = (TT_Driver)FT_FACE_DRIVER( face );\n\n      FT_Bool  subpixel = FALSE;\n\n#if 0\n      /* not used yet */\n      FT_Bool  compatible_widths;\n      FT_Bool  symmetrical_smoothing;\n      FT_Bool  bgr;\n      FT_Bool  subpixel_positioned;\n#endif\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n      FT_Bool  reexecute = FALSE;\n\n\n      if ( size->bytecode_ready < 0 || size->cvt_ready < 0 )\n      {\n        error = tt_size_ready_bytecode( size, pedantic );\n        if ( error )\n          return error;\n      }\n      else if ( size->bytecode_ready )\n        return size->bytecode_ready;\n      else if ( size->cvt_ready )\n        return size->cvt_ready;\n\n      /* query new execution context */\n      exec = size->debug ? size->context\n                         : ( (TT_Driver)FT_FACE_DRIVER( face ) )->context;\n      if ( !exec )\n        return FT_THROW( Could_Not_Find_Context );\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n\n      if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )\n      {\n        subpixel = FT_BOOL( ( FT_LOAD_TARGET_MODE( load_flags ) !=\n                              FT_RENDER_MODE_MONO               )  &&\n                            SPH_OPTION_SET_SUBPIXEL                );\n\n        if ( subpixel )\n          grayscale = FALSE;\n        else if ( SPH_OPTION_SET_GRAYSCALE )\n        {\n          grayscale = TRUE;\n          subpixel  = FALSE;\n        }\n        else\n          grayscale = FALSE;\n\n        if ( FT_IS_TRICKY( glyph->face ) )\n          subpixel = FALSE;\n\n        exec->ignore_x_mode      = subpixel || grayscale;\n        exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION;\n        if ( exec->sph_tweak_flags & SPH_TWEAK_RASTERIZER_35 )\n          exec->rasterizer_version = TT_INTERPRETER_VERSION_35;\n\n#if 1\n        exec->compatible_widths     = SPH_OPTION_SET_COMPATIBLE_WIDTHS;\n        exec->symmetrical_smoothing = FALSE;\n        exec->bgr                   = FALSE;\n        exec->subpixel_positioned   = TRUE;\n#else /* 0 */\n        exec->compatible_widths =\n          FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=\n                   TT_LOAD_COMPATIBLE_WIDTHS );\n        exec->symmetrical_smoothing =\n          FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=\n                   TT_LOAD_SYMMETRICAL_SMOOTHING );\n        exec->bgr =\n          FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=\n                   TT_LOAD_BGR );\n        exec->subpixel_positioned =\n          FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=\n                   TT_LOAD_SUBPIXEL_POSITIONED );\n#endif /* 0 */\n\n      }\n      else\n\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n      {\n        grayscale = FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=\n                             FT_RENDER_MODE_MONO );\n      }\n\n      error = TT_Load_Context( exec, face, size );\n      if ( error )\n        return error;\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n\n      if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )\n      {\n        /* a change from mono to subpixel rendering (and vice versa) */\n        /* requires a re-execution of the CVT program                */\n        if ( subpixel != exec->subpixel )\n        {\n          FT_TRACE4(( \"tt_loader_init: subpixel hinting change,\"\n                      \" re-executing `prep' table\\n\" ));\n\n          exec->subpixel = subpixel;\n          reexecute      = TRUE;\n        }\n\n        /* a change from mono to grayscale rendering (and vice versa) */\n        /* requires a re-execution of the CVT program                 */\n        if ( grayscale != exec->grayscale )\n        {\n          FT_TRACE4(( \"tt_loader_init: grayscale hinting change,\"\n                      \" re-executing `prep' table\\n\" ));\n\n          exec->grayscale = grayscale;\n          reexecute       = TRUE;\n        }\n      }\n      else\n\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n      {\n        /* a change from mono to grayscale rendering (and vice versa) */\n        /* requires a re-execution of the CVT program                 */\n        if ( grayscale != exec->grayscale )\n        {\n          FT_TRACE4(( \"tt_loader_init: grayscale change,\"\n                      \" re-executing `prep' table\\n\" ));\n\n          exec->grayscale = grayscale;\n          reexecute       = TRUE;\n        }\n      }\n\n      if ( reexecute )\n      {\n        FT_UInt  i;\n\n\n        for ( i = 0; i < size->cvt_size; i++ )\n          size->cvt[i] = FT_MulFix( face->cvt[i], size->ttmetrics.scale );\n        error = tt_size_run_prep( size, pedantic );\n        if ( error )\n          return error;\n      }\n\n      /* see whether the cvt program has disabled hinting */\n      if ( exec->GS.instruct_control & 1 )\n        load_flags |= FT_LOAD_NO_HINTING;\n\n      /* load default graphics state -- if needed */\n      if ( exec->GS.instruct_control & 2 )\n        exec->GS = tt_default_graphics_state;\n\n      exec->pedantic_hinting = FT_BOOL( load_flags & FT_LOAD_PEDANTIC );\n      loader->exec = exec;\n      loader->instructions = exec->glyphIns;\n    }\n\n#endif /* TT_USE_BYTECODE_INTERPRETER */\n\n    /* seek to the beginning of the glyph table -- for Type 42 fonts     */\n    /* the table might be accessed from a Postscript stream or something */\n    /* else...                                                           */\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n\n    if ( face->root.internal->incremental_interface )\n      loader->glyf_offset = 0;\n    else\n\n#endif\n\n    {\n      error = face->goto_table( face, TTAG_glyf, stream, 0 );\n\n      if ( FT_ERR_EQ( error, Table_Missing ) )\n        loader->glyf_offset = 0;\n      else if ( error )\n      {\n        FT_ERROR(( \"tt_loader_init: could not access glyph table\\n\" ));\n        return error;\n      }\n      else\n        loader->glyf_offset = FT_STREAM_POS();\n    }\n\n    /* get face's glyph loader */\n    if ( !glyf_table_only )\n    {\n      FT_GlyphLoader  gloader = glyph->internal->loader;\n\n\n      FT_GlyphLoader_Rewind( gloader );\n      loader->gloader = gloader;\n    }\n\n    loader->load_flags = load_flags;\n\n    loader->face   = (FT_Face)face;\n    loader->size   = (FT_Size)size;\n    loader->glyph  = (FT_GlyphSlot)glyph;\n    loader->stream = stream;\n\n    return FT_Err_Ok;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    TT_Load_Glyph                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to load a single glyph within a given glyph slot,  */\n  /*    for a given size.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    glyph       :: A handle to a target slot object where the glyph    */\n  /*                   will be loaded.                                     */\n  /*                                                                       */\n  /*    size        :: A handle to the source face size at which the glyph */\n  /*                   must be scaled/loaded.                              */\n  /*                                                                       */\n  /*    glyph_index :: The index of the glyph in the font file.            */\n  /*                                                                       */\n  /*    load_flags  :: A flag indicating what to load for this glyph.  The */\n  /*                   FT_LOAD_XXX constants can be used to control the    */\n  /*                   glyph loading process (e.g., whether the outline    */\n  /*                   should be scaled, whether to load bitmaps or not,   */\n  /*                   whether to hint the outline, etc).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  TT_Load_Glyph( TT_Size       size,\n                 TT_GlyphSlot  glyph,\n                 FT_UInt       glyph_index,\n                 FT_Int32      load_flags )\n  {\n    FT_Error      error;\n    TT_LoaderRec  loader;\n\n\n    FT_TRACE1(( \"TT_Load_Glyph: glyph index %d\\n\", glyph_index ));\n\n#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n\n    /* try to load embedded bitmap if any              */\n    /*                                                 */\n    /* XXX: The convention should be emphasized in     */\n    /*      the documents because it can be confusing. */\n    if ( size->strike_index != 0xFFFFFFFFUL      &&\n         ( load_flags & FT_LOAD_NO_BITMAP ) == 0 )\n    {\n      error = load_sbit_image( size, glyph, glyph_index, load_flags );\n      if ( !error )\n      {\n        if ( FT_IS_SCALABLE( glyph->face ) )\n        {\n          /* for the bbox we need the header only */\n          (void)tt_loader_init( &loader, size, glyph, load_flags, TRUE );\n          (void)load_truetype_glyph( &loader, glyph_index, 0, TRUE );\n          glyph->linearHoriAdvance = loader.linear;\n          glyph->linearVertAdvance = loader.vadvance;\n\n          /* sanity checks: if `xxxAdvance' in the sbit metric */\n          /* structure isn't set, use `linearXXXAdvance'      */\n          if ( !glyph->metrics.horiAdvance && glyph->linearHoriAdvance )\n            glyph->metrics.horiAdvance =\n              FT_MulFix( glyph->linearHoriAdvance,\n                         size->root.metrics.x_scale );\n          if ( !glyph->metrics.vertAdvance && glyph->linearVertAdvance )\n            glyph->metrics.vertAdvance =\n              FT_MulFix( glyph->linearVertAdvance,\n                         size->root.metrics.y_scale );\n        }\n\n        return FT_Err_Ok;\n      }\n    }\n\n#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */\n\n    /* if FT_LOAD_NO_SCALE is not set, `ttmetrics' must be valid */\n    if ( !( load_flags & FT_LOAD_NO_SCALE ) && !size->ttmetrics.valid )\n      return FT_THROW( Invalid_Size_Handle );\n\n    if ( load_flags & FT_LOAD_SBITS_ONLY )\n      return FT_THROW( Invalid_Argument );\n\n    error = tt_loader_init( &loader, size, glyph, load_flags, FALSE );\n    if ( error )\n      return error;\n\n    glyph->format        = FT_GLYPH_FORMAT_OUTLINE;\n    glyph->num_subglyphs = 0;\n    glyph->outline.flags = 0;\n\n    /* main loading loop */\n    error = load_truetype_glyph( &loader, glyph_index, 0, FALSE );\n    if ( !error )\n    {\n      if ( glyph->format == FT_GLYPH_FORMAT_COMPOSITE )\n      {\n        glyph->num_subglyphs = loader.gloader->base.num_subglyphs;\n        glyph->subglyphs     = loader.gloader->base.subglyphs;\n      }\n      else\n      {\n        glyph->outline        = loader.gloader->base.outline;\n        glyph->outline.flags &= ~FT_OUTLINE_SINGLE_PASS;\n\n        /* Translate array so that (0,0) is the glyph's origin.  Note  */\n        /* that this behaviour is independent on the value of bit 1 of */\n        /* the `flags' field in the `head' table -- at least major     */\n        /* applications like Acroread indicate that.                   */\n        if ( loader.pp1.x )\n          FT_Outline_Translate( &glyph->outline, -loader.pp1.x, 0 );\n      }\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n\n      if ( IS_HINTED( load_flags ) )\n      {\n        if ( loader.exec->GS.scan_control )\n        {\n          /* convert scan conversion mode to FT_OUTLINE_XXX flags */\n          switch ( loader.exec->GS.scan_type )\n          {\n          case 0: /* simple drop-outs including stubs */\n            glyph->outline.flags |= FT_OUTLINE_INCLUDE_STUBS;\n            break;\n          case 1: /* simple drop-outs excluding stubs */\n            /* nothing; it's the default rendering mode */\n            break;\n          case 4: /* smart drop-outs including stubs */\n            glyph->outline.flags |= FT_OUTLINE_SMART_DROPOUTS |\n                                    FT_OUTLINE_INCLUDE_STUBS;\n            break;\n          case 5: /* smart drop-outs excluding stubs  */\n            glyph->outline.flags |= FT_OUTLINE_SMART_DROPOUTS;\n            break;\n\n          default: /* no drop-out control */\n            glyph->outline.flags |= FT_OUTLINE_IGNORE_DROPOUTS;\n            break;\n          }\n        }\n        else\n          glyph->outline.flags |= FT_OUTLINE_IGNORE_DROPOUTS;\n      }\n\n#endif /* TT_USE_BYTECODE_INTERPRETER */\n\n      error = compute_glyph_metrics( &loader, glyph_index );\n    }\n\n    /* Set the `high precision' bit flag.                           */\n    /* This is _critical_ to get correct output for monochrome      */\n    /* TrueType glyphs at all sizes using the bytecode interpreter. */\n    /*                                                              */\n    if ( !( load_flags & FT_LOAD_NO_SCALE ) &&\n         size->root.metrics.y_ppem < 24     )\n      glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION;\n\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/truetype/ttgload.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttgload.h                                                              */\n/*                                                                         */\n/*    TrueType Glyph Loader (specification).                               */\n/*                                                                         */\n/*  Copyright 1996-2006, 2008, 2011 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTGLOAD_H__\n#define __TTGLOAD_H__\n\n\n#include <ft2build.h>\n#include \"ttobjs.h\"\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n#include \"ttinterp.h\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  FT_LOCAL( void )\n  TT_Init_Glyph_Loading( TT_Face  face );\n\n  FT_LOCAL( void )\n  TT_Get_HMetrics( TT_Face     face,\n                   FT_UInt     idx,\n                   FT_Short*   lsb,\n                   FT_UShort*  aw );\n\n  FT_LOCAL( void )\n  TT_Get_VMetrics( TT_Face     face,\n                   FT_UInt     idx,\n                   FT_Pos      yMax,\n                   FT_Short*   tsb,\n                   FT_UShort*  ah );\n\n  FT_LOCAL( FT_Error )\n  TT_Load_Glyph( TT_Size       size,\n                 TT_GlyphSlot  glyph,\n                 FT_UInt       glyph_index,\n                 FT_Int32      load_flags );\n\n\nFT_END_HEADER\n\n#endif /* __TTGLOAD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/truetype/ttgxvar.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttgxvar.c                                                              */\n/*                                                                         */\n/*    TrueType GX Font Variation loader                                    */\n/*                                                                         */\n/*  Copyright 2004-2014 by                                                 */\n/*  David Turner, Robert Wilhelm, Werner Lemberg, and George Williams.     */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Apple documents the `fvar', `gvar', `cvar', and `avar' tables at      */\n  /*                                                                       */\n  /*   http://developer.apple.com/fonts/TTRefMan/RM06/Chap6[fgca]var.html  */\n  /*                                                                       */\n  /* The documentation for `fvar' is inconsistent.  At one point it says   */\n  /* that `countSizePairs' should be 3, at another point 2.  It should     */\n  /* be 2.                                                                 */\n  /*                                                                       */\n  /* The documentation for `gvar' is not intelligible; `cvar' refers you   */\n  /* to `gvar' and is thus also incomprehensible.                          */\n  /*                                                                       */\n  /* The documentation for `avar' appears correct, but Apple has no fonts  */\n  /* with an `avar' table, so it is hard to test.                          */\n  /*                                                                       */\n  /* Many thanks to John Jenkins (at Apple) in figuring this out.          */\n  /*                                                                       */\n  /*                                                                       */\n  /* Apple's `kern' table has some references to tuple indices, but as     */\n  /* there is no indication where these indices are defined, nor how to    */\n  /* interpolate the kerning values (different tuples have different       */\n  /* classes) this issue is ignored.                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_CONFIG_CONFIG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_SFNT_H\n#include FT_TRUETYPE_TAGS_H\n#include FT_MULTIPLE_MASTERS_H\n\n#include \"ttpload.h\"\n#include \"ttgxvar.h\"\n\n#include \"tterrors.h\"\n\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n\n\n#define FT_Stream_FTell( stream )  \\\n          (FT_ULong)( (stream)->cursor - (stream)->base )\n#define FT_Stream_SeekSet( stream, off ) \\\n          ( (stream)->cursor = (stream)->base + (off) )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_ttgxvar\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       Internal Routines                       *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro ALL_POINTS is used in `ft_var_readpackedpoints'.  It        */\n  /* indicates that there is a delta for every point without needing to    */\n  /* enumerate all of them.                                                */\n  /*                                                                       */\n\n  /* ensure that value `0' has the same width as a pointer */\n#define ALL_POINTS  (FT_UShort*)~(FT_PtrDist)0\n\n\n#define GX_PT_POINTS_ARE_WORDS      0x80\n#define GX_PT_POINT_RUN_COUNT_MASK  0x7F\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    ft_var_readpackedpoints                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Read a set of points to which the following deltas will apply.     */\n  /*    Points are packed with a run length encoding.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream    :: The data stream.                                      */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    point_cnt :: The number of points read.  A zero value means that   */\n  /*                 all points in the glyph will be affected, without     */\n  /*                 enumerating them individually.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    An array of FT_UShort containing the affected points or the        */\n  /*    special value ALL_POINTS.                                          */\n  /*                                                                       */\n  static FT_UShort*\n  ft_var_readpackedpoints( FT_Stream  stream,\n                           FT_UInt   *point_cnt )\n  {\n    FT_UShort *points = NULL;\n    FT_Int     n;\n    FT_Int     runcnt;\n    FT_Int     i;\n    FT_Int     j;\n    FT_Int     first;\n    FT_Memory  memory = stream->memory;\n    FT_Error   error  = FT_Err_Ok;\n\n    FT_UNUSED( error );\n\n\n    *point_cnt = n = FT_GET_BYTE();\n    if ( n == 0 )\n      return ALL_POINTS;\n\n    if ( n & GX_PT_POINTS_ARE_WORDS )\n      n = FT_GET_BYTE() | ( ( n & GX_PT_POINT_RUN_COUNT_MASK ) << 8 );\n\n    if ( FT_NEW_ARRAY( points, n ) )\n      return NULL;\n\n    i = 0;\n    while ( i < n )\n    {\n      runcnt = FT_GET_BYTE();\n      if ( runcnt & GX_PT_POINTS_ARE_WORDS )\n      {\n        runcnt = runcnt & GX_PT_POINT_RUN_COUNT_MASK;\n        first  = points[i++] = FT_GET_USHORT();\n\n        if ( runcnt < 1 || i + runcnt >= n )\n          goto Exit;\n\n        /* first point not included in runcount */\n        for ( j = 0; j < runcnt; ++j )\n          points[i++] = (FT_UShort)( first += FT_GET_USHORT() );\n      }\n      else\n      {\n        first = points[i++] = FT_GET_BYTE();\n\n        if ( runcnt < 1 || i + runcnt >= n )\n          goto Exit;\n\n        for ( j = 0; j < runcnt; ++j )\n          points[i++] = (FT_UShort)( first += FT_GET_BYTE() );\n      }\n    }\n\n  Exit:\n    return points;\n  }\n\n\n  enum\n  {\n    GX_DT_DELTAS_ARE_ZERO      = 0x80,\n    GX_DT_DELTAS_ARE_WORDS     = 0x40,\n    GX_DT_DELTA_RUN_COUNT_MASK = 0x3F\n  };\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    ft_var_readpackeddeltas                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Read a set of deltas.  These are packed slightly differently than  */\n  /*    points.  In particular there is no overall count.                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream    :: The data stream.                                      */\n  /*                                                                       */\n  /*    delta_cnt :: The number of to be read.                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    An array of FT_Short containing the deltas for the affected        */\n  /*    points.  (This only gets the deltas for one dimension.  It will    */\n  /*    generally be called twice, once for x, once for y.  When used in   */\n  /*    cvt table, it will only be called once.)                           */\n  /*                                                                       */\n  static FT_Short*\n  ft_var_readpackeddeltas( FT_Stream  stream,\n                           FT_Offset  delta_cnt )\n  {\n    FT_Short  *deltas = NULL;\n    FT_UInt    runcnt;\n    FT_Offset  i;\n    FT_UInt    j;\n    FT_Memory  memory = stream->memory;\n    FT_Error   error  = FT_Err_Ok;\n\n    FT_UNUSED( error );\n\n\n    if ( FT_NEW_ARRAY( deltas, delta_cnt ) )\n      return NULL;\n\n    i = 0;\n    while ( i < delta_cnt )\n    {\n      runcnt = FT_GET_BYTE();\n      if ( runcnt & GX_DT_DELTAS_ARE_ZERO )\n      {\n        /* runcnt zeroes get added */\n        for ( j = 0;\n              j <= ( runcnt & GX_DT_DELTA_RUN_COUNT_MASK ) && i < delta_cnt;\n              ++j )\n          deltas[i++] = 0;\n      }\n      else if ( runcnt & GX_DT_DELTAS_ARE_WORDS )\n      {\n        /* runcnt shorts from the stack */\n        for ( j = 0;\n              j <= ( runcnt & GX_DT_DELTA_RUN_COUNT_MASK ) && i < delta_cnt;\n              ++j )\n          deltas[i++] = FT_GET_SHORT();\n      }\n      else\n      {\n        /* runcnt signed bytes from the stack */\n        for ( j = 0;\n              j <= ( runcnt & GX_DT_DELTA_RUN_COUNT_MASK ) && i < delta_cnt;\n              ++j )\n          deltas[i++] = FT_GET_CHAR();\n      }\n\n      if ( j <= ( runcnt & GX_DT_DELTA_RUN_COUNT_MASK ) )\n      {\n        /* Bad format */\n        FT_FREE( deltas );\n        return NULL;\n      }\n    }\n\n    return deltas;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    ft_var_load_avar                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Parse the `avar' table if present.  It need not be, so we return   */\n  /*    nothing.                                                           */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face :: The font face.                                             */\n  /*                                                                       */\n  static void\n  ft_var_load_avar( TT_Face  face )\n  {\n    FT_Stream       stream = FT_FACE_STREAM(face);\n    FT_Memory       memory = stream->memory;\n    GX_Blend        blend  = face->blend;\n    GX_AVarSegment  segment;\n    FT_Error        error = FT_Err_Ok;\n    FT_ULong        version;\n    FT_Long         axisCount;\n    FT_Int          i, j;\n    FT_ULong        table_len;\n\n    FT_UNUSED( error );\n\n\n    blend->avar_checked = TRUE;\n    if ( (error = face->goto_table( face, TTAG_avar, stream, &table_len )) != 0 )\n      return;\n\n    if ( FT_FRAME_ENTER( table_len ) )\n      return;\n\n    version   = FT_GET_LONG();\n    axisCount = FT_GET_LONG();\n\n    if ( version != 0x00010000L                       ||\n         axisCount != (FT_Long)blend->mmvar->num_axis )\n      goto Exit;\n\n    if ( FT_NEW_ARRAY( blend->avar_segment, axisCount ) )\n      goto Exit;\n\n    segment = &blend->avar_segment[0];\n    for ( i = 0; i < axisCount; ++i, ++segment )\n    {\n      segment->pairCount = FT_GET_USHORT();\n      if ( FT_NEW_ARRAY( segment->correspondence, segment->pairCount ) )\n      {\n        /* Failure.  Free everything we have done so far.  We must do */\n        /* it right now since loading the `avar' table is optional.   */\n\n        for ( j = i - 1; j >= 0; --j )\n          FT_FREE( blend->avar_segment[j].correspondence );\n\n        FT_FREE( blend->avar_segment );\n        blend->avar_segment = NULL;\n        goto Exit;\n      }\n\n      for ( j = 0; j < segment->pairCount; ++j )\n      {\n        segment->correspondence[j].fromCoord =\n          FT_GET_SHORT() << 2;    /* convert to Fixed */\n        segment->correspondence[j].toCoord =\n          FT_GET_SHORT()<<2;    /* convert to Fixed */\n      }\n    }\n\n  Exit:\n    FT_FRAME_EXIT();\n  }\n\n\n  typedef struct  GX_GVar_Head_\n  {\n    FT_Long    version;\n    FT_UShort  axisCount;\n    FT_UShort  globalCoordCount;\n    FT_ULong   offsetToCoord;\n    FT_UShort  glyphCount;\n    FT_UShort  flags;\n    FT_ULong   offsetToData;\n\n  } GX_GVar_Head;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    ft_var_load_gvar                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Parses the `gvar' table if present.  If `fvar' is there, `gvar'    */\n  /*    had better be there too.                                           */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face :: The font face.                                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  static FT_Error\n  ft_var_load_gvar( TT_Face  face )\n  {\n    FT_Stream     stream = FT_FACE_STREAM(face);\n    FT_Memory     memory = stream->memory;\n    GX_Blend      blend  = face->blend;\n    FT_Error      error;\n    FT_UInt       i, j;\n    FT_ULong      table_len;\n    FT_ULong      gvar_start;\n    FT_ULong      offsetToData;\n    GX_GVar_Head  gvar_head;\n\n    static const FT_Frame_Field  gvar_fields[] =\n    {\n\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  GX_GVar_Head\n\n      FT_FRAME_START( 20 ),\n        FT_FRAME_LONG  ( version ),\n        FT_FRAME_USHORT( axisCount ),\n        FT_FRAME_USHORT( globalCoordCount ),\n        FT_FRAME_ULONG ( offsetToCoord ),\n        FT_FRAME_USHORT( glyphCount ),\n        FT_FRAME_USHORT( flags ),\n        FT_FRAME_ULONG ( offsetToData ),\n      FT_FRAME_END\n    };\n\n    if ( (error = face->goto_table( face, TTAG_gvar, stream, &table_len )) != 0 )\n      goto Exit;\n\n    gvar_start = FT_STREAM_POS( );\n    if ( FT_STREAM_READ_FIELDS( gvar_fields, &gvar_head ) )\n      goto Exit;\n\n    blend->tuplecount  = gvar_head.globalCoordCount;\n    blend->gv_glyphcnt = gvar_head.glyphCount;\n    offsetToData       = gvar_start + gvar_head.offsetToData;\n\n    if ( gvar_head.version   != (FT_Long)0x00010000L              ||\n         gvar_head.axisCount != (FT_UShort)blend->mmvar->num_axis )\n    {\n      error = FT_THROW( Invalid_Table );\n      goto Exit;\n    }\n\n    if ( FT_NEW_ARRAY( blend->glyphoffsets, blend->gv_glyphcnt + 1 ) )\n      goto Exit;\n\n    if ( gvar_head.flags & 1 )\n    {\n      /* long offsets (one more offset than glyphs, to mark size of last) */\n      if ( FT_FRAME_ENTER( ( blend->gv_glyphcnt + 1 ) * 4L ) )\n        goto Exit;\n\n      for ( i = 0; i <= blend->gv_glyphcnt; ++i )\n        blend->glyphoffsets[i] = offsetToData + FT_GET_LONG();\n\n      FT_FRAME_EXIT();\n    }\n    else\n    {\n      /* short offsets (one more offset than glyphs, to mark size of last) */\n      if ( FT_FRAME_ENTER( ( blend->gv_glyphcnt + 1 ) * 2L ) )\n        goto Exit;\n\n      for ( i = 0; i <= blend->gv_glyphcnt; ++i )\n        blend->glyphoffsets[i] = offsetToData + FT_GET_USHORT() * 2;\n                                              /* XXX: Undocumented: `*2'! */\n\n      FT_FRAME_EXIT();\n    }\n\n    if ( blend->tuplecount != 0 )\n    {\n      if ( FT_NEW_ARRAY( blend->tuplecoords,\n                         gvar_head.axisCount * blend->tuplecount ) )\n        goto Exit;\n\n      if ( FT_STREAM_SEEK( gvar_start + gvar_head.offsetToCoord )       ||\n           FT_FRAME_ENTER( blend->tuplecount * gvar_head.axisCount * 2L )                   )\n        goto Exit;\n\n      for ( i = 0; i < blend->tuplecount; ++i )\n        for ( j = 0 ; j < (FT_UInt)gvar_head.axisCount; ++j )\n          blend->tuplecoords[i * gvar_head.axisCount + j] =\n            FT_GET_SHORT() << 2;                /* convert to FT_Fixed */\n\n      FT_FRAME_EXIT();\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    ft_var_apply_tuple                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Figure out whether a given tuple (design) applies to the current   */\n  /*    blend, and if so, what is the scaling factor.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    blend           :: The current blend of the font.                  */\n  /*                                                                       */\n  /*    tupleIndex      :: A flag saying whether this is an intermediate   */\n  /*                       tuple or not.                                   */\n  /*                                                                       */\n  /*    tuple_coords    :: The coordinates of the tuple in normalized axis */\n  /*                       units.                                          */\n  /*                                                                       */\n  /*    im_start_coords :: The initial coordinates where this tuple starts */\n  /*                       to apply (for intermediate coordinates).        */\n  /*                                                                       */\n  /*    im_end_coords   :: The final coordinates after which this tuple no */\n  /*                       longer applies (for intermediate coordinates).  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    An FT_Fixed value containing the scaling factor.                   */\n  /*                                                                       */\n  static FT_Fixed\n  ft_var_apply_tuple( GX_Blend   blend,\n                      FT_UShort  tupleIndex,\n                      FT_Fixed*  tuple_coords,\n                      FT_Fixed*  im_start_coords,\n                      FT_Fixed*  im_end_coords )\n  {\n    FT_UInt   i;\n    FT_Fixed  apply = 0x10000L;\n\n\n    for ( i = 0; i < blend->num_axis; ++i )\n    {\n      if ( tuple_coords[i] == 0 )\n        /* It's not clear why (for intermediate tuples) we don't need     */\n        /* to check against start/end -- the documentation says we don't. */\n        /* Similarly, it's unclear why we don't need to scale along the   */\n        /* axis.                                                          */\n        continue;\n\n      else if ( blend->normalizedcoords[i] == 0                           ||\n                ( blend->normalizedcoords[i] < 0 && tuple_coords[i] > 0 ) ||\n                ( blend->normalizedcoords[i] > 0 && tuple_coords[i] < 0 ) )\n      {\n        apply = 0;\n        break;\n      }\n\n      else if ( !( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) )\n        /* not an intermediate tuple */\n        apply = FT_MulFix( apply,\n                           blend->normalizedcoords[i] > 0\n                             ? blend->normalizedcoords[i]\n                             : -blend->normalizedcoords[i] );\n\n      else if ( blend->normalizedcoords[i] <= im_start_coords[i] ||\n                blend->normalizedcoords[i] >= im_end_coords[i]   )\n      {\n        apply = 0;\n        break;\n      }\n\n      else if ( blend->normalizedcoords[i] < tuple_coords[i] )\n        apply = FT_MulDiv( apply,\n                           blend->normalizedcoords[i] - im_start_coords[i],\n                           tuple_coords[i] - im_start_coords[i] );\n\n      else\n        apply = FT_MulDiv( apply,\n                           im_end_coords[i] - blend->normalizedcoords[i],\n                           im_end_coords[i] - tuple_coords[i] );\n    }\n\n    return apply;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****               MULTIPLE MASTERS SERVICE FUNCTIONS              *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  typedef struct  GX_FVar_Head_\n  {\n    FT_Long    version;\n    FT_UShort  offsetToData;\n    FT_UShort  countSizePairs;\n    FT_UShort  axisCount;\n    FT_UShort  axisSize;\n    FT_UShort  instanceCount;\n    FT_UShort  instanceSize;\n\n  } GX_FVar_Head;\n\n\n  typedef struct  fvar_axis_\n  {\n    FT_ULong   axisTag;\n    FT_ULong   minValue;\n    FT_ULong   defaultValue;\n    FT_ULong   maxValue;\n    FT_UShort  flags;\n    FT_UShort  nameID;\n\n  } GX_FVar_Axis;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    TT_Get_MM_Var                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Check that the font's `fvar' table is valid, parse it, and return  */\n  /*    those data.                                                        */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face   :: The font face.                                           */\n  /*              TT_Get_MM_Var initializes the blend structure.           */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    master :: The `fvar' data (must be freed by caller).               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  TT_Get_MM_Var( TT_Face      face,\n                 FT_MM_Var*  *master )\n  {\n    FT_Stream            stream = face->root.stream;\n    FT_Memory            memory = face->root.memory;\n    FT_ULong             table_len;\n    FT_Error             error  = FT_Err_Ok;\n    FT_ULong             fvar_start;\n    FT_Int               i, j;\n    FT_MM_Var*           mmvar = NULL;\n    FT_Fixed*            next_coords;\n    FT_String*           next_name;\n    FT_Var_Axis*         a;\n    FT_Var_Named_Style*  ns;\n    GX_FVar_Head         fvar_head;\n\n    static const FT_Frame_Field  fvar_fields[] =\n    {\n\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  GX_FVar_Head\n\n      FT_FRAME_START( 16 ),\n        FT_FRAME_LONG  ( version ),\n        FT_FRAME_USHORT( offsetToData ),\n        FT_FRAME_USHORT( countSizePairs ),\n        FT_FRAME_USHORT( axisCount ),\n        FT_FRAME_USHORT( axisSize ),\n        FT_FRAME_USHORT( instanceCount ),\n        FT_FRAME_USHORT( instanceSize ),\n      FT_FRAME_END\n    };\n\n    static const FT_Frame_Field  fvaraxis_fields[] =\n    {\n\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  GX_FVar_Axis\n\n      FT_FRAME_START( 20 ),\n        FT_FRAME_ULONG ( axisTag ),\n        FT_FRAME_ULONG ( minValue ),\n        FT_FRAME_ULONG ( defaultValue ),\n        FT_FRAME_ULONG ( maxValue ),\n        FT_FRAME_USHORT( flags ),\n        FT_FRAME_USHORT( nameID ),\n      FT_FRAME_END\n    };\n\n\n    if ( face->blend == NULL )\n    {\n      /* both `fvar' and `gvar' must be present */\n      if ( (error = face->goto_table( face, TTAG_gvar,\n                                      stream, &table_len )) != 0 )\n        goto Exit;\n\n      if ( (error = face->goto_table( face, TTAG_fvar,\n                                      stream, &table_len )) != 0 )\n        goto Exit;\n\n      fvar_start = FT_STREAM_POS( );\n\n      if ( FT_STREAM_READ_FIELDS( fvar_fields, &fvar_head ) )\n        goto Exit;\n\n      if ( fvar_head.version != (FT_Long)0x00010000L                      ||\n           fvar_head.countSizePairs != 2                                  ||\n           fvar_head.axisSize != 20                                       ||\n           /* axisCount limit implied by 16-bit instanceSize */\n           fvar_head.axisCount > 0x3FFE                                   ||\n           fvar_head.instanceSize != 4 + 4 * fvar_head.axisCount          ||\n           /* instanceCount limit implied by limited range of name IDs */\n           fvar_head.instanceCount > 0x7EFF                               ||\n           fvar_head.offsetToData + fvar_head.axisCount * 20U +\n             fvar_head.instanceCount * fvar_head.instanceSize > table_len )\n      {\n        error = FT_THROW( Invalid_Table );\n        goto Exit;\n      }\n\n      if ( FT_NEW( face->blend ) )\n        goto Exit;\n\n      /* cannot overflow 32-bit arithmetic because of limits above */\n      face->blend->mmvar_len =\n        sizeof ( FT_MM_Var ) +\n        fvar_head.axisCount * sizeof ( FT_Var_Axis ) +\n        fvar_head.instanceCount * sizeof ( FT_Var_Named_Style ) +\n        fvar_head.instanceCount * fvar_head.axisCount * sizeof ( FT_Fixed ) +\n        5 * fvar_head.axisCount;\n\n      if ( FT_ALLOC( mmvar, face->blend->mmvar_len ) )\n        goto Exit;\n      face->blend->mmvar = mmvar;\n\n      mmvar->num_axis =\n        fvar_head.axisCount;\n      mmvar->num_designs =\n        ~0U;                   /* meaningless in this context; each glyph */\n                               /* may have a different number of designs  */\n                               /* (or tuples, as called by Apple)         */\n      mmvar->num_namedstyles =\n        fvar_head.instanceCount;\n      mmvar->axis =\n        (FT_Var_Axis*)&(mmvar[1]);\n      mmvar->namedstyle =\n        (FT_Var_Named_Style*)&(mmvar->axis[fvar_head.axisCount]);\n\n      next_coords =\n        (FT_Fixed*)&(mmvar->namedstyle[fvar_head.instanceCount]);\n      for ( i = 0; i < fvar_head.instanceCount; ++i )\n      {\n        mmvar->namedstyle[i].coords  = next_coords;\n        next_coords                 += fvar_head.axisCount;\n      }\n\n      next_name = (FT_String*)next_coords;\n      for ( i = 0; i < fvar_head.axisCount; ++i )\n      {\n        mmvar->axis[i].name  = next_name;\n        next_name           += 5;\n      }\n\n      if ( FT_STREAM_SEEK( fvar_start + fvar_head.offsetToData ) )\n        goto Exit;\n\n      a = mmvar->axis;\n      for ( i = 0; i < fvar_head.axisCount; ++i )\n      {\n        GX_FVar_Axis  axis_rec;\n\n\n        if ( FT_STREAM_READ_FIELDS( fvaraxis_fields, &axis_rec ) )\n          goto Exit;\n        a->tag     = axis_rec.axisTag;\n        a->minimum = axis_rec.minValue;     /* A Fixed */\n        a->def     = axis_rec.defaultValue; /* A Fixed */\n        a->maximum = axis_rec.maxValue;     /* A Fixed */\n        a->strid   = axis_rec.nameID;\n\n        a->name[0] = (FT_String)(   a->tag >> 24 );\n        a->name[1] = (FT_String)( ( a->tag >> 16 ) & 0xFF );\n        a->name[2] = (FT_String)( ( a->tag >>  8 ) & 0xFF );\n        a->name[3] = (FT_String)( ( a->tag       ) & 0xFF );\n        a->name[4] = 0;\n\n        ++a;\n      }\n\n      ns = mmvar->namedstyle;\n      for ( i = 0; i < fvar_head.instanceCount; ++i, ++ns )\n      {\n        if ( FT_FRAME_ENTER( 4L + 4L * fvar_head.axisCount ) )\n          goto Exit;\n\n        ns->strid       =    FT_GET_USHORT();\n        (void) /* flags = */ FT_GET_USHORT();\n\n        for ( j = 0; j < fvar_head.axisCount; ++j )\n          ns->coords[j] = FT_GET_ULONG();     /* A Fixed */\n\n        FT_FRAME_EXIT();\n      }\n    }\n\n    if ( master != NULL )\n    {\n      FT_UInt  n;\n\n\n      if ( FT_ALLOC( mmvar, face->blend->mmvar_len ) )\n        goto Exit;\n      FT_MEM_COPY( mmvar, face->blend->mmvar, face->blend->mmvar_len );\n\n      mmvar->axis =\n        (FT_Var_Axis*)&(mmvar[1]);\n      mmvar->namedstyle =\n        (FT_Var_Named_Style*)&(mmvar->axis[mmvar->num_axis]);\n      next_coords =\n        (FT_Fixed*)&(mmvar->namedstyle[mmvar->num_namedstyles]);\n\n      for ( n = 0; n < mmvar->num_namedstyles; ++n )\n      {\n        mmvar->namedstyle[n].coords  = next_coords;\n        next_coords                 += mmvar->num_axis;\n      }\n\n      a = mmvar->axis;\n      next_name = (FT_String*)next_coords;\n      for ( n = 0; n < mmvar->num_axis; ++n )\n      {\n        a->name = next_name;\n\n        /* standard PostScript names for some standard apple tags */\n        if ( a->tag == TTAG_wght )\n          a->name = (char *)\"Weight\";\n        else if ( a->tag == TTAG_wdth )\n          a->name = (char *)\"Width\";\n        else if ( a->tag == TTAG_opsz )\n          a->name = (char *)\"OpticalSize\";\n        else if ( a->tag == TTAG_slnt )\n          a->name = (char *)\"Slant\";\n\n        next_name += 5;\n        ++a;\n      }\n\n      *master = mmvar;\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    TT_Set_MM_Blend                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Set the blend (normalized) coordinates for this instance of the    */\n  /*    font.  Check that the `gvar' table is reasonable and does some     */\n  /*    initial preparation.                                               */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: The font.                                            */\n  /*                  Initialize the blend structure with `gvar' data.     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: Must be the axis count of the font.                  */\n  /*                                                                       */\n  /*    coords     :: An array of num_coords, each between [-1,1].         */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  TT_Set_MM_Blend( TT_Face    face,\n                   FT_UInt    num_coords,\n                   FT_Fixed*  coords )\n  {\n    FT_Error    error = FT_Err_Ok;\n    GX_Blend    blend;\n    FT_MM_Var*  mmvar;\n    FT_UInt     i;\n    FT_Memory   memory = face->root.memory;\n\n    enum\n    {\n      mcvt_retain,\n      mcvt_modify,\n      mcvt_load\n\n    } manageCvt;\n\n\n    face->doblend = FALSE;\n\n    if ( face->blend == NULL )\n    {\n      if ( (error = TT_Get_MM_Var( face, NULL)) != 0 )\n        goto Exit;\n    }\n\n    blend = face->blend;\n    mmvar = blend->mmvar;\n\n    if ( num_coords != mmvar->num_axis )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    for ( i = 0; i < num_coords; ++i )\n      if ( coords[i] < -0x00010000L || coords[i] > 0x00010000L )\n      {\n        error = FT_THROW( Invalid_Argument );\n        goto Exit;\n      }\n\n    if ( blend->glyphoffsets == NULL )\n      if ( (error = ft_var_load_gvar( face )) != 0 )\n        goto Exit;\n\n    if ( blend->normalizedcoords == NULL )\n    {\n      if ( FT_NEW_ARRAY( blend->normalizedcoords, num_coords ) )\n        goto Exit;\n\n      manageCvt = mcvt_modify;\n\n      /* If we have not set the blend coordinates before this, then the  */\n      /* cvt table will still be what we read from the `cvt ' table and  */\n      /* we don't need to reload it.  We may need to change it though... */\n    }\n    else\n    {\n      manageCvt = mcvt_retain;\n      for ( i = 0; i < num_coords; ++i )\n      {\n        if ( blend->normalizedcoords[i] != coords[i] )\n        {\n          manageCvt = mcvt_load;\n          break;\n        }\n      }\n\n      /* If we don't change the blend coords then we don't need to do  */\n      /* anything to the cvt table.  It will be correct.  Otherwise we */\n      /* no longer have the original cvt (it was modified when we set  */\n      /* the blend last time), so we must reload and then modify it.   */\n    }\n\n    blend->num_axis = num_coords;\n    FT_MEM_COPY( blend->normalizedcoords,\n                 coords,\n                 num_coords * sizeof ( FT_Fixed ) );\n\n    face->doblend = TRUE;\n\n    if ( face->cvt != NULL )\n    {\n      switch ( manageCvt )\n      {\n      case mcvt_load:\n        /* The cvt table has been loaded already; every time we change the */\n        /* blend we may need to reload and remodify the cvt table.         */\n        FT_FREE( face->cvt );\n        face->cvt = NULL;\n\n        error = tt_face_load_cvt( face, face->root.stream );\n        break;\n\n      case mcvt_modify:\n        /* The original cvt table is in memory.  All we need to do is */\n        /* apply the `cvar' table (if any).                           */\n        error = tt_face_vary_cvt( face, face->root.stream );\n        break;\n\n      case mcvt_retain:\n        /* The cvt table is correct for this set of coordinates. */\n        break;\n      }\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    TT_Set_Var_Design                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Set the coordinates for the instance, measured in the user         */\n  /*    coordinate system.  Parse the `avar' table (if present) to convert */\n  /*    from user to normalized coordinates.                               */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: The font face.                                       */\n  /*                  Initialize the blend struct with `gvar' data.        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: This must be the axis count of the font.             */\n  /*                                                                       */\n  /*    coords     :: A coordinate array with `num_coords' elements.       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  TT_Set_Var_Design( TT_Face    face,\n                     FT_UInt    num_coords,\n                     FT_Fixed*  coords )\n  {\n    FT_Error        error      = FT_Err_Ok;\n    FT_Fixed*       normalized = NULL;\n    GX_Blend        blend;\n    FT_MM_Var*      mmvar;\n    FT_UInt         i, j;\n    FT_Var_Axis*    a;\n    GX_AVarSegment  av;\n    FT_Memory       memory = face->root.memory;\n\n\n    if ( face->blend == NULL )\n    {\n      if ( (error = TT_Get_MM_Var( face, NULL )) != 0 )\n        goto Exit;\n    }\n\n    blend = face->blend;\n    mmvar = blend->mmvar;\n\n    if ( num_coords != mmvar->num_axis )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    /* Axis normalization is a two stage process.  First we normalize */\n    /* based on the [min,def,max] values for the axis to be [-1,0,1]. */\n    /* Then, if there's an `avar' table, we renormalize this range.   */\n\n    if ( FT_NEW_ARRAY( normalized, mmvar->num_axis ) )\n      goto Exit;\n\n    a = mmvar->axis;\n    for ( i = 0; i < mmvar->num_axis; ++i, ++a )\n    {\n      if ( coords[i] > a->maximum || coords[i] < a->minimum )\n      {\n        error = FT_THROW( Invalid_Argument );\n        goto Exit;\n      }\n\n      if ( coords[i] < a->def )\n        normalized[i] = -FT_DivFix( coords[i] - a->def, a->minimum - a->def );\n      else if ( a->maximum == a->def )\n        normalized[i] = 0;\n      else\n        normalized[i] = FT_DivFix( coords[i] - a->def, a->maximum - a->def );\n    }\n\n    if ( !blend->avar_checked )\n      ft_var_load_avar( face );\n\n    if ( blend->avar_segment != NULL )\n    {\n      av = blend->avar_segment;\n      for ( i = 0; i < mmvar->num_axis; ++i, ++av )\n      {\n        for ( j = 1; j < (FT_UInt)av->pairCount; ++j )\n          if ( normalized[i] < av->correspondence[j].fromCoord )\n          {\n            normalized[i] =\n              FT_MulDiv( normalized[i] - av->correspondence[j - 1].fromCoord,\n                         av->correspondence[j].toCoord -\n                           av->correspondence[j - 1].toCoord,\n                         av->correspondence[j].fromCoord -\n                           av->correspondence[j - 1].fromCoord ) +\n              av->correspondence[j - 1].toCoord;\n            break;\n          }\n      }\n    }\n\n    error = TT_Set_MM_Blend( face, num_coords, normalized );\n\n  Exit:\n    FT_FREE( normalized );\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                     GX VAR PARSING ROUTINES                   *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_vary_cvt                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Modify the loaded cvt table according to the `cvar' table and the  */\n  /*    font's blend.                                                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream :: A handle to the input stream.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /*    Most errors are ignored.  It is perfectly valid not to have a      */\n  /*    `cvar' table even if there is a `gvar' and `fvar' table.           */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_vary_cvt( TT_Face    face,\n                    FT_Stream  stream )\n  {\n    FT_Error    error;\n    FT_Memory   memory = stream->memory;\n    FT_ULong    table_start;\n    FT_ULong    table_len;\n    FT_UInt     tupleCount;\n    FT_ULong    offsetToData;\n    FT_ULong    here;\n    FT_UInt     i, j;\n    FT_Fixed*   tuple_coords    = NULL;\n    FT_Fixed*   im_start_coords = NULL;\n    FT_Fixed*   im_end_coords   = NULL;\n    GX_Blend    blend           = face->blend;\n    FT_UInt     point_count;\n    FT_UShort*  localpoints;\n    FT_Short*   deltas;\n\n\n    FT_TRACE2(( \"CVAR \" ));\n\n    if ( blend == NULL )\n    {\n      FT_TRACE2(( \"tt_face_vary_cvt: no blend specified\\n\" ));\n\n      error = FT_Err_Ok;\n      goto Exit;\n    }\n\n    if ( face->cvt == NULL )\n    {\n      FT_TRACE2(( \"tt_face_vary_cvt: no `cvt ' table\\n\" ));\n\n      error = FT_Err_Ok;\n      goto Exit;\n    }\n\n    error = face->goto_table( face, TTAG_cvar, stream, &table_len );\n    if ( error )\n    {\n      FT_TRACE2(( \"is missing\\n\" ));\n\n      error = FT_Err_Ok;\n      goto Exit;\n    }\n\n    if ( FT_FRAME_ENTER( table_len ) )\n    {\n      error = FT_Err_Ok;\n      goto Exit;\n    }\n\n    table_start = FT_Stream_FTell( stream );\n    if ( FT_GET_LONG() != 0x00010000L )\n    {\n      FT_TRACE2(( \"bad table version\\n\" ));\n\n      error = FT_Err_Ok;\n      goto FExit;\n    }\n\n    if ( FT_NEW_ARRAY( tuple_coords, blend->num_axis )    ||\n         FT_NEW_ARRAY( im_start_coords, blend->num_axis ) ||\n         FT_NEW_ARRAY( im_end_coords, blend->num_axis )   )\n      goto FExit;\n\n    tupleCount   = FT_GET_USHORT();\n    offsetToData = table_start + FT_GET_USHORT();\n\n    /* The documentation implies there are flags packed into the        */\n    /* tuplecount, but John Jenkins says that shared points don't apply */\n    /* to `cvar', and no other flags are defined.                       */\n\n    for ( i = 0; i < ( tupleCount & 0xFFF ); ++i )\n    {\n      FT_UInt   tupleDataSize;\n      FT_UInt   tupleIndex;\n      FT_Fixed  apply;\n\n\n      tupleDataSize = FT_GET_USHORT();\n      tupleIndex    = FT_GET_USHORT();\n\n      /* There is no provision here for a global tuple coordinate section, */\n      /* so John says.  There are no tuple indices, just embedded tuples.  */\n\n      if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD )\n      {\n        for ( j = 0; j < blend->num_axis; ++j )\n          tuple_coords[j] = FT_GET_SHORT() << 2; /* convert from        */\n                                                 /* short frac to fixed */\n      }\n      else\n      {\n        /* skip this tuple; it makes no sense */\n\n        if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE )\n          for ( j = 0; j < 2 * blend->num_axis; ++j )\n            (void)FT_GET_SHORT();\n\n        offsetToData += tupleDataSize;\n        continue;\n      }\n\n      if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE )\n      {\n        for ( j = 0; j < blend->num_axis; ++j )\n          im_start_coords[j] = FT_GET_SHORT() << 2;\n        for ( j = 0; j < blend->num_axis; ++j )\n          im_end_coords[j] = FT_GET_SHORT() << 2;\n      }\n\n      apply = ft_var_apply_tuple( blend,\n                                  (FT_UShort)tupleIndex,\n                                  tuple_coords,\n                                  im_start_coords,\n                                  im_end_coords );\n      if ( /* tuple isn't active for our blend */\n           apply == 0                                    ||\n           /* global points not allowed,           */\n           /* if they aren't local, makes no sense */\n           !( tupleIndex & GX_TI_PRIVATE_POINT_NUMBERS ) )\n      {\n        offsetToData += tupleDataSize;\n        continue;\n      }\n\n      here = FT_Stream_FTell( stream );\n\n      FT_Stream_SeekSet( stream, offsetToData );\n\n      localpoints = ft_var_readpackedpoints( stream, &point_count );\n      deltas      = ft_var_readpackeddeltas( stream,\n                                             point_count == 0 ? face->cvt_size\n                                                              : point_count );\n      if ( localpoints == NULL || deltas == NULL )\n        /* failure, ignore it */;\n\n      else if ( localpoints == ALL_POINTS )\n      {\n        /* this means that there are deltas for every entry in cvt */\n        for ( j = 0; j < face->cvt_size; ++j )\n          face->cvt[j] = (FT_Short)( face->cvt[j] +\n                                     FT_MulFix( deltas[j], apply ) );\n      }\n\n      else\n      {\n        for ( j = 0; j < point_count; ++j )\n        {\n          int  pindex = localpoints[j];\n\n          face->cvt[pindex] = (FT_Short)( face->cvt[pindex] +\n                                          FT_MulFix( deltas[j], apply ) );\n        }\n      }\n\n      if ( localpoints != ALL_POINTS )\n        FT_FREE( localpoints );\n      FT_FREE( deltas );\n\n      offsetToData += tupleDataSize;\n\n      FT_Stream_SeekSet( stream, here );\n    }\n\n  FExit:\n    FT_FRAME_EXIT();\n\n  Exit:\n    FT_FREE( tuple_coords );\n    FT_FREE( im_start_coords );\n    FT_FREE( im_end_coords );\n\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    TT_Vary_Get_Glyph_Deltas                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load the appropriate deltas for the current glyph.                 */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to the target face object.                 */\n  /*                                                                       */\n  /*    glyph_index :: The index of the glyph being modified.              */\n  /*                                                                       */\n  /*    n_points    :: The number of the points in the glyph, including    */\n  /*                   phantom points.                                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    deltas      :: The array of points to change.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  TT_Vary_Get_Glyph_Deltas( TT_Face      face,\n                            FT_UInt      glyph_index,\n                            FT_Vector*  *deltas,\n                            FT_UInt      n_points )\n  {\n    FT_Stream   stream = face->root.stream;\n    FT_Memory   memory = stream->memory;\n    GX_Blend    blend  = face->blend;\n    FT_Vector*  delta_xy = NULL;\n\n    FT_Error    error;\n    FT_ULong    glyph_start;\n    FT_UInt     tupleCount;\n    FT_ULong    offsetToData;\n    FT_ULong    here;\n    FT_UInt     i, j;\n    FT_Fixed*   tuple_coords    = NULL;\n    FT_Fixed*   im_start_coords = NULL;\n    FT_Fixed*   im_end_coords   = NULL;\n    FT_UInt     point_count, spoint_count = 0;\n    FT_UShort*  sharedpoints = NULL;\n    FT_UShort*  localpoints  = NULL;\n    FT_UShort*  points;\n    FT_Short    *deltas_x, *deltas_y;\n\n\n    if ( !face->doblend || blend == NULL )\n      return FT_THROW( Invalid_Argument );\n\n    /* to be freed by the caller */\n    if ( FT_NEW_ARRAY( delta_xy, n_points ) )\n      goto Exit;\n    *deltas = delta_xy;\n\n    if ( glyph_index >= blend->gv_glyphcnt      ||\n         blend->glyphoffsets[glyph_index] ==\n           blend->glyphoffsets[glyph_index + 1] )\n      return FT_Err_Ok;               /* no variation data for this glyph */\n\n    if ( FT_STREAM_SEEK( blend->glyphoffsets[glyph_index] )   ||\n         FT_FRAME_ENTER( blend->glyphoffsets[glyph_index + 1] -\n                           blend->glyphoffsets[glyph_index] ) )\n      goto Fail1;\n\n    glyph_start = FT_Stream_FTell( stream );\n\n    /* each set of glyph variation data is formatted similarly to `cvar' */\n    /* (except we get shared points and global tuples)                   */\n\n    if ( FT_NEW_ARRAY( tuple_coords, blend->num_axis )    ||\n         FT_NEW_ARRAY( im_start_coords, blend->num_axis ) ||\n         FT_NEW_ARRAY( im_end_coords, blend->num_axis )   )\n      goto Fail2;\n\n    tupleCount   = FT_GET_USHORT();\n    offsetToData = glyph_start + FT_GET_USHORT();\n\n    if ( tupleCount & GX_TC_TUPLES_SHARE_POINT_NUMBERS )\n    {\n      here = FT_Stream_FTell( stream );\n\n      FT_Stream_SeekSet( stream, offsetToData );\n\n      sharedpoints = ft_var_readpackedpoints( stream, &spoint_count );\n      offsetToData = FT_Stream_FTell( stream );\n\n      FT_Stream_SeekSet( stream, here );\n    }\n\n    for ( i = 0; i < ( tupleCount & GX_TC_TUPLE_COUNT_MASK ); ++i )\n    {\n      FT_UInt   tupleDataSize;\n      FT_UInt   tupleIndex;\n      FT_Fixed  apply;\n\n\n      tupleDataSize = FT_GET_USHORT();\n      tupleIndex    = FT_GET_USHORT();\n\n      if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD )\n      {\n        for ( j = 0; j < blend->num_axis; ++j )\n          tuple_coords[j] = FT_GET_SHORT() << 2;  /* convert from        */\n                                                  /* short frac to fixed */\n      }\n      else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) >= blend->tuplecount )\n      {\n        error = FT_THROW( Invalid_Table );\n        goto Fail3;\n      }\n      else\n      {\n        FT_MEM_COPY(\n          tuple_coords,\n          &blend->tuplecoords[(tupleIndex & 0xFFF) * blend->num_axis],\n          blend->num_axis * sizeof ( FT_Fixed ) );\n      }\n\n      if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE )\n      {\n        for ( j = 0; j < blend->num_axis; ++j )\n          im_start_coords[j] = FT_GET_SHORT() << 2;\n        for ( j = 0; j < blend->num_axis; ++j )\n          im_end_coords[j] = FT_GET_SHORT() << 2;\n      }\n\n      apply = ft_var_apply_tuple( blend,\n                                  (FT_UShort)tupleIndex,\n                                  tuple_coords,\n                                  im_start_coords,\n                                  im_end_coords );\n\n      if ( apply == 0 )              /* tuple isn't active for our blend */\n      {\n        offsetToData += tupleDataSize;\n        continue;\n      }\n\n      here = FT_Stream_FTell( stream );\n\n      if ( tupleIndex & GX_TI_PRIVATE_POINT_NUMBERS )\n      {\n        FT_Stream_SeekSet( stream, offsetToData );\n\n        localpoints = ft_var_readpackedpoints( stream, &point_count );\n        points      = localpoints;\n      }\n      else\n      {\n        points      = sharedpoints;\n        point_count = spoint_count;\n      }\n\n      deltas_x = ft_var_readpackeddeltas( stream,\n                                          point_count == 0 ? n_points\n                                                           : point_count );\n      deltas_y = ft_var_readpackeddeltas( stream,\n                                          point_count == 0 ? n_points\n                                                           : point_count );\n\n      if ( points == NULL || deltas_y == NULL || deltas_x == NULL )\n        ; /* failure, ignore it */\n\n      else if ( points == ALL_POINTS )\n      {\n        /* this means that there are deltas for every point in the glyph */\n        for ( j = 0; j < n_points; ++j )\n        {\n          delta_xy[j].x += FT_MulFix( deltas_x[j], apply );\n          delta_xy[j].y += FT_MulFix( deltas_y[j], apply );\n        }\n      }\n\n      else\n      {\n        for ( j = 0; j < point_count; ++j )\n        {\n          if ( localpoints[j] >= n_points )\n            continue;\n\n          delta_xy[localpoints[j]].x += FT_MulFix( deltas_x[j], apply );\n          delta_xy[localpoints[j]].y += FT_MulFix( deltas_y[j], apply );\n        }\n      }\n\n      if ( localpoints != ALL_POINTS )\n        FT_FREE( localpoints );\n      FT_FREE( deltas_x );\n      FT_FREE( deltas_y );\n\n      offsetToData += tupleDataSize;\n\n      FT_Stream_SeekSet( stream, here );\n    }\n\n  Fail3:\n    FT_FREE( tuple_coords );\n    FT_FREE( im_start_coords );\n    FT_FREE( im_end_coords );\n\n  Fail2:\n    FT_FRAME_EXIT();\n\n  Fail1:\n    if ( error )\n    {\n      FT_FREE( delta_xy );\n      *deltas = NULL;\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_done_blend                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Frees the blend internal data structure.                           */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  tt_done_blend( FT_Memory  memory,\n                 GX_Blend   blend )\n  {\n    if ( blend != NULL )\n    {\n      FT_UInt  i;\n\n\n      FT_FREE( blend->normalizedcoords );\n      FT_FREE( blend->mmvar );\n\n      if ( blend->avar_segment != NULL )\n      {\n        for ( i = 0; i < blend->num_axis; ++i )\n          FT_FREE( blend->avar_segment[i].correspondence );\n        FT_FREE( blend->avar_segment );\n      }\n\n      FT_FREE( blend->tuplecoords );\n      FT_FREE( blend->glyphoffsets );\n      FT_FREE( blend );\n    }\n  }\n\n#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/truetype/ttgxvar.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttgxvar.h                                                              */\n/*                                                                         */\n/*    TrueType GX Font Variation loader (specification)                    */\n/*                                                                         */\n/*  Copyright 2004 by                                                      */\n/*  David Turner, Robert Wilhelm, Werner Lemberg and George Williams.      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTGXVAR_H__\n#define __TTGXVAR_H__\n\n\n#include <ft2build.h>\n#include \"ttobjs.h\"\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    GX_AVarCorrespondenceRec                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A data structure representing `shortFracCorrespondence' in `avar'  */\n  /*    table according to the specifications from Apple.                  */\n  /*                                                                       */\n  typedef struct  GX_AVarCorrespondenceRec_\n  {\n    FT_Fixed  fromCoord;\n    FT_Fixed  toCoord;\n\n  } GX_AVarCorrespondenceRec_, *GX_AVarCorrespondence;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    GX_AVarRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Data from the segment field of `avar' table.                       */\n  /*    There is one of these for each axis.                               */\n  /*                                                                       */\n  typedef struct  GX_AVarSegmentRec_\n  {\n    FT_UShort              pairCount;\n    GX_AVarCorrespondence  correspondence; /* array with pairCount entries */\n\n  } GX_AVarSegmentRec, *GX_AVarSegment;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    GX_BlendRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Data for interpolating a font from a distortable font specified    */\n  /*    by the GX *var tables ([fgca]var).                                 */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_axis         :: The number of axes along which interpolation   */\n  /*                         may happen                                    */\n  /*                                                                       */\n  /*    normalizedcoords :: A normalized value (between [-1,1]) indicating */\n  /*                        the contribution along each axis to the final  */\n  /*                        interpolated font.                             */\n  /*                                                                       */\n  typedef struct  GX_BlendRec_\n  {\n    FT_UInt         num_axis;\n    FT_Fixed*       normalizedcoords;\n\n    FT_MM_Var*      mmvar;\n    FT_Offset       mmvar_len;\n\n    FT_Bool         avar_checked;\n    GX_AVarSegment  avar_segment;\n\n    FT_UInt         tuplecount;      /* shared tuples in `gvar'           */\n    FT_Fixed*       tuplecoords;     /* tuplecoords[tuplecount][num_axis] */\n\n    FT_UInt         gv_glyphcnt;\n    FT_ULong*       glyphoffsets;\n\n  } GX_BlendRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <enum>                                                                */\n  /*    GX_TupleCountFlags                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Flags used within the `TupleCount' field of the `gvar' table.      */\n  /*                                                                       */\n  typedef enum  GX_TupleCountFlags_\n  {\n    GX_TC_TUPLES_SHARE_POINT_NUMBERS = 0x8000,\n    GX_TC_RESERVED_TUPLE_FLAGS       = 0x7000,\n    GX_TC_TUPLE_COUNT_MASK           = 0x0FFF\n\n  } GX_TupleCountFlags;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <enum>                                                                */\n  /*    GX_TupleIndexFlags                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Flags used within the `TupleIndex' field of the `gvar' and `cvar'  */\n  /*    tables.                                                            */\n  /*                                                                       */\n  typedef enum  GX_TupleIndexFlags_\n  {\n    GX_TI_EMBEDDED_TUPLE_COORD  = 0x8000,\n    GX_TI_INTERMEDIATE_TUPLE    = 0x4000,\n    GX_TI_PRIVATE_POINT_NUMBERS = 0x2000,\n    GX_TI_RESERVED_TUPLE_FLAG   = 0x1000,\n    GX_TI_TUPLE_INDEX_MASK      = 0x0FFF\n\n  } GX_TupleIndexFlags;\n\n\n#define TTAG_wght  FT_MAKE_TAG( 'w', 'g', 'h', 't' )\n#define TTAG_wdth  FT_MAKE_TAG( 'w', 'd', 't', 'h' )\n#define TTAG_opsz  FT_MAKE_TAG( 'o', 'p', 's', 'z' )\n#define TTAG_slnt  FT_MAKE_TAG( 's', 'l', 'n', 't' )\n\n\n  FT_LOCAL( FT_Error )\n  TT_Set_MM_Blend( TT_Face    face,\n                   FT_UInt    num_coords,\n                   FT_Fixed*  coords );\n\n  FT_LOCAL( FT_Error )\n  TT_Set_Var_Design( TT_Face    face,\n                     FT_UInt    num_coords,\n                     FT_Fixed*  coords );\n\n  FT_LOCAL( FT_Error )\n  TT_Get_MM_Var( TT_Face      face,\n                 FT_MM_Var*  *master );\n\n\n  FT_LOCAL( FT_Error )\n  tt_face_vary_cvt( TT_Face    face,\n                    FT_Stream  stream );\n\n\n  FT_LOCAL( FT_Error )\n  TT_Vary_Get_Glyph_Deltas( TT_Face      face,\n                            FT_UInt      glyph_index,\n                            FT_Vector*  *deltas,\n                            FT_UInt      n_points );\n\n\n  FT_LOCAL( void )\n  tt_done_blend( FT_Memory  memory,\n                 GX_Blend   blend );\n\n\nFT_END_HEADER\n\n\n#endif /* __TTGXVAR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/truetype/ttinterp.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttinterp.c                                                             */\n/*                                                                         */\n/*    TrueType bytecode interpreter (body).                                */\n/*                                                                         */\n/*  Copyright 1996-2014                                                    */\n/*  by David Turner, Robert Wilhelm, and Werner Lemberg.                   */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n/* Greg Hitchcock from Microsoft has helped a lot in resolving unclear */\n/* issues; many thanks!                                                */\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_CALC_H\n#include FT_TRIGONOMETRY_H\n#include FT_SYSTEM_H\n#include FT_TRUETYPE_DRIVER_H\n\n#include \"ttinterp.h\"\n#include \"tterrors.h\"\n#include \"ttsubpix.h\"\n\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_ttinterp\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* In order to detect infinite loops in the code, we set up a counter    */\n  /* within the run loop.  A single stroke of interpretation is now        */\n  /* limited to a maximum number of opcodes defined below.                 */\n  /*                                                                       */\n#define MAX_RUNNABLE_OPCODES  1000000L\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* There are two kinds of implementations:                               */\n  /*                                                                       */\n  /* a. static implementation                                              */\n  /*                                                                       */\n  /*    The current execution context is a static variable, which fields   */\n  /*    are accessed directly by the interpreter during execution.  The    */\n  /*    context is named `cur'.                                            */\n  /*                                                                       */\n  /*    This version is non-reentrant, of course.                          */\n  /*                                                                       */\n  /* b. indirect implementation                                            */\n  /*                                                                       */\n  /*    The current execution context is passed to _each_ function as its  */\n  /*    first argument, and each field is thus accessed indirectly.        */\n  /*                                                                       */\n  /*    This version is fully re-entrant.                                  */\n  /*                                                                       */\n  /* The idea is that an indirect implementation may be slower to execute  */\n  /* on low-end processors that are used in some systems (like 386s or     */\n  /* even 486s).                                                           */\n  /*                                                                       */\n  /* As a consequence, the indirect implementation is now the default, as  */\n  /* its performance costs can be considered negligible in our context.    */\n  /* Note, however, that we kept the same source with macros because:      */\n  /*                                                                       */\n  /* - The code is kept very close in design to the Pascal code used for   */\n  /*   development.                                                        */\n  /*                                                                       */\n  /* - It's much more readable that way!                                   */\n  /*                                                                       */\n  /* - It's still open to experimentation and tuning.                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef TT_CONFIG_OPTION_STATIC_INTERPRETER     /* indirect implementation */\n\n#define CUR  (*exc)                             /* see ttobjs.h */\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This macro is used whenever `exec' is unused in a function, to avoid  */\n  /* stupid warnings from pedantic compilers.                              */\n  /*                                                                       */\n#define FT_UNUSED_EXEC  FT_UNUSED( exc )\n\n#else                                           /* static implementation */\n\n#define CUR  cur\n\n#define FT_UNUSED_EXEC  int  __dummy = __dummy\n\n  static\n  TT_ExecContextRec  cur;   /* static exec. context variable */\n\n  /* apparently, we have a _lot_ of direct indexing when accessing  */\n  /* the static `cur', which makes the code bigger (due to all the  */\n  /* four bytes addresses).                                         */\n\n#endif /* TT_CONFIG_OPTION_STATIC_INTERPRETER */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The instruction argument stack.                                       */\n  /*                                                                       */\n#define INS_ARG  EXEC_OP_ FT_Long*  args    /* see ttobjs.h for EXEC_OP_ */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This macro is used whenever `args' is unused in a function, to avoid  */\n  /* stupid warnings from pedantic compilers.                              */\n  /*                                                                       */\n#define FT_UNUSED_ARG  FT_UNUSED_EXEC; FT_UNUSED( args )\n\n\n#define SUBPIXEL_HINTING                                                    \\\n          ( ((TT_Driver)FT_FACE_DRIVER( CUR.face ))->interpreter_version == \\\n            TT_INTERPRETER_VERSION_38 )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The following macros hide the use of EXEC_ARG and EXEC_ARG_ to        */\n  /* increase readability of the code.                                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#define SKIP_Code() \\\n          SkipCode( EXEC_ARG )\n\n#define GET_ShortIns() \\\n          GetShortIns( EXEC_ARG )\n\n#define NORMalize( x, y, v ) \\\n          Normalize( EXEC_ARG_ x, y, v )\n\n#define SET_SuperRound( scale, flags ) \\\n          SetSuperRound( EXEC_ARG_ scale, flags )\n\n#define ROUND_None( d, c ) \\\n          Round_None( EXEC_ARG_ d, c )\n\n#define INS_Goto_CodeRange( range, ip ) \\\n          Ins_Goto_CodeRange( EXEC_ARG_ range, ip )\n\n#define CUR_Func_move( z, p, d ) \\\n          CUR.func_move( EXEC_ARG_ z, p, d )\n\n#define CUR_Func_move_orig( z, p, d ) \\\n          CUR.func_move_orig( EXEC_ARG_ z, p, d )\n\n#define CUR_Func_round( d, c ) \\\n          CUR.func_round( EXEC_ARG_ d, c )\n\n#define CUR_Func_cur_ppem() \\\n          CUR.func_cur_ppem( EXEC_ARG )\n\n#define CUR_Func_read_cvt( index ) \\\n          CUR.func_read_cvt( EXEC_ARG_ index )\n\n#define CUR_Func_write_cvt( index, val ) \\\n          CUR.func_write_cvt( EXEC_ARG_ index, val )\n\n#define CUR_Func_move_cvt( index, val ) \\\n          CUR.func_move_cvt( EXEC_ARG_ index, val )\n\n#define CURRENT_Ratio() \\\n          Current_Ratio( EXEC_ARG )\n\n#define INS_SxVTL( a, b, c, d ) \\\n          Ins_SxVTL( EXEC_ARG_ a, b, c, d )\n\n#define COMPUTE_Funcs() \\\n          Compute_Funcs( EXEC_ARG )\n\n#define COMPUTE_Round( a ) \\\n          Compute_Round( EXEC_ARG_ a )\n\n#define COMPUTE_Point_Displacement( a, b, c, d ) \\\n          Compute_Point_Displacement( EXEC_ARG_ a, b, c, d )\n\n#define MOVE_Zp2_Point( a, b, c, t ) \\\n          Move_Zp2_Point( EXEC_ARG_ a, b, c, t )\n\n\n#define CUR_Func_project( v1, v2 )  \\\n          CUR.func_project( EXEC_ARG_ (v1)->x - (v2)->x, (v1)->y - (v2)->y )\n\n#define CUR_Func_dualproj( v1, v2 )  \\\n          CUR.func_dualproj( EXEC_ARG_ (v1)->x - (v2)->x, (v1)->y - (v2)->y )\n\n#define CUR_fast_project( v ) \\\n          CUR.func_project( EXEC_ARG_ (v)->x, (v)->y )\n\n#define CUR_fast_dualproj( v ) \\\n          CUR.func_dualproj( EXEC_ARG_ (v)->x, (v)->y )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Instruction dispatch function, as used by the interpreter.            */\n  /*                                                                       */\n  typedef void  (*TInstruction_Function)( INS_ARG );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Two simple bounds-checking macros.                                    */\n  /*                                                                       */\n#define BOUNDS( x, n )   ( (FT_UInt)(x)  >= (FT_UInt)(n)  )\n#define BOUNDSL( x, n )  ( (FT_ULong)(x) >= (FT_ULong)(n) )\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This macro computes (a*2^14)/b and complements TT_MulFix14.           */\n  /*                                                                       */\n#define TT_DivFix14( a, b ) \\\n          FT_DivFix( a, (b) << 2 )\n\n\n#undef  SUCCESS\n#define SUCCESS  0\n\n#undef  FAILURE\n#define FAILURE  1\n\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n#define GUESS_VECTOR( V )                                         \\\n  if ( CUR.face->unpatented_hinting )                             \\\n  {                                                               \\\n    CUR.GS.V.x = (FT_F2Dot14)( CUR.GS.both_x_axis ? 0x4000 : 0 ); \\\n    CUR.GS.V.y = (FT_F2Dot14)( CUR.GS.both_x_axis ? 0 : 0x4000 ); \\\n  }\n#else\n#define GUESS_VECTOR( V )\n#endif\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                        CODERANGE FUNCTIONS                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    TT_Goto_CodeRange                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Switches to a new code range (updates the code related elements in */\n  /*    `exec', and `IP').                                                 */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    range :: The new execution code range.                             */\n  /*                                                                       */\n  /*    IP    :: The new IP in the new code range.                         */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    exec  :: The target execution context.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  TT_Goto_CodeRange( TT_ExecContext  exec,\n                     FT_Int          range,\n                     FT_Long         IP )\n  {\n    TT_CodeRange*  coderange;\n\n\n    FT_ASSERT( range >= 1 && range <= 3 );\n\n    coderange = &exec->codeRangeTable[range - 1];\n\n    FT_ASSERT( coderange->base != NULL );\n\n    /* NOTE: Because the last instruction of a program may be a CALL */\n    /*       which will return to the first byte *after* the code    */\n    /*       range, we test for IP <= Size instead of IP < Size.     */\n    /*                                                               */\n    FT_ASSERT( (FT_ULong)IP <= coderange->size );\n\n    exec->code     = coderange->base;\n    exec->codeSize = coderange->size;\n    exec->IP       = IP;\n    exec->curRange = range;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    TT_Set_CodeRange                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Sets a code range.                                                 */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    range  :: The code range index.                                    */\n  /*                                                                       */\n  /*    base   :: The new code base.                                       */\n  /*                                                                       */\n  /*    length :: The range size in bytes.                                 */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    exec   :: The target execution context.                            */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  TT_Set_CodeRange( TT_ExecContext  exec,\n                    FT_Int          range,\n                    void*           base,\n                    FT_Long         length )\n  {\n    FT_ASSERT( range >= 1 && range <= 3 );\n\n    exec->codeRangeTable[range - 1].base = (FT_Byte*)base;\n    exec->codeRangeTable[range - 1].size = length;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    TT_Clear_CodeRange                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Clears a code range.                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    range :: The code range index.                                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    exec  :: The target execution context.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  TT_Clear_CodeRange( TT_ExecContext  exec,\n                      FT_Int          range )\n  {\n    FT_ASSERT( range >= 1 && range <= 3 );\n\n    exec->codeRangeTable[range - 1].base = NULL;\n    exec->codeRangeTable[range - 1].size = 0;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                   EXECUTION CONTEXT ROUTINES                          */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    TT_Done_Context                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroys a given context.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    exec   :: A handle to the target execution context.                */\n  /*                                                                       */\n  /*    memory :: A handle to the parent memory object.                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Only the glyph loader and debugger should call this function.      */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  TT_Done_Context( TT_ExecContext  exec )\n  {\n    FT_Memory  memory = exec->memory;\n\n\n    /* points zone */\n    exec->maxPoints   = 0;\n    exec->maxContours = 0;\n\n    /* free stack */\n    FT_FREE( exec->stack );\n    exec->stackSize = 0;\n\n    /* free call stack */\n    FT_FREE( exec->callStack );\n    exec->callSize = 0;\n    exec->callTop  = 0;\n\n    /* free glyph code range */\n    FT_FREE( exec->glyphIns );\n    exec->glyphSize = 0;\n\n    exec->size = NULL;\n    exec->face = NULL;\n\n    FT_FREE( exec );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Init_Context                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initializes a context object.                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory :: A handle to the parent memory object.                    */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    exec   :: A handle to the target execution context.                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  static FT_Error\n  Init_Context( TT_ExecContext  exec,\n                FT_Memory       memory )\n  {\n    FT_Error  error;\n\n\n    FT_TRACE1(( \"Init_Context: new object at 0x%08p\\n\", exec ));\n\n    exec->memory   = memory;\n    exec->callSize = 32;\n\n    if ( FT_NEW_ARRAY( exec->callStack, exec->callSize ) )\n      goto Fail_Memory;\n\n    /* all values in the context are set to 0 already, but this is */\n    /* here as a remainder                                         */\n    exec->maxPoints   = 0;\n    exec->maxContours = 0;\n\n    exec->stackSize = 0;\n    exec->glyphSize = 0;\n\n    exec->stack     = NULL;\n    exec->glyphIns  = NULL;\n\n    exec->face = NULL;\n    exec->size = NULL;\n\n    return FT_Err_Ok;\n\n  Fail_Memory:\n    FT_ERROR(( \"Init_Context: not enough memory for %p\\n\", exec ));\n    TT_Done_Context( exec );\n\n    return error;\n }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Update_Max                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Checks the size of a buffer and reallocates it if necessary.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory     :: A handle to the parent memory object.                */\n  /*                                                                       */\n  /*    multiplier :: The size in bytes of each element in the buffer.     */\n  /*                                                                       */\n  /*    new_max    :: The new capacity (size) of the buffer.               */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    size       :: The address of the buffer's current size expressed   */\n  /*                  in elements.                                         */\n  /*                                                                       */\n  /*    buff       :: The address of the buffer base pointer.              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  Update_Max( FT_Memory  memory,\n              FT_ULong*  size,\n              FT_Long    multiplier,\n              void*      _pbuff,\n              FT_ULong   new_max )\n  {\n    FT_Error  error;\n    void**    pbuff = (void**)_pbuff;\n\n\n    if ( *size < new_max )\n    {\n      if ( FT_REALLOC( *pbuff, *size * multiplier, new_max * multiplier ) )\n        return error;\n      *size = new_max;\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    TT_Load_Context                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Prepare an execution context for glyph hinting.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source face object.                        */\n  /*                                                                       */\n  /*    size :: A handle to the source size object.                        */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    exec :: A handle to the target execution context.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Only the glyph loader and debugger should call this function.      */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  TT_Load_Context( TT_ExecContext  exec,\n                   TT_Face         face,\n                   TT_Size         size )\n  {\n    FT_Int          i;\n    FT_ULong        tmp;\n    TT_MaxProfile*  maxp;\n    FT_Error        error;\n\n\n    exec->face = face;\n    maxp       = &face->max_profile;\n    exec->size = size;\n\n    if ( size )\n    {\n      exec->numFDefs   = size->num_function_defs;\n      exec->maxFDefs   = size->max_function_defs;\n      exec->numIDefs   = size->num_instruction_defs;\n      exec->maxIDefs   = size->max_instruction_defs;\n      exec->FDefs      = size->function_defs;\n      exec->IDefs      = size->instruction_defs;\n      exec->tt_metrics = size->ttmetrics;\n      exec->metrics    = size->metrics;\n\n      exec->maxFunc    = size->max_func;\n      exec->maxIns     = size->max_ins;\n\n      for ( i = 0; i < TT_MAX_CODE_RANGES; i++ )\n        exec->codeRangeTable[i] = size->codeRangeTable[i];\n\n      /* set graphics state */\n      exec->GS = size->GS;\n\n      exec->cvtSize = size->cvt_size;\n      exec->cvt     = size->cvt;\n\n      exec->storeSize = size->storage_size;\n      exec->storage   = size->storage;\n\n      exec->twilight  = size->twilight;\n\n      /* In case of multi-threading it can happen that the old size object */\n      /* no longer exists, thus we must clear all glyph zone references.   */\n      ft_memset( &exec->zp0, 0, sizeof ( exec->zp0 ) );\n      exec->zp1 = exec->zp0;\n      exec->zp2 = exec->zp0;\n    }\n\n    /* XXX: We reserve a little more elements on the stack to deal safely */\n    /*      with broken fonts like arialbs, courbs, timesbs, etc.         */\n    tmp = exec->stackSize;\n    error = Update_Max( exec->memory,\n                        &tmp,\n                        sizeof ( FT_F26Dot6 ),\n                        (void*)&exec->stack,\n                        maxp->maxStackElements + 32 );\n    exec->stackSize = (FT_UInt)tmp;\n    if ( error )\n      return error;\n\n    tmp = exec->glyphSize;\n    error = Update_Max( exec->memory,\n                        &tmp,\n                        sizeof ( FT_Byte ),\n                        (void*)&exec->glyphIns,\n                        maxp->maxSizeOfInstructions );\n    exec->glyphSize = (FT_UShort)tmp;\n    if ( error )\n      return error;\n\n    exec->pts.n_points   = 0;\n    exec->pts.n_contours = 0;\n\n    exec->zp1 = exec->pts;\n    exec->zp2 = exec->pts;\n    exec->zp0 = exec->pts;\n\n    exec->instruction_trap = FALSE;\n\n    return FT_Err_Ok;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    TT_Save_Context                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Saves the code ranges in a `size' object.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    exec :: A handle to the source execution context.                  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    size :: A handle to the target size object.                        */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Only the glyph loader and debugger should call this function.      */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  TT_Save_Context( TT_ExecContext  exec,\n                   TT_Size         size )\n  {\n    FT_Int  i;\n\n\n    /* XXX: Will probably disappear soon with all the code range */\n    /*      management, which is now rather obsolete.            */\n    /*                                                           */\n    size->num_function_defs    = exec->numFDefs;\n    size->num_instruction_defs = exec->numIDefs;\n\n    size->max_func = exec->maxFunc;\n    size->max_ins  = exec->maxIns;\n\n    for ( i = 0; i < TT_MAX_CODE_RANGES; i++ )\n      size->codeRangeTable[i] = exec->codeRangeTable[i];\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    TT_Run_Context                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Executes one or more instructions in the execution context.        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    debug :: A Boolean flag.  If set, the function sets some internal  */\n  /*             variables and returns immediately, otherwise TT_RunIns()  */\n  /*             is called.                                                */\n  /*                                                                       */\n  /*             This is commented out currently.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    exec  :: A handle to the target execution context.                 */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    TrueType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Only the glyph loader and debugger should call this function.      */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  TT_Run_Context( TT_ExecContext  exec,\n                  FT_Bool         debug )\n  {\n    TT_Goto_CodeRange( exec, tt_coderange_glyph, 0 );\n\n    exec->zp0 = exec->pts;\n    exec->zp1 = exec->pts;\n    exec->zp2 = exec->pts;\n\n    exec->GS.gep0 = 1;\n    exec->GS.gep1 = 1;\n    exec->GS.gep2 = 1;\n\n    exec->GS.projVector.x = 0x4000;\n    exec->GS.projVector.y = 0x0000;\n\n    exec->GS.freeVector = exec->GS.projVector;\n    exec->GS.dualVector = exec->GS.projVector;\n\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n    exec->GS.both_x_axis = TRUE;\n#endif\n\n    exec->GS.round_state = 1;\n    exec->GS.loop        = 1;\n\n    /* some glyphs leave something on the stack. so we clean it */\n    /* before a new execution.                                  */\n    exec->top     = 0;\n    exec->callTop = 0;\n\n#if 1\n    FT_UNUSED( debug );\n\n    return exec->face->interpreter( exec );\n#else\n    if ( !debug )\n      return TT_RunIns( exec );\n    else\n      return FT_Err_Ok;\n#endif\n  }\n\n\n  /* The default value for `scan_control' is documented as FALSE in the */\n  /* TrueType specification.  This is confusing since it implies a      */\n  /* Boolean value.  However, this is not the case, thus both the       */\n  /* default values of our `scan_type' and `scan_control' fields (which */\n  /* the documentation's `scan_control' variable is split into) are     */\n  /* zero.                                                              */\n\n  const TT_GraphicsState  tt_default_graphics_state =\n  {\n    0, 0, 0,\n    { 0x4000, 0 },\n    { 0x4000, 0 },\n    { 0x4000, 0 },\n\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n    TRUE,\n#endif\n\n    1, 64, 1,\n    TRUE, 68, 0, 0, 9, 3,\n    0, FALSE, 0, 1, 1, 1\n  };\n\n\n  /* documentation is in ttinterp.h */\n\n  FT_EXPORT_DEF( TT_ExecContext )\n  TT_New_Context( TT_Driver  driver )\n  {\n    FT_Memory  memory;\n\n\n    if ( !driver )\n      goto Fail;\n\n    memory = driver->root.root.memory;\n\n    if ( !driver->context )\n    {\n      FT_Error        error;\n      TT_ExecContext  exec;\n\n\n      /* allocate object */\n      if ( FT_NEW( exec ) )\n        goto Fail;\n\n      /* initialize it; in case of error this deallocates `exec' too */\n      error = Init_Context( exec, memory );\n      if ( error )\n        goto Fail;\n\n      /* store it into the driver */\n      driver->context = exec;\n    }\n\n    return driver->context;\n\n  Fail:\n    return NULL;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Before an opcode is executed, the interpreter verifies that there are */\n  /* enough arguments on the stack, with the help of the `Pop_Push_Count'  */\n  /* table.                                                                */\n  /*                                                                       */\n  /* For each opcode, the first column gives the number of arguments that  */\n  /* are popped from the stack; the second one gives the number of those   */\n  /* that are pushed in result.                                            */\n  /*                                                                       */\n  /* Opcodes which have a varying number of parameters in the data stream  */\n  /* (NPUSHB, NPUSHW) are handled specially; they have a negative value in */\n  /* the `opcode_length' table, and the value in `Pop_Push_Count' is set   */\n  /* to zero.                                                              */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#undef  PACK\n#define PACK( x, y )  ( ( x << 4 ) | y )\n\n\n  static\n  const FT_Byte  Pop_Push_Count[256] =\n  {\n    /* opcodes are gathered in groups of 16 */\n    /* please keep the spaces as they are   */\n\n    /*  SVTCA  y  */  PACK( 0, 0 ),\n    /*  SVTCA  x  */  PACK( 0, 0 ),\n    /*  SPvTCA y  */  PACK( 0, 0 ),\n    /*  SPvTCA x  */  PACK( 0, 0 ),\n    /*  SFvTCA y  */  PACK( 0, 0 ),\n    /*  SFvTCA x  */  PACK( 0, 0 ),\n    /*  SPvTL //  */  PACK( 2, 0 ),\n    /*  SPvTL +   */  PACK( 2, 0 ),\n    /*  SFvTL //  */  PACK( 2, 0 ),\n    /*  SFvTL +   */  PACK( 2, 0 ),\n    /*  SPvFS     */  PACK( 2, 0 ),\n    /*  SFvFS     */  PACK( 2, 0 ),\n    /*  GPV       */  PACK( 0, 2 ),\n    /*  GFV       */  PACK( 0, 2 ),\n    /*  SFvTPv    */  PACK( 0, 0 ),\n    /*  ISECT     */  PACK( 5, 0 ),\n\n    /*  SRP0      */  PACK( 1, 0 ),\n    /*  SRP1      */  PACK( 1, 0 ),\n    /*  SRP2      */  PACK( 1, 0 ),\n    /*  SZP0      */  PACK( 1, 0 ),\n    /*  SZP1      */  PACK( 1, 0 ),\n    /*  SZP2      */  PACK( 1, 0 ),\n    /*  SZPS      */  PACK( 1, 0 ),\n    /*  SLOOP     */  PACK( 1, 0 ),\n    /*  RTG       */  PACK( 0, 0 ),\n    /*  RTHG      */  PACK( 0, 0 ),\n    /*  SMD       */  PACK( 1, 0 ),\n    /*  ELSE      */  PACK( 0, 0 ),\n    /*  JMPR      */  PACK( 1, 0 ),\n    /*  SCvTCi    */  PACK( 1, 0 ),\n    /*  SSwCi     */  PACK( 1, 0 ),\n    /*  SSW       */  PACK( 1, 0 ),\n\n    /*  DUP       */  PACK( 1, 2 ),\n    /*  POP       */  PACK( 1, 0 ),\n    /*  CLEAR     */  PACK( 0, 0 ),\n    /*  SWAP      */  PACK( 2, 2 ),\n    /*  DEPTH     */  PACK( 0, 1 ),\n    /*  CINDEX    */  PACK( 1, 1 ),\n    /*  MINDEX    */  PACK( 1, 0 ),\n    /*  AlignPTS  */  PACK( 2, 0 ),\n    /*  INS_$28   */  PACK( 0, 0 ),\n    /*  UTP       */  PACK( 1, 0 ),\n    /*  LOOPCALL  */  PACK( 2, 0 ),\n    /*  CALL      */  PACK( 1, 0 ),\n    /*  FDEF      */  PACK( 1, 0 ),\n    /*  ENDF      */  PACK( 0, 0 ),\n    /*  MDAP[0]   */  PACK( 1, 0 ),\n    /*  MDAP[1]   */  PACK( 1, 0 ),\n\n    /*  IUP[0]    */  PACK( 0, 0 ),\n    /*  IUP[1]    */  PACK( 0, 0 ),\n    /*  SHP[0]    */  PACK( 0, 0 ),\n    /*  SHP[1]    */  PACK( 0, 0 ),\n    /*  SHC[0]    */  PACK( 1, 0 ),\n    /*  SHC[1]    */  PACK( 1, 0 ),\n    /*  SHZ[0]    */  PACK( 1, 0 ),\n    /*  SHZ[1]    */  PACK( 1, 0 ),\n    /*  SHPIX     */  PACK( 1, 0 ),\n    /*  IP        */  PACK( 0, 0 ),\n    /*  MSIRP[0]  */  PACK( 2, 0 ),\n    /*  MSIRP[1]  */  PACK( 2, 0 ),\n    /*  AlignRP   */  PACK( 0, 0 ),\n    /*  RTDG      */  PACK( 0, 0 ),\n    /*  MIAP[0]   */  PACK( 2, 0 ),\n    /*  MIAP[1]   */  PACK( 2, 0 ),\n\n    /*  NPushB    */  PACK( 0, 0 ),\n    /*  NPushW    */  PACK( 0, 0 ),\n    /*  WS        */  PACK( 2, 0 ),\n    /*  RS        */  PACK( 1, 1 ),\n    /*  WCvtP     */  PACK( 2, 0 ),\n    /*  RCvt      */  PACK( 1, 1 ),\n    /*  GC[0]     */  PACK( 1, 1 ),\n    /*  GC[1]     */  PACK( 1, 1 ),\n    /*  SCFS      */  PACK( 2, 0 ),\n    /*  MD[0]     */  PACK( 2, 1 ),\n    /*  MD[1]     */  PACK( 2, 1 ),\n    /*  MPPEM     */  PACK( 0, 1 ),\n    /*  MPS       */  PACK( 0, 1 ),\n    /*  FlipON    */  PACK( 0, 0 ),\n    /*  FlipOFF   */  PACK( 0, 0 ),\n    /*  DEBUG     */  PACK( 1, 0 ),\n\n    /*  LT        */  PACK( 2, 1 ),\n    /*  LTEQ      */  PACK( 2, 1 ),\n    /*  GT        */  PACK( 2, 1 ),\n    /*  GTEQ      */  PACK( 2, 1 ),\n    /*  EQ        */  PACK( 2, 1 ),\n    /*  NEQ       */  PACK( 2, 1 ),\n    /*  ODD       */  PACK( 1, 1 ),\n    /*  EVEN      */  PACK( 1, 1 ),\n    /*  IF        */  PACK( 1, 0 ),\n    /*  EIF       */  PACK( 0, 0 ),\n    /*  AND       */  PACK( 2, 1 ),\n    /*  OR        */  PACK( 2, 1 ),\n    /*  NOT       */  PACK( 1, 1 ),\n    /*  DeltaP1   */  PACK( 1, 0 ),\n    /*  SDB       */  PACK( 1, 0 ),\n    /*  SDS       */  PACK( 1, 0 ),\n\n    /*  ADD       */  PACK( 2, 1 ),\n    /*  SUB       */  PACK( 2, 1 ),\n    /*  DIV       */  PACK( 2, 1 ),\n    /*  MUL       */  PACK( 2, 1 ),\n    /*  ABS       */  PACK( 1, 1 ),\n    /*  NEG       */  PACK( 1, 1 ),\n    /*  FLOOR     */  PACK( 1, 1 ),\n    /*  CEILING   */  PACK( 1, 1 ),\n    /*  ROUND[0]  */  PACK( 1, 1 ),\n    /*  ROUND[1]  */  PACK( 1, 1 ),\n    /*  ROUND[2]  */  PACK( 1, 1 ),\n    /*  ROUND[3]  */  PACK( 1, 1 ),\n    /*  NROUND[0] */  PACK( 1, 1 ),\n    /*  NROUND[1] */  PACK( 1, 1 ),\n    /*  NROUND[2] */  PACK( 1, 1 ),\n    /*  NROUND[3] */  PACK( 1, 1 ),\n\n    /*  WCvtF     */  PACK( 2, 0 ),\n    /*  DeltaP2   */  PACK( 1, 0 ),\n    /*  DeltaP3   */  PACK( 1, 0 ),\n    /*  DeltaCn[0] */ PACK( 1, 0 ),\n    /*  DeltaCn[1] */ PACK( 1, 0 ),\n    /*  DeltaCn[2] */ PACK( 1, 0 ),\n    /*  SROUND    */  PACK( 1, 0 ),\n    /*  S45Round  */  PACK( 1, 0 ),\n    /*  JROT      */  PACK( 2, 0 ),\n    /*  JROF      */  PACK( 2, 0 ),\n    /*  ROFF      */  PACK( 0, 0 ),\n    /*  INS_$7B   */  PACK( 0, 0 ),\n    /*  RUTG      */  PACK( 0, 0 ),\n    /*  RDTG      */  PACK( 0, 0 ),\n    /*  SANGW     */  PACK( 1, 0 ),\n    /*  AA        */  PACK( 1, 0 ),\n\n    /*  FlipPT    */  PACK( 0, 0 ),\n    /*  FlipRgON  */  PACK( 2, 0 ),\n    /*  FlipRgOFF */  PACK( 2, 0 ),\n    /*  INS_$83   */  PACK( 0, 0 ),\n    /*  INS_$84   */  PACK( 0, 0 ),\n    /*  ScanCTRL  */  PACK( 1, 0 ),\n    /*  SDPVTL[0] */  PACK( 2, 0 ),\n    /*  SDPVTL[1] */  PACK( 2, 0 ),\n    /*  GetINFO   */  PACK( 1, 1 ),\n    /*  IDEF      */  PACK( 1, 0 ),\n    /*  ROLL      */  PACK( 3, 3 ),\n    /*  MAX       */  PACK( 2, 1 ),\n    /*  MIN       */  PACK( 2, 1 ),\n    /*  ScanTYPE  */  PACK( 1, 0 ),\n    /*  InstCTRL  */  PACK( 2, 0 ),\n    /*  INS_$8F   */  PACK( 0, 0 ),\n\n    /*  INS_$90  */   PACK( 0, 0 ),\n    /*  INS_$91  */   PACK( 0, 0 ),\n    /*  INS_$92  */   PACK( 0, 0 ),\n    /*  INS_$93  */   PACK( 0, 0 ),\n    /*  INS_$94  */   PACK( 0, 0 ),\n    /*  INS_$95  */   PACK( 0, 0 ),\n    /*  INS_$96  */   PACK( 0, 0 ),\n    /*  INS_$97  */   PACK( 0, 0 ),\n    /*  INS_$98  */   PACK( 0, 0 ),\n    /*  INS_$99  */   PACK( 0, 0 ),\n    /*  INS_$9A  */   PACK( 0, 0 ),\n    /*  INS_$9B  */   PACK( 0, 0 ),\n    /*  INS_$9C  */   PACK( 0, 0 ),\n    /*  INS_$9D  */   PACK( 0, 0 ),\n    /*  INS_$9E  */   PACK( 0, 0 ),\n    /*  INS_$9F  */   PACK( 0, 0 ),\n\n    /*  INS_$A0  */   PACK( 0, 0 ),\n    /*  INS_$A1  */   PACK( 0, 0 ),\n    /*  INS_$A2  */   PACK( 0, 0 ),\n    /*  INS_$A3  */   PACK( 0, 0 ),\n    /*  INS_$A4  */   PACK( 0, 0 ),\n    /*  INS_$A5  */   PACK( 0, 0 ),\n    /*  INS_$A6  */   PACK( 0, 0 ),\n    /*  INS_$A7  */   PACK( 0, 0 ),\n    /*  INS_$A8  */   PACK( 0, 0 ),\n    /*  INS_$A9  */   PACK( 0, 0 ),\n    /*  INS_$AA  */   PACK( 0, 0 ),\n    /*  INS_$AB  */   PACK( 0, 0 ),\n    /*  INS_$AC  */   PACK( 0, 0 ),\n    /*  INS_$AD  */   PACK( 0, 0 ),\n    /*  INS_$AE  */   PACK( 0, 0 ),\n    /*  INS_$AF  */   PACK( 0, 0 ),\n\n    /*  PushB[0]  */  PACK( 0, 1 ),\n    /*  PushB[1]  */  PACK( 0, 2 ),\n    /*  PushB[2]  */  PACK( 0, 3 ),\n    /*  PushB[3]  */  PACK( 0, 4 ),\n    /*  PushB[4]  */  PACK( 0, 5 ),\n    /*  PushB[5]  */  PACK( 0, 6 ),\n    /*  PushB[6]  */  PACK( 0, 7 ),\n    /*  PushB[7]  */  PACK( 0, 8 ),\n    /*  PushW[0]  */  PACK( 0, 1 ),\n    /*  PushW[1]  */  PACK( 0, 2 ),\n    /*  PushW[2]  */  PACK( 0, 3 ),\n    /*  PushW[3]  */  PACK( 0, 4 ),\n    /*  PushW[4]  */  PACK( 0, 5 ),\n    /*  PushW[5]  */  PACK( 0, 6 ),\n    /*  PushW[6]  */  PACK( 0, 7 ),\n    /*  PushW[7]  */  PACK( 0, 8 ),\n\n    /*  MDRP[00]  */  PACK( 1, 0 ),\n    /*  MDRP[01]  */  PACK( 1, 0 ),\n    /*  MDRP[02]  */  PACK( 1, 0 ),\n    /*  MDRP[03]  */  PACK( 1, 0 ),\n    /*  MDRP[04]  */  PACK( 1, 0 ),\n    /*  MDRP[05]  */  PACK( 1, 0 ),\n    /*  MDRP[06]  */  PACK( 1, 0 ),\n    /*  MDRP[07]  */  PACK( 1, 0 ),\n    /*  MDRP[08]  */  PACK( 1, 0 ),\n    /*  MDRP[09]  */  PACK( 1, 0 ),\n    /*  MDRP[10]  */  PACK( 1, 0 ),\n    /*  MDRP[11]  */  PACK( 1, 0 ),\n    /*  MDRP[12]  */  PACK( 1, 0 ),\n    /*  MDRP[13]  */  PACK( 1, 0 ),\n    /*  MDRP[14]  */  PACK( 1, 0 ),\n    /*  MDRP[15]  */  PACK( 1, 0 ),\n\n    /*  MDRP[16]  */  PACK( 1, 0 ),\n    /*  MDRP[17]  */  PACK( 1, 0 ),\n    /*  MDRP[18]  */  PACK( 1, 0 ),\n    /*  MDRP[19]  */  PACK( 1, 0 ),\n    /*  MDRP[20]  */  PACK( 1, 0 ),\n    /*  MDRP[21]  */  PACK( 1, 0 ),\n    /*  MDRP[22]  */  PACK( 1, 0 ),\n    /*  MDRP[23]  */  PACK( 1, 0 ),\n    /*  MDRP[24]  */  PACK( 1, 0 ),\n    /*  MDRP[25]  */  PACK( 1, 0 ),\n    /*  MDRP[26]  */  PACK( 1, 0 ),\n    /*  MDRP[27]  */  PACK( 1, 0 ),\n    /*  MDRP[28]  */  PACK( 1, 0 ),\n    /*  MDRP[29]  */  PACK( 1, 0 ),\n    /*  MDRP[30]  */  PACK( 1, 0 ),\n    /*  MDRP[31]  */  PACK( 1, 0 ),\n\n    /*  MIRP[00]  */  PACK( 2, 0 ),\n    /*  MIRP[01]  */  PACK( 2, 0 ),\n    /*  MIRP[02]  */  PACK( 2, 0 ),\n    /*  MIRP[03]  */  PACK( 2, 0 ),\n    /*  MIRP[04]  */  PACK( 2, 0 ),\n    /*  MIRP[05]  */  PACK( 2, 0 ),\n    /*  MIRP[06]  */  PACK( 2, 0 ),\n    /*  MIRP[07]  */  PACK( 2, 0 ),\n    /*  MIRP[08]  */  PACK( 2, 0 ),\n    /*  MIRP[09]  */  PACK( 2, 0 ),\n    /*  MIRP[10]  */  PACK( 2, 0 ),\n    /*  MIRP[11]  */  PACK( 2, 0 ),\n    /*  MIRP[12]  */  PACK( 2, 0 ),\n    /*  MIRP[13]  */  PACK( 2, 0 ),\n    /*  MIRP[14]  */  PACK( 2, 0 ),\n    /*  MIRP[15]  */  PACK( 2, 0 ),\n\n    /*  MIRP[16]  */  PACK( 2, 0 ),\n    /*  MIRP[17]  */  PACK( 2, 0 ),\n    /*  MIRP[18]  */  PACK( 2, 0 ),\n    /*  MIRP[19]  */  PACK( 2, 0 ),\n    /*  MIRP[20]  */  PACK( 2, 0 ),\n    /*  MIRP[21]  */  PACK( 2, 0 ),\n    /*  MIRP[22]  */  PACK( 2, 0 ),\n    /*  MIRP[23]  */  PACK( 2, 0 ),\n    /*  MIRP[24]  */  PACK( 2, 0 ),\n    /*  MIRP[25]  */  PACK( 2, 0 ),\n    /*  MIRP[26]  */  PACK( 2, 0 ),\n    /*  MIRP[27]  */  PACK( 2, 0 ),\n    /*  MIRP[28]  */  PACK( 2, 0 ),\n    /*  MIRP[29]  */  PACK( 2, 0 ),\n    /*  MIRP[30]  */  PACK( 2, 0 ),\n    /*  MIRP[31]  */  PACK( 2, 0 )\n  };\n\n\n#ifdef FT_DEBUG_LEVEL_TRACE\n\n  static\n  const char*  const opcode_name[256] =\n  {\n    \"SVTCA y\",\n    \"SVTCA x\",\n    \"SPvTCA y\",\n    \"SPvTCA x\",\n    \"SFvTCA y\",\n    \"SFvTCA x\",\n    \"SPvTL ||\",\n    \"SPvTL +\",\n    \"SFvTL ||\",\n    \"SFvTL +\",\n    \"SPvFS\",\n    \"SFvFS\",\n    \"GPV\",\n    \"GFV\",\n    \"SFvTPv\",\n    \"ISECT\",\n\n    \"SRP0\",\n    \"SRP1\",\n    \"SRP2\",\n    \"SZP0\",\n    \"SZP1\",\n    \"SZP2\",\n    \"SZPS\",\n    \"SLOOP\",\n    \"RTG\",\n    \"RTHG\",\n    \"SMD\",\n    \"ELSE\",\n    \"JMPR\",\n    \"SCvTCi\",\n    \"SSwCi\",\n    \"SSW\",\n\n    \"DUP\",\n    \"POP\",\n    \"CLEAR\",\n    \"SWAP\",\n    \"DEPTH\",\n    \"CINDEX\",\n    \"MINDEX\",\n    \"AlignPTS\",\n    \"INS_$28\",\n    \"UTP\",\n    \"LOOPCALL\",\n    \"CALL\",\n    \"FDEF\",\n    \"ENDF\",\n    \"MDAP[0]\",\n    \"MDAP[1]\",\n\n    \"IUP[0]\",\n    \"IUP[1]\",\n    \"SHP[0]\",\n    \"SHP[1]\",\n    \"SHC[0]\",\n    \"SHC[1]\",\n    \"SHZ[0]\",\n    \"SHZ[1]\",\n    \"SHPIX\",\n    \"IP\",\n    \"MSIRP[0]\",\n    \"MSIRP[1]\",\n    \"AlignRP\",\n    \"RTDG\",\n    \"MIAP[0]\",\n    \"MIAP[1]\",\n\n    \"NPushB\",\n    \"NPushW\",\n    \"WS\",\n    \"RS\",\n    \"WCvtP\",\n    \"RCvt\",\n    \"GC[0]\",\n    \"GC[1]\",\n    \"SCFS\",\n    \"MD[0]\",\n    \"MD[1]\",\n    \"MPPEM\",\n    \"MPS\",\n    \"FlipON\",\n    \"FlipOFF\",\n    \"DEBUG\",\n\n    \"LT\",\n    \"LTEQ\",\n    \"GT\",\n    \"GTEQ\",\n    \"EQ\",\n    \"NEQ\",\n    \"ODD\",\n    \"EVEN\",\n    \"IF\",\n    \"EIF\",\n    \"AND\",\n    \"OR\",\n    \"NOT\",\n    \"DeltaP1\",\n    \"SDB\",\n    \"SDS\",\n\n    \"ADD\",\n    \"SUB\",\n    \"DIV\",\n    \"MUL\",\n    \"ABS\",\n    \"NEG\",\n    \"FLOOR\",\n    \"CEILING\",\n    \"ROUND[0]\",\n    \"ROUND[1]\",\n    \"ROUND[2]\",\n    \"ROUND[3]\",\n    \"NROUND[0]\",\n    \"NROUND[1]\",\n    \"NROUND[2]\",\n    \"NROUND[3]\",\n\n    \"WCvtF\",\n    \"DeltaP2\",\n    \"DeltaP3\",\n    \"DeltaCn[0]\",\n    \"DeltaCn[1]\",\n    \"DeltaCn[2]\",\n    \"SROUND\",\n    \"S45Round\",\n    \"JROT\",\n    \"JROF\",\n    \"ROFF\",\n    \"INS_$7B\",\n    \"RUTG\",\n    \"RDTG\",\n    \"SANGW\",\n    \"AA\",\n\n    \"FlipPT\",\n    \"FlipRgON\",\n    \"FlipRgOFF\",\n    \"INS_$83\",\n    \"INS_$84\",\n    \"ScanCTRL\",\n    \"SDVPTL[0]\",\n    \"SDVPTL[1]\",\n    \"GetINFO\",\n    \"IDEF\",\n    \"ROLL\",\n    \"MAX\",\n    \"MIN\",\n    \"ScanTYPE\",\n    \"InstCTRL\",\n    \"INS_$8F\",\n\n    \"INS_$90\",\n    \"INS_$91\",\n    \"INS_$92\",\n    \"INS_$93\",\n    \"INS_$94\",\n    \"INS_$95\",\n    \"INS_$96\",\n    \"INS_$97\",\n    \"INS_$98\",\n    \"INS_$99\",\n    \"INS_$9A\",\n    \"INS_$9B\",\n    \"INS_$9C\",\n    \"INS_$9D\",\n    \"INS_$9E\",\n    \"INS_$9F\",\n\n    \"INS_$A0\",\n    \"INS_$A1\",\n    \"INS_$A2\",\n    \"INS_$A3\",\n    \"INS_$A4\",\n    \"INS_$A5\",\n    \"INS_$A6\",\n    \"INS_$A7\",\n    \"INS_$A8\",\n    \"INS_$A9\",\n    \"INS_$AA\",\n    \"INS_$AB\",\n    \"INS_$AC\",\n    \"INS_$AD\",\n    \"INS_$AE\",\n    \"INS_$AF\",\n\n    \"PushB[0]\",\n    \"PushB[1]\",\n    \"PushB[2]\",\n    \"PushB[3]\",\n    \"PushB[4]\",\n    \"PushB[5]\",\n    \"PushB[6]\",\n    \"PushB[7]\",\n    \"PushW[0]\",\n    \"PushW[1]\",\n    \"PushW[2]\",\n    \"PushW[3]\",\n    \"PushW[4]\",\n    \"PushW[5]\",\n    \"PushW[6]\",\n    \"PushW[7]\",\n\n    \"MDRP[00]\",\n    \"MDRP[01]\",\n    \"MDRP[02]\",\n    \"MDRP[03]\",\n    \"MDRP[04]\",\n    \"MDRP[05]\",\n    \"MDRP[06]\",\n    \"MDRP[07]\",\n    \"MDRP[08]\",\n    \"MDRP[09]\",\n    \"MDRP[10]\",\n    \"MDRP[11]\",\n    \"MDRP[12]\",\n    \"MDRP[13]\",\n    \"MDRP[14]\",\n    \"MDRP[15]\",\n\n    \"MDRP[16]\",\n    \"MDRP[17]\",\n    \"MDRP[18]\",\n    \"MDRP[19]\",\n    \"MDRP[20]\",\n    \"MDRP[21]\",\n    \"MDRP[22]\",\n    \"MDRP[23]\",\n    \"MDRP[24]\",\n    \"MDRP[25]\",\n    \"MDRP[26]\",\n    \"MDRP[27]\",\n    \"MDRP[28]\",\n    \"MDRP[29]\",\n    \"MDRP[30]\",\n    \"MDRP[31]\",\n\n    \"MIRP[00]\",\n    \"MIRP[01]\",\n    \"MIRP[02]\",\n    \"MIRP[03]\",\n    \"MIRP[04]\",\n    \"MIRP[05]\",\n    \"MIRP[06]\",\n    \"MIRP[07]\",\n    \"MIRP[08]\",\n    \"MIRP[09]\",\n    \"MIRP[10]\",\n    \"MIRP[11]\",\n    \"MIRP[12]\",\n    \"MIRP[13]\",\n    \"MIRP[14]\",\n    \"MIRP[15]\",\n\n    \"MIRP[16]\",\n    \"MIRP[17]\",\n    \"MIRP[18]\",\n    \"MIRP[19]\",\n    \"MIRP[20]\",\n    \"MIRP[21]\",\n    \"MIRP[22]\",\n    \"MIRP[23]\",\n    \"MIRP[24]\",\n    \"MIRP[25]\",\n    \"MIRP[26]\",\n    \"MIRP[27]\",\n    \"MIRP[28]\",\n    \"MIRP[29]\",\n    \"MIRP[30]\",\n    \"MIRP[31]\"\n  };\n\n#endif /* FT_DEBUG_LEVEL_TRACE */\n\n\n  static\n  const FT_Char  opcode_length[256] =\n  {\n    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,\n    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,\n    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,\n    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,\n\n   -1,-2, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,\n    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,\n    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,\n    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,\n\n    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,\n    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,\n    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,\n    2, 3, 4, 5,  6, 7, 8, 9,  3, 5, 7, 9, 11,13,15,17,\n\n    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,\n    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,\n    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,\n    1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1\n  };\n\n#undef PACK\n\n\n#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER\n\n#if defined( __arm__ )                                 && \\\n    ( defined( __thumb2__ ) || !defined( __thumb__ ) )\n\n#define TT_MulFix14  TT_MulFix14_arm\n\n  static FT_Int32\n  TT_MulFix14_arm( FT_Int32  a,\n                   FT_Int    b )\n  {\n    FT_Int32  t, t2;\n\n\n#if defined( __CC_ARM ) || defined( __ARMCC__ )\n\n    __asm\n    {\n      smull t2, t,  b,  a           /* (lo=t2,hi=t) = a*b */\n      mov   a,  t,  asr #31         /* a   = (hi >> 31) */\n      add   a,  a,  #0x2000         /* a  += 0x2000 */\n      adds  t2, t2, a               /* t2 += a */\n      adc   t,  t,  #0              /* t  += carry */\n      mov   a,  t2, lsr #14         /* a   = t2 >> 14 */\n      orr   a,  a,  t,  lsl #18     /* a  |= t << 18 */\n    }\n\n#elif defined( __GNUC__ )\n\n    __asm__ __volatile__ (\n      \"smull  %1, %2, %4, %3\\n\\t\"       /* (lo=%1,hi=%2) = a*b */\n      \"mov    %0, %2, asr #31\\n\\t\"      /* %0  = (hi >> 31) */\n#if defined( __clang__ ) && defined( __thumb2__ )\n      \"add.w  %0, %0, #0x2000\\n\\t\"      /* %0 += 0x2000 */\n#else\n      \"add    %0, %0, #0x2000\\n\\t\"      /* %0 += 0x2000 */\n#endif\n      \"adds   %1, %1, %0\\n\\t\"           /* %1 += %0 */\n      \"adc    %2, %2, #0\\n\\t\"           /* %2 += carry */\n      \"mov    %0, %1, lsr #14\\n\\t\"      /* %0  = %1 >> 16 */\n      \"orr    %0, %0, %2, lsl #18\\n\\t\"  /* %0 |= %2 << 16 */\n      : \"=r\"(a), \"=&r\"(t2), \"=&r\"(t)\n      : \"r\"(a), \"r\"(b)\n      : \"cc\" );\n\n#endif\n\n    return a;\n  }\n\n#endif /* __arm__ && ( __thumb2__ || !__thumb__ ) */\n\n#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */\n\n\n#if defined( __GNUC__ )                              && \\\n    ( defined( __i386__ ) || defined( __x86_64__ ) )\n\n#define TT_MulFix14  TT_MulFix14_long_long\n\n  /* Temporarily disable the warning that C90 doesn't support `long long'. */\n#if ( __GNUC__ * 100 + __GNUC_MINOR__ ) >= 406\n#pragma GCC diagnostic push\n#endif\n#pragma GCC diagnostic ignored \"-Wlong-long\"\n\n  /* This is declared `noinline' because inlining the function results */\n  /* in slower code.  The `pure' attribute indicates that the result   */\n  /* only depends on the parameters.                                   */\n  static __attribute__(( noinline ))\n         __attribute__(( pure )) FT_Int32\n  TT_MulFix14_long_long( FT_Int32  a,\n                         FT_Int    b )\n  {\n\n    long long  ret = (long long)a * b;\n\n    /* The following line assumes that right shifting of signed values */\n    /* will actually preserve the sign bit.  The exact behaviour is    */\n    /* undefined, but this is true on x86 and x86_64.                  */\n    long long  tmp = ret >> 63;\n\n\n    ret += 0x2000 + tmp;\n\n    return (FT_Int32)( ret >> 14 );\n  }\n\n#if ( __GNUC__ * 100 + __GNUC_MINOR__ ) >= 406\n#pragma GCC diagnostic pop\n#endif\n\n#endif /* __GNUC__ && ( __i386__ || __x86_64__ ) */\n\n\n#ifndef TT_MulFix14\n\n  /* Compute (a*b)/2^14 with maximum accuracy and rounding.  */\n  /* This is optimized to be faster than calling FT_MulFix() */\n  /* for platforms where sizeof(int) == 2.                   */\n  static FT_Int32\n  TT_MulFix14( FT_Int32  a,\n               FT_Int    b )\n  {\n    FT_Int32   sign;\n    FT_UInt32  ah, al, mid, lo, hi;\n\n\n    sign = a ^ b;\n\n    if ( a < 0 )\n      a = -a;\n    if ( b < 0 )\n      b = -b;\n\n    ah = (FT_UInt32)( ( a >> 16 ) & 0xFFFFU );\n    al = (FT_UInt32)( a & 0xFFFFU );\n\n    lo    = al * b;\n    mid   = ah * b;\n    hi    = mid >> 16;\n    mid   = ( mid << 16 ) + ( 1 << 13 ); /* rounding */\n    lo   += mid;\n    if ( lo < mid )\n      hi += 1;\n\n    mid = ( lo >> 14 ) | ( hi << 18 );\n\n    return sign >= 0 ? (FT_Int32)mid : -(FT_Int32)mid;\n  }\n\n#endif  /* !TT_MulFix14 */\n\n\n#if defined( __GNUC__ )        && \\\n    ( defined( __i386__ )   ||    \\\n      defined( __x86_64__ ) ||    \\\n      defined( __arm__ )    )\n\n#define TT_DotFix14  TT_DotFix14_long_long\n\n#if ( __GNUC__ * 100 + __GNUC_MINOR__ ) >= 406\n#pragma GCC diagnostic push\n#endif\n#pragma GCC diagnostic ignored \"-Wlong-long\"\n\n  static __attribute__(( pure )) FT_Int32\n  TT_DotFix14_long_long( FT_Int32  ax,\n                         FT_Int32  ay,\n                         FT_Int    bx,\n                         FT_Int    by )\n  {\n    /* Temporarily disable the warning that C90 doesn't support */\n    /* `long long'.                                             */\n\n    long long  temp1 = (long long)ax * bx;\n    long long  temp2 = (long long)ay * by;\n\n\n    temp1 += temp2;\n    temp2  = temp1 >> 63;\n    temp1 += 0x2000 + temp2;\n\n    return (FT_Int32)( temp1 >> 14 );\n\n  }\n\n#if ( __GNUC__ * 100 + __GNUC_MINOR__ ) >= 406\n#pragma GCC diagnostic pop\n#endif\n\n#endif /* __GNUC__ && (__arm__ || __i386__ || __x86_64__) */\n\n\n#ifndef TT_DotFix14\n\n  /* compute (ax*bx+ay*by)/2^14 with maximum accuracy and rounding */\n  static FT_Int32\n  TT_DotFix14( FT_Int32  ax,\n               FT_Int32  ay,\n               FT_Int    bx,\n               FT_Int    by )\n  {\n    FT_Int32   m, s, hi1, hi2, hi;\n    FT_UInt32  l, lo1, lo2, lo;\n\n\n    /* compute ax*bx as 64-bit value */\n    l = (FT_UInt32)( ( ax & 0xFFFFU ) * bx );\n    m = ( ax >> 16 ) * bx;\n\n    lo1 = l + ( (FT_UInt32)m << 16 );\n    hi1 = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo1 < l );\n\n    /* compute ay*by as 64-bit value */\n    l = (FT_UInt32)( ( ay & 0xFFFFU ) * by );\n    m = ( ay >> 16 ) * by;\n\n    lo2 = l + ( (FT_UInt32)m << 16 );\n    hi2 = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo2 < l );\n\n    /* add them */\n    lo = lo1 + lo2;\n    hi = hi1 + hi2 + ( lo < lo1 );\n\n    /* divide the result by 2^14 with rounding */\n    s   = hi >> 31;\n    l   = lo + (FT_UInt32)s;\n    hi += s + ( l < lo );\n    lo  = l;\n\n    l   = lo + 0x2000U;\n    hi += ( l < lo );\n\n    return (FT_Int32)( ( (FT_UInt32)hi << 18 ) | ( l >> 14 ) );\n  }\n\n#endif /* TT_DotFix14 */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Current_Ratio                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Returns the current aspect ratio scaling factor depending on the   */\n  /*    projection vector's state and device resolutions.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The aspect ratio in 16.16 format, always <= 1.0 .                  */\n  /*                                                                       */\n  static FT_Long\n  Current_Ratio( EXEC_OP )\n  {\n    if ( !CUR.tt_metrics.ratio )\n    {\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n      if ( CUR.face->unpatented_hinting )\n      {\n        if ( CUR.GS.both_x_axis )\n          CUR.tt_metrics.ratio = CUR.tt_metrics.x_ratio;\n        else\n          CUR.tt_metrics.ratio = CUR.tt_metrics.y_ratio;\n      }\n      else\n#endif\n      {\n        if ( CUR.GS.projVector.y == 0 )\n          CUR.tt_metrics.ratio = CUR.tt_metrics.x_ratio;\n\n        else if ( CUR.GS.projVector.x == 0 )\n          CUR.tt_metrics.ratio = CUR.tt_metrics.y_ratio;\n\n        else\n        {\n          FT_F26Dot6  x, y;\n\n\n          x = TT_MulFix14( CUR.tt_metrics.x_ratio,\n                           CUR.GS.projVector.x );\n          y = TT_MulFix14( CUR.tt_metrics.y_ratio,\n                           CUR.GS.projVector.y );\n          CUR.tt_metrics.ratio = FT_Hypot( x, y );\n        }\n      }\n    }\n    return CUR.tt_metrics.ratio;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Long )\n  Current_Ppem( EXEC_OP )\n  {\n    return CUR.tt_metrics.ppem;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Long )\n  Current_Ppem_Stretched( EXEC_OP )\n  {\n    return FT_MulFix( CUR.tt_metrics.ppem, CURRENT_Ratio() );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Functions related to the control value table (CVT).                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  FT_CALLBACK_DEF( FT_F26Dot6 )\n  Read_CVT( EXEC_OP_ FT_ULong  idx )\n  {\n    return CUR.cvt[idx];\n  }\n\n\n  FT_CALLBACK_DEF( FT_F26Dot6 )\n  Read_CVT_Stretched( EXEC_OP_ FT_ULong  idx )\n  {\n    return FT_MulFix( CUR.cvt[idx], CURRENT_Ratio() );\n  }\n\n\n  FT_CALLBACK_DEF( void )\n  Write_CVT( EXEC_OP_ FT_ULong    idx,\n                      FT_F26Dot6  value )\n  {\n    CUR.cvt[idx] = value;\n  }\n\n\n  FT_CALLBACK_DEF( void )\n  Write_CVT_Stretched( EXEC_OP_ FT_ULong    idx,\n                                FT_F26Dot6  value )\n  {\n    CUR.cvt[idx] = FT_DivFix( value, CURRENT_Ratio() );\n  }\n\n\n  FT_CALLBACK_DEF( void )\n  Move_CVT( EXEC_OP_ FT_ULong    idx,\n                     FT_F26Dot6  value )\n  {\n    CUR.cvt[idx] += value;\n  }\n\n\n  FT_CALLBACK_DEF( void )\n  Move_CVT_Stretched( EXEC_OP_ FT_ULong    idx,\n                               FT_F26Dot6  value )\n  {\n    CUR.cvt[idx] += FT_DivFix( value, CURRENT_Ratio() );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    GetShortIns                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Returns a short integer taken from the instruction stream at       */\n  /*    address IP.                                                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Short read at code[IP].                                            */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This one could become a macro.                                     */\n  /*                                                                       */\n  static FT_Short\n  GetShortIns( EXEC_OP )\n  {\n    /* Reading a byte stream so there is no endianess (DaveP) */\n    CUR.IP += 2;\n    return (FT_Short)( ( CUR.code[CUR.IP - 2] << 8 ) +\n                         CUR.code[CUR.IP - 1]      );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Ins_Goto_CodeRange                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Goes to a certain code range in the instruction stream.            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    aRange :: The index of the code range.                             */\n  /*                                                                       */\n  /*    aIP    :: The new IP address in the code range.                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    SUCCESS or FAILURE.                                                */\n  /*                                                                       */\n  static FT_Bool\n  Ins_Goto_CodeRange( EXEC_OP_ FT_Int    aRange,\n                               FT_ULong  aIP )\n  {\n    TT_CodeRange*  range;\n\n\n    if ( aRange < 1 || aRange > 3 )\n    {\n      CUR.error = FT_THROW( Bad_Argument );\n      return FAILURE;\n    }\n\n    range = &CUR.codeRangeTable[aRange - 1];\n\n    if ( range->base == NULL )     /* invalid coderange */\n    {\n      CUR.error = FT_THROW( Invalid_CodeRange );\n      return FAILURE;\n    }\n\n    /* NOTE: Because the last instruction of a program may be a CALL */\n    /*       which will return to the first byte *after* the code    */\n    /*       range, we test for aIP <= Size, instead of aIP < Size.  */\n\n    if ( aIP > range->size )\n    {\n      CUR.error = FT_THROW( Code_Overflow );\n      return FAILURE;\n    }\n\n    CUR.code     = range->base;\n    CUR.codeSize = range->size;\n    CUR.IP       = aIP;\n    CUR.curRange = aRange;\n\n    return SUCCESS;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Direct_Move                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Moves a point by a given distance along the freedom vector.  The   */\n  /*    point will be `touched'.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    point    :: The index of the point to move.                        */\n  /*                                                                       */\n  /*    distance :: The distance to apply.                                 */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    zone     :: The affected glyph zone.                               */\n  /*                                                                       */\n  static void\n  Direct_Move( EXEC_OP_ TT_GlyphZone  zone,\n                        FT_UShort     point,\n                        FT_F26Dot6    distance )\n  {\n    FT_F26Dot6  v;\n\n\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n    FT_ASSERT( !CUR.face->unpatented_hinting );\n#endif\n\n    v = CUR.GS.freeVector.x;\n\n    if ( v != 0 )\n    {\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n      if ( !SUBPIXEL_HINTING                                     ||\n           ( !CUR.ignore_x_mode                                ||\n             ( CUR.sph_tweak_flags & SPH_TWEAK_ALLOW_X_DMOVE ) ) )\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n        zone->cur[point].x += FT_MulDiv( distance, v, CUR.F_dot_P );\n\n      zone->tags[point] |= FT_CURVE_TAG_TOUCH_X;\n    }\n\n    v = CUR.GS.freeVector.y;\n\n    if ( v != 0 )\n    {\n      zone->cur[point].y += FT_MulDiv( distance, v, CUR.F_dot_P );\n\n      zone->tags[point] |= FT_CURVE_TAG_TOUCH_Y;\n    }\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Direct_Move_Orig                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Moves the *original* position of a point by a given distance along */\n  /*    the freedom vector.  Obviously, the point will not be `touched'.   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    point    :: The index of the point to move.                        */\n  /*                                                                       */\n  /*    distance :: The distance to apply.                                 */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    zone     :: The affected glyph zone.                               */\n  /*                                                                       */\n  static void\n  Direct_Move_Orig( EXEC_OP_ TT_GlyphZone  zone,\n                             FT_UShort     point,\n                             FT_F26Dot6    distance )\n  {\n    FT_F26Dot6  v;\n\n\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n    FT_ASSERT( !CUR.face->unpatented_hinting );\n#endif\n\n    v = CUR.GS.freeVector.x;\n\n    if ( v != 0 )\n      zone->org[point].x += FT_MulDiv( distance, v, CUR.F_dot_P );\n\n    v = CUR.GS.freeVector.y;\n\n    if ( v != 0 )\n      zone->org[point].y += FT_MulDiv( distance, v, CUR.F_dot_P );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Special versions of Direct_Move()                                     */\n  /*                                                                       */\n  /*   The following versions are used whenever both vectors are both      */\n  /*   along one of the coordinate unit vectors, i.e. in 90% of the cases. */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  static void\n  Direct_Move_X( EXEC_OP_ TT_GlyphZone  zone,\n                          FT_UShort     point,\n                          FT_F26Dot6    distance )\n  {\n    FT_UNUSED_EXEC;\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    if ( !SUBPIXEL_HINTING  ||\n         !CUR.ignore_x_mode )\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n      zone->cur[point].x += distance;\n\n    zone->tags[point]  |= FT_CURVE_TAG_TOUCH_X;\n  }\n\n\n  static void\n  Direct_Move_Y( EXEC_OP_ TT_GlyphZone  zone,\n                          FT_UShort     point,\n                          FT_F26Dot6    distance )\n  {\n    FT_UNUSED_EXEC;\n\n    zone->cur[point].y += distance;\n    zone->tags[point]  |= FT_CURVE_TAG_TOUCH_Y;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Special versions of Direct_Move_Orig()                                */\n  /*                                                                       */\n  /*   The following versions are used whenever both vectors are both      */\n  /*   along one of the coordinate unit vectors, i.e. in 90% of the cases. */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  static void\n  Direct_Move_Orig_X( EXEC_OP_ TT_GlyphZone  zone,\n                               FT_UShort     point,\n                               FT_F26Dot6    distance )\n  {\n    FT_UNUSED_EXEC;\n\n    zone->org[point].x += distance;\n  }\n\n\n  static void\n  Direct_Move_Orig_Y( EXEC_OP_ TT_GlyphZone  zone,\n                               FT_UShort     point,\n                               FT_F26Dot6    distance )\n  {\n    FT_UNUSED_EXEC;\n\n    zone->org[point].y += distance;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Round_None                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Does not round, but adds engine compensation.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    distance     :: The distance (not) to round.                       */\n  /*                                                                       */\n  /*    compensation :: The engine compensation.                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The compensated distance.                                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The TrueType specification says very few about the relationship    */\n  /*    between rounding and engine compensation.  However, it seems from  */\n  /*    the description of super round that we should add the compensation */\n  /*    before rounding.                                                   */\n  /*                                                                       */\n  static FT_F26Dot6\n  Round_None( EXEC_OP_ FT_F26Dot6  distance,\n                       FT_F26Dot6  compensation )\n  {\n    FT_F26Dot6  val;\n\n    FT_UNUSED_EXEC;\n\n\n    if ( distance >= 0 )\n    {\n      val = distance + compensation;\n      if ( val < 0 )\n        val = 0;\n    }\n    else\n    {\n      val = distance - compensation;\n      if ( val > 0 )\n        val = 0;\n    }\n    return val;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Round_To_Grid                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Rounds value to grid after adding engine compensation.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    distance     :: The distance to round.                             */\n  /*                                                                       */\n  /*    compensation :: The engine compensation.                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Rounded distance.                                                  */\n  /*                                                                       */\n  static FT_F26Dot6\n  Round_To_Grid( EXEC_OP_ FT_F26Dot6  distance,\n                          FT_F26Dot6  compensation )\n  {\n    FT_F26Dot6  val;\n\n    FT_UNUSED_EXEC;\n\n\n    if ( distance >= 0 )\n    {\n      val = FT_PIX_ROUND( distance + compensation );\n      if ( val < 0 )\n        val = 0;\n    }\n    else\n    {\n      val = -FT_PIX_ROUND( compensation - distance );\n      if ( val > 0 )\n        val = 0;\n    }\n\n    return  val;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Round_To_Half_Grid                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Rounds value to half grid after adding engine compensation.        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    distance     :: The distance to round.                             */\n  /*                                                                       */\n  /*    compensation :: The engine compensation.                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Rounded distance.                                                  */\n  /*                                                                       */\n  static FT_F26Dot6\n  Round_To_Half_Grid( EXEC_OP_ FT_F26Dot6  distance,\n                               FT_F26Dot6  compensation )\n  {\n    FT_F26Dot6  val;\n\n    FT_UNUSED_EXEC;\n\n\n    if ( distance >= 0 )\n    {\n      val = FT_PIX_FLOOR( distance + compensation ) + 32;\n      if ( val < 0 )\n        val = 32;\n    }\n    else\n    {\n      val = -( FT_PIX_FLOOR( compensation - distance ) + 32 );\n      if ( val > 0 )\n        val = -32;\n    }\n\n    return val;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Round_Down_To_Grid                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Rounds value down to grid after adding engine compensation.        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    distance     :: The distance to round.                             */\n  /*                                                                       */\n  /*    compensation :: The engine compensation.                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Rounded distance.                                                  */\n  /*                                                                       */\n  static FT_F26Dot6\n  Round_Down_To_Grid( EXEC_OP_ FT_F26Dot6  distance,\n                               FT_F26Dot6  compensation )\n  {\n    FT_F26Dot6  val;\n\n    FT_UNUSED_EXEC;\n\n\n    if ( distance >= 0 )\n    {\n      val = FT_PIX_FLOOR( distance + compensation );\n      if ( val < 0 )\n        val = 0;\n    }\n    else\n    {\n      val = -FT_PIX_FLOOR( compensation - distance );\n      if ( val > 0 )\n        val = 0;\n    }\n\n    return val;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Round_Up_To_Grid                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Rounds value up to grid after adding engine compensation.          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    distance     :: The distance to round.                             */\n  /*                                                                       */\n  /*    compensation :: The engine compensation.                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Rounded distance.                                                  */\n  /*                                                                       */\n  static FT_F26Dot6\n  Round_Up_To_Grid( EXEC_OP_ FT_F26Dot6  distance,\n                             FT_F26Dot6  compensation )\n  {\n    FT_F26Dot6  val;\n\n    FT_UNUSED_EXEC;\n\n\n    if ( distance >= 0 )\n    {\n      val = FT_PIX_CEIL( distance + compensation );\n      if ( val < 0 )\n        val = 0;\n    }\n    else\n    {\n      val = -FT_PIX_CEIL( compensation - distance );\n      if ( val > 0 )\n        val = 0;\n    }\n\n    return val;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Round_To_Double_Grid                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Rounds value to double grid after adding engine compensation.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    distance     :: The distance to round.                             */\n  /*                                                                       */\n  /*    compensation :: The engine compensation.                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Rounded distance.                                                  */\n  /*                                                                       */\n  static FT_F26Dot6\n  Round_To_Double_Grid( EXEC_OP_ FT_F26Dot6  distance,\n                                 FT_F26Dot6  compensation )\n  {\n    FT_F26Dot6 val;\n\n    FT_UNUSED_EXEC;\n\n\n    if ( distance >= 0 )\n    {\n      val = FT_PAD_ROUND( distance + compensation, 32 );\n      if ( val < 0 )\n        val = 0;\n    }\n    else\n    {\n      val = -FT_PAD_ROUND( compensation - distance, 32 );\n      if ( val > 0 )\n        val = 0;\n    }\n\n    return val;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Round_Super                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Super-rounds value to grid after adding engine compensation.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    distance     :: The distance to round.                             */\n  /*                                                                       */\n  /*    compensation :: The engine compensation.                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Rounded distance.                                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The TrueType specification says very few about the relationship    */\n  /*    between rounding and engine compensation.  However, it seems from  */\n  /*    the description of super round that we should add the compensation */\n  /*    before rounding.                                                   */\n  /*                                                                       */\n  static FT_F26Dot6\n  Round_Super( EXEC_OP_ FT_F26Dot6  distance,\n                        FT_F26Dot6  compensation )\n  {\n    FT_F26Dot6  val;\n\n\n    if ( distance >= 0 )\n    {\n      val = ( distance - CUR.phase + CUR.threshold + compensation ) &\n              -CUR.period;\n      val += CUR.phase;\n      if ( val < 0 )\n        val = CUR.phase;\n    }\n    else\n    {\n      val = -( ( CUR.threshold - CUR.phase - distance + compensation ) &\n               -CUR.period );\n      val -= CUR.phase;\n      if ( val > 0 )\n        val = -CUR.phase;\n    }\n\n    return val;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Round_Super_45                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Super-rounds value to grid after adding engine compensation.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    distance     :: The distance to round.                             */\n  /*                                                                       */\n  /*    compensation :: The engine compensation.                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Rounded distance.                                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    There is a separate function for Round_Super_45() as we may need   */\n  /*    greater precision.                                                 */\n  /*                                                                       */\n  static FT_F26Dot6\n  Round_Super_45( EXEC_OP_ FT_F26Dot6  distance,\n                           FT_F26Dot6  compensation )\n  {\n    FT_F26Dot6  val;\n\n\n    if ( distance >= 0 )\n    {\n      val = ( ( distance - CUR.phase + CUR.threshold + compensation ) /\n                CUR.period ) * CUR.period;\n      val += CUR.phase;\n      if ( val < 0 )\n        val = CUR.phase;\n    }\n    else\n    {\n      val = -( ( ( CUR.threshold - CUR.phase - distance + compensation ) /\n                   CUR.period ) * CUR.period );\n      val -= CUR.phase;\n      if ( val > 0 )\n        val = -CUR.phase;\n    }\n\n    return val;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Compute_Round                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Sets the rounding mode.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    round_mode :: The rounding mode to be used.                        */\n  /*                                                                       */\n  static void\n  Compute_Round( EXEC_OP_ FT_Byte  round_mode )\n  {\n    switch ( round_mode )\n    {\n    case TT_Round_Off:\n      CUR.func_round = (TT_Round_Func)Round_None;\n      break;\n\n    case TT_Round_To_Grid:\n      CUR.func_round = (TT_Round_Func)Round_To_Grid;\n      break;\n\n    case TT_Round_Up_To_Grid:\n      CUR.func_round = (TT_Round_Func)Round_Up_To_Grid;\n      break;\n\n    case TT_Round_Down_To_Grid:\n      CUR.func_round = (TT_Round_Func)Round_Down_To_Grid;\n      break;\n\n    case TT_Round_To_Half_Grid:\n      CUR.func_round = (TT_Round_Func)Round_To_Half_Grid;\n      break;\n\n    case TT_Round_To_Double_Grid:\n      CUR.func_round = (TT_Round_Func)Round_To_Double_Grid;\n      break;\n\n    case TT_Round_Super:\n      CUR.func_round = (TT_Round_Func)Round_Super;\n      break;\n\n    case TT_Round_Super_45:\n      CUR.func_round = (TT_Round_Func)Round_Super_45;\n      break;\n    }\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    SetSuperRound                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Sets Super Round parameters.                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    GridPeriod :: The grid period.                                     */\n  /*                                                                       */\n  /*    selector   :: The SROUND opcode.                                   */\n  /*                                                                       */\n  static void\n  SetSuperRound( EXEC_OP_ FT_F26Dot6  GridPeriod,\n                          FT_Long     selector )\n  {\n    switch ( (FT_Int)( selector & 0xC0 ) )\n    {\n      case 0:\n        CUR.period = GridPeriod / 2;\n        break;\n\n      case 0x40:\n        CUR.period = GridPeriod;\n        break;\n\n      case 0x80:\n        CUR.period = GridPeriod * 2;\n        break;\n\n      /* This opcode is reserved, but... */\n\n      case 0xC0:\n        CUR.period = GridPeriod;\n        break;\n    }\n\n    switch ( (FT_Int)( selector & 0x30 ) )\n    {\n    case 0:\n      CUR.phase = 0;\n      break;\n\n    case 0x10:\n      CUR.phase = CUR.period / 4;\n      break;\n\n    case 0x20:\n      CUR.phase = CUR.period / 2;\n      break;\n\n    case 0x30:\n      CUR.phase = CUR.period * 3 / 4;\n      break;\n    }\n\n    if ( ( selector & 0x0F ) == 0 )\n      CUR.threshold = CUR.period - 1;\n    else\n      CUR.threshold = ( (FT_Int)( selector & 0x0F ) - 4 ) * CUR.period / 8;\n\n    CUR.period    /= 256;\n    CUR.phase     /= 256;\n    CUR.threshold /= 256;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Project                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Computes the projection of vector given by (v2-v1) along the       */\n  /*    current projection vector.                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    v1 :: First input vector.                                          */\n  /*    v2 :: Second input vector.                                         */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The distance in F26dot6 format.                                    */\n  /*                                                                       */\n  static FT_F26Dot6\n  Project( EXEC_OP_ FT_Pos  dx,\n                    FT_Pos  dy )\n  {\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n    FT_ASSERT( !CUR.face->unpatented_hinting );\n#endif\n\n    return TT_DotFix14( (FT_UInt32)dx, (FT_UInt32)dy,\n                        CUR.GS.projVector.x,\n                        CUR.GS.projVector.y );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Dual_Project                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Computes the projection of the vector given by (v2-v1) along the   */\n  /*    current dual vector.                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    v1 :: First input vector.                                          */\n  /*    v2 :: Second input vector.                                         */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The distance in F26dot6 format.                                    */\n  /*                                                                       */\n  static FT_F26Dot6\n  Dual_Project( EXEC_OP_ FT_Pos  dx,\n                         FT_Pos  dy )\n  {\n    return TT_DotFix14( (FT_UInt32)dx, (FT_UInt32)dy,\n                        CUR.GS.dualVector.x,\n                        CUR.GS.dualVector.y );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Project_x                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Computes the projection of the vector given by (v2-v1) along the   */\n  /*    horizontal axis.                                                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    v1 :: First input vector.                                          */\n  /*    v2 :: Second input vector.                                         */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The distance in F26dot6 format.                                    */\n  /*                                                                       */\n  static FT_F26Dot6\n  Project_x( EXEC_OP_ FT_Pos  dx,\n                      FT_Pos  dy )\n  {\n    FT_UNUSED_EXEC;\n    FT_UNUSED( dy );\n\n    return dx;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Project_y                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Computes the projection of the vector given by (v2-v1) along the   */\n  /*    vertical axis.                                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    v1 :: First input vector.                                          */\n  /*    v2 :: Second input vector.                                         */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The distance in F26dot6 format.                                    */\n  /*                                                                       */\n  static FT_F26Dot6\n  Project_y( EXEC_OP_ FT_Pos  dx,\n                      FT_Pos  dy )\n  {\n    FT_UNUSED_EXEC;\n    FT_UNUSED( dx );\n\n    return dy;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Compute_Funcs                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Computes the projection and movement function pointers according   */\n  /*    to the current graphics state.                                     */\n  /*                                                                       */\n  static void\n  Compute_Funcs( EXEC_OP )\n  {\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n    if ( CUR.face->unpatented_hinting )\n    {\n      /* If both vectors point rightwards along the x axis, set             */\n      /* `both-x-axis' true, otherwise set it false.  The x values only     */\n      /* need be tested because the vector has been normalised to a unit    */\n      /* vector of length 0x4000 = unity.                                   */\n      CUR.GS.both_x_axis = (FT_Bool)( CUR.GS.projVector.x == 0x4000 &&\n                                      CUR.GS.freeVector.x == 0x4000 );\n\n      /* Throw away projection and freedom vector information */\n      /* because the patents don't allow them to be stored.   */\n      /* The relevant US Patents are 5155805 and 5325479.     */\n      CUR.GS.projVector.x = 0;\n      CUR.GS.projVector.y = 0;\n      CUR.GS.freeVector.x = 0;\n      CUR.GS.freeVector.y = 0;\n\n      if ( CUR.GS.both_x_axis )\n      {\n        CUR.func_project   = Project_x;\n        CUR.func_move      = Direct_Move_X;\n        CUR.func_move_orig = Direct_Move_Orig_X;\n      }\n      else\n      {\n        CUR.func_project   = Project_y;\n        CUR.func_move      = Direct_Move_Y;\n        CUR.func_move_orig = Direct_Move_Orig_Y;\n      }\n\n      if ( CUR.GS.dualVector.x == 0x4000 )\n        CUR.func_dualproj = Project_x;\n      else if ( CUR.GS.dualVector.y == 0x4000 )\n        CUR.func_dualproj = Project_y;\n      else\n        CUR.func_dualproj = Dual_Project;\n\n      /* Force recalculation of cached aspect ratio */\n      CUR.tt_metrics.ratio = 0;\n\n      return;\n    }\n#endif /* TT_CONFIG_OPTION_UNPATENTED_HINTING */\n\n    if ( CUR.GS.freeVector.x == 0x4000 )\n      CUR.F_dot_P = CUR.GS.projVector.x;\n    else if ( CUR.GS.freeVector.y == 0x4000 )\n      CUR.F_dot_P = CUR.GS.projVector.y;\n    else\n      CUR.F_dot_P = ( (FT_Long)CUR.GS.projVector.x * CUR.GS.freeVector.x +\n                      (FT_Long)CUR.GS.projVector.y * CUR.GS.freeVector.y ) >>\n                    14;\n\n    if ( CUR.GS.projVector.x == 0x4000 )\n      CUR.func_project = (TT_Project_Func)Project_x;\n    else if ( CUR.GS.projVector.y == 0x4000 )\n      CUR.func_project = (TT_Project_Func)Project_y;\n    else\n      CUR.func_project = (TT_Project_Func)Project;\n\n    if ( CUR.GS.dualVector.x == 0x4000 )\n      CUR.func_dualproj = (TT_Project_Func)Project_x;\n    else if ( CUR.GS.dualVector.y == 0x4000 )\n      CUR.func_dualproj = (TT_Project_Func)Project_y;\n    else\n      CUR.func_dualproj = (TT_Project_Func)Dual_Project;\n\n    CUR.func_move      = (TT_Move_Func)Direct_Move;\n    CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig;\n\n    if ( CUR.F_dot_P == 0x4000L )\n    {\n      if ( CUR.GS.freeVector.x == 0x4000 )\n      {\n        CUR.func_move      = (TT_Move_Func)Direct_Move_X;\n        CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_X;\n      }\n      else if ( CUR.GS.freeVector.y == 0x4000 )\n      {\n        CUR.func_move      = (TT_Move_Func)Direct_Move_Y;\n        CUR.func_move_orig = (TT_Move_Func)Direct_Move_Orig_Y;\n      }\n    }\n\n    /* at small sizes, F_dot_P can become too small, resulting   */\n    /* in overflows and `spikes' in a number of glyphs like `w'. */\n\n    if ( FT_ABS( CUR.F_dot_P ) < 0x400L )\n      CUR.F_dot_P = 0x4000L;\n\n    /* Disable cached aspect ratio */\n    CUR.tt_metrics.ratio = 0;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Normalize                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Norms a vector.                                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    Vx :: The horizontal input vector coordinate.                      */\n  /*    Vy :: The vertical input vector coordinate.                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    R  :: The normed unit vector.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Returns FAILURE if a vector parameter is zero.                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    In case Vx and Vy are both zero, Normalize() returns SUCCESS, and  */\n  /*    R is undefined.                                                    */\n  /*                                                                       */\n  static FT_Bool\n  Normalize( EXEC_OP_ FT_F26Dot6      Vx,\n                      FT_F26Dot6      Vy,\n                      FT_UnitVector*  R )\n  {\n    FT_F26Dot6  W;\n\n    FT_UNUSED_EXEC;\n\n\n    if ( FT_ABS( Vx ) < 0x4000L && FT_ABS( Vy ) < 0x4000L )\n    {\n      if ( Vx == 0 && Vy == 0 )\n      {\n        /* XXX: UNDOCUMENTED! It seems that it is possible to try   */\n        /*      to normalize the vector (0,0).  Return immediately. */\n        return SUCCESS;\n      }\n\n      Vx *= 0x4000;\n      Vy *= 0x4000;\n    }\n\n    W = FT_Hypot( Vx, Vy );\n\n    R->x = (FT_F2Dot14)TT_DivFix14( Vx, W );\n    R->y = (FT_F2Dot14)TT_DivFix14( Vy, W );\n\n    return SUCCESS;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Here we start with the implementation of the various opcodes.         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  static FT_Bool\n  Ins_SxVTL( EXEC_OP_ FT_UShort       aIdx1,\n                      FT_UShort       aIdx2,\n                      FT_Int          aOpc,\n                      FT_UnitVector*  Vec )\n  {\n    FT_Long     A, B, C;\n    FT_Vector*  p1;\n    FT_Vector*  p2;\n\n\n    if ( BOUNDS( aIdx1, CUR.zp2.n_points ) ||\n         BOUNDS( aIdx2, CUR.zp1.n_points ) )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      return FAILURE;\n    }\n\n    p1 = CUR.zp1.cur + aIdx2;\n    p2 = CUR.zp2.cur + aIdx1;\n\n    A = p1->x - p2->x;\n    B = p1->y - p2->y;\n\n    /* If p1 == p2, SPVTL and SFVTL behave the same as */\n    /* SPVTCA[X] and SFVTCA[X], respectively.          */\n    /*                                                 */\n    /* Confirmed by Greg Hitchcock.                    */\n\n    if ( A == 0 && B == 0 )\n    {\n      A    = 0x4000;\n      aOpc = 0;\n    }\n\n    if ( ( aOpc & 1 ) != 0 )\n    {\n      C =  B;   /* counter clockwise rotation */\n      B =  A;\n      A = -C;\n    }\n\n    NORMalize( A, B, Vec );\n\n    return SUCCESS;\n  }\n\n\n  /* When not using the big switch statements, the interpreter uses a */\n  /* call table defined later below in this source.  Each opcode must */\n  /* thus have a corresponding function, even trivial ones.           */\n  /*                                                                  */\n  /* They are all defined there.                                      */\n\n#define DO_SVTCA                            \\\n  {                                         \\\n    FT_Short  A, B;                         \\\n                                            \\\n                                            \\\n    A = (FT_Short)( CUR.opcode & 1 ) << 14; \\\n    B = A ^ (FT_Short)0x4000;               \\\n                                            \\\n    CUR.GS.freeVector.x = A;                \\\n    CUR.GS.projVector.x = A;                \\\n    CUR.GS.dualVector.x = A;                \\\n                                            \\\n    CUR.GS.freeVector.y = B;                \\\n    CUR.GS.projVector.y = B;                \\\n    CUR.GS.dualVector.y = B;                \\\n                                            \\\n    COMPUTE_Funcs();                        \\\n  }\n\n\n#define DO_SPVTCA                           \\\n  {                                         \\\n    FT_Short  A, B;                         \\\n                                            \\\n                                            \\\n    A = (FT_Short)( CUR.opcode & 1 ) << 14; \\\n    B = A ^ (FT_Short)0x4000;               \\\n                                            \\\n    CUR.GS.projVector.x = A;                \\\n    CUR.GS.dualVector.x = A;                \\\n                                            \\\n    CUR.GS.projVector.y = B;                \\\n    CUR.GS.dualVector.y = B;                \\\n                                            \\\n    GUESS_VECTOR( freeVector );             \\\n                                            \\\n    COMPUTE_Funcs();                        \\\n  }\n\n\n#define DO_SFVTCA                           \\\n  {                                         \\\n    FT_Short  A, B;                         \\\n                                            \\\n                                            \\\n    A = (FT_Short)( CUR.opcode & 1 ) << 14; \\\n    B = A ^ (FT_Short)0x4000;               \\\n                                            \\\n    CUR.GS.freeVector.x = A;                \\\n    CUR.GS.freeVector.y = B;                \\\n                                            \\\n    GUESS_VECTOR( projVector );             \\\n                                            \\\n    COMPUTE_Funcs();                        \\\n  }\n\n\n#define DO_SPVTL                                      \\\n    if ( INS_SxVTL( (FT_UShort)args[1],               \\\n                    (FT_UShort)args[0],               \\\n                    CUR.opcode,                       \\\n                    &CUR.GS.projVector ) == SUCCESS ) \\\n    {                                                 \\\n      CUR.GS.dualVector = CUR.GS.projVector;          \\\n      GUESS_VECTOR( freeVector );                     \\\n      COMPUTE_Funcs();                                \\\n    }\n\n\n#define DO_SFVTL                                      \\\n    if ( INS_SxVTL( (FT_UShort)args[1],               \\\n                    (FT_UShort)args[0],               \\\n                    CUR.opcode,                       \\\n                    &CUR.GS.freeVector ) == SUCCESS ) \\\n    {                                                 \\\n      GUESS_VECTOR( projVector );                     \\\n      COMPUTE_Funcs();                                \\\n    }\n\n\n#define DO_SFVTPV                          \\\n    GUESS_VECTOR( projVector );            \\\n    CUR.GS.freeVector = CUR.GS.projVector; \\\n    COMPUTE_Funcs();\n\n\n#define DO_SPVFS                                \\\n  {                                             \\\n    FT_Short  S;                                \\\n    FT_Long   X, Y;                             \\\n                                                \\\n                                                \\\n    /* Only use low 16bits, then sign extend */ \\\n    S = (FT_Short)args[1];                      \\\n    Y = (FT_Long)S;                             \\\n    S = (FT_Short)args[0];                      \\\n    X = (FT_Long)S;                             \\\n                                                \\\n    NORMalize( X, Y, &CUR.GS.projVector );      \\\n                                                \\\n    CUR.GS.dualVector = CUR.GS.projVector;      \\\n    GUESS_VECTOR( freeVector );                 \\\n    COMPUTE_Funcs();                            \\\n  }\n\n\n#define DO_SFVFS                                \\\n  {                                             \\\n    FT_Short  S;                                \\\n    FT_Long   X, Y;                             \\\n                                                \\\n                                                \\\n    /* Only use low 16bits, then sign extend */ \\\n    S = (FT_Short)args[1];                      \\\n    Y = (FT_Long)S;                             \\\n    S = (FT_Short)args[0];                      \\\n    X = S;                                      \\\n                                                \\\n    NORMalize( X, Y, &CUR.GS.freeVector );      \\\n    GUESS_VECTOR( projVector );                 \\\n    COMPUTE_Funcs();                            \\\n  }\n\n\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n#define DO_GPV                                   \\\n    if ( CUR.face->unpatented_hinting )          \\\n    {                                            \\\n      args[0] = CUR.GS.both_x_axis ? 0x4000 : 0; \\\n      args[1] = CUR.GS.both_x_axis ? 0 : 0x4000; \\\n    }                                            \\\n    else                                         \\\n    {                                            \\\n      args[0] = CUR.GS.projVector.x;             \\\n      args[1] = CUR.GS.projVector.y;             \\\n    }\n#else\n#define DO_GPV                                   \\\n    args[0] = CUR.GS.projVector.x;               \\\n    args[1] = CUR.GS.projVector.y;\n#endif\n\n\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n#define DO_GFV                                   \\\n    if ( CUR.face->unpatented_hinting )          \\\n    {                                            \\\n      args[0] = CUR.GS.both_x_axis ? 0x4000 : 0; \\\n      args[1] = CUR.GS.both_x_axis ? 0 : 0x4000; \\\n    }                                            \\\n    else                                         \\\n    {                                            \\\n      args[0] = CUR.GS.freeVector.x;             \\\n      args[1] = CUR.GS.freeVector.y;             \\\n    }\n#else\n#define DO_GFV                                   \\\n    args[0] = CUR.GS.freeVector.x;               \\\n    args[1] = CUR.GS.freeVector.y;\n#endif\n\n\n#define DO_SRP0                      \\\n    CUR.GS.rp0 = (FT_UShort)args[0];\n\n\n#define DO_SRP1                      \\\n    CUR.GS.rp1 = (FT_UShort)args[0];\n\n\n#define DO_SRP2                      \\\n    CUR.GS.rp2 = (FT_UShort)args[0];\n\n\n#define DO_RTHG                                         \\\n    CUR.GS.round_state = TT_Round_To_Half_Grid;         \\\n    CUR.func_round = (TT_Round_Func)Round_To_Half_Grid;\n\n\n#define DO_RTG                                     \\\n    CUR.GS.round_state = TT_Round_To_Grid;         \\\n    CUR.func_round = (TT_Round_Func)Round_To_Grid;\n\n\n#define DO_RTDG                                           \\\n    CUR.GS.round_state = TT_Round_To_Double_Grid;         \\\n    CUR.func_round = (TT_Round_Func)Round_To_Double_Grid;\n\n\n#define DO_RUTG                                       \\\n    CUR.GS.round_state = TT_Round_Up_To_Grid;         \\\n    CUR.func_round = (TT_Round_Func)Round_Up_To_Grid;\n\n\n#define DO_RDTG                                         \\\n    CUR.GS.round_state = TT_Round_Down_To_Grid;         \\\n    CUR.func_round = (TT_Round_Func)Round_Down_To_Grid;\n\n\n#define DO_ROFF                                 \\\n    CUR.GS.round_state = TT_Round_Off;          \\\n    CUR.func_round = (TT_Round_Func)Round_None;\n\n\n#define DO_SROUND                                \\\n    SET_SuperRound( 0x4000, args[0] );           \\\n    CUR.GS.round_state = TT_Round_Super;         \\\n    CUR.func_round = (TT_Round_Func)Round_Super;\n\n\n#define DO_S45ROUND                                 \\\n    SET_SuperRound( 0x2D41, args[0] );              \\\n    CUR.GS.round_state = TT_Round_Super_45;         \\\n    CUR.func_round = (TT_Round_Func)Round_Super_45;\n\n\n#define DO_SLOOP                            \\\n    if ( args[0] < 0 )                      \\\n      CUR.error = FT_THROW( Bad_Argument ); \\\n    else                                    \\\n      CUR.GS.loop = args[0];\n\n\n#define DO_SMD                         \\\n    CUR.GS.minimum_distance = args[0];\n\n\n#define DO_SCVTCI                                     \\\n    CUR.GS.control_value_cutin = (FT_F26Dot6)args[0];\n\n\n#define DO_SSWCI                                     \\\n    CUR.GS.single_width_cutin = (FT_F26Dot6)args[0];\n\n\n#define DO_SSW                                                     \\\n    CUR.GS.single_width_value = FT_MulFix( args[0],                \\\n                                           CUR.tt_metrics.scale );\n\n\n#define DO_FLIPON            \\\n    CUR.GS.auto_flip = TRUE;\n\n\n#define DO_FLIPOFF            \\\n    CUR.GS.auto_flip = FALSE;\n\n\n#define DO_SDB                              \\\n    CUR.GS.delta_base = (FT_UShort)args[0];\n\n\n#define DO_SDS                                 \\\n    if ( (FT_ULong)args[0] > 6UL )             \\\n      CUR.error = FT_THROW( Bad_Argument );    \\\n    else                                       \\\n      CUR.GS.delta_shift = (FT_UShort)args[0];\n\n\n#define DO_MD  /* nothing */\n\n\n#define DO_MPPEM                   \\\n    args[0] = CUR_Func_cur_ppem();\n\n\n  /* Note: The pointSize should be irrelevant in a given font program; */\n  /*       we thus decide to return only the ppem.                     */\n#if 0\n\n#define DO_MPS                       \\\n    args[0] = CUR.metrics.pointSize;\n\n#else\n\n#define DO_MPS                     \\\n    args[0] = CUR_Func_cur_ppem();\n\n#endif /* 0 */\n\n\n#define DO_DUP         \\\n    args[1] = args[0];\n\n\n#define DO_CLEAR     \\\n    CUR.new_top = 0;\n\n\n#define DO_SWAP        \\\n  {                    \\\n    FT_Long  L;        \\\n                       \\\n                       \\\n    L       = args[0]; \\\n    args[0] = args[1]; \\\n    args[1] = L;       \\\n  }\n\n\n#define DO_DEPTH       \\\n    args[0] = CUR.top;\n\n\n#define DO_CINDEX                                  \\\n  {                                                \\\n    FT_Long  L;                                    \\\n                                                   \\\n                                                   \\\n    L = args[0];                                   \\\n                                                   \\\n    if ( L <= 0 || L > CUR.args )                  \\\n    {                                              \\\n      if ( CUR.pedantic_hinting )                  \\\n        CUR.error = FT_THROW( Invalid_Reference ); \\\n      args[0] = 0;                                 \\\n    }                                              \\\n    else                                           \\\n      args[0] = CUR.stack[CUR.args - L];           \\\n  }\n\n\n#define DO_JROT                                                    \\\n    if ( args[1] != 0 )                                            \\\n    {                                                              \\\n      if ( args[0] == 0 && CUR.args == 0 )                         \\\n        CUR.error = FT_THROW( Bad_Argument );                      \\\n      CUR.IP += args[0];                                           \\\n      if ( CUR.IP < 0                                           || \\\n           ( CUR.callTop > 0                                  &&   \\\n             CUR.IP > CUR.callStack[CUR.callTop - 1].Def->end ) )  \\\n        CUR.error = FT_THROW( Bad_Argument );                      \\\n      CUR.step_ins = FALSE;                                        \\\n    }\n\n\n#define DO_JMPR                                                  \\\n    if ( args[0] == 0 && CUR.args == 0 )                         \\\n      CUR.error = FT_THROW( Bad_Argument );                      \\\n    CUR.IP += args[0];                                           \\\n    if ( CUR.IP < 0                                           || \\\n         ( CUR.callTop > 0                                  &&   \\\n           CUR.IP > CUR.callStack[CUR.callTop - 1].Def->end ) )  \\\n      CUR.error = FT_THROW( Bad_Argument );                      \\\n    CUR.step_ins = FALSE;\n\n\n#define DO_JROF                                                    \\\n    if ( args[1] == 0 )                                            \\\n    {                                                              \\\n      if ( args[0] == 0 && CUR.args == 0 )                         \\\n        CUR.error = FT_THROW( Bad_Argument );                      \\\n      CUR.IP += args[0];                                           \\\n      if ( CUR.IP < 0                                           || \\\n           ( CUR.callTop > 0                                  &&   \\\n             CUR.IP > CUR.callStack[CUR.callTop - 1].Def->end ) )  \\\n        CUR.error = FT_THROW( Bad_Argument );                      \\\n      CUR.step_ins = FALSE;                                        \\\n    }\n\n\n#define DO_LT                        \\\n    args[0] = ( args[0] < args[1] );\n\n\n#define DO_LTEQ                       \\\n    args[0] = ( args[0] <= args[1] );\n\n\n#define DO_GT                        \\\n    args[0] = ( args[0] > args[1] );\n\n\n#define DO_GTEQ                       \\\n    args[0] = ( args[0] >= args[1] );\n\n\n#define DO_EQ                         \\\n    args[0] = ( args[0] == args[1] );\n\n\n#define DO_NEQ                        \\\n    args[0] = ( args[0] != args[1] );\n\n\n#define DO_ODD                                                  \\\n    args[0] = ( ( CUR_Func_round( args[0], 0 ) & 127 ) == 64 );\n\n\n#define DO_EVEN                                                \\\n    args[0] = ( ( CUR_Func_round( args[0], 0 ) & 127 ) == 0 );\n\n\n#define DO_AND                        \\\n    args[0] = ( args[0] && args[1] );\n\n\n#define DO_OR                         \\\n    args[0] = ( args[0] || args[1] );\n\n\n#define DO_NOT          \\\n    args[0] = !args[0];\n\n\n#define DO_ADD          \\\n    args[0] += args[1];\n\n\n#define DO_SUB          \\\n    args[0] -= args[1];\n\n\n#define DO_DIV                                               \\\n    if ( args[1] == 0 )                                      \\\n      CUR.error = FT_THROW( Divide_By_Zero );                \\\n    else                                                     \\\n      args[0] = FT_MulDiv_No_Round( args[0], 64L, args[1] );\n\n\n#define DO_MUL                                    \\\n    args[0] = FT_MulDiv( args[0], args[1], 64L );\n\n\n#define DO_ABS                   \\\n    args[0] = FT_ABS( args[0] );\n\n\n#define DO_NEG          \\\n    args[0] = -args[0];\n\n\n#define DO_FLOOR    \\\n    args[0] = FT_PIX_FLOOR( args[0] );\n\n\n#define DO_CEILING                    \\\n    args[0] = FT_PIX_CEIL( args[0] );\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n\n#define DO_RS                                             \\\n   {                                                      \\\n     FT_ULong  I = (FT_ULong)args[0];                     \\\n                                                          \\\n                                                          \\\n     if ( BOUNDSL( I, CUR.storeSize ) )                   \\\n     {                                                    \\\n       if ( CUR.pedantic_hinting )                        \\\n         ARRAY_BOUND_ERROR;                               \\\n       else                                               \\\n         args[0] = 0;                                     \\\n     }                                                    \\\n     else                                                 \\\n     {                                                    \\\n       /* subpixel hinting - avoid Typeman Dstroke and */ \\\n       /* IStroke and Vacuform rounds                  */ \\\n                                                          \\\n       if ( SUBPIXEL_HINTING                           && \\\n            CUR.ignore_x_mode                          && \\\n            ( ( I == 24                            &&     \\\n                ( CUR.face->sph_found_func_flags &        \\\n                  ( SPH_FDEF_SPACING_1 |                  \\\n                    SPH_FDEF_SPACING_2 )         ) ) ||   \\\n              ( I == 22                      &&           \\\n                ( CUR.sph_in_func_flags    &              \\\n                  SPH_FDEF_TYPEMAN_STROKES ) )       ||   \\\n              ( I == 8                             &&     \\\n                ( CUR.face->sph_found_func_flags &        \\\n                  SPH_FDEF_VACUFORM_ROUND_1      ) &&     \\\n                  CUR.iup_called                   ) ) )  \\\n         args[0] = 0;                                     \\\n       else                                               \\\n         args[0] = CUR.storage[I];                        \\\n     }                                                    \\\n   }\n\n#else /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n#define DO_RS                           \\\n   {                                    \\\n     FT_ULong  I = (FT_ULong)args[0];   \\\n                                        \\\n                                        \\\n     if ( BOUNDSL( I, CUR.storeSize ) ) \\\n     {                                  \\\n       if ( CUR.pedantic_hinting )      \\\n       {                                \\\n         ARRAY_BOUND_ERROR;             \\\n       }                                \\\n       else                             \\\n         args[0] = 0;                   \\\n     }                                  \\\n     else                               \\\n       args[0] = CUR.storage[I];        \\\n   }\n\n#endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n\n#define DO_WS                           \\\n   {                                    \\\n     FT_ULong  I = (FT_ULong)args[0];   \\\n                                        \\\n                                        \\\n     if ( BOUNDSL( I, CUR.storeSize ) ) \\\n     {                                  \\\n       if ( CUR.pedantic_hinting )      \\\n       {                                \\\n         ARRAY_BOUND_ERROR;             \\\n       }                                \\\n     }                                  \\\n     else                               \\\n       CUR.storage[I] = args[1];        \\\n   }\n\n\n#define DO_RCVT                          \\\n   {                                     \\\n     FT_ULong  I = (FT_ULong)args[0];    \\\n                                         \\\n                                         \\\n     if ( BOUNDSL( I, CUR.cvtSize ) )    \\\n     {                                   \\\n       if ( CUR.pedantic_hinting )       \\\n       {                                 \\\n         ARRAY_BOUND_ERROR;              \\\n       }                                 \\\n       else                              \\\n         args[0] = 0;                    \\\n     }                                   \\\n     else                                \\\n       args[0] = CUR_Func_read_cvt( I ); \\\n   }\n\n\n#define DO_WCVTP                         \\\n   {                                     \\\n     FT_ULong  I = (FT_ULong)args[0];    \\\n                                         \\\n                                         \\\n     if ( BOUNDSL( I, CUR.cvtSize ) )    \\\n     {                                   \\\n       if ( CUR.pedantic_hinting )       \\\n       {                                 \\\n         ARRAY_BOUND_ERROR;              \\\n       }                                 \\\n     }                                   \\\n     else                                \\\n       CUR_Func_write_cvt( I, args[1] ); \\\n   }\n\n\n#define DO_WCVTF                                                \\\n   {                                                            \\\n     FT_ULong  I = (FT_ULong)args[0];                           \\\n                                                                \\\n                                                                \\\n     if ( BOUNDSL( I, CUR.cvtSize ) )                           \\\n     {                                                          \\\n       if ( CUR.pedantic_hinting )                              \\\n       {                                                        \\\n         ARRAY_BOUND_ERROR;                                     \\\n       }                                                        \\\n     }                                                          \\\n     else                                                       \\\n       CUR.cvt[I] = FT_MulFix( args[1], CUR.tt_metrics.scale ); \\\n   }\n\n\n#define DO_DEBUG                          \\\n    CUR.error = FT_THROW( Debug_OpCode );\n\n\n#define DO_ROUND                                                   \\\n    args[0] = CUR_Func_round(                                      \\\n                args[0],                                           \\\n                CUR.tt_metrics.compensations[CUR.opcode - 0x68] );\n\n\n#define DO_NROUND                                                            \\\n    args[0] = ROUND_None( args[0],                                           \\\n                          CUR.tt_metrics.compensations[CUR.opcode - 0x6C] );\n\n\n#define DO_MAX               \\\n    if ( args[1] > args[0] ) \\\n      args[0] = args[1];\n\n\n#define DO_MIN               \\\n    if ( args[1] < args[0] ) \\\n      args[0] = args[1];\n\n\n#ifndef TT_CONFIG_OPTION_INTERPRETER_SWITCH\n\n\n#undef  ARRAY_BOUND_ERROR\n#define ARRAY_BOUND_ERROR                        \\\n    {                                            \\\n      CUR.error = FT_THROW( Invalid_Reference ); \\\n      return;                                    \\\n    }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SVTCA[a]:     Set (F and P) Vectors to Coordinate Axis                */\n  /* Opcode range: 0x00-0x01                                               */\n  /* Stack:        -->                                                     */\n  /*                                                                       */\n  static void\n  Ins_SVTCA( INS_ARG )\n  {\n    DO_SVTCA\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SPVTCA[a]:    Set PVector to Coordinate Axis                          */\n  /* Opcode range: 0x02-0x03                                               */\n  /* Stack:        -->                                                     */\n  /*                                                                       */\n  static void\n  Ins_SPVTCA( INS_ARG )\n  {\n    DO_SPVTCA\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SFVTCA[a]:    Set FVector to Coordinate Axis                          */\n  /* Opcode range: 0x04-0x05                                               */\n  /* Stack:        -->                                                     */\n  /*                                                                       */\n  static void\n  Ins_SFVTCA( INS_ARG )\n  {\n    DO_SFVTCA\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SPVTL[a]:     Set PVector To Line                                     */\n  /* Opcode range: 0x06-0x07                                               */\n  /* Stack:        uint32 uint32 -->                                       */\n  /*                                                                       */\n  static void\n  Ins_SPVTL( INS_ARG )\n  {\n    DO_SPVTL\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SFVTL[a]:     Set FVector To Line                                     */\n  /* Opcode range: 0x08-0x09                                               */\n  /* Stack:        uint32 uint32 -->                                       */\n  /*                                                                       */\n  static void\n  Ins_SFVTL( INS_ARG )\n  {\n    DO_SFVTL\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SFVTPV[]:     Set FVector To PVector                                  */\n  /* Opcode range: 0x0E                                                    */\n  /* Stack:        -->                                                     */\n  /*                                                                       */\n  static void\n  Ins_SFVTPV( INS_ARG )\n  {\n    DO_SFVTPV\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SPVFS[]:      Set PVector From Stack                                  */\n  /* Opcode range: 0x0A                                                    */\n  /* Stack:        f2.14 f2.14 -->                                         */\n  /*                                                                       */\n  static void\n  Ins_SPVFS( INS_ARG )\n  {\n    DO_SPVFS\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SFVFS[]:      Set FVector From Stack                                  */\n  /* Opcode range: 0x0B                                                    */\n  /* Stack:        f2.14 f2.14 -->                                         */\n  /*                                                                       */\n  static void\n  Ins_SFVFS( INS_ARG )\n  {\n    DO_SFVFS\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* GPV[]:        Get Projection Vector                                   */\n  /* Opcode range: 0x0C                                                    */\n  /* Stack:        ef2.14 --> ef2.14                                       */\n  /*                                                                       */\n  static void\n  Ins_GPV( INS_ARG )\n  {\n    DO_GPV\n  }\n\n\n  /*************************************************************************/\n  /* GFV[]:        Get Freedom Vector                                      */\n  /* Opcode range: 0x0D                                                    */\n  /* Stack:        ef2.14 --> ef2.14                                       */\n  /*                                                                       */\n  static void\n  Ins_GFV( INS_ARG )\n  {\n    DO_GFV\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SRP0[]:       Set Reference Point 0                                   */\n  /* Opcode range: 0x10                                                    */\n  /* Stack:        uint32 -->                                              */\n  /*                                                                       */\n  static void\n  Ins_SRP0( INS_ARG )\n  {\n    DO_SRP0\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SRP1[]:       Set Reference Point 1                                   */\n  /* Opcode range: 0x11                                                    */\n  /* Stack:        uint32 -->                                              */\n  /*                                                                       */\n  static void\n  Ins_SRP1( INS_ARG )\n  {\n    DO_SRP1\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SRP2[]:       Set Reference Point 2                                   */\n  /* Opcode range: 0x12                                                    */\n  /* Stack:        uint32 -->                                              */\n  /*                                                                       */\n  static void\n  Ins_SRP2( INS_ARG )\n  {\n    DO_SRP2\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* RTHG[]:       Round To Half Grid                                      */\n  /* Opcode range: 0x19                                                    */\n  /* Stack:        -->                                                     */\n  /*                                                                       */\n  static void\n  Ins_RTHG( INS_ARG )\n  {\n    DO_RTHG\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* RTG[]:        Round To Grid                                           */\n  /* Opcode range: 0x18                                                    */\n  /* Stack:        -->                                                     */\n  /*                                                                       */\n  static void\n  Ins_RTG( INS_ARG )\n  {\n    DO_RTG\n  }\n\n\n  /*************************************************************************/\n  /* RTDG[]:       Round To Double Grid                                    */\n  /* Opcode range: 0x3D                                                    */\n  /* Stack:        -->                                                     */\n  /*                                                                       */\n  static void\n  Ins_RTDG( INS_ARG )\n  {\n    DO_RTDG\n  }\n\n\n  /*************************************************************************/\n  /* RUTG[]:       Round Up To Grid                                        */\n  /* Opcode range: 0x7C                                                    */\n  /* Stack:        -->                                                     */\n  /*                                                                       */\n  static void\n  Ins_RUTG( INS_ARG )\n  {\n    DO_RUTG\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* RDTG[]:       Round Down To Grid                                      */\n  /* Opcode range: 0x7D                                                    */\n  /* Stack:        -->                                                     */\n  /*                                                                       */\n  static void\n  Ins_RDTG( INS_ARG )\n  {\n    DO_RDTG\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* ROFF[]:       Round OFF                                               */\n  /* Opcode range: 0x7A                                                    */\n  /* Stack:        -->                                                     */\n  /*                                                                       */\n  static void\n  Ins_ROFF( INS_ARG )\n  {\n    DO_ROFF\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SROUND[]:     Super ROUND                                             */\n  /* Opcode range: 0x76                                                    */\n  /* Stack:        Eint8 -->                                               */\n  /*                                                                       */\n  static void\n  Ins_SROUND( INS_ARG )\n  {\n    DO_SROUND\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* S45ROUND[]:   Super ROUND 45 degrees                                  */\n  /* Opcode range: 0x77                                                    */\n  /* Stack:        uint32 -->                                              */\n  /*                                                                       */\n  static void\n  Ins_S45ROUND( INS_ARG )\n  {\n    DO_S45ROUND\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SLOOP[]:      Set LOOP variable                                       */\n  /* Opcode range: 0x17                                                    */\n  /* Stack:        int32? -->                                              */\n  /*                                                                       */\n  static void\n  Ins_SLOOP( INS_ARG )\n  {\n    DO_SLOOP\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SMD[]:        Set Minimum Distance                                    */\n  /* Opcode range: 0x1A                                                    */\n  /* Stack:        f26.6 -->                                               */\n  /*                                                                       */\n  static void\n  Ins_SMD( INS_ARG )\n  {\n    DO_SMD\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SCVTCI[]:     Set Control Value Table Cut In                          */\n  /* Opcode range: 0x1D                                                    */\n  /* Stack:        f26.6 -->                                               */\n  /*                                                                       */\n  static void\n  Ins_SCVTCI( INS_ARG )\n  {\n    DO_SCVTCI\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SSWCI[]:      Set Single Width Cut In                                 */\n  /* Opcode range: 0x1E                                                    */\n  /* Stack:        f26.6 -->                                               */\n  /*                                                                       */\n  static void\n  Ins_SSWCI( INS_ARG )\n  {\n    DO_SSWCI\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SSW[]:        Set Single Width                                        */\n  /* Opcode range: 0x1F                                                    */\n  /* Stack:        int32? -->                                              */\n  /*                                                                       */\n  static void\n  Ins_SSW( INS_ARG )\n  {\n    DO_SSW\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* FLIPON[]:     Set auto-FLIP to ON                                     */\n  /* Opcode range: 0x4D                                                    */\n  /* Stack:        -->                                                     */\n  /*                                                                       */\n  static void\n  Ins_FLIPON( INS_ARG )\n  {\n    DO_FLIPON\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* FLIPOFF[]:    Set auto-FLIP to OFF                                    */\n  /* Opcode range: 0x4E                                                    */\n  /* Stack: -->                                                            */\n  /*                                                                       */\n  static void\n  Ins_FLIPOFF( INS_ARG )\n  {\n    DO_FLIPOFF\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SANGW[]:      Set ANGle Weight                                        */\n  /* Opcode range: 0x7E                                                    */\n  /* Stack:        uint32 -->                                              */\n  /*                                                                       */\n  static void\n  Ins_SANGW( INS_ARG )\n  {\n    /* instruction not supported anymore */\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SDB[]:        Set Delta Base                                          */\n  /* Opcode range: 0x5E                                                    */\n  /* Stack:        uint32 -->                                              */\n  /*                                                                       */\n  static void\n  Ins_SDB( INS_ARG )\n  {\n    DO_SDB\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SDS[]:        Set Delta Shift                                         */\n  /* Opcode range: 0x5F                                                    */\n  /* Stack:        uint32 -->                                              */\n  /*                                                                       */\n  static void\n  Ins_SDS( INS_ARG )\n  {\n    DO_SDS\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* MPPEM[]:      Measure Pixel Per EM                                    */\n  /* Opcode range: 0x4B                                                    */\n  /* Stack:        --> Euint16                                             */\n  /*                                                                       */\n  static void\n  Ins_MPPEM( INS_ARG )\n  {\n    DO_MPPEM\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* MPS[]:        Measure Point Size                                      */\n  /* Opcode range: 0x4C                                                    */\n  /* Stack:        --> Euint16                                             */\n  /*                                                                       */\n  static void\n  Ins_MPS( INS_ARG )\n  {\n    DO_MPS\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* DUP[]:        DUPlicate the top stack's element                       */\n  /* Opcode range: 0x20                                                    */\n  /* Stack:        StkElt --> StkElt StkElt                                */\n  /*                                                                       */\n  static void\n  Ins_DUP( INS_ARG )\n  {\n    DO_DUP\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* POP[]:        POP the stack's top element                             */\n  /* Opcode range: 0x21                                                    */\n  /* Stack:        StkElt -->                                              */\n  /*                                                                       */\n  static void\n  Ins_POP( INS_ARG )\n  {\n    /* nothing to do */\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* CLEAR[]:      CLEAR the entire stack                                  */\n  /* Opcode range: 0x22                                                    */\n  /* Stack:        StkElt... -->                                           */\n  /*                                                                       */\n  static void\n  Ins_CLEAR( INS_ARG )\n  {\n    DO_CLEAR\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SWAP[]:       SWAP the stack's top two elements                       */\n  /* Opcode range: 0x23                                                    */\n  /* Stack:        2 * StkElt --> 2 * StkElt                               */\n  /*                                                                       */\n  static void\n  Ins_SWAP( INS_ARG )\n  {\n    DO_SWAP\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* DEPTH[]:      return the stack DEPTH                                  */\n  /* Opcode range: 0x24                                                    */\n  /* Stack:        --> uint32                                              */\n  /*                                                                       */\n  static void\n  Ins_DEPTH( INS_ARG )\n  {\n    DO_DEPTH\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* CINDEX[]:     Copy INDEXed element                                    */\n  /* Opcode range: 0x25                                                    */\n  /* Stack:        int32 --> StkElt                                        */\n  /*                                                                       */\n  static void\n  Ins_CINDEX( INS_ARG )\n  {\n    DO_CINDEX\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* EIF[]:        End IF                                                  */\n  /* Opcode range: 0x59                                                    */\n  /* Stack:        -->                                                     */\n  /*                                                                       */\n  static void\n  Ins_EIF( INS_ARG )\n  {\n    /* nothing to do */\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* JROT[]:       Jump Relative On True                                   */\n  /* Opcode range: 0x78                                                    */\n  /* Stack:        StkElt int32 -->                                        */\n  /*                                                                       */\n  static void\n  Ins_JROT( INS_ARG )\n  {\n    DO_JROT\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* JMPR[]:       JuMP Relative                                           */\n  /* Opcode range: 0x1C                                                    */\n  /* Stack:        int32 -->                                               */\n  /*                                                                       */\n  static void\n  Ins_JMPR( INS_ARG )\n  {\n    DO_JMPR\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* JROF[]:       Jump Relative On False                                  */\n  /* Opcode range: 0x79                                                    */\n  /* Stack:        StkElt int32 -->                                        */\n  /*                                                                       */\n  static void\n  Ins_JROF( INS_ARG )\n  {\n    DO_JROF\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* LT[]:         Less Than                                               */\n  /* Opcode range: 0x50                                                    */\n  /* Stack:        int32? int32? --> bool                                  */\n  /*                                                                       */\n  static void\n  Ins_LT( INS_ARG )\n  {\n    DO_LT\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* LTEQ[]:       Less Than or EQual                                      */\n  /* Opcode range: 0x51                                                    */\n  /* Stack:        int32? int32? --> bool                                  */\n  /*                                                                       */\n  static void\n  Ins_LTEQ( INS_ARG )\n  {\n    DO_LTEQ\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* GT[]:         Greater Than                                            */\n  /* Opcode range: 0x52                                                    */\n  /* Stack:        int32? int32? --> bool                                  */\n  /*                                                                       */\n  static void\n  Ins_GT( INS_ARG )\n  {\n    DO_GT\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* GTEQ[]:       Greater Than or EQual                                   */\n  /* Opcode range: 0x53                                                    */\n  /* Stack:        int32? int32? --> bool                                  */\n  /*                                                                       */\n  static void\n  Ins_GTEQ( INS_ARG )\n  {\n    DO_GTEQ\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* EQ[]:         EQual                                                   */\n  /* Opcode range: 0x54                                                    */\n  /* Stack:        StkElt StkElt --> bool                                  */\n  /*                                                                       */\n  static void\n  Ins_EQ( INS_ARG )\n  {\n    DO_EQ\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* NEQ[]:        Not EQual                                               */\n  /* Opcode range: 0x55                                                    */\n  /* Stack:        StkElt StkElt --> bool                                  */\n  /*                                                                       */\n  static void\n  Ins_NEQ( INS_ARG )\n  {\n    DO_NEQ\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* ODD[]:        Is ODD                                                  */\n  /* Opcode range: 0x56                                                    */\n  /* Stack:        f26.6 --> bool                                          */\n  /*                                                                       */\n  static void\n  Ins_ODD( INS_ARG )\n  {\n    DO_ODD\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* EVEN[]:       Is EVEN                                                 */\n  /* Opcode range: 0x57                                                    */\n  /* Stack:        f26.6 --> bool                                          */\n  /*                                                                       */\n  static void\n  Ins_EVEN( INS_ARG )\n  {\n    DO_EVEN\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* AND[]:        logical AND                                             */\n  /* Opcode range: 0x5A                                                    */\n  /* Stack:        uint32 uint32 --> uint32                                */\n  /*                                                                       */\n  static void\n  Ins_AND( INS_ARG )\n  {\n    DO_AND\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* OR[]:         logical OR                                              */\n  /* Opcode range: 0x5B                                                    */\n  /* Stack:        uint32 uint32 --> uint32                                */\n  /*                                                                       */\n  static void\n  Ins_OR( INS_ARG )\n  {\n    DO_OR\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* NOT[]:        logical NOT                                             */\n  /* Opcode range: 0x5C                                                    */\n  /* Stack:        StkElt --> uint32                                       */\n  /*                                                                       */\n  static void\n  Ins_NOT( INS_ARG )\n  {\n    DO_NOT\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* ADD[]:        ADD                                                     */\n  /* Opcode range: 0x60                                                    */\n  /* Stack:        f26.6 f26.6 --> f26.6                                   */\n  /*                                                                       */\n  static void\n  Ins_ADD( INS_ARG )\n  {\n    DO_ADD\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SUB[]:        SUBtract                                                */\n  /* Opcode range: 0x61                                                    */\n  /* Stack:        f26.6 f26.6 --> f26.6                                   */\n  /*                                                                       */\n  static void\n  Ins_SUB( INS_ARG )\n  {\n    DO_SUB\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* DIV[]:        DIVide                                                  */\n  /* Opcode range: 0x62                                                    */\n  /* Stack:        f26.6 f26.6 --> f26.6                                   */\n  /*                                                                       */\n  static void\n  Ins_DIV( INS_ARG )\n  {\n    DO_DIV\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* MUL[]:        MULtiply                                                */\n  /* Opcode range: 0x63                                                    */\n  /* Stack:        f26.6 f26.6 --> f26.6                                   */\n  /*                                                                       */\n  static void\n  Ins_MUL( INS_ARG )\n  {\n    DO_MUL\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* ABS[]:        ABSolute value                                          */\n  /* Opcode range: 0x64                                                    */\n  /* Stack:        f26.6 --> f26.6                                         */\n  /*                                                                       */\n  static void\n  Ins_ABS( INS_ARG )\n  {\n    DO_ABS\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* NEG[]:        NEGate                                                  */\n  /* Opcode range: 0x65                                                    */\n  /* Stack: f26.6 --> f26.6                                                */\n  /*                                                                       */\n  static void\n  Ins_NEG( INS_ARG )\n  {\n    DO_NEG\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* FLOOR[]:      FLOOR                                                   */\n  /* Opcode range: 0x66                                                    */\n  /* Stack:        f26.6 --> f26.6                                         */\n  /*                                                                       */\n  static void\n  Ins_FLOOR( INS_ARG )\n  {\n    DO_FLOOR\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* CEILING[]:    CEILING                                                 */\n  /* Opcode range: 0x67                                                    */\n  /* Stack:        f26.6 --> f26.6                                         */\n  /*                                                                       */\n  static void\n  Ins_CEILING( INS_ARG )\n  {\n    DO_CEILING\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* RS[]:         Read Store                                              */\n  /* Opcode range: 0x43                                                    */\n  /* Stack:        uint32 --> uint32                                       */\n  /*                                                                       */\n  static void\n  Ins_RS( INS_ARG )\n  {\n    DO_RS\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* WS[]:         Write Store                                             */\n  /* Opcode range: 0x42                                                    */\n  /* Stack:        uint32 uint32 -->                                       */\n  /*                                                                       */\n  static void\n  Ins_WS( INS_ARG )\n  {\n    DO_WS\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* WCVTP[]:      Write CVT in Pixel units                                */\n  /* Opcode range: 0x44                                                    */\n  /* Stack:        f26.6 uint32 -->                                        */\n  /*                                                                       */\n  static void\n  Ins_WCVTP( INS_ARG )\n  {\n    DO_WCVTP\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* WCVTF[]:      Write CVT in Funits                                     */\n  /* Opcode range: 0x70                                                    */\n  /* Stack:        uint32 uint32 -->                                       */\n  /*                                                                       */\n  static void\n  Ins_WCVTF( INS_ARG )\n  {\n    DO_WCVTF\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* RCVT[]:       Read CVT                                                */\n  /* Opcode range: 0x45                                                    */\n  /* Stack:        uint32 --> f26.6                                        */\n  /*                                                                       */\n  static void\n  Ins_RCVT( INS_ARG )\n  {\n    DO_RCVT\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* AA[]:         Adjust Angle                                            */\n  /* Opcode range: 0x7F                                                    */\n  /* Stack:        uint32 -->                                              */\n  /*                                                                       */\n  static void\n  Ins_AA( INS_ARG )\n  {\n    /* intentionally no longer supported */\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* DEBUG[]:      DEBUG.  Unsupported.                                    */\n  /* Opcode range: 0x4F                                                    */\n  /* Stack:        uint32 -->                                              */\n  /*                                                                       */\n  /* Note: The original instruction pops a value from the stack.           */\n  /*                                                                       */\n  static void\n  Ins_DEBUG( INS_ARG )\n  {\n    DO_DEBUG\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* ROUND[ab]:    ROUND value                                             */\n  /* Opcode range: 0x68-0x6B                                               */\n  /* Stack:        f26.6 --> f26.6                                         */\n  /*                                                                       */\n  static void\n  Ins_ROUND( INS_ARG )\n  {\n    DO_ROUND\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* NROUND[ab]:   No ROUNDing of value                                    */\n  /* Opcode range: 0x6C-0x6F                                               */\n  /* Stack:        f26.6 --> f26.6                                         */\n  /*                                                                       */\n  static void\n  Ins_NROUND( INS_ARG )\n  {\n    DO_NROUND\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* MAX[]:        MAXimum                                                 */\n  /* Opcode range: 0x68                                                    */\n  /* Stack:        int32? int32? --> int32                                 */\n  /*                                                                       */\n  static void\n  Ins_MAX( INS_ARG )\n  {\n    DO_MAX\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* MIN[]:        MINimum                                                 */\n  /* Opcode range: 0x69                                                    */\n  /* Stack:        int32? int32? --> int32                                 */\n  /*                                                                       */\n  static void\n  Ins_MIN( INS_ARG )\n  {\n    DO_MIN\n  }\n\n\n#endif  /* !TT_CONFIG_OPTION_INTERPRETER_SWITCH */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The following functions are called as is within the switch statement. */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* MINDEX[]:     Move INDEXed element                                    */\n  /* Opcode range: 0x26                                                    */\n  /* Stack:        int32? --> StkElt                                       */\n  /*                                                                       */\n  static void\n  Ins_MINDEX( INS_ARG )\n  {\n    FT_Long  L, K;\n\n\n    L = args[0];\n\n    if ( L <= 0 || L > CUR.args )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n    }\n    else\n    {\n      K = CUR.stack[CUR.args - L];\n\n      FT_ARRAY_MOVE( &CUR.stack[CUR.args - L    ],\n                     &CUR.stack[CUR.args - L + 1],\n                     ( L - 1 ) );\n\n      CUR.stack[CUR.args - 1] = K;\n    }\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* ROLL[]:       ROLL top three elements                                 */\n  /* Opcode range: 0x8A                                                    */\n  /* Stack:        3 * StkElt --> 3 * StkElt                               */\n  /*                                                                       */\n  static void\n  Ins_ROLL( INS_ARG )\n  {\n    FT_Long  A, B, C;\n\n    FT_UNUSED_EXEC;\n\n\n    A = args[2];\n    B = args[1];\n    C = args[0];\n\n    args[2] = C;\n    args[1] = A;\n    args[0] = B;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* MANAGING THE FLOW OF CONTROL                                          */\n  /*                                                                       */\n  /*   Instructions appear in the specification's order.                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  static FT_Bool\n  SkipCode( EXEC_OP )\n  {\n    CUR.IP += CUR.length;\n\n    if ( CUR.IP < CUR.codeSize )\n    {\n      CUR.opcode = CUR.code[CUR.IP];\n\n      CUR.length = opcode_length[CUR.opcode];\n      if ( CUR.length < 0 )\n      {\n        if ( CUR.IP + 1 >= CUR.codeSize )\n          goto Fail_Overflow;\n        CUR.length = 2 - CUR.length * CUR.code[CUR.IP + 1];\n      }\n\n      if ( CUR.IP + CUR.length <= CUR.codeSize )\n        return SUCCESS;\n    }\n\n  Fail_Overflow:\n    CUR.error = FT_THROW( Code_Overflow );\n    return FAILURE;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* IF[]:         IF test                                                 */\n  /* Opcode range: 0x58                                                    */\n  /* Stack:        StkElt -->                                              */\n  /*                                                                       */\n  static void\n  Ins_IF( INS_ARG )\n  {\n    FT_Int   nIfs;\n    FT_Bool  Out;\n\n\n    if ( args[0] != 0 )\n      return;\n\n    nIfs = 1;\n    Out = 0;\n\n    do\n    {\n      if ( SKIP_Code() == FAILURE )\n        return;\n\n      switch ( CUR.opcode )\n      {\n      case 0x58:      /* IF */\n        nIfs++;\n        break;\n\n      case 0x1B:      /* ELSE */\n        Out = FT_BOOL( nIfs == 1 );\n        break;\n\n      case 0x59:      /* EIF */\n        nIfs--;\n        Out = FT_BOOL( nIfs == 0 );\n        break;\n      }\n    } while ( Out == 0 );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* ELSE[]:       ELSE                                                    */\n  /* Opcode range: 0x1B                                                    */\n  /* Stack:        -->                                                     */\n  /*                                                                       */\n  static void\n  Ins_ELSE( INS_ARG )\n  {\n    FT_Int  nIfs;\n\n    FT_UNUSED_ARG;\n\n\n    nIfs = 1;\n\n    do\n    {\n      if ( SKIP_Code() == FAILURE )\n        return;\n\n      switch ( CUR.opcode )\n      {\n      case 0x58:    /* IF */\n        nIfs++;\n        break;\n\n      case 0x59:    /* EIF */\n        nIfs--;\n        break;\n      }\n    } while ( nIfs != 0 );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* DEFINING AND USING FUNCTIONS AND INSTRUCTIONS                         */\n  /*                                                                       */\n  /*   Instructions appear in the specification's order.                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* FDEF[]:       Function DEFinition                                     */\n  /* Opcode range: 0x2C                                                    */\n  /* Stack:        uint32 -->                                              */\n  /*                                                                       */\n  static void\n  Ins_FDEF( INS_ARG )\n  {\n    FT_ULong       n;\n    TT_DefRecord*  rec;\n    TT_DefRecord*  limit;\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    /* arguments to opcodes are skipped by `SKIP_Code' */\n    FT_Byte    opcode_pattern[9][12] = {\n                 /* #0 inline delta function 1 */\n                 {\n                   0x4B, /* PPEM    */\n                   0x53, /* GTEQ    */\n                   0x23, /* SWAP    */\n                   0x4B, /* PPEM    */\n                   0x51, /* LTEQ    */\n                   0x5A, /* AND     */\n                   0x58, /* IF      */\n                   0x38, /*   SHPIX */\n                   0x1B, /* ELSE    */\n                   0x21, /*   POP   */\n                   0x21, /*   POP   */\n                   0x59  /* EIF     */\n                 },\n                 /* #1 inline delta function 2 */\n                 {\n                   0x4B, /* PPEM    */\n                   0x54, /* EQ      */\n                   0x58, /* IF      */\n                   0x38, /*   SHPIX */\n                   0x1B, /* ELSE    */\n                   0x21, /*   POP   */\n                   0x21, /*   POP   */\n                   0x59  /* EIF     */\n                 },\n                 /* #2 diagonal stroke function */\n                 {\n                   0x20, /* DUP     */\n                   0x20, /* DUP     */\n                   0xB0, /* PUSHB_1 */\n                         /*   1     */\n                   0x60, /* ADD     */\n                   0x46, /* GC_cur  */\n                   0xB0, /* PUSHB_1 */\n                         /*   64    */\n                   0x23, /* SWAP    */\n                   0x42  /* WS      */\n                 },\n                 /* #3 VacuFormRound function */\n                 {\n                   0x45, /* RCVT    */\n                   0x23, /* SWAP    */\n                   0x46, /* GC_cur  */\n                   0x60, /* ADD     */\n                   0x20, /* DUP     */\n                   0xB0  /* PUSHB_1 */\n                         /*   38    */\n                 },\n                 /* #4 TTFautohint bytecode (old) */\n                 {\n                   0x20, /* DUP     */\n                   0x64, /* ABS     */\n                   0xB0, /* PUSHB_1 */\n                         /*   32    */\n                   0x60, /* ADD     */\n                   0x66, /* FLOOR   */\n                   0x23, /* SWAP    */\n                   0xB0  /* PUSHB_1 */\n                 },\n                 /* #5 spacing function 1 */\n                 {\n                   0x01, /* SVTCA_x */\n                   0xB0, /* PUSHB_1 */\n                         /*   24    */\n                   0x43, /* RS      */\n                   0x58  /* IF      */\n                 },\n                 /* #6 spacing function 2 */\n                 {\n                   0x01, /* SVTCA_x */\n                   0x18, /* RTG     */\n                   0xB0, /* PUSHB_1 */\n                         /*   24    */\n                   0x43, /* RS      */\n                   0x58  /* IF      */\n                 },\n                 /* #7 TypeMan Talk DiagEndCtrl function */\n                 {\n                   0x01, /* SVTCA_x */\n                   0x20, /* DUP     */\n                   0xB0, /* PUSHB_1 */\n                         /*   3     */\n                   0x25, /* CINDEX  */\n                 },\n                 /* #8 TypeMan Talk Align */\n                 {\n                   0x06, /* SPVTL   */\n                   0x7D, /* RDTG    */\n                 },\n               };\n    FT_UShort  opcode_patterns   = 9;\n    FT_UShort  opcode_pointer[9] = {  0, 0, 0, 0, 0, 0, 0, 0, 0 };\n    FT_UShort  opcode_size[9]    = { 12, 8, 8, 6, 7, 4, 5, 4, 2 };\n    FT_UShort  i;\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n\n    /* some font programs are broken enough to redefine functions! */\n    /* We will then parse the current table.                       */\n\n    rec   = CUR.FDefs;\n    limit = rec + CUR.numFDefs;\n    n     = args[0];\n\n    for ( ; rec < limit; rec++ )\n    {\n      if ( rec->opc == n )\n        break;\n    }\n\n    if ( rec == limit )\n    {\n      /* check that there is enough room for new functions */\n      if ( CUR.numFDefs >= CUR.maxFDefs )\n      {\n        CUR.error = FT_THROW( Too_Many_Function_Defs );\n        return;\n      }\n      CUR.numFDefs++;\n    }\n\n    /* Although FDEF takes unsigned 32-bit integer,  */\n    /* func # must be within unsigned 16-bit integer */\n    if ( n > 0xFFFFU )\n    {\n      CUR.error = FT_THROW( Too_Many_Function_Defs );\n      return;\n    }\n\n    rec->range          = CUR.curRange;\n    rec->opc            = (FT_UInt16)n;\n    rec->start          = CUR.IP + 1;\n    rec->active         = TRUE;\n    rec->inline_delta   = FALSE;\n    rec->sph_fdef_flags = 0x0000;\n\n    if ( n > CUR.maxFunc )\n      CUR.maxFunc = (FT_UInt16)n;\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    /* We don't know for sure these are typeman functions, */\n    /* however they are only active when RS 22 is called   */\n    if ( n >= 64 && n <= 66 )\n      rec->sph_fdef_flags |= SPH_FDEF_TYPEMAN_STROKES;\n#endif\n\n    /* Now skip the whole function definition. */\n    /* We don't allow nested IDEFS & FDEFs.    */\n\n    while ( SKIP_Code() == SUCCESS )\n    {\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n\n      if ( SUBPIXEL_HINTING )\n      {\n        for ( i = 0; i < opcode_patterns; i++ )\n        {\n          if ( opcode_pointer[i] < opcode_size[i]                 &&\n               CUR.opcode == opcode_pattern[i][opcode_pointer[i]] )\n          {\n            opcode_pointer[i] += 1;\n\n            if ( opcode_pointer[i] == opcode_size[i] )\n            {\n              FT_TRACE7(( \"sph: Function %d, opcode ptrn: %d, %s %s\\n\",\n                          i, n,\n                          CUR.face->root.family_name,\n                          CUR.face->root.style_name ));\n\n              switch ( i )\n              {\n              case 0:\n                rec->sph_fdef_flags            |= SPH_FDEF_INLINE_DELTA_1;\n                CUR.face->sph_found_func_flags |= SPH_FDEF_INLINE_DELTA_1;\n                break;\n\n              case 1:\n                rec->sph_fdef_flags            |= SPH_FDEF_INLINE_DELTA_2;\n                CUR.face->sph_found_func_flags |= SPH_FDEF_INLINE_DELTA_2;\n                break;\n\n              case 2:\n                switch ( n )\n                {\n                  /* needs to be implemented still */\n                case 58:\n                  rec->sph_fdef_flags            |= SPH_FDEF_DIAGONAL_STROKE;\n                  CUR.face->sph_found_func_flags |= SPH_FDEF_DIAGONAL_STROKE;\n                }\n                break;\n\n              case 3:\n                switch ( n )\n                {\n                case 0:\n                  rec->sph_fdef_flags            |= SPH_FDEF_VACUFORM_ROUND_1;\n                  CUR.face->sph_found_func_flags |= SPH_FDEF_VACUFORM_ROUND_1;\n                }\n                break;\n\n              case 4:\n                /* probably not necessary to detect anymore */\n                rec->sph_fdef_flags            |= SPH_FDEF_TTFAUTOHINT_1;\n                CUR.face->sph_found_func_flags |= SPH_FDEF_TTFAUTOHINT_1;\n                break;\n\n              case 5:\n                switch ( n )\n                {\n                case 0:\n                case 1:\n                case 2:\n                case 4:\n                case 7:\n                case 8:\n                  rec->sph_fdef_flags            |= SPH_FDEF_SPACING_1;\n                  CUR.face->sph_found_func_flags |= SPH_FDEF_SPACING_1;\n                }\n                break;\n\n              case 6:\n                switch ( n )\n                {\n                case 0:\n                case 1:\n                case 2:\n                case 4:\n                case 7:\n                case 8:\n                  rec->sph_fdef_flags            |= SPH_FDEF_SPACING_2;\n                  CUR.face->sph_found_func_flags |= SPH_FDEF_SPACING_2;\n                }\n                break;\n\n               case 7:\n                 rec->sph_fdef_flags            |= SPH_FDEF_TYPEMAN_DIAGENDCTRL;\n                 CUR.face->sph_found_func_flags |= SPH_FDEF_TYPEMAN_DIAGENDCTRL;\n                 break;\n\n               case 8:\n#if 0\n                 rec->sph_fdef_flags            |= SPH_FDEF_TYPEMAN_DIAGENDCTRL;\n                 CUR.face->sph_found_func_flags |= SPH_FDEF_TYPEMAN_DIAGENDCTRL;\n#endif\n                 break;\n              }\n              opcode_pointer[i] = 0;\n            }\n          }\n\n          else\n            opcode_pointer[i] = 0;\n        }\n\n        /* Set sph_compatibility_mode only when deltas are detected */\n        CUR.face->sph_compatibility_mode =\n          ( ( CUR.face->sph_found_func_flags & SPH_FDEF_INLINE_DELTA_1 ) |\n            ( CUR.face->sph_found_func_flags & SPH_FDEF_INLINE_DELTA_2 ) );\n      }\n\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n      switch ( CUR.opcode )\n      {\n      case 0x89:    /* IDEF */\n      case 0x2C:    /* FDEF */\n        CUR.error = FT_THROW( Nested_DEFS );\n        return;\n\n      case 0x2D:   /* ENDF */\n        rec->end = CUR.IP;\n        return;\n      }\n    }\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* ENDF[]:       END Function definition                                 */\n  /* Opcode range: 0x2D                                                    */\n  /* Stack:        -->                                                     */\n  /*                                                                       */\n  static void\n  Ins_ENDF( INS_ARG )\n  {\n    TT_CallRec*  pRec;\n\n    FT_UNUSED_ARG;\n\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    CUR.sph_in_func_flags = 0x0000;\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n    if ( CUR.callTop <= 0 )     /* We encountered an ENDF without a call */\n    {\n      CUR.error = FT_THROW( ENDF_In_Exec_Stream );\n      return;\n    }\n\n    CUR.callTop--;\n\n    pRec = &CUR.callStack[CUR.callTop];\n\n    pRec->Cur_Count--;\n\n    CUR.step_ins = FALSE;\n\n    if ( pRec->Cur_Count > 0 )\n    {\n      CUR.callTop++;\n      CUR.IP = pRec->Def->start;\n    }\n    else\n      /* Loop through the current function */\n      INS_Goto_CodeRange( pRec->Caller_Range,\n                          pRec->Caller_IP );\n\n    /* Exit the current call frame.                      */\n\n    /* NOTE: If the last instruction of a program is a   */\n    /*       CALL or LOOPCALL, the return address is     */\n    /*       always out of the code range.  This is a    */\n    /*       valid address, and it is why we do not test */\n    /*       the result of Ins_Goto_CodeRange() here!    */\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* CALL[]:       CALL function                                           */\n  /* Opcode range: 0x2B                                                    */\n  /* Stack:        uint32? -->                                             */\n  /*                                                                       */\n  static void\n  Ins_CALL( INS_ARG )\n  {\n    FT_ULong       F;\n    TT_CallRec*    pCrec;\n    TT_DefRecord*  def;\n\n\n    /* first of all, check the index */\n\n    F = args[0];\n    if ( BOUNDSL( F, CUR.maxFunc + 1 ) )\n      goto Fail;\n\n    /* Except for some old Apple fonts, all functions in a TrueType */\n    /* font are defined in increasing order, starting from 0.  This */\n    /* means that we normally have                                  */\n    /*                                                              */\n    /*    CUR.maxFunc+1 == CUR.numFDefs                             */\n    /*    CUR.FDefs[n].opc == n for n in 0..CUR.maxFunc             */\n    /*                                                              */\n    /* If this isn't true, we need to look up the function table.   */\n\n    def = CUR.FDefs + F;\n    if ( CUR.maxFunc + 1 != CUR.numFDefs || def->opc != F )\n    {\n      /* look up the FDefs table */\n      TT_DefRecord*  limit;\n\n\n      def   = CUR.FDefs;\n      limit = def + CUR.numFDefs;\n\n      while ( def < limit && def->opc != F )\n        def++;\n\n      if ( def == limit )\n        goto Fail;\n    }\n\n    /* check that the function is active */\n    if ( !def->active )\n      goto Fail;\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    if ( SUBPIXEL_HINTING                                              &&\n         CUR.ignore_x_mode                                             &&\n         ( ( CUR.iup_called                                        &&\n             ( CUR.sph_tweak_flags & SPH_TWEAK_NO_CALL_AFTER_IUP ) ) ||\n           ( def->sph_fdef_flags & SPH_FDEF_VACUFORM_ROUND_1 )       ) )\n      goto Fail;\n    else\n      CUR.sph_in_func_flags = def->sph_fdef_flags;\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n    /* check the call stack */\n    if ( CUR.callTop >= CUR.callSize )\n    {\n      CUR.error = FT_THROW( Stack_Overflow );\n      return;\n    }\n\n    pCrec = CUR.callStack + CUR.callTop;\n\n    pCrec->Caller_Range = CUR.curRange;\n    pCrec->Caller_IP    = CUR.IP + 1;\n    pCrec->Cur_Count    = 1;\n    pCrec->Def          = def;\n\n    CUR.callTop++;\n\n    INS_Goto_CodeRange( def->range,\n                        def->start );\n\n    CUR.step_ins = FALSE;\n\n    return;\n\n  Fail:\n    CUR.error = FT_THROW( Invalid_Reference );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* LOOPCALL[]:   LOOP and CALL function                                  */\n  /* Opcode range: 0x2A                                                    */\n  /* Stack:        uint32? Eint16? -->                                     */\n  /*                                                                       */\n  static void\n  Ins_LOOPCALL( INS_ARG )\n  {\n    FT_ULong       F;\n    TT_CallRec*    pCrec;\n    TT_DefRecord*  def;\n\n\n    /* first of all, check the index */\n    F = args[1];\n    if ( BOUNDSL( F, CUR.maxFunc + 1 ) )\n      goto Fail;\n\n    /* Except for some old Apple fonts, all functions in a TrueType */\n    /* font are defined in increasing order, starting from 0.  This */\n    /* means that we normally have                                  */\n    /*                                                              */\n    /*    CUR.maxFunc+1 == CUR.numFDefs                             */\n    /*    CUR.FDefs[n].opc == n for n in 0..CUR.maxFunc             */\n    /*                                                              */\n    /* If this isn't true, we need to look up the function table.   */\n\n    def = CUR.FDefs + F;\n    if ( CUR.maxFunc + 1 != CUR.numFDefs || def->opc != F )\n    {\n      /* look up the FDefs table */\n      TT_DefRecord*  limit;\n\n\n      def   = CUR.FDefs;\n      limit = def + CUR.numFDefs;\n\n      while ( def < limit && def->opc != F )\n        def++;\n\n      if ( def == limit )\n        goto Fail;\n    }\n\n    /* check that the function is active */\n    if ( !def->active )\n      goto Fail;\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    if ( SUBPIXEL_HINTING                                    &&\n         CUR.ignore_x_mode                                   &&\n         ( def->sph_fdef_flags & SPH_FDEF_VACUFORM_ROUND_1 ) )\n      goto Fail;\n    else\n      CUR.sph_in_func_flags = def->sph_fdef_flags;\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n    /* check stack */\n    if ( CUR.callTop >= CUR.callSize )\n    {\n      CUR.error = FT_THROW( Stack_Overflow );\n      return;\n    }\n\n    if ( args[0] > 0 )\n    {\n      pCrec = CUR.callStack + CUR.callTop;\n\n      pCrec->Caller_Range = CUR.curRange;\n      pCrec->Caller_IP    = CUR.IP + 1;\n      pCrec->Cur_Count    = (FT_Int)args[0];\n      pCrec->Def          = def;\n\n      CUR.callTop++;\n\n      INS_Goto_CodeRange( def->range, def->start );\n\n      CUR.step_ins = FALSE;\n    }\n\n    return;\n\n  Fail:\n    CUR.error = FT_THROW( Invalid_Reference );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* IDEF[]:       Instruction DEFinition                                  */\n  /* Opcode range: 0x89                                                    */\n  /* Stack:        Eint8 -->                                               */\n  /*                                                                       */\n  static void\n  Ins_IDEF( INS_ARG )\n  {\n    TT_DefRecord*  def;\n    TT_DefRecord*  limit;\n\n\n    /*  First of all, look for the same function in our table */\n\n    def   = CUR.IDefs;\n    limit = def + CUR.numIDefs;\n\n    for ( ; def < limit; def++ )\n      if ( def->opc == (FT_ULong)args[0] )\n        break;\n\n    if ( def == limit )\n    {\n      /* check that there is enough room for a new instruction */\n      if ( CUR.numIDefs >= CUR.maxIDefs )\n      {\n        CUR.error = FT_THROW( Too_Many_Instruction_Defs );\n        return;\n      }\n      CUR.numIDefs++;\n    }\n\n    /* opcode must be unsigned 8-bit integer */\n    if ( 0 > args[0] || args[0] > 0x00FF )\n    {\n      CUR.error = FT_THROW( Too_Many_Instruction_Defs );\n      return;\n    }\n\n    def->opc    = (FT_Byte)args[0];\n    def->start  = CUR.IP + 1;\n    def->range  = CUR.curRange;\n    def->active = TRUE;\n\n    if ( (FT_ULong)args[0] > CUR.maxIns )\n      CUR.maxIns = (FT_Byte)args[0];\n\n    /* Now skip the whole function definition. */\n    /* We don't allow nested IDEFs & FDEFs.    */\n\n    while ( SKIP_Code() == SUCCESS )\n    {\n      switch ( CUR.opcode )\n      {\n      case 0x89:   /* IDEF */\n      case 0x2C:   /* FDEF */\n        CUR.error = FT_THROW( Nested_DEFS );\n        return;\n      case 0x2D:   /* ENDF */\n        return;\n      }\n    }\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* PUSHING DATA ONTO THE INTERPRETER STACK                               */\n  /*                                                                       */\n  /*   Instructions appear in the specification's order.                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* NPUSHB[]:     PUSH N Bytes                                            */\n  /* Opcode range: 0x40                                                    */\n  /* Stack:        --> uint32...                                           */\n  /*                                                                       */\n  static void\n  Ins_NPUSHB( INS_ARG )\n  {\n    FT_UShort  L, K;\n\n\n    L = (FT_UShort)CUR.code[CUR.IP + 1];\n\n    if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )\n    {\n      CUR.error = FT_THROW( Stack_Overflow );\n      return;\n    }\n\n    for ( K = 1; K <= L; K++ )\n      args[K - 1] = CUR.code[CUR.IP + K + 1];\n\n    CUR.new_top += L;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* NPUSHW[]:     PUSH N Words                                            */\n  /* Opcode range: 0x41                                                    */\n  /* Stack:        --> int32...                                            */\n  /*                                                                       */\n  static void\n  Ins_NPUSHW( INS_ARG )\n  {\n    FT_UShort  L, K;\n\n\n    L = (FT_UShort)CUR.code[CUR.IP + 1];\n\n    if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )\n    {\n      CUR.error = FT_THROW( Stack_Overflow );\n      return;\n    }\n\n    CUR.IP += 2;\n\n    for ( K = 0; K < L; K++ )\n      args[K] = GET_ShortIns();\n\n    CUR.step_ins = FALSE;\n    CUR.new_top += L;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* PUSHB[abc]:   PUSH Bytes                                              */\n  /* Opcode range: 0xB0-0xB7                                               */\n  /* Stack:        --> uint32...                                           */\n  /*                                                                       */\n  static void\n  Ins_PUSHB( INS_ARG )\n  {\n    FT_UShort  L, K;\n\n\n    L = (FT_UShort)( CUR.opcode - 0xB0 + 1 );\n\n    if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )\n    {\n      CUR.error = FT_THROW( Stack_Overflow );\n      return;\n    }\n\n    for ( K = 1; K <= L; K++ )\n      args[K - 1] = CUR.code[CUR.IP + K];\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* PUSHW[abc]:   PUSH Words                                              */\n  /* Opcode range: 0xB8-0xBF                                               */\n  /* Stack:        --> int32...                                            */\n  /*                                                                       */\n  static void\n  Ins_PUSHW( INS_ARG )\n  {\n    FT_UShort  L, K;\n\n\n    L = (FT_UShort)( CUR.opcode - 0xB8 + 1 );\n\n    if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) )\n    {\n      CUR.error = FT_THROW( Stack_Overflow );\n      return;\n    }\n\n    CUR.IP++;\n\n    for ( K = 0; K < L; K++ )\n      args[K] = GET_ShortIns();\n\n    CUR.step_ins = FALSE;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* MANAGING THE GRAPHICS STATE                                           */\n  /*                                                                       */\n  /*  Instructions appear in the specs' order.                             */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* GC[a]:        Get Coordinate projected onto                           */\n  /* Opcode range: 0x46-0x47                                               */\n  /* Stack:        uint32 --> f26.6                                        */\n  /*                                                                       */\n  /* XXX: UNDOCUMENTED: Measures from the original glyph must be taken     */\n  /*      along the dual projection vector!                                */\n  /*                                                                       */\n  static void\n  Ins_GC( INS_ARG )\n  {\n    FT_ULong    L;\n    FT_F26Dot6  R;\n\n\n    L = (FT_ULong)args[0];\n\n    if ( BOUNDSL( L, CUR.zp2.n_points ) )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      R = 0;\n    }\n    else\n    {\n      if ( CUR.opcode & 1 )\n        R = CUR_fast_dualproj( &CUR.zp2.org[L] );\n      else\n        R = CUR_fast_project( &CUR.zp2.cur[L] );\n    }\n\n    args[0] = R;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SCFS[]:       Set Coordinate From Stack                               */\n  /* Opcode range: 0x48                                                    */\n  /* Stack:        f26.6 uint32 -->                                        */\n  /*                                                                       */\n  /* Formula:                                                              */\n  /*                                                                       */\n  /*   OA := OA + ( value - OA.p )/( f.p ) * f                             */\n  /*                                                                       */\n  static void\n  Ins_SCFS( INS_ARG )\n  {\n    FT_Long    K;\n    FT_UShort  L;\n\n\n    L = (FT_UShort)args[0];\n\n    if ( BOUNDS( L, CUR.zp2.n_points ) )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      return;\n    }\n\n    K = CUR_fast_project( &CUR.zp2.cur[L] );\n\n    CUR_Func_move( &CUR.zp2, L, args[1] - K );\n\n    /* UNDOCUMENTED!  The MS rasterizer does that with */\n    /* twilight points (confirmed by Greg Hitchcock)   */\n    if ( CUR.GS.gep2 == 0 )\n      CUR.zp2.org[L] = CUR.zp2.cur[L];\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* MD[a]:        Measure Distance                                        */\n  /* Opcode range: 0x49-0x4A                                               */\n  /* Stack:        uint32 uint32 --> f26.6                                 */\n  /*                                                                       */\n  /* XXX: UNDOCUMENTED: Measure taken in the original glyph must be along  */\n  /*                    the dual projection vector.                        */\n  /*                                                                       */\n  /* XXX: UNDOCUMENTED: Flag attributes are inverted!                      */\n  /*                      0 => measure distance in original outline        */\n  /*                      1 => measure distance in grid-fitted outline     */\n  /*                                                                       */\n  /* XXX: UNDOCUMENTED: `zp0 - zp1', and not `zp2 - zp1!                   */\n  /*                                                                       */\n  static void\n  Ins_MD( INS_ARG )\n  {\n    FT_UShort   K, L;\n    FT_F26Dot6  D;\n\n\n    K = (FT_UShort)args[1];\n    L = (FT_UShort)args[0];\n\n    if ( BOUNDS( L, CUR.zp0.n_points ) ||\n         BOUNDS( K, CUR.zp1.n_points ) )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      D = 0;\n    }\n    else\n    {\n      if ( CUR.opcode & 1 )\n        D = CUR_Func_project( CUR.zp0.cur + L, CUR.zp1.cur + K );\n      else\n      {\n        /* XXX: UNDOCUMENTED: twilight zone special case */\n\n        if ( CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 )\n        {\n          FT_Vector*  vec1 = CUR.zp0.org + L;\n          FT_Vector*  vec2 = CUR.zp1.org + K;\n\n\n          D = CUR_Func_dualproj( vec1, vec2 );\n        }\n        else\n        {\n          FT_Vector*  vec1 = CUR.zp0.orus + L;\n          FT_Vector*  vec2 = CUR.zp1.orus + K;\n\n\n          if ( CUR.metrics.x_scale == CUR.metrics.y_scale )\n          {\n            /* this should be faster */\n            D = CUR_Func_dualproj( vec1, vec2 );\n            D = FT_MulFix( D, CUR.metrics.x_scale );\n          }\n          else\n          {\n            FT_Vector  vec;\n\n\n            vec.x = FT_MulFix( vec1->x - vec2->x, CUR.metrics.x_scale );\n            vec.y = FT_MulFix( vec1->y - vec2->y, CUR.metrics.y_scale );\n\n            D = CUR_fast_dualproj( &vec );\n          }\n        }\n      }\n    }\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    /* Disable Type 2 Vacuform Rounds - e.g. Arial Narrow */\n    if ( SUBPIXEL_HINTING                       &&\n         CUR.ignore_x_mode && FT_ABS( D ) == 64 )\n      D += 1;\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n    args[0] = D;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SDPVTL[a]:    Set Dual PVector to Line                                */\n  /* Opcode range: 0x86-0x87                                               */\n  /* Stack:        uint32 uint32 -->                                       */\n  /*                                                                       */\n  static void\n  Ins_SDPVTL( INS_ARG )\n  {\n    FT_Long    A, B, C;\n    FT_UShort  p1, p2;            /* was FT_Int in pas type ERROR */\n    FT_Int     aOpc = CUR.opcode;\n\n\n    p1 = (FT_UShort)args[1];\n    p2 = (FT_UShort)args[0];\n\n    if ( BOUNDS( p2, CUR.zp1.n_points ) ||\n         BOUNDS( p1, CUR.zp2.n_points ) )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      return;\n    }\n\n    {\n      FT_Vector* v1 = CUR.zp1.org + p2;\n      FT_Vector* v2 = CUR.zp2.org + p1;\n\n\n      A = v1->x - v2->x;\n      B = v1->y - v2->y;\n\n      /* If v1 == v2, SDPVTL behaves the same as */\n      /* SVTCA[X], respectively.                 */\n      /*                                         */\n      /* Confirmed by Greg Hitchcock.            */\n\n      if ( A == 0 && B == 0 )\n      {\n        A    = 0x4000;\n        aOpc = 0;\n      }\n    }\n\n    if ( ( aOpc & 1 ) != 0 )\n    {\n      C =  B;   /* counter clockwise rotation */\n      B =  A;\n      A = -C;\n    }\n\n    NORMalize( A, B, &CUR.GS.dualVector );\n\n    {\n      FT_Vector*  v1 = CUR.zp1.cur + p2;\n      FT_Vector*  v2 = CUR.zp2.cur + p1;\n\n\n      A = v1->x - v2->x;\n      B = v1->y - v2->y;\n\n      if ( A == 0 && B == 0 )\n      {\n        A    = 0x4000;\n        aOpc = 0;\n      }\n    }\n\n    if ( ( aOpc & 1 ) != 0 )\n    {\n      C =  B;   /* counter clockwise rotation */\n      B =  A;\n      A = -C;\n    }\n\n    NORMalize( A, B, &CUR.GS.projVector );\n\n    GUESS_VECTOR( freeVector );\n\n    COMPUTE_Funcs();\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SZP0[]:       Set Zone Pointer 0                                      */\n  /* Opcode range: 0x13                                                    */\n  /* Stack:        uint32 -->                                              */\n  /*                                                                       */\n  static void\n  Ins_SZP0( INS_ARG )\n  {\n    switch ( (FT_Int)args[0] )\n    {\n    case 0:\n      CUR.zp0 = CUR.twilight;\n      break;\n\n    case 1:\n      CUR.zp0 = CUR.pts;\n      break;\n\n    default:\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      return;\n    }\n\n    CUR.GS.gep0 = (FT_UShort)args[0];\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SZP1[]:       Set Zone Pointer 1                                      */\n  /* Opcode range: 0x14                                                    */\n  /* Stack:        uint32 -->                                              */\n  /*                                                                       */\n  static void\n  Ins_SZP1( INS_ARG )\n  {\n    switch ( (FT_Int)args[0] )\n    {\n    case 0:\n      CUR.zp1 = CUR.twilight;\n      break;\n\n    case 1:\n      CUR.zp1 = CUR.pts;\n      break;\n\n    default:\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      return;\n    }\n\n    CUR.GS.gep1 = (FT_UShort)args[0];\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SZP2[]:       Set Zone Pointer 2                                      */\n  /* Opcode range: 0x15                                                    */\n  /* Stack:        uint32 -->                                              */\n  /*                                                                       */\n  static void\n  Ins_SZP2( INS_ARG )\n  {\n    switch ( (FT_Int)args[0] )\n    {\n    case 0:\n      CUR.zp2 = CUR.twilight;\n      break;\n\n    case 1:\n      CUR.zp2 = CUR.pts;\n      break;\n\n    default:\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      return;\n    }\n\n    CUR.GS.gep2 = (FT_UShort)args[0];\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SZPS[]:       Set Zone PointerS                                       */\n  /* Opcode range: 0x16                                                    */\n  /* Stack:        uint32 -->                                              */\n  /*                                                                       */\n  static void\n  Ins_SZPS( INS_ARG )\n  {\n    switch ( (FT_Int)args[0] )\n    {\n    case 0:\n      CUR.zp0 = CUR.twilight;\n      break;\n\n    case 1:\n      CUR.zp0 = CUR.pts;\n      break;\n\n    default:\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      return;\n    }\n\n    CUR.zp1 = CUR.zp0;\n    CUR.zp2 = CUR.zp0;\n\n    CUR.GS.gep0 = (FT_UShort)args[0];\n    CUR.GS.gep1 = (FT_UShort)args[0];\n    CUR.GS.gep2 = (FT_UShort)args[0];\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* INSTCTRL[]:   INSTruction ConTRoL                                     */\n  /* Opcode range: 0x8E                                                    */\n  /* Stack:        int32 int32 -->                                         */\n  /*                                                                       */\n  static void\n  Ins_INSTCTRL( INS_ARG )\n  {\n    FT_Long  K, L;\n\n\n    K = args[1];\n    L = args[0];\n\n    if ( K < 1 || K > 2 )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      return;\n    }\n\n    if ( L != 0 )\n        L = K;\n\n    CUR.GS.instruct_control = FT_BOOL(\n      ( (FT_Byte)CUR.GS.instruct_control & ~(FT_Byte)K ) | (FT_Byte)L );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SCANCTRL[]:   SCAN ConTRoL                                            */\n  /* Opcode range: 0x85                                                    */\n  /* Stack:        uint32? -->                                             */\n  /*                                                                       */\n  static void\n  Ins_SCANCTRL( INS_ARG )\n  {\n    FT_Int  A;\n\n\n    /* Get Threshold */\n    A = (FT_Int)( args[0] & 0xFF );\n\n    if ( A == 0xFF )\n    {\n      CUR.GS.scan_control = TRUE;\n      return;\n    }\n    else if ( A == 0 )\n    {\n      CUR.GS.scan_control = FALSE;\n      return;\n    }\n\n    if ( ( args[0] & 0x100 ) != 0 && CUR.tt_metrics.ppem <= A )\n      CUR.GS.scan_control = TRUE;\n\n    if ( ( args[0] & 0x200 ) != 0 && CUR.tt_metrics.rotated )\n      CUR.GS.scan_control = TRUE;\n\n    if ( ( args[0] & 0x400 ) != 0 && CUR.tt_metrics.stretched )\n      CUR.GS.scan_control = TRUE;\n\n    if ( ( args[0] & 0x800 ) != 0 && CUR.tt_metrics.ppem > A )\n      CUR.GS.scan_control = FALSE;\n\n    if ( ( args[0] & 0x1000 ) != 0 && CUR.tt_metrics.rotated )\n      CUR.GS.scan_control = FALSE;\n\n    if ( ( args[0] & 0x2000 ) != 0 && CUR.tt_metrics.stretched )\n      CUR.GS.scan_control = FALSE;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SCANTYPE[]:   SCAN TYPE                                               */\n  /* Opcode range: 0x8D                                                    */\n  /* Stack:        uint32? -->                                             */\n  /*                                                                       */\n  static void\n  Ins_SCANTYPE( INS_ARG )\n  {\n    if ( args[0] >= 0 )\n      CUR.GS.scan_type = (FT_Int)args[0];\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* MANAGING OUTLINES                                                     */\n  /*                                                                       */\n  /*   Instructions appear in the specification's order.                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* FLIPPT[]:     FLIP PoinT                                              */\n  /* Opcode range: 0x80                                                    */\n  /* Stack:        uint32... -->                                           */\n  /*                                                                       */\n  static void\n  Ins_FLIPPT( INS_ARG )\n  {\n    FT_UShort  point;\n\n    FT_UNUSED_ARG;\n\n\n    if ( CUR.top < CUR.GS.loop )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Too_Few_Arguments );\n      goto Fail;\n    }\n\n    while ( CUR.GS.loop > 0 )\n    {\n      CUR.args--;\n\n      point = (FT_UShort)CUR.stack[CUR.args];\n\n      if ( BOUNDS( point, CUR.pts.n_points ) )\n      {\n        if ( CUR.pedantic_hinting )\n        {\n          CUR.error = FT_THROW( Invalid_Reference );\n          return;\n        }\n      }\n      else\n        CUR.pts.tags[point] ^= FT_CURVE_TAG_ON;\n\n      CUR.GS.loop--;\n    }\n\n  Fail:\n    CUR.GS.loop = 1;\n    CUR.new_top = CUR.args;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* FLIPRGON[]:   FLIP RanGe ON                                           */\n  /* Opcode range: 0x81                                                    */\n  /* Stack:        uint32 uint32 -->                                       */\n  /*                                                                       */\n  static void\n  Ins_FLIPRGON( INS_ARG )\n  {\n    FT_UShort  I, K, L;\n\n\n    K = (FT_UShort)args[1];\n    L = (FT_UShort)args[0];\n\n    if ( BOUNDS( K, CUR.pts.n_points ) ||\n         BOUNDS( L, CUR.pts.n_points ) )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      return;\n    }\n\n    for ( I = L; I <= K; I++ )\n      CUR.pts.tags[I] |= FT_CURVE_TAG_ON;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* FLIPRGOFF:    FLIP RanGe OFF                                          */\n  /* Opcode range: 0x82                                                    */\n  /* Stack:        uint32 uint32 -->                                       */\n  /*                                                                       */\n  static void\n  Ins_FLIPRGOFF( INS_ARG )\n  {\n    FT_UShort  I, K, L;\n\n\n    K = (FT_UShort)args[1];\n    L = (FT_UShort)args[0];\n\n    if ( BOUNDS( K, CUR.pts.n_points ) ||\n         BOUNDS( L, CUR.pts.n_points ) )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      return;\n    }\n\n    for ( I = L; I <= K; I++ )\n      CUR.pts.tags[I] &= ~FT_CURVE_TAG_ON;\n  }\n\n\n  static FT_Bool\n  Compute_Point_Displacement( EXEC_OP_ FT_F26Dot6*   x,\n                                       FT_F26Dot6*   y,\n                                       TT_GlyphZone  zone,\n                                       FT_UShort*    refp )\n  {\n    TT_GlyphZoneRec  zp;\n    FT_UShort        p;\n    FT_F26Dot6       d;\n\n\n    if ( CUR.opcode & 1 )\n    {\n      zp = CUR.zp0;\n      p  = CUR.GS.rp1;\n    }\n    else\n    {\n      zp = CUR.zp1;\n      p  = CUR.GS.rp2;\n    }\n\n    if ( BOUNDS( p, zp.n_points ) )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      *refp = 0;\n      return FAILURE;\n    }\n\n    *zone = zp;\n    *refp = p;\n\n    d = CUR_Func_project( zp.cur + p, zp.org + p );\n\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n    if ( CUR.face->unpatented_hinting )\n    {\n      if ( CUR.GS.both_x_axis )\n      {\n        *x = d;\n        *y = 0;\n      }\n      else\n      {\n        *x = 0;\n        *y = d;\n      }\n    }\n    else\n#endif\n    {\n      *x = FT_MulDiv( d, (FT_Long)CUR.GS.freeVector.x, CUR.F_dot_P );\n      *y = FT_MulDiv( d, (FT_Long)CUR.GS.freeVector.y, CUR.F_dot_P );\n    }\n\n    return SUCCESS;\n  }\n\n\n  static void\n  Move_Zp2_Point( EXEC_OP_ FT_UShort   point,\n                           FT_F26Dot6  dx,\n                           FT_F26Dot6  dy,\n                           FT_Bool     touch )\n  {\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n    if ( CUR.face->unpatented_hinting )\n    {\n      if ( CUR.GS.both_x_axis )\n      {\n        CUR.zp2.cur[point].x += dx;\n        if ( touch )\n          CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_X;\n      }\n      else\n      {\n        CUR.zp2.cur[point].y += dy;\n        if ( touch )\n          CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_Y;\n      }\n      return;\n    }\n#endif\n\n    if ( CUR.GS.freeVector.x != 0 )\n    {\n      CUR.zp2.cur[point].x += dx;\n      if ( touch )\n        CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_X;\n    }\n\n    if ( CUR.GS.freeVector.y != 0 )\n    {\n      CUR.zp2.cur[point].y += dy;\n      if ( touch )\n        CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_Y;\n    }\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SHP[a]:       SHift Point by the last point                           */\n  /* Opcode range: 0x32-0x33                                               */\n  /* Stack:        uint32... -->                                           */\n  /*                                                                       */\n  static void\n  Ins_SHP( INS_ARG )\n  {\n    TT_GlyphZoneRec  zp;\n    FT_UShort        refp;\n\n    FT_F26Dot6       dx,\n                     dy;\n    FT_UShort        point;\n\n    FT_UNUSED_ARG;\n\n\n    if ( CUR.top < CUR.GS.loop )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      goto Fail;\n    }\n\n    if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) )\n      return;\n\n    while ( CUR.GS.loop > 0 )\n    {\n      CUR.args--;\n      point = (FT_UShort)CUR.stack[CUR.args];\n\n      if ( BOUNDS( point, CUR.zp2.n_points ) )\n      {\n        if ( CUR.pedantic_hinting )\n        {\n          CUR.error = FT_THROW( Invalid_Reference );\n          return;\n        }\n      }\n      else\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n      /* doesn't follow Cleartype spec but produces better result */\n      if ( SUBPIXEL_HINTING  &&\n           CUR.ignore_x_mode )\n        MOVE_Zp2_Point( point, 0, dy, TRUE );\n      else\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n        MOVE_Zp2_Point( point, dx, dy, TRUE );\n\n      CUR.GS.loop--;\n    }\n\n  Fail:\n    CUR.GS.loop = 1;\n    CUR.new_top = CUR.args;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SHC[a]:       SHift Contour                                           */\n  /* Opcode range: 0x34-35                                                 */\n  /* Stack:        uint32 -->                                              */\n  /*                                                                       */\n  /* UNDOCUMENTED: According to Greg Hitchcock, there is one (virtual)     */\n  /*               contour in the twilight zone, namely contour number     */\n  /*               zero which includes all points of it.                   */\n  /*                                                                       */\n  static void\n  Ins_SHC( INS_ARG )\n  {\n    TT_GlyphZoneRec  zp;\n    FT_UShort        refp;\n    FT_F26Dot6       dx, dy;\n\n    FT_Short         contour, bounds;\n    FT_UShort        start, limit, i;\n\n\n    contour = (FT_UShort)args[0];\n    bounds  = ( CUR.GS.gep2 == 0 ) ? 1 : CUR.zp2.n_contours;\n\n    if ( BOUNDS( contour, bounds ) )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      return;\n    }\n\n    if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) )\n      return;\n\n    if ( contour == 0 )\n      start = 0;\n    else\n      start = (FT_UShort)( CUR.zp2.contours[contour - 1] + 1 -\n                           CUR.zp2.first_point );\n\n    /* we use the number of points if in the twilight zone */\n    if ( CUR.GS.gep2 == 0 )\n      limit = CUR.zp2.n_points;\n    else\n      limit = (FT_UShort)( CUR.zp2.contours[contour] -\n                           CUR.zp2.first_point + 1 );\n\n    for ( i = start; i < limit; i++ )\n    {\n      if ( zp.cur != CUR.zp2.cur || refp != i )\n        MOVE_Zp2_Point( i, dx, dy, TRUE );\n    }\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SHZ[a]:       SHift Zone                                              */\n  /* Opcode range: 0x36-37                                                 */\n  /* Stack:        uint32 -->                                              */\n  /*                                                                       */\n  static void\n  Ins_SHZ( INS_ARG )\n  {\n    TT_GlyphZoneRec  zp;\n    FT_UShort        refp;\n    FT_F26Dot6       dx,\n                     dy;\n\n    FT_UShort        limit, i;\n\n\n    if ( BOUNDS( args[0], 2 ) )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      return;\n    }\n\n    if ( COMPUTE_Point_Displacement( &dx, &dy, &zp, &refp ) )\n      return;\n\n    /* XXX: UNDOCUMENTED! SHZ doesn't move the phantom points.     */\n    /*      Twilight zone has no real contours, so use `n_points'. */\n    /*      Normal zone's `n_points' includes phantoms, so must    */\n    /*      use end of last contour.                               */\n    if ( CUR.GS.gep2 == 0 )\n      limit = (FT_UShort)CUR.zp2.n_points;\n    else if ( CUR.GS.gep2 == 1 && CUR.zp2.n_contours > 0 )\n      limit = (FT_UShort)( CUR.zp2.contours[CUR.zp2.n_contours - 1] + 1 );\n    else\n      limit = 0;\n\n    /* XXX: UNDOCUMENTED! SHZ doesn't touch the points */\n    for ( i = 0; i < limit; i++ )\n    {\n      if ( zp.cur != CUR.zp2.cur || refp != i )\n        MOVE_Zp2_Point( i, dx, dy, FALSE );\n    }\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* SHPIX[]:      SHift points by a PIXel amount                          */\n  /* Opcode range: 0x38                                                    */\n  /* Stack:        f26.6 uint32... -->                                     */\n  /*                                                                       */\n  static void\n  Ins_SHPIX( INS_ARG )\n  {\n    FT_F26Dot6  dx, dy;\n    FT_UShort   point;\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    FT_Int      B1, B2;\n#endif\n\n\n    if ( CUR.top < CUR.GS.loop + 1 )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      goto Fail;\n    }\n\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n    if ( CUR.face->unpatented_hinting )\n    {\n      if ( CUR.GS.both_x_axis )\n      {\n        dx = (FT_UInt32)args[0];\n        dy = 0;\n      }\n      else\n      {\n        dx = 0;\n        dy = (FT_UInt32)args[0];\n      }\n    }\n    else\n#endif\n    {\n      dx = TT_MulFix14( (FT_UInt32)args[0], CUR.GS.freeVector.x );\n      dy = TT_MulFix14( (FT_UInt32)args[0], CUR.GS.freeVector.y );\n    }\n\n    while ( CUR.GS.loop > 0 )\n    {\n      CUR.args--;\n\n      point = (FT_UShort)CUR.stack[CUR.args];\n\n      if ( BOUNDS( point, CUR.zp2.n_points ) )\n      {\n        if ( CUR.pedantic_hinting )\n        {\n          CUR.error = FT_THROW( Invalid_Reference );\n          return;\n        }\n      }\n      else\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n      {\n        /*  If not using ignore_x_mode rendering, allow ZP2 move.          */\n        /*  If inline deltas aren't allowed, skip ZP2 move.                */\n        /*  If using ignore_x_mode rendering, allow ZP2 point move if:     */\n        /*   - freedom vector is y and sph_compatibility_mode is off       */\n        /*   - the glyph is composite and the move is in the Y direction   */\n        /*   - the glyph is specifically set to allow SHPIX moves          */\n        /*   - the move is on a previously Y-touched point                 */\n\n        if ( SUBPIXEL_HINTING  &&\n             CUR.ignore_x_mode )\n        {\n          /* save point for later comparison */\n          if ( CUR.GS.freeVector.y != 0 )\n            B1 = CUR.zp2.cur[point].y;\n          else\n            B1 = CUR.zp2.cur[point].x;\n\n          if ( !CUR.face->sph_compatibility_mode &&\n               CUR.GS.freeVector.y != 0          )\n          {\n            MOVE_Zp2_Point( point, dx, dy, TRUE );\n\n            /* save new point */\n            if ( CUR.GS.freeVector.y != 0 )\n            {\n              B2 = CUR.zp2.cur[point].y;\n\n              /* reverse any disallowed moves */\n              if ( ( CUR.sph_tweak_flags & SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES ) &&\n                   ( B1 & 63 ) != 0                                          &&\n                   ( B2 & 63 ) != 0                                          &&\n                    B1 != B2                                                 )\n                MOVE_Zp2_Point( point, -dx, -dy, TRUE );\n            }\n          }\n          else if ( CUR.face->sph_compatibility_mode )\n          {\n            if ( CUR.sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES )\n            {\n              dx = FT_PIX_ROUND( B1 + dx ) - B1;\n              dy = FT_PIX_ROUND( B1 + dy ) - B1;\n            }\n\n            /* skip post-iup deltas */\n            if ( CUR.iup_called                                          &&\n                 ( ( CUR.sph_in_func_flags & SPH_FDEF_INLINE_DELTA_1 ) ||\n                   ( CUR.sph_in_func_flags & SPH_FDEF_INLINE_DELTA_2 ) ) )\n              goto Skip;\n\n            if ( !( CUR.sph_tweak_flags & SPH_TWEAK_ALWAYS_SKIP_DELTAP ) &&\n                  ( ( CUR.is_composite && CUR.GS.freeVector.y != 0 ) ||\n                    ( CUR.zp2.tags[point] & FT_CURVE_TAG_TOUCH_Y )   ||\n                    ( CUR.sph_tweak_flags & SPH_TWEAK_DO_SHPIX )     )   )\n              MOVE_Zp2_Point( point, 0, dy, TRUE );\n\n            /* save new point */\n            if ( CUR.GS.freeVector.y != 0 )\n            {\n              B2 = CUR.zp2.cur[point].y;\n\n              /* reverse any disallowed moves */\n              if ( ( B1 & 63 ) == 0 &&\n                   ( B2 & 63 ) != 0 &&\n                   B1 != B2         )\n                MOVE_Zp2_Point( point, 0, -dy, TRUE );\n            }\n          }\n          else if ( CUR.sph_in_func_flags & SPH_FDEF_TYPEMAN_DIAGENDCTRL )\n            MOVE_Zp2_Point( point, dx, dy, TRUE );\n        }\n        else\n          MOVE_Zp2_Point( point, dx, dy, TRUE );\n      }\n\n    Skip:\n\n#else /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n        MOVE_Zp2_Point( point, dx, dy, TRUE );\n\n#endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n      CUR.GS.loop--;\n    }\n\n  Fail:\n    CUR.GS.loop = 1;\n    CUR.new_top = CUR.args;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* MSIRP[a]:     Move Stack Indirect Relative Position                   */\n  /* Opcode range: 0x3A-0x3B                                               */\n  /* Stack:        f26.6 uint32 -->                                        */\n  /*                                                                       */\n  static void\n  Ins_MSIRP( INS_ARG )\n  {\n    FT_UShort   point;\n    FT_F26Dot6  distance;\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    FT_F26Dot6  control_value_cutin = 0; /* pacify compiler */\n\n\n    if ( SUBPIXEL_HINTING )\n    {\n      control_value_cutin = CUR.GS.control_value_cutin;\n\n      if ( CUR.ignore_x_mode                                 &&\n           CUR.GS.freeVector.x != 0                          &&\n           !( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )\n        control_value_cutin = 0;\n    }\n\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n    point = (FT_UShort)args[0];\n\n    if ( BOUNDS( point,      CUR.zp1.n_points ) ||\n         BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      return;\n    }\n\n    /* UNDOCUMENTED!  The MS rasterizer does that with */\n    /* twilight points (confirmed by Greg Hitchcock)   */\n    if ( CUR.GS.gep1 == 0 )\n    {\n      CUR.zp1.org[point] = CUR.zp0.org[CUR.GS.rp0];\n      CUR_Func_move_orig( &CUR.zp1, point, args[1] );\n      CUR.zp1.cur[point] = CUR.zp1.org[point];\n    }\n\n    distance = CUR_Func_project( CUR.zp1.cur + point,\n                                 CUR.zp0.cur + CUR.GS.rp0 );\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    /* subpixel hinting - make MSIRP respect CVT cut-in; */\n    if ( SUBPIXEL_HINTING                                    &&\n         CUR.ignore_x_mode                                   &&\n         CUR.GS.freeVector.x != 0                            &&\n         FT_ABS( distance - args[1] ) >= control_value_cutin )\n      distance = args[1];\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n    CUR_Func_move( &CUR.zp1, point, args[1] - distance );\n\n    CUR.GS.rp1 = CUR.GS.rp0;\n    CUR.GS.rp2 = point;\n\n    if ( ( CUR.opcode & 1 ) != 0 )\n      CUR.GS.rp0 = point;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* MDAP[a]:      Move Direct Absolute Point                              */\n  /* Opcode range: 0x2E-0x2F                                               */\n  /* Stack:        uint32 -->                                              */\n  /*                                                                       */\n  static void\n  Ins_MDAP( INS_ARG )\n  {\n    FT_UShort   point;\n    FT_F26Dot6  cur_dist;\n    FT_F26Dot6  distance;\n\n\n    point = (FT_UShort)args[0];\n\n    if ( BOUNDS( point, CUR.zp0.n_points ) )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      return;\n    }\n\n    if ( ( CUR.opcode & 1 ) != 0 )\n    {\n      cur_dist = CUR_fast_project( &CUR.zp0.cur[point] );\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n      if ( SUBPIXEL_HINTING         &&\n           CUR.ignore_x_mode        &&\n           CUR.GS.freeVector.x != 0 )\n        distance = ROUND_None(\n                     cur_dist,\n                     CUR.tt_metrics.compensations[0] ) - cur_dist;\n      else\n#endif\n        distance = CUR_Func_round(\n                     cur_dist,\n                     CUR.tt_metrics.compensations[0] ) - cur_dist;\n    }\n    else\n      distance = 0;\n\n    CUR_Func_move( &CUR.zp0, point, distance );\n\n    CUR.GS.rp0 = point;\n    CUR.GS.rp1 = point;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* MIAP[a]:      Move Indirect Absolute Point                            */\n  /* Opcode range: 0x3E-0x3F                                               */\n  /* Stack:        uint32 uint32 -->                                       */\n  /*                                                                       */\n  static void\n  Ins_MIAP( INS_ARG )\n  {\n    FT_ULong    cvtEntry;\n    FT_UShort   point;\n    FT_F26Dot6  distance;\n    FT_F26Dot6  org_dist;\n    FT_F26Dot6  control_value_cutin;\n\n\n    control_value_cutin = CUR.GS.control_value_cutin;\n    cvtEntry            = (FT_ULong)args[1];\n    point               = (FT_UShort)args[0];\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    if ( SUBPIXEL_HINTING                                  &&\n         CUR.ignore_x_mode                                 &&\n         CUR.GS.freeVector.x != 0                          &&\n         CUR.GS.freeVector.y == 0                          &&\n         !( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )\n      control_value_cutin = 0;\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n    if ( BOUNDS( point,     CUR.zp0.n_points ) ||\n         BOUNDSL( cvtEntry, CUR.cvtSize )      )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      goto Fail;\n    }\n\n    /* UNDOCUMENTED!                                                      */\n    /*                                                                    */\n    /* The behaviour of an MIAP instruction is quite different when used  */\n    /* in the twilight zone.                                              */\n    /*                                                                    */\n    /* First, no control value cut-in test is performed as it would fail  */\n    /* anyway.  Second, the original point, i.e. (org_x,org_y) of         */\n    /* zp0.point, is set to the absolute, unrounded distance found in the */\n    /* CVT.                                                               */\n    /*                                                                    */\n    /* This is used in the CVT programs of the Microsoft fonts Arial,     */\n    /* Times, etc., in order to re-adjust some key font heights.  It      */\n    /* allows the use of the IP instruction in the twilight zone, which   */\n    /* otherwise would be invalid according to the specification.         */\n    /*                                                                    */\n    /* We implement it with a special sequence for the twilight zone.     */\n    /* This is a bad hack, but it seems to work.                          */\n    /*                                                                    */\n    /* Confirmed by Greg Hitchcock.                                       */\n\n    distance = CUR_Func_read_cvt( cvtEntry );\n\n    if ( CUR.GS.gep0 == 0 )   /* If in twilight zone */\n    {\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n      /* Only adjust if not in sph_compatibility_mode or ignore_x_mode. */\n      /* Determined via experimentation and may be incorrect...         */\n      if ( !SUBPIXEL_HINTING                     ||\n           ( !CUR.ignore_x_mode                ||\n             !CUR.face->sph_compatibility_mode ) )\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n        CUR.zp0.org[point].x = TT_MulFix14( (FT_UInt32)distance,\n                                            CUR.GS.freeVector.x );\n      CUR.zp0.org[point].y = TT_MulFix14( (FT_UInt32)distance,\n                                          CUR.GS.freeVector.y ),\n      CUR.zp0.cur[point]   = CUR.zp0.org[point];\n    }\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    if ( SUBPIXEL_HINTING                              &&\n         CUR.ignore_x_mode                             &&\n         ( CUR.sph_tweak_flags & SPH_TWEAK_MIAP_HACK ) &&\n         distance > 0                                  &&\n         CUR.GS.freeVector.y != 0                      )\n      distance = 0;\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n    org_dist = CUR_fast_project( &CUR.zp0.cur[point] );\n\n    if ( ( CUR.opcode & 1 ) != 0 )   /* rounding and control cut-in flag */\n    {\n      if ( FT_ABS( distance - org_dist ) > control_value_cutin )\n        distance = org_dist;\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n      if ( SUBPIXEL_HINTING         &&\n           CUR.ignore_x_mode        &&\n           CUR.GS.freeVector.x != 0 )\n        distance = ROUND_None( distance,\n                               CUR.tt_metrics.compensations[0] );\n      else\n#endif\n        distance = CUR_Func_round( distance,\n                                   CUR.tt_metrics.compensations[0] );\n    }\n\n    CUR_Func_move( &CUR.zp0, point, distance - org_dist );\n\n  Fail:\n    CUR.GS.rp0 = point;\n    CUR.GS.rp1 = point;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* MDRP[abcde]:  Move Direct Relative Point                              */\n  /* Opcode range: 0xC0-0xDF                                               */\n  /* Stack:        uint32 -->                                              */\n  /*                                                                       */\n  static void\n  Ins_MDRP( INS_ARG )\n  {\n    FT_UShort   point;\n    FT_F26Dot6  org_dist, distance, minimum_distance;\n\n\n    minimum_distance = CUR.GS.minimum_distance;\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    if ( SUBPIXEL_HINTING                                  &&\n         CUR.ignore_x_mode                                 &&\n         CUR.GS.freeVector.x != 0                          &&\n         !( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )\n      minimum_distance = 0;\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n    point = (FT_UShort)args[0];\n\n    if ( BOUNDS( point,      CUR.zp1.n_points ) ||\n         BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      goto Fail;\n    }\n\n    /* XXX: Is there some undocumented feature while in the */\n    /*      twilight zone?                                  */\n\n    /* XXX: UNDOCUMENTED: twilight zone special case */\n\n    if ( CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 )\n    {\n      FT_Vector*  vec1 = &CUR.zp1.org[point];\n      FT_Vector*  vec2 = &CUR.zp0.org[CUR.GS.rp0];\n\n\n      org_dist = CUR_Func_dualproj( vec1, vec2 );\n    }\n    else\n    {\n      FT_Vector*  vec1 = &CUR.zp1.orus[point];\n      FT_Vector*  vec2 = &CUR.zp0.orus[CUR.GS.rp0];\n\n\n      if ( CUR.metrics.x_scale == CUR.metrics.y_scale )\n      {\n        /* this should be faster */\n        org_dist = CUR_Func_dualproj( vec1, vec2 );\n        org_dist = FT_MulFix( org_dist, CUR.metrics.x_scale );\n      }\n      else\n      {\n        FT_Vector  vec;\n\n\n        vec.x = FT_MulFix( vec1->x - vec2->x, CUR.metrics.x_scale );\n        vec.y = FT_MulFix( vec1->y - vec2->y, CUR.metrics.y_scale );\n\n        org_dist = CUR_fast_dualproj( &vec );\n      }\n    }\n\n    /* single width cut-in test */\n\n    if ( FT_ABS( org_dist - CUR.GS.single_width_value ) <\n         CUR.GS.single_width_cutin )\n    {\n      if ( org_dist >= 0 )\n        org_dist = CUR.GS.single_width_value;\n      else\n        org_dist = -CUR.GS.single_width_value;\n    }\n\n    /* round flag */\n\n    if ( ( CUR.opcode & 4 ) != 0 )\n    {\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n      if ( SUBPIXEL_HINTING         &&\n           CUR.ignore_x_mode        &&\n           CUR.GS.freeVector.x != 0 )\n        distance = ROUND_None(\n                     org_dist,\n                     CUR.tt_metrics.compensations[CUR.opcode & 3] );\n      else\n#endif\n      distance = CUR_Func_round(\n                   org_dist,\n                   CUR.tt_metrics.compensations[CUR.opcode & 3] );\n    }\n    else\n      distance = ROUND_None(\n                   org_dist,\n                   CUR.tt_metrics.compensations[CUR.opcode & 3] );\n\n    /* minimum distance flag */\n\n    if ( ( CUR.opcode & 8 ) != 0 )\n    {\n      if ( org_dist >= 0 )\n      {\n        if ( distance < minimum_distance )\n          distance = minimum_distance;\n      }\n      else\n      {\n        if ( distance > -minimum_distance )\n          distance = -minimum_distance;\n      }\n    }\n\n    /* now move the point */\n\n    org_dist = CUR_Func_project( CUR.zp1.cur + point,\n                                 CUR.zp0.cur + CUR.GS.rp0 );\n\n    CUR_Func_move( &CUR.zp1, point, distance - org_dist );\n\n  Fail:\n    CUR.GS.rp1 = CUR.GS.rp0;\n    CUR.GS.rp2 = point;\n\n    if ( ( CUR.opcode & 16 ) != 0 )\n      CUR.GS.rp0 = point;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* MIRP[abcde]:  Move Indirect Relative Point                            */\n  /* Opcode range: 0xE0-0xFF                                               */\n  /* Stack:        int32? uint32 -->                                       */\n  /*                                                                       */\n  static void\n  Ins_MIRP( INS_ARG )\n  {\n    FT_UShort   point;\n    FT_ULong    cvtEntry;\n\n    FT_F26Dot6  cvt_dist,\n                distance,\n                cur_dist,\n                org_dist,\n                control_value_cutin,\n                minimum_distance;\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    FT_Int      B1           = 0; /* pacify compiler */\n    FT_Int      B2           = 0;\n    FT_Bool     reverse_move = FALSE;\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n\n    minimum_distance    = CUR.GS.minimum_distance;\n    control_value_cutin = CUR.GS.control_value_cutin;\n    point               = (FT_UShort)args[0];\n    cvtEntry            = (FT_ULong)( args[1] + 1 );\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    if ( SUBPIXEL_HINTING                                  &&\n         CUR.ignore_x_mode                                 &&\n         CUR.GS.freeVector.x != 0                          &&\n         !( CUR.sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )\n      control_value_cutin = minimum_distance = 0;\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n    /* XXX: UNDOCUMENTED! cvt[-1] = 0 always */\n\n    if ( BOUNDS( point,      CUR.zp1.n_points ) ||\n         BOUNDSL( cvtEntry,  CUR.cvtSize + 1 )  ||\n         BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      goto Fail;\n    }\n\n    if ( !cvtEntry )\n      cvt_dist = 0;\n    else\n      cvt_dist = CUR_Func_read_cvt( cvtEntry - 1 );\n\n    /* single width test */\n\n    if ( FT_ABS( cvt_dist - CUR.GS.single_width_value ) <\n         CUR.GS.single_width_cutin )\n    {\n      if ( cvt_dist >= 0 )\n        cvt_dist =  CUR.GS.single_width_value;\n      else\n        cvt_dist = -CUR.GS.single_width_value;\n    }\n\n    /* UNDOCUMENTED!  The MS rasterizer does that with */\n    /* twilight points (confirmed by Greg Hitchcock)   */\n    if ( CUR.GS.gep1 == 0 )\n    {\n      CUR.zp1.org[point].x = CUR.zp0.org[CUR.GS.rp0].x +\n                             TT_MulFix14( (FT_UInt32)cvt_dist,\n                                          CUR.GS.freeVector.x );\n      CUR.zp1.org[point].y = CUR.zp0.org[CUR.GS.rp0].y +\n                             TT_MulFix14( (FT_UInt32)cvt_dist,\n                                          CUR.GS.freeVector.y );\n      CUR.zp1.cur[point]   = CUR.zp1.org[point];\n    }\n\n    org_dist = CUR_Func_dualproj( &CUR.zp1.org[point],\n                                  &CUR.zp0.org[CUR.GS.rp0] );\n    cur_dist = CUR_Func_project ( &CUR.zp1.cur[point],\n                                  &CUR.zp0.cur[CUR.GS.rp0] );\n\n    /* auto-flip test */\n\n    if ( CUR.GS.auto_flip )\n    {\n      if ( ( org_dist ^ cvt_dist ) < 0 )\n        cvt_dist = -cvt_dist;\n    }\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    if ( SUBPIXEL_HINTING                                         &&\n         CUR.ignore_x_mode                                        &&\n         CUR.GS.freeVector.y != 0                                 &&\n         ( CUR.sph_tweak_flags & SPH_TWEAK_TIMES_NEW_ROMAN_HACK ) )\n    {\n      if ( cur_dist < -64 )\n        cvt_dist -= 16;\n      else if ( cur_dist > 64 && cur_dist < 84 )\n        cvt_dist += 32;\n    }\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n    /* control value cut-in and round */\n\n    if ( ( CUR.opcode & 4 ) != 0 )\n    {\n      /* XXX: UNDOCUMENTED!  Only perform cut-in test when both points */\n      /*      refer to the same zone.                                  */\n\n      if ( CUR.GS.gep0 == CUR.GS.gep1 )\n      {\n        /* XXX: According to Greg Hitchcock, the following wording is */\n        /*      the right one:                                        */\n        /*                                                            */\n        /*        When the absolute difference between the value in   */\n        /*        the table [CVT] and the measurement directly from   */\n        /*        the outline is _greater_ than the cut_in value, the */\n        /*        outline measurement is used.                        */\n        /*                                                            */\n        /*      This is from `instgly.doc'.  The description in       */\n        /*      `ttinst2.doc', version 1.66, is thus incorrect since  */\n        /*      it implies `>=' instead of `>'.                       */\n\n        if ( FT_ABS( cvt_dist - org_dist ) > control_value_cutin )\n          cvt_dist = org_dist;\n      }\n\n      distance = CUR_Func_round(\n                   cvt_dist,\n                   CUR.tt_metrics.compensations[CUR.opcode & 3] );\n    }\n    else\n    {\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n      /* do cvt cut-in always in MIRP for sph */\n      if ( SUBPIXEL_HINTING           &&\n           CUR.ignore_x_mode          &&\n           CUR.GS.gep0 == CUR.GS.gep1 )\n      {\n        if ( FT_ABS( cvt_dist - org_dist ) > control_value_cutin )\n          cvt_dist = org_dist;\n      }\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n      distance = ROUND_None(\n                   cvt_dist,\n                   CUR.tt_metrics.compensations[CUR.opcode & 3] );\n    }\n\n    /* minimum distance test */\n\n    if ( ( CUR.opcode & 8 ) != 0 )\n    {\n      if ( org_dist >= 0 )\n      {\n        if ( distance < minimum_distance )\n          distance = minimum_distance;\n      }\n      else\n      {\n        if ( distance > -minimum_distance )\n          distance = -minimum_distance;\n      }\n    }\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    if ( SUBPIXEL_HINTING )\n    {\n      B1 = CUR.zp1.cur[point].y;\n\n      /* Round moves if necessary */\n      if ( CUR.ignore_x_mode                                          &&\n           CUR.GS.freeVector.y != 0                                   &&\n           ( CUR.sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES ) )\n        distance = FT_PIX_ROUND( B1 + distance - cur_dist ) - B1 + cur_dist;\n\n      if ( CUR.ignore_x_mode                                      &&\n           CUR.GS.freeVector.y != 0                               &&\n           ( CUR.opcode & 16 ) == 0                               &&\n           ( CUR.opcode & 8 ) == 0                                &&\n           ( CUR.sph_tweak_flags & SPH_TWEAK_COURIER_NEW_2_HACK ) )\n        distance += 64;\n    }\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n    CUR_Func_move( &CUR.zp1, point, distance - cur_dist );\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    if ( SUBPIXEL_HINTING )\n    {\n      B2 = CUR.zp1.cur[point].y;\n\n      /* Reverse move if necessary */\n      if ( CUR.ignore_x_mode )\n      {\n        if ( CUR.face->sph_compatibility_mode                          &&\n             CUR.GS.freeVector.y != 0                                  &&\n             ( B1 & 63 ) == 0                                          &&\n             ( B2 & 63 ) != 0                                          )\n          reverse_move = TRUE;\n\n        if ( ( CUR.sph_tweak_flags & SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES ) &&\n             CUR.GS.freeVector.y != 0                                  &&\n             ( B2 & 63 ) != 0                                          &&\n             ( B1 & 63 ) != 0                                          )\n          reverse_move = TRUE;\n      }\n\n      if ( reverse_move )\n        CUR_Func_move( &CUR.zp1, point, -( distance - cur_dist ) );\n    }\n\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n  Fail:\n    CUR.GS.rp1 = CUR.GS.rp0;\n\n    if ( ( CUR.opcode & 16 ) != 0 )\n      CUR.GS.rp0 = point;\n\n    CUR.GS.rp2 = point;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* ALIGNRP[]:    ALIGN Relative Point                                    */\n  /* Opcode range: 0x3C                                                    */\n  /* Stack:        uint32 uint32... -->                                    */\n  /*                                                                       */\n  static void\n  Ins_ALIGNRP( INS_ARG )\n  {\n    FT_UShort   point;\n    FT_F26Dot6  distance;\n\n    FT_UNUSED_ARG;\n\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    if ( SUBPIXEL_HINTING                                         &&\n         CUR.ignore_x_mode                                        &&\n         CUR.iup_called                                           &&\n         ( CUR.sph_tweak_flags & SPH_TWEAK_NO_ALIGNRP_AFTER_IUP ) )\n    {\n      CUR.error = FT_THROW( Invalid_Reference );\n      goto Fail;\n    }\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n    if ( CUR.top < CUR.GS.loop ||\n         BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      goto Fail;\n    }\n\n    while ( CUR.GS.loop > 0 )\n    {\n      CUR.args--;\n\n      point = (FT_UShort)CUR.stack[CUR.args];\n\n      if ( BOUNDS( point, CUR.zp1.n_points ) )\n      {\n        if ( CUR.pedantic_hinting )\n        {\n          CUR.error = FT_THROW( Invalid_Reference );\n          return;\n        }\n      }\n      else\n      {\n        distance = CUR_Func_project( CUR.zp1.cur + point,\n                                     CUR.zp0.cur + CUR.GS.rp0 );\n\n        CUR_Func_move( &CUR.zp1, point, -distance );\n      }\n\n      CUR.GS.loop--;\n    }\n\n  Fail:\n    CUR.GS.loop = 1;\n    CUR.new_top = CUR.args;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* ISECT[]:      moves point to InterSECTion                             */\n  /* Opcode range: 0x0F                                                    */\n  /* Stack:        5 * uint32 -->                                          */\n  /*                                                                       */\n  static void\n  Ins_ISECT( INS_ARG )\n  {\n    FT_UShort   point,\n                a0, a1,\n                b0, b1;\n\n    FT_F26Dot6  discriminant, dotproduct;\n\n    FT_F26Dot6  dx,  dy,\n                dax, day,\n                dbx, dby;\n\n    FT_F26Dot6  val;\n\n    FT_Vector   R;\n\n\n    point = (FT_UShort)args[0];\n\n    a0 = (FT_UShort)args[1];\n    a1 = (FT_UShort)args[2];\n    b0 = (FT_UShort)args[3];\n    b1 = (FT_UShort)args[4];\n\n    if ( BOUNDS( b0, CUR.zp0.n_points )  ||\n         BOUNDS( b1, CUR.zp0.n_points )  ||\n         BOUNDS( a0, CUR.zp1.n_points )  ||\n         BOUNDS( a1, CUR.zp1.n_points )  ||\n         BOUNDS( point, CUR.zp2.n_points ) )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      return;\n    }\n\n    /* Cramer's rule */\n\n    dbx = CUR.zp0.cur[b1].x - CUR.zp0.cur[b0].x;\n    dby = CUR.zp0.cur[b1].y - CUR.zp0.cur[b0].y;\n\n    dax = CUR.zp1.cur[a1].x - CUR.zp1.cur[a0].x;\n    day = CUR.zp1.cur[a1].y - CUR.zp1.cur[a0].y;\n\n    dx = CUR.zp0.cur[b0].x - CUR.zp1.cur[a0].x;\n    dy = CUR.zp0.cur[b0].y - CUR.zp1.cur[a0].y;\n\n    CUR.zp2.tags[point] |= FT_CURVE_TAG_TOUCH_BOTH;\n\n    discriminant = FT_MulDiv( dax, -dby, 0x40 ) +\n                   FT_MulDiv( day, dbx, 0x40 );\n    dotproduct   = FT_MulDiv( dax, dbx, 0x40 ) +\n                   FT_MulDiv( day, dby, 0x40 );\n\n    /* The discriminant above is actually a cross product of vectors     */\n    /* da and db. Together with the dot product, they can be used as     */\n    /* surrogates for sine and cosine of the angle between the vectors.  */\n    /* Indeed,                                                           */\n    /*       dotproduct   = |da||db|cos(angle)                           */\n    /*       discriminant = |da||db|sin(angle)     .                     */\n    /* We use these equations to reject grazing intersections by         */\n    /* thresholding abs(tan(angle)) at 1/19, corresponding to 3 degrees. */\n    if ( 19 * FT_ABS( discriminant ) > FT_ABS( dotproduct ) )\n    {\n      val = FT_MulDiv( dx, -dby, 0x40 ) + FT_MulDiv( dy, dbx, 0x40 );\n\n      R.x = FT_MulDiv( val, dax, discriminant );\n      R.y = FT_MulDiv( val, day, discriminant );\n\n      CUR.zp2.cur[point].x = CUR.zp1.cur[a0].x + R.x;\n      CUR.zp2.cur[point].y = CUR.zp1.cur[a0].y + R.y;\n    }\n    else\n    {\n      /* else, take the middle of the middles of A and B */\n\n      CUR.zp2.cur[point].x = ( CUR.zp1.cur[a0].x +\n                               CUR.zp1.cur[a1].x +\n                               CUR.zp0.cur[b0].x +\n                               CUR.zp0.cur[b1].x ) / 4;\n      CUR.zp2.cur[point].y = ( CUR.zp1.cur[a0].y +\n                               CUR.zp1.cur[a1].y +\n                               CUR.zp0.cur[b0].y +\n                               CUR.zp0.cur[b1].y ) / 4;\n    }\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* ALIGNPTS[]:   ALIGN PoinTS                                            */\n  /* Opcode range: 0x27                                                    */\n  /* Stack:        uint32 uint32 -->                                       */\n  /*                                                                       */\n  static void\n  Ins_ALIGNPTS( INS_ARG )\n  {\n    FT_UShort   p1, p2;\n    FT_F26Dot6  distance;\n\n\n    p1 = (FT_UShort)args[0];\n    p2 = (FT_UShort)args[1];\n\n    if ( BOUNDS( p1, CUR.zp1.n_points ) ||\n         BOUNDS( p2, CUR.zp0.n_points ) )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      return;\n    }\n\n    distance = CUR_Func_project( CUR.zp0.cur + p2,\n                                 CUR.zp1.cur + p1 ) / 2;\n\n    CUR_Func_move( &CUR.zp1, p1, distance );\n    CUR_Func_move( &CUR.zp0, p2, -distance );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* IP[]:         Interpolate Point                                       */\n  /* Opcode range: 0x39                                                    */\n  /* Stack:        uint32... -->                                           */\n  /*                                                                       */\n\n  /* SOMETIMES, DUMBER CODE IS BETTER CODE */\n\n  static void\n  Ins_IP( INS_ARG )\n  {\n    FT_F26Dot6  old_range, cur_range;\n    FT_Vector*  orus_base;\n    FT_Vector*  cur_base;\n    FT_Int      twilight;\n\n    FT_UNUSED_ARG;\n\n\n    if ( CUR.top < CUR.GS.loop )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      goto Fail;\n    }\n\n    /*\n     * We need to deal in a special way with the twilight zone.\n     * Otherwise, by definition, the value of CUR.twilight.orus[n] is (0,0),\n     * for every n.\n     */\n    twilight = CUR.GS.gep0 == 0 || CUR.GS.gep1 == 0 || CUR.GS.gep2 == 0;\n\n    if ( BOUNDS( CUR.GS.rp1, CUR.zp0.n_points ) )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      goto Fail;\n    }\n\n    if ( twilight )\n      orus_base = &CUR.zp0.org[CUR.GS.rp1];\n    else\n      orus_base = &CUR.zp0.orus[CUR.GS.rp1];\n\n    cur_base = &CUR.zp0.cur[CUR.GS.rp1];\n\n    /* XXX: There are some glyphs in some braindead but popular */\n    /*      fonts out there (e.g. [aeu]grave in monotype.ttf)   */\n    /*      calling IP[] with bad values of rp[12].             */\n    /*      Do something sane when this odd thing happens.      */\n    if ( BOUNDS( CUR.GS.rp1, CUR.zp0.n_points ) ||\n         BOUNDS( CUR.GS.rp2, CUR.zp1.n_points ) )\n    {\n      old_range = 0;\n      cur_range = 0;\n    }\n    else\n    {\n      if ( twilight )\n        old_range = CUR_Func_dualproj( &CUR.zp1.org[CUR.GS.rp2],\n                                       orus_base );\n      else if ( CUR.metrics.x_scale == CUR.metrics.y_scale )\n        old_range = CUR_Func_dualproj( &CUR.zp1.orus[CUR.GS.rp2],\n                                       orus_base );\n      else\n      {\n        FT_Vector  vec;\n\n\n        vec.x = FT_MulFix( CUR.zp1.orus[CUR.GS.rp2].x - orus_base->x,\n                           CUR.metrics.x_scale );\n        vec.y = FT_MulFix( CUR.zp1.orus[CUR.GS.rp2].y - orus_base->y,\n                           CUR.metrics.y_scale );\n\n        old_range = CUR_fast_dualproj( &vec );\n      }\n\n      cur_range = CUR_Func_project ( &CUR.zp1.cur[CUR.GS.rp2], cur_base );\n    }\n\n    for ( ; CUR.GS.loop > 0; --CUR.GS.loop )\n    {\n      FT_UInt     point = (FT_UInt)CUR.stack[--CUR.args];\n      FT_F26Dot6  org_dist, cur_dist, new_dist;\n\n\n      /* check point bounds */\n      if ( BOUNDS( point, CUR.zp2.n_points ) )\n      {\n        if ( CUR.pedantic_hinting )\n        {\n          CUR.error = FT_THROW( Invalid_Reference );\n          return;\n        }\n        continue;\n      }\n\n      if ( twilight )\n        org_dist = CUR_Func_dualproj( &CUR.zp2.org[point], orus_base );\n      else if ( CUR.metrics.x_scale == CUR.metrics.y_scale )\n        org_dist = CUR_Func_dualproj( &CUR.zp2.orus[point], orus_base );\n      else\n      {\n        FT_Vector  vec;\n\n\n        vec.x = FT_MulFix( CUR.zp2.orus[point].x - orus_base->x,\n                           CUR.metrics.x_scale );\n        vec.y = FT_MulFix( CUR.zp2.orus[point].y - orus_base->y,\n                           CUR.metrics.y_scale );\n\n        org_dist = CUR_fast_dualproj( &vec );\n      }\n\n      cur_dist = CUR_Func_project( &CUR.zp2.cur[point], cur_base );\n\n      if ( org_dist )\n      {\n        if ( old_range )\n          new_dist = FT_MulDiv( org_dist, cur_range, old_range );\n        else\n        {\n          /* This is the same as what MS does for the invalid case:  */\n          /*                                                         */\n          /*   delta = (Original_Pt - Original_RP1) -                */\n          /*           (Current_Pt - Current_RP1)         ;          */\n          /*                                                         */\n          /* In FreeType speak:                                      */\n          /*                                                         */\n          /*   delta = org_dist - cur_dist          .                */\n          /*                                                         */\n          /* We move `point' by `new_dist - cur_dist' after leaving  */\n          /* this block, thus we have                                */\n          /*                                                         */\n          /*   new_dist - cur_dist = delta                   ,       */\n          /*   new_dist - cur_dist = org_dist - cur_dist     ,       */\n          /*              new_dist = org_dist                .       */\n\n          new_dist = org_dist;\n        }\n      }\n      else\n        new_dist = 0;\n\n      CUR_Func_move( &CUR.zp2, (FT_UShort)point, new_dist - cur_dist );\n    }\n\n  Fail:\n    CUR.GS.loop = 1;\n    CUR.new_top = CUR.args;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* UTP[a]:       UnTouch Point                                           */\n  /* Opcode range: 0x29                                                    */\n  /* Stack:        uint32 -->                                              */\n  /*                                                                       */\n  static void\n  Ins_UTP( INS_ARG )\n  {\n    FT_UShort  point;\n    FT_Byte    mask;\n\n\n    point = (FT_UShort)args[0];\n\n    if ( BOUNDS( point, CUR.zp0.n_points ) )\n    {\n      if ( CUR.pedantic_hinting )\n        CUR.error = FT_THROW( Invalid_Reference );\n      return;\n    }\n\n    mask = 0xFF;\n\n    if ( CUR.GS.freeVector.x != 0 )\n      mask &= ~FT_CURVE_TAG_TOUCH_X;\n\n    if ( CUR.GS.freeVector.y != 0 )\n      mask &= ~FT_CURVE_TAG_TOUCH_Y;\n\n    CUR.zp0.tags[point] &= mask;\n  }\n\n\n  /* Local variables for Ins_IUP: */\n  typedef struct  IUP_WorkerRec_\n  {\n    FT_Vector*  orgs;   /* original and current coordinate */\n    FT_Vector*  curs;   /* arrays                          */\n    FT_Vector*  orus;\n    FT_UInt     max_points;\n\n  } IUP_WorkerRec, *IUP_Worker;\n\n\n  static void\n  _iup_worker_shift( IUP_Worker  worker,\n                     FT_UInt     p1,\n                     FT_UInt     p2,\n                     FT_UInt     p )\n  {\n    FT_UInt     i;\n    FT_F26Dot6  dx;\n\n\n    dx = worker->curs[p].x - worker->orgs[p].x;\n    if ( dx != 0 )\n    {\n      for ( i = p1; i < p; i++ )\n        worker->curs[i].x += dx;\n\n      for ( i = p + 1; i <= p2; i++ )\n        worker->curs[i].x += dx;\n    }\n  }\n\n\n  static void\n  _iup_worker_interpolate( IUP_Worker  worker,\n                           FT_UInt     p1,\n                           FT_UInt     p2,\n                           FT_UInt     ref1,\n                           FT_UInt     ref2 )\n  {\n    FT_UInt     i;\n    FT_F26Dot6  orus1, orus2, org1, org2, delta1, delta2;\n\n\n    if ( p1 > p2 )\n      return;\n\n    if ( BOUNDS( ref1, worker->max_points ) ||\n         BOUNDS( ref2, worker->max_points ) )\n      return;\n\n    orus1 = worker->orus[ref1].x;\n    orus2 = worker->orus[ref2].x;\n\n    if ( orus1 > orus2 )\n    {\n      FT_F26Dot6  tmp_o;\n      FT_UInt     tmp_r;\n\n\n      tmp_o = orus1;\n      orus1 = orus2;\n      orus2 = tmp_o;\n\n      tmp_r = ref1;\n      ref1  = ref2;\n      ref2  = tmp_r;\n    }\n\n    org1   = worker->orgs[ref1].x;\n    org2   = worker->orgs[ref2].x;\n    delta1 = worker->curs[ref1].x - org1;\n    delta2 = worker->curs[ref2].x - org2;\n\n    if ( orus1 == orus2 )\n    {\n      /* simple shift of untouched points */\n      for ( i = p1; i <= p2; i++ )\n      {\n        FT_F26Dot6  x = worker->orgs[i].x;\n\n\n        if ( x <= org1 )\n          x += delta1;\n        else\n          x += delta2;\n\n        worker->curs[i].x = x;\n      }\n    }\n    else\n    {\n      FT_Fixed  scale       = 0;\n      FT_Bool   scale_valid = 0;\n\n\n      /* interpolation */\n      for ( i = p1; i <= p2; i++ )\n      {\n        FT_F26Dot6  x = worker->orgs[i].x;\n\n\n        if ( x <= org1 )\n          x += delta1;\n\n        else if ( x >= org2 )\n          x += delta2;\n\n        else\n        {\n          if ( !scale_valid )\n          {\n            scale_valid = 1;\n            scale       = FT_DivFix( org2 + delta2 - ( org1 + delta1 ),\n                                     orus2 - orus1 );\n          }\n\n          x = ( org1 + delta1 ) +\n              FT_MulFix( worker->orus[i].x - orus1, scale );\n        }\n        worker->curs[i].x = x;\n      }\n    }\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* IUP[a]:       Interpolate Untouched Points                            */\n  /* Opcode range: 0x30-0x31                                               */\n  /* Stack:        -->                                                     */\n  /*                                                                       */\n  static void\n  Ins_IUP( INS_ARG )\n  {\n    IUP_WorkerRec  V;\n    FT_Byte        mask;\n\n    FT_UInt   first_point;   /* first point of contour        */\n    FT_UInt   end_point;     /* end point (last+1) of contour */\n\n    FT_UInt   first_touched; /* first touched point in contour   */\n    FT_UInt   cur_touched;   /* current touched point in contour */\n\n    FT_UInt   point;         /* current point   */\n    FT_Short  contour;       /* current contour */\n\n    FT_UNUSED_ARG;\n\n\n    /* ignore empty outlines */\n    if ( CUR.pts.n_contours == 0 )\n      return;\n\n    if ( CUR.opcode & 1 )\n    {\n      mask   = FT_CURVE_TAG_TOUCH_X;\n      V.orgs = CUR.pts.org;\n      V.curs = CUR.pts.cur;\n      V.orus = CUR.pts.orus;\n    }\n    else\n    {\n      mask   = FT_CURVE_TAG_TOUCH_Y;\n      V.orgs = (FT_Vector*)( (FT_Pos*)CUR.pts.org + 1 );\n      V.curs = (FT_Vector*)( (FT_Pos*)CUR.pts.cur + 1 );\n      V.orus = (FT_Vector*)( (FT_Pos*)CUR.pts.orus + 1 );\n    }\n    V.max_points = CUR.pts.n_points;\n\n    contour = 0;\n    point   = 0;\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    if ( SUBPIXEL_HINTING  &&\n         CUR.ignore_x_mode )\n    {\n      CUR.iup_called = TRUE;\n      if ( CUR.sph_tweak_flags & SPH_TWEAK_SKIP_IUP )\n        return;\n    }\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n    do\n    {\n      end_point   = CUR.pts.contours[contour] - CUR.pts.first_point;\n      first_point = point;\n\n      if ( BOUNDS ( end_point, CUR.pts.n_points ) )\n        end_point = CUR.pts.n_points - 1;\n\n      while ( point <= end_point && ( CUR.pts.tags[point] & mask ) == 0 )\n        point++;\n\n      if ( point <= end_point )\n      {\n        first_touched = point;\n        cur_touched   = point;\n\n        point++;\n\n        while ( point <= end_point )\n        {\n          if ( ( CUR.pts.tags[point] & mask ) != 0 )\n          {\n            _iup_worker_interpolate( &V,\n                                     cur_touched + 1,\n                                     point - 1,\n                                     cur_touched,\n                                     point );\n            cur_touched = point;\n          }\n\n          point++;\n        }\n\n        if ( cur_touched == first_touched )\n          _iup_worker_shift( &V, first_point, end_point, cur_touched );\n        else\n        {\n          _iup_worker_interpolate( &V,\n                                   (FT_UShort)( cur_touched + 1 ),\n                                   end_point,\n                                   cur_touched,\n                                   first_touched );\n\n          if ( first_touched > 0 )\n            _iup_worker_interpolate( &V,\n                                     first_point,\n                                     first_touched - 1,\n                                     cur_touched,\n                                     first_touched );\n        }\n      }\n      contour++;\n    } while ( contour < CUR.pts.n_contours );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* DELTAPn[]:    DELTA exceptions P1, P2, P3                             */\n  /* Opcode range: 0x5D,0x71,0x72                                          */\n  /* Stack:        uint32 (2 * uint32)... -->                              */\n  /*                                                                       */\n  static void\n  Ins_DELTAP( INS_ARG )\n  {\n    FT_ULong   nump, k;\n    FT_UShort  A;\n    FT_ULong   C, P;\n    FT_Long    B;\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    FT_UShort  B1, B2;\n\n\n    if ( SUBPIXEL_HINTING                                        &&\n         CUR.ignore_x_mode                                       &&\n         CUR.iup_called                                          &&\n         ( CUR.sph_tweak_flags & SPH_TWEAK_NO_DELTAP_AFTER_IUP ) )\n      goto Fail;\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n    /* Delta hinting is covered by US Patent 5159668. */\n    if ( CUR.face->unpatented_hinting )\n    {\n      FT_Long  n = args[0] * 2;\n\n\n      if ( CUR.args < n )\n      {\n        if ( CUR.pedantic_hinting )\n          CUR.error = FT_THROW( Too_Few_Arguments );\n        n = CUR.args;\n      }\n\n      CUR.args -= n;\n      CUR.new_top = CUR.args;\n      return;\n    }\n#endif\n\n    P = (FT_ULong)CUR_Func_cur_ppem();\n    nump = (FT_ULong)args[0];   /* some points theoretically may occur more\n                                   than once, thus UShort isn't enough */\n\n    for ( k = 1; k <= nump; k++ )\n    {\n      if ( CUR.args < 2 )\n      {\n        if ( CUR.pedantic_hinting )\n          CUR.error = FT_THROW( Too_Few_Arguments );\n        CUR.args = 0;\n        goto Fail;\n      }\n\n      CUR.args -= 2;\n\n      A = (FT_UShort)CUR.stack[CUR.args + 1];\n      B = CUR.stack[CUR.args];\n\n      /* XXX: Because some popular fonts contain some invalid DeltaP */\n      /*      instructions, we simply ignore them when the stacked   */\n      /*      point reference is off limit, rather than returning an */\n      /*      error.  As a delta instruction doesn't change a glyph  */\n      /*      in great ways, this shouldn't be a problem.            */\n\n      if ( !BOUNDS( A, CUR.zp0.n_points ) )\n      {\n        C = ( (FT_ULong)B & 0xF0 ) >> 4;\n\n        switch ( CUR.opcode )\n        {\n        case 0x5D:\n          break;\n\n        case 0x71:\n          C += 16;\n          break;\n\n        case 0x72:\n          C += 32;\n          break;\n        }\n\n        C += CUR.GS.delta_base;\n\n        if ( P == C )\n        {\n          B = ( (FT_ULong)B & 0xF ) - 8;\n          if ( B >= 0 )\n            B++;\n          B *= 1L << ( 6 - CUR.GS.delta_shift );\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n\n          if ( SUBPIXEL_HINTING )\n          {\n            /*\n             *  Allow delta move if\n             *\n             *  - not using ignore_x_mode rendering,\n             *  - glyph is specifically set to allow it, or\n             *  - glyph is composite and freedom vector is not in subpixel\n             *    direction.\n             */\n            if ( !CUR.ignore_x_mode                                   ||\n                 ( CUR.sph_tweak_flags & SPH_TWEAK_ALWAYS_DO_DELTAP ) ||\n                 ( CUR.is_composite && CUR.GS.freeVector.y != 0 )     )\n              CUR_Func_move( &CUR.zp0, A, B );\n\n            /* Otherwise, apply subpixel hinting and compatibility mode */\n            /* rules, always skipping deltas in subpixel direction.     */\n            else if ( CUR.ignore_x_mode && CUR.GS.freeVector.y != 0 )\n            {\n              /* save the y value of the point now; compare after move */\n              B1 = (FT_UShort)CUR.zp0.cur[A].y;\n\n              /* Standard subpixel hinting: Allow y move for y-touched */\n              /* points.  This messes up DejaVu ...                    */\n              if ( !CUR.face->sph_compatibility_mode          &&\n                   ( CUR.zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) )\n                CUR_Func_move( &CUR.zp0, A, B );\n\n              /* compatibility mode */\n              else if ( CUR.face->sph_compatibility_mode                      &&\n                        !( CUR.sph_tweak_flags & SPH_TWEAK_ALWAYS_SKIP_DELTAP ) )\n              {\n                if ( CUR.sph_tweak_flags & SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES )\n                  B = FT_PIX_ROUND( B1 + B ) - B1;\n\n                /* Allow delta move if using sph_compatibility_mode,   */\n                /* IUP has not been called, and point is touched on Y. */\n                if ( !CUR.iup_called                            &&\n                     ( CUR.zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) )\n                  CUR_Func_move( &CUR.zp0, A, B );\n              }\n\n              B2 = (FT_UShort)CUR.zp0.cur[A].y;\n\n              /* Reverse this move if it results in a disallowed move */\n              if ( CUR.GS.freeVector.y != 0                           &&\n                   ( ( CUR.face->sph_compatibility_mode           &&\n                       ( B1 & 63 ) == 0                           &&\n                       ( B2 & 63 ) != 0                           ) ||\n                     ( ( CUR.sph_tweak_flags                    &\n                         SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES_DELTAP ) &&\n                       ( B1 & 63 ) != 0                           &&\n                       ( B2 & 63 ) != 0                           ) ) )\n                CUR_Func_move( &CUR.zp0, A, -B );\n            }\n          }\n          else\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n            CUR_Func_move( &CUR.zp0, A, B );\n        }\n      }\n      else\n        if ( CUR.pedantic_hinting )\n          CUR.error = FT_THROW( Invalid_Reference );\n    }\n\n  Fail:\n    CUR.new_top = CUR.args;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* DELTACn[]:    DELTA exceptions C1, C2, C3                             */\n  /* Opcode range: 0x73,0x74,0x75                                          */\n  /* Stack:        uint32 (2 * uint32)... -->                              */\n  /*                                                                       */\n  static void\n  Ins_DELTAC( INS_ARG )\n  {\n    FT_ULong  nump, k;\n    FT_ULong  A, C, P;\n    FT_Long   B;\n\n\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n    /* Delta hinting is covered by US Patent 5159668. */\n    if ( CUR.face->unpatented_hinting )\n    {\n      FT_Long  n = args[0] * 2;\n\n\n      if ( CUR.args < n )\n      {\n        if ( CUR.pedantic_hinting )\n          CUR.error = FT_THROW( Too_Few_Arguments );\n        n = CUR.args;\n      }\n\n      CUR.args -= n;\n      CUR.new_top = CUR.args;\n      return;\n    }\n#endif\n\n    P    = (FT_ULong)CUR_Func_cur_ppem();\n    nump = (FT_ULong)args[0];\n\n    for ( k = 1; k <= nump; k++ )\n    {\n      if ( CUR.args < 2 )\n      {\n        if ( CUR.pedantic_hinting )\n          CUR.error = FT_THROW( Too_Few_Arguments );\n        CUR.args = 0;\n        goto Fail;\n      }\n\n      CUR.args -= 2;\n\n      A = (FT_ULong)CUR.stack[CUR.args + 1];\n      B = CUR.stack[CUR.args];\n\n      if ( BOUNDSL( A, CUR.cvtSize ) )\n      {\n        if ( CUR.pedantic_hinting )\n        {\n          CUR.error = FT_THROW( Invalid_Reference );\n          return;\n        }\n      }\n      else\n      {\n        C = ( (FT_ULong)B & 0xF0 ) >> 4;\n\n        switch ( CUR.opcode )\n        {\n        case 0x73:\n          break;\n\n        case 0x74:\n          C += 16;\n          break;\n\n        case 0x75:\n          C += 32;\n          break;\n        }\n\n        C += CUR.GS.delta_base;\n\n        if ( P == C )\n        {\n          B = ( (FT_ULong)B & 0xF ) - 8;\n          if ( B >= 0 )\n            B++;\n          B *= 1L << ( 6 - CUR.GS.delta_shift );\n\n          CUR_Func_move_cvt( A, B );\n        }\n      }\n    }\n\n  Fail:\n    CUR.new_top = CUR.args;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* MISC. INSTRUCTIONS                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* GETINFO[]:    GET INFOrmation                                         */\n  /* Opcode range: 0x88                                                    */\n  /* Stack:        uint32 --> uint32                                       */\n  /*                                                                       */\n  static void\n  Ins_GETINFO( INS_ARG )\n  {\n    FT_Long  K;\n\n\n    K = 0;\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    /********************************/\n    /* RASTERIZER VERSION           */\n    /* Selector Bit:  0             */\n    /* Return Bit(s): 0-7           */\n    /*                              */\n    if ( SUBPIXEL_HINTING     &&\n         ( args[0] & 1 ) != 0 &&\n         CUR.ignore_x_mode    )\n    {\n      K = CUR.rasterizer_version;\n      FT_TRACE7(( \"Setting rasterizer version %d\\n\",\n                  CUR.rasterizer_version ));\n    }\n    else\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n      if ( ( args[0] & 1 ) != 0 )\n        K = TT_INTERPRETER_VERSION_35;\n\n    /********************************/\n    /* GLYPH ROTATED                */\n    /* Selector Bit:  1             */\n    /* Return Bit(s): 8             */\n    /*                              */\n    if ( ( args[0] & 2 ) != 0 && CUR.tt_metrics.rotated )\n      K |= 0x80;\n\n    /********************************/\n    /* GLYPH STRETCHED              */\n    /* Selector Bit:  2             */\n    /* Return Bit(s): 9             */\n    /*                              */\n    if ( ( args[0] & 4 ) != 0 && CUR.tt_metrics.stretched )\n      K |= 1 << 8;\n\n    /********************************/\n    /* HINTING FOR GRAYSCALE        */\n    /* Selector Bit:  5             */\n    /* Return Bit(s): 12            */\n    /*                              */\n    if ( ( args[0] & 32 ) != 0 && CUR.grayscale )\n      K |= 1 << 12;\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n\n    if ( SUBPIXEL_HINTING                                    &&\n         CUR.ignore_x_mode                                   &&\n         CUR.rasterizer_version >= TT_INTERPRETER_VERSION_35 )\n    {\n\n      if ( CUR.rasterizer_version >= 37 )\n      {\n        /********************************/\n        /* HINTING FOR SUBPIXEL         */\n        /* Selector Bit:  6             */\n        /* Return Bit(s): 13            */\n        /*                              */\n        if ( ( args[0] & 64 ) != 0 && CUR.subpixel )\n          K |= 1 << 13;\n\n        /********************************/\n        /* COMPATIBLE WIDTHS ENABLED    */\n        /* Selector Bit:  7             */\n        /* Return Bit(s): 14            */\n        /*                              */\n        /* Functionality still needs to be added */\n        if ( ( args[0] & 128 ) != 0 && CUR.compatible_widths )\n          K |= 1 << 14;\n\n        /********************************/\n        /* SYMMETRICAL SMOOTHING        */\n        /* Selector Bit:  8             */\n        /* Return Bit(s): 15            */\n        /*                              */\n        /* Functionality still needs to be added */\n        if ( ( args[0] & 256 ) != 0 && CUR.symmetrical_smoothing )\n          K |= 1 << 15;\n\n        /********************************/\n        /* HINTING FOR BGR?             */\n        /* Selector Bit:  9             */\n        /* Return Bit(s): 16            */\n        /*                              */\n        /* Functionality still needs to be added */\n        if ( ( args[0] & 512 ) != 0 && CUR.bgr )\n          K |= 1 << 16;\n\n        if ( CUR.rasterizer_version >= 38 )\n        {\n          /********************************/\n          /* SUBPIXEL POSITIONED?         */\n          /* Selector Bit:  10            */\n          /* Return Bit(s): 17            */\n          /*                              */\n          /* Functionality still needs to be added */\n          if ( ( args[0] & 1024 ) != 0 && CUR.subpixel_positioned )\n            K |= 1 << 17;\n        }\n      }\n    }\n\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n    args[0] = K;\n  }\n\n\n  static void\n  Ins_UNKNOWN( INS_ARG )\n  {\n    TT_DefRecord*  def   = CUR.IDefs;\n    TT_DefRecord*  limit = def + CUR.numIDefs;\n\n    FT_UNUSED_ARG;\n\n\n    for ( ; def < limit; def++ )\n    {\n      if ( (FT_Byte)def->opc == CUR.opcode && def->active )\n      {\n        TT_CallRec*  call;\n\n\n        if ( CUR.callTop >= CUR.callSize )\n        {\n          CUR.error = FT_THROW( Stack_Overflow );\n          return;\n        }\n\n        call = CUR.callStack + CUR.callTop++;\n\n        call->Caller_Range = CUR.curRange;\n        call->Caller_IP    = CUR.IP + 1;\n        call->Cur_Count    = 1;\n        call->Def          = def;\n\n        INS_Goto_CodeRange( def->range, def->start );\n\n        CUR.step_ins = FALSE;\n        return;\n      }\n    }\n\n    CUR.error = FT_THROW( Invalid_Opcode );\n  }\n\n\n#ifndef TT_CONFIG_OPTION_INTERPRETER_SWITCH\n\n\n  static\n  TInstruction_Function  Instruct_Dispatch[256] =\n  {\n    /* Opcodes are gathered in groups of 16. */\n    /* Please keep the spaces as they are.   */\n\n    /*  SVTCA  y  */  Ins_SVTCA,\n    /*  SVTCA  x  */  Ins_SVTCA,\n    /*  SPvTCA y  */  Ins_SPVTCA,\n    /*  SPvTCA x  */  Ins_SPVTCA,\n    /*  SFvTCA y  */  Ins_SFVTCA,\n    /*  SFvTCA x  */  Ins_SFVTCA,\n    /*  SPvTL //  */  Ins_SPVTL,\n    /*  SPvTL +   */  Ins_SPVTL,\n    /*  SFvTL //  */  Ins_SFVTL,\n    /*  SFvTL +   */  Ins_SFVTL,\n    /*  SPvFS     */  Ins_SPVFS,\n    /*  SFvFS     */  Ins_SFVFS,\n    /*  GPV       */  Ins_GPV,\n    /*  GFV       */  Ins_GFV,\n    /*  SFvTPv    */  Ins_SFVTPV,\n    /*  ISECT     */  Ins_ISECT,\n\n    /*  SRP0      */  Ins_SRP0,\n    /*  SRP1      */  Ins_SRP1,\n    /*  SRP2      */  Ins_SRP2,\n    /*  SZP0      */  Ins_SZP0,\n    /*  SZP1      */  Ins_SZP1,\n    /*  SZP2      */  Ins_SZP2,\n    /*  SZPS      */  Ins_SZPS,\n    /*  SLOOP     */  Ins_SLOOP,\n    /*  RTG       */  Ins_RTG,\n    /*  RTHG      */  Ins_RTHG,\n    /*  SMD       */  Ins_SMD,\n    /*  ELSE      */  Ins_ELSE,\n    /*  JMPR      */  Ins_JMPR,\n    /*  SCvTCi    */  Ins_SCVTCI,\n    /*  SSwCi     */  Ins_SSWCI,\n    /*  SSW       */  Ins_SSW,\n\n    /*  DUP       */  Ins_DUP,\n    /*  POP       */  Ins_POP,\n    /*  CLEAR     */  Ins_CLEAR,\n    /*  SWAP      */  Ins_SWAP,\n    /*  DEPTH     */  Ins_DEPTH,\n    /*  CINDEX    */  Ins_CINDEX,\n    /*  MINDEX    */  Ins_MINDEX,\n    /*  AlignPTS  */  Ins_ALIGNPTS,\n    /*  INS_0x28  */  Ins_UNKNOWN,\n    /*  UTP       */  Ins_UTP,\n    /*  LOOPCALL  */  Ins_LOOPCALL,\n    /*  CALL      */  Ins_CALL,\n    /*  FDEF      */  Ins_FDEF,\n    /*  ENDF      */  Ins_ENDF,\n    /*  MDAP[0]   */  Ins_MDAP,\n    /*  MDAP[1]   */  Ins_MDAP,\n\n    /*  IUP[0]    */  Ins_IUP,\n    /*  IUP[1]    */  Ins_IUP,\n    /*  SHP[0]    */  Ins_SHP,\n    /*  SHP[1]    */  Ins_SHP,\n    /*  SHC[0]    */  Ins_SHC,\n    /*  SHC[1]    */  Ins_SHC,\n    /*  SHZ[0]    */  Ins_SHZ,\n    /*  SHZ[1]    */  Ins_SHZ,\n    /*  SHPIX     */  Ins_SHPIX,\n    /*  IP        */  Ins_IP,\n    /*  MSIRP[0]  */  Ins_MSIRP,\n    /*  MSIRP[1]  */  Ins_MSIRP,\n    /*  AlignRP   */  Ins_ALIGNRP,\n    /*  RTDG      */  Ins_RTDG,\n    /*  MIAP[0]   */  Ins_MIAP,\n    /*  MIAP[1]   */  Ins_MIAP,\n\n    /*  NPushB    */  Ins_NPUSHB,\n    /*  NPushW    */  Ins_NPUSHW,\n    /*  WS        */  Ins_WS,\n    /*  RS        */  Ins_RS,\n    /*  WCvtP     */  Ins_WCVTP,\n    /*  RCvt      */  Ins_RCVT,\n    /*  GC[0]     */  Ins_GC,\n    /*  GC[1]     */  Ins_GC,\n    /*  SCFS      */  Ins_SCFS,\n    /*  MD[0]     */  Ins_MD,\n    /*  MD[1]     */  Ins_MD,\n    /*  MPPEM     */  Ins_MPPEM,\n    /*  MPS       */  Ins_MPS,\n    /*  FlipON    */  Ins_FLIPON,\n    /*  FlipOFF   */  Ins_FLIPOFF,\n    /*  DEBUG     */  Ins_DEBUG,\n\n    /*  LT        */  Ins_LT,\n    /*  LTEQ      */  Ins_LTEQ,\n    /*  GT        */  Ins_GT,\n    /*  GTEQ      */  Ins_GTEQ,\n    /*  EQ        */  Ins_EQ,\n    /*  NEQ       */  Ins_NEQ,\n    /*  ODD       */  Ins_ODD,\n    /*  EVEN      */  Ins_EVEN,\n    /*  IF        */  Ins_IF,\n    /*  EIF       */  Ins_EIF,\n    /*  AND       */  Ins_AND,\n    /*  OR        */  Ins_OR,\n    /*  NOT       */  Ins_NOT,\n    /*  DeltaP1   */  Ins_DELTAP,\n    /*  SDB       */  Ins_SDB,\n    /*  SDS       */  Ins_SDS,\n\n    /*  ADD       */  Ins_ADD,\n    /*  SUB       */  Ins_SUB,\n    /*  DIV       */  Ins_DIV,\n    /*  MUL       */  Ins_MUL,\n    /*  ABS       */  Ins_ABS,\n    /*  NEG       */  Ins_NEG,\n    /*  FLOOR     */  Ins_FLOOR,\n    /*  CEILING   */  Ins_CEILING,\n    /*  ROUND[0]  */  Ins_ROUND,\n    /*  ROUND[1]  */  Ins_ROUND,\n    /*  ROUND[2]  */  Ins_ROUND,\n    /*  ROUND[3]  */  Ins_ROUND,\n    /*  NROUND[0] */  Ins_NROUND,\n    /*  NROUND[1] */  Ins_NROUND,\n    /*  NROUND[2] */  Ins_NROUND,\n    /*  NROUND[3] */  Ins_NROUND,\n\n    /*  WCvtF     */  Ins_WCVTF,\n    /*  DeltaP2   */  Ins_DELTAP,\n    /*  DeltaP3   */  Ins_DELTAP,\n    /*  DeltaCn[0] */ Ins_DELTAC,\n    /*  DeltaCn[1] */ Ins_DELTAC,\n    /*  DeltaCn[2] */ Ins_DELTAC,\n    /*  SROUND    */  Ins_SROUND,\n    /*  S45Round  */  Ins_S45ROUND,\n    /*  JROT      */  Ins_JROT,\n    /*  JROF      */  Ins_JROF,\n    /*  ROFF      */  Ins_ROFF,\n    /*  INS_0x7B  */  Ins_UNKNOWN,\n    /*  RUTG      */  Ins_RUTG,\n    /*  RDTG      */  Ins_RDTG,\n    /*  SANGW     */  Ins_SANGW,\n    /*  AA        */  Ins_AA,\n\n    /*  FlipPT    */  Ins_FLIPPT,\n    /*  FlipRgON  */  Ins_FLIPRGON,\n    /*  FlipRgOFF */  Ins_FLIPRGOFF,\n    /*  INS_0x83  */  Ins_UNKNOWN,\n    /*  INS_0x84  */  Ins_UNKNOWN,\n    /*  ScanCTRL  */  Ins_SCANCTRL,\n    /*  SDPVTL[0] */  Ins_SDPVTL,\n    /*  SDPVTL[1] */  Ins_SDPVTL,\n    /*  GetINFO   */  Ins_GETINFO,\n    /*  IDEF      */  Ins_IDEF,\n    /*  ROLL      */  Ins_ROLL,\n    /*  MAX       */  Ins_MAX,\n    /*  MIN       */  Ins_MIN,\n    /*  ScanTYPE  */  Ins_SCANTYPE,\n    /*  InstCTRL  */  Ins_INSTCTRL,\n    /*  INS_0x8F  */  Ins_UNKNOWN,\n\n    /*  INS_0x90  */   Ins_UNKNOWN,\n    /*  INS_0x91  */   Ins_UNKNOWN,\n    /*  INS_0x92  */   Ins_UNKNOWN,\n    /*  INS_0x93  */   Ins_UNKNOWN,\n    /*  INS_0x94  */   Ins_UNKNOWN,\n    /*  INS_0x95  */   Ins_UNKNOWN,\n    /*  INS_0x96  */   Ins_UNKNOWN,\n    /*  INS_0x97  */   Ins_UNKNOWN,\n    /*  INS_0x98  */   Ins_UNKNOWN,\n    /*  INS_0x99  */   Ins_UNKNOWN,\n    /*  INS_0x9A  */   Ins_UNKNOWN,\n    /*  INS_0x9B  */   Ins_UNKNOWN,\n    /*  INS_0x9C  */   Ins_UNKNOWN,\n    /*  INS_0x9D  */   Ins_UNKNOWN,\n    /*  INS_0x9E  */   Ins_UNKNOWN,\n    /*  INS_0x9F  */   Ins_UNKNOWN,\n\n    /*  INS_0xA0  */   Ins_UNKNOWN,\n    /*  INS_0xA1  */   Ins_UNKNOWN,\n    /*  INS_0xA2  */   Ins_UNKNOWN,\n    /*  INS_0xA3  */   Ins_UNKNOWN,\n    /*  INS_0xA4  */   Ins_UNKNOWN,\n    /*  INS_0xA5  */   Ins_UNKNOWN,\n    /*  INS_0xA6  */   Ins_UNKNOWN,\n    /*  INS_0xA7  */   Ins_UNKNOWN,\n    /*  INS_0xA8  */   Ins_UNKNOWN,\n    /*  INS_0xA9  */   Ins_UNKNOWN,\n    /*  INS_0xAA  */   Ins_UNKNOWN,\n    /*  INS_0xAB  */   Ins_UNKNOWN,\n    /*  INS_0xAC  */   Ins_UNKNOWN,\n    /*  INS_0xAD  */   Ins_UNKNOWN,\n    /*  INS_0xAE  */   Ins_UNKNOWN,\n    /*  INS_0xAF  */   Ins_UNKNOWN,\n\n    /*  PushB[0]  */  Ins_PUSHB,\n    /*  PushB[1]  */  Ins_PUSHB,\n    /*  PushB[2]  */  Ins_PUSHB,\n    /*  PushB[3]  */  Ins_PUSHB,\n    /*  PushB[4]  */  Ins_PUSHB,\n    /*  PushB[5]  */  Ins_PUSHB,\n    /*  PushB[6]  */  Ins_PUSHB,\n    /*  PushB[7]  */  Ins_PUSHB,\n    /*  PushW[0]  */  Ins_PUSHW,\n    /*  PushW[1]  */  Ins_PUSHW,\n    /*  PushW[2]  */  Ins_PUSHW,\n    /*  PushW[3]  */  Ins_PUSHW,\n    /*  PushW[4]  */  Ins_PUSHW,\n    /*  PushW[5]  */  Ins_PUSHW,\n    /*  PushW[6]  */  Ins_PUSHW,\n    /*  PushW[7]  */  Ins_PUSHW,\n\n    /*  MDRP[00]  */  Ins_MDRP,\n    /*  MDRP[01]  */  Ins_MDRP,\n    /*  MDRP[02]  */  Ins_MDRP,\n    /*  MDRP[03]  */  Ins_MDRP,\n    /*  MDRP[04]  */  Ins_MDRP,\n    /*  MDRP[05]  */  Ins_MDRP,\n    /*  MDRP[06]  */  Ins_MDRP,\n    /*  MDRP[07]  */  Ins_MDRP,\n    /*  MDRP[08]  */  Ins_MDRP,\n    /*  MDRP[09]  */  Ins_MDRP,\n    /*  MDRP[10]  */  Ins_MDRP,\n    /*  MDRP[11]  */  Ins_MDRP,\n    /*  MDRP[12]  */  Ins_MDRP,\n    /*  MDRP[13]  */  Ins_MDRP,\n    /*  MDRP[14]  */  Ins_MDRP,\n    /*  MDRP[15]  */  Ins_MDRP,\n\n    /*  MDRP[16]  */  Ins_MDRP,\n    /*  MDRP[17]  */  Ins_MDRP,\n    /*  MDRP[18]  */  Ins_MDRP,\n    /*  MDRP[19]  */  Ins_MDRP,\n    /*  MDRP[20]  */  Ins_MDRP,\n    /*  MDRP[21]  */  Ins_MDRP,\n    /*  MDRP[22]  */  Ins_MDRP,\n    /*  MDRP[23]  */  Ins_MDRP,\n    /*  MDRP[24]  */  Ins_MDRP,\n    /*  MDRP[25]  */  Ins_MDRP,\n    /*  MDRP[26]  */  Ins_MDRP,\n    /*  MDRP[27]  */  Ins_MDRP,\n    /*  MDRP[28]  */  Ins_MDRP,\n    /*  MDRP[29]  */  Ins_MDRP,\n    /*  MDRP[30]  */  Ins_MDRP,\n    /*  MDRP[31]  */  Ins_MDRP,\n\n    /*  MIRP[00]  */  Ins_MIRP,\n    /*  MIRP[01]  */  Ins_MIRP,\n    /*  MIRP[02]  */  Ins_MIRP,\n    /*  MIRP[03]  */  Ins_MIRP,\n    /*  MIRP[04]  */  Ins_MIRP,\n    /*  MIRP[05]  */  Ins_MIRP,\n    /*  MIRP[06]  */  Ins_MIRP,\n    /*  MIRP[07]  */  Ins_MIRP,\n    /*  MIRP[08]  */  Ins_MIRP,\n    /*  MIRP[09]  */  Ins_MIRP,\n    /*  MIRP[10]  */  Ins_MIRP,\n    /*  MIRP[11]  */  Ins_MIRP,\n    /*  MIRP[12]  */  Ins_MIRP,\n    /*  MIRP[13]  */  Ins_MIRP,\n    /*  MIRP[14]  */  Ins_MIRP,\n    /*  MIRP[15]  */  Ins_MIRP,\n\n    /*  MIRP[16]  */  Ins_MIRP,\n    /*  MIRP[17]  */  Ins_MIRP,\n    /*  MIRP[18]  */  Ins_MIRP,\n    /*  MIRP[19]  */  Ins_MIRP,\n    /*  MIRP[20]  */  Ins_MIRP,\n    /*  MIRP[21]  */  Ins_MIRP,\n    /*  MIRP[22]  */  Ins_MIRP,\n    /*  MIRP[23]  */  Ins_MIRP,\n    /*  MIRP[24]  */  Ins_MIRP,\n    /*  MIRP[25]  */  Ins_MIRP,\n    /*  MIRP[26]  */  Ins_MIRP,\n    /*  MIRP[27]  */  Ins_MIRP,\n    /*  MIRP[28]  */  Ins_MIRP,\n    /*  MIRP[29]  */  Ins_MIRP,\n    /*  MIRP[30]  */  Ins_MIRP,\n    /*  MIRP[31]  */  Ins_MIRP\n  };\n\n\n#endif /* !TT_CONFIG_OPTION_INTERPRETER_SWITCH */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* RUN                                                                   */\n  /*                                                                       */\n  /*  This function executes a run of opcodes.  It will exit in the        */\n  /*  following cases:                                                     */\n  /*                                                                       */\n  /*  - Errors (in which case it returns FALSE).                           */\n  /*                                                                       */\n  /*  - Reaching the end of the main code range (returns TRUE).            */\n  /*    Reaching the end of a code range within a function call is an      */\n  /*    error.                                                             */\n  /*                                                                       */\n  /*  - After executing one single opcode, if the flag `Instruction_Trap'  */\n  /*    is set to TRUE (returns TRUE).                                     */\n  /*                                                                       */\n  /*  On exit with TRUE, test IP < CodeSize to know whether it comes from  */\n  /*  an instruction trap or a normal termination.                         */\n  /*                                                                       */\n  /*                                                                       */\n  /*  Note: The documented DEBUG opcode pops a value from the stack.  This */\n  /*        behaviour is unsupported; here a DEBUG opcode is always an     */\n  /*        error.                                                         */\n  /*                                                                       */\n  /*                                                                       */\n  /* THIS IS THE INTERPRETER'S MAIN LOOP.                                  */\n  /*                                                                       */\n  /*  Instructions appear in the specification's order.                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* documentation is in ttinterp.h */\n\n  FT_EXPORT_DEF( FT_Error )\n  TT_RunIns( TT_ExecContext  exc )\n  {\n    FT_Long    ins_counter = 0;  /* executed instructions counter */\n    FT_UShort  i;\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    FT_Byte    opcode_pattern[1][2] = {\n                  /* #8 TypeMan Talk Align */\n                  {\n                    0x06, /* SPVTL   */\n                    0x7D, /* RDTG    */\n                  },\n                };\n    FT_UShort  opcode_patterns   = 1;\n    FT_UShort  opcode_pointer[1] = { 0 };\n    FT_UShort  opcode_size[1]    = { 1 };\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n\n#ifdef TT_CONFIG_OPTION_STATIC_RASTER\n    if ( !exc )\n      return FT_THROW( Invalid_Argument );\n\n    cur = *exc;\n#endif\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    CUR.iup_called = FALSE;\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n    /* set PPEM and CVT functions */\n    CUR.tt_metrics.ratio = 0;\n    if ( CUR.metrics.x_ppem != CUR.metrics.y_ppem )\n    {\n      /* non-square pixels, use the stretched routines */\n      CUR.func_cur_ppem  = Current_Ppem_Stretched;\n      CUR.func_read_cvt  = Read_CVT_Stretched;\n      CUR.func_write_cvt = Write_CVT_Stretched;\n      CUR.func_move_cvt  = Move_CVT_Stretched;\n    }\n    else\n    {\n      /* square pixels, use normal routines */\n      CUR.func_cur_ppem  = Current_Ppem;\n      CUR.func_read_cvt  = Read_CVT;\n      CUR.func_write_cvt = Write_CVT;\n      CUR.func_move_cvt  = Move_CVT;\n    }\n\n    COMPUTE_Funcs();\n    COMPUTE_Round( (FT_Byte)exc->GS.round_state );\n\n    do\n    {\n      CUR.opcode = CUR.code[CUR.IP];\n\n      FT_TRACE7(( \"  \" ));\n      FT_TRACE7(( opcode_name[CUR.opcode] ));\n      FT_TRACE7(( \"\\n\" ));\n\n      if ( ( CUR.length = opcode_length[CUR.opcode] ) < 0 )\n      {\n        if ( CUR.IP + 1 >= CUR.codeSize )\n          goto LErrorCodeOverflow_;\n\n        CUR.length = 2 - CUR.length * CUR.code[CUR.IP + 1];\n      }\n\n      if ( CUR.IP + CUR.length > CUR.codeSize )\n        goto LErrorCodeOverflow_;\n\n      /* First, let's check for empty stack and overflow */\n      CUR.args = CUR.top - ( Pop_Push_Count[CUR.opcode] >> 4 );\n\n      /* `args' is the top of the stack once arguments have been popped. */\n      /* One can also interpret it as the index of the last argument.    */\n      if ( CUR.args < 0 )\n      {\n        if ( CUR.pedantic_hinting )\n        {\n          CUR.error = FT_THROW( Too_Few_Arguments );\n          goto LErrorLabel_;\n        }\n\n        /* push zeroes onto the stack */\n        for ( i = 0; i < Pop_Push_Count[CUR.opcode] >> 4; i++ )\n          CUR.stack[i] = 0;\n        CUR.args = 0;\n      }\n\n      CUR.new_top = CUR.args + ( Pop_Push_Count[CUR.opcode] & 15 );\n\n      /* `new_top' is the new top of the stack, after the instruction's */\n      /* execution.  `top' will be set to `new_top' after the `switch'  */\n      /* statement.                                                     */\n      if ( CUR.new_top > CUR.stackSize )\n      {\n        CUR.error = FT_THROW( Stack_Overflow );\n        goto LErrorLabel_;\n      }\n\n      CUR.step_ins = TRUE;\n      CUR.error    = FT_Err_Ok;\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n\n      if ( SUBPIXEL_HINTING )\n      {\n        for ( i = 0; i < opcode_patterns; i++ )\n        {\n          if ( opcode_pointer[i] < opcode_size[i]                 &&\n               CUR.opcode == opcode_pattern[i][opcode_pointer[i]] )\n          {\n            opcode_pointer[i] += 1;\n\n            if ( opcode_pointer[i] == opcode_size[i] )\n            {\n              FT_TRACE7(( \"sph: opcode ptrn: %d, %s %s\\n\",\n                          i,\n                          CUR.face->root.family_name,\n                          CUR.face->root.style_name ));\n\n              switch ( i )\n              {\n              case 0:\n                break;\n              }\n              opcode_pointer[i] = 0;\n            }\n          }\n          else\n            opcode_pointer[i] = 0;\n        }\n      }\n\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n#ifdef TT_CONFIG_OPTION_INTERPRETER_SWITCH\n\n      {\n        FT_Long*  args   = CUR.stack + CUR.args;\n        FT_Byte   opcode = CUR.opcode;\n\n\n#undef  ARRAY_BOUND_ERROR\n#define ARRAY_BOUND_ERROR  goto Set_Invalid_Ref\n\n\n        switch ( opcode )\n        {\n        case 0x00:  /* SVTCA y  */\n        case 0x01:  /* SVTCA x  */\n        case 0x02:  /* SPvTCA y */\n        case 0x03:  /* SPvTCA x */\n        case 0x04:  /* SFvTCA y */\n        case 0x05:  /* SFvTCA x */\n          {\n            FT_Short  AA, BB;\n\n\n            AA = (FT_Short)( ( opcode & 1 ) << 14 );\n            BB = (FT_Short)( AA ^ 0x4000 );\n\n            if ( opcode < 4 )\n            {\n              CUR.GS.projVector.x = AA;\n              CUR.GS.projVector.y = BB;\n\n              CUR.GS.dualVector.x = AA;\n              CUR.GS.dualVector.y = BB;\n            }\n            else\n            {\n              GUESS_VECTOR( projVector );\n            }\n\n            if ( ( opcode & 2 ) == 0 )\n            {\n              CUR.GS.freeVector.x = AA;\n              CUR.GS.freeVector.y = BB;\n            }\n            else\n            {\n              GUESS_VECTOR( freeVector );\n            }\n\n            COMPUTE_Funcs();\n          }\n          break;\n\n        case 0x06:  /* SPvTL // */\n        case 0x07:  /* SPvTL +  */\n          DO_SPVTL\n          break;\n\n        case 0x08:  /* SFvTL // */\n        case 0x09:  /* SFvTL +  */\n          DO_SFVTL\n          break;\n\n        case 0x0A:  /* SPvFS */\n          DO_SPVFS\n          break;\n\n        case 0x0B:  /* SFvFS */\n          DO_SFVFS\n          break;\n\n        case 0x0C:  /* GPV */\n          DO_GPV\n          break;\n\n        case 0x0D:  /* GFV */\n          DO_GFV\n          break;\n\n        case 0x0E:  /* SFvTPv */\n          DO_SFVTPV\n          break;\n\n        case 0x0F:  /* ISECT  */\n          Ins_ISECT( EXEC_ARG_ args );\n          break;\n\n        case 0x10:  /* SRP0 */\n          DO_SRP0\n          break;\n\n        case 0x11:  /* SRP1 */\n          DO_SRP1\n          break;\n\n        case 0x12:  /* SRP2 */\n          DO_SRP2\n          break;\n\n        case 0x13:  /* SZP0 */\n          Ins_SZP0( EXEC_ARG_ args );\n          break;\n\n        case 0x14:  /* SZP1 */\n          Ins_SZP1( EXEC_ARG_ args );\n          break;\n\n        case 0x15:  /* SZP2 */\n          Ins_SZP2( EXEC_ARG_ args );\n          break;\n\n        case 0x16:  /* SZPS */\n          Ins_SZPS( EXEC_ARG_ args );\n          break;\n\n        case 0x17:  /* SLOOP */\n          DO_SLOOP\n          break;\n\n        case 0x18:  /* RTG */\n          DO_RTG\n          break;\n\n        case 0x19:  /* RTHG */\n          DO_RTHG\n          break;\n\n        case 0x1A:  /* SMD */\n          DO_SMD\n          break;\n\n        case 0x1B:  /* ELSE */\n          Ins_ELSE( EXEC_ARG_ args );\n          break;\n\n        case 0x1C:  /* JMPR */\n          DO_JMPR\n          break;\n\n        case 0x1D:  /* SCVTCI */\n          DO_SCVTCI\n          break;\n\n        case 0x1E:  /* SSWCI */\n          DO_SSWCI\n          break;\n\n        case 0x1F:  /* SSW */\n          DO_SSW\n          break;\n\n        case 0x20:  /* DUP */\n          DO_DUP\n          break;\n\n        case 0x21:  /* POP */\n          /* nothing :-) */\n          break;\n\n        case 0x22:  /* CLEAR */\n          DO_CLEAR\n          break;\n\n        case 0x23:  /* SWAP */\n          DO_SWAP\n          break;\n\n        case 0x24:  /* DEPTH */\n          DO_DEPTH\n          break;\n\n        case 0x25:  /* CINDEX */\n          DO_CINDEX\n          break;\n\n        case 0x26:  /* MINDEX */\n          Ins_MINDEX( EXEC_ARG_ args );\n          break;\n\n        case 0x27:  /* ALIGNPTS */\n          Ins_ALIGNPTS( EXEC_ARG_ args );\n          break;\n\n        case 0x28:  /* ???? */\n          Ins_UNKNOWN( EXEC_ARG_ args );\n          break;\n\n        case 0x29:  /* UTP */\n          Ins_UTP( EXEC_ARG_ args );\n          break;\n\n        case 0x2A:  /* LOOPCALL */\n          Ins_LOOPCALL( EXEC_ARG_ args );\n          break;\n\n        case 0x2B:  /* CALL */\n          Ins_CALL( EXEC_ARG_ args );\n          break;\n\n        case 0x2C:  /* FDEF */\n          Ins_FDEF( EXEC_ARG_ args );\n          break;\n\n        case 0x2D:  /* ENDF */\n          Ins_ENDF( EXEC_ARG_ args );\n          break;\n\n        case 0x2E:  /* MDAP */\n        case 0x2F:  /* MDAP */\n          Ins_MDAP( EXEC_ARG_ args );\n          break;\n\n        case 0x30:  /* IUP */\n        case 0x31:  /* IUP */\n          Ins_IUP( EXEC_ARG_ args );\n          break;\n\n        case 0x32:  /* SHP */\n        case 0x33:  /* SHP */\n          Ins_SHP( EXEC_ARG_ args );\n          break;\n\n        case 0x34:  /* SHC */\n        case 0x35:  /* SHC */\n          Ins_SHC( EXEC_ARG_ args );\n          break;\n\n        case 0x36:  /* SHZ */\n        case 0x37:  /* SHZ */\n          Ins_SHZ( EXEC_ARG_ args );\n          break;\n\n        case 0x38:  /* SHPIX */\n          Ins_SHPIX( EXEC_ARG_ args );\n          break;\n\n        case 0x39:  /* IP    */\n          Ins_IP( EXEC_ARG_ args );\n          break;\n\n        case 0x3A:  /* MSIRP */\n        case 0x3B:  /* MSIRP */\n          Ins_MSIRP( EXEC_ARG_ args );\n          break;\n\n        case 0x3C:  /* AlignRP */\n          Ins_ALIGNRP( EXEC_ARG_ args );\n          break;\n\n        case 0x3D:  /* RTDG */\n          DO_RTDG\n          break;\n\n        case 0x3E:  /* MIAP */\n        case 0x3F:  /* MIAP */\n          Ins_MIAP( EXEC_ARG_ args );\n          break;\n\n        case 0x40:  /* NPUSHB */\n          Ins_NPUSHB( EXEC_ARG_ args );\n          break;\n\n        case 0x41:  /* NPUSHW */\n          Ins_NPUSHW( EXEC_ARG_ args );\n          break;\n\n        case 0x42:  /* WS */\n          DO_WS\n          break;\n\n      Set_Invalid_Ref:\n            CUR.error = FT_THROW( Invalid_Reference );\n          break;\n\n        case 0x43:  /* RS */\n          DO_RS\n          break;\n\n        case 0x44:  /* WCVTP */\n          DO_WCVTP\n          break;\n\n        case 0x45:  /* RCVT */\n          DO_RCVT\n          break;\n\n        case 0x46:  /* GC */\n        case 0x47:  /* GC */\n          Ins_GC( EXEC_ARG_ args );\n          break;\n\n        case 0x48:  /* SCFS */\n          Ins_SCFS( EXEC_ARG_ args );\n          break;\n\n        case 0x49:  /* MD */\n        case 0x4A:  /* MD */\n          Ins_MD( EXEC_ARG_ args );\n          break;\n\n        case 0x4B:  /* MPPEM */\n          DO_MPPEM\n          break;\n\n        case 0x4C:  /* MPS */\n          DO_MPS\n          break;\n\n        case 0x4D:  /* FLIPON */\n          DO_FLIPON\n          break;\n\n        case 0x4E:  /* FLIPOFF */\n          DO_FLIPOFF\n          break;\n\n        case 0x4F:  /* DEBUG */\n          DO_DEBUG\n          break;\n\n        case 0x50:  /* LT */\n          DO_LT\n          break;\n\n        case 0x51:  /* LTEQ */\n          DO_LTEQ\n          break;\n\n        case 0x52:  /* GT */\n          DO_GT\n          break;\n\n        case 0x53:  /* GTEQ */\n          DO_GTEQ\n          break;\n\n        case 0x54:  /* EQ */\n          DO_EQ\n          break;\n\n        case 0x55:  /* NEQ */\n          DO_NEQ\n          break;\n\n        case 0x56:  /* ODD */\n          DO_ODD\n          break;\n\n        case 0x57:  /* EVEN */\n          DO_EVEN\n          break;\n\n        case 0x58:  /* IF */\n          Ins_IF( EXEC_ARG_ args );\n          break;\n\n        case 0x59:  /* EIF */\n          /* do nothing */\n          break;\n\n        case 0x5A:  /* AND */\n          DO_AND\n          break;\n\n        case 0x5B:  /* OR */\n          DO_OR\n          break;\n\n        case 0x5C:  /* NOT */\n          DO_NOT\n          break;\n\n        case 0x5D:  /* DELTAP1 */\n          Ins_DELTAP( EXEC_ARG_ args );\n          break;\n\n        case 0x5E:  /* SDB */\n          DO_SDB\n          break;\n\n        case 0x5F:  /* SDS */\n          DO_SDS\n          break;\n\n        case 0x60:  /* ADD */\n          DO_ADD\n          break;\n\n        case 0x61:  /* SUB */\n          DO_SUB\n          break;\n\n        case 0x62:  /* DIV */\n          DO_DIV\n          break;\n\n        case 0x63:  /* MUL */\n          DO_MUL\n          break;\n\n        case 0x64:  /* ABS */\n          DO_ABS\n          break;\n\n        case 0x65:  /* NEG */\n          DO_NEG\n          break;\n\n        case 0x66:  /* FLOOR */\n          DO_FLOOR\n          break;\n\n        case 0x67:  /* CEILING */\n          DO_CEILING\n          break;\n\n        case 0x68:  /* ROUND */\n        case 0x69:  /* ROUND */\n        case 0x6A:  /* ROUND */\n        case 0x6B:  /* ROUND */\n          DO_ROUND\n          break;\n\n        case 0x6C:  /* NROUND */\n        case 0x6D:  /* NROUND */\n        case 0x6E:  /* NRRUND */\n        case 0x6F:  /* NROUND */\n          DO_NROUND\n          break;\n\n        case 0x70:  /* WCVTF */\n          DO_WCVTF\n          break;\n\n        case 0x71:  /* DELTAP2 */\n        case 0x72:  /* DELTAP3 */\n          Ins_DELTAP( EXEC_ARG_ args );\n          break;\n\n        case 0x73:  /* DELTAC0 */\n        case 0x74:  /* DELTAC1 */\n        case 0x75:  /* DELTAC2 */\n          Ins_DELTAC( EXEC_ARG_ args );\n          break;\n\n        case 0x76:  /* SROUND */\n          DO_SROUND\n          break;\n\n        case 0x77:  /* S45Round */\n          DO_S45ROUND\n          break;\n\n        case 0x78:  /* JROT */\n          DO_JROT\n          break;\n\n        case 0x79:  /* JROF */\n          DO_JROF\n          break;\n\n        case 0x7A:  /* ROFF */\n          DO_ROFF\n          break;\n\n        case 0x7B:  /* ???? */\n          Ins_UNKNOWN( EXEC_ARG_ args );\n          break;\n\n        case 0x7C:  /* RUTG */\n          DO_RUTG\n          break;\n\n        case 0x7D:  /* RDTG */\n          DO_RDTG\n          break;\n\n        case 0x7E:  /* SANGW */\n        case 0x7F:  /* AA    */\n          /* nothing - obsolete */\n          break;\n\n        case 0x80:  /* FLIPPT */\n          Ins_FLIPPT( EXEC_ARG_ args );\n          break;\n\n        case 0x81:  /* FLIPRGON */\n          Ins_FLIPRGON( EXEC_ARG_ args );\n          break;\n\n        case 0x82:  /* FLIPRGOFF */\n          Ins_FLIPRGOFF( EXEC_ARG_ args );\n          break;\n\n        case 0x83:  /* UNKNOWN */\n        case 0x84:  /* UNKNOWN */\n          Ins_UNKNOWN( EXEC_ARG_ args );\n          break;\n\n        case 0x85:  /* SCANCTRL */\n          Ins_SCANCTRL( EXEC_ARG_ args );\n          break;\n\n        case 0x86:  /* SDPVTL */\n        case 0x87:  /* SDPVTL */\n          Ins_SDPVTL( EXEC_ARG_ args );\n          break;\n\n        case 0x88:  /* GETINFO */\n          Ins_GETINFO( EXEC_ARG_ args );\n          break;\n\n        case 0x89:  /* IDEF */\n          Ins_IDEF( EXEC_ARG_ args );\n          break;\n\n        case 0x8A:  /* ROLL */\n          Ins_ROLL( EXEC_ARG_ args );\n          break;\n\n        case 0x8B:  /* MAX */\n          DO_MAX\n          break;\n\n        case 0x8C:  /* MIN */\n          DO_MIN\n          break;\n\n        case 0x8D:  /* SCANTYPE */\n          Ins_SCANTYPE( EXEC_ARG_ args );\n          break;\n\n        case 0x8E:  /* INSTCTRL */\n          Ins_INSTCTRL( EXEC_ARG_ args );\n          break;\n\n        case 0x8F:\n          Ins_UNKNOWN( EXEC_ARG_ args );\n          break;\n\n        default:\n          if ( opcode >= 0xE0 )\n            Ins_MIRP( EXEC_ARG_ args );\n          else if ( opcode >= 0xC0 )\n            Ins_MDRP( EXEC_ARG_ args );\n          else if ( opcode >= 0xB8 )\n            Ins_PUSHW( EXEC_ARG_ args );\n          else if ( opcode >= 0xB0 )\n            Ins_PUSHB( EXEC_ARG_ args );\n          else\n            Ins_UNKNOWN( EXEC_ARG_ args );\n        }\n\n      }\n\n#else\n\n      Instruct_Dispatch[CUR.opcode]( EXEC_ARG_ &CUR.stack[CUR.args] );\n\n#endif /* TT_CONFIG_OPTION_INTERPRETER_SWITCH */\n\n      if ( CUR.error )\n      {\n        switch ( CUR.error )\n        {\n          /* looking for redefined instructions */\n        case FT_ERR( Invalid_Opcode ):\n          {\n            TT_DefRecord*  def   = CUR.IDefs;\n            TT_DefRecord*  limit = def + CUR.numIDefs;\n\n\n            for ( ; def < limit; def++ )\n            {\n              if ( def->active && CUR.opcode == (FT_Byte)def->opc )\n              {\n                TT_CallRec*  callrec;\n\n\n                if ( CUR.callTop >= CUR.callSize )\n                {\n                  CUR.error = FT_THROW( Invalid_Reference );\n                  goto LErrorLabel_;\n                }\n\n                callrec = &CUR.callStack[CUR.callTop];\n\n                callrec->Caller_Range = CUR.curRange;\n                callrec->Caller_IP    = CUR.IP + 1;\n                callrec->Cur_Count    = 1;\n                callrec->Def          = def;\n\n                if ( INS_Goto_CodeRange( def->range, def->start ) == FAILURE )\n                  goto LErrorLabel_;\n\n                goto LSuiteLabel_;\n              }\n            }\n          }\n\n          CUR.error = FT_THROW( Invalid_Opcode );\n          goto LErrorLabel_;\n\n#if 0\n          break;   /* Unreachable code warning suppression.             */\n                   /* Leave to remind in case a later change the editor */\n                   /* to consider break;                                */\n#endif\n\n        default:\n          goto LErrorLabel_;\n\n#if 0\n        break;\n#endif\n        }\n      }\n\n      CUR.top = CUR.new_top;\n\n      if ( CUR.step_ins )\n        CUR.IP += CUR.length;\n\n      /* increment instruction counter and check if we didn't */\n      /* run this program for too long (e.g. infinite loops). */\n      if ( ++ins_counter > MAX_RUNNABLE_OPCODES )\n        return FT_THROW( Execution_Too_Long );\n\n    LSuiteLabel_:\n      if ( CUR.IP >= CUR.codeSize )\n      {\n        if ( CUR.callTop > 0 )\n        {\n          CUR.error = FT_THROW( Code_Overflow );\n          goto LErrorLabel_;\n        }\n        else\n          goto LNo_Error_;\n      }\n    } while ( !CUR.instruction_trap );\n\n  LNo_Error_:\n\n#ifdef TT_CONFIG_OPTION_STATIC_RASTER\n    *exc = cur;\n#endif\n\n    return FT_Err_Ok;\n\n  LErrorCodeOverflow_:\n    CUR.error = FT_THROW( Code_Overflow );\n\n  LErrorLabel_:\n\n#ifdef TT_CONFIG_OPTION_STATIC_RASTER\n    *exc = cur;\n#endif\n\n    /* If any errors have occurred, function tables may be broken. */\n    /* Force a re-execution of `prep' and `fpgm' tables if no      */\n    /* bytecode debugger is run.                                   */\n    if ( CUR.error                          &&\n         !CUR.instruction_trap              &&\n         CUR.curRange == tt_coderange_glyph )\n    {\n      FT_TRACE1(( \"  The interpreter returned error 0x%x\\n\", CUR.error ));\n      exc->size->bytecode_ready = -1;\n      exc->size->cvt_ready      = -1;\n    }\n\n    return CUR.error;\n  }\n\n\n#endif /* TT_USE_BYTECODE_INTERPRETER */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/truetype/ttinterp.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttinterp.h                                                             */\n/*                                                                         */\n/*    TrueType bytecode interpreter (specification).                       */\n/*                                                                         */\n/*  Copyright 1996-2007, 2010, 2012-2014 by                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTINTERP_H__\n#define __TTINTERP_H__\n\n#include <ft2build.h>\n#include \"ttobjs.h\"\n\n\nFT_BEGIN_HEADER\n\n\n#ifndef TT_CONFIG_OPTION_STATIC_INTERPRETER /* indirect implementation */\n\n#define EXEC_OP_   TT_ExecContext  exc,\n#define EXEC_OP    TT_ExecContext  exc\n#define EXEC_ARG_  exc,\n#define EXEC_ARG   exc\n\n#else                                       /* static implementation */\n\n#define EXEC_OP_   /* void */\n#define EXEC_OP    /* void */\n#define EXEC_ARG_  /* void */\n#define EXEC_ARG   /* void */\n\n#endif /* TT_CONFIG_OPTION_STATIC_INTERPRETER */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Rounding mode constants.                                              */\n  /*                                                                       */\n#define TT_Round_Off             5\n#define TT_Round_To_Half_Grid    0\n#define TT_Round_To_Grid         1\n#define TT_Round_To_Double_Grid  2\n#define TT_Round_Up_To_Grid      4\n#define TT_Round_Down_To_Grid    3\n#define TT_Round_Super           6\n#define TT_Round_Super_45        7\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Function types used by the interpreter, depending on various modes    */\n  /* (e.g. the rounding mode, whether to render a vertical or horizontal   */\n  /* line etc).                                                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /* Rounding function */\n  typedef FT_F26Dot6\n  (*TT_Round_Func)( EXEC_OP_ FT_F26Dot6  distance,\n                             FT_F26Dot6  compensation );\n\n  /* Point displacement along the freedom vector routine */\n  typedef void\n  (*TT_Move_Func)( EXEC_OP_ TT_GlyphZone  zone,\n                            FT_UShort     point,\n                            FT_F26Dot6    distance );\n\n  /* Distance projection along one of the projection vectors */\n  typedef FT_F26Dot6\n  (*TT_Project_Func)( EXEC_OP_ FT_Pos   dx,\n                               FT_Pos   dy );\n\n  /* getting current ppem.  Take care of non-square pixels if necessary */\n  typedef FT_Long\n  (*TT_Cur_Ppem_Func)( EXEC_OP );\n\n  /* reading a cvt value.  Take care of non-square pixels if necessary */\n  typedef FT_F26Dot6\n  (*TT_Get_CVT_Func)( EXEC_OP_ FT_ULong  idx );\n\n  /* setting or moving a cvt value.  Take care of non-square pixels  */\n  /* if necessary                                                    */\n  typedef void\n  (*TT_Set_CVT_Func)( EXEC_OP_ FT_ULong    idx,\n                               FT_F26Dot6  value );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This structure defines a call record, used to manage function calls.  */\n  /*                                                                       */\n  typedef struct  TT_CallRec_\n  {\n    FT_Int   Caller_Range;\n    FT_Long  Caller_IP;\n    FT_Long  Cur_Count;\n\n    TT_DefRecord  *Def; /* either FDEF or IDEF */\n\n  } TT_CallRec, *TT_CallStack;\n\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* These structures define rules used to tweak subpixel hinting for      */\n  /* various fonts.  \"\", 0, \"\", NULL value indicates to match any value.   */\n  /*                                                                       */\n\n#define SPH_MAX_NAME_SIZE      32\n#define SPH_MAX_CLASS_MEMBERS  100\n\n  typedef struct  SPH_TweakRule_\n  {\n    const char      family[SPH_MAX_NAME_SIZE];\n    const FT_UInt   ppem;\n    const char      style[SPH_MAX_NAME_SIZE];\n    const FT_ULong  glyph;\n\n  } SPH_TweakRule;\n\n\n  typedef struct  SPH_ScaleRule_\n  {\n    const char      family[SPH_MAX_NAME_SIZE];\n    const FT_UInt   ppem;\n    const char      style[SPH_MAX_NAME_SIZE];\n    const FT_ULong  glyph;\n    const FT_ULong  scale;\n\n  } SPH_ScaleRule;\n\n\n  typedef struct  SPH_Font_Class_\n  {\n    const char  name[SPH_MAX_NAME_SIZE];\n    const char  member[SPH_MAX_CLASS_MEMBERS][SPH_MAX_NAME_SIZE];\n\n  } SPH_Font_Class;\n\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The main structure for the interpreter which collects all necessary   */\n  /* variables and states.                                                 */\n  /*                                                                       */\n  typedef struct  TT_ExecContextRec_\n  {\n    TT_Face            face;\n    TT_Size            size;\n    FT_Memory          memory;\n\n    /* instructions state */\n\n    FT_Error           error;      /* last execution error */\n\n    FT_Long            top;        /* top of exec. stack   */\n\n    FT_UInt            stackSize;  /* size of exec. stack  */\n    FT_Long*           stack;      /* current exec. stack  */\n\n    FT_Long            args;\n    FT_UInt            new_top;    /* new top after exec.  */\n\n    TT_GlyphZoneRec    zp0,        /* zone records */\n                       zp1,\n                       zp2,\n                       pts,\n                       twilight;\n\n    FT_Size_Metrics    metrics;\n    TT_Size_Metrics    tt_metrics; /* size metrics */\n\n    TT_GraphicsState   GS;         /* current graphics state */\n\n    FT_Int             curRange;  /* current code range number   */\n    FT_Byte*           code;      /* current code range          */\n    FT_Long            IP;        /* current instruction pointer */\n    FT_Long            codeSize;  /* size of current range       */\n\n    FT_Byte            opcode;    /* current opcode              */\n    FT_Int             length;    /* length of current opcode    */\n\n    FT_Bool            step_ins;  /* true if the interpreter must */\n                                  /* increment IP after ins. exec */\n    FT_ULong           cvtSize;\n    FT_Long*           cvt;\n\n    FT_UInt            glyphSize; /* glyph instructions buffer size */\n    FT_Byte*           glyphIns;  /* glyph instructions buffer */\n\n    FT_UInt            numFDefs;  /* number of function defs         */\n    FT_UInt            maxFDefs;  /* maximum number of function defs */\n    TT_DefArray        FDefs;     /* table of FDefs entries          */\n\n    FT_UInt            numIDefs;  /* number of instruction defs */\n    FT_UInt            maxIDefs;  /* maximum number of ins defs */\n    TT_DefArray        IDefs;     /* table of IDefs entries     */\n\n    FT_UInt            maxFunc;   /* maximum function index     */\n    FT_UInt            maxIns;    /* maximum instruction index  */\n\n    FT_Int             callTop,    /* top of call stack during execution */\n                       callSize;   /* size of call stack */\n    TT_CallStack       callStack;  /* call stack */\n\n    FT_UShort          maxPoints;    /* capacity of this context's `pts' */\n    FT_Short           maxContours;  /* record, expressed in points and  */\n                                     /* contours.                        */\n\n    TT_CodeRangeTable  codeRangeTable;  /* table of valid code ranges */\n                                        /* useful for the debugger   */\n\n    FT_UShort          storeSize;  /* size of current storage */\n    FT_Long*           storage;    /* storage area            */\n\n    FT_F26Dot6         period;     /* values used for the */\n    FT_F26Dot6         phase;      /* `SuperRounding'     */\n    FT_F26Dot6         threshold;\n\n    FT_Bool            instruction_trap; /* If `True', the interpreter will */\n                                         /* exit after each instruction     */\n\n    TT_GraphicsState   default_GS;       /* graphics state resulting from   */\n                                         /* the prep program                */\n    FT_Bool            is_composite;     /* true if the glyph is composite  */\n    FT_Bool            pedantic_hinting; /* true if pedantic interpretation */\n\n    /* latest interpreter additions */\n\n    FT_Long            F_dot_P;    /* dot product of freedom and projection */\n                                   /* vectors                               */\n    TT_Round_Func      func_round; /* current rounding function             */\n\n    TT_Project_Func    func_project,   /* current projection function */\n                       func_dualproj,  /* current dual proj. function */\n                       func_freeProj;  /* current freedom proj. func  */\n\n    TT_Move_Func       func_move;      /* current point move function */\n    TT_Move_Func       func_move_orig; /* move original position function */\n\n    TT_Cur_Ppem_Func   func_cur_ppem;  /* get current proj. ppem value  */\n\n    TT_Get_CVT_Func    func_read_cvt;  /* read a cvt entry              */\n    TT_Set_CVT_Func    func_write_cvt; /* write a cvt entry (in pixels) */\n    TT_Set_CVT_Func    func_move_cvt;  /* incr a cvt entry (in pixels)  */\n\n    FT_Bool            grayscale;      /* are we hinting for grayscale? */\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    TT_Round_Func      func_round_sphn;   /* subpixel rounding function */\n\n    FT_Bool            subpixel;          /* Using subpixel hinting?       */\n    FT_Bool            ignore_x_mode;     /* Standard rendering mode for   */\n                                          /* subpixel hinting.  On if gray */\n                                          /* or subpixel hinting is on.    */\n\n    /* The following 4 aren't fully implemented but here for MS rasterizer */\n    /* compatibility.                                                      */\n    FT_Bool            compatible_widths;     /* compatible widths?        */\n    FT_Bool            symmetrical_smoothing; /* symmetrical_smoothing?    */\n    FT_Bool            bgr;                   /* bgr instead of rgb?       */\n    FT_Bool            subpixel_positioned;   /* subpixel positioned       */\n                                              /* (DirectWrite ClearType)?  */\n\n    FT_Int             rasterizer_version;    /* MS rasterizer version     */\n\n    FT_Bool            iup_called;            /* IUP called for glyph?     */\n\n    FT_ULong           sph_tweak_flags;       /* flags to control          */\n                                              /* hint tweaks               */\n\n    FT_ULong           sph_in_func_flags;     /* flags to indicate if in   */\n                                              /* special functions         */\n\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n  } TT_ExecContextRec;\n\n\n  extern const TT_GraphicsState  tt_default_graphics_state;\n\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n  FT_LOCAL( void )\n  TT_Goto_CodeRange( TT_ExecContext  exec,\n                     FT_Int          range,\n                     FT_Long         IP );\n\n  FT_LOCAL( void )\n  TT_Set_CodeRange( TT_ExecContext  exec,\n                    FT_Int          range,\n                    void*           base,\n                    FT_Long         length );\n\n  FT_LOCAL( void )\n  TT_Clear_CodeRange( TT_ExecContext  exec,\n                      FT_Int          range );\n\n\n  FT_LOCAL( FT_Error )\n  Update_Max( FT_Memory  memory,\n              FT_ULong*  size,\n              FT_Long    multiplier,\n              void*      _pbuff,\n              FT_ULong   new_max );\n#endif /* TT_USE_BYTECODE_INTERPRETER */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    TT_New_Context                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Queries the face context for a given font.  Note that there is     */\n  /*    now a _single_ execution context in the TrueType driver which is   */\n  /*    shared among faces.                                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source face object.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A handle to the execution context.  Initialized for `face'.        */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Only the glyph loader and debugger should call this function.      */\n  /*                                                                       */\n  FT_EXPORT( TT_ExecContext )\n  TT_New_Context( TT_Driver  driver );\n\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n  FT_LOCAL( void )\n  TT_Done_Context( TT_ExecContext  exec );\n\n  FT_LOCAL( FT_Error )\n  TT_Load_Context( TT_ExecContext  exec,\n                   TT_Face         face,\n                   TT_Size         size );\n\n  FT_LOCAL( void )\n  TT_Save_Context( TT_ExecContext  exec,\n                   TT_Size         ins );\n\n  FT_LOCAL( FT_Error )\n  TT_Run_Context( TT_ExecContext  exec,\n                  FT_Bool         debug );\n#endif /* TT_USE_BYTECODE_INTERPRETER */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    TT_RunIns                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Executes one or more instruction in the execution context.  This   */\n  /*    is the main function of the TrueType opcode interpreter.           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    exec :: A handle to the target execution context.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Only the object manager and debugger should call this function.    */\n  /*                                                                       */\n  /*    This function is publicly exported because it is directly          */\n  /*    invoked by the TrueType debugger.                                  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  TT_RunIns( TT_ExecContext  exec );\n\n\nFT_END_HEADER\n\n#endif /* __TTINTERP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/truetype/ttobjs.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttobjs.c                                                               */\n/*                                                                         */\n/*    Objects manager (body).                                              */\n/*                                                                         */\n/*  Copyright 1996-2013                                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_TRUETYPE_TAGS_H\n#include FT_INTERNAL_SFNT_H\n#include FT_TRUETYPE_DRIVER_H\n\n#include \"ttgload.h\"\n#include \"ttpload.h\"\n\n#include \"tterrors.h\"\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n#include \"ttinterp.h\"\n#endif\n\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n#include FT_TRUETYPE_UNPATENTED_H\n#endif\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n#include \"ttgxvar.h\"\n#endif\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_ttobjs\n\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                       GLYPH ZONE FUNCTIONS                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_glyphzone_done                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Deallocate a glyph zone.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    zone :: A pointer to the target glyph zone.                        */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  tt_glyphzone_done( TT_GlyphZone  zone )\n  {\n    FT_Memory  memory = zone->memory;\n\n\n    if ( memory )\n    {\n      FT_FREE( zone->contours );\n      FT_FREE( zone->tags );\n      FT_FREE( zone->cur );\n      FT_FREE( zone->org );\n      FT_FREE( zone->orus );\n\n      zone->max_points   = zone->n_points   = 0;\n      zone->max_contours = zone->n_contours = 0;\n      zone->memory       = NULL;\n    }\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_glyphzone_new                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Allocate a new glyph zone.                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory      :: A handle to the current memory object.              */\n  /*                                                                       */\n  /*    maxPoints   :: The capacity of glyph zone in points.               */\n  /*                                                                       */\n  /*    maxContours :: The capacity of glyph zone in contours.             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    zone        :: A pointer to the target glyph zone record.          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_glyphzone_new( FT_Memory     memory,\n                    FT_UShort     maxPoints,\n                    FT_Short      maxContours,\n                    TT_GlyphZone  zone )\n  {\n    FT_Error  error;\n\n\n    FT_MEM_ZERO( zone, sizeof ( *zone ) );\n    zone->memory = memory;\n\n    if ( FT_NEW_ARRAY( zone->org,      maxPoints   ) ||\n         FT_NEW_ARRAY( zone->cur,      maxPoints   ) ||\n         FT_NEW_ARRAY( zone->orus,     maxPoints   ) ||\n         FT_NEW_ARRAY( zone->tags,     maxPoints   ) ||\n         FT_NEW_ARRAY( zone->contours, maxContours ) )\n    {\n      tt_glyphzone_done( zone );\n    }\n    else\n    {\n      zone->max_points   = maxPoints;\n      zone->max_contours = maxContours;\n    }\n\n    return error;\n  }\n#endif /* TT_USE_BYTECODE_INTERPRETER */\n\n\n  /* Compare the face with a list of well-known `tricky' fonts. */\n  /* This list shall be expanded as we find more of them.       */\n\n  static FT_Bool\n  tt_check_trickyness_family( FT_String*  name )\n  {\n\n#define TRICK_NAMES_MAX_CHARACTERS  19\n#define TRICK_NAMES_COUNT            9\n\n    static const char trick_names[TRICK_NAMES_COUNT]\n                                 [TRICK_NAMES_MAX_CHARACTERS + 1] =\n    {\n      \"DFKaiSho-SB\",        /* dfkaisb.ttf */\n      \"DFKaiShu\",\n      \"DFKai-SB\",           /* kaiu.ttf */\n      \"HuaTianKaiTi?\",      /* htkt2.ttf */\n      \"HuaTianSongTi?\",     /* htst3.ttf */\n      \"Ming(for ISO10646)\", /* hkscsiic.ttf & iicore.ttf */\n      \"MingLiU\",            /* mingliu.ttf & mingliu.ttc */\n      \"PMingLiU\",           /* mingliu.ttc */\n      \"MingLi43\",           /* mingli.ttf */\n    };\n\n    int  nn;\n\n\n    for ( nn = 0; nn < TRICK_NAMES_COUNT; nn++ )\n      if ( ft_strstr( name, trick_names[nn] ) )\n        return TRUE;\n\n    return FALSE;\n  }\n\n\n  /* XXX: This function should be in the `sfnt' module. */\n\n  /* Some PDF generators clear the checksums in the TrueType header table. */\n  /* For example, Quartz ContextPDF clears all entries, or Bullzip PDF     */\n  /* Printer clears the entries for subsetted subtables.  We thus have to  */\n  /* recalculate the checksums  where necessary.                           */\n\n  static FT_UInt32\n  tt_synth_sfnt_checksum( FT_Stream  stream,\n                          FT_ULong   length )\n  {\n    FT_Error   error;\n    FT_UInt32  checksum = 0;\n    int        i;\n\n\n    if ( FT_FRAME_ENTER( length ) )\n      return 0;\n\n    for ( ; length > 3; length -= 4 )\n      checksum += (FT_UInt32)FT_GET_ULONG();\n\n    for ( i = 3; length > 0; length --, i-- )\n      checksum += (FT_UInt32)( FT_GET_BYTE() << ( i * 8 ) );\n\n    FT_FRAME_EXIT();\n\n    return checksum;\n  }\n\n\n  /* XXX: This function should be in the `sfnt' module. */\n\n  static FT_ULong\n  tt_get_sfnt_checksum( TT_Face    face,\n                        FT_UShort  i )\n  {\n#if 0 /* if we believe the written value, use following part. */\n    if ( face->dir_tables[i].CheckSum )\n      return face->dir_tables[i].CheckSum;\n#endif\n\n    if ( !face->goto_table )\n      return 0;\n\n    if ( face->goto_table( face,\n                           face->dir_tables[i].Tag,\n                           face->root.stream,\n                           NULL ) )\n      return 0;\n\n    return (FT_ULong)tt_synth_sfnt_checksum( face->root.stream,\n                                             face->dir_tables[i].Length );\n  }\n\n\n  typedef struct tt_sfnt_id_rec_\n  {\n    FT_ULong  CheckSum;\n    FT_ULong  Length;\n\n  } tt_sfnt_id_rec;\n\n\n  static FT_Bool\n  tt_check_trickyness_sfnt_ids( TT_Face  face )\n  {\n#define TRICK_SFNT_IDS_PER_FACE   3\n#define TRICK_SFNT_IDS_NUM_FACES  17\n\n    static const tt_sfnt_id_rec sfnt_id[TRICK_SFNT_IDS_NUM_FACES]\n                                       [TRICK_SFNT_IDS_PER_FACE] = {\n\n#define TRICK_SFNT_ID_cvt   0\n#define TRICK_SFNT_ID_fpgm  1\n#define TRICK_SFNT_ID_prep  2\n\n      { /* MingLiU 1995 */\n        { 0x05BCF058UL, 0x000002E4UL }, /* cvt  */\n        { 0x28233BF1UL, 0x000087C4UL }, /* fpgm */\n        { 0xA344A1EAUL, 0x000001E1UL }  /* prep */\n      },\n      { /* MingLiU 1996- */\n        { 0x05BCF058UL, 0x000002E4UL }, /* cvt  */\n        { 0x28233BF1UL, 0x000087C4UL }, /* fpgm */\n        { 0xA344A1EBUL, 0x000001E1UL }  /* prep */\n      },\n      { /* DFKaiShu */\n        { 0x11E5EAD4UL, 0x00000350UL }, /* cvt  */\n        { 0x5A30CA3BUL, 0x00009063UL }, /* fpgm */\n        { 0x13A42602UL, 0x0000007EUL }  /* prep */\n      },\n      { /* HuaTianKaiTi */\n        { 0xFFFBFFFCUL, 0x00000008UL }, /* cvt  */\n        { 0x9C9E48B8UL, 0x0000BEA2UL }, /* fpgm */\n        { 0x70020112UL, 0x00000008UL }  /* prep */\n      },\n      { /* HuaTianSongTi */\n        { 0xFFFBFFFCUL, 0x00000008UL }, /* cvt  */\n        { 0x0A5A0483UL, 0x00017C39UL }, /* fpgm */\n        { 0x70020112UL, 0x00000008UL }  /* prep */\n      },\n      { /* NEC fadpop7.ttf */\n        { 0x00000000UL, 0x00000000UL }, /* cvt  */\n        { 0x40C92555UL, 0x000000E5UL }, /* fpgm */\n        { 0xA39B58E3UL, 0x0000117CUL }  /* prep */\n      },\n      { /* NEC fadrei5.ttf */\n        { 0x00000000UL, 0x00000000UL }, /* cvt  */\n        { 0x33C41652UL, 0x000000E5UL }, /* fpgm */\n        { 0x26D6C52AUL, 0x00000F6AUL }  /* prep */\n      },\n      { /* NEC fangot7.ttf */\n        { 0x00000000UL, 0x00000000UL }, /* cvt  */\n        { 0x6DB1651DUL, 0x0000019DUL }, /* fpgm */\n        { 0x6C6E4B03UL, 0x00002492UL }  /* prep */\n      },\n      { /* NEC fangyo5.ttf */\n        { 0x00000000UL, 0x00000000UL }, /* cvt  */\n        { 0x40C92555UL, 0x000000E5UL }, /* fpgm */\n        { 0xDE51FAD0UL, 0x0000117CUL }  /* prep */\n      },\n      { /* NEC fankyo5.ttf */\n        { 0x00000000UL, 0x00000000UL }, /* cvt  */\n        { 0x85E47664UL, 0x000000E5UL }, /* fpgm */\n        { 0xA6C62831UL, 0x00001CAAUL }  /* prep */\n      },\n      { /* NEC fanrgo5.ttf */\n        { 0x00000000UL, 0x00000000UL }, /* cvt  */\n        { 0x2D891CFDUL, 0x0000019DUL }, /* fpgm */\n        { 0xA0604633UL, 0x00001DE8UL }  /* prep */\n      },\n      { /* NEC fangot5.ttc */\n        { 0x00000000UL, 0x00000000UL }, /* cvt  */\n        { 0x40AA774CUL, 0x000001CBUL }, /* fpgm */\n        { 0x9B5CAA96UL, 0x00001F9AUL }  /* prep */\n      },\n      { /* NEC fanmin3.ttc */\n        { 0x00000000UL, 0x00000000UL }, /* cvt  */\n        { 0x0D3DE9CBUL, 0x00000141UL }, /* fpgm */\n        { 0xD4127766UL, 0x00002280UL }  /* prep */\n      },\n      { /* NEC FA-Gothic, 1996 */\n        { 0x00000000UL, 0x00000000UL }, /* cvt  */\n        { 0x4A692698UL, 0x000001F0UL }, /* fpgm */\n        { 0x340D4346UL, 0x00001FCAUL }  /* prep */\n      },\n      { /* NEC FA-Minchou, 1996 */\n        { 0x00000000UL, 0x00000000UL }, /* cvt  */\n        { 0xCD34C604UL, 0x00000166UL }, /* fpgm */\n        { 0x6CF31046UL, 0x000022B0UL }  /* prep */\n      },\n      { /* NEC FA-RoundGothicB, 1996 */\n        { 0x00000000UL, 0x00000000UL }, /* cvt  */\n        { 0x5DA75315UL, 0x0000019DUL }, /* fpgm */\n        { 0x40745A5FUL, 0x000022E0UL }  /* prep */\n      },\n      { /* NEC FA-RoundGothicM, 1996 */\n        { 0x00000000UL, 0x00000000UL }, /* cvt  */\n        { 0xF055FC48UL, 0x000001C2UL }, /* fpgm */\n        { 0x3900DED3UL, 0x00001E18UL }  /* prep */\n      }\n    };\n\n    FT_ULong   checksum;\n    int        num_matched_ids[TRICK_SFNT_IDS_NUM_FACES];\n    FT_Bool    has_cvt, has_fpgm, has_prep;\n    FT_UShort  i;\n    int        j, k;\n\n\n    FT_MEM_SET( num_matched_ids, 0,\n                sizeof ( int ) * TRICK_SFNT_IDS_NUM_FACES );\n    has_cvt  = FALSE;\n    has_fpgm = FALSE;\n    has_prep = FALSE;\n\n    for ( i = 0; i < face->num_tables; i++ )\n    {\n      checksum = 0;\n\n      switch( face->dir_tables[i].Tag )\n      {\n      case TTAG_cvt:\n        k = TRICK_SFNT_ID_cvt;\n        has_cvt  = TRUE;\n        break;\n\n      case TTAG_fpgm:\n        k = TRICK_SFNT_ID_fpgm;\n        has_fpgm = TRUE;\n        break;\n\n      case TTAG_prep:\n        k = TRICK_SFNT_ID_prep;\n        has_prep = TRUE;\n        break;\n\n      default:\n        continue;\n      }\n\n      for ( j = 0; j < TRICK_SFNT_IDS_NUM_FACES; j++ )\n        if ( face->dir_tables[i].Length == sfnt_id[j][k].Length )\n        {\n          if ( !checksum )\n            checksum = tt_get_sfnt_checksum( face, i );\n\n          if ( sfnt_id[j][k].CheckSum == checksum )\n            num_matched_ids[j]++;\n\n          if ( num_matched_ids[j] == TRICK_SFNT_IDS_PER_FACE )\n            return TRUE;\n        }\n    }\n\n    for ( j = 0; j < TRICK_SFNT_IDS_NUM_FACES; j++ )\n    {\n      if ( !has_cvt  && !sfnt_id[j][TRICK_SFNT_ID_cvt].Length )\n        num_matched_ids[j] ++;\n      if ( !has_fpgm && !sfnt_id[j][TRICK_SFNT_ID_fpgm].Length )\n        num_matched_ids[j] ++;\n      if ( !has_prep && !sfnt_id[j][TRICK_SFNT_ID_prep].Length )\n        num_matched_ids[j] ++;\n      if ( num_matched_ids[j] == TRICK_SFNT_IDS_PER_FACE )\n        return TRUE;\n    }\n\n    return FALSE;\n  }\n\n\n  static FT_Bool\n  tt_check_trickyness( FT_Face  face )\n  {\n    if ( !face )\n      return FALSE;\n\n    /* For first, check the face name for quick check. */\n    if ( face->family_name                               &&\n         tt_check_trickyness_family( face->family_name ) )\n      return TRUE;\n\n    /* Type42 fonts may lack `name' tables, we thus try to identify */\n    /* tricky fonts by checking the checksums of Type42-persistent  */\n    /* sfnt tables (`cvt', `fpgm', and `prep').                     */\n    if ( tt_check_trickyness_sfnt_ids( (TT_Face)face ) )\n      return TRUE;\n\n    return FALSE;\n  }\n\n\n  /* Check whether `.notdef' is the only glyph in the `loca' table. */\n  static FT_Bool\n  tt_check_single_notdef( FT_Face  ttface )\n  {\n    FT_Bool   result = FALSE;\n\n    TT_Face   face = (TT_Face)ttface;\n    FT_UInt   asize;\n    FT_ULong  i;\n    FT_ULong  glyph_index = 0;\n    FT_UInt   count       = 0;\n\n\n    for( i = 0; i < face->num_locations; i++ )\n    {\n      tt_face_get_location( face, i, &asize );\n      if ( asize > 0 )\n      {\n        count += 1;\n        if ( count > 1 )\n          break;\n        glyph_index = i;\n      }\n    }\n\n    /* Only have a single outline. */\n    if ( count == 1 )\n    {\n      if ( glyph_index == 0 )\n        result = TRUE;\n      else\n      {\n        /* FIXME: Need to test glyphname == .notdef ? */\n        FT_Error error;\n        char buf[8];\n\n\n        error = FT_Get_Glyph_Name( ttface, glyph_index, buf, 8 );\n        if ( !error                                            &&\n             buf[0] == '.' && !ft_strncmp( buf, \".notdef\", 8 ) )\n          result = TRUE;\n      }\n    }\n\n    return result;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_init                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initialize a given TrueType face object.                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream     :: The source font stream.                              */\n  /*                                                                       */\n  /*    face_index :: The index of the font face in the resource.          */\n  /*                                                                       */\n  /*    num_params :: Number of additional generic parameters.  Ignored.   */\n  /*                                                                       */\n  /*    params     :: Additional generic parameters.  Ignored.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: The newly built face object.                         */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_init( FT_Stream      stream,\n                FT_Face        ttface,      /* TT_Face */\n                FT_Int         face_index,\n                FT_Int         num_params,\n                FT_Parameter*  params )\n  {\n    FT_Error      error;\n    FT_Library    library;\n    SFNT_Service  sfnt;\n    TT_Face       face = (TT_Face)ttface;\n\n\n    FT_TRACE2(( \"TTF driver\\n\" ));\n\n    library = ttface->driver->root.library;\n\n    sfnt = (SFNT_Service)FT_Get_Module_Interface( library, \"sfnt\" );\n    if ( !sfnt )\n    {\n      FT_ERROR(( \"tt_face_init: cannot access `sfnt' module\\n\" ));\n      error = FT_THROW( Missing_Module );\n      goto Exit;\n    }\n\n    /* create input stream from resource */\n    if ( FT_STREAM_SEEK( 0 ) )\n      goto Exit;\n\n    /* check that we have a valid TrueType file */\n    error = sfnt->init_face( stream, face, face_index, num_params, params );\n\n    /* Stream may have changed. */\n    stream = face->root.stream;\n\n    if ( error )\n      goto Exit;\n\n    /* We must also be able to accept Mac/GX fonts, as well as OT ones. */\n    /* The 0x00020000 tag is completely undocumented; some fonts from   */\n    /* Arphic made for Chinese Windows 3.1 have this.                   */\n    if ( face->format_tag != 0x00010000L &&    /* MS fonts  */\n         face->format_tag != 0x00020000L &&    /* CJK fonts for Win 3.1 */\n         face->format_tag != TTAG_true   )     /* Mac fonts */\n    {\n      FT_TRACE2(( \"  not a TTF font\\n\" ));\n      goto Bad_Format;\n    }\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n    ttface->face_flags |= FT_FACE_FLAG_HINTER;\n#endif\n\n    /* If we are performing a simple font format check, exit immediately. */\n    if ( face_index < 0 )\n      return FT_Err_Ok;\n\n    /* Load font directory */\n    error = sfnt->load_face( stream, face, face_index, num_params, params );\n    if ( error )\n      goto Exit;\n\n    if ( tt_check_trickyness( ttface ) )\n      ttface->face_flags |= FT_FACE_FLAG_TRICKY;\n\n    error = tt_face_load_hdmx( face, stream );\n    if ( error )\n      goto Exit;\n\n    if ( FT_IS_SCALABLE( ttface ) )\n    {\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n\n      if ( !ttface->internal->incremental_interface )\n        error = tt_face_load_loca( face, stream );\n      if ( !error )\n        error = tt_face_load_cvt( face, stream );\n      if ( !error )\n        error = tt_face_load_fpgm( face, stream );\n      if ( !error )\n        error = tt_face_load_prep( face, stream );\n\n      /* Check the scalable flag based on `loca'. */\n      if ( !ttface->internal->incremental_interface &&\n           ttface->num_fixed_sizes                  &&\n           face->glyph_locations                    &&\n           tt_check_single_notdef( ttface )         )\n      {\n        FT_TRACE5(( \"tt_face_init:\"\n                    \" Only the `.notdef' glyph has an outline.\\n\"\n                    \"             \"\n                    \" Resetting scalable flag to FALSE.\\n\" ));\n\n        ttface->face_flags &= ~FT_FACE_FLAG_SCALABLE;\n      }\n\n#else\n\n      if ( !error )\n        error = tt_face_load_loca( face, stream );\n      if ( !error )\n        error = tt_face_load_cvt( face, stream );\n      if ( !error )\n        error = tt_face_load_fpgm( face, stream );\n      if ( !error )\n        error = tt_face_load_prep( face, stream );\n\n      /* Check the scalable flag based on `loca'. */\n      if ( ttface->num_fixed_sizes          &&\n           face->glyph_locations            &&\n           tt_check_single_notdef( ttface ) )\n      {\n        FT_TRACE5(( \"tt_face_init:\"\n                    \" Only the `.notdef' glyph has an outline.\\n\"\n                    \"             \"\n                    \" Resetting scalable flag to FALSE.\\n\" ));\n\n        ttface->face_flags &= ~FT_FACE_FLAG_SCALABLE;\n      }\n\n#endif\n\n    }\n\n#if defined( TT_CONFIG_OPTION_UNPATENTED_HINTING    ) && \\\n    !defined( TT_CONFIG_OPTION_BYTECODE_INTERPRETER )\n\n    {\n      FT_Bool  unpatented_hinting;\n      int      i;\n\n\n      /* Determine whether unpatented hinting is to be used for this face. */\n      unpatented_hinting = FT_BOOL\n        ( library->debug_hooks[FT_DEBUG_HOOK_UNPATENTED_HINTING] != NULL );\n\n      for ( i = 0; i < num_params && !face->unpatented_hinting; i++ )\n        if ( params[i].tag == FT_PARAM_TAG_UNPATENTED_HINTING )\n          unpatented_hinting = TRUE;\n\n      if ( !unpatented_hinting )\n        ttface->internal->ignore_unpatented_hinter = TRUE;\n    }\n\n#endif /* TT_CONFIG_OPTION_UNPATENTED_HINTING &&\n          !TT_CONFIG_OPTION_BYTECODE_INTERPRETER */\n\n    /* initialize standard glyph loading routines */\n    TT_Init_Glyph_Loading( face );\n\n  Exit:\n    return error;\n\n  Bad_Format:\n    error = FT_THROW( Unknown_File_Format );\n    goto Exit;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_done                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Finalize a given face object.                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A pointer to the face object to destroy.                   */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  tt_face_done( FT_Face  ttface )           /* TT_Face */\n  {\n    TT_Face       face = (TT_Face)ttface;\n    FT_Memory     memory;\n    FT_Stream     stream;\n    SFNT_Service  sfnt;\n\n\n    if ( !face )\n      return;\n\n    memory = ttface->memory;\n    stream = ttface->stream;\n    sfnt   = (SFNT_Service)face->sfnt;\n\n    /* for `extended TrueType formats' (i.e. compressed versions) */\n    if ( face->extra.finalizer )\n      face->extra.finalizer( face->extra.data );\n\n    if ( sfnt )\n      sfnt->done_face( face );\n\n    /* freeing the locations table */\n    tt_face_done_loca( face );\n\n    tt_face_free_hdmx( face );\n\n    /* freeing the CVT */\n    FT_FREE( face->cvt );\n    face->cvt_size = 0;\n\n    /* freeing the programs */\n    FT_FRAME_RELEASE( face->font_program );\n    FT_FRAME_RELEASE( face->cvt_program );\n    face->font_program_size = 0;\n    face->cvt_program_size  = 0;\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n    tt_done_blend( memory, face->blend );\n    face->blend = NULL;\n#endif\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                           SIZE  FUNCTIONS                             */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_size_run_fpgm                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Run the font program.                                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    size     :: A handle to the size object.                           */\n  /*                                                                       */\n  /*    pedantic :: Set if bytecode execution should be pedantic.          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_size_run_fpgm( TT_Size  size,\n                    FT_Bool  pedantic )\n  {\n    TT_Face         face = (TT_Face)size->root.face;\n    TT_ExecContext  exec;\n    FT_Error        error;\n\n\n    /* debugging instances have their own context */\n    if ( size->debug )\n      exec = size->context;\n    else\n      exec = ( (TT_Driver)FT_FACE_DRIVER( face ) )->context;\n\n    if ( !exec )\n      return FT_THROW( Could_Not_Find_Context );\n\n    error = TT_Load_Context( exec, face, size );\n    if ( error )\n      return error;\n\n    exec->callTop = 0;\n    exec->top     = 0;\n\n    exec->period    = 64;\n    exec->phase     = 0;\n    exec->threshold = 0;\n\n    exec->instruction_trap = FALSE;\n    exec->F_dot_P          = 0x4000L;\n\n    exec->pedantic_hinting = pedantic;\n\n    {\n      FT_Size_Metrics*  metrics    = &exec->metrics;\n      TT_Size_Metrics*  tt_metrics = &exec->tt_metrics;\n\n\n      metrics->x_ppem   = 0;\n      metrics->y_ppem   = 0;\n      metrics->x_scale  = 0;\n      metrics->y_scale  = 0;\n\n      tt_metrics->ppem  = 0;\n      tt_metrics->scale = 0;\n      tt_metrics->ratio = 0x10000L;\n    }\n\n    /* allow font program execution */\n    TT_Set_CodeRange( exec,\n                      tt_coderange_font,\n                      face->font_program,\n                      face->font_program_size );\n\n    /* disable CVT and glyph programs coderange */\n    TT_Clear_CodeRange( exec, tt_coderange_cvt );\n    TT_Clear_CodeRange( exec, tt_coderange_glyph );\n\n    if ( face->font_program_size > 0 )\n    {\n      TT_Goto_CodeRange( exec, tt_coderange_font, 0 );\n\n      FT_TRACE4(( \"Executing `fpgm' table.\\n\" ));\n      error = face->interpreter( exec );\n    }\n    else\n      error = FT_Err_Ok;\n\n    size->bytecode_ready = error;\n\n    if ( !error )\n      TT_Save_Context( exec, size );\n\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_size_run_prep                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Run the control value program.                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    size     :: A handle to the size object.                           */\n  /*                                                                       */\n  /*    pedantic :: Set if bytecode execution should be pedantic.          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_size_run_prep( TT_Size  size,\n                    FT_Bool  pedantic )\n  {\n    TT_Face         face = (TT_Face)size->root.face;\n    TT_ExecContext  exec;\n    FT_Error        error;\n\n\n    /* debugging instances have their own context */\n    if ( size->debug )\n      exec = size->context;\n    else\n      exec = ( (TT_Driver)FT_FACE_DRIVER( face ) )->context;\n\n    if ( !exec )\n      return FT_THROW( Could_Not_Find_Context );\n\n    error = TT_Load_Context( exec, face, size );\n    if ( error )\n      return error;\n\n    exec->callTop = 0;\n    exec->top     = 0;\n\n    exec->instruction_trap = FALSE;\n\n    exec->pedantic_hinting = pedantic;\n\n    TT_Set_CodeRange( exec,\n                      tt_coderange_cvt,\n                      face->cvt_program,\n                      face->cvt_program_size );\n\n    TT_Clear_CodeRange( exec, tt_coderange_glyph );\n\n    if ( face->cvt_program_size > 0 )\n    {\n      TT_Goto_CodeRange( exec, tt_coderange_cvt, 0 );\n\n      if ( !size->debug )\n      {\n        FT_TRACE4(( \"Executing `prep' table.\\n\" ));\n\n        error = face->interpreter( exec );\n      }\n    }\n    else\n      error = FT_Err_Ok;\n\n    size->cvt_ready = error;\n\n    /* UNDOCUMENTED!  The MS rasterizer doesn't allow the following */\n    /* graphics state variables to be modified by the CVT program.  */\n\n    exec->GS.dualVector.x = 0x4000;\n    exec->GS.dualVector.y = 0;\n    exec->GS.projVector.x = 0x4000;\n    exec->GS.projVector.y = 0x0;\n    exec->GS.freeVector.x = 0x4000;\n    exec->GS.freeVector.y = 0x0;\n\n    exec->GS.rp0 = 0;\n    exec->GS.rp1 = 0;\n    exec->GS.rp2 = 0;\n\n    exec->GS.gep0 = 1;\n    exec->GS.gep1 = 1;\n    exec->GS.gep2 = 1;\n\n    exec->GS.loop = 1;\n\n    /* save as default graphics state */\n    size->GS = exec->GS;\n\n    TT_Save_Context( exec, size );\n\n    return error;\n  }\n\n\n  static void\n  tt_size_done_bytecode( FT_Size  ftsize )\n  {\n    TT_Size    size   = (TT_Size)ftsize;\n    TT_Face    face   = (TT_Face)ftsize->face;\n    FT_Memory  memory = face->root.memory;\n\n\n    if ( size->debug )\n    {\n      /* the debug context must be deleted by the debugger itself */\n      size->context = NULL;\n      size->debug   = FALSE;\n    }\n\n    FT_FREE( size->cvt );\n    size->cvt_size = 0;\n\n    /* free storage area */\n    FT_FREE( size->storage );\n    size->storage_size = 0;\n\n    /* twilight zone */\n    tt_glyphzone_done( &size->twilight );\n\n    FT_FREE( size->function_defs );\n    FT_FREE( size->instruction_defs );\n\n    size->num_function_defs    = 0;\n    size->max_function_defs    = 0;\n    size->num_instruction_defs = 0;\n    size->max_instruction_defs = 0;\n\n    size->max_func = 0;\n    size->max_ins  = 0;\n\n    size->bytecode_ready = -1;\n    size->cvt_ready      = -1;\n  }\n\n\n  /* Initialize bytecode-related fields in the size object.       */\n  /* We do this only if bytecode interpretation is really needed. */\n  static FT_Error\n  tt_size_init_bytecode( FT_Size  ftsize,\n                         FT_Bool  pedantic )\n  {\n    FT_Error   error;\n    TT_Size    size = (TT_Size)ftsize;\n    TT_Face    face = (TT_Face)ftsize->face;\n    FT_Memory  memory = face->root.memory;\n\n    FT_UShort       n_twilight;\n    TT_MaxProfile*  maxp = &face->max_profile;\n\n\n    size->bytecode_ready = -1;\n    size->cvt_ready      = -1;\n\n    size->max_function_defs    = maxp->maxFunctionDefs;\n    size->max_instruction_defs = maxp->maxInstructionDefs;\n\n    size->num_function_defs    = 0;\n    size->num_instruction_defs = 0;\n\n    size->max_func = 0;\n    size->max_ins  = 0;\n\n    size->cvt_size     = face->cvt_size;\n    size->storage_size = maxp->maxStorage;\n\n    /* Set default metrics */\n    {\n      TT_Size_Metrics*  metrics = &size->ttmetrics;\n\n\n      metrics->rotated   = FALSE;\n      metrics->stretched = FALSE;\n\n      /* set default engine compensation */\n      metrics->compensations[0] = 0;   /* gray     */\n      metrics->compensations[1] = 0;   /* black    */\n      metrics->compensations[2] = 0;   /* white    */\n      metrics->compensations[3] = 0;   /* reserved */\n    }\n\n    /* allocate function defs, instruction defs, cvt, and storage area */\n    if ( FT_NEW_ARRAY( size->function_defs,    size->max_function_defs    ) ||\n         FT_NEW_ARRAY( size->instruction_defs, size->max_instruction_defs ) ||\n         FT_NEW_ARRAY( size->cvt,              size->cvt_size             ) ||\n         FT_NEW_ARRAY( size->storage,          size->storage_size         ) )\n      goto Exit;\n\n    /* reserve twilight zone */\n    n_twilight = maxp->maxTwilightPoints;\n\n    /* there are 4 phantom points (do we need this?) */\n    n_twilight += 4;\n\n    error = tt_glyphzone_new( memory, n_twilight, 0, &size->twilight );\n    if ( error )\n      goto Exit;\n\n    size->twilight.n_points = n_twilight;\n\n    size->GS = tt_default_graphics_state;\n\n    /* set `face->interpreter' according to the debug hook present */\n    {\n      FT_Library  library = face->root.driver->root.library;\n\n\n      face->interpreter = (TT_Interpreter)\n                            library->debug_hooks[FT_DEBUG_HOOK_TRUETYPE];\n      if ( !face->interpreter )\n        face->interpreter = (TT_Interpreter)TT_RunIns;\n    }\n\n    /* Fine, now run the font program! */\n    error = tt_size_run_fpgm( size, pedantic );\n\n  Exit:\n    if ( error )\n      tt_size_done_bytecode( ftsize );\n\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  tt_size_ready_bytecode( TT_Size  size,\n                          FT_Bool  pedantic )\n  {\n    FT_Error  error = FT_Err_Ok;\n\n\n    if ( size->bytecode_ready < 0 )\n      error = tt_size_init_bytecode( (FT_Size)size, pedantic );\n\n    if ( error || size->bytecode_ready )\n      goto Exit;\n\n    /* rescale CVT when needed */\n    if ( size->cvt_ready < 0 )\n    {\n      FT_UInt  i;\n      TT_Face  face = (TT_Face)size->root.face;\n\n\n      /* Scale the cvt values to the new ppem.          */\n      /* We use by default the y ppem to scale the CVT. */\n      for ( i = 0; i < size->cvt_size; i++ )\n        size->cvt[i] = FT_MulFix( face->cvt[i], size->ttmetrics.scale );\n\n      /* all twilight points are originally zero */\n      for ( i = 0; i < (FT_UInt)size->twilight.n_points; i++ )\n      {\n        size->twilight.org[i].x = 0;\n        size->twilight.org[i].y = 0;\n        size->twilight.cur[i].x = 0;\n        size->twilight.cur[i].y = 0;\n      }\n\n      /* clear storage area */\n      for ( i = 0; i < (FT_UInt)size->storage_size; i++ )\n        size->storage[i] = 0;\n\n      size->GS = tt_default_graphics_state;\n\n      error = tt_size_run_prep( size, pedantic );\n    }\n\n  Exit:\n    return error;\n  }\n\n#endif /* TT_USE_BYTECODE_INTERPRETER */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_size_init                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initialize a new TrueType size object.                             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    size :: A handle to the size object.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_size_init( FT_Size  ttsize )           /* TT_Size */\n  {\n    TT_Size   size  = (TT_Size)ttsize;\n    FT_Error  error = FT_Err_Ok;\n\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n    size->bytecode_ready = -1;\n    size->cvt_ready      = -1;\n#endif\n\n    size->ttmetrics.valid = FALSE;\n    size->strike_index    = 0xFFFFFFFFUL;\n\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_size_done                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The TrueType size object finalizer.                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    size :: A handle to the target size object.                        */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  tt_size_done( FT_Size  ttsize )           /* TT_Size */\n  {\n    TT_Size  size = (TT_Size)ttsize;\n\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n    tt_size_done_bytecode( ttsize );\n#endif\n\n    size->ttmetrics.valid = FALSE;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_size_reset                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Reset a TrueType size when resolutions and character dimensions    */\n  /*    have been changed.                                                 */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    size :: A handle to the target size object.                        */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_size_reset( TT_Size  size )\n  {\n    TT_Face           face;\n    FT_Error          error = FT_Err_Ok;\n    FT_Size_Metrics*  metrics;\n\n\n    size->ttmetrics.valid = FALSE;\n\n    face = (TT_Face)size->root.face;\n\n    metrics = &size->metrics;\n\n    /* copy the result from base layer */\n    *metrics = size->root.metrics;\n\n    if ( metrics->x_ppem < 1 || metrics->y_ppem < 1 )\n      return FT_THROW( Invalid_PPem );\n\n    /* This bit flag, if set, indicates that the ppems must be       */\n    /* rounded to integers.  Nearly all TrueType fonts have this bit */\n    /* set, as hinting won't work really well otherwise.             */\n    /*                                                               */\n    if ( face->header.Flags & 8 )\n    {\n      metrics->x_scale = FT_DivFix( metrics->x_ppem << 6,\n                                    face->root.units_per_EM );\n      metrics->y_scale = FT_DivFix( metrics->y_ppem << 6,\n                                    face->root.units_per_EM );\n\n      metrics->ascender =\n        FT_PIX_ROUND( FT_MulFix( face->root.ascender, metrics->y_scale ) );\n      metrics->descender =\n        FT_PIX_ROUND( FT_MulFix( face->root.descender, metrics->y_scale ) );\n      metrics->height =\n        FT_PIX_ROUND( FT_MulFix( face->root.height, metrics->y_scale ) );\n      metrics->max_advance =\n        FT_PIX_ROUND( FT_MulFix( face->root.max_advance_width,\n                                 metrics->x_scale ) );\n    }\n\n    /* compute new transformation */\n    if ( metrics->x_ppem >= metrics->y_ppem )\n    {\n      size->ttmetrics.scale   = metrics->x_scale;\n      size->ttmetrics.ppem    = metrics->x_ppem;\n      size->ttmetrics.x_ratio = 0x10000L;\n      size->ttmetrics.y_ratio = FT_DivFix( metrics->y_ppem,\n                                           metrics->x_ppem );\n    }\n    else\n    {\n      size->ttmetrics.scale   = metrics->y_scale;\n      size->ttmetrics.ppem    = metrics->y_ppem;\n      size->ttmetrics.x_ratio = FT_DivFix( metrics->x_ppem,\n                                           metrics->y_ppem );\n      size->ttmetrics.y_ratio = 0x10000L;\n    }\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n    size->cvt_ready = -1;\n#endif /* TT_USE_BYTECODE_INTERPRETER */\n\n    if ( !error )\n      size->ttmetrics.valid = TRUE;\n\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_driver_init                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initialize a given TrueType driver object.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    driver :: A handle to the target driver object.                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_driver_init( FT_Module  ttdriver )     /* TT_Driver */\n  {\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n\n    TT_Driver  driver = (TT_Driver)ttdriver;\n\n\n    if ( !TT_New_Context( driver ) )\n      return FT_THROW( Could_Not_Find_Context );\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n    driver->interpreter_version = TT_INTERPRETER_VERSION_38;\n#else\n    driver->interpreter_version = TT_INTERPRETER_VERSION_35;\n#endif\n\n#else /* !TT_USE_BYTECODE_INTERPRETER */\n\n    FT_UNUSED( ttdriver );\n\n#endif /* !TT_USE_BYTECODE_INTERPRETER */\n\n    return FT_Err_Ok;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_driver_done                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Finalize a given TrueType driver.                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    driver :: A handle to the target TrueType driver.                  */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  tt_driver_done( FT_Module  ttdriver )     /* TT_Driver */\n  {\n#ifdef TT_USE_BYTECODE_INTERPRETER\n    TT_Driver  driver = (TT_Driver)ttdriver;\n\n\n    /* destroy the execution context */\n    if ( driver->context )\n    {\n      TT_Done_Context( driver->context );\n      driver->context = NULL;\n    }\n#else\n    FT_UNUSED( ttdriver );\n#endif\n\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_slot_init                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initialize a new slot object.                                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    slot :: A handle to the slot object.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_slot_init( FT_GlyphSlot  slot )\n  {\n    return FT_GlyphLoader_CreateExtra( slot->internal->loader );\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/truetype/ttobjs.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttobjs.h                                                               */\n/*                                                                         */\n/*    Objects manager (specification).                                     */\n/*                                                                         */\n/*  Copyright 1996-2009, 2011-2014 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTOBJS_H__\n#define __TTOBJS_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_TRUETYPE_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    TT_Driver                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a TrueType driver object.                              */\n  /*                                                                       */\n  typedef struct TT_DriverRec_*  TT_Driver;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    TT_Instance                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a TrueType size object.                                */\n  /*                                                                       */\n  typedef struct TT_SizeRec_*  TT_Size;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    TT_GlyphSlot                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a TrueType glyph slot object.                          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This is a direct typedef of FT_GlyphSlot, as there is nothing      */\n  /*    specific about the TrueType glyph slot.                            */\n  /*                                                                       */\n  typedef FT_GlyphSlot  TT_GlyphSlot;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_GraphicsState                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The TrueType graphics state used during bytecode interpretation.   */\n  /*                                                                       */\n  typedef struct  TT_GraphicsState_\n  {\n    FT_UShort      rp0;\n    FT_UShort      rp1;\n    FT_UShort      rp2;\n\n    FT_UnitVector  dualVector;\n    FT_UnitVector  projVector;\n    FT_UnitVector  freeVector;\n\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\n    FT_Bool        both_x_axis;\n#endif\n\n    FT_Long        loop;\n    FT_F26Dot6     minimum_distance;\n    FT_Int         round_state;\n\n    FT_Bool        auto_flip;\n    FT_F26Dot6     control_value_cutin;\n    FT_F26Dot6     single_width_cutin;\n    FT_F26Dot6     single_width_value;\n    FT_UShort      delta_base;\n    FT_UShort      delta_shift;\n\n    FT_Byte        instruct_control;\n    /* According to Greg Hitchcock from Microsoft, the `scan_control'     */\n    /* variable as documented in the TrueType specification is a 32-bit   */\n    /* integer; the high-word part holds the SCANTYPE value, the low-word */\n    /* part the SCANCTRL value.  We separate it into two fields.          */\n    FT_Bool        scan_control;\n    FT_Int         scan_type;\n\n    FT_UShort      gep0;\n    FT_UShort      gep1;\n    FT_UShort      gep2;\n\n  } TT_GraphicsState;\n\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n\n  FT_LOCAL( void )\n  tt_glyphzone_done( TT_GlyphZone  zone );\n\n  FT_LOCAL( FT_Error )\n  tt_glyphzone_new( FT_Memory     memory,\n                    FT_UShort     maxPoints,\n                    FT_Short      maxContours,\n                    TT_GlyphZone  zone );\n\n#endif /* TT_USE_BYTECODE_INTERPRETER */\n\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  EXECUTION SUBTABLES                                                  */\n  /*                                                                       */\n  /*  These sub-tables relate to instruction execution.                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#define TT_MAX_CODE_RANGES  3\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* There can only be 3 active code ranges at once:                       */\n  /*   - the Font Program                                                  */\n  /*   - the CVT Program                                                   */\n  /*   - a glyph's instructions set                                        */\n  /*                                                                       */\n  typedef enum  TT_CodeRange_Tag_\n  {\n    tt_coderange_none = 0,\n    tt_coderange_font,\n    tt_coderange_cvt,\n    tt_coderange_glyph\n\n  } TT_CodeRange_Tag;\n\n\n  typedef struct  TT_CodeRange_\n  {\n    FT_Byte*  base;\n    FT_ULong  size;\n\n  } TT_CodeRange;\n\n  typedef TT_CodeRange  TT_CodeRangeTable[TT_MAX_CODE_RANGES];\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Defines a function/instruction definition record.                     */\n  /*                                                                       */\n  typedef struct  TT_DefRecord_\n  {\n    FT_Int    range;          /* in which code range is it located?     */\n    FT_Long   start;          /* where does it start?                   */\n    FT_Long   end;            /* where does it end?                     */\n    FT_UInt   opc;            /* function #, or instruction code        */\n    FT_Bool   active;         /* is it active?                          */\n    FT_Bool   inline_delta;   /* is function that defines inline delta? */\n    FT_ULong  sph_fdef_flags; /* flags to identify special functions    */\n\n  } TT_DefRecord, *TT_DefArray;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Subglyph transformation record.                                       */\n  /*                                                                       */\n  typedef struct  TT_Transform_\n  {\n    FT_Fixed    xx, xy;     /* transformation matrix coefficients */\n    FT_Fixed    yx, yy;\n    FT_F26Dot6  ox, oy;     /* offsets                            */\n\n  } TT_Transform;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* A note regarding non-squared pixels:                                  */\n  /*                                                                       */\n  /* (This text will probably go into some docs at some time; for now, it  */\n  /* is kept here to explain some definitions in the TT_Size_Metrics       */\n  /* record).                                                              */\n  /*                                                                       */\n  /* The CVT is a one-dimensional array containing values that control     */\n  /* certain important characteristics in a font, like the height of all   */\n  /* capitals, all lowercase letter, default spacing or stem width/height. */\n  /*                                                                       */\n  /* These values are found in FUnits in the font file, and must be scaled */\n  /* to pixel coordinates before being used by the CVT and glyph programs. */\n  /* Unfortunately, when using distinct x and y resolutions (or distinct x */\n  /* and y pointsizes), there are two possible scalings.                   */\n  /*                                                                       */\n  /* A first try was to implement a `lazy' scheme where all values were    */\n  /* scaled when first used.  However, while some values are always used   */\n  /* in the same direction, some others are used under many different      */\n  /* circumstances and orientations.                                       */\n  /*                                                                       */\n  /* I have found a simpler way to do the same, and it even seems to work  */\n  /* in most of the cases:                                                 */\n  /*                                                                       */\n  /* - All CVT values are scaled to the maximum ppem size.                 */\n  /*                                                                       */\n  /* - When performing a read or write in the CVT, a ratio factor is used  */\n  /*   to perform adequate scaling.  Example:                              */\n  /*                                                                       */\n  /*     x_ppem = 14                                                       */\n  /*     y_ppem = 10                                                       */\n  /*                                                                       */\n  /*   We choose ppem = x_ppem = 14 as the CVT scaling size.  All cvt      */\n  /*   entries are scaled to it.                                           */\n  /*                                                                       */\n  /*     x_ratio = 1.0                                                     */\n  /*     y_ratio = y_ppem/ppem (< 1.0)                                     */\n  /*                                                                       */\n  /*   We compute the current ratio like:                                  */\n  /*                                                                       */\n  /*   - If projVector is horizontal,                                      */\n  /*       ratio = x_ratio = 1.0                                           */\n  /*                                                                       */\n  /*   - if projVector is vertical,                                        */\n  /*       ratio = y_ratio                                                 */\n  /*                                                                       */\n  /*   - else,                                                             */\n  /*       ratio = sqrt( (proj.x * x_ratio) ^ 2 + (proj.y * y_ratio) ^ 2 ) */\n  /*                                                                       */\n  /*   Reading a cvt value returns                                         */\n  /*     ratio * cvt[index]                                                */\n  /*                                                                       */\n  /*   Writing a cvt value in pixels:                                      */\n  /*     cvt[index] / ratio                                                */\n  /*                                                                       */\n  /*   The current ppem is simply                                          */\n  /*     ratio * ppem                                                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Metrics used by the TrueType size and context objects.                */\n  /*                                                                       */\n  typedef struct  TT_Size_Metrics_\n  {\n    /* for non-square pixels */\n    FT_Long     x_ratio;\n    FT_Long     y_ratio;\n\n    FT_UShort   ppem;               /* maximum ppem size              */\n    FT_Long     ratio;              /* current ratio                  */\n    FT_Fixed    scale;\n\n    FT_F26Dot6  compensations[4];   /* device-specific compensations  */\n\n    FT_Bool     valid;\n\n    FT_Bool     rotated;            /* `is the glyph rotated?'-flag   */\n    FT_Bool     stretched;          /* `is the glyph stretched?'-flag */\n\n  } TT_Size_Metrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* TrueType size class.                                                  */\n  /*                                                                       */\n  typedef struct  TT_SizeRec_\n  {\n    FT_SizeRec         root;\n\n    /* we have our own copy of metrics so that we can modify */\n    /* it without affecting auto-hinting (when used)         */\n    FT_Size_Metrics    metrics;\n\n    TT_Size_Metrics    ttmetrics;\n\n    FT_ULong           strike_index;      /* 0xFFFFFFFF to indicate invalid */\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n\n    FT_UInt            num_function_defs; /* number of function definitions */\n    FT_UInt            max_function_defs;\n    TT_DefArray        function_defs;     /* table of function definitions  */\n\n    FT_UInt            num_instruction_defs;  /* number of ins. definitions */\n    FT_UInt            max_instruction_defs;\n    TT_DefArray        instruction_defs;      /* table of ins. definitions  */\n\n    FT_UInt            max_func;\n    FT_UInt            max_ins;\n\n    TT_CodeRangeTable  codeRangeTable;\n\n    TT_GraphicsState   GS;\n\n    FT_ULong           cvt_size;      /* the scaled control value table */\n    FT_Long*           cvt;\n\n    FT_UShort          storage_size; /* The storage area is now part of */\n    FT_Long*           storage;      /* the instance                    */\n\n    TT_GlyphZoneRec    twilight;     /* The instance's twilight zone    */\n\n    /* debugging variables */\n\n    /* When using the debugger, we must keep the */\n    /* execution context tied to the instance    */\n    /* object rather than asking it on demand.   */\n\n    FT_Bool            debug;\n    TT_ExecContext     context;\n\n    /* if negative, `fpgm' (resp. `prep'), wasn't executed yet; */\n    /* otherwise it is the returned error code                  */\n    FT_Error           bytecode_ready;\n    FT_Error           cvt_ready;\n\n#endif /* TT_USE_BYTECODE_INTERPRETER */\n\n  } TT_SizeRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* TrueType driver class.                                                */\n  /*                                                                       */\n  typedef struct  TT_DriverRec_\n  {\n    FT_DriverRec  root;\n\n    TT_ExecContext   context;  /* execution context        */\n    TT_GlyphZoneRec  zone;     /* glyph loader points zone */\n\n    FT_UInt  interpreter_version;\n\n  } TT_DriverRec;\n\n\n  /* Note: All of the functions below (except tt_size_reset()) are used    */\n  /* as function pointers in a FT_Driver_ClassRec.  Therefore their        */\n  /* parameters are of types FT_Face, FT_Size, etc., rather than TT_Face,  */\n  /* TT_Size, etc., so that the compiler can confirm that the types and    */\n  /* number of parameters are correct.  In all cases the FT_xxx types are  */\n  /* cast to their TT_xxx counterparts inside the functions since FreeType */\n  /* will always use the TT driver to create them.                         */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Face functions                                                        */\n  /*                                                                       */\n  FT_LOCAL( FT_Error )\n  tt_face_init( FT_Stream      stream,\n                FT_Face        ttface,      /* TT_Face */\n                FT_Int         face_index,\n                FT_Int         num_params,\n                FT_Parameter*  params );\n\n  FT_LOCAL( void )\n  tt_face_done( FT_Face  ttface );          /* TT_Face */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Size functions                                                        */\n  /*                                                                       */\n  FT_LOCAL( FT_Error )\n  tt_size_init( FT_Size  ttsize );          /* TT_Size */\n\n  FT_LOCAL( void )\n  tt_size_done( FT_Size  ttsize );          /* TT_Size */\n\n#ifdef TT_USE_BYTECODE_INTERPRETER\n\n  FT_LOCAL( FT_Error )\n  tt_size_run_fpgm( TT_Size  size,\n                    FT_Bool  pedantic );\n\n  FT_LOCAL( FT_Error )\n  tt_size_run_prep( TT_Size  size,\n                    FT_Bool  pedantic );\n\n  FT_LOCAL( FT_Error )\n  tt_size_ready_bytecode( TT_Size  size,\n                          FT_Bool  pedantic );\n\n#endif /* TT_USE_BYTECODE_INTERPRETER */\n\n  FT_LOCAL( FT_Error )\n  tt_size_reset( TT_Size  size );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Driver functions                                                      */\n  /*                                                                       */\n  FT_LOCAL( FT_Error )\n  tt_driver_init( FT_Module  ttdriver );    /* TT_Driver */\n\n  FT_LOCAL( void )\n  tt_driver_done( FT_Module  ttdriver );    /* TT_Driver */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Slot functions                                                        */\n  /*                                                                       */\n  FT_LOCAL( FT_Error )\n  tt_slot_init( FT_GlyphSlot  slot );\n\n\n  /* auxiliary */\n#define IS_HINTED( flags )  ( ( flags & FT_LOAD_NO_HINTING ) == 0 )\n\n\nFT_END_HEADER\n\n#endif /* __TTOBJS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/truetype/ttpic.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttpic.c                                                                */\n/*                                                                         */\n/*    The FreeType position independent code services for truetype module. */\n/*                                                                         */\n/*  Copyright 2009, 2010, 2012, 2013 by                                    */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_INTERNAL_OBJECTS_H\n#include \"ttpic.h\"\n#include \"tterrors.h\"\n\n\n#ifdef FT_CONFIG_OPTION_PIC\n\n  /* forward declaration of PIC init functions from ttdriver.c */\n  FT_Error\n  FT_Create_Class_tt_services( FT_Library           library,\n                               FT_ServiceDescRec**  output_class );\n  void\n  FT_Destroy_Class_tt_services( FT_Library          library,\n                                FT_ServiceDescRec*  clazz );\n  void\n  FT_Init_Class_tt_service_gx_multi_masters(\n    FT_Service_MultiMastersRec*  sv_mm );\n  void\n  FT_Init_Class_tt_service_truetype_glyf(\n    FT_Service_TTGlyfRec*  sv_ttglyf );\n\n\n  void\n  tt_driver_class_pic_free( FT_Library  library )\n  {\n    FT_PIC_Container*  pic_container = &library->pic_container;\n    FT_Memory          memory        = library->memory;\n\n\n    if ( pic_container->truetype )\n    {\n      TTModulePIC*  container = (TTModulePIC*)pic_container->truetype;\n\n\n      if ( container->tt_services )\n        FT_Destroy_Class_tt_services( library, container->tt_services );\n      container->tt_services = NULL;\n      FT_FREE( container );\n      pic_container->truetype = NULL;\n    }\n  }\n\n\n  FT_Error\n  tt_driver_class_pic_init( FT_Library  library )\n  {\n    FT_PIC_Container*  pic_container = &library->pic_container;\n    FT_Error           error         = FT_Err_Ok;\n    TTModulePIC*       container     = NULL;\n    FT_Memory          memory        = library->memory;\n\n\n    /* allocate pointer, clear and set global container pointer */\n    if ( FT_ALLOC( container, sizeof ( *container ) ) )\n      return error;\n    FT_MEM_SET( container, 0, sizeof ( *container ) );\n    pic_container->truetype = container;\n\n    /* initialize pointer table - this is how the module usually */\n    /* expects this data                                         */\n    error = FT_Create_Class_tt_services( library,\n                                         &container->tt_services );\n    if ( error )\n      goto Exit;\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n    FT_Init_Class_tt_service_gx_multi_masters(\n      &container->tt_service_gx_multi_masters );\n#endif\n    FT_Init_Class_tt_service_truetype_glyf(\n      &container->tt_service_truetype_glyf );\n\n  Exit:\n    if ( error )\n      tt_driver_class_pic_free( library );\n    return error;\n  }\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/truetype/ttpic.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttpic.h                                                                */\n/*                                                                         */\n/*    The FreeType position independent code services for truetype module. */\n/*                                                                         */\n/*  Copyright 2009, 2012, 2013 by                                          */\n/*  Oran Agra and Mickey Gabel.                                            */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTPIC_H__\n#define __TTPIC_H__\n\n\nFT_BEGIN_HEADER\n\n#ifndef FT_CONFIG_OPTION_PIC\n\n#define TT_SERVICES_GET                  tt_services\n#define TT_SERVICE_GX_MULTI_MASTERS_GET  tt_service_gx_multi_masters\n#define TT_SERVICE_TRUETYPE_GLYF_GET     tt_service_truetype_glyf\n#define TT_SERVICE_PROPERTIES_GET        tt_service_properties\n\n#else /* FT_CONFIG_OPTION_PIC */\n\n#include FT_MULTIPLE_MASTERS_H\n#include FT_SERVICE_MULTIPLE_MASTERS_H\n#include FT_SERVICE_TRUETYPE_GLYF_H\n#include FT_SERVICE_PROPERTIES_H\n\n\n  typedef struct  TTModulePIC_\n  {\n    FT_ServiceDescRec*          tt_services;\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n    FT_Service_MultiMastersRec  tt_service_gx_multi_masters;\n#endif\n    FT_Service_TTGlyfRec        tt_service_truetype_glyf;\n    FT_Service_PropertiesRec    tt_service_properties;\n\n  } TTModulePIC;\n\n\n#define GET_PIC( lib )                                      \\\n          ( (TTModulePIC*)((lib)->pic_container.truetype) )\n#define TT_SERVICES_GET                       \\\n          ( GET_PIC( library )->tt_services )\n#define TT_SERVICE_GX_MULTI_MASTERS_GET                       \\\n          ( GET_PIC( library )->tt_service_gx_multi_masters )\n#define TT_SERVICE_TRUETYPE_GLYF_GET                       \\\n          ( GET_PIC( library )->tt_service_truetype_glyf )\n#define TT_SERVICE_PROPERTIES_GET                       \\\n          ( GET_PIC( library )->tt_service_properties )\n\n\n  /* see ttpic.c for the implementation */\n  void\n  tt_driver_class_pic_free( FT_Library  library );\n\n  FT_Error\n  tt_driver_class_pic_init( FT_Library  library );\n\n#endif /* FT_CONFIG_OPTION_PIC */\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __TTPIC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/truetype/ttpload.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttpload.c                                                              */\n/*                                                                         */\n/*    TrueType-specific tables loader (body).                              */\n/*                                                                         */\n/*  Copyright 1996-2002, 2004-2013 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_STREAM_H\n#include FT_TRUETYPE_TAGS_H\n\n#include \"ttpload.h\"\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n#include \"ttgxvar.h\"\n#endif\n\n#include \"tterrors.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_ttpload\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_load_loca                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load the locations table.                                          */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream :: The input stream.                                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_load_loca( TT_Face    face,\n                     FT_Stream  stream )\n  {\n    FT_Error  error;\n    FT_ULong  table_len;\n    FT_Int    shift;\n\n\n    /* we need the size of the `glyf' table for malformed `loca' tables */\n    error = face->goto_table( face, TTAG_glyf, stream, &face->glyf_len );\n\n    /* it is possible that a font doesn't have a glyf table at all */\n    /* or its size is zero                                         */\n    if ( FT_ERR_EQ( error, Table_Missing ) )\n      face->glyf_len = 0;\n    else if ( error )\n      goto Exit;\n\n    FT_TRACE2(( \"Locations \" ));\n    error = face->goto_table( face, TTAG_loca, stream, &table_len );\n    if ( error )\n    {\n      error = FT_THROW( Locations_Missing );\n      goto Exit;\n    }\n\n    if ( face->header.Index_To_Loc_Format != 0 )\n    {\n      shift = 2;\n\n      if ( table_len >= 0x40000L )\n      {\n        FT_TRACE2(( \"table too large\\n\" ));\n        error = FT_THROW( Invalid_Table );\n        goto Exit;\n      }\n      face->num_locations = table_len >> shift;\n    }\n    else\n    {\n      shift = 1;\n\n      if ( table_len >= 0x20000L )\n      {\n        FT_TRACE2(( \"table too large\\n\" ));\n        error = FT_THROW( Invalid_Table );\n        goto Exit;\n      }\n      face->num_locations = table_len >> shift;\n    }\n\n    if ( face->num_locations != (FT_ULong)face->root.num_glyphs + 1 )\n    {\n      FT_TRACE2(( \"glyph count mismatch!  loca: %d, maxp: %d\\n\",\n                  face->num_locations - 1, face->root.num_glyphs ));\n\n      /* we only handle the case where `maxp' gives a larger value */\n      if ( face->num_locations <= (FT_ULong)face->root.num_glyphs )\n      {\n        FT_Long   new_loca_len =\n                    ( (FT_Long)( face->root.num_glyphs ) + 1 ) << shift;\n\n        TT_Table  entry = face->dir_tables;\n        TT_Table  limit = entry + face->num_tables;\n\n        FT_Long   pos  = FT_Stream_Pos( stream );\n        FT_Long   dist = 0x7FFFFFFFL;\n\n\n        /* compute the distance to next table in font file */\n        for ( ; entry < limit; entry++ )\n        {\n          FT_Long  diff = entry->Offset - pos;\n\n\n          if ( diff > 0 && diff < dist )\n            dist = diff;\n        }\n\n        if ( entry == limit )\n        {\n          /* `loca' is the last table */\n          dist = stream->size - pos;\n        }\n\n        if ( new_loca_len <= dist )\n        {\n          face->num_locations = face->root.num_glyphs + 1;\n          table_len           = new_loca_len;\n\n          FT_TRACE2(( \"adjusting num_locations to %d\\n\",\n                      face->num_locations ));\n        }\n      }\n    }\n\n    /*\n     * Extract the frame.  We don't need to decompress it since\n     * we are able to parse it directly.\n     */\n    if ( FT_FRAME_EXTRACT( table_len, face->glyph_locations ) )\n      goto Exit;\n\n    FT_TRACE2(( \"loaded\\n\" ));\n\n  Exit:\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_ULong )\n  tt_face_get_location( TT_Face   face,\n                        FT_UInt   gindex,\n                        FT_UInt  *asize )\n  {\n    FT_ULong  pos1, pos2;\n    FT_Byte*  p;\n    FT_Byte*  p_limit;\n\n\n    pos1 = pos2 = 0;\n\n    if ( gindex < face->num_locations )\n    {\n      if ( face->header.Index_To_Loc_Format != 0 )\n      {\n        p       = face->glyph_locations + gindex * 4;\n        p_limit = face->glyph_locations + face->num_locations * 4;\n\n        pos1 = FT_NEXT_ULONG( p );\n        pos2 = pos1;\n\n        if ( p + 4 <= p_limit )\n          pos2 = FT_NEXT_ULONG( p );\n      }\n      else\n      {\n        p       = face->glyph_locations + gindex * 2;\n        p_limit = face->glyph_locations + face->num_locations * 2;\n\n        pos1 = FT_NEXT_USHORT( p );\n        pos2 = pos1;\n\n        if ( p + 2 <= p_limit )\n          pos2 = FT_NEXT_USHORT( p );\n\n        pos1 <<= 1;\n        pos2 <<= 1;\n      }\n    }\n\n    /* Check broken location data */\n    if ( pos1 > face->glyf_len )\n    {\n      FT_TRACE1(( \"tt_face_get_location:\"\n                  \" too large offset=0x%08lx found for gid=0x%04lx,\"\n                  \" exceeding the end of glyf table (0x%08lx)\\n\",\n                  pos1, gindex, face->glyf_len ));\n      *asize = 0;\n      return 0;\n    }\n\n    if ( pos2 > face->glyf_len )\n    {\n      FT_TRACE1(( \"tt_face_get_location:\"\n                  \" too large offset=0x%08lx found for gid=0x%04lx,\"\n                  \" truncate at the end of glyf table (0x%08lx)\\n\",\n                  pos2, gindex + 1, face->glyf_len ));\n      pos2 = face->glyf_len;\n    }\n\n    /* The `loca' table must be ordered; it refers to the length of */\n    /* an entry as the difference between the current and the next  */\n    /* position.  However, there do exist (malformed) fonts which   */\n    /* don't obey this rule, so we are only able to provide an      */\n    /* upper bound for the size.                                    */\n    /*                                                              */\n    /* We get (intentionally) a wrong, non-zero result in case the  */\n    /* `glyf' table is missing.                                     */\n    if ( pos2 >= pos1 )\n      *asize = (FT_UInt)( pos2 - pos1 );\n    else\n      *asize = (FT_UInt)( face->glyf_len - pos1 );\n\n    return pos1;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  tt_face_done_loca( TT_Face  face )\n  {\n    FT_Stream  stream = face->root.stream;\n\n\n    FT_FRAME_RELEASE( face->glyph_locations );\n    face->num_locations = 0;\n  }\n\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_load_cvt                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load the control value table into a face object.                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream :: A handle to the input stream.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_load_cvt( TT_Face    face,\n                    FT_Stream  stream )\n  {\n#ifdef TT_USE_BYTECODE_INTERPRETER\n\n    FT_Error   error;\n    FT_Memory  memory = stream->memory;\n    FT_ULong   table_len;\n\n\n    FT_TRACE2(( \"CVT \" ));\n\n    error = face->goto_table( face, TTAG_cvt, stream, &table_len );\n    if ( error )\n    {\n      FT_TRACE2(( \"is missing\\n\" ));\n\n      face->cvt_size = 0;\n      face->cvt      = NULL;\n      error          = FT_Err_Ok;\n\n      goto Exit;\n    }\n\n    face->cvt_size = table_len / 2;\n\n    if ( FT_NEW_ARRAY( face->cvt, face->cvt_size ) )\n      goto Exit;\n\n    if ( FT_FRAME_ENTER( face->cvt_size * 2L ) )\n      goto Exit;\n\n    {\n      FT_Short*  cur   = face->cvt;\n      FT_Short*  limit = cur + face->cvt_size;\n\n\n      for ( ; cur < limit; cur++ )\n        *cur = FT_GET_SHORT();\n    }\n\n    FT_FRAME_EXIT();\n    FT_TRACE2(( \"loaded\\n\" ));\n\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n    if ( face->doblend )\n      error = tt_face_vary_cvt( face, stream );\n#endif\n\n  Exit:\n    return error;\n\n#else /* !TT_USE_BYTECODE_INTERPRETER */\n\n    FT_UNUSED( face   );\n    FT_UNUSED( stream );\n\n    return FT_Err_Ok;\n\n#endif\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_load_fpgm                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load the font program.                                             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream :: A handle to the input stream.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_load_fpgm( TT_Face    face,\n                     FT_Stream  stream )\n  {\n#ifdef TT_USE_BYTECODE_INTERPRETER\n\n    FT_Error  error;\n    FT_ULong  table_len;\n\n\n    FT_TRACE2(( \"Font program \" ));\n\n    /* The font program is optional */\n    error = face->goto_table( face, TTAG_fpgm, stream, &table_len );\n    if ( error )\n    {\n      face->font_program      = NULL;\n      face->font_program_size = 0;\n      error                   = FT_Err_Ok;\n\n      FT_TRACE2(( \"is missing\\n\" ));\n    }\n    else\n    {\n      face->font_program_size = table_len;\n      if ( FT_FRAME_EXTRACT( table_len, face->font_program ) )\n        goto Exit;\n\n      FT_TRACE2(( \"loaded, %12d bytes\\n\", face->font_program_size ));\n    }\n\n  Exit:\n    return error;\n\n#else /* !TT_USE_BYTECODE_INTERPRETER */\n\n    FT_UNUSED( face   );\n    FT_UNUSED( stream );\n\n    return FT_Err_Ok;\n\n#endif\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_load_prep                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load the cvt program.                                              */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream :: A handle to the input stream.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_load_prep( TT_Face    face,\n                     FT_Stream  stream )\n  {\n#ifdef TT_USE_BYTECODE_INTERPRETER\n\n    FT_Error  error;\n    FT_ULong  table_len;\n\n\n    FT_TRACE2(( \"Prep program \" ));\n\n    error = face->goto_table( face, TTAG_prep, stream, &table_len );\n    if ( error )\n    {\n      face->cvt_program      = NULL;\n      face->cvt_program_size = 0;\n      error                  = FT_Err_Ok;\n\n      FT_TRACE2(( \"is missing\\n\" ));\n    }\n    else\n    {\n      face->cvt_program_size = table_len;\n      if ( FT_FRAME_EXTRACT( table_len, face->cvt_program ) )\n        goto Exit;\n\n      FT_TRACE2(( \"loaded, %12d bytes\\n\", face->cvt_program_size ));\n    }\n\n  Exit:\n    return error;\n\n#else /* !TT_USE_BYTECODE_INTERPRETER */\n\n    FT_UNUSED( face   );\n    FT_UNUSED( stream );\n\n    return FT_Err_Ok;\n\n#endif\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    tt_face_load_hdmx                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Load the `hdmx' table into the face object.                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face   :: A handle to the target face object.                      */\n  /*                                                                       */\n  /*    stream :: A handle to the input stream.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n\n  FT_LOCAL_DEF( FT_Error )\n  tt_face_load_hdmx( TT_Face    face,\n                     FT_Stream  stream )\n  {\n    FT_Error   error;\n    FT_Memory  memory = stream->memory;\n    FT_UInt    version, nn, num_records;\n    FT_ULong   table_size, record_size;\n    FT_Byte*   p;\n    FT_Byte*   limit;\n\n\n    /* this table is optional */\n    error = face->goto_table( face, TTAG_hdmx, stream, &table_size );\n    if ( error || table_size < 8 )\n      return FT_Err_Ok;\n\n    if ( FT_FRAME_EXTRACT( table_size, face->hdmx_table ) )\n      goto Exit;\n\n    p     = face->hdmx_table;\n    limit = p + table_size;\n\n    version     = FT_NEXT_USHORT( p );\n    num_records = FT_NEXT_USHORT( p );\n    record_size = FT_NEXT_ULONG( p );\n\n    /* The maximum number of bytes in an hdmx device record is the */\n    /* maximum number of glyphs + 2; this is 0xFFFF + 2, thus      */\n    /* explaining why `record_size' is a long (which we read as    */\n    /* unsigned long for convenience).  In practice, two bytes are */\n    /* sufficient to hold the size value.                          */\n    /*                                                             */\n    /* There are at least two fonts, HANNOM-A and HANNOM-B version */\n    /* 2.0 (2005), which get this wrong: The upper two bytes of    */\n    /* the size value are set to 0xFF instead of 0x00.  We catch   */\n    /* and fix this.                                               */\n\n    if ( record_size >= 0xFFFF0000UL )\n      record_size &= 0xFFFFU;\n\n    /* The limit for `num_records' is a heuristic value. */\n    if ( version != 0           ||\n         num_records > 255      ||\n         record_size > 0x10001L ||\n         record_size < 4        )\n    {\n      error = FT_THROW( Invalid_File_Format );\n      goto Fail;\n    }\n\n    if ( FT_NEW_ARRAY( face->hdmx_record_sizes, num_records ) )\n      goto Fail;\n\n    for ( nn = 0; nn < num_records; nn++ )\n    {\n      if ( p + record_size > limit )\n        break;\n\n      face->hdmx_record_sizes[nn] = p[0];\n      p                          += record_size;\n    }\n\n    face->hdmx_record_count = nn;\n    face->hdmx_table_size   = table_size;\n    face->hdmx_record_size  = record_size;\n\n  Exit:\n    return error;\n\n  Fail:\n    FT_FRAME_RELEASE( face->hdmx_table );\n    face->hdmx_table_size = 0;\n    goto Exit;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  tt_face_free_hdmx( TT_Face  face )\n  {\n    FT_Stream  stream = face->root.stream;\n    FT_Memory  memory = stream->memory;\n\n\n    FT_FREE( face->hdmx_record_sizes );\n    FT_FRAME_RELEASE( face->hdmx_table );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Return the advance width table for a given pixel size if it is found  */\n  /* in the font's `hdmx' table (if any).                                  */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Byte* )\n  tt_face_get_device_metrics( TT_Face  face,\n                              FT_UInt  ppem,\n                              FT_UInt  gindex )\n  {\n    FT_UInt   nn;\n    FT_Byte*  result      = NULL;\n    FT_ULong  record_size = face->hdmx_record_size;\n    FT_Byte*  record      = face->hdmx_table + 8;\n\n\n    for ( nn = 0; nn < face->hdmx_record_count; nn++ )\n      if ( face->hdmx_record_sizes[nn] == ppem )\n      {\n        gindex += 2;\n        if ( gindex < record_size )\n          result = record + nn * record_size + gindex;\n        break;\n      }\n\n    return result;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/truetype/ttpload.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttpload.h                                                              */\n/*                                                                         */\n/*    TrueType-specific tables loader (specification).                     */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2005, 2006 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTPLOAD_H__\n#define __TTPLOAD_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_TRUETYPE_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n  FT_LOCAL( FT_Error )\n  tt_face_load_loca( TT_Face    face,\n                     FT_Stream  stream );\n\n  FT_LOCAL( FT_ULong )\n  tt_face_get_location( TT_Face   face,\n                        FT_UInt   gindex,\n                        FT_UInt  *asize );\n\n  FT_LOCAL( void )\n  tt_face_done_loca( TT_Face  face );\n\n  FT_LOCAL( FT_Error )\n  tt_face_load_cvt( TT_Face    face,\n                    FT_Stream  stream );\n\n  FT_LOCAL( FT_Error )\n  tt_face_load_fpgm( TT_Face    face,\n                     FT_Stream  stream );\n\n\n  FT_LOCAL( FT_Error )\n  tt_face_load_prep( TT_Face    face,\n                     FT_Stream  stream );\n\n\n  FT_LOCAL( FT_Error )\n  tt_face_load_hdmx( TT_Face    face,\n                     FT_Stream  stream );\n\n\n  FT_LOCAL( void )\n  tt_face_free_hdmx( TT_Face  face );\n\n\n  FT_LOCAL( FT_Byte* )\n  tt_face_get_device_metrics( TT_Face    face,\n                              FT_UInt    ppem,\n                              FT_UInt    gindex );\n\nFT_END_HEADER\n\n#endif /* __TTPLOAD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/truetype/ttsubpix.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttsubpix.c                                                             */\n/*                                                                         */\n/*    TrueType Subpixel Hinting.                                           */\n/*                                                                         */\n/*  Copyright 2010-2013 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_CALC_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_SFNT_H\n#include FT_TRUETYPE_TAGS_H\n#include FT_OUTLINE_H\n#include FT_TRUETYPE_DRIVER_H\n\n#include \"ttsubpix.h\"\n\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* These rules affect how the TT Interpreter does hinting, with the      */\n  /* goal of doing subpixel hinting by (in general) ignoring x moves.      */\n  /* Some of these rules are fixes that go above and beyond the            */\n  /* stated techniques in the MS whitepaper on Cleartype, due to           */\n  /* artifacts in many glyphs.  So, these rules make some glyphs render    */\n  /* better than they do in the MS rasterizer.                             */\n  /*                                                                       */\n  /* \"\" string or 0 int/char indicates to apply to all glyphs.             */\n  /* \"-\" used as dummy placeholders, but any non-matching string works.    */\n  /*                                                                       */\n  /* Some of this could arguably be implemented in fontconfig, however:    */\n  /*                                                                       */\n  /*  - Fontconfig can't set things on a glyph-by-glyph basis.             */\n  /*  - The tweaks that happen here are very low-level, from an average    */\n  /*    user's point of view and are best implemented in the hinter.       */\n  /*                                                                       */\n  /* The goal is to make the subpixel hinting techniques as generalized    */\n  /* as possible across all fonts to prevent the need for extra rules such */\n  /* as these.                                                             */\n  /*                                                                       */\n  /* The rule structure is designed so that entirely new rules can easily  */\n  /* be added when a new compatibility feature is discovered.              */\n  /*                                                                       */\n  /* The rule structures could also use some enhancement to handle ranges. */\n  /*                                                                       */\n  /*     ****************** WORK IN PROGRESS *******************           */\n  /*                                                                       */\n\n  /* These are `classes' of fonts that can be grouped together and used in */\n  /* rules below.  A blank entry \"\" is required at the end of these!       */\n#define FAMILY_CLASS_RULES_SIZE  7\n\n  static const SPH_Font_Class FAMILY_CLASS_Rules\n                              [FAMILY_CLASS_RULES_SIZE] =\n  {\n    { \"MS Legacy Fonts\",\n      { \"Aharoni\",\n        \"Andale Mono\",\n        \"Andalus\",\n        \"Angsana New\",\n        \"AngsanaUPC\",\n        \"Arabic Transparent\",\n        \"Arial Black\",\n        \"Arial Narrow\",\n        \"Arial Unicode MS\",\n        \"Arial\",\n        \"Batang\",\n        \"Browallia New\",\n        \"BrowalliaUPC\",\n        \"Comic Sans MS\",\n        \"Cordia New\",\n        \"CordiaUPC\",\n        \"Courier New\",\n        \"DFKai-SB\",\n        \"David Transparent\",\n        \"David\",\n        \"DilleniaUPC\",\n        \"Estrangelo Edessa\",\n        \"EucrosiaUPC\",\n        \"FangSong_GB2312\",\n        \"Fixed Miriam Transparent\",\n        \"FrankRuehl\",\n        \"Franklin Gothic Medium\",\n        \"FreesiaUPC\",\n        \"Garamond\",\n        \"Gautami\",\n        \"Georgia\",\n        \"Gulim\",\n        \"Impact\",\n        \"IrisUPC\",\n        \"JasmineUPC\",\n        \"KaiTi_GB2312\",\n        \"KodchiangUPC\",\n        \"Latha\",\n        \"Levenim MT\",\n        \"LilyUPC\",\n        \"Lucida Console\",\n        \"Lucida Sans Unicode\",\n        \"MS Gothic\",\n        \"MS Mincho\",\n        \"MV Boli\",\n        \"Mangal\",\n        \"Marlett\",\n        \"Microsoft Sans Serif\",\n        \"Mingliu\",\n        \"Miriam Fixed\",\n        \"Miriam Transparent\",\n        \"Miriam\",\n        \"Narkisim\",\n        \"Palatino Linotype\",\n        \"Raavi\",\n        \"Rod Transparent\",\n        \"Rod\",\n        \"Shruti\",\n        \"SimHei\",\n        \"Simplified Arabic Fixed\",\n        \"Simplified Arabic\",\n        \"Simsun\",\n        \"Sylfaen\",\n        \"Symbol\",\n        \"Tahoma\",\n        \"Times New Roman\",\n        \"Traditional Arabic\",\n        \"Trebuchet MS\",\n        \"Tunga\",\n        \"Verdana\",\n        \"Webdings\",\n        \"Wingdings\",\n        \"\",\n      },\n    },\n    { \"Core MS Legacy Fonts\",\n      { \"Arial Black\",\n        \"Arial Narrow\",\n        \"Arial Unicode MS\",\n        \"Arial\",\n        \"Comic Sans MS\",\n        \"Courier New\",\n        \"Garamond\",\n        \"Georgia\",\n        \"Impact\",\n        \"Lucida Console\",\n        \"Lucida Sans Unicode\",\n        \"Microsoft Sans Serif\",\n        \"Palatino Linotype\",\n        \"Tahoma\",\n        \"Times New Roman\",\n        \"Trebuchet MS\",\n        \"Verdana\",\n        \"\",\n      },\n    },\n    { \"Apple Legacy Fonts\",\n      { \"Geneva\",\n        \"Times\",\n        \"Monaco\",\n        \"Century\",\n        \"Chalkboard\",\n        \"Lobster\",\n        \"Century Gothic\",\n        \"Optima\",\n        \"Lucida Grande\",\n        \"Gill Sans\",\n        \"Baskerville\",\n        \"Helvetica\",\n        \"Helvetica Neue\",\n        \"\",\n      },\n    },\n    { \"Legacy Sans Fonts\",\n      { \"Andale Mono\",\n        \"Arial Unicode MS\",\n        \"Arial\",\n        \"Century Gothic\",\n        \"Comic Sans MS\",\n        \"Franklin Gothic Medium\",\n        \"Geneva\",\n        \"Lucida Console\",\n        \"Lucida Grande\",\n        \"Lucida Sans Unicode\",\n        \"Lucida Sans Typewriter\",\n        \"Microsoft Sans Serif\",\n        \"Monaco\",\n        \"Tahoma\",\n        \"Trebuchet MS\",\n        \"Verdana\",\n        \"\",\n      },\n    },\n\n    { \"Misc Legacy Fonts\",\n      { \"Dark Courier\", \"\", }, },\n    { \"Verdana Clones\",\n      { \"DejaVu Sans\",\n        \"Bitstream Vera Sans\", \"\", }, },\n    { \"Verdana and Clones\",\n      { \"DejaVu Sans\",\n        \"Bitstream Vera Sans\",\n        \"Verdana\", \"\", }, },\n  };\n\n\n  /* Define this to force natural (i.e. not bitmap-compatible) widths.     */\n  /* The default leans strongly towards natural widths except for a few    */\n  /* legacy fonts where a selective combination produces nicer results.    */\n/* #define FORCE_NATURAL_WIDTHS   */\n\n\n  /* Define `classes' of styles that can be grouped together and used in   */\n  /* rules below.  A blank entry \"\" is required at the end of these!       */\n#define STYLE_CLASS_RULES_SIZE  5\n\n  const SPH_Font_Class STYLE_CLASS_Rules\n                       [STYLE_CLASS_RULES_SIZE] =\n  {\n    { \"Regular Class\",\n      { \"Regular\",\n        \"Book\",\n        \"Medium\",\n        \"Roman\",\n        \"Normal\",\n        \"\",\n      },\n    },\n    { \"Regular/Italic Class\",\n      { \"Regular\",\n        \"Book\",\n        \"Medium\",\n        \"Italic\",\n        \"Oblique\",\n        \"Roman\",\n        \"Normal\",\n        \"\",\n      },\n    },\n    { \"Bold/BoldItalic Class\",\n      { \"Bold\",\n        \"Bold Italic\",\n        \"Black\",\n        \"\",\n      },\n    },\n    { \"Bold/Italic/BoldItalic Class\",\n      { \"Bold\",\n        \"Bold Italic\",\n        \"Black\",\n        \"Italic\",\n        \"Oblique\",\n        \"\",\n      },\n    },\n    { \"Regular/Bold Class\",\n      { \"Regular\",\n        \"Book\",\n        \"Medium\",\n        \"Normal\",\n        \"Roman\",\n        \"Bold\",\n        \"Black\",\n        \"\",\n      },\n    },\n  };\n\n\n  /* Force special legacy fixes for fonts.                                 */\n#define COMPATIBILITY_MODE_RULES_SIZE  1\n\n  const SPH_TweakRule  COMPATIBILITY_MODE_Rules\n                       [COMPATIBILITY_MODE_RULES_SIZE] =\n  {\n    { \"Verdana Clones\", 0, \"\", 0 },\n  };\n\n\n  /* Don't do subpixel (ignore_x_mode) hinting; do normal hinting.         */\n#define PIXEL_HINTING_RULES_SIZE  2\n\n  const SPH_TweakRule  PIXEL_HINTING_Rules\n                       [PIXEL_HINTING_RULES_SIZE] =\n  {\n    /* these characters are almost always safe */\n    { \"Courier New\", 12, \"Italic\", 'z' },\n    { \"Courier New\", 11, \"Italic\", 'z' },\n  };\n\n\n  /* Subpixel hinting ignores SHPIX rules on X.  Force SHPIX for these.    */\n#define DO_SHPIX_RULES_SIZE  1\n\n  const SPH_TweakRule  DO_SHPIX_Rules\n                       [DO_SHPIX_RULES_SIZE] =\n  {\n    { \"-\", 0, \"\", 0 },\n  };\n\n\n  /* Skip Y moves that start with a point that is not on a Y pixel         */\n  /* boundary and don't move that point to a Y pixel boundary.             */\n#define SKIP_NONPIXEL_Y_MOVES_RULES_SIZE  4\n\n  const SPH_TweakRule  SKIP_NONPIXEL_Y_MOVES_Rules\n                       [SKIP_NONPIXEL_Y_MOVES_RULES_SIZE] =\n  {\n    /* fix vwxyz thinness*/\n    { \"Consolas\", 0, \"\", 0 },\n    /* Fix thin middle stems */\n    { \"Core MS Legacy Fonts\", 0, \"Regular\", 0 },\n    /* Cyrillic small letter I */\n    { \"Legacy Sans Fonts\", 0, \"\", 0 },\n    /* Fix artifacts with some Regular & Bold */\n    { \"Verdana Clones\", 0, \"\", 0 },\n  };\n\n\n#define SKIP_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE  1\n\n  const SPH_TweakRule  SKIP_NONPIXEL_Y_MOVES_Rules_Exceptions\n                       [SKIP_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =\n  {\n    /* Fixes < and > */\n    { \"Courier New\", 0, \"Regular\", 0 },\n  };\n\n\n  /* Skip Y moves that start with a point that is not on a Y pixel         */\n  /* boundary and don't move that point to a Y pixel boundary.             */\n#define SKIP_NONPIXEL_Y_MOVES_DELTAP_RULES_SIZE  2\n\n  const SPH_TweakRule  SKIP_NONPIXEL_Y_MOVES_DELTAP_Rules\n                       [SKIP_NONPIXEL_Y_MOVES_DELTAP_RULES_SIZE] =\n  {\n    /* Maintain thickness of diagonal in 'N' */\n    { \"Times New Roman\", 0, \"Regular/Bold Class\", 'N' },\n    { \"Georgia\", 0, \"Regular/Bold Class\", 'N' },\n  };\n\n\n  /* Skip Y moves that move a point off a Y pixel boundary.                */\n#define SKIP_OFFPIXEL_Y_MOVES_RULES_SIZE  1\n\n  const SPH_TweakRule  SKIP_OFFPIXEL_Y_MOVES_Rules\n                       [SKIP_OFFPIXEL_Y_MOVES_RULES_SIZE] =\n  {\n    { \"-\", 0, \"\", 0 },\n  };\n\n\n#define SKIP_OFFPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE  1\n\n  const SPH_TweakRule  SKIP_OFFPIXEL_Y_MOVES_Rules_Exceptions\n                       [SKIP_OFFPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =\n  {\n    { \"-\", 0, \"\", 0 },\n  };\n\n\n  /* Round moves that don't move a point to a Y pixel boundary.            */\n#define ROUND_NONPIXEL_Y_MOVES_RULES_SIZE  2\n\n  const SPH_TweakRule  ROUND_NONPIXEL_Y_MOVES_Rules\n                       [ROUND_NONPIXEL_Y_MOVES_RULES_SIZE] =\n  {\n    /* Droid font instructions don't snap Y to pixels */\n    { \"Droid Sans\", 0, \"Regular/Italic Class\", 0 },\n    { \"Droid Sans Mono\", 0, \"\", 0 },\n  };\n\n\n#define ROUND_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE  1\n\n  const SPH_TweakRule  ROUND_NONPIXEL_Y_MOVES_Rules_Exceptions\n                       [ROUND_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =\n  {\n    { \"-\", 0, \"\", 0 },\n  };\n\n\n  /* Allow a Direct_Move along X freedom vector if matched.                */\n#define ALLOW_X_DMOVE_RULES_SIZE  1\n\n  const SPH_TweakRule  ALLOW_X_DMOVE_Rules\n                       [ALLOW_X_DMOVE_RULES_SIZE] =\n  {\n    /* Fixes vanishing diagonal in 4 */\n    { \"Verdana\", 0, \"Regular\", '4' },\n  };\n\n\n  /* Return MS rasterizer version 35 if matched.                           */\n#define RASTERIZER_35_RULES_SIZE  8\n\n  const SPH_TweakRule  RASTERIZER_35_Rules\n                       [RASTERIZER_35_RULES_SIZE] =\n  {\n    /* This seems to be the only way to make these look good */\n    { \"Times New Roman\", 0, \"Regular\", 'i' },\n    { \"Times New Roman\", 0, \"Regular\", 'j' },\n    { \"Times New Roman\", 0, \"Regular\", 'm' },\n    { \"Times New Roman\", 0, \"Regular\", 'r' },\n    { \"Times New Roman\", 0, \"Regular\", 'a' },\n    { \"Times New Roman\", 0, \"Regular\", 'n' },\n    { \"Times New Roman\", 0, \"Regular\", 'p' },\n    { \"Times\", 0, \"\", 0 },\n  };\n\n\n  /* Don't round to the subpixel grid.  Round to pixel grid.               */\n#define NORMAL_ROUND_RULES_SIZE  1\n\n  const SPH_TweakRule  NORMAL_ROUND_Rules\n                       [NORMAL_ROUND_RULES_SIZE] =\n  {\n    /* Fix serif thickness for certain ppems */\n    /* Can probably be generalized somehow   */\n    { \"Courier New\", 0, \"\", 0 },\n  };\n\n\n  /* Skip IUP instructions if matched.                                     */\n#define SKIP_IUP_RULES_SIZE  1\n\n  const SPH_TweakRule  SKIP_IUP_Rules\n                       [SKIP_IUP_RULES_SIZE] =\n  {\n    { \"Arial\", 13, \"Regular\", 'a' },\n  };\n\n\n  /* Skip MIAP Twilight hack if matched.                                   */\n#define MIAP_HACK_RULES_SIZE  1\n\n  const SPH_TweakRule  MIAP_HACK_Rules\n                       [MIAP_HACK_RULES_SIZE] =\n  {\n    { \"Geneva\", 12, \"\", 0 },\n  };\n\n\n  /* Skip DELTAP instructions if matched.                                  */\n#define ALWAYS_SKIP_DELTAP_RULES_SIZE  23\n\n  const SPH_TweakRule  ALWAYS_SKIP_DELTAP_Rules\n                       [ALWAYS_SKIP_DELTAP_RULES_SIZE] =\n  {\n    { \"Georgia\", 0, \"Regular\", 'k' },\n    /* fix various problems with e in different versions */\n    { \"Trebuchet MS\", 14, \"Regular\", 'e' },\n    { \"Trebuchet MS\", 13, \"Regular\", 'e' },\n    { \"Trebuchet MS\", 15, \"Regular\", 'e' },\n    { \"Trebuchet MS\", 0, \"Italic\", 'v' },\n    { \"Trebuchet MS\", 0, \"Italic\", 'w' },\n    { \"Trebuchet MS\", 0, \"Regular\", 'Y' },\n    { \"Arial\", 11, \"Regular\", 's' },\n    /* prevent problems with '3' and others */\n    { \"Verdana\", 10, \"Regular\", 0 },\n    { \"Verdana\", 9, \"Regular\", 0 },\n    /* Cyrillic small letter short I */\n    { \"Legacy Sans Fonts\", 0, \"\", 0x438 },\n    { \"Legacy Sans Fonts\", 0, \"\", 0x439 },\n    { \"Arial\", 10, \"Regular\", '6' },\n    { \"Arial\", 0, \"Bold/BoldItalic Class\", 'a' },\n    /* Make horizontal stems consistent with the rest */\n    { \"Arial\", 24, \"Bold\", 'a' },\n    { \"Arial\", 25, \"Bold\", 'a' },\n    { \"Arial\", 24, \"Bold\", 's' },\n    { \"Arial\", 25, \"Bold\", 's' },\n    { \"Arial\", 34, \"Bold\", 's' },\n    { \"Arial\", 35, \"Bold\", 's' },\n    { \"Arial\", 36, \"Bold\", 's' },\n    { \"Arial\", 25, \"Regular\", 's' },\n    { \"Arial\", 26, \"Regular\", 's' },\n  };\n\n\n  /* Always do DELTAP instructions if matched.                             */\n#define ALWAYS_DO_DELTAP_RULES_SIZE  1\n\n  const SPH_TweakRule  ALWAYS_DO_DELTAP_Rules\n                       [ALWAYS_DO_DELTAP_RULES_SIZE] =\n  {\n    { \"-\", 0, \"\", 0 },\n  };\n\n\n  /* Don't allow ALIGNRP after IUP.                                        */\n#define NO_ALIGNRP_AFTER_IUP_RULES_SIZE  1\n\n  static const SPH_TweakRule  NO_ALIGNRP_AFTER_IUP_Rules\n                              [NO_ALIGNRP_AFTER_IUP_RULES_SIZE] =\n  {\n    /* Prevent creation of dents in outline */\n    { \"-\", 0, \"\", 0 },\n  };\n\n\n  /* Don't allow DELTAP after IUP.                                         */\n#define NO_DELTAP_AFTER_IUP_RULES_SIZE  1\n\n  static const SPH_TweakRule  NO_DELTAP_AFTER_IUP_Rules\n                              [NO_DELTAP_AFTER_IUP_RULES_SIZE] =\n  {\n    { \"-\", 0, \"\", 0 },\n  };\n\n\n  /* Don't allow CALL after IUP.                                           */\n#define NO_CALL_AFTER_IUP_RULES_SIZE  1\n\n  static const SPH_TweakRule  NO_CALL_AFTER_IUP_Rules\n                              [NO_CALL_AFTER_IUP_RULES_SIZE] =\n  {\n    /* Prevent creation of dents in outline */\n    { \"-\", 0, \"\", 0 },\n  };\n\n\n  /* De-embolden these glyphs slightly.                                    */\n#define DEEMBOLDEN_RULES_SIZE  9\n\n  static const SPH_TweakRule  DEEMBOLDEN_Rules\n                              [DEEMBOLDEN_RULES_SIZE] =\n  {\n    { \"Courier New\", 0, \"Bold\", 'A' },\n    { \"Courier New\", 0, \"Bold\", 'W' },\n    { \"Courier New\", 0, \"Bold\", 'w' },\n    { \"Courier New\", 0, \"Bold\", 'M' },\n    { \"Courier New\", 0, \"Bold\", 'X' },\n    { \"Courier New\", 0, \"Bold\", 'K' },\n    { \"Courier New\", 0, \"Bold\", 'x' },\n    { \"Courier New\", 0, \"Bold\", 'z' },\n    { \"Courier New\", 0, \"Bold\", 'v' },\n  };\n\n\n  /* Embolden these glyphs slightly.                                       */\n#define EMBOLDEN_RULES_SIZE  2\n\n  static const SPH_TweakRule  EMBOLDEN_Rules\n                              [EMBOLDEN_RULES_SIZE] =\n  {\n    { \"Courier New\", 0, \"Regular\", 0 },\n    { \"Courier New\", 0, \"Italic\", 0 },\n  };\n\n\n  /* This is a CVT hack that makes thick horizontal stems on 2, 5, 7       */\n  /* similar to Windows XP.                                                */\n#define TIMES_NEW_ROMAN_HACK_RULES_SIZE  12\n\n  static const SPH_TweakRule  TIMES_NEW_ROMAN_HACK_Rules\n                              [TIMES_NEW_ROMAN_HACK_RULES_SIZE] =\n  {\n    { \"Times New Roman\", 16, \"Italic\", '2' },\n    { \"Times New Roman\", 16, \"Italic\", '5' },\n    { \"Times New Roman\", 16, \"Italic\", '7' },\n    { \"Times New Roman\", 16, \"Regular\", '2' },\n    { \"Times New Roman\", 16, \"Regular\", '5' },\n    { \"Times New Roman\", 16, \"Regular\", '7' },\n    { \"Times New Roman\", 17, \"Italic\", '2' },\n    { \"Times New Roman\", 17, \"Italic\", '5' },\n    { \"Times New Roman\", 17, \"Italic\", '7' },\n    { \"Times New Roman\", 17, \"Regular\", '2' },\n    { \"Times New Roman\", 17, \"Regular\", '5' },\n    { \"Times New Roman\", 17, \"Regular\", '7' },\n  };\n\n\n  /* This fudges distance on 2 to get rid of the vanishing stem issue.     */\n  /* A real solution to this is certainly welcome.                         */\n#define COURIER_NEW_2_HACK_RULES_SIZE  15\n\n  static const SPH_TweakRule  COURIER_NEW_2_HACK_Rules\n                              [COURIER_NEW_2_HACK_RULES_SIZE] =\n  {\n    { \"Courier New\", 10, \"Regular\", '2' },\n    { \"Courier New\", 11, \"Regular\", '2' },\n    { \"Courier New\", 12, \"Regular\", '2' },\n    { \"Courier New\", 13, \"Regular\", '2' },\n    { \"Courier New\", 14, \"Regular\", '2' },\n    { \"Courier New\", 15, \"Regular\", '2' },\n    { \"Courier New\", 16, \"Regular\", '2' },\n    { \"Courier New\", 17, \"Regular\", '2' },\n    { \"Courier New\", 18, \"Regular\", '2' },\n    { \"Courier New\", 19, \"Regular\", '2' },\n    { \"Courier New\", 20, \"Regular\", '2' },\n    { \"Courier New\", 21, \"Regular\", '2' },\n    { \"Courier New\", 22, \"Regular\", '2' },\n    { \"Courier New\", 23, \"Regular\", '2' },\n    { \"Courier New\", 24, \"Regular\", '2' },\n  };\n\n\n#ifndef FORCE_NATURAL_WIDTHS\n\n  /* Use compatible widths with these glyphs.  Compatible widths is always */\n  /* on when doing B/W TrueType instructing, but is used selectively here, */\n  /* typically on glyphs with 3 or more vertical stems.                    */\n#define COMPATIBLE_WIDTHS_RULES_SIZE  38\n\n  static const SPH_TweakRule  COMPATIBLE_WIDTHS_Rules\n                              [COMPATIBLE_WIDTHS_RULES_SIZE] =\n  {\n    { \"Arial Unicode MS\", 12, \"Regular Class\", 'm' },\n    { \"Arial Unicode MS\", 14, \"Regular Class\", 'm' },\n    /* Cyrillic small letter sha */\n    { \"Arial\", 10, \"Regular Class\", 0x448 },\n    { \"Arial\", 11, \"Regular Class\", 'm' },\n    { \"Arial\", 12, \"Regular Class\", 'm' },\n    /* Cyrillic small letter sha */\n    { \"Arial\", 12, \"Regular Class\", 0x448 },\n    { \"Arial\", 13, \"Regular Class\", 0x448 },\n    { \"Arial\", 14, \"Regular Class\", 'm' },\n    /* Cyrillic small letter sha */\n    { \"Arial\", 14, \"Regular Class\", 0x448 },\n    { \"Arial\", 15, \"Regular Class\", 0x448 },\n    { \"Arial\", 17, \"Regular Class\", 'm' },\n    { \"DejaVu Sans\", 15, \"Regular Class\", 0 },\n    { \"Microsoft Sans Serif\", 11, \"Regular Class\", 0 },\n    { \"Microsoft Sans Serif\", 12, \"Regular Class\", 0 },\n    { \"Segoe UI\", 11, \"Regular Class\", 0 },\n    { \"Monaco\", 0, \"Regular Class\", 0 },\n    { \"Segoe UI\", 12, \"Regular Class\", 'm' },\n    { \"Segoe UI\", 14, \"Regular Class\", 'm' },\n    { \"Tahoma\", 11, \"Regular Class\", 0 },\n    { \"Times New Roman\", 16, \"Regular Class\", 'c' },\n    { \"Times New Roman\", 16, \"Regular Class\", 'm' },\n    { \"Times New Roman\", 16, \"Regular Class\", 'o' },\n    { \"Times New Roman\", 16, \"Regular Class\", 'w' },\n    { \"Trebuchet MS\", 11, \"Regular Class\", 0 },\n    { \"Trebuchet MS\", 12, \"Regular Class\", 0 },\n    { \"Trebuchet MS\", 14, \"Regular Class\", 0 },\n    { \"Trebuchet MS\", 15, \"Regular Class\", 0 },\n    { \"Ubuntu\", 12, \"Regular Class\", 'm' },\n    /* Cyrillic small letter sha */\n    { \"Verdana\", 10, \"Regular Class\", 0x448 },\n    { \"Verdana\", 11, \"Regular Class\", 0x448 },\n    { \"Verdana and Clones\", 12, \"Regular Class\", 'i' },\n    { \"Verdana and Clones\", 12, \"Regular Class\", 'j' },\n    { \"Verdana and Clones\", 12, \"Regular Class\", 'l' },\n    { \"Verdana and Clones\", 12, \"Regular Class\", 'm' },\n    { \"Verdana and Clones\", 13, \"Regular Class\", 'i' },\n    { \"Verdana and Clones\", 13, \"Regular Class\", 'j' },\n    { \"Verdana and Clones\", 13, \"Regular Class\", 'l' },\n    { \"Verdana and Clones\", 14, \"Regular Class\", 'm' },\n  };\n\n\n  /* Scaling slightly in the x-direction prior to hinting results in       */\n  /* more visually pleasing glyphs in certain cases.                       */\n  /* This sometimes needs to be coordinated with compatible width rules.   */\n  /* A value of 1000 corresponds to a scaled value of 1.0.                 */\n\n#define X_SCALING_RULES_SIZE  50\n\n  static const SPH_ScaleRule  X_SCALING_Rules[X_SCALING_RULES_SIZE] =\n  {\n    { \"DejaVu Sans\", 12, \"Regular Class\", 'm', 950 },\n    { \"Verdana and Clones\", 12, \"Regular Class\", 'a', 1100 },\n    { \"Verdana and Clones\", 13, \"Regular Class\", 'a', 1050 },\n    { \"Arial\", 11, \"Regular Class\", 'm', 975 },\n    { \"Arial\", 12, \"Regular Class\", 'm', 1050 },\n    /* Cyrillic small letter el */\n    { \"Arial\", 13, \"Regular Class\", 0x43B, 950 },\n    { \"Arial\", 13, \"Regular Class\", 'o', 950 },\n    { \"Arial\", 13, \"Regular Class\", 'e', 950 },\n    { \"Arial\", 14, \"Regular Class\", 'm', 950 },\n    /* Cyrillic small letter el */\n    { \"Arial\", 15, \"Regular Class\", 0x43B, 925 },\n    { \"Bitstream Vera Sans\", 10, \"Regular/Italic Class\", 0, 1100 },\n    { \"Bitstream Vera Sans\", 12, \"Regular/Italic Class\", 0, 1050 },\n    { \"Bitstream Vera Sans\", 16, \"Regular Class\", 0, 1050 },\n    { \"Bitstream Vera Sans\", 9, \"Regular/Italic Class\", 0, 1050 },\n    { \"DejaVu Sans\", 12, \"Regular Class\", 'l', 975 },\n    { \"DejaVu Sans\", 12, \"Regular Class\", 'i', 975 },\n    { \"DejaVu Sans\", 12, \"Regular Class\", 'j', 975 },\n    { \"DejaVu Sans\", 13, \"Regular Class\", 'l', 950 },\n    { \"DejaVu Sans\", 13, \"Regular Class\", 'i', 950 },\n    { \"DejaVu Sans\", 13, \"Regular Class\", 'j', 950 },\n    { \"DejaVu Sans\", 10, \"Regular/Italic Class\", 0, 1100 },\n    { \"DejaVu Sans\", 12, \"Regular/Italic Class\", 0, 1050 },\n    { \"Georgia\", 10, \"\", 0, 1050 },\n    { \"Georgia\", 11, \"\", 0, 1100 },\n    { \"Georgia\", 12, \"\", 0, 1025 },\n    { \"Georgia\", 13, \"\", 0, 1050 },\n    { \"Georgia\", 16, \"\", 0, 1050 },\n    { \"Georgia\", 17, \"\", 0, 1030 },\n    { \"Liberation Sans\", 12, \"Regular Class\", 'm', 1100 },\n    { \"Lucida Grande\", 11, \"Regular Class\", 'm', 1100 },\n    { \"Microsoft Sans Serif\", 11, \"Regular Class\", 'm', 950 },\n    { \"Microsoft Sans Serif\", 12, \"Regular Class\", 'm', 1050 },\n    { \"Segoe UI\", 12, \"Regular Class\", 'H', 1050 },\n    { \"Segoe UI\", 12, \"Regular Class\", 'm', 1050 },\n    { \"Segoe UI\", 14, \"Regular Class\", 'm', 1050 },\n    { \"Tahoma\", 11, \"Regular Class\", 'i', 975 },\n    { \"Tahoma\", 11, \"Regular Class\", 'l', 975 },\n    { \"Tahoma\", 11, \"Regular Class\", 'j', 900 },\n    { \"Tahoma\", 11, \"Regular Class\", 'm', 918 },\n    { \"Verdana\", 10, \"Regular/Italic Class\", 0, 1100 },\n    { \"Verdana\", 12, \"Regular Class\", 'm', 975 },\n    { \"Verdana\", 12, \"Regular/Italic Class\", 0, 1050 },\n    { \"Verdana\", 13, \"Regular/Italic Class\", 'i', 950 },\n    { \"Verdana\", 13, \"Regular/Italic Class\", 'j', 950 },\n    { \"Verdana\", 13, \"Regular/Italic Class\", 'l', 950 },\n    { \"Verdana\", 16, \"Regular Class\", 0, 1050 },\n    { \"Verdana\", 9, \"Regular/Italic Class\", 0, 1050 },\n    { \"Times New Roman\", 16, \"Regular Class\", 'm', 918 },\n    { \"Trebuchet MS\", 11, \"Regular Class\", 'm', 800 },\n    { \"Trebuchet MS\", 12, \"Regular Class\", 'm', 800 },\n  };\n\n#else\n\n#define COMPATIBLE_WIDTHS_RULES_SIZE  1\n\n  static const SPH_TweakRule  COMPATIBLE_WIDTHS_Rules\n                              [COMPATIBLE_WIDTHS_RULES_SIZE] =\n  {\n    { \"-\", 0, \"\", 0 },\n  };\n\n\n#define X_SCALING_RULES_SIZE  1\n\n  static const SPH_ScaleRule  X_SCALING_Rules\n                              [X_SCALING_RULES_SIZE] =\n  {\n    { \"-\", 0, \"\", 0, 1000 },\n  };\n\n#endif /* FORCE_NATURAL_WIDTHS */\n\n\n  FT_LOCAL_DEF( FT_Bool )\n  is_member_of_family_class( const FT_String*  detected_font_name,\n                             const FT_String*  rule_font_name )\n  {\n    FT_UInt  i, j;\n\n\n    /* Does font name match rule family? */\n    if ( strcmp( detected_font_name, rule_font_name ) == 0 )\n      return TRUE;\n\n    /* Is font name a wildcard \"\"? */\n    if ( strcmp( rule_font_name, \"\" ) == 0 )\n      return TRUE;\n\n    /* Is font name contained in a class list? */\n    for ( i = 0; i < FAMILY_CLASS_RULES_SIZE; i++ )\n    {\n      if ( strcmp( FAMILY_CLASS_Rules[i].name, rule_font_name ) == 0 )\n      {\n        for ( j = 0; j < SPH_MAX_CLASS_MEMBERS; j++ )\n        {\n          if ( strcmp( FAMILY_CLASS_Rules[i].member[j], \"\" ) == 0 )\n            continue;\n          if ( strcmp( FAMILY_CLASS_Rules[i].member[j],\n                       detected_font_name ) == 0 )\n            return TRUE;\n        }\n      }\n    }\n\n    return FALSE;\n  }\n\n\n  FT_LOCAL_DEF( FT_Bool )\n  is_member_of_style_class( const FT_String*  detected_font_style,\n                            const FT_String*  rule_font_style )\n  {\n    FT_UInt  i, j;\n\n\n    /* Does font style match rule style? */\n    if ( strcmp( detected_font_style, rule_font_style ) == 0 )\n      return TRUE;\n\n    /* Is font style a wildcard \"\"? */\n    if ( strcmp( rule_font_style, \"\" ) == 0 )\n      return TRUE;\n\n    /* Is font style contained in a class list? */\n    for ( i = 0; i < STYLE_CLASS_RULES_SIZE; i++ )\n    {\n      if ( strcmp( STYLE_CLASS_Rules[i].name, rule_font_style ) == 0 )\n      {\n        for ( j = 0; j < SPH_MAX_CLASS_MEMBERS; j++ )\n        {\n          if ( strcmp( STYLE_CLASS_Rules[i].member[j], \"\" ) == 0 )\n            continue;\n          if ( strcmp( STYLE_CLASS_Rules[i].member[j],\n                       detected_font_style ) == 0 )\n            return TRUE;\n        }\n      }\n    }\n\n    return FALSE;\n  }\n\n\n  FT_LOCAL_DEF( FT_Bool )\n  sph_test_tweak( TT_Face               face,\n                  const FT_String*      family,\n                  FT_UInt               ppem,\n                  const FT_String*      style,\n                  FT_UInt               glyph_index,\n                  const SPH_TweakRule*  rule,\n                  FT_UInt               num_rules )\n  {\n    FT_UInt  i;\n\n\n    /* rule checks may be able to be optimized further */\n    for ( i = 0; i < num_rules; i++ )\n    {\n      if ( family                                                   &&\n           ( is_member_of_family_class ( family, rule[i].family ) ) )\n        if ( rule[i].ppem == 0    ||\n             rule[i].ppem == ppem )\n          if ( style                                             &&\n               is_member_of_style_class ( style, rule[i].style ) )\n            if ( rule[i].glyph == 0                                ||\n                 FT_Get_Char_Index( (FT_Face)face,\n                                    rule[i].glyph ) == glyph_index )\n        return TRUE;\n    }\n\n    return FALSE;\n  }\n\n\n  static FT_UInt\n  scale_test_tweak( TT_Face               face,\n                    const FT_String*      family,\n                    FT_UInt               ppem,\n                    const FT_String*      style,\n                    FT_UInt               glyph_index,\n                    const SPH_ScaleRule*  rule,\n                    FT_UInt               num_rules )\n  {\n    FT_UInt  i;\n\n\n    /* rule checks may be able to be optimized further */\n    for ( i = 0; i < num_rules; i++ )\n    {\n      if ( family                                                   &&\n           ( is_member_of_family_class ( family, rule[i].family ) ) )\n        if ( rule[i].ppem == 0    ||\n             rule[i].ppem == ppem )\n          if ( style                                            &&\n               is_member_of_style_class( style, rule[i].style ) )\n            if ( rule[i].glyph == 0                                ||\n                 FT_Get_Char_Index( (FT_Face)face,\n                                    rule[i].glyph ) == glyph_index )\n        return rule[i].scale;\n    }\n\n    return 1000;\n  }\n\n\n  FT_LOCAL_DEF( FT_UInt )\n  sph_test_tweak_x_scaling( TT_Face           face,\n                            const FT_String*  family,\n                            FT_UInt           ppem,\n                            const FT_String*  style,\n                            FT_UInt           glyph_index )\n  {\n    return scale_test_tweak( face, family, ppem, style, glyph_index,\n                             X_SCALING_Rules, X_SCALING_RULES_SIZE );\n  }\n\n\n#define TWEAK_RULES( x )                                       \\\n  if ( sph_test_tweak( face, family, ppem, style, glyph_index, \\\n                       x##_Rules, x##_RULES_SIZE ) )           \\\n    loader->exec->sph_tweak_flags |= SPH_TWEAK_##x;\n\n#define TWEAK_RULES_EXCEPTIONS( x )                                        \\\n  if ( sph_test_tweak( face, family, ppem, style, glyph_index,             \\\n                       x##_Rules_Exceptions, x##_RULES_EXCEPTIONS_SIZE ) ) \\\n    loader->exec->sph_tweak_flags &= ~SPH_TWEAK_##x;\n\n\n  FT_LOCAL_DEF( void )\n  sph_set_tweaks( TT_Loader  loader,\n                  FT_UInt    glyph_index )\n  {\n    TT_Face     face   = (TT_Face)loader->face;\n    FT_String*  family = face->root.family_name;\n    int         ppem   = loader->size->metrics.x_ppem;\n    FT_String*  style  = face->root.style_name;\n\n\n    /* don't apply rules if style isn't set */\n    if ( !face->root.style_name )\n      return;\n\n#ifdef SPH_DEBUG_MORE_VERBOSE\n    printf( \"%s,%d,%s,%c=%d \",\n            family, ppem, style, glyph_index, glyph_index );\n#endif\n\n    TWEAK_RULES( PIXEL_HINTING );\n\n    if ( loader->exec->sph_tweak_flags & SPH_TWEAK_PIXEL_HINTING )\n    {\n      loader->exec->ignore_x_mode = FALSE;\n      return;\n    }\n\n    TWEAK_RULES( ALLOW_X_DMOVE );\n    TWEAK_RULES( ALWAYS_DO_DELTAP );\n    TWEAK_RULES( ALWAYS_SKIP_DELTAP );\n    TWEAK_RULES( DEEMBOLDEN );\n    TWEAK_RULES( DO_SHPIX );\n    TWEAK_RULES( EMBOLDEN );\n    TWEAK_RULES( MIAP_HACK );\n    TWEAK_RULES( NORMAL_ROUND );\n    TWEAK_RULES( NO_ALIGNRP_AFTER_IUP );\n    TWEAK_RULES( NO_CALL_AFTER_IUP );\n    TWEAK_RULES( NO_DELTAP_AFTER_IUP );\n    TWEAK_RULES( RASTERIZER_35 );\n    TWEAK_RULES( SKIP_IUP );\n\n    TWEAK_RULES( SKIP_OFFPIXEL_Y_MOVES );\n    TWEAK_RULES_EXCEPTIONS( SKIP_OFFPIXEL_Y_MOVES );\n\n    TWEAK_RULES( SKIP_NONPIXEL_Y_MOVES_DELTAP );\n\n    TWEAK_RULES( SKIP_NONPIXEL_Y_MOVES );\n    TWEAK_RULES_EXCEPTIONS( SKIP_NONPIXEL_Y_MOVES );\n\n    TWEAK_RULES( ROUND_NONPIXEL_Y_MOVES );\n    TWEAK_RULES_EXCEPTIONS( ROUND_NONPIXEL_Y_MOVES );\n\n    if ( loader->exec->sph_tweak_flags & SPH_TWEAK_RASTERIZER_35 )\n    {\n      if ( loader->exec->rasterizer_version != TT_INTERPRETER_VERSION_35 )\n      {\n        loader->exec->rasterizer_version = TT_INTERPRETER_VERSION_35;\n        loader->exec->size->cvt_ready    = -1;\n\n        tt_size_ready_bytecode(\n          loader->exec->size,\n          FT_BOOL( loader->load_flags & FT_LOAD_PEDANTIC ) );\n      }\n      else\n        loader->exec->rasterizer_version = TT_INTERPRETER_VERSION_35;\n    }\n    else\n    {\n      if ( loader->exec->rasterizer_version  !=\n           SPH_OPTION_SET_RASTERIZER_VERSION )\n      {\n        loader->exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION;\n        loader->exec->size->cvt_ready    = -1;\n\n        tt_size_ready_bytecode(\n          loader->exec->size,\n          FT_BOOL( loader->load_flags & FT_LOAD_PEDANTIC ) );\n      }\n      else\n        loader->exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION;\n    }\n\n    if ( IS_HINTED( loader->load_flags ) )\n    {\n      TWEAK_RULES( TIMES_NEW_ROMAN_HACK );\n      TWEAK_RULES( COURIER_NEW_2_HACK );\n    }\n\n    if ( sph_test_tweak( face, family, ppem, style, glyph_index,\n           COMPATIBILITY_MODE_Rules, COMPATIBILITY_MODE_RULES_SIZE ) )\n      loader->exec->face->sph_compatibility_mode = TRUE;\n\n\n    if ( IS_HINTED( loader->load_flags ) )\n    {\n      if ( sph_test_tweak( face, family, ppem, style, glyph_index,\n             COMPATIBLE_WIDTHS_Rules, COMPATIBLE_WIDTHS_RULES_SIZE ) )\n        loader->exec->compatible_widths |= TRUE;\n    }\n  }\n\n#else /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n  /* ANSI C doesn't like empty source files */\n  typedef int  _tt_subpix_dummy;\n\n#endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/truetype/ttsubpix.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttsubpix.h                                                             */\n/*                                                                         */\n/*    TrueType Subpixel Hinting.                                           */\n/*                                                                         */\n/*  Copyright 2010-2013 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTSUBPIX_H__\n#define __TTSUBPIX_H__\n\n#include <ft2build.h>\n#include \"ttobjs.h\"\n#include \"ttinterp.h\"\n\n\nFT_BEGIN_HEADER\n\n\n#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* ID flags to identify special functions at FDEF and runtime.           */\n  /*                                                                       */\n  /*                                                                       */\n#define SPH_FDEF_INLINE_DELTA_1       0x0000001\n#define SPH_FDEF_INLINE_DELTA_2       0x0000002\n#define SPH_FDEF_DIAGONAL_STROKE      0x0000004\n#define SPH_FDEF_VACUFORM_ROUND_1     0x0000008\n#define SPH_FDEF_TTFAUTOHINT_1        0x0000010\n#define SPH_FDEF_SPACING_1            0x0000020\n#define SPH_FDEF_SPACING_2            0x0000040\n#define SPH_FDEF_TYPEMAN_STROKES      0x0000080\n#define SPH_FDEF_TYPEMAN_DIAGENDCTRL  0x0000100\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Tweak flags that are set for each glyph by the below rules.           */\n  /*                                                                       */\n  /*                                                                       */\n#define SPH_TWEAK_ALLOW_X_DMOVE                   0x0000001\n#define SPH_TWEAK_ALWAYS_DO_DELTAP                0x0000002\n#define SPH_TWEAK_ALWAYS_SKIP_DELTAP              0x0000004\n#define SPH_TWEAK_COURIER_NEW_2_HACK              0x0000008\n#define SPH_TWEAK_DEEMBOLDEN                      0x0000010\n#define SPH_TWEAK_DO_SHPIX                        0x0000020\n#define SPH_TWEAK_EMBOLDEN                        0x0000040\n#define SPH_TWEAK_MIAP_HACK                       0x0000080\n#define SPH_TWEAK_NORMAL_ROUND                    0x0000100\n#define SPH_TWEAK_NO_ALIGNRP_AFTER_IUP            0x0000200\n#define SPH_TWEAK_NO_CALL_AFTER_IUP               0x0000400\n#define SPH_TWEAK_NO_DELTAP_AFTER_IUP             0x0000800\n#define SPH_TWEAK_PIXEL_HINTING                   0x0001000\n#define SPH_TWEAK_RASTERIZER_35                   0x0002000\n#define SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES          0x0004000\n#define SPH_TWEAK_SKIP_IUP                        0x0008000\n#define SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES           0x0010000\n#define SPH_TWEAK_SKIP_OFFPIXEL_Y_MOVES           0x0020000\n#define SPH_TWEAK_TIMES_NEW_ROMAN_HACK            0x0040000\n#define SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES_DELTAP    0x0080000\n\n\n  FT_LOCAL( FT_Bool )\n  sph_test_tweak( TT_Face               face,\n                  const FT_String*      family,\n                  FT_UInt               ppem,\n                  const FT_String*      style,\n                  FT_UInt               glyph_index,\n                  const SPH_TweakRule*  rule,\n                  FT_UInt               num_rules );\n\n  FT_LOCAL( FT_UInt )\n  sph_test_tweak_x_scaling( TT_Face           face,\n                            const FT_String*  family,\n                            FT_UInt           ppem,\n                            const FT_String*  style,\n                            FT_UInt           glyph_index );\n\n  FT_LOCAL( void )\n  sph_set_tweaks( TT_Loader  loader,\n                  FT_UInt    glyph_index );\n\n\n  /* These macros are defined absent a method for setting them */\n#define SPH_OPTION_BITMAP_WIDTHS           FALSE\n#define SPH_OPTION_SET_SUBPIXEL            TRUE\n#define SPH_OPTION_SET_GRAYSCALE           FALSE\n#define SPH_OPTION_SET_COMPATIBLE_WIDTHS   FALSE\n#define SPH_OPTION_SET_RASTERIZER_VERSION  38\n\n#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */\n\n\nFT_END_HEADER\n\n#endif /* __TTSUBPIX_H__ */\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type1/Jamfile",
    "content": "# FreeType 2 src/type1 Jamfile\n#\n# Copyright 2001 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) type1 ;\n\n{\n  local  _sources ;\n\n  if $(FT2_MULTI)\n  {\n    _sources = t1afm t1driver t1objs t1load t1gload t1parse ;\n  }\n  else\n  {\n    _sources = type1 ;\n  }\n\n  Library  $(FT2_LIB) : $(_sources).c ;\n}\n\n# end of src/type1 Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/type1/module.mk",
    "content": "#\n# FreeType 2 Type1 module definition\n#\n\n\n# Copyright 1996-2000, 2006 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\nFTMODULE_H_COMMANDS += TYPE1_DRIVER\n\ndefine TYPE1_DRIVER\n$(OPEN_DRIVER) FT_Driver_ClassRec, t1_driver_class $(CLOSE_DRIVER)\n$(ECHO_DRIVER)type1     $(ECHO_DRIVER_DESC)Postscript font files with extension *.pfa or *.pfb$(ECHO_DRIVER_DONE)\nendef\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/type1/rules.mk",
    "content": "#\n# FreeType 2 Type1 driver configuration rules\n#\n\n\n# Copyright 1996-2000, 2001, 2003 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\n# Type1 driver directory\n#\nT1_DIR := $(SRC_DIR)/type1\n\n\n# compilation flags for the driver\n#\nT1_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(T1_DIR))\n\n\n# Type1 driver sources (i.e., C files)\n#\nT1_DRV_SRC := $(T1_DIR)/t1parse.c  \\\n              $(T1_DIR)/t1load.c   \\\n              $(T1_DIR)/t1driver.c \\\n              $(T1_DIR)/t1afm.c    \\\n              $(T1_DIR)/t1gload.c  \\\n              $(T1_DIR)/t1objs.c\n\n# Type1 driver headers\n#\nT1_DRV_H := $(T1_DRV_SRC:%.c=%.h) \\\n            $(T1_DIR)/t1tokens.h  \\\n            $(T1_DIR)/t1errors.h\n\n\n# Type1 driver object(s)\n#\n#   T1_DRV_OBJ_M is used during `multi' builds\n#   T1_DRV_OBJ_S is used during `single' builds\n#\nT1_DRV_OBJ_M := $(T1_DRV_SRC:$(T1_DIR)/%.c=$(OBJ_DIR)/%.$O)\nT1_DRV_OBJ_S := $(OBJ_DIR)/type1.$O\n\n# Type1 driver source file for single build\n#\nT1_DRV_SRC_S := $(T1_DIR)/type1.c\n\n\n# Type1 driver - single object\n#\n$(T1_DRV_OBJ_S): $(T1_DRV_SRC_S) $(T1_DRV_SRC) $(FREETYPE_H) $(T1_DRV_H)\n\t$(T1_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(T1_DRV_SRC_S))\n\n\n# Type1 driver - multiple objects\n#\n$(OBJ_DIR)/%.$O: $(T1_DIR)/%.c $(FREETYPE_H) $(T1_DRV_H)\n\t$(T1_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\n\n\n# update main driver object lists\n#\nDRV_OBJS_S += $(T1_DRV_OBJ_S)\nDRV_OBJS_M += $(T1_DRV_OBJ_M)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/type1/t1afm.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1afm.c                                                                */\n/*                                                                         */\n/*    AFM support for Type 1 fonts (body).                                 */\n/*                                                                         */\n/*  Copyright 1996-2011, 2013 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include \"t1afm.h\"\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_POSTSCRIPT_AUX_H\n#include \"t1errors.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_t1afm\n\n\n  FT_LOCAL_DEF( void )\n  T1_Done_Metrics( FT_Memory     memory,\n                   AFM_FontInfo  fi )\n  {\n    FT_FREE( fi->KernPairs );\n    fi->NumKernPair = 0;\n\n    FT_FREE( fi->TrackKerns );\n    fi->NumTrackKern = 0;\n\n    FT_FREE( fi );\n  }\n\n\n  /* read a glyph name and return the equivalent glyph index */\n  static FT_Int\n  t1_get_index( const char*  name,\n                FT_Offset    len,\n                void*        user_data )\n  {\n    T1_Font  type1 = (T1_Font)user_data;\n    FT_Int   n;\n\n\n    /* PS string/name length must be < 16-bit */\n    if ( len > 0xFFFFU )\n      return 0;\n\n    for ( n = 0; n < type1->num_glyphs; n++ )\n    {\n      char*  gname = (char*)type1->glyph_names[n];\n\n\n      if ( gname && gname[0] == name[0]        &&\n           ft_strlen( gname ) == len           &&\n           ft_strncmp( gname, name, len ) == 0 )\n        return n;\n    }\n\n    return 0;\n  }\n\n\n#undef  KERN_INDEX\n#define KERN_INDEX( g1, g2 )  ( ( (FT_ULong)(g1) << 16 ) | (g2) )\n\n\n  /* compare two kerning pairs */\n  FT_CALLBACK_DEF( int )\n  compare_kern_pairs( const void*  a,\n                      const void*  b )\n  {\n    AFM_KernPair  pair1 = (AFM_KernPair)a;\n    AFM_KernPair  pair2 = (AFM_KernPair)b;\n\n    FT_ULong  index1 = KERN_INDEX( pair1->index1, pair1->index2 );\n    FT_ULong  index2 = KERN_INDEX( pair2->index1, pair2->index2 );\n\n\n    if ( index1 > index2 )\n      return 1;\n    else if ( index1 < index2 )\n      return -1;\n    else\n      return 0;\n  }\n\n\n  /* parse a PFM file -- for now, only read the kerning pairs */\n  static FT_Error\n  T1_Read_PFM( FT_Face       t1_face,\n               FT_Stream     stream,\n               AFM_FontInfo  fi )\n  {\n    FT_Error      error  = FT_Err_Ok;\n    FT_Memory     memory = stream->memory;\n    FT_Byte*      start;\n    FT_Byte*      limit;\n    FT_Byte*      p;\n    AFM_KernPair  kp;\n    FT_Int        width_table_length;\n    FT_CharMap    oldcharmap;\n    FT_CharMap    charmap;\n    FT_Int        n;\n\n\n    start = (FT_Byte*)stream->cursor;\n    limit = (FT_Byte*)stream->limit;\n\n    /* Figure out how long the width table is.          */\n    /* This info is a little-endian short at offset 99. */\n    p = start + 99;\n    if ( p + 2 > limit )\n    {\n      error = FT_THROW( Unknown_File_Format );\n      goto Exit;\n    }\n    width_table_length = FT_PEEK_USHORT_LE( p );\n\n    p += 18 + width_table_length;\n    if ( p + 0x12 > limit || FT_PEEK_USHORT_LE( p ) < 0x12 )\n      /* extension table is probably optional */\n      goto Exit;\n\n    /* Kerning offset is 14 bytes from start of extensions table. */\n    p += 14;\n    p = start + FT_PEEK_ULONG_LE( p );\n\n    if ( p == start )\n      /* zero offset means no table */\n      goto Exit;\n\n    if ( p + 2 > limit )\n    {\n      error = FT_THROW( Unknown_File_Format );\n      goto Exit;\n    }\n\n    fi->NumKernPair = FT_PEEK_USHORT_LE( p );\n    p += 2;\n    if ( p + 4 * fi->NumKernPair > limit )\n    {\n      error = FT_THROW( Unknown_File_Format );\n      goto Exit;\n    }\n\n    /* Actually, kerning pairs are simply optional! */\n    if ( fi->NumKernPair == 0 )\n      goto Exit;\n\n    /* allocate the pairs */\n    if ( FT_QNEW_ARRAY( fi->KernPairs, fi->NumKernPair ) )\n      goto Exit;\n\n    /* now, read each kern pair */\n    kp             = fi->KernPairs;\n    limit          = p + 4 * fi->NumKernPair;\n\n    /* PFM kerning data are stored by encoding rather than glyph index, */\n    /* so find the PostScript charmap of this font and install it       */\n    /* temporarily.  If we find no PostScript charmap, then just use    */\n    /* the default and hope it is the right one.                        */\n    oldcharmap = t1_face->charmap;\n    charmap    = NULL;\n\n    for ( n = 0; n < t1_face->num_charmaps; n++ )\n    {\n      charmap = t1_face->charmaps[n];\n      /* check against PostScript pseudo platform */\n      if ( charmap->platform_id == 7 )\n      {\n        error = FT_Set_Charmap( t1_face, charmap );\n        if ( error )\n          goto Exit;\n        break;\n      }\n    }\n\n    /* Kerning info is stored as:             */\n    /*                                        */\n    /*   encoding of first glyph (1 byte)     */\n    /*   encoding of second glyph (1 byte)    */\n    /*   offset (little-endian short)         */\n    for ( ; p < limit ; p += 4 )\n    {\n      kp->index1 = FT_Get_Char_Index( t1_face, p[0] );\n      kp->index2 = FT_Get_Char_Index( t1_face, p[1] );\n\n      kp->x = (FT_Int)FT_PEEK_SHORT_LE(p + 2);\n      kp->y = 0;\n\n      kp++;\n    }\n\n    if ( oldcharmap != NULL )\n      error = FT_Set_Charmap( t1_face, oldcharmap );\n    if ( error )\n      goto Exit;\n\n    /* now, sort the kern pairs according to their glyph indices */\n    ft_qsort( fi->KernPairs, fi->NumKernPair, sizeof ( AFM_KernPairRec ),\n              compare_kern_pairs );\n\n  Exit:\n    if ( error )\n    {\n      FT_FREE( fi->KernPairs );\n      fi->NumKernPair = 0;\n    }\n\n    return error;\n  }\n\n\n  /* parse a metrics file -- either AFM or PFM depending on what */\n  /* it turns out to be                                          */\n  FT_LOCAL_DEF( FT_Error )\n  T1_Read_Metrics( FT_Face    t1_face,\n                   FT_Stream  stream )\n  {\n    PSAux_Service  psaux;\n    FT_Memory      memory  = stream->memory;\n    AFM_ParserRec  parser;\n    AFM_FontInfo   fi      = NULL;\n    FT_Error       error   = FT_ERR( Unknown_File_Format );\n    T1_Font        t1_font = &( (T1_Face)t1_face )->type1;\n\n\n    if ( FT_NEW( fi )                   ||\n         FT_FRAME_ENTER( stream->size ) )\n      goto Exit;\n\n    fi->FontBBox  = t1_font->font_bbox;\n    fi->Ascender  = t1_font->font_bbox.yMax;\n    fi->Descender = t1_font->font_bbox.yMin;\n\n    psaux = (PSAux_Service)( (T1_Face)t1_face )->psaux;\n    if ( psaux->afm_parser_funcs )\n    {\n      error = psaux->afm_parser_funcs->init( &parser,\n                                             stream->memory,\n                                             stream->cursor,\n                                             stream->limit );\n\n      if ( !error )\n      {\n        parser.FontInfo  = fi;\n        parser.get_index = t1_get_index;\n        parser.user_data = t1_font;\n\n        error = psaux->afm_parser_funcs->parse( &parser );\n        psaux->afm_parser_funcs->done( &parser );\n      }\n    }\n\n    if ( FT_ERR_EQ( error, Unknown_File_Format ) )\n    {\n      FT_Byte*  start = stream->cursor;\n\n\n      /* MS Windows allows versions up to 0x3FF without complaining */\n      if ( stream->size > 6                              &&\n           start[1] < 4                                  &&\n           FT_PEEK_ULONG_LE( start + 2 ) == stream->size )\n        error = T1_Read_PFM( t1_face, stream, fi );\n    }\n\n    if ( !error )\n    {\n      t1_font->font_bbox = fi->FontBBox;\n\n      t1_face->bbox.xMin =   fi->FontBBox.xMin            >> 16;\n      t1_face->bbox.yMin =   fi->FontBBox.yMin            >> 16;\n      /* no `U' suffix here to 0xFFFF! */\n      t1_face->bbox.xMax = ( fi->FontBBox.xMax + 0xFFFF ) >> 16;\n      t1_face->bbox.yMax = ( fi->FontBBox.yMax + 0xFFFF ) >> 16;\n\n      /* no `U' suffix here to 0x8000! */\n      t1_face->ascender  = (FT_Short)( ( fi->Ascender  + 0x8000 ) >> 16 );\n      t1_face->descender = (FT_Short)( ( fi->Descender + 0x8000 ) >> 16 );\n\n      if ( fi->NumKernPair )\n      {\n        t1_face->face_flags |= FT_FACE_FLAG_KERNING;\n        ( (T1_Face)t1_face )->afm_data = fi;\n        fi = NULL;\n      }\n    }\n\n    FT_FRAME_EXIT();\n\n  Exit:\n    if ( fi != NULL )\n      T1_Done_Metrics( memory, fi );\n\n    return error;\n  }\n\n\n  /* find the kerning for a given glyph pair */\n  FT_LOCAL_DEF( void )\n  T1_Get_Kerning( AFM_FontInfo  fi,\n                  FT_UInt       glyph1,\n                  FT_UInt       glyph2,\n                  FT_Vector*    kerning )\n  {\n    AFM_KernPair  min, mid, max;\n    FT_ULong      idx = KERN_INDEX( glyph1, glyph2 );\n\n\n    /* simple binary search */\n    min = fi->KernPairs;\n    max = min + fi->NumKernPair - 1;\n\n    while ( min <= max )\n    {\n      FT_ULong  midi;\n\n\n      mid  = min + ( max - min ) / 2;\n      midi = KERN_INDEX( mid->index1, mid->index2 );\n\n      if ( midi == idx )\n      {\n        kerning->x = mid->x;\n        kerning->y = mid->y;\n\n        return;\n      }\n\n      if ( midi < idx )\n        min = mid + 1;\n      else\n        max = mid - 1;\n    }\n\n    kerning->x = 0;\n    kerning->y = 0;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  T1_Get_Track_Kerning( FT_Face    face,\n                        FT_Fixed   ptsize,\n                        FT_Int     degree,\n                        FT_Fixed*  kerning )\n  {\n    AFM_FontInfo  fi = (AFM_FontInfo)( (T1_Face)face )->afm_data;\n    FT_Int        i;\n\n\n    if ( !fi )\n      return FT_THROW( Invalid_Argument );\n\n    for ( i = 0; i < fi->NumTrackKern; i++ )\n    {\n      AFM_TrackKern  tk = fi->TrackKerns + i;\n\n\n      if ( tk->degree != degree )\n        continue;\n\n      if ( ptsize < tk->min_ptsize )\n        *kerning = tk->min_kern;\n      else if ( ptsize > tk->max_ptsize )\n        *kerning = tk->max_kern;\n      else\n      {\n        *kerning = FT_MulDiv( ptsize - tk->min_ptsize,\n                              tk->max_kern - tk->min_kern,\n                              tk->max_ptsize - tk->min_ptsize ) +\n                   tk->min_kern;\n      }\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type1/t1afm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1afm.h                                                                */\n/*                                                                         */\n/*    AFM support for Type 1 fonts (specification).                        */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2006 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T1AFM_H__\n#define __T1AFM_H__\n\n#include <ft2build.h>\n#include \"t1objs.h\"\n#include FT_INTERNAL_TYPE1_TYPES_H\n\nFT_BEGIN_HEADER\n\n\n  FT_LOCAL( FT_Error )\n  T1_Read_Metrics( FT_Face    face,\n                   FT_Stream  stream );\n\n  FT_LOCAL( void )\n  T1_Done_Metrics( FT_Memory     memory,\n                   AFM_FontInfo  fi );\n\n  FT_LOCAL( void )\n  T1_Get_Kerning( AFM_FontInfo  fi,\n                  FT_UInt       glyph1,\n                  FT_UInt       glyph2,\n                  FT_Vector*    kerning );\n\n  FT_LOCAL( FT_Error )\n  T1_Get_Track_Kerning( FT_Face    face,\n                        FT_Fixed   ptsize,\n                        FT_Int     degree,\n                        FT_Fixed*  kerning );\n\nFT_END_HEADER\n\n#endif /* __T1AFM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type1/t1driver.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1driver.c                                                             */\n/*                                                                         */\n/*    Type 1 driver interface (body).                                      */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006, 2007, 2009, 2011, 2013, 2014 by             */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include \"t1driver.h\"\n#include \"t1gload.h\"\n#include \"t1load.h\"\n\n#include \"t1errors.h\"\n\n#ifndef T1_CONFIG_OPTION_NO_AFM\n#include \"t1afm.h\"\n#endif\n\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n\n#include FT_SERVICE_MULTIPLE_MASTERS_H\n#include FT_SERVICE_GLYPH_DICT_H\n#include FT_SERVICE_XFREE86_NAME_H\n#include FT_SERVICE_POSTSCRIPT_NAME_H\n#include FT_SERVICE_POSTSCRIPT_CMAPS_H\n#include FT_SERVICE_POSTSCRIPT_INFO_H\n#include FT_SERVICE_KERNING_H\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_t1driver\n\n /*\n  *  GLYPH DICT SERVICE\n  *\n  */\n\n  static FT_Error\n  t1_get_glyph_name( T1_Face     face,\n                     FT_UInt     glyph_index,\n                     FT_Pointer  buffer,\n                     FT_UInt     buffer_max )\n  {\n    FT_STRCPYN( buffer, face->type1.glyph_names[glyph_index], buffer_max );\n\n    return FT_Err_Ok;\n  }\n\n\n  static FT_UInt\n  t1_get_name_index( T1_Face     face,\n                     FT_String*  glyph_name )\n  {\n    FT_Int  i;\n\n\n    for ( i = 0; i < face->type1.num_glyphs; i++ )\n    {\n      FT_String*  gname = face->type1.glyph_names[i];\n\n\n      if ( !ft_strcmp( glyph_name, gname ) )\n        return (FT_UInt)i;\n    }\n\n    return 0;\n  }\n\n\n  static const FT_Service_GlyphDictRec  t1_service_glyph_dict =\n  {\n    (FT_GlyphDict_GetNameFunc)  t1_get_glyph_name,\n    (FT_GlyphDict_NameIndexFunc)t1_get_name_index\n  };\n\n\n  /*\n   *  POSTSCRIPT NAME SERVICE\n   *\n   */\n\n  static const char*\n  t1_get_ps_name( T1_Face  face )\n  {\n    return (const char*) face->type1.font_name;\n  }\n\n\n  static const FT_Service_PsFontNameRec  t1_service_ps_name =\n  {\n    (FT_PsName_GetFunc)t1_get_ps_name\n  };\n\n\n  /*\n   *  MULTIPLE MASTERS SERVICE\n   *\n   */\n\n#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT\n  static const FT_Service_MultiMastersRec  t1_service_multi_masters =\n  {\n    (FT_Get_MM_Func)        T1_Get_Multi_Master,\n    (FT_Set_MM_Design_Func) T1_Set_MM_Design,\n    (FT_Set_MM_Blend_Func)  T1_Set_MM_Blend,\n    (FT_Get_MM_Var_Func)    T1_Get_MM_Var,\n    (FT_Set_Var_Design_Func)T1_Set_Var_Design\n  };\n#endif\n\n\n  /*\n   *  POSTSCRIPT INFO SERVICE\n   *\n   */\n\n  static FT_Error\n  t1_ps_get_font_info( FT_Face          face,\n                       PS_FontInfoRec*  afont_info )\n  {\n    *afont_info = ((T1_Face)face)->type1.font_info;\n\n    return FT_Err_Ok;\n  }\n\n\n  static FT_Error\n  t1_ps_get_font_extra( FT_Face           face,\n                        PS_FontExtraRec*  afont_extra )\n  {\n    *afont_extra = ((T1_Face)face)->type1.font_extra;\n\n    return FT_Err_Ok;\n  }\n\n\n  static FT_Int\n  t1_ps_has_glyph_names( FT_Face  face )\n  {\n    FT_UNUSED( face );\n\n    return 1;\n  }\n\n\n  static FT_Error\n  t1_ps_get_font_private( FT_Face         face,\n                          PS_PrivateRec*  afont_private )\n  {\n    *afont_private = ((T1_Face)face)->type1.private_dict;\n\n    return FT_Err_Ok;\n  }\n\n\n  static FT_Long\n  t1_ps_get_font_value( FT_Face       face,\n                        PS_Dict_Keys  key,\n                        FT_UInt       idx,\n                        void         *value,\n                        FT_Long       value_len )\n  {\n    FT_Long  retval = -1;\n    T1_Face  t1face = (T1_Face)face;\n    T1_Font  type1  = &t1face->type1;\n\n\n    switch ( key )\n    {\n    case PS_DICT_FONT_TYPE:\n      retval = sizeof ( type1->font_type );\n      if ( value && value_len >= retval )\n        *((FT_Byte *)value) = type1->font_type;\n      break;\n\n    case PS_DICT_FONT_MATRIX:\n      if ( idx < sizeof ( type1->font_matrix ) /\n                   sizeof ( type1->font_matrix.xx ) )\n      {\n        FT_Fixed  val = 0;\n\n\n        retval = sizeof ( val );\n        if ( value && value_len >= retval )\n        {\n          switch ( idx )\n          {\n          case 0:\n            val = type1->font_matrix.xx;\n            break;\n          case 1:\n            val = type1->font_matrix.xy;\n            break;\n          case 2:\n            val = type1->font_matrix.yx;\n            break;\n          case 3:\n            val = type1->font_matrix.yy;\n            break;\n          }\n          *((FT_Fixed *)value) = val;\n        }\n      }\n      break;\n\n    case PS_DICT_FONT_BBOX:\n      if ( idx < sizeof ( type1->font_bbox ) /\n                   sizeof ( type1->font_bbox.xMin ) )\n      {\n        FT_Fixed val = 0;\n\n\n        retval = sizeof ( val );\n        if ( value && value_len >= retval )\n        {\n          switch ( idx )\n          {\n          case 0:\n            val = type1->font_bbox.xMin;\n            break;\n          case 1:\n            val = type1->font_bbox.yMin;\n            break;\n          case 2:\n            val = type1->font_bbox.xMax;\n            break;\n          case 3:\n            val = type1->font_bbox.yMax;\n            break;\n          }\n          *((FT_Fixed *)value) = val;\n        }\n      }\n      break;\n\n    case PS_DICT_PAINT_TYPE:\n      retval = sizeof ( type1->paint_type );\n      if ( value && value_len >= retval )\n        *((FT_Byte *)value) = type1->paint_type;\n      break;\n\n    case PS_DICT_FONT_NAME:\n      retval = (FT_Long)( ft_strlen( type1->font_name ) + 1 );\n      if ( value && value_len >= retval )\n        ft_memcpy( value, (void *)( type1->font_name ), retval );\n      break;\n\n    case PS_DICT_UNIQUE_ID:\n      retval = sizeof ( type1->private_dict.unique_id );\n      if ( value && value_len >= retval )\n        *((FT_Int *)value) = type1->private_dict.unique_id;\n      break;\n\n    case PS_DICT_NUM_CHAR_STRINGS:\n      retval = sizeof ( type1->num_glyphs );\n      if ( value && value_len >= retval )\n        *((FT_Int *)value) = type1->num_glyphs;\n      break;\n\n    case PS_DICT_CHAR_STRING_KEY:\n      if ( idx < (FT_UInt)type1->num_glyphs )\n      {\n        retval = (FT_Long)( ft_strlen( type1->glyph_names[idx] ) + 1 );\n        if ( value && value_len >= retval )\n        {\n          ft_memcpy( value, (void *)( type1->glyph_names[idx] ), retval );\n          ((FT_Char *)value)[retval - 1] = (FT_Char)'\\0';\n        }\n      }\n      break;\n\n    case PS_DICT_CHAR_STRING:\n      if ( idx < (FT_UInt)type1->num_glyphs )\n      {\n        retval = (FT_Long)( type1->charstrings_len[idx] + 1 );\n        if ( value && value_len >= retval )\n        {\n          ft_memcpy( value, (void *)( type1->charstrings[idx] ),\n                     retval - 1 );\n          ((FT_Char *)value)[retval - 1] = (FT_Char)'\\0';\n        }\n      }\n      break;\n\n    case PS_DICT_ENCODING_TYPE:\n      retval = sizeof ( type1->encoding_type );\n      if ( value && value_len >= retval )\n        *((T1_EncodingType *)value) = type1->encoding_type;\n      break;\n\n    case PS_DICT_ENCODING_ENTRY:\n      if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY &&\n           idx < (FT_UInt)type1->encoding.num_chars       )\n      {\n        retval = (FT_Long)( ft_strlen( type1->encoding.char_name[idx] ) + 1 );\n        if ( value && value_len >= retval )\n        {\n          ft_memcpy( value, (void *)( type1->encoding.char_name[idx] ),\n                     retval - 1 );\n          ((FT_Char *)value)[retval - 1] = (FT_Char)'\\0';\n        }\n      }\n      break;\n\n    case PS_DICT_NUM_SUBRS:\n      retval = sizeof ( type1->num_subrs );\n      if ( value && value_len >= retval )\n        *((FT_Int *)value) = type1->num_subrs;\n      break;\n\n    case PS_DICT_SUBR:\n      if ( idx < (FT_UInt)type1->num_subrs )\n      {\n        retval = (FT_Long)( type1->subrs_len[idx] + 1 );\n        if ( value && value_len >= retval )\n        {\n          ft_memcpy( value, (void *)( type1->subrs[idx] ), retval - 1 );\n          ((FT_Char *)value)[retval - 1] = (FT_Char)'\\0';\n        }\n      }\n      break;\n\n    case PS_DICT_STD_HW:\n      retval = sizeof ( type1->private_dict.standard_width[0] );\n      if ( value && value_len >= retval )\n        *((FT_UShort *)value) = type1->private_dict.standard_width[0];\n      break;\n\n    case PS_DICT_STD_VW:\n      retval = sizeof ( type1->private_dict.standard_height[0] );\n      if ( value && value_len >= retval )\n        *((FT_UShort *)value) = type1->private_dict.standard_height[0];\n      break;\n\n    case PS_DICT_NUM_BLUE_VALUES:\n      retval = sizeof ( type1->private_dict.num_blue_values );\n      if ( value && value_len >= retval )\n        *((FT_Byte *)value) = type1->private_dict.num_blue_values;\n      break;\n\n    case PS_DICT_BLUE_VALUE:\n      if ( idx < type1->private_dict.num_blue_values )\n      {\n        retval = sizeof ( type1->private_dict.blue_values[idx] );\n        if ( value && value_len >= retval )\n          *((FT_Short *)value) = type1->private_dict.blue_values[idx];\n      }\n      break;\n\n    case PS_DICT_BLUE_SCALE:\n      retval = sizeof ( type1->private_dict.blue_scale );\n      if ( value && value_len >= retval )\n        *((FT_Fixed *)value) = type1->private_dict.blue_scale;\n      break;\n\n    case PS_DICT_BLUE_FUZZ:\n      retval = sizeof ( type1->private_dict.blue_fuzz );\n      if ( value && value_len >= retval )\n        *((FT_Int *)value) = type1->private_dict.blue_fuzz;\n      break;\n\n    case PS_DICT_BLUE_SHIFT:\n      retval = sizeof ( type1->private_dict.blue_shift );\n      if ( value && value_len >= retval )\n        *((FT_Int *)value) = type1->private_dict.blue_shift;\n      break;\n\n    case PS_DICT_NUM_OTHER_BLUES:\n      retval = sizeof ( type1->private_dict.num_other_blues );\n      if ( value && value_len >= retval )\n        *((FT_Byte *)value) = type1->private_dict.num_other_blues;\n      break;\n\n    case PS_DICT_OTHER_BLUE:\n      if ( idx < type1->private_dict.num_other_blues )\n      {\n        retval = sizeof ( type1->private_dict.other_blues[idx] );\n        if ( value && value_len >= retval )\n          *((FT_Short *)value) = type1->private_dict.other_blues[idx];\n      }\n      break;\n\n    case PS_DICT_NUM_FAMILY_BLUES:\n      retval = sizeof ( type1->private_dict.num_family_blues );\n      if ( value && value_len >= retval )\n        *((FT_Byte *)value) = type1->private_dict.num_family_blues;\n      break;\n\n    case PS_DICT_FAMILY_BLUE:\n      if ( idx < type1->private_dict.num_family_blues )\n      {\n        retval = sizeof ( type1->private_dict.family_blues[idx] );\n        if ( value && value_len >= retval )\n          *((FT_Short *)value) = type1->private_dict.family_blues[idx];\n      }\n      break;\n\n    case PS_DICT_NUM_FAMILY_OTHER_BLUES:\n      retval = sizeof ( type1->private_dict.num_family_other_blues );\n      if ( value && value_len >= retval )\n        *((FT_Byte *)value) = type1->private_dict.num_family_other_blues;\n      break;\n\n    case PS_DICT_FAMILY_OTHER_BLUE:\n      if ( idx < type1->private_dict.num_family_other_blues )\n      {\n        retval = sizeof ( type1->private_dict.family_other_blues[idx] );\n        if ( value && value_len >= retval )\n          *((FT_Short *)value) = type1->private_dict.family_other_blues[idx];\n      }\n      break;\n\n    case PS_DICT_NUM_STEM_SNAP_H:\n      retval = sizeof ( type1->private_dict.num_snap_widths );\n      if ( value && value_len >= retval )\n        *((FT_Byte *)value) = type1->private_dict.num_snap_widths;\n      break;\n\n    case PS_DICT_STEM_SNAP_H:\n      if ( idx < type1->private_dict.num_snap_widths )\n      {\n        retval = sizeof ( type1->private_dict.snap_widths[idx] );\n        if ( value && value_len >= retval )\n          *((FT_Short *)value) = type1->private_dict.snap_widths[idx];\n      }\n      break;\n\n    case PS_DICT_NUM_STEM_SNAP_V:\n      retval = sizeof ( type1->private_dict.num_snap_heights );\n      if ( value && value_len >= retval )\n        *((FT_Byte *)value) = type1->private_dict.num_snap_heights;\n      break;\n\n    case PS_DICT_STEM_SNAP_V:\n      if ( idx < type1->private_dict.num_snap_heights )\n      {\n        retval = sizeof ( type1->private_dict.snap_heights[idx] );\n        if ( value && value_len >= retval )\n          *((FT_Short *)value) = type1->private_dict.snap_heights[idx];\n      }\n      break;\n\n    case PS_DICT_RND_STEM_UP:\n      retval = sizeof ( type1->private_dict.round_stem_up );\n      if ( value && value_len >= retval )\n        *((FT_Bool *)value) = type1->private_dict.round_stem_up;\n      break;\n\n    case PS_DICT_FORCE_BOLD:\n      retval = sizeof ( type1->private_dict.force_bold );\n      if ( value && value_len >= retval )\n        *((FT_Bool *)value) = type1->private_dict.force_bold;\n      break;\n\n    case PS_DICT_MIN_FEATURE:\n      if ( idx < sizeof ( type1->private_dict.min_feature ) /\n                   sizeof ( type1->private_dict.min_feature[0] ) )\n      {\n        retval = sizeof ( type1->private_dict.min_feature[idx] );\n        if ( value && value_len >= retval )\n          *((FT_Short *)value) = type1->private_dict.min_feature[idx];\n      }\n      break;\n\n    case PS_DICT_LEN_IV:\n      retval = sizeof ( type1->private_dict.lenIV );\n      if ( value && value_len >= retval )\n        *((FT_Int *)value) = type1->private_dict.lenIV;\n      break;\n\n    case PS_DICT_PASSWORD:\n      retval = sizeof ( type1->private_dict.password );\n      if ( value && value_len >= retval )\n        *((FT_Long *)value) = type1->private_dict.password;\n      break;\n\n    case PS_DICT_LANGUAGE_GROUP:\n      retval = sizeof ( type1->private_dict.language_group );\n      if ( value && value_len >= retval )\n        *((FT_Long *)value) = type1->private_dict.language_group;\n      break;\n\n    case PS_DICT_IS_FIXED_PITCH:\n      retval = sizeof ( type1->font_info.is_fixed_pitch );\n      if ( value && value_len >= retval )\n        *((FT_Bool *)value) = type1->font_info.is_fixed_pitch;\n      break;\n\n    case PS_DICT_UNDERLINE_POSITION:\n      retval = sizeof ( type1->font_info.underline_position );\n      if ( value && value_len >= retval )\n        *((FT_Short *)value) = type1->font_info.underline_position;\n      break;\n\n    case PS_DICT_UNDERLINE_THICKNESS:\n      retval = sizeof ( type1->font_info.underline_thickness );\n      if ( value && value_len >= retval )\n        *((FT_UShort *)value) = type1->font_info.underline_thickness;\n      break;\n\n    case PS_DICT_FS_TYPE:\n      retval = sizeof ( type1->font_extra.fs_type );\n      if ( value && value_len >= retval )\n        *((FT_UShort *)value) = type1->font_extra.fs_type;\n      break;\n\n    case PS_DICT_VERSION:\n      retval = (FT_Long)( ft_strlen( type1->font_info.version ) + 1 );\n      if ( value && value_len >= retval )\n        ft_memcpy( value, (void *)( type1->font_info.version ), retval );\n      break;\n\n    case PS_DICT_NOTICE:\n      retval = (FT_Long)( ft_strlen( type1->font_info.notice ) + 1 );\n      if ( value && value_len >= retval )\n        ft_memcpy( value, (void *)( type1->font_info.notice ), retval );\n      break;\n\n    case PS_DICT_FULL_NAME:\n      retval = (FT_Long)( ft_strlen( type1->font_info.full_name ) + 1 );\n      if ( value && value_len >= retval )\n        ft_memcpy( value, (void *)( type1->font_info.full_name ), retval );\n      break;\n\n    case PS_DICT_FAMILY_NAME:\n      retval = (FT_Long)( ft_strlen( type1->font_info.family_name ) + 1 );\n      if ( value && value_len >= retval )\n        ft_memcpy( value, (void *)( type1->font_info.family_name ), retval );\n      break;\n\n    case PS_DICT_WEIGHT:\n      retval = (FT_Long)( ft_strlen( type1->font_info.weight ) + 1 );\n      if ( value && value_len >= retval )\n        ft_memcpy( value, (void *)( type1->font_info.weight ), retval );\n      break;\n\n    case PS_DICT_ITALIC_ANGLE:\n      retval = sizeof ( type1->font_info.italic_angle );\n      if ( value && value_len >= retval )\n        *((FT_Long *)value) = type1->font_info.italic_angle;\n      break;\n    }\n\n    return retval;\n  }\n\n\n  static const FT_Service_PsInfoRec  t1_service_ps_info =\n  {\n    (PS_GetFontInfoFunc)   t1_ps_get_font_info,\n    (PS_GetFontExtraFunc)  t1_ps_get_font_extra,\n    (PS_HasGlyphNamesFunc) t1_ps_has_glyph_names,\n    (PS_GetFontPrivateFunc)t1_ps_get_font_private,\n    (PS_GetFontValueFunc)  t1_ps_get_font_value,\n  };\n\n\n#ifndef T1_CONFIG_OPTION_NO_AFM\n  static const FT_Service_KerningRec  t1_service_kerning =\n  {\n    T1_Get_Track_Kerning,\n  };\n#endif\n\n\n  /*\n   *  SERVICE LIST\n   *\n   */\n\n  static const FT_ServiceDescRec  t1_services[] =\n  {\n    { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &t1_service_ps_name },\n    { FT_SERVICE_ID_GLYPH_DICT,           &t1_service_glyph_dict },\n    { FT_SERVICE_ID_XF86_NAME,            FT_XF86_FORMAT_TYPE_1 },\n    { FT_SERVICE_ID_POSTSCRIPT_INFO,      &t1_service_ps_info },\n\n#ifndef T1_CONFIG_OPTION_NO_AFM\n    { FT_SERVICE_ID_KERNING,              &t1_service_kerning },\n#endif\n\n#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT\n    { FT_SERVICE_ID_MULTI_MASTERS,        &t1_service_multi_masters },\n#endif\n    { NULL, NULL }\n  };\n\n\n  FT_CALLBACK_DEF( FT_Module_Interface )\n  Get_Interface( FT_Module         module,\n                 const FT_String*  t1_interface )\n  {\n    FT_UNUSED( module );\n\n    return ft_service_list_lookup( t1_services, t1_interface );\n  }\n\n\n#ifndef T1_CONFIG_OPTION_NO_AFM\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    Get_Kerning                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A driver method used to return the kerning vector between two      */\n  /*    glyphs of the same face.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to the source face object.                 */\n  /*                                                                       */\n  /*    left_glyph  :: The index of the left glyph in the kern pair.       */\n  /*                                                                       */\n  /*    right_glyph :: The index of the right glyph in the kern pair.      */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    kerning     :: The kerning vector.  This is in font units for      */\n  /*                   scalable formats, and in pixels for fixed-sizes     */\n  /*                   formats.                                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Only horizontal layouts (left-to-right & right-to-left) are        */\n  /*    supported by this function.  Other layouts, or more sophisticated  */\n  /*    kernings are out of scope of this method (the basic driver         */\n  /*    interface is meant to be simple).                                  */\n  /*                                                                       */\n  /*    They can be implemented by format-specific interfaces.             */\n  /*                                                                       */\n  static FT_Error\n  Get_Kerning( FT_Face     t1face,        /* T1_Face */\n               FT_UInt     left_glyph,\n               FT_UInt     right_glyph,\n               FT_Vector*  kerning )\n  {\n    T1_Face  face = (T1_Face)t1face;\n\n\n    kerning->x = 0;\n    kerning->y = 0;\n\n    if ( face->afm_data )\n      T1_Get_Kerning( (AFM_FontInfo)face->afm_data,\n                      left_glyph,\n                      right_glyph,\n                      kerning );\n\n    return FT_Err_Ok;\n  }\n\n\n#endif /* T1_CONFIG_OPTION_NO_AFM */\n\n\n  FT_CALLBACK_TABLE_DEF\n  const FT_Driver_ClassRec  t1_driver_class =\n  {\n    {\n      FT_MODULE_FONT_DRIVER       |\n      FT_MODULE_DRIVER_SCALABLE   |\n      FT_MODULE_DRIVER_HAS_HINTER,\n\n      sizeof ( FT_DriverRec ),\n\n      \"type1\",\n      0x10000L,\n      0x20000L,\n\n      0,   /* format interface */\n\n      T1_Driver_Init,\n      T1_Driver_Done,\n      Get_Interface,\n    },\n\n    sizeof ( T1_FaceRec ),\n    sizeof ( T1_SizeRec ),\n    sizeof ( T1_GlyphSlotRec ),\n\n    T1_Face_Init,\n    T1_Face_Done,\n    T1_Size_Init,\n    T1_Size_Done,\n    T1_GlyphSlot_Init,\n    T1_GlyphSlot_Done,\n\n    T1_Load_Glyph,\n\n#ifdef T1_CONFIG_OPTION_NO_AFM\n    0,                     /* FT_Face_GetKerningFunc */\n    0,                     /* FT_Face_AttachFunc     */\n#else\n    Get_Kerning,\n    T1_Read_Metrics,\n#endif\n    T1_Get_Advances,\n    T1_Size_Request,\n    0                      /* FT_Size_SelectFunc     */\n  };\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type1/t1driver.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1driver.h                                                             */\n/*                                                                         */\n/*    High-level Type 1 driver interface (specification).                  */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T1DRIVER_H__\n#define __T1DRIVER_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DRIVER_H\n\n\nFT_BEGIN_HEADER\n\n#ifdef FT_CONFIG_OPTION_PIC\n#error \"this module does not support PIC yet\"\n#endif\n\n\n  FT_EXPORT_VAR( const FT_Driver_ClassRec )  t1_driver_class;\n\n\nFT_END_HEADER\n\n#endif /* __T1DRIVER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type1/t1errors.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1errors.h                                                             */\n/*                                                                         */\n/*    Type 1 error codes (specification only).                             */\n/*                                                                         */\n/*  Copyright 2001, 2012 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the Type 1 error enumeration constants.   */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __T1ERRORS_H__\n#define __T1ERRORS_H__\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  T1_Err_\n#define FT_ERR_BASE    FT_Mod_Err_Type1\n\n#include FT_ERRORS_H\n\n#endif /* __T1ERRORS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type1/t1gload.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1gload.c                                                              */\n/*                                                                         */\n/*    Type 1 Glyph Loader (body).                                          */\n/*                                                                         */\n/*  Copyright 1996-2006, 2008-2010, 2013, 2014 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include \"t1gload.h\"\n#include FT_INTERNAL_CALC_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_OUTLINE_H\n#include FT_INTERNAL_POSTSCRIPT_AUX_H\n\n#include \"t1errors.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_t1gload\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /**********                                                      *********/\n  /**********            COMPUTE THE MAXIMUM ADVANCE WIDTH         *********/\n  /**********                                                      *********/\n  /**********    The following code is in charge of computing      *********/\n  /**********    the maximum advance width of the font.  It        *********/\n  /**********    quickly processes each glyph charstring to        *********/\n  /**********    extract the value from either a `sbw' or `seac'   *********/\n  /**********    operator.                                         *********/\n  /**********                                                      *********/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  FT_LOCAL_DEF( FT_Error )\n  T1_Parse_Glyph_And_Get_Char_String( T1_Decoder  decoder,\n                                      FT_UInt     glyph_index,\n                                      FT_Data*    char_string )\n  {\n    T1_Face   face  = (T1_Face)decoder->builder.face;\n    T1_Font   type1 = &face->type1;\n    FT_Error  error = FT_Err_Ok;\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n    FT_Incremental_InterfaceRec *inc =\n                      face->root.internal->incremental_interface;\n#endif\n\n\n    decoder->font_matrix = type1->font_matrix;\n    decoder->font_offset = type1->font_offset;\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n\n    /* For incremental fonts get the character data using the */\n    /* callback function.                                     */\n    if ( inc )\n      error = inc->funcs->get_glyph_data( inc->object,\n                                          glyph_index, char_string );\n    else\n\n#endif /* FT_CONFIG_OPTION_INCREMENTAL */\n\n    /* For ordinary fonts get the character data stored in the face record. */\n    {\n      char_string->pointer = type1->charstrings[glyph_index];\n      char_string->length  = (FT_Int)type1->charstrings_len[glyph_index];\n    }\n\n    if ( !error )\n      error = decoder->funcs.parse_charstrings(\n                decoder, (FT_Byte*)char_string->pointer,\n                char_string->length );\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n\n    /* Incremental fonts can optionally override the metrics. */\n    if ( !error && inc && inc->funcs->get_glyph_metrics )\n    {\n      FT_Incremental_MetricsRec  metrics;\n\n\n      metrics.bearing_x = FIXED_TO_INT( decoder->builder.left_bearing.x );\n      metrics.bearing_y = 0;\n      metrics.advance   = FIXED_TO_INT( decoder->builder.advance.x );\n      metrics.advance_v = FIXED_TO_INT( decoder->builder.advance.y );\n\n      error = inc->funcs->get_glyph_metrics( inc->object,\n                                             glyph_index, FALSE, &metrics );\n\n      decoder->builder.left_bearing.x = INT_TO_FIXED( metrics.bearing_x );\n      decoder->builder.advance.x      = INT_TO_FIXED( metrics.advance );\n      decoder->builder.advance.y      = INT_TO_FIXED( metrics.advance_v );\n    }\n\n#endif /* FT_CONFIG_OPTION_INCREMENTAL */\n\n    return error;\n  }\n\n\n  FT_CALLBACK_DEF( FT_Error )\n  T1_Parse_Glyph( T1_Decoder  decoder,\n                  FT_UInt     glyph_index )\n  {\n    FT_Data   glyph_data;\n    FT_Error  error = T1_Parse_Glyph_And_Get_Char_String(\n                        decoder, glyph_index, &glyph_data );\n\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n\n    if ( !error )\n    {\n      T1_Face  face = (T1_Face)decoder->builder.face;\n\n\n      if ( face->root.internal->incremental_interface )\n        face->root.internal->incremental_interface->funcs->free_glyph_data(\n          face->root.internal->incremental_interface->object,\n          &glyph_data );\n    }\n\n#endif /* FT_CONFIG_OPTION_INCREMENTAL */\n\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  T1_Compute_Max_Advance( T1_Face  face,\n                          FT_Pos*  max_advance )\n  {\n    FT_Error       error;\n    T1_DecoderRec  decoder;\n    FT_Int         glyph_index;\n    T1_Font        type1 = &face->type1;\n    PSAux_Service  psaux = (PSAux_Service)face->psaux;\n\n\n    FT_ASSERT( ( face->len_buildchar == 0 ) == ( face->buildchar == NULL ) );\n\n    *max_advance = 0;\n\n    /* initialize load decoder */\n    error = psaux->t1_decoder_funcs->init( &decoder,\n                                           (FT_Face)face,\n                                           0, /* size       */\n                                           0, /* glyph slot */\n                                           (FT_Byte**)type1->glyph_names,\n                                           face->blend,\n                                           0,\n                                           FT_RENDER_MODE_NORMAL,\n                                           T1_Parse_Glyph );\n    if ( error )\n      return error;\n\n    decoder.builder.metrics_only = 1;\n    decoder.builder.load_points  = 0;\n\n    decoder.num_subrs     = type1->num_subrs;\n    decoder.subrs         = type1->subrs;\n    decoder.subrs_len     = type1->subrs_len;\n\n    decoder.buildchar     = face->buildchar;\n    decoder.len_buildchar = face->len_buildchar;\n\n    *max_advance = 0;\n\n    /* for each glyph, parse the glyph charstring and extract */\n    /* the advance width                                      */\n    for ( glyph_index = 0; glyph_index < type1->num_glyphs; glyph_index++ )\n    {\n      /* now get load the unscaled outline */\n      (void)T1_Parse_Glyph( &decoder, glyph_index );\n      if ( glyph_index == 0 || decoder.builder.advance.x > *max_advance )\n        *max_advance = decoder.builder.advance.x;\n\n      /* ignore the error if one occurred - skip to next glyph */\n    }\n\n    psaux->t1_decoder_funcs->done( &decoder );\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  T1_Get_Advances( FT_Face    t1face,        /* T1_Face */\n                   FT_UInt    first,\n                   FT_UInt    count,\n                   FT_Int32   load_flags,\n                   FT_Fixed*  advances )\n  {\n    T1_Face        face  = (T1_Face)t1face;\n    T1_DecoderRec  decoder;\n    T1_Font        type1 = &face->type1;\n    PSAux_Service  psaux = (PSAux_Service)face->psaux;\n    FT_UInt        nn;\n    FT_Error       error;\n\n\n    if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )\n    {\n      for ( nn = 0; nn < count; nn++ )\n        advances[nn] = 0;\n\n      return FT_Err_Ok;\n    }\n\n    error = psaux->t1_decoder_funcs->init( &decoder,\n                                           (FT_Face)face,\n                                           0, /* size       */\n                                           0, /* glyph slot */\n                                           (FT_Byte**)type1->glyph_names,\n                                           face->blend,\n                                           0,\n                                           FT_RENDER_MODE_NORMAL,\n                                           T1_Parse_Glyph );\n    if ( error )\n      return error;\n\n    decoder.builder.metrics_only = 1;\n    decoder.builder.load_points  = 0;\n\n    decoder.num_subrs = type1->num_subrs;\n    decoder.subrs     = type1->subrs;\n    decoder.subrs_len = type1->subrs_len;\n\n    decoder.buildchar     = face->buildchar;\n    decoder.len_buildchar = face->len_buildchar;\n\n    for ( nn = 0; nn < count; nn++ )\n    {\n      error = T1_Parse_Glyph( &decoder, first + nn );\n      if ( !error )\n        advances[nn] = FIXED_TO_INT( decoder.builder.advance.x );\n      else\n        advances[nn] = 0;\n    }\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  T1_Load_Glyph( FT_GlyphSlot  t1glyph,          /* T1_GlyphSlot */\n                 FT_Size       t1size,           /* T1_Size      */\n                 FT_UInt       glyph_index,\n                 FT_Int32      load_flags )\n  {\n    T1_GlyphSlot            glyph = (T1_GlyphSlot)t1glyph;\n    FT_Error                error;\n    T1_DecoderRec           decoder;\n    T1_Face                 face = (T1_Face)t1glyph->face;\n    FT_Bool                 hinting;\n    T1_Font                 type1         = &face->type1;\n    PSAux_Service           psaux         = (PSAux_Service)face->psaux;\n    const T1_Decoder_Funcs  decoder_funcs = psaux->t1_decoder_funcs;\n\n    FT_Matrix               font_matrix;\n    FT_Vector               font_offset;\n    FT_Data                 glyph_data;\n    FT_Bool                 must_finish_decoder = FALSE;\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n    FT_Bool                 glyph_data_loaded = 0;\n#endif\n\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n    if ( glyph_index >= (FT_UInt)face->root.num_glyphs &&\n         !face->root.internal->incremental_interface   )\n#else\n    if ( glyph_index >= (FT_UInt)face->root.num_glyphs )\n#endif /* FT_CONFIG_OPTION_INCREMENTAL */\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    FT_TRACE1(( \"T1_Load_Glyph: glyph index %d\\n\", glyph_index ));\n\n    FT_ASSERT( ( face->len_buildchar == 0 ) == ( face->buildchar == NULL ) );\n\n    if ( load_flags & FT_LOAD_NO_RECURSE )\n      load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;\n\n    if ( t1size )\n    {\n      glyph->x_scale = t1size->metrics.x_scale;\n      glyph->y_scale = t1size->metrics.y_scale;\n    }\n    else\n    {\n      glyph->x_scale = 0x10000L;\n      glyph->y_scale = 0x10000L;\n    }\n\n    t1glyph->outline.n_points   = 0;\n    t1glyph->outline.n_contours = 0;\n\n    hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE   ) == 0 &&\n                       ( load_flags & FT_LOAD_NO_HINTING ) == 0 );\n\n    t1glyph->format = FT_GLYPH_FORMAT_OUTLINE;\n\n    error = decoder_funcs->init( &decoder,\n                                 t1glyph->face,\n                                 t1size,\n                                 t1glyph,\n                                 (FT_Byte**)type1->glyph_names,\n                                 face->blend,\n                                 FT_BOOL( hinting ),\n                                 FT_LOAD_TARGET_MODE( load_flags ),\n                                 T1_Parse_Glyph );\n    if ( error )\n      goto Exit;\n\n    must_finish_decoder = TRUE;\n\n    decoder.builder.no_recurse = FT_BOOL(\n                                   ( load_flags & FT_LOAD_NO_RECURSE ) != 0 );\n\n    decoder.num_subrs     = type1->num_subrs;\n    decoder.subrs         = type1->subrs;\n    decoder.subrs_len     = type1->subrs_len;\n\n    decoder.buildchar     = face->buildchar;\n    decoder.len_buildchar = face->len_buildchar;\n\n    /* now load the unscaled outline */\n    error = T1_Parse_Glyph_And_Get_Char_String( &decoder, glyph_index,\n                                                &glyph_data );\n    if ( error )\n      goto Exit;\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n    glyph_data_loaded = 1;\n#endif\n\n    font_matrix = decoder.font_matrix;\n    font_offset = decoder.font_offset;\n\n    /* save new glyph tables */\n    decoder_funcs->done( &decoder );\n\n    must_finish_decoder = FALSE;\n\n    /* now, set the metrics -- this is rather simple, as   */\n    /* the left side bearing is the xMin, and the top side */\n    /* bearing the yMax                                    */\n    if ( !error )\n    {\n      t1glyph->outline.flags &= FT_OUTLINE_OWNER;\n      t1glyph->outline.flags |= FT_OUTLINE_REVERSE_FILL;\n\n      /* for composite glyphs, return only left side bearing and */\n      /* advance width                                           */\n      if ( load_flags & FT_LOAD_NO_RECURSE )\n      {\n        FT_Slot_Internal  internal = t1glyph->internal;\n\n\n        t1glyph->metrics.horiBearingX =\n          FIXED_TO_INT( decoder.builder.left_bearing.x );\n        t1glyph->metrics.horiAdvance  =\n          FIXED_TO_INT( decoder.builder.advance.x );\n\n        internal->glyph_matrix      = font_matrix;\n        internal->glyph_delta       = font_offset;\n        internal->glyph_transformed = 1;\n      }\n      else\n      {\n        FT_BBox            cbox;\n        FT_Glyph_Metrics*  metrics = &t1glyph->metrics;\n        FT_Vector          advance;\n\n\n        /* copy the _unscaled_ advance width */\n        metrics->horiAdvance =\n          FIXED_TO_INT( decoder.builder.advance.x );\n        t1glyph->linearHoriAdvance =\n          FIXED_TO_INT( decoder.builder.advance.x );\n        t1glyph->internal->glyph_transformed = 0;\n\n        if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )\n        {\n          /* make up vertical ones */\n          metrics->vertAdvance = ( face->type1.font_bbox.yMax -\n                                   face->type1.font_bbox.yMin ) >> 16;\n          t1glyph->linearVertAdvance = metrics->vertAdvance;\n        }\n        else\n        {\n          metrics->vertAdvance =\n            FIXED_TO_INT( decoder.builder.advance.y );\n          t1glyph->linearVertAdvance =\n            FIXED_TO_INT( decoder.builder.advance.y );\n        }\n\n        t1glyph->format = FT_GLYPH_FORMAT_OUTLINE;\n\n        if ( t1size && t1size->metrics.y_ppem < 24 )\n          t1glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION;\n\n#if 1\n        /* apply the font matrix, if any */\n        if ( font_matrix.xx != 0x10000L || font_matrix.yy != font_matrix.xx ||\n             font_matrix.xy != 0        || font_matrix.yx != 0              )\n          FT_Outline_Transform( &t1glyph->outline, &font_matrix );\n\n        if ( font_offset.x || font_offset.y )\n          FT_Outline_Translate( &t1glyph->outline,\n                                font_offset.x,\n                                font_offset.y );\n\n        advance.x = metrics->horiAdvance;\n        advance.y = 0;\n        FT_Vector_Transform( &advance, &font_matrix );\n        metrics->horiAdvance = advance.x + font_offset.x;\n        advance.x = 0;\n        advance.y = metrics->vertAdvance;\n        FT_Vector_Transform( &advance, &font_matrix );\n        metrics->vertAdvance = advance.y + font_offset.y;\n#endif\n\n        if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 )\n        {\n          /* scale the outline and the metrics */\n          FT_Int       n;\n          FT_Outline*  cur = decoder.builder.base;\n          FT_Vector*   vec = cur->points;\n          FT_Fixed     x_scale = glyph->x_scale;\n          FT_Fixed     y_scale = glyph->y_scale;\n\n\n          /* First of all, scale the points, if we are not hinting */\n          if ( !hinting || ! decoder.builder.hints_funcs )\n            for ( n = cur->n_points; n > 0; n--, vec++ )\n            {\n              vec->x = FT_MulFix( vec->x, x_scale );\n              vec->y = FT_MulFix( vec->y, y_scale );\n            }\n\n          /* Then scale the metrics */\n          metrics->horiAdvance = FT_MulFix( metrics->horiAdvance, x_scale );\n          metrics->vertAdvance = FT_MulFix( metrics->vertAdvance, y_scale );\n        }\n\n        /* compute the other metrics */\n        FT_Outline_Get_CBox( &t1glyph->outline, &cbox );\n\n        metrics->width  = cbox.xMax - cbox.xMin;\n        metrics->height = cbox.yMax - cbox.yMin;\n\n        metrics->horiBearingX = cbox.xMin;\n        metrics->horiBearingY = cbox.yMax;\n\n        if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )\n        {\n          /* make up vertical ones */\n          ft_synthesize_vertical_metrics( metrics,\n                                          metrics->vertAdvance );\n        }\n      }\n\n      /* Set control data to the glyph charstrings.  Note that this is */\n      /* _not_ zero-terminated.                                        */\n      t1glyph->control_data = (FT_Byte*)glyph_data.pointer;\n      t1glyph->control_len  = glyph_data.length;\n    }\n\n\n  Exit:\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n    if ( glyph_data_loaded && face->root.internal->incremental_interface )\n    {\n      face->root.internal->incremental_interface->funcs->free_glyph_data(\n        face->root.internal->incremental_interface->object,\n        &glyph_data );\n\n      /* Set the control data to null - it is no longer available if   */\n      /* loaded incrementally.                                         */\n      t1glyph->control_data = 0;\n      t1glyph->control_len  = 0;\n    }\n#endif\n\n    if ( must_finish_decoder )\n      decoder_funcs->done( &decoder );\n\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type1/t1gload.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1gload.h                                                              */\n/*                                                                         */\n/*    Type 1 Glyph Loader (specification).                                 */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2008, 2011 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T1GLOAD_H__\n#define __T1GLOAD_H__\n\n\n#include <ft2build.h>\n#include \"t1objs.h\"\n\n\nFT_BEGIN_HEADER\n\n\n  FT_LOCAL( FT_Error )\n  T1_Compute_Max_Advance( T1_Face  face,\n                          FT_Pos*  max_advance );\n\n  FT_LOCAL( FT_Error )\n  T1_Get_Advances( FT_Face    face,\n                   FT_UInt    first,\n                   FT_UInt    count,\n                   FT_Int32   load_flags,\n                   FT_Fixed*  advances );\n\n  FT_LOCAL( FT_Error )\n  T1_Load_Glyph( FT_GlyphSlot  glyph,\n                 FT_Size       size,\n                 FT_UInt       glyph_index,\n                 FT_Int32      load_flags );\n\n\nFT_END_HEADER\n\n#endif /* __T1GLOAD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type1/t1load.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1load.c                                                               */\n/*                                                                         */\n/*    Type 1 font loader (body).                                           */\n/*                                                                         */\n/*  Copyright 1996-2014 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This is the new and improved Type 1 data loader for FreeType 2.  The  */\n  /* old loader has several problems: it is slow, complex, difficult to    */\n  /* maintain, and contains incredible hacks to make it accept some        */\n  /* ill-formed Type 1 fonts without hiccup-ing.  Moreover, about 5% of    */\n  /* the Type 1 fonts on my machine still aren't loaded correctly by it.   */\n  /*                                                                       */\n  /* This version is much simpler, much faster and also easier to read and */\n  /* maintain by a great order of magnitude.  The idea behind it is to     */\n  /* _not_ try to read the Type 1 token stream with a state machine (i.e.  */\n  /* a Postscript-like interpreter) but rather to perform simple pattern   */\n  /* matching.                                                             */\n  /*                                                                       */\n  /* Indeed, nearly all data definitions follow a simple pattern like      */\n  /*                                                                       */\n  /*  ... /Field <data> ...                                                */\n  /*                                                                       */\n  /* where <data> can be a number, a boolean, a string, or an array of     */\n  /* numbers.  There are a few exceptions, namely the encoding, font name, */\n  /* charstrings, and subrs; they are handled with a special pattern       */\n  /* matching routine.                                                     */\n  /*                                                                       */\n  /* All other common cases are handled very simply.  The matching rules   */\n  /* are defined in the file `t1tokens.h' through the use of several       */\n  /* macros calls PARSE_XXX.  This file is included twice here; the first  */\n  /* time to generate parsing callback functions, the second time to       */\n  /* generate a table of keywords (with pointers to the associated         */\n  /* callback functions).                                                  */\n  /*                                                                       */\n  /* The function `parse_dict' simply scans *linearly* a given dictionary  */\n  /* (either the top-level or private one) and calls the appropriate       */\n  /* callback when it encounters an immediate keyword.                     */\n  /*                                                                       */\n  /* This is by far the fastest way one can find to parse and read all     */\n  /* data.                                                                 */\n  /*                                                                       */\n  /* This led to tremendous code size reduction.  Note that later, the     */\n  /* glyph loader will also be _greatly_ simplified, and the automatic     */\n  /* hinter will replace the clumsy `t1hinter'.                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_CONFIG_CONFIG_H\n#include FT_MULTIPLE_MASTERS_H\n#include FT_INTERNAL_TYPE1_TYPES_H\n#include FT_INTERNAL_CALC_H\n\n#include \"t1load.h\"\n#include \"t1errors.h\"\n\n\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\n#define IS_INCREMENTAL  (FT_Bool)( face->root.internal->incremental_interface != 0 )\n#else\n#define IS_INCREMENTAL  0\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_t1load\n\n\n#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    MULTIPLE MASTERS SUPPORT                   *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static FT_Error\n  t1_allocate_blend( T1_Face  face,\n                     FT_UInt  num_designs,\n                     FT_UInt  num_axis )\n  {\n    PS_Blend   blend;\n    FT_Memory  memory = face->root.memory;\n    FT_Error   error  = FT_Err_Ok;\n\n\n    blend = face->blend;\n    if ( !blend )\n    {\n      if ( FT_NEW( blend ) )\n        goto Exit;\n\n      blend->num_default_design_vector = 0;\n\n      face->blend = blend;\n    }\n\n    /* allocate design data if needed */\n    if ( num_designs > 0 )\n    {\n      if ( blend->num_designs == 0 )\n      {\n        FT_UInt  nn;\n\n\n        /* allocate the blend `private' and `font_info' dictionaries */\n        if ( FT_NEW_ARRAY( blend->font_infos[1], num_designs     ) ||\n             FT_NEW_ARRAY( blend->privates  [1], num_designs     ) ||\n             FT_NEW_ARRAY( blend->bboxes    [1], num_designs     ) ||\n             FT_NEW_ARRAY( blend->weight_vector, num_designs * 2 ) )\n          goto Exit;\n\n        blend->default_weight_vector = blend->weight_vector + num_designs;\n\n        blend->font_infos[0] = &face->type1.font_info;\n        blend->privates  [0] = &face->type1.private_dict;\n        blend->bboxes    [0] = &face->type1.font_bbox;\n\n        for ( nn = 2; nn <= num_designs; nn++ )\n        {\n          blend->font_infos[nn] = blend->font_infos[nn - 1] + 1;\n          blend->privates  [nn] = blend->privates  [nn - 1] + 1;\n          blend->bboxes    [nn] = blend->bboxes    [nn - 1] + 1;\n        }\n\n        blend->num_designs = num_designs;\n      }\n      else if ( blend->num_designs != num_designs )\n        goto Fail;\n    }\n\n    /* allocate axis data if needed */\n    if ( num_axis > 0 )\n    {\n      if ( blend->num_axis != 0 && blend->num_axis != num_axis )\n        goto Fail;\n\n      blend->num_axis = num_axis;\n    }\n\n    /* allocate the blend design pos table if needed */\n    num_designs = blend->num_designs;\n    num_axis    = blend->num_axis;\n    if ( num_designs && num_axis && blend->design_pos[0] == 0 )\n    {\n      FT_UInt  n;\n\n\n      if ( FT_NEW_ARRAY( blend->design_pos[0], num_designs * num_axis ) )\n        goto Exit;\n\n      for ( n = 1; n < num_designs; n++ )\n        blend->design_pos[n] = blend->design_pos[0] + num_axis * n;\n    }\n\n  Exit:\n    return error;\n\n  Fail:\n    error = FT_THROW( Invalid_File_Format );\n    goto Exit;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  T1_Get_Multi_Master( T1_Face           face,\n                       FT_Multi_Master*  master )\n  {\n    PS_Blend  blend = face->blend;\n    FT_UInt   n;\n    FT_Error  error;\n\n\n    error = FT_THROW( Invalid_Argument );\n\n    if ( blend )\n    {\n      master->num_axis    = blend->num_axis;\n      master->num_designs = blend->num_designs;\n\n      for ( n = 0; n < blend->num_axis; n++ )\n      {\n        FT_MM_Axis*   axis = master->axis + n;\n        PS_DesignMap  map = blend->design_map + n;\n\n\n        axis->name    = blend->axis_names[n];\n        axis->minimum = map->design_points[0];\n        axis->maximum = map->design_points[map->num_points - 1];\n      }\n\n      error = FT_Err_Ok;\n    }\n\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Given a normalized (blend) coordinate, figure out the design          */\n  /* coordinate appropriate for that value.                                */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Fixed )\n  mm_axis_unmap( PS_DesignMap  axismap,\n                 FT_Fixed      ncv )\n  {\n    int  j;\n\n\n    if ( ncv <= axismap->blend_points[0] )\n      return INT_TO_FIXED( axismap->design_points[0] );\n\n    for ( j = 1; j < axismap->num_points; ++j )\n    {\n      if ( ncv <= axismap->blend_points[j] )\n        return INT_TO_FIXED( axismap->design_points[j - 1] ) +\n               ( axismap->design_points[j] - axismap->design_points[j - 1] ) *\n               FT_DivFix( ncv - axismap->blend_points[j - 1],\n                          axismap->blend_points[j] -\n                            axismap->blend_points[j - 1] );\n    }\n\n    return INT_TO_FIXED( axismap->design_points[axismap->num_points - 1] );\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Given a vector of weights, one for each design, figure out the        */\n  /* normalized axis coordinates which gave rise to those weights.         */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  mm_weights_unmap( FT_Fixed*  weights,\n                    FT_Fixed*  axiscoords,\n                    FT_UInt    axis_count )\n  {\n    FT_ASSERT( axis_count <= T1_MAX_MM_AXIS );\n\n    if ( axis_count == 1 )\n      axiscoords[0] = weights[1];\n\n    else if ( axis_count == 2 )\n    {\n      axiscoords[0] = weights[3] + weights[1];\n      axiscoords[1] = weights[3] + weights[2];\n    }\n\n    else if ( axis_count == 3 )\n    {\n      axiscoords[0] = weights[7] + weights[5] + weights[3] + weights[1];\n      axiscoords[1] = weights[7] + weights[6] + weights[3] + weights[2];\n      axiscoords[2] = weights[7] + weights[6] + weights[5] + weights[4];\n    }\n\n    else\n    {\n      axiscoords[0] = weights[15] + weights[13] + weights[11] + weights[9] +\n                        weights[7] + weights[5] + weights[3] + weights[1];\n      axiscoords[1] = weights[15] + weights[14] + weights[11] + weights[10] +\n                        weights[7] + weights[6] + weights[3] + weights[2];\n      axiscoords[2] = weights[15] + weights[14] + weights[13] + weights[12] +\n                        weights[7] + weights[6] + weights[5] + weights[4];\n      axiscoords[3] = weights[15] + weights[14] + weights[13] + weights[12] +\n                        weights[11] + weights[10] + weights[9] + weights[8];\n    }\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Just a wrapper around T1_Get_Multi_Master to support the different    */\n  /*  arguments needed by the GX var distortable fonts.                    */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  T1_Get_MM_Var( T1_Face      face,\n                 FT_MM_Var*  *master )\n  {\n    FT_Memory        memory = face->root.memory;\n    FT_MM_Var       *mmvar = NULL;\n    FT_Multi_Master  mmaster;\n    FT_Error         error;\n    FT_UInt          i;\n    FT_Fixed         axiscoords[T1_MAX_MM_AXIS];\n    PS_Blend         blend = face->blend;\n\n\n    error = T1_Get_Multi_Master( face, &mmaster );\n    if ( error )\n      goto Exit;\n    if ( FT_ALLOC( mmvar,\n                   sizeof ( FT_MM_Var ) +\n                     mmaster.num_axis * sizeof ( FT_Var_Axis ) ) )\n      goto Exit;\n\n    mmvar->num_axis        = mmaster.num_axis;\n    mmvar->num_designs     = mmaster.num_designs;\n    mmvar->num_namedstyles = ~0U;                        /* Does not apply */\n    mmvar->axis            = (FT_Var_Axis*)&mmvar[1];\n                                      /* Point to axes after MM_Var struct */\n    mmvar->namedstyle      = NULL;\n\n    for ( i = 0 ; i < mmaster.num_axis; ++i )\n    {\n      mmvar->axis[i].name    = mmaster.axis[i].name;\n      mmvar->axis[i].minimum = INT_TO_FIXED( mmaster.axis[i].minimum);\n      mmvar->axis[i].maximum = INT_TO_FIXED( mmaster.axis[i].maximum);\n      mmvar->axis[i].def     = ( mmvar->axis[i].minimum +\n                                   mmvar->axis[i].maximum ) / 2;\n                            /* Does not apply.  But this value is in range */\n      mmvar->axis[i].strid   = ~0U;                      /* Does not apply */\n      mmvar->axis[i].tag     = ~0U;                      /* Does not apply */\n\n      if ( ft_strcmp( mmvar->axis[i].name, \"Weight\" ) == 0 )\n        mmvar->axis[i].tag = FT_MAKE_TAG( 'w', 'g', 'h', 't' );\n      else if ( ft_strcmp( mmvar->axis[i].name, \"Width\" ) == 0 )\n        mmvar->axis[i].tag = FT_MAKE_TAG( 'w', 'd', 't', 'h' );\n      else if ( ft_strcmp( mmvar->axis[i].name, \"OpticalSize\" ) == 0 )\n        mmvar->axis[i].tag = FT_MAKE_TAG( 'o', 'p', 's', 'z' );\n    }\n\n    if ( blend->num_designs == ( 1U << blend->num_axis ) )\n    {\n      mm_weights_unmap( blend->default_weight_vector,\n                        axiscoords,\n                        blend->num_axis );\n\n      for ( i = 0; i < mmaster.num_axis; ++i )\n        mmvar->axis[i].def = mm_axis_unmap( &blend->design_map[i],\n                                            axiscoords[i] );\n    }\n\n    *master = mmvar;\n\n  Exit:\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  T1_Set_MM_Blend( T1_Face    face,\n                   FT_UInt    num_coords,\n                   FT_Fixed*  coords )\n  {\n    PS_Blend  blend = face->blend;\n    FT_Error  error;\n    FT_UInt   n, m;\n\n\n    error = FT_ERR( Invalid_Argument );\n\n    if ( blend && blend->num_axis == num_coords )\n    {\n      /* recompute the weight vector from the blend coordinates */\n      for ( n = 0; n < blend->num_designs; n++ )\n      {\n        FT_Fixed  result = 0x10000L;  /* 1.0 fixed */\n\n\n        for ( m = 0; m < blend->num_axis; m++ )\n        {\n          FT_Fixed  factor;\n\n\n          /* get current blend axis position */\n          factor = coords[m];\n          if ( factor < 0 )\n            factor = 0;\n          if ( factor > 0x10000L )\n            factor = 0x10000L;\n\n          if ( ( n & ( 1 << m ) ) == 0 )\n            factor = 0x10000L - factor;\n\n          result = FT_MulFix( result, factor );\n        }\n        blend->weight_vector[n] = result;\n      }\n\n      error = FT_Err_Ok;\n    }\n\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  T1_Set_MM_Design( T1_Face   face,\n                    FT_UInt   num_coords,\n                    FT_Long*  coords )\n  {\n    PS_Blend  blend = face->blend;\n    FT_Error  error;\n    FT_UInt   n, p;\n\n\n    error = FT_ERR( Invalid_Argument );\n    if ( blend && blend->num_axis == num_coords )\n    {\n      /* compute the blend coordinates through the blend design map */\n      FT_Fixed  final_blends[T1_MAX_MM_DESIGNS];\n\n\n      for ( n = 0; n < blend->num_axis; n++ )\n      {\n        FT_Long       design  = coords[n];\n        FT_Fixed      the_blend;\n        PS_DesignMap  map     = blend->design_map + n;\n        FT_Long*      designs = map->design_points;\n        FT_Fixed*     blends  = map->blend_points;\n        FT_Int        before  = -1, after = -1;\n\n\n        for ( p = 0; p < (FT_UInt)map->num_points; p++ )\n        {\n          FT_Long  p_design = designs[p];\n\n\n          /* exact match? */\n          if ( design == p_design )\n          {\n            the_blend = blends[p];\n            goto Found;\n          }\n\n          if ( design < p_design )\n          {\n            after = p;\n            break;\n          }\n\n          before = p;\n        }\n\n        /* now interpolate if necessary */\n        if ( before < 0 )\n          the_blend = blends[0];\n\n        else if ( after < 0 )\n          the_blend = blends[map->num_points - 1];\n\n        else\n          the_blend = FT_MulDiv( design         - designs[before],\n                                 blends [after] - blends [before],\n                                 designs[after] - designs[before] );\n\n      Found:\n        final_blends[n] = the_blend;\n      }\n\n      error = T1_Set_MM_Blend( face, num_coords, final_blends );\n    }\n\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Just a wrapper around T1_Set_MM_Design to support the different       */\n  /* arguments needed by the GX var distortable fonts.                     */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  T1_Set_Var_Design( T1_Face    face,\n                     FT_UInt    num_coords,\n                     FT_Fixed*  coords )\n  {\n     FT_Long   lcoords[4];          /* maximum axis count is 4 */\n     FT_UInt   i;\n     FT_Error  error;\n\n\n     error = FT_ERR( Invalid_Argument );\n     if ( num_coords <= 4 && num_coords > 0 )\n     {\n       for ( i = 0; i < num_coords; ++i )\n         lcoords[i] = FIXED_TO_INT( coords[i] );\n       error = T1_Set_MM_Design( face, num_coords, lcoords );\n     }\n\n     return error;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  T1_Done_Blend( T1_Face  face )\n  {\n    FT_Memory  memory = face->root.memory;\n    PS_Blend   blend  = face->blend;\n\n\n    if ( blend )\n    {\n      FT_UInt  num_designs = blend->num_designs;\n      FT_UInt  num_axis    = blend->num_axis;\n      FT_UInt  n;\n\n\n      /* release design pos table */\n      FT_FREE( blend->design_pos[0] );\n      for ( n = 1; n < num_designs; n++ )\n        blend->design_pos[n] = NULL;\n\n      /* release blend `private' and `font info' dictionaries */\n      FT_FREE( blend->privates[1] );\n      FT_FREE( blend->font_infos[1] );\n      FT_FREE( blend->bboxes[1] );\n\n      for ( n = 0; n < num_designs; n++ )\n      {\n        blend->privates  [n] = NULL;\n        blend->font_infos[n] = NULL;\n        blend->bboxes    [n] = NULL;\n      }\n\n      /* release weight vectors */\n      FT_FREE( blend->weight_vector );\n      blend->default_weight_vector = NULL;\n\n      /* release axis names */\n      for ( n = 0; n < num_axis; n++ )\n        FT_FREE( blend->axis_names[n] );\n\n      /* release design map */\n      for ( n = 0; n < num_axis; n++ )\n      {\n        PS_DesignMap  dmap = blend->design_map + n;\n\n\n        FT_FREE( dmap->design_points );\n        dmap->num_points = 0;\n      }\n\n      FT_FREE( face->blend );\n    }\n  }\n\n\n  static void\n  parse_blend_axis_types( T1_Face    face,\n                          T1_Loader  loader )\n  {\n    T1_TokenRec  axis_tokens[T1_MAX_MM_AXIS];\n    FT_Int       n, num_axis;\n    FT_Error     error = FT_Err_Ok;\n    PS_Blend     blend;\n    FT_Memory    memory;\n\n\n    /* take an array of objects */\n    T1_ToTokenArray( &loader->parser, axis_tokens,\n                     T1_MAX_MM_AXIS, &num_axis );\n    if ( num_axis < 0 )\n    {\n      error = FT_ERR( Ignore );\n      goto Exit;\n    }\n    if ( num_axis == 0 || num_axis > T1_MAX_MM_AXIS )\n    {\n      FT_ERROR(( \"parse_blend_axis_types: incorrect number of axes: %d\\n\",\n                 num_axis ));\n      error = FT_THROW( Invalid_File_Format );\n      goto Exit;\n    }\n\n    /* allocate blend if necessary */\n    error = t1_allocate_blend( face, 0, (FT_UInt)num_axis );\n    if ( error )\n      goto Exit;\n\n    blend  = face->blend;\n    memory = face->root.memory;\n\n    /* each token is an immediate containing the name of the axis */\n    for ( n = 0; n < num_axis; n++ )\n    {\n      T1_Token    token = axis_tokens + n;\n      FT_Byte*    name;\n      FT_PtrDist  len;\n\n\n      /* skip first slash, if any */\n      if ( token->start[0] == '/' )\n        token->start++;\n\n      len = token->limit - token->start;\n      if ( len == 0 )\n      {\n        error = FT_THROW( Invalid_File_Format );\n        goto Exit;\n      }\n\n      if ( FT_ALLOC( blend->axis_names[n], (FT_Long)( len + 1 ) ) )\n        goto Exit;\n\n      name = (FT_Byte*)blend->axis_names[n];\n      FT_MEM_COPY( name, token->start, len );\n      name[len] = '\\0';\n    }\n\n  Exit:\n    loader->parser.root.error = error;\n  }\n\n\n  static void\n  parse_blend_design_positions( T1_Face    face,\n                                T1_Loader  loader )\n  {\n    T1_TokenRec  design_tokens[T1_MAX_MM_DESIGNS];\n    FT_Int       num_designs;\n    FT_Int       num_axis;\n    T1_Parser    parser = &loader->parser;\n\n    FT_Error     error = FT_Err_Ok;\n    PS_Blend     blend;\n\n\n    /* get the array of design tokens -- compute number of designs */\n    T1_ToTokenArray( parser, design_tokens,\n                     T1_MAX_MM_DESIGNS, &num_designs );\n    if ( num_designs < 0 )\n    {\n      error = FT_ERR( Ignore );\n      goto Exit;\n    }\n    if ( num_designs == 0 || num_designs > T1_MAX_MM_DESIGNS )\n    {\n      FT_ERROR(( \"parse_blend_design_positions:\"\n                 \" incorrect number of designs: %d\\n\",\n                 num_designs ));\n      error = FT_THROW( Invalid_File_Format );\n      goto Exit;\n    }\n\n    {\n      FT_Byte*  old_cursor = parser->root.cursor;\n      FT_Byte*  old_limit  = parser->root.limit;\n      FT_Int    n;\n\n\n      blend    = face->blend;\n      num_axis = 0;  /* make compiler happy */\n\n      for ( n = 0; n < num_designs; n++ )\n      {\n        T1_TokenRec  axis_tokens[T1_MAX_MM_AXIS];\n        T1_Token     token;\n        FT_Int       axis, n_axis;\n\n\n        /* read axis/coordinates tokens */\n        token = design_tokens + n;\n        parser->root.cursor = token->start;\n        parser->root.limit  = token->limit;\n        T1_ToTokenArray( parser, axis_tokens, T1_MAX_MM_AXIS, &n_axis );\n\n        if ( n == 0 )\n        {\n          if ( n_axis <= 0 || n_axis > T1_MAX_MM_AXIS )\n          {\n            FT_ERROR(( \"parse_blend_design_positions:\"\n                       \" invalid number of axes: %d\\n\",\n                       n_axis ));\n            error = FT_THROW( Invalid_File_Format );\n            goto Exit;\n          }\n\n          num_axis = n_axis;\n          error = t1_allocate_blend( face, num_designs, num_axis );\n          if ( error )\n            goto Exit;\n          blend = face->blend;\n        }\n        else if ( n_axis != num_axis )\n        {\n          FT_ERROR(( \"parse_blend_design_positions: incorrect table\\n\" ));\n          error = FT_THROW( Invalid_File_Format );\n          goto Exit;\n        }\n\n        /* now read each axis token into the design position */\n        for ( axis = 0; axis < n_axis; axis++ )\n        {\n          T1_Token  token2 = axis_tokens + axis;\n\n\n          parser->root.cursor = token2->start;\n          parser->root.limit  = token2->limit;\n          blend->design_pos[n][axis] = T1_ToFixed( parser, 0 );\n        }\n      }\n\n      loader->parser.root.cursor = old_cursor;\n      loader->parser.root.limit  = old_limit;\n    }\n\n  Exit:\n    loader->parser.root.error = error;\n  }\n\n\n  static void\n  parse_blend_design_map( T1_Face    face,\n                          T1_Loader  loader )\n  {\n    FT_Error     error  = FT_Err_Ok;\n    T1_Parser    parser = &loader->parser;\n    PS_Blend     blend;\n    T1_TokenRec  axis_tokens[T1_MAX_MM_AXIS];\n    FT_Int       n, num_axis;\n    FT_Byte*     old_cursor;\n    FT_Byte*     old_limit;\n    FT_Memory    memory = face->root.memory;\n\n\n    T1_ToTokenArray( parser, axis_tokens,\n                     T1_MAX_MM_AXIS, &num_axis );\n    if ( num_axis < 0 )\n    {\n      error = FT_ERR( Ignore );\n      goto Exit;\n    }\n    if ( num_axis == 0 || num_axis > T1_MAX_MM_AXIS )\n    {\n      FT_ERROR(( \"parse_blend_design_map: incorrect number of axes: %d\\n\",\n                 num_axis ));\n      error = FT_THROW( Invalid_File_Format );\n      goto Exit;\n    }\n\n    old_cursor = parser->root.cursor;\n    old_limit  = parser->root.limit;\n\n    error = t1_allocate_blend( face, 0, num_axis );\n    if ( error )\n      goto Exit;\n    blend = face->blend;\n\n    /* now read each axis design map */\n    for ( n = 0; n < num_axis; n++ )\n    {\n      PS_DesignMap  map = blend->design_map + n;\n      T1_Token      axis_token;\n      T1_TokenRec   point_tokens[T1_MAX_MM_MAP_POINTS];\n      FT_Int        p, num_points;\n\n\n      axis_token = axis_tokens + n;\n\n      parser->root.cursor = axis_token->start;\n      parser->root.limit  = axis_token->limit;\n      T1_ToTokenArray( parser, point_tokens,\n                       T1_MAX_MM_MAP_POINTS, &num_points );\n\n      if ( num_points <= 0 || num_points > T1_MAX_MM_MAP_POINTS )\n      {\n        FT_ERROR(( \"parse_blend_design_map: incorrect table\\n\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Exit;\n      }\n\n      /* allocate design map data */\n      if ( FT_NEW_ARRAY( map->design_points, num_points * 2 ) )\n        goto Exit;\n      map->blend_points = map->design_points + num_points;\n      map->num_points   = (FT_Byte)num_points;\n\n      for ( p = 0; p < num_points; p++ )\n      {\n        T1_Token  point_token;\n\n\n        point_token = point_tokens + p;\n\n        /* don't include delimiting brackets */\n        parser->root.cursor = point_token->start + 1;\n        parser->root.limit  = point_token->limit - 1;\n\n        map->design_points[p] = T1_ToInt( parser );\n        map->blend_points [p] = T1_ToFixed( parser, 0 );\n      }\n    }\n\n    parser->root.cursor = old_cursor;\n    parser->root.limit  = old_limit;\n\n  Exit:\n    parser->root.error = error;\n  }\n\n\n  static void\n  parse_weight_vector( T1_Face    face,\n                       T1_Loader  loader )\n  {\n    T1_TokenRec  design_tokens[T1_MAX_MM_DESIGNS];\n    FT_Int       num_designs;\n    FT_Error     error  = FT_Err_Ok;\n    T1_Parser    parser = &loader->parser;\n    PS_Blend     blend  = face->blend;\n    T1_Token     token;\n    FT_Int       n;\n    FT_Byte*     old_cursor;\n    FT_Byte*     old_limit;\n\n\n    T1_ToTokenArray( parser, design_tokens,\n                     T1_MAX_MM_DESIGNS, &num_designs );\n    if ( num_designs < 0 )\n    {\n      error = FT_ERR( Ignore );\n      goto Exit;\n    }\n    if ( num_designs == 0 || num_designs > T1_MAX_MM_DESIGNS )\n    {\n      FT_ERROR(( \"parse_weight_vector:\"\n                 \" incorrect number of designs: %d\\n\",\n                 num_designs ));\n      error = FT_THROW( Invalid_File_Format );\n      goto Exit;\n    }\n\n    if ( !blend || !blend->num_designs )\n    {\n      error = t1_allocate_blend( face, num_designs, 0 );\n      if ( error )\n        goto Exit;\n      blend = face->blend;\n    }\n    else if ( blend->num_designs != (FT_UInt)num_designs )\n    {\n      FT_ERROR(( \"parse_weight_vector:\"\n                 \" /BlendDesignPosition and /WeightVector have\\n\"\n                 \"                    \"\n                 \" different number of elements\\n\" ));\n      error = FT_THROW( Invalid_File_Format );\n      goto Exit;\n    }\n\n    old_cursor = parser->root.cursor;\n    old_limit  = parser->root.limit;\n\n    for ( n = 0; n < num_designs; n++ )\n    {\n      token = design_tokens + n;\n      parser->root.cursor = token->start;\n      parser->root.limit  = token->limit;\n\n      blend->default_weight_vector[n] =\n      blend->weight_vector[n]         = T1_ToFixed( parser, 0 );\n    }\n\n    parser->root.cursor = old_cursor;\n    parser->root.limit  = old_limit;\n\n  Exit:\n    parser->root.error = error;\n  }\n\n\n  /* e.g., /BuildCharArray [0 0 0 0 0 0 0 0] def           */\n  /* we're only interested in the number of array elements */\n  static void\n  parse_buildchar( T1_Face    face,\n                   T1_Loader  loader )\n  {\n    face->len_buildchar = T1_ToFixedArray( &loader->parser, 0, NULL, 0 );\n\n    return;\n  }\n\n\n#endif /* !T1_CONFIG_OPTION_NO_MM_SUPPORT */\n\n\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      TYPE 1 SYMBOL PARSING                    *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  static FT_Error\n  t1_load_keyword( T1_Face         face,\n                   T1_Loader       loader,\n                   const T1_Field  field )\n  {\n    FT_Error  error;\n    void*     dummy_object;\n    void**    objects;\n    FT_UInt   max_objects;\n    PS_Blend  blend = face->blend;\n\n\n    if ( blend && blend->num_designs == 0 )\n      blend = NULL;\n\n    /* if the keyword has a dedicated callback, call it */\n    if ( field->type == T1_FIELD_TYPE_CALLBACK )\n    {\n      field->reader( (FT_Face)face, loader );\n      error = loader->parser.root.error;\n      goto Exit;\n    }\n\n    /* now, the keyword is either a simple field, or a table of fields; */\n    /* we are now going to take care of it                              */\n    switch ( field->location )\n    {\n    case T1_FIELD_LOCATION_FONT_INFO:\n      dummy_object = &face->type1.font_info;\n      objects      = &dummy_object;\n      max_objects  = 0;\n\n      if ( blend )\n      {\n        objects     = (void**)blend->font_infos;\n        max_objects = blend->num_designs;\n      }\n      break;\n\n    case T1_FIELD_LOCATION_FONT_EXTRA:\n      dummy_object = &face->type1.font_extra;\n      objects      = &dummy_object;\n      max_objects  = 0;\n      break;\n\n    case T1_FIELD_LOCATION_PRIVATE:\n      dummy_object = &face->type1.private_dict;\n      objects      = &dummy_object;\n      max_objects  = 0;\n\n      if ( blend )\n      {\n        objects     = (void**)blend->privates;\n        max_objects = blend->num_designs;\n      }\n      break;\n\n    case T1_FIELD_LOCATION_BBOX:\n      dummy_object = &face->type1.font_bbox;\n      objects      = &dummy_object;\n      max_objects  = 0;\n\n      if ( blend )\n      {\n        objects     = (void**)blend->bboxes;\n        max_objects = blend->num_designs;\n      }\n      break;\n\n    case T1_FIELD_LOCATION_LOADER:\n      dummy_object = loader;\n      objects      = &dummy_object;\n      max_objects  = 0;\n      break;\n\n    case T1_FIELD_LOCATION_FACE:\n      dummy_object = face;\n      objects      = &dummy_object;\n      max_objects  = 0;\n      break;\n\n#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT\n    case T1_FIELD_LOCATION_BLEND:\n      dummy_object = face->blend;\n      objects      = &dummy_object;\n      max_objects  = 0;\n      break;\n#endif\n\n    default:\n      dummy_object = &face->type1;\n      objects      = &dummy_object;\n      max_objects  = 0;\n    }\n\n    if ( *objects )\n    {\n      if ( field->type == T1_FIELD_TYPE_INTEGER_ARRAY ||\n           field->type == T1_FIELD_TYPE_FIXED_ARRAY   )\n        error = T1_Load_Field_Table( &loader->parser, field,\n                                     objects, max_objects, 0 );\n      else\n        error = T1_Load_Field( &loader->parser, field,\n                               objects, max_objects, 0 );\n    }\n    else\n    {\n      FT_TRACE1(( \"t1_load_keyword: ignoring keyword `%s'\"\n                  \" which is not valid at this point\\n\"\n                  \"                 (probably due to missing keywords)\\n\",\n                 field->ident ));\n      error = FT_Err_Ok;\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  static void\n  parse_private( T1_Face    face,\n                 T1_Loader  loader )\n  {\n    FT_UNUSED( face );\n\n    loader->keywords_encountered |= T1_PRIVATE;\n  }\n\n\n  static int\n  read_binary_data( T1_Parser  parser,\n                    FT_Long*   size,\n                    FT_Byte**  base,\n                    FT_Bool    incremental )\n  {\n    FT_Byte*  cur;\n    FT_Byte*  limit = parser->root.limit;\n\n\n    /* the binary data has one of the following formats */\n    /*                                                  */\n    /*   `size' [white*] RD white ....... ND            */\n    /*   `size' [white*] -| white ....... |-            */\n    /*                                                  */\n\n    T1_Skip_Spaces( parser );\n\n    cur = parser->root.cursor;\n\n    if ( cur < limit && ft_isdigit( *cur ) )\n    {\n      FT_Long  s = T1_ToInt( parser );\n\n\n      T1_Skip_PS_Token( parser );   /* `RD' or `-|' or something else */\n\n      /* there is only one whitespace char after the */\n      /* `RD' or `-|' token                          */\n      *base = parser->root.cursor + 1;\n\n      if ( s >= 0 && s < limit - *base )\n      {\n        parser->root.cursor += s + 1;\n        *size = s;\n        return !parser->root.error;\n      }\n    }\n\n    if( !incremental )\n    {\n      FT_ERROR(( \"read_binary_data: invalid size field\\n\" ));\n      parser->root.error = FT_THROW( Invalid_File_Format );\n    }\n\n    return 0;\n  }\n\n\n  /* We now define the routines to handle the `/Encoding', `/Subrs', */\n  /* and `/CharStrings' dictionaries.                                */\n\n  static void\n  t1_parse_font_matrix( T1_Face    face,\n                        T1_Loader  loader )\n  {\n    T1_Parser   parser = &loader->parser;\n    FT_Matrix*  matrix = &face->type1.font_matrix;\n    FT_Vector*  offset = &face->type1.font_offset;\n    FT_Face     root   = (FT_Face)&face->root;\n    FT_Fixed    temp[6];\n    FT_Fixed    temp_scale;\n    FT_Int      result;\n\n\n    result = T1_ToFixedArray( parser, 6, temp, 3 );\n\n    if ( result < 6 )\n    {\n      parser->root.error = FT_THROW( Invalid_File_Format );\n      return;\n    }\n\n    temp_scale = FT_ABS( temp[3] );\n\n    if ( temp_scale == 0 )\n    {\n      FT_ERROR(( \"t1_parse_font_matrix: invalid font matrix\\n\" ));\n      parser->root.error = FT_THROW( Invalid_File_Format );\n      return;\n    }\n\n    /* Set Units per EM based on FontMatrix values.  We set the value to */\n    /* 1000 / temp_scale, because temp_scale was already multiplied by   */\n    /* 1000 (in t1_tofixed, from psobjs.c).                              */\n\n    root->units_per_EM = (FT_UShort)FT_DivFix( 1000, temp_scale );\n\n    /* we need to scale the values by 1.0/temp_scale */\n    if ( temp_scale != 0x10000L )\n    {\n      temp[0] = FT_DivFix( temp[0], temp_scale );\n      temp[1] = FT_DivFix( temp[1], temp_scale );\n      temp[2] = FT_DivFix( temp[2], temp_scale );\n      temp[4] = FT_DivFix( temp[4], temp_scale );\n      temp[5] = FT_DivFix( temp[5], temp_scale );\n      temp[3] = temp[3] < 0 ? -0x10000L : 0x10000L;\n    }\n\n    matrix->xx = temp[0];\n    matrix->yx = temp[1];\n    matrix->xy = temp[2];\n    matrix->yy = temp[3];\n\n    /* note that the offsets must be expressed in integer font units */\n    offset->x = temp[4] >> 16;\n    offset->y = temp[5] >> 16;\n  }\n\n\n  static void\n  parse_encoding( T1_Face    face,\n                  T1_Loader  loader )\n  {\n    T1_Parser  parser = &loader->parser;\n    FT_Byte*   cur;\n    FT_Byte*   limit  = parser->root.limit;\n\n    PSAux_Service  psaux = (PSAux_Service)face->psaux;\n\n\n    T1_Skip_Spaces( parser );\n    cur = parser->root.cursor;\n    if ( cur >= limit )\n    {\n      FT_ERROR(( \"parse_encoding: out of bounds\\n\" ));\n      parser->root.error = FT_THROW( Invalid_File_Format );\n      return;\n    }\n\n    /* if we have a number or `[', the encoding is an array, */\n    /* and we must load it now                               */\n    if ( ft_isdigit( *cur ) || *cur == '[' )\n    {\n      T1_Encoding  encode          = &face->type1.encoding;\n      FT_Int       count, n;\n      PS_Table     char_table      = &loader->encoding_table;\n      FT_Memory    memory          = parser->root.memory;\n      FT_Error     error;\n      FT_Bool      only_immediates = 0;\n\n\n      /* read the number of entries in the encoding; should be 256 */\n      if ( *cur == '[' )\n      {\n        count           = 256;\n        only_immediates = 1;\n        parser->root.cursor++;\n      }\n      else\n        count = (FT_Int)T1_ToInt( parser );\n\n      T1_Skip_Spaces( parser );\n      if ( parser->root.cursor >= limit )\n        return;\n\n      /* we use a T1_Table to store our charnames */\n      loader->num_chars = encode->num_chars = count;\n      if ( FT_NEW_ARRAY( encode->char_index, count )     ||\n           FT_NEW_ARRAY( encode->char_name,  count )     ||\n           FT_SET_ERROR( psaux->ps_table_funcs->init(\n                           char_table, count, memory ) ) )\n      {\n        parser->root.error = error;\n        return;\n      }\n\n      /* We need to `zero' out encoding_table.elements */\n      for ( n = 0; n < count; n++ )\n      {\n        char*  notdef = (char *)\".notdef\";\n\n\n        (void)T1_Add_Table( char_table, n, notdef, 8 );\n      }\n\n      /* Now we need to read records of the form                */\n      /*                                                        */\n      /*   ... charcode /charname ...                           */\n      /*                                                        */\n      /* for each entry in our table.                           */\n      /*                                                        */\n      /* We simply look for a number followed by an immediate   */\n      /* name.  Note that this ignores correctly the sequence   */\n      /* that is often seen in type1 fonts:                     */\n      /*                                                        */\n      /*   0 1 255 { 1 index exch /.notdef put } for dup        */\n      /*                                                        */\n      /* used to clean the encoding array before anything else. */\n      /*                                                        */\n      /* Alternatively, if the array is directly given as       */\n      /*                                                        */\n      /*   /Encoding [ ... ]                                    */\n      /*                                                        */\n      /* we only read immediates.                               */\n\n      n = 0;\n      T1_Skip_Spaces( parser );\n\n      while ( parser->root.cursor < limit )\n      {\n        cur = parser->root.cursor;\n\n        /* we stop when we encounter a `def' or `]' */\n        if ( *cur == 'd' && cur + 3 < limit )\n        {\n          if ( cur[1] == 'e'         &&\n               cur[2] == 'f'         &&\n               IS_PS_DELIM( cur[3] ) )\n          {\n            FT_TRACE6(( \"encoding end\\n\" ));\n            cur += 3;\n            break;\n          }\n        }\n        if ( *cur == ']' )\n        {\n          FT_TRACE6(( \"encoding end\\n\" ));\n          cur++;\n          break;\n        }\n\n        /* check whether we've found an entry */\n        if ( ft_isdigit( *cur ) || only_immediates )\n        {\n          FT_Int  charcode;\n\n\n          if ( only_immediates )\n            charcode = n;\n          else\n          {\n            charcode = (FT_Int)T1_ToInt( parser );\n            T1_Skip_Spaces( parser );\n\n            /* protect against invalid charcode */\n            if ( cur == parser->root.cursor )\n            {\n              parser->root.error = FT_THROW( Unknown_File_Format );\n              return;\n            }\n          }\n\n          cur = parser->root.cursor;\n\n          if ( cur + 2 < limit && *cur == '/' && n < count )\n          {\n            FT_PtrDist  len;\n\n\n            cur++;\n\n            parser->root.cursor = cur;\n            T1_Skip_PS_Token( parser );\n            if ( parser->root.cursor >= limit )\n              return;\n            if ( parser->root.error )\n              return;\n\n            len = parser->root.cursor - cur;\n\n            parser->root.error = T1_Add_Table( char_table, charcode,\n                                               cur, len + 1 );\n            if ( parser->root.error )\n              return;\n            char_table->elements[charcode][len] = '\\0';\n\n            n++;\n          }\n          else if ( only_immediates )\n          {\n            /* Since the current position is not updated for           */\n            /* immediates-only mode we would get an infinite loop if   */\n            /* we don't do anything here.                              */\n            /*                                                         */\n            /* This encoding array is not valid according to the type1 */\n            /* specification (it might be an encoding for a CID type1  */\n            /* font, however), so we conclude that this font is NOT a  */\n            /* type1 font.                                             */\n            parser->root.error = FT_THROW( Unknown_File_Format );\n            return;\n          }\n        }\n        else\n        {\n          T1_Skip_PS_Token( parser );\n          if ( parser->root.error )\n            return;\n        }\n\n        T1_Skip_Spaces( parser );\n      }\n\n      face->type1.encoding_type = T1_ENCODING_TYPE_ARRAY;\n      parser->root.cursor       = cur;\n    }\n\n    /* Otherwise, we should have either `StandardEncoding', */\n    /* `ExpertEncoding', or `ISOLatin1Encoding'             */\n    else\n    {\n      if ( cur + 17 < limit                                            &&\n           ft_strncmp( (const char*)cur, \"StandardEncoding\", 16 ) == 0 )\n        face->type1.encoding_type = T1_ENCODING_TYPE_STANDARD;\n\n      else if ( cur + 15 < limit                                          &&\n                ft_strncmp( (const char*)cur, \"ExpertEncoding\", 14 ) == 0 )\n        face->type1.encoding_type = T1_ENCODING_TYPE_EXPERT;\n\n      else if ( cur + 18 < limit                                             &&\n                ft_strncmp( (const char*)cur, \"ISOLatin1Encoding\", 17 ) == 0 )\n        face->type1.encoding_type = T1_ENCODING_TYPE_ISOLATIN1;\n\n      else\n        parser->root.error = FT_ERR( Ignore );\n    }\n  }\n\n\n  static void\n  parse_subrs( T1_Face    face,\n               T1_Loader  loader )\n  {\n    T1_Parser  parser = &loader->parser;\n    PS_Table   table  = &loader->subrs;\n    FT_Memory  memory = parser->root.memory;\n    FT_Error   error;\n    FT_Int     num_subrs;\n\n    PSAux_Service  psaux = (PSAux_Service)face->psaux;\n\n\n    T1_Skip_Spaces( parser );\n\n    /* test for empty array */\n    if ( parser->root.cursor < parser->root.limit &&\n         *parser->root.cursor == '['              )\n    {\n      T1_Skip_PS_Token( parser );\n      T1_Skip_Spaces  ( parser );\n      if ( parser->root.cursor >= parser->root.limit ||\n           *parser->root.cursor != ']'               )\n        parser->root.error = FT_THROW( Invalid_File_Format );\n      return;\n    }\n\n    num_subrs = (FT_Int)T1_ToInt( parser );\n\n    /* position the parser right before the `dup' of the first subr */\n    T1_Skip_PS_Token( parser );         /* `array' */\n    if ( parser->root.error )\n      return;\n    T1_Skip_Spaces( parser );\n\n    /* initialize subrs array -- with synthetic fonts it is possible */\n    /* we get here twice                                             */\n    if ( !loader->num_subrs )\n    {\n      error = psaux->ps_table_funcs->init( table, num_subrs, memory );\n      if ( error )\n        goto Fail;\n    }\n\n    /* the format is simple:   */\n    /*                         */\n    /*   `index' + binary data */\n    /*                         */\n    for (;;)\n    {\n      FT_Long   idx, size;\n      FT_Byte*  base;\n\n\n      /* If we are out of data, or if the next token isn't `dup', */\n      /* we are done.                                             */\n      if ( parser->root.cursor + 4 >= parser->root.limit          ||\n          ft_strncmp( (char*)parser->root.cursor, \"dup\", 3 ) != 0 )\n        break;\n\n      T1_Skip_PS_Token( parser );       /* `dup' */\n\n      idx = T1_ToInt( parser );\n\n      if ( !read_binary_data( parser, &size, &base, IS_INCREMENTAL ) )\n        return;\n\n      /* The binary string is followed by one token, e.g. `NP' */\n      /* (bound to `noaccess put') or by two separate tokens:  */\n      /* `noaccess' & `put'.  We position the parser right     */\n      /* before the next `dup', if any.                        */\n      T1_Skip_PS_Token( parser );   /* `NP' or `|' or `noaccess' */\n      if ( parser->root.error )\n        return;\n      T1_Skip_Spaces  ( parser );\n\n      if ( parser->root.cursor + 4 < parser->root.limit            &&\n           ft_strncmp( (char*)parser->root.cursor, \"put\", 3 ) == 0 )\n      {\n        T1_Skip_PS_Token( parser ); /* skip `put' */\n        T1_Skip_Spaces  ( parser );\n      }\n\n      /* with synthetic fonts it is possible we get here twice */\n      if ( loader->num_subrs )\n        continue;\n\n      /* some fonts use a value of -1 for lenIV to indicate that */\n      /* the charstrings are unencoded                           */\n      /*                                                         */\n      /* thanks to Tom Kacvinsky for pointing this out           */\n      /*                                                         */\n      if ( face->type1.private_dict.lenIV >= 0 )\n      {\n        FT_Byte*  temp;\n\n\n        /* some fonts define empty subr records -- this is not totally */\n        /* compliant to the specification (which says they should at   */\n        /* least contain a `return'), but we support them anyway       */\n        if ( size < face->type1.private_dict.lenIV )\n        {\n          error = FT_THROW( Invalid_File_Format );\n          goto Fail;\n        }\n\n        /* t1_decrypt() shouldn't write to base -- make temporary copy */\n        if ( FT_ALLOC( temp, size ) )\n          goto Fail;\n        FT_MEM_COPY( temp, base, size );\n        psaux->t1_decrypt( temp, size, 4330 );\n        size -= face->type1.private_dict.lenIV;\n        error = T1_Add_Table( table, (FT_Int)idx,\n                              temp + face->type1.private_dict.lenIV, size );\n        FT_FREE( temp );\n      }\n      else\n        error = T1_Add_Table( table, (FT_Int)idx, base, size );\n      if ( error )\n        goto Fail;\n    }\n\n    if ( !loader->num_subrs )\n      loader->num_subrs = num_subrs;\n\n    return;\n\n  Fail:\n    parser->root.error = error;\n  }\n\n\n#define TABLE_EXTEND  5\n\n\n  static void\n  parse_charstrings( T1_Face    face,\n                     T1_Loader  loader )\n  {\n    T1_Parser      parser       = &loader->parser;\n    PS_Table       code_table   = &loader->charstrings;\n    PS_Table       name_table   = &loader->glyph_names;\n    PS_Table       swap_table   = &loader->swap_table;\n    FT_Memory      memory       = parser->root.memory;\n    FT_Error       error;\n\n    PSAux_Service  psaux        = (PSAux_Service)face->psaux;\n\n    FT_Byte*       cur;\n    FT_Byte*       limit        = parser->root.limit;\n    FT_Int         n, num_glyphs;\n    FT_UInt        notdef_index = 0;\n    FT_Byte        notdef_found = 0;\n\n\n    num_glyphs = (FT_Int)T1_ToInt( parser );\n    if ( num_glyphs < 0 )\n    {\n      error = FT_THROW( Invalid_File_Format );\n      goto Fail;\n    }\n\n    /* some fonts like Optima-Oblique not only define the /CharStrings */\n    /* array but access it also                                        */\n    if ( num_glyphs == 0 || parser->root.error )\n      return;\n\n    /* initialize tables, leaving space for addition of .notdef, */\n    /* if necessary, and a few other glyphs to handle buggy      */\n    /* fonts which have more glyphs than specified.              */\n\n    /* for some non-standard fonts like `Optima' which provides  */\n    /* different outlines depending on the resolution it is      */\n    /* possible to get here twice                                */\n    if ( !loader->num_glyphs )\n    {\n      error = psaux->ps_table_funcs->init(\n                code_table, num_glyphs + 1 + TABLE_EXTEND, memory );\n      if ( error )\n        goto Fail;\n\n      error = psaux->ps_table_funcs->init(\n                name_table, num_glyphs + 1 + TABLE_EXTEND, memory );\n      if ( error )\n        goto Fail;\n\n      /* Initialize table for swapping index notdef_index and */\n      /* index 0 names and codes (if necessary).              */\n\n      error = psaux->ps_table_funcs->init( swap_table, 4, memory );\n      if ( error )\n        goto Fail;\n    }\n\n    n = 0;\n\n    for (;;)\n    {\n      FT_Long   size;\n      FT_Byte*  base;\n\n\n      /* the format is simple:        */\n      /*   `/glyphname' + binary data */\n\n      T1_Skip_Spaces( parser );\n\n      cur = parser->root.cursor;\n      if ( cur >= limit )\n        break;\n\n      /* we stop when we find a `def' or `end' keyword */\n      if ( cur + 3 < limit && IS_PS_DELIM( cur[3] ) )\n      {\n        if ( cur[0] == 'd' &&\n             cur[1] == 'e' &&\n             cur[2] == 'f' )\n        {\n          /* There are fonts which have this: */\n          /*                                  */\n          /*   /CharStrings 118 dict def      */\n          /*   Private begin                  */\n          /*   CharStrings begin              */\n          /*   ...                            */\n          /*                                  */\n          /* To catch this we ignore `def' if */\n          /* no charstring has actually been  */\n          /* seen.                            */\n          if ( n )\n            break;\n        }\n\n        if ( cur[0] == 'e' &&\n             cur[1] == 'n' &&\n             cur[2] == 'd' )\n          break;\n      }\n\n      T1_Skip_PS_Token( parser );\n      if ( parser->root.cursor >= limit )\n      {\n        error = FT_THROW( Invalid_File_Format );\n        goto Fail;\n      }\n      if ( parser->root.error )\n        return;\n\n      if ( *cur == '/' )\n      {\n        FT_PtrDist  len;\n\n\n        if ( cur + 2 >= limit )\n        {\n          error = FT_THROW( Invalid_File_Format );\n          goto Fail;\n        }\n\n        cur++;                              /* skip `/' */\n        len = parser->root.cursor - cur;\n\n        if ( !read_binary_data( parser, &size, &base, IS_INCREMENTAL ) )\n          return;\n\n        /* for some non-standard fonts like `Optima' which provides */\n        /* different outlines depending on the resolution it is     */\n        /* possible to get here twice                               */\n        if ( loader->num_glyphs )\n          continue;\n\n        error = T1_Add_Table( name_table, n, cur, len + 1 );\n        if ( error )\n          goto Fail;\n\n        /* add a trailing zero to the name table */\n        name_table->elements[n][len] = '\\0';\n\n        /* record index of /.notdef */\n        if ( *cur == '.'                                              &&\n             ft_strcmp( \".notdef\",\n                        (const char*)(name_table->elements[n]) ) == 0 )\n        {\n          notdef_index = n;\n          notdef_found = 1;\n        }\n\n        if ( face->type1.private_dict.lenIV >= 0 &&\n             n < num_glyphs + TABLE_EXTEND       )\n        {\n          FT_Byte*  temp;\n\n\n          if ( size <= face->type1.private_dict.lenIV )\n          {\n            error = FT_THROW( Invalid_File_Format );\n            goto Fail;\n          }\n\n          /* t1_decrypt() shouldn't write to base -- make temporary copy */\n          if ( FT_ALLOC( temp, size ) )\n            goto Fail;\n          FT_MEM_COPY( temp, base, size );\n          psaux->t1_decrypt( temp, size, 4330 );\n          size -= face->type1.private_dict.lenIV;\n          error = T1_Add_Table( code_table, n,\n                                temp + face->type1.private_dict.lenIV, size );\n          FT_FREE( temp );\n        }\n        else\n          error = T1_Add_Table( code_table, n, base, size );\n        if ( error )\n          goto Fail;\n\n        n++;\n      }\n    }\n\n    loader->num_glyphs = n;\n\n    /* if /.notdef is found but does not occupy index 0, do our magic. */\n    if ( notdef_found                                                 &&\n         ft_strcmp( \".notdef\", (const char*)name_table->elements[0] ) )\n    {\n      /* Swap glyph in index 0 with /.notdef glyph.  First, add index 0  */\n      /* name and code entries to swap_table.  Then place notdef_index   */\n      /* name and code entries into swap_table.  Then swap name and code */\n      /* entries at indices notdef_index and 0 using values stored in    */\n      /* swap_table.                                                     */\n\n      /* Index 0 name */\n      error = T1_Add_Table( swap_table, 0,\n                            name_table->elements[0],\n                            name_table->lengths [0] );\n      if ( error )\n        goto Fail;\n\n      /* Index 0 code */\n      error = T1_Add_Table( swap_table, 1,\n                            code_table->elements[0],\n                            code_table->lengths [0] );\n      if ( error )\n        goto Fail;\n\n      /* Index notdef_index name */\n      error = T1_Add_Table( swap_table, 2,\n                            name_table->elements[notdef_index],\n                            name_table->lengths [notdef_index] );\n      if ( error )\n        goto Fail;\n\n      /* Index notdef_index code */\n      error = T1_Add_Table( swap_table, 3,\n                            code_table->elements[notdef_index],\n                            code_table->lengths [notdef_index] );\n      if ( error )\n        goto Fail;\n\n      error = T1_Add_Table( name_table, notdef_index,\n                            swap_table->elements[0],\n                            swap_table->lengths [0] );\n      if ( error )\n        goto Fail;\n\n      error = T1_Add_Table( code_table, notdef_index,\n                            swap_table->elements[1],\n                            swap_table->lengths [1] );\n      if ( error )\n        goto Fail;\n\n      error = T1_Add_Table( name_table, 0,\n                            swap_table->elements[2],\n                            swap_table->lengths [2] );\n      if ( error )\n        goto Fail;\n\n      error = T1_Add_Table( code_table, 0,\n                            swap_table->elements[3],\n                            swap_table->lengths [3] );\n      if ( error )\n        goto Fail;\n\n    }\n    else if ( !notdef_found )\n    {\n      /* notdef_index is already 0, or /.notdef is undefined in   */\n      /* charstrings dictionary.  Worry about /.notdef undefined. */\n      /* We take index 0 and add it to the end of the table(s)    */\n      /* and add our own /.notdef glyph to index 0.               */\n\n      /* 0 333 hsbw endchar */\n      FT_Byte  notdef_glyph[] = { 0x8B, 0xF7, 0xE1, 0x0D, 0x0E };\n      char*    notdef_name    = (char *)\".notdef\";\n\n\n      error = T1_Add_Table( swap_table, 0,\n                            name_table->elements[0],\n                            name_table->lengths [0] );\n      if ( error )\n        goto Fail;\n\n      error = T1_Add_Table( swap_table, 1,\n                            code_table->elements[0],\n                            code_table->lengths [0] );\n      if ( error )\n        goto Fail;\n\n      error = T1_Add_Table( name_table, 0, notdef_name, 8 );\n      if ( error )\n        goto Fail;\n\n      error = T1_Add_Table( code_table, 0, notdef_glyph, 5 );\n\n      if ( error )\n        goto Fail;\n\n      error = T1_Add_Table( name_table, n,\n                            swap_table->elements[0],\n                            swap_table->lengths [0] );\n      if ( error )\n        goto Fail;\n\n      error = T1_Add_Table( code_table, n,\n                            swap_table->elements[1],\n                            swap_table->lengths [1] );\n      if ( error )\n        goto Fail;\n\n      /* we added a glyph. */\n      loader->num_glyphs += 1;\n    }\n\n    return;\n\n  Fail:\n    parser->root.error = error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define the token field static variables.  This is a set of            */\n  /* T1_FieldRec variables.                                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  static\n  const T1_FieldRec  t1_keywords[] =\n  {\n\n#include \"t1tokens.h\"\n\n    /* now add the special functions... */\n    T1_FIELD_CALLBACK( \"FontMatrix\",           t1_parse_font_matrix,\n                       T1_FIELD_DICT_FONTDICT )\n    T1_FIELD_CALLBACK( \"Encoding\",             parse_encoding,\n                       T1_FIELD_DICT_FONTDICT )\n    T1_FIELD_CALLBACK( \"Subrs\",                parse_subrs,\n                       T1_FIELD_DICT_PRIVATE )\n    T1_FIELD_CALLBACK( \"CharStrings\",          parse_charstrings,\n                       T1_FIELD_DICT_PRIVATE )\n    T1_FIELD_CALLBACK( \"Private\",              parse_private,\n                       T1_FIELD_DICT_FONTDICT )\n\n#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT\n    T1_FIELD_CALLBACK( \"BlendDesignPositions\", parse_blend_design_positions,\n                       T1_FIELD_DICT_FONTDICT )\n    T1_FIELD_CALLBACK( \"BlendDesignMap\",       parse_blend_design_map,\n                       T1_FIELD_DICT_FONTDICT )\n    T1_FIELD_CALLBACK( \"BlendAxisTypes\",       parse_blend_axis_types,\n                       T1_FIELD_DICT_FONTDICT )\n    T1_FIELD_CALLBACK( \"WeightVector\",         parse_weight_vector,\n                       T1_FIELD_DICT_FONTDICT )\n    T1_FIELD_CALLBACK( \"BuildCharArray\",       parse_buildchar,\n                       T1_FIELD_DICT_PRIVATE )\n#endif\n\n    { 0, T1_FIELD_LOCATION_CID_INFO, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0, 0 }\n  };\n\n\n#define T1_FIELD_COUNT                                           \\\n          ( sizeof ( t1_keywords ) / sizeof ( t1_keywords[0] ) )\n\n\n  static FT_Error\n  parse_dict( T1_Face    face,\n              T1_Loader  loader,\n              FT_Byte*   base,\n              FT_Long    size )\n  {\n    T1_Parser  parser = &loader->parser;\n    FT_Byte   *limit, *start_binary = NULL;\n    FT_Bool    have_integer = 0;\n\n\n    parser->root.cursor = base;\n    parser->root.limit  = base + size;\n    parser->root.error  = FT_Err_Ok;\n\n    limit = parser->root.limit;\n\n    T1_Skip_Spaces( parser );\n\n    while ( parser->root.cursor < limit )\n    {\n      FT_Byte*  cur;\n\n\n      cur = parser->root.cursor;\n\n      /* look for `eexec' */\n      if ( IS_PS_TOKEN( cur, limit, \"eexec\" ) )\n        break;\n\n      /* look for `closefile' which ends the eexec section */\n      else if ( IS_PS_TOKEN( cur, limit, \"closefile\" ) )\n        break;\n\n      /* in a synthetic font the base font starts after a           */\n      /* `FontDictionary' token that is placed after a Private dict */\n      else if ( IS_PS_TOKEN( cur, limit, \"FontDirectory\" ) )\n      {\n        if ( loader->keywords_encountered & T1_PRIVATE )\n          loader->keywords_encountered |=\n            T1_FONTDIR_AFTER_PRIVATE;\n        parser->root.cursor += 13;\n      }\n\n      /* check whether we have an integer */\n      else if ( ft_isdigit( *cur ) )\n      {\n        start_binary = cur;\n        T1_Skip_PS_Token( parser );\n        if ( parser->root.error )\n          goto Exit;\n        have_integer = 1;\n      }\n\n      /* in valid Type 1 fonts we don't see `RD' or `-|' directly */\n      /* since those tokens are handled by parse_subrs and        */\n      /* parse_charstrings                                        */\n      else if ( *cur == 'R' && cur + 6 < limit && *(cur + 1) == 'D' &&\n                have_integer )\n      {\n        FT_Long   s;\n        FT_Byte*  b;\n\n\n        parser->root.cursor = start_binary;\n        if ( !read_binary_data( parser, &s, &b, IS_INCREMENTAL ) )\n          return FT_THROW( Invalid_File_Format );\n        have_integer = 0;\n      }\n\n      else if ( *cur == '-' && cur + 6 < limit && *(cur + 1) == '|' &&\n                have_integer )\n      {\n        FT_Long   s;\n        FT_Byte*  b;\n\n\n        parser->root.cursor = start_binary;\n        if ( !read_binary_data( parser, &s, &b, IS_INCREMENTAL ) )\n          return FT_THROW( Invalid_File_Format );\n        have_integer = 0;\n      }\n\n      /* look for immediates */\n      else if ( *cur == '/' && cur + 2 < limit )\n      {\n        FT_PtrDist  len;\n\n\n        cur++;\n\n        parser->root.cursor = cur;\n        T1_Skip_PS_Token( parser );\n        if ( parser->root.error )\n          goto Exit;\n\n        len = parser->root.cursor - cur;\n\n        if ( len > 0 && len < 22 && parser->root.cursor < limit )\n        {\n          /* now compare the immediate name to the keyword table */\n          T1_Field  keyword = (T1_Field)t1_keywords;\n\n\n          for (;;)\n          {\n            FT_Byte*  name;\n\n\n            name = (FT_Byte*)keyword->ident;\n            if ( !name )\n              break;\n\n            if ( cur[0] == name[0]                                  &&\n                 len == (FT_PtrDist)ft_strlen( (const char *)name ) &&\n                 ft_memcmp( cur, name, len ) == 0                   )\n            {\n              /* We found it -- run the parsing callback!     */\n              /* We record every instance of every field      */\n              /* (until we reach the base font of a           */\n              /* synthetic font) to deal adequately with      */\n              /* multiple master fonts; this is also          */\n              /* necessary because later PostScript           */\n              /* definitions override earlier ones.           */\n\n              /* Once we encounter `FontDirectory' after      */\n              /* `/Private', we know that this is a synthetic */\n              /* font; except for `/CharStrings' we are not   */\n              /* interested in anything that follows this     */\n              /* `FontDirectory'.                             */\n\n              /* MM fonts have more than one /Private token at */\n              /* the top level; let's hope that all the junk   */\n              /* that follows the first /Private token is not  */\n              /* interesting to us.                            */\n\n              /* According to Adobe Tech Note #5175 (CID-Keyed */\n              /* Font Installation for ATM Software) a `begin' */\n              /* must be followed by exactly one `end', and    */\n              /* `begin' -- `end' pairs must be accurately     */\n              /* paired.  We could use this to distinguish     */\n              /* between the global Private and the Private    */\n              /* dict that is a member of the Blend dict.      */\n\n              const FT_UInt dict =\n                ( loader->keywords_encountered & T1_PRIVATE )\n                    ? T1_FIELD_DICT_PRIVATE\n                    : T1_FIELD_DICT_FONTDICT;\n\n              if ( !( dict & keyword->dict ) )\n              {\n                FT_TRACE1(( \"parse_dict: found `%s' but ignoring it\"\n                            \" since it is in the wrong dictionary\\n\",\n                            keyword->ident ));\n                break;\n              }\n\n              if ( !( loader->keywords_encountered &\n                      T1_FONTDIR_AFTER_PRIVATE     )                  ||\n                   ft_strcmp( (const char*)name, \"CharStrings\" ) == 0 )\n              {\n                parser->root.error = t1_load_keyword( face,\n                                                      loader,\n                                                      keyword );\n                if ( parser->root.error != FT_Err_Ok )\n                {\n                  if ( FT_ERR_EQ( parser->root.error, Ignore ) )\n                    parser->root.error = FT_Err_Ok;\n                  else\n                    return parser->root.error;\n                }\n              }\n              break;\n            }\n\n            keyword++;\n          }\n        }\n\n        have_integer = 0;\n      }\n      else\n      {\n        T1_Skip_PS_Token( parser );\n        if ( parser->root.error )\n          goto Exit;\n        have_integer = 0;\n      }\n\n      T1_Skip_Spaces( parser );\n    }\n\n  Exit:\n    return parser->root.error;\n  }\n\n\n  static void\n  t1_init_loader( T1_Loader  loader,\n                  T1_Face    face )\n  {\n    FT_UNUSED( face );\n\n    FT_MEM_ZERO( loader, sizeof ( *loader ) );\n    loader->num_glyphs = 0;\n    loader->num_chars  = 0;\n\n    /* initialize the tables -- simply set their `init' field to 0 */\n    loader->encoding_table.init  = 0;\n    loader->charstrings.init     = 0;\n    loader->glyph_names.init     = 0;\n    loader->subrs.init           = 0;\n    loader->swap_table.init      = 0;\n    loader->fontdata             = 0;\n    loader->keywords_encountered = 0;\n  }\n\n\n  static void\n  t1_done_loader( T1_Loader  loader )\n  {\n    T1_Parser  parser = &loader->parser;\n\n\n    /* finalize tables */\n    T1_Release_Table( &loader->encoding_table );\n    T1_Release_Table( &loader->charstrings );\n    T1_Release_Table( &loader->glyph_names );\n    T1_Release_Table( &loader->swap_table );\n    T1_Release_Table( &loader->subrs );\n\n    /* finalize parser */\n    T1_Finalize_Parser( parser );\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  T1_Open_Face( T1_Face  face )\n  {\n    T1_LoaderRec   loader;\n    T1_Parser      parser;\n    T1_Font        type1 = &face->type1;\n    PS_Private     priv  = &type1->private_dict;\n    FT_Error       error;\n\n    PSAux_Service  psaux = (PSAux_Service)face->psaux;\n\n\n    t1_init_loader( &loader, face );\n\n    /* default values */\n    face->ndv_idx          = -1;\n    face->cdv_idx          = -1;\n    face->len_buildchar    = 0;\n\n    priv->blue_shift       = 7;\n    priv->blue_fuzz        = 1;\n    priv->lenIV            = 4;\n    priv->expansion_factor = (FT_Fixed)( 0.06 * 0x10000L );\n    priv->blue_scale       = (FT_Fixed)( 0.039625 * 0x10000L * 1000 );\n\n    parser = &loader.parser;\n    error  = T1_New_Parser( parser,\n                            face->root.stream,\n                            face->root.memory,\n                            psaux );\n    if ( error )\n      goto Exit;\n\n    error = parse_dict( face, &loader,\n                        parser->base_dict, parser->base_len );\n    if ( error )\n      goto Exit;\n\n    error = T1_Get_Private_Dict( parser, psaux );\n    if ( error )\n      goto Exit;\n\n    error = parse_dict( face, &loader,\n                        parser->private_dict, parser->private_len );\n    if ( error )\n      goto Exit;\n\n    /* ensure even-ness of `num_blue_values' */\n    priv->num_blue_values &= ~1;\n\n#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT\n\n    if ( face->blend                                                     &&\n         face->blend->num_default_design_vector != 0                     &&\n         face->blend->num_default_design_vector != face->blend->num_axis )\n    {\n      /* we don't use it currently so just warn, reset, and ignore */\n      FT_ERROR(( \"T1_Open_Face(): /DesignVector contains %u entries \"\n                 \"while there are %u axes.\\n\",\n                 face->blend->num_default_design_vector,\n                 face->blend->num_axis ));\n\n      face->blend->num_default_design_vector = 0;\n    }\n\n    /* the following can happen for MM instances; we then treat the */\n    /* font as a normal PS font                                     */\n    if ( face->blend                                             &&\n         ( !face->blend->num_designs || !face->blend->num_axis ) )\n      T1_Done_Blend( face );\n\n    /* another safety check */\n    if ( face->blend )\n    {\n      FT_UInt  i;\n\n\n      for ( i = 0; i < face->blend->num_axis; i++ )\n        if ( !face->blend->design_map[i].num_points )\n        {\n          T1_Done_Blend( face );\n          break;\n        }\n    }\n\n    if ( face->blend )\n    {\n      if ( face->len_buildchar > 0 )\n      {\n        FT_Memory  memory = face->root.memory;\n\n\n        if ( FT_NEW_ARRAY( face->buildchar, face->len_buildchar ) )\n        {\n          FT_ERROR(( \"T1_Open_Face: cannot allocate BuildCharArray\\n\" ));\n          face->len_buildchar = 0;\n          goto Exit;\n        }\n      }\n    }\n    else\n      face->len_buildchar = 0;\n\n#endif /* !T1_CONFIG_OPTION_NO_MM_SUPPORT */\n\n    /* now, propagate the subrs, charstrings, and glyphnames tables */\n    /* to the Type1 data                                            */\n    type1->num_glyphs = loader.num_glyphs;\n\n    if ( loader.subrs.init )\n    {\n      loader.subrs.init  = 0;\n      type1->num_subrs   = loader.num_subrs;\n      type1->subrs_block = loader.subrs.block;\n      type1->subrs       = loader.subrs.elements;\n      type1->subrs_len   = loader.subrs.lengths;\n    }\n\n    if ( !IS_INCREMENTAL )\n      if ( !loader.charstrings.init )\n      {\n        FT_ERROR(( \"T1_Open_Face: no `/CharStrings' array in face\\n\" ));\n        error = FT_THROW( Invalid_File_Format );\n      }\n\n    loader.charstrings.init  = 0;\n    type1->charstrings_block = loader.charstrings.block;\n    type1->charstrings       = loader.charstrings.elements;\n    type1->charstrings_len   = loader.charstrings.lengths;\n\n    /* we copy the glyph names `block' and `elements' fields; */\n    /* the `lengths' field must be released later             */\n    type1->glyph_names_block    = loader.glyph_names.block;\n    type1->glyph_names          = (FT_String**)loader.glyph_names.elements;\n    loader.glyph_names.block    = 0;\n    loader.glyph_names.elements = 0;\n\n    /* we must now build type1.encoding when we have a custom array */\n    if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY )\n    {\n      FT_Int    charcode, idx, min_char, max_char;\n      FT_Byte*  glyph_name;\n\n\n      /* OK, we do the following: for each element in the encoding  */\n      /* table, look up the index of the glyph having the same name */\n      /* the index is then stored in type1.encoding.char_index, and */\n      /* the name to type1.encoding.char_name                       */\n\n      min_char = 0;\n      max_char = 0;\n\n      charcode = 0;\n      for ( ; charcode < loader.encoding_table.max_elems; charcode++ )\n      {\n        FT_Byte*  char_name;\n\n\n        type1->encoding.char_index[charcode] = 0;\n        type1->encoding.char_name [charcode] = (char *)\".notdef\";\n\n        char_name = loader.encoding_table.elements[charcode];\n        if ( char_name )\n          for ( idx = 0; idx < type1->num_glyphs; idx++ )\n          {\n            glyph_name = (FT_Byte*)type1->glyph_names[idx];\n            if ( ft_strcmp( (const char*)char_name,\n                            (const char*)glyph_name ) == 0 )\n            {\n              type1->encoding.char_index[charcode] = (FT_UShort)idx;\n              type1->encoding.char_name [charcode] = (char*)glyph_name;\n\n              /* Change min/max encoded char only if glyph name is */\n              /* not /.notdef                                      */\n              if ( ft_strcmp( (const char*)\".notdef\",\n                              (const char*)glyph_name ) != 0 )\n              {\n                if ( charcode < min_char )\n                  min_char = charcode;\n                if ( charcode >= max_char )\n                  max_char = charcode + 1;\n              }\n              break;\n            }\n          }\n      }\n\n      type1->encoding.code_first = min_char;\n      type1->encoding.code_last  = max_char;\n      type1->encoding.num_chars  = loader.num_chars;\n    }\n\n  Exit:\n    t1_done_loader( &loader );\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type1/t1load.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1load.h                                                               */\n/*                                                                         */\n/*    Type 1 font loader (specification).                                  */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2004, 2006, 2007 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T1LOAD_H__\n#define __T1LOAD_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_POSTSCRIPT_AUX_H\n#include FT_MULTIPLE_MASTERS_H\n\n#include \"t1parse.h\"\n\n\nFT_BEGIN_HEADER\n\n\n  typedef struct  T1_Loader_\n  {\n    T1_ParserRec  parser;          /* parser used to read the stream */\n\n    FT_Int        num_chars;       /* number of characters in encoding */\n    PS_TableRec   encoding_table;  /* PS_Table used to store the       */\n                                   /* encoding character names         */\n\n    FT_Int        num_glyphs;\n    PS_TableRec   glyph_names;\n    PS_TableRec   charstrings;\n    PS_TableRec   swap_table;      /* For moving .notdef glyph to index 0. */\n\n    FT_Int        num_subrs;\n    PS_TableRec   subrs;\n    FT_Bool       fontdata;\n\n    FT_UInt       keywords_encountered; /* T1_LOADER_ENCOUNTERED_XXX */\n\n  } T1_LoaderRec, *T1_Loader;\n\n\n  /* treatment of some keywords differs depending on whether */\n  /* they precede or follow certain other keywords           */\n\n#define T1_PRIVATE                ( 1 << 0 )\n#define T1_FONTDIR_AFTER_PRIVATE  ( 1 << 1 )\n\n\n  FT_LOCAL( FT_Error )\n  T1_Open_Face( T1_Face  face );\n\n#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT\n\n  FT_LOCAL( FT_Error )\n  T1_Get_Multi_Master( T1_Face           face,\n                       FT_Multi_Master*  master );\n\n  FT_LOCAL_DEF( FT_Error )\n  T1_Get_MM_Var( T1_Face      face,\n                 FT_MM_Var*  *master );\n\n  FT_LOCAL( FT_Error )\n  T1_Set_MM_Blend( T1_Face    face,\n                   FT_UInt    num_coords,\n                   FT_Fixed*  coords );\n\n  FT_LOCAL( FT_Error )\n  T1_Set_MM_Design( T1_Face   face,\n                    FT_UInt   num_coords,\n                    FT_Long*  coords );\n\n  FT_LOCAL_DEF( FT_Error )\n  T1_Set_Var_Design( T1_Face    face,\n                     FT_UInt    num_coords,\n                     FT_Fixed*  coords );\n\n  FT_LOCAL( void )\n  T1_Done_Blend( T1_Face  face );\n\n#endif /* !T1_CONFIG_OPTION_NO_MM_SUPPORT */\n\n\nFT_END_HEADER\n\n#endif /* __T1LOAD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type1/t1objs.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1objs.c                                                               */\n/*                                                                         */\n/*    Type 1 objects manager (body).                                       */\n/*                                                                         */\n/*  Copyright 1996-2009, 2011, 2013 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_CALC_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_TRUETYPE_IDS_H\n\n#include \"t1gload.h\"\n#include \"t1load.h\"\n\n#include \"t1errors.h\"\n\n#ifndef T1_CONFIG_OPTION_NO_AFM\n#include \"t1afm.h\"\n#endif\n\n#include FT_SERVICE_POSTSCRIPT_CMAPS_H\n#include FT_INTERNAL_POSTSCRIPT_AUX_H\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_t1objs\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                            SIZE FUNCTIONS                             */\n  /*                                                                       */\n  /*  note that we store the global hints in the size's \"internal\" root    */\n  /*  field                                                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  static PSH_Globals_Funcs\n  T1_Size_Get_Globals_Funcs( T1_Size  size )\n  {\n    T1_Face           face     = (T1_Face)size->root.face;\n    PSHinter_Service  pshinter = (PSHinter_Service)face->pshinter;\n    FT_Module         module;\n\n\n    module = FT_Get_Module( size->root.face->driver->root.library,\n                            \"pshinter\" );\n    return ( module && pshinter && pshinter->get_globals_funcs )\n           ? pshinter->get_globals_funcs( module )\n           : 0 ;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  T1_Size_Done( FT_Size  t1size )          /* T1_Size */\n  {\n    T1_Size  size = (T1_Size)t1size;\n\n\n    if ( size->root.internal )\n    {\n      PSH_Globals_Funcs  funcs;\n\n\n      funcs = T1_Size_Get_Globals_Funcs( size );\n      if ( funcs )\n        funcs->destroy( (PSH_Globals)size->root.internal );\n\n      size->root.internal = 0;\n    }\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  T1_Size_Init( FT_Size  t1size )      /* T1_Size */\n  {\n    T1_Size            size  = (T1_Size)t1size;\n    FT_Error           error = FT_Err_Ok;\n    PSH_Globals_Funcs  funcs = T1_Size_Get_Globals_Funcs( size );\n\n\n    if ( funcs )\n    {\n      PSH_Globals  globals;\n      T1_Face      face = (T1_Face)size->root.face;\n\n\n      error = funcs->create( size->root.face->memory,\n                             &face->type1.private_dict, &globals );\n      if ( !error )\n        size->root.internal = (FT_Size_Internal)(void*)globals;\n    }\n\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  T1_Size_Request( FT_Size          t1size,     /* T1_Size */\n                   FT_Size_Request  req )\n  {\n    T1_Size            size  = (T1_Size)t1size;\n    PSH_Globals_Funcs  funcs = T1_Size_Get_Globals_Funcs( size );\n\n\n    FT_Request_Metrics( size->root.face, req );\n\n    if ( funcs )\n      funcs->set_scale( (PSH_Globals)size->root.internal,\n                        size->root.metrics.x_scale,\n                        size->root.metrics.y_scale,\n                        0, 0 );\n\n    return FT_Err_Ok;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                            SLOT  FUNCTIONS                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n  FT_LOCAL_DEF( void )\n  T1_GlyphSlot_Done( FT_GlyphSlot  slot )\n  {\n    slot->internal->glyph_hints = 0;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  T1_GlyphSlot_Init( FT_GlyphSlot  slot )\n  {\n    T1_Face           face;\n    PSHinter_Service  pshinter;\n\n\n    face     = (T1_Face)slot->face;\n    pshinter = (PSHinter_Service)face->pshinter;\n\n    if ( pshinter )\n    {\n      FT_Module  module;\n\n\n      module = FT_Get_Module( slot->face->driver->root.library,\n                              \"pshinter\" );\n      if ( module )\n      {\n        T1_Hints_Funcs  funcs;\n\n\n        funcs = pshinter->get_t1_funcs( module );\n        slot->internal->glyph_hints = (void*)funcs;\n      }\n    }\n\n    return 0;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                            FACE  FUNCTIONS                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    T1_Face_Done                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The face object destructor.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A typeless pointer to the face object to destroy.          */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  T1_Face_Done( FT_Face  t1face )         /* T1_Face */\n  {\n    T1_Face    face = (T1_Face)t1face;\n    FT_Memory  memory;\n    T1_Font    type1;\n\n\n    if ( !face )\n      return;\n\n    memory = face->root.memory;\n    type1  = &face->type1;\n\n#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT\n    /* release multiple masters information */\n    FT_ASSERT( ( face->len_buildchar == 0 ) == ( face->buildchar == NULL ) );\n\n    if ( face->buildchar )\n    {\n      FT_FREE( face->buildchar );\n\n      face->buildchar     = NULL;\n      face->len_buildchar = 0;\n    }\n\n    T1_Done_Blend( face );\n    face->blend = 0;\n#endif\n\n    /* release font info strings */\n    {\n      PS_FontInfo  info = &type1->font_info;\n\n\n      FT_FREE( info->version );\n      FT_FREE( info->notice );\n      FT_FREE( info->full_name );\n      FT_FREE( info->family_name );\n      FT_FREE( info->weight );\n    }\n\n    /* release top dictionary */\n    FT_FREE( type1->charstrings_len );\n    FT_FREE( type1->charstrings );\n    FT_FREE( type1->glyph_names );\n\n    FT_FREE( type1->subrs );\n    FT_FREE( type1->subrs_len );\n\n    FT_FREE( type1->subrs_block );\n    FT_FREE( type1->charstrings_block );\n    FT_FREE( type1->glyph_names_block );\n\n    FT_FREE( type1->encoding.char_index );\n    FT_FREE( type1->encoding.char_name );\n    FT_FREE( type1->font_name );\n\n#ifndef T1_CONFIG_OPTION_NO_AFM\n    /* release afm data if present */\n    if ( face->afm_data )\n      T1_Done_Metrics( memory, (AFM_FontInfo)face->afm_data );\n#endif\n\n    /* release unicode map, if any */\n#if 0\n    FT_FREE( face->unicode_map_rec.maps );\n    face->unicode_map_rec.num_maps = 0;\n    face->unicode_map              = NULL;\n#endif\n\n    face->root.family_name = NULL;\n    face->root.style_name  = NULL;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    T1_Face_Init                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The face object constructor.                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    stream     ::  input stream where to load font data.               */\n  /*                                                                       */\n  /*    face_index :: The index of the font face in the resource.          */\n  /*                                                                       */\n  /*    num_params :: Number of additional generic parameters.  Ignored.   */\n  /*                                                                       */\n  /*    params     :: Additional generic parameters.  Ignored.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: The face record to build.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  T1_Face_Init( FT_Stream      stream,\n                FT_Face        t1face,          /* T1_Face */\n                FT_Int         face_index,\n                FT_Int         num_params,\n                FT_Parameter*  params )\n  {\n    T1_Face             face = (T1_Face)t1face;\n    FT_Error            error;\n    FT_Service_PsCMaps  psnames;\n    PSAux_Service       psaux;\n    T1_Font             type1 = &face->type1;\n    PS_FontInfo         info = &type1->font_info;\n\n    FT_UNUSED( num_params );\n    FT_UNUSED( params );\n    FT_UNUSED( stream );\n\n\n    face->root.num_faces = 1;\n\n    FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );\n    face->psnames = psnames;\n\n    face->psaux = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ),\n                                           \"psaux\" );\n    psaux = (PSAux_Service)face->psaux;\n    if ( !psaux )\n    {\n      FT_ERROR(( \"T1_Face_Init: cannot access `psaux' module\\n\" ));\n      error = FT_THROW( Missing_Module );\n      goto Exit;\n    }\n\n    face->pshinter = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ),\n                                              \"pshinter\" );\n\n    FT_TRACE2(( \"Type 1 driver\\n\" ));\n\n    /* open the tokenizer; this will also check the font format */\n    error = T1_Open_Face( face );\n    if ( error )\n      goto Exit;\n\n    /* if we just wanted to check the format, leave successfully now */\n    if ( face_index < 0 )\n      goto Exit;\n\n    /* check the face index */\n    if ( face_index > 0 )\n    {\n      FT_ERROR(( \"T1_Face_Init: invalid face index\\n\" ));\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    /* now load the font program into the face object */\n\n    /* initialize the face object fields */\n\n    /* set up root face fields */\n    {\n      FT_Face  root = (FT_Face)&face->root;\n\n\n      root->num_glyphs = type1->num_glyphs;\n      root->face_index = 0;\n\n      root->face_flags |= FT_FACE_FLAG_SCALABLE    |\n                          FT_FACE_FLAG_HORIZONTAL  |\n                          FT_FACE_FLAG_GLYPH_NAMES |\n                          FT_FACE_FLAG_HINTER;\n\n      if ( info->is_fixed_pitch )\n        root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;\n\n      if ( face->blend )\n        root->face_flags |= FT_FACE_FLAG_MULTIPLE_MASTERS;\n\n      /* XXX: TODO -- add kerning with .afm support */\n\n\n      /* The following code to extract the family and the style is very   */\n      /* simplistic and might get some things wrong.  For a full-featured */\n      /* algorithm you might have a look at the whitepaper given at       */\n      /*                                                                  */\n      /*   http://blogs.msdn.com/text/archive/2007/04/23/wpf-font-selection-model.aspx */\n\n      /* get style name -- be careful, some broken fonts only */\n      /* have a `/FontName' dictionary entry!                 */\n      root->family_name = info->family_name;\n      root->style_name  = NULL;\n\n      if ( root->family_name )\n      {\n        char*  full   = info->full_name;\n        char*  family = root->family_name;\n\n\n        if ( full )\n        {\n          FT_Bool  the_same = TRUE;\n\n\n          while ( *full )\n          {\n            if ( *full == *family )\n            {\n              family++;\n              full++;\n            }\n            else\n            {\n              if ( *full == ' ' || *full == '-' )\n                full++;\n              else if ( *family == ' ' || *family == '-' )\n                family++;\n              else\n              {\n                the_same = FALSE;\n\n                if ( !*family )\n                  root->style_name = full;\n                break;\n              }\n            }\n          }\n\n          if ( the_same )\n            root->style_name = (char *)\"Regular\";\n        }\n      }\n      else\n      {\n        /* do we have a `/FontName'? */\n        if ( type1->font_name )\n          root->family_name = type1->font_name;\n      }\n\n      if ( !root->style_name )\n      {\n        if ( info->weight )\n          root->style_name = info->weight;\n        else\n          /* assume `Regular' style because we don't know better */\n          root->style_name = (char *)\"Regular\";\n      }\n\n      /* compute style flags */\n      root->style_flags = 0;\n      if ( info->italic_angle )\n        root->style_flags |= FT_STYLE_FLAG_ITALIC;\n      if ( info->weight )\n      {\n        if ( !ft_strcmp( info->weight, \"Bold\"  ) ||\n             !ft_strcmp( info->weight, \"Black\" ) )\n          root->style_flags |= FT_STYLE_FLAG_BOLD;\n      }\n\n      /* no embedded bitmap support */\n      root->num_fixed_sizes = 0;\n      root->available_sizes = 0;\n\n      root->bbox.xMin =   type1->font_bbox.xMin            >> 16;\n      root->bbox.yMin =   type1->font_bbox.yMin            >> 16;\n      /* no `U' suffix here to 0xFFFF! */\n      root->bbox.xMax = ( type1->font_bbox.xMax + 0xFFFF ) >> 16;\n      root->bbox.yMax = ( type1->font_bbox.yMax + 0xFFFF ) >> 16;\n\n      /* Set units_per_EM if we didn't set it in t1_parse_font_matrix. */\n      if ( !root->units_per_EM )\n        root->units_per_EM = 1000;\n\n      root->ascender  = (FT_Short)( root->bbox.yMax );\n      root->descender = (FT_Short)( root->bbox.yMin );\n\n      root->height = (FT_Short)( ( root->units_per_EM * 12 ) / 10 );\n      if ( root->height < root->ascender - root->descender )\n        root->height = (FT_Short)( root->ascender - root->descender );\n\n      /* now compute the maximum advance width */\n      root->max_advance_width =\n        (FT_Short)( root->bbox.xMax );\n      {\n        FT_Pos  max_advance;\n\n\n        error = T1_Compute_Max_Advance( face, &max_advance );\n\n        /* in case of error, keep the standard width */\n        if ( !error )\n          root->max_advance_width = (FT_Short)FIXED_TO_INT( max_advance );\n        else\n          error = FT_Err_Ok;   /* clear error */\n      }\n\n      root->max_advance_height = root->height;\n\n      root->underline_position  = (FT_Short)info->underline_position;\n      root->underline_thickness = (FT_Short)info->underline_thickness;\n    }\n\n    {\n      FT_Face  root = &face->root;\n\n\n      if ( psnames )\n      {\n        FT_CharMapRec    charmap;\n        T1_CMap_Classes  cmap_classes = psaux->t1_cmap_classes;\n        FT_CMap_Class    clazz;\n\n\n        charmap.face = root;\n\n        /* first of all, try to synthesize a Unicode charmap */\n        charmap.platform_id = TT_PLATFORM_MICROSOFT;\n        charmap.encoding_id = TT_MS_ID_UNICODE_CS;\n        charmap.encoding    = FT_ENCODING_UNICODE;\n\n        error = FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL );\n        if ( error                                      &&\n             FT_ERR_NEQ( error, No_Unicode_Glyph_Name ) )\n          goto Exit;\n        error = FT_Err_Ok;\n\n        /* now, generate an Adobe Standard encoding when appropriate */\n        charmap.platform_id = TT_PLATFORM_ADOBE;\n        clazz               = NULL;\n\n        switch ( type1->encoding_type )\n        {\n        case T1_ENCODING_TYPE_STANDARD:\n          charmap.encoding    = FT_ENCODING_ADOBE_STANDARD;\n          charmap.encoding_id = TT_ADOBE_ID_STANDARD;\n          clazz               = cmap_classes->standard;\n          break;\n\n        case T1_ENCODING_TYPE_EXPERT:\n          charmap.encoding    = FT_ENCODING_ADOBE_EXPERT;\n          charmap.encoding_id = TT_ADOBE_ID_EXPERT;\n          clazz               = cmap_classes->expert;\n          break;\n\n        case T1_ENCODING_TYPE_ARRAY:\n          charmap.encoding    = FT_ENCODING_ADOBE_CUSTOM;\n          charmap.encoding_id = TT_ADOBE_ID_CUSTOM;\n          clazz               = cmap_classes->custom;\n          break;\n\n        case T1_ENCODING_TYPE_ISOLATIN1:\n          charmap.encoding    = FT_ENCODING_ADOBE_LATIN_1;\n          charmap.encoding_id = TT_ADOBE_ID_LATIN_1;\n          clazz               = cmap_classes->unicode;\n          break;\n\n        default:\n          ;\n        }\n\n        if ( clazz )\n          error = FT_CMap_New( clazz, NULL, &charmap, NULL );\n\n#if 0\n        /* Select default charmap */\n        if (root->num_charmaps)\n          root->charmap = root->charmaps[0];\n#endif\n      }\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    T1_Driver_Init                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initializes a given Type 1 driver object.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    driver :: A handle to the target driver object.                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  T1_Driver_Init( FT_Module  driver )\n  {\n    FT_UNUSED( driver );\n\n    return FT_Err_Ok;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    T1_Driver_Done                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Finalizes a given Type 1 driver.                                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    driver :: A handle to the target Type 1 driver.                    */\n  /*                                                                       */\n  FT_LOCAL_DEF( void )\n  T1_Driver_Done( FT_Module  driver )\n  {\n    FT_UNUSED( driver );\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type1/t1objs.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1objs.h                                                               */\n/*                                                                         */\n/*    Type 1 objects manager (specification).                              */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2006, 2011 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T1OBJS_H__\n#define __T1OBJS_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_OBJECTS_H\n#include FT_CONFIG_CONFIG_H\n#include FT_INTERNAL_TYPE1_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /* The following structures must be defined by the hinter */\n  typedef struct T1_Size_Hints_   T1_Size_Hints;\n  typedef struct T1_Glyph_Hints_  T1_Glyph_Hints;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    T1_Size                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a Type 1 size object.                                  */\n  /*                                                                       */\n  typedef struct T1_SizeRec_*  T1_Size;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    T1_GlyphSlot                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a Type 1 glyph slot object.                            */\n  /*                                                                       */\n  typedef struct T1_GlyphSlotRec_*  T1_GlyphSlot;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    T1_CharMap                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a Type 1 character mapping object.                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The Type 1 format doesn't use a charmap but an encoding table.     */\n  /*    The driver is responsible for making up charmap objects            */\n  /*    corresponding to these tables.                                     */\n  /*                                                                       */\n  typedef struct T1_CharMapRec_*   T1_CharMap;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                  HERE BEGINS THE TYPE1 SPECIFIC STUFF                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    T1_SizeRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Type 1 size record.                                                */\n  /*                                                                       */\n  typedef struct  T1_SizeRec_\n  {\n    FT_SizeRec  root;\n\n  } T1_SizeRec;\n\n\n  FT_LOCAL( void )\n  T1_Size_Done( FT_Size  size );\n\n  FT_LOCAL( FT_Error )\n  T1_Size_Request( FT_Size          size,\n                   FT_Size_Request  req );\n\n  FT_LOCAL( FT_Error )\n  T1_Size_Init( FT_Size  size );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    T1_GlyphSlotRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Type 1 glyph slot record.                                          */\n  /*                                                                       */\n  typedef struct  T1_GlyphSlotRec_\n  {\n    FT_GlyphSlotRec  root;\n\n    FT_Bool          hint;\n    FT_Bool          scaled;\n\n    FT_Int           max_points;\n    FT_Int           max_contours;\n\n    FT_Fixed         x_scale;\n    FT_Fixed         y_scale;\n\n  } T1_GlyphSlotRec;\n\n\n  FT_LOCAL( FT_Error )\n  T1_Face_Init( FT_Stream      stream,\n                FT_Face        face,\n                FT_Int         face_index,\n                FT_Int         num_params,\n                FT_Parameter*  params );\n\n  FT_LOCAL( void )\n  T1_Face_Done( FT_Face  face );\n\n  FT_LOCAL( FT_Error )\n  T1_GlyphSlot_Init( FT_GlyphSlot  slot );\n\n  FT_LOCAL( void )\n  T1_GlyphSlot_Done( FT_GlyphSlot  slot );\n\n  FT_LOCAL( FT_Error )\n  T1_Driver_Init( FT_Module  driver );\n\n  FT_LOCAL( void )\n  T1_Driver_Done( FT_Module  driver );\n\n\nFT_END_HEADER\n\n#endif /* __T1OBJS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type1/t1parse.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1parse.c                                                              */\n/*                                                                         */\n/*    Type 1 parser (body).                                                */\n/*                                                                         */\n/*  Copyright 1996-2005, 2008, 2009, 2012-2014 by                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The Type 1 parser is in charge of the following:                      */\n  /*                                                                       */\n  /*  - provide an implementation of a growing sequence of objects called  */\n  /*    a `T1_Table' (used to build various tables needed by the loader).  */\n  /*                                                                       */\n  /*  - opening .pfb and .pfa files to extract their top-level and private */\n  /*    dictionaries.                                                      */\n  /*                                                                       */\n  /*  - read numbers, arrays & strings from any dictionary.                */\n  /*                                                                       */\n  /* See `t1load.c' to see how data is loaded from the font file.          */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_POSTSCRIPT_AUX_H\n\n#include \"t1parse.h\"\n\n#include \"t1errors.h\"\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_t1parse\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                   INPUT STREAM PARSER                         *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /* see Adobe Technical Note 5040.Download_Fonts.pdf */\n\n  static FT_Error\n  read_pfb_tag( FT_Stream   stream,\n                FT_UShort  *atag,\n                FT_ULong   *asize )\n  {\n    FT_Error   error;\n    FT_UShort  tag;\n    FT_ULong   size;\n\n\n    *atag  = 0;\n    *asize = 0;\n\n    if ( !FT_READ_USHORT( tag ) )\n    {\n      if ( tag == 0x8001U || tag == 0x8002U )\n      {\n        if ( !FT_READ_ULONG_LE( size ) )\n          *asize = size;\n      }\n\n      *atag = tag;\n    }\n\n    return error;\n  }\n\n\n  static FT_Error\n  check_type1_format( FT_Stream    stream,\n                      const char*  header_string,\n                      size_t       header_length )\n  {\n    FT_Error   error;\n    FT_UShort  tag;\n    FT_ULong   dummy;\n\n\n    if ( FT_STREAM_SEEK( 0 ) )\n      goto Exit;\n\n    error = read_pfb_tag( stream, &tag, &dummy );\n    if ( error )\n      goto Exit;\n\n    /* We assume that the first segment in a PFB is always encoded as   */\n    /* text.  This might be wrong (and the specification doesn't insist */\n    /* on that), but we have never seen a counterexample.               */\n    if ( tag != 0x8001U && FT_STREAM_SEEK( 0 ) )\n      goto Exit;\n\n    if ( !FT_FRAME_ENTER( header_length ) )\n    {\n      error = FT_Err_Ok;\n\n      if ( ft_memcmp( stream->cursor, header_string, header_length ) != 0 )\n        error = FT_THROW( Unknown_File_Format );\n\n      FT_FRAME_EXIT();\n    }\n\n  Exit:\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  T1_New_Parser( T1_Parser      parser,\n                 FT_Stream      stream,\n                 FT_Memory      memory,\n                 PSAux_Service  psaux )\n  {\n    FT_Error   error;\n    FT_UShort  tag;\n    FT_ULong   size;\n\n\n    psaux->ps_parser_funcs->init( &parser->root, 0, 0, memory );\n\n    parser->stream       = stream;\n    parser->base_len     = 0;\n    parser->base_dict    = 0;\n    parser->private_len  = 0;\n    parser->private_dict = 0;\n    parser->in_pfb       = 0;\n    parser->in_memory    = 0;\n    parser->single_block = 0;\n\n    /* check the header format */\n    error = check_type1_format( stream, \"%!PS-AdobeFont\", 14 );\n    if ( error )\n    {\n      if ( FT_ERR_NEQ( error, Unknown_File_Format ) )\n        goto Exit;\n\n      error = check_type1_format( stream, \"%!FontType\", 10 );\n      if ( error )\n      {\n        FT_TRACE2(( \"  not a Type 1 font\\n\" ));\n        goto Exit;\n      }\n    }\n\n    /******************************************************************/\n    /*                                                                */\n    /* Here a short summary of what is going on:                      */\n    /*                                                                */\n    /*   When creating a new Type 1 parser, we try to locate and load */\n    /*   the base dictionary if this is possible (i.e., for PFB       */\n    /*   files).  Otherwise, we load the whole font into memory.      */\n    /*                                                                */\n    /*   When `loading' the base dictionary, we only setup pointers   */\n    /*   in the case of a memory-based stream.  Otherwise, we         */\n    /*   allocate and load the base dictionary in it.                 */\n    /*                                                                */\n    /*   parser->in_pfb is set if we are in a binary (`.pfb') font.   */\n    /*   parser->in_memory is set if we have a memory stream.         */\n    /*                                                                */\n\n    /* try to compute the size of the base dictionary;     */\n    /* look for a Postscript binary file tag, i.e., 0x8001 */\n    if ( FT_STREAM_SEEK( 0L ) )\n      goto Exit;\n\n    error = read_pfb_tag( stream, &tag, &size );\n    if ( error )\n      goto Exit;\n\n    if ( tag != 0x8001U )\n    {\n      /* assume that this is a PFA file for now; an error will */\n      /* be produced later when more things are checked        */\n      if ( FT_STREAM_SEEK( 0L ) )\n        goto Exit;\n      size = stream->size;\n    }\n    else\n      parser->in_pfb = 1;\n\n    /* now, try to load `size' bytes of the `base' dictionary we */\n    /* found previously                                          */\n\n    /* if it is a memory-based resource, set up pointers */\n    if ( !stream->read )\n    {\n      parser->base_dict = (FT_Byte*)stream->base + stream->pos;\n      parser->base_len  = size;\n      parser->in_memory = 1;\n\n      /* check that the `size' field is valid */\n      if ( FT_STREAM_SKIP( size ) )\n        goto Exit;\n    }\n    else\n    {\n      /* read segment in memory -- this is clumsy, but so does the format */\n      if ( FT_ALLOC( parser->base_dict, size )       ||\n           FT_STREAM_READ( parser->base_dict, size ) )\n        goto Exit;\n      parser->base_len = size;\n    }\n\n    parser->root.base   = parser->base_dict;\n    parser->root.cursor = parser->base_dict;\n    parser->root.limit  = parser->root.cursor + parser->base_len;\n\n  Exit:\n    if ( error && !parser->in_memory )\n      FT_FREE( parser->base_dict );\n\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  T1_Finalize_Parser( T1_Parser  parser )\n  {\n    FT_Memory  memory = parser->root.memory;\n\n\n    /* always free the private dictionary */\n    FT_FREE( parser->private_dict );\n\n    /* free the base dictionary only when we have a disk stream */\n    if ( !parser->in_memory )\n      FT_FREE( parser->base_dict );\n\n    parser->root.funcs.done( &parser->root );\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  T1_Get_Private_Dict( T1_Parser      parser,\n                       PSAux_Service  psaux )\n  {\n    FT_Stream  stream = parser->stream;\n    FT_Memory  memory = parser->root.memory;\n    FT_Error   error  = FT_Err_Ok;\n    FT_ULong   size;\n\n\n    if ( parser->in_pfb )\n    {\n      /* in the case of the PFB format, the private dictionary can be  */\n      /* made of several segments.  We thus first read the number of   */\n      /* segments to compute the total size of the private dictionary  */\n      /* then re-read them into memory.                                */\n      FT_Long    start_pos = FT_STREAM_POS();\n      FT_UShort  tag;\n\n\n      parser->private_len = 0;\n      for (;;)\n      {\n        error = read_pfb_tag( stream, &tag, &size );\n        if ( error )\n          goto Fail;\n\n        if ( tag != 0x8002U )\n          break;\n\n        parser->private_len += size;\n\n        if ( FT_STREAM_SKIP( size ) )\n          goto Fail;\n      }\n\n      /* Check that we have a private dictionary there */\n      /* and allocate private dictionary buffer        */\n      if ( parser->private_len == 0 )\n      {\n        FT_ERROR(( \"T1_Get_Private_Dict:\"\n                   \" invalid private dictionary section\\n\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Fail;\n      }\n\n      if ( FT_STREAM_SEEK( start_pos )                           ||\n           FT_ALLOC( parser->private_dict, parser->private_len ) )\n        goto Fail;\n\n      parser->private_len = 0;\n      for (;;)\n      {\n        error = read_pfb_tag( stream, &tag, &size );\n        if ( error || tag != 0x8002U )\n        {\n          error = FT_Err_Ok;\n          break;\n        }\n\n        if ( FT_STREAM_READ( parser->private_dict + parser->private_len,\n                             size ) )\n          goto Fail;\n\n        parser->private_len += size;\n      }\n    }\n    else\n    {\n      /* We have already `loaded' the whole PFA font file into memory; */\n      /* if this is a memory resource, allocate a new block to hold    */\n      /* the private dict.  Otherwise, simply overwrite into the base  */\n      /* dictionary block in the heap.                                 */\n\n      /* first of all, look at the `eexec' keyword */\n      FT_Byte*    cur   = parser->base_dict;\n      FT_Byte*    limit = cur + parser->base_len;\n      FT_Byte     c;\n      FT_Pointer  pos_lf;\n      FT_Bool     test_cr;\n\n\n    Again:\n      for (;;)\n      {\n        c = cur[0];\n        if ( c == 'e' && cur + 9 < limit )  /* 9 = 5 letters for `eexec' + */\n                                            /* whitespace + 4 chars        */\n        {\n          if ( cur[1] == 'e' &&\n               cur[2] == 'x' &&\n               cur[3] == 'e' &&\n               cur[4] == 'c' )\n            break;\n        }\n        cur++;\n        if ( cur >= limit )\n        {\n          FT_ERROR(( \"T1_Get_Private_Dict:\"\n                     \" could not find `eexec' keyword\\n\" ));\n          error = FT_THROW( Invalid_File_Format );\n          goto Exit;\n        }\n      }\n\n      /* check whether `eexec' was real -- it could be in a comment */\n      /* or string (as e.g. in u003043t.gsf from ghostscript)       */\n\n      parser->root.cursor = parser->base_dict;\n      /* set limit to `eexec' + whitespace + 4 characters */\n      parser->root.limit  = cur + 10;\n\n      cur   = parser->root.cursor;\n      limit = parser->root.limit;\n\n      while ( cur < limit )\n      {\n        if ( *cur == 'e' && ft_strncmp( (char*)cur, \"eexec\", 5 ) == 0 )\n          goto Found;\n\n        T1_Skip_PS_Token( parser );\n        if ( parser->root.error )\n          break;\n        T1_Skip_Spaces  ( parser );\n        cur = parser->root.cursor;\n      }\n\n      /* we haven't found the correct `eexec'; go back and continue */\n      /* searching                                                  */\n\n      cur   = limit;\n      limit = parser->base_dict + parser->base_len;\n      goto Again;\n\n      /* now determine where to write the _encrypted_ binary private  */\n      /* dictionary.  We overwrite the base dictionary for disk-based */\n      /* resources and allocate a new block otherwise                 */\n\n    Found:\n      parser->root.limit = parser->base_dict + parser->base_len;\n\n      T1_Skip_PS_Token( parser );\n      cur   = parser->root.cursor;\n      limit = parser->root.limit;\n\n      /* According to the Type 1 spec, the first cipher byte must not be */\n      /* an ASCII whitespace character code (blank, tab, carriage return */\n      /* or line feed).  We have seen Type 1 fonts with two line feed    */\n      /* characters...  So skip now all whitespace character codes.      */\n      /*                                                                 */\n      /* On the other hand, Adobe's Type 1 parser handles fonts just     */\n      /* fine that are violating this limitation, so we add a heuristic  */\n      /* test to stop at \\r only if it is not used for EOL.              */\n\n      pos_lf  = ft_memchr( cur, '\\n', limit - cur );\n      test_cr = FT_BOOL( !pos_lf                                      ||\n                         pos_lf > ft_memchr( cur, '\\r', limit - cur ) );\n\n      while ( cur < limit                    &&\n              ( *cur == ' '                ||\n                *cur == '\\t'               ||\n                (test_cr && *cur == '\\r' ) ||\n                *cur == '\\n'               ) )\n        ++cur;\n      if ( cur >= limit )\n      {\n        FT_ERROR(( \"T1_Get_Private_Dict:\"\n                   \" `eexec' not properly terminated\\n\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Exit;\n      }\n\n      size = (FT_ULong)( parser->base_len - ( cur - parser->base_dict ) );\n\n      if ( parser->in_memory )\n      {\n        /* note that we allocate one more byte to put a terminating `0' */\n        if ( FT_ALLOC( parser->private_dict, size + 1 ) )\n          goto Fail;\n        parser->private_len = size;\n      }\n      else\n      {\n        parser->single_block = 1;\n        parser->private_dict = parser->base_dict;\n        parser->private_len  = size;\n        parser->base_dict    = 0;\n        parser->base_len     = 0;\n      }\n\n      /* now determine whether the private dictionary is encoded in binary */\n      /* or hexadecimal ASCII format -- decode it accordingly              */\n\n      /* we need to access the next 4 bytes (after the final whitespace */\n      /* following the `eexec' keyword); if they all are hexadecimal    */\n      /* digits, then we have a case of ASCII storage                   */\n\n      if ( cur + 3 < limit                                &&\n           ft_isxdigit( cur[0] ) && ft_isxdigit( cur[1] ) &&\n           ft_isxdigit( cur[2] ) && ft_isxdigit( cur[3] ) )\n      {\n        /* ASCII hexadecimal encoding */\n        FT_Long  len;\n\n\n        parser->root.cursor = cur;\n        (void)psaux->ps_parser_funcs->to_bytes( &parser->root,\n                                                parser->private_dict,\n                                                parser->private_len,\n                                                &len,\n                                                0 );\n        parser->private_len = len;\n\n        /* put a safeguard */\n        parser->private_dict[len] = '\\0';\n      }\n      else\n        /* binary encoding -- copy the private dict */\n        FT_MEM_MOVE( parser->private_dict, cur, size );\n    }\n\n    /* we now decrypt the encoded binary private dictionary */\n    psaux->t1_decrypt( parser->private_dict, parser->private_len, 55665U );\n\n    if ( parser->private_len < 4 )\n    {\n      FT_ERROR(( \"T1_Get_Private_Dict:\"\n                 \" invalid private dictionary section\\n\" ));\n      error = FT_THROW( Invalid_File_Format );\n      goto Fail;\n    }\n\n    /* replace the four random bytes at the beginning with whitespace */\n    parser->private_dict[0] = ' ';\n    parser->private_dict[1] = ' ';\n    parser->private_dict[2] = ' ';\n    parser->private_dict[3] = ' ';\n\n    parser->root.base   = parser->private_dict;\n    parser->root.cursor = parser->private_dict;\n    parser->root.limit  = parser->root.cursor + parser->private_len;\n\n  Fail:\n  Exit:\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type1/t1parse.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1parse.h                                                              */\n/*                                                                         */\n/*    Type 1 parser (specification).                                       */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2008 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T1PARSE_H__\n#define __T1PARSE_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_TYPE1_TYPES_H\n#include FT_INTERNAL_STREAM_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    T1_ParserRec                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A PS_ParserRec is an object used to parse a Type 1 fonts very      */\n  /*    quickly.                                                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root         :: The root parser.                                   */\n  /*                                                                       */\n  /*    stream       :: The current input stream.                          */\n  /*                                                                       */\n  /*    base_dict    :: A pointer to the top-level dictionary.             */\n  /*                                                                       */\n  /*    base_len     :: The length in bytes of the top dictionary.         */\n  /*                                                                       */\n  /*    private_dict :: A pointer to the private dictionary.               */\n  /*                                                                       */\n  /*    private_len  :: The length in bytes of the private dictionary.     */\n  /*                                                                       */\n  /*    in_pfb       :: A boolean.  Indicates that we are handling a PFB   */\n  /*                    file.                                              */\n  /*                                                                       */\n  /*    in_memory    :: A boolean.  Indicates a memory-based stream.       */\n  /*                                                                       */\n  /*    single_block :: A boolean.  Indicates that the private dictionary  */\n  /*                    is stored in lieu of the base dictionary.          */\n  /*                                                                       */\n  typedef struct  T1_ParserRec_\n  {\n    PS_ParserRec  root;\n    FT_Stream     stream;\n\n    FT_Byte*      base_dict;\n    FT_ULong      base_len;\n\n    FT_Byte*      private_dict;\n    FT_ULong      private_len;\n\n    FT_Bool       in_pfb;\n    FT_Bool       in_memory;\n    FT_Bool       single_block;\n\n  } T1_ParserRec, *T1_Parser;\n\n\n#define T1_Add_Table( p, i, o, l )  (p)->funcs.add( (p), i, o, l )\n#define T1_Done_Table( p )          \\\n          do                        \\\n          {                         \\\n            if ( (p)->funcs.done )  \\\n              (p)->funcs.done( p ); \\\n          } while ( 0 )\n#define T1_Release_Table( p )          \\\n          do                           \\\n          {                            \\\n            if ( (p)->funcs.release )  \\\n              (p)->funcs.release( p ); \\\n          } while ( 0 )\n\n\n#define T1_Skip_Spaces( p )    (p)->root.funcs.skip_spaces( &(p)->root )\n#define T1_Skip_PS_Token( p )  (p)->root.funcs.skip_PS_token( &(p)->root )\n\n#define T1_ToInt( p )       (p)->root.funcs.to_int( &(p)->root )\n#define T1_ToFixed( p, t )  (p)->root.funcs.to_fixed( &(p)->root, t )\n\n#define T1_ToCoordArray( p, m, c )                           \\\n          (p)->root.funcs.to_coord_array( &(p)->root, m, c )\n#define T1_ToFixedArray( p, m, f, t )                           \\\n          (p)->root.funcs.to_fixed_array( &(p)->root, m, f, t )\n#define T1_ToToken( p, t )                          \\\n          (p)->root.funcs.to_token( &(p)->root, t )\n#define T1_ToTokenArray( p, t, m, c )                           \\\n          (p)->root.funcs.to_token_array( &(p)->root, t, m, c )\n\n#define T1_Load_Field( p, f, o, m, pf )                         \\\n          (p)->root.funcs.load_field( &(p)->root, f, o, m, pf )\n\n#define T1_Load_Field_Table( p, f, o, m, pf )                         \\\n          (p)->root.funcs.load_field_table( &(p)->root, f, o, m, pf )\n\n\n  FT_LOCAL( FT_Error )\n  T1_New_Parser( T1_Parser      parser,\n                 FT_Stream      stream,\n                 FT_Memory      memory,\n                 PSAux_Service  psaux );\n\n  FT_LOCAL( FT_Error )\n  T1_Get_Private_Dict( T1_Parser      parser,\n                       PSAux_Service  psaux );\n\n  FT_LOCAL( void )\n  T1_Finalize_Parser( T1_Parser  parser );\n\n\nFT_END_HEADER\n\n#endif /* __T1PARSE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type1/t1tokens.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1tokens.h                                                             */\n/*                                                                         */\n/*    Type 1 tokenizer (specification).                                    */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by             */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  PS_FontInfoRec\n#undef  T1CODE\n#define T1CODE        T1_FIELD_LOCATION_FONT_INFO\n\n  T1_FIELD_STRING( \"version\",            version,\n                   T1_FIELD_DICT_FONTDICT )\n  T1_FIELD_STRING( \"Notice\",             notice,\n                   T1_FIELD_DICT_FONTDICT )\n  T1_FIELD_STRING( \"FullName\",           full_name,\n                   T1_FIELD_DICT_FONTDICT )\n  T1_FIELD_STRING( \"FamilyName\",         family_name,\n                   T1_FIELD_DICT_FONTDICT )\n  T1_FIELD_STRING( \"Weight\",             weight,\n                   T1_FIELD_DICT_FONTDICT )\n\n  /* we use pointers to detect modifications made by synthetic fonts */\n  T1_FIELD_NUM   ( \"ItalicAngle\",        italic_angle,\n                   T1_FIELD_DICT_FONTDICT )\n  T1_FIELD_BOOL  ( \"isFixedPitch\",       is_fixed_pitch,\n                   T1_FIELD_DICT_FONTDICT )\n  T1_FIELD_NUM   ( \"UnderlinePosition\",  underline_position,\n                   T1_FIELD_DICT_FONTDICT )\n  T1_FIELD_NUM   ( \"UnderlineThickness\", underline_thickness,\n                   T1_FIELD_DICT_FONTDICT )\n\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  PS_FontExtraRec\n#undef  T1CODE\n#define T1CODE        T1_FIELD_LOCATION_FONT_EXTRA\n\n  T1_FIELD_NUM   ( \"FSType\", fs_type,\n                   T1_FIELD_DICT_FONTDICT )\n\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  PS_PrivateRec\n#undef  T1CODE\n#define T1CODE        T1_FIELD_LOCATION_PRIVATE\n\n  T1_FIELD_NUM       ( \"UniqueID\",         unique_id,\n                       T1_FIELD_DICT_FONTDICT | T1_FIELD_DICT_PRIVATE )\n  T1_FIELD_NUM       ( \"lenIV\",            lenIV,\n                       T1_FIELD_DICT_PRIVATE )\n  T1_FIELD_NUM       ( \"LanguageGroup\",    language_group,\n                       T1_FIELD_DICT_PRIVATE )\n  T1_FIELD_NUM       ( \"password\",         password,\n                       T1_FIELD_DICT_PRIVATE )\n\n  T1_FIELD_FIXED_1000( \"BlueScale\",        blue_scale,\n                       T1_FIELD_DICT_PRIVATE )\n  T1_FIELD_NUM       ( \"BlueShift\",        blue_shift,\n                       T1_FIELD_DICT_PRIVATE )\n  T1_FIELD_NUM       ( \"BlueFuzz\",         blue_fuzz,\n                       T1_FIELD_DICT_PRIVATE )\n\n  T1_FIELD_NUM_TABLE ( \"BlueValues\",       blue_values,        14,\n                       T1_FIELD_DICT_PRIVATE )\n  T1_FIELD_NUM_TABLE ( \"OtherBlues\",       other_blues,        10,\n                       T1_FIELD_DICT_PRIVATE )\n  T1_FIELD_NUM_TABLE ( \"FamilyBlues\",      family_blues,       14,\n                       T1_FIELD_DICT_PRIVATE )\n  T1_FIELD_NUM_TABLE ( \"FamilyOtherBlues\", family_other_blues, 10,\n                       T1_FIELD_DICT_PRIVATE )\n\n  T1_FIELD_NUM_TABLE2( \"StdHW\",            standard_width,      1,\n                       T1_FIELD_DICT_PRIVATE )\n  T1_FIELD_NUM_TABLE2( \"StdVW\",            standard_height,     1,\n                       T1_FIELD_DICT_PRIVATE )\n  T1_FIELD_NUM_TABLE2( \"MinFeature\",       min_feature,         2,\n                       T1_FIELD_DICT_PRIVATE )\n\n  T1_FIELD_NUM_TABLE ( \"StemSnapH\",        snap_widths,        12,\n                       T1_FIELD_DICT_PRIVATE )\n  T1_FIELD_NUM_TABLE ( \"StemSnapV\",        snap_heights,       12,\n                       T1_FIELD_DICT_PRIVATE )\n\n  T1_FIELD_FIXED     ( \"ExpansionFactor\",  expansion_factor,\n                       T1_FIELD_DICT_PRIVATE )\n  T1_FIELD_BOOL      ( \"ForceBold\",        force_bold,\n                       T1_FIELD_DICT_PRIVATE )\n\n\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  T1_FontRec\n#undef  T1CODE\n#define T1CODE        T1_FIELD_LOCATION_FONT_DICT\n\n  T1_FIELD_KEY  ( \"FontName\",    font_name,    T1_FIELD_DICT_FONTDICT )\n  T1_FIELD_NUM  ( \"PaintType\",   paint_type,   T1_FIELD_DICT_FONTDICT )\n  T1_FIELD_NUM  ( \"FontType\",    font_type,    T1_FIELD_DICT_FONTDICT )\n  T1_FIELD_FIXED( \"StrokeWidth\", stroke_width, T1_FIELD_DICT_FONTDICT )\n\n\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  FT_BBox\n#undef  T1CODE\n#define T1CODE        T1_FIELD_LOCATION_BBOX\n\n  T1_FIELD_BBOX( \"FontBBox\", xMin, T1_FIELD_DICT_FONTDICT )\n\n\n#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT\n\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  T1_FaceRec\n#undef  T1CODE\n#define T1CODE        T1_FIELD_LOCATION_FACE\n\n  T1_FIELD_NUM( \"NDV\", ndv_idx, T1_FIELD_DICT_PRIVATE )\n  T1_FIELD_NUM( \"CDV\", cdv_idx, T1_FIELD_DICT_PRIVATE )\n\n\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  PS_BlendRec\n#undef  T1CODE\n#define T1CODE        T1_FIELD_LOCATION_BLEND\n\n  T1_FIELD_NUM_TABLE( \"DesignVector\", default_design_vector,\n                      T1_MAX_MM_DESIGNS, T1_FIELD_DICT_FONTDICT )\n\n\n#endif /* T1_CONFIG_OPTION_NO_MM_SUPPORT */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type1/type1.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  type1.c                                                                */\n/*                                                                         */\n/*    FreeType Type 1 driver component (body only).                        */\n/*                                                                         */\n/*  Copyright 1996-2001 by                                                 */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#define FT_MAKE_OPTION_SINGLE_OBJECT\n\n#include <ft2build.h>\n#include \"t1parse.c\"\n#include \"t1load.c\"\n#include \"t1objs.c\"\n#include \"t1driver.c\"\n#include \"t1gload.c\"\n\n#ifndef T1_CONFIG_OPTION_NO_AFM\n#include \"t1afm.c\"\n#endif\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type42/Jamfile",
    "content": "# FreeType 2 src/type42 Jamfile\n#\n# Copyright 2002 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) type42 ;\n\n{\n  local  _sources ;\n\n  if $(FT2_MULTI)\n  {\n    _sources = t42objs t42parse t42drivr ;\n  }\n  else\n  {\n    _sources = type42 ;\n  }\n\n  Library  $(FT2_LIB) : $(_sources).c ;\n}\n\n# end of src/type42 Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/type42/module.mk",
    "content": "#\n# FreeType 2 Type42 module definition\n#\n\n\n# Copyright 2002, 2006 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\nFTMODULE_H_COMMANDS += TYPE42_DRIVER\n\ndefine TYPE42_DRIVER\n$(OPEN_DRIVER) FT_Driver_ClassRec, t42_driver_class $(CLOSE_DRIVER)\n$(ECHO_DRIVER)type42    $(ECHO_DRIVER_DESC)Type 42 font files with no known extension$(ECHO_DRIVER_DONE)\nendef\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/type42/rules.mk",
    "content": "#\n# FreeType 2 Type42 driver configuration rules\n#\n\n\n# Copyright 2002, 2003, 2008 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\n# Type42 driver directory\n#\nT42_DIR := $(SRC_DIR)/type42\n\n\n# compilation flags for the driver\n#\nT42_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(T42_DIR))\n\n\n# Type42 driver source\n#\nT42_DRV_SRC := $(T42_DIR)/t42objs.c  \\\n               $(T42_DIR)/t42parse.c \\\n               $(T42_DIR)/t42drivr.c\n\n# Type42 driver headers\n#\nT42_DRV_H := $(T42_DRV_SRC:%.c=%.h) \\\n             $(T42_DIR)/t42error.h  \\\n             $(T42_DIR)/t42types.h\n\n\n# Type42 driver object(s)\n#\n#   T42_DRV_OBJ_M is used during `multi' builds\n#   T42_DRV_OBJ_S is used during `single' builds\n#\nT42_DRV_OBJ_M := $(T42_DRV_SRC:$(T42_DIR)/%.c=$(OBJ_DIR)/%.$O)\nT42_DRV_OBJ_S := $(OBJ_DIR)/type42.$O\n\n# Type42 driver source file for single build\n#\nT42_DRV_SRC_S := $(T42_DIR)/type42.c\n\n\n# Type42 driver - single object\n#\n$(T42_DRV_OBJ_S): $(T42_DRV_SRC_S) $(T42_DRV_SRC) $(FREETYPE_H) $(T42_DRV_H)\n\t$(T42_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(T42_DRV_SRC_S))\n\n\n# Type42 driver - multiple objects\n#\n$(OBJ_DIR)/%.$O: $(T42_DIR)/%.c $(FREETYPE_H) $(T42_DRV_H)\n\t$(T42_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\n\n\n# update main driver object lists\n#\nDRV_OBJS_S += $(T42_DRV_OBJ_S)\nDRV_OBJS_M += $(T42_DRV_OBJ_M)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/type42/t42drivr.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t42drivr.c                                                             */\n/*                                                                         */\n/*    High-level Type 42 driver interface (body).                          */\n/*                                                                         */\n/*  Copyright 2002-2004, 2006, 2007, 2009, 2011, 2013 by                   */\n/*  Roberto Alameda.                                                       */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This driver implements Type42 fonts as described in the               */\n  /* Technical Note #5012 from Adobe, with these limitations:              */\n  /*                                                                       */\n  /* 1) CID Fonts are not currently supported.                             */\n  /* 2) Incremental fonts making use of the GlyphDirectory keyword         */\n  /*    will be loaded, but the rendering will be using the TrueType       */\n  /*    tables.                                                            */\n  /* 3) As for Type1 fonts, CDevProc is not supported.                     */\n  /* 4) The Metrics dictionary is not supported.                           */\n  /* 5) AFM metrics are not supported.                                     */\n  /*                                                                       */\n  /* In other words, this driver supports Type42 fonts derived from        */\n  /* TrueType fonts in a non-CID manner, as done by usual conversion       */\n  /* programs.                                                             */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#include \"t42drivr.h\"\n#include \"t42objs.h\"\n#include \"t42error.h\"\n#include FT_INTERNAL_DEBUG_H\n\n#include FT_SERVICE_XFREE86_NAME_H\n#include FT_SERVICE_GLYPH_DICT_H\n#include FT_SERVICE_POSTSCRIPT_NAME_H\n#include FT_SERVICE_POSTSCRIPT_INFO_H\n\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_t42\n\n\n  /*\n   *\n   *  GLYPH DICT SERVICE\n   *\n   */\n\n  static FT_Error\n  t42_get_glyph_name( T42_Face    face,\n                      FT_UInt     glyph_index,\n                      FT_Pointer  buffer,\n                      FT_UInt     buffer_max )\n  {\n    FT_STRCPYN( buffer, face->type1.glyph_names[glyph_index], buffer_max );\n\n    return FT_Err_Ok;\n  }\n\n\n  static FT_UInt\n  t42_get_name_index( T42_Face    face,\n                      FT_String*  glyph_name )\n  {\n    FT_Int  i;\n\n\n    for ( i = 0; i < face->type1.num_glyphs; i++ )\n    {\n      FT_String*  gname = face->type1.glyph_names[i];\n\n\n      if ( glyph_name[0] == gname[0] && !ft_strcmp( glyph_name, gname ) )\n        return (FT_UInt)ft_atol( (const char *)face->type1.charstrings[i] );\n    }\n\n    return 0;\n  }\n\n\n  static const FT_Service_GlyphDictRec  t42_service_glyph_dict =\n  {\n    (FT_GlyphDict_GetNameFunc)  t42_get_glyph_name,\n    (FT_GlyphDict_NameIndexFunc)t42_get_name_index\n  };\n\n\n  /*\n   *\n   *  POSTSCRIPT NAME SERVICE\n   *\n   */\n\n  static const char*\n  t42_get_ps_font_name( T42_Face  face )\n  {\n    return (const char*)face->type1.font_name;\n  }\n\n\n  static const FT_Service_PsFontNameRec  t42_service_ps_font_name =\n  {\n    (FT_PsName_GetFunc)t42_get_ps_font_name\n  };\n\n\n  /*\n   *\n   *  POSTSCRIPT INFO SERVICE\n   *\n   */\n\n  static FT_Error\n  t42_ps_get_font_info( FT_Face          face,\n                        PS_FontInfoRec*  afont_info )\n  {\n    *afont_info = ((T42_Face)face)->type1.font_info;\n\n    return FT_Err_Ok;\n  }\n\n\n  static FT_Error\n  t42_ps_get_font_extra( FT_Face           face,\n                         PS_FontExtraRec*  afont_extra )\n  {\n    *afont_extra = ((T42_Face)face)->type1.font_extra;\n\n    return FT_Err_Ok;\n  }\n\n\n  static FT_Int\n  t42_ps_has_glyph_names( FT_Face  face )\n  {\n    FT_UNUSED( face );\n\n    return 1;\n  }\n\n\n  static FT_Error\n  t42_ps_get_font_private( FT_Face         face,\n                           PS_PrivateRec*  afont_private )\n  {\n    *afont_private = ((T42_Face)face)->type1.private_dict;\n\n    return FT_Err_Ok;\n  }\n\n\n  static const FT_Service_PsInfoRec  t42_service_ps_info =\n  {\n    (PS_GetFontInfoFunc)   t42_ps_get_font_info,\n    (PS_GetFontExtraFunc)  t42_ps_get_font_extra,\n    (PS_HasGlyphNamesFunc) t42_ps_has_glyph_names,\n    (PS_GetFontPrivateFunc)t42_ps_get_font_private,\n    (PS_GetFontValueFunc)  NULL             /* not implemented */\n  };\n\n\n  /*\n   *\n   *  SERVICE LIST\n   *\n   */\n\n  static const FT_ServiceDescRec  t42_services[] =\n  {\n    { FT_SERVICE_ID_GLYPH_DICT,           &t42_service_glyph_dict },\n    { FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &t42_service_ps_font_name },\n    { FT_SERVICE_ID_POSTSCRIPT_INFO,      &t42_service_ps_info },\n    { FT_SERVICE_ID_XF86_NAME,            FT_XF86_FORMAT_TYPE_42 },\n    { NULL, NULL }\n  };\n\n\n  FT_CALLBACK_DEF( FT_Module_Interface )\n  T42_Get_Interface( FT_Module         module,\n                     const FT_String*  t42_interface )\n  {\n    FT_UNUSED( module );\n\n    return ft_service_list_lookup( t42_services, t42_interface );\n  }\n\n\n  const FT_Driver_ClassRec  t42_driver_class =\n  {\n    {\n      FT_MODULE_FONT_DRIVER       |\n      FT_MODULE_DRIVER_SCALABLE   |\n#ifdef TT_USE_BYTECODE_INTERPRETER\n      FT_MODULE_DRIVER_HAS_HINTER,\n#else\n      0,\n#endif\n\n      sizeof ( T42_DriverRec ),\n\n      \"type42\",\n      0x10000L,\n      0x20000L,\n\n      0,    /* format interface */\n\n      T42_Driver_Init,\n      T42_Driver_Done,\n      T42_Get_Interface,\n    },\n\n    sizeof ( T42_FaceRec ),\n    sizeof ( T42_SizeRec ),\n    sizeof ( T42_GlyphSlotRec ),\n\n    T42_Face_Init,\n    T42_Face_Done,\n    T42_Size_Init,\n    T42_Size_Done,\n    T42_GlyphSlot_Init,\n    T42_GlyphSlot_Done,\n\n    T42_GlyphSlot_Load,\n\n    0,                 /* FT_Face_GetKerningFunc  */\n    0,                 /* FT_Face_AttachFunc      */\n\n    0,                 /* FT_Face_GetAdvancesFunc */\n    T42_Size_Request,\n    T42_Size_Select\n  };\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type42/t42drivr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t42drivr.h                                                             */\n/*                                                                         */\n/*    High-level Type 42 driver interface (specification).                 */\n/*                                                                         */\n/*  Copyright 2002 by Roberto Alameda.                                     */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T42DRIVR_H__\n#define __T42DRIVR_H__\n\n\n#include <ft2build.h>\n#include FT_INTERNAL_DRIVER_H\n\n\nFT_BEGIN_HEADER\n\n#ifdef FT_CONFIG_OPTION_PIC\n#error \"this module does not support PIC yet\"\n#endif\n\n\n  FT_EXPORT_VAR( const FT_Driver_ClassRec )  t42_driver_class;\n\n\nFT_END_HEADER\n\n\n#endif /* __T42DRIVR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type42/t42error.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t42error.h                                                             */\n/*                                                                         */\n/*    Type 42 error codes (specification only).                            */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2012 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the Type 42 error enumeration constants.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __T42ERROR_H__\n#define __T42ERROR_H__\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  T42_Err_\n#define FT_ERR_BASE    FT_Mod_Err_Type42\n\n#include FT_ERRORS_H\n\n#endif /* __T42ERROR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type42/t42objs.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t42objs.c                                                              */\n/*                                                                         */\n/*    Type 42 objects manager (body).                                      */\n/*                                                                         */\n/*  Copyright 2002-2009, 2011, 2013                                        */\n/*  by Roberto Alameda.                                                    */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"t42objs.h\"\n#include \"t42parse.h\"\n#include \"t42error.h\"\n#include FT_INTERNAL_DEBUG_H\n#include FT_LIST_H\n#include FT_TRUETYPE_IDS_H\n\n\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_t42\n\n\n  static FT_Error\n  T42_Open_Face( T42_Face  face )\n  {\n    T42_LoaderRec  loader;\n    T42_Parser     parser;\n    T1_Font        type1 = &face->type1;\n    FT_Memory      memory = face->root.memory;\n    FT_Error       error;\n\n    PSAux_Service  psaux  = (PSAux_Service)face->psaux;\n\n\n    t42_loader_init( &loader, face );\n\n    parser = &loader.parser;\n\n    if ( FT_ALLOC( face->ttf_data, 12 ) )\n      goto Exit;\n\n    /* while parsing the font we always update `face->ttf_size' so that */\n    /* even in case of buggy data (which might lead to premature end of */\n    /* scanning without causing an error) the call to `FT_Open_Face' in */\n    /* `T42_Face_Init' passes the correct size                          */\n    face->ttf_size = 12;\n\n    error = t42_parser_init( parser,\n                             face->root.stream,\n                             memory,\n                             psaux);\n    if ( error )\n      goto Exit;\n\n    error = t42_parse_dict( face, &loader,\n                            parser->base_dict, parser->base_len );\n    if ( error )\n      goto Exit;\n\n    if ( type1->font_type != 42 )\n    {\n      FT_ERROR(( \"T42_Open_Face: cannot handle FontType %d\\n\",\n                 type1->font_type ));\n      error = FT_THROW( Unknown_File_Format );\n      goto Exit;\n    }\n\n    /* now, propagate the charstrings and glyphnames tables */\n    /* to the Type1 data                                    */\n    type1->num_glyphs = loader.num_glyphs;\n\n    if ( !loader.charstrings.init )\n    {\n      FT_ERROR(( \"T42_Open_Face: no charstrings array in face\\n\" ));\n      error = FT_THROW( Invalid_File_Format );\n    }\n\n    loader.charstrings.init  = 0;\n    type1->charstrings_block = loader.charstrings.block;\n    type1->charstrings       = loader.charstrings.elements;\n    type1->charstrings_len   = loader.charstrings.lengths;\n\n    /* we copy the glyph names `block' and `elements' fields; */\n    /* the `lengths' field must be released later             */\n    type1->glyph_names_block    = loader.glyph_names.block;\n    type1->glyph_names          = (FT_String**)loader.glyph_names.elements;\n    loader.glyph_names.block    = 0;\n    loader.glyph_names.elements = 0;\n\n    /* we must now build type1.encoding when we have a custom array */\n    if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY )\n    {\n      FT_Int    charcode, idx, min_char, max_char;\n      FT_Byte*  glyph_name;\n\n\n      /* OK, we do the following: for each element in the encoding   */\n      /* table, look up the index of the glyph having the same name  */\n      /* as defined in the CharStrings array.                        */\n      /* The index is then stored in type1.encoding.char_index, and  */\n      /* the name in type1.encoding.char_name                        */\n\n      min_char = 0;\n      max_char = 0;\n\n      charcode = 0;\n      for ( ; charcode < loader.encoding_table.max_elems; charcode++ )\n      {\n        FT_Byte*  char_name;\n\n\n        type1->encoding.char_index[charcode] = 0;\n        type1->encoding.char_name [charcode] = (char *)\".notdef\";\n\n        char_name = loader.encoding_table.elements[charcode];\n        if ( char_name )\n          for ( idx = 0; idx < type1->num_glyphs; idx++ )\n          {\n            glyph_name = (FT_Byte*)type1->glyph_names[idx];\n            if ( ft_strcmp( (const char*)char_name,\n                            (const char*)glyph_name ) == 0 )\n            {\n              type1->encoding.char_index[charcode] = (FT_UShort)idx;\n              type1->encoding.char_name [charcode] = (char*)glyph_name;\n\n              /* Change min/max encoded char only if glyph name is */\n              /* not /.notdef                                      */\n              if ( ft_strcmp( (const char*)\".notdef\",\n                              (const char*)glyph_name ) != 0 )\n              {\n                if ( charcode < min_char )\n                  min_char = charcode;\n                if ( charcode >= max_char )\n                  max_char = charcode + 1;\n              }\n              break;\n            }\n          }\n      }\n\n      type1->encoding.code_first = min_char;\n      type1->encoding.code_last  = max_char;\n      type1->encoding.num_chars  = loader.num_chars;\n    }\n\n  Exit:\n    t42_loader_done( &loader );\n    return error;\n  }\n\n\n  /***************** Driver Functions *************/\n\n\n  FT_LOCAL_DEF( FT_Error )\n  T42_Face_Init( FT_Stream      stream,\n                 FT_Face        t42face,       /* T42_Face */\n                 FT_Int         face_index,\n                 FT_Int         num_params,\n                 FT_Parameter*  params )\n  {\n    T42_Face            face  = (T42_Face)t42face;\n    FT_Error            error;\n    FT_Service_PsCMaps  psnames;\n    PSAux_Service       psaux;\n    FT_Face             root  = (FT_Face)&face->root;\n    T1_Font             type1 = &face->type1;\n    PS_FontInfo         info  = &type1->font_info;\n\n    FT_UNUSED( num_params );\n    FT_UNUSED( params );\n    FT_UNUSED( stream );\n\n\n    face->ttf_face       = NULL;\n    face->root.num_faces = 1;\n\n    FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );\n    face->psnames = psnames;\n\n    face->psaux = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ),\n                                           \"psaux\" );\n    psaux = (PSAux_Service)face->psaux;\n    if ( !psaux )\n    {\n      FT_ERROR(( \"T42_Face_Init: cannot access `psaux' module\\n\" ));\n      error = FT_THROW( Missing_Module );\n      goto Exit;\n    }\n\n    FT_TRACE2(( \"Type 42 driver\\n\" ));\n\n    /* open the tokenizer, this will also check the font format */\n    error = T42_Open_Face( face );\n    if ( error )\n      goto Exit;\n\n    /* if we just wanted to check the format, leave successfully now */\n    if ( face_index < 0 )\n      goto Exit;\n\n    /* check the face index */\n    if ( face_index > 0 )\n    {\n      FT_ERROR(( \"T42_Face_Init: invalid face index\\n\" ));\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    /* Now load the font program into the face object */\n\n    /* Init the face object fields */\n    /* Now set up root face fields */\n\n    root->num_glyphs   = type1->num_glyphs;\n    root->num_charmaps = 0;\n    root->face_index   = 0;\n\n    root->face_flags |= FT_FACE_FLAG_SCALABLE    |\n                        FT_FACE_FLAG_HORIZONTAL  |\n                        FT_FACE_FLAG_GLYPH_NAMES;\n\n    if ( info->is_fixed_pitch )\n      root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;\n\n    /* We only set this flag if we have the patented bytecode interpreter. */\n    /* There are no known `tricky' Type42 fonts that could be loaded with  */\n    /* the unpatented interpreter.                                         */\n#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER\n    root->face_flags |= FT_FACE_FLAG_HINTER;\n#endif\n\n    /* XXX: TODO -- add kerning with .afm support */\n\n    /* get style name -- be careful, some broken fonts only */\n    /* have a `/FontName' dictionary entry!                 */\n    root->family_name = info->family_name;\n    /* assume \"Regular\" style if we don't know better */\n    root->style_name = (char *)\"Regular\";\n    if ( root->family_name )\n    {\n      char*  full   = info->full_name;\n      char*  family = root->family_name;\n\n\n      if ( full )\n      {\n        while ( *full )\n        {\n          if ( *full == *family )\n          {\n            family++;\n            full++;\n          }\n          else\n          {\n            if ( *full == ' ' || *full == '-' )\n              full++;\n            else if ( *family == ' ' || *family == '-' )\n              family++;\n            else\n            {\n              if ( !*family )\n                root->style_name = full;\n              break;\n            }\n          }\n        }\n      }\n    }\n    else\n    {\n      /* do we have a `/FontName'? */\n      if ( type1->font_name )\n        root->family_name = type1->font_name;\n    }\n\n    /* no embedded bitmap support */\n    root->num_fixed_sizes = 0;\n    root->available_sizes = 0;\n\n    /* Load the TTF font embedded in the T42 font */\n    {\n      FT_Open_Args  args;\n\n\n      args.flags       = FT_OPEN_MEMORY | FT_OPEN_DRIVER;\n      args.driver      = FT_Get_Module( FT_FACE_LIBRARY( face ),\n                                        \"truetype\" );\n      args.memory_base = face->ttf_data;\n      args.memory_size = face->ttf_size;\n\n      if ( num_params )\n      {\n        args.flags     |= FT_OPEN_PARAMS;\n        args.num_params = num_params;\n        args.params     = params;\n      }\n\n      error = FT_Open_Face( FT_FACE_LIBRARY( face ),\n                            &args, 0, &face->ttf_face );\n    }\n\n    if ( error )\n      goto Exit;\n\n    FT_Done_Size( face->ttf_face->size );\n\n    /* Ignore info in FontInfo dictionary and use the info from the  */\n    /* loaded TTF font.  The PostScript interpreter also ignores it. */\n    root->bbox         = face->ttf_face->bbox;\n    root->units_per_EM = face->ttf_face->units_per_EM;\n\n    root->ascender  = face->ttf_face->ascender;\n    root->descender = face->ttf_face->descender;\n    root->height    = face->ttf_face->height;\n\n    root->max_advance_width  = face->ttf_face->max_advance_width;\n    root->max_advance_height = face->ttf_face->max_advance_height;\n\n    root->underline_position  = (FT_Short)info->underline_position;\n    root->underline_thickness = (FT_Short)info->underline_thickness;\n\n    /* compute style flags */\n    root->style_flags = 0;\n    if ( info->italic_angle )\n      root->style_flags |= FT_STYLE_FLAG_ITALIC;\n\n    if ( face->ttf_face->style_flags & FT_STYLE_FLAG_BOLD )\n      root->style_flags |= FT_STYLE_FLAG_BOLD;\n\n    if ( face->ttf_face->face_flags & FT_FACE_FLAG_VERTICAL )\n      root->face_flags |= FT_FACE_FLAG_VERTICAL;\n\n    {\n      if ( psnames )\n      {\n        FT_CharMapRec    charmap;\n        T1_CMap_Classes  cmap_classes = psaux->t1_cmap_classes;\n        FT_CMap_Class    clazz;\n\n\n        charmap.face = root;\n\n        /* first of all, try to synthesize a Unicode charmap */\n        charmap.platform_id = TT_PLATFORM_MICROSOFT;\n        charmap.encoding_id = TT_MS_ID_UNICODE_CS;\n        charmap.encoding    = FT_ENCODING_UNICODE;\n\n        error = FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL );\n        if ( error                                      &&\n             FT_ERR_NEQ( error, No_Unicode_Glyph_Name ) )\n          goto Exit;\n        error = FT_Err_Ok;\n\n        /* now, generate an Adobe Standard encoding when appropriate */\n        charmap.platform_id = TT_PLATFORM_ADOBE;\n        clazz               = NULL;\n\n        switch ( type1->encoding_type )\n        {\n        case T1_ENCODING_TYPE_STANDARD:\n          charmap.encoding    = FT_ENCODING_ADOBE_STANDARD;\n          charmap.encoding_id = TT_ADOBE_ID_STANDARD;\n          clazz               = cmap_classes->standard;\n          break;\n\n        case T1_ENCODING_TYPE_EXPERT:\n          charmap.encoding    = FT_ENCODING_ADOBE_EXPERT;\n          charmap.encoding_id = TT_ADOBE_ID_EXPERT;\n          clazz               = cmap_classes->expert;\n          break;\n\n        case T1_ENCODING_TYPE_ARRAY:\n          charmap.encoding    = FT_ENCODING_ADOBE_CUSTOM;\n          charmap.encoding_id = TT_ADOBE_ID_CUSTOM;\n          clazz               = cmap_classes->custom;\n          break;\n\n        case T1_ENCODING_TYPE_ISOLATIN1:\n          charmap.encoding    = FT_ENCODING_ADOBE_LATIN_1;\n          charmap.encoding_id = TT_ADOBE_ID_LATIN_1;\n          clazz               = cmap_classes->unicode;\n          break;\n\n        default:\n          ;\n        }\n\n        if ( clazz )\n          error = FT_CMap_New( clazz, NULL, &charmap, NULL );\n\n#if 0\n        /* Select default charmap */\n        if ( root->num_charmaps )\n          root->charmap = root->charmaps[0];\n#endif\n      }\n    }\n  Exit:\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  T42_Face_Done( FT_Face  t42face )\n  {\n    T42_Face     face = (T42_Face)t42face;\n    T1_Font      type1;\n    PS_FontInfo  info;\n    FT_Memory    memory;\n\n\n    if ( !face )\n      return;\n\n    type1  = &face->type1;\n    info   = &type1->font_info;\n    memory = face->root.memory;\n\n    /* delete internal ttf face prior to freeing face->ttf_data */\n    if ( face->ttf_face )\n      FT_Done_Face( face->ttf_face );\n\n    /* release font info strings */\n    FT_FREE( info->version );\n    FT_FREE( info->notice );\n    FT_FREE( info->full_name );\n    FT_FREE( info->family_name );\n    FT_FREE( info->weight );\n\n    /* release top dictionary */\n    FT_FREE( type1->charstrings_len );\n    FT_FREE( type1->charstrings );\n    FT_FREE( type1->glyph_names );\n\n    FT_FREE( type1->charstrings_block );\n    FT_FREE( type1->glyph_names_block );\n\n    FT_FREE( type1->encoding.char_index );\n    FT_FREE( type1->encoding.char_name );\n    FT_FREE( type1->font_name );\n\n    FT_FREE( face->ttf_data );\n\n#if 0\n    /* release afm data if present */\n    if ( face->afm_data )\n      T1_Done_AFM( memory, (T1_AFM*)face->afm_data );\n#endif\n\n    /* release unicode map, if any */\n    FT_FREE( face->unicode_map.maps );\n    face->unicode_map.num_maps = 0;\n\n    face->root.family_name = 0;\n    face->root.style_name  = 0;\n  }\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    T42_Driver_Init                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initializes a given Type 42 driver object.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    driver :: A handle to the target driver object.                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_LOCAL_DEF( FT_Error )\n  T42_Driver_Init( FT_Module  module )        /* T42_Driver */\n  {\n    T42_Driver  driver = (T42_Driver)module;\n    FT_Module   ttmodule;\n\n\n    ttmodule = FT_Get_Module( module->library, \"truetype\" );\n    if ( !ttmodule )\n    {\n      FT_ERROR(( \"T42_Driver_Init: cannot access `truetype' module\\n\" ));\n      return FT_THROW( Missing_Module );\n    }\n\n    driver->ttclazz = (FT_Driver_Class)ttmodule->clazz;\n\n    return FT_Err_Ok;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  T42_Driver_Done( FT_Module  module )\n  {\n    FT_UNUSED( module );\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  T42_Size_Init( FT_Size  size )         /* T42_Size */\n  {\n    T42_Size  t42size = (T42_Size)size;\n    FT_Face   face    = size->face;\n    T42_Face  t42face = (T42_Face)face;\n    FT_Size   ttsize;\n    FT_Error  error;\n\n\n    error = FT_New_Size( t42face->ttf_face, &ttsize );\n    t42size->ttsize = ttsize;\n\n    FT_Activate_Size( ttsize );\n\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  T42_Size_Request( FT_Size          t42size,      /* T42_Size */\n                    FT_Size_Request  req )\n  {\n    T42_Size  size = (T42_Size)t42size;\n    T42_Face  face = (T42_Face)t42size->face;\n    FT_Error  error;\n\n\n    FT_Activate_Size( size->ttsize );\n\n    error = FT_Request_Size( face->ttf_face, req );\n    if ( !error )\n      t42size->metrics = face->ttf_face->size->metrics;\n\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  T42_Size_Select( FT_Size   t42size,         /* T42_Size */\n                   FT_ULong  strike_index )\n  {\n    T42_Size  size = (T42_Size)t42size;\n    T42_Face  face = (T42_Face)t42size->face;\n    FT_Error  error;\n\n\n    FT_Activate_Size( size->ttsize );\n\n    error = FT_Select_Size( face->ttf_face, (FT_Int)strike_index );\n    if ( !error )\n      t42size->metrics = face->ttf_face->size->metrics;\n\n    return error;\n\n  }\n\n\n  FT_LOCAL_DEF( void )\n  T42_Size_Done( FT_Size  t42size )             /* T42_Size */\n  {\n    T42_Size     size    = (T42_Size)t42size;\n    FT_Face      face    = t42size->face;\n    T42_Face     t42face = (T42_Face)face;\n    FT_ListNode  node;\n\n\n    node = FT_List_Find( &t42face->ttf_face->sizes_list, size->ttsize );\n    if ( node )\n    {\n      FT_Done_Size( size->ttsize );\n      size->ttsize = NULL;\n    }\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  T42_GlyphSlot_Init( FT_GlyphSlot  t42slot )        /* T42_GlyphSlot */\n  {\n    T42_GlyphSlot  slot    = (T42_GlyphSlot)t42slot;\n    FT_Face        face    = t42slot->face;\n    T42_Face       t42face = (T42_Face)face;\n    FT_GlyphSlot   ttslot;\n    FT_Error       error   = FT_Err_Ok;\n\n\n    if ( face->glyph == NULL )\n    {\n      /* First glyph slot for this face */\n      slot->ttslot = t42face->ttf_face->glyph;\n    }\n    else\n    {\n      error = FT_New_GlyphSlot( t42face->ttf_face, &ttslot );\n      slot->ttslot = ttslot;\n    }\n\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  T42_GlyphSlot_Done( FT_GlyphSlot  t42slot )       /* T42_GlyphSlot */\n  {\n    T42_GlyphSlot  slot = (T42_GlyphSlot)t42slot;\n\n\n    FT_Done_GlyphSlot( slot->ttslot );\n  }\n\n\n  static void\n  t42_glyphslot_clear( FT_GlyphSlot  slot )\n  {\n    /* free bitmap if needed */\n    ft_glyphslot_free_bitmap( slot );\n\n    /* clear all public fields in the glyph slot */\n    FT_ZERO( &slot->metrics );\n    FT_ZERO( &slot->outline );\n    FT_ZERO( &slot->bitmap );\n\n    slot->bitmap_left   = 0;\n    slot->bitmap_top    = 0;\n    slot->num_subglyphs = 0;\n    slot->subglyphs     = 0;\n    slot->control_data  = 0;\n    slot->control_len   = 0;\n    slot->other         = 0;\n    slot->format        = FT_GLYPH_FORMAT_NONE;\n\n    slot->linearHoriAdvance = 0;\n    slot->linearVertAdvance = 0;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  T42_GlyphSlot_Load( FT_GlyphSlot  glyph,\n                      FT_Size       size,\n                      FT_UInt       glyph_index,\n                      FT_Int32      load_flags )\n  {\n    FT_Error         error;\n    T42_GlyphSlot    t42slot = (T42_GlyphSlot)glyph;\n    T42_Size         t42size = (T42_Size)size;\n    FT_Driver_Class  ttclazz = ((T42_Driver)glyph->face->driver)->ttclazz;\n\n\n    FT_TRACE1(( \"T42_GlyphSlot_Load: glyph index %d\\n\", glyph_index ));\n\n    t42_glyphslot_clear( t42slot->ttslot );\n    error = ttclazz->load_glyph( t42slot->ttslot,\n                                 t42size->ttsize,\n                                 glyph_index,\n                                 load_flags | FT_LOAD_NO_BITMAP );\n\n    if ( !error )\n    {\n      glyph->metrics = t42slot->ttslot->metrics;\n\n      glyph->linearHoriAdvance = t42slot->ttslot->linearHoriAdvance;\n      glyph->linearVertAdvance = t42slot->ttslot->linearVertAdvance;\n\n      glyph->format  = t42slot->ttslot->format;\n      glyph->outline = t42slot->ttslot->outline;\n\n      glyph->bitmap      = t42slot->ttslot->bitmap;\n      glyph->bitmap_left = t42slot->ttslot->bitmap_left;\n      glyph->bitmap_top  = t42slot->ttslot->bitmap_top;\n\n      glyph->num_subglyphs = t42slot->ttslot->num_subglyphs;\n      glyph->subglyphs     = t42slot->ttslot->subglyphs;\n\n      glyph->control_data  = t42slot->ttslot->control_data;\n      glyph->control_len   = t42slot->ttslot->control_len;\n    }\n\n    return error;\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type42/t42objs.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t42objs.h                                                              */\n/*                                                                         */\n/*    Type 42 objects manager (specification).                             */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2006, 2007, 2011 by Roberto Alameda.             */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T42OBJS_H__\n#define __T42OBJS_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_TYPE1_TABLES_H\n#include FT_INTERNAL_TYPE1_TYPES_H\n#include \"t42types.h\"\n#include FT_INTERNAL_OBJECTS_H\n#include FT_INTERNAL_DRIVER_H\n#include FT_SERVICE_POSTSCRIPT_CMAPS_H\n#include FT_INTERNAL_POSTSCRIPT_HINTS_H\n\n\nFT_BEGIN_HEADER\n\n\n  /* Type42 size */\n  typedef struct  T42_SizeRec_\n  {\n    FT_SizeRec  root;\n    FT_Size     ttsize;\n\n  } T42_SizeRec, *T42_Size;\n\n\n  /* Type42 slot */\n  typedef struct  T42_GlyphSlotRec_\n  {\n    FT_GlyphSlotRec  root;\n    FT_GlyphSlot     ttslot;\n\n  } T42_GlyphSlotRec, *T42_GlyphSlot;\n\n\n  /* Type 42 driver */\n  typedef struct  T42_DriverRec_\n  {\n    FT_DriverRec     root;\n    FT_Driver_Class  ttclazz;\n    void*            extension_component;\n\n  } T42_DriverRec, *T42_Driver;\n\n\n  /* */\n\n\n  FT_LOCAL( FT_Error )\n  T42_Face_Init( FT_Stream      stream,\n                 FT_Face        face,\n                 FT_Int         face_index,\n                 FT_Int         num_params,\n                 FT_Parameter*  params );\n\n\n  FT_LOCAL( void )\n  T42_Face_Done( FT_Face  face );\n\n\n  FT_LOCAL( FT_Error )\n  T42_Size_Init( FT_Size  size );\n\n\n  FT_LOCAL( FT_Error )\n  T42_Size_Request( FT_Size          size,\n                    FT_Size_Request  req );\n\n\n  FT_LOCAL( FT_Error )\n  T42_Size_Select( FT_Size   size,\n                   FT_ULong  strike_index );\n\n\n  FT_LOCAL( void )\n  T42_Size_Done( FT_Size  size );\n\n\n  FT_LOCAL( FT_Error )\n  T42_GlyphSlot_Init( FT_GlyphSlot  slot );\n\n\n  FT_LOCAL( FT_Error )\n  T42_GlyphSlot_Load( FT_GlyphSlot  glyph,\n                      FT_Size       size,\n                      FT_UInt       glyph_index,\n                      FT_Int32      load_flags );\n\n  FT_LOCAL( void )\n  T42_GlyphSlot_Done( FT_GlyphSlot  slot );\n\n\n  FT_LOCAL( FT_Error )\n  T42_Driver_Init( FT_Module  module );\n\n  FT_LOCAL( void )\n  T42_Driver_Done( FT_Module  module );\n\n /* */\n\nFT_END_HEADER\n\n\n#endif /* __T42OBJS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type42/t42parse.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t42parse.c                                                             */\n/*                                                                         */\n/*    Type 42 font parser (body).                                          */\n/*                                                                         */\n/*  Copyright 2002-2014 by                                                 */\n/*  Roberto Alameda.                                                       */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include \"t42parse.h\"\n#include \"t42error.h\"\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_POSTSCRIPT_AUX_H\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_t42\n\n\n  static void\n  t42_parse_font_matrix( T42_Face    face,\n                         T42_Loader  loader );\n  static void\n  t42_parse_encoding( T42_Face    face,\n                      T42_Loader  loader );\n\n  static void\n  t42_parse_charstrings( T42_Face    face,\n                         T42_Loader  loader );\n\n  static void\n  t42_parse_sfnts( T42_Face    face,\n                   T42_Loader  loader );\n\n\n  /* as Type42 fonts have no Private dict,         */\n  /* we set the last argument of T1_FIELD_XXX to 0 */\n  static const\n  T1_FieldRec  t42_keywords[] =\n  {\n\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  T1_FontInfo\n#undef  T1CODE\n#define T1CODE        T1_FIELD_LOCATION_FONT_INFO\n\n    T1_FIELD_STRING( \"version\",            version,             0 )\n    T1_FIELD_STRING( \"Notice\",             notice,              0 )\n    T1_FIELD_STRING( \"FullName\",           full_name,           0 )\n    T1_FIELD_STRING( \"FamilyName\",         family_name,         0 )\n    T1_FIELD_STRING( \"Weight\",             weight,              0 )\n    T1_FIELD_NUM   ( \"ItalicAngle\",        italic_angle,        0 )\n    T1_FIELD_BOOL  ( \"isFixedPitch\",       is_fixed_pitch,      0 )\n    T1_FIELD_NUM   ( \"UnderlinePosition\",  underline_position,  0 )\n    T1_FIELD_NUM   ( \"UnderlineThickness\", underline_thickness, 0 )\n\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  PS_FontExtraRec\n#undef  T1CODE\n#define T1CODE        T1_FIELD_LOCATION_FONT_EXTRA\n\n    T1_FIELD_NUM   ( \"FSType\",             fs_type,             0 )\n\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  T1_FontRec\n#undef  T1CODE\n#define T1CODE        T1_FIELD_LOCATION_FONT_DICT\n\n    T1_FIELD_KEY  ( \"FontName\",    font_name,    0 )\n    T1_FIELD_NUM  ( \"PaintType\",   paint_type,   0 )\n    T1_FIELD_NUM  ( \"FontType\",    font_type,    0 )\n    T1_FIELD_FIXED( \"StrokeWidth\", stroke_width, 0 )\n\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  FT_BBox\n#undef  T1CODE\n#define T1CODE        T1_FIELD_LOCATION_BBOX\n\n    T1_FIELD_BBOX(\"FontBBox\", xMin, 0 )\n\n    T1_FIELD_CALLBACK( \"FontMatrix\",  t42_parse_font_matrix, 0 )\n    T1_FIELD_CALLBACK( \"Encoding\",    t42_parse_encoding,    0 )\n    T1_FIELD_CALLBACK( \"CharStrings\", t42_parse_charstrings, 0 )\n    T1_FIELD_CALLBACK( \"sfnts\",       t42_parse_sfnts,       0 )\n\n    { 0, T1_FIELD_LOCATION_CID_INFO, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0, 0 }\n  };\n\n\n#define T1_Add_Table( p, i, o, l )  (p)->funcs.add( (p), i, o, l )\n#define T1_Done_Table( p )          \\\n          do                        \\\n          {                         \\\n            if ( (p)->funcs.done )  \\\n              (p)->funcs.done( p ); \\\n          } while ( 0 )\n#define T1_Release_Table( p )          \\\n          do                           \\\n          {                            \\\n            if ( (p)->funcs.release )  \\\n              (p)->funcs.release( p ); \\\n          } while ( 0 )\n\n#define T1_Skip_Spaces( p )    (p)->root.funcs.skip_spaces( &(p)->root )\n#define T1_Skip_PS_Token( p )  (p)->root.funcs.skip_PS_token( &(p)->root )\n\n#define T1_ToInt( p )                          \\\n          (p)->root.funcs.to_int( &(p)->root )\n#define T1_ToBytes( p, b, m, n, d )                          \\\n          (p)->root.funcs.to_bytes( &(p)->root, b, m, n, d )\n\n#define T1_ToFixedArray( p, m, f, t )                           \\\n          (p)->root.funcs.to_fixed_array( &(p)->root, m, f, t )\n#define T1_ToToken( p, t )                          \\\n          (p)->root.funcs.to_token( &(p)->root, t )\n\n#define T1_Load_Field( p, f, o, m, pf )                         \\\n          (p)->root.funcs.load_field( &(p)->root, f, o, m, pf )\n#define T1_Load_Field_Table( p, f, o, m, pf )                         \\\n          (p)->root.funcs.load_field_table( &(p)->root, f, o, m, pf )\n\n\n  /********************* Parsing Functions ******************/\n\n  FT_LOCAL_DEF( FT_Error )\n  t42_parser_init( T42_Parser     parser,\n                   FT_Stream      stream,\n                   FT_Memory      memory,\n                   PSAux_Service  psaux )\n  {\n    FT_Error  error = FT_Err_Ok;\n    FT_Long   size;\n\n\n    psaux->ps_parser_funcs->init( &parser->root, 0, 0, memory );\n\n    parser->stream    = stream;\n    parser->base_len  = 0;\n    parser->base_dict = 0;\n    parser->in_memory = 0;\n\n    /*******************************************************************/\n    /*                                                                 */\n    /* Here a short summary of what is going on:                       */\n    /*                                                                 */\n    /*   When creating a new Type 42 parser, we try to locate and load */\n    /*   the base dictionary, loading the whole font into memory.      */\n    /*                                                                 */\n    /*   When `loading' the base dictionary, we only set up pointers   */\n    /*   in the case of a memory-based stream.  Otherwise, we allocate */\n    /*   and load the base dictionary in it.                           */\n    /*                                                                 */\n    /*   parser->in_memory is set if we have a memory stream.          */\n    /*                                                                 */\n\n    if ( FT_STREAM_SEEK( 0L ) ||\n         FT_FRAME_ENTER( 17 ) )\n      goto Exit;\n\n    if ( ft_memcmp( stream->cursor, \"%!PS-TrueTypeFont\", 17 ) != 0 )\n    {\n      FT_TRACE2(( \"  not a Type42 font\\n\" ));\n      error = FT_THROW( Unknown_File_Format );\n    }\n\n    FT_FRAME_EXIT();\n\n    if ( error || FT_STREAM_SEEK( 0 ) )\n      goto Exit;\n\n    size = stream->size;\n\n    /* now, try to load `size' bytes of the `base' dictionary we */\n    /* found previously                                          */\n\n    /* if it is a memory-based resource, set up pointers */\n    if ( !stream->read )\n    {\n      parser->base_dict = (FT_Byte*)stream->base + stream->pos;\n      parser->base_len  = size;\n      parser->in_memory = 1;\n\n      /* check that the `size' field is valid */\n      if ( FT_STREAM_SKIP( size ) )\n        goto Exit;\n    }\n    else\n    {\n      /* read segment in memory */\n      if ( FT_ALLOC( parser->base_dict, size )       ||\n           FT_STREAM_READ( parser->base_dict, size ) )\n        goto Exit;\n\n      parser->base_len = size;\n    }\n\n    parser->root.base   = parser->base_dict;\n    parser->root.cursor = parser->base_dict;\n    parser->root.limit  = parser->root.cursor + parser->base_len;\n\n  Exit:\n    if ( error && !parser->in_memory )\n      FT_FREE( parser->base_dict );\n\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  t42_parser_done( T42_Parser  parser )\n  {\n    FT_Memory  memory = parser->root.memory;\n\n\n    /* free the base dictionary only when we have a disk stream */\n    if ( !parser->in_memory )\n      FT_FREE( parser->base_dict );\n\n    parser->root.funcs.done( &parser->root );\n  }\n\n\n  static int\n  t42_is_space( FT_Byte  c )\n  {\n    return ( c == ' '  || c == '\\t'              ||\n             c == '\\r' || c == '\\n' || c == '\\f' ||\n             c == '\\0'                           );\n  }\n\n\n  static void\n  t42_parse_font_matrix( T42_Face    face,\n                         T42_Loader  loader )\n  {\n    T42_Parser  parser = &loader->parser;\n    FT_Matrix*  matrix = &face->type1.font_matrix;\n    FT_Vector*  offset = &face->type1.font_offset;\n    FT_Face     root   = (FT_Face)&face->root;\n    FT_Fixed    temp[6];\n    FT_Fixed    temp_scale;\n    FT_Int      result;\n\n\n    result = T1_ToFixedArray( parser, 6, temp, 3 );\n\n    if ( result < 6 )\n    {\n      parser->root.error = FT_THROW( Invalid_File_Format );\n      return;\n    }\n\n    temp_scale = FT_ABS( temp[3] );\n\n    if ( temp_scale == 0 )\n    {\n      FT_ERROR(( \"t1_parse_font_matrix: invalid font matrix\\n\" ));\n      parser->root.error = FT_THROW( Invalid_File_Format );\n      return;\n    }\n\n    /* Set Units per EM based on FontMatrix values.  We set the value to */\n    /* 1000 / temp_scale, because temp_scale was already multiplied by   */\n    /* 1000 (in t1_tofixed, from psobjs.c).                              */\n\n    root->units_per_EM = (FT_UShort)FT_DivFix( 1000, temp_scale );\n\n    /* we need to scale the values by 1.0/temp_scale */\n    if ( temp_scale != 0x10000L )\n    {\n      temp[0] = FT_DivFix( temp[0], temp_scale );\n      temp[1] = FT_DivFix( temp[1], temp_scale );\n      temp[2] = FT_DivFix( temp[2], temp_scale );\n      temp[4] = FT_DivFix( temp[4], temp_scale );\n      temp[5] = FT_DivFix( temp[5], temp_scale );\n      temp[3] = temp[3] < 0 ? -0x10000L : 0x10000L;\n    }\n\n    matrix->xx = temp[0];\n    matrix->yx = temp[1];\n    matrix->xy = temp[2];\n    matrix->yy = temp[3];\n\n    /* note that the offsets must be expressed in integer font units */\n    offset->x = temp[4] >> 16;\n    offset->y = temp[5] >> 16;\n  }\n\n\n  static void\n  t42_parse_encoding( T42_Face    face,\n                      T42_Loader  loader )\n  {\n    T42_Parser  parser = &loader->parser;\n    FT_Byte*    cur;\n    FT_Byte*    limit  = parser->root.limit;\n\n    PSAux_Service  psaux  = (PSAux_Service)face->psaux;\n\n\n    T1_Skip_Spaces( parser );\n    cur = parser->root.cursor;\n    if ( cur >= limit )\n    {\n      FT_ERROR(( \"t42_parse_encoding: out of bounds\\n\" ));\n      parser->root.error = FT_THROW( Invalid_File_Format );\n      return;\n    }\n\n    /* if we have a number or `[', the encoding is an array, */\n    /* and we must load it now                               */\n    if ( ft_isdigit( *cur ) || *cur == '[' )\n    {\n      T1_Encoding  encode          = &face->type1.encoding;\n      FT_Int       count, n;\n      PS_Table     char_table      = &loader->encoding_table;\n      FT_Memory    memory          = parser->root.memory;\n      FT_Error     error;\n      FT_Bool      only_immediates = 0;\n\n\n      /* read the number of entries in the encoding; should be 256 */\n      if ( *cur == '[' )\n      {\n        count           = 256;\n        only_immediates = 1;\n        parser->root.cursor++;\n      }\n      else\n        count = (FT_Int)T1_ToInt( parser );\n\n      T1_Skip_Spaces( parser );\n      if ( parser->root.cursor >= limit )\n        return;\n\n      /* we use a T1_Table to store our charnames */\n      loader->num_chars = encode->num_chars = count;\n      if ( FT_NEW_ARRAY( encode->char_index, count )     ||\n           FT_NEW_ARRAY( encode->char_name,  count )     ||\n           FT_SET_ERROR( psaux->ps_table_funcs->init(\n                           char_table, count, memory ) ) )\n      {\n        parser->root.error = error;\n        return;\n      }\n\n      /* We need to `zero' out encoding_table.elements */\n      for ( n = 0; n < count; n++ )\n      {\n        char*  notdef = (char *)\".notdef\";\n\n\n        (void)T1_Add_Table( char_table, n, notdef, 8 );\n      }\n\n      /* Now we need to read records of the form                */\n      /*                                                        */\n      /*   ... charcode /charname ...                           */\n      /*                                                        */\n      /* for each entry in our table.                           */\n      /*                                                        */\n      /* We simply look for a number followed by an immediate   */\n      /* name.  Note that this ignores correctly the sequence   */\n      /* that is often seen in type42 fonts:                    */\n      /*                                                        */\n      /*   0 1 255 { 1 index exch /.notdef put } for dup        */\n      /*                                                        */\n      /* used to clean the encoding array before anything else. */\n      /*                                                        */\n      /* Alternatively, if the array is directly given as       */\n      /*                                                        */\n      /*   /Encoding [ ... ]                                    */\n      /*                                                        */\n      /* we only read immediates.                               */\n\n      n = 0;\n      T1_Skip_Spaces( parser );\n\n      while ( parser->root.cursor < limit )\n      {\n        cur = parser->root.cursor;\n\n        /* we stop when we encounter `def' or `]' */\n        if ( *cur == 'd' && cur + 3 < limit )\n        {\n          if ( cur[1] == 'e'          &&\n               cur[2] == 'f'          &&\n               t42_is_space( cur[3] ) )\n          {\n            FT_TRACE6(( \"encoding end\\n\" ));\n            cur += 3;\n            break;\n          }\n        }\n        if ( *cur == ']' )\n        {\n          FT_TRACE6(( \"encoding end\\n\" ));\n          cur++;\n          break;\n        }\n\n        /* check whether we have found an entry */\n        if ( ft_isdigit( *cur ) || only_immediates )\n        {\n          FT_Int  charcode;\n\n\n          if ( only_immediates )\n            charcode = n;\n          else\n          {\n            charcode = (FT_Int)T1_ToInt( parser );\n            T1_Skip_Spaces( parser );\n          }\n\n          cur = parser->root.cursor;\n\n          if ( cur + 2 < limit && *cur == '/' && n < count )\n          {\n            FT_PtrDist  len;\n\n\n            cur++;\n\n            parser->root.cursor = cur;\n            T1_Skip_PS_Token( parser );\n            if ( parser->root.cursor >= limit )\n              return;\n            if ( parser->root.error )\n              return;\n\n            len = parser->root.cursor - cur;\n\n            parser->root.error = T1_Add_Table( char_table, charcode,\n                                               cur, len + 1 );\n            if ( parser->root.error )\n              return;\n            char_table->elements[charcode][len] = '\\0';\n\n            n++;\n          }\n          else if ( only_immediates )\n          {\n            /* Since the current position is not updated for           */\n            /* immediates-only mode we would get an infinite loop if   */\n            /* we don't do anything here.                              */\n            /*                                                         */\n            /* This encoding array is not valid according to the type1 */\n            /* specification (it might be an encoding for a CID type1  */\n            /* font, however), so we conclude that this font is NOT a  */\n            /* type1 font.                                             */\n            parser->root.error = FT_THROW( Unknown_File_Format );\n            return;\n          }\n        }\n        else\n        {\n          T1_Skip_PS_Token( parser );\n          if ( parser->root.error )\n            return;\n        }\n\n        T1_Skip_Spaces( parser );\n      }\n\n      face->type1.encoding_type = T1_ENCODING_TYPE_ARRAY;\n      parser->root.cursor       = cur;\n    }\n\n    /* Otherwise, we should have either `StandardEncoding', */\n    /* `ExpertEncoding', or `ISOLatin1Encoding'             */\n    else\n    {\n      if ( cur + 17 < limit                                            &&\n           ft_strncmp( (const char*)cur, \"StandardEncoding\", 16 ) == 0 )\n        face->type1.encoding_type = T1_ENCODING_TYPE_STANDARD;\n\n      else if ( cur + 15 < limit                                          &&\n                ft_strncmp( (const char*)cur, \"ExpertEncoding\", 14 ) == 0 )\n        face->type1.encoding_type = T1_ENCODING_TYPE_EXPERT;\n\n      else if ( cur + 18 < limit                                             &&\n                ft_strncmp( (const char*)cur, \"ISOLatin1Encoding\", 17 ) == 0 )\n        face->type1.encoding_type = T1_ENCODING_TYPE_ISOLATIN1;\n\n      else\n        parser->root.error = FT_THROW( Ignore );\n    }\n  }\n\n\n  typedef enum  T42_Load_Status_\n  {\n    BEFORE_START,\n    BEFORE_TABLE_DIR,\n    OTHER_TABLES\n\n  } T42_Load_Status;\n\n\n  static void\n  t42_parse_sfnts( T42_Face    face,\n                   T42_Loader  loader )\n  {\n    T42_Parser  parser = &loader->parser;\n    FT_Memory   memory = parser->root.memory;\n    FT_Byte*    cur;\n    FT_Byte*    limit  = parser->root.limit;\n    FT_Error    error;\n    FT_Int      num_tables = 0;\n    FT_ULong    count;\n\n    FT_Long     n, string_size, old_string_size, real_size;\n    FT_Byte*    string_buf = NULL;\n    FT_Bool     allocated  = 0;\n\n    T42_Load_Status  status;\n\n\n    /* The format is                                */\n    /*                                              */\n    /*   /sfnts [ <hexstring> <hexstring> ... ] def */\n    /*                                              */\n    /* or                                           */\n    /*                                              */\n    /*   /sfnts [                                   */\n    /*      <num_bin_bytes> RD <binary data>        */\n    /*      <num_bin_bytes> RD <binary data>        */\n    /*      ...                                     */\n    /*   ] def                                      */\n    /*                                              */\n    /* with exactly one space after the `RD' token. */\n\n    T1_Skip_Spaces( parser );\n\n    if ( parser->root.cursor >= limit || *parser->root.cursor++ != '[' )\n    {\n      FT_ERROR(( \"t42_parse_sfnts: can't find begin of sfnts vector\\n\" ));\n      error = FT_THROW( Invalid_File_Format );\n      goto Fail;\n    }\n\n    T1_Skip_Spaces( parser );\n    status          = BEFORE_START;\n    string_size     = 0;\n    old_string_size = 0;\n    count           = 0;\n\n    while ( parser->root.cursor < limit )\n    {\n      cur = parser->root.cursor;\n\n      if ( *cur == ']' )\n      {\n        parser->root.cursor++;\n        goto Exit;\n      }\n\n      else if ( *cur == '<' )\n      {\n        T1_Skip_PS_Token( parser );\n        if ( parser->root.error )\n          goto Exit;\n\n        /* don't include delimiters */\n        string_size = (FT_Long)( ( parser->root.cursor - cur - 2 + 1 ) / 2 );\n        if ( !string_size )\n        {\n          FT_ERROR(( \"t42_parse_sfnts: invalid data in sfnts array\\n\" ));\n          error = FT_THROW( Invalid_File_Format );\n          goto Fail;\n        }\n        if ( FT_REALLOC( string_buf, old_string_size, string_size ) )\n          goto Fail;\n\n        allocated = 1;\n\n        parser->root.cursor = cur;\n        (void)T1_ToBytes( parser, string_buf, string_size, &real_size, 1 );\n        old_string_size = string_size;\n        string_size = real_size;\n      }\n\n      else if ( ft_isdigit( *cur ) )\n      {\n        if ( allocated )\n        {\n          FT_ERROR(( \"t42_parse_sfnts: \"\n                     \"can't handle mixed binary and hex strings\\n\" ));\n          error = FT_THROW( Invalid_File_Format );\n          goto Fail;\n        }\n\n        string_size = T1_ToInt( parser );\n        if ( string_size < 0 )\n        {\n          FT_ERROR(( \"t42_parse_sfnts: invalid string size\\n\" ));\n          error = FT_THROW( Invalid_File_Format );\n          goto Fail;\n        }\n\n        T1_Skip_PS_Token( parser );             /* `RD' */\n        if ( parser->root.error )\n          return;\n\n        string_buf = parser->root.cursor + 1;   /* one space after `RD' */\n\n        if ( limit - parser->root.cursor < string_size )\n        {\n          FT_ERROR(( \"t42_parse_sfnts: too much binary data\\n\" ));\n          error = FT_THROW( Invalid_File_Format );\n          goto Fail;\n        }\n        else\n          parser->root.cursor += string_size + 1;\n      }\n\n      if ( !string_buf )\n      {\n        FT_ERROR(( \"t42_parse_sfnts: invalid data in sfnts array\\n\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Fail;\n      }\n\n      /* A string can have a trailing zero (odd) byte for padding. */\n      /* Ignore it.                                                */\n      if ( ( string_size & 1 ) && string_buf[string_size - 1] == 0 )\n        string_size--;\n\n      if ( !string_size )\n      {\n        FT_ERROR(( \"t42_parse_sfnts: invalid string\\n\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Fail;\n      }\n\n      for ( n = 0; n < string_size; n++ )\n      {\n        switch ( status )\n        {\n        case BEFORE_START:\n          /* load offset table, 12 bytes */\n          if ( count < 12 )\n          {\n            face->ttf_data[count++] = string_buf[n];\n            continue;\n          }\n          else\n          {\n            num_tables     = 16 * face->ttf_data[4] + face->ttf_data[5];\n            status         = BEFORE_TABLE_DIR;\n            face->ttf_size = 12 + 16 * num_tables;\n\n            if ( (FT_ULong)( limit - parser->root.cursor ) < face->ttf_size )\n            {\n              FT_ERROR(( \"t42_parse_sfnts: invalid data in sfnts array\\n\" ));\n              error = FT_THROW( Invalid_File_Format );\n              goto Fail;\n            }\n\n            if ( FT_REALLOC( face->ttf_data, 12, face->ttf_size ) )\n              goto Fail;\n          }\n          /* fall through */\n\n        case BEFORE_TABLE_DIR:\n          /* the offset table is read; read the table directory */\n          if ( count < face->ttf_size )\n          {\n            face->ttf_data[count++] = string_buf[n];\n            continue;\n          }\n          else\n          {\n            int       i;\n            FT_ULong  len;\n\n\n            for ( i = 0; i < num_tables; i++ )\n            {\n              FT_Byte*  p = face->ttf_data + 12 + 16 * i + 12;\n\n\n              len = FT_PEEK_ULONG( p );\n\n              /* Pad to a 4-byte boundary length */\n              face->ttf_size += ( len + 3 ) & ~3;\n            }\n\n            status = OTHER_TABLES;\n\n            /* there are no more than 256 tables, so no size check here */\n            if ( FT_REALLOC( face->ttf_data, 12 + 16 * num_tables,\n                             face->ttf_size + 1 ) )\n              goto Fail;\n          }\n          /* fall through */\n\n        case OTHER_TABLES:\n          /* all other tables are just copied */\n          if ( count >= face->ttf_size )\n          {\n            FT_ERROR(( \"t42_parse_sfnts: too much binary data\\n\" ));\n            error = FT_THROW( Invalid_File_Format );\n            goto Fail;\n          }\n          face->ttf_data[count++] = string_buf[n];\n        }\n      }\n\n      T1_Skip_Spaces( parser );\n    }\n\n    /* if control reaches this point, the format was not valid */\n    error = FT_THROW( Invalid_File_Format );\n\n  Fail:\n    parser->root.error = error;\n\n  Exit:\n    if ( allocated )\n      FT_FREE( string_buf );\n  }\n\n\n  static void\n  t42_parse_charstrings( T42_Face    face,\n                         T42_Loader  loader )\n  {\n    T42_Parser     parser       = &loader->parser;\n    PS_Table       code_table   = &loader->charstrings;\n    PS_Table       name_table   = &loader->glyph_names;\n    PS_Table       swap_table   = &loader->swap_table;\n    FT_Memory      memory       = parser->root.memory;\n    FT_Error       error;\n\n    PSAux_Service  psaux        = (PSAux_Service)face->psaux;\n\n    FT_Byte*       cur;\n    FT_Byte*       limit        = parser->root.limit;\n    FT_UInt        n;\n    FT_UInt        notdef_index = 0;\n    FT_Byte        notdef_found = 0;\n\n\n    T1_Skip_Spaces( parser );\n\n    if ( parser->root.cursor >= limit )\n    {\n      FT_ERROR(( \"t42_parse_charstrings: out of bounds\\n\" ));\n      error = FT_THROW( Invalid_File_Format );\n      goto Fail;\n    }\n\n    if ( ft_isdigit( *parser->root.cursor ) )\n    {\n      loader->num_glyphs = (FT_UInt)T1_ToInt( parser );\n      if ( parser->root.error )\n        return;\n    }\n    else if ( *parser->root.cursor == '<' )\n    {\n      /* We have `<< ... >>'.  Count the number of `/' in the dictionary */\n      /* to get its size.                                                */\n      FT_UInt  count = 0;\n\n\n      T1_Skip_PS_Token( parser );\n      if ( parser->root.error )\n        return;\n      T1_Skip_Spaces( parser );\n      cur = parser->root.cursor;\n\n      while ( parser->root.cursor < limit )\n      {\n        if ( *parser->root.cursor == '/' )\n          count++;\n        else if ( *parser->root.cursor == '>' )\n        {\n          loader->num_glyphs  = count;\n          parser->root.cursor = cur;        /* rewind */\n          break;\n        }\n        T1_Skip_PS_Token( parser );\n        if ( parser->root.error )\n          return;\n        T1_Skip_Spaces( parser );\n      }\n    }\n    else\n    {\n      FT_ERROR(( \"t42_parse_charstrings: invalid token\\n\" ));\n      error = FT_THROW( Invalid_File_Format );\n      goto Fail;\n    }\n\n    if ( parser->root.cursor >= limit )\n    {\n      FT_ERROR(( \"t42_parse_charstrings: out of bounds\\n\" ));\n      error = FT_THROW( Invalid_File_Format );\n      goto Fail;\n    }\n\n    /* initialize tables */\n\n    error = psaux->ps_table_funcs->init( code_table,\n                                         loader->num_glyphs,\n                                         memory );\n    if ( error )\n      goto Fail;\n\n    error = psaux->ps_table_funcs->init( name_table,\n                                         loader->num_glyphs,\n                                         memory );\n    if ( error )\n      goto Fail;\n\n    /* Initialize table for swapping index notdef_index and */\n    /* index 0 names and codes (if necessary).              */\n\n    error = psaux->ps_table_funcs->init( swap_table, 4, memory );\n    if ( error )\n      goto Fail;\n\n    n = 0;\n\n    for (;;)\n    {\n      /* The format is simple:                   */\n      /*   `/glyphname' + index [+ def]          */\n\n      T1_Skip_Spaces( parser );\n\n      cur = parser->root.cursor;\n      if ( cur >= limit )\n        break;\n\n      /* We stop when we find an `end' keyword or '>' */\n      if ( *cur   == 'e'          &&\n           cur + 3 < limit        &&\n           cur[1] == 'n'          &&\n           cur[2] == 'd'          &&\n           t42_is_space( cur[3] ) )\n        break;\n      if ( *cur == '>' )\n        break;\n\n      T1_Skip_PS_Token( parser );\n      if ( parser->root.cursor >= limit )\n      {\n        FT_ERROR(( \"t42_parse_charstrings: out of bounds\\n\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Fail;\n      }\n      if ( parser->root.error )\n        return;\n\n      if ( *cur == '/' )\n      {\n        FT_PtrDist  len;\n\n\n        if ( cur + 2 >= limit )\n        {\n          FT_ERROR(( \"t42_parse_charstrings: out of bounds\\n\" ));\n          error = FT_THROW( Invalid_File_Format );\n          goto Fail;\n        }\n\n        cur++;                              /* skip `/' */\n        len = parser->root.cursor - cur;\n\n        error = T1_Add_Table( name_table, n, cur, len + 1 );\n        if ( error )\n          goto Fail;\n\n        /* add a trailing zero to the name table */\n        name_table->elements[n][len] = '\\0';\n\n        /* record index of /.notdef */\n        if ( *cur == '.'                                              &&\n             ft_strcmp( \".notdef\",\n                        (const char*)(name_table->elements[n]) ) == 0 )\n        {\n          notdef_index = n;\n          notdef_found = 1;\n        }\n\n        T1_Skip_Spaces( parser );\n\n        cur = parser->root.cursor;\n\n        (void)T1_ToInt( parser );\n        if ( parser->root.cursor >= limit )\n        {\n          FT_ERROR(( \"t42_parse_charstrings: out of bounds\\n\" ));\n          error = FT_THROW( Invalid_File_Format );\n          goto Fail;\n        }\n\n        len = parser->root.cursor - cur;\n\n        error = T1_Add_Table( code_table, n, cur, len + 1 );\n        if ( error )\n          goto Fail;\n\n        code_table->elements[n][len] = '\\0';\n\n        n++;\n        if ( n >= loader->num_glyphs )\n          break;\n      }\n    }\n\n    loader->num_glyphs = n;\n\n    if ( !notdef_found )\n    {\n      FT_ERROR(( \"t42_parse_charstrings: no /.notdef glyph\\n\" ));\n      error = FT_THROW( Invalid_File_Format );\n      goto Fail;\n    }\n\n    /* if /.notdef does not occupy index 0, do our magic. */\n    if ( ft_strcmp( (const char*)\".notdef\",\n                    (const char*)name_table->elements[0] ) )\n    {\n      /* Swap glyph in index 0 with /.notdef glyph.  First, add index 0  */\n      /* name and code entries to swap_table.  Then place notdef_index   */\n      /* name and code entries into swap_table.  Then swap name and code */\n      /* entries at indices notdef_index and 0 using values stored in    */\n      /* swap_table.                                                     */\n\n      /* Index 0 name */\n      error = T1_Add_Table( swap_table, 0,\n                            name_table->elements[0],\n                            name_table->lengths [0] );\n      if ( error )\n        goto Fail;\n\n      /* Index 0 code */\n      error = T1_Add_Table( swap_table, 1,\n                            code_table->elements[0],\n                            code_table->lengths [0] );\n      if ( error )\n        goto Fail;\n\n      /* Index notdef_index name */\n      error = T1_Add_Table( swap_table, 2,\n                            name_table->elements[notdef_index],\n                            name_table->lengths [notdef_index] );\n      if ( error )\n        goto Fail;\n\n      /* Index notdef_index code */\n      error = T1_Add_Table( swap_table, 3,\n                            code_table->elements[notdef_index],\n                            code_table->lengths [notdef_index] );\n      if ( error )\n        goto Fail;\n\n      error = T1_Add_Table( name_table, notdef_index,\n                            swap_table->elements[0],\n                            swap_table->lengths [0] );\n      if ( error )\n        goto Fail;\n\n      error = T1_Add_Table( code_table, notdef_index,\n                            swap_table->elements[1],\n                            swap_table->lengths [1] );\n      if ( error )\n        goto Fail;\n\n      error = T1_Add_Table( name_table, 0,\n                            swap_table->elements[2],\n                            swap_table->lengths [2] );\n      if ( error )\n        goto Fail;\n\n      error = T1_Add_Table( code_table, 0,\n                            swap_table->elements[3],\n                            swap_table->lengths [3] );\n      if ( error )\n        goto Fail;\n\n    }\n\n    return;\n\n  Fail:\n    parser->root.error = error;\n  }\n\n\n  static FT_Error\n  t42_load_keyword( T42_Face    face,\n                    T42_Loader  loader,\n                    T1_Field    field )\n  {\n    FT_Error  error;\n    void*     dummy_object;\n    void**    objects;\n    FT_UInt   max_objects = 0;\n\n\n    /* if the keyword has a dedicated callback, call it */\n    if ( field->type == T1_FIELD_TYPE_CALLBACK )\n    {\n      field->reader( (FT_Face)face, loader );\n      error = loader->parser.root.error;\n      goto Exit;\n    }\n\n    /* now the keyword is either a simple field or a table of fields; */\n    /* we are now going to take care of it                            */\n\n    switch ( field->location )\n    {\n    case T1_FIELD_LOCATION_FONT_INFO:\n      dummy_object = &face->type1.font_info;\n      break;\n\n    case T1_FIELD_LOCATION_FONT_EXTRA:\n      dummy_object = &face->type1.font_extra;\n      break;\n\n    case T1_FIELD_LOCATION_BBOX:\n      dummy_object = &face->type1.font_bbox;\n      break;\n\n    default:\n      dummy_object = &face->type1;\n    }\n\n    objects = &dummy_object;\n\n    if ( field->type == T1_FIELD_TYPE_INTEGER_ARRAY ||\n         field->type == T1_FIELD_TYPE_FIXED_ARRAY   )\n      error = T1_Load_Field_Table( &loader->parser, field,\n                                   objects, max_objects, 0 );\n    else\n      error = T1_Load_Field( &loader->parser, field,\n                             objects, max_objects, 0 );\n\n   Exit:\n    return error;\n  }\n\n\n  FT_LOCAL_DEF( FT_Error )\n  t42_parse_dict( T42_Face    face,\n                  T42_Loader  loader,\n                  FT_Byte*    base,\n                  FT_Long     size )\n  {\n    T42_Parser  parser     = &loader->parser;\n    FT_Byte*    limit;\n    FT_Int      n_keywords = (FT_Int)( sizeof ( t42_keywords ) /\n                                         sizeof ( t42_keywords[0] ) );\n\n\n    parser->root.cursor = base;\n    parser->root.limit  = base + size;\n    parser->root.error  = FT_Err_Ok;\n\n    limit = parser->root.limit;\n\n    T1_Skip_Spaces( parser );\n\n    while ( parser->root.cursor < limit )\n    {\n      FT_Byte*  cur;\n\n\n      cur = parser->root.cursor;\n\n      /* look for `FontDirectory' which causes problems for some fonts */\n      if ( *cur == 'F' && cur + 25 < limit                    &&\n           ft_strncmp( (char*)cur, \"FontDirectory\", 13 ) == 0 )\n      {\n        FT_Byte*  cur2;\n\n\n        /* skip the `FontDirectory' keyword */\n        T1_Skip_PS_Token( parser );\n        T1_Skip_Spaces  ( parser );\n        cur = cur2 = parser->root.cursor;\n\n        /* look up the `known' keyword */\n        while ( cur < limit )\n        {\n          if ( *cur == 'k' && cur + 5 < limit             &&\n                ft_strncmp( (char*)cur, \"known\", 5 ) == 0 )\n            break;\n\n          T1_Skip_PS_Token( parser );\n          if ( parser->root.error )\n            goto Exit;\n          T1_Skip_Spaces  ( parser );\n          cur = parser->root.cursor;\n        }\n\n        if ( cur < limit )\n        {\n          T1_TokenRec  token;\n\n\n          /* skip the `known' keyword and the token following it */\n          T1_Skip_PS_Token( parser );\n          T1_ToToken( parser, &token );\n\n          /* if the last token was an array, skip it! */\n          if ( token.type == T1_TOKEN_TYPE_ARRAY )\n            cur2 = parser->root.cursor;\n        }\n        parser->root.cursor = cur2;\n      }\n\n      /* look for immediates */\n      else if ( *cur == '/' && cur + 2 < limit )\n      {\n        FT_PtrDist  len;\n\n\n        cur++;\n\n        parser->root.cursor = cur;\n        T1_Skip_PS_Token( parser );\n        if ( parser->root.error )\n          goto Exit;\n\n        len = parser->root.cursor - cur;\n\n        if ( len > 0 && len < 22 && parser->root.cursor < limit )\n        {\n          int  i;\n\n\n          /* now compare the immediate name to the keyword table */\n\n          /* loop through all known keywords */\n          for ( i = 0; i < n_keywords; i++ )\n          {\n            T1_Field  keyword = (T1_Field)&t42_keywords[i];\n            FT_Byte   *name   = (FT_Byte*)keyword->ident;\n\n\n            if ( !name )\n              continue;\n\n            if ( cur[0] == name[0]                                  &&\n                 len == (FT_PtrDist)ft_strlen( (const char *)name ) &&\n                 ft_memcmp( cur, name, len ) == 0                   )\n            {\n              /* we found it -- run the parsing callback! */\n              parser->root.error = t42_load_keyword( face,\n                                                     loader,\n                                                     keyword );\n              if ( parser->root.error )\n                return parser->root.error;\n              break;\n            }\n          }\n        }\n      }\n      else\n      {\n        T1_Skip_PS_Token( parser );\n        if ( parser->root.error )\n          goto Exit;\n      }\n\n      T1_Skip_Spaces( parser );\n    }\n\n  Exit:\n    return parser->root.error;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  t42_loader_init( T42_Loader  loader,\n                   T42_Face    face )\n  {\n    FT_UNUSED( face );\n\n    FT_MEM_ZERO( loader, sizeof ( *loader ) );\n    loader->num_glyphs = 0;\n    loader->num_chars  = 0;\n\n    /* initialize the tables -- simply set their `init' field to 0 */\n    loader->encoding_table.init = 0;\n    loader->charstrings.init    = 0;\n    loader->glyph_names.init    = 0;\n  }\n\n\n  FT_LOCAL_DEF( void )\n  t42_loader_done( T42_Loader  loader )\n  {\n    T42_Parser  parser = &loader->parser;\n\n\n    /* finalize tables */\n    T1_Release_Table( &loader->encoding_table );\n    T1_Release_Table( &loader->charstrings );\n    T1_Release_Table( &loader->glyph_names );\n    T1_Release_Table( &loader->swap_table );\n\n    /* finalize parser */\n    t42_parser_done( parser );\n  }\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type42/t42parse.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t42parse.h                                                             */\n/*                                                                         */\n/*    Type 42 font parser (specification).                                 */\n/*                                                                         */\n/*  Copyright 2002, 2003 by Roberto Alameda.                               */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T42PARSE_H__\n#define __T42PARSE_H__\n\n\n#include \"t42objs.h\"\n#include FT_INTERNAL_POSTSCRIPT_AUX_H\n\n\nFT_BEGIN_HEADER\n\n  typedef struct  T42_ParserRec_\n  {\n    PS_ParserRec  root;\n    FT_Stream     stream;\n\n    FT_Byte*      base_dict;\n    FT_Long       base_len;\n\n    FT_Bool       in_memory;\n\n  } T42_ParserRec, *T42_Parser;\n\n\n  typedef struct  T42_Loader_\n  {\n    T42_ParserRec  parser;          /* parser used to read the stream */\n\n    FT_UInt        num_chars;       /* number of characters in encoding */\n    PS_TableRec    encoding_table;  /* PS_Table used to store the       */\n                                    /* encoding character names         */\n\n    FT_UInt        num_glyphs;\n    PS_TableRec    glyph_names;\n    PS_TableRec    charstrings;\n    PS_TableRec    swap_table;      /* For moving .notdef glyph to index 0. */\n\n  } T42_LoaderRec, *T42_Loader;\n\n\n  FT_LOCAL( FT_Error )\n  t42_parser_init( T42_Parser     parser,\n                   FT_Stream      stream,\n                   FT_Memory      memory,\n                   PSAux_Service  psaux );\n\n  FT_LOCAL( void )\n  t42_parser_done( T42_Parser  parser );\n\n\n  FT_LOCAL( FT_Error )\n  t42_parse_dict( T42_Face    face,\n                  T42_Loader  loader,\n                  FT_Byte*    base,\n                  FT_Long     size );\n\n\n  FT_LOCAL( void )\n  t42_loader_init( T42_Loader  loader,\n                   T42_Face    face );\n\n  FT_LOCAL( void )\n  t42_loader_done( T42_Loader  loader );\n\n\n /* */\n\nFT_END_HEADER\n\n\n#endif /* __T42PARSE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type42/t42types.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t42types.h                                                             */\n/*                                                                         */\n/*    Type 42 font data types (specification only).                        */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2006, 2008 by Roberto Alameda.                   */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T42TYPES_H__\n#define __T42TYPES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_TYPE1_TABLES_H\n#include FT_INTERNAL_TYPE1_TYPES_H\n#include FT_INTERNAL_POSTSCRIPT_HINTS_H\n\n\nFT_BEGIN_HEADER\n\n\n  typedef struct  T42_FaceRec_\n  {\n    FT_FaceRec      root;\n    T1_FontRec      type1;\n    const void*     psnames;\n    const void*     psaux;\n#if 0\n    const void*     afm_data;\n#endif\n    FT_Byte*        ttf_data;\n    FT_ULong        ttf_size;\n    FT_Face         ttf_face;\n    FT_CharMapRec   charmaprecs[2];\n    FT_CharMap      charmaps[2];\n    PS_UnicodesRec  unicode_map;\n\n  } T42_FaceRec, *T42_Face;\n\n\nFT_END_HEADER\n\n#endif /* __T42TYPES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/type42/type42.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  type42.c                                                               */\n/*                                                                         */\n/*    FreeType Type 42 driver component.                                   */\n/*                                                                         */\n/*  Copyright 2002 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#define FT_MAKE_OPTION_SINGLE_OBJECT\n\n#include <ft2build.h>\n#include \"t42objs.c\"\n#include \"t42parse.c\"\n#include \"t42drivr.c\"\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/winfonts/Jamfile",
    "content": "# FreeType 2 src/winfonts Jamfile\n#\n# Copyright 2001 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\nSubDir  FT2_TOP $(FT2_SRC_DIR) winfonts ;\n\nLibrary  $(FT2_LIB) : winfnt.c ;\n\n# end of src/winfonts Jamfile\n"
  },
  {
    "path": "ext/freetype2/src/winfonts/fnterrs.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fnterrs.h                                                              */\n/*                                                                         */\n/*    Win FNT/FON error codes (specification only).                        */\n/*                                                                         */\n/*  Copyright 2001, 2012 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the Windows FNT/FON error enumeration     */\n  /* constants.                                                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n#ifndef __FNTERRS_H__\n#define __FNTERRS_H__\n\n#include FT_MODULE_ERRORS_H\n\n#undef __FTERRORS_H__\n\n#undef  FT_ERR_PREFIX\n#define FT_ERR_PREFIX  FNT_Err_\n#define FT_ERR_BASE    FT_Mod_Err_Winfonts\n\n#include FT_ERRORS_H\n\n#endif /* __FNTERRS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/winfonts/module.mk",
    "content": "#\n# FreeType 2 Windows FNT/FON module definition\n#\n\n\n# Copyright 1996-2000, 2006 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\nFTMODULE_H_COMMANDS += WINDOWS_DRIVER\n\ndefine WINDOWS_DRIVER\n$(OPEN_DRIVER) FT_Driver_ClassRec, winfnt_driver_class $(CLOSE_DRIVER)\n$(ECHO_DRIVER)winfnt    $(ECHO_DRIVER_DESC)Windows bitmap fonts with extension *.fnt or *.fon$(ECHO_DRIVER_DONE)\nendef\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/winfonts/rules.mk",
    "content": "#\n# FreeType 2 Windows FNT/FON driver configuration rules\n#\n\n\n# Copyright 1996-2000, 2001, 2003 by\n# David Turner, Robert Wilhelm, and Werner Lemberg.\n#\n# This file is part of the FreeType project, and may only be used, modified,\n# and distributed under the terms of the FreeType project license,\n# LICENSE.TXT.  By continuing to use, modify, or distribute this file you\n# indicate that you have read the license and understand and accept it\n# fully.\n\n\n# Windows driver directory\n#\nFNT_DIR := $(SRC_DIR)/winfonts\n\n\nFNT_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(FNT_DIR))\n\n\n# Windows driver sources (i.e., C files)\n#\nFNT_DRV_SRC := $(FNT_DIR)/winfnt.c\n\n# Windows driver headers\n#\nFNT_DRV_H := $(FNT_DRV_SRC:%.c=%.h) \\\n             $(FNT_DIR)/fnterrs.h\n\n\n# Windows driver object(s)\n#\n#   FNT_DRV_OBJ_M is used during `multi' builds\n#   FNT_DRV_OBJ_S is used during `single' builds\n#\nFNT_DRV_OBJ_M := $(FNT_DRV_SRC:$(FNT_DIR)/%.c=$(OBJ_DIR)/%.$O)\nFNT_DRV_OBJ_S := $(OBJ_DIR)/winfnt.$O\n\n# Windows driver source file for single build\n#\nFNT_DRV_SRC_S := $(FNT_DIR)/winfnt.c\n\n\n# Windows driver - single object\n#\n$(FNT_DRV_OBJ_S): $(FNT_DRV_SRC_S) $(FNT_DRV_SRC) $(FREETYPE_H) $(FNT_DRV_H)\n\t$(FNT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(FNT_DRV_SRC_S))\n\n\n# Windows driver - multiple objects\n#\n$(OBJ_DIR)/%.$O: $(FNT_DIR)/%.c $(FREETYPE_H) $(FNT_DRV_H)\n\t$(FNT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)\n\n\n# update main driver object lists\n#\nDRV_OBJS_S += $(FNT_DRV_OBJ_S)\nDRV_OBJS_M += $(FNT_DRV_OBJ_M)\n\n\n# EOF\n"
  },
  {
    "path": "ext/freetype2/src/winfonts/winfnt.c",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  winfnt.c                                                               */\n/*                                                                         */\n/*    FreeType font driver for Windows FNT/FON files                       */\n/*                                                                         */\n/*  Copyright 1996-2004, 2006-2014 by                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*  Copyright 2003 Huw D M Davies for Codeweavers                          */\n/*  Copyright 2007 Dmitry Timoshkov for Codeweavers                        */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#include <ft2build.h>\n#include FT_WINFONTS_H\n#include FT_INTERNAL_DEBUG_H\n#include FT_INTERNAL_STREAM_H\n#include FT_INTERNAL_OBJECTS_H\n#include FT_TRUETYPE_IDS_H\n\n#include \"winfnt.h\"\n#include \"fnterrs.h\"\n#include FT_SERVICE_WINFNT_H\n#include FT_SERVICE_XFREE86_NAME_H\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */\n  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */\n  /* messages during execution.                                            */\n  /*                                                                       */\n#undef  FT_COMPONENT\n#define FT_COMPONENT  trace_winfnt\n\n\n  static const FT_Frame_Field  winmz_header_fields[] =\n  {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  WinMZ_HeaderRec\n\n    FT_FRAME_START( 64 ),\n      FT_FRAME_USHORT_LE ( magic ),\n      FT_FRAME_SKIP_BYTES( 29 * 2 ),\n      FT_FRAME_ULONG_LE  ( lfanew ),\n    FT_FRAME_END\n  };\n\n  static const FT_Frame_Field  winne_header_fields[] =\n  {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  WinNE_HeaderRec\n\n    FT_FRAME_START( 40 ),\n      FT_FRAME_USHORT_LE ( magic ),\n      FT_FRAME_SKIP_BYTES( 34 ),\n      FT_FRAME_USHORT_LE ( resource_tab_offset ),\n      FT_FRAME_USHORT_LE ( rname_tab_offset ),\n    FT_FRAME_END\n  };\n\n  static const FT_Frame_Field  winpe32_header_fields[] =\n  {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  WinPE32_HeaderRec\n\n    FT_FRAME_START( 248 ),\n      FT_FRAME_ULONG_LE  ( magic ),   /* PE00 */\n      FT_FRAME_USHORT_LE ( machine ), /* 0x014C - i386 */\n      FT_FRAME_USHORT_LE ( number_of_sections ),\n      FT_FRAME_SKIP_BYTES( 12 ),\n      FT_FRAME_USHORT_LE ( size_of_optional_header ),\n      FT_FRAME_SKIP_BYTES( 2 ),\n      FT_FRAME_USHORT_LE ( magic32 ), /* 0x10B */\n      FT_FRAME_SKIP_BYTES( 110 ),\n      FT_FRAME_ULONG_LE  ( rsrc_virtual_address ),\n      FT_FRAME_ULONG_LE  ( rsrc_size ),\n      FT_FRAME_SKIP_BYTES( 104 ),\n    FT_FRAME_END\n  };\n\n  static const FT_Frame_Field  winpe32_section_fields[] =\n  {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  WinPE32_SectionRec\n\n    FT_FRAME_START( 40 ),\n      FT_FRAME_BYTES     ( name, 8 ),\n      FT_FRAME_SKIP_BYTES( 4 ),\n      FT_FRAME_ULONG_LE  ( virtual_address ),\n      FT_FRAME_ULONG_LE  ( size_of_raw_data ),\n      FT_FRAME_ULONG_LE  ( pointer_to_raw_data ),\n      FT_FRAME_SKIP_BYTES( 16 ),\n    FT_FRAME_END\n  };\n\n  static const FT_Frame_Field  winpe_rsrc_dir_fields[] =\n  {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  WinPE_RsrcDirRec\n\n    FT_FRAME_START( 16 ),\n      FT_FRAME_ULONG_LE ( characteristics ),\n      FT_FRAME_ULONG_LE ( time_date_stamp ),\n      FT_FRAME_USHORT_LE( major_version ),\n      FT_FRAME_USHORT_LE( minor_version ),\n      FT_FRAME_USHORT_LE( number_of_named_entries ),\n      FT_FRAME_USHORT_LE( number_of_id_entries ),\n    FT_FRAME_END\n  };\n\n  static const FT_Frame_Field  winpe_rsrc_dir_entry_fields[] =\n  {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  WinPE_RsrcDirEntryRec\n\n    FT_FRAME_START( 8 ),\n      FT_FRAME_ULONG_LE( name ),\n      FT_FRAME_ULONG_LE( offset ),\n    FT_FRAME_END\n  };\n\n  static const FT_Frame_Field  winpe_rsrc_data_entry_fields[] =\n  {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  WinPE_RsrcDataEntryRec\n\n    FT_FRAME_START( 16 ),\n      FT_FRAME_ULONG_LE( offset_to_data ),\n      FT_FRAME_ULONG_LE( size ),\n      FT_FRAME_ULONG_LE( code_page ),\n      FT_FRAME_ULONG_LE( reserved ),\n    FT_FRAME_END\n  };\n\n  static const FT_Frame_Field  winfnt_header_fields[] =\n  {\n#undef  FT_STRUCTURE\n#define FT_STRUCTURE  FT_WinFNT_HeaderRec\n\n    FT_FRAME_START( 148 ),\n      FT_FRAME_USHORT_LE( version ),\n      FT_FRAME_ULONG_LE ( file_size ),\n      FT_FRAME_BYTES    ( copyright, 60 ),\n      FT_FRAME_USHORT_LE( file_type ),\n      FT_FRAME_USHORT_LE( nominal_point_size ),\n      FT_FRAME_USHORT_LE( vertical_resolution ),\n      FT_FRAME_USHORT_LE( horizontal_resolution ),\n      FT_FRAME_USHORT_LE( ascent ),\n      FT_FRAME_USHORT_LE( internal_leading ),\n      FT_FRAME_USHORT_LE( external_leading ),\n      FT_FRAME_BYTE     ( italic ),\n      FT_FRAME_BYTE     ( underline ),\n      FT_FRAME_BYTE     ( strike_out ),\n      FT_FRAME_USHORT_LE( weight ),\n      FT_FRAME_BYTE     ( charset ),\n      FT_FRAME_USHORT_LE( pixel_width ),\n      FT_FRAME_USHORT_LE( pixel_height ),\n      FT_FRAME_BYTE     ( pitch_and_family ),\n      FT_FRAME_USHORT_LE( avg_width ),\n      FT_FRAME_USHORT_LE( max_width ),\n      FT_FRAME_BYTE     ( first_char ),\n      FT_FRAME_BYTE     ( last_char ),\n      FT_FRAME_BYTE     ( default_char ),\n      FT_FRAME_BYTE     ( break_char ),\n      FT_FRAME_USHORT_LE( bytes_per_row ),\n      FT_FRAME_ULONG_LE ( device_offset ),\n      FT_FRAME_ULONG_LE ( face_name_offset ),\n      FT_FRAME_ULONG_LE ( bits_pointer ),\n      FT_FRAME_ULONG_LE ( bits_offset ),\n      FT_FRAME_BYTE     ( reserved ),\n      FT_FRAME_ULONG_LE ( flags ),\n      FT_FRAME_USHORT_LE( A_space ),\n      FT_FRAME_USHORT_LE( B_space ),\n      FT_FRAME_USHORT_LE( C_space ),\n      FT_FRAME_ULONG_LE ( color_table_offset ),\n      FT_FRAME_BYTES    ( reserved1, 16 ),\n    FT_FRAME_END\n  };\n\n\n  static void\n  fnt_font_done( FNT_Face face )\n  {\n    FT_Memory  memory = FT_FACE( face )->memory;\n    FT_Stream  stream = FT_FACE( face )->stream;\n    FNT_Font   font   = face->font;\n\n\n    if ( !font )\n      return;\n\n    if ( font->fnt_frame )\n      FT_FRAME_RELEASE( font->fnt_frame );\n    FT_FREE( font->family_name );\n\n    FT_FREE( font );\n    face->font = 0;\n  }\n\n\n  static FT_Error\n  fnt_font_load( FNT_Font   font,\n                 FT_Stream  stream )\n  {\n    FT_Error          error;\n    FT_WinFNT_Header  header = &font->header;\n    FT_Bool           new_format;\n    FT_UInt           size;\n\n\n    /* first of all, read the FNT header */\n    if ( FT_STREAM_SEEK( font->offset )                        ||\n         FT_STREAM_READ_FIELDS( winfnt_header_fields, header ) )\n      goto Exit;\n\n    /* check header */\n    if ( header->version != 0x200 &&\n         header->version != 0x300 )\n    {\n      FT_TRACE2(( \"  not a Windows FNT file\\n\" ));\n      error = FT_THROW( Unknown_File_Format );\n      goto Exit;\n    }\n\n    new_format = FT_BOOL( font->header.version == 0x300 );\n    size       = new_format ? 148 : 118;\n\n    if ( header->file_size < size )\n    {\n      FT_TRACE2(( \"  not a Windows FNT file\\n\" ));\n      error = FT_THROW( Unknown_File_Format );\n      goto Exit;\n    }\n\n    /* Version 2 doesn't have these fields */\n    if ( header->version == 0x200 )\n    {\n      header->flags   = 0;\n      header->A_space = 0;\n      header->B_space = 0;\n      header->C_space = 0;\n\n      header->color_table_offset = 0;\n    }\n\n    if ( header->file_type & 1 )\n    {\n      FT_TRACE2(( \"[can't handle vector FNT fonts]\\n\" ));\n      error = FT_THROW( Unknown_File_Format );\n      goto Exit;\n    }\n\n    /* this is a FNT file/table; extract its frame */\n    if ( FT_STREAM_SEEK( font->offset )                         ||\n         FT_FRAME_EXTRACT( header->file_size, font->fnt_frame ) )\n      goto Exit;\n\n  Exit:\n    return error;\n  }\n\n\n  static FT_Error\n  fnt_face_get_dll_font( FNT_Face  face,\n                         FT_Int    face_index )\n  {\n    FT_Error         error;\n    FT_Stream        stream = FT_FACE( face )->stream;\n    FT_Memory        memory = FT_FACE( face )->memory;\n    WinMZ_HeaderRec  mz_header;\n\n\n    face->font = 0;\n\n    /* does it begin with an MZ header? */\n    if ( FT_STREAM_SEEK( 0 )                                      ||\n         FT_STREAM_READ_FIELDS( winmz_header_fields, &mz_header ) )\n      goto Exit;\n\n    error = FT_ERR( Unknown_File_Format );\n    if ( mz_header.magic == WINFNT_MZ_MAGIC )\n    {\n      /* yes, now look for an NE header in the file */\n      WinNE_HeaderRec  ne_header;\n\n\n      FT_TRACE2(( \"MZ signature found\\n\" ));\n\n      if ( FT_STREAM_SEEK( mz_header.lfanew )                       ||\n           FT_STREAM_READ_FIELDS( winne_header_fields, &ne_header ) )\n        goto Exit;\n\n      error = FT_ERR( Unknown_File_Format );\n      if ( ne_header.magic == WINFNT_NE_MAGIC )\n      {\n        /* good, now look into the resource table for each FNT resource */\n        FT_ULong   res_offset  = mz_header.lfanew +\n                                   ne_header.resource_tab_offset;\n        FT_UShort  size_shift;\n        FT_UShort  font_count  = 0;\n        FT_ULong   font_offset = 0;\n\n\n        FT_TRACE2(( \"NE signature found\\n\" ));\n\n        if ( FT_STREAM_SEEK( res_offset )                    ||\n             FT_FRAME_ENTER( ne_header.rname_tab_offset -\n                             ne_header.resource_tab_offset ) )\n          goto Exit;\n\n        size_shift = FT_GET_USHORT_LE();\n\n        for (;;)\n        {\n          FT_UShort  type_id, count;\n\n\n          type_id = FT_GET_USHORT_LE();\n          if ( !type_id )\n            break;\n\n          count = FT_GET_USHORT_LE();\n\n          if ( type_id == 0x8008U )\n          {\n            font_count  = count;\n            font_offset = (FT_ULong)( FT_STREAM_POS() + 4 +\n                                      ( stream->cursor - stream->limit ) );\n            break;\n          }\n\n          stream->cursor += 4 + count * 12;\n        }\n\n        FT_FRAME_EXIT();\n\n        if ( !font_count || !font_offset )\n        {\n          FT_TRACE2(( \"this file doesn't contain any FNT resources\\n\" ));\n          error = FT_THROW( Invalid_File_Format );\n          goto Exit;\n        }\n\n        /* loading `winfnt_header_fields' needs at least 118 bytes;    */\n        /* use this as a rough measure to check the expected font size */\n        if ( font_count * 118UL > stream->size )\n        {\n          FT_TRACE2(( \"invalid number of faces\\n\" ));\n          error = FT_THROW( Invalid_File_Format );\n          goto Exit;\n        }\n\n        face->root.num_faces = font_count;\n\n        if ( face_index >= font_count )\n        {\n          error = FT_THROW( Invalid_Argument );\n          goto Exit;\n        }\n        else if ( face_index < 0 )\n          goto Exit;\n\n        if ( FT_NEW( face->font ) )\n          goto Exit;\n\n        if ( FT_STREAM_SEEK( font_offset + face_index * 12 ) ||\n             FT_FRAME_ENTER( 12 )                            )\n          goto Fail;\n\n        face->font->offset   = (FT_ULong)FT_GET_USHORT_LE() << size_shift;\n        face->font->fnt_size = (FT_ULong)FT_GET_USHORT_LE() << size_shift;\n\n        stream->cursor += 8;\n\n        FT_FRAME_EXIT();\n\n        error = fnt_font_load( face->font, stream );\n      }\n      else if ( ne_header.magic == WINFNT_PE_MAGIC )\n      {\n        WinPE32_HeaderRec       pe32_header;\n        WinPE32_SectionRec      pe32_section;\n        WinPE_RsrcDirRec        root_dir, name_dir, lang_dir;\n        WinPE_RsrcDirEntryRec   dir_entry1, dir_entry2, dir_entry3;\n        WinPE_RsrcDataEntryRec  data_entry;\n\n        FT_Long    root_dir_offset, name_dir_offset, lang_dir_offset;\n        FT_UShort  i, j, k;\n\n\n        FT_TRACE2(( \"PE signature found\\n\" ));\n\n        if ( FT_STREAM_SEEK( mz_header.lfanew )                           ||\n             FT_STREAM_READ_FIELDS( winpe32_header_fields, &pe32_header ) )\n          goto Exit;\n\n        FT_TRACE2(( \"magic %04lx, machine %02x, number_of_sections %u, \"\n                    \"size_of_optional_header %02x\\n\"\n                    \"magic32 %02x, rsrc_virtual_address %04lx, \"\n                    \"rsrc_size %04lx\\n\",\n                    pe32_header.magic, pe32_header.machine,\n                    pe32_header.number_of_sections,\n                    pe32_header.size_of_optional_header,\n                    pe32_header.magic32, pe32_header.rsrc_virtual_address,\n                    pe32_header.rsrc_size ));\n\n        if ( pe32_header.magic != WINFNT_PE_MAGIC /* check full signature */ ||\n             pe32_header.machine != 0x014C /* i386 */                        ||\n             pe32_header.size_of_optional_header != 0xE0 /* FIXME */         ||\n             pe32_header.magic32 != 0x10B                                    )\n        {\n          FT_TRACE2(( \"this file has an invalid PE header\\n\" ));\n          error = FT_THROW( Invalid_File_Format );\n          goto Exit;\n        }\n\n        face->root.num_faces = 0;\n\n        for ( i = 0; i < pe32_header.number_of_sections; i++ )\n        {\n          if ( FT_STREAM_READ_FIELDS( winpe32_section_fields,\n                                      &pe32_section ) )\n            goto Exit;\n\n          FT_TRACE2(( \"name %.8s, va %04lx, size %04lx, offset %04lx\\n\",\n                      pe32_section.name, pe32_section.virtual_address,\n                      pe32_section.size_of_raw_data,\n                      pe32_section.pointer_to_raw_data ));\n\n          if ( pe32_header.rsrc_virtual_address ==\n                 pe32_section.virtual_address )\n            goto Found_rsrc_section;\n        }\n\n        FT_TRACE2(( \"this file doesn't contain any resources\\n\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Exit;\n\n      Found_rsrc_section:\n        FT_TRACE2(( \"found resources section %.8s\\n\", pe32_section.name ));\n\n        if ( FT_STREAM_SEEK( pe32_section.pointer_to_raw_data )        ||\n             FT_STREAM_READ_FIELDS( winpe_rsrc_dir_fields, &root_dir ) )\n          goto Exit;\n\n        root_dir_offset = pe32_section.pointer_to_raw_data;\n\n        for ( i = 0; i < root_dir.number_of_named_entries +\n                           root_dir.number_of_id_entries; i++ )\n        {\n          if ( FT_STREAM_SEEK( root_dir_offset + 16 + i * 8 )      ||\n               FT_STREAM_READ_FIELDS( winpe_rsrc_dir_entry_fields,\n                                      &dir_entry1 )                )\n            goto Exit;\n\n          if ( !(dir_entry1.offset & 0x80000000UL ) /* DataIsDirectory */ )\n          {\n            error = FT_THROW( Invalid_File_Format );\n            goto Exit;\n          }\n\n          dir_entry1.offset &= ~0x80000000UL;\n\n          name_dir_offset = pe32_section.pointer_to_raw_data +\n                            dir_entry1.offset;\n\n          if ( FT_STREAM_SEEK( pe32_section.pointer_to_raw_data +\n                               dir_entry1.offset )                       ||\n               FT_STREAM_READ_FIELDS( winpe_rsrc_dir_fields, &name_dir ) )\n            goto Exit;\n\n          for ( j = 0; j < name_dir.number_of_named_entries +\n                             name_dir.number_of_id_entries; j++ )\n          {\n            if ( FT_STREAM_SEEK( name_dir_offset + 16 + j * 8 )      ||\n                 FT_STREAM_READ_FIELDS( winpe_rsrc_dir_entry_fields,\n                                        &dir_entry2 )                )\n              goto Exit;\n\n            if ( !(dir_entry2.offset & 0x80000000UL ) /* DataIsDirectory */ )\n            {\n              error = FT_THROW( Invalid_File_Format );\n              goto Exit;\n            }\n\n            dir_entry2.offset &= ~0x80000000UL;\n\n            lang_dir_offset = pe32_section.pointer_to_raw_data +\n                                dir_entry2.offset;\n\n            if ( FT_STREAM_SEEK( pe32_section.pointer_to_raw_data +\n                                   dir_entry2.offset )                     ||\n                 FT_STREAM_READ_FIELDS( winpe_rsrc_dir_fields, &lang_dir ) )\n              goto Exit;\n\n            for ( k = 0; k < lang_dir.number_of_named_entries +\n                               lang_dir.number_of_id_entries; k++ )\n            {\n              if ( FT_STREAM_SEEK( lang_dir_offset + 16 + k * 8 )      ||\n                   FT_STREAM_READ_FIELDS( winpe_rsrc_dir_entry_fields,\n                                          &dir_entry3 )                )\n                goto Exit;\n\n              if ( dir_entry2.offset & 0x80000000UL /* DataIsDirectory */ )\n              {\n                error = FT_THROW( Invalid_File_Format );\n                goto Exit;\n              }\n\n              if ( dir_entry1.name == 8 /* RT_FONT */ )\n              {\n                if ( FT_STREAM_SEEK( root_dir_offset + dir_entry3.offset ) ||\n                     FT_STREAM_READ_FIELDS( winpe_rsrc_data_entry_fields,\n                                            &data_entry )                  )\n                  goto Exit;\n\n                FT_TRACE2(( \"found font #%lu, offset %04lx, \"\n                            \"size %04lx, cp %lu\\n\",\n                            dir_entry2.name,\n                            pe32_section.pointer_to_raw_data +\n                              data_entry.offset_to_data -\n                              pe32_section.virtual_address,\n                            data_entry.size, data_entry.code_page ));\n\n                if ( face_index == face->root.num_faces )\n                {\n                  if ( FT_NEW( face->font ) )\n                    goto Exit;\n\n                  face->font->offset   = pe32_section.pointer_to_raw_data +\n                                           data_entry.offset_to_data -\n                                           pe32_section.virtual_address;\n                  face->font->fnt_size = data_entry.size;\n\n                  error = fnt_font_load( face->font, stream );\n                  if ( error )\n                  {\n                    FT_TRACE2(( \"font #%lu load error %d\\n\",\n                                dir_entry2.name, error ));\n                    goto Fail;\n                  }\n                  else\n                    FT_TRACE2(( \"font #%lu successfully loaded\\n\",\n                                dir_entry2.name ));\n                }\n\n                face->root.num_faces++;\n              }\n            }\n          }\n        }\n      }\n\n      if ( !face->root.num_faces )\n      {\n        FT_TRACE2(( \"this file doesn't contain any RT_FONT resources\\n\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Exit;\n      }\n\n      if ( face_index >= face->root.num_faces )\n      {\n        error = FT_THROW( Invalid_Argument );\n        goto Exit;\n      }\n    }\n\n  Fail:\n    if ( error )\n      fnt_font_done( face );\n\n  Exit:\n    return error;\n  }\n\n\n  typedef struct  FNT_CMapRec_\n  {\n    FT_CMapRec  cmap;\n    FT_UInt32   first;\n    FT_UInt32   count;\n\n  } FNT_CMapRec, *FNT_CMap;\n\n\n  static FT_Error\n  fnt_cmap_init( FNT_CMap    cmap,\n                 FT_Pointer  pointer )\n  {\n    FNT_Face  face = (FNT_Face)FT_CMAP_FACE( cmap );\n    FNT_Font  font = face->font;\n\n    FT_UNUSED( pointer );\n\n\n    cmap->first = (FT_UInt32)  font->header.first_char;\n    cmap->count = (FT_UInt32)( font->header.last_char - cmap->first + 1 );\n\n    return 0;\n  }\n\n\n  static FT_UInt\n  fnt_cmap_char_index( FNT_CMap   cmap,\n                       FT_UInt32  char_code )\n  {\n    FT_UInt  gindex = 0;\n\n\n    char_code -= cmap->first;\n    if ( char_code < cmap->count )\n      /* we artificially increase the glyph index; */\n      /* FNT_Load_Glyph reverts to the right one   */\n      gindex = (FT_UInt)( char_code + 1 );\n    return gindex;\n  }\n\n\n  static FT_UInt32\n  fnt_cmap_char_next( FNT_CMap    cmap,\n                      FT_UInt32  *pchar_code )\n  {\n    FT_UInt    gindex = 0;\n    FT_UInt32  result = 0;\n    FT_UInt32  char_code = *pchar_code + 1;\n\n\n    if ( char_code <= cmap->first )\n    {\n      result = cmap->first;\n      gindex = 1;\n    }\n    else\n    {\n      char_code -= cmap->first;\n      if ( char_code < cmap->count )\n      {\n        result = cmap->first + char_code;\n        gindex = (FT_UInt)( char_code + 1 );\n      }\n    }\n\n    *pchar_code = result;\n    return gindex;\n  }\n\n\n  static const FT_CMap_ClassRec  fnt_cmap_class_rec =\n  {\n    sizeof ( FNT_CMapRec ),\n\n    (FT_CMap_InitFunc)     fnt_cmap_init,\n    (FT_CMap_DoneFunc)     NULL,\n    (FT_CMap_CharIndexFunc)fnt_cmap_char_index,\n    (FT_CMap_CharNextFunc) fnt_cmap_char_next,\n\n    NULL, NULL, NULL, NULL, NULL\n  };\n\n  static FT_CMap_Class const  fnt_cmap_class = &fnt_cmap_class_rec;\n\n\n  static void\n  FNT_Face_Done( FT_Face  fntface )       /* FNT_Face */\n  {\n    FNT_Face   face = (FNT_Face)fntface;\n    FT_Memory  memory;\n\n\n    if ( !face )\n      return;\n\n    memory = FT_FACE_MEMORY( face );\n\n    fnt_font_done( face );\n\n    FT_FREE( fntface->available_sizes );\n    fntface->num_fixed_sizes = 0;\n  }\n\n\n  static FT_Error\n  FNT_Face_Init( FT_Stream      stream,\n                 FT_Face        fntface,        /* FNT_Face */\n                 FT_Int         face_index,\n                 FT_Int         num_params,\n                 FT_Parameter*  params )\n  {\n    FNT_Face   face   = (FNT_Face)fntface;\n    FT_Error   error;\n    FT_Memory  memory = FT_FACE_MEMORY( face );\n\n    FT_UNUSED( num_params );\n    FT_UNUSED( params );\n\n\n    FT_TRACE2(( \"Windows FNT driver\\n\" ));\n\n    /* try to load font from a DLL */\n    error = fnt_face_get_dll_font( face, face_index );\n    if ( !error && face_index < 0 )\n      goto Exit;\n\n    if ( FT_ERR_EQ( error, Unknown_File_Format ) )\n    {\n      /* this didn't work; try to load a single FNT font */\n      FNT_Font  font;\n\n      if ( FT_NEW( face->font ) )\n        goto Exit;\n\n      fntface->num_faces = 1;\n\n      font           = face->font;\n      font->offset   = 0;\n      font->fnt_size = stream->size;\n\n      error = fnt_font_load( font, stream );\n\n      if ( !error )\n      {\n        if ( face_index > 0 )\n          error = FT_THROW( Invalid_Argument );\n        else if ( face_index < 0 )\n          goto Exit;\n      }\n    }\n\n    if ( error )\n      goto Fail;\n\n    /* we now need to fill the root FT_Face fields */\n    /* with relevant information                   */\n    {\n      FT_Face     root = FT_FACE( face );\n      FNT_Font    font = face->font;\n      FT_PtrDist  family_size;\n\n\n      root->face_index = face_index;\n\n      root->face_flags |= FT_FACE_FLAG_FIXED_SIZES |\n                          FT_FACE_FLAG_HORIZONTAL;\n\n      if ( font->header.avg_width == font->header.max_width )\n        root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;\n\n      if ( font->header.italic )\n        root->style_flags |= FT_STYLE_FLAG_ITALIC;\n\n      if ( font->header.weight >= 800 )\n        root->style_flags |= FT_STYLE_FLAG_BOLD;\n\n      /* set up the `fixed_sizes' array */\n      if ( FT_NEW_ARRAY( root->available_sizes, 1 ) )\n        goto Fail;\n\n      root->num_fixed_sizes = 1;\n\n      {\n        FT_Bitmap_Size*  bsize = root->available_sizes;\n        FT_UShort        x_res, y_res;\n\n\n        bsize->width  = font->header.avg_width;\n        bsize->height = (FT_Short)(\n          font->header.pixel_height + font->header.external_leading );\n        bsize->size   = font->header.nominal_point_size << 6;\n\n        x_res = font->header.horizontal_resolution;\n        if ( !x_res )\n          x_res = 72;\n\n        y_res = font->header.vertical_resolution;\n        if ( !y_res )\n          y_res = 72;\n\n        bsize->y_ppem = FT_MulDiv( bsize->size, y_res, 72 );\n        bsize->y_ppem = FT_PIX_ROUND( bsize->y_ppem );\n\n        /*\n         * this reads:\n         *\n         * the nominal height is larger than the bbox's height\n         *\n         * => nominal_point_size contains incorrect value;\n         *    use pixel_height as the nominal height\n         */\n        if ( bsize->y_ppem > ( font->header.pixel_height << 6 ) )\n        {\n          FT_TRACE2(( \"use pixel_height as the nominal height\\n\" ));\n\n          bsize->y_ppem = font->header.pixel_height << 6;\n          bsize->size   = FT_MulDiv( bsize->y_ppem, 72, y_res );\n        }\n\n        bsize->x_ppem = FT_MulDiv( bsize->size, x_res, 72 );\n        bsize->x_ppem = FT_PIX_ROUND( bsize->x_ppem );\n      }\n\n      {\n        FT_CharMapRec  charmap;\n\n\n        charmap.encoding    = FT_ENCODING_NONE;\n        /* initial platform/encoding should indicate unset status? */\n        charmap.platform_id = TT_PLATFORM_APPLE_UNICODE;\n        charmap.encoding_id = TT_APPLE_ID_DEFAULT;\n        charmap.face        = root;\n\n        if ( font->header.charset == FT_WinFNT_ID_MAC )\n        {\n          charmap.encoding    = FT_ENCODING_APPLE_ROMAN;\n          charmap.platform_id = TT_PLATFORM_MACINTOSH;\n/*        charmap.encoding_id = TT_MAC_ID_ROMAN; */\n        }\n\n        error = FT_CMap_New( fnt_cmap_class,\n                             NULL,\n                             &charmap,\n                             NULL );\n        if ( error )\n          goto Fail;\n\n        /* Select default charmap */\n        if ( root->num_charmaps )\n          root->charmap = root->charmaps[0];\n      }\n\n      /* set up remaining flags */\n\n      if ( font->header.last_char < font->header.first_char )\n      {\n        FT_TRACE2(( \"invalid number of glyphs\\n\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Fail;\n      }\n\n      /* reserve one slot for the .notdef glyph at index 0 */\n      root->num_glyphs = font->header.last_char -\n                         font->header.first_char + 1 + 1;\n\n      if ( font->header.face_name_offset >= font->header.file_size )\n      {\n        FT_TRACE2(( \"invalid family name offset\\n\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Fail;\n      }\n      family_size = font->header.file_size - font->header.face_name_offset;\n      /* Some broken fonts don't delimit the face name with a final */\n      /* NULL byte -- the frame is erroneously one byte too small.  */\n      /* We thus allocate one more byte, setting it explicitly to   */\n      /* zero.                                                      */\n      if ( FT_ALLOC( font->family_name, family_size + 1 ) )\n        goto Fail;\n\n      FT_MEM_COPY( font->family_name,\n                   font->fnt_frame + font->header.face_name_offset,\n                   family_size );\n\n      font->family_name[family_size] = '\\0';\n\n      if ( FT_REALLOC( font->family_name,\n                       family_size,\n                       ft_strlen( font->family_name ) + 1 ) )\n        goto Fail;\n\n      root->family_name = font->family_name;\n      root->style_name  = (char *)\"Regular\";\n\n      if ( root->style_flags & FT_STYLE_FLAG_BOLD )\n      {\n        if ( root->style_flags & FT_STYLE_FLAG_ITALIC )\n          root->style_name = (char *)\"Bold Italic\";\n        else\n          root->style_name = (char *)\"Bold\";\n      }\n      else if ( root->style_flags & FT_STYLE_FLAG_ITALIC )\n        root->style_name = (char *)\"Italic\";\n    }\n    goto Exit;\n\n  Fail:\n    FNT_Face_Done( fntface );\n\n  Exit:\n    return error;\n  }\n\n\n  static FT_Error\n  FNT_Size_Select( FT_Size   size,\n                   FT_ULong  strike_index )\n  {\n    FNT_Face          face   = (FNT_Face)size->face;\n    FT_WinFNT_Header  header = &face->font->header;\n\n    FT_UNUSED( strike_index );\n\n\n    FT_Select_Metrics( size->face, 0 );\n\n    size->metrics.ascender    = header->ascent * 64;\n    size->metrics.descender   = -( header->pixel_height -\n                                   header->ascent ) * 64;\n    size->metrics.max_advance = header->max_width * 64;\n\n    return FT_Err_Ok;\n  }\n\n\n  static FT_Error\n  FNT_Size_Request( FT_Size          size,\n                    FT_Size_Request  req )\n  {\n    FNT_Face          face    = (FNT_Face)size->face;\n    FT_WinFNT_Header  header  = &face->font->header;\n    FT_Bitmap_Size*   bsize   = size->face->available_sizes;\n    FT_Error          error   = FT_ERR( Invalid_Pixel_Size );\n    FT_Long           height;\n\n\n    height = FT_REQUEST_HEIGHT( req );\n    height = ( height + 32 ) >> 6;\n\n    switch ( req->type )\n    {\n    case FT_SIZE_REQUEST_TYPE_NOMINAL:\n      if ( height == ( ( bsize->y_ppem + 32 ) >> 6 ) )\n        error = FT_Err_Ok;\n      break;\n\n    case FT_SIZE_REQUEST_TYPE_REAL_DIM:\n      if ( height == header->pixel_height )\n        error = FT_Err_Ok;\n      break;\n\n    default:\n      error = FT_THROW( Unimplemented_Feature );\n      break;\n    }\n\n    if ( error )\n      return error;\n    else\n      return FNT_Size_Select( size, 0 );\n  }\n\n\n  static FT_Error\n  FNT_Load_Glyph( FT_GlyphSlot  slot,\n                  FT_Size       size,\n                  FT_UInt       glyph_index,\n                  FT_Int32      load_flags )\n  {\n    FNT_Face    face   = (FNT_Face)FT_SIZE_FACE( size );\n    FNT_Font    font;\n    FT_Error    error  = FT_Err_Ok;\n    FT_Byte*    p;\n    FT_Int      len;\n    FT_Bitmap*  bitmap = &slot->bitmap;\n    FT_ULong    offset;\n    FT_Bool     new_format;\n\n    FT_UNUSED( load_flags );\n\n\n    if ( !face )\n    {\n      error = FT_THROW( Invalid_Face_Handle );\n      goto Exit;\n    }\n\n    font = face->font;\n\n    if ( !font                                                   ||\n         glyph_index >= (FT_UInt)( FT_FACE( face )->num_glyphs ) )\n    {\n      error = FT_THROW( Invalid_Argument );\n      goto Exit;\n    }\n\n    FT_TRACE1(( \"FNT_Load_Glyph: glyph index %d\\n\", glyph_index ));\n\n    if ( glyph_index > 0 )\n      glyph_index--;                           /* revert to real index */\n    else\n      glyph_index = font->header.default_char; /* the `.notdef' glyph  */\n\n    new_format = FT_BOOL( font->header.version == 0x300 );\n    len        = new_format ? 6 : 4;\n\n    /* get glyph width and offset */\n    offset = ( new_format ? 148 : 118 ) + len * glyph_index;\n\n    if ( offset >= font->header.file_size - 2 - ( new_format ? 4 : 2 ) )\n    {\n      FT_TRACE2(( \"invalid FNT offset\\n\" ));\n      error = FT_THROW( Invalid_File_Format );\n      goto Exit;\n    }\n\n    p = font->fnt_frame + offset;\n\n    bitmap->width = FT_NEXT_SHORT_LE( p );\n\n    /* jump to glyph entry */\n    if ( new_format )\n      offset = FT_NEXT_ULONG_LE( p );\n    else\n      offset = FT_NEXT_USHORT_LE( p );\n\n    if ( offset >= font->header.file_size )\n    {\n      FT_TRACE2(( \"invalid FNT offset\\n\" ));\n      error = FT_THROW( Invalid_File_Format );\n      goto Exit;\n    }\n\n    /* jump to glyph data */\n    p = font->fnt_frame + /* font->header.bits_offset */ + offset;\n\n    /* allocate and build bitmap */\n    {\n      FT_Memory  memory = FT_FACE_MEMORY( slot->face );\n      FT_Int     pitch  = ( bitmap->width + 7 ) >> 3;\n      FT_Byte*   column;\n      FT_Byte*   write;\n\n\n      bitmap->pitch      = pitch;\n      bitmap->rows       = font->header.pixel_height;\n      bitmap->pixel_mode = FT_PIXEL_MODE_MONO;\n\n      if ( offset + pitch * bitmap->rows > font->header.file_size )\n      {\n        FT_TRACE2(( \"invalid bitmap width\\n\" ));\n        error = FT_THROW( Invalid_File_Format );\n        goto Exit;\n      }\n\n      /* note: since glyphs are stored in columns and not in rows we */\n      /*       can't use ft_glyphslot_set_bitmap                     */\n      if ( FT_ALLOC_MULT( bitmap->buffer, pitch, bitmap->rows ) )\n        goto Exit;\n\n      column = (FT_Byte*)bitmap->buffer;\n\n      for ( ; pitch > 0; pitch--, column++ )\n      {\n        FT_Byte*  limit = p + bitmap->rows;\n\n\n        for ( write = column; p < limit; p++, write += bitmap->pitch )\n          *write = *p;\n      }\n    }\n\n    slot->internal->flags = FT_GLYPH_OWN_BITMAP;\n    slot->bitmap_left     = 0;\n    slot->bitmap_top      = font->header.ascent;\n    slot->format          = FT_GLYPH_FORMAT_BITMAP;\n\n    /* now set up metrics */\n    slot->metrics.width        = bitmap->width << 6;\n    slot->metrics.height       = bitmap->rows << 6;\n    slot->metrics.horiAdvance  = bitmap->width << 6;\n    slot->metrics.horiBearingX = 0;\n    slot->metrics.horiBearingY = slot->bitmap_top << 6;\n\n    ft_synthesize_vertical_metrics( &slot->metrics,\n                                    bitmap->rows << 6 );\n\n  Exit:\n    return error;\n  }\n\n\n  static FT_Error\n  winfnt_get_header( FT_Face               face,\n                     FT_WinFNT_HeaderRec  *aheader )\n  {\n    FNT_Font  font = ((FNT_Face)face)->font;\n\n\n    *aheader = font->header;\n\n    return 0;\n  }\n\n\n  static const FT_Service_WinFntRec  winfnt_service_rec =\n  {\n    winfnt_get_header\n  };\n\n /*\n  *  SERVICE LIST\n  *\n  */\n\n  static const FT_ServiceDescRec  winfnt_services[] =\n  {\n    { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_WINFNT },\n    { FT_SERVICE_ID_WINFNT,    &winfnt_service_rec },\n    { NULL, NULL }\n  };\n\n\n  static FT_Module_Interface\n  winfnt_get_service( FT_Module         module,\n                      const FT_String*  service_id )\n  {\n    FT_UNUSED( module );\n\n    return ft_service_list_lookup( winfnt_services, service_id );\n  }\n\n\n\n\n  FT_CALLBACK_TABLE_DEF\n  const FT_Driver_ClassRec  winfnt_driver_class =\n  {\n    {\n      FT_MODULE_FONT_DRIVER        |\n      FT_MODULE_DRIVER_NO_OUTLINES,\n      sizeof ( FT_DriverRec ),\n\n      \"winfonts\",\n      0x10000L,\n      0x20000L,\n\n      0,\n\n      0,                  /* FT_Module_Constructor */\n      0,                  /* FT_Module_Destructor  */\n      winfnt_get_service\n    },\n\n    sizeof ( FNT_FaceRec ),\n    sizeof ( FT_SizeRec ),\n    sizeof ( FT_GlyphSlotRec ),\n\n    FNT_Face_Init,\n    FNT_Face_Done,\n    0,                    /* FT_Size_InitFunc */\n    0,                    /* FT_Size_DoneFunc */\n    0,                    /* FT_Slot_InitFunc */\n    0,                    /* FT_Slot_DoneFunc */\n\n    FNT_Load_Glyph,\n\n    0,                    /* FT_Face_GetKerningFunc  */\n    0,                    /* FT_Face_AttachFunc      */\n    0,                    /* FT_Face_GetAdvancesFunc */\n\n    FNT_Size_Request,\n    FNT_Size_Select\n  };\n\n\n/* END */\n"
  },
  {
    "path": "ext/freetype2/src/winfonts/winfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  winfnt.h                                                               */\n/*                                                                         */\n/*    FreeType font driver for Windows FNT/FON files                       */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2007 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*  Copyright 2007 Dmitry Timoshkov for Codeweavers                        */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __WINFNT_H__\n#define __WINFNT_H__\n\n\n#include <ft2build.h>\n#include FT_WINFONTS_H\n#include FT_INTERNAL_DRIVER_H\n\n\nFT_BEGIN_HEADER\n\n#ifdef FT_CONFIG_OPTION_PIC\n#error \"this module does not support PIC yet\"\n#endif\n\n  typedef struct  WinMZ_HeaderRec_\n  {\n    FT_UShort  magic;\n    /* skipped content */\n    FT_UShort  lfanew;\n\n  } WinMZ_HeaderRec;\n\n\n  typedef struct  WinNE_HeaderRec_\n  {\n    FT_UShort  magic;\n    /* skipped content */\n    FT_UShort  resource_tab_offset;\n    FT_UShort  rname_tab_offset;\n\n  } WinNE_HeaderRec;\n\n\n  typedef struct  WinPE32_HeaderRec_\n  {\n    FT_ULong   magic;\n    FT_UShort  machine;\n    FT_UShort  number_of_sections;\n    /* skipped content */\n    FT_UShort  size_of_optional_header;\n    /* skipped content */\n    FT_UShort  magic32;\n    /* skipped content */\n    FT_ULong   rsrc_virtual_address;\n    FT_ULong   rsrc_size;\n    /* skipped content */\n\n  } WinPE32_HeaderRec;\n\n\n  typedef struct  WinPE32_SectionRec_\n  {\n    FT_Byte   name[8];\n    /* skipped content */\n    FT_ULong  virtual_address;\n    FT_ULong  size_of_raw_data;\n    FT_ULong  pointer_to_raw_data;\n    /* skipped content */\n\n  } WinPE32_SectionRec;\n\n\n  typedef struct  WinPE_RsrcDirRec_\n  {\n    FT_ULong   characteristics;\n    FT_ULong   time_date_stamp;\n    FT_UShort  major_version;\n    FT_UShort  minor_version;\n    FT_UShort  number_of_named_entries;\n    FT_UShort  number_of_id_entries;\n\n  } WinPE_RsrcDirRec;\n\n\n  typedef struct  WinPE_RsrcDirEntryRec_\n  {\n    FT_ULong  name;\n    FT_ULong  offset;\n\n  } WinPE_RsrcDirEntryRec;\n\n\n  typedef struct  WinPE_RsrcDataEntryRec_\n  {\n    FT_ULong  offset_to_data;\n    FT_ULong  size;\n    FT_ULong  code_page;\n    FT_ULong  reserved;\n\n  } WinPE_RsrcDataEntryRec;\n\n\n  typedef struct  WinNameInfoRec_\n  {\n    FT_UShort  offset;\n    FT_UShort  length;\n    FT_UShort  flags;\n    FT_UShort  id;\n    FT_UShort  handle;\n    FT_UShort  usage;\n\n  } WinNameInfoRec;\n\n\n  typedef struct  WinResourceInfoRec_\n  {\n    FT_UShort  type_id;\n    FT_UShort  count;\n\n  } WinResourceInfoRec;\n\n\n#define WINFNT_MZ_MAGIC  0x5A4D\n#define WINFNT_NE_MAGIC  0x454E\n#define WINFNT_PE_MAGIC  0x4550\n\n\n  typedef struct  FNT_FontRec_\n  {\n    FT_ULong             offset;\n\n    FT_WinFNT_HeaderRec  header;\n\n    FT_Byte*             fnt_frame;\n    FT_ULong             fnt_size;\n    FT_String*           family_name;\n\n  } FNT_FontRec, *FNT_Font;\n\n\n  typedef struct  FNT_FaceRec_\n  {\n    FT_FaceRec     root;\n    FNT_Font       font;\n\n    FT_CharMap     charmap_handle;\n    FT_CharMapRec  charmap;  /* a single charmap per face */\n\n  } FNT_FaceRec, *FNT_Face;\n\n\n  FT_EXPORT_VAR( const FT_Driver_ClassRec )  winfnt_driver_class;\n\n\nFT_END_HEADER\n\n\n#endif /* __WINFNT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "ext/jbig2dec/CHANGES",
    "content": "Version 0.12 (2014 October 1)\n\n* Bug fix release.\n\nVersion 0.11 (2010 February 2)\n\n * Support for generic regions with typical prediction (042_8.jb2)\n * Correct bitmap offsets with transposed text (042_19.jb2)\n * Autotools build now uses libtool and provides a shared library\n * Manpage for jbig2dec\n * Code cleanup and robustness fixes\n\nVersion 0.10 (2009 May 28)\n\n * Security fix for malicious symbol dictionaries CVE-2009-0196\n * Fix various resource leaks and error handling issues\n * Dynamically allocate huffman symbol length histogram to save space\n * Support aggregate symbol coding\n * Work around invalid Xerox WorkCentre streams which write the\n   final segment length as -1\n * Fix an issue with huffman table runcodes\n\nVersion 0.9 (2006 July 27)\n\n * striped page support\n * successfully decodes ubc test streams 042_9, 042_20\n\nVersion 0.8 (2005 April 6)\n\n * Fix an allocation error in the page array\n * properly handle non-OR image composition operators\n * Fix a UMR bug in the compositor\n * successfully decodes ubc test streams 042_12,15,16,17,18\n * various memory leak fixes\n\nVersion 0.7 (2004 December 8)\n\n * properly initialize page buffers\n * refinement region handling\n * successfully decodes ubc test streams 042_21, 042_22 and 042_23\n * generic region template 3 handling with arbitrary AT locations\n * successfully decodes ubc test streams 042_6 and 042_7\n \nVersion 0.6 (2003 December 31)\n\n * minor portability fix for cygwin\n\nVersion 0.5 (2003 December 4)\n\n * compiler warning fixes\n * Properly handle the export specification for symbol\n   dictionaries.\n * successfully decodes multipage documents from the\n   Adobe encoder.\n\nVersion 0.4 (released 2003 August 1)\n\n * redid license header to simplify relabelling for commercial \n   distribution, borrowing from Ghostscript.\n\nVersion 0.3 (released 2003 May 20)\n\n * win32 portability fixes related to ghostscript integration\n * generic mmr region support\n * successfully decodes ubc test stream 042_3\n\nVersion 0.2 (released 2003 April 17)\n\n * portability fixes\n * support for metadata extension segments (latin-1 only)\n * decodes single-page documents from the Adobe encoder\n * various other bugfixes\n\nVersion 0.1 (released 2002 August 6)\n\n * decodes artithmetic and huffman-coded generic regions\n    - some templates not working\n * decodes arithmetic symbol dictionaries\n * decodes artithmetic text regions\n * successfully decodes ubc test streams 042_1,2,4,5 and 10.\n * successfully decodes CVision embedded bitstream str-p39\n * regression testing harness based on SHA-1 hashes of known files\n\n"
  },
  {
    "path": "ext/jbig2dec/COPYING",
    "content": "                    GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  Developers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\n  A secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate.  Many developers of free software are heartened and\nencouraged by the resulting cooperation.  However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\n  The GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community.  It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server.  Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\n  An older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals.  This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU Affero General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Remote Network Interaction; Use with the GNU General Public License.\n\n  Notwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software.  This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time.  Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Affero General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Affero General Public License for more details.\n\n    You should have received a copy of the GNU Affero General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source.  For example, if your program is a web application, its\ninterface could display a \"Source\" link that leads users to an archive\nof the code.  There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n<http://www.gnu.org/licenses/>.\n"
  },
  {
    "path": "ext/jbig2dec/LICENSE",
    "content": "  The files in this directory (folder) and any subdirectories \n  (sub-folders) thereof are part of jbig2dec, with the exception\n  of certain source files included to support portability which are\n  marked otherwise in their copyright headers.\n\n  jbig2dec is free software; you can redistribute it and/or modify\n  it under the terms the GNU Affero General Public License as\n  published by the Free Software Foundation, either version 3 of the\n  License, or (at your option) any later version.\n\n  This software is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the \n  GNU General Public License for more details.\n\n  You should have received a copy of the GNU Affero General Public\n  License along with this program in the file named COPYING. If not,\n  write  to the Free Software Foundation, Inc., 59 Temple Place Suite\n  330, Boston, MA 02111-1307, USA.\n\n  In addition, specific permission is given to link jbig2dec to or \n  compile jbig2dec into AFPL Ghostscript and to distribute same\n  under the Aladdin Free Public License (AFPL) version 9.\n"
  },
  {
    "path": "ext/jbig2dec/Makefile.am",
    "content": "## process this file with automake to generate Makefile.in\n\n# require automake 1.7\nAUTOMAKE_OPTIONS = foreign 1.7 dist-bzip2 dist-zip -Wall\n\nlib_LTLIBRARIES = libjbig2dec.la\ninclude_HEADERS = jbig2.h\n\nCFLAGS = @CFLAGS@ $(XCFLAGS)\n\nlibjbig2dec_la_LDFLAGS = -version-info @JBIG2DEC_LT_CURRENT@:@JBIG2DEC_LT_REVISION@:@JBIG2DEC_LT_AGE@ -no-undefined\nlibjbig2dec_la_SOURCES = jbig2.c \\\n\tjbig2_arith.c jbig2_arith_int.c jbig2_arith_iaid.c jbig2_huffman.c \\\n\tjbig2_segment.c jbig2_page.c \\\n\tjbig2_symbol_dict.c jbig2_text.c \\\n\tjbig2_generic.c jbig2_refinement.c jbig2_mmr.c \\\n\tjbig2_halftone.c \\\n\tjbig2_image.c jbig2_image_pbm.c \\\n\tos_types.h config_types.h config_win32.h \\\n\tjbig2.h jbig2_priv.h jbig2_image.h \\\n\tjbig2_arith.h jbig2_arith_iaid.h jbig2_arith_int.h \\\n\tjbig2_huffman.h jbig2_hufftab.h jbig2_mmr.h \\\n\tjbig2_generic.h jbig2_symbol_dict.h jbig2_text.h \\\n\tjbig2_metadata.c jbig2_metadata.h memento.c memento.h\n\nbin_PROGRAMS = jbig2dec\nnoinst_PROGRAMS = test_sha1 test_huffman test_arith\n\njbig2dec_SOURCES = jbig2dec.c sha1.c sha1.h \\\n\tjbig2.h jbig2_image.h getopt.h \\\n\tos_types.h config_types.h config_win32.h\njbig2dec_LDADD = libjbig2dec.la @LIBOBJS@ $(PNG_LIBS)\n\ndist_man_MANS = jbig2dec.1\n\nEXTRA_DIST = test_jbig2dec.py msvc.mak LICENSE CHANGES\n\nMAINTAINERCLEANFILES = config_types.h.in\n\nTESTS = test_sha1 test_jbig2dec.py test_huffman test_arith\n\ntest_sha1_SOURCES = sha1.c sha1.h\ntest_sha1_CFLAGS = -DTEST\n\ntest_arith_SOURCES = jbig2_arith.c\ntest_arith_CFLAGS = -DTEST\ntest_arith_LDADD = libjbig2dec.la\n\ntest_huffman_SOURCES = jbig2_huffman.c\ntest_huffman_CFLAGS = -DTEST\ntest_huffman_LDADD = libjbig2dec.la\n\n"
  },
  {
    "path": "ext/jbig2dec/Makefile.unix",
    "content": "# Simple unix makefile\n\ndefault: all\n\nprefix ?= /usr/local\n\nCFLAGS := -Wall -g -O2 -DHAVE_STDINT_H\n\nLIB_SRCS := \\\n\tjbig2_arith.c jbig2_arith_int.c jbig2_arith_iaid.c \\\n\tjbig2_huffman.c jbig2_segment.c jbig2_page.c jbig2_symbol_dict.c \\\n\tjbig2_text.c jbig2_halftone.c jbig2_generic.c jbig2_refinement.c \\\n\tjbig2_mmr.c jbig2_image.c jbig2_metadata.c jbig2.c\nLIB_OBJS := $(LIB_SRCS:%.c=%.o)\nLIB_HDRS := \\\n\tjbig2.h jbig2_arith.h jbig2_arith_iaid.h jbig2_arith_int.h \\\n\tjbig2_generic.h jbig2_huffman.h jbig2_hufftab.h jbig2_image.h \\\n\tjbig2_metadata.h jbig2_mmr.h jbig2_priv.h jbig2_symbol_dict.h \\\n\tjbig2_text.h os_types.h\n\nAPP_SRCS := jbig2_image_pbm.c jbig2_image_png.c jbig2dec.c sha1.c\nAPP_OBJS := $(APP_SRCS:%.c=%.o)\nAPP_HDRS := sha1.h\n\n$(LIB_OBJS): $(LIB_HDRS)\n$(APP_OBJS): $(LIB_HDRS) $(APP_HDRS)\n\nlibjbig2dec.a: $(LIB_OBJS)\n\tar cru $@ $^\n\njbig2dec: $(APP_OBJS) libjbig2dec.a\n\t$(CC) -o $@ $^ -lpng -lz\n\nall: jbig2dec libjbig2dec.a\n\ninstall: jbig2dec libjbig2dec.a\n\tinstall -d $(prefix)/bin $(prefix)/lib $(prefix)/include $(prefix)/man/man1\n\tinstall jbig2dec $(prefix)/bin\n\tinstall jbig2dec.1 $(prefix)/man/man1\n\tinstall jbig2.h $(prefix)/include\n\tinstall libjbig2dec.a $(prefix)/lib\n\nclean:\n\trm -f *.o jbig2dec libjbig2dec.a\n\n"
  },
  {
    "path": "ext/jbig2dec/README",
    "content": "jbig2dec is a decoder library and example utility implementing the JBIG2\nbi-level image compression spec. Also known as ITU T.88 and ISO IEC\n14492, and included by reference in Adobe's PDF version 1.4 and later.\n\nThe basic invocation is:\n\n    jbig2dec [-o <output file>] file.jbig2\n\nIt also supports separate 'global' and 'page' streams, generally\nextracted from some embedded format:\n\n    jbig2dec [-o <output file>] <global_stream> <page_stream>\n\nThe program is only partially functional at this time, but should be\nuseful in some limited contexts. We welcome files that the decoder can't\nhandle, or renders incorrectly.\n\nA set of example files is available from\nhttp://www.ece.ubc.ca/spmg/jbig2/bitstreams/main.html\n\nMore information about this project and updated versions are available\nfrom http://jbig2dec.sf.net/ Development source code is kept in a \nsubversion repository at svn.ghostscript.com.\n\nThe contact address for the project is <jbig2-dev@ghostscript.com>.\n"
  },
  {
    "path": "ext/jbig2dec/autogen.sh",
    "content": "#!/bin/sh\n# Run this to set up the build system: configure, makefiles, etc.\n\npackage=\"jbig2dec\"\nAUTOMAKE_FLAGS=\"$AUTOMAKE_FLAGS\"\n\nsrcdir=`dirname $0`\ntest -z \"$srcdir\" && srcdir=.\n\ncd \"$srcdir\"\n\necho \"checking for autoconf... \"\n(autoconf --version) < /dev/null > /dev/null 2>&1 || {\n        echo\n        echo \"You must have autoconf installed to compile $package.\"\n        echo \"Download the appropriate package for your distribution,\"\n        echo \"or get the source tarball at ftp://ftp.gnu.org/pub/gnu/\"\n\texit 1\n}\n\nVERSIONGREP=\"sed -e s/.*[^0-9\\.]\\([0-9][0-9]*\\.[0-9][0-9]*\\).*/\\1/\"\nVERSIONMKMAJ=\"sed -e s/\\([0-9][0-9]*\\)[^0-9].*/\\\\1/\"\nVERSIONMKMIN=\"sed -e s/.*[0-9][0-9]*\\.//\"\n\n# do we need automake?\nif test \"x$USE_OLD\" = \"xyes\" ; then\n  if test -r Makefile.am; then\n    AM_OPTIONS=`fgrep AUTOMAKE_OPTIONS Makefile.am`\n    AM_NEEDED=`echo $AM_OPTIONS | $VERSIONGREP`\n    if test \"x$AM_NEEDED\" = \"x$AM_OPTIONS\"; then\n      AM_NEEDED=\"\"\n    fi\n    if test -z \"$AM_NEEDED\"; then\n      echo -n \"checking for automake... \"\n      AUTOMAKE=automake\n      ACLOCAL=aclocal\n      if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then\n        echo \"yes\"\n      else\n        echo \"no\"\n        AUTOMAKE=\n      fi\n    else\n      echo -n \"checking for automake $AM_NEEDED or later... \"\n      majneeded=`echo $AM_NEEDED | $VERSIONMKMAJ`\n      minneeded=`echo $AM_NEEDED | $VERSIONMKMIN`\n      for am in automake-$AM_NEEDED automake$AM_NEEDED automake \\\n          automake-1.7 automake-1.8 automake-1.9 automake-1.10; do\n        ($am --version < /dev/null > /dev/null 2>&1) || continue\n        ver=`$am --version < /dev/null | head -n 1 | $VERSIONGREP`\n        maj=`echo $ver | $VERSIONMKMAJ`\n        min=`echo $ver | $VERSIONMKMIN`\n        if test $maj -eq $majneeded -a $min -ge $minneeded; then\n          AUTOMAKE=$am\n          echo $AUTOMAKE\n          break\n        fi\n      done\n      test -z $AUTOMAKE &&  echo \"no\"\n      echo -n \"checking for aclocal $AM_NEEDED or later... \"\n      for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED aclocal\\\n          aclocal-1.7 aclocal-1.8 aclocal-1.9 aclocal-1.10; do\n        ($ac --version < /dev/null > /dev/null 2>&1) || continue\n        ver=`$ac --version < /dev/null | head -n 1 | $VERSIONGREP`\n        maj=`echo $ver | $VERSIONMKMAJ`\n        min=`echo $ver | $VERSIONMKMIN`\n        if test $maj -eq $majneeded -a $min -ge $minneeded; then\n          ACLOCAL=$ac\n          echo $ACLOCAL\n          break\n        fi\n      done\n      test -z $ACLOCAL && echo \"no\"\n    fi\n    test -z $AUTOMAKE || test -z $ACLOCAL && {\n          echo\n          echo \"You must have automake installed to compile $package.\"\n          echo \"Download the appropriate package for your distribution,\"\n          echo \"or get the source tarball at ftp://ftp.gnu.org/pub/gnu/\"\n          exit 1\n    }\n  fi\nelse\n  AUTOMAKE=automake\n  ACLOCAL=aclocal\n  AM_VER=`$AUTOMAKE --version | grep \"automake (GNU automake)\" | sed 's/[^0-9\\.]*//g'`\n  AM_MAJ=`echo $AM_VER |cut -d. -f1`\n  AM_MIN=`echo $AM_VER |cut -d. -f2`\n  AM_PAT=`echo $AM_VER |cut -d. -f3`\n\n  AM_NEEDED=`fgrep AUTOMAKE_OPTIONS Makefile.am | $VERSIONGREP`\n  AM_MAJOR_REQ=`echo $AM_NEEDED |cut -d. -f1`\n  AM_MINOR_REQ=`echo $AM_NEEDED |cut -d. -f2`\n  \n  echo \"checking for automake $AM_NEEDED or later...\"\n\n  if [ $AM_MAJ -lt $AM_MAJOR_REQ -o $AM_MIN -lt $AM_MINOR_REQ ] ; then\n    echo\n    echo \"You must have automake $AM_NEEDED or better installed to compile $package.\"\n    echo \"Download the appropriate package for your distribution,\"\n    echo \"or get the source tarball at ftp://ftp.gnu.org/pub/gnu/\"\n    exit 1\n  fi\nfi\n\n# do we need libtool?\nif ! test -z `grep -l -s -e PROG_LIBTOOL configure.ac configure.in`; then\n  echo -n \"Checking for libtoolize... \"\n  LIBTOOLIZE=\n  for lt in glibtoolize libtoolize; do\n    if ($lt --version < /dev/null > /dev/null 2>&1); then\n      LIBTOOLIZE=$lt\n      echo $lt\n      break;\n    fi\n  done\n  if test -z $LIBTOOLIZE; then\n        echo\n        echo \"You must have GNU libtool installed to compile $package.\"\n        echo \"Download the appropriate package for your distribution,\"\n        echo \"or get the source tarball at ftp://ftp.gnu.org/pub/gnu/\"\n\texit 1\n  fi\nfi\n\necho \"Generating configuration files for $package, please wait....\"\n\necho \"  $ACLOCAL $ACLOCAL_FLAGS\"\n$ACLOCAL $ACLOCAL_FLAGS\n\necho \"  $LIBTOOLIZE\"\n$LIBTOOLIZE --copy\n\necho \"  autoheader\"\nautoheader\n\necho \"  creating config_types.h.in\"\ncat >config_types.h.in <<EOF\n/*\n   generated header with missing types for the\n   jbig2dec program and library. include this\n   after config.h, within the HAVE_CONFIG_H\n   ifdef\n*/\n\n#ifndef HAVE_STDINT_H\n#  ifdef JBIG2_REPLACE_STDINT_H\n#   include <@JBIG2_STDINT_H@>\n#  else\n    typedef unsigned @JBIG2_INT32_T@ uint32_t;\n    typedef unsigned @JBIG2_INT16_T@ uint16_t;\n    typedef unsigned @JBIG2_INT8_T@ uint8_t;\n    typedef signed @JBIG2_INT32_T@ int32_t;\n    typedef signed @JBIG2_INT16_T@ int16_t;\n    typedef signed @JBIG2_INT8_T@ int8_t;\n#  endif /* JBIG2_REPLACE_STDINT */\n#endif /* HAVE_STDINT_H */\nEOF\n\necho \"  $AUTOMAKE --add-missing $AUTOMAKE_FLAGS\"\n$AUTOMAKE --add-missing --copy $AUTOMAKE_FLAGS\n\necho \"  autoconf\"\nautoconf\n\nif test -z \"$*\"; then\n        echo \"I am going to run ./configure with no arguments - if you wish \"\n        echo \"to pass any to it, please specify them on the $0 command line.\"\nelse\n\techo \"running ./configure $@\"\nfi\n\n$srcdir/configure \"$@\" && echo\n"
  },
  {
    "path": "ext/jbig2dec/config_win32.h",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n/* configuration header file for compiling under Microsoft Windows */\n\n/* update package version here */\n#define PACKAGE \"jbig2dec\"\n#define VERSION \"0.12\"\n\n#if defined(_MSC_VER) || (defined(__BORLANDC__) && defined(__WIN32__))\n  /* Microsoft Visual C++ or Borland C++ */\n  typedef signed char             int8_t;\n  typedef short int               int16_t;\n  typedef int                     int32_t;\n  typedef __int64                 int64_t;\n\n  typedef unsigned char             uint8_t;\n  typedef unsigned short int        uint16_t;\n  typedef unsigned int              uint32_t;\n  /* no uint64_t */\n\n#  if defined(_MSC_VER)\n#   if _MSC_VER < 1500\t/* VS 2008 has vsnprintf */\n#    define vsnprintf _vsnprintf\n#   endif\n#  endif\n\n#  if defined(_MSC_VER) && _MSC_VER>=1900 /* VS 2014 and later have (finally) snprintf */\n#    define STDC99\n#  else\n#    define snprintf _snprintf\n#  endif\n\n#endif /* _MSC_VER */\n"
  },
  {
    "path": "ext/jbig2dec/configure.ac",
    "content": "# Process this file with autoconf to produce a configure script.\n\nAC_INIT([jbig2dec], [0.12], [jbig2-dev@ghostscript.com])\nAC_PREREQ(2.53)\nAC_CONFIG_SRCDIR([jbig2dec.c])\n\nAM_INIT_AUTOMAKE([-Wall])\nAM_CONFIG_HEADER(config.h)\n\ndnl Library versioning - Adapted from the libtool info page\ndnl\ndnl 1. If source has changed at all: increment revision\ndnl 2. If the ABI changed: increment current, reset revision to 0\ndnl 3. If interfaces have been added since last public release: increment age\ndnl 4. If interfaces have been removed: reset age to 0\n\nAC_SUBST([JBIG2DEC_LT_CURRENT], [0])\nAC_SUBST([JBIG2DEC_LT_REVISION], [0])\nAC_SUBST([JBIG2DEC_LT_AGE], [0])\n\n# Checks for programs.\nAC_PROG_CC\nAM_PROG_CC_C_O\nAC_LIBTOOL_WIN32_DLL\nAC_PROG_LIBTOOL\n\n# platform specific compiler flags\nif test \"x$GCC\" = xyes; then\n  CFLAGS=\"$CFLAGS -Wall\"\nfi\n\n# Checks for libraries.\ndnl by default we want png support if possible\nAC_ARG_WITH([libpng], \n  AC_HELP_STRING([--with-libpng[=prefix]],\n    [include support for png output (if libpng is available)]),\n  [ac_cv_want_libpng=\"$withval\"], [ac_cv_want_libpng=\"yes\"])\nsave_cflags=\"$CFLAGS\"\nsave_ldflags=\"$LDFLAGS\"\nhave_libpng=\"no\"\nif test \"x$ac_cv_want_libpng\" != \"xno\"; then\n  if test \"x$ac_cv_want_libpng\" != \"xyes\"; then\n    dnl if it's not yes or no, treat as a prefix\n    CFLAGS=\"$CFLAGS -I$ac_cv_want_libpng/include\"\n    LDFLAGS=\"$LDFLAGS -L$ac_cv_want_libpng/lib\"\n  fi\n  dnl libpng requires pow() which may be in libm\n  AC_SEARCH_LIBS([pow], [m])\n  AC_CHECK_LIB([png], [png_create_write_struct], [\n    AC_CHECK_LIB([z], [deflate], [\n      AC_DEFINE(HAVE_LIBPNG, 1, [Define if libpng is available (-lpng)])\n      PNG_LIBS=\"-lpng -lz\"\n      AC_LIBOBJ([jbig2_image_png])\n      have_libpng=\"yes\"\n    ])\n  ])\nfi\ndnl restore (possibly changed) flags if we didn't find working libpng\nif test \"x$have_libpng\" != \"xyes\"; then\n  CFLAGS=\"$save_cflags\"\n  LDFLAGS=\"$save_ldflags\"\nfi\nAC_SUBST(PNG_LIBS)\n\n# Checks for header files.\nAC_HEADER_STDC\nAC_CHECK_HEADERS([libintl.h stddef.h unistd.h strings.h])\n\ndnl We assume the fixed-size types from stdint.h. If that header is\ndnl not available, look for the same types in a few other headers. \ndnl We also attempt to define them ourselves, but only use those if\ndnl the native versions aren't available. The substitutions happen \ndnl in a file config_types.h, whose template is created by autogen.sh\n\nstdint_types_in=\"no_replacement_found\"\nstdint_types_discovered=\"yes\"\nAC_CHECK_SIZEOF(char)\nAC_CHECK_SIZEOF(short)\nAC_CHECK_SIZEOF(int)\nAC_CHECK_SIZEOF(long)\ncase 1 in\n  $ac_cv_sizeof_char) int8_type=\"char\";;\n  *) stdint_types_discovered=\"no\"\nesac\ncase 2 in\n  $ac_cv_sizeof_short) int16_type=\"short\";;\n  $ac_cv_sizeof_char)  int16_type=\"char\";;\n  $ac_cv_sizeof_int)   int16_type=\"char\";;\n  *) stdint_types_discovered=\"no\";;\nesac\ncase 4 in\n  $ac_cv_sizeof_int)   int32_type=\"int\";;\n  $ac_cv_sizeof_long)  int32_type=\"long\";;\n  $ac_cv_sizeof_short) int32_type=\"short\";;\n  *) stdint_types_discovered=\"no\";;\nesac\nAC_CHECK_HEADER([stdint.h])\nif test \"x$ac_cv_header_stdint_h\" != \"xyes\"; then\n  for include in sys/types.h inttypes.h sys/inttypes.h sys/int_types.h ; do\n    AC_MSG_CHECKING([for uint32_t in $include])\n    AC_TRY_COMPILE([#include <$include>], [uint32_t canary;], [\n      AC_MSG_RESULT([yes])\n      stdint_types_in=\"$include\"\n      break;\n    ], AC_MSG_RESULT([no])\n    )\n  done\n  if test \"x$stdint_types_in\" != \"xno_replacement_found\"; then\n    AC_MSG_RESULT([Adding $stdint_types_in to config header for stdint types])\n    AC_DEFINE([JBIG2_REPLACE_STDINT_H],,\n      [set by configure if an alternate header with the stdint.h types is found])\n  elif test \"x$stdint_types_discovered\" = \"xno\"; then\n    AC_MSG_ERROR([\nUnable to find suitable definitions of the stdint.h types (uint32_t and friends)\nYou will have to define these yourself in a separate header. \nSee config_win32.h for an example.\n    ])\n  fi\nfi\nAC_SUBST(JBIG2_INT32_T, [$int32_type])\nAC_SUBST(JBIG2_INT16_T, [$int16_type])\nAC_SUBST(JBIG2_INT8_T,  [$int8_type])\nAC_SUBST(JBIG2_STDINT_H, [$stdint_types_in])\n\n# Checks for typedefs, structures, and compiler characteristics.\nAC_C_CONST\nAC_TYPE_SIZE_T\nAC_C_BIGENDIAN\n\n# Checks for library functions.\nAC_FUNC_MEMCMP\ndnl we use realloc() but don't depend on the zero-length behavior\ndnl tested by AC_FUNC_REALLOC\nAC_REPLACE_FUNCS([snprintf])\n\nAC_CHECK_FUNCS([memset strdup])\n\ndnl use our included getopt if the system doesn't have getopt_long()\nAC_CHECK_FUNC(getopt_long, \n\tAC_DEFINE(HAVE_GETOPT_LONG,,\n\t  [Define if the local libc includes getopt_long()]\n\t),[\n\tAC_LIBOBJ([getopt])\n\tAC_LIBOBJ([getopt1])\n])\n\n# generate output\nAC_CONFIG_FILES([Makefile config_types.h])\nAC_OUTPUT\n"
  },
  {
    "path": "ext/jbig2dec/getopt.c",
    "content": "/* Getopt for GNU.\n   NOTE: getopt is now part of the C library, so if you don't know what\n   \"Keep this file name-space clean\" means, talk to drepper@gnu.org\n   before changing it!\n   Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001\n   \tFree Software Foundation, Inc.\n   This file is part of the GNU C Library.\n\n   The GNU C Library is free software; you can redistribute it and/or\n   modify it under the terms of the GNU Lesser General Public\n   License as published by the Free Software Foundation; either\n   version 2.1 of the License, or (at your option) any later version.\n\n   The GNU C Library is distributed in the hope that it will be useful,\n   but WITHOUT ANY WARRANTY; without even the implied warranty of\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n   Lesser General Public License for more details.\n\n   You should have received a copy of the GNU Lesser General Public\n   License along with the GNU C Library; if not, write to the Free\n   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA\n   02111-1307 USA.  */\n\f\n/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.\n   Ditto for AIX 3.2 and <stdlib.h>.  */\n#ifndef _NO_PROTO\n# define _NO_PROTO\n#endif\n\n#ifdef HAVE_CONFIG_H\n# include <config.h>\n#endif\n\n#if !defined __STDC__ || !__STDC__\n/* This is a separate conditional since some stdc systems\n   reject `defined (const)'.  */\n# ifndef const\n#  define const\n# endif\n#endif\n\n#include <stdio.h>\n\n/* Comment out all this code if we are using the GNU C Library, and are not\n   actually compiling the library itself.  This code is part of the GNU C\n   Library, but also included in many other GNU distributions.  Compiling\n   and linking in this code is a waste when using the GNU C library\n   (especially if it is a shared library).  Rather than having every GNU\n   program understand `configure --with-gnu-libc' and omit the object files,\n   it is simpler to just do this in the source for each such file.  */\n\n#define GETOPT_INTERFACE_VERSION 2\n#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2\n# include <gnu-versions.h>\n# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION\n#  define ELIDE_CODE\n# endif\n#endif\n\n#ifndef ELIDE_CODE\n\n\n/* This needs to come after some library #include\n   to get __GNU_LIBRARY__ defined.  */\n#ifdef\t__GNU_LIBRARY__\n/* Don't include stdlib.h for non-GNU C libraries because some of them\n   contain conflicting prototypes for getopt.  */\n# include <stdlib.h>\n# include <unistd.h>\n#endif\t/* GNU C library.  */\n\n#ifdef VMS\n# include <unixlib.h>\n# if HAVE_STRING_H - 0\n#  include <string.h>\n# endif\n#endif\n\n#ifndef _\n/* This is for other GNU distributions with internationalized messages.  */\n# if defined HAVE_LIBINTL_H || defined _LIBC\n#  include <libintl.h>\n#  ifndef _\n#   define _(msgid)\tgettext (msgid)\n#  endif\n# else\n#  define _(msgid)\t(msgid)\n# endif\n#endif\n\n/* This version of `getopt' appears to the caller like standard Unix `getopt'\n   but it behaves differently for the user, since it allows the user\n   to intersperse the options with the other arguments.\n\n   As `getopt' works, it permutes the elements of ARGV so that,\n   when it is done, all the options precede everything else.  Thus\n   all application programs are extended to handle flexible argument order.\n\n   Setting the environment variable POSIXLY_CORRECT disables permutation.\n   Then the behavior is completely standard.\n\n   GNU application programs can use a third alternative mode in which\n   they can distinguish the relative order of options and other arguments.  */\n\n#include \"getopt.h\"\n\n/* For communication from `getopt' to the caller.\n   When `getopt' finds an option that takes an argument,\n   the argument value is returned here.\n   Also, when `ordering' is RETURN_IN_ORDER,\n   each non-option ARGV-element is returned here.  */\n\nchar *optarg;\n\n/* Index in ARGV of the next element to be scanned.\n   This is used for communication to and from the caller\n   and for communication between successive calls to `getopt'.\n\n   On entry to `getopt', zero means this is the first call; initialize.\n\n   When `getopt' returns -1, this is the index of the first of the\n   non-option elements that the caller should itself scan.\n\n   Otherwise, `optind' communicates from one call to the next\n   how much of ARGV has been scanned so far.  */\n\n/* 1003.2 says this must be 1 before any call.  */\nint optind = 1;\n\n/* Formerly, initialization of getopt depended on optind==0, which\n   causes problems with re-calling getopt as programs generally don't\n   know that. */\n\nint __getopt_initialized;\n\n/* The next char to be scanned in the option-element\n   in which the last option character we returned was found.\n   This allows us to pick up the scan where we left off.\n\n   If this is zero, or a null string, it means resume the scan\n   by advancing to the next ARGV-element.  */\n\nstatic char *nextchar;\n\n/* Callers store zero here to inhibit the error message\n   for unrecognized options.  */\n\nint opterr = 1;\n\n/* Set to an option character which was unrecognized.\n   This must be initialized on some systems to avoid linking in the\n   system's own getopt implementation.  */\n\nint optopt = '?';\n\n/* Describe how to deal with options that follow non-option ARGV-elements.\n\n   If the caller did not specify anything,\n   the default is REQUIRE_ORDER if the environment variable\n   POSIXLY_CORRECT is defined, PERMUTE otherwise.\n\n   REQUIRE_ORDER means don't recognize them as options;\n   stop option processing when the first non-option is seen.\n   This is what Unix does.\n   This mode of operation is selected by either setting the environment\n   variable POSIXLY_CORRECT, or using `+' as the first character\n   of the list of option characters.\n\n   PERMUTE is the default.  We permute the contents of ARGV as we scan,\n   so that eventually all the non-options are at the end.  This allows options\n   to be given in any order, even with programs that were not written to\n   expect this.\n\n   RETURN_IN_ORDER is an option available to programs that were written\n   to expect options and other ARGV-elements in any order and that care about\n   the ordering of the two.  We describe each non-option ARGV-element\n   as if it were the argument of an option with character code 1.\n   Using `-' as the first character of the list of option characters\n   selects this mode of operation.\n\n   The special argument `--' forces an end of option-scanning regardless\n   of the value of `ordering'.  In the case of RETURN_IN_ORDER, only\n   `--' can cause `getopt' to return -1 with `optind' != ARGC.  */\n\nstatic enum\n{\n  REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER\n} ordering;\n\n/* Value of POSIXLY_CORRECT environment variable.  */\nstatic char *posixly_correct;\n\f\n#ifdef\t__GNU_LIBRARY__\n/* We want to avoid inclusion of string.h with non-GNU libraries\n   because there are many ways it can cause trouble.\n   On some systems, it contains special magic macros that don't work\n   in GCC.  */\n# include <string.h>\n# define my_index\tstrchr\n#else\n\n# if HAVE_STRING_H\n#  include <string.h>\n# else\n#  include <strings.h>\n# endif\n\n/* Avoid depending on library functions or files\n   whose names are inconsistent.  */\n\n#ifndef getenv\nextern char *getenv ();\n#endif\n\nstatic char *\nmy_index (str, chr)\n     const char *str;\n     int chr;\n{\n  while (*str)\n    {\n      if (*str == chr)\n\treturn (char *) str;\n      str++;\n    }\n  return 0;\n}\n\n/* If using GCC, we can safely declare strlen this way.\n   If not using GCC, it is ok not to declare it.  */\n#ifdef __GNUC__\n/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.\n   That was relevant to code that was here before.  */\n# if (!defined __STDC__ || !__STDC__) && !defined strlen\n/* gcc with -traditional declares the built-in strlen to return int,\n   and has done so at least since version 2.4.5. -- rms.  */\nextern int strlen (const char *);\n# endif /* not __STDC__ */\n#endif /* __GNUC__ */\n\n#endif /* not __GNU_LIBRARY__ */\n\f\n/* Handle permutation of arguments.  */\n\n/* Describe the part of ARGV that contains non-options that have\n   been skipped.  `first_nonopt' is the index in ARGV of the first of them;\n   `last_nonopt' is the index after the last of them.  */\n\nstatic int first_nonopt;\nstatic int last_nonopt;\n\n#ifdef _LIBC\n/* Stored original parameters.\n   XXX This is no good solution.  We should rather copy the args so\n   that we can compare them later.  But we must not use malloc(3).  */\nextern int __libc_argc;\nextern char **__libc_argv;\n\n/* Bash 2.0 gives us an environment variable containing flags\n   indicating ARGV elements that should not be considered arguments.  */\n\n# ifdef USE_NONOPTION_FLAGS\n/* Defined in getopt_init.c  */\nextern char *__getopt_nonoption_flags;\n\nstatic int nonoption_flags_max_len;\nstatic int nonoption_flags_len;\n# endif\n\n# ifdef USE_NONOPTION_FLAGS\n#  define SWAP_FLAGS(ch1, ch2) \\\n  if (nonoption_flags_len > 0)\t\t\t\t\t\t      \\\n    {\t\t\t\t\t\t\t\t\t      \\\n      char __tmp = __getopt_nonoption_flags[ch1];\t\t\t      \\\n      __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2];\t      \\\n      __getopt_nonoption_flags[ch2] = __tmp;\t\t\t\t      \\\n    }\n# else\n#  define SWAP_FLAGS(ch1, ch2)\n# endif\n#else\t/* !_LIBC */\n# define SWAP_FLAGS(ch1, ch2)\n#endif\t/* _LIBC */\n\n/* Exchange two adjacent subsequences of ARGV.\n   One subsequence is elements [first_nonopt,last_nonopt)\n   which contains all the non-options that have been skipped so far.\n   The other is elements [last_nonopt,optind), which contains all\n   the options processed since those non-options were skipped.\n\n   `first_nonopt' and `last_nonopt' are relocated so that they describe\n   the new indices of the non-options in ARGV after they are moved.  */\n\n#if defined __STDC__ && __STDC__\nstatic void exchange (char **);\n#endif\n\nstatic void\nexchange (argv)\n     char **argv;\n{\n  int bottom = first_nonopt;\n  int middle = last_nonopt;\n  int top = optind;\n  char *tem;\n\n  /* Exchange the shorter segment with the far end of the longer segment.\n     That puts the shorter segment into the right place.\n     It leaves the longer segment in the right place overall,\n     but it consists of two parts that need to be swapped next.  */\n\n#if defined _LIBC && defined USE_NONOPTION_FLAGS\n  /* First make sure the handling of the `__getopt_nonoption_flags'\n     string can work normally.  Our top argument must be in the range\n     of the string.  */\n  if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len)\n    {\n      /* We must extend the array.  The user plays games with us and\n\t presents new arguments.  */\n      char *new_str = malloc (top + 1);\n      if (new_str == NULL)\n\tnonoption_flags_len = nonoption_flags_max_len = 0;\n      else\n\t{\n\t  memset (__mempcpy (new_str, __getopt_nonoption_flags,\n\t\t\t     nonoption_flags_max_len),\n\t\t  '\\0', top + 1 - nonoption_flags_max_len);\n\t  nonoption_flags_max_len = top + 1;\n\t  __getopt_nonoption_flags = new_str;\n\t}\n    }\n#endif\n\n  while (top > middle && middle > bottom)\n    {\n      if (top - middle > middle - bottom)\n\t{\n\t  /* Bottom segment is the short one.  */\n\t  int len = middle - bottom;\n\t  register int i;\n\n\t  /* Swap it with the top part of the top segment.  */\n\t  for (i = 0; i < len; i++)\n\t    {\n\t      tem = argv[bottom + i];\n\t      argv[bottom + i] = argv[top - (middle - bottom) + i];\n\t      argv[top - (middle - bottom) + i] = tem;\n\t      SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);\n\t    }\n\t  /* Exclude the moved bottom segment from further swapping.  */\n\t  top -= len;\n\t}\n      else\n\t{\n\t  /* Top segment is the short one.  */\n\t  int len = top - middle;\n\t  register int i;\n\n\t  /* Swap it with the bottom part of the bottom segment.  */\n\t  for (i = 0; i < len; i++)\n\t    {\n\t      tem = argv[bottom + i];\n\t      argv[bottom + i] = argv[middle + i];\n\t      argv[middle + i] = tem;\n\t      SWAP_FLAGS (bottom + i, middle + i);\n\t    }\n\t  /* Exclude the moved top segment from further swapping.  */\n\t  bottom += len;\n\t}\n    }\n\n  /* Update records for the slots the non-options now occupy.  */\n\n  first_nonopt += (optind - last_nonopt);\n  last_nonopt = optind;\n}\n\n/* Initialize the internal data when the first call is made.  */\n\n#if defined __STDC__ && __STDC__\nstatic const char *_getopt_initialize (int, char *const *, const char *);\n#endif\nstatic const char *\n_getopt_initialize (argc, argv, optstring)\n     int argc;\n     char *const *argv;\n     const char *optstring;\n{\n  /* Start processing options with ARGV-element 1 (since ARGV-element 0\n     is the program name); the sequence of previously skipped\n     non-option ARGV-elements is empty.  */\n\n  first_nonopt = last_nonopt = optind;\n\n  nextchar = NULL;\n\n  posixly_correct = getenv (\"POSIXLY_CORRECT\");\n\n  /* Determine how to handle the ordering of options and nonoptions.  */\n\n  if (optstring[0] == '-')\n    {\n      ordering = RETURN_IN_ORDER;\n      ++optstring;\n    }\n  else if (optstring[0] == '+')\n    {\n      ordering = REQUIRE_ORDER;\n      ++optstring;\n    }\n  else if (posixly_correct != NULL)\n    ordering = REQUIRE_ORDER;\n  else\n    ordering = PERMUTE;\n\n#if defined _LIBC && defined USE_NONOPTION_FLAGS\n  if (posixly_correct == NULL\n      && argc == __libc_argc && argv == __libc_argv)\n    {\n      if (nonoption_flags_max_len == 0)\n\t{\n\t  if (__getopt_nonoption_flags == NULL\n\t      || __getopt_nonoption_flags[0] == '\\0')\n\t    nonoption_flags_max_len = -1;\n\t  else\n\t    {\n\t      const char *orig_str = __getopt_nonoption_flags;\n\t      int len = nonoption_flags_max_len = strlen (orig_str);\n\t      if (nonoption_flags_max_len < argc)\n\t\tnonoption_flags_max_len = argc;\n\t      __getopt_nonoption_flags =\n\t\t(char *) malloc (nonoption_flags_max_len);\n\t      if (__getopt_nonoption_flags == NULL)\n\t\tnonoption_flags_max_len = -1;\n\t      else\n\t\tmemset (__mempcpy (__getopt_nonoption_flags, orig_str, len),\n\t\t\t'\\0', nonoption_flags_max_len - len);\n\t    }\n\t}\n      nonoption_flags_len = nonoption_flags_max_len;\n    }\n  else\n    nonoption_flags_len = 0;\n#endif\n\n  return optstring;\n}\n\f\n/* Scan elements of ARGV (whose length is ARGC) for option characters\n   given in OPTSTRING.\n\n   If an element of ARGV starts with '-', and is not exactly \"-\" or \"--\",\n   then it is an option element.  The characters of this element\n   (aside from the initial '-') are option characters.  If `getopt'\n   is called repeatedly, it returns successively each of the option characters\n   from each of the option elements.\n\n   If `getopt' finds another option character, it returns that character,\n   updating `optind' and `nextchar' so that the next call to `getopt' can\n   resume the scan with the following option character or ARGV-element.\n\n   If there are no more option characters, `getopt' returns -1.\n   Then `optind' is the index in ARGV of the first ARGV-element\n   that is not an option.  (The ARGV-elements have been permuted\n   so that those that are not options now come last.)\n\n   OPTSTRING is a string containing the legitimate option characters.\n   If an option character is seen that is not listed in OPTSTRING,\n   return '?' after printing an error message.  If you set `opterr' to\n   zero, the error message is suppressed but we still return '?'.\n\n   If a char in OPTSTRING is followed by a colon, that means it wants an arg,\n   so the following text in the same ARGV-element, or the text of the following\n   ARGV-element, is returned in `optarg'.  Two colons mean an option that\n   wants an optional arg; if there is text in the current ARGV-element,\n   it is returned in `optarg', otherwise `optarg' is set to zero.\n\n   If OPTSTRING starts with `-' or `+', it requests different methods of\n   handling the non-option ARGV-elements.\n   See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.\n\n   Long-named options begin with `--' instead of `-'.\n   Their names may be abbreviated as long as the abbreviation is unique\n   or is an exact match for some defined option.  If they have an\n   argument, it follows the option name in the same ARGV-element, separated\n   from the option name by a `=', or else the in next ARGV-element.\n   When `getopt' finds a long-named option, it returns 0 if that option's\n   `flag' field is nonzero, the value of the option's `val' field\n   if the `flag' field is zero.\n\n   The elements of ARGV aren't really const, because we permute them.\n   But we pretend they're const in the prototype to be compatible\n   with other systems.\n\n   LONGOPTS is a vector of `struct option' terminated by an\n   element containing a name which is zero.\n\n   LONGIND returns the index in LONGOPT of the long-named option found.\n   It is only valid when a long-named option has been found by the most\n   recent call.\n\n   If LONG_ONLY is nonzero, '-' as well as '--' can introduce\n   long-named options.  */\n\nint\n_getopt_internal (argc, argv, optstring, longopts, longind, long_only)\n     int argc;\n     char *const *argv;\n     const char *optstring;\n     const struct option *longopts;\n     int *longind;\n     int long_only;\n{\n  int print_errors = opterr;\n  if (optstring[0] == ':')\n    print_errors = 0;\n\n  if (argc < 1)\n    return -1;\n\n  optarg = NULL;\n\n  if (optind == 0 || !__getopt_initialized)\n    {\n      if (optind == 0)\n\toptind = 1;\t/* Don't scan ARGV[0], the program name.  */\n      optstring = _getopt_initialize (argc, argv, optstring);\n      __getopt_initialized = 1;\n    }\n\n  /* Test whether ARGV[optind] points to a non-option argument.\n     Either it does not have option syntax, or there is an environment flag\n     from the shell indicating it is not an option.  The later information\n     is only used when the used in the GNU libc.  */\n#if defined _LIBC && defined USE_NONOPTION_FLAGS\n# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\\0'\t      \\\n\t\t      || (optind < nonoption_flags_len\t\t\t      \\\n\t\t\t  && __getopt_nonoption_flags[optind] == '1'))\n#else\n# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\\0')\n#endif\n\n  if (nextchar == NULL || *nextchar == '\\0')\n    {\n      /* Advance to the next ARGV-element.  */\n\n      /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been\n\t moved back by the user (who may also have changed the arguments).  */\n      if (last_nonopt > optind)\n\tlast_nonopt = optind;\n      if (first_nonopt > optind)\n\tfirst_nonopt = optind;\n\n      if (ordering == PERMUTE)\n\t{\n\t  /* If we have just processed some options following some non-options,\n\t     exchange them so that the options come first.  */\n\n\t  if (first_nonopt != last_nonopt && last_nonopt != optind)\n\t    exchange ((char **) argv);\n\t  else if (last_nonopt != optind)\n\t    first_nonopt = optind;\n\n\t  /* Skip any additional non-options\n\t     and extend the range of non-options previously skipped.  */\n\n\t  while (optind < argc && NONOPTION_P)\n\t    optind++;\n\t  last_nonopt = optind;\n\t}\n\n      /* The special ARGV-element `--' means premature end of options.\n\t Skip it like a null option,\n\t then exchange with previous non-options as if it were an option,\n\t then skip everything else like a non-option.  */\n\n      if (optind != argc && !strcmp (argv[optind], \"--\"))\n\t{\n\t  optind++;\n\n\t  if (first_nonopt != last_nonopt && last_nonopt != optind)\n\t    exchange ((char **) argv);\n\t  else if (first_nonopt == last_nonopt)\n\t    first_nonopt = optind;\n\t  last_nonopt = argc;\n\n\t  optind = argc;\n\t}\n\n      /* If we have done all the ARGV-elements, stop the scan\n\t and back over any non-options that we skipped and permuted.  */\n\n      if (optind == argc)\n\t{\n\t  /* Set the next-arg-index to point at the non-options\n\t     that we previously skipped, so the caller will digest them.  */\n\t  if (first_nonopt != last_nonopt)\n\t    optind = first_nonopt;\n\t  return -1;\n\t}\n\n      /* If we have come to a non-option and did not permute it,\n\t either stop the scan or describe it to the caller and pass it by.  */\n\n      if (NONOPTION_P)\n\t{\n\t  if (ordering == REQUIRE_ORDER)\n\t    return -1;\n\t  optarg = argv[optind++];\n\t  return 1;\n\t}\n\n      /* We have found another option-ARGV-element.\n\t Skip the initial punctuation.  */\n\n      nextchar = (argv[optind] + 1\n\t\t  + (longopts != NULL && argv[optind][1] == '-'));\n    }\n\n  /* Decode the current option-ARGV-element.  */\n\n  /* Check whether the ARGV-element is a long option.\n\n     If long_only and the ARGV-element has the form \"-f\", where f is\n     a valid short option, don't consider it an abbreviated form of\n     a long option that starts with f.  Otherwise there would be no\n     way to give the -f short option.\n\n     On the other hand, if there's a long option \"fubar\" and\n     the ARGV-element is \"-fu\", do consider that an abbreviation of\n     the long option, just like \"--fu\", and not \"-f\" with arg \"u\".\n\n     This distinction seems to be the most useful approach.  */\n\n  if (longopts != NULL\n      && (argv[optind][1] == '-'\n\t  || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))\n    {\n      char *nameend;\n      const struct option *p;\n      const struct option *pfound = NULL;\n      int exact = 0;\n      int ambig = 0;\n      int indfound = -1;\n      int option_index;\n\n      for (nameend = nextchar; *nameend && *nameend != '='; nameend++)\n\t/* Do nothing.  */ ;\n\n      /* Test all long options for either exact match\n\t or abbreviated matches.  */\n      for (p = longopts, option_index = 0; p->name; p++, option_index++)\n\tif (!strncmp (p->name, nextchar, nameend - nextchar))\n\t  {\n\t    if ((unsigned int) (nameend - nextchar)\n\t\t== (unsigned int) strlen (p->name))\n\t      {\n\t\t/* Exact match found.  */\n\t\tpfound = p;\n\t\tindfound = option_index;\n\t\texact = 1;\n\t\tbreak;\n\t      }\n\t    else if (pfound == NULL)\n\t      {\n\t\t/* First nonexact match found.  */\n\t\tpfound = p;\n\t\tindfound = option_index;\n\t      }\n\t    else if (long_only\n\t\t     || pfound->has_arg != p->has_arg\n\t\t     || pfound->flag != p->flag\n\t\t     || pfound->val != p->val)\n\t      /* Second or later nonexact match found.  */\n\t      ambig = 1;\n\t  }\n\n      if (ambig && !exact)\n\t{\n\t  if (print_errors)\n\t    fprintf (stderr, _(\"%s: option `%s' is ambiguous\\n\"),\n\t\t     argv[0], argv[optind]);\n\t  nextchar += strlen (nextchar);\n\t  optind++;\n\t  optopt = 0;\n\t  return '?';\n\t}\n\n      if (pfound != NULL)\n\t{\n\t  option_index = indfound;\n\t  optind++;\n\t  if (*nameend)\n\t    {\n\t      /* Don't test has_arg with >, because some C compilers don't\n\t\t allow it to be used on enums.  */\n\t      if (pfound->has_arg)\n\t\toptarg = nameend + 1;\n\t      else\n\t\t{\n\t\t  if (print_errors)\n\t\t    {\n\t\t      if (argv[optind - 1][1] == '-')\n\t\t\t/* --option */\n\t\t\tfprintf (stderr,\n\t\t\t\t _(\"%s: option `--%s' doesn't allow an argument\\n\"),\n\t\t\t\t argv[0], pfound->name);\n\t\t      else\n\t\t\t/* +option or -option */\n\t\t\tfprintf (stderr,\n\t\t\t\t _(\"%s: option `%c%s' doesn't allow an argument\\n\"),\n\t\t\t\t argv[0], argv[optind - 1][0], pfound->name);\n\t\t    }\n\n\t\t  nextchar += strlen (nextchar);\n\n\t\t  optopt = pfound->val;\n\t\t  return '?';\n\t\t}\n\t    }\n\t  else if (pfound->has_arg == 1)\n\t    {\n\t      if (optind < argc)\n\t\toptarg = argv[optind++];\n\t      else\n\t\t{\n\t\t  if (print_errors)\n\t\t    fprintf (stderr,\n\t\t\t   _(\"%s: option `%s' requires an argument\\n\"),\n\t\t\t   argv[0], argv[optind - 1]);\n\t\t  nextchar += strlen (nextchar);\n\t\t  optopt = pfound->val;\n\t\t  return optstring[0] == ':' ? ':' : '?';\n\t\t}\n\t    }\n\t  nextchar += strlen (nextchar);\n\t  if (longind != NULL)\n\t    *longind = option_index;\n\t  if (pfound->flag)\n\t    {\n\t      *(pfound->flag) = pfound->val;\n\t      return 0;\n\t    }\n\t  return pfound->val;\n\t}\n\n      /* Can't find it as a long option.  If this is not getopt_long_only,\n\t or the option starts with '--' or is not a valid short\n\t option, then it's an error.\n\t Otherwise interpret it as a short option.  */\n      if (!long_only || argv[optind][1] == '-'\n\t  || my_index (optstring, *nextchar) == NULL)\n\t{\n\t  if (print_errors)\n\t    {\n\t      if (argv[optind][1] == '-')\n\t\t/* --option */\n\t\tfprintf (stderr, _(\"%s: unrecognized option `--%s'\\n\"),\n\t\t\t argv[0], nextchar);\n\t      else\n\t\t/* +option or -option */\n\t\tfprintf (stderr, _(\"%s: unrecognized option `%c%s'\\n\"),\n\t\t\t argv[0], argv[optind][0], nextchar);\n\t    }\n\t  nextchar = (char *) \"\";\n\t  optind++;\n\t  optopt = 0;\n\t  return '?';\n\t}\n    }\n\n  /* Look at and handle the next short option-character.  */\n\n  {\n    char c = *nextchar++;\n    char *temp = my_index (optstring, c);\n\n    /* Increment `optind' when we start to process its last character.  */\n    if (*nextchar == '\\0')\n      ++optind;\n\n    if (temp == NULL || c == ':')\n      {\n\tif (print_errors)\n\t  {\n\t    if (posixly_correct)\n\t      /* 1003.2 specifies the format of this message.  */\n\t      fprintf (stderr, _(\"%s: illegal option -- %c\\n\"),\n\t\t       argv[0], c);\n\t    else\n\t      fprintf (stderr, _(\"%s: invalid option -- %c\\n\"),\n\t\t       argv[0], c);\n\t  }\n\toptopt = c;\n\treturn '?';\n      }\n    /* Convenience. Treat POSIX -W foo same as long option --foo */\n    if (temp[0] == 'W' && temp[1] == ';')\n      {\n\tchar *nameend;\n\tconst struct option *p;\n\tconst struct option *pfound = NULL;\n\tint exact = 0;\n\tint ambig = 0;\n\tint indfound = 0;\n\tint option_index;\n\n\t/* This is an option that requires an argument.  */\n\tif (*nextchar != '\\0')\n\t  {\n\t    optarg = nextchar;\n\t    /* If we end this ARGV-element by taking the rest as an arg,\n\t       we must advance to the next element now.  */\n\t    optind++;\n\t  }\n\telse if (optind == argc)\n\t  {\n\t    if (print_errors)\n\t      {\n\t\t/* 1003.2 specifies the format of this message.  */\n\t\tfprintf (stderr, _(\"%s: option requires an argument -- %c\\n\"),\n\t\t\t argv[0], c);\n\t      }\n\t    optopt = c;\n\t    if (optstring[0] == ':')\n\t      c = ':';\n\t    else\n\t      c = '?';\n\t    return c;\n\t  }\n\telse\n\t  /* We already incremented `optind' once;\n\t     increment it again when taking next ARGV-elt as argument.  */\n\t  optarg = argv[optind++];\n\n\t/* optarg is now the argument, see if it's in the\n\t   table of longopts.  */\n\n\tfor (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++)\n\t  /* Do nothing.  */ ;\n\n\t/* Test all long options for either exact match\n\t   or abbreviated matches.  */\n\tfor (p = longopts, option_index = 0; p->name; p++, option_index++)\n\t  if (!strncmp (p->name, nextchar, nameend - nextchar))\n\t    {\n\t      if ((unsigned int) (nameend - nextchar) == strlen (p->name))\n\t\t{\n\t\t  /* Exact match found.  */\n\t\t  pfound = p;\n\t\t  indfound = option_index;\n\t\t  exact = 1;\n\t\t  break;\n\t\t}\n\t      else if (pfound == NULL)\n\t\t{\n\t\t  /* First nonexact match found.  */\n\t\t  pfound = p;\n\t\t  indfound = option_index;\n\t\t}\n\t      else\n\t\t/* Second or later nonexact match found.  */\n\t\tambig = 1;\n\t    }\n\tif (ambig && !exact)\n\t  {\n\t    if (print_errors)\n\t      fprintf (stderr, _(\"%s: option `-W %s' is ambiguous\\n\"),\n\t\t       argv[0], argv[optind]);\n\t    nextchar += strlen (nextchar);\n\t    optind++;\n\t    return '?';\n\t  }\n\tif (pfound != NULL)\n\t  {\n\t    option_index = indfound;\n\t    if (*nameend)\n\t      {\n\t\t/* Don't test has_arg with >, because some C compilers don't\n\t\t   allow it to be used on enums.  */\n\t\tif (pfound->has_arg)\n\t\t  optarg = nameend + 1;\n\t\telse\n\t\t  {\n\t\t    if (print_errors)\n\t\t      fprintf (stderr, _(\"\\\n%s: option `-W %s' doesn't allow an argument\\n\"),\n\t\t\t       argv[0], pfound->name);\n\n\t\t    nextchar += strlen (nextchar);\n\t\t    return '?';\n\t\t  }\n\t      }\n\t    else if (pfound->has_arg == 1)\n\t      {\n\t\tif (optind < argc)\n\t\t  optarg = argv[optind++];\n\t\telse\n\t\t  {\n\t\t    if (print_errors)\n\t\t      fprintf (stderr,\n\t\t\t       _(\"%s: option `%s' requires an argument\\n\"),\n\t\t\t       argv[0], argv[optind - 1]);\n\t\t    nextchar += strlen (nextchar);\n\t\t    return optstring[0] == ':' ? ':' : '?';\n\t\t  }\n\t      }\n\t    nextchar += strlen (nextchar);\n\t    if (longind != NULL)\n\t      *longind = option_index;\n\t    if (pfound->flag)\n\t      {\n\t\t*(pfound->flag) = pfound->val;\n\t\treturn 0;\n\t      }\n\t    return pfound->val;\n\t  }\n\t  nextchar = NULL;\n\t  return 'W';\t/* Let the application handle it.   */\n      }\n    if (temp[1] == ':')\n      {\n\tif (temp[2] == ':')\n\t  {\n\t    /* This is an option that accepts an argument optionally.  */\n\t    if (*nextchar != '\\0')\n\t      {\n\t\toptarg = nextchar;\n\t\toptind++;\n\t      }\n\t    else\n\t      optarg = NULL;\n\t    nextchar = NULL;\n\t  }\n\telse\n\t  {\n\t    /* This is an option that requires an argument.  */\n\t    if (*nextchar != '\\0')\n\t      {\n\t\toptarg = nextchar;\n\t\t/* If we end this ARGV-element by taking the rest as an arg,\n\t\t   we must advance to the next element now.  */\n\t\toptind++;\n\t      }\n\t    else if (optind == argc)\n\t      {\n\t\tif (print_errors)\n\t\t  {\n\t\t    /* 1003.2 specifies the format of this message.  */\n\t\t    fprintf (stderr,\n\t\t\t     _(\"%s: option requires an argument -- %c\\n\"),\n\t\t\t     argv[0], c);\n\t\t  }\n\t\toptopt = c;\n\t\tif (optstring[0] == ':')\n\t\t  c = ':';\n\t\telse\n\t\t  c = '?';\n\t      }\n\t    else\n\t      /* We already incremented `optind' once;\n\t\t increment it again when taking next ARGV-elt as argument.  */\n\t      optarg = argv[optind++];\n\t    nextchar = NULL;\n\t  }\n      }\n    return c;\n  }\n}\n\nint\ngetopt (argc, argv, optstring)\n     int argc;\n     char *const *argv;\n     const char *optstring;\n{\n  return _getopt_internal (argc, argv, optstring,\n\t\t\t   (const struct option *) 0,\n\t\t\t   (int *) 0,\n\t\t\t   0);\n}\n\n#endif\t/* Not ELIDE_CODE.  */\n\f\n#ifdef TEST\n\n/* Compile with -DTEST to make an executable for use in testing\n   the above definition of `getopt'.  */\n\nint\nmain (argc, argv)\n     int argc;\n     char **argv;\n{\n  int c;\n  int digit_optind = 0;\n\n  while (1)\n    {\n      int this_option_optind = optind ? optind : 1;\n\n      c = getopt (argc, argv, \"abc:d:0123456789\");\n      if (c == -1)\n\tbreak;\n\n      switch (c)\n\t{\n\tcase '0':\n\tcase '1':\n\tcase '2':\n\tcase '3':\n\tcase '4':\n\tcase '5':\n\tcase '6':\n\tcase '7':\n\tcase '8':\n\tcase '9':\n\t  if (digit_optind != 0 && digit_optind != this_option_optind)\n\t    printf (\"digits occur in two different argv-elements.\\n\");\n\t  digit_optind = this_option_optind;\n\t  printf (\"option %c\\n\", c);\n\t  break;\n\n\tcase 'a':\n\t  printf (\"option a\\n\");\n\t  break;\n\n\tcase 'b':\n\t  printf (\"option b\\n\");\n\t  break;\n\n\tcase 'c':\n\t  printf (\"option c with value `%s'\\n\", optarg);\n\t  break;\n\n\tcase '?':\n\t  break;\n\n\tdefault:\n\t  printf (\"?? getopt returned character code 0%o ??\\n\", c);\n\t}\n    }\n\n  if (optind < argc)\n    {\n      printf (\"non-option ARGV-elements: \");\n      while (optind < argc)\n\tprintf (\"%s \", argv[optind++]);\n      printf (\"\\n\");\n    }\n\n  exit (0);\n}\n\n#endif /* TEST */\n"
  },
  {
    "path": "ext/jbig2dec/getopt.h",
    "content": "/* Declarations for getopt.\n   Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc.\n   This file is part of the GNU C Library.\n\n   The GNU C Library is free software; you can redistribute it and/or\n   modify it under the terms of the GNU Lesser General Public\n   License as published by the Free Software Foundation; either\n   version 2.1 of the License, or (at your option) any later version.\n\n   The GNU C Library is distributed in the hope that it will be useful,\n   but WITHOUT ANY WARRANTY; without even the implied warranty of\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n   Lesser General Public License for more details.\n\n   You should have received a copy of the GNU Lesser General Public\n   License along with the GNU C Library; if not, write to the Free\n   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA\n   02111-1307 USA.  */\n\n#ifndef _GETOPT_H\n\n#ifndef __need_getopt\n# define _GETOPT_H 1\n#endif\n\n/* If __GNU_LIBRARY__ is not already defined, either we are being used\n   standalone, or this is the first header included in the source file.\n   If we are being used with glibc, we need to include <features.h>, but\n   that does not exist if we are standalone.  So: if __GNU_LIBRARY__ is\n   not defined, include <ctype.h>, which will pull in <features.h> for us\n   if it's from glibc.  (Why ctype.h?  It's guaranteed to exist and it\n   doesn't flood the namespace with stuff the way some other headers do.)  */\n#if !defined __GNU_LIBRARY__\n# include <ctype.h>\n#endif\n\n#ifdef\t__cplusplus\nextern \"C\" {\n#endif\n\n/* For communication from `getopt' to the caller.\n   When `getopt' finds an option that takes an argument,\n   the argument value is returned here.\n   Also, when `ordering' is RETURN_IN_ORDER,\n   each non-option ARGV-element is returned here.  */\n\nextern char *optarg;\n\n/* Index in ARGV of the next element to be scanned.\n   This is used for communication to and from the caller\n   and for communication between successive calls to `getopt'.\n\n   On entry to `getopt', zero means this is the first call; initialize.\n\n   When `getopt' returns -1, this is the index of the first of the\n   non-option elements that the caller should itself scan.\n\n   Otherwise, `optind' communicates from one call to the next\n   how much of ARGV has been scanned so far.  */\n\nextern int optind;\n\n/* Callers store zero here to inhibit the error message `getopt' prints\n   for unrecognized options.  */\n\nextern int opterr;\n\n/* Set to an option character which was unrecognized.  */\n\nextern int optopt;\n\n#ifndef __need_getopt\n/* Describe the long-named options requested by the application.\n   The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector\n   of `struct option' terminated by an element containing a name which is\n   zero.\n\n   The field `has_arg' is:\n   no_argument\t\t(or 0) if the option does not take an argument,\n   required_argument\t(or 1) if the option requires an argument,\n   optional_argument \t(or 2) if the option takes an optional argument.\n\n   If the field `flag' is not NULL, it points to a variable that is set\n   to the value given in the field `val' when the option is found, but\n   left unchanged if the option is not found.\n\n   To have a long-named option do something other than set an `int' to\n   a compiled-in constant, such as set a value from `optarg', set the\n   option's `flag' field to zero and its `val' field to a nonzero\n   value (the equivalent single-letter option character, if there is\n   one).  For long options that have a zero `flag' field, `getopt'\n   returns the contents of the `val' field.  */\n\nstruct option\n{\n# if (defined __STDC__ && __STDC__) || defined __cplusplus\n  const char *name;\n# else\n  char *name;\n# endif\n  /* has_arg can't be an enum because some compilers complain about\n     type mismatches in all the code that assumes it is an int.  */\n  int has_arg;\n  int *flag;\n  int val;\n};\n\n/* Names for the values of the `has_arg' field of `struct option'.  */\n\n# define no_argument\t\t0\n# define required_argument\t1\n# define optional_argument\t2\n#endif\t/* need getopt */\n\n\n/* Get definitions and prototypes for functions to process the\n   arguments in ARGV (ARGC of them, minus the program name) for\n   options given in OPTS.\n\n   Return the option character from OPTS just read.  Return -1 when\n   there are no more options.  For unrecognized options, or options\n   missing arguments, `optopt' is set to the option letter, and '?' is\n   returned.\n\n   The OPTS string is a list of characters which are recognized option\n   letters, optionally followed by colons, specifying that that letter\n   takes an argument, to be placed in `optarg'.\n\n   If a letter in OPTS is followed by two colons, its argument is\n   optional.  This behavior is specific to the GNU `getopt'.\n\n   The argument `--' causes premature termination of argument\n   scanning, explicitly telling `getopt' that there are no more\n   options.\n\n   If OPTS begins with `--', then non-option arguments are treated as\n   arguments to the option '\\0'.  This behavior is specific to the GNU\n   `getopt'.  */\n\n#if (defined __STDC__ && __STDC__) || defined __cplusplus\n# ifdef __GNU_LIBRARY__\n/* Many other libraries have conflicting prototypes for getopt, with\n   differences in the consts, in stdlib.h.  To avoid compilation\n   errors, only prototype getopt for the GNU C library.  */\nextern int getopt (int __argc, char *const *__argv, const char *__shortopts);\n# else /* not __GNU_LIBRARY__ */\nextern int getopt ();\n# endif /* __GNU_LIBRARY__ */\n\n# ifndef __need_getopt\nextern int getopt_long (int __argc, char *const *__argv, const char *__shortopts,\n\t\t        const struct option *__longopts, int *__longind);\nextern int getopt_long_only (int __argc, char *const *__argv,\n\t\t\t     const char *__shortopts,\n\t\t             const struct option *__longopts, int *__longind);\n\n/* Internal only.  Users should not call this directly.  */\nextern int _getopt_internal (int __argc, char *const *__argv,\n\t\t\t     const char *__shortopts,\n\t\t             const struct option *__longopts, int *__longind,\n\t\t\t     int __long_only);\n# endif\n#else /* not __STDC__ */\nextern int getopt ();\n# ifndef __need_getopt\nextern int getopt_long ();\nextern int getopt_long_only ();\n\nextern int _getopt_internal ();\n# endif\n#endif /* __STDC__ */\n\n#ifdef\t__cplusplus\n}\n#endif\n\n/* Make sure we later can get all the definitions and declarations.  */\n#undef __need_getopt\n\n#endif /* getopt.h */\n"
  },
  {
    "path": "ext/jbig2dec/getopt1.c",
    "content": "/* getopt_long and getopt_long_only entry points for GNU getopt.\n   Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98\n     Free Software Foundation, Inc.\n   This file is part of the GNU C Library.\n\n   The GNU C Library is free software; you can redistribute it and/or\n   modify it under the terms of the GNU Lesser General Public\n   License as published by the Free Software Foundation; either\n   version 2.1 of the License, or (at your option) any later version.\n\n   The GNU C Library is distributed in the hope that it will be useful,\n   but WITHOUT ANY WARRANTY; without even the implied warranty of\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n   Lesser General Public License for more details.\n\n   You should have received a copy of the GNU Lesser General Public\n   License along with the GNU C Library; if not, write to the Free\n   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA\n   02111-1307 USA.  */\n\f\n#ifdef HAVE_CONFIG_H\n#include <config.h>\n#endif\n\n#include \"getopt.h\"\n\n#if !defined __STDC__ || !__STDC__\n/* This is a separate conditional since some stdc systems\n   reject `defined (const)'.  */\n#ifndef const\n#define const\n#endif\n#endif\n\n#include <stdio.h>\n\n/* Comment out all this code if we are using the GNU C Library, and are not\n   actually compiling the library itself.  This code is part of the GNU C\n   Library, but also included in many other GNU distributions.  Compiling\n   and linking in this code is a waste when using the GNU C library\n   (especially if it is a shared library).  Rather than having every GNU\n   program understand `configure --with-gnu-libc' and omit the object files,\n   it is simpler to just do this in the source for each such file.  */\n\n#define GETOPT_INTERFACE_VERSION 2\n#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2\n#include <gnu-versions.h>\n#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION\n#define ELIDE_CODE\n#endif\n#endif\n\n#ifndef ELIDE_CODE\n\n\n/* This needs to come after some library #include\n   to get __GNU_LIBRARY__ defined.  */\n#ifdef __GNU_LIBRARY__\n#include <stdlib.h>\n#endif\n\n#ifndef\tNULL\n#define NULL 0\n#endif\n\nint\ngetopt_long (argc, argv, options, long_options, opt_index)\n     int argc;\n     char *const *argv;\n     const char *options;\n     const struct option *long_options;\n     int *opt_index;\n{\n  return _getopt_internal (argc, argv, options, long_options, opt_index, 0);\n}\n\n/* Like getopt_long, but '-' as well as '--' can indicate a long option.\n   If an option that starts with '-' (not '--') doesn't match a long option,\n   but does match a short option, it is parsed as a short option\n   instead.  */\n\nint\ngetopt_long_only (argc, argv, options, long_options, opt_index)\n     int argc;\n     char *const *argv;\n     const char *options;\n     const struct option *long_options;\n     int *opt_index;\n{\n  return _getopt_internal (argc, argv, options, long_options, opt_index, 1);\n}\n\n\n#endif\t/* Not ELIDE_CODE.  */\n\f\n#ifdef TEST\n\n#include <stdio.h>\n\nint\nmain (argc, argv)\n     int argc;\n     char **argv;\n{\n  int c;\n  int digit_optind = 0;\n\n  while (1)\n    {\n      int this_option_optind = optind ? optind : 1;\n      int option_index = 0;\n      static struct option long_options[] =\n      {\n\t{\"add\", 1, 0, 0},\n\t{\"append\", 0, 0, 0},\n\t{\"delete\", 1, 0, 0},\n\t{\"verbose\", 0, 0, 0},\n\t{\"create\", 0, 0, 0},\n\t{\"file\", 1, 0, 0},\n\t{0, 0, 0, 0}\n      };\n\n      c = getopt_long (argc, argv, \"abc:d:0123456789\",\n\t\t       long_options, &option_index);\n      if (c == -1)\n\tbreak;\n\n      switch (c)\n\t{\n\tcase 0:\n\t  printf (\"option %s\", long_options[option_index].name);\n\t  if (optarg)\n\t    printf (\" with arg %s\", optarg);\n\t  printf (\"\\n\");\n\t  break;\n\n\tcase '0':\n\tcase '1':\n\tcase '2':\n\tcase '3':\n\tcase '4':\n\tcase '5':\n\tcase '6':\n\tcase '7':\n\tcase '8':\n\tcase '9':\n\t  if (digit_optind != 0 && digit_optind != this_option_optind)\n\t    printf (\"digits occur in two different argv-elements.\\n\");\n\t  digit_optind = this_option_optind;\n\t  printf (\"option %c\\n\", c);\n\t  break;\n\n\tcase 'a':\n\t  printf (\"option a\\n\");\n\t  break;\n\n\tcase 'b':\n\t  printf (\"option b\\n\");\n\t  break;\n\n\tcase 'c':\n\t  printf (\"option c with value `%s'\\n\", optarg);\n\t  break;\n\n\tcase 'd':\n\t  printf (\"option d with value `%s'\\n\", optarg);\n\t  break;\n\n\tcase '?':\n\t  break;\n\n\tdefault:\n\t  printf (\"?? getopt returned character code 0%o ??\\n\", c);\n\t}\n    }\n\n  if (optind < argc)\n    {\n      printf (\"non-option ARGV-elements: \");\n      while (optind < argc)\n\tprintf (\"%s \", argv[optind++]);\n      printf (\"\\n\");\n    }\n\n  exit (0);\n}\n\n#endif /* TEST */\n"
  },
  {
    "path": "ext/jbig2dec/jbig2.c",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#include \"os_types.h\"\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <stdarg.h>\n#include <string.h>\n\n#include \"jbig2.h\"\n#include \"jbig2_priv.h\"\n\nstatic void *\njbig2_default_alloc (Jbig2Allocator *allocator, size_t size)\n{\n  return malloc (size);\n}\n\nstatic void\njbig2_default_free (Jbig2Allocator *allocator, void *p)\n{\n  free (p);\n}\n\nstatic void *\njbig2_default_realloc (Jbig2Allocator *allocator, void *p, size_t size)\n{\n  return realloc (p, size);\n}\n\nstatic Jbig2Allocator jbig2_default_allocator =\n{\n  jbig2_default_alloc,\n  jbig2_default_free,\n  jbig2_default_realloc\n};\n\nvoid *\njbig2_alloc (Jbig2Allocator *allocator, size_t size, size_t num)\n{\n  /* check for integer multiplication overflow */\n  if (num > 0 && size >= (size_t)-0x100 / num)\n    return NULL;\n  return allocator->alloc(allocator, size * num);\n}\n\nvoid\njbig2_free (Jbig2Allocator *allocator, void *p)\n{\n  allocator->free (allocator, p);\n}\n\nvoid *\njbig2_realloc (Jbig2Allocator *allocator, void *p, size_t size, size_t num)\n{\n  /* check for integer multiplication overflow */\n  if (num > 0 && size >= (size_t)-0x100 / num)\n    return NULL;\n  return allocator->realloc(allocator, p, size * num);\n}\n\nstatic int\njbig2_default_error(void *data, const char *msg,\n                    Jbig2Severity severity, int32_t seg_idx)\n{\n    /* report only fatal errors by default */\n    if (severity == JBIG2_SEVERITY_FATAL) {\n        fprintf(stderr, \"jbig2 decoder FATAL ERROR: %s\", msg);\n        if (seg_idx != -1) fprintf(stderr, \" (segment 0x%02x)\", seg_idx);\n        fprintf(stderr, \"\\n\");\n        fflush(stderr);\n    }\n\n    return 0;\n}\n\nint\njbig2_error(Jbig2Ctx *ctx, Jbig2Severity severity, int32_t segment_number,\n\t     const char *fmt, ...)\n{\n  char buf[1024];\n  va_list ap;\n  int n;\n  int code;\n\n  va_start (ap, fmt);\n  n = vsnprintf (buf, sizeof(buf), fmt, ap);\n  va_end (ap);\n  if (n < 0 || n == sizeof(buf))\n    strncpy (buf, \"jbig2_error: error in generating error string\", sizeof(buf));\n  code = ctx->error_callback (ctx->error_callback_data, buf, severity, segment_number);\n  if (severity == JBIG2_SEVERITY_FATAL)\n    code = -1;\n  return code;\n}\n\nJbig2Ctx *\njbig2_ctx_new (Jbig2Allocator *allocator,\n\t       Jbig2Options options,\n\t       Jbig2GlobalCtx *global_ctx,\n\t       Jbig2ErrorCallback error_callback,\n\t       void *error_callback_data)\n{\n  Jbig2Ctx *result;\n\n  if (allocator == NULL)\n      allocator = &jbig2_default_allocator;\n  if (error_callback == NULL)\n      error_callback = &jbig2_default_error;\n\n  result = (Jbig2Ctx*)jbig2_alloc(allocator, sizeof(Jbig2Ctx), 1);\n  if (result == NULL) {\n    error_callback(error_callback_data, \"initial context allocation failed!\",\n                    JBIG2_SEVERITY_FATAL, -1);\n    return result;\n  }\n\n  result->allocator = allocator;\n  result->options = options;\n  result->global_ctx = (const Jbig2Ctx *)global_ctx;\n  result->error_callback = error_callback;\n  result->error_callback_data = error_callback_data;\n\n  result->state = (options & JBIG2_OPTIONS_EMBEDDED) ?\n    JBIG2_FILE_SEQUENTIAL_HEADER :\n    JBIG2_FILE_HEADER;\n\n  result->buf = NULL;\n\n  result->n_segments = 0;\n  result->n_segments_max = 16;\n  result->segments = jbig2_new(result, Jbig2Segment*, result->n_segments_max);\n  if (result->segments == NULL) {\n    error_callback(error_callback_data, \"initial segments allocation failed!\",\n        JBIG2_SEVERITY_FATAL, -1);\n    jbig2_free(allocator, result);\n    return result;\n  }\n  result->segment_index = 0;\n\n  result->current_page = 0;\n  result->max_page_index = 4;\n  result->pages = jbig2_new(result, Jbig2Page, result->max_page_index);\n  if (result->pages == NULL) {\n    error_callback(error_callback_data, \"initial pages allocation failed!\",\n        JBIG2_SEVERITY_FATAL, -1);\n    jbig2_free(allocator, result->segments);\n    jbig2_free(allocator, result);\n    return result;\n  }\n  {\n    int index;\n    for (index = 0; index < result->max_page_index; index++) {\n        result->pages[index].state = JBIG2_PAGE_FREE;\n        result->pages[index].number = 0;\n        result->pages[index].image = NULL;\n    }\n  }\n\n  return result;\n}\n\n#define get_uint16(bptr)\\\n  (((bptr)[0] << 8) | (bptr)[1])\n#define get_int16(bptr)\\\n  (((int)get_uint16(bptr) ^ 0x8000) - 0x8000)\n\nint16_t\njbig2_get_int16(const byte *bptr)\n{\t\n    return get_int16(bptr);\n}\n\nuint16_t\njbig2_get_uint16(const byte *bptr)\n{\t\n    return get_uint16(bptr);\n}\n\nint32_t\njbig2_get_int32(const byte *bptr)\n{\t\n    return ((int32_t)get_int16(bptr) << 16) | get_uint16(bptr + 2);\n}\n\nuint32_t\njbig2_get_uint32(const byte *bptr)\n{\t\n    return ((uint32_t)get_uint16(bptr) << 16) | get_uint16(bptr + 2);\n}\n\n\n/**\n * jbig2_data_in: submit data for decoding\n * @ctx: The jbig2dec decoder context\n * @data: a pointer to the data buffer\n * @size: the size of the data buffer in bytes\n *\n * Copies the specified data into internal storage and attempts\n * to (continue to) parse it as part of a jbig2 data stream.\n *\n * Return code: 0 on success\n *             -1 if there is a parsing error, or whatever\n *                the error handling callback returns\n **/\nint\njbig2_data_in (Jbig2Ctx *ctx, const unsigned char *data, size_t size)\n{\n  const size_t initial_buf_size = 1024;\n\n  if (ctx->buf == NULL)\n    {\n      size_t buf_size = initial_buf_size;\n\n      do\n\tbuf_size <<= 1;\n      while (buf_size < size);\n      ctx->buf = jbig2_new(ctx, byte, buf_size);\n      if (ctx->buf == NULL)\n      {\n          return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n              \"failed to allocate ctx->buf in jbig2_data_in\");\n      }\n      ctx->buf_size = buf_size;\n      ctx->buf_rd_ix = 0;\n      ctx->buf_wr_ix = 0;\n    }\n  else if (ctx->buf_wr_ix + size > ctx->buf_size)\n    {\n      if (ctx->buf_rd_ix <= (ctx->buf_size >> 1) &&\n\t  ctx->buf_wr_ix - ctx->buf_rd_ix + size <= ctx->buf_size)\n        {\n\t  memmove(ctx->buf, ctx->buf + ctx->buf_rd_ix,\n\t\t  ctx->buf_wr_ix - ctx->buf_rd_ix);\n\t}\n      else\n\t{\n\t  byte *buf;\n\t  size_t buf_size = initial_buf_size;\n\n\t  do\n\t    buf_size <<= 1;\n\t  while (buf_size < ctx->buf_wr_ix - ctx->buf_rd_ix + size);\n\t  buf = jbig2_new(ctx, byte, buf_size);\n      if (buf == NULL)\n      {\n          return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n              \"failed to allocate buf in jbig2_data_in\");\n      }\n\t  memcpy(buf, ctx->buf + ctx->buf_rd_ix,\n\t\t  ctx->buf_wr_ix - ctx->buf_rd_ix);\n\t  jbig2_free(ctx->allocator, ctx->buf);\n\t  ctx->buf = buf;\n\t  ctx->buf_size = buf_size;\n\t}\n      ctx->buf_wr_ix -= ctx->buf_rd_ix;\n      ctx->buf_rd_ix = 0;\n    }\n  memcpy(ctx->buf + ctx->buf_wr_ix, data, size);\n  ctx->buf_wr_ix += size;\n\n  /* data has now been added to buffer */\n\n  for (;;)\n    {\n      const byte jbig2_id_string[8] = { 0x97, 0x4a, 0x42, 0x32, 0x0d, 0x0a, 0x1a, 0x0a };\n      Jbig2Segment *segment;\n      size_t header_size;\n      int code;\n\n      switch (ctx->state)\n\t{\n\tcase JBIG2_FILE_HEADER:\n          /* D.4.1 */\n\t  if (ctx->buf_wr_ix - ctx->buf_rd_ix < 9)\n\t    return 0;\n\t  if (memcmp(ctx->buf + ctx->buf_rd_ix, jbig2_id_string, 8))\n\t    return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n\t\t\t       \"Not a JBIG2 file header\");\n          /* D.4.2 */\n\t  ctx->file_header_flags = ctx->buf[ctx->buf_rd_ix + 8];\n          if (ctx->file_header_flags & 0xFC) {\n            jbig2_error(ctx, JBIG2_SEVERITY_WARNING, -1,\n                \"reserved bits (2-7) of file header flags are not zero (0x%02x)\", ctx->file_header_flags);\n          }\n          /* D.4.3 */\n\t  if (!(ctx->file_header_flags & 2)) /* number of pages is known */\n\t    {\n\t      if (ctx->buf_wr_ix - ctx->buf_rd_ix < 13)\n\t\treturn 0;\n\t      ctx->n_pages = jbig2_get_uint32(ctx->buf + ctx->buf_rd_ix + 9);\n\t      ctx->buf_rd_ix += 13;\n              if (ctx->n_pages == 1)\n                jbig2_error(ctx, JBIG2_SEVERITY_INFO, -1, \"file header indicates a single page document\");\n              else\n                jbig2_error(ctx, JBIG2_SEVERITY_INFO, -1, \"file header indicates a %d page document\", ctx->n_pages);\n\t    }\n\t  else /* number of pages not known */\n            {\n              ctx->n_pages=0;\n\t      ctx->buf_rd_ix += 9;\n            }\n          /* determine the file organization based on the flags - D.4.2 again */\n\t  if (ctx->file_header_flags & 1)\n\t    {\n\t      ctx->state = JBIG2_FILE_SEQUENTIAL_HEADER;\n              jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, -1, \"file header indicates sequential organization\");\n\t    }\n\t  else\n\t    {\n\t      ctx->state = JBIG2_FILE_RANDOM_HEADERS;\n              jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, -1, \"file header indicates random-access organization\");\n\n            }\n\t  break;\n\tcase JBIG2_FILE_SEQUENTIAL_HEADER:\n\tcase JBIG2_FILE_RANDOM_HEADERS:\n\t  segment = jbig2_parse_segment_header(ctx, ctx->buf + ctx->buf_rd_ix,\n\t\t\t\t\t  ctx->buf_wr_ix - ctx->buf_rd_ix,\n\t\t\t\t\t  &header_size);\n\t  if (segment == NULL)\n\t    return 0; /* need more data */\n\t  ctx->buf_rd_ix += header_size;\n\n\t  if (ctx->n_segments == ctx->n_segments_max)\n              ctx->segments = jbig2_renew(ctx, ctx->segments, Jbig2Segment*,\n                  (ctx->n_segments_max <<= 2));\n\n\t  ctx->segments[ctx->n_segments++] = segment;\n\t  if (ctx->state == JBIG2_FILE_RANDOM_HEADERS)\n\t    {\n\t      if ((segment->flags & 63) == 51) /* end of file */\n\t\tctx->state = JBIG2_FILE_RANDOM_BODIES;\n\t    }\n\t  else /* JBIG2_FILE_SEQUENTIAL_HEADER */\n\t    ctx->state = JBIG2_FILE_SEQUENTIAL_BODY;\n\t  break;\n\tcase JBIG2_FILE_SEQUENTIAL_BODY:\n\tcase JBIG2_FILE_RANDOM_BODIES:\n\t  segment = ctx->segments[ctx->segment_index];\n\t  if (segment->data_length > ctx->buf_wr_ix - ctx->buf_rd_ix)\n\t    return 0; /* need more data */\n\t  code = jbig2_parse_segment(ctx, segment, ctx->buf + ctx->buf_rd_ix);\n\t  ctx->buf_rd_ix += segment->data_length;\n\t  ctx->segment_index++;\n\t  if (ctx->state == JBIG2_FILE_RANDOM_BODIES)\n\t    {\n\t      if (ctx->segment_index == ctx->n_segments)\n\t\tctx->state = JBIG2_FILE_EOF;\n\t    }\n\t  else /* JBIG2_FILE_SEQUENCIAL_BODY */\n\t    {\n\t      ctx->state = JBIG2_FILE_SEQUENTIAL_HEADER;\n\t    }\n\t  if (code < 0)\n\t    {\n\t      ctx->state = JBIG2_FILE_EOF;\n\t      return code;\n\t    }\n\t  break;\n\tcase JBIG2_FILE_EOF:\n\t  if (ctx->buf_rd_ix == ctx->buf_wr_ix)\n\t    return 0;\n\t  return jbig2_error(ctx, JBIG2_SEVERITY_WARNING, -1,\n\t\t      \"Garbage beyond end of file\");\n\t}\n    }\n}\n\nvoid\njbig2_ctx_free (Jbig2Ctx *ctx)\n{\n  Jbig2Allocator *ca = ctx->allocator;\n  int i;\n\n  jbig2_free(ca, ctx->buf);\n  if (ctx->segments != NULL) {\n    for (i = 0; i < ctx->n_segments; i++)\n      jbig2_free_segment(ctx, ctx->segments[i]);\n    jbig2_free(ca, ctx->segments);\n  }\n\n  if (ctx->pages != NULL) {\n    for (i = 0; i <= ctx->current_page; i++)\n      if (ctx->pages[i].image != NULL)\n\tjbig2_image_release(ctx, ctx->pages[i].image);\n    jbig2_free(ca, ctx->pages);\n  }\n\n  jbig2_free(ca, ctx);\n}\n\nJbig2GlobalCtx *jbig2_make_global_ctx (Jbig2Ctx *ctx)\n{\n  return (Jbig2GlobalCtx *)ctx;\n}\n\nvoid jbig2_global_ctx_free(Jbig2GlobalCtx *global_ctx)\n{\n  jbig2_ctx_free((Jbig2Ctx *)global_ctx);\n}\n\n\n/* I'm not committed to keeping the word stream interface. It's handy\n   when you think you may be streaming your input, but if you're not\n   (as is currently the case), it just adds complexity.\n*/\n\ntypedef struct {\n  Jbig2WordStream super;\n  const byte *data;\n  size_t size;\n} Jbig2WordStreamBuf;\n\nstatic int\njbig2_word_stream_buf_get_next_word(Jbig2WordStream *self, int offset,\n  uint32_t *word)\n{\n  Jbig2WordStreamBuf *z = (Jbig2WordStreamBuf *)self;\n  const byte *data = z->data;\n  uint32_t result;\n\n  if (offset + 4 < z->size)\n    result = (data[offset] << 24) | (data[offset + 1] << 16) |\n      (data[offset + 2] << 8) | data[offset + 3];\n  else if (offset >= z->size)\n    return -1;\n  else\n    {\n      int i;\n\n      result = 0;\n      for (i = 0; i < z->size - offset; i++)\n\tresult |= data[offset + i] << ((3 - i) << 3);\n    }\n  *word = result;\n  return 0;\n}\n\nJbig2WordStream *\njbig2_word_stream_buf_new(Jbig2Ctx *ctx, const byte *data, size_t size)\n{\n  Jbig2WordStreamBuf *result = jbig2_new(ctx, Jbig2WordStreamBuf, 1);\n  if (result == NULL)\n  {\n      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n          \"failed to allocate Jbig2WordStreamBuf in jbig2_word_stream_buf_new\");\n      return NULL;\n  }\n\n  result->super.get_next_word = jbig2_word_stream_buf_get_next_word;\n  result->data = data;\n  result->size = size;\n\n  return &result->super;\n}\n\nvoid\njbig2_word_stream_buf_free(Jbig2Ctx *ctx, Jbig2WordStream *ws)\n{\n  jbig2_free(ctx->allocator, ws);\n}\n"
  },
  {
    "path": "ext/jbig2dec/jbig2.h",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#ifndef _JBIG2_H\n#define _JBIG2_H\n\n/* To enable Memento, either uncomment the following, or arrange to\n * predefine MEMENTO whilst building. */\n/* #define MEMENTO */\n\n/* SumatraPDF: allow to build without MEMENTO (clashes with MuPDF's) */\n#ifndef JBIG_NO_MEMENTO\n/* If we are building as part of GS then make sure we use the version\n * of MEMENTO that is part of gs (in case of version skew) */\n#ifdef GSBUILD\n#include \"../base/memento.h\"\n#else\n#include \"memento.h\"\n#endif\n#endif\n\n/* warning levels */\ntypedef enum {\n  JBIG2_SEVERITY_DEBUG,\n  JBIG2_SEVERITY_INFO,\n  JBIG2_SEVERITY_WARNING,\n  JBIG2_SEVERITY_FATAL\n} Jbig2Severity;\n\ntypedef enum {\n  JBIG2_OPTIONS_EMBEDDED = 1\n} Jbig2Options;\n\n/* forward public structure declarations */\ntypedef struct _Jbig2Allocator Jbig2Allocator;\ntypedef struct _Jbig2Ctx Jbig2Ctx;\ntypedef struct _Jbig2GlobalCtx Jbig2GlobalCtx;\ntypedef struct _Jbig2Segment Jbig2Segment;\ntypedef struct _Jbig2Image Jbig2Image;\n\n/* private structures */\ntypedef struct _Jbig2Page Jbig2Page;\ntypedef struct _Jbig2SymbolDictionary Jbig2SymbolDictionary;\n\n/*\n   this is the general image structure used by the jbig2dec library\n   images are 1 bpp, packed into rows a byte at a time. stride gives\n   the byte offset to the next row, while width and height define\n   the size of the image area in pixels.\n*/\n\nstruct _Jbig2Image {\n        int             width, height, stride;\n        uint8_t        *data;\n\tint\t\trefcount;\n};\n\nJbig2Image*     jbig2_image_new(Jbig2Ctx *ctx, int width, int height);\nJbig2Image*\tjbig2_image_clone(Jbig2Ctx *ctx, Jbig2Image *image);\nvoid\t\tjbig2_image_release(Jbig2Ctx *ctx, Jbig2Image *image);\nvoid            jbig2_image_free(Jbig2Ctx *ctx, Jbig2Image *image);\nvoid\t\tjbig2_image_clear(Jbig2Ctx *ctx, Jbig2Image *image, int value);\nJbig2Image\t*jbig2_image_resize(Jbig2Ctx *ctx, Jbig2Image *image,\n                                int width, int height);\n\n/* errors are returned from the library via a callback. If no callback\n   is provided (a NULL argument is passed ot jbig2_ctx_new) a default\n   handler is used which prints fatal errors to the stderr stream. */\n\n/* error callback */\ntypedef int (*Jbig2ErrorCallback) (void *data,\n\t\t\t\t  const char *msg, Jbig2Severity severity,\n\t\t\t\t  int32_t seg_idx);\n\n/* memory allocation is likewise done via a set of callbacks so that\n   clients can better control memory usage. If a NULL is passed for\n   this argumennt of jbig2_ctx_new, a default allocator based on malloc()\n   is used. */\n\n/* dynamic memory callbacks */\nstruct _Jbig2Allocator {\n  void *(*alloc) (Jbig2Allocator *allocator, size_t size);\n  void (*free) (Jbig2Allocator *allocator, void *p);\n  void *(*realloc) (Jbig2Allocator *allocator, void *p, size_t size);\n};\n\n/* decoder context */\nJbig2Ctx *jbig2_ctx_new (Jbig2Allocator *allocator,\n\t\t\t Jbig2Options options,\n\t\t\t Jbig2GlobalCtx *global_ctx,\n\t\t\t Jbig2ErrorCallback error_callback,\n\t\t\t void *error_callback_data);\nvoid jbig2_ctx_free (Jbig2Ctx *ctx);\n\n/* global context for embedded streams */\nJbig2GlobalCtx *jbig2_make_global_ctx (Jbig2Ctx *ctx);\nvoid jbig2_global_ctx_free (Jbig2GlobalCtx *global_ctx);\n\n/* submit data to the decoder */\nint jbig2_data_in (Jbig2Ctx *ctx, const unsigned char *data, size_t size);\n\n/* get the next available decoded page image. NULL means there isn't one. */\nJbig2Image *jbig2_page_out (Jbig2Ctx *ctx);\n/* mark a returned page image as no longer needed. */\nint jbig2_release_page (Jbig2Ctx *ctx, Jbig2Image *image);\n/* mark the current page as complete, simulating an end-of-page segment (for broken streams) */\nint jbig2_complete_page (Jbig2Ctx *ctx);\n\n\n/* segment header routines */\n\nstruct _Jbig2Segment {\n  uint32_t number;\n  uint8_t flags;\n  uint32_t page_association;\n  size_t data_length;\n  int referred_to_segment_count;\n  uint32_t *referred_to_segments;\n  void *result;\n};\n\nJbig2Segment *jbig2_parse_segment_header (Jbig2Ctx *ctx, uint8_t *buf, size_t buf_size,\n\t\t\t    size_t *p_header_size);\nint jbig2_parse_segment (Jbig2Ctx *ctx, Jbig2Segment *segment,\n\t\t\t const uint8_t *segment_data);\nvoid jbig2_free_segment (Jbig2Ctx *ctx, Jbig2Segment *segment);\n\nJbig2Segment *jbig2_find_segment(Jbig2Ctx *ctx, uint32_t number);\n\n#endif /* _JBIG2_H */\n\n#ifdef __cplusplus\n}\n#endif\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_arith.c",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#include \"os_types.h\"\n\n#include <stdio.h>\n#include <stdlib.h>\n\n#include \"jbig2.h\"\n#include \"jbig2_priv.h\"\n#include \"jbig2_arith.h\"\n\nstruct _Jbig2ArithState {\n  uint32_t C;\n  int A;\n\n  int CT;\n\n  uint32_t next_word;\n  int next_word_bytes;\n\n  Jbig2WordStream *ws;\n  int offset;\n\n  Jbig2Ctx *ctx;\n};\n\n#undef SOFTWARE_CONVENTION\n\n/*\n  A note on the \"software conventions\".\n\n  Previously, I had misinterpreted the spec, and had thought that the\n  spec's description of the \"software convention\" was wrong. Now I\n  believe that this code is both correct and matches the spec, with\n  SOFTWARE_CONVENTION defined or not. Thanks to William Rucklidge for\n  the clarification.\n\n  In any case, my benchmarking indicates no speed difference at all.\n  Therefore, for now we will just use the normative version.\n\n */\n\nstatic int\njbig2_arith_bytein (Jbig2ArithState *as)\n{\n  byte B;\n\n  /* invariant: as->next_word_bytes > 0 */\n\n  /* Figure G.3 */\n  B = (byte)((as->next_word >> 24) & 0xFF);\n  if (B == 0xFF)\n    {\n      byte B1;\n      if (as->next_word_bytes == 1)\n\t{\n\t  Jbig2WordStream *ws = as->ws;\n\t  if (ws->get_next_word (ws, as->offset, &as->next_word))\n\t    {\n\t      jbig2_error(as->ctx, JBIG2_SEVERITY_FATAL, -1,\n\t\t\"end of jbig2 buffer reached at offset %d\", as->offset);\n\t      return -1;\n\t    }\n\t  as->offset += 4;\n\t  B1 = (byte)((as->next_word >> 24) & 0xFF);\n\t  if (B1 > 0x8F)\n\t    {\n#ifdef JBIG2_DEBUG_ARITH\n\t      fprintf(stderr, \"read %02x (aa)\\n\", B);\n#endif\n#ifndef SOFTWARE_CONVENTION\n\t      as->C += 0xFF00;\n#endif\n\t      as->CT = 8;\n\t      as->next_word = (0xFF00 | B1) << 16;\n\t      as->next_word_bytes = 2;\n\t    }\n\t  else\n\t    {\n#ifdef JBIG2_DEBUG_ARITH\n\t      fprintf(stderr, \"read %02x (a)\\n\", B);\n#endif\n#ifdef SOFTWARE_CONVENTION\n\t      as->C += 0xFE00 - (B1 << 9);\n#else\n\t      as->C += B1 << 9;\n#endif\n\t      as->CT = 7;\n\t      as->next_word_bytes = 4;\n\t    }\n\t}\n      else\n\t{\n\t  B1 = (byte)((as->next_word >> 16) & 0xFF);\n\t  if (B1 > 0x8F)\n\t    {\n#ifdef JBIG2_DEBUG_ARITH\n\t      fprintf(stderr, \"read %02x (ba)\\n\", B);\n#endif\n#ifndef SOFTWARE_CONVENTION\n\t      as->C += 0xFF00;\n#endif\n\t      as->CT = 8;\n\t    }\n\t  else\n\t    {\n\t      as->next_word_bytes--;\n\t      as->next_word <<= 8;\n#ifdef JBIG2_DEBUG_ARITH\n\t      fprintf(stderr, \"read %02x (b)\\n\", B);\n#endif\n\n#ifdef SOFTWARE_CONVENTION\n\t      as->C += 0xFE00 - (B1 << 9);\n#else\n\t      as->C += (B1 << 9);\n#endif\n\t      as->CT = 7;\n\t    }\n\t}\n    }\n  else\n    {\n#ifdef JBIG2_DEBUG_ARITH\n      fprintf(stderr, \"read %02x\\n\", B);\n#endif\n      as->CT = 8;\n      as->next_word <<= 8;\n      as->next_word_bytes--;\n      if (as->next_word_bytes == 0)\n\t{\n\t  Jbig2WordStream *ws = as->ws;\n\n\t  if (ws->get_next_word (ws, as->offset, &as->next_word))\n\t    {\n\t      jbig2_error(as->ctx, JBIG2_SEVERITY_FATAL, -1,\n\t\t\"end of jbig2 buffer reached at offset %d\", as->offset);\n\t      return -1;\n\t    }\n\t  as->offset += 4;\n\t  as->next_word_bytes = 4;\n\t}\n      B = (byte)((as->next_word >> 24) & 0xFF);\n#ifdef SOFTWARE_CONVENTION\n      as->C += 0xFF00 - (B << 8);\n#else\n      as->C += (B << 8);\n#endif\n    }\n    return 0;\n}\n\n#if defined(JBIG2_DEBUG) || defined(JBIG2_DEBUG_ARITH)\nstatic void\njbig2_arith_trace (Jbig2ArithState *as, Jbig2ArithCx cx)\n{\n  fprintf(stderr, \"I = %2d, MPS = %d, A = %04x, CT = %2d, C = %08x\\n\",\n\t  cx & 0x7f, cx >> 7, as->A, as->CT, as->C);\n}\n#endif\n\n/** Allocate and initialize a new arithmetic coding state\n *  the returned pointer can simply be freed; this does\n *  not affect the associated Jbig2WordStream.\n */\nJbig2ArithState *\njbig2_arith_new (Jbig2Ctx *ctx, Jbig2WordStream *ws)\n{\n  Jbig2ArithState *result;\n\n  result = jbig2_new(ctx, Jbig2ArithState, 1);\n  if (result == NULL)\n  {\n      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n          \"failed to allocate Jbig2ArithState in jbig2_arith_new\");\n      return result;\n  }\n\n  result->ws = ws;\n  result->ctx = ctx;\n\n  if (ws->get_next_word (ws, 0, &result->next_word))\n  {\n      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n          \"unable to get first word in jbig2_arith_new\");\n      jbig2_free(ctx->allocator, result);\n      return NULL;\n  }\n  result->next_word_bytes = 4;\n  result->offset = 4;\n\n  /* Figure E.20 */\n#ifdef SOFTWARE_CONVENTION\n  result->C = (~(result->next_word >> 8)) & 0xFF0000;\n#else\n  result->C = (result->next_word >> 8) & 0xFF0000;\n#endif\n\n  if (jbig2_arith_bytein (result))\n  {\n      jbig2_free(ctx->allocator, result);\n      return NULL;\n  }\n  result->C <<= 7;\n  result->CT -= 7;\n  result->A = 0x8000;\n\n  return result;\n}\n\n#define MAX_QE_ARRAY_SIZE 47\n\n/* could put bit fields in to minimize memory usage */\ntypedef struct {\n  unsigned short Qe;\n  byte mps_xor; /* mps_xor = index ^ NMPS */\n  byte lps_xor; /* lps_xor = index ^ NLPS ^ (SWITCH << 7) */\n} Jbig2ArithQe;\n\nconst Jbig2ArithQe jbig2_arith_Qe[MAX_QE_ARRAY_SIZE] = {\n  { 0x5601,  1 ^  0,  1 ^  0 ^ 0x80 },\n  { 0x3401,  2 ^  1,  6 ^  1 },\n  { 0x1801,  3 ^  2,  9 ^  2 },\n  { 0x0AC1,  4 ^  3, 12 ^  3 },\n  { 0x0521,  5 ^  4, 29 ^  4 },\n  { 0x0221, 38 ^  5, 33 ^  5 },\n  { 0x5601,  7 ^  6,  6 ^  6 ^ 0x80 },\n  { 0x5401,  8 ^  7, 14 ^  7 },\n  { 0x4801,  9 ^  8, 14 ^  8 },\n  { 0x3801, 10 ^  9, 14 ^  9 },\n  { 0x3001, 11 ^ 10, 17 ^ 10 },\n  { 0x2401, 12 ^ 11, 18 ^ 11 },\n  { 0x1C01, 13 ^ 12, 20 ^ 12 },\n  { 0x1601, 29 ^ 13, 21 ^ 13 },\n  { 0x5601, 15 ^ 14, 14 ^ 14 ^ 0x80 },\n  { 0x5401, 16 ^ 15, 14 ^ 15 },\n  { 0x5101, 17 ^ 16, 15 ^ 16 },\n  { 0x4801, 18 ^ 17, 16 ^ 17 },\n  { 0x3801, 19 ^ 18, 17 ^ 18 },\n  { 0x3401, 20 ^ 19, 18 ^ 19 },\n  { 0x3001, 21 ^ 20, 19 ^ 20 },\n  { 0x2801, 22 ^ 21, 19 ^ 21 },\n  { 0x2401, 23 ^ 22, 20 ^ 22 },\n  { 0x2201, 24 ^ 23, 21 ^ 23 },\n  { 0x1C01, 25 ^ 24, 22 ^ 24 },\n  { 0x1801, 26 ^ 25, 23 ^ 25 },\n  { 0x1601, 27 ^ 26, 24 ^ 26 },\n  { 0x1401, 28 ^ 27, 25 ^ 27 },\n  { 0x1201, 29 ^ 28, 26 ^ 28 },\n  { 0x1101, 30 ^ 29, 27 ^ 29 },\n  { 0x0AC1, 31 ^ 30, 28 ^ 30 },\n  { 0x09C1, 32 ^ 31, 29 ^ 31 },\n  { 0x08A1, 33 ^ 32, 30 ^ 32 },\n  { 0x0521, 34 ^ 33, 31 ^ 33 },\n  { 0x0441, 35 ^ 34, 32 ^ 34 },\n  { 0x02A1, 36 ^ 35, 33 ^ 35 },\n  { 0x0221, 37 ^ 36, 34 ^ 36 },\n  { 0x0141, 38 ^ 37, 35 ^ 37 },\n  { 0x0111, 39 ^ 38, 36 ^ 38 },\n  { 0x0085, 40 ^ 39, 37 ^ 39 },\n  { 0x0049, 41 ^ 40, 38 ^ 40 },\n  { 0x0025, 42 ^ 41, 39 ^ 41 },\n  { 0x0015, 43 ^ 42, 40 ^ 42 },\n  { 0x0009, 44 ^ 43, 41 ^ 43 },\n  { 0x0005, 45 ^ 44, 42 ^ 44 },\n  { 0x0001, 45 ^ 45, 43 ^ 45 },\n  { 0x5601, 46 ^ 46, 46 ^ 46 }\n};\n\nstatic int\njbig2_arith_renormd (Jbig2ArithState *as)\n{\n  /* Figure E.18 */\n  do\n    {\n      if ((as->CT == 0) && (jbig2_arith_bytein (as) < 0))\n        return -1;\n      as->A <<= 1;\n      as->C <<= 1;\n      as->CT--;\n    }\n  while ((as->A & 0x8000) == 0);\n  return 0;\n}\n\nbool\njbig2_arith_decode (Jbig2ArithState *as, Jbig2ArithCx *pcx)\n{\n  Jbig2ArithCx cx = *pcx;\n  const Jbig2ArithQe *pqe;\n  unsigned int index = cx & 0x7f;\n  bool D;\n\n  if (index >= MAX_QE_ARRAY_SIZE)\n  {\n\t  return -1;\n  }\n  else\n  {\n\t  pqe = &jbig2_arith_Qe[index];\n  }\n\n  /* Figure E.15 */\n  as->A -= pqe->Qe;\n  if (\n#ifdef SOFTWARE_CONVENTION\n      /* Note: I do not think this is correct. See above. */\n      (as->C >> 16) < as->A\n#else\n      !((as->C >> 16) < pqe->Qe)\n#endif\n      )\n    {\n#ifndef SOFTWARE_CONVENTION\n      as->C -= pqe->Qe << 16;\n#endif\n      if ((as->A & 0x8000) == 0)\n\t{\n\t  /* MPS_EXCHANGE, Figure E.16 */\n\t  if (as->A < pqe->Qe)\n\t    {\n\t      D = 1 - (cx >> 7);\n\t      *pcx ^= pqe->lps_xor;\n\t    }\n\t  else\n\t    {\n\t      D = cx >> 7;\n\t      *pcx ^= pqe->mps_xor;\n\t    }\n\t  if (jbig2_arith_renormd (as))\n\t    return -1;\n\t  return D;\n\t}\n      else\n\treturn cx >> 7;\n    }\n  else\n    {\n#ifdef SOFTWARE_CONVENTION\n      as->C -= (as->A) << 16;\n#endif\n      /* LPS_EXCHANGE, Figure E.17 */\n      if (as->A < pqe->Qe)\n\t{\n\t  as->A = pqe->Qe;\n\t  D = cx >> 7;\n\t  *pcx ^= pqe->mps_xor;\n\t}\n      else\n\t{\n\t  as->A = pqe->Qe;\n\t  D = 1 - (cx >> 7);\n\t  *pcx ^= pqe->lps_xor;\n\t}\n      if (jbig2_arith_renormd (as))\n\treturn -1;\n      return D;\n    }\n}\n\nbool\njbig2_arith_has_reached_marker(Jbig2ArithState *as)\n{\n  return as->next_word_bytes == 2 && (as->next_word >> 16) > 0xFF8F;\n}\n\n#ifdef TEST\n\nstatic int\ntest_get_word (Jbig2WordStream *self, int offset, uint32_t *word)\n{\n  byte stream[] = {\n    0x84, 0xC7, 0x3B, 0xFC, 0xE1, 0xA1, 0x43, 0x04, 0x02, 0x20, 0x00, 0x00,\n    0x41, 0x0D, 0xBB, 0x86, 0xF4, 0x31, 0x7F, 0xFF, 0x88, 0xFF, 0x37, 0x47,\n    0x1A, 0xDB, 0x6A, 0xDF, 0xFF, 0xAC,\n    0x00, 0x00\n  };\n  if (offset >= sizeof(stream))\n    return -1;\n  *word = (stream[offset] << 24) | (stream[offset + 1] << 16) |\n    (stream[offset + 2] << 8) | stream[offset + 3];\n  return 0;\n}\n\nint\nmain (int argc, char **argv)\n{\n  Jbig2Ctx *ctx;\n  Jbig2WordStream ws;\n  Jbig2ArithState *as;\n  int i;\n  Jbig2ArithCx cx = 0;\n\n  ctx = jbig2_ctx_new(NULL, 0, NULL, NULL, NULL);\n\n  ws.get_next_word = test_get_word;\n  as = jbig2_arith_new (ctx, &ws);\n#ifdef JBIG2_DEBUG_ARITH\n  jbig2_arith_trace (as, cx);\n#endif\n\n  for (i = 0; i < 256; i++)\n    {\n#ifdef JBIG2_DEBUG_ARITH\n      bool D =\n#else\n      (void)\n#endif\n\n      jbig2_arith_decode (as, &cx);\n\n#ifdef JBIG2_DEBUG_ARITH\n      fprintf(stderr, \"%3d: D = %d, \", i, D);\n      jbig2_arith_trace (as, cx);\n#endif\n    }\n\n  jbig2_free(ctx->allocator, as);\n\n  jbig2_ctx_free(ctx);\n\n  return 0;\n}\n#endif\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_arith.h",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\ntypedef struct _Jbig2ArithState Jbig2ArithState;\n\n/* An arithmetic coding context is stored as a single byte, with the\n   index in the low order 7 bits (actually only 6 are used), and the\n   MPS in the top bit. */\ntypedef unsigned char Jbig2ArithCx;\n\n/* allocate and initialize a new arithmetic coding state */\nJbig2ArithState *\njbig2_arith_new (Jbig2Ctx *ctx, Jbig2WordStream *ws);\n\n/* decode a bit */\nbool\njbig2_arith_decode (Jbig2ArithState *as, Jbig2ArithCx *pcx);\n\n/* returns true if the end of the data stream has been reached (for sanity checks) */\nbool\njbig2_arith_has_reached_marker(Jbig2ArithState *as);\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_arith_iaid.c",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n/* Annex A.3 */\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#include \"os_types.h\"\n\n#include <stddef.h>\n#include <string.h> /* memset() */\n\n#ifdef VERBOSE\n#include <stdio.h> /* for debug printing only */\n#endif\n\n#include \"jbig2.h\"\n#include \"jbig2_priv.h\"\n#include \"jbig2_arith.h\"\n#include \"jbig2_arith_iaid.h\"\n\nstruct _Jbig2ArithIaidCtx {\n  int SBSYMCODELEN;\n  Jbig2ArithCx *IAIDx;\n};\n\nJbig2ArithIaidCtx *\njbig2_arith_iaid_ctx_new(Jbig2Ctx *ctx, int SBSYMCODELEN)\n{\n  Jbig2ArithIaidCtx *result = jbig2_new(ctx, Jbig2ArithIaidCtx, 1);\n  int ctx_size = 1 << SBSYMCODELEN;\n\n  if (result == NULL)\n  {\n      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n          \"failed to allocate storage in jbig2_arith_iaid_ctx_new\");\n      return result;\n  }\n\n  result->SBSYMCODELEN = SBSYMCODELEN;\n  result->IAIDx = jbig2_new(ctx, Jbig2ArithCx, ctx_size);\n  if (result->IAIDx != NULL)\n  {\n      memset(result->IAIDx, 0, ctx_size);\n  }\n  else\n  {\n      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n          \"failed to allocate symbol ID storage in jbig2_arith_iaid_ctx_new\");\n  }\n\n  return result;\n}\n\n/* A.3 */\n/* Return value: -1 on error, 0 on normal value */\nint\njbig2_arith_iaid_decode(Jbig2ArithIaidCtx *ctx, Jbig2ArithState *as,\n\t\t       int32_t *p_result)\n{\n  Jbig2ArithCx *IAIDx = ctx->IAIDx;\n  int SBSYMCODELEN = ctx->SBSYMCODELEN;\n  int PREV = 1;\n  int D;\n  int i;\n\n  /* A.3 (2) */\n  for (i = 0; i < SBSYMCODELEN; i++)\n    {\n      D = jbig2_arith_decode(as, &IAIDx[PREV]);\n      if (D < 0)\n\treturn -1;\n#ifdef VERBOSE\n      fprintf(stderr, \"IAID%x: D = %d\\n\", PREV, D);\n#endif\n      PREV = (PREV << 1) | D;\n    }\n  /* A.3 (3) */\n  PREV -= 1 << SBSYMCODELEN;\n#ifdef VERBOSE\n  fprintf(stderr, \"IAID result: %d\\n\", PREV);\n#endif\n  *p_result = PREV;\n  return 0;\n}\n\nvoid\njbig2_arith_iaid_ctx_free(Jbig2Ctx *ctx, Jbig2ArithIaidCtx *iax)\n{\n    if (iax != NULL)\n    {\n        jbig2_free(ctx->allocator, iax->IAIDx);\n        jbig2_free(ctx->allocator, iax);\n    }\n}\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_arith_iaid.h",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\ntypedef struct _Jbig2ArithIaidCtx Jbig2ArithIaidCtx;\n\nJbig2ArithIaidCtx *\njbig2_arith_iaid_ctx_new(Jbig2Ctx *ctx, int SBSYMCODELEN);\n\nint\njbig2_arith_iaid_decode(Jbig2ArithIaidCtx *ctx, Jbig2ArithState *as,\n\t\t       int32_t *p_result);\n\nvoid\njbig2_arith_iaid_ctx_free(Jbig2Ctx *ctx, Jbig2ArithIaidCtx *iax);\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_arith_int.c",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n/* Annex A */\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#include \"os_types.h\"\n\n#include <stddef.h>\n#include <string.h> /* memset() */\n\n#include \"jbig2.h\"\n#include \"jbig2_priv.h\"\n#include \"jbig2_arith.h\"\n#include \"jbig2_arith_int.h\"\n\nstruct _Jbig2ArithIntCtx {\n  Jbig2ArithCx IAx[512];\n};\n\nJbig2ArithIntCtx *\njbig2_arith_int_ctx_new(Jbig2Ctx *ctx)\n{\n  Jbig2ArithIntCtx *result = jbig2_new(ctx, Jbig2ArithIntCtx, 1);\n\n  if (result == NULL)\n  {\n      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n          \"failed to allocate Jbig2ArithIntCtx in jbig2_arith_int_ctx_new\");\n  }\n  else\n  {\n      memset(result->IAx, 0, sizeof(result->IAx));\n  }\n\n  return result;\n}\n\n/* A.2 */\n/* Return value: -1 on error, 0 on normal value, 1 on OOB return. */\nint\njbig2_arith_int_decode(Jbig2ArithIntCtx *ctx, Jbig2ArithState *as,\n\t\t       int32_t *p_result)\n{\n  Jbig2ArithCx *IAx = ctx->IAx;\n  int PREV = 1;\n  int S, V;\n  int bit;\n  int n_tail, offset;\n  int i;\n\n  S = jbig2_arith_decode(as, &IAx[PREV]);\n  if (S < 0)\n    return -1;\n  PREV = (PREV << 1) | S;\n\n  bit = jbig2_arith_decode(as, &IAx[PREV]);\n  if (bit < 0)\n    return -1;\n  PREV = (PREV << 1) | bit;\n  if (bit)\n    {\n      bit = jbig2_arith_decode(as, &IAx[PREV]);\n      if (bit < 0)\n\treturn -1;\n      PREV = (PREV << 1) | bit;\n\n      if (bit)\n\t{\n\t  bit = jbig2_arith_decode(as, &IAx[PREV]);\n\t  if (bit < 0)\n\t    return -1;\n\t  PREV = (PREV << 1) | bit;\n\n\t  if (bit)\n\t    {\n\t      bit = jbig2_arith_decode(as, &IAx[PREV]);\n\t      if (bit < 0)\n\t\treturn -1;\n\t      PREV = (PREV << 1) | bit;\n\n\t      if (bit)\n\t\t{\n\t\t  bit = jbig2_arith_decode(as, &IAx[PREV]);\n\t          if (bit < 0)\n\t\t    return -1;\n\t\t  PREV = (PREV << 1) | bit;\n\n\t\t  if (bit)\n\t\t    {\n\t\t      n_tail = 32;\n\t\t      offset = 4436;\n\t\t    }\n\t\t  else\n\t\t    {\n\t\t      n_tail = 12;\n\t\t      offset = 340;\n\t\t    }\n\t\t}\n\t      else\n\t\t{\n\t\t  n_tail = 8;\n\t\t  offset = 84;\n\t\t}\n\t    }\n\t  else\n\t    {\n\t      n_tail = 6;\n\t      offset = 20;\n\t    }\n\t}\n      else\n\t{\n\t  n_tail = 4;\n\t  offset = 4;\n\t}\n    }\n  else\n    {\n      n_tail = 2;\n      offset = 0;\n    }\n\n  V = 0;\n  for (i = 0; i < n_tail; i++)\n    {\n      bit = jbig2_arith_decode(as, &IAx[PREV]);\n      if (bit < 0)\n\treturn -1;\n      PREV = ((PREV << 1) & 511) | (PREV & 256) | bit;\n      V = (V << 1) | bit;\n    }\n\n  V += offset;\n  V = S ? -V : V;\n  *p_result = V;\n  return S && V == 0 ? 1 : 0;\n}\n\nvoid\njbig2_arith_int_ctx_free(Jbig2Ctx *ctx, Jbig2ArithIntCtx *iax)\n{\n  jbig2_free(ctx->allocator, iax);\n}\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_arith_int.h",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\ntypedef struct _Jbig2ArithIntCtx Jbig2ArithIntCtx;\n\nJbig2ArithIntCtx *\njbig2_arith_int_ctx_new(Jbig2Ctx *ctx);\n\nint\njbig2_arith_int_decode(Jbig2ArithIntCtx *ctx, Jbig2ArithState *as,\n\t\t       int32_t *p_result);\n\nvoid\njbig2_arith_int_ctx_free(Jbig2Ctx *ctx, Jbig2ArithIntCtx *iax);\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_generic.c",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n/**\n * Generic region handlers.\n **/\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#include \"os_types.h\"\n\n#include <stddef.h>\n#include <string.h> /* memcpy(), memset() */\n\n#ifdef OUTPUT_PBM\n#include <stdio.h>\n#endif\n\n#include \"jbig2.h\"\n#include \"jbig2_priv.h\"\n#include \"jbig2_image.h\"\n#include \"jbig2_arith.h\"\n#include \"jbig2_generic.h\"\n#include \"jbig2_mmr.h\"\n\n/* return the appropriate context size for the given template */\nint\njbig2_generic_stats_size(Jbig2Ctx *ctx, int template)\n{\n  int stats_size = template == 0 ? 1 << 16 :\n        template == 1 ? 1 << 1 << 13 : 1 << 10;\n  return stats_size;\n}\n\n\nstatic int\njbig2_decode_generic_template0(Jbig2Ctx *ctx,\n\t\t\t       Jbig2Segment *segment,\n\t\t\t       const Jbig2GenericRegionParams *params,\n\t\t\t       Jbig2ArithState *as,\n\t\t\t       Jbig2Image *image,\n\t\t\t       Jbig2ArithCx *GB_stats)\n{\n  const int GBW = image->width;\n  const int GBH = image->height;\n  const int rowstride = image->stride;\n  int x, y;\n  byte *gbreg_line = (byte *)image->data;\n\n  /* todo: currently we only handle the nominal gbat location */\n\n#ifdef OUTPUT_PBM\n  printf(\"P4\\n%d %d\\n\", GBW, GBH);\n#endif\n\n  if (GBW <= 0)\n    return 0;\n\n  for (y = 0; y < GBH; y++)\n    {\n      uint32_t CONTEXT;\n      uint32_t line_m1;\n      uint32_t line_m2;\n      int padded_width = (GBW + 7) & -8;\n\n      line_m1 = (y >= 1) ? gbreg_line[-rowstride] : 0;\n      line_m2 = (y >= 2) ? gbreg_line[-(rowstride << 1)] << 6 : 0;\n      CONTEXT = (line_m1 & 0x7f0) | (line_m2 & 0xf800);\n\n      /* 6.2.5.7 3d */\n      for (x = 0; x < padded_width; x += 8)\n\t{\n\t  byte result = 0;\n\t  int x_minor;\n\t  int minor_width = GBW - x > 8 ? 8 : GBW - x;\n\n\t  if (y >= 1)\n\t    line_m1 = (line_m1 << 8) |\n\t      (x + 8 < GBW ? gbreg_line[-rowstride + (x >> 3) + 1] : 0);\n\n\t  if (y >= 2)\n\t    line_m2 = (line_m2 << 8) |\n\t      (x + 8 < GBW ? gbreg_line[-(rowstride << 1) + (x >> 3) + 1] << 6: 0);\n\n\t  /* This is the speed-critical inner loop. */\n\t  for (x_minor = 0; x_minor < minor_width; x_minor++)\n\t    {\n\t      bool bit;\n\n\t      bit = jbig2_arith_decode(as, &GB_stats[CONTEXT]);\n\t      if (bit < 0)\n\t\treturn -1;\n\t      result |= bit << (7 - x_minor);\n\t      CONTEXT = ((CONTEXT & 0x7bf7) << 1) | bit |\n\t\t((line_m1 >> (7 - x_minor)) & 0x10) |\n\t\t((line_m2 >> (7 - x_minor)) & 0x800);\n\t    }\n\t  gbreg_line[x >> 3] = result;\n\t}\n#ifdef OUTPUT_PBM\n      fwrite(gbreg_line, 1, rowstride, stdout);\n#endif\n      gbreg_line += rowstride;\n    }\n\n  return 0;\n}\n\nstatic int\njbig2_decode_generic_template0_unopt(Jbig2Ctx *ctx,\n                               Jbig2Segment *segment,\n                               const Jbig2GenericRegionParams *params,\n                               Jbig2ArithState *as,\n                               Jbig2Image *image,\n                               Jbig2ArithCx *GB_stats)\n{\n  const int GBW = image->width;\n  const int GBH = image->height;\n  uint32_t CONTEXT;\n  int x,y;\n  bool bit;\n\n  /* this version is generic and easy to understand, but very slow */\n\n  for (y = 0; y < GBH; y++) {\n    for (x = 0; x < GBW; x++) {\n      CONTEXT = 0;\n      CONTEXT |= jbig2_image_get_pixel(image, x - 1, y) << 0;\n      CONTEXT |= jbig2_image_get_pixel(image, x - 2, y) << 1;\n      CONTEXT |= jbig2_image_get_pixel(image, x - 3, y) << 2;\n      CONTEXT |= jbig2_image_get_pixel(image, x - 4, y) << 3;\n      CONTEXT |= jbig2_image_get_pixel(image, x + params->gbat[0],\n\ty + params->gbat[1]) << 4;\n      CONTEXT |= jbig2_image_get_pixel(image, x + 2, y - 1) << 5;\n      CONTEXT |= jbig2_image_get_pixel(image, x + 1, y - 1) << 6;\n      CONTEXT |= jbig2_image_get_pixel(image, x + 0, y - 1) << 7;\n      CONTEXT |= jbig2_image_get_pixel(image, x - 1, y - 1) << 8;\n      CONTEXT |= jbig2_image_get_pixel(image, x - 2, y - 1) << 9;\n      CONTEXT |= jbig2_image_get_pixel(image, x + params->gbat[2],\n\ty + params->gbat[3]) << 10;\n      CONTEXT |= jbig2_image_get_pixel(image, x + params->gbat[4],\n\ty + params->gbat[5]) << 11;\n      CONTEXT |= jbig2_image_get_pixel(image, x + 1, y - 2) << 12;\n      CONTEXT |= jbig2_image_get_pixel(image, x + 0, y - 2) << 13;\n      CONTEXT |= jbig2_image_get_pixel(image, x - 1, y - 2) << 14;\n      CONTEXT |= jbig2_image_get_pixel(image, x + params->gbat[6],\n\ty + params->gbat[7]) << 15;\n      bit = jbig2_arith_decode(as, &GB_stats[CONTEXT]);\n      if (bit < 0)\n\treturn -1;\n      jbig2_image_set_pixel(image, x, y, bit);\n    }\n  }\n  return 0;\n}\n\nstatic int\njbig2_decode_generic_template1(Jbig2Ctx *ctx,\n\t\t\t       Jbig2Segment *segment,\n\t\t\t       const Jbig2GenericRegionParams *params,\n\t\t\t       Jbig2ArithState *as,\n\t\t\t       Jbig2Image *image,\n\t\t\t       Jbig2ArithCx *GB_stats)\n{\n  const int GBW = image->width;\n  const int GBH = image->height;\n  const int rowstride = image->stride;\n  int x, y;\n  byte *gbreg_line = (byte *)image->data;\n\n  /* todo: currently we only handle the nominal gbat location */\n\n#ifdef OUTPUT_PBM\n  printf(\"P4\\n%d %d\\n\", GBW, GBH);\n#endif\n\n  if (GBW <= 0)\n    return 0;\n\n  for (y = 0; y < GBH; y++)\n    {\n      uint32_t CONTEXT;\n      uint32_t line_m1;\n      uint32_t line_m2;\n      int padded_width = (GBW + 7) & -8;\n\n      line_m1 = (y >= 1) ? gbreg_line[-rowstride] : 0;\n      line_m2 = (y >= 2) ? gbreg_line[-(rowstride << 1)] << 5 : 0;\n      CONTEXT = ((line_m1 >> 1) & 0x1f8) | ((line_m2 >> 1) & 0x1e00);\n\n      /* 6.2.5.7 3d */\n      for (x = 0; x < padded_width; x += 8)\n\t{\n\t  byte result = 0;\n\t  int x_minor;\n\t  int minor_width = GBW - x > 8 ? 8 : GBW - x;\n\n\t  if (y >= 1)\n\t    line_m1 = (line_m1 << 8) |\n\t      (x + 8 < GBW ? gbreg_line[-rowstride + (x >> 3) + 1] : 0);\n\n\t  if (y >= 2)\n\t    line_m2 = (line_m2 << 8) |\n\t      (x + 8 < GBW ? gbreg_line[-(rowstride << 1) + (x >> 3) + 1] << 5: 0);\n\n\t  /* This is the speed-critical inner loop. */\n\t  for (x_minor = 0; x_minor < minor_width; x_minor++)\n\t    {\n\t      bool bit;\n\n\t      bit = jbig2_arith_decode(as, &GB_stats[CONTEXT]);\n\t      if (bit < 0)\n\t\treturn -1;\n\t      result |= bit << (7 - x_minor);\n\t      CONTEXT = ((CONTEXT & 0xefb) << 1) | bit |\n\t\t((line_m1 >> (8 - x_minor)) & 0x8) |\n\t\t((line_m2 >> (8 - x_minor)) & 0x200);\n\t    }\n\t  gbreg_line[x >> 3] = result;\n\t}\n#ifdef OUTPUT_PBM\n      fwrite(gbreg_line, 1, rowstride, stdout);\n#endif\n      gbreg_line += rowstride;\n    }\n\n  return 0;\n}\n\nstatic int\njbig2_decode_generic_template2(Jbig2Ctx *ctx,\n\t\t\t       Jbig2Segment *segment,\n\t\t\t       const Jbig2GenericRegionParams *params,\n\t\t\t       Jbig2ArithState *as,\n\t\t\t       Jbig2Image *image,\n\t\t\t       Jbig2ArithCx *GB_stats)\n{\n  const int GBW = image->width;\n  const int GBH = image->height;\n  const int rowstride = image->stride;\n  int x, y;\n  byte *gbreg_line = (byte *)image->data;\n\n  /* todo: currently we only handle the nominal gbat location */\n\n#ifdef OUTPUT_PBM\n  printf(\"P4\\n%d %d\\n\", GBW, GBH);\n#endif\n\n  if (GBW <= 0)\n    return 0;\n\n  for (y = 0; y < GBH; y++)\n    {\n      uint32_t CONTEXT;\n      uint32_t line_m1;\n      uint32_t line_m2;\n      int padded_width = (GBW + 7) & -8;\n\n      line_m1 = (y >= 1) ? gbreg_line[-rowstride] : 0;\n      line_m2 = (y >= 2) ? gbreg_line[-(rowstride << 1)] << 4 : 0;\n      CONTEXT = ((line_m1 >> 3) & 0x7c) | ((line_m2 >> 3) & 0x380);\n\n      /* 6.2.5.7 3d */\n      for (x = 0; x < padded_width; x += 8)\n\t{\n\t  byte result = 0;\n\t  int x_minor;\n\t  int minor_width = GBW - x > 8 ? 8 : GBW - x;\n\n\t  if (y >= 1)\n\t    line_m1 = (line_m1 << 8) |\n\t      (x + 8 < GBW ? gbreg_line[-rowstride + (x >> 3) + 1] : 0);\n\n\t  if (y >= 2)\n\t    line_m2 = (line_m2 << 8) |\n\t      (x + 8 < GBW ? gbreg_line[-(rowstride << 1) + (x >> 3) + 1] << 4: 0);\n\n\t  /* This is the speed-critical inner loop. */\n\t  for (x_minor = 0; x_minor < minor_width; x_minor++)\n\t    {\n\t      bool bit;\n\n\t      bit = jbig2_arith_decode(as, &GB_stats[CONTEXT]);\n\t      if (bit < 0)\n\t\treturn -1;\n\t      result |= bit << (7 - x_minor);\n\t      CONTEXT = ((CONTEXT & 0x1bd) << 1) | bit |\n\t\t((line_m1 >> (10 - x_minor)) & 0x4) |\n\t\t((line_m2 >> (10 - x_minor)) & 0x80);\n\t    }\n\t  gbreg_line[x >> 3] = result;\n\t}\n#ifdef OUTPUT_PBM\n      fwrite(gbreg_line, 1, rowstride, stdout);\n#endif\n      gbreg_line += rowstride;\n    }\n\n  return 0;\n}\n\nstatic int\njbig2_decode_generic_template2a(Jbig2Ctx *ctx,\n\t\t\t       Jbig2Segment *segment,\n\t\t\t       const Jbig2GenericRegionParams *params,\n\t\t\t       Jbig2ArithState *as,\n\t\t\t       Jbig2Image *image,\n\t\t\t       Jbig2ArithCx *GB_stats)\n{\n  const int GBW = image->width;\n  const int GBH = image->height;\n  const int rowstride = image->stride;\n  int x, y;\n  byte *gbreg_line = (byte *)image->data;\n\n  /* This is a special case for GBATX1 = 3, GBATY1 = -1 */\n\n#ifdef OUTPUT_PBM\n  printf(\"P4\\n%d %d\\n\", GBW, GBH);\n#endif\n\n  if (GBW <= 0)\n    return 0;\n\n  for (y = 0; y < GBH; y++)\n    {\n      uint32_t CONTEXT;\n      uint32_t line_m1;\n      uint32_t line_m2;\n      int padded_width = (GBW + 7) & -8;\n\n      line_m1 = (y >= 1) ? gbreg_line[-rowstride] : 0;\n      line_m2 = (y >= 2) ? gbreg_line[-(rowstride << 1)] << 4 : 0;\n      CONTEXT = ((line_m1 >> 3) & 0x78) | ((line_m1 >> 2) & 0x4) | ((line_m2 >> 3) & 0x380);\n\n      /* 6.2.5.7 3d */\n      for (x = 0; x < padded_width; x += 8)\n\t{\n\t  byte result = 0;\n\t  int x_minor;\n\t  int minor_width = GBW - x > 8 ? 8 : GBW - x;\n\n\t  if (y >= 1)\n\t    line_m1 = (line_m1 << 8) |\n\t      (x + 8 < GBW ? gbreg_line[-rowstride + (x >> 3) + 1] : 0);\n\n\t  if (y >= 2)\n\t    line_m2 = (line_m2 << 8) |\n\t      (x + 8 < GBW ? gbreg_line[-(rowstride << 1) + (x >> 3) + 1] << 4: 0);\n\n\t  /* This is the speed-critical inner loop. */\n\t  for (x_minor = 0; x_minor < minor_width; x_minor++)\n\t    {\n\t      bool bit;\n\n\t      bit = jbig2_arith_decode(as, &GB_stats[CONTEXT]);\n\t      if (bit < 0)\n\t\treturn -1;\n\t      result |= bit << (7 - x_minor);\n\t      CONTEXT = ((CONTEXT & 0x1b9) << 1) | bit |\n\t\t((line_m1 >> (10 - x_minor)) & 0x8) |\n\t\t((line_m1 >> (9 - x_minor)) & 0x4) |\n\t\t((line_m2 >> (10 - x_minor)) & 0x80);\n\t    }\n\t  gbreg_line[x >> 3] = result;\n\t}\n#ifdef OUTPUT_PBM\n      fwrite(gbreg_line, 1, rowstride, stdout);\n#endif\n      gbreg_line += rowstride;\n    }\n\n  return 0;\n}\n\nstatic int\njbig2_decode_generic_template3(Jbig2Ctx *ctx,\n\t\t\t       Jbig2Segment *segment,\n\t\t\t       const Jbig2GenericRegionParams *params,\n\t\t\t       Jbig2ArithState *as,\n\t\t\t       Jbig2Image *image,\n\t\t\t       Jbig2ArithCx *GB_stats)\n{\n  const int GBW = image->width;\n  const int GBH = image->height;\n  const int rowstride = image->stride;\n  byte *gbreg_line = (byte *)image->data;\n  int x, y;\n\n  /* this routine only handles the nominal AT location */\n\n#ifdef OUTPUT_PBM\n  printf(\"P4\\n%d %d\\n\", GBW, GBH);\n#endif\n\n  if (GBW <= 0)\n    return 0;\n\n  for (y = 0; y < GBH; y++)\n    {\n      uint32_t CONTEXT;\n      uint32_t line_m1;\n      int padded_width = (GBW + 7) & -8;\n\n      line_m1 = (y >= 1) ? gbreg_line[-rowstride] : 0;\n      CONTEXT = (line_m1 >> 1) & 0x3f0;\n\n      /* 6.2.5.7 3d */\n      for (x = 0; x < padded_width; x += 8)\n\t{\n\t  byte result = 0;\n\t  int x_minor;\n\t  int minor_width = GBW - x > 8 ? 8 : GBW - x;\n\n\t  if (y >= 1)\n\t    line_m1 = (line_m1 << 8) |\n\t      (x + 8 < GBW ? gbreg_line[-rowstride + (x >> 3) + 1] : 0);\n\n\t  /* This is the speed-critical inner loop. */\n\t  for (x_minor = 0; x_minor < minor_width; x_minor++)\n\t    {\n\t      bool bit;\n\n\t      bit = jbig2_arith_decode(as, &GB_stats[CONTEXT]);\n\t      if (bit < 0)\n\t\treturn -1;\n\t      result |= bit << (7 - x_minor);\n\t      CONTEXT = ((CONTEXT & 0x1f7) << 1) | bit |\n\t\t((line_m1 >> (10 - x_minor)) & 0x010);\n\t    }\n\t  gbreg_line[x >> 3] = result;\n\t}\n#ifdef OUTPUT_PBM\n      fwrite(gbreg_line, 1, rowstride, stdout);\n#endif\n      gbreg_line += rowstride;\n    }\n\n  return 0;\n}\n\nstatic int\njbig2_decode_generic_template3_unopt(Jbig2Ctx *ctx,\n                               Jbig2Segment *segment,\n                               const Jbig2GenericRegionParams *params,\n                               Jbig2ArithState *as,\n                               Jbig2Image *image,\n                               Jbig2ArithCx *GB_stats)\n{\n  const int GBW = image->width;\n  const int GBH = image->height;\n  uint32_t CONTEXT;\n  int x,y;\n  bool bit;\n\n  /* this version is generic and easy to understand, but very slow */\n\n  for (y = 0; y < GBH; y++) {\n    for (x = 0; x < GBW; x++) {\n      CONTEXT = 0;\n      CONTEXT |= jbig2_image_get_pixel(image, x - 1, y) << 0;\n      CONTEXT |= jbig2_image_get_pixel(image, x - 2, y) << 1;\n      CONTEXT |= jbig2_image_get_pixel(image, x - 3, y) << 2;\n      CONTEXT |= jbig2_image_get_pixel(image, x - 4, y) << 3;\n      CONTEXT |= jbig2_image_get_pixel(image, x + params->gbat[0],\n\ty + params->gbat[1]) << 4;\n      CONTEXT |= jbig2_image_get_pixel(image, x + 1, y - 1) << 5;\n      CONTEXT |= jbig2_image_get_pixel(image, x + 0, y - 1) << 6;\n      CONTEXT |= jbig2_image_get_pixel(image, x - 1, y - 1) << 7;\n      CONTEXT |= jbig2_image_get_pixel(image, x - 2, y - 1) << 8;\n      CONTEXT |= jbig2_image_get_pixel(image, x - 3, y - 1) << 9;\n      bit = jbig2_arith_decode(as, &GB_stats[CONTEXT]);\n      if (bit < 0)\n\treturn -1;\n      jbig2_image_set_pixel(image, x, y, bit);\n    }\n  }\n  return 0;\n}\n\nstatic void\ncopy_prev_row(Jbig2Image *image, int row)\n{\n  if (!row) {\n    /* no previous row */\n    memset( image->data, 0, image->stride );\n  } else {\n    /* duplicate data from the previous row */\n    uint8_t *src = image->data + (row - 1) * image->stride;\n    memcpy( src + image->stride, src, image->stride );\n  }\n}\n\nstatic int\njbig2_decode_generic_template0_TPGDON(Jbig2Ctx *ctx,\n\t\t\t\tJbig2Segment *segment,\n\t\t\t\tconst Jbig2GenericRegionParams *params, \n\t\t\t\tJbig2ArithState *as,\n\t\t\t\tJbig2Image *image,\n\t\t\t\tJbig2ArithCx *GB_stats)\n{\n  const int GBW = image->width;\n  const int GBH = image->height;\n  uint32_t CONTEXT;\n  int x, y;\n  bool bit;\n  int LTP = 0;\n\n  for (y = 0; y < GBH; y++)\n  {\n    bit = jbig2_arith_decode(as, &GB_stats[0x9B25]);\n    if (bit < 0)\n      return -1;\n    LTP ^= bit;\n    if (!LTP) {\n      for (x = 0; x < GBW; x++) {\n        CONTEXT  = jbig2_image_get_pixel(image, x - 1, y);\n        CONTEXT |= jbig2_image_get_pixel(image, x - 2, y) << 1;\n        CONTEXT |= jbig2_image_get_pixel(image, x - 3, y) << 2;\n        CONTEXT |= jbig2_image_get_pixel(image, x - 4, y) << 3;\n        CONTEXT |= jbig2_image_get_pixel(image, x + params->gbat[0],\n\t\t\t\t\ty + params->gbat[1]) << 4;\n        CONTEXT |= jbig2_image_get_pixel(image, x + 2, y - 1) << 5;\n        CONTEXT |= jbig2_image_get_pixel(image, x + 1, y - 1) << 6;\n        CONTEXT |= jbig2_image_get_pixel(image, x    , y - 1) << 7;\n        CONTEXT |= jbig2_image_get_pixel(image, x - 1, y - 1) << 8;\n        CONTEXT |= jbig2_image_get_pixel(image, x - 2, y - 1) << 9;\n        CONTEXT |= jbig2_image_get_pixel(image, x + params->gbat[2],\n\t\t\t\t\ty + params->gbat[3]) << 10;\n        CONTEXT |= jbig2_image_get_pixel(image, x + params->gbat[4],\n\t\t\t\t\ty + params->gbat[5]) << 11;\n        CONTEXT |= jbig2_image_get_pixel(image, x + 1, y - 2) << 12;\n        CONTEXT |= jbig2_image_get_pixel(image, x    , y - 2) << 13;\n        CONTEXT |= jbig2_image_get_pixel(image, x - 1, y - 2) << 14;\n        CONTEXT |= jbig2_image_get_pixel(image, x + params->gbat[6],\n\t\t\t\t\ty + params->gbat[7]) << 15;\n        bit = jbig2_arith_decode(as, &GB_stats[CONTEXT]);\n        if (bit < 0)\n\t  return -1;\n        jbig2_image_set_pixel(image, x, y, bit);\n      }\n    } else {\n      copy_prev_row(image, y);\n    }\n  }\n\n  return 0;\n}\n\nstatic int\njbig2_decode_generic_template1_TPGDON(Jbig2Ctx *ctx, \n\t\t\t\tJbig2Segment *segment,\n\t\t\t\tconst Jbig2GenericRegionParams *params, \n\t\t\t\tJbig2ArithState *as,\n\t\t\t\tJbig2Image *image,\n\t\t\t\tJbig2ArithCx *GB_stats)\n{\n  const int GBW = image->width;\n  const int GBH = image->height;\n  uint32_t CONTEXT;\n  int x, y;\n  bool bit;\n  int LTP = 0;\n\n  for (y = 0; y < GBH; y++) {\n    bit = jbig2_arith_decode(as, &GB_stats[0x0795]);\n    if (bit < 0)\n      return -1;\n    LTP ^= bit;\n    if (!LTP) {\n      for (x = 0; x < GBW; x++) {\n        CONTEXT  = jbig2_image_get_pixel(image, x - 1, y);\n        CONTEXT |= jbig2_image_get_pixel(image, x - 2, y) << 1;\n        CONTEXT |= jbig2_image_get_pixel(image, x - 3, y) << 2;\n        CONTEXT |= jbig2_image_get_pixel(image, x + params->gbat[0],\n\t\t\t\t\ty + params->gbat[1]) << 3;\n        CONTEXT |= jbig2_image_get_pixel(image, x + 2, y - 1) << 4;\n        CONTEXT |= jbig2_image_get_pixel(image, x + 1, y - 1) << 5;\n        CONTEXT |= jbig2_image_get_pixel(image, x    , y - 1) << 6;\n        CONTEXT |= jbig2_image_get_pixel(image, x - 1, y - 1) << 7;\n        CONTEXT |= jbig2_image_get_pixel(image, x - 2, y - 1) << 8;\n        CONTEXT |= jbig2_image_get_pixel(image, x + 2, y - 2) << 9;\n        CONTEXT |= jbig2_image_get_pixel(image, x + 1, y - 2) << 10;\n        CONTEXT |= jbig2_image_get_pixel(image, x    , y - 2) << 11;\n        CONTEXT |= jbig2_image_get_pixel(image, x - 1, y - 2) << 12;\n        bit = jbig2_arith_decode(as, &GB_stats[CONTEXT]);\n        if (bit < 0)\n\t  return -1;\n        jbig2_image_set_pixel(image, x, y, bit);\n      }\n    } else {\n      copy_prev_row(image, y);\n    }\n  }\n\n  return 0;\n}\n\nstatic int\njbig2_decode_generic_template2_TPGDON(Jbig2Ctx *ctx, \n\t\t\t\tJbig2Segment *segment,\n\t\t\t\tconst Jbig2GenericRegionParams *params,\n\t\t\t\tJbig2ArithState *as,\n\t\t\t\tJbig2Image *image,\n\t\t\t\tJbig2ArithCx *GB_stats)\n{\n  const int GBW = image->width;\n  const int GBH = image->height;\n  uint32_t CONTEXT;\n  int x, y;\n  bool bit;\n  int LTP = 0;\n\n  for (y = 0; y < GBH; y++) {\n    bit = jbig2_arith_decode(as, &GB_stats[0xE5]);\n    if (bit < 0)\n      return -1;\n    LTP ^= bit;\n    if (!LTP) {\n      for (x = 0; x < GBW; x++) {\n        CONTEXT  = jbig2_image_get_pixel(image, x - 1, y);\n        CONTEXT |= jbig2_image_get_pixel(image, x - 2, y) << 1;\n        CONTEXT |= jbig2_image_get_pixel(image, x + params->gbat[0],\n\t\t\t\t\ty + params->gbat[1]) << 2;\n        CONTEXT |= jbig2_image_get_pixel(image, x + 1, y - 1) << 3;\n        CONTEXT |= jbig2_image_get_pixel(image, x    , y - 1) << 4;\n        CONTEXT |= jbig2_image_get_pixel(image, x - 1, y - 1) << 5;\n        CONTEXT |= jbig2_image_get_pixel(image, x - 2, y - 1) << 6;\n        CONTEXT |= jbig2_image_get_pixel(image, x + 1, y - 2) << 7;\n        CONTEXT |= jbig2_image_get_pixel(image, x    , y - 2) << 8;\n        CONTEXT |= jbig2_image_get_pixel(image, x - 1, y - 2) << 9;\n        bit = jbig2_arith_decode(as, &GB_stats[CONTEXT]);\n        if (bit < 0)\n\t  return -1;\n        jbig2_image_set_pixel(image, x, y, bit);\n      }\n    } else {\n      copy_prev_row(image, y);\n    }\n  }\n\n  return 0;\n}\n\nstatic int\njbig2_decode_generic_template3_TPGDON(Jbig2Ctx *ctx, \n\t\t\t\tJbig2Segment *segment,\n\t\t\t\tconst Jbig2GenericRegionParams *params,\n\t\t\t\tJbig2ArithState *as,\n\t\t\t\tJbig2Image *image,\n\t\t\t\tJbig2ArithCx *GB_stats)\n{\n  const int GBW = image->width;\n  const int GBH = image->height;\n  uint32_t CONTEXT;\n  int x, y;\n  bool bit;\n  int LTP = 0;\n\n  for (y = 0; y < GBH; y++) {\n    bit = jbig2_arith_decode(as, &GB_stats[0x0195]);\n    if (bit < 0)\n      return -1;\n    LTP ^= bit;\n    if (!LTP) {\n      for (x = 0; x < GBW; x++) {\n        CONTEXT  = jbig2_image_get_pixel(image, x - 1, y);\n        CONTEXT |= jbig2_image_get_pixel(image, x - 2, y) << 1;\n        CONTEXT |= jbig2_image_get_pixel(image, x - 3, y) << 2;\n        CONTEXT |= jbig2_image_get_pixel(image, x - 4, y) << 3;\n        CONTEXT |= jbig2_image_get_pixel(image, x + params->gbat[0],\n\t\t\t\t\ty + params->gbat[1]) << 4;\n        CONTEXT |= jbig2_image_get_pixel(image, x + 1, y - 1) << 5;\n        CONTEXT |= jbig2_image_get_pixel(image, x    , y - 1) << 6;\n        CONTEXT |= jbig2_image_get_pixel(image, x - 1, y - 1) << 7;\n        CONTEXT |= jbig2_image_get_pixel(image, x - 2, y - 1) << 8;\n        CONTEXT |= jbig2_image_get_pixel(image, x - 3, y - 1) << 9;\n        bit = jbig2_arith_decode(as, &GB_stats[CONTEXT]);\n        if (bit < 0)\n\t  return -1;\n        jbig2_image_set_pixel(image, x, y, bit);\n      }\n    } else {\n      copy_prev_row(image, y);\n    }\n  }\n\n  return 0;\n}\n\nstatic int\njbig2_decode_generic_region_TPGDON(Jbig2Ctx *ctx,\n\t\t\t\tJbig2Segment *segment,\n\t\t\t\tconst Jbig2GenericRegionParams *params, \n\t\t\t\tJbig2ArithState *as,\n\t\t\t\tJbig2Image *image,\n\t\t\t\tJbig2ArithCx *GB_stats)\n{\n  switch (params->GBTEMPLATE) {\n    case 0:\n      return jbig2_decode_generic_template0_TPGDON(ctx, segment, \n\t\t\tparams, as, image, GB_stats);\n    case 1:\n      return jbig2_decode_generic_template1_TPGDON(ctx, segment, \n\t\t\tparams, as, image, GB_stats);\n    case 2:\n      return jbig2_decode_generic_template2_TPGDON(ctx, segment, \n\t\t\tparams, as, image, GB_stats);\n    case 3:\n      return jbig2_decode_generic_template3_TPGDON(ctx, segment, \n\t\t\tparams, as, image, GB_stats);\n  }\n\n  return -1;\n}\n\n/**\n * jbig2_decode_generic_region: Decode a generic region.\n * @ctx: The context for allocation and error reporting.\n * @segment: A segment reference for error reporting.\n * @params: Decoding parameter set.\n * @as: Arithmetic decoder state.\n * @image: Where to store the decoded data.\n * @GB_stats: Arithmetic stats.\n *\n * Decodes a generic region, according to section 6.2. The caller should\n * pass an already allocated Jbig2Image object for @image\n *\n * Because this API is based on an arithmetic decoding state, it is\n * not suitable for MMR decoding.\n *\n * Return code: 0 on success.\n **/\nint\njbig2_decode_generic_region(Jbig2Ctx *ctx,\n\t\t\t    Jbig2Segment *segment,\n\t\t\t    const Jbig2GenericRegionParams *params,\n\t\t\t    Jbig2ArithState *as,\n\t\t\t    Jbig2Image *image,\n\t\t\t    Jbig2ArithCx *GB_stats)\n{\n  const int8_t *gbat = params->gbat;\n\n  if (image->stride * image->height > (1 << 24) && segment->data_length < image->stride * image->height / 256) {\n    return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                       \"region is far larger than data provided (%d << %d), aborting to prevent DOS\",\n                       segment->data_length, image->stride * image->height);\n  }\n\n  if (!params->MMR && params->TPGDON) \n     return jbig2_decode_generic_region_TPGDON(ctx, segment, params, \n\t\tas, image, GB_stats);\n\n  if (!params->MMR && params->GBTEMPLATE == 0) {\n    if (gbat[0] == +3 && gbat[1] == -1 &&\n        gbat[2] == -3 && gbat[3] == -1 &&\n        gbat[4] == +2 && gbat[5] == -2 &&\n        gbat[6] == -2 && gbat[7] == -2)\n      return jbig2_decode_generic_template0(ctx, segment, params,\n                                          as, image, GB_stats);\n    else\n      return jbig2_decode_generic_template0_unopt(ctx, segment, params,\n                                          as, image, GB_stats);\n  } else if (!params->MMR && params->GBTEMPLATE == 1)\n    return jbig2_decode_generic_template1(ctx, segment, params,\n\t\t\t\t\t  as, image, GB_stats);\n  else if (!params->MMR && params->GBTEMPLATE == 2)\n    {\n      if (gbat[0] == 3 && gbat[1] == -1)\n\treturn jbig2_decode_generic_template2a(ctx, segment, params,\n\t\t\t\t\t       as, image, GB_stats);\n      else\n\treturn jbig2_decode_generic_template2(ctx, segment, params,\n                                              as, image, GB_stats);\n    }\n  else if (!params->MMR && params->GBTEMPLATE == 3) {\n   if (gbat[0] == 2 && gbat[1] == -1)\n     return jbig2_decode_generic_template3_unopt(ctx, segment, params,\n                                         as, image, GB_stats);\n   else\n     return jbig2_decode_generic_template3_unopt(ctx, segment, params,\n                                         as, image, GB_stats);\n  }\n\n  {\n    int i;\n    for (i = 0; i < 8; i++)\n      jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n        \"gbat[%d] = %d\", i, params->gbat[i]);\n  }\n  jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n\t      \"decode_generic_region: MMR=%d, GBTEMPLATE=%d NYI\",\n\t      params->MMR, params->GBTEMPLATE);\n  return -1;\n}\n\n/**\n * Handler for immediate generic region segments\n */\nint\njbig2_immediate_generic_region(Jbig2Ctx *ctx, Jbig2Segment *segment,\n\t\t\t       const byte *segment_data)\n{\n  Jbig2RegionSegmentInfo rsi;\n  byte seg_flags;\n  int8_t gbat[8];\n  int offset;\n  int gbat_bytes = 0;\n  Jbig2GenericRegionParams params;\n  int code = 0;\n  Jbig2Image *image = NULL;\n  Jbig2WordStream *ws = NULL;\n  Jbig2ArithState *as = NULL;\n  Jbig2ArithCx *GB_stats = NULL;\n\n  /* 7.4.6 */\n  if (segment->data_length < 18)\n    return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n\t\t       \"Segment too short\");\n\n  jbig2_get_region_segment_info(&rsi, segment_data);\n  jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,\n\t      \"generic region: %d x %d @ (%d, %d), flags = %02x\",\n\t      rsi.width, rsi.height, rsi.x, rsi.y, rsi.flags);\n\n  /* 7.4.6.2 */\n  seg_flags = segment_data[17];\n  jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,\n\t      \"segment flags = %02x\", seg_flags);\n  if ((seg_flags & 1) && (seg_flags & 6))\n    jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n\t\t\"MMR is 1, but GBTEMPLATE is not 0\");\n\n  /* 7.4.6.3 */\n  if (!(seg_flags & 1))\n    {\n      gbat_bytes = (seg_flags & 6) ? 2 : 8;\n      if (18 + gbat_bytes > segment->data_length)\n\treturn jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n\t\t\t   \"Segment too short\");\n      memcpy(gbat, segment_data + 18, gbat_bytes);\n      jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,\n\t\t  \"gbat: %d, %d\", gbat[0], gbat[1]);\n    }\n\n  offset = 18 + gbat_bytes;\n\n  /* Table 34 */\n  params.MMR = seg_flags & 1;\n  params.GBTEMPLATE = (seg_flags & 6) >> 1;\n  params.TPGDON = (seg_flags & 8) >> 3;\n  params.USESKIP = 0;\n  memcpy (params.gbat, gbat, gbat_bytes);\n\n  image = jbig2_image_new(ctx, rsi.width, rsi.height);\n  if (image == NULL)\n    return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n             \"unable to allocate generic image\");\n  jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n    \"allocated %d x %d image buffer for region decode results\",\n        rsi.width, rsi.height);\n\n  if (params.MMR)\n    {\n      code = jbig2_decode_generic_mmr(ctx, segment, &params,\n          segment_data + offset, segment->data_length - offset, image);\n    }\n  else\n    {\n      int stats_size = jbig2_generic_stats_size(ctx, params.GBTEMPLATE);\n      GB_stats = jbig2_new(ctx, Jbig2ArithCx, stats_size);\n      if (GB_stats == NULL)\n      {\n          code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n              \"unable to allocate GB_stats in jbig2_immediate_generic_region\");\n          goto cleanup;\n      }\n      memset(GB_stats, 0, stats_size);\n\n      ws = jbig2_word_stream_buf_new(ctx, segment_data + offset,\n          segment->data_length - offset);\n      if (ws == NULL)\n      {\n          code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n              \"unable to allocate ws in jbig2_immediate_generic_region\");\n          goto cleanup;\n      }\n      as = jbig2_arith_new(ctx, ws);\n      if (as == NULL)\n      {\n          code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n              \"unable to allocate as in jbig2_immediate_generic_region\");\n          goto cleanup;\n      }\n      code = jbig2_decode_generic_region(ctx, segment, &params,\n\t\t\t\t\t as, image, GB_stats);\n    }\n\n  if (code >= 0)\n    jbig2_page_add_result(ctx, &ctx->pages[ctx->current_page],\n\t\t\t  image, rsi.x, rsi.y, rsi.op);\n  else\n    jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n\t\t\"error while decoding immediate_generic_region\");\n\ncleanup:\n  jbig2_free(ctx->allocator, as);\n  jbig2_word_stream_buf_free(ctx, ws);\n  jbig2_free(ctx->allocator, GB_stats);\n  jbig2_image_release(ctx, image);\n\n  return code;\n}\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_generic.h",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n/**\n * Headers for Generic and Generic Refinement region handling\n **/\n\n/* 6.4 Table 2 */\ntypedef struct {\n  bool MMR;\n  /* GBW */\n  /* GBH */\n  int GBTEMPLATE;\n  bool TPGDON;\n  bool USESKIP;\n  /* SKIP */\n  int8_t gbat[8];\n} Jbig2GenericRegionParams;\n\n/* return the appropriate context size for the given template */\nint\njbig2_generic_stats_size(Jbig2Ctx *ctx, int template);\n\nint\njbig2_decode_generic_region(Jbig2Ctx *ctx,\n\t\t\t    Jbig2Segment *segment,\n\t\t\t    const Jbig2GenericRegionParams *params,\n\t\t\t    Jbig2ArithState *as,\n\t\t\t    Jbig2Image *image,\n\t\t\t    Jbig2ArithCx *GB_stats);\n\n\n/* 6.3 Table 6 */\ntypedef struct {\n  /* GRW */\n  /* GRH */\n  bool GRTEMPLATE;\n  Jbig2Image *reference;\n  int32_t DX, DY;\n  bool TPGRON;\n  int8_t grat[4];\n} Jbig2RefinementRegionParams;\n\nint\njbig2_decode_refinement_region(Jbig2Ctx *ctx,\n                            Jbig2Segment *segment,\n                            const Jbig2RefinementRegionParams *params,\n                            Jbig2ArithState *as,\n                            Jbig2Image *image,\n                            Jbig2ArithCx *GB_stats);\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_halftone.c",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n/* JBIG2 Pattern Dictionary and Halftone Region decoding */\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#include \"os_types.h\"\n\n#include <string.h> /* memset() */\n\n#include \"jbig2.h\"\n#include \"jbig2_priv.h\"\n#include \"jbig2_arith.h\"\n#include \"jbig2_generic.h\"\n#include \"jbig2_mmr.h\"\n#include \"jbig2_image.h\"\n#include \"jbig2_halftone.h\"\n\n/**\n * jbig2_hd_new: create a new dictionary from a collective bitmap\n */\nJbig2PatternDict *\njbig2_hd_new(Jbig2Ctx *ctx,\n\t\tconst Jbig2PatternDictParams *params,\n\t\tJbig2Image *image)\n{\n  Jbig2PatternDict *new;\n  const int N = params->GRAYMAX + 1;\n  const int HPW = params->HDPW;\n  const int HPH = params->HDPH;\n  int i;\n\n  /* allocate a new struct */\n  new = jbig2_new(ctx, Jbig2PatternDict, 1);\n  if (new != NULL) {\n    new->patterns = jbig2_new(ctx, Jbig2Image*, N);\n    if (new->patterns == NULL) {\n      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n          \"failed to allocate pattern in collective bitmap dictionary\");\n      jbig2_free(ctx->allocator, new);\n      return NULL;\n    }\n    new->n_patterns = N;\n    new->HPW = HPW;\n    new->HPH = HPH;\n\n    /* 6.7.5(4) - copy out the individual pattern images */\n    for (i = 0; i < N; i++) {\n      new->patterns[i] = jbig2_image_new(ctx, HPW, HPH);\n      if (new->patterns[i] == NULL) {\n        int j;\n        jbig2_error(ctx, JBIG2_SEVERITY_WARNING, -1,\n            \"failed to allocate pattern element image\");\n        for (j = 0; j < i; j++)\n          jbig2_free(ctx->allocator, new->patterns[j]);\n        jbig2_free(ctx->allocator, new);\n        return NULL;\n      }\n      /* compose with the REPLACE operator; the source\n         will be clipped to the destintion, selecting the\n         proper sub image */\n      jbig2_image_compose(ctx, new->patterns[i], image,\n\t\t\t  -i * HPW, 0, JBIG2_COMPOSE_REPLACE);\n    }\n  }\n  else\n  {\n      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n          \"failed to allocate collective bitmap dictionary\");\n  }\n\n  return new;\n}\n\n/**\n * jbig2_hd_release: release a pattern dictionary\n */\nvoid\njbig2_hd_release(Jbig2Ctx *ctx, Jbig2PatternDict *dict)\n{\n  int i;\n\n  if (dict == NULL) return;\n  for (i = 0; i < dict->n_patterns; i++)\n    if (dict->patterns[i]) jbig2_image_release(ctx, dict->patterns[i]);\n  jbig2_free(ctx->allocator, dict->patterns);\n  jbig2_free(ctx->allocator, dict);\n}\n\n/**\n * jbig2_decode_pattern_dict: decode pattern dictionary data\n *\n * @ctx: jbig2 decoder context\n * @segment: jbig2 segment (header) structure\n * @params: parameters from the pattern dictionary header\n * @data: pointer to text region data to be decoded\n * @size: length of text region data\n * @GB_stats: artimetic coding context to use\n *\n * Implements the patten dictionary decoding proceedure\n * described in section 6.7 of the JBIG2 spec.\n *\n * returns: a pointer to the resulting dictionary on success\n * returns: 0 on failure\n **/\nstatic Jbig2PatternDict *\njbig2_decode_pattern_dict(Jbig2Ctx *ctx, Jbig2Segment *segment,\n                             const Jbig2PatternDictParams *params,\n                             const byte *data, const size_t size,\n\t\t\t     Jbig2ArithCx *GB_stats)\n{\n  Jbig2PatternDict *hd = NULL;\n  Jbig2Image *image = NULL;\n  Jbig2GenericRegionParams rparams;\n  int code = 0;\n\n  /* allocate the collective image */\n  image = jbig2_image_new(ctx,\n\tparams->HDPW * (params->GRAYMAX + 1), params->HDPH);\n  if (image == NULL) {\n    jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n        \"failed to allocate collective bitmap for halftone dict!\");\n    return NULL;\n  }\n\n  /* fill out the generic region decoder parameters */\n  rparams.MMR = params->HDMMR;\n  rparams.GBTEMPLATE = params->HDTEMPLATE;\n  rparams.TPGDON = 0;\t/* not used if HDMMR = 1 */\n  rparams.USESKIP = 0;\n  rparams.gbat[0] = -(int8_t)params->HDPW;\n  rparams.gbat[1] = 0;\n  rparams.gbat[2] = -3;\n  rparams.gbat[3] = -1;\n  rparams.gbat[4] = 2;\n  rparams.gbat[5] = -2;\n  rparams.gbat[6] = -2;\n  rparams.gbat[7] = -2;\n\n  if (params->HDMMR) {\n    code = jbig2_decode_generic_mmr(ctx, segment, &rparams, data, size, image);\n  } else {\n    Jbig2WordStream *ws = jbig2_word_stream_buf_new(ctx, data, size);\n    if (ws != NULL)\n    {\n      Jbig2ArithState *as = jbig2_arith_new(ctx, ws);\n      if (as != NULL)\n      {\n        code = jbig2_decode_generic_region(ctx, segment, &rparams,\n            as, image, GB_stats);\n      }\n      else\n      {\n        code = jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n            \"failed to allocate storage for as in halftone dict!\");\n      }\n\n      jbig2_free(ctx->allocator, as);\n      jbig2_word_stream_buf_free(ctx, ws);\n    }\n    else\n    {\n      code = jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n          \"failed to allocate storage for ws in halftone dict!\");\n    }\n  }\n\n  if (code == 0) hd = jbig2_hd_new(ctx, params, image);\n  jbig2_image_release(ctx, image);\n\n  return hd;\n}\n\n/* 7.4.4 */\nint\njbig2_pattern_dictionary(Jbig2Ctx *ctx, Jbig2Segment *segment,\n\t\t\t const byte *segment_data)\n{\n  Jbig2PatternDictParams params;\n  Jbig2ArithCx *GB_stats = NULL;\n  byte flags;\n  int offset = 0;\n\n  /* 7.4.4.1 - Data header */\n  if (segment->data_length < 7) {\n    return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n\t\t       \"Segment too short\");\n  }\n  flags = segment_data[0];\n  params.HDMMR = flags & 1;\n  params.HDTEMPLATE = (flags & 6) >> 1;\n  params.HDPW = segment_data[1];\n  params.HDPH = segment_data[2];\n  params.GRAYMAX = jbig2_get_uint32(segment_data + 3);\n  offset += 7;\n\n  jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,\n\t\"pattern dictionary, flags=%02x, %d grays (%dx%d cell)\",\n\tflags, params.GRAYMAX + 1, params.HDPW, params.HDPH);\n\n  if (params.HDMMR && params.HDTEMPLATE) {\n    jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n\t\"HDTEMPLATE is %d when HDMMR is %d, contrary to spec\",\n\tparams.HDTEMPLATE, params.HDMMR);\n  }\n  if (flags & 0xf8) {\n    jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n\t\"Reserved flag bits non-zero\");\n  }\n\n  /* 7.4.4.2 */\n  if (!params.HDMMR) {\n    /* allocate and zero arithmetic coding stats */\n    int stats_size = jbig2_generic_stats_size(ctx, params.HDTEMPLATE);\n    GB_stats = jbig2_new(ctx, Jbig2ArithCx, stats_size);\n    if (GB_stats == NULL)\n    {\n      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n          \"failed to allocate GB_stats in pattern dictionary\");\n      return 0;\n    }\n    memset(GB_stats, 0, stats_size);\n  }\n\n  segment->result = jbig2_decode_pattern_dict(ctx, segment, &params,\n\t\t\tsegment_data + offset,\n\t\t\tsegment->data_length - offset, GB_stats);\n\n  /* todo: retain GB_stats? */\n  if (!params.HDMMR) {\n    jbig2_free(ctx->allocator, GB_stats);\n  }\n\n  return (segment->result != NULL) ? 0 : -1;\n}\n\n/**\n * jbig2_decode_gray_scale_image: decode gray-scale image\n *\n * @ctx: jbig2 decoder context\n * @segment: jbig2 segment (header) structure\n * @data: pointer to text region data to be decoded\n * @size: length of text region data\n * @GSMMR: if MMR is used\n * @GSW: width of gray-scale image\n * @GSH: height of gray-scale image\n * @GSBPP: number of bitplanes/Jbig2Images to use \n * @GSKIP: mask indicating which values should be skipped\n * @GSTEMPLATE: template used to code the gray-scale bitplanes\n * @GB_stats: artimetic coding context to use\n *\n * Implements the decoding a gray-scale image described in\n * annex C.5. This is part of the halftone region decoding.\n *\n * returns: array of gray-scale values with GSW x GSH width/height\n *          0 on failure\n **/\nuint8_t **\njbig2_decode_gray_scale_image(Jbig2Ctx *ctx, Jbig2Segment* segment,\n                              const byte *data, const size_t size,\n                              bool GSMMR, uint32_t GSW, uint32_t GSH, \n                              uint32_t GSBPP, bool GSUSESKIP,\n                              Jbig2Image *GSKIP, int GSTEMPLATE,\n                              Jbig2ArithCx *GB_stats)\n{\n  uint8_t **GSVALS = NULL;\n  size_t consumed_bytes = 0;\n  int i, j, code, stride;\n  int x, y;\n  Jbig2Image **GSPLANES;\n  Jbig2GenericRegionParams rparams;\n  Jbig2WordStream *ws = NULL;\n  Jbig2ArithState *as = NULL;\n\n  /* allocate GSPLANES */\n  GSPLANES = jbig2_new(ctx, Jbig2Image*, GSBPP);\n  if (GSPLANES == NULL) {\n    jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                \"failed to allocate %d bytes for GSPLANES\", GSBPP);\n    return NULL;\n  }\n\n  for (i = 0; i < GSBPP; ++i) {\n    GSPLANES[i] = jbig2_image_new(ctx, GSW, GSH);\n    if (GSPLANES[i] == NULL) {\n      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                  \"failed to allocate %dx%d image for GSPLANES\", GSW, GSH);\n      /* free already allocated */\n      for (j = i-1; j >= 0; --j) {\n        jbig2_image_release(ctx, GSPLANES[j]);\n      }\n      jbig2_free(ctx->allocator, GSPLANES);\n      return NULL;\n    }\n  }\n\n  /* C.5 step 1. Decode GSPLANES[GSBPP-1] */ \n  /* fill generic region decoder parameters */\n  rparams.MMR = GSMMR;\n  rparams.GBTEMPLATE = GSTEMPLATE;\n  rparams.TPGDON = 0;\n  rparams.USESKIP = GSUSESKIP;\n  rparams.gbat[0] = (GSTEMPLATE <= 1? 3 : 2);\n  rparams.gbat[1] = -1;\n  rparams.gbat[2] = -3;\n  rparams.gbat[3] = -1;\n  rparams.gbat[4] = 2;\n  rparams.gbat[5] = -2;\n  rparams.gbat[6] = -2;\n  rparams.gbat[7] = -2;\n\n  if (GSMMR) {\n    code = jbig2_decode_halftone_mmr(ctx, &rparams, data, size,\n                                     GSPLANES[GSBPP-1], &consumed_bytes);\n  } else {\n    ws = jbig2_word_stream_buf_new(ctx, data, size);\n    if (ws == NULL)\n    {\n      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n        \"failed to allocate ws in jbig2_decode_gray_scale_image\");\n      goto cleanup;\n    }\n\n    as = jbig2_arith_new(ctx, ws);\n    if (as == NULL)\n    {\n      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n        \"failed to allocate as in jbig2_decode_gray_scale_image\");\n      goto cleanup;\n    }\n\n    code = jbig2_decode_generic_region(ctx, segment, &rparams, as,\n                                       GSPLANES[GSBPP-1], GB_stats);\n\n  }\n  if (code != 0) {\n    jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                \"error decoding GSPLANES for halftone image\");\n    goto cleanup;\n  }\n\n  /* C.5 step 2. Set j = GSBPP-2 */ \n  j = GSBPP - 2;\n  /* C.5 step 3. decode loop */ \n  while(j >= 0) {\n    /*  C.5 step 3. (a) */\n    if (GSMMR) {\n      code = jbig2_decode_halftone_mmr(ctx, &rparams, data + consumed_bytes,\n                                       size - consumed_bytes, GSPLANES[j],\n                                       &consumed_bytes);\n    } else {\n      code = jbig2_decode_generic_region(ctx, segment, &rparams, as,\n                                         GSPLANES[j], GB_stats);\n    }\n    if (code != 0) {\n      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                  \"error decoding GSPLANES for halftone image\");\n      goto cleanup;\n    }\n\n    /* C.5 step 3. (b):\n     * for each [x,y]\n     * GSPLANES[j][x][y] = GSPLANES[j+1][x][y] XOR GSPLANES[j][x][y] */\n    stride = GSPLANES[0]->stride;\n    for (i=0; i < stride * GSH; ++i)\n      GSPLANES[j]->data[i] ^= GSPLANES[j+1]->data[i];\n\n    /*  C.5 step 3. (c) */\n    --j;\n  }\n\n  /* allocate GSVALS */\n  GSVALS = jbig2_new(ctx, uint8_t* , GSW);\n  if (GSVALS == NULL) {\n    jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                \"failed to allocate GSVALS: %d bytes\", GSW);\n    goto cleanup;\n  }\n  for (i=0; i<GSW; ++i) {\n    GSVALS[i] = jbig2_new(ctx, uint8_t , GSH);\n    if (GSVALS[i] == NULL) {\n      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                  \"failed to allocate GSVALS: %d bytes\", GSH * GSW);\n      /* free already allocated */\n      for (j = i-1; j >= 0; --j) {\n        jbig2_free(ctx->allocator, GSVALS[j]);\n      }\n      jbig2_free(ctx->allocator, GSVALS);\n      GSVALS = NULL;\n      goto cleanup;\n    }\n  }\n\n  /*  C.5 step 4.  */\n  for (x = 0; x < GSW; ++x) {\n    for (y = 0; y < GSH; ++y) {\n      GSVALS[x][y] = 0;\n\n      for (j = 0; j < GSBPP; ++j)\n        GSVALS[x][y] += jbig2_image_get_pixel(GSPLANES[j], x, y) << j;\n    }\n  }\n\ncleanup:\n  /* free memory */\n  if (!GSMMR) {\n    jbig2_free(ctx->allocator, as);\n    jbig2_word_stream_buf_free(ctx, ws);\n  }\n  for (i=0; i< GSBPP; ++i)\n    jbig2_image_release(ctx, GSPLANES[i]);\n\n  jbig2_free(ctx->allocator, GSPLANES);\n\n  return GSVALS;\n}\n\n/**\n * jbig2_decode_ht_region_get_hpats: get pattern dictionary \n *\n * @ctx: jbig2 decoder context\n * @segment: jbig2 halftone region segment \n *\n * Returns the first referred pattern dictionary of segment \n *\n * returns: pattern dictionary\n *          0 if search failed\n **/\nJbig2PatternDict * \njbig2_decode_ht_region_get_hpats(Jbig2Ctx *ctx, Jbig2Segment *segment)\n{\n  int index = 0;\n  Jbig2PatternDict *pattern_dict = NULL;\n  Jbig2Segment *rsegment = NULL;\n\n  /* loop through all referred segments */\n  while (!pattern_dict && segment->referred_to_segment_count > index) {\n    rsegment = jbig2_find_segment(ctx, segment->referred_to_segments[index]);\n    if (rsegment) {\n      /* segment type is pattern dictionary and result is not empty */\n      if ((rsegment->flags & 0x3f) == 16 && rsegment->result) {\n        pattern_dict = (Jbig2PatternDict *) rsegment->result;\n        return pattern_dict;\n      }\n    }\n    index++;\n  }\n  return pattern_dict;\n}\n\n/**\n * jbig2_decode_halftone_region: decode a halftone region\n *\n * @ctx: jbig2 decoder context\n * @segment: jbig2 halftone region segment \n * @params: parameters \n * @data: pointer to halftone region data to be decoded\n * @size: length of halftone region data\n * @GB_stats: artimetic coding context to use\n *\n * Implements the halftone region decoding proceedure\n * described in section 6.6.5 of the JBIG2 spec.\n *\n * returns: 0 on success\n *         <0 on failure\n **/\nint\njbig2_decode_halftone_region(Jbig2Ctx *ctx, Jbig2Segment *segment,\n\t\t\t     Jbig2HalftoneRegionParams *params,\n\t\t\t     const byte *data, const size_t size,\n\t\t\t     Jbig2Image *image,\n\t\t\t     Jbig2ArithCx *GB_stats)\n{\n  uint32_t HBPP;\n  uint32_t HNUMPATS;\n  uint8_t **GI;\n  Jbig2Image *HSKIP = NULL;\n  Jbig2PatternDict * HPATS;\n  int i;\n  uint32_t mg, ng;\n  int32_t x, y;\n  uint8_t gray_val;\n\n  /* 6.6.5 point 1. Fill bitmap with HDEFPIXEL */\n  memset(image->data, params->HDEFPIXEL, image->stride * image->height);\n\n  /* 6.6.5 point 2. compute HSKIP */\n  if (params->HENABLESKIP == 1) {\n    jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n                \"unhandled option HENABLESKIP\");\n  }\n\n  /* 6.6.5 point 3. set HBPP to ceil(log2(HNUMPATS)): \n   * we need the number of patterns used in this region (HNUMPATS)\n   * get it from referred pattern dictionary */\n\n  HPATS = jbig2_decode_ht_region_get_hpats(ctx, segment);\n  if (!HPATS) {\n    jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n    \"no pattern dictionary found, skipping halftone image\");\n    return -1;\n  }\n  HNUMPATS = HPATS->n_patterns;\n\n  /* calculate ceil(log2(HNUMPATS)) */\n  HBPP = 0; \n  while(HNUMPATS > (1 << ++HBPP));\n\n  /* 6.6.5 point 4. decode gray-scale image as mentioned in annex C */\n  GI = jbig2_decode_gray_scale_image(ctx, segment, data, size,\n                                     params->HMMR, params->HGW,\n                                     params->HGH, HBPP, params->HENABLESKIP,\n                                     HSKIP, params->HTEMPLATE,\n                                     GB_stats); \n\n  if (!GI) {\n    jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n    \"unable to acquire gray-scale image, skipping halftone image\");\n    return -1;\n  }\n\n  /* 6.6.5 point 5. place patterns with procedure mentioned in 6.6.5.2 */\n  for (mg = 0 ; mg < params->HGH ; ++mg) {\n    for (ng = 0 ; ng < params->HGW ; ++ng ) {\n      x = (params->HGX + mg * params->HRY + ng * params->HRX) >> 8;\n      y = (params->HGY + mg * params->HRX - ng * params->HRY) >> 8;\n\n      /* prevent pattern index >= HNUMPATS */\n      gray_val = GI[ng][mg];\n      if (gray_val >= HNUMPATS) {\n        jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n                    \"gray-scale image uses value %d which larger than pattern dictionary\",\n                    gray_val);\n        /* use highest aviable pattern */\n        gray_val = HNUMPATS - 1;\n      }\n      jbig2_image_compose(ctx, image, HPATS->patterns[gray_val], x, y, params->op);\n    }\n  }\n\n  /* free GI */\n  for (i = 0; i < params->HGW; ++i) {\n    jbig2_free(ctx->allocator, GI[i]);\n  }\n  jbig2_free(ctx->allocator, GI);\n\n  return 0;\n}\n\n/**\n * jbig2_halftone_region: read a halftone region segment header\n **/\nint\njbig2_halftone_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte *segment_data)\n{\n  int offset = 0;\n  Jbig2RegionSegmentInfo region_info;\n  Jbig2HalftoneRegionParams params;\n  Jbig2Image *image = NULL;\n  Jbig2ArithCx *GB_stats = NULL;\n  int code = 0;\n\n  /* 7.4.5.1 */\n  if (segment->data_length < 17) goto too_short;\n  jbig2_get_region_segment_info(&region_info, segment_data);\n  offset += 17;\n\n  if (segment->data_length < 18) goto too_short;\n\n  /* 7.4.5.1.1 */\n  params.flags = segment_data[offset];\n  params.HMMR = params.flags & 1;\n  params.HTEMPLATE = (params.flags & 6) >> 1;\n  params.HENABLESKIP = (params.flags & 8) >> 3;\n  params.op = (Jbig2ComposeOp)((params.flags & 0x70) >> 4);\n  params.HDEFPIXEL = (params.flags &0x80) >> 7;\n  offset += 1;\n\n  jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,\n\t\"halftone region: %d x %d @ (%x,%d) flags=%02x\",\n\tregion_info.width, region_info.height,\n        region_info.x, region_info.y, params.flags);\n\n  if (params.HMMR && params.HTEMPLATE) {\n    jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n\t\"HTEMPLATE is %d when HMMR is %d, contrary to spec\",\n\tparams.HTEMPLATE, params.HMMR);\n  }\n  if (params.HMMR && params.HENABLESKIP) {\n    jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n\t\"HENABLESKIP is %d when HMMR is %d, contrary to spec\",\n\tparams.HENABLESKIP, params.HMMR);\n  }\n\n  /* Figure 43 */\n  if (segment->data_length - offset < 16) goto too_short;\n  params.HGW = jbig2_get_uint32(segment_data + offset);\n  params.HGH = jbig2_get_uint32(segment_data + offset + 4);\n  params.HGX = jbig2_get_int32(segment_data + offset + 8);\n  params.HGY = jbig2_get_int32(segment_data + offset + 12);\n  offset += 16;\n\n  /* Figure 44 */\n  if (segment->data_length - offset < 4) goto too_short;\n  params.HRX = jbig2_get_uint16(segment_data + offset);\n  params.HRY = jbig2_get_uint16(segment_data + offset + 2);\n  offset += 4;\n\n  jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,\n\t\" grid %d x %d @ (%d.%d,%d.%d) vector (%d.%d,%d.%d)\",\n\tparams.HGW, params.HGH,\n\tparams.HGX >> 8, params.HGX & 0xff,\n\tparams.HGY >> 8, params.HGY & 0xff,\n\tparams.HRX >> 8, params.HRX & 0xff,\n\tparams.HRY >> 8, params.HRY & 0xff);\n\n  /* 7.4.5.2.2 */\n  if (!params.HMMR) {\n    /* allocate and zero arithmetic coding stats */\n    int stats_size = jbig2_generic_stats_size(ctx, params.HTEMPLATE);\n    GB_stats = jbig2_new(ctx, Jbig2ArithCx, stats_size);\n    if (GB_stats == NULL)\n    {\n      return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n          \"failed to allocate GB_stats in halftone region\");\n    }\n    memset(GB_stats, 0, stats_size);\n  }\n\n  image = jbig2_image_new(ctx, region_info.width, region_info.height);\n  if (image == NULL)\n  {\n    jbig2_free(ctx->allocator, GB_stats);\n    return jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n        \"unable to allocate halftone image\");\n  }\n\n  code = jbig2_decode_halftone_region(ctx, segment, &params,\n\t\tsegment_data + offset, segment->data_length - offset,\n\t\timage, GB_stats);\n\n  /* todo: retain GB_stats? */\n  if (!params.HMMR) {\n    jbig2_free(ctx->allocator, GB_stats);\n  }\n\n  jbig2_page_add_result(ctx, &ctx->pages[ctx->current_page],\n\t\t\timage, region_info.x, region_info.y, region_info.op);\n  jbig2_image_release(ctx, image);\n\n  return code;\n\ntoo_short:\n    return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                       \"Segment too short\");\n}\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_halftone.h",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n#ifndef _JBIG2_HALFTONE_H\n#define _JBIG2_HALFTONE_H\n\ntypedef struct {\n  int n_patterns;\n  Jbig2Image **patterns;\n  int HPW, HPH;\n} Jbig2PatternDict;\n\n\n/* Table 24 */\ntypedef struct {\n  bool HDMMR;\n  uint32_t HDPW;\n  uint32_t HDPH;\n  uint32_t GRAYMAX;\n  int HDTEMPLATE;\n} Jbig2PatternDictParams;\n\n/* Table 33 */\ntypedef struct {\n  byte flags;\n  uint32_t HGW;\n  uint32_t HGH;\n  int32_t  HGX;\n  int32_t  HGY;\n  uint16_t HRX;\n  uint16_t HRY;\n  bool HMMR;\n  int HTEMPLATE;\n  bool HENABLESKIP;\n  Jbig2ComposeOp op;\n  bool HDEFPIXEL;\n} Jbig2HalftoneRegionParams;\n\nJbig2PatternDict* \njbig2_hd_new(Jbig2Ctx *ctx, const Jbig2PatternDictParams *params, \n             Jbig2Image *image);\n\nvoid\njbig2_hd_release(Jbig2Ctx *ctx, Jbig2PatternDict *dict);\n\nuint8_t **\njbig2_decode_gray_scale_image(Jbig2Ctx *ctx, Jbig2Segment* segment,\n                              const byte *data, const size_t size,\n                              bool GSMMR, uint32_t GSW, uint32_t GSH,\n                              uint32_t GSBPP, bool GSUSESKIP,\n                              Jbig2Image *GSKIP, int GSTEMPLATE,\n                              Jbig2ArithCx *GB_stats);\n\nJbig2PatternDict *\njbig2_decode_ht_region_get_hpats(Jbig2Ctx *ctx, Jbig2Segment *segment);\n\nint\njbig2_decode_halftone_region(Jbig2Ctx *ctx, Jbig2Segment *segment,\n                             Jbig2HalftoneRegionParams *params,\n                             const byte *data, const size_t size,\n                             Jbig2Image *image,\n                             Jbig2ArithCx *GB_stats);\n\n#endif /* _JBIG2_HALFTONE_H */\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_huffman.c",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n/* Huffman table decoding procedures\n    -- See Annex B of the JBIG2 specification */\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#include \"os_types.h\"\n\n#include <stdlib.h>\n#include <string.h>\n\n#ifdef JBIG2_DEBUG\n#include <stdio.h>\n#endif\n\n#include \"jbig2.h\"\n#include \"jbig2_priv.h\"\n#include \"jbig2_huffman.h\"\n#include \"jbig2_hufftab.h\"\n\n#define JBIG2_HUFFMAN_FLAGS_ISOOB 1\n#define JBIG2_HUFFMAN_FLAGS_ISLOW 2\n#define JBIG2_HUFFMAN_FLAGS_ISEXT 4\n\n\n\nstruct _Jbig2HuffmanState {\n  /* The current bit offset is equal to (offset * 8) + offset_bits.\n     The MSB of this_word is the current bit offset. The MSB of next_word\n     is (offset + 4) * 8. */\n  uint32_t this_word;\n  uint32_t next_word;\n  int offset_bits;\n  int offset;\n  int offset_limit;\n\n  Jbig2WordStream *ws;\n  Jbig2Ctx *ctx;\n};\n\n\nstatic uint32_t\nhuff_get_next_word(Jbig2HuffmanState *hs, int offset)\n{\n  uint32_t word = 0;\n  Jbig2WordStream *ws = hs->ws;\n  if ((ws->get_next_word (ws, offset, &word)) &&\n      ((hs->offset_limit == 0) || (offset < hs->offset_limit)))\n      hs->offset_limit = offset;\n  return word;\n}\n\n\n/** Allocate and initialize a new huffman coding state\n *  the returned pointer can simply be freed; this does\n *  not affect the associated Jbig2WordStream.\n */\nJbig2HuffmanState *\njbig2_huffman_new (Jbig2Ctx *ctx, Jbig2WordStream *ws)\n{\n  Jbig2HuffmanState *result = NULL;\n\n  result = jbig2_new(ctx, Jbig2HuffmanState, 1);\n\n  if (result != NULL) {\n      result->offset = 0;\n      result->offset_bits = 0;\n      result->offset_limit = 0;\n      result->ws = ws;\n      result->ctx = ctx;\n      result->this_word = huff_get_next_word(result, 0);\n      result->next_word = huff_get_next_word(result, 4);\n  } else {\n      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n          \"failed to allocate new huffman coding state\");\n  }\n\n  return result;\n}\n\n/** Free an allocated huffman coding state.\n *  This just calls jbig2_free() if the pointer is not NULL\n */\nvoid\njbig2_huffman_free (Jbig2Ctx *ctx, Jbig2HuffmanState *hs)\n{\n  if (hs != NULL) jbig2_free(ctx->allocator, hs);\n  return;\n}\n\n/** debug routines **/\n#ifdef JBIG2_DEBUG\n\n/** print current huffman state */\nvoid jbig2_dump_huffman_state(Jbig2HuffmanState *hs) {\n  fprintf(stderr, \"huffman state %08x %08x offset %d.%d\\n\",\n\ths->this_word, hs->next_word, hs->offset, hs->offset_bits);\n}\n\n/** print the binary string we're reading from */\nvoid jbig2_dump_huffman_binary(Jbig2HuffmanState *hs)\n{\n  const uint32_t word = hs->this_word;\n  int i;\n\n  fprintf(stderr, \"huffman binary \");\n  for (i = 31; i >= 0; i--)\n    fprintf(stderr, ((word >> i) & 1) ? \"1\" : \"0\");\n  fprintf(stderr, \"\\n\");\n}\n\n/** print huffman table */\nvoid jbig2_dump_huffman_table(const Jbig2HuffmanTable *table)\n{\n    int i;\n    int table_size = (1 << table->log_table_size);\n    fprintf(stderr, \"huffman table %p (log_table_size=%d, %d entries, entryies=%p):\\n\", table, table->log_table_size, table_size, table->entries);\n    for (i = 0; i < table_size; i++) {\n        fprintf(stderr, \"%6d: PREFLEN=%d, RANGELEN=%d, \", i, table->entries[i].PREFLEN, table->entries[i].RANGELEN);\n        if ( table->entries[i].flags & JBIG2_HUFFMAN_FLAGS_ISEXT ) {\n            fprintf(stderr, \"ext=%p\", table->entries[i].u.ext_table);\n        } else {\n            fprintf(stderr, \"RANGELOW=%d\", table->entries[i].u.RANGELOW);\n        }\n        if ( table->entries[i].flags ) {\n            int need_comma = 0;\n            fprintf(stderr, \", flags=0x%x(\", table->entries[i].flags);\n            if ( table->entries[i].flags & JBIG2_HUFFMAN_FLAGS_ISOOB ) {\n                fprintf(stderr, \"OOB\");\n                need_comma = 1;\n            }\n            if ( table->entries[i].flags & JBIG2_HUFFMAN_FLAGS_ISLOW ) {\n                if ( need_comma )\n                    fprintf(stderr, \",\");\n                fprintf(stderr, \"LOW\");\n                need_comma = 1;\n            }\n            if ( table->entries[i].flags & JBIG2_HUFFMAN_FLAGS_ISEXT ) {\n                if ( need_comma )\n                    fprintf(stderr, \",\");\n                fprintf(stderr, \"EXT\");\n            }\n            fprintf(stderr, \")\");\n        }\n        fprintf(stderr, \"\\n\");\n    }\n    fprintf(stderr, \"\\n\");\n}\n\n#endif /* JBIG2_DEBUG */\n\n/** Skip bits up to the next byte boundary\n */\nvoid\njbig2_huffman_skip(Jbig2HuffmanState *hs)\n{\n  int bits = hs->offset_bits & 7;\n\n  if (bits) {\n    bits = 8 - bits;\n    hs->offset_bits += bits;\n    hs->this_word = (hs->this_word << bits) |\n\t(hs->next_word >> (32 - hs->offset_bits));\n  }\n\n  if (hs->offset_bits >= 32) {\n    hs->this_word = hs->next_word;\n    hs->offset += 4;\n    hs->next_word = huff_get_next_word(hs, hs->offset + 4);\n    hs->offset_bits -= 32;\n    if (hs->offset_bits) {\n      hs->this_word = (hs->this_word << hs->offset_bits) |\n\t(hs->next_word >> (32 - hs->offset_bits));\n    }\n  }\n}\n\n/* skip ahead a specified number of bytes in the word stream\n */\nvoid jbig2_huffman_advance(Jbig2HuffmanState *hs, int offset)\n{\n  hs->offset += offset & ~3;\n  hs->offset_bits += (offset & 3) << 3;\n  if (hs->offset_bits >= 32) {\n    hs->offset += 4;\n    hs->offset_bits -= 32;\n  }\n  hs->this_word = huff_get_next_word(hs, hs->offset);\n  hs->next_word = huff_get_next_word(hs, hs->offset + 4);\n  if (hs->offset_bits > 0)\n    hs->this_word = (hs->this_word << hs->offset_bits) |\n\t(hs->next_word >> (32 - hs->offset_bits));\n}\n\n/* return the offset of the huffman decode pointer (in bytes)\n * from the beginning of the WordStream\n */\nint\njbig2_huffman_offset(Jbig2HuffmanState *hs)\n{\n  return hs->offset + (hs->offset_bits >> 3);\n}\n\n/* read a number of bits directly from the huffman state\n * without decoding against a table\n */\nint32_t\njbig2_huffman_get_bits (Jbig2HuffmanState *hs, const int bits, int *err)\n{\n  uint32_t this_word = hs->this_word;\n  int32_t result;\n\n  if (hs->offset_limit && hs->offset >= hs->offset_limit) {\n    jbig2_error(hs->ctx, JBIG2_SEVERITY_FATAL, -1,\n      \"end of jbig2 buffer reached at offset %d\", hs->offset);\n    *err = -1;\n    return -1;\n  }\n\n  result = this_word >> (32 - bits);\n  hs->offset_bits += bits;\n  if (hs->offset_bits >= 32) {\n    hs->offset += 4;\n    hs->offset_bits -= 32;\n    hs->this_word = hs->next_word;\n    hs->next_word = huff_get_next_word(hs, hs->offset + 4);\n    if (hs->offset_bits) {\n      hs->this_word = (hs->this_word << hs->offset_bits) |\n\t(hs->next_word >> (32 - hs->offset_bits));\n    } else {\n      hs->this_word = (hs->this_word << hs->offset_bits);\n    }\n  } else {\n    hs->this_word = (this_word << bits) |\n\t(hs->next_word >> (32 - hs->offset_bits));\n  }\n\n  return result;\n}\n\nint32_t\njbig2_huffman_get (Jbig2HuffmanState *hs,\n\t\t   const Jbig2HuffmanTable *table, bool *oob)\n{\n  Jbig2HuffmanEntry *entry;\n  byte flags;\n  int offset_bits = hs->offset_bits;\n  uint32_t this_word = hs->this_word;\n  uint32_t next_word;\n  int RANGELEN;\n  int32_t result;\n\n  if (hs->offset_limit && hs->offset >= hs->offset_limit) {\n    jbig2_error(hs->ctx, JBIG2_SEVERITY_FATAL, -1,\n      \"end of Jbig2WordStream reached at offset %d\", hs->offset);\n    if (oob)\n      *oob = -1;\n    return -1;\n  }\n\n  for (;;)\n    {\n      int log_table_size = table->log_table_size;\n      int PREFLEN;\n\n      /* SumatraPDF: shifting by the size of the operand is undefined */\n      entry = &table->entries[log_table_size > 0 ? this_word >> (32 - log_table_size) : 0];\n      flags = entry->flags;\n      PREFLEN = entry->PREFLEN;\n      if ((flags == (byte)-1) && (PREFLEN == (byte)-1) && (entry->u.RANGELOW == -1))\n      {\n          if (oob)\n              *oob = -1;\n          return -1;\n      }\n\n      next_word = hs->next_word;\n      offset_bits += PREFLEN;\n      if (offset_bits >= 32)\n\t{\n\t  this_word = next_word;\n\t  hs->offset += 4;\n\t  next_word = huff_get_next_word(hs, hs->offset + 4);\n\t  offset_bits -= 32;\n\t  hs->next_word = next_word;\n\t  PREFLEN = offset_bits;\n\t}\n      if (PREFLEN)\n\tthis_word = (this_word << PREFLEN) |\n\t  (next_word >> (32 - offset_bits));\n      if (flags & JBIG2_HUFFMAN_FLAGS_ISEXT)\n\t{\n\t  table = entry->u.ext_table;\n\t}\n      else\n\tbreak;\n    }\n  result = entry->u.RANGELOW;\n  RANGELEN = entry->RANGELEN;\n  if (RANGELEN > 0)\n    {\n      int32_t HTOFFSET;\n\n      HTOFFSET = this_word >> (32 - RANGELEN);\n      if (flags & JBIG2_HUFFMAN_FLAGS_ISLOW)\n\tresult -= HTOFFSET;\n      else\n\tresult += HTOFFSET;\n\n      offset_bits += RANGELEN;\n      if (offset_bits >= 32)\n\t{\n\t  this_word = next_word;\n\t  hs->offset += 4;\n\t  next_word = huff_get_next_word(hs, hs->offset + 4);\n\t  offset_bits -= 32;\n\t  hs->next_word = next_word;\n\t  RANGELEN = offset_bits;\n\t}\nif (RANGELEN)\n      this_word = (this_word << RANGELEN) |\n\t(next_word >> (32 - offset_bits));\n    }\n\n  hs->this_word = this_word;\n  hs->offset_bits = offset_bits;\n\n  if (oob != NULL)\n    *oob = (flags & JBIG2_HUFFMAN_FLAGS_ISOOB);\n\n  return result;\n}\n\n/* TODO: more than 8 bits here is wasteful of memory. We have support\n   for sub-trees in jbig2_huffman_get() above, but don't use it here.\n   We should, and then revert to 8 bits */\n#define LOG_TABLE_SIZE_MAX 16\n\n/** Build an in-memory representation of a Huffman table from the\n *  set of template params provided by the spec or a table segment\n */\nJbig2HuffmanTable *\njbig2_build_huffman_table (Jbig2Ctx *ctx, const Jbig2HuffmanParams *params)\n{\n  int *LENCOUNT;\n  int LENMAX = -1;\n  const int lencountcount = 256;\n  const Jbig2HuffmanLine *lines = params->lines;\n  int n_lines = params->n_lines;\n  int i, j;\n  int max_j;\n  int log_table_size = 0;\n  Jbig2HuffmanTable *result;\n  Jbig2HuffmanEntry *entries;\n  int CURLEN;\n  int firstcode = 0;\n  int CURCODE;\n  int CURTEMP;\n\n  LENCOUNT = jbig2_new(ctx, int, lencountcount);\n  if (LENCOUNT == NULL) {\n    jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n      \"couldn't allocate storage for huffman histogram\");\n    return NULL;\n  }\n  memset(LENCOUNT, 0, sizeof(int) * lencountcount);\n\n  /* B.3, 1. */\n  for (i = 0; i < params->n_lines; i++)\n    {\n      int PREFLEN = lines[i].PREFLEN;\n      int lts;\n\n      if (PREFLEN > LENMAX)\n\t\t{\n\t\t\tfor (j = LENMAX + 1; j < PREFLEN + 1; j++)\n\t\t\t\tLENCOUNT[j] = 0;\n\t\t\tLENMAX = PREFLEN;\n\t\t}\n      LENCOUNT[PREFLEN]++;\n\n      lts = PREFLEN + lines[i].RANGELEN;\n      if (lts > LOG_TABLE_SIZE_MAX)\n\t\tlts = PREFLEN;\n      if (lts <= LOG_TABLE_SIZE_MAX && log_table_size < lts)\n\t\tlog_table_size = lts;\n    }\n  jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, -1,\n\t\"constructing huffman table log size %d\", log_table_size);\n  max_j = 1 << log_table_size;\n\n  result = jbig2_new(ctx, Jbig2HuffmanTable, 1);\n  if (result == NULL)\n  {\n    jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n        \"couldn't allocate result storage in jbig2_build_huffman_table\");\n    jbig2_free(ctx->allocator, LENCOUNT);\n    return NULL;\n  }\n  result->log_table_size = log_table_size;\n  entries = jbig2_new(ctx, Jbig2HuffmanEntry, max_j);\n  if (entries == NULL)\n  {\n    jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n        \"couldn't allocate entries storage in jbig2_build_huffman_table\");\n    jbig2_free(ctx->allocator, result);\n    jbig2_free(ctx->allocator, LENCOUNT);\n    return NULL;\n  }\n  /* fill now to catch missing JBIG2Globals later */\n  memset(entries, 0xFF, sizeof(Jbig2HuffmanEntry)*max_j);\n  result->entries = entries;\n\n  LENCOUNT[0] = 0;\n\n  for (CURLEN = 1; CURLEN <= LENMAX; CURLEN++)\n    {\n      int shift = log_table_size - CURLEN;\n\n      /* B.3 3.(a) */\n      firstcode = (firstcode + LENCOUNT[CURLEN - 1]) << 1;\n      CURCODE = firstcode;\n      /* B.3 3.(b) */\n      for (CURTEMP = 0; CURTEMP < n_lines; CURTEMP++)\n\t{\n\t  int PREFLEN = lines[CURTEMP].PREFLEN;\n\t  if (PREFLEN == CURLEN)\n\t    {\n\t      int RANGELEN = lines[CURTEMP].RANGELEN;\n\t      int start_j = CURCODE << shift;\n\t      int end_j = (CURCODE + 1) << shift;\n\t      byte eflags = 0;\n\n\t      if (end_j > max_j) {\n\t\tjbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n\t\t  \"ran off the end of the entries table! (%d >= %d)\",\n\t\t  end_j, max_j);\n\t\tjbig2_free(ctx->allocator, result->entries);\n\t\tjbig2_free(ctx->allocator, result);\n\t\tjbig2_free(ctx->allocator, LENCOUNT);\n\t\treturn NULL;\n\t      }\n\t      /* todo: build extension tables */\n\t      if (params->HTOOB && CURTEMP == n_lines - 1)\n\t\teflags |= JBIG2_HUFFMAN_FLAGS_ISOOB;\n\t      if (CURTEMP == n_lines - (params->HTOOB ? 3 : 2))\n\t\teflags |= JBIG2_HUFFMAN_FLAGS_ISLOW;\n\t      if (PREFLEN + RANGELEN > LOG_TABLE_SIZE_MAX) {\n\t\t  for (j = start_j; j < end_j; j++) {\n\t\t      entries[j].u.RANGELOW = lines[CURTEMP].RANGELOW;\n\t\t      entries[j].PREFLEN = PREFLEN;\n\t\t      entries[j].RANGELEN = RANGELEN;\n\t\t      entries[j].flags = eflags;\n\t\t    }\n\t      } else {\n\t\t  for (j = start_j; j < end_j; j++) {\n\t\t      int32_t HTOFFSET = (j >> (shift - RANGELEN)) &\n\t\t\t((1 << RANGELEN) - 1);\n\t\t      if (eflags & JBIG2_HUFFMAN_FLAGS_ISLOW)\n\t\t\tentries[j].u.RANGELOW = lines[CURTEMP].RANGELOW -\n\t\t\t  HTOFFSET;\n\t\t      else\n\t\t\tentries[j].u.RANGELOW = lines[CURTEMP].RANGELOW +\n\t\t\t  HTOFFSET;\n\t\t      entries[j].PREFLEN = PREFLEN + RANGELEN;\n\t\t      entries[j].RANGELEN = 0;\n\t\t      entries[j].flags = eflags;\n\t\t    }\n\t\t}\n\t      CURCODE++;\n\t    }\n\t}\n    }\n\n  jbig2_free(ctx->allocator, LENCOUNT);\n\n  return result;\n}\n\n/** Free the memory associated with the representation of table */\nvoid\njbig2_release_huffman_table (Jbig2Ctx *ctx, Jbig2HuffmanTable *table)\n{\n  if (table != NULL) {\n      jbig2_free(ctx->allocator, table->entries);\n      jbig2_free(ctx->allocator, table);\n  }\n  return;\n}\n\n/* Routines to handle \"code table segment (53)\" */\n\n/* return 'bitlen' bits from 'bitoffset' of 'data' */\nstatic uint32_t\njbig2_table_read_bits(const byte *data, size_t *bitoffset, const int bitlen)\n{\n    uint32_t result = 0;\n    uint32_t byte_offset = *bitoffset / 8;\n    const int endbit = (*bitoffset & 7) + bitlen;\n    const int n_proc_bytes = (endbit + 7) / 8;\n    const int rshift = n_proc_bytes * 8 - endbit;\n    int i;\n    for (i = n_proc_bytes - 1; i >= 0; i--) {\n        uint32_t d = data[byte_offset++];\n        const int nshift = i * 8 - rshift;\n        if (nshift > 0)\n            d <<= nshift;\n        else if (nshift < 0)\n            d >>= -nshift;\n        result |= d;\n    }\n    result &= ~(-1 << bitlen);\n    *bitoffset += bitlen;\n    return result;\n}\n\n/* Parse a code table segment, store Jbig2HuffmanParams in segment->result */\nint\njbig2_table(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte *segment_data)\n{\n    Jbig2HuffmanParams *params = NULL;\n    Jbig2HuffmanLine *line = NULL;\n\n    segment->result = NULL;\n    if (segment->data_length < 10)\n        goto too_short;\n\n    {\n        /* B.2 1) (B.2.1) Code table flags */\n        const int code_table_flags = segment_data[0];\n        const int HTOOB = code_table_flags & 0x01; /* Bit 0: HTOOB */\n        /* Bits 1-3: Number of bits used in code table line prefix size fields */\n        const int HTPS  = (code_table_flags >> 1 & 0x07) + 1;\n        /* Bits 4-6: Number of bits used in code table line range size fields */\n        const int HTRS  = (code_table_flags >> 4 & 0x07) + 1;\n        /* B.2 2) (B.2.2) The lower bound of the first table line in the encoded table */\n        const int32_t HTLOW  = jbig2_get_int32(segment_data + 1);\n        /* B.2 3) (B.2.3) One larger than the upeer bound of\n           the last normal table line in the encoded table */\n        const int32_t HTHIGH = jbig2_get_int32(segment_data + 5);\n        /* estimated number of lines int this table, used for alloacting memory for lines */\n        const size_t lines_max = (segment->data_length * 8 - HTPS * (HTOOB ? 3 : 2)) /\n                                                        (HTPS + HTRS) + (HTOOB ? 3 : 2);\n        /* points to a first table line data */\n        const byte *lines_data = segment_data + 9;\n        const size_t lines_data_bitlen = (segment->data_length - 9) * 8;    /* length in bit */\n        /* bit offset: controls bit reading */\n        size_t boffset = 0;\n        /* B.2 4) */\n        int32_t CURRANGELOW = HTLOW;\n        size_t NTEMP = 0;\n\n#ifdef JBIG2_DEBUG\n        jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number, \n            \"DECODING USER TABLE... Flags: %d, HTOOB: %d, HTPS: %d, HTRS: %d, HTLOW: %d, HTHIGH: %d\", \n            code_table_flags, HTOOB, HTPS, HTRS, HTLOW, HTHIGH);\n#endif\n\n        /* allocate HuffmanParams & HuffmanLine */\n        params = jbig2_new(ctx, Jbig2HuffmanParams, 1);\n        if (params == NULL) {\n            jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                            \"Could not allocate Huffman Table Parameter\");\n            goto error_exit;\n        }\n        line = jbig2_new(ctx, Jbig2HuffmanLine, lines_max);\n        if (line == NULL) {\n            jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                            \"Could not allocate Huffman Table Lines\");\n            goto error_exit;\n        }\n        /* B.2 5) */\n        while (CURRANGELOW < HTHIGH) {\n            /* B.2 5) a) */\n            if (boffset + HTPS >= lines_data_bitlen)\n                goto too_short;\n            line[NTEMP].PREFLEN  = jbig2_table_read_bits(lines_data, &boffset, HTPS);\n            /* B.2 5) b) */\n            if (boffset + HTRS >= lines_data_bitlen)\n                goto too_short;\n            line[NTEMP].RANGELEN = jbig2_table_read_bits(lines_data, &boffset, HTRS);\n            /* B.2 5) c) */\n            line[NTEMP].RANGELOW = CURRANGELOW;\n            CURRANGELOW += (1 << line[NTEMP].RANGELEN);\n            NTEMP++;\n        }\n        /* B.2 6), B.2 7) lower range table line */\n        if (boffset + HTPS >= lines_data_bitlen)\n            goto too_short;\n        line[NTEMP].PREFLEN  = jbig2_table_read_bits(lines_data, &boffset, HTPS);\n        line[NTEMP].RANGELEN = 32;\n        line[NTEMP].RANGELOW = HTLOW - 1;\n        NTEMP++;\n        /* B.2 8), B.2 9) upper range table line */\n        if (boffset + HTPS >= lines_data_bitlen)\n            goto too_short;\n        line[NTEMP].PREFLEN  = jbig2_table_read_bits(lines_data, &boffset, HTPS);\n        line[NTEMP].RANGELEN = 32;\n        line[NTEMP].RANGELOW = HTHIGH;\n        NTEMP++;\n        /* B.2 10) */\n        if (HTOOB) {\n            /* B.2 10) a), B.2 10) b) out-of-bound table line */\n            if (boffset + HTPS >= lines_data_bitlen)\n                goto too_short;\n            line[NTEMP].PREFLEN  = jbig2_table_read_bits(lines_data, &boffset, HTPS);\n            line[NTEMP].RANGELEN = 0;\n            line[NTEMP].RANGELOW = 0;\n            NTEMP++;\n        }\n        if (NTEMP != lines_max) {\n            Jbig2HuffmanLine *new_line = jbig2_renew(ctx, line,\n                Jbig2HuffmanLine, NTEMP);\n            if ( new_line == NULL ) {\n                jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                                \"Could not reallocate Huffman Table Lines\");\n                goto error_exit;\n            }\n            line = new_line;\n        }\n        params->HTOOB   = HTOOB;\n        params->n_lines = NTEMP;\n        params->lines   = line;\n        segment->result = params;\n\n#ifdef JBIG2_DEBUG\n        {\n            int i;\n            for (i = 0; i < NTEMP; i++) {\n                jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number, \n                    \"Line: %d, PREFLEN: %d, RANGELEN: %d, RANGELOW: %d\", \n                    i, params->lines[i].PREFLEN, params->lines[i].RANGELEN, params->lines[i].RANGELOW);\n            }\n        }\n#endif\n    }\n    return 0;\n\ntoo_short:\n    jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number, \"Segment too short\");\nerror_exit:\n    if (line != NULL) {\n        jbig2_free(ctx->allocator, line);\n    }\n    if (params != NULL) {\n        jbig2_free(ctx->allocator, params);\n    }\n    return -1;\n}\n\n/* free Jbig2HuffmanParams allocated by jbig2_huffman_table() */\nvoid\njbig2_table_free(Jbig2Ctx *ctx, Jbig2HuffmanParams *params)\n{\n    if (params != NULL) {\n        if (params->lines != NULL)\n            jbig2_free(ctx->allocator, (void *)params->lines);\n        jbig2_free(ctx->allocator, params);\n    }\n}\n\n/* find a user supplied table used by 'segment' and by 'index' */\nconst Jbig2HuffmanParams *\njbig2_find_table(Jbig2Ctx *ctx, Jbig2Segment *segment, int index)\n{\n    int i, table_index = 0;\n\n    for (i = 0; i < segment->referred_to_segment_count; i++) {\n        const Jbig2Segment * const rsegment =\n                jbig2_find_segment(ctx, segment->referred_to_segments[i]);\n        if (rsegment && (rsegment->flags & 63) == 53) {\n            if (table_index == index)\n                return (const Jbig2HuffmanParams *)rsegment->result;\n            ++table_index;\n        }\n    }\n    return NULL;\n}\n\n\n#ifdef TEST\n#include <stdio.h>\n\n/* cc -g -o jbig2_huffman.test1 -DTEST jbig2_huffman.c .libs/libjbig2dec.a */\n\n/* a test bitstream, and a list of the table indicies\n   to use in decoding it. 1 = table B.1 (A), 2 = table B.2 (B), and so on */\n/* this test stream should decode to { 8, 5, oob, 8 } */\n\nconst byte\ttest_stream[] = { 0xe9, 0xcb, 0xf4, 0x00 };\nconst byte\ttest_tabindex[] = { 4, 2, 2, 1 };\n\nstatic int\ntest_get_word (Jbig2WordStream *self, int offset, uint32_t *word)\n{\n\t/* assume test_stream[] is at least 4 bytes */\n\tif (offset+3 > sizeof(test_stream))\n\t\treturn -1;\n\t*word = ( (test_stream[offset] << 24) |\n\t\t\t (test_stream[offset+1] << 16) |\n\t\t\t (test_stream[offset+2] << 8) |\n\t\t\t (test_stream[offset+3]) );\n\treturn 0;\n}\n\nint\nmain (int argc, char **argv)\n{\n  Jbig2Ctx *ctx;\n  Jbig2HuffmanTable *tables[5];\n  Jbig2HuffmanState *hs;\n  Jbig2WordStream ws;\n  bool oob;\n  int32_t code;\n\n  ctx = jbig2_ctx_new(NULL, 0, NULL, NULL, NULL);\n\n  tables[0] = NULL;\n  tables[1] = jbig2_build_huffman_table (ctx, &jbig2_huffman_params_A);\n  tables[2] = jbig2_build_huffman_table (ctx, &jbig2_huffman_params_B);\n  tables[3] = NULL;\n  tables[4] = jbig2_build_huffman_table (ctx, &jbig2_huffman_params_D);\n  ws.get_next_word = test_get_word;\n  hs = jbig2_huffman_new (ctx, &ws);\n\n  printf(\"testing jbig2 huffmann decoding...\");\n  printf(\"\\t(should be 8 5 (oob) 8)\\n\");\n\n  {\n\tint i;\n\tint sequence_length = sizeof(test_tabindex);\n\n\tfor (i = 0; i < sequence_length; i++) {\n\t\tcode = jbig2_huffman_get (hs, tables[test_tabindex[i]], &oob);\n\t\tif (oob) printf(\"(oob) \");\n\t\telse printf(\"%d \", code);\n\t}\n  }\n\n  printf(\"\\n\");\n\n  jbig2_ctx_free(ctx);\n\n  return 0;\n}\n#endif\n\n#ifdef TEST2\n#include <stdio.h>\n\n/* cc -g -o jbig2_huffman.test2 -DTEST2 jbig2_huffman.c .libs/libjbig2dec.a */\n\n/* a decoding test of each line from each standard table */\n\n/* test code for Table B.1 - Standard Huffman table A */\nconst int32_t test_output_A[] = {\n    /* line 0, PREFLEN=1, RANGELEN=4, VAL=0..15, 0+VAL */\n    0,      /* 0 0000 */\n    1,      /* 0 0001 */\n    14,     /* 0 1110 */\n    15,     /* 0 1111 */\n    /* line 1, PREFLEN=2, RANGELEN=8, VAL=16..271, 10+(VAL-16) */\n    16,     /* 10 00000000 */\n    17,     /* 10 00000001 */\n    270,    /* 10 11111110 */\n    271,    /* 10 11111111 */\n    /* line 2, PREFLEN=3, RANGELEN=16, VAL=272..65807, 110+(VAL-272) */\n    272,    /* 110 00000000 00000000 */\n    273,    /* 110 00000000 00000001 */\n    65806,  /* 110 11111111 11111110 */\n    65807,  /* 110 11111111 11111111 */\n    /* line 3, PREFLEN=3, RANGELEN=32, VAL=65808..INF, 111+(VAL-65808) */\n    65808,  /* 111 00000000 00000000 00000000 00000000 */\n    65809,  /* 111 00000000 00000000 00000000 00000001 */\n};\nconst byte test_input_A[] = {\n    /* 0000 0000 0101 1100 1111 1000 0000 0010 */\n       0x00,     0x5c,     0xf8,     0x02,\n    /* 0000 0001 1011 1111 1010 1111 1111 1100 */\n       0x01,     0xbf,     0xaf,     0xfc,\n    /* 0000 0000 0000 0001 1000 0000 0000 0000 */\n       0x00,     0x01,     0x80,     0x00,\n    /* 0111 0111 1111 1111 1111 0110 1111 1111 */\n       0x77,     0xff,     0xf6,     0xff,\n    /* 1111 1111 1110 0000 0000 0000 0000 0000 */\n       0xff,     0xe0,     0x00,     0x00,\n    /* 0000 0000 0001 1100 0000 0000 0000 0000 */\n       0x00,     0x1c,     0x00,     0x00,\n    /* 0000 0000 0000 01 */\n       0x00,     0x04, \n};\n\n\n/* test code for Table B.2 - Standard Huffman table B */\nconst int32_t test_output_B[] = {\n    /* line 0, PREFLEN=1, RANGELEN=0, VAL=0, 0 */\n    0,      /* 0 */\n    /* line 1, PREFLEN=2, RANGELEN=0, VAL=1, 10 */\n    1,      /* 10 */\n    /* line 2, PREFLEN=3, RANGELEN=0, VAL=2, 110 */\n    2,      /* 110 */\n    /* line 3, PREFLEN=4, RANGELEN=3, VAL=3..10, 1110+(VAL-3) */\n    3,      /* 1110 000 */\n    4,      /* 1110 001 */\n    9,      /* 1110 110 */\n    10,     /* 1110 111 */\n    /* line 4, PREFLEN=5, RANGELEN=6, VAL=11..74, 11110+(VAL-11) */\n    11,     /* 11110 000000 */\n    12,     /* 11110 000001 */\n    73,     /* 11110 111110 */\n    74,     /* 11110 111111 */\n    /* line 5, PREFLEN=6, RANGELEN=32, VAL=75..INF, 111110+(VAL-75) */\n    75,     /* 111110 00000000 00000000 00000000 00000000 */\n    76,     /* 111110 00000000 00000000 00000000 00000001 */\n    /* line 6, PREFLEN=6, VAL=OOB, 111111 */\n    /*OOB*/ /* 111111 */\n};\nconst byte test_input_B[] = {\n    /* 0101 1011 1000 0111 0001 1110 1101 1101 */\n       0x5b,     0x87,     0x1e,     0xdd,\n    /* 1111 1100 0000 0111 1000 0001 1111 0111 */\n       0xfc,     0x07,     0x81,     0xf7,\n    /* 1101 1110 1111 1111 1110 0000 0000 0000 */\n       0xde,     0xff,     0xe0,     0x00,\n    /* 0000 0000 0000 0000 0000 1111 1000 0000 */\n       0x00,     0x00,     0x0f,     0x80,\n    /* 0000 0000 0000 0000 0000 0000 0111 1111 */\n       0x00,     0x00,     0x00,     0x7f,\n};\n\n/* test code for Table B.3 - Standard Huffman table C */\nconst int32_t test_output_C[] = {\n    /* line 0, PREFLEN=8, RANGELEN=8, VAL=-256..-1, 11111110+(VAL+256) */\n    -256,   /* 11111110 00000000 */\n    -255,   /* 11111110 00000001 */\n    -2,     /* 11111110 11111110 */\n    -1,     /* 11111110 11111111 */\n    /* line 1, PREFLEN=1, RANGELEN=0, VAL=0, 0 */\n    0,      /* 0 */\n    /* line 2, PREFLEN=2, RANGELEN=0, VAL=1, 10 */\n    1,      /* 10 */\n    /* line 3, PREFLEN=3, RANGELEN=0, VAL=2, 110 */\n    2,      /* 110 */\n    /* line 4, PREFLEN=4, RANGELEN=3, VAL=3..10, 1110+(VAL-3) */\n    3,      /* 1110 000 */\n    4,      /* 1110 001 */\n    9,      /* 1110 110 */\n    10,     /* 1110 111 */\n    /* line 5, PREFLEN=5, RANGELEN=6, VAL=11..74, 11110+(VAL-11) */\n    11,     /* 11110 000000 */\n    12,     /* 11110 000001 */\n    73,     /* 11110 111110 */\n    74,     /* 11110 111111 */\n    /* line 6, PREFLEN=8, RANGELEN=32, VAL=-INF..-257, 11111111+(-257-VAL) */\n    -257,   /* 11111111 00000000 00000000 00000000 00000000 */\n    -258,   /* 11111111 00000000 00000000 00000000 00000001 */\n    /* line 7, PREFLEN=7, RANGELEN=32, VAL=75..INF, 1111110+(VAL-75) */\n    75,     /* 1111110 00000000 00000000 00000000 00000000 */\n    76,     /* 1111110 00000000 00000000 00000000 00000001 */\n    /* line 8, PREFLEN=6, VAL=OOB, 111110 */\n    /*OOB*/ /* 111110 */\n};\nconst byte test_input_C[] = {\n    /* 1111 1110 0000 0000 1111 1110 0000 0001 */\n       0xfe,     0x00,     0xfe,     0x01,\n    /* 1111 1110 1111 1110 1111 1110 1111 1111 */\n       0xfe,     0xfe,     0xfe,     0xff,\n    /* 0101 1011 1000 0111 0001 1110 1101 1101 */\n       0x5b,     0x87,     0x1e,     0xdd,\n    /* 1111 1100 0000 0111 1000 0001 1111 0111 */\n       0xfc,     0x07,     0x81,     0xf7,\n    /* 1101 1110 1111 1111 1111 1100 0000 0000 */\n       0xde,     0xff,     0xfc,     0x00,\n    /* 0000 0000 0000 0000 0000 0011 1111 1100 */\n       0x00,     0x00,     0x03,     0xfc,\n    /* 0000 0000 0000 0000 0000 0000 0000 0111 */\n       0x00,     0x00,     0x00,     0x07,\n    /* 1111 0000 0000 0000 0000 0000 0000 0000 */\n       0xf0,     0x00,     0x00,     0x00,\n    /* 0000 0111 1110 0000 0000 0000 0000 0000 */\n       0x07,     0xe0,     0x00,     0x00,\n    /* 0000 0000 0001 1111 10 */\n       0x00,     0x1f,     0x80,\n};\n\n/* test code for Table B.4 - Standard Huffman table D */\nconst int32_t test_output_D[] = {\n    /* line 0, PREFLEN=1, RANGELEN=0, VAL=1, 0 */\n    1,      /* 0 */\n    /* line 1, PREFLEN=2, RANGELEN=0, VAL=2, 10 */\n    2,      /* 10 */\n    /* line 2, PREFLEN=3, RANGELEN=0, VAL=3, 110 */\n    3,      /* 110 */\n    /* line 3, PREFLEN=4, RANGELEN=3, VAL=4..11, 1110+(VAL-4) */\n    4,      /* 1110 000 */\n    5,      /* 1110 001 */\n    10,     /* 1110 110 */\n    11,     /* 1110 111 */\n    /* line 4, PREFLEN=5, RANGELEN=6, VAL=12..75, 11110+(VAL-12) */\n    12,     /* 11110 000000 */\n    13,     /* 11110 000001 */\n    74,     /* 11110 111110 */\n    75,     /* 11110 111111 */\n    /* line 5, PREFLEN=5, RANGELEN=32, VAL=76..INF, 11111+(VAL-76) */\n    76,     /* 11111 00000000 00000000 00000000 00000000 */\n    77,     /* 11111 00000000 00000000 00000000 00000001 */\n};\nconst byte test_input_D[] = {\n    /* 0101 1011 1000 0111 0001 1110 1101 1101 */\n       0x5b,     0x87,     0x1e,     0xdd,\n    /* 1111 1100 0000 0111 1000 0001 1111 0111 */\n       0xfc,     0x07,     0x81,     0xf7,\n    /* 1101 1110 1111 1111 1110 0000 0000 0000 */\n       0xde,     0xff,     0xe0,     0x00,\n    /* 0000 0000 0000 0000 0001 1111 0000 0000 */\n       0x00,     0x00,     0x1f,     0x00,\n    /* 0000 0000 0000 0000 0000 0001 */\n       0x00,     0x00,     0x01,\n};\n\n/* test code for Table B.5 - Standard Huffman table E */\nconst int32_t test_output_E[] = {\n    /* line 0, PREFLEN=7, RANGELEN=8, VAL=-255..0, 1111110+(VAL+255) */\n    -255,   /* 1111110 00000000 */\n    -254,   /* 1111110 00000001 */\n    -1,     /* 1111110 11111110 */\n    0,      /* 1111110 11111111 */\n    /* line 1, PREFLEN=1, RANGELEN=0, VAL=1, 0 */\n    1,      /* 0 */\n    /* line 2, PREFLEN=2, RANGELEN=0, VAL=2, 10 */\n    2,      /* 10 */\n    /* line 3, PREFLEN=3, RANGELEN=0, VAL=3, 110 */\n    3,      /* 110 */\n    /* line 4, PREFLEN=4, RANGELEN=3, VAL=4..11, 1110+(VAL-4) */\n    4,      /* 1110 000 */\n    5,      /* 1110 001 */\n    10,     /* 1110 110 */\n    11,     /* 1110 111 */\n    /* line 5, PREFLEN=5, RANGELEN=6, VAL=12..75, 11110+(VAL-12) */\n    12,     /* 11110 000000 */\n    13,     /* 11110 000001 */\n    74,     /* 11110 111110 */\n    75,     /* 11110 111111 */\n    /* line 6, PREFLEN=7, RANGELEN=32, VAL=-INF..-256, 1111111+(-256-VAL) */\n    -256,   /* 1111111 00000000 00000000 00000000 00000000 */\n    -257,   /* 1111111 00000000 00000000 00000000 00000001 */\n    /* line 6, PREFLEN=6, RANGELEN=32, VAL=76..INF, 111110+(VAL-76) */\n    76,     /* 111110 00000000 00000000 00000000 00000000 */\n    77,     /* 111110 00000000 00000000 00000000 00000001 */\n};\nconst byte test_input_E[] = {\n    /* 1111 1100 0000 0001 1111 1000 0000 0111 */\n       0xfc,     0x01,     0xf8,     0x07,\n    /* 1111 0111 1111 0111 1110 1111 1111 0101 */\n       0xf7,     0xf7,     0xef,     0xf5,\n    /* 1011 1000 0111 0001 1110 1101 1101 1111 */\n       0xb8,     0x71,     0xed,     0xdf,\n    /* 1100 0000 0111 1000 0001 1111 0111 1101 */\n       0xc0,     0x78,     0x1f,     0x7d,\n    /* 1110 1111 1111 1111 1000 0000 0000 0000 */\n       0xef,     0xff,     0x80,     0x00,\n    /* 0000 0000 0000 0000 0111 1111 0000 0000 */\n       0x00,     0x00,     0x7f,     0x00,\n    /* 0000 0000 0000 0000 0000 0001 1111 1000 */\n       0x00,     0x00,     0x01,     0xf8,\n    /* 0000 0000 0000 0000 0000 0000 0000 0011 */\n       0x00,     0x00,     0x00,     0x03,\n    /* 1110 0000 0000 0000 0000 0000 0000 0000 */\n       0xe0,     0x00,     0x00,     0x00,\n    /* 0001 */\n       0x10,\n};\n\n/* test code for Table B.6 - Standard Huffman table F */\nconst int32_t test_output_F[] = {\n    /* line 0, PREFLEN=5, RANGELEN=10, VAL=-2048..-1025, 11100+(VAL+2048) */\n    -2048,  /* 11100 00000000 00 */\n    -2047,  /* 11100 00000000 01 */\n    -1026,  /* 11100 11111111 10 */\n    -1025,  /* 11100 11111111 11 */\n    /* line 1, PREFLEN=4, RANGELEN=9, VAL=-1024..-513, 1000+(VAL+1024) */\n    -1024,  /* 1000 00000000 0 */\n    -1023,  /* 1000 00000000 1 */\n    -514,   /* 1000 11111111 0 */\n    -513,   /* 1000 11111111 1 */\n    /* line 2, PREFLEN=4, RANGELEN=8, VAL=-512..-257, 1001+(VAL+512) */\n    -512,   /* 1001 00000000 */\n    -511,   /* 1001 00000001 */\n    -258,   /* 1001 11111110 */\n    -257,   /* 1001 11111111 */\n    /* line 3, PREFLEN=4, RANGELEN=7, VAL=-256..-129, 1010+(VAL+256) */\n    -256,   /* 1010 0000000 */\n    -255,   /* 1010 0000001 */\n    -130,   /* 1010 1111110 */\n    -129,   /* 1010 1111111 */\n    /* line 4, PREFLEN=5, RANGELEN=6, VAL=-128..-65, 11101+(VAL+128) */\n    -128,   /* 11101 000000 */\n    -127,   /* 11101 000001 */\n    -66,    /* 11101 111110 */\n    -65,    /* 11101 111111 */\n    /* line 5, PREFLEN=5, RANGELEN=5, VAL=-64..-33, 11110+(VAL+64) */\n    -64,    /* 11110 00000 */\n    -63,    /* 11110 00001 */\n    -34,    /* 11110 11110 */\n    -33,    /* 11110 11111 */\n    /* line 6, PREFLEN=4, RANGELEN=5, VAL=-32..-1, 1011+(VAL+32) */\n    -32,    /* 1011 00000 */\n    -31,    /* 1011 00001 */\n    -2,     /* 1011 11110 */\n    -1,     /* 1011 11111 */\n    /* line 7, PREFLEN=2, RANGELEN=7, VAL=0..127, 00+VAL */\n    0,      /* 00 0000000 */\n    1,      /* 00 0000001 */\n    126,    /* 00 1111110 */\n    127,    /* 00 1111111 */\n    /* line 8, PREFLEN=3, RANGELEN=7, VAL=128..255, 010+(VAL-128) */\n    128,    /* 010 0000000 */\n    129,    /* 010 0000001 */\n    254,    /* 010 1111110 */\n    255,    /* 010 1111111 */\n    /* line 9, PREFLEN=3, RANGELEN=8, VAL=256..511, 011+(VAL-256) */\n    256,    /* 011 00000000 */\n    257,    /* 011 00000001 */\n    510,    /* 011 11111110 */\n    511,    /* 011 11111111 */\n    /* line 10, PREFLEN=4, RANGELEN=9, VAL=512..1023, 1100+(VAL-512) */\n    512,    /* 1100 00000000 0 */\n    513,    /* 1100 00000000 1 */\n    1022,   /* 1100 11111111 0 */\n    1023,   /* 1100 11111111 1 */\n    /* line 11, PREFLEN=4, RANGELEN=10, VAL=1024..2047, 1101+(VAL-1024) */\n    1024,   /* 1101 00000000 00 */\n    1025,   /* 1101 00000000 01 */\n    2046,   /* 1101 11111111 10 */\n    2047,   /* 1101 11111111 11 */\n    /* line 12, PREFLEN=6, RANGELEN=32, VAL=-INF..-2049, 111110+(-2049-VAL) */\n    -2049,  /* 111110 00000000 00000000 00000000 00000000 */\n    -2050,  /* 111110 00000000 00000000 00000000 00000001 */\n    /* line 13, PREFLEN=6, RANGELEN=32, VAL=2048..INF, 111111+(VAL-2048) */\n    2048,   /* 111111 00000000 00000000 00000000 00000000 */\n    2049,   /* 111111 00000000 00000000 00000000 00000001 */\n};\nconst byte test_input_F[] = {\n    /* 1110 0000 0000 0001 1100 0000 0000 0111 */\n       0xe0,     0x01,     0xc0,     0x07,\n    /* 1001 1111 1111 0111 0011 1111 1111 1000 */\n       0x9f,     0xf7,     0x3f,     0xf8,\n    /* 0000 0000 0100 0000 0000 0110 0011 1111 */\n       0x00,     0x40,     0x06,     0x3f,\n    /* 1101 0001 1111 1111 1001 0000 0000 1001 */\n       0xd1,     0xff,     0x90,     0x09,\n    /* 0000 0001 1001 1111 1110 1001 1111 1111 */\n       0x01,     0x9f,     0xe9,     0xff,\n    /* 1010 0000 0001 0100 0000 0110 1011 1111 */\n       0xa0,     0x14,     0x06,     0xbf,\n    /* 0101 0111 1111 1110 1000 0001 1101 0000 */\n       0x57,     0xfe,     0x81,     0xd0,\n    /* 0111 1011 1111 0111 0111 1111 1111 0000 */\n       0x7b,     0xf7,     0x7f,     0xf0,\n    /* 0011 1100 0001 1111 0111 1011 1101 1111 */\n       0x3c,     0x1f,     0x7b,     0xdf,\n    /* 1011 0000 0101 1000 0110 1111 1101 0111 */\n       0xb0,     0x58,     0x6f,     0xd7,\n    /* 1111 0000 0000 0000 0000 0100 1111 1100 */\n       0xf0,     0x00,     0x04,     0xfc,\n    /* 0111 1111 0100 0000 0001 0000 0001 0101 */\n       0x7f,     0x40,     0x10,     0x15,\n    /* 1111 1001 0111 1111 0110 0000 0000 1100 */\n       0xf9,     0x7f,     0x60,     0x0c,\n    /* 0000 0101 1111 1111 0011 1111 1111 1100 */\n       0x05,     0xff,     0x3f,     0xfc,\n    /* 0000 0000 0110 0000 0000 0111 0011 1111 */\n       0x00,     0x60,     0x07,     0x3f,\n    /* 1101 1001 1111 1111 1101 0000 0000 0011 */\n       0xd9,     0xff,     0xd0,     0x03,\n    /* 0100 0000 0001 1101 1111 1111 1011 0111 */\n       0x40,     0x1d,     0xff,     0xb7,\n    /* 1111 1111 1111 1000 0000 0000 0000 0000 */\n       0xff,     0xf8,     0x00,     0x00,\n    /* 0000 0000 0000 0011 1110 0000 0000 0000 */\n       0x00,     0x03,     0xe0,     0x00,\n    /* 0000 0000 0000 0000 0001 1111 1100 0000 */\n       0x00,     0x00,     0x1f,     0xc0,\n    /* 0000 0000 0000 0000 0000 0000 0011 1111 */\n       0x00,     0x00,     0x00,     0x3f,\n    /* 0000 0000 0000 0000 0000 0000 0000 0001 */\n       0x00,     0x00,     0x00,     0x01,\n};\n\n/* test code for Table B.7 - Standard Huffman table G */\nconst int32_t test_output_G[] = {\n    /* line 0, PREFLEN=4, RANGELEN=9, VAL=-1024..-513, 1000+(VAL+1024) */\n    -1024,  /* 1000 00000000 0 */\n    -1023,  /* 1000 00000000 1 */\n    -514,   /* 1000 11111111 0 */\n    -513,   /* 1000 11111111 1 */\n    /* line 1, PREFLEN=3, RANGELEN=8, VAL=-512..-257, 000+(VAL+512) */\n    -512,   /* 000 00000000 */\n    -511,   /* 000 00000001 */\n    -258,   /* 000 11111110 */\n    -257,   /* 000 11111111 */\n    /* line 2, PREFLEN=4, RANGELEN=7, VAL=-256..-129, 1001+(VAL+256) */\n    -256,   /* 1001 0000000 */\n    -255,   /* 1001 0000001 */\n    -130,   /* 1001 1111110 */\n    -129,   /* 1001 1111111 */\n    /* line 3, PREFLEN=5, RANGELEN=6, VAL=-128..-65, 11010+(VAL+128) */\n    -128,   /* 11010 000000 */\n    -127,   /* 11010 000001 */\n    -66,    /* 11010 111110 */\n    -65,    /* 11010 111111 */\n    /* line 4, PREFLEN=5, RANGELEN=5, VAL=-64..-33, 11011+(VAL+64) */\n    -64,    /* 11011 00000 */\n    -63,    /* 11011 00001 */\n    -34,    /* 11011 11110 */\n    -33,    /* 11011 11111 */\n    /* line 5, PREFLEN=4, RANGELEN=5, VAL=-32..-1, 1010+(VAL+32) */\n    -32,    /* 1010 00000 */\n    -31,    /* 1010 00001 */\n    -2,     /* 1010 11110 */\n    -1,     /* 1010 11111 */\n    /* line 6, PREFLEN=4, RANGELEN=5, VAL=0..31, 1011+VAL */\n    0,      /* 1011 00000 */\n    1,      /* 1011 00001 */\n    30,     /* 1011 11110 */\n    31,     /* 1011 11111 */\n    /* line 7, PREFLEN=5, RANGELEN=5, VAL=32..63, 11100+(VAL-32) */\n    32,     /* 11100 00000 */\n    33,     /* 11100 00001 */\n    62,     /* 11100 11110 */\n    63,     /* 11100 11111 */\n    /* line 8, PREFLEN=5, RANGELEN=6, VAL=64..127, 11101+(VAL-64) */\n    64,     /* 11101 000000 */\n    65,     /* 11101 000001 */\n    126,    /* 11101 111110 */\n    127,    /* 11101 111111 */\n    /* line 9, PREFLEN=4, RANGELEN=7, VAL=128..255, 1100+(VAL-128) */\n    128,    /* 1100 0000000 */\n    129,    /* 1100 0000001 */\n    254,    /* 1100 1111110 */\n    255,    /* 1100 1111111 */\n    /* line 10, PREFLEN=3, RANGELEN=8, VAL=256..511, 001+(VAL-256) */\n    256,    /* 001 00000000 */\n    257,    /* 001 00000001 */\n    510,    /* 001 11111110 */\n    511,    /* 001 11111111 */\n    /* line 11, PREFLEN=3, RANGELEN=9, VAL=512..1023, 010+(VAL-512) */\n    512,    /* 010 00000000 0 */\n    513,    /* 010 00000000 1 */\n    1022,   /* 010 11111111 0 */\n    1023,   /* 010 11111111 1 */\n    /* line 12, PREFLEN=3, RANGELEN=10, VAL=1024..2047, 011+(VAL-1024) */\n    1024,   /* 011 00000000 00 */\n    1025,   /* 011 00000000 01 */\n    2046,   /* 011 11111111 10 */\n    2047,   /* 011 11111111 11 */\n    /* line 13, PREFLEN=5, RANGELEN=32, VAL=-INF..-1025, 11110+(-1025-VAL) */\n    -1025,  /* 11110 00000000 00000000 00000000 00000000 */\n    -1026,  /* 11110 00000000 00000000 00000000 00000001 */\n    /* line 14, PREFLEN=5, RANGELEN=32, VAL=2048..INF, 11111+(VAL-2048) */\n    2048,   /* 11111 00000000 00000000 00000000 00000000 */\n    2049,   /* 11111 00000000 00000000 00000000 00000001 */\n};\nconst byte test_input_G[] = {\n    /* 1000 0000 0000 0100 0000 0000 0110 0011 */\n       0x80,     0x04,     0x00,     0x63,\n    /* 1111 1101 0001 1111 1111 0000 0000 0000 */\n       0xfd,     0x1f,     0xf0,     0x00,\n    /* 0000 0000 0100 0111 1111 0000 1111 1111 */\n       0x00,     0x47,     0xf0,     0xff,\n    /* 1001 0000 0001 0010 0000 0110 0111 1111 */\n       0x90,     0x12,     0x06,     0x7f,\n    /* 0100 1111 1111 1101 0000 0001 1010 0000 */\n       0x4f,     0xfd,     0x01,     0xa0,\n    /* 0111 0101 1111 0110 1011 1111 1101 1000 */\n       0x75,     0xf6,     0xbf,     0xd8,\n    /* 0011 0110 0001 1101 1111 1011 0111 1111 */\n       0x36,     0x1d,     0xfb,     0x7f,\n    /* 1010 0000 0101 0000 0110 1011 1101 0101 */\n       0xa0,     0x50,     0x6b,     0xd5,\n    /* 1111 1011 0000 0101 1000 0110 1111 1101 */\n       0xfb,     0x05,     0x86,     0xfd,\n    /* 0111 1111 1110 0000 0011 1000 0001 1110 */\n       0x7f,     0xe0,     0x38,     0x1e,\n    /* 0111 1011 1001 1111 1110 1000 0001 1101 */\n       0x7b,     0x9f,     0xe8,     0x1d,\n    /* 0000 0111 1011 1111 0111 0111 1111 1100 */\n       0x07,     0xbf,     0x77,     0xfc,\n    /* 0000 0001 1000 0000 0111 0011 1111 0110 */\n       0x01,     0x80,     0x73,     0xf6,\n    /* 0111 1111 0010 0000 0000 0100 0000 0100 */\n       0x7f,     0x20,     0x04,     0x04,\n    /* 1111 1111 0001 1111 1111 0100 0000 0000 */\n       0xff,     0x1f,     0xf4,     0x00,\n    /* 0100 0000 0001 0101 1111 1110 0101 1111 */\n       0x40,     0x15,     0xfe,     0x5f,\n    /* 1111 0110 0000 0000 0011 0000 0000 0101 */\n       0xf6,     0x00,     0x30,     0x05,\n    /* 1111 1111 1100 1111 1111 1111 1111 0000 */\n       0xff,     0xcf,     0xff,     0xf0,\n    /* 0000 0000 0000 0000 0000 0000 0000 0111 */\n       0x00,     0x00,     0x00,     0x07,\n    /* 1000 0000 0000 0000 0000 0000 0000 0000 */\n       0x80,     0x00,     0x00,     0x00,\n    /* 0111 1110 0000 0000 0000 0000 0000 0000 */\n       0x7e,     0x00,     0x00,     0x00,\n    /* 0000 0001 1111 0000 0000 0000 0000 0000 */\n       0x01,     0xf0,     0x00,     0x00,\n    /* 0000 0000 0001 */\n       0x00,     0x10,\n};\n\n/* test code for Table B.8 - Standard Huffman table H */\nconst int32_t test_output_H[] = {\n    /* line 0, PREFLEN=8, RANGELEN=3, VAL=-15..-8, 11111100+(VAL+15) */\n    -15,    /* 11111100 000 */\n    -14,    /* 11111100 001 */\n    -9,     /* 11111100 110 */\n    -8,     /* 11111100 111 */\n    /* line 1, PREFLEN=9, RANGELEN=1, VAL=-7..-6, 111111100+(VAL+7) */\n    -7,     /* 111111100 0 */\n    -6,     /* 111111100 1 */\n    /* line 2, PREFLEN=8, RANGELEN=1, VAL=-5..-4, 11111101+(VAL+5) */\n    -5,     /* 11111101 0 */\n    -4,     /* 11111101 1 */\n    /* line 3, PREFLEN=9, RANGELEN=0, VAL=-3, 111111101 */\n    -3,     /* 111111101 */\n    /* line 4, PREFLEN=7, RANGELEN=0, VAL=-2, 1111100 */\n    -2,     /* 1111100 */\n    /* line 5, PREFLEN=4, RANGELEN=0, VAL=-1, 1010 */\n    -1,     /* 1010 */\n    /* line 6, PREFLEN=2, RANGELEN=1, VAL=0..1, 00+VAL */\n    0,      /* 00 0 */\n    1,      /* 00 1 */\n    /* line 7, PREFLEN=5, RANGELEN=0, VAL=2, 11010 */\n    2,      /* 11010 */\n    /* line 8, PREFLEN=6, RANGELEN=0, VAL=3, 111010 */\n    3,      /* 111010 */\n    /* line 9, PREFLEN=3, RANGELEN=4, VAL=4..19, 100+(VAL-4) */\n    4,      /* 100 0000 */\n    5,      /* 100 0001 */\n    18,     /* 100 1110 */\n    19,     /* 100 1111 */\n    /* line 10, PREFLEN=6, RANGELEN=1, VAL=20..21, 111011+(VAL-20) */\n    20,     /* 111011 0 */\n    21,     /* 111011 1 */\n    /* line 11, PREFLEN=4, RANGELEN=4, VAL=22..37, 1011+(VAL-22) */\n    22,     /* 1011 0000 */\n    23,     /* 1011 0001 */\n    36,     /* 1011 1110 */\n    37,     /* 1011 1111 */\n    /* line 12, PREFLEN=4, RANGELEN=5, VAL=38..69, 1100+(VAL-38) */\n    38,     /* 1100 00000 */\n    39,     /* 1100 00001 */\n    68,     /* 1100 11110 */\n    69,     /* 1100 11111 */\n    /* line 13, PREFLEN=5, RANGELEN=6, VAL=70..133, 11011+(VAL-70) */\n    70,     /* 11011 000000 */\n    71,     /* 11011 000001 */\n    132,    /* 11011 111110 */\n    133,    /* 11011 111111 */\n    /* line 14, PREFLEN=5, RANGELEN=7, VAL=134..261, 11100+(VAL-134) */\n    134,    /* 11100 0000000 */\n    135,    /* 11100 0000001 */\n    260,    /* 11100 1111110 */\n    261,    /* 11100 1111111 */\n    /* line 15, PREFLEN=6, RANGELEN=7, VAL=262..389, 111100+(VAL-262) */\n    262,    /* 111100 0000000 */\n    263,    /* 111100 0000001 */\n    388,    /* 111100 1111110 */\n    389,    /* 111100 1111111 */\n    /* line 16, PREFLEN=7, RANGELEN=8, VAL=390..645, 1111101+(VAL-390) */\n    390,    /* 1111101 00000000 */\n    391,    /* 1111101 00000001 */\n    644,    /* 1111101 11111110 */\n    645,    /* 1111101 11111111 */\n    /* line 17, PREFLEN=6, RANGELEN=10, VAL=646..1669, 111101+(VAL-646) */\n    646,    /* 111101 00000000 00 */\n    647,    /* 111101 00000000 01 */\n    1668,   /* 111101 11111111 10 */\n    1669,   /* 111101 11111111 11 */\n    /* line 18, PREFLEN=9, RANGELEN=32, VAL=-INF..-16, 111111110+(-16-VAL) */\n    -16,    /* 111111110 00000000 00000000 00000000 00000000 */\n    -17,    /* 111111110 00000000 00000000 00000000 00000001 */\n    /* line 19, PREFLEN=9, RANGELEN=32, VAL=1670..INF, 111111111+(VAL-1670) */\n    1670,   /* 111111111 00000000 00000000 00000000 00000000 */\n    1671,   /* 111111111 00000000 00000000 00000000 00000001 */\n    /* line 20, PREFLEN=2, VAL=OOB, 01 */\n    /*OOB*/ /* 01 */\n};\nconst byte test_input_H[] = {\n    /* 1111 1100  0001 1111 1000 0111 1111 0011 */\n       0xfc,     0x1f,     0x87,     0xf3,\n    /* 0111 1110  0111 1111 1110 0011 1111 1001 */\n       0x7e,     0x7f,     0xe3,     0xf9,\n    /* 1111 1101  0111 1110 1111 1111 1011 1111 */\n       0xfd,     0x7e,     0xff,     0xbf,\n    /* 0010 1000  0001 1101 0111 0101 0000 0010 */\n       0x28,     0x1d,     0x75,     0x02,\n    /* 0000 1100  1110 1001 1111 1101 1011 1011 */\n       0x0c,     0xe9,     0xfd,     0xbb,\n    /* 1101 1000  0101 1000 1101 1111 0101 1111 */\n       0xd8,     0x58,     0xdf,     0x5f,\n    /* 1110 0000  0011 0000 0011 1001 1110 1100 */\n       0xe0,     0x30,     0x39,     0xec,\n    /* 1111 1110  1100 0000 1101 1000 0011 1011 */\n       0xfe,     0xc0,     0xd8,     0x3b,\n    /* 1111 1011  0111 1111 1111 0000 0000 0111 */\n       0xfb,     0x7f,     0xf0,     0x07,\n    /* 0000 0000  1111 0011 1111 0111 0011 1111 */\n       0x00,     0xf3,     0xf7,     0x3f,\n    /* 1111 1000  0000 0011 1100 0000 0011 1110 */\n       0xf8,     0x03,     0xc0,     0x3e,\n    /* 0111 1110  1111 0011 1111 1111 1101 0000 */\n       0x7e,     0xf3,     0xff,     0xd0,\n    /* 0000 1111  1010 0000 0011 1111 0111 1111 */\n       0x0f,     0xa0,     0x3f,     0x7f,\n    /* 1011 1110  1111 1111 1111 1010 0000 0000 */\n       0xbe,     0xff,     0xfa,     0x00,\n    /* 0111 1010  0000 0000 1111 1011 1111 1111 */\n       0x7a,     0x00,     0xfb,     0xff,\n    /* 0111 1011  1111 1111 1111 1111 1000 0000 */\n       0x7b,     0xff,     0xff,     0x80,\n    /* 0000 0000  0000 0000 0000 0000 0011 1111 */\n       0x00,     0x00,     0x00,     0x3f,\n    /* 1100 0000  0000 0000 0000 0000 0000 0000 */\n       0xc0,     0x00,     0x00,     0x00,\n    /* 0011 1111  1111 0000 0000 0000 0000 0000 */\n       0x3f,     0xf0,     0x00,     0x00,\n    /* 0000 0000  0000 1111 1111 1000 0000 0000 */\n       0x00,     0x0f,     0xf8,     0x00,\n    /* 0000 0000  0000 0000 0000 101 */\n       0x00,     0x00,     0x0a,\n};\n\n/* test code for Table B.9 - Standard Huffman table I */\nconst int32_t test_output_I[] = {\n    /* line 0, PREFLEN=8, RANGELEN=4, VAL=-31..-16, 11111100+(VAL+31) */\n    -31,    /* 11111100 0000 */\n    -30,    /* 11111100 0001 */\n    -17,    /* 11111100 1110 */\n    -16,    /* 11111100 1111 */\n    /* line 1, PREFLEN=9, RANGELEN=2, VAL=-15..-12, 111111100+(VAL+15) */\n    -15,    /* 111111100 00 */\n    -14,    /* 111111100 01 */\n    -13,    /* 111111100 10 */\n    -12,    /* 111111100 11 */\n    /* line 2, PREFLEN=8, RANGELEN=2, VAL=-11..-8, 11111101+(VAL+11) */\n    -11,    /* 11111101 00 */\n    -10,    /* 11111101 01 */\n    -9,     /* 11111101 10 */\n    -8,     /* 11111101 11 */\n    /* line 3, PREFLEN=9, RANGELEN=1, VAL=-7..-6, 111111101+(VAL+7) */\n    -7,     /* 111111101 0 */\n    -6,     /* 111111101 1 */\n    /* line 4, PREFLEN=7, RANGELEN=1, VAL=-5..-4, 1111100+(VAL+5) */\n    -5,     /* 1111100 0 */\n    -4,     /* 1111100 1 */\n    /* line 5, PREFLEN=4, RANGELEN=1, VAL=-3..-2, 1010+(VAL+3) */\n    -3,     /* 1010 0 */\n    -2,     /* 1010 1 */\n    /* line 6, PREFLEN=3, RANGELEN=1, VAL=-1..0, 010+(VAL+1) */\n    -1,     /* 010 0 */\n    0,      /* 010 1 */\n    /* line 7, PREFLEN=3, RANGELEN=1, VAL=1..2, 011+(VAL-1) */\n    1,      /* 011 0 */\n    2,      /* 011 1 */\n    /* line 8, PREFLEN=5, RANGELEN=1, VAL=3..4, 11010+(VAL-3) */\n    3,      /* 11010 0 */\n    4,      /* 11010 1 */\n    /* line 9, PREFLEN=6, RANGELEN=1, VAL=5..6, 111010+(VAL-5) */\n    5,      /* 111010 0 */\n    6,      /* 111010 1 */\n    /* line 10, PREFLEN=3, RANGELEN=5, VAL=7..38, 100+(VAL-7) */\n    7,      /* 100 00000 */\n    8,      /* 100 00001 */\n    37,     /* 100 11110 */\n    38,     /* 100 11111 */\n    /* line 11, PREFLEN=6, RANGELEN=2, VAL=39..42, 111011+(VAL-39) */\n    39,     /* 111011 00 */\n    40,     /* 111011 01 */\n    41,     /* 111011 10 */\n    42,     /* 111011 11 */\n    /* line 12, PREFLEN=4, RANGELEN=5, VAL=43..74, 1011+(VAL-43) */\n    43,     /* 1011 00000 */\n    44,     /* 1011 00001 */\n    73,     /* 1011 11110 */\n    74,     /* 1011 11111 */\n    /* line 13, PREFLEN=4, RANGELEN=6, VAL=75..138, 1100+(VAL-75) */\n    75,     /* 1100 000000 */\n    76,     /* 1100 000001 */\n    137,    /* 1100 111110 */\n    138,    /* 1100 111111 */\n    /* line 14, PREFLEN=5, RANGELEN=7, VAL=139..266, 11011+(VAL-139) */\n    139,    /* 11011 0000000 */\n    140,    /* 11011 0000001 */\n    265,    /* 11011 1111110 */\n    266,    /* 11011 1111111 */\n    /* line 15, PREFLEN=5, RANGELEN=8, VAL=267..522, 11100+(VAL-267) */\n    267,    /* 11100 00000000 */\n    268,    /* 11100 00000001 */\n    521,    /* 11100 11111110 */\n    522,    /* 11100 11111111 */\n    /* line 16, PREFLEN=6, RANGELEN=8, VAL=523..778, 111100+(VAL-523) */\n    523,    /* 111100 00000000 */\n    524,    /* 111100 00000001 */\n    777,    /* 111100 11111110 */\n    778,    /* 111100 11111111 */\n    /* line 17, PREFLEN=7, RANGELEN=9, VAL=779..1290, 1111101+(VAL-779) */\n    779,    /* 1111101 00000000 0 */\n    780,    /* 1111101 00000000 1 */\n    1289,   /* 1111101 11111111 0 */\n    1290,   /* 1111101 11111111 1 */\n    /* line 18, PREFLEN=6, RANGELEN=11, VAL=1291..3338, 111101+(VAL-1291) */\n    1291,   /* 111101 00000000 000 */\n    1292,   /* 111101 00000000 001 */\n    3337,   /* 111101 11111111 110 */\n    3338,   /* 111101 11111111 111 */\n    /* line 19, PREFLEN=9, RANGELEN=32, VAL=-INF..-32, 111111110+(-32-VAL) */\n    -32,    /* 111111110 00000000 00000000 00000000 00000000 */\n    -33,    /* 111111110 00000000 00000000 00000000 00000001 */\n    /* line 20, PREFLEN=9, RANGELEN=32, VAL=3339..INF, 111111111+(VAL-3339) */\n    3339,   /* 111111111 00000000 00000000 00000000 00000000 */\n    3340,   /* 111111111 00000000 00000000 00000000 00000001 */\n    /* line 21, PREFLEN=2, VAL=OOB, 00 */\n    /*OOB*/ /* 00 */\n};\nconst byte test_input_I[] = {\n    /* 1111 1100 0000 1111 1100 0001 1111 1100 */\n       0xfc,     0x0f,     0xc1,     0xfc,\n    /* 1110 1111 1100 1111 1111 1110 0001 1111 */\n       0xef,     0xcf,     0xfe,     0x1f,\n    /* 1100 0111 1111 1001 0111 1111 0011 1111 */\n       0xc7,     0xf9,     0x7f,     0x3f,\n    /* 1101 0011 1111 0101 1111 1101 1011 1111 */\n       0xd3,     0xf5,     0xfd,     0xbf,\n    /* 0111 1111 1110 1011 1111 1011 1111 1000 */\n       0x7f,     0xeb,     0xfb,     0xf8,\n    /* 1111 1001 1010 0101 0101 0001 0101 1001 */\n       0xf9,     0xa5,     0x51,     0x59,\n    /* 1111 0100 1101 0111 1010 0111 0101 1000 */\n       0xf4,     0xd7,     0xa7,     0x58,\n    /* 0000 1000 0001 1001 1110 1001 1111 1110 */\n       0x08,     0x19,     0xe9,     0xfe,\n    /* 1100 1110 1101 1110 1110 1110 1111 1011 */\n       0xce,     0xde,     0xee,     0xfb,\n    /* 0000 0101 1000 0110 1111 1101 0111 1111 */\n       0x05,     0x86,     0xfd,     0x7f,\n    /* 1100 0000 0011 0000 0001 1100 1111 1011 */\n       0xc0,     0x30,     0x1c,     0xfb,\n    /* 0011 1111 1101 1000 0000 1101 1000 0001 */\n       0x3f,     0xd8,     0x0d,     0x81,\n    /* 1101 1111 1110 1101 1111 1111 1110 0000 */\n       0xdf,     0xed,     0xff,     0xe0,\n    /* 0000 0111 0000 0000 0111 1001 1111 1101 */\n       0x07,     0x00,     0x79,     0xfd,\n    /* 1100 1111 1111 1111 0000 0000 0011 1100 */\n       0xcf,     0xff,     0x00,     0x3c,\n    /* 0000 0001 1111 0011 1111 1011 1100 1111 */\n       0x01,     0xf3,     0xfb,     0xcf,\n    /* 1111 1111 1010 0000 0000 1111 1010 0000 */\n       0xff,     0xa0,     0x0f,     0xa0,\n    /* 0001 1111 1011 1111 1110 1111 1011 1111 */\n       0x1f,     0xbf,     0xef,     0xbf,\n    /* 1111 1111 0100 0000 0000 0111 1010 0000 */\n       0xff,     0x40,     0x07,     0xa0,\n    /* 0000 0111 1101 1111 1111 1101 1110 1111 */\n       0x07,     0xdf,     0xfd,     0xef,\n    /* 1111 1111 1111 1111 0000 0000 0000 0000 */\n       0xff,     0xff,     0x00,     0x00,\n    /* 0000 0000 0000 0000 0111 1111 1000 0000 */\n       0x00,     0x00,     0x7f,     0x80,\n    /* 0000 0000 0000 0000 0000 0000 0111 1111 */\n       0x00,     0x00,     0x00,     0x7f,\n    /* 1110 0000 0000 0000 0000 0000 0000 0000 */\n       0xe0,     0x00,     0x00,     0x00,\n    /* 0001 1111 1111 0000 0000 0000 0000 0000 */\n       0x1f,     0xf0,     0x00,     0x00,\n    /* 0000 0000 0001 00 */\n       0x00,     0x10,\n};\n\n/* test code for Table B.10 - Standard Huffman table J */\nconst int32_t test_output_J[] = {\n    /* line 0, PREFLEN=7, RANGELEN=4, VAL=-21..-6, 1111010+(VAL+21) */\n    -21,    /* 1111010 0000 */\n    -20,    /* 1111010 0001 */\n    -7,     /* 1111010 1110 */\n    -6,     /* 1111010 1111 */\n    /* line 1, PREFLEN=8, RANGELEN=0, VAL=-5, 11111100 */\n    -5,     /* 11111100 */\n    /* line 2, PREFLEN=7, RANGELEN=0, VAL=-5, 1111011 */\n    -4,     /* 1111011 */\n    /* line 3, PREFLEN=5, RANGELEN=0, VAL=-3, 11000 */\n    -3,     /* 11000 */\n    /* line 4, PREFLEN=2, RANGELEN=2, VAL=-2..1, 00+(VAL+2) */\n    -2,     /* 00 00 */\n    -1,     /* 00 01 */\n    0,      /* 00 10 */\n    1,      /* 00 11 */\n    /* line 5, PREFLEN=5, RANGELEN=0, VAL=2, 11001 */\n    2,      /* 11001 */\n    /* line 6, PREFLEN=6, RANGELEN=0, VAL=3, 110110 */\n    3,      /* 110110 */\n    /* line 7, PREFLEN=7, RANGELEN=0, VAL=4, 1111100 */\n    4,      /* 1111100 */\n    /* line 8, PREFLEN=8, RANGELEN=0, VAL=5, 11111101 */\n    5,      /* 11111101 */\n    /* line 9, PREFLEN=2, RANGELEN=6, VAL=6..69, 01+(VAL-6) */\n    6,      /* 01 000000 */\n    7,      /* 01 000001 */\n    68,     /* 01 111110 */\n    69,     /* 01 111111 */\n    /* line 8, PREFLEN=5, RANGELEN=5, VAL=70..101, 11010+(VAL-70) */\n    70,     /* 11010 00000 */\n    71,     /* 11010 00001 */\n    100,    /* 11010 11110 */\n    101,    /* 11010 11111 */\n    /* line 9, PREFLEN=6, RANGELEN=5, VAL=102..133, 110111+(VAL-102) */\n    102,    /* 110111 00000 */\n    103,    /* 110111 00001 */\n    132,    /* 110111 11110 */\n    133,    /* 110111 11111 */\n    /* line 10, PREFLEN=6, RANGELEN=6, VAL=134..197, 111000+(VAL-134) */\n    134,    /* 111000 000000 */\n    135,    /* 111000 000001 */\n    196,    /* 111000 111110 */\n    197,    /* 111000 111111 */\n    /* line 11, PREFLEN=6, RANGELEN=7, VAL=198..325, 111001+(VAL-198) */\n    198,    /* 111001 0000000 */\n    199,    /* 111001 0000001 */\n    324,    /* 111001 1111110 */\n    325,    /* 111001 1111111 */\n    /* line 12, PREFLEN=6, RANGELEN=8, VAL=326..581, 111010+(VAL-326) */\n    326,    /* 111010 00000000 */\n    327,    /* 111010 00000001 */\n    580,    /* 111010 11111110 */\n    581,    /* 111010 11111111 */\n    /* line 13, PREFLEN=6, RANGELEN=9, VAL=582..1093, 111011+(VAL-582) */\n    582,    /* 111011 00000000 0 */\n    583,    /* 111011 00000000 1 */\n    1092,   /* 111011 11111111 0 */\n    1093,   /* 111011 11111111 1 */\n    /* line 14, PREFLEN=6, RANGELEN=10, VAL=1094..2117, 111100+(VAL-1094) */\n    1094,   /* 111100 00000000 00 */\n    1095,   /* 111100 00000000 01 */\n    2116,   /* 111100 11111111 10 */\n    2117,   /* 111100 11111111 11 */\n    /* line 15, PREFLEN=7, RANGELEN=11, VAL=2118..4165, 1111101+(VAL-2118) */\n    2118,   /* 1111101 00000000 000 */\n    2119,   /* 1111101 00000000 001 */\n    4164,   /* 1111101 11111111 110 */\n    4165,   /* 1111101 11111111 111 */\n    /* line 16, PREFLEN=8, RANGELEN=32, VAL=-INF..-22, 11111110+(-22-VAL) */\n    -22,    /* 11111110 00000000 00000000 00000000 00000000 */\n    -23,    /* 11111110 00000000 00000000 00000000 00000001 */\n    /* line 17, PREFLEN=8, RANGELEN=32, VAL=4166..INF, 11111111+(VAL-4166) */\n    4166,   /* 11111111 00000000 00000000 00000000 00000000 */\n    4167,   /* 11111111 00000000 00000000 00000000 00000001 */\n    /* line 8, PREFLEN=2, VAL=OOB, 10 */\n    /*OOB*/ /* 10 */\n};\nconst byte test_input_J[] = {\n    /* 1111 0100 0001 1110 1000 0111 1101 0111 */\n       0xf4,     0x1e,     0x87,     0xd7,\n    /* 0111 1010 1111 1111 1100 1111 0111 1000 */\n       0x7a,     0xff,     0xcf,     0x78,\n    /* 0000 0001 0010 0011 1100 1110 1101 1111 */\n       0x01,     0x23,     0xce,     0xdf,\n    /* 0011 1111 0101 0000 0001 0000 0101 1111 */\n       0x3f,     0x50,     0x10,     0x5f,\n    /* 1001 1111 1111 0100 0000 1101 0000 0111 */\n       0x9f,     0xf4,     0x0d,     0x07,\n    /* 0101 1110 1101 0111 1111 0111 0000 0110 */\n       0x5e,     0xd7,     0xf7,     0x06,\n    /* 1110 0001 1101 1111 1101 1011 1111 1111 */\n       0xe1,     0xdf,     0xdb,     0xff,\n    /* 1000 0000 0011 1000 0000 0111 1000 1111 */\n       0x80,     0x38,     0x07,     0x8f,\n    /* 1011 1000 1111 1111 1001 0000 0001 1100 */\n       0xb8,     0xff,     0x90,     0x1c,\n    /* 1000 0001 1110 0111 1111 0111 0011 1111 */\n       0x81,     0xe7,     0xf7,     0x3f,\n    /* 1111 1010 0000 0000 1110 1000 0000 0111 */\n       0xfa,     0x00,     0xe8,     0x07,\n    /* 1010 1111 1110 1110 1011 1111 1111 1011 */\n       0xaf,     0xee,     0xbf,     0xfb,\n    /* 0000 0000 0111 0110 0000 0001 1110 1111 */\n       0x00,     0x76,     0x01,     0xef,\n    /* 1111 1101 1101 1111 1111 1111 1100 0000 */\n       0xfd,     0xdf,     0xff,     0xc0,\n    /* 0000 0011 1100 0000 0000 0111 1100 1111 */\n       0x03,     0xc0,     0x07,     0xcf,\n    /* 1111 1011 1100 1111 1111 1111 1110 1000 */\n       0xfb,     0xcf,     0xff,     0xe8,\n    /* 0000 0000 1111 1010 0000 0000 0111 1110 */\n       0x00,     0xfa,     0x00,     0x7e,\n    /* 1111 1111 1110 1111 1011 1111 1111 1111 */\n       0xff,     0xef,     0xbf,     0xff,\n    /* 1111 1000 0000 0000 0000 0000 0000 0000 */\n       0xf8,     0x00,     0x00,     0x00,\n    /* 0000 0011 1111 1000 0000 0000 0000 0000 */\n       0x03,     0xf8,     0x00,     0x00,\n    /* 0000 0000 0000 0111 1111 1100 0000 0000 */\n       0x00,     0x07,     0xfc,     0x00,\n    /* 0000 0000 0000 0000 0000 0011 1111 1100 */\n       0x00,     0x00,     0x03,     0xfc,\n    /* 0000 0000 0000 0000 0000 0000 0000 0110 */\n       0x00,     0x00,     0x00,     0x06,\n};\n\n/* test code for Table B.11 - Standard Huffman table K */\nconst int32_t test_output_K[] = {\n    /* line 0, PREFLEN=1, RANGELEN=0, VAL=1, 0 */\n    1,      /* 0 */\n    /* line 1, PREFLEN=2, RANGELEN=1, VAL=2..3, 10+(VAL-2) */\n    2,      /* 10 0 */\n    3,      /* 10 1 */\n    /* line 2, PREFLEN=4, RANGELEN=0, VAL=4, 1100 */\n    4,      /* 1100 */\n    /* line 3, PREFLEN=4, RANGELEN=1, VAL=5..6, 1101+(VAL-5) */\n    5,      /* 1101 0 */\n    6,      /* 1101 1 */\n    /* line 4, PREFLEN=5, RANGELEN=1, VAL=7..8, 11100+(VAL-7) */\n    7,      /* 11100 0 */\n    8,      /* 11100 1 */\n    /* line 5, PREFLEN=5, RANGELEN=2, VAL=9..12, 11101+(VAL-9) */\n    9,      /* 11101 00 */\n    10,     /* 11101 01 */\n    11,     /* 11101 10 */\n    12,     /* 11101 11 */\n    /* line 6, PREFLEN=6, RANGELEN=2, VAL=13..16, 111100+(VAL-13) */\n    13,     /* 111100 00 */\n    14,     /* 111100 01 */\n    15,     /* 111100 10 */\n    16,     /* 111100 11 */\n    /* line 7, PREFLEN=7, RANGELEN=2, VAL=17..20, 1111010+(VAL-17) */\n    17,     /* 1111010 00 */\n    18,     /* 1111010 01 */\n    19,     /* 1111010 10 */\n    20,     /* 1111010 11 */\n    /* line 8, PREFLEN=7, RANGELEN=3, VAL=21..28, 1111011+(VAL-21) */\n    21,     /* 1111011 000 */\n    22,     /* 1111011 001 */\n    27,     /* 1111011 110 */\n    28,     /* 1111011 111 */\n    /* line 9, PREFLEN=7, RANGELEN=4, VAL=29..44, 1111100+(VAL-29) */\n    29,     /* 1111100 0000 */\n    30,     /* 1111100 0001 */\n    43,     /* 1111100 1110 */\n    44,     /* 1111100 1111 */\n    /* line 10, PREFLEN=7, RANGELEN=5, VAL=45..76, 1111101+(VAL-45) */\n    45,     /* 1111101 00000 */\n    46,     /* 1111101 00001 */\n    75,     /* 1111101 11110 */\n    76,     /* 1111101 11111 */\n    /* line 11, PREFLEN=7, RANGELEN=6, VAL=77..140, 1111110+(VAL-77) */\n    77,     /* 1111110 000000 */\n    78,     /* 1111110 000001 */\n    139,    /* 1111110 111110 */\n    140,    /* 1111110 111111 */\n    /* line 12, PREFLEN=7, RANGELEN=32, VAL=141..INF, 1111111+(VAL-141) */\n    141,    /* 1111111 00000000 00000000 00000000 00000000 */\n    142,    /* 1111111 00000000 00000000 00000000 00000001 */\n};\nconst byte test_input_K[] = {\n    /* 0100 1011 1001 1010 1101 1111 0001 1100 */\n       0x4b,     0x9a,     0xdf,     0x1c,\n    /* 1111 0100 1110 1011 1101 1011 1011 1111 */\n       0xf4,     0xeb,     0xdb,     0xbf,\n    /* 1000 0111 1000 1111 1001 0111 1001 1111 */\n       0x87,     0x8f,     0x97,     0x9f,\n    /* 1010 0011 1101 0011 1110 1010 1111 0101 */\n       0xa3,     0xd3,     0xea,     0xf5,\n    /* 1111 1011 0001 1110 1100 1111 1011 1101 */\n       0xfb,     0x1e,     0xcf,     0xbd,\n    /* 1110 1111 1111 1100 0000 1111 1000 0011 */\n       0xef,     0xfc,     0x0f,     0x83,\n    /* 1111 0011 1011 1110 0111 1111 1101 0000 */\n       0xf3,     0xbe,     0x7f,     0xd0,\n    /* 0111 1101 0000 1111 1101 1111 0111 1101 */\n       0x7d,     0x0f,     0xdf,     0x7d,\n    /* 1111 1111 1110 0000 0011 1111 0000 0011 */\n       0xff,     0xe0,     0x3f,     0x03,\n    /* 1111 1011 1110 1111 1101 1111 1111 1111 */\n       0xfb,     0xef,     0xdf,     0xff,\n    /* 0000 0000 0000 0000 0000 0000 0000 0000 */\n       0x00,     0x00,     0x00,     0x00,\n    /* 1111 1110 0000 0000 0000 0000 0000 0000 */\n       0xfe,     0x00,     0x00,     0x00,\n    /* 0000 001 */\n       0x02,\n};\n\n/* test code for Table B.12 - Standard Huffman table L */\nconst int32_t test_output_L[] = {\n    /* line 0, PREFLEN=1, RANGELEN=0, VAL=1, 0 */\n    1,      /* 0 */\n    /* line 1, PREFLEN=2, RANGELEN=0, VAL=2, 10 */\n    2,      /* 10 */\n    /* line 2, PREFLEN=3, RANGELEN=1, VAL=3..4, 110+(VAL-3) */\n    3,      /* 110 0 */\n    4,      /* 110 1 */\n    /* line 3, PREFLEN=5, RANGELEN=0, VAL=5, 11100 */\n    5,      /* 11100 */\n    /* line 4, PREFLEN=5, RANGELEN=1, VAL=6..7, 11101+(VAL-7) */\n    6,      /* 11101 0 */\n    7,      /* 11101 1 */\n    /* line 5, PREFLEN=6, RANGELEN=1, VAL=8..9, 111100+(VAL-8) */\n    8,      /* 111100 0 */\n    9,      /* 111100 1 */\n    /* line 6, PREFLEN=7, RANGELEN=0, VAL=10, 1111010 */\n    10,     /* 1111010 */\n    /* line 7, PREFLEN=7, RANGELEN=1, VAL=11..12, 1111011+(VAL-11) */\n    11,     /* 1111011 0 */\n    12,     /* 1111011 1 */\n    /* line 8, PREFLEN=7, RANGELEN=2, VAL=13..16, 1111100+(VAL-13) */\n    13,     /* 1111100 00 */\n    14,     /* 1111100 01 */\n    15,     /* 1111100 10 */\n    16,     /* 1111100 11 */\n    /* line 9, PREFLEN=7, RANGELEN=3, VAL=17..24, 1111101+(VAL-17) */\n    17,     /* 1111101 000 */\n    18,     /* 1111101 001 */\n    23,     /* 1111101 110 */\n    24,     /* 1111101 111 */\n    /* line 10, PREFLEN=7, RANGELEN=4, VAL=25..40, 1111110+(VAL-25) */\n    25,     /* 1111110 0000 */\n    26,     /* 1111110 0001 */\n    39,     /* 1111110 1110 */\n    40,     /* 1111110 1111 */\n    /* line 11, PREFLEN=8, RANGELEN=5, VAL=41..72, 11111110+(VAL-41) */\n    41,     /* 11111110 00000 */\n    42,     /* 11111110 00001 */\n    71,     /* 11111110 11110 */\n    72,     /* 11111110 11111 */\n    /* line 12, PREFLEN=8, RANGELEN=32, VAL=73..INF, 11111111+(VAL-73) */\n    73,     /* 11111111 00000000 00000000 00000000 00000000 */\n    74,     /* 11111111 00000000 00000000 00000000 00000001 */\n};\nconst byte test_input_L[] = {\n    /* 0101 1001 1011 1100 1110 1011 1011 1111 */\n       0x59,     0xbc,     0xeb,     0xbf,\n    /* 0001 1110 0111 1101 0111 1011 0111 1011 */\n       0x1e,     0x7d,     0x7b,     0x7b,\n    /* 1111 1100 0011 1110 0011 1111 0010 1111 */\n       0xfc,     0x3e,     0x3f,     0x2f,\n    /* 1001 1111 1101 0001 1111 0100 1111 1101 */\n       0x9f,     0xd1,     0xf4,     0xfd,\n    /* 1101 1111 0111 1111 1110 0000 1111 1100 */\n       0xdf,     0x7f,     0xe0,     0xfc,\n    /* 0011 1111 1011 1011 1111 0111 1111 1111 */\n       0x3f,     0xbb,     0xf7,     0xff,\n    /* 0000 0011 1111 1000 0011 1111 1101 1110 */\n       0x03,     0xf8,     0x3f,     0xde,\n    /* 1111 1110 1111 1111 1111 1000 0000 0000 */\n       0xfe,     0xff,     0xf8,     0x00,\n    /* 0000 0000 0000 0000 0000 0111 1111 1000 */\n       0x00,     0x00,     0x07,     0xf8,\n    /* 0000 0000 0000 0000 0000 0000 0000 1 */\n       0x00,     0x00,     0x00,     0x08,\n};\n\n/* test code for Table B.13 - Standard Huffman table M */\nconst int32_t test_output_M[] = {\n    /* line 0, PREFLEN=1, RANGELEN=0, VAL=1, 0 */\n    1,      /* 0 */\n    /* line 1, PREFLEN=3, RANGELEN=0, VAL=2, 100 */\n    2,      /* 100 */\n    /* line 2, PREFLEN=3, RANGELEN=0, VAL=3, 1100 */\n    3,      /* 1100 */\n    /* line 3, PREFLEN=5, RANGELEN=0, VAL=4, 11100 */\n    4,      /* 11100 */\n    /* line 4, PREFLEN=4, RANGELEN=1, VAL=5..6, 1101+(VAL-5) */\n    5,      /* 1101 0 */\n    6,      /* 1101 1 */\n    /* line 5, PREFLEN=3, RANGELEN=3, VAL=7..14, 101+(VAL-7) */\n    7,      /* 101 000 */\n    8,      /* 101 001 */\n    13,     /* 101 110 */\n    14,     /* 101 111 */\n    /* line 6, PREFLEN=6, RANGELEN=1, VAL=15..16, 111010+(VAL-15) */\n    15,     /* 111010 0 */\n    16,     /* 111010 1 */\n    /* line 7, PREFLEN=6, RANGELEN=2, VAL=17..20, 111011+(VAL-17) */\n    17,     /* 111011 00 */\n    18,     /* 111011 01 */\n    19,     /* 111011 10 */\n    20,     /* 111011 11 */\n    /* line 8, PREFLEN=6, RANGELEN=3, VAL=21..28, 111100+(VAL-21) */\n    21,     /* 111100 000 */\n    22,     /* 111100 001 */\n    27,     /* 111100 110 */\n    28,     /* 111100 111 */\n    /* line 9, PREFLEN=6, RANGELEN=4, VAL=29..44, 111101+(VAL-29) */\n    29,     /* 111101 0000 */\n    30,     /* 111101 0001 */\n    43,     /* 111101 1110 */\n    44,     /* 111101 1111 */\n    /* line 10, PREFLEN=6, RANGELEN=5, VAL=45..76, 111110+(VAL-45) */\n    45,     /* 111110 00000 */\n    46,     /* 111110 00001 */\n    75,     /* 111110 11110 */\n    76,     /* 111110 11111 */\n    /* line 11, PREFLEN=7, RANGELEN=6, VAL=77..140, 1111110+(VAL-77) */\n    77,     /* 1111110 000000 */\n    78,     /* 1111110 000001 */\n    139,    /* 1111110 111110 */\n    140,    /* 1111110 111111 */\n    /* line 12, PREFLEN=7, RANGELEN=32, VAL=141..INF, 1111111+(VAL-141) */\n    141,    /* 1111111 00000000 00000000 00000000 00000000 */\n    142,    /* 1111111 00000000 00000000 00000000 00000001 */\n};\nconst byte test_input_M[] = {\n    /* 0100 1100 1110 0110 1011 0111 0100 0101 */\n       0x4c,     0xe6,     0xb7,     0x45,\n    /* 0011 0111 0101 1111 1101 0011 1010 1111 */\n       0x37,     0x5f,     0xd3,     0xaf,\n    /* 0110 0111 0110 1111 0111 0111 0111 1111 */\n       0x67,     0x6f,     0x77,     0x7f,\n    /* 1000 0011 1100 0011 1110 0110 1111 0011 */\n       0x83,     0xc3,     0xe6,     0xf3,\n    /* 1111 1010 0001 1110 1000 1111 1011 1101 */\n       0xfa,     0x1e,     0x8f,     0xbd,\n    /* 1110 1111 1111 1100 0000 1111 1000 0011 */\n       0xef,     0xfc,     0x0f,     0x83,\n    /* 1111 0111 1011 1110 1111 1111 1110 0000 */\n       0xf7,     0xbe,     0xff,     0xe0,\n    /* 0011 1111 0000 0011 1111 1011 1110 1111 */\n       0x3f,     0x03,     0xfb,     0xef,\n    /* 1101 1111 1111 1111 0000 0000 0000 0000 */\n       0xdf,     0xff,     0x00,     0x00,\n    /* 0000 0000 0000 0000 1111 1110 0000 0000 */\n       0x00,     0x00,     0xfe,     0x00,\n    /* 0000 0000 0000 0000 0000 001 */\n       0x00,     0x00,     0x02,\n};\n\n/* test code for Table B.14 - Standard Huffman table N */\nconst int32_t test_output_N[] = {\n    /* line 0, PREFLEN=3, RANGELEN=0, VAL=-2, 100 */\n    -2,     /* 100 */\n    /* line 1, PREFLEN=3, RANGELEN=0, VAL=-1, 101 */\n    -1,     /* 101 */\n    /* line 2, PREFLEN=1, RANGELEN=0, VAL=1, 0 */\n    0,      /* 0 */\n    /* line 3, PREFLEN=3, RANGELEN=0, VAL=1, 110 */\n    1,      /* 110 */\n    /* line 4, PREFLEN=3, RANGELEN=0, VAL=2, 111 */\n    2,      /* 111 */\n};\nconst byte test_input_N[] = {\n    /* 1001 0101 1011 1 */\n       0x95,     0xb8,\n};\n\n/* test code for Table B.15 - Standard Huffman table O */\nconst int32_t test_output_O[] = {\n    /* line 0, PREFLEN=7, RANGELEN=4, VAL=-24..-9, 1111100+(VAL+24) */\n    -24,    /* 1111100 0000 */\n    -23,    /* 1111100 0001 */\n    -10,    /* 1111100 1110 */\n    -9,     /* 1111100 1111 */\n    /* line 1, PREFLEN=6, RANGELEN=2, VAL=-8..-5, 111100+(VAL+8) */\n    -8,     /* 111100 00 */\n    -7,     /* 111100 01 */\n    -6,     /* 111100 10 */\n    -5,     /* 111100 11 */\n    /* line 2, PREFLEN=5, RANGELEN=1, VAL=-4..-3, 11100+(VAL+4) */\n    -4,     /* 11100 0 */\n    -3,     /* 11100 1 */\n    /* line 3, PREFLEN=4, RANGELEN=0, VAL=-2, 1100 */\n    -2,     /* 1100 */\n    /* line 4, PREFLEN=3, RANGELEN=0, VAL=-1, 100 */\n    -1,     /* 100 */\n    /* line 5, PREFLEN=1, RANGELEN=0, VAL=1, 0 */\n    0,      /* 0 */\n    /* line 6, PREFLEN=3, RANGELEN=0, VAL=1, 101 */\n    1,      /* 101 */\n    /* line 7, PREFLEN=4, RANGELEN=0, VAL=2, 1101 */\n    2,      /* 1101 */\n    /* line 8, PREFLEN=5, RANGELEN=1, VAL=3..4, 11101+(VAL-3) */\n    3,      /* 11101 0 */\n    4,      /* 11101 1 */\n    /* line 9, PREFLEN=6, RANGELEN=2, VAL=5..8, 111101+(VAL-5) */\n    5,      /* 111101 00 */\n    6,      /* 111101 01 */\n    7,      /* 111101 10 */\n    8,      /* 111101 11 */\n    /* line 10, PREFLEN=7, RANGELEN=4, VAL=9..24, 1111101+(VAL-9) */\n    9,      /* 1111101 0000 */\n    10,     /* 1111101 0001 */\n    23,     /* 1111101 1110 */\n    24,     /* 1111101 1111 */\n    /* line 11, PREFLEN=7, RANGELEN=32, VAL=-INF..-25, 1111110+(-25-VAL) */\n    -25,    /* 1111110 00000000 00000000 00000000 00000000 */\n    -26,    /* 1111110 00000000 00000000 00000000 00000001 */\n    /* line 12, PREFLEN=7, RANGELEN=32, VAL=25..INF, 1111111+(VAL-25) */\n    25,     /* 1111111 00000000 00000000 00000000 00000000 */\n    26,     /* 1111111 00000000 00000000 00000000 00000001 */\n};\nconst byte test_input_O[] = {\n    /* 1111 1000 0001 1111 0000 0111 1110 0111 */\n       0xf8,     0x1f,     0x07,     0xe7,\n    /* 0111 1100 1111 1111 0000 1111 0001 1111 */\n       0x7c,     0xff,     0x0f,     0x1f,\n    /* 0010 1111 0011 1110 0011 1001 1100 1000 */\n       0x2f,     0x3e,     0x39,     0xc8,\n    /* 1011 1011 1101 0111 0111 1110 1001 1110 */\n       0xbb,     0xd7,     0x7e,     0x9e,\n    /* 1011 1110 1101 1110 1111 1111 0100 0011 */\n       0xbe,     0xde,     0xff,     0x43,\n    /* 1110 1000 1111 1101 1110 1111 1011 1111 */\n       0xe8,     0xfd,     0xef,     0xbf,\n    /* 1111 1000 0000 0000 0000 0000 0000 0000 */\n       0xf8,     0x00,     0x00,     0x00,\n    /* 0000 0011 1111 0000 0000 0000 0000 0000 */\n       0x03,     0xf0,     0x00,     0x00,\n    /* 0000 0000 0000 1111 1111 0000 0000 0000 */\n       0x00,     0x0f,     0xf0,     0x00,\n    /* 0000 0000 0000 0000 0000 1111 1110 0000 */\n       0x00,     0x00,     0x0f,     0xe0,\n    /* 0000 0000 0000 0000 0000 0000 001 */\n       0x00,     0x00,     0x00,     0x20,\n};\n\ntypedef struct test_huffmancodes {\n    const char *name;\n    const Jbig2HuffmanParams *params;\n    const byte *input;\n    const size_t input_len;\n    const int32_t *output;\n    const size_t output_len;\n} test_huffmancodes_t;\n\n#define countof(x) (sizeof((x)) / sizeof((x)[0]))\n\n#define DEF_TEST_HUFFMANCODES(x) { \\\n    #x, \\\n    &jbig2_huffman_params_##x, \\\n    test_input_##x, countof(test_input_##x), \\\n    test_output_##x, countof(test_output_##x), \\\n}\n\ntest_huffmancodes_t   tests[] = {\n    DEF_TEST_HUFFMANCODES(A),\n    DEF_TEST_HUFFMANCODES(B),\n    DEF_TEST_HUFFMANCODES(C),\n    DEF_TEST_HUFFMANCODES(D),\n    DEF_TEST_HUFFMANCODES(E),\n    DEF_TEST_HUFFMANCODES(F),\n    DEF_TEST_HUFFMANCODES(G),\n    DEF_TEST_HUFFMANCODES(H),\n    DEF_TEST_HUFFMANCODES(I),\n    DEF_TEST_HUFFMANCODES(J),\n    DEF_TEST_HUFFMANCODES(K),\n    DEF_TEST_HUFFMANCODES(L),\n    DEF_TEST_HUFFMANCODES(M),\n    DEF_TEST_HUFFMANCODES(N),\n    DEF_TEST_HUFFMANCODES(O),\n};\n\ntypedef struct test_stream {\n    Jbig2WordStream ws;\n    test_huffmancodes_t *h;\n} test_stream_t;\n\nstatic int\ntest_get_word(Jbig2WordStream *self, int offset, uint32_t *word)\n{\n    uint32_t val = 0;\n    test_stream_t *st = (test_stream_t *)self;\n    if (st != NULL) {\n        if (st->h != NULL) {\n            if (offset >= st->h->input_len)\n                return -1;\n            if (offset   < st->h->input_len) {\n                val |= (st->h->input[offset]   << 24);\n            }\n            if (offset+1 < st->h->input_len) {\n                val |= (st->h->input[offset+1] << 16);\n            }\n            if (offset+2 < st->h->input_len) {\n                val |= (st->h->input[offset+2] << 8);\n            }\n            if (offset+3 < st->h->input_len) {\n                val |=  st->h->input[offset+3];\n            }\n        }\n    }\n    *word = val;\n    return 0;\n}\n\nint\nmain (int argc, char **argv)\n{\n    Jbig2Ctx *ctx = jbig2_ctx_new(NULL, 0, NULL, NULL, NULL);\n    int i;\n\n    for (i = 0; i < countof(tests); i++) {\n        Jbig2HuffmanTable *table;\n        Jbig2HuffmanState *hs;\n        test_stream_t st;\n        int32_t code;\n        bool oob;\n        int j;\n\n        st.ws.get_next_word = test_get_word;\n        st.h = &tests[i];\n        printf(\"testing Standard Huffman table %s: \", st.h->name);\n        table = jbig2_build_huffman_table(ctx, st.h->params);\n        if (table == NULL) {\n            printf(\"jbig2_build_huffman_table() returned NULL!\\n\");\n        } else {\n            /* jbig2_dump_huffman_table(table); */\n            hs = jbig2_huffman_new(ctx, &st.ws);\n            if ( hs == NULL ) {\n                printf(\"jbig2_huffman_new() returned NULL!\\n\");\n            } else {\n                for (j = 0; j < st.h->output_len; j++) {\n                    printf(\"%d...\", st.h->output[j]);\n                    code = jbig2_huffman_get(hs, table, &oob);\n                    if (code == st.h->output[j] && !oob) {\n                        printf(\"ok, \");\n                    } else {\n                        int need_comma = 0;\n                        printf(\"NG(\");\n                        if (code != st.h->output[j]) {\n                            printf(\"%d\", code);\n                            need_comma = 1;\n                        }\n                        if (oob) {\n                            if (need_comma)\n                                printf(\",\");\n                            printf(\"OOB\");\n                        }\n                        printf(\"), \");\n                    }\n                }\n                if (st.h->params->HTOOB) {\n                    printf(\"OOB...\");\n                    code = jbig2_huffman_get(hs, table, &oob);\n                    if (oob) {\n                        printf(\"ok\");\n                    } else {\n                        printf(\"NG(%d)\", code);\n                    }\n                }\n                printf(\"\\n\");\n                jbig2_huffman_free(ctx, hs);\n            }\n            jbig2_release_huffman_table(ctx, table);\n        }\n    }\n    jbig2_ctx_free(ctx);\n    return 0;\n}\n#endif\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_huffman.h",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n#ifndef JBIG2_HUFFMAN_H\n#define JBIG2_HUFFMAN_H\n\n/* Huffman coder interface */\n\ntypedef struct _Jbig2HuffmanEntry Jbig2HuffmanEntry;\ntypedef struct _Jbig2HuffmanState Jbig2HuffmanState;\ntypedef struct _Jbig2HuffmanTable Jbig2HuffmanTable;\ntypedef struct _Jbig2HuffmanParams Jbig2HuffmanParams;\n\nstruct _Jbig2HuffmanEntry {\n  union {\n    int32_t RANGELOW;\n    Jbig2HuffmanTable *ext_table;\n  } u;\n  byte PREFLEN;\n  byte RANGELEN;\n  byte flags;\n};\n\nstruct _Jbig2HuffmanTable {\n  int log_table_size;\n  Jbig2HuffmanEntry *entries;\n};\n\ntypedef struct _Jbig2HuffmanLine Jbig2HuffmanLine;\n\nstruct _Jbig2HuffmanLine {\n  int PREFLEN;\n  int RANGELEN;\n  int RANGELOW;\n};\n\nstruct _Jbig2HuffmanParams {\n  bool HTOOB;\n  int n_lines;\n  const Jbig2HuffmanLine *lines;\n};\n\nJbig2HuffmanState *\njbig2_huffman_new (Jbig2Ctx *ctx, Jbig2WordStream *ws);\n\nvoid\njbig2_huffman_free (Jbig2Ctx *ctx, Jbig2HuffmanState *hs);\n\nvoid\njbig2_huffman_skip(Jbig2HuffmanState *hs);\n\nvoid jbig2_huffman_advance(Jbig2HuffmanState *hs, int offset);\n\nint\njbig2_huffman_offset(Jbig2HuffmanState *hs);\n\nint32_t\njbig2_huffman_get (Jbig2HuffmanState *hs,\n\t\t   const Jbig2HuffmanTable *table, bool *oob);\n\nint32_t\njbig2_huffman_get_bits (Jbig2HuffmanState *hs, const int bits, int *err);\n\n#ifdef JBIG2_DEBUG\nvoid jbig2_dump_huffman_state(Jbig2HuffmanState *hs);\nvoid jbig2_dump_huffman_binary(Jbig2HuffmanState *hs);\n#endif\n\nJbig2HuffmanTable *\njbig2_build_huffman_table (Jbig2Ctx *ctx, const Jbig2HuffmanParams *params);\n\nvoid\njbig2_release_huffman_table (Jbig2Ctx *ctx, Jbig2HuffmanTable *table);\n\n/* standard Huffman templates defined by the specification */\nextern const Jbig2HuffmanParams jbig2_huffman_params_A; /* Table B.1  */\nextern const Jbig2HuffmanParams jbig2_huffman_params_B; /* Table B.2  */\nextern const Jbig2HuffmanParams jbig2_huffman_params_C; /* Table B.3  */\nextern const Jbig2HuffmanParams jbig2_huffman_params_D; /* Table B.4  */\nextern const Jbig2HuffmanParams jbig2_huffman_params_E; /* Table B.5  */\nextern const Jbig2HuffmanParams jbig2_huffman_params_F; /* Table B.6  */\nextern const Jbig2HuffmanParams jbig2_huffman_params_G; /* Table B.7  */\nextern const Jbig2HuffmanParams jbig2_huffman_params_H; /* Table B.8  */\nextern const Jbig2HuffmanParams jbig2_huffman_params_I; /* Table B.9  */\nextern const Jbig2HuffmanParams jbig2_huffman_params_J; /* Table B.10 */\nextern const Jbig2HuffmanParams jbig2_huffman_params_K; /* Table B.11 */\nextern const Jbig2HuffmanParams jbig2_huffman_params_L; /* Table B.12 */\nextern const Jbig2HuffmanParams jbig2_huffman_params_M; /* Table B.13 */\nextern const Jbig2HuffmanParams jbig2_huffman_params_N; /* Table B.14 */\nextern const Jbig2HuffmanParams jbig2_huffman_params_O; /* Table B.15 */\n\n/* Routines to handle \"code table segment (53)\" */\n\n/* Parse a code table segment, store Jbig2HuffmanParams in segment->result */\nint\njbig2_table(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte *segment_data);\n\n/* free Jbig2HuffmanParams allocated by jbig2_huffman_table() */\nvoid\njbig2_table_free(Jbig2Ctx *ctx, Jbig2HuffmanParams *params);\n\n/* find a user supplied table used by 'segment' and by 'index' */\nconst Jbig2HuffmanParams *\njbig2_find_table(Jbig2Ctx *ctx, Jbig2Segment *segment, int index);\n\n#endif /* JBIG2_HUFFMAN_H */\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_hufftab.h",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n/* predefined Huffman table definitions\n    -- See Annex B of the JBIG2 specification */\n\n#ifndef JBIG2_HUFFTAB_H\n#define JBIG2_HUFFTAB_H\n\n/* types are in jbig2_huffman.h, you must include that first */\n\n#define JBIG2_COUNTOF(x) (sizeof((x)) / sizeof((x)[0]))\n\n/* Table B.1 */\nconst Jbig2HuffmanLine\njbig2_huffman_lines_A[] = {\n  { 1, 4, 0 },\n  { 2, 8, 16 },\n  { 3, 16, 272 },\n  { 0, 32, -1 },   /* low */\n  { 3, 32, 65808 } /* high */\n};\n\nconst Jbig2HuffmanParams\njbig2_huffman_params_A = { FALSE, JBIG2_COUNTOF(jbig2_huffman_lines_A), jbig2_huffman_lines_A };\n\n/* Table B.2 */\nconst Jbig2HuffmanLine\njbig2_huffman_lines_B[] = {\n  { 1, 0, 0 },\n  { 2, 0, 1 },\n  { 3, 0, 2 },\n  { 4, 3, 3 },\n  { 5, 6, 11 },\n  { 0, 32, -1 }, /* low */\n  { 6, 32, 75 }, /* high */\n  { 6, 0, 0 }    /* OOB */\n};\n\nconst Jbig2HuffmanParams\njbig2_huffman_params_B = { TRUE, JBIG2_COUNTOF(jbig2_huffman_lines_B), jbig2_huffman_lines_B };\n\n/* Table B.3 */\nconst Jbig2HuffmanLine\njbig2_huffman_lines_C[] = {\n  { 8, 8, -256 },\n  { 1, 0, 0 },\n  { 2, 0, 1 },\n  { 3, 0, 2 },\n  { 4, 3, 3 },\n  { 5, 6, 11 },\n  { 8, 32, -257 }, /* low */\n  { 7, 32, 75 },   /* high */\n  { 6, 0, 0 }      /* OOB */\n};\n\nconst Jbig2HuffmanParams\njbig2_huffman_params_C = { TRUE, JBIG2_COUNTOF(jbig2_huffman_lines_C), jbig2_huffman_lines_C };\n\n/* Table B.4 */\nconst Jbig2HuffmanLine\njbig2_huffman_lines_D[] = {\n  { 1, 0, 1 },\n  { 2, 0, 2 },\n  { 3, 0, 3 },\n  { 4, 3, 4 },\n  { 5, 6, 12 },\n  { 0, 32, -1 }, /* low */\n  { 5, 32, 76 }, /* high */\n};\n\nconst Jbig2HuffmanParams\njbig2_huffman_params_D = { FALSE, JBIG2_COUNTOF(jbig2_huffman_lines_D), jbig2_huffman_lines_D };\n\n/* Table B.5 */\nconst Jbig2HuffmanLine\njbig2_huffman_lines_E[] = {\n\t{7, 8, -255},\n\t{1, 0, 1},\n\t{2, 0, 2},\n\t{3, 0, 3},\n\t{4, 3, 4},\n\t{5, 6, 12},\n\t{7, 32, -256}, /* low */\n\t{6, 32, 76}    /* high */\n};\n\nconst Jbig2HuffmanParams\njbig2_huffman_params_E = { FALSE, JBIG2_COUNTOF(jbig2_huffman_lines_E), jbig2_huffman_lines_E };\n\n/* Table B.6 */\nconst Jbig2HuffmanLine\njbig2_huffman_lines_F[] = {\n\t{5, 10, -2048},\n\t{4, 9, -1024},\n\t{4, 8, -512},\n\t{4, 7, -256},\n\t{5, 6, -128},\n\t{5, 5, -64},\n\t{4, 5, -32},\n\t{2, 7, 0},\n\t{3, 7, 128},\n\t{3, 8, 256},\n\t{4, 9, 512},\n\t{4, 10, 1024},\n\t{6, 32, -2049}, /* low */\n\t{6, 32, 2048}   /* high */\n};\n\nconst Jbig2HuffmanParams\njbig2_huffman_params_F = { FALSE, JBIG2_COUNTOF(jbig2_huffman_lines_F), jbig2_huffman_lines_F };\n\n/* Table B.7 */\nconst Jbig2HuffmanLine\njbig2_huffman_lines_G[] = {\n\t{4, 9, -1024},\n\t{3, 8, -512},\n\t{4, 7, -256},\n\t{5, 6, -128},\n\t{5, 5, -64},\n\t{4, 5, -32},\n\t{4, 5, 0},\n\t{5, 5, 32},\n\t{5, 6, 64},\n\t{4, 7, 128},\n\t{3, 8, 256},\n\t{3, 9, 512},\n\t{3, 10, 1024},\n\t{5, 32, -1025}, /* low */\n\t{5, 32, 2048}   /* high */\n};\n\nconst Jbig2HuffmanParams\njbig2_huffman_params_G = { FALSE, JBIG2_COUNTOF(jbig2_huffman_lines_G), jbig2_huffman_lines_G };\n\n/* Table B.8 */\nconst Jbig2HuffmanLine\njbig2_huffman_lines_H[] = {\n\t{8, 3, -15},\n\t{9, 1, -7},\n\t{8, 1, -5},\n\t{9, 0, -3},\n\t{7, 0, -2},\n\t{4, 0, -1},\n\t{2, 1, 0},\n\t{5, 0, 2},\n\t{6, 0, 3},\n\t{3, 4, 4},\n\t{6, 1, 20},\n\t{4, 4, 22},\n\t{4, 5, 38},\n\t{5, 6, 70},\n\t{5, 7, 134},\n\t{6, 7, 262},\n\t{7, 8, 390},\n\t{6, 10, 646},\n\t{9, 32, -16},  /* low */\n\t{9, 32, 1670}, /* high */\n\t{2, 0, 0}      /* OOB */\n};\n\nconst Jbig2HuffmanParams\njbig2_huffman_params_H = { TRUE, JBIG2_COUNTOF(jbig2_huffman_lines_H), jbig2_huffman_lines_H };\n\n/* Table B.9 */\nconst Jbig2HuffmanLine\njbig2_huffman_lines_I[] = {\n\t{8, 4, -31},\n\t{9, 2, -15},\n\t{8, 2, -11},\n\t{9, 1, -7},\n\t{7, 1, -5},\n\t{4, 1, -3},\n\t{3, 1, -1},\n\t{3, 1, 1},\n\t{5, 1, 3},\n\t{6, 1, 5},\n\t{3, 5, 7},\n\t{6, 2, 39},\n\t{4, 5, 43},\n\t{4, 6, 75},\n\t{5, 7, 139},\n\t{5, 8, 267},\n\t{6, 8, 523},\n\t{7, 9, 779},\n\t{6, 11, 1291},\n\t{9, 32, -32},  /* low */\n\t{9, 32, 3339}, /* high */\n\t{2, 0, 0}      /* OOB */\n};\n\nconst Jbig2HuffmanParams\njbig2_huffman_params_I = { TRUE, JBIG2_COUNTOF(jbig2_huffman_lines_I), jbig2_huffman_lines_I };\n\n/* Table B.10 */\nconst Jbig2HuffmanLine\njbig2_huffman_lines_J[] = {\n\t{7, 4, -21},\n\t{8, 0, -5},\n\t{7, 0, -4},\n\t{5, 0, -3},\n\t{2, 2, -2},\n\t{5, 0, 2},\n\t{6, 0, 3},\n\t{7, 0, 4},\n\t{8, 0, 5},\n\t{2, 6, 6},\n\t{5, 5, 70},\n\t{6, 5, 102},\n\t{6, 6, 134},\n\t{6, 7, 198},\n\t{6, 8, 326},\n\t{6, 9, 582},\n\t{6, 10, 1094},\n\t{7, 11, 2118},\n\t{8, 32, -22},  /* low */\n\t{8, 32, 4166}, /* high */\n\t{2, 0, 0}      /* OOB */\n};\n\nconst Jbig2HuffmanParams\njbig2_huffman_params_J = { TRUE, JBIG2_COUNTOF(jbig2_huffman_lines_J), jbig2_huffman_lines_J };\n\n/* Table B.11 */\nconst Jbig2HuffmanLine\njbig2_huffman_lines_K[] = {\n\t{1, 0, 1},\n\t{2, 1, 2},\n\t{4, 0, 4},\n\t{4, 1, 5},\n\t{5, 1, 7},\n\t{5, 2, 9},\n\t{6, 2, 13},\n\t{7, 2, 17},\n\t{7, 3, 21},\n\t{7, 4, 29},\n\t{7, 5, 45},\n\t{7, 6, 77},\n\t{0, 32, -1}, /* low */\n\t{7, 32, 141} /* high */\n};\n\nconst Jbig2HuffmanParams\njbig2_huffman_params_K = { FALSE, JBIG2_COUNTOF(jbig2_huffman_lines_K), jbig2_huffman_lines_K };\n\n/* Table B.12 */\nconst Jbig2HuffmanLine\njbig2_huffman_lines_L[] = {\n\t{1, 0, 1},\n\t{2, 0, 2},\n\t{3, 1, 3},\n\t{5, 0, 5},\n\t{5, 1, 6},\n\t{6, 1, 8},\n\t{7, 0, 10},\n\t{7, 1, 11},\n\t{7, 2, 13},\n\t{7, 3, 17},\n\t{7, 4, 25},\n\t{8, 5, 41},\n\t{8, 32, 73},\n\t{0, 32, -1}, /* low */\n\t{0, 32, 0}   /* high */\n};\n\nconst Jbig2HuffmanParams\njbig2_huffman_params_L = { FALSE, JBIG2_COUNTOF(jbig2_huffman_lines_L), jbig2_huffman_lines_L };\n\n\n/* Table B.13 */\nconst Jbig2HuffmanLine\njbig2_huffman_lines_M[] = {\n\t{1, 0, 1},\n\t{3, 0, 2},\n\t{4, 0, 3},\n\t{5, 0, 4},\n\t{4, 1, 5},\n\t{3, 3, 7},\n\t{6, 1, 15},\n\t{6, 2, 17},\n\t{6, 3, 21},\n\t{6, 4, 29},\n\t{6, 5, 45},\n\t{7, 6, 77},\n\t{0, 32, -1}, /* low */\n\t{7, 32, 141} /* high */\n};\n\nconst Jbig2HuffmanParams\njbig2_huffman_params_M = { FALSE, JBIG2_COUNTOF(jbig2_huffman_lines_M), jbig2_huffman_lines_M };\n\n/* Table B.14 */\nconst Jbig2HuffmanLine\njbig2_huffman_lines_N[] = {\n  { 3, 0, -2 },\n  { 3, 0, -1 },\n  { 1, 0, 0 },\n  { 3, 0, 1 },\n  { 3, 0, 2 },\n  { 0, 32, -1 }, /* low */\n  { 0, 32, 3 },  /* high */\n};\n\nconst Jbig2HuffmanParams\njbig2_huffman_params_N = { FALSE, JBIG2_COUNTOF(jbig2_huffman_lines_N), jbig2_huffman_lines_N };\n\n/* Table B.15 */\nconst Jbig2HuffmanLine\njbig2_huffman_lines_O[] = {\n\t{7, 4, -24},\n\t{6, 2, -8},\n\t{5, 1, -4},\n\t{4, 0, -2},\n\t{3, 0, -1},\n\t{1, 0, 0},\n\t{3, 0, 1},\n\t{4, 0, 2},\n\t{5, 1, 3},\n\t{6, 2, 5},\n\t{7, 4, 9},\n\t{7, 32, -25}, /* low */\n\t{7, 32, 25}   /* high */\n};\n\nconst Jbig2HuffmanParams\njbig2_huffman_params_O = { FALSE, JBIG2_COUNTOF(jbig2_huffman_lines_O), jbig2_huffman_lines_O };\n\n#undef JBIG2_COUNTOF\n\n#endif /* JBIG2_HUFFTAB_H */\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_image.c",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#include \"os_types.h\"\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h> /* memcpy() */\n\n#include \"jbig2.h\"\n#include \"jbig2_priv.h\"\n#include \"jbig2_image.h\"\n\n\n/* allocate a Jbig2Image structure and its associated bitmap */\nJbig2Image* jbig2_image_new(Jbig2Ctx *ctx, int width, int height)\n{\n\tJbig2Image\t*image;\n\tint\t\tstride;\n        int64_t         check;\n\n\timage = jbig2_new(ctx, Jbig2Image, 1);\n\tif (image == NULL) {\n\t\tjbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n            \"could not allocate image structure in jbig2_image_new\");\n\t\treturn NULL;\n\t}\n\n\tstride = ((width - 1) >> 3) + 1; /* generate a byte-aligned stride */\n        /* check for integer multiplication overflow */\n        check = ((int64_t)stride)*((int64_t)height);\n        if (check != (int)check)\n        {\n            jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n                \"integer multiplication overflow from stride(%d)*height(%d)\",\n                stride, height);\n            jbig2_free(ctx->allocator, image);\n            return NULL;\n        }\n        /* Add 1 to accept runs that exceed image width and clamped to width+1 */\n        image->data = jbig2_new(ctx, uint8_t, (int)check + 1);\n\tif (image->data == NULL) {\n        jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n            \"could not allocate image data buffer! [stride(%d)*height(%d) bytes]\",\n                stride, height);\n\t\tjbig2_free(ctx->allocator, image);\n\t\treturn NULL;\n\t}\n\n\timage->width = width;\n\timage->height = height;\n\timage->stride = stride;\n\timage->refcount = 1;\n\n\treturn image;\n}\n\n/* clone an image pointer by bumping its reference count */\nJbig2Image* jbig2_image_clone(Jbig2Ctx *ctx, Jbig2Image *image)\n{\n\tif (image)\n\t\timage->refcount++;\n\treturn image;\n}\n\n/* release an image pointer, freeing it it appropriate */\nvoid jbig2_image_release(Jbig2Ctx *ctx, Jbig2Image *image)\n{\n\tif (image == NULL)\n\t\treturn;\n\timage->refcount--;\n\tif (!image->refcount) jbig2_image_free(ctx, image);\n}\n\n/* free a Jbig2Image structure and its associated memory */\nvoid jbig2_image_free(Jbig2Ctx *ctx, Jbig2Image *image)\n{\n\tif (image)\n\t\tjbig2_free(ctx->allocator, image->data);\n\tjbig2_free(ctx->allocator, image);\n}\n\n/* resize a Jbig2Image */\nJbig2Image *jbig2_image_resize(Jbig2Ctx *ctx, Jbig2Image *image,\n\t\t\t\tint width, int height)\n{\n\tif (width == image->width) {\n            /* check for integer multiplication overflow */\n            int64_t check = ((int64_t)image->stride)*((int64_t)height);\n            if (check != (int)check)\n            {\n                jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n                    \"integer multiplication overflow during resize stride(%d)*height(%d)\",\n                    image->stride, height);\n                return NULL;\n            }\n\t    /* use the same stride, just change the length */\n\t    image->data = jbig2_renew(ctx, image->data, uint8_t, (int)check);\n            if (image->data == NULL) {\n                jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n                    \"could not resize image buffer!\");\n\t\treturn NULL;\n            }\n\t    if (height > image->height) {\n\t\tmemset(image->data + image->height*image->stride,\n\t\t\t0, (height - image->height)*image->stride);\n\t    }\n            image->height = height;\n\n\t} else {\n\t    /* we must allocate a new image buffer and copy */\n\t    jbig2_error(ctx, JBIG2_SEVERITY_WARNING, -1,\n\t\t\"jbig2_image_resize called with a different width (NYI)\");\n\t}\n\n\treturn NULL;\n}\n\n/* composite one jbig2_image onto another\n   slow but general version */\nint jbig2_image_compose_unopt(Jbig2Ctx *ctx,\n\t\t\tJbig2Image *dst, Jbig2Image *src,\n                        int x, int y, Jbig2ComposeOp op)\n{\n    int i, j;\n    int sw = src->width;\n    int sh = src->height;\n    int sx = 0;\n    int sy = 0;\n\n    /* clip to the dst image boundaries */\n    if (x < 0) { sx += -x; sw -= -x; x = 0; }\n    if (y < 0) { sy += -y; sh -= -y; y = 0; }\n    if (x + sw >= dst->width) sw = dst->width - x;\n    if (y + sh >= dst->height) sh = dst->height - y;\n\n    switch (op) {\n\tcase JBIG2_COMPOSE_OR:\n\t    for (j = 0; j < sh; j++) {\n\t\tfor (i = 0; i < sw; i++) {\n\t\t    jbig2_image_set_pixel(dst, i+x, j+y,\n\t\t\tjbig2_image_get_pixel(src, i+sx, j+sy) |\n\t\t\tjbig2_image_get_pixel(dst, i+x, j+y));\n\t\t}\n    \t    }\n\t    break;\n\tcase JBIG2_COMPOSE_AND:\n\t    for (j = 0; j < sh; j++) {\n\t\tfor (i = 0; i < sw; i++) {\n\t\t    jbig2_image_set_pixel(dst, i+x, j+y,\n\t\t\tjbig2_image_get_pixel(src, i+sx, j+sy) &\n\t\t\tjbig2_image_get_pixel(dst, i+x, j+y));\n\t\t}\n    \t    }\n\t    break;\n\tcase JBIG2_COMPOSE_XOR:\n\t    for (j = 0; j < sh; j++) {\n\t\tfor (i = 0; i < sw; i++) {\n\t\t    jbig2_image_set_pixel(dst, i+x, j+y,\n\t\t\tjbig2_image_get_pixel(src, i+sx, j+sy) ^\n\t\t\tjbig2_image_get_pixel(dst, i+x, j+y));\n\t\t}\n    \t    }\n\t    break;\n\tcase JBIG2_COMPOSE_XNOR:\n\t    for (j = 0; j < sh; j++) {\n\t\tfor (i = 0; i < sw; i++) {\n\t\t    jbig2_image_set_pixel(dst, i+x, j+y,\n\t\t\t(jbig2_image_get_pixel(src, i+sx, j+sy) ==\n\t\t\tjbig2_image_get_pixel(dst, i+x, j+y)));\n\t\t}\n    \t    }\n\t    break;\n\tcase JBIG2_COMPOSE_REPLACE:\n\t    for (j = 0; j < sh; j++) {\n\t\tfor (i = 0; i < sw; i++) {\n\t\t    jbig2_image_set_pixel(dst, i+x, j+y,\n\t\t\tjbig2_image_get_pixel(src, i+sx, j+sy));\n\t\t}\n    \t    }\n\t    break;\n    }\n\n    return 0;\n}\n\n/* composite one jbig2_image onto another */\nint jbig2_image_compose(Jbig2Ctx *ctx, Jbig2Image *dst, Jbig2Image *src,\n\t\t\tint x, int y, Jbig2ComposeOp op)\n{\n    int i, j;\n    int w, h;\n    int leftbyte, rightbyte;\n    int shift;\n    uint8_t *s, *ss;\n    uint8_t *d, *dd;\n    uint8_t mask, rightmask;\n\n    if (op != JBIG2_COMPOSE_OR) {\n\t/* hand off the the general routine */\n\treturn jbig2_image_compose_unopt(ctx, dst, src, x, y, op);\n    }\n\n    /* clip */\n    w = src->width;\n    h = src->height;\n    ss = src->data;\n\n    if (x < 0) { w += x; x = 0; }\n    if (y < 0) { h += y; y = 0; }\n    w = (x + w < dst->width) ? w : dst->width - x;\n    h = (y + h < dst->height) ? h : dst->height - y;\n#ifdef JBIG2_DEBUG\n    jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, -1,\n      \"compositing %dx%d at (%d, %d) after clipping\\n\",\n        w, h, x, y);\n#endif\n\n    /* check for zero clipping region */\n    if ((w <= 0) || (h <= 0))\n    {\n#ifdef JBIG2_DEBUG\n        jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, -1, \"zero clipping region\");\n#endif\n        return 0;\n    }\n\n#if 0\n    /* special case complete/strip replacement */\n    /* disabled because it's only safe to do when the destination\n       buffer is all-blank. */\n    if ((x == 0) && (w == src->width)) {\n        memcpy(dst->data + y*dst->stride, src->data, h*src->stride);\n        return 0;\n    }\n#endif\n\n    leftbyte = x >> 3;\n    rightbyte = (x + w - 1) >> 3;\n    shift = x & 7;\n\n    /* general OR case */\n    s = ss;\n    d = dd = dst->data + y*dst->stride + leftbyte;\n    if (d < dst->data || leftbyte > dst->stride || h * dst->stride < 0 ||\n        d - leftbyte + h * dst->stride > dst->data + dst->height * dst->stride) {\n        return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n            \"preventing heap overflow in jbig2_image_compose\");\n    }\n    if (leftbyte == rightbyte) {\n\tmask = 0x100 - (0x100 >> w);\n        for (j = 0; j < h; j++) {\n            *d |= (*s & mask) >> shift;\n            d += dst->stride;\n            s += src->stride;\n        }\n    } else if (shift == 0) {\n\trightmask = (w & 7) ? 0x100 - (1 << (8 - (w & 7))) : 0xFF;\n        for (j = 0; j < h; j++) {\n\t    for (i = leftbyte; i < rightbyte; i++)\n\t\t*d++ |= *s++;\n\t    *d |= *s & rightmask;\n            d = (dd += dst->stride);\n            s = (ss += src->stride);\n\t}\n    } else {\n\tbool overlap = (((w + 7) >> 3) < ((x + w + 7) >> 3) - (x >> 3));\n\tmask = 0x100 - (1 << shift);\n\tif (overlap)\n\t    rightmask = (0x100 - (0x100 >> ((x + w) & 7))) >> (8 - shift);\n\telse\n\t    rightmask = 0x100 - (0x100 >> (w & 7));\n        for (j = 0; j < h; j++) {\n\t    *d++ |= (*s & mask) >> shift;\n            for(i = leftbyte; i < rightbyte - 1; i++) {\n\t\t*d |= ((*s++ & ~mask) << (8 - shift));\n\t\t*d++ |= ((*s & mask) >> shift);\n\t    }\n\t    if (overlap)\n\t\t*d |= (*s & rightmask) << (8 - shift);\n\t    else\n\t\t*d |= ((s[0] & ~mask) << (8 - shift)) |\n\t\t    ((s[1] & rightmask) >> shift);\n\t    d = (dd += dst->stride);\n\t    s = (ss += src->stride);\n\t}\n    }\n\n    return 0;\n}\n\n\n/* initialize an image bitmap to a constant value */\nvoid jbig2_image_clear(Jbig2Ctx *ctx, Jbig2Image *image, int value)\n{\n    const uint8_t fill = value ? 0xFF : 0x00;\n\n    memset(image->data, fill, image->stride*image->height);\n}\n\n/* look up a pixel value in an image.\n   returns 0 outside the image frame for the convenience of\n   the template code\n*/\nint jbig2_image_get_pixel(Jbig2Image *image, int x, int y)\n{\n  const int w = image->width;\n  const int h = image->height;\n  const int byte = (x >> 3) + y*image->stride;\n  const int bit = 7 - (x & 7);\n\n  if ((x < 0) || (x >= w)) return 0;\n  if ((y < 0) || (y >= h)) return 0;\n\n  return ((image->data[byte]>>bit) & 1);\n}\n\n/* set an individual pixel value in an image */\nint jbig2_image_set_pixel(Jbig2Image *image, int x, int y, bool value)\n{\n  const int w = image->width;\n  const int h = image->height;\n  int scratch, mask;\n  int bit, byte;\n\n  if ((x < 0) || (x >= w)) return 0;\n  if ((y < 0) || (y >= h)) return 0;\n\n  byte = (x >> 3) + y*image->stride;\n  bit = 7 - (x & 7);\n  mask = (1 << bit) ^ 0xff;\n\n  scratch = image->data[byte] & mask;\n  image->data[byte] = scratch | (value << bit);\n\n  return 1;\n}\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_image.h",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n\n#ifndef _JBIG2_IMAGE_H\n#define _JBIG2_IMAGE_H\n\nint jbig2_image_get_pixel(Jbig2Image *image, int x, int y);\nint jbig2_image_set_pixel(Jbig2Image *image, int x, int y, bool value);\n\n/* routines for dumping the image data in various formats */\n/* FIXME: should these be in the client instead? */\n\n#include <stdio.h>\n\nint jbig2_image_write_pbm_file(Jbig2Image *image, char *filename);\nint jbig2_image_write_pbm(Jbig2Image *image, FILE *out);\nJbig2Image *jbig2_image_read_pbm_file(Jbig2Ctx *ctx, char *filename);\nJbig2Image *jbig2_image_read_pbm(Jbig2Ctx *ctx, FILE *in);\n\n#ifdef HAVE_LIBPNG\nint jbig2_image_write_png_file(Jbig2Image *image, char *filename);\nint jbig2_image_write_png(Jbig2Image *image, FILE *out);\n#endif\n\n#endif /* _JBIG2_IMAGE_H */\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_image_pbm.c",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#include \"os_types.h\"\n\n#include <stdio.h>\n#include <ctype.h>\n\n#include \"jbig2.h\"\n#include \"jbig2_priv.h\"\n#include \"jbig2_image.h\"\n\n/* take an image structure and write it to a file in pbm format */\n\nint jbig2_image_write_pbm_file(Jbig2Image *image, char *filename)\n{\n    FILE *out;\n    int\terror;\n\n    if ((out = fopen(filename, \"wb\")) == NULL) {\n        fprintf(stderr, \"unable to open '%s' for writing\", filename);\n        return 1;\n    }\n\n    error = jbig2_image_write_pbm(image, out);\n\n    fclose(out);\n    return (error);\n}\n\n/* write out an image struct as a pbm stream to an open file pointer */\n\nint jbig2_image_write_pbm(Jbig2Image *image, FILE *out)\n{\n        /* pbm header */\n        fprintf(out, \"P4\\n%d %d\\n\", image->width, image->height);\n\n        /* pbm format pads to a byte boundary, so we can\n           just write out the whole data buffer\n           NB: this assumes minimal stride for the width */\n        fwrite(image->data, 1, image->height*image->stride, out);\n\n        /* success */\n\treturn 0;\n}\n\n/* take an image from a file in pbm format */\nJbig2Image *jbig2_image_read_pbm_file(Jbig2Ctx *ctx, char *filename)\n{\n    FILE *in;\n    Jbig2Image *image;\n\n    if ((in = fopen(filename, \"rb\")) == NULL) {\n\t\tfprintf(stderr, \"unable to open '%s' for reading\\n\", filename);\n\t\treturn NULL;\n    }\n\n    image = jbig2_image_read_pbm(ctx, in);\n\n    fclose(in);\n\n    return (image);\n}\n\n/* FIXME: should handle multi-image files */\nJbig2Image *jbig2_image_read_pbm(Jbig2Ctx *ctx, FILE *in)\n{\n    int i, dim[2];\n    int done;\n    Jbig2Image *image;\n    int c;\n    char buf[32];\n\n    /* look for 'P4' magic */\n    while ((c = fgetc(in)) != 'P') {\n        if (feof(in)) return NULL;\n    }\n    if ((c = fgetc(in)) != '4') {\n        fprintf(stderr, \"not a binary pbm file.\\n\");\n        return NULL;\n    }\n    /* read size. we must find two decimal numbers representing\n       the image dimensions. 'done' will index whether we're\n       looking for the width or the height and 'i' will be our\n       array index for copying strings into our buffer */\n    done = 0;\n    i = 0;\n    while (done < 2) {\n        c = fgetc(in);\n        /* skip whitespace */\n        if (c == ' ' || c == '\\t' || c == '\\r' || c == '\\n') continue;\n        /* skip comments */\n        if (c == '#') {\n            while ((c = fgetc(in)) != '\\n');\n            continue;\n        }\n        /* report unexpected eof */\n        if (c == EOF) {\n           fprintf(stderr, \"end-of-file parsing pbm header\\n\");\n           return NULL;\n        }\n        if (isdigit(c)) {\n            buf[i++] = c;\n            while (isdigit(c = fgetc(in))) {\n                if (i >= 32) {\n                    fprintf(stderr, \"pbm parsing error\\n\");\n                    return NULL;\n                }\n                buf[i++] = c;\n            }\n            buf[i] = '\\0';\n            if (sscanf(buf, \"%d\", &dim[done]) != 1) {\n                fprintf(stderr, \"couldn't read pbm image dimensions\\n\");\n                return NULL;\n            }\n            i = 0;\n            done++;\n        }\n    }\n    /* allocate image structure */\n    image = jbig2_image_new(ctx, dim[0], dim[1]);\n    if (image == NULL) {\n        fprintf(stderr, \"could not allocate %dx%d image for pbm file\\n\", dim[0], dim[1]);\n        return NULL;\n    }\n    /* the pbm data is byte-aligned, so we can\n       do a simple block read */\n    (void)fread(image->data, 1, image->height*image->stride, in);\n    if (feof(in)) {\n        fprintf(stderr, \"unexpected end of pbm file.\\n\");\n        jbig2_image_release(ctx, image);\n        return NULL;\n    }\n    /* success */\n    return image;\n}\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_image_png.c",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#include \"os_types.h\"\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <png.h>\n\n#if PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR < 5\n#include <pngstruct.h>\n#endif\n\n#define CVT_PTR(ptr) (ptr)\n\n#include \"jbig2.h\"\n#include \"jbig2_priv.h\"\n#include \"jbig2_image.h\"\n\n/* take an image structure and write it out in png format */\n\nstatic void\njbig2_png_write_data(png_structp png_ptr, png_bytep data, png_size_t length)\n{\n    png_size_t check;\n#if PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR < 5\n    png_FILE_p f = (png_FILE_p)png_ptr->io_ptr;\n#else\n    png_FILE_p f = (png_FILE_p)png_get_io_ptr(png_ptr);\n#endif\n\n    check = fwrite(data, 1, length, f);\n    if (check != length) {\n      png_error(png_ptr, \"Write Error\");\n    }\n}\n\nstatic void\njbig2_png_flush(png_structp png_ptr)\n{\n#if PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR < 5\n    png_FILE_p f = (png_FILE_p)png_ptr->io_ptr;\n#else\n    png_FILE_p f = (png_FILE_p)png_get_io_ptr(png_ptr);\n#endif\n\n    if (f != NULL)\n        fflush(f);\n}\n\nint jbig2_image_write_png_file(Jbig2Image *image, char *filename)\n{\n    FILE *out;\n    int\terror;\n\n    if ((out = fopen(filename, \"wb\")) == NULL) {\n\t\tfprintf(stderr, \"unable to open '%s' for writing\\n\", filename);\n\t\treturn 1;\n    }\n\n    error = jbig2_image_write_png(image, out);\n\n    fclose(out);\n    return (error);\n}\n\n/* write out an image struct in png format to an open file pointer */\n\nint jbig2_image_write_png(Jbig2Image *image, FILE *out)\n{\n\tint\t\ti;\n\tpng_structp\tpng;\n\tpng_infop\tinfo;\n\tpng_bytep\trowpointer;\n\n\tpng = png_create_write_struct(PNG_LIBPNG_VER_STRING,\n\t\tNULL, NULL, NULL);\n\tif (png == NULL) {\n\t\tfprintf(stderr, \"unable to create png structure\\n\");\n\t\treturn 2;\n\t}\n\n\tinfo = png_create_info_struct(png);\n\tif (info == NULL) {\n            fprintf(stderr, \"unable to create png info structure\\n\");\n            png_destroy_write_struct(&png,  (png_infopp)NULL);\n            return 3;\n\t}\n\n\t/* set/check error handling */\n\tif (setjmp(png_jmpbuf(png))) {\n\t\t/* we've returned here after an internal error */\n\t\tfprintf(stderr, \"internal error in libpng saving file\\n\");\n\t\tpng_destroy_write_struct(&png, &info);\n\t\treturn 4;\n\t}\n\n        /* png_init_io() doesn't work linking dynamically to libpng on win32\n           one has to either link statically or use callbacks because of runtime\n           variations */\n\t/* png_init_io(png, out); */\n        png_set_write_fn(png, (png_voidp)out, jbig2_png_write_data,\n            jbig2_png_flush);\n\n\t/* now we fill out the info structure with our format data */\n\tpng_set_IHDR(png, info, image->width, image->height,\n\t\t1, PNG_COLOR_TYPE_GRAY, PNG_INTERLACE_NONE,\n\t\tPNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);\n\tpng_write_info(png, info);\n\n\t/* png natively treates 0 as black. This will convert for us */\n\tpng_set_invert_mono(png);\n\n\t/* write out each row in turn */\n\trowpointer = (png_bytep)image->data;\n\tfor(i = 0; i < image->height; i++) {\n\t\tpng_write_row(png, rowpointer);\n\t\trowpointer += image->stride;\n\t}\n\n\t/* finish and clean up */\n\tpng_write_end(png, info);\n\tpng_destroy_write_struct(&png, &info);\n\n\treturn 0;\n}\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_metadata.c",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#include \"os_types.h\"\n\n#include <stdlib.h>\n#include <string.h>\n\n#include \"jbig2.h\"\n#include \"jbig2_priv.h\"\n#include \"jbig2_metadata.h\"\n\n/* metadata key,value list object */\nJbig2Metadata *jbig2_metadata_new(Jbig2Ctx *ctx, Jbig2Encoding encoding)\n{\n    Jbig2Metadata *md = jbig2_new(ctx, Jbig2Metadata, 1);\n\n    if (md != NULL) {\n        md->encoding = encoding;\n        md->entries = 0;\n        md->max_entries = 4;\n        md->keys = jbig2_new(ctx, char*, md->max_entries);\n        md->values = jbig2_new(ctx, char*, md->max_entries);\n        if (md->keys == NULL || md->values == NULL) {\n            jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n                \"failed to allocate storage for metadata keys/values\");\n            jbig2_metadata_free(ctx, md);\n            md = NULL;\n        }\n    } else {\n        jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n            \"failed to allocate storage for metadata\");\n    }\n    return md;\n}\n\nvoid jbig2_metadata_free(Jbig2Ctx *ctx, Jbig2Metadata *md)\n{\n    int i;\n\n    if (md->keys) {\n      /* assume we own the pointers */\n      for (i = 0; i < md->entries; i++)\n        jbig2_free(ctx->allocator, md->keys[i]);\n      jbig2_free(ctx->allocator, md->keys);\n    }\n    if (md->values) {\n      for (i = 0; i < md->entries; i++)\n        jbig2_free(ctx->allocator, md->values[i]);\n      jbig2_free(ctx->allocator, md->values);\n    }\n    jbig2_free(ctx->allocator, md);\n}\n\nstatic char *jbig2_strndup(Jbig2Ctx *ctx, const char *c, const int len)\n{\n    char *s = jbig2_new(ctx, char, len);\n    if (s == NULL) {\n        jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n            \"unable to duplicate comment string\");\n    } else {\n        memcpy(s, c, len);\n    }\n    return s;\n}\n\nint jbig2_metadata_add(Jbig2Ctx *ctx, Jbig2Metadata *md,\n                        const char *key, const int key_length,\n                        const char *value, const int value_length)\n{\n    char **keys, **values;\n\n    /* grow the array if necessary */\n    if (md->entries == md->max_entries) {\n        md->max_entries <<= 1;\n        keys = jbig2_renew(ctx, md->keys, char*, md->max_entries);\n        values = jbig2_renew(ctx, md->values, char*, md->max_entries);\n        if (keys == NULL || values == NULL) {\n            jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n                \"unable to resize metadata structure\");\n            return -1;\n        }\n        md->keys = keys;\n        md->values = values;\n    }\n\n    /* copy the passed key,value pair */\n    md->keys[md->entries] = jbig2_strndup(ctx, key, key_length);\n    md->values[md->entries] = jbig2_strndup(ctx, value, value_length);\n    md->entries++;\n\n    return 0;\n}\n\n\n/* decode an ascii comment segment 7.4.15.1 */\nint jbig2_comment_ascii(Jbig2Ctx *ctx, Jbig2Segment *segment,\n                               const uint8_t *segment_data)\n{\n    char *s = (char *)(segment_data + 4);\n    char *end = (char *)(segment_data + segment->data_length);\n    Jbig2Metadata *comment;\n    char *key, *value;\n\n    jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,\n        \"ASCII comment data\");\n\n    comment = jbig2_metadata_new(ctx, JBIG2_ENCODING_ASCII);\n    if (comment == NULL) {\n        jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n            \"unable to allocate comment structure\");\n        return -1;\n    }\n    /* loop over the segment data pulling out the key,value pairs */\n    while (s < end && *s) {\n        key = s;\n        value = memchr(key, '\\0', end - key);\n        if (!value) goto too_short;\n        value++;\n        s = memchr(value, '\\0', end - value);\n        if (!s) goto too_short;\n        s++;\n        jbig2_metadata_add(ctx, comment, key, value - key, value, s - value);\n        jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,\n            \"'%s'\\t'%s'\", key, value);\n    }\n\n    /* TODO: associate with ctx, page, or referred-to segment(s) */\n    segment->result = comment;\n\n    return 0;\n\ntoo_short:\n    jbig2_metadata_free(ctx, comment);\n    return jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n        \"unexpected end of comment segment\");\n}\n\n/* decode a UCS-16 comment segement 7.4.15.2 */\nint jbig2_comment_unicode(Jbig2Ctx *ctx, Jbig2Segment *segment,\n                               const uint8_t *segment_data)\n{\n    return jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n        \"unhandled unicode comment segment\");\n}\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_metadata.h",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n\n#ifndef _JBIG2_METADATA_H\n#define _JBIG2_METADATA_H\n\n/* metadata from extension segments */\n\n/* these bits should be moved to jbig2.h for public access */\ntypedef enum {\n    JBIG2_ENCODING_ASCII,\n    JBIG2_ENCODING_UCS16\n} Jbig2Encoding;\n\ntypedef struct _Jbig2Metadata Jbig2Metadata;\n\nJbig2Metadata *jbig2_metadata_new(Jbig2Ctx *ctx, Jbig2Encoding encoding);\nvoid jbig2_metadata_free(Jbig2Ctx *ctx, Jbig2Metadata *md);\nint jbig2_metadata_add(Jbig2Ctx *ctx, Jbig2Metadata *md,\n                        const char *key, const int key_length,\n                        const char *value, const int value_length);\n\nstruct _Jbig2Metadata {\n    Jbig2Encoding encoding;\n    char **keys, **values;\n    int entries, max_entries;\n};\n\n/* these bits can go to jbig2_priv.h */\nint jbig2_comment_ascii(Jbig2Ctx *ctx, Jbig2Segment *segment,\n                                const uint8_t *segment_data);\nint jbig2_comment_unicode(Jbig2Ctx *ctx, Jbig2Segment *segment,\n                               const uint8_t *segment_data);\n\n#endif /* _JBIG2_METADATA_H */\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_mmr.c",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n/* An implementation of MMR decoding. This is based on the\n   implementation in Fitz, which in turn is based on the one\n   in Ghostscript.\n*/\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#include \"os_types.h\"\n\n#include <stddef.h>\n#include <stdio.h>\n#include <string.h>\n\n#include \"jbig2.h\"\n#include \"jbig2_priv.h\"\n#include \"jbig2_arith.h\"\n#include \"jbig2_generic.h\"\n#include \"jbig2_mmr.h\"\n\ntypedef struct {\n\tint width;\n\tint height;\n\tconst byte *data;\n\tsize_t size;\n\tint data_index;\n\tint bit_index;\n\tuint32_t word;\n} Jbig2MmrCtx;\n\n\nstatic void\njbig2_decode_mmr_init(Jbig2MmrCtx *mmr, int width, int height, const byte *data, size_t size)\n{\n\tint i;\n\tuint32_t word = 0;\n\n\tmmr->width = width;\n\tmmr->height = height;\n\tmmr->data = data;\n\tmmr->size = size;\n\tmmr->data_index = 0;\n\tmmr->bit_index = 0;\n\n\tfor (i = 0; i < size && i < 4; i++)\n\t\tword |= (data[i] << ((3 - i) << 3));\n\tmmr->word = word;\n}\n\nstatic void\njbig2_decode_mmr_consume(Jbig2MmrCtx *mmr, int n_bits)\n{\n\tmmr->word <<= n_bits;\n\tmmr->bit_index += n_bits;\n\twhile (mmr->bit_index >= 8) {\n\t\tmmr->bit_index -= 8;\n\t\tif (mmr->data_index + 4 < mmr->size)\n\t\t\tmmr->word |= (mmr->data[mmr->data_index + 4] << mmr->bit_index);\n\t\tmmr->data_index++;\n\t}\n}\n\n/*\n<raph> the first 2^(initialbits) entries map bit patterns to decodes\n<raph> let's say initial_bits is 8 for the sake of example\n<raph> and that the code is 1001\n<raph> that means that entries 0x90 .. 0x9f have the entry { val, 4 }\n<raph> because those are all the bytes that start with the code\n<raph> and the 4 is the length of the code\n... if (n_bits > initial_bits) ...\n<raph> anyway, in that case, it basically points to a mini table\n<raph> the n_bits is the maximum length of all codes beginning with that byte\n<raph> so 2^(n_bits - initial_bits) is the size of the mini-table\n<raph> peter came up with this, and it makes sense\n*/\n\ntypedef struct {\n\tshort val;\n\tshort n_bits;\n} mmr_table_node;\n\n/* white decode table (runlength huffman codes) */\nconst mmr_table_node jbig2_mmr_white_decode[] = {\n{ 256, 12 },\n{ 272, 12 },\n{ 29, 8 },\n{ 30, 8 },\n{ 45, 8 },\n{ 46, 8 },\n{ 22, 7 },\n{ 22, 7 },\n{ 23, 7 },\n{ 23, 7 },\n{ 47, 8 },\n{ 48, 8 },\n{ 13, 6 },\n{ 13, 6 },\n{ 13, 6 },\n{ 13, 6 },\n{ 20, 7 },\n{ 20, 7 },\n{ 33, 8 },\n{ 34, 8 },\n{ 35, 8 },\n{ 36, 8 },\n{ 37, 8 },\n{ 38, 8 },\n{ 19, 7 },\n{ 19, 7 },\n{ 31, 8 },\n{ 32, 8 },\n{ 1, 6 },\n{ 1, 6 },\n{ 1, 6 },\n{ 1, 6 },\n{ 12, 6 },\n{ 12, 6 },\n{ 12, 6 },\n{ 12, 6 },\n{ 53, 8 },\n{ 54, 8 },\n{ 26, 7 },\n{ 26, 7 },\n{ 39, 8 },\n{ 40, 8 },\n{ 41, 8 },\n{ 42, 8 },\n{ 43, 8 },\n{ 44, 8 },\n{ 21, 7 },\n{ 21, 7 },\n{ 28, 7 },\n{ 28, 7 },\n{ 61, 8 },\n{ 62, 8 },\n{ 63, 8 },\n{ 0, 8 },\n{ 320, 8 },\n{ 384, 8 },\n{ 10, 5 },\n{ 10, 5 },\n{ 10, 5 },\n{ 10, 5 },\n{ 10, 5 },\n{ 10, 5 },\n{ 10, 5 },\n{ 10, 5 },\n{ 11, 5 },\n{ 11, 5 },\n{ 11, 5 },\n{ 11, 5 },\n{ 11, 5 },\n{ 11, 5 },\n{ 11, 5 },\n{ 11, 5 },\n{ 27, 7 },\n{ 27, 7 },\n{ 59, 8 },\n{ 60, 8 },\n{ 288, 9 },\n{ 290, 9 },\n{ 18, 7 },\n{ 18, 7 },\n{ 24, 7 },\n{ 24, 7 },\n{ 49, 8 },\n{ 50, 8 },\n{ 51, 8 },\n{ 52, 8 },\n{ 25, 7 },\n{ 25, 7 },\n{ 55, 8 },\n{ 56, 8 },\n{ 57, 8 },\n{ 58, 8 },\n{ 192, 6 },\n{ 192, 6 },\n{ 192, 6 },\n{ 192, 6 },\n{ 1664, 6 },\n{ 1664, 6 },\n{ 1664, 6 },\n{ 1664, 6 },\n{ 448, 8 },\n{ 512, 8 },\n{ 292, 9 },\n{ 640, 8 },\n{ 576, 8 },\n{ 294, 9 },\n{ 296, 9 },\n{ 298, 9 },\n{ 300, 9 },\n{ 302, 9 },\n{ 256, 7 },\n{ 256, 7 },\n{ 2, 4 },\n{ 2, 4 },\n{ 2, 4 },\n{ 2, 4 },\n{ 2, 4 },\n{ 2, 4 },\n{ 2, 4 },\n{ 2, 4 },\n{ 2, 4 },\n{ 2, 4 },\n{ 2, 4 },\n{ 2, 4 },\n{ 2, 4 },\n{ 2, 4 },\n{ 2, 4 },\n{ 2, 4 },\n{ 3, 4 },\n{ 3, 4 },\n{ 3, 4 },\n{ 3, 4 },\n{ 3, 4 },\n{ 3, 4 },\n{ 3, 4 },\n{ 3, 4 },\n{ 3, 4 },\n{ 3, 4 },\n{ 3, 4 },\n{ 3, 4 },\n{ 3, 4 },\n{ 3, 4 },\n{ 3, 4 },\n{ 3, 4 },\n{ 128, 5 },\n{ 128, 5 },\n{ 128, 5 },\n{ 128, 5 },\n{ 128, 5 },\n{ 128, 5 },\n{ 128, 5 },\n{ 128, 5 },\n{ 8, 5 },\n{ 8, 5 },\n{ 8, 5 },\n{ 8, 5 },\n{ 8, 5 },\n{ 8, 5 },\n{ 8, 5 },\n{ 8, 5 },\n{ 9, 5 },\n{ 9, 5 },\n{ 9, 5 },\n{ 9, 5 },\n{ 9, 5 },\n{ 9, 5 },\n{ 9, 5 },\n{ 9, 5 },\n{ 16, 6 },\n{ 16, 6 },\n{ 16, 6 },\n{ 16, 6 },\n{ 17, 6 },\n{ 17, 6 },\n{ 17, 6 },\n{ 17, 6 },\n{ 4, 4 },\n{ 4, 4 },\n{ 4, 4 },\n{ 4, 4 },\n{ 4, 4 },\n{ 4, 4 },\n{ 4, 4 },\n{ 4, 4 },\n{ 4, 4 },\n{ 4, 4 },\n{ 4, 4 },\n{ 4, 4 },\n{ 4, 4 },\n{ 4, 4 },\n{ 4, 4 },\n{ 4, 4 },\n{ 5, 4 },\n{ 5, 4 },\n{ 5, 4 },\n{ 5, 4 },\n{ 5, 4 },\n{ 5, 4 },\n{ 5, 4 },\n{ 5, 4 },\n{ 5, 4 },\n{ 5, 4 },\n{ 5, 4 },\n{ 5, 4 },\n{ 5, 4 },\n{ 5, 4 },\n{ 5, 4 },\n{ 5, 4 },\n{ 14, 6 },\n{ 14, 6 },\n{ 14, 6 },\n{ 14, 6 },\n{ 15, 6 },\n{ 15, 6 },\n{ 15, 6 },\n{ 15, 6 },\n{ 64, 5 },\n{ 64, 5 },\n{ 64, 5 },\n{ 64, 5 },\n{ 64, 5 },\n{ 64, 5 },\n{ 64, 5 },\n{ 64, 5 },\n{ 6, 4 },\n{ 6, 4 },\n{ 6, 4 },\n{ 6, 4 },\n{ 6, 4 },\n{ 6, 4 },\n{ 6, 4 },\n{ 6, 4 },\n{ 6, 4 },\n{ 6, 4 },\n{ 6, 4 },\n{ 6, 4 },\n{ 6, 4 },\n{ 6, 4 },\n{ 6, 4 },\n{ 6, 4 },\n{ 7, 4 },\n{ 7, 4 },\n{ 7, 4 },\n{ 7, 4 },\n{ 7, 4 },\n{ 7, 4 },\n{ 7, 4 },\n{ 7, 4 },\n{ 7, 4 },\n{ 7, 4 },\n{ 7, 4 },\n{ 7, 4 },\n{ 7, 4 },\n{ 7, 4 },\n{ 7, 4 },\n{ 7, 4 },\n{ -2, 3 },\n{ -2, 3 },\n{ -1, 0 },\n{ -1, 0 },\n{ -1, 0 },\n{ -1, 0 },\n{ -1, 0 },\n{ -1, 0 },\n{ -1, 0 },\n{ -1, 0 },\n{ -1, 0 },\n{ -1, 0 },\n{ -1, 0 },\n{ -1, 0 },\n{ -1, 0 },\n{ -3, 4 },\n{ 1792, 3 },\n{ 1792, 3 },\n{ 1984, 4 },\n{ 2048, 4 },\n{ 2112, 4 },\n{ 2176, 4 },\n{ 2240, 4 },\n{ 2304, 4 },\n{ 1856, 3 },\n{ 1856, 3 },\n{ 1920, 3 },\n{ 1920, 3 },\n{ 2368, 4 },\n{ 2432, 4 },\n{ 2496, 4 },\n{ 2560, 4 },\n{ 1472, 1 },\n{ 1536, 1 },\n{ 1600, 1 },\n{ 1728, 1 },\n{ 704, 1 },\n{ 768, 1 },\n{ 832, 1 },\n{ 896, 1 },\n{ 960, 1 },\n{ 1024, 1 },\n{ 1088, 1 },\n{ 1152, 1 },\n{ 1216, 1 },\n{ 1280, 1 },\n{ 1344, 1 },\n{ 1408, 1 }\n};\n\n/* black decode table (runlength huffman codes) */\nconst mmr_table_node jbig2_mmr_black_decode[] = {\n{ 128, 12 },\n{ 160, 13 },\n{ 224, 12 },\n{ 256, 12 },\n{ 10, 7 },\n{ 11, 7 },\n{ 288, 12 },\n{ 12, 7 },\n{ 9, 6 },\n{ 9, 6 },\n{ 8, 6 },\n{ 8, 6 },\n{ 7, 5 },\n{ 7, 5 },\n{ 7, 5 },\n{ 7, 5 },\n{ 6, 4 },\n{ 6, 4 },\n{ 6, 4 },\n{ 6, 4 },\n{ 6, 4 },\n{ 6, 4 },\n{ 6, 4 },\n{ 6, 4 },\n{ 5, 4 },\n{ 5, 4 },\n{ 5, 4 },\n{ 5, 4 },\n{ 5, 4 },\n{ 5, 4 },\n{ 5, 4 },\n{ 5, 4 },\n{ 1, 3 },\n{ 1, 3 },\n{ 1, 3 },\n{ 1, 3 },\n{ 1, 3 },\n{ 1, 3 },\n{ 1, 3 },\n{ 1, 3 },\n{ 1, 3 },\n{ 1, 3 },\n{ 1, 3 },\n{ 1, 3 },\n{ 1, 3 },\n{ 1, 3 },\n{ 1, 3 },\n{ 1, 3 },\n{ 4, 3 },\n{ 4, 3 },\n{ 4, 3 },\n{ 4, 3 },\n{ 4, 3 },\n{ 4, 3 },\n{ 4, 3 },\n{ 4, 3 },\n{ 4, 3 },\n{ 4, 3 },\n{ 4, 3 },\n{ 4, 3 },\n{ 4, 3 },\n{ 4, 3 },\n{ 4, 3 },\n{ 4, 3 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 3, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ 2, 2 },\n{ -2, 4 },\n{ -2, 4 },\n{ -1, 0 },\n{ -1, 0 },\n{ -1, 0 },\n{ -1, 0 },\n{ -1, 0 },\n{ -1, 0 },\n{ -1, 0 },\n{ -1, 0 },\n{ -1, 0 },\n{ -1, 0 },\n{ -1, 0 },\n{ -1, 0 },\n{ -1, 0 },\n{ -3, 5 },\n{ 1792, 4 },\n{ 1792, 4 },\n{ 1984, 5 },\n{ 2048, 5 },\n{ 2112, 5 },\n{ 2176, 5 },\n{ 2240, 5 },\n{ 2304, 5 },\n{ 1856, 4 },\n{ 1856, 4 },\n{ 1920, 4 },\n{ 1920, 4 },\n{ 2368, 5 },\n{ 2432, 5 },\n{ 2496, 5 },\n{ 2560, 5 },\n{ 18, 3 },\n{ 18, 3 },\n{ 18, 3 },\n{ 18, 3 },\n{ 18, 3 },\n{ 18, 3 },\n{ 18, 3 },\n{ 18, 3 },\n{ 52, 5 },\n{ 52, 5 },\n{ 640, 6 },\n{ 704, 6 },\n{ 768, 6 },\n{ 832, 6 },\n{ 55, 5 },\n{ 55, 5 },\n{ 56, 5 },\n{ 56, 5 },\n{ 1280, 6 },\n{ 1344, 6 },\n{ 1408, 6 },\n{ 1472, 6 },\n{ 59, 5 },\n{ 59, 5 },\n{ 60, 5 },\n{ 60, 5 },\n{ 1536, 6 },\n{ 1600, 6 },\n{ 24, 4 },\n{ 24, 4 },\n{ 24, 4 },\n{ 24, 4 },\n{ 25, 4 },\n{ 25, 4 },\n{ 25, 4 },\n{ 25, 4 },\n{ 1664, 6 },\n{ 1728, 6 },\n{ 320, 5 },\n{ 320, 5 },\n{ 384, 5 },\n{ 384, 5 },\n{ 448, 5 },\n{ 448, 5 },\n{ 512, 6 },\n{ 576, 6 },\n{ 53, 5 },\n{ 53, 5 },\n{ 54, 5 },\n{ 54, 5 },\n{ 896, 6 },\n{ 960, 6 },\n{ 1024, 6 },\n{ 1088, 6 },\n{ 1152, 6 },\n{ 1216, 6 },\n{ 64, 3 },\n{ 64, 3 },\n{ 64, 3 },\n{ 64, 3 },\n{ 64, 3 },\n{ 64, 3 },\n{ 64, 3 },\n{ 64, 3 },\n{ 13, 1 },\n{ 13, 1 },\n{ 13, 1 },\n{ 13, 1 },\n{ 13, 1 },\n{ 13, 1 },\n{ 13, 1 },\n{ 13, 1 },\n{ 13, 1 },\n{ 13, 1 },\n{ 13, 1 },\n{ 13, 1 },\n{ 13, 1 },\n{ 13, 1 },\n{ 13, 1 },\n{ 13, 1 },\n{ 23, 4 },\n{ 23, 4 },\n{ 50, 5 },\n{ 51, 5 },\n{ 44, 5 },\n{ 45, 5 },\n{ 46, 5 },\n{ 47, 5 },\n{ 57, 5 },\n{ 58, 5 },\n{ 61, 5 },\n{ 256, 5 },\n{ 16, 3 },\n{ 16, 3 },\n{ 16, 3 },\n{ 16, 3 },\n{ 17, 3 },\n{ 17, 3 },\n{ 17, 3 },\n{ 17, 3 },\n{ 48, 5 },\n{ 49, 5 },\n{ 62, 5 },\n{ 63, 5 },\n{ 30, 5 },\n{ 31, 5 },\n{ 32, 5 },\n{ 33, 5 },\n{ 40, 5 },\n{ 41, 5 },\n{ 22, 4 },\n{ 22, 4 },\n{ 14, 1 },\n{ 14, 1 },\n{ 14, 1 },\n{ 14, 1 },\n{ 14, 1 },\n{ 14, 1 },\n{ 14, 1 },\n{ 14, 1 },\n{ 14, 1 },\n{ 14, 1 },\n{ 14, 1 },\n{ 14, 1 },\n{ 14, 1 },\n{ 14, 1 },\n{ 14, 1 },\n{ 14, 1 },\n{ 15, 2 },\n{ 15, 2 },\n{ 15, 2 },\n{ 15, 2 },\n{ 15, 2 },\n{ 15, 2 },\n{ 15, 2 },\n{ 15, 2 },\n{ 128, 5 },\n{ 192, 5 },\n{ 26, 5 },\n{ 27, 5 },\n{ 28, 5 },\n{ 29, 5 },\n{ 19, 4 },\n{ 19, 4 },\n{ 20, 4 },\n{ 20, 4 },\n{ 34, 5 },\n{ 35, 5 },\n{ 36, 5 },\n{ 37, 5 },\n{ 38, 5 },\n{ 39, 5 },\n{ 21, 4 },\n{ 21, 4 },\n{ 42, 5 },\n{ 43, 5 },\n{ 0, 3 },\n{ 0, 3 },\n{ 0, 3 },\n{ 0, 3 }\n};\n\n#define getbit(buf, x) ( ( buf[x >> 3] >> ( 7 - (x & 7) ) ) & 1 )\n\nstatic int\njbig2_find_changing_element(const byte *line, int x, int w)\n{\n\tint a, b;\n\n\tif (line == 0)\n\t\treturn w;\n\n\tif (x == -1) {\n\t\ta = 0;\n\t\tx = 0;\n\t}\n\telse {\n\t\ta = getbit(line, x);\n\t\tx ++;\n\t}\n\n\twhile (x < w) {\n\t\tb = getbit(line, x);\n\t\tif (a != b)\n\t\t\tbreak;\n\t\tx++;\n\t}\n\n\treturn x;\n}\n\nstatic int\njbig2_find_changing_element_of_color(const byte *line, int x, int w, int color)\n{\n\tif (line == 0)\n\t\treturn w;\n\tx = jbig2_find_changing_element(line, x, w);\n\tif (x < w && getbit(line, x) != color)\n\t\tx = jbig2_find_changing_element(line, x, w);\n\treturn x;\n}\n\nstatic const byte lm[8] = { 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0x01 };\nstatic const byte rm[8] = { 0x00, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE };\n\nstatic void\njbig2_set_bits(byte *line, int x0, int x1)\n{\n\tint a0, a1, b0, b1, a;\n\n\ta0 = x0 >> 3;\n\ta1 = x1 >> 3;\n\n\tb0 = x0 & 7;\n\tb1 = x1 & 7;\n\n\tif (a0 == a1) {\n\t\tline[a0] |= lm[b0] & rm[b1];\n\t}\n\telse {\n\t\tline[a0] |= lm[b0];\n\t\tfor (a = a0 + 1; a < a1; a++)\n\t\t\tline[a] = 0xFF;\n\t\tif (b1) line[a1] |= rm[b1];\n\t}\n}\n\n\nstatic int\njbig2_decode_get_code(Jbig2MmrCtx *mmr, const mmr_table_node *table, int initial_bits)\n{\n\tuint32_t word = mmr->word;\n\tint table_ix = word >> (32 - initial_bits);\n\tint val = table[table_ix].val;\n\tint n_bits = table[table_ix].n_bits;\n\n\tif (n_bits > initial_bits) {\n\t\tint mask = (1 << (32 - initial_bits)) - 1;\n\t\ttable_ix = val + ((word & mask) >> (32 - n_bits));\n\t\tval = table[table_ix].val;\n\t\tn_bits = initial_bits + table[table_ix].n_bits;\n\t}\n\n\tjbig2_decode_mmr_consume(mmr, n_bits);\n\n\treturn val;\n}\n\nstatic int\njbig2_decode_get_run(Jbig2MmrCtx *mmr, const mmr_table_node *table, int initial_bits)\n{\n\tint result = 0;\n\tint val;\n\n\tdo {\n\t\tval = jbig2_decode_get_code(mmr, table, initial_bits);\n\t\tresult += val;\n\t} while (val >= 64);\n\n\treturn result;\n}\n\nstatic int\njbig2_decode_mmr_line(Jbig2MmrCtx *mmr, const byte *ref, byte *dst)\n{\n\tint a0 = -1;\n\tint a1, a2, b1, b2;\n\tint c = 0;\t\t/* 0 is white, black is 1 */\n\n\twhile (1)\n\t{\n\t\tuint32_t word = mmr->word;\n\t\t/* printf (\"%08x\\n\", word); */\n\n\t\tif (a0 >= mmr->width)\n\t\t\tbreak;\n\n\t\tif ((word >> (32 - 3)) == 1)\n\t\t{\n\t\t\tint white_run, black_run;\n\n\t\t\tjbig2_decode_mmr_consume(mmr, 3);\n\n\t\t\tif (a0 == -1)\n\t\t\t\ta0 = 0;\n\n\t\t\tif (c == 0) {\n\t\t\t\twhite_run = jbig2_decode_get_run(mmr, jbig2_mmr_white_decode, 8);\n\t\t\t\tblack_run = jbig2_decode_get_run(mmr, jbig2_mmr_black_decode, 7);\n\t\t\t\ta1 = a0 + white_run;\n\t\t\t\ta2 = a1 + black_run;\n\t\t\t\tif (a1 > mmr->width) a1 = mmr->width;\n\t\t\t\tif (a2 > mmr->width) a2 = mmr->width;\n\t\t\t\tif (a2 < a1 || a1 < 0) return -1;\n\t\t\t\tjbig2_set_bits(dst, a1, a2);\n\t\t\t\ta0 = a2;\n\t\t\t\t/* printf (\"H %d %d\\n\", white_run, black_run); */\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tblack_run = jbig2_decode_get_run(mmr, jbig2_mmr_black_decode, 7);\n\t\t\t\twhite_run = jbig2_decode_get_run(mmr, jbig2_mmr_white_decode, 8);\n\t\t\t\ta1 = a0 + black_run;\n\t\t\t\ta2 = a1 + white_run;\n\t\t\t\tif (a1 > mmr->width) a1 = mmr->width;\n\t\t\t\tif (a2 > mmr->width) a2 = mmr->width;\n\t\t\t\tif (a1 < a0 || a0 < 0) return -1;\n\t\t\t\tjbig2_set_bits(dst, a0, a1);\n\t\t\t\ta0 = a2;\n\t\t\t\t/* printf (\"H %d %d\\n\", black_run, white_run); */\n\t\t\t}\n\t\t}\n\n\t\telse if ((word >> (32 - 4)) == 1)\n\t\t{\n\t\t\t/* printf (\"P\\n\"); */\n\t\t\tjbig2_decode_mmr_consume(mmr, 4);\n\t\t\tb1 = jbig2_find_changing_element_of_color(ref, a0, mmr->width, !c);\n\t\t\tb2 = jbig2_find_changing_element(ref, b1, mmr->width);\n\t\t\tif (c)\n\t\t\t{\n\t\t\t\tif (b2 < a0 || a0 < 0) return -1;\n\t\t\t\tjbig2_set_bits(dst, a0, b2);\n\t\t\t}\n\t\t\ta0 = b2;\n\t\t}\n\n\t\telse if ((word >> (32 - 1)) == 1)\n\t\t{\n\t\t\t/* printf (\"V(0)\\n\"); */\n\t\t\tjbig2_decode_mmr_consume(mmr, 1);\n\t\t\tb1 = jbig2_find_changing_element_of_color(ref, a0, mmr->width, !c);\n\t\t\tif (c)\n\t\t\t{\n\t\t\t\tif (b1 < a0 || a0 < 0) return -1;\n\t\t\t\tjbig2_set_bits(dst, a0, b1);\n\t\t\t}\n\t\t\ta0 = b1;\n\t\t\tc = !c;\n\t\t}\n\n\t\telse if ((word >> (32 - 3)) == 3)\n\t\t{\n\t\t\t/* printf (\"VR(1)\\n\"); */\n\t\t\tjbig2_decode_mmr_consume(mmr, 3);\n\t\t\tb1 = jbig2_find_changing_element_of_color(ref, a0, mmr->width, !c);\n\t\t\tif (b1 + 1 > mmr->width) break;\n\t\t\tif (c)\n\t\t\t{\n\t\t\t\tif (b1 + 1 < a0 || a0 < 0) return -1;\n\t\t\t\tjbig2_set_bits(dst, a0, b1 + 1);\n\t\t\t}\n\t\t\ta0 = b1 + 1;\n\t\t\tc = !c;\n\t\t}\n\n\t\telse if ((word >> (32 - 6)) == 3)\n\t\t{\n\t\t\t/* printf (\"VR(2)\\n\"); */\n\t\t\tjbig2_decode_mmr_consume(mmr, 6);\n\t\t\tb1 = jbig2_find_changing_element_of_color(ref, a0, mmr->width, !c);\n\t\t\tif (b1 + 2 > mmr->width) break;\n\t\t\tif (c)\n\t\t\t{\n\t\t\t\tif (b1 + 2 < a0 || a0 < 0) return -1;\n\t\t\t\tjbig2_set_bits(dst, a0, b1 + 2);\n\t\t\t}\n\t\t\ta0 = b1 + 2;\n\t\t\tc = !c;\n\t\t}\n\n\t\telse if ((word >> (32 - 7)) == 3)\n\t\t{\n\t\t\t/* printf (\"VR(3)\\n\"); */\n\t\t\tjbig2_decode_mmr_consume(mmr, 7);\n\t\t\tb1 = jbig2_find_changing_element_of_color(ref, a0, mmr->width, !c);\n\t\t\tif (b1 + 3 > mmr->width) break;\n\t\t\tif (c)\n\t\t\t{\n\t\t\t\tif (b1 + 3 < a0 || a0 < 0) return -1;\n\t\t\t\tjbig2_set_bits(dst, a0, b1 + 3);\n\t\t\t}\n\t\t\ta0 = b1 + 3;\n\t\t\tc = !c;\n\t\t}\n\n\t\telse if ((word >> (32 - 3)) == 2)\n\t\t{\n\t\t\t/* printf (\"VL(1)\\n\"); */\n\t\t\tjbig2_decode_mmr_consume(mmr, 3);\n\t\t\tb1 = jbig2_find_changing_element_of_color(ref, a0, mmr->width, !c);\n\t\t\tif (b1 - 1 < 0) break;\n\t\t\tif (c)\n\t\t\t{\n\t\t\t\tif (b1 - 1 < a0 || a0 < 0) return -1;\n\t\t\t\tjbig2_set_bits(dst, a0, b1 - 1);\n\t\t\t}\n\t\t\ta0 = b1 - 1;\n\t\t\tc = !c;\n\t\t}\n\n\t\telse if ((word >> (32 - 6)) == 2)\n\t\t{\n\t\t\t/* printf (\"VL(2)\\n\"); */\n\t\t\tjbig2_decode_mmr_consume(mmr, 6);\n\t\t\tb1 = jbig2_find_changing_element_of_color(ref, a0, mmr->width, !c);\n\t\t\tif (b1 - 2 < 0) break;\n\t\t\tif (c)\n\t\t\t{\n\t\t\t\tif (b1 - 2 < a0 || a0 < 0) return -1;\n\t\t\t\tjbig2_set_bits(dst, a0, b1 - 2);\n\t\t\t}\n\t\t\ta0 = b1 - 2;\n\t\t\tc = !c;\n\t\t}\n\n\t\telse if ((word >> (32 - 7)) == 2)\n\t\t{\n\t\t\t/* printf (\"VL(3)\\n\"); */\n\t\t\tjbig2_decode_mmr_consume(mmr, 7);\n\t\t\tb1 = jbig2_find_changing_element_of_color(ref, a0, mmr->width, !c);\n\t\t\tif (b1 - 3 < 0) break;\n\t\t\tif (c)\n\t\t\t{\n\t\t\t\tif (b1 - 3 < a0 || a0 < 0) return -1;\n\t\t\t\tjbig2_set_bits(dst, a0, b1 - 3);\n\t\t\t}\n\t\t\ta0 = b1 - 3;\n\t\t\tc = !c;\n\t\t}\n\n\t\telse\n\t\t\tbreak;\n\t}\n\n\treturn 0;\n}\n\nint\njbig2_decode_generic_mmr(Jbig2Ctx *ctx,\n\tJbig2Segment *segment,\n\tconst Jbig2GenericRegionParams *params,\n\tconst byte *data, size_t size,\n\tJbig2Image *image)\n{\n\tJbig2MmrCtx mmr;\n\tconst int rowstride = image->stride;\n\tbyte *dst = image->data;\n\tbyte *ref = NULL;\n\tint y;\n\tint code = 0;\n\n\tjbig2_decode_mmr_init(&mmr, image->width, image->height, data, size);\n\n\tfor (y = 0; y < image->height; y++) {\n\t\tmemset(dst, 0, rowstride);\n\t\tcode = jbig2_decode_mmr_line(&mmr, ref, dst);\n\t\tif (code < 0) return code;\n\t\tref = dst;\n\t\tdst += rowstride;\n\t}\n\n\treturn code;\n}\n\n/**\n * jbig2_decode_halftone_mmr: decode mmr region inside of halftones\n * \n * @ctx: jbig2 decoder context\n * @params: parameters for decoding  \n * @data: pointer to text region data to be decoded\n * @size: length of text region data\n * @image: return of decoded image \n * @consumed_bytes: return of consumed bytes from @data\n *\n * MMR decoding that consumes EOFB and returns consumed bytes (@consumed_bytes)\n *\n * returns: 0 \n **/\nint\njbig2_decode_halftone_mmr(Jbig2Ctx *ctx,\n\tconst Jbig2GenericRegionParams *params,\n\tconst byte *data, size_t size,\n\tJbig2Image *image, size_t* consumed_bytes)\n{\n\tJbig2MmrCtx mmr;\n\tconst int rowstride = image->stride;\n\tbyte *dst = image->data;\n\tbyte *ref = NULL;\n\tint y;\n        int code = 0;\n\tconst uint32_t EOFB = 0x001001;\n\n\tjbig2_decode_mmr_init(&mmr, image->width, image->height, data, size);\n\n\tfor (y = 0; y < image->height; y++) {\n\t\tmemset(dst, 0, rowstride);\n\t\tcode = jbig2_decode_mmr_line(&mmr, ref, dst);\n               if (code < 0) return code;\n\t\tref = dst;\n\t\tdst += rowstride;\n\t}\n\n\t/* test for EOFB (see section 6.2.6) */\n\tif (mmr.word >> 8 == EOFB) {\n\t\tmmr.data_index += 3;\n\t}\n\n\t*consumed_bytes += mmr.data_index + (mmr.bit_index >> 3) + \n                       (mmr.bit_index > 0 ? 1 : 0);\n\treturn code;\n}\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_mmr.h",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\nint\njbig2_decode_generic_mmr(Jbig2Ctx *ctx,\n\t\t\t Jbig2Segment *segment,\n\t\t\t const Jbig2GenericRegionParams *params,\n\t\t\t const byte *data, size_t size,\n\t\t\t Jbig2Image *image);\n\nint\njbig2_decode_halftone_mmr(Jbig2Ctx *ctx,\n\tconst Jbig2GenericRegionParams *params,\n\tconst byte *data, size_t size,\n\tJbig2Image *image, size_t* consumed_bytes);\n\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_page.c",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#include \"os_types.h\"\n\n#include <stdlib.h>\n\n#include \"jbig2.h\"\n#include \"jbig2_priv.h\"\n\n#ifdef OUTPUT_PBM\n#include <stdio.h>\n#include \"jbig2_image.h\"\n#endif\n\n/* dump the page struct info */\nstatic void\ndump_page_info(Jbig2Ctx *ctx, Jbig2Segment *segment, Jbig2Page *page)\n{\n    if (page->x_resolution == 0) {\n        jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,\n            \"page %d image is %dx%d (unknown res)\", page->number,\n            page->width, page->height);\n    } else if (page->x_resolution == page->y_resolution) {\n        jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,\n            \"page %d image is %dx%d (%d ppm)\", page->number,\n            page->width, page->height,\n            page->x_resolution);\n    } else {\n        jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,\n            \"page %d image is %dx%d (%dx%d ppm)\", page->number,\n            page->width, page->height,\n            page->x_resolution, page->y_resolution);\n    }\n    if (page->striped) {\n        jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,\n            \"\\tmaximum stripe size: %d\", page->stripe_size);\n    }\n}\n\n/**\n * jbig2_page_info: parse page info segment\n *\n * Parse the page info segment data and fill out a corresponding\n * Jbig2Page struct and ready it for subsequent rendered data,\n * including allocating an image buffer for the page (or the first stripe)\n **/\nint\njbig2_page_info (Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data)\n{\n    Jbig2Page *page;\n\n    /* a new page info segment implies the previous page is finished */\n    page = &(ctx->pages[ctx->current_page]);\n    if ((page->number != 0) &&\n            ((page->state == JBIG2_PAGE_NEW) || (page->state == JBIG2_PAGE_FREE))) {\n        page->state = JBIG2_PAGE_COMPLETE;\n        jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n            \"unexpected page info segment, marking previous page finished\");\n    }\n\n    /* find a free page */\n    {\n        int index, j;\n        index = ctx->current_page;\n        while (ctx->pages[index].state != JBIG2_PAGE_FREE) {\n            index++;\n            if (index >= ctx->max_page_index) {\n                /* grow the list */\n\t\tctx->pages = jbig2_renew(ctx, ctx->pages, Jbig2Page,\n                    (ctx->max_page_index <<= 2));\n                for (j=index; j < ctx->max_page_index; j++) {\n                    ctx->pages[j].state = JBIG2_PAGE_FREE;\n                    ctx->pages[j].number = 0;\n                    ctx->pages[j].image = NULL;\n\n                }\n            }\n        }\n        page = &(ctx->pages[index]);\n        ctx->current_page = index;\n        page->state = JBIG2_PAGE_NEW;\n        page->number = segment->page_association;\n    }\n\n    /* FIXME: would be nice if we tried to work around this */\n    if (segment->data_length < 19) {\n        return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"segment too short\");\n    }\n\n    /* 7.4.8.x */\n    page->width = jbig2_get_uint32(segment_data);\n    page->height = jbig2_get_uint32(segment_data + 4);\n\n    page->x_resolution = jbig2_get_uint32(segment_data + 8);\n    page->y_resolution = jbig2_get_uint32(segment_data + 12);\n    page->flags = segment_data[16];\n\n    /* 7.4.8.6 */\n    {\n        int16_t striping = jbig2_get_int16(segment_data +17);\n        if (striping & 0x8000) {\n            page->striped = TRUE;\n            page->stripe_size = striping & 0x7FFF;\n        } else {\n            page->striped = FALSE;\n            page->stripe_size = 0;\t/* would page->height be better? */\n        }\n    }\n    if (page->height == 0xFFFFFFFF && page->striped == FALSE) {\n        jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n            \"height is unspecified but page is not markes as striped\");\n        page->striped = TRUE;\n    }\n    page->end_row = 0;\n\n    if (segment->data_length > 19) {\n        jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n            \"extra data in segment\");\n    }\n\n    dump_page_info(ctx, segment, page);\n\n    /* allocate an approprate page image buffer */\n    /* 7.4.8.2 */\n    if (page->height == 0xFFFFFFFF) {\n        page->image = jbig2_image_new(ctx, page->width, page->stripe_size);\n    } else {\n        page->image = jbig2_image_new(ctx, page->width, page->height);\n    }\n    if (page->image == NULL) {\n        return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"failed to allocate buffer for page image\");\n    } else {\n\t/* 8.2 (3) fill the page with the default pixel value */\n\tjbig2_image_clear(ctx, page->image, (page->flags & 4));\n        jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n            \"allocated %dx%d page image (%d bytes)\",\n            page->image->width, page->image->height,\n            page->image->stride*page->image->height);\n    }\n\n    return 0;\n}\n\n/**\n * jbig2_end_of_stripe: parse and implement an end of stripe segment\n **/\nint\njbig2_end_of_stripe(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data)\n{\n    Jbig2Page page = ctx->pages[ctx->current_page];\n    int end_row;\n\n    end_row = jbig2_get_int32(segment_data);\n    if (end_row < page.end_row) {\n\tjbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n\t    \"end of stripe segment with non-positive end row advance\"\n\t    \" (new end row %d vs current end row %d)\",\n\t    end_row, page.end_row);\n    } else {\n\tjbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,\n\t    \"end of stripe: advancing end row to %d\", end_row);\n    }\n\n    page.end_row = end_row;\n\n    return 0;\n}\n\n/**\n * jbig2_complete_page: complete a page image\n *\n * called upon seeing an 'end of page' segment, this routine\n * marks a page as completed so it can be returned.\n * compositing will have already happened in the previous\n * segment handlers.\n **/\nint\njbig2_complete_page (Jbig2Ctx *ctx)\n{\n    int code = 0;\n\n    /* check for unfinished segments */\n    if (ctx->segment_index != ctx->n_segments) {\n      Jbig2Segment *segment = ctx->segments[ctx->segment_index];\n      /* Some versions of Xerox Workcentre generate PDF files\n         with the segment data length field of the last segment\n         set to -1. Try to cope with this here. */\n      if ((segment->data_length & 0xffffffff) == 0xffffffff) {\n        jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n          \"File has an invalid segment data length!\"\n          \" Trying to decode using the available data.\");\n        segment->data_length = ctx->buf_wr_ix - ctx->buf_rd_ix;\n        code = jbig2_parse_segment(ctx, segment, ctx->buf + ctx->buf_rd_ix);\n        ctx->buf_rd_ix += segment->data_length;\n        ctx->segment_index++;\n      }\n    }\n\n    /* ensure image exists before marking page as complete */\n    if (ctx->pages[ctx->current_page].image != NULL)\n    {\n        ctx->pages[ctx->current_page].state = JBIG2_PAGE_COMPLETE;\n    }\n\n    return code;\n}\n\n/**\n * jbig2_end_of_page: parse and implement an end of page segment\n **/\nint\njbig2_end_of_page(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data)\n{\n    uint32_t page_number = ctx->pages[ctx->current_page].number;\n\n    if (segment->page_association != page_number) {\n        jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n            \"end of page marker for page %d doesn't match current page number %d\",\n            segment->page_association, page_number);\n    }\n\n    jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,\n        \"end of page %d\", page_number);\n\n    jbig2_complete_page(ctx);\n\n#ifdef OUTPUT_PBM\n    jbig2_image_write_pbm(ctx->pages[ctx->current_page].image, stdout);\n#endif\n\n    return 0;\n}\n\n/**\n * jbig2_add_page_result: composite a decoding result onto a page\n *\n * this is called to add the results of segment decode (when it\n * is an image) to a page image buffer\n **/\nint\njbig2_page_add_result(Jbig2Ctx *ctx, Jbig2Page *page, Jbig2Image *image,\n\t\t      int x, int y, Jbig2ComposeOp op)\n{\n    /* ensure image exists first */\n    if (page->image == NULL)\n    {\n        jbig2_error(ctx, JBIG2_SEVERITY_WARNING, -1,\n            \"page info possibly missing, no image defined\");\n        return 0;\n    }\n\n    /* grow the page to accomodate a new stripe if necessary */\n    if (page->striped) {\n\tint new_height = y + image->height + page->end_row;\n\tif (page->image->height < new_height) {\n\t    jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, -1,\n\t\t\"growing page buffer to %d rows \"\n\t\t\"to accomodate new stripe\", new_height);\n\t    jbig2_image_resize(ctx, page->image,\n\t\tpage->image->width, new_height);\n\t}\n    }\n\n    jbig2_image_compose(ctx, page->image, image,\n                        x, y + page->end_row, op);\n\n    return 0;\n}\n\n/**\n * jbig2_get_page: return the next available page image buffer\n *\n * the client can call this at any time to check if any pages\n * have been decoded. If so, it returns the first available\n * one. The client should then call jbig2_release_page() when\n * it no longer needs to refer to the image buffer.\n *\n * since this is a public routine for the library clients, we\n * return an image structure pointer, even though the function\n * name refers to a page; the page structure is private.\n **/\nJbig2Image *jbig2_page_out(Jbig2Ctx *ctx)\n{\n    int index;\n\n    /* search for a completed page */\n    for (index=0; index < ctx->max_page_index; index++) {\n        if (ctx->pages[index].state == JBIG2_PAGE_COMPLETE) {\n            Jbig2Image *img = ctx->pages[index].image;\n            uint32_t page_number = ctx->pages[index].number;\n            ctx->pages[index].state = JBIG2_PAGE_RETURNED;\n            if (img != NULL) {\n                jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, -1,\n                            \"page %d returned to the client\", page_number);\n                return jbig2_image_clone(ctx, img);\n            } else {\n                jbig2_error(ctx, JBIG2_SEVERITY_WARNING, -1,\n                            \"page %d returned with no associated image\",\n                            page_number);\n                ; /* continue */\n            }\n        }\n    }\n\n    /* no pages available */\n    return NULL;\n}\n\n/**\n * jbig2_release_page: tell the library a page can be freed\n **/\nint jbig2_release_page(Jbig2Ctx *ctx, Jbig2Image *image)\n{\n    int index;\n\n    /* find the matching page struct and mark it released */\n    for (index = 0; index < ctx->max_page_index; index++) {\n        if (ctx->pages[index].image == image) {\n            jbig2_image_release(ctx, image);\n            ctx->pages[index].state = JBIG2_PAGE_RELEASED;\n            jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, -1,\n                \"page %d released by the client\", ctx->pages[index].number);\n            return 0;\n        }\n    }\n\n    /* no matching pages */\n    jbig2_error(ctx, JBIG2_SEVERITY_WARNING, -1,\n        \"jbig2_release_page called on unknown page\");\n    return 1;\n}\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_priv.h",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n/* library internals */\n\ntypedef uint8_t byte;\n\n#define bool int\n\n#ifdef __cplusplus\n#define template template_C\n#define new new_C\n#endif\n\n#ifndef TRUE\n#define TRUE 1\n#endif\n#ifndef FALSE\n#define FALSE 0\n#endif\n\n#ifndef NULL\n#define NULL ((void*)0)\n#endif\n\ntypedef enum {\n  JBIG2_FILE_HEADER,\n  JBIG2_FILE_SEQUENTIAL_HEADER,\n  JBIG2_FILE_SEQUENTIAL_BODY,\n  JBIG2_FILE_RANDOM_HEADERS,\n  JBIG2_FILE_RANDOM_BODIES,\n  JBIG2_FILE_EOF\n} Jbig2FileState;\n\nstruct _Jbig2Ctx {\n  Jbig2Allocator *allocator;\n  Jbig2Options options;\n  const Jbig2Ctx *global_ctx;\n  Jbig2ErrorCallback error_callback;\n  void *error_callback_data;\n\n  byte *buf;\n  size_t buf_size;\n  unsigned int buf_rd_ix;\n  unsigned int buf_wr_ix;\n\n  Jbig2FileState state;\n\n  uint8_t file_header_flags;\n  uint32_t n_pages;\n\n  int n_segments_max;\n  Jbig2Segment **segments;\n  int n_segments;\t/* index of last segment header parsed */\n  int segment_index;    /* index of last segment body parsed */\n\n  /* list of decoded pages, including the one in progress,\n     currently stored as a contiguous, 0-indexed array. */\n  int current_page;\n  int max_page_index;\n  Jbig2Page *pages;\n};\n\nuint32_t\njbig2_get_uint32(const byte *bptr);\n\nint32_t\njbig2_get_int32 (const byte *buf);\n\nuint16_t\njbig2_get_uint16(const byte *bptr);\n\nint16_t\njbig2_get_int16 (const byte *buf);\n\n/* dynamic memory management */\nvoid *\njbig2_alloc (Jbig2Allocator *allocator, size_t size, size_t num);\n\nvoid\njbig2_free (Jbig2Allocator *allocator, void *p);\n\nvoid *\njbig2_realloc (Jbig2Allocator *allocator, void *p, size_t size, size_t num);\n\n#define jbig2_new(ctx, t, size) ((t *)jbig2_alloc(ctx->allocator, size, sizeof(t)))\n\n#define jbig2_renew(ctx, p, t, size) ((t *)jbig2_realloc(ctx->allocator, (p), size, sizeof(t)))\n\nint\njbig2_error (Jbig2Ctx *ctx, Jbig2Severity severity, int32_t seg_idx,\n\t     const char *fmt, ...);\n\n/* the page structure handles decoded page\n   results. it's allocated by a 'page info'\n   segement and marked complete by an 'end of page'\n   segment.\n*/\ntypedef enum {\n    JBIG2_PAGE_FREE,\n    JBIG2_PAGE_NEW,\n    JBIG2_PAGE_COMPLETE,\n    JBIG2_PAGE_RETURNED,\n    JBIG2_PAGE_RELEASED\n} Jbig2PageState;\n\nstruct _Jbig2Page {\n    Jbig2PageState state;\n    uint32_t number;\n    uint32_t height, width;\t/* in pixels */\n    uint32_t x_resolution,\n             y_resolution;\t/* in pixels per meter */\n    uint16_t stripe_size;\n    bool striped;\n    int end_row;\n    uint8_t flags;\n    Jbig2Image *image;\n};\n\nint jbig2_page_info (Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data);\nint jbig2_end_of_stripe(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data);\nint jbig2_end_of_page(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data);\nint jbig2_extension_segment(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data);\n\ntypedef enum {\n    JBIG2_COMPOSE_OR = 0,\n    JBIG2_COMPOSE_AND = 1,\n    JBIG2_COMPOSE_XOR = 2,\n    JBIG2_COMPOSE_XNOR = 3,\n    JBIG2_COMPOSE_REPLACE = 4\n} Jbig2ComposeOp;\n\nint jbig2_image_compose(Jbig2Ctx *ctx, Jbig2Image *dst, Jbig2Image *src, int x, int y, Jbig2ComposeOp op);\nint jbig2_page_add_result(Jbig2Ctx *ctx, Jbig2Page *page, Jbig2Image *src, int x, int y, Jbig2ComposeOp op);\n\n/* region segment info */\n\ntypedef struct {\n  int32_t width;\n  int32_t height;\n  int32_t x;\n  int32_t y;\n  Jbig2ComposeOp op;\n  uint8_t flags;\n} Jbig2RegionSegmentInfo;\n\nvoid jbig2_get_region_segment_info(Jbig2RegionSegmentInfo *info, const uint8_t *segment_data);\nint jbig2_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const uint8_t *segment_data);\n\n/* 7.4 */\nint jbig2_immediate_generic_region(Jbig2Ctx *ctx, Jbig2Segment *segment,\n\t\t\t       const uint8_t *segment_data);\nint jbig2_refinement_region(Jbig2Ctx *ctx, Jbig2Segment *segment,\n                               const byte *segment_data);\n\nint jbig2_pattern_dictionary(Jbig2Ctx *ctx, Jbig2Segment *segment,\n                               const byte *segment_data);\nint jbig2_halftone_region(Jbig2Ctx *ctx, Jbig2Segment *segment,\n                               const byte *segment_data);\n\n\n/* The word stream design is a compromise between simplicity and\n   trying to amortize the number of method calls. Each ::get_next_word\n   invocation pulls 4 bytes from the stream, packed big-endian into a\n   32 bit word. The offset argument is provided as a convenience. It\n   begins at 0 and increments by 4 for each successive invocation. */\ntypedef struct _Jbig2WordStream Jbig2WordStream;\n\nstruct _Jbig2WordStream {\n  int (*get_next_word) (Jbig2WordStream *self, int offset, uint32_t *word);\n};\n\nJbig2WordStream *\njbig2_word_stream_buf_new(Jbig2Ctx *ctx, const byte *data, size_t size);\n\nvoid\njbig2_word_stream_buf_free(Jbig2Ctx *ctx, Jbig2WordStream *ws);\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_refinement.c",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n/**\n * Generic Refinement region handlers.\n **/\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#include \"os_types.h\"\n\n#include <stddef.h>\n#include <string.h> /* memcpy(), memset() */\n\n#include <stdio.h>\n\n#include \"jbig2.h\"\n#include \"jbig2_priv.h\"\n#include \"jbig2_arith.h\"\n#include \"jbig2_generic.h\"\n#include \"jbig2_image.h\"\n\n#if 0 /* currently not used */\nstatic int\njbig2_decode_refinement_template0(Jbig2Ctx *ctx,\n                              Jbig2Segment *segment,\n                              const Jbig2RefinementRegionParams *params,\n                              Jbig2ArithState *as,\n                              Jbig2Image *image,\n                              Jbig2ArithCx *GR_stats)\n{\n  return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n    \"refinement region template 0 NYI\");\n}\n#endif\n\nstatic int\njbig2_decode_refinement_template0_unopt(Jbig2Ctx *ctx,\n                              Jbig2Segment *segment,\n                              const Jbig2RefinementRegionParams *params,\n                              Jbig2ArithState *as,\n                              Jbig2Image *image,\n                              Jbig2ArithCx *GR_stats)\n{\n  const int GRW = image->width;\n  const int GRH = image->height;\n  const int dx = params->DX;\n  const int dy = params->DY;\n  Jbig2Image *ref = params->reference;\n  uint32_t CONTEXT;\n  int x,y;\n  bool bit;\n\n  for (y = 0; y < GRH; y++) {\n    for (x = 0; x < GRW; x++) {\n      CONTEXT = 0;\n      CONTEXT |= jbig2_image_get_pixel(image, x - 1, y + 0) << 0;\n      CONTEXT |= jbig2_image_get_pixel(image, x + 1, y - 1) << 1;\n      CONTEXT |= jbig2_image_get_pixel(image, x + 0, y - 1) << 2;\n      CONTEXT |= jbig2_image_get_pixel(image, x + params->grat[0],\n\ty + params->grat[1]) << 3;\n      CONTEXT |= jbig2_image_get_pixel(ref, x-dx+1, y-dy+1) << 4;\n      CONTEXT |= jbig2_image_get_pixel(ref, x-dx+0, y-dy+1) << 5;\n      CONTEXT |= jbig2_image_get_pixel(ref, x-dx-1, y-dy+1) << 6;\n      CONTEXT |= jbig2_image_get_pixel(ref, x-dx+1, y-dy+0) << 7;\n      CONTEXT |= jbig2_image_get_pixel(ref, x-dx+0, y-dy+0) << 8;\n      CONTEXT |= jbig2_image_get_pixel(ref, x-dx-1, y-dy+0) << 9;\n      CONTEXT |= jbig2_image_get_pixel(ref, x-dx+1, y-dy-1) << 10;\n      CONTEXT |= jbig2_image_get_pixel(ref, x-dx+0, y-dy-1) << 11;\n      CONTEXT |= jbig2_image_get_pixel(ref, x-dx+params->grat[2],\n\ty-dy+params->grat[3]) << 12;\n      bit = jbig2_arith_decode(as, &GR_stats[CONTEXT]);\n      if (bit < 0)\n        return -1;\n      jbig2_image_set_pixel(image, x, y, bit);\n    }\n  }\n#ifdef JBIG2_DEBUG_DUMP\n  {\n    static count = 0;\n    char name[32];\n    snprintf(name, 32, \"refin-%d.pbm\", count);\n    jbig2_image_write_pbm_file(ref, name);\n    snprintf(name, 32, \"refout-%d.pbm\", count);\n    jbig2_image_write_pbm_file(image, name);\n    count++;\n  }\n#endif\n\n  return 0;\n}\n\n\nstatic int\njbig2_decode_refinement_template1_unopt(Jbig2Ctx *ctx,\n                              Jbig2Segment *segment,\n                              const Jbig2RefinementRegionParams *params,\n                              Jbig2ArithState *as,\n                              Jbig2Image *image,\n                              Jbig2ArithCx *GR_stats)\n{\n  const int GRW = image->width;\n  const int GRH = image->height;\n  const int dx = params->DX;\n  const int dy = params->DY;\n  Jbig2Image *ref = params->reference;\n  uint32_t CONTEXT;\n  int x,y;\n  bool bit;\n\n  for (y = 0; y < GRH; y++) {\n    for (x = 0; x < GRW; x++) {\n      CONTEXT = 0;\n      CONTEXT |= jbig2_image_get_pixel(image, x - 1, y + 0) << 0;\n      CONTEXT |= jbig2_image_get_pixel(image, x + 1, y - 1) << 1;\n      CONTEXT |= jbig2_image_get_pixel(image, x + 0, y - 1) << 2;\n      CONTEXT |= jbig2_image_get_pixel(image, x - 1, y - 1) << 3;\n      CONTEXT |= jbig2_image_get_pixel(ref, x-dx+1, y-dy+1) << 4;\n      CONTEXT |= jbig2_image_get_pixel(ref, x-dx+0, y-dy+1) << 5;\n      CONTEXT |= jbig2_image_get_pixel(ref, x-dx+1, y-dy+0) << 6;\n      CONTEXT |= jbig2_image_get_pixel(ref, x-dx+0, y-dy+0) << 7;\n      CONTEXT |= jbig2_image_get_pixel(ref, x-dx-1, y-dy+0) << 8;\n      CONTEXT |= jbig2_image_get_pixel(ref, x-dx+0, y-dy-1) << 9;\n      bit = jbig2_arith_decode(as, &GR_stats[CONTEXT]);\n      if (bit < 0)\n        return -1;\n      jbig2_image_set_pixel(image, x, y, bit);\n    }\n  }\n\n#ifdef JBIG2_DEBUG_DUMP\n  {\n    static count = 0;\n    char name[32];\n    snprintf(name, 32, \"refin-%d.pbm\", count);\n    jbig2_image_write_pbm_file(ref, name);\n    snprintf(name, 32, \"refout-%d.pbm\", count);\n    jbig2_image_write_pbm_file(image, name);\n    count++;\n  }\n#endif\n\n  return 0;\n}\n\n#if 0 /* currently not used */\nstatic int\njbig2_decode_refinement_template1(Jbig2Ctx *ctx,\n                              Jbig2Segment *segment,\n                              const Jbig2RefinementRegionParams *params,\n                              Jbig2ArithState *as,\n                              Jbig2Image *image,\n                              Jbig2ArithCx *GR_stats)\n{\n  const int GRW = image->width;\n  const int GRH = image->height;\n  const int stride = image->stride;\n  const int refstride = params->reference->stride;\n  const int dy = params->DY;\n  byte *grreg_line = (byte *)image->data;\n  byte *grref_line = (byte *)params->reference->data;\n  int x,y;\n\n  for (y = 0; y < GRH; y++) {\n    const int padded_width = (GRW + 7) & -8;\n    uint32_t CONTEXT;\n    uint32_t refline_m1; /* previous line of the reference bitmap */\n    uint32_t refline_0;  /* current line of the reference bitmap */\n    uint32_t refline_1;  /* next line of the reference bitmap */\n    uint32_t line_m1;    /* previous line of the decoded bitmap */\n\n    line_m1 = (y >= 1) ? grreg_line[-stride] : 0;\n    refline_m1 = ((y-dy) >= 1) ? grref_line[(-1-dy)*stride] << 2: 0;\n    refline_0  = (((y-dy) > 0) && ((y-dy) < GRH)) ? grref_line[(0-dy)*stride] << 4 : 0;\n    refline_1  = (y < GRH - 1) ? grref_line[(+1-dy)*stride] << 7 : 0;\n    CONTEXT = ((line_m1 >> 5) & 0x00e) |\n\t      ((refline_1 >> 5) & 0x030) |\n\t      ((refline_0 >> 5) & 0x1c0) |\n\t      ((refline_m1 >> 5) & 0x200);\n\n    for (x = 0; x < padded_width; x += 8) {\n      byte result = 0;\n      int x_minor;\n      const int minor_width = GRW - x > 8 ? 8 : GRW - x;\n\n      if (y >= 1) {\n\tline_m1 = (line_m1 << 8) |\n\t  (x + 8 < GRW ? grreg_line[-stride + (x >> 3) + 1] : 0);\n\trefline_m1 = (refline_m1 << 8) |\n\t  (x + 8 < GRW ? grref_line[-refstride + (x >> 3) + 1] << 2 : 0);\n      }\n\n      refline_0 = (refline_0 << 8) |\n\t  (x + 8 < GRW ? grref_line[(x >> 3) + 1] << 4 : 0);\n\n      if (y < GRH - 1)\n\trefline_1 = (refline_1 << 8) |\n\t  (x + 8 < GRW ? grref_line[+refstride + (x >> 3) + 1] << 7 : 0);\n      else\n\trefline_1 = 0;\n\n      /* this is the speed critical inner-loop */\n      for (x_minor = 0; x_minor < minor_width; x_minor++) {\n\tbool bit;\n\n\tbit = jbig2_arith_decode(as, &GR_stats[CONTEXT]);\n\tif (bit < 0)\n\t  return -1;\n\tresult |= bit << (7 - x_minor);\n\tCONTEXT = ((CONTEXT & 0x0d6) << 1) | bit |\n\t  ((line_m1 >> (9 - x_minor)) & 0x002) |\n\t  ((refline_1 >> (9 - x_minor)) & 0x010) |\n\t  ((refline_0 >> (9 - x_minor)) & 0x040) |\n\t  ((refline_m1 >> (9 - x_minor)) & 0x200);\n      }\n\n      grreg_line[x>>3] = result;\n\n    }\n\n    grreg_line += stride;\n    grref_line += refstride;\n\n  }\n\n  return 0;\n\n}\n#endif\n\n\ntypedef uint32_t (*ContextBuilder)(const Jbig2RefinementRegionParams *,\nJbig2Image *, int, int);\n\nstatic int implicit_value( const Jbig2RefinementRegionParams *params, Jbig2Image\n*image, int x, int y )\n{\n  Jbig2Image *ref = params->reference;\n  int i = x - params->DX;\n  int j = y - params->DY;\n  int m = jbig2_image_get_pixel(ref, i, j);\n  return (\n          (jbig2_image_get_pixel(ref, i - 1, j - 1) == m) &&\n          (jbig2_image_get_pixel(ref, i    , j - 1) == m) &&\n          (jbig2_image_get_pixel(ref, i + 1, j - 1) == m) &&\n          (jbig2_image_get_pixel(ref, i - 1, j    ) == m) &&\n          (jbig2_image_get_pixel(ref, i + 1, j    ) == m) &&\n          (jbig2_image_get_pixel(ref, i - 1, j + 1) == m) &&\n          (jbig2_image_get_pixel(ref, i    , j + 1) == m) &&\n          (jbig2_image_get_pixel(ref, i + 1, j + 1) == m)\n         )? m : -1;\n}\n\nstatic uint32_t mkctx0( const Jbig2RefinementRegionParams *params, Jbig2Image\n*image, int x, int y )\n{\n  const int dx = params->DX;\n  const int dy = params->DY;\n  Jbig2Image *ref = params->reference;\n  uint32_t CONTEXT;\n  CONTEXT  = jbig2_image_get_pixel(image, x - 1, y + 0);\n  CONTEXT |= jbig2_image_get_pixel(image, x + 1, y - 1) << 1;\n  CONTEXT |= jbig2_image_get_pixel(image, x + 0, y - 1) << 2;\n  CONTEXT |= jbig2_image_get_pixel(image, x + params->grat[0], y +\nparams->grat[1]) << 3;\n  CONTEXT |= jbig2_image_get_pixel(ref, x - dx + 1, y - dy + 1) << 4;\n  CONTEXT |= jbig2_image_get_pixel(ref, x - dx + 0, y - dy + 1) << 5;\n  CONTEXT |= jbig2_image_get_pixel(ref, x - dx - 1, y - dy + 1) << 6;\n  CONTEXT |= jbig2_image_get_pixel(ref, x - dx + 1, y - dy + 0) << 7;\n  CONTEXT |= jbig2_image_get_pixel(ref, x - dx + 0, y - dy + 0) << 8;\n  CONTEXT |= jbig2_image_get_pixel(ref, x - dx - 1, y - dy + 0) << 9;\n  CONTEXT |= jbig2_image_get_pixel(ref, x - dx + 1, y - dy - 1) << 10;\n  CONTEXT |= jbig2_image_get_pixel(ref, x - dx + 0, y - dy - 1) << 11;\n  CONTEXT |= jbig2_image_get_pixel(ref, x - dx + params->grat[2], y - dy +\nparams->grat[3]) << 12;\n  return CONTEXT;\n}\n\nstatic uint32_t mkctx1( const Jbig2RefinementRegionParams *params, Jbig2Image\n*image, int x, int y )\n{\n  const int dx = params->DX;\n  const int dy = params->DY;\n  Jbig2Image *ref = params->reference;\n  uint32_t CONTEXT;\n  CONTEXT  = jbig2_image_get_pixel(image, x - 1, y + 0);\n  CONTEXT |= jbig2_image_get_pixel(image, x + 1, y - 1) << 1;\n  CONTEXT |= jbig2_image_get_pixel(image, x + 0, y - 1) << 2;\n  CONTEXT |= jbig2_image_get_pixel(image, x - 1, y - 1) << 3;\n  CONTEXT |= jbig2_image_get_pixel(ref, x - dx + 1, y - dy + 1) << 4;\n  CONTEXT |= jbig2_image_get_pixel(ref, x - dx + 0, y - dy + 1) << 5;\n  CONTEXT |= jbig2_image_get_pixel(ref, x - dx + 1, y - dy + 0) << 6;\n  CONTEXT |= jbig2_image_get_pixel(ref, x - dx + 0, y - dy + 0) << 7;\n  CONTEXT |= jbig2_image_get_pixel(ref, x - dx - 1, y - dy + 0) << 8;\n  CONTEXT |= jbig2_image_get_pixel(ref, x - dx + 0, y - dy - 1) << 9;\n  return CONTEXT;\n}\n\nstatic int jbig2_decode_refinement_TPGRON(const Jbig2RefinementRegionParams\n*params, Jbig2ArithState *as, Jbig2Image *image, Jbig2ArithCx *GR_stats)\n{\n  const int GRW = image->width;\n  const int GRH = image->height;\n  int x, y, iv, bit, LTP = 0;\n  uint32_t start_context = (params->GRTEMPLATE? 0x40   : 0x100);\n  ContextBuilder mkctx   = (params->GRTEMPLATE? mkctx1 : mkctx0);\n\n  for (y = 0; y < GRH; y++)\n  {\n    bit = jbig2_arith_decode(as, &GR_stats[start_context]);\n    if (bit < 0) return -1;\n    LTP = LTP ^ bit;\n    if (!LTP)\n    {\n      for (x = 0; x < GRW; x++)\n      {\n        bit = jbig2_arith_decode(as, &GR_stats[mkctx(params, image, x, y)]);\n        if (bit < 0) return -1;\n        jbig2_image_set_pixel(image, x, y, bit);\n      }\n    }\n    else\n    {\n      for (x = 0; x < GRW; x++)\n      {\n        iv = implicit_value(params, image, x, y);\n        if (iv < 0)\n        {\n          bit = jbig2_arith_decode(as, &GR_stats[mkctx(params, image, x, y)]);\n          if (bit < 0) return -1;\n          jbig2_image_set_pixel(image, x, y, bit);\n        }\n        else jbig2_image_set_pixel(image, x, y, iv);\n      }\n    }\n  }\n\n  return 0;\n}\n\n\n/**\n * jbig2_decode_refinement_region: Decode a generic refinement region.\n * @ctx: The context for allocation and error reporting.\n * @segment: A segment reference for error reporting.\n * @params: Decoding parameter set.\n * @as: Arithmetic decoder state.\n * @image: Where to store the decoded image.\n * @GR_stats: Arithmetic stats.\n *\n * Decodes a generic refinement region, according to section 6.3.\n * an already allocated Jbig2Image object in @image for the result.\n *\n * Because this API is based on an arithmetic decoding state, it is\n * not suitable for MMR decoding.\n *\n * Return code: 0 on success.\n **/\nint\njbig2_decode_refinement_region(Jbig2Ctx *ctx,\n\t\t\t    Jbig2Segment *segment,\n\t\t\t    const Jbig2RefinementRegionParams *params,\n\t\t\t    Jbig2ArithState *as,\n\t\t\t    Jbig2Image *image,\n\t\t\t    Jbig2ArithCx *GR_stats)\n{\n  {\n    jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n      \"decoding generic refinement region with offset %d,%x, GRTEMPLATE=%d, TPGRON=%d\",\n      params->DX, params->DY, params->GRTEMPLATE, params->TPGRON);\n  }\n\n  if (params->TPGRON)\n    return jbig2_decode_refinement_TPGRON(params, as, image, GR_stats);\n\n  if (params->GRTEMPLATE)\n    return jbig2_decode_refinement_template1_unopt(ctx, segment, params,\n                                             as, image, GR_stats);\n  else\n    return jbig2_decode_refinement_template0_unopt(ctx, segment, params,\n                                             as, image, GR_stats);\n}\n\n/**\n * Find the first referred-to intermediate region segment\n * with a non-NULL result for use as a reference image\n */\nJbig2Segment *\njbig2_region_find_referred(Jbig2Ctx *ctx,Jbig2Segment *segment)\n{\n  const int nsegments = segment->referred_to_segment_count;\n  Jbig2Segment *rsegment;\n  int index;\n\n  for (index = 0; index < nsegments; index++) {\n    rsegment = jbig2_find_segment(ctx,\n      segment->referred_to_segments[index]);\n    if (rsegment == NULL) {\n      jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n        \"could not find referred to segment %d\",\n        segment->referred_to_segments[index]);\n      continue;\n    }\n    switch (rsegment->flags & 63) {\n      case 4:  /* intermediate text region */\n      case 20: /* intermediate halftone region */\n      case 36: /* intermediate generic region */\n      case 40: /* intermediate generic refinement region */\n        if (rsegment->result) return rsegment;\n\tbreak;\n      default: /* keep looking */\n        break;\n    }\n  }\n  /* no appropriate reference was found. */\n  return NULL;\n}\n\n/**\n * Handler for generic refinement region segments\n */\nint\njbig2_refinement_region(Jbig2Ctx *ctx, Jbig2Segment *segment,\n                               const byte *segment_data)\n{\n  Jbig2RefinementRegionParams params;\n  Jbig2RegionSegmentInfo rsi;\n  int offset = 0;\n  byte seg_flags;\n  int code = 0;\n\n  /* 7.4.7 */\n  if (segment->data_length < 18)\n    return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                       \"Segment too short\");\n\n  jbig2_get_region_segment_info(&rsi, segment_data);\n  jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,\n              \"generic region: %d x %d @ (%d, %d), flags = %02x\",\n              rsi.width, rsi.height, rsi.x, rsi.y, rsi.flags);\n\n  /* 7.4.7.2 */\n  seg_flags = segment_data[17];\n  params.GRTEMPLATE = seg_flags & 0x01;\n  params.TPGRON = seg_flags & 0x02 ? 1 : 0;\n  jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,\n              \"segment flags = %02x %s%s\", seg_flags,\n              params.GRTEMPLATE ? \" GRTEMPLATE\" :\"\",\n              params.TPGRON ? \" TPGRON\" : \"\" );\n  if (seg_flags & 0xFC)\n    jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n                \"reserved segment flag bits are non-zero\");\n  offset += 18;\n\n  /* 7.4.7.3 */\n  if (!params.GRTEMPLATE) {\n    if (segment->data_length < 22)\n      return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                         \"Segment too short\");\n    params.grat[0] = segment_data[offset + 0];\n    params.grat[1] = segment_data[offset + 1];\n    params.grat[2] = segment_data[offset + 2];\n    params.grat[3] = segment_data[offset + 3];\n    jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,\n                   \"grat1: (%d, %d) grat2: (%d, %d)\",\n                   params.grat[0], params.grat[1],\n                   params.grat[2], params.grat[3]);\n    offset += 4;\n  }\n\n  /* 7.4.7.4 - set up the reference image */\n  if (segment->referred_to_segment_count) {\n    Jbig2Segment *ref;\n\n    ref = jbig2_region_find_referred(ctx, segment);\n    if (ref == NULL)\n      return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n        \"could not find reference bitmap!\");\n    /* the reference bitmap is the result of a previous\n       intermediate region segment; the reference selection\n       rules say to use the first one available, and not to\n       reuse any intermediate result, so we simply clone it\n       and free the original to keep track of this. */\n    params.reference = jbig2_image_clone(ctx, (Jbig2Image*)ref->result);\n    jbig2_image_release(ctx, (Jbig2Image*)ref->result);\n    ref->result = NULL;\n    jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n      \"found reference bitmap in segment %d\", ref->number);\n  } else {\n    /* the reference is just (a subset of) the page buffer */\n    params.reference = jbig2_image_clone(ctx,\n      ctx->pages[ctx->current_page].image);\n    if (params.reference == NULL)\n      return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n        \"could not clone reference bitmap!\");\n    /* TODO: subset the image if appropriate */\n  }\n\n  /* 7.4.7.5 */\n  params.DX = 0;\n  params.DY = 0;\n  {\n    Jbig2WordStream *ws = NULL;\n    Jbig2ArithState *as = NULL;\n    Jbig2ArithCx *GR_stats = NULL;\n    int stats_size;\n    Jbig2Image *image = NULL;\n\n    image = jbig2_image_new(ctx, rsi.width, rsi.height);\n    if (image == NULL)\n    {\n        code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"unable to allocate refinement image\");\n        goto cleanup;\n    }\n    jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n      \"allocated %d x %d image buffer for region decode results\",\n          rsi.width, rsi.height);\n\n    stats_size = params.GRTEMPLATE ? 1 << 10 : 1 << 13;\n    GR_stats = jbig2_new(ctx, Jbig2ArithCx, stats_size);\n    if (GR_stats == NULL)\n    {\n        code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n            \"failed to allocate GR-stats in jbig2_refinement_region\");\n        goto cleanup;\n    }\n    memset(GR_stats, 0, stats_size);\n\n    ws = jbig2_word_stream_buf_new(ctx, segment_data + offset,\n           segment->data_length - offset);\n    if (ws == NULL)\n    {\n        code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n            \"failed to allocate ws in jbig2_refinement_region\");\n        goto cleanup;\n    }\n\n    as = jbig2_arith_new(ctx, ws);\n    if (as == NULL)\n    {\n        code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n            \"failed to allocate as in jbig2_refinement_region\");\n        goto cleanup;\n    }\n\n    code = jbig2_decode_refinement_region(ctx, segment, &params,\n                              as, image, GR_stats);\n\n    if ((segment->flags & 63) == 40) {\n        /* intermediate region. save the result for later */\n        segment->result = jbig2_image_clone(ctx, image);\n    } else {\n\t/* immediate region. composite onto the page */\n        jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n            \"composing %dx%d decoded refinement region onto page at (%d, %d)\",\n            rsi.width, rsi.height, rsi.x, rsi.y);\n\tjbig2_page_add_result(ctx, &ctx->pages[ctx->current_page],\n          image, rsi.x, rsi.y, rsi.op);\n    }\n\ncleanup:\n    jbig2_image_release(ctx, image);\n    jbig2_image_release(ctx, params.reference);\n    jbig2_free(ctx->allocator, as);\n    jbig2_word_stream_buf_free(ctx, ws);\n    jbig2_free(ctx->allocator, GR_stats);\n  }\n\n  return code;\n}\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_segment.c",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#include \"os_types.h\"\n\n#include <stddef.h> /* size_t */\n\n#include \"jbig2.h\"\n#include \"jbig2_priv.h\"\n#include \"jbig2_huffman.h\"\n#include \"jbig2_symbol_dict.h\"\n#include \"jbig2_metadata.h\"\n#include \"jbig2_arith.h\"\n#include \"jbig2_halftone.h\"\n\nJbig2Segment *\njbig2_parse_segment_header (Jbig2Ctx *ctx, uint8_t *buf, size_t buf_size,\n\t\t\t    size_t *p_header_size)\n{\n  Jbig2Segment *result;\n  uint8_t rtscarf;\n  uint32_t rtscarf_long;\n  uint32_t *referred_to_segments;\n  int referred_to_segment_count;\n  int referred_to_segment_size;\n  int pa_size;\n  int offset;\n\n  /* minimum possible size of a jbig2 segment header */\n  if (buf_size < 11)\n    return NULL;\n\n  result = jbig2_new(ctx, Jbig2Segment, 1);\n  if (result == NULL)\n  {\n      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n          \"failed to allocate segment in jbig2_parse_segment_header\");\n      return result;\n  }\n\n  /* 7.2.2 */\n  result->number = jbig2_get_uint32(buf);\n\n  /* 7.2.3 */\n  result->flags = buf[4];\n\n  /* 7.2.4 referred-to segments */\n  rtscarf = buf[5];\n  if ((rtscarf & 0xe0) == 0xe0)\n    {\n      rtscarf_long = jbig2_get_uint32(buf + 5);\n      referred_to_segment_count = rtscarf_long & 0x1fffffff;\n      offset = 5 + 4 + (referred_to_segment_count + 1) / 8;\n    }\n  else\n    {\n      referred_to_segment_count = (rtscarf >> 5);\n      offset = 5 + 1;\n    }\n  result->referred_to_segment_count = referred_to_segment_count;\n\n  /* we now have enough information to compute the full header length */\n  referred_to_segment_size = result->number <= 256 ? 1:\n        result->number <= 65536 ? 2 : 4;  /* 7.2.5 */\n  pa_size = result->flags & 0x40 ? 4 : 1; /* 7.2.6 */\n  if (offset + referred_to_segment_count*referred_to_segment_size + pa_size + 4 > buf_size)\n    {\n      jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, result->number,\n        \"jbig2_parse_segment_header() called with insufficient data\", -1);\n      jbig2_free (ctx->allocator, result);\n      return NULL;\n    }\n\n  /* 7.2.5 */\n  if (referred_to_segment_count)\n    {\n      int i;\n\n      referred_to_segments = jbig2_new(ctx, uint32_t,\n        referred_to_segment_count * referred_to_segment_size);\n      if (referred_to_segments == NULL)\n      {\n          jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n              \"could not allocate referred_to_segments \"\n              \"in jbig2_parse_segment_header\");\n          return NULL;\n      }\n\n      for (i = 0; i < referred_to_segment_count; i++) {\n        referred_to_segments[i] =\n          (referred_to_segment_size == 1) ? buf[offset] :\n          (referred_to_segment_size == 2) ? jbig2_get_uint16(buf+offset) :\n            jbig2_get_uint32(buf + offset);\n        offset += referred_to_segment_size;\n        jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, result->number,\n            \"segment %d refers to segment %d\",\n            result->number, referred_to_segments[i]);\n      }\n      result->referred_to_segments = referred_to_segments;\n    }\n  else /* no referred-to segments */\n    {\n      result->referred_to_segments = NULL;\n    }\n\n  /* 7.2.6 */\n  if (result->flags & 0x40) {\n\tresult->page_association = jbig2_get_uint32(buf + offset);\n\toffset += 4;\n  } else {\n\tresult->page_association = buf[offset++];\n  }\n  jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, result->number,\n  \t\"segment %d is associated with page %d\",\n  \tresult->number, result->page_association);\n\n  /* 7.2.7 */\n  result->data_length = jbig2_get_uint32(buf + offset);\n  *p_header_size = offset + 4;\n\n  /* no body parsing results yet */\n  result->result = NULL;\n\n  return result;\n}\n\nvoid\njbig2_free_segment (Jbig2Ctx *ctx, Jbig2Segment *segment)\n{\n  if (segment->referred_to_segments != NULL) {\n    jbig2_free(ctx->allocator, segment->referred_to_segments);\n  }\n  /* todo: we need either some separate fields or\n     a more complex result object rather than this\n     brittle special casing */\n    switch (segment->flags & 63) {\n\tcase 0:  /* symbol dictionary */\n\t  if (segment->result != NULL)\n\t    jbig2_sd_release(ctx, (Jbig2SymbolDict*)segment->result);\n\t  break;\n\tcase 4:  /* intermediate text region */\n\tcase 40: /* intermediate refinement region */\n\t  if (segment->result != NULL)\n\t    jbig2_image_release(ctx, (Jbig2Image*)segment->result);\n\t  break;\n\tcase 16: /* pattern dictionary */\n      if (segment->result != NULL)\n        jbig2_hd_release(ctx, (Jbig2PatternDict*)segment->result);\n      break;\n\tcase 53: /* user-supplied huffman table */\n\t  if (segment->result != NULL)\n\t\tjbig2_table_free(ctx, (Jbig2HuffmanParams*)segment->result);\n\t  break;\n\tcase 62:\n\t  if (segment->result != NULL)\n\t    jbig2_metadata_free(ctx, (Jbig2Metadata*)segment->result);\n\t  break;\n\tdefault:\n\t  /* anything else is probably an undefined pointer */\n\t  break;\n    }\n  jbig2_free (ctx->allocator, segment);\n}\n\n/* find a segment by number */\nJbig2Segment *\njbig2_find_segment(Jbig2Ctx *ctx, uint32_t number)\n{\n    int index, index_max = ctx->segment_index - 1;\n    const Jbig2Ctx *global_ctx = ctx->global_ctx;\n\n    /* FIXME: binary search would be better */\n    for (index = index_max; index >= 0; index--)\n        if (ctx->segments[index]->number == number)\n            return (ctx->segments[index]);\n\n    if (global_ctx)\n\tfor (index = global_ctx->segment_index - 1; index >= 0; index--)\n\t    if (global_ctx->segments[index]->number == number)\n\t\treturn (global_ctx->segments[index]);\n\n    /* didn't find a match */\n    return NULL;\n}\n\n/* parse the generic portion of a region segment data header */\nvoid\njbig2_get_region_segment_info(Jbig2RegionSegmentInfo *info,\n\t\t\t      const uint8_t *segment_data)\n{\n  /* 7.4.1 */\n  info->width = jbig2_get_int32(segment_data);\n  info->height = jbig2_get_int32(segment_data + 4);\n  info->x = jbig2_get_int32(segment_data + 8);\n  info->y = jbig2_get_int32(segment_data + 12);\n  info->flags = segment_data[16];\n  info->op = (Jbig2ComposeOp)(info->flags & 0x7);\n}\n\n/* dispatch code for extension segment parsing */\nint jbig2_parse_extension_segment(Jbig2Ctx *ctx, Jbig2Segment *segment,\n                            const uint8_t *segment_data)\n{\n    uint32_t type = jbig2_get_uint32(segment_data);\n    bool reserved = type & 0x20000000;\n    /* bool dependent = type & 0x40000000; (NYI) */\n    bool necessary = type & 0x80000000;\n\n    if (necessary && !reserved) {\n        jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n            \"extension segment is marked 'necessary' but \"\n            \"not 'reservered' contrary to spec\");\n    }\n\n    switch (type) {\n        case 0x20000000: return jbig2_comment_ascii(ctx, segment, segment_data);\n        case 0x20000002: return jbig2_comment_unicode(ctx, segment, segment_data);\n        default:\n            if (necessary) {\n                return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                    \"unhandled necessary extension segment type 0x%08x\", type);\n            } else {\n                return jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n                    \"unhandled extension segment\");\n            }\n    }\n}\n\n/* general segment parsing dispatch */\nint jbig2_parse_segment (Jbig2Ctx *ctx, Jbig2Segment *segment,\n\t\t\t const uint8_t *segment_data)\n{\n  jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,\n\t      \"Segment %d, flags=%x, type=%d, data_length=%d\",\n\t      segment->number, segment->flags, segment->flags & 63,\n\t      segment->data_length);\n  switch (segment->flags & 63)\n    {\n    case 0:\n      return jbig2_symbol_dictionary(ctx, segment, segment_data);\n    case 4: /* intermediate text region */\n    case 6: /* immediate text region */\n    case 7: /* immediate lossless text region */\n      return jbig2_text_region(ctx, segment, segment_data);\n    case 16:\n      return jbig2_pattern_dictionary(ctx, segment, segment_data);\n    case 20: /* intermediate halftone region */\n    case 22: /* immediate halftone region */\n    case 23: /* immediate lossless halftone region */\n      return jbig2_halftone_region(ctx, segment, segment_data);\n    case 36:\n      return jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n        \"unhandled segment type 'intermediate generic region'\");\n    case 38: /* immediate generic region */\n    case 39: /* immediate lossless generic region */\n      return jbig2_immediate_generic_region(ctx, segment, segment_data);\n    case 40: /* intermediate generic refinement region */\n    case 42: /* immediate generic refinement region */\n    case 43: /* immediate lossless generic refinement region */\n      return jbig2_refinement_region(ctx, segment, segment_data);\n    case 48:\n      return jbig2_page_info(ctx, segment, segment_data);\n    case 49:\n      return jbig2_end_of_page(ctx, segment, segment_data);\n    case 50:\n      return jbig2_end_of_stripe(ctx, segment, segment_data);\n    case 51:\n      ctx->state = JBIG2_FILE_EOF;\n      return jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,\n        \"end of file\");\n    case 52:\n      return jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n        \"unhandled segment type 'profile'\");\n    case 53: /* user-supplied huffman table */\n      return jbig2_table(ctx, segment, segment_data);\n    case 62:\n      return jbig2_parse_extension_segment(ctx, segment, segment_data);\n    default:\n        jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n          \"unknown segment type %d\", segment->flags & 63);\n    }\n  return 0;\n}\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_symbol_dict.c",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n/* symbol dictionary segment decode and support */\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#include \"os_types.h\"\n\n#include <stddef.h>\n#include <string.h> /* memset() */\n\n#include \"jbig2.h\"\n#include \"jbig2_priv.h\"\n#include \"jbig2_arith.h\"\n#include \"jbig2_arith_int.h\"\n#include \"jbig2_arith_iaid.h\"\n#include \"jbig2_huffman.h\"\n#include \"jbig2_generic.h\"\n#include \"jbig2_mmr.h\"\n#include \"jbig2_symbol_dict.h\"\n#include \"jbig2_text.h\"\n\n#if defined(OUTPUT_PBM) || defined(DUMP_SYMDICT)\n#include <stdio.h>\n#include \"jbig2_image.h\"\n#endif\n\n/* Table 13 */\ntypedef struct {\n  bool SDHUFF;\n  bool SDREFAGG;\n  uint32_t SDNUMINSYMS;\n  Jbig2SymbolDict *SDINSYMS;\n  uint32_t SDNUMNEWSYMS;\n  uint32_t SDNUMEXSYMS;\n  Jbig2HuffmanTable *SDHUFFDH;\n  Jbig2HuffmanTable *SDHUFFDW;\n  Jbig2HuffmanTable *SDHUFFBMSIZE;\n  Jbig2HuffmanTable *SDHUFFAGGINST;\n  int SDTEMPLATE;\n  int8_t sdat[8];\n  bool SDRTEMPLATE;\n  int8_t sdrat[4];\n} Jbig2SymbolDictParams;\n\n\n/* Utility routines */\n\n#ifdef DUMP_SYMDICT\nvoid\njbig2_dump_symbol_dict(Jbig2Ctx *ctx, Jbig2Segment *segment)\n{\n    Jbig2SymbolDict *dict = (Jbig2SymbolDict *)segment->result;\n    int index;\n    char filename[24];\n\n    if (dict == NULL) return;\n    jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,\n        \"dumping symbol dict as %d individual png files\\n\", dict->n_symbols);\n    for (index = 0; index < dict->n_symbols; index++) {\n        snprintf(filename, sizeof(filename), \"symbol_%02d-%04d.png\",\n\t\tsegment->number, index);\n\tjbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n\t  \"dumping symbol %d/%d as '%s'\", index, dict->n_symbols, filename);\n#ifdef HAVE_LIBPNG\n        jbig2_image_write_png_file(dict->glyphs[index], filename);\n#else\n        jbig2_image_write_pbm_file(dict->glyphs[index], filename);\n#endif\n    }\n}\n#endif /* DUMP_SYMDICT */\n\n/* return a new empty symbol dict */\nJbig2SymbolDict *\njbig2_sd_new(Jbig2Ctx *ctx, int n_symbols)\n{\n   Jbig2SymbolDict *new = NULL;\n\n   if (n_symbols < 0) {\n     jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n         \"Negative number of symbols in symbol dict: %d\", n_symbols);\n     return NULL;\n   }\n\n   new = jbig2_new(ctx, Jbig2SymbolDict, 1);\n   if (new != NULL) {\n     new->glyphs = jbig2_new(ctx, Jbig2Image*, n_symbols);\n     new->n_symbols = n_symbols;\n   } else {\n     jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n         \"unable to allocate new empty symbol dict\");\n     return NULL;\n   }\n\n   if (new->glyphs != NULL) {\n     memset(new->glyphs, 0, n_symbols*sizeof(Jbig2Image*));\n   } else {\n     jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n         \"unable to allocate glyphs for new empty symbol dict\");\n     jbig2_free(ctx->allocator, new);\n     return NULL;\n   }\n\n   return new;\n}\n\n/* release the memory associated with a symbol dict */\nvoid\njbig2_sd_release(Jbig2Ctx *ctx, Jbig2SymbolDict *dict)\n{\n   int i;\n\n   if (dict == NULL) return;\n   for (i = 0; i < dict->n_symbols; i++)\n     if (dict->glyphs[i]) jbig2_image_release(ctx, dict->glyphs[i]);\n   jbig2_free(ctx->allocator, dict->glyphs);\n   jbig2_free(ctx->allocator, dict);\n}\n\n/* get a particular glyph by index */\nJbig2Image *\njbig2_sd_glyph(Jbig2SymbolDict *dict, unsigned int id)\n{\n   if (dict == NULL) return NULL;\n   return dict->glyphs[id];\n}\n\n/* count the number of dictionary segments referred to by the given segment */\nint\njbig2_sd_count_referred(Jbig2Ctx *ctx, Jbig2Segment *segment)\n{\n    int index;\n    Jbig2Segment *rsegment;\n    int n_dicts = 0;\n\n    for (index = 0; index < segment->referred_to_segment_count; index++) {\n        rsegment = jbig2_find_segment(ctx, segment->referred_to_segments[index]);\n        if (rsegment && ((rsegment->flags & 63) == 0) &&\n            rsegment->result &&\n            (((Jbig2SymbolDict *)rsegment->result)->n_symbols > 0) &&\n            ((*((Jbig2SymbolDict *)rsegment->result)->glyphs) != NULL))\n            n_dicts++;\n    }\n\n    return (n_dicts);\n}\n\n/* return an array of pointers to symbol dictionaries referred to by the given segment */\nJbig2SymbolDict **\njbig2_sd_list_referred(Jbig2Ctx *ctx, Jbig2Segment *segment)\n{\n    int index;\n    Jbig2Segment *rsegment;\n    Jbig2SymbolDict **dicts;\n    int n_dicts = jbig2_sd_count_referred(ctx, segment);\n    int dindex = 0;\n\n    dicts = jbig2_new(ctx, Jbig2SymbolDict*, n_dicts);\n    if (dicts == NULL)\n    {\n        jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"failed to allocate referred list of symbol dictionaries\");\n        return NULL;\n    }\n\n    for (index = 0; index < segment->referred_to_segment_count; index++) {\n        rsegment = jbig2_find_segment(ctx, segment->referred_to_segments[index]);\n        if (rsegment && ((rsegment->flags & 63) == 0) && rsegment->result &&\n            (((Jbig2SymbolDict *)rsegment->result)->n_symbols > 0) &&\n            ((*((Jbig2SymbolDict *)rsegment->result)->glyphs) != NULL)) {\n            /* add this referred to symbol dictionary */\n            dicts[dindex++] = (Jbig2SymbolDict *)rsegment->result;\n        }\n    }\n\n    if (dindex != n_dicts) {\n        /* should never happen */\n        jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"counted %d symbol dictionaries but built a list with %d.\\n\",\n            n_dicts, dindex);\n    }\n\n    return (dicts);\n}\n\n/* generate a new symbol dictionary by concatenating a list of\n   existing dictionaries */\nJbig2SymbolDict *\njbig2_sd_cat(Jbig2Ctx *ctx, int n_dicts, Jbig2SymbolDict **dicts)\n{\n  int i,j,k, symbols;\n  Jbig2SymbolDict *new = NULL;\n\n  /* count the imported symbols and allocate a new array */\n  symbols = 0;\n  for(i = 0; i < n_dicts; i++)\n    symbols += dicts[i]->n_symbols;\n\n  /* fill a new array with cloned glyph pointers */\n  new = jbig2_sd_new(ctx, symbols);\n  if (new != NULL) {\n    k = 0;\n    for (i = 0; i < n_dicts; i++)\n      for (j = 0; j < dicts[i]->n_symbols; j++)\n        new->glyphs[k++] = jbig2_image_clone(ctx, dicts[i]->glyphs[j]);\n  } else {\n    jbig2_error(ctx, JBIG2_SEVERITY_WARNING, -1,\n        \"failed to allocate new symbol dictionary\");\n  }\n\n  return new;\n}\n\n\n/* Decoding routines */\n\n/* 6.5 */\nstatic Jbig2SymbolDict *\njbig2_decode_symbol_dict(Jbig2Ctx *ctx,\n\t\t\t Jbig2Segment *segment,\n\t\t\t const Jbig2SymbolDictParams *params,\n\t\t\t const byte *data, size_t size,\n\t\t\t Jbig2ArithCx *GB_stats,\n\t\t\t Jbig2ArithCx *GR_stats)\n{\n  Jbig2SymbolDict *SDNEWSYMS = NULL;\n  Jbig2SymbolDict *SDEXSYMS = NULL;\n  uint32_t HCHEIGHT;\n  uint32_t NSYMSDECODED;\n  uint32_t SYMWIDTH, TOTWIDTH;\n  uint32_t HCFIRSTSYM;\n  uint32_t *SDNEWSYMWIDTHS = NULL;\n  int SBSYMCODELEN = 0;\n  Jbig2WordStream *ws = NULL;\n  Jbig2HuffmanState *hs = NULL;\n  Jbig2HuffmanTable *SDHUFFRDX = NULL;\n  Jbig2HuffmanTable *SBHUFFRSIZE = NULL;\n  Jbig2ArithState *as = NULL;\n  Jbig2ArithIntCtx *IADH = NULL;\n  Jbig2ArithIntCtx *IADW = NULL;\n  Jbig2ArithIntCtx *IAEX = NULL;\n  Jbig2ArithIntCtx *IAAI = NULL;\n  Jbig2ArithIaidCtx *IAID = NULL;\n  Jbig2ArithIntCtx *IARDX = NULL;\n  Jbig2ArithIntCtx *IARDY = NULL;\n  int code = 0;\n  Jbig2SymbolDict **refagg_dicts = NULL;\n  int n_refagg_dicts = 1;\n\n  Jbig2TextRegionParams *tparams = NULL;\n\n  /* 6.5.5 (3) */\n  HCHEIGHT = 0;\n  NSYMSDECODED = 0;\n\n  ws = jbig2_word_stream_buf_new(ctx, data, size);\n  if (ws == NULL)\n  {\n      jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n          \"failed to allocate ws in jbig2_decode_symbol_dict\");\n      return NULL;\n  }\n\n  as = jbig2_arith_new(ctx, ws);\n  if (as == NULL)\n  {\n      jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n          \"failed to allocate as in jbig2_decode_symbol_dict\");\n      jbig2_word_stream_buf_free(ctx, ws);\n      return NULL;\n  }\n\n  if (!params->SDHUFF) {\n      IADH = jbig2_arith_int_ctx_new(ctx);\n      IADW = jbig2_arith_int_ctx_new(ctx);\n      IAEX = jbig2_arith_int_ctx_new(ctx);\n      IAAI = jbig2_arith_int_ctx_new(ctx);\n      if ((IADH == NULL) || (IADW == NULL) || (IAEX == NULL) || (IAAI == NULL))\n      {\n          jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n              \"failed to allocate storage for symbol bitmap\");\n          goto cleanup1;\n      }\n      if (params->SDREFAGG) {\n          int64_t tmp = params->SDNUMINSYMS + params->SDNUMNEWSYMS;\n          for (SBSYMCODELEN = 0; ((int64_t)1 << SBSYMCODELEN) < tmp; SBSYMCODELEN++);\n          IAID = jbig2_arith_iaid_ctx_new(ctx, SBSYMCODELEN);\n          IARDX = jbig2_arith_int_ctx_new(ctx);\n          IARDY = jbig2_arith_int_ctx_new(ctx);\n          if ((IAID == NULL) || (IARDX == NULL) || (IARDY == NULL))\n          {\n              jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n                  \"failed to allocate storage for symbol bitmap\");\n              goto cleanup2;\n          }\n      }\n  } else {\n      jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n          \"huffman coded symbol dictionary\");\n      hs = jbig2_huffman_new(ctx, ws);\n      SDHUFFRDX = jbig2_build_huffman_table(ctx, &jbig2_huffman_params_O);\n      SBHUFFRSIZE = jbig2_build_huffman_table(ctx, &jbig2_huffman_params_A);\n      if ( (hs == NULL) || (SDHUFFRDX == NULL) || (SBHUFFRSIZE == NULL))\n      {\n          jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n              \"failed to allocate storage for symbol bitmap\");\n          goto cleanup2;\n      }\n      if (!params->SDREFAGG) {\n\t  SDNEWSYMWIDTHS = jbig2_new(ctx, uint32_t, params->SDNUMNEWSYMS);\n\t  if (SDNEWSYMWIDTHS == NULL) {\n\t    jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n              \"could not allocate storage for (%u) symbol widths\",\n              params->SDNUMNEWSYMS);\n\t    goto cleanup2;\n\t  }\n      }\n  }\n\n  SDNEWSYMS = jbig2_sd_new(ctx, params->SDNUMNEWSYMS);\n  if (SDNEWSYMS == NULL) {\n      jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n          \"could not allocate storage for (%u) new symbols\",\n          params->SDNUMNEWSYMS);\n      goto cleanup2;\n  }\n\n  /* 6.5.5 (4a) */\n  while (NSYMSDECODED < params->SDNUMNEWSYMS) {\n      int32_t HCDH, DW;\n\n      /* 6.5.6 */\n      if (params->SDHUFF) {\n\t  HCDH = jbig2_huffman_get(hs, params->SDHUFFDH, &code);\n      } else {\n\t  code = jbig2_arith_int_decode(IADH, as, &HCDH);\n      }\n\n      if (code != 0) {\n\tjbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n\t  \"error or OOB decoding height class delta (%d)\\n\", code);\n      }\n\n      if (!params->SDHUFF && jbig2_arith_has_reached_marker(as)) {\n          code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n              \"prevent DOS while decoding height classes\");\n          goto cleanup2;\n      }\n\n      /* 6.5.5 (4b) */\n      HCHEIGHT = HCHEIGHT + HCDH;\n      SYMWIDTH = 0;\n      TOTWIDTH = 0;\n      HCFIRSTSYM = NSYMSDECODED;\n\n      if ((int32_t)HCHEIGHT < 0) {\n          code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n              \"Invalid HCHEIGHT value\");\n          goto cleanup2;\n      }\n#ifdef JBIG2_DEBUG\n      jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n        \"HCHEIGHT = %d\", HCHEIGHT);\n#endif\n      jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n        \"decoding height class %d with %d syms decoded\", HCHEIGHT, NSYMSDECODED);\n\n      for (;;) {\n\t  /* 6.5.7 */\n\t  if (params->SDHUFF) {\n\t      DW = jbig2_huffman_get(hs, params->SDHUFFDW, &code);\n\t  } else {\n\t      code = jbig2_arith_int_decode(IADW, as, &DW);\n\t  }\n          if (code < 0) goto cleanup4;\n\n\t  /* 6.5.5 (4c.i) */\n\t  if (code == 1) {\n\t    jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n\t    \" OOB signals end of height class %d\", HCHEIGHT);\n\t    break;\n\t  }\n\n\t  /* check for broken symbol table */\n          if (NSYMSDECODED >= params->SDNUMNEWSYMS)\n          {\n              jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                  \"No OOB signalling end of height class %d\", HCHEIGHT);\n              goto cleanup4;\n          }\n\n\t  SYMWIDTH = SYMWIDTH + DW;\n\t  TOTWIDTH = TOTWIDTH + SYMWIDTH;\n\t  if ((int32_t)SYMWIDTH < 0) {\n          code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n              \"Invalid SYMWIDTH value (%d) at symbol %d\", SYMWIDTH, NSYMSDECODED+1);\n          goto cleanup4;\n      }\n#ifdef JBIG2_DEBUG\n\t  jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n            \"SYMWIDTH = %d TOTWIDTH = %d\", SYMWIDTH, TOTWIDTH);\n#endif\n\t  /* 6.5.5 (4c.ii) */\n\t  if (!params->SDHUFF || params->SDREFAGG) {\n#ifdef JBIG2_DEBUG\n\t\tjbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n\t\t  \"SDHUFF = %d; SDREFAGG = %d\", params->SDHUFF, params->SDREFAGG);\n#endif\n\t      /* 6.5.8 */\n\t      if (!params->SDREFAGG) {\n\t\t  Jbig2GenericRegionParams region_params;\n\t\t  int sdat_bytes;\n\t\t  Jbig2Image *image;\n\n\t\t  /* Table 16 */\n\t\t  region_params.MMR = 0;\n\t\t  region_params.GBTEMPLATE = params->SDTEMPLATE;\n\t\t  region_params.TPGDON = 0;\n\t\t  region_params.USESKIP = 0;\n\t\t  sdat_bytes = params->SDTEMPLATE == 0 ? 8 : 2;\n\t\t  memcpy(region_params.gbat, params->sdat, sdat_bytes);\n\n\t\t  image = jbig2_image_new(ctx, SYMWIDTH, HCHEIGHT);\n          if (image == NULL)\n          {\n              code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                  \"failed to allocate image in jbig2_decode_symbol_dict\");\n              goto cleanup4;\n          }\n\n\t\t  code = jbig2_decode_generic_region(ctx, segment, &region_params,\n              as, image, GB_stats);\n          if (code < 0) {\n              jbig2_image_release(ctx, image);\n              goto cleanup4;\n          }\n\n          SDNEWSYMS->glyphs[NSYMSDECODED] = image;\n\t      } else {\n          /* 6.5.8.2 refinement/aggregate symbol */\n          uint32_t REFAGGNINST;\n\n\t\t  if (params->SDHUFF) {\n\t\t      REFAGGNINST = jbig2_huffman_get(hs, params->SDHUFFAGGINST, &code);\n\t\t  } else {\n\t\t      code = jbig2_arith_int_decode(IAAI, as, (int32_t*)&REFAGGNINST);\n\t\t  }\n\t\t  if (code || (int32_t)REFAGGNINST <= 0) {\n\t\t      code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                  \"invalid number of symbols or OOB in aggregate glyph\");\n\t\t      goto cleanup4;\n\t\t  }\n\n\t\t  jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n\t\t    \"aggregate symbol coding (%d instances)\", REFAGGNINST);\n\n\t\t  if (REFAGGNINST > 1) {\n\t\t      Jbig2Image *image;\n\t\t      int i;\n\n\t\t      if (tparams == NULL)\n\t\t      {\n\t\t\t  /* First time through, we need to initialise the */\n\t\t\t  /* various tables for Huffman or adaptive encoding */\n\t\t\t  /* as well as the text region parameters structure */\n\t\t\t  refagg_dicts = jbig2_new(ctx, Jbig2SymbolDict*, n_refagg_dicts);\n\t\t          if (refagg_dicts == NULL) {\n\t\t\t      code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n\t\t\t       \"Out of memory allocating dictionary array\");\n\t\t              goto cleanup4;\n\t\t          }\n\t\t          refagg_dicts[0] = jbig2_sd_new(ctx, params->SDNUMINSYMS + params->SDNUMNEWSYMS);\n\t\t          if (refagg_dicts[0] == NULL) {\n\t\t\t      code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n\t\t\t       \"Out of memory allocating symbol dictionary\");\n\t\t              jbig2_free(ctx->allocator, refagg_dicts);\n\t\t              goto cleanup4;\n\t\t          }\n\t\t          for (i=0;i < params->SDNUMINSYMS;i++)\n\t\t          {\n\t\t\t      refagg_dicts[0]->glyphs[i] = jbig2_image_clone(ctx, params->SDINSYMS->glyphs[i]);\n\t\t          }\n\n\t\t\t  tparams = jbig2_new(ctx, Jbig2TextRegionParams, 1);\n\t\t\t  if (tparams == NULL) {\n\t\t\t      code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n\t\t\t      \"Out of memory creating text region params\");\n\t\t\t      goto cleanup4;\n\t\t\t  }\n              if (!params->SDHUFF) {\n\t\t\t      /* Values from Table 17, section 6.5.8.2 (2) */\n\t\t\t      tparams->IADT = jbig2_arith_int_ctx_new(ctx);\n\t\t\t      tparams->IAFS = jbig2_arith_int_ctx_new(ctx);\n\t\t\t      tparams->IADS = jbig2_arith_int_ctx_new(ctx);\n\t\t\t      tparams->IAIT = jbig2_arith_int_ctx_new(ctx);\n\t\t\t      /* Table 31 */\n\t\t\t      for (SBSYMCODELEN = 0; (1 << SBSYMCODELEN) <\n\t\t\t\t  (int)(params->SDNUMINSYMS + params->SDNUMNEWSYMS); SBSYMCODELEN++);\n\t\t\t      tparams->IAID = jbig2_arith_iaid_ctx_new(ctx, SBSYMCODELEN);\n\t\t\t      tparams->IARI = jbig2_arith_int_ctx_new(ctx);\n\t\t\t      tparams->IARDW = jbig2_arith_int_ctx_new(ctx);\n\t\t\t      tparams->IARDH = jbig2_arith_int_ctx_new(ctx);\n\t\t\t      tparams->IARDX = jbig2_arith_int_ctx_new(ctx);\n\t\t\t      tparams->IARDY = jbig2_arith_int_ctx_new(ctx);\n\t\t\t  } else {\n\t\t\t      tparams->SBHUFFFS = jbig2_build_huffman_table(ctx,\n\t\t\t\t&jbig2_huffman_params_F);   /* Table B.6 */\n\t\t\t      tparams->SBHUFFDS = jbig2_build_huffman_table(ctx,\n\t\t\t\t&jbig2_huffman_params_H);  /* Table B.8 */\n\t\t\t      tparams->SBHUFFDT = jbig2_build_huffman_table(ctx,\n\t\t\t\t&jbig2_huffman_params_K);  /* Table B.11 */\n\t\t\t      tparams->SBHUFFRDW = jbig2_build_huffman_table(ctx,\n\t\t\t\t&jbig2_huffman_params_O); /* Table B.15 */\n\t\t\t      tparams->SBHUFFRDH = jbig2_build_huffman_table(ctx,\n\t\t\t\t&jbig2_huffman_params_O); /* Table B.15 */\n\t\t\t      tparams->SBHUFFRDX = jbig2_build_huffman_table(ctx,\n\t\t\t\t&jbig2_huffman_params_O); /* Table B.15 */\n\t\t\t      tparams->SBHUFFRDY = jbig2_build_huffman_table(ctx,\n\t\t\t\t&jbig2_huffman_params_O); /* Table B.15 */\n\t\t\t  }\n\t\t\t  tparams->SBHUFF = params->SDHUFF;\n\t\t\t  tparams->SBREFINE = 1;\n\t\t\t  tparams->SBSTRIPS = 1;\n\t\t\t  tparams->SBDEFPIXEL = 0;\n\t\t\t  tparams->SBCOMBOP = JBIG2_COMPOSE_OR;\n\t\t\t  tparams->TRANSPOSED = 0;\n\t\t\t  tparams->REFCORNER = JBIG2_CORNER_TOPLEFT;\n\t\t\t  tparams->SBDSOFFSET = 0;\n\t\t\t  tparams->SBRTEMPLATE = params->SDRTEMPLATE;\n\t\t      }\n\t\t      tparams->SBNUMINSTANCES = REFAGGNINST;\n\n              image = jbig2_image_new(ctx, SYMWIDTH, HCHEIGHT);\n\t\t      if (image == NULL) {\n                  code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                      \"Out of memory creating symbol image\");\n                  goto cleanup4;\n\t\t      }\n\n\t\t      /* multiple symbols are handled as a text region */\n\t\t      jbig2_decode_text_region(ctx, segment, tparams, (const Jbig2SymbolDict * const *)refagg_dicts,\n\t\t\t  n_refagg_dicts, image, data, size, GR_stats, as, ws);\n\n\t\t      SDNEWSYMS->glyphs[NSYMSDECODED] = image;\n\t\t      refagg_dicts[0]->glyphs[params->SDNUMINSYMS + NSYMSDECODED] = jbig2_image_clone(ctx, SDNEWSYMS->glyphs[NSYMSDECODED]);\n\t\t  } else {\n\t\t      /* 6.5.8.2.2 */\n\t\t      /* bool SBHUFF = params->SDHUFF; */\n\t\t      Jbig2RefinementRegionParams rparams;\n\t\t      Jbig2Image *image;\n\t\t      uint32_t ID;\n\t\t      int32_t RDX, RDY;\n\t\t      int BMSIZE = 0;\n\t\t      int ninsyms = params->SDNUMINSYMS;\n\t\t      int code1 = 0;\n\t\t      int code2 = 0;\n\t\t      int code3 = 0;\n\t\t      int code4 = 0;\n\n\t\t      /* 6.5.8.2.2 (2, 3, 4, 5) */\n\t\t      if (params->SDHUFF) {\n\t\t          ID = jbig2_huffman_get_bits(hs, SBSYMCODELEN, &code4);\n\t\t          RDX = jbig2_huffman_get(hs, SDHUFFRDX, &code1);\n\t\t          RDY = jbig2_huffman_get(hs, SDHUFFRDX, &code2);\n\t\t          BMSIZE = jbig2_huffman_get(hs, SBHUFFRSIZE, &code3);\n\t\t          jbig2_huffman_skip(hs);\n\t\t      } else {\n\t\t          code1 = jbig2_arith_iaid_decode(IAID, as, (int32_t*)&ID);\n\t\t          code2 = jbig2_arith_int_decode(IARDX, as, &RDX);\n\t\t          code3 = jbig2_arith_int_decode(IARDY, as, &RDY);\n\t\t      }\n\n\t\t      if ((code1 < 0) || (code2 < 0) || (code3 < 0) || (code4 < 0))\n\t\t      {\n\t\t          code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL,\n\t\t              segment->number, \"failed to decode data\");\n\t\t          goto cleanup4;\n\t\t      }\n\n\t\t      if (ID >= ninsyms+NSYMSDECODED) {\n                  code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                      \"refinement references unknown symbol %d\", ID);\n                  goto cleanup4;\n\t\t      }\n\n\t\t      jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n                  \"symbol is a refinement of id %d with the \"\n                  \"refinement applied at (%d,%d)\", ID, RDX, RDY);\n\n\t\t      image = jbig2_image_new(ctx, SYMWIDTH, HCHEIGHT);\n              if (image == NULL) {\n                  code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                      \"Out of memory creating symbol image\");\n                  goto cleanup4;\n              }\n\n\t\t      /* Table 18 */\n\t\t      rparams.GRTEMPLATE = params->SDRTEMPLATE;\n\t\t      rparams.reference = (ID < ninsyms) ?\n\t\t\t\t\tparams->SDINSYMS->glyphs[ID] :\n\t\t\t\t\tSDNEWSYMS->glyphs[ID-ninsyms];\n\t\t      /* SumatraPDF: fail on missing glyphs */\n\t\t      if (rparams.reference == NULL) {\n\t\t          code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n\t\t              \"missing glyph %d/%d!\", ID, ninsyms);\n\t\t          jbig2_image_release(ctx, image);\n\t\t          goto cleanup4;\n\t\t      }\n\t\t      rparams.DX = RDX;\n\t\t      rparams.DY = RDY;\n\t\t      rparams.TPGRON = 0;\n\t\t      memcpy(rparams.grat, params->sdrat, 4);\n\t\t      code = jbig2_decode_refinement_region(ctx, segment,\n\t\t          &rparams, as, image, GR_stats);\n\t\t\t  if (code < 0) goto cleanup4;\n\n\t\t      SDNEWSYMS->glyphs[NSYMSDECODED] = image;\n\n\t\t      /* 6.5.8.2.2 (7) */\n\t\t      if (params->SDHUFF) {\n\t\t          if (BMSIZE == 0) BMSIZE = image->height * image->stride;\n\t\t          jbig2_huffman_advance(hs, BMSIZE);\n\t\t      }\n\t\t  }\n               }\n\n#ifdef OUTPUT_PBM\n\t\t  {\n\t\t    char name[64];\n\t\t    FILE *out;\n\t\t    snprintf(name, 64, \"sd.%04d.%04d.pbm\",\n\t\t             segment->number, NSYMSDECODED);\n\t\t    out = fopen(name, \"wb\");\n                    jbig2_image_write_pbm(SDNEWSYMS->glyphs[NSYMSDECODED], out);\n\t\t    jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n\t\t\t\"writing out glyph as '%s' ...\", name);\n\t\t    fclose(out);\n\t\t  }\n#endif\n\n\t  }\n\n\t  /* 6.5.5 (4c.iii) */\n\t  if (params->SDHUFF && !params->SDREFAGG) {\n\t    SDNEWSYMWIDTHS[NSYMSDECODED] = SYMWIDTH;\n\t  }\n\n          /* 6.5.5 (4c.iv) */\n          NSYMSDECODED = NSYMSDECODED + 1;\n\n\t  jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n            \"decoded symbol %u of %u (%ux%u)\",\n\t\tNSYMSDECODED, params->SDNUMNEWSYMS,\n\t\tSYMWIDTH, HCHEIGHT);\n\n      } /* end height class decode loop */\n\n      /* 6.5.5 (4d) */\n      if (params->SDHUFF && !params->SDREFAGG) {\n\t/* 6.5.9 */\n\tJbig2Image *image;\n\tint BMSIZE = jbig2_huffman_get(hs, params->SDHUFFBMSIZE, &code);\n\tint j, x;\n\n\tif (code || (BMSIZE < 0)) {\n\t  jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n\t    \"error decoding size of collective bitmap!\");\n\t  goto cleanup4;\n\t}\n\n\t/* skip any bits before the next byte boundary */\n\tjbig2_huffman_skip(hs);\n\n\timage = jbig2_image_new(ctx, TOTWIDTH, HCHEIGHT);\n\tif (image == NULL) {\n\t  jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n\t    \"could not allocate collective bitmap image!\");\n\t  goto cleanup4;\n\t}\n\n\tif (BMSIZE == 0) {\n\t  /* if BMSIZE == 0 bitmap is uncompressed */\n\t  const byte *src = data + jbig2_huffman_offset(hs);\n\t  const int stride = (image->width >> 3) +\n\t\t((image->width & 7) ? 1 : 0);\n\t  byte *dst = image->data;\n\n\t  /* SumatraPDF: prevent read access violation */\n\t  if (size - jbig2_huffman_offset(hs) < image->height * stride) {\n\t    jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number, \"not enough data for decoding (%d/%d)\", image->height * stride, size - jbig2_huffman_offset(hs));\n\t    jbig2_image_release(ctx, image);\n\t    goto cleanup4;\n\t  }\n\n\t  BMSIZE = image->height * stride;\n\t  jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n\t    \"reading %dx%d uncompressed bitmap\"\n\t    \" for %d symbols (%d bytes)\",\n\t    image->width, image->height, NSYMSDECODED - HCFIRSTSYM, BMSIZE);\n\n\t  for (j = 0; j < image->height; j++) {\n\t    memcpy(dst, src, stride);\n\t    dst += image->stride;\n\t    src += stride;\n\t  }\n\t} else {\n\t  Jbig2GenericRegionParams rparams;\n\n\t  /* SumatraPDF: prevent read access violation */\n\t  if (size - jbig2_huffman_offset(hs) < BMSIZE) {\n\t    jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number, \"not enough data for decoding (%d/%d)\", BMSIZE, size - jbig2_huffman_offset(hs));\n\t    jbig2_image_release(ctx, image);\n\t    goto cleanup4;\n\t  }\n\n\t  jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n\t    \"reading %dx%d collective bitmap for %d symbols (%d bytes)\",\n\t    image->width, image->height, NSYMSDECODED - HCFIRSTSYM, BMSIZE);\n\n\t  rparams.MMR = 1;\n\t  code = jbig2_decode_generic_mmr(ctx, segment, &rparams,\n\t    data + jbig2_huffman_offset(hs), BMSIZE, image);\n\t  if (code) {\n\t    jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n\t      \"error decoding MMR bitmap image!\");\n\t    jbig2_image_release(ctx, image);\n\t    goto cleanup4;\n\t  }\n\t}\n\n\t/* advance past the data we've just read */\n\tjbig2_huffman_advance(hs, BMSIZE);\n\n\t/* copy the collective bitmap into the symbol dictionary */\n\tx = 0;\n\tfor (j = HCFIRSTSYM; j < NSYMSDECODED; j++) {\n\t  Jbig2Image *glyph;\n\t  glyph = jbig2_image_new(ctx, SDNEWSYMWIDTHS[j], HCHEIGHT);\n      if (glyph == NULL)\n      {\n          jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n              \"failed to copy the collective bitmap into symbol dictionary\");\n          jbig2_image_release(ctx, image);\n          goto cleanup4;\n      }\n\t  jbig2_image_compose(ctx, glyph, image, -x, 0, JBIG2_COMPOSE_REPLACE);\n\t  x += SDNEWSYMWIDTHS[j];\n\t  SDNEWSYMS->glyphs[j] = glyph;\n\t}\n\tjbig2_image_release(ctx, image);\n      }\n\n  } /* end of symbol decode loop */\n\n  /* 6.5.10 */\n  SDEXSYMS = jbig2_sd_new(ctx, params->SDNUMEXSYMS);\n  if (SDEXSYMS == NULL)\n  {\n      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n          \"failed to allocate symbols exported from symbols dictionary\");\n      goto cleanup4;\n  }\n  else\n  {\n    int i = 0;\n    int j = 0;\n    int k;\n    int exflag = 0;\n    int64_t limit = params->SDNUMINSYMS + params->SDNUMNEWSYMS;\n    int32_t exrunlength;\n    int zerolength = 0;\n\n    while (i < limit) {\n      if (params->SDHUFF)\n        exrunlength = jbig2_huffman_get(hs, SBHUFFRSIZE, &code);\n      else\n        code = jbig2_arith_int_decode(IAEX, as, &exrunlength);\n      /* prevent infinite loop */\n      zerolength = exrunlength > 0 ? 0 : zerolength + 1;\n      if (code || (exrunlength > limit - i) || (exrunlength < 0) || (zerolength > 4) ||\n          (exflag && (exrunlength > params->SDNUMEXSYMS - j))) {\n        if (code)\n          jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"failed to decode exrunlength for exported symbols\");\n        else if (exrunlength <= 0)\n          jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"runlength too small in export symbol table (%d <= 0)\\n\", exrunlength);\n        else\n          jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"runlength too large in export symbol table (%d > %d - %d)\\n\",\n            exrunlength, params->SDNUMEXSYMS, j);\n        /* skip to the cleanup code and return SDEXSYMS = NULL */\n        jbig2_sd_release(ctx, SDEXSYMS);\n        SDEXSYMS = NULL;\n        break;\n      }\n      for(k = 0; k < exrunlength; k++) {\n        if (exflag) {\n          SDEXSYMS->glyphs[j++] = (i < params->SDNUMINSYMS) ?\n            jbig2_image_clone(ctx, params->SDINSYMS->glyphs[i]) :\n            jbig2_image_clone(ctx, SDNEWSYMS->glyphs[i-params->SDNUMINSYMS]);\n        }\n        i++;\n      }\n      exflag = !exflag;\n    }\n  }\n\ncleanup4:\n  if (tparams != NULL)\n  {\n      if (!params->SDHUFF)\n      {\n          jbig2_arith_int_ctx_free(ctx, tparams->IADT);\n          jbig2_arith_int_ctx_free(ctx, tparams->IAFS);\n          jbig2_arith_int_ctx_free(ctx, tparams->IADS);\n          jbig2_arith_int_ctx_free(ctx, tparams->IAIT);\n          jbig2_arith_iaid_ctx_free(ctx, tparams->IAID);\n          jbig2_arith_int_ctx_free(ctx, tparams->IARI);\n          jbig2_arith_int_ctx_free(ctx, tparams->IARDW);\n          jbig2_arith_int_ctx_free(ctx, tparams->IARDH);\n          jbig2_arith_int_ctx_free(ctx, tparams->IARDX);\n          jbig2_arith_int_ctx_free(ctx, tparams->IARDY);\n      }\n      else\n      {\n          jbig2_release_huffman_table(ctx, tparams->SBHUFFFS);\n          jbig2_release_huffman_table(ctx, tparams->SBHUFFDS);\n          jbig2_release_huffman_table(ctx, tparams->SBHUFFDT);\n          jbig2_release_huffman_table(ctx, tparams->SBHUFFRDX);\n          jbig2_release_huffman_table(ctx, tparams->SBHUFFRDY);\n          jbig2_release_huffman_table(ctx, tparams->SBHUFFRDW);\n          jbig2_release_huffman_table(ctx, tparams->SBHUFFRDH);\n      }\n      jbig2_free(ctx->allocator, tparams);\n  }\n  if (refagg_dicts != NULL)\n  {\n      jbig2_sd_release(ctx, refagg_dicts[0]);\n      jbig2_free(ctx->allocator, refagg_dicts);\n  }\n\ncleanup2:\n  jbig2_sd_release(ctx, SDNEWSYMS);\n  if (params->SDHUFF && !params->SDREFAGG)\n  {\n      jbig2_free(ctx->allocator, SDNEWSYMWIDTHS);\n  }\n  jbig2_release_huffman_table(ctx, SDHUFFRDX);\n  jbig2_release_huffman_table(ctx, SBHUFFRSIZE);\n  jbig2_huffman_free(ctx, hs);\n  jbig2_arith_iaid_ctx_free(ctx, IAID);\n  jbig2_arith_int_ctx_free(ctx, IARDX);\n  jbig2_arith_int_ctx_free(ctx, IARDY);\n\ncleanup1:\n  jbig2_word_stream_buf_free(ctx, ws);\n  jbig2_free(ctx->allocator, as);\n  jbig2_arith_int_ctx_free(ctx, IADH);\n  jbig2_arith_int_ctx_free(ctx, IADW);\n  jbig2_arith_int_ctx_free(ctx, IAEX);\n  jbig2_arith_int_ctx_free(ctx, IAAI);\n\n  return SDEXSYMS;\n}\n\n/* 7.4.2 */\nint\njbig2_symbol_dictionary(Jbig2Ctx *ctx, Jbig2Segment *segment,\n\t\t\tconst byte *segment_data)\n{\n  Jbig2SymbolDictParams params;\n  uint16_t flags;\n  int sdat_bytes;\n  int offset;\n  Jbig2ArithCx *GB_stats = NULL;\n  Jbig2ArithCx *GR_stats = NULL;\n  int table_index = 0;\n  const Jbig2HuffmanParams *huffman_params;\n\n  if (segment->data_length < 10)\n    goto too_short;\n\n  /* 7.4.2.1.1 */\n  flags = jbig2_get_uint16(segment_data);\n\n  /* zero params to ease cleanup later */\n  memset(&params, 0, sizeof(Jbig2SymbolDictParams));\n\n  params.SDHUFF = flags & 1;\n  params.SDREFAGG = (flags >> 1) & 1;\n  params.SDTEMPLATE = (flags >> 10) & 3;\n  params.SDRTEMPLATE = (flags >> 12) & 1;\n\n  if (params.SDHUFF) {\n    switch ((flags & 0x000c) >> 2) {\n      case 0: /* Table B.4 */\n\tparams.SDHUFFDH = jbig2_build_huffman_table(ctx, &jbig2_huffman_params_D);\n\tbreak;\n      case 1: /* Table B.5 */\n\tparams.SDHUFFDH = jbig2_build_huffman_table(ctx, &jbig2_huffman_params_E);\n\tbreak;\n      case 3: /* Custom table from referred segment */\n        huffman_params = jbig2_find_table(ctx, segment, table_index);\n        if (huffman_params == NULL) {\n            return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                \"Custom DH huffman table not found (%d)\", table_index);\n        }\n        params.SDHUFFDH = jbig2_build_huffman_table(ctx, huffman_params);\n        ++table_index;\n        break;\n      case 2:\n      default:\n\treturn jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n\t    \"symbol dictionary specified invalid huffman table\");\n    }\n    if (params.SDHUFFDH == NULL)\n    {\n        jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"failed to allocate DH huffman table\");\n        goto cleanup;\n    }\n\n    switch ((flags & 0x0030) >> 4) {\n      case 0: /* Table B.2 */\n\tparams.SDHUFFDW = jbig2_build_huffman_table(ctx, &jbig2_huffman_params_B);\n\tbreak;\n      case 1: /* Table B.3 */\n\tparams.SDHUFFDW = jbig2_build_huffman_table(ctx, &jbig2_huffman_params_C);\n\tbreak;\n      case 3: /* Custom table from referred segment */\n        huffman_params = jbig2_find_table(ctx, segment, table_index);\n        if (huffman_params == NULL) {\n            jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                \"Custom DW huffman table not found (%d)\", table_index);\n            break;\n        }\n        params.SDHUFFDW = jbig2_build_huffman_table(ctx, huffman_params);\n        ++table_index;\n        break;\n      case 2:\n      default:\n        jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n\t    \"symbol dictionary specified invalid huffman table\");\n        goto cleanup; /* Jump direct to cleanup to avoid 2 errors being given */\n    }\n    if (params.SDHUFFDW == NULL)\n    {\n        jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"failed to allocate DW huffman table\");\n        goto cleanup;\n    }\n\n    if (flags & 0x0040) {\n        /* Custom table from referred segment */\n        huffman_params = jbig2_find_table(ctx, segment, table_index);\n        if (huffman_params == NULL) {\n            jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                \"Custom BMSIZE huffman table not found (%d)\", table_index);\n        } else {\n            params.SDHUFFBMSIZE = jbig2_build_huffman_table(ctx, huffman_params);\n            ++table_index;\n        }\n    } else {\n\t/* Table B.1 */\n\tparams.SDHUFFBMSIZE = jbig2_build_huffman_table(ctx, &jbig2_huffman_params_A);\n    }\n    if (params.SDHUFFBMSIZE == NULL)\n    {\n        jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"failed to allocate BMSIZE huffman table\");\n        goto cleanup;\n    }\n\n    if (flags & 0x0080) {\n        /* Custom table from referred segment */\n        huffman_params = jbig2_find_table(ctx, segment, table_index);\n        if (huffman_params == NULL) {\n            jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                \"Custom REFAGG huffman table not found (%d)\", table_index);\n        } else {\n            params.SDHUFFAGGINST = jbig2_build_huffman_table(ctx, huffman_params);\n            ++table_index;\n        }\n    } else {\n\t/* Table B.1 */\n\tparams.SDHUFFAGGINST = jbig2_build_huffman_table(ctx, &jbig2_huffman_params_A);\n    }\n    if (params.SDHUFFAGGINST == NULL)\n    {\n        jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"failed to allocate REFAGG huffman table\");\n        goto cleanup;\n    }\n  }\n\n  /* FIXME: there are quite a few of these conditions to check */\n  /* maybe #ifdef CONFORMANCE and a separate routine */\n  if (!params.SDHUFF) {\n    if (flags & 0x000c) {\n      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n\t\t  \"SDHUFF is zero, but contrary to spec SDHUFFDH is not.\");\n      goto cleanup;\n    }\n    if (flags & 0x0030) {\n      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n\t\t  \"SDHUFF is zero, but contrary to spec SDHUFFDW is not.\");\n      goto cleanup;\n    }\n  }\n\n  if (flags & 0x0080) {\n      jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n        \"bitmap coding context is used (NYI) symbol data likely to be garbage!\");\n      goto cleanup;\n  }\n\n  /* 7.4.2.1.2 */\n  sdat_bytes = params.SDHUFF ? 0 : params.SDTEMPLATE == 0 ? 8 : 2;\n  memcpy(params.sdat, segment_data + 2, sdat_bytes);\n  offset = 2 + sdat_bytes;\n\n  /* 7.4.2.1.3 */\n  if (params.SDREFAGG && !params.SDRTEMPLATE) {\n      if (offset + 4 > segment->data_length)\n\tgoto too_short;\n      memcpy(params.sdrat, segment_data + offset, 4);\n      offset += 4;\n  }\n\n  if (offset + 8 > segment->data_length)\n    goto too_short;\n\n  /* 7.4.2.1.4 */\n  params.SDNUMEXSYMS = jbig2_get_uint32(segment_data + offset);\n  /* 7.4.2.1.5 */\n  params.SDNUMNEWSYMS = jbig2_get_uint32(segment_data + offset + 4);\n  offset += 8;\n\n  jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,\n\t      \"symbol dictionary, flags=%04x, %u exported syms, %u new syms\",\n\t      flags, params.SDNUMEXSYMS, params.SDNUMNEWSYMS);\n\n  /* 7.4.2.2 (2) */\n  {\n    int n_dicts = jbig2_sd_count_referred(ctx, segment);\n    Jbig2SymbolDict **dicts = NULL;\n\n    if (n_dicts > 0) {\n      dicts = jbig2_sd_list_referred(ctx, segment);\n      if (dicts == NULL)\n      {\n          jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n              \"failed to allocate dicts in symbol dictionary\");\n          goto cleanup;\n      }\n      params.SDINSYMS = jbig2_sd_cat(ctx, n_dicts, dicts);\n      if (params.SDINSYMS == NULL)\n      {\n          jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n              \"failed to allocate symbol array in symbol dictionary\");\n          jbig2_free(ctx->allocator, dicts);\n          goto cleanup;\n      }\n      jbig2_free(ctx->allocator, dicts);\n    }\n    if (params.SDINSYMS != NULL) {\n      params.SDNUMINSYMS = params.SDINSYMS->n_symbols;\n    }\n  }\n\n  /* 7.4.2.2 (3, 4) */\n  if (flags & 0x0100) {\n      jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n        \"segment marks bitmap coding context as used (NYI)\");\n      goto cleanup;\n  } else {\n      int stats_size = params.SDTEMPLATE == 0 ? 65536 :\n          params.SDTEMPLATE == 1 ? 8192 : 1024;\n      GB_stats = jbig2_new(ctx, Jbig2ArithCx, stats_size);\n      if (GB_stats == NULL)\n      {\n          jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n              \"failed to allocate GB_stats in jbig2_symbol_dictionary\");\n          goto cleanup;\n      }\n      memset(GB_stats, 0, stats_size);\n\t  \n\t  stats_size = params.SDRTEMPLATE ? 1 << 10 : 1 << 13;\n\t  GR_stats = jbig2_new(ctx, Jbig2ArithCx, stats_size);\n\t  if (GR_stats == NULL)\n\t  {\n\t\t  jbig2_error(ctx, JBIG2_SEVERITY_FATAL, -1,\n\t\t\t  \"failed to allocate GR_stats in jbig2_symbol_dictionary\");\n\t\t  jbig2_free(ctx->allocator, GB_stats);\n\t\t  goto cleanup;\n\t  }\n\t  memset(GR_stats, 0, stats_size);\n  }\n\n  segment->result = (void *)jbig2_decode_symbol_dict(ctx, segment,\n\t\t\t\t  &params,\n\t\t\t\t  segment_data + offset,\n\t\t\t\t  segment->data_length - offset,\n\t\t\t\t  GB_stats, GR_stats);\n#ifdef DUMP_SYMDICT\n  if (segment->result) jbig2_dump_symbol_dict(ctx, segment);\n#endif\n\n  /* 7.4.2.2 (7) */\n  if (flags & 0x0200) {\n      /* todo: retain GB_stats, GR_stats */\n      jbig2_free(ctx->allocator, GR_stats);\n      jbig2_free(ctx->allocator, GB_stats);\n      jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n          \"segment marks bitmap coding context as retained (NYI)\");\n  } else {\n      jbig2_free(ctx->allocator, GR_stats);\n      jbig2_free(ctx->allocator, GB_stats);\n  }\n\ncleanup:\n  if (params.SDHUFF) {\n      jbig2_release_huffman_table(ctx, params.SDHUFFDH);\n      jbig2_release_huffman_table(ctx, params.SDHUFFDW);\n      jbig2_release_huffman_table(ctx, params.SDHUFFBMSIZE);\n      jbig2_release_huffman_table(ctx, params.SDHUFFAGGINST);\n  }\n  jbig2_sd_release(ctx, params.SDINSYMS);\n\n  return (segment->result != NULL) ? 0 : -1;\n\n too_short:\n  return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n\t\t     \"Segment too short\");\n}\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_symbol_dict.h",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n/* symbol dictionary header */\n\n/* the results of decoding a symbol dictionary */\ntypedef struct {\n    uint32_t n_symbols;\n    Jbig2Image **glyphs;\n} Jbig2SymbolDict;\n\n/* decode a symbol dictionary segment and store the results */\nint\njbig2_symbol_dictionary(Jbig2Ctx *ctx, Jbig2Segment *segment,\n\t\t\tconst byte *segment_data);\n\n/* get a particular glyph by index */\nJbig2Image *\njbig2_sd_glyph(Jbig2SymbolDict *dict, unsigned int id);\n\n/* return a new empty symbol dict */\nJbig2SymbolDict *\njbig2_sd_new(Jbig2Ctx *ctx, int n_symbols);\n\n/* release the memory associated with a symbol dict */\nvoid\njbig2_sd_release(Jbig2Ctx *ctx, Jbig2SymbolDict *dict);\n\n/* generate a new symbol dictionary by concatenating a list of\n   existing dictionaries */\nJbig2SymbolDict *\njbig2_sd_cat(Jbig2Ctx *ctx, int n_dicts,\n\t\t\tJbig2SymbolDict **dicts);\n\n/* count the number of dictionary segments referred\n   to by the given segment */\nint\njbig2_sd_count_referred(Jbig2Ctx *ctx, Jbig2Segment *segment);\n\n/* return an array of pointers to symbol dictionaries referred\n   to by a segment */\nJbig2SymbolDict **\njbig2_sd_list_referred(Jbig2Ctx *ctx, Jbig2Segment *segment);\n\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_text.c",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#include \"os_types.h\"\n\n#include <stddef.h>\n#include <string.h> /* memset() */\n\n#include \"jbig2.h\"\n#include \"jbig2_priv.h\"\n#include \"jbig2_arith.h\"\n#include \"jbig2_arith_int.h\"\n#include \"jbig2_arith_iaid.h\"\n#include \"jbig2_huffman.h\"\n#include \"jbig2_generic.h\"\n#include \"jbig2_symbol_dict.h\"\n#include \"jbig2_text.h\"\n\n\n/**\n * jbig2_decode_text_region: decode a text region segment\n *\n * @ctx: jbig2 decoder context\n * @segment: jbig2 segment (header) structure\n * @params: parameters from the text region header\n * @dicts: an array of referenced symbol dictionaries\n * @n_dicts: the number of referenced symbol dictionaries\n * @image: image structure in which to store the decoded region bitmap\n * @data: pointer to text region data to be decoded\n * @size: length of text region data\n *\n * Implements the text region decoding procedure\n * described in section 6.4 of the JBIG2 spec.\n *\n * returns: 0 on success\n **/\nint\njbig2_decode_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment,\n                             const Jbig2TextRegionParams *params,\n                             const Jbig2SymbolDict * const *dicts, const int n_dicts,\n                             Jbig2Image *image,\n                             const byte *data, const size_t size,\n\t\t\t     Jbig2ArithCx *GR_stats, Jbig2ArithState *as, Jbig2WordStream *ws)\n{\n    /* relevent bits of 6.4.4 */\n    uint32_t NINSTANCES;\n    uint32_t ID;\n    int32_t STRIPT;\n    int32_t FIRSTS;\n    int32_t DT;\n    int32_t DFS;\n    int32_t IDS;\n    int32_t CURS;\n    int32_t CURT;\n    int S,T;\n    int x,y;\n    bool first_symbol;\n    uint32_t index, SBNUMSYMS;\n    Jbig2Image *IB = NULL;\n    Jbig2HuffmanState *hs = NULL;\n    Jbig2HuffmanTable *SBSYMCODES = NULL;\n    int code = 0;\n    int RI;\n\n    SBNUMSYMS = 0;\n    for (index = 0; index < n_dicts; index++) {\n        SBNUMSYMS += dicts[index]->n_symbols;\n    }\n    jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n        \"symbol list contains %d glyphs in %d dictionaries\", SBNUMSYMS, n_dicts);\n\n    if (params->SBHUFF) {\n\tJbig2HuffmanTable *runcodes = NULL;\n\tJbig2HuffmanParams runcodeparams;\n\tJbig2HuffmanLine runcodelengths[35];\n\tJbig2HuffmanLine *symcodelengths = NULL;\n\tJbig2HuffmanParams symcodeparams;\n\tint err, len, range, r;\n\n\tjbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n\t  \"huffman coded text region\");\n\ths = jbig2_huffman_new(ctx, ws);\n    if (hs == NULL)\n    {\n        jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n            \"failed to allocate storage for text region\");\n        return -1;\n    }\n\n\t/* 7.4.3.1.7 - decode symbol ID Huffman table */\n\t/* this is actually part of the segment header, but it is more\n\t   convenient to handle it here */\n\n\t/* parse and build the runlength code huffman table */\n\tfor (index = 0; index < 35; index++) {\n\t  runcodelengths[index].PREFLEN = jbig2_huffman_get_bits(hs, 4, &code);\n\t  if (code < 0)\n\t    goto cleanup1;\n\t  runcodelengths[index].RANGELEN = 0;\n\t  runcodelengths[index].RANGELOW = index;\n\t  jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n\t    \"  read runcode%d length %d\", index, runcodelengths[index].PREFLEN);\n\t}\n\truncodeparams.HTOOB = 0;\n\truncodeparams.lines = runcodelengths;\n\truncodeparams.n_lines = 35;\n\truncodes = jbig2_build_huffman_table(ctx, &runcodeparams);\n\tif (runcodes == NULL) {\n\t  jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n\t    \"error constructing symbol id runcode table!\");\n\t  code = -1;\n      goto cleanup1;\n\t}\n\n\t/* decode the symbol id codelengths using the runlength table */\n\tsymcodelengths = jbig2_new(ctx, Jbig2HuffmanLine, SBNUMSYMS);\n\tif (symcodelengths == NULL) {\n\t  jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n\t    \"memory allocation failure reading symbol ID huffman table!\");\n\t  code = -1;\n      goto cleanup1;\n\t}\n\tindex = 0;\n\twhile (index < SBNUMSYMS) {\n\t  code = jbig2_huffman_get(hs, runcodes, &err);\n\t  if (err != 0 || code < 0 || code >= 35) {\n\t    jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n\t      \"error reading symbol ID huffman table!\");\n\t    code = err ? err : -1;\n        goto cleanup1;\n\t  }\n\n\t  if (code < 32) {\n\t    len = code;\n\t    range = 1;\n\t  } else {\n\t    if (code == 32) {\n\t      if (index < 1) {\n\t\tjbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n\t \t  \"error decoding symbol id table: run length with no antecedent!\");\n\t        code = -1;\n                goto cleanup1;\n\t      }\n\t      len = symcodelengths[index-1].PREFLEN;\n\t    } else {\n\t      len = 0; /* code == 33 or 34 */\n\t    }\n\t    err = 0;\n\t    if (code == 32) range = jbig2_huffman_get_bits(hs, 2, &err) + 3;\n\t    else if (code == 33) range = jbig2_huffman_get_bits(hs, 3, &err) + 3;\n\t    else if (code == 34) range = jbig2_huffman_get_bits(hs, 7, &err) + 11;\n\t    if (err < 0)\n\t      goto cleanup1;\n\t  }\n\t  jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n\t    \"  read runcode%d at index %d (length %d range %d)\", code, index, len, range);\n\t  if (index+range > SBNUMSYMS) {\n\t    jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n\t      \"runlength extends %d entries beyond the end of symbol id table!\",\n\t\tindex+range - SBNUMSYMS);\n\t    range = SBNUMSYMS - index;\n\t  }\n\t  for (r = 0; r < range; r++) {\n\t    symcodelengths[index+r].PREFLEN = len;\n\t    symcodelengths[index+r].RANGELEN = 0;\n\t    symcodelengths[index+r].RANGELOW = index + r;\n\t  }\n\t  index += r;\n\t}\n\n\tif (index < SBNUMSYMS) {\n\t  jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n\t    \"runlength codes do not cover the available symbol set\");\n\t}\n\tsymcodeparams.HTOOB = 0;\n\tsymcodeparams.lines = symcodelengths;\n\tsymcodeparams.n_lines = SBNUMSYMS;\n\n\t/* skip to byte boundary */\n\tjbig2_huffman_skip(hs);\n\n\t/* finally, construct the symbol id huffman table itself */\n\tSBSYMCODES = jbig2_build_huffman_table(ctx, &symcodeparams);\n\ncleanup1:\n\tjbig2_free(ctx->allocator, symcodelengths);\n\tjbig2_release_huffman_table(ctx, runcodes);\n\n\tif (SBSYMCODES == NULL) {\n\t    jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"could not construct Symbol ID huffman table!\");\n        jbig2_huffman_free(ctx, hs);\n\t    return ((code != 0) ? code : -1);\n\t}\n    }\n\n    /* 6.4.5 (1) */\n    jbig2_image_clear(ctx, image, params->SBDEFPIXEL);\n\n    /* 6.4.6 */\n    if (params->SBHUFF) {\n        STRIPT = jbig2_huffman_get(hs, params->SBHUFFDT, &code);\n    } else {\n        code = jbig2_arith_int_decode(params->IADT, as, &STRIPT);\n    }\n    if (code < 0) goto cleanup2;\n\n    /* 6.4.5 (2) */\n    STRIPT *= -(params->SBSTRIPS);\n    FIRSTS = 0;\n    NINSTANCES = 0;\n\n    /* 6.4.5 (3) */\n    while (NINSTANCES < params->SBNUMINSTANCES) {\n        /* (3b) */\n        if (params->SBHUFF) {\n            DT = jbig2_huffman_get(hs, params->SBHUFFDT, &code);\n        } else {\n            code = jbig2_arith_int_decode(params->IADT, as, &DT);\n        }\n        if (code < 0) goto cleanup2;\n        DT *= params->SBSTRIPS;\n        STRIPT += DT;\n\n\tfirst_symbol = TRUE;\n\t/* 6.4.5 (3c) - decode symbols in strip */\n\tfor (;;) {\n\t    /* (3c.i) */\n\t    if (first_symbol) {\n\t\t/* 6.4.7 */\n\t\tif (params->SBHUFF) {\n\t\t    DFS = jbig2_huffman_get(hs, params->SBHUFFFS, &code);\n\t\t} else {\n\t\t    code = jbig2_arith_int_decode(params->IAFS, as, &DFS);\n\t\t}\n                if (code < 0) goto cleanup2;\n\t\tFIRSTS += DFS;\n\t\tCURS = FIRSTS;\n\t\tfirst_symbol = FALSE;\n\t    } else {\n                if (NINSTANCES > params->SBNUMINSTANCES) {\n                    code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                        \"too many NINSTANCES (%d) decoded\", NINSTANCES);\n                    break;\n\t\t}\n\t\t/* (3c.ii) / 6.4.8 */\n\t\tif (params->SBHUFF) {\n\t\t    IDS = jbig2_huffman_get(hs, params->SBHUFFDS, &code);\n\t\t} else {\n\t\t    code = jbig2_arith_int_decode(params->IADS, as, &IDS);\n\t\t}\n\t\tif (code) {\n                    /* decoded an OOB, reached end of strip */\n\t\t    break;\n\t\t}\n\t\tCURS += IDS + params->SBDSOFFSET;\n\t    }\n\n\t    /* (3c.iii) / 6.4.9 */\n\t    if (params->SBSTRIPS == 1) {\n\t\tCURT = 0;\n\t    } else if (params->SBHUFF) {\n\t\tCURT = jbig2_huffman_get_bits(hs, params->LOGSBSTRIPS, &code);\n\t    } else {\n\t\tcode = jbig2_arith_int_decode(params->IAIT, as, &CURT);\n\t    }\n\t    if (code < 0) goto cleanup2;\n\t    T = STRIPT + CURT;\n\n\t    /* (3b.iv) / 6.4.10 - decode the symbol id */\n\t    if (params->SBHUFF) {\n\t\tID = jbig2_huffman_get(hs, SBSYMCODES, &code);\n\t    } else {\n\t\tcode = jbig2_arith_iaid_decode(params->IAID, as, (int *)&ID);\n\t    }\n            if (code < 0) goto cleanup2;\n\t    if (ID >= SBNUMSYMS) {\n            code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                \"symbol id out of range! (%d/%d)\", ID, SBNUMSYMS);\n            goto cleanup2;\n\t    }\n\n\t    /* (3c.v) / 6.4.11 - look up the symbol bitmap IB */\n\t    {\n\t\tuint32_t id = ID;\n\n\t\tindex = 0;\n\t\twhile (id >= dicts[index]->n_symbols)\n\t\t    id -= dicts[index++]->n_symbols;\n\t\tIB = jbig2_image_clone(ctx, dicts[index]->glyphs[id]);\n\t\t/* SumatraPDF: fail on missing glyphs */\n\t\tif (!IB) {\n\t\t    code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n\t\t        \"missing glyph %d/%d!\", index, id);\n\t\t    goto cleanup2;\n\t\t}\n\t    }\n\t    if (params->SBREFINE) {\n\t      if (params->SBHUFF) {\n\t\tRI = jbig2_huffman_get_bits(hs, 1, &code);\n\t      } else {\n\t\tcode = jbig2_arith_int_decode(params->IARI, as, &RI);\n\t      }\n\t      if (code < 0) goto cleanup2;\n\t    } else {\n\t\tRI = 0;\n\t    }\n\t    if (RI) {\n\t\tJbig2RefinementRegionParams rparams;\n\t\tJbig2Image *IBO;\n\t\tint32_t RDW, RDH, RDX, RDY;\n\t\tJbig2Image *refimage;\n\t\tint BMSIZE = 0;\n\t\tint code1 = 0;\n\t\tint code2 = 0;\n\t\tint code3 = 0;\n\t\tint code4 = 0;\n\t\tint code5 = 0;\n\n\t\t/* 6.4.11 (1, 2, 3, 4) */\n\t\tif (!params->SBHUFF) {\n\t\t  code1 = jbig2_arith_int_decode(params->IARDW, as, &RDW);\n\t\t  code2 = jbig2_arith_int_decode(params->IARDH, as, &RDH);\n\t\t  code3 = jbig2_arith_int_decode(params->IARDX, as, &RDX);\n\t\t  code4 = jbig2_arith_int_decode(params->IARDY, as, &RDY);\n\t\t} else {\n\t\t  RDW = jbig2_huffman_get(hs, params->SBHUFFRDW, &code1);\n\t\t  RDH = jbig2_huffman_get(hs, params->SBHUFFRDH, &code2);\n\t\t  RDX = jbig2_huffman_get(hs, params->SBHUFFRDX, &code3);\n\t\t  RDY = jbig2_huffman_get(hs, params->SBHUFFRDY, &code4);\n\t\t  BMSIZE = jbig2_huffman_get(hs, params->SBHUFFRSIZE, &code5);\n\t\t  jbig2_huffman_skip(hs);\n\t\t}\n\n\t\tif ((code1 < 0) || (code2 < 0) || (code3 < 0) || (code4 < 0) || (code5 < 0))\n\t\t{\n\t\t    code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n\t\t        \"failed to decode data\");\n\t\t    goto cleanup2;\n\t\t}\n\n\t\t/* 6.4.11 (6) */\n\t\tIBO = IB;\n\t\trefimage = jbig2_image_new(ctx, IBO->width + RDW,\n\t\t\t\t\t\tIBO->height + RDH);\n\t\tif (refimage == NULL) {\n\t\t  jbig2_image_release(ctx, IBO);\n\t\t  if (params->SBHUFF) {\n\t\t    jbig2_release_huffman_table(ctx, SBSYMCODES);\n\t\t  }\n\t\t  return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, \n\t\t\tsegment->number,\n\t\t\t\"couldn't allocate reference image\");\n\t        }\n\n\t\t/* Table 12 */\n\t\trparams.GRTEMPLATE = params->SBRTEMPLATE;\n\t\trparams.reference = IBO;\n\t\trparams.DX = (RDW >> 1) + RDX;\n\t\trparams.DY = (RDH >> 1) + RDY;\n\t\trparams.TPGRON = 0;\n\t\tmemcpy(rparams.grat, params->sbrat, 4);\n\t\tcode = jbig2_decode_refinement_region(ctx, segment,\n\t\t    &rparams, as, refimage, GR_stats);\n\t\tif (code < 0) {\n\t\t    jbig2_image_release(ctx, refimage);\n\t\t    goto cleanup2;\n\t\t}\n\t\tIB = refimage;\n\n\t\tjbig2_image_release(ctx, IBO);\n\n\t\t/* 6.4.11 (7) */\n\t\tif (params->SBHUFF) {\n\t\t  jbig2_huffman_advance(hs, BMSIZE);\n\t\t}\n\n\t    }\n\n\t    /* (3c.vi) */\n\t    if ((!params->TRANSPOSED) && (params->REFCORNER > 1)) {\n\t\tCURS += IB->width - 1;\n\t    } else if ((params->TRANSPOSED) && !(params->REFCORNER & 1)) {\n\t\tCURS += IB->height - 1;\n\t    }\n\n\t    /* (3c.vii) */\n\t    S = CURS;\n\n\t    /* (3c.viii) */\n\t    if (!params->TRANSPOSED) {\n\t\tswitch (params->REFCORNER) {\n\t\tcase JBIG2_CORNER_TOPLEFT: x = S; y = T; break;\n\t\tcase JBIG2_CORNER_TOPRIGHT: x = S - IB->width + 1; y = T; break;\n\t\tcase JBIG2_CORNER_BOTTOMLEFT: x = S; y = T - IB->height + 1; break;\n\t\tdefault:\n\t\tcase JBIG2_CORNER_BOTTOMRIGHT: x = S - IB->width + 1; y = T - IB->height + 1; break;\n\t\t}\n\t    } else { /* TRANSPOSED */\n\t\tswitch (params->REFCORNER) {\n\t\tcase JBIG2_CORNER_TOPLEFT: x = T; y = S; break;\n\t\tcase JBIG2_CORNER_TOPRIGHT: x = T - IB->width + 1; y = S; break;\n\t\tcase JBIG2_CORNER_BOTTOMLEFT: x = T; y = S - IB->height + 1; break;\n\t\tdefault:\n\t\tcase JBIG2_CORNER_BOTTOMRIGHT: x = T - IB->width + 1; y = S - IB->height + 1; break;\n\t\t}\n\t    }\n\n\t    /* (3c.ix) */\n#ifdef JBIG2_DEBUG\n\t    jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n\t\t\t\"composing glyph id %d: %dx%d @ (%d,%d) symbol %d/%d\",\n\t\t\tID, IB->width, IB->height, x, y, NINSTANCES + 1,\n\t\t\tparams->SBNUMINSTANCES);\n#endif\n\t    code = jbig2_image_compose(ctx, image, IB, x, y, params->SBCOMBOP);\n\t    if (code < 0) {\n\t\tjbig2_image_release(ctx, IB);\n\t\tgoto cleanup2;\n\t    }\n\n\t    /* (3c.x) */\n\t    if ((!params->TRANSPOSED) && (params->REFCORNER < 2)) {\n\t\tCURS += IB->width -1 ;\n\t    } else if ((params->TRANSPOSED) && (params->REFCORNER & 1)) {\n\t\tCURS += IB->height - 1;\n\t    }\n\n\t    /* (3c.xi) */\n\t    NINSTANCES++;\n\n\t    jbig2_image_release(ctx, IB);\n\t}\n        /* end strip */\n    }\n    /* 6.4.5 (4) */\n\ncleanup2:\n    if (params->SBHUFF) {\n      jbig2_release_huffman_table(ctx, SBSYMCODES);\n    }\n    jbig2_huffman_free(ctx, hs);\n\n    return code;\n}\n\n/**\n * jbig2_text_region: read a text region segment header\n **/\nint\njbig2_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment, const byte *segment_data)\n{\n    int offset = 0;\n    Jbig2RegionSegmentInfo region_info;\n    Jbig2TextRegionParams params;\n    Jbig2Image *image = NULL;\n    Jbig2SymbolDict **dicts = NULL;\n    int n_dicts = 0;\n    uint16_t flags = 0;\n    uint16_t huffman_flags = 0;\n    Jbig2ArithCx *GR_stats = NULL;\n    int code = 0;\n    Jbig2WordStream *ws = NULL;\n    Jbig2ArithState *as = NULL;\n    int table_index = 0;\n    const Jbig2HuffmanParams *huffman_params = NULL;\n\n    /* 7.4.1 */\n    if (segment->data_length < 17)\n        goto too_short;\n    jbig2_get_region_segment_info(&region_info, segment_data);\n    offset += 17;\n\n    /* 7.4.3.1.1 */\n    flags = jbig2_get_uint16(segment_data + offset);\n    offset += 2;\n\n    jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n\t\"text region header flags 0x%04x\", flags);\n\n    /* zero params to ease cleanup later */\n    memset(&params, 0, sizeof(Jbig2TextRegionParams));\n\n    params.SBHUFF = flags & 0x0001;\n    params.SBREFINE = flags & 0x0002;\n    params.LOGSBSTRIPS = (flags & 0x000c) >> 2;\n    params.SBSTRIPS = 1 << params.LOGSBSTRIPS;\n    params.REFCORNER = (Jbig2RefCorner)((flags & 0x0030) >> 4);\n    params.TRANSPOSED = flags & 0x0040;\n    params.SBCOMBOP = (Jbig2ComposeOp)((flags & 0x0180) >> 7);\n    params.SBDEFPIXEL = flags & 0x0200;\n    /* SBDSOFFSET is a signed 5 bit integer */\n    params.SBDSOFFSET = (flags & 0x7C00) >> 10;\n    if (params.SBDSOFFSET > 0x0f) params.SBDSOFFSET -= 0x20;\n    params.SBRTEMPLATE = flags & 0x8000;\n\n    if (params.SBDSOFFSET) {\n      jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n\t\"text region has SBDSOFFSET %d\", params.SBDSOFFSET);\n    }\n\n    if (params.SBHUFF)\t/* Huffman coding */\n      {\n        /* 7.4.3.1.2 */\n        huffman_flags = jbig2_get_uint16(segment_data + offset);\n        offset += 2;\n\n        if (huffman_flags & 0x8000)\n            jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n                \"reserved bit 15 of text region huffman flags is not zero\");\n      }\n    else\t/* arithmetic coding */\n      {\n        /* 7.4.3.1.3 */\n        if ((params.SBREFINE) && !(params.SBRTEMPLATE))\n          {\n            params.sbrat[0] = segment_data[offset];\n            params.sbrat[1] = segment_data[offset + 1];\n            params.sbrat[2] = segment_data[offset + 2];\n            params.sbrat[3] = segment_data[offset + 3];\n            offset += 4;\n\t  }\n      }\n\n    /* 7.4.3.1.4 */\n    params.SBNUMINSTANCES = jbig2_get_uint32(segment_data + offset);\n    offset += 4;\n\n    if (params.SBHUFF) {\n        /* 7.4.3.1.5 - Symbol ID Huffman table */\n        /* ...this is handled in the segment body decoder */\n\n        /* 7.4.3.1.6 - Other Huffman table selection */\n\tswitch (huffman_flags & 0x0003) {\n\t  case 0: /* Table B.6 */\n\t    params.SBHUFFFS = jbig2_build_huffman_table(ctx,\n\t\t\t&jbig2_huffman_params_F);\n\t    break;\n\t  case 1: /* Table B.7 */\n\t    params.SBHUFFFS = jbig2_build_huffman_table(ctx,\n\t\t\t&jbig2_huffman_params_G);\n\t    break;\n\t  case 3: /* Custom table from referred segment */\n            huffman_params = jbig2_find_table(ctx, segment, table_index);\n            if (huffman_params == NULL) {\n                code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                    \"Custom FS huffman table not found (%d)\", table_index);\n                goto cleanup1;\n            }\n            params.SBHUFFFS = jbig2_build_huffman_table(ctx, huffman_params);\n            ++table_index;\n            break;\n\t  case 2: /* invalid */\n\t  default:\n\t    code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"text region specified invalid FS huffman table\");\n        goto cleanup1;\n\t    break;\n\t}\n    if (params.SBHUFFFS == NULL)\n    {\n        code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"failed to allocate text region specified FS huffman table\");\n        goto cleanup1;\n    }\n\n\tswitch ((huffman_flags & 0x000c) >> 2) {\n\t  case 0: /* Table B.8 */\n\t    params.SBHUFFDS = jbig2_build_huffman_table(ctx,\n\t\t\t&jbig2_huffman_params_H);\n\t    break;\n\t  case 1: /* Table B.9 */\n\t    params.SBHUFFDS = jbig2_build_huffman_table(ctx,\n\t\t\t&jbig2_huffman_params_I);\n\t    break;\n\t  case 2: /* Table B.10 */\n\t    params.SBHUFFDS = jbig2_build_huffman_table(ctx,\n\t\t\t&jbig2_huffman_params_J);\n\t    break;\n\t  case 3: /* Custom table from referred segment */\n            huffman_params = jbig2_find_table(ctx, segment, table_index);\n            if (huffman_params == NULL) {\n                code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                    \"Custom DS huffman table not found (%d)\", table_index);\n                goto cleanup1;\n            }\n            params.SBHUFFDS = jbig2_build_huffman_table(ctx, huffman_params);\n            ++table_index;\n            break;\n\t}\n    if (params.SBHUFFDS == NULL)\n    {\n        code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"failed to allocate text region specified DS huffman table\");\n        goto cleanup1;\n    }\n\n\tswitch ((huffman_flags & 0x0030) >> 4) {\n\t  case 0: /* Table B.11 */\n\t    params.SBHUFFDT = jbig2_build_huffman_table(ctx,\n\t\t\t&jbig2_huffman_params_K);\n\t    break;\n\t  case 1: /* Table B.12 */\n\t    params.SBHUFFDT = jbig2_build_huffman_table(ctx,\n\t\t\t&jbig2_huffman_params_L);\n\t    break;\n\t  case 2: /* Table B.13 */\n\t    params.SBHUFFDT = jbig2_build_huffman_table(ctx,\n\t\t\t&jbig2_huffman_params_M);\n\t    break;\n\t  case 3: /* Custom table from referred segment */\n            huffman_params = jbig2_find_table(ctx, segment, table_index);\n            if (huffman_params == NULL) {\n                code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                    \"Custom DT huffman table not found (%d)\", table_index);\n                goto cleanup1;\n            }\n            params.SBHUFFDT = jbig2_build_huffman_table(ctx, huffman_params);\n            ++table_index;\n            break;\n\t}\n    if (params.SBHUFFDT == NULL)\n    {\n        code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"failed to allocate text region specified DT huffman table\");\n        goto cleanup1;\n    }\n\n\tswitch ((huffman_flags & 0x00c0) >> 6) {\n\t  case 0: /* Table B.14 */\n\t    params.SBHUFFRDW = jbig2_build_huffman_table(ctx,\n\t\t\t&jbig2_huffman_params_N);\n\t    break;\n\t  case 1: /* Table B.15 */\n\t    params.SBHUFFRDW = jbig2_build_huffman_table(ctx,\n\t\t\t&jbig2_huffman_params_O);\n\t    break;\n\t  case 3: /* Custom table from referred segment */\n            huffman_params = jbig2_find_table(ctx, segment, table_index);\n            if (huffman_params == NULL) {\n                code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                    \"Custom RDW huffman table not found (%d)\", table_index);\n                goto cleanup1;\n            }\n            params.SBHUFFRDW = jbig2_build_huffman_table(ctx, huffman_params);\n            ++table_index;\n\t    break;\n\t  case 2: /* invalid */\n\t  default:\n\t    code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"text region specified invalid RDW huffman table\");\n        goto cleanup1;\n\t    break;\n\t}\n    if (params.SBHUFFRDW == NULL)\n    {\n        code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"failed to allocate text region specified RDW huffman table\");\n        goto cleanup1;\n    }\n\n\tswitch ((huffman_flags & 0x0300) >> 8) {\n\t  case 0: /* Table B.14 */\n\t    params.SBHUFFRDH = jbig2_build_huffman_table(ctx,\n\t\t\t&jbig2_huffman_params_N);\n\t    break;\n\t  case 1: /* Table B.15 */\n\t    params.SBHUFFRDH = jbig2_build_huffman_table(ctx,\n\t\t\t&jbig2_huffman_params_O);\n\t    break;\n\t  case 3: /* Custom table from referred segment */\n            huffman_params = jbig2_find_table(ctx, segment, table_index);\n            if (huffman_params == NULL) {\n                code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                    \"Custom RDH huffman table not found (%d)\", table_index);\n                goto cleanup1;\n            }\n            params.SBHUFFRDH = jbig2_build_huffman_table(ctx, huffman_params);\n            ++table_index;\n\t    break;\n\t  case 2: /* invalid */\n\t  default:\n\t    code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"text region specified invalid RDH huffman table\");\n        goto cleanup1;\n\t    break;\n\t}\n    if (params.SBHUFFRDH == NULL)\n    {\n        code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"failed to allocate text region specified RDH huffman table\");\n        goto cleanup1;\n    }\n\n    switch ((huffman_flags & 0x0c00) >> 10) {\n\t  case 0: /* Table B.14 */\n\t    params.SBHUFFRDX = jbig2_build_huffman_table(ctx,\n\t\t\t&jbig2_huffman_params_N);\n\t    break;\n\t  case 1: /* Table B.15 */\n\t    params.SBHUFFRDX = jbig2_build_huffman_table(ctx,\n\t\t\t&jbig2_huffman_params_O);\n\t    break;\n\t  case 3: /* Custom table from referred segment */\n            huffman_params = jbig2_find_table(ctx, segment, table_index);\n            if (huffman_params == NULL) {\n                code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                    \"Custom RDX huffman table not found (%d)\", table_index);\n                goto cleanup1;\n            }\n            params.SBHUFFRDX = jbig2_build_huffman_table(ctx, huffman_params);\n            ++table_index;\n\t    break;\n\t  case 2: /* invalid */\n\t  default:\n\t    code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"text region specified invalid RDX huffman table\");\n        goto cleanup1;\n\t    break;\n\t}\n    if (params.SBHUFFRDX == NULL)\n    {\n        code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"failed to allocate text region specified RDX huffman table\");\n        goto cleanup1;\n    }\n\n\tswitch ((huffman_flags & 0x3000) >> 12) {\n\t  case 0: /* Table B.14 */\n\t    params.SBHUFFRDY = jbig2_build_huffman_table(ctx,\n\t\t\t&jbig2_huffman_params_N);\n\t    break;\n\t  case 1: /* Table B.15 */\n\t    params.SBHUFFRDY = jbig2_build_huffman_table(ctx,\n\t\t\t&jbig2_huffman_params_O);\n\t    break;\n\t  case 3: /* Custom table from referred segment */\n            huffman_params = jbig2_find_table(ctx, segment, table_index);\n            if (huffman_params == NULL) {\n                code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                    \"Custom RDY huffman table not found (%d)\", table_index);\n                goto cleanup1;\n            }\n            params.SBHUFFRDY = jbig2_build_huffman_table(ctx, huffman_params);\n            ++table_index;\n\t    break;\n\t  case 2: /* invalid */\n\t  default:\n\t    code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"text region specified invalid RDY huffman table\");\n        goto cleanup1;\n\t    break;\n\t}\n    if (params.SBHUFFRDY == NULL)\n    {\n        code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"failed to allocate text region specified RDY huffman table\");\n        goto cleanup1;\n    }\n\n\tswitch ((huffman_flags & 0x4000) >> 14) {\n\t  case 0: /* Table B.1 */\n\t    params.SBHUFFRSIZE = jbig2_build_huffman_table(ctx,\n\t\t\t&jbig2_huffman_params_A);\n\t    break;\n\t  case 1: /* Custom table from referred segment */\n            huffman_params = jbig2_find_table(ctx, segment, table_index);\n            if (huffman_params == NULL) {\n                code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n                    \"Custom RSIZE huffman table not found (%d)\", table_index);\n                goto cleanup1;\n            }\n            params.SBHUFFRSIZE = jbig2_build_huffman_table(ctx, huffman_params);\n            ++table_index;\n\t    break;\n\t}\n    if (params.SBHUFFRSIZE == NULL)\n    {\n        code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"failed to allocate text region specified RSIZE huffman table\");\n        goto cleanup1;\n    }\n\n        if (huffman_flags & 0x8000) {\n\t  jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n \t    \"text region huffman flags bit 15 is set, contrary to spec\");\n\t}\n\n        /* 7.4.3.1.7 */\n        /* For convenience this is done in the body decoder routine */\n    }\n\n    jbig2_error(ctx, JBIG2_SEVERITY_INFO, segment->number,\n        \"text region: %d x %d @ (%d,%d) %d symbols\",\n        region_info.width, region_info.height,\n        region_info.x, region_info.y, params.SBNUMINSTANCES);\n\n    /* 7.4.3.2 (2) - compose the list of symbol dictionaries */\n    n_dicts = jbig2_sd_count_referred(ctx, segment);\n    if (n_dicts != 0) {\n        dicts = jbig2_sd_list_referred(ctx, segment);\n    } else {\n        code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"text region refers to no symbol dictionaries!\");\n        goto cleanup1;\n    }\n    if (dicts == NULL) {\n        code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"unable to retrive symbol dictionaries! previous parsing error?\");\n        goto cleanup1;\n    } else {\n\tint index;\n\tif (dicts[0] == NULL) {\n        code =jbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n            \"unable to find first referenced symbol dictionary!\");\n        goto cleanup1;\n\t}\n\tfor (index = 1; index < n_dicts; index++)\n\t    if (dicts[index] == NULL) {\n\t\tjbig2_error(ctx, JBIG2_SEVERITY_WARNING, segment->number,\n\t\t\t\"unable to find all referenced symbol dictionaries!\");\n\t    n_dicts = index;\n\t}\n    }\n\n    /* 7.4.3.2 (3) */\n    {\n\tint stats_size = params.SBRTEMPLATE ? 1 << 10 : 1 << 13;\n\tGR_stats = jbig2_new(ctx, Jbig2ArithCx, stats_size);\n    if (GR_stats == NULL)\n    {\n        code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"could not allocate GR_stats\");\n        goto cleanup1;\n    }\n\tmemset(GR_stats, 0, stats_size);\n    }\n\n    image = jbig2_image_new(ctx, region_info.width, region_info.height);\n    if (image == NULL) {\n        code =jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"couldn't allocate text region image\");\n        goto cleanup2;\n    }\n\n    ws = jbig2_word_stream_buf_new(ctx, segment_data + offset, segment->data_length - offset);\n    if (ws == NULL)\n    {\n        code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"couldn't allocate ws in text region image\");\n        goto cleanup2;\n    }\n\n    as = jbig2_arith_new(ctx, ws);\n    if (as == NULL)\n    {\n        code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"couldn't allocate as in text region image\");\n        goto cleanup2;\n    }\n\n    if (!params.SBHUFF) {\n\tint SBSYMCODELEN, index;\n        int SBNUMSYMS = 0;\n\tfor (index = 0; index < n_dicts; index++) {\n\t    SBNUMSYMS += dicts[index]->n_symbols;\n\t}\n\n    params.IADT = jbig2_arith_int_ctx_new(ctx);\n    params.IAFS = jbig2_arith_int_ctx_new(ctx);\n    params.IADS = jbig2_arith_int_ctx_new(ctx);\n    params.IAIT = jbig2_arith_int_ctx_new(ctx);\n    if ((params.IADT == NULL) || (params.IAFS == NULL) ||\n        (params.IADS == NULL) || (params.IAIT == NULL))\n    {\n        code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"couldn't allocate text region image data\");\n        goto cleanup3;\n    }\n\n\t/* Table 31 */\n\tfor (SBSYMCODELEN = 0; (1 << SBSYMCODELEN) < SBNUMSYMS; SBSYMCODELEN++);\n    params.IAID = jbig2_arith_iaid_ctx_new(ctx, SBSYMCODELEN);\n\tparams.IARI = jbig2_arith_int_ctx_new(ctx);\n\tparams.IARDW = jbig2_arith_int_ctx_new(ctx);\n\tparams.IARDH = jbig2_arith_int_ctx_new(ctx);\n\tparams.IARDX = jbig2_arith_int_ctx_new(ctx);\n\tparams.IARDY = jbig2_arith_int_ctx_new(ctx);\n    if ((params.IAID == NULL) || (params.IARI == NULL) ||\n        (params.IARDW == NULL) || (params.IARDH == NULL) ||\n        (params.IARDX == NULL) || (params.IARDY == NULL))\n    {\n        code = jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"couldn't allocate text region image data\");\n        goto cleanup4;\n    }\n    }\n\n    code = jbig2_decode_text_region(ctx, segment, &params,\n        (const Jbig2SymbolDict * const *)dicts, n_dicts, image,\n        segment_data + offset, segment->data_length - offset,\n\t\tGR_stats, as, ws);\n    if (code < 0)\n    {\n        jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n            \"failed to decode text region image data\");\n        goto cleanup4;\n    }\n\n    if ((segment->flags & 63) == 4) {\n        /* we have an intermediate region here. save it for later */\n        segment->result = jbig2_image_clone(ctx, image);\n    } else {\n        /* otherwise composite onto the page */\n        jbig2_error(ctx, JBIG2_SEVERITY_DEBUG, segment->number,\n            \"composing %dx%d decoded text region onto page at (%d, %d)\",\n            region_info.width, region_info.height, region_info.x, region_info.y);\n        jbig2_page_add_result(ctx, &ctx->pages[ctx->current_page], image,\n            region_info.x, region_info.y, region_info.op);\n    }\n\ncleanup4:\n    if (!params.SBHUFF) {\n        jbig2_arith_iaid_ctx_free(ctx, params.IAID);\n        jbig2_arith_int_ctx_free(ctx, params.IARI);\n        jbig2_arith_int_ctx_free(ctx, params.IARDW);\n        jbig2_arith_int_ctx_free(ctx, params.IARDH);\n        jbig2_arith_int_ctx_free(ctx, params.IARDX);\n        jbig2_arith_int_ctx_free(ctx, params.IARDY);\n    }\n\ncleanup3:\n    if (!params.SBHUFF) {\n        jbig2_arith_int_ctx_free(ctx, params.IADT);\n        jbig2_arith_int_ctx_free(ctx, params.IAFS);\n        jbig2_arith_int_ctx_free(ctx, params.IADS);\n        jbig2_arith_int_ctx_free(ctx, params.IAIT);\n    }\n    jbig2_free(ctx->allocator, as);\n    jbig2_word_stream_buf_free(ctx, ws);\n\ncleanup2:\n    jbig2_free(ctx->allocator, GR_stats);\n    jbig2_image_release(ctx, image);\n\ncleanup1:\n    if (params.SBHUFF) {\n        jbig2_release_huffman_table(ctx, params.SBHUFFFS);\n        jbig2_release_huffman_table(ctx, params.SBHUFFDS);\n        jbig2_release_huffman_table(ctx, params.SBHUFFDT);\n        jbig2_release_huffman_table(ctx, params.SBHUFFRDX);\n        jbig2_release_huffman_table(ctx, params.SBHUFFRDY);\n        jbig2_release_huffman_table(ctx, params.SBHUFFRDW);\n        jbig2_release_huffman_table(ctx, params.SBHUFFRDH);\n        jbig2_release_huffman_table(ctx, params.SBHUFFRSIZE);\n    }\n    jbig2_free(ctx->allocator, dicts);\n\n    return code;\n\ntoo_short:\n    return jbig2_error(ctx, JBIG2_SEVERITY_FATAL, segment->number,\n        \"Segment too short\");\n}\n"
  },
  {
    "path": "ext/jbig2dec/jbig2_text.h",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n/**\n * Headers for Text region handling\n **/\n\ntypedef enum {\n    JBIG2_CORNER_BOTTOMLEFT = 0,\n    JBIG2_CORNER_TOPLEFT = 1,\n    JBIG2_CORNER_BOTTOMRIGHT = 2,\n    JBIG2_CORNER_TOPRIGHT = 3\n} Jbig2RefCorner;\n\ntypedef struct {\n    bool SBHUFF;\n    bool SBREFINE;\n    bool SBDEFPIXEL;\n    Jbig2ComposeOp SBCOMBOP;\n    bool TRANSPOSED;\n    Jbig2RefCorner REFCORNER;\n    int SBDSOFFSET;\n    /* int SBW; */\n    /* int SBH; */\n    uint32_t SBNUMINSTANCES;\n    int LOGSBSTRIPS;\n    int SBSTRIPS;\n    /* int SBNUMSYMS; */\n    /* SBSYMCODES */\n    /* SBSYMCODELEN */\n    /* SBSYMS */\n    Jbig2HuffmanTable *SBHUFFFS;\n    Jbig2HuffmanTable *SBHUFFDS;\n    Jbig2HuffmanTable *SBHUFFDT;\n    Jbig2HuffmanTable *SBHUFFRDW;\n    Jbig2HuffmanTable *SBHUFFRDH;\n    Jbig2HuffmanTable *SBHUFFRDX;\n    Jbig2HuffmanTable *SBHUFFRDY;\n    Jbig2HuffmanTable *SBHUFFRSIZE;\n    Jbig2ArithIntCtx *IADT;\n    Jbig2ArithIntCtx *IAFS;\n    Jbig2ArithIntCtx *IADS;\n    Jbig2ArithIntCtx *IAIT;\n    Jbig2ArithIaidCtx *IAID;\n    Jbig2ArithIntCtx *IARI;\n    Jbig2ArithIntCtx *IARDW;\n    Jbig2ArithIntCtx *IARDH;\n    Jbig2ArithIntCtx *IARDX;\n    Jbig2ArithIntCtx *IARDY;\n    bool SBRTEMPLATE;\n    int8_t sbrat[4];\n} Jbig2TextRegionParams;\n\nint\njbig2_decode_text_region(Jbig2Ctx *ctx, Jbig2Segment *segment,\n                             const Jbig2TextRegionParams *params,\n                             const Jbig2SymbolDict * const *dicts, const int n_dicts,\n                             Jbig2Image *image,\n                             const byte *data, const size_t size,\n\t\t\t     Jbig2ArithCx *GR_stats,\n\t\t\t     Jbig2ArithState *as, Jbig2WordStream *ws);\n"
  },
  {
    "path": "ext/jbig2dec/jbig2dec.1",
    "content": ".TH jbig2dec 1 \"2014 Oct 31\" \"Version 0.12\" \"jbig2dec Manual\"\n\n.SH NAME\njbig2dec \\- File format converter specialized in JBIG2 decoding\n\n.SH SYNOPSIS\n.B jbig2dec\n.RI [ options ]\n.I file.jbig2\n.br\n.B jbig2dec\n.RI [ options ]\n.I global-stream page-stream\n\n.SH DESCRIPTION\nThe\n.B jbig2dec\ncommand converts JBIG2 files to png or pbm files.\n\nWhen passed a single\n.I file\nargument it is interpreted as a JBIG2 file stream, with either\nsequential or random-access organization.\n\nWhen passed two stream arguments, they are interpreted as the\nglobal and page-specific portions of an embedded organzation,\nas used in PDF. If a particular page references no global\nsegment stream, /dev/null can be passed for the\n.I global-stream\nargument to request the embedded parser.\n\n.SH OPTIONS\nThe options are as follows:\n.TP\n.BI -o \" file\"\nStore the decoded output in\n.IR file .\nDefaults to the input with a different extension.\nSet to \\fI-\\fR for standard output.\n.TP\n.BI -t \" type\"\nForce a particular output file format. Supported are \\fIpng\\fR and\n\\fIpbm\\fR.\n.TP\n.BR -d \" or \" --dump\nPrint the structure of the JBIG2 file rather than explicitly decoding it.\n.TP\n.BR --hash\nPrint a hash of the decoded document.\n.TP\n.BR -q \" or \" --quiet\nSuppress warnings and other diagnostic output.\n.TP\n.BR -v \" or \" --verbose\nReport additional information about the decoding process.\nPass just \\fB-v\\fR for information about the file as it's being decoded.\nThis is the same as \\fB--verbose=2\\fR.\nPass \\fB--verbose=3\\fR or higher for debugging information.\n.TP\n.BR --version\nShow program version information.\n.TP\n.BR -h \" or \" --help\nShow usage summary.\n\n.SH AUTHOR\njbig2-dev <jbig2-dev@ghostscript.com>\nThis manpage was initially written by Sebastian Rasmussen\n<sebras@hotmail.com> for jbig2dec and the Debian Project.\n\n"
  },
  {
    "path": "ext/jbig2dec/jbig2dec.c",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n\n#ifndef PACKAGE\n#define PACKAGE \"jbig2dec\"\n#endif\n#ifndef VERSION\n#define VERSION \"unknown-version\"\n#endif\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <stddef.h>\n#include <string.h>\n\n#ifdef HAVE_GETOPT_H\n# include <getopt.h>\n#else\n# include \"getopt.h\"\n#endif\n\n#include \"os_types.h\"\n#include \"sha1.h\"\n\n#include \"jbig2.h\"\n#include \"jbig2_priv.h\"\n#include \"jbig2_image.h\"\n\ntypedef enum {\n    usage,dump,render\n} jbig2dec_mode;\n\ntypedef enum {\n    jbig2dec_format_jbig2,\n    jbig2dec_format_pbm,\n    jbig2dec_format_png,\n    jbig2dec_format_none\n} jbig2dec_format;\n\ntypedef struct {\n\tjbig2dec_mode mode;\n\tint verbose, hash;\n        SHA1_CTX *hash_ctx;\n\tchar *output_file;\n\tjbig2dec_format output_format;\n} jbig2dec_params_t;\n\nstatic int print_version(void);\nstatic int print_usage(void);\n\n/* page hashing functions */\nstatic void\nhash_init(jbig2dec_params_t *params)\n{\n    params->hash_ctx = (SHA1_CTX*)malloc(sizeof(SHA1_CTX));\n    if (params->hash_ctx == NULL) {\n        fprintf(stderr, \"unable to allocate hash state\\n\");\n        params->hash = 0;\n        return;\n    } else {\n        SHA1_Init(params->hash_ctx);\n    }\n}\n\nstatic void\nhash_image(jbig2dec_params_t *params, Jbig2Image *image)\n{\n    unsigned int N = image->stride * image->height;\n    SHA1_Update(params->hash_ctx, image->data, N);\n}\n\nstatic void\nhash_print(jbig2dec_params_t *params, FILE *out)\n{\n    unsigned char md[SHA1_DIGEST_SIZE];\n    char digest[2*SHA1_DIGEST_SIZE + 1];\n    int i;\n\n    SHA1_Final(params->hash_ctx, md);\n    for (i = 0; i < SHA1_DIGEST_SIZE; i++) {\n        snprintf(&(digest[2*i]), 3, \"%02x\", md[i]);\n    }\n    fprintf(out, \"%s\", digest);\n}\n\nstatic void\nhash_free(jbig2dec_params_t *params)\n{\n    free(params->hash_ctx);\n    params->hash_ctx = NULL;\n}\n\nstatic int\nset_output_format(jbig2dec_params_t *params, const char *format)\n{\n#ifdef HAVE_LIBPNG\n    /* this should really by strncasecmp()\n       TODO: we need to provide our own for portability */\n    if (!strncmp(format, \"png\", 3) || !strncmp(format, \"PNG\", 3)) {\n\tparams->output_format=jbig2dec_format_png;\n    \treturn 0;\n    }\n#endif\n    /* default to pbm */\n    params->output_format=jbig2dec_format_pbm;\n\n    return 0;\n}\n\nstatic int\nparse_options(int argc, char *argv[], jbig2dec_params_t *params)\n{\n\tstatic struct option long_options[] = {\n                {\"version\", 0, NULL, 'V'},\n\t\t{\"help\", 0, NULL, 'h'},\n                {\"quiet\", 0, NULL, 'q'},\n\t\t{\"verbose\", 2, NULL, 'v'},\n\t\t{\"dump\", 0, NULL, 'd'},\n                {\"hash\", 0, NULL, 'm'},\n\t\t{\"output\", 1, NULL, 'o'},\n                {\"format\", 1, NULL, 't'},\n\t\t{NULL, 0, NULL, 0}\n\t};\n\tint option_idx = 1;\n\tint option;\n\n\twhile (1) {\n\t\toption = getopt_long(argc, argv,\n\t\t\t\"Vh?qv:do:t:\", long_options, &option_idx);\n\t\tif (option == -1) break;\n\n\t\tswitch (option) {\n\t\t\tcase 0:\t/* unknown long option */\n\t\t\t\tif (!params->verbose) fprintf(stdout,\n\t\t\t\t\t\"unrecognized option: --%s\\n\",\n\t\t\t\t\tlong_options[option_idx].name);\n\t\t\t\t\tbreak;\n\t\t\tcase 'q':\n\t\t\t\tparams->verbose = 0;\n\t\t\t\tbreak;\n                        case 'v':\n                                if (optarg) params->verbose = atoi(optarg);\n                                else params->verbose = 2;\n                                break;\n\t\t\tcase 'h':\n\t\t\tcase '?':\n\t\t\t\tparams->mode = usage;\n                                break;\n                        case 'V':\n                                /* the GNU Coding Standards suggest --version\n                                   should override all other options */\n                                print_version();\n                                exit(0);\n                                break;\n\t\t\tcase 'd':\n\t\t\t\tparams->mode=dump;\n\t\t\t\tbreak;\n                        case 'm':\n                                params->hash = 1;\n                                break;\n\t\t\tcase 'o':\n\t\t\t\tparams->output_file = strdup(optarg);\n\t\t\t\tbreak;\n                        case 't':\n                        \tset_output_format(params, optarg);\n                                break;\n\t\t\tdefault:\n\t\t\t\tif (!params->verbose) fprintf(stdout,\n\t\t\t\t\t\"unrecognized option: -%c\\n\", option);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\treturn (optind);\n}\n\nstatic int\nprint_version (void)\n{\n    fprintf(stdout, \"%s %s\\n\", PACKAGE, VERSION);\n    return 0;\n}\n\nstatic int\nprint_usage (void)\n{\n  fprintf(stderr,\n    \"Usage: jbig2dec [options] <file.jbig2>\\n\"\n    \"   or  jbig2dec [options] <global_stream> <page_stream>\\n\"\n    \"\\n\"\n    \"  When invoked with a single file, it attempts to parse it as\\n\"\n    \"  a normal jbig2 file. Invoked with two files, it treats the\\n\"\n    \"  first as the global segments, and the second as the segment\\n\"\n    \"  stream for a particular page. This is useful for examining\\n\"\n    \"  embedded streams.\\n\"\n    \"\\n\"\n    \"  available options:\\n\"\n    \"    -h --help      this usage summary\\n\"\n    \"    -q --quiet     suppress diagnostic output\\n\"\n    \"    -v --verbose   set the verbosity level\\n\"\n    \"    -d --dump      print the structure of the jbig2 file\\n\"\n    \"                   rather than explicitly decoding\\n\"\n    \"       --version   program name and version information\\n\"\n    \"       --hash      print a hash of the decoded document\\n\"\n    \"    -o <file>      send decoded output to <file>\\n\"\n    \"                   Defaults to the the input with a different\\n\"\n    \"                   extension. Pass '-' for stdout.\\n\"\n    \"    -t <type>      force a particular output file format\\n\"\n #ifdef HAVE_LIBPNG\n    \"                   supported options are 'png' and 'pbm'\\n\"\n #else\n    \"                   the only supported option is 'pbm'\\n\"\n #endif\n    \"\\n\"\n  );\n\n  return 1;\n}\n\nstatic int\nerror_callback(void *error_callback_data, const char *buf, Jbig2Severity severity,\n\t       int32_t seg_idx)\n{\n    const jbig2dec_params_t *params = (jbig2dec_params_t *)error_callback_data;\n    char *type;\n    char segment[22];\n\n    switch (severity) {\n        case JBIG2_SEVERITY_DEBUG:\n            if (params->verbose < 3) return 0;\n            type = \"DEBUG\"; break;;\n        case JBIG2_SEVERITY_INFO:\n            if (params->verbose < 2) return 0;\n            type = \"info\"; break;;\n        case JBIG2_SEVERITY_WARNING:\n            if (params->verbose < 1) return 0;\n            type = \"WARNING\"; break;;\n        case JBIG2_SEVERITY_FATAL: type = \"FATAL ERROR\"; break;;\n        default: type = \"unknown message\"; break;;\n    }\n    if (seg_idx == -1) segment[0] = '\\0';\n    else snprintf(segment, sizeof(segment), \"(segment 0x%02x)\", seg_idx);\n\n    fprintf(stderr, \"jbig2dec %s %s %s\\n\", type, buf, segment);\n\n    return 0;\n}\n\nstatic char *\nmake_output_filename(const char *input_filename, const char *extension)\n{\n    char *output_filename;\n    const char *c, *e;\n    int len;\n\n    if (extension == NULL) {\n        fprintf(stderr, \"make_output_filename called with no extension!\\n\");\n        exit (1);\n    }\n\n    if (input_filename == NULL)\n      c = \"out\";\n    else {\n      /* strip any leading path */\n      c = strrchr(input_filename, '/'); /* *nix */\n      if (c == NULL)\n        c = strrchr(input_filename, '\\\\'); /* win32/dos */\n      if (c != NULL)\n        c++; /* skip the path separator */\n      else\n        c = input_filename; /* no leading path */\n    }\n\n    /* make sure we haven't just stripped the last character */\n    if (*c == '\\0')\n      c = \"out\";\n\n    /* strip the extension */\n    len = strlen(c);\n    e = strrchr(c, '.');\n    if (e != NULL)\n      len -= strlen(e);\n\n    /* allocate enough space for the base + ext */\n    output_filename = (char*)malloc(len + strlen(extension) + 1);\n    if (output_filename == NULL) {\n        fprintf(stderr, \"couldn't allocate memory for output_filename\\n\");\n        exit (1);\n    }\n\n    strncpy(output_filename, c, len);\n    strncpy(output_filename + len, extension, strlen(extension));\n    *(output_filename + len + strlen(extension)) = '\\0';\n\n    /* return the new string */\n    return (output_filename);\n}\n\nstatic int\nwrite_page_image(jbig2dec_params_t *params, Jbig2Image *image)\n{\n      if (!strncmp(params->output_file, \"-\", 2))\n        {\n\t  switch (params->output_format) {\n#ifdef HAVE_LIBPNG\n            case jbig2dec_format_png:\n              jbig2_image_write_png(image, stdout);\n              break;\n#endif\n            case jbig2dec_format_pbm:\n              jbig2_image_write_pbm(image, stdout);\n              break;\n            default:\n              fprintf(stderr, \"unsupported output format.\\n\");\n              return 1;\n          }\n        }\n      else\n        {\n          if (params->verbose > 1)\n            fprintf(stderr, \"saving decoded page as '%s'\\n\", params->output_file);\n          switch (params->output_format) {\n#ifdef HAVE_LIBPNG\n            case jbig2dec_format_png:\n              jbig2_image_write_png_file(image, params->output_file);\n              break;\n#endif\n            case jbig2dec_format_pbm:\n              jbig2_image_write_pbm_file(image, params->output_file);\n              break;\n            default:\n              fprintf(stderr, \"unsupported output format.\\n\");\n              return 1;\n          }\n        }\n\n  return 0;\n}\n\nstatic int\nwrite_document_hash(jbig2dec_params_t *params)\n{\n    FILE *out;\n\n    if (!strncmp(params->output_file, \"-\", 2)) {\n        out = stderr;\n    } else {\n        out = stdout;\n    }\n\n    fprintf(out, \"Hash of decoded document: \");\n    hash_print(params, out);\n    fprintf(out, \"\\n\");\n\n    return 0;\n}\n\nint\nmain (int argc, char **argv)\n{\n  FILE *f = NULL, *f_page = NULL;\n  Jbig2Ctx *ctx;\n  uint8_t buf[4096];\n  jbig2dec_params_t params;\n  int filearg;\n\n  /* set defaults */\n  params.mode = render;\n  params.verbose = 1;\n  params.hash = 0;\n  params.output_file = NULL;\n  params.output_format = jbig2dec_format_none;\n\n  filearg = parse_options(argc, argv, &params);\n\n  if (params.hash) hash_init(&params);\n\n  switch (params.mode) {\n    case usage:\n        print_usage();\n        exit (0);\n        break;\n    case dump:\n        fprintf(stderr, \"Sorry, segment dump not yet implemented\\n\");\n        break;\n    case render:\n\n  if ((argc - filearg) == 1)\n  /* only one argument--open as a jbig2 file */\n    {\n      char *fn = argv[filearg];\n\n      f = fopen(fn, \"rb\");\n      if (f == NULL)\n\t{\n\t  fprintf(stderr, \"error opening %s\\n\", fn);\n\t  return 1;\n\t}\n    }\n  else if ((argc - filearg) == 2)\n  /* two arguments open as separate global and page streams */\n    {\n      char *fn = argv[filearg];\n      char *fn_page = argv[filearg+1];\n\n      f = fopen(fn, \"rb\");\n      if (f == NULL)\n\t{\n\t  fprintf(stderr, \"error opening %s\\n\", fn);\n\t  return 1;\n\t}\n\n      f_page = fopen(fn_page, \"rb\");\n      if (f_page == NULL)\n\t{\n\t  fprintf(stderr, \"error opening %s\\n\", fn_page);\n\t  return 1;\n\t}\n    }\n  else\n  /* any other number of arguments */\n    return print_usage();\n\n  ctx = jbig2_ctx_new(NULL, (Jbig2Options)(f_page != NULL ? JBIG2_OPTIONS_EMBEDDED : 0),\n\t\t      NULL,\n\t\t      error_callback, &params);\n\n  /* pull the whole file/global stream into memory */\n  for (;;)\n    {\n      int n_bytes = fread(buf, 1, sizeof(buf), f);\n      if (n_bytes <= 0)\n\tbreak;\n      if (jbig2_data_in(ctx, buf, n_bytes))\n\tbreak;\n    }\n  fclose(f);\n\n  /* if there's a local page stream read that in its entirety */\n  if (f_page != NULL)\n    {\n      Jbig2GlobalCtx *global_ctx = jbig2_make_global_ctx(ctx);\n      ctx = jbig2_ctx_new(NULL, JBIG2_OPTIONS_EMBEDDED, global_ctx,\n\t\t\t error_callback, &params);\n      for (;;)\n\t{\n\t  int n_bytes = fread(buf, 1, sizeof(buf), f_page);\n\t  if (n_bytes <= 0)\n\t    break;\n\t  if (jbig2_data_in(ctx, buf, n_bytes))\n\t    break;\n\t}\n      fclose(f_page);\n      jbig2_global_ctx_free(global_ctx);\n    }\n\n  /* retrieve and output the returned pages */\n  {\n    Jbig2Image *image;\n\n    /* work around broken CVision embedded streams */\n    if (f_page != NULL)\n      jbig2_complete_page(ctx);\n\n    if (params.output_file == NULL)\n      {\n#ifdef HAVE_LIBPNG\n        params.output_file = make_output_filename(argv[filearg], \".png\");\n        params.output_format = jbig2dec_format_png;\n#else\n        params.output_file = make_output_filename(argv[filearg], \".pbm\");\n        params.output_format = jbig2dec_format_pbm;\n#endif\n      } else {\n        int len = strlen(params.output_file);\n        if ((len >= 3) && (params.output_format == jbig2dec_format_none))\n          /* try to set the output type by the given extension */\n          set_output_format(&params, params.output_file + len - 3);\n      }\n\n    /* retrieve and write out all the completed pages */\n    while ((image = jbig2_page_out(ctx)) != NULL) {\n      write_page_image(&params, image);\n      if (params.hash) hash_image(&params, image);\n      jbig2_release_page(ctx, image);\n    }\n    if (params.hash) write_document_hash(&params);\n  }\n\n  jbig2_ctx_free(ctx);\n\n  } /* end params.mode switch */\n\n  if (params.output_file) free(params.output_file);\n  if (params.hash) hash_free(&params);\n\n  /* fin */\n  return 0;\n}\n"
  },
  {
    "path": "ext/jbig2dec/memcmp.c",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n\n#include <stddef.h>\n\n/* replacement for broken memcmp() */\n\n/*\n * compares two byte strings 'a' and 'b', both assumed to be 'len' bytes long\n * returns zero if the two strings are identical, otherwise returns -1 or 1\n * depending on the relative magnitude of the first differing elements,\n * considered as unsigned chars\n */\n\nint memcmp(const void *b1, const void *b2, size_t len)\n{\n\tunsigned char *a, *b;\n\tsize_t i;\n\n\ta = (unsigned char *)b1;\n\tb = (unsigned char *)b2;\n\tfor(i = 0; i < len; i++) {\n\t\tif (*a != *b) {\n\t\t\t /* strings differ */\n\t\t\treturn (*a < *b) ? -1 : 1;\n\t\t}\n\t\ta++;\n\t\tb++;\n\t}\n\n\t/* strings match */\n\treturn 0;\n}\n"
  },
  {
    "path": "ext/jbig2dec/memento.c",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n\n/* Inspired by Fortify by Simon P Bullen. */\n\n\n/* Set the following if you're only looking for leaks, not memory overwrites\n * to speed the operation */\n/* #define MEMENTO_LEAKONLY */\n\n#ifndef MEMENTO_STACKTRACE_METHOD\n#ifdef __GNUC__\n#define MEMENTO_STACKTRACE_METHOD 1\n#endif\n#endif\n\n/* Don't keep blocks around if they'd mean losing more than a quarter of\n * the freelist. */\n#define MEMENTO_FREELIST_MAX_SINGLE_BLOCK (MEMENTO_FREELIST_MAX/4)\n\n#define COMPILING_MEMENTO_C\n\n#ifdef MEMENTO_GS_HACKS\n/* For GS we include malloc_.h. Anyone else would just include memento.h */\n#include \"malloc_.h\"\n#ifdef __MACH__\n#include <string.h>\n#else\n#ifndef memset\nvoid *memset(void *,int,size_t);\n#endif\n#endif\nint atexit(void (*)(void));\n#else\n#include \"memento.h\"\n#include <stdio.h>\n#include <stdlib.h>\n#endif\n\n#if defined(__linux__)\n#define MEMENTO_HAS_FORK\n#elif defined(__APPLE__) && defined(__MACH__)\n#define MEMENTO_HAS_FORK\n#endif\n\n/* Define the underlying allocators, just in case */\nvoid *MEMENTO_UNDERLYING_MALLOC(size_t);\nvoid MEMENTO_UNDERLYING_FREE(void *);\nvoid *MEMENTO_UNDERLYING_REALLOC(void *,size_t);\nvoid *MEMENTO_UNDERLYING_CALLOC(size_t,size_t);\n\n/* And some other standard functions we use. We don't include the header\n * files, just in case they pull in unexpected others. */\nint atoi(const char *);\nchar *getenv(const char *);\n\n/* How far to search for pointers in each block when calculating nestings */\n/* mupdf needs at least 34000ish (sizeof(fz_shade))/ */\n#define MEMENTO_PTRSEARCH 65536\n\n#ifndef MEMENTO_MAXPATTERN\n#define MEMENTO_MAXPATTERN 0\n#endif\n\n#ifdef MEMENTO\n\n#ifdef MEMENTO_GS_HACKS\n#include \"valgrind.h\"\n#else\n#ifdef HAVE_VALGRIND\n#include \"valgrind/memcheck.h\"\n#else\n#define VALGRIND_MAKE_MEM_NOACCESS(p,s)  do { } while (0==1)\n#define VALGRIND_MAKE_MEM_UNDEFINED(p,s)  do { } while (0==1)\n#define VALGRIND_MAKE_MEM_DEFINED(p,s)  do { } while (0==1)\n#endif\n#endif\n\nenum {\n    Memento_PreSize  = 16,\n    Memento_PostSize = 16\n};\n\nenum {\n    Memento_Flag_OldBlock = 1,\n    Memento_Flag_HasParent = 2,\n    Memento_Flag_BreakOnFree = 4,\n    Memento_Flag_BreakOnRealloc = 8\n};\n\n/* When we list leaked blocks at the end of execution, we search for pointers\n * between blocks in order to be able to give a nice nested view.\n * Unfortunately, if you have are running your own allocator (such as\n * ghostscripts chunk allocator) you can often find that the header of the\n * block always contains pointers to next or previous blocks. This tends to\n * mean the nesting displayed is \"uninteresting\" at best :)\n *\n * As a hack to get around this, we have a define MEMENTO_SKIP_SEARCH that\n * indicates how many bytes to skip over at the start of the chunk.\n * This may cause us to miss true nestings, but such is life...\n */ \n#ifndef MEMENTO_SEARCH_SKIP\n#ifdef MEMENTO_GS_HACKS\n#define MEMENTO_SEARCH_SKIP (2*sizeof(void *))\n#else\n#define MEMENTO_SEARCH_SKIP 0\n#endif\n#endif\n\ntypedef struct Memento_BlkHeader Memento_BlkHeader;\n\nstruct Memento_BlkHeader\n{\n    size_t             rawsize;\n    int                sequence;\n    int                lastCheckedOK;\n    int                flags;\n    Memento_BlkHeader *next;\n    Memento_BlkHeader *parent; /* Only used while printing out nested list */\n\n    const char        *label;\n\n    /* Entries for nesting display calculations */\n    Memento_BlkHeader *child;\n    Memento_BlkHeader *sibling;\n\n    char               preblk[Memento_PreSize];\n};\n\n/* In future this could (should) be a smarter data structure, like, say,\n * splay trees. For now, we use a list.\n */\ntypedef struct Memento_Blocks\n{\n    Memento_BlkHeader  *head;\n    Memento_BlkHeader **tail;\n} Memento_Blocks;\n\n/* And our global structure */\nstatic struct {\n    int            inited;\n    Memento_Blocks used;\n    Memento_Blocks free;\n    size_t         freeListSize;\n    int            sequence;\n    int            paranoia;\n    int            paranoidAt;\n    int            countdown;\n    int            lastChecked;\n    int            breakAt;\n    int            failAt;\n    int            failing;\n    int            nextFailAt;\n    int            squeezeAt;\n    int            squeezing;\n    int            segv;\n    int            pattern;\n    int            nextPattern;\n    int            patternBit;\n    size_t         maxMemory;\n    size_t         alloc;\n    size_t         peakAlloc;\n    size_t         totalAlloc;\n    size_t         numMallocs;\n    size_t         numFrees;\n    size_t         numReallocs;\n} globals;\n\n#define MEMENTO_EXTRASIZE (sizeof(Memento_BlkHeader) + Memento_PostSize)\n\n/* Round up size S to the next multiple of N (where N is a power of 2) */\n#define MEMENTO_ROUNDUP(S,N) ((S + N-1)&~(N-1))\n\n#define MEMBLK_SIZE(s) MEMENTO_ROUNDUP(s + MEMENTO_EXTRASIZE, MEMENTO_MAXALIGN)\n\n#define MEMBLK_FROMBLK(B)   (&((Memento_BlkHeader*)(void *)(B))[-1])\n#define MEMBLK_TOBLK(B)     ((void*)(&((Memento_BlkHeader*)(void*)(B))[1]))\n#define MEMBLK_POSTPTR(B) \\\n          (&((char *)(void *)(B))[(B)->rawsize + sizeof(Memento_BlkHeader)])\n\nvoid Memento_breakpoint(void)\n{\n    /* A handy externally visible function for breakpointing */\n#if 0 /* Enable this to force automatic breakpointing */\n#ifdef DEBUG\n#ifdef _MSC_VER\n    __asm int 3;\n#endif\n#endif\n#endif\n}\n\nstatic void Memento_addBlockHead(Memento_Blocks    *blks,\n                                 Memento_BlkHeader *b,\n                                 int                type)\n{\n    if (blks->tail == &blks->head) {\n        /* Adding into an empty list, means the tail changes too */\n        blks->tail = &b->next;\n    }\n    b->next    = blks->head;\n    blks->head = b;\n#ifndef MEMENTO_LEAKONLY\n    memset(b->preblk, MEMENTO_PREFILL, Memento_PreSize);\n    memset(MEMBLK_POSTPTR(b), MEMENTO_POSTFILL, Memento_PostSize);\n#endif\n    VALGRIND_MAKE_MEM_NOACCESS(MEMBLK_POSTPTR(b), Memento_PostSize);\n    if (type == 0) { /* malloc */\n        VALGRIND_MAKE_MEM_UNDEFINED(MEMBLK_TOBLK(b), b->rawsize);\n    } else if (type == 1) { /* free */\n        VALGRIND_MAKE_MEM_NOACCESS(MEMBLK_TOBLK(b), b->rawsize);\n    }\n    VALGRIND_MAKE_MEM_NOACCESS(b, sizeof(Memento_BlkHeader));\n}\n\nstatic void Memento_addBlockTail(Memento_Blocks    *blks,\n                                 Memento_BlkHeader *b,\n                                 int                type)\n{\n    VALGRIND_MAKE_MEM_DEFINED(blks->tail, sizeof(Memento_BlkHeader *));\n    *blks->tail = b;\n    blks->tail  = &b->next;\n    b->next = NULL;\n    VALGRIND_MAKE_MEM_NOACCESS(blks->tail, sizeof(Memento_BlkHeader *));\n#ifndef MEMENTO_LEAKONLY\n    memset(b->preblk, MEMENTO_PREFILL, Memento_PreSize);\n    memset(MEMBLK_POSTPTR(b), MEMENTO_POSTFILL, Memento_PostSize);\n#endif\n    VALGRIND_MAKE_MEM_NOACCESS(MEMBLK_POSTPTR(b), Memento_PostSize);\n    if (type == 0) { /* malloc */\n        VALGRIND_MAKE_MEM_UNDEFINED(MEMBLK_TOBLK(b), b->rawsize);\n    } else if (type == 1) { /* free */\n        VALGRIND_MAKE_MEM_NOACCESS(MEMBLK_TOBLK(b), b->rawsize);\n    }\n    VALGRIND_MAKE_MEM_NOACCESS(b, sizeof(Memento_BlkHeader));\n}\n\ntypedef struct BlkCheckData {\n    int found;\n    int preCorrupt;\n    int postCorrupt;\n    int freeCorrupt;\n    int index;\n} BlkCheckData;\n\nstatic int Memento_Internal_checkAllocedBlock(Memento_BlkHeader *b, void *arg)\n{\n#ifndef MEMENTO_LEAKONLY\n    int           i;\n    char         *p;\n    int           corrupt = 0;\n    BlkCheckData *data = (BlkCheckData *)arg;\n\n    p = b->preblk;\n    i = Memento_PreSize;\n    do {\n        corrupt |= (*p++ ^ (char)MEMENTO_PREFILL);\n    } while (--i);\n    if (corrupt) {\n        data->preCorrupt = 1;\n    }\n    p = MEMBLK_POSTPTR(b);\n    i = Memento_PreSize;\n    do {\n        corrupt |= (*p++ ^ (char)MEMENTO_POSTFILL);\n    } while (--i);\n    if (corrupt) {\n        data->postCorrupt = 1;\n    }\n    if ((data->freeCorrupt | data->preCorrupt | data->postCorrupt) == 0) {\n        b->lastCheckedOK = globals.sequence;\n    }\n    data->found |= 1;\n#endif\n    return 0;\n}\n\nstatic int Memento_Internal_checkFreedBlock(Memento_BlkHeader *b, void *arg)\n{\n#ifndef MEMENTO_LEAKONLY\n    int           i;\n    char         *p;\n    BlkCheckData *data = (BlkCheckData *)arg;\n\n    p = MEMBLK_TOBLK(b);\n    i = b->rawsize;\n    /* Attempt to speed this up by checking an (aligned) int at a time */\n    do {\n        if (((size_t)p) & 1) {\n            if (*p++ != (char)MEMENTO_FREEFILL)\n                break;\n            i--;\n            if (i == 0)\n                break;\n        }\n        if ((i >= 2) && (((size_t)p) & 2)) {\n            if (*(short *)p != (short)(MEMENTO_FREEFILL | (MEMENTO_FREEFILL<<8)))\n                goto mismatch;\n            p += 2;\n            i -= 2;\n            if (i == 0)\n                break;\n        }\n        i -= 4;\n        while (i >= 0) {\n            if (*(int *)p != (MEMENTO_FREEFILL |\n                              (MEMENTO_FREEFILL<<8) |\n                              (MEMENTO_FREEFILL<<16) |\n                              (MEMENTO_FREEFILL<<24)))\n                goto mismatch;\n            p += 4;\n            i -= 4;\n        }\n        i += 4;\n        if ((i >= 2) && (((size_t)p) & 2)) {\n            if (*(short *)p != (short)(MEMENTO_FREEFILL | (MEMENTO_FREEFILL<<8)))\n                goto mismatch;\n            p += 2;\n            i -= 2;\n        }\nmismatch:\n        while (i) {\n            if (*p++ != (char)MEMENTO_FREEFILL)\n                break;\n            i--;\n        }\n    } while (0);\n    if (i) {\n        data->freeCorrupt = 1;\n        data->index       = b->rawsize-i;\n    }\n    return Memento_Internal_checkAllocedBlock(b, arg);\n#else\n    return 0;\n#endif\n}\n\nstatic void Memento_removeBlock(Memento_Blocks    *blks,\n                                Memento_BlkHeader *b)\n{\n    Memento_BlkHeader *head = blks->head;\n    Memento_BlkHeader *prev = NULL;\n    while ((head) && (head != b)) {\n        VALGRIND_MAKE_MEM_DEFINED(head, sizeof(*head));\n        prev = head;\n        head = head->next;\n        VALGRIND_MAKE_MEM_NOACCESS(prev, sizeof(*prev));\n    }\n    if (head == NULL) {\n        /* FAIL! Will have been reported to user earlier, so just exit. */\n        return;\n    }\n    VALGRIND_MAKE_MEM_DEFINED(blks->tail, sizeof(*blks->tail));\n    if (*blks->tail == head) {\n        /* Removing the tail of the list */\n        if (prev == NULL) {\n            /* Which is also the head */\n            blks->tail = &blks->head;\n        } else {\n            /* Which isn't the head */\n            blks->tail = &prev->next;\n        }\n    }\n    if (prev == NULL) {\n        /* Removing from the head of the list */\n        VALGRIND_MAKE_MEM_DEFINED(head, sizeof(*head));\n        blks->head = head->next;\n        VALGRIND_MAKE_MEM_NOACCESS(head, sizeof(*head));\n    } else {\n        /* Removing from not-the-head */\n        VALGRIND_MAKE_MEM_DEFINED(head, sizeof(*head));\n        VALGRIND_MAKE_MEM_DEFINED(prev, sizeof(*prev));\n        prev->next = head->next;\n        VALGRIND_MAKE_MEM_NOACCESS(head, sizeof(*head));\n        VALGRIND_MAKE_MEM_NOACCESS(prev, sizeof(*prev));\n    }\n}\n\nstatic int Memento_Internal_makeSpace(size_t space)\n{\n    /* If too big, it can never go on the freelist */\n    if (space > MEMENTO_FREELIST_MAX_SINGLE_BLOCK)\n        return 0;\n    /* Pretend we added it on. */\n    globals.freeListSize += space;\n    /* Ditch blocks until it fits within our limit */\n    while (globals.freeListSize > MEMENTO_FREELIST_MAX) {\n        Memento_BlkHeader *head = globals.free.head;\n        VALGRIND_MAKE_MEM_DEFINED(head, sizeof(*head));\n        globals.free.head = head->next;\n        globals.freeListSize -= MEMBLK_SIZE(head->rawsize);\n        MEMENTO_UNDERLYING_FREE(head);\n    }\n    /* Make sure we haven't just completely emptied the free list */\n    /* (This should never happen, but belt and braces... */\n    if (globals.free.head == NULL)\n        globals.free.tail = &globals.free.head;\n    return 1;\n}\n\nstatic int Memento_appBlocks(Memento_Blocks *blks,\n                             int             (*app)(Memento_BlkHeader *,\n                                                    void *),\n                             void           *arg)\n{\n    Memento_BlkHeader *head = blks->head;\n    Memento_BlkHeader *next;\n    int                result;\n    while (head) {\n        VALGRIND_MAKE_MEM_DEFINED(head, sizeof(Memento_BlkHeader));\n        VALGRIND_MAKE_MEM_DEFINED(MEMBLK_TOBLK(head),\n                                  head->rawsize + Memento_PostSize);\n        result = app(head, arg);\n        next = head->next;\n        VALGRIND_MAKE_MEM_NOACCESS(MEMBLK_POSTPTR(head), Memento_PostSize);\n        VALGRIND_MAKE_MEM_NOACCESS(head, sizeof(Memento_BlkHeader));\n        if (result)\n            return result;\n        head = next;\n    }\n    return 0;\n}\n\nstatic int Memento_appBlock(Memento_Blocks    *blks,\n                            int                (*app)(Memento_BlkHeader *,\n                                                      void *),\n                            void              *arg,\n                            Memento_BlkHeader *b)\n{\n    Memento_BlkHeader *head = blks->head;\n    Memento_BlkHeader *next;\n    int                result;\n    while (head && head != b) {\n        VALGRIND_MAKE_MEM_DEFINED(head, sizeof(Memento_BlkHeader));\n        next = head->next;\n        VALGRIND_MAKE_MEM_NOACCESS(MEMBLK_POSTPTR(head), Memento_PostSize);\n        head = next;\n    }\n    if (head == b) {\n        VALGRIND_MAKE_MEM_DEFINED(head, sizeof(Memento_BlkHeader));\n        VALGRIND_MAKE_MEM_DEFINED(MEMBLK_TOBLK(head),\n                                  head->rawsize + Memento_PostSize);\n        result = app(head, arg);\n        VALGRIND_MAKE_MEM_NOACCESS(MEMBLK_POSTPTR(head), Memento_PostSize);\n        VALGRIND_MAKE_MEM_NOACCESS(head, sizeof(Memento_BlkHeader));\n        return result;\n    }\n    return 0;\n}\n\nstatic void showBlock(Memento_BlkHeader *b, int space)\n{\n    fprintf(stderr, \"0x%p:(size=%d,num=%d)\",\n            MEMBLK_TOBLK(b), (int)b->rawsize, b->sequence);\n    if (b->label)\n        fprintf(stderr, \"%c(%s)\", space, b->label);\n}\n\nstatic void blockDisplay(Memento_BlkHeader *b, int n)\n{\n    n++;\n    while(n > 0)\n    {\n        int i = n;\n        if (i > 32)\n            i = 32;\n        n -= i;\n        fprintf(stderr, \"%s\", &\"                                \"[32-i]);\n    }\n    showBlock(b, '\\t');\n    fprintf(stderr, \"\\n\");\n}\n\nstatic int Memento_listBlock(Memento_BlkHeader *b,\n                             void              *arg)\n{\n    int *counts = (int *)arg;\n    blockDisplay(b, 0);\n    counts[0]++;\n    counts[1]+= b->rawsize;\n    return 0;\n}\n\nstatic void doNestedDisplay(Memento_BlkHeader *b,\n                            int depth)\n{\n    blockDisplay(b, depth);\n    for (b = b->child; b; b = b->sibling)\n        doNestedDisplay(b, depth+1);\n}\n\nstatic int ptrcmp(const void *a_, const void *b_)\n{\n    const char **a = (const char **)a_;\n    const char **b = (const char **)b_;\n    return (int)(*a-*b);\n}\n\nstatic\nint Memento_listBlocksNested(void)\n{\n    int count, size, i;\n    Memento_BlkHeader *b;\n    void **blocks, *minptr, *maxptr;\n    long mask;\n\n    /* Count the blocks */\n    count = 0;\n    size = 0;\n    for (b = globals.used.head; b; b = b->next) {\n        size += b->rawsize;\n        count++;\n    }\n\n    /* Make our block list */\n    blocks = MEMENTO_UNDERLYING_MALLOC(sizeof(void *) * count);\n    if (blocks == NULL)\n        return 1;\n\n    /* Populate our block list */\n    b = globals.used.head;\n    minptr = maxptr = MEMBLK_TOBLK(b);\n    mask = (long)minptr;\n    for (i = 0; b; b = b->next, i++) {\n        void *p = MEMBLK_TOBLK(b);\n        mask &= (long)p;\n        if (p < minptr)\n            minptr = p;\n        if (p > maxptr)\n            maxptr = p;\n        blocks[i] = p;\n        b->flags &= ~Memento_Flag_HasParent;\n        b->child   = NULL;\n        b->sibling = NULL;\n        b->parent  = NULL;\n    }\n    qsort(blocks, count, sizeof(void *), ptrcmp);\n\n    /* Now, calculate tree */\n    for (b = globals.used.head; b; b = b->next) {\n        char *p = MEMBLK_TOBLK(b);\n        int end = (b->rawsize < MEMENTO_PTRSEARCH ? b->rawsize : MEMENTO_PTRSEARCH);\n        for (i = MEMENTO_SEARCH_SKIP; i < end; i += sizeof(void *)) {\n            void *q = *(void **)(&p[i]);\n            void **r;\n\n            /* Do trivial checks on pointer */\n            if ((mask & (int)q) != mask || q < minptr || q > maxptr)\n                continue;\n\n            /* Search for pointer */\n            r = bsearch(&q, blocks, count, sizeof(void *), ptrcmp);\n            if (r) {\n                /* Found child */\n                Memento_BlkHeader *child = MEMBLK_FROMBLK(*r);\n                Memento_BlkHeader *parent;\n\n                /* We're assuming tree structure, not graph - ignore second\n                 * and subsequent pointers. */\n                if (child->parent != NULL)\n                    continue;\n                if (child->flags & Memento_Flag_HasParent)\n                    continue;\n\n                /* We're also assuming acyclicness here. If this is one of\n                 * our parents, ignore it. */\n                parent = b->parent;\n                while (parent != NULL && parent != child)\n                    parent = parent->parent;\n                if (parent == child)\n                    continue;\n\n                child->sibling = b->child;\n                b->child = child;\n                child->parent = b;\n                child->flags |= Memento_Flag_HasParent;\n            }\n        }\n    }\n\n    /* Now display with nesting */\n    for (b = globals.used.head; b; b = b->next) {\n        if ((b->flags & Memento_Flag_HasParent) == 0)\n            doNestedDisplay(b, 0);\n    }\n    fprintf(stderr, \" Total number of blocks = %d\\n\", count);\n    fprintf(stderr, \" Total size of blocks = %d\\n\", size);\n\n    MEMENTO_UNDERLYING_FREE(blocks);\n    return 0;\n}\n\nvoid Memento_listBlocks(void)\n{\n    fprintf(stderr, \"Allocated blocks:\\n\");\n    if (Memento_listBlocksNested())\n    {\n        int counts[2];\n        counts[0] = 0;\n        counts[1] = 0;\n        Memento_appBlocks(&globals.used, Memento_listBlock, &counts[0]);\n        fprintf(stderr, \" Total number of blocks = %d\\n\", counts[0]);\n        fprintf(stderr, \" Total size of blocks = %d\\n\", counts[1]);\n    }\n}\n\nstatic int Memento_listNewBlock(Memento_BlkHeader *b,\n                                void              *arg)\n{\n    if (b->flags & Memento_Flag_OldBlock)\n        return 0;\n    b->flags |= Memento_Flag_OldBlock;\n    return Memento_listBlock(b, arg);\n}\n\nvoid Memento_listNewBlocks(void) {\n    int counts[2];\n    counts[0] = 0;\n    counts[1] = 0;\n    fprintf(stderr, \"Blocks allocated and still extant since last list:\\n\");\n    Memento_appBlocks(&globals.used, Memento_listNewBlock, &counts[0]);\n    fprintf(stderr, \"  Total number of blocks = %d\\n\", counts[0]);\n    fprintf(stderr, \"  Total size of blocks = %d\\n\", counts[1]);\n}\n\nstatic void Memento_endStats(void)\n{\n    fprintf(stderr, \"Total memory malloced = %u bytes\\n\", (unsigned int)globals.totalAlloc);\n    fprintf(stderr, \"Peak memory malloced = %u bytes\\n\", (unsigned int)globals.peakAlloc);\n    fprintf(stderr, \"%u mallocs, %u frees, %u reallocs\\n\", (unsigned int)globals.numMallocs,\n            (unsigned int)globals.numFrees, (unsigned int)globals.numReallocs);\n    fprintf(stderr, \"Average allocation size %u bytes\\n\", (unsigned int)\n            (globals.numMallocs != 0 ? globals.totalAlloc/globals.numMallocs: 0));\n}\n\nvoid Memento_stats(void)\n{\n    fprintf(stderr, \"Current memory malloced = %u bytes\\n\", (unsigned int)globals.alloc);\n    Memento_endStats();\n}\n\nstatic void Memento_fin(void)\n{\n    Memento_checkAllMemory();\n    Memento_endStats();\n    if (globals.used.head != NULL) {\n        Memento_listBlocks();\n        Memento_breakpoint();\n    }\n    if (globals.segv) {\n        fprintf(stderr, \"Memory dumped on SEGV while squeezing @ %d\\n\", globals.failAt);\n    } else if (globals.squeezing) {\n        if (globals.pattern == 0)\n            fprintf(stderr, \"Memory squeezing @ %d complete\\n\", globals.squeezeAt);\n        else\n            fprintf(stderr, \"Memory squeezing @ %d (%d) complete\\n\", globals.squeezeAt, globals.pattern);\n    }\n    if (globals.failing)\n    {\n        fprintf(stderr, \"MEMENTO_FAILAT=%d\\n\", globals.failAt);\n        fprintf(stderr, \"MEMENTO_PATTERN=%d\\n\", globals.pattern);\n    }\n    if (globals.nextFailAt != 0)\n    {\n        fprintf(stderr, \"MEMENTO_NEXTFAILAT=%d\\n\", globals.nextFailAt);\n        fprintf(stderr, \"MEMENTO_NEXTPATTERN=%d\\n\", globals.nextPattern);\n    }\n}\n\nstatic void Memento_inited(void)\n{\n    /* A good place for a breakpoint */\n}\n\nstatic void Memento_init(void)\n{\n    char *env;\n    memset(&globals, 0, sizeof(globals));\n    globals.inited    = 1;\n    globals.used.head = NULL;\n    globals.used.tail = &globals.used.head;\n    globals.free.head = NULL;\n    globals.free.tail = &globals.free.head;\n    globals.sequence  = 0;\n    globals.countdown = 1024;\n\n    env = getenv(\"MEMENTO_FAILAT\");\n    globals.failAt = (env ? atoi(env) : 0);\n\n    env = getenv(\"MEMENTO_PARANOIA\");\n    globals.paranoia = (env ? atoi(env) : 0);\n    if (globals.paranoia == 0)\n        globals.paranoia = 1024;\n\n    env = getenv(\"MEMENTO_PARANOIDAT\");\n    globals.paranoidAt = (env ? atoi(env) : 0);\n\n    env = getenv(\"MEMENTO_SQUEEZEAT\");\n    globals.squeezeAt = (env ? atoi(env) : 0);\n\n    env = getenv(\"MEMENTO_PATTERN\");\n    globals.pattern = (env ? atoi(env) : 0);\n\n    env = getenv(\"MEMENTO_MAXMEMORY\");\n    globals.maxMemory = (env ? atoi(env) : 0);\n\n    atexit(Memento_fin);\n\n    Memento_inited();\n}\n\n#ifdef MEMENTO_HAS_FORK\n#include <unistd.h>\n#include <sys/wait.h>\n#ifdef MEMENTO_STACKTRACE_METHOD\n#if MEMENTO_STACKTRACE_METHOD == 1\n#include <signal.h>\n#endif\n#endif\n\n/* FIXME: Find some portable way of getting this */\n/* MacOSX has 10240, Ubuntu seems to have 256 */\n#define OPEN_MAX 10240\n\n/* stashed_map[j] = i means that filedescriptor i-1 was duplicated to j */\nint stashed_map[OPEN_MAX];\n\nextern size_t backtrace(void **, int);\nextern void backtrace_symbols_fd(void **, size_t, int);\n\nstatic void Memento_signal(void)\n{\n    fprintf(stderr, \"SEGV after Memory squeezing @ %d\\n\", globals.squeezeAt);\n\n#ifdef MEMENTO_STACKTRACE_METHOD\n#if MEMENTO_STACKTRACE_METHOD == 1\n    {\n      void *array[100];\n      size_t size;\n\n      size = backtrace(array, 100);\n      fprintf(stderr, \"------------------------------------------------------------------------\\n\");\n      fprintf(stderr, \"Backtrace:\\n\");\n      backtrace_symbols_fd(array, size, 2);\n      fprintf(stderr, \"------------------------------------------------------------------------\\n\");\n    }\n#endif\n#endif\n\n    exit(1);\n}\n\nstatic int squeeze(void)\n{\n    pid_t pid;\n    int i, status;\n\n    if (globals.patternBit < 0)\n        return 1;\n    if (globals.squeezing && globals.patternBit >= MEMENTO_MAXPATTERN)\n        return 1;\n\n    if (globals.patternBit == 0)\n        globals.squeezeAt = globals.sequence;\n\n    if (!globals.squeezing) {\n        fprintf(stderr, \"Memory squeezing @ %d\\n\", globals.squeezeAt);\n    } else\n        fprintf(stderr, \"Memory squeezing @ %d (%x,%x)\\n\", globals.squeezeAt, globals.pattern, globals.patternBit);\n\n    /* When we fork below, the child is going to snaffle all our file pointers\n     * and potentially corrupt them. Let's make copies of all of them before\n     * we fork, so we can restore them when we restart. */\n    for (i = 0; i < OPEN_MAX; i++) {\n        if (stashed_map[i] == 0) {\n            int j = dup(i);\n            stashed_map[j] = i+1;\n        }\n    }\n\n    pid = fork();\n    if (pid == 0) {\n        /* Child */\n        signal(SIGSEGV, Memento_signal);\n        /* In the child, we always fail the next allocation. */\n        if (globals.patternBit == 0) {\n            globals.patternBit = 1;\n        } else\n            globals.patternBit <<= 1;\n        globals.squeezing = 1;\n        return 1;\n    }\n\n    /* In the parent if we hit another allocation, pass it (and record the\n     * fact we passed it in the pattern. */\n    globals.pattern |= globals.patternBit;\n    globals.patternBit <<= 1;\n\n    /* Wait for pid to finish */\n    waitpid(pid, &status, 0);\n\n    if (status != 0) {\n        fprintf(stderr, \"Child status=%d\\n\", status);\n    }\n\n    /* Put the files back */\n    for (i = 0; i < OPEN_MAX; i++) {\n        if (stashed_map[i] != 0) {\n            dup2(i, stashed_map[i]-1);\n            close(i);\n            stashed_map[i] = 0;\n        }\n    }\n\n    return 0;\n}\n#else\n#include <signal.h>\n\nstatic void Memento_signal(void)\n{\n    globals.segv = 1;\n    /* If we just return from this function the SEGV will be unhandled, and\n     * we'll launch into whatever JIT debugging system the OS provides. At\n     * least output something useful first. If MEMENTO_NOJIT is set, then\n     * just exit to avoid the JIT (and get the usual atexit handling). */\n    if (getenv(\"MEMENTO_NOJIT\"))\n        exit(1);\n    else\n        Memento_fin();\n}\n\nint squeeze(void)\n{\n    fprintf(stderr, \"Memento memory squeezing disabled as no fork!\\n\");\n    return 0;\n}\n#endif\n\nstatic void Memento_startFailing(void)\n{\n    if (!globals.failing) {\n        fprintf(stderr, \"Starting to fail...\\n\");\n        fflush(stderr);\n        globals.failing = 1;\n        globals.failAt = globals.sequence;\n        globals.nextFailAt = globals.sequence+1;\n        globals.pattern = 0;\n        globals.patternBit = 0;\n        signal(SIGSEGV, Memento_signal);\n        signal(SIGABRT, Memento_signal);\n        Memento_breakpoint();\n    }\n}\n\nstatic void Memento_event(void)\n{\n    globals.sequence++;\n    if ((globals.sequence >= globals.paranoidAt) && (globals.paranoidAt != 0)) {\n        globals.paranoia = 1;\n        globals.countdown = 1;\n    }\n    if (--globals.countdown == 0) {\n        Memento_checkAllMemory();\n        globals.countdown = globals.paranoia;\n    }\n\n    if (globals.sequence == globals.breakAt) {\n        fprintf(stderr, \"Breaking at event %d\\n\", globals.breakAt);\n        Memento_breakpoint();\n    }\n}\n\nint Memento_breakAt(int event)\n{\n    globals.breakAt = event;\n    return event;\n}\n\nvoid *Memento_label(void *ptr, const char *label)\n{\n    Memento_BlkHeader *block;\n\n    if (ptr == NULL)\n        return NULL;\n    block = MEMBLK_FROMBLK(ptr);\n    block->label = label;\n    return ptr;\n}\n\nint Memento_failThisEvent(void)\n{\n    int failThisOne;\n\n    if (!globals.inited)\n        Memento_init();\n\n    Memento_event();\n\n    if ((globals.sequence >= globals.failAt) && (globals.failAt != 0))\n        Memento_startFailing();\n    if ((globals.sequence >= globals.squeezeAt) && (globals.squeezeAt != 0)) {\n        return squeeze();\n    }\n\n    if (!globals.failing)\n        return 0;\n    failThisOne = ((globals.patternBit & globals.pattern) == 0);\n    /* If we are failing, and we've reached the end of the pattern and we've\n     * still got bits available in the pattern word, and we haven't already\n     * set a nextPattern, then extend the pattern. */\n    if (globals.failing &&\n        ((~(globals.patternBit-1) & globals.pattern) == 0) &&\n        (globals.patternBit != 0) &&\n        globals.nextPattern == 0)\n    {\n        /* We'll fail this one, and set the 'next' one to pass it. */\n        globals.nextFailAt = globals.failAt;\n        globals.nextPattern = globals.pattern | globals.patternBit;\n    }\n    globals.patternBit = (globals.patternBit ? globals.patternBit << 1 : 1);\n\n    return failThisOne;\n}\n\nvoid *Memento_malloc(size_t s)\n{\n    Memento_BlkHeader *memblk;\n    size_t             smem = MEMBLK_SIZE(s);\n\n    if (Memento_failThisEvent())\n        return NULL;\n\n    if (s == 0)\n        return NULL;\n\n    globals.numMallocs++;\n\n    if (globals.maxMemory != 0 && globals.alloc + s > globals.maxMemory)\n        return NULL;\n\n    memblk = MEMENTO_UNDERLYING_MALLOC(smem);\n    if (memblk == NULL)\n        return NULL;\n\n    globals.alloc      += s;\n    globals.totalAlloc += s;\n    if (globals.peakAlloc < globals.alloc)\n        globals.peakAlloc = globals.alloc;\n#ifndef MEMENTO_LEAKONLY\n    memset(MEMBLK_TOBLK(memblk), MEMENTO_ALLOCFILL, s);\n#endif\n    memblk->rawsize       = s;\n    memblk->sequence      = globals.sequence;\n    memblk->lastCheckedOK = memblk->sequence;\n    memblk->flags         = 0;\n    memblk->label         = 0;\n    memblk->child         = NULL;\n    memblk->sibling       = NULL;\n    Memento_addBlockHead(&globals.used, memblk, 0);\n    return MEMBLK_TOBLK(memblk);\n}\n\nvoid *Memento_calloc(size_t n, size_t s)\n{\n    void *block = Memento_malloc(n*s);\n\n    if (block)\n        memset(block, 0, n*s);\n    return block;\n}\n\nstatic int checkBlock(Memento_BlkHeader *memblk, const char *action)\n{\n#ifndef MEMENTO_LEAKONLY\n    BlkCheckData data;\n\n    memset(&data, 0, sizeof(data));\n    Memento_appBlock(&globals.used, Memento_Internal_checkAllocedBlock,\n                     &data, memblk);\n    if (!data.found) {\n        /* Failure! */\n        fprintf(stderr, \"Attempt to %s block \", action);\n        showBlock(memblk, 32);\n        Memento_breakpoint();\n        return 1;\n    } else if (data.preCorrupt || data.postCorrupt) {\n        fprintf(stderr, \"Block \");\n        showBlock(memblk, ' ');\n        fprintf(stderr, \" found to be corrupted on %s!\\n\", action);\n        if (data.preCorrupt) {\n            fprintf(stderr, \"Preguard corrupted\\n\");\n        }\n        if (data.postCorrupt) {\n            fprintf(stderr, \"Postguard corrupted\\n\");\n        }\n        fprintf(stderr, \"Block last checked OK at allocation %d. Now %d.\\n\",\n                memblk->lastCheckedOK, globals.sequence);\n        Memento_breakpoint();\n        return 1;\n    }\n#endif\n    return 0;\n}\n\nvoid Memento_free(void *blk)\n{\n    Memento_BlkHeader *memblk;\n\n    if (!globals.inited)\n        Memento_init();\n\n    Memento_event();\n\n    if (blk == NULL)\n        return;\n\n    memblk = MEMBLK_FROMBLK(blk);\n    VALGRIND_MAKE_MEM_DEFINED(memblk, sizeof(*memblk));\n    if (checkBlock(memblk, \"free\"))\n        return;\n\n    if (memblk->flags & Memento_Flag_BreakOnFree)\n        Memento_breakpoint();\n\n    VALGRIND_MAKE_MEM_DEFINED(memblk, sizeof(*memblk));\n    globals.alloc -= memblk->rawsize;\n    globals.numFrees++;\n\n    Memento_removeBlock(&globals.used, memblk);\n\n    VALGRIND_MAKE_MEM_DEFINED(memblk, sizeof(*memblk));\n    if (Memento_Internal_makeSpace(MEMBLK_SIZE(memblk->rawsize))) {\n        VALGRIND_MAKE_MEM_DEFINED(memblk, sizeof(*memblk));\n        VALGRIND_MAKE_MEM_DEFINED(MEMBLK_TOBLK(memblk),\n                                  memblk->rawsize + Memento_PostSize);\n#ifndef MEMENTO_LEAKONLY\n        memset(MEMBLK_TOBLK(memblk), MEMENTO_FREEFILL, memblk->rawsize);\n#endif\n        Memento_addBlockTail(&globals.free, memblk, 1);\n    } else {\n        MEMENTO_UNDERLYING_FREE(memblk);\n    }\n}\n\nvoid *Memento_realloc(void *blk, size_t newsize)\n{\n    Memento_BlkHeader *memblk, *newmemblk;\n    size_t             newsizemem;\n    int                flags;\n\n    if (blk == NULL)\n        return Memento_malloc(newsize);\n    if (newsize == 0) {\n        Memento_free(blk);\n        return NULL;\n    }\n\n    if (Memento_failThisEvent())\n        return NULL;\n\n    memblk     = MEMBLK_FROMBLK(blk);\n    if (checkBlock(memblk, \"realloc\"))\n        return NULL;\n\n    if (memblk->flags & Memento_Flag_BreakOnRealloc)\n        Memento_breakpoint();\n\n    if (globals.maxMemory != 0 && globals.alloc - memblk->rawsize + newsize > globals.maxMemory)\n        return NULL;\n\n    newsizemem = MEMBLK_SIZE(newsize);\n    Memento_removeBlock(&globals.used, memblk);\n    flags = memblk->flags;\n    newmemblk  = MEMENTO_UNDERLYING_REALLOC(memblk, newsizemem);\n    if (newmemblk == NULL)\n    {\n        Memento_addBlockHead(&globals.used, memblk, 2);\n        return NULL;\n    }\n    globals.numReallocs++;\n    globals.totalAlloc += newsize;\n    globals.alloc      -= newmemblk->rawsize;\n    globals.alloc      += newsize;\n    if (globals.peakAlloc < globals.alloc)\n        globals.peakAlloc = globals.alloc;\n    newmemblk->flags = flags;\n    if (newmemblk->rawsize < newsize) {\n        char *newbytes = ((char *)MEMBLK_TOBLK(newmemblk))+newmemblk->rawsize;\n#ifndef MEMENTO_LEAKONLY\n        memset(newbytes, MEMENTO_ALLOCFILL, newsize - newmemblk->rawsize);\n#endif\n        VALGRIND_MAKE_MEM_UNDEFINED(newbytes, newsize - newmemblk->rawsize);\n    }\n    newmemblk->rawsize = newsize;\n#ifndef MEMENTO_LEAKONLY\n    memset(newmemblk->preblk, MEMENTO_PREFILL, Memento_PreSize);\n    memset(MEMBLK_POSTPTR(newmemblk), MEMENTO_POSTFILL, Memento_PostSize);\n#endif\n    Memento_addBlockHead(&globals.used, newmemblk, 2);\n    return MEMBLK_TOBLK(newmemblk);\n}\n\nint Memento_checkBlock(void *blk)\n{\n    Memento_BlkHeader *memblk;\n\n    if (blk == NULL)\n        return 0;\n    memblk = MEMBLK_FROMBLK(blk);\n    return checkBlock(memblk, \"check\");\n}\n\nstatic int Memento_Internal_checkAllAlloced(Memento_BlkHeader *memblk, void *arg)\n{\n    BlkCheckData *data = (BlkCheckData *)arg;\n\n    Memento_Internal_checkAllocedBlock(memblk, data);\n    if (data->preCorrupt || data->postCorrupt) {\n        if ((data->found & 2) == 0) {\n            fprintf(stderr, \"Allocated blocks:\\n\");\n            data->found |= 2;\n        }\n        fprintf(stderr, \"  Block \");\n        showBlock(memblk, ' ');\n        if (data->preCorrupt) {\n            fprintf(stderr, \" Preguard \");\n        }\n        if (data->postCorrupt) {\n            fprintf(stderr, \"%s Postguard \",\n                    (data->preCorrupt ? \"&\" : \"\"));\n        }\n        fprintf(stderr, \"corrupted.\\n    \"\n                \"Block last checked OK at allocation %d. Now %d.\\n\",\n                memblk->lastCheckedOK, globals.sequence);\n        data->preCorrupt  = 0;\n        data->postCorrupt = 0;\n        data->freeCorrupt = 0;\n    }\n    else\n        memblk->lastCheckedOK = globals.sequence;\n    return 0;\n}\n\nstatic int Memento_Internal_checkAllFreed(Memento_BlkHeader *memblk, void *arg)\n{\n    BlkCheckData *data = (BlkCheckData *)arg;\n\n    Memento_Internal_checkFreedBlock(memblk, data);\n    if (data->preCorrupt || data->postCorrupt || data->freeCorrupt) {\n        if ((data->found & 4) == 0) {\n            fprintf(stderr, \"Freed blocks:\\n\");\n            data->found |= 4;\n        }\n        fprintf(stderr, \"  \");\n        showBlock(memblk, ' ');\n        if (data->freeCorrupt) {\n            fprintf(stderr, \" index %d (address 0x%p) onwards\", data->index,\n                    &((char *)MEMBLK_TOBLK(memblk))[data->index]);\n            if (data->preCorrupt) {\n                fprintf(stderr, \"+ preguard\");\n            }\n            if (data->postCorrupt) {\n                fprintf(stderr, \"+ postguard\");\n            }\n        } else {\n            if (data->preCorrupt) {\n                fprintf(stderr, \" preguard\");\n            }\n            if (data->postCorrupt) {\n                fprintf(stderr, \"%s Postguard\",\n                        (data->preCorrupt ? \"+\" : \"\"));\n            }\n        }\n        fprintf(stderr, \" corrupted.\\n\"\n                \"    Block last checked OK at allocation %d. Now %d.\\n\",\n                memblk->lastCheckedOK, globals.sequence);\n        data->preCorrupt  = 0;\n        data->postCorrupt = 0;\n        data->freeCorrupt = 0;\n    }\n    else\n        memblk->lastCheckedOK = globals.sequence;\n    return 0;\n}\n\nint Memento_checkAllMemory(void)\n{\n#ifndef MEMENTO_LEAKONLY\n    BlkCheckData data;\n\n    memset(&data, 0, sizeof(data));\n    Memento_appBlocks(&globals.used, Memento_Internal_checkAllAlloced, &data);\n    Memento_appBlocks(&globals.free, Memento_Internal_checkAllFreed, &data);\n    if (data.found & 6) {\n        Memento_breakpoint();\n        return 1;\n    }\n#endif\n    return 0;\n}\n\nint Memento_setParanoia(int i)\n{\n    globals.paranoia = i;\n    globals.countdown = globals.paranoia;\n    return i;\n}\n\nint Memento_paranoidAt(int i)\n{\n    globals.paranoidAt = i;\n    return i;\n}\n\nint Memento_getBlockNum(void *b)\n{\n    Memento_BlkHeader *memblk;\n    if (b == NULL)\n        return 0;\n    memblk = MEMBLK_FROMBLK(b);\n    return (memblk->sequence);\n}\n\nint Memento_check(void)\n{\n    int result;\n\n    fprintf(stderr, \"Checking memory\\n\");\n    result = Memento_checkAllMemory();\n    fprintf(stderr, \"Memory checked!\\n\");\n    return result;\n}\n\ntypedef struct findBlkData {\n    void              *addr;\n    Memento_BlkHeader *blk;\n    int                flags;\n} findBlkData;\n\nstatic int Memento_containsAddr(Memento_BlkHeader *b,\n                                void *arg)\n{\n    findBlkData *data = (findBlkData *)arg;\n    char *blkend = &((char *)MEMBLK_TOBLK(b))[b->rawsize];\n    if ((MEMBLK_TOBLK(b) <= data->addr) &&\n        ((void *)blkend > data->addr)) {\n        data->blk = b;\n        data->flags = 1;\n        return 1;\n    }\n    if (((void *)b <= data->addr) &&\n        (MEMBLK_TOBLK(b) > data->addr)) {\n        data->blk = b;\n        data->flags = 2;\n        return 1;\n    }\n    if (((void *)blkend <= data->addr) &&\n        ((void *)(blkend + Memento_PostSize) > data->addr)) {\n        data->blk = b;\n        data->flags = 3;\n        return 1;\n    }\n    return 0;\n}\n\nint Memento_find(void *a)\n{\n    findBlkData data;\n\n    data.addr  = a;\n    data.blk   = NULL;\n    data.flags = 0;\n    Memento_appBlocks(&globals.used, Memento_containsAddr, &data);\n    if (data.blk != NULL) {\n        fprintf(stderr, \"Address 0x%p is in %sallocated block \",\n                data.addr,\n                (data.flags == 1 ? \"\" : (data.flags == 2 ?\n                                         \"preguard of \" : \"postguard of \")));\n        showBlock(data.blk, ' ');\n        fprintf(stderr, \"\\n\");\n        return data.blk->sequence;\n    }\n    data.blk   = NULL;\n    data.flags = 0;\n    Memento_appBlocks(&globals.free, Memento_containsAddr, &data);\n    if (data.blk != NULL) {\n        fprintf(stderr, \"Address 0x%p is in %sfreed block \",\n                data.addr,\n                (data.flags == 1 ? \"\" : (data.flags == 2 ?\n                                         \"preguard of \" : \"postguard of \")));\n        showBlock(data.blk, ' ');\n        fprintf(stderr, \"\\n\");\n        return data.blk->sequence;\n    }\n    return 0;\n}\n\nvoid Memento_breakOnFree(void *a)\n{\n    findBlkData data;\n\n    data.addr  = a;\n    data.blk   = NULL;\n    data.flags = 0;\n    Memento_appBlocks(&globals.used, Memento_containsAddr, &data);\n    if (data.blk != NULL) {\n        fprintf(stderr, \"Will stop when address 0x%p (in %sallocated block \",\n                data.addr,\n                (data.flags == 1 ? \"\" : (data.flags == 2 ?\n                                         \"preguard of \" : \"postguard of \")));\n        showBlock(data.blk, ' ');\n        fprintf(stderr, \") is freed\\n\");\n        data.blk->flags |= Memento_Flag_BreakOnFree;\n        return;\n    }\n    data.blk   = NULL;\n    data.flags = 0;\n    Memento_appBlocks(&globals.free, Memento_containsAddr, &data);\n    if (data.blk != NULL) {\n        fprintf(stderr, \"Can't stop on free; address 0x%p is in %sfreed block \",\n                data.addr,\n                (data.flags == 1 ? \"\" : (data.flags == 2 ?\n                                         \"preguard of \" : \"postguard of \")));\n        showBlock(data.blk, ' ');\n        fprintf(stderr, \"\\n\");\n        return;\n    }\n    fprintf(stderr, \"Can't stop on free; address 0x%p is not in a known block.\\n\", a);\n}\n\nvoid Memento_breakOnRealloc(void *a)\n{\n    findBlkData data;\n\n    data.addr  = a;\n    data.blk   = NULL;\n    data.flags = 0;\n    Memento_appBlocks(&globals.used, Memento_containsAddr, &data);\n    if (data.blk != NULL) {\n        fprintf(stderr, \"Will stop when address 0x%p (in %sallocated block \",\n                data.addr,\n                (data.flags == 1 ? \"\" : (data.flags == 2 ?\n                                         \"preguard of \" : \"postguard of \")));\n        showBlock(data.blk, ' ');\n        fprintf(stderr, \") is freed (or realloced)\\n\");\n        data.blk->flags |= Memento_Flag_BreakOnFree | Memento_Flag_BreakOnRealloc;\n        return;\n    }\n    data.blk   = NULL;\n    data.flags = 0;\n    Memento_appBlocks(&globals.free, Memento_containsAddr, &data);\n    if (data.blk != NULL) {\n        fprintf(stderr, \"Can't stop on free/realloc; address 0x%p is in %sfreed block \",\n                data.addr,\n                (data.flags == 1 ? \"\" : (data.flags == 2 ?\n                                         \"preguard of \" : \"postguard of \")));\n        showBlock(data.blk, ' ');\n        fprintf(stderr, \"\\n\");\n        return;\n    }\n    fprintf(stderr, \"Can't stop on free/realloc; address 0x%p is not in a known block.\\n\", a);\n}\n\nint Memento_failAt(int i)\n{\n    globals.failAt = i;\n    if ((globals.sequence > globals.failAt) &&\n        (globals.failing != 0))\n        Memento_startFailing();\n    return i;\n}\n\nsize_t Memento_setMax(size_t max)\n{\n    globals.maxMemory = max;\n    return max;\n}\n\n#else\n\n/* Just in case anyone has left some debugging code in... */\nvoid (Memento_breakpoint)(void)\n{\n}\n\nint (Memento_checkBlock)(void *b)\n{\n    return 0;\n}\n\nint (Memento_checkAllMemory)(void)\n{\n    return 0;\n}\n\nint (Memento_check)(void)\n{\n    return 0;\n}\n\nint (Memento_setParanoia)(int i)\n{\n    return 0;\n}\n\nint (Memento_paranoidAt)(int i)\n{\n    return 0;\n}\n\nint (Memento_breakAt)(int i)\n{\n    return 0;\n}\n\nint  (Memento_getBlockNum)(void *i)\n{\n    return 0;\n}\n\nint (Memento_find)(void *a)\n{\n    return 0;\n}\n\nint (Memento_failAt)(int i)\n{\n    return 0;\n}\n\nvoid (Memento_breakOnFree)(void *a)\n{\n}\n\nvoid (Memento_breakOnRealloc)(void *a)\n{\n}\n\n#undef Memento_malloc\n#undef Memento_free\n#undef Memento_realloc\n#undef Memento_calloc\n\nvoid *Memento_malloc(size_t size)\n{\n    return MEMENTO_UNDERLYING_MALLOC(size);\n}\n\nvoid Memento_free(void *b)\n{\n    MEMENTO_UNDERLYING_FREE(b);\n}\n\nvoid *Memento_realloc(void *b, size_t s)\n{\n    return MEMENTO_UNDERLYING_REALLOC(b, s);\n}\n\nvoid *Memento_calloc(size_t n, size_t s)\n{\n    return MEMENTO_UNDERLYING_CALLOC(n, s);\n}\n\nvoid (Memento_listBlocks)(void)\n{\n}\n\nvoid (Memento_listNewBlocks)(void)\n{\n}\n\nsize_t (Memento_setMax)(size_t max)\n{\n    return 0;\n}\n\nvoid (Memento_stats)(void)\n{\n}\n\nvoid *(Memento_label)(void *ptr, const char *label)\n{\n    return ptr;\n}\n\n#endif\n"
  },
  {
    "path": "ext/jbig2dec/memento.h",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n\n/* Memento: A library to aid debugging of memory leaks/heap corruption.\n *\n * Usage:\n *    First, build your project with MEMENTO defined, and include this\n *    header file wherever you use malloc, realloc or free.\n *    This header file will use macros to point malloc, realloc and free to\n *    point to Memento_malloc, Memento_realloc, Memento_free.\n *\n *    Run your program, and all mallocs/frees/reallocs should be redirected\n *    through here. When the program exits, you will get a list of all the\n *    leaked blocks, together with some helpful statistics. You can get the\n *    same list of allocated blocks at any point during program execution by\n *    calling Memento_listBlocks();\n *\n *    Every call to malloc/free/realloc counts as an 'allocation event'.\n *    On each event Memento increments a counter. Every block is tagged with\n *    the current counter on allocation. Every so often during program\n *    execution, the heap is checked for consistency. By default this happens\n *    every 1024 events. This can be changed at runtime by using\n *    Memento_setParanoia(int level). 0 turns off such checking, 1 sets\n *    checking to happen on every event, any other number n sets checking to\n *    happen once every n events.\n *\n *    Memento keeps blocks around for a while after they have been freed, and\n *    checks them as part of these heap checks to see if they have been\n *    written to (or are freed twice etc).\n *\n *    A given heap block can be checked for consistency (it's 'pre' and\n *    'post' guard blocks are checked to see if they have been written to)\n *    by calling Memento_checkBlock(void *blockAddress);\n *\n *    A check of all the memory can be triggered by calling Memento_check();\n *    (or Memento_checkAllMemory(); if you'd like it to be quieter).\n *\n *    A good place to breakpoint is Memento_breakpoint, as this will then\n *    trigger your debugger if an error is detected. This is done\n *    automatically for debug windows builds.\n *\n *    If a block is found to be corrupt, information will be printed to the\n *    console, including the address of the block, the size of the block,\n *    the type of corruption, the number of the block and the event on which\n *    it last passed a check for correctness.\n *\n *    If you rerun, and call Memento_paranoidAt(int event); with this number\n *    the the code will wait until it reaches that event and then start\n *    checking the heap after every allocation event. Assuming it is a\n *    deterministic failure, you should then find out where in your program\n *    the error is occurring (between event x-1 and event x).\n *\n *    Then you can rerun the program again, and call\n *    Memento_breakAt(int event); and the program will call\n *    Memento_Breakpoint() when event x is reached, enabling you to step\n *    through.\n *\n *    Memento_find(address) will tell you what block (if any) the given\n *    address is in.\n *\n * An example:\n *    Suppose we have a gs invocation that crashes with memory corruption.\n *     * Build with -DMEMENTO.\n *     * In your debugger put breakpoints on Memento_inited and\n *       Memento_Breakpoint.\n *     * Run the program. It will stop in Memento_inited.\n *     * Execute Memento_setParanoia(1);  (In VS use Ctrl-Alt-Q). (Note #1)\n *     * Continue execution.\n *     * It will detect the memory corruption on the next allocation event\n *       after it happens, and stop in Memento_breakpoint. The console should\n *       show something like:\n *\n *       Freed blocks:\n *         0x172e610(size=288,num=1415) index 256 (0x172e710) onwards corrupted\n *           Block last checked OK at allocation 1457. Now 1458.\n *\n *     * This means that the block became corrupted between allocation 1457\n *       and 1458 - so if we rerun and stop the program at 1457, we can then\n *       step through, possibly with a data breakpoint at 0x172e710 and see\n *       when it occurs.\n *     * So restart the program from the beginning. When we hit Memento_inited\n *       execute Memento_breakAt(1457); (and maybe Memento_setParanoia(1), or\n *       Memento_setParanoidAt(1457))\n *     * Continue execution until we hit Memento_breakpoint.\n *     * Now you can step through and watch the memory corruption happen.\n *\n *    Note #1: Using Memento_setParanoia(1) can cause your program to run\n *    very slowly. You may instead choose to use Memento_setParanoia(100)\n *    (or some other figure). This will only exhaustively check memory on\n *    every 100th allocation event. This trades speed for the size of the\n *    average allocation event range in which detection of memory corruption\n *    occurs. You may (for example) choose to run once checking every 100\n *    allocations and discover that the corruption happens between events\n *    X and X+100. You can then rerun using Memento_paranoidAt(X), and\n *    it'll only start exhaustively checking when it reaches X.\n *\n * More than one memory allocator?\n *\n *    If you have more than one memory allocator in the system (like for\n *    instance the ghostscript chunk allocator, that builds on top of the\n *    standard malloc and returns chunks itself), then there are some things\n *    to note:\n *\n *    * If the secondary allocator gets its underlying blocks from calling\n *      malloc, then those will be checked by Memento, but 'subblocks' that\n *      are returned to the secondary allocator will not. There is currently\n *      no way to fix this other than trying to bypass the secondary\n *      allocator. One way I have found to do this with the chunk allocator\n *      is to tweak its idea of a 'large block' so that it puts every\n *      allocation in its own chunk. Clearly this negates the point of having\n *      a secondary allocator, and is therefore not recommended for general\n *      use.\n *\n *    * Again, if the secondary allocator gets its underlying blocks from\n *      calling malloc (and hence Memento) leak detection should still work\n *      (but whole blocks will be detected rather than subblocks).\n *\n *    * If on every allocation attempt the secondary allocator calls into\n *      Memento_failThisEvent(), and fails the allocation if it returns true\n *      then more useful features can be used; firstly memory squeezing will\n *      work, and secondly, Memento will have a \"finer grained\" paranoia\n *      available to it.\n */\n\n#ifndef MEMENTO_H\n\n#include <memory.h>\n\n#define MEMENTO_H\n\n#ifndef MEMENTO_UNDERLYING_MALLOC\n#define MEMENTO_UNDERLYING_MALLOC malloc\n#endif\n#ifndef MEMENTO_UNDERLYING_FREE\n#define MEMENTO_UNDERLYING_FREE free\n#endif\n#ifndef MEMENTO_UNDERLYING_REALLOC\n#define MEMENTO_UNDERLYING_REALLOC realloc\n#endif\n#ifndef MEMENTO_UNDERLYING_CALLOC\n#define MEMENTO_UNDERLYING_CALLOC calloc\n#endif\n\n#ifndef MEMENTO_MAXALIGN\n#define MEMENTO_MAXALIGN (sizeof(int))\n#endif\n\n#define MEMENTO_PREFILL   0xa6\n#define MEMENTO_POSTFILL  0xa7\n#define MEMENTO_ALLOCFILL 0xa8\n#define MEMENTO_FREEFILL  0xa9\n\n#define MEMENTO_FREELIST_MAX 0x2000000\n\nint Memento_checkBlock(void *);\nint Memento_checkAllMemory(void);\nint Memento_check(void);\n\nint Memento_setParanoia(int);\nint Memento_paranoidAt(int);\nint Memento_breakAt(int);\nvoid Memento_breakOnFree(void *a);\nvoid Memento_breakOnRealloc(void *a);\nint Memento_getBlockNum(void *);\nint Memento_find(void *a);\nvoid Memento_breakpoint(void);\nint Memento_failAt(int);\nint Memento_failThisEvent(void);\nvoid Memento_listBlocks(void);\nvoid Memento_listNewBlocks(void);\nsize_t Memento_setMax(size_t);\nvoid Memento_stats(void);\nvoid *Memento_label(void *, const char *);\n\nvoid *Memento_malloc(size_t s);\nvoid *Memento_realloc(void *, size_t s);\nvoid  Memento_free(void *);\nvoid *Memento_calloc(size_t, size_t);\n\n#ifdef MEMENTO\n\n#ifndef COMPILING_MEMENTO_C\n#define malloc  Memento_malloc\n#define free    Memento_free\n#define realloc Memento_realloc\n#define calloc  Memento_calloc\n#endif\n\n#else\n\n#define Memento_malloc  MEMENTO_UNDERLYING_MALLOC\n#define Memento_free    MEMENTO_UNDERLYING_FREE\n#define Memento_realloc MEMENTO_UNDERLYING_REALLOC\n#define Memento_calloc  MEMENTO_UNDERLYING_CALLOC\n\n#define Memento_checkBlock(A)     0\n#define Memento_checkAllMemory()  0\n#define Memento_check()           0\n#define Memento_setParanoia(A)    0\n#define Memento_paranoidAt(A)     0\n#define Memento_breakAt(A)        0\n#define Memento_breakOnFree(A)    0\n#define Memento_breakOnRealloc(A) 0\n#define Memento_getBlockNum(A)    0\n#define Memento_find(A)           0\n#define Memento_breakpoint()      do {} while (0)\n#define Memento_failAt(A)         0\n#define Memento_failThisEvent()   0\n#define Memento_listBlocks()      do {} while (0)\n#define Memento_listNewBlocks()   do {} while (0)\n#define Memento_setMax(A)         0\n#define Memento_stats()           do {} while (0)\n#define Memento_label(A,B)        (A)\n\n#endif /* MEMENTO */\n\n#endif /* MEMENTO_H */\n"
  },
  {
    "path": "ext/jbig2dec/msvc.mak",
    "content": "# makefile for jbig2dec\n# under Microsoft Visual C++\n#\n# To compile zlib.dll:\n#  Get zlib >= 1.2.7, unzip and rename to zlib,\n#  cd zlib, then nmake -f win32\\Makefile.msc\n# To compile libpng.lib:\n#  Get libpng >= 1.6.0, unzip then rename to libpng,\n#  cd libpng, nmake -f scripts\\makefile.vcwin32\n\n!ifndef LIBPNGDIR\nLIBPNGDIR=../libpng\n!endif\n\n!ifndef ZLIBDIR\nZLIBDIR=../zlib\n!endif\n\n# define iff you're linking to libpng\n!if exist(\"$(ZLIBDIR)\") && exist(\"$(LIBPNGDIR)\") && exist (\"$(LIBPNGDIR)/pnglibconf.h\")\nLIBPNG_CFLAGS=-DHAVE_LIBPNG -I$(LIBPNGDIR) -I$(ZLIBDIR)\nLIBPNG_LDFLAGS=$(LIBPNGDIR)/libpng.lib $(ZLIBDIR)/zlib.lib /link /NODEFAULTLIB:LIBCMT\n\nJBIG2_IMAGE_PNG_OBJ=jbig2_image_png$(OBJ)\n!else\nLIBPNG_CFLAGS=\nLIBPNG_LDFLAGS=\n\nJBIG2_IMAGE_PNG_OBJ=\n!endif\n\n\nEXE=.exe\nOBJ=.obj\nNUL=\nCFLAGS=-nologo -W4 -Zi -DHAVE_STRING_H=1 -D_CRT_SECURE_NO_WARNINGS $(LIBPNG_CFLAGS) \nCC=cl\nFE=-Fe\n\n\n# no libpng\n#\nOBJS=getopt$(OBJ) getopt1$(OBJ) jbig2$(OBJ) jbig2_arith$(OBJ) \\\n jbig2_arith_iaid$(OBJ) jbig2_arith_int$(OBJ) jbig2_huffman$(OBJ) \\\n jbig2_generic$(OBJ) jbig2_refinement$(OBJ) jbig2_halftone$(OBJ)\\\n jbig2_image$(OBJ) jbig2_image_pbm$(OBJ) $(JBIG2_IMAGE_PNG_OBJ) \\\n jbig2_segment$(OBJ) jbig2_symbol_dict$(OBJ) jbig2_text$(OBJ) \\\n jbig2_mmr$(OBJ) jbig2_page$(OBJ) jbig2_metadata$(OBJ) \\\n jbig2dec$(OBJ) sha1$(OBJ)\n\nHDRS=getopt.h jbig2.h jbig2_arith.h jbig2_arith_iaid.h jbig2_arith_int.h \\\n jbig2_generic.h jbig2_huffman.h jbig2_hufftab.h jbig2_image.h \\\n jbig2_mmr.h jbig2_priv.h jbig2_symbol_dict.h jbig2_metadata.h \\\n config_win32.h sha1.h\n\nall: jbig2dec$(EXE)\n\njbig2dec$(EXE): $(OBJS)\n\t$(CC) $(CFLAGS) $(FE)jbig2dec$(EXE) $(OBJS) $(LIBPNG_LDFLAGS) \n\ngetopt$(OBJ): getopt.c getopt.h\n\t$(CC) $(CFLAGS) -c getopt.c\n\ngetopt1$(OBJ): getopt1.c getopt.h\n\t$(CC) $(CFLAGS) -c getopt1.c\n\njbig2$(OBJ): jbig2.c $(HDRS)\n\t$(CC) $(CFLAGS) -c jbig2.c\n\njbig2_arith$(OBJ): jbig2_arith.c $(HDRS)\n\t$(CC) $(CFLAGS) -c jbig2_arith.c\n\njbig2_arith_iaid$(OBJ): jbig2_arith_iaid.c $(HDRS)\n\t$(CC) $(CFLAGS) -c jbig2_arith_iaid.c\n\njbig2_arith_int$(OBJ): jbig2_arith_int.c $(HDRS)\n\t$(CC) $(CFLAGS) -c jbig2_arith_int.c\n\njbig2_generic$(OBJ): jbig2_generic.c $(HDRS)\n\t$(CC) $(CFLAGS) -c jbig2_generic.c\n\njbig2_refinement$(OBJ): jbig2_refinement.c $(HDRS)\n\t$(CC) $(CFLAGS) -c jbig2_refinement.c\n\njbig2_huffman$(OBJ): jbig2_huffman.c $(HDRS)\n\t$(CC) $(CFLAGS) -c jbig2_huffman.c\n\njbig2_image$(OBJ): jbig2_image.c $(HDRS)\n\t$(CC) $(CFLAGS) -c jbig2_image.c\n\njbig2_image_pbm$(OBJ): jbig2_image_pbm.c $(HDRS)\n\t$(CC) $(CFLAGS) -c jbig2_image_pbm.c\n\njbig2_image_png$(OBJ): jbig2_image_png.c $(HDRS)\n\t$(CC) $(CFLAGS) -c jbig2_image_png.c\n\njbig2_halftone$(OBJ): jbig2_halftone.c $(HDRS)\n\t$(CC) $(CFLAGS) -c jbig2_halftone.c\n\njbig2_mmr$(OBJ): jbig2_mmr.c $(HDRS)\n\t$(CC) $(CFLAGS) -c jbig2_mmr.c\n\njbig2_page$(OBJ): jbig2_page.c $(HDRS)\n\t$(CC) $(CFLAGS) -c jbig2_page.c\n\njbig2_segment$(OBJ): jbig2_segment.c $(HDRS)\n\t$(CC) $(CFLAGS) -c jbig2_segment.c\n\njbig2_symbol_dict$(OBJ): jbig2_symbol_dict.c $(HDRS)\n\t$(CC) $(CFLAGS) -c jbig2_symbol_dict.c\n\njbig2_text$(OBJ): jbig2_text.c $(HDRS)\n\t$(CC) $(CFLAGS) -c jbig2_text.c\n\njbig2_metadata$(OBJ): jbig2_metadata.c $(HDRS)\n\t$(CC) $(CFLAGS) -c jbig2_metadata.c\n\njbig2dec$(OBJ): jbig2dec.c $(HDRS)\n\t$(CC) $(CFLAGS) -c jbig2dec.c\n\nsha1$(OBJ): sha1.c $(HDRS)\n\t$(CC) $(CFLAGS) -c sha1.c\n\nclean:\n\t-del $(OBJS)\n\t-del jbig2dec$(EXE)\n\t-del jbig2dec.ilk\n\t-del jbig2dec.pdb\n\t-del pbm2png$(EXE)\n\t-del pbm2png.ilk\n\t-del pbm2png.pdb\n\t-del vc70.pdb\n\t-del vc60.pdb\n\t-del vc50.pdb\n\n"
  },
  {
    "path": "ext/jbig2dec/os_types.h",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n/*\n   indirection layer for build and platform-specific definitions\n\n   in general, this header should ensure that the stdint types are\n   available, and that any optional compile flags are defined if\n   the build system doesn't pass them directly.\n*/\n\n#ifndef _JBIG2_OS_TYPES_H\n#define _JBIG2_OS_TYPES_H\n\n#if defined(__CYGWIN__) && !defined(HAVE_STDINT_H)\n# include <sys/types.h>\n# if defined(OLD_CYGWIN_SYS_TYPES)\n  /*\n   * Old versions of Cygwin have no stdint.h but define \"MS types\". Some of\n   * them conflict with a standard type emulation provided by config_types.h\n   * so we do a fixup here.\n   */\n   typedef u_int8_t uint8_t;\n   typedef u_int16_t uint16_t;\n   typedef u_int32_t uint32_t;\n#endif\n#elif defined(HAVE_CONFIG_H)\n# include \"config_types.h\"\n#elif defined(_WIN32) || defined(__WIN32__)\n# include \"config_win32.h\"\n#elif defined (STD_INT_USE_SYS_TYPES_H)\n# include <sys/types.h>\n#elif defined (STD_INT_USE_INTTYPES_H)\n# include <inttypes.h>\n#elif defined (STD_INT_USE_SYS_INTTYPES_H)\n# include <sys/inttypes.h>\n#elif defined (STD_INT_USE_SYS_INT_TYPES_H)\n# include <sys/int_types.h>\n#elif !defined(HAVE_STDINT_H)\n   typedef unsigned char  uint8_t;\n   typedef unsigned short uint16_t;\n   typedef unsigned int   uint32_t;\n   typedef signed char    int8_t;\n   typedef signed short   int16_t;\n   typedef signed int     int32_t;\n#endif\n\n#if defined(HAVE_STDINT_H) || defined(__MACOS__)\n# include <stdint.h>\n#elif defined(__VMS) || defined(__osf__)\n# include <inttypes.h>\n#endif\n\n#ifdef __hpux\n#include <sys/_inttypes.h>\n#endif\n\n#endif /* _JBIG2_OS_TYPES_H */\n"
  },
  {
    "path": "ext/jbig2dec/pbm2png.c",
    "content": "/* Copyright (C) 2001-2012 Artifex Software, Inc.\n   All Rights Reserved.\n\n   This software is provided AS-IS with no warranty, either express or\n   implied.\n\n   This software is distributed under license and may not be copied,\n   modified or distributed except as expressly authorized under the terms\n   of the license contained in the file LICENSE in this distribution.\n\n   Refer to licensing information at http://www.artifex.com or contact\n   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,\n   CA  94903, U.S.A., +1(415)492-9861, for further information.\n*/\n\n/*\n    jbig2dec\n*/\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#include \"config_types.h\"\n#elif _WIN32\n#include \"config_win32.h\"\n#endif\n#ifdef HAVE_STDINT_H\n#include <stdint.h>\n#endif\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"jbig2.h\"\n#include \"jbig2_image.h\"\n\nint main(int argc, char *argv[])\n{\n    Jbig2Ctx *ctx;\n    Jbig2Image *image;\n    int error;\n\n    /* we need a context for the allocators */\n    ctx = jbig2_ctx_new(NULL, 0, NULL, NULL, NULL);\n\n    if (argc != 3) {\n        fprintf(stderr, \"usage: %s <in.pbm> <out.png>\\n\\n\", argv[0]);\n        return 1;\n    }\n\n    image = jbig2_image_read_pbm_file(ctx, argv[1]);\n    if(image == NULL) {\n        fprintf(stderr, \"error reading pbm file '%s'\\n\", argv[1]);\n        return 1;\n    } else {\n        fprintf(stderr, \"converting %dx%d image to png format\\n\", image->width, image->height);\n    }\n\n    error = jbig2_image_write_png_file(image, argv[2]);\n    if (error) {\n        fprintf(stderr, \"error writing png file '%s' error %d\\n\", argv[2], error);\n    }\n\n    return (error);\n}\n"
  },
  {
    "path": "ext/jbig2dec/sha1.c",
    "content": "/*\nSHA-1 in C\nBy Steve Reid <sreid@sea-to-sky.net>\n100% Public Domain\n\n-----------------\nModified 7/98\nBy James H. Brown <jbrown@burgoyne.com>\nStill 100% Public Domain\n\nCorrected a problem which generated improper hash values on 16 bit machines\nRoutine SHA1Update changed from\n\tvoid SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int\nlen)\nto\n\tvoid SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned\nlong len)\n\nThe 'len' parameter was declared an int which works fine on 32 bit machines.\nHowever, on 16 bit machines an int is too small for the shifts being done\nagainst\nit.  This caused the hash function to generate incorrect values if len was\ngreater than 8191 (8K - 1) due to the 'len << 3' on line 3 of SHA1Update().\n\nSince the file IO in main() reads 16K at a time, any file 8K or larger would\nbe guaranteed to generate the wrong hash (e.g. Test Vector #3, a million\n\"a\"s).\n\nI also changed the declaration of variables i & j in SHA1Update to\nunsigned long from unsigned int for the same reason.\n\nThese changes should make no difference to any 32 bit implementations since\nan\nint and a long are the same size in those environments.\n\n--\nI also corrected a few compiler warnings generated by Borland C.\n1. Added #include <process.h> for exit() prototype\n2. Removed unused variable 'j' in SHA1Final\n3. Changed exit(0) to return(0) at end of main.\n\nALL changes I made can be located by searching for comments containing 'JHB'\n-----------------\nModified 8/98\nBy Steve Reid <sreid@sea-to-sky.net>\nStill 100% public domain\n\n1- Removed #include <process.h> and used return() instead of exit()\n2- Fixed overwriting of finalcount in SHA1Final() (discovered by Chris Hall)\n3- Changed email address from steve@edmweb.com to sreid@sea-to-sky.net\n\n-----------------\nModified 4/01\nBy Saul Kravitz <Saul.Kravitz@celera.com>\nStill 100% PD\nModified to run on Compaq Alpha hardware.\n\n-----------------\nModified 07/2002\nBy Ralph Giles <giles@ghostscript.com>\nStill 100% public domain\nmodified for use with stdint types, autoconf\ncode cleanup, removed attribution comments\nswitched SHA1Final() argument order for consistency\nuse SHA1_ prefix for public api\nmove public api to sha1.h\n*/\n\n/*\nTest Vectors (from FIPS PUB 180-1)\n\"abc\"\n  A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D\n\"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq\"\n  84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1\nA million repetitions of \"a\"\n  34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F\n*/\n\n/* #define SHA1HANDSOFF  */\n\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n\n#include <stdio.h>\n#include <string.h>\n\n#include \"os_types.h\"\n#include \"sha1.h\"\n\nvoid SHA1_Transform(uint32_t state[5], const uint8_t buffer[64]);\n\n#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))\n\n/* blk0() and blk() perform the initial expand. */\n/* I got the idea of expanding during the round function from SSLeay */\n/* FIXME: can we do this in an endian-proof way? */\n#ifdef WORDS_BIGENDIAN\n#define blk0(i) block->l[i]\n#else\n#define blk0(i) (block->l[i] = (rol(block->l[i],24)&0xFF00FF00) \\\n    |(rol(block->l[i],8)&0x00FF00FF))\n#endif\n#define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \\\n    ^block->l[(i+2)&15]^block->l[i&15],1))\n\n/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */\n#define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30);\n#define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30);\n#define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30);\n#define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30);\n#define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30);\n\n\n#ifdef VERBOSE  /* SAK */\nvoid SHAPrintContext(SHA1_CTX *context, char *msg){\n  printf(\"%s (%d,%d) %x %x %x %x %x\\n\",\n\t msg,\n\t context->count[0], context->count[1],\n\t context->state[0],\n\t context->state[1],\n\t context->state[2],\n\t context->state[3],\n\t context->state[4]);\n}\n#endif /* VERBOSE */\n\n/* Hash a single 512-bit block. This is the core of the algorithm. */\nvoid SHA1_Transform(uint32_t state[5], const uint8_t buffer[64])\n{\n    uint32_t a, b, c, d, e;\n    typedef union {\n        uint8_t c[64];\n        uint32_t l[16];\n    } CHAR64LONG16;\n    CHAR64LONG16* block;\n\n#ifdef SHA1HANDSOFF\n    static uint8_t workspace[64];\n    block = (CHAR64LONG16*)workspace;\n    memcpy(block, buffer, 64);\n#else\n    block = (CHAR64LONG16*)buffer;\n#endif\n\n    /* Copy context->state[] to working vars */\n    a = state[0];\n    b = state[1];\n    c = state[2];\n    d = state[3];\n    e = state[4];\n\n    /* 4 rounds of 20 operations each. Loop unrolled. */\n    R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3);\n    R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7);\n    R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11);\n    R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15);\n    R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19);\n    R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23);\n    R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27);\n    R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31);\n    R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35);\n    R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39);\n    R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43);\n    R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47);\n    R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51);\n    R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55);\n    R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59);\n    R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63);\n    R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67);\n    R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71);\n    R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75);\n    R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79);\n\n    /* Add the working vars back into context.state[] */\n    state[0] += a;\n    state[1] += b;\n    state[2] += c;\n    state[3] += d;\n    state[4] += e;\n\n    /* Wipe variables */\n    a = b = c = d = e = 0;\n}\n\n\n/* SHA1Init - Initialize new context */\nvoid SHA1_Init(SHA1_CTX* context)\n{\n    /* SHA1 initialization constants */\n    context->state[0] = 0x67452301;\n    context->state[1] = 0xEFCDAB89;\n    context->state[2] = 0x98BADCFE;\n    context->state[3] = 0x10325476;\n    context->state[4] = 0xC3D2E1F0;\n    context->count[0] = context->count[1] = 0;\n}\n\n\n/* Run your data through this. */\nvoid SHA1_Update(SHA1_CTX* context, const uint8_t* data, const size_t len)\n{\n    size_t i, j;\n\n#ifdef VERBOSE\n    SHAPrintContext(context, \"before\");\n#endif\n\n    j = (context->count[0] >> 3) & 63;\n    if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++;\n    context->count[1] += (len >> 29);\n    if ((j + len) > 63) {\n        memcpy(&context->buffer[j], data, (i = 64-j));\n        SHA1_Transform(context->state, context->buffer);\n        for ( ; i + 63 < len; i += 64) {\n            SHA1_Transform(context->state, data + i);\n        }\n        j = 0;\n    }\n    else i = 0;\n    memcpy(&context->buffer[j], &data[i], len - i);\n\n#ifdef VERBOSE\n    SHAPrintContext(context, \"after \");\n#endif\n}\n\n\n/* Add padding and return the message digest. */\nvoid SHA1_Final(SHA1_CTX* context, uint8_t digest[SHA1_DIGEST_SIZE])\n{\n    uint32_t i;\n    uint8_t  finalcount[8];\n\n    for (i = 0; i < 8; i++) {\n        finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)]\n         >> ((3-(i & 3)) * 8) ) & 255);  /* Endian independent */\n    }\n    SHA1_Update(context, (uint8_t *)\"\\200\", 1);\n    while ((context->count[0] & 504) != 448) {\n        SHA1_Update(context, (uint8_t *)\"\\0\", 1);\n    }\n    SHA1_Update(context, finalcount, 8);  /* Should cause a SHA1_Transform() */\n    for (i = 0; i < SHA1_DIGEST_SIZE; i++) {\n        digest[i] = (uint8_t)\n         ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);\n    }\n\n    /* Wipe variables */\n    i = 0;\n    memset(context->buffer, 0, 64);\n    memset(context->state, 0, 20);\n    memset(context->count, 0, 8);\n    memset(finalcount, 0, 8);\t/* SWR */\n\n#ifdef SHA1HANDSOFF  /* make SHA1Transform overwrite its own static vars */\n    SHA1_Transform(context->state, context->buffer);\n#endif\n}\n\n/*************************************************************/\n\n#if 0\nint main(int argc, char** argv)\n{\nint i, j;\nSHA1_CTX context;\nunsigned char digest[SHA1_DIGEST_SIZE], buffer[16384];\nFILE* file;\n\n    if (argc > 2) {\n        puts(\"Public domain SHA-1 implementation - by Steve Reid <sreid@sea-to-sky.net>\");\n        puts(\"Modified for 16 bit environments 7/98 - by James H. Brown <jbrown@burgoyne.com>\");\t/* JHB */\n        puts(\"Produces the SHA-1 hash of a file, or stdin if no file is specified.\");\n        return(0);\n    }\n    if (argc < 2) {\n        file = stdin;\n    }\n    else {\n        if (!(file = fopen(argv[1], \"rb\"))) {\n            fputs(\"Unable to open file.\", stderr);\n            return(-1);\n        }\n    }\n    SHA1_Init(&context);\n    while (!feof(file)) {  /* note: what if ferror(file) */\n        i = fread(buffer, 1, 16384, file);\n        SHA1_Update(&context, buffer, i);\n    }\n    SHA1_Final(&context, digest);\n    fclose(file);\n    for (i = 0; i < SHA1_DIGEST_SIZE/4; i++) {\n        for (j = 0; j < 4; j++) {\n            printf(\"%02X\", digest[i*4+j]);\n        }\n        putchar(' ');\n    }\n    putchar('\\n');\n    return(0);\t/* JHB */\n}\n#endif\n\n/* self test */\n\n#ifdef TEST\n\nstatic char *test_data[] = {\n    \"abc\",\n    \"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq\",\n    \"A million repetitions of 'a'\"};\nstatic char *test_results[] = {\n    \"A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D\",\n    \"84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1\",\n    \"34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F\"};\n\n\nvoid digest_to_hex(const uint8_t digest[SHA1_DIGEST_SIZE], char *output)\n{\n    int i,j;\n    char *c = output;\n\n    for (i = 0; i < SHA1_DIGEST_SIZE/4; i++) {\n        for (j = 0; j < 4; j++) {\n            sprintf(c,\"%02X\", digest[i*4+j]);\n            c += 2;\n        }\n        sprintf(c, \" \");\n        c += 1;\n    }\n    *(c - 1) = '\\0';\n}\n\nint main(int argc, char** argv)\n{\n    int k;\n    SHA1_CTX context;\n    uint8_t digest[20];\n    char output[80];\n\n    fprintf(stdout, \"verifying SHA-1 implementation... \");\n\n    for (k = 0; k < 2; k++){\n        SHA1_Init(&context);\n        SHA1_Update(&context, (uint8_t*)test_data[k], strlen(test_data[k]));\n        SHA1_Final(&context, digest);\n\tdigest_to_hex(digest, output);\n\n        if (strcmp(output, test_results[k])) {\n            fprintf(stdout, \"FAIL\\n\");\n            fprintf(stderr,\"* hash of \\\"%s\\\" incorrect:\\n\", test_data[k]);\n            fprintf(stderr,\"\\t%s returned\\n\", output);\n            fprintf(stderr,\"\\t%s is correct\\n\", test_results[k]);\n            return (1);\n        }\n    }\n    /* million 'a' vector we feed separately */\n    SHA1_Init(&context);\n    for (k = 0; k < 1000000; k++)\n        SHA1_Update(&context, (uint8_t*)\"a\", 1);\n    SHA1_Final(&context, digest);\n    digest_to_hex(digest, output);\n    if (strcmp(output, test_results[2])) {\n        fprintf(stdout, \"FAIL\\n\");\n        fprintf(stderr,\"* hash of \\\"%s\\\" incorrect:\\n\", test_data[2]);\n        fprintf(stderr,\"\\t%s returned\\n\", output);\n        fprintf(stderr,\"\\t%s is correct\\n\", test_results[2]);\n        return (1);\n    }\n\n    /* success */\n    fprintf(stdout, \"ok\\n\");\n    return(0);\n}\n#endif /* TEST */\n"
  },
  {
    "path": "ext/jbig2dec/sha1.h",
    "content": "/* public api for steve reid's public domain SHA-1 implementation */\n/* this file is in the public domain */\n\n#ifndef __SHA1_H\n#define __SHA1_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct {\n    uint32_t state[5];\n    uint32_t count[2];\n    uint8_t  buffer[64];\n} SHA1_CTX;\n\n#define SHA1_DIGEST_SIZE 20\n\nvoid SHA1_Init(SHA1_CTX* context);\nvoid SHA1_Update(SHA1_CTX* context, const uint8_t* data, const size_t len);\nvoid SHA1_Final(SHA1_CTX* context, uint8_t digest[SHA1_DIGEST_SIZE]);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* __SHA1_H */\n"
  },
  {
    "path": "ext/jbig2dec/snprintf.c",
    "content": "/*\n * Revision 12: http://theos.com/~deraadt/snprintf.c\n *\n * Copyright (c) 1997 Theo de Raadt\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifdef __VMS\n#include <param.h>\n#else\n#include <sys/param.h>\n#endif\n#include <sys/types.h>\n#include <sys/mman.h>\n#include <signal.h>\n#include <stdio.h>\n#if __STDC__\n#include <stdarg.h>\n#include <stdlib.h>\n#else\n#include <varargs.h>\n#endif\n#include <setjmp.h>\n#include <unistd.h>\n#include <string.h>\n\n#ifndef roundup\n#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))\n#endif\n\n#ifdef __sgi\n#define size_t ssize_t\n#endif\n\nstatic int pgsize;\nstatic char *curobj;\nstatic int caught;\nstatic sigjmp_buf bail;\n\n#define EXTRABYTES\t2\t/* XXX: why 2? you don't want to know */\n\nstatic char *\nmsetup(str, n)\n\tchar *str;\n\tsize_t n;\n{\n\tchar *e;\n\n\tif (n == 0)\n\t\treturn NULL;\n\tif (pgsize == 0)\n\t\tpgsize = getpagesize();\n\tcurobj = (char *)malloc(n + EXTRABYTES + pgsize * 2);\n\tif (curobj == NULL)\n\t\treturn NULL;\n\te = curobj + n + EXTRABYTES;\n\te = (char *)roundup((unsigned long)e, pgsize);\n\tif (mprotect(e, pgsize, PROT_NONE) == -1) {\n\t\tfree(curobj);\n\t\tcurobj = NULL;\n\t\treturn NULL;\n\t}\n\te = e - n - EXTRABYTES;\n\t*e = '\\0';\n\treturn (e);\n}\n\nstatic void\n  mcatch( int a )\n{\n\tsiglongjmp(bail, 1);\n}\n\nstatic void\nmcleanup(str, n, p)\n\tchar *str;\n\tsize_t n;\n\tchar *p;\n{\n\tstrncpy(str, p, n-1);\n\tstr[n-1] = '\\0';\n\tif (mprotect((caddr_t)(p + n + EXTRABYTES), pgsize,\n\t    PROT_READ|PROT_WRITE|PROT_EXEC) == -1)\n\t\tmprotect((caddr_t)(p + n + EXTRABYTES), pgsize,\n\t\t    PROT_READ|PROT_WRITE);\n\tfree(curobj);\n}\n\nint\n#if __STDC__\nvsnprintf(char *str, size_t n, char const *fmt, va_list ap)\n#else\nvsnprintf(str, n, fmt, ap)\n\tchar *str;\n\tsize_t n;\n\tchar *fmt;\n\tchar *ap;\n#endif\n{\n\tstruct sigaction osa, nsa;\n\tchar *p;\n\tint ret = n + 1;\t/* if we bail, indicated we overflowed */\n\n\tmemset(&nsa, 0, sizeof nsa);\n\tnsa.sa_handler = mcatch;\n\tsigemptyset(&nsa.sa_mask);\n\n\tp = msetup(str, n);\n\tif (p == NULL) {\n\t\t*str = '\\0';\n\t\treturn 0;\n\t}\n\tif (sigsetjmp(bail, 1) == 0) {\n\t\tif (sigaction(SIGSEGV, &nsa, &osa) == -1) {\n\t\t\tmcleanup(str, n, p);\n\t\t\treturn (0);\n\t\t}\n\t\tret = vsprintf(p, fmt, ap);\n\t}\n\tmcleanup(str, n, p);\n\t(void) sigaction(SIGSEGV, &osa, NULL);\n\treturn (ret);\n}\n\nint\n#if __STDC__\nsnprintf(char *str, size_t n, char const *fmt, ...)\n#else\nsnprintf(str, n, fmt, va_alist)\n\tchar *str;\n\tsize_t n;\n\tchar *fmt;\n\tva_dcl\n#endif\n{\n\tva_list ap;\n#if __STDC__\n\tva_start(ap, fmt);\n#else\n\tva_start(ap);\n#endif\n\n\treturn (vsnprintf(str, n, fmt, ap));\n\tva_end(ap);\n}\n\n"
  },
  {
    "path": "ext/jbig2dec/test_jbig2dec.py",
    "content": "#! /usr/bin/env python\n\n# this is the testtest script for jbig2dec\n\nimport os, re\nimport sys, time\n\nclass SelfTest:\n  'generic class for self tests'\n  def __init__(self):\n    self.result = 'unrun'\n    self.msg = ''\n  def shortDescription(self):\n    'returns a short name for the test'\n    return \"generic self test\"\n  def runTest(self):\n    'call this to execute the test'\n    pass\n  def fail(self, msg=None):\n    self.result = 'FAIL'\n    self.msg = msg\n  def failIf(self, check, msg=None):\n    if check: self.fail(msg)\n  def assertEqual(self, a, b, msg=None):\n    if a != b: self.fail(msg)\n\nclass SelfTestSuite:\n  'generic class for running a collection of SelfTest instances'\n  def __init__(self, stream=sys.stderr):\n    self.stream = stream\n    self.tests = []\n    self.fails = []\n    self.xfails = []\n    self.errors = []\n  def addTest(self, test):\n    self.tests.append(test)\n  def run(self):\n    starttime = time.time()\n    for test in self.tests:\n      self.stream.write(\"%s ... \" % test.shortDescription())\n      test.result = 'ok'\n      test.runTest()\n      if test.result != 'ok':\n        self.fails.append(test)\n      self.stream.write(\"%s\\n\" % test.result)\n    stoptime = time.time()\n    self.stream.write('-'*72 + '\\n')\n    self.stream.write('ran %d tests in %.3f seconds\\n\\n' % \n\t(len(self.tests), stoptime - starttime))\n    if len(self.fails):\n      self.stream.write('FAILED %d of %d tests\\n' % \n\t(len(self.fails),len(self.tests)))\n    else:\n      self.stream.write('PASSED all %d tests\\n' % len(self.tests))\n\nclass KnownFileHash(SelfTest):\n  'self test to check for correct decode of known test files'\n\n  # hashes of known test inputs\n  known_042_DECODED = \"ebfdf6e2fc5ff3ee2271c2fa19de0e52712046e8\"\n  # we do not have correct hashes for these\n  known_amb_DECODED = \"ff32ffff0776ff66ff254129ff28ffffffff6bff\"\n\n  # these are known test files in the form\n  # (filename, sha-1(file), sha-1(decoded document)\n  known_hashes = ( ('../ubc/042_1.jb2',\n\t\t\t\"673e1ee5c55ab241b171e476ba1168a42733ddaa\",\n\t\t\tknown_042_DECODED),\n                   ('../ubc/042_2.jb2', \n                        \"9aa2804e2d220952035c16fb3c907547884067c5\",\n                        known_042_DECODED),\n                   ('../ubc/042_3.jb2',\n\t\t\t\"9663a5f35727f13e61a0a2f0a64207b1f79e7d67\",\n\t\t\tknown_042_DECODED),\n                   ('../ubc/042_4.jb2',\n\t\t\t\"014df658c8b99b600c2ceac3f1d53c7cc2b4917c\",\n                        known_042_DECODED),\n                   ('../ubc/042_5.jb2',\n\t\t\t\"264720a6ccbbf72aa6a2cfb6343f43b8e6f2da4b\",\n                        known_042_DECODED),\n                   ('../ubc/042_6.jb2',\n\t\t\t\"96f7dc9df4a1b305f9ac082dd136f85ef5b108fe\",\n\t\t\tknown_042_DECODED),\n                   ('../ubc/042_7.jb2',\n\t\t\t\"5526371ba9dc2b8743f20ae3e05a7e60b3dcba76\",\n\t\t\tknown_042_DECODED),\n                   ('../ubc/042_8.jb2',\n\t\t\t\"4bf0c87dfaf40d67c36f2a083579eeda26d54641\",\n\t\t\tknown_042_DECODED),\n                   ('../ubc/042_9.jb2',\n\t\t\t\"53e630e7fe2fe6e1d6164758e15fc93382e07f55\",\n\t\t\tknown_042_DECODED),\n                   ('../ubc/042_10.jb2',\n\t\t\t\"5ca1364367e25cb8f642e9dc677a94d5cfed0c8b\",\n\t\t\tknown_042_DECODED),\n                   ('../ubc/042_11.jb2',\n\t\t\t\"bc194caf022bc5345fc41259e05cea3c08245216\",\n\t\t\tknown_042_DECODED),\n                   ('../ubc/042_12.jb2',\n\t\t\t\"f354df8eb4849bc707f088739e322d1fe3a14ef3\",\n\t\t\tknown_042_DECODED),\n                   ('../ubc/042_13.jb2',\n\t\t\t\"7d428bd542f58591b254d9827f554b0552c950a7\",\n\t\t\tknown_042_DECODED),\n                   ('../ubc/042_14.jb2',\n\t\t\t\"c40fe3a02acb6359baf9b40fc9c49bc0800be589\",\n\t\t\tknown_042_DECODED),\n                   ('../ubc/042_15.jb2',\n\t\t\t\"a9e39fc1ecb178aec9f05039514d75ea3246246c\",\n\t\t\tknown_042_DECODED),\n                   ('../ubc/042_16.jb2',\n\t\t\t\"4008bbca43670f3c90eaee26516293ba95baaf3d\",\n\t\t\tknown_042_DECODED),\n                   ('../ubc/042_17.jb2',\n\t\t\t\"0ff95637b64c57d659a41c582da03e25321551fb\",\n\t\t\tknown_042_DECODED),\n                   ('../ubc/042_18.jb2',\n\t\t\t\"87381d044f00c4329200e44decbe91bebfa31595\",\n\t\t\tknown_042_DECODED),\n                   ('../ubc/042_19.jb2',\n\t\t\t\"387d95a140b456d4742622c788cf5b51cebbf438\",\n\t\t\tknown_042_DECODED),\n                   ('../ubc/042_20.jb2',\n\t\t\t\"85c19e9ec42b8ddd6b860a1bebea1c67610e7a59\",\n\t\t\tknown_042_DECODED),\n                   ('../ubc/042_21.jb2',\n\t\t\t\"ab535c7d7a61a7b9dc53d546e7419ca78ac7f447\",\n\t\t\tknown_042_DECODED),\n                   ('../ubc/042_22.jb2',\n\t\t\t\"a9e2b365be63716dbde74b0661c3c6efd2a6844d\",\n\t\t\tknown_042_DECODED),\n                   ('../ubc/042_23.jb2',\n\t\t\t\"8ffa40a05e93e10982b38a2233a8da58c1b5c343\",\n\t\t\tknown_042_DECODED),\n                   ('../ubc/042_24.jb2',\n\t\t\t\"2553fe65111c58f6412de51d8cdc71651e778ccf\",\n\t\t\tknown_042_DECODED),\n                   ('../ubc/042_25.jb2',\n\t\t\t\"52de4a3b86252d896a8d783ba71dd0699333dd69\",\n\t\t\tknown_042_DECODED),\n                   ('../ubc/amb_1.jb2',\n\t\t\t\"d6d6d1c981dc37a09108c1e3ed990aa5b345fa6a\",\n                        known_amb_DECODED),\n                   ('../ubc/amb_2.jb2',\n\t\t\t\"9af6616a89eb03f8934de72626e301a716366c3c\",\n                        known_amb_DECODED),\n                   ('../str-p39',\n\t\t\t\"1a303e33d3ea57eb7e19a676a1b2f28baa29b045\",\n                        \"ff373f070f5f405b732c53ffffff087eff22ff5b\") )\n\n  def __init__(self, file, file_hash, decode_hash):\n    SelfTest.__init__(self)\n    self.file = file\n    self.file_hash = file_hash\n    self.decode_hash = decode_hash\n\n  def shortDescription(self):\n    return \"Checking '%s' for correct decoded document hash\" % self.file\n\n  def runTest(self):\n    '''jbig2dec should return proper document hashes for known files'''\n    # invoke jbig2dec on our file\n    instance = os.popen('./jbig2dec -q -o /dev/null --hash ' + self.file)\n    lines = instance.readlines()\n    exit_code = instance.close()\n    self.failIf(exit_code, 'jbig2dec should exit normally')\n    # test here for correct hash\n    hash_pattern = re.compile('[0-9a-f]{%d}' % len(decode_hash))\n    for line in lines:\n      m = hash_pattern.search(line.lower())\n      if m:\n        self.assertEqual(self.decode_hash, m.group(),\n          'hash of known decoded document must be correct')\n        return\n    self.fail('document hash was not found in the output')\n\nsuite = SelfTestSuite()\nfor filename, file_hash, decode_hash in KnownFileHash.known_hashes:\n  # only add tests for files we can find\n  if not os.access(filename, os.R_OK): continue\n  # todo: verify our file matches its encoded document hash\n  suite.addTest(KnownFileHash(filename, file_hash, decode_hash))\n\n# run the defined tests if we're called as a script\nif __name__ == \"__main__\":\n    result = suite.run()\n    sys.exit(not result)\n"
  },
  {
    "path": "ext/libdjvu/Arrays.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"Arrays.h\"\n#include \"GException.h\"\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nArrayRep::ArrayRep(int xelsize,\n\t\t   void (* xdestroy)(void *, int, int),\n\t\t   void (* xinit1)(void *, int, int),\n\t\t   void (* xinit2)(void *, int, int, const void *, int, int),\n\t\t   void (* xcopy)(void *, int, int, const void *, int, int),\n\t\t   void (* xinsert)(void *, int, int, const void *, int)) :\n      data(0), minlo(0), maxhi(-1), lobound(0), hibound(-1),\n      elsize(xelsize), destroy(xdestroy), init1(xinit1),\n      init2(xinit2), copy(xcopy), insert(xinsert)\n{\n}\n\nArrayRep::ArrayRep(int xelsize,\n\t\t   void (* xdestroy)(void *, int, int),\n\t\t   void (* xinit1)(void *, int, int),\n\t\t   void (* xinit2)(void *, int, int, const void *, int, int),\n\t\t   void (* xcopy)(void *, int, int, const void *, int, int),\n\t\t   void (* xinsert)(void *, int, int, const void *, int),\n\t\t   int hi) : data(0), minlo(0), maxhi(-1),\n   lobound(0), hibound(-1), elsize(xelsize), destroy(xdestroy), init1(xinit1),\n   init2(xinit2), copy(xcopy), insert(xinsert)\n{\n   resize(0, hi);\n}\n\nArrayRep::ArrayRep(int xelsize,\n\t\t   void (* xdestroy)(void *, int, int),\n\t\t   void (* xinit1)(void *, int, int),\n\t\t   void (* xinit2)(void *, int, int, const void *, int, int),\n\t\t   void (* xcopy)(void *, int, int, const void *, int, int),\n\t\t   void (* xinsert)(void *, int, int, const void *, int),\n\t\t   int lo, int hi) : data(0), minlo(0), maxhi(-1),\n   lobound(0), hibound(-1), elsize(xelsize), destroy(xdestroy), init1(xinit1),\n   init2(xinit2), copy(xcopy), insert(xinsert)\n{\n   resize(lo,hi);\n}\n\nArrayRep::ArrayRep(const ArrayRep & arr) : data(0), minlo(0), maxhi(-1),\n   lobound(0), hibound(-1), elsize(arr.elsize), destroy(arr.destroy),\n   init1(arr.init1), init2(arr.init2), copy(arr.copy), insert(arr.insert)\n{\n   resize(arr.lobound, arr.hibound);\n   arr.copy(data, lobound-minlo, hibound-minlo,\n\t    arr.data, arr.lobound-arr.minlo, arr.hibound-arr.minlo);\n}\n\nArrayRep::~ArrayRep()\n{\n   destroy(data, lobound-minlo, hibound-minlo);\n   operator delete(data);\n   data=0;\n}\n\nArrayRep & \nArrayRep::operator= (const ArrayRep & rep)\n{\n   if (&rep == this) return *this;\n   empty();\n   resize(rep.lobound, rep.hibound);\n   copy(data, lobound-minlo, hibound-minlo,\n\trep.data, rep.lobound-rep.minlo, rep.hibound-rep.minlo);\n   return *this;\n}\n\nvoid\nArrayRep::resize(int lo, int hi)\n{\n  int nsize = hi - lo + 1;\n  // Validation\n  if (nsize < 0)\n    G_THROW( ERR_MSG(\"arrays.resize\") );\n  // Destruction\n  if (nsize == 0)\n    {\n      destroy(data, lobound-minlo, hibound-minlo);\n      operator delete(data);\n      data = 0;\n      lobound = minlo = lo; \n      hibound = maxhi = hi; \n      return;\n    }\n  // Simple extension\n  if (lo >= minlo && hi <= maxhi)\n    {\n      init1(data, lo-minlo, lobound-1-minlo);\n      destroy(data, lobound-minlo, lo-1-minlo);\n      init1(data, hibound+1-minlo, hi-minlo);\n      destroy(data, hi+1-minlo, hibound-minlo);\n      lobound = lo;\n      hibound = hi;\n      return;\n    }\n  // General case\n  int nminlo = minlo;\n  int nmaxhi = maxhi;\n  if (nminlo > nmaxhi)\n    nminlo = nmaxhi = lo;\n  while (nminlo > lo) {\n    int incr = nmaxhi - nminlo;\n    nminlo -= (incr < 8 ? 8 : (incr > 32768 ? 32768 : incr));\n  }\n  while (nmaxhi < hi) {\n    int incr = nmaxhi - nminlo;\n    nmaxhi += (incr < 8 ? 8 : (incr > 32768 ? 32768 : incr));\n  }\n  // allocate\n  int bytesize=elsize*(nmaxhi-nminlo+1);\n  void * ndata;\n  GPBufferBase gndata(ndata,bytesize,1);\n  memset(ndata, 0, bytesize);\n  // initialize\n  init1(ndata, lo-nminlo, lobound-1-nminlo);\n  init2(ndata, lobound-nminlo, hibound-nminlo,\n        data, lobound-minlo, hibound-minlo);\n  init1(ndata, hibound+1-nminlo, hi-nminlo);\n  destroy(data, lobound-minlo, hibound-minlo);\n\n  // free and replace\n  void *tmp=data;\n  data = ndata;\n  ndata=tmp;\n\n  minlo = nminlo;\n  maxhi = nmaxhi;\n  lobound = lo;\n  hibound = hi;\n}\n\nvoid\nArrayRep::shift(int disp)\n{\n   lobound += disp;\n   hibound += disp;\n   minlo += disp;\n   maxhi += disp;\n}\n\nvoid\nArrayRep::del(int n, unsigned int howmany)\n{\n   if (howmany == 0)\n      return;\n   if ((int)(n + howmany) > hibound +1)\n      G_THROW( ERR_MSG(\"arrays.ill_arg\") );\n   copy(data, n-minlo, hibound-howmany-minlo,\n\tdata, n+howmany-minlo, hibound-minlo);\n   destroy(data, hibound+1-howmany-minlo, hibound-minlo);\n   hibound = hibound - howmany;\n}\n\nvoid\nArrayRep::ins(int n, const void * what, unsigned int howmany)\n{\n   int nhi = hibound + howmany;\n   if (howmany == 0) return;\n   if (maxhi < nhi)\n   {\n      int nmaxhi = maxhi;\n      while (nmaxhi < nhi)\n\t nmaxhi += (nmaxhi < 8 ? 8 : (nmaxhi > 32768 ? 32768 : nmaxhi));\n      int bytesize = elsize*(nmaxhi-minlo+1);\n      void *ndata;\n      GPBufferBase gndata(ndata,bytesize,1);\n      memset(ndata, 0, bytesize);\n      copy(ndata, lobound-minlo, hibound-minlo,\n\t   data, lobound-minlo, hibound-minlo);\n      destroy(data, lobound-minlo, hibound-minlo);\n      data=ndata;\n      maxhi = nmaxhi;\n   }\n\n   insert(data, hibound+1-minlo, n-minlo, what, howmany);\n   hibound=nhi;\n}\n\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n\n\n// ---------------------------------------\n// BEGIN HACK\n// ---------------------------------------\n// Included here to avoid dependency\n// from ByteStream.o to Arrays.o\n\n#ifndef DO_NOT_MOVE_GET_DATA_TO_ARRAYS_CPP\n#include \"ByteStream.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\nTArray<char>\nByteStream::get_data(void)\n{\n   const int s=size();\n   if(s > 0)\n   {\n     TArray<char> data(0, s-1);\n     readat((char*)data, s, 0);\n     return data;\n   }else\n   {\n     TArray<char> data(0, -1);\n     return data;\n   }\n}\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n\n// ---------------------------------------\n// END HACK\n// ---------------------------------------\n\n"
  },
  {
    "path": "ext/libdjvu/Arrays.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _ARRAYS_H_\n#define _ARRAYS_H_\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n#include \"GException.h\"\n#include \"GSmartPointer.h\"\n#include <string.h>\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n\n/** @name Arrays.h\n\n    Files #\"Arrays.h\"# and #\"Arrays.cpp\"# implement three array template classes.\n    Class \\Ref{TArray} implements an array of objects of trivial types\n    such as #char#, #int#, #float#, etc. It is faster than general implementation\n    for any type done in \\Ref{DArray} because it does not cope with\n    element's constructors, destructors and copy operators. Although\n    implemented as a template, which makes it possible to incorrectly use\n    \\Ref{TArray} with non-trivial classes, it should not be done.\n\n    A lot of things is shared by these three arrays. That is why there are\n    more base classes:\n    \\begin{itemize}\n       \\item \\Ref{ArrayBase} defines functions independent of the elements type\n       \\item \\Ref{ArrayBaseT} template class defining functions shared by\n             \\Ref{DArray} and \\Ref{TArray}\n    \\end{itemize}\n\n    The main difference between \\Ref{GArray} (now obsolete) and these ones\n    is the copy-on-demand strategy, which allows you to copy array objects\n    without copying the real data. It's the same thing, which has been\n    implemented in \\Ref{GString} long ago: as long as you don't try to modify\n    the underlying data, it may be shared between several copies of array\n    objects. As soon as you attempt to make any changes, a private copy\n    is created automatically and transparently for you - the procedure, that\n    we call \"copy-on-demand\".\n\n    Also, please note that now there is no separate class, which does fast\n    sorting. Both \\Ref{TArray} (dynamic array for trivial types) and\n    \\Ref{DArray} (dynamic array for arbitrary types) can sort their elements.\n    \n    {\\bf Historical comments} --- Leon chose to implement his own arrays because\n    the STL classes were not universally available and the compilers were\n    rarely able to deal with such a template galore. Later it became clear\n    that there is no really good reason why arrays should be derived from\n    containers. It was also suggested to create separate arrays implementation\n    for simple classes and do the copy-on-demand strategy, which would allow\n    to assign array objects without immediate copying of their elements. \n\n    At this point \\Ref{DArray} and \\Ref{TArray} should only be used when\n    it is critical to have the copy-on-demand feature.  The \\Ref{GArray}\n    implementation is a lot more efficient.\n    \n    @memo Template array classes.\n    @author \n    Andrei Erofeev <eaf@geocities.com> -- Copy-on-demand implementation.\n*/\n//@{\n\n// Auxiliary classes: Will be used in place of GPBase and GPEnabled objects\nclass _ArrayRep\n{\n   friend class\t_ArrayBase;\npublic:\n   _ArrayRep(void) : count(0) {}\n   _ArrayRep(const _ArrayRep &) {}\n   virtual ~_ArrayRep(void) {}\n\n   _ArrayRep & operator=(const _ArrayRep &) { return *this; }\n\n   int\t\tget_count(void) const { return count; }\nprivate:\n   int\t\tcount;\n\n   void\t\tref(void) { count++; }\n   void\t\tunref(void) { if (--count==0) delete this; }\n};\n\nclass _ArrayBase\n{\npublic:\n   _ArrayBase(void) : rep(0) {}\n   _ArrayBase(const _ArrayBase & ab) : rep(0)\n   {\n      if (ab.rep) ab.rep->ref();\n      rep=ab.rep;\n   }\n   _ArrayBase(_ArrayRep * ar) : rep(0)\n   {\n      if (ar) ar->ref();\n      rep=ar;\n   }\n   virtual ~_ArrayBase(void)\n   {\n      if (rep) { rep->unref(); rep=0; }\n   }\n\n   _ArrayRep *\tget(void) const { return rep; }\n   _ArrayBase & assign(_ArrayRep * ar)\n   {\n      if (ar) ar->ref();\n      if (rep) rep->unref();\n      rep=ar;\n      return *this;\n   }\n   _ArrayBase &\toperator=(const _ArrayBase & ab) { return assign(ab.rep); }\n   bool\t\toperator==(const _ArrayBase & ab) { return rep==ab.rep; }\nprivate:\n   _ArrayRep\t* rep;\n};\n\n// Internal \"Array repository\" holding the pointer to the actual data,\n// data bounds, etc. It copes with data elements with the help of five\n// static functions which pointers are supposed to be passed to the\n// constructor.\nclass DJVUAPI ArrayRep : public _ArrayRep\n{\npublic:\n   ArrayRep(int elsize,\n\t    void (* xdestroy)(void *, int, int),\n\t    void (* xinit1)(void *, int, int),\n\t    void (* xinit2)(void *, int, int, const void *, int, int),\n\t    void (* xcopy)(void *, int, int, const void *, int, int),\n\t    void (* xinsert)(void *, int, int, const void *, int));\n   ArrayRep(int elsize,\n\t    void (* xdestroy)(void *, int, int),\n\t    void (* xinit1)(void *, int, int),\n\t    void (* xinit2)(void *, int, int, const void *, int, int),\n\t    void (* xcopy)(void *, int, int, const void *, int, int),\n\t    void (* xinsert)(void *, int, int, const void *, int),\n\t    int hibound);\n   ArrayRep(int elsize,\n\t    void (* xdestroy)(void *, int, int),\n\t    void (* xinit1)(void *, int, int),\n\t    void (* xinit2)(void *, int, int, const void *, int, int),\n\t    void (* xcopy)(void *, int, int, const void *, int, int),\n\t    void (* xinsert)(void *, int, int, const void *, int),\n\t    int lobound, int hibound);\n   ArrayRep(const ArrayRep & rep);\n   \n   virtual ~ArrayRep();\n   \n      // Following is the standard interface to DArray. DArray will call these\n      // functions to access data.\n   int\t\tsize() const;\n   int\t\tlbound() const;\n   int\t\thbound() const;\n\n   void\t\tempty();\n   void\t\ttouch(int n);\n   void\t\tresize(int lobound, int hibound);\n   void\t\tshift(int disp);\n   void\t\tdel(int n, unsigned int howmany=1);\n\n      // ins() is an exception. It does it job only partially.\n      // The derived class is supposed to finish insertion.\n   void\t\tins(int n, const void * what, unsigned int howmany);\n\n   ArrayRep &\toperator=(const ArrayRep & rep);\n\n      // All data is public because DArray... classes will need access to it\n   void\t\t*data;\n   int\t\tminlo;\n   int\t\tmaxhi;\n   int\t\tlobound;\n   int\t\thibound;\n   int\t\telsize;\nprivate:\n      // These functions can't be virtual as they're called from\n      // constructors and destructors :((\n      // destroy(): should destroy elements in data[] array from 'lo' to 'hi'\n   void\t\t(* destroy)(void * data, int lo, int hi);\n      // init1(): should initialize elements in data[] from 'lo' to 'hi'\n      // using default constructors\n   void\t\t(* init1)(void * data, int lo, int hi);\n      // init2(): should initialize elements in data[] from 'lo' to 'hi'\n      // using corresponding elements from src[] (copy constructor)\n   void\t\t(* init2)(void * data, int lo, int hi,\n\t\t\t  const void * src, int src_lo, int src_hi);\n      // copy(): should copy elements from src[] to dst[] (copy operator)\n   void\t\t(* copy)(void * dst, int dst_lo, int dst_hi,\n\t\t\t const void * src, int src_lo, int src_hi);\n      // insert(): should insert '*what' at position 'where' 'howmany' times\n      // into array data[] having 'els' initialized elements\n   void\t\t(* insert)(void * data, int els, int where, const void * what,\n\t\t\t   int howmany);\n};\n\ninline int\nArrayRep::size() const\n{\n   return hibound - lobound + 1;\n}\n\ninline int\nArrayRep::lbound() const\n{\n  return lobound;\n}\n\ninline int\nArrayRep::hbound() const\n{\n  return hibound;\n}\n\ninline void\nArrayRep::empty()\n{\n  resize(0, -1);\n}\n\ninline void\nArrayRep::touch(int n)\n{\n   if (hibound < lobound)\n   {\n      resize(n,n);\n   } else\n   {\n      int nlo = lobound;\n      int nhi = hibound;\n      if (n < nlo) nlo = n;\n      if (n > nhi) nhi = n;\n      resize(nlo, nhi);\n   }\n}\n\n/** Dynamic array base class.\n    This is an auxiliary base class for \\Ref{DArray} and \\Ref{TArray}\n    implementing some shared functions independent of the type of array\n    elements. It's not supposed to be constructed by hands. Use \\Ref{DArray}\n    and \\Ref{TArray} instead.\n    */\n    \nclass DJVUAPI ArrayBase : protected _ArrayBase\n{\nprotected:\n   void\t\tcheck(void);\n   void\t\tdetach(void);\n\n   ArrayBase(void) {};\npublic:\n   /// Returns the number of elements in the array\n   int\t\tsize() const;\n   /** Returns the lower bound of the valid subscript range. */\n   int\t\tlbound() const;\n   /** Returns the upper bound of the valid subscript range. */\n   int\t\thbound() const;\n   /** Erases the array contents. All elements in the array are destroyed.  \n       The valid subscript range is set to the empty range. */\n   void empty();\n   /** Extends the subscript range so that is contains #n#.\n       This function does nothing if #n# is already int the valid subscript range.\n       If the valid range was empty, both the lower bound and the upper bound\n       are set to #n#.  Otherwise the valid subscript range is extended\n       to encompass #n#. This function is very handy when called before setting\n       an array element:\n       \\begin{verbatim}\n       int lineno=1;\n       DArray<GString> a;\n       while (! end_of_file()) { \n       a.touch[lineno]; \n       a[lineno++] = read_a_line(); \n       }\n       \\end{verbatim} \n   */\n   void touch(int n);\n   /** Resets the valid subscript range to #0#---#hibound#.\n       This function may destroy some array elements and may construct\n       new array elements with the null constructor. Setting #hibound# to\n       #-1# resets the valid subscript range to the empty range.\n       @param hibound upper bound of the new subscript range. */      \n   void resize(int hibound);\n   /** Resets the valid subscript range to #lobound#---#hibound#. \n       This function may destroy some array elements and may construct\n       new array elements with the null constructor. Setting #lobound# to #0# and\n       #hibound# to #-1# resets the valid subscript range to the empty range.\n       @param lobound lower bound of the new subscript range.\n       @param hibound upper bound of the new subscript range. */\n   void resize(int lobound, int hibound);\n   /** Shifts the valid subscript range. Argument #disp# is added to both \n       bounds of the valid subscript range. Array elements previously\n       located at subscript #x# will now be located at subscript #x+disp#. */\n   void shift(int disp);\n   /** Deletes array elements. The array elements corresponding to\n       subscripts #n#...#n+howmany-1# are destroyed. All array elements\n       previously located at subscripts greater or equal to #n+howmany#\n       are moved to subscripts starting with #n#. The new subscript upper\n       bound is reduced in order to account for this shift. \n       @param n subscript of the first element to delete.\n       @param howmany number of elements to delete. */\n   void del(int n, unsigned int howmany=1);\n\n   virtual ~ArrayBase(void) {};\n};\n\ninline void\nArrayBase::detach(void)\n{\n   ArrayRep * new_rep=new ArrayRep(*(ArrayRep *) get());\n   assign(new_rep);\n}\n\ninline void\nArrayBase::check(void)\n{\n   if (get()->get_count()>1) detach();\n}\n\ninline int\nArrayBase::size() const\n{\n   return ((const ArrayRep *) get())->size();\n}\n\ninline int\nArrayBase::lbound() const\n{\n   return ((const ArrayRep *) get())->lobound;\n}\n\ninline int\nArrayBase::hbound() const\n{\n   return ((const ArrayRep *) get())->hibound;\n}\n\ninline void\nArrayBase::empty()\n{\n   check();\n   ((ArrayRep *) get())->empty();\n}\n\ninline void\nArrayBase::resize(int lo, int hi)\n{\n   check();\n   ((ArrayRep *) get())->resize(lo, hi);\n}\n\ninline void\nArrayBase::resize(int hi)\n{\n   resize(0, hi);\n}\n\ninline void\nArrayBase::touch(int n)\n{\n   check();\n   ((ArrayRep *) get())->touch(n);\n}\n\ninline void\nArrayBase::shift(int disp)\n{\n   check();\n   ((ArrayRep *) get())->shift(disp);\n}\n\ninline void\nArrayBase::del(int n, unsigned int howmany)\n{\n   check();\n   \n   ((ArrayRep *) get())->del(n, howmany);\n}\n\n/** Dynamic array template base class.\n    This is an auxiliary template base class for \\Ref{DArray} and \\Ref{TArray}\n    implementing some shared functions which {\\em depend} on the type of\n    the array elements (this is contrary to \\Ref{ArrayBase}).\n    It's not supposed to be constructed by hands. Use \\Ref{DArray} and\n    \\Ref{TArray} instead.\n    */\n\ntemplate <class TYPE>\nclass ArrayBaseT : public ArrayBase\n{\npublic:\n   virtual ~ArrayBaseT(void) {};\n   \n   /** Returns a reference to the array element for subscript #n#.  This\n       reference can be used for both reading (as \"#a[n]#\") and writing (as\n       \"#a[n]=v#\") an array element.  This operation will not extend the valid\n       subscript range: an exception \\Ref{GException} is thrown if argument #n#\n       is not in the valid subscript range. */\n   TYPE& operator[](int n);\n   /** Returns a constant reference to the array element for subscript #n#.\n       This reference can only be used for reading (as \"#a[n]#\") an array\n       element.  This operation will not extend the valid subscript range: an\n       exception \\Ref{GException} is thrown if argument #n# is not in the valid\n       subscript range.  This variant of #operator[]# is necessary when dealing\n       with a #const DArray<TYPE>#. */\n   const TYPE& operator[](int n) const;\n   \n   /** Returns a pointer for reading or writing the array elements.  This\n       pointer can be used to access the array elements with the same\n       subscripts and the usual bracket syntax.  This pointer remains valid as\n       long as the valid subscript range is unchanged. If you change the\n       subscript range, you must stop using the pointers returned by prior\n       invocation of this conversion operator. */\n   operator TYPE* ();\n   /** Returns a pointer for reading (but not modifying) the array elements.\n       This pointer can be used to access the array elements with the same\n       subscripts and the usual bracket syntax.  This pointer remains valid as\n       long as the valid subscript range is unchanged. If you change the\n       subscript range, you must stop using the pointers returned by prior\n       invocation of this conversion operator. */\n   operator const TYPE* () const;\n   \n   /** Insert new elements into an array. This function inserts\n       #howmany# elements at position #n# into the array. The initial value #val#\n       is copied into the new elements. All array elements previously located at subscripts\n       #n# and higher are moved to subscripts #n+howmany# and higher. The upper bound of the \n       valid subscript range is increased in order to account for this shift.\n       @param n subscript of the first inserted element.\n       @param val initial value of the new elements.\n       @param howmany number of elements to insert. */\n   void ins(int n, const TYPE &val, unsigned int howmany=1);\n\n   /** Sort array elements.  Sort all array elements in ascending order.  Array\n       elements are compared using the less-or-equal comparison operator for\n       type #TYPE#. */\n   void sort();\n   /** Sort array elements in subscript range #lo# to #hi#.  Sort all array\n       elements whose subscripts are in range #lo#..#hi# in ascending order.\n       The other elements of the array are left untouched.  An exception is\n       thrown if arguments #lo# and #hi# are not in the valid subscript range.\n       Array elements are compared using the less-or-equal comparison operator\n       for type #TYPE#.  \n       @param lo low bound for the subscripts of the elements to sort.  \n       @param hi high bound for the subscripts of the elements to sort. */\n   void sort(int lo, int hi);\nprotected:\n   ArrayBaseT(void) {};\nprivate:\n      // Callbacks called from ArrayRep\n   static void\t\tdestroy(void * data, int lo, int hi);\n   static void\t\tinit1(void * data, int lo, int hi);\n   static void\t\tinit2(void * data, int lo, int hi,\n\t\t\t     const void * src, int src_lo, int src_hi);\n   static void\t\tcopy(void * dst, int dst_lo, int dst_hi,\n\t\t\t     const void * src, int src_lo, int src_hi);\n   static void\t\tinsert(void * data, int els, int where,\n\t\t\t       const void * what, int howmany);\n};\n\ntemplate <class TYPE> inline\nArrayBaseT<TYPE>::operator TYPE* ()\n{\n   check();\n   \n   ArrayRep * rep=(ArrayRep *) get();\n   return &((TYPE *) rep->data)[-rep->minlo];\n}\n\ntemplate <class TYPE> inline\nArrayBaseT<TYPE>::operator const TYPE* () const\n{\n   const ArrayRep * rep=(const ArrayRep *) get();\n   return &((const TYPE *) rep->data)[-rep->minlo];\n}\n\ntemplate <class TYPE> inline TYPE& \nArrayBaseT<TYPE>::operator[](int n)\n{\n   check();\n\n   ArrayRep * rep=(ArrayRep *) get();\n   if (n<rep->lobound || n>rep->hibound)\n      G_THROW( ERR_MSG(\"arrays.ill_sub\") );\n   return ((TYPE *) rep->data)[n - rep->minlo];\n}\n\ntemplate <class TYPE> inline const TYPE& \nArrayBaseT<TYPE>::operator[](int n) const\n{\n   const ArrayRep * rep=(const ArrayRep *) get();\n   if (n<rep->lobound || n>rep->hibound)\n      G_THROW( ERR_MSG(\"arrays.ill_sub\") );\n   return ((const TYPE *) rep->data)[n - rep->minlo];\n}\n\ntemplate <class TYPE> inline void\nArrayBaseT<TYPE>::ins(int n, const TYPE &val, unsigned int howmany)\n{\n   check();\n   \n   ((ArrayRep *) get())->ins(n, &val, howmany);\n}\n\ntemplate <class TYPE> void\nArrayBaseT<TYPE>::sort()\n{\n   sort(lbound(), hbound());\n}\n\ntemplate <class TYPE> void\nArrayBaseT<TYPE>::sort(int lo, int hi)\n{\n   if (hi <= lo)\n      return;\n      // Test for insertion sort (optimize!)\n   if (hi <= lo + 20)\n   {\n      for (int i=lo+1; i<=hi; i++)\n      {\n\t int j = i;\n\t TYPE tmp = (*this)[i];\n\t while ((--j>=lo) && !((*this)[j]<=tmp))\n            (*this)[j+1] = (*this)[j];\n\t (*this)[j+1] = tmp;\n      }\n      return;\n   }\n      // -- determine suitable quick-sort pivot\n   TYPE tmp = (*this)[lo];\n   TYPE pivot = (*this)[(lo+hi)/2];\n   if (pivot <= tmp)\n   { tmp = pivot; pivot=(*this)[lo]; }\n   if ((*this)[hi] <= tmp)\n   { pivot = tmp; }\n   else if ((*this)[hi] <= pivot)\n   { pivot = (*this)[hi]; }\n      // -- partition set\n   int h = hi;\n   int l = lo;\n   while (l < h)\n   {\n      while (! (pivot <= (*this)[l])) l++;\n      while (! ((*this)[h] <= pivot)) h--;\n      if (l < h)\n      {\n\t tmp = (*this)[l];\n\t (*this)[l] = (*this)[h];\n\t (*this)[h] = tmp;\n\t l = l+1;\n\t h = h-1;\n      }\n   }\n      // -- recursively restart\n   sort(lo, h);\n   sort(l, hi);\n}\n\n/** Dynamic array for simple types.  \n    Template class #TArray<TYPE># implements an array of\n    elements of {\\em simple} type #TYPE#. {\\em Simple} means that the type\n    may be #char#, #int#, #float# etc. The limitation is imposed by the\n    way in which the #TArray# is working with its elements: it's not trying\n    to execute elements' constructors, destructors or copy operators. It's\n    just doing bitwise copy. Except for this it's pretty much the same as\n    \\Ref{DArray}.\n    \n    Please note that most of the methods are implemented in the base classes\n    \\Ref{ArrayBase} and \\Ref{ArrayBaseT}.\n*/\n\ntemplate <class TYPE>\nclass TArray : public ArrayBaseT<TYPE> {\npublic:\n   /** Constructs an empty array. The valid subscript range is initially\n       empty. Member function #touch# and #resize# provide convenient ways\n       to enlarge the subscript range. */\n   TArray();\n   /** Constructs an array with subscripts in range 0 to #hibound#. \n       The subscript range can be subsequently modified with member functions\n       #touch# and #resize#.\n       @param hibound upper bound of the initial subscript range. */\n   TArray(int hibound);\n   /** Constructs an array with subscripts in range #lobound# to #hibound#.  \n       The subscript range can be subsequently modified with member functions\n       #touch# and #resize#.\n       @param lobound lower bound of the initial subscript range.\n       @param hibound upper bound of the initial subscript range. */\n   TArray(int lobound, int hibound);\n   \n   virtual ~TArray() {};\nprivate:\n      // Callbacks called from ArrayRep\n   static void\t\tdestroy(void * data, int lo, int hi);\n   static void\t\tinit1(void * data, int lo, int hi);\n   static void\t\tinit2(void * data, int lo, int hi,\n\t\t\t     const void * src, int src_lo, int src_hi);\n   static void\t\tinsert(void * data, int els, int where,\n\t\t\t       const void * what, int howmany);\n};\n\ntemplate <class TYPE> void\nTArray<TYPE>::destroy(void * data, int lo, int hi)\n{\n}\n\ntemplate <class TYPE> void\nTArray<TYPE>::init1(void * data, int lo, int hi)\n{\n}\n\ntemplate <class TYPE> void\nTArray<TYPE>::init2(void * data, int lo, int hi,\n\t\t    const void * src, int src_lo, int src_hi)\n{\n   if (data && src)\n   {\n      int els=hi-lo+1;\n      if (els>src_hi-src_lo+1) els=src_hi-src_lo+1;\n      if (els>0)\n\t memmove((void *) &((TYPE *) data)[lo],\n\t\t (void *) &((TYPE *) src)[src_lo], els*sizeof(TYPE));\n   };\n}\n\n// inline removed\ntemplate <class TYPE> void\nTArray<TYPE>::insert(void * data, int els, int where,\n\t\t     const void * what, int howmany)\n{\n   memmove(((TYPE *) data)+where+howmany,\n\t   ((TYPE *) data)+where, sizeof(TYPE)*(els-where));\n   for(int i=0;i<howmany;i++)\n      ((TYPE *) data)[where+i]=*(TYPE *) what;\n}\n\ntemplate <class TYPE> \nTArray<TYPE>::TArray ()\n{\n   this->assign(new ArrayRep(sizeof(TYPE), destroy, init1,\n\t\t       init2, init2, insert));\n}\n\ntemplate <class TYPE> \nTArray<TYPE>::TArray(int hi)\n{\n   this->assign(new ArrayRep(sizeof(TYPE), destroy, init1,\n\t\t       init2, init2, insert, hi));\n}\n\ntemplate <class TYPE> \nTArray<TYPE>::TArray(int lo, int hi)\n{\n   this->assign(new ArrayRep(sizeof(TYPE), destroy, init1,\n\t\t       init2, init2, insert, lo, hi));\n}\n\n//inline removal ends\n\n/** Dynamic array for general types.\n    Template class #DArray<TYPE># implements an array of\n    elements of type #TYPE#.  Each element is identified by an integer\n    subscript.  The valid subscripts range is defined by dynamically\n    adjustable lower- and upper-bounds.  Besides accessing and setting\n    elements, member functions are provided to insert or delete elements at\n    specified positions.\n\n    This template class must be able to access\n    \\begin{itemize}\n    \\item a null constructor #TYPE::TYPE()#, \n    \\item a copy constructor #TYPE::TYPE(const TYPE &)#,\n    \\item and a copy operator #TYPE & operator=(const TYPE &)#.\n    \\end{itemize}\n    \n    The class offers \"copy-on-demand\" policy, which means that when you\n    copy the array object, array elements will stay intact as long as you\n    don't try to modify them. As soon as you make an attempt to change\n    array contents, the copying is done automatically and transparently\n    for you - the procedure that we call \"copy-on-demand\". This is the main\n    difference between this class and \\Ref{GArray} (now obsolete)\n        \n    Please note that most of the methods are implemented in the base classes\n    \\Ref{ArrayBase} and \\Ref{ArrayBaseT}.\n*/\n\ntemplate <class TYPE>\nclass DArray : public ArrayBaseT<TYPE> {\npublic:\n   /** Constructs an empty array. The valid subscript range is initially\n       empty. Member function #touch# and #resize# provide convenient ways\n       to enlarge the subscript range. */\n   DArray(void);\n   /** Constructs an array with subscripts in range 0 to #hibound#. \n       The subscript range can be subsequently modified with member functions\n       #touch# and #resize#.\n       @param hibound upper bound of the initial subscript range. */\n   DArray(const int hibound);\n   /** Constructs an array with subscripts in range #lobound# to #hibound#.  \n       The subscript range can be subsequently modified with member functions\n       #touch# and #resize#.\n       @param lobound lower bound of the initial subscript range.\n       @param hibound upper bound of the initial subscript range. */\n   DArray(const int lobound, const int hibound);\n   \n   virtual ~DArray() {};\nprivate:\n      // Callbacks called from ArrayRep\n   static void\t\tdestroy(void * data, int lo, int hi);\n   static void\t\tinit1(void * data, int lo, int hi);\n   static void\t\tinit2(void * data, int lo, int hi,\n\t\t\t     const void * src, int src_lo, int src_hi);\n   static void\t\tcopy(void * dst, int dst_lo, int dst_hi,\n\t\t\t     const void * src, int src_lo, int src_hi);\n   static void\t\tinsert(void * data, int els, int where,\n\t\t\t       const void * what, int howmany);\n};\n\ntemplate <class TYPE> void\nDArray<TYPE>::destroy(void * data, int lo, int hi)\n{\n   if (data)\n      for(int i=lo;i<=hi;i++)\n\t ((TYPE *) data)[i].TYPE::~TYPE();\n}\n\ntemplate <class TYPE> void\nDArray<TYPE>::init1(void * data, int lo, int hi)\n{\n   if (data)\n      for(int i=lo;i<=hi;i++)\n\t new ((void *) &((TYPE *) data)[i]) TYPE;\n}\n\ntemplate <class TYPE> void\nDArray<TYPE>::init2(void * data, int lo, int hi,\n\t\t    const void * src, int src_lo, int src_hi)\n{\n   if (data && src)\n   {\n      int i, j;\n      for(i=lo, j=src_lo;i<=hi && j<=src_hi;i++, j++)\n\t new ((void *) &((TYPE *) data)[i]) TYPE(((TYPE *) src)[j]);\n   };\n}\n\ntemplate <class TYPE> void\nDArray<TYPE>::copy(void * dst, int dst_lo, int dst_hi,\n\t\t   const void * src, int src_lo, int src_hi)\n{\n   if (dst && src)\n   {\n      int i, j;\n      for(i=dst_lo, j=src_lo;i<=dst_hi && j<=src_hi;i++, j++)\n\t ((TYPE *) dst)[i]=((TYPE *) src)[j];\n   };\n}\n\ntemplate <class TYPE> inline void\nDArray<TYPE>::insert(void * data, int els, int where,\n\t\t     const void * what, int howmany)\n{\n      // Now do the insertion\n   TYPE * d=(TYPE *) data;\n   \n   int i;\n   for (i=els+howmany-1; i>=els; i--)\n   {\n      if (i-where >= (int)howmany)\n\t new ((void*) &d[i]) TYPE (d[i-howmany]);\n      else\n\t new ((void*) &d[i]) TYPE (*(TYPE *) what);\n   }\n   \n   for (i=els-1; i>=where; i--)\n   {\n      if (i-where >= (int)howmany)\n\t d[i] = d[i-howmany];\n      else\n\t d[i] = *(TYPE *) what;\n   }\n}\n\ntemplate <class TYPE> inline \nDArray<TYPE>::DArray ()\n{\n   this->assign(new ArrayRep(sizeof(TYPE), destroy, init1,\n\t\t       init2, copy, insert));\n}\n\ntemplate <class TYPE> inline \nDArray<TYPE>::DArray(const int hi)\n{\n   this->assign(new ArrayRep(sizeof(TYPE), destroy, init1,\n\t\t       init2, copy, insert, hi));\n}\n\ntemplate <class TYPE> inline \nDArray<TYPE>::DArray(const int lo, const int hi)\n{\n   this->assign(new ArrayRep(sizeof(TYPE), destroy, init1,\n\t\t       init2, copy, insert, lo, hi));\n}\n\n/** Dynamic array for \\Ref{GPBase}d classes.\n\n    There are many situations when it's necessary to create arrays of\n    \\Ref{GP} pointers. For example, #DArray<GP<Dialog> ># or #DArray<GP<Button> >#.\n    This would result in compilation of two instances of \\Ref{DArray} because\n    from the viewpoint of the compiler there are two different classes used\n    as array elements: #GP<Dialog># and #GP<Button>#. In reality though,\n    all \\Ref{GP} pointers have absolutely the same binary structure because\n    they are derived from \\Ref{GPBase} class and do not add any variables\n    or virtual functions. That's why it's possible to instantiate \\Ref{DArray}\n    only once for \\Ref{GPBase} elements and then just cast types.\n\n    To implement this idea we have created this #DPArray<TYPE># class,\n    which can be used instead of #DArray<GP<TYPE> >#. It behaves absolutely\n    the same way as \\Ref{DArray} but has one big advantage: overhead of\n    using #DPArray# with one more type is negligible.\n  */\ntemplate <class TYPE>\nclass DPArray : public DArray<GPBase> {\npublic:\n  // -- CONSTRUCTORS\n  DPArray();\n  DPArray(int hibound);\n  DPArray(int lobound, int hibound);\n  DPArray(const DPArray<TYPE> &gc);\n  // -- DESTRUCTOR\n  virtual ~DPArray();\n  // -- ACCESS\n  GP<TYPE>& operator[](int n);\n  const GP<TYPE>& operator[](int n) const;\n  // -- CONVERSION\n  operator GP<TYPE>* ();\n  \n#ifndef __MWERKS__ //MCW can't compile\n  operator const GP<TYPE>* ();\n#endif \n \n  operator const GP<TYPE>* () const;\n  // -- ALTERATION\n  void ins(int n, const GP<TYPE> &val, unsigned int howmany=1);\n  DPArray<TYPE>& operator= (const DPArray &ga);\n};\n\ntemplate<class TYPE>\nDPArray<TYPE>::DPArray() {}\n\ntemplate<class TYPE>\nDPArray<TYPE>::DPArray(int hibound) :\n      DArray<GPBase>(hibound) {}\n\ntemplate<class TYPE>\nDPArray<TYPE>::DPArray(int lobound, int hibound) :\n      DArray<GPBase>(lobound, hibound) {}\n\ntemplate<class TYPE>\nDPArray<TYPE>::DPArray(const DPArray<TYPE> &gc) :\n      DArray<GPBase>(gc) {}\n\ntemplate<class TYPE>\nDPArray<TYPE>::~DPArray() {}\n\ntemplate<class TYPE>\ninline GP<TYPE> &\nDPArray<TYPE>::operator[](int n)\n{\n   return (GP<TYPE> &) DArray<GPBase>::operator[](n);\n}\n\ntemplate<class TYPE>\ninline const GP<TYPE> &\nDPArray<TYPE>::operator[](int n) const\n{\n   return (const GP<TYPE> &) DArray<GPBase>::operator[](n);\n}\n\ntemplate<class TYPE>\ninline DPArray<TYPE>::operator GP<TYPE>* ()\n{\n   return (GP<TYPE> *) DArray<GPBase>::operator GPBase*();\n}\n\n#ifndef __MWERKS__ //MCW can't compile\ntemplate<class TYPE>\ninline DPArray<TYPE>::operator const GP<TYPE>* ()\n{\n   return (const GP<TYPE> *) DArray<GPBase>::operator const GPBase*();\n}\n#endif\n\ntemplate<class TYPE>\ninline DPArray<TYPE>::operator const GP<TYPE>* () const\n{\n   return (const GP<TYPE> *) DArray<GPBase>::operator const GPBase*();\n}\n\ntemplate<class TYPE>\ninline void\nDPArray<TYPE>::ins(int n, const GP<TYPE> & val, unsigned int howmany)\n{\n   DArray<GPBase>::ins(n, val, howmany);\n}\n\ntemplate<class TYPE>\ninline DPArray<TYPE> &\nDPArray<TYPE>::operator= (const DPArray &ga)\n{\n   DArray<GPBase>::operator=(ga);\n   return *this;\n}\n\n// ------------ THE END\n\n//@}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/BSByteStream.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n// - Author: Leon Bottou, 07/1998\n\n#include <stddef.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include \"BSByteStream.h\"\n#undef BSORT_TIMER\n#ifdef BSORT_TIMER\n#include \"GOS.h\"\n#endif\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass BSByteStream::Decode : public BSByteStream\n{\npublic:\n  /** Creates a Static object for allocating the memory area of\n      length #sz# starting at address #buffer#. */\n  Decode(GP<ByteStream> bs);\n  ~Decode();\n  void init(void);\n  // Virtual functions\n  virtual size_t read(void *buffer, size_t sz);\n  virtual void flush(void);\nprotected:\n  unsigned int decode(void);\nprivate:\n  bool eof;\n};\n\n// ========================================\n// --- Assertion\n\n#define ASSERT(expr) do{if(!(expr))G_THROW(\"assertion (\"#expr\") failed\");}while(0)\n\n// ========================================\n// --- Construction\n\nBSByteStream::BSByteStream(GP<ByteStream> xbs)\n: offset(0), bptr(0), blocksize(0), size(0), bs(xbs),\n  gbs(xbs), gdata(data,0)\n{\n  // Initialize context array\n  memset(ctx, 0, sizeof(ctx));\n}\n\nBSByteStream::~BSByteStream() {}\n\nBSByteStream::Decode::Decode(GP<ByteStream> xbs)\n: BSByteStream(xbs), eof(false) {}\n\nvoid\nBSByteStream::Decode::init(void)\n{\n  gzp=ZPCodec::create(gbs,false,true);\n}\n\nBSByteStream::Decode::~Decode() {}\n\nGP<ByteStream>\nBSByteStream::create(GP<ByteStream> xbs)\n{\n  BSByteStream::Decode *rbs=new BSByteStream::Decode(xbs);\n  GP<ByteStream> retval=rbs;\n  rbs->init();\n  return retval;\n}\n\nvoid \nBSByteStream::Decode::flush()\n{\n  size = bptr = 0;\n}\n\n// ========================================\n// -- Decoding\n\n\nstatic int \ndecode_raw(ZPCodec &zp, int bits)\n{\n  int n = 1;\n  const int m = (1<<bits);\n  while (n < m)\n    {\n      const int b = zp.decoder();\n      n = (n<<1) | b;\n    }\n  return n - m;\n}\n\nstatic inline int \ndecode_binary(ZPCodec &zp, BitContext *ctx, int bits)\n{\n  int n = 1;\n  int m = (1<<bits);\n  ctx = ctx - 1;\n  while (n < m)\n    {\n      int b = zp.decoder(ctx[n]);\n      n = (n<<1) | b;\n    }\n  return n - m;\n}\n\n\nstatic inline void\nassignmtf(unsigned char xmtf[256])\n{\n  static const unsigned char mtf[256]={\n    0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,\n    0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,\n    0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,\n    0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,\n    0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,\n    0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,\n    0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,\n    0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,\n    0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,\n    0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,\n    0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,\n    0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,\n    0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,\n    0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,\n    0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,\n    0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,\n    0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,\n    0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,\n    0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,\n    0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,\n    0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,\n    0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,\n    0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,\n    0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,\n    0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,\n    0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,\n    0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,\n    0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,\n    0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,\n    0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,\n    0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,\n    0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF};\n  memcpy(xmtf,mtf,sizeof(mtf));\n}\n  \nunsigned int\nBSByteStream::Decode::decode(void)\n{\n  /////////////////////////////////\n  ////////////  Decode input stream\n  \n  int i;\n  // Decode block size\n  ZPCodec &zp=*gzp;\n  size = decode_raw(zp, 24);\n  if (!size)\n    return 0;\n  if (size>MAXBLOCK*1024)\n    G_THROW( ERR_MSG(\"ByteStream.corrupt\") );\n  // Allocate\n  if ((int)blocksize < size)\n    {\n      blocksize = size;\n      if (data)\n      {\n        gdata.resize(0);\n      }\n    }\n  if (! data) \n    gdata.resize(blocksize);\n  // Decode Estimation Speed\n  int fshift = 0;\n  if (zp.decoder())\n    {\n      fshift += 1;\n      if (zp.decoder())\n        fshift += 1;\n    }\n  // Prepare Quasi MTF\n  static const unsigned char xmtf[256]={\n    0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,\n    0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,\n    0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,\n    0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,\n    0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,\n    0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,\n    0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,\n    0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,\n    0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,\n    0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,\n    0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,\n    0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,\n    0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,\n    0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,\n    0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,\n    0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,\n    0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,\n    0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,\n    0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,\n    0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,\n    0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,\n    0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,\n    0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,\n    0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,\n    0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,\n    0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,\n    0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,\n    0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,\n    0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,\n    0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,\n    0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,\n    0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF};\n  unsigned char mtf[256];\n  memcpy(mtf,xmtf,sizeof(xmtf));\n  unsigned int freq[FREQMAX];\n  memset(freq,0,sizeof(freq));\n  int fadd = 4;\n  // Decode\n  int mtfno = 3;\n  int markerpos = -1;\n  for (i=0; i<size; i++)\n    {\n      int ctxid = CTXIDS-1;\n      if (ctxid>mtfno) ctxid=mtfno;\n      BitContext *cx = ctx;\n      if (zp.decoder(cx[ctxid]))\n        { mtfno=0; data[i]=mtf[mtfno]; goto rotate; }\n      cx+=CTXIDS;\n      if (zp.decoder(cx[ctxid]))\n        { mtfno=1; data[i]=mtf[mtfno]; goto rotate; } \n      cx+=CTXIDS;\n      if (zp.decoder(cx[0]))\n        { mtfno=2+decode_binary(zp,cx+1,1); data[i]=mtf[mtfno]; goto rotate; } \n      cx+=1+1;\n      if (zp.decoder(cx[0]))\n        { mtfno=4+decode_binary(zp,cx+1,2); data[i]=mtf[mtfno]; goto rotate; } \n      cx+=1+3;\n      if (zp.decoder(cx[0]))\n        { mtfno=8+decode_binary(zp,cx+1,3); data[i]=mtf[mtfno]; goto rotate; } \n      cx+=1+7;\n      if (zp.decoder(cx[0]))\n        { mtfno=16+decode_binary(zp,cx+1,4); data[i]=mtf[mtfno]; goto rotate; } \n      cx+=1+15;\n      if (zp.decoder(cx[0]))\n        { mtfno=32+decode_binary(zp,cx+1,5); data[i]=mtf[mtfno]; goto rotate; } \n      cx+=1+31;\n      if (zp.decoder(cx[0]))\n        { mtfno=64+decode_binary(zp,cx+1,6); data[i]=mtf[mtfno]; goto rotate; } \n      cx+=1+63;\n      if (zp.decoder(cx[0]))\n        { mtfno=128+decode_binary(zp,cx+1,7); data[i]=mtf[mtfno]; goto rotate; } \n      mtfno=256;\n      data[i]=0;\n      markerpos=i;\n      continue;\n      // Rotate mtf according to empirical frequencies (new!)\n    rotate:\n      // Adjust frequencies for overflow\n      int k;\n      fadd = fadd + (fadd>>fshift);\n      if (fadd > 0x10000000) \n        {\n          fadd    >>= 24;\n          freq[0] >>= 24;\n          freq[1] >>= 24;\n          freq[2] >>= 24;\n          freq[3] >>= 24;\n          for (k=4; k<FREQMAX; k++)\n            freq[k] = freq[k]>>24;\n        }\n      // Relocate new char according to new freq\n      unsigned int fc = fadd;\n      if (mtfno < FREQMAX)\n        fc += freq[mtfno];\n      for (k=mtfno; k>=FREQMAX; k--) \n        mtf[k] = mtf[k-1];\n      for (; k>0 && fc>=freq[k-1]; k--)\n        {\n          mtf[k] = mtf[k-1];\n          freq[k] = freq[k-1];\n        }\n      mtf[k] = data[i];\n      freq[k] = fc;\n    }\n  \n\n  /////////////////////////////////\n  ////////// Reconstruct the string\n  \n  if (markerpos<1 || markerpos>=size)\n    G_THROW( ERR_MSG(\"ByteStream.corrupt\") );\n  // Allocate pointers\n  unsigned int *posn;\n  GPBuffer<unsigned int> gposn(posn,blocksize);\n  memset(posn, 0, sizeof(unsigned int)*size);\n  // Prepare count buffer\n  int count[256];\n  for (i=0; i<256; i++)\n    count[i] = 0;\n  // Fill count buffer\n  for (i=0; i<markerpos; i++) \n    {\n      unsigned char c = data[i];\n      posn[i] = (c<<24) | (count[c] & 0xffffff);\n      count[c] += 1;\n    }\n  for (i=markerpos+1; i<size; i++)\n    {\n      unsigned char c = data[i];\n      posn[i] = (c<<24) | (count[c] & 0xffffff);\n      count[c] += 1;\n    }\n  // Compute sorted char positions\n  int last = 1;\n  for (i=0; i<256; i++)\n    {\n      int tmp = count[i];\n      count[i] = last;\n      last += tmp;\n    }\n  // Undo the sort transform\n  i = 0;\n  last = size-1;\n  while (last>0)\n    {\n      unsigned int n = posn[i];\n      unsigned char c = (posn[i]>>24);\n      data[--last] = c;\n      i = count[c] + (n & 0xffffff);\n    }\n  // Free and check\n  if (i != markerpos)\n    G_THROW( ERR_MSG(\"ByteStream.corrupt\") );\n  return size;\n}\n\n\n\n// ========================================\n// -- ByteStream interface\n\n\n\nlong \nBSByteStream::tell() const\n{\n  return offset;\n}\n\nsize_t \nBSByteStream::Decode::read(void *buffer, size_t sz)\n{\n  if (eof)\n    return 0;\n  // Loop\n  int copied = 0;\n  while (sz>0 && !eof)\n    {\n      // Decode if needed\n      if (!size)\n        {\n          bptr = 0;\n          if (! decode()) \n          {\n            size = 1 ;\n            eof = true;\n          }\n          size -= 1;\n        }\n      // Compute remaining\n      int bytes = size;\n      if (bytes > (int)sz)\n        bytes = sz;\n      // Transfer\n      if (buffer && bytes)\n        {\n          memcpy(buffer, data+bptr, bytes);\n          buffer = (void*)((char*)buffer + bytes);\n        }\n      size -= bytes;\n      bptr += bytes;\n      sz -= bytes;\n      copied += bytes;\n      offset += bytes;\n    }\n  // Return copied bytes\n  return copied;\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/BSByteStream.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _BSBYTESTREAM_H\n#define _BSBYTESTREAM_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n/** @name BSByteStream.h\n    \n    Files #\"BSByteStream.h\"# and #\"BSByteStream.cpp\"# implement a very compact\n    general purpose compressor based on the Burrows-Wheeler transform.  The\n    utility program \\Ref{bzz} provides a front-end for this class. Although\n    this compression model is not currently used in DjVu files, it may be used\n    in the future for encoding textual data chunks.\n\n    {\\bf Algorithms} --- The Burrows-Wheeler transform (also named Block-Sorting)\n    is performed using a combination of the Karp-Miller-Rosenberg and the\n    Bentley-Sedgewick algorithms. This is comparable to (Sadakane, DCC 98)\n    with a slightly more flexible ranking scheme. Symbols are then ordered\n    according to a running estimate of their occurrence frequencies.  The\n    symbol ranks are then coded using a simple fixed tree and the\n    \\Ref{ZPCodec} binary adaptive coder.\n\n    {\\bf Performances} --- The basic algorithm is mostly similar to those\n    implemented in well known compressors like #bzip# or #bzip2#\n    (\\URL{http://www.muraroa.demon.co.uk}).  The adaptive binary coder however\n    generates small differences. The adaptation noise may cost up to 5\\% in\n    file size, but this penalty is usually offset by the benefits of\n    adaptation.  This is good when processing large and highly structured\n    files like spreadsheet files.  Compression and decompression speed is\n    about twice slower than #bzip2# but the sorting algorithms is more\n    robust. Unlike #bzip2# (as of August 1998), this code can compress half a\n    megabyte of \"abababab....\" in bounded time.\n    \n    Here are some comparative results (in bits per character) obtained on the\n    Canterbury Corpus (\\URL{http://corpus.canterbury.ac.nz}) as of August\n    1998. The BSByteStream performance on the single spreadsheet file #Excl#\n    moves #bzz#'s weighted average ahead of much more sophisticated methods,\n    like Suzanne Bunton's #fsmxBest# system\n    \\URL{http://corpus.canterbury.ac.nz/methodinfo/fsmx.html}.  This result\n    will not last very long.\n\n    {\\footnotesize\n    \\begin{tabular}{lccccccccccccc}\n      & text & fax & Csrc & Excl & SPRC & tech \n      & poem & html & lisp & man & play & Weighted & Average \\\\\n      compress \n      & 3.27 & 0.97 & 3.56 & 2.41 & 4.21 & 3.06 \n      & 3.38 & 3.68 & 3.90 & 4.43 & 3.51 \n      & 2.55 & 3.31 \\\\\n      gzip -9\n      & 2.85 & 0.82 & 2.24 & 1.63 & 2.67 & 2.71 \n      & 3.23 & 2.59 & 2.65 & 3.31 & 3.12 \n      & 2.08 & 2.53 \\\\  \n      bzip2 -9\n      & 2.27 & 0.78 & 2.18 & 1.01 & 2.70 & 2.02 \n      & 2.42 & 2.48 & 2.79 & 3.33 & 2.53 \n      & 1.54 & 2.23 \\\\\n      ppmd\n      & 2.31 & 0.99 & 2.11 & 1.08 & 2.68 & 2.19 \n      & 2.48 & 2.38 & 2.43 & 3.00 & 2.53 \n      & 1.65 & 2.20 \\\\\n      fsmx\n      & {\\bf 2.10} & 0.79 & {\\bf 1.89} & 1.48 & {\\bf 2.52} & {\\bf 1.84} \n      & {\\bf 2.21} & {\\bf 2.24} & {\\bf 2.29} & {\\bf 2.91} & {\\bf 2.35} \n      & 1.63 & {\\bf 2.06} \\\\\n      {\\bf bzz}\n      & 2.25 & {\\bf 0.76} & 2.13 & {\\bf 0.78} & 2.67 & 2.00\n      & 2.40 & 2.52 & 2.60 & 3.19 & 2.52 \n      & {\\bf 1.44} & 2.16\n    \\end{tabular}\n    }\n\n    Note that the DjVu people have several entries in this table.  Program\n    #compress# was written some time ago by Joe Orost\n    (\\URL{http://www.research.att.com/info/orost}). The #ppmc# method, (a\n    precursor of #ppmd#) was created by Paul Howard\n    (\\URL{http://www.research.att.com/info/pgh}). The #bzz# program is just\n    below your eyes.\n\n    @author\n    L\\'eon Bottou <leonb@research.att.com> -- Initial implementation\\\\\n    Andrei Erofeev <eaf@geocities.com> -- Improved Block Sorting algorithm.\n    @memo\n    Simple Burrows-Wheeler general purpose compressor.\n*/\n//@{\n\n\n#include \"ByteStream.h\"\n#include \"GException.h\"\n#include \"ZPCodec.h\"\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n/** Performs bzz compression/decompression.\n    \n    Class #BSByteStream# defines a \\Ref{ByteStream} which transparently\n    performs the BZZ compression/decompression. The constructor of class\n    \\Ref{BSByteStream} takes another \\Ref{ByteStream} as argument.  Any data\n    written to the BSByteStream is compressed and written to this second\n    ByteStream. Any data read from the BSByteStream is internally generated by\n    decompressing data read from the second ByteStream.\n\n    Program \\Ref{bzz} demonstrates how to use this class.  All the hard work\n    is achieved by a simple ByteStream to ByteStream copy, as shown below.\n    \\begin{verbatim}\n      GP<ByteStream> in=ByteStream::create(infile,\"rb\");\n      GP<ByteStream> out=ByteStream::create(outfile,\"wb\");\n      if (encoding) {\n          BSByteStream bsb(out, blocksize);\n          bsb.copy(*in);\n      } else {\n          BSByteStream bsb(in);\n          out->copy(bsb);\n      }\n    \\end{verbatim}\n    Due to the block oriented nature of the Burrows-Wheeler transform, there\n    is a very significant latency between the data input and the data output.\n    You can use function #flush# to force data output at the expense of\n    compression efficiency.\n\n    You should never directly access a ByteStream object connected to a valid\n    BSByteStream object. The ByteStream object can be accessed again after the\n    destruction of the BSByteStream object.  Note that the encoder always\n    flushes its internal buffers and writes a few final code bytes when the\n    BSByteStream object is destroyed.  Note also that the decoder often reads\n    a few bytes beyond the last code byte written by the encoder.  This lag\n    means that you must reposition the ByteStream after the destruction of the\n    BSByteStream object and before re-using the ByteStream object (see\n    \\Ref{IFFByteStream}.)\n*/\nclass DJVUAPI BSByteStream : public ByteStream\n{\npublic:\n// Limits on block sizes\n  enum { MINBLOCK=10, MAXBLOCK=4096 };\n\n// Sorting tresholds\n  enum { FREQMAX=4, CTXIDS=3 };\n\n  class Decode;\n  class Encode;\nprotected:\n  BSByteStream(GP<ByteStream> bs);\n\npublic:\n  /** Creates a BSByteStream.\n      The BSByteStream will be used for decompressing data.\n      \\begin{description}\n      \\item[Decompression]\n      The BSByteStream is created and the decompressor initializes.  Chunks of\n      data will be read from ByteStream #bs# and decompressed into an internal\n      buffer. Function #read# can be used to access the decompressed data.\n      \\end{description} */\n  static GP<ByteStream> create(GP<ByteStream> bs);\n\n  /** Constructs a BSByteStream.\n      The BSByteStream will be used for compressing data.\n      \\begin{description}\n      \\item[Compression]\n      Set #blocksize# to a positive number smaller than 4096 to \n      initialize the compressor.  Data written to the BSByteStream will be\n      accumulated into an internal buffer.  The buffered data will be\n      compressed and written to ByteStream #bs# whenever the buffer sizes\n      reaches the maximum value specified by argument #blocksize# (in\n      kilobytes).  Using a larger block size usually increases the compression\n      ratio at the expense of computation time.  There is no need however to\n      specify a block size larger than the total number of bytes to compress.\n      Setting #blocksize# to #1024# is a good starting point.  A minimal block\n      size of 10 is silently enforced.\n      \\end{description} */\n  static GP<ByteStream> create(GP<ByteStream> bs, const int blocksize);\n\n  // ByteStream Interface\n  ~BSByteStream();\n  virtual long tell(void) const;\n  virtual void flush(void) = 0;\nprotected:\n  // Data\n  long            offset;\n  int             bptr;\n  unsigned int    blocksize;\n  int             size;\n  ByteStream *bs;\n  GP<ByteStream> gbs;\n  unsigned char  *data;\n  GPBuffer<unsigned char> gdata;\n  // Coder\n  GP<ZPCodec> gzp;\n  BitContext ctx[300];\nprivate:  \n  // Cancel C++ default stuff\n  BSByteStream(const BSByteStream &);\n  BSByteStream & operator=(const BSByteStream &);\n  BSByteStream(ByteStream *);\n  BSByteStream(ByteStream *, int);\n};\n\n//@}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/BSEncodeByteStream.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n// - Author: Leon Bottou, 07/1998\n\n\n\n#include \"BSByteStream.h\"\n#include \"GString.h\"\n#undef BSORT_TIMER\n#ifdef BSORT_TIMER\n#include \"GOS.h\"\n#endif\n\n#include <stddef.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n// ========================================\n// --- Assertion\n\n#define ASSERT(expr) do{if(!(expr))G_THROW(\"assertion (\"#expr\") failed\");}while(0)\n\n\n\n// ========================================\n// --- Global Definitions\n            \n\n#ifdef OVERFLOW\n#undef OVERFLOW\n#endif\n// Overflow required when encoding\nstatic const int OVERFLOW=32;\n\n// Sorting tresholds\nstatic const int RANKSORT_THRESH=10;\nstatic const int QUICKSORT_STACK=512;\nstatic const int PRESORT_THRESH=10;\nstatic const int PRESORT_DEPTH=8;\nstatic const int RADIX_THRESH=32768;\n\nstatic const int FREQS0=100000;\nstatic const int FREQS1=1000000;\n\n// ========================================\n// -- Sorting Routines\n\n  \nclass _BSort  // DJVU_CLASS\n{\npublic:\n  ~_BSort();\n  _BSort(unsigned char *data, int size);\n  void run(int &markerpos);\nprivate:\n  // Members\n  int            size;\n  unsigned char *data;\n  unsigned int  *posn;\n  GPBuffer<unsigned int> gposn;\n  int           *rank;\n  GPBuffer<int> grank;\n  // Helpers\n  inline int GT(int p1, int p2, int depth);\n  inline int GTD(int p1, int p2, int depth);\n  // -- final in-depth sort\n  void ranksort(int lo, int hi, int d);\n  // -- doubling sort\n  int  pivot3r(int *rr, int lo, int hi);\n  void quicksort3r(int lo, int hi, int d);\n  // -- presort to depth PRESORT_DEPTH\n  unsigned char pivot3d(unsigned char *dd, int lo, int hi);\n  void quicksort3d(int lo, int hi, int d);\n  // -- radixsort\n  void radixsort16(void);\n  void radixsort8(void);\n};\n\n\n// blocksort -- the main entry point\n\nstatic void \nblocksort(unsigned char *data, int size, int &markerpos)\n{\n  _BSort bsort(data, size);\n  bsort.run(markerpos);\n}\n\n\n// _BSort construction\n\n_BSort::_BSort(unsigned char *xdata, int xsize)\n  : size(xsize), data(xdata), gposn(posn,xsize), grank(rank,xsize+1)\n{\n  ASSERT(size>0 && size<0x1000000);\n  rank[size] = -1;\n}\n\n_BSort::~_BSort()\n{\n}\n\n\n\n// GT -- compare suffixes using rank information\n\ninline int \n_BSort::GT(int p1, int p2, int depth)\n{\n  int r1, r2;\n  int twod = depth + depth;\n  while (1)\n    {\n      r1=rank[p1+depth]; r2=rank[p2+depth];\n      p1+=twod;  p2+=twod;\n      if (r1!=r2) \n        return (r1>r2);\n      r1=rank[p1]; r2=rank[p2];\n      if (r1!=r2) \n        return (r1>r2);\n      r1=rank[p1+depth]; r2=rank[p2+depth];\n      p1+=twod;  p2+=twod;\n      if (r1!=r2) \n        return (r1>r2);\n      r1=rank[p1]; r2=rank[p2];\n      if (r1!=r2) \n        return (r1>r2);\n      r1=rank[p1+depth]; r2=rank[p2+depth];\n      p1+=twod;  p2+=twod;\n      if (r1!=r2) \n        return (r1>r2);\n      r1=rank[p1]; r2=rank[p2];\n      if (r1!=r2) \n        return (r1>r2);\n      r1=rank[p1+depth]; r2=rank[p2+depth];\n      p1+=twod;  p2+=twod;\n      if (r1!=r2) \n        return (r1>r2);\n      r1=rank[p1]; r2=rank[p2];\n      if (r1!=r2) \n        return (r1>r2);\n    };\n}\n\n\n// _BSort::ranksort -- \n// -- a simple insertion sort based on GT\n\nvoid \n_BSort::ranksort(int lo, int hi, int depth)\n{\n  int i,j;\n  for (i=lo+1; i<=hi; i++)\n    {\n      int tmp = posn[i];\n      for(j=i-1; j>=lo && GT(posn[j], tmp, depth); j--)\n        posn[j+1] = posn[j];\n      posn[j+1] = tmp;\n    }\n  for(i=lo;i<=hi;i++) \n    rank[posn[i]]=i;\n}\n\n// pivot -- return suitable pivot\n\ninline int\n_BSort::pivot3r(int *rr, int lo, int hi)\n{\n  int c1, c2, c3;\n  if (hi-lo > 256)\n    {\n      c1 = pivot3r(rr, lo, (6*lo+2*hi)/8);\n      c2 = pivot3r(rr, (5*lo+3*hi)/8, (3*lo+5*hi)/8);\n      c3 = pivot3r(rr, (2*lo+6*hi)/8, hi);\n    }\n  else\n    {\n      c1 = rr[posn[lo]];\n      c2 = rr[posn[(lo+hi)/2]];\n      c3 = rr[posn[hi]];\n    }\n  // Extract median\n  if (c1>c3)\n    { int tmp=c1; c1=c3; c3=tmp; }\n  if (c2<=c1)\n    return c1;\n  else if (c2>=c3)\n    return c3;\n  else\n    return c2;\n}\n\n\n// _BSort::quicksort3r -- Three way quicksort algorithm \n//    Sort suffixes based on rank at pos+depth\n//    The algorithm breaks into ranksort when size is \n//    smaller than RANKSORT_THRESH\n\nstatic inline int\nmini(int a, int b) \n{\n  return (a<=b) ? a : b;\n}\n\nstatic inline void\nvswap(int i, int j, int n, unsigned int *x)\n{\n  while (n-- > 0) \n    { int tmp = x[i]; x[i++]=x[j]; x[j++]=tmp; }\n}\n\nvoid \n_BSort::quicksort3r(int lo, int hi, int depth)\n{\n  /* Initialize stack */\n  int slo[QUICKSORT_STACK];\n  int shi[QUICKSORT_STACK];\n  int sp = 1;\n  slo[0] = lo;\n  shi[0] = hi;\n  // Recursion elimination loop\n  while (--sp>=0)\n    {\n      lo = slo[sp];\n      hi = shi[sp];\n      // Test for insertion sort\n      if (hi-lo<RANKSORT_THRESH)\n        {\n          ranksort(lo, hi, depth);\n        }\n      else\n        {\n          int tmp;\n          int *rr=rank+depth;\n          int med = pivot3r(rr,lo,hi);\n          // -- positions are organized as follows:\n          //   [lo..l1[ [l1..l[ ]h..h1] ]h1..hi]\n          //      =        <       >        =\n          int l1 = lo;\n          int h1 = hi;\n          while (rr[posn[l1]]==med && l1<h1) { l1++; }\n          while (rr[posn[h1]]==med && l1<h1) { h1--; }\n          int l = l1;\n          int h = h1;\n          // -- partition set\n          for (;;)\n            {\n              while (l<=h)\n                {\n                  int c = rr[posn[l]] - med;\n                  if (c > 0) break;\n                  if (c == 0) { tmp=posn[l]; posn[l]=posn[l1]; posn[l1++]=tmp; }\n                  l++;\n                }\n              while (l<=h)\n                {\n                  int c = rr[posn[h]] - med;\n                  if (c < 0) break;\n                  if (c == 0) { tmp=posn[h]; posn[h]=posn[h1]; posn[h1--]=tmp; }\n                  h--;\n                }\n              if (l>h) break;\n              tmp=posn[l]; posn[l]=posn[h]; posn[h]=tmp;\n            }\n          // -- reorganize as follows\n          //   [lo..l1[ [l1..h1] ]h1..hi]\n          //      <        =        > \n          tmp = mini(l1-lo, l-l1);\n          vswap(lo, l-tmp, tmp, posn);\n          l1 = lo + (l-l1);\n          tmp = mini(hi-h1, h1-h);\n          vswap(hi-tmp+1, h+1, tmp, posn);\n          h1 = hi - (h1-h);\n          // -- process segments\n          ASSERT(sp+2<QUICKSORT_STACK);\n          // ----- middle segment (=?) [l1, h1]\n          for(int i=l1;i<=h1;i++) \n            rank[posn[i]] = h1;\n          // ----- lower segment (<) [lo, l1[\n          if (l1 > lo)\n            {\n              for(int i=lo;i<l1;i++) \n                rank[posn[i]]=l1-1;\n              slo[sp]=lo;\n              shi[sp]=l1-1;\n              if (slo[sp] < shi[sp])  \n                sp++;\n            }\n          // ----- upper segment (>) ]h1, hi]\n          if (h1 < hi)\n            {\n              slo[sp]=h1+1;\n              shi[sp]=hi;\n              if (slo[sp] < shi[sp])  \n                sp++;\n            }\n        }\n    }\n}\n\n\n\n\n\n\n// GTD -- compare suffixes using data information \n//  (up to depth PRESORT_DEPTH)\n\ninline int \n_BSort::GTD(int p1, int p2, int depth)\n{\n  unsigned char c1, c2;\n  p1+=depth; p2+=depth;\n  while (depth < PRESORT_DEPTH)\n    {\n      // Perform two\n      c1=data[p1]; c2=data[p2];\n      if (c1!=c2) \n        return (c1>c2);\n      c1=data[p1+1]; c2=data[p2+1];\n      p1+=2;  p2+=2; depth+=2;\n      if (c1!=c2) \n        return (c1>c2);\n    }\n  if (p1<size && p2<size)\n    return 0;\n  return (p1<p2);\n}\n\n// pivot3d -- return suitable pivot\n\ninline unsigned char\n_BSort::pivot3d(unsigned char *rr, int lo, int hi)\n{\n  unsigned char c1, c2, c3;\n  if (hi-lo > 256)\n    {\n      c1 = pivot3d(rr, lo, (6*lo+2*hi)/8);\n      c2 = pivot3d(rr, (5*lo+3*hi)/8, (3*lo+5*hi)/8);\n      c3 = pivot3d(rr, (2*lo+6*hi)/8, hi);\n    }\n  else\n    {\n      c1 = rr[posn[lo]];\n      c2 = rr[posn[(lo+hi)/2]];\n      c3 = rr[posn[hi]];\n    }\n  // Extract median\n  if (c1>c3)\n    { int tmp=c1; c1=c3; c3=tmp; }\n  if (c2<=c1)\n    return c1;\n  else if (c2>=c3)\n    return c3;\n  else\n    return c2;\n}\n\n\n// _BSort::quicksort3d -- Three way quicksort algorithm \n//    Sort suffixes based on strings until reaching\n//    depth rank at pos+depth\n//    The algorithm breaks into ranksort when size is \n//    smaller than PRESORT_THRESH\n\nvoid \n_BSort::quicksort3d(int lo, int hi, int depth)\n{\n  /* Initialize stack */\n  int slo[QUICKSORT_STACK];\n  int shi[QUICKSORT_STACK];\n  int sd[QUICKSORT_STACK];\n  int sp = 1;\n  slo[0] = lo;\n  shi[0] = hi;\n  sd[0] = depth;\n  // Recursion elimination loop\n  while (--sp>=0)\n    {\n      lo = slo[sp];\n      hi = shi[sp];\n      depth = sd[sp];\n      // Test for insertion sort\n      if (depth >= PRESORT_DEPTH)\n        {\n          for (int i=lo; i<=hi; i++)\n            rank[posn[i]] = hi;\n        }\n      else if (hi-lo<PRESORT_THRESH)\n        {\n          int i,j;\n          for (i=lo+1; i<=hi; i++)\n            {\n              int tmp = posn[i];\n              for(j=i-1; j>=lo && GTD(posn[j], tmp, depth); j--)\n                posn[j+1] = posn[j];\n              posn[j+1] = tmp;\n            }\n          for(i=hi;i>=lo;i=j)\n            {\n              int tmp = posn[i];\n              rank[tmp] = i;\n              for (j=i-1; j>=lo && !GTD(tmp,posn[j],depth); j--)\n                rank[posn[j]] = i;\n            }\n        }\n        else\n        {\n          int tmp;\n          unsigned char *dd=data+depth;\n          unsigned char med = pivot3d(dd,lo,hi);\n          // -- positions are organized as follows:\n          //   [lo..l1[ [l1..l[ ]h..h1] ]h1..hi]\n          //      =        <       >        =\n          int l1 = lo;\n          int h1 = hi;\n          while (dd[posn[l1]]==med && l1<h1) { l1++; }\n          while (dd[posn[h1]]==med && l1<h1) { h1--; }\n          int l = l1;\n          int h = h1;\n          // -- partition set\n          for (;;)\n            {\n              while (l<=h)\n                {\n                  int c = (int)dd[posn[l]] - (int)med;\n                  if (c > 0) break;\n                  if (c == 0) { tmp=posn[l]; posn[l]=posn[l1]; posn[l1++]=tmp; }\n                  l++;\n                }\n              while (l<=h)\n                {\n                  int c = (int)dd[posn[h]] - (int)med;\n                  if (c < 0) break;\n                  if (c == 0) { tmp=posn[h]; posn[h]=posn[h1]; posn[h1--]=tmp; }\n                  h--;\n                }\n              if (l>h) break;\n              tmp=posn[l]; posn[l]=posn[h]; posn[h]=tmp;\n            }\n          // -- reorganize as follows\n          //   [lo..l1[ [l1..h1] ]h1..hi]\n          //      <        =        > \n          tmp = mini(l1-lo, l-l1);\n          vswap(lo, l-tmp, tmp, posn);\n          l1 = lo + (l-l1);\n          tmp = mini(hi-h1, h1-h);\n          vswap(hi-tmp+1, h+1, tmp, posn);\n          h1 = hi - (h1-h);\n          // -- process segments\n          ASSERT(sp+3<QUICKSORT_STACK);\n          // ----- middle segment (=?) [l1, h1]\n          l = l1; h = h1;\n          if (med==0) // special case for marker [slow]\n            for (int i=l; i<=h; i++)\n              if ((int)posn[i]+depth == size-1)\n                { \n                  tmp=posn[i]; posn[i]=posn[l]; posn[l]=tmp; \n                  rank[tmp]=l++; break; \n                }\n          if (l<h)\n            { slo[sp] = l; shi[sp] = h; sd[sp++] = depth+1; }\n          else if (l==h)\n            { rank[posn[h]] = h; }\n          // ----- lower segment (<) [lo, l1[\n          l = lo;\n          h = l1-1;\n          if (l<h)\n            { slo[sp] = l; shi[sp] = h; sd[sp++] = depth; }\n          else if (l==h)\n            { rank[posn[h]] = h; }\n          // ----- upper segment (>) ]h1, hi]\n          l = h1+1;\n          h = hi;\n          if (l<h)\n            { slo[sp] = l; shi[sp] = h; sd[sp++] = depth; }\n          else if (l==h)\n            { rank[posn[h]] = h; }\n        }\n    }\n}\n\n\n\n\n// _BSort::radixsort8 -- 8 bit radix sort\n\nvoid \n_BSort::radixsort8(void)\n{\n  int i;\n  // Initialize frequency array\n  int lo[256], hi[256];\n  for (i=0; i<256; i++)\n    hi[i] = lo[i] = 0;\n  // Count occurences\n  for (i=0; i<size-1; i++)\n    hi[data[i]] ++;\n  // Compute positions (lo)\n  int last = 1;\n  for (i=0; i<256; i++)\n    {\n      lo[i] = last;\n      hi[i] = last + hi[i] - 1;\n      last = hi[i] + 1;\n    }\n  for (i=0; i<size-1; i++)\n    {\n      posn[ lo[data[i]]++ ] = i;\n      rank[ i ] = hi[data[i]];\n    }\n  // Process marker \"$\"\n  posn[0] = size-1;\n  rank[size-1] = 0;\n  // Extra element\n  rank[size] = -1;\n}\n\n\n// _BSort::radixsort16 -- 16 bit radix sort\n\nvoid \n_BSort::radixsort16(void)\n{\n  int i;\n  // Initialize frequency array\n  int *ftab;\n  GPBuffer<int> gftab(ftab,65536);\n  for (i=0; i<65536; i++)\n    ftab[i] = 0;\n  // Count occurences\n  unsigned char c1 = data[0];\n  for (i=0; i<size-1; i++)\n    {\n      unsigned char c2 = data[i+1];\n      ftab[(c1<<8)|c2] ++;\n      c1 = c2;\n    }\n  // Generate upper position\n  for (i=1;i<65536;i++)\n    ftab[i] += ftab[i-1];\n  // Fill rank array with upper bound\n  c1 = data[0];\n  for (i=0; i<size-2; i++)\n    {\n      unsigned char c2 = data[i+1];\n      rank[i] = ftab[(c1<<8)|c2];\n      c1 = c2;\n    }\n  // Fill posn array (backwards)\n  c1 = data[size-2];\n  for (i=size-3; i>=0; i--)\n    {\n      unsigned char c2 = data[i];\n      posn[ ftab[(c2<<8)|c1]-- ] = i;\n      c1 = c2;\n    }\n  // Fixup marker stuff\n  ASSERT(data[size-1]==0);\n  c1 = data[size-2];\n  posn[0] = size-1;\n  posn[ ftab[(c1<<8)] ] = size-2;\n  rank[size-1] = 0;\n  rank[size-2] = ftab[(c1<<8)];\n  // Extra element\n  rank[size] = -1;\n}\n\n\n\n// _BSort::run -- main sort loop\n\nvoid\n_BSort::run(int &markerpos)\n{\n  int lo, hi;\n  ASSERT(size>0);\n  ASSERT(data[size-1]==0);\n#ifdef BSORT_TIMER\n  long start = GOS::ticks();\n#endif  \n  // Step 1: Radix sort \n  int depth = 0;\n  if (size > RADIX_THRESH)\n    { \n      radixsort16();\n      depth=2;\n    }\n  else\n    { \n      radixsort8(); \n      depth=1;\n    }\n  // Step 2: Perform presort to depth PRESORT_DEPTH\n  for (lo=0; lo<size; lo++)\n    {\n      hi = rank[posn[lo]];\n      if (lo < hi)\n        quicksort3d(lo, hi, depth);\n      lo = hi;\n    }\n  depth = PRESORT_DEPTH;\n#ifdef BSORT_TIMER\n  long middle = GOS::ticks();\n#endif  \n  // Step 3: Perform rank doubling\n  int again = 1;\n  while (again)\n    {\n      again = 0;\n      int sorted_lo = 0;\n      for (lo=0; lo<size; lo++)\n        {\n          hi = rank[posn[lo]&0xffffff];\n          if (lo == hi)\n            {\n              lo += (posn[lo]>>24) & 0xff;\n            }\n          else\n            {\n              if (hi-lo < RANKSORT_THRESH)\n                {\n                  ranksort(lo, hi, depth);\n                }\n              else\n                {\n                  again += 1;\n                  while (sorted_lo < lo-1)\n                    {\n                      int step = mini(255, lo-1-sorted_lo);\n                      posn[sorted_lo] = (posn[sorted_lo]&0xffffff) | (step<<24);\n                      sorted_lo += step+1;\n                    }\n                  quicksort3r(lo, hi, depth);\n                  sorted_lo = hi + 1;\n                }\n              lo = hi;\n            }\n        }\n      // Finish threading\n      while (sorted_lo < lo-1)\n        {\n          int step = mini(255, lo-1-sorted_lo);\n          posn[sorted_lo] = (posn[sorted_lo]&0xffffff) | (step<<24);\n          sorted_lo += step+1;\n        }\n      // Double depth\n      depth += depth;\n    }\n  // Step 4: Permute data\n  int i;\n  markerpos = -1;\n  for (i=0; i<size; i++)\n    rank[i] = data[i];\n  for (i=0; i<size; i++)\n    {\n      int j = posn[i] & 0xffffff;\n      if (j>0) \n        { \n          data[i] = rank[j-1];\n        } \n      else \n        {\n          data[i] = 0;\n          markerpos = i;\n        }\n    }\n  ASSERT(markerpos>=0 && markerpos<size);\n#ifdef BSORT_TIMER\n  long end = GOS::ticks();\n  DjVuPrintErrorUTF8(\"Sorting time: %d bytes in %ld + %ld = %ld ms\\n\", \n          size-1, middle-start, end-middle, end-start);\n#endif  \n}\n\n\n// ========================================\n// -- Encoding\n\nstatic void\nencode_raw(ZPCodec &zp, int bits, int x)\n{\n  int n = 1;\n  int m = (1<<bits);\n  while (n < m)\n    {\n      x = (x & (m-1)) << 1;\n      int b = (x >> bits);\n      zp.encoder(b);\n      n = (n<<1) | b;\n    }\n}\n\nstatic inline void\nencode_binary(ZPCodec &zp, BitContext *ctx, int bits, int x)\n{\n  // Require 2^bits-1  contexts\n  int n = 1;\n  int m = (1<<bits);\n  ctx = ctx - 1;\n  while (n < m)\n    {\n      x = (x & (m-1)) << 1;\n      int b = (x >> bits);\n      zp.encoder(b, ctx[n]);\n      n = (n<<1) | b;\n    }\n}\n\nclass BSByteStream::Encode : public BSByteStream\n{\npublic:\n  /** Creates a Static object for allocating the memory area of\n      length #sz# starting at address #buffer#. */\n  Encode(GP<ByteStream> bs);\n  ~Encode();\n  void init(const int encoding);\n  // Virtual functions\n  virtual size_t write(const void *buffer, size_t sz);\n  virtual void flush(void);\nprotected:\n  unsigned int encode(void);\n};\n\nunsigned int\nBSByteStream::Encode::encode()\n{ \n  /////////////////////////////////\n  ////////////  Block Sort Tranform\n\n  int markerpos = size-1;\n  blocksort(data,size,markerpos);\n\n  /////////////////////////////////\n  //////////// Encode Output Stream\n\n  // Header\n  ZPCodec &zp=*gzp;\n  encode_raw(zp, 24, size);\n  // Determine and Encode Estimation Speed\n  int fshift = 0;\n  if (size < FREQS0)\n    { fshift=0; zp.encoder(0); }\n  else if (size < FREQS1)\n    { fshift = 1; zp.encoder(1); zp.encoder(0); }\n  else\n    { fshift = 2; zp.encoder(1); zp.encoder(1); }\n  // MTF\n  unsigned char mtf[256];\n  unsigned char rmtf[256];\n  unsigned int  freq[FREQMAX];\n  int m = 0;\n  for (m=0; m<256; m++)\n    mtf[m] = m;\n  for (m=0; m<256; m++)\n    rmtf[mtf[m]] = m;\n  int fadd = 4;\n  for (m=0; m<FREQMAX; m++)\n    freq[m] = 0;\n  // Encode\n  int i;\n  int mtfno = 3;\n  for (i=0; i<size; i++)\n    {\n      // Get MTF data\n      int c = data[i];\n      int ctxid = CTXIDS-1;\n      if (ctxid>mtfno) ctxid=mtfno;\n      mtfno = rmtf[c];\n      if (i==markerpos)\n        mtfno = 256;\n      // Encode using ZPCoder\n      int b;\n      BitContext *cx = ctx;\n      b = (mtfno==0);\n      zp.encoder(b, cx[ctxid]);\n      if (b) goto rotate; cx+=CTXIDS;\n      b = (mtfno==1);\n      zp.encoder(b, cx[ctxid]);\n      if (b) goto rotate; cx+=CTXIDS;\n      b = (mtfno<4);\n      zp.encoder(b, cx[0]);\n      if (b) { encode_binary(zp,cx+1,1,mtfno-2); goto rotate; } \n      cx+=1+1;\n      b = (mtfno<8);\n      zp.encoder(b, cx[0]);\n      if (b) { encode_binary(zp,cx+1,2,mtfno-4); goto rotate; } \n      cx+=1+3;\n      b = (mtfno<16);\n      zp.encoder(b, cx[0]);\n      if (b) { encode_binary(zp,cx+1,3,mtfno-8); goto rotate; } \n      cx+=1+7;\n      b = (mtfno<32);\n      zp.encoder(b, cx[0]);\n      if (b) { encode_binary(zp,cx+1,4,mtfno-16); goto rotate; } \n      cx+=1+15;\n      b = (mtfno<64);\n      zp.encoder(b, cx[0]);\n      if (b) { encode_binary(zp,cx+1,5,mtfno-32); goto rotate; } \n      cx+=1+31;\n      b = (mtfno<128);\n      zp.encoder(b, cx[0]);\n      if (b) { encode_binary(zp,cx+1,6,mtfno-64); goto rotate; } \n      cx+=1+63;\n      b = (mtfno<256);\n      zp.encoder(b, cx[0]);\n      if (b) { encode_binary(zp,cx+1,7,mtfno-128); goto rotate; } \n      continue;\n      // Rotate MTF according to empirical frequencies (new!)\n    rotate:\n      // Adjust frequencies for overflow\n      fadd = fadd + (fadd>>fshift);\n      if (fadd > 0x10000000) \n        {\n          fadd = fadd>>24;\n          freq[0] >>= 24;\n          freq[1] >>= 24;\n          freq[2] >>= 24;\n          freq[3] >>= 24;\n          for (int k=4; k<FREQMAX; k++)\n            freq[k] = freq[k]>>24;\n        }\n      // Relocate new char according to new freq\n      unsigned int fc = fadd;\n      if (mtfno < FREQMAX)\n        fc += freq[mtfno];\n      int k;\n      for (k=mtfno; k>=FREQMAX; k--)\n        {\n          mtf[k] = mtf[k-1];\n          rmtf[mtf[k]] = k;\n        }\n      for (; k>0 && fc>=freq[k-1]; k--)\n        {\n          mtf[k] = mtf[k-1];\n          freq[k] = freq[k-1];\n          rmtf[mtf[k]] = k;\n        }\n      mtf[k] = c;\n      freq[k] = fc;\n      rmtf[mtf[k]] = k;\n    }\n  // Terminate\n  return 0;\n}\n\n// ========================================\n// --- Construction\n\nBSByteStream::Encode::Encode(GP<ByteStream> xbs)\n: BSByteStream(xbs) {}\n\nvoid\nBSByteStream::Encode::init(const int xencoding)\n{\n  gzp=ZPCodec::create(gbs,true,true);\n  const int encoding=(xencoding<MINBLOCK)?MINBLOCK:xencoding;\n  if (encoding > MAXBLOCK)\n    G_THROW( ERR_MSG(\"ByteStream.blocksize\") \"\\t\" + GUTF8String(MAXBLOCK) );\n  // Record block size\n  blocksize = encoding * 1024;\n  // Initialize context array\n}\n\nBSByteStream::Encode::~Encode()\n{\n  // Flush\n  flush();\n  // Encode EOF marker\n  encode_raw(*gzp, 24, 0);\n  // Free allocated memory\n}\n\nGP<ByteStream>\nBSByteStream::create(GP<ByteStream> xbs,const int blocksize)\n{\n  BSByteStream::Encode *rbs=new BSByteStream::Encode(xbs);\n  GP<ByteStream> retval=rbs;\n  rbs->init(blocksize);\n  return retval;\n}\n\n// ========================================\n// -- ByteStream interface\n\nvoid \nBSByteStream::Encode::flush()\n{\n  if (bptr>0)\n  {\n    ASSERT(bptr<(int)blocksize);\n    memset(data+bptr, 0, OVERFLOW);\n    size = bptr+1;\n    encode();\n  }\n  size = bptr = 0;\n}\n\nsize_t \nBSByteStream::Encode::write(const void *buffer, size_t sz)\n{\n  // Trivial checks\n  if (sz == 0)\n    return 0;\n  // Loop\n  int copied = 0;\n  while (sz > 0)\n    {\n      // Initialize\n      if (!data) \n        {\n          bptr = 0;\n          gdata.resize(blocksize+OVERFLOW);\n        }\n      // Compute remaining\n      int bytes = blocksize - 1 - bptr;\n      if (bytes > (int)sz)\n        bytes = sz;\n      // Store date (todo: rle)\n      memcpy(data+bptr, buffer, bytes);\n      buffer = (void*)((char*)buffer + bytes);\n      bptr += bytes;\n      sz -= bytes;\n      copied += bytes;\n      offset += bytes;\n      // Flush when needed\n      if (bptr + 1 >= (int)blocksize)\n        flush();\n    }\n  // return\n  return copied;\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/ByteStream.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n// From: Leon Bottou, 1/31/2002\n// This file has very little to do with my initial implementation.\n// It has been practically rewritten by Lizardtech for i18n changes.\n// Our original implementation consisted of multiple classes.\n// <http://prdownloads.sourceforge.net/djvu/DjVu2_2b-src.tgz>.\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n// - Author: Leon Bottou, 04/1997\n\n#include \"DjVuGlobal.h\"\n#include \"ByteStream.h\"\n#include \"GOS.h\"\n#include \"GURL.h\"\n#include \"DjVuMessage.h\"\n#include <stddef.h>\n#include <fcntl.h>\n#if defined(WIN32) || defined(__CYGWIN32__)\n# include <io.h>\n#endif\n\n#ifdef UNIX\n# ifndef HAS_MEMMAP\n#  define HAS_MEMMAP 1\n# endif\n#endif\n\n#ifdef UNIX\n# include <sys/types.h>\n# include <sys/stat.h>\n# include <unistd.h>\n# include <errno.h>\n# ifdef HAS_MEMMAP\n#  include <sys/mman.h>\n# endif\n#endif\n\n#ifdef macintosh\n# ifndef UNIX\n#  include <unistd.h>\n_MSL_IMP_EXP_C int _dup(int);\n_MSL_IMP_EXP_C int _dup2(int,int);\n_MSL_IMP_EXP_C int _close(int);\n__inline int dup(int _a ) { return _dup(_a);}\n__inline int dup2(int _a, int _b ) { return _dup2(_a, _b);}\n# endif\n#endif\n\n#ifdef WIN32\n# if !defined(__MINGW32__) && !defined(__CYGWIN32__)\n#  define close _close\n#  define fdopen _fdopen\n#  define dup _dup\n# endif\n#endif\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nconst char *ByteStream::EndOfFile=ERR_MSG(\"EOF\");\n\n/** ByteStream interface for stdio files. \n    The virtual member functions #read#, #write#, #tell# and #seek# are mapped\n    to the well known stdio functions #fread#, #fwrite#, #ftell# and #fseek#.\n    @see Unix man page fopen(3), fread(3), fwrite(3), ftell(3), fseek(3) */\n\nclass ByteStream::Stdio : public ByteStream {\npublic:\n  Stdio(void);\n\n  /** Constructs a ByteStream for accessing the file named #url#.\n      Arguments #url# and #mode# are similar to the arguments of the well\n      known stdio function #fopen#. In addition a url of #-# will be\n      interpreted as the standard output or the standard input according to\n      #mode#.  This constructor will open a stdio file and construct a\n      ByteStream object accessing this file. Destroying the ByteStream object\n      will flush and close the associated stdio file.  Returns an error code\n      if the stdio file cannot be opened. */\n  GUTF8String init(const GURL &url, const char * const mode);\n\n  /** Constructs a ByteStream for accessing the stdio file #f#.\n      Argument #mode# indicates the type of the stdio file, as in the\n      well known stdio function #fopen#.  Destroying the ByteStream\n      object will not close the stdio file #f# unless closeme is true. */\n  GUTF8String init(FILE * const f, const char * const mode=\"rb\", const bool closeme=false);\n\n  /** Initializes from stdio */\n  GUTF8String init(const char mode[]);\n\n  // Virtual functions\n  ~Stdio();\n  virtual size_t read(void *buffer, size_t size);\n  virtual size_t write(const void *buffer, size_t size);\n  virtual void flush(void);\n  virtual int seek(long offset, int whence = SEEK_SET, bool nothrow=false);\n  virtual long tell(void) const;\nprivate:\n  // Cancel C++ default stuff\n  Stdio(const Stdio &);\n  Stdio & operator=(const Stdio &);\nprivate:\n  // Implementation\n  bool can_read;\n  bool can_write;\n  bool must_close;\nprotected:\n  FILE *fp;\n  long pos;\n};\n\ninline GUTF8String\nByteStream::Stdio::init(FILE * const f,const char mode[],const bool closeme)\n{\n  fp=f;\n  must_close=closeme;\n  return init(mode);\n}\n\n\n/** ByteStream interface managing a memory buffer.  \n    Class #ByteStream::Memory# manages a dynamically resizable buffer from\n    which data can be read or written.  The buffer itself is organized as an\n    array of blocks of 4096 bytes.  */\n\nclass ByteStream::Memory : public ByteStream\n{\npublic:\n  /** Constructs an empty ByteStream::Memory.\n      The buffer is initially empty. You must first use function #write#\n      to store data into the buffer, use function #seek# to rewind the\n      current position, and function #read# to read the data back. */\n  Memory();\n  /** Constructs a Memory by copying initial data.  The\n      Memory buffer is initialized with #size# bytes copied from the\n      memory area pointed to by #buffer#. */\n  GUTF8String init(const void * const buffer, const size_t size);\n  // Virtual functions\n  ~Memory();\n  virtual size_t read(void *buffer, size_t size);\n  virtual size_t write(const void *buffer, size_t size);\n  virtual int    seek(long offset, int whence=SEEK_SET, bool nothrow=false);\n  virtual long   tell(void) const;\n  /** Erases everything in the Memory.\n      The current location is reset to zero. */\n  void empty();\n  /** Returns the total number of bytes contained in the buffer.  Valid\n      offsets for function #seek# range from 0 to the value returned by this\n      function. */\n  virtual int size(void) const;\n  /** Returns a reference to the byte at offset #n#. This reference can be\n      used to read (as in #mbs[n]#) or modify (as in #mbs[n]=c#) the contents\n      of the buffer. */\n  char &operator[] (int n);\n  /** Copies all internal data into \\Ref{TArray} and returns it */\nprivate:\n  // Cancel C++ default stuff\n  Memory(const Memory &);\n  Memory & operator=(const Memory &);\n  // Current position\n  int where;\nprotected:\n  /** Reads data from a random position. This function reads at most #sz#\n      bytes at position #pos# into #buffer# and returns the actual number of\n      bytes read.  The current position is unchanged. */\n  virtual size_t readat(void *buffer, size_t sz, int pos);\n  /** Number of bytes in internal buffer. */\n  int bsize;\n  /** Number of 4096 bytes blocks. */\n  int nblocks;\n  /** Pointers (possibly null) to 4096 bytes blocks. */\n  char **blocks;\n  /** Pointers (possibly null) to 4096 bytes blocks. */\n  GPBuffer<char *> gblocks;\n};\n\n\n\ninline int\nByteStream::Memory::size(void) const\n{\n  return bsize;\n}\n\ninline char &\nByteStream::Memory::operator[] (int n)\n{\n  return blocks[n>>12][n&0xfff];\n}\n\n\n\n/** Read-only ByteStream interface to a memory area.  \n    Class #ByteStream::Static# implements a read-only ByteStream interface for a\n    memory area specified by the user at construction time. Calls to function\n    #read# directly access this memory area.  The user must therefore make\n    sure that its content remain valid long enough.  */\n\nclass ByteStream::Static : public ByteStream\n{\npublic:\n\n  /** Creates a Static object for allocating the memory area of\n      length #sz# starting at address #buffer#. */\n  Static(const void * const buffer, const size_t sz);\n  ~Static();\n  // Virtual functions\n  virtual size_t read(void *buffer, size_t sz);\n  virtual int    seek(long offset, int whence = SEEK_SET, bool nothrow=false);\n  virtual long tell(void) const;\n  /** Returns the total number of bytes contained in the buffer, file, etc.\n      Valid offsets for function #seek# range from 0 to the value returned\n      by this function. */\n  virtual int size(void) const;\nprotected:\n  const char *data;\n  int bsize;\nprivate:\n  int where;\n};\n\nByteStream::Static::~Static() {}\n\ninline int\nByteStream::Static::size(void) const\n{\n  return bsize;\n}\n\n#if HAS_MEMMAP\n/** Read-only ByteStream interface to a memmap area.\n    Class #MemoryMapByteStream# implements a read-only ByteStream interface\n    for a memory map to a file. */\n\nclass MemoryMapByteStream : public ByteStream::Static\n{\npublic:\n  MemoryMapByteStream(void);\n  virtual ~MemoryMapByteStream();  \nprivate:\n  GUTF8String init(const int fd, const bool closeme);\n  GUTF8String init(FILE *const f,const bool closeme);\n  friend class ByteStream;\n};\n#endif\n\n//// CLASS BYTESTREAM\n\n\nByteStream::~ByteStream()\n{\n}\n\nint \nByteStream::scanf(const char *fmt, ...)\n{\n  G_THROW( ERR_MSG(\"ByteStream.not_implemented\") ); // This is a place holder function.\n  return 0;\n}\n\nsize_t \nByteStream::read(void *buffer, size_t sz)\n{\n  G_THROW( ERR_MSG(\"ByteStream.cant_read\") );      //  Cannot read from a ByteStream created for writing\n  return 0;\n}\n\nsize_t \nByteStream::write(const void *buffer, size_t sz)\n{\n  G_THROW( ERR_MSG(\"ByteStream.cant_write\") );      //  Cannot write from a ByteStream created for reading\n  return 0;\n}\n\nvoid\nByteStream::flush()\n{\n}\n\nint\nByteStream::seek(long offset, int whence, bool nothrow)\n{\n  int nwhere = 0;\n  int ncurrent = tell();\n  switch (whence)\n    {\n    case SEEK_SET:\n      nwhere=0; break;\n    case SEEK_CUR:\n      nwhere=ncurrent; break;\n    case SEEK_END: \n    {\n      if(offset)\n      {\n        if (nothrow)\n          return -1;\n        G_THROW( ERR_MSG(\"ByteStream.backward\") );\n      }\n      char buffer[1024];\n      int bytes;\n      while((bytes=read(buffer, sizeof(buffer))))\n        EMPTY_LOOP;\n      return 0;\n    }\n    default:\n      G_THROW( ERR_MSG(\"ByteStream.bad_arg\") );       //  Illegal argument in seek\n    }\n  nwhere += offset;\n  if (nwhere < ncurrent) \n  {\n    //  Seeking backwards is not supported by this ByteStream\n    if (nothrow)\n      return -1;\n    G_THROW( ERR_MSG(\"ByteStream.backward\") );\n  }\n  while (nwhere>ncurrent)\n  {\n    char buffer[1024];\n    const int xbytes=(ncurrent+(int)sizeof(buffer)>nwhere)\n      ?(nwhere - ncurrent):(int)sizeof(buffer);\n    const int bytes = read(buffer, xbytes);\n    ncurrent += bytes;\n    if (!bytes)\n      G_THROW( ByteStream::EndOfFile );\n    //  Seeking works funny on this ByteStream (ftell() acts strange)\n    if (ncurrent!=tell())\n      G_THROW( ERR_MSG(\"ByteStream.seek\") );\n  }\n  return 0;\n}\n\nsize_t \nByteStream::readall(void *buffer, size_t size)\n{\n  size_t total = 0;\n    while (size > 0)\n    {\n      int nitems = read(buffer, size);\n      // Replaced perror() below with G_THROW(). It still makes little sense\n      // as there is no guarantee, that errno is right. Still, throwing\n      // exception instead of continuing to loop is better.\n      // - eaf\n      if(nitems < 0) \n        G_THROW(strerror(errno));               //  (No error in the DjVuMessageFile)\n      if (nitems == 0)\n        break;\n      total += nitems;\n      size -= nitems; \n      buffer = (void*)((char*)buffer + nitems);\n    }\n  return total;\n}\n\nsize_t\nByteStream::format(const char *fmt, ... )\n{\n  va_list args;\n  va_start(args, fmt); \n  const GUTF8String message(fmt,args);\n  return writestring(message);\n}\n\nsize_t\nByteStream::writestring(const GNativeString &s)\n{\n  int retval;\n  if(cp != UTF8)\n  {\n    retval=writall((const char *)s,s.length());\n    if(cp == AUTO)\n      cp=NATIVE; // Avoid mixing string types.\n  }else\n  { \n    const GUTF8String msg(s.getNative2UTF8());\n    retval=writall((const char *)msg,msg.length());\n  }\n  return retval;\n}\n\nsize_t\nByteStream::writestring(const GUTF8String &s)\n{\n  int retval;\n  if(cp != NATIVE)\n  {\n    retval=writall((const char *)s,s.length());\n    if(cp == AUTO)\n      cp=UTF8; // Avoid mixing string types.\n  }else\n  { \n    const GNativeString msg(s.getUTF82Native());\n    retval=writall((const char *)msg,msg.length());\n  }\n  return retval;\n}\n\nsize_t \nByteStream::writall(const void *buffer, size_t size)\n{\n  size_t total = 0;\n  while (size > 0)\n    {\n      size_t nitems = write(buffer, size);\n      if (nitems == 0)\n        G_THROW( ERR_MSG(\"ByteStream.write_error\") );      //  Unknown error in write\n      total += nitems;\n      size -= nitems; \n      buffer = (void*)((char*)buffer + nitems);\n    }\n  return total;\n}\n\nsize_t \nByteStream::copy(ByteStream &bsfrom, size_t size)\n{\n  size_t total = 0;\n  const size_t max_buffer_size=200*1024;\n  const size_t buffer_size=(size>0 && size<max_buffer_size)\n    ?size:max_buffer_size;\n  char *buffer;\n  GPBuffer<char> gbuf(buffer,buffer_size);\n  for(;;)\n    {\n      size_t bytes = buffer_size;\n      if (size>0 && bytes+total>size)\n        bytes = size - total;\n      if (bytes == 0)\n        break;\n      bytes = bsfrom.read((void*)buffer, bytes);\n      if (bytes == 0)\n        break;\n      writall((void*)buffer, bytes);\n      total += bytes;\n    }\n  return total;\n}\n\n\nvoid \nByteStream::write8 (unsigned int card)\n{\n  unsigned char c[1];\n  c[0] = (card) & 0xff;\n  if (write((void*)c, sizeof(c)) != sizeof(c))\n    G_THROW(strerror(errno));   //  (No error in the DjVuMessageFile)\n}\n\nvoid \nByteStream::write16(unsigned int card)\n{\n  unsigned char c[2];\n  c[0] = (card>>8) & 0xff;\n  c[1] = (card) & 0xff;\n  if (writall((void*)c, sizeof(c)) != sizeof(c))\n    G_THROW(strerror(errno));   //  (No error in the DjVuMessageFile)\n}\n\nvoid \nByteStream::write24(unsigned int card)\n{\n  unsigned char c[3];\n  c[0] = (card>>16) & 0xff;\n  c[1] = (card>>8) & 0xff;\n  c[2] = (card) & 0xff;\n  if (writall((void*)c, sizeof(c)) != sizeof(c))\n    G_THROW(strerror(errno));   //  (No error in the DjVuMessageFile)\n}\n\nvoid \nByteStream::write32(unsigned int card)\n{\n  unsigned char c[4];\n  c[0] = (card>>24) & 0xff;\n  c[1] = (card>>16) & 0xff;\n  c[2] = (card>>8) & 0xff;\n  c[3] = (card) & 0xff;\n  if (writall((void*)c, sizeof(c)) != sizeof(c))\n    G_THROW(strerror(errno));   //  (No error in the DjVuMessageFile)\n}\n\nunsigned int \nByteStream::read8 ()\n{\n  unsigned char c[1];\n  if (readall((void*)c, sizeof(c)) != sizeof(c))\n    G_THROW( ByteStream::EndOfFile );\n  return c[0];\n}\n\nunsigned int \nByteStream::read16()\n{\n  unsigned char c[2];\n  if (readall((void*)c, sizeof(c)) != sizeof(c))\n    G_THROW( ByteStream::EndOfFile );\n  return (c[0]<<8)+c[1];\n}\n\nunsigned int \nByteStream::read24()\n{\n  unsigned char c[3];\n  if (readall((void*)c, sizeof(c)) != sizeof(c))\n    G_THROW( ByteStream::EndOfFile );\n  return (((c[0]<<8)+c[1])<<8)+c[2];\n}\n\nunsigned int \nByteStream::read32()\n{\n  unsigned char c[4];\n  if (readall((void*)c, sizeof(c)) != sizeof(c))\n    G_THROW( ByteStream::EndOfFile );\n  return (((((c[0]<<8)+c[1])<<8)+c[2])<<8)+c[3];\n}\n\n\n\n//// CLASS ByteStream::Stdio\n\nByteStream::Stdio::Stdio(void)\n: can_read(false),can_write(false),must_close(true),fp(0),pos(0)\n{}\n\nByteStream::Stdio::~Stdio()\n{\n  if (fp && must_close)\n    fclose(fp);\n}\n\nGUTF8String\nByteStream::Stdio::init(const char mode[])\n{\n  char const *mesg=0;\n  bool binary=false;\n  if(!fp)\n    must_close=false;\n  for (const char *s=mode; s && *s; s++)\n  {\n    switch(*s) \n    {\n      case 'r':\n        can_read=true;\n        if(!fp) fp=stdin;\n        break;\n      case 'w': \n      case 'a':\n        can_write=true;\n        if(!fp) fp=stdout;\n        break;\n      case '+':\n        can_read=can_write=true;\n        break;\n      case 'b':\n        binary=true;\n        break;\n      default:\n        mesg= ERR_MSG(\"ByteStream.bad_mode\"); //  Illegal mode in Stdio\n    }\n  }\n  if(binary && fp) {\n#if defined(__CYGWIN32__)\n    setmode(fileno(fp), O_BINARY);\n#elif defined(WIN32)\n    _setmode(_fileno(fp), _O_BINARY);\n#endif\n  }\n  GUTF8String retval;\n  if(!mesg)\n  {\n    tell();\n  }else\n  {\n    retval=mesg;\n  }\n  if(mesg &&(fp && must_close))\n  {\n    fclose(fp);\n    fp=0;\n    must_close=false;\n  }\n  return retval;\n}\n\nstatic FILE *\nurlfopen(const GURL &url,const char mode[])\n{\n#ifdef WIN32\n  FILE *retval=0;\n  const GUTF8String filename(url.UTF8Filename());\n  wchar_t *wfilename;\n  const size_t wfilename_size=filename.length()+1;\n  GPBuffer<wchar_t> gwfilename(wfilename,wfilename_size);\n  if(filename.ncopy(wfilename,wfilename_size) > 0)\n  {\n    const GUTF8String gmode(mode);\n    wchar_t *wmode;\n    const size_t wmode_size=gmode.length()+1;\n    GPBuffer<wchar_t> gwmode(wmode,wmode_size);\n\tif(gmode.ncopy(wmode,wmode_size) > 0)\n\t{\n\t  retval=_wfopen(wfilename,wmode);\n\t}\n  }\n  return retval?retval:fopen((const char *)url.NativeFilename(),mode);\n#else\n  return fopen((const char *)url.NativeFilename(),mode);\n#endif\n}\n\n#ifdef UNIX\nstatic int\nurlopen(const GURL &url, const int mode, const int perm)\n{\n  return open((const char *)url.NativeFilename(),mode,perm);\n}\n#endif /* UNIX */\n\nGUTF8String\nByteStream::Stdio::init(const GURL &url, const char mode[])\n{\n  GUTF8String retval;\n  if (url.fname() != \"-\")\n  {\n    fp = urlfopen(url,mode);\n    if (!fp)\n    {\n      //  Failed to open '%s': %s\n      G_THROW( ERR_MSG(\"ByteStream.open_fail\") \"\\t\" + url.name()\n               +\"\\t\"+GNativeString(strerror(errno)).getNative2UTF8());\n    }\n  }\n  return retval.length()?retval:init(mode);\n}\n\nsize_t \nByteStream::Stdio::read(void *buffer, size_t size)\n{\n  if (!can_read)\n    G_THROW( ERR_MSG(\"ByteStream.no_read\") ); //  Stdio not opened for reading\n  size_t nitems;\n  do\n  {\n    clearerr(fp);\n    nitems = fread(buffer, 1, size, fp); \n    if (nitems<=0 && ferror(fp))\n    {\n#ifdef EINTR\n      if (errno!=EINTR)\n#endif\n        G_THROW(strerror(errno)); //  (No error in the DjVuMessageFile)\n    }\n    else\n      break;\n  } while(true);\n  pos += nitems;\n  return nitems;\n}\n\nsize_t \nByteStream::Stdio::write(const void *buffer, size_t size)\n{\n  if (!can_write)\n    G_THROW( ERR_MSG(\"ByteStream.no_write\") ); //  Stdio not opened for writing\n  size_t nitems;\n  do\n  {\n    clearerr(fp);\n    nitems = fwrite(buffer, 1, size, fp);\n    if (nitems<=0 && ferror(fp))\n    {\n#ifdef EINTR\n      if (errno!=EINTR)\n#endif\n        G_THROW(strerror(errno)); //  (No error in the DjVuMessageFile)\n    }\n    else\n      break;\n  } while(true);\n  pos += nitems;\n  return nitems;\n}\n\nvoid\nByteStream::Stdio::flush()\n{\n  if (fflush(fp) < 0)\n    G_THROW(strerror(errno)); //  (No error in the DjVuMessageFile)\n}\n\nlong \nByteStream::Stdio::tell(void) const\n{\n  long x = ftell(fp);\n  if (x >= 0)\n  {\n    Stdio *sbs=const_cast<Stdio *>(this);\n    (sbs->pos) = x;\n  }else\n  {\n    x=pos;\n  }\n  return x;\n}\n\nint\nByteStream::Stdio::seek(long offset, int whence, bool nothrow)\n{\n  if (whence==SEEK_SET && offset>=0 && offset==ftell(fp))\n    return 0;\n  clearerr(fp);\n  if (fseek(fp, offset, whence)) \n    {\n      if (nothrow) \n        return -1;\n      G_THROW(strerror(errno)); //  (No error in the DjVuMessageFile)\n    }\n  return tell();\n}\n\n\n\n\n///////// ByteStream::Memory\n\nByteStream::Memory::Memory()\n  : where(0), bsize(0), nblocks(0), gblocks(blocks,0)\n{\n}\n\nGUTF8String\nByteStream::Memory::init(void const * const buffer, const size_t sz)\n{\n  GUTF8String retval;\n  G_TRY\n  {\n    writall(buffer, sz);\n    where = 0;\n  }\n  G_CATCH(ex) // The only error that should be thrown is out of memory...\n  {\n    retval=ex.get_cause();\n  }\n  G_ENDCATCH;\n  return retval;\n}\n\nvoid \nByteStream::Memory::empty()\n{\n  for (int b=0; b<nblocks; b++)\n  {\n    delete [] blocks[b];\n    blocks[b]=0;\n  }\n  bsize = 0;\n  where = 0;\n  nblocks = 0;\n}\n\nByteStream::Memory::~Memory()\n{\n  empty();\n}\n\nsize_t \nByteStream::Memory::write(const void *buffer, size_t sz)\n{\n  int nsz = (int)sz;\n  if (nsz <= 0)\n    return 0;\n  // check memory\n  if ( (where+nsz) > ((bsize+0xfff)&~0xfff) )\n    {\n      // reallocate pointer array\n      if ( (where+nsz) > (nblocks<<12) )\n        {\n          const int old_nblocks=nblocks;\n          nblocks = (((where+nsz)+0xffff)&~0xffff) >> 12;\n          gblocks.resize(nblocks);\n          char const ** eblocks=(char const **)(blocks+old_nblocks);\n          for(char const * const * const new_eblocks=blocks+nblocks;\n            eblocks <new_eblocks; eblocks++) \n          {\n            *eblocks = 0;\n          }\n        }\n      // allocate blocks\n      for (int b=(where>>12); (b<<12)<(where+nsz); b++)\n      {\n        if (! blocks[b])\n          blocks[b] = new char[0x1000];\n      }\n    }\n  // write data to buffer\n  while (nsz > 0)\n    {\n      int n = (where|0xfff) + 1 - where;\n      n = ((nsz < n) ? nsz : n);\n      memcpy( (void*)&blocks[where>>12][where&0xfff], buffer, n);\n      buffer = (void*) ((char*)buffer + n);\n      where += n;\n      nsz -= n;\n    }\n  // adjust size\n  if (where > bsize)\n    bsize = where;\n  return sz;\n}\n\nsize_t \nByteStream::Memory::readat(void *buffer, size_t sz, int pos)\n{\n  if ((int) sz > bsize - pos)\n    sz = bsize - pos;\n  int nsz = (int)sz;\n  if (nsz <= 0)\n    return 0;\n  // read data from buffer\n  while (nsz > 0)\n    {\n      int n = (pos|0xfff) + 1 - pos;\n      n = ((nsz < n) ? nsz : n);\n      memcpy(buffer, (void*)&blocks[pos>>12][pos&0xfff], n);\n      buffer = (void*) ((char*)buffer + n);\n      pos += n;\n      nsz -= n;\n    }\n  return sz;\n}\n\nsize_t \nByteStream::Memory::read(void *buffer, size_t sz)\n{\n  sz = readat(buffer,sz,where);\n  where += sz;\n  return sz;\n}\n\nlong \nByteStream::Memory::tell(void) const\n{\n  return where;\n}\n\nint\nByteStream::Memory::seek(long offset, int whence, bool nothrow)\n{\n  int nwhere = 0;\n  switch (whence)\n    {\n    case SEEK_SET: nwhere = 0; break;\n    case SEEK_CUR: nwhere = where; break;\n    case SEEK_END: nwhere = bsize; break;\n    default: G_THROW( ERR_MSG(\"bad_arg\") \"\\tByteStream::Memory::seek()\");      // Illegal argument in ByteStream::Memory::seek()\n    }\n  nwhere += offset;\n  if (nwhere<0)\n    G_THROW( ERR_MSG(\"ByteStream.seek_error2\") );                          //  Attempt to seek before the beginning of the file\n  where = nwhere;\n  return 0;\n}\n\n\n\n/** This function has been moved into Arrays.cpp\n    In order to avoid dependencies from ByteStream.o\n    to Arrays.o */\n#ifdef DO_NOT_MOVE_GET_DATA_TO_ARRAYS_CPP\nTArray<char>\nByteStream::get_data(void)\n{\n   TArray<char> data(0, size()-1);\n   readat((char*)data, size(), 0);\n   return data;\n}\n#endif\n\n\n///////// ByteStream::Static\n\nByteStream::Static::Static(const void * const buffer, const size_t sz)\n  : data((const char *)buffer), bsize(sz), where(0)\n{\n}\n\nsize_t \nByteStream::Static::read(void *buffer, size_t sz)\n{\n  int nsz = (int)sz;\n  if (nsz > bsize - where)\n    nsz = bsize - where;\n  if (nsz <= 0)\n    return 0;\n  memcpy(buffer, data+where, nsz);\n  where += nsz;\n  return nsz;\n}\n\nint\nByteStream::Static::seek(long offset, int whence, bool nothrow)\n{\n  int nwhere = 0;\n  switch (whence)\n    {\n    case SEEK_SET: nwhere = 0; break;\n    case SEEK_CUR: nwhere = where; break;\n    case SEEK_END: nwhere = bsize; break;\n    default: G_THROW(\"bad_arg\\tByteStream::Static::seek()\");      //  Illegal argument to ByteStream::Static::seek()\n    }\n  nwhere += offset;\n  if (nwhere<0)\n    G_THROW( ERR_MSG(\"ByteStream.seek_error2\") );                          //  Attempt to seek before the beginning of the file\n  where = nwhere;\n  return 0;\n}\n\nlong \nByteStream::Static::tell(void) const\n{\n  return where;\n}\n\nGP<ByteStream>\nByteStream::create(void)\n{\n  return new Memory();\n}\n\nGP<ByteStream>\nByteStream::create(void const * const buffer, const size_t size)\n{\n  Memory *mbs=new Memory();\n  GP<ByteStream> retval=mbs;\n  mbs->init(buffer,size);\n  return retval;\n}\n\nGP<ByteStream>\nByteStream::create(const GURL &url,char const * const xmode)\n{\n  GP<ByteStream> retval;\n  const char *mode = ((xmode) ? xmode : \"rb\");\n#ifdef UNIX\n  if (!strcmp(mode,\"rb\")) \n    {\n      int fd = urlopen(url,O_RDONLY,0777);\n      if (fd >= 0)\n        {\n#if HAS_MEMMAP && defined(S_IFREG)\n          struct stat buf;\n          if ( (fstat(fd, &buf) >= 0) && (buf.st_mode & S_IFREG) )\n            {\n              MemoryMapByteStream *rb = new MemoryMapByteStream();\n              retval = rb;\n              GUTF8String errmessage = rb->init(fd,true);\n              if(errmessage.length())\n                retval=0;\n            }\n#endif\n          if (! retval)\n            {\n              FILE *f = fdopen(fd, mode);\n              if (f) \n                {\n                  Stdio *sbs=new Stdio();\n                  retval=sbs;\n                  GUTF8String errmessage=sbs->init(f, mode, true);\n                  if(errmessage.length())\n                    retval=0;\n                }\n            }\n          if (! retval)\n            close(fd);\n        }     \n    }\n#endif\n  if (! retval)\n    {\n      Stdio *sbs=new Stdio();\n      retval=sbs;\n      GUTF8String errmessage=sbs->init(url, mode);\n      if(errmessage.length())\n        G_THROW(errmessage);\n    }\n  return retval;\n}\n\nGP<ByteStream>\nByteStream::create(char const * const mode)\n{\n  GP<ByteStream> retval;\n  Stdio *sbs=new Stdio();\n  retval=sbs;\n  GUTF8String errmessage=sbs->init(mode?mode:\"rb\");\n  if(errmessage.length())\n  {\n    G_THROW(errmessage);\n  }\n  return retval;\n}\n\nGP<ByteStream>\nByteStream::create(const int fd,char const * const mode,const bool closeme)\n{\n  GP<ByteStream> retval;\n  const char *default_mode=\"rb\";\n#if HAS_MEMMAP\n  if (   (!mode&&(fd!=0)&&(fd!=1)&&(fd!=2)) \n      || (mode&&(GUTF8String(\"rb\") == mode)))\n  {\n    MemoryMapByteStream *rb=new MemoryMapByteStream();\n    retval=rb;\n    GUTF8String errmessage=rb->init(fd,closeme);\n    if(errmessage.length())\n    {\n      retval=0;\n    }\n  }\n  if(!retval)\n#endif\n  {\n    int fd2 = fd;\n    FILE *f = 0;\n    if (fd == 0 && !closeme \n        && (!mode || mode[0]=='r') )\n      {\n        f=stdin;\n        default_mode = \"r\";\n        fd2=(-1);\n      }\n    else if (fd == 1 && !closeme \n             && (!mode || mode[0]=='a' || mode[0]=='w') )\n      {\n        default_mode = \"a\";\n        f=stdout;\n        fd2 = -1;\n      }\n    else if (fd == 2 && !closeme\n             && (!mode || mode[0]=='a' || mode[0]=='w') )\n      {\n        default_mode = \"a\";\n        f=stderr;\n        fd2 = -1;\n      }\n    else\n      {\n        if (! closeme)\n          fd2 = dup(fd);\n        f = fdopen(fd2,(char*)(mode?mode:default_mode));\n      }\n\n    if(!f)\n      {\n        if ( fd2 >= 0)\n          close(fd2);\n        G_THROW( ERR_MSG(\"ByteStream.open_fail2\") );\n      }\n    Stdio *sbs=new Stdio();\n    retval=sbs;\n    GUTF8String errmessage=sbs->init(f,mode?mode:default_mode,(fd2>=0));\n    if(errmessage.length())\n      G_THROW(errmessage);\n  }\n  return retval;\n}\n\nGP<ByteStream>\nByteStream::create(FILE * const f,char const * const mode,const bool closeme)\n{\n  GP<ByteStream> retval;\n#if HAS_MEMMAP\n  if (!mode || (GUTF8String(\"rb\") == mode))\n  {\n    MemoryMapByteStream *rb=new MemoryMapByteStream();\n    retval=rb;\n    GUTF8String errmessage=rb->init(fileno(f),false);\n    if(errmessage.length())\n    {\n      retval=0;\n    }else\n    {\n      fclose(f);\n    }\n  }\n  if(!retval)\n#endif\n  {\n    Stdio *sbs=new Stdio();\n    retval=sbs;\n    GUTF8String errmessage=sbs->init(f,mode?mode:\"rb\",closeme);\n    if(errmessage.length())\n    {\n      G_THROW(errmessage);\n    }\n  }\n  return retval;\n}\n\nGP<ByteStream>\nByteStream::create_static(const void * buffer, size_t sz)\n{\n  return new Static(buffer, sz);\n}\n\n#if HAS_MEMMAP\nMemoryMapByteStream::MemoryMapByteStream(void)\n: ByteStream::Static(0,0)\n{}\n\nGUTF8String\nMemoryMapByteStream::init(FILE *const f,const bool closeme)\n{\n  GUTF8String retval;\n  retval=init(fileno(f),false);\n  if(closeme)\n  {\n    fclose(f);\n  }\n  return retval;\n}\n\nGUTF8String\nMemoryMapByteStream::init(const int fd,const bool closeme)\n{\n  GUTF8String retval;\n  data = (char*)(-1);\n#if defined(PROT_READ) && defined(MAP_SHARED)\n  struct stat statbuf;\n  if(!fstat(fd,&statbuf) && statbuf.st_size)\n    {\n      bsize=statbuf.st_size;\n      data=(char *)mmap(0,statbuf.st_size,PROT_READ,MAP_SHARED,fd,0);\n    }\n#endif\n  if(data == (char *)(-1))\n    retval = ERR_MSG(\"ByteStream.open_fail2\");\n  if(closeme)\n    close(fd);\n  return retval;\n}\n\nMemoryMapByteStream::~MemoryMapByteStream()\n{\n  if(data)\n  {\n    munmap(const_cast<char *>(data),bsize);\n  }\n}\n\n#endif\n\nByteStream::Wrapper::~Wrapper() {}\n\n\nGP<ByteStream> \nByteStream::get_stdin(char const *mode)\n{\n  static GP<ByteStream> gp = ByteStream::create(0,mode,false);\n  return gp;\n}\n\nGP<ByteStream> \nByteStream::get_stdout(char const *mode)\n{\n  static GP<ByteStream> gp = ByteStream::create(1,mode,false);\n  return gp;\n}\n\nGP<ByteStream> \nByteStream::get_stderr(char const *mode)\n{\n  static GP<ByteStream> gp = ByteStream::create(2,mode,false);\n  return gp;\n}\n\n\n/** Looks up the message and writes it to the specified stream. */\nvoid ByteStream::formatmessage( const char *fmt, ... )\n{\n  va_list args;\n  va_start(args, fmt);\n  const GUTF8String message(fmt,args);\n  writemessage( message );\n}\n\n/** Looks up the message and writes it to the specified stream. */\nvoid ByteStream::writemessage( const char *message )\n{\n  writestring( DjVuMessage::LookUpUTF8( message ) );\n}\n\nstatic void \nread_file(ByteStream &bs,char *&buffer,GPBuffer<char> &gbuffer)\n{\n  const int size=bs.size();\n  int pos=0;\n  if(size>0)\n  {\n    size_t readsize=size+1;\n    gbuffer.resize(readsize);\n    for(int i;readsize&&(i=bs.read(buffer+pos,readsize))>0;pos+=i,readsize-=i)\n      EMPTY_LOOP;\n  }else\n  {\n    const size_t readsize=32768;\n    gbuffer.resize(readsize);\n    for(int i;((i=bs.read(buffer+pos,readsize))>0);\n      gbuffer.resize((pos+=i)+readsize))\n      EMPTY_LOOP;\n  }\n  buffer[pos]=0;\n}\n\nGNativeString\nByteStream::getAsNative(void)\n{\n  char *buffer;\n  GPBuffer<char> gbuffer(buffer);\n  read_file(*this,buffer,gbuffer);\n  return GNativeString(buffer);\n}\n\nGUTF8String\nByteStream::getAsUTF8(void)\n{\n  char *buffer;\n  GPBuffer<char> gbuffer(buffer);\n  read_file(*this,buffer,gbuffer);\n  return GUTF8String(buffer);\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n\nvoid\nDjVuPrintErrorUTF8(const char *fmt, ... )\n{\n  G_TRY {\n    GP<ByteStream> errout = ByteStream::get_stderr();\n    if (errout)\n      {\n        errout->cp=ByteStream::NATIVE;\n        va_list args;\n        va_start(args, fmt); \n        const GUTF8String message(fmt,args);\n        errout->writestring(message);\n      }\n    // Need to catch all exceptions because these might be \n    // called from an outer exception handler (with prejudice)\n  } G_CATCH_ALL { } G_ENDCATCH;\n}\n\nvoid\nDjVuPrintErrorNative(const char *fmt, ... )\n{\n  G_TRY {\n    GP<ByteStream> errout = ByteStream::get_stderr();\n    if (errout)\n      {\n        errout->cp=ByteStream::NATIVE;\n        va_list args;\n        va_start(args, fmt); \n        const GNativeString message(fmt,args);\n        errout->writestring(message);\n      }\n    // Need to catch all exceptions because these might be \n    // called from an outer exception handler (with prejudice)\n  } G_CATCH_ALL { } G_ENDCATCH;\n}\n\nvoid\nDjVuPrintMessageUTF8(const char *fmt, ... )\n{\n  G_TRY {\n    GP<ByteStream> strout = ByteStream::get_stdout();\n    if (strout)\n      {\n        strout->cp=ByteStream::NATIVE;\n        va_list args;\n        va_start(args, fmt);\n        const GUTF8String message(fmt,args);\n        strout->writestring(message);\n      }\n    // Need to catch all exceptions because these might be \n    // called from an outer exception handler (with prejudice)\n  } G_CATCH_ALL { } G_ENDCATCH;\n}\n\nvoid\nDjVuPrintMessageNative(const char *fmt, ... )\n{\n  G_TRY {\n    GP<ByteStream> strout = ByteStream::get_stdout();\n    if (strout)\n      {\n        strout->cp=ByteStream::NATIVE;\n        va_list args;\n        va_start(args, fmt);\n        const GNativeString message(fmt,args);\n        strout->writestring(message);\n      }\n    // Need to catch all exceptions because these might be \n    // called from an outer exception handler (with prejudice)\n  } G_CATCH_ALL { } G_ENDCATCH;\n}\n"
  },
  {
    "path": "ext/libdjvu/ByteStream.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _BYTESTREAM_H\n#define _BYTESTREAM_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n/** @name ByteStream.h\n    \n    Files #\"ByteStream.h\"# and #\"ByteStream.cpp\"# define input/output classes\n    similar in spirit to the well known C++ #iostream# classes.  Class\n    \\Ref{ByteStream} is an abstract base class for all byte streams.  It\n    defines a virtual interface and also provides useful functions.  These\n    files provide two subclasses. Class \\Ref{ByteStream::Stdio} provides a\n    simple interface to the Ansi C buffered input/output functions. Class\n    \\Ref{ByteStream::Memory} provides stream-like access to a dynamical array\n    maintained in memory. Class \\Ref{ByteStream::Static} provides read-only\n    stream-like access to a user allocated data buffer.\n\n    {\\bf Notes} --- These classes were partly written because we did not want to\n    depend on the standard C++ library.  The main reason however is related to\n    the browser interface. We want to have a tight control over the\n    implementation of subclasses because we want to use a byte stream to\n    represent data passed by a web browser to a plugin.  This operation\n    involves multi-threading issues that many implementations of the standard\n    C++ library would squarely ignore.\n\n    @memo \n    Input/output classes\n    @author\n    L\\'eon Bottou <leonb@research.att.com> -- initial implementation\\\\\n    Andrei Erofeev <eaf@geocities.com> -- \n\n// From: Leon Bottou, 1/31/2002\n// This file has very little to do with my initial implementation.\n// It has been practically rewritten by Lizardtech for i18n changes.\n// Our original implementation consisted of multiple classes.\n// <http://prdownloads.sourceforge.net/djvu/DjVu2_2b-src.tgz>.\n\n*/\n//@{\n\n\n#include \"Arrays.h\"\n#include <stdio.h>\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass GURL;\nclass GUTF8String;\nclass GNativeString;\n\n/** Abstract class for a stream of bytes.  Class #ByteStream# represent an\n    object from which (resp. to which) bytes can be read (resp. written) as\n    with a regular file.  Virtual functions #read# and #write# must implement\n    these two basic operations.  In addition, function #tell# returns an\n    offset identifying the current position, and function #seek# may be used\n    to change the current position.\n\n    {\\bf Note}. Both the copy constructor and the copy operator are declared\n    as private members. It is therefore not possible to make multiple copies\n    of instances of this class, as implied by the class semantic.  \n*/\nclass DJVUAPI ByteStream : public GPEnabled\n{\npublic:\n  class Stdio;\n  class Static;\n  class Memory;\n  class Wrapper;\n  enum codepage_type {RAW,AUTO,NATIVE,UTF8} cp;\n\n  /** @name Virtual Functions.\n      These functions are usually implemented by each subclass of #ByteStream#.\n  */\n  //@{\npublic:\n  /** Virtual destructor. */\n  virtual ~ByteStream();\n  /** Reads data from a ByteStream.  This function {\\em must} be implemented\n      by each subclass of #ByteStream#.  At most #size# bytes are read from\n      the ByteStream and stored in the memory area pointed to by #buffer#.\n      Function #read# returns immediately if #size# is zero. The actual number\n      of bytes read is returned.  Function #read# returns a number of bytes\n      smaller than #size# if the end-of-file mark is reached before filling\n      the buffer. Subsequent invocations will always return value #0#.\n      Function #read# may also return a value greater than zero but smaller\n      than #size# for internal reasons. Programs must be ready to handle these\n      cases or use function \\Ref{readall}. Exception \\Ref{GException} is\n      thrown with a plain text error message whenever an error occurs. */\n  virtual size_t read(void *buffer, size_t size);\n  /** Writes data to a ByteStream.  This function {\\em must} be implemented by\n      each subclass of #ByteStream#.  At most #size# bytes from buffer\n      #buffer# are written to the ByteStream.  Function #write# returns\n      immediately if #size# is zero.  The actual number of bytes written is\n      returned. Function #write# may also return a value greater than zero but\n      smaller than #size# for internal reasons. Programs must be ready to\n      handle these cases or use function \\Ref{writall}. Exception\n      \\Ref{GException} is thrown with a plain text error message whenever an\n      error occurs. */\n  virtual size_t write(const void *buffer, size_t size);\n  /** Returns the offset of the current position in the ByteStream.  This\n      function {\\em must} be implemented by each subclass of #ByteStream#. */\n  virtual long tell(void) const  = 0;\n  /** Sets the current position for reading or writing the ByteStream.  Class\n      #ByteStream# provides a default implementation able to seek forward by\n      calling function #read# until reaching the desired position.  Subclasses\n      implementing better seek capabilities must override this default\n      implementation.  The new current position is computed by applying\n      displacement #offset# to the position represented by argument\n      #whence#. The following values are recognized for argument #whence#:\n      \\begin{description}\n      \\item[#SEEK_SET#] Argument #offset# indicates the position relative to\n      the beginning of the ByteStream.\n      \\item[#SEEK_CUR#] Argument #offset# is a signed displacement relative to\n      the current position.\n      \\item[#SEEK_END#] Argument #offset# is a displacement relative to the end\n      of the file. It is then advisable to provide a negative value for #offset#.\n      \\end{description}\n      Results are undefined whenever the new position is greater than the\n      total size of the ByteStream.\n\n      {\\bf Error reporting}:\n      If #seek()# succeeds, #0# is returned. Otherwise it either returns\n      #-1# (if #nothrow# is set to #FALSE#) or throws the \\Ref{GException}\n      exception. */\n  virtual int seek(long offset, int whence = SEEK_SET, bool nothrow=false);\n  /** Flushes all buffers in the ByteStream.  Calling this function\n      guarantees that pending data have been actually written (i.e. passed to\n      the operating system). Class #ByteStream# provides a default\n      implementation which does nothing. */\n  virtual void flush(void);\n  //@}\n  /** @name Utility Functions.  \n      Class #ByteStream# implements these functions using the virtual\n      interface functions only.  All subclasses of #ByteStream# inherit these\n      functions. */\n  //@{\npublic:\n  /** Reads data and blocks until everything has been read.  This function is\n      essentially similar to function #read#.  Unlike function #read# however,\n      function #readall# will never return a value smaller than #size# unless\n      an end-of-file mark is reached.  This is implemented by repeatedly\n      calling function #read# until everything is read or until we reach an\n      end-of-file mark.  Note that #read# and #readall# are equivalent when\n      #size# is one. */\n  size_t readall(void *buffer, size_t size);\n  /** Writes data and blocks until everything has been written.  This function\n      is essentially similar to function #write#.  Unlike function #write#\n      however, function #writall# will only return after all #size# bytes have\n      been written.  This is implemented by repeatedly calling function\n      #write# until everything is written.  Note that #write# and #writall#\n      are equivalent when #size# is one. */\n  size_t writall(const void *buffer, size_t size);\n  /** Copy data from another ByteStream.  A maximum of #size# bytes are read\n      from the ByteStream #bsfrom# and are written to the ByteStream #*this#\n      at the current position.  Less than #size# bytes may be written if an\n      end-of-file mark is reached on #bsfrom#.  This function returns the\n      total number of bytes copied.  Setting argument #size# to zero (the\n      default value) has a special meaning: the copying process will continue\n      until reaching the end-of-file mark on ByteStream #bsfrom#, regardless\n      of the number of bytes transferred.  */\n  size_t copy(ByteStream &bsfrom, size_t size=0);\n  /// Allows printf() type operations to a bytestream.\n  size_t format(const char *fmt, ... );\n  /// Allows scanf() type operations on a bytestream.\n  int scanf(const char *fmt, ... );\n  /** Writes the string as is, to the specified stream. */\n  size_t writestring(const GUTF8String &s);\n  /** Writes the string as is, to the specified stream. */\n  size_t writestring(const GNativeString &s);\n  /** Formats the message string, looks up the external representation\n      and writes it to the specified stream. */\n  void formatmessage( const char *fmt, ... );\n  /** Looks up the message and writes it to the specified stream. */\n  void writemessage( const char *message );\n  /** Writes a one-byte integer to a ByteStream. */\n  void write8 (unsigned int card8);\n  /** Writes a two-bytes integer to a ByteStream.\n      The integer most significant byte is written first,\n      regardless of the processor endianness. */\n  void write16(unsigned int card16);\n  /** Writes a three-bytes integer to a ByteStream.\n      The integer most significant byte is written first,\n      regardless of the processor endianness. */\n  void write24(unsigned int card24);\n  /** Writes a four-bytes integer to a ByteStream. \n      The integer most significant bytes are written first,\n      regardless of the processor endianness. */\n  void write32(unsigned int card32);\n  /** Reads a one-byte integer from a ByteStream. */\n  unsigned int read8 ();\n  /** Reads a two-bytes integer from a ByteStream.\n      The integer most significant byte is read first,\n      regardless of the processor endianness. */\n  unsigned int read16();\n  /** Reads a three-bytes integer from a ByteStream.\n      The integer most significant byte is read first,\n      regardless of the processor endianness. */\n  unsigned int read24();\n  /** Reads a four-bytes integer from a ByteStream.\n      The integer most significant bytes are read first,\n      regardless of the processor endianness. */\n  unsigned int read32();\n  /** Returns the total number of bytes contained in the buffer, file, etc.\n      Valid offsets for function #seek# range from 0 to the value returned\n      by this function. */\n  virtual int size(void) const;\n  /// Use at your own risk, only guarenteed to work for ByteStream::Memorys.\n  TArray<char> get_data(void);\n  /** Reads data from a random position. This function reads at most #sz#\n      bytes at position #pos# into #buffer# and returns the actual number of\n      bytes read.  The current position is unchanged. */\n  virtual size_t readat(void *buffer, size_t sz, int pos);\n  //@}\nprotected:\n  ByteStream(void) : cp(AUTO) {};\nprivate:\n  // Cancel C++ default stuff\n  ByteStream(const ByteStream &);\n  ByteStream & operator=(const ByteStream &);\npublic:\n  /** Constructs an empty Memory ByteStream.  The buffer itself is organized\n      as an array of 4096 byte blocks.  The buffer is initially empty. You\n      must first use function #write# to store data into the buffer, use\n      function #seek# to rewind the current position, and function #read# to\n      read the data back. */\n  static GP<ByteStream> create(void);\n  /** Constructs a Memory ByteStream by copying initial data.  The\n      Memory buffer is initialized with #size# bytes copied from the\n      memory area pointed to by #buffer#. */\n  static GP<ByteStream> create(void const * const buffer, const size_t size);\n  /** Constructs a ByteStream for accessing the file named #url#.\n      Arguments #url# and #mode# are similar to the arguments of the well\n      known stdio function #fopen#. In addition a url of #-# will be\n      interpreted as the standard output or the standard input according to\n      #mode#.  This constructor will open a stdio file and construct a\n      ByteStream object accessing this file. Destroying the ByteStream object\n      will flush and close the associated stdio file.  Exception\n      \\Ref{GException} is thrown with a plain text error message if the stdio\n      file cannot be opened. */\n  static GP<ByteStream> create(\n    const GURL &url, char const * const mode);\n  /** Same as the above, but uses stdin or stdout */\n  static GP<ByteStream> create( char const * const mode);\n\n  /** Constructs a ByteStream for accessing the stdio file #f#.\n      Argument #mode# indicates the type of the stdio file, as in the\n      well known stdio function #fopen#.  Destroying the ByteStream\n      object will not close the stdio file #f# unless closeme is true. */\n  static GP<ByteStream> create(\n    const int fd, char const * const mode, const bool closeme);\n\n  /** Constructs a ByteStream for accessing the stdio file #f#.\n      Argument #mode# indicates the type of the stdio file, as in the\n      well known stdio function #fopen#.  Destroying the ByteStream\n      object will not close the stdio file #f# unless closeme is true. */\n  static GP<ByteStream> create(\n    FILE * const f, char const * const mode, const bool closeme);\n  /** Creates a ByteStream object for allocating the memory area of\n      length #sz# starting at address #buffer#.  This call impliments \n      a read-only ByteStream interface for a memory area specified by\n      the user at construction time. Calls to function #read# directly\n      access this memory area.  The user must therefore make sure that its\n      content remain valid long enough.  */\n  static GP<ByteStream> create_static(void const *buffer, size_t size);\n  \n  /** Easy access to preallocated stdin/stdout/stderr bytestreams */\n  static GP<ByteStream> get_stdin(char const * mode=0);\n  static GP<ByteStream> get_stdout(char const * mode=0);  \n  static GP<ByteStream> get_stderr(char const * mode=0);\n\n  /** This is the conventional name for EOF exceptions */\n  static const char *EndOfFile;\n  /** Returns the contents of the file as a GNativeString */\n  GNativeString getAsNative(void);\n  /** Returns the contents of the file as a GUTF8String */\n  GUTF8String getAsUTF8(void);\n};\n\ninline size_t\nByteStream::readat(void *buffer, size_t sz, int pos)\n{\n  size_t retval;\n  long tpos=tell();\n  seek(pos, SEEK_SET, true);\n  retval=readall(buffer,sz);\n  seek(tpos, SEEK_SET, true);\n  return retval;\n}\n\ninline int\nByteStream::size(void) const\n{\n  ByteStream *bs=const_cast<ByteStream *>(this);\n  int bsize=(-1);\n  long pos=tell();\n  if(bs->seek(0,SEEK_END,true))\n  {\n    bsize=(int)tell();\n    (void)(bs->seek(pos,SEEK_SET,false));\n  }\n  return bsize;\n}\n\n/** ByteStream::Wrapper implements wrapping bytestream.  This is useful\n    for derived classes that take a GP<ByteStream> as a creation argument,\n    and the backwards compatible bytestreams.  */\nclass DJVUAPI ByteStream::Wrapper : public ByteStream\n{\nprotected:\n  GP<ByteStream> gbs;\n  ByteStream *bs;\n  Wrapper(void) : bs(0) {}\n  Wrapper(const GP<ByteStream> &xbs) : gbs(xbs), bs(xbs) {}\npublic:\n  ~Wrapper();\n  ByteStream * operator & () const {return bs;}\n  ByteStream * operator & () {return bs;}\n  virtual size_t read(void *buffer, size_t size)\n    { return bs->read(buffer,size); }\n  virtual size_t write(const void *buffer, size_t size)\n    { return bs->write(buffer,size); }\n  virtual long tell(void) const\n    { return bs->tell(); }\n  virtual int seek(long offset, int whence = SEEK_SET, bool nothrow=false)\n    { return bs->seek(offset,whence,nothrow); }\n  virtual void flush(void)\n    { bs->flush(); }\n};\n\n\n//@}\n\n// ------------ THE END\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/COPYRIGHT",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n\n\n\n\n\n"
  },
  {
    "path": "ext/libdjvu/DataPool.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"DataPool.h\"\n#include \"IFFByteStream.h\"\n#include \"GString.h\"\n#include \"GOS.h\"\n#include \"GURL.h\"\n#include \"debug.h\"\n\n#ifndef macintosh\n# include <sys/types.h>\n#endif\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nconst char * DataPool::Stop = ERR_MSG(\"STOP\");\n\nstatic void\n// call_callback(void (* callback)(GP<GPEnabled> &), GP<GPEnabled> cl_data)\ncall_callback(void (* callback)(void *), void *cl_data)\n{\n   G_TRY\n   {\n      if (callback)\n        callback(cl_data);\n   } G_CATCH_ALL {} G_ENDCATCH;\n}\n\n\n//****************************************************************************\n//****************************** OpenFiles ***********************************\n//****************************************************************************\n\n#define MAX_OPEN_FILES\t15\n\n/** The purpose of this class is to limit the number of files open by\n    connected DataPools. Now, when a DataPool is connected to a file, it\n    doesn't necessarily has it open. Every time it needs access to data\n    it's supposed to ask this file for the ByteStream. It should\n    also inform the class when it's going to die (so that the file can\n    be closed). OpenFiles makes sure, that the number of open files\n    doesn't exceed MAX_OPEN_FILES. When it does, it looks for the oldest\n    file, closes it and asks all DataPools working with it to ZERO\n    their GP<> pointers. */\nclass DataPool::OpenFiles_File : public GPEnabled\n{\npublic:\n  GURL\t\t\turl;\n  GP<ByteStream>\t        stream;\t\t// Stream connected to 'url'\n  GCriticalSection\t\tstream_lock;\n  GPList<DataPool>\t\tpools_list;\t// List of pools using this stream\n  GCriticalSection\t\tpools_lock;\n  unsigned long\t\topen_time;\t// Time when stream was open\n  \n  int\tadd_pool(GP<DataPool> &pool);\n  int\tdel_pool(GP<DataPool> &pool);\n  \n  OpenFiles_File(const GURL &url, GP<DataPool> &pool);\n  virtual ~OpenFiles_File(void);\n  void clear_stream(void);\n};\n\nclass DataPool::OpenFiles : public GPEnabled\n{\nprivate:\n   static OpenFiles\t* global_ptr;\n\n   GPList<DataPool::OpenFiles_File>\t\tfiles_list;\n   GCriticalSection\tfiles_lock;\npublic:\n   static OpenFiles\t* get(void);\n\n      // Opend the specified file if necessary (or finds an already open one)\n      // and returns it. The caller (pool) is stored in the list associated\n      // with the stream. Whenever OpenFiles decides, that this stream\n      // had better be closed, it will order every pool from the list to\n      // ZERO their references to it\n   GP<DataPool::OpenFiles_File> request_stream(const GURL &url, GP<DataPool> pool);\n      // If there are more than MAX_STREAM_FILES open, close the oldest.\n   void\t\tprune(void);\n      // Removes the pool from the list associated with the stream.\n      // If there is nobody else using this stream, the stream will\n      // be closed too.\n   void\t\tstream_released(GP<ByteStream> &stream, GP<DataPool> pool);\n\n   void \tclose_all(void);\n};\n\nDataPool::OpenFiles * DataPool::OpenFiles::global_ptr;\n\nDataPool::OpenFiles_File::OpenFiles_File(const GURL &xurl, GP<DataPool> &pool) : url(xurl)\n{\n   DEBUG_MSG(\"DataPool::OpenFiles_File::OpenFiles_File(): Opening file '\" << url << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n   \n   open_time=GOS::ticks();\n   stream=ByteStream::create(url,\"rb\");\n   add_pool(pool);\n}\n\nDataPool::OpenFiles_File::~OpenFiles_File(void)\n{\n   DEBUG_MSG(\"DataPool::OpenFiles_File::~OpenFiles_File(): Closing file '\" << url << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n   clear_stream();\n}\n\nvoid\nDataPool::OpenFiles_File::clear_stream(void)\n{\n  GCriticalSectionLock lock(&pools_lock);\n  for(GPosition pos=pools_list;pos;++pos)\n    if(pools_list[pos])\n      pools_list[pos]->clear_stream(false);\n  pools_list.empty();\n}\n\nint\nDataPool::OpenFiles_File::add_pool(GP<DataPool> &pool)\n{\n   DEBUG_MSG(\"DataPool::OpenFiles_File::add_pool: pool=\" << (void *) pool << \"\\n\");\n   DEBUG_MAKE_INDENT(3);\n   GCriticalSectionLock lock(&pools_lock);\n   if (!pools_list.contains(pool))\n     pools_list.append(pool);\n   return pools_list.size();\n}\n\nint\nDataPool::OpenFiles_File::del_pool(GP<DataPool> &pool)\n{\n   DEBUG_MSG(\"DataPool::OpenFiles_File::del_pool: pool=\" << (void *) pool << \"\\n\");\n   DEBUG_MAKE_INDENT(3);\n   GCriticalSectionLock lock(&pools_lock);\n   GPosition pos;\n   if (pools_list.search(pool, pos))\n     pools_list.del(pos);\n   return pools_list.size();\n}\n\ninline DataPool::OpenFiles *\nDataPool::OpenFiles::get(void)\n{\n   DEBUG_MSG(\"DataPool::OpenFiles::get()\\n\");\n   DEBUG_MAKE_INDENT(3);\n   if (!global_ptr)\n     global_ptr=new OpenFiles();\n   return global_ptr;\n}\n\nvoid\nDataPool::OpenFiles::prune(void)\n{\n  DEBUG_MSG(\"DataPool::OpenFiles::prune(void): \"<<files_list.size()<< \"\\n\");\n  DEBUG_MAKE_INDENT(3);\n  while(files_list.size()>MAX_OPEN_FILES)\n    {\n      // Too many open files (streams). Get rid of the oldest one.\n      unsigned long oldest_time=GOS::ticks();\n      GPosition oldest_pos=files_list;\n      for(GPosition pos=files_list;pos;++pos)\n        {\n          if (files_list[pos]->open_time<oldest_time)\n            {\n              oldest_time=files_list[pos]->open_time;\n              oldest_pos=pos;\n            }\n        }\n      files_list[oldest_pos]->clear_stream();\n      files_list.del(oldest_pos);\n    }\n}\n\n//\t\t\t  GP<ByteStream> & stream,\n//\t\t\t  GCriticalSection ** stream_lock)\nGP<DataPool::OpenFiles_File>\nDataPool::OpenFiles::request_stream(const GURL &url, GP<DataPool> pool)\n{\n   DEBUG_MSG(\"DataPool::OpenFiles::request_stream(): url='\" << url << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   GP<DataPool::OpenFiles_File> file;\n\n      // Check: maybe the stream has already been open by request of\n      // another DataPool\n   GCriticalSectionLock lock(&files_lock);\n   for(GPosition pos=files_list;pos;++pos)\n   {\n      if (files_list[pos]->url==url)\n      {\n\t DEBUG_MSG(\"found existing stream\\n\");\n\t file=files_list[pos];\n\t break;\n      }\n   }\n\n      // No? Open the stream, but check, that there are not\n      // too many streams open\n   if (!file)\n   {\n      file=new DataPool::OpenFiles_File(url, pool);\n      files_list.append(file);\n      prune();\n   }\n   \n   file->add_pool(pool);\n   return file;\n}\n\nvoid\nDataPool::OpenFiles::stream_released(GP<ByteStream> &stream, GP<DataPool> pool)\n{\n   DEBUG_MSG(\"DataPool::OpenFiles::stream_release: stream=\" \n             << (void *)stream << \" pool=\" << (void *)pool << \"\\n\");\n   DEBUG_MAKE_INDENT(3);\n   GCriticalSectionLock lock(&files_lock);\n   for(GPosition pos=files_list;pos;)\n   {\n     GPosition dpos = pos;\n     ++pos;\n     GP<DataPool::OpenFiles_File> f=files_list[dpos];\n     if ((ByteStream *)(f->stream) == (ByteStream *)stream)\n       if (f->del_pool(pool)==0)\n         files_list.del(dpos);\n   }\n}\n\n// This isn't really an accurate url.  The files are not really\n// closed.  Instead they are dereferenced from the data pool.  If\n// a there is another reference to the respective bytestream, it\n// will remain open until dereferenced.\nvoid\nDataPool::OpenFiles::close_all(void)\n{\n  DEBUG_MSG(\"DataPool::OpenFiles::close_all\\n\");\n  DEBUG_MAKE_INDENT(3);\n  GCriticalSectionLock lock(&files_lock);\n  files_list.empty();\n}\n\n//****************************************************************************\n//******************************** FCPools ***********************************\n//****************************************************************************\n\n/** This class is used to maintain a list of DataPools connected to a file.\n    It's important to have this list if we want to do something with this file\n    like to modify it or just erase. Since any modifications of the file\n    will break DataPools directly connected to it, it would be nice to have\n    a mechanism for signaling all the related DataPools to read data into\n    memory. This is precisely the purpose of this class. */\nclass FCPools\n{\nprivate:\n   GMap<GURL, GPList<DataPool> >\tmap;\t// GMap<GUTF8String, GPList<DataPool>> in fact\n   GCriticalSection\t\tmap_lock;\n\n   static FCPools\t* global_ptr;\npublic:\n   static FCPools *\tget(void);\n      // Adds the <furl, pool> pair into the list\n   void\t\tadd_pool(const GURL &furl, GP<DataPool> pool);\n      // Removes the <furl, pool> pair from the list\n   void\t\tdel_pool(const GURL &furl, GP<DataPool> pool);\n      // Looks for the list of DataPools connected to 'furl' and makes\n      // each of them load the contents of the file into memory\n   void\t\tload_file(const GURL &url);\n      // Retrieve a local URL, if available.\n   GP<DataPool> get_pool(const GURL &url, int start, int length);\n   void clean(void);\n};\n\nvoid\nFCPools::clean(void)\n{\n  GCriticalSectionLock lock(&map_lock);\n  static int count=0;\n  if(! count++)\n  {\n    bool restart = true;\n    while (restart)\n      {\n        restart = false;\n        for (GPosition posmap = map; posmap; ++posmap)\n          {\n            GPList<DataPool> *lst;\n            lst = & map[posmap];\n            if (lst->isempty())\n              {\n                map.del(posmap);\n                restart = true;\n                break;\n              }\n            for (GPosition poslst = *lst; poslst; ++poslst)\n              if ((*lst)[poslst]->get_count() < 2) \n                {\n                  lst->del(poslst);\n                  restart = true;\n                  break;\n                }\n            if (restart)\n              break;\n          }\n      }\n  }\n  --count;\n}\n\nvoid\nFCPools::add_pool(const GURL &url, GP<DataPool> pool)\n{\n  DEBUG_MSG(\"FCPools::add_pool: url='\" << url << \"' pool=\" << (void *)pool << \"\\n\");\n  DEBUG_MAKE_INDENT(3);\n  GCriticalSectionLock lock(&map_lock);\n\n   if (url.is_local_file_url())\n   {\n      GPList<DataPool> list;\n      GPosition pos(map.contains(url));\n      if (! pos)\n      {\n        map[url]=list;\n        pos=map.contains(url);\n      }\n      GPList<DataPool> &plist=map[pos];\n      if (!plist.contains(pool))\n        plist.append(pool);\n   }\n  clean();\n}\n\nGP<DataPool>\nFCPools::get_pool(const GURL &url, int start, int length)\n{\n  DEBUG_MSG(\"FCPools::get_pool: url='\" << url << \"\\n\");\n  DEBUG_MAKE_INDENT(3);\n  GP<DataPool> retval;\n  if (url.is_local_file_url())\n  {\n    GCriticalSectionLock lock(&map_lock);\n    GPosition pos(map.contains(url));\n    if (pos)\n    {\n      GPList<DataPool> &plist=map[pos];\n      for(pos=plist;pos;++pos)\n      {\n        DataPool &pool=*plist[pos];\n        if(start == pool.start && (length < 0 || (length == pool.length)))\n        {\n          retval=plist[pos];\n          break;\n        }\n      }\n    }\n    clean();\n  }\n  return retval;\n}\n\nvoid\nFCPools::del_pool(const GURL &url, GP<DataPool> pool)\n{\n  DEBUG_MSG(\"FCPools::del_pool: url='\" << url << \"' pool=\" << (void *)pool << \"\\n\");\n  DEBUG_MAKE_INDENT(3);\n  GCriticalSectionLock lock(&map_lock);\n\n  clean();\n   if (url.is_local_file_url())\n   {\n      GPosition pos;\n      if (map.contains(url, pos))\n      {\n\t GPList<DataPool> &list=map[pos];\n\t GPosition list_pos;\n\t while(list.search(pool, list_pos))\n\t    list.del(list_pos);\n\t if (list.isempty())\n\t {\n\t    map.del(pos);\n\t }\n      }\n   }\n}\n\nvoid\nFCPools::load_file(const GURL &url)\n{\n  DEBUG_MSG(\"FCPools::load_file: url='\" << url << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n  GCriticalSectionLock lock(&map_lock);\n   \n  clean();\n   if (url.is_local_file_url())\n   {\n      GPosition pos;\n      if (map.contains(url, pos))\n      {\n\t    // We make here a copy of the list because DataPool::load_file()\n\t    // will call FCPools::del_pool(), which will modify the list\n\t GPList<DataPool> list=map[pos];\n\t for(GPosition list_pos=list;list_pos;++list_pos)\n\t    list[list_pos]->load_file();\n      }\n   }\n}\n\nFCPools\t* FCPools::global_ptr;\n\ninline FCPools *\nFCPools::get(void)\n{\n   if (!global_ptr)\n     global_ptr=new FCPools();\n   return global_ptr;\n}\n\n//****************************************************************************\n//****************************** BlockList ***********************************\n//****************************************************************************\n\n// Since data can be added to the DataPool at any offset now, there may\n// be white spots, which contain illegal data. This class is to contain\n// the list of valid and invalid regions.\n// The class is basically a list of integers. Abs(integer)=size of the\n// block. If the integer is positive, data for the block is known.\n// Otherwise it's unkown.\n\nclass DataPool::BlockList\n{\n         // See comments in .cpp file.\nprivate:\n   GCriticalSection  lock;\n   GList<int>        list;\npublic:\n   BlockList() {};\n   void              clear(void);\n   void              add_range(int start, int length);\n   int               get_bytes(int start, int length) const;\n   int               get_range(int start, int length) const;\nfriend class DataPool;\n};\n\nvoid\nDataPool::BlockList::clear(void)\n{\n  DEBUG_MSG(\"DataPool::BlockList::clear()\\n\");\n  DEBUG_MAKE_INDENT(3);\n   GCriticalSectionLock lk(&lock);\n   list.empty();\n}\n\nvoid\nDataPool::BlockList::add_range(int start, int length)\n      // Adds range of known data.\n{\n  DEBUG_MSG(\"DataPool::BlockList::add_range: start=\" << start << \" length=\" << length << \"\\n\");\n  DEBUG_MAKE_INDENT(3);\n   if (start<0)\n     G_THROW( ERR_MSG(\"DataPool.neg_start\") );\n   if (length<=0)\n     G_THROW( ERR_MSG(\"DataPool.bad_length\") );\n   if (length>0)\n   {\n      GCriticalSectionLock lk(&lock);\n\n\t // Look thru existing zones, change their sign and split if\n\t // necessary.\n      GPosition pos=list;\n      int block_start=0, block_end=0;\n      while(pos && block_start<start+length)\n      {\n\t int size=list[pos];\n\t block_end=block_start+abs(size);\n\t if (size<0)\n\t   {\n\t     if (block_start<start)\n\t       {\n\t\t if (block_end>start && block_end<=start+length)\n\t\t   {\n\t\t     list[pos]=-(start-block_start);\n\t\t     list.insert_after(pos, block_end-start);\n\t\t     ++pos;\n\t\t     block_start=start;\n\t\t   } else if (block_end>start+length)\n\t\t   {\n\t\t     list[pos]=-(start-block_start);\n\t\t     list.insert_after(pos, length);\n\t\t     ++pos;\n\t\t     list.insert_after(pos, -(block_end-(start+length)));\n\t\t     ++pos;\n\t\t     block_start=start+length;\n\t\t   }\n\t       } else if (block_start>=start && block_start<start+length)\n\t       {\n\t\t if (block_end<=start+length) list[pos]=abs(size);\n\t\t else\n\t\t   {\n\t\t     list[pos]=start+length-block_start;\n\t\t     list.insert_after(pos, -(block_end-(start+length)));\n\t\t     ++pos;\n\t\t     block_start=start+length;\n\t\t   }\n\t       }\n\t   }\n\t block_start=block_end;\n\t ++pos;\n      }\n      if (block_end<start)\n      {\n\t list.append(-(start-block_end));\n\t list.append(length);\n      } else if (block_end<start+length) list.append(start+length-block_end);\n\n\t // Now merge adjacent areas with the same sign\n      pos=list;\n      while(pos)\n      {\n\t GPosition pos1=pos; ++pos1;\n\t while(pos1)\n\t   {\n\t     if ( (list[pos]<0 && list[pos1]>0) ||\n\t\t  (list[pos]>0 && list[pos1]<0) )\n\t       break;\n\t     list[pos]+=list[pos1];\n\t     GPosition this_pos=pos1;\n\t     ++pos1;\n\t     list.del(this_pos);\n\t   }\n\t pos=pos1;\n      }\n   } // if (length>0)\n}\n\nint\nDataPool::BlockList::get_bytes(int start, int length) const\n      // Returns the number of bytes of data available in the range\n      // [start, start+length[. There may be holes between data chunks\n{\n  DEBUG_MSG(\"DataPool::BlockList::get_bytes: start=\" << start << \" length=\" << length << \"\\n\");\n  DEBUG_MAKE_INDENT(3);\n\n   if (length<0)\n     G_THROW( ERR_MSG(\"DataPool.bad_length\") );\n\n   GCriticalSectionLock lk((GCriticalSection *) &lock);\n   int bytes=0;\n   int block_start=0, block_end=0;\n   for(GPosition pos=list;pos && block_start<start+length;++pos)\n   {\n      int size=list[pos];\n      block_end=block_start+abs(size);\n      if (size>0)\n\t{\n\t  if (block_start<start)\n\t    {\n\t      if (block_end>=start && block_end<start+length)\n\t\tbytes+=block_end-start;\n\t      else if (block_end>=start+length)\n\t\tbytes+=length;\n\t    }\n\t  else\n\t    {\n\t      if (block_end<=start+length)\n\t\tbytes+=block_end-block_start;\n\t      else bytes+=start+length-block_start;\n\t    }\n\t}\n      block_start=block_end;\n   }\n   return bytes;\n}\n\nint\nDataPool::BlockList::get_range(int start, int length) const\n      // Finds a range covering offset=start and returns the length\n      // of intersection of this range with [start, start+length[\n      // 0 is returned if nothing can be found\n{\n  DEBUG_MSG(\"DataPool::BlockList::get_range: start=\" << start << \" length=\" << length << \"\\n\");\n  DEBUG_MAKE_INDENT(3);\n   if (start<0)\n     G_THROW( ERR_MSG(\"DataPool.neg_start\") );\n   if (length<=0)\n      G_THROW( ERR_MSG(\"DataPool.bad_length\") );\n\n   GCriticalSectionLock lk((GCriticalSection *) &lock);\n   int block_start=0, block_end=0;\n   for(GPosition pos=list;pos && block_start<start+length;++pos)\n     {\n       int size=list[pos];\n       block_end=block_start+abs(size);\n       if (block_start<=start && block_end>start)\n\t {\n\t   if (size<0)\n\t     return -1;\n\t   else if (block_end>start+length)\n\t     return length;\n\t   else\n\t     return block_end-start;\n\t }\n       block_start=block_end;\n     }\n   return 0;\n}\n\n//****************************************************************************\n//******************************* DataPool ***********************************\n//****************************************************************************\n\nclass DataPool::Reader : public GPEnabled\n{\npublic:\n   GEvent event;\n   bool reenter_flag;\n   int  offset;\n   int  size;\n   Reader() : reenter_flag(false), offset(0), size(-1){};\n   Reader(int offset_in, int size_in=-1) :\n   reenter_flag(false), offset(offset_in), size(size_in) {};\n   virtual ~Reader() {};\n};\n\nclass DataPool::Trigger : public GPEnabled\n{\npublic:\n   GSafeFlags disabled;\n   int  start, length;\n//   void (* callback)(GP<GPEnabled> &);\n   void (* callback)(void *);\n//   GP<GPEnabled> cl_data;\n   void *cl_data;\n\n   Trigger() : start(0), length(-1), callback(0), cl_data(0) {};\n   Trigger(int xstart, int xlength,\n//   void (* xcallback)(GP<GPEnabled> &), GP<GPEnabled> xcl_data) :\n   void (* xcallback)(void *), void *xcl_data) :\n      start(xstart), length(xlength), callback(xcallback), cl_data(xcl_data) {};\n   virtual ~Trigger() {};\n};\n\nclass DataPool::Counter\n{\nprivate:\n   int               counter;\n   GCriticalSection  lock;\npublic:\n   Counter() : counter(0) {};\n   operator int(void) const;\n   void              inc(void);\n   void              dec(void);\n};\n\n#define DATAPOOL_INIT eof_flag(false),stop_flag(false), \\\n    stop_blocked_flag(false), \\\n    add_at(0),start(0),length(-1)\n\nvoid\nDataPool::init(void)\n{\n  DEBUG_MSG(\"DataPool::init(): Initializing\\n\");\n  DEBUG_MAKE_INDENT(3);\n  start=0; length=-1; add_at=0;\n  eof_flag=false;\n  stop_flag=false;\n  stop_blocked_flag=false;\n\n  active_readers=new Counter;\n  block_list=0;\n  G_TRY\n  {   \n    block_list=new BlockList;\n    data=ByteStream::create();\n  }\n  G_CATCH_ALL\n  {\n    delete block_list;\n    block_list=0;\n    delete active_readers;\n    active_readers=0;\n    G_RETHROW;\n  }\n  G_ENDCATCH;\n}\n\nDataPool::DataPool(void) : DATAPOOL_INIT {}\n\nGP<DataPool>\nDataPool::create(void)\n{\n  DEBUG_MSG(\"DataPool::DataPool()\\n\");\n  DEBUG_MAKE_INDENT(3);\n  DataPool *pool=new DataPool();\n\n  GP<DataPool> retval=pool;\n  pool->init();\n\n      // If we maintain the data ourselves, we want to interpret its\n      // IFF structure to predict its length\n  pool->add_trigger(0, 32, static_trigger_cb, pool);\n  return retval;\n}\n\nGP<DataPool> \nDataPool::create(const GP<ByteStream> &gstr)\n{\n  DEBUG_MSG(\"DataPool::create: str=\"<<(ByteStream *)gstr<<\"\\n\");\n  DEBUG_MAKE_INDENT(3);\n  DataPool *pool=new DataPool();\n  GP<DataPool> retval=pool;\n  pool->init();\n\n  // It's nice to have IFF data analyzed in this case too.\n  pool->add_trigger(0, 32, static_trigger_cb, pool);\n\n  char buffer[1024];\n  int length;\n  while((length=gstr->read(buffer, 1024)))\n    pool->add_data(buffer, length);\n  pool->set_eof();\n\n  return retval;\n}\n\nGP<DataPool>\nDataPool::create(const GP<DataPool> & pool, int start, int length)\n{\n  DEBUG_MSG(\"DataPool::DataPool: pool=\" << (void *)((DataPool *)pool) << \" start=\" << start << \" length= \" << length << \"\\n\");\n  DEBUG_MAKE_INDENT(3);\n\n  DataPool *xpool=new DataPool();\n  GP<DataPool> retval=xpool;\n  xpool->init();\n  xpool->connect(pool, start, length);\n  return retval;\n}\n\nGP<DataPool>\nDataPool::create(const GURL &furl, int start, int length)\n{\n  DEBUG_MSG(\"DataPool::DataPool: furl='\" << furl << \"' start=\" << start << \" length= \" << length << \"\\n\");\n  DEBUG_MAKE_INDENT(3);\n\n  GP<DataPool> retval=FCPools::get()->get_pool(furl,start,length);\n  if(! retval)\n  {\n    DataPool *pool=new DataPool();\n    retval=pool;\n    pool->init();\n    pool->connect(furl, start, length);\n  }\n  return retval;\n}\n\nvoid\nDataPool::clear_stream(const bool release)\n{\n  DEBUG_MSG(\"DataPool::clear_stream()\\n\");\n  DEBUG_MAKE_INDENT(3);\n  if(fstream)\n  {\n    GCriticalSectionLock lock1(&class_stream_lock);\n    GP<OpenFiles_File> f=fstream;\n    if(f)\n    {\n      GCriticalSectionLock lock2(&(f->stream_lock));\n      fstream=0;\n      if(release)\n        OpenFiles::get()->stream_released(f->stream, this);\n    }\n  }\n}\n\nDataPool::~DataPool(void)\n{\n  DEBUG_MSG(\"DataPool::~DataPool()\\n\");\n  DEBUG_MAKE_INDENT(3);\n\n  clear_stream(true);\n  if (furl.is_local_file_url())\n    if (this->get_count() > 1)\n      FCPools::get()->del_pool(furl, this);\n  \n  GP<DataPool> pool = this->pool;\n  {\n\t // Wait until the static_trigger_cb() exits\n      GCriticalSectionLock lock(&trigger_lock);\n      if (pool)\n        pool->del_trigger(static_trigger_cb, this);\n      del_trigger(static_trigger_cb, this);\n  }\n  if (pool)\n  {\n      GCriticalSectionLock lock(&triggers_lock);\n      for(GPosition pos=triggers_list;pos;++pos)\n      {\n\t GP<Trigger> trigger=triggers_list[pos];\n\t pool->del_trigger(trigger->callback, trigger->cl_data);\n      }\n  }\n  delete block_list;\n  delete active_readers;\n}\n\nvoid\nDataPool::connect(const GP<DataPool> & pool_in, int start_in, int length_in)\n{\n   DEBUG_MSG(\"DataPool::connect(): connecting to another DataPool\\n\");\n   DEBUG_MAKE_INDENT(3);\n   \n   if (pool) G_THROW( ERR_MSG(\"DataPool.connected1\") );\n   if (furl.is_local_file_url()) G_THROW( ERR_MSG(\"DataPool.connected2\") );\n   if (start_in<0) G_THROW( ERR_MSG(\"DataPool.neg_start\") );\n\n   pool=pool_in;\n   start=start_in;\n   length=length_in;\n\n      // The following will work for length<0 too\n   if (pool->has_data(start, length))\n     eof_flag=true;\n   else\n     pool->add_trigger(start, length, static_trigger_cb, this);\n\n   data=0;\n\n   wake_up_all_readers();\n   \n      // Pass registered trigger callbacks to the DataPool\n   GCriticalSectionLock lock(&triggers_lock);\n   for(GPosition pos=triggers_list;pos;++pos)\n   {\n      GP<Trigger> t=triggers_list[pos];\n      int tlength=t->length;\n      if (tlength<0 && length>0)\n        tlength=length-t->start;\n      pool->add_trigger(start+t->start, tlength, t->callback, t->cl_data);\n   }\n}\n\nvoid\nDataPool::connect(const GURL &furl_in, int start_in, int length_in)\n{\n   DEBUG_MSG(\"DataPool::connect(): connecting to a file\\n\");\n   DEBUG_MAKE_INDENT(3);\n   \n   if (pool)\n     G_THROW( ERR_MSG(\"DataPool.connected1\") );\n   if (furl.is_local_file_url())\n     G_THROW( ERR_MSG(\"DataPool.connected2\") );\n   if (start_in<0)\n     G_THROW( ERR_MSG(\"DataPool.neg_start\") );\n\n\n   if (furl_in.name() == \"-\")\n   {\n      DEBUG_MSG(\"This is stdin => just read the data...\\n\");\n      DEBUG_MAKE_INDENT(3);\n      char buffer[1024];\n      int length;\n      GP<ByteStream> gstr=ByteStream::create(furl_in, \"rb\");\n      ByteStream &str=*gstr;\n      while((length=str.read(buffer, 1024)))\n\t add_data(buffer, length);\n      set_eof();\n   } else if(furl_in.is_local_file_url())\n   {\n\t // Open the stream (just in this function) too see if\n\t // the file is accessible. In future we will be using 'OpenFiles'\n\t // to request and release streams\n      GP<ByteStream> str=ByteStream::create(furl_in,\"rb\");\n      str->seek(0, SEEK_END);\n      int file_size=str->tell();\n\n      furl=furl_in;\n      start=start_in;\n      length=length_in;\n      if (start>=file_size)\n        length=0;\n      else if (length<0 || start+length>=file_size)\n        length=file_size-start;\n      \n      eof_flag=true;\n      data=0;\n      \n      FCPools::get()->add_pool(furl, this);\n\n      wake_up_all_readers();\n   \n\t // Call every trigger callback\n      GCriticalSectionLock lock(&triggers_lock);\n      for(GPosition pos=triggers_list;pos;++pos)\n      {\n\t GP<Trigger> t=triggers_list[pos];\n\t call_callback(t->callback, t->cl_data);\n      }\n      triggers_list.empty();\n   }\n}\n\nint\nDataPool::get_length(void) const\n{\n      // Not connected and length has been guessed\n      // Or connected to a file\n      // Or connected to a pool, but length was preset\n   int retval=(-1);\n   if (length>=0) \n   {\n     retval=length;\n   }else if (pool)\n   {\n      int plength=pool->get_length();\n      if (plength>=0)\n        retval=plength-start;\n   }\n   return retval;\n}\n\nint\nDataPool::get_size(int dstart, int dlength) const\n{\n   if (dlength<0 && length>0)\n   {\n      dlength=length-dstart;\n      if (dlength<0) return 0;\n   }\n   \n   GP<DataPool> pool = this->pool;\n   if (pool) \n     return pool->get_size(start+dstart, dlength);\n   else if (furl.is_local_file_url())\n   {\n      if (start+dstart+dlength>length) return length-(start+dstart);\n      else return dlength;\n   } else\n   {\n      if (dlength<0)\n      {\n\t GCriticalSectionLock lock((GCriticalSection *) &data_lock);\n\t dlength=data->size()-dstart;\n      }\n      return (dlength<0)?0:(block_list->get_bytes(dstart, dlength));\n   }\n}\n\nvoid\nDataPool::add_data(const void * buffer, int size)\n      // This function adds data sequentially at 'add_at' position\n{\n   DEBUG_MSG(\"DataPool::add_data(): adding \" << size << \" bytes of data...\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   add_data(buffer, add_at, size);\n   add_at+=size;\n}\n\nvoid\nDataPool::add_data(const void * buffer, int offset, int size)\n{\n   DEBUG_MSG(\"DataPool::add_data(): adding \" << size << \" bytes at pos=\" <<\n\t     offset << \"...\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   if (furl.is_local_file_url() || pool)\n      G_THROW( ERR_MSG(\"DataPool.add_data\") );\n   \n      // Add data to the data storage\n   {\n      GCriticalSectionLock lock(&data_lock);\n      if (offset>data->size())\n      {\n\t char ch=0;\n\t data->seek(0, SEEK_END);\n\t for(int i=data->size();i<offset;i++)\n\t    data->write(&ch, 1);\n      } else\n      {\n\t data->seek(offset, SEEK_SET);\n\t data->writall(buffer, size);\n      }\n   }\n\n   added_data(offset, size);\n}\n\nvoid\nDataPool::added_data(const int offset, const int size)\n{\n     // Modify map of blocks\n  block_list->add_range(offset, size);\n   \n     // Wake up all threads, which may be waiting for this data\n  {\n    GCriticalSectionLock lock(&readers_lock);\n    for(GPosition pos=readers_list;pos;++pos)\n    {\n      GP<Reader> reader=readers_list[pos];\n      if (block_list->get_bytes(reader->offset, 1))\n      {\n        DEBUG_MSG(\"waking up reader: offset=\" << reader->offset <<\n          \", size=\" << reader->size << \"\\n\");\n        DEBUG_MAKE_INDENT(3);\n        reader->event.set();\n      }\n    }\n  }\n\n    // And call triggers\n  check_triggers();\n\n      // Do not undo the following two lines. The reason why we need them\n      // here is the connected DataPools, which use 'length' (more exactly\n      // has_data()) to see if they have all data required. So, right after\n      // all data has been added to the master DataPool, but before EOF\n      // is set, the master and slave DataPools disagree regarding if\n      // all data is there or not. These two lines solve the problem\n  GCriticalSectionLock lock(&data_lock);\n  if (length>=0 && data->size()>=length)\n    set_eof();\n}\n\nbool\nDataPool::has_data(int dstart, int dlength)\n{\n   if (dlength<0 && length>0)\n     dlength=length-dstart;\n   return (pool?(pool->has_data(start+dstart, dlength))\n     :((furl.is_local_file_url())?(start+dstart+dlength<=length)\n       :((dlength<0)?is_eof()\n         :(block_list->get_bytes(dstart, dlength)==dlength))));\n}\n\nint\nDataPool::get_data(void * buffer, int offset, int sz)\n{\n   return get_data(buffer, offset, sz, 0);\n}\n\nclass DataPool::Incrementor\n{\nprivate:\n   Counter      & counter;\npublic:\n   Incrementor(Counter & xcounter) : counter(xcounter) {counter.inc();}\n   ~Incrementor() {counter.dec();}\n};\n\nint\nDataPool::get_data(void * buffer, int offset, int sz, int level)\n{\n   DEBUG_MSG(\"DataPool::get_data()\\n\");\n   DEBUG_MAKE_INDENT(3);\n   Incrementor inc(*active_readers);\n   \n   if (stop_flag)\n     G_THROW( DataPool::Stop );\n   if (stop_blocked_flag && !is_eof() &&\n       !has_data(offset, sz))\n     G_THROW( DataPool::Stop );\n   \n   if (sz < 0)\n     G_THROW( ERR_MSG(\"DataPool.bad_size\") );\n   \n   if (! sz)\n     return 0;\n\n   GP<DataPool> pool = this->pool;\n   if (pool)\n     {\n       DEBUG_MSG(\"DataPool::get_data(): from pool\\n\");\n       DEBUG_MAKE_INDENT(3);\n       int retval=0;\n       if (length>0 && offset+sz>length)\n\t sz=length-offset;\n       if (sz<0)\n\t sz=0;\n       for(;;)\n\t {\n\t   // Ask the underlying (master) DataPool for data. Note, that\n\t   // master DataPool may throw the \"DATA_POOL_REENTER\" exception\n\t   // demanding all readers to restart. This happens when\n\t   // a DataPool in the chain of DataPools stops. All readers\n\t   // should return to the most upper level and then reenter the\n\t   // DataPools hierarchy. Some of them will be stopped by\n\t   // DataPool::Stop exception.\n\t   G_TRY\n\t     {\n\t       if(stop_flag\n\t\t  || (stop_blocked_flag && !is_eof() && !has_data(offset, sz)))\n\t\t G_THROW( DataPool::Stop );\n\t       retval=pool->get_data(buffer, start+offset, sz, level+1);\n\t     }\n\t   G_CATCH(exc)\n\t   {\n\t     pool->clear_stream(true);\n\t     if ((exc.get_cause() != GUTF8String(ERR_MSG(\"DataPool.reenter\")))\n\t\t || level)\n\t       G_RETHROW;\n\t   } G_ENDCATCH;\n\t   pool->clear_stream(true);\n\t   return retval;\n\t }\n     }\n   else if (furl.is_local_file_url())\n     {\n       DEBUG_MSG(\"DataPool::get_data(): from file\\n\");\n       DEBUG_MAKE_INDENT(3);\n       if (length>0 && offset+sz>length)\n\t sz=length-offset;\n       if (sz<0)\n         sz=0;\n       \n       GP<OpenFiles_File> f=fstream;\n       if (!f)\n         {\n           GCriticalSectionLock lock(&class_stream_lock);\n           f=fstream;\n           if(!f)\n             {\n               fstream=f=OpenFiles::get()->request_stream(furl, this);\n             }\n         }\n       GCriticalSectionLock lock2(&(f->stream_lock));\n       f->stream->seek(start+offset, SEEK_SET); \n       return f->stream->readall(buffer, sz);\n     } \n   else\n     {\n       DEBUG_MSG(\"DataPool::get_data(): direct\\n\");\n       DEBUG_MAKE_INDENT(3);\n       // We're not connected to anybody => handle the data\n       int size=block_list->get_range(offset, sz);\n       if (size>0)\n         {\n           // Hooray! Some data is there\n           GCriticalSectionLock lock(&data_lock);\n           data->seek(offset, SEEK_SET);\n           return data->readall(buffer, size);\n         }\n       \n       // No data available.\n       \n       // If there is no data and nothing else is expected, we can do\n       // two things: throw ByteStream::EndOfFile exception or return ZERO bytes.\n       // The exception is for the cases when the data flow has been\n       // terminated in the middle. ZERO bytes is for regular read() beyond\n       // the boundaries of legal data. The problem is to distinguish\n       // these two cases. We do it here with the help of analysis of the\n       // IFF structure of the data (which sets the 'length' variable).\n       // If we attempt to read beyond the [0, length[, ZERO bytes will be\n       // returned. Otherwise an ByteStream::EndOfFile exception will be thrown.\n       if (eof_flag)\n         {\n           if (length>0 && offset<length) \n             {\n               G_THROW( ByteStream::EndOfFile );\n             }\n           else \n             {\n               return 0;\n             }\n         } \n       // Some data is still expected => add this reader to the\n       // list of readers and call virtual wait_for_data()\n       DEBUG_MSG(\"DataPool::get_data(): There is no data in the pool.\\n\");\n       DEBUG_MSG(\"offset=\" << offset << \", size=\" << sz <<\n                 \", data_size=\" << data->size() << \"\\n\");\n       GP<Reader> reader=new Reader(offset, sz);\n       G_TRY \n         {\n           {\n             GCriticalSectionLock slock(&readers_lock);\n             readers_list.append(reader);\n           }\n           wait_for_data(reader);\n         } \n       G_CATCH_ALL \n         {\n           {\n             GCriticalSectionLock slock(&readers_lock);\n             GPosition pos;\n             if (readers_list.search(reader, pos)) readers_list.del(pos);\n           }\n           G_RETHROW;\n         } \n       G_ENDCATCH;\n       \n       {\n         GCriticalSectionLock slock(&readers_lock);\n         GPosition pos;\n         if (readers_list.search(reader, pos)) readers_list.del(pos);\n       }\n       \n       // This call to get_data() should return immediately as there MUST\n       // be data in the buffer after wait_for_data(reader) returns\n       // or eof_flag should be TRUE\n       return get_data(buffer, reader->offset, reader->size, level);\n     }\n   return 0;\n}\n\nvoid\nDataPool::wait_for_data(const GP<Reader> & reader)\n      // This function may NOT return until there is some data for the\n      // given reader in the internal buffer\n{\n   DEBUG_MSG(\"DataPool::wait_for_data(): waiting for data at offset=\" << reader->offset <<\n\t     \", length=\" << reader->size << \"\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n#if THREADMODEL==NOTHREADS\n   G_THROW( ERR_MSG(\"DataPool.no_threadless\") );\n#else\n   for(;;)\n   {\n      if (stop_flag)\n        G_THROW( DataPool::Stop );\n      if (reader->reenter_flag)\n        G_THROW( ERR_MSG(\"DataPool.reenter\") );\n      if (eof_flag || block_list->get_bytes(reader->offset, 1))\n        return;\n      if (pool || furl.is_local_file_url())\n        return;\n\n      if (stop_blocked_flag)\n        G_THROW( DataPool::Stop );\n\n      DEBUG_MSG(\"calling event.wait()...\\n\");\n      reader->event.wait();\n   }\n#endif\n   \n   DEBUG_MSG(\"Got some data to read\\n\");\n}\n\nvoid\nDataPool::wake_up_all_readers(void)\n{\n   DEBUG_MSG(\"DataPool::wake_up_all_readers(): waking up all readers\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   GCriticalSectionLock lock(&readers_lock);\n   for(GPosition pos=readers_list;pos;++pos)\n      readers_list[pos]->event.set();\n}\n\nvoid\nDataPool::set_eof(void)\n      // Has no effect on connected DataPools\n{\n   if (!furl.is_local_file_url() && !pool)\n   {\n      eof_flag=true;\n      \n\t // Can we set the length now?\n      if (length<0)\n      {\n\t GCriticalSectionLock lock(&data_lock);\n\t length=data->size();\n      }\n\n\t // Wake up all readers to let them rescan the flags\n      wake_up_all_readers();\n   \n\t // Activate all trigger callbacks with negative threshold\n      check_triggers();\n   }\n}\n\nvoid\nDataPool::stop(bool only_blocked)\n{\n   DEBUG_MSG(\"DataPool::stop(): Stopping this and dependent DataPools, only_blocked=\"\n\t     << only_blocked << \"\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   if (only_blocked) stop_blocked_flag=true;\n   else stop_flag=true;\n   \n\n   wake_up_all_readers();\n\n      // Now let all readers, which already go thru to the master DataPool,\n      // come back and reenter. While reentering some of them will go\n      // thru this DataPool again and will be stopped (DataPool::Stop exception)\n      // Others (which entered the master DataPool thru other slave DataPools)\n      // will simply continue waiting for their data.\n   GP<DataPool> pool = this->pool;\n   if (pool)\n   {\n\t // This loop is necessary because there may be another thread, which\n\t // is going down thru the DataPool chain and did not reach the\n\t // lowest \"master\" DataPool yet. Since it didn't reach it yet,\n\t // the \"pool->restart_readers()\" will not restart it. So we're going\n\t // to continue issuing this command until we get rid of all\n\t // \"active_readers\"\n      while(*active_readers)\n      {\n#if (THREADMODEL==COTHREADS) || (THREADMODEL==MACTHREADS)\n\t GThread::yield();\n#endif\n\t pool->restart_readers();\n      }\n   }\n}\n\nvoid\nDataPool::restart_readers(void)\n{\n   DEBUG_MSG(\"DataPool::restart_readers(): telling all readers to reenter\\n\");\n   DEBUG_MAKE_INDENT(3);\n   \n   GCriticalSectionLock slock(&readers_lock);\n   for(GPosition pos=readers_list;pos;++pos)\n   {\n      GP<Reader> reader=readers_list[pos];\n      reader->reenter_flag=true;\n      reader->event.set();\n   }\n      \n   if (pool)\n     pool->restart_readers();\n}\n\nvoid\nDataPool::load_file(void)\n{\n   DEBUG_MSG(\"DataPool::load_file() called\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   if (pool)\n   {\n      DEBUG_MSG(\"passing the request down.\\n\");\n      pool->load_file();\n   } else if (furl.is_local_file_url())\n   {\n      DEBUG_MSG(\"loading the data from \\\"\"<<(const char *)furl<<\"\\\".\\n\");\n\n      GCriticalSectionLock lock1(&class_stream_lock);\n      GP<OpenFiles_File> f=fstream;\n      if (!f)\n      {\n        fstream=f=OpenFiles::get()->request_stream(furl, this);\n      }\n      {  // Scope to de-allocate lock2 before stream gets released\n         GCriticalSectionLock lock2(&(f->stream_lock));\n\n         data=ByteStream::create();\n         block_list->clear();\n         FCPools::get()->del_pool(furl, this);\n         furl=GURL();\n\n         const GP<ByteStream> gbs = f->stream;\n         gbs->seek(0, SEEK_SET);\n         \n         char buffer[1024];\n         int length;\n         while((length = f->stream->read(buffer, 1024)))\n           add_data(buffer, length);\n         set_eof();\n         \n         OpenFiles::get()->stream_released(f->stream, this);\n      }\n      fstream=0;\n   } else DEBUG_MSG(\"Not connected\\n\");\n}\n\nvoid\nDataPool::load_file(const GURL &url )\n{\n   FCPools::get()->load_file(url);\n}\n\nvoid\nDataPool::check_triggers(void)\n      // This function is for not connected DataPools only\n{\n  DEBUG_MSG(\"DataPool::check_triggers(): calling activated trigger callbacks.\\n\");\n  DEBUG_MAKE_INDENT(3);\n\n  if (!pool && !furl.is_local_file_url())\n    while(true)\n      {\n\tGP<Trigger> trigger;\n\n\t// First find a candidate (trigger, which needs to be called)\n\t// Don't remove it from the list yet. del_trigger() should\n\t// be able to find it if necessary and disable.\n\t{\n\t  GCriticalSectionLock list_lock(&triggers_lock);\n\t  for(GPosition pos=triggers_list;pos;++pos)\n\t    {\n\t      GP<Trigger> t=triggers_list[pos];\n\t      if (is_eof()\n\t\t  || (t->length>=0 &&\n\t\t      block_list->get_bytes(t->start, t->length)==t->length))\n\t\t{\n\t\t  trigger=t;\n\t\t  break;\n\t\t}\n\t    }\n\t}\n\n\tif (trigger)\n\t  {\n\t    // Now check that the trigger is not disabled\n\t    // and lock the trigger->disabled lock for the duration\n\t    // of the trigger. This will block the del_trigger() and\n\t    // will postpone client's destruction (usually following\n\t    // the call to del_trigger())\n\t    {\n\t      GMonitorLock lock(&trigger->disabled);\n\t      if (!trigger->disabled)\n\t\tcall_callback(trigger->callback, trigger->cl_data);\n\t    }\n\n\t    // Finally - remove the trigger from the list.\n\t    GCriticalSectionLock list_lock(&triggers_lock);\n\t    for(GPosition pos=triggers_list;pos;++pos)\n\t      if (triggers_list[pos]==trigger)\n\t\t{\n\t\t  triggers_list.del(pos);\n\t\t  break;\n\t\t}\n\t  } else break;\n      }\n}\n\nvoid\nDataPool::add_trigger(int thresh, void (* callback)(void *), void * cl_data)\n{\n  if (thresh>=0)\n    add_trigger(0, thresh+1, callback, cl_data);\n  else\n    add_trigger(0, -1, callback, cl_data);\n}\n\nvoid\nDataPool::add_trigger(int tstart, int tlength,\n\t\t      void (* callback)(void *), void * cl_data)\n{\n   DEBUG_MSG(\"DataPool::add_trigger(): start=\" << tstart <<\n\t     \", length=\" << tlength << \", func=\" << (void *) callback << \"\\n\");\n   DEBUG_MAKE_INDENT(3);\n   \n   if (callback)\n   {\n      if (is_eof())\n      {\n        call_callback(callback, cl_data);\n      }else\n      {\n         GP<DataPool> pool = this->pool;\n\t if (pool)\n\t {\n\t       // We're connected to a DataPool\n\t       // Just pass the triggers down remembering it in the list\n\t    if (tlength<0 && length>0) tlength=length-tstart;\n\t    GP<Trigger> trigger=new Trigger(tstart, tlength, callback, cl_data);\n\t    pool->add_trigger(start+tstart, tlength, callback, cl_data);\n\t    GCriticalSectionLock lock(&triggers_lock);\n\t    triggers_list.append(trigger);\n\t } \n         else if (!furl.is_local_file_url())\n\t {\n\t       // We're not connected to anything and maintain our own data\n\t    if (tlength>=0 && block_list->get_bytes(tstart, tlength)==tlength)\n\t       call_callback(callback, cl_data);\n\t    else\n\t    {\n              GP<Trigger> trigger=new Trigger(tstart, tlength, callback, cl_data);\n              GCriticalSectionLock lock(&triggers_lock);\n              triggers_list.append(trigger);\n\t    }\n\t }\n      }\n   }\n}\n\nvoid\nDataPool::del_trigger(void (* callback)(void *), void * cl_data)\n{\n   DEBUG_MSG(\"DataPool::del_trigger(): func=\" << (void *) callback << \"\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   for(;;)\n   {\n      GP<Trigger> trigger;\n      {\n\t GCriticalSectionLock lock(&triggers_lock);\n\t for(GPosition pos=triggers_list;pos;)\n\t {\n\t    GP<Trigger> t=triggers_list[pos];\n\t    if (t->callback==callback && t->cl_data==cl_data)\n\t    {\n\t       trigger=t;\n\t       GPosition this_pos=pos;\n\t       ++pos;\n\t       triggers_list.del(this_pos);\n\t       break;\n\t    } else\n              ++pos;\n\t }\n      }\n\n\t // Above we removed the trigger from the list and unlocked the list\n\t // Now we will disable it and will wait if necessary (if the\n\t // trigger is currently being processed by check_triggers())\n\t // check_triggers() locks the trigger for the duration of the\n\t // trigger callback. Thus we will wait for the trigger callback\n\t // to finish and avoid client's destruction.\n      if (trigger)\n        trigger->disabled=1;\n      else\n        break;\n   }\n\n   GP<DataPool> pool = this->pool;\n   if (pool)\n     pool->del_trigger(callback, cl_data);\n}\n\nvoid\n// DataPool::static_trigger_cb(GP<GPEnabled> &cl_data)\nDataPool::static_trigger_cb(void *cl_data)\n{\n//  GP<DataPool> d=(DataPool *)(GPEnabled *)cl_data;\n  GP<DataPool> d=(DataPool *)cl_data;\n  d->trigger_cb();\n}\n\nvoid\nDataPool::trigger_cb(void)\n      // This function may be triggered by the DataPool, which we're\n      // connected to, or by ourselves, if we're connected to nothing\n{\n      // Don't want to be destroyed while I'm here. Can't use GP<> life saver\n      // because it may be called from the constructor\n   GCriticalSectionLock lock(&trigger_lock);\n   \n   DEBUG_MSG(\"DataPool::trigger_cb() called\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   GP<DataPool> pool = this->pool;\n   if (pool)\n   {\n      // Connected to a pool\n      // We may be here when either EOF is set on the master DataPool\n      // Or when it may have learnt its length (from IFF or whatever)\n      if (pool->is_eof() || pool->has_data(start, length)) eof_flag=true;\n   } else if (!furl.is_local_file_url())\n   {\n\t    // Not connected to anything => Try to guess the length\n      if (length<0) analyze_iff();\n      \n\t    // Failed to analyze? Check, maybe it's EOF already\n      if (length<0 && is_eof())\n      {\n\t       GCriticalSectionLock lock(&data_lock);\n\t       length=data->size();\n      }\n   }\n}\n\nvoid\nDataPool::analyze_iff(void)\n      // In order to display decode progress properly, we need to know\n      // the size of the data. It's trivial to figure it out if is_eof()\n      // is true. Otherwise we need to make a prediction. Luckily all\n      // DjVuFiles have IFF structure, which makes it possible to do it.\n      // If due to some reason we fail, the length will remain -1.\n{\n   DEBUG_MSG(\"DataPool::analyze_iff(): Trying to decode IFF structure of \" << furl << \".\\n\");\n   DEBUG_MSG(\"in order to predict the DataPool's size\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   GP<ByteStream> str=get_stream();\n   \n   GP<IFFByteStream> giff=IFFByteStream::create(str);\n   IFFByteStream &iff=*giff;\n   GUTF8String chkid;\n   int size;\n   if ((size=iff.get_chunk(chkid)) && size>=0)\n   {\n      length=size+iff.tell()-4;\n      DEBUG_MSG(\"Got size=\" << size << \", length=\" << length << \"\\n\");\n   }\n}\n\n\n\n\n\n//****************************************************************************\n//****************************** PoolByteStream ******************************\n//****************************************************************************\n\n// This is an internal ByteStream receiving data from the associated DataPool.\n// It's just a sequential interface, nothing more. All the job for data\n// retrieval, waiting and thread synchronization is done by DataPool\n\nclass PoolByteStream : public ByteStream\n{\npublic:\n   PoolByteStream(GP<DataPool> data_pool);\n   virtual ~PoolByteStream() {};\n\n   virtual size_t read(void *buffer, size_t size);\n   virtual size_t write(const void *buffer, size_t size);\n   virtual long tell(void) const ;\n   virtual int seek(long offset, int whence = SEEK_SET, bool nothrow=false);\nprivate:\n      // Don't make data_pool GP<>. The problem is that DataPool creates\n      // and soon destroys this ByteStream from the constructor. Since\n      // there are no other pointers to the DataPool created yet, it becomes\n      // destroyed immediately :(\n   DataPool\t\t* data_pool;\n   GP<DataPool>\t\tdata_pool_lock;\n   long\t\t\tposition;\n   \n   char\t\t\tbuffer[512];\n   size_t\t\tbuffer_size;\n   size_t\t\tbuffer_pos;\n\n      // Cancel C++ default stuff\n   PoolByteStream & operator=(const PoolByteStream &);\n};\n\ninline\nPoolByteStream::PoolByteStream(GP<DataPool> xdata_pool) :\n   data_pool(xdata_pool), position(0), buffer_size(0), buffer_pos(0)\n{\n   if (!data_pool) \n       G_THROW( ERR_MSG(\"DataPool.zero_DataPool\") );\n\n      // Secure the DataPool if possible. If we're called from DataPool\n      // constructor (get_count()==0) there is no need to secure at all.\n   if (data_pool->get_count()) data_pool_lock=data_pool;\n}\n\nsize_t\nPoolByteStream::read(void *data, size_t size)\n{\n  if (buffer_pos >= buffer_size) {\n    if (size >= sizeof(buffer)) {\n      // Direct read\n      size = data_pool->get_data(data, position, size);\n      position += size;\n      return size;\n    } else {\n      // Refill buffer\n      buffer_size = data_pool->get_data(buffer, position, sizeof(buffer));\n      buffer_pos=0;\n    }\n  }\n  if (buffer_pos + size >= buffer_size)\n    size = buffer_size - buffer_pos;\n  memcpy(data, buffer+buffer_pos, size);\n  buffer_pos += size;\n  position += size;\n  return size;\n}\n\nsize_t\nPoolByteStream::write(const void *buffer, size_t size)\n{\n   G_THROW( ERR_MSG(\"not_implemented_n\") \"\\tPoolByteStream::write()\");   //  PoolByteStream::write() is not implemented.\n   return 0;\t// For compiler not to bark\n}\n\nlong\nPoolByteStream::tell(void) const\n{\n   return position;\n}\n\nint\nPoolByteStream::seek(long offset, int whence, bool nothrow)\n{\n  int retval=(-1);\n  switch(whence)\n  {\n    case SEEK_CUR:\n      offset+=position;\n      // fallthrough;\n    case SEEK_SET:\n      if(offset<position)\n      {\n        if((int)(offset+buffer_pos)>=(int)position)\n        {\n          buffer_pos-=position-offset;\n        }else\n        {\n          buffer_size=0;\n        }\n        position=offset;\n      }else if(offset>position)\n      {\n        buffer_pos+=(offset-position)-1;\n        position=offset-1;\n        unsigned char c;\n        if(read(&c,1)<1)\n        {\n          G_THROW( ByteStream::EndOfFile );\n        }\n      }\n      retval=0;\n      break;\n    case SEEK_END:\n      if(! nothrow)\n        G_THROW( ERR_MSG(\"DataPool.seek_backward\") );\n      break;\n   }\n   return retval;\n}\n\nvoid\nDataPool::close_all(void)\n{\n  OpenFiles::get()->close_all();\n  FCPools::get()->clean();\n}\n\n\nGP<ByteStream>\nDataPool::get_stream(void)\n{\n  return new PoolByteStream(this);\n}\n\n\ninline\nDataPool::Counter::operator int(void) const\n{\n   GCriticalSectionLock lk((GCriticalSection *) &lock);\n   int cnt=counter;\n   return cnt;\n}\n\ninline void\nDataPool::Counter::inc(void)\n{\n   GCriticalSectionLock lk(&lock);\n   counter++;\n}\n\ninline void\nDataPool::Counter::dec(void)\n{\n   GCriticalSectionLock lk(&lock);\n   counter--;\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DataPool.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _DATAPOOL_H\n#define _DATAPOOL_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n#include \"GThreads.h\"\n#include \"GString.h\"\n#include \"GURL.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass ByteStream;\n\n/** @name DataPool.h\n    Files #\"DataPool.h\"# and #\"DataPool.cpp\"# implement classes \\Ref{DataPool}\n    and \\Ref{DataRange} used by DjVu decoder to access data.\n\n    The main goal of class \\Ref{DataPool} is to provide concurrent access\n    to the same data from many threads with a possibility to add data\n    from yet another thread. It is especially important in the case of the\n    Netscape plugin when data is not immediately available, but decoding\n    should be started as soon as possible. In this situation it is vital\n    to provide transparent access to the data from many threads possibly\n    blocking readers that try to access information that has not been\n    received yet.\n\n    When the data is local though, it can be accessed directly using\n    standard IO mechanism. To provide a uniform interface for decoding\n    routines, \\Ref{DataPool} supports file mode as well.\n\n    @memo Thread safe data storage\n    @author Andrei Erofeev <eaf@geocities.com>\n*/\n\n//@{\n\n/** Thread safe data storage.\n    The purpose of #DataPool# is to provide a uniform interface for\n    accessing data from decoding routines running in a multi-threaded\n    environment. Depending on the mode of operation it may contain the\n    actual data, may be connected to another #DataPool# or may be mapped\n    to a file. Regardless of the mode, the class returns data in a\n    thread-safe way, blocking reading threads if there is no data of\n    interest available. This blocking is especially useful in the\n    networking environment (plugin) when there is a running decoding thread,\n    which wants to start decoding as soon as there is just one byte available\n    blocking if necessary.\n\n    Access to data in a #DataPool# may be direct (Using \\Ref{get_data}()\n    function) or sequential (See \\Ref{get_stream}() function).\n\n    If the #DataPool# is not connected to anything, that is it contains\n    some real data, this data can be added to it by means of two\n    \\Ref{add_data}() functions. One of them adds data sequentially maintaining\n    the offset of the last block of data added by it. The other can store\n    data anywhere. Thus it's important to realize, that there may be \"white\n    spots\" in the data storage.\n\n    There is also a way to test if data is available for some given data\n    range (See \\Ref{has_data}()). In addition to this mechanism, there are\n    so-called {\\em trigger callbacks}, which are called, when there is\n    all data available for a given data range.\n\n    Let us consider all modes of operation in details:\n\n    \\begin{enumerate}\n       \\item {\\bf Not connected #DataPool#}. In this mode the #DataPool#\n             contains some real data. As mentioned above, it may be added  \n             by means of two functions \\Ref{add_data}() operating independent\n\t     of each other and allowing to add data sequentially and\n\t     directly to any place of data storage. It's important to call\n\t     function \\Ref{set_eof}() after all data has been added.\n\n\t     Functions like \\Ref{get_data}() or \\Ref{get_stream}() can\n\t     be used to obtain direct or sequential access to the data. As\n\t     long as \\Ref{is_eof}() is #FALSE#, #DataPool# will block every\n\t     reader, which is trying to read unavailable data until it\n\t     really becomes available. But as soon as \\Ref{is_eof}() is\n\t     #TRUE#, any attempt to read non-existing data will read #0# bytes.\n\n\t     Taking into account the fact, that #DataPool# was designed to\n\t     store DjVu files, which are in IFF formats, it becomes possible\n\t     to predict the size of the #DataPool# as soon as the first\n\t     #32# bytes have been added. This is invaluable for estimating\n\t     download progress. See function \\Ref{get_length}() for details.\n\t     If this estimate fails (which means, that stored data is not\n\t     in IFF format), \\Ref{get_length}() returns #-1#.\n\n\t     Triggers may be added and removed by means of \\Ref{add_trigger}()\n\t     and \\Ref{del_trigger}() functions. \\Ref{add_trigger}() takes\n\t     a data range. As soon as all data in that data range is\n\t     available, the trigger callback will be called.\n\n\t     All trigger callbacks will be called when #EOF# condition\n\t     has been set.\n\n       \\item {\\bf #DataPool# connected to another #DataPool#}. In this\n             {\\em slave} mode you can map a given #DataPool# to any offsets\n\t     range inside another #DataPool#. You can connect the slave\n\t     #DataPool# even if there is no data in the master #DataPool#.\n\t     Any \\Ref{get_data}() request will be forwarded to the master\n\t     #DataPool#, and it will be responsible for blocking readers\n\t     trying to access unavailable data.\n\n\t     The usage of \\Ref{add_data}() functions is prohibited for\n\t     connected #DataPool#s.\n\n\t     The offsets range used to map a slave #DataPool# can be fully\n\t     specified (both start offset and length are positive numbers)\n\t     or partially specified (the length is negative). In this mode\n\t     the slave #DataPool# is assumed to extend up to the end\n\t     of the master #DataPool#.\n\n\t     Triggers may be used with slave #DataPool#s as well as with\n\t     the master ones.\n\n\t     Calling \\Ref{stop}() function of a slave will stop only the slave\n\t     (and any other slave connected to it), but not the master.\n\n\t     \\Ref{set_eof}() function is meaningless for slaves. They obtain\n\t     the #ByteStream::EndOfFile# status from their master.\n\n\t     Depending on the offsets range passed to the constructor,\n\t     \\Ref{get_length}() returns different values. If the length\n\t     passed to the constructor was positive, then it is returned\n\t     by \\Ref{get_length}() all the time. Otherwise the value returned\n\t     is either #-1# if master's length is still unknown (it didn't\n\t     manage to parse IFF data yet) or it is calculated as\n\t     #masters_length-slave_start#.\n\n       \\item {\\bf #DataPool# connected to a file}. This mode is quite similar\n             to the case, when the #DataPool# is connected to another\n\t     #DataPool#. Similarly, the #DataPool# stores no data inside.\n\t     It just forwards all \\Ref{get_data}() requests to the underlying\n\t     source (a file in this case). Thus these requests will never\n\t     block the reader. But they may return #0# if there is no data\n\t     available at the requested offset.\n\n\t     The usage of \\Ref{add_data}() functions is meaningless and\n\t     is prohibited.\n\n\t     \\Ref{is_eof}() function always returns #TRUE#. Thus \\Ref{set_eof}()\n\t     us meaningless and does nothing.\n\n\t     \\Ref{get_length}() function always returns the file size.\n\n\t     Calling \\Ref{stop}() function will stop this #DataPool# and\n\t     any other slave connected to it.\n\n\t     Trigger callbacks passed through \\Ref{add_trigger}() function\n\t     are called immediately.\n\n\t     This mode is useful to read and decode DjVu files without reading\n\t     and storing them in full in memory.\n    \\end{enumerate}\n*/\n\nclass DJVUAPI DataPool : public GPEnabled\n{\npublic: // Classes used internally by DataPool\n\t// These are declared public to support buggy C++ compilers.\n   class Incrementor;\n   class Reader;\n   class Trigger;\n   class OpenFiles;\n   class OpenFiles_File;\n   class BlockList;\n   class Counter;\nprotected:\n   DataPool(void);\n\npublic:\n      /** @name Initialization */\n      //@{\n      /** Default creator. Will prepare #DataPool# for accepting data\n\t  added through functions \\Ref{add_data}(). Use \\Ref{connect}()\n\t  functions if you want to map this #DataPool# to another or\n\t  to a file. */\n   static GP<DataPool> create(void);\n\n      /** Creates and initialized the #DataPool# with data from stream #str#.\n\t  The constructor will read the stream's contents and add them\n\t  to the pool using the \\Ref{add_data}() function. Afterwards it\n\t  will call \\Ref{set_eof}() function, and no other data will be\n\t  allowed to be added to the pool. */\n   static GP<DataPool> create(const GP<ByteStream> & str);\n\n      /** Initializes the #DataPool# in slave mode and connects it\n\t  to the specified offsets range of the specified master #DataPool#.\n\t  It is equivalent to calling default constructor and function\n\t  \\Ref{connect}().\n\n\t  @param master_pool Master #DataPool# providing data for this slave\n\t  @param start Beginning of the offsets range which the slave is\n\t         mapped into\n          @param length Length of the offsets range. If negative, the range\n\t         is assumed to extend up to the end of the master #DataPool#.\n      */\n   static GP<DataPool> create(const GP<DataPool> & master_pool, int start=0, int length=-1);\n\n      /** Initializes the #DataPool# in slave mode and connects it\n\t  to the specified offsets range of the specified file.\n\t  It is equivalent to calling default constructor and function\n\t  \\Ref{connect}().\n\t  @param url Name of the file to connect to.\n\t  @param start Beginning of the offsets range which the #DataPool# is\n\t         mapped into\n          @param length Length of the offsets range. If negative, the range\n\t         is assumed to extend up to the end of the file.\n      */\n   static GP<DataPool> create(const GURL &url, int start=0, int length=-1);\n\n   virtual ~DataPool();\n\n      /** Switches the #DataPool# to slave mode and connects it to the\n\t  specified offsets range of the master #DataPool#.\n\t  @param master_pool Master #DataPool# providing data for this slave\n\t  @param start Beginning of the offsets range which the slave is\n\t         mapped into\n          @param length Length of the offsets range. If negative, the range\n\t         is assumed to extend up to the end of the master #DataPool#.\n      */\n   void\t\tconnect(const GP<DataPool> & master_pool, int start=0, int length=-1);\n      /** Connects the #DataPool# to the specified offsets range of\n\t  the named #url#.\n\t  @param url Name of the file to connect to.\n\t  @param start Beginning of the offsets range which the #DataPool# is\n\t         mapped into\n          @param length Length of the offsets range. If negative, the range\n\t         is assumed to extend up to the end of the file.\n      */\n   void\t\tconnect(const GURL &url, int start=0, int length=-1);\n      //@}\n\n      /** Tells the #DataPool# to stop serving readers.\n\n\t  If #only_blocked# flag is #TRUE# then only those requests will\n\t  be processed, which would not block. Any attempt to get non-existing\n\t  data would result in a #STOP# exception (instead of blocking until\n\t  data is available).\n\n\t  If #only_blocked# flag is #FALSE# then any further attempt to read\n\t  from this #DataPool# (as well as from any #DataPool# connected\n\t  to this one) will result in a #STOP# exception. */\n   void\t\tstop(bool only_blocked=false);\n\n      /** @name Adding data.\n\t  Please note, that these functions are for not connected #DataPool#s\n\t  only. You can not add data to a #DataPool#, which is connected\n\t  to another #DataPool# or to a file.\n\t*/\n      //@{\n      /** Appends the new block of data to the #DataPool#. There are two\n\t  \\Ref{add_data}() functions available. One is for adding data\n\t  sequentially. It keeps track of the last byte position, which has\n\t  been stored {\\bf by it} and always appends the next block after\n\t  this position. The other \\Ref{add_data}() can store data anywhere.\n\t  \n\t  The function will unblock readers waiting for data if this data\n\t  arrives with this block. It may also trigger some {\\em trigger\n\t  callbacks}, which may have been added by means of \\Ref{add_trigger}()\n\t  function.\n\n\t  {\\bf Note:} After all the data has been added, it's necessary\n\t  to call \\Ref{set_eof}() to tell the #DataPool# that nothing else\n\t  is expected.\n\n\t  {\\bf Note:} This function may not be called if the #DataPool#\n\t  has been connected to something.\n\n\t  @param buffer data to append\n\t  @param size length of the {\\em buffer}\n      */\n   void\t\tadd_data(const void * buffer, int size);\n\n      /** Stores the specified block of data at the specified offset.\n\t  Like the function above this one can also unblock readers\n\t  waiting for data and engage trigger callbacks. The difference\n\t  is that {\\bf this} function can store data anywhere.\n\n\t  {\\bf Note:} After all the data has been added, it's necessary\n\t  to call \\Ref{set_eof}() to tell the #DataPool# that nothing else\n\t  is expected.\n\n\t  {\\bf Note:} This function may not be called if the #DataPool#\n\t  has been connected to something.\n\n\t  @param buffer data to store\n\t  @param offset where to store the data\n\t  @param size length of the {\\em buffer} */\n   void\t\tadd_data(const void * buffer, int offset, int size);\n\n      /** Tells the #DataPool# that all data has been added and nothing else\n\t  is anticipated. When #EOF# is true, any reader attempting to read\n\t  non existing data will not be blocked. It will either read #ZERO#\n\t  bytes or will get an #ByteStream::EndOfFile# exception (see \\Ref{get_data}()).\n\t  Calling this function will also activate all registered trigger\n\t  callbacks.\n\n\t  {\\bf Note:} This function is meaningless and does nothing\n\t  when the #DataPool# is connected to another #DataPool# or to\n\t  a file. */\n   void\t\tset_eof(void);\n      //@}\n\n      /** @name Accessing data.\n\t  These functions provide direct and sequential access to the\n\t  data of the #DataPool#. If the #DataPool# is not connected\n\t  (contains some real data) then it handles the requests itself.\n\t  Otherwise they are forwarded to the master #DataPool# or the file.\n\t*/\n      //@{\n      /** Attempts to return a block of data at the given #offset#\n\t  of the given #size#.\n\n\t  \\begin{enumerate}\n\t     \\item If the #DataPool# is connected to another #DataPool# or\n\t           to a file, the request will just be forwarded to them.\n\t     \\item If the #DataPool# is not connected to anything and\n\t           some of the data requested is in the internal buffer,\n\t\t   the function copies available data to #buffer# and returns\n\t\t   immediately.\n\n\t\t   If there is no data available, and \\Ref{is_eof}() returns\n\t\t   #FALSE#, the reader (and the thread) will be {\\bf blocked}\n\t\t   until the data actually arrives. Please note, that since\n\t\t   the reader is blocked, it should run in a separate thread\n\t\t   so that other threads have a chance to call \\Ref{add_data}().\n\t\t   If there is no data available, but \\Ref{is_eof}() is #TRUE#\n\t\t   the behavior is different and depends on the #DataPool#'s\n\t\t   estimate of the file size:\n\t\t   \\begin{itemize}\n\t\t      \\item If #DataPool# learns from the IFF structure of the\n\t\t            data, that its size should be greater than it\n\t\t\t    really is, then any attempt to read non-existing\n\t\t\t    data in the range of {\\em valid} offsets will\n\t\t\t    result in an #ByteStream::EndOfFile# exception. This is done to\n\t\t\t    indicate, that there was an error in adding data,\n\t\t\t    and the data requested is {\\bf supposed} to be\n\t\t\t    there, but has actually not been added.\n\t\t      \\item If #DataPool#'s expectations about the data size\n\t\t            coincide with the reality then any attempt to\n\t\t\t    read data beyond the legal range of offsets will\n\t\t\t    result in #ZERO# bytes returned.\n\t\t   \\end{itemize}.\n          \\end{enumerate}.\n\n\t  @param buffer Buffer to be filled with data\n\t  @param offset Offset in the #DataPool# to read data at\n\t  @param size Size of the {\\em buffer}\n\t  @return The number of bytes actually read\n\t  @exception STOP The stream has been stopped\n\t  @exception EOF The requested data is not there and will not be added,\n\t             although it should have been.\n      */\n   int\t\tget_data(void * buffer, int offset, int size);\n\n      /** Returns a \\Ref{ByteStream} to access contents of the #DataPool#\n\t  sequentially. By reading from the returned stream you basically\n          call \\Ref{get_data}() function. Thus, everything said for it\n\t  remains true for the stream too. */\n   GP<ByteStream>\tget_stream(void);\n      //@}\n\n      /** @name State querying functions. */\n      //@{\n      /** Returns #TRUE# if this #DataPool# is connected to another #DataPool#\n\t  or to a file. */\n   bool\t\tis_connected(void) const;\n   \n      /** Returns #TRUE# if all data available for offsets from\n\t  #start# till #start+length-1#. If #length# is negative, the\n          range is assumed to extend up to the end of the #DataPool#.\n\t  This function works both for connected and not connected #DataPool#s.\n\t  Once it returned #TRUE# for some offsets range, you can be\n\t  sure that the subsequent \\Ref{get_data}() request will not block.\n      */\n   bool\t\thas_data(int start, int length);\n\n      /* Returns #TRUE# if no more data is planned to be added.\n\n\t {\\bf Note:} This function always returns #TRUE# when the #DataPool#\n\t has been initialized with a file name. */\n   bool\t\tis_eof(void) const {return eof_flag;}\n\n      /** Returns the {\\em length} of data in the #DataPool#. The value\n\t  returned depends on the mode of operation:\n\t  \\begin{itemize}\n\t     \\item If the #DataPool# is not connected to anything then\n\t           the length returned is either calculated by interpreting\n\t\t   the IFF structure of stored data (if successful) or\n\t\t   by calculating the real size of data after \\Ref{set_eof}()\n\t\t   has been called. Otherwise it is #-1#.\n\t     \\item If the #DataPool# is connected to a file, the length\n\t           is calculated basing on the length passed to the\n\t\t   \\Ref{connect}() function and the file size.\n\t     \\item If the #DataPool# is connected to a master #DataPool#,\n\t           the length is calculated basing on the value returned\n\t\t   by the master's #get_length()# function and the length\n\t\t   passed to the \\Ref{connect}() function.\n\t  \\end{itemize}. */\n   int\t\tget_length(void) const;\n      /** Returns the number of bytes of data available in this #DataPool#.\n\t  Contrary to the \\Ref{get_length}() function, this one doesn't try\n\t  to interpret the IFF structure and predict the file length.\n\t  It just returns the number of bytes of data really available inside\n\t  the #DataPool#, if it contains data, or inside its range, if it's\n\t  connected to another #DataPool# or a file. */\n   int\t\tget_size(void) const {return get_size(0, -1);}\n      //@}\n\n      /** @name Trigger callbacks.\n\t  {\\em Trigger callbacks} are special callbacks called when\n\t  all data for the given range of offsets has been made available.\n\t  Since reading unavailable data may result in a thread block,\n\t  which may be bad, the usage of {\\em trigger callbacks} appears\n\t  to be a convenient way to signal availability of data.\n\n\t  You can add a trigger callback in two ways:\n\t  \\begin{enumerate}\n\t     \\item By specifying a range. This is the most general case\n\t     \\item By providing just one {\\em threshold}. In this case\n\t           the range is assumed to start from offset #ZERO# and\n\t\t   last for {\\em threshold}+1 bytes.\n\t  \\end{enumerate}\n\t*/\n      //@{\n      /** Associates the specified {\\em trigger callback} with the\n\t  given data range.\n\n\t  {\\bf Note:} The callback may be called immediately if all\n\t  data for the given range is already available or #EOF# is #TRUE#.\n\n\t  @param start The beginning of the range for which all data\n\t         should be available\n\t  @param length If the {\\em length} is not negative then the callback\n\t         will be called when there is data available for every\n\t\t offset from {\\em start} to {\\em start+length-1}.\n\t         If {\\em thresh} is negative, the callback is called after\n\t\t #EOF# condition has been set.\n\t  @param callback Function to call\n\t  @param cl_data Argument to pass to the callback when it's called. */\n   void\t\tadd_trigger(int start, int length,\n\t\t\t    void (* callback)(void *), void * cl_data);\n\n      /** Associates the specified {\\em trigger callback} with the\n\t  specified threshold.\n\n\t  This function is a simplified version of the function above.\n\t  The callback will be called when there is data available for\n\t  every offset from #0# to #thresh#, if #thresh# is positive, or\n\t  when #EOF# condition has been set otherwise. */\n\n   void\t\tadd_trigger(int thresh, \n                            void (* callback)(void *), void * cl_data);\n\n      /** Use this function to unregister callbacks, which are no longer\n\t  needed. {\\bf Note!} It's important to do it when the client\n\t  is about to be destroyed. */\n   void\t\tdel_trigger(void (* callback)(void *), void *  cl_data);\n\n      //@}\n\n      /** Loads data from the file into memory. This function is only useful\n\t  for #DataPool#s getting data from a file. It descends the #DataPool#s\n\t  hierarchy until it either reaches a file-connected #DataPool#\n\t  or #DataPool# containing the real data. In the latter case it\n\t  does nothing, in the first case it makes the #DataPool# read all\n\t  data from the file into memory and stop using the file.\n\n\t  This may be useful when you want to overwrite the file and leave\n\t  existing #DataPool#s with valid data. */\n   void\t\tload_file(void);\n      /** This function will make every #DataPool# in the program, which\n\t  is connected to a file, to load the file contents to the main\n\t  memory and close the file. This feature is important when you\n\t  want to do something with the file like remove or overwrite it\n\t  not affecting the rest of the program. */\n   static void\tload_file(const GURL &url);\n\n      /** This function will remove OpenFiles filelist. */\n   static void\tclose_all(void);\n\n      // Internal. Used by 'OpenFiles'\n   void\t\tclear_stream(const bool release = true);\n\n      /** Useful in comparing data pools.  Returns true if dirived from\n          same URL or bytestream. */\n   bool simple_compare(DataPool &pool) const;\n\n\nprivate:\n   bool\t\teof_flag;\n   bool\t\tstop_flag;\n   bool\t\tstop_blocked_flag;\n\n   Counter\t*active_readers;\n   \n      // Source or storage of data\n   GP<DataPool>\t\tpool;\n   GURL\t\tfurl;\n   GP<OpenFiles_File>   fstream;\n   GCriticalSection\tclass_stream_lock;\n   GP<ByteStream>\tdata;\n   GCriticalSection\tdata_lock;\n   BlockList\t\t*block_list;\n   int\t\t\tadd_at;\n   int\t\t\tstart, length;\n\n      // List of readers waiting for data\n   GPList<Reader>\treaders_list;\n   GCriticalSection\treaders_lock;\n\n      // Triggers\n   GPList<Trigger>\ttriggers_list;\t\t// List of passed or our triggers\n   GCriticalSection\ttriggers_lock;\t\t// Lock for the list above\n   GCriticalSection\ttrigger_lock;\t\t// Lock for static_trigger_cb()\n\n   void\t\tinit(void);\n   void\t\twait_for_data(const GP<Reader> & reader);\n   void\t\twake_up_all_readers(void);\n   void\t\tcheck_triggers(void);\n   int\t\tget_data(void * buffer, int offset, int size, int level);\n   int\t\tget_size(int start, int length) const;\n   void\t\trestart_readers(void);\n\n//   static void\tstatic_trigger_cb(GP<GPEnabled> &);\n   static void\tstatic_trigger_cb(void *);\n   void\t\ttrigger_cb(void);\n   void\t\tanalyze_iff(void);\n   void\t\tadded_data(const int offset, const int size);\npublic:\n  static const char *Stop;\n  friend class FCPools;\n};\n\ninline bool \nDataPool::simple_compare(DataPool &pool) const\n{\n  // return true if these pools are identical.  False means they may or may\n  // not be identical.\n  return (this == &pool)\n    ||(furl.is_valid()&&!furl.is_empty()&&pool.furl.is_valid()&&(furl == pool.furl))\n    ||(data && (data == pool.data));\n}\n\ninline bool\nDataPool::is_connected(void) const\n{\n   return furl.is_local_file_url() || pool!=0;\n}\n\n//@}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVmDir.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"DjVmDir.h\"\n#include \"BSByteStream.h\"\n#include \"GURL.h\"\n#include \"debug.h\"\n\n#include <ctype.h>\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\nGP<DjVmDir::File>\nDjVmDir::File::create(const GUTF8String &load_name,\n  const GUTF8String &save_name, const GUTF8String &title,\n  const FILE_TYPE file_type)\n{\n  File *file_ptr=new File();\n  GP<File> file=file_ptr;\n  file_ptr->set_load_name(load_name);\n  file_ptr->set_save_name(save_name);\n  file_ptr->set_title(title);\n  file_ptr->flags=(file_type & TYPE_MASK);\n  return file;\n}\n\nconst GUTF8String &\nDjVmDir::File::check_save_name(const bool xis_bundled)\n{\n  if(!xis_bundled && !valid_name)\n  {\n    GUTF8String retval=name.length()?name:id;\n    if(GUTF8String(GNativeString(retval)) != retval)\n    {\n      const_cast<bool &>(valid_name)=true;\n      char *buf;\n      GPBuffer<char> gbuf(buf,2*retval.length()+1);\n      char *s=buf;\n      int i=0;\n      for(char c=retval[i++];c;)\n      {\n        static const char hex[]=\"0123456789ABCDEF\";\n        int len=retval.nextChar(i)-i;\n        if(len>1 || ((len == 1)&&(c&0x80)))\n        {\n          do\n          {\n            s++[0]=hex[(c>>4)&0xf];\n            s++[0]=hex[(c&0xf)];\n            c=retval[i++];\n          } while(c && ((--len) > 0));\n        }else\n        {\n          s++[0]=c;\n          c=retval[i++];\n        }\n      }\n      s++[0]=0;\n      oldname=retval;\n      name=buf;\n    }\n    const_cast<bool &>(valid_name)=true;\n  }\n  return *(name.length()?&name:&id);\n}\n\nconst GUTF8String &\nDjVmDir::File::get_save_name(void) const\n{\n  return *(name.length()?&name:&id);\n}\n\nvoid\nDjVmDir::File::set_load_name(const GUTF8String &xid)\n{\n  GURL url=GURL::UTF8(xid);\n  if(!url.is_valid())\n  {\n    url=GURL::Filename::UTF8(xid);\n  }\n  id=url.fname();\n}\n\nvoid\nDjVmDir::File::set_save_name(const GUTF8String &xname)\n{\n  GURL url;\n  valid_name=false;\n  if(!xname.length())\n  {\n    GURL url=GURL::UTF8(id);\n    if(!url.is_valid())\n    {\n      name=id;\n    }else\n    {\n      name=url.fname();\n    }\n  }else\n  {\n    GURL url=GURL::UTF8(xname);\n    if(!url.is_valid())\n    {\n      url=GURL::Filename::UTF8(xname);\n    }\n    name=url.fname();\n  }\n  oldname=\"\";\n}\n\n/* DjVmDir::File */\n\nDjVmDir::File::File(void) : offset(0), size(0), valid_name(false),\n   flags(0), page_num(-1) { }\n\nGUTF8String\nDjVmDir::File::get_str_type(void) const\n{\n   GUTF8String type;\n   switch(flags & TYPE_MASK)\n   {\n      case INCLUDE:\n        type=\"INCLUDE\";\n        break;\n      case PAGE:\n        type=\"PAGE\";\n        break;\n      case THUMBNAILS:\n        type=\"THUMBNAILS\";\n        break;\n      case SHARED_ANNO:\n        type=\"SHARED_ANNO\";\n        break;\n      default:\n        //  Internal error: please modify DjVmDir::File::get_str_type()\n        //  to contain all possible File types.\n\t      G_THROW( ERR_MSG(\"DjVmDir.get_str_type\") );\n   }\n   return type;\n}\n\n\nconst int DjVmDir::version=1;\n\nvoid \nDjVmDir::decode(const GP<ByteStream> &gstr)\n{\n   ByteStream &str=*gstr;\n   DEBUG_MSG(\"DjVmDir::decode(): decoding contents of 'DIRM' chunk...\\n\");\n   DEBUG_MAKE_INDENT(3);\n   \n   GCriticalSectionLock lock(&class_lock);\n\n   GPosition pos;\n\n   files_list.empty();\n   page2file.resize(-1);\n   name2file.empty();\n   id2file.empty();\n   title2file.empty();\n\n   int ver=str.read8();\n   bool bundled=(ver & 0x80)!=0;\n   ver&=0x7f;\n\n   DEBUG_MSG(\"DIRM version=\" << ver << \", our version=\" << version << \"\\n\");\n   if (ver>version)\n      G_THROW( ERR_MSG(\"DjVmDir.version_error\") \"\\t\" \n               + GUTF8String(version) + \"\\t\" + GUTF8String(ver));\n   // Unable to read DJVM directories of versions higher than xxx\n   // Data version number is yyy.\n   DEBUG_MSG(\"bundled directory=\" << bundled << \"\\n\");\n   DEBUG_MSG(\"reading the directory records...\\n\");\n   int files=str.read16();\n   DEBUG_MSG(\"number of files=\" << files << \"\\n\");\n\n   if (files)\n   {\n      DEBUG_MSG(\"reading offsets (and sizes for ver==0)\\n\");\n      for(int nfile=0;nfile<files;nfile++)\n      {\n         GP<File> file=new File();\n         files_list.append(file);\n         if (bundled)\n         {\n            file->offset=str.read32();\n            if (ver==0)\n              file->size=str.read24();\n            if (file->offset==0)\n               G_THROW( ERR_MSG(\"DjVmDir.no_indirect\") );\n         } else\n         {\n           file->offset=file->size=0;\n         }\n      }\n\n      GP<ByteStream> gbs_str=BSByteStream::create(gstr);\n      ByteStream &bs_str=*gbs_str;\n      if (ver>0)\n      {\n         DEBUG_MSG(\"reading and decompressing sizes...\\n\");\n         for(GPosition pos=files_list;pos;++pos)\n            files_list[pos]->size=bs_str.read24();\n      }\n         \n      DEBUG_MSG(\"reading and decompressing flags...\\n\");\n      for(pos=files_list;pos;++pos)\n         files_list[pos]->flags=bs_str.read8();\n\n      if (!ver)\n      {\n         DEBUG_MSG(\"converting flags from version 0...\\n\");\n         for(pos=files_list;pos;++pos)\n         {\n            unsigned char flags_0=files_list[pos]->flags;\n            unsigned char flags_1;\n            flags_1=(flags_0 & File::IS_PAGE_0)?(File::PAGE):(File::INCLUDE);\n            if (flags_0 & File::HAS_NAME_0)\n              flags_1|=File::HAS_NAME;\n            if (flags_0 & File::HAS_TITLE_0)\n              flags_1|=File::HAS_TITLE;\n            files_list[pos]->flags=flags_1;\n         }\n      }\n   \n      DEBUG_MSG(\"reading and decompressing names...\\n\");\n      GTArray<char> strings;\n      char buffer[1024];\n      int length;\n      while((length=bs_str.read(buffer, 1024)))\n      {\n         int strings_size=strings.size();\n         strings.resize(strings_size+length-1);\n         memcpy((char*) strings+strings_size, buffer, length);\n      }\n      DEBUG_MSG(\"size of decompressed names block=\" << strings.size() << \"\\n\");\n   \n         // Copy names into the files\n      const char * ptr=strings;\n      for(pos=files_list;pos;++pos)\n      {\n         GP<File> file=files_list[pos];\n\n         file->id=ptr;\n         ptr+=file->id.length()+1;\n         if (file->flags & File::HAS_NAME)\n         {\n            file->name=ptr;\n            ptr+=file->name.length()+1;\n         } else\n         {\n            file->name=file->id;\n         }\n         if (file->flags & File::HAS_TITLE)\n         {\n            file->title=ptr;\n       ptr+=file->title.length()+1;\n         } else\n       file->title=file->id;\n   /* msr debug:  multipage file, file->title is null.  \n         DEBUG_MSG(file->name << \", \" << file->id << \", \" << file->title << \", \" <<\n                   file->offset << \", \" << file->size << \", \" <<\n                   file->is_page() << \"\\n\"); */\n      }\n\n         // Check that there is only one file with SHARED_ANNO flag on\n      int shared_anno_cnt=0;\n      for(pos=files_list;pos;++pos)\n      {\n         if (files_list[pos]->is_shared_anno())\n         {\n            shared_anno_cnt++;\n         }\n      }\n      if (shared_anno_cnt>1)\n        G_THROW( ERR_MSG(\"DjVmDir.corrupt\") );\n\n         // Now generate page=>file array for direct access\n      int pages=0;\n      for(pos=files_list;pos;++pos)\n              pages+=files_list[pos]->is_page() ? 1 : 0;\n      DEBUG_MSG(\"got \" << pages << \" pages\\n\");\n      page2file.resize(pages-1);\n      int page_num=0;\n      for(pos=files_list;pos;++pos)\n      {\n               GP<File> file=files_list[pos];\n               if (file->is_page())\n               {\n                  page2file[page_num]=file;\n                  file->page_num=page_num++;\n               }\n      }\n\n         // Generate name2file map\n      for(pos=files_list;pos;++pos)\n      {\n\t       GP<File> file=files_list[pos];\n\t       if (name2file.contains(file->name))\n\t          G_THROW( ERR_MSG(\"DjVmDir.dupl_name\") \"\\t\" + file->name );\n\t       name2file[file->name]=file;\n      }\n\n         // Generate id2file map\n      for(pos=files_list;pos;++pos)\n      {\n\t       GP<File> file=files_list[pos];\n\t       if (id2file.contains(file->id))\n\t          G_THROW( ERR_MSG(\"DjVmDir.dupl_id\") \"\\t\" + file->id);\n\t       id2file[file->id]=file;\n      }\n\n         // Generate title2file map\n      for(pos=files_list;pos;++pos)\n      {\n\t       GP<File> file=files_list[pos];\n\t       if (file->title.length())\n\t       {\n\t          if (title2file.contains(file->title))\n\t             G_THROW( ERR_MSG(\"DjVmDir.dupl_title\") \"\\t\" + file->title);\n\t          title2file[file->title]=file;\n\t       }\n      }\n   }\n}\n\n\nvoid\nDjVmDir::encode(const GP<ByteStream> &gstr, const bool do_rename) const\n{\n  bool bundled = true;\n  GPosition pos = files_list;\n  if (files_list.size() && !files_list[pos]->offset)\n    bundled = false;\n  for (pos=files_list; pos; ++pos)\n    if ( !bundled !=  !files_list[pos]->offset)\n      //  There directory contains both indirect and bundled records.\n      G_THROW( ERR_MSG(\"DjVmDir.bad_dir\") );\n  // Do the real work\n  encode(gstr, bundled, do_rename);\n}\n\nvoid\nDjVmDir::encode(const GP<ByteStream> &gstr, const bool bundled, const bool do_rename) const\n{\n  ByteStream &str=*gstr;\n  DEBUG_MSG(\"DjVmDir::encode(): encoding contents of the 'DIRM' chunk do_rename=\" << do_rename << \"\\n\");\n  DEBUG_MAKE_INDENT(3);\n   \n  GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n  GPosition pos;\n\n  DEBUG_MSG(\"encoding version number=\" << version << \", bundled=\" << bundled << \"\\n\");\n  str.write8(version | ((int) bundled<< 7));\n   \n  DEBUG_MSG(\"storing the number of records=\" << files_list.size() << \"\\n\");\n  str.write16(files_list.size());\n\n  if (files_list.size())\n    {\n      // Check that there is only one file with shared annotations\n      int shared_anno_cnt=0;\n      for (pos=files_list; pos; ++pos)\n        if (files_list[pos]->is_shared_anno())\n          shared_anno_cnt++;\n      if (shared_anno_cnt>1)\n        G_THROW( ERR_MSG(\"DjVmDir.multi_save\") );\n      \n      if (bundled)\n        {\n          // We need to store offsets uncompressed. That's because when\n          // we save a DjVmDoc, we first compress the DjVmDir with dummy\n          // offsets and after computing the real offsets we rewrite the\n          // DjVmDir, which should not change its size during this operation\n          DEBUG_MSG(\"storing offsets for every record\\n\");\n          for (pos=files_list; pos; ++pos)\n            {\n              GP<File> file=files_list[pos];\n              if (!file->offset)\n                // The directory contains record without offset\n                G_THROW( ERR_MSG(\"DjVmDir.bad_dir\") );\n              str.write32(file->offset);\n            }\n        }\n\n      GP<ByteStream> gbs_str=BSByteStream::create(gstr, 50);\n      ByteStream &bs_str=*gbs_str;\n      DEBUG_MSG(\"storing and compressing sizes for every record\\n\");\n      for (pos=files_list; pos; ++pos)\n        {\n          const GP<File> file(files_list[pos]);\n          bs_str.write24(file->size);\n        }\n      DEBUG_MSG(\"storing and compressing flags for every record\\n\");\n      const bool xdo_rename=(do_rename||!bundled);\n      for (pos=files_list;pos;++pos)\n\t{\n\t  const GP<File> file(files_list[pos]);\n\t  if (xdo_rename)\n\t    {\n\t      const GUTF8String new_id = file->name;\n\t      if (!new_id)\n\t\t{\n\t\t  if (!file->oldname.length() || file->oldname == new_id)\n\t\t    file->flags &= ~File::HAS_NAME;\n\t\t  else\n\t\t    file->flags |= File::HAS_NAME;\n\t\t}\n\t    }\n\t  else\n\t    {\n\t      if (!file->name.length() || file->name == file->id)\n\t\tfile->flags &= ~File::HAS_NAME;\n\t      else\n\t\tfile->flags |= File::HAS_NAME;\n\t    }\n\t  if (file->title.length() && (file->title!=file->id))\n\t    file->flags |= File::HAS_TITLE;\n\t  else\n\t    file->flags &= ~File::HAS_TITLE;\n\n\t  bs_str.write8(file->flags);\n\t}\n\n     DEBUG_MSG(\"storing and compressing names...\\n\");\n     for(pos=files_list;pos;++pos)\n     {\n         GP<File> file=files_list[pos];\n         GUTF8String id;\n         GUTF8String name;\n         GUTF8String title;\n         if (xdo_rename)\n           {\n             id = file->name;\n             if (! id)\n               id = file->id;\n             if ((file->flags) & File::HAS_NAME)\n               name = file->oldname;\n           }\n         else\n           {\n             id=file->id;\n             if ((file->flags) & File::HAS_NAME)\n               name = file->name;\n           }\n         if ((file->flags) & File::HAS_TITLE)\n           title = file->title;\n         DEBUG_MSG(\"rename=\" <<xdo_rename<<\" id='\" << id << \"' name='\" << name << \"' title='\" << title << \"'\\n\");\n         bs_str.writestring(id);\n         bs_str.write8(0);\n         if (name.length())\n           {\n             bs_str.writestring(name);\n             bs_str.write8(0);\n           }\n         if (title.length())\n           {\n             bs_str.writestring(title);\n             bs_str.write8(0);\n           }\n     }\n    }\n  DEBUG_MSG(\"done\\n\");\n}\n\nGP<DjVmDir::File>\nDjVmDir::page_to_file(int page_num) const\n{\n   GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n\n   return (page_num<page2file.size())?page2file[page_num]:(GP<DjVmDir::File>(0));\n}\n\nGP<DjVmDir::File>\nDjVmDir::name_to_file(const GUTF8String & name) const\n{\n   GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n\n   GPosition pos;\n   return (name2file.contains(name, pos))?name2file[pos]:(GP<DjVmDir::File>(0));\n}\n\nGP<DjVmDir::File>\nDjVmDir::id_to_file(const GUTF8String &id) const\n{\n   GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n\n   GPosition pos;\n   return (id2file.contains(id, pos))?id2file[pos]:(GP<DjVmDir::File>(0));\n}\n\nGP<DjVmDir::File>\nDjVmDir::title_to_file(const GUTF8String &title) const\n{\n   GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n   GPosition pos;\n   return (title2file.contains(title, pos))?title2file[pos]:(GP<DjVmDir::File>(0));\n}\n\nGP<DjVmDir::File>\nDjVmDir::pos_to_file(int fileno, int *ppageno) const\n{\n  GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n  GPosition pos = files_list;\n  int pageno = 0;\n  while (pos && --fileno >= 0) {\n    if (files_list[pos]->is_page())\n      ++pageno;\n    ++pos;\n  }\n  if (!pos)\n    return 0;\n  if (ppageno)\n    *ppageno = pageno;\n  return files_list[pos];\n}\n\nGPList<DjVmDir::File>\nDjVmDir::get_files_list(void) const\n{\n  GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n  return files_list;\n}\n\nint\nDjVmDir::get_files_num(void) const\n{\n  GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n  return files_list.size();\n}\n\nint\nDjVmDir::get_pages_num(void) const\n{\n   GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n   return page2file.size();\n}\n\nint\nDjVmDir::get_file_pos(const File * f) const\n{\n   GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n   int cnt;\n   GPosition pos;\n   for(pos=files_list, cnt=0;pos&&(files_list[pos]!=f);++pos, cnt++)\n                   continue;\n   return (pos)?cnt:(-1);\n}\n\nint\nDjVmDir::get_page_pos(int page_num) const\n{\n   GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n   \n   GP<File> file=page_to_file(page_num);\n   return (file)?get_file_pos(file):(-1);\n}\n\nGP<DjVmDir::File>\nDjVmDir::get_shared_anno_file(void) const\n{\n   GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n\n   GP<File> file;\n   for(GPosition pos=files_list;pos;++pos)\n   {\n      GP<File> frec=files_list[pos];\n      if (frec->is_shared_anno())\n      {\n         file=frec;\n         break;\n      }\n   }\n   return file;\n}\n\nint\nDjVmDir::insert_file(const GP<File> & file, int pos_num)\n{\n   DEBUG_MSG(\"DjVmDir::insert_file(): name='\" \n             << file->name << \"', pos=\" << pos_num << \"\\n\");\n   DEBUG_MAKE_INDENT(3);\n   \n   GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n   \n   if (pos_num<0)\n     pos_num=files_list.size();\n\n   //// Modify maps\n   //   if (! File::is_legal_id(file->id))\n   //     G_THROW( ERR_MSG(\"DjVmDir.bad_file\") \"\\t\" + file->id);\n   if (id2file.contains(file->id))\n     G_THROW( ERR_MSG(\"DjVmDir.dupl_id2\") \"\\t\" + file->id);\n   if (name2file.contains(file->name))\n     G_THROW( ERR_MSG(\"DjVmDir.dupl_name2\") \"\\t\" + file->name);\n   name2file[file->name]=file;\n   id2file[file->id]=file;\n   if (file->title.length())\n     {\n       if (title2file.contains(file->title))  \n         // duplicate titles may become ok some day\n         G_THROW( ERR_MSG(\"DjVmDir.dupl_title2\") \"\\t\" + file->title);\n       title2file[file->title]=file;\n     }\n\n      // Make sure that there is no more than one file with shared annotations\n   if (file->is_shared_anno())\n   {\n      for(GPosition pos=files_list;pos;++pos)\n         if (files_list[pos]->is_shared_anno())\n            G_THROW( ERR_MSG(\"DjVmDir.multi_save2\") );\n   }\n   \n      // Add the file to the list\n   int cnt;\n   GPosition pos;\n   for(pos=files_list, cnt=0;pos&&(cnt!=pos_num);++pos, cnt++)\n                   continue;\n   if (pos)\n     files_list.insert_before(pos, file);\n   else\n     files_list.append(file);\n\n   if (file->is_page())\n   {\n         // This file is also a page\n         // Count its number\n      int page_num=0;\n      for(pos=files_list;pos;++pos)\n      {\n         GP<File> &f=files_list[pos];\n         if (f==file)\n           break;\n         if (f->is_page())\n           page_num++;\n      }\n\n      int i;\n      page2file.resize(page2file.size());\n      for(i=page2file.size()-1;i>page_num;i--)\n         page2file[i]=page2file[i-1];\n      page2file[page_num]=file;\n      for(i=page_num;i<page2file.size();i++)\n         page2file[i]->page_num=i;\n   }\n   return pos_num;\n}\n\nvoid\nDjVmDir::delete_file(const GUTF8String &id)\n{\n   DEBUG_MSG(\"Deleting file with id='\" << (const char *)id << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n   \n   for(GPosition pos=files_list;pos;++pos)\n   {\n      GP<File> & f=files_list[pos];\n      if (id == f->id)\n      {\n         name2file.del(f->name);\n         id2file.del(f->id);\n         title2file.del(f->title);\n         if (f->is_page())\n         {\n            for(int page=0;page<page2file.size();page++)\n            {\n               if (page2file[page]==f)\n               {\n                  int i;\n                  for(i=page;i<page2file.size()-1;i++)\n                     page2file[i]=page2file[i+1];\n                  page2file.resize(page2file.size()-2);\n                  for(i=page;i<page2file.size();i++)\n                     page2file[i]->page_num=i;\n                  break;\n               }\n            }\n         }\n         files_list.del(pos);\n         break;\n      }\n   }\n}\n\nvoid\nDjVmDir::set_file_name(const GUTF8String &id, const GUTF8String &name)\n{\n   DEBUG_MSG(\"DjVmDir::set_file_name(): id='\" << id << \"', name='\" << name << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n   \n   GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n\n   GPosition pos;\n   \n      // First see, if the name is unique\n   for(pos=files_list;pos;++pos)\n   {\n      GP<File> file=files_list[pos];\n      if (file->id!=id && file->name==name)\n        G_THROW( ERR_MSG(\"DjVmDir.name_in_use\") \"\\t\" + GUTF8String(name));\n   }\n\n      // Check if ID is valid\n   if (!id2file.contains(id, pos))\n      G_THROW( ERR_MSG(\"DjVmDir.no_info\") \"\\t\" + GUTF8String(id));\n   GP<File> file=id2file[pos];\n   name2file.del(file->name);\n   file->name=name;\n   name2file[name]=file;\n}\n\nvoid\nDjVmDir::set_file_title(const GUTF8String &id, const GUTF8String &title)\n{\n   DEBUG_MSG(\"DjVmDir::set_file_title(): id='\" << id << \"', title='\" << title << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n   GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n   GPosition pos;\n      // Check if ID is valid\n   if (!id2file.contains(id, pos))\n      G_THROW( ERR_MSG(\"DjVmDir.no_info\") \"\\t\" + GUTF8String(id));\n   GP<File> file=id2file[pos];\n   title2file.del(file->title);\n   file->title=title;\n   title2file[title]=file;\n}\n\nGPList<DjVmDir::File>\nDjVmDir::resolve_duplicates(const bool save_as_bundled)\n{\n  GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n  // Make sure all the filenames are unique.\n  GPosition pos;\n  GMap<GUTF8String,void *> save_map;\n  GMap<GUTF8String,GPList<DjVmDir::File> > conflicts;\n  for(pos=files_list;pos;++pos)\n  {\n    const GUTF8String save_name=files_list[pos]->check_save_name(save_as_bundled).downcase();\n    if(save_map.contains(save_name))\n    {\n      conflicts[save_name].append(files_list[pos]);\n    }else\n    {\n      save_map[save_name]=0;\n    }\n  }\n  for(pos=conflicts;pos;++pos)\n  {\n    const GUTF8String &save_name=conflicts.key(pos);\n    const int dot=save_name.rsearch('.',0);\n    GPList<DjVmDir::File> &cfiles=conflicts[pos];\n    int count=1;\n    for(GPosition qpos=cfiles;qpos;++qpos)\n    {\n      GUTF8String new_name=cfiles[qpos]->get_load_name();\n      if((new_name != GUTF8String(GNativeString(new_name)))\n        ||conflicts.contains(new_name))\n      {\n        do\n        {\n          new_name=(dot<0)\n            ?(save_name+\"-\"+GUTF8String(count++))\n            :(save_name.substr(0,dot)+\"-\"+GUTF8String(count++)+\n              save_name.substr(dot,(unsigned int)(-1)));\n        } while(save_map.contains(new_name.downcase()));\n      }\n      cfiles[qpos]->set_save_name(new_name);\n      save_map[new_name]=0;\n    }\n  }\n  return files_list;\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVmDir.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _DJVMDIR_H\n#define _DJVMDIR_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n/** @name DjVmDir.h\n    Files #\"DjVmDir.h\"# and #\"DjVmDir.cpp\"# implement class \\Ref{DjVmDir} for\n    representing the directory of a DjVu multipage document.\n\n    {\\bf Bundled vs. Indirect format} --- There are currently two multipage\n    DjVu formats supported: {\\em bundled} and {\\em indirect}.  In the first\n    format all component files composing a given document are packaged (or\n    bundled) into one file, in the second one every page and component is\n    stored in a separate file and there is one more file, which contains the\n    list of all others.\n\n    {\\bf Multipage DjVu format} --- Multipage DjVu documents follow the EA\n    IFF85 format (cf. \\Ref{IFFByteStream.h}.)  A document is composed of a\n    #\"FORM:DJVM\"# whose first chunk is a #\"DIRM\"# chunk containing the {\\em\n    document directory}.  This directory lists all component files composing\n    the given document, helps to access every component file and identify the\n    pages of the document.\n    \\begin{itemize} \n    \\item In a {\\em bundled} multipage file, the component files \n         are stored immediately after the #\"DIRM\"# chunk,\n         within the #\"FORM:DJVU\"# composite chunk.  \n    \\item In an {\\em indirect} multipage file, the component files are \n          stored in different files whose URLs are composed using information \n          stored in the #\"DIRM\"# chunk.\n    \\end{itemize} \n    Most of the component files represent pages of a document.  Some files\n    however represent data shared by several pages.  The pages refer to these\n    supporting files by means of an inclusion chunk (#\"INCL\"# chunks)\n    identifying the supporting file.\n\n    {\\bf Document Directory} --- Every directory record describes a component\n    file.  Each component file is identified by a small string named the\n    identifier (ID).  Each component file also contains a file name and a\n    title.  The format of the #\"DIRM\"# chunk is described in section\n    \\Ref{Format of the DIRM chunk.}.\n\n    Theoretically, IDs are used to uniquely identify each component file in\n    #\"INCL\"# chunks, names are used to compose the the URLs of the component\n    files in an indirect multipage DjVu file, and titles are cosmetic names\n    possibly displayed when viewing a page of a document.  There are however\n    many problems with this scheme, and we {\\em strongly suggest}, with the\n    current implementation to always make the file ID, the file name and the\n    file title identical.\n\n    @memo Implements DjVu multipage document directory\n    @author Andrei Erofeev <eaf@geocities.com>\n*/\n//@{\n\n\n\n#include \"GString.h\"\n#include \"GThreads.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass ByteStream;\n\n/** Implements DjVu multipage document directory.  There are currently two\n    multipage DjVu formats supported: {\\em bundled} and {\\em indirect}.  In\n    the first format all component files composing a given document are\n    packaged (or bundled) into one file, in the second one every page and\n    component is stored in a separate file and there is one more file, which\n    contains the list of all others.\n\n    The multipage document directory lists all component files composing the\n    given document, helps to access every file, identify pages and maintain\n    user-specified shortcuts.  Every directory record describes a file\n    composing the document.  Each file is identified by a small string named\n    the identifier (ID).  Each file may also contain a file name and a title.\n\n    The #DjVmDir# class represents a multipage document directory.  Its main\n    purpose is to encode and decode the document directory when writing or\n    reading the #DIRM# chunk.  Normally you don't have to create this class\n    yourself. It's done automatically when \\Ref{DjVmDoc} class initializes\n    itself. It may be useful though to be able to access records in the\n    directory because some classes (like \\Ref{DjVuDocument} and \\Ref{DjVmDoc})\n    return a pointer to #DjVmDir# in some cases. */\n\nclass DJVUAPI DjVmDir : public GPEnabled\n{\nprotected:\n      /** Class \\Ref{DjVmDir::File} represents the directory records\n          managed by class \\Ref{DjVmDir}. */\n   DjVmDir(void) { } ;\npublic:\n   class File;\n\n   static const int version;\n\n      /** Class \\Ref{DjVmDir::File} represents the directory records\n          managed by class \\Ref{DjVmDir}. */\n   static GP<DjVmDir> create(void) {return new DjVmDir; } ;\n\n      /** Decodes the directory from the specified stream. */\n   void decode(const GP<ByteStream> &stream);\n      /** Encodes the directory into the specified stream. */\n   void encode(const GP<ByteStream> &stream, const bool do_rename=false) const;\n      /** Encodes the directory into the specified stream, \n          explicitely as bundled or indirect. */\n  void encode(const GP<ByteStream> &stream, \n              const bool bundled, const bool do_rename) const;\n      /** Tests if directory defines an {\\em indirect} document. */\n   inline bool is_indirect(void) const;\n      /** Tests if the directory defines a {\\em bundled} document. */\n   inline bool is_bundled(void) const;\n      /** Translates page numbers to file records. */\n   GP<File> page_to_file(int page_num) const;\n      /** Translates file names to file records. */\n   GP<File> name_to_file(const GUTF8String & name) const;\n      /** Translates file IDs to file records. */\n   GP<File> id_to_file(const GUTF8String &id) const;\n      /** Translates file shortcuts to file records. */\n   GP<File> title_to_file(const GUTF8String &title) const;\n      /** Access file record by position. */\n   GP<File> pos_to_file(int fileno, int *ppageno=0) const;\n      /** Returns position of the file in the directory. */\n   int get_file_pos(const File * f) const;\n      /** Returns position of the given page in the directory. */\n   int get_page_pos(int page_num) const;\n      /** Check for duplicate names, and resolve them. */\n   GPList<File> resolve_duplicates(const bool save_as_bundled);\n      /** Returns a copy of the list of file records. */\n   GPList<File> get_files_list(void) const;\n      /** Returns the number of file records. */\n   int get_files_num(void) const;\n      /** Returns the number of file records representing pages. */\n   int get_pages_num(void) const;\n      /** Returns back pointer to the file with #SHARED_ANNO# flag.\n        Note that there may be only one file with shared annotations\n        in any multipage DjVu document. */\n   GP<File> get_shared_anno_file(void) const;\n      /** Changes the title of the file with ID #id#. */\n   void set_file_title(const GUTF8String &id, const GUTF8String &title);\n      /** Changes the name of the file with ID #id#. */\n   void set_file_name(const GUTF8String &id, const GUTF8String &name);\n      /** Inserts the specified file record at the specified position.\n        Specifying #pos# equal to #-1# means to append.  The actual position\n        inserted is returned. */\n   int insert_file(const GP<File> & file, int pos=-1);\n      /** Removes a file record with ID #id#. */\n   void delete_file(const GUTF8String &id);\nprivate:\n   GCriticalSection class_lock;\n   GPList<File>\tfiles_list;\n   GPArray<File> page2file;\n   GPMap<GUTF8String, File> name2file;\n   GPMap<GUTF8String, File> id2file;\n   GPMap<GUTF8String, File> title2file;\nprivate: //dummy stuff\n   static void decode(ByteStream *);\n   static void encode(ByteStream *);\n};\n\nclass DJVUAPI DjVmDir::File : public GPEnabled\n{\npublic:\n  // Out of the record: INCLUDE below must be zero and PAGE must be one.\n  // This is to avoid problems with the File constructor, which now takes\n  // 'int file_type' as the last argument instead of 'bool is_page'\n  \n  /** File type. Possible file types are:\n     \\begin{description}\n       \\item[PAGE] This is a top level page file. It may include other\n         #INCLUDE#d files, which may in turn be shared between\n         different pages.\n       \\item[INCLUDE] This file is included into some other file inside\n         this document.\n       \\item[THUMBNAILS] This file contains thumbnails for the document\n         pages.\n       \\item[SHARED_ANNO] This file contains annotations shared by\n         all the pages. It's supposed to be included into every page\n         for the annotations to take effect. There may be only one\n         file with shared annotations in a document.\n     \\end{description} */\n  enum FILE_TYPE { INCLUDE=0, PAGE=1, THUMBNAILS=2, SHARED_ANNO=3 };\nprotected:\n  /** Default constructor. */\n  File(void);\n\npublic:\n  static GP<File> create(void) { return new File(); }\n  static GP<File> create(const GUTF8String &load_name,\n     const GUTF8String &save_name, const GUTF8String &title,\n     const FILE_TYPE file_type);\n\n  /** Check for filenames that are not valid for the native encoding,\n      and change them. */\n  const GUTF8String &check_save_name(const bool as_bundled);\n\n  /** File name.  The optional file name must be unique and is the name\n      that will be used when the document is saved to an indirect file.\n      If not assigned, the value of #id# will be used for this purpose.\n      By keeping the name in {\\em bundled} document we guarantee, that it\n      can be expanded later into {\\em indirect} document and files will\n      still have the same names, if the name is legal on a given filesystem.\n    */\n  const GUTF8String &get_save_name(void) const;\n\n  /** File identifier.  The encoder assigns a unique identifier to each file\n      in a multipage document. This is the name used when loading files.\n      Indirection chunks in other files (#\"INCL\"# chunks) may refer to another\n      file using its identifier. */\n  const GUTF8String &get_load_name(void) const;\n  void set_load_name(const GUTF8String &id);\n\n  /** File title.  The file title is assigned by the user and may be used as\n      a shortcut for viewing a particular page.  Names like #\"chapter1\"# or\n      #\"appendix\"# are appropriate. */\n  const GUTF8String &get_title() const;\n  void set_title(const GUTF8String &id);\n\n  /** Reports an ascii string indicating file type. */\n  GUTF8String get_str_type(void) const;\n\n  /** Offset of the file data in a bundled DJVM file.  This number is\n      relevant in the {\\em bundled} case only when everything is packed into\n      one single file. */\n  int offset;\n\n  /** Size of the file data in a bundled DJVM file.  This number is\n      relevant in the {\\em bundled} case only when everything is\n      packed into one single file. */\n  int size;\n\n  /** Have we checked the saved file name, to see if it is valid on the\n      local disk? */\n  bool valid_name;\n\n  /** Tests if this file represents a page of the document. */\n  bool is_page(void) const \n  {\n    return (flags & TYPE_MASK)==PAGE;\n  }\n\n  /** Returns #TRUE# if this file is included into some other files of\n      this document. */\n  bool is_include(void) const\n  {\n    return (flags & TYPE_MASK)==INCLUDE;\n  }\n\n  /** Returns #TRUE# if this file contains thumbnails for the document pages. */\n  bool is_thumbnails(void) const\n  {\n    return (flags & TYPE_MASK)==THUMBNAILS;\n  }\n\n  /** Returns the page number of this file. This function returns\n      #-1# if this file does not represent a page of the document. */\n  bool is_shared_anno(void) const\n  { return (flags & TYPE_MASK)==SHARED_ANNO; }\n\n  int get_page_num(void) const \n  { return page_num; } \nprotected:\n  GUTF8String name;\n  GUTF8String oldname;\n  GUTF8String id;\n  GUTF8String title; \n  void set_save_name(const GUTF8String &name);\nprivate:\n      friend class DjVmDir;\n      enum FLAGS_0 { IS_PAGE_0=1, HAS_NAME_0=2, HAS_TITLE_0=4 };\n      enum FLAGS_1 { HAS_NAME=0x80, HAS_TITLE=0x40, TYPE_MASK=0x3f };\n      unsigned char flags;\n      int page_num;\n};\n\ninline const GUTF8String &\nDjVmDir::File::get_load_name(void) const\n{ return id; }\n\ninline const GUTF8String &\nDjVmDir::File::get_title() const\n{ return *(title.length()?&title:&id); }\n\ninline void\nDjVmDir::File::set_title(const GUTF8String &xtitle) { title=xtitle; }\n\n/** @name Format of the DIRM chunk.\n\n    {\\bf Variants} --- There are two versions of the #\"DIRM\"# chunk format.\n    The version number is identified by the seven low bits of the first byte\n    of the chunk.  Version {\\bf 0} is obsolete and should never be used.  This\n    section describes version {\\bf 1}.  There are two major multipage DjVu\n    formats supported: {\\em bundled} and {\\em indirect}.  The #\"DIRM\"# chunk\n    indicates which format is used in the most significant bit of the first\n    byte of the chunk.  The document is bundled when this bit is set.\n    Otherwise the document is indirect.\n\n    {\\bf Unencoded data} --- The #\"DIRM\"# chunk is composed some unencoded\n    data followed by \\Ref{bzz} encoded data.  The unencoded data starts with\n    the version byte and a 16 bit integer representing the number of component\n    files.  All integers are encoded with the most significant byte first.\n    \\begin{verbatim}\n          BYTE:             Flags/Version:  0x<bundled>0000011\n          INT16:            Number of component files.\n    \\end{verbatim}\n    When the document is a bundled document (i.e. the flag #bundled# is set),\n    this header is followed by the offsets of each of the component files within\n    the #\"FORM:DJVM\"#.  These offsets allow for random component file access.\n    \\begin{verbatim}\n          INT32:            Offset of first component file.\n          INT32:            Offset of second component file.\n          ...\n          INT32:            Offset of last component file.\n    \\end{verbatim}\n\n    {\\bf BZZ encoded data} --- The rest of the chunk is entirely compressed\n    with the BZZ general purpose compressor.  We describe now the data fed\n    into (or retrieved from) the BZZ codec (cf. \\Ref{BSByteStream}.)  First\n    come the sizes and the flags associated with each component file.\n    \\begin{verbatim}\n          INT24:             Size of the first component file.\n          INT24:             Size of the second component file.\n          ...\n          INT24:             Size of the last component file.\n          BYTE:              Flag byte for the first component file.\n          BYTE:              Flag byte for the second component file.\n          ...\n          BYTE:              Flag byte for the last component file.\n    \\end{verbatim}\n    The flag bytes have the following format:\n    \\begin{verbatim}\n          0b<hasname><hastitle>000000     for a file included by other files.\n          0b<hasname><hastitle>000001     for a file representing a page.\n          0b<hasname><hastitle>000010     for a file containing thumbnails.\n    \\end{verbatim}\n    Flag #hasname# is set when the name of the file is different from the file\n    ID.  Flag #hastitle# is set when the title of the file is different from\n    the file ID.  These flags are used to avoid encoding the same string three\n    times.  Then come a sequence of zero terminated strings.  There are one to\n    three such strings per component file.  The first string contains the ID\n    of the component file.  The second string contains the name of the\n    component file.  It is only present when the flag #hasname# is set. The third\n    one contains the title of the component file. It is only present when the\n    flag #hastitle# is set. The \\Ref{bzz} encoding system makes sure that \n    all these strings will be encoded efficiently despite their possible\n    redundancies.\n    \\begin{verbatim}\n          ZSTR:     ID of the first component file.\n          ZSTR:     Name of the first component file (only if #hasname# is set.)\n          ZSTR:     Title of the first component file (only if #hastitle# is set.)\n          ... \n          ZSTR:     ID of the last component file.\n          ZSTR:     Name of the last component file (only if #hasname# is set.)\n          ZSTR:     Title of the last component file (only if #hastitle# is set.)\n    \\end{verbatim}\n\n    @memo Description of the format of the DIRM chunk.  */\n//@}\n\n\n\n// -------------- IMPLEMENTATION\n\n\ninline bool\nDjVmDir::is_bundled(void) const\n{\n  return ! is_indirect();\n}\n\ninline bool\nDjVmDir::is_indirect(void) const\n{\n  GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n  return ( files_list.size() && files_list[files_list] != 0 &&\n           files_list[files_list]->offset==0 );\n}\n\n\n\n// ----- THE END\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVmDir0.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"DjVmDir0.h\"\n#include \"ByteStream.h\"\n#include \"debug.h\"\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nint\nDjVmDir0::get_size(void) const\n      // WARNING! make sure, that get_size(), encode() and decode() are in sync\n{\n   int size=0;\n\n   size+=2;\t// number of files\n   for(int i=0;i<num2file.size();i++)\n   {\n      FileRec & file=*num2file[i];\n      size+=file.name.length()+1;\t// file name\n      size+=1;\t\t\t\t// is IFF file\n      size+=4;\t\t\t\t// file offset\n      size+=4;\t\t\t\t// file size\n   };\n\n   return size;\n}\n\n#ifndef NEED_DECODER_ONLY\nvoid\nDjVmDir0::encode(ByteStream & bs)\n      // WARNING! make sure, that get_size(), encode() and decode() are in sync\n{\n   bs.write16(num2file.size());\n   for(int i=0;i<num2file.size();i++)\n   {\n      FileRec & file=*num2file[i];\n      bs.writestring(file.name);\n      bs.write8(0);\n      bs.write8(file.iff_file);\n      bs.write32(file.offset);\n      bs.write32(file.size);\n   }\n}\n#endif\n\nvoid\nDjVmDir0::decode(ByteStream & bs)\n      // WARNING! make sure, that get_size(), encode() and decode() are in sync\n{\n   name2file.empty();\n   num2file.empty();\n\n   for(int i=bs.read16();i>0;i--)\n   {\n      GUTF8String name;\n      char ch;\n      while(bs.read(&ch, 1) && ch) name+=ch;\n      bool iff_file=bs.read8()?true:false;\n      int offset=bs.read32();\n      int size=bs.read32();\n      add_file(name, iff_file, offset, size);\n   };\n}\n\nGP<DjVmDir0::FileRec>\nDjVmDir0::get_file(const GUTF8String &name)\n{\n   if (name2file.contains(name))\n     return name2file[name];\n   return 0;\n}\n\nGP<DjVmDir0::FileRec>\nDjVmDir0::get_file(int file_num)\n{\n   if (file_num<num2file.size()) return num2file[file_num];\n   return 0;\n}\n\nvoid\nDjVmDir0::add_file(\n  const GUTF8String &name, bool iff_file, int offset, int size)\n{\n   DEBUG_MSG(\"DjVmDir0::add_file(): name='\" << name << \"', iff=\" << iff_file <<\n\t     \", offset=\" << offset << \"\\n\");\n   \n   if (name.search('/') >= 0)\n     G_THROW( ERR_MSG(\"DjVmDir0.no_slash\") );\n   \n   GP<FileRec> file=new FileRec(name, iff_file, offset, size);\n   name2file[name]=file;\n   num2file.resize(num2file.size());\n   num2file[num2file.size()-1]=file;\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVmDir0.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _DJVMDIR0_H\n#define _DJVMDIR0_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n#include \"GString.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass ByteStream;\n\n/** @name DjVmDir0.h\n\n    Files #\"DjVmDir0.h\"# and #\"DjVmDir0.cpp\"# contain implementation of\n    \\Ref{DjVmDir0} class responsible for reading and writing the directory\n    of a multipage all-in-one-file DjVu document (usually referred to as\n    {\\bf DjVm} document.\n\n    This is {\\bf not} a navigation directory, which lists all the pages\n    in a multipage document. The navigation directory is supported by class\n    \\Ref{DjVuNavDir}. This is the directory of a DjVm archive.\n    \n\n    @memo Directory of DjVu all-in-one-file DjVu documents.\n    @author Andrei Erofeev <eaf@geocities.com>\n*/\n\n//@{\n\n/** Directory of all-in-one-file DjVu documents (also known as DjVm documents).\n    This class can read and write the directory (table of contents, in other\n    words) of a DjVm document. This table of contents lists all {\\bf files}\n    included into the document, not {\\bf pages} like \\Ref{DjVuNavDir} does.\n    It is normally stored in the document inside {\\bf DIR0} chunk where\n    {\\bf \"0\"} refers to the version number.\n\n    An object of this class can be created either as a result of the decoding\n    of an existing DjVm file, or manually by calling the default constructor\n    and adding later directory entries by means of \\Ref{add_file}() function.\n\n    You normally will not want to create or decode this directory manually.\n    \\Ref{DjVmFile} class will do it for you. */\nclass DjVmDir0 : public GPEnabled\n{\npublic:\n      /** Describes a file record inside a DjVm document (archive) */\n   class FileRec;\nprivate:\n   GMap<GUTF8String, GP<FileRec> >\tname2file;\n   GPArray<FileRec>\t\tnum2file;\nprotected:\n      /// Default constructor\n   DjVmDir0(void) {};\npublic:\n      /// Copy constructor\n   DjVmDir0(const DjVmDir0 & d);\n\n   static GP<DjVmDir0> create(void) {return new DjVmDir0;}\n\n   virtual ~DjVmDir0(void) {};\n\n      /// Returns the number of files in the DjVm archive\n   int\t\tget_files_num(void) const;\n   \n      /// Returns the file record with name #name#\n   GP<FileRec>\tget_file(const GUTF8String &name);\n\n      /// Returns the file record number #file_num#\n   GP<FileRec>\tget_file(int file_num);\n\n      /** Creates a new file record with name #name# at offset\n\t  #offset# and size #size#, which is in IFF format if\n\t  #iff_file# is #TRUE#. */\n   void\t\tadd_file(const GUTF8String &name, bool iff_file,\n\t\t\t int offset=-1, int size=-1);\n\n      /// Returns the size of the directory if it were encoded in #DIR0# chunk\n   int\t\tget_size(void) const;\n\n      /** Encodes the directory in #DIR0# chunk into the specified\n\t  \\Ref{ByteStream} */\n   void\t\tencode(ByteStream & bs);\n\n      /** Decodes the directory from #DIR0# chunk from the specified\n\t  \\Ref{ByteStream} */\n   void\t\tdecode(ByteStream & bs);\n\n};\n\n      /** Describes a file record inside a DjVm document (archive) */\nclass DjVmDir0::FileRec : public GPEnabled\n{\npublic:\n  /// Name of the file.\n  GUTF8String\t\tname;\n  /// 1 if the file is in IFF format.\n  bool\t\tiff_file;\n  /// Offset of the file in the archive.\n  int\t\toffset;\n  /// Size of the file\n  int\t\tsize;\n\n  friend int\toperator==(const FileRec & f1, const FileRec & f2);\n\n  /// Constructs the #FileRec# object\n  FileRec(const GUTF8String &name, bool iff_file,\n\t      int offset=-1, int size=-1);\n  /// Default constructor\n  FileRec(void);\n  virtual ~FileRec(void);\n};\n\ninline\nDjVmDir0::FileRec::FileRec(\n  const GUTF8String &name_in, bool iff_file_in, int offset_in, int size_in)\n: name(name_in), iff_file(iff_file_in), offset(offset_in), size(size_in)\n{\n}\n\ninline\nDjVmDir0::FileRec::FileRec(void) : iff_file(0), offset(-1), size(-1)\n{\n}\n\ninline\nDjVmDir0::FileRec::~FileRec(void)\n{\n}\n\ninline int\nDjVmDir0::get_files_num(void) const\n{\n   return num2file.size();\n}\n\ninline\nDjVmDir0::DjVmDir0(const DjVmDir0 & d) :\n      name2file(d.name2file), num2file(d.num2file)\n{\n}\n\n//@}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVmDoc.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"DjVmDoc.h\"\n#include \"DjVmNav.h\"\n#include \"DataPool.h\"\n#include \"IFFByteStream.h\"\n#include \"GOS.h\"\n#include \"debug.h\"\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nstatic const char octets[4]={0x41,0x54,0x26,0x54};\n\n// Save the file to disk, remapping INCL chunks while saving.\nstatic void\nsave_file(\n  IFFByteStream &iff_in, IFFByteStream &iff_out, const DjVmDir &dir,\n  GMap<GUTF8String,GUTF8String> &incl)\n{\n  GUTF8String chkid;\n  if (iff_in.get_chunk(chkid))\n  {\n    iff_out.put_chunk(chkid,true);\n    if(!chkid.cmp(\"FORM:\",5))\n    {\n      for(;iff_in.get_chunk(chkid);iff_in.close_chunk())\n      {\n        iff_out.put_chunk(chkid);\n        if(chkid == \"INCL\")\n        {\n          GUTF8String incl_str;\n          char buffer[1024];\n          int length;\n          while((length=iff_in.read(buffer, 1024)))\n            incl_str+=GUTF8String(buffer, length);\n          // Eat '\\n' in the beginning and at the end\n          while(incl_str.length() && incl_str[0]=='\\n')\n          {\n            incl_str=incl_str.substr(1,(unsigned int)(-1));\n          }\n          while(incl_str.length()>0 && incl_str[(int)incl_str.length()-1]=='\\n')\n          {\n            incl_str.setat(incl_str.length()-1, 0);\n          }\n          GPosition pos=incl.contains(incl_str);\n          if(pos)\n          { \n            iff_out.get_bytestream()->writestring(incl[pos]);\n          }else\n          {\n            GP<DjVmDir::File> incl_file=dir.id_to_file(incl_str); \n            if(incl_file)\n            {\n              DEBUG_MSG(\"INCL '\"<<(const char *)incl_file->get_save_name()<<\"'\\n\");\n              const GUTF8String incl_name=incl_file->get_save_name();\n              incl[incl_str]=incl_name;\n              iff_out.get_bytestream()->writestring(incl_name);\n            }else\n            {\n              DEBUG_MSG(\"BOGUS INCL '\"<<(const char *)incl_str<<\"'\\n\");\n              iff_out.copy(*iff_in.get_bytestream());\n            }\n          }\n        }else\n        {\n          iff_out.copy(*iff_in.get_bytestream());\n        }\n        iff_out.close_chunk();\n      }\n    }else\n    {\n      iff_out.copy(*iff_in.get_bytestream());\n    }\n    iff_out.close_chunk();\n    iff_in.close_chunk();\n  }\n}\n\nDjVmDoc::DjVmDoc(void)\n{\n   DEBUG_MSG(\"DjVmDoc::DjVmDoc(): Constructing empty DjVm document.\\n\");\n   DEBUG_MAKE_INDENT(3);\n}\n\nvoid\nDjVmDoc::init(void)\n{\n  dir=DjVmDir::create();\n}\n\nGP<DjVmDoc>\nDjVmDoc::create(void)\n{\n  DjVmDoc *doc=new DjVmDoc();\n  GP<DjVmDoc> retval=doc;\n  doc->init();\n  return retval;\n}\n\nvoid\nDjVmDoc::insert_file(const GP<DjVmDir::File> & f,\n\t\t     GP<DataPool> data_pool, int pos)\n{\n   DEBUG_MSG(\"DjVmDoc::insert_file(): inserting file '\" << f->get_load_name() <<\n\t     \"' at pos \" << pos << \"\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   if (!f)\n     G_THROW( ERR_MSG(\"DjVmDoc.no_zero_file\") );\n   if (data.contains(f->get_load_name()))\n     G_THROW( ERR_MSG(\"DjVmDoc.no_duplicate\") );\n\n   char buffer[4];\n   if (data_pool->get_data(buffer, 0, 4)==4 && !memcmp(buffer, octets, 4))\n   {\n      data_pool=DataPool::create(data_pool, 4, -1);\n   } \n   data[f->get_load_name()]=data_pool;\n   dir->insert_file(f, pos);\n}\n\nvoid\nDjVmDoc::insert_file(\n  ByteStream &data, DjVmDir::File::FILE_TYPE file_type,\n  const GUTF8String &name, const GUTF8String &id, const GUTF8String &title,\n  int pos)\n{\n   const GP<DjVmDir::File> file(\n     DjVmDir::File::create(name, id, title, file_type));\n   const GP<DataPool> pool(DataPool::create());\n      // Cannot connect to a bytestream.\n      // Must copy data into the datapool.\n   int nbytes;\n   char buffer[1024];\n   while ((nbytes = data.read(buffer, sizeof(buffer))))\n      pool->add_data(buffer, nbytes);\n   pool->set_eof();\n      // Call low level insert\n   insert_file(file, pool, pos);\n}\n\nvoid\nDjVmDoc::insert_file(\n  const GP<DataPool> &pool, DjVmDir::File::FILE_TYPE file_type,\n  const GUTF8String &name, const GUTF8String &id, const GUTF8String &title,\n  int pos)\n{\n   const GP<DjVmDir::File> file(\n     DjVmDir::File::create(name, id, title, file_type));\n      // Call low level insert\n   insert_file(file, pool, pos);\n}\n\nvoid\nDjVmDoc::delete_file(const GUTF8String &id)\n{\n   DEBUG_MSG(\"DjVmDoc::delete_file(): deleting file '\" << id << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n   \n   if (!data.contains(id))\n      G_THROW(GUTF8String( ERR_MSG(\"DjVmDoc.cant_delete\") \"\\t\") + id);\n   \n   data.del(id);\n   dir->delete_file(id);\n}\n\nvoid \nDjVmDoc::set_djvm_nav(GP<DjVmNav> n)\n{\n  if (n && ! n->isValidBookmark())\n    G_THROW(\"Invalid bookmark data\");\n  nav = n;\n}\n\nGP<DataPool>\nDjVmDoc::get_data(const GUTF8String &id) const\n{\n  GPosition pos;\n  if (!data.contains(id, pos))\n    G_THROW(GUTF8String( ERR_MSG(\"DjVmDoc.cant_find\") \"\\t\") + id);\n  const GP<DataPool> pool(data[pos]);\n   // First check that the file is in IFF format\n  G_TRY\n  {\n    const GP<ByteStream> str_in(pool->get_stream());\n    const GP<IFFByteStream> giff_in=IFFByteStream::create(str_in);\n    IFFByteStream &iff_in=*giff_in;\n    GUTF8String chkid;\n    int size=iff_in.get_chunk(chkid);\n    if (size<0 || size>0x7fffffff)\n      G_THROW( ERR_MSG(\"DjVmDoc.not_IFF\") \"\\t\" + id);\n  }\n  G_CATCH_ALL \n  {\n    G_THROW( ERR_MSG(\"DjVmDoc.not_IFF\") \"\\t\" + id);\n  }\n  G_ENDCATCH;\n  return pool;\n}\n\nvoid\nDjVmDoc::write(const GP<ByteStream> &gstr)\n{\n  const GMap<GUTF8String,void *> reserved;\n  write(gstr,reserved);\n}\n\nstatic inline GUTF8String\nget_name(const DjVmDir::File &file)\n{\n  const GUTF8String save_name(file.get_save_name());\n  return save_name.length()?save_name:(file.get_load_name());\n}\n\nvoid\nDjVmDoc::write(const GP<ByteStream> &gstr,\n               const GMap<GUTF8String,void *> &reserved)\n{\n  DEBUG_MSG(\"DjVmDoc::write(): Storing document into the byte stream.\\n\");\n  DEBUG_MAKE_INDENT(3);\n\n  GPList<DjVmDir::File> files_list=dir->resolve_duplicates(true);\n  bool do_rename=false;\n  GPosition pos(reserved);\n\n  GMap<GUTF8String,GUTF8String> incl;\n  DEBUG_MSG(\"pass 1: looking for reserved names.\");\n  if(pos)\n  {\n      // Check if there are any conflicting file names.\n    for(pos=files_list;pos;++pos)\n    {\n      GP<DjVmDir::File> file=files_list[pos];\n      if((do_rename=(reserved.contains(file->get_load_name())?true:false))\n\t\t  ||(do_rename=(reserved.contains(file->get_save_name())?true:false)))\n      {\n        break;\n      }\n    }\n    // If there are conflicting file names, check if the save names\n    // are OK.  If not, generate new save names.\n    if(do_rename)\n    {\n      DEBUG_MSG(\"pass 1: renaming reserved names.\");\n      for(;;files_list=dir->resolve_duplicates(true))\n      {\n        GMap<GUTF8String,void *> this_doc;\n        for(pos=files_list;pos;++pos)\n        {\n          GP<DjVmDir::File> file=files_list[pos];\n          this_doc[::get_name(*file)]=0;\n        }\n        bool need_new_list=false;\n        for(pos=files_list;pos;++pos)\n        {\n          GP<DjVmDir::File> file=files_list[pos];\n          const GUTF8String name(::get_name(*file));\n          if(reserved.contains(name))\n          {\n            GUTF8String new_name;\n            int series=0;\n            do\n            {\n              int dot=name.rsearch('.');\n              if(dot>0)\n              {\n                new_name=name.substr(0,dot)+\n                  \"_\"+GUTF8String(++series)+name.substr(dot,-1);\n              }else\n              {\n                new_name=name+\"_\"+GUTF8String(++series);\n              }\n            } while(reserved.contains(new_name)||this_doc.contains(new_name));\n            dir->set_file_name(file->get_load_name(),new_name);\n            need_new_list=true;\n          }\n        }\n        if(!need_new_list)\n          break;\n      }\n    }\n  }\n\n  DEBUG_MSG(\"pass 2: create dummy DIRM chunk and calculate offsets...\\n\");\n  for(pos=files_list;pos;++pos)\n  {\n    GP<DjVmDir::File> file=files_list[pos];\n    file->offset=0xffffffff;\n    GPosition data_pos=data.contains(file->get_load_name());\n    if (!data_pos)\n      G_THROW( ERR_MSG(\"DjVmDoc.no_data\") \"\\t\" + file->get_load_name());\n    if(do_rename)\n    {\n      GP<ByteStream> gout(ByteStream::create());\n      {\n        const GP<IFFByteStream> giff_in(\n          IFFByteStream::create(data[data_pos]->get_stream()));\n        const GP<IFFByteStream> giff_out(IFFByteStream::create(gout));\n        ::save_file(*giff_in,*giff_out,*dir,incl);\n      }\n      gout->seek(0L);\n      data[data_pos]=DataPool::create(gout);\n    }\n    file->size=data[data_pos]->get_length();\n    if (!file->size)\n      G_THROW( ERR_MSG(\"DjVmDoc.zero_file\") );\n  }\n   \n  const GP<ByteStream> tmp_str(ByteStream::create());\n  const GP<IFFByteStream> gtmp_iff(IFFByteStream::create(tmp_str));\n  IFFByteStream &tmp_iff=*gtmp_iff;\n  tmp_iff.put_chunk(\"FORM:DJVM\", 1);\n  tmp_iff.put_chunk(\"DIRM\");\n  dir->encode(tmp_iff.get_bytestream(),do_rename);\n  tmp_iff.close_chunk();\n  if (nav)\n    {\n      tmp_iff.put_chunk(\"NAVM\");\n      nav->encode(tmp_iff.get_bytestream());\n      tmp_iff.close_chunk();\n    }\n  tmp_iff.close_chunk();\n  int offset=tmp_iff.tell();\n\n  for(pos=files_list;pos;++pos)\n  {\n    if ((offset & 1)!=0)\n      offset++;\n      \n    GP<DjVmDir::File> & file=files_list[pos];\n    file->offset=offset;\n    offset+=file->size;\t// file->size has been set in the first pass\n  }\n\n  DEBUG_MSG(\"pass 3: store the file contents.\\n\");\n\n  GP<IFFByteStream> giff=IFFByteStream::create(gstr);\n  IFFByteStream &iff=*giff;\n  iff.put_chunk(\"FORM:DJVM\", 1);\n  iff.put_chunk(\"DIRM\");\n  dir->encode(iff.get_bytestream(),do_rename);\n  iff.close_chunk();\n  if (nav)\n    {\n      iff.put_chunk(\"NAVM\");\n      nav->encode(iff.get_bytestream());\n      iff.close_chunk();\n    }\n\n  for(pos=files_list;pos;++pos)\n  {\n    GP<DjVmDir::File> & file=files_list[pos];\n\n    const GP<DataPool> pool=get_data(file->get_load_name());\n    const GP<ByteStream> str_in(pool->get_stream());\n    if ((iff.tell() & 1)!=0)\n    {\n      iff.get_bytestream()->write8(0);\n    }\n    iff.copy(*str_in);\n  }\n\n  iff.close_chunk();\n  iff.flush();\n\n  DEBUG_MSG(\"done storing DjVm file.\\n\");\n}\n\nvoid\nDjVmDoc::read(const GP<DataPool> & pool)\n{\n   DEBUG_MSG(\"DjVmDoc::read(): reading the BUNDLED doc contents from the pool\\n\");\n   DEBUG_MAKE_INDENT(3);\n   \n   const GP<ByteStream> str(pool->get_stream());\n   \n   GP<IFFByteStream> giff=IFFByteStream::create(str);\n   IFFByteStream &iff=*giff;\n   GUTF8String chkid;\n   iff.get_chunk(chkid);\n   if (chkid!=\"FORM:DJVM\")\n      G_THROW( ERR_MSG(\"DjVmDoc.no_form_djvm\") );\n\n   iff.get_chunk(chkid);\n   if (chkid!=\"DIRM\")\n      G_THROW( ERR_MSG(\"DjVmDoc.no_dirm_chunk\") );\n   dir->decode(iff.get_bytestream());\n   iff.close_chunk();\n\n   data.empty();\n\n   if (dir->is_indirect())\n      G_THROW( ERR_MSG(\"DjVmDoc.cant_read_indr\") );\n\n   GPList<DjVmDir::File> files_list=dir->get_files_list();\n   for(GPosition pos=files_list;pos;++pos)\n   {\n      DjVmDir::File * f=files_list[pos];\n      \n      DEBUG_MSG(\"reading contents of file '\" << f->get_load_name() << \"'\\n\");\n      data[f->get_load_name()]=DataPool::create(pool, f->offset, f->size);\n   }\n}\n\nvoid\nDjVmDoc::read(ByteStream & str_in)\n{\n   DEBUG_MSG(\"DjVmDoc::read(): reading the BUNDLED doc contents from the stream\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   GP<DataPool> pool=DataPool::create();\n   char buffer[1024];\n   int length;\n   while((length=str_in.read(buffer, 1024)))\n      pool->add_data(buffer, length);\n   pool->set_eof();\n\n   read(pool);\n}\n\nvoid\nDjVmDoc::read(const GURL &url)\n{\n   DEBUG_MSG(\"DjVmDoc::read(): reading the doc contents from the HDD\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   GP<DataPool> pool=DataPool::create(url);\n   const GP<ByteStream> str(pool->get_stream());\n   GP<IFFByteStream> giff=IFFByteStream::create(str);\n   IFFByteStream &iff=*giff;\n   GUTF8String chkid;\n   iff.get_chunk(chkid);\n   if (chkid!=\"FORM:DJVM\")\n      G_THROW( ERR_MSG(\"DjVmDoc.no_form_djvm2\") );\n\n   iff.get_chunk(chkid);\n   if (chkid!=\"DIRM\")\n      G_THROW( ERR_MSG(\"DjVmDoc.no_dirm_chunk\") );\n   dir->decode(iff.get_bytestream());\n   iff.close_chunk();\n\n   if (dir->is_bundled())\n     read(pool);\n   else\n   {\n//      GUTF8String full_name=GOS::expand_name(name);\n//      GUTF8String dir_name=GOS::dirname(GOS::url_to_filename(url.base()));\n      GURL dirbase=url.base();\n\n      data.empty();\n\n      GPList<DjVmDir::File> files_list=dir->get_files_list();\n      for(GPosition pos=files_list;pos;++pos)\n      {\n\t DjVmDir::File * f=files_list[pos];\n      \n\t DEBUG_MSG(\"reading contents of file '\" << f->get_load_name() << \"'\\n\");\n\n         const GURL::UTF8 url(f->get_load_name(),dirbase);\n\t data[f->get_load_name()]=DataPool::create(url);\n      }\n   }\n}\n\nvoid\nDjVmDoc::write_index(const GP<ByteStream> &str)\n{\n   DEBUG_MSG(\"DjVmDoc::write_index(): Storing DjVm index file\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   GPList<DjVmDir::File> files_list=dir->get_files_list();\n   for(GPosition pos=files_list;pos;++pos)\n   {\n      GP<DjVmDir::File> file=files_list[pos];\n      file->offset=0;\n\n      GPosition data_pos=data.contains(file->get_load_name());\n      if (!data_pos)\n\tG_THROW( ERR_MSG(\"DjVmDoc.no_data\") \"\\t\" + file->get_load_name());\n      file->size=data[data_pos]->get_length();\n      if (!file->size)\n        G_THROW( ERR_MSG(\"DjVmDoc.zero_file\") );\n   }\n\n   GP<IFFByteStream> giff=IFFByteStream::create(str);\n   IFFByteStream &iff=*giff;\n   iff.put_chunk(\"FORM:DJVM\", 1);\n   iff.put_chunk(\"DIRM\");\n   dir->encode(iff.get_bytestream());\n   iff.close_chunk();\n   if (nav)\n     {\n       iff.put_chunk(\"NAVM\");\n       nav->encode(iff.get_bytestream());\n       iff.close_chunk();\n     }\n   iff.close_chunk();\n   iff.flush();\n}\n\nvoid\nDjVmDoc::save_page(\n  const GURL &codebase, const DjVmDir::File &file) const\n{\n  GMap<GUTF8String,GUTF8String> incl;\n  save_file(codebase,file,&incl);\n}\n\nvoid\nDjVmDoc::save_page(\n  const GURL &codebase, const DjVmDir::File &file,\n  GMap<GUTF8String,GUTF8String> &incl ) const\n{\n  save_file(codebase,file,&incl);\n}\n\nvoid\nDjVmDoc::save_file(\n  const GURL &codebase, const DjVmDir::File &file) const\n{\n  save_file(codebase,file,0);\n}\n\nGUTF8String \nDjVmDoc::save_file(const GURL &codebase, const DjVmDir::File &file,\n  GMap<GUTF8String,GUTF8String> &incl, const GP<DataPool> &pool) const\n{\n  const GUTF8String save_name(file.get_save_name());\n  const GURL::UTF8 new_url(save_name,codebase);\n  DEBUG_MSG(\"storing file '\"<<new_url<<\"'\\n\");\n  DataPool::load_file(new_url);\n  const GP<ByteStream> str_in(pool->get_stream());\n  const GP<ByteStream> str_out(ByteStream::create(new_url, \"wb\"));\n  ::save_file( *IFFByteStream::create(str_in),\n      *IFFByteStream::create(str_out), *dir, incl);\n  return save_name;\n}\n\nvoid\nDjVmDoc::save_file(\n  const GURL &codebase, const DjVmDir::File &file,\n  GMap<GUTF8String,GUTF8String> *incl) const\n{\n  const GUTF8String load_name=file.get_load_name();\n  if(!incl || !incl->contains(load_name))\n  {\n    GMap<GUTF8String,GUTF8String> new_incl;\n    const GUTF8String save_name(\n      save_file(codebase,file,new_incl,get_data(load_name)));\n\n    if(incl)\n    {\n      (*incl)[load_name]=save_name;\n      for(GPosition pos=new_incl;pos;++pos)\n      {\n        save_file(codebase,file,incl);\n      }\n    }\n  }\n}\n\nvoid\nDjVmDoc::expand(const GURL &codebase, const GUTF8String &idx_name)\n{\n   DEBUG_MSG(\"DjVmDoc::expand(): Expanding into '\" << codebase << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   // Resolve any name conflicts\n   // Find the list of all files.\n   GPList<DjVmDir::File> files_list=dir->resolve_duplicates(false);\n\n      // store each file\n   for(GPosition pos=files_list;pos;++pos)\n   {\n     save_file(codebase,*files_list[pos]);\n   }\n\n   if (idx_name.length())\n   {\n      const GURL::UTF8 idx_url(idx_name, codebase);\n   \n      DEBUG_MSG(\"storing index file '\" << idx_url << \"'\\n\");\n\n      DataPool::load_file(idx_url);\n      GP<ByteStream> str=ByteStream::create(idx_url, \"wb\");\n      write_index(str);\n   }\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVmDoc.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _DJVMDOC_H\n#define _DJVMDOC_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n#include \"DjVmDir.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass ByteStream;\nclass DataPool;\nclass GURL;\nclass GUTF8String;\nclass DjVmNav;\n\n/** @name DjVmDoc.h\n    Files #\"DjVmDoc.h\"# and #\"DjVmDoc.cpp\"# contain implementation of the\n    \\Ref{DjVmDoc} class used to read and write new DjVu multipage documents.\n\n    @memo DjVu multipage documents reader/writer.\n    @author Andrei Erofeev <eaf@geocities.com>\n*/\n\n//@{\n\n/** Read/Write DjVu multipage documents.\n\n    The \"new\" DjVu multipage documents can be of two types: {\\em bundled} and\n    {\\em indirect}. In the first case all pages are packed into one file,\n    which is very like an archive internally. In the second case every page\n    is stored in a separate file. Plus there can be other components,\n    included into one or more pages, which also go into separate files. In\n    addition to pages and components, in the case of the {\\em indirect} format\n    there is one more top-level file with the document directory (see\n    \\Ref{DjVmDir}), which is basically an index file containing the\n    list of all files composing the document.\n\n    This class can read documents of both formats and can save them under any\n    format.  It is therefore ideal for converting between {\\em bundled} and\n    {\\em indirect} formats.  It cannot be used however for reading obsolete\n    formats.  The best way to convert obsolete formats consists in reading\n    them with class \\Ref{DjVuDocument} class and saving them using\n    \\Ref{DjVuDocument::write} or \\Ref{DjVuDocument::expand}.\n\n    This class can also be used to create and modify multipage documents at\n    the low level without decoding every page or component (See\n    \\Ref{insert_file}() and \\Ref{delete_file}()). \n*/\n\nclass DJVUAPI DjVmDoc : public GPEnabled\n{\n      // Internal function.\nprotected:   \n  DjVmDoc(void);\n  void init(void);\npublic:\n      /// Creator\n   static GP<DjVmDoc> create(void);\n      /** Inserts a file into the document.\n          @param data  ByteStream containing the file data.\n          @param file_type Describes the type of the file to be inserted.\n\t  \t See \\Ref{DjVmDir::File} for details.\n          @param name  Name of the file in the document (e.g. an URL).\n          @param id    Identifier of the file (as used in INCL chunks).\n          @param title Optional title of the file (shown in browsers).\n          @param pos   Position of the file in the document (default is append).\n      */\n   void\tinsert_file(\n     ByteStream &data, DjVmDir::File::FILE_TYPE file_type,\n     const GUTF8String &name, const GUTF8String &id,\n     const GUTF8String &title=GUTF8String(), int pos=-1 );\n      /** Inserts a file into the document.\n          @param pool  Data pool containing file data.\n          @param file_type Describes the type of the file to be inserted.\n\t  \t See \\Ref{DjVmDir::File} for details.\n          @param name  Name of the file in the document (e.g. an URL).\n          @param id    Identifier of the file (as used in INCL chunks).\n          @param title Optional title of the file (shown in browsers).\n          @param pos   Position of the file in the document (default is append).\n      */\n   void\tinsert_file(\n     const GP<DataPool> &pool, DjVmDir::File::FILE_TYPE file_type,\n     const GUTF8String &name, const GUTF8String &id,\n     const GUTF8String &title=GUTF8String(), int pos=-1 );\n\n      /** Inserts a file described by \\Ref{DjVmDir::File} structure with\n\t  data #data# at position #pos#. If #pos# is negative, the file\n          will be appended to the document. Otherwise it will be inserted\n          at position #pos#. */\n   void\tinsert_file(const GP<DjVmDir::File> & f,\n                    GP<DataPool> data, int pos=-1);\n\n      /** Removes file with the specified #id# from the document. Every\n\t  file inside a new DjVu multipage document has its unique ID\n\t  (refer to \\Ref{DjVmDir} for details), which is passed to this\n          function. */\n   void\tdelete_file(const GUTF8String &id);\n\n     /** Set the bookmarks */\n   void set_djvm_nav(GP<DjVmNav> n);\n\n      /** Returns the directory of the DjVm document (the one which will\n\t  be encoded into #DJVM# chunk of the top-level file or the bundle). */\n   GP<DjVmDir>\tget_djvm_dir(void);\n   \n      /** Returns contents of file with ID #id# from the document.\n\t  Please refer to \\Ref{DjVmDir} for the explanation of what\n          IDs mean. */\n   GP<DataPool>\tget_data(const GUTF8String &id) const;\n\n      /** Reading routines */\n      //@{\n      /** Reads contents of a {\\em bundled} multipage DjVu document from\n\t  the stream. */\n   void\tread(ByteStream & str);\n      /** Reads contents of a {\\em bundled} multipage DjVu document from\n\t  the \\Ref{DataPool}. */\n   void\tread(const GP<DataPool> & data_pool);\n      /** Reads the DjVu multipage document in either {\\em bundled} or\n\t  {\\em indirect} format.\n\n\t  {\\bf Note:} For {\\em bundled} documents the file is not\n\t  read into memory. We just open it and access data directly there.\n\t  Thus you should not modify the file contents.\n\n\t  @param name For {\\em bundled} documents this is the name\n\t         of the document. For {\\em indirect} documents this is\n\t\t the name of the top-level file of the document (containing\n\t\t the \\Ref{DjVmDir} with the list of all files).\n\t\t The rest of the files are expected to be in the\n\t\t same directory and will be read by this function as well. */\n   void\tread(const GURL &url);\n      //@}\n\n      /** Writing routines */\n      //@{\n      /** Writes the multipage DjVu document in the {\\em bundled} format into\n\t  the stream. */\n   void\twrite(const GP<ByteStream> &str);\n      /** Writes the multipage DjVu document in the {\\em bundled} format into\n\t  the stream, reserving any of the specified names. */\n   void\twrite(const GP<ByteStream> &str,\n              const GMap<GUTF8String,void *>& reserved);\n      /** Stored index (top-level) file of the DjVu document in the {\\em\n\t  indirect} format into the specified stream. */\n   void\twrite_index(const GP<ByteStream> &str);\n      /** Writes the multipage DjVu document in the {\\em indirect} format\n\t  into the given directory. Every page and included file will be\n          stored as a separate file. Besides, one top-level file with\n          the document directory (named #idx_name#) will be created unless\n\t  #idx_name# is empty.\n\n          @param dir_name Name of the directory where files should be\n\t\t created\n\t  @param idx_name Name of the top-level file with the \\Ref{DjVmDir}\n\t\t with the list of files composing the given document.\n\t\t If empty, the file will not be created. */\n   void\texpand(const GURL &codebase, const GUTF8String &idx_name);\n\n      /** Writes an individual file, and all included files. \n          INCL chunks will be remapped as appropriate. */\n   void save_page(const GURL &codebase, const DjVmDir::File &file) const;\n\n      /** Writes an individual file if not mapped, and all included files. \n          INCL chunks will be remapped as appropriate.  All pages saved\n          are added to the #incl# map. */\n   void save_page(const GURL &codebase, const DjVmDir::File &file,\n                  GMap<GUTF8String,GUTF8String> &incl) const;\n\n      /** Writes an individual file specified, remapping INCL chunks as\n          appropriate.  Included files will not be saved. */\n   void save_file(const GURL &codebase, const DjVmDir::File &file) const;\n\n      /** Writes the specified file from the given #pool#. */\n   GUTF8String save_file(const GURL &codebase, const DjVmDir::File &file,\n                         GMap<GUTF8String,GUTF8String> &incl, \n                         const GP<DataPool> &pool) const;\n  //@}\nprivate:\n   void save_file(const GURL &codebase, const DjVmDir::File &file,\n                  GMap<GUTF8String,GUTF8String> *incl) const;\n   GP<DjVmDir> dir;\n   GP<DjVmNav> nav;\n   GPMap<GUTF8String, DataPool > data;\nprivate: // dummy stuff\n   static void write(ByteStream *);\n   static void write_index(ByteStream *);\n};\n\ninline GP<DjVmDir>\nDjVmDoc::get_djvm_dir(void)\n{\n   return dir;\n}\n\n\n//@}\n\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVmNav.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include <ctype.h>\n\n#include \"DjVuDocument.h\"\n#include \"DjVmNav.h\"\n#include \"BSByteStream.h\"\n#include \"GURL.h\"\n#include \"debug.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\nGP<DjVmNav::DjVuBookMark>\nDjVmNav::DjVuBookMark::create(void)\n{\n  return new DjVuBookMark();\n}\n\nGP<DjVmNav::DjVuBookMark>\nDjVmNav::DjVuBookMark::create(const unsigned short count,\n                              const GUTF8String &displayname, \n                              const GUTF8String &url)\n{\n  DjVuBookMark *pvm=new DjVuBookMark();\n  GP<DjVuBookMark> bookmark=pvm;\n  pvm->count=count;\n  pvm->displayname=displayname;\n  pvm->url=url;\n  return bookmark;\n}   \n\nDjVmNav::DjVuBookMark::DjVuBookMark(void)\n  : count(0), displayname(), url()\n{ \n}\n\nGP<DjVmNav>\nDjVmNav::create(void)\n{\n  return new DjVmNav;\n}\n\n// Decode the input bytestream and populate this object\nvoid \nDjVmNav::DjVuBookMark::decode(const GP<ByteStream> &gstr)\n{\n  int textsize=0, readsize=0;\n  char *buffer=0;\n  ByteStream &bs=*gstr;\n  count = bs.read8();\n  displayname.empty();\n#ifdef DJVMNAV_WITH_256LIMIT\n  textsize = bs.read24();\n#else\n  int counthi = bs.read8();\n  count = (counthi<<8)+ count;\n  textsize = bs.read16();\n#endif\n  if (textsize)\n    {\n      buffer = displayname.getbuf(textsize);\n      readsize = bs.read(buffer,textsize);\n      buffer[readsize] = 0;\n    }\n  url.empty();\n  textsize = bs.read24();\n  if (textsize)\n    {\n      buffer = url.getbuf(textsize);\n      readsize = bs.read(buffer,textsize);\n      buffer[readsize] = 0;\n    }\n}\n\n// Serialize this object to the output bytestream\nvoid  \nDjVmNav::DjVuBookMark::encode(const GP<ByteStream> &gstr) \n{\n  int textsize=0;\n  ByteStream &bs=*gstr;\n#ifdef DJVMNAV_WITH_256LIMIT\n  if (count>255)\n    G_THROW(\"Excessive number of children in bookmark tree\");\n  bs.write8(count);\n  textsize = displayname.length();\n  bs.write24( textsize );\n#else\n  if (count>65535)\n    G_THROW(\"Excessive number of children in bookmark tree\");\n  bs.write8( count & 0xff );\n  bs.write8( (count>>8) & 0xff );\n  textsize = displayname.length();\n  bs.write16( textsize );\n#endif\n  bs.writestring(displayname);\n  textsize = url.length();\n  bs.write24( textsize );\n  bs.writestring(url);\n}\n\n// Text dump of this object to the output bytestream\nvoid \nDjVmNav::DjVuBookMark::dump(const GP<ByteStream> &gstr) \n{\n  int textsize=0;\n  ByteStream &bs=*gstr;\n  bs.format(\"\\n  count=%d\\n\",count);\n  textsize = displayname.length();\n  bs.format(\"  (%d) %s\\n\",textsize, displayname.getbuf());\n  textsize = url.length();\n  bs.format(\"  (%d) %s\\n\",textsize, url.getbuf());\n}\n\n// Decode the input bytestream and populate this object\nvoid \nDjVmNav::decode(const GP<ByteStream> &gstr)\n{\n  //ByteStream &str=*gstr;\n  GP<ByteStream> gpBSByteStream = BSByteStream::create(gstr);\n  GCriticalSectionLock lock(&class_lock);\n  bookmark_list.empty();\n  int nbookmarks=gpBSByteStream->read16();\n  if (nbookmarks)\n    {\n      for(int bookmark=0;bookmark<nbookmarks;bookmark++)\n        {\n          GP<DjVuBookMark> pBookMark=DjVuBookMark::create();\n          pBookMark->decode(gpBSByteStream);\n          bookmark_list.append(pBookMark);  \n        }\n    }\n}\n\n// Serialize this object to the output stream\nvoid \nDjVmNav::encode(const GP<ByteStream> &gstr)\n{\n  //ByteStream &str=*gstr;\n  GP<ByteStream> gpBSByteStream = BSByteStream::create(gstr, 1024);\n  GCriticalSectionLock lock(&class_lock);\n  int nbookmarks=bookmark_list.size();\n  gpBSByteStream->write16(nbookmarks);\n  if (nbookmarks)\n    {\n      GPosition pos;\n      int cnt=0;\n      for (pos = bookmark_list; pos; ++pos)\n        {\n          bookmark_list[pos]->encode(gpBSByteStream);\n          cnt++;\n        }\n      if (nbookmarks != cnt)\n        {\n          GUTF8String msg;\n          msg.format(\"Corrupt bookmarks found during encode: %d of %d \\n\",\n                     cnt, nbookmarks);\n          G_THROW (msg);\n        }\n    }\n}\n\nint \nDjVmNav::getBookMarkCount()\n{\n  return(bookmark_list.size());\n}\n\nvoid \nDjVmNav::append (const GP<DjVuBookMark> &gpBookMark) \n{\n  bookmark_list.append(gpBookMark);\n}\n\nbool \nDjVmNav::getBookMark(GP<DjVuBookMark> &gpBookMark, int iPos)\n{\n  GPosition pos = bookmark_list.nth(iPos);\n  if (pos)\n    gpBookMark = bookmark_list[pos];\n  else\n    gpBookMark = 0;\n  return (gpBookMark?true:false);\n}\n\n\n// A text dump of this object\nvoid \nDjVmNav::dump(const GP<ByteStream> &gstr)\n{\n  ByteStream &str=*gstr;\n  GCriticalSectionLock lock(&class_lock);\n  int nbookmarks=bookmark_list.size();\n  str.format(\"%d bookmarks:\\n\",nbookmarks);\n  if (nbookmarks)\n    {\n      GPosition pos;\n      int cnt=0;\n      for (pos = bookmark_list; pos; ++pos)\n        {\n          bookmark_list[pos]->dump(&str);\n          cnt++;\n        }\n      if (nbookmarks != cnt)\n        {\n          GUTF8String msg;\n          msg.format(\"Corrupt bookmarks found during encode: %d of %d \\n\",\n                     cnt,nbookmarks);\n          G_THROW (msg);\n        }\n    }\n}\n\nbool \nDjVmNav::isValidBookmark()\n{\n  //test if the bookmark is properly given\n  //for example: (4, \"A\", urla)\n  //\t         (0, \"B\", urlb)\n  //             (0, \"C\", urlc)\n  //is not a bookmark since A suppose to have 4 decendents, it only get one.\n  int bookmark_totalnum=getBookMarkCount();\n  GP<DjVuBookMark> gpBookMark;\n  int* count_array=(int*)malloc(sizeof(int)*bookmark_totalnum);\n  for(int i=0;i<bookmark_totalnum;i++)\n    {\n      getBookMark(gpBookMark, i);\n      count_array[i]=gpBookMark->count;\n    }\n  int index=0;\n  int trees=0;\n  int* treeSizes=(int*)malloc(sizeof(int)*bookmark_totalnum);\n  while(index<bookmark_totalnum)\n    {\n      int treeSize=get_tree(index,count_array,bookmark_totalnum);\n      if(treeSize>0) //is a tree\n        {\n          index+=treeSize;\n          treeSizes[trees++]=treeSize;\n        }\n      else //not a tree\n        break;\n    }\n  free(count_array);\n  free(treeSizes);\n  return true;\n}\n\nint \nDjVmNav::get_tree(int index, int* count_array, int count_array_size)\n{\n  int i=index;\n  int accumulate_count=0;\n  while(i<count_array_size)\n    {\n      accumulate_count+=count_array[i];\n      if(accumulate_count==0)\n        return 1;\n      else if(accumulate_count == i-index) //get a tree\n        return accumulate_count;\n      i++;\n    }\n  return 0;\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVmNav.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _DJVMNAV_H\n#define _DJVMNAV_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n#include \"DjVuGlobal.h\"\n#include \"GString.h\"\n#include \"GThreads.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\nclass ByteStream;\n\n/** The NAVM chunk.\n    The optional #\"NAVM\"# chunk which follows the DIRM chunk describes\n    how the user can navigate the document.\n    This is a list of DjVuBookMarks.\n**/\n\nclass DJVUAPI DjVmNav : public GPEnabled\n{\npublic:\n   /** Class \\Ref{DjVmNav::DjVuBookMark} represents a entry in the \n       hierarchy of contents. */\n   class DjVuBookMark;\n \n   static GP<DjVmNav> create(void);\n      /** Decodes the directory from the specified stream. */\n   void decode(const GP<ByteStream> &stream);\n      /** Encodes the directory into the specified stream. */\n   void encode(const GP<ByteStream> &stream) ;\n   void dump(const GP<ByteStream> &stream) ;\n      /** Return bookmark at zero-based position i */\n   bool getBookMark(GP<DjVuBookMark> &gpBookMark, int i) ;\n   int getBookMarkCount();\n      /** Append the BookMark to the end of the list */\n   void append (const GP<DjVuBookMark> &gpBookMark) ;\n      /** This function will check the given bookmark is valid or not */\n   bool isValidBookmark();\n      /** This function determines if the given count_array is a tree\n          sequence, that is if it fits a tree. */\n   int get_tree(int index, int* count_array, int count_array_size);\nprotected:\n   DjVmNav(void) { } ;\nprivate:\n   GCriticalSection class_lock;\n   GPList<DjVuBookMark>\tbookmark_list;\n};\n\n/** The DjVuBookMark.\n    Each entry in the Navigation chunk (NAVM) is a bookmark.  A bookmark\n    contains a count of immediate children, a display string and a url.\n**/\n\nclass DJVUAPI DjVmNav::DjVuBookMark : public GPEnabled\n{\nprotected:\n  /** Default constructor. */\n  DjVuBookMark(void);\npublic:\n  static GP<DjVuBookMark> create(void);\n  static GP<DjVuBookMark> create(const unsigned short count,\n                                 const GUTF8String &displayname, \n                                 const GUTF8String &url);\n  void encode(const GP<ByteStream> &stream);\n  void dump(const GP<ByteStream> &stream);\n  void decode(const GP<ByteStream> &stream);\n  int count;\t           // count of immediate children.\n  GUTF8String displayname; // example:  \"Section 3.5 - Encryption\"\n  GUTF8String url;\t   // url, may be blank or relative.\n};\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVuAnno.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"DjVuAnno.h\"\n#include \"GContainer.h\"\n#include \"GException.h\"\n#include \"IFFByteStream.h\"\n#include \"BSByteStream.h\"\n#include \"GMapAreas.h\"\n\n#include \"debug.h\"\n\n#include <ctype.h>\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n// GLParser.h and GLParser.cpp used to be separate files capable to decode\n// that weird ANTa chunk format into C++ structures and lists. But since\n// its implementation is temporary and is used only in this file (DjVuAnno.cpp)\n// it appears reasonable to build it in here.\n\n//***************************************************************************\n//****************************** GLParser.h *********************************\n//***************************************************************************\n\n\nclass GLObject : public GPEnabled\n{\npublic:\n   enum GLObjectType { INVALID=0, NUMBER=1, STRING=2, SYMBOL=3, LIST=4 };\n   static const char * const GLObjectString[LIST+1];\n\n   GLObject(int _number=0);\n   GLObject(GLObjectType type, const char * str);\n   GLObject(const char * name, const GPList<GLObject> & list);\n   virtual ~GLObject(void);\n   \n   int\t\tget_number(void) const;\n   GUTF8String\tget_string(void) const;\n   GUTF8String\tget_symbol(void) const;\n   GPList<GLObject>\t& get_list(void);\n   GP<GLObject>\toperator[](int n) const;\n   \n   GLObjectType\tget_type(void) const;\n   GUTF8String\tget_name(void) const;\n   void\t\tprint(ByteStream & str, int compact=1, int indent=0, int * cur_pos=0) const;\nprivate:\n   GLObjectType\ttype;\n   GUTF8String\tname;\n   \n   int\t\tnumber;\n   GUTF8String\tstring;\n   GUTF8String\tsymbol;\n   GPList<GLObject>\tlist;\n   void throw_can_not_convert_to(const GLObjectType to) const;\n};\n\nconst char * const GLObject::GLObjectString[]=\n  {\"invalid\", \"number\", \"string\", \"symbol\", \"list\"};\n\ninline GLObject::GLObjectType\nGLObject::get_type(void) const { return type; }\n\ninline\nGLObject::~GLObject(void) {}\n\nclass GLToken\n{\npublic:\n   enum GLTokenType { OPEN_PAR, CLOSE_PAR, OBJECT };\n   GLTokenType\ttype;\n   GP<GLObject>\tobject;\n   \n   GLToken(GLTokenType type, const GP<GLObject> & object);\n};\n\ninline\nGLToken::GLToken(GLTokenType xtype, const GP<GLObject> & xobject) :\n      type(xtype), object(xobject) {}\n\nclass GLParser\n{\npublic:\n   void\t\tparse(const char * str);\n   GPList<GLObject>\t& get_list(void);\n   GP<GLObject>\t\tget_object(const char * name, bool last=true);\n   void\t\tprint(ByteStream & str, int compact=1);\n\n   GLParser(void);\n   GLParser(const char * str);\n   ~GLParser(void);\nprivate:\n   GPList<GLObject>\tlist;\n\n   bool   \tcompat;\n   void\t\tskip_white_space(const char * & start);\n   void \tcheck_compat(const char *str);\n   GLToken\tget_token(const char * & start);\n   void\t\tparse(const char * cur_name, GPList<GLObject> & list,\n\t\t      const char * & start);\n};\n\nGLParser::GLParser(void) \n  : compat(false)\n{\n}\n\nGLParser::~GLParser(void) \n{\n}\n\nGPList<GLObject> &\nGLParser::get_list(void) \n{ \n  return list; \n}\n\nGLParser::GLParser(const char * str) \n  : compat(false)\n{\n  parse(str); \n}\n\n\n//***************************************************************************\n//***************************** GLParser.cpp ********************************\n//***************************************************************************\n\n\nGLObject::GLObject(int xnumber) : type(NUMBER), number(xnumber) {}\n\nGLObject::GLObject(GLObjectType xtype, const char * str) : type(xtype)\n{\n   if (type!=STRING && type!=SYMBOL)\n      G_THROW( ERR_MSG(\"DjVuAnno.bad_type\") );\n   if (type==STRING) \n      string=str;\n   else symbol=str;\n}\n\nGLObject::GLObject(const char * xname, const GPList<GLObject> & xlist) :\n      type(LIST), name(xname), list(xlist) {}\n\n\nstatic GUTF8String make_c_string(GUTF8String string)\n{\n  GUTF8String buffer;\n  const char *data = (const char*)string;\n  int length = string.length();\n  buffer = GUTF8String(\"\\\"\");\n  while (*data && length>0) \n    {\n      int span = 0;\n      while (span<length && (unsigned char)(data[span])>=0x20 && \n             data[span]!=0x7f && data[span]!='\"' && data[span]!='\\\\' )\n        span++;\n      if (span > 0) \n        {  \n          buffer = buffer + GUTF8String(data, span);\n          data += span;\n          length -= span;\n        }  \n      else \n        {\n          char buf[8];\n          static const char *tr1 = \"\\\"\\\\tnrbf\";\n          static const char *tr2 = \"\\\"\\\\\\t\\n\\r\\b\\f\";\n          sprintf(buf,\"\\\\%03o\", (int)(((unsigned char*)data)[span]));\n          for (int i=0; tr2[i]; i++)\n            if (data[span] == tr2[i])\n              buf[1] = tr1[i];\n          if (buf[1]<'0' || buf[1]>'3')\n            buf[2] = 0;\n          buffer = buffer + GUTF8String(buf);\n          data += 1;\n          length -= 1;\n        }\n    }\n  buffer = buffer + GUTF8String(\"\\\"\");\n  return buffer;\n}\n\n\nvoid\nGLObject::print(ByteStream & str, int compact, int indent, int * cur_pos) const\n{\n  int local_cur_pos = 0;\n  if (!cur_pos) { cur_pos = &local_cur_pos; }\n  \n  GUTF8String buffer;\n  switch(type)\n  {\n  case NUMBER:\n    buffer.format(\"%d\",number);\n    break;\n  case STRING:\n    buffer = make_c_string(string);\n    break;\n  case SYMBOL:\n    buffer.format(\"%s\",(const char *)symbol);\n    break;\n  case LIST:\n    buffer.format(\"(%s\",(const char *)name);\n    break;\n  case INVALID:\n    break;\n  }\n  const char * to_print = (const char*)buffer;\n  if (!compact && *cur_pos+strlen(to_print)>70)\n  {\n    char ch='\\n';\n    str.write(&ch, 1);\n    ch=' ';\n    for(int i=0;i<indent;i++) str.write(&ch, 1);\n    *cur_pos=indent;\n  }\n  str.write(to_print, strlen(to_print));\n  char ch=' ';\n  str.write(&ch, 1);\n  *cur_pos+=strlen(to_print)+1;\n  if (type==LIST)\n  {\n    int indent=*cur_pos-strlen(to_print);\n    for(GPosition pos=list;pos;++pos)\n      list[pos]->print(str, compact, indent, cur_pos);\n    str.write(\") \", 2);\n    *cur_pos+=2;\n  }\n}\n\n//  This function constructs message names for external lookup.\n//  The message names are constructed to avoid the problems of concatenating\n//  phrases (which does not translate well into other languages). The\n//  message names that can be generated are (listed here to appease the\n//  auditing program which reads comments):\n//    ERR_MSG(\"DjVuAnno.invalid2number\"), ERR_MSG(\"DjVuAnno.string2number\"),\n//    ERR_MSG(\"DjVuAnno.symbol2number\"), ERR_MSG(\"DjVuAnno.list2number\")\n//    ERR_MSG(\"DjVuAnno.invalid2string\"), ERR_MSG(\"DjVuAnno.number2string\"),\n//    ERR_MSG(\"DjVuAnno.symbol2string\"), ERR_MSG(\"DjVuAnno.list2string\")\n//    ERR_MSG(\"DjVuAnno.invalid2symbol\"), ERR_MSG(\"DjVuAnno.number2symbol\"),\n//    ERR_MSG(\"DjVuAnno.string2symbol\"), ERR_MSG(\"DjVuAnno.list2symbol\")\n//    ERR_MSG(\"DjVuAnno.invalid2list\"), ERR_MSG(\"DjVuAnno.number2list\"),\n//    ERR_MSG(\"DjVuAnno.string2list\"), ERR_MSG(\"DjVuAnno.symbol2list\")\nvoid\nGLObject::throw_can_not_convert_to(const GLObjectType to) const\n{\n  static const GUTF8String two('2');\n  static const GUTF8String tab('\\t');\n  GUTF8String mesg(\"DjVuAnno.\");\n  switch(type)\n  {\n    case NUMBER:\n      mesg+=GLObjectString[NUMBER]+two+GLObjectString[to]+tab+GUTF8String(number);\n      break;\n    case STRING:\n      mesg+=GLObjectString[STRING]+two+GLObjectString[to]+tab+string;\n      break;\n    case SYMBOL:\n      mesg+=GLObjectString[SYMBOL]+two+GLObjectString[to]+tab+symbol;\n      break;\n    case LIST:\n      mesg+=GLObjectString[LIST]+two+GLObjectString[to]+tab+name;\n      break;\n    default:\n      mesg+=GLObjectString[INVALID]+two+GLObjectString[to];\n      break;\n  }\n  G_THROW(mesg);\n}\n\nGUTF8String\nGLObject::get_string(void) const\n{\n   if (type!=STRING)\n   {\n      throw_can_not_convert_to(STRING);\n   }\n   return string;\n}\n\nGUTF8String\nGLObject::get_symbol(void) const\n{\n   if (type!=SYMBOL)\n   {\n      throw_can_not_convert_to(SYMBOL);\n   }\n   return symbol;\n}\n\nint\nGLObject::get_number(void) const\n{\n   if (type!=NUMBER)\n   {\n      throw_can_not_convert_to(NUMBER);\n   }\n   return number;\n}\n\nGUTF8String\nGLObject::get_name(void) const\n{\n   if (type!=LIST)\n   {\n      throw_can_not_convert_to(LIST);\n   }\n   return name;\n}\n\nGP<GLObject>\nGLObject::operator[](int n) const\n{\n   if (type!=LIST)\n   {\n      throw_can_not_convert_to(LIST);\n   }\n   if (n>=list.size()) G_THROW( ERR_MSG(\"DjVuAnno.too_few\") \"\\t\"+name);\n   int i;\n   GPosition pos;\n   for(i=0, pos=list;i<n && pos;i++, ++pos)\n   \t\tcontinue;\n   return list[pos];\n}\n\nGPList<GLObject> &\nGLObject::get_list(void)\n{\n   if (type!=LIST)\n   {\n      throw_can_not_convert_to(LIST);\n   }\n   return list;\n}\n\n//********************************** GLParser *********************************\n\nvoid\nGLParser::skip_white_space(const char * & start)\n{\n   while(*start && isspace(*start)) start++;\n   if (!*start) \n       G_THROW( ByteStream::EndOfFile );\n}\n\nGLToken\nGLParser::get_token(const char * & start)\n{\n   skip_white_space(start);\n   char c = *start;\n   if (c == '(')\n     {\n       start++;\n       return GLToken(GLToken::OPEN_PAR, 0);\n     }\n   else if (c == ')')\n     {\n       start++;\n       return GLToken(GLToken::CLOSE_PAR, 0);\n     }\n   else if (c=='-' || (c>='0' && c<='9'))\n     {\n       return GLToken(GLToken::OBJECT,\n                      new GLObject(strtol(start, (char **) &start, 10)));\n     }\n   else if (c=='\"')\n     {\n       GUTF8String str;\n       start++;\n       while(1)\n\t {\n           int span = 0;\n           while (start[span] && start[span]!='\\\\' && start[span]!='\\\"')\n             span++;\n           if (span > 0)\n             {\n               str = str + GUTF8String(start,span);\n               start += span;\n             }\n           else if (start[0]=='\\\"')\n             {\n               start += 1;\n               break;\n             }\n           else if (start[0]=='\\\\' && compat)\n             {\n               char c = start[1];\n               if (c == '\\\"')\n                 {\n                   start += 2;\n                   str += '\\\"';\n                 }\n               else\n                 {\n                   start += 1;\n                   str += '\\\\';\n                 }\n             }\n           else if (start[0]=='\\\\' && start[1])\n             {\n               char c = *++start;\n               if (c>='0' && c<='7')\n                 {\n                   int x = 0;\n                   for (int i=0; i<3 && c>='0' && c<='7'; i++) \n                     {\n                       x = x * 8 + c - '0';\n                       c = *++start;\n                     }\n                   str += (char)(x & 0xff);\n                 }\n               else\n                 {\n                   static const char *tr1 = \"tnrbfva\";\n                   static const char *tr2 = \"\\t\\n\\r\\b\\f\\013\\007\";\n                   for (int i=0; tr1[i]; i++)\n                     if (c == tr1[i])\n                       c = tr2[i];\n                   start += 1;\n                   str += c;\n                 }\n             }\n           else \n             {\n               G_THROW( ByteStream::EndOfFile );\n             }\n         }\n       return GLToken(GLToken::OBJECT, \n                      new GLObject(GLObject::STRING, str));\n     }\n   else\n     {\n       GUTF8String str;\n       while(1)\n\t {\n           char ch=*start++;\n           if (!ch)\n             G_THROW( ByteStream::EndOfFile );\n           if (ch==')') { start--; break; }\n           if (isspace(ch)) break;\n           str+=ch;\n\t }\n       return GLToken(GLToken::OBJECT, new GLObject(GLObject::SYMBOL, str));\n     }\n} \n\nvoid\nGLParser::parse(const char * cur_name, GPList<GLObject> & list,\n\t\tconst char * & start)\n{\n  DEBUG_MSG(\"GLParse::parse(): Parsing contents of object '\" << cur_name << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n  \n  while(1)\n  {\n    GLToken token=get_token(start);\n    if (token.type==GLToken::OPEN_PAR)\n    {\n      if (isspace(*start))\n      {\n        GUTF8String mesg=GUTF8String( ERR_MSG(\"DjVuAnno.paren\") \"\\t\")+cur_name;\n        G_THROW(mesg);\n      }\n      \n      GLToken tok=get_token(start);\n      GP<GLObject> object=tok.object;\t// This object should be SYMBOL\n      // We will convert it to LIST later\n      if (tok.type!=GLToken::OBJECT || object->get_type()!=GLObject::SYMBOL)\n      {\n        if (tok.type==GLToken::OPEN_PAR ||\n          tok.type==GLToken::CLOSE_PAR)\n        {\n          GUTF8String mesg=GUTF8String( ERR_MSG(\"DjVuAnno.no_paren\") \"\\t\")+cur_name;\n          G_THROW(mesg);\n        }\n        if (tok.type==GLToken::OBJECT)\n        {\n          GLObject::GLObjectType type=object->get_type();\n          if (type==GLObject::NUMBER)\n          {\n            GUTF8String mesg( ERR_MSG(\"DjVuAnno.no_number\") \"\\t\");\n            mesg += cur_name;\n            G_THROW(mesg);\n          }\n          else if (type==GLObject::STRING)\n          {\n            GUTF8String mesg( ERR_MSG(\"DjVuAnno.no_string\") \"\\t\");\n            mesg += cur_name;\n            G_THROW(mesg);\n          }\n        }\n      }\n      \n      // OK. Get the object contents\n      GPList<GLObject> new_list;\n      G_TRY\n      {\n        parse(object->get_symbol(), new_list, start);\n      } \n      G_CATCH(exc)\n      {\n        if (exc.cmp_cause(ByteStream::EndOfFile))\n          G_RETHROW;\n      } \n      G_ENDCATCH;\n      list.append(new GLObject(object->get_symbol(), new_list));\n      continue;\n    }\n    if (token.type==GLToken::CLOSE_PAR) \n      return;\n    list.append(token.object);\n  }\n}\n\nvoid \nGLParser::check_compat(const char *s)\n{\n  int state = 0;\n  while (s && *s && !compat)\n    {\n      switch(state)\n        {\n        case 0:\n          if (*s == '\\\"')\n            state = '\\\"';\n          break;\n        case '\\\"':\n          if (*s == '\\\"')\n            state = 0;\n          else if (*s == '\\\\')\n            state = '\\\\';\n          else if ((unsigned char)(*s)<0x20 || *s==0x7f)\n            compat = true;\n          break;\n        case '\\\\':\n          if (!strchr(\"01234567tnrbfva\\\"\\\\\",*s))\n            compat = true;\n          state = '\\\"';\n          break;\n        }\n      s += 1;\n    }\n}\n\nvoid\nGLParser::parse(const char * str)\n{\n   DEBUG_MSG(\"GLParser::parse(): parsing string contents\\n\");\n   DEBUG_MAKE_INDENT(3);\n   \n   G_TRY\n   {\n      check_compat(str);\n      parse(\"toplevel\", list, str);\n   } G_CATCH(exc)\n   {\n      if (exc.cmp_cause(ByteStream::EndOfFile))\n        G_RETHROW;\n   } G_ENDCATCH;\n}\n\nvoid\nGLParser::print(ByteStream & str, int compact)\n{\n   for(GPosition pos=list;pos;++pos)\n      list[pos]->print(str, compact);\n}\n\nGP<GLObject>\nGLParser::get_object(const char * name, bool last)\n{\n   GP<GLObject> object;\n   for(GPosition pos=list;pos;++pos)\n   {\n      GP<GLObject> obj=list[pos];\n      if (obj->get_type()==GLObject::LIST &&\n\t  obj->get_name()==name)\n      {\n\t object=obj;\n\t if (!last) break;\n      }\n   }\n   return object;\n}\n\n//***************************************************************************\n//********************************** ANT ************************************\n//***************************************************************************\n\nstatic const char *zoom_strings[]={\n  \"default\",\"page\",\"width\",\"one2one\",\"stretch\"};\nstatic const int zoom_strings_size=sizeof(zoom_strings)/sizeof(const char *);\n\nstatic const char *mode_strings[]={\n  \"default\",\"color\",\"fore\",\"back\",\"bw\"};\nstatic const int mode_strings_size=sizeof(mode_strings)/sizeof(const char *);\n\nstatic const char *align_strings[]={\n  \"default\",\"left\",\"center\",\"right\",\"top\",\"bottom\"};\nstatic const int align_strings_size=sizeof(align_strings)/sizeof(const char *);\n\n#define PNOTE_TAG\t\"pnote\"\n#define BACKGROUND_TAG\t\"background\"\n#define ZOOM_TAG\t\"zoom\"\n#define MODE_TAG\t\"mode\"\n#define ALIGN_TAG\t\"align\"\n#define HALIGN_TAG\t\"halign\"\n#define VALIGN_TAG\t\"valign\"\n#define METADATA_TAG    \"metadata\"\n#define XMP_TAG         \"xmp\"\n\nstatic const unsigned long default_bg_color=0xffffffff;\n\nDjVuANT::DjVuANT(void)\n{\n   bg_color=default_bg_color;\n   zoom=0;\n   mode=MODE_UNSPEC;\n   hor_align=ver_align=ALIGN_UNSPEC;\n}\n\nDjVuANT::~DjVuANT()\n{\n}\n\nGUTF8String\nDjVuANT::get_paramtags(void) const\n{\n  GUTF8String retval;\n  if(zoom > 0)\n  {\n    retval+=\"<PARAM name=\\\"\" ZOOM_TAG \"\\\" value=\\\"\"+GUTF8String(zoom)+=\"\\\" />\\n\";\n  }else if(zoom && ((-zoom)<zoom_strings_size))\n  {\n    retval+=\"<PARAM name=\\\"\" ZOOM_TAG \"\\\" value=\\\"\"+GUTF8String(zoom_strings[-zoom])+\"\\\" />\\n\";\n  }\n  if((mode>0)&&(mode<mode_strings_size))\n  {\n    retval+=\"<PARAM name=\\\"\" MODE_TAG \"\\\" value=\\\"\"+GUTF8String(mode_strings[mode])+\"\\\" />\\n\";\n  }\n  if((hor_align>ALIGN_UNSPEC)&&(hor_align<align_strings_size))\n  {\n    retval+=\"<PARAM name=\\\"\" HALIGN_TAG \"\\\" value=\\\"\"+GUTF8String(align_strings[hor_align])+\"\\\" />\\n\";\n  }\n  if((ver_align>ALIGN_UNSPEC)&&(ver_align<align_strings_size))\n  {\n    retval+=\"<PARAM name=\\\"\" VALIGN_TAG \"\\\" value=\\\"\"+GUTF8String(align_strings[ver_align])+\"\\\" />\\n\";\n  }\n  if((bg_color&0xffffff) == bg_color)\n  {\n    retval+=\"<PARAM name=\\\"\" BACKGROUND_TAG \"\\\" value=\\\"\"+GUTF8String().format(\"#%06lX\",bg_color)+\"\\\" />\\n\";\n  }\n  return retval;\n}\n\nvoid\nDjVuANT::writeParam(ByteStream &str_out) const\n{\n  str_out.writestring(get_paramtags());\n}\n\nGUTF8String\nDjVuANT::get_xmlmap(const GUTF8String &name,const int height) const\n{\n  GUTF8String retval(\"<MAP name=\\\"\"+name.toEscaped()+\"\\\" >\\n\");\n  for(GPosition pos(map_areas);pos;++pos)\n  {\n    retval+=map_areas[pos]->get_xmltag(height);\n  }\n  return retval+\"</MAP>\\n\";\n}\n\nvoid\nDjVuANT::writeMap(\n  ByteStream &str_out,const GUTF8String &name,const int height) const\n{\n  str_out.writestring(\"<MAP name=\\\"\"+name.toEscaped()+\"\\\" >\\n\");\n  for(GPosition pos(map_areas);pos;++pos)\n  {\n    str_out.writestring(GUTF8String(map_areas[pos]->get_xmltag(height)));\n  }\n  str_out.writestring(GUTF8String(\"</MAP>\\n\"));\n}\n\nGUTF8String\nDjVuANT::read_raw(ByteStream & str)\n{\n   GUTF8String raw;\n   char buffer[1024];\n   int length;\n   while((length=str.read(buffer, 1024)))\n      raw+=GUTF8String(buffer, length);\n   return raw;\n}\n\nvoid\nDjVuANT::decode(class GLParser & parser)\n{\n   bg_color=get_bg_color(parser);\n   zoom=get_zoom(parser);\n   mode=get_mode(parser);\n   hor_align=get_hor_align(parser);\n   ver_align=get_ver_align(parser);\n   map_areas=get_map_areas(parser);\n   metadata=get_metadata(parser); \n   xmpmetadata=get_xmpmetadata(parser);\n}\n\n\nvoid \nDjVuANT::decode(ByteStream & str)\n{\n   GLParser parser(read_raw(str));\n   decode(parser);\n}\n\nvoid\nDjVuANT::merge(ByteStream & str)\n{\n   GLParser parser(encode_raw());\n   GUTF8String add_raw=read_raw(str);\n   parser.parse(add_raw);\n   decode(parser);\n}\n\nvoid\nDjVuANT::encode(ByteStream &bs)\n{\n  GUTF8String raw=encode_raw();\n  bs.writall((const char*) raw, raw.length());\n}\n\nunsigned int \nDjVuANT::get_memory_usage() const\n{\n  return sizeof(DjVuANT);\n}\n\nunsigned char\nDjVuANT::decode_comp(char ch1, char ch2)\n{\n   unsigned char dig1=0;\n   if (ch1)\n   {\n      ch1=toupper(ch1);\n      if (ch1>='0' && ch1<='9') dig1=ch1-'0';\n      if (ch1>='A' && ch1<='F') dig1=10+ch1-'A';\n      \n      unsigned char dig2=0;\n      if (ch2)\n      {\n\t ch2=toupper(ch2);\n\t if (ch2>='0' && ch2<='9') dig2=ch2-'0';\n\t if (ch2>='A' && ch2<='F') dig2=10+ch2-'A';\n\t return (dig1 << 4) | dig2;\n      }\n      return dig1;\n   }\n   return 0;\n}\n\nunsigned long int\nDjVuANT::cvt_color(const char * color, unsigned long int def)\n{\n   if (color[0]!='#') return def;\n\n   unsigned long int color_rgb=0;\n   color++;\n   const char * start, * end;\n   \n      // Do blue\n   end=color+strlen(color); start=end-2;\n   if (start<color) start=color;\n   if (end>start)\n      color_rgb|=decode_comp(start[0], start+1<end ? start[1] : 0);\n   \n      // Do green\n   end=color+strlen(color)-2; start=end-2;\n   if (start<color) start=color;\n   if (end>start)\n      color_rgb|=decode_comp(start[0], start+1<end ? start[1] : 0) << 8;\n   \n      // Do red\n   end=color+strlen(color)-4; start=end-2;\n   if (start<color) start=color;\n   if (end>start)\n      color_rgb|=decode_comp(start[0], start+1<end ? start[1] : 0) << 16;\n\n      // Do the fourth byte\n   end=color+strlen(color)-6; start=end-2;\n   if (start<color) start=color;\n   if (end>start)\n      color_rgb|=decode_comp(start[0], start+1<end ? start[1] : 0) << 24;\n   \n   return color_rgb;\n}\n\nunsigned long int\nDjVuANT::get_bg_color(GLParser & parser)\n{\n  unsigned long retval=default_bg_color;\n  DEBUG_MSG(\"DjVuANT::get_bg_color(): getting background color ...\\n\");\n  DEBUG_MAKE_INDENT(3);\n  G_TRY\n  {\n    GP<GLObject> obj=parser.get_object(BACKGROUND_TAG);\n    if (obj && obj->get_list().size()==1)\n    {\n      GUTF8String color=(*obj)[0]->get_symbol();\n      DEBUG_MSG(\"color='\" << color << \"'\\n\");\n      retval=cvt_color(color, 0xffffff);\n    }\n#ifndef NDEBUG\n    if(retval == default_bg_color)\n    {\n      DEBUG_MSG(\"can't find any.\\n\");\n    }\n#endif // NDEBUG\n  } G_CATCH_ALL {} G_ENDCATCH;\n#ifndef NDEBUG\n  if(retval == default_bg_color)\n  {\n    DEBUG_MSG(\"resetting color to 0xffffffff (UNSPEC)\\n\");\n  }\n#endif // NDEBUG\n  return retval;\n}\n\nint\nDjVuANT::get_zoom(GLParser & parser)\n      // Returns:\n      //   <0 - special zoom (like ZOOM_STRETCH)\n      //   =0 - not set\n      //   >0 - numeric zoom (%%)\n{\n  int retval=ZOOM_UNSPEC;\n  DEBUG_MSG(\"DjVuANT::get_zoom(): getting zoom factor ...\\n\");\n  DEBUG_MAKE_INDENT(3);\n  G_TRY\n  {\n    GP<GLObject> obj=parser.get_object(ZOOM_TAG);\n    if (obj && obj->get_list().size()==1)\n    {\n      const GUTF8String zoom((*obj)[0]->get_symbol());\n      DEBUG_MSG(\"zoom='\" << zoom << \"'\\n\");\n     \n      for(int i=0;(i<zoom_strings_size);++i)\n      {\n        if(zoom == zoom_strings[i])\n        {\n          retval=(-i);\n          break;\n        }\n      }\n      if(retval == ZOOM_UNSPEC)\n      {\n        if (zoom[0]!='d')\n        {\n          G_THROW( ERR_MSG(\"DjVuAnno.bad_zoom\") );\n        }else\n        {\n          retval=zoom.substr(1, zoom.length()).toInt(); //atoi((const char *) zoom+1);\n        }\n      }\n    }\n#ifndef NDEBUG\n    if(retval == ZOOM_UNSPEC)\n    {\n      DEBUG_MSG(\"can't find any.\\n\");\n    }\n#endif // NDEBUG\n  } G_CATCH_ALL {} G_ENDCATCH;\n#ifndef NDEBUG\n  if(retval == ZOOM_UNSPEC)\n  {\n    DEBUG_MSG(\"resetting zoom to 0 (UNSPEC)\\n\");\n  }\n#endif // NDEBUG\n  return retval;\n}\n\nint\nDjVuANT::get_mode(GLParser & parser)\n{\n  int retval=MODE_UNSPEC;\n  DEBUG_MSG(\"DjVuAnt::get_mode(): getting default mode ...\\n\");\n  DEBUG_MAKE_INDENT(3);\n  G_TRY\n  {\n    GP<GLObject> obj=parser.get_object(MODE_TAG);\n    if (obj && obj->get_list().size()==1)\n    {\n      const GUTF8String mode((*obj)[0]->get_symbol());\n      DEBUG_MSG(\"mode='\" << mode << \"'\\n\");\n      for(int i=0;(i<mode_strings_size);++i)\n      {\n        if(mode == mode_strings[i])\n        {\n          retval=i;\n          break;\n        }\n      }\n    }\n#ifndef NDEBUG\n    if(retval == MODE_UNSPEC)\n    {\n      DEBUG_MSG(\"can't find any.\\n\");\n    }\n#endif // NDEBUG\n  } G_CATCH_ALL {} G_ENDCATCH;\n#ifndef NDEBUG\n  if(retval == MODE_UNSPEC)\n  {\n    DEBUG_MSG(\"resetting mode to MODE_UNSPEC\\n\");\n  }\n#endif // NDEBUG\n  return retval;\n}\n\nstatic inline DjVuANT::alignment\nlegal_halign(const int i)\n{\n  DjVuANT::alignment retval;\n  switch((DjVuANT::alignment)i)\n  {\n  case DjVuANT::ALIGN_LEFT:\n  case DjVuANT::ALIGN_CENTER:\n  case DjVuANT::ALIGN_RIGHT:\n    retval=(DjVuANT::alignment)i;\n    break;\n  default:\n    retval=DjVuANT::ALIGN_UNSPEC;\n    break;\n  }\n  return retval;\n}\n\nstatic inline DjVuANT::alignment\nlegal_valign(const int i)\n{\n  DjVuANT::alignment retval;\n  switch((DjVuANT::alignment)i)\n  {\n  case DjVuANT::ALIGN_CENTER:\n  case DjVuANT::ALIGN_TOP:\n  case DjVuANT::ALIGN_BOTTOM:\n    retval=(DjVuANT::alignment)i;\n    break;\n  default:\n    retval=DjVuANT::ALIGN_UNSPEC;\n    break;\n  }\n  return retval;\n}\n\nDjVuANT::alignment\nDjVuANT::get_hor_align(GLParser & parser)\n{\n  DEBUG_MSG(\"DjVuAnt::get_hor_align(): getting hor page alignemnt ...\\n\");\n  DEBUG_MAKE_INDENT(3);\n  alignment retval=ALIGN_UNSPEC;\n  G_TRY\n  {\n    GP<GLObject> obj=parser.get_object(ALIGN_TAG);\n    if (obj && obj->get_list().size()==2)\n    {\n      const GUTF8String align((*obj)[0]->get_symbol());\n      DEBUG_MSG(\"hor_align='\" << align << \"'\\n\");\n      \n      for(int i=(int)ALIGN_UNSPEC;(i<align_strings_size);++i)\n      {\n        const alignment j=legal_halign(i);\n        if((i == (int)j)&&(align == align_strings[i]))\n        {\n          retval=j;\n          break;\n        }\n      }\n    }\n#ifndef NDEBUG\n    if(retval == ALIGN_UNSPEC)\n    {\n      DEBUG_MSG(\"can't find any.\\n\");\n    }\n#endif // NDEBUG\n  } G_CATCH_ALL {} G_ENDCATCH;\n#ifndef NDEBUG\n  if(retval == ALIGN_UNSPEC)\n  {\n    DEBUG_MSG(\"resetting alignment to ALIGN_UNSPEC\\n\");\n  }\n#endif // NDEBUG\n  return retval;\n}\n\nDjVuANT::alignment\nDjVuANT::get_ver_align(GLParser & parser)\n{\n  DEBUG_MSG(\"DjVuAnt::get_ver_align(): getting vert page alignemnt ...\\n\");\n  DEBUG_MAKE_INDENT(3);\n  alignment retval=ALIGN_UNSPEC;\n  G_TRY\n  {\n    GP<GLObject> obj=parser.get_object(ALIGN_TAG);\n    if (obj && obj->get_list().size()==2)\n    {\n      const GUTF8String align((*obj)[1]->get_symbol());\n      DEBUG_MSG(\"ver_align='\" << align << \"'\\n\");\n      for(int i=(int)ALIGN_UNSPEC;(i<align_strings_size);++i)\n      {\n        const alignment j=legal_valign(i);\n        if((i == (int)j)&&(align == align_strings[i]))\n        {\n          retval=j;\n          break;\n        }\n      }\n    }\n#ifndef NDEBUG\n    if(retval == ALIGN_UNSPEC)\n    {\n      DEBUG_MSG(\"can't find any.\\n\");\n    }\n#endif // NDEBUG\n  } G_CATCH_ALL {} G_ENDCATCH;\n#ifndef NDEBUG\n  if(retval == ALIGN_UNSPEC)\n  {\n    DEBUG_MSG(\"resetting alignment to ALIGN_UNSPEC\\n\");\n  }\n#endif // NDEBUG\n  return retval;\n}\n\nGMap<GUTF8String, GUTF8String>\nDjVuANT::get_metadata(GLParser & parser)\n{\n  DEBUG_MSG(\"DjVuANT::get_metadata(): forming and returning metadata table\\n\");\n  DEBUG_MAKE_INDENT(3);\n  \n  GMap<GUTF8String, GUTF8String> mdata;\n  \n  GPList<GLObject> list=parser.get_list();\n  for(GPosition pos=list;pos;++pos)\n    {\n      GLObject & obj=*list[pos];\n      if (obj.get_type()==GLObject::LIST && obj.get_name()==METADATA_TAG)  \n        { \n          G_TRY \n            {\n              for(int obj_num=0;obj_num<obj.get_list().size();obj_num++)\n                {\n                  GLObject & el=*obj[obj_num];\n                  const int type = el.get_type();\n                  if (type == GLObject::LIST)\n                    { \n                      const GUTF8String & name=el.get_name();  \n                      mdata[name]=(el[0])->get_string();\n                    }\n                }\n            } \n          G_CATCH_ALL { } G_ENDCATCH;\n        }\n    }\n  return mdata;\n}\n\nGUTF8String\nDjVuANT::get_xmpmetadata(GLParser & parser)\n{\n  DEBUG_MSG(\"DjVuANT::get_xmpmetadata(): returning xmp metadata string\\n\");\n  DEBUG_MAKE_INDENT(3);\n  \n  GUTF8String xmp;\n  GPList<GLObject> list=parser.get_list();\n  for(GPosition pos=list;pos;++pos)\n    {\n      GLObject &obj = *list[pos];\n      if (obj.get_type()==GLObject::LIST && obj.get_name()==XMP_TAG)  \n        { \n          G_TRY \n            {\n              if (obj.get_list().size() >= 1)\n                {\n                  GLObject &el = *obj[0];\n                  xmp = el.get_string();\n                  break;\n                }\n            } \n          G_CATCH_ALL { } G_ENDCATCH;\n        }\n    }\n  return xmp;\n}\n\n\nGPList<GMapArea>\nDjVuANT::get_map_areas(GLParser & parser)\n{\n  DEBUG_MSG(\"DjVuANT::get_map_areas(): forming and returning back list of map areas\\n\");\n  DEBUG_MAKE_INDENT(3);\n  \n  GPList<GMapArea> map_areas;\n  \n  GPList<GLObject> list=parser.get_list();\n\n  for(GPosition pos=list;pos;++pos)\n  {\n    GLObject & obj=*list[pos];\n    const int type=obj.get_type();\n    if (type == GLObject::LIST)\n    {\n      const GUTF8String name=obj.get_name();\n      if(name == GMapArea::MAPAREA_TAG)\n      {\n        G_TRY {\n\t       // Getting the url\n          GUTF8String url;\n          GUTF8String target=GMapArea::TARGET_SELF;\n          GLObject & url_obj=*(obj[0]);\n          if (url_obj.get_type()==GLObject::LIST)\n          {\n            if (url_obj.get_name()!=GMapArea::URL_TAG)\n              G_THROW( ERR_MSG(\"DjVuAnno.bad_url\") );\n            url=(url_obj[0])->get_string();\n            target=(url_obj[1])->get_string();\n          } else url=url_obj.get_string();\n        \n\t       // Getting the comment\n          GUTF8String comment=(obj[1])->get_string();\n        \n          DEBUG_MSG(\"found maparea '\" << comment << \"' (\" <<\n            url << \":\" << target << \")\\n\");\n        \n          GLObject * shape=obj[2];\n          GP<GMapArea> map_area;\n          if (shape->get_type()==GLObject::LIST)\n          {\n            if (shape->get_name()==GMapArea::RECT_TAG)\n            {\n              DEBUG_MSG(\"it's a rectangle.\\n\");\n              GRect grect((*shape)[0]->get_number(),\n                          (*shape)[1]->get_number(),\n                          (*shape)[2]->get_number(),\n                          (*shape)[3]->get_number());\n              GP<GMapRect> map_rect=GMapRect::create(grect);\n              map_area=(GMapRect *)map_rect;\n            } else if (shape->get_name()==GMapArea::POLY_TAG)\n            {\n              DEBUG_MSG(\"it's a polygon.\\n\");\n              int points=shape->get_list().size()/2;\n              GTArray<int> xx(points-1), yy(points-1);\n              for(int i=0;i<points;i++)\n              {\n                xx[i]=(*shape)[2*i]->get_number();\n                yy[i]=(*shape)[2*i+1]->get_number();\n              }\n              GP<GMapPoly> map_poly=GMapPoly::create(xx,yy,points);\n              map_area=(GMapPoly *)map_poly;\n            } else if (shape->get_name()==GMapArea::OVAL_TAG)\n            {\n              DEBUG_MSG(\"it's an ellipse.\\n\");\n              GRect grect((*shape)[0]->get_number(),\n                          (*shape)[1]->get_number(),\n                          (*shape)[2]->get_number(),\n                          (*shape)[3]->get_number());\n              GP<GMapOval> map_oval=GMapOval::create(grect);\n              map_area=(GMapOval *)map_oval;\n            }\n          }\n        \n          if (map_area)\n          {\n            map_area->url=url;\n            map_area->target=target;\n            map_area->comment=comment;\n            for(int obj_num=3;obj_num<obj.get_list().size();obj_num++)\n            {\n              GLObject * el=obj[obj_num];\n              if (el->get_type()==GLObject::LIST)\n              {\n                const GUTF8String & name=el->get_name();\n                if (name==GMapArea::BORDER_AVIS_TAG)\n                  map_area->border_always_visible=true;\n                else if (name==GMapArea::HILITE_TAG)\n                {\n                  GLObject * obj=el->get_list()[el->get_list().firstpos()];\n                  if (obj->get_type()==GLObject::SYMBOL)\n                    map_area->hilite_color=cvt_color(obj->get_symbol(), 0xff);\n                } else\n                {\n                  int border_type=\n                    name==GMapArea::NO_BORDER_TAG ? GMapArea::NO_BORDER :\n                    name==GMapArea::XOR_BORDER_TAG ? GMapArea::XOR_BORDER :\n                    name==GMapArea::SOLID_BORDER_TAG ? GMapArea::SOLID_BORDER :\n                    name==GMapArea::SHADOW_IN_BORDER_TAG ? GMapArea::SHADOW_IN_BORDER :\n                    name==GMapArea::SHADOW_OUT_BORDER_TAG ? GMapArea::SHADOW_OUT_BORDER :\n                    name==GMapArea::SHADOW_EIN_BORDER_TAG ? GMapArea::SHADOW_EIN_BORDER :\n                    name==GMapArea::SHADOW_EOUT_BORDER_TAG ? GMapArea::SHADOW_EOUT_BORDER : -1;\n                  if (border_type>=0)\n                  {\n                    map_area->border_type=(GMapArea::BorderType) border_type;\n                    for(GPosition pos=el->get_list();pos;++pos)\n                    {\n                      GLObject * obj=el->get_list()[pos];\n                      if (obj->get_type()==GLObject::SYMBOL)\n                        map_area->border_color=cvt_color(obj->get_symbol(), 0xff);\n                      if (obj->get_type()==GLObject::NUMBER)\n                        map_area->border_width=obj->get_number();\n                    }\n                  }\n                }\t    \n              } // if (el->get_type()==...)\n            } // for(int obj_num=...)\n            map_areas.append(map_area);\n          } // if (map_area) ...\n        } G_CATCH_ALL {} G_ENDCATCH;\n      }\n    }\n  } // while(item==...)\n   \n  DEBUG_MSG(\"map area list size = \" << list.size() << \"\\n\");\n  \n  return map_areas;\n}\n\nvoid\nDjVuANT::del_all_items(const char * name, GLParser & parser)\n{\n   GPList<GLObject> & list=parser.get_list();\n   GPosition pos=list;\n   while(pos)\n   {\n      GLObject & obj=*list[pos];\n      if (obj.get_type()==GLObject::LIST &&\n\t  obj.get_name()==name)\n      {\n\t GPosition this_pos=pos;\n\t ++pos;\n\t list.del(this_pos);\n      } else ++pos;\n   }\n}\n\nGUTF8String\nDjVuANT::encode_raw(void) const\n{\n   GUTF8String buffer;\n   GLParser parser;\n\n      //*** Background color\n   del_all_items(BACKGROUND_TAG, parser);\n   if (bg_color!=default_bg_color)\n   {\n      buffer.format(\"(\" BACKGROUND_TAG \" #%02X%02X%02X)\",\n\t      (unsigned int)((bg_color & 0xff0000) >> 16),\n\t      (unsigned int)((bg_color & 0xff00) >> 8),\n\t      (unsigned int)(bg_color & 0xff));\n      parser.parse(buffer);\n   }\n\n      //*** Zoom\n   del_all_items(ZOOM_TAG, parser);\n   if (zoom>0 || (zoom>=ZOOM_STRETCH && zoom<=ZOOM_PAGE))\n   {\n      buffer=\"(\" ZOOM_TAG \" \";\n      if (zoom < 0)\n        buffer += zoom_strings[-zoom];\n      else\n        buffer += \"d\"+GUTF8String(zoom);\n      buffer+=\")\";\n      parser.parse(buffer);\n   }\n\n      //*** Mode\n   del_all_items(MODE_TAG, parser);\n   if (mode!=MODE_UNSPEC)\n   {\n      const int i=mode-1;\n      if((i>=0)&& (i<mode_strings_size))\n      { \n        buffer=\"(\" MODE_TAG \" \" + GUTF8String(mode_strings[mode]) + \")\";\n      }\n      parser.parse(buffer);\n   }\n\n      //*** Alignment\n   del_all_items(ALIGN_TAG, parser);\n   if (hor_align!=ALIGN_UNSPEC || ver_align!=ALIGN_UNSPEC)\n   {\n      buffer= GUTF8String(\"(\" ALIGN_TAG \" \")\n        +align_strings[((hor_align<ALIGN_UNSPEC)||\n                        (hor_align>=align_strings_size))?ALIGN_UNSPEC:hor_align]\n        +\" \"+align_strings[((ver_align<ALIGN_UNSPEC)||\n                            (ver_align>=align_strings_size))?ALIGN_UNSPEC:ver_align]+\")\";\n      parser.parse(buffer);\n   }\n      //*** Metadata\n   del_all_items(METADATA_TAG, parser);\n   if (!metadata.isempty())\n     {\n       GUTF8String mdatabuffer(\"(\");\n       mdatabuffer +=  METADATA_TAG ;\n       for (GPosition pos=metadata; pos; ++pos)\n         mdatabuffer +=\" (\" + metadata.key(pos) + make_c_string(metadata[pos]) + \")\";\n       mdatabuffer += \" )\";\n       parser.parse(mdatabuffer);\n     }\n      //*** XMP Metadata\n   del_all_items(XMP_TAG, parser);\n   if (!!xmpmetadata)\n     {\n       GUTF8String mdatabuffer(\"(\");\n       mdatabuffer +=  XMP_TAG;\n       mdatabuffer += \" \" + make_c_string(xmpmetadata) + \")\";\n       parser.parse(mdatabuffer);\n     }\n     //*** Mapareas\n   del_all_items(GMapArea::MAPAREA_TAG, parser);\n   for(GPosition pos=map_areas;pos;++pos)\n     {\n       GUTF8String mapareabuffer = map_areas[pos]->print();\n       parser.parse(mapareabuffer);\n     }\n   GP<ByteStream> gstr=ByteStream::create();\n   ByteStream &str=*gstr;\n   parser.print(str, 1);\n   GUTF8String ans;\n   int size = str.size();\n   str.seek(0);\n   str.read(ans.getbuf(size), size);\n   return ans;\n}\n\nbool\nDjVuANT::is_empty(void) const\n{\n   GUTF8String raw=encode_raw();\n   for(int i=raw.length()-1;i>=0;i--)\n      if (isspace(raw[i])) raw.setat(i, 0);\n      else break;\n   return raw.length()==0;\n}\n\nGP<DjVuANT>\nDjVuANT::copy(void) const\n{\n   GP<DjVuANT> ant=new DjVuANT(*this);\n      // Now process the list of hyperlinks.\n   ant->map_areas.empty();\n   for(GPosition pos=map_areas;pos;++pos)\n      ant->map_areas.append(map_areas[pos]->get_copy());\n   return ant;\n}\n\n//***************************************************************************\n//******************************** DjVuAnno *********************************\n//***************************************************************************\n\nGUTF8String\nDjVuAnno::get_xmlmap(const GUTF8String &name,const int height) const\n{\n  return ant\n    ?(ant->get_xmlmap(name,height))\n    :(\"<MAP name=\\\"\"+name.toEscaped()+\"\\\"/>\\n\");\n}\n\nvoid\nDjVuAnno::writeMap(ByteStream &str_out,const GUTF8String &name,const int height) const\n{\n  if(ant)\n  {\n    ant->writeMap(str_out,name,height);\n  }else\n  {\n    str_out.writestring(get_xmlmap(name,height));\n  }\n}\n\nGUTF8String\nDjVuAnno::get_paramtags(void) const\n{\n  return ant\n    ?(ant->get_paramtags())\n    :GUTF8String();\n}\n\nvoid\nDjVuAnno::writeParam(ByteStream &str_out) const\n{\n  str_out.writestring(get_paramtags());\n}\n\n\nvoid\nDjVuAnno::decode(const GP<ByteStream> &gbs)\n{\n  GUTF8String chkid;\n  GP<IFFByteStream> giff=IFFByteStream::create(gbs);\n  IFFByteStream &iff=*giff;\n  while( iff.get_chunk(chkid) )\n  {\n    if (chkid == \"ANTa\")\n    {\n      if (ant) {\n        ant->merge(*iff.get_bytestream());\n      } else {\n        ant=DjVuANT::create();\n        ant->decode(*iff.get_bytestream());\n      }\n    }\n    else if (chkid == \"ANTz\")\n    {\n      GP<ByteStream> gbsiff=BSByteStream::create(giff->get_bytestream());\n      if (ant) {\n        ant->merge(*gbsiff);\n      } else {\n        ant=DjVuANT::create();\n        ant->decode(*gbsiff);\n      }\n    }\n    // Add decoding of other chunks here\n    iff.close_chunk();\n  }\n}\n\nvoid\nDjVuAnno::encode(const GP<ByteStream> &gbs)\n{\n  GP<IFFByteStream> giff=IFFByteStream::create(gbs);\n  IFFByteStream &iff=*giff;\n  if (ant)\n    {\n#if 0\n      iff.put_chunk(\"ANTa\");\n      ant->encode(iff);\n      iff.close_chunk();\n#else\n      iff.put_chunk(\"ANTz\");\n      {\n//\t GP<ByteStream> bsbinput = giff.get_bytestream();\n\t GP<ByteStream> bsb = BSByteStream::create(giff->get_bytestream(), 50);\n\t ant->encode(*bsb);\n      }\n      iff.close_chunk();\n#endif\n    }\n  // Add encoding of other chunks here\n}\n\n\nGP<DjVuAnno>\nDjVuAnno::copy(void) const\n{\n   GP<DjVuAnno> anno= new DjVuAnno;\n      // Copy any primitives (if any)\n   *anno=*this;\n      // Copy each substructure\n   if (ant) anno->ant = ant->copy();\n   return anno;\n}\n\nvoid\nDjVuAnno::merge(const GP<DjVuAnno> & anno)\n{\n   if (anno)\n   {\n      GP<ByteStream> gstr=ByteStream::create();\n      encode(gstr);\n      anno->encode(gstr);\n      gstr->seek(0);\n      decode(gstr);\n   }\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVuAnno.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _DJVUANNO_H\n#define _DJVUANNO_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n\n/** @name DjVuAnno.h\n\n    Files #\"DjVuAnno.h\"# and #\"DjVuAnno.cpp\"# implement the mechanism for\n    annotating DjVuImages. Annotations are additional instructions for the\n    plugin about how the image should be displayed.  The exact format of\n    annotations is not strictly defined. The only requirement is that they\n    have to be stored as a sequence of chunks inside a #FORM:ANNO#.\n\n    This file implements annotations understood by the DjVu plugins \n    and encoders.\n\n\n    using: contents of #ANT*# chunks.\n\n    Contents of the #FORM:ANNO# should be passed to \\Ref{DjVuAnno::decode}()\n    for parsing, which initializes \\Ref{DjVuAnno::ANT} \n    and fills them with decoded data. \n    @memo Implements support for DjVuImage annotations\n    @author Andrei Erofeev <eaf@geocities.com>\n*/\n//@{\n\n\n#include \"GString.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass GMapArea;\nclass ByteStream;\n\n// -------- DJVUANT --------\n\n/** This class contains some trivial annotations of the page or of the\n    document such as page border color, page alignment, initial zoom and\n    display mode, hyperlinks and highlighted areas.  All this information is\n    put inside a textual chunk #ANTa# in pseudo-lisp format. Decoding and\n    encoding are normally done by \\Ref{DjVuANT::decode}() and\n    \\Ref{DjVuANT::encode}() functions. */\n\nclass DJVUAPI DjVuANT : public GPEnabled\n{\nprotected:\n      /// Constructs an empty annotation object.\n   DjVuANT(void);\n\npublic:\n   enum { MODE_UNSPEC=0, MODE_COLOR, MODE_FORE, MODE_BACK, MODE_BW };\n   enum { ZOOM_STRETCH=-4, ZOOM_ONE2ONE=-3, ZOOM_WIDTH=-2,\n\t  ZOOM_PAGE=-1, ZOOM_UNSPEC=0 };\n   enum alignment { ALIGN_UNSPEC=0, ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT,\n\t  ALIGN_TOP, ALIGN_BOTTOM };\n\n      /// Creates an empty annotation object.\n   static GP<DjVuANT> create(void) { return new DjVuANT; }\n   virtual ~DjVuANT();\n\n      /** Background color. Is in #0x00RRBBGG# format. #0xffffffff# if\n\t  there were no background color records in the annotation chunk. */\n   unsigned long int\tbg_color;\n      /** Initial zoom. Possible values are:\n\t  \\begin{description}\n          \\item[ZOOM_STRETCH] the image is stretched to the viewport.\n          \\item[ZOOM_ONE2ONE] the image is displayed pixel-to-pixel.\n          \\item[ZOOM_WIDTH] \"Fit width\" mode.\n          \\item[ZOOM_PAGE] \"Fit page\" mode.\n          \\item[ZOOM_UNSPEC] Annotation does not specify a zoom factor.\n          \\end{description} */\n   int\t\tzoom;\n      /** Initial mode. Possible values are:\n\t  \\begin{description}\n             \\item[MODE_COLOR] color mode.\n             \\item[MODE_FORE] foreground mode.\n             \\item[MODE_BACK] background mode.\n             \\item[MODE_BW] black and white mode.\n             \\item[MODE_UNSPEC] Annotation does not specify a display mode.\n\t     \\item[Any positive number] Zoom in \\%. Please note that\n                   all constants above are either negative or ZERO. Thus\n                   it's possible to distinguish numerical zoom from those\n                   special cases.\n          \\end{description} */\n   int\t\tmode;\n      /** Horizontal page alignment. Possible values are #ALIGN_LEFT#,\n\t  #ALIGN_CENTER#, #ALIGN_RIGHT# and #ALIGN_UNSPEC#. */\n   alignment hor_align;\n      /** Vertical page alignment. Possible values are #ALIGN_TOP#,\n\t  #ALIGN_CENTER#, #ALIGN_BOTTOM# and #ALIGN_UNSPEC#. */\n   alignment ver_align;\n      /** List of defined map areas. They may be just areas of highlighting\n\t  or hyperlink. Please refer to \\Ref{GMapArea}, \\Ref{GMapRect},\n\t  \\Ref{GMapPoly} and \\Ref{GMapOval} for details. */\n   GPList<GMapArea> map_areas;\n      /** Metainformations like title, author ... */\n   GMap<GUTF8String,GUTF8String> metadata;\n      /** Metainformations like title, author ... */\n   GUTF8String xmpmetadata;\n      /** Returns TRUE if no features are specified or specified features\n         are not different from default ones */\n   bool\tis_empty(void) const;\n\n      /** Decodes contents of annotation chunk #ANTa#. The chunk data is\n\t  read from ByteStream #bs# until reaching an end-of-stream marker.\n\t  This function is normally called after a call to\n\t  \\Ref{IFFByteStream::get_chunk}(). */\n   void\tdecode(ByteStream &bs);\n\n      /** Same as \\Ref{decode}() but adds the new data to what has\n\t  been decoded before. */\n   void merge(ByteStream & bs);\n\n      /** Encodes the #ANTa# chunk. The annotation data is simply written\n\t  into ByteStream #bs# with no IFF header. This function is normally\n\t  called after a call to \\Ref{IFFByteStream::put_chunk}(). */\n   void encode(ByteStream &bs);\n\n      /// Encodes data back into raw annotation data.\n   GUTF8String encode_raw(void) const;\n\n      /// Returns a copy of this object\n   GP<DjVuANT>\tcopy(void) const;\n   \n      /** Returns the number of bytes needed by this data structure. It's\n\t  used by caching routines to estimate the size of a \\Ref{DjVuImage}. */\n   unsigned int get_memory_usage() const;\n\n      /// Converts color from string in \\#RRGGBB notation to an unsigned integer\n   static unsigned long int\tcvt_color(const char * color, unsigned long int def);\n      /// Obtain the <MAP></MAP> tag for these annotations.\n   GUTF8String get_xmlmap(const GUTF8String &name, const int height) const;\n      /// Write the <MAP></MAP> tag for these annotations.\n   void writeMap(\n     ByteStream &bs,const GUTF8String &name, const int height) const;\n      /// Obtain the XML flags for the default specifications.\n   GUTF8String get_paramtags(void) const;\n      /// Write the XML flags for the default specifications.\n   void writeParam(ByteStream &out_str) const;\nprivate:\n   void\tdecode(class GLParser & parser);\n   static GUTF8String read_raw(ByteStream & str);\n   static unsigned char\tdecode_comp(char ch1, char ch2);\n   static unsigned long int get_bg_color(class GLParser & parser);\n   static int get_zoom(class GLParser & parser);\n   static int get_mode(class GLParser & parser);\n   static alignment get_hor_align(class GLParser & parser);\n   static alignment get_ver_align(class GLParser & parser);\n   static GPList<GMapArea> get_map_areas(class GLParser & parser);\n   static GMap<GUTF8String, GUTF8String>get_metadata(GLParser & parser);\n   static GUTF8String get_xmpmetadata(GLParser & parser);\n   static void del_all_items(const char * name, class GLParser & parser);\n};\n\n// -------- DJVUANNO --------\n\n\n/** This is a top-level class containing annotations of a DjVu document (or\n    just a page). It has only two functions: \\Ref{encode}() and\n    \\Ref{decode}().  Both of them work with a sequence of annotation chunks\n    from #FORM:ANNO# form. Basing on the name of the chunks they call\n    #encode()# and #decode()# functions of the proper annotation structure\n    (like \\Ref{ANT}). The real work of encoding and decoding is done by\n    lower-level classes. */\nclass DJVUAPI DjVuAnno : public GPEnabled\n{\nprotected:\n   DjVuAnno(void) {}\npublic:\n   /// Creation method.\n   static GP<DjVuAnno> create(void) { return new DjVuAnno; }\n\n   GP<DjVuANT>\tant;\n\n      /** Decodes a sequence of annotation chunks and merges contents of every\n\t  chunk with previously decoded information. This function\n\t  should be called right after applying \\Ref{IFFByteStream::get_chunk}()\n\t  to data from #FORM:ANNO#. */\n   void decode(const GP<ByteStream> &bs);\n\n      /** Encodes all annotations back into a sequence of chunks to be put\n\t  inside a #FORM:ANNO#. */\n   void\tencode(const GP<ByteStream> &bs);\n\n      /// Returns a copy of this object\n   GP<DjVuAnno>\tcopy(void) const;\n\n      /** Merged the contents of this class and of annotations\n\t  pointed by #anno# pointer */\n   void\t\tmerge(const GP<DjVuAnno> & anno);\n\n      /** Returns the number of bytes needed by this data structure. It's\n\t  used by caching routines to estimate the size of a \\Ref{DjVuImage}. */\n   inline unsigned int get_memory_usage() const;\n      /// Obtain the <MAP></MAP> tag for these annotations.\n   GUTF8String get_xmlmap(const GUTF8String &name, const int height) const;\n      /// Write the <MAP></MAP> tag for these annotations.\n   void writeMap(\n     ByteStream &bs,const GUTF8String &name, const int height) const;\n      /// Obtain the XML flags for the default specifications.\n   GUTF8String get_paramtags(void) const;\n      /// Write the XML flags for the default specifications.\n   void writeParam(ByteStream &out_str) const;\nprivate: // dummy stuff\n   static void decode(ByteStream *);\n   static void encode(ByteStream *);\n};\n\n//@}\n\ninline unsigned int \nDjVuAnno::get_memory_usage() const\n{\n  return (ant)?(ant->get_memory_usage()):0;\n}\n\n// ----- THE END\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVuDocEditor.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"DjVuDocEditor.h\"\n#include \"DjVuImage.h\"\n#include \"IFFByteStream.h\"\n#include \"DataPool.h\"\n#include \"IW44Image.h\"\n#include \"GOS.h\"\n#include \"GURL.h\"\n#include \"DjVuAnno.h\"\n#include \"GRect.h\"\n#include \"DjVmNav.h\"\n\n#include \"debug.h\"\n\n#include <ctype.h>\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\nstatic const char octets[4]={0x41,0x54,0x26,0x54};\n\nint        DjVuDocEditor::thumbnails_per_file=10;\n\n// This is a structure for active files and DataPools. It may contain\n// a DjVuFile, which is currently being used by someone (I check the list\n// and get rid of hanging files from time to time) or a DataPool,\n// which is \"custom\" with respect to the document (was modified or\n// inserted), or both.\n//\n// DjVuFile is set to smth!=0 when it's created using url_to_file().\n//          It's reset back to ZERO in clean_files_map() when\n//\t  it sees, that a given file is not used by anyone.\n// DataPool is updated when a file is inserted\nclass DjVuDocEditor::File : public GPEnabled\n{\npublic:\n  // 'pool' below may be non-zero only if it cannot be retrieved\n  // by the DjVuDocument, that is it either corresponds to a\n  // modified DjVuFile or it has been inserted. Otherwise it's ZERO\n  // Once someone assigns a non-zero DataPool, it remains non-ZERO\n  // (may be updated if the file gets modified) and may be reset\n  // only by save() or save_as() functions.\n  GP<DataPool>\tpool;\n\n  // If 'file' is non-zero, it means, that it's being used by someone\n  // We check for unused files from time to time and ZERO them.\n  // But before we do it, we may save the DataPool in the case if\n  // file has been modified.\n  GP<DjVuFile>\tfile;\n};\n\nvoid\nDjVuDocEditor::check(void)\n{\n   if (!initialized) G_THROW( ERR_MSG(\"DjVuDocEditor.not_init\") );\n}\n\nDjVuDocEditor::DjVuDocEditor(void)\n{\n   initialized=false;\n   refresh_cb=0;\n   refresh_cl_data=0;\n}\n\nDjVuDocEditor::~DjVuDocEditor(void)\n{\n   GCriticalSectionLock lock(&thumb_lock);\n   thumb_map.empty();\n   DataPool::close_all();\n}\n\nvoid\nDjVuDocEditor::init(void)\n{\n   DEBUG_MSG(\"DjVuDocEditor::init() called\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n      // If you remove this check be sure to delete thumb_map\n   if (initialized) G_THROW( ERR_MSG(\"DjVuDocEditor.init\") );\n\n   doc_url=GURL::Filename::UTF8(\"noname.djvu\");\n\n   const GP<DjVmDoc> doc(DjVmDoc::create());\n   const GP<ByteStream> gstr(ByteStream::create());\n   doc->write(gstr);\n   gstr->seek(0, SEEK_SET);\n   doc_pool=DataPool::create(gstr);\n\n   orig_doc_type=UNKNOWN_TYPE;\n   orig_doc_pages=0;\n\n   initialized=true;\n\n   DjVuDocument::init(doc_url, this);\n}\n\nvoid\nDjVuDocEditor::init(const GURL &url)\n{\n   DEBUG_MSG(\"DjVuDocEditor::init() called: url='\" << url << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n      // If you remove this check be sure to delete thumb_map\n   if (initialized)\n     G_THROW( ERR_MSG(\"DjVuDocEditor.init\") );\n\n      // First - create a temporary DjVuDocument and check its type\n   doc_pool=DataPool::create(url);\n   doc_url=url;\n   const GP<DjVuDocument> tmp_doc(DjVuDocument::create_wait(doc_url,this));\n   if (!tmp_doc->is_init_ok())\n      G_THROW( ERR_MSG(\"DjVuDocEditor.open_fail\") \"\\t\" +url.get_string());\n\n   orig_doc_type=tmp_doc->get_doc_type();\n   orig_doc_pages=tmp_doc->get_pages_num();\n   if (orig_doc_type==OLD_BUNDLED ||\n       orig_doc_type==OLD_INDEXED ||\n       orig_doc_type==SINGLE_PAGE)\n   {\n     // Suxx. I need to convert it now.\n     GP<ByteStream> gstr = ByteStream::create();  // Convert in memory.\n     tmp_doc->write(gstr, true);  // Force DJVM format\n     gstr->seek(0);                     \n     doc_pool=DataPool::create(gstr);\n   }\n\n      // OK. Now doc_pool contains data of the document in one of the\n      // new formats. It will be a lot easier to insert/delete pages now.\n      // 'doc_url' below of course doesn't refer to the file with the converted\n      // data, but we will take care of it by redirecting the request_data().\n   initialized=true;\n   DjVuDocument::init(doc_url, this);\n\n      // Cool. Now extract the thumbnails...\n   GCriticalSectionLock lock(&thumb_lock);\n   int pages_num=get_pages_num();\n   for(int page_num=0;page_num<pages_num;page_num++)\n   {\n\t // Call DjVuDocument::get_thumbnail() here to bypass logic\n\t // of DjVuDocEditor::get_thumbnail(). init() is the only safe\n\t // place where we can still call DjVuDocument::get_thumbnail();\n      const GP<DataPool> pool(DjVuDocument::get_thumbnail(page_num, true));\n      if (pool)\n      {\n        thumb_map[page_to_id(page_num)]=pool;\n      }\n   }\n      // And remove then from DjVmDir so that DjVuDocument\n      // does not try to use them\n   unfile_thumbnails();\n}\n\nGP<DataPool>\nDjVuDocEditor::request_data(const DjVuPort * source, const GURL & url)\n{\n   DEBUG_MSG(\"DjVuDocEditor::request_data(): url='\" << url << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n      // Check if we have either original data or converted (to new format),\n      // if all the story is about the DjVuDocument's data\n   if (url==doc_url)\n     return doc_pool;\n\n      // Now see if we have any file matching the url\n   const GP<DjVmDir::File> frec(djvm_dir->name_to_file(url.fname()));\n   if (frec)\n   {\n      GCriticalSectionLock lock(&files_lock);\n      GPosition pos;\n      if (files_map.contains(frec->get_load_name(), pos))\n      {\n         const GP<File> f(files_map[pos]);\n         if (f->file && f->file->get_init_data_pool())\n            return f->file->get_init_data_pool();// Favor DjVuFile's knowledge\n         else if (f->pool) return f->pool;\n      }\n   }\n\n      // Finally let DjVuDocument cope with it. It may be a connected DataPool\n      // for a BUNDLED format. Or it may be a file. Anyway, it was not\n      // manually included, so it should be in the document.\n   const GP<DataPool> pool(DjVuDocument::request_data(source, url));\n\n      // We do NOT update the 'File' structure, because our rule is that\n      // we keep a separate copy of DataPool in 'File' only if it cannot\n      // be retrieved from DjVuDocument (like it has been \"inserted\" or\n      // corresponds to a modified file).\n   return pool;\n}\n\nvoid\nDjVuDocEditor::clean_files_map(void)\n      // Will go thru the map of files looking for unreferenced\n      // files or records w/o DjVuFile and DataPool.\n      // These will be modified and/or removed.\n{\n   DEBUG_MSG(\"DjVuDocEditor::clean_files_map() called\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   GCriticalSectionLock lock(&files_lock);\n\n      // See if there are too old items in the \"cache\", which are\n      // not referenced by anyone. If the corresponding DjVuFile has been\n      // modified, obtain the new data and replace the 'pool'. Clear the\n      // DjVuFile anyway. If both DataPool and DjVuFile are zero, remove\n      // the entry.\n   for(GPosition pos=files_map;pos;)\n   {\n      const GP<File> f(files_map[pos]);\n      if (f->file && f->file->get_count()==1)\n      {\n         DEBUG_MSG(\"ZEROing file '\" << f->file->get_url() << \"'\\n\");\n         if (f->file->is_modified())\n            f->pool=f->file->get_djvu_data(false);\n         f->file=0;\n      }\n      if (!f->file && !f->pool)\n      {\n         DEBUG_MSG(\"Removing record '\" << files_map.key(pos) << \"'\\n\");\n         GPosition this_pos=pos;\n         ++pos;\n         files_map.del(this_pos);\n      } else ++pos;\n   }\n}\n\nGP<DjVuFile>\nDjVuDocEditor::url_to_file(const GURL & url, bool dont_create) const\n{\n   DEBUG_MSG(\"DjVuDocEditor::url_to_file(): url='\" << url << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n      // Check if have a DjVuFile with this url cached (created before\n      // and either still active or left because it has been modified)\n   GP<DjVmDir::File> frec;\n   if((const DjVmDir *)djvm_dir)\n     frec=djvm_dir->name_to_file(url.fname());\n   if (frec)\n   {\n      GCriticalSectionLock lock(&(const_cast<DjVuDocEditor *>(this)->files_lock));\n      GPosition pos;\n      if (files_map.contains(frec->get_load_name(), pos))\n      {\n         const GP<File> f(files_map[pos]);\n         if (f->file)\n           return f->file;\n      }\n   }\n\n   const_cast<DjVuDocEditor *>(this)->clean_files_map();\n\n      // We don't have the file cached. Let DjVuDocument create the file.\n   const GP<DjVuFile> file(DjVuDocument::url_to_file(url, dont_create));\n\n      // And add it to our private \"cache\"\n   if (file && frec)\n   {\n      GCriticalSectionLock lock(&(const_cast<DjVuDocEditor *>(this)->files_lock));\n      GPosition pos;\n      if (files_map.contains(frec->get_load_name(), pos))\n      {\n         files_map[frec->get_load_name()]->file=file;\n      }else\n      {\n         const GP<File> f(new File());\n         f->file=file;\n         const_cast<DjVuDocEditor *>(this)->files_map[frec->get_load_name()]=f;\n      }\n   }\n\n   return file;\n}\n\nGUTF8String\nDjVuDocEditor::page_to_id(int page_num) const\n{\n   if (page_num<0 || page_num>=get_pages_num())\n     G_THROW( ERR_MSG(\"DjVuDocEditor.page_num\") \"\\t\"+GUTF8String(page_num));\n   const GP<DjVmDir::File> f(djvm_dir->page_to_file(page_num));\n   if (! f)\n     G_THROW( ERR_MSG(\"DjVuDocEditor.page_num\") \"\\t\"+GUTF8String(page_num));\n\n   return f->get_load_name();\n}\n\nGUTF8String\nDjVuDocEditor::find_unique_id(GUTF8String id)\n{\n  const GP<DjVmDir> dir(get_djvm_dir());\n\n  GUTF8String base, ext;\n  const int dot=id.rsearch('.');\n  if(dot >= 0)\n  {\n    base=id.substr(0,dot);\n    ext=id.substr(dot+1,(unsigned int)-1);\n  }else\n  {\n    base=id;\n  }\n\n  int cnt=0;\n  while (!(!dir->id_to_file(id) &&\n           !dir->name_to_file(id) &&\n           !dir->title_to_file(id)))\n  {\n     cnt++;\n     id=base+\"_\"+GUTF8String(cnt);\n     if (ext.length())\n       id+=\".\"+ext;\n  }\n  return id;\n}\n\nGP<DataPool>\nDjVuDocEditor::strip_incl_chunks(const GP<DataPool> & pool_in)\n{\n   DEBUG_MSG(\"DjVuDocEditor::strip_incl_chunks() called\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   const GP<IFFByteStream> giff_in(\n     IFFByteStream::create(pool_in->get_stream()));\n\n   const GP<ByteStream> gbs_out(ByteStream::create());\n   const GP<IFFByteStream> giff_out(IFFByteStream::create(gbs_out));\n\n   IFFByteStream &iff_in=*giff_in;\n   IFFByteStream &iff_out=*giff_out;\n\n   bool have_incl=false;\n   int chksize;\n   GUTF8String chkid;\n   if (iff_in.get_chunk(chkid))\n   {\n      iff_out.put_chunk(chkid);\n      while((chksize=iff_in.get_chunk(chkid)))\n      {\n         if (chkid!=\"INCL\")\n         {\n            iff_out.put_chunk(chkid);\n            iff_out.copy(*iff_in.get_bytestream());\n            iff_out.close_chunk();\n         } else\n         {\n           have_incl=true;\n         }\n         iff_in.close_chunk();\n      }\n      iff_out.close_chunk();\n   }\n\n   if (have_incl)\n   {\n      gbs_out->seek(0,SEEK_SET);\n      return DataPool::create(gbs_out);\n   } else return pool_in;\n}\n\nGUTF8String\nDjVuDocEditor::insert_file(const GURL &file_url, const GUTF8String &parent_id,\n                           int chunk_num, DjVuPort *source)\n      // Will open the 'file_name' and insert it into an existing DjVuFile\n      // with ID 'parent_id'. Will insert the INCL chunk at position chunk_num\n      // Will NOT process ANY files included into the file being inserted.\n      // Moreover it will strip out any INCL chunks in that file...\n{\n   DEBUG_MSG(\"DjVuDocEditor::insert_file(): fname='\" << file_url <<\n             \"', parent_id='\" << parent_id << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n   const GP<DjVmDir> dir(get_djvm_dir());\n\n   if(!source)\n     source=this;\n      // Create DataPool and see if the file exists\n   GP<DataPool> file_pool;\n   if(file_url.is_empty()||file_url.is_local_file_url())\n   {\n     file_pool=DataPool::create(file_url);\n   }else\n   {\n     file_pool=source->request_data(source, file_url);\n     if(source != this)\n     {\n       file_pool=DataPool::create(file_pool->get_stream());\n     }\n   }\n   if(file_pool && file_url && DjVuDocument::djvu_import_codec)\n   {\n     (*DjVuDocument::djvu_import_codec)(file_pool,file_url,needs_compression_flag,can_compress_flag);\n   }\n\n      // Strip any INCL chunks\n   file_pool=strip_incl_chunks(file_pool);\n\n      // Check if parent ID is valid\n   GP<DjVmDir::File> parent_frec(dir->id_to_file(parent_id));\n   if (!parent_frec)\n     parent_frec=dir->name_to_file(parent_id);\n   if (!parent_frec)\n     parent_frec=dir->title_to_file(parent_id);\n   if (!parent_frec)\n     G_THROW( ERR_MSG(\"DjVuDocEditor.no_file\") \"\\t\" +parent_id);\n   const GP<DjVuFile> parent_file(get_djvu_file(parent_id));\n   if (!parent_file)\n     G_THROW( ERR_MSG(\"DjVuDocEditor.create_fail\") \"\\t\"+parent_id);\n\n      // Now obtain ID for the new file\n   const GUTF8String id(find_unique_id(file_url.fname()));\n\n      // Add it into the directory\n   const GP<DjVmDir::File> frec(\n     DjVmDir::File::create(id, id, id, DjVmDir::File::INCLUDE));\n   int pos=dir->get_file_pos(parent_frec);\n   if (pos>=0)\n     ++pos;\n   dir->insert_file(frec, pos);\n\n      // Add it to our \"cache\"\n   {\n      const GP<File> f(new File);\n      f->pool=file_pool;\n      GCriticalSectionLock lock(&files_lock);\n      files_map[id]=f;\n   }\n\n      // And insert it into the parent DjVuFile\n   parent_file->insert_file(id, chunk_num);\n\n   return id;\n}\n\n      // First it will insert the 'file_url' at position 'file_pos'.\n      //\n      // Then it will process all the INCL chunks in the file and try to do\n      // the same thing with the included files. If insertion of an included\n      // file fails, it will proceed with other INCL chunks until it does\n      // them all. In the very end we will throw exception to let the caller\n      // know about problems with included files.\n      //\n      // If the name of a file being inserted conflicts with some other\n      // name, which has been in DjVmDir prior to call to this function,\n      // it will be modified. name2id is the translation table to\n      // keep track of these modifications.\n      //\n      // Also, if a name is in name2id, we will not insert that file again.\n      //\n      // Will return TRUE if the file has been successfully inserted.\n      // FALSE, if the file contains NDIR chunk and has been skipped.\nbool\nDjVuDocEditor::insert_file(const GURL &file_url, bool is_page,\n  int & file_pos, GMap<GUTF8String, GUTF8String> & name2id,\n  DjVuPort *source)\n{\n\n  DEBUG_MSG(\"DjVuDocEditor::insert_file(): file_url='\" << file_url <<\n             \"', is_page='\" << is_page << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n  if (refresh_cb)\n    refresh_cb(refresh_cl_data);\n\n\n      // We do not want to insert the same file twice (important when\n      // we insert a group of files at the same time using insert_group())\n      // So we check if we already did that and return if so.\n  if (name2id.contains(file_url.fname()))\n    return true;\n\n  if(!source)\n    source=this;\n\n  GP<DataPool> file_pool;\n  if(file_url.is_empty()||file_url.is_local_file_url())\n  {\n    file_pool=DataPool::create(file_url);\n  }\n  else\n  {\n    file_pool=source->request_data(source, file_url);\n    if(source != this)\n    {\n      file_pool=DataPool::create(file_pool->get_stream());\n    }\n  }\n       // Create DataPool and see if the file exists\n  if(file_pool && !file_url.is_empty() && DjVuDocument::djvu_import_codec)\n  {\n      (*DjVuDocument::djvu_import_codec)(file_pool,file_url,\n                                         needs_compression_flag,\n                                         can_compress_flag);\n  }\n\n  // Oh. It does exist... Check that it has IFF structure\n  {\n    const GP<IFFByteStream> giff(\n       IFFByteStream::create(file_pool->get_stream()));\n    IFFByteStream &iff=*giff;\n    GUTF8String chkid;\n    iff.get_chunk(chkid);\n    if (chkid!=\"FORM:DJVI\" && chkid!=\"FORM:DJVU\" &&\n        chkid!=\"FORM:BM44\" && chkid!=\"FORM:PM44\")\n      G_THROW( ERR_MSG(\"DjVuDocEditor.not_1_page\") \"\\t\"\n               + file_url.get_string());\n    // Wonderful. It's even a DjVu file. Scan for NDIR chunks.\n    // If NDIR chunk is found, ignore the file\n    while(iff.get_chunk(chkid))\n      {\n        if (chkid==\"NDIR\")\n          return false;\n        iff.close_chunk();\n      }\n  }\n  return insert_file(file_pool,file_url,is_page,file_pos,name2id,source);\n}\n\nbool\nDjVuDocEditor::insert_file(const GP<DataPool> &file_pool,\n  const GURL &file_url, bool is_page,\n  int & file_pos, GMap<GUTF8String, GUTF8String> & name2id,\n  DjVuPort *source)\n{\n  GUTF8String errors;\n  if(file_pool)\n  {\n    const GP<DjVmDir> dir(get_djvm_dir());\n    G_TRY\n    {\n         // Now get a unique name for this file.\n         // Check the name2id first...\n      const GUTF8String name=file_url.fname();\n      GUTF8String id;\n      if (name2id.contains(name))\n      {\n        id=name2id[name];\n      }else\n      {\n           // Check to see if this page exists with a different name.\n        if(!is_page)\n        {\n          GPList<DjVmDir::File> list(dir->get_files_list());\n          for(GPosition pos=list;pos;++pos)\n          {\n            DEBUG_MSG(\"include \" << list[pos]->is_include() \n                      << \" size=\" << list[pos]->size << \" length=\" \n                      << file_pool->get_length() << \"\\n\");\n            if(list[pos]->is_include() \n               && (!list[pos]->size \n                   || (list[pos]->size == file_pool->get_length())))\n            {\n              id=list[pos]->get_load_name();\n              GP<DjVuFile> file(get_djvu_file(id,false));\n              const GP<DataPool> pool(file->get_djvu_data(false));\n              if(file_pool->simple_compare(*pool))\n              {\n                // The files are the same, so just store the alias.\n                name2id[name]=id;\n              }\n              const GP<IFFByteStream> giff_old(IFFByteStream::create(pool->get_stream()));\n              const GP<IFFByteStream> giff_new(IFFByteStream::create(file_pool->get_stream()));\n              file=0;\n              if(giff_old->compare(*giff_new))\n              {\n                // The files are the same, so just store the alias.\n                name2id[name]=id;\n                return true;\n              }\n            } \n          }\n        }\n        // Otherwise create a new unique ID and remember the translation\n        id=find_unique_id(name);\n        name2id[name]=id;\n      }\n\n         // Good. Before we continue with the included files we want to\n         // complete insertion of this one. Notice, that insertion of\n         // children may fail, in which case we will have to modify\n         // data for this file to get rid of invalid INCL\n\n         // Create a file record with the chosen ID\n      const GP<DjVmDir::File> file(DjVmDir::File::create(id, id, id,\n        is_page ? DjVmDir::File::PAGE : DjVmDir::File::INCLUDE ));\n\n         // And insert it into the directory\n      file_pos=dir->insert_file(file, file_pos);\n\n         // And add the File record (containing the file URL and DataPool)\n      {\n         const GP<File> f(new File);\n         f->pool=file_pool;\n         GCriticalSectionLock lock(&files_lock);\n         files_map[id]=f;\n      }\n\n         // The file has been added. If it doesn't include anything else,\n         // that will be enough. Otherwise repeat what we just did for every\n         // included child. Don't forget to modify the contents of INCL\n         // chunks due to name2id translation.\n         // We also want to include here our file with shared annotations,\n         // if it exists.\n      GUTF8String chkid;\n      const GP<IFFByteStream> giff_in(\n        IFFByteStream::create(file_pool->get_stream()));\n      IFFByteStream &iff_in=*giff_in;\n      const GP<ByteStream> gstr_out(ByteStream::create());\n      const GP<IFFByteStream> giff_out(IFFByteStream::create(gstr_out));\n      IFFByteStream &iff_out=*giff_out;\n\n      const GP<DjVmDir::File> shared_frec(djvm_dir->get_shared_anno_file());\n\n      iff_in.get_chunk(chkid);\n      iff_out.put_chunk(chkid);\n      while(iff_in.get_chunk(chkid))\n      {\n         if (chkid!=\"INCL\")\n         {\n            iff_out.put_chunk(chkid);\n            iff_out.copy(*iff_in.get_bytestream());\n            iff_in.close_chunk();\n            iff_out.close_chunk();\n            if (shared_frec && chkid==\"INFO\")\n            {\n               iff_out.put_chunk(\"INCL\");\n               iff_out.get_bytestream()->writestring(shared_frec->get_load_name());\n               iff_out.close_chunk();\n            }\n         } else\n         {\n            GUTF8String name;\n            char buffer[1024];\n            int length;\n            while((length=iff_in.read(buffer, 1024)))\n               name+=GUTF8String(buffer, length);\n            while(isspace(name[0]))\n            {\n              name=name.substr(1,(unsigned int)-1);\n            }\n            while(isspace(name[(int)name.length()-1]))\n            {\n              name.setat(name.length()-1, 0);\n            }\n            const GURL::UTF8 full_url(name,file_url.base());\n            iff_in.close_chunk();\n\n            G_TRY {\n               if (insert_file(full_url, false, file_pos, name2id, source))\n               {\n                     // If the child file has been inserted (doesn't\n                     // contain NDIR chunk), add INCL chunk.\n                  GUTF8String id=name2id[name];\n                  iff_out.put_chunk(\"INCL\");\n                  iff_out.get_bytestream()->writestring(id);\n                  iff_out.close_chunk();\n               }\n            } G_CATCH(exc) {\n                  // Should an error occur, we move on. INCL chunk will\n                  // not be copied.\n               if (errors.length())\n                 errors+=\"\\n\\n\";\n               errors+=exc.get_cause();\n            } G_ENDCATCH;\n         }\n      } // while(iff_in.get_chunk(chkid))\n      iff_out.close_chunk();\n\n      // Increment the file_pos past the page inserted.\n      if (file_pos>=0) file_pos++;\n\n         // We have just inserted every included file. We may have modified\n         // contents of the INCL chunks. So we need to update the DataPool...\n      gstr_out->seek(0);\n      const GP<DataPool> new_file_pool(DataPool::create(gstr_out));\n      {\n            // It's important that we replace the pool here anyway.\n            // By doing this we load the file into memory. And this is\n            // exactly what insert_group() wants us to do because\n            // it creates temporary files.\n         GCriticalSectionLock lock(&files_lock);\n         files_map[id]->pool=new_file_pool;\n      }\n    } G_CATCH(exc) {\n      if (errors.length())\n        errors+=\"\\n\\n\";\n      errors+=exc.get_cause();\n      G_THROW(errors);\n    } G_ENDCATCH;\n\n      // The only place where we intercept exceptions is when we process\n      // included files. We want to process all of them even if we failed to\n      // process one. But here we need to let the exception propagate...\n    if (errors.length())\n      G_THROW(errors);\n\n    return true;\n  }\n  return false;\n}\n\nvoid\nDjVuDocEditor::insert_group(const GList<GURL> & file_urls, int page_num,\n                             void (* _refresh_cb)(void *), void * _cl_data)\n      // The function will insert every file from the list at position\n      // corresponding to page_num. If page_num is negative, concatenation\n      // will occur. Included files will be processed as well\n{\n  refresh_cb=_refresh_cb;\n  refresh_cl_data=_cl_data;\n\n  G_TRY\n  {\n\n     // First translate the page_num to file_pos.\n    const GP<DjVmDir> dir(get_djvm_dir());\n    int file_pos;\n    if (page_num<0 || page_num>=dir->get_pages_num())\n    {\n      file_pos=-1;\n    }\n    else\n    {\n      file_pos=dir->get_page_pos(page_num);\n    }\n\n       // Now call the insert_file() for every page. We will remember the\n       // name2id translation table. Thus insert_file() will remember IDs\n       // it assigned to shared files\n    GMap<GUTF8String, GUTF8String> name2id;\n\n    GUTF8String errors;\n    for(GPosition pos=file_urls;pos;++pos)\n    {\n      const GURL &furl=file_urls[pos];\n      DEBUG_MSG( \"Inserting file '\" << furl << \"'\\n\" );\n      G_TRY\n      {\n               // Check if it's a multipage document...\n        GP<DataPool> xdata_pool(DataPool::create(furl));\n        if(xdata_pool && furl.is_valid()\n           && furl.is_local_file_url() && DjVuDocument::djvu_import_codec)\n        {\n          (*DjVuDocument::djvu_import_codec)(xdata_pool,furl,\n                                             needs_compression_flag,\n                                             can_compress_flag);\n        }\n        GUTF8String chkid;\n        IFFByteStream::create(xdata_pool->get_stream())->get_chunk(chkid);\n        if (name2id.contains(furl.fname())||(chkid==\"FORM:DJVM\"))\n        {\n          GMap<GUTF8String,void *> map;\n          map_ids(map);\n          DEBUG_MSG(\"Read DjVuDocument furl='\" << furl << \"'\\n\");\n          GP<ByteStream> gbs(ByteStream::create());\n          GP<DjVuDocument> doca(DjVuDocument::create_noinit());\n          doca->set_verbose_eof(verbose_eof);\n          doca->set_recover_errors(recover_errors);\n          doca->init(furl /* ,this */ );\n          doca->wait_for_complete_init();\n          get_portcaster()->add_route(doca,this);\n          DEBUG_MSG(\"Saving DjVuDocument url='\" << furl << \"' with unique names\\n\");\n          doca->write(gbs,map);\n          gbs->seek(0L);\n          DEBUG_MSG(\"Loading unique names\\n\");\n          GP<DjVuDocument> doc(DjVuDocument::create(gbs));\n          doc->set_verbose_eof(verbose_eof);\n          doc->set_recover_errors(recover_errors);\n          doc->wait_for_complete_init();\n          get_portcaster()->add_route(doc,this);\n          gbs=0;\n          DEBUG_MSG(\"Inserting pages\\n\");\n          int pages_num=doc->get_pages_num();\n          for(int page_num=0;page_num<pages_num;page_num++)\n          {\n            const GURL url(doc->page_to_url(page_num));\n            insert_file(url, true, file_pos, name2id, doc);\n          }\n        }\n        else\n        {\n          insert_file(furl, true, file_pos, name2id, this);\n        }\n      } G_CATCH(exc)\n      {\n        if (errors.length())\n        {\n          errors+=\"\\n\\n\";\n        }\n        errors+=exc.get_cause();\n      }\n      G_ENDCATCH;\n    }\n    if (errors.length())\n    {\n      G_THROW(errors);\n    }\n  } G_CATCH_ALL\n  {\n    refresh_cb=0;\n    refresh_cl_data=0;\n    G_RETHROW;\n  } G_ENDCATCH;\n  refresh_cb=0;\n  refresh_cl_data=0;\n}\n\nvoid\nDjVuDocEditor::insert_page(const GURL &file_url, int page_num)\n{\n   DEBUG_MSG(\"DjVuDocEditor::insert_page(): furl='\" << file_url << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   GList<GURL> list;\n   list.append(file_url);\n\n   insert_group(list, page_num);\n}\n\nvoid\nDjVuDocEditor::insert_page(GP<DataPool> & _file_pool,\n\t\t\t   const GURL & file_url, int page_num)\n      // Use _file_pool as source of data, create a new DjVuFile\n      // with name file_name, and insert it as page number page_num\n{\n   DEBUG_MSG(\"DjVuDocEditor::insert_page(): pool size='\" <<\n\t     _file_pool->get_size() << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   const GP<DjVmDir> dir(get_djvm_dir());\n\n      // Strip any INCL chunks (we do not allow to insert hierarchies\n      // using this function)\n   const GP<DataPool> file_pool(strip_incl_chunks(_file_pool));\n   \n      // Now obtain ID for the new file\n   const GUTF8String id(find_unique_id(file_url.fname()));\n\n      // Add it into the directory\n   const GP<DjVmDir::File> frec(DjVmDir::File::create(\n     id, id, id, DjVmDir::File::PAGE));\n   int pos=dir->get_page_pos(page_num);\n   dir->insert_file(frec, pos);\n\n      // Add it to our \"cache\"\n   {\n      GP<File> f=new File;\n      f->pool=file_pool;\n      GCriticalSectionLock lock(&files_lock);\n      files_map[id]=f;\n   }\n}\n\nvoid\nDjVuDocEditor::generate_ref_map(const GP<DjVuFile> & file,\n\t\t\t\tGMap<GUTF8String, void *> & ref_map,\n\t\t\t\tGMap<GURL, void *> & visit_map)\n      // This private function is used to generate a list (implemented as map)\n      // of files referencing the given file. To get list of all parents\n      // for file with ID 'id' iterate map obtained as\n      // *((GMap<GUTF8String, void *> *) ref_map[id])\n{\n   const GURL url=file->get_url();\n   const GUTF8String id(djvm_dir->name_to_file(url.fname())->get_load_name());\n   if (!visit_map.contains(url))\n   {\n      visit_map[url]=0;\n\n      GPList<DjVuFile> files_list=file->get_included_files(false);\n      for(GPosition pos=files_list;pos;++pos)\n      {\n         GP<DjVuFile> child_file=files_list[pos];\n            // First: add the current file to the list of parents for\n            // the child being processed\n         GURL child_url=child_file->get_url();\n         const GUTF8String child_id(\n           djvm_dir->name_to_file(child_url.fname())->get_load_name());\n         GMap<GUTF8String, void *> * parents=0;\n         if (ref_map.contains(child_id))\n            parents=(GMap<GUTF8String, void *> *) ref_map[child_id];\n         else\n            ref_map[child_id]=parents=new GMap<GUTF8String, void *>();\n         (*parents)[id]=0;\n            // Second: go recursively\n         generate_ref_map(child_file, ref_map, visit_map);\n      }\n   }\n}\n\nvoid\nDjVuDocEditor::remove_file(const GUTF8String &id, bool remove_unref,\n                           GMap<GUTF8String, void *> & ref_map)\n      // Private function, which will remove file with ID id.\n      //\n      // If will also remove all INCL chunks in parent files pointing\n      // to this one\n      //\n      // Finally, if remove_unref is TRUE, we will go down the files\n      // hierarchy removing every file, which becomes unreferenced.\n      //\n      // ref_map will be used to find out list of parents referencing\n      // this file (required when removing INCL chunks)\n{\n      // First get rid of INCL chunks in parents\n   GMap<GUTF8String, void *> * parents=(GMap<GUTF8String, void *> *) ref_map[id];\n   if (parents)\n   {\n      for(GPosition pos=*parents;pos;++pos)\n      {\n         const GUTF8String parent_id((*parents).key(pos));\n         const GP<DjVuFile> parent(get_djvu_file(parent_id));\n         if (parent)\n           parent->unlink_file(id);\n      }\n      delete parents;\n      parents=0;\n      ref_map.del(id);\n   }\n\n      // We will accumulate errors here.\n   GUTF8String errors;\n\n      // Now modify the ref_map and process children if necessary\n   GP<DjVuFile> file=get_djvu_file(id);\n   if (file)\n   {\n      G_TRY {\n         GPList<DjVuFile> files_list=file->get_included_files(false);\n         for(GPosition pos=files_list;pos;++pos)\n         {\n            GP<DjVuFile> child_file=files_list[pos];\n            GURL child_url=child_file->get_url();\n            const GUTF8String child_id(\n              djvm_dir->name_to_file(child_url.fname())->get_load_name());\n            GMap<GUTF8String, void *> * parents=(GMap<GUTF8String, void *> *) ref_map[child_id];\n            if (parents) parents->del(id);\n\n            if (remove_unref && (!parents || !parents->size()))\n               remove_file(child_id, remove_unref, ref_map);\n         }\n      } G_CATCH(exc) {\n         if (errors.length()) errors+=\"\\n\\n\";\n         errors+=exc.get_cause();\n      } G_ENDCATCH;\n   }\n\n      // Finally remove this file from the directory.\n   djvm_dir->delete_file(id);\n\n      // And get rid of its thumbnail, if any\n   GCriticalSectionLock lock(&thumb_lock);\n   GPosition pos(thumb_map.contains(id));\n   if (pos)\n   {\n     thumb_map.del(pos);\n   }\n   if (errors.length())\n     G_THROW(errors);\n}\n\nvoid\nDjVuDocEditor::remove_file(const GUTF8String &id, bool remove_unref)\n{\n   DEBUG_MSG(\"DjVuDocEditor::remove_file(): id='\" << id << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   if (!djvm_dir->id_to_file(id))\n      G_THROW( ERR_MSG(\"DjVuDocEditor.no_file\") \"\\t\"+id);\n\n      // First generate a map of references (containing the list of parents\n      // including this particular file. This will speed things up\n      // significatly.\n   GMap<GUTF8String, void *> ref_map;        // GMap<GUTF8String, GMap<GUTF8String, void *> *> in fact\n   GMap<GURL, void *> visit_map;        // To avoid loops\n\n   int pages_num=djvm_dir->get_pages_num();\n   for(int page_num=0;page_num<pages_num;page_num++)\n      generate_ref_map(get_djvu_file(page_num), ref_map, visit_map);\n\n      // Now call the function, which will do the removal recursively\n   remove_file(id, remove_unref, ref_map);\n\n      // And clear the ref_map\n   GPosition pos;\n   while((pos=ref_map))\n   {\n      GMap<GUTF8String, void *> * parents=(GMap<GUTF8String, void *> *) ref_map[pos];\n      delete parents;\n      ref_map.del(pos);\n   }\n}\n\nvoid\nDjVuDocEditor::remove_page(int page_num, bool remove_unref)\n{\n   DEBUG_MSG(\"DjVuDocEditor::remove_page(): page_num=\" << page_num << \"\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n      // Translate the page_num to ID\n   GP<DjVmDir> djvm_dir=get_djvm_dir();\n   if (page_num<0 || page_num>=djvm_dir->get_pages_num())\n      G_THROW( ERR_MSG(\"DjVuDocEditor.bad_page\") \"\\t\"+GUTF8String(page_num));\n\n      // And call general remove_file()\n   remove_file(djvm_dir->page_to_file(page_num)->get_load_name(), remove_unref);\n}\n\nvoid\nDjVuDocEditor::remove_pages(const GList<int> & page_list, bool remove_unref)\n{\n   DEBUG_MSG(\"DjVuDocEditor::remove_pages() called\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n      // First we need to translate page numbers to IDs (they will\n      // obviously be changing while we're removing pages one after another)\n   GP<DjVmDir> djvm_dir=get_djvm_dir();\n   GPosition pos ;\n   if (djvm_dir)\n   {\n      GList<GUTF8String> id_list;\n      for(pos=page_list;pos;++pos)\n      {\n         GP<DjVmDir::File> frec=djvm_dir->page_to_file(page_list[pos]);\n         if (frec)\n            id_list.append(frec->get_load_name());\n      }\n\n      for(pos=id_list;pos;++pos)\n      {\n         GP<DjVmDir::File> frec=djvm_dir->id_to_file(id_list[pos]);\n         if (frec)\n            remove_page(frec->get_page_num(), remove_unref);\n      }\n   }\n}\n\nvoid\nDjVuDocEditor::move_file(const GUTF8String &id, int & file_pos,\n                         GMap<GUTF8String, void *> & map)\n      // NOTE! file_pos here is the desired position in DjVmDir *after*\n      // the record with ID 'id' is removed.\n{\n   if (!map.contains(id))\n   {\n      map[id]=0;\n\n      GP<DjVmDir::File> file_rec=djvm_dir->id_to_file(id);\n      if (file_rec)\n      {\n         file_rec=new DjVmDir::File(*file_rec);\n         djvm_dir->delete_file(id);\n         djvm_dir->insert_file(file_rec, file_pos);\n\n         if (file_pos>=0)\n         {\n            file_pos++;\n        \n               // We care to move included files only if we do not append\n               // This is because the only reason why we move included\n               // files is to made them available sooner than they would\n               // be available if we didn't move them. By appending files\n               // we delay the moment when the data for the file becomes\n               // available, of course.\n            GP<DjVuFile> djvu_file=get_djvu_file(id);\n            if (djvu_file)\n            {\n               GPList<DjVuFile> files_list=djvu_file->get_included_files(false);\n               for(GPosition pos=files_list;pos;++pos)\n               {\n                  const GUTF8String name(files_list[pos]->get_url().fname());\n                  GP<DjVmDir::File> child_frec=djvm_dir->name_to_file(name);\n\n                     // If the child is positioned in DjVmDir AFTER the\n                     // file being processed (position is file_pos or greater),\n                     // move it to file_pos position\n                  if (child_frec)\n                     if (djvm_dir->get_file_pos(child_frec)>file_pos)\n                        move_file(child_frec->get_load_name(), file_pos, map);\n               }\n            }\n         }\n      }\n   }\n}\n\nvoid\nDjVuDocEditor::move_page(int page_num, int new_page_num)\n{\n  DEBUG_MSG(\"DjVuDocEditor::move_page(): page_num=\" << page_num <<\n\t    \", new_page_num=\" << new_page_num << \"\\n\");\n  DEBUG_MAKE_INDENT(3);\n\n  if (page_num==new_page_num) return;\n\n  int pages_num=get_pages_num();\n  if (page_num<0 || page_num>=pages_num)\n    G_THROW( ERR_MSG(\"DjVuDocEditor.bad_page\") \"\\t\"+GUTF8String(page_num));\n\n  const GUTF8String id(page_to_id(page_num));\n  int file_pos=-1;\n  if (new_page_num>=0 && new_page_num<pages_num)\n    {\n      if (new_page_num>page_num)        // Moving toward the end\n\t{\n\t  if (new_page_num<pages_num-1)\n\t    file_pos=djvm_dir->get_page_pos(new_page_num+1)-1;\n\t}\n      else\n\tfile_pos=djvm_dir->get_page_pos(new_page_num);\n    }\n\n  GMap<GUTF8String, void *> map;\n  move_file(id, file_pos, map);\n}\n\n#ifdef _WIN32_WCE_EMULATION         // Work around odd behavior under WCE Emulation\n#define CALLINGCONVENTION __cdecl\n#else\n#define CALLINGCONVENTION  /* */\n#endif\n\nstatic int\nCALLINGCONVENTION\ncmp(const void * ptr1, const void * ptr2)\n{\n   int num1=*(int *) ptr1;\n   int num2=*(int *) ptr2;\n   return num1<num2 ? -1 : num1>num2 ? 1 : 0;\n}\n\nstatic GList<int>\nsortList(const GList<int> & list)\n{\n   GArray<int> a(list.size()-1);\n   int cnt;\n   GPosition pos;\n   for(pos=list, cnt=0;pos;++pos, cnt++)\n      a[cnt]=list[pos];\n\n   qsort((int *) a, a.size(), sizeof(int), cmp);\n\n   GList<int> l;\n   for(int i=0;i<a.size();i++)\n      l.append(a[i]);\n\n   return l;\n}\n\nvoid\nDjVuDocEditor::move_pages(const GList<int> & _page_list, int shift)\n{\n   if (!shift) return;\n\n   GList<int> page_list=sortList(_page_list);\n\n   GList<GUTF8String> id_list;\n   for(GPosition pos=page_list;pos;++pos)\n   {\n      GP<DjVmDir::File> frec=djvm_dir->page_to_file(page_list[pos]);\n      if (frec)\n         id_list.append(frec->get_load_name());\n   }\n\n   if (shift<0)\n   {\n         // We have to start here from the smallest page number\n         // We will move it according to the 'shift', and all\n         // further moves are guaranteed not to affect its page number.\n\n         // We will be changing the 'min_page' to make sure that\n         // pages moved beyond the document will still be in correct order\n      int min_page=0;\n      for(GPosition pos=id_list;pos;++pos)\n      {\n         GP<DjVmDir::File> frec=djvm_dir->id_to_file(id_list[pos]);\n         if (frec)\n         {\n            int page_num=frec->get_page_num();\n            int new_page_num=page_num+shift;\n            if (new_page_num<min_page)\n               new_page_num=min_page++;\n            move_page(page_num, new_page_num);\n         }\n      }\n   } else\n   {\n         // We have to start here from the biggest page number\n         // We will move it according to the 'shift', and all\n         // further moves will not affect its page number.\n\n         // We will be changing the 'max_page' to make sure that\n         // pages moved beyond the document will still be in correct order\n      int max_page=djvm_dir->get_pages_num()-1;\n      for(GPosition pos=id_list.lastpos();pos;--pos)\n      {\n         GP<DjVmDir::File> frec=djvm_dir->id_to_file(id_list[pos]);\n         if (frec)\n         {\n            int page_num=frec->get_page_num();\n            int new_page_num=page_num+shift;\n            if (new_page_num>max_page)\n               new_page_num=max_page--;\n            move_page(page_num, new_page_num);\n         }\n      }\n   }\n}\n\nvoid\nDjVuDocEditor::set_file_name(const GUTF8String &id, const GUTF8String &name)\n{\n   DEBUG_MSG(\"DjVuDocEditor::set_file_name(), id='\" << id << \"', name='\" << name << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n      // It's important to get the URL now, because later (after we\n      // change DjVmDir) id_to_url() will be returning a modified value\n   GURL url=id_to_url(id);\n\n      // Change DjVmDir. It will check if the name is unique\n   djvm_dir->set_file_name(id, name);\n\n      // Now find DjVuFile (if any) and rename it\n   GPosition pos;\n   if (files_map.contains(id, pos))\n   {\n      GP<File> file=files_map[pos];\n      GP<DataPool> pool=file->pool;\n      if (pool) pool->load_file();\n      GP<DjVuFile> djvu_file=file->file;\n      if (djvu_file) djvu_file->set_name(name);\n   }\n}\n\nvoid\nDjVuDocEditor::set_page_name(int page_num, const GUTF8String &name)\n{\n   DEBUG_MSG(\"DjVuDocEditor::set_page_name(), page_num='\" << page_num << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   if (page_num<0 || page_num>=get_pages_num())\n      G_THROW( ERR_MSG(\"DjVuDocEditor.bad_page\") \"\\t\"+GUTF8String(page_num));\n\n   set_file_name(page_to_id(page_num), name);\n}\n\nvoid\nDjVuDocEditor::set_file_title(const GUTF8String &id, const GUTF8String &title)\n{\n   DEBUG_MSG(\"DjVuDocEditor::set_file_title(), id='\" << id << \"', title='\" << title << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n      // Just change DjVmDir. It will check if the title is unique\n   djvm_dir->set_file_title(id, title);\n}\n\nvoid\nDjVuDocEditor::set_page_title(int page_num, const GUTF8String &title)\n{\n   DEBUG_MSG(\"DjVuDocEditor::set_page_title(), page_num='\" << page_num << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   if (page_num<0 || page_num>=get_pages_num())\n      G_THROW( ERR_MSG(\"DjVuDocEditor.bad_page\") \"\\t\"+GUTF8String(page_num));\n\n   set_file_title(page_to_id(page_num), title);\n}\n\n//****************************************************************************\n//************************** Shared annotations ******************************\n//****************************************************************************\n\nvoid\nDjVuDocEditor::simplify_anno(void (* progress_cb)(float progress, void *),\n                             void * cl_data)\n      // It's important that no decoding is done while this function\n      // is running. Otherwise the DjVuFile's decoding routines and\n      // this function may attempt to decode/modify a file's\n      // annotations at the same time.\n{\n      // Get the name of the SHARED_ANNO file. We will not\n      // touch that file (will not move annotations from it)\n   GP<DjVmDir::File> shared_file=djvm_dir->get_shared_anno_file();\n   GUTF8String shared_id;\n   if (shared_file)\n      shared_id=shared_file->get_load_name();\n\n   GList<GURL> ignore_list;\n   if (shared_id.length())\n      ignore_list.append(id_to_url(shared_id));\n\n      // First, for every page get merged (or \"flatten\" or \"projected\")\n      // annotations and store them inside the top-level page file\n   int pages_num=djvm_dir->get_pages_num();\n   for(int page_num=0;page_num<pages_num;page_num++)\n   {\n      GP<DjVuFile> djvu_file=get_djvu_file(page_num);\n      if (!djvu_file)\n         G_THROW( ERR_MSG(\"DjVuDocEditor.page_fail\") \"\\t\"+page_num);\n      int max_level=0;\n      GP<ByteStream> anno;\n      anno=djvu_file->get_merged_anno(ignore_list, &max_level);\n      if (anno && max_level>0)\n      {\n            // This is the moment when we try to modify DjVuFile's annotations\n            // Make sure, that it's not being decoded\n         GSafeFlags & file_flags=djvu_file->get_safe_flags();\n         GMonitorLock lock(&file_flags);\n         while(file_flags & DjVuFile::DECODING)\n            file_flags.wait();\n        \n            // Merge all chunks in one by decoding and encoding DjVuAnno\n         const GP<DjVuAnno> dec_anno(DjVuAnno::create());\n         dec_anno->decode(anno);\n         const GP<ByteStream> new_anno(ByteStream::create());\n         dec_anno->encode(new_anno);\n         new_anno->seek(0);\n\n            // And store it in the file\n         djvu_file->anno=new_anno;\n         djvu_file->rebuild_data_pool();\n         if ((file_flags & (DjVuFile::DECODE_OK |\n                            DjVuFile::DECODE_FAILED |\n                            DjVuFile::DECODE_STOPPED))==0)\n            djvu_file->anno=0;\n      }\n      if (progress_cb)\n    progress_cb((float)(page_num/2.0/pages_num), cl_data);\n   }\n\n      // Now remove annotations from every file except for\n      // the top-level page files and SHARED_ANNO file.\n      // Unlink empty files too.\n   GPList<DjVmDir::File> files_list=djvm_dir->get_files_list();\n   int cnt;\n   GPosition pos;\n   for(pos=files_list, cnt=0;pos;++pos, cnt++)\n   {\n      GP<DjVmDir::File> frec=files_list[pos];\n      if (!frec->is_page() && frec->get_load_name()!=shared_id)\n      {\n         GP<DjVuFile> djvu_file=get_djvu_file(frec->get_load_name());\n         if (djvu_file)\n         {\n            djvu_file->remove_anno();\n            if (djvu_file->get_chunks_number()==0)\n               remove_file(frec->get_load_name(), true);\n         }\n      }\n      if (progress_cb)\n         progress_cb((float)(0.5+cnt/2.0/files_list.size()), cl_data);\n   }\n}\n\nvoid\nDjVuDocEditor::create_shared_anno_file(void (* progress_cb)(float progress, void *),\n                                       void * cl_data)\n{\n   if (djvm_dir->get_shared_anno_file())\n      G_THROW( ERR_MSG(\"DjVuDocEditor.share_fail\") );\n\n      // Prepare file with ANTa chunk inside\n   const GP<ByteStream> gstr(ByteStream::create());\n   const GP<IFFByteStream> giff(IFFByteStream::create(gstr));\n   IFFByteStream &iff=*giff;\n   iff.put_chunk(\"FORM:DJVI\");\n   iff.put_chunk(\"ANTa\");\n   iff.close_chunk();\n   iff.close_chunk();\n   ByteStream &str=*gstr;\n   str.flush();\n   str.seek(0);\n   const GP<DataPool> file_pool(DataPool::create(gstr));\n\n      // Get a unique ID for the new file\n   const GUTF8String id(find_unique_id(\"shared_anno.iff\"));\n\n      // Add it into the directory\n   GP<DjVmDir::File> frec(DjVmDir::File::create(id, id, id,\n     DjVmDir::File::SHARED_ANNO));\n   djvm_dir->insert_file(frec, 1);\n\n      // Add it to our \"cache\"\n   {\n      GP<File> f=new File;\n      f->pool=file_pool;\n      GCriticalSectionLock lock(&files_lock);\n      files_map[id]=f;\n   }\n\n      // Now include this shared file into every top-level page file\n   int pages_num=djvm_dir->get_pages_num();\n   for(int page_num=0;page_num<pages_num;page_num++)\n   {\n      GP<DjVuFile> djvu_file=get_djvu_file(page_num);\n      djvu_file->insert_file(id, 1);\n\n      if (progress_cb)\n         progress_cb((float) page_num/pages_num, cl_data);\n   }\n}\n\nvoid \nDjVuDocEditor::set_djvm_nav(GP<DjVmNav> n)\n{\n  if (n && ! n->isValidBookmark())\n    G_THROW(\"Invalid bookmark data\");\n  djvm_nav = n;\n}\n\nGP<DjVuFile>\nDjVuDocEditor::get_shared_anno_file(void)\n{\n   GP<DjVuFile> djvu_file;\n\n   GP<DjVmDir::File> frec=djvm_dir->get_shared_anno_file();\n   if (frec)\n      djvu_file=get_djvu_file(frec->get_load_name());\n\n   return djvu_file;\n}\n\nGP<DataPool>\nDjVuDocEditor::get_thumbnail(int page_num, bool dont_decode)\n      // We override DjVuDocument::get_thumbnail() here because\n      // pages may have been shuffled and those \"thumbnail file records\"\n      // from the DjVmDir do not describe things correctly.\n      //\n      // So, first we will check the thumb_map[] if we have a predecoded\n      // thumbnail for the given page. If this is the case, we will\n      // return it. Otherwise we will ask DjVuDocument to generate\n      // this thumbnail for us.\n{\n   const GUTF8String id(page_to_id(page_num));\n\n   GCriticalSectionLock lock(&thumb_lock);\n   const GPosition pos(thumb_map.contains(id));\n   if (pos)\n   {\n         // Get the image from the map\n      return thumb_map[pos];\n   } else\n   {\n      unfile_thumbnails();\n      return DjVuDocument::get_thumbnail(page_num, dont_decode);\n   }\n}\n\nint\nDjVuDocEditor::get_thumbnails_num(void) const\n{\n   GCriticalSectionLock lock((GCriticalSection *) &thumb_lock);\n\n   int cnt=0;\n   int pages_num=get_pages_num();\n   for(int page_num=0;page_num<pages_num;page_num++)\n   {\n     if (thumb_map.contains(page_to_id(page_num)))\n       cnt++;\n   }\n   return cnt;\n}\n\nint\nDjVuDocEditor::get_thumbnails_size(void) const\n{\n   DEBUG_MSG(\"DjVuDocEditor::remove_thumbnails(): doing it\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   GCriticalSectionLock lock((GCriticalSection *) &thumb_lock);\n\n   int pages_num=get_pages_num();\n   for(int page_num=0;page_num<pages_num;page_num++)\n   {\n     const GPosition pos(thumb_map.contains(page_to_id(page_num)));\n     if (pos)\n     {\n       const GP<ByteStream> gstr(thumb_map[pos]->get_stream());\n       GP<IW44Image> iwpix=IW44Image::create_decode(IW44Image::COLOR);\n       iwpix->decode_chunk(gstr);\n      \n       int width=iwpix->get_width();\n       int height=iwpix->get_height();\n       return width<height ? width : height;\n    }\n  }\n  return -1;\n}\n\nvoid\nDjVuDocEditor::remove_thumbnails(void)\n{\n   DEBUG_MSG(\"DjVuDocEditor::remove_thumbnails(): doing it\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   unfile_thumbnails();\n\n   DEBUG_MSG(\"clearing thumb_map\\n\");\n   GCriticalSectionLock lock(&thumb_lock);\n   thumb_map.empty();\n}\n\nvoid\nDjVuDocEditor::unfile_thumbnails(void)\n      // Will erase all \"THUMBNAILS\" files from DjVmDir.\n      // This function is useful when filing thumbnails (to get rid of\n      // those files, which currently exist: they need to be replaced\n      // anyway) and when calling DjVuDocument::get_thumbnail() to\n      // be sure, that it will not use wrong information from DjVmDir\n{\n   DEBUG_MSG(\"DjVuDocEditor::unfile_thumbnails(): updating DjVmDir\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   {\n     GCriticalSectionLock lock(&threqs_lock);\n     threqs_list.empty();\n   }\n   if((const DjVmDir *)djvm_dir)\n   {\n     GPList<DjVmDir::File> xfiles_list=djvm_dir->get_files_list();\n     for(GPosition pos=xfiles_list;pos;++pos)\n     {\n       GP<DjVmDir::File> f=xfiles_list[pos];\n       if (f->is_thumbnails())\n         djvm_dir->delete_file(f->get_load_name());\n     }\n   }\n}\n\nvoid\nDjVuDocEditor::file_thumbnails(void)\n      // The purpose of this function is to create files containing\n      // thumbnail images and register them in DjVmDir.\n      // If some of the thumbnail images are missing, they'll\n      // be generated with generate_thumbnails()\n{\n   DEBUG_MSG(\"DjVuDocEditor::file_thumbnails(): updating DjVmDir\\n\");\n   DEBUG_MAKE_INDENT(3);\n   unfile_thumbnails();\n\n      // Generate thumbnails if they're missing due to some reason.\n   int thumb_num=get_thumbnails_num();\n   int size=thumb_num>0 ? get_thumbnails_size() : 128;\n   if (thumb_num!=get_pages_num())\n   {\n     generate_thumbnails(size);\n   }\n\n   DEBUG_MSG(\"filing thumbnails\\n\");\n\n   GCriticalSectionLock lock(&thumb_lock);\n\n      // The first thumbnail file always contains only one thumbnail\n   int ipf=1;\n   int image_num=0;\n   int page_num=0, pages_num=djvm_dir->get_pages_num();\n   GP<ByteStream> str(ByteStream::create());\n   GP<IFFByteStream> iff(IFFByteStream::create(str));\n   iff->put_chunk(\"FORM:THUM\");\n   for(;;)\n   {\n      GUTF8String id(page_to_id(page_num));\n      const GPosition pos(thumb_map.contains(id));\n      if (! pos)\n      {\n        G_THROW( ERR_MSG(\"DjVuDocEditor.no_thumb\") \"\\t\"+GUTF8String(page_num));\n      }\n      iff->put_chunk(\"TH44\");\n      iff->copy(*(thumb_map[pos]->get_stream()));\n      iff->close_chunk();\n      image_num++;\n      page_num++;\n      if (image_num>=ipf || page_num>=pages_num)\n      {\n         int i=id.rsearch('.');\n         if(i<=0)\n         {\n           i=id.length();\n         }\n         id=id.substr(0,i)+\".thumb\";\n            // Get unique ID for this file\n         id=find_unique_id(id);\n\n            // Create a file record with the chosen ID\n         GP<DjVmDir::File> file(DjVmDir::File::create(id, id, id,\n           DjVmDir::File::THUMBNAILS));\n\n            // Set correct file position (so that it will cover the next\n            // ipf pages)\n         int file_pos=djvm_dir->get_page_pos(page_num-image_num);\n         djvm_dir->insert_file(file, file_pos);\n\n            // Now add the File record (containing the file URL and DataPool)\n            // After we do it a simple save_as() will save the document\n            // with the thumbnails. This is because DjVuDocument will see\n            // the file in DjVmDir and will ask for data. We will intercept\n            // the request for data and will provide this DataPool\n         iff->close_chunk();\n         str->seek(0);\n         const GP<DataPool> file_pool(DataPool::create(str));\n         GP<File> f=new File;\n         f->pool=file_pool;\n         GCriticalSectionLock lock(&files_lock);\n         files_map[id]=f;\n\n            // And create new streams\n         str=ByteStream::create();\n         iff=IFFByteStream::create(str);\n         iff->put_chunk(\"FORM:THUM\");\n         image_num=0;\n\n            // Reset ipf to correct value (after we stored first\n            // \"exceptional\" file with thumbnail for the first page)\n         if (page_num==1) ipf=thumbnails_per_file;\n         if (page_num>=pages_num) break;\n      }\n   }\n}\n\nint\nDjVuDocEditor::generate_thumbnails(int thumb_size, int page_num)\n{\n   DEBUG_MSG(\"DjVuDocEditor::generate_thumbnails(): doing it\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   if(page_num<(djvm_dir->get_pages_num()))\n   {\n      const GUTF8String id(page_to_id(page_num));\n      if (!thumb_map.contains(id))\n        {\n          const GP<DjVuImage> dimg(get_page(page_num, true));\n         \n          GRect rect(0, 0, thumb_size, dimg->get_height()*thumb_size/dimg->get_width());\n          GP<GPixmap> pm=dimg->get_pixmap(rect, rect, get_thumbnails_gamma());\n          if (!pm)\n            {\n              const GP<GBitmap> bm(dimg->get_bitmap(rect, rect, sizeof(int)));\n              if (bm) \n                pm = GPixmap::create(*bm);\n              else\n                pm = GPixmap::create(rect.height(), rect.width(), &GPixel::WHITE);\n            }\n          // Store and compress the pixmap\n          const GP<IW44Image> iwpix(IW44Image::create_encode(*pm));\n          const GP<ByteStream> gstr(ByteStream::create());\n          IWEncoderParms parms;\n          parms.slices=97;\n          parms.bytes=0;\n          parms.decibels=0;\n          iwpix->encode_chunk(gstr, parms);\n          gstr->seek(0L);\n          thumb_map[id]=DataPool::create(gstr);\n        }\n      ++page_num;\n   }\n   else\n   {\n     page_num = -1;\n   }\n   return page_num;\n}\n\nvoid\nDjVuDocEditor::generate_thumbnails(int thumb_size,\n                                   bool (* cb)(int page_num, void *),\n                                   void * cl_data)\n{\n   int page_num=0;\n   do\n   {\n     page_num=generate_thumbnails(thumb_size,page_num);\n     if (cb && page_num>0) if (cb(page_num-1, cl_data)) return;\n   } while(page_num>=0);\n}\n\nstatic void\nstore_file(const GP<DjVmDir> & src_djvm_dir, const GP<DjVmDoc> & djvm_doc,\n           GP<DjVuFile> & djvu_file, GMap<GURL, void *> & map)\n{\n   GURL url=djvu_file->get_url();\n   if (!map.contains(url))\n   {\n      map[url]=0;\n\n         // Store included files first\n      GPList<DjVuFile> djvu_files_list=djvu_file->get_included_files(false);\n      for(GPosition pos=djvu_files_list;pos;++pos)\n         store_file(src_djvm_dir, djvm_doc, djvu_files_list[pos], map);\n\n         // Now store contents of this file\n      GP<DataPool> file_data=djvu_file->get_djvu_data(false);\n      GP<DjVmDir::File> frec=src_djvm_dir->name_to_file(url.name());\n      if (frec)\n      {\n         frec=new DjVmDir::File(*frec);\n         djvm_doc->insert_file(frec, file_data, -1);\n      }\n   }\n}\n\nvoid\nDjVuDocEditor::save_pages_as(\n  const GP<ByteStream> &str, const GList<int> & _page_list)\n{\n   GList<int> page_list=sortList(_page_list);\n\n   GP<DjVmDoc> djvm_doc=DjVmDoc::create();\n   GMap<GURL, void *> map;\n   for(GPosition pos=page_list;pos;++pos)\n   {\n      GP<DjVmDir::File> frec=djvm_dir->page_to_file(page_list[pos]);\n      if (frec)\n      {\n         GP<DjVuFile> djvu_file=get_djvu_file(frec->get_load_name());\n         if (djvu_file)\n            store_file(djvm_dir, djvm_doc, djvu_file, map);\n      }\n   }\n   djvm_doc->write(str);\n}\n\nvoid\nDjVuDocEditor::save_file(const GUTF8String &file_id, const GURL &codebase,\n  const bool only_modified, GMap<GUTF8String,GUTF8String> & map)\n{\n  if(only_modified)\n  {\n    for(GPosition pos=files_map;pos;++pos)\n    {\n      const GP<File> file_rec(files_map[pos]);\n      const bool file_modified=file_rec->pool ||\n        (file_rec->file && file_rec->file->is_modified());\n      if(!file_modified)\n      {\n        const GUTF8String id=files_map.key(pos);\n        const GUTF8String save_name(djvm_dir->id_to_file(id)->get_save_name());\n        if(id == save_name)\n        {\n          map[id]=id;\n        }\n      }\n    }\n  }\n  save_file(file_id,codebase,map);\n}\n\nvoid\nDjVuDocEditor::save_file(\n  const GUTF8String &file_id, const GURL &codebase,\n  GMap<GUTF8String,GUTF8String> & map)\n{\n   DEBUG_MSG(\"DjVuDocEditor::save_file(): ID='\" << file_id << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   if (!map.contains(file_id))\n   {\n      const GP<DjVmDir::File> file(djvm_dir->id_to_file(file_id));\n\n      GP<DataPool> file_pool;\n      const GPosition pos(files_map.contains(file_id));\n      if (pos)\n      {\n         const GP<File> file_rec(files_map[pos]);\n         if (file_rec->file)\n            file_pool=file_rec->file->get_djvu_data(false);\n         else\n            file_pool=file_rec->pool;\n      }\n\n      if (!file_pool)\n      {\n         DjVuPortcaster * pcaster=DjVuPort::get_portcaster();\n         file_pool=pcaster->request_data(this, id_to_url(file_id));\n      }\n\n      if (file_pool)\n      {\n         GMap<GUTF8String,GUTF8String> incl;\n         map[file_id]=get_djvm_doc()->save_file(codebase,*file,incl,file_pool);\n         for(GPosition pos=incl;pos;++pos)\n         {\n           save_file(incl.key(pos),codebase ,map);\n         }\n      }else\n      {\n        map[file_id]=file->get_save_name();\n      }\n   }\n}\n\nvoid\nDjVuDocEditor::save(void)\n{\n   DEBUG_MSG(\"DjVuDocEditor::save(): saving the file\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   if (!can_be_saved())\n     G_THROW( ERR_MSG(\"DjVuDocEditor.cant_save\") );\n   save_as(GURL(), orig_doc_type!=INDIRECT);\n}\n\nvoid\nDjVuDocEditor::write(const GP<ByteStream> &gbs, bool force_djvm)\n{\n  DEBUG_MSG(\"DjVuDocEditor::write()\\n\");\n  DEBUG_MAKE_INDENT(3);\n  if (get_thumbnails_num()==get_pages_num())\n  {\n    file_thumbnails();\n  }else\n  { \n    remove_thumbnails();\n  }\n  clean_files_map();\n  DjVuDocument::write(gbs,force_djvm);\n}\n\nvoid\nDjVuDocEditor::write(\n  const GP<ByteStream> &gbs,const GMap<GUTF8String,void *> &reserved)\n{\n  DEBUG_MSG(\"DjVuDocEditor::write()\\n\");\n  DEBUG_MAKE_INDENT(3);\n  if (get_thumbnails_num()==get_pages_num())\n  {\n    file_thumbnails();\n  }else\n  { \n    remove_thumbnails();\n  }\n  clean_files_map();\n  DjVuDocument::write(gbs,reserved);\n}\n\nvoid\nDjVuDocEditor::save_as(const GURL &where, bool bundled)\n{\n   DEBUG_MSG(\"DjVuDocEditor::save_as(): where='\" << where << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n      // First see if we need to generate (or just reshuffle) thumbnails...\n      // If we have an icon for every page, we will just call\n      // file_thumbnails(), which will update DjVmDir and will create\n      // the actual bundles with thumbnails (very fast)\n      // Otherwise we will remove the thumbnails completely because\n      // we really don't want to deal with documents, which have only\n      // some of their pages thumbnailed.\n   if (get_thumbnails_num()==get_pages_num())\n   {\n     file_thumbnails();\n   }else\n   { \n     remove_thumbnails();\n   }\n\n   GURL save_doc_url;\n\n   if (where.is_empty())\n   {\n         // Assume, that we just want to 'save'. Check, that it's possible\n         // and proceed.\n      bool can_be_saved_bundled =\n\torig_doc_type==BUNDLED ||\n\torig_doc_type==OLD_BUNDLED ||\n\torig_doc_type==SINGLE_PAGE ||\n\t(orig_doc_type==OLD_INDEXED && orig_doc_pages==1);\n      if ((bundled ^ can_be_saved_bundled)!=0)\n         G_THROW( ERR_MSG(\"DjVuDocEditor.cant_save2\") );\n      save_doc_url=doc_url;\n   } else\n   {\n      save_doc_url=where;\n   }\n\n   int save_doc_type=bundled ? BUNDLED : INDIRECT;\n\n   clean_files_map();\n\n   GCriticalSectionLock lock(&files_lock);\n\n   DjVuPortcaster * pcaster=DjVuPort::get_portcaster();\n\n      // First consider saving in SINGLE_FILE format (one file)\n   if(needs_compression())\n   {\n     DEBUG_MSG(\"Compressing on output\\n\");\n     remove_thumbnails();\n     if(! djvu_compress_codec)\n     {\n       G_THROW( ERR_MSG(\"DjVuDocEditor.no_codec\") );\n     }\n     const GP<DjVmDoc> doc(get_djvm_doc());\n     GP<ByteStream> mbs(ByteStream::create());\n     doc->write(mbs);\n     mbs->flush();\n     mbs->seek(0,SEEK_SET);\n     djvu_compress_codec(mbs,save_doc_url,(!(const DjVmDir *)djvm_dir)||(djvm_dir->get_files_num()==1)||(save_doc_type!=INDIRECT));\n     files_map.empty();\n     doc_url=GURL();\n   }else\n   {\n     bool singlepage = (djvm_dir->get_files_num()==1 && !djvm_nav);\n     if (singlepage)\n     {\n       // maybe save as single page\n       DjVmDir::File *file = djvm_dir->page_to_file(0);\n       if (file->get_title() != file->get_load_name())\n         singlepage = false;\n     }\n     if (singlepage)\n     {\n       // Here 'bundled' has no effect: we will save it as one page.\n       DEBUG_MSG(\"saving one file...\\n\");\n       GURL file_url=page_to_url(0);\n       const GUTF8String file_id(djvm_dir->page_to_file(0)->get_load_name());\n       GP<DataPool> file_pool;\n       GPosition pos=files_map.contains(file_id);\n       if (pos)\n       {\n         const GP<File> file_rec(files_map[pos]);\n         if (file_rec->pool && (!file_rec->file ||\n                                !file_rec->file->is_modified()))\n         {\n           file_pool=file_rec->pool;\n         }else if (file_rec->file)\n         {\n           file_pool=file_rec->file->get_djvu_data(false);\n         }\n       }\n       // Even if file has not been modified (pool==0) we still want\n       // to save it.\n       if (!file_pool)\n         file_pool=pcaster->request_data(this, file_url);\n       if (file_pool)\n       {\n         DEBUG_MSG(\"Saving '\" << file_url << \"' to '\" << save_doc_url << \"'\\n\");\n         DataPool::load_file(save_doc_url);\n         const GP<ByteStream> gstr_out(ByteStream::create(save_doc_url, \"wb\"));\n         ByteStream &str_out=*gstr_out;\n         str_out.writall(octets, 4);\n         const GP<ByteStream> str_in(file_pool->get_stream());\n         str_out.copy(*str_in);\n       }\n\n       // Update the document's DataPool (to save memory)\n       const GP<DjVmDoc> doc(get_djvm_doc());\n       const GP<ByteStream> gstr=ByteStream::create();// One page: we can do it in the memory\n       doc->write(gstr);\n       gstr->seek(0, SEEK_SET);\n       const GP<DataPool> pool(DataPool::create(gstr));\n       doc_pool=pool;\n       init_data_pool=pool;\n\n         // Also update DjVmDir (to reflect changes in offsets)\n       djvm_dir=doc->get_djvm_dir();\n     } else if (save_doc_type==INDIRECT)\n     {\n       DEBUG_MSG(\"Saving in INDIRECT format to '\" << save_doc_url << \"'\\n\");\n       bool save_only_modified=!(save_doc_url!=doc_url || save_doc_type!=orig_doc_type);\n       GPList<DjVmDir::File> xfiles_list=djvm_dir->resolve_duplicates(false);\n       const GURL codebase=save_doc_url.base();\n       int pages_num=djvm_dir->get_pages_num();\n       GMap<GUTF8String, GUTF8String> map;\n       // First go thru the pages\n       for(int page_num=0;page_num<pages_num;page_num++)\n       {\n         const GUTF8String id(djvm_dir->page_to_file(page_num)->get_load_name());\n         save_file(id, codebase, save_only_modified, map);\n       }\n       // Next go thru thumbnails and similar stuff\n       GPosition pos;\n       for(pos=xfiles_list;pos;++pos)\n         save_file(xfiles_list[pos]->get_load_name(), codebase, save_only_modified, map);\n\n         // Finally - save the top-level index file\n       for(pos=xfiles_list;pos;++pos)\n       {\n         const GP<DjVmDir::File> file(xfiles_list[pos]);\n         file->offset=0;\n         file->size=0;\n       }\n       DataPool::load_file(save_doc_url);\n       const GP<ByteStream> gstr(ByteStream::create(save_doc_url, \"wb\"));\n       const GP<IFFByteStream> giff(IFFByteStream::create(gstr));\n       IFFByteStream &iff=*giff;\n\n       iff.put_chunk(\"FORM:DJVM\", 1);\n       iff.put_chunk(\"DIRM\");\n       djvm_dir->encode(giff->get_bytestream());\n       iff.close_chunk();\n       if (djvm_nav)\n         {\n           iff.put_chunk(\"NAVM\");\n           djvm_nav->encode(iff.get_bytestream());\n           iff.close_chunk();\n         }\n       iff.close_chunk();\n       iff.flush();\n\n       // Update the document data pool (not required, but will save memory)\n       doc_pool=DataPool::create(save_doc_url);\n       init_data_pool=doc_pool;\n\n       // No reason to update DjVmDir as for this format it doesn't\n       // contain DJVM offsets\n     } else if (save_doc_type==BUNDLED || save_doc_type==OLD_BUNDLED)\n     {\n        DEBUG_MSG(\"Saving in BUNDLED format to '\" << save_doc_url << \"'\\n\");\n\n         // Can't be very smart here. Simply overwrite the file.\n        const GP<DjVmDoc> doc(get_djvm_doc());\n        DataPool::load_file(save_doc_url);\n        const GP<ByteStream> gstr(ByteStream::create(save_doc_url, \"wb\"));\n        doc->write(gstr);\n        gstr->flush();\n\n         // Update the document data pool (not required, but will save memory)\n        doc_pool=DataPool::create(save_doc_url);\n        init_data_pool=doc_pool;\n\n         // Also update DjVmDir (to reflect changes in offsets)\n        djvm_dir=doc->get_djvm_dir();\n     } else\n     {\n       G_THROW( ERR_MSG(\"DjVuDocEditor.cant_save\") );\n     }\n\n        // Now, after we have saved the document w/o any error, detach DataPools,\n        // which are in the 'File's list to save memory. Detach everything.\n        // Even in the case when File->file is non-zero. If File->file is zero,\n        // remove the item from the list at all. If it's non-zero, it has\n        // to stay there because by definition files_map[] contains the list\n        // of all active files and customized DataPools\n        //\n        // In addition to it, look thru all active files and change their URLs\n        // to reflect changes in the document's URL (if there was a change)\n        // Another reason why file's URLs must be changed is that we may have\n        // saved the document in a different format, which changes the rules\n        // of file url composition.\n     for(GPosition pos=files_map;pos;)\n       {\n\t const GP<File> file_rec(files_map[pos]);\n\t file_rec->pool=0;\n\t if (file_rec->file==0)\n\t   {\n\t     GPosition this_pos=pos;\n\t     ++pos;\n\t     files_map.del(this_pos);\n\t   } else\n\t   {\n\t     // Change the file's url;\n\t     if (doc_url!=save_doc_url ||\n\t\t orig_doc_type!=save_doc_type)\n\t       {\n\t\t if (save_doc_type==BUNDLED)\n\t\t   file_rec->file->move(save_doc_url);\n\t\t else\n\t\t   file_rec->file->move(save_doc_url.base());\n\t       }\n\t     ++pos;\n\t   }\n       }\n   }\n   orig_doc_type=save_doc_type;\n   doc_type=save_doc_type;\n\n   if (doc_url!=save_doc_url)\n   {\n     // Also update document's URL (we moved, didn't we?)\n     doc_url=save_doc_url;\n     init_url=save_doc_url;\n   }\n}\n\nGP<DjVuDocEditor> \nDjVuDocEditor::create_wait(void)\n{\n  DjVuDocEditor *doc=new DjVuDocEditor();\n  const GP<DjVuDocEditor> retval(doc);\n  doc->init();\n  return retval;\n}\n\nGP<DjVuDocEditor> \nDjVuDocEditor::create_wait(const GURL &url)\n{\n  DjVuDocEditor *doc=new DjVuDocEditor();\n  const GP<DjVuDocEditor> retval(doc);\n  doc->init(url);\n  return retval;\n}\n\nbool\nDjVuDocEditor::inherits(const GUTF8String &class_name) const\n{\n   return (class_name == \"DjVuDocEditor\")||DjVuDocument::inherits(class_name);\n}\n\nint\nDjVuDocEditor::get_orig_doc_type(void) const\n{\n   return orig_doc_type;\n}\n\nbool\nDjVuDocEditor::can_be_saved(void) const\n{\n   return !(needs_rename()||needs_compression()||orig_doc_type==UNKNOWN_TYPE ||\n\t    orig_doc_type==OLD_INDEXED);\n}\n\nint\nDjVuDocEditor::get_save_doc_type(void) const\n{\n   if (orig_doc_type==SINGLE_PAGE)\n      if (djvm_dir->get_files_num()==1)\n        return SINGLE_PAGE;\n      else\n        return BUNDLED;\n   else if (orig_doc_type==INDIRECT)\n     return INDIRECT;\n   else if (orig_doc_type==OLD_BUNDLED || orig_doc_type==BUNDLED)\n     return BUNDLED;\n   else\n     return UNKNOWN_TYPE;\n}\n\nGURL\nDjVuDocEditor::get_doc_url(void) const\n{\n   return doc_url.is_empty() ? init_url : doc_url;\n}\n\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVuDocEditor.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _DJVUDOCEDITOR_H\n#define _DJVUDOCEDITOR_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n#include \"DjVuDocument.h\"\n#include \"DjVmDoc.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n/** @name DjVuDocEditor.h\n    Files #\"DjVuDocEditor.h\"# and #\"DjVuDocEditor.cpp\"# contain extension\n    of \\Ref{DjVuDocument} class, which can create and modify existing\n    DjVu document, generate thumbnails, etc. It does {\\bf not} do\n    compression though.\n\n    @memo DjVu document editor class.\n    @author Andrei Erofeev <eaf@geocities.com>\n*/\n\n//@{\n\n/** #DjVuDocEditor# is an extension of \\Ref{DjVuDocument} class with\n    additional capabilities for editing the document contents.\n\n    It can be used to:\n    \\begin{enumerate}\n       \\item Create (compose) new multipage DjVu documents using single\n             page DjVu documents. The class does {\\bf not} do compression.\n       \\item Insert and remove different pages of multipage DjVu documents.\n       \\item Change attributes ({\\em names}, {\\em IDs} and {\\em titles})\n             of files composing the DjVu document.\n       \\item Generate thumbnail images and integrate them into the document.\n    \\end{enumerate}\n*/\n\nclass DJVUAPI DjVuDocEditor : public DjVuDocument\n{\npublic:\n   static int\tthumbnails_per_file;\n\nprotected:\n      /// Default constructor\n   DjVuDocEditor(void);\n\n      /** Initialization function. Initializes an empty document.\n\n\t  {\\bf Note}: You must call either of the two\n\t  available \\Ref{init}() function before you start doing\n\t  anything else with the #DjVuDocEditor#. */\n   void\t\tinit(void);\n\n      /** Initialization function. Opens document with name #filename#.\n\n\t  {\\bf Note}: You must call either of the two\n\t  available \\Ref{init}() function before you start doing\n\t  anything else with the #DjVuDocEditor#. */\n   void\t\tinit(const GURL &url);\n\npublic:\n     /** Creates a DjVuDocEditor class and initializes with #fname#. */\n   static GP<DjVuDocEditor> create_wait(const GURL &url);\n\n     /** Creates a DjVuDocEditor class and initializes an empty document. */\n   static GP<DjVuDocEditor> create_wait(void);\n\n\n      /// Destructor\n   virtual ~DjVuDocEditor(void);\n\n      /** Returns type of open document. #DjVuDocEditor# silently\n\t  converts any open DjVu document to #BUNDLED# format (see\n\t  \\Ref{DjVuDocument}. Thus, \\Ref{DjVuDocument::get_doc_type}()\n\t  will always be returning #BUNDLED#. Use this function to\n\t  learn the original format of the document being edited. */\n   int\t\tget_orig_doc_type(void) const;\n\n      /** Returns #TRUE# if the document can be \"saved\" (sometimes\n\t  the only possibility is to do a \"save as\"). The reason why\n\t  we have this function is that #DjVuDocEditor# can save\n\t  documents in new formats only (#BUNDLED# and #INDIRECT#).\n\t  At the same time it recognizes all DjVu formats (#OLD_BUNDLED#,\n\t  #OLD_INDEXED#, #BUNDLED#, and #INDIRECT#).\n\n\t  #OLD_BUNDLED# and #BUNDLED# documents occupy only one file,\n\t  so in this case \"saving\" involves the automatic conversion\n\t  to #BUNDLED# format and storing data into the same file.\n\n\t  #OLD_INDEXED# documents, on the other hand, occupy more\n\t  than one file. They could be converted to #INDIRECT# format\n\t  if these two formats had the same set of files. Unfortunately,\n\t  these formats are too different, and the best thing to do\n\t  is to use \"save as\" capability. */\n   bool\t\tcan_be_saved(void) const;\n\n      /** Returns type of the document, which can be created by\n\t  \\Ref{save}() function. Can be #INDIRECT#, #BUNDLED#,\n\t  #SINGLE_PAGE#, or #UNKNOWN_TYPE#. The latter indicates,\n\t  that \\Ref{save}() will fail, and that \\Ref{save_as}()\n\t  should be used instead */\n   int\t\tget_save_doc_type(void) const;\n\n      /** Saves the document. May generate exception if the document\n\t  can not be saved, and \\Ref{save_as}() should be used.\n\t  See \\Ref{can_be_saved}() for details. */\n   void\t\tsave(void);\n\n      /** Saves the document. */\n   virtual void\tsave_as(const GURL &where, bool bundled);\n\n      /** Saves the document in the {\\em new bundled} format. All the data\n\t  is \"bundled\" into one file and this file is written into the\n\t  passed stream.\n\n\t  If #force_djvm# is #TRUE# then even one page documents will be\n\t  saved in the #DJVM BUNDLED# format (inside a #FORM:DJVM#);\n\n\t  {\\bf Plugin Warning}. This function will read contents of the whole\n\t  document. Thus, if you call it from the main thread (the thread,\n\t  which transfers data from Netscape), the plugin will block. */\n   virtual void\twrite(const GP<ByteStream> &str, bool force_djvm=false);\n     /** Always save as bundled, renaming any files conflicting with the\n         the names in the supplied GMap. */\n   virtual void\twrite(const GP<ByteStream> &str,\n     const GMap<GUTF8String,void *> &reserved);\n\n      /** Saves the specified pages in DjVu #BUNDLED# multipage document. */\n   void\t\tsave_pages_as(\n     const GP<ByteStream> &str, const GList<int> & page_list);\n\n      /** Translates page number #page_num# to ID. If #page_num# is invalid,\n\t  an exception is thrown. */\n   GUTF8String\tpage_to_id(int page_num) const;\n   \n   GUTF8String\tinsert_file(const GURL &url, const GUTF8String &parent_id,\n\t\t\t    int chunk_num=1, DjVuPort *source=0);\n      /** Inserts the referenced file into this DjVu document.\n\n\t  @param fname Name of the top-level file containing the image of\n\t  \t the page to be inserted. This file must be a DjVu file and\n\t\t may include one or more other DjVu files.\n\n\t\t If it include other DjVu files, the function will try to\n\t\t insert them into the document too. Should this attempt fail,\n\t\t the corresponding #INCL# chunk will be removed from the\n\t\t referencing file and an exception will be thrown.\n\n\t\t When inserting a file, the function may modify its name\n\t\t to be unique in the DjVu document.\n\t  @param page_num Position where the new page should be inserted at.\n\t  \t Negative value means \"append\" */\n   void insert_page(const GURL &fname, int page_num=-1);\n   /** Inserts a new page with data inside the #data_pool# as page\n       number #page_num.\n\n\t  @param data_pool \\Ref{DataPool} with data for this page.\n\t  @param file_name Name, which will be assigned to this page.\n\t  \t If you try to save the document in #INDIRECT# format,\n\t\t a file with this name will be created to hold the\n\t\t page's data. If there is already a file in the document\n\t\t with the same name, the function will derive a new\n\t\t unique name from file_name, which will be assigned\n\t\t to the page.\n\t  @param page_num Describes where the page should be inserted.\n\t  \t Negative number means \"append\". */\n   void\t\tinsert_page(GP<DataPool> & file_pool,\n\t\t\t    const GURL &fname, int page_num=-1);\n      /** Inserts a group of pages into this DjVu document.\n\t  \n\t  Like \\Ref{insert_page}() it will insert every page into the document.\n\t  The main advantage of calling this function once for the whole\n\t  group instead of calling \\Ref{insert_page}() for every page is\n\t  the processing of included files:\n\n\t  The group of files may include one or more files, which are thus\n\t  shared by them. If you call \\Ref{insert_page}() for every page,\n\t  this shared file will be inserted into the document more than once\n\t  though under different names. This is how \\Ref{insert_page}() works:\n\t  whenever it inserts something, it checks for duplicate names with\n\t  only one purpose: invent a new name if a given one is already in\n\t  use.\n\n\t  On the other hand, if you call #insert_group#(), it will insert\n\t  shared included files only once. This is because it can analyze\n\t  the group of files before inserting them and figure out what files\n\t  are shared and thus should be inserted only once.\n\n\t  @param fname_list List of top-level files for the pages to be inserted\n\t  @param page_num Position where the new pages should be inserted at.\n\t  \t Negative value means \"append\" */\n   void\t\tinsert_group(const GList<GURL> & furl_list, int page_num=-1,\n\t\t\t     void (* refresh_cb)(void *)=0, void * cl_data=0);\n      /** Removes the specified page from the document. If #remove_unref#\n\t  is #TRUE#, the function will also remove from the document any file,\n\t  which became unreferenced due to the page's removal */\n   void\t\tremove_page(int page_num, bool remove_unref=true);\n      /** Removes the specified pages from the document. If #remove_unref#\n\t  is #TRUE#, the function will also remove from the document any file,\n\t  which became unreferenced due to the pages' removal */\n   void\t\tremove_pages(const GList<int> & page_list, bool remove_unref=true);\n      /** Removes a DjVu file with the specified #id#.\n\n\t  If some other files include this file, the corresponding #INCL#\n\t  chunks will be removed to avoid dead links.\n\n\t  If #remove_unref# is #TRUE#, the function will also remove every\n\t  file, which will become unreferenced after the removal of this file. */\n   void\t\tremove_file(const GUTF8String &id, bool remove_unref=true);\n      /** Makes page number #page_num# to be #new_page_num#. If #new_page_num#\n\t  is negative or too big, the function will move page #page_num# to\n\t  the end of the document. */\n   void\t\tmove_page(int page_num, int new_page_num);\n      /** Shifts all pags from the #page_list# according to the #shift#.\n\t  The #shift# can be positive (shift toward the end of the document)\n\t  or negative (shift toward the beginning of the document).\n\n\t  It is OK to make #shift# too big in value. Pages will just be\n\t  moved to the end (or to the beginning, depending on the #shift#\n\t  sign) of the document. */\n   void\t\tmove_pages(const GList<int> & page_list, int shift);\n   \n      /** Changes the name of the file with ID #id# to #name#.\n\t  Refer to \\Ref{DjVmDir} for the explanation of {\\em IDs},\n          {\\em names} and {\\em titles}. */\n   void\t\tset_file_name(const GUTF8String &id, const GUTF8String &name);\n      /** Changes the name of the page #page_num# to #name#.\n\t  Refer to \\Ref{DjVmDir} for the explanation of {\\em IDs},\n          {\\em names} and {\\em titles}. */\n   void\t\tset_page_name(int page_num, const GUTF8String &name);\n      /** Changes the title of the file with ID #id# to #title#.\n\t  Refer to \\Ref{DjVmDir} for the explanation of {\\em IDs},\n          {\\em names} and {\\em titles}. */\n   void\t\tset_file_title(const GUTF8String &id, const GUTF8String &title);\n      /** Changes the title of the page #page_num# to #title#.\n\t  Refer to \\Ref{DjVmDir} for the explanation of {\\em IDs},\n          {\\em names} and {\\em titles}. */\n   void\t\tset_page_title(int page_num, const GUTF8String &title);\n\n      /** @name Thumbnails */\n      //@{\n      /** Returns the number of thumbnails stored inside this document.\n\n\t  It may be #ZERO#, which means, that there are no thumbnails at all.\n\n\t  It may be equal to the number of pages, which is what should\n\t  normally be.\n\n\t  Finally, it may be greater than #ZERO# and less than the number\n\t  of pages, in which case thumbnails should be regenerated before\n\t  the document can be saved. */\n   int\t\tget_thumbnails_num(void) const;\n\n      /** Returns the size of the first encountered thumbnail image. Since\n\t  thumbnails can currently be generated by \\Ref{generate_thumbnails}()\n\t  only, all thumbnail images should be of the same size. Thus,\n\t  the number returned is actually the size of {\\em all}\n\t  document thumbnails.\n\n\t  The function will return #-1# if there are no thumbnails. */\n   int\t\tget_thumbnails_size(void) const;\n\n      /** Removes all thumbnails from the document */\n   void\t\tremove_thumbnails(void);\n\n      /** Generates thumbnails for the specified page, if and only if\n          it does not have a thumbnail yet.  If you want to regenerate\n          thumbnails for all pages, call \\Ref{remove_thumbnails}() prior\n          to calling this function.\n\n\t  @param thumb_size The size of the thumbnails in pixels. DjVu viewer\n\t         is able to rescale the thumbnail images if necessary, so this\n\t\t parameter affects thumbnails quality only. 128 is a good number.\n\t  @param page_num The page number to genate the thumbnail for.  */\n   int\t\tgenerate_thumbnails(int thumb_size, int page_num);\n\n      /** Generates thumbnails for those pages, which do not have them yet.\n\t  If you want to regenerate thumbnails for all pages, call\n\t  \\Ref{remove_thumbnails}() prior to calling this function.\n\n\t  @param thumb_size The size of the thumbnails in pixels. DjVu viewer\n\t         is able to rescale the thumbnail images if necessary, so this\n\t\t parameter affects thumbnails quality only. 128 is a good number.\n\t  @param cb The callback, which will be called after thumbnail image\n\t         for the next page has been generated. Regardless of if\n\t\t the document already has thumbnail images for some of its\n\t\t pages, the callback will be called #pages_num# times, where\n\t\t #pages_num# is the total number of pages in the document.\n\t\t The callback should return #FALSE# if thumbnails generating\n\t\t should proceed. #TRUE# will stop it. */\n   void\tgenerate_thumbnails(int thumb_size,\n                            bool (* cb)(int page_num, void *)=0,\n                            void * cl_data=0);\n      //@}\n      /** Use this function to simplify annotations in the document.\n        The \"simplified\" format is when annotations are only allowed\n        either in top-level page files or in a special file with\n        #SHARED_ANNO# flag on. This file is supposed to be included into\n        every page. */\n   void simplify_anno(void (* progress_cb)(float progress, void *)=0,\n                      void * cl_data=0);\n\n      /** Will create a file that will be included into every page and\n        marked with the #SHARED_ANNO# flag. This file can be used\n        to store global annotations (annotations applicable to every page).\n\n        {\\bf Note:} There may be only one #SHARED_ANNO# file in any\n        DjVu multipage document. */\n   void create_shared_anno_file(void (* progress_cb)(float progress, void *)=0,\n                                void * cl_data=0);\n\n      /** Sets bookmark data */\n   void set_djvm_nav(GP<DjVmNav> nav);\n\n      /** Returns a pointer to the file with #SHARED_ANNO# flag on.\n        This file should be used for storing document-wide annotations.\n\n        {\\bf Note:} There may be only one #SHARED_ANNO# file in any\n        DjVu multipage document. */\n   GP<DjVuFile>       get_shared_anno_file(void);\n\n   GURL               get_doc_url(void) const;\n                                                                              \n      /** Returns TRUE if #class_name# is #\"DjVuDocEditor\"#,\n\t  #\"DjVuDocument\"# or #\"DjVuPort\"# */\n   virtual bool\t\tinherits(const GUTF8String &class_name) const;\n   virtual GP<DataPool>\trequest_data(const DjVuPort * source, const GURL & url);\nprotected:\n   virtual GP<DjVuFile>\turl_to_file(const GURL & url, bool dont_create) const;\n   virtual GP<DataPool> get_thumbnail(int page_num, bool dont_decode);\n   friend class CThumbNails;\npublic:\n   class File;\nprivate:\n   bool\t\tinitialized;\n   GURL\t\tdoc_url;\n   GP<DataPool>\tdoc_pool;\n   int\t\torig_doc_type;\n   int\t\torig_doc_pages;\n\n   GPMap<GUTF8String, File>\tfiles_map; \t// files_map[id]=GP<File>\n   GCriticalSection\tfiles_lock;\n\n   GPMap<GUTF8String,DataPool> thumb_map;\n   GCriticalSection\tthumb_lock;\n\n   void\t\t(* refresh_cb)(void *);\n   void\t\t* refresh_cl_data;\n\n   void\t\tcheck(void);\n   GUTF8String\tfind_unique_id(GUTF8String id);\n   GP<DataPool>\tstrip_incl_chunks(const GP<DataPool> & pool);\n   void\t\tclean_files_map(void);\n   bool\t\tinsert_file_type(const GURL &file_url,\n                  DjVmDir::File::FILE_TYPE page_type,\n\t\t  int & file_pos,\n                  GMap<GUTF8String, GUTF8String> & name2id);\n   bool\t\tinsert_file( const GP<DataPool> &pool,\n                  const GURL &file_url, bool is_page,\n\t\t  int & file_pos,\n                  GMap<GUTF8String,GUTF8String> & name2id,\n                  DjVuPort *source=0 );\n   bool\t\tinsert_file(\n                  const GURL &file_url, bool is_page,\n\t\t  int & file_pos,\n                  GMap<GUTF8String,GUTF8String> & name2id,\n                  DjVuPort *source=0 );\n   void\t\tremove_file(const GUTF8String &id, bool remove_unref,\n\t\t\t    GMap<GUTF8String, void *> & ref_map);\n   void\t\tgenerate_ref_map(const GP<DjVuFile> & file,\n\t\t\t\t GMap<GUTF8String, void *> & ref_map,\n\t\t\t\t GMap<GURL, void *> & visit_map);\n   void\t\tmove_file(const GUTF8String &id, int & file_pos,\n\t\t\t  GMap<GUTF8String, void *> & map);\n   void\t\tunfile_thumbnails(void);\n   void\t\tfile_thumbnails(void);\n   void\tsave_file(const GUTF8String &id, const GURL &codebase,\n     const bool only_modified, GMap<GUTF8String, GUTF8String> & map);\n   void\tsave_file(const GUTF8String &id, const GURL &codebase,\n     GMap<GUTF8String, GUTF8String> & map);\n};\n\n//@}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/DjVuDocument.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"DjVuDocument.h\"\n#include \"DjVmDoc.h\"\n#include \"DjVmDir0.h\"\n#include \"DjVmNav.h\"\n#include \"DjVuNavDir.h\"\n#include \"DjVuImage.h\"\n#include \"DjVuFileCache.h\"\n#include \"IFFByteStream.h\"\n#include \"GOS.h\"\n#include \"DataPool.h\"\n#include \"IW44Image.h\"\n#include \"GRect.h\"\n\n#include \"debug.h\"\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\nstatic const char octets[4]={0x41,0x54,0x26,0x54};\nconst float\tDjVuDocument::thumb_gamma=(float)2.20;\n\nvoid (* DjVuDocument::djvu_import_codec)(\n  GP<DataPool> &pool, const GURL &url, bool &needs_compression,\n  bool &needs_rename )=0;\n\nvoid (* DjVuDocument::djvu_compress_codec)(\n  GP<ByteStream> &doc,const GURL &where,bool bundled)=0;\n\nvoid\nDjVuDocument::set_import_codec(\n  void (*codec)(\n    GP<DataPool> &pool, const GURL &url, bool &needs_compression, bool &needs_rename ))\n{\n  djvu_import_codec=codec;\n}\n\nvoid\nDjVuDocument::set_compress_codec(\n  void (* codec)(\n    GP<ByteStream> &doc,const GURL &where,bool bundled))\n{\n  djvu_compress_codec=codec;\n}\n\nDjVuDocument::DjVuDocument(void)\n  : doc_type(UNKNOWN_TYPE),\n    needs_compression_flag(false),\n    can_compress_flag(false),\n    needs_rename_flag(false),\n    has_url_names(false),\n    recover_errors(ABORT),\n    verbose_eof(false),\n    init_started(false),\n    cache(0) \n{\n}\n\nGP<DjVuDocument>\nDjVuDocument::create(\n  GP<DataPool> pool, GP<DjVuPort> xport, DjVuFileCache * const xcache)\n{\n  DjVuDocument *doc=new DjVuDocument;\n  GP<DjVuDocument> retval=doc;\n  doc->init_data_pool=pool;\n  doc->start_init(GURL(),xport,xcache);\n  return retval;\n}\n\nGP<DjVuDocument>\nDjVuDocument::create(\n  const GP<ByteStream> &bs, GP<DjVuPort> xport, DjVuFileCache * const xcache)\n{\n  return create(DataPool::create(bs),xport,xcache);\n}\n\nGP<DjVuDocument>\nDjVuDocument::create_wait(\n  const GURL &url, GP<DjVuPort> xport, DjVuFileCache * const xcache)\n{\n  GP<DjVuDocument> retval=create(url,xport,xcache);\n  retval->wait_for_complete_init();\n  return retval;\n}\n\nvoid\nDjVuDocument::start_init(\n  const GURL & url, GP<DjVuPort> xport, DjVuFileCache * xcache)\n{\n   DEBUG_MSG(\"DjVuDocument::start_init(): initializing class...\\n\");\n   DEBUG_MAKE_INDENT(3);\n   if (init_started)\n      G_THROW( ERR_MSG(\"DjVuDocument.2nd_init\") );\n   if (!get_count())\n      G_THROW( ERR_MSG(\"DjVuDocument.not_secure\") );\n   if(url.is_empty())\n   {\n     if (!init_data_pool)\n       G_THROW( ERR_MSG(\"DjVuDocument.empty_url\") );\n     if(init_url.is_empty())\n     {\n       init_url=invent_url(\"document.djvu\");\n     }\n   }else\n   {\n     init_url=url;\n   }\n   \n      // Initialize\n   cache=xcache;\n   doc_type=UNKNOWN_TYPE;\n   DataPool::close_all();\n   DjVuPortcaster * pcaster=get_portcaster();\n   if (!xport)\n     xport=simple_port=new DjVuSimplePort();\n   pcaster->add_route(this, xport);\n   pcaster->add_route(this, this);\n\n   if(!url.is_empty())\n   {\n     init_data_pool=pcaster->request_data(this, init_url);\n     if(init_data_pool)\n     {\n       if(!init_url.is_empty() && init_url.is_local_file_url() && djvu_import_codec)\n       {\n         djvu_import_codec(init_data_pool,init_url,needs_compression_flag,needs_rename_flag);\n       }\n       if(needs_rename_flag)\n         can_compress_flag=true;\n     }\n     if (!init_data_pool) \n     {\n       G_THROW( ERR_MSG(\"DjVuDocument.fail_URL\") \"\\t\"+init_url.get_string());\n     }\n   }\n      // Now we say it is ready\n   init_started=true;\n\n   init_thread_flags=STARTED;\n   init_life_saver=this;\n   init_thr.create(static_init_thread, this);\n}\n\nDjVuDocument::~DjVuDocument(void)\n{\n      // No more messages, please. We're being destroyed.\n   get_portcaster()->del_port(this);\n\n      // We want to stop any DjVuFile which has been created by us\n      // and is still being decoded. We have to stop them manually because\n      // they keep the \"life saver\" in the decoding thread and won't stop\n      // when we clear the last reference to them\n   {\n      GCriticalSectionLock lock(&ufiles_lock);\n      for(GPosition pos=ufiles_list;pos;++pos)\n      {\n          GP<DjVuFile> file=ufiles_list[pos]->file;\n          file->stop_decode(false);\n          file->stop(false);\t// Disable any access to data\n      }\n      ufiles_list.empty();\n   }\n\n   GPList<DjVuPort> ports=get_portcaster()->prefix_to_ports(get_int_prefix());\n   for(GPosition pos=ports;pos;++pos)\n   {\n     GP<DjVuPort> port=ports[pos];\n     if (port->inherits(\"DjVuFile\"))\n     {\n       DjVuFile * file=(DjVuFile *) (DjVuPort *) port;\n       file->stop_decode(false);\n       file->stop(false);\t// Disable any access to data\n     }\n   }\n   DataPool::close_all();\n}\n\nvoid\nDjVuDocument::stop_init(void)\n{\n   DEBUG_MSG(\"DjVuDocument::stop_init(): making sure that the init thread dies.\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   GMonitorLock lock(&init_thread_flags);\n   while((init_thread_flags & STARTED) &&\n\t !(init_thread_flags & FINISHED))\n   {\n      if (init_data_pool) init_data_pool->stop(true);\t// blocking operation\n\n      if (ndir_file) ndir_file->stop(false);\n\n      {\n\t GCriticalSectionLock lock(&ufiles_lock);\n\t for(GPosition pos=ufiles_list;pos;++pos)\n\t    ufiles_list[pos]->file->stop(false);\t// Disable any access to data\n\t ufiles_list.empty();\n      }\n\n      init_thread_flags.wait(50);\n   }\n}\n\nvoid\nDjVuDocument::check() const\n{\n  if (!init_started)\n    G_THROW( ERR_MSG(\"DjVuDocument.not_init\") );\n}\n\nvoid\nDjVuDocument::static_init_thread(void * cl_data)\n{\n  DjVuDocument * th=(DjVuDocument *) cl_data;\n  GP<DjVuDocument> life_saver=th;\n  th->init_life_saver=0;\n  G_TRY {\n    th->init_thread();\n  } G_CATCH(exc) {\n    G_TRY {\n      int changed = DjVuDocument::DOC_INIT_FAILED;\n      th->flags |= changed;\n      get_portcaster()->notify_doc_flags_changed(th, changed, 0);\n    } G_CATCH_ALL {\n    } G_ENDCATCH;\n    G_TRY {\n      th->check_unnamed_files();\n      if (!exc.cmp_cause(ByteStream::EndOfFile) && th->verbose_eof)\n        get_portcaster()->notify_error(th, ERR_MSG(\"DjVuDocument.init_eof\"));\n      else if (!exc.cmp_cause(DataPool::Stop))\n        get_portcaster()->notify_status(th, ERR_MSG(\"DjVuDocument.stopped\"));\n      else\n        get_portcaster()->notify_error(th, exc.get_cause());\n    } G_CATCH_ALL {\n    } G_ENDCATCH;\n    th->init_thread_flags |= FINISHED;\n  } G_ENDCATCH;\n}\n\nvoid\nDjVuDocument::init_thread(void)\n      // This function is run in a separate thread.\n      // The goal is to detect the document type (BUNDLED, OLD_INDEXED, etc.)\n      // and decode navigation directory.\n{\n   DEBUG_MSG(\"DjVuDocument::init_thread(): guessing what we're dealing with\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   DjVuPortcaster * pcaster=get_portcaster();\n      \n   GP<ByteStream> stream=init_data_pool->get_stream();\n\n   GP<IFFByteStream> giff=IFFByteStream::create(stream);\n   IFFByteStream &iff=*giff;\n   GUTF8String chkid;\n   int size=iff.get_chunk(chkid);\n   if (!size)\n     G_THROW( ByteStream::EndOfFile );\n   if (size < 0)\n     G_THROW( ERR_MSG(\"DjVuDocument.no_file\") );\n   if (size<8)\n     G_THROW( ERR_MSG(\"DjVuDocument.not_DjVu\") );\n   if (chkid==\"FORM:DJVM\")\n   {\n     DEBUG_MSG(\"Got DJVM document here\\n\");\n     DEBUG_MAKE_INDENT(3);\n     \n     size=iff.get_chunk(chkid);\n     if (chkid==\"DIRM\")\n       {\n\t djvm_dir=DjVmDir::create();\n\t djvm_dir->decode(iff.get_bytestream());\n\t iff.close_chunk();\n\t if (djvm_dir->is_bundled())\n           {\n             DEBUG_MSG(\"Got BUNDLED file.\\n\");\n             doc_type=BUNDLED;\n           } \n         else\n           {\n             DEBUG_MSG(\"Got INDIRECT file.\\n\");\n             doc_type=INDIRECT;\n           }\n\t flags|=DOC_TYPE_KNOWN | DOC_DIR_KNOWN;\n\t pcaster->notify_doc_flags_changed(this, \n                                           DOC_TYPE_KNOWN | DOC_DIR_KNOWN, 0);\n\t check_unnamed_files();\n         \n         /* Check for NAVM */\n         size=iff.get_chunk(chkid);\n         if (size && chkid==\"NAVM\")\n           {\n             djvm_nav=DjVmNav::create();\n             djvm_nav->decode(iff.get_bytestream());\n             iff.close_chunk();\n           }\n       }\n     else if (chkid==\"DIR0\")\n       {\n\t DEBUG_MSG(\"Got OLD_BUNDLED file.\\n\");\n\t doc_type=OLD_BUNDLED;\n\t flags|=DOC_TYPE_KNOWN;\n\t pcaster->notify_doc_flags_changed(this, DOC_TYPE_KNOWN, 0);\n\t check_unnamed_files();\n       } \n     else \n       G_THROW( ERR_MSG(\"DjVuDocument.bad_format\") );\n     \n     if (doc_type==OLD_BUNDLED)\n       {\n         // Read the DjVmDir0 directory. We are unable to tell what\n         // files are pages and what are included at this point.\n         // We only know that the first file with DJVU (BM44 or PM44)\n         // form *is* the first page. The rest will become known\n         // after we decode DjVuNavDir\n\t djvm_dir0=DjVmDir0::create();\n\t djvm_dir0->decode(*iff.get_bytestream());\n\t iff.close_chunk();\n         // Get offset to the first DJVU, PM44 or BM44 chunk\n\t int first_page_offset=0;\n\t while(!first_page_offset)\n           {\n             int offset;\n             size=iff.get_chunk(chkid, &offset);\n             if (size==0) G_THROW( ERR_MSG(\"DjVuDocument.no_page\") );\n             if (chkid==\"FORM:DJVU\" || \n                 chkid==\"FORM:PM44\" || chkid==\"FORM:BM44\")\n               {\n                 DEBUG_MSG(\"Got 1st page offset=\" << offset << \"\\n\");\n                 first_page_offset=offset;\n               }\n             iff.close_chunk();\n           }\n         \n         // Now get the name of this file\n\t int file_num;\n\t for(file_num=0;file_num<djvm_dir0->get_files_num();file_num++)\n           {\n             DjVmDir0::FileRec & file=*djvm_dir0->get_file(file_num);\n             if (file.offset==first_page_offset)\n               {\n                 first_page_name=file.name;\n                 break;\n               }\n           }\n\t if (!first_page_name.length())\n           G_THROW( ERR_MSG(\"DjVuDocument.no_page\") );\n\t flags|=DOC_DIR_KNOWN;\n\t pcaster->notify_doc_flags_changed(this, DOC_DIR_KNOWN, 0);\n\t check_unnamed_files();\n       }\n   } \n   else // chkid!=\"FORM:DJVM\"\n     {\n       // DJVU format\n       DEBUG_MSG(\"Got DJVU OLD_INDEXED or SINGLE_PAGE document here.\\n\");\n       doc_type=SINGLE_PAGE;\n       flags |= DOC_TYPE_KNOWN;\n       pcaster->notify_doc_flags_changed(this, DOC_TYPE_KNOWN, 0);\n       check_unnamed_files();\n     }\n   if (doc_type==OLD_BUNDLED || doc_type==SINGLE_PAGE)\n     {\n       DEBUG_MSG(\"Searching for NDIR chunks...\\n\");\n       ndir_file=get_djvu_file(-1);\n       if (ndir_file) ndir=ndir_file->decode_ndir();\n       ndir_file=0;\t// Otherwise ~DjVuDocument() will stop (=kill) it\n       if (!ndir)\n         {\n           // Seems to be 1-page old-style document. Create dummy NDIR\n           if (doc_type==OLD_BUNDLED)\n             {\n               ndir=DjVuNavDir::create(GURL::UTF8(\"directory\",init_url));\n               ndir->insert_page(-1, first_page_name);\n             } \n           else\n             {\n               ndir=DjVuNavDir::create(GURL::UTF8(\"directory\",init_url.base()));\n               ndir->insert_page(-1, init_url.fname());\n             }\n         } \n       else\n         {\n           if (doc_type==SINGLE_PAGE)\n             doc_type=OLD_INDEXED;\n         }\n       flags|=DOC_NDIR_KNOWN;\n       pcaster->notify_doc_flags_changed(this, DOC_NDIR_KNOWN, 0);\n       check_unnamed_files();\n     }\n   \n   flags |= DOC_INIT_OK;\n   pcaster->notify_doc_flags_changed(this, DOC_INIT_OK, 0);\n   check_unnamed_files();\n   init_thread_flags|=FINISHED;\n   DEBUG_MSG(\"DOCUMENT IS FULLY INITIALIZED now: doc_type='\" <<\n\t     (doc_type==BUNDLED ? \"BUNDLED\" :\n\t      doc_type==OLD_BUNDLED ? \"OLD_BUNDLED\" :\n\t      doc_type==INDIRECT ? \"INDIRECT\" :\n\t      doc_type==OLD_INDEXED ? \"OLD_INDEXED\" :\n\t      doc_type==SINGLE_PAGE ? \"SINGLE_PAGE\" :\n\t      \"UNKNOWN\") << \"'\\n\");\n}\n\nbool\nDjVuDocument::wait_for_complete_init(void)\n{\n  flags.enter();\n  while(!(flags & DOC_INIT_FAILED) &&\n        !(flags & DOC_INIT_OK)) flags.wait();\n  flags.leave();\n  init_thread_flags.enter();\n  while (!(init_thread_flags & FINISHED))\n    init_thread_flags.wait();\n  init_thread_flags.leave();\n  return (flags & (DOC_INIT_OK | DOC_INIT_FAILED))!=0;\n}\n\nint\nDjVuDocument::wait_get_pages_num(void) const\n{\n  GSafeFlags &f=const_cast<GSafeFlags &>(flags);\n  f.enter();\n  while(!(f & DOC_TYPE_KNOWN) &&\n        !(f & DOC_INIT_FAILED) &&\n        !(f & DOC_INIT_OK)) f.wait();\n  f.leave();\n  return get_pages_num();\n}\n\nGUTF8String\nDjVuDocument::get_int_prefix(void) const\n{\n      // These NAMEs are used to enable DjVuFile sharing inside the same\n      // DjVuDocument using DjVuPortcaster. Since URLs are unique to the\n      // document, other DjVuDocuments cannot retrieve files until they're\n      // assigned some permanent name. After '?' there should be the real\n      // file's URL. Please note, that output of this function is used only\n      // as name for DjVuPortcaster. Not as a URL.\n   GUTF8String retval;\n   return retval.format(\"document_%p%d?\", this, hash(init_url));\n}\n\nvoid\nDjVuDocument::set_file_aliases(const DjVuFile * file)\n{\n   DEBUG_MSG(\"DjVuDocument::set_file_aliases(): setting global aliases for file '\"\n\t     << file->get_url() << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   DjVuPortcaster * pcaster=DjVuPort::get_portcaster();\n   \n   GMonitorLock lock(&((DjVuFile *) file)->get_safe_flags());\n   pcaster->clear_aliases(file);\n   if (file->is_decode_ok() && cache)\n   {\n\t // If file is successfully decoded and caching is enabled,\n\t // assign a global alias to this file, so that any other\n\t // DjVuDocument will be able to use it.\n      \n      pcaster->add_alias(file, file->get_url().get_string());\n      if (flags & (DOC_NDIR_KNOWN | DOC_DIR_KNOWN))\n      {\n\t int page_num=url_to_page(file->get_url());\n\t if (page_num>=0)\n\t {\n\t    if (page_num==0) pcaster->add_alias(file, init_url.get_string()+\"#-1\");\n\t    pcaster->add_alias(file, init_url.get_string()+\"#\"+GUTF8String(page_num));\n\t }\n      }\n\t // The following line MUST stay here. For OLD_INDEXED documents\n\t // a page may finish decoding before DIR or NDIR becomes known\n\t // (multithreading, remember), so the code above would not execute\n      pcaster->add_alias(file, file->get_url().get_string()+\"#-1\");\n   } else pcaster->add_alias(file, get_int_prefix()+file->get_url());\n}\n\nvoid\nDjVuDocument::check_unnamed_files(void)\n{\n  DEBUG_MSG(\"DjVuDocument::check_unnamed_files(): Seeing if we can fix some...\\n\");\n  DEBUG_MAKE_INDENT(3);\n  \n  if (flags & DOC_INIT_FAILED)\n  {\n    // Init failed. All unnamed files should be terminated\n    GCriticalSectionLock lock(&ufiles_lock);\n    for(GPosition pos=ufiles_list;pos;++pos)\n    {\n      GP<DjVuFile> file=ufiles_list[pos]->file;\n      file->stop_decode(true);\n      file->stop(false);\t// Disable any access to data\n    }\n    ufiles_list.empty();\n    return;\n  }\n  \n  if ((flags & DOC_TYPE_KNOWN)==0)\n    return;\n  \n  // See the list of unnamed files (created when there was insufficient\n  // information about DjVuDocument structure) and try to fix those,\n  // which can be fixed at this time\n  while(true)\n  {\n    DjVuPortcaster * pcaster=get_portcaster();\n    \n    GP<UnnamedFile> ufile;\n    GURL new_url;\n    GPosition pos ;   \n\t   GCriticalSectionLock lock(&ufiles_lock);\n     for(pos=ufiles_list;pos;)\n     {\n\tG_TRY\n        {\n          GP<UnnamedFile> f=ufiles_list[pos];\n          if (f->id_type==UnnamedFile::ID) \n            new_url=id_to_url(f->id);\n          else \n            new_url=page_to_url(f->page_num);\n          if (!new_url.is_empty())\n          {\n            ufile=f;\n            // Don't take it off the list. We want to be\n            // able to stop the init from ~DjVuDocument();\n            //\n            // ufiles_list.del(pos);\n            break;\n          } else if (is_init_complete())\n          {\n            // No empty URLs are allowed at this point.\n            // We now know all information about the document\n            // and can determine if a page is inside it or not\n            f->data_pool->set_eof();\n            GUTF8String msg;\n            if (f->id_type==UnnamedFile::ID)\n              msg= ERR_MSG(\"DjVuDocument.miss_page_name\") \"\\t\"+f->id;\n            else \n              msg= ERR_MSG(\"DjVuDocument.miss_page_num\") \"\\t\"+GUTF8String(f->page_num);\n            G_THROW(msg);\n          }\n          ++pos;\n        }\n        G_CATCH(exc)\n        {\n          pcaster->notify_error(this, exc.get_cause());\n          GP<DataPool> pool=ufiles_list[pos]->data_pool;\n          if (pool)\n            pool->stop();\n          GPosition this_pos=pos;\n          ++pos;\n          ufiles_list.del(this_pos);\n        }\n        G_ENDCATCH;\n     }\n     \n     if (ufile && !new_url.is_empty())\n       {\n         DEBUG_MSG(\"Fixing file: '\" << ufile->url << \"'=>'\" << new_url << \"'\\n\");\n         // Now, once we know its real URL we can request a real DataPool and\n         // can connect the DataPool owned by DjVuFile to that real one\n         // Note, that now request_data() will not play fool because\n         // we have enough information\n         \n         G_TRY\n           {\n             if (ufile->data_pool)\n               {\n                 GP<DataPool> new_pool=pcaster->request_data(ufile->file, new_url);\n                 if(!new_pool)\n                   G_THROW( ERR_MSG(\"DjVuDocument.fail_URL\") \"\\t\"+new_url.get_string());\n                 ufile->data_pool->connect(new_pool);\n               }\n             ufile->file->set_name(new_url.fname());\n             ufile->file->move(new_url.base());\n             set_file_aliases(ufile->file);\n           }\n         G_CATCH(exc)\n           {\n             pcaster->notify_error(this, exc.get_cause());\n           }   \n         G_ENDCATCH;\n       }\n     else\n       break;\n     \n     // Remove the 'ufile' from the list\n     for(pos=ufiles_list;pos;++pos)\n       if (ufiles_list[pos]==ufile)\n         {\n           ufiles_list.del(pos);\n           break;\n         }\n  } // while(1)\n}\n\nint\nDjVuDocument::get_pages_num(void) const\n{\n  check();\n  if (flags & DOC_TYPE_KNOWN)\n    {\n      if (doc_type==BUNDLED || doc_type==INDIRECT)\n\treturn djvm_dir->get_pages_num();\n      else if (flags & DOC_NDIR_KNOWN)\n\treturn ndir->get_pages_num();\n    }\n  return 1;\n}\n\nGURL\nDjVuDocument::page_to_url(int page_num) const\n{\n   check();\n   DEBUG_MSG(\"DjVuDocument::page_to_url(): page_num=\" << page_num << \"\\n\");\n   DEBUG_MAKE_INDENT(3);\n   \n   GURL url;\n   if (flags & DOC_TYPE_KNOWN)\n      switch(doc_type)\n      {\n\t case SINGLE_PAGE:\n         {\n           if (page_num<1) \n             url=init_url;\n           else\n             G_THROW( ERR_MSG(\"DjVuDocument.big_num\") );\n           break;\n         }\n\t case OLD_INDEXED:\n\t {\n\t    if (page_num<0) \n              url=init_url;\n\t    else if (flags & DOC_NDIR_KNOWN) \n              url=ndir->page_to_url(page_num);\n\t    break;\n\t }\n\t case OLD_BUNDLED:\n\t {\n\t    if (page_num<0) \n              page_num=0;\n\t    if (page_num==0 && (flags & DOC_DIR_KNOWN))\n              url=GURL::UTF8(first_page_name,init_url);\n\t    else if (flags & DOC_NDIR_KNOWN)\n              url=ndir->page_to_url(page_num);\n\t    break;\n\t }\n\t case BUNDLED:\n\t {\n\t    if (page_num<0)\n              page_num=0;\n\t    if (flags & DOC_DIR_KNOWN)\n\t    {\n\t      GP<DjVmDir::File> file=djvm_dir->page_to_file(page_num);\n\t      if (!file) \n                G_THROW( ERR_MSG(\"DjVuDocument.big_num\") );\n\t      url=GURL::UTF8(file->get_load_name(),init_url);\n\t    }\n\t    break;\n\t }\n\t case INDIRECT:\n\t {\n\t    if (page_num<0) page_num=0;\n\t    if (flags & DOC_DIR_KNOWN)\n\t    {\n\t       GP<DjVmDir::File> file=djvm_dir->page_to_file(page_num);\n\t       if (!file)\n                 G_THROW( ERR_MSG(\"DjVuDocument.big_num\") );\n\t       url=GURL::UTF8(file->get_load_name(),init_url.base());\n\t    }\n\t    break;\n\t }\n\t default:\n\t    G_THROW( ERR_MSG(\"DjVuDocument.unk_type\") );\n      }\n   return url;\n}\n\nint\nDjVuDocument::url_to_page(const GURL & url) const\n{\n   check();\n   DEBUG_MSG(\"DjVuDocument::url_to_page(): url='\" << url << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   int page_num=-1;\n   if (flags & DOC_TYPE_KNOWN)\n      switch(doc_type)\n      {\n\t case SINGLE_PAGE:\n\t case OLD_BUNDLED:\n\t case OLD_INDEXED:\n\t {\n\t    if (flags & DOC_NDIR_KNOWN) page_num=ndir->url_to_page(url);\n\t    break;\n\t }\n\t case BUNDLED:\n\t {\n\t    if (flags & DOC_DIR_KNOWN)\n\t    {\n\t       GP<DjVmDir::File> file;\n\t       if (url.base()==init_url)\n                 file=djvm_dir->id_to_file(url.fname());\n\t       if (file)\n                 page_num=file->get_page_num();\n\t    }\n\t    break;\n\t }\n\t case INDIRECT:\n\t {\n\t    if (flags & DOC_DIR_KNOWN)\n\t    {\n\t       GP<DjVmDir::File> file;\n\t       if (url.base()==init_url.base())\n                 file=djvm_dir->id_to_file(url.fname());\n\t       if (file)\n                 page_num=file->get_page_num();\n\t    }\n\t    break;\n\t }\n\t default:\n\t    G_THROW( ERR_MSG(\"DjVuDocument.unk_type\") );\n      }\n   return page_num;\n}\n\nGURL\nDjVuDocument::id_to_url(const GUTF8String & id) const\n{\n   check();\n   DEBUG_MSG(\"DjVuDocument::id_to_url(): translating ID='\" << id << \"' to URL\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   if (flags & DOC_TYPE_KNOWN)\n      switch(doc_type)\n      {\n\t case BUNDLED:\n\t    if (flags & DOC_DIR_KNOWN)\n\t    {\n\t      GP<DjVmDir::File> file=djvm_dir->id_to_file(id);\n\t      if (!file)\n              {\n                file=djvm_dir->name_to_file(id);\n\t        if (!file)\n                  file=djvm_dir->title_to_file(id);\n              }\n\t      if (file)\n\t        return GURL::UTF8(file->get_load_name(),init_url);\n\t    }\n\t    break;\n\t case INDIRECT:\n\t    if (flags & DOC_DIR_KNOWN)\n\t    {\n\t       GP<DjVmDir::File> file=djvm_dir->id_to_file(id);\n\t       if (!file)\n               {\n                 file=djvm_dir->name_to_file(id);\n\t         if (!file)\n                   file=djvm_dir->title_to_file(id);\n               }\n\t       if (file)\n\t         return GURL::UTF8(file->get_load_name(),init_url.base());\n\t    }\n\t    break;\n\t case OLD_BUNDLED:\n\t    if (flags & DOC_DIR_KNOWN)\n\t    {\n\t       GP<DjVmDir0::FileRec> frec=djvm_dir0->get_file(id);\n\t       if (frec)\n                 return GURL::UTF8(id,init_url);\n\t    }\n\t    break;\n\t case OLD_INDEXED:\n\t case SINGLE_PAGE:\n\t    return GURL::UTF8(id,init_url.base());\n\t    break;\n      }\n   return GURL();\n}\n\nGURL\nDjVuDocument::id_to_url(const DjVuPort * source, const GUTF8String &id)\n{\n   return id_to_url(id);\n}\n\nGP<DjVuFile>\nDjVuDocument::url_to_file(const GURL & url, bool dont_create) const\n      // This function is private and is called from two places:\n      // id_to_file() and get_djvu_file() ONLY when the structure is known\n{\n   check();\n   DEBUG_MSG(\"DjVuDocument::url_to_file(): url='\" << url << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n      // Try DjVuPortcaster to find existing files.\n   DjVuPortcaster * pcaster=DjVuPort::get_portcaster();\n   GP<DjVuPort> port;\n\n   if (cache)\n   {\n\t // First - fully decoded files\n      port=pcaster->alias_to_port(url.get_string());\n      if (port && port->inherits(\"DjVuFile\"))\n      {\n\t DEBUG_MSG(\"found fully decoded file using DjVuPortcaster\\n\");\n\t return (DjVuFile *) (DjVuPort *) port;\n      }\n   }\n\n      // Second - internal files\n   port=pcaster->alias_to_port(get_int_prefix()+url);\n   if (port && port->inherits(\"DjVuFile\"))\n   {\n      DEBUG_MSG(\"found internal file using DjVuPortcaster\\n\");\n      return (DjVuFile *) (DjVuPort *) port;\n   }\n\n   GP<DjVuFile> file;\n   \n   if (!dont_create)\n   {\n      DEBUG_MSG(\"creating a new file\\n\");\n      file=DjVuFile::create(url,const_cast<DjVuDocument *>(this),recover_errors,verbose_eof);\n      const_cast<DjVuDocument *>(this)->set_file_aliases(file);\n   }\n\n   return file;\n}\n\nGP<DjVuFile>\nDjVuDocument::get_djvu_file(int page_num, bool dont_create) const\n{\n   check();\n   DEBUG_MSG(\"DjVuDocument::get_djvu_file(): request for page \" << page_num << \"\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   DjVuPortcaster * pcaster=DjVuPort::get_portcaster();\n   \n   GURL url;\n   {\n\t // I'm locking the flags because depending on what page_to_url()\n\t // returns me, I'll be creating DjVuFile in different ways.\n\t // And I don't want the situation to change between the moment I call\n\t // id_to_url() and I actually create DjVuFile\n      GMonitorLock lock(&(const_cast<DjVuDocument *>(this)->flags));\n      url=page_to_url(page_num);\n      if (url.is_empty())\n      {\n\t    // If init is complete and url is empty, we know for sure, that\n\t    // smth is wrong with the page_num. So we can return ZERO.\n\t    // Otherwise we create a temporary file and wait for init to finish\n\t if (is_init_complete()) return 0;\n\t \n\t DEBUG_MSG(\"Structure is not known => check <doc_url>#<page_num> alias...\\n\");\n\t GP<DjVuPort> port;\n\t if (cache)\n\t    port=pcaster->alias_to_port(init_url.get_string()+\"#\"+GUTF8String(page_num));\n\t if (!port || !port->inherits(\"DjVuFile\"))\n\t {\n\t    DEBUG_MSG(\"failed => invent dummy URL and proceed\\n\");\n\t \n\t       // Invent some dummy temporary URL. I don't care what it will\n\t       // be. I'll remember the page_num and will generate the correct URL\n\t       // after I learn what the document is\n            GUTF8String name(\"page\");\n            name+=GUTF8String(page_num);\n            name+=\".djvu\";\n            url=invent_url(name);\n\n            GCriticalSectionLock(&(const_cast<DjVuDocument *>(this)->ufiles_lock));\n\t    for(GPosition pos=ufiles_list;pos;++pos)\n\t    {\n\t       GP<UnnamedFile> f=ufiles_list[pos];\n\t       if (f->url==url) return f->file;\n\t    }\n\t    GP<UnnamedFile> ufile=new UnnamedFile(UnnamedFile::PAGE_NUM, 0,\n\t\t\t\t\t\t  page_num, url, 0);\n\n\t       // We're adding the record to the list before creating the DjVuFile\n\t       // because DjVuFile::init() will call request_data(), and the\n\t       // latter should be able to find the record.\n\t       //\n\t       // We also want to keep ufiles_lock to make sure that when\n\t       // request_data() is called, the record is still there\n\t    const_cast<DjVuDocument *>(this)->ufiles_list.append(ufile);\n      \n\t    GP<DjVuFile> file=\n              DjVuFile::create(url,const_cast<DjVuDocument *>(this),recover_errors,verbose_eof);\n\t    ufile->file=file;\n\t    return file;\n\t } else url=((DjVuFile *) (DjVuPort *) port)->get_url();\n      }\n   }\n   \n   GP<DjVuFile> file=url_to_file(url, dont_create);\n   if (file) \n     pcaster->add_route(file, const_cast<DjVuDocument *>(this));\n   return file;\n}\n\nGURL\nDjVuDocument::invent_url(const GUTF8String &name) const\n{\n   GUTF8String buffer;\n   buffer.format(\"djvufileurl://%p/%s\", this, (const char *)name);\n   return GURL::UTF8(buffer);\n}\n\nGP<DjVuFile>\nDjVuDocument::get_djvu_file(const GUTF8String& id, bool dont_create)\n{\n  check();\n  DEBUG_MSG(\"DjVuDocument::get_djvu_file(): ID='\" << id << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n  if (!id.length())\n    return get_djvu_file(-1);\n\n// Integers are not supported, only ID's  \n//  if (id.is_int())\n//     return get_djvu_file(id.toInt(),dont_create);\n  \n  GURL url;\n  // I'm locking the flags because depending on what id_to_url()\n  // returns me, I'll be creating DjVuFile in different ways.\n  // And I don't want the situation to change between the moment I call\n  // id_to_url() and I actually create DjVuFile\n  {\n    GMonitorLock lock(&flags);\n    url=id_to_url(id);\n    if(url.is_empty() && !id.is_int())\n    {\n      // If init is complete, we know for sure, that there is no such\n      // file with ID 'id' in the document. Otherwise we have to\n      // create a temporary file and wait for the init to finish\n      if (is_init_complete())\n        return 0;\n      // Invent some dummy temporary URL. I don't care what it will\n      // be. I'll remember the ID and will generate the correct URL\n      // after I learn what the document is\n      url=invent_url(id);\n      DEBUG_MSG(\"Invented url='\" << url << \"'\\n\");\n\n      GCriticalSectionLock lock(&ufiles_lock);\n      for(GPosition pos=ufiles_list;pos;++pos)\n      {\n        GP<UnnamedFile> f=ufiles_list[pos];\n        if (f->url==url)\n          return f->file;\n      }\n      GP<UnnamedFile> ufile=new UnnamedFile(UnnamedFile::ID, id, 0, url, 0);\n\n      // We're adding the record to the list before creating the DjVuFile\n      // because DjVuFile::init() will call request_data(), and the\n      // latter should be able to find the record.\n      //\n      // We also want to keep ufiles_lock to make sure that when\n      // request_data() is called, the record is still there\n      ufiles_list.append(ufile);\n      \n      GP<DjVuFile> file=DjVuFile::create(url,this,recover_errors,verbose_eof);\n      ufile->file=file;\n      return file;\n    }\n  }\n     \n  return get_djvu_file(url,dont_create);\n}\n\nGP<DjVuFile>\nDjVuDocument::get_djvu_file(const GURL& url, bool dont_create)\n{\n   check();\n   DEBUG_MSG(\"DjVuDocument::get_djvu_file(): URL='\" << url << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   if (url.is_empty())\n     return 0;\n\n   const GP<DjVuFile> file(url_to_file(url, dont_create));\n\n   if (file)\n     get_portcaster()->add_route(file, this);\n\n   return file;\n}\n\nGP<DjVuImage>\nDjVuDocument::get_page(int page_num, bool sync, DjVuPort * port) const\n{\n   check();\n   DEBUG_MSG(\"DjVuDocument::get_page(): request for page \" << page_num << \"\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   GP<DjVuImage> dimg;\n   const GP<DjVuFile> file(get_djvu_file(page_num));\n   if (file)\n   {\n     dimg=DjVuImage::create(file);\n     if (port)\n       DjVuPort::get_portcaster()->add_route(dimg, port);\n   \n     file->resume_decode();\n     if (dimg && sync)\n       dimg->wait_for_complete_decode();\n   }\n   return dimg;\n}\n\nGP<DjVuImage>\nDjVuDocument::get_page(const GUTF8String &id, bool sync, DjVuPort * port)\n{\n   check();\n   DEBUG_MSG(\"DjVuDocument::get_page(): ID='\" << id << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   GP<DjVuImage> dimg;\n   const GP<DjVuFile> file(get_djvu_file(id));\n   if(file)\n   {\n     dimg=DjVuImage::create(file);\n     if (port)\n       DjVuPort::get_portcaster()->add_route(dimg, port);\n   \n     file->resume_decode();\n     if (dimg && sync)\n       dimg->wait_for_complete_decode();\n   }\n   return dimg;\n}\n\nvoid\nDjVuDocument::process_threqs(void)\n      // Will look thru threqs_list and try to fulfil every request\n{\n  GCriticalSectionLock lock(&threqs_lock);\n  for(GPosition pos=threqs_list;pos;)\n  {\n    GP<ThumbReq> req=threqs_list[pos];\n    bool remove=false;\n    if (req->thumb_file)\n    {\n      G_TRY {\n\t       // There is supposed to be a file with thumbnails\n        if (req->thumb_file->is_data_present())\n        {\n          // Cool, we can extract the thumbnail now\n          GP<ByteStream> str=req->thumb_file->get_init_data_pool()->get_stream();\n          GP<IFFByteStream> giff=IFFByteStream::create(str);\n          IFFByteStream &iff=*giff;\n          GUTF8String chkid;\n          if (!iff.get_chunk(chkid) || chkid!=\"FORM:THUM\")\n            G_THROW( ERR_MSG(\"DjVuDocument.bad_thumb\") );          \n          for(int i=0;i<req->thumb_chunk;i++)\n          {\n            if (!iff.get_chunk(chkid)) \n              G_THROW( ERR_MSG(\"DjVuDocument.bad_thumb\") );\n            iff.close_chunk();\n          }\n          if (!iff.get_chunk(chkid) || chkid!=\"TH44\")\n            G_THROW( ERR_MSG(\"DjVuDocument.bad_thumb\") );\n          \n          // Copy the data\n          char buffer[1024];\n          int length;\n          while((length=iff.read(buffer, 1024)))\n            req->data_pool->add_data(buffer, length);\n          req->data_pool->set_eof();\n          \n          // Also add this file to cache so that we won't have\n          // to download it next time\n          add_to_cache(req->thumb_file);\n          req->thumb_file=0;\n          req->image_file=0;\n          remove=true;\n        }\n      } G_CATCH(exc) {\n        GUTF8String msg= ERR_MSG(\"DjVuDocument.cant_extract\") \"\\n\";\n        msg+=exc.get_cause();\n        get_portcaster()->notify_error(this, msg);\n\t       // Switch this request to the \"decoding\" mode\n        req->image_file=get_djvu_file(req->page_num);\n        req->thumb_file=0;\n        req->data_pool->set_eof();\n        remove=true;\n      } G_ENDCATCH;\n    } // if (req->thumb_file)\n    \n    if (req->image_file)\n    {\n      G_TRY {\n\t       // Decode the file if necessary. Or just used predecoded image.\n        GSafeFlags & file_flags=req->image_file->get_safe_flags();\n        {\n          GMonitorLock lock(&file_flags);\n          if (!req->image_file->is_decoding())\n          {\n            if (req->image_file->is_decode_ok())\n            {\n              // We can generate it now\n              const GP<DjVuImage> dimg(DjVuImage::create(req->image_file));\n              \n              dimg->wait_for_complete_decode();\n              \n              int width = 160;\n              int height = 160;\n              \n              if( dimg->get_width() )\n                width = dimg->get_width();\n              if( dimg->get_height() )\n                height = dimg->get_height();\n              \n              GRect rect(0, 0, 160, height*160/width);\n              GP<GPixmap> pm=dimg->get_pixmap(rect, rect, thumb_gamma);\n              if (!pm)\n              {\n                GP<GBitmap> bm=dimg->get_bitmap(rect, rect, sizeof(int));\n                if(bm)\n                  pm=GPixmap::create(*bm);\n                else\n                  pm = GPixmap::create(rect.height(), rect.width(), \n                                       &GPixel::WHITE);\n              }\n              \n              // Store and compress the pixmap\n              GP<IW44Image> iwpix=IW44Image::create_encode(*pm);\n              GP<ByteStream> gstr=ByteStream::create();\n              IWEncoderParms parms;\n              parms.slices=97;\n              parms.bytes=0;\n              parms.decibels=0;\n              iwpix->encode_chunk(gstr, parms);\n              TArray<char> data=gstr->get_data();\n              \n              req->data_pool->add_data((const char *) data, data.size());\n              req->data_pool->set_eof();\n              \n              req->thumb_file=0;\n              req->image_file=0;\n              remove=true;\n            } else if (req->image_file->is_decode_failed())\n            {\n              // Unfortunately we cannot decode it\n              req->thumb_file=0;\n              req->image_file=0;\n              req->data_pool->set_eof();\n              remove=true;\n            } else\n            {\n              req->image_file->start_decode();\n            }\n          }\n        }\n      } G_CATCH(exc) {\n        GUTF8String msg=\"Failed to decode thumbnails:\\n\";\n        msg+=exc.get_cause();\n        get_portcaster()->notify_error(this, msg);\n        \n\t       // Get rid of this request\n        req->image_file=0;\n        req->thumb_file=0;\n        req->data_pool->set_eof();\n        remove=true;\n      } G_ENDCATCH;\n    }\n    \n    if (remove)\n    {\n      GPosition this_pos=pos;\n      ++pos;\n      threqs_list.del(this_pos);\n    } else ++pos;\n  }\n}\n\nGP<DjVuDocument::ThumbReq>\nDjVuDocument::add_thumb_req(const GP<ThumbReq> & thumb_req)\n      // Will look through the list of pending requests for thumbnails\n      // and try to add the specified request. If a duplicate is found,\n      // it will be returned and the list will not be modified\n{\n   GCriticalSectionLock lock(&threqs_lock);\n   for(GPosition pos=threqs_list;pos;++pos)\n   {\n      GP<ThumbReq> req=threqs_list[pos];\n      if (req->page_num==thumb_req->page_num)\n\t return req;\n   }\n   threqs_list.append(thumb_req);\n   return thumb_req;\n}\n\nGList<GUTF8String>\nDjVuDocument::get_id_list(void)\n{\n  GList<GUTF8String> ids;\n  if (is_init_complete())\n  {\n    if(djvm_dir)\n    {\n      GPList<DjVmDir::File> files_list=djvm_dir->get_files_list();\n      for(GPosition pos=files_list;pos;++pos)\n      {\n        ids.append(files_list[pos]->get_load_name());\n      }\n    }else\n    {\n      const int page_num=get_pages_num();\n      for(int page=0;page<page_num;page++)\n      { \n        ids.append(page_to_url(page).fname());\n      }\n    }\n  }\n  return ids;\n}\n\nvoid\nDjVuDocument::map_ids(GMap<GUTF8String,void *> &map)\n{\n  GList<GUTF8String> ids=get_id_list();\n  for(GPosition pos=ids;pos;++pos)\n  {\n    map[ids[pos]]=0;\n  }\n}\n\nGP<DataPool>\nDjVuDocument::get_thumbnail(int page_num, bool dont_decode)\n{\n   DEBUG_MSG(\"DjVuDocument::get_thumbnail(): page_num=\" << page_num << \"\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   if (!is_init_complete()) return 0;\n   \n   {\n\t // See if we already have request for this thumbnail pending\n      GCriticalSectionLock lock(&threqs_lock);\n      for(GPosition pos=threqs_list;pos;++pos)\n      {\n\t GP<ThumbReq> req=threqs_list[pos];\n\t if (req->page_num==page_num)\n\t    return req->data_pool;\t// That's it. Just return it.\n      }\n   }\n\n      // No pending request for this page... Create one\n   GP<ThumbReq> thumb_req=new ThumbReq(page_num, DataPool::create());\n   \n      // First try to find predecoded thumbnail\n   if (get_doc_type()==INDIRECT || get_doc_type()==BUNDLED)\n   {\n\t // Predecoded thumbnails exist for new formats only\n      GPList<DjVmDir::File> files_list=djvm_dir->get_files_list();\n      GP<DjVmDir::File> thumb_file;\n      int thumb_start=0;\n      int page_cnt=-1;\n      for(GPosition pos=files_list;pos;++pos)\n      {\n\t GP<DjVmDir::File> f=files_list[pos];\n\t if (f->is_thumbnails())\n\t {\n\t    thumb_file=f;\n\t    thumb_start=page_cnt+1;\n\t } else if (f->is_page())\n         {\n           page_cnt++;\n         }\n\t if (page_cnt==page_num) break;\n      }\n      if (thumb_file)\n      {\n\t    // That's the file with the desired thumbnail image\n\t thumb_req->thumb_file=get_djvu_file(thumb_file->get_load_name());\n\t thumb_req->thumb_chunk=page_num-thumb_start;\n\t thumb_req=add_thumb_req(thumb_req);\n\t process_threqs();\n\t return thumb_req->data_pool;\n      }\n   }\n\n      // Apparently we're out of luck and need to decode the requested\n      // page (unless it's already done and if it's allowed) and render\n      // it into the thumbnail. If dont_decode is true, do not attempt\n      // to create this file (because this will result in a request for data)\n   GP<DjVuFile> file=get_djvu_file(page_num, dont_decode);\n   if (file)\n   {\n      thumb_req->image_file=file;\n\n\t // I'm locking the flags here to make sure, that DjVuFile will not\n\t // change its state in between of the checks.\n      GSafeFlags & file_flags=file->get_safe_flags();\n      {\n\t GMonitorLock lock(&file_flags);\n\t if (thumb_req->image_file->is_decode_ok() || !dont_decode)\n\t {\n\t       // Just add it to the list and call process_threqs(). It\n\t       // will start decoding if necessary\n\t    thumb_req=add_thumb_req(thumb_req);\n\t    process_threqs();\n\t } else\n\t {\n\t       // Nothing can be done return ZERO\n\t    thumb_req=0;\n\t }\n      }\n   } else thumb_req=0;\n   \n   if (thumb_req) return thumb_req->data_pool;\n   else return 0;\n}\n\nstatic void\nadd_to_cache(const GP<DjVuFile> & f, GMap<GURL, void *> & map,\n\t     DjVuFileCache * cache)\n{\n   GURL url=f->get_url();\n   DEBUG_MSG(\"DjVuDocument::add_to_cache(): url='\" << url << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n   \n   if (!map.contains(url))\n   {\n      map[url]=0;\n      cache->add_file(f);\n      \n      GPList<DjVuFile> list;\n      for(GPosition pos=list;pos;++pos)\n\t add_to_cache(list[pos], map, cache);\n   }\n}\n\nvoid\nDjVuDocument::add_to_cache(const GP<DjVuFile> & f)\n{\n   if (cache)\n   {\n      GMap<GURL, void *> map;\n      ::add_to_cache(f, map, cache);\n   }\n}\n\nvoid\nDjVuDocument::notify_file_flags_changed(const DjVuFile * source,\n\t\t\t\t\tlong set_mask, long clr_mask)\n{\n      // Don't check here if the document is initialized or not.\n      // This function may be called when it's not.\n      // check();\n   if (set_mask & DjVuFile::DECODE_OK)\n   {\n      set_file_aliases(source);\n      if (cache) add_to_cache((DjVuFile *) source);\n      if(!needs_compression_flag)\n      {\n        if(source->needs_compression())\n        {\n          can_compress_flag=true;\n          needs_compression_flag=true;\n        }else if(source->can_compress())\n        {\n          can_compress_flag=true;\n        }\n      }\n   }\n   process_threqs();\n}\n\nGP<DjVuFile>\nDjVuDocument::id_to_file(const DjVuPort * source, const GUTF8String &id)\n{\n   return (DjVuFile *) get_djvu_file(id);\n}\n\nGP<DataPool>\nDjVuDocument::request_data(const DjVuPort * source, const GURL & url)\n{\n   DEBUG_MSG(\"DjVuDocument::request_data(): seeing if we can do it\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   if (url==init_url)\n     return init_data_pool;\n\n   check();\t// Don't put it before 'init_data_pool'\n\n   {\n\t // See if there is a file in the \"UnnamedFiles\" list.\n\t // If it's there, then create an empty DataPool and store its\n\t // pointer in the list. The \"init thread\" will eventually\n\t // do smth with it.\n      GCriticalSectionLock lock(&ufiles_lock);\n      for(GPosition pos=ufiles_list;pos;++pos)\n      {\n\t GP<UnnamedFile> f=ufiles_list[pos];\n\t if (f->url==url)\n\t {\n\t    DEBUG_MSG(\"Found tmp unnamed DjVuFile. Return empty DataPool\\n\");\n\t       // Remember the DataPool. We will connect it to the\n\t       // actual data after the document structure becomes known\n\t    f->data_pool=DataPool::create();\n\t    return f->data_pool;\n\t }\n      }\n   }\n\n      // Well, the url is not in the \"UnnamedFiles\" list, but it doesn't\n      // mean, that it's not \"artificial\". Stay alert!\n   GP<DataPool> data_pool;\n   if (flags & DOC_TYPE_KNOWN)\n      switch(doc_type)\n      {\n\t case OLD_BUNDLED:\n\t {\n\t    if (flags & DOC_DIR_KNOWN)\n\t    {\n\t       DEBUG_MSG(\"The document is in OLD_BUNDLED format\\n\");\n\t       if (url.base()!=init_url)\n\t\t        G_THROW( ERR_MSG(\"DjVuDocument.URL_outside\") \"\\t\"+url.get_string());\n\t \n\t       GP<DjVmDir0::FileRec> file=djvm_dir0->get_file(url.fname());\n\t       if (!file)\n               {\n                 G_THROW( ERR_MSG(\"DjVuDocument.file_outside\") \"\\t\"+url.fname());\n               }\n\t       data_pool=DataPool::create(init_data_pool, file->offset, file->size);\n\t    }\n\t    break;\n\t }\n\t case BUNDLED:\n\t {\n\t    if (flags & DOC_DIR_KNOWN)\n\t    {\n\t       DEBUG_MSG(\"The document is in new BUNDLED format\\n\");\n\t       if (url.base()!=init_url)\n               {\n\t\t G_THROW( ERR_MSG(\"DjVuDocument.URL_outside\") \"\\t\"\n                   +url.get_string());\n               }\n\t \n\t       GP<DjVmDir::File> file=djvm_dir->id_to_file(url.fname());\n\t       if (!file)\n               {\n                 G_THROW( ERR_MSG(\"DjVuDocument.file_outside\") \"\\t\"+url.fname());\n               }\n\t       data_pool=DataPool::create(init_data_pool, file->offset, file->size);\n\t    }\n\t    break;\n\t }\n\t case SINGLE_PAGE:\n\t case OLD_INDEXED:\n\t case INDIRECT:\n\t {\n\t    DEBUG_MSG(\"The document is in SINGLE_PAGE or OLD_INDEXED or INDIRECT format\\n\");\n\t    if (flags & DOC_DIR_KNOWN)\n\t       if (doc_type==INDIRECT && !djvm_dir->id_to_file(url.fname()))\n\t\t        G_THROW( ERR_MSG(\"DjVuDocument.URL_outside2\") \"\\t\"+url.get_string());\n\t \n\t    if (url.is_local_file_url())\n\t    {\n//\t       GUTF8String fname=GOS::url_to_filename(url);\n//\t       if (GOS::basename(fname)==\"-\") fname=\"-\";\n\t       DEBUG_MSG(\"url=\" << url << \"\\n\");\n\n\t       data_pool=DataPool::create(url);\n\t    }\n\t }\n      }\n   return data_pool;\n}\n\n\nstatic void\nadd_file_to_djvm(const GP<DjVuFile> & file, bool page,\n\t\t DjVmDoc & doc, GMap<GURL, void *> & map)\n      // This function is used only for obsolete formats.\n      // For new formats there is no need to process files recursively.\n      // All information is already available from the DJVM chunk\n{\n   GURL url=file->get_url();\n\n   if (!map.contains(url))\n   {\n      map[url]=0;\n\n      if (file->get_chunks_number()>0 && !file->contains_chunk(\"NDIR\"))\n      {\n\t    // Get the data and unlink any file containing NDIR chunk.\n\t    // Yes. We're lazy. We don't check if those files contain\n\t    // anything else.\n\t GPosition pos;\n\t GPList<DjVuFile> files_list=file->get_included_files(false);\n\t GP<DataPool> data=file->get_djvu_data(false);\n\t for(pos=files_list;pos;++pos)\n\t {\n\t    GP<DjVuFile> f=files_list[pos];\n\t    if (f->contains_chunk(\"NDIR\"))\n\t       data=DjVuFile::unlink_file(data, f->get_url().fname());\n\t }\n\t \n\t    // Finally add it to the document\n\t GUTF8String name=file->get_url().fname();\n\t GP<DjVmDir::File> file_rec=DjVmDir::File::create(\n           name, name, name,\n           page ? DjVmDir::File::PAGE : DjVmDir::File::INCLUDE );\n\t doc.insert_file(file_rec, data, -1);\n\n\t    // And repeat for all included files\n\t for(pos=files_list;pos;++pos)\n\t    add_file_to_djvm(files_list[pos], false, doc, map);\n      }\n   }\n}\n\nstatic void\nadd_file_to_djvm(const GP<DjVuFile> & file, bool page,\n\t\t DjVmDoc & doc, GMap<GURL, void *> & map, \n                 bool &needs_compression_flag, bool &can_compress_flag )\n{\n  if(!needs_compression_flag)\n  {\n    if(file->needs_compression())\n    {\n      can_compress_flag=true;\n      needs_compression_flag=true;\n    }else if(file->can_compress())\n    {\n      can_compress_flag=true;\n    }\n  }\n  add_file_to_djvm(file,page,doc,map);\n}\n\nstatic void\nlocal_get_url_names(DjVuFile * f,const GMap<GURL, void *> & map,GMap<GURL,void *> &tmpmap)\n{\n   GURL url=f->get_url();\n   if (!map.contains(url) && !tmpmap.contains(url))\n   {\n      tmpmap[url]=0;\n      f->process_incl_chunks();\n      GPList<DjVuFile> files_list=f->get_included_files(false);\n      for(GPosition pos=files_list;pos;++pos)\n         local_get_url_names(files_list[pos], map, tmpmap);\n   }\n}\n\nstatic void\nlocal_get_url_names(DjVuFile * f, GMap<GURL, void *> & map)\n{\n   GMap<GURL,void *> tmpmap;\n   local_get_url_names(f,map,tmpmap);\n   for(GPosition pos=tmpmap;pos;++pos)\n     map[tmpmap.key(pos)]=0;\n}\n\nGList<GURL>\nDjVuDocument::get_url_names(void)\n{\n  check();\n\n  GCriticalSectionLock lock(&url_names_lock);\n  if(has_url_names)\n    return url_names;\n\n  GMap<GURL, void *> map;\n  int i;\n  if (doc_type==BUNDLED || doc_type==INDIRECT)\n  {\n    GPList<DjVmDir::File> files_list=djvm_dir->get_files_list();\n    for(GPosition pos=files_list;pos;++pos)\n    {\n      GURL url=id_to_url(files_list[pos]->get_load_name());\n      map[url]=0;\n    }\n  }else\n  {\n    int pages_num=get_pages_num();\n    for(i=0;i<pages_num;i++)\n    {\n      G_TRY\n      {\n        local_get_url_names(get_djvu_file(i), map);\n      }\n      G_CATCH(ex)\n      {\n        // Why is this try/catch block here?\n        G_TRY { \n          get_portcaster()->notify_error(this, ex.get_cause()); \n          GUTF8String emsg = ERR_MSG(\"DjVuDocument.exclude_page\") \"\\t\" + (i+1);\n          get_portcaster()->notify_error(this, emsg);\n        }\n        G_CATCH_ALL\n        {\n          G_RETHROW;\n        }\n        G_ENDCATCH;\n      }\n      G_ENDCATCH;\n    }\n  }\n  for(GPosition j=map;j;++j)\n  {\n    if (map.key(j).is_local_file_url())\n    {\n      url_names.append(map.key(j));\n    }\n  }\n  has_url_names=true;\n  return url_names;\n}\n\nGP<DjVmDoc>\nDjVuDocument::get_djvm_doc()\n      // This function may block for data\n{\n   check();\n   DEBUG_MSG(\"DjVuDocument::get_djvm_doc(): creating the DjVmDoc\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   if (!is_init_complete())\n     G_THROW( ERR_MSG(\"DjVuDocument.init_not_done\") );\n\n   GP<DjVmDoc> doc=DjVmDoc::create();\n\n   if (doc_type==BUNDLED || doc_type==INDIRECT)\n     {\n       GPList<DjVmDir::File> files_list=djvm_dir->get_files_list();\n       for(GPosition pos=files_list;pos;++pos)\n         {\n           GP<DjVmDir::File> f=new DjVmDir::File(*files_list[pos]);\n           GP<DjVuFile> file=url_to_file(id_to_url(f->get_load_name()));\n           GP<DataPool> data;\n           if (file->is_modified()) \n             data=file->get_djvu_data(false);\n           else \n             data=file->get_init_data_pool();\n           doc->insert_file(f, data);\n         }\n       if (djvm_nav)\n         doc->set_djvm_nav(djvm_nav);\n     } \n   else if (doc_type==SINGLE_PAGE)\n     {\n       DEBUG_MSG(\"Creating: djvm for a single page document.\\n\");\n       GMap<GURL, void *> map_add;\n       GP<DjVuFile> file=get_djvu_file(0);\n       add_file_to_djvm(file, true, *doc, map_add,\n                        needs_compression_flag,can_compress_flag);\n     } \n   else\n     {\n       DEBUG_MSG(\"Converting: the document is in an old format.\\n\");\n       GMap<GURL, void *> map_add;\n       if(recover_errors == ABORT)\n         {\n           for(int page_num=0;page_num<ndir->get_pages_num();page_num++)\n             {\n               GP<DjVuFile> file=url_to_file(ndir->page_to_url(page_num));\n               add_file_to_djvm(file, true, *doc, map_add,\n                                needs_compression_flag,can_compress_flag);\n             }\n         }\n       else\n         {\n           for(int page_num=0;page_num<ndir->get_pages_num();page_num++)\n             {\n               G_TRY\n                 {\n                   GP<DjVuFile> file=url_to_file(ndir->page_to_url(page_num));\n                   add_file_to_djvm(file, true, *doc, map_add,\n                                    needs_compression_flag,can_compress_flag);\n                 }\n               G_CATCH(ex)\n                 {\n                   G_TRY { \n                     get_portcaster()->notify_error(this, ex.get_cause());\n                     GUTF8String emsg = ERR_MSG(\"DjVuDocument.skip_page\") \"\\t\" \n                                      + (page_num+1);\n                     get_portcaster()->notify_error(this, emsg);\n                   }\n                   G_CATCH_ALL\n                     {\n                       G_RETHROW;\n                     }\n                   G_ENDCATCH;\n                 }\n               G_ENDCATCH;\n             }\n         }\n     }\n   return doc;\n}\n\nvoid\nDjVuDocument::write( const GP<ByteStream> &gstr,\n  const GMap<GUTF8String,void *> &reserved)\n{\n  DEBUG_MSG(\"DjVuDocument::write(): storing DjVmDoc into ByteStream\\n\");\n  DEBUG_MAKE_INDENT(3);\n  get_djvm_doc()->write(gstr,reserved); \n}\n\nvoid\nDjVuDocument::write(const GP<ByteStream> &gstr, bool force_djvm)\n{\n  DEBUG_MSG(\"DjVuDocument::write(): storing DjVmDoc into ByteStream\\n\");\n  DEBUG_MAKE_INDENT(3);\n   \n  GP<DjVmDoc> doc=get_djvm_doc();\n  GP<DjVmDir> dir=doc->get_djvm_dir();\n\n  bool singlepage = (dir->get_files_num()==1 && !djvm_nav && !force_djvm);\n  if (singlepage)\n  {\n    // maybe save as single page\n    DjVmDir::File *file = dir->page_to_file(0);\n    if (file->get_title() != file->get_load_name())\n      singlepage = false;\n  }\n  if (! singlepage)\n  {\n    doc->write(gstr);\n  }\n  else\n  {\n    GPList<DjVmDir::File> files_list=dir->resolve_duplicates(false);\n    GP<DataPool> pool=doc->get_data(files_list[files_list]->get_load_name());\n    GP<ByteStream> pool_str=pool->get_stream();\n    ByteStream &str=*gstr;\n    str.writall(octets,4);\n    str.copy(*pool_str);\n  }\n}\n\nvoid\nDjVuDocument::expand(const GURL &codebase, const GUTF8String &idx_name)\n{\n   DEBUG_MSG(\"DjVuDocument::expand(): codebase='\" << codebase << \"'\\n\");\n   DEBUG_MAKE_INDENT(3);\n   \n   GP<DjVmDoc> doc=get_djvm_doc();\n   doc->expand(codebase, idx_name);\n}\n\nvoid\nDjVuDocument::save_as(const GURL &where, bool bundled)\n{\n   DEBUG_MSG(\"DjVuDocument::save_as(): where='\" << where <<\n\t     \"', bundled=\" << bundled << \"\\n\");\n   DEBUG_MAKE_INDENT(3);\n   \n   if (needs_compression())\n   { \n     if(!djvu_compress_codec)\n     {\n       G_THROW( ERR_MSG(\"DjVuDocument.comp_codec\") );\n     }\n     GP<ByteStream> gmbs=ByteStream::create();\n     write(gmbs);\n     ByteStream &mbs=*gmbs;\n     mbs.flush();\n     mbs.seek(0,SEEK_SET);\n     (*djvu_compress_codec)(gmbs,where,bundled);\n   }else if (bundled)\n   {\n      DataPool::load_file(where);\n      write(ByteStream::create(where, \"wb\"));\n   } else \n   {\n     expand(where.base(), where.fname());\n   }\n}\n\nstatic const char prolog[]=\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<!DOCTYPE DjVuXML PUBLIC \\\"-//W3C//DTD DjVuXML 1.1//EN\\\" \\\"pubtext/DjVuXML-s.dtd\\\">\\n<DjVuXML>\\n<HEAD>\";\nstatic const char start_xml[]=\"</HEAD>\\n<BODY>\\n\";\nstatic const char end_xml[]=\"</BODY>\\n</DjVuXML>\\n\";\n\nvoid\nDjVuDocument::writeDjVuXML(const GP<ByteStream> &gstr_out,\n                           int flags, int page) const\n{\n  ByteStream &str_out=*gstr_out;\n  str_out.writestring(\n    prolog+get_init_url().get_string().toEscaped()+start_xml);\n  const int pages=wait_get_pages_num();\n  int pstart = (page < 0) ? 0 : page;\n  int pend = (page < 0) ? pages : page+1;\n  for(int page_num=pstart; page_num<pend; ++page_num)\n  {\n    const GP<DjVuImage> dimg(get_page(page_num,true));\n    if(!dimg)\n    {\n      G_THROW( ERR_MSG(\"DjVuToText.decode_failed\") );\n    }\n    dimg->writeXML(str_out,get_init_url(),flags);\n  }\n  str_out.writestring(GUTF8String(end_xml));\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVuDocument.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _DJVUDOCUMENT_H\n#define _DJVUDOCUMENT_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n#include \"DjVuPort.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass DjVmDoc;\nclass DjVmDir;\nclass DjVmDir0;\nclass DjVmNav;\nclass DjVuImage;\nclass DjVuFile;\nclass DjVuFileCache;\nclass DjVuNavDir;\nclass ByteStream;\n\n/** @name DjVuDocument.h\n    Files #\"DjVuDocument.h\"# and #\"DjVuDocument.cpp\"# contain implementation\n    of the \\Ref{DjVuDocument} class - the ideal tool for opening, decoding\n    and saving DjVu single page and multi page documents.\n\n    @memo DjVu document class.\n    @author Andrei Erofeev <eaf@geocities.com>\n*/\n\n//@{\n\n/** #DjVuDocument# provides convenient interface for opening, decoding\n    and saving back DjVu documents in single page and multi page formats.\n\n    {\\bf Input formats}\n    It can read multi page DjVu documents in either of the 4 formats: 2\n    obsolete ({\\em old bundled} and {\\em old indexed}) and two new\n    ({\\em new bundled} and {\\em new indirect}).\n\n    {\\bf Output formats}\n    To encourage users to switch to the new formats, the #DjVuDocument# can\n    save documents back only in the new formats: {\\em bundled} and\n    {\\em indirect}.\n\n    {\\bf Conversion.} Since #DjVuDocument# can open DjVu documents in\n    an obsolete format and save it in any of the two new formats\n    ({\\em new bundled} and {\\em new indirect}), this class can be used for\n    conversion from obsolete formats to the new ones. Although it can also\n    do conversion between the new two formats, it's not the best way to\n    do it. Please refer to \\Ref{DjVmDoc} for details.\n\n    {\\bf Decoding.} #DjVuDocument# provides convenient interface for obtaining\n    \\Ref{DjVuImage} corresponding to any page of the document. It uses\n    \\Ref{DjVuFileCache} to do caching thus avoiding unnecessary multiple decoding of\n    the same page. The real decoding though is accomplished by \\Ref{DjVuFile}.\n\n    {\\bf Messenging.} Being derived from \\Ref{DjVuPort}, #DjVuDocument#\n    takes an active part in exchanging messages (requests and notifications)\n    between different parties involved in decoding. It reports (relays)\n    errors, progress information and even handles some requests for data (when\n    these requests deal with local files).\n\n    Typical usage of #DjVuDocument# class in a threadless command line\n    program would be the following:\n    \\begin{verbatim}\n    static const char file_name[]=\"/tmp/document.djvu\";\n    GP<DjVuDocument> doc=DjVuDocument::create_wait(file_name);\n    const int pages=doc->get_pages_num();\n    for(int page=0;page<pages;page++)\n    {\n       GP<DjVuImage> dimg=doc->get_page(page);\n       // Do something\n    };\n    \\end{verbatim}\n    \n    {\\bf Comments for the code above}\n    \\begin{enumerate}\n       \\item Since the document is assumed to be stored on the hard drive,\n             we don't have to cope with \\Ref{DjVuPort}s and can pass\n\t     #ZERO# pointer to the \\Ref{init}() function. #DjVuDocument#\n\t     can access local data itself. In the case of a plugin though,\n\t     one would have to implement his own \\Ref{DjVuPort}, which\n\t     would handle requests for data arising when the document\n\t     is being decoded.\n       \\item In a threaded program instead of calling the \\Ref{init}()\n             function one can call \\Ref{start_init}() and \\Ref{stop_init}()\n\t     to initiate and interrupt initialization carried out in\n\t     another thread. This possibility of initializing the document\n\t     in another thread has been added specially for the plugin\n\t     because the initialization itself requires data, which is\n\t     not immediately available in the plugin. Thus, to prevent the\n\t     main thread from blocking, we perform initialization in a\n\t     separate thread. To check if the class is completely and\n\t     successfully initialized, use \\Ref{is_init_ok}(). To see if\n\t     there was an error, use \\Ref{is_init_failed}(). To\n\t     know when initialization is over (whether successfully or not),\n\t     use \\Ref{is_init_complete}(). To wait for this to happen use\n\t     \\Ref{wait_for_complete_init}(). Once again, all these things are\n\t     not required for single-threaded program.\n\n\t     Another difference between single-threaded and multi-threaded\n\t     environments is that in a single-threaded program, the image is\n\t     fully decoded before it's returned. In a multi-threaded\n\t     application decoding starts in a separate thread, and the pointer\n\t     to the \\Ref{DjVuImage} being decoded is returned immediately.\n\t     This has been done to enable progressive redisplay\n\t     in the DjVu plugin. Use communication mechanism provided by\n\t     \\Ref{DjVuPort} and \\Ref{DjVuPortcaster} to learn about progress\n\t     of decoding.  Or try #dimg->wait_for_complete_decode()# to wait\n\t     until the decoding ends.\n       \\item See Also: \\Ref{DjVuFile}, \\Ref{DjVuImage}, \\Ref{GOS}.\n    \\end{enumerate}\n\n    {\\bf Initialization}\n    As mentioned above, the #DjVuDocument# can go through several stages\n    of initialization. The functionality is gradually added while it passes\n    one stage after another:\n    \\begin{enumerate}\n       \\item First of all, immediately after the object is created \\Ref{init}()\n             or \\Ref{start_init}() functions must be called. {\\bf Nothing}\n\t     will work until this is done. \\Ref{init}() function will not\n\t     return until the initialization is complete. You need to make\n\t     sure, that enough data is available. {\\bf Do not call \\Ref{init}()\n\t     in the plugin}. \\Ref{start_init}() will start initialization\n\t     in another thread. Use \\Ref{stop_init}() to interrupt it.\n\t     Use \\Ref{is_init_complete}() to check the initialization progress.\n\t     Use \\Ref{wait_for_complete_init}() to wait for init to finish.\n       \\item The first thing the initializing code learns about the document\n\t     is its type (#BUNDLED#, #INDIRECT#, #OLD_BUNDLED# or #OLD_INDEXED#).\n\t     As soon as it happens, document flags are changed and\n\t     #notify_doc_flags_changed()# request is sent through the\n\t     communication mechanism provided by \\Ref{DjVuPortcaster}.\n       \\item After the document type becomes known, the initializing code\n             proceeds with learning the document structure. Gradually the\n\t     flags are updated with values:\n\t     \\begin{itemize}\n\t        \\item #DOC_DIR_KNOWN#: Contents of the document became known.\n\t\t      This is meaningful for #BUNDLED#, #OLD_BUNDLED# and\n\t\t      #INDIRECT# documents only.\n\t\t\\item #DOC_NDIR_KNOWN#: Contents of the document navigation\n\t\t      directory became known. This is meaningful for old-style\n\t\t      documents (#OLD_BUNDLED# and #OLD_INDEXED#) only\n\t\t\\item #DOC_INIT_OK# or #DOC_INIT_FAILED#:\n\t\t      The initializating code finished.\n\t     \\end{itemize}\n    \\end{enumerate} */\n    \nclass DJVUAPI DjVuDocument : public DjVuPort\n{\npublic:\n      /** Flags describing the document initialization state.\n\t  \\begin{itemize}\n\t     \\item #DOC_TYPE_KNOWN#: The type of the document has been learnt.\n\t     \\item #DOC_DIR_KNOWN#: Contents of the document became known.\n\t\t   This is meaningful for #BUNDLED#, #OLD_BUNDLED# and\n\t\t   #INDIRECT# documents only.\n\t     \\item #DOC_NDIR_KNOWN#: Contents of the document navigation\n\t\t   directory became known. This is meaningful for old-style\n\t\t   documents (#OLD_BUNDLED# and #OLD_INDEXED#) only\n\t     \\item #DOC_INIT_OK#: The initialization has completed successfully.\n\t     \\item #DOC_INIT_FAILED#: The initialization failed.\n\t  \\end{itemize} */\n   enum DOC_FLAGS { DOC_TYPE_KNOWN=1, DOC_DIR_KNOWN=2,\n\t\t    DOC_NDIR_KNOWN=4, DOC_INIT_OK=8,\n\t\t    DOC_INIT_FAILED=16 };\n      /** Specifies the format of #DjVuDocument#. There are currently 4 DjVu\n\t  multipage formats recognized by the library. Two of them are obsolete\n\t  and should not be used.\n\t  \\begin{enumerate}\n\t     \\item #OLD_BUNDLED# - Obsolete bundled format\n\t     \\item #OLD_INDEXED# - Obsolete multipage format where every page\n\t           is stored in a separate file and \"includes\" (by means\n\t\t   of an #INCL# chunk) the file with the document directory.\n\t     \\item #SINGLE_PAGE# - Single page document. Basically a file\n\t     \t   with either #FORM:DJVU# or #FORM:IW44# and no multipage\n\t\t   information. For example, #OLD_INDEXED# documents with\n\t\t   document directory do not qualify even if they contain only\n\t\t   one page.\n\t     \\item #BUNDLED# - Currently supported bundled format\n\t     \\item #INDIRECT# - Currently supported \"expanded\" format, where\n\t           every page and component is stored in a separate file. There\n\t\t   is also a {\\em top-level} file with the document directory.\n          \\end{enumerate} */\n   enum DOC_TYPE { OLD_BUNDLED=1, OLD_INDEXED, BUNDLED, INDIRECT,\n\t\t   SINGLE_PAGE, UNKNOWN_TYPE };\n   enum THREAD_FLAGS { STARTED=1, FINISHED=2 };\n\nprotected:\n      /** Default creator. Please call functions \\Ref{init}() or\n\t  \\Ref{start_init}() before you start working with the #DjVuDocument#.\n        */\n   DjVuDocument(void);\npublic:\n\n     /// Virtual Destructor\n   virtual ~DjVuDocument(void);\n\n      /** Initializes the #DjVuDocument# object using an existing document.\n          This function should be called once after creating the object.\n\t  The #url# should point to the real data, and the creator of the\n\t  document should be ready to return this data to the document\n\t  if it's not stored locally (in which case #DjVuDocument# can\n\t  access it itself).\n\n\t  {\\bf Initializing thread}\n\t  In a single-threaded application, the #start_init()# function performs\n\t  the complete initialization of the #DjVuDocument# before it returns.\n\t  In a multi-threaded application, though, it initializes some internal\n\t  variables, requests data for the document and starts a new\n\t  {\\em initializing} thread, which is responsible for determining the\n\t  document type and structure and completing the initialization\n\t  process. This additional complication is justified in the case of\n\t  the DjVu plugin because performing initialization requires data and\n\t  in the plugin the data can be supplied by the main thread only.\n\t  Thus, if the initialization was completed by the main thread, the\n\t  plugin would run out of data and block.\n\n\t  {\\bf Stages of initialization}\n\t  Immediately after the #start_init()# function terminates, the\n\t  #DjVuDocument# object is ready for use. Its functionality will\n\t  not be complete (until the initializing thread finishes), but\n\t  the object is still very useful. Such functions as \\Ref{get_page}()\n\t  or \\Ref{get_djvu_file}() or \\Ref{id_to_url}() may be called\n\t  before the initializing thread completes. This allows the DjVu\n\t  plugin start decoding as soon as possible without waiting for\n\t  all data to arrive.\n\n\t  To query the current stage of initialization you can use\n\t  \\Ref{get_doc_flags}() function or listen to the\n\t  #notify_doc_flags_changed()# notifications distributed with the help\n\t  of \\Ref{DjVuPortcaster}. To wait for the initialization to\n\t  complete use \\Ref{wait_for_complete_init}(). To stop initialization\n\t  call \\Ref{stop_init}().\n\n\t  {\\bf Querying data}\n\t  The query for data is done using the communication mechanism\n\t  provided by \\Ref{DjVuPort} and \\Ref{DjVuPortcaster}. If #port#\n\t  is not #ZERO#, then the request for data will be forwarded to it.\n\t  If it {\\bf is} #ZERO# then #DjVuDocument# will create an internal\n\t  instance of \\Ref{DjVuSimplePort} and will use it to access local\n\t  files and report errors to #stderr#. In short, if the document\n\t  file is stored on the local hard disk, and you're OK about reporting\n\t  errors to #stderr#, you may pass #ZERO# pointer to \\Ref{DjVuPort}\n\t  as #DjVuDocument# can take care of this situation by itself.\n\n\t  {\\bf The URL}\n\t  Depending on the document type the #url# should point to:\n\t  \\begin{itemize}\n\t     \\item {\\bf Old bundled} and {\\bf New bundled} formats: to the\n\t           document itself.\n\t     \\item {\\bf Old indexed} format: to any page of the document.\n\t     \\item {\\bf New indirect} format: to the top-level file of the\n\t           document. If (like in the {\\em old indexed} format) you\n\t\t   point the #url# to a page, the page {\\em will} be decoded,\n\t\t   but it will {\\em not} be recognized to be part of the\n\t\t   document.\n\t  \\end{itemize}\n\n\t  @param url The URL pointing to the document. If the document is\n\t         in a {\\em bundled} format then the URL should point to it.\n\t\t If the document is in the {\\em old indexed} format then\n\t\t URL may point to any page of this document. For {\\em new\n\t\t indirect} format the URL should point to the top-level\n\t\t file of the document.\n\t  @param port If not #ZERO#, all requests and notifications will\n\t         be sent to it. Otherwise #DjVuDocument# will create an internal\n\t\t instance of \\Ref{DjVuSimplePort} for these purposes.\n\t\t It's OK to make it #ZERO# if you're writing a command line\n\t\t tool, which should work with files on the hard disk only\n\t\t because #DjVuDocument# can access such files itself.\n\t  @param cache It's used to cache decoded \\Ref{DjVuFile}s and\n\t         is actually useful in the plugin only.  */\n   void\t\tstart_init(const GURL & url, GP<DjVuPort> port=0,\n\t\t\t   DjVuFileCache * cache=0);\n\n   /** This creates a DjVuDocument without initializing it. */\n   static GP<DjVuDocument> create_noinit(void) {return new DjVuDocument;}\n\n   /** Create a version of DjVuDocument which has finished initializing. */\n   static GP<DjVuDocument> create_wait(\n     const GURL &url, GP<DjVuPort> xport=0, DjVuFileCache * const xcache=0);\n\n   /** Create a version of DjVuDocument which has begun initializing. */\n   static GP<DjVuDocument> create(\n     const GURL &url, GP<DjVuPort> xport=0, DjVuFileCache * const xcache=0);\n\n   /** Create a version of DjVuDocument which has begun initializing. */\n   static GP<DjVuDocument> create(\n     GP<DataPool> pool, GP<DjVuPort> xport=0, DjVuFileCache * const xcache=0);\n\n   /** Create a version of DjVuDocument which has begun initializing. */\n   static GP<DjVuDocument> create(\n     const GP<ByteStream> &bs, GP<DjVuPort> xport=0,\n     DjVuFileCache * const xcache=0);\n\n      /** Call this function when you don't need the #DjVuDocument# any more.\n\t  In a multi-threaded environment it will stop initialization\n\t  thread, if it is currently running. {\\bf You will not be able\n\t  to start the initialization again. Thus, after calling this\n          function the document should not be used any more}. */\n   void\t\tstop_init(void);\n\n      /** Initializes the document.\n\n\t  Contrary to \\Ref{start_init}(), which just starts the initialization\n\t  thread in a multi-threaded environment, this function does not\n\t  return until the initialization completes (either successfully or\n\t  not). Basically, it calls \\Ref{start_init}() and then\n\t  \\Ref{wait_for_complete_init}().\n\t  */\n   void\t\tinit(const GURL & url, GP<DjVuPort> port=0,\n\t\t     DjVuFileCache * cache=0);\n\n      /** Returns #TRUE# if the initialization thread finished (does not\n\t  matter successfully or not). As soon as it happens, the document\n\t  becomes completely initialized and its every function should work\n\t  properly. Please refer to the description of \\Ref{init}() function\n\t  and of the #DjVuDocument# class to learn about the initializing\n\t  stages.\n\n\t  To wait for the initialization to complete use\n\t  \\Ref{wait_for_complete_init}() function.\n\n\t  To query the initialization stage use \\Ref{get_flags}() function.\n\n\t  To learn whether initialization was successful or not,\n\t  use \\Ref{is_init_ok}() and \\Ref{is_init_failed}().\n\n\t  {\\bf Note:} In a single threaded application the initialization\n\t  completes before the \\Ref{init}() function returns. */\n   bool\t\tis_init_complete(void) const;\n\n      /** Returns #TRUE# is the initialization thread finished successfully.\n\n\t  See \\Ref{is_init_complete}() and \\Ref{wait_for_complete_init}()\n\t  for more details. */\n   bool\t\tis_init_ok(void) const;\n      /** Forces compression with the next save_as function. */\n   void\t\tset_needs_compression(void);\n      /** Returns #TRUE# if there are uncompressed pages in this document. */\n   bool\t\tneeds_compression(void) const;\n      /** Returns #TRUE# if this file must be renamed before saving. */\n   bool\t\tneeds_rename(void) const;\n      /** Returns #TRUE# if this file must be renamed before saving. */\n   bool\t\tcan_compress(void) const;\n\n      /** Returns #TRUE# is the initialization thread failed.\n\n\t  See \\Ref{is_init_complete}() and \\Ref{wait_for_complete_init}()\n\t  for more details. */\n   bool\t\tis_init_failed(void) const;\n\n      /** If the document has already learnt its type, the function will\n\t  returns it: #DjVuDocument::OLD_BUNDLED# or\n\t  #DjVuDocument::OLD_INDEXED# or #DjVuDocument::SINGLE_PAGE# or\n\t  #DjVuDocument:BUNDLED# or #DjVuDocument::INDIRECT#. The first\n\t  two formats are obsolete. Otherwise (if the type is unknown yet),\n\t  #UNKNOWN_TYPE# will be returned.\n\n\t  {\\bf Note:} To check the stage of the document initialization\n\t  use \\Ref{get_flags}() or \\Ref{is_init_complete}() functions. To\n\t  wait for the initialization to complete use \\Ref{wait_for_complete_init}().\n\t  For single threaded applications the initialization completes\n\t  before the \\Ref{init}() function returns. */\n   int\t\tget_doc_type(void) const;\n\n      /** Returns the document flags. The flags describe the degree in which\n\t  the #DjVuDocument# object is initialized. Every time the flags\n\t  are changed, a #notify_doc_flags_changed()# notification is\n\t  distributed using the \\Ref{DjVuPortcaster} communication\n\t  mechanism.\n\n\t  {\\bf Note:} To wait for the initialization to complete use\n\t  \\Ref{wait_for_complete_init}(). For single threaded applications\n\t  the initialization completes before the \\Ref{init}() function\n\t  returns. */\n   long\t\tget_doc_flags(void) const;\n\n      /** Returns #TRUE# if the document is in bundled format (either in\n\t  #DjVuDocument::OLD_BUNDLED# or #DjVuDocument::BUNDLED# formats). */\n   bool\t\tis_bundled(void) const;\n\n      /// Returns the URL passed to the \\Ref{init}() function\n   GURL\t\tget_init_url(void) const;\n\n      /// Returns a listing of id's used by this document.\n   GList<GUTF8String> get_id_list(void);\n\n      /// Fill the id's into a GMap.\n   void map_ids( GMap<GUTF8String,void *> &map);\n\n      /** Returns data corresponding to the URL passed to the \\Ref{init}()\n\t  function.\n\n\t  {\\bf Note:} The pointer returned is guaranteed to be non-#ZERO#\n\t  only after the #DjVuDocument# learns its type (passes through\n\t  the first stage of initialization process). Please refer to\n\t  \\Ref{init}() for details. */\n   GP<DataPool>\tget_init_data_pool(void) const;\n\n      /** @name Accessing pages */\n      //@{\n      /** Returns the number of pages in the document. If there is still\n\t  insufficient information about the document structure (initialization\n\t  has not finished yet), #1# will be returned. Please refer to\n          \\Ref{init}() for details. */\n   int\t\tget_pages_num(void) const;\n\n      /** Translates the page number to the full URL of the page. This URL\n\t  is \"artificial\" for the {\\em bundled} formats and is obtained\n\t  by appending the page name to the document's URL honoring possible\n\t  #;# and #?# in it. Negative page number has a special meaning for\n\t  #OLD_INDEXED# documents: it points to the URL, which the\n\t  #DjVuDocument# has been initialized with. For other formats this\n\t  is the same as page #0#.\n\n\t  The function tries it best to map the page number to the URL.\n\t  Although, if the document structure has not been fully discovered\n\t  yet, an empty URL will be returned. Use \\Ref{wait_for_complete_init}()\n\t  to wait until the document initialization completes. Refer to\n\t  \\Ref{init}() for details.\n\n\t  Depending on the document format, the function assumes, that there\n\t  is enough information to complete the request when:\n\t  \\begin{itemize}\n\t     \\item #OLD_INDEXED#: If #page_num<0#, #DOC_TYPE_KNOWN# flag must\n\t\t   be set. Otherwise #DOC_NDIR_KNOWN# must be set.\n\t     \\item #OLD_BUNDLED#: If #page_num=0#, #DOC_DIR_KNOWN# flag must\n\t\t   be set. Otherwise #DOC_NDIR_KNOWN# flag must be set.\n\t     \\item #INDIRECT# and #BUNDLED#: #DOC_DIR_KNOWN# flag must be set.\n\t  \\end{itemize} */\n   GURL\t\tpage_to_url(int page_num) const;\n   /// Tranlate the page number to id...\n   GUTF8String page_to_id(int page_num) const\n   { return url_to_id(page_to_url(page_num)); }\n      /** Translates the page URL back to page number. Returns #-1# if the\n\t  page is not in the document or the document's structure\n          has not been learnt yet.\n\n\t  Depending on the document format, the function starts working\n\t  properly as soon as:\n\t  \\begin{itemize}\n\t     \\item #OLD_INDEXED# and #OLD_BUNDLED# and #SINGLE_PAGE#:\n\t           #DOC_NDIR_KNOWN# is set\n\t     \\item #INDIRECT# and #BUNDLED#: #DOC_DIR_KNOWN# is set.\n\t  \\end{itemize} */\n   int\t\turl_to_page(const GURL & url) const;\n   /// Map the specified url to it's id.\n   GUTF8String  url_to_id(const GURL &url) const\n   { return url.fname(); }\n\n      /** Translates the textual ID to the complete URL if possible.\n\t  \n\t  Depending on the document format the translation is done in the\n\t  following way:\n\t  \\begin{itemize}\n\t     \\item For #BUNDLED# and #INDIRECT# documents the function\n\t\t   scans the \\Ref{DjVmDir} (the document directory) and\n\t\t   matches the ID against:\n\t\t   \\begin{enumerate}\n\t\t      \\item File ID from the \\Ref{DjVmDir}\n\t\t      \\item File name from the \\Ref{DjVmDir}\n\t\t      \\item File title from the \\Ref{DjVmDir}\n\t\t   \\end{enumerate}\n\t\t   Then for #BUNDLED# document the URL is obtained by\n\t\t   appending the #name# of the found file to the document's\n\t\t   URL.\n\n\t\t   For #INDIRECT# documents the URL is obtained by\n\t\t   appending the #name# of the found file to the URL of\n\t\t   the directory containing the document.\n\t     \\item For #OLD_BUNDLED# documents the function compares the ID\n\t\t   with internal name of every file inside the bundle and\n\t\t   composes an artificial URL by appending the file name to\n\t\t   the document's URL.\n\t     \\item For #OLD_INDEXED# or #SINGLE_PAGE# documents the function\n\t\t   composes the URL by appending the ID to the URL of the\n\t\t   directory containing the document.\n\t  \\end{itemize}\n\n\t  If information obtained by the initialization thread is not\n\t  sufficient yet, the #id_to_url()# may return an empty URL.\n\t  Depending on the document type, the information is sufficient when\n\t  \\begin{itemize}\n\t     \\item #BUNDLED# and #INDIRECT#: #DOC_DIR_KNOWN# flag is set.\n\t     \\item #OLD_BUNDLED# and #OLD_INDEXED# and #SINGLE_PAGE#:\n\t           #DOC_TYPE_KNOWN# flag is set.\n\t  \\end{itemize} */\n   GURL\t\tid_to_url(const GUTF8String &id) const;\n   /// Find out which page this id is...\n   int\t\tid_to_page(const GUTF8String &id) const\n   {  return url_to_page(id_to_url(id)); }\n\n      /** Returns \\Ref{GP} pointer to \\Ref{DjVuImage} corresponding to page\n          #page_num#. If caching is enabled, and there is a {\\em fully decoded}\n\t  \\Ref{DjVuFile} in the cache, the image will be reused and will\n\t  be returned fully decoded. Otherwise, if multi-threaded behavior\n\t  is allowed, and #sync# is set to #FALSE#, the decoding will be\n\t  started in a separate thread, which enables to do progressive\n\t  redisplay. Thus, in this case the image returned may be partially\n\t  decoded.\n\n\t  Negative #page_num# has a special meaning for the {\\em old indexed}\n\t  multipage documents: the #DjVuDocument# will start decoding of the\n\t  URL with which it has been initialized. For other formats page\n\t  #-1# is the same as page #0#.\n\n\t  #DjVuDocument# can also connect the created page to the specified\n\t  #port# {\\em before starting decoding}. This option will allow\n\t  the future owner of \\Ref{DjVuImage} to receive all messages and\n\t  requests generated during its decoding.\n\n\t  If this function is called before the document's structure becomes\n\t  known (the initialization process completes), the \\Ref{DjVuFile},\n\t  which the returned image will be attached to, will be assigned a\n\t  temporary artificial URL, which will be corrected as soon as enough\n\t  information becomes available. The trick prevents the main thread\n\t  from blocking and in some cases helps to start decoding earlier.\n\t  The URL is corrected and decoding will start as soon as\n\t  #DjVuDocument# passes some given stages of initialization and\n\t  \\Ref{page_to_url}(), \\Ref{id_to_url}() functions start working\n\t  properly. Please look through their description for details.\n\n\t  {\\bf Note:} To wait for the initialization to complete use\n\t  \\Ref{wait_for_complete_init}(). For single threaded applications\n\t  the initialization completes before the \\Ref{init}() function\n\t  returns.\n\n\t  @param page_num Number of the page to be decoded\n\t  @param sync When set to #TRUE# the function will not return\n\t  \t      until the page is completely decoded. Otherwise,\n\t\t      in a multi-threaded program, this function will\n\t\t      start decoding in a new thread and will return\n\t\t      a partially decoded image. Refer to\n\t\t      \\Ref{DjVuImage::wait_for_complete_decode}() and\n\t\t      \\Ref{DjVuFile::is_decode_ok}().\n\t  @param port A pointer to \\Ref{DjVuPort}, that the created image\n\t  \t      will be connected to. */\n   GP<DjVuImage> get_page(int page_num, bool sync=true, DjVuPort * port=0) const;\n   GP<DjVuImage> get_page(int page_num, bool sync=true, DjVuPort * port=0)\n   { return const_cast<const DjVuDocument *>(this)->get_page(page_num,sync,port); }\n\n      /** Returns \\Ref{GP} pointer to \\Ref{DjVuImage} corresponding to the\n\t  specified ID. This function behaves exactly as the #get_page()#\n\t  function above. The only thing worth mentioning here is how the #ID#\n\t  parameter is treated.\n\n\t  First of all the function checks, if the ID contains a number.\n\t  If so, it just calls the #get_page()# function above. If ID is\n\t  #ZERO# or just empty, page number #-1# is assumed. Otherwise\n\t  the ID is translated to the URL using \\Ref{id_to_url}(). */\n   GP<DjVuImage> get_page(const GUTF8String &id, bool sync=true, DjVuPort * port=0);\n   \n      /** Returns \\Ref{DjVuFile} corresponding to the specified page.\n\t  Normally it translates the page number to the URL using\n\t  \\Ref{page_to_url}() and then creates \\Ref{DjVuFile} initializing\n\t  it with data from the URL.\n\n\t  The behavior becomes different, though in the case when the\n\t  document structure is unknown at the moment this function is called.\n\t  In this situations it invents a temporary URL, creates a\n\t  \\Ref{DjVuFile}, initializes it with this URL and returns\n\t  immediately. The caller may start decoding the file right away\n\t  (if necessary). The decoding will block but will automatically\n\t  continue as soon as enough information is collected about the\n\t  document. This trick should be quite transparent to the user and\n\t  helps to prevent the main thread from blocking. The decoding will\n\t  unblock and this function will stop using this \"trick\" as soon\n\t  as #DjVuDocument# passes some given stages of initialization and\n\t  \\Ref{page_to_url}(), \\Ref{id_to_url}() functions start working\n\t  properly.\n\n\t  If #dont_create# is #FALSE# the function will return the file\n\t  only if it already exists.\n\n\t  {\\bf Note:} To wait for the initialization to complete use\n\t  \\Ref{wait_for_complete_init}(). For single threaded applications\n\t  the initialization completes before the \\Ref{init}() function\n\t  returns. */\n   GP<DjVuFile>\tget_djvu_file(int page_num, bool dont_create=false) const;\n   GP<DjVuFile> get_djvu_file(int page_num, bool dont_create=false)\n   { return const_cast<const DjVuDocument *>(this)->get_djvu_file(page_num,dont_create); }\n\n\n      /** Returns \\Ref{DjVuFile} corresponding to the specified ID.\n          This function behaves exactly as the #get_djvu_file()# function\n\t  above. The only thing worth mentioning here is how the #ID#\n\t  parameter is treated.\n\n          First off, \\Ref{id_to_url}() is called.  If not successfull,\n\t  the function checks, if the ID contains a number.\n\t  If so, it just calls the #get_djvu_file()# function above. If ID is\n\t  #ZERO# or just empty, page number #-1# is assumed.\n\n\t  If #dont_create# is #FALSE# the function will return the file\n\t  only if it already exists. */\n   GP<DjVuFile>\tget_djvu_file(const GUTF8String &id, bool dont_create=false);\n   GP<DjVuFile>\tget_djvu_file(const GURL &url, bool dont_create=false);\n      /** Returns a \\Ref{DataPool} containing one chunk #TH44# with\n\t  the encoded thumbnail for the specified page. The function\n\t  first looks for thumbnails enclosed into the document and if\n\t  it fails to find one, it decodes the required page and creates\n\t  the thumbnail on the fly (unless #dont_decode# is true).\n\n\t  {\\bf Note:} It may happen that the returned \\Ref{DataPool} will\n\t  not contain all the data you need. In this case you will need\n\t  to install a trigger into the \\Ref{DataPool} to learn when the\n\t  data actually arrives. */\n   virtual GP<DataPool> get_thumbnail(int page_num, bool dont_decode);\n      /* Will return gamma correction, which was used when creating\n\t thumbnail images. If you need other gamma correction, you will\n\t need to correct the thumbnails again. */\n   float\tget_thumbnails_gamma(void) const;\n      //@}\n\n      /** Waits until the document initialization process finishes.\n\t  It can finish either successfully or not. Use \\Ref{is_init_ok}()\n\t  and \\Ref{is_init_failed}() to learn the result code.\n\t  \n\t  As described in \\Ref{start_init}(), for multi-threaded applications the\n\t  initialization is carried out in parallel with the main thread.\n\t  This function blocks the calling thread until the initializing\n\t  thread reads enough data, receives information about the document\n\t  format and exits.  This function returns #true# if the\n\t  initialization is successful. You can use \\Ref{get_flags}() or\n\t  \\Ref{is_init_complete}() to check more precisely the degree of\n\t  initialization. Use \\Ref{stop_init}() to interrupt initialization. */\n   bool    \t   wait_for_complete_init(void);\n\n          /** Wait until we known the number of pages and return. */\n   int wait_get_pages_num(void) const;\n   \n      /// Returns cache being used.\n   DjVuFileCache * get_cache(void) const;\n\n      /** @name Saving document to disk */\n      //@{\n      /** Returns pointer to the \\Ref{DjVmDoc} class, which can save the\n\t  document contents on the hard disk in one of the two new formats:\n\t  {\\em bundled} and {\\em indirect}. You may also want to look\n\t  at \\Ref{write}() and \\Ref{expand}() if you are interested in\n\t  how to save the document.\n\n\t  {\\bf Plugin Warning}. This function will read contents of the whole\n\t  document. Thus, if you call it from the main thread (the thread,\n\t  which transfers data from Netscape), the plugin will block. */\n   GP<DjVmDoc>\t\tget_djvm_doc(void);\n      /** Saves the document in the {\\em new bundled} format. All the data\n\t  is \"bundled\" into one file and this file is written into the\n\t  passed stream.\n\n\t  If #force_djvm# is #TRUE# then even one page documents will be\n\t  saved in the #DJVM BUNDLED# format (inside a #FORM:DJVM#);\n\n\t  {\\bf Plugin Warning}. This function will read contents of the whole\n\t  document. Thus, if you call it from the main thread (the thread,\n\t  which transfers data from Netscape), the plugin will block. */\n   virtual void write(const GP<ByteStream> &str, bool force_djvm=false);\n     /** Always save as bundled, renaming any files conflicting with the\n         the names in the supplied GMap. */\n   virtual void write(const GP<ByteStream> &str,\n     const GMap<GUTF8String,void *> &reserved);\n      /** Saves the document in the {\\em new indirect} format when every\n\t  page and component are stored in separate files. This format\n\t  is ideal for web publishing because it allows direct access to\n\t  any page and component. In addition to it, a top-level file\n\t  containing the list of all components will be created. To view\n\t  the document later in the plugin or in the viewer one should\n\t  load the top-level file.\n\n\t  {\\bf Plugin Warning}. This function will read contents of the whole\n\t  document. Thus, if you call it from the main thread (the thread,\n\t  which transfers data from Netscape), the plugin will block.\n\t  \n\t  @param codebase - Name of the directory which the document should\n\t         be expanded into.\n\t  @param idx_name - Name of the top-level file containing the document\n\t         directory (basically, list of all files composing the document).\n      */\n   void\t\t\texpand(const GURL &codebase, const GUTF8String &idx_name);\n      /** This function can be used instead of \\Ref{write}() and \\Ref{expand}().\n\t  It allows to save the document either in the new #BUNDLED# format\n\t  or in the new #INDIRECT# format depending on the value of parameter\n\t  #bundled#.\n\n\t  Depending on the document's type, the meaning of #where# is:\n\t  \\begin{itemize}\n\t     \\item For #BUNDLED# documents this is the name of the file\n\t     \\item For #INDIRECT# documents this is the name of top-level\n\t           index file. All document files will be saved into the\n\t\t   save directory where the index file will resize. */\n   virtual void\t\tsave_as(const GURL &where, bool bundled=0);\n      //@}\n      /** Returns pointer to the internal directory of the document, if it\n\t  is in one of the new formats: #BUNDLED# or #INDIRECT#.\n\t  Otherwise (if the format of the input document is obsolete),\n\t  #ZERO# is returned.\n\n\t  #ZERO# will also be returned if the initializing thread has not\n\t  learnt enough information about the document (#DOC_DIR_KNOWN# has\n\t  not been set yet). Check \\Ref{is_init_complete}() and \\Ref{init}()\n          for details. */\n   GP<DjVmDir>\t\tget_djvm_dir(void) const;\n      /** Returns pointer to the document bookmarks.\n          This applies to #BUNDLED# and #INDIRECT# documents.\n\n\t  #ZERO# will also be returned if the initializing thread has not\n\t  learnt enough information about the document (#DOC_DIR_KNOWN# has\n\t  not been set yet). Check \\Ref{is_init_complete}() and \\Ref{init}()\n          for details. */\n   GP<DjVmNav>\t\tget_djvm_nav(void) const;\n      /** Returns pointer to the internal directory of the document, if it\n\t  is in obsolete #OLD_BUNDLED# format.\n\n\t  #ZERO# will also be returned if the initializing thread has not\n\t  learnt enough information about the document (#DOC_DIR_KNOWN# has\n\t  not been set yet). Check \\Ref{is_init_complete}() and \\Ref{init}()\n          for details. */\n   GP<DjVmDir0>\t\tget_djvm_dir0(void) const;\n      /** Returns pointer to {\\em navigation directory} of the document.\n\t  The navigation directory is a DjVu file containing only one\n\t  chunk #NDIR# inside a #FORM:DJVI# with the list of all\n\t  document pages. */\n   GP<DjVuNavDir>\tget_nav_dir(void) const;\n\n   /// Create a complete DjVuXML file.\n   void writeDjVuXML(const GP<ByteStream> &gstr_out,\n                     int flags, int page = -1) const;\n\n      /// Returns TRUE if #class_name# is #\"DjVuDocument\"# or #\"DjVuPort\"#\n   virtual bool\t\tinherits(const GUTF8String &class_name) const;\n\n      /// Converts the specified id to a URL.\n   virtual GURL\t\tid_to_url(const DjVuPort * source, const GUTF8String &id);\n   virtual GP<DjVuFile>\tid_to_file(const DjVuPort * source, const GUTF8String &id);\n   virtual GP<DataPool>\trequest_data(const DjVuPort * source, const GURL & url);\n   virtual void\t\tnotify_file_flags_changed(const DjVuFile * source,\n \t\t\tlong set_mask, long clr_mask);\n\n   virtual GList<GURL>\tget_url_names(void);\n   virtual void \tset_recover_errors(ErrorRecoveryAction=ABORT);\n   virtual void \tset_verbose_eof(bool=true);\n\n   static void set_compress_codec(\n     void (*codec)(GP<ByteStream> &, const GURL &where, bool bundled));\n\n   static void set_import_codec(\n     void (*codec)(GP<DataPool> &,const GURL &url,bool &, bool &));\n\nprotected:\n   static void (*djvu_import_codec) (\n     GP<DataPool> &pool, const GURL &url,bool &needs_compression, bool &needs_rename );\n   static void (*djvu_compress_codec) (\n     GP<ByteStream> &bs, const GURL &where, bool bundled);\n   virtual GP<DjVuFile>\turl_to_file(const GURL & url, bool dont_create=false) const;\n   GURL\t\t\tinit_url;\n   GP<DataPool>\t\tinit_data_pool;\n   GP<DjVmDir>\t\tdjvm_dir;\t// New-style DjVm directory\n   GP<DjVmNav>          djvm_nav;\n   int\tdoc_type;\n   bool needs_compression_flag;\n   bool can_compress_flag;\n   bool needs_rename_flag;\n\n   \n\n   bool\t\t\thas_url_names;\n   GCriticalSection\turl_names_lock;\n   GList<GURL>\turl_names;\n   ErrorRecoveryAction\trecover_errors;\n   bool\t\t\tverbose_eof;\npublic:\n   class UnnamedFile; // This really should be protected ...\n   class ThumbReq; // This really should be protected ...\nprotected:\n   bool                 init_started;\n   GSafeFlags\t\tflags;\n   GSafeFlags\t\tinit_thread_flags;\n   DjVuFileCache\t* cache;\n   GP<DjVuSimplePort>\tsimple_port;\n\n   GP<DjVmDir0>\t\tdjvm_dir0;\t// Old-style DjVm directory\n   GP<DjVuNavDir>\tndir;\t\t// Old-style navigation directory\n   GUTF8String\t\tfirst_page_name;// For OLD_BUNDLED docs only\n\n      // The following is used in init() and destructor to query NDIR\n      // DO NOT USE FOR ANYTHING ELSE. THE FILE IS ZEROED IMMEDIATELY\n      // AFTER IT'S NO LONGER NEEDED. If you don't zero it, ~DjVuDocument()\n      // will kill it, which is a BAD thing if the file's already in cache.\n   GP<DjVuFile>\t\tndir_file;\n   \n   GPList<UnnamedFile>\tufiles_list;\n   GCriticalSection\tufiles_lock;\n\n   GPList<ThumbReq>\tthreqs_list;\n   GCriticalSection\tthreqs_lock;\n\n   GP<DjVuDocument>\tinit_life_saver;\n\n   static const float\tthumb_gamma;\n\n      // Reads document contents in another thread trying to determine\n      // its type and structure\n   GThread\t\tinit_thr;\n   static void\t\tstatic_init_thread(void *);\n   void\t\t\tinit_thread(void);\n\n   void                 check() const;\n\n   void\t\t\tprocess_threqs(void);\n   GP<ThumbReq>\t\tadd_thumb_req(const GP<ThumbReq> & thumb_req);\n      \n   void\t\t\tadd_to_cache(const GP<DjVuFile> & f);\n   void\t\t\tcheck_unnamed_files(void);\n   GUTF8String\t\tget_int_prefix(void) const;\n   void\t\t\tset_file_aliases(const DjVuFile * file);\n   GURL\t\t\tinvent_url(const GUTF8String &name) const;\n};\n\nclass DjVuDocument::UnnamedFile : public GPEnabled\n{\npublic:\n   enum { ID, PAGE_NUM };\n   int\t\tid_type;\n   GUTF8String\t\tid;\n   int\t\tpage_num;\n   GURL\t\turl;\n   GP<DjVuFile>\tfile;\n   GP<DataPool>\tdata_pool;\nprotected:\n   UnnamedFile(int xid_type, const GUTF8String &xid, int xpage_num, const GURL & xurl,\n\t\t  const GP<DjVuFile> & xfile) :\n      id_type(xid_type), id(xid), page_num(xpage_num), url(xurl), file(xfile) {}\n   friend class DjVuDocument;\n};\n\nclass DjVuDocument::ThumbReq : public GPEnabled\n{\npublic:\n   int\t\tpage_num;\n   GP<DataPool>\tdata_pool;\n\n\t // Either of the next two blocks should present\n   GP<DjVuFile>\timage_file;\n\n   int\t\tthumb_chunk;\n   GP<DjVuFile>\tthumb_file;\nprotected:\n   ThumbReq(int xpage_num, const GP<DataPool> & xdata_pool) :\n      page_num(xpage_num), data_pool(xdata_pool) {}\n   friend class DjVuDocument;\n};\n\ninline void\nDjVuDocument::init(const GURL &url, GP<DjVuPort> port, DjVuFileCache *cache)\n{\n  start_init(url,port,cache);\n  wait_for_complete_init();\n}\n\ninline GP<DjVuDocument>\nDjVuDocument::create(\n  const GURL &url, GP<DjVuPort> xport, DjVuFileCache * const xcache)\n{\n  DjVuDocument *doc=new DjVuDocument;\n  GP<DjVuDocument> retval=doc;\n  doc->start_init(url,xport,xcache);\n  return retval;\n}\n\ninline bool\nDjVuDocument::is_init_complete(void) const\n{\n   return (flags & (DOC_INIT_OK | DOC_INIT_FAILED))!=0;\n}\n\ninline bool\nDjVuDocument::is_init_ok(void) const\n{\n   return (flags & DOC_INIT_OK)!=0;\n}\n\ninline void\nDjVuDocument::set_needs_compression(void)\n{\n   needs_compression_flag=true;\n}\n\ninline bool\nDjVuDocument::needs_compression(void) const\n{\n   return needs_compression_flag;\n}\n\ninline bool\nDjVuDocument::needs_rename(void) const\n{\n   return needs_rename_flag;\n}\n\ninline bool\nDjVuDocument::can_compress(void) const\n{\n   return can_compress_flag;\n}\n\ninline bool\nDjVuDocument::is_init_failed(void) const\n{\n   return (flags & DOC_INIT_FAILED)!=0;\n}\n\ninline int\nDjVuDocument::get_doc_type(void) const { return doc_type; }\n\ninline long\nDjVuDocument::get_doc_flags(void) const { return flags; }\n\ninline bool\nDjVuDocument::is_bundled(void) const\n{\n   return doc_type==BUNDLED || doc_type==OLD_BUNDLED;\n}\n\ninline GURL\nDjVuDocument::get_init_url(void) const { return init_url; }\n\ninline GP<DataPool>\nDjVuDocument::get_init_data_pool(void) const { return init_data_pool; }\n\ninline bool\nDjVuDocument::inherits(const GUTF8String &class_name) const\n{\n   return\n      (GUTF8String(\"DjVuDocument\") == class_name) ||\n      DjVuPort::inherits(class_name);\n//      !strcmp(\"DjVuDocument\", class_name) ||\n//      DjVuPort::inherits(class_name);\n}\n\ninline float\nDjVuDocument::get_thumbnails_gamma(void) const\n{\n   return thumb_gamma;\n}\n\ninline DjVuFileCache *\nDjVuDocument::get_cache(void) const\n{\n   return cache;\n}\n\ninline GP<DjVmDir>\nDjVuDocument::get_djvm_dir(void) const\n{\n   if (doc_type==SINGLE_PAGE)\n      G_THROW( ERR_MSG(\"DjVuDocument.no_dir\") );\n   if (doc_type!=BUNDLED && doc_type!=INDIRECT)\n      G_THROW( ERR_MSG(\"DjVuDocument.obsolete\") );\n   return djvm_dir;\n}\n\ninline GP<DjVmNav>\nDjVuDocument::get_djvm_nav(void) const\n{\n  if (doc_type==BUNDLED || doc_type==INDIRECT)\n    return djvm_nav;\n  return 0;\n}\n\ninline GP<DjVmDir0>\nDjVuDocument::get_djvm_dir0(void) const\n{\n   if (doc_type!=OLD_BUNDLED)\n      G_THROW( ERR_MSG(\"DjVuDocument.old_bundle\") );\n   return djvm_dir0;\n}\n\ninline GP<DjVuNavDir>\nDjVuDocument::get_nav_dir(void) const\n{\n   return ndir;\n}\n\ninline void\nDjVuDocument::set_recover_errors(ErrorRecoveryAction recover)\n{\n  recover_errors=recover;\n}\n\ninline void\nDjVuDocument::set_verbose_eof(bool verbose)\n{\n  verbose_eof=verbose;\n}\n\n//@}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVuDumpHelper.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"DjVuDumpHelper.h\"\n#include \"DataPool.h\"\n#include \"DjVmDir.h\"\n#include \"DjVuInfo.h\"\n#include \"IFFByteStream.h\"\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n#ifdef putchar\n#undef putchar\n#endif\n\nstruct DjVmInfo\n{\n  GP<DjVmDir> dir;\n  GPMap<int,DjVmDir::File> map;\n};\n\ninline static void\nputchar(ByteStream & str, char ch)\n{\n   str.write(&ch, 1);\n}\n\n// ---------- ROUTINES FOR SUMMARIZING CHUNK DATA\n\nstatic void\ndisplay_djvu_info(ByteStream & out_str, IFFByteStream &iff,\n\t\t  GUTF8String, size_t size, DjVmInfo&, int)\n{\n  GP<DjVuInfo> ginfo=DjVuInfo::create();\n  DjVuInfo &info=*ginfo;\n  info.decode(*iff.get_bytestream());\n  if (size >= 4)\n    out_str.format( \"DjVu %dx%d\", info.width, info.height);\n  if (size >= 5)\n    out_str.format( \", v%d\", info.version);\n  if (size >= 8)\n    out_str.format( \", %d dpi\", info.dpi);\n  if (size >= 8)\n    out_str.format( \", gamma=%3.1f\", info.gamma);\n}\n\nstatic void\ndisplay_djbz(ByteStream & out_str, IFFByteStream &iff,\n\t     GUTF8String, size_t, DjVmInfo&, int)\n{\n  out_str.format( \"JB2 shared dictionary\");\n}\n\nstatic void\ndisplay_fgbz(ByteStream & out_str, IFFByteStream &iff,\n\t     GUTF8String, size_t, DjVmInfo&, int)\n{\n  GP<ByteStream> gbs = iff.get_bytestream();\n  int version = gbs->read8();\n  int size = gbs->read16();\n  out_str.format( \"JB2 colors data, v%d, %d colors\", \n                  version & 0x7f, size);\n}\n\nstatic void\ndisplay_sjbz(ByteStream & out_str, IFFByteStream &iff,\n\t     GUTF8String, size_t, DjVmInfo&, int)\n{\n  out_str.format( \"JB2 bilevel data\");\n}\n\nstatic void\ndisplay_smmr(ByteStream & out_str, IFFByteStream &iff,\n\t     GUTF8String, size_t, DjVmInfo&, int)\n{\n  out_str.format( \"G4/MMR stencil data\");\n}\n\nstatic void\ndisplay_iw4(ByteStream & out_str, IFFByteStream &iff,\n\t    GUTF8String, size_t, DjVmInfo&, int)\n{\n  GP<ByteStream> gbs = iff.get_bytestream();\n  unsigned char serial = gbs->read8();\n  unsigned char slices = gbs->read8();\n  out_str.format( \"IW4 data #%d, %d slices\", serial+1, slices);\n  if (serial == 0)\n    {\n      unsigned char major = gbs->read8();\n      unsigned char minor = gbs->read8();\n      unsigned char xhi = gbs->read8();\n      unsigned char xlo = gbs->read8();\n      unsigned char yhi = gbs->read8();\n      unsigned char ylo = gbs->read8();\n      out_str.format( \", v%d.%d (%s), %dx%d\", major & 0x7f, minor,\n                      (major & 0x80 ? \"b&w\" : \"color\"), \n                      (xhi<<8)+xlo, (yhi<<8)+ylo );\n    }\n}\n\nstatic void\ndisplay_djvm_dirm(ByteStream & out_str, IFFByteStream & iff,\n\t\t  GUTF8String head, size_t, DjVmInfo& djvminfo, int)\n{\n  GP<DjVmDir> dir = DjVmDir::create();\n  dir->decode(iff.get_bytestream());\n  GPList<DjVmDir::File> list = dir->get_files_list();\n  if (dir->is_indirect())\n  {\n    out_str.format( \"Document directory (indirect, %d files %d pages)\", \n\t                  dir->get_files_num(), dir->get_pages_num());\n    for (GPosition p=list; p; ++p)\n      out_str.format( \"\\n%s%s -> %s\", (const char*)head, \n                      (const char*)list[p]->get_load_name(), (const char*)list[p]->get_save_name() );\n  }\n  else\n  {\n    out_str.format( \"Document directory (bundled, %d files %d pages)\", \n\t                  dir->get_files_num(), dir->get_pages_num());\n    djvminfo.dir = dir;\n    djvminfo.map.empty();\n    for (GPosition p=list; p; ++p)\n      djvminfo.map[list[p]->offset] = list[p];\n  }\n}\n\nstatic void\ndisplay_th44(ByteStream & out_str, IFFByteStream & iff,\n\t     GUTF8String, size_t, DjVmInfo & djvminfo, int counter)\n{\n   int start_page=-1;\n   if (djvminfo.dir)\n   {\n      GPList<DjVmDir::File> files_list=djvminfo.dir->get_files_list();\n      for(GPosition pos=files_list;pos;++pos)\n      {\n\t GP<DjVmDir::File> frec=files_list[pos];\n\t if (iff.tell()>=frec->offset &&\n\t     iff.tell()<frec->offset+frec->size)\n\t {\n\t    while(pos && !files_list[pos]->is_page())\n\t       ++pos;\n\t    if (pos)\n\t       start_page=files_list[pos]->get_page_num();\n\t    break;\n\t }\n      }\n   }\n   if (start_page>=0)\n      out_str.format( \"Thumbnail icon for page %d\", start_page+counter+1);\n   else\n      out_str.format( \"Thumbnail icon\");\n}\n\nstatic void\ndisplay_incl(ByteStream & out_str, IFFByteStream & iff,\n\t     GUTF8String, size_t, DjVmInfo&, int)\n{\n   GUTF8String name;\n   char ch;\n   while(iff.read(&ch, 1) && ch!='\\n')\n     name += ch;\n   out_str.format( \"Indirection chunk --> {%s}\", (const char *) name);\n}\n\nstatic void\ndisplay_anno(ByteStream & out_str, IFFByteStream &iff,\n\t     GUTF8String, size_t, DjVmInfo&, int)\n{\n   out_str.format( \"Page annotation\");\n   GUTF8String id;\n   iff.short_id(id);\n   out_str.format( \" (hyperlinks, etc.)\");\n}\n\nstatic void\ndisplay_text(ByteStream & out_str, IFFByteStream &iff,\n\t     GUTF8String, size_t, DjVmInfo&, int)\n{\n   out_str.format( \"Hidden text\");\n   GUTF8String id;\n   iff.short_id(id);\n   out_str.format( \" (text, etc.)\");\n}\n\nstruct displaysubr\n{\n  const char *id;\n  void (*subr)(ByteStream &, IFFByteStream &, GUTF8String,\n\t       size_t, DjVmInfo&, int counter);\n};\n \nstatic displaysubr disproutines[] = \n{\n  { \"DJVU.INFO\", display_djvu_info },\n  { \"DJVU.Smmr\", display_smmr },\n  { \"DJVU.Sjbz\", display_sjbz },\n  { \"DJVU.Djbz\", display_djbz },\n  { \"DJVU.FG44\", display_iw4 },\n  { \"DJVU.BG44\", display_iw4 },\n  { \"DJVU.FGbz\", display_fgbz },\n  { \"DJVI.Sjbz\", display_sjbz },\n  { \"DJVI.Djbz\", display_djbz },\n  { \"DJVI.FGbz\", display_fgbz },\n  { \"DJVI.FG44\", display_iw4 },\n  { \"DJVI.BG44\", display_iw4 },\n  { \"BM44.BM44\", display_iw4 },\n  { \"PM44.PM44\", display_iw4 },\n  { \"DJVM.DIRM\", display_djvm_dirm },\n  { \"THUM.TH44\", display_th44 },\n  { \"INCL\", display_incl },\n  { \"ANTa\", display_anno },\n  { \"ANTz\", display_anno },\n  { \"TXTa\", display_text },\n  { \"TXTz\", display_text },\n  { 0, 0 },\n};\n\n// ---------- ROUTINES FOR DISPLAYING CHUNK STRUCTURE\n\nstatic void\ndisplay_chunks(ByteStream & out_str, IFFByteStream &iff,\n\t       const GUTF8String &head, DjVmInfo djvminfo)\n{\n  size_t size;\n  GUTF8String id, fullid;\n  GUTF8String head2 = head + \"  \";\n  GPMap<int,DjVmDir::File> djvmmap;\n  int rawoffset;\n  GMap<GUTF8String, int> counters;\n  \n  while ((size = iff.get_chunk(id, &rawoffset)))\n  {\n    if (!counters.contains(id)) counters[id]=0;\n    else counters[id]++;\n    \n    GUTF8String msg;\n    msg.format(\"%s%s [%d] \", (const char *)head, (const char *)id, size);\n    out_str.format( \"%s\", (const char *)msg);\n    // Display DJVM is when adequate\n    if (djvminfo.dir)\n    {\n      GP<DjVmDir::File> rec = djvminfo.map[rawoffset];\n      if (rec)\n        {\n          GUTF8String id = rec->get_load_name();\n          GUTF8String title = rec->get_title();\n          out_str.format( \"{%s}\", (const char*) id);\n          if (rec->is_include())\n            out_str.format(\" [I]\");\n          if (rec->is_thumbnails())\n            out_str.format(\" [T]\");\n          if (rec->is_shared_anno())\n            out_str.format(\" [S]\");\n          if (rec->is_page())\n            out_str.format(\" [P%d]\", rec->get_page_num()+1);\n          if (id != title)\n            out_str.format(\" (%s)\", (const char*)title);\n        }\n    }\n    // Test chunk type\n    iff.full_id(fullid);\n    for (int i=0; disproutines[i].id; i++)\n      if (fullid == disproutines[i].id || id == disproutines[i].id)\n      {\n        int n = msg.length();\n        while (n++ < 14+(int) head.length()) putchar(out_str, ' ');\n        if (!iff.composite()) out_str.format( \"    \");\n        (*disproutines[i].subr)(out_str, iff, head2,\n                                size, djvminfo, counters[id]);\n        break;\n      }\n      // Default display of composite chunk\n      out_str.format( \"\\n\");\n      if (iff.composite())\n        display_chunks(out_str, iff, head2, djvminfo);\n      // Terminate\n      iff.close_chunk();\n  }\n}\n\nGP<ByteStream>\nDjVuDumpHelper::dump(const GP<DataPool> & pool)\n{\n   return dump(pool->get_stream());\n}\n\nGP<ByteStream>\nDjVuDumpHelper::dump(GP<ByteStream> gstr)\n{\n   GP<ByteStream> out_str=ByteStream::create();\n   GUTF8String head=\"  \";\n   GP<IFFByteStream> iff=IFFByteStream::create(gstr);\n   DjVmInfo djvminfo;\n   display_chunks(*out_str, *iff, head, djvminfo);\n   return out_str;\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVuDumpHelper.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _DJVUDUMPHELPER_H\n#define _DJVUDUMPHELPER_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n/** @name DjVuDupmHelper.h\n    This file contains code capable of generating information on\n    DjVu documents without actually decoding them. The code has\n    been extracted from a command line utility \\Ref{djvudump.cpp}\n    for use in the DjVu plugin.\n    @memo\n    DjVu Dump Helper.\n    @author\n    L\\'eon Bottou <leonb@research.att.com> -- as a separate program.\\\\\n    Andrei Erofeev <eaf@geocities.com> -- as a class.\n*/\n//@{\n\n\n\n#include \"GSmartPointer.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass DataPool;\nclass ByteStream;\n\n/** DjVuDumpHelper.\n    This class can dump information on any DjVu file without decoding it.\n    Based upon old \\Ref{djvudump.cpp} code.\n */\n\nclass DJVUAPI DjVuDumpHelper\n{\npublic:\n      /// Default constructor\n   DjVuDumpHelper(void) {}\n      /// Destructor\n   ~DjVuDumpHelper(void) {}\n      /** Interprets the file passed in the \\Ref{DataPool}, and returns\n\t  the results in \\Ref{ByteStream}. */\n   GP<ByteStream>\tdump(const GP<DataPool> & pool);\n      /** Interprets the file passed in the \\Ref{ByteStream}, and returns\n\t  the results in \\Ref{ByteStream}. */\n   GP<ByteStream>\tdump(GP<ByteStream> str);\n};\n\n\n//@}\n\n// ----- THE END\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVuErrorList.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"DjVuErrorList.h\"\n#include \"DjVmDoc.h\"\n#include \"GException.h\"\n#include \"GContainer.h\"\n#include \"GOS.h\"\n#include \"DataPool.h\"\n#include <string.h>\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\nDjVuErrorList::DjVuErrorList() {}\n\nGURL\nDjVuErrorList::set_stream(GP<ByteStream> xibs)\n{\n  GUTF8String name;\n  static unsigned long serial=0;\n  pool=DataPool::create(xibs);\n  name.format(\"data://%08lx/%08lx.djvu\",\n    ++serial,(unsigned long)(size_t)((const ByteStream *)xibs));\n  pool_url=GURL::UTF8(name);\n  return pool_url;\n}\n\nbool\nDjVuErrorList::notify_error(const DjVuPort * source, const GUTF8String & msg)\n{\n  Errors.append(msg);\n  return 1;\n}\n\nbool\nDjVuErrorList::notify_status(const DjVuPort * source, const GUTF8String &msg)\n{\n  Status.append(msg);\n  return 1;\n}  \n\nGUTF8String\nDjVuErrorList::GetError(void)\n{\n  GUTF8String PrevError;\n  GPosition pos;\n  if((pos=Errors))\n  {\n    PrevError=Errors[pos];\n    Errors.del(pos);\n  }\n  return PrevError;\n}\n\nGUTF8String\nDjVuErrorList::GetStatus(void)\n{\n  GUTF8String PrevStatus;\n  GPosition pos;\n  if((pos=Status))\n  {\n    PrevStatus=Status[pos];\n    Status.del(pos);\n  }\n  return PrevStatus;\n}\n\nGP<DataPool>\nDjVuErrorList::request_data(const DjVuPort * source, const GURL & url)\n{\n   GP<DataPool> retval;\n   G_TRY\n   {\n     if (pool && url.protocol().downcase() == \"data\")\n     {\n       if(url == pool_url)\n       {\n         retval=pool;\n       }else if(url.base() == pool_url)\n       {\n         GUTF8String name=url.fname();\n         GP<DjVmDoc> doc=DjVmDoc::create();\n         GP<ByteStream> bs=pool->get_stream();\n         doc->read(*bs);\n         retval=doc->get_data(name);\n       }\n     }else if (url.is_local_file_url())\n     {\n//       GUTF8String fname=GOS::url_to_filename(url);\n//       if (GOS::basename(fname)==\"-\") fname=\"-\";\n       retval=DataPool::create(url);\n     }\n   }\n   G_CATCH_ALL\n   {\n     retval=0;\n   } G_ENDCATCH;\n   return retval;\n}\n \n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVuErrorList.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _DJVUERRORLIST_H\n#define _DJVUERRORLIST_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n#include \"DjVuPort.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass ByteStream;\n\n/** @name DjVuErrorList.h\n    This file implements a very simple class for redirecting port caster\n    messages that would normally end up on stderr to a double linked list.\n\n    @memo DjVuErrorList class.\n    @author Bill C Riemers <docbill@sourceforge.net>\n*/\n\n//@{\n\n/** #DjVuErrorList# provides a convenient way to redirect error messages\n    from classes derived from DjVuPort to a list that can be accessed at\n    any time. */\n\nclass DjVuErrorList : public DjVuSimplePort\n{\nprotected:\n     /// The normal port caster constructor. \n  DjVuErrorList(void);\npublic:\n  static GP<DjVuErrorList> create(void) {return new DjVuErrorList();}\n\n     /// This constructor allows the user to specify the ByteStream.\n  GURL set_stream(GP<ByteStream>);\n\n     /// Append all error messages to the list\n  virtual bool notify_error(const DjVuPort * source, const GUTF8String & msg);\n\n     /// Append all status messages to the list\n  virtual bool notify_status(const DjVuPort * source, const GUTF8String & msg);\n\n     /// Add a new class to have its messages redirected here.\n  inline void connect( const DjVuPort &port);\n\n     /// Get the listing of errors, and clear the list.\n  inline GList<GUTF8String> GetErrorList(void);\n\n     /// Just clear the list.\n  inline void ClearError(void);\n\n     /// Get one error message and clear that message from the list.\n  GUTF8String GetError(void);\n\n     /// Check if there are anymore error messages.\n  inline bool HasError(void) const;\n\n     /// Get the listing of status messages, and clear the list.\n  inline GList<GUTF8String> GetStatusList(void);\n\n     /// Just clear the list.\n  inline void ClearStatus(void);\n\n     /// Get one status message and clear that message from the list.\n  GUTF8String GetStatus(void);\n\n     /// Check if there are any more status messages.\n  inline bool HasStatus(void) const;\n\n     /** This gets the data.  We can't use the simple port's request\n       data since we want to allow the user to specify the ByteStream. */\n  virtual GP<DataPool> request_data (\n    const DjVuPort * source, const GURL & url );\n\nprivate:\n  GURL pool_url;\n  GP<DataPool> pool;\n  GList<GUTF8String> Errors;\n  GList<GUTF8String> Status;\nprivate: //dummy stuff\n  static GURL set_stream(ByteStream *);\n};\n\ninline void\nDjVuErrorList::connect( const DjVuPort &port )\n{ get_portcaster()->add_route(&port, this); }\n\ninline GList<GUTF8String>\nDjVuErrorList::GetErrorList(void)\n{\n  GList<GUTF8String> retval=(const GList<GUTF8String>)Errors;\n  Errors.empty();\n  return retval;\n}\n\ninline void\nDjVuErrorList::ClearError(void)\n{ Errors.empty(); }\n\ninline GList<GUTF8String>\nDjVuErrorList::GetStatusList(void)\n{\n  GList<GUTF8String> retval=(const GList<GUTF8String>)Status;\n  Status.empty();\n  return retval;\n}\n\ninline void\nDjVuErrorList::ClearStatus(void)\n{ Status.empty(); }\n\ninline bool\nDjVuErrorList::HasError(void) const\n{ return !Errors.isempty(); }\n\ninline bool\nDjVuErrorList::HasStatus(void) const\n{ return !Status.isempty(); }\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVuFile.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"DjVuFile.h\"\n#include \"IFFByteStream.h\"\n#include \"GOS.h\"\n#include \"MMRDecoder.h\"\n#ifdef NEED_JPEG_DECODER\n#include \"JPEGDecoder.h\"\n#endif\n#include \"DjVuAnno.h\"\n#include \"DjVuText.h\"\n#include \"DataPool.h\"\n#include \"JB2Image.h\"\n#include \"IW44Image.h\"\n#include \"DjVuNavDir.h\"\n#ifndef NEED_DECODER_ONLY\n#include \"BSByteStream.h\"\n#endif // NEED_DECODER_ONLY\n\n#include \"debug.h\"\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n#define STRINGIFY(x) STRINGIFY_(x)\n#define STRINGIFY_(x) #x\n\n\n#define REPORT_EOF(x) \\\n  {G_TRY{G_THROW( ByteStream::EndOfFile );}G_CATCH(ex){report_error(ex,(x));}G_ENDCATCH;}\n\nstatic GP<GPixmap> (*djvu_decode_codec)(ByteStream &bs)=0;\n\nclass ProgressByteStream : public ByteStream\n{\npublic:\n  ProgressByteStream(const GP<ByteStream> & xstr) : str(xstr),\n    last_call_pos(0) {}\n  virtual ~ProgressByteStream() {}\n\n  virtual size_t read(void *buffer, size_t size)\n  {\n    int rc=0;\n\t   // G_TRY {} CATCH; block here is merely to avoid egcs internal error\n    G_TRY {\n      int cur_pos=str->tell();\n      if (progress_cb && (last_call_pos/256!=cur_pos/256))\n      {\n        progress_cb(cur_pos, progress_cl_data);\n        last_call_pos=cur_pos;\n      }\n      rc=str->read(buffer, size);\n    } G_CATCH_ALL {\n      G_RETHROW;\n    } G_ENDCATCH;\n    return rc;\n  }\n  virtual size_t write(const void *buffer, size_t size)\n  {\n    return str->write(buffer, size);\n  }\n  virtual int seek(long offset, int whence = SEEK_SET, bool nothrow=false)\n  {\n    return str->seek(offset, whence);\n  }\n  virtual long tell(void ) const { return str->tell(); }\n\n  void\t\tset_progress_cb(void (* xprogress_cb)(int, void *),\n  void * xprogress_cl_data)\n  {\n    progress_cb=xprogress_cb;\n    progress_cl_data=xprogress_cl_data;\n  }\nprivate:\n  GP<ByteStream> str;\n  void\t\t* progress_cl_data;\n  void\t\t(* progress_cb)(int pos, void *);\n  int\t\tlast_call_pos;\n  \n  // Cancel C++ default stuff\n  ProgressByteStream & operator=(const ProgressByteStream &);\n};\n\n\nDjVuFile::DjVuFile()\n: file_size(0), recover_errors(ABORT), verbose_eof(false), chunks_number(-1),\ninitialized(false)\n{\n}\n\nvoid\nDjVuFile::check() const\n{\n  if (!initialized)\n    G_THROW( ERR_MSG(\"DjVuFile.not_init\") );\n}\n\nGP<DjVuFile>\nDjVuFile::create(\n  const GP<ByteStream> & str, const ErrorRecoveryAction recover_errors,\n  const bool verbose_eof )\n{\n  DjVuFile *file=new DjVuFile();\n  GP<DjVuFile> retval=file;\n  file->set_recover_errors(recover_errors);\n  file->set_verbose_eof(verbose_eof);\n  file->init(str);\n  return retval;\n}\n\nvoid \nDjVuFile::init(const GP<ByteStream> & str)\n{\n  DEBUG_MSG(\"DjVuFile::DjVuFile(): ByteStream constructor\\n\");\n  DEBUG_MAKE_INDENT(3);\n  \n  if (initialized)\n    G_THROW( ERR_MSG(\"DjVuFile.2nd_init\") );\n  if (!get_count())\n    G_THROW( ERR_MSG(\"DjVuFile.not_secured\") );\n  \n  file_size=0;\n  decode_thread=0;\n  \n  // Read the data from the stream\n  data_pool=DataPool::create(str);\n  \n  // Construct some dummy URL\n  GUTF8String buffer;\n  buffer.format(\"djvufile:/%p.djvu\", this);\n  DEBUG_MSG(\"DjVuFile::DjVuFile(): url is \"<<(const char *)buffer<<\"\\n\");\n  url=GURL::UTF8(buffer);\n  \n  // Set it here because trigger will call other DjVuFile's functions\n  initialized=true;\n  \n  // Add (basically - call) the trigger\n  data_pool->add_trigger(-1, static_trigger_cb, this);\n}\n\nGP<DjVuFile>\nDjVuFile::create(\n  const GURL & xurl, GP<DjVuPort> port, \n  const ErrorRecoveryAction recover_errors, const bool verbose_eof ) \n{\n  DjVuFile *file=new DjVuFile();\n  GP<DjVuFile> retval=file;\n  file->set_recover_errors(recover_errors);\n  file->set_verbose_eof(verbose_eof);\n  file->init(xurl,port);\n  return retval;\n}\n\nvoid\nDjVuFile::init(const GURL & xurl, GP<DjVuPort> port) \n{\n  DEBUG_MSG(\"DjVuFile::init(): url='\" << xurl << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n  \n  if (initialized)\n    G_THROW( ERR_MSG(\"DjVuFile.2nd_init\") );\n  if (!get_count())\n    G_THROW( ERR_MSG(\"DjVuFile.not_secured\") );\n  if (xurl.is_empty())\n    G_THROW( ERR_MSG(\"DjVuFile.empty_URL\") );\n  \n  url = xurl;\n  DEBUG_MSG(\"DjVuFile::DjVuFile(): url is \"<<(const char *)url<<\"\\n\");\n  file_size=0;\n  decode_thread=0;\n  \n  DjVuPortcaster * pcaster=get_portcaster();\n  \n  // We need it 'cause we're waiting for our own termination in stop_decode()\n  pcaster->add_route(this, this);\n  if (!port)\n    port = simple_port = new DjVuSimplePort();\n  pcaster->add_route(this, port);\n  \n  // Set it here because trigger will call other DjVuFile's functions\n  initialized=true;\n  \n  if (!(data_pool=DataPool::create(pcaster->request_data(this, url))))\n    G_THROW( ERR_MSG(\"DjVuFile.no_data\") \"\\t\"+url.get_string());\n  data_pool->add_trigger(-1, static_trigger_cb, this);\n}\n\nDjVuFile::~DjVuFile(void)\n{\n  DEBUG_MSG(\"DjVuFile::~DjVuFile(): destroying...\\n\");\n  DEBUG_MAKE_INDENT(3);\n  \n  // No more messages. They may result in adding this file to a cache\n  // which will be very-very bad as we're being destroyed\n  get_portcaster()->del_port(this);\n  \n  // Unregister the trigger (we don't want it to be called and attempt\n  // to access the destroyed object)\n  if (data_pool)\n    data_pool->del_trigger(static_trigger_cb, this);\n  \n  // We don't have to wait for decoding to finish here. It's already\n  // finished (we know it because there is a \"life saver\" in the\n  // thread function)  -- but we need to delete it\n  delete decode_thread; decode_thread=0;\n}\n\nvoid\nDjVuFile::reset(void)\n{\n   flags.enter();\n   info = 0; \n   anno = 0; \n   text = 0; \n   meta = 0; \n   bg44 = 0; \n   fgbc = 0;\n   fgjb = 0; \n   fgjd = 0;\n   fgpm = 0;\n   dir  = 0; \n   description = \"\"; \n   mimetype = \"\";\n   flags=(flags&(ALL_DATA_PRESENT|DECODE_STOPPED|DECODE_FAILED));\n   flags.leave();\n}\n\nunsigned int\nDjVuFile::get_memory_usage(void) const\n{\n   unsigned int size=sizeof(*this);\n   if (info) size+=info->get_memory_usage();\n   if (bg44) size+=bg44->get_memory_usage();\n   if (fgjb) size+=fgjb->get_memory_usage();\n   if (fgpm) size+=fgpm->get_memory_usage();\n   if (fgbc) size+=fgbc->size()*sizeof(int);\n   if (anno) size+=anno->size();\n   if (meta) size+=meta->size();\n   if (dir) size+=dir->get_memory_usage();\n   return size;\n}\n\nGPList<DjVuFile>\nDjVuFile::get_included_files(bool only_created)\n{\n  check();\n  if (!only_created && !are_incl_files_created())\n    process_incl_chunks();\n  \n  GCriticalSectionLock lock(&inc_files_lock);\n  GPList<DjVuFile> list=inc_files_list;\t// Get a copy when locked\n  return list;\n}\n\nvoid\nDjVuFile::wait_for_chunk(void)\n// Will return after a chunk has been decoded\n{\n  check();\n  DEBUG_MSG(\"DjVuFile::wait_for_chunk() called\\n\");\n  DEBUG_MAKE_INDENT(3);\n  chunk_mon.enter();\n  chunk_mon.wait();\n  chunk_mon.leave();\n}\n\nbool\nDjVuFile::wait_for_finish(bool self)\n// if self==TRUE, will block until decoding of this file is over\n// if self==FALSE, will block until decoding of a child (direct\n// or indirect) is over.\n// Will return FALSE if there is nothing to wait for. TRUE otherwise\n{\n  DEBUG_MSG(\"DjVuFile::wait_for_finish():  self=\" << self <<\"\\n\");\n  DEBUG_MAKE_INDENT(3);\n  \n  check();\n  \n  if (self)\n  {\n    // It's best to check for self termination using flags. The reason\n    // is that finish_mon is updated in a DjVuPort function, which\n    // will not be called if the object is being destroyed\n    GMonitorLock lock(&flags);\n    if (is_decoding())\n    {\n      while(is_decoding()) flags.wait();\n      DEBUG_MSG(\"got it\\n\");\n      return 1;\n    }\n  } else\n  {\n    // By locking the monitor, we guarantee that situation doesn't change\n    // between the moments when we check for pending finish events\n    // and when we actually run wait(). If we don't lock, the last child\n    // may terminate in between, and we'll wait forever.\n    //\n    // Locking is required by GMonitor interface too, btw.\n    GMonitorLock lock(&finish_mon);\n    GP<DjVuFile> file;\n    {\n      GCriticalSectionLock lock(&inc_files_lock);\n      for(GPosition pos=inc_files_list;pos;++pos)\n      {\n        GP<DjVuFile> & f=inc_files_list[pos];\n        if (f->is_decoding())\n        {\n          file=f; break;\n        }\n      }\n    }\n    if (file)\n    {\n      finish_mon.wait();\n      DEBUG_MSG(\"got it\\n\");\n      return 1;\n    }\n  }\n  DEBUG_MSG(\"nothing to wait for\\n\");\n  return 0;\n}\n\nvoid\nDjVuFile::notify_chunk_done(const DjVuPort *, const GUTF8String &)\n{\n  check();\n  chunk_mon.enter();\n  chunk_mon.broadcast();\n  chunk_mon.leave();\n}\n\nvoid\nDjVuFile::notify_file_flags_changed(const DjVuFile * src,\n                                    long set_mask, long clr_mask)\n{\n  check();\n  if (set_mask & (DECODE_OK | DECODE_FAILED | DECODE_STOPPED))\n  {\n    // Signal threads waiting for file termination\n    finish_mon.enter();\n    finish_mon.broadcast();\n    finish_mon.leave();\n    \n    // In case a thread is still waiting for a chunk\n    chunk_mon.enter();\n    chunk_mon.broadcast();\n    chunk_mon.leave();\n  }\n  \n  if ((set_mask & ALL_DATA_PRESENT) && src!=this &&\n    are_incl_files_created() && is_data_present())\n  {\n    if (src!=this && are_incl_files_created() && is_data_present())\n    {\n      // Check if all children have data\n      bool all=true;\n      {\n        GCriticalSectionLock lock(&inc_files_lock);\n        for(GPosition pos=inc_files_list;pos;++pos)\n          if (!inc_files_list[pos]->is_all_data_present())\n          {\n            all=false;\n            break;\n          }\n      }\n      if (all)\n      {\n        DEBUG_MSG(\"Just got ALL data for '\" << url << \"'\\n\");\n        flags|=ALL_DATA_PRESENT;\n        get_portcaster()->notify_file_flags_changed(this, ALL_DATA_PRESENT, 0);\n      }\n    }\n  }\n}\n\nvoid\nDjVuFile::static_decode_func(void * cl_data)\n{\n  DjVuFile * th=(DjVuFile *) cl_data;\n  \n  /* Please do not undo this life saver. If you do then try to resolve the\n  following conflict first:\n  1. Decoding starts and there is only one external reference\n  to the DjVuFile.\n  2. Decoding proceeds and calls DjVuPortcaster::notify_error(),\n  which creates inside a temporary GP<DjVuFile>.\n  3. While notify_error() is running, the only external reference\n  is lost, but the DjVuFile is still alive (remember the\n  temporary GP<>?)\n  4. The notify_error() returns, the temporary GP<> gets destroyed\n  and the DjVuFile is attempting to destroy right in the middle\n  of the decoding thread. This is either a dead block (waiting\n  for the termination of the decoding from the ~DjVuFile() called\n  from the decoding thread) or coredump. */\n  GP<DjVuFile> life_saver=th;\n  th->decode_life_saver=0;\n  G_TRY {\n    th->decode_func();\n  } G_CATCH_ALL {\n  } G_ENDCATCH;\n}\n\nvoid\nDjVuFile::decode_func(void)\n{\n  check();\n  DEBUG_MSG(\"DjVuFile::decode_func() called, url='\" << url << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n  \n  DjVuPortcaster * pcaster=get_portcaster();\n  \n  G_TRY {\n    const GP<ByteStream> decode_stream(decode_data_pool->get_stream());\n    ProgressByteStream *pstr=new ProgressByteStream(decode_stream);\n    const GP<ByteStream> gpstr(pstr);\n    pstr->set_progress_cb(progress_cb, this);\n    \n    decode(gpstr);\n    \n    // Wait for all child files to finish\n    while(wait_for_finish(0))\n    \tcontinue;\n    \n    DEBUG_MSG(\"waiting for children termination\\n\");\n    // Check for termination status\n    GCriticalSectionLock lock(&inc_files_lock);\n    for(GPosition pos=inc_files_list;pos;++pos)\n    {\n      GP<DjVuFile> & f=inc_files_list[pos];\n      if (f->is_decode_failed())\n\tG_THROW( ERR_MSG(\"DjVuFile.decode_fail\") );\n      if (f->is_decode_stopped())\n\tG_THROW( DataPool::Stop );\n      if (!f->is_decode_ok())\n\t{\n\t  DEBUG_MSG(\"this_url='\" << url << \"'\\n\");\n\t  DEBUG_MSG(\"incl_url='\" << f->get_url() << \"'\\n\");\n\t  DEBUG_MSG(\"decoding=\" << f->is_decoding() << \"\\n\");\n\t  DEBUG_MSG(\"status='\" << f->get_flags() << \"\\n\");\n\t  G_THROW( ERR_MSG(\"DjVuFile.not_finished\") );\n\t}\n    }\n  } G_CATCH(exc) {\n    G_TRY {\n      if (!exc.cmp_cause(DataPool::Stop))\n\t{\n\t  flags.enter();\n\t  flags = (flags & ~DECODING) | DECODE_STOPPED;\n\t  flags.leave();\n\t  pcaster->notify_status(this, GUTF8String(ERR_MSG(\"DjVuFile.stopped\"))\n\t\t\t\t + GUTF8String(\"\\t\") + GUTF8String(url));\n\t  pcaster->notify_file_flags_changed(this, DECODE_STOPPED, DECODING);\n\t} else\n\t{\n\t  flags.enter();\n\t  flags = (flags & ~DECODING) | DECODE_FAILED;\n\t  flags.leave();\n\t  pcaster->notify_status(this, GUTF8String(ERR_MSG(\"DjVuFile.failed\"))\n\t\t\t\t + GUTF8String(\"\\t\") + GUTF8String(url));\n\t  pcaster->notify_error(this, exc.get_cause());\n\t  pcaster->notify_file_flags_changed(this, DECODE_FAILED, DECODING);\n\t}\n    } G_CATCH_ALL\n\t{\n\t  DEBUG_MSG(\"******* Oops. Almost missed an exception\\n\");\n\t} G_ENDCATCH;\n  } G_ENDCATCH;\n\n  decode_data_pool->clear_stream();\n  G_TRY {\n    if (flags.test_and_modify(DECODING, 0, DECODE_OK | INCL_FILES_CREATED, DECODING))\n      pcaster->notify_file_flags_changed(this, DECODE_OK | INCL_FILES_CREATED, \n                                         DECODING);\n  } G_CATCH_ALL {} G_ENDCATCH;\n  DEBUG_MSG(\"decoding thread for url='\" << url << \"' ended\\n\");\n}\n\nGP<DjVuFile>\nDjVuFile::process_incl_chunk(ByteStream & str, int file_num)\n{\n  check();\n  DEBUG_MSG(\"DjVuFile::process_incl_chunk(): processing INCL chunk...\\n\");\n  DEBUG_MAKE_INDENT(3);\n  \n  DjVuPortcaster * pcaster=get_portcaster();\n  \n  GUTF8String incl_str;\n  char buffer[1024];\n  int length;\n  while((length=str.read(buffer, 1024)))\n    incl_str+=GUTF8String(buffer, length);\n  \n  // Eat '\\n' in the beginning and at the end\n  while(incl_str.length() && incl_str[0]=='\\n')\n  {\n    incl_str=incl_str.substr(1,(unsigned int)(-1));\n  }\n  while(incl_str.length()>0 && incl_str[(int)incl_str.length()-1]=='\\n')\n  {\n    incl_str.setat(incl_str.length()-1, 0);\n  }\n  \n  if (incl_str.length()>0)\n  {\n    if (strchr(incl_str, '/'))\n      G_THROW( ERR_MSG(\"DjVuFile.malformed\") );\n    \n    DEBUG_MSG(\"incl_str='\" << incl_str << \"'\\n\");\n    \n    GURL incl_url=pcaster->id_to_url(this, incl_str);\n    if (incl_url.is_empty())\t// Fallback. Should never be used.\n      incl_url=GURL::UTF8(incl_str,url.base());\n    \n    // Now see if there is already a file with this *name* created\n    {\n      GCriticalSectionLock lock(&inc_files_lock);\n      GPosition pos;\n      for(pos=inc_files_list;pos;++pos)\n      {\n        if (inc_files_list[pos]->url.fname()==incl_url.fname())\n           break;\n      }\n      if (pos)\n        return inc_files_list[pos];\n    }\n    \n    // No. We have to request a new file\n    GP<DjVuFile> file;\n    G_TRY\n    {\n      file=pcaster->id_to_file(this, incl_str);\n    }\n    G_CATCH(ex)\n    {\n      unlink_file(incl_str);\n      // In order to keep compatibility with the previous\n      // release of the DjVu plugin, we will not interrupt\n      // decoding here. We will just report the error.\n      // NOTE, that it's now the responsibility of the\n      // decoder to resolve all chunk dependencies, and\n      // abort decoding if necessary.\n      \n      get_portcaster()->notify_error(this,ex.get_cause());\n      return 0;\n    }\n    G_ENDCATCH;\n    if (!file)\n    {\n      G_THROW( ERR_MSG(\"DjVuFile.no_create\") \"\\t\"+incl_str);\n    }\n    if (recover_errors!=ABORT)\n      file->set_recover_errors(recover_errors);\n    if (verbose_eof)\n      file->set_verbose_eof(verbose_eof);\n    pcaster->add_route(file, this);\n    \n    // We may have been stopped. Make sure the child will be stopped too.\n    if (flags & STOPPED)\n      file->stop(false);\n    if (flags & BLOCKED_STOPPED)\n      file->stop(true);\n    \n    // Lock the list again and check if the file has already been\n    // added by someone else\n    {\n      GCriticalSectionLock lock(&inc_files_lock);\n      GPosition pos;\n      for(pos=inc_files_list;pos;++pos)\n      {\n        if (inc_files_list[pos]->url.fname()==incl_url.fname())\n          break;\n      }\n      if (pos)\n      {\n        file=inc_files_list[pos];\n      } else if (file_num<0 || !(pos=inc_files_list.nth(file_num)))\n      {\n        inc_files_list.append(file);\n      } else \n      {\n        inc_files_list.insert_before(pos, file);\n      }\n    }\n    return file;\n  }\n  return 0;\n}\n\n\nvoid\nDjVuFile::report_error(const GException &ex,bool throw_errors)\n{\n  data_pool->clear_stream();\n  if((!verbose_eof)|| (ex.cmp_cause(ByteStream::EndOfFile)))\n  {\n    if(throw_errors)\n    {\n      G_EMTHROW(ex);\n    }else\n    {\n      get_portcaster()->notify_error(this,ex.get_cause());\n    }\n  }else\n  {\n    GURL url=get_url();\n    GUTF8String url_str=url.get_string();\n//    if (url.is_local_file_url())\n//      url_str=url.filename();\n    \n    GUTF8String msg = GUTF8String( ERR_MSG(\"DjVuFile.EOF\") \"\\t\") + url;\n    if(throw_errors)\n    {\n      G_EMTHROW(GException(msg, ex.get_file(), ex.get_line(), \n                           ex.get_function() ));\n    }else\n    {\n      get_portcaster()->notify_error(this,msg);\n    }\n  }\n}\n\nvoid\nDjVuFile::process_incl_chunks(void)\n// This function may block for data\n// NOTE: It may be called again when INCL_FILES_CREATED is set.\n// It happens in insert_file() when it has modified the data\n// and wants to create the actual file\n{\n  DEBUG_MSG(\"DjVuFile::process_incl_chunks(void)\\n\");\n  DEBUG_MAKE_INDENT(3);\n  check();\n  \n  int incl_cnt=0;\n  \n  const GP<ByteStream> str(data_pool->get_stream());\n  GUTF8String chkid;\n  const GP<IFFByteStream> giff(IFFByteStream::create(str));\n  IFFByteStream &iff=*giff;\n  if (iff.get_chunk(chkid))\n  {\n    int chunks=0;\n    int last_chunk=0;\n    G_TRY\n    {\n      int chunks_left=(recover_errors>SKIP_PAGES)?chunks_number:(-1);\n      int chksize;\n      for(;(chunks_left--)&&(chksize=iff.get_chunk(chkid));last_chunk=chunks)\n      {\n        chunks++;\n        if (chkid==\"INCL\")\n        {\n          G_TRY\n          {\n            process_incl_chunk(*iff.get_bytestream(), incl_cnt++);\n          }\n          G_CATCH(ex);\n          {\n            report_error(ex,(recover_errors <= SKIP_PAGES));\n          }\n          G_ENDCATCH;\n        }else if(chkid==\"FAKE\")\n        {\n          set_needs_compression(true);\n          set_can_compress(true);\n        }else if(chkid==\"BGjp\")\n        {\n          set_can_compress(true);\n        }else if(chkid==\"Smmr\")\n        {\n          set_can_compress(true);\n        }\n        iff.seek_close_chunk();\n      }\n      if (chunks_number < 0) chunks_number=last_chunk;\n    }\n    G_CATCH(ex)\n    {\t\n      if (chunks_number < 0)\n        chunks_number=(recover_errors>SKIP_CHUNKS)?chunks:last_chunk;\n      report_error(ex,(recover_errors <= SKIP_PAGES));\n    }\n    G_ENDCATCH;\n  }\n  flags|=INCL_FILES_CREATED;\n  data_pool->clear_stream();\n}\n\nGP<JB2Dict>\nDjVuFile::static_get_fgjd(void *arg)\n{\n  DjVuFile *file = (DjVuFile*)arg;\n  return file->get_fgjd(1);\n}\n\nGP<JB2Dict>\nDjVuFile::get_fgjd(int block)\n{\n  check();\n  \n  // Simplest case\n  if (fgjd)\n    return fgjd;\n  // Check wether included files\n  chunk_mon.enter();\n  G_TRY {\n    for(;;)\n    {\n      int active = 0;\n      GPList<DjVuFile> incs = get_included_files();\n      for (GPosition pos=incs.firstpos(); pos; ++pos)\n      {\n        GP<DjVuFile> file = incs[pos];\n        if (file->is_decoding())\n          active = 1;\n        GP<JB2Dict> fgjd = file->get_fgjd();\n        if (fgjd)\n        {\n          chunk_mon.leave();\n          return fgjd;\n        }\n      }\n      // Exit if non-blocking mode\n      if (! block)\n        break;\n      // Exit if there is no decoding activity\n      if (! active)\n        break;\n      // Wait until a new chunk gets decoded\n      wait_for_chunk();\n    }\n  } G_CATCH_ALL {\n    chunk_mon.leave();\n    G_RETHROW;\n  } G_ENDCATCH;\n  chunk_mon.leave();\n  if (is_decode_stopped()) G_THROW( DataPool::Stop );\n  return 0;\n}\n\nint\nDjVuFile::get_dpi(int w, int h)\n{\n  int dpi=0, red=1;\n  if (info)\n  {\n    for(red=1; red<=12; red++)\n      if ((info->width+red-1)/red==w)\n        if ((info->height+red-1)/red==h)\n          break;\n    if (red>12)\n      G_THROW( ERR_MSG(\"DjVuFile.corrupt_BG44\") );\n    dpi=info->dpi;\n  }\n  return (dpi ? dpi : 300)/red;\n}\n\nstatic inline bool\nis_info(const GUTF8String &chkid)\n{\n  return (chkid==\"INFO\");\n}\n\nstatic inline bool\nis_annotation(const GUTF8String &chkid)\n{\n  return (chkid==\"ANTa\" ||\n    chkid==\"ANTz\" ||\n    chkid==\"FORM:ANNO\" ); \n}\n\nstatic inline bool\nis_text(const GUTF8String &chkid)\n{\n  return (chkid==\"TXTa\" || chkid==\"TXTz\");\n}\n\nstatic inline bool\nis_meta(const GUTF8String &chkid)\n{\n  return (chkid==\"METa\" || chkid==\"METz\");\n}\n\n\nGUTF8String\nDjVuFile::decode_chunk( const GUTF8String &id, const GP<ByteStream> &gbs,\n  bool djvi, bool djvu, bool iw44)\n{\n  DEBUG_MSG(\"DjVuFile::decode_chunk()\\n\");\n  ByteStream &bs=*gbs;\n  check();\n  \n  // If this object is referenced by only one GP<> pointer, this\n  // pointer should be the \"life_saver\" created by the decoding thread.\n  // If it is the only GP<> pointer, then nobody is interested in the\n  // results of the decoding and we can abort now with #DataPool::Stop#\n  if (get_count()==1)\n    G_THROW( DataPool::Stop );\n  \n  GUTF8String desc = ERR_MSG(\"DjVuFile.unrecog_chunk\");\n  GUTF8String chkid = id;\n  DEBUG_MSG(\"DjVuFile::decode_chunk() : decoding \" << id << \"\\n\");\n  \n  // INFO  (information chunk for djvu page)\n  if (is_info(chkid) && (djvu || djvi))\n  {\n    if (info)\n      G_THROW( ERR_MSG(\"DjVuFile.corrupt_dupl\") );\n    if (djvi)\n      G_THROW( ERR_MSG(\"DjVuFile.corrupt_INFO\") );\n    // DjVuInfo::decode no longer throws version exceptions\n    GP<DjVuInfo> xinfo=DjVuInfo::create();\n    xinfo->decode(bs);\n    info = xinfo;\n    desc.format( ERR_MSG(\"DjVuFile.page_info\") );\n    // Consistency checks (previously in DjVuInfo::decode)\n    if (info->width<0 || info->height<0)\n      G_THROW( ERR_MSG(\"DjVuFile.corrupt_zero\") );\n    if (info->version >= DJVUVERSION_TOO_NEW)\n      G_THROW( ERR_MSG(\"DjVuFile.new_version\") \"\\t\" \n               STRINGIFY(DJVUVERSION_TOO_NEW) );\n  }\n  \n  // INCL (inclusion chunk)\n  else if (chkid == \"INCL\" && (djvi || djvu || iw44))\n  {\n    GP<DjVuFile> file=process_incl_chunk(bs);\n    if (file)\n    {\n      int decode_was_already_started = 1;\n      {\n        GMonitorLock lock(&file->flags);\n          // Start decoding\n        if(file->resume_decode())\n        {\n          decode_was_already_started = 0;\n        }\n      }\n      // Send file notifications if previously started\n      if (decode_was_already_started)\n      {\n        // May send duplicate notifications...\n        if (file->is_decode_ok())\n          get_portcaster()->notify_file_flags_changed(file, DECODE_OK, 0);\n        else if (file->is_decode_failed())\n          get_portcaster()->notify_file_flags_changed(file, DECODE_FAILED, 0);\n      }\n      desc.format( ERR_MSG(\"DjVuFile.indir_chunk1\") \"\\t\" + file->get_url().fname() );\n    } else\n      desc.format( ERR_MSG(\"DjVuFile.indir_chunk2\") );\n  }\n  \n  // Djbz (JB2 Dictionary)\n  else if (chkid == \"Djbz\" && (djvu || djvi))\n  {\n    if (this->fgjd)\n      G_THROW( ERR_MSG(\"DjVuFile.dupl_Dxxx\") );\n    if (this->fgjd)\n      G_THROW( ERR_MSG(\"DjVuFile.Dxxx_after_Sxxx\") );\n    GP<JB2Dict> fgjd = JB2Dict::create();\n    fgjd->decode(gbs);\n    this->fgjd = fgjd;\n    desc.format( ERR_MSG(\"DjVuFile.shape_dict\") \"\\t%d\", fgjd->get_shape_count() );\n  } \n  \n  // Sjbz (JB2 encoded mask)\n  else if (chkid==\"Sjbz\" && (djvu || djvi))\n  {\n    if (this->fgjb)\n      G_THROW( ERR_MSG(\"DjVuFile.dupl_Sxxx\") );\n    GP<JB2Image> fgjb=JB2Image::create();\n    // ---- begin hack\n    if (info && info->version <=18)\n      fgjb->reproduce_old_bug = true;\n    // ---- end hack\n    fgjb->decode(gbs, static_get_fgjd, (void*)this);\n    this->fgjb = fgjb;\n    desc.format( ERR_MSG(\"DjVuFile.fg_mask\") \"\\t%d\\t%d\\t%d\",\n      fgjb->get_width(), fgjb->get_height(),\n      get_dpi(fgjb->get_width(), fgjb->get_height()));\n  }\n  \n  // Smmr (MMR-G4 encoded mask)\n  else if (chkid==\"Smmr\" && (djvu || djvi))\n  {\n    if (this->fgjb)\n      G_THROW( ERR_MSG(\"DjVuFile.dupl_Sxxx\") );\n    set_can_compress(true);\n    this->fgjb = MMRDecoder::decode(gbs);\n    desc.format( ERR_MSG(\"DjVuFile.G4_mask\") \"\\t%d\\t%d\\t%d\",\n      fgjb->get_width(), fgjb->get_height(),\n      get_dpi(fgjb->get_width(), fgjb->get_height()));\n  }\n  \n  // BG44 (background wavelets)\n  else if (chkid == \"BG44\" && (djvu || djvi))\n  {\n    if (!bg44)\n    {\n      if (bgpm)\n        G_THROW( ERR_MSG(\"DjVuFile.dupl_backgrnd\") );\n      // First chunk\n      GP<IW44Image> bg44=IW44Image::create_decode(IW44Image::COLOR);\n      bg44->decode_chunk(gbs);\n      this->bg44 = bg44;\n      desc.format( ERR_MSG(\"DjVuFile.IW44_bg1\") \"\\t%d\\t%d\\t%d\",\n\t\t      bg44->get_width(), bg44->get_height(),\n          get_dpi(bg44->get_width(), bg44->get_height()));\n    } \n    else\n    {\n      // Refinement chunks\n      GP<IW44Image> bg44 = this->bg44;\n      bg44->decode_chunk(gbs);\n      desc.format( ERR_MSG(\"DjVuFile.IW44_bg2\") \"\\t%d\\t%d\",\n\t\t      bg44->get_serial(), get_dpi(bg44->get_width(), bg44->get_height()));\n    }\n  }\n  \n  // FG44 (foreground wavelets)\n  else if (chkid == \"FG44\" && (djvu || djvu))\n  {\n    if (fgpm || fgbc)\n      G_THROW( ERR_MSG(\"DjVuFile.dupl_foregrnd\") );\n    GP<IW44Image> gfg44=IW44Image::create_decode(IW44Image::COLOR);\n    IW44Image &fg44=*gfg44;\n    fg44.decode_chunk(gbs);\n    fgpm=fg44.get_pixmap();\n    desc.format( ERR_MSG(\"DjVuFile.IW44_fg\") \"\\t%d\\t%d\\t%d\",\n      fg44.get_width(), fg44.get_height(),\n      get_dpi(fg44.get_width(), fg44.get_height()));\n  } \n  \n  // LINK (background LINK)\n  else if (chkid == \"LINK\" && (djvu || djvi))\n  {\n    if (bg44 || bgpm)\n      G_THROW( ERR_MSG(\"DjVuFile.dupl_backgrnd\") );\n    if(djvu_decode_codec)\n    {\n      set_modified(true);\n      set_can_compress(true);\n      set_needs_compression(true);\n      this->bgpm = djvu_decode_codec(bs);\n      desc.format( ERR_MSG(\"DjVuFile.color_import1\") \"\\t%d\\t%d\\t%d\",\n        bgpm->columns(), bgpm->rows(),\n        get_dpi(bgpm->columns(), bgpm->rows()));\n    }else\n    {\n      desc.format( ERR_MSG(\"DjVuFile.color_import2\") );\n    }\n  } \n  \n  // BGjp (background JPEG)\n  else if (chkid == \"BGjp\" && (djvu || djvi))\n  {\n    if (bg44 || bgpm)\n      G_THROW( ERR_MSG(\"DjVuFile.dupl_backgrnd\") );\n    set_can_compress(true);\n#ifdef NEED_JPEG_DECODER\n    this->bgpm = JPEGDecoder::decode(bs);\n    desc.format( ERR_MSG(\"DjVuFile.JPEG_bg1\") \"\\t%d\\t%d\\t%d\",\n      bgpm->columns(), bgpm->rows(),\n      get_dpi(bgpm->columns(), bgpm->rows()));\n#else\n    desc.format( ERR_MSG(\"DjVuFile.JPEG_bg2\") );\n#endif\n  } \n  \n  // FGjp (foreground JPEG)\n  else if (chkid == \"FGjp\" && (djvu || djvi))\n  {\n    if (fgpm || fgbc)\n      G_THROW( ERR_MSG(\"DjVuFile.dupl_foregrnd\") );\n#ifdef NEED_JPEG_DECODER\n    this->fgpm = JPEGDecoder::decode(bs);\n    desc.format( ERR_MSG(\"DjVuFile.JPEG_fg1\") \"\\t%d\\t%d\\t%d\",\n      fgpm->columns(), fgpm->rows(),\n      get_dpi(fgpm->columns(), fgpm->rows()));\n#else\n    desc.format( ERR_MSG(\"DjVuFile.JPEG_fg2\") );\n#endif\n  } \n  \n  // BG2k (background JPEG-2000) Note: JPEG2K bitstream not finalized.\n  else if (chkid == \"BG2k\" && (djvu || djvi))\n  {\n    if (bg44)\n      G_THROW( ERR_MSG(\"DjVuFile.dupl_backgrnd\") );\n    desc.format( ERR_MSG(\"DjVuFile.JPEG2K_bg\") );\n  } \n  \n  // FG2k (foreground JPEG-2000) Note: JPEG2K bitstream not finalized.\n  else if (chkid == \"FG2k\" && (djvu || djvi))\n  {\n    if (fgpm || fgbc)\n      G_THROW( ERR_MSG(\"DjVuFile.dupl_foregrnd\") );\n    desc.format( ERR_MSG(\"DjVuFile.JPEG2K_fg\") );\n  } \n  \n  // FGbz (foreground color vector)\n  else if (chkid == \"FGbz\" && (djvu || djvi))\n  {\n    if (fgpm || fgbc)\n      G_THROW( ERR_MSG(\"DjVuFile.dupl_foregrnd\") );\n    GP<DjVuPalette> fgbc = DjVuPalette::create();\n    fgbc->decode(gbs);\n    this->fgbc = fgbc;\n    desc.format( ERR_MSG(\"DjVuFile.JB2_fg\") \"\\t%d\\t%d\",\n      fgbc->size(), fgbc->colordata.size());\n  }\n  \n  // BM44/PM44 (IW44 data)\n  else if ((chkid == \"PM44\" || chkid==\"BM44\") && iw44)\n  {\n    if (!bg44)\n    {\n      // First chunk\n      GP<IW44Image> bg44 = IW44Image::create_decode(IW44Image::COLOR);\n      bg44->decode_chunk(gbs);\n      GP<DjVuInfo> info = DjVuInfo::create();\n      info->width = bg44->get_width();\n      info->height = bg44->get_height();\n      info->dpi = 100;\n      this->bg44 = bg44;\n      this->info = info;\n      desc.format( ERR_MSG(\"DjVuFile.IW44_data1\") \"\\t%d\\t%d\\t%d\",\n                   bg44->get_width(), bg44->get_height(),\n                   get_dpi(bg44->get_width(), bg44->get_height()));\n    } \n    else\n    {\n      // Refinement chunks\n      GP<IW44Image> bg44 = this->bg44;\n      bg44->decode_chunk(gbs);\n      desc.format( ERR_MSG(\"DjVuFile.IW44_data2\") \"\\t%d\\t%d\",\n                   bg44->get_serial(),\n                   get_dpi(bg44->get_width(), bg44->get_height()));\n    }\n  }\n  \n  // NDIR (obsolete navigation chunk)\n  else if (chkid == \"NDIR\")\n  {\n    GP<DjVuNavDir> dir=DjVuNavDir::create(url);\n    dir->decode(bs);\n    this->dir=dir;\n    desc.format( ERR_MSG(\"DjVuFile.nav_dir\") );\n  }\n  \n  // FORM:ANNO (obsolete) (must be before other annotations)\n  else if (chkid == \"FORM:ANNO\") \n    {\n      const GP<ByteStream> gachunk(ByteStream::create());\n      ByteStream &achunk=*gachunk;\n      achunk.copy(bs);\n      achunk.seek(0);\n      GCriticalSectionLock lock(&anno_lock);\n      if (! anno)\n      {\n        anno=ByteStream::create();\n      }\n      anno->seek(0,SEEK_END);\n      if (anno->tell())\n      {\n        anno->write((void*)\"\", 1);\n      }\n      // Copy data\n      anno->copy(achunk);\n      desc.format( ERR_MSG(\"DjVuFile.anno1\") );\n    }\n  \n  // ANTa/ANTx/TXTa/TXTz annotations\n  else if (is_annotation(chkid))  // but not FORM:ANNO\n    {\n      const GP<ByteStream> gachunk(ByteStream::create());\n      ByteStream &achunk=*gachunk;\n      achunk.copy(bs);\n      achunk.seek(0);\n      GCriticalSectionLock lock(&anno_lock);\n      if (! anno)\n      {\n        anno = ByteStream::create();\n      }\n      anno->seek(0,SEEK_END);\n      if (anno->tell() & 1)\n      {\n        anno->write((const void*)\"\", 1);\n      }\n      // Recreate chunk header\n      const GP<IFFByteStream> giffout(IFFByteStream::create(anno));\n      IFFByteStream &iffout=*giffout;\n      iffout.put_chunk(id);\n      iffout.copy(achunk);\n      iffout.close_chunk();\n      desc.format( ERR_MSG(\"DjVuFile.anno2\") );\n    }\n  else if (is_text(chkid))\n    {\n      const GP<ByteStream> gachunk(ByteStream::create());\n      ByteStream &achunk=*gachunk;\n      achunk.copy(bs);\n      achunk.seek(0);\n      GCriticalSectionLock lock(&text_lock);\n      if (! text)\n      {\n        text = ByteStream::create();\n      }\n      text->seek(0,SEEK_END);\n      if (text->tell())\n      {\n        text->write((const void*)\"\", 1);\n      }\n      // Recreate chunk header\n      const GP<IFFByteStream> giffout(IFFByteStream::create(text));\n      IFFByteStream &iffout=*giffout;\n      iffout.put_chunk(id);\n      iffout.copy(achunk);\n      iffout.close_chunk();\n      desc.format( ERR_MSG(\"DjVuFile.text\") );\n    }\n  else if (is_meta(chkid))\n    {\n      const GP<ByteStream> gachunk(ByteStream::create());\n      ByteStream &achunk=*gachunk;\n      achunk.copy(bs);\n      achunk.seek(0);\n      GCriticalSectionLock lock(&meta_lock);\n      if (! meta)\n      {\n        meta = ByteStream::create();\n      }\n      meta->seek(0,SEEK_END);\n      if (meta->tell())\n      {\n        meta->write((const void*)\"\", 1);\n      }\n      // Recreate chunk header\n      const GP<IFFByteStream> giffout(IFFByteStream::create(meta));\n      IFFByteStream &iffout=*giffout;\n      iffout.put_chunk(id);\n      iffout.copy(achunk);\n      iffout.close_chunk();\n    }\n  else if (chkid == \"CELX\" || chkid == \"SINF\")\n    {\n      G_THROW( ERR_MSG(\"DjVuFile.securedjvu\") );\n    }\n  \n  // Return description\n  return desc;\n}\n\nvoid\nDjVuFile::set_decode_codec(GP<GPixmap> (*codec)(ByteStream &bs))\n{\n  djvu_decode_codec=codec;\n}\n\nvoid\nDjVuFile::decode(const GP<ByteStream> &gbs)\n{\n  check();\n  DEBUG_MSG(\"DjVuFile::decode(), url='\" << url << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n  DjVuPortcaster * pcaster=get_portcaster();\n  \n  // Get form chunk\n  GUTF8String chkid;\n  const GP<IFFByteStream> giff(IFFByteStream::create(gbs));\n  IFFByteStream &iff=*giff;\n  if (!iff.get_chunk(chkid)) \n    REPORT_EOF(true)\n    \n    // Check file format\n  bool djvi = (chkid==\"FORM:DJVI\")?true:false;\n  bool djvu = (chkid==\"FORM:DJVU\")?true:false;\n  bool iw44 = ((chkid==\"FORM:PM44\") || (chkid==\"FORM:BM44\"));\n  if (djvi || djvu)\n    mimetype = \"image/x.djvu\";\n  else if (iw44)\n    mimetype = \"image/x-iw44\";\n  else\n    G_THROW( ERR_MSG(\"DjVuFile.unexp_image\") );\n  \n  // Process chunks\n  int size_so_far=iff.tell();\n  int chunks=0;\n  int last_chunk=0;\n  G_TRY\n  {\n    int chunks_left=(recover_errors>SKIP_PAGES)?chunks_number:(-1);\n    int chksize;\n    for(;(chunks_left--)&&(chksize = iff.get_chunk(chkid));last_chunk=chunks)\n    {\n      chunks++;\n\n      // Decode and get chunk description\n      GUTF8String str = decode_chunk(chkid, iff.get_bytestream(), djvi, djvu, iw44);\n      // Add parameters to the chunk description to give the size and chunk id\n      GUTF8String desc;\n      desc.format(\"\\t%5.1f\\t%s\", chksize/1024.0, (const char*)chkid);\n      // Append the whole thing to the growing file description\n      description = description + str + desc + \"\\n\";\n\n      pcaster->notify_chunk_done(this, chkid);\n      // Close chunk\n      iff.seek_close_chunk();\n      // Record file size\n      size_so_far=iff.tell();\n    }\n    if (chunks_number < 0) chunks_number=last_chunk;\n  }\n  G_CATCH(ex)\n  {\n    if(!ex.cmp_cause(ByteStream::EndOfFile))\n    {\n      if (chunks_number < 0)\n        chunks_number=(recover_errors>SKIP_CHUNKS)?chunks:last_chunk;\n      report_error(ex,(recover_errors <= SKIP_PAGES));\n    }else\n    {\n      report_error(ex,true);\n    }\n  }\n  G_ENDCATCH;\n  \n  // Record file size\n  file_size=size_so_far;\n  // Close form chunk\n  iff.close_chunk();\n  // Close BG44 codec\n  if (bg44) \n    bg44->close_codec();\n  \n  // Complete description\n  if (djvu && !info)\n    G_THROW( ERR_MSG(\"DjVuFile.corrupt_missing_info\") );\n  if (iw44 && !info)\n    G_THROW( ERR_MSG(\"DjVuFile.corrupt_missing_IW44\") );\n  if (info)\n  {\n    GUTF8String desc;\n    if (djvu || djvi)\n      desc.format( ERR_MSG(\"DjVuFile.djvu_header\") \"\\t%d\\t%d\\t%d\\t%d\", \n        info->width, info->height,\n        info->dpi, info->version);\n    else if (iw44)\n      desc.format( ERR_MSG(\"DjVuFile.IW44_header\") \"\\t%d\\t%d\\t%d\", \n        info->width, info->height, info->dpi);\n    description=desc + \"\\n\" + description;\n    int rawsize=info->width*info->height*3;\n    desc.format( ERR_MSG(\"DjVuFile.ratio\") \"\\t%0.1f\\t%0.1f\",\n      (double)rawsize/file_size, file_size/1024.0 );\n    description=description+desc;\n  }\n}\n\nvoid\nDjVuFile::start_decode(void)\n{\n  check();\n  DEBUG_MSG(\"DjVuFile::start_decode(), url='\" << url << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n  \n  GThread * thread_to_delete=0;\n  flags.enter();\n  G_TRY {\n    if (!(flags & DONT_START_DECODE) && !is_decoding())\n    {\n      if (flags & DECODE_STOPPED) reset();\n      flags&=~(DECODE_OK | DECODE_STOPPED | DECODE_FAILED);\n      flags|=DECODING;\n      \n      // Don't delete the thread while you're owning the flags lock\n      // Beware of deadlock!\n      thread_to_delete=decode_thread; decode_thread=0;\n      \n      // We want to create it right here to be able to stop the\n      // decoding thread even before its function is called (it starts)\n      decode_data_pool=DataPool::create(data_pool);\n      decode_life_saver=this;\n      \n      decode_thread=new GThread();\n      decode_thread->create(static_decode_func, this);\n    }\n  }\n  G_CATCH_ALL\n  {\n    flags&=~DECODING;\n    flags|=DECODE_FAILED;\n    flags.leave();\n    get_portcaster()->notify_file_flags_changed(this, DECODE_FAILED, DECODING);\n    delete thread_to_delete;\n    G_RETHROW;\n  }\n  G_ENDCATCH;\n  flags.leave();\n  delete thread_to_delete;\n}\n\nbool\nDjVuFile::resume_decode(const bool sync)\n{\n  bool retval=false;\n  {\n    GMonitorLock lock(&flags);\n    if( !is_decoding() && !is_decode_ok() && !is_decode_failed() )\n    {\n      start_decode();\n      retval=true;\n    }\n  }\n  if(sync)\n  {\n    wait_for_finish();\n  }\n  return retval;\n}\n\nvoid\nDjVuFile::stop_decode(bool sync)\n{\n  check();\n  \n  DEBUG_MSG(\"DjVuFile::stop_decode(), url='\" << url <<\n    \"', sync=\" << (int) sync << \"\\n\");\n  DEBUG_MAKE_INDENT(3);\n  \n  G_TRY\n  {\n    flags|=DONT_START_DECODE;\n    \n    // Don't stop SYNCHRONOUSLY from the thread where the decoding is going!!!\n    {\n      // First - ask every included child to stop in async mode\n      GCriticalSectionLock lock(&inc_files_lock);\n      for(GPosition pos=inc_files_list;pos;++pos)\n        inc_files_list[pos]->stop_decode(0);\n      \n//      if (decode_data_pool) decode_data_pool->stop();\n    }\n    \n    if (sync)\n    {\n      while(1)\n      {\n        GP<DjVuFile> file;\n        {\n          GCriticalSectionLock lock(&inc_files_lock);\n          for(GPosition pos=inc_files_list;pos;++pos)\n          {\n            GP<DjVuFile> & f=inc_files_list[pos];\n            if (f->is_decoding())\n            {\n              file=f; break;\n            }\n          }\n        }\n        if (!file) break;\n        \n        file->stop_decode(1);\n      }\n      \n      wait_for_finish(1);\t// Wait for self termination\n      \n      // Don't delete the thread here. Until GPBase::preserve() is\n      // reimplemented somehow at the GThread level.\n      // delete decode_thread; decode_thread=0;\n    }\n    flags&=~(DONT_START_DECODE);\n  } G_CATCH_ALL {\n    flags&=~(DONT_START_DECODE);\n    G_RETHROW;\n  } G_ENDCATCH;\n}\n\nvoid\nDjVuFile::stop(bool only_blocked)\n// This is a one-way function. There is no way to undo the stop()\n// command.\n{\n  DEBUG_MSG(\"DjVuFile::stop(): Stopping everything\\n\");\n  DEBUG_MAKE_INDENT(3);\n  \n  flags|=only_blocked ? BLOCKED_STOPPED : STOPPED;\n  if (data_pool) data_pool->stop(only_blocked);\n  GCriticalSectionLock lock(&inc_files_lock);\n  for(GPosition pos=inc_files_list;pos;++pos)\n    inc_files_list[pos]->stop(only_blocked);\n}\n\nGP<DjVuNavDir>\nDjVuFile::find_ndir(GMap<GURL, void *> & map)\n{\n  check();\n  \n  DEBUG_MSG(\"DjVuFile::find_ndir(): looking for NDIR in '\" << url << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n  \n  if (dir) return dir;\n  \n  if (!map.contains(url))\n  {\n    map[url]=0;\n    \n    GPList<DjVuFile> list=get_included_files(false);\n    for(GPosition pos=list;pos;++pos)\n    {\n      GP<DjVuNavDir> d=list[pos]->find_ndir(map);\n      if (d) return d;\n    }\n  }\n  return 0;\n}\n\nGP<DjVuNavDir>\nDjVuFile::find_ndir(void)\n{\n  GMap<GURL, void *> map;\n  return find_ndir(map);\n}\n\nGP<DjVuNavDir>\nDjVuFile::decode_ndir(GMap<GURL, void *> & map)\n{\n  check();\n  \n  DEBUG_MSG(\"DjVuFile::decode_ndir(): decoding for NDIR in '\" << url << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n  \n  if (dir) return dir;\n  \n  if (!map.contains(url))\n  {\n    map[url]=0;\n    \n    const GP<ByteStream> str(data_pool->get_stream());\n    \n    GUTF8String chkid;\n    const GP<IFFByteStream> giff(IFFByteStream::create(str));\n    IFFByteStream &iff=*giff;\n    if (!iff.get_chunk(chkid)) \n      REPORT_EOF(true)\n\n    int chunks=0;\n    int last_chunk=0;\n#ifndef SLOW_BUT_EXACT_DETECTION_OF_NDIR\n    int found_incl=0;\n#endif\n    G_TRY\n    {\n      int chunks_left=(recover_errors>SKIP_PAGES)?chunks_number:(-1);\n      int chksize;\n      for(;(chunks_left--)&&(chksize=iff.get_chunk(chkid));last_chunk=chunks)\n      {\n        chunks++;\n        if (chkid==\"NDIR\")\n        {\n          GP<DjVuNavDir> d=DjVuNavDir::create(url);\n          d->decode(*iff.get_bytestream());\n          dir=d;\n          break;\n        }\n#ifndef SLOW_BUT_EXACT_DETECTION_OF_NDIR\n        if (chkid==\"INCL\")\n          found_incl = 1;\n        if (chunks>2 && !found_incl && !data_pool->is_eof())\n          return 0;\n#endif\n        iff.seek_close_chunk();\n      }\n      if ((!dir)&&(chunks_number < 0)) chunks_number=last_chunk;\n    }\n    G_CATCH(ex)\n    {\n       if(!ex.cmp_cause(ByteStream::EndOfFile))\n       {\n          if (chunks_number < 0)\n             chunks_number=(recover_errors>SKIP_CHUNKS)?chunks:last_chunk;\n          report_error(ex,(recover_errors<=SKIP_PAGES));\n       }else\n       {\n          report_error(ex,true);\n       }\n    }\n    G_ENDCATCH;\n    \n    data_pool->clear_stream();\n    if (dir) return dir;\n    \n    GPList<DjVuFile> list=get_included_files(false);\n    for(GPosition pos=list;pos;++pos)\n    {\n      GP<DjVuNavDir> d=list[pos]->decode_ndir(map);\n      if (d) return d;\n    }\n    data_pool->clear_stream();\n  }\n  return 0;\n}\n\nGP<DjVuNavDir>\nDjVuFile::decode_ndir(void)\n{\n  GMap<GURL, void *> map;\n  return decode_ndir(map);\n}\n\nvoid\nDjVuFile::get_merged_anno(const GP<DjVuFile> & file,\n  const GP<ByteStream> &gstr_out, const GList<GURL> & ignore_list,\n  int level, int & max_level, GMap<GURL, void *> & map)\n{\n  DEBUG_MSG(\"DjVuFile::get_merged_anno()\\n\");\n  GURL url=file->get_url();\n  if (!map.contains(url))\n  {\n    ByteStream &str_out=*gstr_out;\n    map[url]=0;\n\n    // Do the included files first (To make sure that they have\n    // less precedence)\n    // Depending on if we have all data present, we will\n    // either create all included files or will use only\n    // those that have already been created\n    GPList<DjVuFile> list=file->get_included_files(!file->is_data_present());\n    for(GPosition pos=list;pos;++pos)\n      get_merged_anno(list[pos], gstr_out, ignore_list, level+1, max_level, map);\n\n    // Now process the DjVuFile's own annotations\n    if (!ignore_list.contains(file->get_url()))\n      {\n\tif (!file->is_data_present() ||\n\t    (file->is_modified() && file->anno))\n\t  {\n\t    // Process the decoded (?) anno\n\t    GCriticalSectionLock lock(&file->anno_lock);\n\t    if (file->anno && file->anno->size())\n\t      {\n\t\tif (str_out.tell())\n\t\t  {\n\t\t    str_out.write((void *) \"\", 1);\n\t\t  }\n\t\tfile->anno->seek(0);\n\t\tstr_out.copy(*file->anno);\n\t      }\n\t  } else if (file->is_data_present())\n\t  {\n\t    // Copy all annotations chunks, but do NOT modify\n\t    // this->anno (to avoid correlation with DjVuFile::decode())\n\t    const GP<ByteStream> str(file->data_pool->get_stream());\n\t    const GP<IFFByteStream> giff(IFFByteStream::create(str));\n\t    IFFByteStream &iff=*giff;\n\t    GUTF8String chkid;\n\t    if (iff.get_chunk(chkid))\n\t      while(iff.get_chunk(chkid))\n\t\t{\n\t\t  if (chkid==\"FORM:ANNO\")\n\t\t    {\n\t\t      if (max_level<level)\n\t\t\tmax_level=level;\n\t\t      if (str_out.tell())\n\t\t\t{\n\t\t\t  str_out.write((void *) \"\", 1);\n\t\t\t}\n\t\t      str_out.copy(*iff.get_bytestream());\n\t\t    }\n\t\t  else if (is_annotation(chkid)) // but not FORM:ANNO\n\t\t    {\n\t\t      if (max_level<level)\n\t\t\tmax_level=level;\n\t\t      if (str_out.tell()&&chkid != \"ANTz\")\n\t\t\t{\n\t\t\t  str_out.write((void *) \"\", 1);\n\t\t\t}\n\t\t      const GP<IFFByteStream> giff_out(IFFByteStream::create(gstr_out));\n\t\t      IFFByteStream &iff_out=*giff_out;\n\t\t      iff_out.put_chunk(chkid);\n\t\t      iff_out.copy(*iff.get_bytestream());\n\t\t      iff_out.close_chunk();\n\t\t    }\n\t\t  iff.close_chunk();\n\t\t}\n\t    file->data_pool->clear_stream();\n\t  }\n      }\n  }\n}\n\nGP<ByteStream>\nDjVuFile::get_merged_anno(const GList<GURL> & ignore_list,\n                          int * max_level_ptr)\n                          // Will do the same thing as get_merged_anno(int *), but will\n                          // ignore DjVuFiles with URLs from the ignore_list\n{\n  DEBUG_MSG(\"DjVuFile::get_merged_anno()\\n\");\n  GP<ByteStream> gstr(ByteStream::create());\n  GMap<GURL, void *> map;\n  int max_level=0;\n  get_merged_anno(this, gstr, ignore_list, 0, max_level, map);\n  if (max_level_ptr)\n    *max_level_ptr=max_level;\n  ByteStream &str=*gstr;\n  if (!str.tell()) \n  {\n    gstr=0;\n  }else\n  {\n    str.seek(0);\n  }\n  return gstr;\n}\n\nGP<ByteStream>\nDjVuFile::get_merged_anno(int * max_level_ptr)\n// Will go down the DjVuFile's hierarchy and decode all DjVuAnno even\n// when the DjVuFile is not fully decoded yet. To avoid correlations\n// with DjVuFile::decode(), we do not modify DjVuFile::anno data.\n//\n// Files deeper in the hierarchy have less influence on the\n// results. It means, for example, that the if annotations are\n// specified in the top level page file and in a shared file,\n// the top level page file settings will take precedence.\n//\n// NOTE! This function guarantees correct results only if the\n// DjVuFile has all data\n{\n  GList<GURL> ignore_list;\n  return get_merged_anno(ignore_list, max_level_ptr);\n}\n\n\n// [LB->BCR] The following six functions get_anno, get_text, get_meta \n// contain the same code in triplicate!!!\n\nvoid\nDjVuFile::get_anno(\n  const GP<DjVuFile> & file, const GP<ByteStream> &gstr_out)\n{\n  DEBUG_MSG(\"DjVuFile::get_anno()\\n\");\n  ByteStream &str_out=*gstr_out;\n  if (!file->is_data_present() ||\n      (file->is_modified() && file->anno))\n    {\n      // Process the decoded (?) anno\n      GCriticalSectionLock lock(&file->anno_lock);\n      if (file->anno && file->anno->size())\n\t{\n\t  if (str_out.tell())\n\t    {\n\t      str_out.write((void *) \"\", 1);\n\t    }\n\t  file->anno->seek(0);\n\t  str_out.copy(*file->anno);\n\t}\n    } else if (file->is_data_present())\n    {\n      // Copy all anno chunks, but do NOT modify\n      // DjVuFile::anno (to avoid correlation with DjVuFile::decode())\n      const GP<ByteStream> str=file->data_pool->get_stream();\n      const GP<IFFByteStream> giff=IFFByteStream::create(str);\n      IFFByteStream &iff=*giff;\n      GUTF8String chkid;\n      if (iff.get_chunk(chkid))\n\t{\n\t  while(iff.get_chunk(chkid))\n\t    {\n\t      if (is_annotation(chkid))\n\t\t{\n\t\t  if (str_out.tell())\n\t\t    {\n\t\t      str_out.write((void *) \"\", 1);\n\t\t    }\n\t\t  const GP<IFFByteStream> giff_out(IFFByteStream::create(gstr_out));\n\t\t  IFFByteStream &iff_out=*giff_out;\n\t\t  iff_out.put_chunk(chkid);\n\t\t  iff_out.copy(*iff.get_bytestream());\n\t\t  iff_out.close_chunk();\n\t\t}\n\t      iff.close_chunk();\n\t    }\n\t}\n      file->data_pool->clear_stream();\n    }\n}\n\nvoid\nDjVuFile::get_text(\n  const GP<DjVuFile> & file, const GP<ByteStream> &gstr_out)\n{\n  DEBUG_MSG(\"DjVuFile::get_text()\\n\");\n  ByteStream &str_out=*gstr_out;\n  if (!file->is_data_present() ||\n      (file->is_modified() && file->text))\n    {\n      // Process the decoded (?) text\n      GCriticalSectionLock lock(&file->text_lock);\n      if (file->text && file->text->size())\n\t{\n\t  if (str_out.tell())\n\t    {\n\t      str_out.write((void *) \"\", 1);\n\t    }\n\t  file->text->seek(0);\n\t  str_out.copy(*file->text);\n\t}\n    } else if (file->is_data_present())\n    {\n      // Copy all text chunks, but do NOT modify\n      // DjVuFile::text (to avoid correlation with DjVuFile::decode())\n      const GP<ByteStream> str=file->data_pool->get_stream();\n      const GP<IFFByteStream> giff=IFFByteStream::create(str);\n      IFFByteStream &iff=*giff;\n      GUTF8String chkid;\n      if (iff.get_chunk(chkid))\n\t{\n\t  while(iff.get_chunk(chkid))\n\t    {\n\t      if (is_text(chkid))\n\t\t{\n\t\t  if (str_out.tell())\n\t\t    {\n\t\t      str_out.write((void *) \"\", 1);\n\t\t    }\n\t\t  const GP<IFFByteStream> giff_out(IFFByteStream::create(gstr_out));\n\t\t  IFFByteStream &iff_out=*giff_out;\n\t\t  iff_out.put_chunk(chkid);\n\t\t  iff_out.copy(*iff.get_bytestream());\n\t\t  iff_out.close_chunk();\n\t\t}\n\t      iff.close_chunk();\n\t    }\n\t}\n      file->data_pool->clear_stream();\n    }\n}\n\nvoid\nDjVuFile::get_meta(\n  const GP<DjVuFile> & file, const GP<ByteStream> &gstr_out)\n{\n  DEBUG_MSG(\"DjVuFile::get_meta()\\n\");\n  ByteStream &str_out=*gstr_out;\n  if (!file->is_data_present() ||\n      (file->is_modified() && file->meta))\n    {\n      // Process the decoded (?) meta\n      GCriticalSectionLock lock(&file->meta_lock);\n      if (file->meta && file->meta->size())\n\t{\n\t  if (str_out.tell())\n\t    {\n\t      str_out.write((void *) \"\", 1);\n\t    }\n\t  file->meta->seek(0);\n\t  str_out.copy(*file->meta);\n\t}\n    } else if (file->is_data_present())\n    {\n      // Copy all meta chunks, but do NOT modify\n      // DjVuFile::meta (to avoid correlation with DjVuFile::decode())\n      const GP<ByteStream> str=file->data_pool->get_stream();\n      const GP<IFFByteStream> giff=IFFByteStream::create(str);\n      IFFByteStream &iff=*giff;\n      GUTF8String chkid;\n      if (iff.get_chunk(chkid))\n\t{\n\t  while(iff.get_chunk(chkid))\n\t    {\n\t      if (is_meta(chkid))\n\t\t{\n\t\t  if (str_out.tell())\n\t\t    {\n\t\t      str_out.write((void *) \"\", 1);\n\t\t    }\n\t\t  const GP<IFFByteStream> giff_out(IFFByteStream::create(gstr_out));\n\t\t  IFFByteStream &iff_out=*giff_out;\n\t\t  iff_out.put_chunk(chkid);\n\t\t  iff_out.copy(*iff.get_bytestream());\n\t\t  iff_out.close_chunk();\n\t\t}\n\t      iff.close_chunk();\n\t    }\n\t}\n      file->data_pool->clear_stream();\n    }\n}\n\nGP<ByteStream>\nDjVuFile::get_anno(void)\n{\n  DEBUG_MSG(\"DjVuFile::get_text(void)\\n\");\n  GP<ByteStream> gstr(ByteStream::create());\n  get_anno(this, gstr);\n  ByteStream &str=*gstr;\n  if (!str.tell())\n  { \n    gstr=0;\n  }else\n  {\n    str.seek(0);\n  }\n  return gstr;\n}\n\nGP<ByteStream>\nDjVuFile::get_text(void)\n{\n  DEBUG_MSG(\"DjVuFile::get_text(void)\\n\");\n  GP<ByteStream> gstr(ByteStream::create());\n  get_text(this, gstr);\n  ByteStream &str=*gstr;\n  if (!str.tell())\n  { \n    gstr=0;\n  }else\n  {\n    str.seek(0);\n  }\n  return gstr;\n}\n\nGP<ByteStream>\nDjVuFile::get_meta(void)\n{\n  DEBUG_MSG(\"DjVuFile::get_meta(void)\\n\");\n  GP<ByteStream> gstr(ByteStream::create());\n  get_meta(this, gstr);\n  ByteStream &str=*gstr;\n  if (!str.tell())\n  { \n    gstr=0;\n  }else\n  {\n    str.seek(0);\n  }\n  return gstr;\n}\n\nvoid\nDjVuFile::static_trigger_cb(void * cl_data)\n{\n  DjVuFile * th=(DjVuFile *) cl_data;\n  G_TRY {\n    GP<DjVuPort> port=DjVuPort::get_portcaster()->is_port_alive(th);\n    if (port && port->inherits(\"DjVuFile\"))\n      ((DjVuFile *) (DjVuPort *) port)->trigger_cb();\n  } G_CATCH(exc) {\n    G_TRY {\n      get_portcaster()->notify_error(th, exc.get_cause());\n    } G_CATCH_ALL {} G_ENDCATCH;\n  } G_ENDCATCH;\n}\n\nvoid\nDjVuFile::trigger_cb(void)\n{\n  GP<DjVuFile> life_saver=this;\n  \n  DEBUG_MSG(\"DjVuFile::trigger_cb(): got data for '\" << url << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n  \n  file_size=data_pool->get_length();\n  flags|=DATA_PRESENT;\n  get_portcaster()->notify_file_flags_changed(this, DATA_PRESENT, 0);\n  \n  if (!are_incl_files_created())\n    process_incl_chunks();\n  \n  bool all=true;\n  inc_files_lock.lock();\n  GPList<DjVuFile> files_list=inc_files_list;\n  inc_files_lock.unlock();\n  for(GPosition pos=files_list;pos&&(all=files_list[pos]->is_all_data_present());++pos)\n    EMPTY_LOOP;\n  if (all)\n  {\n    DEBUG_MSG(\"DjVuFile::trigger_cb(): We have ALL data for '\" << url << \"'\\n\");\n    flags|=ALL_DATA_PRESENT;\n    get_portcaster()->notify_file_flags_changed(this, ALL_DATA_PRESENT, 0);\n  }\n}\n\nvoid\nDjVuFile::progress_cb(int pos, void * cl_data)\n{\n  DEBUG_MSG(\"DjVuFile::progress_cb() called\\n\");\n  DEBUG_MAKE_INDENT(3);\n  \n  DjVuFile * th=(DjVuFile *) cl_data;\n  \n  int length=th->decode_data_pool->get_length();\n  if (length>0)\n  {\n    float progress=(float) pos/length;\n    DEBUG_MSG(\"progress=\" << progress << \"\\n\");\n    get_portcaster()->notify_decode_progress(th, progress);\n  } else\n  {\n    DEBUG_MSG(\"DataPool size is still unknown => ignoring\\n\");\n  }\n}\n\n//*****************************************************************************\n//******************************** Utilities **********************************\n//*****************************************************************************\n\nvoid\nDjVuFile::move(GMap<GURL, void *> & map, const GURL & dir_url)\n// This function may block for data.\n{\n  if (!map.contains(url))\n  {\n    map[url]=0;\n    \n    url=GURL::UTF8(url.name(),dir_url);\n    \n    \n    // Leave the lock here!\n    GCriticalSectionLock lock(&inc_files_lock);\n    for(GPosition pos=inc_files_list;pos;++pos)\n      inc_files_list[pos]->move(map, dir_url);\n  }\n}\n\nvoid\nDjVuFile::move(const GURL & dir_url)\n// This function may block for data.\n{\n  check();\n  DEBUG_MSG(\"DjVuFile::move(): dir_url='\" << dir_url << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n  \n  GMap<GURL, void *> map;\n  move(map, dir_url);\n}\n\nvoid\nDjVuFile::set_name(const GUTF8String &name)\n{\n  DEBUG_MSG(\"DjVuFile::set_name(): name='\" << name << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n  url=GURL::UTF8(name,url.base());\n}\n\n//*****************************************************************************\n//****************************** Data routines ********************************\n//*****************************************************************************\n\nint\nDjVuFile::get_chunks_number(void)\n{\n  if(chunks_number < 0)\n  {\n    const GP<ByteStream> str(data_pool->get_stream());\n    GUTF8String chkid;\n    const GP<IFFByteStream> giff(IFFByteStream::create(str));\n    IFFByteStream &iff=*giff;\n    if (!iff.get_chunk(chkid))\n      REPORT_EOF(true)\n      \n      int chunks=0;\n    int last_chunk=0;\n    G_TRY\n    {\n      int chksize;\n      for(;(chksize=iff.get_chunk(chkid));last_chunk=chunks)\n      {\n        chunks++;\n        iff.seek_close_chunk();\n      }\n      chunks_number=last_chunk;\n    }\n    G_CATCH(ex)\n    {\n      chunks_number=(recover_errors>SKIP_CHUNKS)?chunks:last_chunk;\n      report_error(ex,(recover_errors<=SKIP_PAGES));\n    }\n    G_ENDCATCH;\n    data_pool->clear_stream();\n  }\n  return chunks_number;\n}\n\nGUTF8String\nDjVuFile::get_chunk_name(int chunk_num)\n{\n  if(chunk_num < 0)\n  {\n    G_THROW( ERR_MSG(\"DjVuFile.illegal_chunk\") );\n  }\n  if((chunks_number >= 0)&&(chunk_num > chunks_number))\n  {\n    G_THROW( ERR_MSG(\"DjVuFile.missing_chunk\") );\n  }\n  check();\n  \n  GUTF8String name;\n  const GP<ByteStream> str(data_pool->get_stream());\n  GUTF8String chkid;\n  const GP<IFFByteStream> giff(IFFByteStream::create(str));\n  IFFByteStream &iff=*giff;\n  if (!iff.get_chunk(chkid)) \n    REPORT_EOF(true)\n    \n    int chunks=0;\n  int last_chunk=0;\n  G_TRY\n  {\n    int chunks_left=(recover_errors>SKIP_PAGES)?chunks_number:(-1);\n    int chksize;\n    for(;(chunks_left--)&&(chksize=iff.get_chunk(chkid));last_chunk=chunks)\n    {\n      if (chunks++==chunk_num) { name=chkid; break; }\n      iff.seek_close_chunk();\n    }\n  }\n  G_CATCH(ex)\n  {\n    if (chunks_number < 0)\n      chunks_number=(recover_errors>SKIP_CHUNKS)?chunks:last_chunk;\n    report_error(ex,(recover_errors <= SKIP_PAGES));\n  }\n  G_ENDCATCH;\n  if (!name.length())\n  {\n    if (chunks_number < 0) chunks_number=chunks;\n    G_THROW( ERR_MSG(\"DjVuFile.missing_chunk\") );\n  }\n  return name;\n}\n\nbool\nDjVuFile::contains_chunk(const GUTF8String &chunk_name)\n{\n  check();\n  DEBUG_MSG(\"DjVuFile::contains_chunk(): url='\" << url << \"', chunk_name='\" <<\n    chunk_name << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n  \n  bool contains=0;\n  const GP<ByteStream> str(data_pool->get_stream());\n  GUTF8String chkid;\n  const GP<IFFByteStream> giff(IFFByteStream::create(str));\n  IFFByteStream &iff=*giff;\n  if (!iff.get_chunk(chkid)) \n    REPORT_EOF((recover_errors<=SKIP_PAGES))\n    \n    int chunks=0;\n  int last_chunk=0;\n  G_TRY\n  {\n    int chunks_left=(recover_errors>SKIP_PAGES)?chunks_number:(-1);\n    int chksize;\n    for(;(chunks_left--)&&(chksize=iff.get_chunk(chkid));last_chunk=chunks)\n    {\n      chunks++;\n      if (chkid==chunk_name) { contains=1; break; }\n      iff.seek_close_chunk();\n    }\n    if (!contains &&(chunks_number < 0)) chunks_number=last_chunk;\n  }\n  G_CATCH(ex)\n  {\n    if (chunks_number < 0)\n      chunks_number=(recover_errors>SKIP_CHUNKS)?chunks:last_chunk;\n    report_error(ex,(recover_errors <= SKIP_PAGES));\n  }\n  G_ENDCATCH;\n  data_pool->clear_stream();\n  return contains;\n}\n\nbool\nDjVuFile::contains_anno(void)\n{\n  const GP<ByteStream> str(data_pool->get_stream());\n  \n  GUTF8String chkid;\n  const GP<IFFByteStream> giff(IFFByteStream::create(str));\n  IFFByteStream &iff=*giff;\n  if (!iff.get_chunk(chkid))\n    G_THROW( ByteStream::EndOfFile );\n  \n  while(iff.get_chunk(chkid))\n  {\n    if (is_annotation(chkid))\n      return true;\n    iff.close_chunk();\n  }\n  \n  data_pool->clear_stream();\n  return false;\n}\n\nbool\nDjVuFile::contains_text(void)\n{\n  const GP<ByteStream> str(data_pool->get_stream());\n  \n  GUTF8String chkid;\n  const GP<IFFByteStream> giff(IFFByteStream::create(str));\n  IFFByteStream &iff=*giff;\n  if (!iff.get_chunk(chkid))\n    G_THROW( ByteStream::EndOfFile );\n  \n  while(iff.get_chunk(chkid))\n  {\n    if (is_text(chkid))\n      return true;\n    iff.close_chunk();\n  }\n  \n  data_pool->clear_stream();\n  return false;\n}\n\nbool\nDjVuFile::contains_meta(void)\n{\n  const GP<ByteStream> str(data_pool->get_stream());\n  \n  GUTF8String chkid;\n  const GP<IFFByteStream> giff(IFFByteStream::create(str));\n  IFFByteStream &iff=*giff;\n  if (!iff.get_chunk(chkid))\n    G_THROW( ByteStream::EndOfFile );\n  \n  while(iff.get_chunk(chkid))\n  {\n    if (is_meta(chkid))\n      return true;\n    iff.close_chunk();\n  }\n  \n  data_pool->clear_stream();\n  return false;\n}\n\n//*****************************************************************************\n//****************************** Save routines ********************************\n//*****************************************************************************\n\nstatic void\ncopy_chunks(const GP<ByteStream> &from, IFFByteStream &ostr)\n{\n  from->seek(0);\n  const GP<IFFByteStream> giff(IFFByteStream::create(from));\n  IFFByteStream &iff=*giff;\n  GUTF8String chkid;\n  int chksize;\n  while ((chksize=iff.get_chunk(chkid)))\n  {\n    ostr.put_chunk(chkid);\n    int ochksize=ostr.copy(*iff.get_bytestream());\n    ostr.close_chunk();\n    iff.seek_close_chunk();\n    if(ochksize != chksize)\n    {\n      G_THROW( ByteStream::EndOfFile );\n    }\n  }\n}\n\n\nvoid\nDjVuFile::add_djvu_data(IFFByteStream & ostr, GMap<GURL, void *> & map,\n                        const bool included_too, const bool no_ndir)\n{\n  check();\n  if (map.contains(url)) return;\n  bool top_level = !map.size();\n  map[url]=0;\n  bool processed_annotation = false;\n  bool processed_text = false;\n  bool processed_meta = false;\n  \n  const GP<ByteStream> str(data_pool->get_stream());\n  GUTF8String chkid;\n  const GP<IFFByteStream> giff(IFFByteStream::create(str));\n  IFFByteStream &iff=*giff;\n  if (!iff.get_chunk(chkid)) \n    REPORT_EOF(true)\n    \n    // Open toplevel form\n    if (top_level) \n      ostr.put_chunk(chkid);\n    // Process chunks\n    int chunks=0;\n    int last_chunk=0;\n    G_TRY\n    {\n      int chunks_left=(recover_errors>SKIP_PAGES)?chunks_number:(-1);\n      int chksize;\n      for(;(chunks_left--)&&(chksize = iff.get_chunk(chkid));last_chunk=chunks)\n      {\n        chunks++;\n        if (is_info(chkid) && info)\n        {\n          ostr.put_chunk(chkid);\n          info->encode(*ostr.get_bytestream());\n          ostr.close_chunk();\n        }\n        else if (chkid==\"INCL\" && included_too)\n        {\n          GP<DjVuFile> file = process_incl_chunk(*iff.get_bytestream());\n          if (file)\n          {\n            if(recover_errors!=ABORT)\n              file->set_recover_errors(recover_errors);\n            if(verbose_eof)\n              file->set_verbose_eof(verbose_eof);\n            file->add_djvu_data(ostr, map, included_too, no_ndir);\n          }\n        } \n        else if (is_annotation(chkid) && anno && anno->size())\n        {\n          if (!processed_annotation)\n          {\n            processed_annotation = true;\n            GCriticalSectionLock lock(&anno_lock);\n            copy_chunks(anno, ostr);\n          }\n        }\n        else if (is_text(chkid) && text && text->size())\n        {\n          if (!processed_text)\n          {\n            processed_text = true;\n            GCriticalSectionLock lock(&text_lock);\n            copy_chunks(text, ostr);\n          }\n        }\n        else if (is_meta(chkid) && meta && meta->size())\n        {\n          if (!processed_meta)\n          {\n            processed_meta = true;\n            GCriticalSectionLock lock(&meta_lock);\n            copy_chunks(meta, ostr);\n          }\n        }\n        else if (chkid!=\"NDIR\"||!(no_ndir || dir))\n        {  // Copy NDIR chunks, but never generate new ones.\n          ostr.put_chunk(chkid);\n          ostr.copy(*iff.get_bytestream());\n          ostr.close_chunk();\n        }\n        iff.seek_close_chunk();\n      }\n      if (chunks_number < 0) chunks_number=last_chunk;\n    }\n    G_CATCH(ex)\n    {\n      if(!ex.cmp_cause(ByteStream::EndOfFile))\n      {\n        if (chunks_number < 0)\n          chunks_number=(recover_errors>SKIP_CHUNKS)?chunks:last_chunk;\n        report_error(ex,(recover_errors<=SKIP_PAGES));\n      }else\n      {\n        report_error(ex,true);\n      }\n    }\n    G_ENDCATCH;\n    \n    // Otherwise, writes annotation at the end (annotations could be big)\n    if (!processed_annotation && anno && anno->size())\n    {\n      processed_annotation = true;\n      GCriticalSectionLock lock(&anno_lock);\n      copy_chunks(anno, ostr);\n    }\n    if (!processed_text && text && text->size())\n    {\n      processed_text = true;\n      GCriticalSectionLock lock(&text_lock);\n      copy_chunks(text, ostr);\n    }\n    if (!processed_meta && meta && meta->size())\n    {\n      processed_meta = true;\n      GCriticalSectionLock lock(&meta_lock);\n      copy_chunks(meta, ostr);\n    }\n    // Close iff\n    if (top_level) \n      ostr.close_chunk();\n\n  data_pool->clear_stream();\n}\n\nGP<ByteStream>  \nDjVuFile::get_djvu_bytestream(const bool included_too, const bool no_ndir)\n{\n   check();\n   DEBUG_MSG(\"DjVuFile::get_djvu_bytestream(): creating DjVu raw file\\n\");\n   DEBUG_MAKE_INDENT(3);\n   const GP<ByteStream> pbs(ByteStream::create());\n   const GP<IFFByteStream> giff=IFFByteStream::create(pbs);\n   IFFByteStream &iff=*giff;\n   GMap<GURL, void *> map;\n   add_djvu_data(iff, map, included_too, no_ndir);\n   iff.flush();\n   pbs->seek(0, SEEK_SET);\n   return pbs;\n}\n\nGP<DataPool>\nDjVuFile::get_djvu_data(const bool included_too, const bool no_ndir)\n{\n  const GP<ByteStream> pbs = get_djvu_bytestream(included_too, no_ndir);\n  return DataPool::create(pbs);\n}\n\nvoid\nDjVuFile::merge_anno(ByteStream &out)\n{\n  // Reuse get_merged_anno(), which is better than the previous\n  // implementation due to three things:\n  //  1. It works even before the file is completely decoded\n  //  2. It merges annotations taking into account where a child DjVuFile\n  //     is included.\n  //  3. It handles loops in DjVuFile's hierarchy\n  \n  const GP<ByteStream> str(get_merged_anno());\n  if (str)\n  {\n    str->seek(0);\n    if (out.tell())\n    {\n      out.write((void *) \"\", 1);\n    }\n    out.copy(*str);\n  }\n}\n\nvoid\nDjVuFile::get_text(ByteStream &out)\n{\n  const GP<ByteStream> str(get_text());\n  if (str)\n  {\n    str->seek(0);\n    if (out.tell())\n    {\n      out.write((void *) \"\", 1);\n    }\n    out.copy(*str);\n  }\n}\n\nvoid\nDjVuFile::get_meta(ByteStream &out)\n{\n  const GP<ByteStream> str(get_meta());\n  if (str)\n  {\n    str->seek(0);\n    if (out.tell())\n    {\n      out.write((void *) \"\", 1);\n    }\n    out.copy(*str);\n  }\n}\n\n\n\n//****************************************************************************\n//******************************* Modifying **********************************\n//****************************************************************************\n\nvoid\nDjVuFile::remove_anno(void)\n{\n  DEBUG_MSG(\"DjVuFile::remove_anno()\\n\");\n  const GP<ByteStream> str_in(data_pool->get_stream());\n  const GP<ByteStream> gstr_out(ByteStream::create());\n  \n  GUTF8String chkid;\n  const GP<IFFByteStream> giff_in(IFFByteStream::create(str_in));\n  IFFByteStream &iff_in=*giff_in;\n  if (!iff_in.get_chunk(chkid))\n    G_THROW( ByteStream::EndOfFile );\n  \n  const GP<IFFByteStream> giff_out(IFFByteStream::create(gstr_out));\n  IFFByteStream &iff_out=*giff_out;\n  iff_out.put_chunk(chkid);\n  \n  while(iff_in.get_chunk(chkid))\n  {\n    if (!is_annotation(chkid))\n    {\n      iff_out.put_chunk(chkid);\n      iff_out.copy(*iff_in.get_bytestream());\n      iff_out.close_chunk();\n    }\n    iff_in.close_chunk();\n  }\n  \n  iff_out.close_chunk();\n  \n  gstr_out->seek(0, SEEK_SET);\n  data_pool=DataPool::create(gstr_out);\n  chunks_number=-1;\n  \n  anno=0;\n  \n  flags|=MODIFIED;\n  data_pool->clear_stream();\n}\n\nvoid\nDjVuFile::remove_text(void)\n{\n  DEBUG_MSG(\"DjVuFile::remove_text()\\n\");\n  const GP<ByteStream> str_in(data_pool->get_stream());\n  const GP<ByteStream> gstr_out(ByteStream::create());\n  \n  GUTF8String chkid;\n  const GP<IFFByteStream> giff_in(IFFByteStream::create(str_in));\n  IFFByteStream &iff_in=*giff_in;\n  if (!iff_in.get_chunk(chkid))\n    G_THROW( ByteStream::EndOfFile );\n  \n  const GP<IFFByteStream> giff_out(IFFByteStream::create(gstr_out));\n  IFFByteStream &iff_out=*giff_out;\n  iff_out.put_chunk(chkid);\n  \n  while(iff_in.get_chunk(chkid))\n  {\n    if (!is_text(chkid))\n    {\n      iff_out.put_chunk(chkid);\n      iff_out.copy(*iff_in.get_bytestream());\n      iff_out.close_chunk();\n    }\n    iff_in.close_chunk();\n  }\n  \n  iff_out.close_chunk();\n  \n  gstr_out->seek(0, SEEK_SET);\n  data_pool=DataPool::create(gstr_out);\n  chunks_number=-1;\n  \n  text=0;\n  \n  flags|=MODIFIED;\n  data_pool->clear_stream();\n}\n\nvoid\nDjVuFile::remove_meta(void)\n{\n  DEBUG_MSG(\"DjVuFile::remove_meta()\\n\");\n  const GP<ByteStream> str_in(data_pool->get_stream());\n  const GP<ByteStream> gstr_out(ByteStream::create());\n  \n  GUTF8String chkid;\n  const GP<IFFByteStream> giff_in(IFFByteStream::create(str_in));\n  IFFByteStream &iff_in=*giff_in;\n  if (!iff_in.get_chunk(chkid))\n    G_THROW( ByteStream::EndOfFile );\n  \n  const GP<IFFByteStream> giff_out(IFFByteStream::create(gstr_out));\n  IFFByteStream &iff_out=*giff_out;\n  iff_out.put_chunk(chkid);\n  \n  while(iff_in.get_chunk(chkid))\n  {\n    if (!is_meta(chkid))\n    {\n      iff_out.put_chunk(chkid);\n      iff_out.copy(*iff_in.get_bytestream());\n      iff_out.close_chunk();\n    }\n    iff_in.close_chunk();\n  }\n  \n  iff_out.close_chunk();\n  \n  gstr_out->seek(0, SEEK_SET);\n  data_pool=DataPool::create(gstr_out);\n  chunks_number=-1;\n  \n  meta=0;\n  \n  flags|=MODIFIED;\n  data_pool->clear_stream();\n}\n\nvoid\nDjVuFile::rebuild_data_pool(void)\n{\n  data_pool=get_djvu_data(false,false);\n  chunks_number=1;\n  flags|=MODIFIED;\n}\n\n// Do NOT comment this function out. It's used by DjVuDocEditor to convert\n// old-style DjVu documents to BUNDLED format.\n\nGP<DataPool>\nDjVuFile::unlink_file(const GP<DataPool> & data, const GUTF8String &name)\n// Will process contents of data[] and remove any INCL chunk\n// containing 'name'\n{\n  DEBUG_MSG(\"DjVuFile::unlink_file()\\n\");\n  const GP<ByteStream> gstr_out(ByteStream::create());\n  const GP<IFFByteStream> giff_out(IFFByteStream::create(gstr_out));\n  IFFByteStream &iff_out=*giff_out;\n  \n  const GP<ByteStream> str_in(data->get_stream());\n  const GP<IFFByteStream> giff_in(IFFByteStream::create(str_in));\n  IFFByteStream &iff_in=*giff_in;\n  \n  int chksize;\n  GUTF8String chkid;\n  if (!iff_in.get_chunk(chkid)) return data;\n  \n  iff_out.put_chunk(chkid);\n  \n  while((chksize=iff_in.get_chunk(chkid)))\n  {\n    if (chkid==\"INCL\")\n    {\n      GUTF8String incl_str;\n      char buffer[1024];\n      int length;\n      while((length=iff_in.read(buffer, 1024)))\n        incl_str+=GUTF8String(buffer, length);\n      \n      // Eat '\\n' in the beginning and at the end\n      while(incl_str.length() && incl_str[0]=='\\n')\n      {\n        incl_str=incl_str.substr(1,(unsigned int)(-1));\n      }\n      while(incl_str.length()>0 && incl_str[(int)incl_str.length()-1]=='\\n')\n      {\n        incl_str.setat(incl_str.length()-1, 0);\n      }\n      if (incl_str!=name)\n      {\n        iff_out.put_chunk(chkid);\n        iff_out.get_bytestream()->writestring(incl_str);\n        iff_out.close_chunk();\n      }\n    } else\n    {\n      iff_out.put_chunk(chkid);\n      char buffer[1024];\n      int length;\n      for(const GP<ByteStream> gbs(iff_out.get_bytestream());\n        (length=iff_in.read(buffer, 1024));)\n      {\n        gbs->writall(buffer, length);\n      }\n      iff_out.close_chunk();\n    }\n    iff_in.close_chunk();\n  }\n  iff_out.close_chunk();\n  iff_out.flush();\n  gstr_out->seek(0, SEEK_SET);\n  data->clear_stream();\n  return DataPool::create(gstr_out);\n}\n\n#ifndef NEED_DECODER_ONLY\nvoid\nDjVuFile::insert_file(const GUTF8String &id, int chunk_num)\n{\n  DEBUG_MSG(\"DjVuFile::insert_file(): id='\" << id << \"', chunk_num=\"\n    << chunk_num << \"\\n\");\n  DEBUG_MAKE_INDENT(3);\n  \n  // First: create new data\n  const GP<ByteStream> str_in(data_pool->get_stream());\n  const GP<IFFByteStream> giff_in(IFFByteStream::create(str_in));\n  IFFByteStream &iff_in=*giff_in;\n  \n  const GP<ByteStream> gstr_out(ByteStream::create());\n  const GP<IFFByteStream> giff_out(IFFByteStream::create(gstr_out));\n  IFFByteStream &iff_out=*giff_out;\n  \n  int chunk_cnt=0;\n  bool done=false;\n  GUTF8String chkid;\n  if (iff_in.get_chunk(chkid))\n  {\n    iff_out.put_chunk(chkid);\n    int chksize;\n    while((chksize=iff_in.get_chunk(chkid)))\n    {\n      if (chunk_cnt++==chunk_num)\n      {\n        iff_out.put_chunk(\"INCL\");\n        iff_out.get_bytestream()->writestring(id);\n        iff_out.close_chunk();\n        done=true;\n      }\n      iff_out.put_chunk(chkid);\n      iff_out.copy(*iff_in.get_bytestream());\n      iff_out.close_chunk();\n      iff_in.close_chunk();\n    }\n    if (!done)\n    {\n      iff_out.put_chunk(\"INCL\");\n      iff_out.get_bytestream()->writestring(id);\n      iff_out.close_chunk();\n    }\n    iff_out.close_chunk();\n  }\n  gstr_out->seek(0, SEEK_SET);\n  data_pool=DataPool::create(gstr_out);\n  chunks_number=-1;\n  \n  // Second: create missing DjVuFiles\n  process_incl_chunks();\n  \n  flags|=MODIFIED;\n  data_pool->clear_stream();\n}\n#endif\n\nvoid\nDjVuFile::unlink_file(const GUTF8String &id)\n{\n  DEBUG_MSG(\"DjVuFile::insert_file(): id='\" << id << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n  \n  // Remove the file from the list of included files\n  {\n    GURL url=DjVuPort::get_portcaster()->id_to_url(this, id);\n    if (url.is_empty()) url=GURL::UTF8(id,this->url.base());\n    GCriticalSectionLock lock(&inc_files_lock);\n    for(GPosition pos=inc_files_list;pos;)\n      if (inc_files_list[pos]->get_url()==url)\n      {\n        GPosition this_pos=pos;\n        ++pos;\n        inc_files_list.del(this_pos);\n      } else ++pos;\n  }\n  \n  // And update the data.\n  const GP<ByteStream> str_in(data_pool->get_stream());\n  const GP<IFFByteStream> giff_in(IFFByteStream::create(str_in));\n  IFFByteStream &iff_in=*giff_in;\n  \n  const GP<ByteStream> gstr_out(ByteStream::create());\n  const GP<IFFByteStream> giff_out(IFFByteStream::create(gstr_out));\n  IFFByteStream &iff_out=*giff_out;\n  \n  GUTF8String chkid;\n  if (iff_in.get_chunk(chkid))\n  {\n    iff_out.put_chunk(chkid);\n    int chksize;\n    while((chksize=iff_in.get_chunk(chkid)))\n    {\n      if (chkid!=\"INCL\")\n      {\n        iff_out.put_chunk(chkid);\n        iff_out.copy(*iff_in.get_bytestream());\n        iff_out.close_chunk();\n      } else\n      {\n        GUTF8String incl_str;\n        char buffer[1024];\n        int length;\n        while((length=iff_in.read(buffer, 1024)))\n          incl_str+=GUTF8String(buffer, length);\n        \n\t       // Eat '\\n' in the beginning and at the end\n        while(incl_str.length() && incl_str[0]=='\\n')\n        {\n          incl_str=incl_str.substr(1,(unsigned int)(-1));\n        }\n        while(incl_str.length()>0 && incl_str[(int)incl_str.length()-1]=='\\n')\n          incl_str.setat(incl_str.length()-1, 0);\n        if (incl_str!=id)\n        {\n          iff_out.put_chunk(\"INCL\");\n          iff_out.get_bytestream()->writestring(incl_str);\n          iff_out.close_chunk();\n        }\n      }\n      iff_in.close_chunk();\n    }\n    iff_out.close_chunk();\n  }\n  \n  gstr_out->seek(0, SEEK_SET);\n  data_pool=DataPool::create(gstr_out);\n  chunks_number=-1;\n  \n  flags|=MODIFIED;\n}\n\nvoid\nDjVuFile::change_info(GP<DjVuInfo> xinfo,const bool do_reset)\n{\n  DEBUG_MSG(\"DjVuFile::change_text()\\n\");\n  // Mark this as modified\n  set_modified(true);\n  if(do_reset)\n    reset();\n  info=xinfo;\n}\n\n#ifndef NEED_DECODER_ONLY\nvoid\nDjVuFile::change_text(GP<DjVuTXT> txt,const bool do_reset)\n{\n  DEBUG_MSG(\"DjVuFile::change_text()\\n\");\n  GP<DjVuText> gtext_c=DjVuText::create();\n  DjVuText &text_c=*gtext_c;\n  if(contains_text())\n  {\n    const GP<ByteStream> file_text(get_text());\n    if(file_text)\n    {\n      text_c.decode(file_text);\n    }\n  }\n  GCriticalSectionLock lock(&text_lock);\n  // Mark this as modified\n  set_modified(true);\n  if(do_reset)\n    reset();\n  text_c.txt = txt;\n  text=ByteStream::create();\n  text_c.encode(text);\n}\n\nvoid\nDjVuFile::change_meta(const GUTF8String &xmeta,const bool do_reset)\n{\n  DEBUG_MSG(\"DjVuFile::change_meta()\\n\");\n  // Mark this as modified\n  set_modified(true);\n  if(contains_meta())\n  {\n    (void)get_meta();\n  }\n  if(do_reset)\n    reset();\n  GCriticalSectionLock lock(&meta_lock);\n  meta=ByteStream::create();\n  if(xmeta.length())\n  {\n    const GP<IFFByteStream> giff=IFFByteStream::create(meta);\n    IFFByteStream &iff=*giff;\n    iff.put_chunk(\"METz\");\n    {\n      GP<ByteStream> gbsiff=BSByteStream::create(iff.get_bytestream(),50);\n      gbsiff->writestring(xmeta);\n    }\n    iff.close_chunk();\n  }\n}\n#endif\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVuFile.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _DJVUFILE_H\n#define _DJVUFILE_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n#include \"DjVuInfo.h\"\n#include \"DjVuPalette.h\"\n#include \"DjVuPort.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass DjVuTXT;\nclass ByteStream;\nclass DataPool;\nclass JB2Image;\nclass JB2Dict;\nclass IW44Image;\nclass IFFByteStream;\nclass GPixmap;\nclass DjVuNavDir;\n\n\n/** @name DjVuFile.h\n    Files #\"DjVuFile.h\"# and #\"DjVuFile.cpp\"# contain implementation of the\n    \\Ref{DjVuFile} class, which takes the leading role in decoding of\n    \\Ref{DjVuImage}s.\n\n    In the previous releases of the library the work of decoding has been\n    entirely done in \\Ref{DjVuImage}. Now, due to the introduction of multipage\n    documents, the decoding procedure became significantly more complex and\n    has been moved out from \\Ref{DjVuImage} into \\Ref{DjVuFile}.\n\n    There is not much point though in creating just \\Ref{DjVuFile} alone.\n    The maximum power of the decoder is achieved when you create the\n    \\Ref{DjVuDocument} and work with {\\bf it} when decoding the image.\n\n    @memo Classes representing DjVu files.\n    @author Andrei Erofeev <eaf@geocities.com>\n*/\n\n//@{\n\n/** #DjVuFile# plays the central role in decoding \\Ref{DjVuImage}s.\n    First of all, it represents a DjVu file whether it's part of a\n    multipage all-in-one-file DjVu document, or part of a multipage\n    DjVu document where every page is in a separate file, or the whole\n    single page document. #DjVuFile# can read its contents from a file\n    and store it back when necessary.\n\n    Second, #DjVuFile# does the greatest part of decoding work. In the\n    past this was the responsibility of \\Ref{DjVuImage}. Now, with the\n    introduction of the multipage DjVu formats, the decoding routines\n    have been extracted from the \\Ref{DjVuImage} and put into this separate\n    class #DjVuFile#.\n\n    As \\Ref{DjVuImage} before, #DjVuFile# now contains public class\n    variables corresponding to every component, that can ever be decoded\n    from a DjVu file (such as #INFO# chunk, #BG44# chunk, #SJBZ# chunk, etc.).\n\n    As before, the decoding is initiated by a single function\n    (\\Ref{start_decode}() in this case, and \\Ref{DjVuImage::decode}() before).\n    The difference is that #DjVuFile# now handles threads creation itself.\n    When you call the \\Ref{start_decode}() function, it creates the decoding\n    thread, which starts decoding, and which can create additional threads:\n    one per each file included into this one.\n\n    {\\bf Inclusion} is also a new feature specifically designed for a\n    multipage document. Indeed, inside a given document there can be a lot\n    of things shared between its pages. Examples can be the document\n    annotation (\\Ref{DjVuAnno}) and other things like shared shapes and\n    dictionary (to be implemented). To avoid putting these chunks into\n    every page, we have invented new chunk called #INCL# which purpose is\n    to make the decoder open the specified file and decode it.\n    \n    {\\bf Source of data.} The #DjVuFile# can be initialized in two ways:\n    \\begin{itemize}\n       \\item With #URL# and \\Ref{DjVuPort}. In this case #DjVuFile# will\n             request its data thru the communication mechanism provided by\n\t     \\Ref{DjVuPort} in the constructor. If this file references\n\t     (includes) any other file, data for them will also be requested\n\t     in the same way.\n       \\item With \\Ref{ByteStream}. In this case the #DjVuFile# will read\n             its data directly from the passed stream. This constructor\n\t     has been added to simplify creation of #DjVuFile#s, which do\n\t     no include anything else. In this case the \\Ref{ByteStream}\n\t     is enough for the #DjVuFile# to initialize.\n    \\end{itemize}\n\t     \n    {\\bf Progress information.} #DjVuFile# does not do decoding silently.\n    Instead, it sends a whole set of notifications through the mechanism\n    provided by \\Ref{DjVuPort} and \\Ref{DjVuPortcaster}. It tells the user\n    of the class about the progress of the decoding, about possible errors,\n    chunk being decoded, etc. The data is requested using this mechanism too.\n\n    {\\bf Creating.} Depending on where you have data of the DjVu file, the\n    #DjVuFile# can be initialized in two ways:\n    \\begin{itemize}\n       \\item By providing #URL# and pointer to \\Ref{DjVuPort}. In this case\n             #DjVuFile# will request data using communication mechanism\n\t     provided by \\Ref{DjVuPort}. This is useful when the data is on\n\t     the web or when this file includes other files.\n       \\item By providing a \\Ref{ByteStream} with the data for the file. Use\n             it only when the file doesn't include other files.\n    \\end{itemize}\n    There is also a bunch of functions provided for composing\n    the desired \\Ref{DjVuDocument} and modifying #DjVuFile# structure. The\n    examples are \\Ref{delete_chunks}(), \\Ref{insert_chunk}(),\n    \\Ref{include_file}() and \\Ref{unlink_file}().\n\n    {\\bf Caching.} In the case of plugin it's important to do the caching\n    of decoded images or files. #DjVuFile# appears to be the best candidate\n    for caching, and that's why it supports this procedure. Whenever a\n    #DjVuFile# is successfully decoded, it's added to the cache by\n    \\Ref{DjVuDocument}. Next time somebody needs it, it will be extracted\n    from the cache directly by \\Ref{DjVuDocument} and won't be decoded again.\n\n    {\\bf URLs.} Historically the biggest strain is put on making the decoder\n    available for Netscape and IE plugins where the original files reside\n    somewhere in the net. That is why #DjVuFile# uses {\\bf URLs} to\n    identify itself and other files. If you're working with files on the\n    hard disk, you have to use the local URLs instead of file names.\n    A good way to do two way conversion is the \\Ref{GOS} class. Sometimes it\n    happens that a given file does not reside anywhere but the memory. No\n    problem in this case either. There is a special port \\Ref{DjVuMemoryPort},\n    which can associate any URL with the corresponding data in the memory.\n    All you need to do is to invent your own URL prefix for this case.\n    \"#memory:#\" will do. The usage of absolute URLs has many advantages among\n    which is the capability to cache files with their URL being the cache key.\n\n    Please note, that the #DjVuFile# class has been designed to work closely\n    with \\Ref{DjVuDocument}. So please review the documentation on this class\n    too. */\n\nclass DJVUAPI DjVuFile : public DjVuPort\n{\npublic:\n   enum { DECODING=1, DECODE_OK=2, DECODE_FAILED=4, DECODE_STOPPED=8,\n\t  DATA_PRESENT=16, ALL_DATA_PRESENT=32, INCL_FILES_CREATED=64,\n          MODIFIED=128, DONT_START_DECODE=256, STOPPED=512,\n\t  BLOCKED_STOPPED=1024, CAN_COMPRESS=2048, NEEDS_COMPRESSION=4096 };\n   enum { STARTED=1, FINISHED=2 };\n\n      /** @name Decoded file contents */\n      //@{\n      /// Pointer to the DjVu file information component.\n   GP<DjVuInfo>\t\tinfo;\n      /// Pointer to the background component of DjVu image (IW44 encoded).\n   GP<IW44Image>\tbg44;\n      /// Pointer to the background component of DjVu image (Raw).\n   GP<GPixmap>\t\tbgpm;\n      /// Pointer to the mask of foreground component of DjVu image (JB2 encoded).\n   GP<JB2Image>\t\tfgjb;\n      /// Pointer to the optional shape dictionary for the mask (JB2 encoded).\n   GP<JB2Dict>\t\tfgjd;\n      /// Pointer to a colors layer for the foreground component of DjVu image.\n   GP<GPixmap>\t\tfgpm;\n      /// Pointer to a colors vector for the foreground component of DjVu image.\n   GP<DjVuPalette>\tfgbc;\n      /// Pointer to collected annotation chunks.\n   GP<ByteStream>\tanno;\n      /// Pointer to collected hiddentext chunks.\n   GP<ByteStream>\ttext;\n      /// Pointer to meta data chunks.\n   GP<ByteStream>\tmeta;\n      /// Pointer to the *old* navigation directory contained in this file\n   GP<DjVuNavDir>\tdir;\n      /// Description of the file formed during decoding\n   GUTF8String\t\tdescription;\n      /// MIME type string describing the DjVu data.\n   GUTF8String\t\tmimetype;\n      /// Size of the file.\n   int\t\t\tfile_size;\n      //@}\n\nprotected:\n      /** Default constructor.  Must follow with an init() */\n   DjVuFile(void);\npublic:\n   virtual ~DjVuFile(void);\n\n      /** Initializes a #DjVuFile# object. This is a simplified initializer,\n\t  which is not supposed to be used for decoding or creating\n\t  #DjVuFile#s, which include other files.\n\n\t  If the file is stored on the hard drive, you may also use the\n\t  other constructor and pass it the file's URL and #ZERO# #port#.\n\t  The #DjVuFile# will read the data itself.\n\n\t  If you want to receive error messages and notifications, you\n\t  may connect the #DjVuFile# to your own \\Ref{DjVuPort} after\n\t  it has been constructed.\n\n\t  @param str The stream containing data for the file. */\n   void init(const GP<ByteStream> & str);\n\n      /** Creator, does the init(ByteStream &str) */\n   static GP<DjVuFile> create( const GP<ByteStream> & str,\n     const ErrorRecoveryAction recover_action=ABORT,\n     const bool verbose_eof=true);\n   \n      /** Initializes a #DjVuFile# object. As you can notice, the data is not\n\t  directly passed to this function. The #DjVuFile# will ask for it\n\t  through the \\Ref{DjVuPort} mechanism before the constructor\n\t  finishes. If the data is stored locally on the hard disk then the\n\t  pointer to \\Ref{DjVuPort} may be set to #ZERO#, which will make\n\t  #DjVuFile# read all data from the hard disk and report all errors\n\t  to #stderr#.\n\n\t  {\\bf Note}. If the file includes (by means of #INCL# chunks) other\n\t  files then you should be ready to\n\t  \\begin{enumerate}\n\t     \\item Reply to requests \\Ref{DjVuPort::id_to_url}() issued to\n\t           translate IDs (used in #INCL# chunks) to absolute URLs.\n\t\t   Usually, when the file is created by \\Ref{DjVuDocument}\n\t\t   this job is done by it. If you construct such a file\n\t\t   manually, be prepared to do the ID to URL translation\n\t     \\item Provide data for all included files.\n\t  \\end{enumerate}\n\n\t  @param url The URL assigned to this file. It will be used when\n\t         the #DjVuFile# asks for data.\n\t  @param port All communication between #DjVuFile#s and \\Ref{DjVuDocument}s\n\t         is done through the \\Ref{DjVuPort} mechanism. If the {\\em url}\n\t\t is not local or the data does not reside on the hard disk,\n\t\t the {\\em port} parameter must not be #ZERO#. If the {\\em port}\n\t\t is #ZERO# then #DjVuFile# will create an internal instance\n\t\t of \\Ref{DjVuSimplePort} for accessing local files and\n\t\t reporting errors. It can later be disabled by means\n\t\t of \\Ref{disable_standard_port}() function. */\n   void init(const GURL & url, GP<DjVuPort> port=0);\n\n      /** Creator, does the init(const GURL &url, GP<DjVuPort> port=0) */\n   static GP<DjVuFile> create(\n     const GURL & url, GP<DjVuPort> port=0,\n     const ErrorRecoveryAction recover_action=ABORT,\n     const bool verbose_eof=true);\n\n      /** Disables the built-in port for accessing local files, which may\n\t  have been created in the case when the #port# argument to\n\t  the \\Ref{DjVuFile::DjVuFile}() constructor is #ZERO# */\n   void\t\tdisable_standard_port(void);\n\n      /** Looks for #decoded# navigation directory (\\Ref{DjVuNavDir}) in this\n\t  or included files. Returns #ZERO# if nothing could be found.\n\n\t  {\\bf Note.} This function does {\\bf not} attempt to decode #NDIR#\n\t  chunks. It is looking for predecoded components. #NDIR# can be\n\t  decoded either during regular decoding (initiated by\n\t  \\Ref{start_decode}() function) or by \\Ref{decode_ndir}() function,\n\t  which processes this and included files recursively in search\n\t  of #NDIR# chunks and decodes them. */\n   GP<DjVuNavDir>\tfind_ndir(void);\n\n      /** @name #DjVuFile# flags query functions */\n      //@{\n      /** Returns the #DjVuFile# flags. The value returned is the\n\t  result of ORing one or more of the following constants:\n\t  \\begin{itemize}\n\t     \\item #DECODING# The decoding is in progress\n\t     \\item #DECODE_OK# The decoding has finished successfully\n\t     \\item #DECODE_FAILED# The decoding has failed\n\t     \\item #DECODE_STOPPED# The decoding has been stopped by\n\t           \\Ref{stop_decode}() function\n\t     \\item #DATA_PRESENT# All data for this file has been received.\n\t           It's especially important in the case of Netscape or IE\n\t\t   plugins when the data is being received while the\n\t\t   decoding is done.\n\t     \\item #ALL_DATA_PRESENT# Not only data for this file, but also\n\t           for all included file has been received.\n\t     \\item #INCL_FILES_CREATED# All #INCL# and #INCF# chunks have been\n\t           processed and the corresponding #DjVuFile#s created. This\n\t\t   is important to know to be sure that the list returned by\n\t\t   \\Ref{get_included_files}() is OK.\n\t  \\end{itemize} */\n   long\t\tget_flags(void) const;\n      /// Returns #TRUE# if the file is being decoded.\n   bool\t\tis_decoding(void) const;\n      /// Returns #TRUE# if decoding of the file has finished successfully.\n   bool\t\tis_decode_ok(void) const;\n      /// Returns #TRUE# if decoding of the file has failed.\n   bool\t\tis_decode_failed(void) const;\n      /** Returns #TRUE# if decoding of the file has been stopped by\n\t  \\Ref{stop_decode}() function. */\n   bool\t\tis_decode_stopped(void) const;\n      /// Returns #TRUE# if this file has received all data.\n   bool\t\tis_data_present(void) const;\n      /** Returns #TRUE# if this file {\\bf and} all included files have\n\t  received all data. */\n   bool\t\tis_all_data_present(void) const;\n      /** Returns #TRUE# if all included files have been created. Only when\n\t  this function returns 1, the \\Ref{get_included_files}() returns\n\t  the correct information. */\n   bool\t\tare_incl_files_created(void) const;\n   bool\t\tis_modified(void) const;\n   bool\t\tneeds_compression(void) const;\n   bool\t\tcan_compress(void) const;\n   void\t\tset_modified(bool m);\n   void\t\tset_needs_compression(bool m);\n   void\t\tset_can_compress(bool m);\n      //@}\n\n      /// Returns the URL assigned to this file\n   GURL\t\tget_url(void) const;\n\n      /** @name Decode control routines */\n      //@{\n      /** Starts decode. If threads are enabled, the decoding will be\n\t  done in another thread. Be sure to use \\Ref{wait_for_finish}()\n\t  or listen for notifications sent through the \\Ref{DjVuPortcaster}\n\t  to remain in sync. */\n   void\t\tstart_decode(void);\n      /** Start the decode iff not already decoded.  If sync is true, wait\n          wait for decode to complete.  Returns true of start_decode is called.\n          */\n   bool   resume_decode(const bool sync=false);\n      /** Stops decode. If #sync# is 1 then the function will not return\n\t  until the decoding thread actually dies. Otherwise it will\n\t  just signal the thread to stop and will return immediately.\n\t  Decoding of all included files will be stopped too. */\n   void\t\tstop_decode(bool sync);\n      /** Recursively stops all data-related operations.\n\n\t  Depending on the value of #only_blocked# flag this works as follows:\n\t  \\begin{itemize}\n\t     \\item If #only_blocked# is #TRUE#, the function will make sure,\n\t           that any further access to the file's data will result\n\t\t   in a #STOP# exception if the desired data is not available\n\t\t   (and the thread would normally block).\n\t     \\item If #only_blocked# is #FALSE#, then {\\bf any} further\n\t           access to the file's data will result in immediate\n\t\t   #STOP# exception.\n\t  \\end{itemize}\n\n\t  The action of this function is recursive, meaning that any #DjVuFile#\n\t  included into this one will also be stopped.\n\n\t  Use this function when you don't need the #DjVuFile# anymore. The\n\t  results cannot be undone, and the whole idea is to make all threads\n\t  working with this file exit with the #STOP# exception. */\n   void\t\tstop(bool only_blocked);\n      /** Wait for the decoding to finish. This will wait for the\n\t  termination of included files too. */\n   void\t\twait_for_finish(void);\n      /** Looks for #NDIR# chunk (navigation directory), and decodes its\n\t  contents. If the #NDIR# chunk has not been found in {\\em this} file,\n\t  but this file includes others, the procedure will continue\n\t  recursively. This function is useful to obtain the document\n\t  navigation directory before any page has been decoded. After it\n\t  returns the directory can be obtained by calling \\Ref{find_ndir}()\n\t  function.\n\n\t  {\\bf Warning.} Contrary to \\Ref{start_decode}(), this function\n\t  does not return before it completely decodes the directory.\n\t  Make sure, that this file and all included files have enough data. */\n   GP<DjVuNavDir>\tdecode_ndir(void);\n      /// Clears all decoded components.\n   void\t\treset(void);\n      /** Processes #INCL# chunks and creates included files.\n\t  Normally you won't need to call this function because included\n\t  files are created automatically when the file is being decoded.\n\t  But if due to some reason you'd like to obtain the list of included\n\t  files without decoding this file, this is an ideal function to call.\n\n\t  {\\bf Warning.} This function does not return before it reads the\n\t  whole file, which may block your application under some circumstances\n\t  if not all data is available. */\n   void\t\tprocess_incl_chunks(void);\n      //@}\n   \n      // Function needed by the cache\n   unsigned int\tget_memory_usage(void) const;\n\n      /** Returns the list of included DjVuFiles.\n\t  \n\t  {\\bf Warning.} Included files are normally created during decoding.\n\t  Before that they do not exist.   If you call this function at\n\t  that time and set #only_created# to #FALSE# then it will have to\n\t  read all the data from this file in order to find #INCL# chunks,\n\t  which may block your application, if not all data is available.\n\n\t  @param only_created If #TRUE#, the file will not try to process\n\t         #INCL# chunks and load referenced files. It will return\n\t\t just those files, which have already been created during\n\t\t the decoding procedure. */\n   GPList<DjVuFile>\tget_included_files(bool only_created=true);\n\n      /** Includes a #DjVuFile# with the specified #id# into this one.\n\t  This function will also insert an #INCL# chunk at position\n\t  #chunk_num#. The function will request data for the included\n\t  file and will create it before returning. */\n   void\t\tinsert_file(const GUTF8String &id, int chunk_num=1);\n      /// Will get rid of included file with the given #id#\n   void\t\tunlink_file(const GUTF8String &id);\n      /** Will find an #INCL# chunk containing #name# in input #data# and\n\t  will remove it */\n   static GP<DataPool>\tunlink_file(const GP<DataPool> & data, const GUTF8String &name);\n\n      /// Returns the number of chunks in the IFF file data\n   int\t\tget_chunks_number(void);\n      /// Returns the name of chunk number #chunk_num#\n   GUTF8String\tget_chunk_name(int chunk_num);\n      /// Returns 1 if this file contains chunk with name #chunk_name#\n   bool\t\tcontains_chunk(const GUTF8String &chunk_name);\n\n      /** Processes the included files hierarchy and returns merged\n\t  annotations. This function may be used even when the #DjVuFile#\n\t  has not been decoded yet. If all data has been received for\n\t  this #DjVuFile# and all included #DjVuFile#s, it will will\n\t  gather annotations from them and will return the result.\n\t  If no annotations have been found, #ZERO# will be returned.\n\t  If either this #DjVuFile# or any of the included files do not\n\t  have all the data, the function will use the results of\n\t  decoding, which may have been started with the \\Ref{start_decode}()\n\t  function. Otherwise #ZERO# will be returned as well.\n\n\t  If #max_level_ptr# pointer is not zero, the function will use\n\t  it to store the maximum level number from which annotations\n\t  have been obtained. #ZERO# level corresponds to the top-level\n\t  page file.\n\n\t  {\\bf Summary:} This function will return complete annotations only\n\t  when the \\Ref{is_all_data_present}() returns #TRUE#. */\n   GP<ByteStream>\tget_merged_anno(int * max_level_ptr=0);\n\n      /** Returns the annotation chunks (#\"ANTa\"# and #\"ANTz\"#).  This\n          function may be used even when the #DjVuFile# has not been decoded\n          yet. If all data has been received for this #DjVuFile#, it will\n          gather hidden text and return the result.  If no hidden text has\n          been found, #ZERO# will be returned.\n\n\t  {\\bf Summary:} This function will return complete annotations\n\t  only when the \\Ref{is_all_data_present}() returns #TRUE#. */\n   GP<ByteStream>\tget_anno(void);\n\n      /** Returns the text chunks (#\"TXTa\"# and #\"TXTz\"#).  This function may\n          be used even when the #DjVuFile# has not been decoded yet. If all\n          data has been received for this #DjVuFile#, it will gather hidden\n          text and return the result.  If no hidden text has been found,\n          #ZERO# will be returned.\n\n\t  {\\bf Summary:} This function will return complete hidden text layers\n\t  only when the \\Ref{is_all_data_present}() returns #TRUE#. */\n   GP<ByteStream>\tget_text(void);\n\n      /** Returns the meta chunks (#\"METa\"# and #\"METz\"#).  This function may\n          be used even when the #DjVuFile# has not been decoded yet. If all\n          data has been received for this #DjVuFile#, it will gather metadata\n          and return the result.  If no hidden text has been found, #ZERO#\n          will be returned.\n\n\t  {\\bf Summary:} This function will return complete meta data only\n\t  when the \\Ref{is_all_data_present}() returns #TRUE#. */\n   GP<ByteStream>\tget_meta(void);\n\n      /** Goes down the hierarchy of #DjVuFile#s and merges their annotations.\n          (shouldn't this one be private?).\n\t  @param max_level_ptr If this pointer is not ZERO, the function\n\t         will use it to store the maximum level at which annotations\n\t\t were found. Top-level page files have ZERO #level#.\n\t  @param ignore_list The function will not process included #DjVuFile#s\n\t         with URLs matching those mentioned in this #ignore_list#. */\n   GP<ByteStream>\tget_merged_anno(const GList<GURL> & ignore_list,\n\t\t\t\t\tint * max_level_ptr);\n\n      /** Clears this file of all annotations. */\n   void\tremove_anno(void);\n\n      /** Clears the hidden text. */\n   void\tremove_text(void);\n\n      /// Clears the meta data.\n   void remove_meta(void);\n\n      /** Returns #TRUE# if the file contains annotation chunks.\n\t  Known annotation chunks at the time of writing this help are:\n\t  {\\bf ANTa}, {\\bf ANTz}, {\\bf FORM:ANNO}. */\n   bool\t\tcontains_anno(void);\n\n      /** Returns #TRUE# if the file contains hiddentext chunks.\n\t  Known hiddentext chunks at the time of writing this help are:\n\t  {\\bf TXTa}, and {\\bf TXTz}. */\n   bool\t\tcontains_text(void);\n\n      /** Returns #TRUE# if the file contains metadata chunks.\n\t  Known metadata chunks at the time of writing this help are:\n\t  {\\bf METa}, and {\\bf METz}. */\n   bool\t\tcontains_meta(void);\n\n     /** Changes the value of the hiddentext. */\n   void change_info(GP<DjVuInfo> info, const bool do_reset=false);\n   \n     /** Changes the value of the hiddentext. */\n   void change_text(GP<DjVuTXT> txt, const bool do_reset=false);\n   \n     /** Changes the value of the metadata. */\n   void change_meta(const GUTF8String &meta, const bool do_reset=false);\n   \n      /** @name Encoding routines */\n      //@{\n      /** The main function that encodes data back into binary stream.\n\t  The data returned will reflect possible changes made into the\n\t  chunk structure, annotation chunks and navigation directory\n\t  chunk #NDIR#.\n\n\t  {\\bf Note:} The file stream will not have the magic\n          #0x41,0x54,0x26,0x54#\n\t  at the beginning.\n\t  \n\t  @param included_too Process included files too. */\n   GP<ByteStream>\tget_djvu_bytestream(const bool included_too, const bool no_ndir=true);\n\n      /** Same as \\Ref{get_djvu_bytestream}(), returning a DataPool.\n\t  @param included_too Process included files too. */\n   GP<DataPool>\t\tget_djvu_data(const bool included_too, const bool no_ndir=true );\n      //@}\n\n      // Internal. Used by DjVuDocument\n   GP<DataPool>\t\tget_init_data_pool(void) const { return data_pool; };\n\n      // Internal. Used by DjVuDocument. May block for data.\n   void\t\t\tmove(const GURL & dir_url);\n\n      /** Internal. Used by DjVuDocument. The #name# should {\\bf not}\n\t  be encoded with \\Ref{GOS::encode_reserved}(). */\n   void\t\t\tset_name(const GUTF8String &name);\n\n      // Internal. Used by DjVuDocument\n   GSafeFlags &\t\tget_safe_flags(void);\n\n      // Internal. Used by DjVuImage\n   void                 merge_anno(ByteStream &out);\n\n      // Internal. Used by DjVuImage\n   void                 get_text(ByteStream &out);\n\n      // Internal. Used by DjVuImage\n   void                 get_meta(ByteStream &out);\n\n      // Internal. Used by DjVuDocEditor\n   void\t\t\trebuild_data_pool(void);\n\n      // Functions inherited from DjVuPort\n   virtual bool\t\tinherits(const GUTF8String &class_name) const;\n   virtual void\t\tnotify_chunk_done(const DjVuPort * source, const GUTF8String &name);\n   virtual void\t\tnotify_file_flags_changed(const DjVuFile * source,\n\t\t\t\t\t\t  long set_mask, long clr_mask);\n   virtual void\t\tset_recover_errors(const ErrorRecoveryAction=ABORT);\n   virtual void\t\tset_verbose_eof(const bool verbose_eof=true);\n   virtual void\t\treport_error(const GException &ex,const bool=true);\n   static void set_decode_codec(GP<GPixmap> (*codec)(ByteStream &bs));\n\nprotected:\n   GURL\t\t\turl;\n   GP<DataPool>\t\tdata_pool;\n\n   GPList<DjVuFile>\tinc_files_list;\n   GCriticalSection\tinc_files_lock;\n   GCriticalSection\tanno_lock;\n   GCriticalSection\ttext_lock;\n   GCriticalSection\tmeta_lock;\n   ErrorRecoveryAction\trecover_errors;\n   bool\t\t\tverbose_eof;\n   int\t\t\tchunks_number;\nprivate:\n   bool                 initialized;\n   GSafeFlags\t\tflags;\n\n   GThread\t\t* decode_thread;\n   GP<DataPool>\t\tdecode_data_pool;\n   GP<DjVuFile>\t\tdecode_life_saver;\n\n   GP<DjVuPort>\t\tsimple_port;\n\n   GMonitor\t\tchunk_mon, finish_mon;\n\n      // Functions called when the decoding thread starts\n   static void\tstatic_decode_func(void *);\n   void\tdecode_func(void);\n   void\tdecode(const GP<ByteStream> &str);\n   GUTF8String decode_chunk(const GUTF8String &chkid,\n     const GP<ByteStream> &str, bool djvi, bool djvu, bool iw44);\n   int\t\tget_dpi(int w, int h);\n\n      // Functions dealing with the shape directory (fgjd)\n   static GP<JB2Dict> static_get_fgjd(void *);\n   GP<JB2Dict> get_fgjd(int block=0);\n\n      // Functions used to wait for smth\n   void\t\twait_for_chunk(void);\n   bool\t\twait_for_finish(bool self);\n\n      // INCL chunk processor\n   GP<DjVuFile>\tprocess_incl_chunk(ByteStream & str, int file_num=-1);\n\n      // Trigger: called when DataPool has all data\n   static void\tstatic_trigger_cb(void *);\n   void\t\ttrigger_cb(void);\n   \n      // Progress callback: called from time to time\n   static void\tprogress_cb(int pos, void *);\n   static void\tget_merged_anno(const GP<DjVuFile> & file,\n     const GP<ByteStream> &str_out, const GList<GURL> & ignore_list,\n     int level, int & max_level, GMap<GURL, void *> & map);\n   static void\tget_anno(const GP<DjVuFile> & file,\n     const GP<ByteStream> &str_out);\n   static void\tget_text(const GP<DjVuFile> & file,\n     const GP<ByteStream> &str_out);\n   static void\tget_meta(const GP<DjVuFile> & file,\n     const GP<ByteStream> &str_out);\n\n   void          check() const;\n   GP<DjVuNavDir>find_ndir(GMap<GURL, void *> & map);\n   GP<DjVuNavDir>decode_ndir(GMap<GURL, void *> & map);\n   void\t\tadd_djvu_data(IFFByteStream & str,\n\t\t\t      GMap<GURL, void *> & map,\n\t\t\t      const bool included_too, const bool no_ndir=true);\n   void\t\tmove(GMap<GURL, void *> & map, const GURL & dir_url);\nprivate: // dummy stuff\n   static void decode(ByteStream *);\n   static GUTF8String decode_chunk(const GUTF8String &, ByteStream *,bool,bool,bool);\n   static void\tget_merged_anno(const GP<DjVuFile> &,ByteStream *,\n     const GList<GURL> &, int, int &, GMap<GURL, void *> &);\n   static void\tget_text(const GP<DjVuFile> &,ByteStream *);\n   static void\tget_meta(const GP<DjVuFile> &,ByteStream *);\n\n};\n\ninline long\nDjVuFile::get_flags(void) const\n{\n   return flags;\n}\n\ninline GSafeFlags &\nDjVuFile::get_safe_flags(void)\n{\n   return flags;\n}\n\ninline bool\nDjVuFile::is_decoding(void) const\n{\n   return (flags & DECODING)!=0;\n}\n\ninline bool\nDjVuFile::is_decode_ok(void) const\n{\n   return (flags & DECODE_OK)!=0;\n}\n\ninline bool\nDjVuFile::is_decode_failed(void) const\n{\n   return (flags & DECODE_FAILED)!=0;\n}\n\ninline bool\nDjVuFile::is_decode_stopped(void) const\n{\n   return (flags & DECODE_STOPPED)!=0;\n}\n\ninline bool\nDjVuFile::is_data_present(void) const\n{\n   return (flags & DATA_PRESENT)!=0;\n}\n\ninline bool\nDjVuFile::is_all_data_present(void) const\n{\n   return (flags & ALL_DATA_PRESENT)!=0;\n}\n\ninline bool\nDjVuFile::are_incl_files_created(void) const\n{\n   return (flags & INCL_FILES_CREATED)!=0;\n}\n\ninline bool\nDjVuFile::is_modified(void) const\n{\n   return (flags & MODIFIED)!=0;\n}\n\ninline void\nDjVuFile::set_modified(bool m)\n{\n  flags=m ? (flags | MODIFIED) : (flags & ~MODIFIED);\n}\n\ninline bool\nDjVuFile::needs_compression(void) const\n{\n   return (flags & NEEDS_COMPRESSION)!=0;\n}\n\ninline void\nDjVuFile::set_needs_compression(bool m)\n{\n   if (m) flags=flags | NEEDS_COMPRESSION;\n   else flags=flags & ~NEEDS_COMPRESSION;\n}\n\ninline bool\nDjVuFile::can_compress(void) const\n{\n   return (flags & CAN_COMPRESS)!=0;\n}\n\ninline void\nDjVuFile::set_can_compress(bool m)\n{\n   if (m)\n     flags=flags | CAN_COMPRESS;\n   else\n     flags=flags & ~CAN_COMPRESS;\n}\n\ninline void\nDjVuFile::disable_standard_port(void)\n{\n   simple_port=0;\n}\n\ninline bool\nDjVuFile::inherits(const GUTF8String &class_name) const\n{\n   return\n      (GUTF8String(\"DjVuFile\") == class_name) ||\n      DjVuPort::inherits(class_name);\n//      !strcmp(\"DjVuFile\", class_name) ||\n//      DjVuPort::inherits(class_name);\n}\n\ninline void\nDjVuFile::wait_for_finish(void)\n{\n   while(wait_for_finish(1))\n     EMPTY_LOOP;\n}\n\ninline GURL\nDjVuFile::get_url(void) const\n{\n   return url;\n}\n\ninline void\nDjVuFile::set_verbose_eof\n(const bool verbose)\n{\n  verbose_eof=verbose;\n}\n\ninline void\nDjVuFile::set_recover_errors\n(const ErrorRecoveryAction action)\n{\n  recover_errors=action;\n}\n\n//@}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVuFileCache.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"DjVuFileCache.h\"\n#include \"debug.h\"\n\n#include <stddef.h>\n#include <stdlib.h>\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\nDjVuFileCache::~DjVuFileCache(void) {}\n\nint\nDjVuFileCache::Item::qsort_func(const void * el1, const void * el2)\n{\n   const Item * item1=*(Item **) el1;\n   const Item * item2=*(Item **) el2;\n   time_t time1=item1->get_time();\n   time_t time2=item2->get_time();\n   return time1<time2 ? -1 : time1>time2 ? 1 : 0;\n}\n\nvoid\nDjVuFileCache::set_max_size(int xmax_size)\n{\n   DEBUG_MSG(\"DjVuFileCache::set_max_size(): resizing to \" << xmax_size << \"\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   GCriticalSectionLock lock(&class_lock);\n   \n   max_size=xmax_size;\n   cur_size=calculate_size();\n\n   if (max_size>=0) clear_to_size(enabled ? max_size : 0);\n}\n\nvoid\nDjVuFileCache::enable(bool en)\n{\n   enabled=en;\n   set_max_size(max_size);\n}\n\nvoid\nDjVuFileCache::add_file(const GP<DjVuFile> & file)\n{\n   DEBUG_MSG(\"DjVuFileCache::add_file(): trying to add a new item\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   GCriticalSectionLock lock(&class_lock);\n\n      // See if the file is already cached\n   GPosition pos;\n   for(pos=list;pos;++pos)\n      if (list[pos]->get_file()==file) break;\n   \n   if (pos) list[pos]->refresh();\t// Refresh the timestamp\n   else\n   {\n\t // Doesn't exist in the list yet\n      int _max_size=enabled ? max_size : 0;\n      if (max_size<0) _max_size=max_size;\n\n      int add_size=file->get_memory_usage();\n   \n      if (_max_size>=0 && add_size>_max_size)\n      {\n\t DEBUG_MSG(\"but this item is way too large => doing nothing\\n\");\n\t return;\n      }\n\n      if (_max_size>=0) clear_to_size(_max_size-add_size);\n\n      list.append(new Item(file));\n      cur_size+=add_size;\n      file_added(file);\n   }\n}\n\nvoid\nDjVuFileCache::clear_to_size(int size)\n{\n   DEBUG_MSG(\"DjVuFileCache::clear_to_size(): dropping cache size to \" << size << \"\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   GCriticalSectionLock lock(&class_lock);\n   \n   if (size==0)\n   {\n      list.empty();\n      cur_size=0;\n   } else\n      if (list.size()>20)\n      {\n\t    // More than 20 elements in the cache: use qsort to\n\t    // sort them before picking up the oldest\n\t GTArray<void *> item_arr(list.size()-1);\n\t GPosition pos;\n\t int i;\n\t for(pos=list, i=0;pos;++pos, i++)\n\t {\n\t    GP<Item> item=list[pos];\n\t    item->list_pos=pos;\n\t    item_arr[i]=item;\n\t }\n\n\t qsort(&item_arr[0], item_arr.size(), sizeof(item_arr[0]), Item::qsort_func);\n\n\t for(i=0;i<item_arr.size() && cur_size>(int) size;i++)\n\t {\n\t    Item * item=(Item *) item_arr[i];\n\t    cur_size-=item->get_size();\n\t    GP<DjVuFile> file=item->file;\n\t    list.del(item->list_pos);\n\t    file_cleared(file);\n\t    if (cur_size<=0) cur_size=calculate_size();\n\t }\n      } else\n      {\n\t    // Less than 20 elements: no reason to presort\n\t while(cur_size>(int) size)\n\t {\n\t    if (!list.size())\n\t    {\n\t\t  // Oops. Discrepancy due to an item changed its size\n\t       cur_size=0;\n\t       break;\n\t    }\n\n\t       // Remove the oldest cache item\n\t    GPosition oldest_pos=list;\n\t    GPosition pos=list;\n\t    for(++pos;pos;++pos)\n\t       if (list[pos]->get_time()<list[oldest_pos]->get_time())\n\t\t  oldest_pos=pos;\n\t    cur_size-=list[oldest_pos]->get_size();\n\t    GP<DjVuFile> file=list[oldest_pos]->file;\n\t    list.del(oldest_pos);\n\t    file_cleared(file);\n\n\t       // cur_size *may* become negative because items may change their\n\t       // size after they've been added to the cache\n\t    if (cur_size<=0) cur_size=calculate_size();\n\t }\n      }\n   \n   DEBUG_MSG(\"done: current cache size=\" << cur_size << \"\\n\");\n}\n\nint\nDjVuFileCache::calculate_size(void)\n{\n   GCriticalSectionLock lock(&class_lock);\n   \n   int size=0;\n   for(GPosition pos=list;pos;++pos)\n      size+=list[pos]->get_size();\n   return size;\n}\n\nvoid\nDjVuFileCache::del_file(const DjVuFile * file)\n{\n   DEBUG_MSG(\"DjVuFileCache::del_file(): Removing an item from cache\\n\");\n   DEBUG_MAKE_INDENT(3);\n\n   GCriticalSectionLock lock(&class_lock);\n\n   for(GPosition pos=list;pos;++pos)\n      if (list[pos]->get_file()==file)\n      {\n\t GP<DjVuFile> file=list[pos]->get_file();\n\t cur_size-=list[pos]->get_size();\n\t list.del(pos);\n\t file_deleted(file);\n\t break;\n      }\n   if (cur_size<0) cur_size=calculate_size();\n   DEBUG_MSG(\"current cache size=\" << cur_size << \"\\n\");\n}\n\nGPList<DjVuFileCache::Item>\nDjVuFileCache::get_items(void)\n{\n   GCriticalSectionLock lock(&class_lock);\n\n   return list;\n}\n\nvoid\nDjVuFileCache::file_added(const GP<DjVuFile> &) {}\n\nvoid\nDjVuFileCache::file_deleted(const GP<DjVuFile> &) {}\n\nvoid\nDjVuFileCache::file_cleared(const GP<DjVuFile> &) {}\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/DjVuFileCache.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _DJVUFILECACHE_H\n#define _DJVUFILECACHE_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n#include \"DjVuFile.h\"\n\n#ifndef macintosh //MCW can't compile\n# ifndef UNDER_CE\n#  include <sys/types.h>\n#  include <time.h>\n# endif \n#else\n# include <time.h>\n#endif\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n/** @name DjVuFileCache.h\n    Files #\"DjVuFileCache.h\"# and #\"DjVuFileCache.cpp\"# implement a simple\n    caching mechanism for keeping a given number of \\Ref{DjVuFile} instances\n    alive. The cache estimates the size of its elements and gets rid of\n    the oldest ones when necessary.\n\n    See \\Ref{DjVuFileCache} for details.\n    \n    @memo Simple DjVuFile caching class.\n    @author Andrei Erofeev <eaf@geocities.com>\n*/\n\n//@{\n\n/** #DjVuFileCache# is a simple list of \\Ref{DjVuFile} instances. It keeps\n    track of the total size of all elements and can get rid of the oldest\n    one once the total size becomes over some threshold. Its main purpose\n    is to keep the added \\Ref{DjVuFile} instances alive until their size\n    exceeds some given threshold (set by \\Ref{set_maximum_size}() function).\n    The user is supposed to use \\Ref{DjVuPortcaster::name_to_port}() to\n    find a file corresponding to a given name. The cache provides no\n    naming services */\n#ifdef UNDER_CE\nclass DjVuFileCache : public GPEnabled\n{\nprotected:\n   DjVuFileCache(const int) {}\npublic:\n   static GP<DjVuFileCache> create(const int);\n   virtual ~DjVuFileCache(void);\n   void del_file(const DjVuFile *) {}\n   void add_file(const GP<DjVuFile> &) {}\n   void clear(void) {}\n   void set_max_size(int) {}\n   int get_max_size(void) const {return 0;}\n   void enable(bool en) {}\n   bool is_enabled(void) const {return false;}\n} ;\n#else\nclass DjVuFileCache : public GPEnabled\n{\nprotected:\n   DjVuFileCache(const int max_size=5*2*1024*1024);\npublic:\n      /** Constructs the #DjVuFileCache#\n\t  @param max_size Maximum allowed size of the cache in bytes. */\n   static GP<DjVuFileCache> create(const int max_size=5*2*1024*1024);\n\n   virtual ~DjVuFileCache(void);\n\n      /** Removes file #file# from the cache */\n   void\t\tdel_file(const DjVuFile * file);\n\n      /** Adds the given file to the cache. It it's already there, its\n\t  timestamp will be refreshed. */\n   void\t\tadd_file(const GP<DjVuFile> & file);\n\n      /** Clears the cache. All items will be deleted. */\n   void\t\tclear(void);\n      /** Sets new maximum size. If the total size of all items in the cache\n\t  is greater than #max_size#, the cache will be deleting the oldest\n\t  items until the size is OK. */\n   void\t\tset_max_size(int max_size);\n\n      /** Returns the maximum allowed size of the cache. */\n   int\t\tget_max_size(void) const;\n\n      /** Enables or disables the cache. See \\Ref{is_enabled}() for details\n\t  @param en - If {\\em en} is TRUE, the cache will be enabled.\n\t         Otherwise it will be disabled.\n\t*/\n   void\t\tenable(bool en);\n\n      /** Returns #TRUE# if the cache is enabled, #FALSE# otherwise.\n\t  When a cache is disabled, \\Ref{add_file}(), and\n\t  \\Ref{del_file}() do nothing. But the {\\em maximum size} is preserved\n\t  inside the class so that next time the cache is enabled, it will\n\t  be configured the same way. Clearly this \"enable/disable\" thing is\n\t  for convenience only. One could easily simulate this behavior by\n\t  setting the {\\em maximum size} of the cache to #ZERO#. */\n   bool\t\tis_enabled(void) const;\n\npublic:\n   class Item;\n   \n   class Item : public GPEnabled\n\t{\n\tpublic:\n\t   virtual ~Item(void);\n\t   time_t\t\tget_time(void) const;\n\n\t   GP<DjVuFile>\tget_file(void) const;\n\t   unsigned int\tget_size(void) const;\n\t   \n\t   void\t\trefresh(void);\n\n\tpublic:\n\t   GP<DjVuFile>\tfile;\n\t   time_t\t\ttime;\n\t   GPosition\t\tlist_pos;\n\t   static int\tqsort_func(const void * el1, const void * el2);\n\n\t   Item(void);\n\t   Item(const GP<DjVuFile> & xfile);\n\t};\n\nprotected:\n   GCriticalSection\tclass_lock;\n   \n      /** This function is called right after the given file has been added\n\t  to the cache for management. */\n   virtual void\tfile_added(const GP<DjVuFile> & file);\n      /** This function is called when the given file is no longer\n\t  managed by the cache. */\n   virtual void\tfile_deleted(const GP<DjVuFile> & file);\n      /** This function is called when after the cache decides to get rid\n\t  of the file. */\n   virtual void\tfile_cleared(const GP<DjVuFile> & file);\n\n   GPList<Item>\tget_items(void);\nprivate:\n   GPList<Item>\tlist;\n   bool\t\tenabled;\n   int\t\tmax_size;\n   int\t\tcur_size;\n\n   int\t\tcalculate_size(void);\n   void\t\tclear_to_size(int size);\n};\n\n\n\n//@}\n   \ninline\nDjVuFileCache::Item::Item(void) : time(::time(0)) {};\n\ninline\nDjVuFileCache::Item::Item(const GP<DjVuFile> & xfile) :\n      file(xfile), time(::time(0)) {}\n\ninline\nDjVuFileCache::Item::~Item(void) {}\n\ninline GP<DjVuFile>\nDjVuFileCache::Item::get_file(void) const\n{\n   return file;\n}\n\ninline unsigned int\nDjVuFileCache::Item::get_size(void) const\n{\n   return file->get_memory_usage();\n}\n\ninline time_t\nDjVuFileCache::Item::get_time(void) const\n{\n   return time;\n}\n\ninline void\nDjVuFileCache::Item::refresh(void)\n{\n   time=::time(0);\n}\n\ninline\nDjVuFileCache::DjVuFileCache(const int xmax_size) :\n      enabled(true), max_size(xmax_size), cur_size(0) {}\n\ninline void\nDjVuFileCache::clear(void)\n{\n   clear_to_size(0);\n}\n\ninline bool\nDjVuFileCache::is_enabled(void) const\n{\n   return enabled;\n}\n\ninline int\nDjVuFileCache::get_max_size(void) const\n{\n   return max_size;\n}\n\n#endif\n\ninline GP<DjVuFileCache>\nDjVuFileCache::create(const int max_size)\n{\n  return new DjVuFileCache(max_size);\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVuGlobal.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n/** This file impliments the DjVuProgressTask elements.  The memory\n    functions are implimented in a separate file, because only the memory\n    functions should be compiled with out overloading of the memory functions.\n */\n  \n\n#ifdef NEED_DJVU_PROGRESS\n#include \"DjVuGlobal.h\"\n\n\n// ----------------------------------------\n\n#include \"GOS.h\"\n#include \"GThreads.h\"\n#include \"GException.h\"\n#include \"GContainer.h\"\n\n#include <stddef.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n\n#define INITIAL  500\n#define INTERVAL 250\n\nclass DjVuProgressTask::Data : public GPEnabled\n{\npublic:\n  djvu_progress_callback *callback;\n  DjVuProgressTask *head;\n  const char *gtask;\n  unsigned long lastsigdate;\n  Data(djvu_progress_callback *_callback):\n    callback(_callback), head(0), gtask(0), lastsigdate(0) {}\n};\n\n  \nstatic GPMap<void *,DjVuProgressTask::Data> &\nget_map(void)\n{\n  static GPMap<void *,DjVuProgressTask::Data> xmap;\n  return xmap;\n}\n\ndjvu_progress_callback *\nDjVuProgressTask::set_callback(djvu_progress_callback *_callback)\n{ \n  djvu_progress_callback *retval=0;\n  if(_callback)\n  {\n    GMap<void *,GP<DjVuProgressTask::Data> > &map=get_map();\n    void *threadID=GThread::current();\n    if(map.contains(threadID))\n    {\n      DjVuProgressTask::Data &data=*(map[threadID]);\n      retval=data.callback;\n      data.callback=_callback;\n      data.head=0;\n      data.gtask=0;\n      data.lastsigdate=0;\n    }else\n    {\n      map[threadID]=new Data(_callback);\n    }\n  }else\n  {\n    GMap<void *,GP<DjVuProgressTask::Data> > &map=get_map();\n    void *threadID=GThread::current();\n    if(map.contains(threadID))\n    {\n      DjVuProgressTask::Data &data=*(map[threadID]);\n      retval=data.callback;\n      data.callback=0;\n      data.head=0;\n      data.gtask=0;\n      data.lastsigdate=0;\n      map.del(threadID);\n    }\n  }\n  return retval;\n}\n\nDjVuProgressTask::DjVuProgressTask(const char *xtask,int nsteps)\n  : task(xtask),parent(0), nsteps(nsteps), runtostep(0), gdata(0), data(0)\n{\n  //  gtask=task;\n  {\n    GMap<void *,GP<DjVuProgressTask::Data> > &map=get_map();\n    void *threadID=GThread::current();\n    if(map.contains(threadID))\n    {\n      gdata=new GP<Data>;\n      Data &d=*(data=((*(GP<Data> *)gdata)=map[threadID]));\n      if(d.callback)\n      {\n        unsigned long curdate = GOS::ticks();\n        startdate = curdate;\n        if (!d.head)\n          d.lastsigdate = curdate + INITIAL;\n        parent = d.head;\n        d.head = this;\n      }\n    }\n  }\n}\n\nDjVuProgressTask::~DjVuProgressTask()\n{\n  if (data && data->callback)\n  {\n    if (data->head != this)\n      G_THROW( ERR_MSG(\"DjVuGlobal.not_compatible\") );\n    data->head = parent;\n    if (!parent)\n    {\n      unsigned long curdate = GOS::ticks();\n      if((*(data->callback))(data->gtask?data->gtask:\"\",curdate-startdate, curdate-startdate))\n      {\n        G_THROW(\"INTERRUPT\");\n      }\n    }\n  }\n  delete (GP<Data> *)gdata;\n}\n\nvoid\nDjVuProgressTask::run(int tostep)\n{\n  if(data)\n  {\n    data->gtask=task;\n    if ((data->callback)&&(tostep>runtostep))\n    {\n      unsigned long curdate = GOS::ticks();\n      if (curdate > data->lastsigdate + INTERVAL)\n        signal(curdate, curdate);\n      runtostep = tostep;\n    }\n  }\n}\n\nvoid\nDjVuProgressTask::signal(unsigned long curdate, unsigned long estdate)\n{\n  int inprogress = runtostep;\n  if (inprogress > nsteps)\n    inprogress = nsteps;\n  if (inprogress > 0)\n    {\n      const unsigned long enddate = startdate+\n        (unsigned long)(((float)(estdate-startdate) * (float)nsteps) / (float)inprogress);\n      if (parent)\n      {\n        parent->signal(curdate, enddate);\n      }\n      else if (data && data->callback && curdate<enddate)\n      {\n        if((*(data->callback))(data->gtask?data->gtask:\"\",curdate-startdate, enddate-startdate))\n        {\n          G_THROW(\"INTERRUPT\");\n        }\n        data->lastsigdate = curdate;\n      }\n    }\n}\n\n// Progress callback\n//\ndjvu_progress_callback *\ndjvu_set_progress_callback( djvu_progress_callback *callback )\n{\n   return DjVuProgressTask::set_callback(callback);\n}\n\nint djvu_supports_progress_callback(void) {return 1;}\n\n#else\n\n#ifndef HAS_DJVU_PROGRESS_TYPEDEF\nextern \"C\"\n{\n  void *djvu_set_progress_callback(void *);\n  int djvu_supports_progress_callback(void);\n}\nvoid *djvu_set_progress_callback(void *) { return 0; }\nint djvu_supports_progress_callback(void) {return 0;}\n#else\nint djvu_supports_progress_callback(void) {return 0;}\ndjvu_progress_callback *\ndjvu_set_progress_callback( djvu_progress_callback *) { return 0; }\n#endif\n\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/DjVuGlobal.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _DJVUGLOBAL_H\n#define _DJVUGLOBAL_H\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n#if defined(UNDER_CE)\n# ifndef __WCEALT_H__\ninline void * operator new(size_t, void * ptr) { return ptr; }\n# endif\n#elif defined(AUTOCONF) && defined(HAVE_STDINCLUDES)\n# include <new>\n#else\n# include <new.h>\n#endif\n\n// SumatraPDF: allow to build as a static library (built-in)\n#ifdef WIN32_AND_NOT_STATIC\n# ifdef DLL_EXPORT\n#  define DJVUAPI __declspec(dllexport)\n# else\n#  define DJVUAPI __declspec(dllimport)\n# endif\n#endif\n#ifndef DJVUAPI\n# define DJVUAPI\n#endif\n\n\n/** @name DjVuGlobal.h \n\n    This file is included by all include files in the DjVu reference library.\n    \n\tIf compilation symbols #NEED_DJVU_MEMORY#, #NEED_DJVU_PROGRESS# \n\tor #NEED_DJVU_NAMES# are defined, this file enables \n\tfeatures which are useful for certain applications of the\n    DjVu Reference Library.  These features are still experimental and\n    therefore poorly documented.\n    \n    @memo\n    Global definitions.\n    @author\n    L\\'eon Bottou <leonb@research.att.com> -- empty file.\\\\\n    Bill Riemers <docbill@sourceforge.net> -- real work.  */\n//@{\n\n\n/** @name DjVu Memory \n\n    This section is enabled when compilation symbol #NEED_DJVU_MEMORY# is\n    defined.  Function #_djvu_memory_callback# can be used to redefine the C++\n    memory allocation operators.  Some operating systems (e.g. Macintoshes)\n    require very peculiar memory allocation in shared objects.  We redefine\n    the operators #new# and #delete# as #STATIC_INLINE# because we do not\n    want to export these redefined versions to other libraries.  */\n//@{\n//@}\n\n#ifdef NEED_DJVU_MEMORY\n\n# include \"DjVu.h\"\n\n// These define the two callbacks needed for C++\ntypedef void djvu_delete_callback(void *);\ntypedef void *djvu_new_callback(size_t);\n\n// These functions allow users to set the callbacks.\nint djvu_memoryObject_callback ( djvu_delete_callback*, djvu_new_callback*);\nint djvu_memoryArray_callback ( djvu_delete_callback*, djvu_new_callback*);\n\n// We need to use this inline function in all modules, but we never want it to\n// appear in the symbol table.  It seems different compilers need different\n// directives to do this...\n# ifndef STATIC_INLINE\n#  ifdef __GNUC__\n#   define STATIC_INLINE extern inline\n#  else /* !__GNUC__ */\n#   define STATIC_INLINE static inline\n#  endif /* __GNUC__ */\n# endif /* STATIC_INLINE */\n\n// This clause is used when overriding operator new\n// because the standard has slightly changed.\n# if defined( __GNUC__ ) && ( __GNUC__*1000 + __GNUC_MINOR__ >= 2091 )\n#  ifndef new_throw_spec\n#   define new_throw_spec throw(std::bad_alloc)\n#  endif /* new_throw_spec */\n#  ifndef delete_throw_spec\n#   define delete_throw_spec throw()\n#  endif /* delete_throw_spec */\n# endif /* __GNUC__ ... */\n// Old style\n# ifndef new_throw_spec\n#  define new_throw_spec\n# endif /* new_throw_spec */\n# ifndef delete_throw_spec\n#  define delete_throw_spec\n# endif  /* delete_throw_spec */\n\n# ifdef UNIX\nextern djvu_new_callback *_djvu_new_ptr;\nextern djvu_new_callback *_djvu_newArray_ptr;\nextern djvu_delete_callback *_djvu_delete_ptr;\nextern djvu_delete_callback *_djvu_deleteArray_ptr;\n\n#  ifndef NEED_DJVU_MEMORY_IMPLEMENTATION\nvoid *operator new (size_t) new_throw_spec;\nvoid *operator new[] (size_t) new_throw_spec;\nvoid operator delete (void *) delete_throw_spec;\nvoid operator delete[] (void *) delete_throw_spec;\n\nSTATIC_INLINE void *\noperator new(size_t sz) new_throw_spec\n{ return (*_djvu_new_ptr)(sz); }\nSTATIC_INLINE void\noperator delete(void *addr) delete_throw_spec\n{ return (*_djvu_delete_ptr)(addr); }\nSTATIC_INLINE void *\noperator new [] (size_t sz) new_throw_spec\n{ return (*_djvu_newArray_ptr)(sz); }\nSTATIC_INLINE void\noperator delete [] (void *addr) delete_throw_spec\n{ return (*_djvu_deleteArray_ptr)(addr); }\n#  endif /* NEED_DJVU_MEMORY_IMPLEMENTATION */\n\n# else /* UNIX */\n\n#  ifndef NEED_DJVU_MEMORY_IMPLEMENTATION\nSTATIC_INLINE void *\noperator new(size_t sz) new_throw_spec\n{ return _djvu_new(sz); }\ninline_as_macro void\noperator delete(void *addr) delete_throw_spec\n{ return _djvu_delete(addr); }\ninline_as_macro void *\noperator new [] (size_t sz) new_throw_spec\n{ return _djvu_new(sz); }\ninline_as_macro void\noperator delete [] (void *addr) delete_throw_spec\n{ _djvu_deleteArray(addr); }\n#  endif /* !NEED_DJVU_MEMORY_IMPLEMENTATION */\n\n# endif /* UNIX */\n\n#else\n\n# define _djvu_free(ptr) free((ptr))\n# define _djvu_malloc(siz) malloc((siz))\n# define _djvu_realloc(ptr,siz) realloc((ptr),(siz))\n# define _djvu_calloc(siz,items) calloc((siz),(items))\n\n#endif /* NEED_DJVU_MEMORY */\n\n/** @name DjVu Progress  \n\n    This section is enabled when compilation symbol #NEED_DJVU_PROGRESS# is\n    defined.  This macro setups callback function that may be used to\n    implement a progress indicator for the encoding routines.  The decoding\n    routines do not need such a facility because it is sufficient to monitor\n    the calls to function \\Ref{ByteStream::read} in class \\Ref{ByteStream}.\n    \n    {\\bf Code tracing macros} ---\n    Monitoring the progress of such complex algorithms requires significant\n    code support.  This is achieved by inserting {\\em code tracing macros}\n    in strategic regions of the code.  \n    \\begin{description}\n    \\item[DJVU_PROGRESS_TASK(name,task,nsteps)]  indicates that the current\n         scope performs a task roughly divided in #nsteps# equal steps, with\n\t       the specified #task# string used in the callback.\n    \\item[DJVU_PROGRESS_RUN(name,tostep)] indicates that we are starting\n         an operation which will take us to step #tostep#.  The operation\n         will be considered finished when #DJVU_PROGRESS_RUN# will be called\n         again with an argument greater than #tostep#.  The execution of\n         this operation of course can be described by one subtask and so on.\n    \\end{description}\n \n    {\\bf Progress callback} --- Before defining the outermost task, you can\n    store a callback function pointer into the static member variable\n    #DjVuProgressTask::callback#.  This callback function is called\n    periodically with two unsigned long arguments.  The first argument is the\n    elapsed time. The second argument is the estimated total execution time.\n    Both times are given in milliseconds.\n\n    {\\bf Important Note} --- This monitoring mechanism should not be used by\n    multithreaded programs.  */\n//@{\n\n#ifndef HAS_DJVU_PROGRESS_CALLBACKS\n# define HAS_DJVU_PROGRESS_CALLBACKS\n\n# ifdef NEED_DJVU_PROGRESS\n#  include \"DjVu.h\"\n\nextern djvu_progress_callback *_djvu_progress_ptr;\n\n#  define DJVU_PROGRESS_TASK(name,task,nsteps)  DjVuProgressTask task_##name(task,nsteps)\n#  define DJVU_PROGRESS_RUN(name,tostep)   { task_##name.run(tostep); }\n\nclass DjVuProgressTask\n{\npublic:\n  class Data;\n  ~DjVuProgressTask();\n  DjVuProgressTask(const char *task,int nsteps);\n  void run(int tostep);\n  const char *task;\n  static djvu_progress_callback *set_callback(djvu_progress_callback *ptr=0);\nprivate:\n  DjVuProgressTask *parent;\n  int nsteps;\n  int runtostep;\n  unsigned long startdate;\n  // Statics\n  void *gdata;\n  Data *data;\n  // Helpers\n  void signal(unsigned long curdate, unsigned long estdate);\n};\n\n# else  // ! NEED_DJVU_PROGRESS\n\n#  define DJVU_PROGRESS_TASK(name,task,nsteps)\n#  define DJVU_PROGRESS_RUN(name,step)\n\n# endif // ! NEED_DJVU_PROGRESS\n#endif // HAS_DJVU_PROGRESS_CALLBACKS\n//@}\n\n\n/** @name General functions.\n\n    This section contains functions that replace some of the standard\n    system calls without any other header file dependancies.\n */\n\n#ifdef __cplusplus\n# define DJVUEXTERNCAPI(x) extern \"C\" DJVUAPI x;\n#else\n# define DJVUEXTERNCAPI(x) extern DJVUAPI x\n#endif\n\n/** This replaces fprintf(stderr,...), but with UTF8 encoded strings. */\nDJVUEXTERNCAPI(void DjVuPrintErrorUTF8(const char *fmt, ...));\n\n/** This replaces fprintf(stderr,...), but with UTF8 encoded strings. */\nDJVUEXTERNCAPI(void DjVuPrintErrorNative(const char *fmt, ...));\n\n/** This replaces printf(...), but requires UTF8 encoded strings. */\nDJVUEXTERNCAPI(void DjVuPrintMessageUTF8(const char *fmt, ...));\n\n/** This replaces printf(...), but requires UTF8 encoded strings. */\nDJVUEXTERNCAPI(void DjVuPrintMessageNative(const char *fmt, ...));\n\n/** The format (fmt) and arguments define a MessageList to be looked\n    up in the external messages and printed to stderr. */\nDJVUEXTERNCAPI(void DjVuFormatErrorUTF8(const char *fmt, ...));\n\n/** The format (fmt) and arguments define a MessageList to be looked\n    up in the external messages and printed to stderr. */\nDJVUEXTERNCAPI(void DjVuFormatErrorNative(const char *fmt, ...));\n\n/** Prints the translation of message to stderr. */\nDJVUEXTERNCAPI(void DjVuWriteError( const char *message ));\n\n/** Prints the translation of message to stdout. */\nDJVUEXTERNCAPI(void DjVuWriteMessage( const char *message ));\n\n/** A C function to perform a message lookup. Arguments are a buffer to\n  received the translated message, a buffer size (bytes), and a\n  message_list. The translated result is returned in msg_buffer encoded\n  in UTF-8. In case of error, msg_buffer is empty\n  (i.e., msg_buffer[0] == '\\0').\n*/\nDJVUEXTERNCAPI(void DjVuMessageLookUpUTF8(\n  char *msg_buffer, const unsigned int buffer_size, \n  const char *message ));\nDJVUEXTERNCAPI(void DjVuMessageLookUpNative(\n  char *msg_buffer, const unsigned int buffer_size, \n  const char *message ));\n\n/** This function sets the program name used when \n    searching for language files.\n*/\nDJVUEXTERNCAPI(const char *djvu_programname(const char *programname));\n\n\n/** @name DjVu Names  \n\n    This section is enabled when compilation symbol #NEED_DJVU_NAMES# is\n    defined.  This section redefines class names in order to unclutter the\n    name space of shared objects.  This is useful on systems which\n    automatically export all global symbols when building a shared object.\n    @args */\n//@{\n//@}\n\n#ifdef NEED_DJVU_NAMES\n/* The contents of this section may be generated by this shell command :\n * % egrep -h '^(class|struct) +[A-Z_][A-Za-z0-9_]*' *.h *.cpp |\\\n *   sed -e 's:[a-z]*  *\\([A-Za-z_][A-Za-z0-9_]*\\).*:#define \\1 DJVU_\\1:g' |\\\n *   sort\n */\n#endif // NEED_DJVU_NAMES\n\n//@}\n\n#if defined(macintosh)\n# define EMPTY_LOOP continue\n#else\n# define EMPTY_LOOP /* nop */\n#endif\n\n//  The ERR_MSG(x) macro is intended to permit automated checking of the\n//  externalized error message names against the source code. It has no\n//  effect on the executed program. It should be used to surround each\n//  message name that will need to be looked up in the external message\n//  files. In particular, it should use on all strings passed to G_THROW.\n#ifndef HAS_CTRL_C_IN_ERR_MSG\n# define HAS_CTRL_C_IN_ERR_MSG 1\n#endif\n#ifndef ERR_MSG\n# if HAS_CTRL_C_IN_ERR_MSG\n// This hack allows for the coexistence of internationalized\n// and non-internationalized code.  All internationalized error\n// message names are prefixed with a ctrl-c.  Only these will\n// be looked for in the message files.  Messages that do no \n// start with a ctrl-c will remain untranslated.\n#  define ERR_MSG(x) \"\\003\" x\n# else\n#  define ERR_MSG(x) x\n# endif\n#endif\n\n#endif /* _DJVUGLOBAL_H_ */\n\n\n"
  },
  {
    "path": "ext/libdjvu/DjVuGlobalMemory.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#ifdef NEED_DJVU_MEMORY\n#ifndef NEED_DJVU_MEMORY_IMPLEMENTATION\n#define NEED_DJVU_MEMORY_IMPLEMENTATION\n#endif /* NEED_DJVU_MEMORY_IMPLEMENTATION */\n\n#include \"DjVuGlobal.h\"\n#include \"GException.h\"\n\n#include <stddef.h>\n#include <stdlib.h>\n#include <string.h>\n#include \"debug.h\"\n\n#ifdef UNIX\ndjvu_delete_callback *\n_djvu_delete_ptr=(djvu_delete_callback *)&(operator delete);\ndjvu_delete_callback *\n_djvu_deleteArray_ptr=(djvu_delete_callback *)&(operator delete []);\ndjvu_new_callback *\n_djvu_new_ptr=(djvu_new_callback *)&(operator new);\ndjvu_new_callback *\n_djvu_newArray_ptr=(djvu_new_callback *)&(operator new []);\n#endif\n\nstatic djvu_delete_callback *_djvu_delete_handler = 0;\nstatic djvu_new_callback *_djvu_new_handler = 0;\nstatic djvu_delete_callback *deleteArray_handler = 0;\nstatic djvu_new_callback *newArray_handler = 0;\n\nstatic djvu_free_callback *_djvu_free_handler = 0;\nstatic djvu_realloc_callback *_djvu_realloc_handler = 0;\nstatic djvu_calloc_callback *_djvu_calloc_handler = 0;\nstatic djvu_malloc_callback *_djvu_malloc_handler = 0;\n\nint\ndjvu_memoryObject_callback (\n  djvu_delete_callback* delete_handler,\n  djvu_new_callback* new_handler\n) {\n  if(delete_handler && new_handler)\n  {\n#ifdef UNIX\n    _djvu_new_ptr=&_djvu_new;\n    _djvu_delete_ptr=&_djvu_delete;\n#endif\n    _djvu_delete_handler=delete_handler;\n    _djvu_new_handler=new_handler;\n    return 1;\n  }else\n  {\n#ifdef UNIX\n    _djvu_new_ptr=(djvu_new_callback *)&(operator new);\n    _djvu_delete_ptr=(djvu_delete_callback *)&(operator delete);\n#endif\n    _djvu_delete_handler=0;\n    _djvu_new_handler=0;\n    return (delete_handler||new_handler)?0:1;\n  }\n  return 0;\n}\n\nint \ndjvu_set_memory_callbacks\n(\n  djvu_free_callback *free_handler,\n  djvu_realloc_callback *realloc_handler,\n  djvu_malloc_callback *malloc_handler,\n  djvu_calloc_callback *calloc_handler\n)\n{\n  if(free_handler && realloc_handler && malloc_handler)\n  {\n#ifdef UNIX\n    _djvu_new_ptr=(djvu_new_callback *)&_djvu_new;\n    _djvu_delete_ptr=(djvu_delete_callback *)&_djvu_delete;\n#endif\n    _djvu_new_handler=(djvu_new_callback *)malloc_handler;\n    _djvu_delete_handler=(djvu_delete_callback *)free_handler;\n    _djvu_malloc_handler=(djvu_malloc_callback *)malloc_handler;\n    _djvu_free_handler=(djvu_free_callback *)free_handler;\n    _djvu_realloc_handler=(djvu_realloc_callback *)realloc_handler;\n    if(calloc_handler)\n    {\n      _djvu_calloc_handler=(djvu_calloc_callback *)&calloc_handler;\n    }else\n    {\n      _djvu_calloc_handler=0;\n    }\n    return 1;\n  }else\n  {\n#ifdef UNIX\n    _djvu_new_ptr=(djvu_new_callback *)&(operator new);\n    _djvu_delete_ptr=(djvu_delete_callback *)&(operator delete);\n#endif\n    _djvu_delete_handler=0;\n    _djvu_new_handler=0;\n    _djvu_malloc_handler=0;\n    _djvu_free_handler=0;\n    _djvu_realloc_handler=0;\n    _djvu_calloc_handler=0;\n    return !(_djvu_malloc_handler\n      ||_djvu_free_handler\n      ||_djvu_realloc_handler\n      ||_djvu_calloc_handler);\n  }\n}\n\nDJVUAPI void *\n_djvu_new(size_t siz)\n{\n  void *ptr;\n#ifndef UNIX\n  if(_djvu_new_handler)\n  {\n#endif\n    if(!(ptr=(*_djvu_new_handler)(siz?siz:1)))\n    {\n      G_THROW( ERR_MSG(\"DjVuGlobalMemory.exhausted\") );\n    }\n#ifndef UNIX\n  }else\n  {\n      ptr=::operator new(siz?siz:1);\n  }\n#endif\n  return ptr;\n}\n\nvoid  \n_djvu_delete(void *addr)\n{\n  if(addr)\n  {\n    if(_djvu_delete_handler)\n    {\n      (*_djvu_delete_handler)(addr);\n    }else\n    {\n      operator delete(addr);\n    }\n  }\n}\n\nvoid *\n_djvu_newArray(size_t siz)\n{\n  void *ptr;\n#ifndef UNIX\n  if(newArray_handler)\n  {\n#endif\n    if(!(ptr=(*newArray_handler)(siz?siz:1)))\n    {\n      G_THROW( ERR_MSG(\"DjVuGlobalMemory.exhausted\") );\n    }\n#ifndef UNIX\n  }else\n  {\n      ptr=::new unsigned char[siz?siz:1];\n  }\n#endif\n  return ptr;\n}\n\nvoid\n_djvu_deleteArray(void *addr)\n{\n  if(addr)\n  {\n    if(deleteArray_handler)\n    {\n      (*deleteArray_handler)(addr);\n    }else\n    {\n#ifdef WIN32\n                delete [] (addr) ;\n#else\n        operator delete [] (addr);\n#endif\n    }\n  }\n}\n\nvoid *\n_djvu_malloc(size_t siz)\n{\n  DEBUG_MSG(\"_djvu_malloc: siz=\"<<siz<<\"\\n\");\n  return _djvu_malloc_handler?(*_djvu_malloc_handler)(siz?siz:1):malloc(siz?siz:1);\n}\n\nvoid *\n_djvu_calloc(size_t siz, size_t items)\n{\n  DEBUG_MSG(\"_djvu_calloc: siz=\"<<siz<<\" items=\"<<items<<\"\\n\");\n  void *ptr;\n  if( _djvu_calloc_handler )\n  {\n    ptr = (*_djvu_calloc_handler)(siz?siz:1, items?items:1);\n  }else if( _djvu_malloc_handler )\n  {\n    if((ptr = (*_djvu_malloc_handler)((siz?siz:1)*(items?items:1)))&&siz&&items)\n    {\n      memset(ptr,0,siz*items);\n    }\n  }else\n  { \n    ptr = calloc(siz?siz:1, items?items:1);\n  }\n  return ptr;    \n}\n\nvoid *\n_djvu_realloc(void* ptr, size_t siz)\n{\n  DEBUG_MSG(\"_djvu_realloc: ptr=\"<<ptr<<\" siz=\"<<siz<<\"\\n\");\n  void *newptr;\n  if( _djvu_realloc_handler )\n  {\n    newptr = (*_djvu_realloc_handler)(ptr, siz);\n  }else\n  {\n    newptr = realloc(ptr, siz?siz:1);\n  }\n  return newptr;\n}\n \nvoid\n_djvu_free(void *ptr)\n{\n  DEBUG_MSG(\"_djvu_free: ptr=\"<<ptr<<\"\\n\");\n  if(ptr)\n  {\n    if( _djvu_free_handler )\n    {\n      (*_djvu_free_handler)(ptr);\n    }else\n    {\n      free(ptr);\n    }\n  }\n}\n\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/DjVuImage.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"DjVuImage.h\"\n#include \"GScaler.h\"\n#include \"DjVuDocument.h\"\n#include \"DjVuPalette.h\"\n#include \"GContainer.h\"\n#include \"GSmartPointer.h\"\n#include \"JB2Image.h\"\n#include \"IW44Image.h\"\n#include \"DataPool.h\"\n#include \"ByteStream.h\"\n#include \"GMapAreas.h\"\n#include \"DjVuText.h\"\n#include \"IFFByteStream.h\"\n#include \"BSByteStream.h\"\n#include \"debug.h\"\n#include <stdarg.h>\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n\n//// DJVUIMAGE: CONSTRUCTION\n\nDjVuImage::DjVuImage(void) \n: rotate_count(-1),relayout_sent(false)\n{\n}\n\nvoid\nDjVuImage::connect(const GP<DjVuFile> & xfile)\n{\n   file=xfile;\n   DjVuPort::get_portcaster()->add_route(file, this);\n}\n\n\n\n\n//// DJVUIMAGE: DATA COLLECTORS\n\nGP<DjVuInfo>\nDjVuImage::get_info(const GP<DjVuFile> & file) const\n{\n   if (file->info)\n   {\n     if(rotate_count<0)\n     {\n       const_cast<DjVuImage *>(this)->init_rotate(*(file->info));\n     }\n     return file->info;\n   }\n   GPList<DjVuFile> list=file->get_included_files();\n   for(GPosition pos=list;pos;++pos)\n   {\n      GP<DjVuInfo> info=get_info(list[pos]);\n      if (info) \n      {\n        if(rotate_count<0)\n        {\n          const_cast<DjVuImage *>(this)->init_rotate(*(file->info));\n        }\n        return info;\n      }\n   }\n   return 0;\n}\n\nGP<IW44Image>\nDjVuImage::get_bg44(const GP<DjVuFile> & file) const\n{\n   if (file->bg44)\n     return file->bg44;\n   GPList<DjVuFile> list=file->get_included_files();\n   for(GPosition pos=list;pos;++pos)\n   {\n      GP<IW44Image> bg44=get_bg44(list[pos]);\n      if (bg44)\n        return bg44;\n   }\n   return 0;\n}\n\nGP<GPixmap>\nDjVuImage::get_bgpm(const GP<DjVuFile> & file) const\n{\n   if (file->bgpm)\n     return file->bgpm;\n   GPList<DjVuFile> list=file->get_included_files();\n   for(GPosition pos=list;pos;++pos)\n   {\n      GP<GPixmap> bgpm=get_bgpm(list[pos]);\n      if (bgpm) return bgpm;\n   }\n   return 0;\n}\n\nGP<JB2Image>\nDjVuImage::get_fgjb(const GP<DjVuFile> & file) const\n{\n   if (file->fgjb)\n     return file->fgjb;\n   GPList<DjVuFile> list=file->get_included_files();\n   for(GPosition pos=list;pos;++pos)\n   {\n      GP<JB2Image> fgjb=get_fgjb(list[pos]);\n      if (fgjb)\n        return fgjb;\n   }\n   return 0;\n}\n\nGP<GPixmap>\nDjVuImage::get_fgpm(const GP<DjVuFile> & file) const\n{\n   if (file->fgpm)\n     return file->fgpm;\n   GPList<DjVuFile> list=file->get_included_files();\n   for(GPosition pos=list;pos;++pos)\n   {\n      GP<GPixmap> fgpm=get_fgpm(list[pos]);\n      if (fgpm)\n        return fgpm;\n   }\n   return 0;\n}\n\nGP<DjVuPalette>\nDjVuImage::get_fgbc(const GP<DjVuFile> & file) const\n{\n   if (file->fgbc)\n     return file->fgbc;\n   GPList<DjVuFile> list=file->get_included_files();\n   for(GPosition pos=list;pos;++pos)\n   {\n      GP<DjVuPalette> fgbc=get_fgbc(list[pos]);\n      if (fgbc) return fgbc;\n   }\n   return 0;\n}\n\nGP<DjVuInfo>   \nDjVuImage::get_info() const\n{\n   if (file)\n   {\n     return get_info(file);\n   }else\n   {\n     return 0;\n   }\n}\n\nGP<ByteStream>\nDjVuImage::get_anno() const\n{\n   GP<ByteStream> out = ByteStream::create();\n   ByteStream &mbs = *out;\n   if (file) \n   {\n     file->merge_anno(mbs);\n   }\n   mbs.seek(0);\n   if(!mbs.size())\n   {\n     out=0;\n   }\n   return out;\n}\n\nGP<ByteStream>\nDjVuImage::get_text() const\n{\n   GP<ByteStream> out = ByteStream::create();\n   ByteStream &mbs = *out;\n   if (file) \n   {\n     file->get_text(mbs);\n   }\n   mbs.seek(0);\n   if(!mbs.size())\n   {\n     out=0;\n   }\n   return out;\n}\n\nGP<ByteStream>\nDjVuImage::get_meta() const\n{\n   GP<ByteStream> out = ByteStream::create();\n   ByteStream &mbs = *out;\n   if (file) \n   {\n     file->get_meta(mbs);\n   }\n   mbs.seek(0);\n   if(!mbs.size())\n   {\n     out=0;\n   }\n   return out;\n}\n\nGP<IW44Image>   \nDjVuImage::get_bg44() const\n{\n   if (file)\n     return get_bg44(file);\n   else\n     return 0;\n}\n\nGP<GPixmap>   \nDjVuImage::get_bgpm() const\n{\n   if (file)\n     return get_bgpm(file);\n   else\n     return 0;\n}\n\nGP<JB2Image>   \nDjVuImage::get_fgjb() const\n{\n   if (file)\n     return get_fgjb(file);\n   else\n     return 0;\n}\n\nGP<GPixmap>    \nDjVuImage::get_fgpm() const\n{\n   if (file)\n     return get_fgpm(file);\n   else\n     return 0;\n}\n\nGP<DjVuPalette>    \nDjVuImage::get_fgbc() const\n{\n   if (file)\n     return get_fgbc(file);\n   else\n     return 0;\n}\n\nint\nDjVuImage::get_width() const\n{\n   GP<DjVuInfo> info=get_info();\n   return info?((rotate_count&1)?(info->height):(info->width)):0;\n}\n\nint\nDjVuImage::get_height() const\n{\n   GP<DjVuInfo> info=get_info();\n   return info?((rotate_count&1)?(info->width):(info->height)):0;\n}\n\nint\nDjVuImage::get_real_width() const\n{\n   GP<DjVuInfo> info=get_info();\n   return info ? info->width : 0;\n}\n\nint\nDjVuImage::get_real_height() const\n{\n   GP<DjVuInfo> info=get_info();\n   return info ? info->height : 0;\n}\n\nint\nDjVuImage::get_version() const\n{\n   GP<DjVuInfo> info=get_info();\n   return info ? info->version : DJVUVERSION;\n}\n\nint\nDjVuImage::get_dpi() const\n{\n   GP<DjVuInfo> info=get_info();\n   return info ? info->dpi : 300;\n}\n\nint\nDjVuImage::get_rounded_dpi() const\n{\n   return (get_dpi()+5)/10*10;\n#if 0   \n      /* This code used to round the reported dpi to 25, 50, 75, 100, 150,\n\t 300, and 600. Now we just round the dpi to 10ths and return it */\n   int dpi=get_dpi();\n   if (dpi>700) return dpi;\n  \n   const int std_dpi[]={ 25, 50, 75, 100, 150, 300, 600 };\n   const int std_dpis=sizeof(std_dpi)/sizeof(std_dpi[0]);\n   int min_dist=abs(dpi-std_dpi[0]);\n   int min_idx=0;\n   for(int i=1;i<std_dpis;i++)\n      if (abs(std_dpi[i]-dpi)<min_dist)\n      {\n         min_dist=abs(std_dpi[i]-dpi);\n         min_idx=i;\n      };\n   return std_dpi[min_idx];\n#endif\n}\n\ndouble\nDjVuImage::get_gamma() const\n{\n   GP<DjVuInfo> info=get_info();\n   return info ? info->gamma : 2.2;\n}\n\nGUTF8String\nDjVuImage::get_mimetype() const\n{\n   return file ? file->mimetype : GUTF8String();\n}\n\n\n//// DJVUIMAGE: UTILITIES\n\nGUTF8String\nDjVuImage::get_short_description() const\n{\n  GUTF8String msg = \"Empty\";\n  int width = get_width();\n  int height = get_height();\n  if (width && height)\n    {\n      if (file && file->file_size>100)\n\t//msg.format(\"%dx%d in %0.1f Kb\", width, height, file->file_size/1024.0);\n\tmsg.format( ERR_MSG(\"DjVuImage.short1\") \"\\t%d\\t%d\\t%0.1f\",\n\t\t    width, height, file->file_size/1024.0 );\n      else\n\t//msg.format(\"%dx%d\", width, height);\n\tmsg.format( ERR_MSG(\"DjVuImage.short2\") \"\\t%d\\t%d\", width, height );\n    }\n  return msg;\n}\n\nGUTF8String\nDjVuImage::get_long_description() const\n{\n  return file?(file->description):GUTF8String();\n}\n\n\nvoid\nDjVuImage::notify_chunk_done(const DjVuPort *, const GUTF8String & name)\n{\n   if (!relayout_sent &&\n     ( !name.cmp(\"INFO\", 4) ||\n       !name.cmp(\"PMxx\", 2) ||\n       !name.cmp(\"BMxx\", 2)  ) )\n   {\n      DjVuPort::get_portcaster()->notify_relayout(this);\n      relayout_sent=true;\n   } \n   else if (!name.cmp(\"Sxxx\", 1) ||\n            !name.cmp(\"BGxx\", 2) ||\n            !name.cmp(\"FGxx\", 2) ||\n            !name.cmp(\"BMxx\", 2) ||\n            !name.cmp(\"PMxx\", 2)  )\n     DjVuPort::get_portcaster()->notify_redisplay(this);\n}\n\n\n\n\n\n\n//// DJVUIMAGE: OLD-STYLE DECODING\n\nDjVuInterface::~DjVuInterface() \n{\n}\n\nclass DjVuImageNotifier : public DjVuPort\n{\n  friend class DjVuImage;\n  DjVuInterface  *notifier;\n  GP<DataPool>\t  stream_pool;\n  GURL\t\t  stream_url;\npublic:\n  DjVuImageNotifier(DjVuInterface *notifier);\n  GP<DataPool> request_data(const DjVuPort *src, const GURL & url);\n  void notify_chunk_done(const DjVuPort *, const GUTF8String &name);\n  void notify_redisplay(const class DjVuImage * source);\n  void notify_relayout(const class DjVuImage * source);\n};\n\nDjVuImageNotifier::DjVuImageNotifier(DjVuInterface *notifier)\n  : notifier(notifier)\n{\n}\n\nGP<DataPool> \nDjVuImageNotifier::request_data(const DjVuPort *src, const GURL & url)\n{\n  if (url!=stream_url)\n    G_THROW( ERR_MSG(\"DjVuImage.not_decode\") );\n  return stream_pool;\n}\n\nvoid \nDjVuImageNotifier::notify_redisplay(const class DjVuImage * source)\n{\n  if (notifier)\n    notifier->notify_redisplay();\n}\n\nvoid \nDjVuImageNotifier::notify_relayout(const class DjVuImage * source)\n{\n  if (notifier)\n    notifier->notify_relayout();\n}\n\nvoid \nDjVuImageNotifier::notify_chunk_done(const DjVuPort *, const GUTF8String &name)\n{\n  if (notifier)\n    notifier->notify_chunk(name, \"\" );\n}\n\nvoid\nDjVuImage::decode(ByteStream & str, DjVuInterface *notifier)\n{\n  DEBUG_MSG(\"DjVuImage::decode(): decoding old way...\\n\");\n  DEBUG_MAKE_INDENT(3);\n  if (file) \n    G_THROW( ERR_MSG(\"DjVuImage.bad_call\") );\n  GP<DjVuImageNotifier> pport = new DjVuImageNotifier(notifier);\n  pport->stream_url=GURL::UTF8(\"internal://fake/fake.djvu\");\n  pport->stream_pool=DataPool::create();\n  // Get all the data first\n  int length;\n  char buffer[1024];\n  while((length=str.read(buffer, 1024)))\n    pport->stream_pool->add_data(buffer, length);\n  pport->stream_pool->set_eof();\n  GP<DjVuDocument> doc = DjVuDocument::create_wait(pport->stream_url, (DjVuImageNotifier*)pport);\n  GP<DjVuImage> dimg=doc->get_page(-1, true, (DjVuImageNotifier*)pport);\n  file=dimg->get_djvu_file();\n  if (file->is_decode_stopped())\n    G_THROW( DataPool::Stop );\n  if (file->is_decode_failed())\n    G_THROW( ByteStream::EndOfFile ); // guess\n  if (!file->is_decode_ok())\n    G_THROW( ERR_MSG(\"DjVuImage.mult_error\") );\n  DEBUG_MSG(\"decode DONE\\n\");\n}\n\n\n//// DJVUIMAGE: CHECKING\n\nstatic int\ncompute_red(int w, int h, int rw, int rh)\n{\n  for (int red=1; red<16; red++)\n    if (((w+red-1)/red==rw) && ((h+red-1)/red==rh))\n      return red;\n  return 16;\n}\n\n\nint \nDjVuImage::is_legal_bilevel() const\n{\n  // Components\n  GP<DjVuInfo> info = get_info();\n  GP<JB2Image> fgjb = get_fgjb();\n  GP<IW44Image> bg44 = get_bg44();\n  GP<GPixmap>  bgpm = get_bgpm();\n  GP<GPixmap>  fgpm = get_fgpm();\n  // Check info\n  if (! info)\n    return 0;\n  int width = info->width;\n  int height = info->height;\n  if (! (width>0 && height>0))\n    return 0;\n  // Check fgjb\n  if (!fgjb)\n    return 0;\n  if (fgjb->get_width()!=width || fgjb->get_height()!=height)\n    return 0;\n  // Check that color information is not present.\n  if (bg44 || bgpm || fgpm)\n    return 0;\n  // Ok.\n  return 1;\n}\n\nint \nDjVuImage::is_legal_photo() const\n{\n  // Components\n  GP<DjVuInfo> info = get_info();\n  GP<JB2Image> fgjb = get_fgjb(); \n  GP<IW44Image> bg44 = get_bg44();\n  GP<GPixmap>  bgpm = get_bgpm();\n  GP<GPixmap>  fgpm = get_fgpm();\n  // Check info\n  if (! info)\n    return 0;\n  int width = info->width;\n  int height = info->height;\n  if (! (width>0 && height>0))\n    return 0;\n  // Check that extra information is not present.\n  if (fgjb || fgpm)\n    return 0;\n  // Check bg44\n  if (bg44 && bg44->get_width()==width && bg44->get_height()==height)\n    return 1;\n  // Check bgpm\n  if (bgpm && (int)bgpm->columns()==width && (int)bgpm->rows()==height)\n    return 1;\n  // Ok.\n  return 0;\n}\n\nint \nDjVuImage::is_legal_compound() const\n{\n  // Components\n  GP<DjVuInfo>     info = get_info();\n  GP<JB2Image>     fgjb = get_fgjb();\n  GP<IW44Image>     bg44 = get_bg44();\n  GP<GPixmap>      bgpm = get_bgpm();\n  GP<GPixmap>      fgpm = get_fgpm();\n  GP<DjVuPalette>  fgbc = get_fgbc();\n  // Check size\n  if (! info)\n    return 0;\n  int width = info->width;\n  int height = info->height;\n  if (! (width>0 && height>0))\n    return 0;\n  // Check fgjb\n  if (!fgjb)\n    return 0;\n  if (fgjb->get_width()!=width || fgjb->get_height()!=height)\n    return 0;\n  // Check background\n  int bgred = 0;\n  if (bg44)\n    bgred = compute_red(width, height, bg44->get_width(), bg44->get_height());\n  else if (bgpm)\n    bgred = compute_red(width, height, bgpm->columns(), bgpm->rows());\n  if (bgred<1 || bgred>12)\n    return 0;\n  // Check foreground colors\n  int fgred = 0;\n  if (fgbc)\n    fgred = 1;\n  else if (fgpm)\n    fgred = compute_red(width, height, fgpm->columns(), fgpm->rows());\n  if (fgred<1 || fgred>12)\n    return 0;\n  // Check that all components are present\n  if (fgjb && bgred && fgred)\n    return 1;\n  // Unrecognized\n  return 0;\n}\n\n\n//// DJVUIMAGE: LOW LEVEL RENDERING\n\nGP<GBitmap>\nDjVuImage::get_bitmap(const GRect &rect, \n                      int subsample, int align) const\n{\n  // Access image size\n  int width = get_real_width();\n  int height = get_real_height();\n  GP<JB2Image> fgjb = get_fgjb();\n  if ( width && height && fgjb && \n       (fgjb->get_width() == width) && \n       (fgjb->get_height() == height) ) \n    {\n      return fgjb->get_bitmap(rect, subsample, align);\n    }\n  return 0;\n}\n\nGP<GPixmap>\nDjVuImage::get_bg_pixmap(const GRect &rect, \n                         int subsample, double gamma, GPixel white) const\n{\n  GP<GPixmap> pm = 0;\n  // Access image size\n  \n  GP<DjVuInfo> info = get_info();\n  int width = get_real_width();\n  int height = get_real_height();\n\n\n  if (width<=0 || height<=0 || !info) return 0;\n  // Compute gamma_correction\n  double gamma_correction = 1.0;\n  if (gamma > 0)\n    gamma_correction = gamma / info->gamma;\n  if (gamma_correction < 0.1)\n    gamma_correction = 0.1;\n  else if (gamma_correction > 10)\n    gamma_correction = 10;\n  \n  // CASE1: Incremental BG IW44Image\n  GP<IW44Image> bg44 = get_bg44();\n  if (bg44)\n    {\n      int w = bg44->get_width();\n      int h = bg44->get_height();\n      // Avoid silly cases\n      if (w==0 || h==0 || width==0 || height==0)\n        return 0;\n      // Determine how much bg44 is reduced\n      int red = compute_red(width,height,w,h);\n      if (red<1 || red>12)\n        return 0;\n      // Handle pure downsampling cases\n      if (subsample == red)\n        pm = bg44->get_pixmap(1,rect);\n      else if (subsample == 2*red)\n        pm = bg44->get_pixmap(2,rect);    \n      else if (subsample == 4*red)\n        pm = bg44->get_pixmap(4,rect); \n      else if (subsample == 8*red)\n        pm = bg44->get_pixmap(8,rect); \n      // Handle fractional downsampling case\n      else if (red*4 == subsample*3)\n        {\n          GRect nrect = rect;\n          GRect xrect = rect;\n          xrect.xmin = (xrect.xmin/3)*4;\n          xrect.ymin = (xrect.ymin/3)*4;\n          xrect.xmax = ((xrect.xmax+2)/3)*4;\n          xrect.ymax = ((xrect.ymax+2)/3)*4;\n          nrect.translate(-xrect.xmin*3/4, -xrect.ymin*3/4);\n          if (xrect.xmax > w) \n            xrect.xmax = w;\n          if (xrect.ymax > h) \n            xrect.ymax = h;\n          GP<GPixmap> ipm = bg44->get_pixmap(1,xrect);\n          pm = GPixmap::create();\n          pm->downsample43(ipm, &nrect);\n        }\n      // Handle all other cases with pixmapscaler\n      else\n        {\n          // find suitable power of two\n          int po2 = 16;\n          while (po2>1 && subsample<po2*red)\n            po2 >>= 1;\n          // setup pixmap scaler\n          int inw = (w+po2-1)/po2;\n          int inh = (h+po2-1)/po2;\n          int outw = (width+subsample-1)/subsample;\n          int outh = (height+subsample-1)/subsample;\n          GP<GPixmapScaler> gps=GPixmapScaler::create(inw, inh, outw, outh);\n          GPixmapScaler &ps=*gps;\n          ps.set_horz_ratio(red*po2, subsample);\n          ps.set_vert_ratio(red*po2, subsample);\n          // run pixmap scaler\n          GRect xrect;\n          ps.get_input_rect(rect,xrect);\n          GP<GPixmap> ipm = bg44->get_pixmap(po2,xrect);\n          pm = GPixmap::create();\n          ps.scale(xrect, *ipm, rect, *pm);\n        }\n      // Apply gamma correction\n      if (pm)\n        if (gamma_correction!=1.0 || white != GPixel::WHITE)\n          pm->color_correct(gamma_correction, white);\n      return pm;\n    }\n\n  // CASE 2: Raw background pixmap\n  GP<GPixmap>  bgpm = get_bgpm();\n  if (bgpm)\n    {\n      int w = bgpm->columns();\n      int h = bgpm->rows();\n      // Avoid silly cases\n      if (w==0 || h==0 || width==0 || height==0)\n        return 0;\n      // Determine how much bgpm is reduced\n      int red = compute_red(width,height,w,h);\n      if (red<1 || red>12)\n        return 0;\n      // Handle pure downsampling cases\n      int ratio = subsample/red;\n      if (subsample==ratio*red && ratio>=1)\n        {\n          pm = GPixmap::create();\n          if (ratio == 1)\n            pm->init(*bgpm, rect);\n          else if (ratio > 1)\n            pm->downsample(bgpm, ratio, &rect);\n        }\n      // Handle all other cases with pixmapscaler\n      else\n        {\n          // setup pixmap scaler\n          int outw = (width+subsample-1)/subsample;\n          int outh = (height+subsample-1)/subsample;\n          GP<GPixmapScaler> gps=GPixmapScaler::create(w, h, outw, outh);\n          GPixmapScaler &ps=*gps;\n          ps.set_horz_ratio(red, subsample);\n          ps.set_vert_ratio(red, subsample);\n          // run pixmap scaler\n          pm = GPixmap::create();\n          GRect xrect(0,0,w,h);\n          ps.scale(xrect, *bgpm, rect, *pm);\n        }\n      // Apply gamma correction\n      if (pm)\n        if (gamma_correction!=1.0 || white != GPixel::WHITE)\n          pm->color_correct(gamma_correction, white);\n      return pm;\n    }\n\n  // FAILURE\n  return 0;\n}\n\n\nGP<GPixmap>\nDjVuImage::get_bg_pixmap(const GRect &rect, int subsample, double gamma) const\n{\n  return get_bg_pixmap(rect, subsample, gamma, GPixel::WHITE);\n}\n\n\nint  \nDjVuImage::stencil(GPixmap *pm, const GRect &rect,\n\t\t   int subsample, double gamma, GPixel white) const\n{\n  // Warping and blending. \n  if (!pm)\n    return 0;\n  // Access components\n  \n  GP<DjVuInfo> info = get_info();\n  int width = get_real_width();\n  int height = get_real_height();\n\n\n  if (width<=0 || height<=0 || !info) return 0;\n  GP<JB2Image> fgjb = get_fgjb();\n  GP<GPixmap> fgpm = get_fgpm();\n  GP<DjVuPalette> fgbc = get_fgbc();\n  \n  // Compute gamma_correction\n  double gamma_correction = 1.0;\n  if (gamma > 0)\n    gamma_correction = gamma / info->gamma;\n  if (gamma_correction < 0.1)\n    gamma_correction = 0.1;\n  else if (gamma_correction > 10)\n    gamma_correction = 10;\n\n  // Compute alpha map and relevant JB2Image components\n  GList<int> components;\n  GP<GBitmap> bm;\n  if (fgjb)\n    {\n      JB2Image *jimg = fgjb;\n      if (! (width && height && \n             jimg->get_width() == width && \n             jimg->get_height() == height ) )\n        return 0;\n      // Decode bitmap\n      bm = GBitmap::create(rect.height(), rect.width());\n      bm->set_grays(1+subsample*subsample);\n      int rxmin = rect.xmin * subsample;\n      int rymin = rect.ymin * subsample;\n      for (int blitno = 0; blitno < jimg->get_blit_count(); blitno++)\n        {\n          const JB2Blit *pblit = jimg->get_blit(blitno);\n          const JB2Shape  &pshape = jimg->get_shape(pblit->shapeno);\n          if (pshape.bits &&\n              pblit->left <= rect.xmax * subsample &&\n              pblit->bottom <= rect.ymax * subsample &&\n              pblit->left+(int)pshape.bits->columns() >= rect.xmin*subsample &&\n              pblit->bottom+(int)pshape.bits->rows() >= rect.ymin*subsample )\n            {\n              // Record component list\n              if (fgbc) components.append(blitno);\n              // Blit\n              bm->blit(pshape.bits, \n                       pblit->left - rxmin, pblit->bottom - rymin, \n                       subsample);\n            }\n        }\n    }\n\n\n  // TWO LAYER MODEL\n  if (bm && fgbc)\n    {\n      // Perform attenuation from scratch\n      pm->attenuate(bm, 0, 0);\n      // Check that fgbc has the correct size\n      JB2Image *jimg = fgjb;\n      DjVuPalette *fg = fgbc;\n      if (jimg->get_blit_count() != fg->colordata.size())\n        return 0;\n      // Copy and color correct palette\n      int palettesize = fg->size();\n      GTArray<GPixel> colors(0,palettesize-1);\n      for (int i=0; i<palettesize; i++)\n        fg->index_to_color(i, colors[i]);\n      GPixmap::color_correct(gamma_correction, white, colors, palettesize);\n      // Blit all components (one color at a time)\n      while (components.size() > 0)\n        {\n          GPosition nullpos;\n          GPosition pos = components;\n          int lastx = 0;\n          int colorindex = fg->colordata[components[pos]];\n          if (colorindex >= palettesize)\n            G_THROW( ERR_MSG(\"DjVuImage.corrupted\") );\n          // Gather relevant components and relevant rectangle\n          GList<int> compset;\n          GRect comprect;\n          while (pos)\n            {\n              int blitno = components[pos];\n              const JB2Blit *pblit = jimg->get_blit(blitno);\n              if (pblit->left < lastx) break; \n              lastx = pblit->left;\n              if (fg->colordata[blitno] == colorindex)\n                {\n                  const JB2Shape  &pshape = jimg->get_shape(pblit->shapeno);\n                  GRect rect(pblit->left, pblit->bottom, \n                             pshape.bits->columns(), pshape.bits->rows());\n                  comprect.recthull(comprect, rect);\n                  compset.insert_before(nullpos, components, pos);\n                  continue;\n                }\n              ++pos;\n            }\n          // Round alpha map rectangle\n          comprect.xmin = comprect.xmin / subsample;\n          comprect.ymin = comprect.ymin / subsample;\n          comprect.xmax = (comprect.xmax+subsample-1) / subsample;\n          comprect.ymax = (comprect.ymax+subsample-1) / subsample;\n          comprect.intersect(comprect, rect);\n          // Compute alpha map for that color\n          bm = 0;\n          bm = GBitmap::create(comprect.height(), comprect.width());\n          bm->set_grays(1+subsample*subsample);\n          int rxmin = comprect.xmin * subsample;\n          int rymin = comprect.ymin * subsample;\n          for (pos=compset; pos; ++pos)\n            {\n              int blitno = compset[pos];\n              const JB2Blit *pblit = jimg->get_blit(blitno);\n              const JB2Shape  &pshape = jimg->get_shape(pblit->shapeno);\n              bm->blit(pshape.bits, \n                       pblit->left - rxmin, pblit->bottom - rymin, \n                       subsample);\n            }\n          // Blend color into background pixmap\n          pm->blit(bm, comprect.xmin-rect.xmin, comprect.ymin-rect.ymin, \n                   &colors[colorindex]);\n        }\n      return 1;\n    }\n\n\n  // THREE LAYER MODEL\n  if (bm && fgpm)\n    {\n      // This follows fig. 4 in Adelson \"Layered representations for image\n      // coding\" (1991) http://www-bcs.mit.edu/people/adelson/papers.html.\n      // The properly warped background is already in PM.  The properly warped\n      // alpha map is already in BM.  We just have to warp the foreground and\n      // perform alpha blending.\n#ifdef SIMPLE_THREE_LAYER_RENDERING\n      int w = fgpm->columns();\n      int h = fgpm->rows();\n      // Determine foreground reduction\n      int red = compute_red(width,height, w, h);\n      if (red<1 || red>12)\n        return 0;\n      // Warp foreground pixmap\n      GPixmapScaler ps(w,h,width/subsample+1,height/subsample+1);\n      ps.set_horz_ratio(red,subsample);\n      ps.set_vert_ratio(red,subsample);\n      GP<GPixmap> nfg = new GPixmap;\n      GRect provided(0,0,w,h);\n      ps.scale(provided, *fgpm, rect, *nfg);\n      // Attenuate background and blit\n      nfg->color_correct(gamma_correction, white);\n      pm->blend(bm, 0, 0, nfg); // blend == attenuate + blit\n      return 1;\n#else \n      // Things are now a little bit more complex because the convenient\n      // function GPixmap::stencil() simultaneously upsamples the foreground \n      // by an integer factor and performs the alpha blending.  We have\n      // to determine how and when this facility can be used.\n      int w = fgpm->columns();\n      int h = fgpm->rows();\n      // Determine foreground reduction\n      int red = compute_red(width,height,w,h);\n      if (red<1 || red>12)\n        return 0;\n      // Try supersampling foreground pixmap by an integer factor\n      int supersample = ( red>subsample ? red/subsample : 1);\n      int wantedred = supersample*subsample;\n      // Try simple foreground upsampling\n      if (red == wantedred)\n        {\n          // Simple foreground upsampling is enough.\n          pm->stencil(bm, fgpm, supersample, &rect, gamma_correction, white);\n          return 1;\n        }\n      else \n        {\n          // Must pre-warp foreground pixmap\n          GP<GPixmap> nfg;\n          int desw = (w*red+wantedred-1)/wantedred;\n          int desh = (h*red+wantedred-1)/wantedred;\n          // Cache rescaled fgpm for speed\n          static const DjVuImage *tagimage  = 0;\n          static const GPixmap *tagfgpm   = 0;\n          static GP<GPixmap> cachednfg = 0;\n          // Check whether cached fgpm applies.\n          if ( cachednfg && this==tagimage && fgpm==tagfgpm\n               && desw==(int)cachednfg->columns()\n               && desh==(int)cachednfg->rows() )\n            {\n              nfg = cachednfg;\n            }\n          else\n            {\n              GP<GPixmapScaler> gps=GPixmapScaler::create(w,h,desw,desh);\n              GPixmapScaler &ps=*gps;\n              ps.set_horz_ratio(red, wantedred);\n              ps.set_vert_ratio(red, wantedred);\n              nfg = GPixmap::create();\n              GRect provided(0,0,w,h);\n              GRect desired(0,0,desw,desh);\n              ps.scale(provided, *fgpm, desired, *nfg);\n            }\n          // Use combined warp+blend function\n          pm->stencil(bm, nfg, supersample, &rect, gamma_correction, white);\n          // Cache\n          tagimage = this;\n          tagfgpm = fgpm;\n          cachednfg = nfg;\n          return 1;\n        }\n#endif\n    }\n  \n  // FAILURE\n  return 0;\n}\n\n\nGP<GPixmap>\nDjVuImage::get_fg_pixmap(const GRect &rect, \n                         int subsample, double gamma, GPixel white) const\n{\n  // Obtain white background pixmap\n  GP<GPixmap> pm;\n  // Access components\n  const int width = get_real_width();\n  const int height = get_real_height();\n  if (width && height)\n  {\n    pm = GPixmap::create(rect.height(),rect.width(), &GPixel::WHITE);\n    if (!stencil(pm, rect, subsample, gamma, white))\n      pm=0;\n  }\n  return pm;\n}\n\n\nGP<GPixmap>\nDjVuImage::get_fg_pixmap(const GRect &rect, \n                         int subsample, double gamma) const\n{\n  return get_fg_pixmap(rect, subsample, gamma, GPixel::WHITE);\n}\n\n\nGP<GPixmap>\nDjVuImage::get_pixmap(const GRect &rect, int subsample, \n                      double gamma, GPixel white) const\n{\n  // Get background\n  GP<GPixmap> pm = get_bg_pixmap(rect, subsample, gamma, white);\n  // Superpose foreground\n  if (! stencil(pm, rect, subsample, gamma, white))\n    // Avoid ugly progressive display (hack)\n    if (get_fgjb()) return 0;\n  // Return\n  return pm;\n}\n\n\nGP<GPixmap>\nDjVuImage::get_pixmap(const GRect &rect, int subsample, \n                      double gamma) const\n{\n  return get_pixmap(rect, subsample, gamma, GPixel::WHITE);\n}\n\n\n//// DJVUIMAGE: RENDERING (ARBITRARY SCALE)\n\ntypedef GP<GBitmap>(DjVuImage::*BImager)(const GRect&,int,int) const;\ntypedef GP<GPixmap>(DjVuImage::*PImager)(const GRect&,int,double,GPixel) const;\n\nstatic GP<GBitmap>\ndo_bitmap(const DjVuImage &dimg, BImager get,\n          const GRect &inrect, const GRect &inall, int align )\n{\n  GRect rect=inrect;\n  GRect all=inall;\n  if (! dimg.get_info())\n    return 0;\n  if( dimg.get_rotate() )\n    {\n      GRectMapper mapper;\n      mapper.rotate(-dimg.get_rotate());\n      mapper.map(rect);\n      mapper.map(all);\n    }\n  // Sanity\n  if (! ( all.contains(rect.xmin, rect.ymin) &&\n          all.contains(rect.xmax-1, rect.ymax-1) ))\n    G_THROW( ERR_MSG(\"DjVuImage.bad_rect\") );\n  // Check for integral reduction\n  int red;\n  int w = dimg.get_real_width();\n  int h = dimg.get_real_height();\n\n  int rw = all.width();\n  int rh = all.height();\n  GRect zrect = rect; \n  zrect.translate(-all.xmin, -all.ymin);\n  for (red=1; red<=15; red++)\n    if (rw*red>w-red && rw*red<w+red && rh*red>h-red && rh*red<h+red)\n    {\n        GP<GBitmap> bm=(dimg.*get)(zrect, red, align);\n        if(bm)\n            return bm->rotate(dimg.get_rotate());\n        else\n\t        return NULL;\n    }\n  // Find best reduction\n  for (red=15; red>1; red--)\n    if ( (rw*red < w && rh*red < h) ||\n         (rw*red*3 < w || rh*red*3 < h) )\n      break;\n  // Setup bitmap scaler\n  if (w<=0 || h<=0) return 0;\n  GP<GBitmapScaler> gbs=GBitmapScaler::create();\n  GBitmapScaler &bs=*gbs;\n  bs.set_input_size( (w+red-1)/red, (h+red-1)/red );\n  bs.set_output_size( rw, rh );\n  bs.set_horz_ratio( rw*red, w );\n  bs.set_vert_ratio( rh*red, h );\n  // Scale\n  GRect srect;\n  bs.get_input_rect(zrect, srect);\n  GP<GBitmap> sbm = (dimg.*get)(srect, red, 1);\n  if (!sbm) return 0;\n  int border = ((zrect.width() + align - 1) & ~(align - 1)) - zrect.width();\n  GP<GBitmap> bm = GBitmap::create(zrect.height(), zrect.width(), border);\n  bs.scale(srect, *sbm, zrect, *bm);\n  if( bm )\n      return bm->rotate(dimg.get_rotate());\n  else\n      return NULL;\n}\n\nstatic GP<GPixmap>\ndo_pixmap(const DjVuImage &dimg, PImager get,\n          const GRect &inrect, const GRect &inall, \n          double gamma, GPixel white )\n{\n  GRect rect=inrect;\n  GRect all=inall;\n  if (! dimg.get_info())\n    return 0;\n  if( dimg.get_rotate()%4 )\n    {\n      GRectMapper mapper;\n      mapper.rotate(-dimg.get_rotate());\n      mapper.map(rect);\n      mapper.map(all);\n    }\n  \n  // Sanity\n  if (! ( all.contains(rect.xmin, rect.ymin) &&\n          all.contains(rect.xmax-1, rect.ymax-1) ))\n    G_THROW( ERR_MSG(\"DjVuImage.bad_rect2\") );\n  // Check for integral reduction\n  int red, w=0, h=0, rw=0, rh=0;\n  w = dimg.get_real_width();\n  h = dimg.get_real_height();\n  rw = all.width();\n  rh = all.height();\n  GRect zrect = rect; \n  zrect.translate(-all.xmin, -all.ymin);\n  for (red=1; red<=15; red++)\n    if (rw*red>w-red && rw*red<w+red && rh*red>h-red && rh*red<h+red)\n    {\n      GP<GPixmap> pm = (dimg.*get)(zrect, red, gamma, white);\n        if( pm ) \n            return pm->rotate(dimg.get_rotate());\n        else\n            return NULL;\n    }\n  // These reductions usually go faster (improve!)\n  static int fastred[] = { 12,6,4,3,2,1 };\n  // Find best reduction\n  for (int i=0; (red=fastred[i])>1; i++)\n    if ( (rw*red < w && rh*red < h) ||\n         (rw*red*3 < w || rh*red*3 < h) )\n      break;\n  // Setup pixmap scaler\n  if (w<=0 || h<=0) return 0;\n  GP<GPixmapScaler> gps=GPixmapScaler::create();\n  GPixmapScaler &ps=*gps;\n  ps.set_input_size( (w+red-1)/red, (h+red-1)/red );\n  ps.set_output_size( rw, rh );\n  ps.set_horz_ratio( rw*red, w );\n  ps.set_vert_ratio( rh*red, h );\n  // Scale\n  GRect srect;\n  ps.get_input_rect(zrect, srect);\n  GP<GPixmap> spm = (dimg.*get)(srect, red, gamma, white);\n  if (!spm) return 0;\n  GP<GPixmap> pm = GPixmap::create();\n  ps.scale(srect, *spm, zrect, *pm);\n  if(pm)\n      return pm->rotate(dimg.get_rotate());\n  else\n      return NULL;\n}\n\nGP<GPixmap>  \nDjVuImage::get_pixmap(const GRect &r, const GRect &a, double g, GPixel w) const\n{\n  return do_pixmap(*this, &DjVuImage::get_pixmap, r, a, g, w);\n}\n\nGP<GPixmap>  \nDjVuImage::get_pixmap(const GRect &r, const GRect &a, double g) const\n{\n  return do_pixmap(*this, &DjVuImage::get_pixmap, r, a, g, GPixel::WHITE);\n}\n\nGP<GBitmap>  \nDjVuImage::get_bitmap(const GRect &rect, const GRect &all, int align) const\n{\n  return do_bitmap(*this, &DjVuImage::get_bitmap, rect, all, align);\n}\n\nGP<GPixmap>  \nDjVuImage::get_bg_pixmap(const GRect&r, const GRect&a, double g, GPixel w) const\n{\n  return do_pixmap(*this, &DjVuImage::get_bg_pixmap, r, a, g, w);\n}\n\nGP<GPixmap>  \nDjVuImage::get_bg_pixmap(const GRect&r, const GRect&a, double g) const\n{\n  return do_pixmap(*this, &DjVuImage::get_bg_pixmap, r, a, g, GPixel::WHITE);\n}\n\nGP<GPixmap>  \nDjVuImage::get_fg_pixmap(const GRect&r, const GRect&a, double g, GPixel w) const\n{\n  return do_pixmap(*this, &DjVuImage::get_fg_pixmap, r, a, g, w);\n}\n\nGP<GPixmap>  \nDjVuImage::get_fg_pixmap(const GRect&r, const GRect&a, double g) const\n{\n  return do_pixmap(*this, &DjVuImage::get_fg_pixmap, r, a, g, GPixel::WHITE);\n}\n\nint \nDjVuImage::get_rotate() const\n{\n  return (rotate_count<0) ? 0 : rotate_count;\n}\n\nvoid\nDjVuImage::init_rotate(const DjVuInfo &info)\n{ \n  rotate_count = info.orientation;\n}\n\nvoid DjVuImage::set_rotate(int count) \n{ \n  rotate_count = count % 4;\n}\n\nGP<DjVuAnno> \nDjVuImage::get_decoded_anno()\n{\n    GP<DjVuInfo> djvuinfo = get_info();\n    GP<DjVuAnno> djvuanno = DjVuAnno::create();\n    GP<ByteStream> bs=get_anno();\n    if( bs )\n    {\n      int rotate_count=get_rotate(); \n      /// Brain damaged adjustment of annotation \n      /// coordinates that reflect the orientation\n      /// flag in the info chunk....\n      if (djvuinfo)\n        rotate_count = rotate_count - djvuinfo->orientation;\n      ///decode\n      djvuanno->decode(bs);\n      ///map hyperlinks correctly for rotation           \n      if( rotate_count & 3 )\n        {   \n          GRect input, output;\n          input = GRect(0,0,get_width(),get_height());\n          if (rotate_count & 1)\n            output = GRect(0,0,get_height(),get_width());\n          else\n            output = GRect(0,0,get_width(),get_height());\n          GRectMapper mapper;\n          mapper.clear();\n          mapper.set_input(input);\n          mapper.set_output(output);               \n          mapper.rotate(-rotate_count);\n          GPList<GMapArea> &list=djvuanno->ant->map_areas;\n          for(GPosition pos=list;pos;++pos)\n            list[pos]->unmap(mapper);\n        }\n      return djvuanno;\n    }\n    else\n      return NULL;\n}\n\n\nvoid\nDjVuImage::map(GRect &rect) const\n{\n    GRect input, output;\n    const int rotate_count=get_rotate(); \n    if(rotate_count>0)\n    {  \n        input = GRect(0,0,get_width(), get_height());\n        output = GRect(0,0, get_real_width(), get_real_height());\n\n        GRectMapper mapper;\n        mapper.clear();\n        mapper.set_input(input);\n        mapper.set_output(output);               \n        mapper.rotate(-rotate_count);\n        mapper.map(rect);\n    }\n}\n\nvoid\nDjVuImage::unmap(GRect &rect) const\n{\n    GRect input, output;\n    const int rotate_count=get_rotate(); \n    if(rotate_count>0)\n    {  \n        input = GRect(0,0,get_width(), get_height());\n        output = GRect(0,0, get_real_width(), get_real_height());\n\n        GRectMapper mapper;\n        mapper.clear();\n        mapper.set_input(input);\n        mapper.set_output(output);               \n        mapper.rotate(-rotate_count);\n        mapper.unmap(rect);\n    }\n}\n\nvoid\nDjVuImage::map(int &x, int &y) const\n{\n    GRect input, output;\n    const int rotate_count=get_rotate(); \n    if(rotate_count>0)\n    {  \n        input = GRect(0,0,get_width(), get_height());\n        output = GRect(0,0, get_real_width(), get_real_height());\n\n        GRectMapper mapper;\n        mapper.clear();\n        mapper.set_input(input);\n        mapper.set_output(output);               \n        mapper.rotate(-rotate_count);\n        mapper.map(x, y);\n    }\n}\n\nvoid\nDjVuImage::unmap(int &x, int &y) const\n{\n    GRect input, output;\n    const int rotate_count=get_rotate(); \n    if(rotate_count>0)\n    {  \n        input = GRect(0,0,get_width(), get_height());\n        output = GRect(0,0, get_real_width(), get_real_height());\n\n        GRectMapper mapper;\n        mapper.clear();\n        mapper.set_input(input);\n        mapper.set_output(output);               \n        mapper.rotate(-rotate_count);\n        mapper.unmap(x, y);\n    }\n}\n\nbool\nDjVuImage::wait_for_complete_decode(void)\n{\n  if (file) \n  {\n    file->resume_decode(true);\n    return file->is_decode_ok();\n  }\n  return 0;\n}\n\n// Write out a DjVuXML object tag and map tag.\nvoid\nDjVuImage::writeXML(ByteStream &str_out,const GURL &doc_url,const int flags) const\n{\n  const int height=get_height();\n  \n  static const char *Object=\"<OBJECT data=\\\"\";\n  const GURL url(get_djvu_file()->get_url());\n  const GUTF8String pagename(url.fname());\n  GUTF8String page_param;\n  if(doc_url.is_valid() && !doc_url.is_empty() && (doc_url != url))\n  {\n    str_out.writestring(Object+doc_url.get_string());\n    page_param=\"<PARAM name=\\\"PAGE\\\" value=\\\"\"+pagename+\"\\\" />\\n\";\n  }else\n  {\n    str_out.writestring(Object+doc_url.get_string());\n  }\n  str_out.writestring(\"\\\" type=\\\"\"+get_mimetype()+\"\\\" height=\\\"\"\n    +GUTF8String(height)+\"\\\" width=\\\"\"+GUTF8String(get_width())\n    +\"\\\" usemap=\\\"\"+pagename.toEscaped()+\"\\\" >\\n\");\n  if(!(flags & NOINFO))\n  {\n    const GP<DjVuInfo> info(get_info());\n    if(info)\n    {\n      info->writeParam(str_out);\n    }\n  }\n  str_out.writestring(page_param);\n  const GP<DjVuAnno> anno(DjVuAnno::create());\n  if(!(flags & NOINFO)||!(flags&NOMAP))\n  {\n    const GP<ByteStream> anno_str(get_anno());\n    if(anno_str)\n    {\n      anno->decode(anno_str);\n    }\n    if(!(flags & NOINFO))\n    {\n      anno->writeParam(str_out);\n    }\n  }\n  if(!(flags & NOTEXT))\n  {\n    const GP<DjVuText> text(DjVuText::create());\n    {\n      const GP<ByteStream> text_str(get_text());\n      if(text_str)\n      {\n        text->decode(text_str);\n      }\n      text->writeText(str_out,height);\n    }\n  }\n  if(!(flags & NOMETA))\n  {\n    const GP<ByteStream> meta_str(get_meta());\n    if(meta_str)\n    {\n      GP<IFFByteStream> giff=IFFByteStream::create(meta_str);\n      IFFByteStream &iff=*giff;\n      GUTF8String chkid;\n      while( iff.get_chunk(chkid))\n      {\n        GP<ByteStream> gbs(iff.get_bytestream());\n        if(chkid == \"METa\")\n        {\n\t   str_out.copy(*gbs);\n          //str_out.writestring(gbs->getAsUTF8());\n        }else if(chkid == \"METz\")\n        {\n          gbs=BSByteStream::create(gbs);\n          str_out.copy(*gbs);\n          //str_out.writestring(gbs->getAsUTF8());\n        }\n        iff.close_chunk();\n      }\n    }\n  }\n  str_out.writestring(GUTF8String(\"</OBJECT>\\n\"));\n  if(!(flags & NOMAP))\n  {\n    anno->writeMap(str_out,pagename,height);\n  }\n}\n\n// Write out a DjVuXML object tag and map tag.\nvoid\nDjVuImage::writeXML(ByteStream &str_out) const\n{\n  writeXML(str_out,GURL());\n}\n\n// Write out a DjVuXML object tag and map tag.\nGUTF8String\nDjVuImage::get_XML(const GURL &doc_url,const int flags) const\n{\n  GP<ByteStream> gbs(ByteStream::create());\n  ByteStream &bs=*gbs;\n  writeXML(bs,doc_url);\n  bs.seek(0L);\n  return bs.getAsUTF8();\n}\n\n// Write out a DjVuXML object tag and map tag.\nGUTF8String\nDjVuImage::get_XML(void) const\n{\n  return get_XML(GURL());\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVuImage.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _DJVUIMAGE_H\n#define _DJVUIMAGE_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n/** @name DjVuImage.h\n\n    Files #\"DjVuImage.h\"# and #\"DjVuImage.cpp\"# implement \\Ref{DjVuImage}\n    class produced as a result of decoding of DjVu files. In the previous\n    version of the library both the rendering {\\bf and} decoding have been\n    handled by \\Ref{DjVuImage}. This is no longer true. Now the\n    \\Ref{DjVuDocument} and \\Ref{DjVuFile} classes handle decoding of both\n    single page and multi page documents.\n\n    For compatibility reasons though, we still support old-style decoding\n    interface through the \\Ref{DjVuImage} class for single page documents\n    {\\em only}. As before, the display programs can call the decoding\n    function from a separate thread.  The user interface thread may call\n    the rendering functions at any time. Rendering will be performed using\n    the most recent data generated by the decoding thread. This multithreaded\n    capability enables progressive display of remote images.\n\n    {\\bf Creating DjVu images} --- Class \\Ref{DjVuImage} does not provide a\n    direct way to create a DjVu image.  The recommended procedure consists of\n    directly writing the required chunks into an \\Ref{IFFByteStream} as\n    demonstrated in program \\Ref{djvumake}.  Dealing with too many encoding\n    issues (such as chunk ordering and encoding quality) would indeed make the\n    decoder unnecessarily complex.\n\n    {\\bf ToDo: Layered structure} --- Class #DjVuImage# currently contains an\n    unstructured collection of smart pointers to various data structures.\n    Although it simplifies the rendering routines, this choice does not\n    reflect the layered structure of DjVu images and does not leave much room\n    for evolution.  We should be able to do better.\n\n    @memo\n    Decoding DjVu and IW44 images.\n    @author\n    L\\'eon Bottou <leonb@research.att.com> - initial implementation\n    Andrei Erofeev <eaf@geocities.com> - multipage support\n*/\n//@{\n\n\n\n#include \"DjVuFile.h\"\n#include \"DjVuAnno.h\"\n#include \"GRect.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n/* Obsolete class included for backward compatibility. */\n\nclass DjVuInterface\n{\npublic:\n  virtual ~DjVuInterface();\n  virtual void notify_chunk(const char *chkid, const char *msg) = 0;\n  virtual void notify_relayout(void) = 0;\n  virtual void notify_redisplay(void) = 0;\n};\n\n\n/** Main DjVu Image data structure.  This class defines the internal\n    representation of a DjVu image.  This representation consists of a few\n    pointers referencing the various components of the DjVu image.  These\n    components are created and populated by the decoding function.  The\n    rendering functions then can use the available components to compute a\n    pixel representation of the desired segment of the DjVu image. */\n\nclass DJVUAPI DjVuImage : public DjVuPort\n{\nprotected:\n  DjVuImage(void);\npublic:\n  enum { NOINFO, NOTEXT=1, NOMAP=4, NOMETA=8 };\n  // CONSTRUCTION\n  /** @name Construction. */\n  //@{\n  /** Creates an empty DjVu image. After the image has been constructed,\n      it may be connected to an existing \\Ref{DjVuFile} or left as is.\n\n      In the former case #DjVuImage# will look for its decoded components\n      (like #Sjbz# or #BG44#) by decending the hierarchy of \\Ref{DjVuFile}s\n      starting from the one passed to \\Ref{connect}().\n\n      In the latter case you can use \\Ref{decode}() function to decode\n      {\\bf single-page} DjVu documents in the old-style way. */\n  static GP<DjVuImage> create(void) {return new DjVuImage();}\n\n  /** Connects this #DjVuImage# to the passed \\Ref{DjVuFile}. The #DjVuImage#\n      will use this \\Ref{DjVuFile} to retrieve components necessary for\n      decoding. It will also connect itself to \\Ref{DjVuFile} using the\n      communication mechanism provided by \\Ref{DjVuPort} and \\Ref{DjVuPortcaster}.\n      This will allow it to receive and relay messages and requests generated\n      by the passed \\Ref{DjVuFile} and any file included into it. */\n  void\t\tconnect(const GP<DjVuFile> & file);\n\n  /** This combines the above two steps for simplier code operations. */\n  static GP<DjVuImage> create(const GP<DjVuFile> &file)\n  { const GP<DjVuImage> retval=create(); retval->connect(file); return retval; }\n      \n  //@}\n\n  // COMPONENTS\n  /** @name Components. */\n  //@{\n  /** Returns a pointer to a DjVu information component.\n      This function returns a null pointer until the decoder\n      actually processes an #\"INFO\"# chunk. */\n  GP<DjVuInfo>    get_info() const;\n  /** Returns a pointer to the IW44 encoded background component of a DjVu\n      image.  This function returns a null pointer until the decoder actually\n      processes an #\"BG44\"# chunk. */\n  GP<IW44Image>    get_bg44() const;\n  /** Returns a pointer to the raw background component of a DjVu image. The\n      background component is used for JPEG encoded backgrounds.  This\n      function returns a null pointer until the decoder actually processes an\n      #\"BGjp\"# chunk. */\n  GP<GPixmap>     get_bgpm() const;\n  /** Returns a pointer to the mask of the foreground component of a DjVu\n      image. The mask of the foreground component is always a JB2 image in\n      this implementation. This function returns a null pointer until the\n      decoder actually processes an #\"Sjbz\"# chunk. */\n  GP<JB2Image>    get_fgjb() const;\n  /** Returns a pointer to the colors of the foreground component of a DjVu\n      image. The mask of the foreground component is always a small pixmap in\n      this implementation. This function returns a null pointer until the\n      decoder actually processes an #\"FG44\"# chunk. */\n  GP<GPixmap>     get_fgpm() const;\n  /** Returns a pointer to a palette object containing colors for the \n      foreground components of a DjVu image.  These colors are only\n      pertinent with respect to the JB2Image. */\n  GP<DjVuPalette> get_fgbc() const;\n  /** Returns a pointer to a ByteStream containing all the annotation\n      chunks collected so far for this image.  Individual chunks can be\n      retrieved using \\Ref{IFFByteStream}. Returns NULL if no chunks have been\n      collected yet. */\n  GP<ByteStream> get_anno() const;\n  /** Returns a pointer to a ByteStream containing all the hidden text.\n      Returns NULL if no chunks have been collected yet. */\n  GP<ByteStream> get_text() const;\n  /** Returns a pointer to a ByteStream containing all the metadata.\n      Returns NULL if no chunks have been collected yet. */\n  GP<ByteStream> get_meta() const;\n  //@}\n\n  // NEW STYLE DECODING\n  /** @name New style decoding. */\n  //@{\n  /** The decoder is now started when the image is created\n      by function \\Ref{DjVuDocument::get_page} in \\Ref{DjVuDocument}. \n      This function waits until the decoding thread terminates\n      and returns TRUE if the image has been successfully decoded. */\n  bool wait_for_complete_decode(void);\n  //@}\n  \n  // OLD STYLE DECODING\n  /** @name Old style decoding (backward compatibility). */\n  //@{\n  /** This function is here for backward compatibility. Now, with the\n      introduction of multipage DjVu documents, the decoding is handled\n      by \\Ref{DjVuFile} and \\Ref{DjVuDocument} classes. For single page\n      documents though, we still have this wrapper. */\n  void decode(ByteStream & str, DjVuInterface *notifier=0);\n  //@}\n  \n  // UTILITIES\n  /** @name Utilities */\n  //@{\n  /** Returns the width of the DjVu image. This function just extracts this\n      information from the DjVu information component. It returns zero if such\n      a component is not yet available. This gives rotated width if there is any\n      rotation of image. If you need real width, use #get_real_width()#.*/\n  int get_width() const;\n  /** Returns the height of the DjVu image. This function just extracts this\n      information from the DjVu information component. It returns zero if such\n      a component is not yet available. This gives rotated height if there is any\n      rotation of image. If you need real width, use #get_real_height()#.*/\n  int get_height() const;\n  /** Returns the width of the DjVu image. This function just extracts this\n      information from the DjVu information component. It returns zero if such\n      a component is not yet available.*/\n  int get_real_width() const;\n  /** Returns the height of the DjVu image. This function just extracts this\n      information from the DjVu information component. It returns zero if such\n      a component is not yet available.*/\n  int get_real_height() const;\n  /** Returns the format version the DjVu data. This function just extracts\n      this information from the DjVu information component. It returns zero if\n      such a component is not yet available.  This version number should\n      be compared with the \\Ref{DjVu version constants}. */\n  int get_version() const;\n  /** Returns the resolution of the DjVu image. This information is given in\n      pixels per 2.54 cm.  Display programs can use this information to\n      determine the natural magnification to use for rendering a DjVu\n      image. */\n  int get_dpi() const;\n  /** Same as \\Ref{get_dpi}() but instead of precise value returns the closest\n      \"standard\" one: 25, 50, 75, 100, 150, 300, 600. If dpi is greater than\n      700, it's returned as is. */\n  int get_rounded_dpi() const;\n  /** Returns the gamma coefficient of the display for which the image was\n      designed.  The rendering functions can use this information in order to\n      perform color correction for the intended display device. */\n  double get_gamma() const;\n  /** Returns a MIME type string describing the DjVu data.  This information\n      is auto-sensed by the decoder.  The MIME type can be #\"image/djvu\"# or\n      #\"image/iw44\"# depending on the data stream. */\n  GUTF8String get_mimetype() const;\n  /** Returns a short string describing the DjVu image.\n      Example: #\"2500x3223 in 23.1 Kb\"#. */\n  GUTF8String get_short_description() const;\n  /** Returns a verbose description of the DjVu image.  This description lists\n      all the chunks with their size and a brief comment, as shown in the\n      following example.\n      \\begin{verbatim}\n      DJVU Image (2325x3156) version 17:\n       0.0 Kb   'INFO'  Page information.\n       17.3 Kb  'Sjbz'  JB2 foreground mask (2325x3156)\n       2.5 Kb   'BG44'  IW44 background (775x1052)\n       1.0 Kb   'FG44'  IW44 foreground colors (194x263)\n       3.0 Kb   'BG44'  IW44 background (part 2).\n       0.9 Kb   'BG44'  IW44 background (part 3).\n       7.1 Kb   'BG44'  IW44 background (part 4).\n      Compression ratio: 676 (31.8 Kb)\n      \\end{verbatim} */\n  GUTF8String get_long_description() const;\n  /** Returns pointer to \\Ref{DjVuFile} which contains this image in\n      compressed form. */\n  GP<DjVuFile> get_djvu_file(void) const;\n  /// Write out a DjVuXML object tag and map tag.\n  void writeXML(ByteStream &str_out,const GURL &doc_url, const int flags=0) const;\n  /// Write out a DjVuXML object tag and map tag.\n  void writeXML(ByteStream &str_out) const;\n  /// Get a DjVuXML object tag and map tag.\n  GUTF8String get_XML(const GURL &doc_url, const int flags=0) const;\n  /// Get a DjVuXML object tag and map tag.\n  GUTF8String get_XML(void) const;\n  //@}\n\n  // CHECKING\n  /** @name Checking for legal DjVu files. */\n  //@{\n  /** This function returns true if this object contains a well formed {\\em\n      Photo DjVu Image}. Calling function #get_pixmap# on a well formed photo\n      image should always return a non zero value.  Note that function\n      #get_pixmap# works as soon as sufficient information is present,\n      regardless of the fact that the image follows the rules or not. */\n  int is_legal_photo() const;\n  /** This function returns true if this object contains a well formed {\\em\n      Bilevel DjVu Image}.  Calling function #get_bitmap# on a well formed\n      bilevel image should always return a non zero value.  Note that function\n      #get_bitmap# works as soon as a foreground mask component is present,\n      regardless of the fact that the image follows the rules or not. */\n  int is_legal_bilevel() const;\n  /** This function returns true if this object contains a well formed {\\em\n      Compound DjVu Image}.  Calling function #get_bitmap# or #get_pixmap# on\n      a well formed compound DjVu image should always return a non zero value.\n      Note that functions #get_bitmap# or #get_pixmap# works as soon as\n      sufficient information is present, regardless of the fact that the image\n      follows the rules or not.  */\n  int is_legal_compound() const;\n  //@}\n\n  // RENDERING \n  /** @name Rendering.  \n      All these functions take two rectangles as argument.  Conceptually,\n      these function first render the whole image into a rectangular area\n      defined by rectangle #all#.  The relation between this rectangle and the\n      image size define the appropriate scaling.  The rendering function then\n      extract the subrectangle #rect# and return the corresponding pixels as a\n      #GPixmap# or #GBitmap# object.  The #all# and #rect# should take the any\n      rotation in to effect, The actual implementation performs these\n      two operation simultaneously for obvious efficiency reasons.  The best\n      rendering speed is achieved by making sure that the size of rectangle\n      #all# and the size of the DjVu image are related by an integer ratio. */\n  //@{\n  /** Renders the image and returns a color pixel image.  Rectangles #rect#\n      and #all# are used as explained above. Color correction is performed\n      according to argument #gamma#, which represents the gamma coefficient of\n      the display device on which the pixmap will be rendered.  The default\n      value, zero, means that no color correction should be performed. \n      This function returns a null pointer if there is not enough information\n      in the DjVu image to properly render the desired image. */\n  GP<GPixmap>  get_pixmap(const GRect &rect, const GRect &all, \n                          double gamma, GPixel white) const;\n  GP<GPixmap>  get_pixmap(const GRect &rect, const GRect &all, \n                          double gamma=0) const;\n  /** Renders the mask of the foreground layer of the DjVu image.  This\n      functions is a wrapper for \\Ref{JB2Image::get_bitmap}.  Argument #align#\n      specified the alignment of the rows of the returned images.  Setting\n      #align# to #4#, for instance, will adjust the bitmap border in order to\n      make sure that each row of the returned image starts on a word (four\n      byte) boundary.  This function returns a null pointer if there is not\n      enough information in the DjVu image to properly render the desired\n      image. */\n  GP<GBitmap>  get_bitmap(const GRect &rect, const GRect &all, \n                          int align = 1) const;\n  /** Renders the background layer of the DjVu image.  Rectangles #rect# and\n      #all# are used as explained above. Color correction is performed\n      according to argument #gamma#, which represents the gamma coefficient of\n      the display device on which the pixmap will be rendered.  The default\n      value, zero, means that no color correction should be performed.  This\n      function returns a null pointer if there is not enough information in\n      the DjVu image to properly render the desired image. */\n  GP<GPixmap>  get_bg_pixmap(const GRect &rect, const GRect &all, \n                             double gamma, GPixel white) const;\n  GP<GPixmap>  get_bg_pixmap(const GRect &rect, const GRect &all, \n                             double gamma=0) const;\n  /** Renders the foreground layer of the DjVu image.  Rectangles #rect# and\n      #all# are used as explained above. Color correction is performed\n      according to argument #gamma#, which represents the gamma coefficient of\n      the display device on which the pixmap will be rendered.  The default\n      value, zero, means that no color correction should be performed.  This\n      function returns a null pointer if there is not enough information in\n      the DjVu image to properly render the desired image. */\n  GP<GPixmap>  get_fg_pixmap(const GRect &rect, const GRect &all, \n                             double gamma, GPixel white) const;\n  GP<GPixmap>  get_fg_pixmap(const GRect &rect, const GRect &all, \n                             double gamma=0) const;\n\n\n  /** set the rotation count(angle) in counter clock wise for the image\n    values (0,1,2,3) correspond to (0,90,180,270) degree rotation*/\n  void set_rotate(int count=0);\n  /** returns the rotation count*/\n  int get_rotate() const;\n  /** returns decoded annotations in DjVuAnno object in which all hyperlinks\n      and hilighted areas are rotated as per rotation setting*/\n  GP<DjVuAnno> get_decoded_anno();\n  /** maps the given #rect# from rotated co-ordinates to unrotated document \n      co-ordinates*/\n  void map(GRect &rect) const;\n  /** unmaps the given #rect# from unrotated document co-ordinates to rotated  \n      co-ordinates*/\n  void unmap(GRect &rect) const;\n  /** maps the given #x#, #y# from rotated co-ordinates to unrotated document \n      co-ordinates*/\n  void map(int &x, int &y) const;\n  /** unmaps the given #x#, #y# from unrotated document co-ordinates to rotated  \n      co-ordinates*/\n  void unmap(int &x, int &y) const;\n\n\n\n  //@}\n\n  // Inherited from DjVuPort.\n  virtual void notify_chunk_done(const DjVuPort *, const GUTF8String &name);\n\n  // SUPERSEDED\n  GP<GPixmap>  get_pixmap(const GRect &r, int s=1, double g=0) const;\n  GP<GPixmap>  get_pixmap(const GRect &r, int s, double g, GPixel w) const;\n  GP<GBitmap>  get_bitmap(const GRect &r, int s=1, int align = 1) const;\n  GP<GPixmap>  get_bg_pixmap(const GRect &r, int s=1, double g=0) const;\n  GP<GPixmap>  get_bg_pixmap(const GRect &r, int s, double g, GPixel w) const;\n  GP<GPixmap>  get_fg_pixmap(const GRect &r, int s=1, double g=0) const;\n  GP<GPixmap>  get_fg_pixmap(const GRect &r, int s, double g, GPixel w) const;\nprivate:\n  GP<DjVuFile>\t\tfile;\n  int\t\t\trotate_count;\n  bool\t\t\trelayout_sent;\n  \n  // HELPERS\n  int stencil(GPixmap *pm, const GRect &rect, int s, double g, GPixel w) const;\n  GP<DjVuInfo>\t\tget_info(const GP<DjVuFile> & file) const;\n  GP<IW44Image>\t\tget_bg44(const GP<DjVuFile> & file) const;\n  GP<GPixmap>\t\tget_bgpm(const GP<DjVuFile> & file) const;\n  GP<JB2Image>\t\tget_fgjb(const GP<DjVuFile> & file) const;\n  GP<GPixmap>\t\tget_fgpm(const GP<DjVuFile> & file) const;\n  GP<DjVuPalette>      get_fgbc(const GP<DjVuFile> & file) const;\n  void init_rotate(const DjVuInfo &info);\n};\n\n\ninline GP<DjVuFile>\nDjVuImage::get_djvu_file(void) const\n{\n   return file;\n}\n\n//@}\n\n\n\n// ----- THE END\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVuInfo.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"DjVuInfo.h\"\n#include \"GException.h\"\n#include \"ByteStream.h\"\n#include \"GString.h\"\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n// ----------------------------------------\n// CLASS DJVUINFO\n\n\n#define STRINGIFY(x) STRINGIFY_(x)\n#define STRINGIFY_(x) #x\n\n\nDjVuInfo::DjVuInfo()\n  : width(0), height(0), \n#ifdef DJVUVERSION_FOR_OUTPUT\n    version(DJVUVERSION_FOR_OUTPUT),\n#else\n    version(DJVUVERSION),\n#endif\n    dpi(300), gamma(2.2), orientation(0)\n{\n}\n\nvoid \nDjVuInfo::decode(ByteStream &bs)\n{\n  // Set to default values\n  width = 0;\n  height = 0;\n  version = DJVUVERSION;\n  dpi = 300;\n  gamma = 2.2;\n  orientation=0;\n  // Read data\n  unsigned char buffer[10];\n  int  size = bs.readall((void*)buffer, sizeof(buffer));\n  if (size == 0)\n    G_THROW( ByteStream::EndOfFile );\n  if (size < 5)\n    G_THROW( ERR_MSG(\"DjVuInfo.corrupt_file\") );\n  // Analyze data with backward compatibility in mind!\n  if (size>=2)\n    width = (buffer[0]<<8) + buffer[1];\n  if (size>=4)\n    height = (buffer[2]<<8) + buffer[3];\n  if (size>=5)\n    version = buffer[4];\n  if (size>=6 && buffer[5]!=0xff)\n    version = (buffer[5]<<8) + buffer[4];\n  if (size>=8 && buffer[7]!=0xff)\n    dpi = (buffer[7]<<8) + buffer[6];\n  if (size>=9)\n    gamma = 0.1 * buffer[8];\n  int flags=0;\n  if (size>=10)\n    flags = buffer[9];\n  // Fixup\n  if (gamma<0.3)\n    gamma=0.3;\n  if (gamma>5.0)\n    gamma=5.0;\n  if (dpi < 25 || dpi > 6000)\n    dpi = 300;\n  switch (flags & 0x7)\n    {\n    case 6:  orientation=1; break; \n    case 2:  orientation=2; break; \n    case 5:  orientation=3; break;\n    default: orientation=0; break;\n    }\n}\n\nvoid \nDjVuInfo::encode(ByteStream &bs)\n{\n  bs.write16(width);\n  bs.write16(height);\n  bs.write8(version & 0xff);\n  bs.write8(version >> 8);\n  bs.write8(dpi & 0xff);\n  bs.write8(dpi >> 8);\n  bs.write8((int)(10.0*gamma+0.5) );\n  unsigned char flags;\n  switch (orientation) \n    {\n    default: flags=1; break;\n    case 1:  flags=6; break;\n    case 2:  flags=2; break;\n    case 3:  flags=5; break;\n    }\n  bs.write8(flags);\n}\n\nunsigned int \nDjVuInfo::get_memory_usage() const\n{\n  return sizeof(DjVuInfo);\n}\n\nGUTF8String\nDjVuInfo::get_paramtags(void) const\n{\n  GUTF8String retval;\n  if(orientation)\n    retval+=\"<PARAM name=\\\"ROTATE\\\" value=\\\"\"\n      +GUTF8String(((4-orientation)%4)*90)+\"\\\" />\\n\";\n  if(dpi)\n    retval+=\"<PARAM name=\\\"DPI\\\" value=\\\"\"\n      +GUTF8String(dpi)+\"\\\" />\\n\";\n  if(gamma)\n    retval+=\"<PARAM name=\\\"GAMMA\\\" value=\\\"\"\n      +GUTF8String(gamma)+\"\\\" />\\n\";\n  return retval;\n}\n\nvoid\nDjVuInfo::writeParam(ByteStream &str_out) const\n{\n  str_out.writestring(get_paramtags());\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVuInfo.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _DJVUINFO_H\n#define _DJVUINFO_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n/** @name DjVuInfo.h\n    Each instance of class #DjVuInfo# represents the information\n    contained in the information chunk of a DjVu file.  This #\"INFO\"#\n    chunk is always the first chunk of a DjVu file.\n    @memo\n    DjVu information chunk.\n    @author\n    L\\'eon Bottou <leonb@research.att.com>\n*/\n//@{\n\n\n\n#include \"GSmartPointer.h\"\n#include \"GRect.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass ByteStream;\n\n/** @name DjVu version constants\n    @memo DjVu file format version. */\n//@{\n/** Current DjVu format version.  The value of this macro represents the\n    version of the DjVu file format implemented by this release of the DjVu\n    Reference Library. */\n#define DJVUVERSION              26\n/** DjVu format version. This is the value used in files produced \n    with DjVuLibre. This is smaller than DJVUVERSION because version\n    number inflation causes problems with older software. */ \n#define DJVUVERSION_FOR_OUTPUT   24\n/** This is the version which introduced orientations. */\n#define DJVUVERSION_ORIENTATION  22\n/** Oldest DjVu format version supported by this library.  This release of the\n    library cannot completely decode DjVu files whose version field is less\n    than or equal to this number. */\n#define DJVUVERSION_TOO_OLD      15\n/** Newest DjVu format partially supported by this library.  This release of\n    the library will attempt to decode files whose version field is smaller\n    than this macro.  If the version field is greater than or equal to this\n    number, the decoder will just throw a \\Ref{GException}.  */\n#define DJVUVERSION_TOO_NEW      50\n//@}\n\n\nclass GUTF8String;\n\n/** Information component.\n    Each instance of class #DjVuInfo# represents the information\n    contained in the information chunk of a DjVu file.  This #\"INFO\"#\n    chunk is always the first chunk of a DjVu file.\n */\n\nclass DJVUAPI DjVuInfo : public GPEnabled\n{\nprotected:\n  DjVuInfo(void);\npublic:\n  /** Creates an empty DjVuInfo object.\n      The #width# and #height# fields are set to zero.\n      All other fields are initialized with suitable default values. */\n  static GP<DjVuInfo> create(void) {return new DjVuInfo();}\n\n  /** Decodes the DjVu #\"INFO\"# chunk.  This function reads binary data from\n      ByteStream #bs# and populates the fields of this DjVuInfo object.  It is\n      normally called after detecting an #\"INFO\"# chunk header with function\n      \\Ref{IFFByteStream::get_chunk}. */\n  void decode(ByteStream &bs);\n  /** Encodes the DjVu #\"INFO\"# chunk. This function writes the fields of this\n      DjVuInfo object into ByteStream #bs#. It is normally called after\n      creating an #\"INFO\"# chunk header with function\n      \\Ref{IFFByteStream::put_chunk}. */\n  void encode(ByteStream &bs);  \n  /** Returns the number of bytes used by this object. */\n  unsigned int get_memory_usage() const;\n  /** Width of the DjVu image (in pixels). */\n  int width;\n  /** Height of the DjVu image (in pixels). */\n  int height;\n  /** DjVu file version number.  This number characterizes the file format\n      version used by the encoder to generate this DjVu image.  A decoder\n      should compare this version number with the constants described in\n      section \"\\Ref{DjVu version constants}\". */\n  int version;\n  /** Resolution of the DjVu image.  The resolution is given in ``pixels per\n      2.54 centimeters'' (this unit is sometimes called ``pixels per\n      inch''). Display programs can use this information to determine the\n      natural magnification to use for rendering a DjVu image. */\n  int dpi;\n  /** Gamma coefficient of the display for which the image was designed.  The\n      rendering functions can use this information in order to perform color\n      correction for the intended display device. */\n  double gamma;\n\n  /** Image orientation:\n      0: no rotation      1: 90 degrees counter-clockwise\n      2: 180 degrees      3: 270 degrees counter-clockwise */\n  int orientation;\n\n     /// Obtain the flags for the default specifications.\n  GUTF8String get_paramtags(void) const;\n     /// Obtain the flags for the default specifications.\n  void writeParam(ByteStream &out_str) const;\n};\n\n\n//@}\n\n// ----- THE END\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVuMessage.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n// From: Leon Bottou, 1/31/2002\n// All these XML messages are Lizardtech innovations.\n\n#include \"DjVuMessage.h\"\n#include \"GOS.h\"\n#include \"XMLTags.h\"\n#include \"ByteStream.h\"\n#include \"GURL.h\"\n#include \"debug.h\"\n#include <ctype.h>\n#include <string.h>\n#include <stddef.h>\n#include <stdlib.h>\n#ifdef WIN32\n# include <tchar.h>\n# include <windows.h>\n# include <winreg.h>\n#endif\n#ifdef UNIX\n# include <unistd.h>\n# include <pwd.h>\n# include <sys/types.h>\n#endif\n#include <locale.h>\n#ifndef LC_MESSAGES\n# define LC_MESSAGES LC_ALL\n#endif\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nGUTF8String &\nDjVuMessage::programname(void)\n{\n  static GUTF8String xprogramname;\n  use_language();\n  return xprogramname;\n}\n\nstatic const char namestring[]=\"name\";\nstatic const char srcstring[]=\"src\";\n\nstatic const char *failed_to_parse_XML=ERR_MSG(\"DjVuMessage.failed_to_parse_XML\");\nstatic const char bodystring[]=\"BODY\";\nstatic const char languagestring[]=\"LANGUAGE\";\nstatic const char headstring[]=\"HEAD\";\nstatic const char includestring[]=\"INCLUDE\";\nstatic const char messagestring[]=\"MESSAGE\";\nstatic const char localestring[]=\"locale\";\n\n\n// directory names for searching messages\n#ifdef AUTOCONF\nstatic const char DjVuDataDir[] = DIR_DATADIR \"/djvu/osi\";\n#endif /* AUTOCONF */\nstatic const char ModuleDjVuDir[] =\"share/djvu/osi\";\nstatic const char ProfilesDjVuDir[] =\"profiles\";\nstatic const char LocalDjVuDir[] =\".DjVu\";      // relative to ${HOME}\n#ifdef LT_DEFAULT_PREFIX\nstatic const char DjVuPrefixDir[] = LT_DEFAULT_PREFIX \"/profiles\";\n#endif\n#ifndef NDEBUG\nstatic const char DebugModuleDjVuDir[] =\"../TOPDIR/SRCDIR/profiles\";\n#endif\n#ifdef WIN32\nstatic const char RootDjVuDir[] =\"C:/Program Files/LizardTech/Profiles\";\nstatic const TCHAR registrypath[]= TEXT(\"Software\\\\LizardTech\\\\DjVu\\\\Profile Path\");\n#else\nstatic const char RootDjVuDir[] =\"/etc/DjVu/\";  // global last resort\n#endif\n\nstatic const char DjVuEnv[] = \"DJVU_CONFIG_DIR\";\n\n//  The name of the message file\nstatic const char MessageFile[]=\"messages.xml\";\nstatic const char LanguageFile[]=\"languages.xml\";\n\n#ifdef WIN32\nstatic GURL\nRegOpenReadConfig ( HKEY hParentKey )\n{\n  GURL retval;\n  LPCTSTR path = registrypath;\n  HKEY hKey = 0;\n  if (RegOpenKeyEx(hParentKey, path, 0,\n\t\t   KEY_READ, &hKey) == ERROR_SUCCESS )\n  {\n    CHAR path[1024];\n    CHAR *szPathValue = path;\n    LPCSTR lpszEntry = \"\";\n    DWORD dwCount = (sizeof(path)/sizeof(CHAR))-1;\n    DWORD dwType;\n    LONG lResult = RegQueryValueExA(hKey, lpszEntry, NULL,\n\t\t\t&dwType, (LPBYTE)szPathValue, &dwCount);\n    RegCloseKey(hKey);\n    if ((lResult == ERROR_SUCCESS))\n    {\n      szPathValue[dwCount] = 0;\n      retval=GURL::Filename::Native(path);\n    }\n  } \n  return retval;\n}\n\nstatic GURL\nGetModulePath( void )\n{\n  const GUTF8String cwd(GOS::cwd());\n  CHAR path[1024];\n  DWORD dwCount = (sizeof(path)/sizeof(CHAR))-1;\n  GetModuleFileNameA(0, path, dwCount);\n  GURL retval=GURL::Filename::Native(path).base();\n  GOS::cwd(cwd);\n  return retval;\n}\n#elif defined(UNIX)\n\nstatic GList<GURL>\nparsePATH(void)\n{\n  GList<GURL> retval;\n  const char *path=getenv(\"PATH\");\n  if(path)\n  {\n    GNativeString p(path);\n    int from=0;\n    for(int to;(to=p.search(':',from))>0;from=to+1)\n    {\n      if(to > from)\n      {\n        retval.append(GURL::Filename::Native(p.substr(from,to-from)));\n      }\n    }\n    if((from+1)<(int)p.length())\n    {\n      retval.append(GURL::Filename::Native(p.substr(from,-1)));\n    }\n  }\n  return retval;\n}\n\nstatic GURL\nGetModulePath( void )\n{\n GURL retval;\n GUTF8String &xprogramname=DjVuMessage::programname();\n if(xprogramname.length())\n {\n   if(xprogramname[1]=='/'\n     ||!xprogramname.cmp(\"../\",3)\n     ||!xprogramname.cmp(\"./\",2))\n   {\n     retval=GURL::Filename::UTF8(xprogramname);\n   }\n   if(retval.is_empty() || !retval.is_file())\n   {\n     GList<GURL> paths(parsePATH());\n     GMap<GUTF8String,void *> pathMAP;\n     for(GPosition pos=paths;pos;++pos)\n     {\n       retval=GURL::UTF8(xprogramname,paths[pos]);\n       const GUTF8String path(retval.get_string());\n       if(!pathMAP.contains(path))\n       {\n         if(retval.is_file())\n           break;\n         pathMAP[path]=0;\n       }\n     }\n   }\n   if (! retval.is_empty() )\n     retval = retval.follow_symlinks();\n   if (! retval.is_empty() )\n     retval = retval.base();\n }\n return retval;\n}\n#endif\n\nstatic void\nappendPath(const GURL &url, \n           GMap<GUTF8String,void *> &map,\n           GList<GURL> &list)\n{\n  if( !url.is_empty() && !map.contains(url.get_string()) )\n    {\n      map[url.get_string()]=0;\n      list.append(url);\n    }\n}\n\nGList<GURL>\nDjVuMessage::GetProfilePaths(void)\n{\n  static bool first=true;\n  static GList<GURL> realpaths;\n  if(first)\n  {\n    first=false;\n    GMap<GUTF8String,void *> pathsmap;\n    GList<GURL> paths;\n    GURL path;\n    const GUTF8String envp(GOS::getenv(DjVuEnv));\n    if(envp.length())\n      appendPath(GURL::Filename::UTF8(envp),pathsmap,paths);\n#if defined(WIN32) || defined(UNIX)\n    GURL mpath(GetModulePath());\n    if(!mpath.is_empty() && mpath.is_dir())\n    {\n#if defined(UNIX) && !defined(AUTOCONF) && !defined(NDEBUG)\n      appendPath(GURL::UTF8(DebugModuleDjVuDir,mpath),pathsmap,paths);\n#endif\n      appendPath(mpath,pathsmap,paths);\n      appendPath(GURL::UTF8(ModuleDjVuDir,mpath),pathsmap,paths);\n      appendPath(GURL::UTF8(ProfilesDjVuDir,mpath),pathsmap,paths);\n      mpath=mpath.base();\n      appendPath(GURL::UTF8(ModuleDjVuDir,mpath),pathsmap,paths);\n      appendPath(GURL::UTF8(ProfilesDjVuDir,mpath),pathsmap,paths);\n      mpath=mpath.base();\n      appendPath(GURL::UTF8(ModuleDjVuDir,mpath),pathsmap,paths);\n      appendPath(GURL::UTF8(ProfilesDjVuDir,mpath),pathsmap,paths);\n      mpath=mpath.base();\n      appendPath(GURL::UTF8(ModuleDjVuDir,mpath),pathsmap,paths);\n      appendPath(GURL::UTF8(ProfilesDjVuDir,mpath),pathsmap,paths);\n    }\n#endif\n#if defined(AUTOCONF)\n    GURL dpath = GURL::Filename::UTF8(DjVuDataDir);\n    appendPath(dpath,pathsmap,paths);\n#endif\n#ifdef WIN32\n    appendPath(RegOpenReadConfig(HKEY_CURRENT_USER),pathsmap,paths);\n    appendPath(RegOpenReadConfig(HKEY_LOCAL_MACHINE),pathsmap,paths);\n#else\n    GUTF8String home=GOS::getenv(\"HOME\");\n# if HAVE_GETPWUID\n    if (! home.length()) {\n      struct passwd *pw=0;\n      if ((pw = getpwuid(getuid())))\n        home=GNativeString(pw->pw_dir);\n    }\n# endif\n    if (home.length()) {\n      GURL hpath = GURL::UTF8(LocalDjVuDir,GURL::Filename::UTF8(home));\n      appendPath(hpath,pathsmap,paths);\n    }\n#endif\n#ifdef LT_DEFAULT_PREFIX\n    appendPath(GURL::Filename::UTF8(DjVuPrefixDir),pathsmap,paths);\n#endif\n    appendPath(GURL::Filename::UTF8(RootDjVuDir),pathsmap,paths);\n    pathsmap.empty();\n\n    GPosition pos;\n    GList< GMap<GUTF8String,GP<lt_XMLTags> > > localemaps;\n    for(pos=paths;pos;++pos)\n    {\n      path=GURL::UTF8(LanguageFile,paths[pos]);\n      if(path.is_file())\n      {\n        const GP<lt_XMLTags> xml(lt_XMLTags::create(ByteStream::create(path,\"rb\")));\n        const GPList<lt_XMLTags> Body(xml->get_Tags(bodystring));\n        GPosition pos=Body;\n        if(!pos || (pos != Body.lastpos()))\n        {\n          G_THROW( ERR_MSG(\"XMLAnno.extra_body\") );\n        }\n        const GP<lt_XMLTags> GBody(Body[pos]);\n        if(!GBody)\n        {\n          G_THROW( ERR_MSG(\"XMLAnno.no_body\") );\n        }\n        GMap<GUTF8String,GP<lt_XMLTags> > localemap;\n        lt_XMLTags::get_Maps(languagestring,localestring,Body,localemap);\n        localemaps.append(localemap);\n      }\n    } \n    GList<GURL> localepaths;\n\n    // Need to do it the right way!\n    GUTF8String defaultlocale = getenv(\"LANGUAGE\");\n    if (! defaultlocale) \n      {\n        const GUTF8String oldlocale(setlocale(LC_MESSAGES,0));\n        defaultlocale = setlocale(LC_MESSAGES,\"\");\n        setlocale(LC_MESSAGES,(const char *)oldlocale);\n      }\n    // Unfathomable search.\n    for(int loop=0; loop<2; loop++)\n    {\n      static const char sepchars[]=\" _.@\";\n      const char *p=sepchars+sizeof(sepchars)-1;\n      do\n      {\n        int sepcharpos=p[0]?defaultlocale.search(p[0]):defaultlocale.length();\n        if(sepcharpos > 0)\n        {\n          const GUTF8String sublocale(defaultlocale,sepcharpos);\n          const GUTF8String downcasesublocale(\"downcase^\"+sublocale.downcase());\n          for(pos=localemaps;pos;++pos) \n          {\n            const GMap<GUTF8String,GP<lt_XMLTags> > &localemap=localemaps[pos];\n            GPosition pos=localemap.contains(sublocale);\n            if(!pos)\n              pos=localemap.contains(downcasesublocale);\n            if(pos)\n            {\n              const GMap<GUTF8String,GUTF8String>&args\n                = localemap[pos]->get_args();\n              pos = args.contains(srcstring);\n              if (pos)\n              {\n                const GUTF8String src(args[pos]);\n                for(pos=paths;pos;++pos)\n                {\n                  path=GURL::UTF8(src,paths[pos]);\n                  if(path.is_dir())\n                    localepaths.append(path);\n                }\n              }\n              // We don't need to check anymore language files.\n              p=sepchars;\n              break;\n            }\n          }\n          if(!pos)\n            {\n            for(pos=paths;pos;++pos)\n              {\n              path=GURL::UTF8(sublocale,paths[pos]);\n              if(path.is_dir())\n                localepaths.append(path);\n            }\n          }\n        }\n      } while(p-- != sepchars);\n      if((GPosition) localepaths)\n        break;\n      defaultlocale=\"C\";\n    }\n    for(pos=localepaths;pos;++pos)\n      appendPath(localepaths[pos],pathsmap,realpaths);\n    for(pos=paths;pos;++pos)\n      appendPath(paths[pos],pathsmap,realpaths);\n  }\n  return realpaths;\n}\n\nstatic GUTF8String\ngetbodies(\n  GList<GURL> &paths,\n  const GUTF8String &MessageFileName,\n  GPList<lt_XMLTags> &body, \n  GMap<GUTF8String, void *> & map )\n{\n  GUTF8String errors;\n  bool isdone=false;\n  GPosition firstpathpos=paths;\n  for(GPosition pathpos=firstpathpos;!isdone && pathpos;++pathpos)\n  {\n    const GURL::UTF8 url(MessageFileName,paths[pathpos]);\n    if(url.is_file())\n    {\n      map[MessageFileName]=0;\n      GP<lt_XMLTags> gtags;\n      {\n        GP<ByteStream> bs=ByteStream::create(url,\"rb\");\n        G_TRY\n        {\n          gtags=lt_XMLTags::create(bs);\n        }\n        G_CATCH(ex)\n        {\n          GUTF8String mesg(failed_to_parse_XML+(\"\\t\"+url.get_string()));\n          if(errors.length())\n          {\n            errors+=\"\\n\"+mesg;\n          }else\n          {\n            errors=mesg;\n          }\n          errors+=\"\\n\"+GUTF8String(ex.get_cause());\n        }\n        G_ENDCATCH;\n      }\n      if(gtags)\n      {\n        lt_XMLTags &tags=*gtags;\n        GPList<lt_XMLTags> Bodies=tags.get_Tags(bodystring);\n        if(! Bodies.isempty())\n        {\n          isdone=true;\n          for(GPosition pos=Bodies;pos;++pos)\n          {\n            body.append(Bodies[pos]);\n          }\n        }\n        GPList<lt_XMLTags> Head=tags.get_Tags(headstring);\n        if(! Head.isempty())\n        {\n          isdone=true;\n          GMap<GUTF8String, GP<lt_XMLTags> > includes;\n          lt_XMLTags::get_Maps(includestring,namestring,Head,includes);\n          for(GPosition pos=includes;pos;++pos)\n          {\n            const GUTF8String file=includes.key(pos);\n            if(! map.contains(file))\n            {\n              GList<GURL> xpaths;\n              xpaths.append(url.base());\n              const GUTF8String err2(getbodies(xpaths,file,body,map));\n              if(err2.length())\n              {\n                if(errors.length())\n                {\n                  errors+=\"\\n\"+err2;\n                }else\n                {\n                  errors=err2;\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n  return errors;\n}\n\nstatic GUTF8String\nparse(GMap<GUTF8String,GP<lt_XMLTags> > &retval)\n{\n  GUTF8String errors;\n  GPList<lt_XMLTags> body;\n  if (0) /* SumatraPDF: don't bother looking for messages.xml and languages.xml using broken code */\n  {\n    GList<GURL> paths=DjVuMessage::GetProfilePaths();\n    GMap<GUTF8String, void *> map;\n    GUTF8String m(MessageFile);\n    errors=getbodies(paths,m,body,map);\n  }\n  if(! body.isempty())\n  {\n    lt_XMLTags::get_Maps(messagestring,namestring,body,retval);\n  }\n  return errors;\n}\n\n\nconst DjVuMessageLite &\nDjVuMessage::create_full(void)\n{\n  GP<DjVuMessageLite> &static_message=getDjVuMessageLite();\n  if(!static_message)\n  {\n    DjVuMessage *mesg=new DjVuMessage;\n    static_message=mesg;\n    mesg->init();\n  }\n  return DjVuMessageLite::create_lite();\n}\n\nvoid\nDjVuMessage::set_programname(const GUTF8String &xprogramname)\n{\n  programname()=xprogramname;\n  DjVuMessageLite::create=create_full; \n}\n\nvoid\nDjVuMessage::use_language(void)\n{ \n  DjVuMessageLite::create=create_full; \n}\n\n\n// Constructor\nDjVuMessage::DjVuMessage( void ) {}\n\nvoid\nDjVuMessage::init(void)\n{\n  errors=parse(Map);\n}\n\n// Destructor\nDjVuMessage::~DjVuMessage( )\n{\n}\n\n\n//  A C function to perform a message lookup. Arguments are a buffer to receiv\n//  translated message, a buffer size (bytes), and a message_list. The transla\n//  result is returned in msg_buffer encoded in Native MBS encoding. In case\n// of error, msg_b empty (i.e., msg_buffer[0] == '\\0').\nvoid\nDjVuMessageLookUpNative( \n  char *msg_buffer, const unsigned int buffer_size, const char *message)\n{\n  const GNativeString converted(DjVuMessage::LookUpNative( message ));\n  if( converted.length() >= buffer_size )\n    msg_buffer[0] = '\\0';\n  else\n    strcpy( msg_buffer, converted );\n}\n\n//  A C function to perform a message lookup. Arguments are a buffer to receiv\n//  translated message, a buffer size (bytes), and a message_list. The transla\n//  result is returned in msg_buffer encoded in UTF8 encoding. In case\n// of error, msg_b empty (i.e., msg_buffer[0] == '\\0').\nvoid\nDjVuMessageLookUpUTF8( \n  char *msg_buffer, const unsigned int buffer_size, const char *message)\n{\n  const GUTF8String converted(DjVuMessage::LookUpUTF8( message ));\n  if( converted.length() >= buffer_size )\n    msg_buffer[0] = '\\0';\n  else\n    strcpy( msg_buffer, converted );\n}\n\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n\nvoid\nDjVuFormatErrorUTF8( const char *fmt, ... )\n{\n  va_list args;\n  va_start(args, fmt); \n  const GUTF8String message(fmt,args);\n  DjVuWriteError( message );\n}\n\nvoid\nDjVuFormatErrorNative( const char *fmt, ... )\n{\n  va_list args;\n  va_start(args, fmt); \n  const GNativeString message(fmt,args);\n  DjVuWriteError( message );\n}\n\nconst char *\ndjvu_programname(const char *xprogramname)\n{\n  if(xprogramname)\n    DjVuMessage::programname()=GNativeString(xprogramname);\n  return DjVuMessage::programname();\n}\n"
  },
  {
    "path": "ext/libdjvu/DjVuMessage.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n\n#ifndef __DJVU_MESSAGE_H__\n#define __DJVU_MESSAGE_H__\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n// From: Leon Bottou, 1/31/2002\n// All these I18N XML messages are Lizardtech innovations.\n// For DjvuLibre, I changed the path extraction logic\n// and added support for non I18N messages. \n\n\n#include \"DjVuMessageLite.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass GURL;\n\nclass DJVUAPI DjVuMessage : public DjVuMessageLite\n{\nprotected:\n  void init(void);\n  DjVuMessage(void);\n\npublic:\n  /// Use the locale info and find the XML files on disk.\n  static void use_language(void);\n\n  /// Set the program name used when searching for XML files on disk.\n  static void set_programname(const GUTF8String &programname);\n  static GUTF8String &programname(void);\n\n  /// creates this class specifically.\n  static const DjVuMessageLite &create_full(void);\n\n  /** Adds a byte stream to be parsed whenever the next DjVuMessage::create()\n      call is made. */\n  static void AddByteStreamLater(const GP<ByteStream> &bs)\n  { use_language(); DjVuMessageLite::AddByteStreamLater(bs); }\n\n  /** Destructor: Does any necessary cleanup. Actions depend on how the message\n      file is implemented. */\n  ~DjVuMessage();\n\n  //// Same as LookUp, but this is a static method.\n  static GUTF8String LookUpUTF8( const GUTF8String & MessageList )\n  { use_language();return DjVuMessageLite::LookUpUTF8(MessageList); }\n\n  /** Same as Lookup, but returns a multibyte character string in the\n      current locale. */\n  static GNativeString LookUpNative( const GUTF8String & MessageList )\n  { use_language();return DjVuMessageLite::LookUpNative(MessageList); }\n\n  /// This is a simple alias to the above class, but does an fprintf to stderr.\n  static void perror( const GUTF8String & MessageList )\n  { use_language();DjVuMessageLite::perror(MessageList); }\n\n  static GList<GURL> GetProfilePaths(void);\n};\n\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif /* __DJVU_MESSAGE_H__ */\n\n"
  },
  {
    "path": "ext/libdjvu/DjVuMessageLite.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n// From: Leon Bottou, 1/31/2002\n// All these I18N XML messages are Lizardtech innovations.\n// For DjvuLibre, I changed the path extraction logic\n// and added support for non I18N messages. \n\n#include \"DjVuMessageLite.h\"\n#include \"GOS.h\"\n#include \"XMLTags.h\"\n#include \"ByteStream.h\"\n#include \"GURL.h\"\n#include \"debug.h\"\n#include <ctype.h>\n#include <string.h>\n#include <stddef.h>\n#include <stdlib.h>\n#ifdef WIN32\n#include <tchar.h>\n#include <windows.h>\n#include <winreg.h>\n#endif\n#ifdef UNIX\n#include <unistd.h>\n#include <pwd.h>\n#include <sys/types.h>\n#endif\n#include <locale.h>\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\nconst DjVuMessageLite& (*DjVuMessageLite::create)(void) = \n  DjVuMessageLite::create_lite; \n\nstatic const char *failed_to_parse_XML=\n  ERR_MSG(\"DjVuMessage.failed_to_parse_XML\");\nstatic const char *unrecognized=\n  ERR_MSG(\"DjVuMessage.Unrecognized\");\nstatic const char *uparameter=\n  ERR_MSG(\"DjVuMessage.Parameter\");\n#ifdef LIZARDTECH_1_800_NUMBER\nstatic const char unrecognized_default[] =\n  \"** Unrecognized DjVu Message: [Contact LizardTech at \" \n  LIZARDTECH_1_800_NUMBER \" \\n\"\n  \"\\t** Message name:  %1!s!\";\n#else\nstatic const char unrecognized_default[] =\n  \"** Unrecognized DjVu Message:\\n\"\n  \"\\t** Message name:  %1!s!\";\n#endif\nstatic const char uparameter_default[] = \n  \"\\t   Parameter: %1!s!\";\nstatic const char failed_to_parse_XML_default[]=\n  \"Failed to parse XML message file:&#10;&#09;&apos;%1!s!&apos;.\";\n\nstatic const char namestring[]=\"name\";\nstatic const char valuestring[]=\"value\";\nstatic const char numberstring[]=\"number\";\nstatic const char bodystring[]=\"BODY\";\nstatic const char messagestring[]=\"MESSAGE\";\n\nGPList<ByteStream> &\nDjVuMessageLite::getByteStream(void)\n{\n  static GPList<ByteStream> gbs;\n  return gbs;\n}\n\nGP<DjVuMessageLite> &\nDjVuMessageLite::getDjVuMessageLite(void)\n{\n  static GP<DjVuMessageLite> message;\n  return message;\n}\n\nvoid\nDjVuMessageLite::AddByteStreamLater(const GP<ByteStream> &bs)\n{\n  getByteStream().append(bs);\n}\n\n//  There is only object of class DjVuMessage in a program, and here it is:\n//DjVuMessage  DjVuMsg;\nconst DjVuMessageLite &\nDjVuMessageLite::create_lite(void)\n{\n  GP<DjVuMessageLite> &static_message=getDjVuMessageLite();\n  if(!static_message)\n  {\n    static_message=new DjVuMessageLite;\n  }\n  DjVuMessageLite &m=*static_message;\n  GPList<ByteStream> &bs = getByteStream();\n  for(GPosition pos;(pos=bs);bs.del(pos))\n  {\n    m.AddByteStream(bs[pos]);\n  }\n  return m;\n}\n\n// Constructor\nDjVuMessageLite::DjVuMessageLite( void ) {}\n\n// Destructor\nDjVuMessageLite::~DjVuMessageLite( ) {}\n\n\nvoid\nDjVuMessageLite::perror( const GUTF8String & MessageList )\n{\n  DjVuPrintErrorUTF8(\"%s\\n\",(const char *)DjVuMessageLite::LookUpUTF8(MessageList));\n}\n\n\n//  Expands message lists by looking up the message IDs and inserting\n//  arguments into the retrieved messages.\n//  N.B. The resulting string may be encoded in UTF-8 format (ISO 10646-1 Annex R)\n//       and SHOULD NOT BE ASSUMED TO BE ASCII.\nGUTF8String\nDjVuMessageLite::LookUp( const GUTF8String & MessageList ) const\n{\n//  DEBUG_MSG( \"========== DjVuMessageLite::LookUp ==========\\n\" <<\n//             MessageList <<\n//             \"\\n========== DjVuMessageLite::LookUp ==========\\n\" );\n  GUTF8String result;                       // Result string; begins empty\n  if(errors.length())\n  {\n    const GUTF8String err1(errors);\n    (const_cast<GUTF8String &>(errors)).empty();\n    result=LookUp(err1)+\"\\n\";\n  }\n\n  int start = 0;                            // Beginning of next message\n  int end = MessageList.length();           // End of the message string\n\n  //  Isolate single messages and process them\n  while( start < end )\n  {\n    if( MessageList[start] == '\\n' )\n    {\n      result += MessageList[start++];       // move the newline to the result\n                                            // and advance to the next message\n    }\n    else\n    {\n      //  Find the end of the next message and process it\n      int next_ending = MessageList.search((unsigned long)'\\n', start);\n      if( next_ending < 0 )\n        next_ending = end;\n      result += LookUpSingle( MessageList.substr(start, next_ending-start) );\n      //  Advance to the next message\n      start = next_ending;\n    }\n  }\n\n  //  All done \n  return result;\n}\n\n\n// Expands a single message and inserts the arguments. Single_Message\n// contains no separators (newlines), but includes all the parameters\n// separated by tabs.\nGUTF8String\nDjVuMessageLite::LookUpSingle( const GUTF8String &Single_Message ) const\n{\n#if HAS_CTRL_C_IN_ERR_MSG\n  if (Single_Message[0] != '\\003')\n    return Single_Message;\n#endif\n  //  Isolate the message ID and get the corresponding message text\n  int ending_posn = Single_Message.contains(\"\\t\\v\");\n  if( ending_posn < 0 )\n    ending_posn = Single_Message.length();\n  GUTF8String msg_text;\n  GUTF8String msg_number;\n  const GUTF8String message=Single_Message.substr(0,ending_posn);\n  LookUpID( message, msg_text, msg_number );\n\n  //  Check whether we found anything\n  if( !msg_text.length())\n  {\n    if(message == unrecognized)\n    {\n      msg_text = unrecognized_default;\n    }else if(message == uparameter)\n    {\n      msg_text = uparameter_default;\n    }else if(message == failed_to_parse_XML)\n    {\n      msg_text = failed_to_parse_XML_default;\n    }else\n    {\n      return LookUpSingle(unrecognized + (\"\\t\" + Single_Message));\n    }\n  }\n    \n  //  Insert the parameters (if any)\n  unsigned int param_num = 0;\n  while( (unsigned int)ending_posn < Single_Message.length() )\n  {\n    GUTF8String arg;\n    const int start_posn = ending_posn+1;\n    if(Single_Message[ending_posn] == '\\v')\n    {\n      ending_posn=Single_Message.length();\n      arg=LookUpSingle(Single_Message.substr(start_posn,ending_posn));\n    }else\n    {\n      ending_posn = Single_Message.contains(\"\\v\\t\",start_posn);\n      if( ending_posn < 0 )\n        ending_posn = Single_Message.length();\n      arg=Single_Message.substr(start_posn, ending_posn-start_posn);\n    }\n    InsertArg( msg_text, ++param_num, arg);\n  }\n  //  Insert the message number\n  InsertArg( msg_text, 0, msg_number );\n\n  return msg_text;\n}\n\n\n// Looks up the msgID in the file of messages and returns a pointer to\n// the beginning of the translated message, if found; and an empty string\n// otherwise.\nvoid\nDjVuMessageLite::LookUpID( const GUTF8String &xmsgID,\n                       GUTF8String &message_text,\n                       GUTF8String &message_number ) const\n{\n  if(!Map.isempty())\n  {\n    GUTF8String msgID = xmsgID;\n#if HAS_CTRL_C_IN_ERR_MSG\n    int start = 0;\n    while (msgID[start] == '\\003') \n      start ++;\n    if (start > 0)\n      msgID = msgID.substr(start, msgID.length() - start);\n#endif\n    GPosition pos=Map.contains(msgID);\n    if(pos)\n    {\n      const GP<lt_XMLTags> tag=Map[pos];\n      GPosition valuepos=tag->get_args().contains(valuestring);\n      if(valuepos)\n      {\n        message_text=tag->get_args()[valuepos];\n      }else\n      {\n        const GUTF8String raw(tag->get_raw());\n        const int start_line=raw.search((unsigned long)'\\n',0);\n      \n        const int start_text=raw.nextNonSpace(0);\n        const int end_text=raw.firstEndSpace(0);\n        if(start_line<0 || start_text<0 || start_text < start_line)\n        {\n          message_text=raw.substr(0,end_text).fromEscaped();\n        }else\n        {\n          message_text=raw.substr(start_line+1,end_text-start_line-1).fromEscaped();\n        }\n      }\n      GPosition numberpos=tag->get_args().contains(numberstring);\n      if(numberpos)\n      {\n        message_number=tag->get_args()[numberpos];\n      }\n    }\n  }\n}\n\n\n// Insert a string into the message text. Will insert into any field\n// description.  Except for an ArgId of zero (message number), if the ArgId\n// is not found, the routine adds a line with the parameter so information\n// will not be lost.\nvoid\nDjVuMessageLite::InsertArg( GUTF8String &message,\n  const int ArgId, const GUTF8String &arg ) const\n{\n    // argument target string\n  const GUTF8String target= \"%\"+GUTF8String(ArgId)+\"!\";\n    // location of target string\n  int format_start = message.search( (const char *)target );\n  if( format_start >= 0 )\n  {\n    do\n    {\n      const int n=format_start+target.length()+1;\n      const int format_end=message.search((unsigned long)'!',n);\n      if(format_end > format_start)\n      { \n        const int len=1+format_end-n;\n        if(len && isascii(message[n-1]))\n        {\n          GUTF8String narg;\n          GUTF8String format=\"%\"+message.substr(n-1,len);\n          switch(format[len])\n          {\n            case 'd':\n            case 'i':\n              narg.format((const char *)format,arg.toInt());\n              break;\n            case 'u':\n            case 'o':\n            case 'x':\n            case 'X':\n              narg.format((const char *)format,(unsigned int)arg.toInt());\n              break;\n            case 'f':\n            case 'g':\n            case 'e':\n              {\n                int endpos;\n                narg.format((const char *)format, arg.toDouble(0,endpos));\n                if( endpos < 0 )\n                  narg = arg;\n              }\n              break;\n            default:\n              narg.format((const char *)format,(const char *)arg);\n              break;\n          }\n          message = message.substr( 0, format_start )+narg\n            +message.substr( format_end+1, -1 );\n        }else\n        {\n          message = message.substr( 0, format_start )+arg\n            +message.substr( format_end+1, -1 );\n        }\n      }\n      format_start=message.search((const char*)target, format_start+arg.length());\n    } while(format_start >= 0);\n  }\n  else\n  {\n    //  Not found, fake it\n    if( ArgId != 0 )\n    {\n      message += \"\\n\"+LookUpSingle(uparameter+(\"\\t\"+arg));\n    }\n  }\n}\n\n\n//  A C function to perform a message lookup. Arguments are a buffer to received the\n//  translated message, a buffer size (bytes), and a message_list. The translated\n//  result is returned in msg_buffer encoded in UTF-8. In case of error, msg_buffer is\n//  empty (i.e., msg_buffer[0] == '\\0').\nvoid \nDjVuMessageLite_LookUp( char *msg_buffer, const unsigned int buffer_size, const char *message )\n{\n  GUTF8String converted = DjVuMessageLite::LookUpUTF8( message );\n  if( converted.length() >= buffer_size )\n    msg_buffer[0] = '\\0';\n  else\n    strcpy( msg_buffer, converted );\n}\n\nvoid\nDjVuMessageLite::AddByteStream(const GP<ByteStream> &bs)\n{\n  const GP<lt_XMLTags> gtags(lt_XMLTags::create(bs));\n  lt_XMLTags &tags=*gtags;\n  GPList<lt_XMLTags> Bodies=tags.get_Tags(bodystring);\n  if(! Bodies.isempty())\n  {\n    lt_XMLTags::get_Maps(messagestring,namestring,Bodies,Map);\n  }\n}\n\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n\nvoid\nDjVuWriteError( const char *message )\n{\n  G_TRY {\n    GP<ByteStream> errout = ByteStream::get_stderr();\n    if (errout)\n      {\n        const GUTF8String external = DjVuMessageLite::LookUpUTF8( message );\n        errout->writestring(external+\"\\n\");\n      }\n    // Need to catch all exceptions because these might be \n    // called from an outer exception handler (with prejudice)\n  } G_CATCH_ALL { } G_ENDCATCH;\n}\n\nvoid\nDjVuWriteMessage( const char *message )\n{\n  G_TRY {\n    GP<ByteStream> strout = ByteStream::get_stdout();\n    if (strout)\n      {\n        const GUTF8String external = DjVuMessageLite::LookUpUTF8( message );\n        strout->writestring(external+\"\\n\");\n      }\n    // Need to catch all exceptions because these might be \n    // called from an outer exception handler (with prejudice)\n  } G_CATCH_ALL { } G_ENDCATCH;\n}\n"
  },
  {
    "path": "ext/libdjvu/DjVuMessageLite.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef __DJVU_MESSAGE_LITE_H__\n#define __DJVU_MESSAGE_LITE_H__\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n// From: Leon Bottou, 1/31/2002\n// All these I18N XML messages are Lizardtech innovations.\n// For DjvuLibre, I changed the path extraction logic\n// and added support for non I18N messages. \n\n\n#include \"GString.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass lt_XMLTags;\nclass ByteStream;\n\n/** Exception causes and external messages are passed as message lists which\n    have the following syntax:\n  \n    message_list ::= single_message |\n                     single_message separator message_list\n    \n    separator ::= newline |\n                  newline | separator\n    \n    single_message ::= message_ID |\n                       message_ID parameters\n    \n    parameters ::= tab string |\n                   tab string parameters\n    \n    Message_IDs are looked up an external file and replaced by the message\n    text strings they are mapped to. The message text may contain the\n    following:\n    \n    Parameter specifications: These are modelled after printf format\n    specifications and have one of the following forms:\n  \n      %n!s! %n!d! %n!i! %n!u! %n!x! %n!X!\n  \n    where n is the parameter number. The parameter number is indicated\n    explicitly to allow for the possibility that the parameter order may\n    change when the message text is translated into another language.\n    The final letter ('s', 'd', 'i', 'u', 'x', or 'X') indicates the form\n    of the parameter (string, integer, integer, unsigned integer, lowercase\n    hexadecimal, or uppercase hexadecimal, respectively).  In addition\n    formating options such as precision available in sprintf, may be used.\n    So, to print the third argument as 5 digit unsigned number, with leading\n    zero's one could use:\n      %3!05u!\n\n    All of the arguments are actually strings.  For forms that don't take\n    string input ('d', 'i', 'u', 'x', or 'X'), and atoi() conversion is done\n    on the string before formatting.  In addition the form indicates to the\n    translater whether to expect a word or a number.\n\n    The strings are read in from XML.  To to format the strings, use the\n    relavent XML escape sequences, such as follows:\n\n            &#10;        [line feed]\n            &#09;        [horizontal tab]\n            &apos;       [single quote]\n            &#34;        [double quote]\n            &lt;         [less than sign]\n            &gt;         [greater than sign]\n  \n    After parameters have been inserted in the message text, the formatting \n    strings are replaced by their usual equivalents (newline and tab\n    respectively).\n\n    If a message_id cannot be found in the external file, a message text\n    is fabricated giving the message_id and the parameters (if any).\n\n    Separators (newlines) are preserved in the translated message list.\n\n    Expands message lists by looking up the message IDs and inserting\n    arguments into the retrieved messages.\n\n    N.B. The resulting string may be encoded in UTF-8 format (ISO 10646-1\n    Annex R) and SHOULD NOT BE ASSUMED TO BE ASCII.\n  */\n\nclass DJVUAPI DjVuMessageLite : public GPEnabled\n{\nprotected:\n  // Constructor:\n  DjVuMessageLite( void );\n  GMap<GUTF8String,GP<lt_XMLTags> > Map;\n  GUTF8String errors;\n  /// Creates a DjVuMessage class.\n  static const DjVuMessageLite &real_create(void);\n\npublic:\n  /// Creates a DjVuMessage class.\n  static const DjVuMessageLite& (*create)(void);\n\n  /// Creates this class specifically.\n  static const DjVuMessageLite &create_lite(void);\n\n  /** Adds a byte stream to be parsed whenever the next DjVuMessage::create()\n      call is made. */\n  static void AddByteStreamLater(const GP<ByteStream> &bs);\n\n  /** Destructor: Does any necessary cleanup. Actions depend on how the message\n      file is implemented. */\n  ~DjVuMessageLite();\n\n  /// Lookup the relavent string and parse the message.\n  GUTF8String LookUp( const GUTF8String & MessageList ) const;\n\n  //// Same as LookUp, but this is a static method.\n  static GUTF8String LookUpUTF8( const GUTF8String & MessageList )\n  { return create().LookUp(MessageList); }\n\n  /** Same as Lookup, but returns the a multibyte character string in the\n      current locale. */\n  static GNativeString LookUpNative( const GUTF8String & MessageList )\n  { return create().LookUp(MessageList).getUTF82Native(); }\n\n  /// This is a simple alias to the above class, but does an fprintf to stderr.\n  static void perror( const GUTF8String & MessageList );\n\nprotected:\n\n  /*  Looks up the msgID in the file of messages. The strings message_text\n      and message_number are returned if found. If not found, these strings\n      are empty. */\n  void LookUpID( const GUTF8String & msgID,\n    GUTF8String &message_text, GUTF8String &message_number ) const;\n\n  /*  Expands a single message and inserts the arguments. Single_Message\n      contains no separators (newlines), but includes all the parameters\n      separated by tabs. */\n  GUTF8String LookUpSingle( const GUTF8String & Single_Message ) const;\n\n  /*  Insert a string into the message text. Will insert into any field\n      description.  Except for an ArgId of zero (message number), if the\n      #ArgId# is not found, the routine adds a line with the parameter\n      so information will not be lost. */\n  void InsertArg(\n    GUTF8String &message, const int ArgId, const GUTF8String &arg ) const;\n\n  void AddByteStream(const GP<ByteStream> &bs);\n\nprotected:\n  /*  Static storage of the DjVuMessage class. */\n  static GP<DjVuMessageLite> &getDjVuMessageLite(void);\n  /*  Static storage of the ByteStream list. */\n  static GPList<ByteStream> &getByteStream(void);\n};\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif /* __DJVU_MESSAGE_LITE_H__ */\n\n"
  },
  {
    "path": "ext/libdjvu/DjVuNavDir.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"DjVuNavDir.h\"\n#include \"debug.h\"\n#include \"GException.h\"\n#include \"GOS.h\"\n#include \"ByteStream.h\"\n#include \"GURL.h\"\n#include <ctype.h>\n\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n\nDjVuNavDir::DjVuNavDir(const GURL &dirURL)\n{\n   if (!dirURL) G_THROW( ERR_MSG(\"DjVuNavDir.zero_dir\") );\n   baseURL=dirURL.base();\n}\n\nDjVuNavDir::DjVuNavDir(ByteStream & str, const GURL &dirURL)\n{\n   if (!dirURL) G_THROW( ERR_MSG(\"DjVuNavDir.zero_dir\") );\n   \n   baseURL=GURL(dirURL).base();\n   \n   decode(str);\n}\n\nvoid\nDjVuNavDir::decode(ByteStream & str)\n{\n   GCriticalSectionLock lk(&lock);\n   \n   GList<GUTF8String> tmp_page2name;\n   int eof=0;\n   while(!eof)\n   {\n      char buffer[1024];\n      char * ptr;\n      for(ptr=buffer;ptr-buffer<1024;ptr++)\n\t if ((eof=!str.read(ptr, 1)) || *ptr=='\\n') break;\n      if (ptr-buffer==1024) G_THROW( ERR_MSG(\"DjVuNavDir.long_line\") );\n      *ptr=0;\n      if (!strlen(buffer)) continue;\n\n      if (!tmp_page2name.contains(buffer))\n\t tmp_page2name.append(buffer);\n   };\n\n   // Now copying lists to arrays for faster access later\n   int pages=tmp_page2name.size();\n   page2name.resize(pages-1);\n\n   int cnt;\n   GPosition pos;\n   for(pos=tmp_page2name, cnt=0;pos;++pos, cnt++)\n      page2name[cnt]=tmp_page2name[pos];\n   \n   // Now creating reverse mapping (strings => numbers)\n   for(cnt=0;cnt<pages;cnt++)\n   {\n      name2page[page2name[cnt]]=cnt;\n      url2page[GURL::UTF8(page2name[cnt],baseURL)]=cnt;\n   }\n}\n\n#ifndef NEED_DECODER_ONLY\nvoid\nDjVuNavDir::encode(ByteStream & str)\n{\n   GCriticalSectionLock lk(&lock);\n\n   for(int i=0;i<page2name.size();i++)\n   {\n      GUTF8String & name=page2name[i];\n      str.writall((const char*)name, name.length());\n      str.writall(\"\\n\", 1);\n   };\n}\n#endif //NEED_DECODER_ONLY\n\nint\nDjVuNavDir::get_pages_num(void) const\n{\n   GCriticalSectionLock lk((GCriticalSection *)&lock);\n   \n   return page2name.size();\n}\n\nint\nDjVuNavDir::name_to_page(const char * name) const\n{\n   GCriticalSectionLock lk((GCriticalSection *)&lock);\n\n   if (!name2page.contains(name)) return -1;\n   return name2page[name];\n}\n\nint\nDjVuNavDir::url_to_page(const GURL & url) const\n{\n   GCriticalSectionLock lk((GCriticalSection *)&lock);\n\n   if (!url2page.contains(url)) return -1;\n   return url2page[url];\n}\n\nGUTF8String\nDjVuNavDir::page_to_name(int page) const\n{\n   GCriticalSectionLock lk((GCriticalSection *)&lock);\n   \n   if (page<0) \n      G_THROW( ERR_MSG(\"DjVuNavDir.neg_page\") );\n   if (page>=page2name.size())\n      G_THROW( ERR_MSG(\"DjVuNavDir.large_page\") );\n   return page2name[page];\n}\n\nGURL\nDjVuNavDir::page_to_url(int page) const\n{\n   GCriticalSectionLock lk((GCriticalSection *)&lock);\n   \n   return GURL::UTF8(page_to_name(page),baseURL);\n}\n\nvoid\nDjVuNavDir::insert_page(int where, const char * name)\n{\n   GCriticalSectionLock lk((GCriticalSection *)&lock);\n\n   int pages=page2name.size();\n   if (where<0) where=pages;\n   \n   page2name.resize(pages);\n   for(int i=pages;i>where;i--)\n      page2name[i]=page2name[i-1];\n   page2name[where]=name;\n   name2page[name]=where;\n   url2page[GURL::UTF8(name,baseURL)]=where;\n}\n\n#ifndef NEED_DECODER_ONLY\nvoid\nDjVuNavDir::delete_page(int page_num)\n{\n   GCriticalSectionLock lk((GCriticalSection *)&lock);\n\n   int pages=page2name.size();\n   \n   if (page_num<0 || page_num>=pages)\n      G_THROW( ERR_MSG(\"DjVuNavDir.bad_page\") );\n\n   for(int i=page_num;i<pages-1;i++)\n      page2name[i]=page2name[i+1];\n   page2name.resize(--pages-1);\n}\n#endif\n\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVuNavDir.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _DJVUNAVDIR_H\n#define _DJVUNAVDIR_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n#include \"GString.h\"\n#include \"GThreads.h\"\n#include \"GURL.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass ByteStream;\n\n/** @name DjVuNavDir.h\n    Files #\"DjVuNavDir.h\"# and #\"DjVuNavDir.cpp\"# contain implementation of the\n    multipage DjVu navigation directory. This directory lists all the pages,\n    that a given document is composed of. The navigation (switching from page\n    to page in the plugin) is not possible before this directory is decoded.\n\n    Refer to the \\Ref{DjVuNavDir} class description for greater details.\n\n    @memo DjVu Navigation Directory\n    @author Andrei Erofeev <eaf@geocities.com>\n*/\n\n//@{\n\n//*****************************************************************************\n//********************* Note: this class is thread-safe ***********************\n//*****************************************************************************\n\n/** DjVu Navigation Directory.\n\n    This class implements the {\\em navigation directory} of a multipage\n    DjVu document - basically a list of pages that this document is composed\n    of. We would like to emphasize, that this is the list of namely\n    {\\bf pages}, not {\\bf files}. Any page may include any\n    number of additional files. When you've got an all-in-one-file multipage\n    DjVu document (DjVm archive) you may get the files list from \\Ref{DjVmDir0}\n    class.\n\n    The \\Ref{DjVuNavDir} class can decode and encode the navigation directory\n    from {\\bf NDIR} IFF chunk. It's normally created by the library during\n    decoding procedure and can be accessed like any other component of\n    the \\Ref{DjVuImage} being decoded.\n    \n    In a typical multipage DjVu document the navigation directory is stored\n    in a separate IFF file containing only one chunk: {\\bf NDIR} chunk.\n    This file should be included (by means of the {\\bf INCL} chunk) into\n    every page of the document to enable the navigation. */\nclass DjVuNavDir : public GPEnabled\n{\nprivate:\n   GCriticalSection\t\tlock;\n   GURL\t\t\t\tbaseURL;\n   GArray<GUTF8String>\t\tpage2name;\n   GMap<GUTF8String, int>\t\tname2page;\n   GMap<GURL, int>\t\turl2page;\nprotected:\n   DjVuNavDir(const GURL &dir_url);\n   DjVuNavDir(ByteStream & str, const GURL &dir_url);\n\npublic:\n   int\t\tget_memory_usage(void) const { return 1024; };\n\n      /** Creates a #DjVuNavDir# object. #dir_url# is the URL of the file\n\t  containing the directory source data. It will be used later\n\t  in translation by functions like \\Ref{url_to_page}() and\n\t  \\Ref{page_to_url}() */\n   static GP<DjVuNavDir> create(const GURL &dir_url)\n   {return new DjVuNavDir(dir_url);}\n\n      /** Creates #DjVuNavDir# object by decoding its contents from\n\t  the stream. #dir_url# is the URL of the file containing the\n\t  directory source data. */\n   static GP<DjVuNavDir> create(ByteStream & str, const GURL &dir_url)\n   { return new DjVuNavDir(str,dir_url); }\n\n   virtual ~DjVuNavDir(void) {};\n\n      /// Decodes the directory contents from the given \\Ref{ByteStream}\n   void\t\tdecode(ByteStream & str);\n\n      /// Encodes the directory contents into the given \\Ref{ByteStream}\n   void\t\tencode(ByteStream & str);\n\n      /** Inserts a new page at position #where# pointing to a file\n\t  with name #name#.\n\n\t  @param where The position where the page should be inserted.\n\t  \t #-1# means to append.\n\t  @param name The name of the file corresponding to this page.\n\t  \t The name may not contain slashes. The file may include\n\t\t other files. */\n   void\t\tinsert_page(int where, const char * name);\n\n      /// Deletes page with number #page_num# from the directory.\n   void\t\tdelete_page(int page_num);\n\n      /// Returns the number of pages in the directory.\n   int\t\tget_pages_num(void) const;\n      /** Converts the #url# to page number. Returns #-1# if the #url#\n\t  does not correspond to anything in the directory. */\n   int\t\turl_to_page(const GURL & url) const;\n      /** Converts file name #name# to page number. Returns #-1# if file\n\t  with given name cannot be found. */\n   int\t\tname_to_page(const char * name) const;\n      /** Converts given #page# to URL. Throws an exception if page number\n\t  is invalid. */\n   GURL\t\tpage_to_url(int page) const;\n      /** Converts given #page# to URL. Throws an exception if page number\n\t  is invalid. */\n   GUTF8String\tpage_to_name(int page) const;\n};\n\n//@}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVuPalette.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"GException.h\"\n#include \"ByteStream.h\"\n#include \"BSByteStream.h\"\n#include \"DjVuPalette.h\"\n\n#include <stddef.h>\n#include <stdlib.h>\n#include <math.h>\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n#define CUBEBITS  4\n#define CUBESIDE  (1<<CUBEBITS)\n#define CUBESIZE  (CUBESIDE*CUBESIDE*CUBESIDE)\n\n#define RMUL 5\n#define GMUL 9\n#define BMUL 2\n#define SMUL (RMUL+GMUL+BMUL)\n\n#define MAXPALETTESIZE 65535 // Limit for a 16 bit unsigned read.\n\n\ninline unsigned char \numax(unsigned char a, unsigned char b) \n{ return (a>b) ? a : b; }\n\ninline unsigned char \numin(unsigned char a, unsigned char b) \n{ return (a>b) ? b : a; }\n\n/* SumatraPDF: in VS 2013 math.h already defines fmin */\n#if !defined(_MSC_VER) || (_MSC_VER < 1800)\ninline float \nfmin(float a, float b) \n{ return (a>b) ? b : a; }\n#endif\n\n\n\n// ------- DJVUPALETTE\n\n\nDjVuPalette::DjVuPalette()\n  : mask(0), hist(0), pmap(0)\n{\n}\n\nDjVuPalette::~DjVuPalette()\n{\n  delete hist;\n  delete pmap;\n}\n\nDjVuPalette& \nDjVuPalette::operator=(const DjVuPalette &ref)\n{\n  if (this != &ref)\n    {\n      delete hist;\n      delete pmap;\n      mask = 0;\n      palette = ref.palette;\n      colordata = ref.colordata;\n    }\n  return *this;\n}\n\nDjVuPalette::DjVuPalette(const DjVuPalette &ref)\n  : mask(0), hist(0), pmap(0)\n{\n  this->operator=(ref);\n}\n\n\n\n// -------- HISTOGRAM ALLOCATION\n\nvoid\nDjVuPalette::allocate_hist()\n{\n  if (! hist)\n    {\n      hist = new GMap<int,int>;\n      mask = 0;\n    }\n  else\n    {\n      GMap<int,int> *old = hist;\n      hist = new GMap<int,int>;\n      mask = (mask<<1)|(0x010101);\n      for (GPosition p = *old; p; ++p)\n        {\n          int k = old->key(p);\n          int w = (*old)[p];\n          (*hist)[k | mask] += w;\n        }\n      delete old;\n    }\n}\n\n\n// -------- PALETTE COMPUTATION\n\n\n#ifndef NEED_DECODER_ONLY\n\nstruct PData\n{\n  unsigned char p[3];\n  int w;\n};\n\nstruct PBox \n{\n  PData *data;\n  int colors;\n  int boxsize;\n  int sum;\n};\nint\nDjVuPalette::bcomp (const void *a, const void *b)\n{\n  return ((PData*)a)->p[0] - ((PData*)b)->p[0];\n}\n\nint\n\nDjVuPalette::gcomp (const void *a, const void *b)\n{\n  return ((PData*)a)->p[1] - ((PData*)b)->p[1];\n}\n\nint\nDjVuPalette::rcomp (const void *a, const void *b)\n{\n  return ((PData*)a)->p[2] - ((PData*)b)->p[2];\n}\n\nint\nDjVuPalette::lcomp (const void *a, const void *b)\n{\n  unsigned char *aa = ((PColor*)a)->p;\n  unsigned char *bb = ((PColor*)b)->p;\n  if (aa[3] != bb[3])\n    return aa[3]-bb[3];\n  else if (aa[2] != bb[2])\n    return aa[2]-bb[2];\n  else if (aa[1] != bb[1])\n    return aa[1]=bb[1];\n  else\n    return aa[0]-bb[0];\n}\n\nint\nDjVuPalette::compute_palette(int maxcolors, int minboxsize)\n{\n  if (!hist)\n    G_THROW( ERR_MSG(\"DjVuPalette.no_color\") );\n  if (maxcolors<1 || maxcolors>MAXPALETTESIZE)\n    G_THROW( ERR_MSG(\"DjVuPalette.many_colors\") );\n  \n  // Paul Heckbert: \"Color Image Quantization for Frame Buffer Display\", \n  // SIGGRAPH '82 Proceedings, page 297.  (also in ppmquant)\n  \n  // Collect histogram colors\n  int sum = 0;\n  int ncolors = 0;\n  GTArray<PData> pdata;\n  { // extra nesting for windows\n    for (GPosition p = *hist; p; ++p)\n    {\n      pdata.touch(ncolors);\n      PData &data = pdata[ncolors++];\n      int k = hist->key(p);\n      data.p[0] = (k>>16) & 0xff;\n      data.p[1] = (k>>8) & 0xff;\n      data.p[2] = (k) & 0xff;\n      data.w = (*hist)[p];\n      sum += data.w;\n    }\n  }\n  // Create first box\n  GList<PBox> boxes;\n  PBox newbox;\n  newbox.data = pdata;\n  newbox.colors = ncolors;\n  newbox.boxsize = 256;\n  newbox.sum = sum;\n  boxes.append(newbox);\n  // Repeat spliting boxes\n  while (boxes.size() < maxcolors)\n    {\n      // Find suitable box\n      GPosition p;\n      for (p=boxes; p; ++p)\n        if (boxes[p].colors>=2 && boxes[p].boxsize>minboxsize) \n          break;\n      if (! p)\n        break;\n      // Find box boundaries\n      PBox &splitbox = boxes[p];\n      unsigned char pmax[3];\n      unsigned char pmin[3];\n      pmax[0] = pmin[0] = splitbox.data->p[0];\n      pmax[1] = pmin[1] = splitbox.data->p[1];\n      pmax[2] = pmin[2] = splitbox.data->p[2];\n      { // extra nesting for windows\n        for (int j=1; j<splitbox.colors; j++)\n        {\n          pmax[0] = umax(pmax[0], splitbox.data[j].p[0]);\n          pmax[1] = umax(pmax[1], splitbox.data[j].p[1]);\n          pmax[2] = umax(pmax[2], splitbox.data[j].p[2]);\n          pmin[0] = umin(pmin[0], splitbox.data[j].p[0]);\n          pmin[1] = umin(pmin[1], splitbox.data[j].p[1]);\n          pmin[2] = umin(pmin[2], splitbox.data[j].p[2]);\n        }\n      }\n      // Determine split direction and sort\n      int bl = pmax[0]-pmin[0]; \n      int gl = pmax[1]-pmin[1];\n      int rl = pmax[2]-pmin[2];\n      splitbox.boxsize = (bl>gl ? (rl>bl ? rl : bl) : (rl>gl ? rl : gl));\n      if (splitbox.boxsize <= minboxsize)\n        continue;\n      if (gl == splitbox.boxsize)\n        qsort(splitbox.data, splitbox.colors, sizeof(PData), gcomp);\n      else if (rl == splitbox.boxsize)\n        qsort(splitbox.data, splitbox.colors, sizeof(PData), rcomp);\n      else\n        qsort(splitbox.data, splitbox.colors, sizeof(PData), bcomp);\n      // Find median\n      int lowercolors = 0;\n      int lowersum = 0;\n      while (lowercolors<splitbox.colors-1 && lowersum+lowersum<splitbox.sum)\n        lowersum += splitbox.data[lowercolors++].w;\n      // Compute new boxes\n      newbox.data = splitbox.data + lowercolors;\n      newbox.colors = splitbox.colors - lowercolors;\n      newbox.sum = splitbox.sum - lowersum;\n      splitbox.colors = lowercolors;\n      splitbox.sum = lowersum;\n      // Insert boxes at proper location\n      GPosition q;\n      for (q=p; q; ++q)\n        if (boxes[q].sum < newbox.sum)\n          break;\n      boxes.insert_before(q, newbox);\n      for (q=p; q; ++q)\n        if (boxes[q].sum < splitbox.sum)\n          break;\n      boxes.insert_before(q, boxes, p);\n    }\n  // Fill palette array\n  ncolors = 0;\n  palette.empty();\n  palette.resize(0,boxes.size()-1);\n  { // extra nesting for windows\n    for (GPosition p=boxes; p; ++p)\n    {\n      PBox &box = boxes[p];\n      // Compute box representative color\n      float bsum = 0;\n      float gsum = 0;\n      float rsum = 0;\n      for (int j=0; j<box.colors; j++)\n        {\n          float w = (float)box.data[j].w;\n          bsum += box.data[j].p[0] * w;\n          gsum += box.data[j].p[1] * w;\n          rsum += box.data[j].p[2] * w;\n        }\n      PColor &color = palette[ncolors++];\n      color.p[0] = (unsigned char) fmin(255, bsum/box.sum);\n      color.p[1] = (unsigned char) fmin(255, gsum/box.sum);\n      color.p[2] = (unsigned char) fmin(255, rsum/box.sum);\n      color.p[3] = ( color.p[0]*BMUL + color.p[1]*GMUL + color.p[2]*RMUL) / SMUL;\n    }\n  }\n  // Save dominant color\n  PColor dcolor = palette[0];\n  // Sort palette colors in luminance order\n  qsort((PColor*)palette, ncolors, sizeof(PColor), lcomp);\n  // Clear invalid data\n  colordata.empty();\n  delete pmap;\n  pmap = 0;\n  // Return dominant color\n  return color_to_index_slow(dcolor.p);\n}\n\n\n\nint \nDjVuPalette::compute_pixmap_palette(const GPixmap &pm, int ncolors, int minboxsize)\n{\n  // Prepare histogram\n  histogram_clear();\n  { // extra nesting for windows\n    for (int j=0; j<(int)pm.rows(); j++)\n    {\n      const GPixel *p = pm[j];\n      for (int i=0; i<(int)pm.columns(); i++)\n        histogram_add(p[i], 1);\n    }\n  }\n  // Compute palette\n  return compute_palette(ncolors, minboxsize);\n}\n\n\n#endif\n\n\n\n\n// -------- QUANTIZATION\n\n\nvoid\nDjVuPalette::allocate_pmap()\n{\n  if (! pmap)\n    pmap = new GMap<int,int>;\n}\n\nint \nDjVuPalette::color_to_index_slow(const unsigned char *bgr)\n{\n  PColor *pal = palette;\n  const int ncolors = palette.size();\n  if (! ncolors)\n    G_THROW( ERR_MSG(\"DjVuPalette.not_init\") );\n  // Should be able to do better\n  int found = 0;\n  int founddist = 3*256*256;\n  { // extra nesting for windows\n    for (int i=0; i<ncolors; i++)\n    {\n      int bd = bgr[0] - pal[i].p[0];\n      int gd = bgr[1] - pal[i].p[1];\n      int rd = bgr[2] - pal[i].p[2];\n      int dist = (bd*bd)+(gd*gd)+(rd*rd);\n      if (dist < founddist)\n        {\n          found = i;\n          founddist = dist;\n        }\n    }\n  }\n  // Store in pmap\n  if (pmap && pmap->size()<0x8000)\n    {\n      int key = (bgr[0]<<16)|(bgr[1]<<8)|(bgr[2]);\n      (*pmap)[key] = found;\n    }\n  // Return\n  return found;\n}\n\n\n#ifndef NEED_DECODER_ONLY\n\nvoid \nDjVuPalette::quantize(GPixmap &pm)\n{\n  { // extra nesting for windows\n    for (int j=0; j<(int)pm.rows(); j++)\n    {\n      GPixel *p = pm[j];\n      for (int i=0; i<(int)pm.columns(); i++)\n        index_to_color(color_to_index(p[i]), p[i]);\n    }\n  }\n}\n\nint \nDjVuPalette::compute_palette_and_quantize(GPixmap &pm, int maxcolors, int minboxsize)\n{\n  int result = compute_pixmap_palette(pm, maxcolors, minboxsize);\n  quantize(pm);\n  return result;\n}\n\nvoid \nDjVuPalette::color_correct(double corr)\n{\n  const int palettesize = palette.size();\n  if (palettesize > 0)\n    {\n      // Copy colors\n      int i;\n      GTArray<GPixel> pix(0,palettesize-1);\n      GPixel *r = pix;\n      PColor *q = palette;\n      for (i=0; i<palettesize; i++) \n        {\n          r[i].b = q[i].p[0];\n          r[i].g = q[i].p[1];\n          r[i].r = q[i].p[2];\n        }\n      // Apply color correction\n      GPixmap::color_correct(corr, r, palettesize);\n      // Restore colors\n      for (i=0; i<palettesize; i++) \n        {\n          q[i].p[0] = r[i].b;\n          q[i].p[1] = r[i].g;\n          q[i].p[2] = r[i].r;\n        }\n    }\n}\n\n#endif\n\n\n// -------- ENCODE AND DECODE\n\n#define DJVUPALETTEVERSION 0\n\nvoid\nDjVuPalette::encode_rgb_entries(ByteStream &bs) const\n{\n  const int palettesize = palette.size();\n  { // extra nesting for windows\n    for (int c=0; c<palettesize; c++)\n    {\n      unsigned char p[3];\n      p[2] = palette[c].p[0];\n      p[1] = palette[c].p[1];\n      p[0] = palette[c].p[2];\n      bs.writall((const void*)p, 3);\n    }\n  }\n}\n\nvoid \nDjVuPalette::encode(GP<ByteStream> gbs) const\n{\n  ByteStream &bs=*gbs;\n  const int palettesize = palette.size();\n  const int datasize = colordata.size();\n  // Code version number\n  int version = DJVUPALETTEVERSION;\n  if (datasize>0) version |= 0x80;\n  bs.write8(version);\n  // Code palette\n  bs.write16(palettesize);\n  { // extra nesting for windows\n    for (int c=0; c<palettesize; c++)\n    {\n      unsigned char p[3];\n      p[0] = palette[c].p[0];\n      p[1] = palette[c].p[1];\n      p[2] = palette[c].p[2];\n      bs.writall((const void*)p, 3);\n    }\n  }\n  // Code colordata\n  if (datasize > 0)\n    {\n      bs.write24(datasize);\n      GP<ByteStream> gbsb=BSByteStream::create(gbs, 50);\n      ByteStream &bsb=*gbsb;\n      for (int d=0; d<datasize; d++)\n        bsb.write16(colordata[d]);\n    }\n}\n\nvoid \nDjVuPalette::decode_rgb_entries(ByteStream &bs, const int palettesize)\n{\n  palette.resize(0,palettesize-1);\n  { // extra nesting for windows\n    for (int c=0; c<palettesize; c++)\n    {\n      unsigned char p[3];\n      bs.readall((void*)p, 3);\n      palette[c].p[0] = p[2];\n      palette[c].p[1] = p[1];\n      palette[c].p[2] = p[0];\n      palette[c].p[3] = (p[0]*BMUL+p[1]*GMUL+p[2]*RMUL)/SMUL;\n    }\n  }\n}\n\nvoid \nDjVuPalette::decode(GP<ByteStream> gbs)\n{\n  ByteStream &bs=*gbs;\n  // Make sure that everything is clear\n  delete hist;\n  delete pmap;\n  hist = 0;\n  pmap = 0;\n  mask = 0;\n  // Code version\n  int version = bs.read8();\n  if ( (version & 0x7f) != DJVUPALETTEVERSION)\n    G_THROW( ERR_MSG(\"DjVuPalette.bad_version\") );\n  // Code palette\n  const int palettesize = bs.read16();\n  if (palettesize<0 || palettesize>MAXPALETTESIZE)\n    G_THROW( ERR_MSG(\"DjVuPalette.bad_palette\") );\n  palette.resize(0,palettesize-1);\n  { // extra nesting for windows\n    for (int c=0; c<palettesize; c++)\n    {\n      unsigned char p[3];\n      bs.readall((void*)p, 3);\n      palette[c].p[0] = p[0];\n      palette[c].p[1] = p[1];\n      palette[c].p[2] = p[2];\n      palette[c].p[3] = (p[0]*BMUL+p[1]*GMUL+p[2]*RMUL)/SMUL;\n    }\n  }\n  // Code data\n  if (version & 0x80)\n    {\n      int datasize = bs.read24();\n      if (datasize<0)\n        G_THROW( ERR_MSG(\"DjVuPalette.bad_palette\") );\n      colordata.resize(0,datasize-1);\n      GP<ByteStream> gbsb=BSByteStream::create(gbs);\n      ByteStream &bsb=*gbsb;\n      { // extra nesting for windows\n        for (int d=0; d<datasize; d++)\n        {\n          short s = bsb.read16();\n          if (s<0 || s>=palettesize)\n            G_THROW( ERR_MSG(\"DjVuPalette.bad_palette\") );        \n          colordata[d] = s;\n        }\n      }\n    }\n}\n\n\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/DjVuPalette.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _DJVUPALETTE_H_\n#define _DJVUPALETTE_H_\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n#include \"GContainer.h\"\n#include \"GPixmap.h\"\n#include <string.h>\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n/** @name DjVuPalette.h\n    Files #\"DjVuPalette.h\"# and #\"DjVuPalette.cpp\"# implement a single class\n    \\Ref{DjVuPalette} which provides facilities for computing optimal color\n    palettes, coding color palettes, and coding sequences of color indices.\n    @memo \n    DjVuPalette header file\n    @author: \n    L\\'eon Bottou <leonb@research.att.com> */\n//@{\n\n\n/** Computing and coding color palettes and index arrays.\n    This class provides facilities for computing optimal color palettes,\n    coding color palettes, and coding sequences of color indices.\n    \n    {\\bf Creating a color palette} -- The recipe for creating a color palette\n    consists in (a) creating a DjVuPalette object, (b) constructing a color\n    histogram using \\Ref{histogram_add}, and (c) calling function\n    \\Ref{compute_palette}.\n\n    {\\bf Accessing the color palette} -- Conversion between colors and color\n    palette indices is easily achieved with \\Ref{color_to_index} and\n    \\Ref{index_to_color}.  There are also functions for computing a palette\n    and quantizing a complete pixmap.\n\n    {\\bf Sequences of color indices} -- The DjVuPalette object also contains\n    an array \\Ref{colordata} optionally containing a sequence of color\n    indices.  This array will be encoded and decoded by functions \\Ref{encode}\n    and \\Ref{decode}.  This feature simplifies the implementation of the ``one\n    color per symbol'' model in DjVu.\n\n    {\\bf Coding color palettes and color indices} -- Two functions\n    \\Ref{encode} and \\Ref{decode} are provided for coding the color palette\n    and the array of color indices when appropriate.  */\n#ifdef _WIN32_WCE_EMULATION         // Work around odd behavior under WCE Emulation\n#define CALLINGCONVENTION __cdecl\n#else\n#define CALLINGCONVENTION  /* */\n#endif\n\nclass DJVUAPI DjVuPalette : public GPEnabled\n{\nprotected:\n  DjVuPalette(void);\npublic:\n  /// Generic creator\n  static GP<DjVuPalette> create(void) {return new DjVuPalette();}\n\n  /// Non-virtual destructor\n  ~DjVuPalette();\n  // COPY\n  DjVuPalette(const DjVuPalette &ref);\n  DjVuPalette& operator=(const DjVuPalette &ref);\n  // PALETTE COMPUTATION\n  /** Resets the color histogram to zero. */\n  void histogram_clear();\n  /** Adds the color specified by #p# to the histogram.\n      Argument #weight# represent the number of pixels with this color. */\n  void histogram_add(const GPixel &p, int weight);\n  /** Adds the color specified by the triple #bgr# to the histogram.\n      Argument #weight# represent the number of pixels with this color. */\n  void histogram_add(const unsigned char *bgr, int weight);\n  /** Adds the color specified by the weighted triple #bgr# to the histogram.\n      Argument #weight# represent the number of pixels with this color.  This\n      function will compute the actual color by dividing the elements of the\n      #bgr# array by #weight# and then use the unnormalized values to compute\n      the average color per bucket.  This is all a way to avoid excessive loss\n      of accuracy. */\n  void histogram_norm_and_add(const int *bgr, int weight);\n  /** Computes an optimal palette for representing an image where colors\n      appear according to the histogram.  Argument #maxcolors# is the maximum\n      number of colors allowed in the palette (up to 1024).  Argument\n      #minboxsize# controls the minimal size of the color cube area affected\n      to a color palette entry.  Returns the index of the dominant color. */\n  int compute_palette(int maxcolors, int minboxsize=0);\n  /** Computes the optimal palette for pixmap #pm#.  This function builds the\n      histogram for pixmap #pm# and computes the optimal palette using\n      \\Ref{compute_palette}. */\n  int compute_pixmap_palette(const GPixmap &pm, int ncolors, int minboxsize=0);\n  // CONVERSION\n  /** Returns the number of colors in the palette. */\n  int size() const;\n  /** Returns the best palette index for representing color #p#. */\n  int color_to_index(const GPixel &p);\n  /** Returns the best palette index for representing color #bgr#. */\n  int color_to_index(const unsigned char *bgr);\n  /** Overwrites #p# with the color located at position #index# in the palette. */\n  void index_to_color(int index, GPixel &p) const;\n  /** Overwrites #rgb[0..3]# with the color located at \n      position #index# in the palette. */\n  void index_to_color(int index, unsigned char *bgr) const;\n  /** Quantizes pixmap #pm#. All pixels are replaced by their closest\n      approximation available in the palette. */\n  void quantize(GPixmap &pm);\n  /** Calls \\Ref{compute_pixmap_palette} and \\Ref{quantize}. */\n  int compute_palette_and_quantize(GPixmap &pm, int maxcolors, int minboxsize=0);\n  // COLOR CORRECTION\n  /** Applies a luminance gamma correction factor of #corr# to the palette\n      entries.  Values greater than #1.0# make the image brighter.  Values\n      smaller than #1.0# make the image darker.  The documentation of program\n      \\Ref{ppmcoco} explains how to properly use this function. */\n  void color_correct(double corr);\n  // COLOR INDEX DATA\n  /** Contains an optional sequence of color indices. \n      Function \\Ref{encode} and \\Ref{decode} also encode and decode this\n      sequence when such a sequence is provided. */\n  GTArray<short> colordata;\n  /** Returns colors from the color index sequence.  Pixel #out# is\n      overwritten with the color corresponding to the #nth# element of the\n      color sequence \\Ref{colordata}. */\n  void get_color(int nth, GPixel &out) const;\n  // CODING\n  /** Writes the palette colors.  This function writes each palette color as a\n      RGB triple into bytestream #bs#. */\n  void encode_rgb_entries(ByteStream &bs) const;\n  /** Reads palette colors.  This function initializes the palette colors by\n      reading #palettesize# RGB triples from bytestream #bs#. */\n  void decode_rgb_entries(ByteStream &bs, const int palettesize);\n  /** Encodes the palette and the color index sequence. This function encodes\n      the a version byte, the palette size, the palette colors and the color\n      index sequence into bytestream #bs#.  Note that the color histogram is\n      never saved. */\n  void encode(GP<ByteStream> bs) const;\n  /** Initializes the object by reading data from bytestream #bs#.  This\n      function reads a version byte, the palette size, the palette and the\n      color index sequence from bytestream #bs#.  Note that the color\n      histogram is never saved. */\n  void decode(GP<ByteStream> bs);\n\nprivate:\n  // Histogram\n  int mask;\n  GMap<int,int> *hist;\n  // Quantization data\n  struct PColor { unsigned char p[4]; };\n  GTArray<PColor> palette;\n  GMap<int,int> *pmap;\n  // Helpers\n  void allocate_hist();\n  void allocate_pmap();\n  static int CALLINGCONVENTION bcomp (const void*, const void*);\n  static int CALLINGCONVENTION gcomp (const void*, const void*);\n  static int CALLINGCONVENTION rcomp (const void*, const void*);\n  static int CALLINGCONVENTION lcomp (const void*, const void*);\n  int color_to_index_slow(const unsigned char *bgr);\nprivate: // dummy functions\n  static void encode(ByteStream *);\n  static void decode(ByteStream *);\n};\n\n\n//@}\n\n// ------------ INLINES\n\n\ninline void \nDjVuPalette::histogram_clear()\n{\n  delete hist;\n  hist = 0;\n  mask = 0;\n}\n\ninline void \nDjVuPalette::histogram_add(const unsigned char *bgr, int weight)\n{\n  if (weight > 0)\n    {\n      if (!hist || hist->size()>=0x4000) \n        allocate_hist();\n      int key = (bgr[0]<<16)|(bgr[1]<<8)|(bgr[2])|(mask);\n      (*hist)[key] += weight;\n    }\n}  \n\ninline void \nDjVuPalette::histogram_add(const GPixel &p, int weight)\n{\n  histogram_add(&p.b, weight);\n}\n\ninline void \nDjVuPalette::histogram_norm_and_add(const int *bgr, int weight)\n{\n  if (weight > 0)\n    {\n      int p0 = bgr[0]/weight; if (p0>255) p0=255;\n      int p1 = bgr[1]/weight; if (p1>255) p1=255;\n      int p2 = bgr[2]/weight; if (p2>255) p2=255;\n      if (!hist || hist->size()>=0x4000) \n        allocate_hist();\n      int key = (p0<<16)|(p1<<8)|(p2)|(mask);\n      (*hist)[key] += weight;\n    }\n}\n\ninline int\nDjVuPalette::size() const\n{\n  return palette.size();\n}\n\ninline int \nDjVuPalette::color_to_index(const unsigned char *bgr)\n{\n  if (! pmap)\n    allocate_pmap();\n  int key = (bgr[0]<<16)|(bgr[1]<<8)|(bgr[2]);\n  GPosition p = pmap->contains(key);\n  if ( p)\n    return (*pmap)[p];\n  return color_to_index_slow(bgr);\n}\n\ninline int \nDjVuPalette::color_to_index(const GPixel &p)\n{\n  return color_to_index(&p.b);\n}\n\ninline void \nDjVuPalette::index_to_color(int index, unsigned char *bgr) const\n{\n  const PColor &color = palette[index];\n  bgr[0] = color.p[0];\n  bgr[1] = color.p[1];\n  bgr[2] = color.p[2];\n}\n\ninline void \nDjVuPalette::index_to_color(int index, GPixel &p) const\n{\n  index_to_color(index, &p.b);\n}\n\ninline void\nDjVuPalette::get_color(int nth, GPixel &p) const\n{\n  index_to_color(colordata[nth], p);\n}\n\n\n\n// ------------ THE END\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n      \n      \n             \n\n    \n"
  },
  {
    "path": "ext/libdjvu/DjVuPort.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"DjVuPort.h\"\n#include \"GOS.h\"\n#include \"DjVuImage.h\"\n#include \"DjVuDocument.h\"\n#include \"DjVuFile.h\"\n#include \"DjVuMessageLite.h\"\n#include \"DataPool.h\"\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n//****************************************************************************\n//******************************* Globals ************************************\n//****************************************************************************\n\nstatic DjVuPortcaster *pcaster;\n\nDjVuPortcaster *\nDjVuPort::get_portcaster(void)\n{\n   if (!pcaster) pcaster = new DjVuPortcaster();\n   return pcaster;\n}\n\nclass DjVuPort::DjVuPortCorpse\n{\npublic:\n   DjVuPort\t\t* port;\n   DjVuPortCorpse\t* next;\n\n   DjVuPortCorpse(DjVuPort * _port) : port(_port), next(0) {}\n};\n\n//****************************************************************************\n//******************************* DjVuPort ***********************************\n//****************************************************************************\n\n#define MAX_CORPSE_NUM\t128\n\n// Last MAX_CORPSE_NUM addresses of dead DjVuPorts. We want to maintain this\n// list because of the way DjVuPort::is_port_alive() works: it accepts an\n// address and runs it thru its internal maps. The problem will occur if\n// a new DjVuPort is created exactly on place of another one, which just\n// died. Here we attempt to remember the last MAX_CORPSE_NUM addresses\n// of dead DjVuPorts, and take them into account in DjVuPort::operator new();\nGCriticalSection * DjVuPort::corpse_lock;\nDjVuPort::DjVuPortCorpse\t* DjVuPort::corpse_head;\nDjVuPort::DjVuPortCorpse\t* DjVuPort::corpse_tail;\nint\t\tDjVuPort::corpse_num;\n\nvoid *\nDjVuPort::operator new (size_t sz)\n{\n  if (!corpse_lock) corpse_lock=new GCriticalSection();\n  \n  // Loop until we manage to allocate smth, which is not mentioned in\n  // the 'corpse' list. Thus we will avoid allocating a new DjVuPort\n  // on place of a dead one. Not *absolutely* secure (only 64 items\n  // in the list) but is still better than nothing.\n  void * addr=0;\n  {\n    GCriticalSectionLock lock(corpse_lock);\n    \n    // Store here addresses, which were found in 'corpse' list.\n    // We will free then in the end\n    int addr_num=0;\n    static void * addr_arr[MAX_CORPSE_NUM];\n    \n    // Make at most MAX_CORPSE_NUM attempts. During each attempt\n    // we try to allocate a block of memory for DjVuPort. If\n    // the address of this block is not in the corpse list, we break\n    // All addresses will be recorder, so that we can delete them\n    // after we're done.\n    for(int attempt=0;attempt<MAX_CORPSE_NUM;attempt++)\n    {\n      void * test_addr=::operator new (sz);\n      addr_arr[addr_num++]=test_addr;\n      \n      // See if 'test_addr' is in the 'corpse' list (was recently used)\n      DjVuPortCorpse * corpse;\n      for(corpse=corpse_head;corpse;corpse=corpse->next)\n        if (test_addr==corpse->port) break;\n        if (!corpse)\n        {\n          addr=test_addr;\n          addr_num--;\n          break;\n        }\n    }\n    // If all attempts failed (all addresses generated are already\n    // in the list of corpses, allocate a new one and proceed\n    // w/o additional checks\n    if (!addr) addr=::operator new(sz);\n    \n    // Here 'addr_arr[0<=i<addr_num]' contains addresses, that we\n    // tried to allocate, and which need to be freed now\n    // 'addr' contains address we want to use.\n    addr_num--;\n    while(addr_num>=0) ::operator delete(addr_arr[addr_num--]);\n  }\n  \n  DjVuPortcaster * pcaster=get_portcaster();\n  GCriticalSectionLock lock(&pcaster->map_lock);\n  pcaster->cont_map[addr]=0;\n  return addr;\n}\n\nvoid\nDjVuPort::operator delete(void * addr)\n{\n  if (corpse_lock)\n  {\n    GCriticalSectionLock lock(corpse_lock);\n    \n    // Add 'addr' to the list of corpses\n    if (corpse_tail)\n    {\n      corpse_tail->next=new DjVuPortCorpse((DjVuPort *) addr);\n      corpse_tail=corpse_tail->next;\n      corpse_tail->next=0;\n    } else\n    {\n      corpse_head=corpse_tail=new DjVuPortCorpse((DjVuPort *) addr);\n      corpse_tail->next=0;\n    }\n    corpse_num++;\n    if (corpse_num>=MAX_CORPSE_NUM)\n    {\n      DjVuPortCorpse * corpse=corpse_head;\n      corpse_head=corpse_head->next;\n      delete corpse;\n      corpse_num--;\n    }\n  }\n  ::operator delete(addr);\n}\n\nDjVuPort::DjVuPort()\n{\n  DjVuPortcaster *pcaster = get_portcaster();\n  GCriticalSectionLock lock(& pcaster->map_lock );\n  GPosition p = pcaster->cont_map.contains(this);\n  if (!p) G_THROW( ERR_MSG(\"DjVuPort.not_alloc\") );\n  pcaster->cont_map[p] = (void*)this;\n}\n\nDjVuPort::DjVuPort(const DjVuPort & port)\n{\n  DjVuPortcaster *pcaster = get_portcaster();\n  GCriticalSectionLock lock(& pcaster->map_lock );\n  GPosition p = pcaster->cont_map.contains(this);\n  if (!p) G_THROW( ERR_MSG(\"DjVuPort.not_alloc\") );\n  pcaster->cont_map[p] = (void*)this;\n  pcaster->copy_routes(this, &port);\n}\n\nDjVuPort &\nDjVuPort::operator=(const DjVuPort & port)\n{\n   if (this != &port)\n      get_portcaster()->copy_routes(this, &port);\n   return *this;\n}\n\nDjVuPort::~DjVuPort(void)\n{\n  get_portcaster()->del_port(this);\n}\n\n\n//****************************************************************************\n//**************************** DjVuPortcaster ********************************\n//****************************************************************************\n\n\n\nDjVuPortcaster::DjVuPortcaster(void)\n{\n}\n\nDjVuPortcaster::~DjVuPortcaster(void)\n{\n   GCriticalSectionLock lock(&map_lock);\n   for(GPosition pos=route_map;pos;++pos)\n      delete (GList<void *> *) route_map[pos];\n}\n\nGP<DjVuPort>\nDjVuPortcaster::is_port_alive(DjVuPort *port)\n{\n   GP<DjVuPort> gp_port;\n   GCriticalSectionLock lock(&map_lock);\n   GPosition pos=cont_map.contains(port);\n   if (pos && cont_map[pos] && ((DjVuPort *) port)->get_count()>0)\n      gp_port=port;\n   if (gp_port && gp_port->get_count() <= 0)\n      gp_port = 0;\n   return gp_port;\n}\n\nvoid\nDjVuPortcaster::add_alias(const DjVuPort * port, const GUTF8String &alias)\n{\n   GCriticalSectionLock lock(&map_lock);\n   a2p_map[alias]=port;\n}\n\nvoid\nDjVuPortcaster::clear_all_aliases(void)\n{\n  DjVuPortcaster *p=get_portcaster();\n  GCriticalSectionLock lock(&(p->map_lock));\n  GPosition pos;\n  while((pos=p->a2p_map))\n  {\n    p->a2p_map.del(pos);\n  }\n}\n\nvoid\nDjVuPortcaster::clear_aliases(const DjVuPort * port)\n{\n  GCriticalSectionLock lock(&map_lock);\n  for(GPosition pos=a2p_map;pos;)\n    if (a2p_map[pos]==port)\n    {\n      GPosition this_pos=pos;\n      ++pos;\n      a2p_map.del(this_pos);\n    } else ++pos;\n}\n\nGP<DjVuPort>\nDjVuPortcaster::alias_to_port(const GUTF8String &alias)\n{\n   GCriticalSectionLock lock(&map_lock);\n   GPosition pos;\n   if (a2p_map.contains(alias, pos))\n   {\n      DjVuPort * port=(DjVuPort *) a2p_map[pos];\n      GP<DjVuPort> gp_port=is_port_alive(port);\n      if (gp_port) return gp_port;\n      else a2p_map.del(pos);\n   }\n   return 0;\n}\n\nGPList<DjVuPort>\nDjVuPortcaster::prefix_to_ports(const GUTF8String &prefix)\n{\n  GPList<DjVuPort> list;\n  {\n    int length=prefix.length();\n    if (length)\n    {\n      GCriticalSectionLock lock(&map_lock);\n      for(GPosition pos=a2p_map;pos;++pos)\n        if (!prefix.cmp(a2p_map.key(pos), length))\n        {\n          DjVuPort * port=(DjVuPort *) a2p_map[pos];\n          GP<DjVuPort> gp_port=is_port_alive(port);\n          if (gp_port) list.append(gp_port);\n        }\n    }\n  }\n  return list;\n}\n\nvoid\nDjVuPortcaster::del_port(const DjVuPort * port)\n{\n  GCriticalSectionLock lock(&map_lock);\n  \n  GPosition pos;\n  \n  // Update the \"aliases map\"\n  clear_aliases(port);\n  \n  // Update \"contents map\"\n  if (cont_map.contains(port, pos)) cont_map.del(pos);\n  \n  // Update \"route map\"\n  if (route_map.contains(port, pos))\n  {\n    delete (GList<void *> *) route_map[pos];\n    route_map.del(pos);\n  }\n  for(pos=route_map;pos;)\n  {\n    GList<void *> & list=*(GList<void *> *) route_map[pos];\n    GPosition list_pos;\n    if (list.search((void *) port, list_pos)) list.del(list_pos);\n    if (!list.size())\n    {\n      delete &list;\n      GPosition tmp_pos=pos;\n      ++pos;\n      route_map.del(tmp_pos);\n    } else ++pos;\n  }\n}\n\nvoid\nDjVuPortcaster::add_route(const DjVuPort * src, DjVuPort * dst)\n      // Adds route src->dst\n{\n   GCriticalSectionLock lock(&map_lock);\n   if (cont_map.contains(src) && src->get_count()>0 &&\n       cont_map.contains(dst) && dst->get_count()>0)\n   {\n      if (!route_map.contains(src)) route_map[src]=new GList<void *>();\n      GList<void *> & list=*(GList<void *> *) route_map[src];\n      if (!list.contains(dst)) list.append(dst);\n   }\n}\n\nvoid\nDjVuPortcaster::del_route(const DjVuPort * src, DjVuPort * dst)\n// Deletes route src->dst\n{\n  GCriticalSectionLock lock(&map_lock);\n  \n  if (route_map.contains(src))\n  {\n    GList<void *> & list=*(GList<void *> *) route_map[src];\n    GPosition pos;\n    if (list.search(dst, pos)) list.del(pos);\n    if (!list.size())\n    {\n      delete &list;\n      route_map.del(src);\n    }\n  }\n}\n\nvoid\nDjVuPortcaster::copy_routes(DjVuPort * dst, const DjVuPort * src)\n      // For every route src->x or x->src, it creates a new one:\n      // dst->x or x->dst respectively. It's useful when you create a copy\n      // of a port and you want the copy to stay connected.\n{\n  GCriticalSectionLock lock(&map_lock);\n  \n  if (!cont_map.contains(src) || src->get_count()<=0 ||\n    !cont_map.contains(dst) || dst->get_count()<=0) return;\n  \n  for(GPosition pos=route_map;pos;++pos)\n  {\n    GList<void *> & list=*(GList<void *> *) route_map[pos];\n    if (route_map.key(pos) == src)\n      for(GPosition pos=list;pos;++pos)\n        add_route(dst, (DjVuPort *) list[pos]);\n    for(GPosition pos=list;pos;++pos)\n      if ((DjVuPort*)(list[pos]) == src)\n        add_route((DjVuPort *) route_map.key(pos), dst);\n  }\n}\n\nvoid\nDjVuPortcaster::add_to_closure(GMap<const void *, void *> & set,\n\t\t\t       const DjVuPort * dst, int distance)\n{\n  // Assuming that the map's already locked\n  // GCriticalSectionLock lock(&map_lock);\n  set[dst]= (void*) (unsigned long) distance;\n  if (route_map.contains(dst))\n    {\n      GList<void *> & list=*(GList<void *> *) route_map[dst];\n      for(GPosition pos=list;pos;++pos)\n        {\n          DjVuPort * new_dst=(DjVuPort *) list[pos];\n          if (!set.contains(new_dst)) \n            add_to_closure(set, new_dst, distance+1);\n        }\n   }\n}\n\nvoid\nDjVuPortcaster::compute_closure(const DjVuPort * src, GPList<DjVuPort> &list, bool sorted)\n{\n   GCriticalSectionLock lock(&map_lock);\n   GMap<const void*, void*> set;\n   if (route_map.contains(src))\n   {\n      GList<void *> & list=*(GList<void *> *) route_map[src];\n      for(GPosition pos=list;pos;++pos)\n      {\n\t       DjVuPort * dst=(DjVuPort *) list[pos];\n\t       if (dst==src) add_to_closure(set, src, 0);\n\t       else add_to_closure(set, dst, 1);\n      }\n   }\n\n   // Compute list\n   GPosition pos;\n   if (sorted)\n     {\n       // Sort in depth order\n       int max_dist=0;\n       for(pos=set;pos;++pos)\n         if (max_dist < (int)(long)set[pos])\n           max_dist = (int)(long)set[pos];\n       GArray<GList<const void*> > lists(0,max_dist);\n       for(pos=set;pos;++pos)\n         lists[(int)(long)set[pos]].append(set.key(pos));\n       for(int dist=0;dist<=max_dist;dist++)\n         for(pos=lists[dist];pos;++pos)\n           {\n             GP<DjVuPort> p = is_port_alive((DjVuPort*) lists[dist][pos]);\n             if (p) list.append(p);\n           }\n     }\n   else\n     {\n       // Gather ports without order\n       for(pos=set;pos;++pos)\n         {\n           GP<DjVuPort> p = is_port_alive((DjVuPort*) set.key(pos));\n           if (p) list.append(p);\n         }\n     }\n}\n\nGURL\nDjVuPortcaster::id_to_url(const DjVuPort * source, const GUTF8String &id)\n{\n   GPList<DjVuPort> list;\n   compute_closure(source, list, true);\n   GURL url;\n   for(GPosition pos=list;pos;++pos)\n   {\n      url=list[pos]->id_to_url(source, id);\n      if (!url.is_empty()) break;\n   }\n   return url;\n}\n\nGP<DjVuFile>\nDjVuPortcaster::id_to_file(const DjVuPort * source, const GUTF8String &id)\n{\n   GPList<DjVuPort> list;\n   compute_closure(source, list, true);\n   GP<DjVuFile> file;\n   for(GPosition pos=list;pos;++pos)\n      if ((file=list[pos]->id_to_file(source, id))) break;\n   return file;\n}\n\nGP<DataPool>\nDjVuPortcaster::request_data(const DjVuPort * source, const GURL & url)\n{\n   GPList<DjVuPort> list;\n   compute_closure(source, list, true);\n   GP<DataPool> data;\n   for(GPosition pos=list;pos;++pos)\n     if ((data = list[pos]->request_data(source, url)))\n       break;\n   return data;\n}\n\nbool\nDjVuPortcaster::notify_error(const DjVuPort * source, const GUTF8String &msg)\n{\n   GPList<DjVuPort> list;\n   compute_closure(source, list, true);\n   for(GPosition pos=list;pos;++pos)\n     if (list[pos]->notify_error(source, msg))\n       return 1;\n   return 0;\n}\n\nbool\nDjVuPortcaster::notify_status(const DjVuPort * source, const GUTF8String &msg)\n{\n   GPList<DjVuPort> list;\n   compute_closure(source, list, true);\n   for(GPosition pos=list;pos;++pos)\n     if (list[pos]->notify_status(source, msg))\n       return 1;\n   return 0;\n}\n\nvoid\nDjVuPortcaster::notify_redisplay(const DjVuImage * source)\n{\n   GPList<DjVuPort> list;\n   compute_closure(source, list);\n   for(GPosition pos=list; pos; ++pos)\n     list[pos]->notify_redisplay(source);\n}\n\nvoid\nDjVuPortcaster::notify_relayout(const DjVuImage * source)\n{\n   GPList<DjVuPort> list;\n   compute_closure(source, list);\n   for(GPosition pos=list; pos; ++pos)\n     list[pos]->notify_relayout(source);\n}\n\nvoid\nDjVuPortcaster::notify_chunk_done(const DjVuPort * source, const GUTF8String &name)\n{\n   GPList<DjVuPort> list;\n   compute_closure(source, list);\n   for(GPosition pos=list; pos; ++pos)\n     list[pos]->notify_chunk_done(source, name);\n}\n\nvoid\nDjVuPortcaster::notify_file_flags_changed(const DjVuFile * source,\n\t\t\t\t\t  long set_mask, long clr_mask)\n{\n   GPList<DjVuPort> list;\n   compute_closure(source, list);\n   for(GPosition pos=list; pos; ++pos)\n     list[pos]->notify_file_flags_changed(source, set_mask, clr_mask);\n}\n\nvoid\nDjVuPortcaster::notify_doc_flags_changed(const DjVuDocument * source,\n\t\t\t\t\t long set_mask, long clr_mask)\n{\n   GPList<DjVuPort> list;\n   compute_closure(source, list);\n   for(GPosition pos=list; pos; ++pos)\n     list[pos]->notify_doc_flags_changed(source, set_mask, clr_mask);\n}\n\nvoid\nDjVuPortcaster::notify_decode_progress(const DjVuPort * source, float done)\n{\n   GPList<DjVuPort> list;\n   compute_closure(source, list);\n   for(GPosition pos=list; pos; ++pos)\n     list[pos]->notify_decode_progress(source, done);\n}\n\n//****************************************************************************\n//******************************* DjVuPort ***********************************\n//****************************************************************************\n\nGURL\nDjVuPort::id_to_url(const DjVuPort *, const GUTF8String &) { return GURL(); }\n\nGP<DjVuFile>\nDjVuPort::id_to_file(const DjVuPort *, const GUTF8String &) { return 0; }\n\nGP<DataPool>\nDjVuPort::request_data(const DjVuPort *, const GURL &) { return 0; }\n\nbool\nDjVuPort::notify_error(const DjVuPort *, const GUTF8String &) { return 0; }\n\nbool\nDjVuPort::notify_status(const DjVuPort *, const GUTF8String &) { return 0; }\n\nvoid\nDjVuPort::notify_redisplay(const DjVuImage *) {}\n\nvoid\nDjVuPort::notify_relayout(const DjVuImage *) {}\n\nvoid\nDjVuPort::notify_chunk_done(const DjVuPort *, const GUTF8String &) {}\n\nvoid\nDjVuPort::notify_file_flags_changed(const DjVuFile *, long, long) {}\n\nvoid\nDjVuPort::notify_doc_flags_changed(const DjVuDocument *, long, long) {}\n\nvoid\nDjVuPort::notify_decode_progress(const DjVuPort *, float) {}\n\n//****************************************************************************\n//*************************** DjVuSimplePort *********************************\n//****************************************************************************\n\nGP<DataPool>\nDjVuSimplePort::request_data(const DjVuPort * source, const GURL & url)\n{\n  G_TRY {\n    if (url.is_local_file_url())\n    {\n//      GUTF8String fname=GOS::url_to_filename(url);\n//      if (GOS::basename(fname)==\"-\") fname=\"-\";\n      return DataPool::create(url);\n    }\n  } G_CATCH_ALL {} G_ENDCATCH;\n  return 0;\n}\n\nbool\nDjVuSimplePort::notify_error(const DjVuPort * source, const GUTF8String &msg)\n{\n   DjVuMessageLite::perror(msg);\n   return 1;\n}\n\nbool\nDjVuSimplePort::notify_status(const DjVuPort * source, const GUTF8String &msg)\n{\n   DjVuMessageLite::perror(msg);\n   return 1;\n}\n\n\n\n\n\n//****************************************************************************\n//*************************** DjVuMemoryPort *********************************\n//****************************************************************************\n\n\n\nGP<DataPool>\nDjVuMemoryPort::request_data(const DjVuPort * source, const GURL & url)\n{\n   GCriticalSectionLock lk(&lock);\n   GP<DataPool> pool;\n   GPosition pos;\n   if (map.contains(url, pos))\n      pool=map[pos];\n   return pool;\n}\n\nvoid\nDjVuMemoryPort::add_data(const GURL & url, const GP<DataPool> & pool)\n{\n   GCriticalSectionLock lk(&lock);\n   map[url]=pool;\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/DjVuPort.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _DJVUPORT_H\n#define _DJVUPORT_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n#include \"GThreads.h\"\n#include \"GURL.h\"\n#include \"stddef.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass DataPool;\n\n/** @name DjVuPort.h\n    Files #\"DjVuPort.h\"# and #\"DjVuPort.cpp\"# implement a communication\n    mechanism between different parties involved in decoding DjVu files.\n    It should be pretty clear that the creator of \\Ref{DjVuDocument} and\n    \\Ref{DjVuFile} would like to receive some information about the progress\n    of decoding, errors occurred, etc. It may also want to provide source data\n    for decoders (like it's done in the plugin where the real data is downloaded\n    from the net and is fed into DjVu decoders).\n\n    Normally this functionality is implemented by means of callbacks which are\n    run when a given condition comes true. Unfortunately it's not quite easy\n    to implement this strategy in our case. The reason is that there may be\n    more than one \"client\" working with the same document, and the document\n    should send the information to each of the clients. This could be done by\n    means of callback {\\em lists}, of course, but we want to achieve more\n    bulletproof results: we want to be sure that the client that we're about\n    to contact is still alive, and is not being destroyed by another thread.\n    Besides, we are going to call these \"callbacks\" from many places, from\n    many different classes.  Maintaining multi-thread safe callback lists is\n    very difficult.\n\n    Finally, we want to provide some default implementation of these\n    \"callbacks\" in the library, which should attempt to process the requests\n    themselves if they can, and contact the client only if they're unable to\n    do it (like in the case of \\Ref{DjVuPort::request_data}() with local URL\n    where \\Ref{DjVuDocument} can get the data from the hard drive itself not\n    disturbing the document's creator.\n\n    Two classes implement a general communication mechanism: \\Ref{DjVuPort} and\n    \\Ref{DjVuPortcaster}. Any sender and recipient of requests should be a\n    subclass of \\Ref{DjVuPort}.  \\Ref{DjVuPortcaster} maintains a map of\n    routes between \\Ref{DjVuPort}s, which should be configured by somebody\n    else. Whenever a port wants to send a request, it calls the corresponding\n    function of \\Ref{DjVuPortcaster}, and the portcaster relays the request to\n    all the destinations that it sees in the internal map.\n\n    The \\Ref{DjVuPortcaster} is responsible for keeping the map up to date by\n    getting rid of destinations that have been destroyed.  Map updates are\n    performed from a single place and are serialized by a global monitor.\n    \n    @memo DjVu decoder communication mechanism.\n    @author Andrei Erofeev <eaf@geocities.com>\\\\\n            L\\'eon Bottou <leonb@research.att.com>\n*/\n//@{\n\nclass DjVuPort;\nclass DjVuPortcaster;\nclass DjVuFile;\n\n/** Base class for notification targets.\n    #DjVuPort# provides base functionality for classes willing to take part in\n    sending and receiving messages generated during decoding process.  You\n    need to derive your class from #DjVuPort# if you want it to be able to\n    send or receive requests. In addition, for receiving requests you should\n    override one or more virtual function.\n\n    {\\bf Important remark} --- All ports should be allocated on the heap using\n    #operator new# and immediately secured using a \\Ref{GP} smart pointer.\n    Ports which are not secured by a smart-pointer are not considered\n    ``alive'' and never receive notifications! */\n\nclass DJVUAPI DjVuPort : public GPEnabled\n{\npublic:\n   DjVuPort();\n   virtual ~DjVuPort();\n   static void *operator new (size_t sz);\n   static void operator delete(void *addr);\n\n      /**  Use this function to get a copy of the global \\Ref{DjVuPortcaster}. */\n   static DjVuPortcaster *get_portcaster(void);\n\n      /** Copy constructor. When #DjVuPort#s are copied, the portcaster\n          copies all incoming and outgoing routes of the original. */\n   DjVuPort(const DjVuPort & port);\n\n      /** Copy operator. Similarly to the copy constructor, the portcaster\n          copies all incoming and outgoing coming routes of the original. */\n   DjVuPort & operator=(const DjVuPort & port);\n\n      /** Should return 1 if the called class inherits class #class_name#.\n\t  When a destination receives a request, it can retrieve the pointer\n\t  to the source #DjVuPort#. This virtual function should be able\n\t  to help to identify the source of the request. For example,\n\t  \\Ref{DjVuFile} is also derived from #DjVuPort#. In order for\n\t  the receiver to recognize the sender, the \\Ref{DjVuFile} should\n\t  override this function to return #TRUE# when the #class_name#\n\t  is either #DjVuPort# or #DjVuFile# */\n   virtual bool\t\tinherits(const GUTF8String &class_name) const;\n\n      /** @name Notifications. \n          These virtual functions may be overridden by the subclasses\n          of #DjVuPort#.  They are called by the \\Ref{DjVuPortcaster}\n          when the port is alive and when there is a route between the \n          source of the notification and this port. */\n      //@{\n\n      /** This request is issued to request translation of the ID, used\n\t  in an DjVu INCL chunk to a URL, which may be used to request\n\t  data associated with included file. \\Ref{DjVuDocument} usually\n\t  intercepts all such requests, and the user doesn't have to\n\t  worry about the translation */\n   virtual GURL\t\tid_to_url(const DjVuPort * source, const GUTF8String &id);\n\n      /** This request is used to get a file corresponding to the\n\t  given ID. \\Ref{DjVuDocument} is supposed to intercept it\n\t  and either create a new instance of \\Ref{DjVuFile} or reuse\n\t  an existing one from the cache. */\n   virtual GP<DjVuFile>\tid_to_file(const DjVuPort * source, const GUTF8String &id);\n\n      /** This request is issued when decoder needs additional data\n\t  for decoding.  Both \\Ref{DjVuFile} and \\Ref{DjVuDocument} are\n\t  initialized with a URL, not the document data.  As soon as\n\t  they need the data, they call this function, whose responsibility\n\t  is to locate the source of the data basing on the #URL# passed\n\t  and return it back in the form of the \\Ref{DataPool}. If this\n\t  particular receiver is unable to fullfil the request, it should\n\t  return #0#. */\n   virtual GP<DataPool>\trequest_data(const DjVuPort * source, const GURL & url);\n\n      /** This notification is sent when an error occurs and the error message\n\t  should be shown to the user.  The receiver should return #0# if it is \n          unable to process the request. Otherwise the receiver should return 1. */\n   virtual bool\t\tnotify_error(const DjVuPort * source, const GUTF8String &msg);\n\n      /** This notification is sent to update the decoding status.  The\n          receiver should return #0# if it is unable to process the\n          request. Otherwise the receiver should return 1. */\n   virtual bool\t\tnotify_status(const DjVuPort * source, const GUTF8String &msg);\n\n      /** This notification is sent by \\Ref{DjVuImage} when it should be\n\t  redrawn. It may be used to implement progressive redisplay.\n\n\t  @param source The sender of the request */\n   virtual void\t\tnotify_redisplay(const class DjVuImage * source);\n\n      /** This notification is sent by \\ref{DjVuImage} when its geometry\n\t  has been changed as a result of decoding. It may be used to\n\t  implement progressive redisplay. */\n   virtual void\t\tnotify_relayout(const class DjVuImage * source);\n\n      /** This notification is sent when a new chunk has been decoded. */\n   virtual void\t\tnotify_chunk_done(const DjVuPort * source, const GUTF8String &name);\n\n      /** This notification is sent after the \\Ref{DjVuFile} flags have\n\t  been changed. This happens, for example, when:\n\t  \\begin{itemize}\n\t    \\item Decoding succeeded, failed or just stopped\n\t    \\item All data has been received\n\t    \\item All included files have been created\n\t  \\end{itemize}\n\t  \n\t  @param source \\Ref{DjVuFile}, which flags have been changed\n\t  @param set_mask bits, which have been set\n\t  @param clr_mask bits, which have been cleared */\n   virtual void\t\tnotify_file_flags_changed(const class DjVuFile * source,\n\t\t\t\t\t\t  long set_mask, long clr_mask);\n\n      /** This notification is sent after the \\Ref{DjVuDocument} flags have\n\t  been changed. This happens, for example, after it receives enough\n\t  data and can determine its structure (#BUNDLED#, #OLD_INDEXED#, etc.).\n\n\t  @param source \\Ref{DjVuDocument}, which flags have been changed\n\t  @param set_mask bits, which have been set\n\t  @param clr_mask bits, which have been cleared */\n   virtual void\t\tnotify_doc_flags_changed(const class DjVuDocument * source,\n\t\t\t\t\t\t long set_mask, long clr_mask);\n   \n      /** This notification is sent from time to time while decoding is in\n\t  progress. The purpose is obvious: to provide a way to know how much\n\t  is done and how long the decoding will continue.  Argument #done# is\n\t  a number from 0 to 1 reflecting the progress. */\n   virtual void\t\tnotify_decode_progress(const DjVuPort * source, float done);\n\n      /** This is the standard types for defining what to do in case of errors.\n          This is only used by some of the subclasses, but it needs to be \n          defined here to guarantee all subclasses use the same enum types.\n          In general, many errors are non recoverable.  Using a setting\n          other than ABORT may just result in even more errors. */\n   enum ErrorRecoveryAction {ABORT=0,SKIP_PAGES=1,SKIP_CHUNKS=2,KEEP_ALL=3 }; \n      //@}\npublic:\n   class DjVuPortCorpse;\nprivate:\n   static GCriticalSection\t* corpse_lock;\n   static DjVuPortCorpse\t* corpse_head;\n   static DjVuPortCorpse        * corpse_tail;\n   static int\t\t\tcorpse_num;\n};\n\n/** Simple port.  \n    An instance of #DjVuSimplePort# is automatically created when you create a\n    \\Ref{DjVuFile} or a \\Ref{DjVuDocument} without specifying a port.  This\n    simple port can retrieve data for local urls (i.e. urls referring to local\n    files) and display error messages on #stderr#.  All other notifications\n    are ignored. */\n\nclass DJVUAPI DjVuSimplePort : public DjVuPort\n{\npublic:\n      /// Returns 1 if #class_name# is #\"DjVuPort\"# or #\"DjVuSimplePort\"#.\n   virtual bool\t\tinherits(const GUTF8String &class_name) const;\n\n      /** If #url# is local, it created a \\Ref{DataPool}, connects it to the\n\t  file with the given name and returns.  Otherwise returns #0#. */\n   virtual GP<DataPool>\trequest_data(const DjVuPort * source, const GURL & url);\n\n      /// Displays error on #stderr#. Always returns 1.\n   virtual bool\t\tnotify_error(const DjVuPort * source, const GUTF8String &msg);\n   \n      /// Displays status on #stderr#. Always returns 1.\n   virtual bool\t\tnotify_status(const DjVuPort * source, const GUTF8String &msg);\n};\n\n\n/** Memory based port.\n    This \\Ref{DjVuPort} maintains a map associating pseudo urls with data\n    segments.  It processes the #request_data# notifications according to this\n    map.  After initializing the port, you should add as many pairs #<url,\n    pool># as needed need and add a route from a \\Ref{DjVuDocument} or\n    \\Ref{DjVuFile} to this port. */\n\nclass DJVUAPI DjVuMemoryPort : public DjVuPort\n{\npublic:\n      /// Returns 1 if #class_name# is #\"DjVuPort\"# or #\"DjVuMemoryPort\"#\n   virtual bool\t\tinherits(const GUTF8String &class_name) const;\n\n      /** If #url# is one of those, that have been added before by means\n\t  of \\Ref{add_data}() function, it will return the associated\n\t  \\Ref{DataPool}. #ZERO# otherwize. */\n   virtual GP<DataPool>\trequest_data(const DjVuPort * source, const GURL & url);\n\n      /** Adds #<url, pool># pair to the internal map. From now on, if\n\t  somebody asks for data corresponding to the #url#, it will\n\t  be returning the #pool# */\n   void\t\tadd_data(const GURL & url, const GP<DataPool> & pool);\nprivate:\n   GCriticalSection\tlock;\n   GPMap<GURL, DataPool>map;\n};\n\n\n\n/** Maintains associations between ports.\n    It monitors the status of all ports (have they been destructed yet?),\n    accepts requests and notifications from them and forwards them to\n    destinations according to internally maintained map of routes.\n\n    The caller can modify the route map any way he likes (see\n    \\Ref{add_route}(), \\Ref{del_route}(), \\Ref{copy_routes}(),\n    etc. functions). Any port can be either a sender of a message, an\n    intermediary receiver or a final destination.  \n\n    When a request is sent, the #DjVuPortcaster# computes the list of\n    destinations by consulting with the route map.  Notifications are only\n    sent to ``alive'' ports.  A port is alive if it is referenced by a valid\n    \\Ref{GP} smartpointer.  As a consequence, a port usually becomes alive\n    after running the constructor (since the returned pointer is then assigned\n    to a smartpointer) and is no longer alive when the port is destroyed\n    (because it would not be destroyed if a smartpointer was referencing it).\n\n    Destination ports are sorted according to their distance from the source.\n    For example, if port {\\bf A} is connected to ports {\\bf B} and {\\bf C}\n    directly, and port {\\bf B} is connected to {\\bf D}, then {\\bf B} and {\\bf\n    C} are assumed to be one hop away from {\\bf A}, while {\\bf D} is two hops\n    away from {\\bf A}.\n\n    In some cases the requests and notifications are sent to every possible\n    destination, and the order is not significant (like it is for\n    \\Ref{notify_file_flags_changed}() request). Others should be sent to the closest\n    destinations first, and only then to the farthest, in case if they have\n    not been processed by the closest. The examples are \\Ref{request_data}(),\n    \\Ref{notify_error}() and \\Ref{notify_status}().\n\n    The user is not expected to create the #DjVuPortcaster# itself. He should\n    use \\Ref{get_portcaster}() global function instead.  */\nclass DJVUAPI DjVuPortcaster\n{\npublic:\n      /**  Use this function to get a copy of the global \\Ref{DjVuPortcaster}. */\n   static DjVuPortcaster *get_portcaster(void)\n    { return DjVuPort::get_portcaster(); } ;\n\n      /** The default constructor. */\n   DjVuPortcaster(void);\n\n   virtual ~DjVuPortcaster(void);\n\n      /** Removes the specified port from all routes. It will no longer\n\t  be able to receive or generate messages and will be considered\n    {\\bf \"dead\"} by \\Ref{is_port_alive}() function. */\n   void\t\tdel_port(const DjVuPort * port);\n   \n      /** Adds route from #src# to #dst#. Whenever a request is\n\t  sent or received by #src#, it will be forwarded to #dst# as well.\n\t  @param src The source\n\t  @param dst The destination */\n   void\t\tadd_route(const DjVuPort *src, DjVuPort *dst);\n\n      /** The opposite of \\Ref{add_route}(). Removes the association\n\t  between #src# and #dst# */\n   void\t\tdel_route(const DjVuPort *src, DjVuPort *dst);\n\n      /** Copies all incoming and outgoing routes from #src# to\n\t  #dst#. This function should be called when a \\Ref{DjVuPort} is\n\t  copied, if you want to preserve the connectivity. */\n   void\t\tcopy_routes(DjVuPort *dst, const DjVuPort *src);\n\n      /** Returns a smart pointer to the port if #port# is a valid pointer\n          to an existing #DjVuPort#.  Returns a null pointer otherwise. */\n   GP<DjVuPort> is_port_alive(DjVuPort *port);\n\n      /** Assigns one more {\\em alias} for the specified \\Ref{DjVuPort}.\n\t  {\\em Aliases} are names, which can be used later to retrieve this\n\t  \\Ref{DjVuPort}, if it still exists. Any \\Ref{DjVuPort} may have\n\t  more than one {\\em alias}. But every {\\em alias} must correspond\n\t  to only one \\Ref{DjVuPort}. Thus, if the specified alias is\n\t  already associated with another port, this association will be\n\t  removed. */\n   void\t\tadd_alias(const DjVuPort * port, const GUTF8String &alias);\n\n      /** Removes all the aliases */\n   static void\t\tclear_all_aliases(void);\n\n      /** Removes all aliases associated with the given \\Ref{DjVuPort}. */\n   void\t\tclear_aliases(const DjVuPort * port);\n\n      /** Returns \\Ref{DjVuPort} associated with the given #alias#. If nothing\n\t  is known about name #alias#, or the port associated with it has\n\t  already been destroyed #ZERO# pointer will be returned. */\n   GP<DjVuPort>\talias_to_port(const GUTF8String &name);\n\n      /** Returns a list of \\Ref{DjVuPort}s with aliases starting with\n\t  #prefix#. If no \\Ref{DjVuPort}s have been found, empty\n\t  list is returned. */\n   GPList<DjVuPort>\tprefix_to_ports(const GUTF8String &prefix);\n\n      /** Computes destination list for #source# and calls the corresponding\n\t  function in each of the ports from the destination list starting from\n\t  the closest until one of them returns non-empty \\Ref{GURL}. */\n   virtual GURL\t\tid_to_url(const DjVuPort * source, const GUTF8String &id);\n\n      /** Computes destination list for #source# and calls the corresponding\n\t  function in each of the ports from the destination list starting from\n\t  the closest until one of them returns non-zero pointer to\n\t  \\Ref{DjVuFile}. */\n   virtual GP<DjVuFile>\tid_to_file(const DjVuPort * source, const GUTF8String &id);\n\n      /** Computes destination list for #source# and calls the corresponding\n\t  function in each of the ports from the destination list starting from\n\t  the closest until one of them returns non-zero \\Ref{DataPool}. */\n   virtual GP<DataPool>\trequest_data(const DjVuPort * source, const GURL & url);\n\n      /** Computes destination list for #source# and calls the corresponding.\n\t  function in each of the ports from the destination starting from\n\t  the closest until one of them returns 1. */\n   virtual bool\t\tnotify_error(const DjVuPort * source, const GUTF8String &msg);\n\n      /** Computes destination list for #source# and calls the corresponding\n\t  function in each of the ports from the destination list starting from\n\t  the closest until one of them returns 1. */\n   virtual bool\t\tnotify_status(const DjVuPort * source, const GUTF8String &msg);\n\n      /** Computes destination list for #source# and calls the corresponding\n\t  function in each of the ports from the destination list starting from\n\t  the closest. */\n   virtual void\t\tnotify_redisplay(const class DjVuImage * source);\n\n      /** Computes destination list for #source# and calls the corresponding\n\t  function in each of the ports from the destination list starting from\n\t  the closest. */\n   virtual void\t\tnotify_relayout(const class DjVuImage * source);\n\n      /** Computes destination list for #source# and calls the corresponding\n\t  function in each of the ports from the destination list starting from\n\t  the closest. */\n   virtual void\t\tnotify_chunk_done(const DjVuPort * source, const GUTF8String &name);\n\n      /** Computes destination list for #source# and calls the corresponding\n\t  function in each of the ports from the destination list starting from\n\t  the closest. */\n   virtual void\t\tnotify_file_flags_changed(const class DjVuFile * source,\n\t\t\t\t\t\t  long set_mask, long clr_mask);\n\n      /** Computes destination list for #source# and calls the corresponding\n\t  function in each of the ports from the destination list starting from\n\t  the closest. */\n   virtual void\t\tnotify_doc_flags_changed(const class DjVuDocument * source,\n\t\t\t\t\t\t long set_mask, long clr_mask);\n   \n      /** Computes destination list for #source# and calls the corresponding\n\t  function in each of the ports from the destination list starting from\n\t  the closest. */\n   virtual void\t\tnotify_decode_progress(const DjVuPort * source, float done);\n\nprivate:\n      // We use these 'void *' to minimize template instantiations.\n   friend class DjVuPort;\n   GCriticalSection\t\tmap_lock;\n   GMap<const void *, void *>\troute_map;\t// GMap<DjVuPort *, GList<DjVuPort *> *>\n   GMap<const void *, void *>\tcont_map;\t// GMap<DjVuPort *, DjVuPort *>\n   GMap<GUTF8String, const void *>\ta2p_map;\t// GMap<GUTF8String, DjVuPort *>\n   void add_to_closure(GMap<const void*, void*> & set,\n                       const DjVuPort *dst, int distance);\n   void compute_closure(const DjVuPort *src, GPList<DjVuPort> &list,\n                        bool sorted=false);\n};\n\n\ninline bool\nDjVuPort::inherits(const GUTF8String &class_name) const\n{\n   return (class_name == \"DjVuPort\");\n}\n\ninline bool\nDjVuSimplePort::inherits(const GUTF8String &class_name) const\n{\n   return\n      (class_name == \"DjVuSimplePort\") || DjVuPort::inherits(class_name);\n}\n\ninline bool\nDjVuMemoryPort::inherits(const GUTF8String &class_name) const\n{\n   return\n      (class_name == \"DjVuMemoryPort\") || DjVuPort::inherits(class_name);\n}\n\n//@}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/DjVuText.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"DjVuText.h\"\n#include \"IFFByteStream.h\"\n#include \"BSByteStream.h\"\n#include \"debug.h\"\n#include <ctype.h>\n\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n\n#ifdef min\n#undef min\n#endif\ntemplate<class TYPE>\nstatic inline TYPE min(TYPE a,TYPE b) { return (a<b)?a:b; }\n\n//***************************************************************************\n//******************************** DjVuTXT **********************************\n//***************************************************************************\n\nconst char DjVuTXT::end_of_column    = 013;      // VT: Vertical Tab\nconst char DjVuTXT::end_of_region    = 035;      // GS: Group Separator\nconst char DjVuTXT::end_of_paragraph = 037;      // US: Unit Separator\nconst char DjVuTXT::end_of_line      = 012;      // LF: Line Feed\n\nconst int DjVuTXT::Zone::version  = 1;\n\nDjVuTXT::Zone::Zone()\n  : ztype(DjVuTXT::PAGE), text_start(0), text_length(0), zone_parent(0)\n{\n}\n\nDjVuTXT::Zone *\nDjVuTXT::Zone::append_child()\n{\n  Zone empty;\n  empty.ztype = ztype;\n  empty.text_start = 0;\n  empty.text_length = 0;\n  empty.zone_parent=this;\n  children.append(empty);\n  return & children[children.lastpos()];\n}\n\nvoid\nDjVuTXT::Zone::cleartext()\n{\n  text_start = 0;\n  text_length = 0;\n  for (GPosition i=children; i; ++i)\n    children[i].cleartext();\n}\n\nvoid\nDjVuTXT::Zone::normtext(const char *instr, GUTF8String &outstr)\n{\n  if (text_length == 0)\n    {\n      // Descend collecting text below\n      text_start = outstr.length();\n      for (GPosition i=children; i; ++i)\n        children[i].normtext(instr, outstr);\n      text_length = outstr.length() - text_start;\n      // Ignore empty zones\n      if (text_length == 0)\n        return;\n    }\n  else\n    {\n      // Collect text at this level\n      int new_start = outstr.length();\n      outstr = outstr + GUTF8String(instr+text_start, text_length);\n      text_start = new_start;\n      // Clear textual information on lower level nodes\n      for (GPosition i=children; i; ++i)\n        children[i].cleartext();\n    }\n  // Determine standard separator\n  char sep;\n  switch (ztype)\n    {\n    case COLUMN:\n      sep = end_of_column; break;\n    case REGION:\n      sep = end_of_region; break;\n    case PARAGRAPH: \n      sep = end_of_paragraph; break;\n    case LINE:\n      sep = end_of_line; break;\n    case WORD:\n      sep = ' '; break;\n    default:\n      return;\n    }\n  // Add separator if not present yet.\n  if (outstr[text_start+text_length-1] != sep)\n    {\n      outstr = outstr + GUTF8String(&sep, 1);\n      text_length += 1;\n    }\n}\n\nunsigned int \nDjVuTXT::Zone::memuse() const\n{\n  int memuse = sizeof(*this);\n  for (GPosition i=children; i; ++i)\n    memuse += children[i].memuse();\n  return memuse;\n}\n\n\n#ifndef NEED_DECODER_ONLY\nvoid \nDjVuTXT::Zone::encode(\n  const GP<ByteStream> &gbs, const Zone * parent, const Zone * prev) const\n{\n  ByteStream &bs=*gbs;\n  // Encode type\n  bs.write8(ztype);\n  \n  // Modify text_start and bounding rectangle based on the context\n  // (whether there is a previous non-zero same-level-child or parent)\n  int start=text_start;\n  int x=rect.xmin, y=rect.ymin;\n  int width=rect.width(), height=rect.height();\n  if (prev)\n  {\n    if (ztype==PAGE || ztype==PARAGRAPH || ztype==LINE)\n    {\n      // Encode offset from the lower left corner of the previous\n      // child in the coord system in that corner with x to the\n      // right and y down\n      x=x-prev->rect.xmin;\n      y=prev->rect.ymin-(y+height);\n    } else // Either COLUMN or WORD or CHARACTER\n    {\n      // Encode offset from the lower right corner of the previous\n      // child in the coord system in that corner with x to the\n      // right and y up\n      x=x-prev->rect.xmax;\n      y=y-prev->rect.ymin;\n    }\n    start-=prev->text_start+prev->text_length;\n  } else if (parent)\n  {\n    // Encode offset from the upper left corner of the parent\n    // in the coord system in that corner with x to the right and y down\n    x=x-parent->rect.xmin;\n    y=parent->rect.ymax-(y+height);\n    start-=parent->text_start;\n  }\n  // Encode rectangle\n  bs.write16(0x8000+x);\n  bs.write16(0x8000+y);\n  bs.write16(0x8000+width);\n  bs.write16(0x8000+height);\n  // Encode text info\n  bs.write16(0x8000+start);\n  bs.write24(text_length);\n  // Encode number of children\n  bs.write24(children.size());\n  \n  const Zone * prev_child=0;\n  // Encode all children\n  for (GPosition i=children; i; ++i)\n  {\n    children[i].encode(gbs, this, prev_child);\n    prev_child=&children[i];\n  }\n}\n#endif\n\nvoid \nDjVuTXT::Zone::decode(const GP<ByteStream> &gbs, int maxtext,\n\t\t      const Zone * parent, const Zone * prev)\n{\n  ByteStream &bs=*gbs;\n  // Decode type\n  ztype = (ZoneType) bs.read8();\n  if ( ztype<PAGE || ztype>CHARACTER )\n    G_THROW( ERR_MSG(\"DjVuText.corrupt_text\") );\n\n  // Decode coordinates\n  int x=(int) bs.read16()-0x8000;\n  int y=(int) bs.read16()-0x8000;\n  int width=(int) bs.read16()-0x8000;\n  int height=(int) bs.read16()-0x8000;\n\n  // Decode text info\n  text_start = (int) bs.read16()-0x8000;\n//  int start=text_start;\n  text_length = bs.read24();\n  if (prev)\n  {\n    if (ztype==PAGE || ztype==PARAGRAPH || ztype==LINE)\n    {\n      x=x+prev->rect.xmin;\n      y=prev->rect.ymin-(y+height);\n    } else // Either COLUMN or WORD or CHARACTER\n    {\n      x=x+prev->rect.xmax;\n      y=y+prev->rect.ymin;\n    }\n    text_start+=prev->text_start+prev->text_length;\n  } else if (parent)\n  {\n    x=x+parent->rect.xmin;\n    y=parent->rect.ymax-(y+height);\n    text_start+=parent->text_start;\n  }\n  rect=GRect(x, y, width, height);\n  // Get children size\n  int size = bs.read24();\n\n  // Checks\n  if (rect.isempty() || text_start<0 || text_start+text_length>maxtext )\n    G_THROW( ERR_MSG(\"DjVuText.corrupt_text\") );\n\n  // Process children\n  const Zone * prev_child=0;\n  children.empty();\n  while (size-- > 0) \n  {\n    Zone *z = append_child();\n    z->decode(gbs, maxtext, this, prev_child);\n    prev_child=z;\n  }\n}\n\nvoid \nDjVuTXT::normalize_text()\n{\n  GUTF8String newtextUTF8;\n  page_zone.normtext( (const char*)textUTF8, newtextUTF8 );\n  textUTF8 = newtextUTF8;\n}\n\nint \nDjVuTXT::has_valid_zones() const\n{\n  if (!textUTF8)\n    return false;\n  if (page_zone.rect.isempty()) \n    return false;\n  return true;\n}\n\n\n#ifndef NEED_DECODER_ONLY\nvoid \nDjVuTXT::encode(const GP<ByteStream> &gbs) const\n{\n  ByteStream &bs=*gbs;\n  if (! textUTF8 )\n    G_THROW( ERR_MSG(\"DjVuText.no_text\") );\n  // Encode text\n  int textsize = textUTF8.length();\n  bs.write24( textsize );\n  bs.writall( (void*)(const char*)textUTF8, textsize );\n  // Encode zones\n  if (has_valid_zones())\n  {\n    bs.write8(Zone::version);\n    page_zone.encode(gbs);\n  }\n}\n#endif\n\nvoid \nDjVuTXT::decode(const GP<ByteStream> &gbs)\n{\n  ByteStream &bs=*gbs;\n  // Read text\n  textUTF8.empty();\n  int textsize = bs.read24();\n  char *buffer = textUTF8.getbuf(textsize);\n  int readsize = bs.read(buffer,textsize);\n  buffer[readsize] = 0;\n  if (readsize < textsize)\n    G_THROW( ERR_MSG(\"DjVuText.corrupt_chunk\") );\n  // Try reading zones\n  unsigned char version;\n  if ( bs.read( (void*) &version, 1 ) == 1) \n  {\n    if (version != Zone::version)\n      G_THROW( ERR_MSG(\"DjVuText.bad_version\") \"\\t\" + GUTF8String(version) );\n    page_zone.decode(gbs, textsize);\n  }\n}\n\nGP<DjVuTXT> \nDjVuTXT::copy(void) const\n{\n  return new DjVuTXT(*this);\n}\n\n\nstatic inline bool\nintersects_zone(GRect box, const GRect &zone)\n{\n  return\n    ((box.xmin < zone.xmin)\n      ?(box.xmax >= zone.xmin)\n      :(box.xmin <= zone.xmax))\n    &&((box.ymin < zone.ymin)\n      ?(box.ymax >= zone.ymin)\n      :(box.ymin <= zone.ymax));\n}\n\nvoid\nDjVuTXT::Zone::get_text_with_rect(const GRect &box, \n                                  int &string_start, int &string_end) const\n{\n  GPosition pos=children;\n  if(pos?box.contains(rect):intersects_zone(box,rect))\n  {\n    const int text_end=text_start+text_length;\n    if(string_start == string_end)\n    {\n      string_start=text_start;\n      string_end=text_end;\n    }else\n    {\n      if (string_end < text_end)\n        string_end=text_end;\n      if(text_start < string_start)\n        string_start=text_start;\n    }\n  }else if(pos&&intersects_zone(box,rect))\n  {\n    do\n    {\n      children[pos].get_text_with_rect(box,string_start,string_end);\n    } while(++pos);\n  }\n}\n\nvoid\nDjVuTXT::Zone::find_zones(GList<Zone *> &list, \n                          const int string_start, const int string_end) const\n{\n  const int text_end=text_start+text_length;\n  if(text_start >= string_start)\n    {\n      if(text_end <= string_end)\n        {\n          list.append(const_cast<Zone *>(this));\n        }\n      else if(text_start < string_end)\n        {\n          if (children.size())\n            for (GPosition pos=children; pos; ++pos)\n              children[pos].find_zones(list,string_start,string_end);\n          else\n            list.append(const_cast<Zone *>(this));\n        }\n    }\n  else if( text_end > string_start)\n    {\n      if (children.size())\n        for (GPosition pos=children; pos; ++pos)\n          children[pos].find_zones(list,string_start,string_end);\n      else\n        list.append(const_cast<Zone *>(this));\n    }\n}\n\nvoid\nDjVuTXT::Zone::get_smallest(GList<GRect> &list) const\n{\n  GPosition pos=children;\n  if(pos)\n    {\n      do {\n        children[pos].get_smallest(list);\n      } while (++pos);\n    }\n  else\n    {\n      list.append(rect);\n    }\n}\n\nvoid\nDjVuTXT::Zone::get_smallest(GList<GRect> &list, const int padding) const\n{\n  GPosition pos=children;\n  if(pos)\n    {\n      do {\n        children[pos].get_smallest(list,padding);\n      } while (++pos);\n    }\n  else if(zone_parent && zone_parent->ztype >= PARAGRAPH)\n    {\n      const GRect &xrect=zone_parent->rect;\n      if(xrect.height() < xrect.width())\n        {\n          list.append(GRect(rect.xmin-padding,xrect.ymin-padding,rect.width()\n                            +2*padding,xrect.height()+2*padding));\n        }\n      else\n        {\n          list.append(GRect(xrect.xmin-padding,rect.ymin-padding,xrect.width()\n                            +2*padding,rect.height()+2*padding));\n        }\n    }\n  else\n    {\n      list.append(GRect(rect.xmin-padding,rect.ymin-padding,rect.width()\n                        +2*padding,rect.height()+2*padding));\n    }\n}\n\nvoid\nDjVuTXT::get_zones(int zone_type, const Zone *parent, \n                   GList<Zone *> & zone_list) const \n   // get all the zones of  type zone_type under zone node parent\n{\n   // search all branches under parent\n   const Zone *zone=parent;\n   for( int cur_ztype=zone->ztype; cur_ztype<zone_type; ++cur_ztype )\n   {\n      GPosition pos;\n      for(pos=zone->children; pos; ++pos)\n      {\n\t Zone *zcur=(Zone *)&zone->children[pos];\n\t if ( zcur->ztype == zone_type )\n\t {\n\t    GPosition zpos=zone_list;\n\t    if ( !zone_list.search(zcur,zpos) )\n\t       zone_list.append(zcur);\n\t }\n\t else if ( zone->children[pos].ztype < zone_type )\n\t    get_zones(zone_type, &zone->children[pos], zone_list);\n      }\n   }\n}\n\nGList<GRect>\nDjVuTXT::find_text_with_rect(const GRect &box, GUTF8String &text, \n                             const int padding) const\n{\n  GList<GRect> retval;\n  int text_start=0;\n  int text_end=0;\n  page_zone.get_text_with_rect(box,text_start,text_end);\n  if(text_start != text_end)\n  {\n    GList<Zone *> zones;\n    page_zone.find_zones(zones,text_start,text_end);\n    GPosition pos=zones;\n    if(pos)\n    {\n      do\n      {\n        if(padding >= 0)\n        {\n          zones[pos]->get_smallest(retval,padding);\n        }else\n        {\n          zones[pos]->get_smallest(retval);\n        }\n      } while(++pos);\n    }\n  }\n  text=textUTF8.substr(text_start,text_end-text_start);\n  return retval;\n}\n\n\nGList<DjVuTXT::Zone *>\nDjVuTXT::find_text_in_rect(GRect target_rect, GUTF8String &text) const\n   // returns a list of zones of type WORD in the nearest/selected paragraph \n{\n   GList<Zone *> zone_list;\n   GList<Zone *> lines;\n\n   get_zones((int)PARAGRAPH, &page_zone, zone_list);\n   // it's possible that no paragraph structure exists for reasons that  \n   // 1) ocr engine is not capable 2) file was modified by user. In such case, \n   // we can only make a rough guess, i.e., select all the lines intersected with\n   // target_rect\n   if (zone_list.isempty())\n   {\n      get_zones((int)LINE, &page_zone, zone_list);\n      GPosition pos;\n      for(pos=zone_list; pos; ++pos)\n      {\n\t GRect rect=zone_list[pos]->rect;\n\t int h0=rect.height()/2;\n\t if(rect.intersect(rect,target_rect) && rect.height()>h0)\n\t    lines.append(zone_list[pos]);\n      }\n   } else \n   {\n      GPosition pos, pos_sel=zone_list;\n      float ar=0;\n      for(pos=zone_list; pos; ++pos)\n      {\n\t GRect rect=zone_list[pos]->rect;\n\t int area=rect.area();\n\t if (rect.intersect(rect, target_rect))\n\t {\n\t    float ftmp=rect.area()/(float)area;\n\t    if ( !ar || ar<ftmp )\n\t    {\n\t       ar=ftmp;\n\t       pos_sel=pos;\n\t    }\n\t }\n      }\n      Zone *parag = 0;\n      if ( ar>0 ) parag=zone_list[pos_sel];\n      zone_list.empty();\n      if ( ar>0 ) \n      {\n\t get_zones((int)LINE, parag, zone_list);\n\t if ( !zone_list.isempty() )\n\t {\n\t    for(GPosition pos=zone_list; pos; ++pos)\n\t    {\n\t       GRect rect=zone_list[pos]->rect;\n\t       int h0=rect.height()/2;\n\t       if(rect.intersect(rect,target_rect) && rect.height()>h0)\n\t\t  lines.append(zone_list[pos]);\n\t    }\n\t }\n      }\n   }\n\n   zone_list.empty();\n   if (!lines.isempty()) \n   {\n      int i=1, lsize=lines.size();\n\n      GList<Zone *> words;\n      for (GPosition pos=lines; pos; ++pos, ++i)\n      {\n\t words.empty();\n\t get_zones((int)WORD, lines[pos], words);\n\n\t if ( lsize==1 )\n\t {\n\t    for(GPosition p=words;p;++p)\n\t    {\n\t       GRect rect=words[p]->rect;\n\t       if(rect.intersect(rect,target_rect))\n\t       //if (target_rect.contains(words[p]->rect))\n\t\t  zone_list.append(words[p]);\n\t    }\n\t } else\n\t {\n\t    if (i==1)\n\t    {\n\t       bool start=true;\n\t       for(GPosition p=words; p; ++p)\n\t       {\n\t\t  if ( start )\n\t\t  {\n\t\t     GRect rect=words[p]->rect;\n\t\t     if(rect.intersect(rect,target_rect))\n\t\t\t//if (target_rect.contains(words[p]->rect))\n\t\t     {\n\t\t\tstart=false;\n\t\t\tzone_list.append(words[p]);\n\t\t     }\n\t\t  } else \n\t\t     zone_list.append(words[p]);\n\t       }\n\t    } else if (i==lsize)\n\t    {\n\t       bool end=true;\n\t       for(GPosition p=words.lastpos();p;--p)\n\t       {\n\t\t  if ( end )\n\t\t  {\n\t\t     GRect rect=words[p]->rect;\n\t\t     if(rect.intersect(rect,target_rect))\n\t\t\t//if(target_rect.contains(words[p]->rect) )\n\t\t     {\n\t\t\tend=false;\n\t\t\tzone_list.append(words[p]);\n\t\t     }\n\t\t  } else \n\t\t     zone_list.append(words[p]);\n\t       }\n\t    }\n\n\t    if (i!=1 && i!=lsize )\n\t    {\n\t       for(GPosition p=words;p;++p)\n\t\t  zone_list.append(words[p]);\n\t    }\n\t }\n      }\n   } \n\n   return zone_list;\n}\n\nunsigned int \nDjVuTXT::get_memory_usage() const\n{\n  return sizeof(*this) + textUTF8.length() + page_zone.memuse() - sizeof(page_zone); \n}\n\n\n\n//***************************************************************************\n//******************************** DjVuText *********************************\n//***************************************************************************\n\nvoid\nDjVuText::decode(const GP<ByteStream> &gbs)\n{\n  GUTF8String chkid;\n  GP<IFFByteStream> giff=IFFByteStream::create(gbs);\n  IFFByteStream &iff=*giff;\n  while( iff.get_chunk(chkid) )\n  {\n    if (chkid == \"TXTa\")\n    {\n      if (txt)\n        G_THROW( ERR_MSG(\"DjVuText.dupl_text\") );\n      txt = DjVuTXT::create();\n      txt->decode(iff.get_bytestream());\n    }\n    else if (chkid == \"TXTz\")\n    {\n      if (txt)\n        G_THROW( ERR_MSG(\"DjVuText.dupl_text\") );\n      txt = DjVuTXT::create();\n      const GP<ByteStream> gbsiff=BSByteStream::create(iff.get_bytestream());\n      txt->decode(gbsiff);\n    }\n    // Add decoding of other chunks here\n    iff.close_chunk();\n  }\n}\n\nvoid\nDjVuText::encode(const GP<ByteStream> &gbs)\n{\n  if (txt)\n  {\n    const GP<IFFByteStream> giff=IFFByteStream::create(gbs);\n    IFFByteStream &iff=*giff;\n    iff.put_chunk(\"TXTz\");\n    {\n      GP<ByteStream> gbsiff=BSByteStream::create(iff.get_bytestream(),50);\n      txt->encode(gbsiff);\n    }\n    iff.close_chunk();\n  }\n  // Add encoding of other chunks here\n}\n\n\nGP<DjVuText>\nDjVuText::copy(void) const\n{\n   GP<DjVuText> text= new DjVuText;\n      // Copy any primitives (if any)\n   *text=*this;\n      // Copy each substructure\n   if (txt)\n     text->txt = txt->copy();\n   return text;\n}\n\nstatic GUTF8String\nindent ( int spaces)\n{\n  GUTF8String ret;\n  for( int i = 0 ; i < spaces ; i++ )\n    ret += ' ';\n  return ret;\n}\n\nstatic const char *tags[8]=\n{ 0,\n  \"HIDDENTEXT\",\n  \"PAGECOLUMN\",\n  \"REGION\",\n  \"PARAGRAPH\",\n  \"LINE\",\n  \"WORD\",\n  \"CHARACTER\" };\nstatic const int tags_size=sizeof(tags)/sizeof(const char *);\n\nstatic GUTF8String\nstart_tag(const DjVuTXT::ZoneType zone)\n{\n  GUTF8String retval;\n  if((tags_size > (int)zone)&&((int)zone > 0))\n  {\n    switch (zone)\n    {\n      case DjVuTXT::CHARACTER:\n        retval=\"<\"+GUTF8String(tags[zone])+\">\";\n        break;\n      case DjVuTXT::WORD:\n        retval=indent(2*(int)zone+2)+\"<\"+tags[zone]+\">\";\n        break;\n      default:\n        retval=indent(2*(int)zone+2)+\"<\"+tags[zone]+\">\\n\";\n        break;\n    }\n  }\n  return retval;\n}\n\nstatic GUTF8String\nstart_tag(const DjVuTXT::ZoneType zone, const GUTF8String &attributes)\n{\n  GUTF8String retval;\n  if((tags_size > (int)zone)&&((int)zone > 0))\n  {\n    switch (zone)\n    {\n      case DjVuTXT::CHARACTER:\n        retval=\"<\"+GUTF8String(tags[zone])+\" \"+attributes+\">\";\n        break;\n      case DjVuTXT::WORD:\n        retval=indent(2*(int)zone+2)+\"<\"+tags[zone]+\" \"+attributes+\">\";\n        break;\n      default:\n        retval=indent(2*(int)zone+2)+\"<\"+tags[zone]+\" \"+attributes+\">\\n\";\n        break;\n    }\n  }\n  return retval;\n}\n\nstatic inline GUTF8String\nstart_tag(const int layer)\n{\n  return start_tag((const DjVuTXT::ZoneType)layer);\n}\n\n\nstatic GUTF8String\nend_tag(const DjVuTXT::ZoneType zone)\n{\n  GUTF8String retval;\n  if((tags_size > (int)zone)&&((int)zone >= 0))\n  {\n    switch (zone)\n    {\n      case DjVuTXT::CHARACTER:\n        retval=\"</\"+GUTF8String(tags[zone])+\">\";\n        break;\n      case DjVuTXT::WORD:\n        retval=\"</\"+GUTF8String(tags[zone])+\">\\n\";\n        break;\n      default:\n        retval=indent(2*(int)zone+2)+\"</\"+tags[zone]+\">\\n\";\n        break;\n    }\n  }\n  return retval;\n}\n\nstatic inline GUTF8String\nend_tag(const int layer)\n{\n  return end_tag((const DjVuTXT::ZoneType)layer);\n}\n\nstatic GUTF8String\ntolayer(int &layer, const DjVuTXT::ZoneType next_layer)\n{\n  GUTF8String retval;\n  for( ;layer < (int)next_layer;layer++ )\n  {\n    retval+=start_tag(layer);\n  }\n  while (layer > (int)next_layer )\n  {\n    retval+=end_tag(--layer);\n  }\n  return retval;\n}\n\nstatic void\nwriteText( ByteStream & str_out,\n            const GUTF8String &textUTF8,\n            const DjVuTXT::Zone &zone,\n            const int WindowHeight );\n\nstatic void\nwriteText( ByteStream & str_out,\n           const GUTF8String &textUTF8,\n           const DjVuTXT::ZoneType zlayer,\n           const GList<DjVuTXT::Zone> &children,\n           const int WindowHeight )\n{\n//  assert( txt->has_valid_zones() );\n//  DEBUG_MSG( \"--zonetype=\" << txt->page_zone.ztype << \"\\n\" );\n\n  //  Beginning tags for missing layers\n  int layer=(int)zlayer;\n  //  Output the next layer\n  for(GPosition pos=children ; pos ; ++pos )\n  {\n    str_out.writestring(tolayer(layer,children[pos].ztype));\n    writeText( str_out,\n                textUTF8,\n                children[pos],\n                WindowHeight );\n  }\n  str_out.writestring(tolayer(layer,zlayer));\n}\n\nstatic void\nwriteText( ByteStream & str_out,\n            const GUTF8String &textUTF8,\n            const DjVuTXT::Zone &zone,\n            const int WindowHeight )\n{\n//  DEBUG_MSG( \"--zonetype=\" << zone.ztype << \"\\n\" );\n\n  const GUTF8String xindent(indent( 2 * zone.ztype + 2 ));\n  GPosition pos=zone.children;\n  // Build attribute string\n  if( ! pos )\n  {\n    GUTF8String coords;\n    coords.format(\"coords=\\\"%d,%d,%d,%d\\\"\",\n      zone.rect.xmin, WindowHeight - 1 - zone.rect.ymin,\n      zone.rect.xmax, WindowHeight - 1 - zone.rect.ymax);\n    const int start=zone.text_start;\n    const int end=textUTF8.firstEndSpace(start,zone.text_length);\n    str_out.writestring(start_tag(zone.ztype,coords));\n    str_out.writestring(textUTF8.substr(start,end-start).toEscaped());\n    str_out.writestring(end_tag(zone.ztype));\n  } else\n  {\n    writeText(str_out,textUTF8,zone.ztype,zone.children,WindowHeight);\n  }\n}\n\nvoid\nDjVuTXT::writeText(ByteStream &str_out,const int height) const\n{\n  if(has_valid_zones())\n  {\n    ::writeText(str_out,textUTF8,DjVuTXT::PAGE,page_zone.children,height);\n  }else\n  {\n    str_out.writestring(start_tag(DjVuTXT::PAGE));\n    str_out.writestring(end_tag(DjVuTXT::PAGE));\n  }\n}\n\nvoid\nDjVuText::writeText(ByteStream &str_out,const int height) const\n{\n  if(txt)\n  {\n    txt->writeText(str_out,height);\n  }else\n  {\n    str_out.writestring(\"<\"+GUTF8String(tags[DjVuTXT::PAGE])+\"/>\\n\");\n  }\n   \n}\nGUTF8String\nDjVuTXT::get_xmlText(const int height) const\n{\n  GP<ByteStream> gbs(ByteStream::create());\n  ByteStream &bs=*gbs;\n  writeText(bs,height);\n  bs.seek(0L);\n  return bs.getAsUTF8();\n}\n\nGUTF8String\nDjVuText::get_xmlText(const int height) const\n{\n  GUTF8String retval;\n  if(txt)\n  {\n    retval=txt->get_xmlText(height);\n  }else\n  {\n    retval=\"<\"+GUTF8String(tags[DjVuTXT::PAGE])+\"/>\\n\";\n  }\n  return retval;\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/DjVuText.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _DJVUTEXT_H\n#define _DJVUTEXT_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n\n/** @name DjVuText.h\n\n    Files #\"DjVuText.h\"# and #\"DjVuText.cpp\"# implement the mechanism for\n    text in DjVuImages.\n\n    This file implements annotations understood by the DjVu plugins \n    and encoders.\n\n\n    using: contents of #TXT*# chunks.\n\n    Contents of the #FORM:TEXT# should be passed to \\Ref{DjVuText::decode}()\n    for parsing, which initializes \\Ref{DjVuText::TXT} \n    and fills them with decoded data. \n    @memo Implements support for DjVuImage hidden text.\n    @author Andrei Erofeev <eaf@geocities.com>\n*/\n//@{\n\n\n#include \"GMapAreas.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\nclass ByteStream;\n\n// -------- DJVUTXT --------\n\n/** Description of the text contained in a DjVu page.  This class contains the\n    textual data for the page.  It describes the text as a hierarchy of zones\n    corresponding to page, column, region, paragraph, lines, words, etc...\n    The piece of text associated with each zone is represented by an offset\n    and a length describing a segment of a global UTF8 encoded string.  */\n\nclass DJVUAPI DjVuTXT : public GPEnabled\n{\nprotected:\n  DjVuTXT(void) {}\npublic:\n  /// Default creator\n  static GP<DjVuTXT> create(void) {return new DjVuTXT();}\n\n  /** These constants are used to tell what a zone describes.\n      This can be useful for a copy/paste application. \n      The deeper we go into the hierarchy, the higher the constant. */\n  enum ZoneType { PAGE=1, COLUMN=2, REGION=3, PARAGRAPH=4, \n                  LINE=5, WORD=6, CHARACTER=7 };\n  /** Data structure representing document textual components.\n      The text structure is represented by a hierarchy of rectangular zones. */\n  class DJVUAPI Zone \n  {\n  public:\n    Zone();\n    /** Type of the zone. */\n    enum ZoneType ztype;\n    /** Rectangle spanned by the zone */\n    GRect rect;\n    /** Position of the zone text in string #textUTF8#. */\n    int text_start;\n    /** Length of the zone text in string #textUTF8#. */\n    int text_length;\n    /** List of children zone. */\n    GList<Zone> children;\n    /** Appends another subzone inside this zone.  The new zone is initialized\n        with an empty rectangle, empty text, and has the same type as this\n        zone. */\n    Zone *append_child();\n    /** Find the text_start and text_end indicated by the given box. */\n    void get_text_with_rect(const GRect &box, \n                            int &string_start,int &string_end ) const;\n    /** Find the zones used by the specified string and append them to the list. */\n    void find_zones(GList<Zone *> &list, \n                    const int string_start, const int string_end) const;\n    /** Finds the smallest rectangles and appends them to the list. */\n    void get_smallest(GList<GRect> &list) const;\n    /** Finds the smallest rectangles and appends them to the list after \n        padding the smallest unit to fit width or height for the parent rectangle\n        and adding the number of specified pixels. */\n    void get_smallest(GList<GRect> &list,const int padding) const;\n    /// Find out this Zone's parent.\n    const Zone *get_parent(void) const;\n  private:\n    friend class DjVuTXT;\n    const Zone *zone_parent;\n    void cleartext();\n    void normtext(const char *instr, GUTF8String &outstr);\n    unsigned int memuse() const;\n    static const int version;\n    void encode(const GP<ByteStream> &bs, \n                const Zone * parent=0, const Zone * prev=0) const;\n    void decode(const GP<ByteStream> &bs, int maxtext,\n                const Zone * parent=0, const Zone * prev=0);\n  };\n  /** Textual data for this page.  \n      The content of this string is encoded using the UTF8 code.\n      This code corresponds to ASCII for the first 127 characters.\n      Columns, regions, paragraph and lines are delimited by the following\n      control character:\n      \\begin{tabular}{lll}\n        {\\bf Name} & {\\bf Octal} & {\\bf Ascii name} \\\\\\hline\\\\\n        {\\tt DjVuText::end_of_column}    & 013 & VT, Vertical Tab \\\\\n        {\\tt DjVuText::end_of_region}    & 035 & GS, Group Separator \\\\\n        {\\tt DjVuText::end_of_paragraph} & 037 & US, Unit Separator \\\\\n        {\\tt DjVuText::end_of_line}      & 012 & LF: Line Feed\n      \\end{tabular} */\n  GUTF8String textUTF8;\n  static const char end_of_column    ;      // VT: Vertical Tab\n  static const char end_of_region    ;      // GS: Group Separator\n  static const char end_of_paragraph ;      // US: Unit Separator\n  static const char end_of_line      ;      // LF: Line Feed\n  /** Main zone in the document.\n      This zone represent the page. */\n  Zone page_zone;\n  /** Tests whether there is a meaningful zone hierarchy. */\n  int has_valid_zones() const;\n  /** Normalize textual data.  Assuming that a zone hierarchy has been built\n      and represents the reading order.  This function reorganizes the string\n      #textUTF8# by gathering the highest level text available in the zone\n      hierarchy.  The text offsets and lengths are recomputed for all the\n      zones in the hierarchy. Separators are inserted where appropriate. */\n  void normalize_text();\n  /** Encode data for a TXT chunk. */\n  void encode(const GP<ByteStream> &bs) const;\n  /** Decode data from a TXT chunk. */\n  void decode(const GP<ByteStream> &bs);\n  /** Returns a copy of this object. */\n  GP<DjVuTXT> copy(void) const;\n  /// Write XML formated text.\n  void writeText(ByteStream &bs,const int height) const;\n  /// Get XML formatted text.\n  GUTF8String get_xmlText(const int height) const;\n  /** Find the text specified by the rectangle. */  \n  GList<Zone*> find_text_in_rect(GRect target_rect, GUTF8String &text) const;\n  /** Find the text specified by the rectangle. */\n  GList<GRect> find_text_with_rect(const GRect &box, GUTF8String &text, const int padding=0) const;\n  /** Get all zones of zone type zone_type under node parent. \n      zone_list contains the return value. */\n  void get_zones(int zone_type, const Zone *parent, GList<Zone *> & zone_list) const;\n  /** Returns the number of bytes needed by this data structure. It's\n      used by caching routines to estimate the size of a \\Ref{DjVuImage}. */\n  unsigned int get_memory_usage() const;\n};\n\ninline const DjVuTXT::Zone *\nDjVuTXT::Zone::get_parent(void) const\n{\n  return zone_parent;\n}\n\n\nclass DJVUAPI DjVuText : public GPEnabled\n{\nprotected:\n   DjVuText(void) {}\npublic:\n   /// Default creator.\n   static GP<DjVuText> create(void) {return new DjVuText();}\n\n      /** Decodes a sequence of annotation chunks and merges contents of every\n\t  chunk with previously decoded information. This function\n\t  should be called right after applying \\Ref{IFFByteStream::get_chunk}()\n\t  to data from #FORM:TEXT#. */\n   void decode(const GP<ByteStream> &bs);\n\n      /** Encodes all annotations back into a sequence of chunks to be put\n\t  inside a #FORM:TEXT#. */\n   void\tencode(const GP<ByteStream> &bs);\n\n      /// Returns a copy of this object\n   GP<DjVuText>\tcopy(void) const;\n\n      /** Returns the number of bytes needed by this data structure. It's\n\t  used by caching routines to estimate the size of a \\Ref{DjVuImage}. */\n   inline unsigned int get_memory_usage() const;\n\n   /// Write XML formated text.\n   void writeText(ByteStream &bs,const int height) const;\n\n   /// Get XML formatted text.\n   GUTF8String get_xmlText(const int height) const;\n\n   GP<DjVuTXT>  txt;\nprivate: // dummy stuff\n   static void decode(ByteStream *);\n   static void\tencode(ByteStream *);\n};\n\n//@}\n\ninline unsigned int\nDjVuText::get_memory_usage() const\n{\n  return (txt)?(txt->get_memory_usage()):0;\n}\n\n\n// ----- THE END\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n\n\n"
  },
  {
    "path": "ext/libdjvu/DjVuToPS.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"DjVuToPS.h\"\n#include \"IFFByteStream.h\"\n#include \"BSByteStream.h\"\n#include \"DjVuImage.h\"\n#include \"DjVuText.h\"\n#include \"DataPool.h\"\n#include \"IW44Image.h\"\n#include \"JB2Image.h\"\n#include \"GBitmap.h\"\n#include \"GPixmap.h\"\n#include \"debug.h\"\n#include <stdarg.h>\n#include <stddef.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <time.h>\n#include <math.h>\n#ifdef UNIX\n#include <pwd.h>\n#include <grp.h>\n#include <unistd.h>\n#endif\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\nstatic const size_t ps_string_size=15000;\n\n// ***************************************************************************\n// ****************************** Options ************************************\n// ***************************************************************************\n\nDjVuToPS::Options::\nOptions(void)\n: format(PS), \n  level(2), \n  orientation(AUTO), \n  mode(COLOR), \n  zoom(0),\n  color(true), \n  calibrate(true), \n  text(false),\n  gamma((double)2.2), \n  copies(1), \n  frame(false),\n  cropmarks(false),\n  bookletmode(OFF),\n  bookletmax(0),\n  bookletalign(0),\n  bookletfold(18),\n  bookletxfold(200)\n{}\n\nvoid\nDjVuToPS::Options::\nset_format(Format xformat)\n{\n  if (xformat != EPS && xformat != PS)\n    G_THROW(ERR_MSG(\"DjVuToPS.bad_format\"));\n  format=xformat;\n}\n\nvoid\nDjVuToPS::Options::\nset_level(int xlevel)\n{\n  if (xlevel<1 || xlevel>3)\n    G_THROW(ERR_MSG(\"DjVuToPS.bad_level\")\n           + GUTF8String(\"\\t\") + GUTF8String(xlevel));\n  level=xlevel;\n}\n\nvoid\nDjVuToPS::Options::\nset_orientation(Orientation xorientation)\n{\n  if (xorientation!=PORTRAIT && \n      xorientation!=LANDSCAPE &&\n      xorientation!=AUTO )\n    G_THROW(ERR_MSG(\"DjVuToPS.bad_orient\"));\n  orientation=xorientation;\n}\n\nvoid\nDjVuToPS::Options::\nset_mode(Mode xmode)\n{\n  if (xmode!=COLOR && xmode!=FORE && xmode!=BACK && xmode!=BW)\n    G_THROW(ERR_MSG(\"DjVuToPS.bad_mode\"));\n  mode=xmode;\n}\n\nvoid\nDjVuToPS::Options::\nset_zoom(int xzoom)\n{\n  if (xzoom!=0 && !(xzoom>=5 && xzoom<=999))\n    G_THROW(ERR_MSG(\"DjVuToPS.bad_zoom\"));\n  zoom=xzoom;\n}\n\nvoid\nDjVuToPS::Options::\nset_color(bool xcolor)\n{\n  color=xcolor;\n}\n\nvoid \nDjVuToPS::Options::\nset_sRGB(bool xcalibrate)\n{\n  calibrate=xcalibrate;\n}\n\nvoid\nDjVuToPS::Options::\nset_gamma(double xgamma)\n{\n  if  (xgamma<(double)(0.3-0.0001) || xgamma>(double)(5.0+0.0001))\n    G_THROW(ERR_MSG(\"DjVuToPS.bad_gamma\"));\n  gamma=xgamma;\n}\n\nvoid\nDjVuToPS::Options::\nset_copies(int xcopies)\n{\n  if (xcopies<=0)\n    G_THROW(ERR_MSG(\"DjVuToPS.bad_number\"));\n  copies=xcopies;\n}\n\nvoid\nDjVuToPS::Options::\nset_frame(bool xframe)\n{\n  frame=xframe;\n}\n\nvoid\nDjVuToPS::Options::\nset_cropmarks(bool xmarks)\n{\n  cropmarks=xmarks;\n}\n\nvoid\nDjVuToPS::Options::\nset_text(bool xtext)\n{\n  text=xtext;\n}\n\nvoid \nDjVuToPS::Options::\nset_bookletmode(BookletMode m)\n{\n  bookletmode = m;\n}\n\nvoid \nDjVuToPS::Options::\nset_bookletmax(int m)\n{\n  bookletmax = 0;\n  if (m > 0)\n    bookletmax = (m+3)/4;\n  bookletmax *= 4;\n}\n\nvoid \nDjVuToPS::Options::\nset_bookletalign(int m)\n{\n  bookletalign = m;\n}\n\nvoid \nDjVuToPS::Options::\nset_bookletfold(int fold, int xfold)\n{\n  if (fold >= 0)\n    bookletfold = fold;\n  if (xfold >= 0)\n    bookletxfold = xfold;\n}\n\n\n// ***************************************************************************\n// ******************************* DjVuToPS **********************************\n// ***************************************************************************\n\nstatic char bin2hex[256][2];\n\nDjVuToPS::DjVuToPS(void)\n{\n  DEBUG_MSG(\"DjVuToPS::DjVuToPS(): initializing...\\n\");\n  DEBUG_MAKE_INDENT(3);\n  DEBUG_MSG(\"Initializing dig2hex[]\\n\");\n  // Creating tables for bin=>text translation\n  static const char * dig2hex=\"0123456789ABCDEF\";\n  int i;\n  for(i=0;i<256;i++)\n    {\n      bin2hex[i][0]=dig2hex[i/16];\n      bin2hex[i][1]=dig2hex[i%16];\n    }\n  refresh_cb=0;\n  refresh_cl_data=0;\n  prn_progress_cb=0;\n  prn_progress_cl_data=0;\n  dec_progress_cb=0;\n  dec_progress_cl_data=0;\n  info_cb=0;\n  info_cl_data=0;\n}\n\n#ifdef __GNUC__\nstatic void\nwrite(ByteStream &str, const char *format, ...)\n__attribute__((format (printf, 2, 3)));\n#endif\n\nstatic void\nwrite(ByteStream &str, const char *format, ...)\n{\n  /* Will output the formated string to the specified \\Ref{ByteStream}\n     like #fprintf# would do it for a #FILE#. */\n  va_list args;\n  va_start(args, format);\n  GUTF8String tmp;\n  tmp.vformat(format, args);\n  str.writall((const char *) tmp, tmp.length());\n}\n\n// ************************* DOCUMENT LEVEL *********************************\n\nvoid\nDjVuToPS::\nstore_doc_prolog(ByteStream &str, int pages, int dpi, GRect *grect)\n{\n  /* Will store the {\\em document prolog}, which is basically a\n     block of document-level comments in PS DSC 3.0 format.\n     @param str Stream where PostScript data should be written\n     @param pages Total number of pages\n     @param dpi (EPS mode only) \n     @param grect (EPS mode only) */\n  DEBUG_MSG(\"storing the document prolog\\n\");\n  DEBUG_MAKE_INDENT(3);\n  if (options.get_format()==Options::EPS)\n    write(str,\n          \"%%!PS-Adobe-3.0 EPSF 3.0\\n\"\n          \"%%%%BoundingBox: 0 0 %d %d\\n\",\n          (grect->width()*100+dpi-1)/dpi, \n          (grect->height()*100+dpi-1)/dpi );\n  else\n    write(str, \"%%!PS-Adobe-3.0\\n\");\n  write(str,\n        \"%%%%Title: DjVu PostScript document\\n\"\n        \"%%%%Copyright: Copyright (c) 1998-1999 AT&T\\n\"\n        \"%%%%Creator: DjVu (code by Andrei Erofeev)\\n\"\n        \"%%%%DocumentData: Clean7Bit\\n\");\n  // Date\n  time_t tm=time(0);\n  write(str, \"%%%%CreationDate: %s\", ctime(&tm));\n  // For\n#ifdef UNIX\n  passwd *pswd = getpwuid(getuid());\n  if (pswd)\n    {\n      char *s = strchr(pswd->pw_gecos, ',');\n      if (s) \n        *s = 0;\n      s = 0;\n      if (pswd->pw_gecos && strlen(pswd->pw_gecos))\n        s = pswd->pw_gecos;\n      else if (pswd->pw_name && strlen(pswd->pw_name))\n        s = pswd->pw_name;\n      if (s)\n        write(str, \"%%%%For: %s\\n\", s);\n    }\n#endif\n  // Language\n  write(str, \"%%%%LanguageLevel: %d\\n\", options.get_level());\n  if (options.get_level()<2 && options.get_color())\n    write(str, \"%%%%Extensions: CMYK\\n\");\n  // Pages\n  write(str, \"%%%%Pages: %d\\n\",pages );\n  write(str, \"%%%%PageOrder: Ascend\\n\");\n  // Orientation\n  if (options.get_orientation() != Options::AUTO)\n    write(str, \"%%%%Orientation: %s\\n\", \n          options.get_orientation()==Options::PORTRAIT ?\n          \"Portrait\" : \"Landscape\" );\n  // Requirements\n  if (options.get_format() == Options::PS)\n    {\n      write(str, \"%%%%Requirements:\");\n      if (options.get_color())\n        write(str, \" color\");\n      if (options.get_copies()>1)\n        write(str, \" numcopies(%d)\", options.get_copies());\n      if (options.get_level()>=2)\n        {\n          if (options.get_copies()>1)\n            write(str, \" collate\");\n          if (options.get_bookletmode() == Options::RECTOVERSO)\n            write(str, \" duplex(tumble)\");\n        }\n      write(str, \"\\n\");\n    }\n  // End\n  write(str,\n        \"%%%%EndComments\\n\"\n        \"%%%%EndProlog\\n\"\n        \"\\n\");\n}\n\nvoid\nDjVuToPS::\nstore_doc_setup(ByteStream &str)\n{\n  /* Will store the {\\em document setup}, which is a set of\n     PostScript commands and functions used to inspect and prepare\n     the PostScript interpreter environment before displaying images. */\n  write(str, \n        \"%%%%BeginSetup\\n\"\n        \"/doc-origstate save def\\n\");\n  if (options.get_level()>=2)\n    {\n      if (options.get_format() == Options::PS)\n        {\n          if (options.get_copies()>1)\n            write(str, \n                  \"[{\\n\"\n                  \"%%%%BeginFeature: NumCopies %d\\n\"\n                  \"<< /NumCopies %d >> setpagedevice\\n\"\n                  \"%%%%EndFeature\\n\"\n                  \"} stopped cleartomark\\n\"\n                  \"[{\\n\"\n                  \"%%%%BeginFeature: Collate\\n\"\n                  \"<< /Collate true >> setpagedevice\\n\"\n                  \"%%%%EndFeature\\n\"\n                  \"} stopped cleartomark\\n\",\n                  options.get_copies(),\n                  options.get_copies() );\n          if (options.get_bookletmode()==Options::RECTOVERSO)\n            write(str, \n                  \"[{\\n\"\n                  \"%%%%BeginFeature: Duplex DuplexTumble\\n\"\n                  \"<< /Duplex true /Tumble true >> setpagedevice\\n\"\n                  \"%%%%EndFeature\\n\"\n                  \"} stopped cleartomark\\n\");\n        }\n      if (options.get_color())\n        write(str, \n              \"%% -- procs for reading color image\\n\"\n              \"/readR () def\\n\"\n              \"/readG () def\\n\"\n              \"/readB () def\\n\"\n              \"/ReadData {\\n\"\n              \"   currentfile /ASCII85Decode filter dup\\n\"\n              \"   /RunLengthDecode filter\\n\"\n              \"   bufferR readstring pop /readR exch def\\n\"\n              \"   dup status { flushfile } { pop } ifelse\\n\"\n              \"   currentfile /ASCII85Decode filter dup\\n\"\n              \"   /RunLengthDecode filter\\n\"\n              \"   bufferG readstring pop /readG exch def\\n\"\n              \"   dup status { flushfile } { pop } ifelse\\n\"\n              \"   currentfile /ASCII85Decode filter dup\\n\"\n              \"   /RunLengthDecode filter\\n\"\n              \"   bufferB readstring pop /readB exch def\\n\"\n              \"   dup status { flushfile } { pop } ifelse\\n\"\n              \"} bind def\\n\"\n              \"/ReadR {\\n\"\n              \"   readR length 0 eq { ReadData } if\\n\"\n              \"   readR /readR () def\\n\"\n              \"} bind def\\n\"\n              \"/ReadG {\\n\"\n              \"   readG length 0 eq { ReadData } if\\n\"\n              \"   readG /readG () def\\n\"\n              \"} bind def\\n\"\n              \"/ReadB {\\n\"\n              \"   readB length 0 eq { ReadData } if\\n\"\n              \"   readB /readB () def\\n\"\n              \"} bind def\\n\");\n      write(str,\n            \"%% -- procs for foreground layer\\n\"\n            \"/g {gsave 0 0 0 0 5 index 5 index setcachedevice\\n\"\n            \"    true [1 0 0 1 0 0] 5 4 roll imagemask grestore\\n\"\n            \"} bind def\\n\"\n            \"/gn {gsave 0 0 0 0 6 index 6 index setcachedevice\\n\"\n            \"  true [1 0 0 1 0 0] 3 2 roll 5 1 roll \\n\"\n            \"  { 1 sub 0 index 2 add 1 index  1 add roll\\n\"\n            \"  } imagemask grestore pop \\n\"\n            \"} bind def\\n\"\n            \"/c {setcolor rmoveto glyphshow} bind def\\n\"\n            \"/s {rmoveto glyphshow} bind def\\n\"\n            \"/S {rmoveto gsave show grestore} bind def\\n\" \n            \"/F {(Helvetica) findfont exch scalefont setfont} bind def\\n\"\n            \"%% -- emulations\\n\"\n            \"systemdict /rectstroke known not {\\n\"\n            \"  /rectstroke  %% stack : x y width height \\n\"\n            \"  { newpath 4 2 roll moveto 1 index 0 rlineto\\n\"\n            \"    0 exch rlineto neg 0 rlineto closepath stroke\\n\"\n            \"  } bind def } if\\n\"\n            \"systemdict /rectclip known not {\\n\"\n            \"  /rectclip  %% stack : x y width height \\n\"\n            \"  { newpath 4 2 roll moveto 1 index 0 rlineto\\n\"\n            \"    0 exch rlineto neg 0 rlineto closepath clip\\n\"\n            \"  } bind def } if\\n\"\n            \"%% -- color space\\n\" );\n      if (options.get_sRGB())\n        write(str,\n              \"/DjVuColorSpace [ %s\\n\"\n              \"<< /DecodeLMN [ { dup 0.03928 le {\\n\"\n              \"       12.92321 div\\n\"\n              \"     } {\\n\"\n              \"       0.055 add 1.055 div 2.4 exp\\n\"\n              \"     } ifelse } bind dup dup ]\\n\"\n              \"   /MatrixLMN [\\n\"\n              \"      0.412457 0.212673 0.019334\\n\"\n              \"      0.357576 0.715152 0.119192\\n\"\n              \"      0.180437 0.072175 0.950301 ]\\n\"\n              \"   /WhitePoint [ 0.9505 1 1.0890 ] %% D65 \\n\"\n              \"   /BlackPoint[0 0 0] >> ] def\\n\",\n              (options.get_color()) ? \"/CIEBasedABC\" : \"/CIEBasedA\" );\n      else if (options.get_color())\n        write(str,\"/DjVuColorSpace /DeviceRGB def\\n\");\n      else\n        write(str,\"/DjVuColorSpace /DeviceGray def\\n\");\n    } \n  else \n    {\n      // level<2\n      if (options.get_format() == Options::PS)\n        if (options.get_copies() > 1)\n          write(str,\"/#copies %d def\\n\", options.get_copies());\n      if (options.get_color())\n        write(str, \n              \"%% -- buffers for reading image\\n\"\n              \"/buffer8 () def\\n\"\n              \"/buffer24 () def\\n\"\n              \"%% -- colorimage emulation\\n\"\n              \"systemdict /colorimage known {\\n\"\n              \"   /ColorProc {\\n\"\n              \"      currentfile buffer24 readhexstring pop\\n\"\n              \"   } bind def\\n\"\n              \"   /ColorImage {\\n\"\n              \"      colorimage\\n\"\n              \"   } bind def\\n\"\n              \"} {\\n\"\n              \"   /ColorProc {\\n\"\n              \"      currentfile buffer24 readhexstring pop\\n\"\n              \"      /data exch def /datalen data length def\\n\"\n              \"      /cnt 0 def\\n\"\n              \"      0 1 datalen 3 idiv 1 sub {\\n\"\n              \"         buffer8 exch\\n\"\n              \"                data cnt get 20 mul /cnt cnt 1 add def\\n\"\n              \"                data cnt get 32 mul /cnt cnt 1 add def\\n\"\n              \"                data cnt get 12 mul /cnt cnt 1 add def\\n\"\n              \"                add add 64 idiv put\\n\"\n              \"      } for\\n\"\n              \"      buffer8 0 datalen 3 idiv getinterval\\n\"\n              \"   } bind def\\n\"\n              \"   /ColorImage {\\n\"\n              \"      pop pop image\\n\"\n              \"   } bind def\\n\"\n              \"} ifelse\\n\");\n    } // level<2\n  write(str, \"%%%%EndSetup\\n\\n\");\n}\n\nvoid\nDjVuToPS::\nstore_doc_trailer(ByteStream &str)\n{\n  /* Will store the {\\em document trailer}, which is a clean-up code\n     used to return the PostScript interpeter back to the state, in which\n     it was before displaying this document. */\n  write(str, \n        \"%%%%Trailer\\n\"\n        \"doc-origstate restore\\n\"\n        \"%%%%EOF\\n\");\n}\n\n// ***********************************************************************\n// ***************************** PAGE LEVEL ******************************\n// ***********************************************************************\n\nstatic unsigned char *\nASCII85_encode(unsigned char * dst, \n               const unsigned char * src_start,\n               const unsigned char * src_end)\n{\n  /* Will read data between #src_start# and #src_end# pointers (excluding byte\n     pointed by #src_end#), encode it using {\\bf ASCII85} algorithm, and\n     output the result into the destination buffer pointed by #dst#.  The\n     function returns pointer to the first unused byte in the destination\n     buffer. */\n  int symbols=0;\n  const unsigned char * ptr;\n  for(ptr=src_start;ptr<src_end;ptr+=4)\n    {\n      unsigned int num=0;\n      if (ptr+3<src_end)\n        {\n          num |= ptr[0] << 24; \n          num |= ptr[1] << 16; \n          num |= ptr[2] << 8; \n          num |= ptr[3];\n        }\n      else\n        {\n          num |= ptr[0] << 24; \n          if (ptr+1<src_end) \n            num |= ptr[1] << 16; \n          if (ptr+2<src_end) \n            num |= ptr[2] << 8; \n        }\n      int a1, a2, a3, a4, a5;\n      a5=num % 85; num/=85;\n      a4=num % 85; num/=85;\n      a3=num % 85; num/=85;\n      a2=num % 85;\n      a1=num / 85;\n      *dst++ = a1+33;\n      *dst++ = a2+33;\n      if (ptr+1<src_end)\n        *dst++ = a3+33;\n      if (ptr+2<src_end)\n        *dst++ = a4+33;\n      if (ptr+3<src_end)\n        *dst++ = a5+33;\n      symbols += 5;\n      if (symbols > 70 && ptr+4<src_end)\n        { \n          *dst++='\\n'; \n          symbols=0; \n        }\n    }\n  return dst;\n}\n\nstatic unsigned char *\nRLE_encode(unsigned char * dst,\n           const unsigned char * src_start,\n           const unsigned char * src_end)\n{\n  /* Will read data between #src_start# and #src_end# pointers (excluding byte\n     pointed by #src_end#), RLE encode it, and output the result into the\n     destination buffer pointed by #dst#.  #counter# is used to count the\n     number of output bytes.  The function returns pointer to the first unused\n     byte in the destination buffer. */\n  const unsigned char * ptr;\n  for(ptr=src_start;ptr<src_end;ptr++)\n    {\n      if (ptr==src_end-1)\n        {\n          *dst++=0; *dst++=*ptr;\n        } \n      else if (ptr[0]!=ptr[1])\n        {\n          // Guess how many non repeating bytes we have\n          const unsigned char * ptr1;\n          for(ptr1=ptr+1;ptr1<src_end-1;ptr1++)\n            if (ptr1[0]==ptr1[1] || ptr1-ptr>=128) break;\n          int pixels=ptr1-ptr;\n          *dst++=pixels-1;\n          for(int cnt=0;cnt<pixels;cnt++)\n            *dst++=*ptr++;\n          ptr--;\n        } \n      else\n        {\n          // Get the number of repeating bytes\n          const unsigned char * ptr1;\n          for(ptr1=ptr+1;ptr1<src_end-1;ptr1++)\n            if (ptr1[0]!=ptr1[1] || ptr1-ptr+1>=128) break;\n          int pixels=ptr1-ptr+1;\n          *dst++=257-pixels;\n          *dst++=*ptr;\n          ptr=ptr1;\n        }\n    }\n  return dst;\n}\n\n#define GRAY(r,g,b) (((r)*20+(g)*32+(b)*12)/64)\n\nvoid\nDjVuToPS::\nstore_page_setup(ByteStream &str, \n                 int dpi, \n                 const GRect &grect, \n                 int align )\n{\n  /* Will store PostScript code necessary to prepare page for\n     the coming \\Ref{DjVuImage}. This is basically a scaling\n     code plus initialization of some buffers. */\n  if (options.get_format() == Options::EPS)\n    write(str, \n          \"/page-origstate save def\\n\"\n          \"%% -- coordinate system\\n\"\n          \"/image-dpi %d def\\n\"\n          \"/image-x 0 def\\n\"\n          \"/image-y 0 def\\n\"\n          \"/image-width  %d def\\n\"\n          \"/image-height %d def\\n\"\n          \"/coeff 100 image-dpi div def\\n\"\n          \"/a11 coeff def\\n\"\n          \"/a12 0 def\\n\"\n          \"/a13 0 def\\n\"\n          \"/a21 0 def\\n\"\n          \"/a22 coeff def\\n\"\n          \"/a23 0 def\\n\"\n          \"[a11 a21 a12 a22 a13 a23] concat\\n\"\n          \"gsave 0 0 image-width image-height rectclip\\n\"\n          \"%% -- begin printing\\n\",\n          dpi, grect.width(), grect.height() );\n  else\n    {\n      int margin = 0;\n      const char *xauto = \"false\";\n      const char *xportrait = \"false\";\n      const char *xfit = \"false\";\n      if (options.get_orientation()==Options::AUTO)\n        xauto = \"true\";\n      if (options.get_orientation()==Options::PORTRAIT)\n        xportrait = \"true\";\n      if (options.get_zoom()<=0)\n        xfit = \"true\";\n      if (options.get_cropmarks())\n        margin = 36;\n      else if (options.get_frame())\n        margin = 6;\n      write(str, \n            \"/page-origstate save def\\n\"\n            \"%% -- coordinate system\\n\"\n            \"/auto-orient %s def\\n\"\n            \"/portrait %s def\\n\"\n            \"/fit-page %s def\\n\"\n            \"/zoom %d def\\n\"\n            \"/image-dpi %d def\\n\"\n            \"clippath pathbbox newpath\\n\"\n            \"2 index sub exch 3 index sub\\n\"\n            \"/page-width exch def\\n\"\n            \"/page-height exch def\\n\"\n            \"/page-y exch def\\n\"\n            \"/page-x exch def\\n\"\n            \"/image-x 0 def\\n\"\n            \"/image-y 0 def\\n\"\n            \"/image-width  %d def\\n\"\n            \"/image-height %d def\\n\"\n            \"/margin %d def\\n\"\n            \"/halign %d def\\n\"\n            \"/valign 0 def\\n\",\n            xauto, xportrait, xfit, options.get_zoom(), \n            dpi, grect.width(), grect.height(),\n            margin, align );\n      write(str, \n            \"%% -- position page\\n\"\n            \"auto-orient {\\n\"\n            \"  image-height image-width sub\\n\"\n            \"  page-height page-width sub\\n\"\n            \"  mul 0 ge /portrait exch def\\n\" \n            \"} if\\n\"\n            \"fit-page {\\n\"\n            \"  /page-width page-width margin sub\\n\"\n            \"     halign 0 eq { margin sub } if def\\n\"\n            \"  /page-height page-height margin sub\\n\"\n            \"     valign 0 eq { margin sub } if def\\n\"\n            \"  /page-x page-x halign 0 ge { margin add } if def\\n\"\n            \"  /page-y page-y valign 0 ge { margin add } if def\\n\"\n            \"} if\\n\"\n            \"portrait {\\n\"\n            \"  fit-page {\\n\"\n            \"    image-height page-height div\\n\"\n            \"    image-width page-width div\\n\"\n            \"    gt {\\n\"\n            \"      page-height image-height div /coeff exch def\\n\"\n            \"    } {\\n\"\n            \"      page-width image-width div /coeff exch def\\n\"\n            \"    } ifelse\\n\"\n            \"  } {\\n\"\n            \"    /coeff 72 image-dpi div zoom mul 100 div def\\n\"\n            \"  } ifelse\\n\"\n            \"  /start-x page-x page-width image-width\\n\"\n            \"    coeff mul sub 2 div halign 1 add mul add def\\n\"\n            \"  /start-y page-y page-height image-height\\n\"\n            \"    coeff mul sub 2 div valign 1 add mul add def\\n\"\n            \"  /a11 coeff def\\n\"\n            \"  /a12 0 def\\n\"\n            \"  /a13 start-x def\\n\"\n            \"  /a21 0 def\\n\"\n            \"  /a22 coeff def\\n\"\n            \"  /a23 start-y def\\n\"\n            \"} { %% landscape\\n\"\n            \"  fit-page {\\n\"\n            \"    image-height page-width div\\n\"\n            \"    image-width page-height div\\n\"\n            \"    gt {\\n\"\n            \"      page-width image-height div /coeff exch def\\n\"\n            \"    } {\\n\"\n            \"      page-height image-width div /coeff exch def\\n\"\n            \"    } ifelse\\n\"\n            \"  } {\\n\"\n            \"    /coeff 72 image-dpi div zoom mul 100 div def\\n\"\n            \"  } ifelse\\n\"\n            \"  /start-x page-x page-width add page-width image-height\\n\"\n            \"    coeff mul sub 2 div valign 1 add mul sub def\\n\"\n            \"  /start-y page-y page-height image-width\\n\"\n            \"    coeff mul sub 2 div halign 1 add mul add def\\n\"\n            \"  /a11 0 def\\n\"\n            \"  /a12 coeff neg def\\n\"\n            \"  /a13 start-x image-y coeff neg mul sub def\\n\"\n            \"  /a21 coeff def\\n\"\n            \"  /a22 0 def\\n\"\n            \"  /a23 start-y image-x coeff mul add def \\n\"\n            \"} ifelse\\n\"\n            \"[a11 a21 a12 a22 a13 a23] concat\\n\"\n            \"gsave 0 0 image-width image-height rectclip\\n\"\n            \"%% -- begin print\\n\");\n    }\n}\n\nvoid\nDjVuToPS::\nstore_page_trailer(ByteStream &str)\n{\n  write(str, \n        \"%% -- end print\\n\" \n        \"grestore\\n\");\n  if (options.get_frame())\n    write(str, \n          \"%% Drawing frame\\n\"\n          \"gsave 0.7 setgray 0.5 coeff div setlinewidth 0 0\\n\"\n          \"image-width image-height rectstroke\\n\"\n          \"grestore\\n\");\n  if (options.get_cropmarks() &&\n      options.get_format() != Options::EPS )\n    write(str,\n          \"%% Drawing crop marks\\n\"\n          \"/cm { gsave translate rotate 1 coeff div dup scale\\n\"\n          \"      0 setgray 0.5 setlinewidth -36 0 moveto 0 0 lineto\\n\"\n          \"      0 -36 lineto stroke grestore } bind def\\n\"\n          \"0 0 0 cm 180 image-width image-height cm\\n\"\n          \"90 image-width 0 cm 270 0 image-height cm\\n\");\n  write(str,\n        \"page-origstate restore\\n\");\n}\n\nstatic int\ncompute_red(int w, int h, int rw, int rh)\n{\n  for (int red=1; red<16; red++)\n    if (((w+red-1)/red==rw) && ((h+red-1)/red==rh))\n      return red;\n  return 16;\n}\n\nstatic int\nget_bg_red(GP<DjVuImage> dimg) \n{\n  GP<GPixmap> pm = 0;\n  // Access image size\n  int width = dimg->get_width();\n  int height = dimg->get_height();\n  if (width<=0 || height<=0) return 0;\n  // CASE1: Incremental BG IW44Image\n  GP<IW44Image> bg44 = dimg->get_bg44();\n  if (bg44)\n    {\n      int w = bg44->get_width();\n      int h = bg44->get_height();\n      // Avoid silly cases\n      if (w==0 || h==0 || width==0 || height==0)\n        return 0;\n      return compute_red(width,height,w,h);\n    }\n  // CASE 2: Raw background pixmap\n  GP<GPixmap>  bgpm = dimg->get_bgpm();\n  if (bgpm)\n    {\n      int w = bgpm->columns();\n      int h = bgpm->rows();\n      // Avoid silly cases\n      if (w==0 || h==0 || width==0 || height==0)\n        return 0;\n      return compute_red(width,height,w,h);\n    }\n  return 0;\n}\n\nstatic GP<GPixmap>\nget_bg_pixmap(GP<DjVuImage> dimg, const GRect &rect)\n{\n  GP<GPixmap> pm = 0;\n  // Access image size\n  int width = dimg->get_width();\n  int height = dimg->get_height();\n  GP<DjVuInfo> info = dimg->get_info();\n  if (width<=0 || height<=0 || !info) return 0;\n  // CASE1: Incremental BG IW44Image\n  GP<IW44Image> bg44 = dimg->get_bg44();\n  if (bg44)\n    {\n      int w = bg44->get_width();\n      int h = bg44->get_height();\n      // Avoid silly cases\n      if (w==0 || h==0 || width==0 || height==0)\n        return 0;\n      pm = bg44->get_pixmap(1,rect);\n      return pm;\n    }\n  // CASE 2: Raw background pixmap\n  GP<GPixmap>  bgpm = dimg->get_bgpm();\n  if (bgpm)\n    {\n      int w = bgpm->columns();\n      int h = bgpm->rows();\n      // Avoid silly cases\n      if (w==0 || h==0 || width==0 || height==0)\n        return 0;\n      pm->init(*bgpm, rect);\n      return pm;\n    }\n  // FAILURE\n  return 0;\n}\n\nvoid \nDjVuToPS::\nmake_gamma_ramp(GP<DjVuImage> dimg)\n{\n  double targetgamma = options.get_gamma();\n  double whitepoint = (options.get_sRGB() ? 255 : 280);\n  for (int i=0; i<256; i++)\n    ramp[i] = i;\n  if (! dimg->get_info()) \n    return;\n  if (targetgamma < 0.1)\n    return;\n  double filegamma = dimg->get_info()->gamma;\n  double correction = filegamma / targetgamma;\n  if (correction<0.1 || correction>10)\n    return;\n  {\n    for (int i=0; i<256; i++)\n    {\n      double x = (double)(i)/255.0;\n      if (correction != 1.0) \n        x = pow(x, correction);        \n      int j = (int) floor(whitepoint * x + 0.5);\n      ramp[i] = (j>255) ? 255 : (j<0) ? 0 : j;\n    }\n  }\n}\n\nvoid\nDjVuToPS::\nprint_fg_2layer(ByteStream &str, \n                GP<DjVuImage> dimg,\n                const GRect &prn_rect, \n                unsigned char *blit_list)\n{\n  // Pure-jb2 or color-jb2 case.\n  GPixel p;\n  int currentx=0;\n  int currenty=0;\n  GP<DjVuPalette> pal = dimg->get_fgbc();\n  GP<JB2Image> jb2 = dimg->get_fgjb();\n  if (! jb2) return;\n  int num_blits = jb2->get_blit_count();\n  int current_blit;\n  for(current_blit=0; current_blit<num_blits; current_blit++)\n    {\n      if (blit_list[current_blit])\n        {\n          JB2Blit *blit = jb2->get_blit(current_blit);\n          if ((pal) && !(options.get_mode()==Options::BW))\n            {\n              pal->index_to_color(pal->colordata[current_blit], p);\n              if (options.get_color())\n                {\n                  write(str,\"/%d %d %d %f %f %f c\\n\",\n                        blit->shapeno, \n                        blit->left-currentx, blit->bottom-currenty,\n                        ramp[p.r]/255.0, ramp[p.g]/255.0, ramp[p.b]/255.0);\n                } \n              else\n                {\n                  write(str,\"/%d %d %d %f c\\n\",\n                        blit->shapeno, \n                        blit->left-currentx, blit->bottom-currenty,\n                        ramp[GRAY(p.r, p.g, p.b)]/255.0);\n                }\n            }\n          else\n            {\n              write(str,\"/%d %d %d s\\n\", \n                    blit->shapeno, \n                    blit->left-currentx, blit->bottom-currenty);\n            }\n          currentx = blit->left;\n          currenty = blit->bottom;\n        }\n    }\n}\n\nvoid\nDjVuToPS::\nprint_fg_3layer(ByteStream &str, \n                GP<DjVuImage> dimg,\n                const GRect &cprn_rect, \n                unsigned char *blit_list )\n{\n  GRect prn_rect;\n  GP<GPixmap> brush = dimg->get_fgpm();\n  if (! brush) return;\n  int br = brush->rows();\n  int bc = brush->columns();\n  int red = compute_red(dimg->get_width(),dimg->get_height(),bc,br);\n  prn_rect.ymin = (cprn_rect.ymin)/red;\n  prn_rect.xmin = (cprn_rect.xmin)/red;\n  prn_rect.ymax = (cprn_rect.ymax+red-1)/red;\n  prn_rect.xmax = (cprn_rect.xmax+red-1)/red;\n  int color_nb = ((options.get_color()) ? 3 : 1);\n  GP<JB2Image> jb2 = dimg->get_fgjb();\n  if (! jb2) return;\n  int pw = bc;\n  int ph = 2;\n\n  write(str,\n        \"/P {\\n\" \n        \"  11 dict dup begin 4 1 roll\\n\"\n        \"    /PatternType 1 def\\n\"\n        \"    /PaintType 1 def\\n\"\n        \"    /TilingType 1 def\\n\"\n        \"    /H exch def\\n\"\n        \"    /W exch def\\n\"\n        \"    /Red %d def\\n\"\n        \"    /PatternString exch def\\n\"\n        \"    /XStep W Red mul def\\n\"\n        \"    /YStep H Red mul def\\n\"\n        \"    /BBox [0 0 XStep YStep] def\\n\"\n        \"    /PaintProc { begin\\n\"\n        \"       Red dup scale\\n\"\n        \"       << /ImageType 1 /Width W /Height H\\n\"\n        \"          /BitsPerComponent 8 /Interpolate false\\n\"\n        \"          /Decode [%s] /ImageMatrix [1 0 0 1 0 0]\\n\"\n        \"          /DataSource PatternString >> image\\n\"\n        \"       end } bind def\\n\"\n        \"     0 0 XStep YStep rectclip\\n\"\n        \"     end matrix makepattern\\n\"\n        \"  /Pattern setcolorspace setpattern\\n\"\n        \"  0 0 moveto\\n\"\n        \"} def\\n\", red, (color_nb == 1) ? \"0 1\" : \"0 1 0 1 0 1\" );\n\n  unsigned char *s;\n  GPBuffer<unsigned char> gs(s,pw*ph*color_nb);\n  unsigned char *s_ascii_encoded;\n  GPBuffer<unsigned char> gs_ascii_encoded(s_ascii_encoded,pw*ph*2*color_nb);\n    {\n      for (int y=prn_rect.ymin; y<prn_rect.ymax; y+=ph)\n        for (int x=prn_rect.xmin; x<prn_rect.xmax; x+=pw)\n          {\n            int w = ((x+pw > prn_rect.xmax) ? prn_rect.xmax-x : pw);\n            int h = ((y+ph > prn_rect.ymax) ? prn_rect.ymax-y : ph);\n            int currentx = x * red;\n            int currenty = y * red;\n            // Find first intersecting blit\n            int current_blit;\n            int num_blits = jb2->get_blit_count();\n            GRect rect1(currentx,currenty, w*red, h*red);\n            for(current_blit=0; current_blit<num_blits; current_blit++)\n              if (blit_list[current_blit])\n                {\n                  JB2Blit *blit = jb2->get_blit(current_blit);\n                  GRect rect2(blit->left, blit->bottom,\n                              jb2->get_shape(blit->shapeno).bits->columns(),\n                              jb2->get_shape(blit->shapeno).bits->rows());\n                  if (rect2.intersect(rect1,rect2)) \n                    break;\n                }\n            if (current_blit >= num_blits)\n              continue;\n            // Setup pattern\n            write(str,\"gsave %d %d translate\\n\", currentx, currenty);\n            write(str,\"<~\");\n            unsigned char *q = s;\n            for(int current_row = y; current_row<y+h; current_row++)\n              { \n                GPixel *row_pix = (*brush)[current_row];\n                for(int current_col = x; current_col<x+w; current_col++)\n                  { \n                    GPixel &p = row_pix[current_col];\n                    if (color_nb>1)\n                      {\n                        *q++ = ramp[p.r];\n                        *q++ = ramp[p.g];\n                        *q++ = ramp[p.b];\n                      }\n                    else\n                      {\n                        *q++ = ramp[GRAY(p.r,p.g,p.b)];\n                      }\n                  }\n              }\n            unsigned char *stop_ascii = \n              ASCII85_encode(s_ascii_encoded,s,s+w*h*color_nb);\n            *stop_ascii++='\\0';\n            write(str,\"%s\",s_ascii_encoded);\n            write(str,\"~> %d %d P\\n\", w, h);\n            // Keep performing blits\n            for(; current_blit<num_blits; current_blit++)\n              if (blit_list[current_blit])\n                {\n                  JB2Blit *blit = jb2->get_blit(current_blit);\n                  GRect rect2(blit->left, blit->bottom,\n                              jb2->get_shape(blit->shapeno).bits->columns(),\n                              jb2->get_shape(blit->shapeno).bits->rows()); \n                  if (rect2.intersect(rect1,rect2)) \n                    {   \n                      write(str,\"/%d %d %d s\\n\",\n                            blit->shapeno, \n                            blit->left-currentx, blit->bottom-currenty);\n                      currentx = blit->left;\n                      currenty = blit->bottom;\n                    }\n                }\n            write(str,\"grestore\\n\");\n          }\n      // Cleanup\n    }\n}\n\nvoid\nDjVuToPS::\nprint_fg(ByteStream &str, \n         GP<DjVuImage> dimg,\n         const GRect &prn_rect )\n{\n  GP<JB2Image> jb2=dimg->get_fgjb();\n  if (! jb2) return;\n  int num_blits = jb2->get_blit_count();\n  int num_shapes = jb2->get_shape_count();\n  unsigned char *dict_shapes = 0;\n  unsigned char *blit_list = 0;\n  GPBuffer<unsigned char> gdict_shapes(dict_shapes,num_shapes);\n  GPBuffer<unsigned char> gblit_list(blit_list,num_blits);\n  for(int i=0; i<num_shapes; i++)\n  {\n    dict_shapes[i]=0;\n  }\n  for(int current_blit=0; current_blit<num_blits; current_blit++)\n  {\n    JB2Blit *blit = jb2->get_blit(current_blit);\n    JB2Shape *shape = & jb2->get_shape(blit->shapeno);\n    blit_list[current_blit] = 0;\n    if (! shape->bits) \n      continue;\n    GRect rect2(blit->left, blit->bottom, \n      shape->bits->columns(), shape->bits->rows());\n    if (rect2.intersect(rect2, prn_rect))\n    {\n      dict_shapes[blit->shapeno] = 1;\n      blit_list[current_blit] = 1;\n    }\n  }\n  write(str,\n    \"%% --- now doing the foreground\\n\"\n    \"gsave DjVuColorSpace setcolorspace\\n\" );\n      // Define font\n  write(str,\n    \"/$DjVuLocalFont 7 dict def\\n\"\n    \"$DjVuLocalFont begin\\n\"\n    \"/FontType 3 def \\n\"\n    \"/FontMatrix [1 0 0 1 0 0] def\\n\"\n    \"/FontBBox [0 0 1 .5] def\\n\"\n    \"/CharStrings %d dict def\\n\"\n    \"/Encoding 2 array def\\n\"\n    \"0 1 1 {Encoding exch /.notdef put} for \\n\"\n    \"CharStrings begin\\n\"\n    \"/.notdef {} def\\n\",\n    num_shapes+1);\n  for(int current_shape=0; current_shape<num_shapes; current_shape++)\n  {\n    if (dict_shapes[current_shape])\n    {\n      JB2Shape *shape = & jb2->get_shape(current_shape);\n      GP<GBitmap> bitmap = shape->bits;\n      int rows = bitmap->rows();\n      int columns = bitmap->columns();\n      int nbytes = (columns+7)/8*rows+1;\n      int nrows = rows;\n      int nstrings=0;\n      if (nbytes>(int)ps_string_size)   //max string length\n      {\n        nrows=ps_string_size/((columns+7)/8);\n        nbytes=(columns+7)/8*nrows+1;\n      }\n      unsigned char *s_start;\n      GPBuffer<unsigned char> gs_start(s_start,nbytes);\n      unsigned char *s_ascii;\n      GPBuffer<unsigned char> gs_ascii(s_ascii,nbytes*2);\n      write(str,\"/%d {\",current_shape);\n\n      unsigned char *s = s_start;\n      for(int current_row=0; current_row<rows; current_row++)\n      {  \n        unsigned char * row_bits = (*bitmap)[current_row];\n        unsigned char acc = 0;\n        unsigned char mask = 0;\n        for(int current_col=0; current_col<columns; current_col++)\n        {\n          if (mask == 0)\n            mask = 0x80;\n          if (row_bits[current_col])\n            acc |= mask;\n          mask >>= 1;\n          if (mask == 0)\n          {\n            *s=acc;\n            s++;\n            acc = mask = 0;\n          }\n        }\n        if (mask != 0)\n        {\n          *s=acc;\n          s++;\n        }\n        if (!((current_row+1)%nrows))\n        {\n          unsigned char *stop_ascii = ASCII85_encode(s_ascii,s_start,s); \n          *stop_ascii++='\\0';\n          write(str,\"<~%s~> \",s_ascii);\n          s=s_start;\n          nstrings++;\n        }\n      }\n      if (s!=s_start)\n      {\n        unsigned char *stop_ascii = ASCII85_encode(s_ascii,s_start,s);\n        *stop_ascii++='\\0';\n        write(str,\"<~%s~> \",s_ascii);\n          nstrings++;\n      }\n      if (nstrings==1)\n        write(str,\" %d %d g} def\\n\", columns, rows);                  \n      else\n        write(str,\" %d %d %d gn} def\\n\", columns, rows,nstrings);\n    }\n  }\n  write(str, \n    \"end\\n\"\n    \"/BuildGlyph {\\n\"\n    \"  exch /CharStrings get exch\\n\"\n    \"  2 copy known not\\n\"\n    \"  {pop /.notdef} if\\n\"\n    \"  get exec \\n\"\n    \"} bind def\\n\"\n    \"end\\n\"\n    \"/LocalDjVuFont $DjVuLocalFont definefont pop\\n\"\n    \"/LocalDjVuFont findfont setfont\\n\" );\n  write(str,\n    \"-%d -%d translate\\n\"\n    \"0 0 moveto\\n\",\n    prn_rect.xmin, prn_rect.ymin);\n  // Print the foreground layer\n  if (dimg->get_fgpm() && !(options.get_mode()==Options::BW)) \n    print_fg_3layer(str, dimg, prn_rect, blit_list);\n  else\n    print_fg_2layer(str, dimg, prn_rect, blit_list);        \n  write(str, \"/LocalDjVuFont undefinefont grestore\\n\");\n}\n\n\nvoid \nDjVuToPS::\nprint_bg(ByteStream &str, \n         GP<DjVuImage> dimg,\n         const GRect &cprn_rect)\n{\n  GP<GPixmap> pm;\n  GRect prn_rect;\n  double print_done = 0;\n  int red = 0;\n  write(str, \"%% --- now doing the background\\n\");\n  if (! (red = get_bg_red(dimg)))\n    return;\n  write(str, \n        \"gsave -%d -%d translate\\n\"\n        \"/bgred %d def bgred bgred scale\\n\",\n        cprn_rect.xmin % red, \n        cprn_rect.ymin % red, \n        red);\n  prn_rect.ymin = (cprn_rect.ymin)/red;\n  prn_rect.ymax = (cprn_rect.ymax+red-1)/red;\n  prn_rect.xmin = (cprn_rect.xmin)/red;\n  prn_rect.xmax = (cprn_rect.xmax+red-1)/red;\n  // Display image\n  int band_bytes = 125000;\n  int band_height = band_bytes/prn_rect.width();\n  int buffer_size = band_height*prn_rect.width();\n  int ps_chunk_height = 30960/prn_rect.width()+1;\n  buffer_size = buffer_size*23/10;\n  bool do_color = options.get_color();\n  if ((!dimg->is_legal_photo() &&\n       !dimg->is_legal_compound())\n      || options.get_mode()==Options::BW)\n    do_color = false;\n  if (do_color) \n    buffer_size *= 3;\n  if (do_color)\n    write(str, \n          \"/bufferR %d string def\\n\"\n          \"/bufferG %d string def\\n\"\n          \"/bufferB %d string def\\n\"\n          \"DjVuColorSpace setcolorspace\\n\"\n          \"<< /ImageType 1\\n\"\n          \"   /Width %d\\n\"\n          \"   /Height %d\\n\"\n          \"   /BitsPerComponent 8\\n\"\n          \"   /Decode [0 1 0 1 0 1]\\n\"\n          \"   /ImageMatrix [1 0 0 1 0 0]\\n\"\n          \"   /MultipleDataSources true\\n\"\n          \"   /DataSource [ { ReadR } { ReadG } { ReadB } ]\\n\"\n          \"   /Interpolate false >> image\\n\",\n          ps_chunk_height*prn_rect.width(),\n          ps_chunk_height*prn_rect.width(),\n          ps_chunk_height*prn_rect.width(),\n          prn_rect.width(), prn_rect.height());\n  else\n    write(str, \n          \"DjVuColorSpace setcolorspace\\n\"\n          \"<< /ImageType 1\\n\"\n          \"   /Width %d\\n\"\n          \"   /Height %d\\n\"\n          \"   /BitsPerComponent 8\\n\"\n          \"   /Decode [0 1]\\n\"\n          \"   /ImageMatrix [1 0 0 1 0 0]\\n\"\n          \"   /DataSource currentfile /ASCII85Decode\\n\"\n          \"      filter /RunLengthDecode filter\\n\"\n          \"   /Interpolate false >> image\\n\",\n          prn_rect.width(), prn_rect.height());\n  \n  unsigned char *buffer;\n  GPBuffer<unsigned char> gbuffer(buffer,buffer_size);\n  unsigned char *rle_in;\n  GPBuffer<unsigned char> grle_in(rle_in,ps_chunk_height*prn_rect.width());\n  unsigned char *rle_out;\n  GPBuffer<unsigned char> grle_out(rle_out,2*ps_chunk_height*prn_rect.width());\n  {\n    // Start storing image in bands\n    unsigned char * rle_out_end = rle_out;\n    GRect grectBand = prn_rect;\n    grectBand.ymax = grectBand.ymin;\n    while(grectBand.ymax < prn_rect.ymax)\n      {\n        GP<GPixmap> pm = 0;\n        // Compute next band\n        grectBand.ymin=grectBand.ymax;\n        grectBand.ymax=grectBand.ymin+band_bytes/grectBand.width();\n        if (grectBand.ymax>prn_rect.ymax)\n          grectBand.ymax=prn_rect.ymax;\n        pm = get_bg_pixmap(dimg, grectBand);\n        unsigned char *buf_ptr = buffer;\n        if (pm)\n          {\n            if (do_color)\n              {\n                int y=0;\n                while(y<grectBand.height())\n                  {\n                    int row, y1;\n                    unsigned char *ptr, *ptr1;\n                    // Doing R component of current chunk\n                    for (row=0,ptr=rle_in,y1=y; \n                         row<ps_chunk_height && y1<grectBand.height(); \n                         row++,y1++)\n                      {\n                        GPixel *pix = (*pm)[y1];\n                        for (int x=grectBand.width(); x>0; x--,pix++)\n                          *ptr++ = ramp[pix->r];\n                      }\n                    ptr1 = RLE_encode(rle_out, rle_in, ptr); \n                    *ptr1++ = 0x80;\n                    buf_ptr = ASCII85_encode(buf_ptr, rle_out, ptr1);\n                    *buf_ptr++ = '~'; *buf_ptr++ = '>'; *buf_ptr++ = '\\n';\n                    // Doing G component of current chunk\n                    for (row=0,ptr=rle_in,y1=y; \n                         row<ps_chunk_height && y1<grectBand.height(); \n                         row++,y1++)\n                      {\n                        GPixel *pix = (*pm)[y1];\n                        for (int x=grectBand.width(); x>0; x--,pix++)\n                          *ptr++ = ramp[pix->g];\n                      }\n                    ptr1 = RLE_encode(rle_out, rle_in, ptr); \n                    *ptr1++ = 0x80;\n                    buf_ptr = ASCII85_encode(buf_ptr, rle_out, ptr1);\n                    *buf_ptr++ = '~'; \n                    *buf_ptr++ = '>'; \n                    *buf_ptr++ = '\\n';\n                    // Doing B component of current chunk\n                    for (row=0, ptr=rle_in, y1=y;\n                         row<ps_chunk_height && y1<grectBand.height(); \n                         row++,y1++)\n                      {\n                        GPixel *pix = (*pm)[y1];\n                        for (int x=grectBand.width(); x>0; x--,pix++)\n                          *ptr++ = ramp[pix->b];\n                      }\n                    ptr1 = RLE_encode(rle_out, rle_in, ptr);\n                    *ptr1++ = 0x80;\n                    buf_ptr = ASCII85_encode(buf_ptr, rle_out, ptr1);\n                    *buf_ptr++ = '~'; \n                    *buf_ptr++ = '>'; \n                    *buf_ptr++ = '\\n';\n                    y=y1;\n                    if (refresh_cb) \n                      refresh_cb(refresh_cl_data);\n                  } //while (y>=0)\n              } \n            else\n              {\n                // Don't use color\n                int y=0;\n                while(y<grectBand.height())\n                  {\n                    unsigned char *ptr = rle_in;\n                    for(int row=0; \n                        row<ps_chunk_height && y<grectBand.height(); \n                        row++,y++)\n                      {\n                        GPixel *pix = (*pm)[y];\n                        for (int x=grectBand.width(); x>0; x--,pix++)\n                          *ptr++ = ramp[GRAY(pix->r,pix->g,pix->b)];\n                      }\n                    rle_out_end = RLE_encode(rle_out_end, rle_in, ptr);\n                    unsigned char *encode_to \n                      = rle_out+(rle_out_end-rle_out)/4*4;\n                    int bytes_left = rle_out_end-encode_to;\n                    buf_ptr = ASCII85_encode(buf_ptr, rle_out, encode_to);\n                    *buf_ptr++ = '\\n';\n                    memcpy(rle_out, encode_to, bytes_left);\n                    rle_out_end = rle_out+bytes_left;\n                    if (refresh_cb) \n                      refresh_cb(refresh_cl_data);\n                  }\n              }\n          } // if (pm)\n        str.writall(buffer, buf_ptr-buffer);\n        if (prn_progress_cb)\n          {\n            double done=(double)(grectBand.ymax \n                                 - prn_rect.ymin)/prn_rect.height();\n            if ((int) (20*print_done)!=(int) (20*done))\n              {\n                print_done=done;\n                prn_progress_cb(done, prn_progress_cl_data);\n              }\n          }\n      } // while(grectBand.yax<grect.ymax)\n    if (! do_color)\n      {\n        unsigned char * buf_ptr = buffer;\n        *rle_out_end++ = 0x80;\n        buf_ptr = ASCII85_encode(buf_ptr, rle_out, rle_out_end);\n        *buf_ptr++='~'; \n        *buf_ptr++='>'; \n        *buf_ptr++='\\n';\n        str.writall(buffer, buf_ptr-buffer);\n      }\n  } \n  //restore the scaling\n  write(str, \"grestore\\n\");\n}\n\nvoid\nDjVuToPS::\nprint_image_lev1(ByteStream &str, \n                 GP<DjVuImage> dimg,\n                 const GRect &prn_rect)\n{         \n  double print_done=0;\n  GRect all(0,0, dimg->get_width(),dimg->get_height());\n  GP<GPixmap> pm;\n  GP<GBitmap> bm;\n  GRect test(0,0,1,1);\n  if (options.get_mode() == Options::FORE)\n    pm = dimg->get_fg_pixmap(test, all);\n  else if (options.get_mode() == Options::BACK)\n    pm = dimg->get_bg_pixmap(test, all);\n  else if (options.get_mode() != Options::BW)\n    pm = dimg->get_pixmap(test, all);\n  if (! pm)\n    bm = dimg->get_bitmap(test,all);\n  if (! pm && ! bm)\n    return;\n  write(str,\n        \"%% --- now doing a level 1 image\\n\"\n        \"gsave\\n\");\n  // Display image\n  int band_bytes=125000;\n  int band_height = band_bytes/prn_rect.width();\n  int buffer_size = band_height*prn_rect.width();\n  buffer_size = buffer_size*21/10;\n  bool do_color = false;\n  bool do_color_or_gray = false;\n  if (pm && (options.get_mode() != Options::BW))\n    do_color_or_gray = true;\n  if (do_color_or_gray && options.get_color())\n    do_color = true;\n  if (do_color) \n    buffer_size *= 3;\n  if (do_color)\n    write(str, \"/buffer24 %d string def\\n\", 3*prn_rect.width());\n  if (do_color_or_gray)\n    write(str, \"/buffer8 %d string def\\n\", prn_rect.width());\n  else\n    write(str, \"/buffer8 %d string def\\n\", (prn_rect.width()+7)/8);\n  if (do_color)\n    {\n      write(str,\n            \"%d %d 8 [ 1 0 0 1 0 0 ]\\n\"\n            \"{ ColorProc } false 3 ColorImage\\n\",\n            prn_rect.width(), prn_rect.height());\n    } \n  else if (do_color_or_gray)\n    {\n      write(str,\n            \"%d %d 8 [ 1 0 0 1 0 0 ]\\n\"\n            \"{ currentfile buffer8 readhexstring pop } image\\n\",\n            prn_rect.width(), prn_rect.height());\n    } \n  else\n    {\n      write(str,\n            \"%d %d 1 [ 1 0 0 1 0 0 ]\\n\"\n            \"{ currentfile buffer8 readhexstring pop } image\\n\",\n            prn_rect.width(), prn_rect.height());\n    }\n  unsigned char * buffer;\n  GPBuffer<unsigned char> gbuffer(buffer,buffer_size);\n    {\n      // Start storing image in bands\n      GRect grectBand = prn_rect;\n      grectBand.ymax = grectBand.ymin;\n      while(grectBand.ymax < prn_rect.ymax)\n        {\n          // Compute next band\n          grectBand.ymin = grectBand.ymax;\n          grectBand.ymax = grectBand.ymin+band_bytes/grectBand.width();\n          if (grectBand.ymax > prn_rect.ymax)\n            grectBand.ymax = prn_rect.ymax;\n          GRect all(0,0, dimg->get_width(),dimg->get_height());\n          pm = 0;\n          bm = 0;\n          if (do_color_or_gray)\n            {\n              if (options.get_mode() == Options::FORE)\n                pm = dimg->get_fg_pixmap(grectBand, all);\n              else if (options.get_mode() == Options::BACK)\n                pm = dimg->get_bg_pixmap(grectBand, all);\n              else\n                pm = dimg->get_pixmap(grectBand, all);\n            }\n          else \n            {\n              bm = dimg->get_bitmap(grectBand, all);\n            }\n          // Store next band\n          unsigned char *buf_ptr = buffer;\n          int symbols=0;\n          for (int y=0; y<grectBand.height(); y++)\n            {\n              if (pm && do_color_or_gray)\n                {\n                  GPixel *pix = (*pm)[y];\n                  for (int x=grectBand.width(); x>0; x--, pix++)\n                    {\n                      if (do_color)\n                        {\n                          char *data;\n                          data = bin2hex[ramp[pix->r]];\n                          *buf_ptr++ = data[0];\n                          *buf_ptr++ = data[1];\n                          data = bin2hex[ramp[pix->g]];\n                          *buf_ptr++ = data[0];\n                          *buf_ptr++ = data[1];\n                          data = bin2hex[ramp[pix->b]];\n                          *buf_ptr++ = data[0];\n                          *buf_ptr++ = data[1];\n                          symbols += 6;\n                        }\n                      else\n                        {\n                          char *data;\n                          data = bin2hex[ramp[GRAY(pix->r,pix->g,pix->b)]];\n                          *buf_ptr++ = data[0];\n                          *buf_ptr++ = data[1];\n                          symbols += 2;\n                        }\n                      if (symbols>70) \n                        { \n                          *buf_ptr++ = '\\n'; \n                          symbols=0; \n                        }\n                    }\n                }\n              else if (bm)\n                {\n                  unsigned char *pix = (*bm)[y];\n                  unsigned char acc = 0;\n                  unsigned char mask = 0;\n                  char *data;\n                  for (int x=grectBand.width(); x>0; x--, pix++)\n                    {\n                      if (mask == 0)\n                        mask = 0x80;\n                      if (! *pix)\n                        acc |= mask;\n                      mask >>= 1;\n                      if (mask == 0)\n                        {\n                          data = bin2hex[acc];\n                          acc = 0;\n                          *buf_ptr++ = data[0];\n                          *buf_ptr++ = data[1];\n                          symbols += 2;\n                          if (symbols>70) \n                            { \n                              *buf_ptr++ = '\\n'; \n                              symbols = 0; \n                            }\n                        }\n                    }\n                  if (mask != 0) \n                    {\n                      data = bin2hex[acc];\n                      *buf_ptr++ = data[0];\n                      *buf_ptr++ = data[1];\n                      symbols += 2;\n                    }\n                }\n              if (refresh_cb) \n                refresh_cb(refresh_cl_data);\n            }\n          str.writall(buffer, buf_ptr-buffer);\n          if (prn_progress_cb)\n            {\n              double done=(double) (grectBand.ymax \n                                    - prn_rect.ymin)/prn_rect.height();\n              if ((int) (20*print_done)!=(int) (20*done))\n                {\n                  print_done=done;\n                  prn_progress_cb(done, prn_progress_cl_data);\n                }\n            }\n        }\n      write(str, \"\\n\");\n    } \n  write(str, \"grestore\\n\");\n}\n\nvoid\nDjVuToPS::\nprint_image_lev2(ByteStream &str, \n                 GP<DjVuImage> dimg,\n                 const GRect &prn_rect)\n{         \n  double print_done=0;\n  GRect all(0,0, dimg->get_width(),dimg->get_height());\n  GP<GPixmap> pm;\n  GRect test(0,0,1,1);\n  if (options.get_mode() == Options::FORE)\n    pm = dimg->get_fg_pixmap(test, all);\n  else if (options.get_mode() == Options::BACK)\n    pm = dimg->get_bg_pixmap(test, all);\n  else if (options.get_mode() != Options::BW)\n    pm = dimg->get_pixmap(test, all);\n  if (! pm)\n    return;\n  write(str,\n        \"%% --- now doing a level 2 image\\n\"\n        \"gsave\\n\");\n  // Display image\n  int band_bytes=125000;\n  int band_height = band_bytes/prn_rect.width();\n  int buffer_size = band_height*prn_rect.width();\n  int ps_chunk_height = 30960/prn_rect.width()+1;\n  buffer_size = buffer_size*21/10 + 32;\n  bool do_color = options.get_color();\n  if (do_color)\n    {\n      buffer_size *= 3;\n      write(str, \n            \"/bufferR %d string def\\n\"\n            \"/bufferG %d string def\\n\"\n            \"/bufferB %d string def\\n\"\n            \"DjVuColorSpace setcolorspace\\n\"\n            \"<< /ImageType 1\\n\"\n            \"   /Width %d\\n\"\n            \"   /Height %d\\n\"\n            \"   /BitsPerComponent 8\\n\"\n            \"   /Decode [0 1 0 1 0 1]\\n\"\n            \"   /ImageMatrix [1 0 0 1 0 0]\\n\"\n            \"   /MultipleDataSources true\\n\"\n            \"   /DataSource [ { ReadR } { ReadG } { ReadB } ]\\n\"\n            \"   /Interpolate false >> image\\n\",\n            ps_chunk_height*prn_rect.width(),\n            ps_chunk_height*prn_rect.width(),\n            ps_chunk_height*prn_rect.width(),\n            prn_rect.width(), prn_rect.height());\n    } \n  else\n    {\n      write(str, \n            \"DjVuColorSpace setcolorspace\\n\"\n            \"<< /ImageType 1\\n\"\n            \"   /Width %d\\n\"\n            \"   /Height %d\\n\"\n            \"   /BitsPerComponent 8\\n\"\n            \"   /Decode [0 1]\\n\"\n            \"   /ImageMatrix [1 0 0 1 0 0]\\n\"\n            \"   /DataSource currentfile /ASCII85Decode\\n\"\n            \"       filter /RunLengthDecode filter\\n\"\n            \"   /Interpolate false >> image\\n\",\n            prn_rect.width(), prn_rect.height());\n    } \n  unsigned char *buffer;\n  GPBuffer<unsigned char> gbuffer(buffer,buffer_size);\n  unsigned char *rle_in;\n  GPBuffer<unsigned char> grle_in(rle_in,ps_chunk_height*prn_rect.width());\n  unsigned char *rle_out;\n  GPBuffer<unsigned char> grle_out(rle_out,2*ps_chunk_height*prn_rect.width());\n    {\n      // Start storing image in bands\n      unsigned char * rle_out_end = rle_out;\n      GRect grectBand = prn_rect;\n      grectBand.ymax = grectBand.ymin;\n      while(grectBand.ymax < prn_rect.ymax)\n        {\n          // Compute next band\n          grectBand.ymin = grectBand.ymax;\n          grectBand.ymax = grectBand.ymin+band_bytes/grectBand.width();\n          if (grectBand.ymax > prn_rect.ymax)\n            grectBand.ymax = prn_rect.ymax;\n          GRect all(0,0, dimg->get_width(),dimg->get_height());\n          pm = 0;\n          if (options.get_mode() == Options::FORE)\n            pm = dimg->get_fg_pixmap(grectBand, all);\n          else if (options.get_mode() == Options::BACK)\n            pm = dimg->get_bg_pixmap(grectBand, all);\n          else\n            pm = dimg->get_pixmap(grectBand, all);\n          // Store next band\n          unsigned char *buf_ptr = buffer;\n          if (do_color && pm)\n            {\n              int y=0;\n              while(y<grectBand.height())\n                {\n                  int row, y1;\n                  unsigned char *ptr, *ptr1;\n                  // Doing R component of current chunk\n                  for (row=0,ptr=rle_in,y1=y; \n                       row<ps_chunk_height && y1<grectBand.height(); \n                       row++,y1++)\n                    {\n                      GPixel *pix = (*pm)[y1];\n                      for (int x=grectBand.width(); x>0; x--,pix++)\n                        *ptr++ = ramp[pix->r];\n                    }\n                  ptr1 = RLE_encode(rle_out, rle_in, ptr); \n                  *ptr1++ = 0x80;\n                  buf_ptr = ASCII85_encode(buf_ptr, rle_out, ptr1);\n                  *buf_ptr++ = '~'; *buf_ptr++ = '>'; *buf_ptr++ = '\\n';\n                  // Doing G component of current chunk\n                  for (row=0,ptr=rle_in,y1=y; \n                       row<ps_chunk_height && y1<grectBand.height(); \n                       row++,y1++)\n                    {\n                      GPixel *pix = (*pm)[y1];\n                      for (int x=grectBand.width(); x>0; x--,pix++)\n                        *ptr++ = ramp[pix->g];\n                    }\n                  ptr1 = RLE_encode(rle_out, rle_in, ptr); \n                  *ptr1++ = 0x80;\n                  buf_ptr = ASCII85_encode(buf_ptr, rle_out, ptr1);\n                  *buf_ptr++ = '~'; \n                  *buf_ptr++ = '>'; \n                  *buf_ptr++ = '\\n';\n                  // Doing B component of current chunk\n                  for (row=0, ptr=rle_in, y1=y;\n                       row<ps_chunk_height && y1<grectBand.height(); \n                       row++,y1++)\n                    {\n                      GPixel *pix = (*pm)[y1];\n                      for (int x=grectBand.width(); x>0; x--,pix++)\n                        *ptr++ = ramp[pix->b];\n                    }\n                  ptr1 = RLE_encode(rle_out, rle_in, ptr);\n                  *ptr1++ = 0x80;\n                  buf_ptr = ASCII85_encode(buf_ptr, rle_out, ptr1);\n                  *buf_ptr++ = '~'; \n                  *buf_ptr++ = '>'; \n                  *buf_ptr++ = '\\n';\n                  y=y1;\n                  if (refresh_cb) \n                    refresh_cb(refresh_cl_data);\n                } //while (y>=0)\n            } \n          else if (pm)\n            {\n              // Don't use color\n              int y=0;\n              while(y<grectBand.height())\n                {\n                  unsigned char *ptr = rle_in;\n                  for(int row=0;\n                      row<ps_chunk_height && y<grectBand.height(); \n                      row++,y++)\n                    {\n                      GPixel *pix = (*pm)[y];\n                      for (int x=grectBand.width(); x>0; x--,pix++)\n                        *ptr++ = ramp[GRAY(pix->r,pix->g,pix->b)];\n                    }\n                  rle_out_end = RLE_encode(rle_out_end, rle_in, ptr);\n                  unsigned char *encode_to = rle_out \n                    + (rle_out_end-rle_out)/4*4;\n                  int bytes_left = rle_out_end-encode_to;\n                  buf_ptr = ASCII85_encode(buf_ptr, rle_out, encode_to);\n                  *buf_ptr++ = '\\n';\n                  memcpy(rle_out, encode_to, bytes_left);\n                  rle_out_end = rle_out+bytes_left;\n                  if (refresh_cb) \n                    refresh_cb(refresh_cl_data);\n                }\n              if (grectBand.ymax >= prn_rect.ymax)\n                {\n                  *rle_out_end++ = 0x80; // Add EOF marker\n                  buf_ptr = ASCII85_encode(buf_ptr, rle_out, rle_out_end);\n                  *buf_ptr++ = '~'; \n                  *buf_ptr++ = '>'; \n                  *buf_ptr++ = '\\n';\n                }\n            }\n          str.writall(buffer, buf_ptr-buffer);\n          if (prn_progress_cb)\n            {\n              double done=(double) (grectBand.ymax\n                                    - prn_rect.ymin)/prn_rect.height();\n              if ((int) (20*print_done)!=(int) (20*done))\n                {\n                  print_done=done;\n                  prn_progress_cb(done, prn_progress_cl_data);\n                }\n            }\n        }\n      write(str, \"\\n\");\n    } \n  write(str, \"grestore\\n\");\n}\n\nstatic void \nget_anno_sub(IFFByteStream &iff, IFFByteStream &out)\n{\n  GUTF8String chkid;\n  while (iff.get_chunk(chkid))\n    {\n      if (iff.composite())\n        get_anno_sub(iff, out);\n      else if (chkid == \"ANTa\" || chkid == \"ANTz\" ||\n               chkid == \"TXTa\" || chkid == \"TXTz\"   )\n        {\n          out.put_chunk(chkid);\n          out.copy(*iff.get_bytestream());\n          out.close_chunk();\n        }\n      iff.close_chunk();\n    }\n}\n\nstatic GP<ByteStream>\nget_anno(GP<DjVuFile> f)\n{\n  if (! f->anno) \n    {\n      GP<ByteStream> bs = f->get_init_data_pool()->get_stream();\n      GP<ByteStream> anno = ByteStream::create();\n      GP<IFFByteStream> in = IFFByteStream::create(bs);\n      GP<IFFByteStream> out = IFFByteStream::create(anno);\n      get_anno_sub(*in, *out);\n      f->anno = anno;\n    }\n  f->anno->seek(0);\n  return f->anno;\n}\n\nstatic GP<DjVuTXT>\nget_text(GP<DjVuFile> file)\n{ \n  GUTF8String chkid;\n  GP<IFFByteStream> iff = IFFByteStream::create(get_anno(file));\n  while (iff->get_chunk(chkid))\n    {\n      if (chkid == \"TXTa\") \n        {\n          GP<DjVuTXT> txt = DjVuTXT::create();\n          txt->decode(iff->get_bytestream());\n          return txt;\n        }\n      else if (chkid == \"TXTz\") \n        {\n          GP<DjVuTXT> txt = DjVuTXT::create();\n          GP<ByteStream> bsiff = BSByteStream::create(iff->get_bytestream());\n          txt->decode(bsiff);\n          return txt;\n        }\n      iff->close_chunk();\n    }\n  return 0;\n}\n\nstatic void\nprint_ps_string(const char *data, int length, ByteStream &out)\n{\n  while (*data && length>0) \n    {\n      int span = 0;\n      while (span<length && data[span]>=0x20 && data[span]<0x7f \n             && data[span]!='(' && data[span]!=')' && data[span]!='\\\\' )\n        span++;\n      if (span > 0) \n        {\n          out.write(data, span);\n          data += span;\n          length -= span;\n        }\n      else\n        {\n          char buffer[5];\n          sprintf(buffer,\"\\\\%03o\", *(unsigned char*)data);\n          out.write(buffer,4);\n          data += 1;\n          length -= 1;\n        }\n    }\n}\n\nstatic void\nprint_txt_sub(DjVuTXT &txt, DjVuTXT::Zone &zone, \n              ByteStream &out,int &lastx,int &lasty)\n{\n  // Get separator\n  char separator = 0;\n  switch(zone.ztype)\n    {\n    case DjVuTXT::COLUMN: \n      separator = DjVuTXT::end_of_column; break;\n    case DjVuTXT::REGION: \n      separator = DjVuTXT::end_of_region; break;\n    case DjVuTXT::PARAGRAPH: \n      separator = DjVuTXT::end_of_paragraph; break;\n    case DjVuTXT::LINE: \n      separator = DjVuTXT::end_of_line; break;\n    case DjVuTXT::WORD: \n      separator = ' '; break;\n    default:\n      separator = 0; break;\n    }\n  // Zone children\n  if (zone.children.isempty()) \n    {\n      const char *data = (const char*)txt.textUTF8 + zone.text_start;\n      int length = zone.text_length;\n      if (data[length-1] == separator)\n        length -= 1;\n      out.write(\"( \",2);\n      print_ps_string(data,length,out);\n      out.write(\")\",1);\n      GUTF8String message;\n      int tmpx= zone.rect.xmin-lastx;\n      int tmpy= zone.rect.ymin-lasty;\n      message.format(\" %d %d S \\n\", tmpx, tmpy);\n      lastx=zone.rect.xmin;\n      lasty=zone.rect.ymin;\n      out.write((const char*)message, message.length());\n    }\n  else\n    {\n      if (zone.ztype==DjVuTXT::LINE)\n        {\n          GUTF8String message;\n          message.format(\"%d F\\n\",zone.rect.ymax-zone.rect.ymin);\n          out.write((const char*)message,message.length());\n        }\n      for (GPosition pos=zone.children; pos; ++pos)\n        print_txt_sub(txt, zone.children[pos], out,lastx,lasty);\n    }\n}\n\nstatic void\nprint_txt(GP<DjVuTXT> txt, \n          ByteStream &out )\n{\n  if (txt)\n    {\n      int lastx=0;\n      int lasty=0;\n      GUTF8String message = \n        \"%% -- now doing hidden text\\n\"\n        \"gsave -1 -1 0 0 clip 0 0 moveto\\n\";\n      out.write((const char*)message,message.length());\n      print_txt_sub(*txt, txt->page_zone, out,lastx,lasty);\n      message = \n        \"grestore \\n\";\n      out.write((const char*)message,message.length());\n    }\n}\n\nvoid\nDjVuToPS::\nprint_image(ByteStream &str, \n            GP<DjVuImage> dimg,\n            const GRect &prn_rect, \n            GP<DjVuTXT> txt)\n{\n  /* Just outputs the specified image. The function assumes, that\n     all add-ons (like {\\em document setup}, {\\em page setup}) are\n     already there. It will just output the image. Since\n     output of this function will generate PostScript errors when\n     used without output of auxiliary functions, it should be\n     used carefully. */\n  DEBUG_MSG(\"DjVuToPS::print_image(): Printing DjVuImage to a stream\\n\");\n  DEBUG_MAKE_INDENT(3);\n  if (!dimg)\n    G_THROW(ERR_MSG(\"DjVuToPS.empty_image\"));\n  if (prn_rect.isempty())\n    G_THROW(ERR_MSG(\"DjVuToPS.empty_rect\"));\n  if (prn_progress_cb)\n    prn_progress_cb(0, prn_progress_cl_data);\n  // Compute information for chosen display mode\n  print_txt(txt, str);\n  make_gamma_ramp(dimg);\n  if (options.get_level() < 2)\n    {\n      print_image_lev1(str, dimg, prn_rect);\n    }\n  else if (options.get_level() < 3 && dimg->get_fgpm())\n    {\n      switch(options.get_mode())\n        {\n        case Options::COLOR:\n        case Options::FORE:\n          print_image_lev2(str, dimg, prn_rect);\n          break;\n        case Options::BW:\n          print_fg(str, dimg, prn_rect);\n          break;\n        case Options::BACK:\n          print_bg(str, dimg, prn_rect);\n          break;\n        }\n    }\n  else \n    {\n      switch(options.get_mode())\n        {\n        case Options::COLOR:\n          print_bg(str, dimg, prn_rect);\n          print_fg(str, dimg, prn_rect);\n          break;\n        case Options::FORE:\n        case Options::BW:\n          print_fg(str, dimg, prn_rect);\n          break;\n        case Options::BACK:\n          print_bg(str, dimg, prn_rect);\n          break;\n        }\n    }\n  if (prn_progress_cb)\n    prn_progress_cb(1, prn_progress_cl_data);\n}\n\n\n\n\n// ***********************************************************************\n// ******* PUBLIC FUNCTION FOR PRINTING A SINGLE PAGE ********************\n// ***********************************************************************\n\n\n\n\nvoid\nDjVuToPS::\nprint(ByteStream &str, \n      GP<DjVuImage> dimg,\n      const GRect &prn_rect_in, \n      const GRect &img_rect,\n      int override_dpi)\n{\n  DEBUG_MSG(\"DjVuToPS::print(): Printing DjVu page to a stream\\n\");\n  DEBUG_MAKE_INDENT(3);\n  GRect prn_rect;\n  prn_rect.intersect(prn_rect_in, img_rect);\n  DEBUG_MSG(\"prn_rect=(\" << prn_rect.xmin << \", \" << prn_rect.ymin << \", \" <<\n            prn_rect.width() << \", \" << prn_rect.height() << \")\\n\");\n  DEBUG_MSG(\"img_rect=(\" << img_rect.xmin << \", \" << img_rect.ymin << \", \" <<\n            img_rect.width() << \", \" << img_rect.height() << \")\\n\");\n  if (!dimg)\n    G_THROW(ERR_MSG(\"DjVuToPS.empty_image\"));\n  if (prn_rect.isempty())\n    G_THROW(ERR_MSG(\"DjVuToPS.empty_rect\"));\n  if (img_rect.isempty())\n    G_THROW(ERR_MSG(\"DjVuToPS.bad_scale\"));\n  GRectMapper mapper;\n  mapper.set_input(img_rect);\n  GRect full_rect(0, 0, dimg->get_width(), dimg->get_height());\n  mapper.set_output(full_rect);\n  mapper.map(prn_rect);\n  int image_dpi =  dimg->get_dpi();\n  if (override_dpi>0) \n    image_dpi = override_dpi;\n  if (image_dpi <= 0) \n    image_dpi = 300;\n  store_doc_prolog(str, 1, (int)(image_dpi), &prn_rect);\n  store_doc_setup(str);\n  write(str,\"%%%%Page: 1 1\\n\");\n  store_page_setup(str, (int)(image_dpi), prn_rect);\n  print_image(str, dimg, prn_rect, 0);\n  store_page_trailer(str);\n  write(str,\"showpage\\n\");\n  store_doc_trailer(str);\n}\n\n\n\n\n// ***********************************************************************\n// *************************** DOCUMENT LEVEL ****************************\n// ***********************************************************************\n\n\nvoid\nDjVuToPS::\nparse_range(GP<DjVuDocument> doc, \n             GUTF8String page_range, \n             GList<int> &pages_todo)\n{\n  int doc_pages = doc->get_pages_num();\n  if (!page_range.length())\n    page_range.format(\"1-%d\", doc_pages);\n  DEBUG_MSG(\"page_range='\" << (const char *)page_range << \"'\\n\");\n  int spec = 0;\n  int both = 1;\n  int start_page = 1;\n  int end_page = doc_pages;\n  const char *q = (const char*)page_range;\n  char *p = (char*)q;\n  while (*p)\n    {\n      while (*p==' ')\n        p += 1;\n      if (! *p)\n        break;\n      if (*p>='0' && *p<='9') \n        {\n          end_page = strtol(p, &p, 10);\n          spec = 1;\n        } \n      else if (*p=='$') \n        {\n          spec = 1;\n          end_page = doc_pages;\n          p += 1;\n        } \n      else if (both) \n        {\n          end_page = 1;\n        } \n      else \n        {\n          end_page = doc_pages;\n        }\n      while (*p==' ')\n        p += 1;\n      if (both)\n        {\n          start_page = end_page;\n          if (*p == '-') \n            {\n              p += 1;\n              both = 0;\n              continue;\n            }\n        }\n      both = 1;\n      while (*p==' ')\n        p += 1;\n      if (*p && *p != ',')\n        G_THROW(ERR_MSG(\"DjVuToPS.bad_range\") \n                + GUTF8String(\"\\t\") + GUTF8String(p) );\n      if (*p == ',')\n        p += 1;\n      if (! spec)\n        G_THROW(ERR_MSG(\"DjVuToPS.bad_range\") \n                + GUTF8String(\"\\t\") + page_range );\n      spec = 0;\n      if (end_page < 0)\n        end_page = 0;\n      if (start_page < 0)\n        start_page = 0;\n      if (end_page > doc_pages)\n        end_page = doc_pages;\n      if (start_page > doc_pages)\n        start_page = doc_pages;\n      if (start_page <= end_page)\n        for(int page_num=start_page; page_num<=end_page; page_num++)\n          pages_todo.append(page_num-1);\n      else\n        for(int page_num=start_page; page_num>=end_page; page_num--)\n          pages_todo.append(page_num-1);\n    }\n}\n\nclass DjVuToPS::DecodePort : public DjVuPort\n{\nprotected:\n  DecodePort(void);\npublic:\n  static GP<DecodePort> create(void);\n  GEvent decode_event;\n  bool decode_event_received;\n  double decode_done;\n  GURL decode_page_url;\n  virtual void notify_file_flags_changed(const DjVuFile*,long,long);\n  virtual void notify_decode_progress(const DjVuPort*,double);\n};\n\nDjVuToPS::DecodePort::\nDecodePort(void)\n  : decode_event_received(false),\n    decode_done((double)0) \n{\n}\n\nGP<DjVuToPS::DecodePort> \nDjVuToPS::DecodePort::\ncreate(void)\n{\n  return new DecodePort;\n}\n\nvoid \nDjVuToPS::DecodePort::\nnotify_file_flags_changed(const DjVuFile *source, \n                          long set_mask, long clr_mask)\n{\n  // WARNING! This function is called from another thread\n  if (set_mask & (DjVuFile::DECODE_OK | \n                  DjVuFile::DECODE_FAILED | \n                  DjVuFile::DECODE_STOPPED ))\n    {\n      if (source->get_url() == decode_page_url)\n        {\n          decode_event_received=true;\n          decode_event.set();\n        }\n    }\n}\n\nvoid \nDjVuToPS::DecodePort::\nnotify_decode_progress(const DjVuPort *source, double done)\n{\n  // WARNING! This function is called from another thread\n  if (source->inherits(\"DjVuFile\"))\n    {\n      DjVuFile * file=(DjVuFile *) source;\n      if (file->get_url()==decode_page_url)\n        if ((int) (decode_done*20)!=(int) (done*20))\n          {\n            decode_done=done;\n            decode_event_received=true;\n            decode_event.set();\n          }\n    }\n}\n\nvoid \nDjVuToPS::\nset_refresh_cb(void (*_refresh_cb)(void*), void *_refresh_cl_data)\n{\n  refresh_cb = _refresh_cb;\n  refresh_cl_data = _refresh_cl_data;\n}\n\nvoid \nDjVuToPS::\nset_prn_progress_cb(void (*_prn_progress_cb)(double, void *),\n                    void *_prn_progress_cl_data)\n{\n  prn_progress_cb=_prn_progress_cb;\n  prn_progress_cl_data=_prn_progress_cl_data;\n}\n\nvoid \nDjVuToPS::\nset_dec_progress_cb(void (*_dec_progress_cb)(double, void *),\n                    void *_dec_progress_cl_data)\n{\n  dec_progress_cb=_dec_progress_cb;\n  dec_progress_cl_data=_dec_progress_cl_data;\n}\n\nvoid \nDjVuToPS::\nset_info_cb(void (*_info_cb)(int, int, int, Stage, void*),\n            void *_info_cl_data)\n{\n  info_cb=_info_cb;\n  info_cl_data=_info_cl_data;\n}\n\nGP<DjVuImage>\nDjVuToPS::\ndecode_page(GP<DjVuDocument> doc, \n            int page_num, int cnt, int todo)\n{\n  DEBUG_MSG(\"processing page #\" << page_num << \"\\n\");\n  if (! port)\n    {\n      port = DecodePort::create();\n      DjVuPort::get_portcaster()->add_route((DjVuDocument*)doc, port);\n    }\n  port->decode_event_received = false;\n  port->decode_done = 0;\n  GP<DjVuFile> djvu_file;\n  GP<DjVuImage> dimg;\n  if (page_num >= 0 && page_num < doc->get_pages_num())\n    djvu_file = doc->get_djvu_file(page_num);\n  if (! djvu_file )\n    return 0;\n  if (djvu_file->is_decode_ok())\n    return doc->get_page(page_num, false);\n  // This is the best place to call info_cb(). Note, that\n  // get_page() will start decoding if necessary, and will not\n  // return until the decoding is over in a single threaded\n  // environment. That's why we call get_djvu_file() first.\n  if (info_cb)\n    info_cb(page_num, cnt, todo, DECODING, info_cl_data);\n  // Do NOT decode the page synchronously here!!!\n  // The plugin will deadlock otherwise.\n  dimg = doc->get_page(page_num, false);\n  djvu_file = dimg->get_djvu_file();\n  port->decode_page_url = djvu_file->get_url();\n  if (djvu_file->is_decode_ok())\n    return dimg;\n  DEBUG_MSG(\"decoding\\n\");\n  if (dec_progress_cb)\n    dec_progress_cb(0, dec_progress_cl_data);\n  while(! djvu_file->is_decode_ok())\n    {\n      while(!port->decode_event_received && \n            !djvu_file->is_decode_ok())\n        {\n          port->decode_event.wait(250);\n          if (refresh_cb) \n            refresh_cb(refresh_cl_data);\n        }\n      port->decode_event_received = false;\n      if (djvu_file->is_decode_failed() || \n          djvu_file->is_decode_stopped())\n        G_THROW(ERR_MSG(\"DjVuToPS.no_image\") \n                + GUTF8String(\"\\t\") \n                + GUTF8String(page_num));\n      if (dec_progress_cb)\n        dec_progress_cb(port->decode_done, dec_progress_cl_data);\n    }\n  if (dec_progress_cb)\n    dec_progress_cb(1, dec_progress_cl_data);\n  return dimg;\n}\n\nvoid\nDjVuToPS::\nprocess_single_page(ByteStream &str, \n                    GP<DjVuDocument> doc,\n                    int page_num, int cnt, int todo,\n                    int magic)\n{\n  GP<DjVuTXT> txt;\n  GP<DjVuImage> dimg;\n  dimg = decode_page(doc, page_num, cnt, todo);\n  if (options.get_text())\n    txt = get_text(dimg->get_djvu_file());\n  if (info_cb)\n    info_cb(page_num, cnt, todo, PRINTING, info_cl_data);\n  if (!magic)\n    write(str, \"%%%%Page: %d %d\\n\", page_num+1, cnt+1);\n  if (dimg)\n    {\n      int dpi = dimg->get_dpi();\n      dpi = ((dpi <= 0) ? 300 : dpi);\n      GRect img_rect(0, 0, dimg->get_width(), dimg->get_height());\n      store_page_setup(str, dpi, img_rect, magic);\n      print_image(str, dimg, img_rect,txt);\n      store_page_trailer(str);\n    }\n  if (!magic)\n    write(str,\"showpage\\n\");\n}\n\n\nstruct pdata {\n  int page1, page2;\n  int smax, spos;\n  int offset;\n};\n\nvoid \nDjVuToPS::\nprocess_double_page(ByteStream &str, \n                    GP<DjVuDocument> doc,\n                    void *v, int cnt, int todo)\n{\n  const pdata *inf = (const pdata*)v;\n  int off = abs(inf->offset);\n  write(str,\n        \"%%%%Page: (%d,%d) %d\\n\"\n        \"gsave\\n\"\n        \"/fold-dict 8 dict dup 3 1 roll def begin\\n\"\n        \" clippath pathbbox newpath pop pop translate\\n\"\n        \" clippath pathbbox newpath 4 2 roll pop pop\\n\"\n        \" /ph exch def\\n\"\n        \" /pw exch def\\n\"\n        \" /w ph %d sub 2 div def\\n\"\n        \" /m1 %d def\\n\"\n        \" /m2 %d def\\n\"\n        \"end\\n\",\n        inf->page1 + 1, inf->page2 + 1, cnt,\n        2 * (off + options.get_bookletfold(inf->smax-1)),\n        inf->offset + options.get_bookletfold(inf->spos),\n        inf->offset - options.get_bookletfold(inf->spos));\n  if (options.get_cropmarks())\n    write(str,\n          \"%% -- folding marks\\n\"\n          \"fold-dict begin\\n\"\n          \" 0 setgray 0.5 setlinewidth\\n\"\n          \" ph m1 m2 add add 2 div dup\\n\"\n          \" 0 exch moveto 36 0 rlineto stroke\\n\"\n          \" pw exch moveto -36 0 rlineto stroke\\n\"\n          \"end\\n\");\n  write(str,\n        \"%% -- first page\\n\"\n        \"gsave fold-dict begin\\n\"\n        \" 0 ph 2 div w add m1 add translate 270 rotate\\n\"\n        \" 0 0 w pw rectclip end\\n\");\n  if (inf->page1 >= 0)\n    process_single_page(str, doc, inf->page1, cnt*2, todo*2, +1);\n  write(str,\n        \"grestore\\n\"\n        \"%% -- second page\\n\"\n        \"gsave fold-dict begin\\n\"\n        \" 0 ph 2 div m2 add translate 270 rotate\\n\"\n        \" 0 0 w pw rectclip end\\n\");\n  if (inf->page2 >= 0)\n    process_single_page(str, doc, inf->page2, cnt*2+1, todo*2, -1);\n  write(str,\n        \"grestore\\n\"\n        \"grestore\\n\"\n        \"showpage\\n\");\n}\n\nstatic void\nbooklet_order(GList<int>& pages, int smax)\n{\n  // -- make a multiple of four\n  while (pages.size() & 0x3)\n    pages.append(-1);\n  // -- copy to array\n  int i = 0;\n  int n = pages.size();\n  GTArray<int> p(0,n-1);\n  for (GPosition pos=pages; pos; ++pos)\n    p[i++] = pages[pos];\n  // -- rebuild\n  pages.empty();\n  for (i=0; i<n; i+=smax)\n    {\n      int lo = i;\n      int hi = i+smax-1;\n      if (hi >= n)\n        hi = n-1;\n      while (lo < hi)\n        {\n          pages.append(p[hi--]);\n          pages.append(p[lo++]);\n          pages.append(p[lo++]);\n          pages.append(p[hi--]);\n        }\n    }\n}\n\n\n// ***********************************************************************\n// ******* PUBLIC FUNCTIONS FOR PRINTING MULTIPLE PAGES ******************\n// ***********************************************************************\n\n\n\nvoid\nDjVuToPS::\nprint(ByteStream &str, \n      GP<DjVuDocument> doc, \n      GUTF8String page_range)\n{\n  DEBUG_MSG(\"DjVuToPS::print(): Printing DjVu document\\n\");\n  DEBUG_MAKE_INDENT(3);\n  // Get page range\n  GList<int> pages_todo;\n  parse_range(doc, page_range, pages_todo);\n  int todo = pages_todo.size();\n  if (options.get_format()==Options::EPS)\n    {\n      /* Encapsulated Postscript mode */\n      if (todo != 1)\n        G_THROW(ERR_MSG(\"DjVuToPS.only_one_page\"));\n      GPosition pos = pages_todo;\n      int page_num = pages_todo[pos];\n      GP<DjVuImage> dimg = decode_page(doc,page_num,0,todo);\n      if (! dimg)\n        G_THROW(ERR_MSG(\"DjVuToPS.no_image\") + GUTF8String(\"\\t1\"));\n      GRect bbox(0, 0, dimg->get_width(), dimg->get_height());\n      store_doc_prolog(str, 1, dimg->get_dpi(), &bbox);\n      store_doc_setup(str);\n      process_single_page(str, doc, page_num, 0, todo, 0);\n    }\n  else if (options.get_bookletmode()==Options::OFF)\n    {\n      /* Normal mode */\n      int cnt = 0;\n      store_doc_prolog(str, todo, 0, 0);\n      store_doc_setup(str);\n      for(GPosition pos = pages_todo; pos; ++pos)\n        process_single_page(str,doc,pages_todo[pos],cnt++,todo,0);\n      store_doc_trailer(str);\n    }\n  else\n    {\n      /* Booklet mode */\n      int sheets_left = (todo+3)/4;\n      int sides_todo = sheets_left;\n      if (options.get_bookletmode() == Options::RECTOVERSO)\n        sides_todo *= 2;\n      int sheets_max = (options.get_bookletmax()+3)/4;\n      if (! sheets_max)\n        sheets_max = sheets_left;\n      // -- reorder pages\n      booklet_order(pages_todo, sheets_max*4);\n      // -- print\n      int sides = 0;\n      int sheetpos = sheets_max;\n      store_doc_prolog(str, sides_todo, 0, 0);\n      store_doc_setup(str);\n      for (GPosition p=pages_todo; p; ++p)\n        {\n          struct pdata inf;\n          inf.page1 = pages_todo[p]; \n          inf.page2 = pages_todo[++p]; \n          inf.smax = sheets_max;\n          inf.spos = --sheetpos;\n          inf.offset = options.get_bookletalign();\n          if (options.get_bookletmode() != Options::VERSO)\n            process_double_page(str,doc,(void*)&inf,sides++,sides_todo);\n          inf.page1 = pages_todo[++p]; \n          inf.page2 = pages_todo[++p]; \n          inf.offset = -inf.offset;\n          if (options.get_bookletmode() != Options::RECTO)\n            process_double_page(str,doc,(void*)&inf,sides++,sides_todo);\n          sheets_left -= 1;\n          if (sheetpos <= 0)\n            sheetpos = ((sheets_max<sheets_left) ? sheets_max : sheets_left);\n        }\n      store_doc_trailer(str);\n    }\n}\n\n\nvoid\nDjVuToPS::\nprint(ByteStream &str, GP<DjVuDocument> doc)\n{\n  GUTF8String dummy;\n  print(str,doc,dummy);\n}\n\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/DjVuToPS.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _DJVU_TO_PS_H_\n#define _DJVU_TO_PS_H_\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n/** @name DjVuToPS.h\n    Files #\"DjVuToPS.h\"# and #\"DjVuToPS.cpp\"# implement code that can be\n    used to convert a \\Ref{DjVuImage} or \\Ref{DjVuDocument} to PostScript\n    format. The conversion is carried out by the \\Ref{DjVuToPS} class.\n    \n    @memo PostScript file generator\n    @author Andrei Erofeev <eaf@geocities.com> \\\\\n            Florin Nicsa <Florin.Nicsa@insa-lyon.fr>\n*/\n//@{\n\n#include \"DjVuGlobal.h\"\n#include \"GRect.h\"\n#include \"DjVuDocument.h\"\n#include \"DjVuText.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n/** DjVuImage to PostScript converter.\n    Use this class to print \\Ref{DjVuImage}s and \\Ref{DjVuDocument}s.\n    The behavior is customizable. See \\Ref{DjVuToPS::Options} for the\n    description of available options.*/\nclass DjVuToPS\n{\npublic:\n  class DecodePort;\n\n  /** DjVuToPS options. Use this class to customize the way\n      in which DjVu to PS conversion will be done. You can adjust\n      the following things:\n          \\begin{description}\n             \\item[Format] ({\\em EPS} or {\\em PS}). Use the {\\em EPS}\n                format if you plan to embed the output image into another\n                document. Print {\\em PS} otherwise.\n             \\item[Language level] ({\\em 1} or {\\em 2}). Any PostScript\n                printer or interpreter should understand PostScript Level 1\n                files. Unfortunately we cannot efficiently compress and encode\n                data when generating Level 1 files. PostScript Level 2 allows\n                to employ an RLE compression and ASCII85 encoding scheme,\n                which makes output files significantly smaller. Most of\n                the printers and word processors nowadays support PostScript\n                Level 2.\n             \\item[Orientation] ({\\em PORTRAIT} or {\\em LANDSCAPE})\n             \\item[Zoom factor] ({\\em FIT_PAGE} or {\\em ONE_TO_ONE}).\n                {\\em ONE_TO_ONE} mode is useful, if you want the output to\n                be of the same size as the original image (before compression).\n                This requires that the #dpi# setting inside the \\Ref{DjVuImage}\n                is correct. In most of the cases the {\\em FIT_PAGE} zoom is\n                would be your best choice.\n             \\item[Mode] ({\\em COLOR}, {\\em FORE}, {\\em BACK}, or {\\em BW})\n                Specifies how the \\Ref{DjVuImage}s will be rendered (all layers,\n                foreground layer, background layer, and the mask respectively)\n             \\item[Color] ({\\em TRUE} or {\\em FALSE}). Choosing {\\em FALSE}\n                converts color images to gray scale.\n             \\item[Gamma] Printer color correction. \n                This parameter ranges from #0.3# to #5.0#. \n             \\item[sRGB] ({\\em TRUE} or {\\em FALSE}).  Choosing {\\em TRUE}\n                enables accurate sRGB color calibration.  This option\n                only works with language level 2.  When this is set,\n                gamma correction is clamped to #2.2#.\n             \\item[Number of copies] Specifies how many copies should be\n                printed. This does {\\bf not} affect the size of the output file.\n          \\end{description}\n  */\n  class Options\n  {\n  public:\n    /** Specifies the rendering mode */\n    enum Mode { COLOR, FORE, BACK, BW };\n    /** Selects the output format */\n    enum Format { PS, EPS };\n    /** Specifies the orientation of the output image */\n    enum Orientation { PORTRAIT, LANDSCAPE, AUTO };\n    /** Specifies the booklet mode */\n    enum BookletMode { OFF, RECTO, VERSO, RECTOVERSO };\n  private:\n    Format format;\n    int level;\n    Orientation orientation;\n    Mode mode;\n    int zoom;\n    bool color;\n    bool calibrate;\n    bool text;\n    double gamma;\n    int copies;\n    bool frame;\n    bool cropmarks;\n    BookletMode bookletmode;\n    int bookletmax;\n    int bookletalign;\n    int bookletfold;\n    int bookletxfold;\n  public:\n    /** Sets output image format to #PS# or #EPS# */\n    void set_format(Format format);\n    /** Sets PostScript level (#1#, #2#, or #3#) */\n    void set_level(int level);\n    /** Sets orientation (#LANDSCAPE# or #PORTRAIT#) */\n    void set_orientation(Orientation orientation);\n    /** Sets \\Ref{DjVuImage} rendering mode (#COLOR#, #BW#, #FORE#, #BACK#) */\n    void set_mode(Mode mode);\n    /** Sets zoom factor. Zoom 0 means fit page. */\n    void set_zoom(int zoom);\n    /** Affects automatic conversion to GreyScale mode. */\n    void set_color(bool color);\n    /** Sets gamma correction factor. Ranges from #0.3# to #5.0#. */    \n    void set_gamma(double gamma);\n    /** Sets sRGB color calibration flag. */\n    void set_sRGB(bool calibrate);\n    /** Specifies the number of copies to be printed. */\n    void set_copies(int copies);\n    /** Specifies if a gray frame around the image should be printed. */\n    void set_frame(bool on);\n    /** Specifies if crop marks should be printed. */\n    void set_cropmarks(bool on);\n    /** Specifies if a shadow text should be printed. */\n    void set_text(bool on);\n    /** Specifies the bookletmode */\n    void set_bookletmode(BookletMode m);\n    /** Specifies the maximal number of pages in a booklet */\n    void set_bookletmax(int m);\n    /** Specifies an offset (points) between \n        booklet recto(s) and verso(s). */\n    void set_bookletalign(int m);\n    /** Specifies the margin (points) required to fold \n        the booklet (#fold# in points) and the margin \n        increase required for each sheet (#xfold# in millipoints). */\n    void set_bookletfold(int fold, int xfold=0);\n\n    /** Returns output image format (#PS# or #EPS#) */\n    Format get_format(void) const {\n      return format; }\n    /** Returns PostScript level (#1# or #2#) */\n    int get_level(void) const {\n      return level; }\n    /** Returns output image orientation (#PORTRAIT# or #LANDSCAPE#) */\n    Orientation get_orientation(void) const {\n      return orientation; }\n    /** Returns \\Ref{DjVuImage} rendering mode \n        (#COLOR#, #FORE#, #BACK#, #BW#) */\n    Mode get_mode(void) const {\n      return mode; }\n    /** Returns output zoom factor (#FIT_PAGE# or #ONE_TO_ONE#) */\n    int get_zoom(void) const {\n      return zoom; }\n    /** Returns color printing flag. */\n    bool get_color(void) const {\n      return color; }\n    /** Returns sRGB color calibration flag. */\n    bool get_sRGB(void) const {\n      return calibrate; }\n    /** Returns printer gamma correction factor */\n    double get_gamma(void) const {\n      return ((calibrate) ? ((double)2.2) : gamma); }\n    /** Returns the number of copies, which will be printed by printer\n        This parameter does {\\bf not} affect the size of output file */\n    int get_copies(void) const {\n      return copies; }\n    /** Returns #TRUE# if there will be a gray frame */\n    bool get_frame(void) const {\n      return frame; }\n    /** Returns #TRUE# if there will be a gray frame */\n    bool get_cropmarks(void) const {\n      return cropmarks; }\n    /** Returns #TRUE# if there will be a shadow text printed */\n    bool get_text(void) const {\n      return text; }\n    /** Returns the booklet mode */\n    BookletMode get_bookletmode(void) const {\n      return bookletmode; }\n    /** Returns the booklet max size */\n    int get_bookletmax(void) {\n      return bookletmax; }\n    /** Returns the booklet recto/verso offset */\n    int get_bookletalign(void) {\n      return bookletalign; }\n    /** Returns the folding margin for sheet number #n#. */\n    int get_bookletfold(int n=0) {\n      return bookletfold + (n*bookletxfold+500)/1000; }\n    /* Constructor */\n    Options(void);\n  };\n  \n  /** Describes current page processing stage. This is passed to\n      the #info_cb()# callback. See \\Ref{set_info_cb}() for details. */\n  enum Stage { DECODING, PRINTING };\n  \nprivate:\n  void (*refresh_cb)(void*);\n  void  *refresh_cl_data;\n  void (*prn_progress_cb)(double, void*);\n  void  *prn_progress_cl_data;\n  void (*dec_progress_cb)(double, void*);\n  void  *dec_progress_cl_data;\n  void (*info_cb)(int,int,int,Stage,void*);\n  void  *info_cl_data;\n  unsigned char ramp[256];\n  GP<DecodePort> port;\nprotected:\n  void store_doc_prolog(ByteStream&,int,int,GRect*);\n  void store_doc_setup(ByteStream&);\n  void store_doc_trailer(ByteStream&);\n  void store_page_setup(ByteStream&,int,const GRect&,int align=0);\n  void store_page_trailer(ByteStream&);\n  void make_gamma_ramp(GP<DjVuImage>);\n  void print_image_lev1(ByteStream&,GP<DjVuImage>,const GRect&);\n  void print_image_lev2(ByteStream&,GP<DjVuImage>,const GRect&);\n  void print_bg(ByteStream&,GP<DjVuImage>,const GRect&);\n  void print_fg_3layer(ByteStream&,GP<DjVuImage>,const GRect&,unsigned char*);\n  void print_fg_2layer(ByteStream&,GP<DjVuImage>,const GRect&,unsigned char*);\n  void print_fg(ByteStream&,GP<DjVuImage>,const GRect&);\n  void print_image(ByteStream&,GP<DjVuImage>,const GRect&,GP<DjVuTXT>);\n  void parse_range(GP<DjVuDocument>,GUTF8String,GList<int>&);\n  GP<DjVuImage> decode_page(GP<DjVuDocument>,int,int,int);\n  void process_single_page(ByteStream&,GP<DjVuDocument>,int,int,int,int);\n  void process_double_page(ByteStream&,GP<DjVuDocument>,void*,int,int);\n  \npublic:\n  /** Options affecting the print result. Please refer to\n      \\Ref{DjVuToPS::Options} for details. */\n  Options options;\n  \n  /** @name Callbacks */\n  //@{\n  /** Refresh callback is a function, which will be called fairly\n      often while the image (document) is being printed. It can\n      be used to refresh a GUI, if necessary.\n      \n      @param refresh_cb Callback function to be called periodically\n      @param refresh_cl_data Pointer passed to #refresh_cb()# */\n   void set_refresh_cb(void (*refresh_cb)(void*), void *refresh_cl_data);\n  /** Callback used to report the progress of printing.  The progress is a\n      double number from 0 to 1.  If an existing \\Ref{DjVuImage} is printed,\n      this callback will be called at least twice: in the beginning and at the\n      end of printing.  If a \\Ref{DjVuDocument} is being printed, this\n      callback will be used to report printing progress of every page. To\n      learn the number of the page being printed you can use\n      \\Ref{set_info_cb}() function.  See \\Ref{set_dec_progress_cb}() to find\n      out how to learn the decoding progress.\n      \n      @param cb Callback function to be called\n      @param data Pointer passed to #cb()#. */\n  void set_prn_progress_cb(void (*cb)(double, void*), void *data);\n  /** Callback used to report the progress of decoding.  The progress is a\n      double number from 0 to 1.  This callback is only used when printing a\n      \\Ref{DjVuDocument} in a multithreaded environment. In all other cases it\n      will not be called.  Whenever you \\Ref{print}() a page range from a\n      \\Ref{DjVuDocument}, the #DjVuToPS# has to decode the mentioned pages\n      before writing them to the output \\Ref{ByteStream}. This callback can be\n      helpful to find out the status of the decoding.  See\n      \\Ref{set_prn_progress_cb}() to find out how to learn the printing\n      progress.  See \\Ref{set_info_cb}() to learn how to find out the number\n      of the page being processed, the total number of pages and the number of\n      processed pages.\n          \n      @param cb Callback function to be called\n      @param data Pointer passed to #cb()#. */\n  void set_dec_progress_cb(void (*cb)(double, void*), void *data);\n  /** Callback used to report the current printing stage of a\n      \\Ref{DjVuDocument}.  When printing a \\Ref{DjVuDocument} ({\\bf not} a\n      \\Ref{DjVuImage}), the #DjVuToPS# class will decode and output every page\n      mentioned in the {\\em page range}. Before decoding and outputing, it\n      will call this #info_cb()# callback in order to let you know about what\n      is going on. This can be quite useful in a GUI program to keep the user\n      informed.  This function is not called when you print a \\Ref{DjVuImage}.\n\n      Description of the arguments passed to #info_cb#:\n      \\begin{description}\n      \\item[page_num] The number of the page being processed\n      \\item[page_cnt] Counts how many pages have already been processed.\n      \\item[tot_pages] Counts how many pages will be output enventually.\n      \\item[stage] Describes the current processing stage \n                   (#DECODING# or #PRINTING#).\n      \\end{description}\n      @param cb Callback function to be called\n      @param data Pointer, which will be passed to #cb()#. */\n  void set_info_cb(void (*cb)(int,int,int,Stage,void*), void *data);\n  //@}\n  \n  /** Prints the specified \\Ref{DjVuImage} #dimg# into the\n      \\Ref{ByteStream} #str#. The function will first scale\n      the image to fit the #img_rect#, then extract #prn_rect#\n      from the obtained bitmap and will output it in the\n      PostScript format. The function generates a legal PostScript\n      (or Encapsulated PostScript) file taking care of all comments\n      conforming to Document Structure Conventions v. 3.0.\n      \n      {\\bf Warning:} The zoom factor specified in \\Ref{Options} does\n      not affect the amount of data stored into the PostScript file.\n      It will be used by the PostScript code to additionally scale\n      the image. We cannot pre-scale it here, because we do not know\n      the future resolution of the printer. The #img_rect# and\n      #prn_rect# alone define how much data will be sent to printer.\n      \n      Using #img_rect# one can upsample or downsample the image prior\n      to sending it to the printer.\n      \n      @param str \\Ref{ByteStream} where PostScript output will be sent\n      @param dimg \\Ref{DjVuImage} to print\n      @param img_rect Rectangle to which the \\Ref{DjVuImage} will be scaled.\n             Note that this parameters defines the amount of data\n             that will actually be sent to the printer. The PostScript\n             code can futher resize the image according to the\n             #zoom# parameter from the \\Ref{Options} structure.\n      @param prn_rect Part of img_rect to send to printer.\n      @param override_dpi Optional parameter allowing you to override\n             dpi setting that would otherwise be extracted from #dimg# */\n   void print(ByteStream&, GP<DjVuImage> dimg,\n              const GRect &prn_rect, const GRect &img_rect,\n              int override_dpi=-1 );\n  \n  /** Outputs the specifies pages from the \\Ref{DjVuDocument} into the\n      \\Ref{ByteStream} in PostScript format.  The function will generate a\n      multipage PostScript document conforming to PS DSC 3.0 by storing into\n      it every page mentioned in the #page_range#.\n\n      If #page_range# is empty, all pages from the \\Ref{DjVuDocument} #doc#\n      will be printed.  The #page_range# is a set of ranges separated by\n      commas. Every range has this form: {\\em start_page}[-{\\em\n      end_page}]. {\\em end_page} is optional and can be less than the {\\em\n      start_page}, in which case the pages will be printed in the reverse\n      order.\n\n      Examples:\n      \\begin{itemize}\n      \\item {\\bf 1-10} - Will print pages 1 to 10.\n      \\item {\\bf 10-1} - Will print pages 1 to 10 in reverse order.\n      \\item {\\bf 1-10,12-20} - Will print pages 1 to 20 with page 11 skipped.\n      \\end{itemize} */\n  void print(ByteStream&, GP<DjVuDocument> doc, GUTF8String page_range);\n  void print(ByteStream&, GP<DjVuDocument> doc);\n \n  \n  /** Default constructor. Initializes the class. */\n  DjVuToPS(void);\n};\n\n\n//****************************************************************************\n//******************************** DjVuToPS **********************************\n//****************************************************************************\n\n//@}\n// ------------\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/GBitmap.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"GBitmap.h\"\n#include \"ByteStream.h\"\n#include \"GRect.h\"\n#include \"GString.h\"\n#include \"GThreads.h\"\n#include \"GException.h\"\n#include <stddef.h>\n#include <stdlib.h>\n#include <string.h>\n\n// - Author: Leon Bottou, 05/1997\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n// ----- constructor and destructor\n\nGBitmap::~GBitmap()\n{\n}\n\nvoid\nGBitmap::destroy(void)\n{\n  gbytes_data.resize(0);\n  bytes = 0;\n  grle.resize(0);\n  grlerows.resize(0);\n  rlelength = 0;\n}\n\nGBitmap::GBitmap()\n  : nrows(0), ncolumns(0), border(0), \n    bytes_per_row(0), grays(0), bytes(0), gbytes_data(bytes_data), \n    grle(rle), grlerows(rlerows), rlelength(0),\n    monitorptr(0)\n{\n}\n\nGBitmap::GBitmap(int nrows, int ncolumns, int border)\n  : nrows(0), ncolumns(0), border(0), \n    bytes_per_row(0), grays(0), bytes(0), gbytes_data(bytes_data), \n    grle(rle), grlerows(rlerows), rlelength(0),\n    monitorptr(0)\n{\n  G_TRY\n  { \n    init(nrows, ncolumns, border);\n  }\n  G_CATCH_ALL\n  {\n    destroy();\n    G_RETHROW;\n  }\n  G_ENDCATCH;\n}\n\nGBitmap::GBitmap(ByteStream &ref, int border)\n  : nrows(0), ncolumns(0), border(0), \n    bytes_per_row(0), grays(0), bytes(0), gbytes_data(bytes_data),\n    grle(rle), grlerows(rlerows), rlelength(0),\n    monitorptr(0)\n{\n  G_TRY\n  { \n    init(ref, border);\n  }\n  G_CATCH_ALL\n  {\n    destroy();\n    G_RETHROW;\n  }\n  G_ENDCATCH;\n}\n\nGBitmap::GBitmap(const GBitmap &ref)\n  : nrows(0), ncolumns(0), border(0), \n    bytes_per_row(0), grays(0), bytes(0), gbytes_data(bytes_data), \n    grle(rle), grlerows(rlerows), rlelength(0),\n    monitorptr(0)\n{\n  G_TRY\n  { \n    init(ref, ref.border);\n  }\n  G_CATCH_ALL\n  {\n    destroy();\n    G_RETHROW;\n  }\n  G_ENDCATCH;\n}\n\nGBitmap::GBitmap(const GBitmap &ref, int border)\n  : nrows(0), ncolumns(0), border(0), \n    bytes_per_row(0), grays(0), bytes(0), gbytes_data(bytes_data),\n    grle(rle), grlerows(rlerows), rlelength(0),\n    monitorptr(0)\n{\n  G_TRY\n  { \n    init(ref, border);\n  }\n  G_CATCH_ALL\n  {\n    destroy();\n    G_RETHROW;\n  }\n  G_ENDCATCH;\n}\n\n\nGBitmap::GBitmap(const GBitmap &ref, const GRect &rect, int border)\n  : nrows(0), ncolumns(0), border(0), \n    bytes_per_row(0), grays(0), bytes(0), gbytes_data(bytes_data),\n    grle(rle), grlerows(rlerows), rlelength(0),\n    monitorptr(0)\n{\n  G_TRY\n  { \n    init(ref, rect, border);\n  }\n  G_CATCH_ALL\n  {\n    destroy();\n    G_RETHROW;\n  }\n  G_ENDCATCH;\n}\n\n\n\n\n\n\n// ----- initialization\n\nvoid \nGBitmap::init(int arows, int acolumns, int aborder)\n{\n  if (arows != (unsigned short) arows ||\n      acolumns != (unsigned short) acolumns ||\n      acolumns + aborder != (unsigned short)(acolumns + aborder))\n    G_THROW(\"Illegal arguments\");\n  GMonitorLock lock(monitor());\n  destroy();\n  grays = 2;\n  nrows = arows;\n  ncolumns = acolumns;\n  border = aborder;\n  bytes_per_row = ncolumns + border;\n  int npixels = nrows * bytes_per_row + border;\n  gzerobuffer=zeroes(bytes_per_row + border);\n  if (npixels > 0) \n    {\n      gbytes_data.resize(npixels);\n      gbytes_data.clear();\n      bytes = bytes_data;\n    }\n}\n\n\nvoid \nGBitmap::init(const GBitmap &ref, int aborder)\n{\n  GMonitorLock lock(monitor());\n  if (this != &ref) \n    {\n      GMonitorLock lock(ref.monitor());\n      init(ref.nrows, ref.ncolumns, aborder);\n      grays = ref.grays;\n      unsigned char *row = bytes_data+border;\n      for (int n=0; n<nrows; n++, row+=bytes_per_row)\n      memcpy( (void*)row, (void*)ref[n],  ncolumns );\n    }\n  else if (aborder > border)\n    {\n      minborder(aborder);\n    }\n}\n\n\nvoid \nGBitmap::init(const GBitmap &ref, const GRect &rect, int border)\n{\n  GMonitorLock lock(monitor());\n  // test bitmap physical equality\n  if (this == &ref)\n    {\n      GBitmap tmp;\n      tmp.grays = grays;\n      tmp.border = border;\n      tmp.bytes_per_row = bytes_per_row;\n      tmp.ncolumns = ncolumns;\n      tmp.nrows = nrows;\n      tmp.bytes = bytes;\n      tmp.gbytes_data.swap(gbytes_data);\n      tmp.grle.swap(grle);\n      bytes = 0 ;\n      init(tmp, rect, border);\n    }\n  else\n    {\n      GMonitorLock lock(ref.monitor());\n      // create empty bitmap\n      init(rect.height(), rect.width(), border);\n      grays = ref.grays;\n      // compute destination rectangle\n      GRect rect2(0, 0, ref.columns(), ref.rows() );\n      rect2.intersect(rect2, rect);\n      rect2.translate(-rect.xmin, -rect.ymin);\n      // copy bits\n      if (! rect2.isempty())\n        {\n          for (int y=rect2.ymin; y<rect2.ymax; y++)\n            {\n              unsigned char *dst = (*this)[y];\n              const unsigned char *src = ref[y+rect.ymin] + rect.xmin;\n              for (int x=rect2.xmin; x<rect2.xmax; x++)\n                dst[x] = src[x];\n            }\n        }\n    }\n}\n\n\nvoid \nGBitmap::init(ByteStream &ref, int aborder)\n{\n  GMonitorLock lock(monitor());\n  // Get magic number\n  char magic[2];\n  magic[0] = magic[1] = 0;\n  ref.readall((void*)magic, sizeof(magic));\n  char lookahead = '\\n';\n  int acolumns = read_integer(lookahead, ref);\n  int arows = read_integer(lookahead, ref);\n  int maxval = 1;\n  init(arows, acolumns, aborder);\n  // go reading file\n  if (magic[0]=='P')\n    {\n      switch(magic[1])\n        {\n        case '1':\n          grays = 2;\n          read_pbm_text(ref); \n          return;\n        case '2':\n          maxval = read_integer(lookahead, ref);\n          if (maxval > 65535)\n            G_THROW(\"Cannot read PGM with depth greater than 16 bits.\");\n          grays = (maxval>255 ? 256 : maxval+1);\n          read_pgm_text(ref, maxval); \n          return;\n        case '4':\n          grays = 2;\n          read_pbm_raw(ref); \n          return;\n        case '5':\n          maxval = read_integer(lookahead, ref);\n          if (maxval > 65535)\n            G_THROW(\"Cannot read PGM with depth greater than 16 bits.\");\n          grays = (maxval>255 ? 256 : maxval+1);\n          read_pgm_raw(ref, maxval); \n          return;\n        }\n    }\n  else if (magic[0]=='R')\n    {\n      switch(magic[1])\n        {\n        case '4':\n          grays = 2;\n          read_rle_raw(ref); \n          return;\n        }\n    }\n  G_THROW( ERR_MSG(\"GBitmap.bad_format\") );\n}\n\nvoid\nGBitmap::donate_data(unsigned char *data, int w, int h)\n{\n  destroy();\n  grays = 2;\n  nrows = h;\n  ncolumns = w;\n  border = 0;\n  bytes_per_row = w;\n  gbytes_data.replace(data,w*h);\n  bytes = bytes_data;\n  rlelength = 0;\n}\n\nvoid\nGBitmap::donate_rle(unsigned char *rledata, unsigned int rledatalen, int w, int h)\n{\n  destroy();\n  grays = 2;\n  nrows = h;\n  ncolumns = w;\n  border = 0;\n  bytes_per_row = w;\n//  rle = rledata;\n  grle.replace(rledata,rledatalen);\n  rlelength = rledatalen;\n}\n\n\nunsigned char *\nGBitmap::take_data(size_t &offset)\n{\n  GMonitorLock lock(monitor());\n  unsigned char *ret = bytes_data;\n  if (ret) offset = (size_t)border;\n  bytes_data=0;\n  return ret;\n}\n\nconst unsigned char *\nGBitmap::get_rle(unsigned int &rle_length)\n{\n  if(!rle)\n    compress();\n  rle_length=rlelength;\n  return rle; \n}\n\n// ----- compression\n\n\nvoid \nGBitmap::compress()\n{\n  if (grays > 2)\n    G_THROW( ERR_MSG(\"GBitmap.cant_compress\") );\n  GMonitorLock lock(monitor());\n  if (bytes)\n    {\n      grle.resize(0);\n      grlerows.resize(0);\n      rlelength = encode(rle,grle);\n      if (rlelength)\n        {\n          gbytes_data.resize(0);\n          bytes = 0;\n        }\n    }\n}\n\nvoid\nGBitmap::uncompress()\n{\n  GMonitorLock lock(monitor());\n  if (!bytes && rle)\n    decode(rle);\n}\n\n\n\nunsigned int \nGBitmap::get_memory_usage() const\n{\n  unsigned long usage = sizeof(GBitmap);\n  if (bytes)\n    usage += nrows * bytes_per_row + border;\n  if (rle)\n    usage += rlelength;\n  return usage;\n}\n\n\nvoid \nGBitmap::minborder(int minimum)\n{\n  if (border < minimum)\n    {\n      GMonitorLock lock(monitor());\n      if (border < minimum)\n        {\n          if (bytes)\n            {\n              GBitmap tmp(*this, minimum);\n              bytes_per_row = tmp.bytes_per_row;\n              tmp.gbytes_data.swap(gbytes_data);\n              bytes = bytes_data;\n              tmp.bytes = 0;\n            }\n          border = minimum;\n          gzerobuffer=zeroes(border + ncolumns + border);\n        }\n    }\n}\n\n\n#define NMONITORS 8\nstatic GMonitor monitors[NMONITORS];\n\nvoid\nGBitmap::share()\n{\n  if (!monitorptr)\n    {\n      unsigned long x = (unsigned long)this;\n      monitorptr = &monitors[(x^(x>>5)) % NMONITORS];\n    }\n}\n\n\n// ----- gray levels\n\nvoid\nGBitmap::set_grays(int ngrays)\n{\n  if (ngrays<2 || ngrays>256)\n    G_THROW( ERR_MSG(\"GBitmap.bad_levels\") );\n  // set gray levels\n  GMonitorLock lock(monitor());\n  grays = ngrays;\n  if (ngrays>2 && !bytes)\n    uncompress();\n}\n\nvoid \nGBitmap::change_grays(int ngrays)\n{\n  GMonitorLock lock(monitor());\n  // set number of grays\n  int ng = ngrays - 1;\n  int og = grays - 1;\n  set_grays(ngrays);\n  // setup conversion table\n  unsigned char conv[256];\n  for (int i=0; i<256; i++)\n    {\n      if (i > og)\n        conv[i] = ng;\n      else\n        conv[i] = (i*ng+og/2)/og;\n    }\n  // perform conversion\n  for (int row=0; row<nrows; row++)\n    {\n      unsigned char *p = (*this)[row];\n      for (int n=0; n<ncolumns; n++)\n        p[n] = conv[ p[n] ];\n    }\n}\n\nvoid \nGBitmap::binarize_grays(int threshold)\n{\n  GMonitorLock lock(monitor());\n  if (bytes)\n    for (int row=0; row<nrows; row++)\n      {\n        unsigned char *p = (*this)[row];\n        for(unsigned char const * const pend=p+ncolumns;p<pend;++p)\n        {\n          *p = (*p>threshold) ? 1 : 0;\n        }\n      }\n  grays = 2;\n}\n\n\n// ----- additive blitting\n\n#undef min\n#undef max\n\nstatic inline int\nmin(int x, int y) \n{ \n  return (x < y ? x : y);\n}\n\nstatic inline int\nmax(int x, int y) \n{ \n  return (x > y ? x : y);\n}\n\nvoid \nGBitmap::blit(const GBitmap *bm, int x, int y)\n{\n  // Check boundaries\n  if ((x >= ncolumns)              || \n      (y >= nrows)                 ||\n      (x + (int)bm->columns() < 0) || \n      (y + (int)bm->rows() < 0)     )\n    return;\n\n  // Perform blit\n  GMonitorLock lock1(monitor());\n  GMonitorLock lock2(bm->monitor());\n  if (bm->bytes)\n    {\n      if (!bytes_data)\n        uncompress();\n      // Blit from bitmap\n      const unsigned char *srow = bm->bytes + bm->border;\n      unsigned char *drow = bytes_data + border + y*bytes_per_row + x;\n      for (int sr = 0; sr < bm->nrows; sr++)\n        {\n          if (sr+y>=0 && sr+y<nrows) \n            {\n              int sc = max(0, -x);\n              int sc1 = min(bm->ncolumns, ncolumns-x);\n              while (sc < sc1)\n                {\n                  drow[sc] += srow[sc];\n                  sc += 1;\n                }\n            }\n          srow += bm->bytes_per_row;\n          drow += bytes_per_row;\n        }\n    }\n  else if (bm->rle)\n    {\n      if (!bytes_data)\n        uncompress();\n      // Blit from rle\n      const unsigned char *runs = bm->rle;\n      unsigned char *drow = bytes_data + border + y*bytes_per_row + x;\n      int sr = bm->nrows - 1;\n      drow += sr * bytes_per_row;\n      int sc = 0;\n      char p = 0;\n      while (sr >= 0)\n        {\n          const int z = read_run(runs);\n          if (sc+z > bm->ncolumns)\n            G_THROW( ERR_MSG(\"GBitmap.lost_sync\") );\n          int nc = sc + z;\n          if (p && sr+y>=0 && sr+y<nrows) \n            {\n              if (sc + x < 0) \n                sc = min(-x, nc); \n              while (sc < nc && sc + x<ncolumns)\n                drow[sc++] += 1;\n            }\n          sc = nc;\n          p = 1 - p;\n          if (sc >= bm->ncolumns) \n            {\n              p = 0;\n              sc = 0;\n              drow -= bytes_per_row;\n              sr -= 1; \n            }\n        }\n    }\n}\n\n\n\nvoid \nGBitmap::blit(const GBitmap *bm, int xh, int yh, int subsample)\n{\n  // Use code when no subsampling is necessary\n  if (subsample == 1)\n    {\n      blit(bm, xh, yh);\n      return;\n    }\n\n  // Check boundaries\n  if ((xh >= ncolumns * subsample) || \n      (yh >= nrows * subsample)    ||\n      (xh + (int)bm->columns() < 0)   || \n      (yh + (int)bm->rows() < 0)     )\n    return;\n\n  // Perform subsampling blit\n  GMonitorLock lock1(monitor());\n  GMonitorLock lock2(bm->monitor());\n  if (bm->bytes)\n    {\n      if (!bytes_data)\n        uncompress();\n      // Blit from bitmap\n      int dr, dr1, zdc, zdc1;\n      euclidian_ratio(yh, subsample, dr, dr1);\n      euclidian_ratio(xh, subsample, zdc, zdc1);\n      const unsigned char *srow = bm->bytes + bm->border;\n      unsigned char *drow = bytes_data + border + dr*bytes_per_row;\n      for (int sr = 0; sr < bm->nrows; sr++)\n        {\n          if (dr>=0 && dr<nrows) \n            {\n              int dc = zdc;\n              int dc1 = zdc1;\n              for (int sc=0; sc < bm->ncolumns; sc++) \n                {\n                  if (dc>=0 && dc<ncolumns)\n                    drow[dc] += srow[sc];\n                  if (++dc1 >= subsample) \n                    {\n                      dc1 = 0;\n                      dc += 1;\n                    }\n                }\n            }\n          // next line in source\n          srow += bm->bytes_per_row;\n          // next line fraction in destination\n          if (++dr1 >= subsample)\n            {\n              dr1 = 0;\n              dr += 1;\n              drow += bytes_per_row;\n            }\n        }\n    }\n  else if (bm->rle)\n    {\n      if (!bytes_data)\n        uncompress();\n      // Blit from rle\n      int dr, dr1, zdc, zdc1;\n      euclidian_ratio(yh+bm->nrows-1, subsample, dr, dr1);\n      euclidian_ratio(xh, subsample, zdc, zdc1);\n      const unsigned char *runs = bm->rle;\n      unsigned char *drow = bytes_data + border + dr*bytes_per_row;\n      int sr = bm->nrows -1;\n      int sc = 0;\n      char p = 0;\n      int dc = zdc;\n      int dc1 = zdc1;\n      while (sr >= 0)\n        {\n          int z = read_run(runs);\n          if (sc+z > bm->ncolumns)\n            G_THROW( ERR_MSG(\"GBitmap.lost_sync\") );\n          int nc = sc + z;\n\n          if (dr>=0 && dr<nrows)\n            while (z>0 && dc<ncolumns)\n              {\n                int zd = subsample - dc1;\n                if (zd > z) \n                  zd = z;\n                if (p && dc>=0) \n                  drow[dc] += zd;\n                z -= zd;\n                dc1 += zd;\n                if (dc1 >= subsample)\n                  {\n                    dc1 = 0;\n                    dc += 1;\n                  }\n              }\n          // next fractional row\n          sc = nc;\n          p = 1 - p;\n          if (sc >= bm->ncolumns) \n            {\n              sc = 0;\n              dc = zdc;\n              dc1 = zdc1;\n              p = 0;\n              sr -= 1; \n              if (--dr1 < 0)\n                {\n                  dr1 = subsample - 1;\n                  dr -= 1;\n                  drow -= bytes_per_row;\n                }\n            }\n        }\n    }\n}\n\n\n\n// ------ load bitmaps\n\n\nunsigned int \nGBitmap::read_integer(char &c, ByteStream &bs)\n{\n  unsigned int x = 0;\n  // eat blank before integer\n  while (c==' ' || c=='\\t' || c=='\\r' || c=='\\n' || c=='#') \n    {\n      if (c=='#') \n        do { } while (bs.read(&c,1) && c!='\\n' && c!='\\r');\n      c = 0; \n      bs.read(&c, 1);\n    }\n  // check integer\n  if (c<'0' || c>'9')\n    G_THROW( ERR_MSG(\"GBitmap.not_int\") );\n  // eat integer\n  while (c>='0' && c<='9') \n    {\n      x = x*10 + c - '0';\n      c = 0;\n      bs.read(&c, 1);\n    }\n  return x;\n}\n\n\nvoid \nGBitmap::read_pbm_text(ByteStream &bs)\n{\n  unsigned char *row = bytes_data + border;\n  row += (nrows-1) * bytes_per_row;\n  for (int n = nrows-1; n>=0; n--) \n    {\n      for (int c = 0; c<ncolumns; c++) \n        {\n          char bit = 0;\n          bs.read(&bit,1);\n          while (bit==' ' || bit=='\\t' || bit=='\\r' || bit=='\\n')\n            { \n              bit=0; \n              bs.read(&bit,1); \n            }\n          if (bit=='1')\n            row[c] = 1;\n          else if (bit=='0')\n            row[c] = 0;\n          else\n            G_THROW( ERR_MSG(\"GBitmap.bad_PBM\") );\n        }\n      row -= bytes_per_row;\n    }\n}\n\nvoid \nGBitmap::read_pgm_text(ByteStream &bs, int maxval)\n{\n  unsigned char *row = bytes_data + border;\n  row += (nrows-1) * bytes_per_row;\n  char lookahead = '\\n';\n  GTArray<unsigned char> ramp(0, maxval);\n  for (int i=0; i<=maxval; i++)\n    ramp[i] = (i<maxval ? ((grays-1)*(maxval-i) + maxval/2) / maxval : 0);\n  for (int n = nrows-1; n>=0; n--) \n    {\n      for (int c = 0; c<ncolumns; c++)\n        row[c] = ramp[(int)read_integer(lookahead, bs)];\n      row -= bytes_per_row;\n    }\n}\n\nvoid \nGBitmap::read_pbm_raw(ByteStream &bs)\n{\n  unsigned char *row = bytes_data + border;\n  row += (nrows-1) * bytes_per_row;\n  for (int n = nrows-1; n>=0; n--) \n    {\n      unsigned char acc = 0;\n      unsigned char mask = 0;\n      for (int c = 0; c<ncolumns; c++)\n        {\n          if (!mask) \n            {\n              bs.read(&acc, 1);\n              mask = (unsigned char)0x80;\n            }\n          if (acc & mask)\n            row[c] = 1;\n          else\n            row[c] = 0;\n          mask >>= 1;\n        }\n      row -= bytes_per_row;\n    }\n}\n\nvoid \nGBitmap::read_pgm_raw(ByteStream &bs, int maxval)\n{\n  int maxbin = (maxval>255) ? 65536 : 256;\n  GTArray<unsigned char> ramp(0, maxbin-1);\n  for (int i=0; i<maxbin; i++)\n    ramp[i] = (i<maxval ? ((grays-1)*(maxval-i) + maxval/2) / maxval : 0);\n  unsigned char *bramp = ramp;\n  unsigned char *row = bytes_data + border;\n  row += (nrows-1) * bytes_per_row;\n  for (int n = nrows-1; n>=0; n--) \n    {\n      if (maxbin > 256)\n        {\n          for (int c = 0; c<ncolumns; c++)\n            {\n              unsigned char x[2];\n              bs.read((void*)&x, 2);\n              row[c] = bramp[x[0]*256+x[1]];\n            }\n        }\n      else\n        {\n          for (int c = 0; c<ncolumns; c++)\n            {\n              unsigned char x;\n              bs.read((void*)&x, 1);\n              row[c] = bramp[x];\n            }\n        }\n      row -= bytes_per_row;\n    }\n}\n\nvoid \nGBitmap::read_rle_raw(ByteStream &bs)\n{\n  // interpret runs data\n  unsigned char h;\n  unsigned char p = 0;\n  unsigned char *row = bytes_data + border;\n  int n = nrows - 1;\n  row += n * bytes_per_row;\n  int c = 0;\n  while (n >= 0)\n    {\n      bs.read(&h, 1);\n      int x = h;\n      if (x >= (int)RUNOVERFLOWVALUE)\n        {\n          bs.read(&h, 1);\n          x = h + ((x - (int)RUNOVERFLOWVALUE) << 8);\n        }\n      if (c+x > ncolumns)\n        G_THROW( ERR_MSG(\"GBitmap.lost_sync\") );\n      while (x-- > 0)\n        row[c++] = p;\n      p = 1 - p;\n      if (c >= ncolumns) \n        {\n          c = 0;\n          p = 0;\n          row -= bytes_per_row;\n          n -= 1; \n        }\n    }\n}\n\n\n// ------ save bitmaps\n\nvoid \nGBitmap::save_pbm(ByteStream &bs, int raw)\n{\n  // check arguments\n  if (grays > 2)\n    G_THROW( ERR_MSG(\"GBitmap.cant_make_PBM\") );\n  GMonitorLock lock(monitor());\n  // header\n  {\n    GUTF8String head;\n    head.format(\"P%c\\n%d %d\\n\", (raw ? '4' : '1'), ncolumns, nrows);\n    bs.writall((void*)(const char *)head, head.length());\n  }\n  // body\n  if(raw)\n  {\n    if(!rle)\n      compress();\n    const unsigned char *runs=rle;\n    const unsigned char * const runs_end=rle+rlelength;\n    const int count=(ncolumns+7)>>3;\n    unsigned char *buf;\n    GPBuffer<unsigned char> gbuf(buf,count);\n    while(runs<runs_end)\n    {\n      rle_get_bitmap(ncolumns,runs,buf,false);\n      bs.writall(buf,count);\n    }\n  }else\n  {\n    if (!bytes)\n      uncompress();\n    const unsigned char *row = bytes + border;\n    int n = nrows - 1;\n    row += n * bytes_per_row;\n    while (n >= 0)\n    {\n      unsigned char eol='\\n';\n      for (int c=0; c<ncolumns;)\n      {\n        unsigned char bit= (row[c] ? '1' : '0');\n        bs.write((void*)&bit, 1);\n        c += 1;\n        if (c==ncolumns || (c&(int)RUNMSBMASK)==0) \n          bs.write((void*)&eol, 1);          \n       }\n      // next row\n      row -= bytes_per_row;\n      n -= 1;\n    }\n  }\n}\n\nvoid \nGBitmap::save_pgm(ByteStream &bs, int raw)\n{\n  // checks\n  GMonitorLock lock(monitor());\n  if (!bytes)\n    uncompress();\n  // header\n  GUTF8String head;\n  head.format(\"P%c\\n%d %d\\n%d\\n\", (raw ? '5' : '2'), ncolumns, nrows, grays-1);\n  bs.writall((void*)(const char *)head, head.length());\n  // body\n  const unsigned char *row = bytes + border;\n  int n = nrows - 1;\n  row += n * bytes_per_row;\n  while (n >= 0)\n    {\n      if (raw)\n        {\n          for (int c=0; c<ncolumns; c++)\n            {\n              char x = grays - 1 - row[c];\n              bs.write((void*)&x, 1);\n            }\n        }\n      else \n        {\n          unsigned char eol='\\n';\n          for (int c=0; c<ncolumns; )\n            {\n              head.format(\"%d \", grays - 1 - row[c]);\n              bs.writall((void*)(const char *)head, head.length());\n              c += 1;\n              if (c==ncolumns || (c&0x1f)==0) \n                bs.write((void*)&eol, 1);          \n            }\n        }\n      row -= bytes_per_row;\n      n -= 1;\n    }\n}\n\nvoid \nGBitmap::save_rle(ByteStream &bs)\n{\n  // checks\n  if (ncolumns==0 || nrows==0)\n    G_THROW( ERR_MSG(\"GBitmap.not_init\") );\n  GMonitorLock lock(monitor());\n  if (grays > 2)\n    G_THROW( ERR_MSG(\"GBitmap.cant_make_PBM\") );\n  // header\n  GUTF8String head;\n  head.format(\"R4\\n%d %d\\n\", ncolumns, nrows);\n  bs.writall((void*)(const char *)head, head.length());\n  // body\n  if (rle)\n    {\n      bs.writall((void*)rle, rlelength);\n    }\n  else\n    {\n      unsigned char *runs = 0;\n      GPBuffer<unsigned char> gruns(runs);\n      int size = encode(runs,gruns);\n      bs.writall((void*)runs, size);\n    }\n}\n\n\n// ------ runs\n\n\nvoid\nGBitmap::makerows(\n  int nrows, const int ncolumns, unsigned char *runs, unsigned char *rlerows[])\n{\n  while (nrows-- > 0)\n  {\n    rlerows[nrows] = runs;\n    int c;\n    for(c=0;c<ncolumns;c+=GBitmap::read_run(runs))\n      EMPTY_LOOP;\n    if (c > ncolumns)\n      G_THROW( ERR_MSG(\"GBitmap.lost_sync2\") );\n  }\n}\n\n\nvoid\nGBitmap::rle_get_bitmap (\n  const int ncolumns,\n  const unsigned char *&runs,\n  unsigned char *bitmap,\n  const bool invert )\n{\n  const int obyte_def=invert?0xff:0;\n  const int obyte_ndef=invert?0:0xff;\n  int mask=0x80,obyte=0;\n  for(int c=ncolumns;c > 0 ;)\n  {\n    int x=read_run(runs);\n    c-=x;\n    while((x--)>0)\n    {\n      if(!(mask>>=1))\n      {\n        *(bitmap++) = obyte^obyte_def;\n        obyte=0;\n        mask=0x80;\n        for(;x>=8;x-=8)\n        {\n          *(bitmap++)=obyte_def;\n        }\n      }\n    }\n    if(c>0)\n    {\n      int x=read_run(runs);\n      c-=x;\n      while((x--)>0)\n      {\n        obyte|=mask;\n        if(!(mask>>=1))\n        {\n          *(bitmap++)=obyte^obyte_def;\n          obyte=0;\n          mask=0x80;\n          for(;(x>8);x-=8)\n            *(bitmap++)=obyte_ndef;\n        }\n      }\n    }\n  }\n  if(mask != 0x80)\n  {\n    *(bitmap++)=obyte^obyte_def;\n  }\n}\n\nint \nGBitmap::rle_get_bits(int rowno, unsigned char *bits) const\n{\n  GMonitorLock lock(monitor());\n  if (!rle)\n    return 0;\n  if (rowno<0 || rowno>=nrows)\n    return 0;\n  if (!rlerows)\n  {\n    const_cast<GPBuffer<unsigned char *> &>(grlerows).resize(nrows);\n    makerows(nrows,ncolumns,rle,const_cast<unsigned char **>(rlerows));\n  }\n  int n = 0;\n  int p = 0;\n  int c = 0;\n  unsigned char *runs = rlerows[rowno];\n  while (c < ncolumns)\n    {\n      const int x=read_run(runs);\n      if ((c+=x)>ncolumns)\n        c = ncolumns;\n      while (n<c)\n        bits[n++] = p;\n      p = 1-p;\n    }\n  return n;\n}\n\n\nint \nGBitmap::rle_get_runs(int rowno, int *rlens) const\n{\n  GMonitorLock lock(monitor());\n  if (!rle)\n    return 0;\n  if (rowno<0 || rowno>=nrows)\n    return 0;\n  if (!rlerows)\n  {\n    const_cast<GPBuffer<unsigned char *> &>(grlerows).resize(nrows);\n    makerows(nrows,ncolumns,rle,const_cast<unsigned char **>(rlerows));\n  }\n  int n = 0;\n  int d = 0;\n  int c = 0;\n  unsigned char *runs = rlerows[rowno];\n  while (c < ncolumns)\n    {\n      const int x=read_run(runs);\n      if (n>0 && !x)\n        {\n          n--;\n          d = d-rlens[n];\n        }\n      else \n        {\n          rlens[n++] = (c+=x)-d;\n          d = c;\n        }\n    }\n  return n;\n}\n\n\nint \nGBitmap::rle_get_rect(GRect &rect) const\n{\n  GMonitorLock lock(monitor());\n  if (!rle) \n    return 0;\n  int area = 0;\n  unsigned char *runs = rle;\n  rect.xmin = ncolumns;\n  rect.ymin = nrows;\n  rect.xmax = 0;\n  rect.ymax = 0;\n  int r = nrows;\n  while (--r >= 0)\n    {\n      int p = 0;\n      int c = 0;\n      int n = 0;\n      while (c < ncolumns)\n        {\n          const int x=read_run(runs);\n          if(x)\n            {\n              if (p)\n                {\n                  if (c < rect.xmin) \n                    rect.xmin = c;\n                  if ((c += x) > rect.xmax) \n                    rect.xmax = c-1;\n                  n += x;\n                }\n              else\n                {\n                  c += x;\n                }\n            }\n          p = 1-p;\n        }\n      area += n;\n      if (n)\n        {\n          rect.ymin = r;\n          if (r > rect.ymax) \n            rect.ymax = r;\n        }\n    }\n  if (area==0)\n    rect.clear();\n  return area;\n}\n\n\n\n// ------ helpers\n\nint\nGBitmap::encode(unsigned char *&pruns,GPBuffer<unsigned char> &gpruns) const\n{\n  // uncompress rle information\n  if (nrows==0 || ncolumns==0)\n  {\n    gpruns.resize(0);\n    return 0;\n  }\n  if (!bytes)\n    {\n      unsigned char *runs;\n      GPBuffer<unsigned char> gruns(runs,rlelength);\n      memcpy((void*)runs, rle, rlelength);\n      gruns.swap(gpruns);\n      return rlelength;\n    }\n  gpruns.resize(0);\n  // create run array\n  int pos = 0;\n  int maxpos = 1024 + ncolumns + ncolumns;\n  unsigned char *runs;\n  GPBuffer<unsigned char> gruns(runs,maxpos);\n  // encode bitmap as rle\n  const unsigned char *row = bytes + border;\n  int n = nrows - 1;\n  row += n * bytes_per_row;\n  while (n >= 0)\n    {\n      if (maxpos < pos+ncolumns+ncolumns+2)\n        {\n          maxpos += 1024 + ncolumns + ncolumns;\n          gruns.resize(maxpos);\n        }\n\n      unsigned char *runs_pos=runs+pos;\n      const unsigned char * const runs_pos_start=runs_pos;\n      append_line(runs_pos,row,ncolumns);\n      pos+=(size_t)runs_pos-(size_t)runs_pos_start;\n      row -= bytes_per_row;\n      n -= 1;\n    }\n  // return result\n  gruns.resize(pos);\n  gpruns.swap(gruns);\n  return pos;\n}\n\nvoid \nGBitmap::decode(unsigned char *runs)\n{\n  // initialize pixel array\n  if (nrows==0 || ncolumns==0)\n    G_THROW( ERR_MSG(\"GBitmap.not_init\") );\n  bytes_per_row = ncolumns + border;\n  if (runs==0)\n    G_THROW( ERR_MSG(\"GBitmap.null_arg\") );\n  int npixels = nrows * bytes_per_row + border;\n  if (!bytes_data)\n  {\n    gbytes_data.resize(npixels);\n    bytes = bytes_data;\n  }\n  gbytes_data.clear();\n  gzerobuffer=zeroes(bytes_per_row + border);\n  // interpret runs data\n  int c, n;\n  unsigned char p = 0;\n  unsigned char *row = bytes_data + border;\n  n = nrows - 1;\n  row += n * bytes_per_row;\n  c = 0;\n  while (n >= 0)\n    {\n      int x = read_run(runs);\n      if (c+x > ncolumns)\n        G_THROW( ERR_MSG(\"GBitmap.lost_sync2\") );\n      while (x-- > 0)\n        row[c++] = p;\n      p = 1 - p;\n      if (c >= ncolumns) \n        {\n          c = 0;\n          p = 0;\n          row -= bytes_per_row;\n          n -= 1; \n        }\n    }\n  // Free rle data possibly attached to this bitmap\n  grle.resize(0);\n  grlerows.resize(0);\n  rlelength = 0;\n#ifndef NDEBUG\n  check_border();\n#endif\n}\n\nclass GBitmap::ZeroBuffer : public GPEnabled\n{\npublic:\n  ZeroBuffer(const unsigned int zerosize);\n  unsigned char *zerobuffer;\n  GPBuffer<unsigned char> gzerobuffer;\n};\n\nGBitmap::ZeroBuffer::ZeroBuffer(const unsigned int zerosize)\n: gzerobuffer(zerobuffer,zerosize)\n{\n  gzerobuffer.clear();\n  GBitmap::zerobuffer=zerobuffer;\n  GBitmap::zerosize=zerosize;\n}\n\nstatic const unsigned char static_zerobuffer[]=\n{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, // 32\n 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, // 64\n 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, // 96 \n 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, // 128 \n 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, // 160\n 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, // 192\n 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, // 234\n 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, // 256\n 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, // 288\n 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, // 320\n 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, // 352 \n 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, // 384 \n 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, // 416\n 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, // 448\n 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, // 480\n 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, // 512\n 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, // 544\n 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, // 576\n 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, // 608 \n 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, // 640 \n 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, // 672\n 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, // 704\n 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, // 736\n 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, // 768\n 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, // 800\n 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, // 832\n 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, // 864 \n 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, // 896 \n 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, // 928\n 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, // 960\n 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, // 992\n 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, // 1024\n 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, // 1024+32\n 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, // 1024+64\n 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, // 1024+96 \n 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, // 1024+128 \n 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, // 1024+160\n 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, // 1024+192\n 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, // 1024+234\n 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, // 1024+256\n 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, // 1024+288\n 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, // 1024+320\n 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, // 1024+352 \n 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, // 1024+384 \n 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, // 1024+416\n 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, // 1024+448\n 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, // 1024+480\n 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, // 1024+512\n 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, // 1024+544\n 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, // 1024+576\n 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, // 1024+608 \n 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, // 1024+640 \n 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, // 1024+672\n 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, // 1024+704\n 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, // 1024+736\n 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, // 1024+768\n 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, // 1024+800\n 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, // 1024+832\n 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, // 1024+864 \n 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, // 1024+896 \n 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, // 1024+928\n 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, // 1024+960\n 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, // 1024+992\n 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, // 2048\n 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, // 2048+32\n 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, // 2048+64\n 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, // 2048+96 \n 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, // 2048+128 \n 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, // 2048+160\n 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, // 2048+192\n 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, // 2048+234\n 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, // 2048+256\n 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, // 2048+288\n 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, // 2048+320\n 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, // 2048+352 \n 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, // 2048+384 \n 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, // 2048+416\n 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, // 2048+448\n 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, // 2048+480\n 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, // 2048+512\n 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, // 2048+544\n 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, // 2048+576\n 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, // 2048+608 \n 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, // 2048+640 \n 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, // 2048+672\n 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, // 2048+704\n 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, // 2048+736\n 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, // 2048+768\n 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, // 2048+800\n 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, // 2048+832\n 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, // 2048+864 \n 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, // 2048+896 \n 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, // 2048+928\n 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, // 2048+960\n 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, // 2048+992\n 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, // 3072\n 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, // 3072+32\n 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, // 3072+64\n 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, // 3072+96 \n 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, // 3072+128 \n 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, // 3072+160\n 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, // 3072+192\n 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, // 3072+234\n 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, // 3072+256\n 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, // 3072+288\n 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, // 3072+320\n 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, // 3072+352 \n 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, // 3072+384 \n 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, // 3072+416\n 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, // 3072+448\n 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, // 3072+480\n 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, // 3072+512\n 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, // 3072+544\n 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, // 3072+576\n 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, // 3072+608 \n 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, // 3072+640 \n 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, // 3072+672\n 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, // 3072+704\n 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, // 3072+736\n 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, // 3072+768\n 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, // 3072+800\n 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, // 3072+832\n 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, // 3072+864 \n 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, // 3072+896 \n 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, // 3072+928\n 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, // 3072+960\n 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, // 3072+992\n 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}; // 4096\n\nint GBitmap::zerosize = sizeof(static_zerobuffer);\nunsigned char *GBitmap::zerobuffer=const_cast<unsigned char *>(static_zerobuffer);\n\nGP<GBitmap::ZeroBuffer>\nGBitmap::zeroes(int required)\n{\n  GMonitorLock lock(&monitors[0]); // any monitor would do\n  static GP<GBitmap::ZeroBuffer> gzerobuffer;\n  if (zerosize < required)\n  {\n    int z;\n    for(z=zerosize;z<required;z <<= 1)\n      EMPTY_LOOP;\n    z=(z+0xfff)&(~0xfff);\n    gzerobuffer=new GBitmap::ZeroBuffer((unsigned int)z);\n  }\n  return gzerobuffer;\n}\n\n\n// Fills a bitmap with the given value\nvoid \nGBitmap::fill(unsigned char value)\n{\n  GMonitorLock lock(monitor());\n  for(unsigned int y=0; y<rows(); y++)\n    {\n      unsigned char* bm_y = (*this)[y];\n      for(unsigned int x=0; x<columns(); x++)\n        bm_y[x] = value;\n    }\n}\n\n\nvoid \nGBitmap::append_long_run(unsigned char *&data, int count)\n{\n  while (count > MAXRUNSIZE)\n    {\n      data[0] = data[1] = 0xff;\n      data[2] = 0;\n      data += 3;\n      count -= MAXRUNSIZE;\n    }\n  if (count < RUNOVERFLOWVALUE)\n    {\n      data[0] = count;\n      data += 1;\n    }\n  else\n    {\n      data[0] = (count>>8) + GBitmap::RUNOVERFLOWVALUE;\n      data[1] = (count & 0xff);\n      data += 2;\n    }\n}\n\n\nvoid\nGBitmap::append_line(unsigned char *&data,const unsigned char *row,\n                     const int rowlen,bool invert)\n{\n  const unsigned char *rowend=row+rowlen;\n  bool p=!invert;\n  while(row<rowend)\n    {\n      int count=0;\n      if ((p=!p)) \n        {\n          if(*row)\n            for(++count,++row;(row<rowend)&&*row;++count,++row)\n            \tEMPTY_LOOP;\n        } \n      else if(!*row)\n        {\n          for(++count,++row;(row<rowend)&&!*row;++count,++row)\n          \tEMPTY_LOOP;\n        }\n      append_run(data,count);\n    }\n}\n\n#if 0\nstatic inline int\nGetRowTDLRNR(\n  GBitmap &bit,const int row, const unsigned char *&startptr,\n  const unsigned char *&stopptr)\n{\n  stopptr=(startptr=bit[row])+bit.columns();\n  return 1;\n}\n\nstatic inline int\nGetRowTDLRNR(\n  GBitmap &bit,const int row, const unsigned char *&startptr,\n  const unsigned char *&stopptr)\n{\n  stopptr=(startptr=bit[row])+bit.columns();\n  return 1;\n}\n\nstatic inline int\nGetRowTDRLNR(\n  GBitmap &bit,const int row, const unsigned char *&startptr,\n  const unsigned char *&stopptr)\n{\n  startptr=(stopptr=bit[row]-1)+bit.columns();\n  return -1;\n}\n#endif // 0\n\nGP<GBitmap> \nGBitmap::rotate(int count)\n{\n  GP<GBitmap> newbitmap=this;\n  count = count & 3;\n  if(count)\n  {\n    if( count & 0x01 )\n    {\n      newbitmap = new GBitmap(ncolumns, nrows);\n    }else\n    {\n      newbitmap = new GBitmap(nrows, ncolumns);\n    }\n    GMonitorLock lock(monitor());\n    if (!bytes_data)\n      uncompress();\n    GBitmap &dbitmap = *newbitmap;\n    dbitmap.set_grays(grays);\n    switch(count)\n    {\n    case 3: // rotate 90 counter clockwise\n      {\n        const int lastrow = dbitmap.rows()-1;\n        for(int y=0; y<nrows; y++)\n        {\n          const unsigned char *r=operator[] (y);\n          for(int x=0,xnew=lastrow;xnew>=0; x++,xnew--)\n          {\n            dbitmap[xnew][y] = r[x];\n          }\n        }\n      }\n      break;\n    case 2: // rotate 180 counter clockwise\n      {\n        const int lastrow = dbitmap.rows()-1;\n        const int lastcolumn = dbitmap.columns()-1;\n        for(int y=0,ynew=lastrow;ynew>=0; y++,ynew--)\n        {\n          const unsigned char *r=operator[] (y);\n          unsigned char *d=dbitmap[ynew];\n          for(int xnew=lastcolumn;xnew>=0; r++,--xnew)\n          {\n            d[xnew] = *r;\n          }\n        }\n      }\n      break;\n    case 1: // rotate 270 counter clockwise\n      {\n        const int lastcolumn = dbitmap.columns()-1;\n        for(int y=0,ynew=lastcolumn;ynew>=0;y++,ynew--)\n        {\n          const unsigned char *r=operator[] (y);\n          for(int x=0; x<ncolumns; x++)\n          {\n            dbitmap[x][ynew] = r[x];\n          }\n        }\n      }\n      break;\n    }\n    if(grays == 2)\n    {\n      compress();\n      dbitmap.compress();\n    }\n  }\n  return newbitmap;\n}\n\n#ifndef NDEBUG\nvoid \nGBitmap::check_border() const\n{int col ;\n  if (bytes)\n    {\n      const unsigned char *p = (*this)[-1];\n      for (col=-border; col<ncolumns+border; col++)\n        if (p[col])\n          G_THROW( ERR_MSG(\"GBitmap.zero_damaged\") );\n      for (int row=0; row<nrows; row++)\n        {\n          p = (*this)[row];\n          for (col=-border; col<0; col++)\n            if (p[col])\n              G_THROW( ERR_MSG(\"GBitmap.left_damaged\") );\n          for (col=ncolumns; col<ncolumns+border; col++)\n            if (p[col])\n              G_THROW( ERR_MSG(\"GBitmap.right_damaged\") );\n        }\n    }\n}\n#endif\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/GBitmap.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _GBITMAP_H_\n#define _GBITMAP_H_\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n#include \"GSmartPointer.h\"\n#ifndef NDEBUG\n#include \"GException.h\"\n#endif\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\nclass GRect;\nclass GMonitor;\nclass ByteStream;\n\n/** @name GBitmap.h\n\n    Files #\"GBitmap.h\"# and #\"GBitmap.cpp\"# implement class \\Ref{GBitmap}.\n    Instances of this class represent bilevel or gray-level images. The\n    ``bottom left'' coordinate system is used consistently in the DjVu library.\n    Line zero of a bitmap is the bottom line in the bitmap.  Pixels are\n    organized from left to right within each line.  As suggested by its name,\n    class #GBitmap# was initially a class for bilevel images only.  It was\n    extended to handle gray-level images when arose the need to render\n    anti-aliased images.  This class has been a misnomer since then.\n\n    {\\bf ToDo} --- Class #GBitmap# can internally represent bilevel images\n    using a run-length encoded representation.  Some algorithms may benefit\n    from a direct access to this run information.\n\n    @memo\n    Generic support for bilevel and gray-level images.\n    @author\n    L\\'eon Bottou <leonb@research.att.com>\n\n */\n//@{\n\n\n/** Bilevel and gray-level images.  Instances of class #GBitmap# represent\n    bilevel or gray-level images.  Images are usually represented using one\n    byte per pixel.  Value zero represents a white pixel.  A value equal to\n    the number of gray levels minus one represents a black pixel.  The number\n    of gray levels is returned by the function \\Ref{get_grays} and can be\n    manipulated by the functions \\Ref{set_grays} and \\Ref{change_grays}.\n\n    The bracket operator returns a pointer to the bytes composing one line of\n    the image.  This pointer can be used to read or write the image pixels.\n    Line zero represents the bottom line of the image.\n\n    The memory organization is setup in such a way that you can safely read a\n    few pixels located in a small border surrounding all four sides of the\n    image.  The width of this border can be modified using the function\n    \\Ref{minborder}.  The border pixels are initialized to zero and therefore\n    represent white pixels.  You should never write anything into border\n    pixels because they are shared between images and between lines.  */\n\nclass DJVUAPI GBitmap : public GPEnabled\n{\nprotected:\n  GBitmap(void);\n  GBitmap(int nrows, int ncolumns, int border=0);\n  GBitmap(const GBitmap &ref);\n  GBitmap(const GBitmap &ref, int border);\n  GBitmap(const GBitmap &ref, const GRect &rect, int border=0);\n  GBitmap(ByteStream &ref, int border=0);\npublic:\n  virtual ~GBitmap();\n  void destroy(void);\n  /** @name Construction. */\n  //@{\n  /** Constructs an empty GBitmap object.  The returned GBitmap has zero rows\n      and zero columns.  Use function \\Ref{init} to change the size of the\n      image. */\n  static GP<GBitmap> create(void) {return new GBitmap;}\n\n  /** Constructs a GBitmap with #nrows# rows and #ncolumns# columns.  All\n      pixels are initialized to white. The optional argument #border#\n      specifies the size of the optional border of white pixels surrounding\n      the image.  The number of gray levels is initially set to #2#.  */\n  static GP<GBitmap> create(const int nrows, const int ncolumns, const int border=0)\n  {return new GBitmap(nrows,ncolumns, border); }\n\n  /** Copy constructor. Constructs a GBitmap by replicating the size, the\n      border and the contents of GBitmap #ref#. */\n  static GP<GBitmap> create(const GBitmap &ref)\n  {return new GBitmap(ref);}\n\n  /** Constructs a GBitmap by copying the contents of GBitmap #ref#.  \n      Argument #border# specifies the width of the optional border. */\n  static GP<GBitmap> create(const GBitmap &ref, const int border)\n  { return new GBitmap(ref,border); }\n\n  /** Constructs a GBitmap by copying a rectangular segment #rect# of GBitmap\n      #ref#.  The optional argument #border# specifies the size of the\n      optional border of white pixels surrounding the image. */\n  static GP<GBitmap> create(const GBitmap &ref, const GRect &rect, const int border=0)\n  { return new GBitmap(ref,rect,border); }\n\n  /** Constructs a GBitmap by reading PBM, PGM or RLE data from ByteStream\n      #ref# into this GBitmap. The optional argument #border# specifies the\n      size of the optional border of white pixels surrounding the image.  See\n      \\Ref{PNM and RLE file formats} for more information.  */\n  static GP<GBitmap> create(ByteStream &ref, const int border=0)\n  { return new GBitmap(ref,border); }\n\n  //@}\n\n  /** @name Initialization. */\n  //@{\n  /** Resets this GBitmap size to #nrows# rows and #ncolumns# columns and sets\n      all pixels to white.  The optional argument #border# specifies the size\n      of the optional border of white pixels surrounding the image.  The\n      number of gray levels is initialized to #2#. */\n  void init(int nrows, int ncolumns, int border=0);\n  /** Initializes this GBitmap with the contents of the GBitmap #ref#.  The\n      optional argument #border# specifies the size of the optional border of\n      white pixels surrounding the image. */\n  void init(const GBitmap &ref, int border=0);\n  /** Initializes this GBitmap with a rectangular segment #rect# of GBitmap\n      #ref#.  The optional argument #border# specifies the size of the\n      optional border of white pixels surrounding the image. */\n  void init(const GBitmap &ref, const GRect &rect, int border=0);\n  /** Reads PBM, PGM or RLE data from ByteStream #ref# into this GBitmap.  The\n      previous content of the GBitmap object is lost. The optional argument\n      #border# specifies the size of the optional border of white pixels\n      surrounding the image. See \\Ref{PNM and RLE file formats} for more\n      information. */\n  void init(ByteStream &ref, int border=0);\n  /** Assignment operator. Initializes this GBitmap by copying the size, the\n      border and the contents of GBitmap #ref#. */\n  GBitmap& operator=(const GBitmap &ref);\n  /** Initializes all the GBitmap pixels to value #value#. */\n  void fill(unsigned char value);\n  //@}\n\n  /** @name Accessing the pixels. */\n  //@{\n  /** Returns the number of rows (the image height). */\n  unsigned int rows() const;\n  /** Returns the number of columns (the image width). */\n  unsigned int columns() const;\n  /** Returns a constant pointer to the first byte of row #row#.\n      This pointer can be used as an array to read the row elements. */\n  const unsigned char *operator[] (int row) const;\n  /** Returns a pointer to the first byte of row #row#.\n      This pointer can be used as an array to read or write the row elements. */\n  unsigned char *operator[] (int row);\n  /** Returns the size of a row in memory (in pixels).  This number is equal\n      to the difference between pointers to pixels located in the same column\n      in consecutive rows.  This difference can be larger than the number of\n      columns in the image. */\n  unsigned int rowsize() const;\n  /** Makes sure that the border is at least #minimum# pixels large.  This\n      function does nothing it the border width is already larger than\n      #minimum#.  Otherwise it reorganizes the data in order to provide a\n      border of #minimum# pixels. */\n  void minborder(int minimum);\n  //@}\n\n  /** @name Managing gray levels. */\n  //@{\n  /** Returns the number of gray levels. \n      Value #2# denotes a bilevel image. */\n  int  get_grays() const;\n  /** Sets the number of gray levels without changing the pixels.\n      Argument #grays# must be in range #2# to #256#. */\n  void set_grays(int grays);\n  /** Changes the number of gray levels.  The argument #grays# must be in the\n      range #2# to #256#.  All the pixel values are then rescaled and clipped\n      in range #0# to #grays-1#. */\n  void change_grays(int grays);\n  /** Binarizes a gray level image using a threshold.  The number of gray\n      levels is reduced to #2# as in a bilevel image.  All pixels whose value\n      was strictly greater than #threshold# are set to black. All other pixels\n      are set to white. */\n  void binarize_grays(int threshold=0);\n  //@}\n\n  /** @name Optimizing the memory usage.  \n      The amount of memory used by bilevel images can be reduced using\n      function \\Ref{compress}, which encodes the image using a run-length\n      encoding scheme.  The bracket operator decompresses the image on demand.\n      A few highly optimized functions (e.g. \\Ref{blit}) can use a run-length\n      encoded bitmap without decompressing it.  There are unfortunate locking\n      issues associated with this capability (c.f. \\Ref{share} and\n      \\Ref{monitor}). */\n  //@{\n  /** Reduces the memory required for a bilevel image by using a run-length\n      encoded representation.  Functions that need to access the pixel array\n      will decompress the image on demand. */\n  void compress();\n  /** Decodes run-length encoded bitmaps and recreate the pixel array.\n      This function is usually called by #operator[]# when needed. */\n  void uncompress();\n  /** Returns the number of bytes allocated for this image. */\n  unsigned int get_memory_usage() const;\n  /** Returns a possibly null pointer to a \\Ref{GMonitor} for this bitmap.\n      You should use this monitor to ensure that the data representation of the \n      bitmap will not change while you are using it.  We suggest using\n      class \\Ref{GMonitorLock} which properly handles null monitor pointers. */\n  GMonitor *monitor() const;\n  /** Associates a \\Ref{GMonitor} with this bitmap. This function should be\n      called on all bitmaps susceptible of being simultaneously used by\n      several threads.  It will make sure that function \\Ref{monitor} returns\n      a pointer to a suitable monitor for this bitmap. */\n  void share();\n  //@}\n\n  /** @name Accessing RLE data.\n      The next functions are useful for processing bilevel images\n      encoded using the run length encoding scheme.  These functions always return\n      zero if the bitmap is not RLE encoded.  Function \\Ref{compress} must\n      be used to ensure that the bitmap is RLE encoded.  */\n  //@{\n  /** Gets the pixels for line #rowno#.  One line of pixel is stored as\n      #unsigned char# values into array #bits#.  Each pixel is either 1 or 0.\n      The array must be large enough to hold the whole line.  The number of\n      pixels is returned. */\n\n  int rle_get_bits(int rowno, unsigned char *bits) const;\n\n  /** Gets the bitmap line rle data passed.  One line of pixel is stored one\n      with 8 bits per #unsigned char# in an array.  The array must be large\n      enough to hold the whole line.  */\n\n  static void rle_get_bitmap(const int ncolumns,const unsigned char *&runs,\n    unsigned char *bitmap, const bool invert );\n\n  /** Gets the lengths of all runs in line #rowno#.  The array #rlens# must be\n      large enough to accomodate #w+2# integers where #w# is the number of\n      columns in the image.  These integers represent the lengths of\n      consecutive runs of alternatively white or black pixels.  Lengths can be\n      zero in order to allow for lines starting with black pixels.  This\n      function returns the total number of runs in the line. */\n  int rle_get_runs(int rowno, int *rlens) const;\n  /** Gets the smallest rectangle enclosing black pixels.\n      Rectangle rect gives the coordinates of the smallest rectangle\n      containing all black pixels. Returns the number of black pixels. */\n  int rle_get_rect(GRect &rect) const;\n  //@}\n\n  /** @name Additive Blit.  \n      The blit functions are designed to efficiently construct an anti-aliased\n      image by copying smaller images at predefined locations.  The image of a\n      page, for instance, is composed by copying the images of characters at\n      predefined locations.  These functions are fairly optimized.  They can\n      directly use compressed GBitmaps (see \\Ref{compress}).  We consider in\n      this section that each GBitmap comes with a coordinate system defined as\n      follows.  Position (#0#,#0#) corresponds to the bottom left corner of\n      the bottom left pixel.  Position (#1#,#1#) corresponds to the top right\n      corner of the bottom left pixel, which is also the bottom left corner of\n      the second pixel of the second row.  Position (#w#,#h#), where #w# and\n      #h# denote the size of the GBitmap, corresponds to the top right corner\n      of the top right pixel. */\n\n  //@{\n  /** Performs an additive blit of the GBitmap #bm#.  The GBitmap #bm# is\n      first positioned above the current GBitmap in such a way that position\n      (#u#,#v#) in GBitmap #bm# corresponds to position (#u#+#x#,#v#+#y#) in\n      the current GBitmap.  The value of each pixel in GBitmap #bm# is then\n      added to the value of the corresponding pixel in the current GBitmap.\n      \n      {\\bf Example}: Assume for instance that the current GBitmap is initially\n      white (all pixels have value zero).  This operation copies the pixel\n      values of GBitmap #bm# at position (#x#,#y#) into the current GBitmap.\n      Note that function #blit# does not change the number of gray levels in\n      the current GBitmap.  You may have to call \\Ref{set_grays} to specify\n      how the pixel values should be interpreted. */\n  void blit(const GBitmap *bm, int x, int y);\n  /** Performs an additive blit of the GBitmap #bm# with anti-aliasing.  The\n      GBitmap #bm# is first positioned above the current GBitmap in such a\n      way that position (#u#,#v#) in GBitmap #bm# corresponds to position\n      (#u#+#x#/#subsample#,#v#+#y#/#subsample#) in the current GBitmap.  This\n      mapping results in a contraction of GBitmap #bm# by a factor\n      #subsample#.  Each pixel of the current GBitmap can be covered by a\n      maximum of #subsample^2# pixels of GBitmap #bm#.  The value of\n      each pixel in GBitmap #bm# is then added to the value of the\n      corresponding pixel in the current GBitmap.\n\n      {\\bf Example}: Assume for instance that the current GBitmap is initially\n      white (all pixels have value zero).  Each pixel of the current GBitmap\n      then contains the sum of the gray levels of the corresponding pixels in\n      GBitmap #bm#.  There are up to #subsample*subsample# such pixels.  If\n      for instance GBitmap #bm# is a bilevel image (pixels can be #0# or #1#),\n      the pixels of the current GBitmap can take values in range #0# to\n      #subsample*subsample#.  Note that function #blit# does not change the\n      number of gray levels in the current GBitmap.  You must call\n      \\Ref{set_grays} to indicate that there are #subsample^2+1# gray\n      levels.  Since there is at most 256 gray levels, this also means that\n      #subsample# should never be greater than #15#.\n\n      {\\bf Remark}: Arguments #x# and #y# do not represent a position in the\n      coordinate system of the current GBitmap.  According to the above\n      discussion, the position is (#x/subsample#,#y/subsample#).  In other\n      words, you can position the blit with a sub-pixel resolution.  The\n      resulting anti-aliasing changes are paramount to the image quality. */\n  void blit(const GBitmap *shape, int x, int y, int subsample);\n  //@}\n  \n  /** @name Saving images.  \n      The following functions write PBM, PGM and RLE files.  PBM and PGM are\n      well known formats for bilevel and gray-level images.  The RLE is a\n      simple run-length encoding scheme for bilevel images. These files can be\n      read using the ByteStream based constructor or initialization function.\n      See \\Ref{PNM and RLE file formats} for more information. */\n  //@{\n  /** Saves the image into ByteStream #bs# using the PBM format.  Argument\n      #raw# selects the ``Raw PBM'' (1) or the ``Ascii PBM'' (0) format.  The\n      image is saved as a bilevel image.  All non zero pixels are considered\n      black pixels. See section \\Ref{PNM and RLE file formats}. */\n  void save_pbm(ByteStream &bs, int raw=1);\n  /** Saves the image into ByteStream #bs# using the PGM format.  Argument\n      #raw# selects the ``Raw PGM'' (1) or the ``Ascii PGM'' (0) format.  The\n      image is saved as a gray level image.  See section\n      \\Ref{PNM and RLE file formats}. */\n  void save_pgm(ByteStream &bs, int raw=1);\n  /** Saves the image into ByteStream #bs# using the RLE file format.\n      The image is saved as a bilevel image. All non zero pixels are\n      considered black pixels. See section \\Ref{PNM and RLE file formats}. */\n  void save_rle(ByteStream &bs);\n  //@}\n\n  /** @name Stealing or borrowing the memory buffer (advanced). */\n  //@{\n  /** Steals the memory buffer of a GBitmap.  This function returns the\n      address of the memory buffer allocated by this GBitmap object.  The\n      offset of the first pixel in the bottom line is written into variable\n      #offset#.  Other lines can be accessed using pointer arithmetic (see\n      \\Ref{rowsize}).  The GBitmap object no longer ``owns'' the buffer: you\n      must explicitly de-allocate the buffer using #operator delete []#.  This\n      de-allocation should take place after the destruction or the\n      re-initialization of the GBitmap object.  This function will return a\n      null pointer if the GBitmap object does not ``own'' the buffer in the\n      first place.  */\n  unsigned char *take_data(size_t &offset);\n  /** Initializes this GBitmap by borrowing a memory segment.  The GBitmap\n      then directly addresses the memory buffer #data# provided by the user.\n      This buffer must be large enough to hold #w*h# bytes representing each\n      one pixel.  The GBitmap object does not ``own'' the buffer: you must\n      explicitly de-allocate the buffer using #operator delete []#.  This\n      de-allocation should take place after the destruction or the\n      re-initialization of the GBitmap object.  */\n  inline void borrow_data(unsigned char &data, int w, int h);\n  /** Same as borrow_data, except GBitmap will call #delete[]#. */\n  void donate_data(unsigned char *data, int w, int h);\n  /** Return a pointer to the rle data. */\n  const unsigned char *get_rle(unsigned int &rle_length);\n  /** Initializes this GBitmap by setting the size to #h# rows and #w#\n      columns, and directly addressing the memory buffer #rledata# provided by\n      the user.  This buffer contains #rledatalen# bytes representing the\n      bitmap in run length encoded form.  The GBitmap object then ``owns'' the\n      buffer (unlike #borrow_data#, but like #donate_data#) and will\n      deallocate this buffer when appropriate: you should not deallocate this\n      buffer yourself.  The encoding of buffer #rledata# is similar to the\n      data segment of the RLE file format (without the header) documented in\n      \\Ref{PNM and RLE file formats}.  */\n  void donate_rle(unsigned char *rledata, unsigned int rledatalen, int w, int h);\n  /** Static function for parsing run data.\n      This function returns one run length encoded at position #data# \n      and increments the pointer #data# accordingly. */\n  static inline int read_run(const unsigned char *&data);\n  static inline int read_run(unsigned char *&data);\n  /** Static function for generating run data.\n      This function encoded run length #count# at position #data#\n      and increments the pointer accordingly.  The pointer must\n      initially point to a large enough data buffer. */\n  static inline void append_run(unsigned char *&data, int count);\n  /** Rotates bitmap by 90, 180 or 270 degrees anticlockwise\n      and returns a new pixmap, input bitmap is not changed. \n      count can be 1, 2, or 3 for 90, 180, 270 degree rotation.\n      It returns the same bitmap if not rotated. \n      The input bitmap will be uncompressed for rotation*/\n  GP<GBitmap> rotate(int count=0);\n  //@}\n\n// These are constants, but we use enum because that works on older compilers.\n  enum {MAXRUNSIZE=0x3fff};\n  enum {RUNOVERFLOWVALUE=0xc0};\n  enum {RUNMSBMASK=0x3f};\n  enum {RUNLSBMASK=0xff};\n\n\nprotected:\n  // bitmap components\n  unsigned short nrows;\n  unsigned short ncolumns;\n  unsigned short border;\n  unsigned short bytes_per_row;\n  unsigned short grays;\n  unsigned char  *bytes;\n  unsigned char  *bytes_data;\n  GPBuffer<unsigned char> gbytes_data;\n  unsigned char  *rle;\n  GPBuffer<unsigned char> grle;\n  unsigned char  **rlerows;\n  GPBuffer<unsigned char *> grlerows;\n  unsigned int   rlelength;\nprivate:\n  GMonitor       *monitorptr;\npublic:\n  class ZeroBuffer;\n  friend class ZeroBuffer;\n  GP<ZeroBuffer> gzerobuffer; \nprivate:\n  static int zerosize;\n  static unsigned char *zerobuffer;\n  static GP<ZeroBuffer> zeroes(int ncolumns);\n  static unsigned int read_integer(char &lookahead, ByteStream &ref);\n  static void euclidian_ratio(int a, int b, int &q, int &r);\n  int encode(unsigned char *&pruns,GPBuffer<unsigned char> &gpruns) const;\n  void decode(unsigned char *runs);\n  void read_pbm_text(ByteStream &ref); \n  void read_pgm_text(ByteStream &ref, int maxval); \n  void read_pbm_raw(ByteStream &ref); \n  void read_pgm_raw(ByteStream &ref, int maxval); \n  void read_rle_raw(ByteStream &ref); \n  static void append_long_run(unsigned char *&data, int count);\n  static void append_line(unsigned char *&data,const unsigned char *row,\n                          const int rowlen,bool invert=false);\n  static void makerows(int,const int, unsigned char *, unsigned char *[]);\n  friend class DjVu_Stream;\n  friend class DjVu_PixImage;\npublic:\n#ifndef NDEBUG\n  void check_border() const;\n#endif\n};\n\n\n/** @name PNM and RLE file formats\n\n    {\\bf PNM} --- There are actually three PNM file formats: PBM for bilevel\n    images, PGM for gray level images, and PPM for color images.  These\n    formats are widely used by popular image manipulation packages such as\n    NetPBM \\URL{http://www.arc.umn.edu/GVL/Software/netpbm.html} or\n    ImageMagick \\URL{http://www.wizards.dupont.com/cristy/}.\n    \n    {\\bf RLE} --- The binary RLE file format is a simple run-length encoding\n    scheme for storing bilevel images.  Encoding or decoding a RLE encoded\n    file is extremely simple. Yet RLE encoded files are usually much smaller\n    than the corresponding PBM encoded files.  RLE files always begin with a\n    header line composed of:\\\\\n    - the two characters #\"R4\"#,\\\\\n    - one or more blank characters,\\\\\n    - the number of columns, encoded using characters #\"0\"# to #\"9\"#,\\\\\n    - one or more blank characters,\\\\\n    - the number of lines, encoded using characters #\"0\"# to #\"9\"#,\\\\\n    - exactly one blank character (usually a line-feed character).\n\n    The rest of the file encodes a sequence of numbers representing the\n    lengths of alternating runs of white and black pixels.  Lines are encoded\n    starting with the top line and progressing towards the bottom line.  Each\n    line starts with a white run. The decoder knows that a line is finished\n    when the sum of the run lengths for that line is equal to the number of\n    columns in the image.  Numbers in range #0# to #191# are represented by a\n    single byte in range #0x00# to #0xbf#.  Numbers in range #192# to #16383#\n    are represented by a two byte sequence: the first byte, in range #0xc0# to\n    #0xff#, encodes the six most significant bits of the number, the second\n    byte encodes the remaining eight bits of the number. This scheme allows\n    for runs of length zero, which are useful when a line starts with a black\n    pixel, and when a very long run (whose length exceeds #16383#) must be\n    split into smaller runs.\n\n    @memo\n    Simple image file formats.  */\n\n//@}\n\n\n// ---------------- IMPLEMENTATION\n\ninline unsigned int\nGBitmap::rows() const\n{\n  return nrows;\n}\n\ninline unsigned int\nGBitmap::columns() const\n{\n  return ncolumns;\n}\n\ninline unsigned int \nGBitmap::rowsize() const\n{\n  return bytes_per_row;\n}\n\ninline int\nGBitmap::get_grays() const\n{\n  return grays;\n}\n\ninline unsigned char *\nGBitmap::operator[](int row) \n{\n  if (!bytes) \n    uncompress();\n  if (row<0 || row>=nrows) {\n#ifndef NDEBUG\n    if (zerosize < bytes_per_row + border)\n      G_THROW( ERR_MSG(\"GBitmap.zero_small\") );\n#endif\n    return zerobuffer + border;\n  }\n  return &bytes[row * bytes_per_row + border];\n}\n\ninline const unsigned char *\nGBitmap::operator[](int row) const\n{\n  if (!bytes) \n    ((GBitmap*)this)->uncompress();\n  if (row<0 || row>=nrows) {\n#ifndef NDEBUG\n    if (zerosize < bytes_per_row + border)\n      G_THROW( ERR_MSG(\"GBitmap.zero_small\") );\n#endif\n    return zerobuffer + border;\n  }\n  return &bytes[row * bytes_per_row + border];\n}\n\ninline GBitmap& \nGBitmap::operator=(const GBitmap &ref)\n{\n  init(ref, ref.border);\n  return *this;\n}\n\ninline GMonitor *\nGBitmap::monitor() const\n{\n  return monitorptr;\n}\n\ninline void \nGBitmap::euclidian_ratio(int a, int b, int &q, int &r)\n{\n  q = a / b;\n  r = a - b*q;\n  if (r < 0)\n  {\n    q -= 1;\n    r += b;\n  }\n}\n\n\ninline int\nGBitmap::read_run(unsigned char *&data)\n{\n  register int z=*data++;\n  return (z>=RUNOVERFLOWVALUE)?\n    ((z&~RUNOVERFLOWVALUE)<<8)|(*data++):z;\n}\n\ninline int\nGBitmap::read_run(const unsigned char *&data)\n{\n  register int z=*data++;\n  return (z>=RUNOVERFLOWVALUE)?\n    ((z&~RUNOVERFLOWVALUE)<<8)|(*data++):z;\n}\n\ninline void\nGBitmap::append_run(unsigned char *&data, int count)\n{\n  if (count < RUNOVERFLOWVALUE)\n    {\n      data[0] = count;\n      data += 1;\n    }\n  else if (count <= MAXRUNSIZE)\n    {\n      data[0] = (count>>8) + GBitmap::RUNOVERFLOWVALUE;\n      data[1] = (count & 0xff);\n      data += 2;\n    }\n  else\n    {\n      append_long_run(data, count);\n    }\n}\n\n\ninline void\nGBitmap::borrow_data(unsigned char &data,int w,int h)\n{\n  donate_data(&data,w,h);\n  bytes_data=0;\n}\n\n// ---------------- THE END\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/GContainer.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"GContainer.h\"\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n// ------------------------------------------------------------\n// DYNAMIC ARRAYS\n// ------------------------------------------------------------\n\n\nGArrayBase::GArrayBase(const GArrayBase &ref)\n  : traits(ref.traits), data(0),\n    minlo(ref.minlo), maxhi(ref.maxhi),\n    lobound(ref.lobound), hibound(ref.hibound)\n{\n  if (maxhi >= minlo)\n    data = ::operator new(traits.size * (maxhi - minlo + 1));\n  if (hibound >= lobound)\n    traits.copy(traits.lea(data, lobound-minlo), \n                traits.lea(ref.data, lobound-minlo),\n                hibound - lobound + 1, 0);\n}\n\n\nGArrayBase::GArrayBase(const GCONT Traits &traits)\n  : traits(traits), data(0),\n    minlo(0), maxhi(-1),\n    lobound(0), hibound(-1)\n{\n}\n\n\nGArrayBase::GArrayBase(const GCONT Traits &traits, int lobound, int hibound)\n  : traits(traits), data(0),\n    minlo(0), maxhi(-1),\n    lobound(0), hibound(-1)\n{\n  resize(lobound, hibound);\n}\n\n\nGArrayBase::~GArrayBase()\n{\n  G_TRY { empty(); } G_CATCH_ALL { } G_ENDCATCH;\n}\n\n\nGArrayBase &\nGArrayBase::operator= (const GArrayBase &ga)\n{\n  if (this == &ga)\n    return *this;\n  empty();\n  if (ga.hibound >= ga.lobound)\n    {\n      resize(ga.lobound, ga.hibound);\n      traits.copy( traits.lea(data, lobound-minlo),\n                   traits.lea(ga.data, ga.lobound-ga.minlo),\n                   hibound - lobound + 1, 0 );\n    }\n  return *this;\n}\n\n\nvoid\nGArrayBase::steal(GArrayBase &ga)\n{\n  if (this != &ga)\n    {\n      empty();\n      lobound = ga.lobound;\n      hibound = ga.hibound;\n      minlo = ga.minlo;\n      maxhi = ga.maxhi;\n      data = ga.data;\n      ga.data = 0;\n      ga.lobound = ga.minlo = 0;\n      ga.hibound = ga.maxhi = -1;\n    }\n}\n\n\nvoid \nGArrayBase::empty()\n{\n  resize(0, -1);\n}\n\n\nvoid \nGArrayBase::touch(int n)\n{\n  int nlo = (n<lobound ? n : lobound);\n  int nhi = (n>hibound ? n : hibound);\n  if (hibound < lobound)\n    nlo = nhi = n;\n  resize(nlo, nhi);\n}\n\n\nvoid \nGArrayBase::resize(int lo, int hi)\n{\n  // Validation\n  int nsize = hi - lo + 1;\n  if (nsize < 0)\n    G_THROW( ERR_MSG(\"GContainer.bad_args\") );\n  // Destruction\n  if (nsize == 0)\n    {\n      if (hibound >= lobound)\n        traits.fini( traits.lea(data, lobound-minlo), hibound-lobound+1 );\n      if (data)\n        ::operator delete (data);\n      data = 0;\n      lobound = minlo = 0;\n      hibound = maxhi = -1;\n      return;\n    }\n  // Simple extension\n  if (lo >= minlo && hi <= maxhi)\n    {\n      if (lobound > lo)\n        traits.init( traits.lea(data,lo-minlo), lobound-lo );\n      else if (lo > lobound)\n        traits.fini( traits.lea(data,lobound-minlo), lo-lobound );\n      if (hi > hibound)\n        traits.init( traits.lea(data,hibound-minlo+1), hi-hibound );\n      else if (hibound > hi)\n        traits.fini( traits.lea(data,hi-minlo+1), hibound-hi );        \n      lobound = lo;\n      hibound = hi;\n      return;\n    }\n  // General case\n  int nminlo = minlo;\n  int nmaxhi = maxhi;\n  if (nminlo > nmaxhi)\n    nminlo = nmaxhi = lo;\n  while (nminlo > lo) {\n    int incr = nmaxhi - nminlo;\n    nminlo -= (incr < 8 ? 8 : (incr > 32768 ? 32768 : incr));\n  }\n  while (nmaxhi < hi) {\n    int incr = nmaxhi - nminlo;\n    nmaxhi += (incr < 8 ? 8 : (incr > 32768 ? 32768 : incr));\n  }\n  // allocate and move\n  int beg = lo;\n  int end = hi;\n  int bytesize = traits.size * (nmaxhi-nminlo+1);\n  void *ndata = ::operator new(bytesize);\n#if GCONTAINER_ZERO_FILL\n  memset(ndata, 0, bytesize);  // slower but cleaner\n#endif\n  G_TRY\n    {\n      if (lo < lobound)\n        { traits.init( traits.lea(ndata,lo-nminlo), lobound-lo ); beg=lobound; }\n      else if (lobound < lo)\n        { traits.fini( traits.lea(data,lobound-minlo), lo-lobound); }\n      if (hibound < hi)\n        { traits.init( traits.lea(ndata,hibound-nminlo+1), hi-hibound ); end=hibound; }\n      else if (hi < hibound)\n        { traits.fini( traits.lea(data, hi-minlo+1), hibound-hi ); }\n      if (end >= beg)\n        { traits.copy( traits.lea(ndata, beg-nminlo), \n                       traits.lea(data, beg-minlo),\n                       end-beg+1, 1 ); }\n    }\n  G_CATCH_ALL\n    {\n      if (ndata)\n        ::operator delete(ndata);\n      G_RETHROW;\n    }\n  G_ENDCATCH;\n  // free and replace\n  if (data) \n    ::operator delete(data);\n  data = ndata;\n  minlo = nminlo;\n  maxhi = nmaxhi;\n  lobound = lo;\n  hibound = hi;\n}\n\n\nvoid \nGArrayBase::shift(int disp)\n{\n  lobound += disp;\n  hibound += disp;\n  minlo += disp;\n  maxhi += disp;\n}\n\n\nvoid \nGArrayBase::del(int n, int howmany)\n{\n  if (howmany < 0)\n    G_THROW( ERR_MSG(\"GContainer.bad_howmany\") );\n  if (howmany == 0)\n    return;\n  if ( n < lobound || n+(int)howmany-1 > hibound)\n    G_THROW( ERR_MSG(\"GContainer.bad_sub2\") );\n  traits.fini( traits.lea(data, n-minlo), howmany );\n  if ( n+howmany-1 < hibound)\n    traits.copy( traits.lea(data, n-minlo),\n                 traits.lea(data, n-minlo+howmany),\n                 hibound - (n+howmany-1), 1 );\n  hibound = hibound - howmany;\n}\n\n\nstatic inline void *\nnextptr(void *p, int elsize)\n{\n  return (void*)(((char*)p) + elsize);\n}\n\n\nstatic inline void *\nprevptr(void *p, int elsize)\n{\n  return (void*)(((char*)p) - elsize);  \n}\n\n\nvoid \nGArrayBase::ins(int n, const void *src, int howmany)\n{\n  if (howmany < 0)\n    G_THROW( ERR_MSG(\"GContainer.bad_howmany\") );\n  if (howmany == 0)\n    return;\n  // Make enough room\n  if (hibound+howmany > maxhi)\n    {\n      int nmaxhi = maxhi;\n      while (nmaxhi < hibound+howmany)\n        nmaxhi += (nmaxhi < 8 ? 8 : (nmaxhi > 32768 ? 32768 : nmaxhi));\n      int bytesize = traits.size * (nmaxhi-minlo+1);\n      void *ndata = ::operator new (bytesize);\n#if GCONTAINER_ZERO_FILL\n      memset(ndata, 0, bytesize);\n#endif\n      G_TRY\n        {\n          if (hibound >= lobound)\n            traits.copy( traits.lea(ndata, lobound-minlo),\n                         traits.lea(data, lobound-minlo),\n                         hibound-lobound+1, 1 );\n        }\n      G_CATCH_ALL\n        {\n          if (ndata)\n            ::operator delete (ndata);\n          G_RETHROW;\n        }\n      G_ENDCATCH;\n      if (data)\n        ::operator delete(data);\n      data = ndata;\n      maxhi = nmaxhi;\n    }\n  // Shift data\n  int elsize = traits.size;\n  void *pdst = traits.lea(data, hibound+howmany-minlo);\n  void *psrc = traits.lea(data, hibound-minlo);\n  void *pend = traits.lea(data, n-minlo);\n  while ((char*)psrc >= (char*)pend)\n    {\n      traits.copy( pdst, psrc, 1, 1 );\n      pdst = prevptr(pdst, elsize);\n      psrc = prevptr(psrc, elsize);\n    }\n  hibound += howmany;\n  // Initialize new data\n  if (! src)\n    {\n      traits.init( traits.lea(data, n-minlo), howmany );\n      hibound += howmany;\n      return;\n    }\n  // Initialize new data with copy constructor\n  pdst = traits.lea(data, n-minlo);\n  pend = traits.lea(data, n+howmany-minlo);\n  while ((char*)pdst < (char*)pend)\n    {\n      traits.copy( pdst, src, 1, 0);\n      pdst = nextptr(pdst, elsize);\n    }\n}\n\n\n\n// ------------------------------------------------------------\n// GPOSITION\n// ------------------------------------------------------------\n\n\n\nvoid \nGPosition::throw_invalid(void *c) const\n{\n  if (c != cont)\n    G_THROW( ERR_MSG(\"GContainer.bad_pos_cont\") );\n  else if (! ptr)\n    G_THROW( ERR_MSG(\"GContainer.bad_pos_null\") );\n  else \n    G_THROW( ERR_MSG(\"GContainer.bad_pos\") );\n}\n\n\n\n// ------------------------------------------------------------\n// DOUBLY LINKED LISTS\n// ------------------------------------------------------------\n\n\nGListBase::GListBase(const Traits& traits)\n  : traits(traits)\n{\n  nelem = 0;\n  head.next = head.prev = 0;\n}\n\n\nGListBase::GListBase(const GListBase &ref)\n  : traits(ref.traits)\n{\n  nelem = 0;\n  head.next = head.prev = 0;\n  GListBase::operator= (ref);\n}\n\nGListBase::~GListBase()\n{\n  G_TRY\n  {\n    empty();\n  }\n  G_CATCH_ALL\n  {\n  }\n  G_ENDCATCH;\n}\n\n\nvoid \nGListBase::append(Node *n)\n{\n  // Link\n  n->next = 0;\n  n->prev = head.prev;\n  head.prev = n;\n  if (n->prev)\n    n->prev->next = n;\n  else\n    head.next = n;\n  // Finish\n  nelem += 1;\n}\n\n\nvoid \nGListBase::prepend(Node *n)\n{\n  // Link\n  n->next = head.next;\n  n->prev = 0;\n  head.next = n;\n  if (n->next)\n    n->next->prev = n;\n  else\n    head.prev = n;\n  // Finish\n  nelem += 1;\n}\n\n\nvoid \nGListBase::insert_after(GPosition pos, Node *n)\n{\n  // Prepare\n  if (pos.ptr)\n    {\n      if (pos.cont != (void*)this)\n        pos.throw_invalid((void*)this);\n      Node *p = pos.ptr;\n      n->prev = p;\n      n->next = p->next;\n    }\n  else\n    {\n      n->prev = 0;\n      n->next = head.next;\n    }\n  // Link\n  if (n->prev)\n    n->prev->next = n;\n  else\n    head.next = n;\n  if (n->next)\n    n->next->prev = n;\n  else\n    head.prev = n;\n  // Finish\n  nelem += 1;\n}\n\n\nvoid \nGListBase::insert_before(GPosition pos, Node *n)\n{\n  // Prepare\n  if (pos.ptr)\n    {\n      if (pos.cont != (void*)this)\n        pos.throw_invalid((void*)this);\n      Node *p = pos.ptr;\n      n->prev = p->prev;\n      n->next = p;\n    }\n  else\n    {\n      n->prev = head.prev;\n      n->next = 0;\n    }\n  // Link\n  if (n->prev)\n    n->prev->next = n;\n  else\n    head.next = n;\n  if (n->next)\n    n->next->prev = n;\n  else\n    head.prev = n;\n  // Finish\n  nelem += 1;\n}\n\n\nvoid\nGListBase::insert_before(GPosition pos, GListBase &fromlist, GPosition &frompos)\n{\n  // Check\n  if (!frompos.ptr || frompos.cont != (void*)&fromlist)\n    frompos.throw_invalid((void*)&fromlist);\n  if (pos.ptr && pos.cont != (void*)this)\n    pos.throw_invalid((void*)this);\n  // Update frompos\n  Node *n = frompos.ptr;\n  frompos.ptr = n->next;\n  if (pos.ptr == n) return;\n  // Unlink\n  if (n->next)\n    n->next->prev = n->prev;\n  else\n    fromlist.head.prev = n->prev;\n  if (n->prev)\n    n->prev->next = n->next;\n  else\n    fromlist.head.next = n->next;\n  fromlist.nelem -= 1;\n  // Prepare insertion\n  if (pos.ptr)\n    {\n      Node *p = pos.ptr;\n      n->prev = p->prev;\n      n->next = p;\n    }\n  else\n    {\n      n->prev = head.prev;\n      n->next = 0;\n    }\n  // Link\n  if (n->prev)\n    n->prev->next = n;\n  else\n    head.next = n;\n  if (n->next)\n    n->next->prev = n;\n  else\n    head.prev = n;\n  nelem += 1;\n}\n\n\nvoid \nGListBase::del(GPosition &pos)\n{\n  // Check\n  if (!pos.ptr || pos.cont != (void*)this) return;\n  // Unlink\n  Node *n = pos.ptr;\n  if (n->next)\n    n->next->prev = n->prev;\n  else\n    head.prev = n->prev;\n  if (n->prev)\n    n->prev->next = n->next;\n  else\n    head.next = n->next;\n  // Finish\n  nelem -= 1;\n  traits.fini( (void*)n, 1);\n  operator delete ( (void*)n );\n  pos.ptr = 0;\n}\n\n\nGPosition \nGListBase::nth(unsigned int n) const\n{\n  Node *p = 0;\n  if ((int)n < nelem)\n    for (p=head.next; p; p=p->next)\n      if ( n-- == 0)\n        break;\n  return GPosition(p, (void*)this);\n}\n\n\nvoid \nGListBase::empty()\n{\n  Node *n=head.next;\n  while (n)\n    {\n      Node *p = n->next;\n      traits.fini( (void*)n, 1 );\n      operator delete ( (void*)n );\n      n = p;\n    }\n  head.next = head.prev = 0;\n  nelem = 0;\n}\n\n\nGListBase & \nGListBase::operator= (const GListBase & ref)\n{\n  if (this == &ref)\n    return *this;\n  empty();\n  for(Node *n = ref.head.next; n; n=n->next)\n    {\n      Node *m = (Node*) operator new (traits.size);\n      traits.copy( (void*)m, (void*)n, 1, 0);\n      append(m);\n    }\n  return *this;\n}\n\n\n\n\n\n// ------------------------------------------------------------\n// ASSOCIATIVE MAPS\n// ------------------------------------------------------------\n\n\n\n\nGSetBase::GSetBase(const Traits &traits)\n  : traits(traits), nelems(0), nbuckets(0), \n    gtable(table), first(0)\n{\n  rehash(17);\n}\n\n\nGSetBase::GSetBase(const GSetBase &ref)\n  : traits(ref.traits), \n    nelems(0), nbuckets(0), gtable(table), first(0)\n{\n  GSetBase::operator= (ref);\n}\n\n\nGSetBase::~GSetBase()\n{\n  G_TRY { empty(); } G_CATCH_ALL { } G_ENDCATCH;\n//  delete [] table;\n}\n\n\nGCONT HNode *\nGSetBase::hashnode(unsigned int hashcode) const\n{\n  int bucket = hashcode % nbuckets;\n  return table[bucket];\n}\n\nGCONT HNode *\nGSetBase::installnode(HNode *n)\n{\n  // Rehash if table is more than 60% full\n  if (nelems*3 > nbuckets*2)\n    rehash( 2*nbuckets - 1 );\n  // Create and insert\n  insertnode(n);\n  return n;\n}\n\nvoid \nGSetBase::insertnode(HNode *n)\n{\n  int bucket = n->hashcode % nbuckets;\n  n->prev = n->hprev = table[bucket];\n  if (n->prev) \n    {\n      // bucket was not empty\n      n->next = n->prev->next;\n      n->prev->next = n;\n      if (n->next)\n        n->next->prev = n;\n    }\n  else\n    {\n      // bucket was empty.\n      n->next = first;\n      first = n;\n      if (n->next)\n        n->next->prev = n;\n    }\n  // finish\n  table[bucket] = n;\n  nelems += 1;\n}\n\n\nvoid   \nGSetBase::deletenode(GCONT HNode *n)\n{\n  if (n == 0) \n    return;\n  int bucket = n->hashcode % nbuckets;\n  // Regular links\n  if (n->next)\n    n->next->prev = n->prev;\n  if (n->prev)\n    n->prev->next = n->next;\n  else\n    first = (HNode*)(n->next);\n  // HPrev links\n  if (table[bucket] == n)\n    table[bucket] = n->hprev;\n  else\n    ((HNode*)(n->next))->hprev = n->hprev;\n  // Delete entry\n  traits.fini( (void*)n, 1 );\n  operator delete ( (void*)n );\n  nelems -= 1;\n}\n\n\nvoid   \nGSetBase::rehash(int newbuckets)\n{\n  // Save chain of nodes\n  Node *n = first;\n  // Simulate an empty map\n  nelems = 0;\n  first = 0;\n  // Allocate a new empty bucket table\n// delete [] table;\n  gtable.resize(0);\n  nbuckets = newbuckets;\n  typedef HNode *HNodePtr;\n// table = new HNodePtr[nbuckets];\n  gtable.resize(nbuckets);\n  gtable.clear();\n//  for (int i=0; i<nbuckets; i++)\n//    table[i] = 0;\n  // Insert saved nodes\n  while (n)\n    {\n      Node *p = n->next;\n      insertnode((HNode*)n);\n      n = p;\n    }\n}\n\n\nGSetBase& \nGSetBase::operator=(const GSetBase &ref)\n{\n  if (this == &ref) \n    return *this;\n  empty();\n  rehash(ref.nbuckets);\n  for (Node *n = ref.first; n; n=n->next)\n    {\n      HNode *m = (HNode*) operator new (traits.size);\n      traits.copy( (void*)m, (void*)n, 1, 0);\n      insertnode(m);\n    }\n  return *this;\n}\n\n\nGPosition \nGSetBase::firstpos() const\n{\n  return GPosition(first, (void*)this);\n}\n\n\nvoid \nGSetBase::del(GPosition &pos)\n{\n  if (pos.ptr && pos.cont==(void*)this)\n    {\n      deletenode((HNode*)pos.ptr);\n      pos.ptr = 0;\n    }\n}\n\nvoid \nGSetBase::empty()\n{\n  HNode *n = first;\n  while (n)\n    {\n      HNode *p = (HNode*)(n->next);\n      traits.fini( (void*)n, 1 );\n      operator delete ( (void*)n );\n      n = p;\n    }\n  first = 0;\n  nelems = 0;\n  gtable.clear();\n//  for (int i=0; i<nbuckets; i++)\n//    table[i] = 0;\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/GContainer.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _GCONTAINER_H_\n#define _GCONTAINER_H_\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n#include \"GException.h\"\n#include \"GSmartPointer.h\"\n#include <string.h>\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n// Supports old iterators (first/last/next/prev) on lists and maps?\n#ifndef GCONTAINER_OLD_ITERATORS\n#define GCONTAINER_OLD_ITERATORS 1\n#endif\n\n// Check array bounds at runtime ?\n#ifndef GCONTAINER_BOUNDS_CHECK\n#define GCONTAINER_BOUNDS_CHECK 1\n#endif\n\n// Clears allocated memory prior to running constructors ?\n#ifndef GCONTAINER_ZERO_FILL\n#define GCONTAINER_ZERO_FILL 1\n#endif\n\n// Avoid member templates (needed by old compilers)\n#ifndef GCONTAINER_NO_MEMBER_TEMPLATES\n#if defined(__GNUC__) && (__GNUC__==2) && (__GNUC_MINOR__<91)\n#define GCONTAINER_NO_MEMBER_TEMPLATES 1\n#elif defined(_MSC_VER) && !defined(__ICL)\n#define GCONTAINER_NO_MEMBER_TEMPLATES 1\n#elif defined(__MWERKS__)\n#define GCONTAINER_NO_MEMBER_TEMPLATES 1\n#else\n#define GCONTAINER_NO_MEMBER_TEMPLATES 0\n#endif\n#endif\n\n// Define typename when needed\n#ifndef GCONTAINER_NO_TYPENAME\n#define GCONTAINER_NO_TYPENAME 0\n#endif\n#if GCONTAINER_NO_TYPENAME\n#define typename /**/\n#endif\n\n\n/** @name GContainer.h\n\n    Files #\"GContainer.h\"# and #\"GContainer.cpp\"# implement three main\n    template class for generic containers.  \n    Class #GArray# (see \\Ref{Dynamic Arrays}) implements an array of objects\n    with variable bounds. Class #GList# (see \\Ref{Doubly Linked Lists})\n    implements a doubly linked list of objects.  Class #GMap# (see\n    \\Ref{Associative Maps}) implements a hashed associative map.  The\n    container templates are not thread-safe. Thread safety can be implemented\n    using the facilities provided in \\Ref{GThreads.h}.\n    \n    @memo \n    Template class for generic containers.\n    @author \n    L\\'eon Bottou <leonb@research.att.com> -- initial implementation.\\\\\n    Andrei Erofeev <eaf@geocities.com> -- bug fixes.\n*/\n//@{\n\n\n\n// ------------------------------------------------------------\n// HASH FUNCTIONS\n// ------------------------------------------------------------\n\n\n/** @name Hash functions\n    These functions let you use template class \\Ref{GMap} with the\n    corresponding elementary types. The returned hash code may be reduced to\n    an arbitrary range by computing its remainder modulo the upper bound of\n    the range.\n    @memo Hash functions for elementary types. */\n//@{\n\n/** Hashing function (unsigned int). */\nstatic inline unsigned int \nhash(const unsigned int & x) \n{ \n  return x; \n}\n\n/** Hashing function (int). */\nstatic inline unsigned int \nhash(const int & x) \n{ \n  return (unsigned int)x;\n}\n\n/** Hashing function (long). */\nstatic inline unsigned int\nhash(const long & x) \n{ \n  return (unsigned int)x;\n}\n\n/** Hashing function (unsigned long). */\nstatic inline unsigned int\nhash(const unsigned long & x) \n{ \n  return (unsigned int)x;\n}\n\n/** Hashing function (const void *). */\nstatic inline unsigned int \nhash(const void * const & x) \n{ \n  return (unsigned long) x; \n}\n\n/** Hashing function (float). */\nstatic inline unsigned int\nhash(const float & x) \n{ \n  // optimizer will get rid of unnecessary code  \n  unsigned int *addr = (unsigned int*)&x;\n  if (sizeof(float)<2*sizeof(unsigned int))\n    return addr[0];\n  else\n    return addr[0]^addr[1];\n}\n\n/** Hashing function (double). */\nstatic inline unsigned int\nhash(const double & x) \n{ \n  // optimizer will get rid of unnecessary code\n  unsigned int *addr = (unsigned int*)&x;\n  if (sizeof(double)<2*sizeof(unsigned int))\n    return addr[0];\n  else if (sizeof(double)<4*sizeof(unsigned int))\n    return addr[0]^addr[1];\n  else\n    return addr[0]^addr[1]^addr[2]^addr[3];    \n}\n\n\n\n// ------------------------------------------------------------\n// HELPER CLASSES\n// ------------------------------------------------------------\n\n\n\n/* Namespace for containers support classes.  This class is used as a\n   namespace for global identifiers related to the implementation of\n   containers.  It is inherited by all container objects.  This is disabled by\n   defining compilation symbol #GCONTAINER_NO_MEMBER_TEMPATES# to 1. */\n\n\n#ifdef _MSC_VER\n// Language lawyer say MS is wrong on that one. \n// Cf section 5.4.7 in november 1997 draft.\n#pragma warning( disable : 4243 )\n#endif\n\n\n// GPEnabled inhertenced removed again so the code works on more machines.\nclass GCont\n#if GCONTAINER_NO_MEMBER_TEMPLATES\n{\n};\n#else\n{\npublic:\n#endif\n  // --- Pointers to type management functions\n  struct Traits\n  {\n    int       size;\n    void     *(*lea)     (void *base, int n);\n    void      (*init)    (void *dst, int n); \n    void      (*copy)    (void *dst, const void* src, int n, int zap);\n    void      (*fini)    (void *dst, int n);\n  };\n#if !GCONTAINER_NO_MEMBER_TEMPLATES\nprotected:\n#endif\n  // --- Management of simple types\n  template <int SZ> class TrivTraits\n  {\n  public:\n    // The unique object\n    static const Traits & traits();\n    // Offset in an array of T\n    static void * lea(void* base, int n)\n      { return (void*)( ((char*)base) + SZ*n ); }\n    // Trivial default constructor\n    static void   init(void* dst, int n) {}\n    // Trivial copy constructor\n    static void   copy(void* dst, const void* src, int n, int ) \n      { memcpy(dst, src, SZ*n); }\n    // Trivial destructor\n    static void   fini(void* dst, int n) {}\n  };\n  // --- Management of regular types\n  template <class T> class NormTraits\n  {\n  public:\n    // The unique object\n    static const Traits & traits();\n    // Offset in an array of T\n    static void * lea(void* base, int n)\n      { return (void*)( ((T*)base) + n ); }\n    // Template based default constructor\n    static void init(void* dst, int n) \n      { T* d = (T*)dst; while (--n>=0) { new ((void*)d) T; d++; } }\n    // Template based copy constructor\n    static void copy(void* dst, const void* src, int n, int zap)\n      { T* d = (T*)dst; T* s = (T*)src; while (--n>=0) { \n          new ((void*)d) T(*s); if (zap) { s->~T(); }; d++; s++; } }\n    // Template based destructor\n    static void fini(void* dst, int n) \n      { T* d = (T*)dst; while (--n>=0) { d->~T(); d++; } }\n  };\n  // --- Base class for list nodes\n  struct Node\n  {\n    Node *next;\n    Node *prev;\n  };\n  // -- Class for list nodes\n  template <class T> struct ListNode : public Node\n  { \n    T val;\n  };\n  // -- Class for map nodes showing the hash\n  struct HNode : public Node\n  {\n    HNode *hprev;\n    unsigned int hashcode;\n  };\n  // -- Class for map nodes showing the hash and the key\n  template <class K> struct SetNode : public HNode\n  { \n    K key;\n  };\n  // -- Class for map nodes with everything\n  template <class K, class T> struct MapNode : public SetNode<K>\n  {\n    T val;\n  };\n#if !GCONTAINER_NO_MEMBER_TEMPLATES\n};\n#endif\n\n\n#if !GCONTAINER_NO_MEMBER_TEMPLATES\n#define GCONT GCont::\n#else\n#define GCONT\n#endif\n\ntemplate <int SZ> const GCONT Traits & \nGCONT TrivTraits<SZ>::traits()\n{\n  static const Traits theTraits = {\n    SZ,\n    TrivTraits<SZ>::lea,\n    TrivTraits<SZ>::init,\n    TrivTraits<SZ>::copy,\n    TrivTraits<SZ>::fini\n  };\n  return theTraits;\n}\n\ntemplate <class T> const GCONT Traits & \nGCONT NormTraits<T>::traits()\n{\n  static const Traits theTraits = {\n    sizeof(T),\n    NormTraits<T>::lea,\n    NormTraits<T>::init,\n    NormTraits<T>::copy,\n    NormTraits<T>::fini\n  };\n  return theTraits;\n}\n\n\n// ------------------------------------------------------------\n// DYNAMIC ARRAYS\n// ------------------------------------------------------------\n\n\n/** @name Dynamic Arrays\n\n    These class implement arrays of objects of any type.  Each element is\n    identified by an integer subscript.  The valid subscripts range is defined\n    by dynamically adjustable lower- and upper-bounds.  Besides accessing and\n    setting elements, member functions are provided to insert or delete\n    elements at specified positions.\n\n    Class \\Ref{GArrayTemplate} implements all methods for manipulating arrays\n    of type #TYPE#.  You should not however create instances of this class.\n    You should instead use one of the following classes:\n    \\begin{itemize}\n    \\item Class \\Ref{GArray<TYPE>} is the most general class,\n    \\item Class \\Ref{GTArray<TYPE>} is more efficient, but only works for\n          types that do not require sophisticated constructors or destructors,\n          such as the plain old C types (e.g. #int# or #char# ...).\n    \\item Class \\Ref{GPArray<TYPE>} implements an array of smart-pointers\n          \\Ref{GP<TYPE>} to objects of type #TYPE#.  Using this class \n          reduces the size of the code generated by the template instanciation.\n    \\end{itemize}\n\n    Another variant of dynamic arrays is implemented in file \\Ref{Arrays.h}.\n    The main difference is that class \\Ref{TArray}, \\Ref{DArray} and\n    \\Ref{DPArray} implement a copy-on-demand scheme.\n\n    @memo Dynamic arrays.  */\n//@{\n\nclass DJVUAPI GArrayBase : public GCont\n{\npublic:\n  // -- CONSTRUCTORS\n  GArrayBase(const GArrayBase &ref);\n  GArrayBase(const Traits &traits);\n  GArrayBase(const Traits &traits, int lobound, int hibound);\n  // -- DESTRUCTOR\n  ~GArrayBase();\n  // -- ASSIGNMENT\n  GArrayBase& operator= (const GArrayBase &ga);\n  // -- ALTERATION\n  void empty();\n  void touch(int n);\n  void resize(int lobound, int hibound);\n  void shift(int disp);\n  void del(int n, int howmany=1);\n  void ins(int n, const void *src, int howmany=1);\n  void steal(GArrayBase &ga);\nprotected:\n  const Traits &traits;\n  void  *data;\n  int   minlo;\n  int   maxhi;\n  int   lobound;\n  int   hibound;\n};\n\n\n/** Common base class for all dynamic arrays.  \n    Class \\Ref{GArrayTemplate} implements all methods for manipulating arrays\n    of type #TYPE#.  You should not however create instances of this class.\n    You should instead use class \\Ref{GArray}, \\Ref{GTArray} or\n    \\Ref{GPArray}. */\n\ntemplate<class TYPE>\nclass GArrayTemplate : protected GArrayBase\n{\npublic:\n  // -- CONSTRUCTORS\n  GArrayTemplate(const Traits &traits) : GArrayBase(traits) {}\n  GArrayTemplate(const Traits &traits, int lobound, int hibound)\n    : GArrayBase(traits, lobound, hibound) {}\n  // -- ACCESS\n  /** Returns the number of elements in the array. */\n  int size() const\n    { return hibound-lobound+1; }\n  /** Returns the lower bound of the valid subscript range. */\n  int lbound() const\n    { return lobound; }\n  /** Returns the upper bound of the valid subscript range. */\n  int hbound() const\n    { return hibound; }\n  /** Returns a reference to the array element for subscript #n#.  This\n      reference can be used for both reading (as \"#a[n]#\") and writing (as\n      \"#a[n]=v#\") an array element.  This operation will not extend the valid\n      subscript range: an exception \\Ref{GException} is thrown if argument #n#\n      is not in the valid subscript range. */\n  inline TYPE& operator[](int const n);\n  /** Returns a constant reference to the array element for subscript #n#.\n      This reference can only be used for reading (as \"#a[n]#\") an array\n      element.  This operation will not extend the valid subscript range: an\n      exception \\Ref{GException} is thrown if argument #n# is not in the valid\n      subscript range.  This variant of #operator[]# is necessary when dealing\n      with a #const GArray<TYPE>#. */\n  inline const TYPE& operator[](int n) const;\n  // -- CONVERSION\n  /** Returns a pointer for reading or writing the array elements.  This\n      pointer can be used to access the array elements with the same\n      subscripts and the usual bracket syntax.  This pointer remains valid as\n      long as the valid subscript range is unchanged. If you change the\n      subscript range, you must stop using the pointers returned by prior\n      invocation of this conversion operator. */\n  operator TYPE* ()\n    { return ((TYPE*)data)-minlo; }\n  /** Returns a pointer for reading (but not modifying) the array elements.\n      This pointer can be used to access the array elements with the same\n      subscripts and the usual bracket syntax.  This pointer remains valid as\n      long as the valid subscript range is unchanged. If you change the\n      subscript range, you must stop using the pointers returned by prior\n      invocation of this conversion operator. */\n  operator const TYPE* () const\n    { return ((const TYPE*)data)-minlo; }\n  // -- ALTERATION\n  /** Erases the array contents. All elements in the array are destroyed.  \n      The valid subscript range is set to the empty range. */\n  void empty()\n    { GArrayBase::empty(); }\n  /** Extends the subscript range so that it contains #n#.\n      This function does nothing if #n# is already int the valid subscript range.\n      If the valid range was empty, both the lower bound and the upper bound\n      are set to #n#.  Otherwise the valid subscript range is extended\n      to encompass #n#. This function is very handy when called before setting\n      an array element:\n      \\begin{verbatim}\n       int lineno=1;\n       GArray<GString> a;\n       while (! end_of_file()) { \n         a.touch(lineno); \n         a[lineno++] = read_a_line(); \n       }\n      \\end{verbatim} */\n  void touch(int n)\n    { if (n<lobound || n>hibound) GArrayBase::touch(n); }\n  /** Resets the valid subscript range to #0#---#hibound#.\n      This function may destroy some array elements and may construct\n      new array elements with the null constructor. Setting #hibound# to\n      #-1# resets the valid subscript range to the empty range. */\n  void resize(int hibound)\n    { GArrayBase::resize(0, hibound); }\n  /** Resets the valid subscript range to #lobound#---#hibound#. \n      This function may destroy some array elements and may construct\n      new array elements with the null constructor. Setting #lobound# to #0# and\n      #hibound# to #-1# resets the valid subscript range to the empty range. */\n  void resize(int lobound, int hibound)\n    { GArrayBase::resize(lobound, hibound); }\n  /** Shifts the valid subscript range. Argument #disp# is added to both \n      bounds of the valid subscript range. Array elements previously\n      located at subscript #x# will now be located at subscript #x+disp#. */\n  void shift(int disp)\n    { GArrayBase::shift(disp); }\n  /** Deletes array elements. The array elements corresponding to\n      subscripts #n#...#n+howmany-1# are destroyed. All array elements\n      previously located at subscripts greater or equal to #n+howmany#\n      are moved to subscripts starting with #n#. The new subscript upper\n      bound is reduced in order to account for this shift. */\n  void del(int n, int howmany=1)\n    { GArrayBase::del(n, howmany); }\n  /** Insert new elements into an array. This function inserts\n      #howmany# elements at position #n# into the array. These\n      elements are constructed using the default constructor for type\n      #TYPE#.  All array elements previously located at subscripts #n#\n      and higher are moved to subscripts #n+howmany# and higher. The\n      upper bound of the valid subscript range is increased in order\n      to account for this shift. */\n  void ins(int n, int howmany=1)\n    { GArrayBase::ins(n, 0, howmany); }\n  /** Insert new elements into an array. The new elements are\n      constructed by copying element #val# using the copy constructor\n      for type #TYPE#. See \\Ref{ins(int n, unsigned int howmany=1)}. */\n  void ins(int n, const TYPE &val, int howmany=1)\n    { GArrayBase::ins(n, (const void*)&val, howmany); }\n  /** Steals contents from array #ga#.  After this call, array #ga# is empty,\n      and this array contains everything previously contained in #ga#. */\n  void steal(GArrayTemplate &ga)\n    { GArrayBase::steal(ga); }\n  // -- SORTING\n  /** Sort array elements.  Sort all array elements in ascending\n      order according to the less-or-equal comparison\n      operator for type #TYPE#. */\n  void sort()\n    { sort(lbound(), hbound()); }\n  /** Sort array elements in subscript range #lo# to #hi#.  Sort all array\n      elements whose subscripts are in range #lo# to #hi# in ascending order\n      according to the less-or-equal comparison operator for type #TYPE#.  The\n      other elements of the array are left untouched.  An exception is thrown\n      if arguments #lo# and #hi# are not in the valid subscript range.  */\n  void sort(int lo, int hi);\n};\n\n\n\n/* That one must be implemented as a regular template function. */\ntemplate <class TYPE> void\nGArrayTemplate<TYPE>::sort(int lo, int hi)\n{\n  if (hi <= lo)\n    return;\n  if (hi > hibound || lo<lobound)\n    G_THROW( ERR_MSG(\"GContainer.illegal_subscript\") );\n  TYPE *data = (TYPE*)(*this);\n  // Test for insertion sort\n  if (hi <= lo + 50)\n    {\n      for (int i=lo+1; i<=hi; i++)\n        {\n          int j = i;\n          TYPE tmp = data[i];\n          while ((--j>=lo) && !(data[j]<=tmp))\n            data[j+1] = data[j];\n          data[j+1] = tmp;\n        }\n      return;\n    }\n  // -- determine suitable quick-sort pivot\n  TYPE tmp = data[lo];\n  TYPE pivot = data[(lo+hi)/2];\n  if (pivot <= tmp)\n    { tmp = pivot; pivot=data[lo]; }\n  if (data[hi] <= tmp)\n    { pivot = tmp; }\n  else if (data[hi] <= pivot)\n    { pivot = data[hi]; }\n  // -- partition set\n  int h = hi;\n  int l = lo;\n  while (l < h)\n    {\n      while (! (pivot <= data[l])) l++;\n      while (! (data[h] <= pivot)) h--;\n      if (l < h)\n        {\n          tmp = data[l];\n          data[l] = data[h];\n          data[h] = tmp;\n          l = l+1;\n          h = h-1;\n      }\n    }\n  // -- recursively restart\n  sort(lo, h);\n  sort(l, hi);\n}\n\ntemplate<class TYPE> inline TYPE&\nGArrayTemplate<TYPE>::operator[](int const n)\n{\n#if GCONTAINER_BOUNDS_CHECK\n  if (n<lobound || n>hibound)\n  {\n    G_THROW( ERR_MSG(\"GContainer.illegal_subscript\") ); \n  }\n#endif\n  return ((TYPE*)data)[n-minlo];\n}\n\n\ntemplate<class TYPE> inline const TYPE &\nGArrayTemplate<TYPE>::operator[](int const n) const\n{\n#if GCONTAINER_BOUNDS_CHECK\n  if (n<lobound || n>hibound)\n  {\n    G_THROW( ERR_MSG(\"GContainer.illegal_subscript\") ); \n  }\n#endif\n  return ((const TYPE*)data)[n-minlo];\n}\n\n\n\n/** Dynamic array for general types.  \n    Template class #GArray<TYPE># implements an array of elements of type\n    #TYPE#. This template class must be able to access the following\n    functions.\n    \\begin{itemize}\n    \\item a default constructor #TYPE::TYPE()#, \n    \\item a copy constructor #TYPE::TYPE(const TYPE &)#,\n    \\item and optionally a destructor #TYPE::~TYPE()#.\n    \\end{itemize}\n    This class only implement constructors.  See class \\Ref{GArrayTemplate}\n    for a description of all access methods. */\n\ntemplate<class TYPE>\nclass GArray : public GArrayTemplate<TYPE>\n{\npublic:\n  /** Constructs an empty array. The valid subscript range is initially\n      empty. Member function #touch# and #resize# provide convenient ways\n      to enlarge the subscript range. */\n  GArray() \n    : GArrayTemplate<TYPE>(GCONT NormTraits<TYPE>::traits() ) {}\n  /** Constructs an array with subscripts in range 0 to #hibound#. \n      The subscript range can be subsequently modified with member functions\n      #touch# and #resize#. */\n  GArray(int hi) \n    : GArrayTemplate<TYPE>(GCONT NormTraits<TYPE>::traits(), 0, hi ) {}\n  /** Constructs an array with subscripts in range #lobound# to #hibound#.  \n      The subscript range can be subsequently modified with member functions\n      #touch# and #resize#. */\n  GArray(int lo, int hi) \n    : GArrayTemplate<TYPE>(GCONT NormTraits<TYPE>::traits(), lo, hi ) {}\n  // Copy operator\n  GArray& operator=(const GArray &r)\n    { GArrayBase::operator=(r); return *this; }\n};\n\n\n/** Dynamic array for smart pointers.  \n    Template class #GPArray<TYPE># implements an array of elements of type\n    #GP<TYPE># (see \\Ref{GSmartPointer.h}).  Significantly smaller code sizes\n    can be achieved by using this class instead of the more general\n    #GArray<GP<TYPE>>#.  \n    This class only implement constructors.  See class \\Ref{GArrayTemplate}\n    for a description of all access methods.  */\n\ntemplate<class TYPE>\nclass GPArray : public GArrayTemplate<GP<TYPE> >\n{\npublic:\n  GPArray() \n    : GArrayTemplate<GP<TYPE> >(GCONT NormTraits<GPBase>::traits() ) {}\n  GPArray(int hi) \n    : GArrayTemplate<GP<TYPE> >(GCONT NormTraits<GPBase>::traits(), 0, hi ) {}\n  GPArray(int lo, int hi) \n    : GArrayTemplate<GP<TYPE> >(GCONT NormTraits<GPBase>::traits(), lo, hi ) {}\n  // Copy operator\n  GPArray& operator=(const GPArray &r)\n    { GArrayBase::operator=(r); return *this; }\n};\n\n/** Dynamic array for simple types.  \n    Template class #GTArray<TYPE># implements an array of elements of {\\em\n    simple} type #TYPE#.  {\\em Simple} means that objects of type #TYPE# can\n    be created, copied, moved or destroyed without using specific constructors\n    or destructor functions.  Class #GTArray<TYPE># will move or copy objects\n    using simple bitwise copies.  Otherwise you must use class #GArray<TYPE>#. \n    This class only implement constructors.  See class \\Ref{GArrayTemplate}\n    for a description of all access methods.  */\ntemplate<class TYPE>\nclass GTArray : public GArrayTemplate<TYPE>\n{\npublic:\n  GTArray() \n    : GArrayTemplate<TYPE>(GCONT TrivTraits<sizeof(TYPE)>::traits() ) {}\n  GTArray(int hi) \n    : GArrayTemplate<TYPE>(GCONT TrivTraits<sizeof(TYPE)>::traits(), 0, hi ) {}\n  GTArray(int lo, int hi) \n    : GArrayTemplate<TYPE>(GCONT TrivTraits<sizeof(TYPE)>::traits(), lo, hi ) {}\n  // Copy operator\n  GTArray& operator=(const GTArray &r)\n    { GArrayBase::operator=(r); return *this; }\n};\n\n\n//@}\n\n\n\n// ------------------------------------------------------------\n// DOUBLY LINKED LISTS\n// ------------------------------------------------------------\n\n\n/** @name Doubly Linked Lists\n\n    The template classes \\Ref{GList} and \\Ref{GPList} implement a doubly\n    linked list of objects of arbitrary types. Member functions are provided\n    to search the list for an element, to insert or delete elements at\n    specified positions.  Theses template class must be able to access\n    \\begin{itemize}\n    \\item a default constructor #TYPE::TYPE()#,\n    \\item a copy constructor #TYPE::TYPE(const TYPE &)#,\n    \\item optionally a destructor #TYPE::~TYPE()#,\n    \\item and optionally a comparison operator #TYPE::operator==(const TYPE &)#.\n    \\end{itemize} \n    @memo Doubly linked lists.  \n*/\n//@{\n\n/** Generic iterator class.\n    This class represents a position in a list (see \\Ref{GList}) or a map\n    (see \\Ref{GMap}).   As demonstrated by the following examples,\n    this class should be used to iterate over the objects contained\n    in a list or a map:\n    \\begin{verbatim}\n    void print_list(GList<GString> a)\n    {\n      for (GPosition i = a ; i; ++i) \n        DjVuPrintMessage(\"%s\\n\", (const char*) a[i] );\n    }\n\n    void print_list_backwards(GList<GString> a)\n    {\n      for (GPosition i = a.lastpos() ; i; --i) \n        DjVuPrintMessage(\"%s\\n\", (const char*) a[i] );\n    }\n    \\end{verbatim}\n    GPosition objects should only be used with the list or map for which they\n    have been created (using the member functions #firstpos# or #lastpos# of\n    the container).  Furthermore, you should never use a GPosition object\n    which designates a list element which has been removed from the list\n    (using member function #del# or by other means.)\n*/\n\nclass DJVUAPI GPosition : protected GCont\n{\npublic:\n  /** Creates a null GPosition object. */\n  GPosition() : ptr(0), cont(0) {}\n  /** Creates a copy of a GPosition object. */\n  GPosition(const GPosition &ref) : ptr(ref.ptr), cont(ref.cont) {}\n  /** Tests whether this GPosition object is non null. */\n  operator int() const \n    { return !!ptr; }\n  /** Tests whether this GPosition object is null. */\n  int operator !() const \n    { return !ptr; }\n  /** Moves this GPosition object to the next object in the container. */\n  GPosition& operator ++() \n    { if (ptr) ptr = ptr->next; return *this; }\n  /** Moves this GPosition object to the previous object in the container. */\n  GPosition& operator --() \n    { if (ptr) ptr = ptr->prev; return *this; }\n  // Internal. Do not use.\n  GPosition(Node *p, void *c) : ptr(p), cont(c) {}\n#if GCONTAINER_BOUNDS_CHECK\n  Node *check(void *c) \n    { if (!ptr || c!=cont) throw_invalid(c); return ptr; }\n  const Node *check(void *c) const\n    { if (!ptr || c!=cont) throw_invalid(c); return ptr; }\n#else\n  Node *check(void *c) \n    { return ptr; }\n  const Node *check(void *c) const\n    { return ptr; }\n#endif\nprotected:\n  Node *ptr;\n  void *cont;\n  friend class GListBase;\n  friend class GSetBase;\n  void throw_invalid(void *c) const no_return;\n};\n\n\nclass DJVUAPI GListBase : public GCont\n{\nprotected:\n  GListBase(const Traits& traits);\n  GListBase(const GListBase &ref);\n  void append(Node *n);\n  void prepend(Node *n);\n  void insert_after(GPosition pos, Node *n);\n  void insert_before(GPosition pos, Node *n);\n  void insert_before(GPosition pos, GListBase &fromlist, GPosition &frompos);\n  void del(GPosition &pos);\nprotected:\n  const Traits &traits;\n  int nelem;\n  Node head;\npublic:\n  ~GListBase();\n  GListBase & operator= (const GListBase & gl);\n  GPosition firstpos() const { return GPosition(head.next, (void*)this); }\n  GPosition lastpos() const { return GPosition(head.prev, (void*)this); }\n  bool isempty() const { return nelem==0; };\n  GPosition nth(unsigned int n) const;\n  void empty();\n};\n\n\ntemplate<class TI>\nclass GListImpl : public GListBase\n{\nprotected:\n  GListImpl();\n  typedef GCONT ListNode<TI> LNode;\n  static Node * newnode(const TI &elt);\n  int operator==(const GListImpl<TI> &l2) const;\n  int search(const TI &elt, GPosition &pos) const;\n};\n\ntemplate<class TI> \nGListImpl<TI>::GListImpl() \n  : GListBase( GCONT NormTraits<LNode>::traits() ) \n{ \n}\n\ntemplate<class TI> GCONT Node *\nGListImpl<TI>::newnode(const TI &elt)\n{\n  LNode  *n = (LNode *) operator new (sizeof(LNode ));\n#if GCONTAINER_ZERO_FILL\n  memset(n, 0, sizeof(LNode ));\n#endif\n  new ((void*)&(n->val)) TI(elt);\n  return (Node*) n;\n}\n\ntemplate<class TI> int\nGListImpl<TI>::operator==(const GListImpl<TI> &l2) const\n{\n  Node *p, *q;\n  for (p=head.next, q=l2.head.next; p && q; p=p->next, q=q->next )\n    if (((LNode*)p)->val != ((LNode*)q)->val)\n      return 0;\n  return p==0 && q==0;\n}\n\ntemplate<class TI> int\nGListImpl<TI>::search(const TI &elt, GPosition &pos) const\n{\n  Node *n = (pos ? pos.check((void*)this) : head.next);\n  for (; n; n=n->next) \n    if ( ((LNode *)n)->val == elt ) \n      break;\n  if (n) pos = GPosition(n, (void*)this);\n  return (n != 0);\n}\n\n\n/** Common base class for all doubly linked lists.  \n    Class \\Ref{GListTemplate} implements all methods for manipulating lists \n    of of objects of type #TYPE#.  You should not however create instances of \n    this class. You should instead use class \\Ref{GList} or \\Ref{GPList}. */\n\ntemplate <class TYPE, class TI>\nclass GListTemplate : protected GListImpl<TI>\n{\npublic:\n  // -- ACCESS\n  /** Returns the number of elements in the list. */\n  int size() const\n    { return this->nelem; }\n  /** Returns the first position in the list. See \\Ref{GPosition}. */\n  GPosition firstpos() const\n    { return GListImpl<TI>::firstpos(); }\n  /** Returns the last position in the list. See \\Ref{GPosition}. */\n  GPosition lastpos() const\n    { return GListImpl<TI>::lastpos(); }\n  /** Implicit notation for GList::firstpos(). */\n  operator GPosition() const\n    { return firstpos(); }    \n  /** Returns a reference to the list element at position #pos#.  This\n      reference can be used for both reading (as \"#a[n]#\") and modifying (as\n      \"#a[n]=v#\") a list element.  Using an invalid position will cause a\n      segmentation violation. See \\Ref{GPosition} for efficient operations on\n      positions. */\n  TYPE& operator[](GPosition pos)\n    { return (TYPE&) (((typename GListImpl<TI>::LNode *)pos.check((void*)this))->val); }\n  /** Returns a constant reference to the list element at position #pos#.\n      This reference only be used for reading a list element.  An exception\n      \\Ref{GException} is thrown if #pos# is not a valid position. This\n      variant of #operator[]# is necessary when dealing with a #const\n      GList<TYPE>#.  See \\Ref{GPosition} for efficient operations on\n      positions. */\n  const TYPE& operator[](GPosition pos) const\n    { return (const TYPE&) (((const typename GListImpl<TI>::LNode *)pos.check((void*)this))->val); }\n  // -- TEST\n  /** Tests whether a list is empty.  \n      Returns a non zero value if the list contains no elements. */\n  bool isempty() const \n    { return this->nelem==0; }\n  /** Compares two lists. Returns a non zero value if and only if both lists\n      contain the same elements (as tested by #TYPE::operator==(const TYPE&)#\n      in the same order. */\n  int operator==(const GListTemplate<TYPE,TI> &l2) const\n    { return GListImpl<TI>::operator==(l2); }\n  // -- SEARCHING\n  /** Returns the position #pos# of the #n#-th list element.  An invalid\n      position is returned if the list contains less than #n# elements. The\n      operation works by sequentially scanning the list until reaching the\n      #n#-th element. */\n  GPosition nth(unsigned int n) const\n    { return GListImpl<TI>::nth(n); }\n  /*  Compatibility */\n  int nth(unsigned int n, GPosition &pos) const\n    { GPosition npos=nth(n); if (npos) pos=npos; return !!pos; }\n  /** Tests whether the list contains a given element.  If the list contains\n      #elt#, the position of the the first list element equal to #elt# as\n      checked by #TYPE::operator==(const TYPE&)# is returned.  Otherwise an\n      invalid position is returned. */\n  GPosition contains(const TYPE &elt) const\n    { GPosition pos; GListImpl<TI>::search((const TI&)elt, pos); return pos; }\n  /** Searches the list for a given element. If position #pos# is a valid\n      position for this list, the search starts at the specified position. If\n      position #pos# is not a valid position, the search starts at the\n      beginning of the list.  The list elements are sequentially compared with\n      #elt# using #TYPE::operator==(const TYPE&)#.  As soon as a list element\n      is equal to #elt#, function #search# sets argument #pos# with the\n      position of this list element and returns 1.  If however the search\n      reaches the end of the list, function #search# returns 0 and leaves\n      #pos# unchanged. */\n  int search(const TYPE &elt, GPosition &pos) const\n    { return GListImpl<TI>::search((const TI&)elt, pos); }\n  // -- ALTERATION\n  /** Erases the list contents.  All list elements are destroyed and\n      unlinked. The list is left with zero elements. */\n  void empty()\n    { GListImpl<TI>::empty(); }\n  /** Inserts an element after the last element of the list. \n      The new element is initialized with a copy of argument #elt#. */\n  void append(const TYPE &elt)\n    { GListImpl<TI>::append(this->newnode((const TI&)elt)); }\n  /** Inserts an element before the first element of the list. \n      The new element is initialized with a copy of argument #elt#. */\n  void prepend(const TYPE &elt)\n    { GListImpl<TI>::prepend(this->newnode((const TI&)elt)); }\n  /** Inserts a new element after the list element at position #pos#.  When\n      position #pos# is null the element is inserted at the beginning of the\n      list.  The new element is initialized with a copy of #elt#. */\n  void insert_after(GPosition pos, const TYPE &elt)\n    { GListImpl<TI>::insert_after(pos, this->newnode((const TI&)elt)); }\n  /** Inserts a new element before the list element at position #pos#. When\n      position #pos# is null the element is inserted at the end of the\n      list. The new element is initialized with a copy of #elt#. */\n  void insert_before(GPosition pos, const TYPE &elt)\n    { GListImpl<TI>::insert_before(pos, this->newnode((const TI&)elt)); }\n  /** Inserts an element of another list into this list.  This function\n      removes the element at position #frompos# in list #frompos#, inserts it\n      in the current list before the element at position #pos#, and advances\n      #frompos# to the next element in list #fromlist#. When position #pos# is\n      null the element is inserted at the end of the list. */\n  void insert_before(GPosition pos, GListTemplate<TYPE,TI> &fromlist, GPosition &frompos)\n    { GListImpl<TI>::insert_before(pos, fromlist, frompos); }\n  /** Destroys the list element at position #pos#.  This function does \n      nothing unless position #pos# is a valid position. */\n  void del(GPosition &pos)\n    { GListImpl<TI>::del(pos); }\n  /* Old iterators. Do not use. */\n#if GCONTAINER_OLD_ITERATORS\n  void first(GPosition &pos) const { pos = firstpos(); }\n  void last(GPosition &pos) const { pos = lastpos(); }\n  const TYPE *next(GPosition &pos) const \n    { if (!pos) return 0; const TYPE *x=&((*this)[pos]); ++pos; return x; }\n  const TYPE *prev(GPosition &pos) const \n    { if (!pos) return 0; const TYPE *x=&((*this)[pos]); --pos; return x; }\n  TYPE *next(GPosition &pos)\n    { if (!pos) return 0; TYPE *x=&((*this)[pos]); ++pos; return x; }\n  TYPE *prev(GPosition &pos)\n    { if (!pos) return 0; TYPE *x=&((*this)[pos]); --pos; return x; }\n#endif\n};\n\n\n/** Doubly linked lists.  Template class #GList<TYPE># implements a doubly\n    linked list of elements of type #TYPE#.  This class only implement\n    constructors.  See class \\Ref{GListTemplate} and \\Ref{GPosition} for a\n    description of all access methods. */\n\ntemplate <class TYPE>\nclass GList : public GListTemplate<TYPE,TYPE>\n{\npublic:\n  /** Null Constructor. Constructs a list with zero elements. */\n  GList() : GListTemplate<TYPE,TYPE>() {}\n  GList& operator=(const GList &r) \n    { GListBase::operator=(r); return *this; }\n};\n\n\n/** Doubly linked lists for smart pointers. \n    Template class #GList<TYPE># implements a doubly linked list of elements\n    of type #GP<TYPE># (see \\Ref{GSmartPointer.h}).  Significantly smaller\n    code sizes can be achieved by using this class instead of the more general\n    #GArray<GP<TYPE>>#.  \n    This class only implement constructors.  See class \\Ref{GListTemplate} and\n    \\Ref{GPosition} for a description of all access methods. */\n\ntemplate <class TYPE>\nclass GPList : public GListTemplate<GP<TYPE>,GPBase>\n{\npublic:\n  /** Null Constructor. Constructs a list with zero elements. */\n  GPList() : GListTemplate<GP<TYPE>,GPBase>() {}\n  GPList& operator=(const GPList &r) \n    { GListBase::operator=(r); return *this; }\n};\n\n\n//@}\n\n\n\n// ------------------------------------------------------------\n// ASSOCIATIVE MAPS\n// ------------------------------------------------------------\n\n/** @name Associative Maps\n\n    These template classes implements a associative maps.  The associative map\n    contains an arbitrary number of entries. Each entry is a pair containing\n    one element of type #KTYPE# (named the \"key\") and one element of type\n    #VTYPE# (named the \"value\").  All entries have distinct keys. \n    These template class must be able to access the following functions:\n    \\begin{itemize}\n    \\item a #VTYPE# default constructor #VTYPE::VTYPE()#, \n    \\item a #VTYPE# copy constructor #VTYPE::VTYPE(const VTYPE &)#, \n    \\item optionally a #VTYPE# destructor #VTYPE::~VTYPE()#,\n    \\item a #KTYPE# default constructor #KTYPE::KTYPE()#, \n    \\item a #KTYPE# copy constructor #KTYPE::KTYPE(const KTYPE &)#, \n    \\item optionally a #KTYPE# destructor #KTYPE::~KTYPE()#,\n    \\item a #KTYPE# comparison operator #KTYPE::operator==(const KTYPE &)#,\n    \\item and a #KTYPE# hashing function #hash(const KTYPE&)#.\n    \\end{itemize} \n    The hashing function must return an #unsigned int# number. Multiple\n    invocations of the hashing function with equal arguments (in the sense of\n    #KTYPE::operator==#) must always return the same number.  \n    Position objects (see \\Ref{GPosition}) may be used to iterate over the\n    entries contained by an associative map. \n    @memo Associative maps.\n*/\n//@{\n\nclass DJVUAPI GSetBase : public GCont\n{\nprotected:\n  GSetBase(const Traits &traits);\n  GSetBase(const GSetBase &ref);\n  static GCONT HNode *newnode(const void *key);\n  HNode *hashnode(unsigned int hashcode) const;\n  HNode *installnode(HNode *n);\n  void   deletenode(HNode *n);\nprotected:\n  const Traits &traits;\n  int nelems;\n  int nbuckets;\n  HNode **table;\n  GPBuffer<HNode *> gtable;\n  HNode *first;\nprivate:\n  void insertnode(HNode *n);\n  void rehash(int newbuckets);\npublic:\n  ~GSetBase();\n  GSetBase& operator=(const GSetBase &ref);\n  GPosition firstpos() const;\n  void del(GPosition &pos); \n  void empty();\n};\n\ntemplate <class K>\nclass GSetImpl : public GSetBase\n{\nprotected:\n  GSetImpl();\n  GSetImpl(const Traits &traits);\n  typedef GCONT SetNode<K> SNode;\n  HNode *get(const K &key) const;\n  HNode *get_or_throw(const K &key) const;\n  HNode *get_or_create(const K &key);\npublic:\n  GPosition contains(const K &key) const \n    { return GPosition( get(key), (void*)this); }\n  void del(const K &key) \n    { deletenode(get(key)); }\n};\n\ntemplate<class K>\nGSetImpl<K>::GSetImpl()\n  : GSetBase( GCONT NormTraits<GCONT SetNode<K> >::traits() )\n{ \n}\n\ntemplate<class K>\nGSetImpl<K>::GSetImpl(const Traits &traits)\n  : GSetBase(traits) \n{ \n}\n\ntemplate<class K> GCONT HNode *\nGSetImpl<K>::get(const K &key) const\n{ \n  unsigned int hashcode = hash(key);\n  for (SNode *s=(SNode*)hashnode(hashcode); s; s=(SNode*)(s->hprev))\n    if (s->hashcode == hashcode && s->key == key) return s;\n  return 0;\n}\n\n#if GCONTAINER_BOUNDS_CHECK\ntemplate<class K> GCONT HNode *\nGSetImpl<K>::get_or_throw(const K &key) const\n{ \n  HNode *m = get(key);\n  if (!m)\n  {\n    G_THROW( ERR_MSG(\"GContainer.cannot_add\") );\n  }\n  return m;\n}\n#else\ntemplate<class K> inline GCONT HNode *\nGSetImpl<K>::get_or_throw(const K &key) const\n{ \n  return get(key);\n}\n#endif\n\ntemplate<class K> GCONT HNode *\nGSetImpl<K>::get_or_create(const K &key)\n{\n  HNode *m = get(key);\n  if (m) return m;\n  SNode *n = (SNode*) operator new (sizeof(SNode));\n#if GCONTAINER_ZERO_FILL\n  memset(n, 0, sizeof(SNode));\n#endif\n  new ((void*)&(n->key)) K ( key );\n  n->hashcode = hash((const K&)(n->key));\n  installnode(n);\n  return n;\n}\n\ntemplate <class K, class TI>\nclass GMapImpl : public GSetImpl<K>\n{\nprotected:\n  GMapImpl();\n  GMapImpl(const GCONT Traits &traits);\n  typedef GCONT MapNode<K,TI> MNode;\n  GCONT HNode* get_or_create(const K &key);\n};\n\ntemplate<class K, class TI>\nGMapImpl<K,TI>::GMapImpl()\n  : GSetImpl<K> ( GCONT NormTraits<GCONT MapNode<K,TI> >::traits() ) \n{ \n}\n\ntemplate<class K, class TI>\nGMapImpl<K,TI>::GMapImpl(const GCONT Traits &traits)\n  : GSetImpl<K>(traits) \n{ \n}\n\ntemplate<class K, class TI> GCONT HNode *\nGMapImpl<K,TI>::get_or_create(const K &key)\n{\n  GCONT HNode *m = this->get(key);\n  if (m) return m;\n  MNode *n = (MNode*) operator new (sizeof(MNode));\n#if GCONTAINER_ZERO_FILL\n  memset(n, 0, sizeof(MNode));\n#endif\n  new ((void*)&(n->key)) K  (key);\n  new ((void*)&(n->val)) TI ();\n  n->hashcode = hash((const K&)(n->key));\n  this->installnode(n);\n  return n;\n}\n\n\n\n/** Common base class for all associative maps.\n    Class \\Ref{GArrayTemplate} implements all methods for manipulating \n    associative maps with key type #KTYPE# and value type #VTYPE#. \n    You should not however create instances of this class.\n    You should instead use class \\Ref{GMap} or \\Ref{GPMap}. */\n\ntemplate <class KTYPE, class VTYPE, class TI>\nclass GMapTemplate : protected GMapImpl<KTYPE,TI>\n{\npublic:\n  /** Returns the number of elements in the map. */\n  int size() const\n    { return this->nelems; }\n  /** Returns the first position in the map. */\n  GPosition firstpos() const\n    { return GMapImpl<KTYPE,TI>::firstpos(); }\n  /** Implicit notation for GMap::firstpos(). */\n  operator GPosition() const\n    { return firstpos(); }    \n  /** Tests whether the associative map is empty.  \n      Returns a non zero value if and only if the map contains zero entries. */\n  bool isempty() const\n    { return this->nelems==0; }\n  /** Searches an entry for key #key#.  If the map contains an entry whose key\n      is equal to #key# according to #KTYPE::operator==(const KTYPE&)#, this\n      function returns its position.  Otherwise it returns an invalid\n      position. */\n  GPosition contains(const KTYPE &key) const\n    { return GMapImpl<KTYPE,TI>::contains(key); }\n  /*  Compatibility */\n  GPosition contains(const KTYPE &key, GPosition &pos) const\n    { return pos = GMapImpl<KTYPE,TI>::contains(key); }\n  // -- ALTERATION\n  /** Erases the associative map contents.  All entries are destroyed and\n      removed. The map is left with zero entries. */\n  void empty()\n    { GMapImpl<KTYPE,TI>::empty(); }\n  /** Returns a constant reference to the key of the map entry at position\n      #pos#.  An exception \\Ref{GException} is thrown if position #pos# is not\n      valid.  There is no direct way to change the key of a map entry. */\n  const KTYPE &key(const GPosition &pos) const\n    { return (const KTYPE&)(((typename GMapImpl<KTYPE,TI>::MNode*)(pos.check((void*)this)))->key); }\n  /** Returns a reference to the value of the map entry at position #pos#.\n      This reference can be used for both reading (as \"#a[n]#\") and modifying\n      (as \"#a[n]=v#\").  An exception \\Ref{GException} is thrown if position\n      #pos# is not valid. */\n  VTYPE& operator[](const GPosition &pos)\n    { return (VTYPE&)(((typename GMapImpl<KTYPE,TI>::MNode*)(pos.check((void*)this)))->val); }\n  /** Returns a constant reference to the value of the map entry at position\n      #pos#.  This reference can only be used for reading (as \"#a[n]#\") the\n      entry value.  An exception \\Ref{GException} is thrown if position #pos#\n      is not valid. */\n  const VTYPE& operator[](const GPosition &pos) const\n    { return (const VTYPE&)(((typename GMapImpl<KTYPE,TI>::MNode*)(pos.check((void*)this)))->val); }\n  /** Returns a constant reference to the value of the map entry for key\n      #key#.  This reference can only be used for reading (as \"#a[n]#\") the\n      entry value.  An exception \\Ref{GException} is thrown if no entry\n      contains key #key#. This variant of #operator[]# is necessary when\n      dealing with a #const GMAP<KTYPE,VTYPE>#. */\n  const VTYPE& operator[](const KTYPE &key) const\n    { return (const VTYPE&)(((const typename GMapImpl<KTYPE,TI>::MNode*)(this->get_or_throw(key)))->val); }\n  /** Returns a reference to the value of the map entry for key #key#.  This\n      reference can be used for both reading (as \"#a[n]#\") and modifying (as\n      \"#a[n]=v#\"). If there is no entry for key #key#, a new entry is created\n      for that key with the null constructor #VTYPE::VTYPE()#. */\n  VTYPE& operator[](const KTYPE &key)\n    { return (VTYPE&)(((typename GMapImpl<KTYPE,TI>::MNode*)(this->get_or_create(key)))->val); }\n  /** Destroys the map entry for position #pos#.  \n      Nothing is done if position #pos# is not a valid position. */\n  void del(GPosition &pos)\n    { GSetBase::del(pos); }\n  /** Destroys the map entry for key #key#.  \n      Nothing is done if there is no entry for key #key#. */\n  void del(const KTYPE &key)\n    { GMapImpl<KTYPE,TI>::del(key); }\n  /* Old iterators. Do not use. */\n#if GCONTAINER_OLD_ITERATORS\n  void first(GPosition &pos) const { pos = firstpos(); }\n  const VTYPE *next(GPosition &pos) const \n    { if (!pos) return 0; const VTYPE *x=&((*this)[pos]); ++pos; return x; }\n  VTYPE *next(GPosition &pos)\n    { if (!pos) return 0; VTYPE *x=&((*this)[pos]); ++pos; return x; }\n#endif\n};\n\n\n\n/** Associative maps.  \n    Template class #GMap<KTYPE,VTYPE># implements an associative map.\n    The map contains an arbitrary number of entries. Each entry is a\n    pair containing one element of type #KTYPE# (named the \"key\") and one\n    element of type #VTYPE# (named the \"value\").  \n    The entry associated to a particular value of the key can retrieved\n    very efficiently.\n    This class only implement constructors.  See class \\Ref{GMapTemplate} and\n    \\Ref{GPosition} for a description of all access methods.*/\n\ntemplate <class KTYPE, class VTYPE>\nclass GMap : public GMapTemplate<KTYPE,VTYPE,VTYPE>\n{\npublic:\n  // -- ACCESS\n  GMap() : GMapTemplate<KTYPE,VTYPE,VTYPE>() {}\n  GMap& operator=(const GMap &r) \n    { GSetBase::operator=(r); return *this; }\n};\n\n/** Associative maps for smart-pointers.  \n    Template class #GMap<KTYPE,VTYPE># implements an associative map for key\n    type #KTYPE# and value type #GP<VTYPE># (see \\Ref{GSmartPointer.h}).  The\n    map contains an arbitrary number of entries. Each entry is a pair\n    containing one element of type #KTYPE# (named the \"key\") and one aelement\n    of type #VTYPE# (named the \"value\").  The entry associated to a particular\n    value of the key can retrieved very efficiently.\n    Significantly smaller code sizes can be achieved by using this class\n    instead of the more general #GMap<KTYPE,GP<VTYPE>># (see \\Ref{GMap}).\n    This class only implement constructors.  See class \\Ref{GMapTemplate} and\n    \\Ref{GPosition} for a description of all access methods.*/\n\ntemplate <class KTYPE, class VTYPE>\nclass GPMap : public GMapTemplate<KTYPE,GP<VTYPE>,GPBase>\n{\npublic:\n  GPMap() : GMapTemplate<KTYPE,GP<VTYPE>,GPBase>() {}\n  GPMap& operator=(const GPMap &r) \n    { GSetBase::operator=(r); return *this; }\n};\n\n\n\n//@}\n//@}\n//@}\n\n// ------------ THE END\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n\n\n"
  },
  {
    "path": "ext/libdjvu/GException.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include <stddef.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include \"GException.h\"\n#include \"DjVuMessageLite.h\"\n#include \"debug.h\"\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n// - Author: Leon Bottou, 05/1997\n\nGException::GException() \n  : cause(0), file(0), func(0), line(0), source(GException::GINTERNAL)\n{\n}\n\nconst char * const\nGException::outofmemory = ERR_MSG(\"GException.outofmemory\");\n\nGException::GException(const GException & exc) \n  : file(exc.file), func(exc.func), line(exc.line), source(exc.source)\n{\n  if (exc.cause && exc.cause!=outofmemory) \n    {\n      char *s = new char[strlen(exc.cause)+1];\n      strcpy(s, exc.cause);\n      cause = s;\n    }\n  else\n    {\n      cause = exc.cause;\n    }\n}\n\nGException::GException (const char *xcause, const char *file, int line,\n   const char *func, const source_type xsource)\n  : file(file), func(func), line(line), source(xsource)\n{\n  // good place to set a breakpoint and DEBUG message too. \n  // It'd hard to track exceptions which seem to go from nowhere\n#ifdef DEBUG_MSG\n  DEBUG_MSG(\"GException::GException(): cause=\" << (xcause ? xcause : \"unknown\") << \"\\n\");\n#endif\n  if (xcause && xcause!=outofmemory) \n    {\n      char *s = new char[strlen(xcause)+1];\n      strcpy(s, xcause);\n      cause = s;\n    }\n  else\n    {\n      cause = xcause;\n    }\n}\n\nGException::~GException(void)\n{\n  if (cause && cause!=outofmemory ) \n    delete [] const_cast<char*>(cause); \n  cause=file=func=0;\n}\n\nGException & \nGException::operator=(const GException & exc)\n{\n  if (cause && cause!=outofmemory) \n    delete [] const_cast<char*>(cause);\n  cause = 0;\n  file = exc.file;\n  func = exc.func;\n  line = exc.line;\n  source=exc.source;\n  if (exc.cause && exc.cause!=outofmemory) \n    {\n      char *s = new char[strlen(exc.cause)+1];\n      strcpy(s, exc.cause);\n      cause = s;\n    }\n  else\n    {\n      cause = exc.cause;\n    }\n  return *this;\n}\n\nvoid\nGException::perror(void) const\n{\n  fflush(0);\n  DjVuPrintErrorUTF8(\"*** \");\n  DjVuMessageLite::perror(get_cause());\n  if (file && line>0)\n    DjVuPrintErrorUTF8(\"*** (%s:%d)\\n\", file, line);    \n  else if (file)\n    DjVuPrintErrorUTF8(\"*** (%s)\\n\", file);\n  if (func)\n    DjVuPrintErrorUTF8(\"*** '%s'\\n\", func);    \n  DjVuPrintErrorUTF8(\"\\n\");\n}\n\nconst char* \nGException::get_cause(void) const\n{\n  if (! cause)\n    return \"Invalid exception\";\n  return cause;\n}\n\nint\nGException::cmp_cause(const char s1[] , const char s2[])\n{\n  int retval;\n  if(! s2 || !s2[0])\n  {\n    retval=(s1&&s1[0])?1:(-1);\n  }else if(! s1 || !s1[0])\n  {\n    retval=(-1);\n  }else\n  {\n    const char *end_s1=strpbrk(s1,\"\\t\\n\");\n    const int n1=end_s1?(int)((size_t)end_s1-(size_t)s1):strlen(s1);\n    const char *end_s2=strpbrk(s1,\"\\t\\n\");\n    const int n2=end_s2?(int)((size_t)end_s2-(size_t)s2):strlen(s2);\n    retval=(n1==n2)?strncmp(s1,s2,n1):strcmp(s1,s2);\n  }\n  return retval;\n}\n\nint\nGException::cmp_cause(const char s2[]) const\n{\n  return cmp_cause(cause,s2);\n}\n\n#ifdef USE_EXCEPTION_EMULATION\n\nGExceptionHandler *GExceptionHandler::head = 0;\n\nvoid\nGExceptionHandler::emthrow(const GException &gex)\n{\n  if (head)\n    {\n      head->current = gex;\n      longjmp(head->jump, -1);\n    }\n  else\n    {\n      DjVuPrintErrorUTF8(\"\\n*** Unhandled exception\");\n      gex.perror();\n      abort();\n    }\n}\n\n#else // ! USE_EXCEPTION_EMULATION\n\nstatic int abort_on_exception = 0;\n\nvoid \n#ifndef NO_LIBGCC_HOOKS\nGExceptionHandler::exthrow(const GException &ex)\n#else\nGExceptionHandler::exthrow(const GException ex)\n#endif /* NO_LIBGCC_HOOKS */\n{\n  if (abort_on_exception) \n    abort();\n  throw ex;\n}\n\nvoid \nGExceptionHandler::rethrow(void)\n{\n  if (abort_on_exception) \n    abort();\n  throw;\n}\n\n#endif\n\n\n\n// ------ MEMORY MANAGEMENT HANDLER\n\n/* SumatraPDF: prevent exception handler overriding when not building stand-alone libdjvu */\n#ifdef ALLOW_GLOBAL_OOM_HANDLING\n#ifndef NEED_DJVU_MEMORY\n// This is not activated when C++ memory management\n// is overidden.  The overriding functions handle\n// memory exceptions by themselves.\n# if defined(_MSC_VER)\n// Microsoft is different!\nstatic int throw_memory_error(size_t) { G_THROW(GException::outofmemory); return 0; }\nstatic int (*old_handler)(size_t) = _set_new_handler(throw_memory_error);\n# else // !_MSC_VER\n// Standard C++\nstatic void throw_memory_error() { G_THROW(GException::outofmemory); }\n#  if !defined(WIN32) && !defined(__CYGWIN32__) && !defined(OS2)\n#   ifdef HAVE_STDINCLUDES\nstatic void (*old_handler)() = std::set_new_handler(throw_memory_error);\n#   else\nstatic void (*old_handler)() = set_new_handler(throw_memory_error);\n#   endif // HAVE_STDINCLUDES\n#  endif // ! WIN32\n# endif // !_MSC_VER\n#endif // !NEED_DJVU_MEMORY\n#endif\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/GException.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _GEXCEPTION_H_\n#define _GEXCEPTION_H_\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n#ifndef no_return\n#ifdef __GNUC__\n#define no_return __attribute__ ((noreturn))\n#else\n#define no_return\n#endif\n#endif\n\n/** @name GException.h\n\n    Files #\"GException.h\"# and #\"GException.cpp\"# define a portable exception\n    scheme used through the DjVu Reference Library. This scheme can use native\n    C++ exceptions or an exception emulation based on #longjmp#/#setjmp#. A\n    particular model can be forced a compile time by defining option\n    #CPP_SUPPORTS_EXCEPTIONS# or #USE_EXCEPTION_EMULATION#.\n    \n    This emulation code was motivated because many compilers did not properly\n    support exceptions as mandated by the C++ standard documents. This\n    emulation is now considered obsolete because (a) it is not able to call\n    the proper destructors when an exception occurs, and (b) it is not thread\n    safe.  Although all modern C++ compiler handle exception decently, the\n    exception handling intrinsics are not always thread safe.  Therefore we\n    urge programmers to {\\em only} use exceptions to signal error conditions\n    that force the library to discontinue execution.\n    \n    There are four macros for handling exceptions.  Macros #G_TRY#, #G_CATCH# and\n    #G_ENDCATCH# are used to define an exception catching block.  Exceptions can\n    be thrown at all times using macro #G_THROW(cause)#. An exception can be\n    re-thrown from a catch block using macro #G_RETHROW#.\n    \n    Example:\n    \\begin{verbatim}\n    G_TRY\n      {\n        // program lines which may result in a call to THROW()\n        G_THROW(\"message\");\n      }\n    G_CATCH(ex) \n      {\n        // Variable ex refers to a GException object.\n        ex.perror();  \n        // You can rethrow the exception to an outer exception handler.\n        G_RETHROW;\n      }\n    G_ENDCATCH;\n    \\end{verbatim} \n\n    @memo \n    Portable exceptions.\n    @author \n    L\\'eon Bottou <leonb@research.att.com> -- initial implementation.\\\\\n    Andrei Erofeev <eaf@geocities.com> -- fixed message memory allocation.\n*/\n//@{\n\n#include \"DjVuGlobal.h\"\n\n// Check if compiler supports native exceptions\n#ifdef HAVE_CONFIG_H\n# if HAVE_EXCEPTIONS\n#  define CPP_SUPPORTS_EXCEPTIONS\n# endif\n#else\n# if defined(_MSC_VER)\n#  define CPP_SUPPORTS_EXCEPTIONS\n# endif\n# if defined(__MWERKS__)\n#  define CPP_SUPPORTS_EXCEPTIONS\n# endif\n# if defined(__EXCEPTIONS)\n#  define CPP_SUPPORTS_EXCEPTIONS\n# endif\n#endif\n// Decide which exception model to use\n#ifndef CPP_SUPPORTS_EXCEPTIONS\n# ifndef USE_EXCEPTION_EMULATION\n#  define USE_EXCEPTION_EMULATION\n# endif\n#endif\n\n#ifdef USE_EXCEPTION_EMULATION\n# include <setjmp.h>\n#endif\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n# endif\n#endif\n\n/** Exception class.  \n    The library always uses macros #G_TRY#, #G_THROW#, #G_CATCH# and #G_ENDCATCH# for\n    throwing and catching exceptions (see \\Ref{GException.h}). These macros\n    only deal with exceptions of type #GException#. */\n\nclass DJVUAPI GException {\npublic:\n  enum source_type { GINTERNAL=0, GEXTERNAL, GAPPLICATION, GOTHER };\n  /** Constructs a GException.  This constructor is usually called by macro\n      #G_THROW#.  Argument #cause# is a plain text error message. As a\n      convention, string #ByteStream::EndOfFile# is used when reaching an unexpected\n      end-of-file condition and string #DataPool::Stop# is used when the user\n      interrupts the execution. The remaining arguments are usually provided\n      by the predefined macros #__FILE__#, #__LINE__#, and (G++ and EGCS only)\n      #__PRETTY_FUNCTION__#.  */\n  GException (const char *cause, const char *file=0, int line=0, \n              const char *func=0, const source_type source=GINTERNAL);\n\n  /** Copy Constructor. */\n  GException (const GException & exc);\n  \n  /** Null Constructor. */\n  GException ();\n  \n  /** Destructor. */\n  virtual ~GException(void);\n  \n  /** Copy Operator. */\n  GException & operator=(const GException & exc);\n  \n  /** Prints an error message on stderr.\n      This function no longer takes a message parameter because \n      some instances used a i18n message id and other instances\n      used a literal string. */\n  void perror(void) const;\n  \n  /** Returns the string describing the cause of the exception.  The returned\n      pointer is never null.  Exception handlers should not rely on the value\n      of the string #cause#.  As a convention however, string\n      #ByteStream::EndOfFile# is used\n      when reaching an unexpected end-of-file condition and string\n      #DataPool::Stop# is used when the user interrupts the execution. These\n      strings can be tested by the exception handlers, with\n      #cmp_cause#. Similar conventional strings may be defined\n      in the future. They all will be small strings with only uppercase\n      characters. */\n  const char* get_cause(void) const;\n\n  /** Compares the cause with the specified string, ignoring anything after\n      the first tab. */\n  int cmp_cause(const char s2[]) const;\n\n  /** Compares the cause with the specified string, ignoring anything after\n      the first tab. */\n  static int cmp_cause(const char s1[],const char s2[]);\n\n  /** Returns the function name from which the exception was thrown.\n      A null pointer is returned if no function name is available. */\n  const char* get_function(void) const { return func; }\n  \n  /** Returns the file name from which the exception was thrown.\n      A null pointer is returned if no file name is available. */\n  const char* get_file(void) const { return file; }\n \n  /** Returns the exception source */\n  source_type get_source(void) const { return source; }\n \n  /** Returns the line number from which the exception was thrown.\n      A zero is returned if no line number is available. */\n  int get_line(void) const { return line; };\n  \n  //  Magic cause string\n  static const char * const outofmemory;\n\nprivate:\n  const char *cause;\n  const char *file;\n  const char *func;\n  int line;\n  source_type source;\n};\n\n//@}\n\n#undef G_TRY\n#undef G_CATCH\n#undef G_CATCH_ALL\n#undef G_ENDCATCH\n#undef G_RETHROW\n#undef G_THROW\n#undef G_THROW_TYPE\n#undef G_THROW_INTERNAL\n#undef G_THROW_EXTERNAL\n#undef G_THROW_APPLICATION\n#undef G_THROW_OTHER\n\n#ifndef USE_EXCEPTION_EMULATION\n\n// Compiler supports ANSI C++ exceptions.\n// Defined exception macros accordingly.\n\nclass DJVUAPI GExceptionHandler {\npublic:\n#ifndef NO_LIBGCC_HOOKS\n  static void exthrow(const GException &) no_return;\n#else\n  static void exthrow(const GException ) no_return;\n#endif /* NO_LIBGCC_HOOKS */\n  static void rethrow(void) no_return;\n};\n\n#define G_TRY        try\n#define G_CATCH(n)   catch(const GException &n) { \n#define G_CATCH_ALL   catch(...) { \n#define G_ENDCATCH   } \n#define G_RETHROW    GExceptionHandler::rethrow()\n#define G_EMTHROW(ex)  GExceptionHandler::exthrow(ex)\n#ifdef __GNUG__\n#define G_THROW_TYPE(msg,xtype) GExceptionHandler::exthrow \\\n  (GException(msg, __FILE__, __LINE__, __PRETTY_FUNCTION__, xtype))\n#else\n#define G_THROW_TYPE(msg,xtype) GExceptionHandler::exthrow \\\n  (GException(msg, __FILE__, __LINE__,0, xtype))\n#endif\n\n#else // USE_EXCEPTION_EMULATION\n\n// Compiler does not support ANSI C++ exceptions.\n// Emulate with setjmp/longjmp.\n\nclass DJVUAPI GExceptionHandler {\npublic:\n  jmp_buf jump;\n  GExceptionHandler *next;\n  GException current;\npublic:\n  static GExceptionHandler *head;\n  static void emthrow(const GException &) no_return;\npublic:\n  GExceptionHandler() { next = head; };\n  ~GExceptionHandler() { head = next; };\n};\n\n#define G_TRY    do { GExceptionHandler __exh; \\\n                      if (!setjmp(__exh.jump)) \\\n                      { GExceptionHandler::head = &__exh;\n\n#define G_CATCH_ALL } else { GExceptionHandler::head = __exh.next; \n#define G_CATCH(n) G_CATCH_ALL const GException& n = __exh.current;\n\n#define G_ENDCATCH } } while(0)\n\n#define G_RETHROW    GExceptionHandler::emthrow(__exh.current)\n\n#ifdef __GNUG__\n#define G_THROW_TYPE(msg,xtype) GExceptionHandler::emthrow \\\n  (GException(msg, __FILE__, __LINE__, __PRETTY_FUNCTION__, xtype)) \n#define G_EMTHROW(ex) GExceptionHandler::emthrow(ex)\n#else\n// SumatraPDF: don't collect messages, file and line for smaller size\n#define G_THROW_TYPE(m,xtype) GExceptionHandler::emthrow \\\n  (GException(0, 0, 0, 0, xtype))\n#define G_EMTHROW(ex) GExceptionHandler::emthrow(ex)\n#endif\n\n#endif // !CPP_SUPPORTS_EXCEPTIONS\n\n\ninline void G_EXTHROW(const GException &ex,\n   const char *msg=0,const char *file=0,int line=0, const char *func=0,\n   const GException::source_type source=GException::GINTERNAL)\n{\n  G_EMTHROW( (msg||file||line||func)?\n      GException(msg?msg:ex.get_cause(),\n        file?file:ex.get_file(),\n        line?line:ex.get_line(),\n        func?func:ex.get_function(),\n        source)\n  :ex);\n}\n\ninline void G_EXTHROW(const char msg[],\n   const char *file=0,int line=0,const char *func=0,\n   const GException::source_type source=GException::GINTERNAL )\n{\n  G_EMTHROW(GException(msg,file,line,func,source));\n}\n\n#define G_THROW(msg) G_THROW_TYPE(msg,GException::GINTERNAL)\n#define G_THROW_INTERNAL(msg) G_THROW_TYPE(msg,GException::GINTERNAL)\n#define G_THROW_EXTERNAL(msg) G_THROW_TYPE(msg,GException::GEXTERNAL)\n#define G_THROW_APPLICATION(msg) G_THROW_TYPE(msg,GException::GAPPLICATION)\n#define G_THROW_OTHER(msg) G_THROW_TYPE(msg,GException::GOTHER)\n\n// -------------- THE END\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/GIFFManager.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"GIFFManager.h\"\n#include \"GException.h\"\n#include \"debug.h\"\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\nGIFFChunk::~GIFFChunk(void) {}\n\nGIFFManager::~GIFFManager(void) {}\n\nGP<GIFFManager> \nGIFFManager::create(void)\n{\n  GIFFManager *iff=new GIFFManager();\n  GP<GIFFManager> retval=iff;\n  iff->init();\n  return retval;\n}\n\nGP<GIFFManager> \nGIFFManager::create(const GUTF8String &name)\n{\n  GIFFManager *iff=new GIFFManager();\n  GP<GIFFManager> retval=iff;\n  iff->init(name);\n  return retval;\n}\n\nvoid\nGIFFChunk::set_name(GUTF8String name)\n{\n  DEBUG_MSG(\"GIFFChunk::set_name(): name='\" << name << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n\n  const int colon=name.search(':');\n  if(colon>=0)\n  {\n    type=name.substr(0,colon);\n    name=name.substr(colon+1,(unsigned int)-1);\n    if(name.search(':')>=0)\n      G_THROW( ERR_MSG(\"GIFFManager.one_colon\") );\n  }\n\n  DEBUG_MSG(\"auto-setting type to '\" << type << \"'\\n\");\n\n  if (name.contains(\".[]\")>=0)\n    G_THROW( ERR_MSG(\"GIFFManager.bad_char\") );\n\n  strncpy(GIFFChunk::name, (const char *)name, 4);\n  GIFFChunk::name[4]=0;\n  for(int i=strlen(GIFFChunk::name);i<4;i++)\n    GIFFChunk::name[i]=' ';\n}\n\nbool\nGIFFChunk::check_name(GUTF8String name)\n{\n  GUTF8String type;\n  const int colon=name.search(':');\n  if(colon>=0)\n    {\n      type=name.substr(0,colon);\n      name=name.substr(colon+1,(unsigned int)-1);\n    }\n\n  const GUTF8String sname=(name.substr(0,4)+\"    \").substr(0,4);\n\n  DEBUG_MSG(\"GIFFChunk::check_name(): type='\" << type << \"' name='\" << sname << \"'\\n\");\n  return (type==GIFFChunk::type || (!type.length() && GIFFChunk::type==\"FORM\"))\n    && sname==GIFFChunk::name;\n}\n\nvoid\nGIFFChunk::save(IFFByteStream & istr, bool use_trick)\n{\n  DEBUG_MSG(\"GIFFChunk::save(): saving chunk '\" << get_full_name() << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n\n  if (is_container())\n  {\n    istr.put_chunk(get_full_name(), use_trick);\n    if (chunks.size())\n    {\n      GPosition pos;\n      for(pos=chunks;pos;++pos)\n        if (chunks[pos]->get_type()==\"PROP\")\n          chunks[pos]->save(istr);\n      for(pos=chunks;pos;++pos)\n        if (chunks[pos]->get_type()!=\"PROP\")\n          chunks[pos]->save(istr);\n    } else\n    {\n      DEBUG_MSG(\"but it's empty => saving empty container.\\n\");\n    }\n    istr.close_chunk();\n  } else\n  {\n    istr.put_chunk(get_name(), use_trick);\n    istr.get_bytestream()->writall((const char *) data, data.size());\n    istr.close_chunk();\n  }\n}\n\nvoid\nGIFFChunk::add_chunk(const GP<GIFFChunk> & chunk, int position)\n{\n  DEBUG_MSG(\"GIFFChunk::add_chunk(): Adding chunk to '\" << get_name() <<\n     \"' @ position=\" << position << \"\\n\");\n  DEBUG_MAKE_INDENT(3);\n\n  if (!type.length())\n  {\n    DEBUG_MSG(\"Converting the parent to FORM\\n\");\n    type=\"FORM\";\n  }\n\n  if (chunk->get_type()==\"PROP\")\n  {\n    DEBUG_MSG(\"Converting the parent to LIST\\n\");\n    type=\"LIST\";\n  }\n\n  GPosition pos;\n  if (position>=0 && chunks.nth(position, pos))\n  {\n    chunks.insert_before(pos, chunk);\n  }else\n  {\n    chunks.append(chunk);\n  }\n}\n\nGUTF8String \nGIFFChunk::decode_name(const GUTF8String &name, int &number)\n{\n  DEBUG_MSG(\"GIFFChunk::decode_name(): Checking brackets in name '\" << name << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n   \n  if (name.search('.')>=0)\n    G_THROW( ERR_MSG(\"GIFFManager.no_dots\") );\n\n  number=0;\n  const int obracket=name.search('[');\n  GUTF8String short_name;\n  if (obracket >= 0)\n  {\n    const int cbracket=name.search(']',obracket+1);\n    if (cbracket < 0)\n      G_THROW( ERR_MSG(\"GIFFManager.unmatched\") );\n    if (name.length() > (unsigned int)(cbracket+1))\n      G_THROW( ERR_MSG(\"GIFFManager.garbage\") );\n//    number =atoi((const char *)name.substr(obracket+1,cbracket-obracket-1));\n    number= name.substr(obracket+1,cbracket-obracket-1).toInt(); \n    short_name=name.substr(0,obracket);\n  }else\n  {\n    short_name=name;\n  }\n\n  const int colon=short_name.search(':');\n  if (colon>=0)\n    short_name=short_name.substr(colon+1,(unsigned int)-1);\n\n  for(int i=short_name.length();i<4;i++)\n    short_name.setat(i, ' ');\n   \n  DEBUG_MSG(\"short_name='\" << short_name << \"'\\n\");\n  DEBUG_MSG(\"number=\" << number << \"\\n\");\n   \n  return short_name;\n}\n\nvoid\nGIFFChunk::del_chunk(const GUTF8String &name)\n   // The name may contain brackets to specify the chunk number\n{\n  DEBUG_MSG(\"GIFFChunk::del_chunk(): Deleting chunk '\" << name <<\n     \"' from '\" << get_name() << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n\n  int number;\n  const GUTF8String short_name=decode_name(name,number);\n\n  GPosition pos=chunks;\n  for(int num=0;pos;++pos)\n  {\n    if ((chunks[pos]->get_name()==short_name)&&(num++ == number))\n    {\n      chunks.del(pos);\n      break;\n    }\n  }\n  if(! pos)\n  {\n    G_THROW( ERR_MSG(\"GIFFManager.no_chunk\") \"\\t\"+short_name+\"\\t\"+GUTF8String(number)+\"\\t\"+get_name());\n  }\n}\n\nGP<GIFFChunk>\nGIFFChunk::get_chunk(const GUTF8String &name, int * pos_ptr)\n   // The name may contain brackets to specify the chunk number\n{\n  DEBUG_MSG(\"GIFFChunk::get_chunk(): Returning chunk '\" << name <<\n     \"' from '\" << get_name() << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n\n  int number;\n  const GUTF8String short_name=decode_name(name,number);\n\n  int num=0;\n  int pos_num;\n  GP<GIFFChunk> retval;\n  GPosition pos;\n  for(pos=chunks, pos_num=0;pos;++pos, pos_num++)\n  {\n    if (chunks[pos]->get_name()==short_name && num++==number)\n    {\n      if (pos_ptr)\n        *pos_ptr=pos_num;\n      retval=chunks[pos];\n      break;\n    }\n  }\n  return retval;\n}\n\nint\nGIFFChunk::get_chunks_number(void)\n{\n  DEBUG_MSG(\"GIFFChunk::get_chunks_number(): Returning number of chunks '\" << name <<\n     \"' in '\" << get_name() << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n  return chunks.size();\n}\n\nint\nGIFFChunk::get_chunks_number(const GUTF8String &name)\n{\n  DEBUG_MSG(\"GIFFChunk::get_chunks_number(): Returning number of chunks '\" << name <<\n     \"' in '\" << get_name() << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n\n  if (name.contains(\"[]\")>=0)\n    G_THROW( ERR_MSG(\"GIFFManager.no_brackets\") );\n  \n  int number; \n  GUTF8String short_name=decode_name(name,number);\n   \n  int num=0;\n  for(GPosition pos=chunks;pos;++pos)\n     num+=(chunks[pos]->get_name()==short_name);\n  return num;\n}\n\n//************************************************************************\n\nvoid\nGIFFManager::add_chunk(GUTF8String parent_name, const GP<GIFFChunk> & chunk,\n\t\t       int pos)\n      // parent_name is the fully qualified name of the PARENT\n      //             IT MAY BE EMPTY\n      // All the required chunks will be created\n      // pos=-1 means to append the chunk\n{\n  DEBUG_MSG(\"GIFFManager::add_chunk(): Adding chunk to name='\" << parent_name << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n   \n  if (!top_level->get_name().length())\n  {\n    if ((!parent_name.length())||(parent_name[0]!='.'))\n      G_THROW( ERR_MSG(\"GIFFManager.no_top_name\") );\n    if (parent_name.length() < 2)\n    {\n      // 'chunk' is actually the new top-level chunk\n      DEBUG_MSG(\"since parent_name=='.', making the chunk top-level\\n\");\n      if (!chunk->is_container())\n        G_THROW( ERR_MSG(\"GIFFManager.no_top_cont\") );\n      top_level=chunk;\n      return;\n    }\n\n    DEBUG_MSG(\"Setting the name of the top-level chunk\\n\");\n    const int next_dot=parent_name.search('.',1);\n    if(next_dot>=0)\n    {\n      top_level->set_name(parent_name.substr(1,next_dot-1));\n    }else\n    {\n      top_level->set_name(parent_name.substr(1,(unsigned int)-1));\n    }\n  }\n\n  DEBUG_MSG(\"top level chunk name='\" << top_level->get_name() << \"'\\n\");\n   \n  if (parent_name.length() && parent_name[0] == '.')\n  {\n    int next_dot=parent_name.search('.',1);\n    if(next_dot<0)\n    {\n      next_dot=parent_name.length();\n    }\n    GUTF8String top_name=parent_name.substr(1,next_dot-1);\n    if (!top_level->check_name(top_name))\n      G_THROW( ERR_MSG(\"GIFFManager.wrong_name\") \"\\t\"+top_name);\n    parent_name=parent_name.substr(next_dot,(unsigned int)-1);\n  }\n\n  GP<GIFFChunk> cur_sec=top_level;\n  const char * start, * end=(const char *)parent_name-1;\n  do\n  {\n    for(start=++end;*end&&(*end!='.');end++)\n      EMPTY_LOOP;\n    if (end>start)\n    {\n      GUTF8String name(start,end-start);\n      GUTF8String short_name;\n      int number=0;\n      const int obracket=name.search('[');\n      if (obracket >= 0)\n      {\n        const int cbracket=name.search(']',obracket+1);\n        if (cbracket < 0)\n          G_THROW( ERR_MSG(\"GIFFManager.unmatched\") );\n//        number=atoi((const char *)name.substr(obracket+1,cbracket-obracket-1));\n        number = name.substr(obracket+1,cbracket-obracket-1).toInt();\n        short_name=name.substr(0,obracket);\n      }else\n      {\n        short_name=name;\n      }\n\n      for(int i=cur_sec->get_chunks_number(short_name);i<number+1;i++)\n        cur_sec->add_chunk(GIFFChunk::create(short_name));\n      cur_sec=cur_sec->get_chunk(name);\n      if (!cur_sec)\n        G_THROW( ERR_MSG(\"GIFFManager.unknown\") \"\\t\"+name);\n    }\n  } while(*end);\n  cur_sec->add_chunk(chunk, pos);\n}\n\nvoid\nGIFFManager::add_chunk(GUTF8String name, const TArray<char> & data)\n      // name is fully qualified name of the chunk TO BE INSERTED.\n      //      it may contain brackets at the end to set the position\n      // All the required chunks will be created\n{\n  DEBUG_MSG(\"GIFFManager::add_chunk(): adding plain chunk with name='\" << name << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n\n  GUTF8String chunk_name;\n  const int lastdot=name.rsearch('.');\n  if(lastdot < 0)\n  {\n    chunk_name=name;\n    name=name.substr(0,lastdot);\n  }else\n  {\n    chunk_name=name.substr(lastdot+1,(unsigned int)-1);\n  }\n\n  int pos=-1;\n  const int obracket=chunk_name.search('[');\n  if (obracket >= 0)\n  {\n    const int cbracket=chunk_name.search(']',obracket+1);\n    if (cbracket < 0)\n      G_THROW( ERR_MSG(\"GIFFManager.unmatched\") );\n    if (name.length() > (unsigned int)(cbracket+1))\n      G_THROW( ERR_MSG(\"GIFFManager.garbage\") );\n//    pos=atoi((const char *)chunk_name.substr(obracket+1,cbracket-obracket-1));\n    pos = chunk_name.substr(obracket+1,cbracket-obracket-1).toInt();\n    chunk_name=chunk_name.substr(0,obracket);\n  }\n  DEBUG_MSG(\"Creating new chunk with name \" << chunk_name << \"\\n\");\n  GP<GIFFChunk> chunk;\n  chunk=GIFFChunk::create(chunk_name, data);\n  add_chunk(name, chunk, pos);\n}\n\nvoid\nGIFFManager::del_chunk(void)\n{\n  DEBUG_MSG(\"GIFFManager::del_chunk(): Deleting chunk\\n\");\n  DEBUG_MAKE_INDENT(3);\n   \n  G_THROW( ERR_MSG(\"GIFFManager.del_empty\") );\n}\n\nvoid\nGIFFManager::del_chunk(GUTF8String name)\n      // \"name\" should be fully qualified, that is contain dots.\n      // It may also end with [] to set the chunk order number\n{\n  DEBUG_MSG(\"GIFFManager::del_chunk(): Deleting chunk '\" << name << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n   \n  if (!name.length())\n    G_THROW( ERR_MSG(\"GIFFManager.del_empty\") );\n\n  if (name[0]=='.')\n  {\n    const int next_dot=name.search('.',1);\n    if (next_dot < 0)\n    {\n      if (top_level->check_name(name.substr(1,(unsigned int)-1)))\n      {\n        DEBUG_MSG(\"Removing top level chunk..\\n\");\n        top_level=GIFFChunk::create();\n        return;\n      }\n      G_THROW( ERR_MSG(\"GIFFManager.wrong_name2\") \"\\t\"+name.substr(1,(unsigned int)-1));\n    }\n    const GUTF8String top_name=name.substr(1,next_dot-1);\n    if (!top_level->check_name(top_name))\n      G_THROW( ERR_MSG(\"GIFFManager.wrong_name2\") \"\\t\"+top_name);\n    name=name.substr(next_dot+1,(unsigned int)-1);\n  }\n   \n  GP<GIFFChunk> cur_sec=top_level;\n  const char * start, * end=(const char *)name-1;\n  do\n  {\n    for(start=++end;*end&&(*end!='.');end++)\n      EMPTY_LOOP;\n    if (end>start && *end=='.')\n      cur_sec=cur_sec->get_chunk(GUTF8String(start, end-start));\n    if (!cur_sec)\n      G_THROW( ERR_MSG(\"GIFFManager.cant_find\") \"\\t\"+GUTF8String(name));\n  } while(*end);\n   \n  if (!start[0])\n  {\n    G_THROW(GUTF8String( ERR_MSG(\"GIFFManager.malformed\") \"\\t\")+name);\n  }\n   \n  cur_sec->del_chunk(start);\n}\n\nGP<GIFFChunk>\nGIFFManager::get_chunk(GUTF8String name, int * pos_num)\n      // \"name\" should be fully qualified, that is contain dots.\n      // It may also end with [] to set the chunk order number\n{\n  DEBUG_MSG(\"GIFFManager::get_chunk(): Returning chunk '\" << name << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n   \n  if (!name.length())\n    G_THROW( ERR_MSG(\"GIFFManager.get_empty\") );\n\n  if (name[0]=='.')\n  {\n    const int next_dot=name.search('.',1);\n    if (next_dot < 0)\n    {\n      if (top_level->check_name(name.substr(1,(unsigned int)-1)))\n      {\n        DEBUG_MSG(\"Removing top level chunk..\\n\");\n        return top_level;\n      }\n      G_THROW( ERR_MSG(\"GIFFManager.wrong_name2\") \"\\t\"+name.substr(1,(unsigned int)-1));\n    }\n    const GUTF8String top_name=name.substr(1,next_dot-1);\n    if (!top_level->check_name(top_name))\n      G_THROW( ERR_MSG(\"GIFFManager.wrong_name2\") \"\\t\"+top_name);\n    name=name.substr(next_dot+1,(unsigned int)-1);\n  }\n   \n  GP<GIFFChunk> cur_sec=top_level;\n  const char * start, * end=(const char *) name-1;\n  do\n  {\n    for(start=++end;*end&&(*end!='.');end++)\n      EMPTY_LOOP;\n    if (end>start)\n      cur_sec=cur_sec->get_chunk(GUTF8String(start, end-start), pos_num);\n    if (!cur_sec)\n      break;\n  } while(*end);\n   \n  return cur_sec;\n}\n\nint\nGIFFManager::get_chunks_number(void)\n{\n  DEBUG_MSG(\"GIFFManager::get_chunks_number()\\n\");\n  DEBUG_MAKE_INDENT(3);\n  return top_level->get_chunks_number();\n}\n\nint\nGIFFManager::get_chunks_number(const GUTF8String &name)\n   // Returns the number of chunks with given fully qualified name\n{\n  DEBUG_MSG(\"GIFFManager::get_chunks_number(): name='\" << name << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n\n  int retval;\n  const int last_dot=name.rsearch('.');\n  if (last_dot<0)\n  {\n    retval=top_level->get_chunks_number(name);\n  }else if(!last_dot)\n  {\n    retval=(top_level->get_name()==name.substr(1,(unsigned int)-1))?1:0;\n  }else\n  {\n    GP<GIFFChunk> chunk=get_chunk(name.substr(0,last_dot));\n    retval=( chunk\n      ?(chunk->get_chunks_number(name.substr(last_dot+1,(unsigned int)-1)))\n      :0 );\n  }\n  return retval;\n}\n\nvoid\nGIFFManager::load_chunk(IFFByteStream & istr, GP<GIFFChunk> chunk)\n{\n  DEBUG_MSG(\"GIFFManager::load_chunk(): loading contents of chunk '\" <<\n    chunk->get_name() << \"'\\n\");\n  DEBUG_MAKE_INDENT(3);\n   \n  int chunk_size;\n  GUTF8String chunk_id;\n  while ((chunk_size=istr.get_chunk(chunk_id)))\n  {\n    if (istr.check_id(chunk_id))\n    {\n      GP<GIFFChunk> ch=GIFFChunk::create(chunk_id);\n      load_chunk(istr, ch);\n      chunk->add_chunk(ch);\n    } else\n    {\n      TArray<char> data(chunk_size-1);\n      istr.get_bytestream()->readall( (char*)data, data.size());\n      GP<GIFFChunk> ch=GIFFChunk::create(chunk_id, data);\n      chunk->add_chunk(ch);\n    }\n    istr.close_chunk();\n  }\n}\n\nvoid\nGIFFManager::load_file(const TArray<char> & data)\n{\n  GP<ByteStream> str=ByteStream::create((const char *)data, data.size());\n  load_file(str);\n}\n\nvoid\nGIFFManager::load_file(GP<ByteStream> str)\n{\n  DEBUG_MSG(\"GIFFManager::load_file(): Loading IFF file.\\n\");\n  DEBUG_MAKE_INDENT(3);\n   \n  GP<IFFByteStream> gistr=IFFByteStream::create(str);\n  IFFByteStream &istr=*gistr;\n  GUTF8String chunk_id;\n  if (istr.get_chunk(chunk_id))\n  {\n    if (chunk_id.substr(0,5) != \"FORM:\")\n      G_THROW( ERR_MSG(\"GIFFManager.cant_find2\") );\n    set_name(chunk_id);\n    load_chunk(istr, top_level);\n    istr.close_chunk();\n  }\n}\n\nvoid\nGIFFManager::save_file(TArray<char> & data)\n{\n  GP<ByteStream> gstr=ByteStream::create();\n  save_file(gstr);\n  data=gstr->get_data();\n}\n\nvoid\nGIFFManager::save_file(GP<ByteStream> str)\n{\n  GP<IFFByteStream> istr=IFFByteStream::create(str);\n  top_level->save(*istr, 1);\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/GIFFManager.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _GIFFMANAGER_H\n#define _GIFFMANAGER_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n#include \"IFFByteStream.h\"\n#include \"GContainer.h\"\n#include \"Arrays.h\"\n#include \"GSmartPointer.h\"\n#include \"GString.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n/** @name GIFFManager.h\n\n    Files #\"GIFFManager.h\"# and #\"GIFFManager.cpp\"# define more convenient\n    interface to IFF files. You may want to use the {\\Ref GIFFManager} class\n    instead of coping with {\\Ref IFFByteStream} especially when you have to\n    insert or move chunks, which is a kind of tricky with sequential access\n    provided by {\\Ref IFFByteStream}.\n\n    You will mostly deal with {\\Ref GIFFManager} class, but sometimes you may\n    want to use {\\Ref GIFFChunk}s as well thus bypassing {\\Ref GIFFManager}'s\n    interface and working with the chunks hierarchy yourself.\n    \n    Interface to IFF files.\n    @author \n    Andrei Erofeev <eaf@geocities.com> -- Initial implementation.\n*/\n\n/** #GIFFChunk# is the base class for other IFF chunks understood by\n    {\\Ref GIFFManager}. It provides some basic interface, and is not supposed\n    to be used on its own. */\n\nclass GIFFChunk : public GPEnabled\n{\nprotected:\n   GIFFChunk(void);\n   GIFFChunk(const GUTF8String &name);\n   GIFFChunk(const GUTF8String &name, const TArray<char> & data);\npublic:\n      /// Default creator.\n   static GP<GIFFChunk> create(void) {return new GIFFChunk();}\n\n      /** Creates the chunk with the given name. The {\\em name} may not\n\t  contain dots colons or brackets */\n   static GP<GIFFChunk> create(const GUTF8String &name)\n   {return new GIFFChunk(name);}\n\n      /** Creates the {\\em plain chunk} containing raw data */\n   static GP<GIFFChunk> create(const GUTF8String &name, const TArray<char> & data)\n   { return new GIFFChunk(name,data); }\n\n      /// Destructor\n   virtual ~GIFFChunk(void);\n\n      /// Returns the name of the chunk (without possible #FORM:# or similar prefixes)\n   GUTF8String\tget_name(void) const;\n      /// Returns full chunk name, with possible container specification\n   GUTF8String\tget_full_name(void) const;\n      /// Returns the chunk type, like #CAT# for chunk #CAT:DJVU#\n   GUTF8String\tget_type(void) const;\n      /// Returns TRUE if the chunk may contain other chunks or FALSE otherwise\n   bool\t\tis_container(void) const;\n      /** Sets the chunk name. The {\\em name} may not contain dots or brackets,\n\t  but {\\bf may} contain colons. */\n   void\t\tset_name(GUTF8String name);\n      /** Parses the {\\em name} probably containing colon and compares it\n\t  with its own name returning TRUE if they are the same */\n   bool\t\tcheck_name(GUTF8String name);\n\n      /** Adds the {\\em chunk} to the chunks list at position {\\em order}.\n\t  Set {\\em order} to #-1# to append the chunk to the list.\n          {\\bf Note!} By adding chunk #PROP# you will convert this chunk\n          to type #LIST# {\\em automatically}. */\n   void\t\tadd_chunk(const GP<GIFFChunk> & chunk, int order=-1);\n      /** Removes the chunk with given {\\em name}. The {\\em name} may not\n\t  contain dots, but MAY contain colons and brackets (the latter -\n\t  for specifying the chunk number) */\n   void\t\tdel_chunk(const GUTF8String &name);\n      /** Returns the chunk with given {\\em name}. The {\\em name} may not\n\t  contain dots, but MAY contain colons and brackets (the latter -\n\t  for specifying the chunk number). If {\\em position} is not zero\n\t  then the chunk position in its parent will be put into #*position# */\n   GP<GIFFChunk>get_chunk(const GUTF8String &name, int * position=0);\n      /** Returns the number of chunks with given {\\em name}. The {\\em name}\n\t  may not contain dots and brackets. If {\\em name} is ZERO, the\n\t  total number of chunks will be returned. */\n   int\t\tget_chunks_number(const GUTF8String &name);\n   int\t\tget_chunks_number(void);\n      /** Returns the data array for plain chunks */\n   TArray<char>\tget_data(void) const;\n   \n      /** Saves the chunk into the {\\Ref IFFByteStream}.\n\t  Set {\\em use_trick} to #1# if this is a top-level chunk */\n   void\t\tsave(IFFByteStream & istr, bool use_trick=0);\nprivate:\n   char\t\t\tname[5];\n   GUTF8String\t\ttype;\n   GPList<GIFFChunk>\tchunks;\n   TArray<char>\t\tdata;\n   static GUTF8String decode_name(const GUTF8String &name, int &number);\n};\n\ninline GUTF8String\nGIFFChunk::get_name(void) const { return GUTF8String(name, 4); }\n\ninline GUTF8String\nGIFFChunk::get_type(void) const { return type; };\n\ninline GUTF8String\nGIFFChunk::get_full_name(void) const { return get_type()+\":\"+get_name(); };\n\ninline bool\nGIFFChunk::is_container(void) const { return type.length()!=0; };\n\ninline TArray<char>\nGIFFChunk::get_data(void) const { return data; };\n\ninline\nGIFFChunk::GIFFChunk(void) { name[0]=0; }\n\ninline\nGIFFChunk::GIFFChunk(const GUTF8String &name) { set_name(name); }\n\ninline\nGIFFChunk::GIFFChunk(const GUTF8String &name, const TArray<char> & data_in) :\n      data(data_in)\n{\n   set_name(name);\n}\n\n//************************************************************************\n\n/** Intuitive interface to IFF files.\n\n    It's too terrible to keep reading/writing IFF files chunk after chunk\n    using {\\Ref IFFByteStream}s. This class allows you to operate with chunks\n    as with structures or arrays without even caring about the byte streams.\n\n    Some of the examples are below:\n    \\begin{verbatim}\n       GP<GIFFChunk> chunk;\n       chunk=manager1.get_chunk(\"BG44[2]\");\n       manager2.add_chunk(\".FORM:DJVU.BG44[-1]\", chunk);\n    \\end{verbatim}\n\n    {\\bf Chunk name}\n    \\begin{itemize}\n       \\item Every chunk name may contain optional prefix #FORM:#, #LIST:#,\n             #PROP:# or #CAT:#. If the prefix is omitted and the chunk happens\n\t     to contain other chunks, #FORM:# will be assumed.\n       \\item Every chunk name may be {\\em short} or {\\em complete}.\n             {\\em short} chunk names may not contain dots as they're a\n\t     subchunks names with respect to a given chunk.\n\t     {\\em complete} chunk names may contain dots. But there may be\n\t     or may not be the {\\em leading dot} in the name. If the\n\t     {\\em leading dot} is present, then the name is assumed to contain\n\t     the name of the top-level chunk as well. Otherwise it's treated\n\t     {\\em with respect} to the top-level chunk. You may want to use\n\t     the leading dot only when you add a chunk to an empty document,\n\t     since a command like #manager.addChunk(\".FORM:DJVU.BG44\", chunk)#\n\t     will create the top level chunk of the requested type (#FORM:DJVU#)\n\t     and will add chunk #BG44# to it {\\em automatically}.\n       \\item You may use {\\em brackets} in the name to specify the chunk's\n             position. The meaning of the number inside the brackets depends\n\t     on the function you call. In most of the cases this is the number\n\t     of the chunk with the given name in the parent chunk. But sometimes\n\t     (as in #addChunk(name, buffer, length)#) the brackets at the\n\t     end of the #name# actually specify the {\\em position} of the\n\t     chunk in the parent. For example, to insert #INCL# chunk into\n\t     #DJVU# form at position #1# (make it the second) you may want to\n\t     use #manager.addChunk(\".DJVU.INCL[1]\", data, size)#. At the same\n\t     time, to get 2-nd chunk with name #BG44# from form #DJVU# you\n\t     should do smth like #chunk=manager.getChunk(\"BG44[1]\")#. Note, that\n\t     here the manager will search for chunk #BG44# in form #DJVU# and\n\t     will take the second {\\em found} one.\n    \\end{itemize} */\n\nclass GIFFManager : public GPEnabled\n{\nprotected:\n   GIFFManager(void);\n   void init(void);\n   void init(const GUTF8String &name);\npublic:\n      /// Default creator.\n   static GP<GIFFManager> create(void);\n\n      /** Creates the {\\Ref GIFFManager} and assigns name {\\em name} to\n\t  the top-level chunk. you may use chunk type names (before colon)\n\t  to set the top-level chunk type, or omit it to work with #FORM# */\n   static GP<GIFFManager> create(const GUTF8String &name);\n\n      /// Virtual destructor.\n   virtual ~GIFFManager(void);\n\n      /// Sets the name of the top level chunk to {\\em name}\n   void\t\tset_name(const GUTF8String &name);\n      /** Adds the chunk {\\em chunk} to chunk with name {\\em parent_name} at\n\t  position {\\em pos}. {\\em parent_name} may contain dots, brackets\n\t  and colons. All missing chunks in the chain will be created.\n\n\t  {\\bf Examples:}\n\t  \\begin{verbatim}\n\t     ;; To set the top-level chunk to 'ch'\n\t     m.addChunk(\".\", ch);\n\t     ;; To add 'ch' to the top-level chunk \"DJVU\" creating it if necessary\n\t     m.addChunk(\".DJVU\", ch);\n\t     ;; Same as above regardless of top-level chunk name\n\t     m.addChunk(\"\", ch);\n\t     ;; To add 'ch' to 2nd FORM DJVU in top-level form DJVM\n\t     m.addChunk(\".FORM:DJVM.FORM:DJVU[1]\", ch);\n\t     ;; Same thing regardless of the top-level chunk name\n\t     m.addChunk(\"FORM:DJVU[1]\", ch);\n\t  \\end{verbatim} */\n   void\t\tadd_chunk(GUTF8String parent_name, const GP<GIFFChunk> & chunk, int pos=-1);\n      /** If {\\em name}={\\em name1}.{\\em name2} where {\\em name2} doesn't\n\t  contain dots, then #addChunk()# will create plain chunk with\n\t  name {\\em name2} with data {\\em buffer} of size {\\em length} and\n\t  will add it to chunk {\\em name1} in the same way as\n\t  #addChunk(name, chunk, pos)# function would do it. The #pos# in\n\t  this case is either #-1# (append) or is extracted from between\n          brackets if the {\\em name} ends with them.\n\t  \n          {\\bf Examples:}\n          \\begin{verbatim}\n             ;; To insert INCL chunk at position 2 (make it 3rd)\n             m.addChunk(\"INCL[2]\", data, length);\n             ;; To append chunk BG44 to 2nd DjVu file inside DjVm archive:\n             m.addChunk(\".DJVM.DJVU[1].BG44\", data, length);\n          \\end{verbatim} */\n   void\t\tadd_chunk(GUTF8String name, const TArray<char> & data);\n      /** Will remove chunk with name {\\em name}. You may use dots, colons\n\t  and brackets to specify the chunk uniquely.\n\n\t  {\\bf Examples:}\n\t  \\begin{verbatim}\n\t     ;; To remove 2nd DjVu document from DjVm archive use\n\t     m.delChunk(\".DJVM.DJVU[1]\");\n\t     ;; Same thing without top-level chunk name specification\n\t     m.delChunk(\"DJVU[1]\");\n\t     ;; Same thing for the first DJVU chunk\n\t     m.delChunk(\"DJVU\");\n\t  \\end{verbatim}\n      */\n   void\t\tdel_chunk(GUTF8String name);\n   void\t\tdel_chunk(void);\n      /** Will return the number of chunks with given name. The {\\em name} may\n\t  not end with brackets, but may contain them inside. It may also\n\t  contain dots and colons. If {\\em name} is ZERO, the total number\n\t  of chunks will be returned.\n\n\t  {\\bf Examples:}\n\t  \\begin{verbatim}\n\t     ;; To get the number of DJVU forms inside DjVm document\n\t     m.getChunksNumber(\".DJVM.DJVU\");\n\t     ;; Same thing without top-level chunk name specification\n\t     m.getChunksNumber(\"DJVU\");\n\t  \\end{verbatim}\n      */\n   int\t\tget_chunks_number(const GUTF8String &name);\n   int\t\tget_chunks_number(void);\n\n      /** Returns the chunk with name {\\em name}. The {\\em name} may contain dots\n\t  colons and slashes. If {\\em position} is not zero, #*position# will\n\t  be assigned the position of the found chunk in the parent chunk.\n\n\t  {\\bf Examples:}\n\t  \\begin{verbatim}\n\t     ;; To get the directory chunk of DjVm document\n\t     m.getChunk(\".DJVM.DIR0\");\n\t     ;; To get chunk corresponding to 2nd DJVU form\n\t     m.getChunk(\".DJVU[1]\");\n\t  \\end{verbatim} */\n   GP<GIFFChunk>get_chunk(GUTF8String name, int * position=0);\n\n      /** Loads the composite {\\em chunk}'s contents from stream {\\em istr}. */\n   void\t\tload_chunk(IFFByteStream & istr, GP<GIFFChunk> chunk);\n      /** Loads the file contents from stream {\\em str} */\n   void\t\tload_file(GP<ByteStream> str);\n      /** Loads the file contents from the data array {\\em data} */\n   void\t\tload_file(const TArray<char> & data);\n      /** Saves all the chunks into stream {\\em str} */\n   void\t\tsave_file(GP<ByteStream> str);\n      /** Saves all the chunks into the data array {\\em data} */\n   void\t\tsave_file(TArray<char> & data);\n\nprivate:\n   GP<GIFFChunk>\ttop_level;\n\n   static const char *\tcheck_leading_dot(const GUTF8String &name);\nprivate: //dummy methods\n   static void save_file(ByteStream *);\n   static void load_file(ByteStream *);\n};\n\ninline void\nGIFFManager::set_name(const GUTF8String &name)\n{\n   top_level->set_name(name);\n}\n\ninline\nGIFFManager::GIFFManager(void) {}\n\ninline  void\nGIFFManager::init(void)\n{\n  top_level=GIFFChunk::create();\n}\n\ninline  void\nGIFFManager::init(const GUTF8String &name)\n{\n  top_level=GIFFChunk::create(name);\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/GMapAreas.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"GMapAreas.h\"\n#include \"GException.h\"\n#include \"debug.h\"\n\n#include <math.h>\n#include <stdio.h>\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n/****************************************************************************\n***************************** GMapArea definition ***************************\n****************************************************************************/\n\nconst char GMapArea::MAPAREA_TAG[] = \t\t\"maparea\";\nconst char GMapArea::RECT_TAG[] = \t\t\"rect\";\nconst char GMapArea::POLY_TAG[] = \t\t\"poly\";\nconst char GMapArea::OVAL_TAG[] = \t\t\"oval\";\nconst char GMapArea::NO_BORDER_TAG[] = \t\t\"none\";\nconst char GMapArea::XOR_BORDER_TAG[] = \t\"xor\";\nconst char GMapArea::SOLID_BORDER_TAG[] = \t\"border\";\nconst char GMapArea::SHADOW_IN_BORDER_TAG[] = \t\"shadow_in\";\nconst char GMapArea::SHADOW_OUT_BORDER_TAG[] = \t\"shadow_out\";\nconst char GMapArea::SHADOW_EIN_BORDER_TAG[] = \t\"shadow_ein\";\nconst char GMapArea::SHADOW_EOUT_BORDER_TAG[] = \"shadow_eout\";\nconst char GMapArea::BORDER_AVIS_TAG[] = \t\"border_avis\";\nconst char GMapArea::HILITE_TAG[] = \t\t\"hilite\";\nconst char GMapArea::URL_TAG[] = \t\t\"url\";\nconst char GMapArea::TARGET_SELF[] = \t\t\"_self\";\nstatic const char zero_width[] = ERR_MSG(\"GMapAreas.zero_width\");\nstatic const char zero_height[] = ERR_MSG(\"GMapAreas.zero_height\");\nstatic const char width_1[] = ERR_MSG(\"GMapAreas.width_1\");\nstatic const char width_3_32 [] = ERR_MSG(\"GMapAreas.width_3-32\");\nstatic const char error_poly_border [] = ERR_MSG(\"GMapAreas.poly_border\");\nstatic const char error_poly_hilite [] = ERR_MSG(\"GMapAreas.poly_hilite\");\nstatic const char error_oval_border [] = ERR_MSG(\"GMapAreas.oval_border\");\nstatic const char error_oval_hilite [] = ERR_MSG(\"GMapAreas.oval_hilite\");\nstatic const char error_too_few_points [] = ERR_MSG(\"GMapAreas.too_few_points\");\nstatic const char error_intersect [] = ERR_MSG(\"GMapAreas.intersect\");\n\nGMapArea::~GMapArea() {}\n\nGMapRect::~GMapRect() {}\n\nGMapPoly::~GMapPoly() {}\n\nGMapOval::~GMapOval() {}\n\nvoid\nGMapArea::initialize_bounds(void)\n{\n   xmin=gma_get_xmin();\n   xmax=gma_get_xmax();\n   ymin=gma_get_ymin();\n   ymax=gma_get_ymax();\n   bounds_initialized=true;\n}\n\nint\nGMapArea::get_xmin(void) const\n{\n   if (!bounds_initialized)\n     const_cast<GMapArea *>(this)->initialize_bounds();\n   return xmin;\n}\n\nint\nGMapArea::get_ymin(void) const\n{\n   if (!bounds_initialized)\n     const_cast<GMapArea *>(this)->initialize_bounds();\n   return ymin;\n}\n\nint\nGMapArea::get_xmax(void) const\n{\n   if (!bounds_initialized)\n     const_cast<GMapArea *>(this)->initialize_bounds();\n   return xmax;\n}\n\nint\nGMapArea::get_ymax(void) const\n{\n   if (!bounds_initialized)\n     const_cast<GMapArea *>(this)->initialize_bounds();\n   return ymax;\n}\n\nGRect\nGMapArea::get_bound_rect(void) const\n{\n   return GRect(get_xmin(), get_ymin(), get_xmax()-get_xmin(),\n\t\tget_ymax()-get_ymin());\n}\n\nvoid\nGMapArea::move(int dx, int dy)\n{\n   if (dx || dy)\n   {\n     if (bounds_initialized)\n     {\n        xmin+=dx;\n        ymin+=dy;\n        xmax+=dx;\n        ymax+=dy;\n     }\n     gma_move(dx, dy);\n   }\n}\n\nvoid\nGMapArea::resize(int new_width, int new_height)\n{\n   if (get_xmax()-get_xmin()!=new_width ||\n       get_ymax()-get_ymin()!=new_height)\n   {\n     gma_resize(new_width, new_height);\n     bounds_initialized=false;\n   }\n}\n\nvoid\nGMapArea::transform(const GRect & grect)\n{\n   if (grect.xmin!=get_xmin() || grect.ymin!=get_ymin() ||\n       grect.xmax!=get_xmax() || grect.ymax!=get_ymax())\n   {\n     gma_transform(grect);\n     bounds_initialized=false;\n   }\n}\n\nchar const * const\nGMapArea::check_object(void)\n{\n   char const *retval;\n   if (get_xmax()==get_xmin())\n   {\n     retval=zero_width;\n   }\n   else if (get_ymax()==get_ymin())\n   {\n     retval=zero_height;\n   }\n   else if ((border_type==XOR_BORDER ||\n       border_type==SOLID_BORDER) && border_width!=1)\n   {\n     retval=width_1;\n   }\n   else if ((border_type==SHADOW_IN_BORDER ||\n       border_type==SHADOW_OUT_BORDER ||\n       border_type==SHADOW_EIN_BORDER ||\n       border_type==SHADOW_EOUT_BORDER)&&\n       (border_width<3 || border_width>32))\n   {\n     retval=width_3_32;\n   }else\n   {\n     retval=gma_check_object();\n   }\n   return retval;\n}\n\nbool\nGMapArea::is_point_inside(int x, int y) const\n{\n   if (!bounds_initialized)\n     const_cast<GMapArea *>(this)->initialize_bounds();\n   return (x>=xmin && x<xmax && y>=ymin && y<ymax) ?\n\t      gma_is_point_inside(x, y) : false;\n}\n\nstatic GUTF8String make_c_string(GUTF8String string)\n{\n  GUTF8String buffer;\n  const char *data = (const char*)string;\n  int length = string.length();\n  buffer = GUTF8String(\"\\\"\");\n  while (*data && length>0) \n    {\n      int span = 0;\n      while (span<length && (unsigned char)(data[span])>=0x20 && \n             data[span]!=0x7f && data[span]!='\"' && data[span]!='\\\\' )\n        span++;\n      if (span > 0) \n        {  \n          buffer = buffer + GUTF8String(data, span);\n          data += span;\n          length -= span;\n        }  \n      else \n        {\n          char buf[8];\n          static const char *tr1 = \"\\\"\\\\tnrbf\";\n          static const char *tr2 = \"\\\"\\\\\\t\\n\\r\\b\\f\";\n          sprintf(buf,\"\\\\%03o\", (int)(((unsigned char*)data)[span]));\n          for (int i=0; tr2[i]; i++)\n            if (data[span] == tr2[i])\n              buf[1] = tr1[i];\n          if (buf[1]<'0' || buf[1]>'3')\n            buf[2] = 0;\n          buffer = buffer + GUTF8String(buf);\n          data += 1;\n          length -= 1;\n        }\n    }\n  buffer = buffer + GUTF8String(\"\\\"\");\n  return buffer;\n}\n\nGUTF8String\nGMapArea::print(void)\n{\n      // Make this hard check to make sure, that *no* illegal GMapArea\n      // can be stored into a file.\n   const char * const errors=check_object();\n   if (errors[0])\n   {\n     G_THROW(errors);\n   }\n   \n   GUTF8String url1 = make_c_string((GUTF8String)url);\n   GUTF8String target1 = make_c_string(target);\n   GUTF8String comment1 = make_c_string(comment);\n   \n   GUTF8String border_color_str;\n   border_color_str.format(\"#%02X%02X%02X\",\n\t   (border_color & 0xff0000) >> 16,\n\t   (border_color & 0xff00) >> 8,\n\t   (border_color & 0xff));\n\n   static const GUTF8String left('(');\n   static const GUTF8String right(')');\n   static const GUTF8String space(' ');\n   GUTF8String border_type_str;\n   switch(border_type)\n   {\n      case NO_BORDER:\n        border_type_str=left+NO_BORDER_TAG+right;\n        break;\n      case XOR_BORDER:\n        border_type_str=left+XOR_BORDER_TAG+right;\n        break;\n      case SOLID_BORDER:\n        border_type_str=left+SOLID_BORDER_TAG+space+border_color_str+right;\n        break;\n      case SHADOW_IN_BORDER:\n        border_type_str=left+SHADOW_IN_BORDER_TAG+space+GUTF8String(border_width)+right;\n        break;\n      case SHADOW_OUT_BORDER:\n        border_type_str=left+SHADOW_OUT_BORDER_TAG+space+GUTF8String(border_width)+right;\n        break;\n      case SHADOW_EIN_BORDER:\n        border_type_str=left+SHADOW_EIN_BORDER_TAG+space+GUTF8String(border_width)+right;\n        break;\n      case SHADOW_EOUT_BORDER:\n        border_type_str=left+SHADOW_EOUT_BORDER_TAG+space+GUTF8String(border_width)+right;\n        break;\n      default:\n        border_type_str=left+XOR_BORDER_TAG+right;\n        break;\n   }\n\n   GUTF8String hilite_str;\n   if (hilite_color!=0xffffffff)\n   {\n      hilite_str.format(\"(%s #%02X%02X%02X)\",\n\t      HILITE_TAG, (hilite_color & 0xff0000) >> 16,\n\t      (hilite_color & 0xff00) >> 8,\n\t      (hilite_color & 0xff));\n   }\n   \n   GUTF8String URL;\n   if (target1==TARGET_SELF)\n   {\n      URL=url1;\n   }else\n   {\n      URL=left+URL_TAG+space+url1+space+target1+right;\n   }\n\n   GUTF8String total=left+MAPAREA_TAG+space+URL+space+comment1+space+gma_print()+border_type_str;\n   if (border_always_visible)\n     total+=space+left+BORDER_AVIS_TAG+right;\n   if ( hilite_str.length() > 0 )\n     total+=space+hilite_str;\n   total+=right;\n   return total;\n}\n\n/*\nvoid \nGMapArea::map(GRectMapper &mapper)\n{\n    get_bound_rect();\n    GRect rect = GRect(xmin, ymin, xmax, ymax);\n    mapper.map(rect);\n    xmin = rect.xmin;\n    ymin = rect.ymin;\n    xmax = rect.xmax;\n    ymax = rect.ymax;\n    clear_bounds();\n}\nvoid \nGMapArea::unmap(GRectMapper &mapper)\n{\n    get_bound_rect();\n    GRect rect = GRect(xmin, ymin, xmax, ymax);\n    mapper.unmap(rect);\n    xmin = rect.xmin;\n    ymin = rect.ymin;\n    xmax = rect.xmax;\n    ymax = rect.ymax;\n    clear_bounds();\n}\n*/\n\n\n/// Virtual function generating a list of defining coordinates\n/// (default are the opposite corners of the enclosing rectangle)\nvoid GMapArea::get_coords( GList<int> & CoordList ) const\n{\n  CoordList.append( get_xmin() );\n  CoordList.append( get_ymin() );\n  CoordList.append( get_xmax() );\n  CoordList.append( get_ymax() );\n}\n\n\n/****************************************************************************\n**************************** GMapRect definition ****************************\n****************************************************************************/\n\nvoid\nGMapRect::gma_resize(int new_width, int new_height)\n{\n   xmax=xmin+new_width;\n   ymax=ymin+new_height;\n}\n\nvoid\nGMapRect::gma_transform(const GRect & grect)\n{\n   xmin=grect.xmin; ymin=grect.ymin;\n   xmax=grect.xmax; ymax=grect.ymax;\n}\n\nGUTF8String\nGMapRect::gma_print(void)\n{\n   GUTF8String buffer;\n   return buffer.format(\"(%s %d %d %d %d) \",\n\t   RECT_TAG, xmin, ymin, xmax-xmin, ymax-ymin);\n}\n\nvoid \nGMapRect::map(GRectMapper &mapper)\n{\n    get_bound_rect();\n    GRect rect;\n    rect.xmin = xmin;\n    rect.xmax = xmax;\n    rect.ymin = ymin;\n    rect.ymax = ymax;\n    mapper.map(rect);\n    xmin = rect.xmin;\n    ymin = rect.ymin;\n    xmax = rect.xmax;\n    ymax = rect.ymax;\n    clear_bounds();\n}\nvoid \nGMapRect::unmap(GRectMapper &mapper)\n{\n    get_bound_rect();\n    GRect rect;\n    rect.xmin = xmin;\n    rect.xmax = xmax;\n    rect.ymin = ymin;\n    rect.ymax = ymax;\n    mapper.unmap(rect);\n    xmin = rect.xmin;\n    ymin = rect.ymin;\n    xmax = rect.xmax;\n    ymax = rect.ymax;\n    clear_bounds();\n}\n\n/****************************************************************************\n**************************** GMapPoly definition ****************************\n****************************************************************************/\n\ninline int\nGMapPoly::sign(int x) { return x<0 ? -1 : x>0 ? 1 : 0; }\n\nbool\nGMapPoly::does_side_cross_rect(const GRect & grect, int side)\n{\n   int x1=xx[side], x2=xx[(side+1)%points];\n   int y1=yy[side], y2=yy[(side+1)%points];\n   int xmin=x1<x2 ? x1 : x2;\n   int ymin=y1<y2 ? y1 : y2;\n   int xmax=x1+x2-xmin;\n   int ymax=y1+y2-ymin;\n\n   if (xmax<grect.xmin || xmin>grect.xmax ||\n       ymax<grect.ymin || ymin>grect.ymax)\n     return false;\n\n   return\n     (x1>=grect.xmin && x1<=grect.xmax && y1>=grect.ymin && y1<=grect.ymax) ||\n     (x2>=grect.xmin && x2<=grect.xmax && y2>=grect.ymin && y2<=grect.ymax) ||\n     do_segments_intersect(grect.xmin, grect.ymin, grect.xmax, grect.ymax,\n\t\t\t   x1, y1, x2, y2) ||\n     do_segments_intersect(grect.xmax, grect.ymin, grect.xmin, grect.ymax,\n\t\t\t   x1, y1, x2, y2);\n}\n\nbool\nGMapPoly::is_projection_on_segment(int x, int y, int x1, int y1, int x2, int y2)\n{\n   int res1=(x-x1)*(x2-x1)+(y-y1)*(y2-y1);\n   int res2=(x-x2)*(x2-x1)+(y-y2)*(y2-y1);\n   return sign(res1)*sign(res2)<=0;\n}\n\nbool\nGMapPoly::do_segments_intersect(int x11, int y11, int x12, int y12,\n\t\t\t\tint x21, int y21, int x22, int y22)\n{\n   int res11=(x11-x21)*(y22-y21)-(y11-y21)*(x22-x21);\n   int res12=(x12-x21)*(y22-y21)-(y12-y21)*(x22-x21);\n   int res21=(x21-x11)*(y12-y11)-(y21-y11)*(x12-x11);\n   int res22=(x22-x11)*(y12-y11)-(y22-y11)*(x12-x11);\n   if (!res11 && !res12)\n   {\n      // Segments are on the same line\n      return\n\t is_projection_on_segment(x11, y11, x21, y21, x22, y22) ||\n\t is_projection_on_segment(x12, y12, x21, y21, x22, y22) ||\n\t is_projection_on_segment(x21, y21, x11, y11, x12, y12) ||\n\t is_projection_on_segment(x22, y22, x11, y11, x12, y12);\n   }\n   int sign1=sign(res11)*sign(res12);\n   int sign2=sign(res21)*sign(res22);\n   return sign1<=0 && sign2<=0;\n}\n\nbool\nGMapPoly::are_segments_parallel(int x11, int y11, int x12, int y12,\n\t\t\t\tint x21, int y21, int x22, int y22)\n{\n   return (x12-x11)*(y22-y21)-(y12-y11)*(x22-x21)==0;\n}\n\nchar const * const\nGMapPoly::check_data(void)\n{\n  if ((open && points<2) || (!open && points<3))\n    return error_too_few_points;\n  for(int i=0;i<sides;i++)\n    {\n      for(int j=i+2;j<sides;j++)\n\t{\n\t  if (i != (j+1)%points )\n\t    if (do_segments_intersect(xx[i], yy[i], xx[i+1], yy[i+1],\n\t\t\t\t      xx[j], yy[j], xx[(j+1)%points], yy[(j+1)%points]))\n\t      return error_intersect;\n\t}\n    }\n  return \"\";\n}\n\nvoid\nGMapPoly::optimize_data(void)\n{\n  // Removing segments of length zero\n  int i;\n  for(i=0;i<sides;i++)\n    {\n      while(xx[i]==xx[(i+1)%points] && yy[i]==yy[(i+1)%points])\n\t{\n\t  for(int k=(i+1)%points;k<points-1;k++)\n\t    {\n\t      xx[k]=xx[k+1]; yy[k]=yy[k+1];\n\t    }\n\t  points--; sides--;\n\t  if (!points) return;\n\t}\n    }\n  // Concatenating consequitive parallel segments\n  for(i=0;i<sides;i++)\n    {\n      while(((open && i+1<sides) || !open) &&\n\t    are_segments_parallel(xx[i], yy[i],\n\t\t\t\t  xx[(i+1)%points], yy[(i+1)%points],\n\t\t\t\t  xx[(i+1)%points], yy[(i+1)%points],\n\t\t\t\t  xx[(i+2)%points], yy[(i+2)%points]))\n\t{\n\t  for(int k=(i+1)%points;k<points-1;k++)\n\t    {\n\t      xx[k]=xx[k+1]; yy[k]=yy[k+1];\n\t    }\n\t  points--; sides--;\n\t  if (!points) return;\n\t}\n    }\n}\n\nbool\nGMapPoly::gma_is_point_inside(const int xin, const int yin) const\n{\n   if (open)\n     return false;\n\n   int xfar=get_xmax()+(get_xmax()-get_xmin());\n\n   int intersections=0;\n   for(int i=0;i<points;i++)\n   {\n      int res1=yy[i]-yin;\n      if (!res1) continue;\n      int res2, isaved=i;\n      while(!(res2=yy[(i+1)%points]-yin)) i++;\n      if (isaved!=i)\n      {\n\t // Some points fell exactly on the line\n\t if ((xx[(isaved+1)%points]-xin)*\n\t     (xx[i%points]-xin)<=0)\n\t {\n\t    // Test point is exactly on the boundary\n\t    return true;\n\t }\n      }\n      if ((res1<0 && res2>0) || (res1>0 && res2<0))\n      {\n\t int x1=xx[i%points], y1=yy[i%points];\n\t int x2=xx[(i+1)%points], y2=yy[(i+1)%points];\n\t int _res1=(xin-x1)*(y2-y1)-(yin-y1)*(x2-x1);\n\t int _res2=(xfar-x1)*(y2-y1)-(yin-y1)*(x2-x1);\n\t if (!_res1 || !_res2)\n\t {\n\t    // The point is on this boundary\n\t    return true;\n\t }\n\t if (sign(_res1)*sign(_res2)<0) intersections++;\n      }\n   }\n   return (intersections % 2)!=0;\n}\n\nint\nGMapPoly::gma_get_xmin(void) const\n{\n   int x=xx[0];\n   for(int i=1;i<points;i++)\n      if (x>xx[i]) x=xx[i];\n   return x;\n}\n\nint\nGMapPoly::gma_get_xmax(void) const\n{\n   int x=xx[0];\n   for(int i=1;i<points;i++)\n      if (x<xx[i]) x=xx[i];\n   return x+1;\n}\n\nint\nGMapPoly::gma_get_ymin(void) const\n{\n   int y=yy[0];\n   for(int i=1;i<points;i++)\n      if (y>yy[i]) y=yy[i];\n   return y;\n}\n\nint\nGMapPoly::gma_get_ymax(void) const\n{\n   int y=yy[0];\n   for(int i=1;i<points;i++)\n      if (y<yy[i]) y=yy[i];\n   return y+1;\n}\n\nvoid\nGMapPoly::gma_move(int dx, int dy)\n{\n   for(int i=0;i<points;i++)\n   {\n      xx[i]+=dx; yy[i]+=dy;\n   }\n}\n\nvoid\nGMapPoly::gma_resize(int new_width, int new_height)\n{\n   int width=get_xmax()-get_xmin();\n   int height=get_ymax()-get_ymin();\n   int xmin=get_xmin(), ymin=get_ymin();\n   for(int i=0;i<points;i++)\n   {\n      xx[i]=xmin+(xx[i]-xmin)*new_width/width;\n      yy[i]=ymin+(yy[i]-ymin)*new_height/height;\n   }\n}\n\nvoid\nGMapPoly::gma_transform(const GRect & grect)\n{\n   int width=get_xmax()-get_xmin();\n   int height=get_ymax()-get_ymin();\n   int xmin=get_xmin(), ymin=get_ymin();\n   for(int i=0;i<points;i++)\n   {\n      xx[i]=grect.xmin+(xx[i]-xmin)*grect.width()/width;\n      yy[i]=grect.ymin+(yy[i]-ymin)*grect.height()/height;\n   }\n}\n\nchar const * const\nGMapPoly::gma_check_object(void) const\n{\n   const char * str;\n   str=(border_type!=NO_BORDER &&\n        border_type!=SOLID_BORDER &&\n        border_type!=XOR_BORDER) ? error_poly_border:\n       ((hilite_color!=0xffffffff) ? error_poly_hilite:\"\");\n   return str;\n}\n\nGMapPoly::GMapPoly(const int * _xx, const int * _yy, int _points, bool _open) :\n   open(_open), points(_points)\n{\n   sides=points-(open!=0);\n   \n   xx.resize(points-1); yy.resize(points-1);\n   for(int i=0;i<points;i++)\n   {\n      xx[i]=_xx[i]; yy[i]=_yy[i];\n   }\n   optimize_data();\n   char const * const res=check_data();\n   if (res[0])\n     G_THROW(res);\n}\n\nint      \nGMapPoly::add_vertex(int x, int y)\n{\n    points++;\n    sides=points-(open!=0);\n\n    xx.resize(points-1); yy.resize(points-1);\n    xx[points-1] = x;\n    yy[points-1] = y;\n\n    return points;\n}\n\nvoid\nGMapPoly::close_poly()\n{\n    open = false;\n    sides=points;\n}\n\nGUTF8String\nGMapPoly::gma_print(void)\n{\n   static const GUTF8String space(' ');\n   GUTF8String res=GUTF8String('(')+POLY_TAG+space;\n   for(int i=0;i<points;i++)\n   {\n      GUTF8String buffer;\n      res+=buffer.format(\"%d %d \", xx[i], yy[i]);\n   }\n   res.setat(res.length()-1, ')');\n   res+=space;\n   return res;\n}\n\n/// Virtual function generating a list of defining coordinates\nvoid GMapPoly::get_coords( GList<int> & CoordList ) const\n{\n  for(int i = 0 ; i < points ; i++)\n  {\n    CoordList.append( xx[i] );\n    CoordList.append( yy[i] );\n  }\n}\n\nvoid \nGMapPoly::map(GRectMapper &mapper)\n{\n    get_bound_rect();\n    for(int i=0; i<points; i++)\n    {\n        mapper.map(xx[i], yy[i]);\n    }\n    clear_bounds();\n}\n\nvoid \nGMapPoly::unmap(GRectMapper &mapper)\n{\n    get_bound_rect();\n    for(int i=0; i<points; i++)\n    {\n        mapper.unmap(xx[i], yy[i]);\n    }\n    clear_bounds();\n}\n\n\n\n/****************************************************************************\n**************************** GMapOval definition ****************************\n****************************************************************************/\n\nvoid\nGMapOval::gma_resize(int new_width, int new_height)\n{\n   xmax=xmin+new_width;\n   ymax=ymin+new_height;\n   initialize();\n}\n\nvoid\nGMapOval::gma_transform(const GRect & grect)\n{\n   xmin=grect.xmin; ymin=grect.ymin;\n   xmax=grect.xmax; ymax=grect.ymax;\n   initialize();\n}\n\nbool\nGMapOval::gma_is_point_inside(const int x, const int y) const\n{\n   return\n      sqrt((double)((x-xf1)*(x-xf1)+(y-yf1)*(y-yf1))) +\n      sqrt((double)((x-xf2)*(x-xf2)+(y-yf2)*(y-yf2))) <= 2*rmax;\n}\n\nchar const * const\nGMapOval::gma_check_object(void) const\n{\n   return (border_type!=NO_BORDER &&\n       border_type!=SOLID_BORDER &&\n       border_type!=XOR_BORDER)?error_oval_border:\n      ((hilite_color!=0xffffffff) ? error_oval_hilite:\"\");\n}\n\nvoid\nGMapOval::initialize(void)\n{\n   int xc=(xmax+xmin)/2;\n   int yc=(ymax+ymin)/2;\n   int f;\n   \n   a=(xmax-xmin)/2;\n   b=(ymax-ymin)/2;\n   if (a>b)\n   {\n      rmin=b; rmax=a;\n      f=(int) sqrt((double)(rmax*rmax-rmin*rmin));\n      xf1=xc+f; xf2=xc-f; yf1=yf2=yc;\n   } else\n   {\n      rmin=a; rmax=b;\n      f=(int) sqrt((double)(rmax*rmax-rmin*rmin));\n      yf1=yc+f; yf2=yc-f; xf1=xf2=xc;\n   }\n}\n\nGMapOval::GMapOval(const GRect & rect) : xmin(rect.xmin), ymin(rect.ymin),\n   xmax(rect.xmax), ymax(rect.ymax)\n{\n   initialize();\n}\n\nGUTF8String\nGMapOval::gma_print(void)\n{\n   GUTF8String buffer;\n   return buffer.format(\"(%s %d %d %d %d) \",\n\t   OVAL_TAG, xmin, ymin, xmax-xmin, ymax-ymin);\n}\n\nvoid \nGMapOval::map(GRectMapper &mapper)\n{\n    get_bound_rect();\n    GRect rect;\n    rect.xmin = xmin;\n    rect.xmax = xmax;\n    rect.ymin = ymin;\n    rect.ymax = ymax;\n    mapper.map(rect);\n    xmin = rect.xmin;\n    ymin = rect.ymin;\n    xmax = rect.xmax;\n    ymax = rect.ymax;\n    clear_bounds();\n    initialize();\n}\n\nvoid \nGMapOval::unmap(GRectMapper &mapper)\n{\n    get_bound_rect();\n    GRect rect;\n    rect.xmin = xmin;\n    rect.xmax = xmax;\n    rect.ymin = ymin;\n    rect.ymax = ymax;\n    mapper.unmap(rect);\n    xmin = rect.xmin;\n    ymin = rect.ymin;\n    xmax = rect.xmax;\n    ymax = rect.ymax;\n    clear_bounds();\n    initialize();\n}\n\nGMapArea::GMapArea(void) : target(\"_self\"), border_type(NO_BORDER),\n   border_always_visible(false), border_color(0xff), border_width(1),\n   hilite_color(0xffffffff), bounds_initialized(0) {}\n\nGMapRect::GMapRect(void) : xmin(0), ymin(0), xmax(0), ymax(0) {}\n\nGMapRect::GMapRect(const GRect & rect) : xmin(rect.xmin), ymin(rect.ymin),\n   xmax(rect.xmax), ymax(rect.ymax) {}\n\nGMapRect &\nGMapRect::operator=(const GRect & rect)\n{\n   xmin=rect.xmin;\n   xmax=rect.xmax;\n   ymin=rect.ymin;\n   ymax=rect.ymax;\n   return *this;\n}\n\nvoid\nGMapRect::gma_move(int dx, int dy)\n{\n   xmin+=dx;\n   xmax+=dx;\n   ymin+=dy;\n   ymax+=dy;\n}\n\nbool\nGMapRect::gma_is_point_inside(const int x, const int y) const\n{\n   return (x>=xmin)&&(x<xmax)&&(y>=ymin)&&(y<ymax);\n}\n\nGP<GMapArea>\nGMapRect::get_copy(void) const { return new GMapRect(*this); }\n\nGMapPoly::GMapPoly(void) : points(0), sides(0) {}\n\nvoid\nGMapPoly::move_vertex(int i, int x, int y)\n{\n   xx[i]=x; yy[i]=y;\n   clear_bounds();\n}\n\nGP<GMapArea>\nGMapPoly::get_copy(void) const { return new GMapPoly(*this); }\n\nGMapOval::GMapOval(void) : xmin(0), ymin(0), xmax(0), ymax(0) {}\n\nvoid\nGMapOval::gma_move(int dx, int dy)\n{\n   xmin+=dx; xmax+=dx; ymin+=dy; ymax+=dy;\n   xf1+=dx; yf1+=dy; xf2+=dx; yf2+=dy;\n}\n\nGP<GMapArea>\nGMapOval::get_copy(void) const\n{\n  return new GMapOval(*this);\n}\n\nstatic GUTF8String\nGMapArea2xmltag(const GMapArea &area,const GUTF8String &coords)\n{\n  GUTF8String retval(\"<AREA coords=\\\"\"\n    +coords+\"\\\" shape=\\\"\"+area.get_shape_name()+\"\\\" \"\n    +\"alt=\\\"\"+area.comment.toEscaped()+\"\\\" \");\n  if(area.url.length())\n  {\n    retval+=\"href=\\\"\"+area.url+\"\\\" \";\n  }else\n  {\n    retval+=\"nohref=\\\"nohref\\\" \";\n  }\n  if(area.target.length())\n  {\n    retval+=\"target=\\\"\"+area.target.toEscaped()+\"\\\" \";\n  }\n  //  highlight\n  if( area.hilite_color != GMapArea::NO_HILITE &&\n      area.hilite_color != GMapArea::XOR_HILITE )\n  {\n    retval+=GUTF8String().format( \"highlight=\\\"#%06X\\\" \", area.hilite_color );\n  }\n  const char *b_type=\"none\";\n  switch( area.border_type )\n  {\n  case GMapArea::NO_BORDER:\n    b_type = \"none\";\n    break;\n  case GMapArea::XOR_BORDER:\n    b_type = \"xor\";\n    break;\n  case GMapArea::SOLID_BORDER:\n    b_type = \"solid\";\n    break;\n  case GMapArea::SHADOW_IN_BORDER:\n    b_type = \"shadowin\";\n    break;\n  case GMapArea::SHADOW_OUT_BORDER:\n    b_type = \"shadowout\";\n    break;\n  case GMapArea::SHADOW_EIN_BORDER:\n    b_type = \"etchedin\";\n    break;\n  case GMapArea::SHADOW_EOUT_BORDER:\n    b_type = \"etchedout\";\n    break;\n  }\n  retval=retval+\"bordertype=\\\"\"+b_type+\"\\\" \";\n  if( area.border_type != GMapArea::NO_BORDER)\n  {\n    retval+=\"bordercolor=\\\"\"+GUTF8String().format(\"#%06X\",area.border_color)\n      +\"\\\" border=\\\"\"+GUTF8String(area.border_width)+\"\\\" \";\n  }\n  if(area.border_always_visible )\n    retval=retval+\"visible=\\\"visible\\\" \";\n  return retval+\"/>\\n\";\n}\n\nGUTF8String\nGMapRect::get_xmltag(const int height) const\n{\n  return GMapArea2xmltag( *this, GUTF8String(get_xmin())\n    +\",\"+GUTF8String(height-1-get_ymax())\n    +\",\"+GUTF8String(get_xmax())\n    +\",\"+GUTF8String(height-1-get_ymin()));\n#if 0\n  GUTF8String retval;\n  return retval;\n#endif\n}\n\nGUTF8String\nGMapOval::get_xmltag(const int height) const\n{ \n  return GMapArea2xmltag( *this, GUTF8String(get_xmin())\n    +\",\"+GUTF8String(height-1-get_ymax())\n    +\",\"+GUTF8String(get_xmax())\n    +\",\"+GUTF8String(height-1-get_ymin()));\n#if 0\n  GUTF8String retval;\n  return retval;\n#endif\n}\n\nGUTF8String\nGMapPoly::get_xmltag(const int height) const\n{\n  GList<int> CoordList;\n  get_coords(CoordList);\n  GPosition pos=CoordList;\n  GUTF8String retval;\n  if(pos)\n  {\n    GUTF8String coords(CoordList[pos]);\n    while(++pos)\n    {\n      coords+=\",\"+GUTF8String(height-1-CoordList[pos]);\n      if(! ++pos)\n        break;\n      coords+=\",\"+GUTF8String(CoordList[pos]);\n    }\n    retval=GMapArea2xmltag( *this, coords);\n  }\n  return retval;\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/GMapAreas.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _GMAPAREAS_H\n#define _GMAPAREAS_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n#include \"GSmartPointer.h\"\n#include \"GContainer.h\"\n#include \"GString.h\"\n#include \"GRect.h\"\n#include \"GURL.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n/** @name GMapAreas.h\n\n    Files #\"GMapAreas.h\"# and #\"GMapAreas.cpp\"# implement base objects\n    used by the plugin to display and manage hyperlinks and highlighted\n    areas inside a \\Ref{DjVuImage} page.\n\n    The currently supported areas can be rectangular (\\Ref{GMapRect}),\n    elliptical (\\Ref{GMapOval}) and polygonal (\\Ref{GMapPoly}). Every\n    map area besides the definition of its shape contains information\n    about display style and optional {\\bf URL}, which it may refer to.\n    If this {\\bf URL} is not empty then the map area will work like a\n    hyperlink.\n\n    The classes also implement some useful functions to ease geometry\n    manipulations\n\n    @memo Definition of base map area classes\n    @author Andrei Erofeev <eaf@geocities.com>\n*/\n//@{\n\n\n// ---------- GMAPAREA ---------\n\n/** This is the base object for all map areas. It defines some standard\n    interface to access the geometrical properties of the areas and\n    describes the area itsef:\n    \\begin{itemize}\n       \\item #url# If the optional #URL# is specified, the map area will\n             also work as a hyperlink meaning that if you click it with\n\t     your mouse pointer, the browser will be advised to load\n\t     the page referenced by the #URL#.\n       \\item #target# Defines where the specified #URL# should be loaded\n       \\item #comment# This is a string displayed in a status line or in\n             a popup window when the mouse pointer moves over the hyperlink\n\t     area\n       \\item #border_type#, #border_color# and #border_width# describes\n             how the area border should be drawn\n       \\item #area_color# describes how the area should be highlighted.\n    \\end{itemize}\n\n    The map areas can be displayed using two different techniques, which\n    can be combined together:\n    \\begin{itemize}\n       \\item Visible border. The border of a map area can be drawn in several\n             different ways (like #XOR_BORDER# or #SHADOW_IN_BORDER#).\n\t     It can be made always visible, or appearing only when the\n\t     mouse pointer moves over the map area.\n       \\item Highlighted contents. Contents of rectangular map areas can\n             also be highlighted with some given color.\n    \\end{itemize}\n*/\n\nclass GMapArea : public GPEnabled\n{\nprotected:\n   GMapArea(void);\npublic:\n//      // Default creator.\n//   static GP<GMapArea> create(void) {return new GMapArea();}\n\n      /// Virtual destructor.\n   virtual ~GMapArea();\n\n   static const char MAPAREA_TAG [];\n   static const char RECT_TAG [];\n   static const char POLY_TAG [];\n   static const char OVAL_TAG [];\n   static const char NO_BORDER_TAG [];\n   static const char XOR_BORDER_TAG [];\n   static const char SOLID_BORDER_TAG [];\n   static const char SHADOW_IN_BORDER_TAG [];\n   static const char SHADOW_OUT_BORDER_TAG [];\n   static const char SHADOW_EIN_BORDER_TAG [];\n   static const char SHADOW_EOUT_BORDER_TAG [];\n   static const char BORDER_AVIS_TAG [];\n   static const char HILITE_TAG [];\n   static const char URL_TAG [];\n   static const char TARGET_SELF [];\n\n   enum BorderType { NO_BORDER=0, XOR_BORDER=1, SOLID_BORDER=2,\n\t\t     SHADOW_IN_BORDER=3, SHADOW_OUT_BORDER=4,\n\t\t     SHADOW_EIN_BORDER=5, SHADOW_EOUT_BORDER=6 };\n\n   enum Special_Hilite_Color{ NO_HILITE=0xFFFFFFFF, XOR_HILITE=0xFF000000};\n\n   // Enumeration for reporting the type of map area. \"MapUnknown\" is reported\n   // for objects of type GMapArea (there shouldn't be any).\n   enum MapAreaType { UNKNOWN, RECT, OVAL, POLY };\n\n      /** Optional URL which this map area can be associated with.\n\t  If it's not empty then clicking this map area with the mouse\n\t  will make the browser load the HTML page referenced by\n\t  this #url#.  Note: This may also be a relative URL, so the\n          GURL class is not used. */\n   GUTF8String\turl;\n      /** The target for the #URL#. Standard targets are:\n\t  \\begin{itemize}\n\t     \\item #_blank# - Load the link in a new blank window\n\t     \\item #_self# - Load the link into the plugin window\n\t     \\item #_top# - Load the link into the top-level frame\n\t  \\end{itemize} */\n   GUTF8String\ttarget;\n      /** Comment (displayed in a status line or as a popup hint when\n\t  the mouse pointer moves over the map area */\n   GUTF8String\tcomment;\n      /** Border type. Defines how the map area border should be drawn\n\t  \\begin{itemize}\n\t     \\item #NO_BORDER# - No border drawn\n\t     \\item #XOR_BORDER# - The border is drawn using XOR method.\n\t     \\item #SOLID_BORDER# - The border is drawn as a solid line\n\t           of a given color.\n\t     \\item #SHADOW_IN_BORDER# - Supported for \\Ref{GMapRect} only.\n\t     \t   The map area area looks as if it was \"pushed-in\".\n\t     \\item #SHADOW_OUT_BORDER# - The opposite of #SHADOW_OUT_BORDER#\n\t     \\item #SHADOW_EIN_BORDER# - Also for \\Ref{GMapRect} only.\n\t     \t   Is translated as \"shadow etched in\"\n\t     \\item #SHADOW_EOUT_BORDER# - The opposite of #SHADOW_EIN_BORDER#.\n\t  \\end{itemize} */\n   BorderType\tborder_type;\n      /** If #TRUE#, the border will be made always visible. Otherwise\n\t  it will be drawn when the mouse moves over the map area. */\n   bool\t\tborder_always_visible;\n      /// Border color (when relevant) in #0x00RRGGBB# format\n   unsigned long int\tborder_color;\n      /// Border width in pixels\n   int\t\tborder_width;\n      /** Specified a color for highlighting the internal area of the map\n\t  area. Will work with rectangular map areas only. The color is\n\t  specified in \\#00RRGGBB format. A special value of \\#FFFFFFFF disables\n          highlighting and \\#FF000000 is for XOR highlighting. */\n   unsigned long int\thilite_color;\n\n      /// Returns 1 if the given point is inside the hyperlink area\n   bool\t\tis_point_inside(int x, int y) const;\n\n      /// Returns xmin of the bounding rectangle\n   int\t\tget_xmin(void) const;\n      /// Returns ymin of the bounding rectangle\n   int\t\tget_ymin(void) const;\n      /** Returns xmax of the bounding rectangle. In other words, if #X# is\n\t  a coordinate of the last point in the right direction, the\n\t  function will return #X+1# */\n   int\t\tget_xmax(void) const;\n      /** Returns xmax of the bounding rectangle. In other words, if #Y# is\n\t  a coordinate of the last point in the top direction, the\n\t  function will return #Y+1# */\n   int\t\tget_ymax(void) const;\n      /// Returns the hyperlink bounding rectangle\n   GRect\tget_bound_rect(void) const;\n      /** Moves the hyperlink along the given vector. Is used by the\n\t  hyperlinks editor. */\n   void\t\tmove(int dx, int dy);\n      /** Resizes the hyperlink to fit new bounding rectangle while\n\t  keeping the (xmin, ymin) points at rest. */\n   void\t\tresize(int new_width, int new_height);\n      /** Transforms the hyperlink to be within the specified rectangle */\n   void\t\ttransform(const GRect & grect);\n      /** Checks if the object is OK. Especially useful with \\Ref{GMapPoly}\n\t  where edges may intersect. If there is a problem it returns a\n\t  string describing it. */\n   char const *\tconst check_object(void);\n      /** Stores the contents of the hyperlink object in a lisp-like format\n\t  for saving into #ANTa# chunk (see \\Ref{DjVuAnno}) */\n   GUTF8String\tprint(void);\n\n   virtual GUTF8String get_xmltag(const int height) const=0;\n\n      /// Virtual function returning the shape type.\n   virtual MapAreaType const get_shape_type( void ) const { return UNKNOWN; };\n      /// Virtual function returning the shape name.\n   virtual char const * const\tget_shape_name(void) const=0;\n      /// Virtual function generating a copy of this object\n   virtual GP<GMapArea>\tget_copy(void) const=0;\n      /// Virtual function generating a list of defining coordinates\n      /// (default are the opposite corners of the enclosing rectangle)\n   virtual void get_coords( GList<int> & CoordList ) const;\n   /// Virtual function maps maparea from one area to another using mapper\n   virtual void map(GRectMapper &mapper)=0;\n   /// Virtual function unmaps maparea from one area to another using mapper\n   virtual void unmap(GRectMapper &mapper)=0;\n\nprotected:\n   virtual int\t\tgma_get_xmin(void) const=0;\n   virtual int\t\tgma_get_ymin(void) const=0;\n   virtual int\t\tgma_get_xmax(void) const=0;\n   virtual int\t\tgma_get_ymax(void) const=0;\n   virtual void\t\tgma_move(int dx, int dy)=0;\n   virtual void\t\tgma_resize(int new_width, int new_height)=0;\n   virtual void\t\tgma_transform(const GRect & grect)=0;\n   virtual bool\t\tgma_is_point_inside(const int x, const int y) const=0;\n   virtual char const * const\tgma_check_object(void) const=0;\n   virtual GUTF8String\tgma_print(void)=0;\n   \n   void\t\tclear_bounds(void) { bounds_initialized=0; }\nprivate:\n   int\t\txmin, xmax, ymin, ymax;\n   bool\t\tbounds_initialized;\n\n   void\t\tinitialize_bounds(void);\n};\n\n// ---------- GMAPRECT ---------\n\n/** Implements rectangular map areas. This is the only kind of map areas\n    supporting #SHADOW_IN_BORDER#, #SHADOW_OUT_BORDER#, #SHADOW_EIN_BORDER#\n    and #SHADOW_EOUT_BORDER# types of border and area highlighting. */\n\nclass GMapRect: public GMapArea\n{\nprotected:\n   GMapRect(void);\n   GMapRect(const GRect & rect);\npublic:\n   /// Default creator.\n   static GP<GMapRect> create(void) {return new GMapRect();}\n   /// Create with the specified GRect.\n   static GP<GMapRect> create(const GRect &rect) {return new GMapRect(rect);}\n\n   virtual ~GMapRect();\n\n      /// Returns the width of the rectangle\n   int\t\tget_width(void) const { return xmax-xmin; }\n      /// Returns the height of the rectangle\n   int\t\tget_height(void) const { return ymax-ymin; }\n\n      /// Changes the #GMapRect#'s geometry\n   GMapRect & operator=(const GRect & rect);\n\n      /// Returns \\Ref{GRect} describing the map area's rectangle\n   operator GRect(void);\n   \n   virtual GUTF8String get_xmltag(const int height) const;\n      /// Returns MapRect\n   virtual MapAreaType const get_shape_type( void ) const { return RECT; };\n      /// Returns #\"rect\"#\n   virtual char const * const\tget_shape_name(void) const;\n      /// Returns a copy of the rectangle\n   virtual GP<GMapArea>\tget_copy(void) const;\n      /// Virtual function maps rectangle from one area to another using mapper\n   virtual void map(GRectMapper &mapper);\n      /// Virtual function unmaps rectangle from one area to another using mapper\n   virtual void unmap(GRectMapper &mapper);\nprotected:\n   int\t\t\txmin, ymin, xmax, ymax;\n   virtual int\t\tgma_get_xmin(void) const;\n   virtual int\t\tgma_get_ymin(void) const;\n   virtual int\t\tgma_get_xmax(void) const;\n   virtual int\t\tgma_get_ymax(void) const;\n   virtual void\t\tgma_move(int dx, int dy);\n   virtual void\t\tgma_resize(int new_width, int new_height);\n   virtual void\t\tgma_transform(const GRect & grect);\n   virtual bool\t\tgma_is_point_inside(const int x, const int y) const;\n   virtual char const * const gma_check_object(void) const;\n   virtual GUTF8String\tgma_print(void);\n};\n\n// ---------- GMAPPOLY ---------\n\n/** Implements polygonal map areas. The only supported types of border\n    are #NO_BORDER#, #XOR_BORDER# and #SOLID_BORDER#. Its contents can not\n    be highlighted either. It's worth mentioning here that despite its\n    name the polygon may be open, which basically makes it a broken line.\n    This very specific mode is used by the hyperlink editor when creating\n    the polygonal hyperlink. */\n\nclass GMapPoly : public GMapArea\n{\nprotected:\n   GMapPoly(void);\n   GMapPoly(const int * xx, const int * yy, int points, bool open=false);\npublic:\n   /// Default creator\n   static GP<GMapPoly> create(void) {return new GMapPoly();}\n\n   /// Create from specified coordinates.\n   static GP<GMapPoly> create(\n     const int xx[], const int yy[], const int points, const bool open=false)\n   {return new GMapPoly(xx,yy,points,open);}\n\n   /// Virtual destructor.\n   virtual ~GMapPoly();\n\n      /// Returns 1 if side #side# crosses the specified rectangle #rect#.\n   bool\t\tdoes_side_cross_rect(const GRect & grect, int side);\n\n      /// Returns the number of vertices in the polygon\n   int\t\tget_points_num(void) const;\n\n      /// Returns the number sides in the polygon\n   int\t\tget_sides_num(void) const;\n\n      /// Returns x coordinate of vertex number #i#\n   int\t\tget_x(int i) const;\n   \n      /// Returns y coordinate of vertex number #i#\n   int\t\tget_y(int i) const;\n\n      /// Moves vertex #i# to position (#x#, #y#)\n   void\t\tmove_vertex(int i, int x, int y);\n\n      /// Adds a new vertex and returns number of vertices in the polygon\n   int      add_vertex(int x, int y);\n\n      /// Closes the polygon if it is not closed\n   void     close_poly();\n      /// Optimizes the polygon \n   void\t\toptimize_data(void);\n      /// Checks validity of the polygon \n   char const * const\tcheck_data(void);\n\n   virtual GUTF8String get_xmltag(const int height) const;\n      /// Returns MapPoly\n   virtual MapAreaType const get_shape_type( void ) const { return POLY; };\n      /// Returns #\"poly\"# all the time\n   virtual char const * const \tget_shape_name(void) const;\n      /// Returns a copy of the polygon\n   virtual GP<GMapArea>\tget_copy(void) const;\n      /// Virtual function generating a list of defining coordinates\n   void get_coords( GList<int> & CoordList ) const;\n      /// Virtual function maps polygon from one area to another using mapper\n   virtual void map(GRectMapper &mapper);\n   /// Virtual function unmaps polygon from one area to another using mapper\n   virtual void unmap(GRectMapper &mapper);\nprotected:\n   virtual int\t\tgma_get_xmin(void) const;\n   virtual int\t\tgma_get_ymin(void) const;\n   virtual int\t\tgma_get_xmax(void) const;\n   virtual int\t\tgma_get_ymax(void) const;\n   virtual void\t\tgma_move(int dx, int dy);\n   virtual void\t\tgma_resize(int new_width, int new_height);\n   virtual void\t\tgma_transform(const GRect & grect);\n   virtual bool\t\tgma_is_point_inside(const int x, const int y) const;\n   virtual char const * const gma_check_object(void) const;\n   virtual GUTF8String\tgma_print(void);\nprivate:\n   bool\t\topen;\n   int\t\tpoints, sides;\n   GTArray<int>\txx, yy;\n   static int\tsign(int x);\n   static bool\tis_projection_on_segment(int x, int y, int x1, int y1, int x2, int y2);\n   static bool\tdo_segments_intersect(int x11, int y11, int x12, int y12,\n\t\t\t\t      int x21, int y21, int x22, int y22);\n   static bool\tare_segments_parallel(int x11, int y11, int x12, int y12,\n\t\t\t\t      int x21, int y21, int x22, int y22);\n};\n\n// ---------- GMAPOVAL ---------\n\n/** Implements elliptical map areas. The only supported types of border\n    are #NO_BORDER#, #XOR_BORDER# and #SOLID_BORDER#. Its contents can not\n    be highlighted either. */\n\nclass GMapOval: public GMapArea\n{\nprotected:\n   GMapOval(void);\n   GMapOval(const GRect & rect);\npublic:\n   /// Default creator.\n   static GP<GMapOval> create(void) {return new GMapOval();}\n\n   /// Create from the specified GRect.\n   static GP<GMapOval> create(const GRect &rect) {return new GMapOval(rect);}\n\n   /// Virtual destructor. \n   virtual ~GMapOval();\n\n      /// Returns (xmax-xmin)/2\n   int\t\tget_a(void) const;\n      /// Returns (ymax-ymin)/2\n   int\t\tget_b(void) const;\n      /// Returns the lesser of \\Ref{get_a}() and \\Ref{get_b}()\n   int\t\tget_rmin(void) const;\n      /// Returns the greater of \\Ref{get_a}() and \\Ref{get_b}()\n   int\t\tget_rmax(void) const;\n\n   virtual GUTF8String get_xmltag(const int height) const;\n      /// Returns MapOval\n   virtual MapAreaType const get_shape_type( void ) const { return OVAL; };\n      /// Returns #\"oval\"#\n   virtual char const * const get_shape_name(void) const;\n      /// Returns a copy of the oval\n   virtual GP<GMapArea>\tget_copy(void) const;\n      /// Virtual function maps oval from one area to another using mapper\n   virtual void map(GRectMapper &mapper);\n      /// Virtual function unmaps oval from one area to another using mapper\n   virtual void unmap(GRectMapper &mapper);\nprotected:\n   virtual int\t\tgma_get_xmin(void) const;\n   virtual int\t\tgma_get_ymin(void) const;\n   virtual int\t\tgma_get_xmax(void) const;\n   virtual int\t\tgma_get_ymax(void) const;\n   virtual void\t\tgma_move(int dx, int dy);\n   virtual void\t\tgma_resize(int new_width, int new_height);\n   virtual void\t\tgma_transform(const GRect & grect);\n   virtual bool\t\tgma_is_point_inside(const int x, const int y) const;\n   virtual char const * const\tgma_check_object(void) const;\n   virtual GUTF8String\tgma_print(void);\nprivate:\n   int\t\trmax, rmin;\n   int\t\ta, b;\n   int\t\txf1, yf1, xf2, yf2;\n   int\t\txmin, ymin, xmax, ymax;\n   \n   void\t\tinitialize(void);\n};\n\ninline\nGMapRect::operator GRect(void)\n{\n  return GRect(xmin, ymin, xmax-xmin, ymax-ymin);\n}\n\ninline int\nGMapRect::gma_get_xmin(void) const { return xmin; }\n\ninline int\nGMapRect::gma_get_ymin(void) const { return ymin; }\n\ninline int\nGMapRect::gma_get_xmax(void) const { return xmax; }\n\ninline int\nGMapRect::gma_get_ymax(void) const { return ymax; }\n\ninline char const * const\nGMapRect::gma_check_object(void)  const{ return \"\"; }\n\ninline char const * const \nGMapRect::get_shape_name(void) const { return RECT_TAG; }\n\ninline int\nGMapPoly::get_points_num(void) const { return points; }\n\ninline int\nGMapPoly::get_sides_num(void) const { return sides; }\n\ninline int\nGMapPoly::get_x(int i) const { return xx[i]; }\n\ninline int\nGMapPoly::get_y(int i) const { return yy[i]; }\n\ninline char const * const\nGMapPoly::get_shape_name(void) const { return POLY_TAG; }\n\ninline int\nGMapOval::get_a(void) const { return a; }\n\ninline int\nGMapOval::get_b(void) const { return b; }\n\ninline int\nGMapOval::get_rmin(void) const { return rmin; }\n\ninline int\nGMapOval::get_rmax(void) const { return rmax; }\n\ninline int\nGMapOval::gma_get_xmin(void) const { return xmin; }\n\ninline int\nGMapOval::gma_get_ymin(void) const { return ymin; }\n\ninline int\nGMapOval::gma_get_xmax(void) const { return xmax; }\n\ninline int\nGMapOval::gma_get_ymax(void) const { return ymax; }\n\ninline char const * const\nGMapOval::get_shape_name(void) const { return OVAL_TAG; }\n\n//@}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/GOS.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"GException.h\"\n#include \"GThreads.h\"\n#include \"GOS.h\"\n#include \"GURL.h\"\n\n#include <stddef.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <ctype.h>\n#include <math.h>\n#include <string.h>\n\n#if defined(__CYGWIN32__)\n# define UNIX 1\n#endif\n\n#if defined(WIN32) && !defined(UNIX)\n# include <windows.h>\n# include <direct.h>\n# define getcwd _getcwd\n#endif\n\n#if defined(OS2)\n# define INCL_DOS\n# include <os2.h>\n#endif\n\n#if defined(macintosh) && !defined(UNIX)\n# include <unix.h>\n# include <errno.h>\n# include <unistd.h>\n#endif\n\n#if defined(UNIX) || defined(OS2)\n# include <errno.h>\n# include <sys/types.h>\n# include <sys/stat.h>\n# include <sys/time.h>\n# include <fcntl.h>\n# include <pwd.h>\n# include <stdio.h>\n# include <unistd.h>\n#endif\n\n\n// -- TRUE FALSE\n#undef TRUE\n#undef FALSE\n#define TRUE 1\n#define FALSE 0\n\n// -- MAXPATHLEN\n#ifndef MAXPATHLEN\n# ifdef _MAX_PATH\n#  define MAXPATHLEN _MAX_PATH\n# else\n#  define MAXPATHLEN 1024\n# endif\n#else\n# if ( MAXPATHLEN < 1024 )\n#  undef MAXPATHLEN\n#  define MAXPATHLEN 1024\n# endif\n#endif\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n#if defined(AUTOCONF) && !defined(HAVE_STRERROR)\n# define NEED_STRERROR\n#elif defined(sun) && !defined(__svr4__) && !defined(__SVR4)\n# define NEED_STRERROR\n#elif defined(REIMPLEMENT_STRERROR)\n# define NEED_STRERROR\n#endif\n#ifdef NEED_STRERROR\nchar *\nstrerror(int errno)\n{\n  extern int sys_nerr;\n  extern char *sys_errlist[];\n  if (errno>0 && errno<sys_nerr) \n    return sys_errlist[errno];\n  return \"unknown stdio error\";\n}\n#endif\n\n\nstatic const char slash='/';\nstatic const char percent='%';\nstatic const char backslash='\\\\';\nstatic const char colon=':';\nstatic const char dot='.';\nstatic const char nillchar=0;\n\n\n// -----------------------------------------\n// Functions for dealing with filenames\n// -----------------------------------------\n\nstatic inline int\nfinddirsep(const GUTF8String &fname)\n{\n#if defined(WIN32)\n  return fname.rcontains(\"\\\\/\",0);\n#elif defined(UNIX)\n  return fname.rsearch('/',0);\n#elif defined(macintosh)\n  return fname.rcontains(\":/\",0);\n#else\n# error \"Define something here for your operating system\"\n#endif  \n}\n\n\n// basename(filename[, suffix])\n// -- returns the last component of filename and removes suffix\n//    when present. works like /bin/basename.\nGUTF8String \nGOS::basename(const GUTF8String &gfname, const char *suffix)\n{\n  if(!gfname.length())\n    return gfname;\n\n  const char *fname=gfname;\n#if defined(WIN32) || defined(OS2)\n  // Special cases\n  if (fname[1] == colon)\n  {\n    if(!fname[2])\n    {\n      return gfname;\n    }\n    if (!fname[3] && (fname[2]== slash || fname[2]== backslash))\n    {\n      char string_buffer[4];\n      string_buffer[0] = fname[0];\n      string_buffer[1] = colon;\n      string_buffer[2] = backslash; \n      string_buffer[3] = 0; \n      return string_buffer;\n    }\n  }\n#endif\n\n\n  // Allocate buffer\n  GUTF8String retval(gfname,finddirsep(gfname)+1,(unsigned int)(-1));\n  fname=retval;\n\n  // Process suffix\n  if (suffix)\n  {\n    if (suffix[0]== dot )\n      suffix ++;\n    if (suffix[0])\n    {\n      const GUTF8String gsuffix(suffix);\n      const int sl = gsuffix.length();\n      const char *s = fname + strlen(fname);\n      if (s > fname + sl)\n      {\n        s = s - (sl + 1);\n        if(*s == dot && (GUTF8String(s+1).downcase() == gsuffix.downcase()))\n        {\n          retval.setat((int)((size_t)s-(size_t)fname),0);\n        }\n      }\n    }\n  }\n  return retval;\n}\n\n\n\n// errmsg --\n// -- A small helper function returning a \n//    stdio error message in a static buffer.\n\nstatic GNativeString \nerrmsg()\n{\n  GNativeString buffer;\n  const char *errname = strerror(errno);\n  buffer.format(\"%s (errno = %d)\", errname, errno);\n  return buffer;\n}\n\n\n\n// -----------------------------------------\n// Functions for measuring time\n// -----------------------------------------\n\n// ticks() --\n// -- returns the number of milliseconds elapsed since \n//    a system dependent date.\nunsigned long \nGOS::ticks()\n{\n#if defined(UNIX)\n  struct timeval tv;\n  if (gettimeofday(&tv, NULL) < 0)\n    G_THROW(errmsg());\n  return (unsigned long)( ((tv.tv_sec & 0xfffff)*1000) \n                          + (tv.tv_usec/1000) );\n#elif defined(WIN32)\n  DWORD clk = GetTickCount();\n  return (unsigned long)clk;\n#elif defined(OS2)\n  ULONG clk = 0;\n  DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, (PVOID)&clk, sizeof(ULONG));\n  return clk;\n#elif defined(macintosh)\n  return (unsigned long)((double)TickCount()*16.66);\n#else\n# error \"Define something here for your operating system\"\n#endif\n}\n\n// sleep(int milliseconds) --\n// -- sleeps during the specified time (in milliseconds)\nvoid \nGOS::sleep(int milliseconds)\n{\n#if defined(UNIX)\n  struct timeval tv;\n  tv.tv_sec = milliseconds / 1000;\n  tv.tv_usec = (milliseconds - (tv.tv_sec * 1000)) * 1000;\n# if defined(THREADMODEL) && (THREADMODEL==COTHREADS)\n  GThread::select(0, NULL, NULL, NULL, &tv);\n# else\n  select(0, NULL, NULL, NULL, &tv);\n# endif\n#elif defined(WIN32)\n  Sleep(milliseconds);\n#elif defined(OS2)\n  DosSleep(milliseconds);\n#elif defined(macintosh)\n  unsigned long tick = ticks(), now;\n  while (1) {\n    now = ticks();\n    if ((tick+milliseconds) < now)\n      break;\n    GThread::yield();\n  }\n#endif\n}\n\n\n// -----------------------------------------\n// Testing\n// -----------------------------------------\n\n// cwd([dirname])\n// -- changes directory to dirname (when specified).\n//    returns the full path name of the current directory. \nGUTF8String \nGOS::cwd(const GUTF8String &dirname)\n{\n#if defined(UNIX) || defined(macintosh) || defined(OS2)\n  if (dirname.length() && chdir(dirname.getUTF82Native())==-1)//MBCS cvt\n    G_THROW(errmsg());\n  char *string_buffer;\n  GPBuffer<char> gstring_buffer(string_buffer,MAXPATHLEN+1);\n  char *result = getcwd(string_buffer,MAXPATHLEN);\n  if (!result)\n    G_THROW(errmsg());\n  return GNativeString(result).getNative2UTF8();//MBCS cvt\n#elif defined (WIN32)\n  char drv[2];\n  if (dirname.length() && _chdir(dirname.getUTF82Native())==-1)//MBCS cvt\n    G_THROW(errmsg());\n  drv[0]= dot ; drv[1]=0;\n  char *string_buffer;\n  GPBuffer<char> gstring_buffer(string_buffer,MAXPATHLEN+1);\n  char *result = getcwd(string_buffer,MAXPATHLEN);\n  GetFullPathName(drv, MAXPATHLEN, string_buffer, &result);\n  return GNativeString(string_buffer).getNative2UTF8();//MBCS cvt\n#else\n# error \"Define something here for your operating system\"\n#endif \n}\n\nGUTF8String\nGOS::getenv(const GUTF8String &name)\n{\n  GUTF8String retval;\n  if(name.length())\n  {\n    const char *env=::getenv(name.getUTF82Native());\n    if(env)\n    {\n      retval=GNativeString(env);\n    }\n  }\n  return retval;\n}\n\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/GOS.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _GOS_H_\n#define _GOS_H_\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n/** @name GOS.h\n    Files #\"GOS.h\"# and #\"GOS.cpp\"# implement operating system \n    dependent functions with a unified interface.  All these functions\n    are implemented as static member of class \\Ref{GOS}. \n    Functions are provided for testing the presence of a file or a directory\n    (\\Ref{GOS::is_file}, \\Ref{GOS::is_dir}), for manipulating file and directory names\n    (\\Ref{GOS::dirname}, \\Ref{GOS::basename}, \\Ref{GOS::expand_name},\n    for obtaining and changing the current directory (\\Ref{GOS::cwd}),\n    for converting between file names and urls (\\Ref{GOS::filename_to_url},\n    \\Ref{GOS::url_to_filename}), and for counting time (\\Ref{GOS::ticks},\n    \\Ref{GOS::sleep}).\n    \n    @memo\n    Operating System dependent functions.\n    @author\n    L\\'eon Bottou <leonb@research.att.com> -- Initial implementation\n*/\n//@{\n\n#include \"DjVuGlobal.h\"\n#include \"GString.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\nclass GURL;\n\n/** Operating System dependent functions. */\nclass DJVUAPI GOS \n{\n public:\n  // -----------------------------------------\n  // Functions for dealing with filenames\n  // -----------------------------------------\n\n  /** Returns the last component of file name #filename#.  If the filename\n      suffix matches argument #suffix#, the filename suffix is removed.  This\n      function works like the unix command #/bin/basename#, but also supports\n      the naming conventions of other operating systems. */\n  static GUTF8String basename(const GUTF8String &filename, const char *suffix=0);\n\n  /** Sets and returns the current working directory.\n      When argument #dirname# is specified, the current directory is changed\n      to #dirname#. This function always returns the fully qualified name\n      of the current directory. */\n  static GUTF8String cwd(const GUTF8String &dirname=GUTF8String());\n\n  // -----------------------------------------\n  // Functions for measuring time\n  // -----------------------------------------\n  \n  /** Returns a number of elapsed milliseconds.  This number counts elapsed\n      milliseconds since a operating system dependent date. This function is\n      useful for timing code. */\n  static unsigned long ticks();\n\n  /** Sleeps during the specified time expressed in milliseconds.\n      Other threads can run while the calling thread sleeps. */\n  static void sleep(int milliseconds);\n\n  /// Read the named variable from the environment, and converts it to UTF8.\n  static GUTF8String getenv(const GUTF8String &name);\n\n#if 0\n  // -------------------------------------------\n  // Functions for converting filenames and urls\n  // -------------------------------------------\n  /** Encodes all reserved characters, so that the #filename# can be\n      used inside a URL. Every reserved character is encoded using escape\n      sequence in the form of #%XX#. The legal characters are alphanumeric and\n      #$-_.+!*'(),:#.\n      Use \\Ref{decode_reserved}() to convert the URL back to the filename. */\n//  static GString encode_reserved(const char * filename);\n  static GString encode_mbcs_reserved(const char * filename);/*MBCS*/\n#endif\n\n};\n\n\n//@}\n// ------------\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/GPixmap.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n// -- Implements class PIXMAP\n// Author: Leon Bottou 07/1997\n\n\n\n#include \"GPixmap.h\"\n\n#include \"GString.h\"\n#include \"GException.h\"\n#include \"ByteStream.h\"\n#include \"GRect.h\"\n#include \"GBitmap.h\"\n#include \"GThreads.h\"\n#include \"Arrays.h\"\n#include \"JPEGDecoder.h\"\n\n#include <stddef.h>\n#include <stdlib.h>\n#include <math.h>\n#include <assert.h>\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n\n//////////////////////////////////////////////////\n// ------- predefined colors\n//////////////////////////////////////////////////\n\n\nconst GPixel GPixel::WHITE = { 255, 255, 255 };\nconst GPixel GPixel::BLACK = {   0,   0,   0 };\nconst GPixel GPixel::BLUE  = { 255,   0,   0 };\nconst GPixel GPixel::GREEN = {   0, 255,   0 };\nconst GPixel GPixel::RED   = {   0,   0, 255 };\n\n\n//////////////////////////////////////////////////\n// ----- utilities\n//////////////////////////////////////////////////\n\n\nstatic const GPixel *\nnew_gray_ramp(int grays,GPixel *ramp)\n{\n  int color = 0xff0000;\n  int decrement = color / (grays-1);\n  for (int i=0; i<grays; i++)\n    {\n      int level = color >> 16;\n      ramp[i].b = level;\n      ramp[i].g = level;\n      ramp[i].r = level;\n      color -= decrement;\n    }\n  return ramp;\n}\n\n\nstatic inline int\nmini(int x, int y) \n{ \n  return (x < y ? x : y);\n}\n\n\nstatic inline int\nmaxi(int x, int y) \n{ \n  return (x > y ? x : y);\n}\n\n\nstatic inline void \neuclidian_ratio(int a, int b, int &q, int &r)\n{\n  q = a / b;\n  r = a - b*q;\n  if (r < 0)\n  {\n    q -= 1;\n    r += b;\n  }\n}\n\n\n//////////////////////////////////////////////////\n// global lock used by some rare operations\n//////////////////////////////////////////////////\n\nstatic GMonitor &pixmap_monitor() {\n  static GMonitor xpixmap_monitor;\n  return xpixmap_monitor;\n}\n\n\n//////////////////////////////////////////////////\n// constructors and destructors\n//////////////////////////////////////////////////\n\n\nGPixmap::~GPixmap()\n{\n  delete [] pixels_data;\n}\n\nvoid\nGPixmap::destroy(void)\n{\n  delete [] pixels_data;\n  pixels = pixels_data = 0;\n}\n\nGPixmap::GPixmap()\n: nrows(0), ncolumns(0), pixels(0), pixels_data(0)\n{\n}\n\nGPixmap::GPixmap(int nrows, int ncolumns, const GPixel *filler)\n: nrows(0), ncolumns(0), pixels(0), pixels_data(0)\n{\n  G_TRY\n  {\n    init(nrows, ncolumns, filler);\n  }\n  G_CATCH_ALL\n  {\n\tdestroy();\n\tG_RETHROW;\n  }\n  G_ENDCATCH;\n}\n\nGPixmap::GPixmap(ByteStream &bs)\n: nrows(0), ncolumns(0), pixels(0), pixels_data(0)\n{\n  G_TRY\n  {\n\tinit(bs);\n  }\n  G_CATCH_ALL\n  {\n\tdestroy();\n\tG_RETHROW;\n  }\n  G_ENDCATCH;\n}\n\nGPixmap::GPixmap(const GBitmap &ref)\n: nrows(0), ncolumns(0), pixels(0), pixels_data(0)\n{\n  G_TRY\n  {\n\tinit(ref, 0);\n  }\n  G_CATCH_ALL\n  {\n\tdestroy();\n\tG_RETHROW;\n  }\n  G_ENDCATCH;\n}\n\nGPixmap::GPixmap(const GBitmap &ref, const GRect &rect)\n: nrows(0), ncolumns(0), pixels(0), pixels_data(0)\n{\n  G_TRY\n  {\n    init(ref, rect, 0);\n  }\n  G_CATCH_ALL\n  {\n\tdestroy();\n\tG_RETHROW;\n  }\n  G_ENDCATCH;\n}\n\nGPixmap::GPixmap(const GPixmap &ref)\n: nrows(0), ncolumns(0), pixels(0), pixels_data(0)\n{\n  G_TRY\n  {\n    init(ref);\n  }\n  G_CATCH_ALL\n  {\n\tdestroy();\n\tG_RETHROW;\n  }\n  G_ENDCATCH;\n}\n\nGPixmap::GPixmap(const GPixmap &ref, const GRect &rect)\n: nrows(0), ncolumns(0), pixels(0), pixels_data(0)\n{\n  G_TRY\n  {\n\tinit(ref, rect);\n  }\n  G_CATCH_ALL\n  {\n\tdestroy();\n\tG_RETHROW;\n  }\n  G_ENDCATCH;\n}\n\n\n\n//////////////////////////////////////////////////\n// Initialization\n//////////////////////////////////////////////////\n\n\nvoid \nGPixmap::init(int arows, int acolumns, const GPixel *filler)\n{\n  if (arows != (unsigned short) arows ||\n      acolumns != (unsigned short) acolumns )\n    G_THROW(\"Illegal arguments\");\n  destroy();\n  nrows = arows;\n  ncolumns = acolumns;\n  nrowsize = acolumns;\n  int npix = nrows * nrowsize;\n  if (npix > 0)\n  {\n    pixels = pixels_data = new GPixel[npix];\n    if (filler)\n    { \n      while (--npix>=0) \n        pixels_data[npix] = *filler;\n    }\n  }\n}\n\n\nvoid \nGPixmap::init(const GBitmap &ref, const GPixel *userramp)\n{\n  init(ref.rows(), ref.columns(), 0);\n  GPixel *xramp;\n  GPBuffer<GPixel> gxramp(xramp);\n  if (nrows>0 && ncolumns>0)\n  {\n    // Create pixel ramp\n    const GPixel *ramp = userramp;\n    if (!userramp)\n\t{\n          gxramp.resize(256);\n          gxramp.clear();\n\t  ramp = new_gray_ramp(ref.get_grays(),xramp);\n\t}\n    // Copy pixels\n    for (int y=0; y<nrows; y++)\n    {\n      GPixel *dst = (*this)[y];\n      const unsigned char *src = ref[y];\n      for (int x=0; x<ncolumns; x++)\n        dst[x] = ramp[ src[x] ];\n    }\n    // Free ramp\n//    if (!userramp)\n//      delete [] (GPixel*)ramp;\n  }\n}\n\n\nvoid \nGPixmap::init(const GBitmap &ref, const GRect &rect, const GPixel *userramp)\n{\n  init(rect.height(), rect.width(), 0);\n  // compute destination rectangle\n  GRect rect2(0, 0, ref.columns(), ref.rows() );\n  rect2.intersect(rect2, rect);\n  rect2.translate(-rect.xmin, -rect.ymin);\n  // copy bits\n  if (! rect2.isempty())\n  {\n    GPixel *xramp;\n    GPBuffer<GPixel> gxramp(xramp);\n    // allocate ramp\n    const GPixel *ramp = userramp;\n    if (!userramp)\n\t{\n\t  gxramp.resize(256);\n          gxramp.clear();\n          ramp = new_gray_ramp(ref.get_grays(),xramp);\n\t}\n    // copy pixels\n    for (int y=rect2.ymin; y<rect2.ymax; y++)\n    {\n      GPixel *dst = (*this)[y];\n      const unsigned char *src = ref[y+rect.ymin] + rect.xmin;\n      for (int x=rect2.xmin; x<rect2.xmax; x++)\n        dst[x] = ramp[ src[x] ];\n    }\n    // free ramp\n//    if (!userramp)\n//      delete [] (GPixel*) ramp;\n  }\n}\n\n\nvoid \nGPixmap::init(const GPixmap &ref)\n{\n  init(ref.rows(), ref.columns(), 0);\n  if (nrows>0 && ncolumns>0)\n  {\n    for (int y=0; y<nrows; y++)\n    {\n      GPixel *dst = (*this)[y];\n      const GPixel *src = ref[y];\n      for (int x=0; x<ncolumns; x++)\n        dst[x] = src[x];\n    }\n  }\n}\n\n\nvoid \nGPixmap::init(const GPixmap &ref, const GRect &rect)\n{\n  init(rect.height(), rect.width(), 0);\n  // compute destination rectangle\n  GRect rect2(0, 0, ref.columns(), ref.rows() );\n  rect2.intersect(rect2, rect);\n  rect2.translate(-rect.xmin, -rect.ymin);\n  // copy bits\n  if (! rect2.isempty())\n  {\n    for (int y=rect2.ymin; y<rect2.ymax; y++)\n    {\n      GPixel *dst = (*this)[y];\n      const GPixel *src = ref[y+rect.ymin] + rect.xmin;\n      for (int x=rect2.xmin; x<rect2.xmax; x++)\n        dst[x] = src[x];\n    }\n  }\n}\n\n\nvoid \nGPixmap::donate_data(GPixel *data, int w, int h)\n{\n  destroy();\n  nrows = h;\n  ncolumns = w;\n  nrowsize = w;\n  pixels_data=pixels=data;\n}\n\n\nGPixel *\nGPixmap::take_data(size_t &offset)\n{\n  GPixel *ret = pixels_data;\n  pixels_data = 0;\n  offset = 0;\n  return ret;\n}\n\n\n\n//////////////////////////////////////////////////\n// Save and load ppm files\n//////////////////////////////////////////////////\n\n\nstatic unsigned int \nread_integer(char &c, ByteStream &bs)\n{\n  unsigned int x = 0;\n  // eat blank before integer\n  while (c==' ' || c=='\\t' || c=='\\r' || c=='\\n' || c=='#') \n    {\n      if (c=='#') \n        do { } while (bs.read(&c,1) && c!='\\n' && c!='\\r');\n      c = 0; \n      bs.read(&c, 1);\n    }\n  // check integer\n  if (c<'0' || c>'9')\n    G_THROW( ERR_MSG(\"GPixmap.no_int\") );\n  // eat integer\n  while (c>='0' && c<='9') \n    {\n      x = x*10 + c - '0';\n      c = 0;\n      bs.read(&c, 1);\n    }\n  return x;\n}\n\n\nvoid \nGPixmap::init(ByteStream &bs)\n{\n  // Read header\n  bool raw = false;\n  bool grey = false;\n  int magic = bs.read16();\n  GP<GBitmap> bm;\n  switch (magic)\n    {\n    case ('P'<<8)+'2':\n      grey = true;\n      break;\n    case ('P'<<8)+'3':\n      break;\n    case ('P'<<8)+'5':\n      raw = grey = true;\n    case ('P'<<8)+'6':\n      raw = true;\n      break;\n    case ('P'<<8)+'1':\n    case ('P'<<8)+'4': \n      bs.seek(0L);\n      bm = GBitmap::create(bs); \n      init(*bm);\n      return;\n    default:\n#ifdef NEED_JPEG_DECODER\n      bs.seek(0L);\n      JPEGDecoder::decode(bs,*this);\n      return;\n#else\n      \n      G_THROW( ERR_MSG(\"GPixmap.unk_PPM\") );\n#endif\n    }\n  // Read image size\n  char lookahead = '\\n';\n  int bytesperrow = 0;\n  int bytespercomp = 1;\n  int acolumns = read_integer(lookahead, bs);\n  int arows = read_integer(lookahead, bs);\n  int maxval = read_integer(lookahead, bs);\n  if (maxval > 65535)\n    G_THROW(\"Cannot read PPM with depth greater than 48 bits.\");\n  if (maxval > 255)\n    bytespercomp = 2;\n  init(arows, acolumns, 0);\n  // Prepare ramp\n  GTArray<unsigned char> ramp;\n  int maxbin = 1 << (8 * bytespercomp);\n  ramp.resize(0, maxbin-1);\n  for (int i=0; i<maxbin; i++)\n    ramp[i] = (i<maxval ? (255*i + maxval/2) / maxval : 255);\n  unsigned char *bramp = ramp;\n  // Read image data\n  if (raw && grey)\n    {\n      bytesperrow = ncolumns * bytespercomp;\n      GTArray<unsigned char> line(bytesperrow);\n      for (int y=nrows-1; y>=0; y--) \n        {\n          GPixel *p = (*this)[y];\n          unsigned char *g = &line[0];\n          if ( bs.readall((void*)g, bytesperrow) < (size_t)bytesperrow)\n            G_THROW( ByteStream::EndOfFile );\n          if (bytespercomp <= 1)\n            {\n              for (int x=0; x<ncolumns; x+=1, g+=1)\n                p[x].r = p[x].g = p[x].b = bramp[g[0]];\n            }\n          else\n            {\n              for (int x=0; x<ncolumns; x+=1, g+=2)\n                p[x].r = p[x].g = p[x].b = bramp[g[0]*256+g[1]];\n            }\n        }\n    }\n  else if (raw)\n    {\n      bytesperrow = ncolumns * bytespercomp * 3;\n      GTArray<unsigned char> line(bytesperrow);\n      for (int y=nrows-1; y>=0; y--) \n        {\n          GPixel *p = (*this)[y];\n          unsigned char *rgb = &line[0];\n          if ( bs.readall((void*)rgb, bytesperrow) < (size_t)bytesperrow)\n            G_THROW( ByteStream::EndOfFile );\n          if (bytespercomp <= 1)\n            {\n              for (int x=0; x<ncolumns; x+=1, rgb+=3)\n                {\n                  p[x].r = bramp[rgb[0]];\n                  p[x].g = bramp[rgb[1]];\n                  p[x].b = bramp[rgb[2]];\n                }\n            }\n          else\n            for (int x=0; x<ncolumns; x+=1, rgb+=6)\n              {\n                p[x].r = bramp[rgb[0]*256+rgb[1]];\n                p[x].g = bramp[rgb[2]*256+rgb[3]];\n                p[x].b = bramp[rgb[4]*256+rgb[5]];\n              }\n        }\n    }\n  else\n    {\n      for (int y=nrows-1; y>=0; y--) \n        {\n          GPixel *p = (*this)[y];\n          for (int x=0; x<ncolumns; x++)\n            if (grey)\n              {\n                p[x].g = p[x].b = p[x].r = ramp[(int)read_integer(lookahead, bs)];\n              }\n            else\n              {\n                p[x].r = ramp[(int)read_integer(lookahead, bs)];\n                p[x].g = ramp[(int)read_integer(lookahead, bs)];\n                p[x].b = ramp[(int)read_integer(lookahead, bs)];\n              }\n        }\n    }\n}\n\n\nvoid \nGPixmap::save_ppm(ByteStream &bs, int raw) const\n{\n  GUTF8String head;\n  head.format(\"P%c\\n%d %d\\n255\\n\", (raw ? '6' : '3'), ncolumns, nrows);\n  bs.writall((void*)(const char *)head, head.length());\n  if (raw)\n    {\n      int rowsize = ncolumns+ncolumns+ncolumns;\n      GTArray<unsigned char> xrgb(rowsize);\n      for (int y=nrows-1; y>=0; y--) \n        {\n          const GPixel *p = (*this)[y];\n          unsigned char *d = xrgb;\n          for (int x=0; x<ncolumns; x++) \n            {\n              *d++ = p[x].r;\n              *d++ = p[x].g;\n              *d++ = p[x].b;\n            }\n          bs.writall((void*)(unsigned char*)xrgb, ncolumns * 3);\n        }\n    }\n  else\n    {\n      for (int y=nrows-1; y>=0; y--) \n        {\n          const GPixel *p = (*this)[y];\n          unsigned char eol='\\n';\n          for (int x=0; x<ncolumns; )\n            {\n              head.format(\"%d %d %d  \", p[x].r, p[x].g, p[x].b);\n              bs.writall((void*)(const char *)head, head.length());\n              x += 1;\n              if (x==ncolumns || (x&0x7)==0) \n                bs.write((void*)&eol, 1);          \n            }\n        }\n    }\n}\n\n\n\n\n//////////////////////////////////////////////////\n// Color correction\n//////////////////////////////////////////////////\n\n\nstatic void\ncolor_correction_table(double gamma, GPixel white,\n                       unsigned char gtable[256][3] )\n{\n  // Check argument\n  if (gamma<0.1 || gamma>10.0)\n    G_THROW( ERR_MSG(\"GPixmap.bad_param\") );\n  if (gamma<1.001 && gamma>0.999 && white==GPixel::WHITE)\n    {\n      // Trivial correction\n      for (int i=0; i<256; i++)\n        gtable[i][0] = gtable[i][1] = gtable[i][2] = i;\n    }\n  else\n    {\n      // Must compute the correction\n      for (int i=0; i<256; i++)\n        {\n          double x = (double)(i)/255.0;\n#ifdef BEZIERGAMMA\n          double t = ( sqrt(1.0+(gamma*gamma-1.0)*x) - 1.0 ) / (gamma - 1.0);\n          x = ( (1.0 - gamma)*t + 2.0 * gamma ) * t / (gamma + 1.0);\n#else\n          x = pow(x, 1.0/gamma);        \n#endif\n          gtable[i][0] = (int) floor(white.b * x + 0.5);\n          gtable[i][1] = (int) floor(white.g * x + 0.5);\n          gtable[i][2] = (int) floor(white.r * x + 0.5);\n        }\n      // Make sure that min and max values are exactly black or white\n      gtable[0][0] = 0;\n      gtable[0][1] = 0;\n      gtable[0][2] = 0;\n      gtable[255][0] = white.b;\n      gtable[255][1] = white.g;\n      gtable[255][2] = white.r;\n    }\n}\n\nstatic void\ncolor_correction_table_cache(double gamma, GPixel white,\n                             unsigned char gtable[256][3] )\n{\n  // Compute color correction table\n  if (gamma<1.001 && gamma>0.999 && white==GPixel::WHITE)\n    {\n      color_correction_table(gamma, white, gtable);\n    }\n  else\n    {\n      static double lgamma = -1.0;\n      static GPixel lwhite = GPixel::BLACK;\n      static unsigned char ctable[256][3];\n      GMonitorLock lock(&pixmap_monitor());\n      if (gamma != lgamma || white != lwhite)\n        {\n          color_correction_table(gamma, white, ctable);\n          lgamma = gamma;\n          lwhite = white;\n        }\n      memcpy(gtable, ctable, 256*3*sizeof(unsigned char));\n    }\n}\n\nvoid \nGPixmap::color_correct(double gamma_correction, GPixel white)\n{\n  // Trivial corrections\n  if (gamma_correction>0.999 && gamma_correction<1.001 && white==GPixel::WHITE)\n    return;\n  // Compute correction table\n  unsigned char gtable[256][3];\n  color_correction_table_cache(gamma_correction, white, gtable);\n  // Perform correction\n  for (int y=0; y<nrows; y++)\n  {\n    GPixel *pix = (*this)[y];\n    for (int x=0; x<ncolumns; x++, pix++)\n    {\n      pix->b = gtable[ pix->b ][0];\n      pix->g = gtable[ pix->g ][1];\n      pix->r = gtable[ pix->r ][2];\n    }\n  }\n}\n\nvoid \nGPixmap::color_correct(double gamma_correction)\n{\n  // Trivial corrections\n  if (gamma_correction<=0.999 || gamma_correction>=1.001)\n    color_correct(gamma_correction, GPixel::WHITE);\n}\n\n\nvoid \nGPixmap::color_correct(double gamma_correction, GPixel white,\n                       GPixel *pix, int npixels)\n{\n  // Trivial corrections\n  if (gamma_correction>0.999 && gamma_correction<1.001 && white==GPixel::WHITE)\n    return;\n  // Compute correction table\n  unsigned char gtable[256][3];\n  color_correction_table_cache(gamma_correction, white, gtable);\n  // Perform correction\n  while (--npixels>=0)\n    {\n      pix->b = gtable[pix->b][0];\n      pix->g = gtable[pix->g][1];\n      pix->r = gtable[pix->r][2];\n      pix++;\n    }\n}\n\n\nvoid \nGPixmap::color_correct(double gamma_correction, GPixel *pix, int npixels)\n{\n  // Trivial corrections\n  if (gamma_correction<=0.999 || gamma_correction>=1.001)\n    color_correct(gamma_correction,GPixel::WHITE,pix,npixels);\n}\n\n\n//////////////////////////////////////////////////\n// Dithering\n//////////////////////////////////////////////////\n\n\nvoid\nGPixmap::ordered_666_dither(int xmin, int ymin)\n{\n  static unsigned char quantize[256+0x33+0x33];\n  static unsigned char *quant = quantize + 0x33;\n  static char  dither_ok = 0;\n  static short dither[16][16] = \n  {\n    {   0,192, 48,240, 12,204, 60,252,  3,195, 51,243, 15,207, 63,255 },\n    { 128, 64,176,112,140, 76,188,124,131, 67,179,115,143, 79,191,127 },\n    {  32,224, 16,208, 44,236, 28,220, 35,227, 19,211, 47,239, 31,223 },\n    { 160, 96,144, 80,172,108,156, 92,163, 99,147, 83,175,111,159, 95 },\n    {   8,200, 56,248,  4,196, 52,244, 11,203, 59,251,  7,199, 55,247 },\n    { 136, 72,184,120,132, 68,180,116,139, 75,187,123,135, 71,183,119 },\n    {  40,232, 24,216, 36,228, 20,212, 43,235, 27,219, 39,231, 23,215 },\n    { 168,104,152, 88,164,100,148, 84,171,107,155, 91,167,103,151, 87 },\n    {   2,194, 50,242, 14,206, 62,254,  1,193, 49,241, 13,205, 61,253 },\n    { 130, 66,178,114,142, 78,190,126,129, 65,177,113,141, 77,189,125 },\n    {  34,226, 18,210, 46,238, 30,222, 33,225, 17,209, 45,237, 29,221 },\n    { 162, 98,146, 82,174,110,158, 94,161, 97,145, 81,173,109,157, 93 },\n    {  10,202, 58,250,  6,198, 54,246,  9,201, 57,249,  5,197, 53,245 },\n    { 138, 74,186,122,134, 70,182,118,137, 73,185,121,133, 69,181,117 },\n    {  42,234, 26,218, 38,230, 22,214, 41,233, 25,217, 37,229, 21,213 },\n    { 170,106,154, 90,166,102,150, 86,169,105,153, 89,165,101,149, 85 }\n  };\n  // Prepare tables\n  if (!dither_ok)\n  {\n    int i, j;\n    for (i=0; i<16; i++)\n      for (j=0; j<16; j++)\n        dither[i][j] = ((255 - 2*dither[i][j]) * 0x33) / 512;    \n    j = -0x33;\n    for (i=0x19; i<256; i+=0x33)\n      while (j <= i)\n        quant[j++] = i-0x19;\n    assert(i-0x19 == 0xff);\n    while (j< 256+0x33)\n      quant[j++] = i-0x19;\n    dither_ok = 1;\n  }\n  // Go dithering\n  for (int y=0; y<nrows; y++)\n  {\n    GPixel *pix = (*this)[y];\n    for (int x=0; x<ncolumns; x++, pix++)\n    {\n      pix->r = quant[ pix->r + dither[(x+xmin+0)&0xf][(y+ymin+0)&0xf] ];\n      pix->g = quant[ pix->g + dither[(x+xmin+5)&0xf][(y+ymin+11)&0xf] ];\n      pix->b = quant[ pix->b + dither[(x+xmin+11)&0xf][(y+ymin+5)&0xf] ];\n    }\n  }\n}\n\nvoid\nGPixmap::ordered_32k_dither(int xmin, int ymin)\n{\n  static unsigned char quantize[256+8+8];\n  static unsigned char *quant = quantize + 8;\n  static char  dither_ok = 0;\n  static short dither[16][16] = \n  {\n    {   0,192, 48,240, 12,204, 60,252,  3,195, 51,243, 15,207, 63,255 },\n    { 128, 64,176,112,140, 76,188,124,131, 67,179,115,143, 79,191,127 },\n    {  32,224, 16,208, 44,236, 28,220, 35,227, 19,211, 47,239, 31,223 },\n    { 160, 96,144, 80,172,108,156, 92,163, 99,147, 83,175,111,159, 95 },\n    {   8,200, 56,248,  4,196, 52,244, 11,203, 59,251,  7,199, 55,247 },\n    { 136, 72,184,120,132, 68,180,116,139, 75,187,123,135, 71,183,119 },\n    {  40,232, 24,216, 36,228, 20,212, 43,235, 27,219, 39,231, 23,215 },\n    { 168,104,152, 88,164,100,148, 84,171,107,155, 91,167,103,151, 87 },\n    {   2,194, 50,242, 14,206, 62,254,  1,193, 49,241, 13,205, 61,253 },\n    { 130, 66,178,114,142, 78,190,126,129, 65,177,113,141, 77,189,125 },\n    {  34,226, 18,210, 46,238, 30,222, 33,225, 17,209, 45,237, 29,221 },\n    { 162, 98,146, 82,174,110,158, 94,161, 97,145, 81,173,109,157, 93 },\n    {  10,202, 58,250,  6,198, 54,246,  9,201, 57,249,  5,197, 53,245 },\n    { 138, 74,186,122,134, 70,182,118,137, 73,185,121,133, 69,181,117 },\n    {  42,234, 26,218, 38,230, 22,214, 41,233, 25,217, 37,229, 21,213 },\n    { 170,106,154, 90,166,102,150, 86,169,105,153, 89,165,101,149, 85 }\n  };\n  // Prepare tables\n  if (!dither_ok)\n  {\n    int i, j;\n    for (i=0; i<16; i++)\n      for (j=0; j<16; j++)\n        dither[i][j] = ((255 - 2*dither[i][j]) * 8) / 512;    \n    j = -8;\n    for (i=3; i<256; i+=8)\n      while (j <= i)\n        quant[j++] = i;\n    while (j<256+8)\n      quant[j++] = 0xff;\n    dither_ok = 1;\n  }\n  // Go dithering\n  for (int y=0; y<nrows; y++)\n  {\n    GPixel *pix = (*this)[y];\n    for (int x=0; x<ncolumns; x++, pix++)\n    {\n      pix->r = quant[ pix->r + dither[(x+xmin+0)&0xf][(y+ymin+0)&0xf] ];\n      pix->g = quant[ pix->g + dither[(x+xmin+5)&0xf][(y+ymin+11)&0xf] ];\n      pix->b = quant[ pix->b + dither[(x+xmin+11)&0xf][(y+ymin+5)&0xf] ];\n    }\n  }\n}\n\n\n//////////////////////////////////////////////////\n// Upsample Downsample\n//////////////////////////////////////////////////\n\n\nvoid  \nGPixmap::downsample(const GPixmap *src, int factor, const GRect *pdr)\n{\n  // check arguments\n  GRect rect(0, 0, (src->columns()+factor-1)/factor, (src->rows()+factor-1)/factor);\n  if (pdr != 0)\n  {\n    if (pdr->xmin < rect.xmin || \n        pdr->ymin < rect.ymin || \n        pdr->xmax > rect.xmax || \n        pdr->ymax > rect.ymax  )\n      G_THROW( ERR_MSG(\"GPixmap.overflow1\") );\n    rect = *pdr;\n  }\n\n  // precompute inverse map\n  static int invmap[256];\n  static int invmapok = 0;\n  if (! invmapok)\n  {\n    invmapok = 1;\n    for (int i=1; i<(int)(sizeof(invmap)/sizeof(int)); i++)\n      invmap[i] = 0x10000 / i;\n  }\n  \n  // initialise pixmap\n  init(rect.height(), rect.width(), 0);\n\n  // determine starting and ending points in source rectangle\n  int sy = rect.ymin * factor;\n  int sxz = rect.xmin * factor;\n\n\n  // loop over source rows\n  const GPixel *sptr = (*src)[sy];\n  GPixel *dptr = (*this)[0];\n  for (int y=0; y<nrows; y++)\n  {\n    int sx = sxz;\n    // loop over source columns\n    for (int x=0; x<ncolumns; x++)\n    {\n      int r=0, g=0, b=0, s=0;\n      // compute average bounds\n      const GPixel *ksptr = sptr;\n      int lsy = sy + factor;\n      if (lsy > (int)src->rows())\n        lsy = (int)src->rows();\n      int lsx = sx + factor;\n      if (lsx > (int)src->columns())\n        lsx = (int)src->columns();\n      // compute average\n      for (int rsy=sy; rsy<lsy; rsy++)\n      {\n        for (int rsx = sx; rsx<lsx; rsx++)\n        {\n          r += ksptr[rsx].r;\n          g += ksptr[rsx].g;\n          b += ksptr[rsx].b;\n          s += 1;\n        }\n        ksptr += src->rowsize();\n      }\n      // set pixel color\n      if (s >= (int)(sizeof(invmap)/sizeof(int)))\n      {\n        dptr[x].r = r / s;\n        dptr[x].g = g / s;\n        dptr[x].b = b / s;\n      }\n      else\n      {\n        dptr[x].r = (r*invmap[s] + 0x8000) >> 16;\n        dptr[x].g = (g*invmap[s] + 0x8000) >> 16;\n        dptr[x].b = (b*invmap[s] + 0x8000) >> 16;\n      }\n      // next column\n      sx = sx + factor;\n    }\n    // next row\n    sy = sy + factor;\n    sptr = sptr + factor * src->rowsize();\n    dptr = dptr + rowsize();\n  }\n}\n\nvoid  \nGPixmap::upsample(const GPixmap *src, int factor, const GRect *pdr)\n{\n  // check arguments\n  GRect rect(0, 0, src->columns()*factor, src->rows()*factor);\n  if (pdr != 0)\n  {\n    if (pdr->xmin < rect.xmin || \n        pdr->ymin < rect.ymin || \n        pdr->xmax > rect.xmax || \n        pdr->ymax > rect.ymax  )\n      G_THROW( ERR_MSG(\"GPixmap.overflow2\") );\n    rect = *pdr;\n  }\n  // initialise pixmap\n  init(rect.height(), rect.width(), 0);\n  // compute starting point in source rectangle\n  int sy, sy1, sxz, sx1z;\n  euclidian_ratio(rect.ymin, factor, sy, sy1);\n  euclidian_ratio(rect.xmin, factor, sxz, sx1z);\n  // loop over rows\n  const GPixel *sptr = (*src)[sy];\n  GPixel *dptr = (*this)[0];\n  for (int y=0; y<nrows; y++)\n  {\n    // loop over columns\n    int sx = sxz;\n    int sx1 = sx1z;\n    for (int x=0; x<ncolumns; x++)\n    {\n      dptr[x] = sptr[sx];\n      // next column\n      if (++sx1 >= factor)\n      {\n        sx1 = 0;\n        sx += 1;\n      }\n    }\n    // next row\n    dptr += rowsize();\n    if (++sy1 >= factor)\n    {\n      sy1 = 0;\n      sptr += src->rowsize();\n    }\n  }\n}\n\n\nstatic inline void\ndownsample_4x4_to_3x3 (const GPixel *s, int sadd, GPixel *d, int dadd)\n{\n  const GPixel *x = s;\n  const GPixel *y = x + sadd;\n  d[0].b = ( 11*x[0].b + 2*(x[1].b + y[0].b ) + y[1].b  + 8) >> 4;\n  d[0].g = ( 11*x[0].g + 2*(x[1].g + y[0].g ) + y[1].g  + 8) >> 4;\n  d[0].r = ( 11*x[0].r + 2*(x[1].r + y[0].r ) + y[1].r  + 8) >> 4;\n  d[1].b = ( 7*(x[1].b + x[2].b) + y[1].b + y[2].b + 8 )     >> 4;\n  d[1].g = ( 7*(x[1].g + x[2].g) + y[1].g + y[2].g + 8 )     >> 4;\n  d[1].r = ( 7*(x[1].r + x[2].r) + y[1].r + y[2].r + 8 )     >> 4;\n  d[2].b = ( 11*x[3].b + 2*(x[2].b + y[3].b ) + y[2].b  + 8) >> 4;\n  d[2].g = ( 11*x[3].g + 2*(x[2].g + y[3].g ) + y[2].g  + 8) >> 4;\n  d[2].r = ( 11*x[3].r + 2*(x[2].r + y[3].r ) + y[2].r  + 8) >> 4;\n  d = d + dadd;\n  x = x + sadd + sadd;\n  d[0].b = ( 7*(x[0].b + y[0].b) + x[1].b + y[1].b + 8 )     >> 4;\n  d[0].g = ( 7*(x[0].g + y[0].g) + x[1].g + y[1].g + 8 )     >> 4;\n  d[0].r = ( 7*(x[0].r + y[0].r) + x[1].r + y[1].r + 8 )     >> 4;\n  d[1].b = ( x[2].b + y[2].b + x[1].b + y[1].b + 2 )         >> 2;\n  d[1].g = ( x[2].g + y[2].g + x[1].g + y[1].g + 2 )         >> 2;\n  d[1].r = ( x[2].r + y[2].r + x[1].r + y[1].r + 2 )         >> 2;\n  d[2].b = ( 7*(x[3].b + y[3].b) + x[2].b + y[2].b + 8 )     >> 4;\n  d[2].g = ( 7*(x[3].g + y[3].g) + x[2].g + y[2].g + 8 )     >> 4;\n  d[2].r = ( 7*(x[3].r + y[3].r) + x[2].r + y[2].r + 8 )     >> 4;\n  d = d + dadd;\n  y = y + sadd + sadd;\n  d[0].b = ( 11*y[0].b + 2*(y[1].b + x[0].b ) + x[1].b  + 8) >> 4;\n  d[0].g = ( 11*y[0].g + 2*(y[1].g + x[0].g ) + x[1].g  + 8) >> 4;\n  d[0].r = ( 11*y[0].r + 2*(y[1].r + x[0].r ) + x[1].r  + 8) >> 4;\n  d[1].b = ( 7*(y[1].b + y[2].b) + x[1].b + x[2].b + 8 )     >> 4;\n  d[1].g = ( 7*(y[1].g + y[2].g) + x[1].g + x[2].g + 8 )     >> 4;\n  d[1].r = ( 7*(y[1].r + y[2].r) + x[1].r + x[2].r + 8 )     >> 4;\n  d[2].b = ( 11*y[3].b + 2*(y[2].b + x[3].b ) + x[2].b  + 8) >> 4;\n  d[2].g = ( 11*y[3].g + 2*(y[2].g + x[3].g ) + x[2].g  + 8) >> 4;\n  d[2].r = ( 11*y[3].r + 2*(y[2].r + x[3].r ) + x[2].r  + 8) >> 4;\n}\n\n\nstatic inline void\nupsample_2x2_to_3x3 (const GPixel *s, int sadd, GPixel *d, int dadd)\n{\n  const GPixel *x = s;\n  const GPixel *y = x + sadd;\n  d[0] = x[0];\n  d[1].b = (x[0].b + x[1].b + 1) >> 1;\n  d[1].g = (x[0].g + x[1].g + 1) >> 1;\n  d[1].r = (x[0].r + x[1].r + 1) >> 1;\n  d[2] = x[1];\n  d = d + dadd;\n  d[0].b = (x[0].b + y[0].b + 1) >> 1;\n  d[0].g = (x[0].g + y[0].g + 1) >> 1;\n  d[0].r = (x[0].r + y[0].r + 1) >> 1;\n  d[1].b = (x[0].b + y[0].b + x[1].b + y[1].b + 2) >> 2;\n  d[1].g = (x[0].g + y[0].g + x[1].g + y[1].g + 2) >> 2;\n  d[1].r = (x[0].r + y[0].r + x[1].r + y[1].r + 2) >> 2;\n  d[2].b = (x[1].b + y[1].b + 1) >> 1;\n  d[2].g = (x[1].g + y[1].g + 1) >> 1;\n  d[2].r = (x[1].r + y[1].r + 1) >> 1;\n  d = d + dadd;\n  d[0] = y[0];\n  d[1].b = (y[0].b + y[1].b + 1) >> 1;\n  d[1].g = (y[0].g + y[1].g + 1) >> 1;\n  d[1].r = (y[0].r + y[1].r + 1) >> 1;\n  d[2] = y[1];\n}\n\n\nstatic inline void\ncopy_to_partial(int w, int h,\n                const GPixel *s, int sadd,\n                GPixel *d, int dadd, int xmin, int xmax, int ymin, int ymax)\n{\n  int y = 0;\n  while (y<ymin  && y<h)\n    {\n      y += 1;\n      s += sadd;\n      d += dadd;\n    }\n  while (y<ymax && y<h)\n    {\n      int x = (xmin>0 ? xmin : 0);\n      while (x<w && x<xmax)\n        {\n          d[x] = s[x];\n          x++;\n        }\n      y += 1;\n      s += sadd;\n      d += dadd;\n    }\n}\n\n\nstatic inline void\ncopy_line(const GPixel *s, int smin, int smax,\n          GPixel *d, int dmin, int dmax)\n{\n  int x = dmin;\n  while (x < smin) \n  { \n    d[x] = s[smin]; \n    x++; \n  }\n  while (x < dmax && x < smax)  \n  { \n    d[x] = s[x]; \n    x++; \n  }\n  while (x < dmax)              \n  {\n    d[x] = s[smax-1]; \n    x++; \n  }\n}\n\n\nstatic inline void\ncopy_from_partial(int w, int h,\n                  const GPixel *s, int sadd, int xmin, int xmax, int ymin, int ymax,\n                  GPixel *d, int dadd)\n{\n  int y = 0;\n  s += (ymin>0 ? sadd * ymin : 0);\n  while (y<ymin  && y<h)\n    {\n      copy_line(s, xmin, xmax, d, 0, w);\n      y += 1;\n      d += dadd;\n    }\n  while (y<ymax && y<h)\n    {\n      copy_line(s, xmin, xmax, d, 0, w);\n      y += 1;\n      s += sadd;\n      d += dadd;\n    }\n  s -= sadd;\n  while (y < h)\n    {\n      copy_line(s, xmin, xmax, d, 0, w);\n      y += 1;\n      d += dadd;\n    }\n}\n\n\n\n\n\nvoid  \nGPixmap::downsample43(const GPixmap *src, const GRect *pdr)\n{\n  // check arguments\n  int srcwidth = src->columns();\n  int srcheight = src->rows();\n  int destwidth = (srcwidth * 3 + 3 ) / 4;\n  int destheight = (srcheight * 3 + 3) / 4;\n  GRect rect(0, 0, destwidth, destheight);\n  if (pdr != 0)\n  {\n    if (pdr->xmin < rect.xmin || \n        pdr->ymin < rect.ymin || \n        pdr->xmax > rect.xmax || \n        pdr->ymax > rect.ymax  )\n      G_THROW( ERR_MSG(\"GPixmap.overflow3\") );\n    rect = *pdr;\n    destwidth = rect.width();\n    destheight = rect.height();\n  }\n  // initialize pixmap\n  init(destheight, destwidth, 0);\n\n  // compute bounds\n  int dxz, dy;   // location of bottomleft block in destination image\n  int sxz, sy;   // location of bottomleft block in source image\n  euclidian_ratio(rect.ymin, 3, sy, dy);\n  euclidian_ratio(rect.xmin, 3, sxz, dxz);\n  sxz = 4 * sxz;   \n  sy  = 4 * sy;\n  dxz = - dxz;\n  dy  = - dy;\n\n  // prepare variables\n  int sadd = src->rowsize();\n  int dadd = this->rowsize();\n  const GPixel *sptr = (*src)[0]  + sy * sadd;\n  GPixel *dptr = (*this)[0] + dy * dadd;\n  int s4add = 4 * sadd;\n  int d3add = 3 * dadd;\n\n  // iterate over row blocks\n  while (dy < destheight)\n  {\n    int sx = sxz;\n    int dx = dxz;\n    // iterate over column blocks\n    while (dx < destwidth)\n    {\n      GPixel xin[16], xout[9];\n\n      if (dx>=0 && dy>=0 && dx+3<=destwidth && dy+3<=destheight)\n        {\n          if (sx+4<=srcwidth && sy+4<=srcheight)\n            {\n              downsample_4x4_to_3x3(sptr+sx, sadd, dptr+dx, dadd);\n            }\n          else\n            {\n              copy_from_partial(4,4, sptr+sx,sadd,-sx,srcwidth-sx,-sy,srcheight-sy, xin,4);\n              downsample_4x4_to_3x3(xin, 4, dptr+dx, dadd);\n            }\n        }\n      else\n        {\n          if (sx+4<=srcwidth && sy+4<=srcheight)\n            {\n              downsample_4x4_to_3x3(sptr+sx, sadd, xout, 3);  \n              copy_to_partial(3,3, xout, 3, dptr+dx, dadd,-dx,destwidth-dx,-dy,destheight-dy);\n            }\n          else\n            {\n              copy_from_partial(4,4, sptr+sx,sadd,-sx,srcwidth-sx,-sy,srcheight-sy, xin,4);\n              downsample_4x4_to_3x3(xin, 4, xout, 3);  \n              copy_to_partial(3,3, xout,3, dptr+dx,dadd,-dx,destwidth-dx,-dy,destheight-dy);\n            }\n        }\n      // next column\n      dx += 3;\n      sx += 4;\n    }\n    // next row\n    dy += 3;\n    dptr += d3add;\n    sy += 4;\n    sptr += s4add;\n  }\n}\n\n\nvoid  \nGPixmap::upsample23(const GPixmap *src, const GRect *pdr)\n{\n  // check arguments\n  int srcwidth = src->columns();\n  int srcheight = src->rows();\n  int destwidth = (srcwidth * 3 + 1 ) / 2;\n  int destheight = (srcheight * 3 + 1) / 2;\n  GRect rect(0, 0, destwidth, destheight);\n  if (pdr != 0)\n  {\n    if (pdr->xmin < rect.xmin || \n        pdr->ymin < rect.ymin || \n        pdr->xmax > rect.xmax || \n        pdr->ymax > rect.ymax  )\n      G_THROW( ERR_MSG(\"GPixmap.overflow4\") );\n    rect = *pdr;\n    destwidth = rect.width();\n    destheight = rect.height();\n  }\n  // initialize pixmap\n  init(destheight, destwidth, 0);\n\n  // compute bounds\n  int dxz, dy;   // location of bottomleft block in destination image\n  int sxz, sy;   // location of bottomleft block in source image\n  euclidian_ratio(rect.ymin, 3, sy, dy);\n  euclidian_ratio(rect.xmin, 3, sxz, dxz);\n  sxz = 2 * sxz;   \n  sy  = 2 * sy;\n  dxz = - dxz;\n  dy  = - dy;\n\n  // prepare variables\n  int sadd = src->rowsize();\n  int dadd = this->rowsize();\n  const GPixel *sptr = (*src)[0]  + sy * sadd;\n  GPixel *dptr = (*this)[0] + dy * dadd;\n  int s2add = 2 * sadd;\n  int d3add = 3 * dadd;\n\n  // iterate over row blocks\n  while (dy < destheight)\n  {\n    int sx = sxz;\n    int dx = dxz;\n    // iterate over column blocks\n    while (dx < destwidth)\n    {\n      GPixel xin[4], xout[9];\n\n      if (dx>=0 && dy>=0 && dx+3<=destwidth && dy+3<=destheight)\n      {\n        if (sx+2<=srcwidth && sy+2<=srcheight)\n        {\n          upsample_2x2_to_3x3( sptr+sx, sadd, dptr+dx, dadd);\n        }\n        else\n        {\n          copy_from_partial(2, 2, sptr+sx, sadd, -sx, srcwidth-sx, -sy, srcheight-sy, xin, 2);\n          upsample_2x2_to_3x3(xin, 2, dptr+dx, dadd);\n        }\n      }\n      else\n      {\n        if (sx+2<=srcwidth && sy+2<=srcheight)\n        {\n          upsample_2x2_to_3x3( sptr+sx, sadd, xout, 3);  \n          copy_to_partial(3,3, xout, 3, dptr+dx, dadd, -dx, destwidth-dx, -dy, destheight-dy);\n        }\n        else\n        {\n          copy_from_partial(2, 2, sptr+sx, sadd, -sx, srcwidth-sx, -sy, srcheight-sy, xin, 2);\n          upsample_2x2_to_3x3(xin, 2, xout, 3);  \n          copy_to_partial(3,3, xout, 3, dptr+dx, dadd, -dx, destwidth-dx, -dy, destheight-dy);\n        }\n      }\n      // next column\n      dx += 3;\n      sx += 2;\n    }\n    // next row\n    dy += 3;\n    dptr += d3add;\n    sy += 2;\n    sptr += s2add;\n  }\n}\n\n\n//////////////////////////////////////////////////\n// Blitting and attenuating\n//////////////////////////////////////////////////\n\n\nstatic unsigned char clip[512];\nstatic bool clipok = false;\n\nstatic void\ncompute_clip()\n{\n  clipok = true;\n  for (unsigned int i=0; i<sizeof(clip); i++)\n    clip[i] = (i<256 ? i : 255);\n}\n\n\nvoid \nGPixmap::attenuate(const GBitmap *bm, int xpos, int ypos)\n{\n  // Check\n  if (!bm) G_THROW( ERR_MSG(\"GPixmap.null_alpha\") );\n  // Compute number of rows and columns\n  int xrows = mini(ypos + (int)bm->rows(), nrows) - maxi(0, ypos),\n    xcolumns = mini(xpos + (int) bm->columns(), ncolumns) - maxi(0, xpos);\n  if(xrows <= 0 || xcolumns <= 0)\n    return;\n  // Precompute multiplier map\n  unsigned int multiplier[256];\n  unsigned int maxgray = bm->get_grays() - 1;\n  for (unsigned int i=0; i<maxgray ; i++)\n    multiplier[i] = 0x10000 * i / maxgray;\n  // Compute starting point\n  const unsigned char *src = (*bm)[0] - mini(0,ypos)*bm->rowsize()-mini(0,xpos);\n  GPixel *dst = (*this)[0] + maxi(0, ypos)*rowsize()+maxi(0, xpos);\n  // Loop over rows\n  for (int y=0; y<xrows; y++)\n    {\n      // Loop over columns\n      for (int x=0; x<xcolumns; x++)\n        {\n          unsigned char srcpix = src[x];\n          // Perform pixel operation\n          if (srcpix > 0)\n            {\n              if (srcpix >= maxgray)\n                {\n                  dst[x].b = 0;\n                  dst[x].g = 0;\n                  dst[x].r = 0;\n                }\n              else\n                {\n                  unsigned int level = multiplier[srcpix];\n                  dst[x].b -=  (dst[x].b * level) >> 16;\n                  dst[x].g -=  (dst[x].g * level) >> 16;\n                  dst[x].r -=  (dst[x].r * level) >> 16;\n                }\n            }\n        }\n      // Next line\n      dst += rowsize();\n      src += bm->rowsize();\n    }\n}\n\n\nvoid \nGPixmap::blit(const GBitmap *bm, int xpos, int ypos, const GPixel *color)\n{\n  // Check\n  if (!bm) G_THROW( ERR_MSG(\"GPixmap.null_alpha\") );\n  if (!clipok) compute_clip();\n  if (!color) return;\n  // Compute number of rows and columns\n  int xrows = mini(ypos + (int)bm->rows(), nrows) - maxi(0, ypos),\n    xcolumns = mini(xpos + (int) bm->columns(), ncolumns) - maxi(0, xpos);\n  if(xrows <= 0 || xcolumns <= 0)\n    return;\n  // Precompute multiplier map\n  unsigned int multiplier[256];\n  unsigned int maxgray = bm->get_grays() - 1;\n  for (unsigned int i=1; i<maxgray ; i++)\n    multiplier[i] = 0x10000 * i / maxgray;\n  // Cache target color\n  unsigned char gr = color->r;\n  unsigned char gg = color->g;\n  unsigned char gb = color->b;\n  // Compute starting point\n  const unsigned char *src = (*bm)[0] - mini(0,ypos)*bm->rowsize()-mini(0,xpos);\n  GPixel *dst = (*this)[0] + maxi(0, ypos)*rowsize()+maxi(0, xpos);\n  // Loop over rows\n  for (int y=0; y<xrows; y++)\n    {\n      // Loop over columns\n      for (int x=0; x<xcolumns; x++)\n        {\n          unsigned char srcpix = src[x];\n          // Perform pixel operation\n          if (srcpix > 0)\n            {\n              if (srcpix >= maxgray)\n                {\n                  dst[x].b = clip[dst[x].b + gb];\n                  dst[x].g = clip[dst[x].g + gg];\n                  dst[x].r = clip[dst[x].r + gr];\n                }\n              else\n                {\n                  unsigned int level = multiplier[srcpix];\n                  dst[x].b = clip[dst[x].b + ((gb * level) >> 16)];\n                  dst[x].g = clip[dst[x].g + ((gg * level) >> 16)];\n                  dst[x].r = clip[dst[x].r + ((gr * level) >> 16)];\n                }\n            }\n        }\n      // Next line\n      dst += rowsize();\n      src += bm->rowsize();\n    }\n}\n\n\nvoid \nGPixmap::blit(const GBitmap *bm, int xpos, int ypos, const GPixmap *color)\n{\n  // Check\n  if (!bm) G_THROW( ERR_MSG(\"GPixmap.null_alpha\") );\n  if (!color) G_THROW( ERR_MSG(\"GPixmap.null_color\") );\n  if (!clipok) compute_clip();\n  if (bm->rows()!=color->rows() || bm->columns()!=color->columns())\n    G_THROW( ERR_MSG(\"GPixmap.diff_size\") );\n  // Compute number of rows and columns\n  int xrows = mini(ypos + (int)bm->rows(), nrows) - maxi(0, ypos),\n      xcolumns = mini(xpos + (int) bm->columns(), ncolumns) - maxi(0, xpos);\n  if(xrows <= 0 || xcolumns <= 0)\n    return;\n  // Precompute multiplier map\n  unsigned int multiplier[256];\n  unsigned int maxgray = bm->get_grays() - 1;\n  for (unsigned int i=1; i<maxgray ; i++)\n    multiplier[i] = 0x10000 * i / maxgray;\n  // Cache target color\n  // Compute starting point\n  const unsigned char *src = (*bm)[0] - mini(0,ypos)*bm->rowsize()-mini(0,xpos);\n  const GPixel *src2 = (*color)[0] + maxi(0, ypos)*color->rowsize()+maxi(0, xpos);\n  GPixel *dst = (*this)[0] + maxi(0, ypos)*rowsize()+maxi(0, xpos);\n  // Loop over rows\n  for (int y=0; y<xrows; y++)\n    {\n      // Loop over columns\n      for (int x=0; x<xcolumns; x++)\n        {\n          unsigned char srcpix = src[x];\n          // Perform pixel operation\n          if (srcpix > 0)\n            {\n              if (srcpix >= maxgray)\n                {\n                  dst[x].b = clip[dst[x].b + src2[x].b];\n                  dst[x].g = clip[dst[x].g + src2[x].g];\n                  dst[x].r = clip[dst[x].r + src2[x].r];\n                }\n              else\n                {\n                  unsigned int level = multiplier[srcpix];\n                  dst[x].b = clip[dst[x].b + ((src2[x].b * level) >> 16)];\n                  dst[x].g = clip[dst[x].g + ((src2[x].g * level) >> 16)];\n                  dst[x].r = clip[dst[x].r + ((src2[x].r * level) >> 16)];\n                }\n            }\n        }\n      // Next line\n      dst += rowsize();\n      src += bm->rowsize();\n      src2 += color->rowsize();\n    }\n}\n\n\n\nvoid \nGPixmap::blend(const GBitmap *bm, int xpos, int ypos, const GPixmap *color)\n{\n  // Check\n  if (!bm) G_THROW( ERR_MSG(\"GPixmap.null_alpha\") );\n  if (!color) G_THROW( ERR_MSG(\"GPixmap.null_color\") );\n  if (!clipok) compute_clip();\n  if (bm->rows()!=color->rows() || bm->columns()!=color->columns())\n    G_THROW( ERR_MSG(\"GPixmap.diff_size\") );\n  // Compute number of rows and columns\n  int xrows = mini(ypos + (int)bm->rows(), nrows) - maxi(0, ypos),\n      xcolumns = mini(xpos + (int) bm->columns(), ncolumns) - maxi(0, xpos);\n  if(xrows <= 0 || xcolumns <= 0)\n    return;\n  // Precompute multiplier map\n  unsigned int multiplier[256];\n  unsigned int maxgray = bm->get_grays() - 1;\n  for (unsigned int i=1; i<maxgray ; i++)\n    multiplier[i] = 0x10000 * i / maxgray;\n  // Cache target color\n  // Compute starting point\n  const unsigned char *src = (*bm)[0] - mini(0,ypos)*bm->rowsize()-mini(0,xpos);\n  const GPixel *src2 = (*color)[0] + maxi(0, ypos)*color->rowsize()+maxi(0, xpos);\n  GPixel *dst = (*this)[0] + maxi(0, ypos)*rowsize()+maxi(0, xpos);\n  // Loop over rows\n  for (int y=0; y<xrows; y++)\n    {\n      // Loop over columns\n      for (int x=0; x<xcolumns; x++)\n        {\n          unsigned char srcpix = src[x];\n          // Perform pixel operation\n          if (srcpix > 0)\n            {\n              if (srcpix >= maxgray)\n                {\n                  dst[x].b = src2[x].b;\n                  dst[x].g = src2[x].g;\n                  dst[x].r = src2[x].r;\n                }\n              else\n                {\n                  unsigned int level = multiplier[srcpix];\n                  dst[x].b -= (((int)dst[x].b - (int)src2[x].b) * level) >> 16;\n                  dst[x].g -= (((int)dst[x].g - (int)src2[x].g) * level) >> 16;\n                  dst[x].r -= (((int)dst[x].r - (int)src2[x].r) * level) >> 16;\n                }\n            }\n        }\n      // Next line\n      dst += rowsize();\n      src += bm->rowsize();\n      src2 += color->rowsize();\n    }\n}\n\n\n\n\nvoid \nGPixmap::stencil(const GBitmap *bm, \n                const GPixmap *pm, int pms, const GRect *pmr, \n                 double corr, GPixel white)\n{\n  // Check arguments\n  GRect rect(0, 0, pm->columns()*pms, pm->rows()*pms);\n  if (pmr != 0)\n    {\n      if (pmr->xmin < rect.xmin || \n          pmr->ymin < rect.ymin || \n          pmr->xmax > rect.xmax || \n          pmr->ymax > rect.ymax  )\n        G_THROW( ERR_MSG(\"GPixmap.overflow5\") );\n      rect = *pmr;\n    }\n  // Compute number of rows\n  int xrows = nrows;\n  if ((int)bm->rows() < xrows)\n    xrows = bm->rows();\n  if (rect.height() < xrows)\n    xrows = rect.height();\n  // Compute number of columns\n  int xcolumns = ncolumns;\n  if ((int)bm->columns() < xcolumns)\n    xcolumns = bm->columns();\n  if (rect.width() < xcolumns)\n    xcolumns = rect.width();\n  // Precompute multiplier map\n  unsigned int multiplier[256];\n  unsigned int maxgray = bm->get_grays() - 1;\n  for (unsigned int i=1; i<maxgray ; i++)\n    multiplier[i] = 0x10000 * i / maxgray;\n  // Prepare color correction table\n  unsigned char gtable[256][3];\n  color_correction_table_cache(corr, white, gtable);\n  // Compute starting point in blown up foreground pixmap\n  int fgy, fgy1, fgxz, fgx1z;\n  euclidian_ratio(rect.ymin, pms, fgy, fgy1);\n  euclidian_ratio(rect.xmin, pms, fgxz, fgx1z);\n  const GPixel *fg = (*pm)[fgy];\n  const unsigned char *src = (*bm)[0];\n  GPixel *dst = (*this)[0];\n  // Loop over rows\n  for (int y=0; y<xrows; y++)\n  {\n    // Loop over columns\n    int fgx = fgxz;\n    int fgx1 = fgx1z;\n    for (int x=0; x<xcolumns; x++)\n    {\n      unsigned char srcpix = src[x];\n      // Perform pixel operation\n      if (srcpix > 0)\n      {\n        if (srcpix >= maxgray)\n        {\n          dst[x].b = gtable[fg[fgx].b][0];\n          dst[x].g = gtable[fg[fgx].g][1];\n          dst[x].r = gtable[fg[fgx].r][2];\n        }\n        else\n        {\n          unsigned int level = multiplier[srcpix];\n          dst[x].b -= (((int)dst[x].b-(int)gtable[fg[fgx].b][0])*level) >> 16;\n          dst[x].g -= (((int)dst[x].g-(int)gtable[fg[fgx].g][1])*level) >> 16;\n          dst[x].r -= (((int)dst[x].r-(int)gtable[fg[fgx].r][2])*level) >> 16;\n        }\n      }\n      // Next column\n      if (++fgx1 >= pms)\n      {\n        fgx1 = 0;\n        fgx += 1;\n      }\n    }\n    // Next line\n    dst += rowsize();\n    src += bm->rowsize();\n    if (++fgy1 >= pms)\n    {\n      fgy1 = 0;\n      fg += pm->rowsize();\n    } \n  }\n}\n\nvoid \nGPixmap::stencil(const GBitmap *bm, \n                const GPixmap *pm, int pms, const GRect *pmr, \n                double corr)\n{\n  stencil(bm, pm, pms, pmr, corr, GPixel::WHITE);\n}\n\n\nGP<GPixmap> GPixmap::rotate(int count)\n{\n  GP<GPixmap> newpixmap(this);\n  count = count & 3;\n  if(count)\n  {\n    if( count&0x01)\n      newpixmap = new GPixmap(ncolumns, nrows);\n    else\n      newpixmap = new GPixmap(nrows, ncolumns);\n\n    GPixmap &dpixmap = *newpixmap;\n\n    GMonitorLock lock(&pixmap_monitor());\n    switch(count)\n    {\n    case 3: //// rotate 90 counter clockwise\n        {\n            int lastrow = dpixmap.rows()-1;\n\n            for(int y=0; y<nrows; y++)\n            {\n                const GPixel *r=operator [] (y);\n                for(int x=0,xnew=lastrow; xnew>=0; x++,xnew--)\n                {\n                    dpixmap[xnew][y] = r[x];\n                }\n            }\n        }\n        break;\n    case 2: //// rotate 180 counter clockwise\n        {\n            int lastrow = dpixmap.rows()-1;\n            int lastcolumn = dpixmap.columns()-1;\n\n            for(int y=0,ynew=lastrow; ynew>=0; y++,ynew--)\n            {\n                const GPixel *r=operator [] (y);\n                GPixel *d=dpixmap[ynew];\n                for(int xnew=lastcolumn; xnew>=0; r++,xnew--)\n                {\n                    d[xnew] = *r;\n                }\n            }\n        }\n        break;\n    case 1: //// rotate 270 counter clockwise\n        {\n            int lastcolumn = dpixmap.columns()-1;\n\n            for(int y=0,ynew=lastcolumn; ynew>=0; y++,ynew--)\n            {\n                const GPixel *r=operator [] (y);\n                for(int x=0; x<ncolumns; x++)\n                {\n                    dpixmap[x][ynew] = r[x];\n                }\n            }\n        }\n        break;\n    }\n  }\n  return newpixmap;\n}\n\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/GPixmap.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _GPIXMAP_H_\n#define _GPIXMAP_H_\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n/** @name GPixmap.h\n\n    Files #\"GPixmap.h\"# and #\"GPixmap.cpp\"# implement class \\Ref{GPixmap}.\n    Instances of this class represent color images.  Each RGB pixel is\n    represented by structure \\Ref{GPixel}. The ``bottom left'' coordinate system\n    is used consistently in the DjVu library.  Line zero of a GPixmap is the\n    bottom line in the color image.  Pixels are organized from left to right\n    within each line.\n    \n    {\\bf ToDo} --- More sophisticated color correction schemes. \n    \n    @memo\n    Generic support for color images.\n    @author\n    L\\'eon Bottou <leonb@research.att.com>\n*/\n//@{\n\n\n#include \"GSmartPointer.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\nclass GBitmap;\nclass GRect;\nclass ByteStream;\n\n\n/** Color pixel as a RGB triple.  \n    The colors are represented using three bytes named #r#, #g# and #b#.  The\n    value of these bytes represent additive amounts of light.  Color white is\n    represented by setting all three bytes to #255#.  Color black is\n    represented by setting all three bytes to #0#.  This convention should not\n    be confused with the convention adopted for class \\Ref{GBitmap} where the\n    pixel values represent an ink level.  */\n\nstruct DJVUAPI GPixel\n{\n  /** Blue component. */\n  unsigned char b;\n  /** Green component. */\n  unsigned char g;\n  /** Red component. */\n  unsigned char r;\n  /** Returns true iff colors are identical. */\n  friend int operator==(const GPixel & p1, const GPixel & p2);\n  /** Returns true iff colors are different. */\n  friend int operator!=(const GPixel & p1, const GPixel & p2);\n  /** Returns a hash code for the color. */\n  friend unsigned int hash(const GPixel &p);\n  /** @name Predefined colors. */\n  //@{ \n  /// GPixel::WHITE is initialized to #rgb:255/255/255#.\n  static const GPixel WHITE; \n  /// GPixel::BLACK is initialized to #rgb:0/0/0#.\n  static const GPixel BLACK; \n  /// GPixel::BLUE is initialized to #rgb:0/0/255#.\n  static const GPixel BLUE;  \n  /// GPixel::GREEN is initialized to #rgb:0/255/0#.\n  static const GPixel GREEN; \n  /// GPixel::RED is initialized to #rgb:255/0/0#.\n  static const GPixel RED;\n  //@}\n};\n\n\n/** RGB Color images.  \n    Instances of class #GPixmap# represent color images as a two dimensional\n    array of pixels \\Ref{GPixel}.  The bracket operator returns a pointer to\n    the pixels composing one line of the image.  This pointer can be used as\n    an array to read or write the pixels of this particular line.  Following\n    the general convention of the DjVu Reference Library, line zero is always\n    the bottom line of the image.\n */\n\nclass DJVUAPI GPixmap : public GPEnabled\n{\nprotected:\n  GPixmap(void);\n  GPixmap(int nrows, int ncolumns, const GPixel *filler=0);\n  GPixmap(const GBitmap &ref);\n  GPixmap(const GBitmap &ref, const GRect &rect);\n  GPixmap(const GPixmap &ref);\n  GPixmap(const GPixmap &ref, const GRect &rect);\n  GPixmap(ByteStream &ref);\n\npublic:\n  /// Virtual destructor.\n  virtual ~GPixmap();\n\n  void destroy(void);\n  /** @name Construction. */\n  //@{\n  /** Creates an empty GBitmap object.  The returned GPixmap has zero rows\n      and zero columns.  Use function \\Ref{init} to change the size of the\n      image. */\n  static GP<GPixmap> create(void) {return new GPixmap();}\n\n  /** Creates a GPixmap with #nrows# rows and #ncolumns# columns.  When the\n      optional argument #filler# is specified, all pixels are initialized \n      with the corresponding color. */\n  static GP<GPixmap> create(\n    const int nrows, const int ncolumns, const GPixel *filler=0)\n  { return new GPixmap(nrows,ncolumns,filler); }\n\n  /** Creates a GPixmap by copying the gray level image #ref#.\n      The constructed GPixmap has the same size as #ref#.  The pixels\n      are initialized with shades of grays copied from #ref#. */\n  static GP<GPixmap> create(const GBitmap &ref)\n  { return new GPixmap(ref); }\n\n  /** Creates a GPixmap by copying the rectangle #rect# of the gray level\n      image #ref#.  The constructed GPixmap has the same size as rectangle\n      #rect#.  The pixels are initialized with shades of grays converted from\n      the ink levels represented in #ref#.  This conversion depends on the\n      number of gray levels in #ref#. */\n  static GP<GPixmap> create(const GBitmap &ref, const GRect &rect)\n  { return new GPixmap(ref,rect); }\n\n  /** Copy constructors. Creates a GPixmap by replicating the size and the\n      contents of GPixmap #ref#. */\n  static GP<GPixmap> create(const GPixmap &ref)\n  { return new GPixmap(ref); }\n\n  /** Creates a GPixmap by copying the rectangle #rect# of the color image #ref#.\n      The constructed GPixmap has the same size as rectangle #rect#.\n      The pixels are initialized with colors copied from #ref#. */\n  static GP<GPixmap> create(const GPixmap &ref, const GRect &rect)\n  { return new GPixmap(ref,rect); }\n\n  /** Creates a GPixmap by reading PPM data from ByteStream #ref#.\n      See \\Ref{PNM and RLE file formats} for more information. */\n  static GP<GPixmap> create(ByteStream &ref)\n  { return new GPixmap(ref); }\n\n  //@}\n\n  /** @name Initialization. */\n  //@{\n  /** Resets the GPixmap to #nrows# rows and #ncolumns# columns.  When the\n      optional argument #filler# is specified, all pixels are initialized with\n      the corresponding color.  The previous content of the GPixmap is discarded. */\n  void init(int nrows, int ncolumns,  const GPixel *filler=0);\n  /** Resets the GPixmap by copying the size and the contents of the color\n      image #ref#.  The previous content of the GPixmap is discarded. */\n  void init(const GPixmap &ref);\n  /** Resets the GPixmap by copying the rectangle #rect# of the color image #ref#.\n      The previous content of the GPixmap is discarded. */\n  void init(const GPixmap &ref, const GRect &rect);\n  /** Resets the GPixmap by copying the size and the contents of the gray \n      level image #ref#.  The optional argument #ramp# is an array of 256 \n      pixel values used for mapping the gray levels to color values. \n      Setting #ramp# to zero selects a linear ramp of shades of gray. */\n  void init(const GBitmap &ref, const GPixel *ramp=0);\n  /** Resets the GPixmap by copying the rectangle #rect# of the gray level\n      image #ref#.  The optional argument #ramp# is an array of 256 pixel\n      values used for mapping the gray levels to color values.  Setting #ramp#\n      to zero selects a linear ramp computed according to the maximal number\n      of gray levels in #ref#. */\n  void init(const GBitmap &ref, const GRect &rect, const GPixel *ramp=0);\n  /** Resets the GPixmap by reading PPM data from ByteStream #ref#.  See\n      \\Ref{PNM and RLE file formats} for more information. */\n  void init(ByteStream &ref);\n  /** Resets the GPixmap by copying the gray level image #ref#.  The pixels\n      are initialized with shades of grays copied from #ref#. */\n  GPixmap& operator=(const GBitmap &ref);\n  /** Copy operator. Resets the GPixmap by copying the size and the contents\n      of the color image #ref#.  The previous content of the GPixmap is\n      discarded. */\n  GPixmap& operator=(const GPixmap &ref);\n  //@}\n\n  /** @name Accessing pixels. */\n  //@{\n  /** Returns the number of rows (the image height). */\n  unsigned int rows() const;\n  /** Returns the number of columns (the image width). */\n  unsigned int columns() const;\n  /** Returns a constant pointer to the first GPixel in row #row#.  This\n      pointer can be used as an array to read the row elements. */\n  const GPixel * operator[] (int row) const;\n  /** Returns a pointer to the first GPixel in row #row#.  This pointer can be\n      used as an array to read or write the row elements. */\n  GPixel * operator[] (int row);\n  /** Returns the length (in pixels) of a row in memory.  This number is equal\n      to the difference between pointers to pixels located in the same column\n      in consecutive rows.  This difference may be larger than the number of\n      columns in the image. */\n  unsigned int rowsize() const;\n  //@}\n\n  /** @name Resampling images. */\n  //@{\n  /** Resets this GPixmap with a subsampled segment of color image #src#.\n      This function conceptually rescales image #src# by a factor #1:factor#,\n      and copies rectangle #rect# of the subsampled image into the current GPixmap.\n      The full subsampled image is copied if #rect# is a null pointer.\n      Both operations are however performed together for efficiency reasons.\n      Subsampling works by averaging the colors of the source pixels located\n      in small squares of size #factor# times #factor#. */\n  void downsample(const GPixmap *src, int factor, const GRect *rect=0);\n  /** Resets this GPixmap with a oversampled segment of color image #src#.\n      This function conceptually rescales image #src# by a factor #factor:1#,\n      and copies rectangle #rect# of the oversampled image into the current\n      GPixmap.  The full oversampled image is copied if #rect# is a null\n      pointer.  Both operations are however performed together for efficiency\n      reasons.  Oversampling works by replicating the color of the source\n      pixels into squares of size #factor# times #factor#. */\n  void upsample(const GPixmap *src, int factor, const GRect *rect=0);\n  /** Resets this GPixmap with a rescaled segment of #src# (zoom 75%).  This\n      function conceptually rescales image #src# by a factor #3:4#, and copies\n      rectangle #rect# of the rescaled image into the current GPixmap.  The\n      full rescaled image is copied if #rect# is a null pointer.  Both\n      operations are however performed together for efficiency reasons.  This\n      function has been superseded by class \\Ref{GPixmapScaler}. */\n  void downsample43(const GPixmap *src, const GRect *rect=0); \n  /** Resets this GPixmap with a rescaled segment of #src# (zoom 150%).  This\n      function conceptually rescales image #src# by a factor #3:2# and copies\n      rectangle #rect# of the rescaled image into the current GPixmap.  The\n      full rescaled image is copied if #rect# is a null pointer.  Both\n      operations are however performed together for efficiency reasons.  This\n      function has been superseded by class \\Ref{GPixmapScaler}. */\n  void upsample23(const GPixmap *src, const GRect *rect=0);\n  //@}\n\n  /** @name Blitting and applying stencils.  \n      These function is essential for rendering DjVu images.  The elementary\n      functions are \\Ref{attenuate} and \\Ref{blit}.  The combined functions\n      \\Ref{blend} and \\Ref{stencil} should be viewed as optimizations.  */\n  //@{\n  /** Attenuates the color image in preparation for a blit.  \n      Bitmap #bm# is positionned at location #x#,#y# over this color image.\n      The matching color image pixels are then multiplied by #1.0-Alpha# where\n      #Alpha# denotes the gray value, in range #[0,1]#, represented by the\n      corresponding pixel of bitmap #bm#. */\n  void attenuate(const GBitmap *bm, int x, int y);\n  /** Blits solid color #color# through transparency mask #bm#.  \n      Bitmap #bm# is positionned at location #x#,#y# over this color image.\n      The matching color image pixels are then modified by adding color\n      #color# multiplied by #Alpha#, where #Alpha# denotes the gray value, in\n      range #[0,1]#, represented by the corresponding pixel of bitmap #bm#. */\n  void blit(const GBitmap *bm, int x, int y, const GPixel *color);\n  /** Blits pixmap #color# through transparency mask #bm#.\n      Bitmap #bm# is positionned at location #x#,#y# over this color image.\n      The matching color image pixels are then modified by adding the\n      corresponding pixel color in pixmap #color#, multiplied by #Alpha#,\n      where #Alpha# denotes the gray value, in range #[0,1]#, represented by\n      the corresponding pixel of bitmap #bm#. */\n  void blit(const GBitmap *bm, int x, int y, const GPixmap *color);\n  /** Performs alpha blending. This function is similar to first calling\n      \\Ref{attenuate} with alpha map #bm# and then calling \\Ref{blit} with\n      alpha map #bm# and color map #color#. Both operations are performed\n      together for efficiency reasons. */\n  void blend(const GBitmap *bm, int x, int y, const GPixmap *color);\n  /** Resample color pixmap and performs color corrected alpha blending.  This\n      function conceptually computes an intermediate color image by first\n      upsampling the GPixmap #pm# by a factor #pms:1# (see \\Ref{upsample}),\n      extracting the sub-image designated by rectangle #pmr# and applying\n      color correction #corr# (see \\Ref{color_correct}).  This intermediate\n      color image is then blended into this pixel map according to the alpha\n      map #bm# (see \\Ref{blend}). */\n  void stencil(const GBitmap *bm, \n               const GPixmap *pm, int pms, \n               const GRect *pmr, double corr, GPixel white);\n  void stencil(const GBitmap *bm, \n               const GPixmap *pm, int pms, \n               const GRect *pmr, double corr=1.0);\n  //@}\n  \n  /** @name Manipulating colors. */\n  //@{\n  /** Dithers the image to 216 colors.  This function applies an ordered\n      dithering algorithm to reduce the image to 216 predefined colors.  These\n      predefined colors are located on a color cube of 6x6x6 colors: the color\n      RGB coordinates can only take the following values: #0#, #51#, #102#,\n      #163#, #214# or #255#.  This is useful for displaying images on a device\n      supporting a maximum of 256 colors. Arguments #xmin# and #ymin# control\n      the position of the dithering grids.  This is useful for dithering tiled\n      images. Arguments #xmin# and #ymin# must be the position of the bottom\n      left corner of the tile contained in this GPixmap. Properly setting\n      these arguments eliminates dithering artifacts on the tile\n      boundaries. */\n  void ordered_666_dither(int xmin=0, int ymin=0);\n  /** Dithers the image to 32768 colors.  This function applies an ordered\n      dithering algorithm to reduce the image to 32768 predefined colors.\n      These predefined colors are located on a color cube of 32x32x32 colors:\n      the color RGB coordinates can only take values in which the three least\n      significant bits are set to #1#.  This is useful for displaying images\n      with less than 24 bits per pixel.  Arguments #xmin# and #ymin# control\n      the position of the dithering grids.  This is useful for dithering tiled\n      images. Arguments #xmin# and #ymin# must be the position of the bottom\n      left corner of the tile contained in this GPixmap. Properly setting\n      these arguments eliminates dithering artifacts on the tile\n      boundaries. */\n  void ordered_32k_dither(int xmin=0, int ymin=0);\n  /** Applies a luminance gamma correction factor of #corr#.  \n      Values greater than #1.0# make the image brighter.  \n      Values smaller than #1.0# make the image darker.  \n      The documentation of program \\Ref{ppmcoco} explains how to\n      properly use this function. */\n  void color_correct(double corr);\n  void color_correct(double corr, GPixel white);\n  /** Applies a luminance gamma correction to an array of pixels. \n      This function is {\\em static} and does not modify this pixmap. */\n  static void color_correct(double corr, GPixel *pix, int npix);\n  static void color_correct(double corr, GPixel white, GPixel *pix, int npix);\n\n  //@}\n  \n  /** @name Miscellaneous. */\n  //@{\n  /** Returns the number of bytes allocated for this image. */\n  inline unsigned int get_memory_usage() const;\n  /** Saves the image into ByteStream #bs# using the PPM format.\n      Argument #raw# selects the ``Raw PPM'' (1) or the ``Ascii PPM'' (0) format.\n      See \\Ref{PNM and RLE file formats} for more information. */\n  void save_ppm(ByteStream &bs, int raw=1) const;\n  //@}\n\n  /** @name Stealing or borrowing the memory buffer (advanced). */\n  //@{\n  /** Steals the memory buffer of a GPixmap.  This function returns the\n      address of the memory buffer allocated by this GPixmap object.  The\n      offset of the first pixel in the bottom line is written into variable\n      #offset#.  Other lines can be accessed using pointer arithmetic (see\n      \\Ref{rowsize}).  The GPixmap object no longer ``owns'' the buffer: you\n      must explicitly de-allocate the buffer using #operator delete []#.  This\n      de-allocation should take place after the destruction or the\n      re-initialization of the GPixmap object.  This function will return a\n      null pointer if the GPixmap object does not ``own'' the buffer in the\n      first place.  */\n  GPixel *take_data(size_t &offset);\n  /** Initializes this GPixmap by borrowing a memory segment.  The GPixmap\n      then directly addresses the memory buffer #data# provided by the user.\n      This buffer must be large enough to hold #w*h# GPixels.  The GPixmap\n      object does not ``own'' the buffer: you must explicitly de-allocate the\n      buffer using #operator delete []#.  This de-allocation should take place\n      after the destruction or the re-initialization of the GPixmap object.  */\n  inline void borrow_data(GPixel &data, int w, int h); \n  /// Identical to the above, but GPixmap will do the delete []. \n  void donate_data(GPixel *data, int w, int h); \n  \n  /** Rotates pixmap by 90, 180 or 270 degrees anticlockwise\n      and returns a new pixmap, input pixmap is not changed. \n      count can be 1, 2, or 3 for 90, 180, 270 degree rotation.\n      It returns the same pixmap if not rotated. */\n  GP<GPixmap> rotate(int count=0);\n\n  //@}\n  \n  // Please ignore these two functions. Their only purpose is to allow\n  // DjVu viewer compile w/o errors. eaf. \n  // Is this still useful ?. lyb.\n  int get_grays(void) const { return 256; };\n  void set_grays(int) {};\\\n  \nprotected:\n  // data\n  unsigned short nrows;\n  unsigned short ncolumns;\n  unsigned short nrowsize;\n  GPixel *pixels;\n  GPixel *pixels_data;\n  friend class DjVu_PixImage;\n};\n\n//@}\n\n// INLINE --------------------------\n\n\ninline int \noperator==(const GPixel & p1, const GPixel & p2)\n{\n  return p1.r==p2.r && p1.g==p2.g && p1.b==p2.b;\n}\n\ninline int \noperator!=(const GPixel & p1, const GPixel & p2)\n{\n  return p1.r!=p2.r || p1.g!=p2.g || p1.b!=p2.b;\n}\n\ninline unsigned int \nhash(const GPixel &p)\n{\n  unsigned int x = (p.b<<16)|(p.g<<8)|(p.r);\n  return x ^ (p.b<<4) ^ (p.r<<12);\n}\n\ninline unsigned int\nGPixmap::rows() const\n{\n  return nrows;\n}\n\ninline unsigned int\nGPixmap::columns() const\n{\n  return ncolumns;\n}\n\ninline unsigned int\nGPixmap::rowsize() const\n{\n  return nrowsize;\n}\n\ninline GPixel *\nGPixmap::operator[](int row)\n{\n  if (row<0 || row>=nrows || !pixels) return 0;\n  return &pixels[row * nrowsize];\n}\n\ninline const GPixel *\nGPixmap::operator[](int row) const\n{\n  if (row<0 || row>=nrows) return 0;\n  return &pixels[row * nrowsize];\n}\n\ninline GPixmap & \nGPixmap::operator=(const GBitmap &ref)\n{\n  init(ref);\n  return *this;\n}\n\ninline GPixmap & \nGPixmap::operator=(const GPixmap &ref)\n{\n  init(ref);\n  return *this;\n}\n\ninline void\nGPixmap::borrow_data(GPixel &data, int w, int h)\n{\n  donate_data(&data,w,h);\n  pixels_data=0;\n}\n\n//////////////////////////////////////////////////\n// Memory usage\n//////////////////////////////////////////////////\n\n\ninline unsigned int \nGPixmap::get_memory_usage() const\n{\n  return  sizeof(GPixmap)+(nrows * ncolumns * sizeof(GPixel));\n}\n\n// ---------------------------------\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n\n\n"
  },
  {
    "path": "ext/libdjvu/GRect.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n// -- Implementation of class GRect and GRectMapper\n// - Author: Leon Bottou, 05/1997\n\n\n#include \"GRect.h\"\n#include \"GException.h\"\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n// -- Local utilities\n\nstatic inline int \nimin(int x, int y)\n{\n  if (x < y) \n    return x;\n  else\n    return y;\n}\n\nstatic inline int \nimax(int x, int y)\n{\n  if (x > y) \n    return x;\n  else\n    return y;\n}\n\nstatic inline void\niswap(int &x, int &y)\n{\n  int tmp = x; x = y; y = tmp;\n}\n\n// -- Class GRect\n\nint \noperator==(const GRect & r1, const GRect & r2)\n{\n  bool isempty1 = r1.isempty();\n  bool isempty2 = r2.isempty();\n  if (isempty1 || isempty2)\n    if (isempty1 && isempty2)\n      return 1;\n  if ( r1.xmin==r2.xmin && r1.xmax==r2.xmax \n       && r1.ymin==r2.ymin && r1.ymax==r2.ymax )\n    return 1;\n  return 0;\n}\n\nint \nGRect::inflate(int dx, int dy)\n{\n  xmin -= dx;\n  xmax += dx;\n  ymin -= dy;\n  ymax += dy;\n  if (! isempty()) \n    return 1;\n  xmin = ymin = xmax = ymax = 0;\n  return 0;\n}\n\nint \nGRect::translate(int dx, int dy)\n{\n  xmin += dx;\n  xmax += dx;\n  ymin += dy;\n  ymax += dy;\n  if (! isempty()) \n    return 1;\n  xmin = ymin = xmax = ymax = 0;\n  return 0;\n}\n\nint  \nGRect::intersect(const GRect &rect1, const GRect &rect2)\n{\n  xmin = imax(rect1.xmin, rect2.xmin);\n  xmax = imin(rect1.xmax, rect2.xmax);\n  ymin = imax(rect1.ymin, rect2.ymin);\n  ymax = imin(rect1.ymax, rect2.ymax);\n  if (! isempty()) \n    return 1;\n  xmin = ymin = xmax = ymax = 0;\n  return 0;\n}\n\nint  \nGRect::recthull(const GRect &rect1, const GRect &rect2)\n{\n  if (rect1.isempty())\n    {\n      xmin = rect2.xmin;\n      xmax = rect2.xmax;\n      ymin = rect2.ymin;\n      ymax = rect2.ymax;\n      return !isempty();\n    }\n  if (rect2.isempty())\n    {\n      xmin = rect1.xmin;\n      xmax = rect1.xmax;\n      ymin = rect1.ymin;\n      ymax = rect1.ymax;\n      return !isempty();\n    }\n  xmin = imin(rect1.xmin, rect2.xmin);\n  xmax = imax(rect1.xmax, rect2.xmax);\n  ymin = imin(rect1.ymin, rect2.ymin);\n  ymax = imax(rect1.ymax, rect2.ymax);\n  return 1;\n}\n\nint\nGRect::contains(const GRect & rect) const\n{\n   GRect tmp_rect;\n   tmp_rect.intersect(*this, rect);\n   return tmp_rect==rect;\n}\n\nvoid\nGRect::scale(float factor)\n{\n\txmin = (int)(((float)xmin) * factor);\n\tymin = (int)(((float)ymin) * factor);\n\txmax = (int)(((float)xmax) * factor);\n\tymax = (int)(((float)ymax) * factor);\n}\n\nvoid\nGRect::scale(float xfactor, float yfactor)\n{\n\txmin = (int)(((float)xmin) * xfactor);\n\tymin = (int)(((float)ymin) * yfactor);\n\txmax = (int)(((float)xmax) * xfactor);\n\tymax = (int)(((float)ymax) * yfactor);\n}\n// -- Class GRatio\n\n\ninline\nGRectMapper::GRatio::GRatio()\n  : p(0), q(1)\n{\n}\n\ninline\nGRectMapper::GRatio::GRatio(int p, int q)\n  : p(p), q(q)\n{\n  if (q == 0) \n    G_THROW( ERR_MSG(\"GRect.div_zero\") );\n  if (p == 0)\n    q = 1;\n  if (q < 0)\n    {\n      p = -p; \n      q = -q; \n    }\n  int gcd = 1;\n  int g1 = p; \n  int g2 = q; \n  if (g1 > g2)\n    {\n      gcd = g1;\n      g1 = g2;\n      g2 = gcd;\n    }\n  while (g1 > 0)\n    {\n      gcd = g1;\n      g1 = g2 % g1;\n      g2 = gcd;\n    }\n  p /= gcd;\n  q /= gcd;\n}\n\n\n#ifdef HAVE_LONG_LONG_INT\n#define llint_t long long int\n#else\n#define llint_t long int\n#endif\n\ninline int \noperator*(int n, GRectMapper::GRatio r )\n{ \n  /* [LB] -- This computation is carried out with integers and\n     rational numbers because it must be exact.  Some lizard changed\n     it to double and this is wrong.  I suspect they did so because\n     they encountered overflow issues.  Let's use long long ints. */\n  llint_t x = (llint_t) n * (llint_t) r.p;\n  if (x >= 0)\n    return   ((r.q/2 + x) / r.q);\n  else\n    return - ((r.q/2 - x) / r.q);\n}\n\ninline int \noperator/(int n, GRectMapper::GRatio r )\n{ \n  /* [LB] -- See comment in operator*() above. */\n  llint_t x = (llint_t) n * (llint_t) r.q;\n  if (x >= 0)\n    return   ((r.p/2 + x) / r.p);\n  else\n    return - ((r.p/2 - x) / r.p);\n}\n\n\n// -- Class GRectMapper\n\n#define MIRRORX  1\n#define MIRRORY  2\n#define SWAPXY 4\n\n\nGRectMapper::GRectMapper()\n: rectFrom(0,0,1,1), \n  rectTo(0,0,1,1),\n  code(0)\n{\n\n}\n\nvoid\nGRectMapper::clear()\n{\n  rectFrom = GRect(0,0,1,1);\n  rectTo = GRect(0,0,1,1);\n  code = 0;\n}\n\nvoid \nGRectMapper::set_input(const GRect &rect)\n{\n  if (rect.isempty())\n    G_THROW( ERR_MSG(\"GRect.empty_rect1\") );\n  rectFrom = rect;\n  if (code & SWAPXY)\n  {\n    iswap(rectFrom.xmin, rectFrom.ymin);\n    iswap(rectFrom.xmax, rectFrom.ymax);\n  }\n  rw = rh = GRatio();\n}\n\nvoid \nGRectMapper::set_output(const GRect &rect)\n{\n  if (rect.isempty())\n    G_THROW( ERR_MSG(\"GRect.empty_rect2\") );\n  rectTo = rect;\n  rw = rh = GRatio();\n}\n\nvoid \nGRectMapper::rotate(int count)\n{\n  int oldcode = code;\n  switch (count & 0x3)\n    {\n    case 1:\n      code ^= (code & SWAPXY) ? MIRRORY : MIRRORX;\n      code ^= SWAPXY;\n      break;\n    case 2:\n      code ^= (MIRRORX|MIRRORY);\n      break;\n    case 3:\n      code ^= (code & SWAPXY) ? MIRRORX : MIRRORY;\n      code ^= SWAPXY;\n      break;\n    }\n  if ((oldcode ^ code) & SWAPXY)\n    { \n      iswap(rectFrom.xmin, rectFrom.ymin);\n      iswap(rectFrom.xmax, rectFrom.ymax);\n      rw = rh = GRatio();\n    }\n}\n\nvoid \nGRectMapper::mirrorx()\n{\n  code ^= MIRRORX;\n}\n\nvoid \nGRectMapper::mirrory()\n{\n  code ^= MIRRORY;\n}\n\nvoid\nGRectMapper::precalc()\n{\n  if (rectTo.isempty() || rectFrom.isempty())\n    G_THROW( ERR_MSG(\"GRect.empty_rect3\") );\n  rw = GRatio(rectTo.width(), rectFrom.width());\n  rh = GRatio(rectTo.height(), rectFrom.height());\n}\n\nvoid \nGRectMapper::map(int &x, int &y)\n{\n  int mx = x;\n  int my = y;\n  // precalc\n  if (! (rw.p && rh.p))\n    precalc();\n  // swap and mirror\n  if (code & SWAPXY)\n    iswap(mx,my);\n  if (code & MIRRORX)\n    mx = rectFrom.xmin + rectFrom.xmax - mx;\n  if (code & MIRRORY)\n    my = rectFrom.ymin + rectFrom.ymax - my;\n  // scale and translate\n  x = rectTo.xmin + (mx - rectFrom.xmin) * rw;\n  y = rectTo.ymin + (my - rectFrom.ymin) * rh;\n}\n\nvoid \nGRectMapper::unmap(int &x, int &y)\n{\n  // precalc \n  if (! (rw.p && rh.p))\n    precalc();\n  // scale and translate\n  int mx = rectFrom.xmin + (x - rectTo.xmin) / rw;\n  int my = rectFrom.ymin + (y - rectTo.ymin) / rh;\n  //  mirror and swap\n  if (code & MIRRORX)\n    mx = rectFrom.xmin + rectFrom.xmax - mx;\n  if (code & MIRRORY)\n    my = rectFrom.ymin + rectFrom.ymax - my;\n  if (code & SWAPXY)\n    iswap(mx,my);\n  x = mx;\n  y = my;\n}\n\nvoid \nGRectMapper::map(GRect &rect)\n{\n  map(rect.xmin, rect.ymin);\n  map(rect.xmax, rect.ymax);\n  if (rect.xmin >= rect.xmax)\n    iswap(rect.xmin, rect.xmax);\n  if (rect.ymin >= rect.ymax)\n    iswap(rect.ymin, rect.ymax);\n}\n\nvoid \nGRectMapper::unmap(GRect &rect)\n{\n  unmap(rect.xmin, rect.ymin);\n  unmap(rect.xmax, rect.ymax);\n  if (rect.xmin >= rect.xmax)\n    iswap(rect.xmin, rect.xmax);\n  if (rect.ymin >= rect.ymax)\n    iswap(rect.ymin, rect.ymax);\n}\n\nGRect \nGRectMapper::get_input()\n{\n    return rectFrom;\n}\n\nGRect \nGRectMapper::get_output()\n{\n    return rectTo;\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/GRect.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _GRECT_H_\n#define _GRECT_H_\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n/** @name GRect.h\n    Files #\"GRect.h\"# and #\"GRect.cpp\"# implement basic operations on\n    rectangles. Class \\Ref{GRect} is used to represent rectangles.  Class\n    \\Ref{GRectMapper} represent the correspondence between points relative to\n    given rectangles.  Class \\Ref{GRatio} is used to represent scaling factors\n    as rational numbers.\n    @memo\n    Rectangle manipulation class.\n    @author\n    L\\'eon Bottou <leonb@research.att.com> -- initial implementation.\n*/\n//@{\n\n#include \"DjVuGlobal.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n/* Flag to indicate that this djvulibre version\n   gets rid of all the crap about orientation bits.\n   All rotation code has been fixed and consistently\n   implements counter-clockwise rotations. */\n\n#define GRECT_WITHOUT_ORIENTATION_BITS 1\n\n\n/** @name Point Coordinates vs. Pixel Coordinates\n\n    The DjVu technology relies on the accurate superposition of images at\n    different resolutions.  Such an accuracy cannot be reached with the usual\n    assumption that pixels are small enough to be considered infinitesimally\n    small.  We must distinguish very precisely ``points'' and ``pixels''.\n    This distinction is essential for performing scaling operations.\n\n    The pixels of an image are identified by ``pixel coordinates''.  The\n    bottom-left corner pixel has coordinates #(0,0)# and the top-right corner\n    pixel has coordinates #(w-1,h-1)# where #w# and #h# are the image size.\n    Pixel coordinates are necessarily integers since pixels never overlap.\n\n    An infinitesimally small point is identified by its ``point coordinates''.\n    There may be fractional point coordinates, although this library does not\n    make use of them.  Points with integer coordinates are located {\\em on the\n    corners of each pixel}.  They are not located on the pixel centers.  The\n    center of the pixel with pixel coordinates #(i,j)# is located at point\n    coordinates #(i+1/2,j+1/2)#.  In other words, the pixel #(i,j)# extends\n    from point #(i,j)# to point #(i+1,j+1)#.\n\n    Therefore, the point located on the bottom left corner of an image has\n    coordinates #(0,0)#.  This point is in fact the bottom left corner of the\n    bottom left pixel of the image.  The point located on the top right corner\n    of an image has coordinates #(w,h)# where #w# and #h# are the image size.\n    This is in fact the top right corner of pixel #(w-1,h-1)# which is the\n    image pixel with the highest coordinates.\n*/\n//@{\n//@}\n\n\n\n/** Rectangle class.  Each instance of this class represents a rectangle whose\n    sides are parallel to the axis. Such a rectangle represents all the points\n    whose coordinates lies between well defined minimal and maximal values.\n    Member functions can combine several rectangles by computing the\n    intersection of rectangles (\\Ref{intersect}) or the smallest rectangle\n    enclosing two rectangles (\\Ref{recthull}).  */\n\nclass DJVUAPI GRect \n{\npublic:\n  /** Constructs an empty rectangle */\n  GRect();\n  /** Constructs a rectangle given its minimal coordinates #xmin# and #ymin#,\n      and its measurements #width# and #height#. Setting #width# or #height# to zero\n      produces an empty rectangle.  */\n  GRect(int xmin, int ymin, unsigned int width=0, unsigned int height=0);\n  /** Returns the rectangle width. */\n  int  width() const;\n  /** Returns the rectangle height. */\n  int  height() const;\n  /** Returns the area of the rectangle. */\n  int  area() const;\n  /** Returns true if the rectangle is empty. */\n  bool  isempty() const;\n  /** Returns true if the rectangle contains pixel (#x#,#y#).  A rectangle\n      contains all pixels with horizontal pixel coordinates in range #xmin#\n      (inclusive) to #xmax# (exclusive) and vertical coordinates #ymin#\n      (inclusive) to #ymax# (exclusive). */\n  int  contains(int x, int y) const;\n  /** Returns true if this rectangle contains the passed rectangle #rect#.\n      The function basically checks, that the intersection of this rectangle\n      with #rect# is #rect#. */\n  int  contains(const GRect & rect) const;\n  /** Returns true if rectangles #r1# and #r2# are equal. */\n  friend int operator==(const GRect & r1, const GRect & r2);\n  /** Returns true if rectangles #r1# and #r2# are not equal. */\n  friend int operator!=(const GRect & r1, const GRect & r2);\n  /** Resets the rectangle to the empty rectangle */\n  void clear();\n  /** Fatten the rectangle. Both vertical sides of the rectangle are pushed\n      apart by #dx# units. Both horizontal sides of the rectangle are pushed\n      apart by #dy# units. Setting arguments #dx# (resp. #dy#) to a negative\n      value reduces the rectangle horizontal (resp. vertical) size. */\n  int  inflate(int dx, int dy);\n  /** Translate the rectangle. The new rectangle is composed of all the points\n      of the old rectangle translated by #dx# units horizontally and #dy#\n      units vertically. */\n  int  translate(int dx, int dy);\n  /** Sets the rectangle to the intersection of rectangles #rect1# and #rect2#.\n      This function returns true if the intersection rectangle is not empty. */\n  int  intersect(const GRect &rect1, const GRect &rect2);\n  /** Sets the rectangle to the smallest rectangle containing the points of\n      both rectangles #rect1# and #rect2#. This function returns true if the\n      created rectangle is not empty. */\n  int  recthull(const GRect &rect1, const GRect &rect2);\n  /** Multiplies xmin, ymin, xmax, ymax by factor and scales the rectangle*/\n  void scale(float factor);\n  /** Multiplies xmin, xmax by xfactor and ymin, ymax by yfactor and scales the rectangle*/\n  void scale(float xfactor, float yfactor);\n  /** Minimal horizontal point coordinate of the rectangle. */\n  int xmin;\n  /** Minimal vertical point coordinate of the rectangle. */\n  int ymin;\n  /** Maximal horizontal point coordinate of the rectangle. */\n  int xmax;\n  /** Maximal vertical point coordinate of the rectangle. */\n  int ymax;\n};\n\n\n/** Maps points from one rectangle to another rectangle.  This class\n    represents a relation between the points of two rectangles. Given the\n    coordinates of a point in the first rectangle (input rectangle), function\n    \\Ref{map} computes the coordinates of the corresponding point in the\n    second rectangle (the output rectangle).  This function actually implements\n    an affine transform which maps the corners of the first rectangle onto the\n    matching corners of the second rectangle. The scaling operation is\n    performed using integer fraction arithmetic in order to maximize\n    accuracy. */\nclass DJVUAPI GRectMapper \n{\npublic:\n  /** Constructs a rectangle mapper. */\n  GRectMapper();\n  /** Resets the rectangle mapper state. Both the input rectangle\n      and the output rectangle are marked as undefined. */\n  void clear();\n  /** Sets the input rectangle. */\n  void set_input(const GRect &rect);\n  /** Returns the input rectangle. */\n  GRect get_input();\n  /** Sets the output rectangle. */\n  void set_output(const GRect &rect);\n  /** Returns the output rectangle. */\n  GRect get_output();\n  /** Composes the affine transform with a rotation of #count# quarter turns\n      counter-clockwise.  This operation essentially is a modification of the\n      match between the corners of the input rectangle and the corners of the\n      output rectangle. */\n  void rotate(int count=1);\n  /** Composes the affine transform with a symmetry with respect to the\n      vertical line crossing the center of the output rectangle.  This\n      operation essentially is a modification of the match between the corners\n      of the input rectangle and the corners of the output rectangle. */\n  void mirrorx();\n  /** Composes the affine transform with a symmetry with respect to the\n      horizontal line crossing the center of the output rectangle.  This\n      operation essentially is a modification of the match between the corners\n      of the input rectangle and the corners of the output rectangle. */\n  void mirrory();\n  /** Maps a point according to the affine transform.  Variables #x# and #y#\n      initially contain the coordinates of a point. This operation overwrites\n      these variables with the coordinates of a second point located in the\n      same position relative to the corners of the output rectangle as the\n      first point relative to the matching corners of the input rectangle.\n      Coordinates are rounded to the nearest integer. */\n  void map(int &x, int &y);\n  /** Maps a rectangle according to the affine transform. This operation\n      consists in mapping the rectangle corners and reordering the corners in\n      the canonical rectangle representation.  Variable #rect# is overwritten\n      with the new rectangle coordinates. */\n  void map(GRect &rect);\n  /** Maps a point according to the inverse of the affine transform.\n      Variables #x# and #y# initially contain the coordinates of a point. This\n      operation overwrites these variables with the coordinates of a second\n      point located in the same position relative to the corners of input\n      rectangle as the first point relative to the matching corners of the\n      input rectangle. Coordinates are rounded to the nearest integer. */\n  void unmap(int &x, int &y);\n  /** Maps a rectangle according to the inverse of the affine transform. This\n      operation consists in mapping the rectangle corners and reordering the\n      corners in the canonical rectangle representation.  Variable #rect# is\n      overwritten with the new rectangle coordinates. */\n  void unmap(GRect &rect);\npublic:\n  // GRatio\n  struct GRatio {\n    GRatio ();\n    GRatio (int p, int q);\n    int p;\n    int q;\n  };\nprivate:\n  // Data\n  GRect rectFrom;\n  GRect rectTo;\n  int   code;\n  // Helper\n  void  precalc();\n  friend int operator*(int n, GRatio r ); \n  friend int operator/(int n, GRatio r ); \n  GRatio rw;\n  GRatio rh;\n};\n\n\n//@}\n\n\n\n// ---- INLINES\n\ninline\nGRect::GRect()\n: xmin(0), ymin(0), xmax(0), ymax(0)\n{\n}\n\ninline \nGRect::GRect(int xmin, int ymin, unsigned int width, unsigned int height)\n: xmin(xmin), ymin(ymin), xmax(xmin+width), ymax(ymin+height)\n{\n}\n\ninline int \nGRect::width() const\n{\n  return xmax - xmin;\n}\n\ninline int \nGRect::height() const\n{\n  return ymax - ymin;\n}\n\ninline bool \nGRect::isempty() const\n{\n  return (xmin>=xmax || ymin>=ymax);\n}\n\ninline int \nGRect::area() const\n{\n  return isempty() ? 0 : (xmax-xmin)*(ymax-ymin);\n}\n\ninline int\nGRect::contains(int x, int y) const\n{\n  return (x>=xmin && x<xmax && y>=ymin && y<ymax);\n}\n  \ninline void \nGRect::clear()\n{\n  xmin = xmax = ymin = ymax = 0;\n}\n\ninline int\noperator!=(const GRect & r1, const GRect & r2)\n{\n   return !(r1==r2);\n}\n\n// ---- THE END\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/GScaler.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n// Rescale images with fast bilinear interpolation\n// From: Leon Bottou, 1/31/2002\n// Almost equal to my initial code.\n\n#include \"GScaler.h\"\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n////////////////////////////////////////\n// CONSTANTS\n\n\n#define FRACBITS  4\n#define FRACSIZE  (1<<FRACBITS)\n#define FRACSIZE2 (FRACSIZE>>1)\n#define FRACMASK  (FRACSIZE-1)\n\n\n\n\n\n\n////////////////////////////////////////\n// UTILITIES\n\n\nstatic int interp_ok = 0;\nstatic short interp[FRACSIZE][512];\n\nstatic void\nprepare_interp()\n{\n  if (! interp_ok)\n    {\n      interp_ok = 1;\n      for (int i=0; i<FRACSIZE; i++)\n        {\n          short *deltas = & interp[i][256];\n          for (int j = -255; j <= 255; j++)\n            deltas[j] = ( j*i + FRACSIZE2 ) >> FRACBITS;\n        }\n    }\n}\n\n\nstatic inline int\nmini(int x, int y) \n{ \n  return (x < y ? x : y);\n}\n\n\nstatic inline int\nmaxi(int x, int y) \n{ \n  return (x > y ? x : y);\n}\n\n\n\n\n\n\n////////////////////////////////////////\n// GSCALER\n\n\nGScaler::GScaler()\n  : inw(0), inh(0), \n    xshift(0), yshift(0), redw(0), redh(0), \n    outw(0), outh(0),\n    gvcoord(vcoord,0), ghcoord(hcoord,0)\n{\n}\n\n\nGScaler::~GScaler()\n{\n}\n\n\nvoid\nGScaler::set_input_size(int w, int h)\n{ \n  inw = w;\n  inh = h;\n  if (vcoord)\n  {\n    gvcoord.resize(0);\n  }\n  if (hcoord)\n  {\n    ghcoord.resize(0);\n  }\n}\n\n\nvoid\nGScaler::set_output_size(int w, int h)\n{ \n  outw = w;\n  outh = h;\n  if (vcoord)\n  {\n    gvcoord.resize(0);\n  }\n  if (hcoord)\n  {\n    ghcoord.resize(0);\n  }\n}\n\n\nstatic void\nprepare_coord(int *coord, int inmax, int outmax, int in, int out)\n{\n  int len = (in*FRACSIZE);\n  int beg = (len+out)/(2*out) - FRACSIZE2;\n  // Bresenham algorithm\n  int y = beg;\n  int z = out/2;\n  int inmaxlim = (inmax-1)*FRACSIZE;\n  for  (int x=0; x<outmax; x++)\n    {\n      coord[x] = mini(y,inmaxlim);\n      z = z + len;\n      y = y + z / out;  \n      z = z % out;\n    }\n  // Result must fit exactly\n  if (out==outmax && y!=beg+len)\n    G_THROW( ERR_MSG(\"GScaler.assertion\") );\n}\n\n\nvoid \nGScaler::set_horz_ratio(int numer, int denom)\n{\n  if (! (inw>0 && inh>0 && outw>0 && outh>0))\n    G_THROW( ERR_MSG(\"GScaler.undef_size\") );\n  // Implicit ratio (determined by the input/output sizes)\n  if (numer==0 && denom==0) {\n    numer = outw;\n    denom = inw;\n  } else if (numer<=0 || denom<=0)\n    G_THROW( ERR_MSG(\"GScaler.ratios\") );\n  // Compute horz reduction\n  xshift = 0;\n  redw = inw;\n  while (numer+numer < denom) {\n    xshift += 1;\n    redw = (redw + 1) >> 1;\n   numer = numer << 1;\n  }\n  // Compute coordinate table\n  if (! hcoord)\n    ghcoord.resize(outw);\n  prepare_coord(hcoord, redw, outw, denom, numer);\n}\n\n\nvoid \nGScaler::set_vert_ratio(int numer, int denom)\n{\n  if (! (inw>0 && inh>0 && outw>0 && outh>0))\n    G_THROW( ERR_MSG(\"GScaler.undef_size\") );\n  // Implicit ratio (determined by the input/output sizes)\n  if (numer==0 && denom==0) {\n    numer = outh;\n    denom = inh;\n  } else if (numer<=0 || denom<=0)\n    G_THROW( ERR_MSG(\"GScaler.ratios\") );\n  // Compute horz reduction\n  yshift = 0;\n  redh = inh;\n  while (numer+numer < denom) {\n    yshift += 1;\n    redh = (redh + 1) >> 1;\n    numer = numer << 1;\n  }\n  // Compute coordinate table\n  if (! vcoord)\n  {\n    gvcoord.resize(outh);\n  }\n  prepare_coord(vcoord, redh, outh, denom, numer);\n}\n\n\nvoid\nGScaler::make_rectangles(const GRect &desired, GRect &red, GRect &inp)\n{\n  // Parameter validation\n  if (desired.xmin<0 || desired.ymin<0 ||\n      desired.xmax>outw || desired.ymax>outh )\n    G_THROW( ERR_MSG(\"GScaler.too_big\") );\n  // Compute ratio (if not done yet)\n  if (!vcoord) \n    set_vert_ratio(0,0);\n  if (!hcoord) \n    set_horz_ratio(0,0);\n  // Compute reduced bounds\n  red.xmin = (hcoord[desired.xmin]) >> FRACBITS;\n  red.ymin = (vcoord[desired.ymin]) >> FRACBITS;\n  red.xmax = (hcoord[desired.xmax-1]+FRACSIZE-1) >> FRACBITS;\n  red.ymax = (vcoord[desired.ymax-1]+FRACSIZE-1) >> FRACBITS;\n  // Borders\n  red.xmin = maxi(red.xmin, 0);\n  red.xmax = mini(red.xmax+1, redw);\n  red.ymin = maxi(red.ymin, 0);\n  red.ymax = mini(red.ymax+1, redh);\n  // Input\n  inp.xmin = maxi(red.xmin<<xshift, 0); \n  inp.xmax = mini(red.xmax<<xshift, inw); \n  inp.ymin = maxi(red.ymin<<yshift, 0); \n  inp.ymax = mini(red.ymax<<yshift, inh); \n}\n\n\nvoid \nGScaler::get_input_rect( const GRect &desired_output, GRect &required_input )\n{\n  GRect red;\n  make_rectangles(desired_output, red, required_input);\n}\n\n\n\n\n\n\n////////////////////////////////////////\n// GBITMAPSCALER\n\n\nGBitmapScaler::GBitmapScaler()\n  : glbuffer(lbuffer,0), gconv(conv,0), gp1(p1,0), gp2(p2,0)\n{\n}\n\n\nGBitmapScaler::GBitmapScaler(int inw, int inh, int outw, int outh)\n  : glbuffer(lbuffer,0), gconv(conv,0), gp1(p1,0), gp2(p2,0)\n{\n  set_input_size(inw, inh);\n  set_output_size(outw, outh);\n}\n\n\nGBitmapScaler::~GBitmapScaler()\n{\n}\n\n\nunsigned char *\nGBitmapScaler::get_line(int fy, \n                        const GRect &required_red, \n                        const GRect &provided_input,\n                        const GBitmap &input )\n{\n  if (fy < required_red.ymin)\n    fy = required_red.ymin; \n  else if (fy >= required_red.ymax)\n    fy = required_red.ymax - 1;\n  // Cached line\n  if (fy == l2)\n    return p2;\n  if (fy == l1)\n    return p1;\n  // Shift\n  unsigned char *p = p1;\n  p1 = p2;\n  l1 = l2;\n  p2 = p;\n  l2 = fy;\n  if (xshift==0 && yshift==0)\n    {\n      // Fast mode\n      int dx = required_red.xmin-provided_input.xmin;\n      int dx1 = required_red.xmax-provided_input.xmin;\n      const unsigned char *inp1 = input[fy-provided_input.ymin] + dx;\n      while (dx++ < dx1)\n        *p++ = conv[*inp1++];\n      return p2;\n    }\n  else\n    {\n      // Compute location of line\n      GRect line;\n      line.xmin = required_red.xmin << xshift;\n      line.xmax = required_red.xmax << xshift;\n      line.ymin = fy << yshift;\n      line.ymax = (fy+1) << yshift;\n      line.intersect(line, provided_input);\n      line.translate(-provided_input.xmin, -provided_input.ymin);\n      // Prepare variables\n      const unsigned char *botline = input[line.ymin];\n      int rowsize = input.rowsize();\n      int sw = 1<<xshift;\n      int div = xshift+yshift;\n      int rnd = 1<<(div-1);\n      // Compute averages\n      for (int x=line.xmin; x<line.xmax; x+=sw,p++)\n        {\n          int g=0, s=0;\n          const unsigned char *inp0 = botline + x;\n          int sy1 = mini(line.height(), (1<<yshift));\n          for (int sy=0; sy<sy1; sy++,inp0+=rowsize)\n\t    {\n\t      const unsigned char *inp1;\n\t      const unsigned char *inp2 = inp0 + mini(x+sw, line.xmax) - x;\n\t      for (inp1=inp0; inp1<inp2; inp1++)\n\t\t{\n\t\t  g += conv[*inp1];\n\t\t  s += 1;\n\t\t}\n\t    }\n          if (s == rnd+rnd)\n            *p = (g+rnd)>>div;\n          else\n            *p = (g+s/2)/s;\n        }\n      // Return\n      return p2;\n    }\n}\n\n\nvoid \nGBitmapScaler::scale( const GRect &provided_input, const GBitmap &input,\n                      const GRect &desired_output, GBitmap &output )\n{\n  // Compute rectangles\n  GRect required_input; \n  GRect required_red;\n  make_rectangles(desired_output, required_red, required_input);\n  // Parameter validation\n  if (provided_input.width() != (int)input.columns() ||\n      provided_input.height() != (int)input.rows() )\n    G_THROW( ERR_MSG(\"GScaler.no_match\") );\n  if (provided_input.xmin > required_input.xmin ||\n      provided_input.ymin > required_input.ymin ||\n      provided_input.xmax < required_input.xmax ||\n      provided_input.ymax < required_input.ymax  )\n    G_THROW( ERR_MSG(\"GScaler.too_small\") );\n  // Adjust output pixmap\n  if (desired_output.width() != (int)output.columns() ||\n      desired_output.height() != (int)output.rows() )\n    output.init(desired_output.height(), desired_output.width());\n  output.set_grays(256);\n  // Prepare temp stuff\n  gp1.resize(0);\n  gp2.resize(0);\n  glbuffer.resize(0);\n  prepare_interp();\n  const int bufw = required_red.width();\n  glbuffer.resize(bufw+2);\n  gp1.resize(bufw);\n  gp2.resize(bufw);\n  l1 = l2 = -1;\n  // Prepare gray conversion array (conv)\n  gconv.resize(0);\n  gconv.resize(256);\n  int maxgray = input.get_grays()-1;\n  for (int i=0; i<256; i++) \n    {\n      conv[i]=(i<= maxgray)\n        ?(((i*255) + (maxgray>>1)) / maxgray)\n        :255;\n    }\n  // Loop on output lines\n  for (int y=desired_output.ymin; y<desired_output.ymax; y++)\n    {\n      // Perform vertical interpolation\n      {\n        int fy = vcoord[y];\n        int fy1 = fy>>FRACBITS;\n        int fy2 = fy1+1;\n        const unsigned char *lower, *upper;\n        // Obtain upper and lower line in reduced image\n        lower = get_line(fy1, required_red, provided_input, input);\n        upper = get_line(fy2, required_red, provided_input, input);\n        // Compute line\n        unsigned char *dest = lbuffer+1;\n        const short *deltas = & interp[fy&FRACMASK][256];\n        for(unsigned char const * const edest=(unsigned char const *)dest+bufw;\n          dest<edest;upper++,lower++,dest++)\n        {\n          const int l = *lower;\n          const int u = *upper;\n          *dest = l + deltas[u-l];\n        }\n      }\n      // Perform horizontal interpolation\n      {\n        // Prepare for side effects\n        lbuffer[0]   = lbuffer[1];\n        lbuffer[bufw+1] = lbuffer[bufw];\n        unsigned char *line = lbuffer+1-required_red.xmin;\n        unsigned char *dest  = output[y-desired_output.ymin];\n        // Loop horizontally\n        for (int x=desired_output.xmin; x<desired_output.xmax; x++)\n          {\n            int n = hcoord[x];\n            const unsigned char *lower = line + (n>>FRACBITS);\n            const short *deltas = &interp[n&FRACMASK][256];\n            int l = lower[0];\n            int u = lower[1];\n            *dest = l + deltas[u-l];\n            dest++;\n          }\n      }\n    }\n  // Free temporaries\n  gp1.resize(0);\n  gp2.resize(0);\n  glbuffer.resize(0);\n  gconv.resize(0);\n}\n\n\n\n\n\n\n////////////////////////////////////////\n// GPIXMAPSCALER\n\n\nGPixmapScaler::GPixmapScaler()\n  : glbuffer(lbuffer,0), \n    gp1(p1,0), \n    gp2(p2,0)\n{\n}\n\n\nGPixmapScaler::GPixmapScaler(int inw, int inh, int outw, int outh)\n  : glbuffer(lbuffer,0), \n    gp1(p1,0), \n    gp2(p2,0)\n{\n  set_input_size(inw, inh);\n  set_output_size(outw, outh);\n}\n\n\nGPixmapScaler::~GPixmapScaler()\n{\n}\n\n\nGPixel *\nGPixmapScaler::get_line(int fy, \n                        const GRect &required_red, \n                        const GRect &provided_input,\n                        const GPixmap &input )\n{\n  if (fy < required_red.ymin)\n    fy = required_red.ymin; \n  else if (fy >= required_red.ymax)\n    fy = required_red.ymax - 1;\n  // Cached line\n  if (fy == l2)\n    return p2;\n  if (fy == l1)\n    return p1;\n  // Shift\n  GPixel *p=p1;\n  p1 = p2;\n  l1 = l2;\n  p2 = p;\n  l2 = fy;\n  // Compute location of line\n  GRect line;\n  line.xmin = required_red.xmin << xshift;\n  line.xmax = required_red.xmax << xshift;\n  line.ymin = fy << yshift;\n  line.ymax = (fy+1) << yshift;\n  line.intersect(line, provided_input);\n  line.translate(-provided_input.xmin, -provided_input.ymin);\n  // Prepare variables\n  const GPixel *botline = input[line.ymin];\n  int rowsize = input.rowsize();\n  int sw = 1<<xshift;\n  int div = xshift+yshift;\n  int rnd = 1<<(div-1);\n  // Compute averages\n  for (int x=line.xmin; x<line.xmax; x+=sw,p++)\n    {\n      int r=0, g=0, b=0, s=0;\n      const GPixel *inp0 = botline + x;\n      int sy1 = mini(line.height(), (1<<yshift));\n      for (int sy=0; sy<sy1; sy++,inp0+=rowsize)\n        {\n\t  const GPixel *inp1;\n\t  const GPixel *inp2 = inp0 + mini(x+sw, line.xmax) - x;\n          for (inp1 = inp0; inp1<inp2; inp1++)\n            {\n              r += inp1->r;  \n              g += inp1->g;  \n              b += inp1->b; \n              s += 1;\n            }\n        }\n      if (s == rnd+rnd)\n        {\n          p->r = (r+rnd) >> div;\n          p->g = (g+rnd) >> div;\n          p->b = (b+rnd) >> div;\n        }\n      else\n        {\n          p->r = (r+s/2)/s;\n          p->g = (g+s/2)/s;\n          p->b = (b+s/2)/s;\n        }\n    }\n  // Return\n  return (GPixel *)p2;\n}\n\n\nvoid \nGPixmapScaler::scale( const GRect &provided_input, const GPixmap &input,\n                      const GRect &desired_output, GPixmap &output )\n{\n  // Compute rectangles\n  GRect required_input; \n  GRect required_red;\n  make_rectangles(desired_output, required_red, required_input);\n  // Parameter validation\n  if (provided_input.width() != (int)input.columns() ||\n      provided_input.height() != (int)input.rows() )\n    G_THROW( ERR_MSG(\"GScaler.no_match\") );\n  if (provided_input.xmin > required_input.xmin ||\n      provided_input.ymin > required_input.ymin ||\n      provided_input.xmax < required_input.xmax ||\n      provided_input.ymax < required_input.ymax  )\n    G_THROW( ERR_MSG(\"GScaler.too_small\") );\n  // Adjust output pixmap\n  if (desired_output.width() != (int)output.columns() ||\n      desired_output.height() != (int)output.rows() )\n    output.init(desired_output.height(), desired_output.width());\n  // Prepare temp stuff \n  gp1.resize(0);\n  gp2.resize(0);\n  glbuffer.resize(0);\n  prepare_interp();\n  const int bufw = required_red.width();\n  glbuffer.resize(bufw+2);\n  if (xshift>0 || yshift>0)\n    {\n      gp1.resize(bufw);\n      gp2.resize(bufw);\n      l1 = l2 = -1;\n    }\n  // Loop on output lines\n  for (int y=desired_output.ymin; y<desired_output.ymax; y++)\n    {\n      // Perform vertical interpolation\n      {\n        int fy = vcoord[y];\n        int fy1 = fy>>FRACBITS;\n        int fy2 = fy1+1;\n        const GPixel *lower, *upper;\n        // Obtain upper and lower line in reduced image\n        if (xshift>0 || yshift>0)\n          {\n            lower = get_line(fy1, required_red, provided_input, input);\n            upper = get_line(fy2, required_red, provided_input, input);\n          }\n        else\n          {\n            int dx = required_red.xmin-provided_input.xmin;\n            fy1 = maxi(fy1, required_red.ymin);\n            fy2 = mini(fy2, required_red.ymax-1);\n            lower = input[fy1-provided_input.ymin] + dx;\n            upper = input[fy2-provided_input.ymin] + dx;\n          }\n        // Compute line\n        GPixel *dest = lbuffer+1;\n        const short *deltas = & interp[fy&FRACMASK][256];\n        for(GPixel const * const edest = (GPixel const *)dest+bufw;\n          dest<edest;upper++,lower++,dest++)\n        {\n          const int lower_r = lower->r;\n          const int delta_r = deltas[(int)upper->r - lower_r];\n          dest->r = lower_r + delta_r;\n          const int lower_g = lower->g;\n          const int delta_g = deltas[(int)upper->g - lower_g];\n          dest->g = lower_g + delta_g;\n          const int lower_b = lower->b;\n          const int delta_b = deltas[(int)upper->b - lower_b];\n          dest->b = lower_b + delta_b;\n        }\n      }\n      // Perform horizontal interpolation\n      {\n        // Prepare for side effects\n        lbuffer[0]   = lbuffer[1];\n        lbuffer[bufw+1] = lbuffer[bufw];\n        GPixel *line = lbuffer+1-required_red.xmin;\n        GPixel *dest  = output[y-desired_output.ymin];\n        // Loop horizontally\n        for (int x=desired_output.xmin; x<desired_output.xmax; x++,dest++)\n          {\n            const int n = hcoord[x];\n            const GPixel *lower = line + (n>>FRACBITS);\n            const short *deltas = &interp[n&FRACMASK][256];\n            const int lower_r = lower[0].r;\n            const int delta_r = deltas[(int)lower[1].r - lower_r];\n            dest->r = lower_r + delta_r;\n            const int lower_g = lower[0].g;\n            const int delta_g = deltas[(int)lower[1].g - lower_g];\n            dest->g = lower_g + delta_g;\n            const int lower_b = lower[0].b;\n            const int delta_b = deltas[(int)lower[1].b - lower_b];\n            dest->b = lower_b + delta_b;\n          }\n      }\n    }\n  // Free temporaries\n  gp1.resize(0);\n  gp2.resize(0);\n  glbuffer.resize(0);\n}\n\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/GScaler.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _GSCALER_H_\n#define _GSCALER_H_\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n// From: Leon Bottou, 1/31/2002\n// Almost equal to my initial code.\n\n#include \"GException.h\"\n#include \"GRect.h\"\n#include \"GBitmap.h\"\n#include \"GPixmap.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n/** @name GScaler.h \n\n    Files #\"GScaler.h\"# and #\"GScaler.cpp\"# implement a fast bilinear\n    interpolation scheme to rescale a \\Ref{GBitmap} or a \\Ref{GPixmap}.\n    Common setup functions are implemented by the base class \\Ref{GScaler}.\n    The actual function for rescaling a gray level image is implemented by\n    class \\Ref{GBitmapScaler}.  The actual function for rescaling a color\n    image is implemented by class \\Ref{GPixmapScaler}.\n\n    {\\bf Remark} --- The bilinear interpolation code relies on fixed precision\n    tables.  It becomes suboptimal when upsampling (i.e. zooming into) an\n    image by a factor greater than eight.  High contrast images displayed at\n    high magnification may contain visible jaggies.\n\n    @memo\n    Rescaling images with bilinear interpolation.\n    @author\n    L\\'eon Bottou <leonb@research.att.com>\n*/\n//@{\n\n\n/** Base class for GBitmapScaler and GPixmapScaler.  This base class\n    implements the common elements of class \\Ref{GBitmapScaler} and\n    \\Ref{GPixmapScaler}.  Functions \\Ref{set_input_size} and\n    \\Ref{set_output_size} are used to specify the size of the input image and\n    the size of the output image.  Functions \\Ref{set_horz_ratio} and\n    \\Ref{set_vert_ratio} may be used to override the scaling ratios computed\n    from the image sizes.  You can then call function \\Ref{get_input_rect} to\n    know which pixels of the input image are necessary to compute a specified\n    rectangular zone of the output image.  The actual computation is then\n    performed by calling function #scale# in class \\Ref{GBitmapScaler} and\n    \\Ref{GPixmapScaler}.  \n*/\nclass DJVUAPI GScaler  : public GPEnabled\n{\nprotected:  \n  GScaler();\npublic:\n  virtual ~GScaler();\n  /** Sets the size of the input image. Argument #w# (resp. #h#) contains the\n      horizontal (resp. vertical) size of the input image.  This size is used\n      to initialize the internal data structures of the scaler object. */\n  void set_input_size(int w, int h);\n  /** Sets the size of the output image. Argument #w# (resp. #h#) contains the\n      horizontal (resp. vertical) size of the output image. This size is used\n      to initialize the internal data structures of the scaler object. */\n  void set_output_size(int w, int h);\n  /** Sets the horizontal scaling ratio #numer/denom#.  This function may be\n      used to force an exact scaling ratio.  The scaling ratios are otherwise\n      derived from the sizes of the input and output images. */\n  void set_horz_ratio(int numer, int denom);\n  /** Sets the vertical scaling ratio to #numer/denom#.  This function may be\n      used to force an exact scaling ratio.  The scaling ratios are otherwise\n      derived from the sizes of the input and output images. */\n  void set_vert_ratio(int numer, int denom);\n  /** Computes which input pixels are required to compute specified output\n      pixels.  Let us assume that we only need a part of the output\n      image. This part is defined by rectangle #desired_output#.  Only a part\n      of the input image is necessary to compute the output pixels.  Function\n      #get_input_rect# computes the coordinates of that part of the input\n      image, and stores them into rectangle #required_input#.  */\n  void get_input_rect( const GRect &desired_output, GRect &required_input );\nprotected:\n  // The sizes\n  int inw, inh;\n  int xshift, yshift;\n  int redw, redh;\n  int outw, outh;\n  // Fixed point coordinates\n  int *vcoord;\n  GPBuffer<int> gvcoord;\n  int *hcoord;\n  GPBuffer<int> ghcoord;\n  // Helper\n  void make_rectangles(const GRect &desired, GRect &red, GRect &inp);\n};\n\n\n\n/** Fast rescaling code for gray level images.  This class augments the base\n    class \\Ref{GScaler} with a function for rescaling gray level\n    images.  Function \\Ref{GBitmapScaler::scale} computes an arbitrary segment\n    of the output image given the corresponding pixels in the input image.\n\n    {\\bf Example} --- The following functions returns an gray level image\n    (sixteen gray levels, size #nw# by #nh#) containing a rescaled version of\n    the input image #in#.\n    \\begin{verbatim}\n    GBitmap *rescale_bitmap(const GBitmap &in, int nw, int nh)\n    {\n      int w = in.columns();       // Get input width\n      int h = in.raws();          // Get output width\n      GBitmapScaler scaler(w,h,nw,nh);  // Creates bitmap scaler\n      GRect desired(0,0,nw,nh);   // Desired output = complete bitmap\n      GRect provided(0,0,w,h);    // Provided input = complete bitmap\n      GBitmap *out = new GBitmap;\n      scaler.scale(provided, in, desired, *out);  // Rescale\n      out->change_grays(16);      // Reduce to 16 gray levels\n      return out;\n    }\n    \\end{verbatim} */\nclass DJVUAPI GBitmapScaler : public GScaler\n{\nprotected:\n  GBitmapScaler(void);\n  GBitmapScaler(int inw, int inh, int outw, int outh);\npublic:\n  /// Virtual destructor.\n  virtual ~GBitmapScaler();\n\n  /** Creates an empty GBitmapScaler. You must call functions\n      \\Ref{GScaler::set_input_size} and \\Ref{GScaler::set_output_size} before\n      calling any of the scaling functions. */\n  static GP<GBitmapScaler> create(void) {return new GBitmapScaler(); }\n\n  /** Creates a GBitmapScaler. The size of the input image is given by\n      #inw# and #inh#.  This function internally calls\n      \\Ref{GScaler::set_input_size} and \\Ref{GScaler::set_output_size}. The\n      size of the output image is given by #outw# and #outh#.  . */\n  static GP<GBitmapScaler> create(\n    const int inw, const int inh, const int outw, const int outh)\n  { return new GBitmapScaler(inw,inh,outw,outh); }\n\n  /** Computes a segment of the rescaled output image.  The GBitmap object\n      #output# is overwritten with the segment of the output image specified\n      by the rectangle #desired_output#.  The rectangle #provided_input#\n      specifies which segment of the input image is provided by the GBitmap\n      object #input#.  An exception \\Ref{GException} is thrown if the\n      rectangle #provided_input# is smaller then the rectangle\n      #required_input# returned by function \\Ref{GScaler::get_input_rect}.\n      Note that the output image always contain 256 gray levels. You may want\n      to use function \\Ref{GBitmap::change_grays} to reduce the number of gray\n      levels. */\n  void scale( const GRect &provided_input, const GBitmap &input,\n              const GRect &desired_output, GBitmap &output );\nprotected:\n  // Helpers\n  unsigned char *get_line(int, const GRect &, const GRect &, const GBitmap &);\n  // Temporaries\n  unsigned char *lbuffer;\n  GPBuffer<unsigned char> glbuffer;\n  unsigned char *conv;\n  GPBuffer<unsigned char> gconv;\n  unsigned char *p1;\n  GPBuffer<unsigned char> gp1;\n  unsigned char *p2;\n  GPBuffer<unsigned char> gp2;\n  int l1;\n  int l2;\n};\n\n\n/** Fast rescaling code for color images.  This class augments the base class\n    \\Ref{GScaler} with a function for rescaling color images.  Function\n    \\Ref{GPixmapScaler::scale} computes an arbitrary segment of the output\n    image given the corresponding pixels in the input image.\n\n    {\\bf Example} --- The following functions returns a color image\n    of size #nw# by #nh# containing a rescaled version of\n    the input image #in#.\n    \\begin{verbatim}\n    GPixmap *rescale_pixmap(const GPixmap &in, int nw, int nh)\n    {\n      int w = in.columns();       // Get input width\n      int h = in.raws();          // Get output width\n      GPixmapScaler scaler(w,h,nw,nh);  // Creates bitmap scaler\n      GRect desired(0,0,nw,nh);   // Desired output = complete image\n      GRect provided(0,0,w,h);    // Provided input = complete image\n      GPixmap *out = new GPixmap;\n      scaler.scale(provided, in, desired, *out);  // Rescale\n      return out;\n    }\n    \\end{verbatim}\n\n */\nclass DJVUAPI GPixmapScaler : public GScaler\n{\nprotected:\n  GPixmapScaler(void);\n  GPixmapScaler(int inw, int inh, int outw, int outh);\npublic:\n  /// Virtual destructor.\n  virtual ~GPixmapScaler();\n\n  /** Creates an empty GPixmapScaler. You must call functions\n      \\Ref{GScaler::set_input_size} and \\Ref{GScaler::set_output_size} before\n      calling any of the scaling functions. */\n  static GP<GPixmapScaler> create(void) {return new GPixmapScaler(); }\n\n  /** Creates a GPixmapScaler. The size of the input image is given by\n      #inw# and #inh#.  This function internally calls\n      \\Ref{GScaler::set_input_size} and \\Ref{GScaler::set_output_size}. The\n      size of the output image is given by #outw# and #outh#.  . */\n  static GP<GPixmapScaler> create(\n    const int inw, const int inh, const int outw, const int outh)\n  { return new GPixmapScaler(inw,inh,outw,outh); }\n\n  /** Computes a segment of the rescaled output image.  The pixmap #output# is\n      overwritten with the segment of the output image specified by the\n      rectangle #desired_output#.  The rectangle #provided_input# specifies\n      which segment of the input image is provided in the pixmap #input#.  An\n      exception \\Ref{GException} is thrown if the rectangle #provided_input#\n      is smaller then the rectangle #required_input# returned by function\n      \\Ref{GScaler::get_input_rect}. */\n  void scale( const GRect &provided_input, const GPixmap &input,\n              const GRect &desired_output, GPixmap &output );\nprotected:\n  // Helpers\n  GPixel *get_line(int, const GRect &, const GRect &, const GPixmap &);\n  // Temporaries\n  GPixel *lbuffer;\n  GPBuffer<GPixel> glbuffer;\n  GPixel *p1;\n  GPBuffer<GPixel> gp1;\n  GPixel *p2;\n  GPBuffer<GPixel> gp2;\n  int    l1;\n  int    l2;\n};\n\n\n\n\n\n//@}\n    \n\n\n\n// -------- END\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/GSmartPointer.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n// - Author: Leon Bottou, 05/1997\n\n// From: Leon Bottou, 1/31/2002\n// Class GPBuffer has been added (but not documented) by Lizardtech.\n// Our original implementation consisted of multiple classes.\n// <http://prdownloads.sourceforge.net/djvu/DjVu2_2b-src.tgz>.\n\n#include <stddef.h>\n#include <string.h>\n#if PARANOID_DEBUG\n# include <assert.h>\n#endif\n\n#include \"GThreads.h\"\n#include \"GSmartPointer.h\"\n#include \"GException.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n// ------ GPENABLED\n\nGPEnabled::~GPEnabled()\n{\n  if (count > 0)\n    G_THROW( ERR_MSG(\"GSmartPointer.suspicious\") );\n}\n\nvoid\nGPEnabled::destroy()\n{\n  // Only delete if the counter is still zero.\n  // because someone may have rescued the object...\n  // If yes, set the counter to -0x7fff to mark \n  // the object as doomed and make sure things\n  // will work if the destructor uses a GP...\n  if (atomicCompareAndSwap(&count, 0, -0x7fff))\n    delete this;\n}\n\n\n// ------ GPBASE\n\n\n#define LOCKMASK 0x3f\n#define LOCKIDX(addr) ((((size_t)(addr))/sizeof(void*))&LOCKMASK)\nstatic int volatile locks[LOCKMASK+1];\n\n\nGPBase&\nGPBase::assign (const GPBase &sptr)\n{\n  int volatile *lockb = locks+LOCKIDX(&sptr);\n  atomicAcquireOrSpin(lockb);\n  GPEnabled *nptr = sptr.ptr;\n  if (nptr)\n    nptr->ref();\n  atomicRelease(lockb);\n  int volatile *locka = locks+LOCKIDX(this);\n  atomicAcquireOrSpin(locka);\n  GPEnabled *old = ptr;\n  ptr = nptr;\n  atomicRelease(locka);\n  if (old)\n    old->unref();\n  return *this;\n}\n\nGPBase&\nGPBase::assign (GPEnabled *nptr)\n{\n  if (nptr)\n    nptr->ref();\n  int volatile *locka = locks+LOCKIDX(this);\n  atomicAcquireOrSpin(locka);\n  GPEnabled *old = ptr;\n  ptr = nptr;\n  atomicRelease(locka);\n  if (old)\n    old->unref();\n  return *this;\n}\n\n\n\n\n// ------ GPBUFFERBASE\n\n\nvoid\nGPBufferBase::replace(void *nptr,const size_t n)\n{\n  resize(0,0);\n  ptr=nptr;\n  num=n;\n}\n\nGPBufferBase::GPBufferBase(void *&xptr,const size_t n,const size_t t) \n  : ptr(xptr), num(n)\n{\n  if (n)\n    xptr = ::operator new(n*t);\n  else\n    xptr = 0;\n}\n\nGPBufferBase::~GPBufferBase()\n{\n  ::operator delete(ptr);\n}\n\nvoid \nGPBufferBase::swap(GPBufferBase &other)\n{\n  void * const temp_ptr=ptr;\n  ptr=other.ptr;\n  other.ptr=temp_ptr;\n  const size_t temp_num=num;\n  num=other.num;\n  other.num=temp_num;\n}\n\nvoid\nGPBufferBase::resize(const size_t n, const size_t t)\n{\n  if(!n && !ptr)\n    {\n      num=0;\n    }\n  else\n    {\n      const size_t s=ptr?(((num<n)?num:n)*t):0;\n      void *nptr;\n      GPBufferBase gnptr(nptr, n, t);\n      if(s)\n        {\n          memcpy(nptr, ptr, s);\n        }\n      swap(gnptr);\n    }\n}\n\nvoid\nGPBufferBase::set(const size_t t,const char c)\n{\n  if(num)\n    memset(ptr,c,num*t);\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/GSmartPointer.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _GSMARTPOINTER_H_\n#define _GSMARTPOINTER_H_\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n/** @name GSmartPointer.h\n\n    Files #\"GSmartPointer.h\"# and #\"GSmartPointer.cpp\"# define a smart-pointer\n    class which automatically performs thread-safe reference counting.  Class\n    \\Ref{GP} implements smart-pointers by overloading the usual pointer\n    assignment and dereferencing operators. The overloaded operators maintain\n    the reference counters and destroy the pointed objects as soon as their\n    reference counter reaches zero.  Transparent type conversions are provided\n    between smart-pointers and regular pointers.  Objects referenced by\n    smart-pointers must be derived from class \\Ref{GPEnabled}.\n\n    @memo \n    Thread-Safe reference counting smart-pointers.\n    @author \n    L\\'eon Bottou <leonb@research.att.com> -- initial implementation\\\\\n    Andrei Erofeev <eaf@geocities.com> -- bug fix.\n\n// From: Leon Bottou, 1/31/2002\n// Class GPBuffer has been added (but not documented) by Lizardtech.\n// Our original implementation consisted of multiple classes.\n// <http://prdownloads.sourceforge.net/djvu/DjVu2_2b-src.tgz>.\n\n    @args\n*/\n//@{\n\n#if defined(_MSC_VER)\n// Language lawyer say MSVC6 is wrong on that one. \n// Cf section 5.4.7 in november 1997 draft.\n#pragma warning( disable : 4243 )\n#endif\n\n#include \"DjVuGlobal.h\"\n#include \"atomic.h\"\n\n#include <stddef.h>\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n\n/** Base class for reference counted objects.  \n    This is the base class for all reference counted objects.\n    Any instance of a subclass of #GPEnabled# can be used with \n    smart-pointers (see \\Ref{GP}).  \n */\nclass DJVUAPI GPEnabled\n{\n  friend class GPBase;\n  void destroy();\n  void unref();\n  void ref();\npublic:\n  /// Null constructor.\n  GPEnabled();\n  /// Copy construcotr\n  GPEnabled(const GPEnabled & obj);\n  /// Virtual destructor.\n  virtual ~GPEnabled();\n  /// Copy operator\n  GPEnabled & operator=(const GPEnabled & obj);\n  /** Returns the number of references to this object.  This should be only\n      used for debugging purposes. Other uses are not thread-safe. */\n  int get_count(void) const;\nprotected:\n  /// The reference counter\n  volatile int count;\n};\n\n\n\n/** Base class for all smart-pointers.\n    This class implements common mechanisms for all\n    smart-pointers (see \\Ref{GP}). There should be no need\n    to use this class directly.  Its sole purpose consists\n    in reducing the template expansion overhead.\n*/\n\nclass DJVUAPI GPBase\n{\npublic:\n  /** Null Constructor. */\n  GPBase();\n  /** Copy Constructor.\n      Increments the reference count. \n      @param sptr reference to a #GPBase# object. */\n  GPBase(const GPBase &sptr);\n  /** Construct a GPBase from a pointer.\n      Increments the reference count.\n      @param nptr pointer to a #GPEnabled# object. */\n  GPBase(GPEnabled *nptr);\n  /** Destructor. Decrements the reference count. */\n  ~GPBase();\n  /** Accesses the actual pointer. */\n  GPEnabled* get() const;\n  /** Assignment from smartpointer. \n      Increments the counter of the new value of the pointer.\n      Decrements the counter of the previous value of the pointer. */\n  GPBase& assign(const GPBase &sptr);\n  /** Assignment from pointer. \n      Checks that the object is not being destroyed.\n      Increments the counter of the new value of the pointer.\n      Decrements the counter of the previous value of the pointer. */\n  GPBase& assign(GPEnabled *nptr);\n  /** Assignment operator. */\n  GPBase & operator=(const GPBase & obj);\n  /** Comparison operator. */\n  int operator==(const GPBase & g2) const;\nprotected:\n  /** Actual pointer */\n  GPEnabled *ptr;\n};\n\n\n/** Reference counting pointer.\n    Class #GP<TYPE># represents a smart-pointer to an object of type #TYPE#.\n    Type #TYPE# must be a subclass of #GPEnabled#.  This class overloads the\n    usual pointer assignment and dereferencing operators. The overloaded\n    operators maintain the reference counters and destroy the pointed object\n    as soon as their reference counter reaches zero.  Transparent type\n    conversions are provided between smart-pointers and regular pointers.\n\n    Using a smart-pointer is a convenience and not an obligation.  There is no\n    need to use a smart-pointer to access a #GPEnabled# object.  As long as\n    you never use a smart-pointer to access a #GPEnabled# object, its\n    reference counter remains zero.  Since the reference counter is never\n    decremented from one to zero, the object is never destroyed by the\n    reference counting code.  You can therefore choose to only use regular\n    pointers to access objects allocated on the stack (automatic variables) or\n    objects allocated dynamically.  In the latter case you must explicitly\n    destroy the dynamically allocated object with operator #delete#.\n\n    The first time you use a smart-pointer to access #GPEnabled# object, the\n    reference counter is incremented to one. Object destruction will then\n    happen automatically when the reference counter is decremented back to\n    zero (i.e. when the last smart-pointer referencing \n    this object stops doing so).\n    This will happen regardless of how many regular pointers \n    reference this object.\n    In other words, if you start using smart-pointers with a #GPEnabled#\n    object, you engage automatic mode for this object.  You should only do\n    this with objects dynamically allocated with operator #new#.  You should\n    never destroy the object yourself, but let the smart-pointers control the\n    life of the object.\n    \n    {\\bf Performance considerations} --- Thread safe reference counting incurs\n    a significant overhead. Smart-pointer are best used with sizeable objects\n    for which the cost of maintaining the counters represent a small fraction\n    of the processing time.  It is always possible to cache a smart-pointer\n    into a regular pointer.  The cached pointer will remain valid until the\n    smart-pointer object is destroyed or the smart-pointer value is changed.\n\n    {\\bf Safety considerations} --- As explained above, a #GPEnabled# object\n    switches to automatic mode as soon as it becomes referenced by a\n    smart-pointer.  There is no way to switch the object back to manual mode.\n    Suppose that you have decided to only use regular pointers with a\n    particular #GPEnabled# object.  You therefore plan to destroy the object\n    explicitly when you no longer need it.  When you pass a regular pointer to\n    this object as argument to a function, you really need to be certain that\n    the function implementation will not assign this pointer to a\n    smart-pointer.  Doing so would indeed destroy the object as soon as the\n    function returns.  The bad news is that the fact that a function assigns a\n    pointer argument to a smart-pointer does not necessarily appear in the\n    function prototype.  Such a behavior must be {\\em documented} with the\n    function public interface.  As a convention, we usually write such\n    functions with smart-pointer arguments instead of a regular pointer\n    arguments.  This is not enough to catch the error at compile time, but\n    this is a simple way to document such a behavior.  We still believe that\n    this is a small problem in regard to the benefits of the smart-pointer.\n    But one has to be aware of its existence.  */\n\ntemplate <class TYPE>\nclass GP : protected GPBase\n{\npublic:\n  /** Constructs a null smart-pointer. */\n  GP();\n  /** Constructs a copy of a smart-pointer.\n      @param sptr smart-pointer to copy. */\n  GP(const GP<TYPE> &sptr);\n  /** Constructs a smart-pointer from a regular pointer.\n      The pointed object must be dynamically allocated (with operator #new#).\n      You should no longer explicitly destroy the object referenced by #sptr#\n      since the object life is now controlled by smart-pointers.  \n      @param nptr regular pointer to a {\\em dynamically allocated object}. */\n  GP(TYPE *nptr);\n  /** Converts a smart-pointer into a regular pointer.  \n      This is useful for caching the value of a smart-pointer for performances\n      purposes.  The cached pointer will remain valid until the smart-pointer\n      is destroyed or until the smart-pointer value is changed. */\n  operator TYPE* () const;\n  /** Assigns a regular pointer to a smart-pointer lvalue.\n      The pointed object must be dynamically allocated (with operator #new#).\n      You should no longer explicitly destroy the object referenced by #sptr#\n      since the object life is now controlled by smart-pointers.  \n      @param nptr regular pointer to a {\\em dynamically allocated object}. */\n  GP<TYPE>& operator= (TYPE *nptr);\n  /** Assigns a smart-pointer to a smart-pointer lvalue.\n      @param sptr smart-pointer copied into this smart-pointer. */\n  GP<TYPE>& operator= (const GP<TYPE> &sptr);\n  /** Indirection operator.\n      This operator provides a convenient access to the members\n      of a smart-pointed object. Operator #-># works with smart-pointers\n      exactly as with regular pointers. */\n  TYPE* operator->() const;\n  /** Dereferencement operator.\n      This operator provides a convenient access to the smart-pointed object. \n      Operator #*# works with smart-pointers exactly as with regular pointers. */\n  TYPE& operator*() const;\n  /** Comparison operator. \n      Returns true if both this smart-pointer and pointer #nptr# point to the\n      same object.  The automatic conversion from smart-pointers to regular\n      pointers allows you to compare two smart-pointers as well.  \n      @param nptr pointer to compare with. */\n  int operator== (TYPE *nptr) const;\n  /** Comparison operator.  \n      Returns true if this smart-pointer and pointer #nptr# point to different\n      objects. The automatic conversion from smart-pointers to regular\n      pointers allows you to compare two smart-pointers as well.  \n      @param nptr pointer to compare with. */\n  int operator!= (TYPE *nptr) const;\n  /** Test operator.\n      Returns true if the smart-pointer is null.  The automatic conversion \n      from smart-pointers to regular pointers allows you to test whether \n      a smart-pointer is non-null.  You can use both following constructs:\n      \\begin{verbatim}\n      if (gp) { ... }\n      while (! gp) { ... }\n      \\end{verbatim} */\n  int operator! () const;\n};\n\n//@}\n\n// INLINE FOR GPENABLED\n\ninline\nGPEnabled::GPEnabled()\n  : count(0)\n{\n}\n\ninline\nGPEnabled::GPEnabled(const GPEnabled & obj) \n  : count(0) \n{\n\n}\n\ninline int\nGPEnabled::get_count(void) const\n{\n   return count;\n}\n\ninline GPEnabled & \nGPEnabled::operator=(const GPEnabled & obj)\n{ \n  /* The copy operator should do nothing because the count should not be\n     changed.  Subclasses of GPEnabled will call this version of the copy\n     operator as part of the default 'memberwise copy' strategy. */\n  return *this; \n}\n\ninline void \nGPEnabled::ref()\n{\n#if PARANOID_DEBUG\n  assert (count >= 0);\n#endif\n  atomicIncrement(&count);\n}\n\ninline void \nGPEnabled::unref()\n{\n#if PARANOID_DEBUG\n  assert (count > 0);\n#endif\n  if (! atomicDecrement(&count))\n    destroy();\n}\n\n// INLINE FOR GPBASE\n\ninline\nGPBase::GPBase()\n  : ptr(0)\n{\n}\n\ninline\nGPBase::GPBase(GPEnabled *nptr)\n  : ptr(0)\n{\n  assign(nptr);\n}\n\ninline\nGPBase::GPBase(const GPBase &sptr)\n{\n  if (sptr.ptr)\n    sptr.ptr->ref();\n  ptr = sptr.ptr;\n}\n\ninline\nGPBase::~GPBase()\n{\n  GPEnabled *old = ptr;\n  ptr = 0;\n  if (old)\n    old->unref();\n}\n\ninline GPEnabled* \nGPBase::get() const\n{\n#if PARANOID_DEBUG\n  if (ptr && ptr->get_count() <= 0)\n    *(int*)0=0;\n#endif\n  return ptr;\n}\n\ninline GPBase &\nGPBase::operator=(const GPBase & obj)\n{\n  return assign(obj);\n}\n\ninline int \nGPBase::operator==(const GPBase & g2) const\n{\n  return ptr == g2.ptr;\n}\n\n\n\n\n// INLINE FOR GP<TYPE>\n\ntemplate <class TYPE> inline\nGP<TYPE>::GP()\n{\n}\n\ntemplate <class TYPE> inline\nGP<TYPE>::GP(TYPE *nptr)\n: GPBase((GPEnabled*)nptr)\n{\n}\n\ntemplate <class TYPE> inline\nGP<TYPE>::GP(const GP<TYPE> &sptr)\n: GPBase((const GPBase&) sptr)\n{\n}\n\ntemplate <class TYPE> inline\nGP<TYPE>::operator TYPE* () const\n{\n  return (TYPE*) ptr;\n}\n\ntemplate <class TYPE> inline TYPE*\nGP<TYPE>::operator->() const\n{\n#if PARANOID_DEBUG\n  if (ptr && ptr->get_count() <= 0)\n    *(int*)0=0;\n#endif\n  return (TYPE*) ptr;\n}\n\ntemplate <class TYPE> inline TYPE&\nGP<TYPE>::operator*() const\n{\n#if PARANOID_DEBUG\n  if (ptr && ptr->get_count() <= 0)\n    *(int*)0=0;\n#endif\n  return *(TYPE*) ptr;\n}\n\ntemplate <class TYPE> inline GP<TYPE>& \nGP<TYPE>::operator= (TYPE *nptr)\n{\n  return (GP<TYPE>&)( assign(nptr) );\n}\n\ntemplate <class TYPE> inline GP<TYPE>& \nGP<TYPE>::operator= (const GP<TYPE> &sptr)\n{\n  return (GP<TYPE>&)( assign((const GPBase&)sptr) );\n}\n\ntemplate <class TYPE> inline int\nGP<TYPE>::operator== (TYPE *nptr) const\n{\n  return ( (TYPE*)ptr == nptr );\n}\n\ntemplate <class TYPE> inline int\nGP<TYPE>::operator!= (TYPE *nptr) const\n{\n  return ( (TYPE*)ptr != nptr );\n}\n\ntemplate <class TYPE> inline int\nGP<TYPE>::operator! () const\n{\n  return !ptr;\n}\n\n/* GPBUFFER */\n\n/* What is this LT innovation ? \n   What does it do that a GArray does not do ? \n   What about the objects construction and destruction ? */\n\nclass DJVUAPI GPBufferBase\n{\npublic:\n  GPBufferBase(void *&,const size_t n,const size_t t);\n  void swap(GPBufferBase &p);\n  void resize(const size_t n,const size_t t);\n  void replace(void *nptr,const size_t n);\n  void set(const size_t t,const char c);\n  ~GPBufferBase();\n  operator int(void) const { return ptr ? num : 0; }\nprivate:\n  void *&ptr;\n  size_t num;\n};\n\ntemplate<class TYPE>\nclass GPBuffer : public GPBufferBase\n{\npublic:\n  GPBuffer(TYPE *&xptr,const size_t n=0) \n    : GPBufferBase((void *&)xptr,n,sizeof(TYPE)) {}\n  inline void resize(const size_t n) {GPBufferBase::resize(n,sizeof(TYPE));}\n  inline void clear(void) {GPBufferBase::set(sizeof(TYPE),0);}\n  inline void set(const char c) {GPBufferBase::set(sizeof(TYPE),c);}\n  inline operator int(void) const {return GPBufferBase::operator int();}\n};\n\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/GString.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n// From: Leon Bottou, 1/31/2002\n// This file has very little to do with my initial implementation.\n// It has been practically rewritten by Lizardtech for i18n changes.\n// My original implementation was very small in comparison\n// <http://prdownloads.sourceforge.net/djvu/DjVu2_2b-src.tgz>.\n// In my opinion, the duplication of the string classes is a failed\n// attempt to use the type system to enforce coding policies.\n// This could be fixed.  But there are better things to do in djvulibre.\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"GString.h\"\n#include \"GThreads.h\"\n#include \"debug.h\"\n\n#include <stddef.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#if HAS_WCHAR\n# include <locale.h>\n# if !defined(AUTOCONF) || HAVE_WCHAR_H\n#  include <wchar.h>\n# endif\n# if HAS_WCTYPE\n#  include <wctype.h>\n# endif\n#endif\n#include <ctype.h>\n\n#ifndef DO_CHANGELOCALE\n#define DO_CHANGELOCALE 1\n#ifdef UNIX\n#if THREADMODEL != COTHREADS\n#if THREADMODEL != NOTHREADS\n#undef DO_CHANGELOCALE\n#define DO_CHANGELOCALE 0\n#endif\n#endif \n#endif\n#endif\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\nGBaseString::~GBaseString() {}\nGNativeString::~GNativeString() {}\nGUTF8String::~GUTF8String() {}\n\n#if !HAS_MBSTATE && HAS_WCHAR\n// Under some systems, wctomb() and mbtowc() are not thread\n// safe.  In those cases, wcrtomb and mbrtowc are preferred.\n// For Solaris, wctomb() and mbtowc() are thread safe, and \n// wcrtomb() and mbrtowc() don't exist.\n\n#define wcrtomb MYwcrtomb\n#define mbrtowc MYmbrtowc\n#define mbrlen  MYmbrlen\n\nstatic inline int\nwcrtomb(char *bytes,wchar_t w,mbstate_t *)\n{\n  return wctomb(bytes,w);\n}\n\nstatic inline int\nmbrtowc(wchar_t *w,const char *source, size_t n, mbstate_t *)\n{\n  return mbtowc(w,source,n);\n}\n\nstatic inline size_t\nmbrlen(const char *s, size_t n, mbstate_t *)\n{\n  return mblen(s,n);\n}\n#endif // !HAS_MBSTATE || HAS_WCHAR\n\n\nGP<GStringRep>\nGStringRep::upcase(void) const\n{ return tocase(giswupper,gtowupper); }\n\nGP<GStringRep>\nGStringRep::downcase(void) const\n{ return tocase(giswlower,gtowlower); }\n\nGP<GStringRep>\nGStringRep::UTF8::create(const unsigned int sz)\n{\n  return GStringRep::create(sz,(GStringRep::UTF8 *)0);\n}\n\nGP<GStringRep>\nGStringRep::UTF8::create(const char *s)\n{\n  GStringRep::UTF8 dummy;\n  return dummy.strdup(s);\n}\n\nGP<GStringRep> \nGStringRep::UTF8::create(const GP<GStringRep> &s1,const GP<GStringRep> &s2)\n{\n  GStringRep::UTF8 dummy;\n  return dummy.concat(s1,s2);\n}\n\nGP<GStringRep> \nGStringRep::UTF8::create( const GP<GStringRep> &s1,const char *s2)\n{\n  GStringRep::UTF8 dummy;\n  return dummy.concat(s1,s2);\n}\n\nGP<GStringRep> \nGStringRep::UTF8::create( const char *s1, const GP<GStringRep> &s2)\n{\n  GStringRep::UTF8 dummy;\n  return dummy.concat(s1,s2);\n}\n\nGP<GStringRep> \nGStringRep::UTF8::create( const char *s1,const char *s2)\n{ \n  GStringRep::UTF8 dummy;\n  return dummy.concat(s1,s2);\n}\n\nGP<GStringRep> \nGStringRep::UTF8::create(const char *s,const int start,const int length)\n{\n  GStringRep::UTF8 dummy;\n  return dummy.substr(s,start,length);\n}\n\nGP<GStringRep> \nGStringRep::UTF8::create(\n  const uint16_t *s,const int start,const int length)\n{\n  GStringRep::UTF8 dummy;\n  return dummy.substr(s,start,length);\n}\n\nGP<GStringRep>\nGStringRep::UTF8::create(\n  const uint32_t *s,const int start,const int length)\n{\n  GStringRep::UTF8 dummy;\n  return dummy.substr(s,start,length);\n}\n\nGP<GStringRep> \nGStringRep::UTF8::blank(const unsigned int sz) const\n{\n   return GStringRep::create(sz,(GStringRep::UTF8 *)0);\n}\n\nbool\nGStringRep::UTF8::isUTF8(void) const\n{\n  return true;\n}\n\nGP<GStringRep> \nGStringRep::UTF8::toThis(\n    const GP<GStringRep> &rep,const GP<GStringRep> &) const\n{\n  return rep?(rep->toUTF8(true)):rep;\n}\n\nGP<GStringRep> \nGStringRep::UTF8::create(const char fmt[],va_list& args)\n{ \n  const GP<GStringRep> s(create(fmt));\n  return (s?(s->vformat(args)):s);\n}\n\n#if !HAS_WCHAR\n\n#define NATIVE_CREATE(x) UTF8::create( x );\n\n#ifdef LC_ALL\n#undef LC_ALL\n#endif\n#define LC_ALL 0\n\nclass GStringRep::ChangeLocale\n{\npublic:\n  ChangeLocale(const int,const char *) {}\n  ~ChangeLocale() {};\n};\n\nGP<GStringRep>\nGStringRep::NativeToUTF8( const char *s )\n{\n  return GStringRep::UTF8::create(s);\n}\n\n#else\n\n#define NATIVE_CREATE(x) Native::create( x );\n\n// The declaration and implementation of GStringRep::ChangeLocale\n// Not used in WinCE\n\nclass GStringRep::ChangeLocale\n{\npublic:\n  ChangeLocale(const int category,const char locale[]);\n  ~ChangeLocale();\nprivate:\n  GUTF8String locale;\n  int category;\n};\n\nclass GStringRep::Native : public GStringRep\n{\npublic:\n  // default constructor\n  Native(void);\n  // virtual destructor\n  virtual ~Native();\n\n    // Other virtual methods.\n      // Create an empty string.\n  virtual GP<GStringRep> blank(const unsigned int sz = 0) const;\n      // Append a string.\n  virtual GP<GStringRep> append(const GP<GStringRep> &s2) const;\n      // Test if Native.\n  virtual bool isNative(void) const;\n      // Convert to Native.\n  virtual GP<GStringRep> toNative(\n    const EscapeMode escape=UNKNOWN_ESCAPED) const;\n      // Convert to UTF8.\n  virtual GP<GStringRep> toUTF8(const bool nothrow=false) const;\n      // Convert to UTF8.\n  virtual GP<GStringRep> toThis(\n     const GP<GStringRep> &rep,const GP<GStringRep> &) const;\n      // Compare with #s2#.\n  virtual int cmp(const GP<GStringRep> &s2, const int len=(-1)) const;\n\n  // Convert strings to numbers.\n  virtual int toInt(void) const;\n  virtual long toLong(\n    const int pos, int &endpos, const int base=10) const;\n  virtual unsigned long toULong(\n    const int pos, int &endpos, const int base=10) const;\n  virtual double toDouble(\n    const int pos, int &endpos) const;\n\n    // Create an empty string\n  static GP<GStringRep> create(const unsigned int sz = 0);\n\n    // Create a strdup string.\n  static GP<GStringRep> create(const char *s);\n\n  // Creates by appending to the current string\n\n   // Creates with a concat operation.\n  static GP<GStringRep> create(\n    const GP<GStringRep> &s1,const GP<GStringRep> &s2);\n  static GP<GStringRep> create( const GP<GStringRep> &s1,const char *s2);\n  static GP<GStringRep> create( const char *s1, const GP<GStringRep> &s2);\n  static GP<GStringRep> create(const char *s1,const char *s2);\n\n    // Create with a strdup and substr operation.\n  static GP<GStringRep> create(\n    const char *s,const int start,const int length=(-1));\n  static GP<GStringRep> create(\n    const uint16_t *s,const int start,const int length=(-1));\n  static GP<GStringRep> create(\n    const uint32_t *s,const int start,const int length=(-1));\n\n    // Create with an sprintf()\n  static GP<GStringRep> create_format(const char fmt[],...);\n  static GP<GStringRep> create(const char fmt[],va_list &args);\n\n  virtual unsigned char *UCS4toString(\n    const uint32_t w,unsigned char *ptr, mbstate_t *ps=0) const;\n\n  // Tests if a string is legally encoded in the current character set.\n  virtual bool is_valid(void) const;\n\n  virtual int ncopy(wchar_t * const buf, const int buflen) const;\n\n  friend class GBaseString;\nprotected:\n  // Return the next character and increment the source pointer.\n  virtual uint32_t getValidUCS4(const char *&source) const;\n};\n\nGP<GStringRep>\nGStringRep::Native::create(const unsigned int sz)\n{\n  return GStringRep::create(sz,(GStringRep::Native *)0);\n}\n\n    // Create a strdup string.\nGP<GStringRep>\nGStringRep::Native::create(const char *s)\n{\n  GStringRep::Native dummy;\n  return dummy.strdup(s);\n}\n\nGP<GStringRep>\nGStringRep::Native::create(const GP<GStringRep> &s1,const GP<GStringRep> &s2)\n{\n  GStringRep::Native dummy;\n  return dummy.concat(s1,s2);\n}\n\nGP<GStringRep> \nGStringRep::Native::create( const GP<GStringRep> &s1,const char *s2)\n{\n  GStringRep::Native dummy;\n  return dummy.concat(s1,s2);\n}\n\nGP<GStringRep>\nGStringRep::Native::create( const char *s1, const GP<GStringRep> &s2)\n{\n  GStringRep::Native dummy;\n  return dummy.concat(s1,s2);\n}\n\nGP<GStringRep>\nGStringRep::Native::create(const char *s1,const char *s2)\n{\n  GStringRep::Native dummy;\n  return dummy.concat(s1,s2);\n}\n\nGP<GStringRep>\nGStringRep::Native::create(\n  const char *s,const int start,const int length)\n{\n  GStringRep::Native dummy;\n  return dummy.substr(s,start,length);\n}\n\nGP<GStringRep>\nGStringRep::Native::create(\n    const uint16_t *s,const int start,const int length)\n{\n  GStringRep::Native dummy;\n  return dummy.substr(s,start,length);\n}\n\nGP<GStringRep>\nGStringRep::Native::create(\n  const uint32_t *s,const int start,const int length)\n{\n  GStringRep::Native dummy;\n  return dummy.substr(s,start,length);\n}\n\nGP<GStringRep> \nGStringRep::Native::blank(const unsigned int sz) const\n{\n  return GStringRep::create(sz,(GStringRep::Native *)0);\n}\n\nbool\nGStringRep::Native::isNative(void) const\n{\n  return true;\n}\n\nGP<GStringRep>\nGStringRep::Native::toThis(\n     const GP<GStringRep> &rep,const GP<GStringRep> &) const\n{\n  return rep?(rep->toNative(NOT_ESCAPED)):rep;\n}\n\nGP<GStringRep> \nGStringRep::Native::create(const char fmt[],va_list &args)\n{ \n  const GP<GStringRep> s(create(fmt));\n  return (s?(s->vformat(args)):s);\n}\n\nint\nGStringRep::Native::ncopy(\n  wchar_t * const buf, const int buflen ) const\n{\n  return toUTF8()->ncopy(buf,buflen);\n}\n\nGStringRep::ChangeLocale::ChangeLocale(const int xcategory, const char xlocale[] )\n  : category(xcategory)\n{\n#if DO_CHANGELOCALE\n  // This is disabled under UNIX because \n  // it does not play nice with MT.\n  if(xlocale)\n    {\n      locale=setlocale(xcategory,0);\n      if(locale.length() &&(locale!=xlocale))\n        {\n          if(locale == setlocale(category,xlocale))\n            {\n              locale.empty();\n            }\n        }\n      else\n        {\n          locale.empty();\n        }\n    }\n#endif\n}\n\nGStringRep::ChangeLocale::~ChangeLocale()\n{\n#if DO_CHANGELOCALE\n  if(locale.length())\n    {\n      setlocale(category,(const char *)locale);\n    }\n#endif\n}\n\nGNativeString &\nGNativeString::format(const char fmt[], ... )\n{\n  va_list args;\n  va_start(args, fmt);\n  return init(GStringRep::Native::create(fmt,args));\n}\n\n// Gather the native implementations here. Not used in WinCE.\n\nGStringRep::Native::Native(void) {}\nGStringRep::Native::~Native() {}\n\nGP<GStringRep>\nGStringRep::Native::append(const GP<GStringRep> &s2) const\n{\n  GP<GStringRep> retval;\n  if(s2)\n  {\n    if(s2->isUTF8())\n    {\n      G_THROW( ERR_MSG(\"GStringRep.appendUTF8toNative\") );\n    }\n    retval=concat(data,s2->data);\n  }else\n  {\n    retval=const_cast<GStringRep::Native *>(this); \n  }\n  return retval;\n}\n\nGP<GStringRep>\nGStringRep::Native::create_format(const char fmt[],...)\n{\n  va_list args;\n  va_start(args, fmt);\n  return create(fmt,args);\n}\n\nunsigned char *\nGStringRep::Native::UCS4toString(\n  const uint32_t w0,unsigned char *ptr, mbstate_t *ps) const\n{\n  return UCS4toNative(w0,ptr,ps);\n}\n\n// Convert a UCS4 to a multibyte string in the value bytes.  \n// The data pointed to by ptr should be long enough to contain\n// the results with a nill termination.  (Normally 7 characters\n// is enough.)\nunsigned char *\nGStringRep::UCS4toNative(const uint32_t w0,unsigned char *ptr, mbstate_t *ps)\n{\n  uint16_t w1;\n  uint16_t w2=1;\n  for(int count=(sizeof(wchar_t)==sizeof(w1)) \n        ? UCS4toUTF16(w0,w1,w2) : 1;\n      count;\n      --count,w1=w2)\n    {\n      // wchar_t can be either UCS4 or UCS2\n      const wchar_t w=(sizeof(wchar_t) == sizeof(w1))?(wchar_t)w1:(wchar_t)w0;\n      int i=wcrtomb((char *)ptr,w,ps);\n      if(i<0)\n        break;\n      ptr[i]=0;\n      ptr += i;\n    }\n  ptr[0]=0;\n  return ptr;\n}\n\nGP<GStringRep>\nGStringRep::Native::toNative(const EscapeMode escape) const\n{\n  if(escape == UNKNOWN_ESCAPED)\n    G_THROW( ERR_MSG(\"GStringRep.NativeToNative\") );\n  return const_cast<GStringRep::Native *>(this);\n}\n\nGP<GStringRep>\nGStringRep::Native::toUTF8(const bool) const\n{\n  unsigned char *buf;\n  GPBuffer<unsigned char> gbuf(buf,size*6+1);\n  buf[0]=0;\n  if(data && size)\n  {\n    size_t n=size;\n    const char *source=data;\n    mbstate_t ps;\n    unsigned char *ptr=buf;\n    //(void)mbrlen(source, n, &ps);\n    memset(&ps,0,sizeof(mbstate_t));\n    int i=0;\n    if(sizeof(wchar_t) == sizeof(uint32_t))\n      {\n        wchar_t w = 0;\n        for(;(n>0)&&((i=mbrtowc(&w,source,n,&ps))>=0); n-=i,source+=i)\n          {\n            ptr=UCS4toUTF8((uint32_t)w,ptr);\n          }\n      }\n    else\n      { \n        wchar_t w = 0;\n        for(;(n>0)&&((i=mbrtowc(&w,source,n,&ps))>=0);n-=i,source+=i)\n          {\n            uint16_t s[2];\n            s[0]=w;\n            uint32_t w0;\n            if(UTF16toUCS4(w0,s,s+1)<=0)\n              {\n                source+=i;\n                n-=i;\n                if((n>0)&&((i=mbrtowc(&w,source,n,&ps))>=0))\n                  {\n                    s[1]=w;\n                    if(UTF16toUCS4(w0,s,s+2)<=0)\n                      {\n                        i=(-1);\n                        break;\n                      }\n                  }\n                else\n                  {\n                    i=(-1);\n                    break;\n                  }\n              }\n            ptr=UCS4toUTF8(w0,ptr);\n          }\n      }\n    if(i<0)\n      {\n        gbuf.resize(0);\n      }\n    else\n      {\n        ptr[0]=0;\n      }\n  }\n  return GStringRep::UTF8::create((const char *)buf);\n}\n\nGNativeString\nGBaseString::UTF8ToNative(\n  const bool currentlocale,const EscapeMode escape) const\n{\n  const char *source=(*this);\n  GP<GStringRep> retval;\n  if(source && source[0]) \n    {\n#if DO_CHANGELOCALE\n      GUTF8String lc_ctype(setlocale(LC_CTYPE,0));\n      bool repeat;\n      for(repeat=!currentlocale;;repeat=false)\n        {\n#endif\n          retval=(*this)->toNative((GStringRep::EscapeMode)escape);\n#if DO_CHANGELOCALE\n          if (!repeat || retval || (lc_ctype == setlocale(LC_CTYPE,\"\")))\n            break;\n        }\n      if(!repeat)\n        setlocale(LC_CTYPE,(const char *)lc_ctype);\n#endif\n    }\n  return GNativeString(retval);\n}\n\n/*MBCS*/\nGNativeString\nGBaseString::getUTF82Native( EscapeMode escape ) const\n{ //MBCS cvt\n  GNativeString retval;\n\n  // We don't want to convert this if it \n  // already is known to be native...\n//  if (isNative()) return *this;\n\n  const size_t slen=length()+1;\n  if(slen>1)\n  {\n    retval=UTF8ToNative(false,escape) ;\n    if(!retval.length())\n    {\n      retval=(const char*)*this;\n    }\n  }\n  return retval;\n}\n\nGUTF8String\nGBaseString::NativeToUTF8(void) const\n{\n  GP<GStringRep> retval;\n  if(length())\n  {\n    const char *source=(*this);\n#if DO_CHANGELOCALE\n    GUTF8String lc_ctype=setlocale(LC_CTYPE,0);\n    bool repeat;\n    for(repeat=true;;repeat=false)\n      {\n#endif\n        if( (retval=GStringRep::NativeToUTF8(source)) )\n          if(GStringRep::cmp(retval->toNative(),source))\n            retval=GStringRep::UTF8::create((unsigned int)0);\n#if DO_CHANGELOCALE\n        if(!repeat || retval || (lc_ctype == setlocale(LC_CTYPE,\"\")))\n          break;\n      }\n    if(!repeat)\n      setlocale(LC_CTYPE,(const char *)lc_ctype);\n#endif\n  }\n  return GUTF8String(retval);\n}\n\nGUTF8String\nGBaseString::getNative2UTF8(void) const\n{ //MBCS cvt\n\n   // We don't want to do a transform this\n   // if we already are in the given type.\n//   if (isUTF8()) return *this;\n   \n  const size_t slen=length()+1;\n  GUTF8String retval;\n  if(slen > 1)\n  {\n    retval=NativeToUTF8();\n    if(!retval.length())\n    {\n      retval=(const char *)(*this);\n    }\n  }\n  return retval;\n} /*MBCS*/\n\nint\nGStringRep::Native::cmp(const GP<GStringRep> &s2,const int len) const\n{\n  int retval;\n  if(s2)\n  {\n    if(s2->isUTF8())\n    {\n      const GP<GStringRep> r(toUTF8(true));\n      if(r)\n      {\n        retval=GStringRep::cmp(r->data,s2->data,len);\n      }else\n      {\n        retval=cmp(s2->toNative(NOT_ESCAPED),len);\n      }\n    }else\n    {\n      retval=GStringRep::cmp(data,s2->data,len);\n    }\n  }else\n  {\n    retval=GStringRep::cmp(data,0,len);\n  }\n  return retval;\n}\n\nint\nGStringRep::Native::toInt() const\n{\n  return atoi(data);\n}\n\nlong\nGStringRep::Native::toLong(\n  const int pos, int &endpos, const int base) const\n{\n   char *edata=0;\n   const long retval=strtol(data+pos, &edata, base);\n   if(edata)\n   {\n     endpos=(int)((size_t)edata-(size_t)data);\n   }else\n   {\n     endpos=(-1);\n   }\n   return retval;\n}\n\nunsigned long\nGStringRep::Native::toULong(\n  const int pos, int &endpos, const int base) const\n{\n   char *edata=0;\n   const unsigned long retval=strtoul(data+pos, &edata, base);\n   if(edata)\n   {\n     endpos=(int)((size_t)edata-(size_t)data);\n   }else\n   {\n     endpos=(-1);\n   }\n   return retval;\n}\n\ndouble\nGStringRep::Native::toDouble(\n  const int pos, int &endpos) const\n{\n   char *edata=0;\n   const double retval=strtod(data+pos, &edata);\n   if(edata)\n   {\n     endpos=(int)((size_t)edata-(size_t)data);\n   }else\n   {\n     endpos=(-1);\n   }\n   return retval;\n}\n\nuint32_t\nGStringRep::Native::getValidUCS4(const char *&source) const\n{\n  uint32_t retval=0;\n  int n=(int)((size_t)size+(size_t)data-(size_t)source);\n  if(source && (n > 0))\n  {\n    mbstate_t ps;\n    //(void)mbrlen(source, n, &ps);\n    memset(&ps,0,sizeof(mbstate_t));\n    wchar_t wt;\n    const int len=mbrtowc(&wt,source,n,&ps); \n    if(len>=0)\n    {\n      if(sizeof(wchar_t) == sizeof(uint16_t))\n      {\n        source+=len;\n        uint16_t s[2];\n        s[0]=(uint16_t)wt;\n        if(UTF16toUCS4(retval,s,s+1)<=0)\n        {\n          if((n-=len)>0)\n          {\n            const int len=mbrtowc(&wt,source,n,&ps);\n            if(len>=0)\n            {\n              s[1]=(uint16_t)wt;\n              uint32_t w;\n              if(UTF16toUCS4(w,s,s+2)>0)\n              {\n                source+=len;\n                retval=w;\n              }\n            }\n          }\n        }\n      }else\n      {\n        retval=(uint32_t)wt;\n        source++;\n      } \n    }else\n    {\n      source++;\n    }\n  }\n  return retval;\n}\n\n// Tests if a string is legally encoded in the current character set.\nbool \nGStringRep::Native::is_valid(void) const\n{\n  bool retval=true;\n  if(data && size)\n  {\n    size_t n=size;\n    const char *s=data;\n    mbstate_t ps;\n    //(void)mbrlen(s, n, &ps);\n    memset(&ps,0,sizeof(mbstate_t));\n    do\n    {\n      size_t m=mbrlen(s,n,&ps);\n      if(m > n)\n      {\n        retval=false;\n        break;\n      }else if(m)\n      {\n        s+=m;\n        n-=m;\n      }else\n      {\n        break;\n      }\n    } while(n);\n  }\n  return retval;\n}\n\n// These are dummy functions.\nvoid \nGStringRep::set_remainder(void const * const, const unsigned int,\n  const EncodeType) {}\nvoid \nGStringRep::set_remainder(void const * const, const unsigned int,\n  const GP<GStringRep> &encoding) {}\nvoid\nGStringRep::set_remainder( const GP<GStringRep::Unicode> &) {}\n\nGP<GStringRep::Unicode>\nGStringRep::get_remainder( void ) const\n{\n  return 0;\n}\n\nGNativeString::GNativeString(const char dat)\n{\n  init(GStringRep::Native::create(&dat,0,1));\n}\n\nGNativeString::GNativeString(const char *str)\n{\n  init(GStringRep::Native::create(str));\n}\n\nGNativeString::GNativeString(const unsigned char *str)\n{\n  init(GStringRep::Native::create((const char *)str));\n}\n\nGNativeString::GNativeString(const uint16_t *str)\n{\n  init(GStringRep::Native::create(str,0,-1));\n}\n\nGNativeString::GNativeString(const uint32_t *str)\n{\n  init(GStringRep::Native::create(str,0,-1));\n}\n\nGNativeString::GNativeString(const char *dat, unsigned int len)\n{\n  init(\n    GStringRep::Native::create(dat,0,((int)len<0)?(-1):(int)len));\n}\n\nGNativeString::GNativeString(const uint16_t *dat, unsigned int len)\n{\n  init(\n    GStringRep::Native::create(dat,0,((int)len<0)?(-1):(int)len));\n}\n\nGNativeString::GNativeString(const uint32_t *dat, unsigned int len)\n{\n  init(\n    GStringRep::Native::create(dat,0,((int)len<0)?(-1):(int)len));\n}\n\nGNativeString::GNativeString(const GNativeString &str)\n{\n  init(str);\n}\n\nGNativeString::GNativeString(const GBaseString &gs, int from, int len)\n{\n  init(\n    GStringRep::Native::create(gs,from,((int)len<0)?(-1):(int)len));\n}\n\nGNativeString::GNativeString(const int number)\n{\n  init(GStringRep::Native::create_format(\"%d\",number));\n}\n\nGNativeString::GNativeString(const double number)\n{\n  init(GStringRep::Native::create_format(\"%f\",number));\n}\n\nGNativeString&\nGNativeString::operator= (const char str)\n{ return init(GStringRep::Native::create(&str,0,1)); }\n\nGNativeString&\nGNativeString::operator= (const char *str)\n{ return init(GStringRep::Native::create(str)); }\n\nGNativeString\nGBaseString::operator+(const GNativeString &s2) const\n{\n  return GStringRep::Native::create(*this,s2);\n}\n\nGP<GStringRep>\nGStringRep::NativeToUTF8( const char *s )\n{\n  return GStringRep::Native::create(s)->toUTF8();\n}\n\n#endif // HAS_WCHAR\n\ntemplate <class TYPE>\nGP<GStringRep>\nGStringRep::create(const unsigned int sz, TYPE *)\n{\n  GP<GStringRep> gaddr;\n  if (sz > 0)\n  {\n    GStringRep *addr;\n    gaddr=(addr=new TYPE);\n    addr->data=(char *)(::operator new(sz+1));\n    addr->size = sz;\n    addr->data[sz] = 0;\n  }\n  return gaddr;\n}\n\nGP<GStringRep>\nGStringRep::strdup(const char *s) const\n{\n  GP<GStringRep> retval;\n  const int length=s?strlen(s):0;\n  if(length>0)\n  {\n    retval=blank(length);\n    char const * const end=s+length;\n    char *ptr=retval->data;\n    for(;*s&&(s!=end);ptr++)\n    {\n      ptr[0]=s++[0];\n    }\n    ptr[0]=0;\n  }\n  return retval;\n}\n\nGP<GStringRep>\nGStringRep::substr(const char *s,const int start,const int len) const\n{\n  GP<GStringRep> retval;\n  if(s && s[0])\n  {\n    const unsigned int length=(start<0 || len<0)?(unsigned int)strlen(s):(unsigned int)(-1);\n    const char *startptr, *endptr;\n    if(start<0)\n    {\n      startptr=s+length+start;\n      if(startptr<s)\n        startptr=s;\n    }else\n    { \n      startptr=s;\n      for(const char * const ptr=s+start;(startptr<ptr)&&*startptr;++startptr)\n        EMPTY_LOOP;\n    }\n    if(len<0)\n    {\n      if(s+length+1 < startptr+len)\n      {\n        endptr=startptr;\n      }else\n      {\n        endptr=s+length+1+len;\n      } \n    }else\n    {\n      endptr=startptr;\n      for(const char * const ptr=startptr+len;(endptr<ptr)&&*endptr;++endptr)\n        EMPTY_LOOP;\n    }\n    if(endptr>startptr)\n    {\n      retval=blank((size_t)(endptr-startptr));\n      char *data=retval->data;\n      for(; (startptr<endptr) && *startptr; ++startptr,++data)\n      {\n        data[0]=startptr[0];\n      }\n      data[0]=0;\n    }\n  }\n  return retval;\n}\n\nGP<GStringRep>\nGStringRep::substr(const uint16_t *s,const int start,const int len) const\n{\n  GP<GStringRep> retval;\n  if(s && s[0])\n  {\n    uint16_t const *eptr;\n    if(len<0)\n    {\n      for(eptr=s;eptr[0];++eptr)\n        EMPTY_LOOP;\n    }else\n    {\n      eptr=&(s[len]);\n    }\n    s=&s[start];\n    if((size_t)s<(size_t)eptr)\n    {\n      mbstate_t ps;\n      memset(&ps,0,sizeof(mbstate_t));\n      unsigned char *buf,*ptr;\n      GPBuffer<unsigned char> gbuf(buf,(((size_t)eptr-(size_t)s)/2)*3+7);\n      for(ptr=buf;s[0];)\n      {\n        uint32_t w;\n        int i=UTF16toUCS4(w,s,eptr);\n        if(i<=0)\n          break;\n        s+=i;\n        ptr=UCS4toString(w,ptr,&ps);\n      }\n      ptr[0]=0;\n      retval = strdup( (const char *)buf );\n    }\n  }\n  return retval;\n}\n\nGP<GStringRep>\nGStringRep::substr(const uint32_t *s,const int start,const int len) const\n{\n  GP<GStringRep> retval;\n  if(s && s[0])\n  {\n    uint32_t const *eptr;\n    if(len<0)\n    {\n      for(eptr=s;eptr[0];++eptr)\n        EMPTY_LOOP;\n    }else\n    {\n      eptr=&(s[len]);\n    }\n    s=&s[start];\n    if((size_t)s<(size_t)eptr)\n    {\n      mbstate_t ps;\n      memset(&ps,0,sizeof(mbstate_t));\n      unsigned char *buf,*ptr;\n      GPBuffer<unsigned char> gbuf(buf,((((size_t)eptr-(size_t)s))/4)*6+7);\n      for(ptr=buf;s[0];++s)\n      {\n        ptr=UCS4toString(s[0],ptr,&ps);\n      }\n      ptr[0]=0;\n      retval = strdup( (const char *)buf );\n    }\n  }\n  return retval;\n}\n\nGP<GStringRep>\nGStringRep::append(const char *s2) const\n{\n  GP<GStringRep> retval;\n  if(s2)\n  {\n    retval=concat(data,s2);\n  }else\n  {\n    retval=const_cast<GStringRep *>(this);\n  }\n  return retval;\n}\n\nGP<GStringRep>\nGStringRep::UTF8::append(const GP<GStringRep> &s2) const\n{\n  GP<GStringRep> retval;\n  if(s2)\n  {\n    if(s2->isNative())\n    {\n      G_THROW( ERR_MSG(\"GStringRep.appendNativeToUTF8\") );\n    }\n    retval=concat(data,s2->data);\n  }else\n  {\n    retval=const_cast<GStringRep::UTF8 *>(this); \n  }\n  return retval;\n}\n\nGP<GStringRep>\nGStringRep::concat(const char *s1,const char *s2) const\n{\n  const int length1=(s1?strlen(s1):0);\n  const int length2=(s2?strlen(s2):0);\n  const int length=length1+length2;\n  GP<GStringRep> retval;\n  if(length>0)\n  {\n    retval=blank(length);\n    GStringRep &r=*retval;\n    if(length1)\n    {\n      strcpy(r.data,s1);\n      if(length2)\n        strcat(r.data,s2);\n    }else\n    {\n      strcpy(r.data,s2);\n    }\n  }\n  return retval;\n}\n\nconst char *GBaseString::nullstr = \"\";\n\nvoid\nGBaseString::empty( void )\n{\n  init(0);\n}\n\nGP<GStringRep>\nGStringRep::getbuf(int n) const\n{\n  GP<GStringRep> retval;\n  if(n< 0)\n    n=strlen(data);\n  if(n>0)\n  {\n    retval=blank(n);\n    char *ndata=retval->data;\n    strncpy(ndata,data,n);\n    ndata[n]=0;\n  }\n  return retval;\n}\n\nconst char *\nGStringRep::isCharType(bool (*xiswtest)(const unsigned long wc), \n                       const char *ptr, \n                       const bool reverse) const\n{\n  const char *xptr = ptr;\n  unsigned long w=getValidUCS4(xptr);\n  if(ptr != xptr)\n    {\n      if (sizeof(wchar_t) == 2)\n        w &= 0xffff;\n      if (reverse ^ xiswtest(w))\n        ptr = xptr;\n    }\n  return ptr;\n}\n\nint\nGStringRep::nextCharType(\n  bool (*xiswtest)(const unsigned long wc), const int from, const int len,\n  const bool reverse) const\n{\n  // We want to return the position of the next\n  // non white space starting from the #from#\n  // location.  isspace should work in any locale\n  // so we should only need to do this for the non-\n  // native locales (UTF8)\n  int retval;\n  if(from<size)\n  {\n    retval=from;\n    const char * ptr = data+from;\n    for( const char * const eptr=ptr+((len<0)?(size-from):len);\n      (ptr<eptr) && *ptr;)\n    {\n       // Skip characters that fail the isCharType test\n      char const * const xptr=isCharType(xiswtest,ptr,!reverse);\n      if(xptr == ptr)\n        break;\n      ptr=xptr;\n    }\n    retval=(int)((size_t)ptr-(size_t)data);\n  }else\n  {\n    retval=size;\n  }\n  return retval;\n}\n\nbool\nGStringRep::giswspace(const unsigned long w)\n{\n#if HAS_WCTYPE\n  return !!iswspace((wchar_t)w);\n#else\n  return (w & ~0xff) ? false : !!isspace((int)(w & 0xff));\n#endif\n}\n\nbool\nGStringRep::giswupper(const unsigned long w)\n{\n#if HAS_WCTYPE\n  return !!iswupper((wchar_t)w);\n#else\n  return (w & ~0xff) ? false : !!isupper((int)(w & 0xff));\n#endif\n}\n\nbool\nGStringRep::giswlower(const unsigned long w)\n{\n#if HAS_WCTYPE\n  return !!iswlower((wchar_t)w);\n#else\n  return (w & ~0xff) ? false : !!islower((int)(w & 0xff));\n#endif\n}\n\nunsigned long\nGStringRep::gtowupper(const unsigned long w)\n{\n#if HAS_WCTYPE\n  return (unsigned long)towupper((wchar_t)w);\n#else\n  return (w&~0xff) ? w : (unsigned long)toupper(w & 0xff);\n#endif\n}\n\nunsigned long\nGStringRep::gtowlower(const unsigned long w)\n{\n#if HAS_WCTYPE\n  return (unsigned long)towlower((wchar_t)w);\n#else\n  return (w&~0xff) ? w : (unsigned long)tolower(w & 0xff);\n#endif\n}\n\nGP<GStringRep>\nGStringRep::tocase(\n  bool (*xiswcase)(const unsigned long wc),\n  unsigned long (*xtowcase)(const unsigned long wc)) const\n{\n  GP<GStringRep> retval;\n  char const * const eptr=data+size;\n  char const *ptr=data;\n  while(ptr<eptr)\n  {\n    char const * const xptr=isCharType(xiswcase,ptr,false);\n    if(ptr == xptr)\n      break;\n    ptr=xptr;\n  }\n  if(ptr<eptr)\n  {\n    const int n=(int)((size_t)ptr-(size_t)data);\n    unsigned char *buf;\n    GPBuffer<unsigned char> gbuf(buf,n+(1+size-n)*6);\n    if(n>0)\n    {\n      strncpy((char *)buf,data,n);\n    }\n    unsigned char *buf_ptr=buf+n;\n    for(char const *ptr=data+n;ptr<eptr;)\n    {\n      char const * const xptr=ptr;\n      const unsigned long w=getValidUCS4(ptr);\n      if(ptr == xptr)\n        break;\n      if(xiswcase(w))\n      {\n        const int len=(int)((size_t)ptr-(size_t)xptr);\n        strncpy((char *)buf_ptr,xptr,len);\n        buf_ptr+=len;\n      }else\n      {\n        mbstate_t ps;\n        memset(&ps,0,sizeof(mbstate_t));\n        buf_ptr=UCS4toString(xtowcase(w),buf_ptr,&ps);\n      }\n    }\n    buf_ptr[0]=0;\n    retval=substr((const char *)buf,0,(int)((size_t)buf_ptr-(size_t)buf));\n  }else\n  {\n    retval=const_cast<GStringRep *>(this);\n  }\n  return retval;\n}\n\n// Returns a copy of this string with characters used in XML escaped as follows:\n//      '<'  -->  \"&lt;\"\n//      '>'  -->  \"&gt;\"\n//      '&'  -->  \"&amp;\"\n//      '\\'' -->  \"&apos;\"\n//      '\\\"' -->  \"&quot;\"\n//  Also escapes characters 0x00 through 0x1f and 0x7e through 0x7f.\nGP<GStringRep>\nGStringRep::toEscaped( const bool tosevenbit ) const\n{\n  bool modified=false;\n  char *ret;\n  GPBuffer<char> gret(ret,size*7);\n  ret[0]=0;\n  char *retptr=ret;\n  char const *start=data;\n  char const *s=start;\n  char const *last=s;\n  GP<GStringRep> special;\n  for(unsigned long w;(w=getValidUCS4(s));last=s)  \n    // Whoever wrote this for statement should be __complete_here__\n  {\n    char const *ss=0;\n    switch(w)\n    {\n    case '<':\n      ss=\"&lt;\";\n      break;\n    case '>':\n      ss=\"&gt;\";\n      break;\n    case '&':\n      ss=\"&amp;\";\n      break;\n    case '\\47':\n      ss=\"&apos;\";\n      break;\n    case '\\42':\n      ss=\"&quot;\";\n      break;\n    default:\n      if((w<' ')||(w>=0x7e && (tosevenbit || (w < 0x80))))\n      {\n        special=toThis(UTF8::create_format(\"&#%lu;\",w));\n        ss=special->data;\n      }\n      break;\n    }\n    if(ss)\n    {\n      modified=true;\n      if(s!=start)\n      {\n        size_t len=(size_t)last-(size_t)start;\n        strncpy(retptr,start,len);\n        retptr+=len;\n        start=s;\n      }\n      if(ss[0])\n      {\n        size_t len=strlen(ss);\n        strcpy(retptr,ss);\n        retptr+=len;\n      }\n    }\n  }\n  GP<GStringRep> retval;\n  if(modified)\n  {\n    strcpy(retptr,start);\n    retval=strdup( ret );\n  }else\n  {\n    retval=const_cast<GStringRep *>(this);\n  }\n//  DEBUG_MSG( \"Escaped string is '\" << ret << \"'\\n\" );\n  return retval;\n}\n\n\nstatic const GMap<GUTF8String,GUTF8String> &\nBasicMap( void )\n{\n  static GMap<GUTF8String,GUTF8String> Basic;\n  if (! Basic.size())\n    {\n      Basic[\"lt\"]   = GUTF8String('<');\n      Basic[\"gt\"]   = GUTF8String('>');\n      Basic[\"amp\"]  = GUTF8String('&');\n      Basic[\"apos\"] = GUTF8String('\\47');\n      Basic[\"quot\"] = GUTF8String('\\42');\n    }\n  return Basic;\n}\n\nGUTF8String\nGUTF8String::fromEscaped( const GMap<GUTF8String,GUTF8String> ConvMap ) const\n{\n  GUTF8String ret;                  // Build output string here\n  int start_locn = 0;           // Beginning of substring to skip\n  int amp_locn;                 // Location of a found ampersand\n\n  while( (amp_locn = search( '&', start_locn )) > -1 )\n  {\n      // Found the next apostrophe\n      // Locate the closing semicolon\n    const int semi_locn = search( ';', amp_locn );\n      // No closing semicolon, exit and copy\n      //  the rest of the string.\n    if( semi_locn < 0 )\n      break;\n    ret += substr( start_locn, amp_locn - start_locn );\n    int const len = semi_locn - amp_locn - 1;\n    if(len)\n    {\n      GUTF8String key = substr( amp_locn+1, len);\n      //DEBUG_MSG( \"key = '\" << key << \"'\\n\" );\n      char const * s=key;\n      if( s[0] == '#')\n      {\n        unsigned long value;\n        char *ptr=0;\n        if(s[1] == 'x' || s[1] == 'X')\n        {\n          value=strtoul((char const *)(s+2),&ptr,16);\n        }else\n        {\n          value=strtoul((char const *)(s+1),&ptr,10);\n        }\n        if(ptr)\n        {\n          unsigned char utf8char[7];\n          unsigned char const * const end=GStringRep::UCS4toUTF8(value,utf8char);\n          ret+=GUTF8String((char const *)utf8char,(size_t)end-(size_t)utf8char);\n        }else\n        {\n          ret += substr( amp_locn, semi_locn - amp_locn + 1 );\n        }\n      }else\n      {  \n        GPosition map_entry = ConvMap.contains( key );\n        if( map_entry )\n        {                           // Found in the conversion map, substitute\n          ret += ConvMap[map_entry];\n        } else\n        {\n          static const GMap<GUTF8String,GUTF8String> &Basic = BasicMap();\n          GPosition map_entry = Basic.contains( key );\n          if ( map_entry )\n          {\n            ret += Basic[map_entry];\n          }else\n          {\n            ret += substr( amp_locn, len+2 );\n          }\n        }\n      }\n    }else\n    {\n      ret += substr( amp_locn, len+2 );\n    }\n    start_locn = semi_locn + 1;\n//    DEBUG_MSG( \"ret = '\" << ret << \"'\\n\" );\n  }\n\n                                // Copy the end of the string to the output\n  ret += substr( start_locn, length()-start_locn );\n\n//  DEBUG_MSG( \"Unescaped string is '\" << ret << \"'\\n\" );\n  return (ret == *this)?(*this):ret;\n}\n\nGUTF8String\nGUTF8String::fromEscaped(void) const\n{\n  const GMap<GUTF8String,GUTF8String> nill;\n  return fromEscaped(nill);\n}\n\nGP<GStringRep>\nGStringRep::setat(int n, char ch) const\n{\n  GP<GStringRep> retval;\n  if(n<0)\n    n+=size;\n  if (n < 0 || n>size) \n    GBaseString::throw_illegal_subscript();\n  if(ch == data[n])\n  {\n    retval=const_cast<GStringRep *>(this);\n  }else if(!ch)\n  {\n    retval=getbuf(n);\n  }else\n  {\n    retval=getbuf((n<size)?size:n);\n    retval->data[n]=ch;\n    if(n == size)\n      retval->data[n+1]=0;\n  }\n  return retval;\n}\n\n#if defined(AUTOCONF) && defined(HAVE_VSNPRINTF)\n# define USE_VSNPRINTF vsnprintf\n#elif defined(WIN32) && !defined(__CYGWIN32__)\n# define USE_VSNPRINTF _vsnprintf\n#elif defined(linux)\n# define USE_VSNPRINTF vsnprintf\n#endif\n \nGUTF8String &\nGUTF8String::format(const char fmt[], ... )\n{\n  va_list args;\n  va_start(args, fmt);\n  return init(GStringRep::UTF8::create(fmt,args));\n}\n\nGP<GStringRep>\nGStringRep::UTF8::create_format(const char fmt[],...)\n{\n  va_list args;\n  va_start(args, fmt);\n  return create(fmt,args);\n}\n\nGP<GStringRep>\nGStringRep::vformat(va_list args) const\n{\n  GP<GStringRep> retval;\n  if(size)\n  {\n    char const * const fmt=data;\n    int buflen=32768;\n    char *buffer;\n    GPBuffer<char> gbuffer(buffer,buflen);\n    ChangeLocale locale(LC_NUMERIC,(isNative()?0:\"C\"));\n    // Format string\n#ifdef USE_VSNPRINTF\n    while(USE_VSNPRINTF(buffer, buflen, fmt, args)<0)\n      {\n        gbuffer.resize(0);\n        gbuffer.resize(buflen+32768);\n      }\n    va_end(args);\n#else\n    buffer[buflen-1] = 0;\n    vsprintf(buffer, fmt, args);\n    va_end(args);\n    if (buffer[buflen-1])\n      {\n        // This isn't as fatal since it is on the stack, but we\n        // definitely should stop the current operation.\n        G_THROW( ERR_MSG(\"GString.overwrite\") );\n      }\n#endif\n    retval=strdup((const char *)buffer);\n  }\n  // Go altering the string\n  return retval;\n}\n\nint \nGStringRep::search(char c, int from) const\n{\n  if (from<0)\n    from += size;\n  int retval=(-1);\n  if (from>=0 && from<size)\n  {\n    char const *const s = strchr(data+from,c);\n    if(s)\n      retval=(int)((size_t)s-(size_t)data);\n  }\n  return retval;\n}\n\nint \nGStringRep::search(char const *ptr, int from) const\n{\n  if(from<0)\n  {\n    from+=size;\n    if(from<0)\n      G_THROW( ERR_MSG(\"GString.bad_subscript\") );\n  }\n  int retval=(-1);\n  if (from>=0 && from<size)\n  {\n    char const *const s = strstr(data+from,ptr);\n    if(s)\n      retval=(int)((size_t)s-(size_t)data);\n  }\n  return retval;\n}\n\nint \nGStringRep::rsearch(char c, int from) const\n{\n  if(from<0)\n  {\n    from+=size;\n    if(from<0)\n      G_THROW( ERR_MSG(\"GString.bad_subscript\") );\n  }\n  int retval=(-1);\n  if ((from>=0) && (from<size))\n  {\n    char const *const s = strrchr(data+from,c);\n    if(s)\n      retval=(int)((size_t)s-(size_t)data);\n  }\n  return retval;\n}\n\nint \nGStringRep::rsearch(char const *ptr, int from) const\n{\n  if(from<0)\n  {\n    from+=size;\n    if(from<0)\n      G_THROW( ERR_MSG(\"GString.bad_subscript\") );\n  }\n  int retval=(-1);\n  for(int loc=from;(loc=search(ptr,loc)) >= 0;++loc)\n    retval=loc;\n  return retval;\n}\n\nint\nGStringRep::contains(const char accept[],int from) const\n{\n  if(from<0)\n  {\n    from+=size;\n    if(from<0)\n      G_THROW( ERR_MSG(\"GString.bad_subscript\") );\n  }\n  int retval=(-1);\n  if (accept && accept[0] && from>=0 && from<size)\n  {\n    char const * const src = data+from;\n    char const *ptr=strpbrk(src,accept);\n    if(ptr)\n    {\n      retval=(int)(ptr-src)+from;\n    }\n  }\n  return retval;\n}\n\nint\nGStringRep::rcontains(const char accept[],int from) const\n{\n  int retval=(-1);\n  while((from=contains(accept,from)) >= 0)\n  {\n    retval=from++;\n  }\n  return retval;\n}\n\nbool\nGBaseString::is_int(void) const\n{\n  bool isLong=!!ptr;\n  if(isLong)\n  {\n    int endpos;\n    (*this)->toLong(0,endpos);\n    if(endpos>=0)\n    {\n      isLong=((*this)->nextNonSpace(endpos) == (int)length());\n    }\n  }\n  return isLong;\n}\n\nbool\nGBaseString::is_float(void) const\n{\n  bool isDouble=!!ptr;\n  if(isDouble)\n  {\n    int endpos;\n    (*this)->toDouble(0,endpos);\n    if(endpos>=0)\n    {\n      isDouble=((*this)->nextNonSpace(endpos) == (int)length());\n    }\n  }\n  return isDouble;\n}\n\nunsigned int \nhash(const GBaseString &str)\n{\n  unsigned int x = 0;\n  const char *s = (const char*)str;\n  while (*s) \n    x = x ^ (x<<6) ^ (unsigned char)(*s++);\n  return x;\n}\n\nvoid \nGBaseString::throw_illegal_subscript()\n{\n  G_THROW( ERR_MSG(\"GString.bad_subscript\") );\n}\n\nunsigned char *\nGStringRep::UTF8::UCS4toString(\n  const uint32_t w0,unsigned char *ptr, mbstate_t *) const\n{\n  return UCS4toUTF8(w0,ptr);\n}\n\nint\nGStringRep::UTF8::ncopy(wchar_t * const buf, const int buflen ) const\n{\n  int retval=(-1);\n  if(buf && buflen)\n    {\n      buf[0]=0;\n      if(data[0])\n\t{\n          const size_t length=strlen(data);\n          const unsigned char * const eptr=(const unsigned char *)(data+length);\n\t  wchar_t *r=buf;\n\t  wchar_t const * const rend=buf+buflen;\n          for(const unsigned char *s=(const unsigned char *)data;\n              (r<rend)&&(s<eptr)&&*s;)\n            {\n              const uint32_t w0=UTF8toUCS4(s,eptr);\n              uint16_t w1;\n              uint16_t w2=1;\n              for(int count=(sizeof(wchar_t)==sizeof(w1))\n                    ?UCS4toUTF16(w0,w1,w2):1;\n                  count&&(r<rend);\n                  --count,w1=w2,++r)\n\t\t{\n\t\t  r[0]=(sizeof(wchar_t) == sizeof(w1))?(wchar_t)w1:(wchar_t)w0;\n\t\t}\n            }\n\t  if(r<rend)\n            {\n              r[0]=0;\n              retval=((size_t)r-(size_t)buf)/sizeof(wchar_t);\n            }\n\t}\n      else\n\t{\n\t  retval=0;\n\t}\n    }\n  return retval;\n}\n\nGP<GStringRep> \nGStringRep::UTF8::toNative(const EscapeMode escape) const\n{\n  GP<GStringRep> retval;\n  if(data[0])\n  {\n    const size_t length=strlen(data);\n    const unsigned char * const eptr=(const unsigned char *)(data+length);\n    unsigned char *buf;\n    GPBuffer<unsigned char> gbuf(buf,12*length+12); \n    unsigned char *r=buf;\n    mbstate_t ps;\n    memset(&ps,0,sizeof(mbstate_t));\n    for(const unsigned char *s=(const unsigned char *)data;(s<eptr)&& *s;)\n      {\n        const unsigned char * const s0 = s;\n        const uint32_t w0=UTF8toUCS4(s,eptr);\n        if (s == s0)\n          {\n            s += 1;\n            *r++ = '?';\n          }\n        else\n          {\n            const unsigned char * const r0 = r;\n            r=UCS4toNative(w0,r,&ps);\n            if(r == r0)\n              {\n                if (escape == IS_ESCAPED)\n                  {\n                    sprintf((char *)r,\"&#%lu;\",(unsigned long)w0);\n                    r += strlen((char *)r);\n                  }\n                else\n                  {\n                    *r++ = '?';\n                  }\n              }\n          }\n      }\n    r[0]=0;\n    retval = NATIVE_CREATE( (const char *)buf );\n  } \n  else\n  {\n    retval = NATIVE_CREATE( (unsigned int)0 );\n  }\n  return retval;\n}\n\nGP<GStringRep>\nGStringRep::UTF8::toUTF8(const bool nothrow) const\n{\n  if(!nothrow)\n    G_THROW( ERR_MSG(\"GStringRep.UTF8ToUTF8\") );\n  return const_cast<GStringRep::UTF8 *>(this);\n}\n\n// Tests if a string is legally encoded in the current character set.\nbool \nGStringRep::UTF8::is_valid(void) const\n{\n  bool retval=true;\n  if(data && size)\n  {\n    const unsigned char * const eptr=(const unsigned char *)(data+size);\n    for(const unsigned char *s=(const unsigned char *)data;(s<eptr)&& *s;)\n    {\n      const unsigned char * const r=s;\n      (void)UTF8toUCS4(s,eptr);\n      if(r == s)\n      {\n        retval=false;\n        break;\n      }\n    }\n  }\n  return retval;\n}\n\nstatic inline uint32_t\nadd_char(uint32_t const U, unsigned char const * const r)\n{\n  uint32_t const C=r[0];\n  return ((C|0x3f) == 0xbf)?((U<<6)|(C&0x3f)):0;\n}\n\nuint32_t\nGStringRep::UTF8toUCS4(\n  unsigned char const *&s,void const * const eptr)\n{\n  uint32_t U=0;\n  unsigned char const *r=s;\n  if(r < eptr)\n  {\n    uint32_t const C1=r++[0];\n    if(C1&0x80)\n    {\n      if(r < eptr)\n      {\n        U=C1;\n        if((U=((C1&0x40)?add_char(U,r++):0)))\n        {\n          if(C1&0x20)\n          {\n            if(r < eptr)\n            {\n              if((U=add_char(U,r++)))\n              {\n                if(C1&0x10)\n                {\n                  if(r < eptr)\n                  {\n                    if((U=add_char(U,r++)))\n                    {\n                      if(C1&0x8)\n                      {\n                        if(r < eptr)\n                        {\n                          if((U=add_char(U,r++)))\n                          {\n                            if(C1&0x4)\n                            {\n                              if(r < eptr)\n                              {\n                                if((U=((!(C1&0x2))?(add_char(U,r++)&0x7fffffff):0)))\n                                {\n                                  s=r;\n                                }else\n                                {\n                                  U=(unsigned int)(-1)-s++[0];\n                                }\n                              }else\n                              {\n                                U=0;\n                              }\n                            }else if((U=((U&0x4000000)?0:(U&0x3ffffff))))\n                            {\n                              s=r;\n                            }\n                          }else\n                          {\n                            U=(unsigned int)(-1)-s++[0];\n                          }\n                        }else\n                        {\n                          U=0;\n                        }\n                      }else if((U=((U&0x200000)?0:(U&0x1fffff))))\n                      {\n                        s=r;\n                      }\n                    }else\n                    {\n                      U=(unsigned int)(-1)-s++[0];\n                    }\n                  }else\n                  {\n                    U=0;\n                  }\n                }else if((U=((U&0x10000)?0:(U&0xffff))))\n                {\n                  s=r;\n                }\n              }else\n              {\n                U=(unsigned int)(-1)-s++[0];\n              }\n            }else\n            {\n              U=0;\n            }\n          }else if((U=((U&0x800)?0:(U&0x7ff))))\n          {\n            s=r;\n          }\n        }else\n        {\n          U=(unsigned int)(-1)-s++[0];\n        }\n      }else\n      {\n        U=0;\n      }\n    }else if((U=C1))\n    {\n      s=r;\n    }\n  }\n  return U;\n}\n\nunsigned char *\nGStringRep::UCS4toUTF8(const uint32_t w,unsigned char *ptr)\n{\n  if(w <= 0x7f)\n  {\n    *ptr++ = (unsigned char)w;\n  }\n  else if(w <= 0x7ff)\n  {\n    *ptr++ = (unsigned char)((w>>6)|0xC0);\n    *ptr++ = (unsigned char)((w|0x80)&0xBF);\n  }\n  else if(w <= 0xFFFF)\n  {\n    *ptr++ = (unsigned char)((w>>12)|0xE0);\n    *ptr++ = (unsigned char)(((w>>6)|0x80)&0xBF);\n    *ptr++ = (unsigned char)((w|0x80)&0xBF);\n  }\n  else if(w <= 0x1FFFFF)\n  {\n    *ptr++ = (unsigned char)((w>>18)|0xF0);\n    *ptr++ = (unsigned char)(((w>>12)|0x80)&0xBF);\n    *ptr++ = (unsigned char)(((w>>6)|0x80)&0xBF);\n    *ptr++ = (unsigned char)((w|0x80)&0xBF);\n  }\n  else if(w <= 0x3FFFFFF)\n  {\n    *ptr++ = (unsigned char)((w>>24)|0xF8);\n    *ptr++ = (unsigned char)(((w>>18)|0x80)&0xBF);\n    *ptr++ = (unsigned char)(((w>>12)|0x80)&0xBF);\n    *ptr++ = (unsigned char)(((w>>6)|0x80)&0xBF);\n    *ptr++ = (unsigned char)((w|0x80)&0xBF);\n  }\n  else if(w <= 0x7FFFFFFF)\n  {\n    *ptr++ = (unsigned char)((w>>30)|0xFC);\n    *ptr++ = (unsigned char)(((w>>24)|0x80)&0xBF);\n    *ptr++ = (unsigned char)(((w>>18)|0x80)&0xBF);\n    *ptr++ = (unsigned char)(((w>>12)|0x80)&0xBF);\n    *ptr++ = (unsigned char)(((w>>6)|0x80)&0xBF);\n    *ptr++ = (unsigned char)((w|0x80)&0xBF);\n  }\n  else\n  { \n    *ptr++ = '?';\n  }\n  return ptr;\n}\n\n   // Creates with a concat operation.\nGP<GStringRep> \nGStringRep::concat( const char *s1, const GP<GStringRep> &s2) const\n{\n  GP<GStringRep> retval;\n  if(s2)\n  {\n    retval=toThis(s2);\n    if(s1 && s1[0])\n    {\n      if(retval)\n      {\n        retval=concat(s1,retval->data);\n      }else\n      {\n        retval=strdup(s1);\n      }\n    }\n  }else if(s1 && s1[0])\n  {\n    retval=strdup(s1);\n  }\n  return retval;\n}\n\n   // Creates with a concat operation.\n\nGP<GStringRep> \nGStringRep::concat( const GP<GStringRep> &s1,const char *s2) const\n{\n  GP<GStringRep> retval;\n  if(s1)\n  {\n    retval=toThis(s1);\n    if(s2 && s2[0])\n    {\n      if(retval)\n      {\n        retval=retval->append(s2);\n      }else\n      {\n        retval=strdup(s2);\n      }\n    }\n  }else if(s2 && s2[0])\n  {\n    retval=strdup(s2);\n  }\n  return retval;\n}\n\nGP<GStringRep> \nGStringRep::concat(const GP<GStringRep> &s1,const GP<GStringRep> &s2) const\n{ \n  GP<GStringRep> retval; \n  if(s1)\n  {\n    retval=toThis(s1,s2);\n    if(retval && s2)\n    {\n      retval=retval->append(toThis(s2));\n    }\n  }else if(s2)\n  {\n    retval=toThis(s2);\n  }\n  return retval;\n}\n\n#ifdef WIN32\nstatic const char *setlocale_win32(void)\n{\n  static const char *locale=setlocale(LC_ALL,0);\n  if(! locale || (locale[0] == 'C' && !locale[1]))\n  {\n    locale=setlocale(LC_ALL,\"\");\n  }\n  return locale;\n}\nconst char *setlocale_win32_var = setlocale_win32();\n#endif\n\nGStringRep::GStringRep(void)\n{\n  size=0;\n  data=0;\n}\n\nGStringRep::~GStringRep()\n{\n  if(data)\n  {\n    data[0]=0;\n    ::operator delete(data);\n  }\n  data=0;\n}\n\nGStringRep::UTF8::UTF8(void) {}\n\nGStringRep::UTF8::~UTF8() {}\n\nint\nGStringRep::cmp(const char *s1,const int len) const\n{\n  return cmp(data,s1,len);\n}\n\nint\nGStringRep::cmp(const char *s1, const char *s2,const int len)\n{\n  return (len\n   ?((s1&&s1[0])\n      ?((s2&&s2[0])\n        ?((len>0)\n          ?strncmp(s1,s2,len)\n          :strcmp(s1,s2))\n        :1)\n      :((s2&&s2[0])?(-1):0))\n   :0);\n}\n\nint \nGStringRep::cmp(const GP<GStringRep> &s1, const GP<GStringRep> &s2,\n  const int len )\n{\n  return (s1?(s1->cmp(s2,len)):cmp(0,(s2?(s2->data):0),len));\n}\n\nint \nGStringRep::cmp(const GP<GStringRep> &s1, const char *s2, \n  const int len )\n{\n  return cmp((s1?s1->data:0),s2,len);\n}\n\nint \nGStringRep::cmp(const char *s1, const GP<GStringRep> &s2,\n  const int len )\n{\n  return cmp(s1,(s2?(s2->data):0),len);\n}\n\nint\nGStringRep::UTF8::cmp(const GP<GStringRep> &s2,const int len) const\n{\n  int retval;\n  if(s2)\n  {\n    if(s2->isNative())\n    {\n      GP<GStringRep> r(s2->toUTF8(true));\n      if(r)\n      {\n        retval=GStringRep::cmp(data,r->data,len);\n      }else\n      {\n        retval=-(s2->cmp(toNative(NOT_ESCAPED),len));\n      }\n    }else\n    {\n      retval=GStringRep::cmp(data,s2->data,len);\n    }\n  }else\n  { \n    retval=GStringRep::cmp(data,0,len);\n  }\n  return retval;\n} \n\nint\nGStringRep::UTF8::toInt() const\n{\n  int endpos;\n  return (int)toLong(0,endpos);\n}\n\nstatic inline long\nCstrtol(char *data,char **edata, const int base)\n{\n  GStringRep::ChangeLocale locale(LC_NUMERIC,\"C\");\n  while (data && *data==' ') data++;\n  return strtol(data,edata,base);\n}\n\nlong \nGStringRep::UTF8::toLong(\n  const int pos, int &endpos, const int base) const\n{\n  char *edata=0;\n  long retval=Cstrtol(data+pos,&edata, base);\n  if(edata)\n  {\n    endpos=edata-data;\n  }else\n  {\n    endpos=(-1);\n    GP<GStringRep> ptr=ptr->strdup(data+pos);\n    if(ptr)\n      ptr=ptr->toNative(NOT_ESCAPED);\n    if(ptr)\n    {\n      int xendpos;\n      retval=ptr->toLong(0,xendpos,base);\n      if(xendpos> 0)\n      {\n        endpos=(int)size;\n        ptr=ptr->strdup(data+xendpos);\n        if(ptr)\n        {\n          ptr=ptr->toUTF8(true);\n          if(ptr)\n          {\n            endpos-=(int)(ptr->size);\n          }\n        }\n      }\n    }\n  }\n  return retval;\n}\n\nstatic inline unsigned long\nCstrtoul(char *data,char **edata, const int base)\n{\n  GStringRep::ChangeLocale locale(LC_NUMERIC,\"C\");\n  while (data && *data==' ') data++;\n  return strtoul(data,edata,base);\n}\n\nunsigned long \nGStringRep::UTF8::toULong(\n  const int pos, int &endpos, const int base) const\n{\n  char *edata=0;\n  unsigned long retval=Cstrtoul(data+pos,&edata, base);\n  if(edata)\n  {\n    endpos=edata-data;\n  }else\n  {\n    endpos=(-1);\n    GP<GStringRep> ptr=ptr->strdup(data+pos);\n    if(ptr)\n      ptr=ptr->toNative(NOT_ESCAPED);\n    if(ptr)\n    {\n      int xendpos;\n      retval=ptr->toULong(0,xendpos,base);\n      if(xendpos> 0)\n      {\n        endpos=(int)size;\n        ptr=ptr->strdup(data+xendpos);\n        if(ptr)\n        {\n          ptr=ptr->toUTF8(true);\n          if(ptr)\n          {\n            endpos-=(int)(ptr->size);\n          }\n        }\n      }\n    }\n  }\n  return retval;\n}\n\nstatic inline double\nCstrtod(char *data,char **edata)\n{\n  GStringRep::ChangeLocale locale(LC_NUMERIC,\"C\");\n  while (data && *data==' ') data++;\n  return strtod(data,edata);\n}\n\ndouble\nGStringRep::UTF8::toDouble(const int pos, int &endpos) const\n{\n  char *edata=0;\n  double retval=Cstrtod(data+pos,&edata);\n  if(edata)\n  {\n    endpos=edata-data;\n  }else\n  {\n    endpos=(-1);\n    GP<GStringRep> ptr=ptr->strdup(data+pos);\n    if(ptr)\n      ptr=ptr->toNative(NOT_ESCAPED);\n    if(ptr)\n    {\n      int xendpos;\n      retval=ptr->toDouble(0,xendpos);\n      if(xendpos >= 0)\n      {\n        endpos=(int)size;\n        ptr=ptr->strdup(data+xendpos);\n        if(ptr)\n        {\n          ptr=ptr->toUTF8(true);\n          if(ptr)\n          {\n            endpos-=(int)(ptr->size);\n          }\n        }\n      }\n    }\n  }\n  return retval;\n}\n\nint \nGStringRep::getUCS4(uint32_t &w, const int from) const\n{\n  int retval;\n  if(from>=size)\n  {\n    w=0;\n    retval=size;\n  }else if(from<0)\n  {\n    w=(unsigned int)(-1);\n    retval=(-1);\n  }else\n  {\n    const char *source=data+from;\n    w=getValidUCS4(source);\n    retval=(int)((size_t)source-(size_t)data);\n  } \n  return retval;\n}\n\n\nuint32_t\nGStringRep::UTF8::getValidUCS4(const char *&source) const\n{\n  return GStringRep::UTF8toUCS4((const unsigned char *&)source,data+size);\n}\n\nint\nGStringRep::nextNonSpace(const int from,const int len) const\n{\n  return nextCharType(giswspace,from,len,true);\n}\n\nint\nGStringRep::nextSpace(const int from,const int len) const\n{\n  return nextCharType(giswspace,from,len,false);\n}\n\nint\nGStringRep::nextChar(const int from) const\n{\n  char const * xptr=data+from;\n  (void)getValidUCS4(xptr);\n  return (int)((size_t)xptr-(size_t)data);\n}\n\nint \nGStringRep::firstEndSpace(int from,const int len) const\n{\n  const int xsize=(len<0)?size:(from+len);\n  const int ysize=(size<xsize)?size:xsize;\n  int retval=ysize;\n  while(from<ysize)\n  {\n    from=nextNonSpace(from,ysize-from);\n    if(from < size)\n    {\n      const int r=nextSpace(from,ysize-from);\n      // If a character isn't legal, then it will return\n      // tru for both nextSpace and nextNonSpace.\n      if(r == from)\n      {\n        from++;\n      }else\n      {\n        from=retval=r;\n      }\n    }\n  }\n  return retval;\n}\n\nint\nGStringRep::UCS4toUTF16(\n  const uint32_t w,uint16_t &w1, uint16_t &w2)\n{\n  int retval;\n  if(w<0x10000)\n  {\n    w1=(uint16_t)w;\n    w2=0;\n    retval=1;\n  }else\n  {\n    w1=(uint16_t)((((w-0x10000)>>10)&0x3ff)+0xD800);\n    w2=(uint16_t)((w&0x3ff)+0xDC00);\n    retval=2;\n  }\n  return retval;\n}\n\nint\nGStringRep::UTF16toUCS4(\n  uint32_t &U,uint16_t const * const s,void const * const eptr)\n{\n  int retval=0;\n  U=0;\n  uint16_t const * const r=s+1;\n  if(r <= eptr)\n  {\n    uint32_t const W1=s[0];\n    if((W1<0xD800)||(W1>0xDFFF))\n    {\n      if((U=W1))\n      {\n        retval=1;\n      }\n    }else if(W1<=0xDBFF)\n    {\n      uint16_t const * const rr=r+1;\n      if(rr <= eptr)\n      {\n        uint32_t const W2=s[1];\n        if(((W2>=0xDC00)||(W2<=0xDFFF))&&((U=(0x10000+((W1&0x3ff)<<10))|(W2&0x3ff))))\n        {\n          retval=2;\n        }else\n        {\n          retval=(-1);\n        }\n      }\n    }\n  }\n  return retval;\n}\n\n\n//bcr\n\nGUTF8String&\nGUTF8String::operator+= (char ch)\n{\n  return init(\n    GStringRep::UTF8::create((const char*)*this,\n    GStringRep::UTF8::create(&ch,0,1)));\n}\n\nGUTF8String&\nGUTF8String::operator+= (const char *str)\n{\n  return init(GStringRep::UTF8::create(*this,str));\n}\n\nGUTF8String&\nGUTF8String::operator+= (const GBaseString &str)\n{\n  return init(GStringRep::UTF8::create(*this,str));\n}\n\nGUTF8String\nGUTF8String::substr(int from, int len) const\n{ return GUTF8String(*this, from, len); }\n\nGUTF8String\nGUTF8String::operator+(const GBaseString &s2) const\n{ return GStringRep::UTF8::create(*this,s2); }\n\nGUTF8String\nGUTF8String::operator+(const GUTF8String &s2) const\n{ return GStringRep::UTF8::create(*this,s2); }\n\nGUTF8String\nGUTF8String::operator+(const char    *s2) const\n{ return GStringRep::UTF8::create(*this,s2); }\n\nchar *\nGUTF8String::getbuf(int n)\n{\n  if(ptr)\n    init((*this)->getbuf(n));\n  else if(n>0)\n    init(GStringRep::UTF8::create(n));\n  else\n    init(0);\n  return ptr?((*this)->data):0;\n}\n\nvoid \nGUTF8String::setat(const int n, const char ch)\n{\n  if((!n)&&(!ptr))\n  {\n    init(GStringRep::UTF8::create(&ch,0,1));\n  }else\n  {\n    init((*this)->setat(CheckSubscript(n),ch));\n  }\n}\n\nGP<GStringRep>\nGStringRep::UTF8ToNative( const char *s, const EscapeMode escape )\n{\n  return GStringRep::UTF8::create(s)->toNative(escape);\n}\n\nGUTF8String::GUTF8String(const char dat)\n{ init(GStringRep::UTF8::create(&dat,0,1)); }\n\nGUTF8String::GUTF8String(const GUTF8String &fmt, va_list &args)\n{ \n  if (fmt.ptr)\n    init(fmt->vformat(args));\n  else \n    init(fmt); \n}\n\nGUTF8String::GUTF8String(const char *str)\n{ init(GStringRep::UTF8::create(str)); }\n\nGUTF8String::GUTF8String(const unsigned char *str)\n{ init(GStringRep::UTF8::create((const char *)str)); }\n\nGUTF8String::GUTF8String(const uint16_t *str)\n{ init(GStringRep::UTF8::create(str,0,-1)); }\n\nGUTF8String::GUTF8String(const uint32_t *str)\n{ init(GStringRep::UTF8::create(str,0,-1)); }\n\nGUTF8String::GUTF8String(const char *dat, unsigned int len)\n{ init(GStringRep::UTF8::create(dat,0,((int)len<0)?(-1):(int)len)); }\n\nGUTF8String::GUTF8String(const uint16_t *dat, unsigned int len)\n{ init(GStringRep::UTF8::create(dat,0,((int)len<0)?(-1):(int)len)); }\n\nGUTF8String::GUTF8String(const uint32_t *dat, unsigned int len)\n{ init(GStringRep::UTF8::create(dat,0,((int)len<0)?(-1):(int)len)); }\n\nGUTF8String::GUTF8String(const GBaseString &gs, int from, int len)\n{ init(GStringRep::UTF8::create(gs,from,((int)len<0)?(-1):(int)len)); }\n\nGUTF8String::GUTF8String(const int number)\n{ init(GStringRep::UTF8::create_format(\"%d\",number)); }\n\nGUTF8String::GUTF8String(const double number)\n{ init(GStringRep::UTF8::create_format(\"%f\",number)); }\n\nGUTF8String& GUTF8String::operator= (const char str)\n{ return init(GStringRep::UTF8::create(&str,0,1)); }\n\nGUTF8String& GUTF8String::operator= (const char *str)\n{ return init(GStringRep::UTF8::create(str)); }\n\nGUTF8String GBaseString::operator+(const GUTF8String &s2) const\n{ return GStringRep::UTF8::create(*this,s2); }\n\n#if HAS_WCHAR\nGUTF8String\nGNativeString::operator+(const GUTF8String &s2) const\n{\n  if (ptr)\n    return GStringRep::UTF8::create((*this)->toUTF8(true),s2);\n  else\n    return GStringRep::UTF8::create((*this),s2);\n}\n#endif\n\nGUTF8String\nGUTF8String::operator+(const GNativeString &s2) const\n{\n  GP<GStringRep> g = s2;\n  if (s2.ptr)\n    g = s2->toUTF8(true);\n  return GStringRep::UTF8::create(*this,g);\n}\n\nGUTF8String\noperator+(const char    *s1, const GUTF8String &s2)\n{ return GStringRep::UTF8::create(s1,s2); }\n\n#if HAS_WCHAR\nGNativeString\noperator+(const char    *s1, const GNativeString &s2)\n{ return GStringRep::Native::create(s1,s2); }\n\nGNativeString&\nGNativeString::operator+= (char ch)\n{\n  char s[2]; s[0]=ch; s[1]=0;\n  return init(GStringRep::Native::create((const char*)*this, s));\n}\n\nGNativeString&\nGNativeString::operator+= (const char *str)\n{\n  return init(GStringRep::Native::create(*this,str));\n}\n\nGNativeString&\nGNativeString::operator+= (const GBaseString &str)\n{\n  return init(GStringRep::Native::create(*this,str));\n}\n\nGNativeString\nGNativeString::operator+(const GBaseString &s2) const\n{ return GStringRep::Native::create(*this,s2); }\n\nGNativeString\nGNativeString::operator+(const GNativeString &s2) const\n{ return GStringRep::Native::create(*this,s2); }\n\nGNativeString\nGNativeString::operator+(const char    *s2) const\n{ return GStringRep::Native::create(*this,s2); }\n\nchar *\nGNativeString::getbuf(int n)\n{\n  if(ptr)\n    init((*this)->getbuf(n));\n  else if(n>0)\n    init(GStringRep::Native::create(n));\n  else\n    init(0);\n  return ptr?((*this)->data):0;\n}\n\nvoid\nGNativeString::setat(const int n, const char ch)\n{\n  if((!n)&&(!ptr))\n  {\n    init(GStringRep::Native::create(&ch,0,1));\n  }else\n  {\n    init((*this)->setat(CheckSubscript(n),ch));\n  }\n}\n\n#endif\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/GString.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _GSTRING_H_\n#define _GSTRING_H_\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n/** @name GString.h\n\n    Files #\"GString.h\"# and #\"GString.cpp\"# implement a general\n    purpose string class \\Ref{GBaseString}, with dirived types\n    \\Ref{GUTF8String} and \\Ref{GNativeString} for UTF8 MBS encoding\n    and the current Native MBS encoding respectively.  This\n    implementation relies on smart pointers (see\n    \\Ref{GSmartPointer.h}).\n\n    {\\bf Historical Comments} --- At some point during the DjVu\n    research era, it became clear that C++ compilers rarely provided\n    portable libraries. We then decided to avoid fancy classes (like\n    #iostream# or #string#) and to rely only on the good old C\n    library.  A good string class however is very useful.  We had\n    already randomly picked letter 'G' to prefix class names and we\n    logically derived the new class name.  Native English speakers\n    kept laughing in hiding.  This is ironic because we completely\n    forgot this letter 'G' when creating more challenging things\n    like the ZP Coder or the IW44 wavelets.  \n\n    {\\bf Later Changes} \n    When converting to I18N, we (Lizardtech) decided that two string classes\n    where needing, replacing the original GString with \\Ref{GUTF8String} and\n    \\Ref{GNativeString}.\n\n    @memo\n    General purpose string class.\n    @author\n    L\\'eon Bottou <leonb@research.att.com> -- initial implementation.\\\\\n\n// From: Leon Bottou, 1/31/2002\n// This file has very little to do with my initial implementation.\n// It has been practically rewritten by Lizardtech for i18n changes.\n// My original implementation was very small in comparison\n// <http://prdownloads.sourceforge.net/djvu/DjVu2_2b-src.tgz>.\n// In my opinion, the duplication of the string classes is a failed\n// attempt to use the type system to enforce coding policies.\n// This could be fixed.  But there are better things to do in djvulibre.\n    \n*/\n//@{\n\n\n#include \"DjVuGlobal.h\"\n#include \"GContainer.h\"\n\n#include <stddef.h>\n#include <stdlib.h>\n#include <stdarg.h>\n#ifdef WIN32\n# include <windows.h>\n# define HAS_WCHAR 1\n# define HAS_WCTYPE 1\n# define HAS_MBSTATE 1\n#endif\n\n#if HAS_WCHAR\n# if !defined(AUTOCONF) || HAVE_WCHAR_H\n#  include <wchar.h>\n# endif\n#endif\n\n#if HAVE_STDINT_H\n# include <stdint.h>\n#elif HAVE_INTTYPES_H\n# include <inttypes.h>\n#else\n# ifdef WIN32\ntypedef unsigned __int32 uint32_t;\ntypedef unsigned __int16 uint16_t;\n# else\n# pragma message(\"Please verify defs for uint32_t and uint16_t\")\ntypedef unsigned int   uint32_t // verify\ntypedef unsigned short uint16_t // verify\n# endif\n#endif\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n#if !HAS_MBSTATE\n# ifndef HAVE_MBSTATE_T\ntypedef int mbstate_t;\n# endif\n#endif\n\nclass GBaseString;\nclass GUTF8String;\nclass GNativeString;\n\n// Internal string representation.\nclass DJVUAPI GStringRep : public GPEnabled\n{\npublic:\n  enum EncodeType { XUCS4, XUCS4BE, XUCS4LE, XUCS4_2143, XUCS4_3412,\n    XUTF16, XUTF16BE, XUTF16LE, XUTF8, XEBCDIC, XOTHER } ;\n\n  enum EscapeMode { UNKNOWN_ESCAPED=0,  IS_ESCAPED=1, NOT_ESCAPED=2 };\n\n  class UTF8;\n  friend class UTF8;\n  class Unicode;\n  friend class Unicode;\n\n  class ChangeLocale;\n#if HAS_WCHAR\n  class Native;\n  friend class Native;\n#endif // HAS_WCHAR\n  friend class GBaseString;\n  friend class GUTF8String;\n  friend class GNativeString;\n  friend DJVUAPI unsigned int hash(const GBaseString &ref);\n\npublic:\n  // default constructor\n  GStringRep(void);\n  // virtual destructor\n  virtual ~GStringRep();\n\n    // Other virtual methods.\n      // Create an empty string.\n  virtual GP<GStringRep> blank(const unsigned int sz) const = 0;\n      // Create a duplicate at the given size.\n  GP<GStringRep>  getbuf(int n) const;\n      // Change the value of one of the bytes.\n  GP<GStringRep> setat(int n, char ch) const;\n      // Append a string.\n  virtual GP<GStringRep> append(const GP<GStringRep> &s2) const = 0;\n      // Test if isUTF8.\n  virtual bool isUTF8(void) const { return false; }\n      // Test if Native.\n  virtual bool isNative(void) const { return false; }\n      // Convert to Native.\n  virtual GP<GStringRep> toNative(\n    const EscapeMode escape=UNKNOWN_ESCAPED ) const = 0;\n      // Convert to UTF8.\n  virtual GP<GStringRep> toUTF8(const bool nothrow=false) const = 0;\n      // Convert to same as current class.\n  virtual GP<GStringRep> toThis(\n    const GP<GStringRep> &rep,const GP<GStringRep> &locale=0) const = 0;\n      // Compare with #s2#.\n  virtual int cmp(const GP<GStringRep> &s2,const int len=(-1)) const = 0;\n\n  // Convert strings to numbers.\n  virtual int toInt(void) const = 0;\n  virtual long int toLong(\n    const int pos, int &endpos, const int base=10) const = 0;\n  virtual unsigned long toULong(\n    const int pos, int &endpos, const int base=10) const = 0;\n  virtual double toDouble(const int pos, int &endpos) const = 0;\n\n  // return the position of the next character\n  int nextChar( const int from=0 ) const;\n\n  // return next non space position\n  int nextNonSpace( const int from=0, const int len=(-1) ) const;\n\n  // return next white space position\n  int nextSpace( const int from=0, const int len=(-1) ) const;\n\n  // return the position after the last non-whitespace character.\n  int firstEndSpace( int from=0, const int len=(-1) ) const;\n\n    // Create an empty string.\n  template <class TYPE> static GP<GStringRep> create(\n    const unsigned int sz,TYPE *);\n    // Creates with a strdup string.\n  GP<GStringRep> strdup(const char *s) const;\n\n    // Creates by appending to the current string\n  GP<GStringRep> append(const char *s2) const;\n\n    // Creates with a concat operation.\n  GP<GStringRep> concat(const GP<GStringRep> &s1,const GP<GStringRep> &s2) const;\n  GP<GStringRep> concat(const char *s1,const GP<GStringRep> &s2) const;\n  GP<GStringRep> concat(const GP<GStringRep> &s1,const char *s2) const;\n  GP<GStringRep> concat(const char *s1,const char *s2) const;\n\n   /* Creates with a strdup and substr.  Negative values have strlen(s)+1\n      added to them.\n   */\n  GP<GStringRep> substr(\n    const char *s,const int start,const int length=(-1)) const;\n\n  GP<GStringRep> substr(\n    const uint16_t *s,const int start,const int length=(-1)) const;\n\n  GP<GStringRep> substr(\n    const uint32_t *s,const int start,const int length=(-1)) const;\n\n  /** Initializes a string with a formatted string (as in #vprintf#).  The\n      string is re-initialized with the characters generated according to the\n      specified format #fmt# and using the optional arguments.  See the ANSI-C\n      function #vprintf()# for more information. The current implementation\n      will cause a segmentation violation if the resulting string is longer\n      than 32768 characters. */\n  GP<GStringRep> vformat(va_list args) const;\n  // -- SEARCHING\n\n  static GP<GStringRep> UTF8ToNative( const char *s,\n    const EscapeMode escape=UNKNOWN_ESCAPED );\n  static GP<GStringRep> NativeToUTF8( const char *s );\n\n  // Creates an uppercase version of the current string.\n  GP<GStringRep> upcase(void) const;\n  // Creates a lowercase version of the current string.\n  GP<GStringRep> downcase(void) const;\n\n  /** Returns the next UCS4 character, and updates the pointer s. */\n  static uint32_t UTF8toUCS4(\n    unsigned char const *&s, void const * const endptr );\n\n  /** Returns the number of bytes in next UCS4 character,\n      and sets #w# to the next UCS4 chacter.  */\n  static int UTF8toUCS4(\n    uint32_t &w, unsigned char const s[], void const * const endptr )\n  { unsigned char const *r=s;w=UTF8toUCS4(r,endptr);return (int)((size_t)r-(size_t)s); }\n\n  /** Returns the next UCS4 word from the UTF16 string. */\n  static int UTF16toUCS4(\n     uint32_t &w, uint16_t const * const s,void const * const eptr);\n\n  static int UCS4toUTF16(\n    uint32_t w, uint16_t &w1, uint16_t &w2);\n\n  int cmp(const char *s2, const int len=(-1)) const;\n  static int cmp(\n    const GP<GStringRep> &s1, const GP<GStringRep> &s2, const int len=(-1)) ;\n  static int cmp(\n    const GP<GStringRep> &s1, const char *s2, const int len=(-1));\n  static int cmp(\n    const char *s1, const GP<GStringRep> &s2, const int len=(-1));\n  static int cmp(\n    const char *s1, const char *s2, const int len=(-1));\n\n  // Lookup the next character, and return the position of the next character.\n  int getUCS4(uint32_t &w, const int from) const;\n\n  virtual unsigned char *UCS4toString(\n    const uint32_t w, unsigned char *ptr, mbstate_t *ps=0) const = 0;\n\n  static unsigned char *UCS4toUTF8(\n    const uint32_t w,unsigned char *ptr);\n\n  static unsigned char *UCS4toNative(\n    const uint32_t w,unsigned char *ptr, mbstate_t *ps);\n\n  int search(char c, int from=0) const;\n\n  int search(char const *str, int from=0) const;\n\n  int rsearch(char c, int from=0) const;\n\n  int rsearch(char const *str, int from=0) const;\n\n  int contains(char const accept[], int from=0) const;\n\n  int rcontains(char const accept[], int from=0) const;\n\nprotected:\n  // Return the next character and increment the source pointer.\n  virtual uint32_t getValidUCS4(const char *&source) const = 0;\n\n  GP<GStringRep> tocase(\n    bool (*xiswcase)(const unsigned long wc),\n    unsigned long (*xtowcase)(const unsigned long wc)) const;\n\n  // Tests if the specified character passes the xiswtest.  If so, the\n  // return pointer is incremented to the next character, otherwise the\n  // specified #ptr# is returned.\n  const char * isCharType( bool (*xiswtest)(const unsigned long wc), const char *ptr,\n    const bool reverse=false) const;\n\n  // Find the next character position that passes the isCharType test.\n  int nextCharType(\n    bool (*xiswtest)(const unsigned long wc),const int from,const int len,\n    const bool reverse=false) const;\n\n  static bool giswspace(const unsigned long w);\n  static bool giswupper(const unsigned long w);\n  static bool giswlower(const unsigned long w);\n  static unsigned long gtowupper(const unsigned long w);\n  static unsigned long gtowlower(const unsigned long w);\n\n  virtual void set_remainder( void const * const buf, const unsigned int size,\n    const EncodeType encodetype);\n  virtual void set_remainder( void const * const buf, const unsigned int size,\n    const GP<GStringRep> &encoding );\n  virtual void set_remainder ( const GP<Unicode> &remainder );\n\n  virtual GP<Unicode> get_remainder( void ) const;\n\npublic:\n  /* Returns a copy of this string with characters used in XML with\n      '<'  to \"&lt;\", '>'  to \"&gt;\",  '&' to \"&amp;\" '\\'' to\n      \"&apos;\", and  '\\\"' to  \"&quot;\".   Characters 0x01 through\n      0x1f are also escaped. */\n  GP<GStringRep> toEscaped( const bool tosevenbit ) const;\n\n  // Tests if a string is legally encoded in the current character set.\n  virtual bool is_valid(void) const = 0;\n#if HAS_WCHAR\n  virtual int ncopy(wchar_t * const buf, const int buflen) const = 0;\n#endif\nprotected:\n\n// Actual string data.\n  int  size;\n  char *data;\n};\n\nclass DJVUAPI GStringRep::UTF8 : public GStringRep\n{\npublic:\n  // default constructor\n  UTF8(void);\n  // virtual destructor\n  virtual ~UTF8();\n\n    // Other virtual methods.\n  virtual GP<GStringRep> blank(const unsigned int sz = 0) const;\n  virtual GP<GStringRep> append(const GP<GStringRep> &s2) const;\n      // Test if Native.\n  virtual bool isUTF8(void) const;\n      // Convert to Native.\n  virtual GP<GStringRep> toNative(\n    const EscapeMode escape=UNKNOWN_ESCAPED) const;\n      // Convert to UTF8.\n  virtual GP<GStringRep> toUTF8(const bool nothrow=false) const;\n      // Convert to same as current class.\n  virtual GP<GStringRep> toThis(\n    const GP<GStringRep> &rep,const GP<GStringRep> &) const;\n      // Compare with #s2#.\n  virtual int cmp(const GP<GStringRep> &s2,const int len=(-1)) const;\n\n  static GP<GStringRep> create(const unsigned int sz = 0);\n\n  // Convert strings to numbers.\n  virtual int toInt(void) const;\n  virtual long int toLong(\n    const int pos, int &endpos, const int base=10) const;\n  virtual unsigned long toULong(\n    const int pos, int &endpos, const int base=10) const;\n  virtual double toDouble(\n    const int pos, int &endpos) const;\n\n    // Create a strdup string.\n  static GP<GStringRep> create(const char *s);\n\n   // Creates with a concat operation.\n  static GP<GStringRep> create(\n    const GP<GStringRep> &s1,const GP<GStringRep> &s2);\n  static GP<GStringRep> create( const GP<GStringRep> &s1,const char *s2);\n  static GP<GStringRep> create( const char *s1, const GP<GStringRep> &s2);\n  static GP<GStringRep> create( const char *s1,const char *s2);\n\n    // Create with a strdup and substr operation.\n  static GP<GStringRep> create(\n    const char *s,const int start,const int length=(-1));\n\n  static GP<GStringRep> create(\n    const uint16_t *s,const int start,const int length=(-1));\n\n  static GP<GStringRep> create(\n    const uint32_t *s,const int start,const int length=(-1));\n\n  static GP<GStringRep> create_format(const char fmt[],...);\n  static GP<GStringRep> create(const char fmt[],va_list& args);\n\n  virtual unsigned char *UCS4toString(\n    const uint32_t w,unsigned char *ptr, mbstate_t *ps=0) const;\n\n  // Tests if a string is legally encoded in the current character set.\n  virtual bool is_valid(void) const;\n#if HAS_WCHAR\n  virtual int ncopy(wchar_t * const buf, const int buflen) const;\n#endif\n  friend class GBaseString;\n\nprotected:\n  // Return the next character and increment the source pointer.\n  virtual uint32_t getValidUCS4(const char *&source) const;\n};\n\n\n/** General purpose character string.\n    Each dirivied instance of class #GBaseString# represents a\n    character string.  Overloaded operators provide a value semantic\n    to #GBaseString# objects.  Conversion operators and constructors\n    transparently convert between #GBaseString# objects and\n    #const char*# pointers.  The #GBaseString# class has no public\n    constructors, since a dirived type should always be used\n    to specify the desired multibyte character encoding.\n\n    Functions taking strings as arguments should declare their\n    arguments as \"#const char*#\".  Such functions will work equally\n    well with dirived #GBaseString# objects since there is a fast\n    conversion operator from the dirivied #GBaseString# objects\n    to \"#const char*#\".  Functions returning strings should return\n    #GUTF8String# or #GNativeString# objects because the class will\n    automatically manage the necessary memory.\n\n    Characters in the string can be identified by their position.  The\n    first character of a string is numbered zero. Negative positions\n    represent characters relative to the end of the string (i.e.\n    position #-1# accesses the last character of the string,\n    position #-2# represents the second last character, etc.)  */\n\nclass DJVUAPI GBaseString : protected GP<GStringRep>\n{\npublic:\n  enum EscapeMode {\n    UNKNOWN_ESCAPED=GStringRep::UNKNOWN_ESCAPED,\n    IS_ESCAPED=GStringRep::IS_ESCAPED,\n    NOT_ESCAPED=GStringRep::NOT_ESCAPED };\n\n  friend class GUTF8String;\n  friend class GNativeString;\nprotected:\n  // Sets the gstr pointer;\n  inline void init(void);\n\n  ~GBaseString();\n  inline GBaseString &init(const GP<GStringRep> &rep);\n\n  // -- CONSTRUCTORS\n  /** Null constructor. Constructs an empty string. */\n  GBaseString( void );\n\npublic:\n  // -- ACCESS\n  /** Converts a string into a constant null terminated character\n      array.  This conversion operator is very efficient because\n      it simply returns a pointer to the internal string data. The\n      returned pointer remains valid as long as the string is\n      unmodified. */\n  operator const char* ( void ) const  ;\n  /// Returns the string length.\n  unsigned int length( void ) const;\n  /** Returns true if and only if the string contains zero characters.\n      This operator is useful for conditional expression in control\n      structures.\n      \\begin{verbatim}\n         if (! str) { ... }\n         while (!! str) { ... }  -- Note the double operator!\n      \\end{verbatim}\n      Class #GBaseString# does not to support syntax\n      \"#if# #(str)# #{}#\" because the required conversion operator\n      introduces dangerous ambiguities with certain compilers. */\n  bool operator! ( void ) const;\n\n  // -- INDEXING\n  /** Returns the character at position #n#. An exception\n      \\Ref{GException} is thrown if number #n# is not in range #-len#\n      to #len-1#, where #len# is the length of the string.  The first\n      character of a string is numbered zero.  Negative positions\n      represent characters relative to the end of the string. */\n  char operator[] (int n) const;\n  /// Returns #TRUE# if the string contains an integer number.\n  bool is_int(void) const;\n  /// Returns #TRUE# if the string contains a float number.\n  bool is_float(void) const;\n\n  /** Converts strings between native & UTF8 **/\n  GNativeString getUTF82Native( EscapeMode escape=UNKNOWN_ESCAPED ) const;\n  GUTF8String getNative2UTF8( void ) const;\n\n  // -- ALTERING\n  /// Reinitializes a string with the null string.\n  void empty( void );\n  // -- SEARCHING\n  /** Searches character #c# in the string, starting at position\n      #from# and scanning forward until reaching the end of the\n      string.  This function returns the position of the matching\n      character.  It returns #-1# if character #c# cannot be found. */\n  int search(char c, int from=0) const;\n\n  /** Searches sub-string #str# in the string, starting at position\n      #from# and scanning forward until reaching the end of the\n      string.  This function returns the position of the first\n      matching character of the sub-string.  It returns #-1# if\n      string #str# cannot be found. */\n  int search(const char *str, int from=0) const;\n\n  /** Searches character #c# in the string, starting at position\n      #from# and scanning backwards until reaching the beginning of\n      the string.  This function returns the position of the matching\n      character.  It returns #-1# if character #c# cannot be found. */\n  int rsearch(char c, const int from=0) const;\n  /** Searches sub-string #str# in the string, starting at position\n      #from# and scanning backwards until reaching the beginning of\n      the string.  This function returns the position of the first\n      matching character of the sub-string. It returns #-1# if\n      string #str# cannot be found. */\n  int rsearch(const char *str, const int from=0) const;\n  /** Searches for any of the specified characters in the accept\n      string.  It returns #-1# if the none of the characters and\n      be found, otherwise the position of the first match. */\n  int contains(const char accept[], const int from=0) const;\n  /** Searches for any of the specified characters in the accept\n      string.  It returns #-1# if the none of the characters and be\n      found, otherwise the position of the last match. */\n  int rcontains(const char accept[], const int from=0) const;\n\n  /** Concatenates strings. Returns a string composed by concatenating\n      the characters of strings #s1# and #s2#. */\n  GUTF8String operator+(const GUTF8String &s2) const;\n  GNativeString operator+(const GNativeString &s2) const;\n\n  /** Returns an integer.  Implements i18n atoi.  */\n  int toInt(void) const;\n\n  /** Returns a long intenger.  Implments i18n strtol.  */\n  long toLong(const int pos, int &endpos, const int base=10) const;\n\n  /** Returns a unsigned long integer.  Implements i18n strtoul. */\n  unsigned long toULong(\n    const int pos, int &endpos, const int base=10) const;\n\n  /** Returns a double.  Implements the i18n strtod.  */\n  double toDouble(\n    const int pos, int &endpos ) const;\n\n  /** Returns a long intenger.  Implments i18n strtol.  */\n  static long toLong(\n    const GUTF8String& src, const int pos, int &endpos, const int base=10);\n\n  static unsigned long toULong(\n    const GUTF8String& src, const int pos, int &endpos, const int base=10);\n\n  static double toDouble(\n    const GUTF8String& src, const int pos, int &endpos);\n\n  /** Returns a long intenger.  Implments i18n strtol.  */\n  static long toLong(\n    const GNativeString& src, const int pos, int &endpos, const int base=10);\n\n  static unsigned long toULong(\n    const GNativeString& src, const int pos, int &endpos, const int base=10);\n\n  static double toDouble(\n    const GNativeString& src, const int pos, int &endpos);\n\n  // -- HASHING\n\n  // -- COMPARISONS\n    /** Returns an #int#.  Compares string with #s2# and returns\n        sorting order. */\n  int cmp(const GBaseString &s2, const int len=(-1)) const;\n    /** Returns an #int#.  Compares string with #s2# and returns\n        sorting order. */\n  int cmp(const char *s2, const int len=(-1)) const;\n    /** Returns an #int#.  Compares string with #s2# and returns\n        sorting order. */\n  int cmp(const char s2) const;\n    /** Returns an #int#.  Compares #s2# with #s2# and returns\n        sorting order. */\n  static int cmp(const char *s1, const char *s2, const int len=(-1));\n  /** Returns a boolean. The Standard C strncmp takes two string and\n      compares the first N characters.  static bool GBaseString::ncmp\n      will compare #s1# with #s2# with the #len# characters starting\n      from the beginning of the string. */\n  /** String comparison. Returns true if and only if character\n      strings #s1# and #s2# are equal (as with #strcmp#.)\n    */\n  bool operator==(const GBaseString &s2) const;\n  bool operator==(const char *s2) const;\n  friend bool operator==(const char    *s1, const GBaseString &s2);\n\n  /** String comparison. Returns true if and only if character\n      strings #s1# and #s2# are not equal (as with #strcmp#.)\n    */\n  bool operator!=(const GBaseString &s2) const;\n  bool operator!=(const char *s2) const;\n  friend bool operator!=(const char *s1, const GBaseString &s2);\n\n  /** String comparison. Returns true if and only if character\n      strings #s1# is lexicographically greater than or equal to\n      string #s2# (as with #strcmp#.) */\n  bool operator>=(const GBaseString &s2) const;\n  bool operator>=(const char *s2) const;\n  bool operator>=(const char s2) const;\n  friend bool operator>=(const char    *s1, const GBaseString &s2);\n  friend bool operator>=(const char s1, const GBaseString &s2);\n\n  /** String comparison. Returns true if and only if character\n      strings #s1# is lexicographically less than string #s2#\n      (as with #strcmp#.)\n   */\n  bool operator<(const GBaseString &s2) const;\n  bool operator<(const char *s2) const;\n  bool operator<(const char s2) const;\n  friend bool operator<(const char *s1, const GBaseString &s2);\n  friend bool operator<(const char s1, const GBaseString &s2);\n\n  /** String comparison. Returns true if and only if character\n      strings #s1# is lexicographically greater than string #s2#\n      (as with #strcmp#.)\n   */\n  bool operator> (const GBaseString &s2) const;\n  bool operator> (const char *s2) const;\n  bool operator> (const char s2) const;\n  friend bool operator> (const char    *s1, const GBaseString &s2);\n  friend bool operator> (const char s1, const GBaseString &s2);\n\n  /** String comparison. Returns true if and only if character\n      strings #s1# is lexicographically less than or equal to string\n      #s2# (as with #strcmp#.)\n   */\n  bool operator<=(const GBaseString &s2) const;\n  bool operator<=(const char *s2) const;\n  bool operator<=(const char s2) const;\n  friend bool operator<=(const char    *s1, const GBaseString &s2);\n  friend bool operator<=(const char    s1, const GBaseString &s2);\n\n   /** Returns an integer.  Implements a functional i18n atoi. Note\n       that if you pass a GBaseString that is not in Native format\n       the results may be disparaging. */\n\n  /** Returns a hash code for the string.  This hashing function\n      helps when creating associative maps with string keys (see\n      \\Ref{GMap}).  This hash code may be reduced to an arbitrary\n      range by computing its remainder modulo the upper bound of\n      the range. */\n  friend DJVUAPI unsigned int hash(const GBaseString &ref);\n  // -- HELPERS\n  friend class GStringRep;\n\n  /// Returns next non space position.\n  int nextNonSpace( const int from=0, const int len=(-1) ) const;\n\n  /// Returns next character position.\n  int nextChar( const int from=0 ) const;\n\n  /// Returns next non space position.\n  int nextSpace( const int from=0, const int len=(-1) ) const;\n\n  /// return the position after the last non-whitespace character.\n  int firstEndSpace( const int from=0,const int len=(-1) ) const;\n\n  /// Tests if the string is legally encoded in the current codepage.\n  bool is_valid(void) const;\n\n  /// copy to a wchar_t buffer\n#if HAS_WCHAR\n  int ncopy(wchar_t * const buf, const int buflen) const;\n#endif\nprotected:\n  const char *gstr;\n  static void throw_illegal_subscript() no_return;\n  static const char *nullstr;\npublic:\n  GNativeString UTF8ToNative(\n    const bool currentlocale=false,\n    const EscapeMode escape=UNKNOWN_ESCAPED) const;\n  GUTF8String NativeToUTF8(void) const;\nprotected:\n  inline int CheckSubscript(int n) const;\n};\n\n/** General purpose character string.\n    Each instance of class #GUTF8String# represents a character\n    string.  Overloaded operators provide a value semantic to\n    #GUTF8String# objects.  Conversion operators and constructors\n    transparently convert between #GUTF8String# objects and\n    #const char*# pointers.\n\n    Functions taking strings as arguments should declare their\n    arguments as \"#const char*#\".  Such functions will work equally\n    well with #GUTF8String# objects since there is a fast conversion\n    operator from #GUTF8String# to \"#const char*#\".  Functions\n    returning strings should return #GUTF8String# or #GNativeString#\n    objects because the class will automatically manage the necessary\n    memory.\n\n    Characters in the string can be identified by their position.  The\n    first character of a string is numbered zero. Negative positions\n    represent characters relative to the end of the string (i.e.\n    position #-1# accesses the last character of the string,\n    position #-2# represents the second last character, etc.)  */\n\nclass DJVUAPI GUTF8String : public GBaseString\n{\npublic:\n  ~GUTF8String();\n  inline void init(void);\n\n  inline GUTF8String &init(const GP<GStringRep> &rep);\n\n  // -- CONSTRUCTORS\n  /** Null constructor. Constructs an empty string. */\n  GUTF8String(void);\n  /// Constructs a string from a character.\n  GUTF8String(const char dat);\n  /// Constructs a string from a null terminated character array.\n  GUTF8String(const char *str);\n  /// Constructs a string from a null terminated character array.\n  GUTF8String(const unsigned char *str);\n  GUTF8String(const uint16_t *dat);\n  GUTF8String(const uint32_t *dat);\n  /** Constructs a string from a character array.  Elements of the\n      character array #dat# are added into the string until the\n      string length reaches #len# or until encountering a null\n      character (whichever comes first). */\n  GUTF8String(const char *dat, unsigned int len);\n  GUTF8String(const uint16_t *dat, unsigned int len);\n  GUTF8String(const uint32_t *dat, unsigned int len);\n\n  /// Construct from base class.\n  GUTF8String(const GP<GStringRep> &str);\n  GUTF8String(const GBaseString &str);\n  GUTF8String(const GUTF8String &str);\n  GUTF8String(const GNativeString &str);\n  /** Constructs a string from a character array.  Elements of the\n      character array #dat# are added into the string until the\n      string length reaches #len# or until encountering a null\n      character (whichever comes first). */\n  GUTF8String(const GBaseString &gs, int from, int len);\n\n  /** Copy a null terminated character array. Resets this string\n      with the character string contained in the null terminated\n      character array #str#. */\n  GUTF8String& operator= (const char str);\n  GUTF8String& operator= (const char *str);\n  inline GUTF8String& operator= (const GP<GStringRep> &str);\n  inline GUTF8String& operator= (const GBaseString &str);\n  inline GUTF8String& operator= (const GUTF8String &str);\n  inline GUTF8String& operator= (const GNativeString &str);\n\n  /** Constructs a string with a formatted string (as in #vprintf#).\n      The string is re-initialized with the characters generated\n      according to the specified format #fmt# and using the optional\n      arguments.  See the ANSI-C function #vprintf()# for more\n      information. The current implementation will cause a\n      segmentation violation if the resulting string is longer\n      than 32768 characters. */\n  GUTF8String(const GUTF8String &fmt, va_list &args);\n\n  /// Constructs a string from a character.\n  /** Constructs a string with a human-readable representation of\n      integer #number#.  The format is similar to format #\"%d\"# in\n      function #printf#. */\n  GUTF8String(const int number);\n\n  /** Constructs a string with a human-readable representation of\n      floating point number #number#. The format is similar to\n      format #\"%f\"# in function #printf#.  */\n  GUTF8String(const double number);\n\n\n  /** Initializes a string with a formatted string (as in #printf#).\n      The string is re-initialized with the characters generated\n      according to the specified format #fmt# and using the optional\n      arguments.  See the ANSI-C function #printf()# for more\n      information. The current implementation will cause a\n      segmentation violation if the resulting string is longer\n      than 32768 characters. */\n  GUTF8String &format(const char *fmt, ... );\n  /** Initializes a string with a formatted string (as in #vprintf#).\n      The string is re-initialized with the characters generated\n      according to the specified format #fmt# and using the optional\n      arguments.  See the ANSI-C function #vprintf()# for more\n      information. The current implementation will cause a\n      segmentation violation if the resulting string is longer\n      than 32768 characters. */\n  GUTF8String &vformat(const GUTF8String &fmt, va_list &args);\n\n  /** Returns a copy of this string with characters used in XML with\n      '<'  to \"&lt;\", '>'  to \"&gt;\",  '&' to \"&amp;\" '\\'' to\n      \"&apos;\", and  '\\\"' to  \"&quot;\".   Characters 0x01 through\n      0x1f are also escaped. */\n  GUTF8String toEscaped( const bool tosevenbit=false ) const;\n\n  /** Converts strings containing HTML/XML escaped characters into\n      their unescaped forms. Numeric representations of characters\n      (e.g., \"&#38;\" or \"&#x26;\" for \"*\") are the only forms\n      converted by this function. */\n  GUTF8String fromEscaped( void ) const;\n\n  /** Converts strings containing HTML/XML escaped characters\n      (e.g., \"&lt;\" for \"<\") into their unescaped forms. The\n      conversion is partially defined by the ConvMap argument which\n      specifies the conversion strings to be recognized. Numeric\n      representations of characters (e.g., \"&#38;\" or \"&#x26;\"\n      for \"*\") are always converted. */\n  GUTF8String fromEscaped(\n    const GMap<GUTF8String,GUTF8String> ConvMap ) const;\n\n\n  // -- CONCATENATION\n  /// Appends character #ch# to the string.\n  GUTF8String& operator+= (char ch);\n\n  /// Appends the null terminated character array #str# to the string.\n  GUTF8String& operator+= (const char *str);\n  /// Appends the specified GBaseString to the string.\n  GUTF8String& operator+= (const GBaseString &str);\n\n  /** Returns a sub-string.  The sub-string is composed by copying\n      #len# characters starting at position #from# in this string.\n      The length of the resulting string may be smaller than #len#\n      if the specified range is too large. */\n  GUTF8String substr(int from, int len/*=(-1)*/) const;\n\n  /** Returns an upper case copy of this string.  The returned string\n      contains a copy of the current string with all letters turned\n      into upper case letters. */\n  GUTF8String upcase( void ) const;\n  /** Returns an lower case copy of this string.  The returned string\n      contains a copy of the current string with all letters turned\n      into lower case letters. */\n  GUTF8String downcase( void ) const;\n\n  /** Concatenates strings. Returns a string composed by concatenating\n      the characters of strings #s1# and #s2#.\n  */\n  GUTF8String operator+(const GBaseString &s2) const;\n  GUTF8String operator+(const GUTF8String &s2) const;\n  GUTF8String operator+(const GNativeString &s2) const;\n  GUTF8String operator+(const char *s2) const;\n  friend DJVUAPI GUTF8String operator+(const char *s1, const GUTF8String &s2);\n\n  /** Provides a direct access to the string buffer.  Returns a\n      pointer for directly accessing the string buffer.  This pointer\n      valid remains valid as long as the string is not modified by\n      other means.  Positive values for argument #n# represent the\n      length of the returned buffer.  The returned string buffer will\n      be large enough to hold at least #n# characters plus a null\n      character.  If #n# is positive but smaller than the string\n      length, the string will be truncated to #n# characters. */\n  char *getbuf(int n = -1);\n  /** Set the character at position #n# to value #ch#.  An exception\n      \\Ref{GException} is thrown if number #n# is not in range #-len#\n      to #len#, where #len# is the length of the string.  If character\n      #ch# is zero, the string is truncated at position #n#.  The\n      first character of a string is numbered zero. Negative\n      positions represent characters relative to the end of the\n      string. If position #n# is equal to the length of the string,\n      this function appends character #ch# to the end of the string. */\n  void setat(const int n, const char ch);\npublic:\n  typedef enum GStringRep::EncodeType EncodeType;\n  static GUTF8String create(void const * const buf,\n    const unsigned int size,\n    const EncodeType encodetype, const GUTF8String &encoding);\n  static GUTF8String create( void const * const buf,\n    unsigned int size, const EncodeType encodetype );\n  static GUTF8String create( void const * const buf,\n    const unsigned int size, const GUTF8String &encoding );\n  static GUTF8String create( void const * const buf,\n    const unsigned int size, const GP<GStringRep::Unicode> &remainder);\n  GP<GStringRep::Unicode> get_remainder(void) const;\n  static GUTF8String create( const char *buf, const unsigned int bufsize );\n  static GUTF8String create( const uint16_t *buf, const unsigned int bufsize );\n  static GUTF8String create( const uint32_t *buf, const unsigned int bufsize );\n};\n\n\n#if !HAS_WCHAR\n#define GBaseString GUTF8String\n#endif\n\n/** General purpose character string.\n    Each instance of class #GNativeString# represents a character\n    string.  Overloaded operators provide a value semantic to\n    #GNativeString# objects.  Conversion operators and constructors\n    transparently convert between #GNativeString# objects and\n    #const char*# pointers.\n\n    Functions taking strings as arguments should declare their\n    arguments as \"#const char*#\".  Such functions will work equally\n    well with #GNativeString# objects since there is a fast conversion\n    operator from #GNativeString# to \"#const char*#\".  Functions\n    returning strings should return #GUTF8String# or #GNativeString#\n    objects because the class will automatically manage the necessary\n    memory.\n\n    Characters in the string can be identified by their position.  The\n    first character of a string is numbered zero. Negative positions\n    represent characters relative to the end of the string (i.e.\n    position #-1# accesses the last character of the string,\n    position #-2# represents the second last character, etc.)  */\n\nclass DJVUAPI GNativeString : public GBaseString\n{\npublic:\n  ~GNativeString();\n  // -- CONSTRUCTORS\n  /** Null constructor. Constructs an empty string. */\n  GNativeString(void);\n  /// Constructs a string from a character.\n  GNativeString(const char dat);\n  /// Constructs a string from a null terminated character array.\n  GNativeString(const char *str);\n  /// Constructs a string from a null terminated character array.\n  GNativeString(const unsigned char *str);\n  GNativeString(const uint16_t *str);\n  GNativeString(const uint32_t *str);\n  /** Constructs a string from a character array.  Elements of the\n      character array #dat# are added into the string until the\n      string length reaches #len# or until encountering a null\n      character (whichever comes first). */\n  GNativeString(const char *dat, unsigned int len);\n  GNativeString(const uint16_t *dat, unsigned int len);\n  GNativeString(const uint32_t *dat, unsigned int len);\n  /// Construct from base class.\n  GNativeString(const GP<GStringRep> &str);\n  GNativeString(const GBaseString &str);\n#if HAS_WCHAR\n  GNativeString(const GUTF8String &str);\n#endif\n  GNativeString(const GNativeString &str);\n  /** Constructs a string from a character array.  Elements of the\n      character array #dat# are added into the string until the\n      string length reaches #len# or until encountering a null\n      character (whichever comes first). */\n  GNativeString(const GBaseString &gs, int from, int len);\n\n  /** Constructs a string with a formatted string (as in #vprintf#).\n      The string is re-initialized with the characters generated\n      according to the specified format #fmt# and using the optional\n      arguments.  See the ANSI-C function #vprintf()# for more\n      information. The current implementation will cause a\n      segmentation violation if the resulting string is longer than\n      32768 characters. */\n  GNativeString(const GNativeString &fmt, va_list &args);\n\n  /** Constructs a string with a human-readable representation of\n      integer #number#.  The format is similar to format #\"%d\"# in\n      function #printf#. */\n  GNativeString(const int number);\n\n  /** Constructs a string with a human-readable representation of\n      floating point number #number#. The format is similar to\n      format #\"%f\"# in function #printf#.  */\n  GNativeString(const double number);\n\n#if !HAS_WCHAR\n#undef GBaseString\n#else\n  /// Initialize this string class\n  void init(void);\n\n  /// Initialize this string class\n  GNativeString &init(const GP<GStringRep> &rep);\n\n  /** Copy a null terminated character array. Resets this string with\n      the character string contained in the null terminated character\n      array #str#. */\n  GNativeString& operator= (const char str);\n  GNativeString& operator= (const char *str);\n  inline GNativeString& operator= (const GP<GStringRep> &str);\n  inline GNativeString& operator= (const GBaseString &str);\n  inline GNativeString& operator= (const GUTF8String &str);\n  inline GNativeString& operator= (const GNativeString &str);\n  // -- CONCATENATION\n  /// Appends character #ch# to the string.\n  GNativeString& operator+= (char ch);\n  /// Appends the null terminated character array #str# to the string.\n  GNativeString& operator+= (const char *str);\n  /// Appends the specified GBaseString to the string.\n  GNativeString& operator+= (const GBaseString &str);\n\n  /** Returns a sub-string.  The sub-string is composed by copying\n      #len# characters starting at position #from# in this string.\n      The length of the resulting string may be smaller than #len#\n      if the specified range is too large. */\n  GNativeString substr(int from, int len/*=(-1)*/) const;\n\n  /** Returns an upper case copy of this string.  The returned\n      string contains a copy of the current string with all letters\n      turned into upper case letters. */\n  GNativeString upcase( void ) const;\n  /** Returns an lower case copy of this string.  The returned\n      string contains a copy of the current string with all letters\n      turned into lower case letters. */\n  GNativeString downcase( void ) const;\n\n\n  GNativeString operator+(const GBaseString &s2) const;\n  GNativeString operator+(const GNativeString &s2) const;\n  GUTF8String operator+(const GUTF8String &s2) const;\n  GNativeString operator+(const char *s2) const;\n  friend DJVUAPI GNativeString operator+(const char *s1, const GNativeString &s2);\n\n  /** Initializes a string with a formatted string (as in #printf#).\n      The string is re-initialized with the characters generated\n      according to the specified format #fmt# and using the optional\n      arguments.  See the ANSI-C function #printf()# for more\n      information. The current implementation will cause a\n      segmentation violation if the resulting string is longer than\n      32768 characters. */\n  GNativeString &format(const char *fmt, ... );\n  /** Initializes a string with a formatted string (as in #vprintf#).\n      The string is re-initialized with the characters generated\n      according to the specified format #fmt# and using the optional\n      arguments.  See the ANSI-C function #vprintf()# for more\n      information. The current implementation will cause a\n      segmentation violation if the resulting string is longer than\n      32768 characters. */\n  GNativeString &vformat(const GNativeString &fmt, va_list &args);\n\n  /** Returns a copy of this string with characters used in XML with\n      '<'  to \"&lt;\", '>'  to \"&gt;\",  '&' to \"&amp;\" '\\'' to\n      \"&apos;\", and  '\\\"' to  \"&quot;\".   Characters 0x01 through\n      0x1f are also escaped. */\n  GNativeString toEscaped( const bool tosevenbit=false ) const;\n\n\n  /** Provides a direct access to the string buffer.  Returns a\n      pointer for directly accessing the string buffer.  This\n      pointer valid remains valid as long as the string is not\n      modified by other means.  Positive values for argument #n#\n      represent the length of the returned buffer.  The returned\n      string buffer will be large enough to hold at least #n#\n      characters plus a null character.  If #n# is positive but\n      smaller than the string length, the string will be truncated\n      to #n# characters. */\n  char *getbuf(int n = -1);\n  /** Set the character at position #n# to value #ch#.  An exception\n      \\Ref{GException} is thrown if number #n# is not in range #-len#\n      to #len#, where #len# is the length of the string.  If\n      character #ch# is zero, the string is truncated at position\n      #n#.  The first character of a string is numbered zero.\n      Negative positions represent characters relative to the end of\n      the string. If position #n# is equal to the length of the\n      string, this function appends character #ch# to the end of the\n      string. */\n  void setat(const int n, const char ch);\n\n  static GNativeString create( const char *buf, const unsigned int bufsize );\n  static GNativeString create( const uint16_t *buf, const unsigned int bufsize );\n  static GNativeString create( const uint32_t *buf, const unsigned int bufsize );\n#endif // WinCE\n};\n\n//@}\n\ninline\nGBaseString::operator const char* ( void ) const\n{\n  return ptr?(*this)->data:nullstr;\n}\n\ninline unsigned int\nGBaseString::length( void ) const\n{\n  return ptr ? (*this)->size : 0;\n}\n\ninline bool\nGBaseString::operator! ( void ) const\n{\n  return !ptr;\n}\n\ninline GUTF8String\nGUTF8String::upcase( void ) const\n{\n  if (ptr) return (*this)->upcase();\n  return *this;\n}\n\ninline GUTF8String\nGUTF8String::downcase( void ) const\n{\n  if (ptr) return (*this)->downcase();\n  return *this;\n}\n\ninline void\nGUTF8String::init(void)\n{ GBaseString::init(); }\n\ninline GUTF8String &\nGUTF8String::init(const GP<GStringRep> &rep)\n{ GP<GStringRep>::operator=(rep?rep->toUTF8(true):rep); init(); return *this; }\n\ninline GUTF8String &\nGUTF8String::vformat(const GUTF8String &fmt, va_list &args)\n{ return (*this = (fmt.ptr?GUTF8String(fmt,args):fmt)); }\n\ninline GUTF8String\nGUTF8String::toEscaped( const bool tosevenbit ) const\n{ return ptr?GUTF8String((*this)->toEscaped(tosevenbit)):(*this); }\n\ninline GP<GStringRep::Unicode> \nGUTF8String::get_remainder(void) const\n{\n  GP<GStringRep::Unicode> retval;\n  if(ptr)\n    retval=((*this)->get_remainder());\n  return retval;\n}\n\ninline\nGUTF8String::GUTF8String(const GNativeString &str)\n{ init(str.length()?(str->toUTF8(true)):(GP<GStringRep>)str); }\n\ninline\nGUTF8String::GUTF8String(const GP<GStringRep> &str)\n{ init(str?(str->toUTF8(true)):str); }\n\ninline\nGUTF8String::GUTF8String(const GBaseString &str)\n{ init(str.length()?(str->toUTF8(true)):(GP<GStringRep>)str); }\n\ninline void\nGBaseString::init(void)\n{\n  gstr=ptr?((*this)->data):nullstr;\n}\n/** Returns an integer.  Implements i18n atoi.  */\ninline int\nGBaseString::toInt(void) const\n{ return ptr?(*this)->toInt():0; }\n\n/** Returns a long intenger.  Implments i18n strtol.  */\ninline long\nGBaseString::toLong(const int pos, int &endpos, const int base) const\n{\n  long int retval=0;\n  if(ptr)\n  {\n    retval=(*this)->toLong(pos, endpos, base);\n  }else\n  {\n    endpos=(-1);\n  }\n  return retval;\n}\n\ninline long\nGBaseString::toLong(\n  const GUTF8String& src, const int pos, int &endpos, const int base)\n{\n  return src.toLong(pos,endpos,base);\n}\n\ninline long\nGBaseString::toLong(\n  const GNativeString& src, const int pos, int &endpos, const int base)\n{\n  return src.toLong(pos,endpos,base);\n}\n\n/** Returns a unsigned long integer.  Implements i18n strtoul. */\ninline unsigned long\nGBaseString::toULong(const int pos, int &endpos, const int base) const\n{\n  unsigned long retval=0;\n  if(ptr)\n  {\n    retval=(*this)->toULong(pos, endpos, base);\n  }else\n  {\n    endpos=(-1);\n  }\n  return retval;\n}\n\ninline unsigned long\nGBaseString::toULong(\n  const GUTF8String& src, const int pos, int &endpos, const int base)\n{\n  return src.toULong(pos,endpos,base);\n}\n\ninline unsigned long\nGBaseString::toULong(\n  const GNativeString& src, const int pos, int &endpos, const int base)\n{\n  return src.toULong(pos,endpos,base);\n}\n\n/** Returns a double.  Implements the i18n strtod.  */\ninline double\nGBaseString::toDouble(\n  const int pos, int &endpos ) const\n{\n  double retval=(double)0;\n  if(ptr)\n  {\n    retval=(*this)->toDouble(pos, endpos);\n  }else\n  {\n    endpos=(-1);\n  }\n  return retval;\n}\n\ninline double\nGBaseString::toDouble(\n  const GUTF8String& src, const int pos, int &endpos)\n{\n  return src.toDouble(pos,endpos);\n}\n\ninline double\nGBaseString::toDouble(\n  const GNativeString& src, const int pos, int &endpos)\n{\n  return src.toDouble(pos,endpos);\n}\n\ninline GBaseString &\nGBaseString::init(const GP<GStringRep> &rep)\n{ GP<GStringRep>::operator=(rep); init(); return *this;}\n\ninline char\nGBaseString::operator[] (int n) const\n{ return ((n||ptr)?((*this)->data[CheckSubscript(n)]):0); }\n\ninline int\nGBaseString::search(char c, int from) const\n{ return ptr?((*this)->search(c,from)):(-1); }\n\ninline int\nGBaseString::search(const char *str, int from) const\n{ return ptr?((*this)->search(str,from)):(-1); }\n\ninline int\nGBaseString::rsearch(char c, const int from) const\n{ return ptr?((*this)->rsearch(c,from)):(-1); }\n\ninline int\nGBaseString::rsearch(const char *str, const int from) const\n{ return ptr?((*this)->rsearch(str,from)):(-1); }\n\ninline int\nGBaseString::contains(const char accept[], const int from) const\n{ return ptr?((*this)->contains(accept,from)):(-1); }\n\ninline int\nGBaseString::rcontains(const char accept[], const int from) const\n{ return ptr?((*this)->rcontains(accept,from)):(-1); }\n\ninline int\nGBaseString::cmp(const GBaseString &s2, const int len) const\n{ return GStringRep::cmp(*this,s2,len); }\n\ninline int\nGBaseString::cmp(const char *s2, const int len) const\n{ return GStringRep::cmp(*this,s2,len); }\n\ninline int\nGBaseString::cmp(const char s2) const\n{ return GStringRep::cmp(*this,&s2,1); }\n\ninline int\nGBaseString::cmp(const char *s1, const char *s2, const int len)\n{ return GStringRep::cmp(s1,s2,len); }\n\ninline bool\nGBaseString::operator==(const GBaseString &s2) const\n{ return !cmp(s2); }\n\ninline bool\nGBaseString::operator==(const char *s2) const\n{ return !cmp(s2); }\n\ninline bool\nGBaseString::operator!=(const GBaseString &s2) const\n{ return !!cmp(s2); }\n\ninline bool\nGBaseString::operator!=(const char *s2) const\n{ return !!cmp(s2); }\n\ninline bool\nGBaseString::operator>=(const GBaseString &s2) const\n{ return (cmp(s2)>=0); }\n\ninline bool\nGBaseString::operator>=(const char *s2) const\n{ return (cmp(s2)>=0); }\n\ninline bool\nGBaseString::operator>=(const char s2) const\n{ return (cmp(s2)>=0); }\n\ninline bool\nGBaseString::operator<(const GBaseString &s2) const\n{ return (cmp(s2)<0); }\n\ninline bool\nGBaseString::operator<(const char *s2) const\n{ return (cmp(s2)<0); }\n\ninline bool\nGBaseString::operator<(const char s2) const\n{ return (cmp(s2)<0); }\n\ninline bool\nGBaseString::operator> (const GBaseString &s2) const\n{ return (cmp(s2)>0); }\n\ninline bool\nGBaseString::operator> (const char *s2) const\n{ return (cmp(s2)>0); }\n\ninline bool\nGBaseString::operator> (const char s2) const\n{ return (cmp(s2)>0); }\n\ninline bool\nGBaseString::operator<=(const GBaseString &s2) const\n{ return (cmp(s2)<=0); }\n\ninline bool\nGBaseString::operator<=(const char *s2) const\n{ return (cmp(s2)<=0); }\n\ninline bool\nGBaseString::operator<=(const char s2) const\n{ return (cmp(s2)<=0); }\n\ninline int\nGBaseString::nextNonSpace( const int from, const int len ) const\n{ return ptr?(*this)->nextNonSpace(from,len):0; }\n\ninline int\nGBaseString::nextChar( const int from ) const\n{ return ptr?(*this)->nextChar(from):0; }\n\ninline int\nGBaseString::nextSpace( const int from, const int len ) const\n{ return ptr?(*this)->nextSpace(from,len):0; }\n\ninline int\nGBaseString::firstEndSpace( const int from,const int len ) const\n{ return ptr?(*this)->firstEndSpace(from,len):0; }\n\ninline bool\nGBaseString::is_valid(void) const\n{ return ptr?((*this)->is_valid()):true; }\n\n#if HAS_WCHAR\ninline int\nGBaseString::ncopy(wchar_t * const buf, const int buflen) const\n{if(buf&&buflen)buf[0]=0;return ptr?((*this)->ncopy(buf,buflen)):0;}\n#endif\n\ninline int\nGBaseString::CheckSubscript(int n) const\n{\n  if(n)\n  {\n    if (n<0 && ptr)\n      n += (*this)->size;\n    if (n<0 || !ptr || n > (int)(*this)->size)\n      throw_illegal_subscript();\n  }\n  return n;\n}\n\ninline GBaseString::GBaseString(void) { init(); }\n\ninline GUTF8String::GUTF8String(void) { }\n\ninline GUTF8String::GUTF8String(const GUTF8String &str)\n{ init(str); }\n\ninline GUTF8String& GUTF8String::operator= (const GP<GStringRep> &str)\n{ return init(str); }\n\ninline GUTF8String& GUTF8String::operator= (const GBaseString &str)\n{ return init(str); }\n\ninline GUTF8String& GUTF8String::operator= (const GUTF8String &str)\n{ return init(str); }\n\ninline GUTF8String& GUTF8String::operator= (const GNativeString &str)\n{ return init(str); }\n\ninline GUTF8String\nGUTF8String::create( const char *buf, const unsigned int bufsize )\n{\n#if HAS_WCHAR\n  return GNativeString(buf,bufsize);\n#else\n  return GUTF8String(buf,bufsize);\n#endif\n}\n\ninline GUTF8String\nGUTF8String::create( const uint16_t *buf, const unsigned int bufsize )\n{\n  return GUTF8String(buf,bufsize);\n}\n\ninline GUTF8String\nGUTF8String::create( const uint32_t *buf, const unsigned int bufsize )\n{\n  return GUTF8String(buf,bufsize);\n}\n\ninline GNativeString::GNativeString(void) {}\n\n#if !HAS_WCHAR\n// For Windows CE, GNativeString is essentially GUTF8String\n\ninline\nGNativeString::GNativeString(const GUTF8String &str)\n: GUTF8String(str) {}\n\ninline\nGNativeString::GNativeString(const GP<GStringRep> &str)\n: GUTF8String(str) {}\n\ninline\nGNativeString::GNativeString(const char dat)\n: GUTF8String(dat) {}\n\ninline\nGNativeString::GNativeString(const char *str)\n: GUTF8String(str) {}\n\ninline\nGNativeString::GNativeString(const unsigned char *str)\n: GUTF8String(str) {}\n\ninline\nGNativeString::GNativeString(const uint16_t *str)\n: GUTF8String(str) {}\n\ninline\nGNativeString::GNativeString(const uint32_t *str)\n: GUTF8String(str) {}\n\ninline\nGNativeString::GNativeString(const char *dat, unsigned int len)\n: GUTF8String(dat,len) {}\n\ninline\nGNativeString::GNativeString(const uint16_t *dat, unsigned int len)\n: GUTF8String(dat,len) {}\n\ninline\nGNativeString::GNativeString(const uint32_t *dat, unsigned int len)\n: GUTF8String(dat,len) {}\n\ninline\nGNativeString::GNativeString(const GNativeString &str)\n: GUTF8String(str) {}\n\ninline\nGNativeString::GNativeString(const int number)\n: GUTF8String(number) {}\n\ninline\nGNativeString::GNativeString(const double number)\n: GUTF8String(number) {}\n\ninline\nGNativeString::GNativeString(const GNativeString &fmt, va_list &args)\n: GUTF8String(fmt,args) {}\n\n#else // HAS_WCHAR\n\n/// Initialize this string class\ninline void\nGNativeString::init(void)\n{ GBaseString::init(); }\n\n/// Initialize this string class\ninline GNativeString &\nGNativeString::init(const GP<GStringRep> &rep)\n{\n  GP<GStringRep>::operator=(rep?rep->toNative(GStringRep::NOT_ESCAPED):rep);\n  init();\n  return *this;\n}\n\ninline GNativeString \nGNativeString::substr(int from, int len) const\n{ return GNativeString(*this, from, len); }\n\ninline GNativeString &\nGNativeString::vformat(const GNativeString &fmt, va_list &args)\n{ return (*this = (fmt.ptr?GNativeString(fmt,args):fmt)); }\n\ninline GNativeString\nGNativeString::toEscaped( const bool tosevenbit ) const\n{ return ptr?GNativeString((*this)->toEscaped(tosevenbit)):(*this); }\n\ninline\nGNativeString::GNativeString(const GUTF8String &str)\n{\n  if (str.length())\n    init(str->toNative(GStringRep::NOT_ESCAPED));\n  else\n    init((GP<GStringRep>)str);\n}\n\ninline\nGNativeString::GNativeString(const GP<GStringRep> &str)\n{\n  if (str)\n    init(str->toNative(GStringRep::NOT_ESCAPED));\n  else\n    init(str);\n}\n\ninline\nGNativeString::GNativeString(const GBaseString &str)\n{\n  if (str.length())\n    init(str->toNative(GStringRep::NOT_ESCAPED));\n  else\n    init((GP<GStringRep>)str);\n}\n\n\ninline\nGNativeString::GNativeString(const GNativeString &fmt, va_list &args)\n{\n  if (fmt.ptr)\n    init(fmt->vformat(args));\n  else\n    init(fmt);\n}\n\ninline GNativeString\nGNativeString::create( const char *buf, const unsigned int bufsize )\n{\n  return GNativeString(buf,bufsize);\n}\n\ninline GNativeString\nGNativeString::create( const uint16_t *buf, const unsigned int bufsize )\n{\n  return GNativeString(buf,bufsize);\n}\n\ninline GNativeString\nGNativeString::create( const uint32_t *buf, const unsigned int bufsize )\n{\n  return GNativeString(buf,bufsize);\n}\n\ninline GNativeString&\nGNativeString::operator= (const GP<GStringRep> &str)\n{ return init(str); }\n\ninline GNativeString&\nGNativeString::operator= (const GBaseString &str)\n{ return init(str); }\n\ninline GNativeString&\nGNativeString::operator= (const GUTF8String &str)\n{ return init(str); }\n\ninline GNativeString&\nGNativeString::operator= (const GNativeString &str)\n{ return init(str); }\n\ninline GNativeString\nGNativeString::upcase( void ) const\n{\n  if (ptr) return (*this)->upcase();\n  return *this;\n}\n\ninline GNativeString\nGNativeString::downcase( void ) const\n{\n  if (ptr) return (*this)->downcase();\n  return *this;\n}\n\n#endif // HAS_WCHAR\n\ninline bool\noperator==(const char *s1, const GBaseString &s2)\n{ return !s2.cmp(s1); }\n\ninline bool\noperator!=(const char *s1, const GBaseString &s2)\n{ return !!s2.cmp(s1); }\n\ninline bool\noperator>=(const char    *s1, const GBaseString &s2)\n{ return (s2.cmp(s1)<=0); }\n\ninline bool\noperator>=(const char s1, const GBaseString &s2)\n{ return (s2.cmp(s1)<=0); }\n\ninline bool\noperator<(const char *s1, const GBaseString &s2)\n{ return (s2.cmp(s1)>0); }\n\ninline bool\noperator<(const char s1, const GBaseString &s2)\n{ return (s2.cmp(s1)>0); }\n\ninline bool\noperator> (const char    *s1, const GBaseString &s2)\n{ return (s2.cmp(s1)<0); }\n\ninline bool\noperator> (const char s1, const GBaseString &s2)\n{ return (s2.cmp(s1)<0); }\n\ninline bool\noperator<=(const char    *s1, const GBaseString &s2)\n{ return !(s1>s2); }\n\ninline bool\noperator<=(const char    s1, const GBaseString &s2)\n{ return !(s1>s2); }\n\n// ------------------- The end\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/GThreads.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n// This file defines machine independent classes\n// for running and synchronizing threads.\n// - Author: Leon Bottou, 01/1998\n\n// From: Leon Bottou, 1/31/2002\n// Almost unchanged by Lizardtech.\n// GSafeFlags should go because it not as safe as it claims.\n\n#include \"GThreads.h\"\n#include \"GException.h\"\n#include \"DjVuMessageLite.h\"\n\n#include <stddef.h>\n#include <stdlib.h>\n#include <stdio.h>\n\n// ----------------------------------------\n// Consistency check\n\n#if THREADMODEL!=NOTHREADS\n#ifdef USE_EXCEPTION_EMULATION\n#warning \"Compiler must support thread safe exceptions\"\n#endif //USE_EXCEPTION_EMULATION\n#if defined(__GNUC__)\n#if (__GNUC__<2) || ((__GNUC__==2) && (__GNUC_MINOR__<=8))\n#warning \"GCC 2.8 exceptions are not thread safe.\"\n#warning \"Use properly configured EGCS-1.1 or greater.\"\n#endif // (__GNUC__<2 ...\n#endif // defined(__GNUC__)\n#endif // THREADMODEL!=NOTHREADS\n\n#ifndef _DEBUG\n#if defined(DEBUG) \n#define _DEBUG /* */\n#elif DEBUGLVL >= 1\n#define _DEBUG /* */\n#endif\n#endif\n\n#if THREADMODEL==WINTHREADS\n# include <process.h>\n#endif\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n// ----------------------------------------\n// NOTHREADS\n// ----------------------------------------\n\n#if THREADMODEL==NOTHREADS\nint\nGThread::create( void (*entry)(void*), void *arg)\n{\n  (*entry)(arg);\n  return 0;\n}\n#endif\n\n\n// ----------------------------------------\n// WIN32 IMPLEMENTATION\n// ----------------------------------------\n\n#if THREADMODEL==WINTHREADS\n\nstatic unsigned __stdcall \nstart(void *arg)\n{\n  GThread *gt = (GThread*)arg;\n  try \n    {\n      G_TRY\n        {\n          gt->xentry( gt->xarg );\n        }\n      G_CATCH(ex)\n        {\n          ex.perror();\n          DjVuMessageLite::perror( ERR_MSG(\"GThreads.uncaught\") );\n#ifdef _DEBUG\n          abort();\n#endif\n        }\n      G_ENDCATCH;\n    }\n  catch(...)\n    {\n      DjVuMessageLite::perror( ERR_MSG(\"GThreads.unrecognized\") );\n#ifdef _DEBUG\n      abort();\n#endif\n    }\n  return 0;\n}\n\nGThread::GThread(int stacksize)\n  : hthr(0), thrid(0), xentry(0), xarg(0)\n{\n}\n\nGThread::~GThread()\n{\n  if (hthr)\n    CloseHandle(hthr);\n  hthr = 0;\n  thrid = 0;\n}\n\nint  \nGThread::create(void (*entry)(void*), void *arg)\n{\n  if (hthr)\n    return -1;\n  xentry = entry;\n  xarg = arg;\n  unsigned uthread = 0;\n  hthr = (HANDLE)_beginthreadex(NULL, 0, start, (void*)this, 0, &uthread);\n  thrid = (DWORD) uthread;\n  if (hthr)\n    return 0;\n  return -1;\n}\n\nvoid \nGThread::terminate()\n{\n  OutputDebugString(\"Terminating thread.\\n\");\n  if (hthr)\n    TerminateThread(hthr,0);\n}\n\nint\nGThread::yield()\n{\n  Sleep(0);\n  return 0;\n}\n\nvoid *\nGThread::current()\n{\n  return (void*) GetCurrentThreadId();\n}\n\nstruct thr_waiting {\n  struct thr_waiting *next;\n  struct thr_waiting *prev;\n  BOOL   waiting;\n  HANDLE gwait;\n};\n\nGMonitor::GMonitor()\n  : ok(0), count(1), head(0), tail(0)\n{\n  InitializeCriticalSection(&cs);\n  locker = GetCurrentThreadId();\n  ok = 1;\n}\n\nGMonitor::~GMonitor()\n{\n  ok = 0;\n  EnterCriticalSection(&cs);\n  for (struct thr_waiting *w=head; w; w=w->next)\n    SetEvent(w->gwait);\n  LeaveCriticalSection(&cs);\n  DeleteCriticalSection(&cs); \n}\n\nvoid \nGMonitor::enter()\n{\n  DWORD self = GetCurrentThreadId();\n  if (count>0 || self!=locker)\n    {\n      if (ok)\n        EnterCriticalSection(&cs);\n      locker = self;\n      count = 1;\n    }\n  count -= 1;\n}\n\nvoid \nGMonitor::leave()\n{\n  DWORD self = GetCurrentThreadId();\n  if (ok && (count>0 || self!=locker))\n    G_THROW( ERR_MSG(\"GThreads.not_acq_broad\") );\n  count += 1;\n  if (count > 0)\n    {\n      count = 1;\n      if (ok)\n        LeaveCriticalSection(&cs);\n    }\n}\n\nvoid\nGMonitor::signal()\n{\n  if (ok)\n    {\n      DWORD self = GetCurrentThreadId();\n      if (count>0 || self!=locker)\n        G_THROW( ERR_MSG(\"GThreads.not_acq_signal\") );\n      for (struct thr_waiting *w=head; w; w=w->next)\n        if (w->waiting) \n          {\n            SetEvent(w->gwait);\n            w->waiting = FALSE;\n            break; // Only one thread is allowed to run!\n          }\n    }\n}\n\nvoid\nGMonitor::broadcast()\n{\n  if (ok)\n    {\n      DWORD self = GetCurrentThreadId();\n      if (count>0 || self!=locker)\n        G_THROW( ERR_MSG(\"GThreads.not_acq_broad\") );\n      for (struct thr_waiting *w=head; w; w=w->next)\n        if (w->waiting)\n            {\n              SetEvent(w->gwait);\n              w->waiting = FALSE;\n            }\n    }\n}\n\nvoid\nGMonitor::wait()\n{\n  // Check state\n  DWORD self = GetCurrentThreadId();\n  if (count>0 || self!=locker)\n    G_THROW( ERR_MSG(\"GThreads.not_acq_wait\") );\n  // Wait\n  if (ok)\n    {\n      // Prepare wait record\n      struct thr_waiting waitrec;\n      waitrec.waiting = TRUE;\n      waitrec.gwait = CreateEvent(NULL,FALSE,FALSE,NULL);\n      waitrec.next = 0;\n      waitrec.prev = tail;\n      // Link wait record (protected by critical section)\n      *(waitrec.next ? &waitrec.next->prev : &tail) = &waitrec; \n      *(waitrec.prev ? &waitrec.prev->next : &head) = &waitrec;\n      // Start wait\n      int sav_count = count;\n      count = 1;\n      LeaveCriticalSection(&cs);\n      WaitForSingleObject(waitrec.gwait,INFINITE);\n      // Re-acquire\n      EnterCriticalSection(&cs);\n      count = sav_count;\n      locker = self;\n      // Unlink wait record\n      *(waitrec.next ? &waitrec.next->prev : &tail) = waitrec.prev;\n      *(waitrec.prev ? &waitrec.prev->next : &head) = waitrec.next;\n      CloseHandle(waitrec.gwait);\n    }\n}\n\nvoid\nGMonitor::wait(unsigned long timeout) \n{\n  // Check state\n  DWORD self = GetCurrentThreadId();\n  if (count>0 || self!=locker)\n    G_THROW( ERR_MSG(\"GThreads.not_acq_wait\") );\n  // Wait\n  if (ok)\n    {\n      // Prepare wait record\n      struct thr_waiting waitrec;\n      waitrec.waiting = TRUE;\n      waitrec.gwait = CreateEvent(NULL,FALSE,FALSE,NULL);\n      waitrec.next = 0;\n      waitrec.prev = tail;\n      // Link wait record (protected by critical section)\n      *(waitrec.prev ? &waitrec.prev->next : &head) = &waitrec;\n      *(waitrec.next ? &waitrec.next->prev : &tail) = &waitrec; \n      // Start wait\n      int sav_count = count;\n      count = 1;\n      LeaveCriticalSection(&cs);\n      WaitForSingleObject(waitrec.gwait,timeout);\n      // Re-acquire\n      EnterCriticalSection(&cs);\n      count = sav_count;\n      locker = self;\n      // Unlink wait record\n      *(waitrec.next ? &waitrec.next->prev : &tail) = waitrec.prev;\n      *(waitrec.prev ? &waitrec.prev->next : &head) = waitrec.next;\n      CloseHandle(waitrec.gwait);\n    }\n}\n\n#endif\n\n\n// ----------------------------------------\n// POSIXTHREADS IMPLEMENTATION\n// ----------------------------------------\n\n#if THREADMODEL==POSIXTHREADS\n\n#if defined(CMA_INCLUDE)\n#define DCETHREADS\n#define pthread_key_create pthread_keycreate\n#else\n#define pthread_mutexattr_default  NULL\n#define pthread_condattr_default   NULL\n#endif\n\n\nvoid *\nGThread::start(void *arg)\n{\n  GThread *gt = (GThread*)arg;\n#ifdef DCETHREADS\n#ifdef CANCEL_ON\n  pthread_setcancel(CANCEL_ON);\n  pthread_setasynccancel(CANCEL_ON);\n#endif\n#else // !DCETHREADS\n#ifdef PTHREAD_CANCEL_ENABLE\n  pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, 0);\n#endif\n#ifdef PTHREAD_CANCEL_ASYNCHRONOUS\n  pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0);\n#endif\n#endif\n  // Catch exceptions\n#ifdef __EXCEPTIONS\n  try \n    {\n#endif \n      G_TRY\n        {\n          (gt->xentry)(gt->xarg);\n        }\n      G_CATCH(ex)\n        {\n          ex.perror();\n          DjVuMessageLite::perror( ERR_MSG(\"GThreads.uncaught\") );\n#ifdef _DEBUG\n          abort();\n#endif\n        }\n      G_ENDCATCH;\n#ifdef __EXCEPTIONS\n    }\n  catch(...)\n    {\n          DjVuMessageLite::perror( ERR_MSG(\"GThreads.unrecognized\") );\n#ifdef _DEBUG\n      abort();\n#endif\n    }\n#endif\n  return 0;\n}\n\n\n// GThread\n\nGThread::GThread(int stacksize) : \n  hthr(0), xentry(0), xarg(0)\n{\n}\n\nGThread::~GThread()\n{\n  hthr = 0;\n}\n\nint  \nGThread::create(void (*entry)(void*), void *arg)\n{\n  if (xentry || xarg)\n    return -1;\n  xentry = entry;\n  xarg = arg;\n#ifdef DCETHREADS\n  int ret = pthread_create(&hthr, pthread_attr_default, GThread::start, (void*)this);\n  if (ret >= 0)\n    pthread_detach(hthr);\n#else\n  pthread_attr_t attr;\n  pthread_attr_init(&attr);\n  pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);\n  int ret = pthread_create(&hthr, &attr, start, (void*)this);\n  pthread_attr_destroy(&attr);\n#endif\n  return ret;\n}\n\nvoid \nGThread::terminate()\n{\n  if (xentry || xarg)\n    pthread_cancel(hthr);\n}\n\nint\nGThread::yield()\n{\n#ifdef DCETHREADS\n  pthread_yield();\n#else\n  // should use sched_yield() when available.\n  static struct timeval timeout = { 0, 0 };\n  ::select(0, 0,0,0, &timeout);\n#endif\n  return 0;\n}\n\nvoid*\nGThread::current()\n{\n  pthread_t self = pthread_self();\n#if defined(pthread_getunique_np)\n  return (void*) pthread_getunique_np( & self );\n#elif defined(cma_thread_get_unique)\n  return (void*) cma_thread_get_unique( & self );  \n#else\n  return (void*) self;\n#endif\n}\n\n// -- GMonitor\n\nGMonitor::GMonitor()\n  : ok(0), count(1), locker(0)\n{\n  // none of this should be necessary ... in theory.\n#ifdef PTHREAD_MUTEX_INITIALIZER\n  static pthread_mutex_t tmutex=PTHREAD_MUTEX_INITIALIZER;\n  memcpy(&mutex,&tmutex,sizeof(mutex));\n#endif\n#ifdef PTHREAD_COND_INITIALIZER\n  static pthread_cond_t tcond=PTHREAD_COND_INITIALIZER;\n  memcpy(&cond,&tcond,sizeof(cond));\n#endif\n  // standard\n  pthread_mutex_init(&mutex, pthread_mutexattr_default);\n  pthread_cond_init(&cond, pthread_condattr_default); \n  locker = pthread_self();\n  ok = 1;\n}\n\nGMonitor::~GMonitor()\n{\n  ok = 0;\n  pthread_cond_destroy(&cond);\n  pthread_mutex_destroy(&mutex); \n}\n\n\nvoid \nGMonitor::enter()\n{\n  pthread_t self = pthread_self();\n  if (count>0 || !pthread_equal(locker, self))\n    {\n      if (ok)\n        pthread_mutex_lock(&mutex);\n      locker = self;\n      count = 1;\n    }\n  count -= 1;\n}\n\nvoid \nGMonitor::leave()\n{\n  static pthread_t pthread_null;\n  pthread_t self = pthread_self();\n  if (ok && (count>0 || !pthread_equal(locker, self)))\n    G_THROW( ERR_MSG(\"GThreads.not_acq_broad\") );\n  count += 1;\n  if (count > 0)\n    {\n      count = 1;\n      locker = pthread_null;\n      if (ok)\n        pthread_mutex_unlock(&mutex);\n    }\n}\n\nvoid\nGMonitor::signal()\n{\n  if (ok)\n    {\n      pthread_t self = pthread_self();\n      if (count>0 || !pthread_equal(locker, self))\n        G_THROW( ERR_MSG(\"GThreads.not_acq_signal\") );\n      pthread_cond_signal(&cond);\n    }\n}\n\nvoid\nGMonitor::broadcast()\n{\n  if (ok)\n    {\n      pthread_t self = pthread_self();\n      if (count>0 || !pthread_equal(locker, self))\n        G_THROW( ERR_MSG(\"GThreads.not_acq_broad\") );\n      pthread_cond_broadcast(&cond);\n    }\n}\n\nvoid\nGMonitor::wait()\n{\n  // Check\n  pthread_t self = pthread_self();\n  if (count>0 || !pthread_equal(locker, self))\n    G_THROW( ERR_MSG(\"GThreads.not_acq_wait\") );\n  // Wait\n  if (ok)\n    {\n      // Release\n      int sav_count = count;\n      count = 1;\n      // Wait\n      pthread_cond_wait(&cond, &mutex);\n      // Re-acquire\n      count = sav_count;\n      locker = self;\n    }      \n}\n\nvoid\nGMonitor::wait(unsigned long timeout) \n{\n  // Check\n  pthread_t self = pthread_self();\n  if (count>0 || !pthread_equal(locker, self))\n    G_THROW( ERR_MSG(\"GThreads.not_acq_wait\") );\n  // Wait\n  if (ok)\n    {\n      // Release\n      int sav_count = count;\n      count = 1;\n      // Wait\n      struct timeval  abstv;\n      struct timespec absts;\n      gettimeofday(&abstv, NULL); // grrr\n      absts.tv_sec = abstv.tv_sec + timeout/1000;\n      absts.tv_nsec = abstv.tv_usec*1000  + (timeout%1000)*1000000;\n      if (absts.tv_nsec > 1000000000) {\n        absts.tv_nsec -= 1000000000;\n        absts.tv_sec += 1;\n      }\n      pthread_cond_timedwait(&cond, &mutex, &absts);\n      // Re-acquire\n      count = sav_count;\n      locker = self;\n    }      \n}\n\n#endif\n\n\n\n// ----------------------------------------\n// GSAFEFLAGS \n// ----------------------------------------\n\n\n\nGSafeFlags &\nGSafeFlags::operator=(long xflags)\n{\n   enter();\n   if (flags!=xflags)\n   {\n      flags=xflags;\n      broadcast();\n   }\n   leave();\n   return *this;\n}\n\nGSafeFlags::operator long(void) const\n{\n   long f;\n   ((GSafeFlags *) this)->enter();\n   f=flags;\n   ((GSafeFlags *) this)->leave();\n   return f;\n}\n\nbool\nGSafeFlags::test_and_modify(long set_mask, long clr_mask,\n\t\t\t    long set_mask1, long clr_mask1)\n{\n   enter();\n   if ((flags & set_mask)==set_mask &&\n       (~flags & clr_mask)==clr_mask)\n   {\n      long new_flags=flags;\n      new_flags|=set_mask1;\n      new_flags&=~clr_mask1;\n      if (new_flags!=flags)\n      {\n\t flags=new_flags;\n\t broadcast();\n      }\n      leave();\n      return true;\n   }\n   leave();\n   return false;\n}\n\nvoid\nGSafeFlags::wait_and_modify(long set_mask, long clr_mask,\n\t\t\t    long set_mask1, long clr_mask1)\n{\n   enter();\n   while((flags & set_mask)!=set_mask ||\n\t (~flags & clr_mask)!=clr_mask) wait();\n   long new_flags=flags;\n   new_flags|=set_mask1;\n   new_flags&=~clr_mask1;\n   if (flags!=new_flags)\n   {\n      flags=new_flags;\n      broadcast();\n   }\n   leave();\n}\n\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/GThreads.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _GTHREADS_H_\n#define _GTHREADS_H_\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n/** @name GThreads.h\n\n    Files #\"GThreads.h\"# and #\"GThreads.cpp\"# implement common entry points\n    for multithreading on multiple platforms.  Each execution thread is\n    represented by an instance of class \\Ref{GThread}.  Synchronization is\n    provided by class \\Ref{GMonitor} which implements a monitor (C.A.R Hoare,\n    Communications of the ACM, 17(10), 1974).\n\n    The value of compiler symbol #THREADMODEL# selects an appropriate\n    implementation for these classes. The current implementation supports\n    the following values:\n    \\begin{description}\n    \\item[-DTHREADMODEL=NOTHREADS] Dummy implementation.  This is a\n          good choice when the multithreading features are not required,\n          because it minimizes the portability problems.  This is currently\n          the default when compiling under Unix.\n    \\item[-DTHREADMODEL=WINTHREADS] Windows implementation.\n          This is the default when compiling under Windows.\n    \\item[-DTHREADMODEL=POSIXTHREADS] Posix implementation.\n          This implementation also supports DCE threads. The behavior of\n          the code is subject to the quality of the system implementation of\n          Posix threads.\n    \\end{description}\n    \n    @memo\n    Portable threads\n    @author\n    L\\'eon Bottou <leonb@research.att.com> -- initial implementation.\\\\\n    Praveen Guduru <praveen@sanskrit.lz.att.com> -- mac implementation.\n\n// From: Leon Bottou, 1/31/2002\n// Almost unchanged by Lizardtech.\n// GSafeFlags should go because it not as safe as it claims.\n\n*/\n//@{\n\n\n#include \"DjVuGlobal.h\"\n#include \"GException.h\"\n\n#define NOTHREADS     0\n#define POSIXTHREADS  10\n#define WINTHREADS    11\n/* SumatraPDF: prevent these constants from being confused with NOTHREADS */\n#define MACTHREADS    -1\n#define COTHREADS     -1\n\n// Known platforms\n#ifndef THREADMODEL\n#if defined(WIN32)\n#define THREADMODEL WINTHREADS\n#endif\n#endif\n\n// Exception emulation is not thread safe\n#ifdef USE_EXCEPTION_EMULATION\n#undef  THREADMODEL\n#define THREADMODEL NOTHREADS\n#endif\n// Default is nothreads\n#ifndef THREADMODEL\n#define THREADMODEL NOTHREADS\n#endif\n\n// ----------------------------------------\n// INCLUDES\n\n#if THREADMODEL==WINTHREADS\n#ifndef _WINDOWS_\n#define WIN32_LEAN_AND_MEAN\n#include \"windows.h\"\n#endif\n#endif\n\n#if THREADMODEL==MACTHREADS\n#include <threads.h>\n#endif\n\n#if THREADMODEL==POSIXTHREADS\n#include <sys/types.h>\n#include <sys/time.h>\n#include <unistd.h>\n#undef TRY\n#undef CATCH\n#define _CMA_NOWRAPPERS_\n#include <pthread.h>\n#endif\n\n\n// ----------------------------------------\n// PORTABLE CLASSES\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n\n/** Thread class.  A multithreaded process is composed of a main execution\n    thread and of several secondary threads.  Each secondary thread is\n    represented by a #GThread# object.  The amount of memory required for the\n    stack of a secondary thread is defined when the #GThread# object is\n    constructed.  The execution thread is started when function\n    \\Ref{GThread::create} is called.  The destructor of class GThread waits\n    until the thread terminanes.  Note that the execution can be terminated at\n    any time (with possible prejudice) by calling \\Ref{GThread::terminate}.\n\n    Several static member functions control the thread scheduler.  Function\n    \\Ref{GThread::yield} relinquishes the processor to another thread.\n    Function \\Ref{GThread::select} (#COTHREADS# only) provides a thread-aware\n    replacement for the well-known unix system call #select#.  \n\n    {\\bf Note} --- Both the copy constructor and the copy operator are declared\n    as private members. It is therefore not possible to make multiple copies\n    of instances of this class, as implied by the class semantic. */\n\nclass GThread {\npublic:\n  /** Constructs a new thread object.  Memory is allocated for the\n      thread, but the thread is not started. \n      Argument #stacksize# is used by the #COTHREADS# model only for\n      specifying the amount of memory needed for the processor stack. A\n      negative value will be replaced by a suitable default value of 128Kb.\n      A minimum value of 32Kb is silently enforced. */\n  GThread(int stacksize = -1);\n  /** Destructor.  Destroying the thread object while the thread is running is\n      perfectly ok since it only destroys the thread identifier.  Execution\n      will continue without interference. */\n  ~GThread();\n  /** Starts the thread. The new thread executes function #entry# with\n      argument #arg#.  The thread terminates when the function returns.  A\n      thread cannot be restarted after its termination. You must create a new\n      #GThread# object. */\n  int  create(void (*entry)(void*), void *arg);\n  /** Terminates a thread with extreme prejudice. The thread is removed from\n      the scheduling list.  Execution terminates regardless of the execution\n      status of the thread function. Automatic variables may or may not be\n      destroyed. This function must be considered as a last resort since\n      memory may be lost. */\n  void terminate();\n  /** Causes the current thread to relinquish the processor.  The scheduler\n      selects a thread ready to run and transfers control to that thread.  The\n      actual effect of #yield# heavily depends on the selected implementation.\n      Function #yield# usually returns zero when the execution of the current\n      thread is resumed.  It may return a positive number when it can\n      determine that the current thread will remain the only runnable thread\n      for some time.  You may then call function \\Ref{get_select} to\n      obtain more information. */\n  static int yield();\n  /** Returns a value which uniquely identifies the current thread. */\n  static void *current();\n#if THREADMODEL==WINTHREADS\nprivate:\n  HANDLE hthr;\n  DWORD  thrid;\n#elif THREADMODEL==POSIXTHREADS\nprivate:\n  pthread_t hthr;\n  static void *start(void *arg);\n#endif\npublic:\n  // Should be considered as private\n  void (*xentry)(void*);\n  void  *xarg;\nprivate:\n  // Disable default members\n  GThread(const GThread&);\n  GThread& operator=(const GThread&);\n};\n\n\n/** Monitor class.  Monitors have been first described in (C.A.R Hoare,\n    Communications of the ACM, 17(10), 1974).  This mechanism provides the\n    basic mutual exclusion (mutex) and thread notification facilities\n    (condition variables).\n    \n    Only one thread can own the monitor at a given time.  Functions\n    \\Ref{enter} and \\Ref{leave} can be used to acquire and release the\n    monitor. This mutual exclusion provides an efficient way to protect\n    segment of codes ({\\em critical sections}) which should not be\n    simultaneously executed by two threads. Class \\Ref{GMonitorLock} provides\n    a convenient way to do this effectively.\n    \n    When the thread owning the monitor calls function \\Ref{wait}, the monitor\n    is released and the thread starts waiting until another thread calls\n    function \\Ref{signal} or \\Ref{broadcast}.  When the thread wakes-up, it\n    re-acquires the monitor and function #wait# returns.  Since the signaling\n    thread must acquire the monitor before calling functions #signal# and\n    #broadcast#, the signaled thread will not be able to re-acquire the\n    monitor until the signaling thread(s) releases the monitor.\n    \n    {\\bf Note} --- Both the copy constructor and the copy operator are declared\n    as private members. It is therefore not possible to make multiple copies\n    of instances of this class, as implied by the class semantic. */\n\nclass GMonitor\n{\npublic:\n  GMonitor();\n  ~GMonitor();\n  /** Enters the monitor.  If the monitor is acquired by another thread this\n      function waits until the monitor is released.  The current thread then\n      acquires the monitor.  Calls to #enter# and #leave# may be nested. */\n  void enter();\n  /** Leaves the monitor.  The monitor counts how many times the current\n      thread has entered the monitor.  Function #leave# decrement this count.\n      The monitor is released when this count reaches zero.  An exception is\n      thrown if this function is called by a thread which does not own the\n      monitor. */\n  void leave();\n  /** Waits until the monitor is signaled.  The current thread atomically\n      releases the monitor and waits until another thread calls function\n      #signal# or #broadcast#.  Function #wait# then re-acquires the monitor\n      and returns.  An exception is thrown if this function is called by a\n      thread which does not own the monitor. */\n  void wait();\n  /** Waits until the monitor is signaled or a timeout is reached.  The\n      current thread atomically releases the monitor and waits until another\n      thread calls function #signal# or #broadcast# or a maximum of #timeout#\n      milliseconds.  Function #wait# then re-acquires the monitor and returns.\n      An exception is thrown if this function is called by a thread which does\n      not own the monitor. */\n  void wait(unsigned long timeout);\n  /** Signals one waiting thread.  Function #signal# wakes up at most one of\n      the waiting threads for this monitor.  An exception is thrown if this\n      function is called by a thread which does not own the monitor. */\n  void signal();\n  /** Signals all waiting threads. Function #broadcast# wakes up all the\n      waiting threads for this monitor.  An exception is thrown if this\n      function is called by a thread which does not own the monitor. */\n  void broadcast();\nprivate:\n#if THREADMODEL==WINTHREADS\n  int ok;\n  int count;\n  DWORD locker;\n  CRITICAL_SECTION cs;\n  struct thr_waiting *head;\n  struct thr_waiting *tail;\n#elif THREADMODEL==POSIXTHREADS\n  int ok;\n  int count;\n  pthread_t locker;\n  pthread_mutex_t mutex;\n  pthread_cond_t cond;\n#endif  \nprivate:\n  // Disable default members\n  GMonitor(const GMonitor&);\n  GMonitor& operator=(const GMonitor&);\n};\n\n\n\n\n// ----------------------------------------\n// NOTHREADS INLINES\n\n#if THREADMODEL==NOTHREADS\ninline GThread::GThread(int stacksize) {}\ninline GThread::~GThread(void) {}\ninline void GThread::terminate() {}\ninline int GThread::yield() { return 0; }\ninline void* GThread::current() { return 0; }\ninline GMonitor::GMonitor() {}\ninline GMonitor::~GMonitor() {}\ninline void GMonitor::enter() {}\ninline void GMonitor::leave() {}\ninline void GMonitor::wait() {}\ninline void GMonitor::wait(unsigned long timeout) {}\ninline void GMonitor::signal() {}\ninline void GMonitor::broadcast() {}\n#endif // NOTHREADS\n\n\n// ----------------------------------------\n// SCOPE LOCK\n\n\n/** Wrapper for mutually exclusive code.\n    This class locks a specified critical section (see \\Ref{GCriticalSection})\n    at construction time and unlocks it at destruction time. It provides a\n    convenient way to take advantage of the C++ implicit destruction of\n    automatic variables in order to make sure that the monitor is\n    released when exiting the protected code.  The following code will release\n    the monitor when the execution thread leaves the protected scope, either\n    because the protected code has executed successfully, or because an\n    exception was thrown.\n    \\begin{verbatim}\n      {      -- protected scope\n         static GMonitor theMonitor;\n         GMonitorLock lock(&theMonitor)\n         ... -- protected code\n      }\n    \\end{verbatim} \n    This construct will do nothing when passed a null pointer.\n*/\nclass GMonitorLock \n{\nprivate:\n  GMonitor *gsec;\npublic:\n  /** Constructor. Enters the monitor #gsec#. */\n  GMonitorLock(GMonitor *gsec) : gsec(gsec) \n    { if (gsec) gsec->enter(); };\n  /** Destructor. Leaves the associated monitor. */\n  ~GMonitorLock() \n    { if (gsec) gsec->leave(); };\n};\n\n\n\n// ----------------------------------------\n// GSAFEFLAGS (not so safe)\n\n\n/** A thread safe class representing a set of flags. The flags are protected\n    by \\Ref{GMonitor}, which is attempted to be locked whenever somebody\n    accesses the flags. One can modify the class contents using one of\n    two functions: \\Ref{test_and_modify}() and \\Ref{wait_and_modify}().\n    Both of them provide atomic operation of testing (first) and modification\n    (second). The flags remain locked between the moment of testing and\n    modification, which guarantees, that their state cannot be changed in\n    between of these operations. */\nclass GSafeFlags : public GMonitor\n{\nprivate:\n   volatile long flags;\npublic:\n      /// Constructs #GSafeFlags# object.\n   GSafeFlags(long flags=0);\n\n      /** Assignment operator. Will also wake up threads waiting for the\n\t  flags to change. */\n   GSafeFlags & operator=(long flags);\n\n      /** Returns the value of the flags */\n   operator long(void) const;\n      /** Modifies the flags by ORing them with the provided mask. A broadcast\n\t  will be sent after the modification is done. */\n   GSafeFlags &\toperator|=(long mask);\n      /** Modifies the flags by ANDing them with the provided mask. A broadcast\n\t  will be sent after the modification is done. */\n   GSafeFlags &\toperator&=(long mask);\n\n      /** If all bits mentioned in #set_mask# are set in the flags and all\n\t  bits mentioned in #clr_mask# are cleared in the flags, it sets all\n\t  bits from #set_mask1# in the flags, clears all flags from\n\t  #clr_mask1# in the flags and returns #TRUE#. Otherwise returns\n\t  #FALSE#. */\n   bool\ttest_and_modify(long set_mask, long clr_mask,\n\t\t\tlong set_mask1, long clr_mask1);\n\n      /** Waits until all bits mentioned in #set_mask# are set in the flags\n\t  and all bits mentioned in #clr_flags# are cleared in the flags.\n\t  After that it sets bits from #set_mask1# and clears bits from\n\t  #clr_mask1# in the flags. */\n   void\twait_and_modify(long set_mask, long clr_mask,\n\t\t\tlong set_mask1, long clr_mask1);\n\n      /** Waits until all bits set in #set_mask# are set in the flags and\n\t  all bits mentioned in #clr_mask# are cleared in the flags. */\n   void\twait_for_flags(long set_mask, long clr_mask=0) const;\n\n      /** Modifies the flags by setting all bits mentioned in #set_mask#\n\t  and clearing all bits mentioned in #clr_mask#. If the flags have\n\t  actually been modified, a broadcast will be sent. */\n   void\tmodify(long set_mask, long clr_mask);\n};\n\ninline\nGSafeFlags::GSafeFlags(long xflags) \n  : flags(xflags) \n{\n}\n\ninline void\nGSafeFlags::wait_for_flags(long set_mask, long clr_mask) const\n{\n   ((GSafeFlags *) this)->wait_and_modify(set_mask, clr_mask, 0, 0);\n}\n\ninline void\nGSafeFlags::modify(long set_mask, long clr_mask)\n{\n   test_and_modify(0, 0, set_mask, clr_mask);\n}\n\ninline GSafeFlags &\nGSafeFlags::operator|=(long mask)\n{\n   test_and_modify(0, 0, mask, 0);\n   return *this;\n}\n\ninline GSafeFlags &\nGSafeFlags::operator&=(long mask)\n{\n   test_and_modify(0, 0, 0, ~mask);\n   return *this;\n}\n\n//@}\n\n\n\n\n// ----------------------------------------\n// COMPATIBILITY CLASSES\n\n\n// -- these classes are no longer documented.\n\nclass GCriticalSection : protected GMonitor \n{\npublic:\n  void lock() \n    { GMonitor::enter(); };\n  void unlock() \n    { GMonitor::leave(); };\n};\n\nclass GEvent : protected GMonitor \n{\nprivate:\n  int status;\npublic:\n  GEvent() \n    : status(0) { };\n  void set() \n    { if (!status) { enter(); status=1; signal(); leave(); } };\n  void wait() \n    { enter(); if (!status) GMonitor::wait(); status=0; leave(); };\n  void wait(int timeout) \n    { enter(); if (!status) GMonitor::wait(timeout); status=0; leave(); };\n};\n\nclass GCriticalSectionLock\n{\nprivate:\n  GCriticalSection *gsec;\npublic:\n  GCriticalSectionLock(GCriticalSection *gsec) : gsec(gsec) \n    { if (gsec) gsec->lock(); };\n  ~GCriticalSectionLock() \n    { if (gsec) gsec->unlock(); };\n};\n\n\n// ----------------------------------------\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif //_GTHREADS_H_\n\n"
  },
  {
    "path": "ext/libdjvu/GURL.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n// From: Leon Bottou, 1/31/2002\n// This has been heavily changed by Lizardtech.\n// They decided to use URLs for everyting, including\n// the most basic file access.  The URL class now is a unholy \n// mixture of code for syntactically parsing the urls (which it was)\n// and file status code (only for local file: urls).\n\n#include \"GException.h\"\n#include \"GOS.h\"\n#include \"GURL.h\"\n#include \"debug.h\"\n\n#include <stddef.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <ctype.h>\n#include <math.h>\n#include <string.h>\n\n#ifdef WIN32\n# include <tchar.h>\n# include <windows.h>\n# include <direct.h>\n#endif /* WIN32 */\n\n// -- MAXPATHLEN\n#ifndef MAXPATHLEN\n# ifdef _MAX_PATH\n#  define MAXPATHLEN _MAX_PATH\n# else\n#  define MAXPATHLEN 1024\n# endif\n#else\n# if ( MAXPATHLEN < 1024 )\n#  undef MAXPATHLEN\n#  define MAXPATHLEN 1024\n# endif\n#endif\n\n#if defined(UNIX) || defined(OS2)\n# include <unistd.h>\n# include <sys/types.h>\n# include <sys/stat.h>\n# include <errno.h>\n# include <fcntl.h>\n# include <pwd.h>\n# include <stdio.h>\n# ifdef AUTOCONF\n#  ifdef TIME_WITH_SYS_TIME\n#   include <sys/time.h>\n#   include <time.h>\n#  else\n#   ifdef HAVE_SYS_TIME_H\n#    include <sys/time.h>\n#   else\n#    include <time.h>\n#   endif\n#  endif\n#  ifdef HAVE_DIRENT_H\n#   include <dirent.h>\n#   define NAMLEN(dirent) strlen((dirent)->d_name)\n#  else\n#   define dirent direct\n#   define NAMLEN(dirent) (dirent)->d_namlen\n#   ifdef HAVE_SYS_NDIR_H\n#    include <sys/ndir.h>\n#   endif\n#   ifdef HAVE_SYS_DIR_H\n#    include <sys/dir.h>\n#   endif\n#   ifdef HAVE_NDIR_H\n#    include <ndir.h>\n#   endif\n#  endif\n# else /* !AUTOCONF */ \n#  include <sys/time.h>\n#  if defined(XENIX)\n#   define USE_DIRECT\n#   include <sys/ndir.h>\n#  elif defined(OLDBSD)\n#   define USE_DIRECT\n#   include <sys/dir.h>\n#  endif\n#  ifdef USE_DIRECT\n#   define dirent direct\n#   define NAMLEN(dirent) (dirent)->d_namlen\n#  else\n#   include <dirent.h>\n#   define NAMLEN(dirent) strlen((dirent)->d_name)\n#  endif \n# endif /* !AUTOCONF */\n#endif /* UNIX */\n\n#ifdef macintosh\n#include <unix.h>\n#include <errno.h>\n#include <unistd.h>\n#endif\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\nstatic const char djvuopts[]=\"DJVUOPTS\";\nstatic const char localhost[]=\"file://localhost/\";\nstatic const char backslash='\\\\';  \nstatic const char colon=':';\nstatic const char dot='.';\nstatic const char filespecslashes[] = \"file://\";\nstatic const char filespec[] = \"file:\";\nstatic const char slash='/';\nstatic const char percent='%';\nstatic const char localhostspec1[] = \"//localhost/\";\nstatic const char localhostspec2[] = \"///\";\nstatic const char nillchar=0;\n#if defined(UNIX)\n  static const char tilde='~';\n  static const char root[] = \"/\";\n#elif defined(WIN32) || defined(OS2)\n  static const char root[] = \"\\\\\";\n#elif defined(macintosh)\n  static char const * const root = &nillchar; \n#else\n#error \"Define something here for your operating system\"\n#endif\n\n\nstatic const int\npathname_start(const GUTF8String &url, const int protolength);\n\n// hexval --\n// -- Returns the hexvalue of a character.\n//    Returns -1 if illegal;\n\nstatic int \nhexval(char c)\n{\n  return ((c>='0' && c<='9')\n    ?(c-'0')\n    :((c>='A' && c<='F')\n      ?(c-'A'+10)\n      :((c>='a' && c<='f')\n        ?(c-'a'+10):(-1))));\n}\n\n\nstatic bool\nis_argument(const char * start)\n      // Returns TRUE if 'start' points to the beginning of an argument\n      // (either hash or CGI)\n{\n   // return (*start=='#' || *start=='?' || *start=='&' || *start==';');\n   return (*start=='#' || *start=='?' );\n}\n\nstatic bool\nis_argument_sep(const char * start)\n      // Returns TRUE if 'start' points to the beginning of an argument\n      // (either hash or CGI)\n{\n   return (*start=='&')||(*start == ';');\n}\n\nvoid\nGURL::convert_slashes(void)\n{\n   GUTF8String xurl(get_string());\n#if defined(WIN32)\n   const int protocol_length=protocol(xurl).length();\n   for(char *ptr=(xurl.getbuf()+protocol_length);*ptr;ptr++)\n     if(*ptr == backslash)\n       *ptr=slash;\n   url=xurl;\n#endif\n}\n\nstatic void\ncollapse(char * ptr, const int chars)\n      // Will remove the first 'chars' chars from the string and\n      // move the rest toward the beginning. Will take into account\n      // string length\n{\n   const int length=strlen(ptr);\n   const char *srcptr=ptr+((chars>length)?length:chars);\n   while((*(ptr++) = *(srcptr++)))\n     EMPTY_LOOP;\n}\n\nGUTF8String\nGURL::beautify_path(GUTF8String xurl)\n{\n\n  const int protocol_length=GURL::protocol(xurl).length();\n   \n  // Eats parts like ./ or ../ or ///\n  char * buffer;\n  GPBuffer<char> gbuffer(buffer,xurl.length()+1);\n  strcpy(buffer, (const char *)xurl);\n   \n  // Find start point\n  char * start=buffer+pathname_start(xurl,protocol_length);\n\n  // Find end of the url (don't touch arguments)\n  char * ptr;\n  GUTF8String args;\n  for(ptr=start;*ptr;ptr++)\n  {\n    if (is_argument(ptr))\n    {\n      args=ptr;\n      *ptr=0;\n      break;\n    }\n  }\n\n  // Eat multiple slashes\n  for(;(ptr=strstr(start, \"////\"));collapse(ptr, 3))\n    EMPTY_LOOP;\n  for(;(ptr=strstr(start, \"//\"));collapse(ptr, 1))\n    EMPTY_LOOP;\n  // Convert /./ stuff into plain /\n  for(;(ptr=strstr(start, \"/./\"));collapse(ptr, 2))\n    EMPTY_LOOP;\n#if defined(WIN32) || defined(OS2)\n  if(!xurl.cmp(filespec,sizeof(filespec)-1))\n  {\n\tint offset=1;\n\tif(start&&(start[0] == '/')&& \n           !xurl.cmp(\"file:////\",sizeof(\"file:////\")-1))\n\t{\n\t  collapse(start, 1);\n\t  offset=0;\n\t}\n    for(ptr=start+offset;(ptr=strchr(ptr, '/'));)\n\t{\n\t  if(isalpha((++ptr)[0]))\n\t  {\n\t    if((ptr[1] == ':')&&(ptr[2]=='/'))\n\t\t{\n\t\t  char *buffer2;\n                  GPBuffer<char> gbuffer2(buffer2,strlen(ptr)+1);\n\t\t  strcpy(buffer2,ptr);\n\t\t  gbuffer.resize(strlen(ptr)+sizeof(localhost));\n\t\t  strcpy(buffer,localhost);\n\t\t  strcat(buffer,buffer2);\n\t\t  ptr=(start=buffer+sizeof(localhost))+1;\n\t\t}\n\t  }\n\t}\n  }\n#endif\n  // Process /../\n  while((ptr=strstr(start, \"/../\")))\n  {\n    for(char * ptr1=ptr-1;(ptr1>=start);ptr1--)\n    {\n      if (*ptr1==slash)\n      {\n        collapse(ptr1, ptr-ptr1+3);\n        break;\n      }\n    }\n  }\n\n  // Remove trailing /.\n  ptr=start+strlen(start)-2;\n  if((ptr>=start)&& (ptr == GUTF8String(\"/.\")))\n  {\n    ptr[1]=0;\n  }\n  // Eat trailing /..\n  ptr=start+strlen(start)-3;\n  if((ptr >= start) && (ptr == GUTF8String(\"/..\")))\n  {\n    for(char * ptr1=ptr-1;(ptr1>=start);ptr1--)\n    {\n      if (*ptr1==slash)\n      {\n        ptr1[1]=0;\n        break;\n      }\n    }\n  }\n\n  // Done. Copy the buffer back into the URL and add arguments.\n  xurl=buffer;\n  return (xurl+args);\n}\n\n\nvoid\nGURL::beautify_path(void)\n{\n  url=beautify_path(get_string());\n}\n\nvoid\nGURL::init(const bool nothrow)\n{\n   GCriticalSectionLock lock(&class_lock);\n   validurl=true;\n   \n   if (url.length())\n   {\n      GUTF8String proto=protocol();\n      if (proto.length()<2)\n      {\n        validurl=false;\n        if(!nothrow)\n          G_THROW( ERR_MSG(\"GURL.no_protocol\") \"\\t\"+url);\n        return;\n      }\n\n         // Below we have to make this complex test to detect URLs really\n         // referring to *local* files. Surprisingly, file://hostname/dir/file\n         // is also valid, but shouldn't be treated thru local FS.\n      if (proto==\"file\" && url[5]==slash &&\n          (url[6]!=slash || !url.cmp(localhost, sizeof(localhost))))\n      {\n            // Separate the arguments\n         GUTF8String arg;\n         {\n           const char * const url_ptr=url;\n           const char * ptr;\n           for(ptr=url_ptr;*ptr&&!is_argument(ptr);ptr++)\n           \t\tEMPTY_LOOP;\n           arg=ptr;\n           url=url.substr(0,(size_t)(ptr-url_ptr));\n         }\n\n            // Do double conversion\n         GUTF8String tmp=UTF8Filename();\n         if (!tmp.length())\n         {\n           validurl=false;\n           if(!nothrow)\n             G_THROW( ERR_MSG(\"GURL.fail_to_file\") );\n           return;\n         }\n         url=GURL::Filename::UTF8(tmp).get_string();\n         if (!url.length())\n         {\n           validurl=false;\n           if(!nothrow)\n             G_THROW( ERR_MSG(\"GURL.fail_to_URL\") );\n           return;\n         }\n            // Return the argument back\n         url+=arg;\n      }\n      convert_slashes();\n      beautify_path();\n      parse_cgi_args();\n   }\n}\n\nGURL::GURL(void) \n  : validurl(false) \n{\n}\n\nGURL::GURL(const char * url_in) \n  : url(url_in ? url_in : \"\"), validurl(false)\n{\n}\n\nGURL::GURL(const GUTF8String & url_in)\n  : url(url_in), validurl(false)\n{\n}\n\nGURL::GURL(const GNativeString & url_in)\n  : url(url_in.getNative2UTF8()), validurl(false)\n{\n#if defined(WIN32) || defined(OS2)\n  if(is_valid() && is_local_file_url())\n  {\n    GURL::Filename::UTF8 xurl(UTF8Filename());\n    url=xurl.get_string(true);\n    validurl=false;\n  }\n#endif\n}\n\nGURL::GURL(const GURL & url_in)\n  : validurl(false)\n{\n  if(url_in.is_valid())\n  {\n    url=url_in.get_string();\n    init();\n  }else\n  {\n    url=url_in.url;\n  }\n}\n\nGURL &\nGURL::operator=(const GURL & url_in)\n{\n   GCriticalSectionLock lock(&class_lock);\n   if(url_in.is_valid())\n   {\n     url=url_in.get_string();\n     init(true);\n   }else\n   {\n     url=url_in.url;\n     validurl=false;\n   }\n   return *this;\n}\n\nGUTF8String\nGURL::protocol(const GUTF8String& url)\n{\n  const char * const url_ptr=url;\n  const char * ptr=url_ptr;\n  for(char c=*ptr;\n      c && (isalnum((unsigned char)c) || c == '+' || c == '-' || c == '.');\n      c=*(++ptr)) EMPTY_LOOP;\n  if (ptr[0]==colon && ptr[1]=='/' && ptr[2]=='/')\n    return GUTF8String(url_ptr, ptr-url_ptr);\n  return GUTF8String();\n}\n\nGUTF8String\nGURL::hash_argument(void) const\n      // Returns the HASH argument (anything after '#' and before '?')\n{\n   const GUTF8String xurl(get_string());\n\n   bool found=false;\n   GUTF8String arg;\n\n         // Break if CGI argument is found\n   for(const char * start=xurl;*start&&(*start!='?');start++)\n   {\n      if (found)\n      {\n         arg+=*start;\n      }else\n      {\n         found=(*start=='#');\n      }\n   }\n   return decode_reserved(arg);\n}\n\nvoid\nGURL::set_hash_argument(const GUTF8String &arg)\n{\n   const GUTF8String xurl(get_string());\n\n   GUTF8String new_url;\n   bool found=false;\n   const char * ptr;\n   for(ptr=xurl;*ptr;ptr++)\n   {\n      if (is_argument(ptr))\n      {\n         if (*ptr!='#')\n         {\n           break;\n         }\n         found=true;\n      } else if (!found)\n      {\n         new_url+=*ptr;\n      }\n   }\n\n   url=new_url+\"#\"+GURL::encode_reserved(arg)+ptr;\n}\n\nvoid\nGURL::parse_cgi_args(void)\n      // Will read CGI arguments from the URL into\n      // cgi_name_arr and cgi_value_arr\n{\n   if(!validurl)\n     init();\n   GCriticalSectionLock lock1(&class_lock);\n   cgi_name_arr.empty();\n   cgi_value_arr.empty();\n\n      // Search for the beginning of CGI arguments\n   const char * start=url;\n   while(*start)\n   {\n     if(*(start++)=='?')\n     {\n       break;\n     }\n   }\n\n      // Now loop until we see all of them\n   while(*start)\n   {\n      GUTF8String arg;        // Storage for another argument\n      while(*start)        // Seek for the end of it\n      {\n         if (is_argument_sep(start))\n         {\n            start++;\n            break;\n         } else\n         {\n           arg+=*start++;\n         }\n      }\n      if (arg.length())\n      {\n            // Got argument in 'arg'. Split it into 'name' and 'value'\n         const char * ptr;\n         const char * const arg_ptr=arg;\n\t for(ptr=arg_ptr;*ptr&&(*ptr != '=');ptr++)\n\t   EMPTY_LOOP;\n\n         GUTF8String name, value;\n         if (*ptr)\n         {\n            name=GUTF8String(arg_ptr, (int)((ptr++)-arg_ptr));\n            value=GUTF8String(ptr, arg.length()-name.length()-1);\n         } else\n         {\n           name=arg;\n         }\n            \n         int args=cgi_name_arr.size();\n         cgi_name_arr.resize(args);\n         cgi_value_arr.resize(args);\n         cgi_name_arr[args]=decode_reserved(name);\n         cgi_value_arr[args]=decode_reserved(value);\n      }\n   }\n}\n\nvoid\nGURL::store_cgi_args(void)\n      // Will store CGI arguments from the cgi_name_arr and cgi_value_arr\n      // back into the URL\n{\n   if(!validurl)\n     init();\n   GCriticalSectionLock lock1(&class_lock);\n\n   const char * const url_ptr=url;\n   const char * ptr;\n   for(ptr=url_ptr;*ptr&&(*ptr!='?');ptr++)\n   \t\tEMPTY_LOOP;\n   \n   GUTF8String new_url(url_ptr, ptr-url_ptr);\n   \n   for(int i=0;i<cgi_name_arr.size();i++)\n   {\n      GUTF8String name=GURL::encode_reserved(cgi_name_arr[i]);\n      GUTF8String value=GURL::encode_reserved(cgi_value_arr[i]);\n      new_url+=(i?\"&\":\"?\")+name;\n      if (value.length())\n         new_url+=\"=\"+value;\n   }\n\n   url=new_url;\n}\n\nint\nGURL::cgi_arguments(void) const\n{\n   if(!validurl)\n      const_cast<GURL *>(this)->init();\n   return cgi_name_arr.size();\n}\n\nint\nGURL::djvu_cgi_arguments(void) const\n{\n   if(!validurl)\n     const_cast<GURL *>(this)->init();\n   GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n\n   int args=0;\n   for(int i=0;i<cgi_name_arr.size();i++)\n   {\n      if (cgi_name_arr[i].upcase()==djvuopts)\n      {\n         args=cgi_name_arr.size()-(i+1);\n         break;\n      }\n   } \n   return args;\n}\n\nGUTF8String\nGURL::cgi_name(int num) const\n{\n   if(!validurl) const_cast<GURL *>(this)->init();\n   GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n   return (num<cgi_name_arr.size())?cgi_name_arr[num]:GUTF8String();\n}\n\nGUTF8String\nGURL::djvu_cgi_name(int num) const\n{\n   if(!validurl) const_cast<GURL *>(this)->init();\n   GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n\n   GUTF8String arg;\n   for(int i=0;i<cgi_name_arr.size();i++)\n      if (cgi_name_arr[i].upcase()==djvuopts)\n      {\n         for(i++;i<cgi_name_arr.size();i++)\n            if (! num--)\n            {\n               arg=cgi_name_arr[i];\n               break;\n            }\n         break;\n      }\n   return arg;\n}\n\nGUTF8String\nGURL::cgi_value(int num) const\n{\n   if(!validurl) const_cast<GURL *>(this)->init();\n   GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n   return (num<cgi_value_arr.size())?cgi_value_arr[num]:GUTF8String();\n}\n\nGUTF8String\nGURL::djvu_cgi_value(int num) const\n{\n   if(!validurl) const_cast<GURL *>(this)->init();\n   GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n\n   GUTF8String arg;\n   for(int i=0;i<cgi_name_arr.size();i++)\n   {\n      if (cgi_name_arr[i].upcase()==djvuopts)\n      {\n         for(i++;i<cgi_name_arr.size();i++)\n         {\n            if (! num--)\n            {\n               arg=cgi_value_arr[i];\n               break;\n            }\n         }\n         break;\n      }\n   }\n   return arg;\n}\n\nDArray<GUTF8String>\nGURL::cgi_names(void) const\n{\n   if(!validurl) const_cast<GURL *>(this)->init();\n   GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n   return cgi_name_arr;\n}\n\nDArray<GUTF8String>\nGURL::cgi_values(void) const\n{\n   if(!validurl) const_cast<GURL *>(this)->init();\n   GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n   return cgi_value_arr;\n}\n\nDArray<GUTF8String>\nGURL::djvu_cgi_names(void) const\n{\n   if(!validurl) const_cast<GURL *>(this)->init();\n   GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n\n   int i;\n   DArray<GUTF8String> arr;\n   for(i=0;(i<cgi_name_arr.size())&&\n     (cgi_name_arr[i].upcase()!=djvuopts)\n     ;i++)\n     \tEMPTY_LOOP;\n\n   int size=cgi_name_arr.size()-(i+1);\n   if (size>0)\n   {\n      arr.resize(size-1);\n      for(i=0;i<arr.size();i++)\n         arr[i]=cgi_name_arr[cgi_name_arr.size()-arr.size()+i];\n   }\n\n   return arr;\n}\n\nDArray<GUTF8String>\nGURL::djvu_cgi_values(void) const\n{\n   if(!validurl) const_cast<GURL *>(this)->init();\n   GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n\n   int i;\n   DArray<GUTF8String> arr;\n   for(i=0;i<cgi_name_arr.size()&&(cgi_name_arr[i].upcase()!=djvuopts);i++)\n   \t\tEMPTY_LOOP;\n\n   int size=cgi_name_arr.size()-(i+1);\n   if (size>0)\n   {\n      arr.resize(size-1);\n      for(i=0;i<arr.size();i++)\n         arr[i]=cgi_value_arr[cgi_value_arr.size()-arr.size()+i];\n   }\n\n   return arr;\n}\n\nvoid\nGURL::clear_all_arguments(void)\n{\n   clear_hash_argument();\n   clear_cgi_arguments();\n}\n\nvoid\nGURL::clear_hash_argument(void)\n      // Clear anything after first '#' and before the following '?'\n{\n   if(!validurl) init();\n   GCriticalSectionLock lock(&class_lock);\n   bool found=false;\n   GUTF8String new_url;\n   for(const char * start=url;*start;start++)\n   {\n         // Break on first CGI arg.\n      if (*start=='?')\n      {\n         new_url+=start;\n         break;\n      }\n\n      if (!found)\n      { \n        if (*start=='#')\n          found=true;\n        else\n          new_url+=*start;\n      }\n   }\n   url=new_url;\n}\n\nvoid\nGURL::clear_cgi_arguments(void)\n{\n   if(!validurl)\n     init();\n   GCriticalSectionLock lock1(&class_lock);\n\n      // Clear the arrays\n   cgi_name_arr.empty();\n   cgi_value_arr.empty();\n\n      // And clear everything past the '?' sign in the URL\n   const char * ptrurl = url;\n   for(const char *ptr = ptrurl; *ptr; ptr++)\n     if (*ptr=='?')\n       {\n         url.setat(ptr-ptrurl, 0);\n         break;\n       }\n}\n\nvoid\nGURL::clear_djvu_cgi_arguments(void)\n{\n   if(!validurl) init();\n      // First - modify the arrays\n   GCriticalSectionLock lock(&class_lock);\n   for(int i=0;i<cgi_name_arr.size();i++)\n   {\n      if (cgi_name_arr[i].upcase()==djvuopts)\n      {\n         cgi_name_arr.resize(i-1);\n         cgi_value_arr.resize(i-1);\n         break;\n      }\n   }\n\n      // And store them back into the URL\n   store_cgi_args();\n}\n\nvoid\nGURL::add_djvu_cgi_argument(const GUTF8String &name, const char * value)\n{\n   if(!validurl)\n     init();\n   GCriticalSectionLock lock1(&class_lock);\n\n      // Check if we already have the \"DJVUOPTS\" argument\n   bool have_djvuopts=false;\n   for(int i=0;i<cgi_name_arr.size();i++)\n   {\n      if (cgi_name_arr[i].upcase()==djvuopts)\n      {\n         have_djvuopts=true;\n         break;\n      }\n   }\n\n      // If there is no DJVUOPTS, insert it\n   if (!have_djvuopts)\n   {\n      int pos=cgi_name_arr.size();\n      cgi_name_arr.resize(pos);\n      cgi_value_arr.resize(pos);\n      cgi_name_arr[pos]=djvuopts;\n   }\n\n      // Add new argument to the array\n   int pos=cgi_name_arr.size();\n   cgi_name_arr.resize(pos);\n   cgi_value_arr.resize(pos);\n   cgi_name_arr[pos]=name;\n   cgi_value_arr[pos]=value;\n\n      // And update the URL\n   store_cgi_args();\n}\n\nbool\nGURL::is_local_file_url(void) const\n{\n   if(!validurl) const_cast<GURL *>(this)->init();\n   GCriticalSectionLock lock((GCriticalSection *) &class_lock);\n   return (protocol()==\"file\" && url[5]==slash);\n}\n\nstatic const int\npathname_start(const GUTF8String &url, const int protolength)\n{\n  const int length=url.length();\n  int retval=0;\n  if(protolength+1<length)\n  {\n    retval=url.search(slash,((url[protolength+1] == '/')\n      ?((url[protolength+2] == '/')?(protolength+3):(protolength+2))\n      :(protolength+1)));\n  }\n  return (retval>0)?retval:length;\n}\n\nGUTF8String\nGURL::pathname(void) const\n{\n  return (is_local_file_url())\n    ?GURL::encode_reserved(UTF8Filename()) \n    :url.substr(pathname_start(url,protocol().length()),(unsigned int)(-1));\n}\n\nGURL\nGURL::base(void) const\n{\n   const GUTF8String xurl(get_string());\n   const int protocol_length=protocol(xurl).length();\n   const char * const url_ptr=xurl;\n   const char * ptr, * xslash;\n   ptr=xslash=url_ptr+protocol_length+1;\n   if(xslash[0] == '/')\n   {\n     xslash++;\n     if(xslash[0] == '/')\n       xslash++;\n     for(ptr=xslash;ptr[0] && !is_argument(ptr);ptr++)\n     {\n       if ((ptr[0]==slash)&&ptr[1]&&!is_argument(ptr+1))\n        xslash=ptr;\n     }\n     if(xslash[0] != '/')\n     {\n       xslash=ptr;\n     }\n   }\n   return GURL::UTF8(GUTF8String(xurl,(int)(xslash-url_ptr))+\"/\"+ptr);\n}\n\nbool\nGURL::operator==(const GURL & gurl2) const\n{\n  const GUTF8String g1(get_string());\n  const GUTF8String g2(gurl2.get_string());\n  const char *s1 = (const char*)g1;\n  const char *s2 = (const char*)g2;\n  int n1=0;\n  int n2=0;\n  while (s1[n1] && !is_argument(s1+n1))\n    n1 += 1;\n  while (s2[n2] && !is_argument(s2+n2))\n    n2 += 1;\n  if (n1 == n2)\n    return !strcmp(s1+n1,s2+n2) && !strncmp(s1,s2,n1);\n  if (n1 == n2+1 && s1[n2]=='/')\n    return !strcmp(s1+n1,s2+n2) && !strncmp(s1,s2,n2);\n  if (n2 == n1+1 && s2[n1]=='/')\n    return !strcmp(s1+n1,s2+n2) && !strncmp(s1,s2,n1);    \n  return false;\n}\n\nGUTF8String\nGURL::name(void) const\n{\n   if(!validurl)\n     const_cast<GURL *>(this)->init();\n   GUTF8String retval;\n   if(!is_empty())\n   {\n     const GUTF8String xurl(url);\n     const int protocol_length=protocol(xurl).length();\n     const char * ptr, * xslash=(const char *)xurl+protocol_length-1;\n     for(ptr=(const char *)xurl+protocol_length;\n       *ptr && !is_argument(ptr);ptr++)\n\t {\n       if (*ptr==slash)\n          xslash=ptr;\n\t }\n     retval=GUTF8String(xslash+1, ptr-xslash-1);\n   }\n   return retval;\n}\n\nGUTF8String\nGURL::fname(void) const\n{\n   if(!validurl)\n     const_cast<GURL *>(this)->init();\n   return decode_reserved(name());\n}\n\nGUTF8String\nGURL::extension(void) const\n{\n   if(!validurl)\n     const_cast<GURL *>(this)->init();\n   GUTF8String xfilename=name();\n   GUTF8String retval;\n\n   for(int i=xfilename.length()-1;i>=0;i--)\n   {\n      if (xfilename[i]=='.')\n      {\n         retval=(const char*)xfilename+i+1;\n         break;\n      }\n   } \n   return retval;\n}\n\nGUTF8String\nGURL::decode_reserved(const GUTF8String &gurl)\n{\n  const char *url=gurl;\n  char *res;\n  GPBuffer<char> gres(res,gurl.length()+1);\n  char *r=res;\n  for(const char * ptr=url;*ptr;++ptr,++r)\n  {\n    if (*ptr!=percent)\n    {\n      r[0]=*ptr;\n    }else\n    {\n      int c1,c2;\n      if ( ((c1=hexval(ptr[1]))>=0)\n        && ((c2=hexval(ptr[2]))>=0) )\n      {\n        r[0]=(c1<<4)|c2;\n        ptr+=2;\n      } else\n      {\n        r[0]=*ptr;\n      }\n    }\n  }\n  r[0]=0;\n  GUTF8String retval(res);\n  if(!retval.is_valid())\n  {\n    retval=GNativeString(res);\n  }\n  return retval;\n}\n\nGUTF8String\nGURL::encode_reserved(const GUTF8String &gs)\n{\n  const char *s=(const char *)gs;\n  // Potentially unsafe characters (cf. RFC1738 and RFC1808)\n  static const char hex[] = \"0123456789ABCDEF\";\n  \n  unsigned char *retval;\n  GPBuffer<unsigned char> gd(retval,strlen(s)*3+1);\n  unsigned char *d=retval;\n  for (; *s; s++,d++)\n  {\n    // Convert directory separator to slashes\n#if defined(WIN32) || defined(OS2)\n    if (*s == backslash || *s== slash)\n#else\n#ifdef macintosh\n    if (*s == colon )\n#else\n#ifdef UNIX\n    if (*s == slash )\n#else\n#error \"Define something here for your operating system\"\n#endif  \n#endif\n#endif\n    {\n      *d = slash; \n      continue;\n    }\n    unsigned char const ss=(unsigned char const)(*s);\n    // WARNING: Whenever you modify this conversion code,\n    // make sure, that the following functions are in sync:\n    //   encode_reserved()\n    //   decode_reserved()\n    //   url_to_filename()\n    //   filename_to_url()\n    // unreserved characters\n    if ( (ss>='a' && ss<='z') ||\n         (ss>='A' && ss<='Z') ||\n         (ss>='0' && ss<='9') ||\n         (strchr(\"$-_.+!*'(),~:=\", ss)) ) \n    {\n      *d = ss;\n      continue;\n    }\n    // escape sequence\n    d[0] = percent;\n    d[1] = hex[ (ss >> 4) & 0xf ];\n    d[2] = hex[ (ss) & 0xf ];\n    d+=2;\n  }\n  *d = 0;\n  return retval;\n}\n\n// -------------------------------------------\n// Functions for converting filenames and urls\n// -------------------------------------------\n\nstatic GUTF8String\nurl_from_UTF8filename(const GUTF8String &gfilename)\n{\n  if(GURL::UTF8(gfilename).is_valid())\n  {\n    DEBUG_MSG(\"Debug: URL as Filename: \" << gfilename << \"\\n\");\n  } \n  const char *filename=gfilename;\n  if(filename && (unsigned char)filename[0] == (unsigned char)0xEF\n     && (unsigned char)filename[1] == (unsigned char)0xBB \n     && (unsigned char)filename[2] == (unsigned char)0xBF)\n  {\n    filename+=3;\n  }\n\n  // Special case for blank pages\n  if(!filename || !filename[0])\n  {\n    return GUTF8String();\n  } \n\n  // Normalize file name to url slash-and-escape syntax\n  GUTF8String oname=GURL::expand_name(filename);\n  GUTF8String nname=GURL::encode_reserved(oname);\n\n  // Preprend \"file://\" to file name. If file is on the local\n  // machine, include \"localhost\".\n  GUTF8String url=filespecslashes;\n  const char *cnname=nname;\n  if (cnname[0] == slash)\n  {\n    if (cnname[1] == slash)\n    {\n      url += cnname+2;\n    }else\n    {\n      url = localhost + nname;\n    }\n  }else\n  {\n    url += (localhostspec1+2) + nname;\n  }\n  return url;\n}\n\nGUTF8String \nGURL::get_string(const bool nothrow) const\n{\n  if(!validurl)\n    const_cast<GURL *>(this)->init(nothrow);\n  return url;\n}\n\n// -- Returns a url for accessing a given file.\n//    If useragent is not provided, standard url will be created,\n//    but will not be understood by some versions if IE.\nGUTF8String \nGURL::get_string(const GUTF8String &useragent) const\n{\n  if(!validurl)\n    const_cast<GURL *>(this)->init();\n  GUTF8String retval(url);\n  if(is_local_file_url()&&useragent.length())\n  {\n    if(useragent.search(\"MSIE\") >= 0 || useragent.search(\"Microsoft\")>=0)\n    {\n      retval=filespecslashes + expand_name(UTF8Filename());\n    }\n  }\n  return retval;\n}\n\nGURL::UTF8::UTF8(const GUTF8String &xurl)\n: GURL(xurl) {}\n\nGURL::UTF8::UTF8(const GUTF8String &xurl,const GURL &codebase)\n: GURL(xurl,codebase) {}\n\nGURL::GURL(const GUTF8String &xurl,const GURL &codebase)\n  : validurl(false)\n{\n  if(GURL::UTF8(xurl).is_valid())\n    {\n      url=xurl;\n    }\n  else\n    {\n      // split codebase\n      const char *buffer = codebase;\n      GUTF8String all(buffer);\n      GUTF8String suffix;\n      GUTF8String path;\n      GUTF8String prefix;\n      const int protocol_length=GURL::protocol(all).length();\n      const char *start = buffer + pathname_start(all,protocol_length);\n      if (start > buffer)\n        prefix = GUTF8String(buffer, start-buffer);\n      const char *ptr = start;\n      while (*ptr && !is_argument(ptr))\n        ptr++;\n      if (*ptr)\n        suffix = GUTF8String(ptr);\n      if (ptr > start)\n        path = GUTF8String(start, ptr-start);\n      // append xurl to path\n      const char *c = xurl;\n      if(c[0] == slash)\n        path = GURL::encode_reserved(xurl);\n      else\n        path = path + GUTF8String(slash)+GURL::encode_reserved(xurl);\n      // construct url\n      url = beautify_path(prefix + path + suffix);\n    }\n}\n\nGURL::Native::Native(const GNativeString &xurl)\n: GURL(xurl) {}\n\nGURL::Native::Native(const GNativeString &xurl,const GURL &codebase)\n: GURL(xurl,codebase) {}\n\nGURL::GURL(const GNativeString &xurl,const GURL &codebase)\n  : validurl(false)\n{\n  GURL retval(xurl.getNative2UTF8(),codebase);\n  if(retval.is_valid())\n  {\n#if defined(WIN32)\n    // Hack for IE to change \\\\ to /\n    if(retval.is_local_file_url())\n    {\n      GURL::Filename::UTF8 retval2(retval.UTF8Filename());\n      url=retval2.get_string(true);\n      validurl=false;\n    }else\n#endif // WIN32\n    {\n      url=retval.get_string(true);\n      validurl=false;\n    }\n  }\n}\n\nGURL::Filename::Filename(const GNativeString &gfilename)\n{\n  url=url_from_UTF8filename(gfilename.getNative2UTF8());\n}\n\nGURL::Filename::Native::Native(const GNativeString &gfilename)\n: GURL::Filename(gfilename) {}\n\nGURL::Filename::Filename(const GUTF8String &gfilename)\n{\n  url=url_from_UTF8filename(gfilename);\n}\n\nGURL::Filename::UTF8::UTF8(const GUTF8String &gfilename)\n: GURL::Filename(gfilename) {}\n\n// filename --\n// -- Applies heuristic rules to convert a url into a valid file name.  \n//    Returns a simple basename in case of failure.\nGUTF8String \nGURL::UTF8Filename(void) const\n{\n  GUTF8String retval;\n  if(! is_empty())\n  {\n    const char *url_ptr=url;\n  \n    // WARNING: Whenever you modify this conversion code,\n    // make sure, that the following functions are in sync:\n    //   encode_reserved()\n    //   decode_reserved()\n    //   url_to_filename()\n    //   filename_to_url()\n\n    GUTF8String urlcopy=decode_reserved(url);\n    url_ptr = urlcopy;\n\n    // All file urls are expected to start with filespec which is \"file:\"\n    if (GStringRep::cmp(filespec, url_ptr, sizeof(filespec)-1))  //if not\n      return GOS::basename(url_ptr);\n    url_ptr += sizeof(filespec)-1;\n  \n#if defined(macintosh)\n    //remove all leading slashes\n    for(;*url_ptr==slash;url_ptr++)\n      EMPTY_LOOP;\n    // Remove possible localhost spec\n    if ( !GStringRep::cmp(localhost, url_ptr, sizeof(localhost)-1) )\n      url_ptr += sizeof(localhost)-1;\n    //remove all leading slashes\n    while(*url_ptr==slash)\n      url_ptr++;\n#else\n    // Remove possible localhost spec\n    if ( !GStringRep::cmp(localhostspec1, url_ptr, sizeof(localhostspec1)-1) )\n      // RFC 1738 local host form\n      url_ptr += sizeof(localhostspec1)-1;\n    else if ( !GStringRep::cmp(localhostspec2, url_ptr, sizeof(localhostspec2)-1 ) )\n      // RFC 1738 local host form\n      url_ptr += sizeof(localhostspec2)-1;\n    else if ( (strlen(url_ptr) > 4)   // \"file://<letter>:/<path>\"\n        && (url_ptr[0] == slash)      // \"file://<letter>|/<path>\"\n        && (url_ptr[1] == slash)\n        && isalpha(url_ptr[2])\n        && ( url_ptr[3] == colon || url_ptr[3] == '|' )\n        && (url_ptr[4] == slash) )\n      url_ptr += 2;\n    else if ( (strlen(url_ptr)) > 2 // \"file:/<path>\"\n        && (url_ptr[0] == slash)\n        && (url_ptr[1] != slash) )\n      url_ptr++;\n#endif\n\n    // Check if we are finished\n#if defined(macintosh)\n    {\n      char *l_url;\n      GPBuffer<char> gl_url(l_url,strlen(url_ptr)+1);\n      const char *s;\n      char *r;\n      for ( s=url_ptr,r=l_url; *s; s++,r++)\n      {\n        *r=(*s == slash)?colon:*s;\n      }\n      *r=0;\n      retval = expand_name(l_url,root);\n    }\n#else  \n    retval = expand_name(url_ptr,root);\n#endif\n    \n#if defined(WIN32) || defined(OS2)\n    if (url_ptr[0] && url_ptr[1]=='|' && url_ptr[2]== slash)\n    {\n      if ((url_ptr[0]>='a' && url_ptr[0]<='z') \n          || (url_ptr[0]>='A' && url_ptr[0]<='Z'))\n      {\n\tGUTF8String drive;\n\tdrive.format(\"%c%c%c\", url_ptr[0],colon,backslash);\n\tretval = expand_name(url_ptr+3, drive);\n      }\n    }\n#endif\n  }\n  // Return what we have\n  return retval;\n}\n\nGNativeString \nGURL::NativeFilename(void) const\n{\n  return UTF8Filename().getUTF82Native();\n}\n\n#if defined(UNIX) || defined(macintosh) || defined(OS2)\nstatic int\nurlstat(const GURL &url,struct stat &buf)\n{\n  return ::stat(url.NativeFilename(),&buf);\n}\n#endif\n\n// is_file(url) --\n// -- returns true if filename denotes a regular file.\nbool\nGURL::is_file(void) const\n{\n  bool retval=false;\n  if(is_local_file_url())\n  {\n#if defined(UNIX) || defined(macintosh) || defined(OS2)\n    struct stat buf;\n    if (!urlstat(*this,buf))\n    {\n      retval=!(buf.st_mode & S_IFDIR);\n    }\n#elif defined(WIN32)\n    GUTF8String filename(UTF8Filename());\n    if(filename.length() >= MAX_PATH)\n      {\n        if(!filename.cmp(\"\\\\\\\\\",2))\n          filename=\"\\\\\\\\?\\\\UNC\"+filename.substr(1,-1);\n        else\n          filename=\"\\\\\\\\?\\\\\"+filename;\n      }\n    wchar_t *wfilename;\n    const size_t wfilename_size=filename.length()+1;\n    GPBuffer<wchar_t> gwfilename(wfilename,wfilename_size);\n    filename.ncopy(wfilename,wfilename_size);\n    DWORD dwAttrib;\n    dwAttrib = GetFileAttributesW(wfilename);\n    if((dwAttrib|1) == 0xFFFFFFFF)\n        dwAttrib = GetFileAttributesA(NativeFilename());\n    retval=!( dwAttrib & FILE_ATTRIBUTE_DIRECTORY );\n#else\n# error \"Define something here for your operating system\"\n#endif\n  }\n  return retval;\n}\n\nbool\nGURL::is_local_path(void) const\n{\n  bool retval=false;\n  if(is_local_file_url())\n  {\n#if defined(UNIX) || defined(macintosh) || defined(OS2)\n    struct stat buf;\n    retval=!urlstat(*this,buf);\n#else\n    GUTF8String filename(UTF8Filename());\n    if(filename.length() >= MAX_PATH)\n      {\n        if(!filename.cmp(\"\\\\\\\\\",2))\n          filename=\"\\\\\\\\?\\\\UNC\"+filename.substr(1,-1);\n        else\n          filename=\"\\\\\\\\?\\\\\"+filename;\n      }\n    wchar_t *wfilename;\n    const size_t wfilename_size=filename.length()+1;\n    GPBuffer<wchar_t> gwfilename(wfilename,wfilename_size);\n    filename.ncopy(wfilename,wfilename_size);\n    DWORD dwAttrib;\n    dwAttrib = GetFileAttributesW(wfilename);\n    if((dwAttrib|1) == 0xFFFFFFFF)\n        dwAttrib = GetFileAttributesA(NativeFilename());\n    retval=( (dwAttrib|1) != 0xFFFFFFFF);\n#endif\n  }\n  return retval;\n}\n\n// is_dir(url) --\n// -- returns true if url denotes a directory.\nbool \nGURL::is_dir(void) const\n{\n  bool retval=false;\n  if(is_local_file_url())\n  {\n    // UNIX implementation\n#if defined(UNIX) || defined(macintosh) || defined(OS2)\n    struct stat buf;\n    if (!urlstat(*this,buf))\n    {\n      retval=(buf.st_mode & S_IFDIR);\n    }\n#elif defined(WIN32)   // (either Windows or WCE)\n    GUTF8String filename(UTF8Filename());\n    if(filename.length() >= MAX_PATH)\n      {\n        if(!filename.cmp(\"\\\\\\\\\",2))\n          filename=\"\\\\\\\\?\\\\UNC\"+filename.substr(1,-1);\n        else\n          filename=\"\\\\\\\\?\\\\\"+filename;\n      }\n    wchar_t *wfilename;\n    const size_t wfilename_size=filename.length()+1;\n    GPBuffer<wchar_t> gwfilename(wfilename,wfilename_size);\n    filename.ncopy(wfilename,wfilename_size);\n    DWORD dwAttrib;\n    dwAttrib = GetFileAttributesW(wfilename);\n    if((dwAttrib|1) == 0xFFFFFFFF)\n        dwAttrib = GetFileAttributesA(NativeFilename());\n    retval=((dwAttrib != 0xFFFFFFFF)&&( dwAttrib & FILE_ATTRIBUTE_DIRECTORY ));\n#else\n# error \"Define something here for your operating system\"\n#endif\n  }\n  return retval;\n}\n\n// Follows symbolic links.\nGURL \nGURL::follow_symlinks(void) const\n{\n  GURL ret = *this;\n#if defined(S_IFLNK)\n#if defined(UNIX) || defined(macintosh)\n  int lnklen;\n  char lnkbuf[MAXPATHLEN+1];\n  struct stat buf;\n  while ( (urlstat(ret, buf) >= 0) &&\n          (buf.st_mode & S_IFLNK) &&\n          ((lnklen = readlink(ret.NativeFilename(),lnkbuf,sizeof(lnkbuf))) > 0) )\n    {\n      lnkbuf[lnklen] = 0;\n      GNativeString lnk(lnkbuf);\n      ret = GURL(lnk, ret.base());\n    }\n#endif\n#endif\n  return ret;\n}\n\nint\nGURL::mkdir() const\n{\n  if(! is_local_file_url())\n    return -1;\n  int retval=0;\n  const GURL baseURL=base();\n  if (baseURL.get_string() != url && !baseURL.is_dir())\n    retval = baseURL.mkdir();\n  if(!retval)\n    {\n#if defined(UNIX)\n      if (is_dir())\n        retval = 0;\n      else \n        retval = ::mkdir(NativeFilename(), 0755);\n#elif defined(WIN32)\n      if (is_dir())\n        retval = 0;\n      else \n        retval = CreateDirectoryA(NativeFilename(), NULL);\n#else\n# error \"Define something here for your operating system\"\n#endif\n    }\n  return retval;\n}\n\n// deletefile\n// -- deletes a file or directory\n  \nint\nGURL::deletefile(void) const\n{\n  int retval = -1;\n  if(is_local_file_url())\n    {\n#if defined(UNIX)\n      if (is_dir())\n        retval = ::rmdir(NativeFilename());\n      else\n        retval = ::unlink(NativeFilename());\n#elif defined(WIN32)\n      if (is_dir())\n        retval = ::RemoveDirectoryA(NativeFilename());\n      else\n        retval = ::DeleteFile(NativeFilename());\n#else\n# error \"Define something here for your operating system\"\n#endif\n  }\n  return retval;\n}\n\nGList<GURL>\nGURL::listdir(void) const\n{\n  GList<GURL> retval;\n  if(is_dir())\n  {\n#if defined(UNIX) || defined(OS2)\n    DIR * dir=opendir(NativeFilename());//MBCS cvt\n    for(dirent *de=readdir(dir);de;de=readdir(dir))\n    {\n      const int len = NAMLEN(de);\n      if (de->d_name[0]== dot  && len==1)\n        continue;\n      if (de->d_name[0]== dot  && de->d_name[1]== dot  && len==2)\n        continue;\n      retval.append(GURL::Native(de->d_name,*this));\n    }\n    closedir(dir);\n#elif defined (WIN32)\n    GURL::UTF8 wildcard(\"*.*\",*this);\n    WIN32_FIND_DATA finddata;\n    HANDLE handle = FindFirstFile(wildcard.NativeFilename(), &finddata);//MBCS cvt\n    const GUTF8String gpathname=pathname();\n    const GUTF8String gbase=base().pathname();\n    if( handle != INVALID_HANDLE_VALUE)\n    {\n      do\n      {\n        GURL::UTF8 Entry(finddata.cFileName,*this);\n        const GUTF8String gentry=Entry.pathname();\n        if((gentry != gpathname) && (gentry != gbase))\n          retval.append(Entry);\n      } while( FindNextFile(handle, &finddata) );\n\n      FindClose(handle);\n    }\n#else\n# error \"Define something here for your operating system\"\n#endif\n  }\n  return retval;\n}\n\nint\nGURL::cleardir(const int timeout) const\n{\n  int retval=(-1);\n  if(is_dir())\n  {\n    GList<GURL> dirlist=listdir();\n    retval=0;\n    for(GPosition pos=dirlist;pos&&!retval;++pos)\n    {\n      const GURL &Entry=dirlist[pos];\n      if(Entry.is_dir())\n      {\n        if((retval=Entry.cleardir(timeout)) < 0)\n        {\n          break;\n        }\n      }\n      if(((retval=Entry.deletefile())<0) && (timeout>0))\n      {\n        GOS::sleep(timeout);\n        retval=Entry.deletefile();\n      }\n    }\n  }\n  return retval;\n}\n\nint\nGURL::renameto(const GURL &newurl) const\n{\n  if (is_local_file_url() && newurl.is_local_file_url())\n    return rename(NativeFilename(),newurl.NativeFilename());\n  return -1;\n}\n\n// expand_name(filename[, fromdirname])\n// -- returns the full path name of filename interpreted\n//    relative to fromdirname.  Use current working dir when\n//    fromdirname is null.\nGUTF8String \nGURL::expand_name(const GUTF8String &xfname, const char *from)\n{\n  const char *fname=xfname;\n  GUTF8String retval;\n  const size_t maxlen=xfname.length()*9+MAXPATHLEN+10;\n  char * const string_buffer = retval.getbuf(maxlen);\n  // UNIX implementation\n#if defined(UNIX)\n  // Perform tilde expansion\n  GUTF8String senv;\n  if (fname && fname[0]==tilde)\n  {\n    int n;\n    for(n=1;fname[n] && fname[n]!= slash;n++) \n      EMPTY_LOOP;\n    struct passwd *pw=0;\n    if (n!=1)\n    {\n      GUTF8String user(fname+1, n-1);\n      pw=getpwnam(user);\n    }else if ((senv=GOS::getenv(\"HOME\")).length())\n    {\n      from=(const char *)senv;\n      fname = fname + n;\n    }else if ((senv=GOS::getenv(\"LOGNAME\")).length())\n    {\n      pw = getpwnam((const char *)senv.getUTF82Native());\n    }else\n    {\n      pw=getpwuid(getuid());\n    }\n    if (pw)\n    {\n      senv=GNativeString(pw->pw_dir).getNative2UTF8();\n      from = (const char *)senv;\n      fname = fname + n;\n    }\n    for(;fname[0] == slash; fname++)\n      EMPTY_LOOP;\n  }\n  // Process absolute vs. relative path\n  if (fname && fname[0]== slash)\n  {\n    string_buffer[0]=slash;\n    string_buffer[1]=0;\n  }else if (from)\n  {\n    strcpy(string_buffer, expand_name(from));\n  }else\n  {\n    strcpy(string_buffer, GOS::cwd());\n  }\n  char *s = string_buffer + strlen(string_buffer);\n  if(fname)\n  {\n    for(;fname[0]== slash;fname++)\n      EMPTY_LOOP;\n    // Process path components\n    while(fname[0])\n    {\n      if (fname[0] == dot )\n      {\n        if (!fname[1] || fname[1]== slash)\n        {\n          fname++;\n          continue;\n        }else if (fname[1]== dot && (fname[2]== slash || !fname[2]))\n        {\n          fname +=2;\n          for(;s>string_buffer+1 && *(s-1)== slash; s--)\n            EMPTY_LOOP;\n          for(;s>string_buffer+1 && *(s-1)!= slash; s--)\n            EMPTY_LOOP;\n          continue;\n        }\n      }\n      if ((s==string_buffer)||(*(s-1)!= slash))\n      {\n        *s = slash;\n        s++;\n      }\n      while (*fname &&(*fname!= slash))\n      {\n        *s = *fname++;\n        if ((size_t)((++s)-string_buffer) > maxlen)\n        {\n          G_THROW( ERR_MSG(\"GURL.big_name\") );\n        }\n      }\n      *s = 0;\n      for(;fname[0]== slash;fname++)\n        EMPTY_LOOP;\n    }\n  }\n  if (!fname || !fname[0])\n  {\n    for(;s>string_buffer+1 && *(s-1) == slash; s--)\n      EMPTY_LOOP;\n    *s = 0;\n  }\n#elif defined (WIN32) // WIN32 implementation\n  // Handle base\n  strcpy(string_buffer, (char const *)(from ? expand_name(from) : GOS::cwd()));\n  //  GNativeString native;\n  if (fname)\n  {\n    char *s = string_buffer;\n    char  drv[4];\n    // Handle absolute part of fname\n    //      Put absolute part of the file name in string_buffer, and\n    //      the relative part pointed to by fname.\n    if (fname[0]== slash || fname[0]== backslash)\n    {\n      if (fname[1]== slash || fname[1]== backslash)\n      {       // Case \"//abcd\"\n        s[0]=s[1]= backslash; s[2]=0;\n      }\n      else\n      {       // Case \"/abcd\" or \"/\"\n              //    File is at the root of the current drive. Delete the\n              //    slash at the beginning of the filename and leave\n              //    an explicit identification of the root of the drive in\n              //    string_buffer.\n        fname++;\n        s[3] = '\\0';\n      }\n    }\n    else if (fname[0] && fname[1]==colon)\n    {\n      if (fname[2]!= slash && fname[2]!= backslash)\n      {       // Case \"x:abcd\"\n        if ( toupper((unsigned char)s[0]) != toupper((unsigned char)fname[0])\n          || s[1]!=colon)\n        {\n          drv[0]=fname[0];\n          drv[1]=colon;\n          drv[2]= dot ;\n          drv[3]=0;\n          GetFullPathName(drv, maxlen, string_buffer, &s);\n          strcpy(string_buffer,(const char *)GUTF8String(string_buffer).getNative2UTF8());\n          s = string_buffer;\n        }\n        fname += 2;\n      }\n      else if (fname[3]!= slash && fname[3]!= backslash)\n      {       // Case \"x:/abcd\"\n        s[0]=toupper((unsigned char)fname[0]);\n        s[1]=colon;\n        s[2]=backslash;\n        s[3]=0;\n        fname += 3;\n      }\n      else\n      {       // Case \"x://abcd\"\n        s[0]=s[1]=backslash;\n        s[2]=0;\n        fname += 4;\n      }\n    }\n    // Process path components\n    while(*fname)\n    {\n      for(;*fname== slash || *fname==backslash;fname++)\n        EMPTY_LOOP;\n      if (fname[0]== dot )\n      {\n        if (fname[1]== slash || fname[1]==backslash || !fname[1])\n        {\n          fname++;\n          continue;\n        }\n\t\telse if ((fname[1] == dot)\n                 && (fname[2]== slash || fname[2]==backslash || !fname[2]))\n        {\n          fname += 2;\n          char *back=_tcsrchr(string_buffer,backslash);\n          char *forward=_tcsrchr(string_buffer,slash);\n          if(back>forward)\n          {\n            *back=0;\n          }else if(forward)\n          {\n            *forward=0;\n          }\n          s = string_buffer;\n          continue;\n        }\n      }\n      char* s2=s;//MBCS DBCS\n      for(;*s;s++) \n        EMPTY_LOOP;\n\t  if (s > string_buffer && s[-1] != slash && s[-1] != backslash)\n        *s++ = backslash;\n      while (*fname && (*fname!= slash) && (*fname!=backslash))\n      {\n        if (s > string_buffer + maxlen)\n          G_THROW( ERR_MSG(\"GURL.big_name\") );\n        *s++ = *fname++;\n      }\n      *s = 0;\n    }\n  }\n#else\n# error \"Define something here for your operating system\"\n#endif  \n  return retval;\n}\n\nunsigned int\nhash(const GURL & gurl)\n{\n  unsigned int retval;\n  const GUTF8String s(gurl.get_string());\n  const int len=s.length();\n  if(len && (s[len-1] == '/')) // Don't include the trailing slash as part of the hash.\n  {\n\tretval=hash(s.substr(0,len-1));\n  }else\n  {\n    retval=hash(s);\n  }\n  return retval;\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/GURL.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _GURL_H_\n#define _GURL_H_\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n#include \"GString.h\"\n#include \"Arrays.h\"\n#include \"GThreads.h\"\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n/** @name GURL.h\n    Files #\"GURL.h\"# and #\"GURL.cpp\"# contain the implementation of the\n    \\Ref{GURL} class used to store URLs in a system independent format.\n    @memo System independent URL representation.\n    @author Andrei Erofeev <eaf@geocities.com>\n\n// From: Leon Bottou, 1/31/2002\n// This has been heavily changed by Lizardtech.\n// They decided to use URLs for everyting, including\n// the most basic file access.  The URL class now is a unholy \n// mixture of code for syntactically parsing the urls (which is was)\n// and file status code (only for local file: urls).\n\n*/\n\n//@{\n\n/** System independent URL representation.\n\n    This class is used in the library to store URLs in a system independent\n    format. The idea to use a general class to hold URL arose after we\n    realized, that DjVu had to be able to access files both from the WEB\n    and from the local disk. While it is strange to talk about system\n    independence of HTTP URLs, file names formats obviously differ from\n    platform to platform. They may contain forward slashes, backward slashes,\n    colons as separators, etc. There maybe more than one URL corresponding\n    to the same file name. Compare #file:/dir/file.djvu# and\n    #file://localhost/dir/file.djvu#.\n\n    To simplify a developer's life we have created this class, which contains\n    inside a canonical representation of URLs.\n\n    File URLs are converted to internal format with the help of \\Ref{GOS} class.\n\n    All other URLs are modified to contain only forward slashes.\n*/\n\nclass DJVUAPI GURL\n{\npublic:\n  class Filename;\n  class UTF8;\n  class Native;\nprotected:\n      /** @name Constructors\n\t  Accept the string URL, check that it starts from #file:/#\n\t  or #http:/# and convert to internal system independent\n\t  representation.\n      */\n      //@{\n      ///\n   GURL(const char * url_string);\n      //@}\n\npublic:\n   GURL(void);\n\n   GURL(const GUTF8String & url_string);\n\n   GURL(const GNativeString & url_string);\n\n   GURL(const GUTF8String &xurl, const GURL &codebase);\n\n   GURL(const GNativeString &xurl, const GURL &codebase);\n\n      /// Copy constructor\n   GURL(const GURL & gurl);\n\n      /// The destructor\n   virtual ~GURL(void) {}\n\nprivate:\n      // The 'class_lock' should be locked whenever you're accessing\n      // url, or cgi_name_arr, or cgi_value_arr.\n   GCriticalSection\tclass_lock;\nprotected:\n   GUTF8String\turl;\n   DArray<GUTF8String>\tcgi_name_arr, cgi_value_arr;\n   bool validurl;\n\n   void\t\tinit(const bool nothrow=false);\n   void\t\tconvert_slashes(void);\n   void\t\tbeautify_path(void);\n   static GUTF8String\tbeautify_path(GUTF8String url);\n\n   static GUTF8String\tprotocol(const GUTF8String& url);\n   void\t\tparse_cgi_args(void);\n   void\t\tstore_cgi_args(void);\npublic:\n   /// Test if the URL is valid. If invalid, reinitialize.\n   bool is_valid(void) const;     // const lies to the compiler because of dependency problems\n\n      /// Extracts the {\\em protocol} part from the URL and returns it\n   GUTF8String\tprotocol(void) const;\n\n      /** Returns string after the first '\\#' with decoded\n\t  escape sequences. */\n   GUTF8String\thash_argument(void) const;\n\n      /** Inserts the #arg# after a separating hash into the URL.\n\t  The function encodes any illegal character in #arg# using\n\t  \\Ref{GOS::encode_reserved}(). */\n   void\t\tset_hash_argument(const GUTF8String &arg);\n\n      /** Returns the total number of CGI arguments in the URL.\n\t  CGI arguments follow '#?#' sign and are separated by '#&#' signs */\n   int\t\tcgi_arguments(void) const;\n\n      /** Returns the total number of DjVu-related CGI arguments (arguments\n\t  following #DJVUOPTS# in the URL). */\n   int\t\tdjvu_cgi_arguments(void) const;\n\n      /** Returns that part of CGI argument number #num#, which is\n\t  before the equal sign. */\n   GUTF8String\tcgi_name(int num) const;\n\n      /** Returns that part of DjVu-related CGI argument number #num#,\n\t  which is before the equal sign. */\n   GUTF8String\tdjvu_cgi_name(int num) const;\n\n      /** Returns that part of CGI argument number #num#, which is\n\t  after the equal sign. */\n   GUTF8String\tcgi_value(int num) const;\n   \n      /** Returns that part of DjVu-related CGI argument number #num#,\n\t  which is after the equal sign. */\n   GUTF8String\tdjvu_cgi_value(int num) const;\n   \n      /** Returns array of all known CGI names (part of CGI argument before\n\t  the equal sign) */\n   DArray<GUTF8String>cgi_names(void) const;\n\n      /** Returns array of names of DjVu-related CGI arguments (arguments\n\t  following #DJVUOPTS# option. */\n   DArray<GUTF8String>djvu_cgi_names(void) const;\n   \n      /** Returns array of all known CGI names (part of CGI argument before\n\t  the equal sign) */\n   DArray<GUTF8String>cgi_values(void) const;\n\n      /** Returns array of values of DjVu-related CGI arguments (arguments\n\t  following #DJVUOPTS# option. */\n   DArray<GUTF8String>djvu_cgi_values(void) const;\n\n      /// Erases everything after the first '\\#' or '?'\n   void\t\tclear_all_arguments(void);\n\n      /// Erases everything after the first '\\#'\n   void\t\tclear_hash_argument(void);\n\n      /// Erases DjVu CGI arguments (following \"#DJVUOPTS#\")\n   void\t\tclear_djvu_cgi_arguments(void);\n\n      /// Erases all CGI arguments (following the first '?')\n   void\t\tclear_cgi_arguments(void);\n\n      /** Appends the specified CGI argument. Will insert \"#DJVUOPTS#\" if\n\t  necessary */\n   void\t\tadd_djvu_cgi_argument(const GUTF8String &name, const char * value=0);\n   \n      /** Returns the URL corresponding to the directory containing\n\t  the document with this URL. The function basically takes the\n\t  URL and clears everything after the last slash. */\n   GURL\t\tbase(void) const;\n\n      /// Returns the aboslute URL without the host part.\n   GUTF8String pathname(void) const;\n\n      /** Returns the name part of this URL.\n\t  For example, if the URL is #http://www.lizardtech.com/file%201.djvu# then\n          this function will return #file%201.djvu#. \\Ref{fname}() will\n          return #file 1.djvu# at the same time. */\n   GUTF8String\tname(void) const;\n\n      /** Returns the name part of this URL with escape sequences expanded.\n\t  For example, if the URL is #http://www.lizardtech.com/file%201.djvu# then\n          this function will return #file 1.djvu#. \\Ref{name}() will\n          return #file%201.djvu# at the same time. */\n   GUTF8String\tfname(void) const;\n\n      /// Returns the extention part of name of document in this URL.\n   GUTF8String\textension(void) const;\n\n      /// Checks if this is an empty URL\n   bool\t\tis_empty(void) const;\n\n      /// Checks if the URL is local (starts from #file:/#) or not\n   bool\t\tis_local_file_url(void) const;\n\n      /** @name Concatenation operators\n\t  Concatenate the GURL with the passed {\\em name}. If the {\\em name}\n\t  is absolute (has non empty protocol prefix), we just return\n\t  #GURL(name)#. Otherwise the #name# is appended to the GURL after a\n\t  separating slash.\n      */\n      //@{\n      ///\n//   GURL\t\toperator+(const GUTF8String &name) const;\n      //@}\n\n      /// Returns TRUE if #gurl1# and #gurl2# are the same\n   bool\toperator==(const GURL & gurl2) const;\n\n      /// Returns TRUE if #gurl1# and #gurl2# are different\n   bool\toperator!=(const GURL & gurl2) const;\n\n      /// Assignment operator\n   GURL &\toperator=(const GURL & url);\n\n      /// Returns Internal URL representation\n   operator\tconst char*(void) const { return url; };\n\n  /** Returns a string representing the URL.  This function normally\n      returns a standard file URL as described in RFC 1738.  \n      Some versions of MSIE do not support this standard syntax.\n      A brain damaged MSIE compatible syntax is generated\n      when the optional argument #useragent# contains string #\"MSIE\"# or\n      #\"Microsoft\"#. */\n   GUTF8String get_string(const GUTF8String &useragent) const;\n\n   GUTF8String get_string(const bool nothrow=false) const;\n\n      /// Escape special characters\n   static GUTF8String encode_reserved(const GUTF8String &gs);\n\n   /** Decodes reserved characters from the URL.\n      See also: \\Ref{encode_reserved}(). */\n   static GUTF8String decode_reserved(const GUTF8String &url);\n\n  /// Test if this url is an existing file, directory, or device.\n  bool is_local_path(void) const;\n\n  /// Test if this url is an existing file.\n  bool is_file(void) const;\n\n  /// Test if this url is an existing directory.\n  bool is_dir(void) const;\n\n  /// Follows symbolic links.\n  GURL follow_symlinks(void) const;\n\n  /// Creates the specified directory.\n  int mkdir(void) const;\n\n  /** Deletes file or directory.\n      Directories are not deleted unless the directory is empty.\n      Returns a negative number if an error occurs. */\n  int deletefile(void) const;\n\n  /** Recursively erases contents of directory. The directory\n      itself will not be removed. */\n  int cleardir(const int timeout=0) const;\n\n  /// Rename a file or directory.\n  int renameto(const GURL &newurl) const;\n\n  /// List the contents of a directory. \n  GList<GURL> listdir(void) const;\n\n  /** Returns a filename for a URL. Argument #url# must be a legal file URL.\n      This function applies heuristic rules to convert the URL into a valid\n      file name. It is guaranteed that this function can properly parse all\n      URLs generated by #filename_to_url#. The heuristics also work better when\n      the file actually exists.  The empty string is returned when this\n      function cannot parse the URL or when the URL is not a file URL.\n        URL formats are as described in RFC 1738 plus the following alternative\n      formats for files on the local host:\n\n                file://<letter>:/<path>\n                file://<letter>|/<path>\n                file:/<path>\n\n      which are accepted because various browsers recognize them.*/\n   GUTF8String UTF8Filename(void) const;\n   /// Same but returns a native string.\n   GNativeString NativeFilename(void) const;\n\n      /** Hashing function.\n\t  @return hash suitable for usage in \\Ref{GMap} */\n   friend unsigned int\thash(const GURL & gurl);\n\n  /** Returns fully qualified file names.  This functions constructs the fully\n      qualified name of file or directory #filename#. When provided, the\n      optional argument #fromdirname# is used as the current directory when\n      interpreting relative specifications in #filename#.  Function\n      #expand_name# is very useful for logically concatenating file names.  It\n      knows which separators should be used for each operating system and it\n      knows which syntactical rules apply. */\n  static GUTF8String expand_name(const GUTF8String &filename, const char *fromdirname=0);\n};\n\nclass DJVUAPI GURL::UTF8 : public GURL\n{\npublic:\n  UTF8(const GUTF8String &xurl);\n  UTF8(const GUTF8String &xurl, const GURL &codebase);\n};\n\nclass DJVUAPI GURL::Native : public GURL\n{\npublic:\n  Native(const GNativeString &xurl);\n  Native(const GNativeString &xurl, const GURL &codebase);\n};\n\nclass DJVUAPI GURL::Filename : public GURL\n{\npublic:\n  Filename(const GUTF8String &filename);\n  Filename(const GNativeString &filename);\n  class UTF8;\n  class Native;\n};\n\nclass DJVUAPI GURL::Filename::UTF8 : public GURL::Filename\n{\npublic:\n  UTF8(const GUTF8String &filename);\n};\n\nclass DJVUAPI GURL::Filename::Native : public GURL::Filename\n{\npublic:\n  Native(const GNativeString &filename);\n};\n\n\ninline bool\nGURL::operator!=(const GURL & gurl2) const\n{\n  return !(*this == gurl2);\n}\n\ninline GUTF8String\nGURL::protocol(void) const\n{\n   return protocol(get_string());\n}\n\ninline bool\nGURL::is_empty(void) const\n{\n   return !url.length()||!get_string().length();\n}\n\n// Test if the URL is valid.\n// If invalid, reinitialize and return the result.\ninline bool\nGURL::is_valid(void) const\n{\n  if(!validurl)\n    const_cast<GURL *>(this)->init(true);\n  return validurl;\n}\n\n\n\n//@}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/GUnicode.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"GString.h\"\n\n#include <stddef.h>\n\n#if HAS_ICONV\n#include <iconv.h>\n#endif\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nstatic unsigned char nill=0;\n\nstatic void const * \ncheckmarks(void const * const xbuf,\n           unsigned int &bufsize,\n           GStringRep::EncodeType &rep)\n{\n  unsigned char const *buf=(unsigned char const *)xbuf;\n  if(bufsize >= 2 || (xbuf && !bufsize && rep != GStringRep::XOTHER))\n  {\n    const unsigned int s=(((unsigned int)buf[0])<<8)+(unsigned int)buf[1];\n    switch(s)\n    {\n      case 0:\n        if((bufsize>=4)||(!bufsize && rep == GStringRep::XUCS4BE)\n          ||(!bufsize && rep == GStringRep::XUCS4_2143))\n        {\n          const unsigned int s=(((unsigned int)buf[2])<<8)+(unsigned int)buf[3];\n          if(s == 0xfeff)\n          { \n            rep=GStringRep::XUCS4BE;\n            buf+=4;\n          }else if(s == 0xfffe)\n          {\n            rep=GStringRep::XUCS4_2143;\n            buf+=4;\n          }\n        }\n        break;\n      case 0xfffe:\n        if(((bufsize>=4)||(!bufsize && rep == GStringRep::XUCS4LE)) \n           && !((unsigned char *)buf)[2] && !((unsigned char *)buf)[3])\n        {\n          rep=GStringRep::XUCS4LE;\n          buf+=4;\n        }else\n        {\n          rep=GStringRep::XUTF16LE;\n          buf+=2;\n        }\n        break;\n      case 0xfeff:\n        if(((bufsize>=4)||(!bufsize && rep == GStringRep::XUCS4_3412)) \n           && !((unsigned char *)buf)[2] && !((unsigned char *)buf)[3])\n        {\n          rep=GStringRep::XUCS4_3412;\n          buf+=4;\n        }else\n        {\n          rep=GStringRep::XUTF16LE;\n          buf+=2;\n        }\n        break;\n      case 0xefbb:\n        if(((bufsize>=3)||(!bufsize && GStringRep::XUTF8 == rep))&&(buf[2] == 0xbf))\n        {\n          rep=GStringRep::XUTF8;\n          buf+=3;\n        }\n        break;\n      default:\n        break;\n    }\n  }\n  if(buf != xbuf)\n  {\n    if(bufsize)\n    {\n      const size_t s=(size_t)xbuf-(size_t)buf;\n      if(bufsize> s)\n      {\n        bufsize-=s;\n      }else\n      {\n        bufsize=0;\n        buf=(const unsigned char *)&nill;\n      }\n    }\n  }\n  return buf;\n}\n\nclass GStringRep::Unicode : public GStringRep::UTF8\n{\npublic:\n  GP<GStringRep> encoding;\n  EncodeType encodetype;\n  void *remainder;\n  GPBufferBase gremainder;\npublic:\n  Unicode(void);\n  /// virtual destructor.\n  virtual ~Unicode();\n\n  static GP<GStringRep> create(const unsigned int sz);\n  static GP<GStringRep> create(void const * const buf, unsigned int bufsize,\n                               const EncodeType, const GP<GStringRep> &encoding);\n  static GP<GStringRep> create( void const * const buf,\n    unsigned int size, const EncodeType encodetype );\n  static GP<GStringRep> create( void const * const buf,\n    const unsigned int size, GP<GStringRep> encoding );\n  static GP<GStringRep> create( void const * const buf,\n    const unsigned int size, const GP<Unicode> &remainder );\n\nprotected:\n  virtual void set_remainder( void const * const buf, const unsigned int size,\n    const EncodeType encodetype );\n  virtual void set_remainder( void const * const buf, const unsigned int size,\n    const GP<GStringRep> &encoding );\n  virtual void set_remainder( const GP<Unicode> &remainder );\n  virtual GP<Unicode> get_remainder(void) const;\n};\n// static uint32_t UTF8toUCS4(unsigned char const *&,void const * const);\nstatic uint32_t xUTF16toUCS4(uint16_t const *&s,void const * const);\nstatic uint32_t UTF16BEtoUCS4(unsigned char const *&s,void const * const);\nstatic uint32_t UTF16LEtoUCS4(unsigned char const *&s,void const * const);\nstatic uint32_t UCS4BEtoUCS4(unsigned char const *&s,void const * const);\nstatic uint32_t UCS4LEtoUCS4(unsigned char const *&s,void const * const);\nstatic uint32_t UCS4_3412toUCS4(unsigned char const *&s,void const * const);\nstatic uint32_t UCS4_2143toUCS4(unsigned char const *&s,void const * const);\n\nGP<GStringRep>\nGStringRep::Unicode::create(const unsigned int sz)\n{\n  GP<GStringRep> gaddr;\n  if (sz > 0)\n  {\n    GStringRep *addr;\n    gaddr=(addr=new GStringRep::Unicode);\n    addr->data=(char *)(::operator new(sz+1));\n    addr->size = sz;\n    addr->data[sz] = 0;\n  }\n  return gaddr;\n}\n\nGStringRep::Unicode::Unicode(void)\n: encodetype(XUTF8), gremainder(remainder,0,1) {}\n\nGStringRep::Unicode::~Unicode() {}\n\nGP<GStringRep>\nGStringRep::Unicode::create(\n  void const * const xbuf,\n  unsigned int bufsize,\n  const EncodeType t,\n  const GP<GStringRep> &encoding)\n{\n  return (encoding->size)\n    ?create(xbuf,bufsize,encoding)\n    :create(xbuf,bufsize,t);\n}\n\nGP<GStringRep>\nGStringRep::Unicode::create(\n  void const * const xbuf,\n  const unsigned int bufsize,\n  const GP<Unicode> &xremainder )\n{\n  Unicode *r=xremainder;\n  GP<GStringRep> retval;\n  if(r)\n  {\n    const int s=r->gremainder;\n    if(xbuf && bufsize)\n    {\n      if(s)\n      {\n        void *buf;\n        GPBufferBase gbuf(buf,s+bufsize,1);\n        memcpy(buf,r->remainder,s);\n        memcpy((void *)((size_t)buf+s),xbuf,bufsize);\n        retval=((r->encoding)\n          ?create(buf,s+bufsize,r->encoding)\n          :create(buf,s+bufsize,r->encodetype));\n      }else\n      {\n        retval=((r->encoding)\n          ?create(xbuf,bufsize,r->encoding)\n          :create(xbuf,bufsize,r->encodetype));\n      }\n    }else if(s)\n\t{\n      void *buf;\n      GPBufferBase gbuf(buf,s,1);\n      memcpy(buf,r->remainder,s);\n      retval=((r->encoding)\n        ?create(buf,s,r->encoding)\n        :create(buf,s,r->encodetype));\n\t}else\n    {\n      retval=((r->encoding)\n        ?create(0,0,r->encoding)\n        :create(0,0,r->encodetype));\n    }\n  }else\n  {\n    retval=create(xbuf,bufsize,XUTF8);\n  }\n  return retval;\n}\n\n#if HAS_ICONV\n/* This template works around incompatible iconv protoypes */\ntemplate<typename _T> inline size_t \niconv_adaptor(size_t(*iconv_func)(iconv_t, _T, size_t *, char**, size_t*),\n              iconv_t cd, char **inbuf, size_t *inbytesleft,\n              char **outbuf, size_t *outbytesleft)\n{\n  return iconv_func (cd, (_T)inbuf, inbytesleft, outbuf, outbytesleft);\n}\n#endif\n\nGP<GStringRep>\nGStringRep::Unicode::create(\n  void const * const xbuf,\n  unsigned int bufsize,\n  GP<GStringRep> encoding)\n{\n  GP<GStringRep> retval;\n  GStringRep *e=encoding;\n  if(e)\n  {\n    e=(encoding=e->upcase());\n  }\n  if(!e || !e->size)\n  {\n    retval=create(xbuf,bufsize,XOTHER);\n  }else if(!e->cmp(\"UTF8\") || !e->cmp(\"UTF-8\"))\n  {\n    retval=create(xbuf,bufsize,XUTF8);\n  }else if(!e->cmp(\"UTF16\")|| !e->cmp(\"UTF-16\")\n    || !e->cmp(\"UCS2\") || !e->cmp(\"UCS2\"))\n  {\n    retval=create(xbuf,bufsize,XUTF16);\n  }else if(!e->cmp(\"UCS4\") || !e->cmp(\"UCS-4\"))\n  {\n    retval=create(xbuf,bufsize,XUCS4);\n  }else\n  {\n#if HAS_ICONV\n    EncodeType t=XOTHER;\n    void const * const buf=checkmarks(xbuf,bufsize,t); \n    if(t != XOTHER)\n    {\n      retval=create(xbuf,bufsize,t);\n    }else if(buf && bufsize)\n    {\n      unsigned char const *eptr=(unsigned char *)buf;\n      unsigned int j=0;\n      for(j=0;(j<bufsize)&&*eptr;j++,eptr++)\n        EMPTY_LOOP;\n      if (j)\n      {\n        unsigned char const *ptr=(unsigned char *)buf;\n        if(e)\n        {\n          iconv_t cv=iconv_open(\"UTF-8\",(const char *)e);\n          if(cv == (iconv_t)(-1))\n          { \n            const int i=e->search('-');\n            if(i>=0)\n            {\n              cv=iconv_open(\"UTF-8\",e->data+i+1);\n            }\n          }\n          if(cv == (iconv_t)(-1))\n          { \n            retval=create(0,0,XOTHER);\n          }else\n          {\n            size_t ptrleft=(eptr-ptr); \n            char *utf8buf;\n            size_t pleft=6*ptrleft+1;\n            GPBuffer<char> gutf8buf(utf8buf,pleft);\n            char *p=utf8buf;\n            char *nptr = (char*)ptr;\n            while(iconv_adaptor(iconv, cv, &nptr, &ptrleft, &p, &pleft)) \n              ptr = (unsigned char*)nptr;\n            iconv_close(cv);\n            retval=create(utf8buf,(size_t)ptr-(size_t)buf,t);\n            retval->set_remainder(ptr,(size_t)eptr-(size_t)ptr,e);\n          }\n        }\n      }else\n      {\n        retval=create(0,0,XOTHER);\n        retval->set_remainder(0,0,e);\n      }\n    }\n#else\n    retval=create(xbuf,bufsize,XOTHER);\n#endif\n  }\n  return retval;\n}\n\nGP<GStringRep>\nGStringRep::Unicode::create(\n  void const * const xbuf,\n  unsigned int bufsize,\n  EncodeType t)\n{\n  GP<GStringRep> gretval;\n  GStringRep *retval=0;\n  void const * const buf=checkmarks(xbuf,bufsize,t); \n  if(buf && bufsize)\n  {\n    unsigned char const *eptr=(unsigned char *)buf;\n    unsigned int maxutf8size=0;\n    void const* const xeptr=(void const *)((size_t)eptr+bufsize);\n    switch(t)\n    {\n      case XUCS4:\n      case XUCS4BE:\n      case XUCS4LE:\n      case XUCS4_2143:\n      case XUCS4_3412:\n      {\n        for(uint32_t w;\n          (eptr<xeptr)&&(w=*(uint32_t const *)eptr);\n          eptr+=sizeof(uint32_t))\n        {\n          maxutf8size+=(w>0x7f)?6:1;\n        }\n        break;\n      }\n      case XUTF16:\n      case XUTF16BE:\n      case XUTF16LE:\n      {\n        for(uint16_t w;\n          (eptr<xeptr)&&(w=*(uint16_t const *)eptr);\n          eptr+=sizeof(uint16_t))\n        {\n          maxutf8size+=3;\n        }\n        break;\n      }\n      case XUTF8:\n        for(;(eptr<xeptr)&&*eptr;maxutf8size++,eptr++)\n          EMPTY_LOOP;\n        break;\n      case XEBCDIC:\n        for(;(eptr<xeptr)&&*eptr;eptr++)\n        {\n          maxutf8size+=(*eptr>0x7f)?2:1;\n        }\n        break;\n      default:\n        break;\n    }\n    unsigned char *utf8buf=0;\n    GPBuffer<unsigned char> gutf8buf(utf8buf,maxutf8size+1);\n    utf8buf[0]=0;\n    if (maxutf8size)\n    {\n      unsigned char *optr=utf8buf;\n      int len=0;\n      unsigned char const *iptr=(unsigned char *)buf;\n      uint16_t const *sptr=(uint16_t *)buf;\n      uint32_t w;\n      switch(t)\n      {\n        case XUCS4:\n          for(;\n            (iptr<eptr)&&(w=*(uint32_t const *)iptr);\n            len++,iptr+=sizeof(uint32_t const))\n          {\n            optr=UCS4toUTF8(w,optr);\n          }\n          break;\n        case XUCS4BE:\n          for(;(w=UCS4BEtoUCS4(iptr,eptr));len++)\n          {\n            optr=UCS4toUTF8(w,optr);\n          }\n          break;\n        case XUCS4LE:\n          for(;(w=UCS4LEtoUCS4(iptr,eptr));len++)\n          {\n            optr=UCS4toUTF8(w,optr);\n          }\n          break;\n        case XUCS4_2143:\n          for(;(w=UCS4_2143toUCS4(iptr,eptr));len++)\n          {\n            optr=UCS4toUTF8(w,optr);\n          }\n          break;\n        case XUCS4_3412:\n          for(;(w=UCS4_3412toUCS4(iptr,eptr));len++)\n          {\n            optr=UCS4toUTF8(w,optr);\n          }\n          break;\n        case XUTF16:\n          for(;(w=xUTF16toUCS4(sptr,eptr));len++)\n          {\n            optr=UCS4toUTF8(w,optr);\n          }\n          break;\n        case XUTF16BE:\n          for(;(w=UTF16BEtoUCS4(iptr,eptr));len++)\n          {\n            optr=UCS4toUTF8(w,optr);\n          }\n          break;\n        case XUTF16LE:\n          for(;(w=UTF16LEtoUCS4(iptr,eptr));len++)\n          {\n            optr=UCS4toUTF8(w,optr);\n          }\n          break;\n        case XUTF8:\n          for(;(w=UTF8toUCS4(iptr,eptr));len++)\n          {\n            optr=UCS4toUTF8(w,optr);\n          }\n          break;\n        case XEBCDIC:\n          for(;(iptr<eptr)&&(w=*iptr++);len++)\n          {\n            optr=UCS4toUTF8(w,optr);\n          }\n          break;\n        default:\n          break;\n      }\n      const unsigned int size=(size_t)optr-(size_t)utf8buf;\n      if(size)\n      {\n        retval=(gretval=GStringRep::Unicode::create(size));\n        memcpy(retval->data,utf8buf,size);\n      }\n      else\n      {\n        retval=(gretval=GStringRep::Unicode::create(1));\n        retval->size=size;\n      }\n      retval->data[size]=0;\n      gutf8buf.resize(0);\n      const size_t s=(size_t)eptr-(size_t)iptr;\n      retval->set_remainder(iptr,s,t);\n    }\n  }\n  if(!retval)\n    {\n      retval=(gretval=GStringRep::Unicode::create(1));\n      retval->data[0]=0;\n      retval->size=0;\n      retval->set_remainder(0,0,t);\n    }\n  return gretval;\n}\n\nstatic uint32_t\nxUTF16toUCS4(uint16_t const *&s,void const * const eptr)\n{\n  uint32_t U=0;\n  uint16_t const * const r=s+1;\n  if(r <= eptr)\n  {\n    uint32_t const W1=s[0];\n    if((W1<0xD800)||(W1>0xDFFF))\n    {\n      if((U=W1))\n        {\n          s=r;\n        }\n    }\n    else if(W1<=0xDBFF)\n      {\n        uint16_t const * const rr=r+1;\n        if(rr <= eptr)\n          {\n            uint32_t const W2=s[1];\n            if(((W2>=0xDC00)||(W2<=0xDFFF))\n               &&((U=(0x1000+((W1&0x3ff)<<10))|(W2&0x3ff))))\n              {\n                s=rr;\n              }\n            else\n              {\n                U=(unsigned int)(-1)-W1;\n                s=r;\n              }\n          }\n      }\n  }\n  return U;\n}\n\nstatic uint32_t\nUTF16BEtoUCS4(unsigned char const *&s,void const * const eptr)\n{\n  uint32_t U=0;\n  unsigned char const * const r=s+2;\n  if(r <= eptr)\n    {\n      uint32_t const C1MSB=s[0];\n      if((C1MSB<0xD8)||(C1MSB>0xDF))\n        {\n          if((U=((C1MSB<<8)|((uint32_t)s[1]))))\n            {\n              s=r;\n            }\n        }\n      else if(C1MSB<=0xDB)\n        {\n          unsigned char const * const rr=r+2;\n          if(rr <= eptr)\n            {\n              uint32_t const C2MSB=s[2];\n              if((C2MSB>=0xDC)||(C2MSB<=0xDF))\n                {\n                  U=0x10000+((uint32_t)s[1]<<10)+(uint32_t)s[3]\n                    +(((C1MSB<<18)|(C2MSB<<8))&0xc0300);\n                  s=rr;\n                }\n              else\n                {\n                  U=(unsigned int)(-1)-((C1MSB<<8)|((uint32_t)s[1]));\n                  s=r;\n                }\n            }\n        }\n    }\n  return U;\n}\n\nstatic uint32_t\nUTF16LEtoUCS4(unsigned char const *&s,void const * const eptr)\n{\n  uint32_t U=0;\n  unsigned char const * const r=s+2;\n  if(r <= eptr)\n    {\n      uint32_t const C1MSB=s[1];\n      if((C1MSB<0xD8)||(C1MSB>0xDF))\n        {\n          if((U=((C1MSB<<8)|((uint32_t)s[0]))))\n            {\n              s=r;\n            }\n        }\n      else if(C1MSB<=0xDB)\n        {\n          unsigned char const * const rr=r+2;\n          if(rr <= eptr)\n            {\n              uint32_t const C2MSB=s[3];\n              if((C2MSB>=0xDC)||(C2MSB<=0xDF))\n                {\n                  U=0x10000+((uint32_t)s[0]<<10)+(uint32_t)s[2]\n                    +(((C1MSB<<18)|(C2MSB<<8))&0xc0300);\n                  s=rr;\n                }\n              else\n                {\n                  U=(unsigned int)(-1)-((C1MSB<<8)|((uint32_t)s[1]));\n                  s=r;\n                }\n            }\n        }\n    }\n  return U;\n}\n\nstatic uint32_t\nUCS4BEtoUCS4(unsigned char const *&s,void const * const eptr)\n{\n  uint32_t U=0;\n  unsigned char const * const r=s+4;\n  if(r<=eptr)\n    {\n      U=(((((((uint32_t)s[0]<<8)|(uint32_t)s[1])<<8)\n           |(uint32_t)s[2])<<8)|(uint32_t)s[3]);\n      if(U)\n        {\n          s=r;\n        } \n    }\n  return U;\n}\n\nstatic uint32_t\nUCS4LEtoUCS4(unsigned char const *&s,void const * const eptr)\n{\n  uint32_t U=0;\n  unsigned char const * const r=s+4;\n  if(r<=eptr)\n    {\n      U=(((((((uint32_t)s[3]<<8)|(uint32_t)s[2])<<8)|\n           (uint32_t)s[1])<<8)|(uint32_t)s[0]);\n      if(U)\n        {\n          s=r;\n        }\n    }\n  return U;\n}\n\nstatic uint32_t\nUCS4_2143toUCS4(unsigned char const *&s,void const * const eptr)\n{\n  uint32_t U=0;\n  unsigned char const * const r=s+4;\n  if(r<=eptr)\n    {\n      U=(((((((uint32_t)s[1]<<8)|(uint32_t)s[0])<<8)\n           |(uint32_t)s[3])<<8)|(uint32_t)s[2]);\n      if(U)\n        {\n          s=r;\n        }\n    }\n  return U;\n}\n\nstatic uint32_t\nUCS4_3412toUCS4(unsigned char const *&s,void const * const eptr)\n{\n  uint32_t U=0;\n  unsigned char const * const r=s+4;\n  if(r<=eptr)\n    {\n      U=(((((((uint32_t)s[2]<<8)|(uint32_t)s[3])<<8)\n           |(uint32_t)s[0])<<8)|(uint32_t)s[1]);\n      if(U)\n        {\n          s=r;\n        }\n    }\n  return U;\n}\n\nvoid\nGStringRep::Unicode::set_remainder( void const * const buf,\n   const unsigned int size, const EncodeType xencodetype )\n{\n  gremainder.resize(size,1);\n  if(size)\n    memcpy(remainder,buf,size);\n  encodetype=xencodetype;\n  encoding=0;\n}\n\nvoid\nGStringRep::Unicode::set_remainder( void const * const buf,\n   const unsigned int size, const GP<GStringRep> &xencoding )\n{\n  gremainder.resize(size,1);\n  if(size)\n    memcpy(remainder,buf,size);\n  encoding=xencoding;\n  encodetype=XOTHER;\n}\n\nvoid\nGStringRep::Unicode::set_remainder( const GP<GStringRep::Unicode> &xremainder )\n{\n  if(xremainder)\n  {\n    const int size=xremainder->gremainder;\n    gremainder.resize(size,1);\n    if(size)\n      memcpy(remainder,xremainder->remainder,size);\n    encodetype=xremainder->encodetype;\n  }\n  else\n  {\n    gremainder.resize(0,1);\n    encodetype=XUTF8;\n  }\n}\n\nGP<GStringRep::Unicode>\nGStringRep::Unicode::get_remainder( void ) const\n{\n  return const_cast<GStringRep::Unicode *>(this);\n}\n\nGUTF8String \nGUTF8String::create(void const * const buf,const unsigned int size,\n    const EncodeType encodetype, const GUTF8String &encoding)\n{\n  return encoding.length()\n    ?create(buf,size,encodetype)\n    :create(buf,size,encoding);\n}\n\nGUTF8String \nGUTF8String::create( void const * const buf,\n  unsigned int size, const EncodeType encodetype )\n{\n  GUTF8String retval;\n  retval.init(GStringRep::Unicode::create(buf,size,encodetype));\n  return retval;\n}\n\nGUTF8String \nGUTF8String::create( void const * const buf,\n  const unsigned int size, const GP<GStringRep::Unicode> &remainder)\n{\n  GUTF8String retval;\n  retval.init(GStringRep::Unicode::create(buf,size,remainder));\n  return retval;\n}\n\nGUTF8String \nGUTF8String::create( void const * const buf,\n  const unsigned int size, const GUTF8String &encoding )\n{\n  GUTF8String retval;\n  retval.init(GStringRep::Unicode::create(buf,size,encoding ));\n  return retval;\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/IFFByteStream.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n// -- Implementation of IFFByteStream\n// - Author: Leon Bottou, 06/1998\n\n// From: Leon Bottou, 1/31/2002\n// This has been changed by Lizardtech to fit better \n// with their re-implementation of ByteStreams.\n\n#include <assert.h>\n#include \"IFFByteStream.h\"\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n// Constructor\nIFFByteStream::IFFByteStream(const GP<ByteStream> &xbs,const int xpos)\n  : ByteStream::Wrapper(xbs), ctx(0), dir(0)\n{\n  offset = seekto = xpos;\n  has_magic_att = false;\n  has_magic_sdjv = false;\n}\n\n// Destructor\nIFFByteStream::~IFFByteStream()\n{\n  while (ctx)\n    close_chunk();\n}\n\nGP<IFFByteStream>\nIFFByteStream::create(const GP<ByteStream> &bs)\n{\n  const int pos=bs->tell();\n  return new IFFByteStream(bs,pos);\n}\n\n\n// IFFByteStream::ready\n// -- indicates if bytestream is ready for reading\n//    returns number of bytes available\n\nint \nIFFByteStream::ready()\n{\n  if (ctx && dir < 0)\n    return ctx->offEnd - offset;\n  else if (ctx)\n    return 1;\n  else\n    return 0;\n}\n\n\n// IFFByteStream::composite\n// -- indicates if bytestream is ready for putting or getting chunks\n\nint \nIFFByteStream::composite()\n{\n  if (ctx && !ctx->bComposite)\n    return 0;\n  else\n    return 1;\n}\n\n\n\n\n// IFFByteStream::check_id\n// -- checks if an id is legal\n\nint \nIFFByteStream::check_id(const char *id)\n{\n  int i;\n  // check absence of null bytes\n  for (i=0; i<4; i++)\n    if (id[i]<0x20 || id[i]>0x7e)\n      return -1;\n  // check composite chunks\n  static const char *szComposite[] = { \"FORM\", \"LIST\", \"PROP\", \"CAT \", 0 };\n  for (i=0; szComposite[i]; i++) \n    if (!memcmp(id, szComposite[i], 4))\n      return 1;\n  // check reserved chunks\n  static const char *szReserved[] = { \"FOR\", \"LIS\", \"CAT\", 0 };\n  for (i=0; szReserved[i]; i++) \n    if (!memcmp(id, szReserved[i], 3) && id[3]>='1' && id[3]<='9')\n      return -1;\n  // regular chunk\n  return 0;\n}\n\n\n\n// IFFByteStream::get_chunk\n// -- get next chunk header\n\nint  \nIFFByteStream::get_chunk(GUTF8String &chkid, int *rawoffsetptr, int *rawsizeptr)\n{\n  int bytes;\n  char buffer[8];\n  \n  // Check that we are allowed to read a chunk\n  if (dir > 0)\n    G_THROW( ERR_MSG(\"IFFByteStream.read_write\") );\n  if (ctx && !ctx->bComposite)\n    G_THROW( ERR_MSG(\"IFFByteStream.not_ready\") );\n  dir = -1;\n\n  // Seek to end of previous chunk if necessary\n  if (seekto > offset)\n    {\n      bs->seek(seekto);\n      offset = seekto;\n    }\n\n  // Skip padding byte\n  if (ctx && offset == ctx->offEnd)\n    return 0;\n  if (offset & 1)\n    {\n      bytes = bs->read( (void*)buffer, 1);\n      if (bytes==0 && !ctx)\n        return 0;\n      offset += bytes;\n    }\n  \n  // Record raw offset\n  int rawoffset = offset;\n  \n  // Read chunk id (skipping magic sequences inserted here to make\n  // DjVu files recognizable.)\n  for(;;)\n  {\n    if (ctx && offset == ctx->offEnd)\n      return 0;\n    if (ctx && offset+4 > ctx->offEnd)\n      G_THROW( ERR_MSG(\"IFFByteStream.corrupt_end\") );\n    bytes = bs->readall( (void*)&buffer[0], 4);\n    offset = seekto = offset + bytes;\n    if (bytes==0 && !ctx)\n      return 0;\n    if (bytes != 4)\n      G_THROW(ByteStream::EndOfFile);\n    if (buffer[0] == 'S' && buffer[1] == 'D' &&\n        buffer[2] == 'J' && buffer[3] == 'V' )\n      {\n        has_magic_sdjv = true;\n        continue;\n      }\n    else if (buffer[0] == 'A' && buffer[1] == 'T' &&\n             buffer[2] == '&' && buffer[3] == 'T' )\n      {\n        has_magic_att=true;\n        continue;\n      }\n    else\n      break;\n  }\n  \n  // Read chunk size\n  if (ctx && offset+4 > ctx->offEnd)\n    G_THROW( ERR_MSG(\"IFFByteStream.corrupt_end2\") );\n  bytes = bs->readall( (void*)&buffer[4], 4);\n  offset = seekto = offset + bytes;\n  if (bytes != 4)\n    G_THROW( ByteStream::EndOfFile );\n  long size = ((unsigned char)buffer[4]<<24) |\n              ((unsigned char)buffer[5]<<16) |\n              ((unsigned char)buffer[6]<<8)  |\n              ((unsigned char)buffer[7]);\n  if (ctx && offset+size > ctx->offEnd)\n    G_THROW( ERR_MSG(\"IFFByteStream.corrupt_mangled\") );\n  \n  // Check if composite \n  int composite = check_id(buffer);\n  if (composite < 0)\n    G_THROW( ERR_MSG(\"IFFByteStream.corrupt_id\") );\n  \n  // Read secondary id of composite chunk\n  if (composite)\n  {\n    if (ctx && ctx->offEnd<offset+4)\n      G_THROW( ERR_MSG(\"IFFByteStream.corrupt_header\") );\n    bytes = bs->readall( (void*)&buffer[4], 4);\n    offset += bytes;\n    if (bytes != 4)\n      G_THROW( ByteStream::EndOfFile );\n    if (check_id(&buffer[4]))\n      G_THROW( ERR_MSG(\"IFFByteStream.corrupt_2nd_id\") );\n  }\n\n  // Create context record\n  IFFContext *nctx = new IFFContext;\n  G_TRY\n  {\n    nctx->next = ctx;\n    nctx->offStart = seekto;\n    nctx->offEnd = seekto + size;\n    if (composite)\n    {\n      memcpy( (void*)(nctx->idOne), (void*)&buffer[0], 4);\n      memcpy( (void*)(nctx->idTwo), (void*)&buffer[4], 4);\n      nctx->bComposite = 1;\n    }\n    else\n    {\n      memcpy( (void*)(nctx->idOne), (void*)&buffer[0], 4);\n      memset( (void*)(nctx->idTwo), 0, 4);\n      nctx->bComposite = 0;\n    }\n  }\n  G_CATCH_ALL\n  {\n    delete nctx;\n    G_RETHROW;\n  }\n  G_ENDCATCH;\n  \n  // Install context record\n  ctx = nctx;\n  chkid = GUTF8String(ctx->idOne, 4);\n  if (composite)\n    chkid = chkid + \":\" + GUTF8String(ctx->idTwo, 4);\n\n  // Return\n  if (rawoffsetptr)\n    *rawoffsetptr = rawoffset;\n  if (rawsizeptr)\n    *rawsizeptr = ( ctx->offEnd - rawoffset + 1) & ~0x1;\n  return size;\n}\n\n\n\n// IFFByteStream::put_chunk\n// -- write new chunk header\n\nvoid  \nIFFByteStream::put_chunk(const char *chkid, int insert_magic)\n{\n  int bytes;\n  char buffer[8];\n\n  // Check that we are allowed to write a chunk\n  if (dir < 0)\n    G_THROW( ERR_MSG(\"IFFByteStream.read_write\") );\n  if (ctx && !ctx->bComposite)\n    G_THROW( ERR_MSG(\"IFFByteStream.not_ready2\") );\n  dir = +1;\n\n  // Check primary id\n  int composite = check_id(chkid);\n  if ((composite<0) || (composite==0 && chkid[4])\n      || (composite && (chkid[4]!=':' || check_id(&chkid[5]) || chkid[9])) )\n    G_THROW( ERR_MSG(\"IFFByteStream.bad_chunk\") );\n\n  // Write padding byte\n  assert(seekto <= offset);\n  memset((void*)buffer, 0, 8);\n  if (offset & 1)\n    offset += bs->write((void*)&buffer[4], 1);\n\n  // Insert magic to make this file recognizable as DjVu\n  if (insert_magic)\n  {\n    // Don't change the way you do the file magic!\n    // I rely on these bytes letters in some places\n    // (like DjVmFile.cpp and djvm.cpp) -- eaf\n    buffer[0]=0x41;\n    buffer[1]=0x54;\n    buffer[2]=0x26;\n    buffer[3]=0x54;\n    offset += bs->writall((void*)&buffer[0], 4);\n  }\n\n  // Write chunk header\n  memcpy((void*)&buffer[0], (void*)&chkid[0], 4);\n  bytes = bs->writall((void*)&buffer[0], 8);\n  offset = seekto = offset + bytes;\n  if (composite)\n  {\n    memcpy((void*)&buffer[4], (void*)&chkid[5], 4);\n    bytes = bs->writall((void*)&buffer[4], 4);\n    offset = offset + bytes;    \n  }\n\n  // Create new context record\n  IFFContext *nctx = new IFFContext;\n  G_TRY\n  {\n    nctx->next = ctx;\n    nctx->offStart = seekto;\n    nctx->offEnd = 0;\n    if (composite)\n    {\n      memcpy( (void*)(nctx->idOne), (void*)&buffer[0], 4);\n      memcpy( (void*)(nctx->idTwo), (void*)&buffer[4], 4);\n      nctx->bComposite = 1;\n    }\n    else\n    {\n      memcpy( (void*)(nctx->idOne), (void*)&buffer[0], 4);\n      memset( (void*)(nctx->idTwo), 0, 4);\n      nctx->bComposite = 0;\n    }\n  }\n  G_CATCH_ALL\n  {\n    delete nctx;\n    G_RETHROW;\n  }\n  G_ENDCATCH; \n  // Install context record and leave\n  ctx = nctx;\n}\n\n\n\nvoid \nIFFByteStream::close_chunk()\n{\n  // Check that this is ok\n  if (!ctx)\n    G_THROW( ERR_MSG(\"IFFByteStream.cant_close\") );\n  // Patch size field in new chunk\n  if (dir > 0)\n    {\n      ctx->offEnd = offset;\n      long size = ctx->offEnd - ctx->offStart;\n      char buffer[4];\n      buffer[0] = (unsigned char)(size>>24);\n      buffer[1] = (unsigned char)(size>>16);\n      buffer[2] = (unsigned char)(size>>8);\n      buffer[3] = (unsigned char)(size);\n      bs->seek(ctx->offStart - 4);\n      bs->writall((void*)buffer, 4);\n      bs->seek(offset);\n    }\n  // Arrange for reader to seek at next chunk\n  seekto = ctx->offEnd;\n  // Remove ctx record\n  IFFContext *octx = ctx;\n  ctx = octx->next;\n  assert(ctx==0 || ctx->bComposite);\n  delete octx;\n}\n\n// This is the same as above, but adds a seek to the close\n// Otherwise an EOF in this chunk won't be reported until we\n// try to open the next chunk, which makes error recovery\n// very difficult.\nvoid  \nIFFByteStream::seek_close_chunk(void)\n{\n  close_chunk();\n  if ((dir <= 0)&&((!ctx)||(ctx->bComposite))&&(seekto > offset))\n  {\n    bs->seek(seekto);\n    offset = seekto;\n  }\n}\n\n// IFFByteStream::short_id\n// Returns the id of the current chunk\n\nvoid \nIFFByteStream::short_id(GUTF8String &chkid)\n{\n  if (!ctx)\n    G_THROW( ERR_MSG(\"IFFByteStream.no_chunk_id\") );\n  if (ctx->bComposite)\n    chkid = GUTF8String(ctx->idOne, 4) + \":\" + GUTF8String(ctx->idTwo, 4);\n  else\n    chkid = GUTF8String(ctx->idOne, 4);\n}\n\n\n// IFFByteStream::full_id\n// Returns the full chunk id of the current chunk\n\nvoid \nIFFByteStream::full_id(GUTF8String &chkid)\n{\n  short_id(chkid);\n  if (ctx->bComposite)\n    return;\n  // Search parent FORM or PROP chunk.\n  for (IFFContext *ct = ctx->next; ct; ct=ct->next)\n    if (memcmp(ct->idOne, \"FOR\", 3)==0 || \n        memcmp(ct->idOne, \"PRO\", 3)==0  )\n      {\n        chkid = GUTF8String(ct->idTwo, 4) + \".\" + chkid;\n        break;\n      }\n}\n\n\n\n// IFFByteStream::read\n// -- read bytes from IFF file chunk\n\nsize_t \nIFFByteStream::read(void *buffer, size_t size)\n{\n  if (! (ctx && dir < 0))\n    G_THROW( ERR_MSG(\"IFFByteStream.not_ready3\") );\n  // Seek if necessary\n  if (seekto > offset) {\n    bs->seek(seekto);\n    offset = seekto;\n  }\n  // Ensure that read does not extend beyond chunk\n  if (offset > ctx->offEnd)\n    G_THROW( ERR_MSG(\"IFFByteStream.bad_offset\") );\n  if (offset + (long)size >  ctx->offEnd)\n    size = (size_t) (ctx->offEnd - offset);\n  // Read bytes\n  size_t bytes = bs->read(buffer, size);\n  offset += bytes;\n  return bytes;\n}\n\n\n// IFFByteStream::write\n// -- write bytes to IFF file chunk\n\nsize_t \nIFFByteStream::write(const void *buffer, size_t size)\n{\n  if (! (ctx && dir > 0))\n    G_THROW( ERR_MSG(\"IFFByteStream.not_ready4\") );\n  if (seekto > offset)\n    G_THROW( ERR_MSG(\"IFFByteStream.cant_write\") );\n  size_t bytes = bs->write(buffer, size);\n  offset += bytes;\n  return bytes;\n}\n\n// IFFByteStream::tell\n// -- tell position\n\nlong \nIFFByteStream::tell() const\n{\n  return (seekto>offset)?seekto:offset;\n}\n\nbool\nIFFByteStream::compare(IFFByteStream &iff)\n{\n  bool retval=(&iff == this);\n  if(!retval)\n  {\n    GUTF8String chkid1, chkid2;\n    int size;\n    while((size=get_chunk(chkid1)) == iff.get_chunk(chkid2))\n    {\n      if(chkid1 != chkid2)\n      {\n        break;\n      }\n      if(!size)\n      {\n        retval=true;\n        break;\n      }\n      char buf[4096];\n      int len;\n      while((len=read(buf,sizeof(buf))))\n      {\n        int s=0;\n        char buf2[sizeof(buf)];\n        while(s<len)\n        {\n          const int i=iff.read(buf2+s,len-s);\n          if(!i)\n            break;\n          s+=i;\n        }\n        if((s != len)||memcmp(buf,buf2,len))\n          break;\n      }\n      if(len)\n        break;\n      iff.close_chunk();\n      close_chunk();\n    }\n  }\n  return retval;\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/IFFByteStream.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _IFFBYTESTREAM_H_\n#define _IFFBYTESTREAM_H_\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n/** @name IFFByteStream.h\n\n    Files #\"IFFByteStream.h\"# and #\"IFFByteStream.cpp\"# implement a parser for\n    files structured according the Electronic Arts ``EA IFF 85 Interchange\n    File Format''.  IFF files are composed of a sequence of data {\\em chunks}.\n    Each chunk is identified by a four character {\\em chunk identifier}\n    describing the type of the data stored in the chunk.  A few special chunk\n    identifiers, for instance #\"FORM\"#, are reserved for {\\em composite\n    chunks} which themselves contain a sequence of data chunks.  This\n    conventions effectively provides IFF files with a convenient hierarchical\n    structure.  Composite chunks are further identified by a secondary chunk\n    identifier.\n    \n    We found convenient to define a {\\em extended chunk identifier}.  In the\n    case of a regular chunk, the extended chunk identifier is simply the\n    chunk identifier, as in #\"PM44\"#. In the case of a composite chunk, the\n    extended chunk identifier is composed by concatenating the main chunk\n    identifier, a colon, and the secondary chunk identifier, as in\n    #\"FORM:DJVU\"#.\n\n    Class \\Ref{IFFByteStream} provides a way to read or write IFF structured\n    files.  Member functions provide an easy mean to position the underlying\n    \\Ref{ByteStream} at the beginning of each chunk and to read or write the\n    data until reaching the end of the chunk.  The utility program\n    \\Ref{djvuinfo} demonstrates how to use class #IFFByteStream#.\n\n    {\\bf IFF Files and ZP-Coder} ---\n    Class #IFFByteStream# repositions the underlying ByteStream whenever a new\n    chunk is accessed.  It is possible to code chunk data with the ZP-Coder\n    without worrying about the final file position. See class \\Ref{ZPCodec}\n    for more details.\n    \n    {\\bf DjVu IFF Files} --- We had initially planned to exactly follow the\n    IFF specifications.  Then we realized that certain versions of MSIE\n    recognize any IFF file as a Microsoft AIFF sound file and pop a message\n    box \"Cannot play that sound\".  It appears that the structure of AIFF files\n    is entirely modeled after the IFF standard, with small variations\n    regarding the endianness of numbers and the padding rules.  We eliminate\n    this problem by casting the octet protection spell.  Our IFF files always\n    start with the four octets #0x41,0x54,0x26,0x54# followed by the fully\n    conformant IFF byte stream.  Class #IFFByteStream# silently skips these\n    four octets when it encounters them.\n\n    {\\bf References} --- EA IFF 85 Interchange File Format specification:\\\\\n    \\URL{http://www.cica.indiana.edu/graphics/image_specs/ilbm.format.txt} or\n    \\URL{http://www.tnt.uni-hannover.de/soft/compgraph/fileformats/docs/iff.pre}\n\n    @memo \n    IFF file parser.\n    @author\n    L\\'eon Bottou <leonb@research.att.com>\n\n// From: Leon Bottou, 1/31/2002\n// This has been changed by Lizardtech to fit better \n// with their re-implementation of ByteStreams.\n\n*/\n//@{\n\n\n#include \"DjVuGlobal.h\"\n#include <stddef.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include \"GException.h\"\n#include \"GString.h\"\n#include \"ByteStream.h\"\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n/** ByteStream interface for an IFF file. \n\n    Class #IFFByteStream# augments the #ByteStream# interface with\n    functions for navigating from chunk to chunk.  It works in relation\n    with a ByteStream specified at construction time. \n\n    {\\bf Reading an IFF file} --- You can read an IFF file by constructing an\n    #IFFByteStream# object attached to the ByteStream containing the IFF file.\n    Calling function \\Ref{get_chunk} positions the file pointer at the\n    beginning of the first chunk.  You can then use \\Ref{ByteStream::read} to\n    access the chunk data.  Function #read# will return #0# if you attempt to\n    read past the end of the chunk, just as if you were trying to read past\n    the end of a file. You can at any time call function \\Ref{close_chunk} to\n    terminate reading data in this chunk.  The following chunks can be\n    accessed by calling #get_chunk# and #close_chunk# repeatedly until you\n    reach the end of the file.  Function #read# is not very useful when\n    accessing a composite chunk.  You can instead make nested calls to\n    functions #get_chunk# and #close_chunk# in order to access the chunks\n    located inside the composite chunk.\n    \n    {\\bf Writing an IFF file} --- You can write an IFF file by constructing an\n    #IFFByteStream# object attached to the seekable ByteStream object that\n    will contain the IFF file.  Calling function \\Ref{put_chunk} creates a\n    first chunk header and positions the file pointer at the beginning of the\n    chunk.  You can then use \\Ref{ByteStream::write} to store the chunk data.\n    Calling function \\Ref{close_chunk} terminates the current chunk.  You can\n    append more chunks by calling #put_chunk# and #close_chunk# repeatedly.\n    Function #write# is not very useful for writing a composite chunk.  You\n    can instead make nested calls to function #put_chunk# and #close_chunk# in\n    order to create chunks located inside the composite chunk.\n\n    Writing an IFF file requires a seekable ByteStream (see\n    \\Ref{ByteStream::is_seekable}).  This is not much of a problem because you\n    can always create the IFF file into a \\Ref{MemoryByteStream} and then use\n    \\Ref{ByteStream::copy} to transfer the IFF file into a non seekable\n    ByteStream.  */\n\nclass DJVUAPI IFFByteStream : protected ByteStream::Wrapper\n{\nprotected: \n  IFFByteStream(const GP<ByteStream> &bs, const int pos);\npublic:\n  /** Constructs an IFFByteStream object attached to ByteStream #bs#.\n      Any ByteStream can be used when reading an IFF file.  Writing\n      an IFF file however requires a seekable ByteStream. */\n  static GP<IFFByteStream> create(const GP<ByteStream> &bs);\n  // --- BYTESTREAM INTERFACE\n  ~IFFByteStream();\n  virtual size_t read(void *buffer, size_t size);\n  virtual size_t write(const void *buffer, size_t size);\n  virtual long tell(void) const;\n  // -- NAVIGATING CHUNKS\n  /** Enters a chunk for reading.  Function #get_chunk# returns zero when the\n      last chunk has already been accessed.  Otherwise it parses a chunk\n      header, positions the IFFByteStream at the beginning of the chunk data,\n      stores the extended chunk identifier into string #chkid#, and returns\n      the non zero chunk size.  The file offset of the chunk data may be\n      retrieved using function #tell#.  The chunk data can then be read using\n      function #read# until reaching the end of the chunk.  Advanced users may\n      supply two pointers to integer variables using arguments #rawoffsetptr#\n      and #rawsizeptr#. These variables will be overwritten with the offset\n      and the length of the file segment containing both the chunk header and\n      the chunk data. */\n  int get_chunk(GUTF8String &chkid, int *rawoffsetptr=0, int *rawsizeptr=0);\n  /** Enters a chunk for writing.  Function #put_chunk# prepares a chunk\n      header and positions the IFFByteStream at the beginning of the chunk\n      data.  Argument #chkid# defines a extended chunk identifier for this\n      chunk.  The chunk data can then be written using function #write#.  The\n      chunk is terminated by a matching call to function #close_chunk#.  When\n      #insertmagic# is non zero, function #put_chunk# inserts the bytes:\n      0x41, 0x54, 0x26, 0x54 before the chunk header, as discussed in\n      \\Ref{IFFByteStream.h}. */\n  void put_chunk(const char *chkid, int insertmagic=0);\n  /** Leaves the current chunk.  This function leaves the chunk previously\n      entered by a matching call to #get_chunk# and #put_chunk#.  The\n      IFFByteStream is then ready to process the next chunk at the same\n      hierarchical level. */\n  void close_chunk();\n  /** This is identical to the above, plus it adds a seek to the start of\n      the next chunk.  This way we catch EOF errors with the current chunk.*/\n  void seek_close_chunk();\n  /** Returns true when it is legal to call #read# or #write#. */\n  int ready();\n  /** Returns true when the current chunk is a composite chunk. */\n  int composite();\n  /** Returns the current chunk identifier of the current chunk.  String\n      #chkid# is overwritten with the {\\em extended chunk identifier} of the\n      current chunk.  The extended chunk identifier of a regular chunk is\n      simply the chunk identifier, as in #\"PM44\"#.  The extended chunk\n      identifier of a composite chunk is the concatenation of the chunk\n      identifier, of a semicolon #\":\"#, and of the secondary chunk identifier,\n      as in #\"FORM:DJVU\"#. */\n  void short_id(GUTF8String &chkid);\n  /** Returns the qualified chunk identifier of the current chunk.  String\n      #chkid# is overwritten with the {\\em qualified chunk identifier} of the\n      current chunk.  The qualified chunk identifier of a composite chunk is\n      equal to the extended chunk identifier.  The qualified chunk identifier\n      of a regular chunk is composed by concatenating the secondary chunk\n      identifier of the closest #\"FORM\"# or #\"PROP\"# composite chunk\n      containing the current chunk, a dot #\".\"#, and the current chunk\n      identifier, as in #\"DJVU.INFO\"#.  According to the EA IFF 85 identifier\n      scoping rules, the qualified chunk identifier uniquely defines how the\n      chunk data should be interpreted. */\n  void full_id(GUTF8String &chkid);\n  /** Checks a potential chunk identifier.  This function categorizes the\n      chunk identifier formed by the first four characters of string #chkid#.\n      It returns #0# if this is a legal identifier for a regular chunk.  It\n      returns #+1# if this is a reserved composite chunk identifier.  It\n      returns #-1# if this is an illegal or otherwise reserved identifier\n      which should not be used.  */\n  static int check_id(const char *id);\n  GP<ByteStream> get_bytestream(void) {return this;}\n  /** Copy data from another ByteStream.  A maximum of #size# bytes are read\n      from the ByteStream #bsfrom# and are written to the ByteStream #*this#\n      at the current position.  Less than #size# bytes may be written if an\n      end-of-file mark is reached on #bsfrom#.  This function returns the\n      total number of bytes copied.  Setting argument #size# to zero (the\n      default value) has a special meaning: the copying process will continue\n      until reaching the end-of-file mark on ByteStream #bsfrom#, regardless\n      of the number of bytes transferred.  */\n  size_t copy(ByteStream &bsfrom, size_t size=0)\n  { return get_bytestream()->copy(bsfrom,size); }\n  /** Flushes all buffers in the ByteStream.  Calling this function\n      guarantees that pending data have been actually written (i.e. passed to\n      the operating system). Class #ByteStream# provides a default\n      implementation which does nothing. */\n  virtual void flush(void)\n  { ByteStream::Wrapper::flush(); }\n  /** This is a simple compare method.  The IFFByteStream may be read for\n      the sake of the comparison.  Since IFFByteStreams are non-seekable,\n      the stream is not valid for use after comparing, regardless of the\n      result. */\n  bool compare(IFFByteStream &iff);\n  /** #has_magic_att# is true if the stream has \n      the DjVu magic 'AT&T' marker. */\n  bool has_magic_att;\n  /** #has_magic_sdjv# is true if the stream has \n      the Celartem magic 'SDJV' marker. */\n  bool has_magic_sdjv;\nprivate:\n  // private datatype\n  struct IFFContext\n  {\n    IFFContext *next;\n    long offStart;\n    long offEnd;\n    char idOne[4];\n    char idTwo[4];\n    char bComposite;\n  };\n  // Implementation\n  IFFContext *ctx;\n  long offset;\n  long seekto;\n  int dir;\n  // Cancel C++ default stuff\n  IFFByteStream(const IFFByteStream &);\n  IFFByteStream & operator=(const IFFByteStream &);\n  static GP<IFFByteStream> create(ByteStream *bs);\n};\n\n//@}\n\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/IW44EncodeCodec.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n// - Author: Leon Bottou, 08/1998\n// From: Leon Bottou, 1/31/2002\n// Lizardtech has split this file into a decoder and an encoder.\n// Only superficial changes.  The meat is mine.\n\n#define IW44IMAGE_IMPLIMENTATION /* */\n\n\n\n#include \"IW44Image.h\"\n#include \"ZPCodec.h\"\n#include \"GBitmap.h\"\n#include \"GPixmap.h\"\n#include \"IFFByteStream.h\"\n#include \"GRect.h\"\n\n#include <stddef.h>\n#include <stdlib.h>\n#include <string.h>\n#include <math.h>\n#include \"MMX.h\"\n#undef IWTRANSFORM_TIMER\n#ifdef IWTRANSFORM_TIMER\n#include \"GOS.h\"\n#endif\n\n#include <assert.h>\n#include <string.h>\n#include <math.h>\n\n#ifndef NEED_DECODER_ONLY\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n#define IWALLOCSIZE    4080\n#define IWCODEC_MAJOR     1\n#define IWCODEC_MINOR     2\n#define DECIBEL_PRUNE   5.0\n\n\n//////////////////////////////////////////////////////\n// WAVELET DECOMPOSITION CONSTANTS\n//////////////////////////////////////////////////////\n\n// Parameters for IW44 wavelet.\n// - iw_norm: norm of all wavelets (for db estimation)\n// - iw_shift: scale applied before decomposition\n\n\nstatic const float iw_norm[16] = {\n  2.627989e+03F,\n  1.832893e+02F, 1.832959e+02F, 5.114690e+01F,\n  4.583344e+01F, 4.583462e+01F, 1.279225e+01F,\n  1.149671e+01F, 1.149712e+01F, 3.218888e+00F,\n  2.999281e+00F, 2.999476e+00F, 8.733161e-01F,\n  1.074451e+00F, 1.074511e+00F, 4.289318e-01F\n};\n\nstatic const int iw_shift  = 6;\nstatic const int iw_round  = (1<<(iw_shift-1));\n\nstatic const struct { int start; int size; }  \nbandbuckets[] = \n{\n  // Code first bucket and number of buckets in each band\n  { 0, 1 }, // -- band zero contains all lores info\n  { 1, 1 }, { 2, 1 }, { 3, 1 }, \n  { 4, 4 }, { 8, 4 }, { 12,4 }, \n  { 16,16 }, { 32,16 }, { 48,16 }, \n};\n\n\n/** IW44 encoded gray-level image.  This class provided functions for managing\n    a gray level image represented as a collection of IW44 wavelet\n    coefficients.  The coefficients are stored in a memory efficient data\n    structure.  Member function \\Ref{get_bitmap} renders an arbitrary segment\n    of the image into a \\Ref{GBitmap}.  Member functions \\Ref{decode_iff} and\n    \\Ref{encode_iff} read and write DjVu IW44 files (see \\Ref{IW44Image.h}).\n    Both the copy constructor and the copy operator are declared as private\n    members. It is therefore not possible to make multiple copies of instances\n    of this class. */\n\nclass IWBitmap::Encode : public IWBitmap\n{\npublic:\n  /// Destructor\n  virtual ~Encode(void);\n  /** Null constructor.  Constructs an empty IWBitmap object. This object does\n      not contain anything meaningful. You must call function \\Ref{init},\n      \\Ref{decode_iff} or \\Ref{decode_chunk} to populate the wavelet\n      coefficient data structure. */\n  Encode(void);\n  /** Initializes an IWBitmap with image #bm#.  This constructor\n      performs the wavelet decomposition of image #bm# and records the\n      corresponding wavelet coefficient.  Argument #mask# is an optional\n      bilevel image specifying the masked pixels (see \\Ref{IW44Image.h}). */\n  void init(const GBitmap &bm, const GP<GBitmap> mask=0);\n  // CODER\n  /** Encodes one data chunk into ByteStream #bs#.  Parameter #parms# controls\n      how much data is generated.  The chunk data is written to ByteStream\n      #bs# with no IFF header.  Successive calls to #encode_chunk# encode\n      successive chunks.  You must call #close_codec# after encoding the last\n      chunk of a file. */\n  virtual int  encode_chunk(GP<ByteStream> gbs, const IWEncoderParms &parms);\n  /** Writes a gray level image into DjVu IW44 file.  This function creates a\n      composite chunk (identifier #FORM:BM44#) composed of #nchunks# chunks\n      (identifier #BM44#).  Data for each chunk is generated with\n      #encode_chunk# using the corresponding parameters in array #parms#. */\n  virtual void encode_iff(IFFByteStream &iff, int nchunks, const IWEncoderParms *parms);\n  /** Resets the encoder/decoder state.  The first call to #decode_chunk# or\n      #encode_chunk# initializes the coder for encoding or decoding.  Function\n      #close_codec# must be called after processing the last chunk in order to\n      reset the coder and release the associated memory. */\n  virtual void close_codec(void);\nprotected:\n  Codec::Encode *ycodec_enc;\n};\n\n/** IW44 encoded color image. This class provided functions for managing a\n    color image represented as a collection of IW44 wavelet coefficients.  The\n    coefficients are stored in a memory efficient data structure.  Member\n    function \\Ref{get_pixmap} renders an arbitrary segment of the image into a\n    \\Ref{GPixmap}.  Member functions \\Ref{decode_iff} and \\Ref{encode_iff}\n    read and write DjVu IW44 files (see \\Ref{IW44Image.h}).  Both the copy\n    constructor and the copy operator are declared as private members. It is\n    therefore not possible to make multiple copies of instances of this\n    class. */\n\nclass IWPixmap::Encode : public IWPixmap\n{\npublic:\n  enum CRCBMode { \n    CRCBnone=IW44Image::CRCBnone, \n    CRCBhalf=IW44Image::CRCBhalf, \n    CRCBnormal=IW44Image::CRCBnormal, \n    CRCBfull=IW44Image::CRCBfull };\n  /// Destructor\n  virtual ~Encode(void);\n  /** Null constructor.  Constructs an empty IWPixmap object. This object does\n      not contain anything meaningful. You must call function \\Ref{init},\n      \\Ref{decode_iff} or \\Ref{decode_chunk} to populate the wavelet\n      coefficient data structure. */\n  Encode(void);\n  /** Initializes an IWPixmap with color image #bm#.  This constructor\n      performs the wavelet decomposition of image #bm# and records the\n      corresponding wavelet coefficient.  Argument #mask# is an optional\n      bilevel image specifying the masked pixels (see \\Ref{IW44Image.h}).\n      Argument #crcbmode# specifies how the chrominance information should be\n      encoded (see \\Ref{CRCBMode}). */\n  void init(const GPixmap &bm, const GP<GBitmap> mask=0, CRCBMode crcbmode=CRCBnormal);\n  // CODER\n  /** Encodes one data chunk into ByteStream #bs#.  Parameter #parms# controls\n      how much data is generated.  The chunk data is written to ByteStream\n      #bs# with no IFF header.  Successive calls to #encode_chunk# encode\n      successive chunks.  You must call #close_codec# after encoding the last\n      chunk of a file. */\n  virtual int  encode_chunk(GP<ByteStream> gbs, const IWEncoderParms &parms);\n  /** Writes a color image into a DjVu IW44 file.  This function creates a\n      composite chunk (identifier #FORM:PM44#) composed of #nchunks# chunks\n      (identifier #PM44#).  Data for each chunk is generated with\n      #encode_chunk# using the corresponding parameters in array #parms#. */\n  virtual void encode_iff(IFFByteStream &iff, int nchunks, const IWEncoderParms *parms);\n  /** Resets the encoder/decoder state.  The first call to #decode_chunk# or\n      #encode_chunk# initializes the coder for encoding or decoding.  Function\n      #close_codec# must be called after processing the last chunk in order to\n      reset the coder and release the associated memory. */\n  virtual void close_codec(void);\nprotected:\n  Codec::Encode *ycodec_enc, *cbcodec_enc, *crcodec_enc;\n};\n\nclass IW44Image::Map::Encode : public IW44Image::Map // DJVU_CLASS\n{\npublic:\n  Encode(const int w, const int h) : Map(w,h) {}\n  // creation (from image)\n  void create(const signed char *img8, int imgrowsize, \n              const signed char *msk8=0, int mskrowsize=0);\n  // slash resolution\n  void slashres(int res);\n};\n\nclass IW44Image::Codec::Encode : public IW44Image::Codec\n{\npublic:\n  Encode(IW44Image::Map &map);\n  // Coding\n  virtual int code_slice(ZPCodec &zp);\n  float estimate_decibel(float frac);\n  // Data\n  void encode_buckets(ZPCodec &zp, int bit, int band,\n    IW44Image::Block &blk, IW44Image::Block &eblk, int fbucket, int nbucket);\n  int encode_prepare(int band, int fbucket, int nbucket, IW44Image::Block &blk, IW44Image::Block &eblk);\n  IW44Image::Map emap;\n};\n\nIW44Image::Codec::Encode::Encode(IW44Image::Map &map)\n: Codec(map), emap(map.iw,map.ih) {}\n\n//////////////////////////////////////////////////////\n/** IW44Image::Transform::Encode\n*/\n\nclass IW44Image::Transform::Encode : IW44Image::Transform\n{\n public:\n // WAVELET TRANSFORM\n  /** Forward transform. */\n  static void forward(short *p, int w, int h, int rowsize, int begin, int end);\n  \n  // COLOR TRANSFORM\n  /** Extracts Y */\n  static void RGB_to_Y(const GPixel *p, int w, int h, int rowsize, \n                       signed char *out, int outrowsize);\n  /** Extracts Cb */\n  static void RGB_to_Cb(const GPixel *p, int w, int h, int rowsize, \n                        signed char *out, int outrowsize);\n  /** Extracts Cr */\n  static void RGB_to_Cr(const GPixel *p, int w, int h, int rowsize, \n                        signed char *out, int outrowsize);\n};\n\n\n//////////////////////////////////////////////////////\n// MMX IMPLEMENTATION HELPERS\n//////////////////////////////////////////////////////\n\n\n// Note:\n// MMX implementation for vertical transforms only.\n// Speedup is basically related to faster memory transfer\n// The IW44 transform is not CPU bound, it is memory bound.\n\n#ifdef MMX\n\nstatic const short w9[]  = {9,9,9,9};\nstatic const short w1[]  = {1,1,1,1};\nstatic const int   d8[]  = {8,8};\nstatic const int   d16[] = {16,16};\n\n\nstatic inline void\nmmx_fv_1 ( short* &q, short* e, int s, int s3 )\n{\n  while (q<e && (((long)q)&0x7))\n    {\n      int a = (int)q[-s] + (int)q[s];\n      int b = (int)q[-s3] + (int)q[s3];\n      *q -= (((a<<3)+a-b+8)>>4);\n      q++;\n    }\n  while (q+3<e)\n    {\n      MMXar( movq,       q-s,mm0);  // MM0=[ b3, b2, b1, b0 ]\n      MMXar( movq,       q+s,mm2);  // MM2=[ c3, c2, c1, c0 ]\n      MMXrr( movq,       mm0,mm1);  \n      MMXrr( punpcklwd,  mm2,mm0);  // MM0=[ c1, b1, c0, b0 ]\n      MMXrr( punpckhwd,  mm2,mm1);  // MM1=[ c3, b3, c2, b2 ]\n      MMXar( pmaddwd,    w9,mm0);   // MM0=[ (c1+b1)*9, (c0+b0)*9 ]\n      MMXar( pmaddwd,    w9,mm1);   // MM1=[ (c3+b3)*9, (c2+b2)*9 ]\n      MMXar( movq,       q-s3,mm2);\n      MMXar( movq,       q+s3,mm4);\n      MMXrr( movq,       mm2,mm3);\n      MMXrr( punpcklwd,  mm4,mm2);  // MM2=[ d1, a1, d0, a0 ]\n      MMXrr( punpckhwd,  mm4,mm3);  // MM3=[ d3, a3, d2, a2 ]\n      MMXar( pmaddwd,    w1,mm2);   // MM2=[ (a1+d1)*1, (a0+d0)*1 ]\n      MMXar( pmaddwd,    w1,mm3);   // MM3=[ (a3+d3)*1, (a2+d2)*1 ]\n      MMXar( paddd,      d8,mm0);\n      MMXar( paddd,      d8,mm1);\n      MMXrr( psubd,      mm2,mm0);  // MM0=[ (c1+b1)*9-a1-d1+8, ...\n      MMXrr( psubd,      mm3,mm1);  // MM1=[ (c3+b3)*9-a3-d3+8, ...\n      MMXir( psrad,      4,mm0);\n      MMXar( movq,       q,mm7);    // MM7=[ p3,p2,p1,p0 ]\n      MMXir( psrad,      4,mm1);\n      MMXrr( packssdw,   mm1,mm0);  // MM0=[ x3,x2,x1,x0 ]\n      MMXrr( psubw,      mm0,mm7);  // MM7=[ p3-x3, p2-x2, ... ]\n      MMXra( movq,       mm7,q);\n#if defined(_MSC_VER) && defined(_DEBUG)\n      MMXemms;\n#endif\n      q += 4;\n    }\n}\n\nstatic inline void\nmmx_fv_2 ( short* &q, short* e, int s, int s3 )\n{\n  while (q<e && (((long)q)&0x7))\n    {\n      int a = (int)q[-s] + (int)q[s];\n      int b = (int)q[-s3] + (int)q[s3];\n      *q += (((a<<3)+a-b+16)>>5);\n      q ++;\n    }\n  while (q+3<e)\n    {\n      MMXar( movq,       q-s,mm0);  // MM0=[ b3, b2, b1, b0 ]\n      MMXar( movq,       q+s,mm2);  // MM2=[ c3, c2, c1, c0 ]\n      MMXrr( movq,       mm0,mm1);  \n      MMXrr( punpcklwd,  mm2,mm0);  // MM0=[ c1, b1, c0, b0 ]\n      MMXrr( punpckhwd,  mm2,mm1);  // MM1=[ c3, b3, c2, b2 ]\n      MMXar( pmaddwd,    w9,mm0);   // MM0=[ (c1+b1)*9, (c0+b0)*9 ]\n      MMXar( pmaddwd,    w9,mm1);   // MM1=[ (c3+b3)*9, (c2+b2)*9 ]\n      MMXar( movq,       q-s3,mm2);\n      MMXar( movq,       q+s3,mm4);\n      MMXrr( movq,       mm2,mm3);\n      MMXrr( punpcklwd,  mm4,mm2);  // MM2=[ d1, a1, d0, a0 ]\n      MMXrr( punpckhwd,  mm4,mm3);  // MM3=[ d3, a3, d2, a2 ]\n      MMXar( pmaddwd,    w1,mm2);   // MM2=[ (a1+d1)*1, (a0+d0)*1 ]\n      MMXar( pmaddwd,    w1,mm3);   // MM3=[ (a3+d3)*1, (a2+d2)*1 ]\n      MMXar( paddd,      d16,mm0);\n      MMXar( paddd,      d16,mm1);\n      MMXrr( psubd,      mm2,mm0);  // MM0=[ (c1+b1)*9-a1-d1+8, ...\n      MMXrr( psubd,      mm3,mm1);  // MM1=[ (c3+b3)*9-a3-d3+8, ...\n      MMXir( psrad,      5,mm0);\n      MMXar( movq,       q,mm7);    // MM7=[ p3,p2,p1,p0 ]\n      MMXir( psrad,      5,mm1);\n      MMXrr( packssdw,   mm1,mm0);  // MM0=[ x3,x2,x1,x0 ]\n      MMXrr( paddw,      mm0,mm7);  // MM7=[ p3+x3, p2+x2, ... ]\n      MMXra( movq,       mm7,q);\n#if defined(_MSC_VER) && defined(_DEBUG)\n      MMXemms;\n#endif\n      q += 4;\n    }\n}\n\n#endif /* MMX */\n\n//////////////////////////////////////////////////////\n// NEW FILTERS\n//////////////////////////////////////////////////////\n\nstatic void \nfilter_fv(short *p, int w, int h, int rowsize, int scale)\n{\n  int y = 0;\n  int s = scale*rowsize;\n  int s3 = s+s+s;\n  h = ((h-1)/scale)+1;\n  y += 1;\n  p += s;\n  while (y-3 < h)\n    {\n      // 1-Delta\n      {\n        short *q = p;\n        short *e = q+w;\n        if (y>=3 && y+3<h)\n          {\n            // Generic case\n#ifdef MMX\n            if (scale==1 && MMXControl::mmxflag>0)\n              mmx_fv_1(q, e, s, s3);\n#endif\n            while (q<e)\n              {\n                int a = (int)q[-s] + (int)q[s];\n                int b = (int)q[-s3] + (int)q[s3];\n                *q -= (((a<<3)+a-b+8)>>4);\n                q += scale;\n              }\n          }\n        else if (y<h)\n          {\n            // Special cases\n            short *q1 = (y+1<h ? q+s : q-s);\n            while (q<e)\n              {\n                int a = (int)q[-s] + (int)(*q1);\n                *q -= ((a+1)>>1);\n                q += scale;\n                q1 += scale;\n              }\n          }\n      }\n      // 2-Update\n      {\n        short *q = p-s3;\n        short *e = q+w;\n        if (y>=6 && y<h)\n          {\n            // Generic case\n#ifdef MMX\n            if (scale==1 && MMXControl::mmxflag>0)\n              mmx_fv_2(q, e, s, s3);\n#endif\n            while (q<e)\n              {\n                int a = (int)q[-s] + (int)q[s];\n                int b = (int)q[-s3] + (int)q[s3];\n                *q += (((a<<3)+a-b+16)>>5);\n                q += scale;\n              }\n          }\n        else if (y>=3)\n          {\n            // Special cases\n            short *q1 = (y-2<h ? q+s : 0);\n            short *q3 = (y<h ? q+s3 : 0);\n            if (y>=6)\n              {\n                while (q<e)\n                  {\n                    int a = (int)q[-s] + (q1 ? (int)(*q1) : 0);\n                    int b = (int)q[-s3] + (q3 ? (int)(*q3) : 0);\n                    *q += (((a<<3)+a-b+16)>>5);\n                    q += scale;\n                    if (q1) q1 += scale;\n                    if (q3) q3 += scale;\n                  }\n              }\n            else if (y>=4)\n              {\n                while (q<e)\n                  {\n                    int a = (int)q[-s] + (q1 ? (int)(*q1) : 0);\n                    int b = (q3 ? (int)(*q3) : 0);\n                    *q += (((a<<3)+a-b+16)>>5);\n                    q += scale;\n                    if (q1) q1 += scale;\n                    if (q3) q3 += scale;\n                  }\n              }\n            else\n              {\n                while (q<e)\n                  {\n                    int a = (q1 ? (int)(*q1) : 0);\n                    int b = (q3 ? (int)(*q3) : 0);\n                    *q += (((a<<3)+a-b+16)>>5);\n                    q += scale;\n                    if (q1) q1 += scale;\n                    if (q3) q3 += scale;\n                  }\n              }\n          }\n      }\n      y += 2;\n      p += s+s;\n    }\n}\n\nstatic void \nfilter_fh(short *p, int w, int h, int rowsize, int scale)\n{\n  int y = 0;\n  int s = scale;\n  int s3 = s+s+s;\n  rowsize *= scale;\n  while (y<h)\n    {\n      short *q = p+s;\n      short *e = p+w;\n      int a0=0, a1=0, a2=0, a3=0;\n      int b0=0, b1=0, b2=0, b3=0;\n      if (q < e)\n        {\n          // Special case: x=1\n          a1 = a2 = a3 = q[-s];\n          if (q+s<e)\n            a2 = q[s];\n          if (q+s3<e)\n            a3 = q[s3];\n          b3 = q[0] - ((a1+a2+1)>>1);\n          q[0] = b3;\n          q += s+s;\n        }\n      while (q+s3 < e)\n        {\n          // Generic case\n          a0=a1; \n          a1=a2; \n          a2=a3;\n          a3=q[s3];\n          b0=b1; \n          b1=b2; \n          b2=b3;\n          b3 = q[0] - ((((a1+a2)<<3)+(a1+a2)-a0-a3+8) >> 4);\n          q[0] = b3;\n          q[-s3] = q[-s3] + ((((b1+b2)<<3)+(b1+b2)-b0-b3+16) >> 5);\n          q += s+s;\n        }\n      while (q < e)\n        {\n          // Special case: w-3 <= x < w\n          a1=a2; \n          a2=a3;\n          b0=b1; \n          b1=b2; \n          b2=b3;\n          b3 = q[0] - ((a1+a2+1)>>1);\n          q[0] = b3;\n          q[-s3] = q[-s3] + ((((b1+b2)<<3)+(b1+b2)-b0-b3+16) >> 5);\n          q += s+s;\n        }\n      while (q-s3 < e)\n        {\n          // Special case  w <= x < w+3\n          b0=b1; \n          b1=b2; \n          b2=b3;\n          b3=0;\n          if (q-s3 >= p)\n            q[-s3] = q[-s3] + ((((b1+b2)<<3)+(b1+b2)-b0-b3+16) >> 5);\n          q += s+s;\n        }\n      y += scale;\n      p += rowsize;\n    }\n}\n\n\n//////////////////////////////////////////////////////\n// WAVELET TRANSFORM \n//////////////////////////////////////////////////////\n\n\n//----------------------------------------------------\n// Function for applying bidimensional IW44 between \n// scale intervals begin(inclusive) and end(exclusive)\n\nvoid\nIW44Image::Transform::Encode::forward(short *p, int w, int h, int rowsize, int begin, int end)\n{ \n\n  // PREPARATION\n  filter_begin(w,h);\n  // LOOP ON SCALES\n  for (int scale=begin; scale<end; scale<<=1)\n    {\n#ifdef IWTRANSFORM_TIMER\n      int tv,th;\n      th = tv = GOS::ticks();\n#endif\n      filter_fh(p, w, h, rowsize, scale);\n#ifdef IWTRANSFORM_TIMER\n      th = GOS::ticks();\n      tv = th - tv;\n#endif\n      filter_fv(p, w, h, rowsize, scale);\n#ifdef IWTRANSFORM_TIMER\n      th = GOS::ticks()-th;\n      DjVuPrintErrorUTF8(\"forw%d\\tv=%dms h=%dms\\n\", scale,th,tv);\n#endif\n    }\n  // TERMINATE\n  filter_end();\n}\n\n//////////////////////////////////////////////////////\n// COLOR TRANSFORM \n//////////////////////////////////////////////////////\n\nstatic const float \nrgb_to_ycc[3][3] = \n{ { 0.304348F,  0.608696F,  0.086956F },      \n  { 0.463768F, -0.405797F, -0.057971F },\n  {-0.173913F, -0.347826F,  0.521739F } };\n\n\n/* Extracts Y */\nvoid \nIW44Image::Transform::Encode::RGB_to_Y(const GPixel *p, int w, int h, int rowsize, \n                      signed char *out, int outrowsize)\n{\n  int rmul[256], gmul[256], bmul[256];\n  for (int k=0; k<256; k++)\n    {\n      rmul[k] = (int)(k*0x10000*rgb_to_ycc[0][0]);\n      gmul[k] = (int)(k*0x10000*rgb_to_ycc[0][1]);\n      bmul[k] = (int)(k*0x10000*rgb_to_ycc[0][2]);\n    }\n  for (int i=0; i<h; i++, p+=rowsize, out+=outrowsize)\n    {\n      const GPixel *p2 = p;\n      signed char *out2 = out;\n      for (int j=0; j<w; j++,p2++,out2++)\n        {\n          int y = rmul[p2->r] + gmul[p2->g] + bmul[p2->b] + 32768;\n          *out2 = (y>>16) - 128;\n        }\n    }\n}\n\n#ifdef min\n#undef min\n#endif\nstatic inline int min(const int x,const int y) {return (x<y)?x:y;}\n#ifdef max\n#undef max\n#endif\nstatic inline int max(const int x,const int y) {return (x>y)?x:y;}\n\n/* Extracts Cb */\nvoid \nIW44Image::Transform::Encode::RGB_to_Cb(const GPixel *p, int w, int h, int rowsize, \n                       signed char *out, int outrowsize)\n{\n  int rmul[256], gmul[256], bmul[256];\n  for (int k=0; k<256; k++)\n    {\n      rmul[k] = (int)(k*0x10000*rgb_to_ycc[2][0]);\n      gmul[k] = (int)(k*0x10000*rgb_to_ycc[2][1]);\n      bmul[k] = (int)(k*0x10000*rgb_to_ycc[2][2]);\n    }\n  for (int i=0; i<h; i++, p+=rowsize, out+=outrowsize)\n    {\n      const GPixel *p2 = p;\n      signed char *out2 = out;\n      for (int j=0; j<w; j++,p2++,out2++)\n        {\n          int c = rmul[p2->r] + gmul[p2->g] + bmul[p2->b] + 32768;\n          *out2 = max(-128, min(127, c>>16));\n        }\n    }\n}\n\n/* Extracts Cr */\nvoid \nIW44Image::Transform::Encode::RGB_to_Cr(const GPixel *p, int w, int h, int rowsize, \n                       signed char *out, int outrowsize)\n{\n  int rmul[256], gmul[256], bmul[256];\n  for (int k=0; k<256; k++)\n    {\n      rmul[k] = (int)((k*0x10000)*rgb_to_ycc[1][0]);\n      gmul[k] = (int)((k*0x10000)*rgb_to_ycc[1][1]);\n      bmul[k] = (int)((k*0x10000)*rgb_to_ycc[1][2]);\n    }\n  for (int i=0; i<h; i++, p+=rowsize, out+=outrowsize)\n    {\n      const GPixel *p2 = p;\n      signed char *out2 = out;\n      for (int j=0; j<w; j++,p2++,out2++)\n        {\n          int c = rmul[p2->r] + gmul[p2->g] + bmul[p2->b] + 32768;\n          *out2 = max(-128, min(127, c>>16));\n        }\n    }\n}\n\n\n//////////////////////////////////////////////////////\n// MASKING DECOMPOSITION\n//////////////////////////////////////////////////////\n\n//----------------------------------------------------\n// Function for applying bidimensional IW44 between \n// scale intervals begin(inclusive) and end(exclusive)\n// with a MASK bitmap\n\n\nstatic void\ninterpolate_mask(short *data16, int w, int h, int rowsize,\n                 const signed char *mask8, int mskrowsize)\n{\n  int i,j;\n  // count masked bits\n  short *count;\n  GPBuffer<short> gcount(count,w*h);\n  short *cp = count;\n  for (i=0; i<h; i++, cp+=w, mask8+=mskrowsize)\n    for (j=0; j<w; j++)\n      cp[j] = (mask8[j] ? 0 : 0x1000);\n  // copy image\n  short *sdata;\n  GPBuffer<short> gsdata(sdata,w*h);\n  short *p = sdata;\n  short *q = data16;\n  for (i=0; i<h; i++, p+=w, q+=rowsize)\n    for (j=0; j<w; j++)\n      p[j] = q[j];\n  // iterate over resolutions\n  int split = 1;\n  int scale = 2;\n  int again = 1;\n  while (again && scale<w && scale<h)\n    {\n      again = 0;\n      p = data16;\n      q = sdata;\n      cp = count;\n      // iterate over block\n      for (i=0; i<h; i+=scale, cp+=w*scale, q+=w*scale, p+=rowsize*scale)\n        for (j=0; j<w; j+=scale)\n          {\n            int ii, jj;\n            int gotz = 0;\n            int gray = 0;\n            int npix = 0;\n            short *cpp = cp;\n            short *qq = q;\n            // look around when square goes beyond border\n            int istart = i;\n            if (istart+split>h)\n              {\n                istart -= scale;\n                cpp -= w*scale;\n                qq -= w*scale;\n              }\n            int jstart = j;\n            if (jstart+split>w)\n              jstart -= scale;\n            // compute gray level\n            for (ii=istart; ii<i+scale && ii<h; ii+=split, cpp+=w*split, qq+=w*split)\n              for (jj=jstart; jj<j+scale && jj<w; jj+=split)\n                {\n                  if (cpp[jj]>0) \n                    {\n                      npix += cpp[jj];\n                      gray += cpp[jj] * qq[jj];\n                    } \n                  else if (ii>=i && jj>=j)\n                    {\n                      gotz = 1;\n                    }\n                }\n            // process result\n            if (npix == 0)\n              {\n                // continue to next resolution\n                again = 1;\n                cp[j] = 0;\n              }\n            else\n              {\n                gray = gray / npix;\n                // check whether initial image require fix\n                if (gotz)\n                  {\n                    cpp = cp;\n                    qq = p;\n                    for (ii=i; ii<i+scale && ii<h; ii+=1, cpp+=w, qq+=rowsize)\n                      for (jj=j; jj<j+scale && jj<w; jj+=1)\n                        if (cpp[jj] == 0)\n                          {\n                            qq[jj] = gray;\n                            cpp[jj] = 1;\n                          }\n                  }\n                // store average for next iteration\n                cp[j] = npix>>2;\n                q[j] = gray;\n              }\n          }\n      // double resolution\n      split = scale;\n      scale = scale+scale;\n    }\n}\n\n\nstatic void\nforward_mask(short *data16, int w, int h, int rowsize, int begin, int end,\n             const signed char *mask8, int mskrowsize )\n{\n  int i,j;\n  signed char *m;\n  short *p;\n  short *d;\n  // Allocate buffers\n  short *sdata;\n  GPBuffer<short> gsdata(sdata,w*h);\n  signed char *smask;\n  GPBuffer<signed char> gsmask(smask,w*h);\n  // Copy mask\n  m = smask;\n  for (i=0; i<h; i+=1, m+=w, mask8+=mskrowsize)\n    memcpy((void*)m, (void*)mask8, w);\n  // Loop over scale\n  for (int scale=begin; scale<end; scale<<=1)\n    {\n      // Copy data into sdata buffer\n      p = data16;\n      d = sdata;\n      for (i=0; i<h; i+=scale)\n        {\n          for (j=0; j<w; j+=scale)\n            d[j] = p[j];\n          p += rowsize * scale;\n          d += w * scale;\n        }\n      // Decompose\n      IW44Image::Transform::Encode::forward(sdata, w, h, w, scale, scale+scale);\n      // Cancel masked coefficients\n      d = sdata;\n      m = smask;\n      for (i=0; i<h; i+=scale+scale)\n        {\n          for (j=scale; j<w; j+=scale+scale)\n            if (m[j])\n              d[j] = 0;\n          d += w * scale;\n          m += w * scale;\n          if (i+scale < h)\n            {\n              for (j=0; j<w; j+=scale)\n                if (m[j])\n                  d[j] = 0;\n              d += w * scale;\n              m += w * scale;\n            }\n        }\n      // Reconstruct\n      IW44Image::Transform::Decode::backward(sdata, w, h, w, scale+scale, scale);\n      // Correct visible pixels\n      p = data16;\n      d = sdata;\n      m = smask;\n      for (i=0; i<h; i+=scale)\n        {\n          for (j=0; j<w; j+=scale)\n            if (! m[j])\n              d[j] = p[j];\n          p += rowsize*scale;\n          m += w*scale;\n          d += w*scale;\n        }\n      // Decompose again (no need to iterate actually!)\n      IW44Image::Transform::Encode::forward(sdata, w, h, w, scale, scale+scale);\n      // Copy coefficients from sdata buffer\n      p = data16;\n      d = sdata;\n      for (i=0; i<h; i+=scale)\n        {\n          for (j=0; j<w; j+=scale)\n            p[j] = d[j];\n          p += rowsize * scale;\n          d += w * scale;\n        }\n      // Compute new mask for next scale\n      m = smask;\n      signed char *m0 = m;\n      signed char *m1 = m;\n      for (i=0; i<h; i+=scale+scale)\n        {\n          m0 = m1;\n          if (i+scale < h)\n            m1 = m + w*scale;\n          for (j=0; j<w; j+=scale+scale)\n            if (m[j] && m0[j] && m1[j] && (j<=0 || m[j-scale]) && (j+scale>=w || m[j+scale]))\n              m[j] = 1;\n            else\n              m[j] = 0;\n          m = m1 + w*scale;\n        }\n    }\n  // Free buffers\n}\n\nvoid \nIW44Image::Map::Encode::create(const signed char *img8, int imgrowsize, \n               const signed char *msk8, int mskrowsize )\n{\n  int i, j;\n  // Progress\n  DJVU_PROGRESS_TASK(transf,\"create iw44 map\",3);\n  // Allocate decomposition buffer\n  short *data16;\n  GPBuffer<short> gdata16(data16,bw*bh);\n  // Copy pixels\n  short *p = data16;\n  const signed char *row = img8;\n  for (i=0; i<ih; i++)\n    {\n      for (j=0; j<iw; j++)\n        *p++ = (int)(row[j]) << iw_shift;\n      row += imgrowsize;\n      for (j=iw; j<bw; j++)\n        *p++ = 0;\n    }\n  for (i=ih; i<bh; i++)\n    for (j=0; j<bw; j++)\n      *p++ = 0;\n  // Handle bitmask\n  if (msk8)\n    {\n      // Interpolate pixels below mask\n      DJVU_PROGRESS_RUN(transf, 1);\n      interpolate_mask(data16, iw, ih, bw, msk8, mskrowsize);\n      // Multiscale iterative masked decomposition\n      DJVU_PROGRESS_RUN(transf, 3);\n      forward_mask(data16, iw, ih, bw, 1, 32, msk8, mskrowsize);\n    }\n  else\n    {\n      // Perform traditional decomposition\n      DJVU_PROGRESS_RUN(transf, 3);\n      IW44Image::Transform::Encode::forward(data16, iw, ih, bw, 1, 32);\n    }\n  // Copy coefficient into blocks\n  p = data16;\n  IW44Image::Block *block = blocks;\n  for (i=0; i<bh; i+=32)\n    {\n      for (j=0; j<bw; j+=32)\n        {\n          short liftblock[1024];\n          // transfer coefficients at (p+j) into aligned block\n          short *pp = p + j;\n          short *pl = liftblock;\n          for (int ii=0; ii<32; ii++, pp+=bw)\n            for (int jj=0; jj<32; jj++) \n              *pl++ = pp[jj];\n          // transfer into IW44Image::Block (apply zigzag and scaling)\n          block->read_liftblock(liftblock, this);\n          block++;\n        }\n      // next row of blocks\n      p += 32*bw;\n    }\n}\n\nvoid \nIW44Image::Map::Encode::slashres(int res)\n{\n  int minbucket = 1;\n  if (res < 2)\n    return;\n  else if (res < 4)\n    minbucket=16;\n  else if (res < 8)\n    minbucket=4;\n  for (int blockno=0; blockno<nb; blockno++)\n    for (int buckno=minbucket; buckno<64; buckno++)\n      blocks[blockno].zero(buckno);\n}\n\n// encode_prepare\n// -- compute the states prior to encoding the buckets\nint\nIW44Image::Codec::Encode::encode_prepare(int band, int fbucket, int nbucket, IW44Image::Block &blk, IW44Image::Block &eblk)\n{\n  int bbstate = 0;\n  // compute state of all coefficients in all buckets\n  if (band) \n    {\n      // Band other than zero\n      int thres = quant_hi[band];\n      char *cstate = coeffstate;\n      for (int buckno=0; buckno<nbucket; buckno++, cstate+=16)\n        {\n          const short *pcoeff = blk.data(fbucket+buckno);\n          const short *epcoeff = eblk.data(fbucket+buckno);\n          int bstatetmp = 0;\n          if (! pcoeff)\n            {\n              bstatetmp = UNK;\n              // cstate[i] is not used and does not need initialization\n            }\n          else if (! epcoeff)\n            {\n              for (int i=0; i<16; i++)\n                {\n                  int cstatetmp = UNK;\n                  if  ((int)(pcoeff[i])>=thres || (int)(pcoeff[i])<=-thres)\n                    cstatetmp = NEW|UNK;\n                  cstate[i] = cstatetmp;\n                  bstatetmp |= cstatetmp;\n                }\n            }\n          else\n            {\n              for (int i=0; i<16; i++)\n                {\n                  int cstatetmp = UNK;\n                  if (epcoeff[i])\n                    cstatetmp = ACTIVE;\n                  else if  ((int)(pcoeff[i])>=thres || (int)(pcoeff[i])<=-thres)\n                    cstatetmp = NEW|UNK;\n                  cstate[i] = cstatetmp;\n                  bstatetmp |= cstatetmp;\n                }\n            }\n          bucketstate[buckno] = bstatetmp;\n          bbstate |= bstatetmp;\n        }\n    }\n  else\n    {\n      // Band zero ( fbucket==0 implies band==zero and nbucket==1 )\n      const short *pcoeff = blk.data(0, &map);\n      const short *epcoeff = eblk.data(0, &emap);\n      char *cstate = coeffstate;\n      for (int i=0; i<16; i++)\n        {\n          int thres = quant_lo[i];\n          int cstatetmp = cstate[i];\n          if (cstatetmp != ZERO)\n            {\n              cstatetmp = UNK;\n              if (epcoeff[i])\n                cstatetmp = ACTIVE;\n              else if ((int)(pcoeff[i])>=thres || (int)(pcoeff[i])<=-thres)\n                cstatetmp = NEW|UNK;\n            }\n          cstate[i] = cstatetmp;\n          bbstate |= cstatetmp;\n        }\n      bucketstate[0] = bbstate;\n    }\n  return bbstate;\n}\n\n// encode_buckets\n// -- code a sequence of buckets in a given block\nvoid\nIW44Image::Codec::Encode::encode_buckets(ZPCodec &zp, int bit, int band, \n                         IW44Image::Block &blk, IW44Image::Block &eblk,\n                         int fbucket, int nbucket)\n{\n  // compute state of all coefficients in all buckets\n  int bbstate = encode_prepare(band, fbucket, nbucket, blk, eblk);\n\n  // code root bit\n  if ((nbucket<16) || (bbstate&ACTIVE))\n    {\n      bbstate |= NEW;\n    }\n  else if (bbstate & UNK)\n    {\n      zp.encoder( (bbstate&NEW) ? 1 : 0 , ctxRoot);\n#ifdef TRACE\n      DjVuPrintMessage(\"bbstate[bit=%d,band=%d] = %d\\n\", bit, band, bbstate);\n#endif\n    }\n  \n  // code bucket bits\n  if (bbstate & NEW)\n    for (int buckno=0; buckno<nbucket; buckno++)\n      {\n        // Code bucket bit\n        if (bucketstate[buckno] & UNK)\n          {\n            // Context\n            int ctx = 0;\n#ifndef NOCTX_BUCKET_UPPER\n            if (band>0)\n              {\n                int k = (fbucket+buckno)<<2;\n                const short *b = eblk.data(k>>4);\n                if (b)\n                  {\n                    k = k & 0xf;\n                    if (b[k])\n                      ctx += 1;\n                    if (b[k+1])\n                      ctx += 1;\n                    if (b[k+2])\n                      ctx += 1;\n                    if (ctx<3 && b[k+3])\n                      ctx += 1;\n                  }\n              }\n#endif\n#ifndef NOCTX_BUCKET_ACTIVE\n            if (bbstate & ACTIVE)\n              ctx |= 4; \n#endif\n            // Code\n            zp.encoder( (bucketstate[buckno]&NEW) ? 1 : 0, ctxBucket[band][ctx] );\n#ifdef TRACE\n            DjVuPrintMessage(\"  bucketstate[bit=%d,band=%d,buck=%d] = %d\\n\", \n                   bit, band, buckno, bucketstate[buckno] & ~ZERO);\n#endif\n          }\n      }\n  \n  // code new active coefficient (with their sign)\n  if (bbstate & NEW)\n    {\n      int thres = quant_hi[band];\n      char *cstate = coeffstate;\n      for (int buckno=0; buckno<nbucket; buckno++, cstate+=16)\n        if (bucketstate[buckno] & NEW)\n          {\n            int i;\n#ifndef NOCTX_EXPECT\n            int gotcha = 0;\n            const int maxgotcha = 7;\n            for (i=0; i<16; i++)\n              if (cstate[i] & UNK)\n                gotcha += 1;\n#endif\n            const short *pcoeff = blk.data(fbucket+buckno);\n            short *epcoeff = eblk.data(fbucket+buckno, &emap);\n            // iterate within bucket\n            for (i=0; i<16; i++)\n              {\n                if (cstate[i] & UNK)\n                  {\n                    // Prepare context\n                    int ctx = 0;\n#ifndef NOCTX_EXPECT\n                    if (gotcha>=maxgotcha)\n                      ctx = maxgotcha;\n                    else\n                      ctx = gotcha;\n#endif\n#ifndef NOCTX_ACTIVE\n                    if (bucketstate[buckno] & ACTIVE)\n                      ctx |= 8;\n#endif\n                    // Code\n                    zp.encoder( (cstate[i]&NEW) ? 1 : 0, ctxStart[ctx] );\n                    if (cstate[i] & NEW)\n                      {\n                        // Code sign\n                        zp.IWencoder( (pcoeff[i]<0) ? 1 : 0 );\n                        // Set encoder state\n                        if (band==0)\n                          thres = quant_lo[i];\n                        epcoeff[i] = thres + (thres>>1);\n                      }\n#ifndef NOCTX_EXPECT\n                    if (cstate[i] & NEW)\n                      gotcha = 0;\n                    else if (gotcha > 0)\n                      gotcha -= 1;\n#endif\n#ifdef TRACE\n                    DjVuPrintMessage(\"    coeffstate[bit=%d,band=%d,buck=%d,c=%d] = %d\\n\", \n                           bit, band, buckno, i, cstate[i]);\n#endif\n                  }\n              }\n          }\n    }\n\n  // code mantissa bits\n  if (bbstate & ACTIVE)\n    {\n      int thres = quant_hi[band];\n      char *cstate = coeffstate;\n      for (int buckno=0; buckno<nbucket; buckno++, cstate+=16)\n        if (bucketstate[buckno] & ACTIVE)\n          {\n            const short *pcoeff = blk.data(fbucket+buckno);\n            short *epcoeff = eblk.data(fbucket+buckno, &emap);\n            for (int i=0; i<16; i++)\n              if (cstate[i] & ACTIVE)\n                {\n                  // get coefficient\n                  int coeff = pcoeff[i];\n                  int ecoeff = epcoeff[i];\n                  if (coeff < 0)\n                    coeff = -coeff;\n                  // get band zero thresholds\n                  if (band == 0)\n                    thres = quant_lo[i];\n                  // compute mantissa bit\n                  int pix = 0;\n                  if (coeff >= ecoeff)\n                    pix = 1;\n                  // encode second or lesser mantissa bit\n                  if (ecoeff <= 3*thres)\n                    zp.encoder(pix, ctxMant);                      \n                  else\n\t\t\t\t\t  zp.IWencoder(!!pix);\n                  // adjust epcoeff\n                  epcoeff[i] = ecoeff - (pix ? 0 : thres) + (thres>>1);\n                }\n          }\n    }\n}\n\n// IW44Image::Codec::estimate_decibel\n// -- estimate encoding error (after code_slice) in decibels.\nfloat\nIW44Image::Codec::Encode::estimate_decibel(float frac)\n{\n  int i,j;\n  const float *q;\n  // Fill norm arrays\n  float norm_lo[16];\n  float norm_hi[10];\n  // -- lo coefficients\n  q = iw_norm;\n  for (i=j=0; i<4; j++)\n    norm_lo[i++] = *q++;\n  for (j=0; j<4; j++)\n    norm_lo[i++] = *q;\n  q += 1;\n  for (j=0; j<4; j++)\n    norm_lo[i++] = *q;\n  q += 1;\n  for (j=0; j<4; j++)\n    norm_lo[i++] = *q;\n  q += 1;\n  // -- hi coefficients\n  norm_hi[0] = 0;\n  for (j=1; j<10; j++)\n    norm_hi[j] = *q++;\n  // Initialize mse array\n  float *xmse;\n  GPBuffer<float> gxmse(xmse,map.nb);\n  // Compute mse in each block\n  for (int blockno=0; blockno<map.nb; blockno++)\n    {\n      float mse = 0;\n      // Iterate over bands\n      for (int bandno=0; bandno<10; bandno++)\n        {\n          int fbucket = bandbuckets[bandno].start;\n          int nbucket = bandbuckets[bandno].size;\n          IW44Image::Block &blk = map.blocks[blockno];\n          IW44Image::Block &eblk = emap.blocks[blockno];\n          float norm = norm_hi[bandno];\n          for (int buckno=0; buckno<nbucket; buckno++)\n            {\n              const short *pcoeff = blk.data(fbucket+buckno);\n              const short *epcoeff = eblk.data(fbucket+buckno);\n              if (pcoeff)\n                {\n                  if (epcoeff)\n                    {\n                      for (i=0; i<16; i++)\n                        {\n                          if (bandno == 0)\n                            norm = norm_lo[i];\n                          float delta = (float)(pcoeff[i]<0 ? -pcoeff[i] : pcoeff[i]);\n                          delta = delta - epcoeff[i];\n                          mse = mse + norm * delta * delta;\n                        }\n                    }\n                  else\n                    {\n                      for (i=0; i<16; i++)\n                        {\n                          if (bandno == 0)\n                            norm = norm_lo[i];\n                          float delta = (float)(pcoeff[i]);\n                          mse = mse + norm * delta * delta;\n                        }\n                    }\n                }\n            }\n        }\n      xmse[blockno] = mse / 1024;\n    }\n  // Compute partition point\n  int n = 0;\n  int m = map.nb - 1;\n  int p = (int)floor(m*(1.0-frac)+0.5);\n  p = (p>m ? m : (p<0 ? 0 : p));\n  float pivot = 0;\n  // Partition array\n  while (n < p)\n    {\n      int l = n;\n      int h = m;\n      if (xmse[l] > xmse[h]) { float tmp=xmse[l]; xmse[l]=xmse[h]; xmse[h]=tmp; }\n      pivot = xmse[(l+h)/2];\n      if (pivot < xmse[l]) { float tmp=pivot; pivot=xmse[l]; xmse[l]=tmp; }\n      if (pivot > xmse[h]) { float tmp=pivot; pivot=xmse[h]; xmse[h]=tmp; }\n      while (l < h)\n        {\n          if (xmse[l] > xmse[h]) { float tmp=xmse[l]; xmse[l]=xmse[h]; xmse[h]=tmp; }\n          while (xmse[l]<pivot || (xmse[l]==pivot && l<h)) l++;\n          while (xmse[h]>pivot) h--;\n        }\n      if (p>=l) \n        n = l;\n      else \n        m = l-1;\n    }\n  // Compute average mse\n  float mse = 0;\n  for (i=p; i<map.nb; i++)\n    mse = mse + xmse[i];\n  mse = mse / (map.nb - p);\n  // Return\n  float factor = 255 << iw_shift;\n  float decibel = (float)(10.0 * log ( factor * factor / mse ) / 2.302585125);\n  return decibel;\n}\n\n\n\n\n//////////////////////////////////////////////////////\n// IW44IMAGE ENCODING ROUTINES\n//////////////////////////////////////////////////////\n\n\nvoid \nIW44Image::PrimaryHeader::encode(GP<ByteStream> gbs)\n{\n  gbs->write8(serial);\n  gbs->write8(slices);\n}\n\nvoid \nIW44Image::SecondaryHeader::encode(GP<ByteStream> gbs)\n{\n  gbs->write8(major);\n  gbs->write8(minor);\n}\n\nvoid \nIW44Image::TertiaryHeader::encode(GP<ByteStream> gbs)\n{\n  gbs->write8(xhi);\n  gbs->write8(xlo);\n  gbs->write8(yhi);\n  gbs->write8(ylo);\n  gbs->write8(crcbdelay);\n}\n\n\n\nGP<IW44Image>\nIW44Image::create_encode(const ImageType itype)\n{\n  switch(itype)\n  {\n  case COLOR:\n    return new IWPixmap::Encode();\n  case GRAY:\n    return new IWBitmap::Encode();\n  default:\n    return 0;\n  }\n}\n\nGP<IW44Image>\nIW44Image::create_encode(const GBitmap &bm, const GP<GBitmap> mask)\n{\n  IWBitmap::Encode *bit=new IWBitmap::Encode();\n  GP<IW44Image> retval=bit;\n  bit->init(bm, mask);\n  return retval;\n}\n\n\nIWBitmap::Encode::Encode(void)\n: IWBitmap(), ycodec_enc(0)\n{}\n\nIWBitmap::Encode::~Encode()\n{\n  close_codec();\n}\n\nvoid\nIWBitmap::Encode::init(const GBitmap &bm, const GP<GBitmap> gmask)\n{\n  // Free\n  close_codec();\n  delete ymap;\n  ymap = 0;\n  // Init\n  int i, j;\n  int w = bm.columns();\n  int h = bm.rows();\n  int g = bm.get_grays()-1;\n  signed char *buffer;\n  GPBuffer<signed char> gbuffer(buffer,w*h);\n  // Prepare gray level conversion table\n  signed char  bconv[256];\n  for (i=0; i<256; i++)\n    bconv[i] = max(0,min(255,i*255/g)) - 128;\n  // Perform decomposition\n  // Prepare mask information\n  const signed char *msk8 = 0;\n  int mskrowsize = 0;\n  GBitmap *mask=gmask;\n  if (gmask)\n  {\n    msk8 = (const signed char*)((*mask)[0]);\n    mskrowsize = mask->rowsize();\n  }\n  // Prepare a buffer of signed bytes\n  for (i=0; i<h; i++)\n    {\n      signed char *bufrow = buffer + i*w;\n      const unsigned char *bmrow = bm[i];\n      for (j=0; j<w; j++)\n        bufrow[j] = bconv[bmrow[j]];\n    }\n  // Create map\n  Map::Encode *eymap=new Map::Encode(w,h);\n  ymap = eymap;\n  eymap->create(buffer, w, msk8, mskrowsize);\n}\n\nvoid \nIWBitmap::Encode::close_codec(void)\n{\n  delete ycodec_enc;\n  ycodec_enc = 0;\n  IWBitmap::close_codec();\n}\n\nint  \nIWBitmap::Encode::encode_chunk(GP<ByteStream> gbs, const IWEncoderParms &parm)\n{\n  // Check\n  if (parm.slices==0 && parm.bytes==0 && parm.decibels==0)\n    G_THROW( ERR_MSG(\"IW44Image.need_stop\") );\n  if (! ymap)\n    G_THROW( ERR_MSG(\"IW44Image.empty_object\") );\n  // Open codec\n  if (!ycodec_enc)\n  {\n    cslice = cserial = cbytes = 0;\n    ycodec_enc = new Codec::Encode(*ymap);\n  }\n  // Adjust cbytes\n  cbytes += sizeof(struct IW44Image::PrimaryHeader);\n  if (cserial == 0)\n    cbytes += sizeof(struct IW44Image::SecondaryHeader) + sizeof(struct IW44Image::TertiaryHeader);\n  // Prepare zcoded slices\n  int flag = 1;\n  int nslices = 0;\n  GP<ByteStream> gmbs=ByteStream::create();\n  ByteStream &mbs=*gmbs;\n  DJVU_PROGRESS_TASK(chunk,\"encode chunk\",parm.slices-cslice);\n  {\n    float estdb = -1.0;\n    GP<ZPCodec> gzp=ZPCodec::create(gmbs, true, true);\n    ZPCodec &zp=*gzp;\n    while (flag)\n      {\n        if (parm.decibels>0  && estdb>=parm.decibels)\n          break;\n        if (parm.bytes>0  && mbs.tell()+cbytes>=parm.bytes)\n          break;\n        if (parm.slices>0 && nslices+cslice>=parm.slices)\n          break;\n        DJVU_PROGRESS_RUN(chunk, (1+nslices-cslice)|0xf);\n        flag = ycodec_enc->code_slice(zp);\n        if (flag && parm.decibels>0.0)\n          if (ycodec_enc->curband==0 || estdb>=parm.decibels-DECIBEL_PRUNE)\n            estdb = ycodec_enc->estimate_decibel(db_frac);\n        nslices++;\n      }\n  }\n  // Write primary header\n  struct IW44Image::PrimaryHeader primary;\n  primary.serial = cserial;\n  primary.slices = nslices;\n  primary.encode(gbs);\n  // Write auxilliary headers\n  if (cserial == 0)\n    {\n      struct IW44Image::SecondaryHeader secondary;\n      secondary.major = IWCODEC_MAJOR + 0x80;\n      secondary.minor = IWCODEC_MINOR;\n      secondary.encode(gbs);\n      struct IW44Image::TertiaryHeader tertiary;\n      tertiary.xhi = (ymap->iw >> 8) & 0xff;\n      tertiary.xlo = (ymap->iw >> 0) & 0xff;\n      tertiary.yhi = (ymap->ih >> 8) & 0xff;\n      tertiary.ylo = (ymap->ih >> 0) & 0xff;\n      tertiary.crcbdelay = 0;\n      tertiary.encode(gbs);\n    }\n  // Write slices\n  mbs.seek(0);\n  gbs->copy(mbs);\n  // Return\n  cbytes  += mbs.tell();\n  cslice  += nslices;\n  cserial += 1;\n  return flag;\n}\n\nvoid \nIWBitmap::Encode::encode_iff(IFFByteStream &iff, int nchunks, const IWEncoderParms *parms)\n{\n  if (ycodec_enc)\n    G_THROW( ERR_MSG(\"IW44Image.left_open1\") );\n  int flag = 1;\n  iff.put_chunk(\"FORM:BM44\", 1);\n  DJVU_PROGRESS_TASK(iff,\"encode iff chunk\",nchunks);\n  for (int i=0; flag && i<nchunks; i++)\n    {\n      DJVU_PROGRESS_RUN(iff,i+1);\n      iff.put_chunk(\"BM44\");\n      flag = encode_chunk(iff.get_bytestream(),parms[i]);\n      iff.close_chunk();\n    }\n  iff.close_chunk();\n  close_codec();\n}\n\nGP<IW44Image>\nIW44Image::create_encode(\n  const GPixmap &pm, const GP<GBitmap> gmask, CRCBMode crcbmode)\n{\n  IWPixmap::Encode *pix=new IWPixmap::Encode();\n  GP<IW44Image> retval=pix;\n  pix->init(pm, gmask,(IWPixmap::Encode::CRCBMode)crcbmode);\n  return retval;\n}\n\nIWPixmap::Encode::Encode(void)\n: IWPixmap(), ycodec_enc(0), cbcodec_enc(0), crcodec_enc(0)\n{}\n\nIWPixmap::Encode::~Encode()\n{\n  close_codec();\n}\n\nvoid\nIWPixmap::Encode::init(const GPixmap &pm, const GP<GBitmap> gmask, CRCBMode crcbmode)\n{\n  /* Free */\n  close_codec();\n  delete ymap;\n  delete cbmap;\n  delete crmap;\n  ymap = cbmap = crmap = 0;\n  /* Create */\n  int w = pm.columns();\n  int h = pm.rows();\n  signed char *buffer;\n  GPBuffer<signed char> gbuffer(buffer,w*h);\n  // Create maps\n  Map::Encode *eymap = new Map::Encode(w,h);\n  ymap = eymap;\n  // Handle CRCB mode\n  switch (crcbmode) \n    {\n    case CRCBnone:   crcb_half=1; crcb_delay=-1; break;\n    case CRCBhalf:   crcb_half=1; crcb_delay=10; break;        \n    case CRCBnormal: crcb_half=0; crcb_delay=10; break;\n    case CRCBfull:   crcb_half=0; crcb_delay= 0; break;\n    }\n  // Prepare mask information\n  const signed char *msk8 = 0;\n  int mskrowsize = 0;\n  GBitmap *mask=gmask;\n  if (mask)\n  {\n    msk8 = (signed char const *)((*mask)[0]);\n    mskrowsize = mask->rowsize();\n  }\n  // Fill buffer with luminance information\n  DJVU_PROGRESS_TASK(create,\"initialize pixmap\",3);\n  DJVU_PROGRESS_RUN(create,(crcb_delay>=0 ? 1 : 3));\n  Transform::Encode::RGB_to_Y(pm[0], w, h, pm.rowsize(), buffer, w);\n  if (crcb_delay < 0)\n    {\n      // Stupid inversion for gray images\n      signed char *e = buffer + w*h;\n      for (signed char *b=buffer; b<e; b++)\n        *b = 255 - *b;\n    }\n  // Create YMAP\n  eymap->create(buffer, w, msk8, mskrowsize);\n  // Create chrominance maps\n  if (crcb_delay >= 0)\n    {\n      Map::Encode *ecbmap = new Map::Encode(w,h);\n      cbmap = ecbmap;\n      Map::Encode *ecrmap = new Map::Encode(w,h);\n      crmap = ecrmap;\n      // Process CB information\n      DJVU_PROGRESS_RUN(create,2);\n      Transform::Encode::RGB_to_Cb(pm[0], w, h, pm.rowsize(), buffer, w);\n      ecbmap->create(buffer, w, msk8, mskrowsize);\n      // Process CR information\n      DJVU_PROGRESS_RUN(create,3);\n      Transform::Encode::RGB_to_Cr(pm[0], w, h, pm.rowsize(), buffer, w); \n      ecrmap->create(buffer, w, msk8, mskrowsize);\n      // Perform chrominance reduction (CRCBhalf)\n      if (crcb_half)\n        {\n          ecbmap->slashres(2);\n          ecrmap->slashres(2);\n        }\n    }\n}\n\nvoid \nIWPixmap::Encode::encode_iff(IFFByteStream &iff, int nchunks, const IWEncoderParms *parms)\n{\n  if (ycodec_enc)\n    G_THROW( ERR_MSG(\"IW44Image.left_open3\") );\n  int flag = 1;\n  iff.put_chunk(\"FORM:PM44\", 1);\n  DJVU_PROGRESS_TASK(iff,\"encode pixmap chunk\", nchunks);\n  for (int i=0; flag && i<nchunks; i++)\n    {\n      DJVU_PROGRESS_RUN(iff,i+1);\n      iff.put_chunk(\"PM44\");\n      flag = encode_chunk(iff.get_bytestream(), parms[i]);\n      iff.close_chunk();\n    }\n  iff.close_chunk();\n  close_codec();\n}\n\nvoid \nIWPixmap::Encode::close_codec(void)\n{\n  delete ycodec_enc;\n  delete cbcodec_enc;\n  delete crcodec_enc;\n  ycodec_enc = crcodec_enc = cbcodec_enc = 0;\n  IWPixmap::close_codec();\n}\n\nint  \nIWPixmap::Encode::encode_chunk(GP<ByteStream> gbs, const IWEncoderParms &parm)\n{\n  // Check\n  if (parm.slices==0 && parm.bytes==0 && parm.decibels==0)\n    G_THROW( ERR_MSG(\"IW44Image.need_stop2\") );\n  if (!ymap)\n    G_THROW( ERR_MSG(\"IW44Image.empty_object2\") );\n  // Open\n  if (!ycodec_enc)\n  {\n    cslice = cserial = cbytes = 0;\n    ycodec_enc = new Codec::Encode(*ymap);\n    if (crmap && cbmap)\n    {\n      cbcodec_enc = new Codec::Encode(*cbmap);\n      crcodec_enc = new Codec::Encode(*crmap);\n    }\n  }\n\n  // Adjust cbytes\n  cbytes += sizeof(struct IW44Image::PrimaryHeader);\n  if (cserial == 0)\n    cbytes += sizeof(struct IW44Image::SecondaryHeader) + sizeof(struct IW44Image::TertiaryHeader);\n  // Prepare zcodec slices\n  int flag = 1;\n  int nslices = 0;\n  GP<ByteStream> gmbs=ByteStream::create();\n  ByteStream &mbs=*gmbs;\n  DJVU_PROGRESS_TASK(chunk, \"encode pixmap chunk\", parm.slices-cslice);\n  {\n    float estdb = -1.0;\n    GP<ZPCodec> gzp=ZPCodec::create(gmbs, true, true);\n    ZPCodec &zp=*gzp;\n    while (flag)\n      {\n        if (parm.decibels>0  && estdb>=parm.decibels)\n          break;\n        if (parm.bytes>0  && mbs.tell()+cbytes>=parm.bytes)\n          break;\n        if (parm.slices>0 && nslices+cslice>=parm.slices)\n          break;\n        DJVU_PROGRESS_RUN(chunk,(1+nslices-cslice)|0xf);\n        flag = ycodec_enc->code_slice(zp);\n        if (flag && parm.decibels>0)\n          if (ycodec_enc->curband==0 || estdb>=parm.decibels-DECIBEL_PRUNE)\n            estdb = ycodec_enc->estimate_decibel(db_frac);\n        if (crcodec_enc && cbcodec_enc && cslice+nslices>=crcb_delay)\n          {\n            flag |= cbcodec_enc->code_slice(zp);\n            flag |= crcodec_enc->code_slice(zp);\n          }\n        nslices++;\n      }\n  }\n  // Write primary header\n  struct IW44Image::PrimaryHeader primary;\n  primary.serial = cserial;\n  primary.slices = nslices;\n  primary.encode(gbs);\n  // Write secondary header\n  if (cserial == 0)\n    {\n      struct IW44Image::SecondaryHeader secondary;\n      secondary.major = IWCODEC_MAJOR;\n      secondary.minor = IWCODEC_MINOR;\n      if (! (crmap && cbmap))\n        secondary.major |= 0x80;\n      secondary.encode(gbs);\n      struct IW44Image::TertiaryHeader tertiary;\n      tertiary.xhi = (ymap->iw >> 8) & 0xff;\n      tertiary.xlo = (ymap->iw >> 0) & 0xff;\n      tertiary.yhi = (ymap->ih >> 8) & 0xff;\n      tertiary.ylo = (ymap->ih >> 0) & 0xff;\n      tertiary.crcbdelay = (crcb_half ? 0x00 : 0x80);\n      tertiary.crcbdelay |= (crcb_delay>=0 ? crcb_delay : 0x00);\n      tertiary.encode(gbs);\n    }\n  // Write slices\n  mbs.seek(0);\n  gbs->copy(mbs);\n  // Return\n  cbytes  += mbs.tell();\n  cslice  += nslices;\n  cserial += 1;\n  return flag;\n}\n\n// code_slice\n// -- read/write a slice of datafile\n\nint\nIW44Image::Codec::Encode::code_slice(ZPCodec &zp)\n{\n  // Check that code_slice can still run\n  if (curbit < 0)\n    return 0;\n  // Perform coding\n  if (! is_null_slice(curbit, curband))\n    {\n      for (int blockno=0; blockno<map.nb; blockno++)\n        {\n          const int fbucket = bandbuckets[curband].start;\n          const int nbucket = bandbuckets[curband].size;\n          encode_buckets(zp, curbit, curband, \n                         map.blocks[blockno], emap.blocks[blockno], \n                         fbucket, nbucket);\n        }\n    }\n  return finish_code_slice(zp);\n}\n\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif // NEED_DECODER_ONLY\n\n"
  },
  {
    "path": "ext/libdjvu/IW44Image.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n// - Author: Leon Bottou, 08/1998\n\n// From: Leon Bottou, 1/31/2002\n// Lizardtech has split this file into a decoder and an encoder.\n// Only superficial changes.  The meat is mine.\n\n#define IW44IMAGE_IMPLIMENTATION /* */\n// -------------------^  not my spelling mistake (Leon Bottou)\n\n#include \"IW44Image.h\"\n#include \"ZPCodec.h\"\n#include \"GBitmap.h\"\n#include \"GPixmap.h\"\n#include \"IFFByteStream.h\"\n#include \"GRect.h\"\n\n#include <stddef.h>\n#include <stdlib.h>\n#include <string.h>\n#include <math.h>\n#include \"MMX.h\"\n#undef IWTRANSFORM_TIMER\n#ifdef IWTRANSFORM_TIMER\n#include \"GOS.h\"\n#endif\n\n#include <assert.h>\n#include <string.h>\n#include <math.h>\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n#define IWALLOCSIZE    4080\n#define IWCODEC_MAJOR     1\n#define IWCODEC_MINOR     2\n#define DECIBEL_PRUNE   5.0\n\n\n//////////////////////////////////////////////////////\n// WAVELET DECOMPOSITION CONSTANTS\n//////////////////////////////////////////////////////\n\n// Parameters for IW44 wavelet.\n// - iw_quant: quantization for all 16 sub-bands\n// - iw_norm: norm of all wavelets (for db estimation)\n// - iw_border: pixel border required to run filters\n// - iw_shift: scale applied before decomposition\n\n\nstatic const int iw_quant[16] = {\n  0x004000, \n  0x008000, 0x008000, 0x010000,\n  0x010000, 0x010000, 0x020000,\n  0x020000, 0x020000, 0x040000,\n  0x040000, 0x040000, 0x080000, \n  0x040000, 0x040000, 0x080000\n};\n\nstatic const float iw_norm[16] = {\n  2.627989e+03F,\n  1.832893e+02F, 1.832959e+02F, 5.114690e+01F,\n  4.583344e+01F, 4.583462e+01F, 1.279225e+01F,\n  1.149671e+01F, 1.149712e+01F, 3.218888e+00F,\n  2.999281e+00F, 2.999476e+00F, 8.733161e-01F,\n  1.074451e+00F, 1.074511e+00F, 4.289318e-01F\n};\n\nstatic const int iw_border = 3;\nstatic const int iw_shift  = 6;\nstatic const int iw_round  = (1<<(iw_shift-1));\n\nclass IW44Image::Codec::Decode : public IW44Image::Codec \n{\npublic:\n  // Construction\n  Decode(IW44Image::Map &map) : Codec(map) {}\n  // Coding\n  virtual int code_slice(ZPCodec &zp);\n};\n\n//////////////////////////////////////////////////////\n// MMX IMPLEMENTATION HELPERS\n//////////////////////////////////////////////////////\n\n\n// Note:\n// MMX implementation for vertical transforms only.\n// Speedup is basically related to faster memory transfer\n// The IW44 transform is not CPU bound, it is memory bound.\n\n#ifdef MMX\n\nstatic const short w9[]  = {9,9,9,9};\nstatic const short w1[]  = {1,1,1,1};\nstatic const int   d8[]  = {8,8};\nstatic const int   d16[] = {16,16};\n\nstatic void\nmmx_bv_1 ( short* &q, short* e, int s, int s3 )\n{\n  while (q<e && (((long)q)&0x7))\n    {\n      int a = (int)q[-s] + (int)q[s];\n      int b = (int)q[-s3] + (int)q[s3];\n      *q -= (((a<<3)+a-b+16)>>5);\n      q ++;\n  }\n  while (q+3 < e)\n    {\n      MMXar( movq,       q-s,mm0);  // MM0=[ b3, b2, b1, b0 ]\n      MMXar( movq,       q+s,mm2);  // MM2=[ c3, c2, c1, c0 ]\n      MMXrr( movq,       mm0,mm1);  \n      MMXrr( punpcklwd,  mm2,mm0);  // MM0=[ c1, b1, c0, b0 ]\n      MMXrr( punpckhwd,  mm2,mm1);  // MM1=[ c3, b3, c2, b2 ]\n      MMXar( pmaddwd,    w9,mm0);   // MM0=[ (c1+b1)*9, (c0+b0)*9 ]\n      MMXar( pmaddwd,    w9,mm1);   // MM1=[ (c3+b3)*9, (c2+b2)*9 ]\n      MMXar( movq,       q-s3,mm2);\n      MMXar( movq,       q+s3,mm4);\n      MMXrr( movq,       mm2,mm3);\n      MMXrr( punpcklwd,  mm4,mm2);  // MM2=[ d1, a1, d0, a0 ]\n      MMXrr( punpckhwd,  mm4,mm3);  // MM3=[ d3, a3, d2, a2 ]\n      MMXar( pmaddwd,    w1,mm2);   // MM2=[ (a1+d1)*1, (a0+d0)*1 ]\n      MMXar( pmaddwd,    w1,mm3);   // MM3=[ (a3+d3)*1, (a2+d2)*1 ]\n      MMXar( paddd,      d16,mm0);\n      MMXar( paddd,      d16,mm1);\n      MMXrr( psubd,      mm2,mm0);  // MM0=[ (c1+b1)*9-a1-d1+8, ...\n      MMXrr( psubd,      mm3,mm1);  // MM1=[ (c3+b3)*9-a3-d3+8, ...\n      MMXir( psrad,      5,mm0);\n      MMXar( movq,       q,mm7);    // MM7=[ p3,p2,p1,p0 ]\n      MMXir( psrad,      5,mm1);\n      MMXrr( packssdw,   mm1,mm0);  // MM0=[ x3,x2,x1,x0 ]\n      MMXrr( psubw,      mm0,mm7);  // MM7=[ p3-x3, p2-x2, ... ]\n      MMXra( movq,       mm7,q);\n#if defined(_MSC_VER) && defined(_DEBUG)\n      MMXemms;\n#endif\n      q += 4;\n    }\n}\n\n\nstatic void\nmmx_bv_2 ( short* &q, short* e, int s, int s3 )\n{\n  while (q<e && (((long)q)&0x7))\n    {\n      int a = (int)q[-s] + (int)q[s];\n      int b = (int)q[-s3] + (int)q[s3];\n      *q += (((a<<3)+a-b+8)>>4);\n      q ++;\n    }\n  while (q+3 < e)\n    {\n      MMXar( movq,       q-s,mm0);  // MM0=[ b3, b2, b1, b0 ]\n      MMXar( movq,       q+s,mm2);  // MM2=[ c3, c2, c1, c0 ]\n      MMXrr( movq,       mm0,mm1);  \n      MMXrr( punpcklwd,  mm2,mm0);  // MM0=[ c1, b1, c0, b0 ]\n      MMXrr( punpckhwd,  mm2,mm1);  // MM1=[ c3, b3, c2, b2 ]\n      MMXar( pmaddwd,    w9,mm0);   // MM0=[ (c1+b1)*9, (c0+b0)*9 ]\n      MMXar( pmaddwd,    w9,mm1);   // MM1=[ (c3+b3)*9, (c2+b2)*9 ]\n      MMXar( movq,       q-s3,mm2);\n      MMXar( movq,       q+s3,mm4);\n      MMXrr( movq,       mm2,mm3);\n      MMXrr( punpcklwd,  mm4,mm2);  // MM2=[ d1, a1, d0, a0 ]\n      MMXrr( punpckhwd,  mm4,mm3);  // MM3=[ d3, a3, d2, a2 ]\n      MMXar( pmaddwd,    w1,mm2);   // MM2=[ (a1+d1)*1, (a0+d0)*1 ]\n      MMXar( pmaddwd,    w1,mm3);   // MM3=[ (a3+d3)*1, (a2+d2)*1 ]\n      MMXar( paddd,      d8,mm0);\n      MMXar( paddd,      d8,mm1);\n      MMXrr( psubd,      mm2,mm0);  // MM0=[ (c1+b1)*9-a1-d1+8, ...\n      MMXrr( psubd,      mm3,mm1);  // MM1=[ (c3+b3)*9-a3-d3+8, ...\n      MMXir( psrad,      4,mm0);\n      MMXar( movq,       q,mm7);    // MM7=[ p3,p2,p1,p0 ]\n      MMXir( psrad,      4,mm1);\n      MMXrr( packssdw,   mm1,mm0);  // MM0=[ x3,x2,x1,x0 ]\n      MMXrr( paddw,      mm0,mm7);  // MM7=[ p3+x3, p2+x2, ... ]\n      MMXra( movq,       mm7,q);\n#if defined(_MSC_VER) && defined(_DEBUG)\n      MMXemms;\n#endif\n      q += 4;\n    }\n}\n#endif /* MMX */\n\nstatic void \nfilter_bv(short *p, int w, int h, int rowsize, int scale)\n{\n  int y = 0;\n  int s = scale*rowsize;\n  int s3 = s+s+s;\n  h = ((h-1)/scale)+1;\n  while (y-3 < h)\n    {\n      // 1-Lifting\n      {\n        short *q = p;\n        short *e = q+w;\n        if (y>=3 && y+3<h)\n          {\n            // Generic case\n#ifdef MMX\n            if (scale==1 && MMXControl::mmxflag>0)\n              mmx_bv_1(q, e, s, s3);\n#endif\n            while (q<e)\n              {\n                int a = (int)q[-s] + (int)q[s];\n                int b = (int)q[-s3] + (int)q[s3];\n                *q -= (((a<<3)+a-b+16)>>5);\n                q += scale;\n              }\n          }\n        else if (y<h)\n          {\n            // Special cases\n            short *q1 = (y+1<h ? q+s : 0);\n            short *q3 = (y+3<h ? q+s3 : 0);\n            if (y>=3)\n              {\n                while (q<e)\n                  {\n                    int a = (int)q[-s] + (q1 ? (int)(*q1) : 0);\n                    int b = (int)q[-s3] + (q3 ? (int)(*q3) : 0);\n                    *q -= (((a<<3)+a-b+16)>>5);\n                    q += scale;\n                    if (q1) q1 += scale;\n                    if (q3) q3 += scale;\n                  }\n              }\n            else if (y>=1)\n              {\n                while (q<e)\n                  {\n                    int a = (int)q[-s] + (q1 ? (int)(*q1) : 0);\n                    int b = (q3 ? (int)(*q3) : 0);\n                    *q -= (((a<<3)+a-b+16)>>5);\n                    q += scale;\n                    if (q1) q1 += scale;\n                    if (q3) q3 += scale;\n                  }\n              }\n            else\n              {\n                while (q<e)\n                  {\n                    int a = (q1 ? (int)(*q1) : 0);\n                    int b = (q3 ? (int)(*q3) : 0);\n                    *q -= (((a<<3)+a-b+16)>>5);\n                    q += scale;\n                    if (q1) q1 += scale;\n                    if (q3) q3 += scale;\n                  }\n              }\n          }\n      }\n      // 2-Interpolation\n      {\n        short *q = p-s3;\n        short *e = q+w;\n        if (y>=6 && y<h)\n          {\n            // Generic case\n#ifdef MMX\n            if (scale==1 && MMXControl::mmxflag>0)\n              mmx_bv_2(q, e, s, s3);\n#endif\n            while (q<e)\n              {\n                int a = (int)q[-s] + (int)q[s];\n                int b = (int)q[-s3] + (int)q[s3];\n                *q += (((a<<3)+a-b+8)>>4);\n                q += scale;\n              }\n          }\n        else if (y>=3)\n          {\n            // Special cases\n            short *q1 = (y-2<h ? q+s : q-s);\n            while (q<e)\n              {\n                int a = (int)q[-s] + (int)(*q1);\n                *q += ((a+1)>>1);\n                q += scale;\n                q1 += scale;\n              }\n          }\n      }\n      y += 2;\n      p += s+s;\n    }\n}\n\nstatic void \nfilter_bh(short *p, int w, int h, int rowsize, int scale)\n{\n  int y = 0;\n  int s = scale;\n  int s3 = s+s+s;\n  rowsize *= scale;\n  while (y<h)\n    {\n      short *q = p;\n      short *e = p+w;\n      int a0=0, a1=0, a2=0, a3=0;\n      int b0=0, b1=0, b2=0, b3=0;\n      if (q<e)\n        {\n          // Special case:  x=0\n          if (q+s < e)\n            a2 = q[s];\n          if (q+s3 < e)\n            a3 = q[s3];\n          b2 = b3 = q[0] - ((((a1+a2)<<3)+(a1+a2)-a0-a3+16) >> 5);\n          q[0] = b3;\n          q += s+s;\n        }\n      if (q<e)\n        {\n          // Special case:  x=2\n          a0 = a1;\n          a1 = a2;\n          a2 = a3;\n          if (q+s3 < e)\n            a3 = q[s3];\n          b3 = q[0] - ((((a1+a2)<<3)+(a1+a2)-a0-a3+16) >> 5);\n          q[0] = b3;\n          q += s+s;\n        }\n      if (q<e)\n        {\n          // Special case:  x=4\n          b1 = b2;\n          b2 = b3;\n          a0 = a1;\n          a1 = a2;\n          a2 = a3;\n          if (q+s3 < e)\n            a3 = q[s3];\n          b3 = q[0] - ((((a1+a2)<<3)+(a1+a2)-a0-a3+16) >> 5);\n          q[0] = b3;\n          q[-s3] = q[-s3] + ((b1+b2+1)>>1);\n          q += s+s;\n        }\n      while (q+s3 < e)\n        {\n          // Generic case\n          a0=a1; \n          a1=a2; \n          a2=a3;\n          a3=q[s3];\n          b0=b1; \n          b1=b2; \n          b2=b3;\n          b3 = q[0] - ((((a1+a2)<<3)+(a1+a2)-a0-a3+16) >> 5);\n          q[0] = b3;\n          q[-s3] = q[-s3] + ((((b1+b2)<<3)+(b1+b2)-b0-b3+8) >> 4);\n          q += s+s;\n        }\n      while (q < e)\n        {\n          // Special case:  w-3 <= x < w\n          a0=a1;\n          a1=a2; \n          a2=a3;\n          a3=0;\n          b0=b1; \n          b1=b2; \n          b2=b3;\n          b3 = q[0] - ((((a1+a2)<<3)+(a1+a2)-a0-a3+16) >> 5);\n          q[0] = b3;\n          q[-s3] = q[-s3] + ((((b1+b2)<<3)+(b1+b2)-b0-b3+8) >> 4);\n          q += s+s;\n        }\n      while (q-s3 < e)\n        {\n          // Special case  w <= x < w+3\n          b0=b1; \n          b1=b2; \n          b2=b3;\n          if (q-s3 >= p)\n            q[-s3] = q[-s3] + ((b1+b2+1)>>1);\n          q += s+s;\n        }\n      y += scale;\n      p += rowsize;\n    }\n}\n\n\n//////////////////////////////////////////////////////\n// REPRESENTATION OF WAVELET DECOMPOSED IMAGES\n//////////////////////////////////////////////////////\n\n\n\n//---------------------------------------------------------------\n// Zig zag location in a 1024 liftblock.\n// These numbers have been generated with the following program:\n//\n// int x=0, y=0;\n// for (int i=0; i<5; i++) {\n//   x = (x<<1) | (n&1);  n >>= 1;\n//   y = (y<<1) | (n&1);  n >>= 1;\n// }\n\n\nstatic int zigzagloc[1024] = {\n   0,  16, 512, 528,   8,  24, 520, 536, 256, 272, 768, 784, 264, 280, 776, 792,\n   4,  20, 516, 532,  12,  28, 524, 540, 260, 276, 772, 788, 268, 284, 780, 796,\n 128, 144, 640, 656, 136, 152, 648, 664, 384, 400, 896, 912, 392, 408, 904, 920,\n 132, 148, 644, 660, 140, 156, 652, 668, 388, 404, 900, 916, 396, 412, 908, 924,\n   2,  18, 514, 530,  10,  26, 522, 538, 258, 274, 770, 786, 266, 282, 778, 794,\n   6,  22, 518, 534,  14,  30, 526, 542, 262, 278, 774, 790, 270, 286, 782, 798,\n 130, 146, 642, 658, 138, 154, 650, 666, 386, 402, 898, 914, 394, 410, 906, 922,\n 134, 150, 646, 662, 142, 158, 654, 670, 390, 406, 902, 918, 398, 414, 910, 926,\n  64,  80, 576, 592,  72,  88, 584, 600, 320, 336, 832, 848, 328, 344, 840, 856,\n  68,  84, 580, 596,  76,  92, 588, 604, 324, 340, 836, 852, 332, 348, 844, 860,\n 192, 208, 704, 720, 200, 216, 712, 728, 448, 464, 960, 976, 456, 472, 968, 984,\n 196, 212, 708, 724, 204, 220, 716, 732, 452, 468, 964, 980, 460, 476, 972, 988,\n  66,  82, 578, 594,  74,  90, 586, 602, 322, 338, 834, 850, 330, 346, 842, 858,\n  70,  86, 582, 598,  78,  94, 590, 606, 326, 342, 838, 854, 334, 350, 846, 862,\n 194, 210, 706, 722, 202, 218, 714, 730, 450, 466, 962, 978, 458, 474, 970, 986,\n 198, 214, 710, 726, 206, 222, 718, 734, 454, 470, 966, 982, 462, 478, 974, 990, // 255\n   1,  17, 513, 529,   9,  25, 521, 537, 257, 273, 769, 785, 265, 281, 777, 793,\n   5,  21, 517, 533,  13,  29, 525, 541, 261, 277, 773, 789, 269, 285, 781, 797,\n 129, 145, 641, 657, 137, 153, 649, 665, 385, 401, 897, 913, 393, 409, 905, 921,\n 133, 149, 645, 661, 141, 157, 653, 669, 389, 405, 901, 917, 397, 413, 909, 925,\n   3,  19, 515, 531,  11,  27, 523, 539, 259, 275, 771, 787, 267, 283, 779, 795,\n   7,  23, 519, 535,  15,  31, 527, 543, 263, 279, 775, 791, 271, 287, 783, 799,\n 131, 147, 643, 659, 139, 155, 651, 667, 387, 403, 899, 915, 395, 411, 907, 923,\n 135, 151, 647, 663, 143, 159, 655, 671, 391, 407, 903, 919, 399, 415, 911, 927,\n  65,  81, 577, 593,  73,  89, 585, 601, 321, 337, 833, 849, 329, 345, 841, 857,\n  69,  85, 581, 597,  77,  93, 589, 605, 325, 341, 837, 853, 333, 349, 845, 861,\n 193, 209, 705, 721, 201, 217, 713, 729, 449, 465, 961, 977, 457, 473, 969, 985,\n 197, 213, 709, 725, 205, 221, 717, 733, 453, 469, 965, 981, 461, 477, 973, 989,\n  67,  83, 579, 595,  75,  91, 587, 603, 323, 339, 835, 851, 331, 347, 843, 859,\n  71,  87, 583, 599,  79,  95, 591, 607, 327, 343, 839, 855, 335, 351, 847, 863,\n 195, 211, 707, 723, 203, 219, 715, 731, 451, 467, 963, 979, 459, 475, 971, 987,\n 199, 215, 711, 727, 207, 223, 719, 735, 455, 471, 967, 983, 463, 479, 975, 991, // 511\n  32,  48, 544, 560,  40,  56, 552, 568, 288, 304, 800, 816, 296, 312, 808, 824,\n  36,  52, 548, 564,  44,  60, 556, 572, 292, 308, 804, 820, 300, 316, 812, 828,\n 160, 176, 672, 688, 168, 184, 680, 696, 416, 432, 928, 944, 424, 440, 936, 952,\n 164, 180, 676, 692, 172, 188, 684, 700, 420, 436, 932, 948, 428, 444, 940, 956,\n  34,  50, 546, 562,  42,  58, 554, 570, 290, 306, 802, 818, 298, 314, 810, 826,\n  38,  54, 550, 566,  46,  62, 558, 574, 294, 310, 806, 822, 302, 318, 814, 830,\n 162, 178, 674, 690, 170, 186, 682, 698, 418, 434, 930, 946, 426, 442, 938, 954,\n 166, 182, 678, 694, 174, 190, 686, 702, 422, 438, 934, 950, 430, 446, 942, 958,\n  96, 112, 608, 624, 104, 120, 616, 632, 352, 368, 864, 880, 360, 376, 872, 888,\n 100, 116, 612, 628, 108, 124, 620, 636, 356, 372, 868, 884, 364, 380, 876, 892,\n 224, 240, 736, 752, 232, 248, 744, 760, 480, 496, 992,1008, 488, 504,1000,1016,\n 228, 244, 740, 756, 236, 252, 748, 764, 484, 500, 996,1012, 492, 508,1004,1020,\n  98, 114, 610, 626, 106, 122, 618, 634, 354, 370, 866, 882, 362, 378, 874, 890,\n 102, 118, 614, 630, 110, 126, 622, 638, 358, 374, 870, 886, 366, 382, 878, 894,\n 226, 242, 738, 754, 234, 250, 746, 762, 482, 498, 994,1010, 490, 506,1002,1018,\n 230, 246, 742, 758, 238, 254, 750, 766, 486, 502, 998,1014, 494, 510,1006,1022, // 767\n  33,  49, 545, 561,  41,  57, 553, 569, 289, 305, 801, 817, 297, 313, 809, 825,\n  37,  53, 549, 565,  45,  61, 557, 573, 293, 309, 805, 821, 301, 317, 813, 829,\n 161, 177, 673, 689, 169, 185, 681, 697, 417, 433, 929, 945, 425, 441, 937, 953,\n 165, 181, 677, 693, 173, 189, 685, 701, 421, 437, 933, 949, 429, 445, 941, 957,\n  35,  51, 547, 563,  43,  59, 555, 571, 291, 307, 803, 819, 299, 315, 811, 827,\n  39,  55, 551, 567,  47,  63, 559, 575, 295, 311, 807, 823, 303, 319, 815, 831,\n 163, 179, 675, 691, 171, 187, 683, 699, 419, 435, 931, 947, 427, 443, 939, 955,\n 167, 183, 679, 695, 175, 191, 687, 703, 423, 439, 935, 951, 431, 447, 943, 959,\n  97, 113, 609, 625, 105, 121, 617, 633, 353, 369, 865, 881, 361, 377, 873, 889,\n 101, 117, 613, 629, 109, 125, 621, 637, 357, 373, 869, 885, 365, 381, 877, 893,\n 225, 241, 737, 753, 233, 249, 745, 761, 481, 497, 993,1009, 489, 505,1001,1017,\n 229, 245, 741, 757, 237, 253, 749, 765, 485, 501, 997,1013, 493, 509,1005,1021,\n  99, 115, 611, 627, 107, 123, 619, 635, 355, 371, 867, 883, 363, 379, 875, 891,\n 103, 119, 615, 631, 111, 127, 623, 639, 359, 375, 871, 887, 367, 383, 879, 895,\n 227, 243, 739, 755, 235, 251, 747, 763, 483, 499, 995,1011, 491, 507,1003,1019,\n 231, 247, 743, 759, 239, 255, 751, 767, 487, 503, 999,1015, 495, 511,1007,1023, // 1023\n};\n\n//---------------------------------------------------------------\n// *** Class IW44Image::Alloc [declaration]\n\nstruct IW44Image::Alloc // DJVU_CLASS\n{\n  Alloc *next;\n  short data[IWALLOCSIZE];\n  Alloc(Alloc *n);\n};\n\n//---------------------------------------------------------------\n// *** Class IW44Image::Block [implementation]\n\n\nIW44Image::Block::Block(void)\n{\n  pdata[0] = pdata[1] = pdata[2] = pdata[3] = 0;\n}\n\nvoid \nIW44Image::Block::zero(int n)\n{\n  if (pdata[n>>4])\n    pdata[n>>4][n&15] = 0;\n}\n\nvoid  \nIW44Image::Block::read_liftblock(const short *coeff, IW44Image::Map *map)\n{\n  int n=0;\n  for (int n1=0; n1<64; n1++)\n    {\n      short *d = data(n1,map);\n      for (int n2=0; n2<16; n2++,n++)\n        d[n2] = coeff[zigzagloc[n]];\n    }\n}\n\nvoid  \nIW44Image::Block::write_liftblock(short *coeff, int bmin, int bmax) const\n{\n  int n = bmin<<4;\n  memset(coeff, 0, 1024*sizeof(short));\n  for (int n1=bmin; n1<bmax; n1++)\n    {\n      const short *d = data(n1);\n      if (d == 0)\n        n += 16;\n      else\n        for (int n2=0; n2<16; n2++,n++)\n          coeff[zigzagloc[n]] = d[n2];\n    }\n}\n\n//---------------------------------------------------------------\n// *** Class IW44Image::Map [implementation]\n\n\nIW44Image::Map::Map(int w, int h)\n  :  blocks(0), iw(w), ih(h), chain(0)\n{\n  bw = (w+0x20-1) & ~0x1f;\n  bh = (h+0x20-1) & ~0x1f;\n  nb = (bw * bh) / (32 * 32);\n  blocks = new IW44Image::Block[nb];\n  top = IWALLOCSIZE;\n}\n\nIW44Image::Map::~Map()\n{\n  while (chain)\n    {\n      IW44Image::Alloc *next = chain->next;\n      delete chain;\n      chain = next;\n    }\n  delete [] blocks;\n}\n\n\nIW44Image::Alloc::Alloc(Alloc *n)\n  : next(n) \n{ \n  // see note in IW44Image::Map::alloc\n  memset(data, 0, sizeof(data)); \n}\n\nshort *\nIW44Image::Map::alloc(int n)\n{\n  if (top+n > IWALLOCSIZE)\n    {\n      // note: everything is cleared long before we use it\n      // in order to avoid the need for a memory fence.\n      chain = new IW44Image::Alloc(chain);\n      top = 0;\n    }\n  short *ans = chain->data + top;\n  top += n;\n  return ans;\n}\n\nshort **\nIW44Image::Map::allocp(int n)\n{\n  // Allocate enough room for pointers plus alignment\n  short *p = alloc( (n+1) * sizeof(short*) / sizeof(short) );\n  // Align on pointer size\n  while ( ((long)p) & (sizeof(short*)-1) )\n    p += 1;\n  // Cast and return\n  return (short**)p;\n}\n\nint \nIW44Image::Map::get_bucket_count(void) const\n{\n  int buckets = 0;\n  for (int blockno=0; blockno<nb; blockno++)\n    for (int buckno=0; buckno<64; buckno++)\n      if (blocks[blockno].data(buckno))\n        buckets += 1;\n  return buckets;\n}\n\nunsigned int \nIW44Image::Map::get_memory_usage(void) const\n{\n  unsigned int usage = sizeof(Map);\n  usage += sizeof(IW44Image::Block) * nb;\n  for (IW44Image::Alloc *n = chain; n; n=n->next)\n    usage += sizeof(IW44Image::Alloc);\n  return usage;\n}\n\n\n\n\nvoid \nIW44Image::Map::image(signed char *img8, int rowsize, int pixsep, int fast)\n{\n  // Allocate reconstruction buffer\n  short *data16;\n  // cf. http://sourceforge.net/p/djvu/djvulibre-git/ci/7993b445f071a15248bd4be788a10643213cb9d2/\n  if (INT_MAX / bw < bh)\n    G_THROW(\"IW44Image: image size exceeds maximum (corrupted file?)\");\n  GPBuffer<short> gdata16(data16,bw*bh);\n  // Copy coefficients\n  int i;\n  short *p = data16;\n  const IW44Image::Block *block = blocks;\n  for (i=0; i<bh; i+=32)\n    {\n      for (int j=0; j<bw; j+=32)\n        {\n          short liftblock[1024];\n          // transfer into IW44Image::Block (apply zigzag and scaling)\n          block->write_liftblock(liftblock);\n          block++;\n          // transfer into coefficient matrix at (p+j)\n          short *pp = p + j;\n          short *pl = liftblock;\n          for (int ii=0; ii<32; ii++, pp+=bw,pl+=32)\n            memcpy((void*)pp, (void*)pl, 32*sizeof(short));\n        }\n      // next row of blocks\n      p += 32*bw;\n    }\n  // Reconstruction\n  if (fast)\n    {\n      IW44Image::Transform::Decode::backward(data16, iw, ih, bw, 32, 2);  \n      p = data16;\n      for (i=0; i<bh; i+=2,p+=bw)\n        for (int jj=0; jj<bw; jj+=2,p+=2)\n          p[bw] = p[bw+1] = p[1] = p[0];\n    }\n  else\n    {\n      IW44Image::Transform::Decode::backward(data16, iw, ih, bw, 32, 1);  \n    }\n  // Copy result into image\n  p = data16;\n  signed char *row = img8;  \n  for (i=0; i<ih; i++)\n    {\n      signed char *pix = row;\n      for (int j=0; j<iw; j+=1,pix+=pixsep)\n        {\n          int x = (p[j] + iw_round) >> iw_shift;\n          if (x < -128)\n            x = -128;\n          else if (x > 127)\n            x = 127;\n          *pix = x;\n        }\n      row += rowsize;\n      p += bw;\n    }\n}\n\nvoid \nIW44Image::Map::image(int subsample, const GRect &rect, \n              signed char *img8, int rowsize, int pixsep, int fast)\n{\n  int i;\n  // Compute number of decomposition levels\n  int nlevel = 0;\n  while (nlevel<5 && (32>>nlevel)>subsample)\n    nlevel += 1;\n  int boxsize = 1<<nlevel;\n  // Parameter check\n  if (subsample!=(32>>nlevel))\n    G_THROW( ERR_MSG(\"IW44Image.sample_factor\") );\n  if (rect.isempty())\n    G_THROW( ERR_MSG(\"IW44Image.empty_rect\") );    \n  GRect irect(0,0,(iw+subsample-1)/subsample,(ih+subsample-1)/subsample);\n  if (rect.xmin<0 || rect.ymin<0 || rect.xmax>irect.xmax || rect.ymax>irect.ymax)\n    G_THROW( ERR_MSG(\"IW44Image.bad_rect\") );\n  // Multiresolution rectangles \n  // -- needed[i] tells which coeffs are required for the next step\n  // -- recomp[i] tells which coeffs need to be computed at this level\n  GRect needed[8];\n  GRect recomp[8];\n  int r = 1;\n  needed[nlevel] = rect;\n  recomp[nlevel] = rect;\n  for (i=nlevel-1; i>=0; i--)\n    {\n      needed[i] = recomp[i+1];\n      needed[i].inflate(iw_border*r, iw_border*r);\n      needed[i].intersect(needed[i], irect);\n      r += r;\n      recomp[i].xmin = (needed[i].xmin + r-1) & ~(r-1);\n      recomp[i].xmax = (needed[i].xmax) & ~(r-1);\n      recomp[i].ymin = (needed[i].ymin + r-1) & ~(r-1);\n      recomp[i].ymax = (needed[i].ymax) & ~(r-1);\n    }\n  // Working rectangle\n  // -- a rectangle large enough to hold all the data\n  GRect work;\n  work.xmin = (needed[0].xmin) & ~(boxsize-1);\n  work.ymin = (needed[0].ymin) & ~(boxsize-1);\n  work.xmax = ((needed[0].xmax-1) & ~(boxsize-1) ) + boxsize;\n  work.ymax = ((needed[0].ymax-1) & ~(boxsize-1) ) + boxsize;\n  // -- allocate work buffer\n  int dataw = work.xmax - work.xmin;     // Note: cannot use inline width() or height()\n  int datah = work.ymax - work.ymin;     // because Intel C++ compiler optimizes it wrong !\n  short *data;\n  GPBuffer<short> gdata(data,dataw*datah);\n  // Fill working rectangle\n  // -- loop over liftblocks rows\n  short *ldata = data;\n  int blkw = (bw>>5);\n  const IW44Image::Block *lblock = blocks + (work.ymin>>nlevel)*blkw + (work.xmin>>nlevel);\n  for (int by=work.ymin; by<work.ymax; by+=boxsize)\n    {\n      // -- loop over liftblocks in row\n      const IW44Image::Block *block = lblock;\n      short *rdata = ldata;\n      for (int bx=work.xmin; bx<work.xmax; bx+=boxsize)        \n        {\n          // -- decide how much to load\n          int mlevel = nlevel;\n          if (nlevel>2)\n            if (bx+31<needed[2].xmin || bx>needed[2].xmax ||\n                by+31<needed[2].ymin || by>needed[2].ymax )\n              mlevel = 2;\n          int bmax   = ((1<<(mlevel+mlevel))+15)>>4;\n          int ppinc  = (1<<(nlevel-mlevel));\n          int ppmod1 = (dataw<<(nlevel-mlevel));\n          int ttmod0 = (32 >> mlevel);\n          int ttmod1 = (ttmod0 << 5);\n          // -- get current block\n          short liftblock[1024];\n          block->write_liftblock(liftblock, 0, bmax );\n          // -- copy liftblock into image\n          short *tt = liftblock;\n          short *pp = rdata;\n          for (int ii=0; ii<boxsize; ii+=ppinc,pp+=ppmod1,tt+=ttmod1-32)\n            for (int jj=0; jj<boxsize; jj+=ppinc,tt+=ttmod0)\n              pp[jj] = *tt;\n          // -- next block in row\n          rdata += boxsize;\n          block += 1;\n        }\n      // -- next row of blocks\n      ldata += dataw << nlevel;\n      lblock += blkw;\n    }\n  // Perform reconstruction\n  r = boxsize;\n  for (i=0; i<nlevel; i++)\n    {\n      GRect comp = needed[i];\n      comp.xmin = comp.xmin & ~(r-1);\n      comp.ymin = comp.ymin & ~(r-1);\n      comp.translate(-work.xmin, -work.ymin);\n      // Fast mode shortcuts finer resolution\n      if (fast && i>=4) \n        {\n          short *pp = data + comp.ymin*dataw;\n          for (int ii=comp.ymin; ii<comp.ymax; ii+=2, pp+=dataw+dataw)\n            for (int jj=comp.xmin; jj<comp.xmax; jj+=2)\n              pp[jj+dataw] = pp[jj+dataw+1] = pp[jj+1] = pp[jj];\n          break;\n        }\n      else\n        {\n          short *pp = data + comp.ymin*dataw + comp.xmin;\n          IW44Image::Transform::Decode::backward(pp, comp.width(), comp.height(), dataw, r, r>>1);\n        }\n      r = r>>1;\n    }\n  // Copy result into image\n  GRect nrect = rect;\n  nrect.translate(-work.xmin, -work.ymin);\n  short *p = data + nrect.ymin*dataw;\n  signed char *row = img8;  \n  for (i=nrect.ymin; i<nrect.ymax; i++)\n    {\n      int j;\n      signed char *pix = row;\n      for (j=nrect.xmin; j<nrect.xmax; j+=1,pix+=pixsep)\n        {\n          int x = (p[j] + iw_round) >> iw_shift;\n          if (x < -128)\n            x = -128;\n          else if (x > 127)\n            x = 127;\n          *pix = x;\n        }\n      row += rowsize;\n      p += dataw;\n    }\n}\n\n\n\n\n//////////////////////////////////////////////////////\n// ENCODING/DECODING WAVELET COEFFICIENTS \n//    USING HIERARCHICAL SET DIFFERENCE\n//////////////////////////////////////////////////////\n\n\n//-----------------------------------------------\n// Class IW44Image::Codec [implementation]\n// Maintains information shared while encoding or decoding\n\n\n// Constant\n\nstatic const struct { int start; int size; }  \nbandbuckets[] = \n{\n  // Code first bucket and number of buckets in each band\n  { 0, 1 }, // -- band zero contains all lores info\n  { 1, 1 }, { 2, 1 }, { 3, 1 }, \n  { 4, 4 }, { 8, 4 }, { 12,4 }, \n  { 16,16 }, { 32,16 }, { 48,16 }, \n};\n\n\n// IW44Image::Codec constructor\n\nIW44Image::Codec::Codec(IW44Image::Map &xmap)\n  : map(xmap), \n    curband(0),\n    curbit(1)\n{\n  // Initialize quantification\n  int  j;\n  int  i = 0;\n  const int *q = iw_quant;\n  // -- lo coefficients\n  for (j=0; i<4; j++)\n    quant_lo[i++] = *q++;\n  for (j=0; j<4; j++)\n    quant_lo[i++] = *q;\n  q += 1;\n  for (j=0; j<4; j++)\n    quant_lo[i++] = *q;\n  q += 1;\n  for (j=0; j<4; j++)\n    quant_lo[i++] = *q;\n  q += 1;\n  // -- hi coefficients\n  quant_hi[0] = 0;\n  for (j=1; j<10; j++)\n    quant_hi[j] = *q++;\n  // Initialize coding contexts\n  memset((void*)ctxStart, 0, sizeof(ctxStart));\n  memset((void*)ctxBucket, 0, sizeof(ctxBucket));\n  ctxMant = 0;\n  ctxRoot = 0;\n}\n\n\n// IW44Image::Codec destructor\n\nIW44Image::Codec::~Codec() {}\n\n// is_null_slice\n// -- check if data can be produced for this band/mask\n// -- also fills the sure_zero array\n\nint \nIW44Image::Codec::is_null_slice(int bit, int band)\n{\n  if (band == 0)\n    {\n      int is_null = 1;\n      for (int i=0; i<16; i++) \n        {\n          int threshold = quant_lo[i];\n          coeffstate[i] = ZERO;\n          if (threshold>0 && threshold<0x8000)\n            {\n              coeffstate[i] = UNK;\n              is_null = 0;\n            }\n        }\n      return is_null;\n    }\n  else\n    {\n      int threshold = quant_hi[band];\n      return (! (threshold>0 && threshold<0x8000));\n    }\n}\n\n\n// code_slice\n// -- read/write a slice of datafile\n\nint\nIW44Image::Codec::Decode::code_slice(ZPCodec &zp)\n{\n  // Check that code_slice can still run\n  if (curbit < 0)\n    return 0;\n  // Perform coding\n  if (! is_null_slice(curbit, curband))\n    {\n      for (int blockno=0; blockno<map.nb; blockno++)\n        {\n          int fbucket = bandbuckets[curband].start;\n          int nbucket = bandbuckets[curband].size;\n          decode_buckets(zp, curbit, curband, \n                           map.blocks[blockno], \n                           fbucket, nbucket);\n        }\n    }\n  return finish_code_slice(zp);\n}\n\n// code_slice\n// -- read/write a slice of datafile\n\nint\nIW44Image::Codec::finish_code_slice(ZPCodec &zp)\n{\n  // Reduce quantization threshold\n  quant_hi[curband] = quant_hi[curband] >> 1;\n  if (curband == 0)\n    for (int i=0; i<16; i++) \n      quant_lo[i] = quant_lo[i] >> 1;\n  // Proceed to the next slice\n  if (++curband >= (int)(sizeof(bandbuckets)/sizeof(bandbuckets[0])))\n    {\n      curband = 0;\n      curbit += 1;\n      if (quant_hi[(sizeof(bandbuckets)/sizeof(bandbuckets[0]))-1] == 0)\n        {\n          // All quantization thresholds are null\n          curbit = -1;\n          return 0;\n        }\n    }\n  return 1;\n}\n\n// decode_prepare\n// -- prepare the states before decoding buckets\n\nint\nIW44Image::Codec::decode_prepare(int fbucket, int nbucket, IW44Image::Block &blk)\n{  \n  int bbstate = 0;\n  char *cstate = coeffstate;\n  if (fbucket)\n    {\n      // Band other than zero\n      for (int buckno=0; buckno<nbucket; buckno++, cstate+=16)\n        {\n          int bstatetmp = 0;\n          const short *pcoeff = blk.data(fbucket+buckno);\n          if (! pcoeff)\n            {\n              // cstate[0..15] will be filled later\n              bstatetmp = UNK;\n            }\n          else\n            {\n              for (int i=0; i<16; i++)\n                {\n                  int cstatetmp = UNK;\n                  if (pcoeff[i])\n                    cstatetmp = ACTIVE;\n                  cstate[i] = cstatetmp;\n                  bstatetmp |= cstatetmp;\n                }\n            }\n          bucketstate[buckno] = bstatetmp;\n          bbstate |= bstatetmp;\n        }\n    }\n  else\n    {\n      // Band zero ( fbucket==0 implies band==zero and nbucket==1 )\n      const short *pcoeff = blk.data(0);\n      if (! pcoeff)\n        {\n          // cstate[0..15] will be filled later\n          bbstate = UNK;      \n        }\n      else\n        {\n          for (int i=0; i<16; i++)\n            {\n              int cstatetmp = cstate[i];\n              if (cstatetmp != ZERO)\n                {\n                  cstatetmp = UNK;\n                  if (pcoeff[i])\n                    cstatetmp = ACTIVE;\n                }\n              cstate[i] = cstatetmp;\n              bbstate |= cstatetmp;\n            }\n        }\n      bucketstate[0] = bbstate;\n    }\n  return bbstate;\n}\n\n\n// decode_buckets\n// -- code a sequence of buckets in a given block\n\nvoid\nIW44Image::Codec::decode_buckets(ZPCodec &zp, int bit, int band, \n                         IW44Image::Block &blk,\n                         int fbucket, int nbucket)\n{\n  // compute state of all coefficients in all buckets\n  int bbstate = decode_prepare(fbucket, nbucket, blk);\n  // code root bit\n  if ((nbucket<16) || (bbstate&ACTIVE))\n    {\n      bbstate |= NEW;\n    }\n  else if (bbstate & UNK)\n    {\n      if (zp.decoder(ctxRoot))\n        bbstate |= NEW;\n#ifdef TRACE\n      DjVuPrintMessage(\"bbstate[bit=%d,band=%d] = %d\\n\", bit, band, bbstate);\n#endif\n    }\n  \n  // code bucket bits\n  if (bbstate & NEW)\n    for (int buckno=0; buckno<nbucket; buckno++)\n      {\n        // Code bucket bit\n        if (bucketstate[buckno] & UNK)\n          {\n            // Context\n            int ctx = 0;\n#ifndef NOCTX_BUCKET_UPPER\n            if (band>0)\n              {\n                int k = (fbucket+buckno)<<2;\n                const short *b = blk.data(k>>4);\n                if (b)\n                  {\n                    k = k & 0xf;\n                    if (b[k])\n                      ctx += 1;\n                    if (b[k+1])\n                      ctx += 1;\n                    if (b[k+2])\n                      ctx += 1;\n                    if (ctx<3 && b[k+3])\n                      ctx += 1;\n                  }\n              }\n#endif // NOCTX_BUCKET_UPPER\n#ifndef NOCTX_BUCKET_ACTIVE\n            if (bbstate & ACTIVE)\n              ctx |= 4; \n#endif\n            // Code\n            if (zp.decoder( ctxBucket[band][ctx] ))\n              bucketstate[buckno] |= NEW;\n#ifdef TRACE\n            DjVuPrintMessage(\"  bucketstate[bit=%d,band=%d,buck=%d] = %d\\n\", \n                   bit, band, buckno, bucketstate[buckno]);\n#endif\n          }\n      }\n\n  // code new active coefficient (with their sign)\n  if (bbstate & NEW)\n    {\n      int thres = quant_hi[band];\n      char *cstate = coeffstate;\n      for (int buckno=0; buckno<nbucket; buckno++, cstate+=16)\n        if (bucketstate[buckno] & NEW)\n          {\n            int i;\n            short *pcoeff = (short*)blk.data(fbucket+buckno);\n            if (!pcoeff)\n              {\n                pcoeff = blk.data(fbucket+buckno, &map);\n                // time to fill cstate[0..15]\n                if (fbucket == 0) // band zero\n                  {\n                    for (i=0; i<16; i++)\n                      if (cstate[i] != ZERO)\n                        cstate[i] = UNK;\n                  }\n                else\n                  {\n                    for (i=0; i<16; i++)\n                      cstate[i] = UNK;\n                  }\n              }\n#ifndef NOCTX_EXPECT\n            int gotcha = 0;\n            const int maxgotcha = 7;\n            for (i=0; i<16; i++)\n              if (cstate[i] & UNK)\n                gotcha += 1;\n#endif\n            for (i=0; i<16; i++)\n              {\n                if (cstate[i] & UNK)\n                  {\n                    // find lores threshold\n                    if (band == 0)\n                      thres = quant_lo[i];\n                    // prepare context\n                    int ctx = 0;\n#ifndef NOCTX_EXPECT\n                    if (gotcha>=maxgotcha)\n                      ctx = maxgotcha;\n                    else\n                      ctx = gotcha;\n#endif\n#ifndef NOCTX_ACTIVE\n                    if (bucketstate[buckno] & ACTIVE)\n                      ctx |= 8;\n#endif\n                    // code difference bit\n                    if (zp.decoder( ctxStart[ctx] ))\n                      {\n                        cstate[i] |= NEW;\n                        int halfthres = thres>>1;\n                        int coeff = thres+halfthres-(halfthres>>2);\n                        if (zp.IWdecoder())\n                          pcoeff[i] = -coeff;\n                        else\n                          pcoeff[i] = coeff;\n                      }\n#ifndef NOCTX_EXPECT\n                    if (cstate[i] & NEW)\n                      gotcha = 0;\n                    else if (gotcha > 0)\n                      gotcha -= 1;\n#endif\n#ifdef TRACE\n                    DjVuPrintMessage(\"    coeffstate[bit=%d,band=%d,buck=%d,c=%d] = %d\\n\", \n                           bit, band, buckno, i, cstate[i]);\n#endif\n                  }\n              }\n          }\n    }\n  \n  // code mantissa bits\n  if (bbstate & ACTIVE)\n    {\n      int thres = quant_hi[band];\n      char *cstate = coeffstate;\n      for (int buckno=0; buckno<nbucket; buckno++, cstate+=16)\n        if (bucketstate[buckno] & ACTIVE)\n          {\n            short *pcoeff = (short*)blk.data(fbucket+buckno);\n            for (int i=0; i<16; i++)\n              if (cstate[i] & ACTIVE)\n                {\n                  int coeff = pcoeff[i];\n                  if (coeff < 0)\n                    coeff = -coeff;\n                  // find lores threshold\n                  if (band == 0)\n                    thres = quant_lo[i];\n                  // adjust coefficient\n                  if (coeff <= 3*thres)\n                    {\n                      // second mantissa bit\n                      coeff = coeff + (thres>>2);\n                      if (zp.decoder(ctxMant))\n                        coeff = coeff + (thres>>1);\n                      else\n                        coeff = coeff - thres + (thres>>1);\n                    }\n                  else\n                    {\n                      if (zp.IWdecoder())\n                        coeff = coeff + (thres>>1);\n                      else\n                        coeff = coeff - thres + (thres>>1);\n                    }\n                  // store coefficient\n                  if (pcoeff[i] > 0)\n                    pcoeff[i] = coeff;\n                  else\n                    pcoeff[i] = -coeff;\n                }\n          }\n    }\n}\n\n\n//////////////////////////////////////////////////////\n// UTILITIES\n//////////////////////////////////////////////////////\n\n\n#ifdef min\n#undef min\n#endif\nstatic inline int\nmin(const int x, const int y)\n{\n  return (x <= y) ? x : y;\n}\n\n#ifdef max\n#undef max\n#endif\nstatic inline int\nmax(const int x, const int y)\n{\n  return (y <= x) ? x : y;\n}\n\n\nvoid \nIW44Image::PrimaryHeader::decode(GP<ByteStream> gbs)\n{\n  serial = gbs->read8();\n  slices = gbs->read8();\n}\n\nvoid \nIW44Image::SecondaryHeader::decode(GP<ByteStream> gbs)\n{\n  major = gbs->read8();\n  minor = gbs->read8();\n}\n\nvoid \nIW44Image::TertiaryHeader::decode(GP<ByteStream> gbs, int major, int minor)\n{\n  xhi = gbs->read8();\n  xlo = gbs->read8();\n  yhi = gbs->read8();\n  ylo = gbs->read8();\n  crcbdelay = 0;\n  if (major== 1 && minor>=2)\n    crcbdelay = gbs->read8();\n}\n\n\n\n//////////////////////////////////////////////////////\n// CLASS IW44Image\n//////////////////////////////////////////////////////\n\nIW44Image::IW44Image(void)\n  : db_frac(1.0),\n    ymap(0), cbmap(0), crmap(0),\n    cslice(0), cserial(0), cbytes(0)\n{}\n\nIW44Image::~IW44Image()\n{\n  delete ymap;\n  delete cbmap;\n  delete crmap;\n}\n\nGP<IW44Image>\nIW44Image::create_decode(const ImageType itype)\n{\n  switch(itype)\n  {\n  case COLOR:\n    return new IWPixmap();\n  case GRAY:\n    return new IWBitmap();\n  default:\n    return 0;\n  }\n}\n\nint\nIW44Image::encode_chunk(GP<ByteStream>, const IWEncoderParms &)\n{\n  G_THROW( ERR_MSG(\"IW44Image.codec_open2\") );\n  return 0;\n}\n\nvoid \nIW44Image::encode_iff(IFFByteStream &, int nchunks, const IWEncoderParms *)\n{\n  G_THROW( ERR_MSG(\"IW44Image.codec_open2\") );\n}\n\n  \nvoid \nIWBitmap::close_codec(void)\n{\n  delete ycodec;\n  ycodec = 0;\n  cslice = cbytes = cserial = 0;\n}\n\nvoid \nIWPixmap::close_codec(void)\n{\n  delete ycodec;\n  delete cbcodec;\n  delete crcodec;\n  ycodec = crcodec = cbcodec = 0;\n  cslice = cbytes = cserial = 0;\n}\n\nint \nIW44Image::get_width(void) const\n{\n  return (ymap)?(ymap->iw):0;\n}\n\nint \nIW44Image::get_height(void) const\n{\n  return (ymap)?(ymap->ih):0;\n}\n\n\n//////////////////////////////////////////////////////\n// CLASS IWBITMAP\n//////////////////////////////////////////////////////\n\nIWBitmap::IWBitmap(void )\n: IW44Image(), ycodec(0)\n{}\n\nIWBitmap::~IWBitmap()\n{\n  close_codec();\n}\n\nint\nIWBitmap::get_percent_memory(void) const\n{\n  int buckets = 0;\n  int maximum = 0;\n  if (ymap) \n    {\n      buckets += ymap->get_bucket_count();\n      maximum += 64 * ymap->nb;\n    }\n  return 100*buckets/ (maximum ? maximum : 1);\n}\n\nunsigned int\nIWBitmap::get_memory_usage(void) const\n{\n  unsigned int usage = sizeof(GBitmap);\n  if (ymap)\n    usage += ymap->get_memory_usage();\n  return usage;\n}\n\n\nGP<GBitmap> \nIWBitmap::get_bitmap(void)\n{\n  // Check presence of data\n  if (ymap == 0)\n    return 0;\n  // Perform wavelet reconstruction\n  int w = ymap->iw;\n  int h = ymap->ih;\n  GP<GBitmap> pbm = GBitmap::create(h, w);\n  ymap->image((signed char*)(*pbm)[0],pbm->rowsize());\n  // Shift image data\n  for (int i=0; i<h; i++)\n    {\n      unsigned char *urow = (*pbm)[i];\n      signed char *srow = (signed char*)urow;\n      for (int j=0; j<w; j++)\n        urow[j] = (int)(srow[j]) + 128;\n    }\n  pbm->set_grays(256);\n  return pbm;\n}\n\n\nGP<GBitmap>\nIWBitmap::get_bitmap(int subsample, const GRect &rect)\n{\n  if (ymap == 0)\n    return 0;\n  // Allocate bitmap\n  int w = rect.width();\n  int h = rect.height();\n  GP<GBitmap> pbm = GBitmap::create(h,w);\n  ymap->image(subsample, rect, (signed char*)(*pbm)[0],pbm->rowsize());\n  // Shift image data\n  for (int i=0; i<h; i++)\n    {\n      unsigned char *urow = (*pbm)[i];\n      signed char *srow = (signed char*)urow;\n      for (int j=0; j<w; j++)\n        urow[j] = (int)(srow[j]) + 128;\n    }\n  pbm->set_grays(256);\n  return pbm;\n}\n\n\nint\nIWBitmap::decode_chunk(GP<ByteStream> gbs)\n{\n  // Open\n  if (! ycodec)\n  {\n    cslice = cserial = 0;\n    delete ymap;\n    ymap = 0;\n  }\n  // Read primary header\n  struct IW44Image::PrimaryHeader primary;\n  primary.decode(gbs);\n  if (primary.serial != cserial)\n    G_THROW( ERR_MSG(\"IW44Image.wrong_serial\") );\n  int nslices = cslice + primary.slices;\n  // Read auxilliary headers\n  if (cserial == 0)\n    {\n      struct IW44Image::SecondaryHeader secondary;\n      secondary.decode(gbs);\n      if ((secondary.major & 0x7f) != IWCODEC_MAJOR)\n        G_THROW( ERR_MSG(\"IW44Image.incompat_codec\") );\n      if (secondary.minor > IWCODEC_MINOR)\n        G_THROW( ERR_MSG(\"IW44Image.recent_codec\") );\n      // Read tertiary header\n      struct IW44Image::TertiaryHeader tertiary;\n      tertiary.decode(gbs, secondary.major & 0x7f, secondary.minor);\n      if (! (secondary.major & 0x80))\n        G_THROW( ERR_MSG(\"IW44Image.has_color\") );\n      // Create ymap and ycodec\n      int w = (tertiary.xhi << 8) | tertiary.xlo;\n      int h = (tertiary.yhi << 8) | tertiary.ylo;\n      assert(! ymap);\n      ymap = new Map(w, h);\n      assert(! ycodec);\n      ycodec = new Codec::Decode(*ymap);\n    }\n  // Read data\n  assert(ymap);\n  assert(ycodec);\n  GP<ZPCodec> gzp=ZPCodec::create(gbs, false, true);\n  ZPCodec &zp=*gzp;\n  int flag = 1;\n  while (flag && cslice<nslices)\n    {\n      flag = ycodec->code_slice(zp);\n      cslice++;\n    }\n  // Return\n  cserial += 1;\n  return nslices;\n}\n\nvoid \nIWBitmap::parm_dbfrac(float frac)\n{\n  if (frac>0 && frac<=1)\n    db_frac = frac;\n  else\n    G_THROW( ERR_MSG(\"IW44Image.param_range\") );\n}\n\n\nint \nIWBitmap::get_serial(void)\n{\n  return cserial;\n}\n\nvoid \nIWBitmap::decode_iff(IFFByteStream &iff, int maxchunks)\n{\n  if (ycodec)\n    G_THROW( ERR_MSG(\"IW44Image.left_open2\") );\n  GUTF8String chkid;\n  iff.get_chunk(chkid);\n  if (chkid != \"FORM:BM44\")\n    G_THROW( ERR_MSG(\"IW44Image.corrupt_BM44\") );\n  while (--maxchunks>=0 && iff.get_chunk(chkid))\n    {\n      if (chkid == \"BM44\")\n        decode_chunk(iff.get_bytestream());\n      iff.close_chunk();\n    }\n  iff.close_chunk();\n  close_codec();\n}\n\n\n\n\n//////////////////////////////////////////////////////\n// CLASS IWENCODERPARMS\n//////////////////////////////////////////////////////\n\n\nIWEncoderParms::IWEncoderParms(void)\n{\n  // Zero represent default values\n  memset((void*)this, 0, sizeof(IWEncoderParms));\n}\n\n\n\n\n\n//////////////////////////////////////////////////////\n// CLASS IWPIXMAP\n//////////////////////////////////////////////////////\n\n\nIWPixmap::IWPixmap(void)\n: IW44Image(), crcb_delay(10), crcb_half(0), ycodec(0), cbcodec(0), crcodec(0)\n{}\n\nIWPixmap::~IWPixmap()\n{\n  close_codec();\n}\n\nint\nIWPixmap::get_percent_memory(void) const\n{\n  int buckets = 0;\n  int maximum = 0;\n  if (ymap)\n    {\n      buckets += ymap->get_bucket_count();\n      maximum += 64*ymap->nb;\n    }\n  if (cbmap)\n    {\n      buckets += cbmap->get_bucket_count();\n      maximum += 64*cbmap->nb;\n    }\n  if (crmap)\n    {\n      buckets += crmap->get_bucket_count();\n      maximum += 64*crmap->nb;\n    }\n  return 100*buckets/ (maximum ? maximum : 1);\n}\n\nunsigned int\nIWPixmap::get_memory_usage(void) const\n{\n  unsigned int usage = sizeof(GPixmap);\n  if (ymap)\n    usage += ymap->get_memory_usage();\n  if (cbmap)\n    usage += cbmap->get_memory_usage();\n  if (crmap)\n    usage += crmap->get_memory_usage();\n  return usage;\n}\n\n\nGP<GPixmap> \nIWPixmap::get_pixmap(void)\n{\n  // Check presence of data\n  if (ymap == 0)\n    return 0;\n  // Allocate pixmap\n  int w = ymap->iw;\n  int h = ymap->ih;\n  GP<GPixmap> ppm = GPixmap::create(h, w);\n  // Perform wavelet reconstruction\n  signed char *ptr = (signed char*) (*ppm)[0];\n  int rowsep = ppm->rowsize() * sizeof(GPixel);\n  int pixsep = sizeof(GPixel);\n  ymap->image(ptr, rowsep, pixsep);\n  if (crmap && cbmap && crcb_delay >= 0)\n  {\n    cbmap->image(ptr+1, rowsep, pixsep, crcb_half);\n    crmap->image(ptr+2, rowsep, pixsep, crcb_half);\n  }\n  // Convert image data to RGB\n  if (crmap && cbmap && crcb_delay >= 0)\n    {\n      Transform::Decode::YCbCr_to_RGB((*ppm)[0], w, h, ppm->rowsize());\n    }\n  else\n    {\n      for (int i=0; i<h; i++)\n        {\n          GPixel *pixrow = (*ppm)[i];\n          for (int j=0; j<w; j++, pixrow++)\n            pixrow->b = pixrow->g = pixrow->r \n              = 127 - (int)(((signed char*)pixrow)[0]);\n        }\n    }\n  // Return\n  return ppm;\n}\n\n\n\nGP<GPixmap>\nIWPixmap::get_pixmap(int subsample, const GRect &rect)\n{\n  if (ymap == 0)\n    return 0;\n  // Allocate\n  int w = rect.width();\n  int h = rect.height();\n  GP<GPixmap> ppm = GPixmap::create(h,w);\n  // Perform wavelet reconstruction\n  signed char *ptr = (signed char*) (*ppm)[0];\n  int rowsep = ppm->rowsize() * sizeof(GPixel);\n  int pixsep = sizeof(GPixel);\n  ymap->image(subsample, rect, ptr, rowsep, pixsep);\n  if (crmap && cbmap && crcb_delay >= 0)\n  {\n    cbmap->image(subsample, rect, ptr+1, rowsep, pixsep, crcb_half);\n    crmap->image(subsample, rect, ptr+2, rowsep, pixsep, crcb_half);\n  }\n  // Convert image data to RGB\n  if (crmap && cbmap && crcb_delay >= 0)\n    {\n      Transform::Decode::YCbCr_to_RGB((*ppm)[0], w, h, ppm->rowsize());\n    }\n  else\n    {\n      for (int i=0; i<h; i++)\n        {\n          GPixel *pixrow = (*ppm)[i];\n          for (int j=0; j<w; j++, pixrow++)\n            pixrow->b = pixrow->g = pixrow->r \n              = 127 - (int)(((signed char*)pixrow)[0]);\n        }\n    }\n  // Return\n  return ppm;\n}\n\n\nint\nIWPixmap::decode_chunk(GP<ByteStream> gbs)\n{\n  // Open\n  if (! ycodec)\n  {\n      cslice = cserial = 0;\n      delete ymap;\n      ymap = 0;\n  }\n\n  // Read primary header\n  struct IW44Image::PrimaryHeader primary;\n  primary.decode(gbs);\n  if (primary.serial != cserial)\n    G_THROW( ERR_MSG(\"IW44Image.wrong_serial2\") );\n  int nslices = cslice + primary.slices;\n  // Read secondary header\n  if (cserial == 0)\n    {\n      struct IW44Image::SecondaryHeader secondary;\n      secondary.decode(gbs);\n      if ((secondary.major & 0x7f) != IWCODEC_MAJOR)\n        G_THROW( ERR_MSG(\"IW44Image.incompat_codec2\") );\n      if (secondary.minor > IWCODEC_MINOR)\n        G_THROW( ERR_MSG(\"IW44Image.recent_codec2\") );\n      // Read tertiary header\n      struct IW44Image::TertiaryHeader tertiary;\n      tertiary.decode(gbs, secondary.major & 0x7f, secondary.minor);\n      // Handle header information\n      int w = (tertiary.xhi << 8) | tertiary.xlo;\n      int h = (tertiary.yhi << 8) | tertiary.ylo;\n      crcb_delay = 0;\n      crcb_half = 0;\n      if (secondary.minor>=2)\n        crcb_delay = tertiary.crcbdelay & 0x7f;\n      if (secondary.minor>=2)\n        crcb_half = (tertiary.crcbdelay & 0x80 ? 0 : 1);\n      if (secondary.major & 0x80)\n        crcb_delay = -1;\n      // Create ymap and ycodec    \n      assert(! ymap);\n      assert(! ycodec);\n      ymap = new Map(w, h);\n      ycodec = new Codec::Decode(*ymap);\n      if (crcb_delay >= 0)\n        {\n          cbmap = new Map(w, h);\n          crmap = new Map(w, h);\n          cbcodec = new Codec::Decode(*cbmap);\n          crcodec = new Codec::Decode(*crmap);\n        }\n    }\n  // Read data\n  assert(ymap);\n  assert(ycodec);\n  GP<ZPCodec> gzp=ZPCodec::create(gbs, false, true);\n  ZPCodec &zp=*gzp;\n  int flag = 1;\n  while (flag && cslice<nslices)\n    {\n      flag = ycodec->code_slice(zp);\n      if (crcodec && cbcodec && crcb_delay<=cslice)\n        {\n          flag |= cbcodec->code_slice(zp);\n          flag |= crcodec->code_slice(zp);\n        }\n      cslice++;\n    }\n  // Return\n  cserial += 1;\n  return nslices;\n}\n\n\nint \nIWPixmap::parm_crcbdelay(const int parm)\n{\n  if (parm >= 0)\n    crcb_delay = parm;\n  return crcb_delay;\n}\n\nvoid \nIWPixmap::parm_dbfrac(float frac)\n{\n  if (frac>0 && frac<=1)\n    db_frac = frac;\n  else\n    G_THROW( ERR_MSG(\"IW44Image.param_range2\") );\n}\n\nint \nIWPixmap::get_serial(void)\n{\n  return cserial;\n}\n\n\nvoid \nIWPixmap::decode_iff(IFFByteStream &iff, int maxchunks)\n{\n  if (ycodec)\n    G_THROW( ERR_MSG(\"IW44Image.left_open4\") );\n  GUTF8String chkid;\n  iff.get_chunk(chkid);\n  if (chkid!=\"FORM:PM44\" && chkid!=\"FORM:BM44\")\n    G_THROW( ERR_MSG(\"IW44Image.corrupt_BM44_2\") );\n  while (--maxchunks>=0 && iff.get_chunk(chkid))\n    {\n      if (chkid==\"PM44\" || chkid==\"BM44\")\n        decode_chunk(iff.get_bytestream());\n      iff.close_chunk();\n    }\n  iff.close_chunk();\n  close_codec();\n}\n\n//////////////////////////////////////////////////////\n// NEW FILTERS\n//////////////////////////////////////////////////////\n\nvoid\nIW44Image::Transform::filter_begin(int w, int h)\n{\n  if (MMXControl::mmxflag < 0)  \n    MMXControl::enable_mmx();\n}\n\n\nvoid\nIW44Image::Transform::filter_end(void)\n{\n#ifdef MMX\n  if (MMXControl::mmxflag > 0)\n    MMXemms;\n#endif\n}\n\n\n//////////////////////////////////////////////////////\n// WAVELET TRANSFORM \n//////////////////////////////////////////////////////\n\n\n//----------------------------------------------------\n// Function for applying bidimensional IW44 between \n// scale intervals begin(inclusive) and end(exclusive)\n\nvoid\nIW44Image::Transform::Decode::backward(short *p, int w, int h, int rowsize, int begin, int end)\n{ \n  // PREPARATION\n  filter_begin(w,h);\n  // LOOP ON SCALES\n  for (int scale=begin>>1; scale>=end; scale>>=1)\n    {\n#ifdef IWTRANSFORM_TIMER\n      int tv,th;\n      th = tv = GOS::ticks();\n#endif\n      filter_bv(p, w, h, rowsize, scale);\n#ifdef IWTRANSFORM_TIMER\n      th = GOS::ticks();\n      tv = th - tv;\n#endif\n      filter_bh(p, w, h, rowsize, scale);\n#ifdef IWTRANSFORM_TIMER\n      th = GOS::ticks()-th;\n      DjVuPrintErrorUTF8(\"back%d\\tv=%dms h=%dms\\n\", scale,tv,th);\n#endif\n    }\n  // TERMINATE\n  filter_end();\n}\n  \n\n\n\n//////////////////////////////////////////////////////\n// COLOR TRANSFORM \n//////////////////////////////////////////////////////\n\n/* Converts YCbCr to RGB. */\nvoid \nIW44Image::Transform::Decode::YCbCr_to_RGB(GPixel *p, int w, int h, int rowsize)\n{\n  for (int i=0; i<h; i++,p+=rowsize)\n    {\n      GPixel *q = p;\n      for (int j=0; j<w; j++,q++)\n        {\n          signed char y = ((signed char*)q)[0];\n          signed char b = ((signed char*)q)[1];\n          signed char r = ((signed char*)q)[2];\n          // This is the Pigeon transform\n          int t1 = b >> 2 ; \n          int t2 = r + (r >> 1);\n          int t3 = y + 128 - t1;\n          int tr = y + 128 + t2;\n          int tg = t3 - (t2 >> 1);\n          int tb = t3 + (b << 1);\n          q->r = max(0,min(255,tr));\n          q->g = max(0,min(255,tg));\n          q->b = max(0,min(255,tb));\n        }\n    }\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/IW44Image.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef IW44IMAGE_H_\n#define IW44IMAGE_H_\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n/** @name IW44Image.h\n\n    Files #\"IW44Image.h\"# and #\"IW44Image.cpp\"# implement the DjVu IW44 wavelet\n    scheme for the compression of gray-level images (see class \\Ref{IWBitmap})\n    and color images (see class \\Ref{IWPixmap}).  Programs \\Ref{c44} and\n    \\Ref{d44} demonstrate how to encode and decode IW44 files.\n\n    {\\bf IW44 File Structure} --- The IW44 files are structured according to\n    the EA IFF85 specifications (see \\Ref{IFFByteStream.h}).  Gray level IW44\n    Images consist of a single #\"FORM:BM44\"# chunk composed of an arbitrary\n    number of #\"BM44\"# data chunks.  Color IW44 Images consist of a single\n    #\"FORM:PM44\"# chunk composed of an arbitrary number of #\"PM44\"# data\n    chunks.  The successive #\"PM44\"# or #\"BM44\"# data chunks contain\n    successive refinements of the encoded image.  Each chunk contains a\n    certain number of ``data slices''.  The first chunk also contains a small\n    image header.  You can use program \\Ref{djvuinfo} to display all this\n    structural information:\n    \\begin{verbatim}\n    % djvuinfo lag.iw4\n    lag.iw4:\n      FORM:PM44 [62598] \n        PM44 [10807]              #1 - 74 slices - v1.2 (color) - 684x510\n        PM44 [23583]              #2 - 13 slices \n        PM44 [28178]              #3 - 10 slices \n    \\end{verbatim}\n\n    {\\bf Embedded IW44 Images} --- These IW44 data chunks can also appear within\n    other contexts.  Files representing a DjVu page, for instance, consist of\n    a single #\"FORM:DJVU\"# composite chunk.  This composite chunk may contain\n    #\"BG44\"# chunks encoding the background layer and #\"FG44\"# chunks encoding\n    the foreground color layer.  These #\"BG44\"# and #\"FG44\"# chunks are\n    actually regular IW44 data chunks with a different chunk identifier.  This\n    information too can be displayed using program \\Ref{djvuinfo}.\n    \\begin{verbatim}\n    % djvuinfo graham1.djvu \n    graham1.djvu:\n      FORM:DJVU [32553] \n        INFO [5]            3156x2325, version 17\n        Sjbz [17692] \n        BG44 [2570]         #1 - 74 slices - v1.2 (color) - 1052x775\n        FG44 [1035]         #1 - 100 slices - v1.2 (color) - 263x194\n        BG44 [3048]         #2 - 10 slices \n        BG44 [894]          #3 - 4 slices \n        BG44 [7247]         #4 - 9 slices \n    \\end{verbatim}\n\n    {\\bf Performance} --- The main design objective for the DjVu wavelets\n    consisted of allowing progressive rendering and smooth scrolling of large\n    images with limited memory requirements.  Decoding functions process the\n    compressed data and update a memory efficient representation of the\n    wavelet coefficients.  Imaging function then can quickly render an\n    arbitrary segment of the image using the available data.  Both process can\n    be carried out in two threads of execution.  This design plays an\n    important role in the DjVu system.  We have investigated various\n    state-of-the-art wavelet compression schemes: although these schemes may\n    achieve slightly smaller file sizes, the decoding functions did not even\n    approach our requirements.  \n\n    The IW44 wavelets satisfy these requirements today. It performs very well\n    for quality settings resulting in high compression ratios.  It should not\n    be used for quasi-lossless compression because certain design choices\n    deliberately sacrifice the IW44 quasi-lossless performance in order to\n    improve the image quality at high compression ratios.\n\n    Little care however has been taken to make the IW44 encoder memory\n    efficient.  This code uses two copies of the wavelet coefficient data\n    structure (one for the raw coefficients, one for the quantized\n    coefficients).  A more sophisticated implementation should considerably\n    reduce the memory requirements.\n\n    {\\bf Masking} --- When we create a DjVu image, we often know that certain\n    pixels of the background image are going to be covered by foreground\n    objects like text or drawings.  The DjVu IW44 wavelet decomposition\n    routine can use an optional bilevel image named the mask.  Every non zero\n    pixel in the mask means the value of the corresponding pixel in the\n    background image is irrelevant.  The wavelet decomposition code will\n    replace these masked pixels by a color value whose coding cost is minimal\n    (see \\URL{http://www.research.att.com/~leonb/DJVU/mask}).\n\n    {\\bf ToDo} --- There are many improvements to be made.  Besides better\n    quantization algorithms (such as trellis quantization and bitrate\n    allocation), we should allow for more wavelet transforms.  These\n    improvements may be implemented in future version, if (and only if) they\n    can meet our decoding constraints.  Future versions will probably split\n    file #\"IW44Image.cpp\"# which currently contains everything.\n \n    @memo\n    Wavelet encoded images.\n    @author\n    L\\'eon Bottou <leonb@research.att.com>\n\n// From: Leon Bottou, 1/31/2002\n// Lizardtech has split the corresponding cpp file into a decoder and an encoder.\n// Only superficial changes.  The meat is mine.\n\n*/\n//@{\n\n\n#include \"GSmartPointer.h\"\n#include \"ZPCodec.h\"\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass GRect;\nclass IFFByteStream;\nclass ByteStream;\nclass GBitmap;\nclass GPixmap;\n\n\n\n/** IW44 encoding parameters.  \n    This data structure gathers the quality specification parameters needed\n    for encoding each chunk of an IW44 file.  Chunk data is generated until\n    meeting either the slice target, the size target or the decibel target.  */\n\nstruct DJVUAPI IWEncoderParms \n{\n  /** Slice target.  Data generation for the current chunk stops if the total\n      number of slices (in this chunk and all the previous chunks) reaches\n      value #slice#.  The default value #0# has a special meaning: data will\n      be generated regardless of the number of slices in the file. */\n  int    slices;\n  /** Size target.  Data generation for the current chunk stops if the total\n      data size (in this chunk and all the previous chunks), expressed in\n      bytes, reaches value #size#.  The default value #0# has a special\n      meaning: data will be generated regardless of the file size. */\n  int    bytes;\n  /** Decibel target.  Data generation for the current chunk stops if the\n      estimated luminance error, expressed in decibels, reaches value\n      #decibel#.  The default value #0# has a special meaning: data will be\n      generated regardless of the estimated luminance error.  Specifying value\n      #0# in fact shortcuts the computation of the estimated luminance error\n      and sensibly speeds up the encoding process.  */\n  float  decibels;\n  /** Constructor. Initializes the structure with the default values. */\n  IWEncoderParms(void);\n};\n\n\n\n/** IW44 encoded gray-level and color images.  This class acts as a base for\n    images represented as a collection of IW44 wavelet coefficients.  The\n    coefficients are stored in a memory efficient data structure.  Member\n    function \\Ref{get_bitmap} renders an arbitrary segment of the image into\n    a \\Ref{GBitmap}.  Member functions \\Ref{decode_iff} and \\Ref{encode_iff}\n    read and write DjVu IW44 files (see \\Ref{IW44Image.h}).  Both the copy\n    constructor and the copy operator are declared as private members. It is\n    therefore not possible to make multiple copies of instances of this\n    class. */\n\nclass DJVUAPI IW44Image : public GPEnabled\n{\npublic:\n  /** Chrominance processing selector.  The following constants may be used as\n      argument to the following \\Ref{IWPixmap} constructor to indicate how the\n      chrominance information should be processed. There are four possible values:\n      \\begin{description}\n      \\item[CRCBnone:] The wavelet transform will discard the chrominance \n           information and only keep the luminance. The image will show in shades of gray.\n      \\item[CRCBhalf:] The wavelet transform will process the chrominance at only \n           half the image resolution. This option creates smaller files but may create\n           artifacts in highly colored images.\n      \\item[CRCBnormal:] The wavelet transform will process the chrominance at full \n           resolution. This is the default.\n      \\item[CRCBfull:] The wavelet transform will process the chrominance at full \n           resolution. This option also disables the chrominance encoding delay\n           (see \\Ref{parm_crcbdelay}) which usually reduces the bitrate associated with the\n           chrominance information.\n      \\end{description} */\n  enum CRCBMode { \n    CRCBnone, \n    CRCBhalf, \n    CRCBnormal, \n    CRCBfull };\n  class Transform;\n  class Map;\n  class Block;\n  class Codec;\n  struct Alloc;\n  struct PrimaryHeader;\n  struct SecondaryHeader;\n  struct TertiaryHeader;\n  enum ImageType {\n    GRAY=false,\n    COLOR=true };\nprotected:\n  IW44Image(void);\npublic:\n  /** Null constructor.  Constructs an empty IW44Image object. This object does\n      not contain anything meaningful. You must call function \\Ref{init},\n      \\Ref{decode_iff} or \\Ref{decode_chunk} to populate the wavelet\n      coefficient data structure. You may not use \\Ref{encode_iff} or \n      \\Ref{encode_chunk}. */\n  static GP<IW44Image> create_decode(const ImageType itype=COLOR);\n  /** Null constructor.  Constructs an empty IW44Image object. This object does\n      not contain anything meaningful. You must call function \\Ref{init},\n      \\Ref{decode_iff} or \\Ref{decode_chunk} to populate the wavelet\n      coefficient data structure.  You may then use \\Ref{encode_iff}\n      and \\Ref{encode_chunk}. */\n  static GP<IW44Image> create_encode(const ImageType itype=COLOR);\n  // virtual destructor\n  virtual ~IW44Image();\n  /** Initializes an IWBitmap with image #bm#.  This constructor\n      performs the wavelet decomposition of image #bm# and records the\n      corresponding wavelet coefficient.  Argument #mask# is an optional\n      bilevel image specifying the masked pixels (see \\Ref{IW44Image.h}). */\n  static GP<IW44Image> create_encode(const GBitmap &bm, const GP<GBitmap> mask=0);\n  /** Initializes an IWPixmap with color image #bm#.  This constructor\n      performs the wavelet decomposition of image #bm# and records the\n      corresponding wavelet coefficient.  Argument #mask# is an optional\n      bilevel image specifying the masked pixels (see \\Ref{IW44Image.h}).\n      Argument #crcbmode# specifies how the chrominance information should be\n      encoded (see \\Ref{CRCBMode}). */\n  static GP<IW44Image> create_encode(const GPixmap &bm, const GP<GBitmap> mask=0, CRCBMode crcbmode=CRCBnormal);\n  // ACCESS\n  /** Returns the width of the IWBitmap image. */\n  int get_width(void) const;\n  /** Returns the height of the IWBitmap image. */\n  int get_height(void) const;\n  /** Reconstructs the complete image.  The reconstructed image\n      is then returned as a GBitmap object. */\n  virtual GP<GBitmap> get_bitmap(void) {return 0;}\n  /** Reconstructs a segment of the image at a given scale.  The subsampling\n      ratio #subsample# must be a power of two between #1# and #32#.  Argument\n      #rect# specifies which segment of the subsampled image should be\n      reconstructed.  The reconstructed image is returned as a GBitmap object\n      whose size is equal to the size of the rectangle #rect#. */\n  virtual GP<GBitmap> get_bitmap(int subsample, const GRect &rect) {return 0;}\n  /** Reconstructs the complete image.  The reconstructed image\n      is then returned as a GPixmap object. */\n  virtual GP<GPixmap> get_pixmap(void) {return 0;}\n  /** Reconstructs a segment of the image at a given scale.  The subsampling\n      ratio #subsample# must be a power of two between #1# and #32#.  Argument\n      #rect# specifies which segment of the subsampled image should be\n      reconstructed.  The reconstructed image is returned as a GPixmap object\n      whose size is equal to the size of the rectangle #rect#. */\n  virtual GP<GPixmap> get_pixmap(int subsample, const GRect &rect) {return 0;}\n  /** Returns the amount of memory used by the wavelet coefficients.  This\n      amount of memory is expressed in bytes. */\n  virtual unsigned int get_memory_usage(void) const = 0;\n  /** Returns the filling ratio of the internal data structure.  Wavelet\n      coefficients are stored in a sparse array.  This function tells what\n      percentage of bins have been effectively allocated. */\n  virtual int get_percent_memory(void) const = 0;\n  // CODER\n  /** Encodes one data chunk into ByteStream #bs#.  Parameter #parms# controls\n      how much data is generated.  The chunk data is written to ByteStream\n      #bs# with no IFF header.  Successive calls to #encode_chunk# encode\n      successive chunks.  You must call #close_codec# after encoding the last\n      chunk of a file. */\n  virtual int  encode_chunk(GP<ByteStream> gbs, const IWEncoderParms &parms);\n  /** Writes a gray level image into DjVu IW44 file.  This function creates a\n      composite chunk (identifier #FORM:BM44# or #FORM:PM44#) composed of\n      #nchunks# chunks (identifier #BM44# or #PM44#).  Data for each chunk is\n      generated with #encode_chunk# using the corresponding parameters in\n      array #parms#. */\n  virtual void encode_iff(IFFByteStream &iff, int nchunks, const IWEncoderParms *parms);\n  // DECODER\n  /** Decodes one data chunk from ByteStream #bs#.  Successive calls to\n      #decode_chunk# decode successive chunks.  You must call #close_codec#\n      after decoding the last chunk of a file.  Note that function\n      #get_bitmap# and #decode_chunk# may be called simultaneously from two\n      execution threads. */\n  virtual int  decode_chunk(GP<ByteStream> gbs) = 0;\n  /** This function enters a composite chunk (identifier #FORM:BM44#, or\n      #FORM:PM44#), and decodes a maximum of #maxchunks# data chunks\n      (identifier #BM44#).  Data for each chunk is processed using the\n      function #decode_chunk#. */\n  virtual void decode_iff(IFFByteStream &iff, int maxchunks=999) = 0;\n  // MISCELLANEOUS\n  /** Resets the encoder/decoder state.  The first call to #decode_chunk# or\n      #encode_chunk# initializes the coder for encoding or decoding.  Function\n      #close_codec# must be called after processing the last chunk in order to\n      reset the coder and release the associated memory. */\n  virtual void close_codec(void) = 0;\n  /** Returns the chunk serial number.  This function returns the serial\n      number of the last chunk encoded with #encode_chunk# or decoded with\n      #decode_chunk#. The first chunk always has serial number #1#. Successive\n      chunks have increasing serial numbers.  Value #0# is returned if this\n      function is called before calling #encode_chunk# or #decode_chunk# or\n      after calling #close_codec#. */\n  virtual int get_serial(void) = 0;\n  /** Sets the chrominance delay parameter.  This function can be called\n      before encoding the first color IW44 data chunk.  Parameter #parm# is an\n      encoding delay which reduces the bitrate associated with the\n      chrominance information. The default chrominance encoding delay is 10. */\n  virtual int  parm_crcbdelay(const int parm) {return parm;}\n  /** Sets the #dbfrac# parameter.  This function can be called before\n      encoding the first IW44 data chunk.  Parameter #frac# modifies the\n      decibel estimation algorithm in such a way that the decibel target only\n      pertains to the average error of the fraction #frac# of the most\n      misrepresented 32x32 pixel blocks.  Setting arguments #frac# to #1.0#\n      restores the normal behavior.  */\n  virtual void parm_dbfrac(float frac) = 0;\nprotected:\n  // Parameter\n  float db_frac;\n  // Data\n  Map *ymap, *cbmap, *crmap;\n  int cslice;\n  int cserial;\n  int cbytes;\nprivate:\n  // Disable assignment semantic\n  IW44Image(const IW44Image &ref);\n  IW44Image& operator=(const IW44Image &ref);\n};\n\n#ifdef IW44IMAGE_IMPLIMENTATION\n\n/*x IW44 encoded gray-level image.  This class provided functions for managing\n    a gray level image represented as a collection of IW44 wavelet\n    coefficients.  The coefficients are stored in a memory efficient data\n    structure.  Member function \\Ref{get_bitmap} renders an arbitrary segment\n    of the image into a \\Ref{GBitmap}.  Member functions \\Ref{decode_iff} and\n    \\Ref{encode_iff} read and write DjVu IW44 files (see \\Ref{IW44Image.h}).\n    Both the copy constructor and the copy operator are declared as private\n    members. It is therefore not possible to make multiple copies of instances\n    of this class. */\n\nclass DJVUAPI IWBitmap : public IW44Image\n{\npublic:\n  friend class IW44Image;\n  class Encode;\nprotected:\n  /*x Null constructor.  Constructs an empty IWBitmap object. This object does\n      not contain anything meaningful. You must call function \\Ref{init},\n      \\Ref{decode_iff} or \\Ref{decode_chunk} to populate the wavelet\n      coefficient data structure. */\n  IWBitmap(void);\npublic:\n  //x virtual destructor\n  virtual ~IWBitmap();\n  //x ACCESS\n  /*x Reconstructs the complete image.  The reconstructed image\n      is then returned as a GBitmap object. */\n  virtual GP<GBitmap> get_bitmap(void);\n  /*x Reconstructs a segment of the image at a given scale.  The subsampling\n      ratio #subsample# must be a power of two between #1# and #32#.  Argument\n      #rect# specifies which segment of the subsampled image should be\n      reconstructed.  The reconstructed image is returned as a GBitmap object\n      whose size is equal to the size of the rectangle #rect#. */\n  virtual GP<GBitmap> get_bitmap(int subsample, const GRect &rect);\n  /*x Returns the amount of memory used by the wavelet coefficients.  This\n      amount of memory is expressed in bytes. */\n  virtual unsigned int get_memory_usage(void) const;\n  /*x Returns the filling ratio of the internal data structure.  Wavelet\n      coefficients are stored in a sparse array.  This function tells what\n      percentage of bins have been effectively allocated. */\n  virtual int get_percent_memory(void) const;\n  // DECODER\n  /*x Decodes one data chunk from ByteStream #bs#.  Successive calls to\n      #decode_chunk# decode successive chunks.  You must call #close_codec#\n      after decoding the last chunk of a file.  Note that function\n      #get_bitmap# and #decode_chunk# may be called simultaneously from two\n      execution threads. */\n  virtual int  decode_chunk(GP<ByteStream> gbs);\n  /*x Reads a DjVu IW44 file as a gray level image.  This function enters a\n      composite chunk (identifier #FORM:BM44#), and decodes a maximum of\n      #maxchunks# data chunks (identifier #BM44#).  Data for each chunk is\n      processed using the function #decode_chunk#. */\n  virtual void decode_iff(IFFByteStream &iff, int maxchunks=999);\n  // MISCELLANEOUS\n  /*x Resets the encoder/decoder state.  The first call to #decode_chunk# or\n      #encode_chunk# initializes the coder for encoding or decoding.  Function\n      #close_codec# must be called after processing the last chunk in order to\n      reset the coder and release the associated memory. */\n  virtual void close_codec(void);\n  /*x Returns the chunk serial number.  This function returns the serial\n      number of the last chunk encoded with #encode_chunk# or decoded with\n      #decode_chunk#. The first chunk always has serial number #1#. Successive\n      chunks have increasing serial numbers.  Value #0# is returned if this\n      function is called before calling #encode_chunk# or #decode_chunk# or\n      after calling #close_codec#. */\n  virtual int get_serial(void);\n  /*x Sets the #dbfrac# parameter.  This function can be called before\n      encoding the first IW44 data chunk.  Parameter #frac# modifies the\n      decibel estimation algorithm in such a way that the decibel target only\n      pertains to the average error of the fraction #frac# of the most\n      misrepresented 32x32 pixel blocks.  Setting arguments #frac# to #1.0#\n      restores the normal behavior.  */\n  virtual void parm_dbfrac(float frac);\nprivate:\n  Codec *ycodec;\n};\n\n\n/*x IW44 encoded color image. This class provided functions for managing a\n    color image represented as a collection of IW44 wavelet coefficients.  The\n    coefficients are stored in a memory efficient data structure.  Member\n    function \\Ref{get_pixmap} renders an arbitrary segment of the image into a\n    \\Ref{GPixmap}.  Member functions \\Ref{decode_iff} and \\Ref{encode_iff}\n    read and write DjVu IW44 files (see \\Ref{IW44Image.h}).  Both the copy\n    constructor and the copy operator are declared as private members. It is\n    therefore not possible to make multiple copies of instances of this\n    class. */\n\nclass DJVUAPI IWPixmap : public IW44Image\n{\npublic:\n  friend class IW44Image;\nprotected:\n  class Encode;\n  /*x Null constructor.  Constructs an empty IWPixmap object. This object does\n      not contain anything meaningful. You must call function \\Ref{init},\n      \\Ref{decode_iff} or \\Ref{decode_chunk} to populate the wavelet\n      coefficient data structure. */\n  IWPixmap(void);\npublic:\n  // virtual destructor\n  virtual ~IWPixmap();\n  // ACCESS\n  /*x Reconstructs the complete image.  The reconstructed image\n      is then returned as a GPixmap object. */\n  virtual GP<GPixmap> get_pixmap(void);\n  /*x Reconstructs a segment of the image at a given scale.  The subsampling\n      ratio #subsample# must be a power of two between #1# and #32#.  Argument\n      #rect# specifies which segment of the subsampled image should be\n      reconstructed.  The reconstructed image is returned as a GPixmap object\n      whose size is equal to the size of the rectangle #rect#. */\n  virtual GP<GPixmap> get_pixmap(int subsample, const GRect &rect);\n  /*x Returns the amount of memory used by the wavelet coefficients.  This\n      amount of memory is expressed in bytes. */\n  virtual unsigned int get_memory_usage(void) const;\n  /*x Returns the filling ratio of the internal data structure.  Wavelet\n      coefficients are stored in a sparse array.  This function tells what\n      percentage of bins have been effectively allocated. */\n  virtual int get_percent_memory(void) const;\n  // DECODER\n  /*x Decodes one data chunk from ByteStream #bs#.  Successive calls to\n      #decode_chunk# decode successive chunks.  You must call #close_codec#\n      after decoding the last chunk of a file.  Note that function\n      #get_bitmap# and #decode_chunk# may be called simultaneously from two\n      execution threads. */\n  virtual int  decode_chunk(GP<ByteStream> gbs);\n  /*x Reads a DjVu IW44 file as a color image.  This function enters a\n      composite chunk (identifier #FORM:PM44# or #FORM:BM44#), and decodes a\n      maximum of #maxchunks# data chunks (identifier #PM44# or #BM44#).  Data\n      for each chunk is processed using the function #decode_chunk#. */\n  virtual void decode_iff(IFFByteStream &iff, int maxchunks=999);\n  // MISCELLANEOUS\n  /*x Resets the encoder/decoder state.  The first call to #decode_chunk# or\n      #encode_chunk# initializes the coder for encoding or decoding.  Function\n      #close_codec# must be called after processing the last chunk in order to\n      reset the coder and release the associated memory. */\n  virtual void close_codec(void);\n  /*x Returns the chunk serial number.  This function returns the serial\n      number of the last chunk encoded with #encode_chunk# or decoded with\n      #decode_chunk#. The first chunk always has serial number #1#. Successive\n      chunks have increasing serial numbers.  Value #0# is returned if this\n      function is called before calling #encode_chunk# or #decode_chunk# or\n      after calling #close_codec#. */\n  virtual int  get_serial(void);\n  /*x Sets the chrominance delay parameter.  This function can be called\n      before encoding the first IW44 data chunk.  Parameter #parm# is an\n      encoding delay which reduces the bitrate associated with the\n      chrominance information. The default chrominance encoding delay is 10. */\n  virtual int  parm_crcbdelay(const int parm);\n  /*x Sets the #dbfrac# parameter.  This function can be called before\n      encoding the first IW44 data chunk.  Parameter #frac# modifies the\n      decibel estimation algorithm in such a way that the decibel target only\n      pertains to the average error of the fraction #frac# of the most\n      misrepresented 32x32 pixel blocks.  Setting arguments #frac# to #1.0#\n      restores the normal behavior.  */\n  virtual void parm_dbfrac(float frac);\nprotected:\n  // Parameter\n  int   crcb_delay;\n  int   crcb_half;\n  // Data\nprivate:\n  Codec *ycodec, *cbcodec, *crcodec;\n};\n\n/*x IW44Transform.\n*/\nclass IW44Image::Transform\n{\npublic:\n  class Decode;\n  class Encode;\nprotected:\n  static void filter_begin(int w, int h);\n  static void filter_end(void);\n};\n\nstruct GPixel;\nclass IW44Image::Transform::Decode : public IW44Image::Transform\n{\npublic:\n // WAVELET TRANSFORM\n  /*x Forward transform. */\n  static void backward(short *p, int w, int h, int rowsize, int begin, int end);\n  \n  // COLOR TRANSFORM\n  /*x Converts YCbCr to RGB. */\n  static void YCbCr_to_RGB(GPixel *p, int w, int h, int rowsize);\n};\n\n//---------------------------------------------------------------\n// *** Class IW44Image::Block [declaration]\n// Represents a block of 32x32 coefficients after zigzagging and scaling\n\n\nclass IW44Image::Block // DJVU_CLASS\n{\npublic:\n  // creating\n  Block(void);\n  // accessing scaled coefficients\n  short get(int n) const;\n  void  set(int n, int val, IW44Image::Map *map);\n  // converting from liftblock\n  void  read_liftblock(const short *coeff, IW44Image::Map *map);\n  void  write_liftblock(short *coeff, int bmin=0, int bmax=64) const;\n  // sparse array access\n  const short* data(int n) const;\n  short* data(int n, IW44Image::Map *map);\n  void   zero(int n);\n  // sparse representation\nprivate:\n  short **(pdata[4]);\n};\n\n//---------------------------------------------------------------\n// *** Class IW44Image::Map [declaration]\n// Represents all the blocks of an image\n\nclass IW44Image::Map // DJVU_CLASS\n{\npublic:\n  class Encode;\n\n  // construction\n  Map(int w, int h);\n  ~Map();\n  // image access\n  void image(signed char *img8, int rowsize, \n             int pixsep=1, int fast=0);\n  void image(int subsample, const GRect &rect, \n             signed char *img8, int rowsize, \n             int pixsep=1, int fast=0);\n  // array of blocks\n  IW44Image::Block *blocks;\n  // geometry\n  int iw, ih;\n  int bw, bh;\n  int nb;\n  // coefficient allocation stuff\n  short *alloc(int n);\n  short **allocp(int n);\n  IW44Image::Alloc *chain;\n  int top;\n  // statistics\n  int get_bucket_count(void) const;\n  unsigned int get_memory_usage(void) const;\n};\n\n//////////////////////////////////////////////////////\n// ENCODING/DECODING WAVELET COEFFICIENTS \n//    USING HIERARCHICAL SET DIFFERENCE\n//////////////////////////////////////////////////////\n\n\n//-----------------------------------------------\n// Class IW44Image::Codec [declaration+implementation]\n// Maintains information shared while encoding or decoding\n\nclass IW44Image::Codec \n{\npublic:\n  class Decode;\n  class Encode;\n\nprotected:\n  // Construction\n  Codec(IW44Image::Map &map);\npublic:\n  virtual ~Codec();\n  // Coding\n  int finish_code_slice(ZPCodec &zp);\n  virtual int code_slice(ZPCodec &zp) = 0;\n  // Data\n  IW44Image::Map &map;                  // working map\n  // status\n  int curband;                  // current band\n  int curbit;                   // current bitplane\n  // quantization tables\n  int quant_hi[10];             // quantization for bands 1 to 9\n  int quant_lo[16];             // quantization for band 0.\n  // bucket state\n  char coeffstate[256];\n  char bucketstate[16];\n  enum { ZERO   = 1,            // this coeff never hits this bit\n         ACTIVE = 2,            // this coeff is already active\n         NEW    = 4,            // this coeff is becoming active\n         UNK    = 8 };          // this coeff may become active\n  // coding context\n  BitContext ctxStart [32];\n  BitContext ctxBucket[10][8];\n  BitContext ctxMant;\n  BitContext ctxRoot;\n  // helper\n  int is_null_slice(int bit, int band);\n  int decode_prepare(int fbucket, int nbucket, IW44Image::Block &blk);\n  void decode_buckets(ZPCodec &zp, int bit, int band,\n    IW44Image::Block &blk, int fbucket, int nbucket);\n};\n\n//////////////////////////////////////////////////////\n// DEFINITION OF CHUNK HEADERS\n//////////////////////////////////////////////////////\n\n\nstruct IW44Image::PrimaryHeader {\n  unsigned char serial;\n  unsigned char slices;\n  void encode(GP<ByteStream> gbs);\n  void decode(GP<ByteStream> gbs);\n};  \n\nstruct IW44Image::SecondaryHeader {\n  unsigned char major;\n  unsigned char minor;\n  void encode(GP<ByteStream> gbs);\n  void decode(GP<ByteStream> gbs);\n};\n\nstruct IW44Image::TertiaryHeader {\n  unsigned char xhi, xlo;\n  unsigned char yhi, ylo;\n  unsigned char crcbdelay;\n  void encode(GP<ByteStream> gbs);\n  void decode(GP<ByteStream> gbs, int major=1, int minor=2);\n};\n\ninline const short* \nIW44Image::Block::data(int n) const\n{\n  if (! pdata[n>>4])\n    return 0;\n  return pdata[n>>4][n&15];\n}\n\ninline short* \nIW44Image::Block::data(int n, IW44Image::Map *map)\n{\n  if (! pdata[n>>4])\n    pdata[n>>4] = map->allocp(16);\n  if (! pdata[n>>4][n &15])\n    pdata[n>>4][n &15] = map->alloc(16);\n  return pdata[n>>4][n&15];\n}\n\ninline short \nIW44Image::Block::get(int n) const\n{\n  int n1 = (n>>4);\n  const short *d = data(n1);\n  if (! d)\n    return 0;\n  return d[n&15];\n}\n\ninline void  \nIW44Image::Block::set(int n, int val, IW44Image::Map *map)\n{\n  int n1 = (n>>4);\n  short* d = data(n1, map);\n  d[n&15] = val;\n}\n\n#endif /* IW44IMAGE_IMPLIMENTATION */\n\n//@}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/JB2EncodeCodec.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n// From: Leon Bottou, 1/31/2002\n// Lizardtech has split the corresponding cpp file into a decoder and an encoder.\n// Only superficial changes.  The meat is mine.\n\n#ifndef NEED_DECODER_ONLY\n\n#include \"JB2Image.h\"\n#include \"GBitmap.h\"\n#include <string.h>\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n////////////////////////////////////////\n//// CLASS JB2Codec::Encode:  DECLARATION\n////////////////////////////////////////\n\n// This class is accessed via the encode\n// functions of class JB2Image\n\n\n//**** Class JB2Codec\n// This class implements the JB2 coder.\n// Contains all contextual information for encoding a JB2Image.\n\nclass JB2Dict::JB2Codec::Encode : public JB2Dict::JB2Codec\n{\npublic:\n  Encode(void);\n  void init(const GP<ByteStream> &gbs);\n//virtual\n  void code(const GP<JB2Image> &jim);\n  void code(JB2Image *jim) { const GP<JB2Image> gjim(jim);code(gjim); }\n  void code(const GP<JB2Dict> &jim);\n  void code(JB2Dict *jim) { const GP<JB2Dict> gjim(jim);code(gjim); }\n\nprotected:\n  void CodeNum(const int num, const int lo, const int hi, NumContext &ctx);\n  void encode_libonly_shape(const GP<JB2Image> &jim, int shapeno);\n// virtual\n  bool CodeBit(const bool bit, BitContext &ctx);\n  void code_comment(GUTF8String &comment);\n  void code_record_type(int &rectype);\n  int code_match_index(int &index, JB2Dict &jim);\n  void code_inherited_shape_count(JB2Dict &jim);\n  void code_image_size(JB2Dict &jim);\n  void code_image_size(JB2Image &jim);\n  void code_absolute_location(JB2Blit *jblt,  int rows, int columns);\n  void code_absolute_mark_size(GBitmap &bm, int border=0);\n  void code_relative_mark_size(GBitmap &bm, int cw, int ch, int border=0);\n  void code_bitmap_directly(GBitmap &bm,const int dw, int dy,\n    unsigned char *up2, unsigned char *up1, unsigned char *up0 );\n  int get_diff(const int x_diff,NumContext &rel_loc);\n  void code_bitmap_by_cross_coding (GBitmap &bm, GBitmap &cbm,\n    const int xd2c, const int dw, int dy, int cy,\n    unsigned char *up1, unsigned char *up0, unsigned char *xup1, \n    unsigned char *xup0, unsigned char *xdn1 );\n\nprivate:\n  GP<ZPCodec> gzp;\n};\n\n\n////////////////////////////////////////\n//// CLASS JB2DICT: IMPLEMENTATION\n////////////////////////////////////////\n\nvoid \nJB2Dict::encode(const GP<ByteStream> &gbs) const\n{\n  JB2Codec::Encode codec;\n  codec.init(gbs);\n  codec.code(const_cast<JB2Dict *>(this));\n}\n\n////////////////////////////////////////\n//// CLASS JB2IMAGE: IMPLEMENTATION\n////////////////////////////////////////\n\nvoid \nJB2Image::encode(const GP<ByteStream> &gbs) const\n{\n  JB2Codec::Encode codec;\n  codec.init(gbs);\n  codec.code(const_cast<JB2Image *>(this));\n}\n\n////////////////////////////////////////\n//// CLASS JB2CODEC : IMPLEMENTATION\n////////////////////////////////////////\n\n#define START_OF_DATA                   (0)\n#define NEW_MARK                        (1)\n#define NEW_MARK_LIBRARY_ONLY           (2)\n#define NEW_MARK_IMAGE_ONLY             (3)\n#define MATCHED_REFINE                  (4)\n#define MATCHED_REFINE_LIBRARY_ONLY     (5)\n#define MATCHED_REFINE_IMAGE_ONLY       (6)\n#define MATCHED_COPY                    (7)\n#define NON_MARK_DATA                   (8)\n#define REQUIRED_DICT_OR_RESET          (9)\n#define PRESERVED_COMMENT               (10)\n#define END_OF_DATA                     (11)\n\n// STATIC DATA MEMBERS\n\nstatic const int BIGPOSITIVE = 262142;\nstatic const int BIGNEGATIVE = -262143;\nstatic const int CELLCHUNK = 20000;\nstatic const int CELLEXTRA =   500;\n\n// CONSTRUCTOR\n\nJB2Dict::JB2Codec::Encode::Encode(void)\n: JB2Dict::JB2Codec(1) {}\n\nvoid\nJB2Dict::JB2Codec::Encode::init(const GP<ByteStream> &gbs)\n{\n  gzp=ZPCodec::create(gbs,true,true);\n}\n\ninline bool\nJB2Dict::JB2Codec::Encode::CodeBit(const bool bit, BitContext &ctx)\n{\n    gzp->encoder(bit?1:0, ctx);\n    return bit;\n}\n\nvoid\nJB2Dict::JB2Codec::Encode::CodeNum(int num, int low, int high, NumContext &ctx)\n{\n  if (num < low || num > high)\n    G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n  JB2Codec::CodeNum(low,high,&ctx,num);\n}\n\n// CODE COMMENTS\n\nvoid \nJB2Dict::JB2Codec::Encode::code_comment(GUTF8String &comment)\n{\n  // Encode size\n      int size=comment.length();\n      CodeNum(size, 0, BIGPOSITIVE, dist_comment_length);\n      for (int i=0; i<size; i++) \n        {\n          CodeNum(comment[i], 0, 255, dist_comment_byte);\n        }\n}\n\n// CODE SIMPLE VALUES\n\ninline void \nJB2Dict::JB2Codec::Encode::code_record_type(int &rectype)\n{\n  CodeNum(rectype, START_OF_DATA, END_OF_DATA, dist_record_type);\n}\n\nint \nJB2Dict::JB2Codec::Encode::code_match_index(int &index, JB2Dict &jim)\n{\n    int match=shape2lib[index];\n    CodeNum(match, 0, lib2shape.hbound(), dist_match_index);\n    return match;\n}\n\n// CODE PAIRS\n\nvoid\nJB2Dict::JB2Codec::Encode::code_inherited_shape_count(JB2Dict &jim)\n{\n  CodeNum(jim.get_inherited_shape_count(),\n    0, BIGPOSITIVE, inherited_shape_count_dist);\n}\n\nvoid \nJB2Dict::JB2Codec::Encode::code_image_size(JB2Dict &jim)\n{\n  CodeNum(0, 0, BIGPOSITIVE, image_size_dist);\n  CodeNum(0, 0, BIGPOSITIVE, image_size_dist);\n  JB2Codec::code_image_size(jim);\n}\n\nvoid \nJB2Dict::JB2Codec::Encode::code_image_size(JB2Image &jim)\n{\n  image_columns = jim.get_width();\n  CodeNum(image_columns, 0, BIGPOSITIVE, image_size_dist);\n  image_rows = jim.get_height();\n  CodeNum(image_rows, 0, BIGPOSITIVE, image_size_dist);\n  JB2Codec::code_image_size(jim);\n}\n\ninline int\nJB2Dict::JB2Codec::Encode::get_diff(int x_diff,NumContext &rel_loc)\n{\n   CodeNum(x_diff, BIGNEGATIVE, BIGPOSITIVE, rel_loc);\n   return x_diff;\n}\n\nvoid \nJB2Dict::JB2Codec::Encode::code_absolute_location(JB2Blit *jblt, int rows, int columns)\n{\n  // Check start record\n  if (!gotstartrecordp)\n    G_THROW( ERR_MSG(\"JB2Image.no_start\") );\n  // Code TOP and LEFT\n  CodeNum(jblt->left+1, 1, image_columns, abs_loc_x);\n  CodeNum(jblt->bottom+rows-1+1, 1, image_rows, abs_loc_y);\n}\n\nvoid \nJB2Dict::JB2Codec::Encode::code_absolute_mark_size(GBitmap &bm, int border)\n{\n  CodeNum(bm.columns(), 0, BIGPOSITIVE, abs_size_x);\n  CodeNum(bm.rows(), 0, BIGPOSITIVE, abs_size_y);\n}\n\nvoid \nJB2Dict::JB2Codec::Encode::code_relative_mark_size(GBitmap &bm, int cw, int ch, int border)\n{\n  CodeNum(bm.columns()-cw, BIGNEGATIVE, BIGPOSITIVE, rel_size_x);\n  CodeNum(bm.rows()-ch, BIGNEGATIVE, BIGPOSITIVE, rel_size_y);\n}\n\n// CODE BITMAP DIRECTLY\n\nvoid \nJB2Dict::JB2Codec::Encode::code_bitmap_directly(\n  GBitmap &bm,const int dw, int dy,\n  unsigned char *up2, unsigned char *up1, unsigned char *up0 )\n{\n      ZPCodec &zp=*gzp;\n      // iterate on rows (encoding)\n      while (dy >= 0)\n        {\n          int context=get_direct_context(up2, up1, up0, 0);\n          for (int dx=0;dx < dw;)\n            {\n              int n = up0[dx++];\n              zp.encoder(n, bitdist[context]);\n              context=shift_direct_context(context, n, up2, up1, up0, dx);\n            }\n          // next row\n          dy -= 1;\n          up2 = up1;\n          up1 = up0;\n          up0 = bm[dy];\n        }\n}\n\n// CODE BITMAP BY CROSS CODING\n\nvoid \nJB2Dict::JB2Codec::Encode::code_bitmap_by_cross_coding (GBitmap &bm, GBitmap &cbm,\n  const int xd2c, const int dw, int dy, int cy,\n  unsigned char *up1, unsigned char *up0, unsigned char *xup1, \n  unsigned char *xup0, unsigned char *xdn1 )\n{\n      ZPCodec &zp=*gzp;\n      // iterate on rows (encoding)\n      while (dy >= 0)\n        {\n          int context=get_cross_context(up1, up0, xup1, xup0, xdn1, 0);\n          for(int dx=0;dx < dw;)\n            {\n              const int n = up0[dx++];\n              zp.encoder(n, cbitdist[context]);\n              context=shift_cross_context(context, n,  \n                                  up1, up0, xup1, xup0, xdn1, dx);\n            }\n          // next row\n          up1 = up0;\n          up0 = bm[--dy];\n          xup1 = xup0;\n          xup0 = xdn1;\n          xdn1 = cbm[(--cy)-1] + xd2c;\n        }\n}\n\n// CODE JB2DICT\n\nvoid \nJB2Dict::JB2Codec::Encode::code(const GP<JB2Dict> &gjim)\n{\n  if(!gjim)\n  {\n    G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n  }\n  JB2Dict &jim=*gjim;\n      // -------------------------\n      // THIS IS THE ENCODING PART\n      // -------------------------\n      int firstshape = jim.get_inherited_shape_count();\n      int nshape = jim.get_shape_count();\n      init_library(jim);\n      // Code headers.\n      int rectype = REQUIRED_DICT_OR_RESET;\n      if (jim.get_inherited_shape_count() > 0)\n        code_record(rectype, gjim, 0);\n      rectype = START_OF_DATA;\n      code_record(rectype, gjim, 0);\n      // Code Comment.\n      rectype = PRESERVED_COMMENT;\n      if (!! jim.comment)\n        code_record(rectype, gjim, 0);\n      // Encode every shape\n      int shapeno;\n      DJVU_PROGRESS_TASK(jb2code,\"jb2 encode\", nshape-firstshape);\n      for (shapeno=firstshape; shapeno<nshape; shapeno++)\n        {\n          DJVU_PROGRESS_RUN(jb2code, (shapeno-firstshape)|0xff);\n          // Code shape\n          JB2Shape &jshp = jim.get_shape(shapeno);\n          rectype=(jshp.parent >= 0)\n            ?MATCHED_REFINE_LIBRARY_ONLY:NEW_MARK_LIBRARY_ONLY;\n          code_record(rectype, gjim, &jshp);\n          add_library(shapeno, jshp);\n\t  // Check numcoder status\n\t  if (cur_ncell > CELLCHUNK) \n\t    {\n\t      rectype = REQUIRED_DICT_OR_RESET;\n\t      code_record(rectype, 0, 0);\t      \n\t    }\n        }\n      // Code end of data record\n      rectype = END_OF_DATA;\n      code_record(rectype, gjim, 0); \n      gzp=0;\n}\n\n// CODE JB2IMAGE\n\nvoid \nJB2Dict::JB2Codec::Encode::code(const GP<JB2Image> &gjim)\n{\n  if(!gjim)\n  {\n    G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n  }\n  JB2Image &jim=*gjim;\n      // -------------------------\n      // THIS IS THE ENCODING PART\n      // -------------------------\n      int i;\n      init_library(jim);\n      int firstshape = jim.get_inherited_shape_count();\n      int nshape = jim.get_shape_count();\n      int nblit = jim.get_blit_count();\n      // Initialize shape2lib \n      shape2lib.resize(0,nshape-1);\n      for (i=firstshape; i<nshape; i++)\n        shape2lib[i] = -1;\n      // Determine shapes that go into library (shapeno>=firstshape)\n      //  shape2lib is -2 if used by one blit\n      //  shape2lib is -3 if used by more than one blit\n      //  shape2lib is -4 if used as a parent\n      for (i=0; i<nblit; i++)\n        {\n          JB2Blit *jblt = jim.get_blit(i);\n          int shapeno = jblt->shapeno;\n          if (shapeno < firstshape)\n            continue;\n          if (shape2lib[shapeno] >= -2) \n            shape2lib[shapeno] -= 1;\n          shapeno = jim.get_shape(shapeno).parent;\n          while (shapeno>=firstshape && shape2lib[shapeno]>=-3)\n            {\n              shape2lib[shapeno] = -4;\n              shapeno = jim.get_shape(shapeno).parent;\n            }\n        }\n      // Code headers.\n      int rectype = REQUIRED_DICT_OR_RESET;\n      if (jim.get_inherited_shape_count() > 0)\n        code_record(rectype, gjim, 0, 0);\n      rectype = START_OF_DATA;\n      code_record(rectype, gjim, 0, 0);\n      // Code Comment.\n      rectype = PRESERVED_COMMENT;\n      if (!! jim.comment)\n        code_record(rectype, gjim, 0, 0);\n      // Encode every blit\n      int blitno;\n      DJVU_PROGRESS_TASK(jb2code,\"jb2 encode\", nblit);\n      for (blitno=0; blitno<nblit; blitno++)\n        {\n          DJVU_PROGRESS_RUN(jb2code, blitno|0xff);\n          JB2Blit *jblt = jim.get_blit(blitno);\n          int shapeno = jblt->shapeno;\n          JB2Shape &jshp = jim.get_shape(shapeno);\n          // Tests if shape exists in library\n          if (shape2lib[shapeno] >= 0)\n            {\n              int rectype = MATCHED_COPY;\n              code_record(rectype, gjim, 0, jblt);\n            }\n          // Avoid coding null shapes/blits\n          else if (jshp.bits) \n            {\n              // Make sure all parents have been coded\n              if (jshp.parent>=0 && shape2lib[jshp.parent]<0)\n                encode_libonly_shape(gjim, jshp.parent);\n              // Allocate library entry when needed\n#define LIBRARY_CONTAINS_ALL\n              int libraryp = 0;\n#ifdef LIBRARY_CONTAINS_MARKS // baseline\n              if (jshp.parent >= -1)\n                libraryp = 1;\n#endif\n#ifdef LIBRARY_CONTAINS_SHARED // worse             \n              if (shape2lib[shapeno] <= -3)\n                libraryp = 1;\n#endif\n#ifdef LIBRARY_CONTAINS_ALL // better\n              libraryp = 1;\n#endif\n              // Test all blit cases\n              if (jshp.parent<-1 && !libraryp)\n                {\n                  int rectype = NON_MARK_DATA;\n                  code_record(rectype, gjim, &jshp, jblt);\n                }\n              else if (jshp.parent < 0)\n                {\n                  int rectype = (libraryp ? NEW_MARK : NEW_MARK_IMAGE_ONLY);\n                  code_record(rectype, gjim, &jshp, jblt);\n                }\n              else \n                {\n                  int rectype = (libraryp ? MATCHED_REFINE : MATCHED_REFINE_IMAGE_ONLY);\n                  code_record(rectype, gjim, &jshp, jblt);\n                }\n              // Add shape to library\n              if (libraryp) \n                add_library(shapeno, jshp);\n            }\n\t  // Check numcoder status\n\t  if (cur_ncell > CELLCHUNK) \n\t    {\n\t      rectype = REQUIRED_DICT_OR_RESET;\n\t      code_record(rectype, 0, 0);\n\t    }\n        }\n      // Code end of data record\n      rectype = END_OF_DATA;\n      code_record(rectype, gjim, 0, 0); \n      gzp=0;\n}\n\n////////////////////////////////////////\n//// HELPERS\n////////////////////////////////////////\n\nvoid \nJB2Dict::JB2Codec::Encode::encode_libonly_shape(\n  const GP<JB2Image> &gjim, int shapeno )\n{\n  if(!gjim)\n  {\n    G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n  }\n  JB2Image &jim=*gjim;\n  // Recursively encode parent shape\n  JB2Shape &jshp = jim.get_shape(shapeno);\n  if (jshp.parent>=0 && shape2lib[jshp.parent]<0)\n    encode_libonly_shape(gjim, jshp.parent);\n  // Test that library shape must be encoded\n  if (shape2lib[shapeno] < 0)\n    {\n      // Code library entry\n      int rectype=(jshp.parent >= 0)\n            ?NEW_MARK_LIBRARY_ONLY:MATCHED_REFINE_LIBRARY_ONLY;\n      code_record(rectype, gjim, &jshp, 0);      \n      // Add shape to library\n      add_library(shapeno, jshp);\n      // Check numcoder status\n      if (cur_ncell > CELLCHUNK) \n\t{\n\t  rectype = REQUIRED_DICT_OR_RESET;\n\t  code_record(rectype, 0, 0);\n\t}\n    }\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n\n#endif /* NEED_DECODER_ONLY */\n\n"
  },
  {
    "path": "ext/libdjvu/JB2Image.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n// From: Leon Bottou, 1/31/2002\n// Lizardtech has split the corresponding cpp file into a decoder and an encoder.\n// Only superficial changes.  The meat is mine.\n\n#include \"JB2Image.h\"\n#include \"GThreads.h\"\n#include \"GRect.h\"\n#include \"GBitmap.h\"\n#include <string.h>\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n////////////////////////////////////////\n//// CLASS JB2Codec::Decode:  DECLARATION\n////////////////////////////////////////\n\n// This class is accessed via the decode\n// functions of class JB2Image\n\n\n//**** Class JB2Codec\n// This class implements the JB2 decoder.\n// Contains all contextual information for decoding a JB2Image.\n\nclass JB2Dict::JB2Codec::Decode : public JB2Dict::JB2Codec\n{\npublic:\n  Decode(void);\n  void init(const GP<ByteStream> &gbs);\n// virtual\n  void code(const GP<JB2Image> &jim);\n  void code(JB2Image *jim) {const GP<JB2Image> gjim(jim);code(gjim);}\n  void code(const GP<JB2Dict> &jim);\n  void code(JB2Dict *jim) {const GP<JB2Dict> gjim(jim);code(gjim);}\n  void set_dict_callback(JB2DecoderCallback *cb, void *arg);\nprotected:\n  int CodeNum(const int lo, const int hi, NumContext &ctx);\n\n// virtual\n  bool CodeBit(const bool bit, BitContext &ctx);\n  void code_comment(GUTF8String &comment);\n  void code_record_type(int &rectype);\n  int code_match_index(int &index, JB2Dict &jim);\n  void code_inherited_shape_count(JB2Dict &jim);\n  void code_image_size(JB2Dict &jim);\n  void code_image_size(JB2Image &jim);\n  void code_absolute_location(JB2Blit *jblt,  int rows, int columns);\n  void code_absolute_mark_size(GBitmap &bm, int border=0);\n  void code_relative_mark_size(GBitmap &bm, int cw, int ch, int border=0);\n  void code_bitmap_directly(GBitmap &bm,const int dw, int dy,\n    unsigned char *up2, unsigned char *up1, unsigned char *up0 );\n  void code_bitmap_by_cross_coding (GBitmap &bm, GBitmap &cbm,\n    const int xd2c, const int dw, int dy, int cy,\n    unsigned char *up1, unsigned char *up0, unsigned char *xup1, \n    unsigned char *xup0, unsigned char *xdn1 );\n  int get_diff(const int x_diff,NumContext &rel_loc);\n\nprivate:\n  GP<ZPCodec> gzp;\n  JB2DecoderCallback *cbfunc;\n  void *cbarg;\n};\n\n////////////////////////////////////////\n//// CLASS JB2DICT: IMPLEMENTATION\n////////////////////////////////////////\n\n\nJB2Dict::JB2Dict()\n  : inherited_shapes(0)\n{\n}\n\nvoid\nJB2Dict::init()\n{\n  inherited_shapes = 0;\n  inherited_dict = 0;\n  shapes.empty();\n}\n\nJB2Shape &\nJB2Dict::get_shape(const int shapeno)\n{\n  JB2Shape *retval;\n  if(shapeno >= inherited_shapes)\n  {\n    retval=&shapes[shapeno - inherited_shapes];\n  }else if(inherited_dict)\n  {\n    retval=&(inherited_dict->get_shape(shapeno));\n  }else\n  {\n    G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n  }\n  return *retval;\n}\n\nconst JB2Shape &\nJB2Dict::get_shape(const int shapeno) const\n{\n  const JB2Shape *retval;\n  if(shapeno >= inherited_shapes)\n  {\n    retval=&shapes[shapeno - inherited_shapes];\n  }else if(inherited_dict)\n  {\n    retval=&(inherited_dict->get_shape(shapeno));\n  }else\n  {\n    G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n  }\n  return *retval;\n}\n\nvoid \nJB2Dict::set_inherited_dict(const GP<JB2Dict> &dict)\n{\n  if (shapes.size() > 0)\n    G_THROW( ERR_MSG(\"JB2Image.cant_set\") );\n  if (inherited_dict)\n    G_THROW( ERR_MSG(\"JB2Image.cant_change\") );\n  inherited_dict = dict; \n  inherited_shapes = dict->get_shape_count();\n  // Make sure that inherited bitmaps are marked as shared\n  for (int i=0; i<inherited_shapes; i++)\n    {\n      JB2Shape &jshp = dict->get_shape(i);\n      if (jshp.bits) jshp.bits->share();\n    }\n}\n\nvoid\nJB2Dict::compress()\n{\n  for (int i=shapes.lbound(); i<=shapes.hbound(); i++)\n    shapes[i].bits->compress();\n}\n\nunsigned int\nJB2Dict::get_memory_usage() const\n{\n  unsigned int usage = sizeof(JB2Dict);\n  usage += sizeof(JB2Shape) * shapes.size();\n  for (int i=shapes.lbound(); i<=shapes.hbound(); i++)\n    if (shapes[i].bits)\n      usage += shapes[i].bits->get_memory_usage();\n  return usage;\n}\n\nint  \nJB2Dict::add_shape(const JB2Shape &shape)\n{\n  if (shape.parent >= get_shape_count())\n    G_THROW( ERR_MSG(\"JB2Image.bad_parent_shape\") );\n  int index = shapes.size();\n  shapes.touch(index);\n  shapes[index] = shape;\n  return index + inherited_shapes;\n}\n\nvoid \nJB2Dict::decode(const GP<ByteStream> &gbs, JB2DecoderCallback *cb, void *arg)\n{\n  init();\n  JB2Codec::Decode codec;\n  codec.init(gbs);\n  codec.set_dict_callback(cb,arg);\n  codec.code(this);\n}\n\n\n\n////////////////////////////////////////\n//// CLASS JB2IMAGE: IMPLEMENTATION\n////////////////////////////////////////\n\n\nJB2Image::JB2Image(void)\n  : width(0), height(0), reproduce_old_bug(false)\n{\n}\n\nvoid\nJB2Image::init(void)\n{\n  width = height = 0;\n  blits.empty();\n  JB2Dict::init();\n}\n\nunsigned int\nJB2Image::get_memory_usage() const\n{\n  unsigned int usage = JB2Dict::get_memory_usage();\n  usage += sizeof(JB2Image) - sizeof(JB2Dict);\n  usage += sizeof(JB2Blit) * blits.size();\n  return usage;\n}\n\nvoid \nJB2Image::set_dimension(int awidth, int aheight)\n{\n  width = awidth;\n  height = aheight;\n}\n\nint  \nJB2Image::add_blit(const JB2Blit &blit)\n{\n  if (blit.shapeno >= (unsigned int)get_shape_count())\n    G_THROW( ERR_MSG(\"JB2Image.bad_shape\") );\n  int index = blits.size();\n  blits.touch(index);\n  blits[index] = blit;\n  return index;\n}\n\nGP<GBitmap>\nJB2Image::get_bitmap(int subsample, int align) const\n{\n  if (width==0 || height==0)\n    G_THROW( ERR_MSG(\"JB2Image.cant_create\") );\n  int swidth = (width + subsample - 1) / subsample;\n  int sheight = (height + subsample - 1) / subsample;\n  int border = ((swidth + align - 1) & ~(align - 1)) - swidth;\n  GP<GBitmap> bm = GBitmap::create(sheight, swidth, border);\n  bm->set_grays(1+subsample*subsample);\n  for (int blitno = 0; blitno < get_blit_count(); blitno++)\n    {\n      const JB2Blit *pblit = get_blit(blitno);\n      const JB2Shape  &pshape = get_shape(pblit->shapeno);\n      if (pshape.bits)\n        bm->blit(pshape.bits, pblit->left, pblit->bottom, subsample);\n    }\n  return bm;\n}\n\nGP<GBitmap>\nJB2Image::get_bitmap(const GRect &rect, int subsample, int align, int dispy) const\n{\n  if (width==0 || height==0)\n    G_THROW( ERR_MSG(\"JB2Image.cant_create\") );\n  int rxmin = rect.xmin * subsample;\n  int rymin = rect.ymin * subsample;\n  int swidth = rect.width();\n  int sheight = rect.height();\n  int border = ((swidth + align - 1) & ~(align - 1)) - swidth;\n  GP<GBitmap> bm = GBitmap::create(sheight, swidth, border);\n  bm->set_grays(1+subsample*subsample);\n  for (int blitno = 0; blitno < get_blit_count(); blitno++)\n    {\n      const JB2Blit *pblit = get_blit(blitno);\n      const JB2Shape  &pshape = get_shape(pblit->shapeno);\n      if (pshape.bits)\n        bm->blit(pshape.bits, pblit->left-rxmin, pblit->bottom-rymin+dispy, subsample);\n    }\n  return bm;\n}\n\nvoid \nJB2Image::decode(const GP<ByteStream> &gbs, JB2DecoderCallback *cb, void *arg)\n{\n  init();\n  JB2Codec::Decode codec;\n  codec.init(gbs);\n  codec.set_dict_callback(cb,arg);\n  codec.code(this);\n}\n\n\n\n////////////////////////////////////////\n//// CLASS JB2CODEC : IMPLEMENTATION\n////////////////////////////////////////\n\n\n\n#define START_OF_DATA                   (0)\n#define NEW_MARK                        (1)\n#define NEW_MARK_LIBRARY_ONLY           (2)\n#define NEW_MARK_IMAGE_ONLY             (3)\n#define MATCHED_REFINE                  (4)\n#define MATCHED_REFINE_LIBRARY_ONLY     (5)\n#define MATCHED_REFINE_IMAGE_ONLY       (6)\n#define MATCHED_COPY                    (7)\n#define NON_MARK_DATA                   (8)\n#define REQUIRED_DICT_OR_RESET          (9)\n#define PRESERVED_COMMENT               (10)\n#define END_OF_DATA                     (11)\n\n\n\n// STATIC DATA MEMBERS\n\nstatic const int BIGPOSITIVE = 262142;\nstatic const int BIGNEGATIVE = -262143;\nstatic const int CELLCHUNK = 20000;\nstatic const int CELLEXTRA =   500;\n\n\n// CONSTRUCTOR\n\nJB2Dict::JB2Codec::Decode::Decode(void)\n: JB2Dict::JB2Codec(0), cbfunc(0), cbarg(0) {}\n\nvoid\nJB2Dict::JB2Codec::Decode::init(const GP<ByteStream> &gbs)\n{\n  gzp=ZPCodec::create(gbs,false,true);\n}\n\nJB2Dict::JB2Codec::JB2Codec(const bool xencoding)\n  : encoding(xencoding),\n    cur_ncell(0),\n    gbitcells(bitcells,CELLCHUNK+CELLEXTRA),\n    gleftcell(leftcell,CELLCHUNK+CELLEXTRA),\n    grightcell(rightcell,CELLCHUNK+CELLEXTRA),\n    refinementp(false),\n    gotstartrecordp(0),\n    dist_comment_byte(0),\n    dist_comment_length(0),\n    dist_record_type(0),\n    dist_match_index(0),\n    dist_refinement_flag(0),\n    abs_loc_x(0),\n    abs_loc_y(0),\n    abs_size_x(0),\n    abs_size_y(0),\n    image_size_dist(0),\n    inherited_shape_count_dist(0),\n    offset_type_dist(0),\n    rel_loc_x_current(0),\n    rel_loc_x_last(0),\n    rel_loc_y_current(0),\n    rel_loc_y_last(0),\n    rel_size_x(0),\n    rel_size_y(0)\n{\n  memset(bitdist, 0, sizeof(bitdist));\n  memset(cbitdist, 0, sizeof(cbitdist));\n  // Initialize numcoder\n  bitcells[0] = 0; // dummy cell\n  leftcell[0] = rightcell[0] = 0;\n  cur_ncell = 1;\n}\n\nJB2Dict::JB2Codec::~JB2Codec() {}\n\nvoid \nJB2Dict::JB2Codec::reset_numcoder()\n{\n  dist_comment_byte = 0;\n  dist_comment_length = 0;\n  dist_record_type = 0;\n  dist_match_index = 0;\n  abs_loc_x = 0;\n  abs_loc_y = 0;\n  abs_size_x = 0;\n  abs_size_y = 0;\n  image_size_dist = 0;\n  inherited_shape_count_dist = 0;\n  rel_loc_x_current = 0;\n  rel_loc_x_last = 0;\n  rel_loc_y_current = 0;\n  rel_loc_y_last = 0;\n  rel_size_x = 0;\n  rel_size_y = 0;\n  gbitcells.clear();\n  gleftcell.clear();\n  grightcell.clear();\n  cur_ncell = 1;\n}\n\n\nvoid \nJB2Dict::JB2Codec::Decode::set_dict_callback(JB2DecoderCallback *cb, void *arg)\n{\n  cbfunc = cb;\n  cbarg = arg;\n}\n\n\n// CODE NUMBERS\n\ninline bool\nJB2Dict::JB2Codec::Decode::CodeBit(const bool, BitContext &ctx)\n{\n  return gzp->decoder(ctx)?true:false;\n}\n\nint\nJB2Dict::JB2Codec::Decode::CodeNum(int low, int high, NumContext &ctx)\n{\n  return JB2Codec::CodeNum(low,high,&ctx,0);\n}\n\nint\nJB2Dict::JB2Codec::CodeNum(int low, int high, NumContext *pctx, int v)\n{\n  bool negative=false;\n  int cutoff;\n  // Check\n  if (!pctx || ((int)*pctx >= cur_ncell))\n    G_THROW( ERR_MSG(\"JB2Image.bad_numcontext\") );\n  // Start all phases\n  cutoff = 0;\n  for(int phase=1,range=0xffffffff;range != 1;)\n    {\n      if (! *pctx)\n        {\n          const int max_ncell=gbitcells;\n          if (cur_ncell >= max_ncell)\n            {\n              const int nmax_ncell = max_ncell+CELLCHUNK;\n              gbitcells.resize(nmax_ncell);\n              gleftcell.resize(nmax_ncell);\n              grightcell.resize(nmax_ncell);\n            }\n          *pctx = cur_ncell ++;\n          bitcells[*pctx] = 0;\n          leftcell[*pctx] = rightcell[*pctx] = 0;\n        }\n      // encode\n      const bool decision = encoding\n        ? ((low < cutoff && high >= cutoff)\n          ? CodeBit((v>=cutoff),bitcells[*pctx])\n          : (v >= cutoff))\n        : ((low>=cutoff)||((high>=cutoff)&&CodeBit(false,bitcells[*pctx])));\n      // context for new bit\n      pctx = decision?(&rightcell[*pctx]):(&leftcell[*pctx]);\n      // phase dependent part\n      switch (phase) \n        {\n\tcase 1:\n          negative = !decision;\n          if (negative) \n            {\n              if (encoding)\n                v = - v - 1;\n              const int temp = - low - 1; \n              low = - high - 1; \n              high = temp;\n\t    }\n          phase = 2; cutoff =  1;\n          break;\n          \n\tcase 2:\n          if (!decision) \n            {\n              phase = 3;\n              range = (cutoff + 1) / 2;\n              if (range == 1)\n                cutoff = 0;\n              else\n                cutoff -= range / 2;\n\t    }\n          else \n            { \n              cutoff += cutoff + 1; \n            }\n          break;\n\n\tcase 3:\n          range /= 2;\n          if (range != 1) \n            {\n              if (!decision)\n                cutoff -= range / 2;\n              else               \n                cutoff += range / 2;\n\t    }\n          else if (!decision) \n            {\n                cutoff --;\n\t    }\n          break;\n\t}\n    }\n    return (negative)?(- cutoff - 1):cutoff;\n}\n\n\n\n// CODE COMMENTS\n\nvoid \nJB2Dict::JB2Codec::Decode::code_comment(GUTF8String &comment)\n{\n      int size=CodeNum(0, BIGPOSITIVE, dist_comment_length);\n      comment.empty();\n      char *combuf = comment.getbuf(size);\n      for (int i=0; i<size; i++) \n        {\n          combuf[i]=CodeNum(0, 255, dist_comment_byte);\n        }\n      comment.getbuf();\n}\n\n\n// LIBRARY\n\n\nvoid\nJB2Dict::JB2Codec::init_library(JB2Dict &jim)\n{\n  int nshape = jim.get_inherited_shape_count();\n  shape2lib.resize(0,nshape-1);\n  lib2shape.resize(0,nshape-1);\n  libinfo.resize(0,nshape-1);\n  for (int i=0; i<nshape; i++)\n    {\n      shape2lib[i] = i;\n      lib2shape[i] = i;\n      jim.get_bounding_box(i, libinfo[i]);\n    }\n}\n\nint \nJB2Dict::JB2Codec::add_library(const int shapeno, JB2Shape &jshp)\n{\n  const int libno = lib2shape.hbound() + 1;\n  lib2shape.touch(libno);\n  lib2shape[libno] = shapeno;\n  shape2lib.touch(shapeno);\n  shape2lib[shapeno] = libno;\n  libinfo.touch(libno);\n  libinfo[libno].compute_bounding_box(*(jshp.bits));\n  return libno;\n}\n\n\n// CODE SIMPLE VALUES\n\ninline void \nJB2Dict::JB2Codec::Decode::code_record_type(int &rectype)\n{\n  rectype=CodeNum( START_OF_DATA, END_OF_DATA, dist_record_type);\n}\n\nint \nJB2Dict::JB2Codec::Decode::code_match_index(int &index, JB2Dict &)\n{\n    int match=CodeNum(0, lib2shape.hbound(), dist_match_index);\n    index = lib2shape[match];\n    return match;\n}\n\n\n// HANDLE SHORT LIST\n\nint \nJB2Dict::JB2Codec::update_short_list(const int v)\n{\n  if (++ short_list_pos == 3)\n    short_list_pos = 0;\n  int * const s = short_list;\n  s[short_list_pos] = v;\n\n  return (s[0] >= s[1])\n    ?((s[0] > s[2])?((s[1] >= s[2])?s[1]:s[2]):s[0])\n    :((s[0] < s[2])?((s[1] >= s[2])?s[2]:s[1]):s[0]);\n}\n\n\n\n// CODE PAIRS\n\n\nvoid\nJB2Dict::JB2Codec::Decode::code_inherited_shape_count(JB2Dict &jim)\n{\n  int size=CodeNum(0, BIGPOSITIVE, inherited_shape_count_dist);\n    {\n      GP<JB2Dict> dict = jim.get_inherited_dict();\n      if (!dict && size>0)\n        {\n          // Call callback function to obtain dictionary\n          if (cbfunc)\n            dict = (*cbfunc)(cbarg);\n          if (dict)\n            jim.set_inherited_dict(dict);\n        }\n      if (!dict && size>0)\n        G_THROW( ERR_MSG(\"JB2Image.need_dict\") );\n      if (dict && size!=dict->get_shape_count())\n        G_THROW( ERR_MSG(\"JB2Image.bad_dict\") );\n    }\n}\n\nvoid \nJB2Dict::JB2Codec::Decode::code_image_size(JB2Dict &jim)\n{\n  int w=CodeNum(0, BIGPOSITIVE, image_size_dist);\n  int h=CodeNum(0, BIGPOSITIVE, image_size_dist);\n  if (w || h)\n    G_THROW( ERR_MSG(\"JB2Image.bad_dict2\") );\n  JB2Codec::code_image_size(jim);\n}\n\nvoid \nJB2Dict::JB2Codec::code_image_size(JB2Dict &)\n{\n  last_left = 1;\n  last_row_left = 0;\n  last_row_bottom = 0;\n  last_right = 0;\n  fill_short_list(last_row_bottom);\n  gotstartrecordp = 1;\n}\n\nvoid \nJB2Dict::JB2Codec::Decode::code_image_size(JB2Image &jim)\n{\n  image_columns=CodeNum(0, BIGPOSITIVE, image_size_dist);\n  image_rows=CodeNum(0, BIGPOSITIVE, image_size_dist);\n  if (!image_columns || !image_rows)\n    G_THROW( ERR_MSG(\"JB2Image.zero_dim\") );\n  jim.set_dimension(image_columns, image_rows);\n  JB2Codec::code_image_size(jim);\n}\n\nvoid \nJB2Dict::JB2Codec::code_image_size(JB2Image &)\n{\n  last_left = 1 + image_columns;\n  last_row_left = 0;\n  last_row_bottom = image_rows;\n  last_right = 0;\n  fill_short_list(last_row_bottom);\n  gotstartrecordp = 1;\n}\n\ninline int\nJB2Dict::JB2Codec::Decode::get_diff(int,NumContext &rel_loc)\n{\n   return CodeNum(BIGNEGATIVE, BIGPOSITIVE, rel_loc);\n}\n\nvoid \nJB2Dict::JB2Codec::code_relative_location(JB2Blit *jblt, int rows, int columns)\n{\n  // Check start record\n  if (!gotstartrecordp)\n    G_THROW( ERR_MSG(\"JB2Image.no_start\") );\n  // Find location\n  int bottom=0, left=0, top=0, right=0;\n  int x_diff, y_diff;\n  if (encoding)\n    {\n      left = jblt->left + 1;\n      bottom = jblt->bottom + 1;\n      right = left + columns - 1;\n      top = bottom + rows - 1;\n    }\n  // Code offset type\n  int new_row=CodeBit((left<last_left), offset_type_dist);\n  if (new_row)\n    {\n      // Begin a new row\n      x_diff=get_diff(left-last_row_left,rel_loc_x_last);\n      y_diff=get_diff(top-last_row_bottom,rel_loc_y_last);\n      if (!encoding)\n        {\n          left = last_row_left + x_diff;\n          top = last_row_bottom + y_diff;\n          right = left + columns - 1;\n          bottom = top - rows + 1;\n        }\n      last_left = last_row_left = left;\n      last_right = right;\n      last_bottom = last_row_bottom = bottom;\n      fill_short_list(bottom);\n    }\n  else\n    {\n      // Same row\n      x_diff=get_diff(left-last_right,rel_loc_x_current);\n      y_diff=get_diff(bottom-last_bottom,rel_loc_y_current);\n      if (!encoding)\n        {\n          left = last_right + x_diff;\n          bottom = last_bottom + y_diff;\n          right = left + columns - 1;\n          top = bottom + rows - 1;\n        }\n      last_left = left;\n      last_right = right;\n      last_bottom = update_short_list(bottom);\n    }\n  // Store in blit record\n  if (!encoding)\n    {\n      jblt->bottom = bottom - 1;\n      jblt->left = left - 1;\n    }\n}\n\nvoid \nJB2Dict::JB2Codec::Decode::code_absolute_location(JB2Blit *jblt, int rows, int columns)\n{\n  // Check start record\n  if (!gotstartrecordp)\n    G_THROW( ERR_MSG(\"JB2Image.no_start\") );\n  int left=CodeNum(1, image_columns, abs_loc_x);\n  int top=CodeNum(1, image_rows, abs_loc_y);\n  jblt->bottom = top - rows + 1 - 1;\n  jblt->left = left - 1;\n}\n\nvoid \nJB2Dict::JB2Codec::Decode::code_absolute_mark_size(GBitmap &bm, int border)\n{\n  int xsize=CodeNum(0, BIGPOSITIVE, abs_size_x);\n  int ysize=CodeNum(0, BIGPOSITIVE, abs_size_y);\n  if ((xsize!=(unsigned short)xsize) || (ysize!=(unsigned short)ysize))\n    G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n  bm.init(ysize, xsize, border);\n}\n\nvoid \nJB2Dict::JB2Codec::Decode::code_relative_mark_size(GBitmap &bm, int cw, int ch, int border)\n{\n  int xdiff=CodeNum(BIGNEGATIVE, BIGPOSITIVE, rel_size_x);\n  int ydiff=CodeNum(BIGNEGATIVE, BIGPOSITIVE, rel_size_y);\n  int xsize = cw + xdiff;\n  int ysize = ch + ydiff;\n  if ((xsize!=(unsigned short)xsize) || (ysize!=(unsigned short)ysize))\n    G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n  bm.init(ysize, xsize, border);\n}\n\n\n\n\n// CODE BITMAP DIRECTLY\n\nvoid \nJB2Dict::JB2Codec::code_bitmap_directly (GBitmap &bm)\n{\n  // Make sure bitmap will not be disturbed\n  GMonitorLock lock(bm.monitor());\n  // ensure borders are adequate\n  bm.minborder(3);\n  // initialize row pointers\n  int dy = bm.rows() - 1;\n  code_bitmap_directly(bm,bm.columns(),dy,bm[dy+2],bm[dy+1],bm[dy]);\n}\n\nvoid \nJB2Dict::JB2Codec::Decode::code_bitmap_directly(\n  GBitmap &bm,const int dw, int dy,\n  unsigned char *up2, unsigned char *up1, unsigned char *up0 )\n{\n      ZPCodec &zp=*gzp;\n      // iterate on rows (decoding)      \n      while (dy >= 0)\n        {\n          int context=get_direct_context(up2, up1, up0, 0);\n          for(int dx=0;dx < dw;)\n            {\n              int n = zp.decoder(bitdist[context]);\n              up0[dx++] = n;\n              context=shift_direct_context(context, n, up2, up1, up0, dx);\n            }\n          // next row\n          dy -= 1;\n          up2 = up1;\n          up1 = up0;\n          up0 = bm[dy];\n        }\n#ifndef NDEBUG\n      bm.check_border();\n#endif\n}\n\n\n\n\n\n// CODE BITMAP BY CROSS CODING\n\nvoid \nJB2Dict::JB2Codec::code_bitmap_by_cross_coding (GBitmap &bm, GP<GBitmap> &cbm, const int libno)\n{\n  // Make sure bitmaps will not be disturbed\n  GP<GBitmap> copycbm=GBitmap::create();\n  if (cbm->monitor())\n    {\n      // Perform a copy when the bitmap is explicitely shared\n      GMonitorLock lock2(cbm->monitor());\n      copycbm->init(*cbm);\n      cbm = copycbm;\n    }\n  GMonitorLock lock1(bm.monitor());\n  // Center bitmaps\n  const int cw = cbm->columns();\n  const int dw = bm.columns();\n  const int dh = bm.rows();\n  const LibRect &l = libinfo[libno];\n  const int xd2c = (dw/2 - dw + 1) - ((l.right - l.left + 1)/2 - l.right);\n  const int yd2c = (dh/2 - dh + 1) - ((l.top - l.bottom + 1)/2 - l.top);\n  // Ensure borders are adequate\n  bm.minborder(2);\n  cbm->minborder(2-xd2c);\n  cbm->minborder(2+dw+xd2c-cw);\n  // Initialize row pointers\n  const int dy = dh - 1;\n  const int cy = dy + yd2c;\n#ifndef NDEBUG\n  bm.check_border();\n  cbm->check_border();\n#endif\n  code_bitmap_by_cross_coding (bm,*cbm, xd2c, dw, dy, cy, bm[dy+1], bm[dy],\n    (*cbm)[cy+1] + xd2c, (*cbm)[cy  ] + xd2c, (*cbm)[cy-1] + xd2c);\n}\n\nvoid \nJB2Dict::JB2Codec::Decode::code_bitmap_by_cross_coding (GBitmap &bm, GBitmap &cbm,\n  const int xd2c, const int dw, int dy, int cy,\n  unsigned char *up1, unsigned char *up0, unsigned char *xup1, \n  unsigned char *xup0, unsigned char *xdn1 )\n{\n      ZPCodec &zp=*gzp;\n      // iterate on rows (decoding)      \n      while (dy >= 0)\n        {\n          int context=get_cross_context(\n                            up1, up0, xup1, xup0, xdn1, 0);\n          for(int dx=0;dx < dw;)\n            {\n              const int n = zp.decoder(cbitdist[context]);\n              up0[dx++] = n;\n              context=shift_cross_context(context, n,  \n                                  up1, up0, xup1, xup0, xdn1, dx);\n            }\n          // next row\n          up1 = up0;\n          up0 = bm[--dy];\n          xup1 = xup0;\n          xup0 = xdn1;\n          xdn1 = cbm[(--cy)-1] + xd2c;\n#ifndef NDEBUG\n          bm.check_border();\n#endif\n        }\n}\n\n\n\n\n// CODE JB2DICT RECORD\n\nvoid\nJB2Dict::JB2Codec::code_record(\n  int &rectype, const GP<JB2Dict> &gjim, JB2Shape *xjshp)\n{\n  GP<GBitmap> cbm;\n  GP<GBitmap> bm;\n  int shapeno = -1;\n\n  // Code record type\n  code_record_type(rectype);\n  \n  // Pre-coding actions\n  switch(rectype)\n    {\n    case NEW_MARK_LIBRARY_ONLY:\n    case MATCHED_REFINE_LIBRARY_ONLY:\n      {\n        if(!xjshp)\n        {\n          G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n        }\n        JB2Shape &jshp=*xjshp;\n        if (!encoding) \n        {\n          jshp.bits = GBitmap::create();\n          jshp.parent = -1;\n        }\n        bm = jshp.bits;\n        break;\n      }\n    }\n  // Coding actions\n  switch (rectype)\n    {\n    case START_OF_DATA:\n      {\n        if(!gjim)\n        {\n           G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n        }\n        JB2Dict &jim=*gjim;\n        code_image_size (jim);\n        code_eventual_lossless_refinement ();\n        if (! encoding)\n          init_library(jim);\n        break;\n      }\n    case NEW_MARK_LIBRARY_ONLY:\n      {\n        code_absolute_mark_size (*bm, 4);\n        code_bitmap_directly (*bm);\n        break;\n      }\n    case MATCHED_REFINE_LIBRARY_ONLY:\n      {\n        if(!xjshp||!gjim)\n        {\n           G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n        }\n        JB2Dict &jim=*gjim;\n        JB2Shape &jshp=*xjshp;\n        int match = code_match_index (jshp.parent, jim);\n        cbm = jim.get_shape(jshp.parent).bits;\n        LibRect &l = libinfo[match];\n        code_relative_mark_size (*bm, l.right-l.left+1, l.top-l.bottom+1, 4);\n        code_bitmap_by_cross_coding (*bm, cbm, jshp.parent);\n        break;\n      }\n    case PRESERVED_COMMENT:\n      {\n        if(!gjim)\n        {\n           G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n        }\n        JB2Dict &jim=*gjim;\n        code_comment(jim.comment);\n        break;\n      }\n    case REQUIRED_DICT_OR_RESET:\n      {\n        if (! gotstartrecordp)\n        {\n\t  // Indicates need for a shape dictionary\n          if(!gjim)\n          {\n             G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n          }\n\t  code_inherited_shape_count(*gjim);\n        }else\n\t  // Reset all numerical contexts to zero\n\t  reset_numcoder();\n        break;\n      }\n    case END_OF_DATA:\n      {\n        break;\n      }\n    default:\n      {\n        G_THROW( ERR_MSG(\"JB2Image.bad_type\") );\n      }\n    }\n  // Post-coding action\n  if (!encoding)\n    {\n      // add shape to dictionary\n      switch(rectype)\n        {\n        case NEW_MARK_LIBRARY_ONLY:\n        case MATCHED_REFINE_LIBRARY_ONLY:\n          {\n            if(!xjshp||!gjim)\n            {\n               G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n            }\n            JB2Shape &jshp=*xjshp;\n            shapeno = gjim->add_shape(jshp);\n            add_library(shapeno, jshp);\n            break;\n          }\n        }\n      // make sure everything is compacted\n      // decompaction will occur automatically when needed\n      if (bm)\n        bm->compress();\n    }\n}\n\n\n// CODE JB2DICT\n\nvoid \nJB2Dict::JB2Codec::Decode::code(const GP<JB2Dict> &gjim)\n{\n  if(!gjim)\n  {\n    G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n  }\n  JB2Dict &jim=*gjim;\n  // -------------------------\n  // THIS IS THE DECODING PART\n  // -------------------------\n  int rectype;\n  JB2Shape tmpshape;\n  do {\n    code_record(rectype, gjim, &tmpshape);        \n  } while(rectype != END_OF_DATA);\n  if (!gotstartrecordp)\n    G_THROW( ERR_MSG(\"JB2Image.no_start\") );\n  // cache bounding boxes\n  int nshapes = jim.get_shape_count();\n  int ishapes = jim.get_inherited_shape_count();\n  jim.boxes.resize(0, nshapes-ishapes-1);\n  for (int i = ishapes; i < nshapes; i++)\n    jim.boxes[i-ishapes] = libinfo[i];\n  // compress\n  jim.compress();\n}\n\n\n\n// CODE JB2IMAGE RECORD\n\nvoid\nJB2Dict::JB2Codec::code_record(\n  int &rectype, const GP<JB2Image> &gjim, JB2Shape *xjshp, JB2Blit *jblt)\n{\n  GP<GBitmap> bm;\n  GP<GBitmap> cbm;\n  int shapeno = -1;\n  int match;\n\n  // Code record type\n  code_record_type(rectype);\n  \n  // Pre-coding actions\n  switch(rectype)\n    {\n    case NEW_MARK:\n    case NEW_MARK_LIBRARY_ONLY:\n    case NEW_MARK_IMAGE_ONLY:\n    case MATCHED_REFINE:\n    case MATCHED_REFINE_LIBRARY_ONLY:\n    case MATCHED_REFINE_IMAGE_ONLY:\n    case NON_MARK_DATA:\n      {\n        if(!xjshp)\n        {\n           G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n        }\n        JB2Shape &jshp=*xjshp;\n        if (!encoding) \n        {\n          jshp.bits = GBitmap::create();\n          jshp.parent = -1;\n          if (rectype == NON_MARK_DATA)\n            jshp.parent = -2;\n        }\n        bm = jshp.bits;\n        break;\n      }\n    }\n  // Coding actions\n  switch (rectype)\n    {\n    case START_OF_DATA:\n      {\n        if(!gjim)\n        {\n           G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n        }\n        JB2Image &jim=*gjim;\n        code_image_size (jim);\n        code_eventual_lossless_refinement ();\n        if (! encoding)\n          init_library(jim);\n        break;\n      }\n    case NEW_MARK:\n      {\n        code_absolute_mark_size (*bm, 4);\n        code_bitmap_directly (*bm);\n        code_relative_location (jblt, bm->rows(), bm->columns() );\n        break;\n      }\n    case NEW_MARK_LIBRARY_ONLY:\n      {\n        code_absolute_mark_size (*bm, 4);\n        code_bitmap_directly (*bm);\n        break;\n      }\n    case NEW_MARK_IMAGE_ONLY:\n      {\n        code_absolute_mark_size (*bm, 3);\n        code_bitmap_directly (*bm);\n        code_relative_location (jblt, bm->rows(), bm->columns() );\n        break;\n      }\n    case MATCHED_REFINE:\n      {\n        if(!xjshp || !gjim)\n        {\n           G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n        }\n        JB2Shape &jshp=*xjshp;\n        JB2Image &jim=*gjim;\n        match = code_match_index (jshp.parent, jim);\n        cbm = jim.get_shape(jshp.parent).bits;\n        LibRect &l = libinfo[match];\n        code_relative_mark_size (*bm, l.right-l.left+1, l.top-l.bottom+1, 4); \n        code_bitmap_by_cross_coding (*bm, cbm, match);\n        code_relative_location (jblt, bm->rows(), bm->columns() );\n        break;\n      }\n    case MATCHED_REFINE_LIBRARY_ONLY:\n      {\n        if(!xjshp||!gjim)\n        {\n           G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n        }\n        JB2Image &jim=*gjim;\n        JB2Shape &jshp=*xjshp;\n        match = code_match_index (jshp.parent, jim);\n        cbm = jim.get_shape(jshp.parent).bits;\n        LibRect &l = libinfo[match];\n        code_relative_mark_size (*bm, l.right-l.left+1, l.top-l.bottom+1, 4);\n        break;\n      }\n    case MATCHED_REFINE_IMAGE_ONLY:\n      {\n        if(!xjshp||!gjim)\n        {\n           G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n        }\n        JB2Image &jim=*gjim;\n        JB2Shape &jshp=*xjshp;\n        match = code_match_index (jshp.parent, jim);\n        cbm = jim.get_shape(jshp.parent).bits;\n        LibRect &l = libinfo[match];\n        code_relative_mark_size (*bm, l.right-l.left+1, l.top-l.bottom+1, 4);\n        code_bitmap_by_cross_coding (*bm, cbm, match);\n        code_relative_location (jblt, bm->rows(), bm->columns() );\n        break;\n      }\n    case MATCHED_COPY:\n      {\n        int temp;\n        if (encoding) temp = jblt->shapeno;\n        if(!gjim)\n        {\n           G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n        }\n        JB2Image &jim=*gjim;\n        match = code_match_index (temp, jim);\n        if (!encoding) jblt->shapeno = temp;\n        bm = jim.get_shape(jblt->shapeno).bits;\n        LibRect &l = libinfo[match];\n        jblt->left += l.left;\n        jblt->bottom += l.bottom;\n        if (jim.reproduce_old_bug)\n          code_relative_location (jblt, bm->rows(), bm->columns() );\n        else\n          code_relative_location (jblt, l.top-l.bottom+1, l.right-l.left+1 );\n        jblt->left -= l.left;\n        jblt->bottom -= l.bottom; \n        break;\n      }\n    case NON_MARK_DATA:\n      {\n        code_absolute_mark_size (*bm, 3);\n        code_bitmap_directly (*bm);\n        code_absolute_location (jblt, bm->rows(), bm->columns() );\n        break;\n      }\n    case PRESERVED_COMMENT:\n      {\n        if(!gjim)\n        {\n           G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n        }\n        JB2Image &jim=*gjim;\n        code_comment(jim.comment);\n        break;\n      }\n    case REQUIRED_DICT_OR_RESET:\n      {\n        if(!gjim)\n        {\n           G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n        }\n        JB2Image &jim=*gjim;\n        if (! gotstartrecordp)\n\t  // Indicates need for a shape dictionary\n\t  code_inherited_shape_count(jim);\n\telse\n\t  // Reset all numerical contexts to zero\n\t  reset_numcoder();\n        break;\n      }\n    case END_OF_DATA:\n      {\n        break;\n      }\n    default:\n      {\n        G_THROW( ERR_MSG(\"JB2Image.unknown_type\") );\n      }\n    }\n  \n  // Post-coding action\n  if (!encoding)\n    {\n      // add shape to image\n      switch(rectype)\n        {\n        case NEW_MARK:\n        case NEW_MARK_LIBRARY_ONLY:\n        case NEW_MARK_IMAGE_ONLY:\n        case MATCHED_REFINE:\n        case MATCHED_REFINE_LIBRARY_ONLY:\n        case MATCHED_REFINE_IMAGE_ONLY:\n        case NON_MARK_DATA:\n          {\n            if(!xjshp||!gjim)\n            {\n              G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n            }\n            JB2Shape &jshp=*xjshp;\n            shapeno = gjim->add_shape(jshp);\n            shape2lib.touch(shapeno);\n            shape2lib[shapeno] = -1;\n            break;\n          }\n        }\n      // add shape to library\n      switch(rectype)\n        {\n        case NEW_MARK:\n        case NEW_MARK_LIBRARY_ONLY:\n        case MATCHED_REFINE:\n        case MATCHED_REFINE_LIBRARY_ONLY:\n          if(!xjshp)\n          {\n            G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n          }\n          add_library(shapeno, *xjshp);\n          break;\n        }\n      // make sure everything is compacted\n      // decompaction will occur automatically on cross-coding bitmaps\n      if (bm)\n        bm->compress();\n      // add blit to image\n      switch (rectype)\n        {\n        case NEW_MARK:\n        case NEW_MARK_IMAGE_ONLY:\n        case MATCHED_REFINE:\n        case MATCHED_REFINE_IMAGE_ONLY:\n        case NON_MARK_DATA:\n          jblt->shapeno = shapeno;\n        case MATCHED_COPY:\n          if(!gjim)\n          {\n            G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n          }\n          gjim->add_blit(* jblt);\n          break;\n        }\n    }\n}\n\n\n// CODE JB2IMAGE\n\nvoid \nJB2Dict::JB2Codec::Decode::code(const GP<JB2Image> &gjim)\n{\n  if(!gjim)\n  {\n    G_THROW( ERR_MSG(\"JB2Image.bad_number\") );\n  }\n  JB2Image &jim=*gjim;\n      // -------------------------\n      // THIS IS THE DECODING PART\n      // -------------------------\n      int rectype;\n      JB2Blit tmpblit;\n      JB2Shape tmpshape;\n      do\n        {\n          code_record(rectype, gjim, &tmpshape, &tmpblit);        \n        } \n      while(rectype!=END_OF_DATA);\n      if (!gotstartrecordp)\n        G_THROW( ERR_MSG(\"JB2Image.no_start\") );\n      jim.compress();\n}\n\n\n\n////////////////////////////////////////\n//// HELPERS\n////////////////////////////////////////\n\nvoid \nJB2Dict::LibRect::compute_bounding_box(const GBitmap &bm)\n{\n  // Avoid trouble\n  GMonitorLock lock(bm.monitor());\n  // Get size\n  const int w = bm.columns();\n  const int h = bm.rows();\n  const int s = bm.rowsize();\n  // Right border\n  for(right=w-1;right >= 0;--right)\n    {\n      unsigned char const *p = bm[0] + right;\n      unsigned char const * const pe = p+(s*h);\n      for (;(p<pe)&&(!*p);p+=s)\n      \tcontinue;\n      if (p<pe)\n        break;\n    }\n  // Top border\n  for(top=h-1;top >= 0;--top)\n    {\n      unsigned char const *p = bm[top];\n      unsigned char const * const pe = p+w;\n      for (;(p<pe)&&(!*p); ++p)\n      \tcontinue;\n      if (p<pe)\n        break;\n    }\n  // Left border\n  for (left=0;left <= right;++left)\n    {\n      unsigned char const *p = bm[0] + left;\n      unsigned char const * const pe=p+(s*h);\n      for (;(p<pe)&&(!*p);p+=s)\n      \tcontinue;\n      if (p<pe)\n        break;\n    }\n  // Bottom border\n  for(bottom=0;bottom <= top;++bottom)\n    {\n      unsigned char const *p = bm[bottom];\n      unsigned char const * const pe = p+w;\n      for (;(p<pe)&&(!*p); ++p)\n      \tcontinue;\n      if (p<pe)\n        break;\n    }\n}\n\n\nvoid\nJB2Dict::get_bounding_box(int shapeno, LibRect &dest)\n{\n  if (shapeno < inherited_shapes && inherited_dict)\n    {\n      inherited_dict->get_bounding_box(shapeno, dest);\n    }\n  else if (shapeno >= inherited_shapes &&\n           shapeno < inherited_shapes + boxes.size())\n    {\n      dest = boxes[shapeno - inherited_shapes];\n    }\n  else\n    {\n      JB2Shape &jshp = get_shape(shapeno);\n      dest.compute_bounding_box(*(jshp.bits));\n    }\n}\n\n\nGP<JB2Dict>\nJB2Dict::create(void)\n{\n  return new JB2Dict();\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/JB2Image.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _JB2IMAGE_H\n#define _JB2IMAGE_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n/** @name JB2Image.h\n\n    Files #\"JB2Image.h\"# and #\"JB2Image.cpp\"# address the compression of\n    bilevel images using the JB2 soft pattern matching scheme.  These files\n    provide the complete decoder and the decoder back-end.  The JB2 scheme is\n    optimized for images containing a large number of self-similar small\n    components such as characters.  Typical text images can be compressed into\n    files 3 to 5 times smaller than with G4/MMR and 2 to 4 times smaller than\n    with JBIG1.\n\n    {\\bf JB2 and JBIG2} --- JB2 has strong similarities with the forthcoming\n    JBIG2 standard developed by the \"ISO/IEC JTC1 SC29 Working Group 1\" which\n    is responsible for both the JPEG and JBIG standards.  This is hardly\n    surprising since JB2 was our own proposal for the JBIG2 standard\n    and remained the only proposal for years.  The full JBIG2 standard however\n    is significantly more complex and slighlty less efficient than JB2 because\n    it addresses a broader range of applications.  Full JBIG2 compliance may\n    be implemented in the future.\n\n    {\\bf JB2 Images} --- Class \\Ref{JB2Image} is the central data structure\n    implemented here.  A #JB2Image# is composed of an array of shapes\n    and an array of blits.  Each shape contains a small bitmap representing an\n    elementary blob of ink, such as a character or a segment of line art.\n    Each blit instructs the decoder to render a particular shape at a\n    specified position in the image.  Some compression is already achieved\n    because several blits can refer to the same shape.  A shape can also\n    contain a pointer to a parent shape.  Additional compression is achieved\n    when both shapes are similar because each shape is encoded using the\n    parent shape as a model.  A #\"O\"# shape for instance could be a parent for\n    both a #\"C\"# shape and a #\"Q\"# shape.\n\n    {\\bf JB2 Dictionary} --- Class \\Ref{JB2Dict} is a peculiar kind of\n    JB2Image which only contains an array of shapes.  These shapes can be\n    referenced from another JB2Dict/JB2Image.  This is arranged by setting the\n    ``inherited dictionary'' of a JB2Dict/JB2Image using function\n    \\Ref{JB2Dict::set_inherited_dict}. Several JB2Images can use shapes from a\n    same JB2Dict encoded separately.  This is how several pages of a same\n    document can share information.\n    \n    {\\bf Decoding JB2 data} --- The first step for decoding JB2 data consists of \n    creating an empty #JB2Image# object.  Function \\Ref{JB2Image::decode} then\n    reads the data and populates the #JB2Image# with the shapes and the blits.\n    Function \\Ref{JB2Image::get_bitmap} finally produces an anti-aliased image.\n\n    {\\bf Encoding JB2 data} --- The first step for decoding JB2 data also\n    consists of creating an empty #JB2Image# object.  You must then use\n    functions \\Ref{JB2Image::add_shape} and \\Ref{JB2Image::add_blit} to\n    populate the #JB2Image# object.  Function \\Ref{JB2Image::encode} finally\n    produces the JB2 data.  Function #encode# sequentially encodes the blits\n    and the necessary shapes.  The compression ratio depends on several\n    factors:\n    \\begin{itemize}\n    \\item Blits should reuse shapes as often as possible.\n    \\item Blits should be sorted in reading order because this facilitates\n          the prediction of the blit coordinates.\n    \\item Shapes should be sorted according to the order of first appearance\n          in the sequence of blits because this facilitates the prediction of the\n          shape indices.\n    \\item Shapes should be compared to all previous shapes in the shape array.\n          The shape parent pointer should be set to a suitable parent shape if\n          such a parent shape exists.  The parent shape should have almost the\n          same size and the same pixels.\n    \\end{itemize}\n    All this is quite easy to achieve in the case of an electronically\n    produced document such as a DVI file or a PS file: we know what the\n    characters are and where they are located.  If you only have a scanned\n    image however you must first locate the characters (connected component\n    analysis) and cut the remaining pieces of ink into smaller blobs.\n    Ordering the blits and matching the shapes is then an essentially\n    heuristic process.  Although the quality of the heuristics substantially\n    effects the file size, misordering blits or mismatching shapes never\n    effects the quality of the image.  The last refinement consists in\n    smoothing the shapes in order to reduce the noise and maximize the\n    similarities between shapes.\n    \n    {\\bf JB2 extensions} --- Two extensions of the JB2\n    encoding format have been introduced with DjVu files version 21. The first\n    extension addresses the shared shape dictionaries. The second extension\n    bounds the number of probability contexts used for coding numbers.\n    Both extensions maintain backward compatibility with JB2 as \n    described in the ICFDD proposal. A more complete discussion\n    can be found in section \\Ref{JB2 extensions for version 21.}.\n\n    {\\bf References} \n    \\begin{itemize}\n    \\item Paul G. Howard : {\\em Text image compression using soft \n          pattern matching}, Computer Journal, volume 40:2/3, 1997.\n    \\item JBIG1 : \\URL{http://www.jpeg.org/public/jbighomepage.htm}.\n    \\item JBIG2 draft : \\URL{http://www.jpeg.org/public/jbigpt2.htm}.\n    \\item ICFDD Draft Proposed American National Standard, 1999-08-26.\n    \\end{itemize}\n\n    @memo\n    Coding bilevel images with JB2.\n    @author\n    Paul Howard <pgh@research.att.com> -- JB2 design\\\\\n    L\\'eon Bottou <leonb@research.att.com> -- this implementation \n\n// From: Leon Bottou, 1/31/2002\n// Lizardtech has split the corresponding cpp file into a decoder and an encoder.\n// Only superficial changes.  The meat is mine.\n\n*/\n//@{\n\n\n#include \"GString.h\"\n#include \"ZPCodec.h\"\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass JB2Dict;\nclass JB2Image;\nclass GRect;\nclass GBitmap;\nclass ByteStream;\n\n/** Blit data structure.  A #JB2Image# contains an array of #JB2Blit# data\n    structures.  Each array entry instructs the decoder to render a particular\n    shape at a particular location.  Members #left# and #bottom# specify the\n    coordinates of the bottom left corner of the shape bitmap.  All\n    coordinates are relative to the bottom left corner of the image.  Member\n    #shapeno# is the subscript of the shape to be rendered.  */\n\nclass DJVUAPI JB2Blit {\npublic:\n  /** Horizontal coordinate of the blit. */\n  unsigned short left;\n  /** Vertical coordinate of the blit. */\n  unsigned short bottom;\n  /** Index of the shape to blit. */\n  unsigned int shapeno;\n};\n\n\n/** Shape data structure.  A #JB2Image# contains an array of #JB2Shape# data\n    structures.  Each array entry represents an elementary blob of ink such as\n    a character or a segment of line art.  Member #bits# points to a bilevel\n    image representing the shape pixels.  Member #parent# is the subscript of\n    the parent shape.  */\n\nclass DJVUAPI JB2Shape\n{ \npublic: \n  /** Subscript of the parent shape.  The parent shape must always be located\n      before the current shape in the shape array.  A negative value indicates\n      that this shape has no parent.  Any negative values smaller than #-1#\n      further indicates that this shape does not look like a character.  This\n      is used to enable a few internal optimizations.  This information is\n      saved into the JB2 file, but the actual value of the #parent# variable\n      is not. */\n  int parent; \n  /** Bilevel image of the shape pixels.  This must be a pointer to a bilevel\n      #GBitmap# image.  This pointer can also be null. The encoder will just\n      silently discard all blits referring to a shape containing a null\n      bitmap. */\n  GP<GBitmap> bits;\n  /** Private user data. This long word is provided as a convenience for users\n      of the JB2Image data structures.  Neither the rendering functions nor\n      the coding functions ever access this value. */\n  long userdata;\n};\n\n\n\n/** JB2 Dictionary callback.\n    The decoding function call this callback function when they discover that\n    the current JB2Image or JB2Dict needs a pre-existing shape dictionary. \n    The callback function must return a pointer to the dictionary or NULL\n    if none is found. */\n\ntypedef GP<JB2Dict> JB2DecoderCallback ( void* );\n\n\n/** Dictionary of JB2 shapes. */\n\nclass DJVUAPI JB2Dict : public GPEnabled\n{\nprotected:\n  JB2Dict(void);\npublic:\n  class JB2Codec;\n\n  // CONSTRUCTION\n  /** Default creator.  Constructs an empty #JB2Dict# object.  You can then\n      call the decoding function #decode#.  You can also manually set the\n      image size using #add_shape#. */\n  static GP<JB2Dict> create(void);\n\n  // INITIALIZATION\n  /** Resets the #JB2Image# object.  This function reinitializes both the shape\n     and the blit arrays.  All allocated memory is freed. */\n  void init(void);\n\n  // INHERITED\n  /** Returns the inherited dictionary. */\n  GP<JB2Dict> get_inherited_dict(void) const;\n  /** Returns the number of inherited shapes. */\n  int get_inherited_shape_count(void) const;\n  /** Sets the inherited dictionary. */\n  void set_inherited_dict(const GP<JB2Dict> &dict);\n\n  // ACCESSING THE SHAPE LIBRARY\n  /** Returns the total number of shapes.\n      Shape indices range from #0# to #get_shape_count()-1#. */\n  int get_shape_count(void) const;\n  /** Returns a pointer to shape #shapeno#.\n      The returned pointer directly points into the shape array.\n      This pointer can be used for reading or writing the shape data. */\n  JB2Shape &get_shape(const int shapeno);\n  /** Returns a constant pointer to shape #shapeno#.\n      The returned pointer directly points into the shape array.\n      This pointer can only be used for reading the shape data. */\n  const JB2Shape &get_shape(const int shapeno) const;\n  /** Appends a shape to the shape array.  This function appends a copy of\n      shape #shape# to the shape array and returns the subscript of the new\n      shape.  The subscript of the parent shape #shape.parent# must \n      actually designate an already existing shape. */\n  int  add_shape(const JB2Shape &shape);\n\n  // MEMORY OPTIMIZATION\n  /** Compresses all shape bitmaps.  This function reduces the memory required\n      by the #JB2Image# by calling \\Ref{GBitmap::compress} on all shapes\n      bitmaps.  This function is best called after decoding a #JB2Image#,\n      because function \\Ref{get_bitmap} can directly use the compressed\n      bitmaps.  */\n  void compress(void);\n  /** Returns the total memory used by the JB2Image.\n      The returned value is expressed in bytes. */\n  unsigned int get_memory_usage(void) const;\n\n  // CODING\n  /** Encodes the JB2Dict into ByteStream #bs#.  \n      This function generates the JB2 data stream without any header.   */\n  void encode(const GP<ByteStream> &gbs) const;\n  /** Decodes JB2 data from ByteStream #bs#. This function decodes the image\n      size and populates the shape and blit arrays.  The callback function\n      #cb# is called when the decoder determines that the ByteStream data\n      requires a shape dictionary which has not been set with\n      \\Ref{JB2Dict::set_inherited_dict}. The callback receives argument #arg#\n      and must return a suitable dictionary which will be installed as the\n      inherited dictionary.  The callback should return null if no such\n      dictionary is found. */\n  void decode(const GP<ByteStream> &gbs, JB2DecoderCallback *cb=0, void *arg=0);\n\n  \npublic:\n  /** Comment string coded by JB2 file. */\n  GUTF8String comment;\n\n\nprivate:\n  friend class JB2Codec;\n  int inherited_shapes;\n  GP<JB2Dict> inherited_dict;\n  GArray<JB2Shape> shapes;\n\n  struct LibRect {\n    int top,left,right,bottom;\n    void compute_bounding_box(const GBitmap &cbm);\n  };\n  GTArray<LibRect> boxes;\n  void get_bounding_box(int shapeno, LibRect &dest);\n};\n\n/** Main JB2 data structure.  Each #JB2Image# consists of an array of shapes\n    and an array of blits.  These arrays can be populated by hand using\n    functions \\Ref{add_shape} and \\Ref{add_blit}, or by decoding JB2 data\n    using function \\Ref{decode}.  You can then use function \\Ref{get_bitmap}\n    to render anti-aliased images, or use function \\Ref{encode} to generate\n    JB2 data. */\n\nclass DJVUAPI JB2Image : public JB2Dict\n{\nprotected:\n  JB2Image(void);\npublic:\n\n  /** Creates an empty #JB2Image# object.  You can then\n      call the decoding function #decode#.  You can also manually set the\n      image size using #set_dimension# and populate the shape and blit arrays\n      using #add_shape# and #add_blit#. */\n  static GP<JB2Image> create(void) { return new JB2Image(); }\n\n  // INITIALIZATION\n  /** Resets the #JB2Image# object.  This function reinitializes both the shape\n     and the blit arrays.  All allocated memory is freed. */\n  void init(void);\n\n  // DIMENSION\n  /** Returns the width of the image.  \n      This is the width value previously set with #set_dimension#. */\n  int get_width(void) const;\n  /** Returns the height of the image.  \n      This is the height value previously set with #set_dimension#. */\n  int get_height(void) const;\n  /** Sets the size of the JB2Image.\n      This function can be called at any time. \n      The corresponding #width# and the #height# are stored\n      in the JB2 file. */\n  void set_dimension(int width, int height);\n\n  // RENDERING\n  /** Renders an anti-aliased gray level image.  This function renders the\n      JB2Image as a bilevel or gray level image.  Argument #subsample#\n      specifies the desired subsampling ratio in range #1# to #15#.  The\n      returned image uses #1+subsample^2# gray levels for representing\n      anti-aliased edges.  Argument #align# specified the alignment of the\n      rows of the returned images.  Setting #align# to #4#, for instance, will\n      adjust the bitmap border in order to make sure that each row of the\n      returned image starts on a word (four byte) boundary. */\n  GP<GBitmap> get_bitmap(int subsample = 1, int align = 1) const;\n  /** Renders an anti-aliased gray level sub-image.  This function renders a\n      segment of the JB2Image as a bilevel or gray level image.  Conceptually,\n      this function first renders the full JB2Image with subsampling ratio\n      #subsample# and then extracts rectangle #rect# in the subsampled image.\n      Both operations of course are efficiently performed simultaneously.\n      Argument #align# specified the alignment of the rows of the returned\n      images, as explained above.  Argument #dispy# should remain null. */\n  GP<GBitmap> get_bitmap(const GRect &rect, int subsample=1, int align=1, int dispy=0) const;\n\n  // ACCESSING THE BLIT LIBRARY\n  /** Returns the total number of blits.\n      Blit indices range from #0# to #get_blit_count(void)-1#. */\n  int get_blit_count(void) const;\n  /** Returns a pointer to blit #blitno#.\n      The returned pointer directly points into the blit array.\n      This pointer can be used for reading or writing the blit data. */\n  JB2Blit *get_blit(int blitno);\n  /** Returns a constant pointer to blit #blitno#.\n      The returned pointer directly points into the shape array.\n      This pointer can only be used for reading the shape data. */\n  const JB2Blit *get_blit(int blitno) const;\n  /** Appends a blit to the blit array.  This function appends a copy of blit\n      #blit# to the blit array and returns the subscript of the new blit.  The\n      shape subscript #blit.shapeno# must actually designate an already\n      existing shape. */\n  int  add_blit(const JB2Blit &blit);\n\n  // MEMORY OPTIMIZATION\n  /** Returns the total memory used by the JB2Image.\n      The returned value is expressed in bytes. */\n  unsigned int get_memory_usage(void) const;\n\n  // CODING\n  /** Encodes the JB2Image into ByteStream #bs#.  \n      This function generates the JB2 data stream without any header. */\n  void encode(const GP<ByteStream> &gbs) const;\n  /** Decodes JB2 data from ByteStream #bs#. This function decodes the image\n      size and populates the shape and blit arrays.  The callback function\n      #cb# is called when the decoder determines that the ByteStream data\n      requires a shape dictionary which has not been set with\n      \\Ref{JB2Dict::set_inherited_dict}. The callback receives argument #arg#\n      and must return a suitable dictionary which will be installed as the\n      inherited dictionary.  The callback should return null if no such\n      dictionary is found. */\n  void decode(const GP<ByteStream> &gbs, JB2DecoderCallback *cb=0, void *arg=0);\n  \nprivate:\n  // Implementation\n  int width;\n  int height;\n  GTArray<JB2Blit> blits;\npublic:\n  /** Reproduces a old bug.  Setting this flag may be necessary for accurately\n      decoding DjVu files with version smaller than #18#.  The default value\n      is of couse #false#. */\n  bool reproduce_old_bug;\n};\n\n\n\n// JB2DICT INLINE FUNCTIONS\n\ninline int\nJB2Dict::get_shape_count(void) const\n{\n  return inherited_shapes + shapes.size();\n}\n\ninline int\nJB2Dict::get_inherited_shape_count(void) const\n{\n  return inherited_shapes;\n}\n\ninline GP<JB2Dict>\nJB2Dict::get_inherited_dict(void) const\n{\n  return inherited_dict;\n}\n\n// JB2IMAGE INLINE FUNCTIONS\n\ninline int\nJB2Image::get_width(void) const\n{\n  return width;\n}\n\ninline int\nJB2Image::get_height(void) const\n{\n  return height;\n}\n\n\ninline int\nJB2Image::get_blit_count(void) const\n{\n  return blits.size();\n}\n\n\ninline JB2Blit *\nJB2Image::get_blit(int blitno)\n{\n  return & blits[blitno];\n}\n\ninline const JB2Blit *\nJB2Image::get_blit(int blitno) const\n{\n  return & blits[blitno];\n}\n\n\n\n\n\n/** @name JB2 extensions for version 21.\n\n    Two extensions of the JB2 encoding format have been introduced\n    with DjVu files version 21.  Both extensions maintain significant\n    backward compatibility with previous version of the JB2 format.\n    These extensions are described below by reference to the ICFDD\n    proposal dated August 1999.  Both extension make use of the unused\n    record type value #9# (cf. ICFDD page 24) which has been renamed\n    #REQUIRED_DICT_OR_RESET#.\n\n    {\\bf Shared Shape Dictionaries} --- This extension provides\n    support for sharing symbol definitions between the pages of a\n    document.  To achieve this objective, the JB2 image data chunk\n    must be able to address symbols defined elsewhere by a JB2\n    dictionary data chunk shared by all the pages of a document.\n\n    The arithmetically encoded JB2 image data logically consist of a\n    sequence of records. The decoder processes these records in\n    sequence and maintains a library of symbols which can be addressed\n    by the following records.  The first record usually is a ``Start\n    Of Image'' record describing the size of the image.\n\n    Starting with version 21, a #REQUIRED_DICT_OR_RESET# (9) record\n    type can appear {\\em before} the #START_OF_DATA# (0) record.  The\n    record type field is followed by a single number arithmetically\n    encoded (cf. ICFDD page 26) using a sixteenth context (cf. ICFDD\n    page 25).  This record appears when the JB2 data chunk requires\n    symbols encoded in a separate JB2 dictionary data chunk.  The\n    number (the {\\bf dictionary size}) indicates how many symbols\n    should have been defined by the JB2 dictionary data chunk.  The\n    decoder should simply load these symbols in the symbol library and\n    proceed as usual.  New symbols potentially defined by the\n    subsequent JB2 image data records will therefore be numbered with\n    integers greater or equal than the dictionary size.\n\n    The JB2 dictionary data format is a pure subset of the JB2 image\n    data format.  The #START_OF_DATA# (0) record always specifies an\n    image width of zero and an image height of zero.  The only allowed\n    record types are those defining library symbols only\n    (#NEW_SYMBOL_LIBRARY_ONLY# (2) and #MATCHED_REFINE_LIBRARY_ONLY#\n    (5) cf. ICFDD page 24) followed by a final #END_OF_DATA# (11)\n    record.\n\n    The JB2 dictionary data is usually located in an {\\bf Djbz} chunk.\n    Each page {\\bf FORM:DJVU} may directly contain a {\\bf Djbz} chunk,\n    or may indirectly point to such a chunk using an {\\bf INCL} chunk\n    (cf. \\Ref{Multipage DjVu documents.}).\n    \n\n    {\\bf Numcoder Reset} --- This extension addresses a problem for\n    hardware implementations.  The encoding of numbers (cf. ICFDD page\n    26) potentially uses an unbounded number of binary coding\n    contexts. These contexts are normally allocated when they are used\n    for the first time (cf. ICFDD informative note, page 27).\n\n    Starting with version 21, a #REQUIRED_DICT_OR_RESET# (9) record\n    type can appear {\\em after} the #START_OF_DATA# (0) record.  The\n    decoder should proceed with the next record after {\\em clearing\n    all binary contexts used for coding numbers}.  This operation\n    implies that all binary contexts previously allocated for coding\n    numbers can be deallocated.\n  \n    Starting with version 21, the JB2 encoder should insert a\n    #REQUIRED_DICT_OR_RESET# record type whenever the number of these\n    allocated binary contexts exceeds #20000#.  Only very large\n    documents ever reach such a large number of allocated binary\n    contexts (e.g large maps).  Hardware implementation however can\n    benefit greatly from a hard bound on the total number of binary\n    coding contexts.  Old JB2 decoders will treat this record type as\n    an #END_OF_DATA# record and cleanly stop decoding (cf. ICFDD page\n    30, Image refinement data).\n\n\n    {\\bf References} ---\n    \\begin{itemize}\n    \\item ICFDD Draft Proposed American National Standard, 1999-08-26.\n    \\item DjVu Specification, \\URL{http://www.lizardtech.com/djvu/sci/djvuspec}.\n    \\end{itemize}\n\n    @memo Extensions to the JB2 format introduced in version 21.  */\n\n//@}\n\n////////////////////////////////////////\n//// CLASS JB2CODEC:  DECLARATION\n////////////////////////////////////////\n\n// This class is accessed via the encode and decode\n// functions of class JB2Image\n\n\n//**** Class JB2Codec\n// This class implements the base class for both the JB2 coder and decoder.\n// The JB2Codec's Contains all contextual information for encoding/decoding\n// a JB2Image.\n\nclass JB2Dict::JB2Codec\n{\npublic:\n  class Decode;\n  class Encode;\n  typedef unsigned int NumContext;\n  virtual ~JB2Codec();\nprotected:\n  // Constructors\n  JB2Codec(const bool xencoding=false);\n  // Forbidden assignment\n  JB2Codec(const JB2Codec &ref);\n  JB2Codec& operator=(const JB2Codec &ref);\n\n  int CodeNum(int lo, int hi, NumContext *pctx,int v);\n  void reset_numcoder(void);\n  inline void code_eventual_lossless_refinement(void);\n  void init_library(JB2Dict &jim);\n  int add_library(const int shapeno, JB2Shape &jshp);\n  void code_relative_location(JB2Blit *jblt, int rows, int columns);\n  void code_bitmap_directly (GBitmap &bm);\n  void code_bitmap_by_cross_coding (GBitmap &bm, GP<GBitmap> &cbm, const int libno);\n  void code_record(int &rectype, const GP<JB2Dict> &jim, JB2Shape *jshp);\n  void code_record(int &rectype, const GP<JB2Image> &jim, JB2Shape *jshp, JB2Blit *jblt);\n  static void compute_bounding_box(GBitmap &cbm, LibRect &lrect);\n  static int get_direct_context( unsigned char const * const up2,\n    unsigned char const * const up1, unsigned char const * const up0,\n    const int column);\n  static int shift_direct_context ( const int context,\n    const int next, unsigned char const * const up2,\n    unsigned char const * const up1, unsigned char const * const up0,\n    const int column);\n  static int get_cross_context( unsigned char const * const up1,\n    unsigned char const * const up0, unsigned char const * const xup1,\n    unsigned char const * const xup0, unsigned char const * const xdn1,\n    const int column );\n  static int shift_cross_context( const int context,\n    const int n, unsigned char const * const up1,\n    unsigned char const * const up0, unsigned char const * const xup1,\n    unsigned char const * const xup0, unsigned char const * const xdn1,\n    const int column );\n\n  virtual bool CodeBit(const bool bit, BitContext &ctx) = 0;\n  virtual void code_comment(GUTF8String &comment) = 0;\n  virtual void code_record_type(int &rectype) = 0;\n  virtual int code_match_index(int &index, JB2Dict &jim)=0;\n  virtual void code_inherited_shape_count(JB2Dict &jim)=0;\n  virtual void code_image_size(JB2Dict &jim);\n  virtual void code_image_size(JB2Image &jim);\n  virtual void code_absolute_location(JB2Blit *jblt,  int rows, int columns)=0;\n  virtual void code_absolute_mark_size(GBitmap &bm, int border=0) = 0;\n  virtual void code_relative_mark_size(GBitmap &bm, int cw, int ch, int border=0) = 0;\n  virtual void code_bitmap_directly(GBitmap &bm,const int dw, int dy,\n    unsigned char *up2, unsigned char *up1, unsigned char *up0 )=0;\n  virtual void code_bitmap_by_cross_coding (GBitmap &bm, GBitmap &cbm,\n    const int xd2c, const int dw, int dy, int cy,\n    unsigned char *up1, unsigned char *up0, unsigned char *xup1, \n    unsigned char *xup0, unsigned char *xdn1 )=0;\n  // Code records\n  virtual int get_diff(const int x_diff,NumContext &rel_loc) = 0;\n\nprivate:\n  bool encoding;\n\nprotected:\n  // NumCoder\n  int cur_ncell;\n  BitContext *bitcells;\n  GPBuffer<BitContext> gbitcells;\n  NumContext *leftcell;\n  GPBuffer<NumContext> gleftcell;\n  NumContext *rightcell;\n  GPBuffer<NumContext> grightcell;\n  // Info\n  bool refinementp;\n  char gotstartrecordp;\n  // Code comment\n  NumContext dist_comment_byte;\n  NumContext dist_comment_length;\n  // Code values\n  NumContext dist_record_type;\n  NumContext dist_match_index;\n  BitContext dist_refinement_flag;\n  // Library\n  GTArray<int> shape2lib;\n  GTArray<int> lib2shape;\n  GTArray<LibRect> libinfo;\n  // Code pairs\n  NumContext abs_loc_x;\n  NumContext abs_loc_y;\n  NumContext abs_size_x;\n  NumContext abs_size_y;\n  NumContext image_size_dist;\n  NumContext inherited_shape_count_dist;\n  BitContext offset_type_dist;\n  NumContext rel_loc_x_current;\n  NumContext rel_loc_x_last;\n  NumContext rel_loc_y_current;\n  NumContext rel_loc_y_last;\n  NumContext rel_size_x;\n  NumContext rel_size_y;\n  int last_bottom;\n  int last_left;\n  int last_right;\n  int last_row_bottom;\n  int last_row_left;\n  int image_columns;\n  int image_rows;\n  int short_list[3];\n  int short_list_pos;\n  inline void fill_short_list(const int v);\n  int update_short_list(const int v);\n  // Code bitmaps\n  BitContext bitdist[1024];\n  BitContext cbitdist[2048];\n};\n\ninline void\nJB2Dict::JB2Codec::code_eventual_lossless_refinement(void)\n{\n  refinementp=CodeBit(refinementp, dist_refinement_flag);\n}\n\ninline void\nJB2Dict::JB2Codec::fill_short_list(const int v)\n{\n  short_list[0] = short_list[1] = short_list[2] = v;\n  short_list_pos = 0;\n}\n\ninline int\nJB2Dict::JB2Codec::get_direct_context( unsigned char const * const up2,\n                    unsigned char const * const up1,\n                    unsigned char const * const up0,\n                    const int column)\n{\n  return ( (up2[column - 1] << 9) |\n              (up2[column    ] << 8) |\n              (up2[column + 1] << 7) |\n              (up1[column - 2] << 6) |\n              (up1[column - 1] << 5) |\n              (up1[column    ] << 4) |\n              (up1[column + 1] << 3) |\n              (up1[column + 2] << 2) |\n              (up0[column - 2] << 1) |\n              (up0[column - 1] << 0) );\n}\n\ninline int\nJB2Dict::JB2Codec::shift_direct_context(const int context, const int next,\n                     unsigned char const * const up2,\n                     unsigned char const * const up1,\n                     unsigned char const * const up0,\n                     const int column)\n{\n  return ( ((context << 1) & 0x37a) |\n              (up1[column + 2] << 2)   |\n              (up2[column + 1] << 7)   |\n              (next << 0)              );\n}\n\ninline int\nJB2Dict::JB2Codec::get_cross_context( unsigned char const * const up1,\n                   unsigned char const * const up0,\n                   unsigned char const * const xup1,\n                   unsigned char const * const xup0,\n                   unsigned char const * const xdn1,\n                   const int column )\n{\n  return ( ( up1[column - 1] << 10) |\n              ( up1[column    ] <<  9) |\n              ( up1[column + 1] <<  8) |\n              ( up0[column - 1] <<  7) |\n              (xup1[column    ] <<  6) |\n              (xup0[column - 1] <<  5) |\n              (xup0[column    ] <<  4) |\n              (xup0[column + 1] <<  3) |\n              (xdn1[column - 1] <<  2) |\n              (xdn1[column    ] <<  1) |\n              (xdn1[column + 1] <<  0) );\n}\n\ninline int\nJB2Dict::JB2Codec::shift_cross_context( const int context, const int n,\n                     unsigned char const * const up1,\n                     unsigned char const * const up0,\n                     unsigned char const * const xup1,\n                     unsigned char const * const xup0,\n                     unsigned char const * const xdn1,\n                     const int column )\n{\n  return ( ((context<<1) & 0x636)  |\n              ( up1[column + 1] << 8) |\n              (xup1[column    ] << 6) |\n              (xup0[column + 1] << 3) |\n              (xdn1[column + 1] << 0) |\n              (n << 7)             );\n}\n\n// ---------- THE END\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/JPEGDecoder.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#ifdef NEED_JPEG_DECODER\n\n#include \"JPEGDecoder.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n#undef HAVE_STDLIB_H\n#undef HAVE_STDDEF_H\n#include <stdio.h>\n#include <jconfig.h>\n#include <jpeglib.h>\n#include <jerror.h>\n#ifdef __cplusplus\n}\n#endif\n\n#include \"ByteStream.h\"\n#include \"GPixmap.h\"\n#ifdef LIBJPEGNAME\n#include \"DjVuDynamic.h\"\n#include \"GString.h\"\n#endif // LIBJPEGNAME\n\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\nclass JPEGDecoder::Impl : public JPEGDecoder\n{\npublic:\n  static void jpeg_byte_stream_src(j_decompress_ptr, ByteStream &);\n};\n\nextern \"C\"\n{\n\nstruct djvu_error_mgr\n{\n  struct jpeg_error_mgr pub;  /* \"public\" fields */\n\n  jmp_buf setjmp_buffer;  /* for return to caller */\n};\n\ntypedef struct djvu_error_mgr * djvu_error_ptr;\n\nMETHODDEF(void)\ndjvu_error_exit (j_common_ptr cinfo)\n{\n  /* cinfo->err really points to a djvu_error_mgr struct, so coerce pointer */\n  djvu_error_ptr djvuerr = (djvu_error_ptr) cinfo->err;\n\n  /* Always display the message. */\n  /* We could postpone this until after returning, if we chose. */\n  (*cinfo->err->output_message) (cinfo);\n\n  /* Return control to the setjmp point */\n  longjmp(djvuerr->setjmp_buffer, 1);\n}\n\n}\n\nGP<GPixmap>\nJPEGDecoder::decode(ByteStream & bs )\n{\n  GP<GPixmap> retval=GPixmap::create();\n  G_TRY\n  {\n    decode(bs,*retval);\n  } G_CATCH_ALL\n  {\n    retval=0;\n  }\n  G_ENDCATCH;\n  return retval;\n}\n\nvoid\nJPEGDecoder::decode(ByteStream & bs,GPixmap &pix)\n{\n  struct jpeg_decompress_struct cinfo;\n\n  /* We use our private extension JPEG error handler. */\n  struct djvu_error_mgr jerr;\n\n  JSAMPARRAY buffer;    /* Output row buffer */\n  int row_stride;   /* physical row width in output buffer */\n  int isGrey,i;\n\n  cinfo.err = jpeg_std_error(&jerr.pub);\n\n  jerr.pub.error_exit = djvu_error_exit;\n\n  if (setjmp(jerr.setjmp_buffer))\n  {\n\n    jpeg_destroy_decompress(&cinfo);\n    G_THROW( ERR_MSG(\"GPixmap.unk_PPM\") );\n  }\n\n  jpeg_create_decompress(&cinfo);\n\n  Impl::jpeg_byte_stream_src(&cinfo, bs);\n\n  (void) jpeg_read_header(&cinfo, TRUE);\n\n  jpeg_start_decompress(&cinfo);\n  \n  /* We may need to do some setup of our own at this point before reading\n   * the data.  After jpeg_start_decompress() we have the correct scaled\n   * output image dimensions available, as well as the output colormap\n   * if we asked for color quantization.\n   * In this example, we need to make an output work buffer of the right size.\n   */\n\n  /* JSAMPLEs per row in output buffer */\n  row_stride = cinfo.output_width * cinfo.output_components;\n\n  /* Make a one-row-high sample array that will go away when done with image */\n  buffer = (*cinfo.mem->alloc_sarray)\n    ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1);\n\n  GP<ByteStream> goutputBlock=ByteStream::create();\n  ByteStream &outputBlock=*goutputBlock;\n  outputBlock.format(\"P6\\n%d %d\\n%d\\n\",cinfo.output_width, \n                                 cinfo.output_height,255);\n\n  isGrey = ( cinfo.out_color_space == JCS_GRAYSCALE) ? 1 : 0; \n\n  while (cinfo.output_scanline < cinfo.output_height)\n  {\n    (void) jpeg_read_scanlines(&cinfo, buffer, 1);\n\n    if ( isGrey == 1 )\n    {\n      for (i=0; i<row_stride; i++)\n      {\n        outputBlock.write8((char)buffer[0][i]); \n        outputBlock.write8((char)buffer[0][i]); \n        outputBlock.write8((char)buffer[0][i]); \n      }\n    }else\n    {\n      for (i=0; i<row_stride; i++) \n        outputBlock.write8((char)buffer[0][i]); \n    }\n  }\n\n  (void) jpeg_finish_decompress(&cinfo);   \n\n  jpeg_destroy_decompress(&cinfo);\n  \n  outputBlock.seek(0,SEEK_SET);\n\n  pix.init(outputBlock);\n}         \n\n/*** From here onwards code is to make ByteStream as the data\n     source for the JPEG library */\n\nextern \"C\"\n{\n\ntypedef struct\n{\n  struct jpeg_source_mgr pub; /* public fields */\n\n  ByteStream * byteStream;    /* source stream */\n  JOCTET * buffer;    /* start of buffer */\n  boolean start_of_stream;  \n} byte_stream_src_mgr;\n                \n\ntypedef byte_stream_src_mgr * byte_stream_src_ptr; \n\n#define INPUT_BUF_SIZE   4096\n\nMETHODDEF(void)\ninit_source (j_decompress_ptr cinfo)\n{\n  byte_stream_src_ptr src = (byte_stream_src_ptr) cinfo->src;\n\n  src->start_of_stream = TRUE;\n}\n\nMETHODDEF(boolean)\nfill_input_buffer (j_decompress_ptr cinfo)\n{\n  byte_stream_src_ptr src = (byte_stream_src_ptr) cinfo->src;\n  size_t nbytes;\n\n  nbytes = src->byteStream->readall(src->buffer, INPUT_BUF_SIZE);\n\n  if (nbytes <= 0)\n  {\n    if (src->start_of_stream) /* Treat empty input as fatal error */\n      ERREXIT(cinfo, JERR_INPUT_EMPTY);\n    WARNMS(cinfo, JWRN_JPEG_EOF);\n    /* Insert a fake EOI marker */\n    src->buffer[0] = (JOCTET) 0xFF;\n    src->buffer[1] = (JOCTET) JPEG_EOI;\n    nbytes = 2;\n  }\n\n  src->pub.next_input_byte = src->buffer;\n  src->pub.bytes_in_buffer = nbytes;\n  src->start_of_stream = FALSE; \n\n  return TRUE;\n}\n\n\nMETHODDEF(void)\nskip_input_data (j_decompress_ptr cinfo, long num_bytes)\n{\n  byte_stream_src_ptr src = (byte_stream_src_ptr) cinfo->src;\n\n  if (num_bytes > (long) src->pub.bytes_in_buffer)\n  {\n    src->byteStream->seek((num_bytes - src->pub.bytes_in_buffer), SEEK_CUR);\n    (void) fill_input_buffer(cinfo);\n  }else\n  {\n    src->pub.bytes_in_buffer -= num_bytes;\n    src->pub.next_input_byte += num_bytes;\n  }\n}\n                 \nMETHODDEF(void)\nterm_source (j_decompress_ptr cinfo)\n{\n  /* no work necessary here */\n}\n\n}\n\nvoid\nJPEGDecoder::Impl::jpeg_byte_stream_src(j_decompress_ptr cinfo,ByteStream &bs)\n{\n  byte_stream_src_ptr src;\n\n  if (cinfo->src == NULL)\n  { /* first time for this JPEG object? */\n    cinfo->src = (struct jpeg_source_mgr *)      \n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n          sizeof(byte_stream_src_mgr));\n    src = (byte_stream_src_ptr) cinfo->src;\n    src->buffer = (JOCTET *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n          INPUT_BUF_SIZE * sizeof(JOCTET));\n  }\n\n  src = (byte_stream_src_ptr) cinfo->src;\n  src->pub.init_source = init_source;\n  src->pub.fill_input_buffer = fill_input_buffer;\n  src->pub.skip_input_data = skip_input_data;\n  src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */\n  src->pub.term_source = term_source;\n  src->byteStream = &bs;\n  src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */\n  src->pub.next_input_byte = NULL; /* until buffer loaded */\n}\n\n#ifdef LIBJPEGNAME\nvoid *\nJPEGDecoder::jpeg_lookup(const GUTF8String &name)\n{\n  static DjVuDynamic lib(GUTF8String(LIBJPEGNAME));\n  void *sym=lib.lookup(name);\n  if(!sym)\n    G_THROW(ERR_MSG(\"DjVuFile.JPEG_bg2\"));\n  return sym;\n}\n\njpeg_error_mgr *\nJPEGDecoder::jpeg_std_error(jpeg_error_mgr *x)\n{\n  static void *sym=jpeg_lookup(\"jpeg_std_error\");\n  return ((jpeg_error_mgr *(*)(jpeg_error_mgr *))sym)(x);\n}\n\nvoid\nJPEGDecoder::jpeg_CreateDecompress(jpeg_decompress_struct *x,int v, size_t s)\n{\n  static void *sym=jpeg_lookup(\"jpeg_CreateDecompress\");\n  ((void (*)(jpeg_decompress_struct *,int,size_t))sym)(x,v,s);\n}\n\nvoid\nJPEGDecoder::jpeg_destroy_decompress(j_decompress_ptr x)\n{\n  static void *sym=jpeg_lookup(\"jpeg_destroy_decompress\");\n  ((void (*)(j_decompress_ptr))sym)(x);\n}\n\nint\nJPEGDecoder::jpeg_read_header(j_decompress_ptr x,boolean y)\n{\n  static void *sym=jpeg_lookup(\"jpeg_read_header\");\n  return ((int (*)(j_decompress_ptr,boolean))sym)(x,y);\n}\n\nJDIMENSION\nJPEGDecoder::jpeg_read_scanlines(j_decompress_ptr x,JSAMPARRAY y,JDIMENSION z)\n{\n  static void *sym=jpeg_lookup(\"jpeg_read_scanlines\");\n  return ((JDIMENSION (*)(j_decompress_ptr,JSAMPARRAY,JDIMENSION))sym)(x,y,z);\n}\n\nboolean\nJPEGDecoder::jpeg_finish_decompress(j_decompress_ptr x)\n{\n  static void *sym=jpeg_lookup(\"jpeg_finish_decompress\");\n  return ((boolean (*)(j_decompress_ptr))sym)(x);\n}\n\nboolean\nJPEGDecoder::jpeg_resync_to_restart(jpeg_decompress_struct *x,int d)\n{\n  static void *sym=jpeg_lookup(\"jpeg_resync_to_restart\");\n  return ((boolean (*)(jpeg_decompress_struct *,int))sym)(x,d);\n}\n\nboolean\nJPEGDecoder::jpeg_start_decompress(j_decompress_ptr x)\n{\n  static void *sym=jpeg_lookup(\"jpeg_start_decompress\");\n  return ((boolean (*)(j_decompress_ptr))sym)(x);\n}\n\n#endif // LIBJPEGNAME\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/JPEGDecoder.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _JPEGDECODER_H_\n#define _JPEGDECODER_H_\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n#ifdef NEED_JPEG_DECODER\n\n#include <stddef.h>\n#include <string.h>\n#include <setjmp.h>\n\n#include \"GSmartPointer.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass ByteStream;\nclass GPixmap;\n\n\n/** @name JPEGDecoder.h\n    Files #\"JPEGDecoder.h\"# and #\"JPEGDecoder.cpp\"# implement an\n    interface to the decoding subset of the IJG JPEG library.\n    @memo\n    Decoding interface to the IJG JPEG library.\n    @author\n    Parag Deshmukh <parag@sanskrit.lz.att.com> \n*/\n//@{\n\nclass GUTF8String;\n\n/** This class ensures namespace isolation. */\nclass JPEGDecoder\n{\npublic:\n  class Impl;\n\n  /** Decodes the JPEG formated ByteStream */ \n  static GP<GPixmap> decode(ByteStream & bs);\n  static void decode(ByteStream & bs,GPixmap &pix);\n#ifdef LIBJPEGNAME\n  static void *jpeg_lookup(const GUTF8String &name);\n  static jpeg_error_mgr *jpeg_std_error(jpeg_error_mgr *x);\n  static void jpeg_CreateDecompress(jpeg_decompress_struct *x,int v, size_t s);\n  static void jpeg_destroy_decompress(j_decompress_ptr x);\n  static int jpeg_read_header(j_decompress_ptr x,boolean y);\n  static JDIMENSION jpeg_read_scanlines(j_decompress_ptr x,JSAMPARRAY y,JDIMENSION z);\n  static boolean jpeg_finish_decompress(j_decompress_ptr x);\n  static boolean jpeg_resync_to_restart(jpeg_decompress_struct *x,int d);\n  static boolean jpeg_start_decompress(j_decompress_ptr x);\n#endif // LIBJPEGNAME\n};\n\n\n//@}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n\n#endif // NEED_JPEG_DECODER\n#endif // _JPEGDECODER_H_\n\n"
  },
  {
    "path": "ext/libdjvu/MMRDecoder.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"MMRDecoder.h\"\n#include \"JB2Image.h\"\n#include \"ByteStream.h\"\n#include \"GBitmap.h\"\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n// ----------------------------------------\n// MMR CODEBOOKS\n\nstatic const char invalid_mmr_data[]= ERR_MSG(\"MMRDecoder.bad_data\");\n\nstruct VLCode \n{\n  unsigned short code;\n  short codelen;\n  short value;\n};\n\nenum MMRMode\n{ \n  P=0, H=1, V0=2, VR1=3, VR2=4, VR3=5, VL1=6, VL2=7, VL3=8 \n};\n\nstatic const VLCode mrcodes[] =\n{   // Codes on 7 bits\n  // 7 bit codes\n  { 0x08,   4,    P }, // 0001\n  { 0x10,   3,    H }, // 001\n  { 0x40,   1,   V0 }, // 1\n  { 0x30,   3,  VR1 }, // 011\n  { 0x06,   6,  VR2 }, // 000011\n  { 0x03,   7,  VR3 }, // 0000011\n  { 0x20,   3,  VL1 }, // 010\n  { 0x04,   6,  VL2 }, // 000010\n  { 0x02,   7,  VL3 }, // 0000010\n  { 0x00,   0,   -1 }  // Illegal entry\n};\n\n\nstatic const VLCode wcodes[] = {    \n  // 13 bit codes\n  { 0x06a0,  8,    0 }, // 00110101\n  { 0x0380,  6,    1 }, // 000111\n  { 0x0e00,  4,    2 }, // 0111\n  { 0x1000,  4,    3 }, // 1000\n  { 0x1600,  4,    4 }, // 1011\n  { 0x1800,  4,    5 }, // 1100\n  { 0x1c00,  4,    6 }, // 1110\n  { 0x1e00,  4,    7 }, // 1111\n  { 0x1300,  5,    8 }, // 10011\n  { 0x1400,  5,    9 }, // 10100\n  { 0x0700,  5,   10 }, // 00111\n  { 0x0800,  5,   11 }, // 01000\n  { 0x0400,  6,   12 }, // 001000\n  { 0x0180,  6,   13 }, // 000011\n  { 0x1a00,  6,   14 }, // 110100\n  { 0x1a80,  6,   15 }, // 110101\n  { 0x1500,  6,   16 }, // 101010\n  { 0x1580,  6,   17 }, // 101011\n  { 0x09c0,  7,   18 }, // 0100111\n  { 0x0300,  7,   19 }, // 0001100\n  { 0x0200,  7,   20 }, // 0001000\n  { 0x05c0,  7,   21 }, // 0010111\n  { 0x00c0,  7,   22 }, // 0000011\n  { 0x0100,  7,   23 }, // 0000100\n  { 0x0a00,  7,   24 }, // 0101000\n  { 0x0ac0,  7,   25 }, // 0101011\n  { 0x04c0,  7,   26 }, // 0010011\n  { 0x0900,  7,   27 }, // 0100100\n  { 0x0600,  7,   28 }, // 0011000\n  { 0x0040,  8,   29 }, // 00000010\n  { 0x0060,  8,   30 }, // 00000011\n  { 0x0340,  8,   31 }, // 00011010\n  { 0x0360,  8,   32 }, // 00011011\n  { 0x0240,  8,   33 }, // 00010010\n  { 0x0260,  8,   34 }, // 00010011\n  { 0x0280,  8,   35 }, // 00010100\n  { 0x02a0,  8,   36 }, // 00010101\n  { 0x02c0,  8,   37 }, // 00010110\n  { 0x02e0,  8,   38 }, // 00010111\n  { 0x0500,  8,   39 }, // 00101000\n  { 0x0520,  8,   40 }, // 00101001\n  { 0x0540,  8,   41 }, // 00101010\n  { 0x0560,  8,   42 }, // 00101011\n  { 0x0580,  8,   43 }, // 00101100\n  { 0x05a0,  8,   44 }, // 00101101\n  { 0x0080,  8,   45 }, // 00000100\n  { 0x00a0,  8,   46 }, // 00000101\n  { 0x0140,  8,   47 }, // 00001010\n  { 0x0160,  8,   48 }, // 00001011\n  { 0x0a40,  8,   49 }, // 01010010\n  { 0x0a60,  8,   50 }, // 01010011\n  { 0x0a80,  8,   51 }, // 01010100\n  { 0x0aa0,  8,   52 }, // 01010101\n  { 0x0480,  8,   53 }, // 00100100\n  { 0x04a0,  8,   54 }, // 00100101\n  { 0x0b00,  8,   55 }, // 01011000\n  { 0x0b20,  8,   56 }, // 01011001\n  { 0x0b40,  8,   57 }, // 01011010\n  { 0x0b60,  8,   58 }, // 01011011\n  { 0x0940,  8,   59 }, // 01001010\n  { 0x0960,  8,   60 }, // 01001011\n  { 0x0640,  8,   61 }, // 00110010\n  { 0x0660,  8,   62 }, // 00110011\n  { 0x0680,  8,   63 }, // 00110100\n  { 0x1b00,  5,   64 }, // 11011\n  { 0x1200,  5,  128 }, // 10010\n  { 0x0b80,  6,  192 }, // 010111\n  { 0x0dc0,  7,  256 }, // 0110111\n  { 0x06c0,  8,  320 }, // 00110110\n  { 0x06e0,  8,  384 }, // 00110111\n  { 0x0c80,  8,  448 }, // 01100100\n  { 0x0ca0,  8,  512 }, // 01100101\n  { 0x0d00,  8,  576 }, // 01101000\n  { 0x0ce0,  8,  640 }, // 01100111\n  { 0x0cc0,  9,  704 }, // 011001100\n  { 0x0cd0,  9,  768 }, // 011001101\n  { 0x0d20,  9,  832 }, // 011010010\n  { 0x0d30,  9,  896 }, // 011010011\n  { 0x0d40,  9,  960 }, // 011010100\n  { 0x0d50,  9, 1024 }, // 011010101\n  { 0x0d60,  9, 1088 }, // 011010110\n  { 0x0d70,  9, 1152 }, // 011010111\n  { 0x0d80,  9, 1216 }, // 011011000\n  { 0x0d90,  9, 1280 }, // 011011001\n  { 0x0da0,  9, 1344 }, // 011011010\n  { 0x0db0,  9, 1408 }, // 011011011\n  { 0x0980,  9, 1472 }, // 010011000\n  { 0x0990,  9, 1536 }, // 010011001\n  { 0x09a0,  9, 1600 }, // 010011010\n  { 0x0c00,  6, 1664 }, // 011000  (what did they think?)\n  { 0x09b0,  9, 1728 }, // 010011011\n  { 0x0020, 11, 1792 }, // 00000001000\n  { 0x0030, 11, 1856 }, // 00000001100\n  { 0x0034, 11, 1920 }, // 00000001101\n  { 0x0024, 12, 1984 }, // 000000010010\n  { 0x0026, 12, 2048 }, // 000000010011\n  { 0x0028, 12, 2112 }, // 000000010100\n  { 0x002a, 12, 2176 }, // 000000010101\n  { 0x002c, 12, 2240 }, // 000000010110\n  { 0x002e, 12, 2304 }, // 000000010111\n  { 0x0038, 12, 2368 }, // 000000011100\n  { 0x003a, 12, 2432 }, // 000000011101\n  { 0x003c, 12, 2496 }, // 000000011110\n  { 0x003e, 12, 2560 }, // 000000011111\n  { 0x0000,  0,   -1 }  // Illegal entry\n};\n\n\nstatic const VLCode bcodes[] = {\n  // 13 bit codes\n  { 0x01b8, 10,    0 }, // 0000110111\n  { 0x0800,  3,    1 }, // 010\n  { 0x1800,  2,    2 }, // 11\n  { 0x1000,  2,    3 }, // 10\n  { 0x0c00,  3,    4 }, // 011\n  { 0x0600,  4,    5 }, // 0011\n  { 0x0400,  4,    6 }, // 0010\n  { 0x0300,  5,    7 }, // 00011\n  { 0x0280,  6,    8 }, // 000101\n  { 0x0200,  6,    9 }, // 000100\n  { 0x0100,  7,   10 }, // 0000100\n  { 0x0140,  7,   11 }, // 0000101\n  { 0x01c0,  7,   12 }, // 0000111\n  { 0x0080,  8,   13 }, // 00000100\n  { 0x00e0,  8,   14 }, // 00000111\n  { 0x0180,  9,   15 }, // 000011000\n  { 0x00b8, 10,   16 }, // 0000010111\n  { 0x00c0, 10,   17 }, // 0000011000\n  { 0x0040, 10,   18 }, // 0000001000\n  { 0x019c, 11,   19 }, // 00001100111\n  { 0x01a0, 11,   20 }, // 00001101000\n  { 0x01b0, 11,   21 }, // 00001101100\n  { 0x00dc, 11,   22 }, // 00000110111\n  { 0x00a0, 11,   23 }, // 00000101000\n  { 0x005c, 11,   24 }, // 00000010111\n  { 0x0060, 11,   25 }, // 00000011000\n  { 0x0194, 12,   26 }, // 000011001010\n  { 0x0196, 12,   27 }, // 000011001011\n  { 0x0198, 12,   28 }, // 000011001100\n  { 0x019a, 12,   29 }, // 000011001101\n  { 0x00d0, 12,   30 }, // 000001101000\n  { 0x00d2, 12,   31 }, // 000001101001\n  { 0x00d4, 12,   32 }, // 000001101010\n  { 0x00d6, 12,   33 }, // 000001101011\n  { 0x01a4, 12,   34 }, // 000011010010\n  { 0x01a6, 12,   35 }, // 000011010011\n  { 0x01a8, 12,   36 }, // 000011010100\n  { 0x01aa, 12,   37 }, // 000011010101\n  { 0x01ac, 12,   38 }, // 000011010110\n  { 0x01ae, 12,   39 }, // 000011010111\n  { 0x00d8, 12,   40 }, // 000001101100\n  { 0x00da, 12,   41 }, // 000001101101\n  { 0x01b4, 12,   42 }, // 000011011010\n  { 0x01b6, 12,   43 }, // 000011011011\n  { 0x00a8, 12,   44 }, // 000001010100\n  { 0x00aa, 12,   45 }, // 000001010101\n  { 0x00ac, 12,   46 }, // 000001010110\n  { 0x00ae, 12,   47 }, // 000001010111\n  { 0x00c8, 12,   48 }, // 000001100100\n  { 0x00ca, 12,   49 }, // 000001100101\n  { 0x00a4, 12,   50 }, // 000001010010\n  { 0x00a6, 12,   51 }, // 000001010011\n  { 0x0048, 12,   52 }, // 000000100100\n  { 0x006e, 12,   53 }, // 000000110111\n  { 0x0070, 12,   54 }, // 000000111000\n  { 0x004e, 12,   55 }, // 000000100111\n  { 0x0050, 12,   56 }, // 000000101000\n  { 0x00b0, 12,   57 }, // 000001011000\n  { 0x00b2, 12,   58 }, // 000001011001\n  { 0x0056, 12,   59 }, // 000000101011\n  { 0x0058, 12,   60 }, // 000000101100\n  { 0x00b4, 12,   61 }, // 000001011010\n  { 0x00cc, 12,   62 }, // 000001100110\n  { 0x00ce, 12,   63 }, // 000001100111\n  { 0x0078, 10,   64 }, // 0000001111\n  { 0x0190, 12,  128 }, // 000011001000\n  { 0x0192, 12,  192 }, // 000011001001\n  { 0x00b6, 12,  256 }, // 000001011011\n  { 0x0066, 12,  320 }, // 000000110011\n  { 0x0068, 12,  384 }, // 000000110100\n  { 0x006a, 12,  448 }, // 000000110101\n  { 0x006c, 13,  512 }, // 0000001101100\n  { 0x006d, 13,  576 }, // 0000001101101\n  { 0x004a, 13,  640 }, // 0000001001010\n  { 0x004b, 13,  704 }, // 0000001001011\n  { 0x004c, 13,  768 }, // 0000001001100\n  { 0x004d, 13,  832 }, // 0000001001101\n  { 0x0072, 13,  896 }, // 0000001110010\n  { 0x0073, 13,  960 }, // 0000001110011\n  { 0x0074, 13, 1024 }, // 0000001110100\n  { 0x0075, 13, 1088 }, // 0000001110101\n  { 0x0076, 13, 1152 }, // 0000001110110\n  { 0x0077, 13, 1216 }, // 0000001110111\n  { 0x0052, 13, 1280 }, // 0000001010010\n  { 0x0053, 13, 1344 }, // 0000001010011\n  { 0x0054, 13, 1408 }, // 0000001010100\n  { 0x0055, 13, 1472 }, // 0000001010101\n  { 0x005a, 13, 1536 }, // 0000001011010\n  { 0x005b, 13, 1600 }, // 0000001011011\n  { 0x0064, 13, 1664 }, // 0000001100100\n  { 0x0065, 13, 1728 }, // 0000001100101\n  { 0x0020, 11, 1792 }, // 00000001000\n  { 0x0030, 11, 1856 }, // 00000001100\n  { 0x0034, 11, 1920 }, // 00000001101\n  { 0x0024, 12, 1984 }, // 000000010010\n  { 0x0026, 12, 2048 }, // 000000010011\n  { 0x0028, 12, 2112 }, // 000000010100\n  { 0x002a, 12, 2176 }, // 000000010101\n  { 0x002c, 12, 2240 }, // 000000010110\n  { 0x002e, 12, 2304 }, // 000000010111\n  { 0x0038, 12, 2368 }, // 000000011100\n  { 0x003a, 12, 2432 }, // 000000011101\n  { 0x003c, 12, 2496 }, // 000000011110\n  { 0x003e, 12, 2560 }, // 000000011111\n  { 0x0000,  0,   -1 }  // Illegal entry\n};\n\n\n\n\n// ----------------------------------------\n// SOURCE OF BITS\n\n#define VLSBUFSIZE    64\n\nclass MMRDecoder::VLSource : public GPEnabled\n{\nprotected:\n  VLSource(GP<ByteStream> &inp);\n  void init(const bool striped);\npublic:\n  // Initializes a bit source on a bytestream\n  static GP<VLSource> create(GP<ByteStream> &inp, const bool striped);\n\n  // Synchronize on the next stripe\n  void nextstripe(void);\n  // Returns a 32 bits integer with at least the \n  // next sixteen code bits in the high order bits.\n  inline unsigned int peek(void);\n  // Ensures that next #peek()# contains at least\n  // the next 24 code bits.\n  void preload(void);\n  // Consumes #n# bits.\n  void shift(const int n);\nprivate:\n  GP<ByteStream> ginp;\n  ByteStream &inp;\n  unsigned char buffer[ VLSBUFSIZE ];\n  unsigned int codeword;\n  int lowbits;\n  int bufpos;\n  int bufmax;\n  int readmax;\n};\n\nMMRDecoder::VLSource::VLSource(GP<ByteStream> &xinp)\n: ginp(xinp), inp(*ginp), codeword(0), \n  lowbits(0), bufpos(0), bufmax(0),\n  readmax(-1)\n{}\n\nvoid\nMMRDecoder::VLSource::init(const bool striped)\n{\n  if (striped)\n    readmax = inp.read32();\n  lowbits = 32;\n  preload();\n}\n\nGP<MMRDecoder::VLSource>\nMMRDecoder::VLSource::create(GP<ByteStream> &inp, const bool striped)\n{\n  VLSource *src=new VLSource(inp);\n  GP<VLSource> retval=src;\n  src->init(striped);\n  return retval;\n}\n\nvoid \nMMRDecoder::VLSource::shift(const int n)\n{ \n  codeword<<=n;\n  lowbits+=n;\n  if (lowbits>=16)\n    preload();\n}\n\ninline unsigned int\nMMRDecoder::VLSource::peek(void)\n{\n  return codeword;\n}\n\n\nvoid\nMMRDecoder::VLSource::nextstripe(void)\n{\n  while (readmax>0)\n    {\n      int size = sizeof(buffer);\n      if (readmax < size) \n        size = readmax;\n      inp.readall(buffer, size);\n      readmax -= size;\n    }\n  bufpos = bufmax = 0;\n  memset(buffer,0,sizeof(buffer));\n  readmax = inp.read32();\n  codeword = 0; \n  lowbits = 32;\n  preload();\n}\n\nvoid\nMMRDecoder::VLSource::preload(void)\n{\n  while (lowbits>=8) \n    {\n      if (bufpos >= bufmax) \n\t{\n          // Refill buffer\n\t  bufpos = bufmax = 0;\n          int size = sizeof(buffer);\n          if (readmax>=0 && readmax<size) \n            size = readmax;\n          if (size>0)\n            bufmax = inp.read((void*)buffer, size);\n          readmax -= bufmax;\n\t  if (bufmax <= 0)\n            return;\n\t}\n      lowbits -= 8;\n      codeword |= buffer[bufpos++] << lowbits;\n    }\n}\n\n\n\n// ----------------------------------------\n// VARIABLE LENGTH CODES\n\n\n\nclass MMRDecoder::VLTable : public GPEnabled\n{\nprotected:\n  VLTable(const VLCode *codes);\n  void init(const int nbits);\npublic:\n  // Construct a VLTable given a codebook with #nbits# long codes.\n  static GP<VLTable> create(VLCode const * const codes, const int nbits);\n\n  // Reads one symbol from a VLSource\n  int decode(MMRDecoder::VLSource *src);\n\n  const VLCode *code;\n  int codewordshift;\n  unsigned char *index;\n  GPBuffer<unsigned char> gindex;\n};\n\nGP<MMRDecoder::VLTable>\nMMRDecoder::VLTable::create(VLCode const * const codes, const int nbits)\n{\n  VLTable *table=new VLTable(codes);\n  GP<VLTable> retval=table;\n  table->init(nbits);\n  return retval;\n}\n\ninline int\nMMRDecoder::VLTable::decode(MMRDecoder::VLSource *src)    \n{ \n  const VLCode &c = code[ index[ src->peek() >> codewordshift ] ];\n  src->shift(c.codelen); \n  return c.value; \n}\n\nMMRDecoder::VLTable::VLTable(const VLCode *codes)\n: code(codes), codewordshift(0), gindex(index,0)\n{}\n\nvoid\nMMRDecoder::VLTable::init(const int nbits)\n{\n  // count entries\n  int ncodes = 0;\n  while (code[ncodes].codelen)\n    ncodes++;\n  // check arguments\n  if (nbits<=1 || nbits>16)\n    G_THROW(invalid_mmr_data);\n  if (ncodes>=256)\n    G_THROW(invalid_mmr_data);\n  codewordshift = 32 - nbits;\n  // allocate table\n  int size = (1<<nbits);\n  gindex.resize(size);\n  gindex.set(ncodes);\n  // process codes\n  for (int i=0; i<ncodes; i++) {\n    const int c = code[i].code;\n    const int b = code[i].codelen;\n    if(b<=0 || b>nbits)\n    {\n      G_THROW(invalid_mmr_data);\n    }\n    // fill table entries whose index high bits are code.\n    int n = c + (1<<(nbits-b));\n    while ( --n >= c ) {\n      if(index[n] != ncodes)\n       G_THROW( ERR_MSG(\"MMRDecoder.bad_codebook\") );\n      index[n] = i;\n    }\n  }\n}\n\n// ----------------------------------------\n// MMR DECODER\n\n\n\nMMRDecoder::~MMRDecoder() {}\n\nMMRDecoder::MMRDecoder( const int xwidth, const int xheight )\n: width(xwidth), height(xheight), lineno(0), \n  striplineno(0), rowsperstrip(0), gline(line,width+8),\n  glineruns(lineruns,width+4), gprevruns(prevruns,width+4)\n{\n  gline.clear();\n  glineruns.clear();\n  gprevruns.clear();\n  lineruns[0] = width;\n  prevruns[0] = width;\n}\n\nvoid\nMMRDecoder::init(GP<ByteStream> gbs, const bool striped)\n{\n  rowsperstrip = (striped ? gbs->read16() : height);\n  src = VLSource::create(gbs, striped);\n  mrtable = VLTable::create(mrcodes, 7);\n  btable = VLTable::create(bcodes, 13);\n  wtable = VLTable::create(wcodes, 13);\n}\n\nGP<MMRDecoder> \nMMRDecoder::create( GP<ByteStream> gbs, const int width,\n  const int height, const bool striped )\n{\n  MMRDecoder *mmr=new MMRDecoder(width,height);\n  GP<MMRDecoder> retval=mmr;\n  mmr->init(gbs,striped);\n  return retval;\n}\n\nconst unsigned short *\nMMRDecoder::scanruns(const unsigned short **endptr)\n{\n  // Check if all lines have been returned\n  if (lineno >= height)\n    return 0;\n  // Check end of stripe\n  if ( striplineno == rowsperstrip )\n    {\n      striplineno=0;\n      lineruns[0] = prevruns[0] = width;\n      src->nextstripe();\n    }\n  // Swap run buffers\n  unsigned short *pr = lineruns;\n  unsigned short *xr = prevruns;\n  prevruns = pr;\n  lineruns = xr;\n  // Loop until scanline is complete\n  bool a0color = false;\n  int a0,rle,b1;\n  for(a0=0,rle=0,b1=*pr++;a0 < width;)\n    {\n      // Process MMR codes\n      const int c=mrtable->decode(src);\n      switch ( c )\n      {\n          /* Pass Mode */\n        case P: \n          { \n            b1 += *pr++;\n            rle += b1 - a0;\n            a0 = b1;\n            b1 += *pr++;\n            break;\n          }\n          /* Horizontal Mode */\n        case H: \n          { \n            // First run\n            VLTable &table1 = *(a0color ? btable : wtable);\n            int inc;\n            do { inc=table1.decode(src); a0+=inc; rle+=inc; } while (inc>=64);\n            *xr = rle; xr++; rle = 0;\n            // Second run\n            VLTable &table2 = *(!a0color ? btable : wtable);\n            do { inc=table2.decode(src); a0+=inc; rle+=inc; } while (inc>=64);\n            *xr = rle; xr++; rle = 0;\n            break;\n          }\n          /* Vertical Modes */\n        case V0:\n        case VR3:\n        case VR2:\n        case VR1:\n        case VL3:\n        case VL2:\n        case VL1:\n        {\n          int inc=b1;\n          switch ( c )\n          {\n          case V0:\n            inc = b1;\n            b1 += *pr++;\n            break;\n          case VR3:\n            inc = b1+3;\n            b1 += *pr++;\n            break;\n          case VR2:\n            inc = b1+2;\n            b1 += *pr++;\n            break;\n          case VR1:\n            inc = b1+1;\n            b1 += *pr++;\n            break;\n          case VL3:\n            inc = b1-3;\n            b1 -= *--pr;\n            break;\n          case VL2:\n            inc = b1-2;\n            b1 -= *--pr;\n            break;\n          case VL1:\n            inc = b1-1;\n            b1 -= *--pr;\n            break;\n          }\n          *xr = inc+rle-a0;\n          xr++;\n          a0 = inc;\n          rle = 0;\n          a0color = !a0color;\n          break;\n        }\n          /* Uncommon modes */\n        default: \n          {\n            src->preload();\n            unsigned int m = src->peek();\n            // -- Could be EOFB ``000000000001000000000001''\n            //    TIFF6 says that all remaining lines are white\n            if ((m & 0xffffff00) == 0x00100100)\n              {\n                lineno = height;\n                return 0;\n              }\n            // -- Could be UNCOMPRESSED ``0000001111''\n            //    TIFF6 says people should not do this.\n            //    RFC1314 says people should do this.\n            else if ((m & 0xffc00000) == 0x03c00000)\n              {\n#ifdef MMRDECODER_REFUSES_UNCOMPRESSED\n                G_THROW( ERR_MSG(\"MMRDecoder.cant_process\") );\n#else\n                // ---THE-FOLLOWING-CODE-IS-POORLY-TESTED---\n                src->shift(10);\n                while ((m = (src->peek() & 0xfc000000)))\n                  {\n                    if (m == 0x04000000)       // 000001\n                      {\n                        src->shift(6);\n                        if (a0color)\n                        {\n                          *xr = rle;\n                          xr++;\n                          rle = 0;\n                          a0color = !a0color;\n                        }\n                        rle += 5;\n                        a0 += 5;\n                      }\n                    else                       // 000010 to 111111 \n                      { \n                        src->shift(1);\n                        if (a0color == !(m & 0x80000000))\n                        {\n                          *xr = rle;\n                          xr++;\n                          rle = 0;\n                          a0color = !a0color;\n                        }\n                        rle++;\n                        a0++;\n                      }\n                    if (a0 > width)\n                      G_THROW(invalid_mmr_data);\n                  }\n                // Analyze uncompressed termination code.\n                m = src->peek() & 0xff000000;  \n                src->shift(8);\n                if ( (m & 0xfe000000) != 0x02000000 )\n                  G_THROW(invalid_mmr_data);\n                if (rle)\n                {\n                  *xr = rle;\n                  xr++;\n                  rle = 0;\n                  a0color = !a0color;\n                }                  \n                if (a0color == !(m & 0x01000000))\n                {\n                  *xr = rle;\n                  xr++;\n                  rle = 0;\n                  a0color = !a0color;\n                }\n                // Cross fingers and proceed ...\n                break;\n#endif\n              }\n            // -- Unknown MMR code.\n            G_THROW(invalid_mmr_data);\n          }\n      }\n      // Next reference run\n      for(;b1<=a0 && b1<width;pr+=2)\n      {\n        b1 += pr[0]+pr[1];\n      }\n    }\n  // Final P must be followed by V0 (they say!)\n  if (rle > 0)\n  {\n    if (mrtable->decode(src) != V0)\n    {\n      G_THROW(invalid_mmr_data);\n    }\n  }\n  if (rle > 0)\n  {\n    *xr = rle;\n    xr++;\n  }\n  // At this point we should have A0 equal to WIDTH\n  // But there are buggy files around (Kofax!)\n  // and we are not the CCITT police.\n  if (a0 > width) \n    {\n      while (a0 > width && xr > lineruns)\n        a0 -= *--xr;\n      if (a0 < width)\n      {\n        *xr = width-a0;\n        xr++;\n      }\n    }\n  /* Increment and return */\n  if (endptr) \n    *endptr = xr;\n  xr[0] = 0;\n  xr[1] = 0;\n  lineno ++;\n  striplineno ++;\n  return lineruns;\n}\n\n\n\nconst unsigned char *\nMMRDecoder::scanrle(const bool invert, const unsigned char **endptr)\n{\n  // Obtain run lengths\n  const unsigned short *xr = scanruns();\n  if (!xr) return 0;\n  unsigned char *p=line;\n  // Process inversion\n  if (invert)\n    {\n      if (! *xr) \n      {\n        xr++;\n      }else\n      {\n        *p = 0; p++;\n      }\n    }\n  // Encode lenghts using the RLE format\n  for(int a0=0;a0 < width;)\n  {\n    int count = *xr++;\n    a0 += count;\n    GBitmap::append_run(p, count);\n  }\n  if (endptr)\n    *endptr = p;\n  p[0] = 0;\n  p[1] = 0;\n  return line;\n}\n\n\n#if 0\nconst unsigned char *\nMMRDecoder::scanline(void)\n{\n  // Obtain run lengths\n  const unsigned short *xr = scanruns();\n  if (!xr) return 0;\n  // Allocate data buffer if needed\n  unsigned char *p = line;\n  // Decode run lengths\n  int a0 = 0;\n  int a0color = 0;\n  while (a0 < width)\n    {\n      int a1 = a0 + *xr++;\n      while (a0<a1 && a0<width)\n        line[a0++] = a0color;\n      a0color = !a0color;\n    }\n  return line;\n}\n#endif\n\n\n\n\n// ----------------------------------------\n// MAIN DECODING ROUTINE\n\nbool\nMMRDecoder::decode_header(\n  ByteStream &inp, int &width, int &height, int &invert)\n{\n  unsigned long int magic = inp.read32();\n  if((magic&0xfffffffc) != 0x4d4d5200)\n    G_THROW( ERR_MSG(\"MMRDecoder.unrecog_header\") ); \n  invert = ((magic & 0x1) ? 1 : 0);\n  const bool strip =  ((magic & 0x2) ? 1 : 0);\n  width = inp.read16();\n  height = inp.read16();\n  if (width<=0 || height<=0)\n    G_THROW( ERR_MSG(\"MMRDecoder.bad_header\") );\n  return strip;\n}\n\nstatic inline int MAX(int a, int b) { return a>b ? a : b; }\nstatic inline int MIN(int a, int b) { return a<b ? a : b; }\n\nGP<JB2Image>\nMMRDecoder::decode(GP<ByteStream> gbs)\n{\n  ByteStream &inp=*gbs;\n  // Read header\n  int width, height, invert;\n  const bool striped=decode_header(inp, width, height, invert);\n  // Prepare image\n  GP<JB2Image> jimg = JB2Image::create();\n  jimg->set_dimension(width, height);\n  // Choose pertinent blocksize\n  int blocksize = MIN(500,MAX(64,MAX(width/17,height/22)));\n  int blocksperline = (width+blocksize-1)/blocksize;\n  // Prepare decoder\n  GP<MMRDecoder> gdcd=MMRDecoder::create(gbs, width, height, striped);\n  MMRDecoder &dcd=*gdcd;\n  // Loop on JB2 bands\n  int line = height-1;\n  while (line >= 0)\n    {\n      int bandline = MIN(blocksize-1,line);\n      GPArray<GBitmap> blocks(0,blocksperline-1);\n      // Loop on scanlines\n      for(; bandline >= 0; bandline--,line--)\n      {\n        // Decode one scanline\n        const unsigned short *s = dcd.scanruns();\n        if (s)\n        {\n\t  // Loop on blocks\n          int x = 0;\n          int b = 0;\n          int firstx = 0;\n          bool c = !!invert;\n          while (x < width)\n            {\n              int xend = x + *s++;\n              while (b<blocksperline)\n                {\n                  int lastx = MIN(firstx+blocksize,width);\n                  if (c)\n                    {\n                      if (!blocks[b])\n                        blocks[b] = GBitmap::create(bandline+1, lastx-firstx);\n                      unsigned char *bptr = (*blocks[b])[bandline] - firstx;\n                      int x1 = MAX(x,firstx);\n                      int x2 = MIN(xend,lastx);\n                      while (x1 < x2)\n                        bptr[x1++] = 1;\n                    }\n                  if (xend < lastx)\n                    break;\n                  firstx = lastx;\n                  b ++;\n                }\n              x = xend;\n              c = !c; \n            }\n\t}\n      }\n      // Insert blocks into JB2Image\n      for (int b=0; b<blocksperline; b++)\n\t{\n\t  JB2Shape shape;\n\t  shape.bits = blocks[b];\n\t  if (shape.bits) \n\t    {\n\t      shape.parent = -1;\n\t      shape.bits->compress();\n\t      JB2Blit blit;\n\t      blit.left = b*blocksize;\n\t      blit.bottom = line+1;\n\t      blit.shapeno = jimg->add_shape(shape);\n\t      jimg->add_blit(blit);\n\t    }\n\t}\n    }\n  // Return\n  return jimg;\n}\n\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/MMRDecoder.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _MMRDECODER_H_\n#define _MMRDECODER_H_\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n#include \"GSmartPointer.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass ByteStream;\nclass JB2Image;\n\n/** @name MMRDecoder.h\n    Files #\"MMRDecoder.h\"# and #\"MMRDecoder.cpp\"# implement a \n    CCITT-G4/MMR decoder suitable for use in DjVu.  The main \n    entry point is function \\Ref{MMRDecoder::decode}.\n\n    The foreground mask layer of a DjVu file is usually encoded with a\n    #\"Sjbz\"# chunk containing JB2 encoded data (cf. \\Ref{JB2Image.h}).\n    Alternatively, the qmask layer may be encoded with a #\"Smmr\"#\n    chunk containing a small header followed by MMR encoded data.\n    This encoding scheme produces significantly larger files. On the\n    other hand, many scanners a printers talk MMR using very efficient\n    hardware components.  This is the reason behind the introduction\n    of #\"Smmr\"# chunks.\n\n    The #Smmr# chunk starts by a header containing the following data:\n    \\begin{verbatim}\n        BYTE*3    :  'M' 'M' 'R'\n        BYTE      :  0xb000000<s><i>\n        INT16     :  <width> (MSB first)\n        INT16     :  <height> (MSB first)\n    \\end{verbatim}\n\n    The header is followed by the encoded data.  Bit 0 of the fourth header\n    byte (#<i>#) is similar to TIFF's ``min-is-black'' tag.  This bit is set\n    for a reverse video image.  The encoded data can be in either ``regular''\n    MMR form or ``striped'' MMR form.  This is indicated by bit 1 of the\n    fourth header byte (#<s>#).  This bit is set to indicate ``striped''\n    data.  The ``regular'' data format consists of ordinary MMR encoded data.\n    The ``striped'' data format consists of one sixteen bit integer (msb\n    first) containing the number of rows per stripe, followed by data for each\n    stripe as follows.\n    \\begin{verbatim}\n        INT16     :  <rowsperstripe> (MSB first)\n        INT32          :  <nbytes1>\n        BYTE*<nbytes1> :  <mmrdata1>\n        INT32          :  <nbytes2>\n        BYTE*<nbytes2> :  <mmrdata2>\n          ...\n    \\end{verbatim}\n    Static function \\Ref{MMRDecoder::decode_header} decodes the header.  You\n    can then create a \\Ref{MMRDecoder} object with the flags #inverted# and\n    #striped# as obtained when decoding the header.  One can also decode raw\n    MMR data by simply initialising a \\Ref{MMRDecoder} object with flag\n    #striped# unset.  Each call to \\Ref{MMRDecoder::scanruns},\n    \\Ref{MMRDecoder::scanrle} or \\Ref{MMRDecoder::scanline} will then decode a\n    row of the MMR encoded image.\n\n    Function \\Ref{MMRDecoder::decode} is a convenience function for decoding\n    the contents of a #\"Smmr\"# chunk.  It returns a \\Ref{JB2Image} divided\n    into manageable blocks in order to provide the zooming and panning\n    features implemented by class \\Ref{JB2Image}.\n\n    @memo\n    CCITT-G4/MMR decoder.\n    @author\n    Parag Deshmukh <parag@sanskrit.lz.att.com> \\\\\n    Leon Bottou <leonb@research.att.com> */\n//@{\n\n\n\n#define MMRDECODER_HAS_SCANRUNS  1\n#define MMRDECODER_HAS_SCANRLE   1\n\n\n\n/** Class for G4/MMR decoding.  The simplest way to use this class is\n    the static member function \\Ref{MMRDecoder::decode}.  This\n    function internally creates an instance of #MMRDecoder# which\n    processes the MMR data scanline by scanline.  */\nclass DJVUAPI MMRDecoder : public GPEnabled\n{\nprotected:\n  MMRDecoder(const int width, const int height);\n  void init(GP<ByteStream> gbs, const bool striped=false);\npublic:\n  /** Main decoding routine that (a) decodes the header using\n      #decode_header#, (b) decodes the MMR data using an instance of\n      #MMRDecoder#, and returns a new \\Ref{JB2Image} composed of tiles\n      whose maximal width and height is derived from the size of the\n      image. */\n  static GP<JB2Image> decode(GP<ByteStream> gbs);\n\n  /// Only decode the header.\n  static bool decode_header(ByteStream &inp, \n                            int &width, int &height, int &invert);\n\npublic:\n  /// Non-virtual destructor.\n  ~MMRDecoder();\n  /** Create a MMRDecoder object for decoding an image\n      of size #width# by #height#. Flag $striped# must be set\n      if the image is composed of multiple stripes. */\n  static GP<MMRDecoder> create(GP<ByteStream> gbs, \n                               const int width, const int height,\n                               const bool striped=false );\n\n  /** Decodes a scanline and returns a pointer to an array of run lengths.\n      The returned buffer contains the length of alternative white and black\n      runs.  These run lengths sum to the image width. They are followed by\n      two zeroes.  The position of these two zeroes is stored in the pointer\n      specified by the optional argument #endptr#.  The buffer data should be\n      processed before calling this function again. */\n  const unsigned short *scanruns(const unsigned short **endptr=0);\n  /** Decodes a scanline and returns a pointer to RLE encoded data.  The\n      buffer contains the length of the runs for the current line encoded as\n      described in \\Ref{PNM and RLE file formats}.)  The flag #invert# can be\n      used to indicate that the MMR data is encoded in reverse video.  The RLE\n      data is followed by two zero bytes.  The position of these two zeroes is\n      stored in the pointer specified by the optional argument #endptr#.  The\n      buffer data should be processed before calling this function again. This\n      is implemented by calling \\Ref{MMRDecoder::scanruns}. */\n  const unsigned char  *scanrle(const bool invert, \n                                const unsigned char **endptr=0);\n#if 0\n  /** Decodes a scanline and returns a pointer to an array of #0# or #1# bytes.\n      Returns a pointer to the scanline buffer containing one byte per pixel. \n      The buffer data should be processed before calling this function again.\n      This is implemented by calling \\Ref{MMRDecoder::scanruns}. */\n  const unsigned char *scanline();\n#endif\n private:\n  int width;\n  int height;\n  int lineno;\n  int striplineno;\n  int rowsperstrip;\n  unsigned char  *line;\n  GPBuffer<unsigned char> gline;\n  unsigned short *lineruns;\n  GPBuffer<unsigned short> glineruns;\n  unsigned short *prevruns;\n  GPBuffer<unsigned short> gprevruns;\npublic:\n  class VLSource;\n  class VLTable;\nprivate:\n  GP<VLSource> src;\n  GP<VLTable> mrtable;\n  GP<VLTable> wtable;\n  GP<VLTable> btable;\n  friend class VLSource;\n  friend class VLTable;\n};\n\n\n//@}\n\n\n// -----------\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/MMX.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"MMX.h\"\n#include <stdio.h>\n#include <stddef.h>\n#include <stdlib.h>\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n// ----------------------------------------\n// PRINTING MMX REGISTERS (Debug)\n\n\n#if defined(MMX) && defined(DEBUG)\nextern \"C\" void\nmmx_show()\n{\n  /* This function can be called from a debugger\n     in order to visualize the contents of the MMX registers. */\n  int mmregs[16];\n  MMXra( movq,  mm0, &mmregs[0]);\n  MMXra( movq,  mm1, &mmregs[2]);\n  MMXra( movq,  mm2, &mmregs[4]);\n  MMXra( movq,  mm3, &mmregs[6]);\n  MMXra( movq,  mm4, &mmregs[8]);\n  MMXra( movq,  mm5, &mmregs[10]);\n  MMXra( movq,  mm6, &mmregs[12]);\n  MMXra( movq,  mm7, &mmregs[14]);\n  MMXemms;\n  for (int i=0; i<8; i++)\n    DjVuPrintMessageUTF8(\"mm%d: %08x%08x\\n\", i, \n           mmregs[i+i+1], mmregs[i+i]);\n  MMXar( movq,  &mmregs[0], mm0);\n  MMXar( movq,  &mmregs[2], mm1);\n  MMXar( movq,  &mmregs[4], mm2);\n  MMXar( movq,  &mmregs[6], mm3);\n  MMXar( movq,  &mmregs[8], mm4);\n  MMXar( movq,  &mmregs[10], mm5);\n  MMXar( movq,  &mmregs[12], mm6);\n  MMXar( movq,  &mmregs[14], mm7);\n}\n#endif\n\n\n\n// ----------------------------------------\n// MMX ENABLE/DISABLE\n\n// Default settings autodetect MMX.\n// Use macro DISABLE_MMX to disable MMX by default.\n\n#if defined(MMX) && !defined(DISABLE_MMX)\nint MMXControl::mmxflag = -1;\n#else\nint MMXControl::mmxflag = 0;\n#endif\n\nint \nMMXControl::disable_mmx()\n{\n  mmxflag = 0;\n  return mmxflag;\n}\n\nint \nMMXControl::enable_mmx()\n{\n  int cpuflags = 0;\n  const char *envvar = getenv(\"LIBDJVU_DISABLE_MMX\");\n  if (envvar && envvar[0] && envvar[0]!='0')\n    return ((mmxflag = 0));\n  \n#if defined(MMX) && defined(__GNUC__) && defined(__i386__)\n  // Detection of MMX for GCC\n  __asm__ volatile (\"pushl %%ebx\\n\\t\"\n                    \"pushfl\\n\\t\"    \n                    \"popl %%ecx\\n\\t\"\n                    \"xorl %%edx,%%edx\\n\\t\"\n                    // Check that CPUID exists\n                    \"movl %%ecx,%%eax\\n\\t\"\n                    \"xorl $0x200000,%%eax\\n\\t\"\n                    \"pushl %%eax\\n\\t\"\n                    \"popfl\\n\\t\"\n                    \"pushfl\\n\\t\"\n                    \"popl %%eax\\n\\t\"\n                    \"xorl %%ecx,%%eax\\n\\t\"\n                    \"jz 1f\\n\\t\"\n                    \"pushl %%ecx\\n\\t\"\n                    \"popfl\\n\\t\"\n                    // Check that CR0:EM is clear\n                    \"smsw %%ax\\n\\t\"\n                    \"andl $4,%%eax\\n\\t\"\n                    \"jnz 1f\\n\\t\"\n                    // Execute CPUID\n                    \"movl $1,%%eax\\n\\t\"\n                    \"cpuid\\n\"\n                    // EBX contains magic when -fPIC is on.\n\t\t    \"1:\\tpopl %%ebx\\n\\t\"\n                    \"movl %%edx, %0\"\n                    : \"=m\" (cpuflags) :\n                    : \"eax\",\"ecx\",\"edx\");\n#endif\n#if defined(MMX) && defined(__GNUC__) && defined(__x86_64__)\n  // Detection of MMX for GCC\n  __asm__ volatile (// Check that CR0:EM is clear\n                    \"xorl %%edx,%%edx\\n\\t\"\n                    \"smsw %%ax\\n\\t\"\n                    \"andl $4,%%eax\\n\\t\"\n                    \"jnz 1f\\n\\t\"\n                    // Execute CPUID\n                    \"movl $1,%%eax\\n\\t\"\n                    \"cpuid\\n\"\n                    // Finish\n\t\t    \"1:\\tmovl %%edx, %0\"\n                    : \"=m\" (cpuflags) :\n                    : \"eax\",\"ebx\",\"ecx\",\"edx\");\n#endif\n#if defined(MMX) && defined(_MSC_VER) && defined(_M_IX86)\n  // Detection of MMX for MSVC 32 bits\n  __asm {  pushfd\n           pop     ecx\n           xor     edx,edx\n             ;// Check that CPUID exists\n           mov     eax,ecx        \n           xor     eax,0x200000\n           push    eax\n           popfd\n           pushfd\n           pop     eax\n           xor     eax,ecx\n           jz      fini\n           push    ecx\n           popfd\n             ;// Check that CR0:EM is zero\n           smsw    ax\n           and     eax,4\n           jnz     fini\n             ;// Execute CPUID\n           mov     eax,1\n           _emit   0xf\n           _emit   0xa2\n         fini:\n           mov     cpuflags,edx\n             ;// MSVC determines clobbered registers by scanning the assembly code.\n             ;// Since it does not know CPUID, it would not know that EBX is clobbered\n             ;// without the dummy instruction below...\n           xor     ebx,ebx\n         }\n#endif\n  mmxflag = !!(cpuflags & 0x800000);\n  return mmxflag;\n}\n\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/MMX.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _MMX_H_\n#define _MMX_H_\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n#include \"DjVuGlobal.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n/** @name MMX.h\n    Files #\"MMX.h\"# and #\"MMX.cpp\"# implement basic routines for\n    supporting the MMX instructions on x86.  Future instruction sets\n    for other processors may be supported in this file as well.\n\n    Macro #MMX# is defined if the compiler supports the X86-MMX instructions.\n    It does not mean however that the processor supports the instruction set.\n    Variable #MMXControl::mmxflag# must be used to decide whether MMX.\n    instructions can be executed.  MMX instructions are entered in the middle\n    of C++ code using the following macros.  Examples can be found in\n    #\"IWTransform.cpp\"#.\n\n    \\begin{description}\n    \\item[MMXrr( insn, srcreg, dstreg)] \n       Encode a register to register MMX instruction \n       (e.g. #paddw# or #punpcklwd#).\n    \\item[MMXar( insn, addr, dstreg )]\n       Encode a memory to register MMX instruction \n       (e.g. #moveq# from memory).\n    \\item[MMXra( insn, srcreg, addr )]\n       Encode a register to memory MMX instruction \n       (e.g. #moveq# to memory).\n    \\item[MMXir( insn, imm, dstreg )]\n       Encode a immediate to register MMX instruction \n       (e.g #psraw#).\n    \\item[MMXemms]\n       Execute the #EMMS# instruction to reset the FPU state.\n    \\end{description}\n\n    @memo\n    Essential support for MMX.\n    @author: \n    L\\'eon Bottou <leonb@research.att.com> -- initial implementation */\n//@{\n\n\n/** MMX Control. \n    Class #MMXControl# encapsulates a few static functions for \n    globally enabling or disabling MMX support. */\n\nclass MMXControl\n{\n public:\n  // MMX DETECTION\n  /** Detects and enable MMX or similar technologies.  This function checks\n      whether the CPU supports a vectorial instruction set (such as Intel's\n      MMX) and enables them.  Returns a boolean indicating whether such an\n      instruction set is available.  Speedups factors may vary. */\n  static int enable_mmx();\n  /** Disables MMX or similar technologies.  The transforms will then be\n      performed using the baseline code. */\n  static int disable_mmx();\n  /** Contains a value greater than zero if the CPU supports vectorial\n      instructions. A negative value means that you must call \\Ref{enable_mmx}\n      and test the value again. Direct access to this member should only be\n      used to transfer the instruction flow to the vectorial branch of the\n      code. Never modify the value of this variable.  Use #enable_mmx# or\n      #disable_mmx# instead. */\n  static int mmxflag;  // readonly\n};\n\n//@}\n\n\n\n\n// ----------------------------------------\n// GCC MMX MACROS\n\n#ifndef NO_MMX\n\n#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))\ntypedef struct{ char c[8]; } MMX_t;\n#define MMXemms \\\n  __asm__ volatile(\"emms\" : : : \"memory\" ) \n#define MMXrr(op,src,dst) \\\n  __asm__ volatile( #op \" %%\" #src \",%%\" #dst : : : \"memory\" ) \n#define MMXir(op,imm,dst) \\\n  __asm__ volatile( #op \" %0,%%\" #dst : : \"i\" (imm) : \"memory\" )\n#define MMXar(op,addr,dst) \\\n  __asm__ volatile( #op \" %0,%%\" #dst : : \"m\" (*(MMX_t*)(addr)) : \"memory\" ) \n#define MMXra(op,src,addr) \\\n  __asm__ volatile( #op \" %%\" #src \",%0\" : \"=m\" (*(MMX_t*)(addr)) : : \"memory\") \n#define MMX 1\n#endif\n\n\n// ----------------------------------------\n// MSVC MMX MACROS\n\n#if defined(_MSC_VER) && defined(_M_IX86)\n// Compiler option /GM is required\n#pragma warning( disable : 4799 )\n#define MMXemms \\\n  __asm { emms }\n#define MMXrr(op,src,dst) \\\n  __asm { op dst,src }\n#define MMXir(op,imm,dst) \\\n  __asm { op dst,imm }\n#define MMXar(op,addr,dst) \\\n  { register __int64 var=*(__int64*)(addr); __asm { op dst,var } }\n#define MMXra(op,src,addr) \\\n  { register __int64 var; __asm { op [var],src };  *(__int64*)addr = var; } \n// Probably not as efficient as GCC macros\n#define MMX 1\n#endif\n\n#endif\n\n// -----------\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/Makefile.dep",
    "content": "Arrays.lo Arrays.o: Arrays.cpp ../config.h Arrays.h GException.h DjVuGlobal.h \\\n  GSmartPointer.h atomic.h ByteStream.h\natomic.lo atomic.o: atomic.cpp ../config.h atomic.h GThreads.h DjVuGlobal.h \\\n  GException.h\nBSByteStream.lo BSByteStream.o: BSByteStream.cpp ../config.h BSByteStream.h ByteStream.h \\\n  Arrays.h GException.h DjVuGlobal.h GSmartPointer.h atomic.h ZPCodec.h \\\n  GContainer.h\nBSEncodeByteStream.lo BSEncodeByteStream.o: BSEncodeByteStream.cpp ../config.h BSByteStream.h \\\n  ByteStream.h Arrays.h GException.h DjVuGlobal.h GSmartPointer.h \\\n  atomic.h ZPCodec.h GContainer.h GString.h\nByteStream.lo ByteStream.o: ByteStream.cpp ../config.h DjVuGlobal.h ByteStream.h \\\n  Arrays.h GException.h GSmartPointer.h atomic.h GOS.h GString.h \\\n  GContainer.h GURL.h GThreads.h DjVuMessage.h DjVuMessageLite.h\nDataPool.lo DataPool.o: DataPool.cpp ../config.h DataPool.h GThreads.h DjVuGlobal.h \\\n  GException.h GString.h GContainer.h GSmartPointer.h atomic.h GURL.h \\\n  Arrays.h IFFByteStream.h ByteStream.h GOS.h debug.h\nddjvuapi.lo ddjvuapi.o: ddjvuapi.cpp ../config.h GException.h DjVuGlobal.h \\\n  GSmartPointer.h atomic.h GThreads.h GContainer.h ByteStream.h Arrays.h \\\n  IFFByteStream.h GString.h BSByteStream.h ZPCodec.h GBitmap.h GPixmap.h \\\n  GScaler.h GRect.h DjVuPort.h GURL.h DataPool.h DjVuInfo.h IW44Image.h \\\n  DjVuImage.h DjVuFile.h DjVuPalette.h DjVuAnno.h DjVuFileCache.h \\\n  DjVuDocument.h DjVuDumpHelper.h DjVuMessageLite.h DjVuMessage.h \\\n  DjVmNav.h DjVuText.h GMapAreas.h DjVuToPS.h DjVmDir.h DjVmDir0.h \\\n  DjVuNavDir.h DjVmDoc.h miniexp.h ddjvuapi.h\ndebug.lo debug.o: debug.cpp ../config.h debug.h\nDjVmDir0.lo DjVmDir0.o: DjVmDir0.cpp ../config.h DjVmDir0.h GString.h DjVuGlobal.h \\\n  GContainer.h GException.h GSmartPointer.h atomic.h ByteStream.h \\\n  Arrays.h debug.h\nDjVmDir.lo DjVmDir.o: DjVmDir.cpp ../config.h DjVmDir.h GString.h DjVuGlobal.h \\\n  GContainer.h GException.h GSmartPointer.h atomic.h GThreads.h \\\n  BSByteStream.h ByteStream.h Arrays.h ZPCodec.h GURL.h debug.h\nDjVmDoc.lo DjVmDoc.o: DjVmDoc.cpp ../config.h DjVmDoc.h DjVmDir.h GString.h \\\n  DjVuGlobal.h GContainer.h GException.h GSmartPointer.h atomic.h \\\n  GThreads.h DjVmNav.h DataPool.h GURL.h Arrays.h IFFByteStream.h \\\n  ByteStream.h GOS.h debug.h\nDjVmNav.lo DjVmNav.o: DjVmNav.cpp ../config.h DjVuDocument.h DjVuPort.h GThreads.h \\\n  DjVuGlobal.h GException.h GURL.h GString.h GContainer.h GSmartPointer.h \\\n  atomic.h Arrays.h DjVmNav.h BSByteStream.h ByteStream.h ZPCodec.h \\\n  debug.h\nDjVuAnno.lo DjVuAnno.o: DjVuAnno.cpp ../config.h DjVuAnno.h GString.h DjVuGlobal.h \\\n  GContainer.h GException.h GSmartPointer.h atomic.h IFFByteStream.h \\\n  ByteStream.h Arrays.h BSByteStream.h ZPCodec.h GMapAreas.h GRect.h \\\n  GURL.h GThreads.h debug.h\nDjVuDocEditor.lo DjVuDocEditor.o: DjVuDocEditor.cpp ../config.h DjVuDocEditor.h \\\n  DjVuDocument.h DjVuPort.h GThreads.h DjVuGlobal.h GException.h GURL.h \\\n  GString.h GContainer.h GSmartPointer.h atomic.h Arrays.h DjVmDoc.h \\\n  DjVmDir.h DjVuImage.h DjVuFile.h DjVuInfo.h GRect.h DjVuPalette.h \\\n  GPixmap.h DjVuAnno.h IFFByteStream.h ByteStream.h DataPool.h \\\n  IW44Image.h ZPCodec.h GOS.h DjVmNav.h debug.h\nDjVuDocument.lo DjVuDocument.o: DjVuDocument.cpp ../config.h DjVuDocument.h DjVuPort.h \\\n  GThreads.h DjVuGlobal.h GException.h GURL.h GString.h GContainer.h \\\n  GSmartPointer.h atomic.h Arrays.h DjVmDoc.h DjVmDir.h DjVmDir0.h \\\n  DjVmNav.h DjVuNavDir.h DjVuImage.h DjVuFile.h DjVuInfo.h GRect.h \\\n  DjVuPalette.h GPixmap.h DjVuAnno.h DjVuFileCache.h IFFByteStream.h \\\n  ByteStream.h GOS.h DataPool.h IW44Image.h ZPCodec.h debug.h\nDjVuDumpHelper.lo DjVuDumpHelper.o: DjVuDumpHelper.cpp ../config.h DjVuDumpHelper.h \\\n  GSmartPointer.h DjVuGlobal.h atomic.h DataPool.h GThreads.h \\\n  GException.h GString.h GContainer.h GURL.h Arrays.h DjVmDir.h \\\n  DjVuInfo.h GRect.h IFFByteStream.h ByteStream.h\nDjVuErrorList.lo DjVuErrorList.o: DjVuErrorList.cpp ../config.h DjVuErrorList.h DjVuPort.h \\\n  GThreads.h DjVuGlobal.h GException.h GURL.h GString.h GContainer.h \\\n  GSmartPointer.h atomic.h Arrays.h DjVmDoc.h DjVmDir.h GOS.h DataPool.h\nDjVuFileCache.lo DjVuFileCache.o: DjVuFileCache.cpp ../config.h DjVuFileCache.h DjVuFile.h \\\n  DjVuInfo.h GSmartPointer.h DjVuGlobal.h atomic.h GRect.h DjVuPalette.h \\\n  GContainer.h GException.h GPixmap.h DjVuPort.h GThreads.h GURL.h \\\n  GString.h Arrays.h debug.h\nDjVuFile.lo DjVuFile.o: DjVuFile.cpp ../config.h DjVuFile.h DjVuInfo.h \\\n  GSmartPointer.h DjVuGlobal.h atomic.h GRect.h DjVuPalette.h \\\n  GContainer.h GException.h GPixmap.h DjVuPort.h GThreads.h GURL.h \\\n  GString.h Arrays.h IFFByteStream.h ByteStream.h GOS.h MMRDecoder.h \\\n  JPEGDecoder.h DjVuAnno.h DjVuText.h GMapAreas.h DataPool.h JB2Image.h \\\n  ZPCodec.h IW44Image.h DjVuNavDir.h BSByteStream.h debug.h\nDjVuGlobal.lo DjVuGlobal.o: DjVuGlobal.cpp ../config.h\nDjVuGlobalMemory.lo DjVuGlobalMemory.o: DjVuGlobalMemory.cpp ../config.h\nDjVuImage.lo DjVuImage.o: DjVuImage.cpp ../config.h DjVuImage.h DjVuFile.h DjVuInfo.h \\\n  GSmartPointer.h DjVuGlobal.h atomic.h GRect.h DjVuPalette.h \\\n  GContainer.h GException.h GPixmap.h DjVuPort.h GThreads.h GURL.h \\\n  GString.h Arrays.h DjVuAnno.h GScaler.h GBitmap.h DjVuDocument.h \\\n  JB2Image.h ZPCodec.h IW44Image.h DataPool.h ByteStream.h GMapAreas.h \\\n  DjVuText.h IFFByteStream.h BSByteStream.h debug.h\nDjVuInfo.lo DjVuInfo.o: DjVuInfo.cpp ../config.h DjVuInfo.h GSmartPointer.h \\\n  DjVuGlobal.h atomic.h GRect.h GException.h ByteStream.h Arrays.h \\\n  GString.h GContainer.h\nDjVuMessage.lo DjVuMessage.o: DjVuMessage.cpp ../config.h DjVuMessage.h \\\n  DjVuMessageLite.h GString.h DjVuGlobal.h GContainer.h GException.h \\\n  GSmartPointer.h atomic.h GOS.h XMLTags.h ByteStream.h Arrays.h GURL.h \\\n  GThreads.h debug.h\nDjVuMessageLite.lo DjVuMessageLite.o: DjVuMessageLite.cpp ../config.h DjVuMessageLite.h \\\n  GString.h DjVuGlobal.h GContainer.h GException.h GSmartPointer.h \\\n  atomic.h GOS.h XMLTags.h ByteStream.h Arrays.h GURL.h GThreads.h \\\n  debug.h\nDjVuNavDir.lo DjVuNavDir.o: DjVuNavDir.cpp ../config.h DjVuNavDir.h GString.h \\\n  DjVuGlobal.h GContainer.h GException.h GSmartPointer.h atomic.h \\\n  GThreads.h GURL.h Arrays.h debug.h GOS.h ByteStream.h\nDjVuPalette.lo DjVuPalette.o: DjVuPalette.cpp ../config.h GException.h DjVuGlobal.h \\\n  ByteStream.h Arrays.h GSmartPointer.h atomic.h BSByteStream.h ZPCodec.h \\\n  GContainer.h DjVuPalette.h GPixmap.h\nDjVuPort.lo DjVuPort.o: DjVuPort.cpp ../config.h DjVuPort.h GThreads.h DjVuGlobal.h \\\n  GException.h GURL.h GString.h GContainer.h GSmartPointer.h atomic.h \\\n  Arrays.h GOS.h DjVuImage.h DjVuFile.h DjVuInfo.h GRect.h DjVuPalette.h \\\n  GPixmap.h DjVuAnno.h DjVuDocument.h DjVuMessageLite.h DataPool.h\nDjVuText.lo DjVuText.o: DjVuText.cpp ../config.h DjVuText.h GMapAreas.h \\\n  GSmartPointer.h DjVuGlobal.h atomic.h GContainer.h GException.h \\\n  GString.h GRect.h GURL.h Arrays.h GThreads.h IFFByteStream.h \\\n  ByteStream.h BSByteStream.h ZPCodec.h debug.h\nDjVuToPS.lo DjVuToPS.o: DjVuToPS.cpp ../config.h DjVuToPS.h DjVuGlobal.h GRect.h \\\n  DjVuDocument.h DjVuPort.h GThreads.h GException.h GURL.h GString.h \\\n  GContainer.h GSmartPointer.h atomic.h Arrays.h DjVuText.h GMapAreas.h \\\n  IFFByteStream.h ByteStream.h BSByteStream.h ZPCodec.h DjVuImage.h \\\n  DjVuFile.h DjVuInfo.h DjVuPalette.h GPixmap.h DjVuAnno.h DataPool.h \\\n  IW44Image.h JB2Image.h GBitmap.h debug.h\nGBitmap.lo GBitmap.o: GBitmap.cpp ../config.h GBitmap.h GSmartPointer.h DjVuGlobal.h \\\n  atomic.h ByteStream.h Arrays.h GException.h GRect.h GString.h \\\n  GContainer.h GThreads.h\nGContainer.lo GContainer.o: GContainer.cpp ../config.h GContainer.h GException.h \\\n  DjVuGlobal.h GSmartPointer.h atomic.h\nGException.lo GException.o: GException.cpp ../config.h GException.h DjVuGlobal.h \\\n  DjVuMessageLite.h GString.h GContainer.h GSmartPointer.h atomic.h \\\n  debug.h\nGIFFManager.lo GIFFManager.o: GIFFManager.cpp ../config.h GIFFManager.h IFFByteStream.h \\\n  DjVuGlobal.h GException.h GString.h GContainer.h GSmartPointer.h \\\n  atomic.h ByteStream.h Arrays.h debug.h\nGMapAreas.lo GMapAreas.o: GMapAreas.cpp ../config.h GMapAreas.h GSmartPointer.h \\\n  DjVuGlobal.h atomic.h GContainer.h GException.h GString.h GRect.h \\\n  GURL.h Arrays.h GThreads.h debug.h\nGOS.lo GOS.o: GOS.cpp ../config.h GException.h DjVuGlobal.h GThreads.h GOS.h \\\n  GString.h GContainer.h GSmartPointer.h atomic.h GURL.h Arrays.h\nGPixmap.lo GPixmap.o: GPixmap.cpp ../config.h GPixmap.h GSmartPointer.h DjVuGlobal.h \\\n  atomic.h GString.h GContainer.h GException.h ByteStream.h Arrays.h \\\n  GRect.h GBitmap.h GThreads.h JPEGDecoder.h\nGRect.lo GRect.o: GRect.cpp ../config.h GRect.h DjVuGlobal.h GException.h\nGScaler.lo GScaler.o: GScaler.cpp ../config.h GScaler.h GException.h DjVuGlobal.h \\\n  GRect.h GBitmap.h GSmartPointer.h atomic.h GPixmap.h\nGSmartPointer.lo GSmartPointer.o: GSmartPointer.cpp ../config.h GThreads.h DjVuGlobal.h \\\n  GException.h GSmartPointer.h atomic.h\nGString.lo GString.o: GString.cpp ../config.h GString.h DjVuGlobal.h GContainer.h \\\n  GException.h GSmartPointer.h atomic.h GThreads.h debug.h\nGThreads.lo GThreads.o: GThreads.cpp ../config.h GThreads.h DjVuGlobal.h GException.h \\\n  DjVuMessageLite.h GString.h GContainer.h GSmartPointer.h atomic.h\nGUnicode.lo GUnicode.o: GUnicode.cpp ../config.h GString.h DjVuGlobal.h GContainer.h \\\n  GException.h GSmartPointer.h atomic.h\nGURL.lo GURL.o: GURL.cpp ../config.h GException.h DjVuGlobal.h GOS.h GString.h \\\n  GContainer.h GSmartPointer.h atomic.h GURL.h Arrays.h GThreads.h \\\n  debug.h\nIFFByteStream.lo IFFByteStream.o: IFFByteStream.cpp ../config.h IFFByteStream.h \\\n  DjVuGlobal.h GException.h GString.h GContainer.h GSmartPointer.h \\\n  atomic.h ByteStream.h Arrays.h\nIW44EncodeCodec.lo IW44EncodeCodec.o: IW44EncodeCodec.cpp ../config.h IW44Image.h \\\n  GSmartPointer.h DjVuGlobal.h atomic.h ZPCodec.h GContainer.h \\\n  GException.h GBitmap.h GPixmap.h IFFByteStream.h GString.h ByteStream.h \\\n  Arrays.h GRect.h MMX.h\nIW44Image.lo IW44Image.o: IW44Image.cpp ../config.h IW44Image.h GSmartPointer.h \\\n  DjVuGlobal.h atomic.h ZPCodec.h GContainer.h GException.h GBitmap.h \\\n  GPixmap.h IFFByteStream.h GString.h ByteStream.h Arrays.h GRect.h MMX.h\nJB2EncodeCodec.lo JB2EncodeCodec.o: JB2EncodeCodec.cpp ../config.h JB2Image.h GString.h \\\n  DjVuGlobal.h GContainer.h GException.h GSmartPointer.h atomic.h \\\n  ZPCodec.h GBitmap.h\nJB2Image.lo JB2Image.o: JB2Image.cpp ../config.h JB2Image.h GString.h DjVuGlobal.h \\\n  GContainer.h GException.h GSmartPointer.h atomic.h ZPCodec.h GThreads.h \\\n  GRect.h GBitmap.h\nJPEGDecoder.lo JPEGDecoder.o: JPEGDecoder.cpp ../config.h JPEGDecoder.h GSmartPointer.h \\\n  DjVuGlobal.h atomic.h ByteStream.h Arrays.h GException.h GPixmap.h\nminiexp.lo miniexp.o: miniexp.cpp ../config.h miniexp.h\nMMRDecoder.lo MMRDecoder.o: MMRDecoder.cpp ../config.h MMRDecoder.h GSmartPointer.h \\\n  DjVuGlobal.h atomic.h JB2Image.h GString.h GContainer.h GException.h \\\n  ZPCodec.h ByteStream.h Arrays.h GBitmap.h\nMMX.lo MMX.o: MMX.cpp ../config.h MMX.h DjVuGlobal.h\nUnicodeByteStream.lo UnicodeByteStream.o: UnicodeByteStream.cpp ../config.h \\\n  UnicodeByteStream.h DjVuGlobal.h GString.h GContainer.h GException.h \\\n  GSmartPointer.h atomic.h ByteStream.h Arrays.h\nXMLParser.lo XMLParser.o: XMLParser.cpp ../config.h XMLParser.h GContainer.h \\\n  GException.h DjVuGlobal.h GSmartPointer.h atomic.h GURL.h GString.h \\\n  Arrays.h GThreads.h XMLTags.h ByteStream.h GOS.h DjVuDocument.h \\\n  DjVuPort.h DjVuText.h GMapAreas.h GRect.h DjVuAnno.h DjVuFile.h \\\n  DjVuInfo.h DjVuPalette.h GPixmap.h DjVuImage.h debug.h\nXMLTags.lo XMLTags.o: XMLTags.cpp ../config.h XMLTags.h GContainer.h GException.h \\\n  DjVuGlobal.h GSmartPointer.h atomic.h GString.h UnicodeByteStream.h \\\n  ByteStream.h Arrays.h\nZPCodec.lo ZPCodec.o: ZPCodec.cpp ../config.h ZPCodec.h GContainer.h GException.h \\\n  DjVuGlobal.h GSmartPointer.h atomic.h ByteStream.h Arrays.h\n"
  },
  {
    "path": "ext/libdjvu/Makefile.in",
    "content": "#C- This program is free software; you can redistribute it and/or \n#C- modify it under the terms of the GNU General Public License, \n#C- either Version 2 of the License or (at your option) any later\n#C- version.  The license should have accompanied the program \n#C- or you may obtain a copy of the license from the Free Software\n#C- Foundation at http://www.fsf.org.\n#C- \n#C- This program is distributed in the hope that it will be useful,\n#C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n#C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n#C- GNU General Public License for more details.\n\n@SET_MAKE@\nSHELL = @SHELL@\nVPATH = @srcdir@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_VERSION = @PACKAGE_VERSION@\n\nsrcdir = @srcdir@\ntop_srcdir = @top_srcdir@\ntop_builddir = ..\n\nprefix = @prefix@\nexec_prefix = @exec_prefix@\nbindir = @bindir@\ndatarootdir = @datarootdir@\ndatadir = @datadir@\nlibdir = @libdir@\nmandir = @mandir@\nincludedir = @includedir@\n\nCC = @CC@\nCXX = @CXX@\nRM = @RM@\nAR = @AR@\nLN_S = @LN_S@\nTOUCH = @TOUCH@\nINSTALL = @INSTALL@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_DATA = @INSTALL_DATA@\nLIBTOOL = @LIBTOOL@\n\nDEFS = @DEFS@\nOPTS = @OPTS@\nCXXRPOFLAGS = @CXXRPOFLAGS@\nJPEG_LIBS=@JPEG_LIBS@\nJPEG_CFLAGS=@JPEG_CFLAGS@\nTHREAD_LIBS = @THREAD_LIBS@\nTHREAD_CFLAGS = @THREAD_CFLAGS@\n\nLIBDJVU_LA = libdjvulibre.la\nLIBDJVU_VER = @LIBDJVU_VER@\n\nINCS = -I${top_builddir} -I${srcdir}\nFLAGS = ${DEFS} ${INCS} ${OPTS} ${JPEG_CFLAGS} ${THREAD_CFLAGS}\nLIBS= @LDFLAGS@ ${JPEG_LIBS} ${THREAD_LIBS} @LIBS@\nCFLAGS = ${FLAGS} @CPPFLAGS@ @CFLAGS@ \nCXXFLAGS =  ${FLAGS} ${CXXPICFLAGS} ${CXXRPOFLAGS} @CPPFLAGS@ @CXXFLAGS@ \nDLLFLAGS = @DLLFLAGS@\n\nall: ${LIBDJVU_LA} \n\ninstall: install-lib install-data install-include install-pkgconfig\n\nOBJS =  DjVuGlobal.lo DjVuGlobalMemory.lo GOS.lo GException.lo GContainer.lo \\\n        GString.lo GThreads.lo GRect.lo atomic.lo GSmartPointer.lo MMX.lo    \\\n        Arrays.lo GBitmap.lo GPixmap.lo GScaler.lo DjVuPalette.lo\t     \\\n        ByteStream.lo IFFByteStream.lo BSByteStream.lo BSEncodeByteStream.lo \\\n        ZPCodec.lo JB2Image.lo JB2EncodeCodec.lo IW44Image.lo\t\t     \\\n        IW44EncodeCodec.lo MMRDecoder.lo JPEGDecoder.lo DataPool.lo GURL.lo  \\\n        DjVuFileCache.lo DjVuPort.lo GMapAreas.lo DjVuAnno.lo GIFFManager.lo \\\n        DjVuText.lo DjVuInfo.lo DjVuFile.lo DjVuImage.lo DjVuDocument.lo     \\\n        DjVmDir.lo DjVmDoc.lo DjVmDir0.lo DjVmNav.lo DjVuNavDir.lo\t     \\\n        DjVuErrorList.lo DjVuDocEditor.lo DjVuToPS.lo DjVuDumpHelper.lo\t     \\\n        DjVuMessageLite.lo DjVuMessage.lo GUnicode.lo UnicodeByteStream.lo   \\\n        XMLParser.lo XMLTags.lo miniexp.lo ddjvuapi.lo debug.lo\n\n${LIBDJVU_LA} : ${OBJS}\n\t@echo \"[ generating $@ ... ]\"\n\t${LIBTOOL} --mode=link ${CXX} ${CXXFLAGS} -no-undefined \\\n\t    -rpath ${libdir} -version-info ${LIBDJVU_VER} ${DLLFLAGS} \\\n\t    ${OBJS} ${LIBS} -o ${LIBDJVU_LA}\n\n@RPO_YES@${LIBDJVU_LA} : libdjvu-rpo\n@RPO_YES@libdjvu-rpo : ${OBJS}\n@RPO_YES@\t@echo \"[ performing library closure ... ]\"\n@RPO_YES@\t@echo \"int main() { return 0; }\" > $@.cpp\n@RPO_YES@\t${LIBTOOL} --mode=compile ${CXX} ${CXXFLAGS} -c $@.cpp\n@RPO_YES@\t${LIBTOOL} --mode=link ${CXX} ${CXXFLAGS} -o $@ $@.lo ${OBJS} ${LIBS}\n\ninstall-data: FORCE\n\t${INSTALL} -d ${DESTDIR}${datadir}/djvu\n\tfor n in `cd ${top_srcdir}/share && \\\n\t          find djvu -name '*.xml' -print` ; do \\\n\t  src=\"${top_srcdir}/share/$$n\" ; \\\n\t  dir=\"`dirname ${datadir}/$$n`\" ;\\\n\t  test -d ${DESTDIR}$$dir || ${INSTALL} -d ${DESTDIR}$$dir ; \\\n\t  ${INSTALL_DATA} $$src ${DESTDIR}$$dir || exit ; done\n\ninstall-lib: ${LIBDJVU_LA} FORCE\n\t${INSTALL} -d ${DESTDIR}${libdir}\n\t${LIBTOOL} --mode=install \\\n\t  ${INSTALL_DATA} ${LIBDJVU_LA} ${DESTDIR}${libdir}\n\ninstall-include: FORCE\n\t${INSTALL} -d ${DESTDIR}${includedir}/libdjvu\n\t${INSTALL_DATA} ${srcdir}/ddjvuapi.h ${DESTDIR}${includedir}/libdjvu\n\t${INSTALL_DATA} ${srcdir}/miniexp.h ${DESTDIR}${includedir}/libdjvu\n\ninstall-pkgconfig: FORCE\n\t${INSTALL} -d ${DESTDIR}${libdir}/pkgconfig\n\t${INSTALL_DATA} ddjvuapi.pc ${DESTDIR}${libdir}/pkgconfig\n\ndepend: FORCE\n\tfor n in ${srcdir}/*.cpp ; do \\\n\t  ${CXX} -MM ${CXXFLAGS} $$n | \\\n\t    sed -e 's/^\\([^.]*\\)\\.o:/\\1.lo \\1.o:/'; \\\n\tdone > Makefile.dep\n\nclean: FORCE\n\t-${LIBTOOL} --mode=clean ${RM} 2>/dev/null *.lo *.la \n\t-${RM} 2>/dev/null libdjvu-rpo\n\ndistclean: clean \n\t-${RM} -r 2>/dev/null Makefile *.rpo ii_files\n\nFORCE:\n.PHONY: FORCE\n.SUFFIXES: .c .cpp .lo .o\n\n.c.o:\n\t${CC} ${CFLAGS} -c $<\n\n.cpp.o:\n\t${CXX} ${CXXFLAGS} -c $<\n\n.c.lo:\n\t${LIBTOOL} --mode=compile ${CC} ${CFLAGS} -c $<\n\n.cpp.lo:\n\t${LIBTOOL} --mode=compile ${CXX} ${CXXFLAGS} -c $<\n\n# Dependencies\n\nMakefile.dep: ${srcdir}/Makefile.dep\n\tcp ${srcdir}/Makefile.dep $@\n\ninclude Makefile.dep\n\n"
  },
  {
    "path": "ext/libdjvu/Template.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n//T// This is a template for the header files in the\n//T// DjVu reference library. It describes the general\n//T// conventions as well as the documentation. \n//T// Comments prefixed with '//T//' explain the template\n//T// features and should be removed.\n\n#ifndef _TEMPLATE_H_\n#define _TEMPLATE_H_\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n//T// Always include \"DjVuGlobal.h\"\n#include \"DjVuGlobal.h\"\n\n//T// Other include files\n#include <string.h>\n#include \"GException.h\"\n\n//T// Begin name space\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n/** @name Template.h\n    \n    Files #\"Template.h\"# and #\"Template.cpp\"# are not used for anything but\n    the current programming and documentation standards in the DjVu reference\n    library. This doc++ comment briefly describes the abstractions defined in\n    this files.  It must mention all the files involved in implementing this\n    features, as well as references to the main classes \\Ref{classname}.  \n\n    This comment may contain additional sections as follows:\n\n    {\\bf Algorithmic Remarks} --- Comments about the algorithms, their\n    performance and their limitations.\n\n    {\\bf Historical Remarks} --- Comments about the successive revisions of\n    this file and other anecdotical details. This is where we can amuse the\n    reader with funny details.\n\n    {\\bf ToDo} --- Things that we have been thinking to do but did not\n    fully implement yet. It should explain how we plan to modify the current\n    code could be modified to implement these things. People who change this\n    code thus should avoid jeopardizing these plans.\n    \n    {\\bf Example} --- It would be cool to demonstrate how these functions\n    can be used by providing a small segment of C/C++ code.\n    \\begin{verbatim}\n       ExampleClass toto(3,4);\n       toto.draw(mywin);\n    \\end{verbatim}\n\n    This main doc++ comment is followed by a few doc++ entries.\n    \\begin{itemize}\n    \\item the \"memo\" field contains a single line description of the file.\n    \\item the \"version\" field contains a cvs magic expression.\n    \\item the author fields contains a list of authors and email addresses.\n          (the #\\\\# termination breaks the line.)\n    \\end{itemize}\n\n    @memo \n    Template header file\n    @author: \n    L\\'eon Bottou <leonb@research.att.com> -- initial implementation \\\\\n    Andrew Erofeev <eaf@geocities.com> -- implemented EXTERNAL_TEMPLATES */\n//@{\n//T// The magic doc++ comment above opens a doc++ context.\n\n\n\n//T// Now comes the 'interface part' of the file.\n//T// The c++ classes and public functions are defined there.\n//T// Doc++ comments must be inserted for all functions\n//T// intended to be used by other people. \n//T//\n//T// Quite often c++ sucks and it is necessary to have public or external symbols\n//T// that actually are only there for implementation purposes. \n//T// It is good to give a comment but this should not be a doc++ comment\n//T// (see class GPool in GContainer.h).  All other 'public' and 'protected' \n//T// members should have a doc++ comment. There is no need to comment 'private'\n//T// members, although a regular comment can be useful (not a doc++ comment). \n\n\n\n/** One-line class description.\n    Long description. There is no need to repeat the class name in the\n    one-line description. The long description should describe the abstraction\n    and point the user to the main member functions.  An example could be\n    inserted when this is informative and not redundant with the file\n    description.  Templates should document which member functions are\n    required for their type argument. The availability of non availabilty of a\n    copy constructor/copy operator can be specified when appropriate. \n    See the doc++ documentation for available LaTeX constructs. \n*/\n\nclass ExampleClass\n{\npublic:\n  /** Virtual Destructor. */\n  ~ExampleClass();\n  /** Null Constructor. */\n  ExampleClass();\n  /** Copy Constructor. */\n  ExampleClass(ExampleClass &ref);\n  /** Copy operator. */\n  ExampleClass& operator=(ExampleClass &ref);\n  /** Example of member function. The first sentence of the member\n      function description must be a short single line description.\n      The rest can be more verbose. Excerpts of C or C++ text should \n      be surrounded by dieze characters (as in #win#).  The doc++ #@param#\n      construct should be used when there is a need for additional details\n      about the arguments. In that case all the arguments must be documented\n      with a #@param# directive.\n      @param win drawing window.\n      This window must be created with #CreateWindow# and must be visible when\n      function #draw# is called.\n   */\n  void draw(Window win);\nprotected:\n  /** Minimal x-coordinate. */\n  int xmin;\n  /** Maximal x-coordinate. */\n  int xmax;\nprivate:\n  int whatever;\n  float encode;\n};\n\n\n/** One-line function description.\n    Long description. Public external functions should be documented\n    as classes. Note that a family of public external function can be \n    introduced by a generic entry (see below) */\n\nExampleClass combine_example_classes(const ExampleClass&, \n                                     const ExampleClass &b);\n\n\n/** @name Generic entry.\n    Long description. there is sometimes a need to add documentation\n    entries for grouping things which are not connected by the C++ \n    syntax (a family of functions, a family of defines, etc...).\n    The description starts with a very short name (introduced with #@name#)\n    followed by a long description.  Because of doc++ limitations,\n    the one-line description must appear after the long description\n    in a #@memo# entry.\n    @memo One-line description\n*/\n\n//T// The following comments should be used when\n//T// the preceding generic entry contains sub-entries\n//@{\n//T// Sub-entries (both DOC++ and C++) should be declared there.\n//@}\n\n\n\n\n\n\n//@}\n//T// The magic doc++ comment above closes the doc++ file context.\n//T// The rest of the file only contains implementation stuff.\n\n// ------------ CLASSEXAMPLE INLINES\n//T// This is where all the inline/template functions should be written\n//T// This part of the file is segmented with comments.\n\ninline void \nClassExample::width()\n{\n  return xmax-xmin;\n}\n\n\n\n// ------------ THE END\n//T// End name space\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n//T// Terminates the multiple inclusion #ifndef\n      \n      \n             \n\n    \n"
  },
  {
    "path": "ext/libdjvu/UnicodeByteStream.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"UnicodeByteStream.h\"\n#include \"ByteStream.h\"\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nUnicodeByteStream::UnicodeByteStream(const UnicodeByteStream &uni)\n: bs(uni.bs), buffer(uni.buffer), bufferpos(uni.bufferpos), linesread(0)\n{\n  startpos=bs->tell();\n}\n\nUnicodeByteStream::UnicodeByteStream(\n  GP<ByteStream> ibs,const GStringRep::EncodeType et)\n: bs(ibs), bufferpos(0), linesread(0)\n{\n  buffer=GUTF8String::create(0,0,et);\n  startpos=bs->tell();\n}\n\nUnicodeByteStream::~UnicodeByteStream()\n{}\n\nstatic int\nCountLines(const GUTF8String &str)\n{\n  int retval=0;\n  static const unsigned long lf='\\n';\n  for(int pos=0;(pos=str.search(lf,pos)+1)>0;++retval)\n    EMPTY_LOOP;\n  return retval;\n}\n\nvoid\nUnicodeByteStream::set_encodetype(const GStringRep::EncodeType et)\n{\n  seek(startpos,SEEK_SET);\n  bufferpos=0;\n  buffer=GUTF8String::create(0,0,et);\n}\n\nvoid\nUnicodeByteStream::set_encoding(const GUTF8String &xencoding)\n{\n  seek(startpos,SEEK_SET);\n  bufferpos=0;\n  buffer=GUTF8String::create(0,0,xencoding);\n}\n\nsize_t\nUnicodeByteStream::read(void *buf, size_t size)\n{\n  bufferpos=0;\n  const int retval=bs->read(buf,size);\n  if(retval)\n  {\n    buffer=GUTF8String::create(\n      (unsigned char const *)buf,retval,buffer.get_remainder());\n  }else\n  {\n    buffer=GUTF8String::create(0,0,buffer.get_remainder());\n  }\n  return retval;\n}\n\nsize_t\nUnicodeByteStream::write(const void *buf, size_t size)\n{\n  bufferpos=0;\n  buffer=GUTF8String::create(0,0,buffer.get_remainder());\n  return bs->write(buf,size);\n}\n\nlong \nUnicodeByteStream::tell(void) const\n{\n  return bs->tell();\n}\n\nUnicodeByteStream & \nUnicodeByteStream::operator=(UnicodeByteStream &uni)\n{\n  bs=uni.bs;\n  bufferpos=uni.bufferpos;\n  buffer=uni.buffer;\n  return *this;\n}\n\nint \nUnicodeByteStream::seek\n(long offset, int whence, bool nothrow)\n{\n  int retval=bs->seek(offset,whence,nothrow);\n  bufferpos=0;\n  buffer=GUTF8String::create(0,0,buffer.get_remainder());\n  return retval;\n}\n\nvoid \nUnicodeByteStream::flush(void)\n{\n  bs->flush();\n  bufferpos=0;\n  buffer=GUTF8String::create(0,0,buffer.get_remainder());\n}\n\n\n\nGUTF8String\nUnicodeByteStream::gets(\n  size_t const t,unsigned long const stopat,bool const inclusive)\n{\n  GUTF8String retval;\n  unsigned int len=buffer.length()-bufferpos;\n  if(!len)\n  {\n    int i;\n    char *buf;\n  \tstatic const size_t bufsize=327680;\n    GPBuffer<char> gbuf(buf,bufsize);\n    while((i=read(buf,bufsize)>0))\n    {\n      if((len=buffer.length()-bufferpos))\n        break;\n    }\n  }\n  if(len)\n  {\n    int i=buffer.search((char)stopat,bufferpos);\n    if(i>=0)\n    {\n      if(inclusive)\n      {\n        ++i;\n      }\n      if(t&&(i>(int)t+bufferpos))\n      {\n        i=t+bufferpos;\n      }\n      if(i>bufferpos)\n      {\n        retval=buffer.substr(bufferpos,i-bufferpos);\n      }\n      bufferpos=i;\n      linesread+=CountLines(retval);\n    }else\n    {\n      retval=buffer.substr(bufferpos,len);\n      bufferpos=buffer.length();\n      linesread+=CountLines(retval);\n      retval+=gets(t?(t-(i-bufferpos)):0,stopat,inclusive);\n    }\n  }\n  return retval;\n}\n\nXMLByteStream::XMLByteStream(UnicodeByteStream &uni)\n: UnicodeByteStream(uni) {}\n\nXMLByteStream::XMLByteStream(GP<ByteStream> &ibs) \n: UnicodeByteStream(ibs,GStringRep::XOTHER)\n{}\n\nGP<XMLByteStream>\nXMLByteStream::create(GP<ByteStream> ibs) \n{\n  XMLByteStream *xml=new XMLByteStream(ibs);\n  GP<XMLByteStream> retval=xml;\n  xml->init();\n  return retval;\n}\n\nvoid\nXMLByteStream::init(void)\n{\n  unsigned char buf[4];\n  GP<ByteStream> ibs=bs;\n  bufferpos=0;\n  bs->readall(buf,sizeof(buf));\n  const unsigned int i=(buf[0]<<8)+buf[1];\n  switch(i)\n  {\n    case 0x0000:\n    {\n      const unsigned int j=(buf[2]<<8)+buf[3];\n      switch(j)\n      {\n        case 0x003C:\n        {\n          buffer=GUTF8String::create(buf,sizeof(buf),GStringRep::XUCS4BE);\n          break;\n        }\n        case 0x3C00:\n        {\n          buffer=GUTF8String::create(buf,sizeof(buf),GStringRep::XUCS4_2143);\n          break;\n        }\n        case 0xFEFF:\n        {\n          buffer=GUTF8String::create(0,0,GStringRep::XUCS4BE);\n          startpos+=sizeof(buf);\n          break;\n        }\n        case 0xFFFE:\n        {\n          buffer=GUTF8String::create(0,0,GStringRep::XUCS4_2143);\n          startpos+=sizeof(buf);\n          break;\n        }\n        default:\n        {\n          buffer=GUTF8String::create(buf,sizeof(buf),GStringRep::XUTF8);\n          break;\n        }\n      }\n    }\n    case 0x003C:\n    {\n      const unsigned int j=(buf[2]<<8)+buf[3];\n      switch(j)\n      {\n        case 0x0000:\n          buffer=GUTF8String::create(buf,sizeof(buf),GStringRep::XUCS4_3412);\n          break;\n        case 0x003F:\n          buffer=GUTF8String::create(buf,sizeof(buf),GStringRep::XUTF16BE);\n          break;\n        default:\n          buffer=GUTF8String::create(buf,sizeof(buf),GStringRep::XUTF8);\n          break;\n      }\n      break;\n    }\n    case 0x3C00:\n    {\n      const unsigned int j=(buf[2]<<8)+buf[3];\n      switch(j)\n      {\n        case 0x0000:\n          buffer=GUTF8String::create(buf,sizeof(buf),GStringRep::XUCS4LE);\n          break;\n        case 0x3F00:\n          buffer=GUTF8String::create(buf,sizeof(buf),GStringRep::XUTF16LE);\n          break;\n        default:\n          buffer=GUTF8String::create(buf,sizeof(buf),GStringRep::XUTF8);\n          break;\n      }\n      break;\n    }\n    case 0x4C6F:\n    {\n      const unsigned int j=(buf[2]<<8)+buf[3];\n      buffer=GUTF8String::create(buf,sizeof(buf),\n         (j == 0xA794)?(GStringRep::XEBCDIC):(GStringRep::XUTF8));\n      break;\n    }\n    case 0xFFFE:\n    {\n      buffer=GUTF8String::create(buf+2,sizeof(buf)-2,GStringRep::XUTF16LE);\n      startpos+=2;\n      break;\n    }\n    case 0xFEFF:\n    {\n      buffer=GUTF8String::create(buf+2,sizeof(buf)-2,GStringRep::XUTF16BE);\n      startpos+=2;\n      break;\n    }\n    case 0xEFBB:\n    {\n      if(buf[2] == 0xBF)\n      {\n        buffer=GUTF8String::create(buf+3,sizeof(buf)-3,GStringRep::XUTF8);\n        startpos+=3;\n      }else\n      {\n        buffer=GUTF8String::create(buf,sizeof(buf),GStringRep::XUTF8);\n      }\n      break;\n    }\n    case 0x3C3F:\n    default:\n    {\n      buffer=GUTF8String::create(buf,sizeof(buf),GStringRep::XUTF8);\n    }\n  }\n  bs=ibs;\n}\n\nXMLByteStream::~XMLByteStream()\n{}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/UnicodeByteStream.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _UNICODEBYTESTREAM_H_\n#define _UNICODEBYTESTREAM_H_\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n\n/** @name UnicodeByteStream.h\n\n    Files #\"UnicodeByteStream.h\"# and #\"UnicodeByteStream.cpp\"# \n    implement a parser for files structured W3C Extensible Markup \n    Language (XML) 1.0 (Second Edition).\n    \n    Class \\Ref{UnicodeByteStream} provides a way to read or write XML files.\n    files.  Member functions provide an easy mean to position the underlying\n    \\Ref{ByteStream}.\n\n    {\\bf References:} \n    W3C Extensible Markup Language (XML) 1.0 (Second Edition)\n    \\URL{http://www.w3.org/TR/2000/REC-xml-20001006.html}\n\n    @memo \n    XML file parser.\n    @author\n    Bill C Riemers <docbill@sourceforge.net>\n*/\n//@{\n\n#include \"DjVuGlobal.h\"\n#include \"GString.h\"\n#include \"ByteStream.h\"\n\n#include <stddef.h>\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n\n/** ByteStream interface for an Unicode file. \n\n    Class #UnicodeByteStream# augments the #ByteStream# interface with\n    functions for navigating Unicode documents.  It works in relation\n    with a ByteStream specified at construction time. \n\n    {\\bf Reading an Unicode file} --- You can read an Unicode file by\n    constructing an #UnicodeByteStream# object attached to the ByteStream\n    containing the Unicode file.\n    \n    {\\bf Writing an Unicode file} --- You can write an Unicode file by\n    constructing an #UnicodeByteStream# object attached to the seekable\n    ByteStream object that will contain the XML file.\n\n    Writing an XML file requires a seekable ByteStream (see\n    \\Ref{ByteStream::is_seekable}).  This is not much of a problem because you\n    can always create the XML file into a \\Ref{MemoryByteStream} and then use\n    \\Ref{ByteStream::copy} to transfer the XML file into a non seekable\n    ByteStream.  */\n\nclass UnicodeByteStream : public ByteStream\n{\nprotected:\n  UnicodeByteStream(const UnicodeByteStream &bs);\n  UnicodeByteStream(GP<ByteStream> bs,\n    const GStringRep::EncodeType encodetype=GStringRep::XUTF8);\npublic:\n  /** Constructs an UnicodeByteStream object attached to ByteStream #bs#.\n      Any ByteStream can be used when reading an XML file.  Writing\n      an XML file however requires a seekable ByteStream. */\n  static GP<UnicodeByteStream> create(GP<ByteStream> bs,\n    const GStringRep::EncodeType encodetype=GStringRep::XUTF8)\n  { return new UnicodeByteStream(bs,encodetype); }\n\n  // --- BYTESTREAM INTERFACE\n  ~UnicodeByteStream();\n  /// Sets the encoding type and seek's to position 0.\n  void set_encodetype(const GStringRep::EncodeType et=GStringRep::XUTF8);\n  void set_encoding(const GUTF8String &encoding);\n  /// Simmular to fgets(), except read aheads effect the tell() position.\n  virtual GUTF8String gets(size_t const t=0,unsigned long const stopat='\\n',bool const inclusive=true); \n  /// Resets the gets buffering as well as physically seeking.\n  virtual int seek(long offset, int whence = SEEK_SET, bool nothrow=false);\n  /** Physically reads the specified bytes, and truncate the read ahead buffer.\n    */\n  virtual size_t read(void *buffer, size_t size);\n  /// Not correctly implimented...\n  virtual size_t write(const void *buffer, size_t size);\n  /// tell will tell you the read position, including read ahead for gets()...\n  virtual long tell(void) const;\n  /// Does a flush, and clears the read ahead buffer.\n  virtual void flush(void);\n\n  /// Find out how many lines have been read with gets.\n  int get_lines_read(void) const { return linesread; }\nprotected:\n  /// The real byte stream.\n  GP<ByteStream> bs;\n  GUTF8String buffer;\n  int bufferpos;\n  int linesread;\n  long startpos;\nprivate:\n  // Cancel C++ default stuff\n  UnicodeByteStream & operator=(UnicodeByteStream &);\n};\n\n\nclass XMLByteStream : public UnicodeByteStream\n{\nprotected:\n  XMLByteStream(GP<ByteStream> &bs);\n  XMLByteStream(UnicodeByteStream &bs);\n  void init(void);\npublic:\n  static GP<XMLByteStream> create(GP<ByteStream> bs);\n  static GP<XMLByteStream> create(UnicodeByteStream &bs);\n  // --- BYTESTREAM INTERFACE\n  ~XMLByteStream();\n};\n\ninline GP<XMLByteStream>\nXMLByteStream::create(UnicodeByteStream &bs)\n{\n  return new XMLByteStream(bs);\n}\n\n//@}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n\n"
  },
  {
    "path": "ext/libdjvu/XMLParser.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n// From: Leon Bottou, 1/31/2002\n// This is purely Lizardtech stuff.\n\n#include \"XMLParser.h\"\n#include \"XMLTags.h\"\n#include \"ByteStream.h\"\n#include \"GOS.h\"\n#include \"DjVuDocument.h\"\n#include \"DjVuText.h\"\n#include \"DjVuAnno.h\"\n#include \"DjVuFile.h\"\n#include \"DjVuImage.h\"\n#include \"debug.h\"\n#include <stdio.h>\n#include <ctype.h>\n#include <stddef.h>\n#include <stdlib.h>\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nstatic const char mimetype[]=\"image/x.djvu\";\nstatic const char bodytag[]=\"BODY\";\nstatic const char areatag[]=\"AREA\";\nstatic const char maptag[]=\"MAP\";\nstatic const char objecttag[]=\"OBJECT\";\nstatic const char paramtag[]=\"PARAM\";\nstatic const char charactertag[]=\"CHARACTER\";\nstatic const char wordtag[]=\"WORD\";\nstatic const char linetag[]=\"LINE\";\nstatic const char paragraphtag[]=\"PARAGRAPH\";\nstatic const char regiontag[]=\"REGION\";\nstatic const char pagecolumntag[]=\"PAGECOLUMN\";\nstatic const char hiddentexttag[]=\"HIDDENTEXT\";\nstatic const char metadatatag[]=\"METADATA\";\n\nclass lt_XMLParser::Impl : public lt_XMLParser\n{\npublic:\n  Impl(void);\n  virtual ~Impl();\n  /// Parse the specified bytestream.\n  virtual void parse(const GP<ByteStream> &bs, GURL *pdjvufile);\n  /// Parse the specified tags - this one does all the work\n  virtual void parse(const lt_XMLTags &tags, GURL *pdjvufile);\n  /// write to disk.\n  virtual void save(void);\n  /// erase.\n  virtual void empty(void);\nprotected:\n  GP<DjVuFile> get_file(const GURL &url,GUTF8String page);\n\n  void parse_anno(const int width, const int height,\n    const lt_XMLTags &GObject,\n    GMap<GUTF8String,GP<lt_XMLTags> > &Maps, DjVuFile &dfile);\n\n  void parse_text(const int width, const int height,\n    const lt_XMLTags &GObject, DjVuFile &dfile);\n\n  void parse_meta(const lt_XMLTags &GObject, DjVuFile &dfile);\n\n  void ChangeAnno( const int width, const int height,\n    DjVuFile &dfile, const lt_XMLTags &map);\n\n  void ChangeInfo(DjVuFile &dfile,const int dpi,const double gamma);\n\n  void ChangeText( const int width, const int height,\n    DjVuFile &dfile, const lt_XMLTags &map);\n\n  void ChangeMeta( DjVuFile &dfile, const lt_XMLTags &map);\n\n  void ChangeTextOCR( const GUTF8String &value, \n    const int width, const int height,\n    const GP<DjVuFile> &dfile);\n\n  // we may want to make these list of modified file static so\n  // they only needed to be loaded and saved once.\n\n  GMap<GUTF8String,GP<DjVuFile> > m_files;\n  GMap<GUTF8String,GP<DjVuDocument> > m_docs;\n\n  GURL m_codebase; \n  GCriticalSection xmlparser_lock;\n};\n\nstatic GP<ByteStream>\nOCRcallback(\n  void * const xarg,\n  lt_XMLParser::mapOCRcallback * const xcallback,\n  const GUTF8String &value=GUTF8String(),\n  const GP<DjVuImage> &image=0 );\n\nstatic inline GP<ByteStream>\nOCRcallback(const GUTF8String &value, const GP<DjVuImage> &image)\n{\n  return OCRcallback(0,0,value,image);\n}\n\nlt_XMLParser::lt_XMLParser() {}\nlt_XMLParser::~lt_XMLParser() {}\nlt_XMLParser::Impl::Impl() {}\nlt_XMLParser::Impl::~Impl() {}\n\nGP<lt_XMLParser>\nlt_XMLParser::create(void)\n{\n  return new lt_XMLParser::Impl;\n}\n\n// helper function for args\nstatic void \nintList(GUTF8String coords, GList<int> &retval)\n{\n  int pos=0;\n  while(coords.length())\n  {\n    int epos;\n    unsigned long i=coords.toLong(pos,epos,10);\n    if(epos>=0)\n    {\n      retval.append(i);\n      const int n=coords.nextNonSpace(epos);\n      if(coords[n] != ',')\n        break;\n      pos=n+1;\n    }\n  }\n}\n\nvoid \nlt_XMLParser::Impl::empty(void)\n{\n  GCriticalSectionLock lock(&xmlparser_lock);\n  m_files.empty();\n  m_docs.empty();\n}\n\nvoid \nlt_XMLParser::Impl::save(void)\n{\n  GCriticalSectionLock lock(&xmlparser_lock);\n  for(GPosition pos=m_docs;pos;++pos)\n  {\n    const GP<DjVuDocument> doc(m_docs[pos]);\n    const GURL url=doc->get_init_url();\n    \n    DEBUG_MSG(\"Saving \"<<(const char *)url<<\" with new text and annotations\\n\");\n    const bool bundle=doc->is_bundled()||(doc->get_doc_type()==DjVuDocument::SINGLE_PAGE);\n    doc->save_as(url,bundle);\n  }\n  empty();\n}\n\nvoid\nlt_XMLParser::Impl::parse(const GP<ByteStream> &bs, GURL *pdjvufile)\n{\n  const GP<lt_XMLTags> tags(lt_XMLTags::create(bs));\n  parse(*tags, pdjvufile);\n}\n  \nstatic const GMap<GUTF8String,GMapArea::BorderType> &\nBorderTypeMap(void)\n{\n  static GMap<GUTF8String,GMapArea::BorderType> typeMap;\n  if (! typeMap.size()) \n    {\n      typeMap[\"none\"]=GMapArea::NO_BORDER;\n      typeMap[\"xor\"]=GMapArea::XOR_BORDER;\n      typeMap[\"solid\"]=GMapArea::SOLID_BORDER;\n      typeMap[\"default\"]=GMapArea::SOLID_BORDER;\n      typeMap[\"shadowout\"]=GMapArea::SHADOW_OUT_BORDER;\n      typeMap[\"shadowin\"]=GMapArea::SHADOW_IN_BORDER;\n      typeMap[\"etchedin\"]=GMapArea::SHADOW_EIN_BORDER;\n      typeMap[\"etchedout\"]=GMapArea::SHADOW_EOUT_BORDER;\n    }\n  return typeMap;\n}\n\nstatic unsigned long\nconvertToColor(const GUTF8String &s)\n{\n  unsigned long retval=0;\n  if(s.length())\n  {\n    int endpos;\n    if(s[0] == '#')\n    {\n      retval=s.substr(1,-1).toULong(0,endpos,16);\n    }\n    if(endpos < 0)\n    {\n      G_THROW( (ERR_MSG(\"XMLAnno.bad_color\") \"\\t\")+s );\n    }\n  }\n  return retval;\n}\n\nvoid\nlt_XMLParser::Impl::ChangeInfo(DjVuFile &dfile,const int dpi,const double gamma)\n{\n  GP<DjVuInfo> info;\n  if(dpi >= 5 && dpi <= 4800)\n  {\n    dfile.resume_decode(true);\n    if(dfile.info && (dpi != dfile.info->dpi) )\n    {\n      info=new DjVuInfo(*dfile.info);\n      info->dpi=dpi;\n    }\n  }\n  if(gamma >= 0.1 && gamma <= 5.0)\n  {\n    dfile.resume_decode(true);\n    if(dfile.info && (gamma != dfile.info->gamma) )\n    {\n      if(!info)\n        info=new DjVuInfo(*dfile.info);\n      info->gamma=gamma;\n    }\n  }\n  if(info)\n  {\n    dfile.change_info(info);\n  }\n}\n\nvoid\nlt_XMLParser::Impl::ChangeAnno(\n  const int width, const int height,\n  DjVuFile &dfile, \n  const lt_XMLTags &map )\n{\n  dfile.resume_decode(true);\n  const GP<DjVuInfo> info(dfile.info);\n  const GP<DjVuAnno> ganno(DjVuAnno::create());\n  DjVuAnno &anno=*ganno;\n  GPosition map_pos;\n  map_pos=map.contains(areatag);\n  if(dfile.contains_anno())\n  {\n    GP<ByteStream> annobs=dfile.get_merged_anno();\n    if(annobs)\n    {\n      anno.decode(annobs);\n      if(anno.ant && info)\n      {\n        anno.ant->map_areas.empty();\n      }\n    }\n//    dfile.remove_anno();\n  }\n  if(info && map_pos)\n  {\n    const int h=info->height;\n    const int w=info->width;\n    double ws=1.0;\n    double hs=1.0;\n    if(width && width != w)\n    {\n      ws=((double)w)/((double)width); \n    }\n    if(height && height != h)\n    {\n      hs=((double)h)/((double)height); \n    }\n    if(!anno.ant)\n    {\n      anno.ant=DjVuANT::create();\n    }\n    GPList<GMapArea> &map_areas=anno.ant->map_areas;\n    map_areas.empty();\n    GPList<lt_XMLTags> gareas=map[map_pos];\n    for(GPosition pos=gareas;pos;++pos)\n    {\n      if(gareas[pos])\n      {\n        lt_XMLTags &areas=*(gareas[pos]);\n        GMap<GUTF8String,GUTF8String> args(areas.get_args());\n        GList<int> coords;\n        // ******************************************************\n        // Parse the coords attribute:  first read the raw data into\n        // a list, then scale the x, y data into another list.  For\n        // circles, you also get a radius element with (looks like an x\n        // with no matching y).\n        // ******************************************************\n        {\n          GPosition coords_pos=args.contains(\"coords\");\n          if(coords_pos)\n          {\n            GList<int> raw_coords;\n            intList(args[coords_pos],raw_coords);\n            for(GPosition raw_pos=raw_coords;raw_pos;++raw_pos)\n            {\n              const int r=raw_coords[raw_pos];\n              const int x=(int)(ws*(double)r+0.5);\n              coords.append(x);\n              int y=h-1;\n              if(! ++raw_pos)\n              {\n                y-=(int)(hs*(double)r+0.5);\n              }else\n              {\n                y-=(int)(hs*(double)raw_coords[raw_pos]+0.5);\n              }\n              coords.append(y);\n//            DjVuPrintMessage(\"Coords (%d,%d)\\n\",x,y);\n            }\n          }\n        }\n        GUTF8String shape;\n        {\n          GPosition shape_pos=args.contains(\"shape\");\n          if(shape_pos)\n          {\n            shape=args[shape_pos];\n          }\n        }\n        GP<GMapArea> a;\n        if(shape == \"default\")\n        {\n          GRect rect(0,0,w,h);\n          a=GMapRect::create(rect);\n        }else if(!shape.length() || shape == \"rect\")\n        {\n          int xx[4];\n          int i=0;\n          for(GPosition rect_pos=coords;(rect_pos)&&(i<4);++rect_pos,++i)\n          {\n            xx[i]=coords[rect_pos];\n          }\n          if(i!=4)\n          {\n            G_THROW( ERR_MSG(\"XMLAnno.bad_rect\") );\n          }\n          int xmin,xmax; \n          if(xx[0]>xx[2])\n          {\n            xmax=xx[0];\n            xmin=xx[2];\n          }else\n          {\n            xmin=xx[0];\n            xmax=xx[2];\n          }\n          int ymin,ymax; \n          if(xx[1]>xx[3])\n          {\n            ymax=xx[1];\n            ymin=xx[3];\n          }else\n          {\n            ymin=xx[1];\n            ymax=xx[3];\n          }\n          GRect rect(xmin,ymin,xmax-xmin,ymax-ymin);\n          a=GMapRect::create(rect);\n        }else if(shape == \"circle\")\n        {\n          int xx[4];\n          int i=0;\n          GPosition rect_pos=coords.lastpos();\n          if(rect_pos)\n          {\n            coords.append(coords[rect_pos]);\n            for(rect_pos=coords;(rect_pos)&&(i<4);++rect_pos)\n            {\n              xx[i++]=coords[rect_pos];\n            }\n          }\n          if(i!=4)\n          {\n            G_THROW( ERR_MSG(\"XMLAnno.bad_circle\") );\n          }\n          int x=xx[0],y=xx[1],rx=xx[2],ry=(h-xx[3])-1;\n          GRect rect(x-rx,y-ry,2*rx,2*ry);\n          a=GMapOval::create(rect);\n        }else if(shape == \"oval\")\n        {\n          int xx[4];\n          int i=0;\n          for(GPosition rect_pos=coords;(rect_pos)&&(i<4);++rect_pos,++i)\n          {\n            xx[i]=coords[rect_pos];\n          }\n          if(i!=4)\n          {\n            G_THROW( ERR_MSG(\"XMLAnno.bad_oval\") );\n          }\n          int xmin,xmax; \n          if(xx[0]>xx[2])\n          {\n            xmax=xx[0];\n            xmin=xx[2];\n          }else\n          {\n            xmin=xx[0];\n            xmax=xx[2];\n          }\n          int ymin,ymax; \n          if(xx[1]>xx[3])\n          {\n            ymax=xx[1];\n            ymin=xx[3];\n          }else\n          {\n            ymin=xx[1];\n            ymax=xx[3];\n          }\n          GRect rect(xmin,ymin,xmax-xmin,ymax-ymin);\n          a=GMapOval::create(rect);\n        }else if(shape == \"poly\")\n        {\n          GP<GMapPoly> p=GMapPoly::create();\n          for(GPosition poly_pos=coords;poly_pos;++poly_pos)\n          {\n            int x=coords[poly_pos];\n            if(! ++poly_pos)\n              break;\n            int y=coords[poly_pos];\n            p->add_vertex(x,y);\n          }\n          p->close_poly();\n          a=p;\n        }else\n        {\n          G_THROW( ( ERR_MSG(\"XMLAnno.unknown_shape\") \"\\t\")+shape );\n        }\n        if(a)\n        {\n          GPosition pos;\n          if((pos=args.contains(\"href\")))\n          {\n            a->url=args[pos];\n          }\n          if((pos=args.contains(\"target\")))\n          {\n            a->target=args[pos];\n          }\n          if((pos=args.contains(\"alt\")))\n          {\n            a->comment=args[pos];\n          }\n          if((pos=args.contains(\"bordertype\")))\n          {\n            GUTF8String b=args[pos];\n            static const GMap<GUTF8String,GMapArea::BorderType> typeMap=BorderTypeMap();\n            if((pos=typeMap.contains(b)))\n            {\n              a->border_type=typeMap[pos];\n            }else\n            {\n              G_THROW( (ERR_MSG(\"XMLAnno.unknown_border\") \"\\t\")+b );\n            }\n          }\n          a->border_always_visible=!!args.contains(\"visible\");\n          if((pos=args.contains(\"bordercolor\")))\n          {\n            a->border_color=convertToColor(args[pos]);\n          }\n          if((pos=args.contains(\"highlight\")))\n          {\n            a->hilite_color=convertToColor(args[pos]);\n          }\n          if((pos=args.contains(\"border\")))\n          {\n             a->border_width=args[pos].toInt(); //atoi(args[pos]);\n          }\n          map_areas.append(a);\n        }\n      }\n    }\n  }\n  dfile.set_modified(true);\n  dfile.anno=ByteStream::create();\n  anno.encode(dfile.anno);\n}\n\nGP<DjVuFile>\nlt_XMLParser::Impl::get_file(const GURL &url,GUTF8String id)\n{\n  GP<DjVuFile> dfile;\n  GP<DjVuDocument> doc;\n  GCriticalSectionLock lock(&xmlparser_lock);\n  {\n    GPosition pos=m_docs.contains(url.get_string());\n    if(pos)\n    {\n      doc=m_docs[pos];\n    }else\n    {\n      doc=DjVuDocument::create_wait(url);\n      if(! doc->wait_for_complete_init())\n      {\n        G_THROW(( ERR_MSG(\"XMLAnno.fail_init\") \"\\t\")+url.get_string() );\n      }\n      m_docs[url.get_string()]=doc;\n    }\n    if(id.is_int())\n    {\n      const int xpage=id.toInt(); //atoi((char const *)page); \n      if(xpage>0)\n        id=doc->page_to_id(xpage-1);\n    }else if(!id.length())\n    { \n      id=doc->page_to_id(0);\n    }\n  }\n  const GURL fileurl(doc->id_to_url(id));\n  GPosition dpos(m_files.contains(fileurl.get_string()));\n  if(!dpos)\n  {\n    if(!doc->get_id_list().contains(id))\n    {\n      G_THROW( ERR_MSG(\"XMLAnno.bad_page\") );\n    }\n    dfile=doc->get_djvu_file(id,false);\n    if(!dfile)\n    {\n      G_THROW( ERR_MSG(\"XMLAnno.bad_page\") );\n    }\n    m_files[fileurl.get_string()]=dfile;\n  }else\n  {\n    dfile=m_files[dpos];\n  }\n  return dfile;\n}\n  \nvoid\nlt_XMLParser::Impl::parse(const lt_XMLTags &tags, GURL *pdjvufile)\n{\n  const GPList<lt_XMLTags> Body(tags.get_Tags(bodytag));\n  GPosition pos=Body;\n \n  if(!pos || (pos != Body.lastpos()))\n  {\n    G_THROW( ERR_MSG(\"XMLAnno.extra_body\") );\n  }\n  const GP<lt_XMLTags> GBody(Body[pos]);\n  if(!GBody)\n  {\n    G_THROW( ERR_MSG(\"XMLAnno.no_body\") );\n  }\n\n  GMap<GUTF8String,GP<lt_XMLTags> > Maps;\n  lt_XMLTags::get_Maps(maptag,\"name\",Body,Maps);\n\n  const GPList<lt_XMLTags> Objects(GBody->get_Tags(objecttag));\n  lt_XMLTags::get_Maps(maptag,\"name\",Objects,Maps);\n\n  for(GPosition Objpos=Objects;Objpos;++Objpos)\n  {\n    lt_XMLTags &GObject=*Objects[Objpos];\n    // Map of attributes to value (e.g. \"width\" --> \"500\")\n    const GMap<GUTF8String,GUTF8String> &args=GObject.get_args();\n    GURL codebase;\n    {\n      DEBUG_MSG(\"Setting up codebase... m_codebase = \" << m_codebase << \"\\n\");\n      GPosition codebasePos=args.contains(\"codebase\");\n      // If user specified a codebase attribute, assume it is correct (absolute URL):\n      //  the GURL constructor will throw an exception if it isn't\n      if(codebasePos)\n      {\n        codebase=GURL::UTF8(args[codebasePos]);\n      }else if (m_codebase.is_dir())\n      {\n        codebase=m_codebase;\n      }else\n      {\n        codebase=GURL::Filename::UTF8(GOS::cwd());\n      }\n      DEBUG_MSG(\"codebase = \" << codebase << \"\\n\");\n    }\n    // the data attribute specifies the input file.  This can be\n    //  either an absolute URL (starts with file:/) or a relative\n    //  URL (for now, just a path and file name).  If it's absolute,\n    //  our GURL will adequately wrap it.  If it's relative, we need\n    //  to use the codebase attribute to form an absolute URL first.\n    GPosition datapos=args.contains(\"data\");\n    if(datapos)\n    {\n      GPosition typePos(args.contains(\"type\"));\n      if(typePos)\n        {\n          if(args[typePos] != mimetype)\n          continue;\n        }\n      const GURL url = (pdjvufile) ? *pdjvufile \n        : GURL::UTF8(args[datapos], \n                     (args[datapos][0] == '/') ? codebase.base() : codebase);\n      int width;\n      {\n        GPosition widthPos=args.contains(\"width\");\n        width=(widthPos)?args[widthPos].toInt():0;\n      }\n      int height;\n      {\n        GPosition heightPos=args.contains(\"height\");\n        height=(heightPos)?args[heightPos].toInt():0;\n      }\n      GUTF8String gamma;\n      GUTF8String dpi;\n      GUTF8String page;\n      GUTF8String do_ocr;\n      {\n        GPosition paramPos(GObject.contains(paramtag));\n        if(paramPos)\n        {\n          const GPList<lt_XMLTags> Params(GObject[paramPos]);\n          for(GPosition loc=Params;loc;++loc)\n          {\n            const GMap<GUTF8String,GUTF8String> &pargs=Params[loc]->get_args();\n            GPosition namepos=pargs.contains(\"name\");\n            if(namepos)\n            {\n              GPosition valuepos=pargs.contains(\"value\");\n              if(valuepos)\n              {\n                const GUTF8String name=pargs[namepos].downcase();\n                const GUTF8String &value=pargs[valuepos];\n                if(name == \"flags\")\n                {\n                  GMap<GUTF8String,GUTF8String> args;\n                  lt_XMLTags::ParseValues(value,args,true);\n                  if(args.contains(\"page\"))\n                  {\n                    page=args[\"page\"];\n                  }\n                  if(args.contains(\"dpi\"))\n                  {\n                    dpi=args[\"dpi\"];\n                  }\n                  if(args.contains(\"gamma\"))\n                  {\n                    gamma=args[\"gamma\"];\n                  }\n                  if(args.contains(\"ocr\"))\n                  {\n                    do_ocr=args[\"ocr\"];\n                  }\n                }else if(name == \"page\")\n                {\n                  page=value;\n                }else if(name == \"dpi\")\n                {\n                  dpi=value;\n                }else if(name == \"gamma\")\n                {\n                  gamma=value;\n                }else if(name == \"ocr\")\n                {\n                  do_ocr=value;\n                }\n              }\n            }\n          }\n        }\n      }\n      const GP<DjVuFile> dfile(get_file(url,page));\n      if(dpi.is_int() || gamma.is_float())\n      {\n        int pos=0;\n        ChangeInfo(*dfile,dpi.toInt(),gamma.toDouble(pos,pos));\n      }\n      parse_anno(width,height,GObject,Maps,*dfile);\n      parse_meta(GObject,*dfile);\n      parse_text(width,height,GObject,*dfile);\n      ChangeTextOCR(do_ocr,width,height,dfile);\n    }\n  }\n}\n\nvoid\nlt_XMLParser::Impl::parse_anno(\n  const int width,\n  const int height,\n  const lt_XMLTags &GObject,\n  GMap<GUTF8String,GP<lt_XMLTags> > &Maps,\n  DjVuFile &dfile )\n{\n  GP<lt_XMLTags> map;\n  {\n    GPosition usemappos=GObject.get_args().contains(\"usemap\");\n    if(usemappos)\n    {\n      const GUTF8String mapname(GObject.get_args()[usemappos]);\n      GPosition mappos=Maps.contains(mapname);\n      if(!mappos)\n      {\n        G_THROW((ERR_MSG(\"XMLAnno.map_find\") \"\\t\")+mapname );\n      }else\n      {\n        map=Maps[mappos];\n      }\n    }\n  }\n  if(map)\n  {\n    ChangeAnno(width,height,dfile,*map);\n  }\n}\n\n#ifdef max\n#undef max\n#endif\ntemplate<class TYPE>\nstatic inline TYPE max(TYPE a,TYPE b) { return (a>b)?a:b; }\n#ifdef min\n#undef min\n#endif\ntemplate<class TYPE>\nstatic inline TYPE min(TYPE a,TYPE b) { return (a<b)?a:b; }\n\n// used to build the zone tree\n// true is returned if the GRect is known for this object,\n// and false, if the rectangle's size is just the parent size.\nstatic bool\nmake_child_layer(\n  DjVuTXT::Zone &parent,\n  const lt_XMLTags &tag, ByteStream &bs,\n  const int height, const double ws, const double hs)\n{\n  bool retval=true;\n  // the plugin thinks there are only Pages, Lines and Words\n  // so we don't make Paragraphs, Regions and Columns zones\n  // if we did the plugin is not able to search the text but \n  // DjVuToText writes out all the text anyway\n  DjVuTXT::Zone *self_ptr;\n  char sepchar;\n  const GUTF8String name(tag.get_name());\n  if(name == charactertag)\n  {\n    self_ptr=parent.append_child();\n    self_ptr->ztype = DjVuTXT::CHARACTER;\n    sepchar=0;  \n  }else if(name == wordtag)\n  {\n    self_ptr=parent.append_child();\n    self_ptr->ztype = DjVuTXT::WORD;\n    sepchar=' ';\n  }else if(name == linetag)\n  {\n    self_ptr=parent.append_child();\n    self_ptr->ztype = DjVuTXT::LINE;\n    sepchar=DjVuTXT::end_of_line;\n  }else if(name == paragraphtag)\n  {\n    self_ptr=parent.append_child();\n    self_ptr->ztype = DjVuTXT::PARAGRAPH;\n    sepchar=DjVuTXT::end_of_paragraph;\n  }else if(name == regiontag)\n  {\n    self_ptr=parent.append_child();\n    self_ptr->ztype = DjVuTXT::REGION;\n    sepchar=DjVuTXT::end_of_region;\n  }else if(name == pagecolumntag)\n  {\n    self_ptr=parent.append_child();\n    self_ptr->ztype = DjVuTXT::COLUMN;\n    sepchar=DjVuTXT::end_of_column;\n  }else\n  {\n    self_ptr = &parent;\n    self_ptr->ztype = DjVuTXT::PAGE;\n    sepchar=0;\n  }\n  DjVuTXT::Zone &self = *self_ptr;\n  self.text_start = bs.tell();\n  int &xmin=self.rect.xmin, &ymin=self.rect.ymin, \n    &xmax=self.rect.xmax, &ymax=self.rect.ymax;\n  GRect default_rect;\n  default_rect.xmin=max(parent.rect.xmax,parent.rect.xmin);\n  default_rect.xmax=min(parent.rect.xmax,parent.rect.xmin);\n  default_rect.ymin=max(parent.rect.ymax,parent.rect.ymin);\n  default_rect.ymax=min(parent.rect.ymax,parent.rect.ymin);\n  // Now if there are coordinates, use those.\n  GPosition pos(tag.get_args().contains(\"coords\"));\n  if(pos)\n  {\n    GList<int> rectArgs;\n    intList(tag.get_args()[pos], rectArgs);\n    if((pos=rectArgs))\n    {\n      xmin=(int)(ws*(double)rectArgs[pos]);\n      if(++pos)\n      {\n        ymin=(height-1)-(int)(hs*(double)rectArgs[pos]);\n        if(++pos)\n        {\n          xmax=(int)(ws*(double)rectArgs[pos]);\n          if(++pos)\n          {\n            ymax=(height-1)-(int)(hs*(double)rectArgs[pos]);\n            if(xmin>xmax) // Make sure xmin is really minimum\n            {\n              const int t=xmin;\n              xmin=xmax;\n              xmax=t;\n            }\n            if(ymin>ymax) // Make sure ymin is really minimum\n            {\n              const int t=ymin;\n              ymin=ymax;\n              ymax=t;\n            }\n          }\n        }\n      }\n    }\n  }\n  if(self.ztype == DjVuTXT::CHARACTER)\n  {\n    if(! pos)\n    {\n      self.rect=default_rect;\n      retval=false;\n    }\n    const GUTF8String raw(tag.get_raw().fromEscaped());\n    const int i=raw.nextNonSpace(0);\n    bs.writestring(raw.substr(i,raw.firstEndSpace(i)-i));\n    if(sepchar)\n      bs.write8(sepchar);\n    self.text_length = bs.tell() - self.text_start;\n  }else if(pos)\n  {\n    pos=tag.get_content();\n    if(pos)\n    {\n      for(pos=tag.get_content(); pos; ++pos)\n      {\n        const GP<lt_XMLTags> t(tag.get_content()[pos].tag);\n        make_child_layer(self, *t, bs, height,ws,hs);\n      }\n      if(sepchar)\n        bs.write8(sepchar);\n      self.text_length = bs.tell() - self.text_start;\n    }else\n    {\n      const GUTF8String raw(tag.get_raw().fromEscaped());\n      const int i=raw.nextNonSpace(0);\n      bs.writestring(raw.substr(i,raw.firstEndSpace(i)-i));\n      if(sepchar)\n        bs.write8(sepchar);\n      self.text_length = bs.tell() - self.text_start;\n    }\n  }else\n  {\n    self.rect=default_rect;\n    if((pos=tag.get_content()))\n    {\n      do\n      {\n        const GP<lt_XMLTags> t(tag.get_content()[pos].tag);\n        const GRect save_rect(self.rect);\n        self.rect=default_rect;\n\tif ((retval = make_child_layer(self, *t, bs, height, ws, hs)))\n        {\n          xmin=min(save_rect.xmin,xmin);\n          xmax=max(save_rect.xmax,xmax);\n          ymin=min(save_rect.ymin,ymin);\n          ymax=max(save_rect.ymax,ymax);\n        }else\n        {\n          // If the child doesn't have coordinates, we need to use a box\n          // at least as big as the parent's coordinates.\n          xmin=min(save_rect.xmin,default_rect.xmax);\n          xmax=max(save_rect.xmax,default_rect.xmin);\n          ymin=min(save_rect.ymin,default_rect.ymax);\n          ymax=max(save_rect.ymax,default_rect.ymin);\n          for(; pos; ++pos)\n          {\n            const GP<lt_XMLTags> t(tag.get_content()[pos].tag);\n            make_child_layer(self, *t, bs, height,ws,hs);\n          }\n          break;\n        }\n      } while(++pos);\n      if(sepchar)\n        bs.write8(sepchar);\n      self.text_length = bs.tell() - self.text_start;\n    }else\n    {\n      const GUTF8String raw(tag.get_raw().fromEscaped());\n      const int i=raw.nextNonSpace(0);\n      bs.writestring(raw.substr(i,raw.firstEndSpace(i)-i));\n      if(sepchar)\n        bs.write8(sepchar);\n      self.text_length = bs.tell() - self.text_start;\n    }\n  }\n  parent.rect.xmin=min(xmin,parent.rect.xmin);\n  parent.rect.ymin=min(ymin,parent.rect.ymin);\n  parent.rect.xmax=max(xmax,parent.rect.xmax);\n  parent.rect.ymax=max(ymax,parent.rect.ymax);\n  if(xmin>xmax)\n  {\n    const int t=xmin;\n    xmin=xmax;\n    xmax=t;\n  }\n  if(ymin>ymax)\n  {\n    const int t=ymin;\n    ymin=ymax;\n    ymax=t;\n  }\n//  DjVuPrintMessage(\"(%d,%d)(%d,%d)<<<\\\\%o>>>\\n\",\n//    xmin,ymin,xmax,ymax, sepchar);\n  return retval;\n}\n\nvoid \nlt_XMLParser::Impl::ChangeTextOCR(\n  const GUTF8String &value,\n  const int width,\n  const int height,\n  const GP<DjVuFile> &dfile)\n{\n  if(value.length() && value.downcase() != \"false\")\n  {\n    const GP<ByteStream> bs=OCRcallback(value,DjVuImage::create(dfile));\n    if( bs && bs->size() )\n    {\n      const GP<lt_XMLTags> tags(lt_XMLTags::create(bs));\n      ChangeText(width,height,*dfile,*tags);\n    }\n  }\n}\n\nvoid \nlt_XMLParser::Impl::ChangeMeta(\n  DjVuFile &dfile, const lt_XMLTags &tags )\n{\n  dfile.resume_decode(true);\n  GP<ByteStream> gbs(ByteStream::create());\n  tags.write(*gbs,false);\n  gbs->seek(0L);\n  GUTF8String raw(gbs->getAsUTF8());\n  if(raw.length())\n  {\n     //GUTF8String gs=\"<\"+(metadatatag+(\">\"+raw))+\"</\"+metadatatag+\">\\n\");\n    dfile.change_meta(raw+\"\\n\");\n  }else\n  {\n    dfile.change_meta(GUTF8String());\n  }\n}\n\nvoid \nlt_XMLParser::Impl::ChangeText(\n  const int width, const int height,\n  DjVuFile &dfile, const lt_XMLTags &tags )\n{\n  dfile.resume_decode(true);\n  \n  GP<DjVuText> text = DjVuText::create();\n  GP<DjVuTXT> txt = text->txt = DjVuTXT::create();\n  \n  // to store the new text\n  GP<ByteStream> textbs = ByteStream::create(); \n  \n  GP<DjVuInfo> info=(dfile.info);\n  if(info)\n  {\n    const int h=info->height;\n    const int w=info->width;\n    txt->page_zone.text_start = 0;\n    DjVuTXT::Zone &parent=txt->page_zone;\n    parent.rect.xmin=0;\n    parent.rect.ymin=0;\n    parent.rect.ymax=h;\n    parent.rect.xmax=w;\n    double ws=1.0;\n    if(width && width != w)\n    {\n      ws=((double)w)/((double)width);\n    }\n    double hs=1.0;\n    if(height && height != h)\n    {\n      hs=((double)h)/((double)height);\n    }\n    make_child_layer(parent, tags, *textbs, h, ws,hs);\n    textbs->write8(0);\n    long len = textbs->tell();\n    txt->page_zone.text_length = len;\n    textbs->seek(0,SEEK_SET);\n    textbs->read(txt->textUTF8.getbuf(len), len);\n  \n    dfile.change_text(txt,false);\n  }\n}\n\nvoid\nlt_XMLParser::Impl::parse_text(\n  const int width,\n  const int height,\n  const lt_XMLTags &GObject,\n  DjVuFile &dfile )\n{\n  GPosition textPos = GObject.contains(hiddentexttag);\n  if(textPos)\n  {\n    // loop through the hidden text - there should only be one \n    // if there are more ??only the last one will be saved??\n    GPList<lt_XMLTags> textTags = GObject[textPos];\n    GPosition pos = textTags;\n    ChangeText(width,height,dfile,*textTags[pos]);\n  }\n}\n\nvoid\nlt_XMLParser::Impl::parse_meta(\n  const lt_XMLTags &GObject,\n  DjVuFile &dfile )\n{\n  GPosition metaPos = GObject.contains(metadatatag);\n  if(metaPos)\n  {\n    // loop through the hidden text - there should only be one \n    // if there are more ??only the last one will be saved??\n    GPList<lt_XMLTags> metaTags = GObject[metaPos];\n    GPosition pos = metaTags;\n    ChangeMeta(dfile,*metaTags[pos]);\n  }\n}\n\nstatic GP<ByteStream>\nOCRcallback(\n  void * const xarg,\n  lt_XMLParser::mapOCRcallback * const xcallback,\n  const GUTF8String &value,\n  const GP<DjVuImage> &image )\n{\n  GP<ByteStream> retval;\n  static void *arg=0;\n  static lt_XMLParser::mapOCRcallback *callback=0;\n  if(image)\n  {\n    if(callback)\n      retval=callback(arg,value,image);\n  }else\n  {\n    arg=xarg;\n    callback=xcallback;\n  }\n  return retval;\n}\n\nvoid\nlt_XMLParser::setOCRcallback(\n  void * const arg,\n  mapOCRcallback * const callback)\n{\n  ::OCRcallback(arg,callback);\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/XMLParser.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _LT_XMLPARSER__\n#define _LT_XMLPARSER__\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n// From: Leon Bottou, 1/31/2002\n// This is purely Lizardtech stuff.\n\n#include \"GContainer.h\"\n#include \"GURL.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass ByteStream;\nclass lt_XMLTags;\nclass lt_XMLContents;\nclass DjVuFile;\nclass DjVuDocument;\nclass DjVuImage;\nclass GBitmap;\n\n// this is the base class for using XML to change DjVu Docs.\n\nclass DJVUAPI lt_XMLParser : public GPEnabled\n{\npublic:\n  class Impl;\n  typedef GP<ByteStream> mapOCRcallback(\n    void *,const GUTF8String &value,const GP<DjVuImage> &);\nprotected:\n  lt_XMLParser(void);\n  virtual ~lt_XMLParser();\npublic:\n  static GP<lt_XMLParser> create(void);\n  /// Parse the specified bytestream.\n  virtual void parse(const GP<ByteStream> &bs, GURL *pdjvufile=0) = 0;\n  /// Parse the specified tags - this one does all the work\n  virtual void parse(const lt_XMLTags &tags, GURL *pdjvufile=0) = 0;\n  /// write to disk.\n  virtual void save(void) = 0;\n  /// erase.\n  virtual void empty(void) = 0;\n\n  // helper function for args\n  static void setOCRcallback(\n    void * const arg,mapOCRcallback * const );\n};\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif /* _LT_XMLPARSER__ */\n\n\n"
  },
  {
    "path": "ext/libdjvu/XMLTags.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n// From: Leon Bottou, 1/31/2002\n// This is purely Lizardtech stuff.\n\n#include \"XMLTags.h\"\n#include \"UnicodeByteStream.h\"\n#include <ctype.h>\n#if HAS_WCTYPE\n#include <wctype.h>\n#endif\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nlt_XMLContents::lt_XMLContents(void) {}\n\nlt_XMLContents::lt_XMLContents(GP<lt_XMLTags> t)\n{\n  tag=t;\n}\n\nstatic GUTF8String\ngetargn(char const tag[], char const *&t)\n{\n  char const *s;\n  for(s=tag;isspace(*s);s++);\n  for(t=s;(*t)&&((*t)!='/')&&((*t)!='>')&&((*t)!='=')&&!isspace(*t);++t);\n  return GUTF8String(s,t-s);\n}\n\nstatic GUTF8String\ngetargv(char const tag[], char const *&t)\n{\n  GUTF8String retval;\n  if(tag && tag[0] == '=')\n  {\n    char const *s=t=tag+1;\n    if((*t == '\"')||(*t == '\\47'))\n    {\n      char const q=*(t++);\n      for(s++;(*t)&&((*t)!=q)&&((*t)!='>');++t);\n      retval=GUTF8String(s,t-s);\n      if (t[0] == q)\n      {\n        ++t;\n      }\n    }else\n    {\n      for(t=s;(*t)&&((*t)!='/')&&((*t)!='>')&&!isspace(*t);++t);\n      retval=GUTF8String(s,t-s);\n    }\n  }else\n  {\n    t=tag;\n  }\n  return retval;\n}\n\nstatic GUTF8String\ntagtoname(char const tag[],char const *&t)\n{\n  char const *s;\n  for(s=tag;isspace(*s);s++);\n  for(t=s;(*t)&&((*t)!='>')&&((*t)!='/')&&!isspace(*t);++t);\n  return GUTF8String(s,t-s);\n}\n\nstatic inline GUTF8String\ntagtoname(char const tag[])\n{\n  char const *t;\n  return tagtoname(tag,t);\n}\n\nstatic inline bool\nisspaces(const GUTF8String &raw)\n{\n  return (raw.nextNonSpace() == (int)raw.length());\n}\n\nvoid\nlt_XMLTags::ParseValues(char const *t, GMap<GUTF8String,GUTF8String> &args,bool downcase)\n{\n  GUTF8String argn;\n  char const *tt;\n  while((argn=getargn(t,tt)).length())\n  {\n    if(downcase)\n      argn=argn.downcase();\n    args[argn]=getargv(tt,t).fromEscaped();\n  }\n}\n\nlt_XMLTags::~lt_XMLTags() {}\n\nlt_XMLTags::lt_XMLTags(void) : startline(0) {}\n\nlt_XMLTags::lt_XMLTags(const char n[]) : startline(0)\n{\n  char const *t;\n  name=tagtoname(n,t);\n  ParseValues(t,args);\n}\n\nvoid\nlt_XMLTags::init(const GP<ByteStream> &bs)\n{\n  GP<XMLByteStream> gxmlbs=XMLByteStream::create(bs);\n  init(*gxmlbs);\n}\n\nvoid\nlt_XMLTags::init(const GURL &url)\n{\n  const GP<ByteStream> bs=ByteStream::create(url,\"rb\");\n  init(bs);\n}\n\nvoid\nlt_XMLTags::init(XMLByteStream &xmlbs)\n{\n  if(!get_count())\n  {\n    G_THROW( ERR_MSG(\"XMLTags.no_GP\") );\n  }\n  GPList<lt_XMLTags> level;\n  GUTF8String tag,raw(xmlbs.gets(0,'<',false));\n  int linesread=xmlbs.get_lines_read();\n  if(!isspaces(raw))\n  {\n    G_THROW( (ERR_MSG(\"XMLTags.raw_string\") \"\\t\")+raw);\n  }\n  GUTF8String encoding;\n  for(int len;(len=(tag=xmlbs.gets(0,'>',true)).length());)\n  {\n    if(tag[len-1] != '>')\n    {\n      G_THROW((ERR_MSG(\"XMLTags.bad_tag\") \"\\t\")+tag);\n    }\n    switch(tag[1])\n    {\n      case '?':\n      {\n        while(len < 4 || tag.substr(len-2,len) != \"?>\")\n        {\n          GUTF8String cont(xmlbs.gets(0,'>',true));\n          if(!cont.length())\n          { \n            G_THROW( (ERR_MSG(\"XMLTags.bad_PI\") \"\\t\")+tag);\n          }\n          len=((tag+=cont).length());\n        }\n        char const *n;\n        GUTF8String xtag = tag.substr(2,-1);\n        GUTF8String xname = tagtoname(xtag,n);\n        if(xname.downcase() == \"xml\")\n        {\n          ParseValues(n,args);\n          for(GPosition pos=args;pos;++pos)\n          {\n            if(args.key(pos) == \"encoding\")\n            {\n              const GUTF8String e=args[pos].upcase();\n              if(e != encoding)\n              {\n                xmlbs.set_encoding((encoding=e));\n              }\n            }\n          }\n        }\n        break;\n      }\n      case '!':\n      {\n        if(tag[2] == '-' && tag[3] == '-')\n        {\n          while((len < 7) ||\n            (tag.substr(len-3,-1) != \"-->\"))\n          {\n            GUTF8String cont(xmlbs.gets(0,'>',true));\n            if(!cont.length())\n            { \n              GUTF8String mesg;\n              mesg.format( ERR_MSG(\"XMLTags.bad_comment\") \"\\t%s\",(const char *)tag);\n              G_THROW(mesg);\n            }\n            len=((tag+=cont).length());\n          }\n        }\n        break;\n      }\n      case '/':\n      {\n        GUTF8String xname=tagtoname(tag.substr(2,-1));\n        GPosition last=level.lastpos();\n        if(last)\n        {\n          if(level[last]->name != xname)\n          {\n            G_THROW( (ERR_MSG(\"XMLTags.unmatched_end\") \"\\t\")\n              +level[last]->name+(\"\\t\"+GUTF8String(level[last]->get_Line()))\n              +(\"\\t\"+xname)+(\"\\t\"+GUTF8String(linesread+1)));\n          }\n          level.del(last);\n        }else\n        {\n          G_THROW( ERR_MSG(\"XMLTags.bad_form\") );\n        }\n        break;\n      }\n      default:\n      {\n        GPosition last=level.lastpos();\n        GP<lt_XMLTags> t;\n        if(last)\n        {\n          t=new lt_XMLTags(tag.substr(1,len-1));\n          level[last]->addtag(t);\n          if(tag[len-2] != '/')\n          {\n            level.append(t);\n          }\n        }else if(tag[len-2] != '/')\n        {\n          char const *n;\n          GUTF8String xtag = tag.substr(1,-1); \n          name=tagtoname(xtag, n);\n          ParseValues(n,args);\n          t=this;\n          level.append(t);\n        }else\n        {\n          G_THROW( ERR_MSG(\"XMLTags.no_body\") );\n        }\n        t->set_Line(linesread+1);\n        break;\n      }\n    }\n    if((raw=xmlbs.gets(0,'<',false))[0])\n    { \n      linesread=xmlbs.get_lines_read();\n      GPosition last=level.lastpos();\n      if(last)\n      {\n        level[last]->addraw(raw);\n      }else if(!isspaces(raw))\n      {\n        G_THROW(( ERR_MSG(\"XMLTags.raw_string\") \"\\t\")+raw);\n      }\n    }\n  }\n}\n\nGPList<lt_XMLTags>\nlt_XMLTags::get_Tags(char const tagname[]) const\n{\n  GPosition pos=allTags.contains(tagname);\n  GPList<lt_XMLTags> retval;\n  return (pos?allTags[pos]:retval);\n}\n\nvoid\nlt_XMLTags::get_Maps(char const tagname[],\n                     char const argn[],\n                     GPList<lt_XMLTags> list,\n                     GMap<GUTF8String, GP<lt_XMLTags> > &map)\n{\n  for(GPosition pos=list;pos;++pos)\n  {\n    GP<lt_XMLTags> &tag=list[pos];\n    if(tag)\n    {\n      GPosition loc;\n      if((loc=tag->contains(tagname)))\n      {\n        GPList<lt_XMLTags> maps=(GPList<lt_XMLTags> &)((*tag)[loc]);\n        for(GPosition mloc=maps;mloc;++mloc)\n        {\n          GP<lt_XMLTags> gtag=maps[mloc];\n          if(gtag)\n          {\n            GMap<GUTF8String,GUTF8String> &args=gtag->args;\n            GPosition gpos;\n            if((gpos=args.contains(argn)))\n            {\n              map[args[gpos]]=gtag;\n            }\n          }\n        }\n      }\n    }\n  }\n}\n\nvoid\nlt_XMLTags::write(ByteStream &bs,bool const top) const\n{\n  if(name.length())\n  {\n    GUTF8String tag=\"<\"+name;\n    for(GPosition pos=args;pos;++pos)\n    {\n      tag+=GUTF8String(' ')+args.key(pos)+GUTF8String(\"=\\42\")+args[pos].toEscaped()+GUTF8String(\"\\42\");\n    }\n    GPosition tags=content;\n    if(tags||raw.length()) \n    {\n      tag+=\">\";\n      bs.writall((const char *)tag,tag.length());\n      tag=\"</\"+name+\">\";\n      if(raw.length())\n      {\n        bs.writestring(raw);\n      }\n      for(;tags;++tags)\n      {\n        content[tags].write(bs);\n      }\n    }else if(!raw.length())\n    {\n      tag+=\"/>\";\n    }\n    bs.writall((const char *)tag,tag.length());\n  }\n  if(top)\n  {\n     bs.writall(\"\\n\",1);\n  }\n}\n\nvoid\nlt_XMLContents::write(ByteStream &bs) const\n{\n  if(tag)\n  {\n    tag->write(bs,false);\n  }\n  if(raw.length())\n  {\n    bs.writestring(raw);\n  } \n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/XMLTags.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _LT_XMLTAGS__\n#define _LT_XMLTAGS__\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n// From: Leon Bottou, 1/31/2002\n// This is purely Lizardtech stuff.\n\n#include \"GContainer.h\"\n#include \"GString.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass lt_XMLContents;\nclass DjVuFile;\nclass DjVuDocument;\nclass ByteStream;\nclass XMLByteStream;\nclass GURL;\n\nclass DJVUAPI lt_XMLTags : public GPEnabled\n{\nprotected:\n  lt_XMLTags();\n  lt_XMLTags(const char n[]);\n\npublic:\n  /// Empty creator.\n  static GP<lt_XMLTags> create(void) { return new lt_XMLTags; }\n  /// Default the specified tag.\n  static GP<lt_XMLTags> create(const char n[]) { return new lt_XMLTags(n); }\n  /// Initialize from the specified URL.\n  void init(const GURL & url);\n  /// Create from the specified URL.\n  static GP<lt_XMLTags> create(const GURL &url);\n  /// Initialize from the specified bytestream.\n  void init(const GP<ByteStream> &bs);\n  /// Create from the specified bytestream.\n  static GP<lt_XMLTags> create(const GP<ByteStream> &bs);\n  /// Initialize from an XMLByteStream.\n  void init(XMLByteStream &xmlbs);\n  /// Create from an XML bytestream.\n  static GP<lt_XMLTags> create(XMLByteStream &xmlbs);\n  /// Non-virtual destructor.\n  ~lt_XMLTags();\n\n  inline int get_Line(void) const;\n  inline const GUTF8String& get_raw(void) const;\n  inline const GUTF8String& get_name(void) const;\n  inline const GList<lt_XMLContents>& get_content(void) const;\n  inline const GMap<GUTF8String,GUTF8String>& get_args(void) const;\n  inline const GMap<GUTF8String,GPList<lt_XMLTags> >& get_allTags(void) const;\n\n  GPList<lt_XMLTags> get_Tags(char const tagname[]) const;\n  inline void set_Line(const int xstartline) { startline=xstartline; }\n\n  inline void addtag(GP<lt_XMLTags> x);\n  inline void addraw(GUTF8String raw);\n  inline GPosition contains(GUTF8String name) const;\n  inline const GPList<lt_XMLTags> & operator [] (const GUTF8String name) const;\n  inline const GPList<lt_XMLTags> & operator [] (const GPosition &pos) const;\n  static void ParseValues(char const *t, GMap<GUTF8String,GUTF8String> &args,bool downcase=true);\n  static void get_Maps(char const tagname[],char const argn[],\n    GPList<lt_XMLTags> list, GMap<GUTF8String, GP<lt_XMLTags> > &map);\n  void write(ByteStream &bs,bool const top=true) const;\n\nprotected:\n  GUTF8String name;\n  GMap<GUTF8String,GUTF8String> args;\n  GList<lt_XMLContents> content;\n  GUTF8String raw;\n  GMap<GUTF8String,GPList<lt_XMLTags> > allTags;\n  int startline;\n};\n\nclass lt_XMLContents\n{\npublic:\n  lt_XMLContents(void);\n  lt_XMLContents(GP<lt_XMLTags> tag);\n  GP<lt_XMLTags> tag;\n  GUTF8String raw;\n  void write(ByteStream &bs) const;\n};\n\ninline GP<lt_XMLTags>\nlt_XMLTags::create(const GURL &url)\n{\n  const GP<lt_XMLTags> retval(new lt_XMLTags);\n  retval->init(url);\n  return retval;\n}\n\ninline GP<lt_XMLTags>\nlt_XMLTags::create(const GP<ByteStream> &bs)\n{\n  const GP<lt_XMLTags> retval(new lt_XMLTags);\n  retval->init(bs);\n  return retval;\n}\n\ninline GP<lt_XMLTags>\nlt_XMLTags::create(XMLByteStream &xmlbs)\n{\n  const GP<lt_XMLTags> retval(new lt_XMLTags);\n  retval->init(xmlbs);\n  return retval;\n}\n\n/// Non-virtual destructor.\ninline void\nlt_XMLTags::addtag (GP<lt_XMLTags> x)\n{\n  content.append(lt_XMLContents(x));\n  allTags[x->name].append(x);\n}\n\ninline void\nlt_XMLTags::addraw (GUTF8String r)\n{\n  GPosition pos=content;\n  if(pos)\n  {\n    content[pos].raw+=r;\n  }else\n  {\n    raw+=r;\n  }\n}\n\ninline int\nlt_XMLTags::get_Line(void) const\n{ return startline; }\n\ninline const GUTF8String &\nlt_XMLTags::get_name(void) const { return name; }\n\ninline const GUTF8String &\nlt_XMLTags::get_raw(void) const { return raw; }\n\ninline const GList<lt_XMLContents> &\nlt_XMLTags::get_content(void) const { return content; }\n\ninline const GMap<GUTF8String,GUTF8String> &\nlt_XMLTags::get_args(void) const { return args; }\n\ninline const GMap<GUTF8String,GPList<lt_XMLTags> > &\nlt_XMLTags::get_allTags(void) const { return allTags; }\n\ninline GPosition\nlt_XMLTags::contains(GUTF8String name) const\n{\n  return allTags.contains(name);\n}\n\ninline const GPList<lt_XMLTags> &\nlt_XMLTags::operator [] (const GUTF8String name) const\n{\n  return allTags[name];\n}\n\ninline const GPList<lt_XMLTags> &\nlt_XMLTags::operator [] (const GPosition &pos) const\n{\n  return allTags[pos];\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif /* _LT_XMLTAGS__ */\n\n\n"
  },
  {
    "path": "ext/libdjvu/ZPCodec.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n// From: Leon Bottou, 1/31/2002\n// Almost equal to my initial code.\n\n#include \"ZPCodec.h\"\n#include \"ByteStream.h\"\n#include \"GException.h\"\n\n#include <stddef.h>\n#include <stdlib.h>\n#include <assert.h>\n#include <math.h>\n#include <stdio.h>\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n////////////////////////////////////////////////////////////////\n// CODER SPECIFICATION\n////////////////////////////////////////////////////////////////\n\n\n#ifndef ZPCODER\n#ifndef ZCODER\n#define ZPCODER\n#endif\n#endif\n#ifdef ZCODER\n\n// The ZCODER option is provided for documentation purposes only. The ZCODER\n// might come dangerously close to U.S. patent 5059976 (Mitsubishi).  This is\n// why we always use the ZPCODER, although it usually produces 1% larger files.\n#warning \"The ZCODER may infringe non-LizardTech patent(s).\"\n#warning \"You should use the ZPCODER instead.\"\n#endif\n\n\n////////////////////////////////////////////////////////////////\n// ZP CODER DEFAULT ADAPTATION TABLE\n////////////////////////////////////////////////////////////////\n\n\n// See ZPCodec::ZPCodec to see how this\n// default table is modified when not\n// using the DjVu compatibility mode.\n\n\nstatic ZPCodec::Table default_ztable[256] = \n{\n#ifdef ZPCODER\n  /* This table has been designed for the ZPCoder\n   * by running the following command in file 'zptable.sn':\n   * (fast-crude (steady-mat 0.0035  0.0002) 260)))\n   */\n  { 0x8000,  0x0000,  84, 145 },    /* 000: p=0.500000 (    0,    0) */\n  { 0x8000,  0x0000,   3,   4 },    /* 001: p=0.500000 (    0,    0) */\n  { 0x8000,  0x0000,   4,   3 },    /* 002: p=0.500000 (    0,    0) */\n  { 0x6bbd,  0x10a5,   5,   1 },    /* 003: p=0.465226 (    0,    0) */\n  { 0x6bbd,  0x10a5,   6,   2 },    /* 004: p=0.465226 (    0,    0) */\n  { 0x5d45,  0x1f28,   7,   3 },    /* 005: p=0.430708 (    0,    0) */\n  { 0x5d45,  0x1f28,   8,   4 },    /* 006: p=0.430708 (    0,    0) */\n  { 0x51b9,  0x2bd3,   9,   5 },    /* 007: p=0.396718 (    0,    0) */\n  { 0x51b9,  0x2bd3,  10,   6 },    /* 008: p=0.396718 (    0,    0) */\n  { 0x4813,  0x36e3,  11,   7 },    /* 009: p=0.363535 (    0,    0) */\n  { 0x4813,  0x36e3,  12,   8 },    /* 010: p=0.363535 (    0,    0) */\n  { 0x3fd5,  0x408c,  13,   9 },    /* 011: p=0.331418 (    0,    0) */\n  { 0x3fd5,  0x408c,  14,  10 },    /* 012: p=0.331418 (    0,    0) */\n  { 0x38b1,  0x48fd,  15,  11 },    /* 013: p=0.300585 (    0,    0) */\n  { 0x38b1,  0x48fd,  16,  12 },    /* 014: p=0.300585 (    0,    0) */\n  { 0x3275,  0x505d,  17,  13 },    /* 015: p=0.271213 (    0,    0) */\n  { 0x3275,  0x505d,  18,  14 },    /* 016: p=0.271213 (    0,    0) */\n  { 0x2cfd,  0x56d0,  19,  15 },    /* 017: p=0.243438 (    0,    0) */\n  { 0x2cfd,  0x56d0,  20,  16 },    /* 018: p=0.243438 (    0,    0) */\n  { 0x2825,  0x5c71,  21,  17 },    /* 019: p=0.217391 (    0,    0) */\n  { 0x2825,  0x5c71,  22,  18 },    /* 020: p=0.217391 (    0,    0) */\n  { 0x23ab,  0x615b,  23,  19 },    /* 021: p=0.193150 (    0,    0) */\n  { 0x23ab,  0x615b,  24,  20 },    /* 022: p=0.193150 (    0,    0) */\n  { 0x1f87,  0x65a5,  25,  21 },    /* 023: p=0.170728 (    0,    0) */\n  { 0x1f87,  0x65a5,  26,  22 },    /* 024: p=0.170728 (    0,    0) */\n  { 0x1bbb,  0x6962,  27,  23 },    /* 025: p=0.150158 (    0,    0) */\n  { 0x1bbb,  0x6962,  28,  24 },    /* 026: p=0.150158 (    0,    0) */\n  { 0x1845,  0x6ca2,  29,  25 },    /* 027: p=0.131418 (    0,    0) */\n  { 0x1845,  0x6ca2,  30,  26 },    /* 028: p=0.131418 (    0,    0) */\n  { 0x1523,  0x6f74,  31,  27 },    /* 029: p=0.114460 (    0,    0) */\n  { 0x1523,  0x6f74,  32,  28 },    /* 030: p=0.114460 (    0,    0) */\n  { 0x1253,  0x71e6,  33,  29 },    /* 031: p=0.099230 (    0,    0) */\n  { 0x1253,  0x71e6,  34,  30 },    /* 032: p=0.099230 (    0,    0) */\n  { 0x0fcf,  0x7404,  35,  31 },    /* 033: p=0.085611 (    0,    0) */\n  { 0x0fcf,  0x7404,  36,  32 },    /* 034: p=0.085611 (    0,    0) */\n  { 0x0d95,  0x75d6,  37,  33 },    /* 035: p=0.073550 (    0,    0) */\n  { 0x0d95,  0x75d6,  38,  34 },    /* 036: p=0.073550 (    0,    0) */\n  { 0x0b9d,  0x7768,  39,  35 },    /* 037: p=0.062888 (    0,    0) */\n  { 0x0b9d,  0x7768,  40,  36 },    /* 038: p=0.062888 (    0,    0) */\n  { 0x09e3,  0x78c2,  41,  37 },    /* 039: p=0.053539 (    0,    0) */\n  { 0x09e3,  0x78c2,  42,  38 },    /* 040: p=0.053539 (    0,    0) */\n  { 0x0861,  0x79ea,  43,  39 },    /* 041: p=0.045365 (    0,    0) */\n  { 0x0861,  0x79ea,  44,  40 },    /* 042: p=0.045365 (    0,    0) */\n  { 0x0711,  0x7ae7,  45,  41 },    /* 043: p=0.038272 (    0,    0) */\n  { 0x0711,  0x7ae7,  46,  42 },    /* 044: p=0.038272 (    0,    0) */\n  { 0x05f1,  0x7bbe,  47,  43 },    /* 045: p=0.032174 (    0,    0) */\n  { 0x05f1,  0x7bbe,  48,  44 },    /* 046: p=0.032174 (    0,    0) */\n  { 0x04f9,  0x7c75,  49,  45 },    /* 047: p=0.026928 (    0,    0) */\n  { 0x04f9,  0x7c75,  50,  46 },    /* 048: p=0.026928 (    0,    0) */\n  { 0x0425,  0x7d0f,  51,  47 },    /* 049: p=0.022444 (    0,    0) */\n  { 0x0425,  0x7d0f,  52,  48 },    /* 050: p=0.022444 (    0,    0) */\n  { 0x0371,  0x7d91,  53,  49 },    /* 051: p=0.018636 (    0,    0) */\n  { 0x0371,  0x7d91,  54,  50 },    /* 052: p=0.018636 (    0,    0) */\n  { 0x02d9,  0x7dfe,  55,  51 },    /* 053: p=0.015421 (    0,    0) */\n  { 0x02d9,  0x7dfe,  56,  52 },    /* 054: p=0.015421 (    0,    0) */\n  { 0x0259,  0x7e5a,  57,  53 },    /* 055: p=0.012713 (    0,    0) */\n  { 0x0259,  0x7e5a,  58,  54 },    /* 056: p=0.012713 (    0,    0) */\n  { 0x01ed,  0x7ea6,  59,  55 },    /* 057: p=0.010419 (    0,    0) */\n  { 0x01ed,  0x7ea6,  60,  56 },    /* 058: p=0.010419 (    0,    0) */\n  { 0x0193,  0x7ee6,  61,  57 },    /* 059: p=0.008525 (    0,    0) */\n  { 0x0193,  0x7ee6,  62,  58 },    /* 060: p=0.008525 (    0,    0) */\n  { 0x0149,  0x7f1a,  63,  59 },    /* 061: p=0.006959 (    0,    0) */\n  { 0x0149,  0x7f1a,  64,  60 },    /* 062: p=0.006959 (    0,    0) */\n  { 0x010b,  0x7f45,  65,  61 },    /* 063: p=0.005648 (    0,    0) */\n  { 0x010b,  0x7f45,  66,  62 },    /* 064: p=0.005648 (    0,    0) */\n  { 0x00d5,  0x7f6b,  67,  63 },    /* 065: p=0.004506 (    0,    0) */\n  { 0x00d5,  0x7f6b,  68,  64 },    /* 066: p=0.004506 (    0,    0) */\n  { 0x00a5,  0x7f8d,  69,  65 },    /* 067: p=0.003480 (    0,    0) */\n  { 0x00a5,  0x7f8d,  70,  66 },    /* 068: p=0.003480 (    0,    0) */\n  { 0x007b,  0x7faa,  71,  67 },    /* 069: p=0.002602 (    0,    0) */\n  { 0x007b,  0x7faa,  72,  68 },    /* 070: p=0.002602 (    0,    0) */\n  { 0x0057,  0x7fc3,  73,  69 },    /* 071: p=0.001843 (    0,    0) */\n  { 0x0057,  0x7fc3,  74,  70 },    /* 072: p=0.001843 (    0,    0) */\n  { 0x003b,  0x7fd7,  75,  71 },    /* 073: p=0.001248 (    0,    0) */\n  { 0x003b,  0x7fd7,  76,  72 },    /* 074: p=0.001248 (    0,    0) */\n  { 0x0023,  0x7fe7,  77,  73 },    /* 075: p=0.000749 (    0,    0) */\n  { 0x0023,  0x7fe7,  78,  74 },    /* 076: p=0.000749 (    0,    0) */\n  { 0x0013,  0x7ff2,  79,  75 },    /* 077: p=0.000402 (    0,    0) */\n  { 0x0013,  0x7ff2,  80,  76 },    /* 078: p=0.000402 (    0,    0) */\n  { 0x0007,  0x7ffa,  81,  77 },    /* 079: p=0.000153 (    0,    0) */\n  { 0x0007,  0x7ffa,  82,  78 },    /* 080: p=0.000153 (    0,    0) */\n  { 0x0001,  0x7fff,  81,  79 },    /* 081: p=0.000027 (    0,    0) */\n  { 0x0001,  0x7fff,  82,  80 },    /* 082: p=0.000027 (    0,    0) */\n  { 0x5695,  0x0000,   9,  85 },    /* 083: p=0.411764 (    2,    3) */\n  { 0x24ee,  0x0000,  86, 226 },    /* 084: p=0.199988 (    1,    0) */\n  { 0x8000,  0x0000,   5,   6 },    /* 085: p=0.500000 (    3,    3) */\n  { 0x0d30,  0x0000,  88, 176 },    /* 086: p=0.071422 (    4,    0) */\n  { 0x481a,  0x0000,  89, 143 },    /* 087: p=0.363634 (    1,    2) */\n  { 0x0481,  0x0000,  90, 138 },    /* 088: p=0.024388 (   13,    0) */\n  { 0x3579,  0x0000,  91, 141 },    /* 089: p=0.285711 (    1,    3) */\n  { 0x017a,  0x0000,  92, 112 },    /* 090: p=0.007999 (   41,    0) */\n  { 0x24ef,  0x0000,  93, 135 },    /* 091: p=0.199997 (    1,    5) */\n  { 0x007b,  0x0000,  94, 104 },    /* 092: p=0.002611 (  127,    0) */\n  { 0x1978,  0x0000,  95, 133 },    /* 093: p=0.137929 (    1,    8) */\n  { 0x0028,  0x0000,  96, 100 },    /* 094: p=0.000849 (  392,    0) */\n  { 0x10ca,  0x0000,  97, 129 },    /* 095: p=0.090907 (    1,   13) */\n  { 0x000d,  0x0000,  82,  98 },    /* 096: p=0.000276 ( 1208,    0) */\n  { 0x0b5d,  0x0000,  99, 127 },    /* 097: p=0.061537 (    1,   20) */\n  { 0x0034,  0x0000,  76,  72 },    /* 098: p=0.001102 ( 1208,    1) */\n  { 0x078a,  0x0000, 101, 125 },    /* 099: p=0.040815 (    1,   31) */\n  { 0x00a0,  0x0000,  70, 102 },    /* 100: p=0.003387 (  392,    1) */\n  { 0x050f,  0x0000, 103, 123 },    /* 101: p=0.027397 (    1,   47) */\n  { 0x0117,  0x0000,  66,  60 },    /* 102: p=0.005912 (  392,    2) */\n  { 0x0358,  0x0000, 105, 121 },    /* 103: p=0.018099 (    1,   72) */\n  { 0x01ea,  0x0000, 106, 110 },    /* 104: p=0.010362 (  127,    1) */\n  { 0x0234,  0x0000, 107, 119 },    /* 105: p=0.011940 (    1,  110) */\n  { 0x0144,  0x0000,  66, 108 },    /* 106: p=0.006849 (  193,    1) */\n  { 0x0173,  0x0000, 109, 117 },    /* 107: p=0.007858 (    1,  168) */\n  { 0x0234,  0x0000,  60,  54 },    /* 108: p=0.011925 (  193,    2) */\n  { 0x00f5,  0x0000, 111, 115 },    /* 109: p=0.005175 (    1,  256) */\n  { 0x0353,  0x0000,  56,  48 },    /* 110: p=0.017995 (  127,    2) */\n  { 0x00a1,  0x0000,  69, 113 },    /* 111: p=0.003413 (    1,  389) */\n  { 0x05c5,  0x0000, 114, 134 },    /* 112: p=0.031249 (   41,    1) */\n  { 0x011a,  0x0000,  65,  59 },    /* 113: p=0.005957 (    2,  389) */\n  { 0x03cf,  0x0000, 116, 132 },    /* 114: p=0.020618 (   63,    1) */\n  { 0x01aa,  0x0000,  61,  55 },    /* 115: p=0.009020 (    2,  256) */\n  { 0x0285,  0x0000, 118, 130 },    /* 116: p=0.013652 (   96,    1) */\n  { 0x0286,  0x0000,  57,  51 },    /* 117: p=0.013672 (    2,  168) */\n  { 0x01ab,  0x0000, 120, 128 },    /* 118: p=0.009029 (  146,    1) */\n  { 0x03d3,  0x0000,  53,  47 },    /* 119: p=0.020710 (    2,  110) */\n  { 0x011a,  0x0000, 122, 126 },    /* 120: p=0.005961 (  222,    1) */\n  { 0x05c5,  0x0000,  49,  41 },    /* 121: p=0.031250 (    2,   72) */\n  { 0x00ba,  0x0000, 124,  62 },    /* 122: p=0.003925 (  338,    1) */\n  { 0x08ad,  0x0000,  43,  37 },    /* 123: p=0.046979 (    2,   47) */\n  { 0x007a,  0x0000,  72,  66 },    /* 124: p=0.002586 (  514,    1) */\n  { 0x0ccc,  0x0000,  39,  31 },    /* 125: p=0.069306 (    2,   31) */\n  { 0x01eb,  0x0000,  60,  54 },    /* 126: p=0.010386 (  222,    2) */\n  { 0x1302,  0x0000,  33,  25 },    /* 127: p=0.102940 (    2,   20) */\n  { 0x02e6,  0x0000,  56,  50 },    /* 128: p=0.015695 (  146,    2) */\n  { 0x1b81,  0x0000,  29, 131 },    /* 129: p=0.148935 (    2,   13) */\n  { 0x045e,  0x0000,  52,  46 },    /* 130: p=0.023648 (   96,    2) */\n  { 0x24ef,  0x0000,  23,  17 },    /* 131: p=0.199999 (    3,   13) */\n  { 0x0690,  0x0000,  48,  40 },    /* 132: p=0.035533 (   63,    2) */\n  { 0x2865,  0x0000,  23,  15 },    /* 133: p=0.218748 (    2,    8) */\n  { 0x09de,  0x0000,  42, 136 },    /* 134: p=0.053434 (   41,    2) */\n  { 0x3987,  0x0000, 137,   7 },    /* 135: p=0.304346 (    2,    5) */\n  { 0x0dc8,  0x0000,  38,  32 },    /* 136: p=0.074626 (   41,    3) */\n  { 0x2c99,  0x0000,  21, 139 },    /* 137: p=0.241378 (    2,    7) */\n  { 0x10ca,  0x0000, 140, 172 },    /* 138: p=0.090907 (   13,    1) */\n  { 0x3b5f,  0x0000,  15,   9 },    /* 139: p=0.312499 (    3,    7) */\n  { 0x0b5d,  0x0000, 142, 170 },    /* 140: p=0.061537 (   20,    1) */\n  { 0x5695,  0x0000,   9,  85 },    /* 141: p=0.411764 (    2,    3) */\n  { 0x078a,  0x0000, 144, 168 },    /* 142: p=0.040815 (   31,    1) */\n  { 0x8000,  0x0000, 141, 248 },    /* 143: p=0.500000 (    2,    2) */\n  { 0x050f,  0x0000, 146, 166 },    /* 144: p=0.027397 (   47,    1) */\n  { 0x24ee,  0x0000, 147, 247 },    /* 145: p=0.199988 (    0,    1) */\n  { 0x0358,  0x0000, 148, 164 },    /* 146: p=0.018099 (   72,    1) */\n  { 0x0d30,  0x0000, 149, 197 },    /* 147: p=0.071422 (    0,    4) */\n  { 0x0234,  0x0000, 150, 162 },    /* 148: p=0.011940 (  110,    1) */\n  { 0x0481,  0x0000, 151,  95 },    /* 149: p=0.024388 (    0,   13) */\n  { 0x0173,  0x0000, 152, 160 },    /* 150: p=0.007858 (  168,    1) */\n  { 0x017a,  0x0000, 153, 173 },    /* 151: p=0.007999 (    0,   41) */\n  { 0x00f5,  0x0000, 154, 158 },    /* 152: p=0.005175 (  256,    1) */\n  { 0x007b,  0x0000, 155, 165 },    /* 153: p=0.002611 (    0,  127) */\n  { 0x00a1,  0x0000,  70, 156 },    /* 154: p=0.003413 (  389,    1) */\n  { 0x0028,  0x0000, 157, 161 },    /* 155: p=0.000849 (    0,  392) */\n  { 0x011a,  0x0000,  66,  60 },    /* 156: p=0.005957 (  389,    2) */\n  { 0x000d,  0x0000,  81, 159 },    /* 157: p=0.000276 (    0, 1208) */\n  { 0x01aa,  0x0000,  62,  56 },    /* 158: p=0.009020 (  256,    2) */\n  { 0x0034,  0x0000,  75,  71 },    /* 159: p=0.001102 (    1, 1208) */\n  { 0x0286,  0x0000,  58,  52 },    /* 160: p=0.013672 (  168,    2) */\n  { 0x00a0,  0x0000,  69, 163 },    /* 161: p=0.003387 (    1,  392) */\n  { 0x03d3,  0x0000,  54,  48 },    /* 162: p=0.020710 (  110,    2) */\n  { 0x0117,  0x0000,  65,  59 },    /* 163: p=0.005912 (    2,  392) */\n  { 0x05c5,  0x0000,  50,  42 },    /* 164: p=0.031250 (   72,    2) */\n  { 0x01ea,  0x0000, 167, 171 },    /* 165: p=0.010362 (    1,  127) */\n  { 0x08ad,  0x0000,  44,  38 },    /* 166: p=0.046979 (   47,    2) */\n  { 0x0144,  0x0000,  65, 169 },    /* 167: p=0.006849 (    1,  193) */\n  { 0x0ccc,  0x0000,  40,  32 },    /* 168: p=0.069306 (   31,    2) */\n  { 0x0234,  0x0000,  59,  53 },    /* 169: p=0.011925 (    2,  193) */\n  { 0x1302,  0x0000,  34,  26 },    /* 170: p=0.102940 (   20,    2) */\n  { 0x0353,  0x0000,  55,  47 },    /* 171: p=0.017995 (    2,  127) */\n  { 0x1b81,  0x0000,  30, 174 },    /* 172: p=0.148935 (   13,    2) */\n  { 0x05c5,  0x0000, 175, 193 },    /* 173: p=0.031249 (    1,   41) */\n  { 0x24ef,  0x0000,  24,  18 },    /* 174: p=0.199999 (   13,    3) */\n  { 0x03cf,  0x0000, 177, 191 },    /* 175: p=0.020618 (    1,   63) */\n  { 0x2b74,  0x0000, 178, 222 },    /* 176: p=0.235291 (    4,    1) */\n  { 0x0285,  0x0000, 179, 189 },    /* 177: p=0.013652 (    1,   96) */\n  { 0x201d,  0x0000, 180, 218 },    /* 178: p=0.173910 (    6,    1) */\n  { 0x01ab,  0x0000, 181, 187 },    /* 179: p=0.009029 (    1,  146) */\n  { 0x1715,  0x0000, 182, 216 },    /* 180: p=0.124998 (    9,    1) */\n  { 0x011a,  0x0000, 183, 185 },    /* 181: p=0.005961 (    1,  222) */\n  { 0x0fb7,  0x0000, 184, 214 },    /* 182: p=0.085105 (   14,    1) */\n  { 0x00ba,  0x0000,  69,  61 },    /* 183: p=0.003925 (    1,  338) */\n  { 0x0a67,  0x0000, 186, 212 },    /* 184: p=0.056337 (   22,    1) */\n  { 0x01eb,  0x0000,  59,  53 },    /* 185: p=0.010386 (    2,  222) */\n  { 0x06e7,  0x0000, 188, 210 },    /* 186: p=0.037382 (   34,    1) */\n  { 0x02e6,  0x0000,  55,  49 },    /* 187: p=0.015695 (    2,  146) */\n  { 0x0496,  0x0000, 190, 208 },    /* 188: p=0.024844 (   52,    1) */\n  { 0x045e,  0x0000,  51,  45 },    /* 189: p=0.023648 (    2,   96) */\n  { 0x030d,  0x0000, 192, 206 },    /* 190: p=0.016529 (   79,    1) */\n  { 0x0690,  0x0000,  47,  39 },    /* 191: p=0.035533 (    2,   63) */\n  { 0x0206,  0x0000, 194, 204 },    /* 192: p=0.010959 (  120,    1) */\n  { 0x09de,  0x0000,  41, 195 },    /* 193: p=0.053434 (    2,   41) */\n  { 0x0155,  0x0000, 196, 202 },    /* 194: p=0.007220 (  183,    1) */\n  { 0x0dc8,  0x0000,  37,  31 },    /* 195: p=0.074626 (    3,   41) */\n  { 0x00e1,  0x0000, 198, 200 },    /* 196: p=0.004750 (  279,    1) */\n  { 0x2b74,  0x0000, 199, 243 },    /* 197: p=0.235291 (    1,    4) */\n  { 0x0094,  0x0000,  72,  64 },    /* 198: p=0.003132 (  424,    1) */\n  { 0x201d,  0x0000, 201, 239 },    /* 199: p=0.173910 (    1,    6) */\n  { 0x0188,  0x0000,  62,  56 },    /* 200: p=0.008284 (  279,    2) */\n  { 0x1715,  0x0000, 203, 237 },    /* 201: p=0.124998 (    1,    9) */\n  { 0x0252,  0x0000,  58,  52 },    /* 202: p=0.012567 (  183,    2) */\n  { 0x0fb7,  0x0000, 205, 235 },    /* 203: p=0.085105 (    1,   14) */\n  { 0x0383,  0x0000,  54,  48 },    /* 204: p=0.019021 (  120,    2) */\n  { 0x0a67,  0x0000, 207, 233 },    /* 205: p=0.056337 (    1,   22) */\n  { 0x0547,  0x0000,  50,  44 },    /* 206: p=0.028571 (   79,    2) */\n  { 0x06e7,  0x0000, 209, 231 },    /* 207: p=0.037382 (    1,   34) */\n  { 0x07e2,  0x0000,  46,  38 },    /* 208: p=0.042682 (   52,    2) */\n  { 0x0496,  0x0000, 211, 229 },    /* 209: p=0.024844 (    1,   52) */\n  { 0x0bc0,  0x0000,  40,  34 },    /* 210: p=0.063636 (   34,    2) */\n  { 0x030d,  0x0000, 213, 227 },    /* 211: p=0.016529 (    1,   79) */\n  { 0x1178,  0x0000,  36,  28 },    /* 212: p=0.094593 (   22,    2) */\n  { 0x0206,  0x0000, 215, 225 },    /* 213: p=0.010959 (    1,  120) */\n  { 0x19da,  0x0000,  30,  22 },    /* 214: p=0.139999 (   14,    2) */\n  { 0x0155,  0x0000, 217, 223 },    /* 215: p=0.007220 (    1,  183) */\n  { 0x24ef,  0x0000,  26,  16 },    /* 216: p=0.199998 (    9,    2) */\n  { 0x00e1,  0x0000, 219, 221 },    /* 217: p=0.004750 (    1,  279) */\n  { 0x320e,  0x0000,  20, 220 },    /* 218: p=0.269229 (    6,    2) */\n  { 0x0094,  0x0000,  71,  63 },    /* 219: p=0.003132 (    1,  424) */\n  { 0x432a,  0x0000,  14,   8 },    /* 220: p=0.344827 (    6,    3) */\n  { 0x0188,  0x0000,  61,  55 },    /* 221: p=0.008284 (    2,  279) */\n  { 0x447d,  0x0000,  14, 224 },    /* 222: p=0.349998 (    4,    2) */\n  { 0x0252,  0x0000,  57,  51 },    /* 223: p=0.012567 (    2,  183) */\n  { 0x5ece,  0x0000,   8,   2 },    /* 224: p=0.434782 (    4,    3) */\n  { 0x0383,  0x0000,  53,  47 },    /* 225: p=0.019021 (    2,  120) */\n  { 0x8000,  0x0000, 228,  87 },    /* 226: p=0.500000 (    1,    1) */\n  { 0x0547,  0x0000,  49,  43 },    /* 227: p=0.028571 (    2,   79) */\n  { 0x481a,  0x0000, 230, 246 },    /* 228: p=0.363634 (    2,    1) */\n  { 0x07e2,  0x0000,  45,  37 },    /* 229: p=0.042682 (    2,   52) */\n  { 0x3579,  0x0000, 232, 244 },    /* 230: p=0.285711 (    3,    1) */\n  { 0x0bc0,  0x0000,  39,  33 },    /* 231: p=0.063636 (    2,   34) */\n  { 0x24ef,  0x0000, 234, 238 },    /* 232: p=0.199997 (    5,    1) */\n  { 0x1178,  0x0000,  35,  27 },    /* 233: p=0.094593 (    2,   22) */\n  { 0x1978,  0x0000, 138, 236 },    /* 234: p=0.137929 (    8,    1) */\n  { 0x19da,  0x0000,  29,  21 },    /* 235: p=0.139999 (    2,   14) */\n  { 0x2865,  0x0000,  24,  16 },    /* 236: p=0.218748 (    8,    2) */\n  { 0x24ef,  0x0000,  25,  15 },    /* 237: p=0.199998 (    2,    9) */\n  { 0x3987,  0x0000, 240,   8 },    /* 238: p=0.304346 (    5,    2) */\n  { 0x320e,  0x0000,  19, 241 },    /* 239: p=0.269229 (    2,    6) */\n  { 0x2c99,  0x0000,  22, 242 },    /* 240: p=0.241378 (    7,    2) */\n  { 0x432a,  0x0000,  13,   7 },    /* 241: p=0.344827 (    3,    6) */\n  { 0x3b5f,  0x0000,  16,  10 },    /* 242: p=0.312499 (    7,    3) */\n  { 0x447d,  0x0000,  13, 245 },    /* 243: p=0.349998 (    2,    4) */\n  { 0x5695,  0x0000,  10,   2 },    /* 244: p=0.411764 (    3,    2) */\n  { 0x5ece,  0x0000,   7,   1 },    /* 245: p=0.434782 (    3,    4) */\n  { 0x8000,  0x0000, 244,  83 },    /* 246: p=0.500000 (    2,    2) */\n  { 0x8000,  0x0000, 249, 250 },    /* 247: p=0.500000 (    1,    1) */\n  { 0x5695,  0x0000,  10,   2 },    /* 248: p=0.411764 (    3,    2) */\n  { 0x481a,  0x0000,  89, 143 },    /* 249: p=0.363634 (    1,    2) */\n  { 0x481a,  0x0000, 230, 246 },    /* 250: p=0.363634 (    2,    1) */\n#endif\n#ifdef ZCODER\n  /* This table has been designed for the ZCoder\n   * by running the following command in file 'ztable2.sn':\n   * (fast-crude (steady-mat 0.0035  0.0002) 260)))\n   */\n  { 0x8000,  0x0000,  84, 139 },    /* 000: p=0.500000 (    0,    0) */\n  { 0x8000,  0x0000,   3,   4 },    /* 001: p=0.500000 (    0,    0) */\n  { 0x8000,  0x0000,   4,   3 },    /* 002: p=0.500000 (    0,    0) */\n  { 0x7399,  0x10a5,   5,   1 },    /* 003: p=0.465226 (    0,    0) */\n  { 0x7399,  0x10a5,   6,   2 },    /* 004: p=0.465226 (    0,    0) */\n  { 0x6813,  0x1f28,   7,   3 },    /* 005: p=0.430708 (    0,    0) */\n  { 0x6813,  0x1f28,   8,   4 },    /* 006: p=0.430708 (    0,    0) */\n  { 0x5d65,  0x2bd3,   9,   5 },    /* 007: p=0.396718 (    0,    0) */\n  { 0x5d65,  0x2bd3,  10,   6 },    /* 008: p=0.396718 (    0,    0) */\n  { 0x5387,  0x36e3,  11,   7 },    /* 009: p=0.363535 (    0,    0) */\n  { 0x5387,  0x36e3,  12,   8 },    /* 010: p=0.363535 (    0,    0) */\n  { 0x4a73,  0x408c,  13,   9 },    /* 011: p=0.331418 (    0,    0) */\n  { 0x4a73,  0x408c,  14,  10 },    /* 012: p=0.331418 (    0,    0) */\n  { 0x421f,  0x48fe,  15,  11 },    /* 013: p=0.300562 (    0,    0) */\n  { 0x421f,  0x48fe,  16,  12 },    /* 014: p=0.300562 (    0,    0) */\n  { 0x3a85,  0x5060,  17,  13 },    /* 015: p=0.271166 (    0,    0) */\n  { 0x3a85,  0x5060,  18,  14 },    /* 016: p=0.271166 (    0,    0) */\n  { 0x339b,  0x56d3,  19,  15 },    /* 017: p=0.243389 (    0,    0) */\n  { 0x339b,  0x56d3,  20,  16 },    /* 018: p=0.243389 (    0,    0) */\n  { 0x2d59,  0x5c73,  21,  17 },    /* 019: p=0.217351 (    0,    0) */\n  { 0x2d59,  0x5c73,  22,  18 },    /* 020: p=0.217351 (    0,    0) */\n  { 0x27b3,  0x615e,  23,  19 },    /* 021: p=0.193091 (    0,    0) */\n  { 0x27b3,  0x615e,  24,  20 },    /* 022: p=0.193091 (    0,    0) */\n  { 0x22a1,  0x65a7,  25,  21 },    /* 023: p=0.170683 (    0,    0) */\n  { 0x22a1,  0x65a7,  26,  22 },    /* 024: p=0.170683 (    0,    0) */\n  { 0x1e19,  0x6963,  27,  23 },    /* 025: p=0.150134 (    0,    0) */\n  { 0x1e19,  0x6963,  28,  24 },    /* 026: p=0.150134 (    0,    0) */\n  { 0x1a0f,  0x6ca3,  29,  25 },    /* 027: p=0.131397 (    0,    0) */\n  { 0x1a0f,  0x6ca3,  30,  26 },    /* 028: p=0.131397 (    0,    0) */\n  { 0x167b,  0x6f75,  31,  27 },    /* 029: p=0.114441 (    0,    0) */\n  { 0x167b,  0x6f75,  32,  28 },    /* 030: p=0.114441 (    0,    0) */\n  { 0x1353,  0x71e6,  33,  29 },    /* 031: p=0.099214 (    0,    0) */\n  { 0x1353,  0x71e6,  34,  30 },    /* 032: p=0.099214 (    0,    0) */\n  { 0x108d,  0x7403,  35,  31 },    /* 033: p=0.085616 (    0,    0) */\n  { 0x108d,  0x7403,  36,  32 },    /* 034: p=0.085616 (    0,    0) */\n  { 0x0e1f,  0x75d7,  37,  33 },    /* 035: p=0.073525 (    0,    0) */\n  { 0x0e1f,  0x75d7,  38,  34 },    /* 036: p=0.073525 (    0,    0) */\n  { 0x0c01,  0x7769,  39,  35 },    /* 037: p=0.062871 (    0,    0) */\n  { 0x0c01,  0x7769,  40,  36 },    /* 038: p=0.062871 (    0,    0) */\n  { 0x0a2b,  0x78c2,  41,  37 },    /* 039: p=0.053524 (    0,    0) */\n  { 0x0a2b,  0x78c2,  42,  38 },    /* 040: p=0.053524 (    0,    0) */\n  { 0x0895,  0x79ea,  43,  39 },    /* 041: p=0.045374 (    0,    0) */\n  { 0x0895,  0x79ea,  44,  40 },    /* 042: p=0.045374 (    0,    0) */\n  { 0x0737,  0x7ae7,  45,  41 },    /* 043: p=0.038280 (    0,    0) */\n  { 0x0737,  0x7ae7,  46,  42 },    /* 044: p=0.038280 (    0,    0) */\n  { 0x060b,  0x7bbe,  47,  43 },    /* 045: p=0.032175 (    0,    0) */\n  { 0x060b,  0x7bbe,  48,  44 },    /* 046: p=0.032175 (    0,    0) */\n  { 0x050b,  0x7c75,  49,  45 },    /* 047: p=0.026926 (    0,    0) */\n  { 0x050b,  0x7c75,  50,  46 },    /* 048: p=0.026926 (    0,    0) */\n  { 0x0431,  0x7d10,  51,  47 },    /* 049: p=0.022430 (    0,    0) */\n  { 0x0431,  0x7d10,  52,  48 },    /* 050: p=0.022430 (    0,    0) */\n  { 0x0379,  0x7d92,  53,  49 },    /* 051: p=0.018623 (    0,    0) */\n  { 0x0379,  0x7d92,  54,  50 },    /* 052: p=0.018623 (    0,    0) */\n  { 0x02dd,  0x7dff,  55,  51 },    /* 053: p=0.015386 (    0,    0) */\n  { 0x02dd,  0x7dff,  56,  52 },    /* 054: p=0.015386 (    0,    0) */\n  { 0x025b,  0x7e5b,  57,  53 },    /* 055: p=0.012671 (    0,    0) */\n  { 0x025b,  0x7e5b,  58,  54 },    /* 056: p=0.012671 (    0,    0) */\n  { 0x01ef,  0x7ea7,  59,  55 },    /* 057: p=0.010414 (    0,    0) */\n  { 0x01ef,  0x7ea7,  60,  56 },    /* 058: p=0.010414 (    0,    0) */\n  { 0x0195,  0x7ee6,  61,  57 },    /* 059: p=0.008529 (    0,    0) */\n  { 0x0195,  0x7ee6,  62,  58 },    /* 060: p=0.008529 (    0,    0) */\n  { 0x0149,  0x7f1b,  63,  59 },    /* 061: p=0.006935 (    0,    0) */\n  { 0x0149,  0x7f1b,  64,  60 },    /* 062: p=0.006935 (    0,    0) */\n  { 0x010b,  0x7f46,  65,  61 },    /* 063: p=0.005631 (    0,    0) */\n  { 0x010b,  0x7f46,  66,  62 },    /* 064: p=0.005631 (    0,    0) */\n  { 0x00d5,  0x7f6c,  67,  63 },    /* 065: p=0.004495 (    0,    0) */\n  { 0x00d5,  0x7f6c,  68,  64 },    /* 066: p=0.004495 (    0,    0) */\n  { 0x00a5,  0x7f8d,  69,  65 },    /* 067: p=0.003484 (    0,    0) */\n  { 0x00a5,  0x7f8d,  70,  66 },    /* 068: p=0.003484 (    0,    0) */\n  { 0x007b,  0x7faa,  71,  67 },    /* 069: p=0.002592 (    0,    0) */\n  { 0x007b,  0x7faa,  72,  68 },    /* 070: p=0.002592 (    0,    0) */\n  { 0x0057,  0x7fc3,  73,  69 },    /* 071: p=0.001835 (    0,    0) */\n  { 0x0057,  0x7fc3,  74,  70 },    /* 072: p=0.001835 (    0,    0) */\n  { 0x0039,  0x7fd8,  75,  71 },    /* 073: p=0.001211 (    0,    0) */\n  { 0x0039,  0x7fd8,  76,  72 },    /* 074: p=0.001211 (    0,    0) */\n  { 0x0023,  0x7fe7,  77,  73 },    /* 075: p=0.000740 (    0,    0) */\n  { 0x0023,  0x7fe7,  78,  74 },    /* 076: p=0.000740 (    0,    0) */\n  { 0x0013,  0x7ff2,  79,  75 },    /* 077: p=0.000402 (    0,    0) */\n  { 0x0013,  0x7ff2,  80,  76 },    /* 078: p=0.000402 (    0,    0) */\n  { 0x0007,  0x7ffa,  81,  77 },    /* 079: p=0.000153 (    0,    0) */\n  { 0x0007,  0x7ffa,  82,  78 },    /* 080: p=0.000153 (    0,    0) */\n  { 0x0001,  0x7fff,  81,  79 },    /* 081: p=0.000027 (    0,    0) */\n  { 0x0001,  0x7fff,  82,  80 },    /* 082: p=0.000027 (    0,    0) */\n  { 0x620b,  0x0000,   9,  85 },    /* 083: p=0.411764 (    2,    3) */\n  { 0x294a,  0x0000,  86, 216 },    /* 084: p=0.199988 (    1,    0) */\n  { 0x8000,  0x0000,   5,   6 },    /* 085: p=0.500000 (    3,    3) */\n  { 0x0db3,  0x0000,  88, 168 },    /* 086: p=0.071422 (    4,    0) */\n  { 0x538e,  0x0000,  89, 137 },    /* 087: p=0.363634 (    1,    2) */\n  { 0x0490,  0x0000,  90, 134 },    /* 088: p=0.024388 (   13,    0) */\n  { 0x3e3e,  0x0000,  91, 135 },    /* 089: p=0.285711 (    1,    3) */\n  { 0x017c,  0x0000,  92, 112 },    /* 090: p=0.007999 (   41,    0) */\n  { 0x294a,  0x0000,  93, 133 },    /* 091: p=0.199997 (    1,    5) */\n  { 0x007c,  0x0000,  94, 104 },    /* 092: p=0.002611 (  127,    0) */\n  { 0x1b75,  0x0000,  95, 131 },    /* 093: p=0.137929 (    1,    8) */\n  { 0x0028,  0x0000,  96, 100 },    /* 094: p=0.000849 (  392,    0) */\n  { 0x12fc,  0x0000,  97, 129 },    /* 095: p=0.097559 (    1,   12) */\n  { 0x000d,  0x0000,  82,  98 },    /* 096: p=0.000276 ( 1208,    0) */\n  { 0x0cfb,  0x0000,  99, 125 },    /* 097: p=0.067795 (    1,   18) */\n  { 0x0034,  0x0000,  76,  72 },    /* 098: p=0.001102 ( 1208,    1) */\n  { 0x08cd,  0x0000, 101, 123 },    /* 099: p=0.046511 (    1,   27) */\n  { 0x00a0,  0x0000,  70, 102 },    /* 100: p=0.003387 (  392,    1) */\n  { 0x05de,  0x0000, 103, 119 },    /* 101: p=0.031249 (    1,   41) */\n  { 0x0118,  0x0000,  66,  60 },    /* 102: p=0.005912 (  392,    2) */\n  { 0x03e9,  0x0000, 105, 117 },    /* 103: p=0.020942 (    1,   62) */\n  { 0x01ed,  0x0000, 106, 110 },    /* 104: p=0.010362 (  127,    1) */\n  { 0x0298,  0x0000, 107, 115 },    /* 105: p=0.013937 (    1,   94) */\n  { 0x0145,  0x0000,  66, 108 },    /* 106: p=0.006849 (  193,    1) */\n  { 0x01b6,  0x0000, 109, 113 },    /* 107: p=0.009216 (    1,  143) */\n  { 0x0237,  0x0000,  60,  54 },    /* 108: p=0.011925 (  193,    2) */\n  { 0x0121,  0x0000,  65, 111 },    /* 109: p=0.006097 (    1,  217) */\n  { 0x035b,  0x0000,  56,  48 },    /* 110: p=0.017995 (  127,    2) */\n  { 0x01f9,  0x0000,  59,  53 },    /* 111: p=0.010622 (    2,  217) */\n  { 0x05de,  0x0000, 114, 130 },    /* 112: p=0.031249 (   41,    1) */\n  { 0x02fc,  0x0000,  55,  49 },    /* 113: p=0.016018 (    2,  143) */\n  { 0x03e9,  0x0000, 116, 128 },    /* 114: p=0.020942 (   62,    1) */\n  { 0x0484,  0x0000,  51,  45 },    /* 115: p=0.024138 (    2,   94) */\n  { 0x0298,  0x0000, 118, 126 },    /* 116: p=0.013937 (   94,    1) */\n  { 0x06ca,  0x0000,  47,  39 },    /* 117: p=0.036082 (    2,   62) */\n  { 0x01b6,  0x0000, 120, 124 },    /* 118: p=0.009216 (  143,    1) */\n  { 0x0a27,  0x0000,  41, 121 },    /* 119: p=0.053434 (    2,   41) */\n  { 0x0121,  0x0000,  66, 122 },    /* 120: p=0.006097 (  217,    1) */\n  { 0x0e57,  0x0000,  37,  31 },    /* 121: p=0.074626 (    3,   41) */\n  { 0x01f9,  0x0000,  60,  54 },    /* 122: p=0.010622 (  217,    2) */\n  { 0x0f25,  0x0000,  37,  29 },    /* 123: p=0.078651 (    2,   27) */\n  { 0x02fc,  0x0000,  56,  50 },    /* 124: p=0.016018 (  143,    2) */\n  { 0x1629,  0x0000,  33, 127 },    /* 125: p=0.112902 (    2,   18) */\n  { 0x0484,  0x0000,  52,  46 },    /* 126: p=0.024138 (   94,    2) */\n  { 0x1ee8,  0x0000,  27,  21 },    /* 127: p=0.153845 (    3,   18) */\n  { 0x06ca,  0x0000,  48,  40 },    /* 128: p=0.036082 (   62,    2) */\n  { 0x200f,  0x0000,  27,  19 },    /* 129: p=0.159089 (    2,   12) */\n  { 0x0a27,  0x0000,  42, 132 },    /* 130: p=0.053434 (   41,    2) */\n  { 0x2dae,  0x0000,  21,  15 },    /* 131: p=0.218748 (    2,    8) */\n  { 0x0e57,  0x0000,  38,  32 },    /* 132: p=0.074626 (   41,    3) */\n  { 0x4320,  0x0000,  15,   7 },    /* 133: p=0.304346 (    2,    5) */\n  { 0x11a0,  0x0000, 136, 164 },    /* 134: p=0.090907 (   13,    1) */\n  { 0x620b,  0x0000,   9,  85 },    /* 135: p=0.411764 (    2,    3) */\n  { 0x0bbe,  0x0000, 138, 162 },    /* 136: p=0.061537 (   20,    1) */\n  { 0x8000,  0x0000, 135, 248 },    /* 137: p=0.500000 (    2,    2) */\n  { 0x07f3,  0x0000, 140, 160 },    /* 138: p=0.042104 (   30,    1) */\n  { 0x294a,  0x0000, 141, 247 },    /* 139: p=0.199988 (    0,    1) */\n  { 0x053e,  0x0000, 142, 158 },    /* 140: p=0.027971 (   46,    1) */\n  { 0x0db3,  0x0000, 143, 199 },    /* 141: p=0.071422 (    0,    4) */\n  { 0x0378,  0x0000, 144, 156 },    /* 142: p=0.018604 (   70,    1) */\n  { 0x0490,  0x0000, 145, 167 },    /* 143: p=0.024388 (    0,   13) */\n  { 0x024d,  0x0000, 146, 154 },    /* 144: p=0.012384 (  106,    1) */\n  { 0x017c,  0x0000, 147, 101 },    /* 145: p=0.007999 (    0,   41) */\n  { 0x0185,  0x0000, 148, 152 },    /* 146: p=0.008197 (  161,    1) */\n  { 0x007c,  0x0000, 149, 159 },    /* 147: p=0.002611 (    0,  127) */\n  { 0x0100,  0x0000,  68, 150 },    /* 148: p=0.005405 (  245,    1) */\n  { 0x0028,  0x0000, 151, 155 },    /* 149: p=0.000849 (    0,  392) */\n  { 0x01c0,  0x0000,  62,  56 },    /* 150: p=0.009421 (  245,    2) */\n  { 0x000d,  0x0000,  81, 153 },    /* 151: p=0.000276 (    0, 1208) */\n  { 0x02a7,  0x0000,  58,  52 },    /* 152: p=0.014256 (  161,    2) */\n  { 0x0034,  0x0000,  75,  71 },    /* 153: p=0.001102 (    1, 1208) */\n  { 0x0403,  0x0000,  54,  46 },    /* 154: p=0.021472 (  106,    2) */\n  { 0x00a0,  0x0000,  69, 157 },    /* 155: p=0.003387 (    1,  392) */\n  { 0x0608,  0x0000,  48,  42 },    /* 156: p=0.032110 (   70,    2) */\n  { 0x0118,  0x0000,  65,  59 },    /* 157: p=0.005912 (    2,  392) */\n  { 0x0915,  0x0000,  44,  38 },    /* 158: p=0.047945 (   46,    2) */\n  { 0x01ed,  0x0000, 161, 165 },    /* 159: p=0.010362 (    1,  127) */\n  { 0x0db4,  0x0000,  40,  32 },    /* 160: p=0.071428 (   30,    2) */\n  { 0x0145,  0x0000,  65, 163 },    /* 161: p=0.006849 (    1,  193) */\n  { 0x1417,  0x0000,  34,  26 },    /* 162: p=0.102940 (   20,    2) */\n  { 0x0237,  0x0000,  59,  53 },    /* 163: p=0.011925 (    2,  193) */\n  { 0x1dd6,  0x0000,  30, 166 },    /* 164: p=0.148935 (   13,    2) */\n  { 0x035b,  0x0000,  55,  47 },    /* 165: p=0.017995 (    2,  127) */\n  { 0x294a,  0x0000,  24,  18 },    /* 166: p=0.199999 (   13,    3) */\n  { 0x11a0,  0x0000, 169, 195 },    /* 167: p=0.090907 (    1,   13) */\n  { 0x31a3,  0x0000, 170, 212 },    /* 168: p=0.235291 (    4,    1) */\n  { 0x0bbe,  0x0000, 171, 193 },    /* 169: p=0.061537 (    1,   20) */\n  { 0x235a,  0x0000, 172, 208 },    /* 170: p=0.173910 (    6,    1) */\n  { 0x07f3,  0x0000, 173, 191 },    /* 171: p=0.042104 (    1,   30) */\n  { 0x18b3,  0x0000, 174, 206 },    /* 172: p=0.124998 (    9,    1) */\n  { 0x053e,  0x0000, 175, 189 },    /* 173: p=0.027971 (    1,   46) */\n  { 0x1073,  0x0000, 176, 204 },    /* 174: p=0.085105 (   14,    1) */\n  { 0x0378,  0x0000, 177, 187 },    /* 175: p=0.018604 (    1,   70) */\n  { 0x0b35,  0x0000, 178, 200 },    /* 176: p=0.058822 (   21,    1) */\n  { 0x024d,  0x0000, 179, 185 },    /* 177: p=0.012384 (    1,  106) */\n  { 0x0778,  0x0000, 180, 198 },    /* 178: p=0.039603 (   32,    1) */\n  { 0x0185,  0x0000, 181, 183 },    /* 179: p=0.008197 (    1,  161) */\n  { 0x04ed,  0x0000, 182, 194 },    /* 180: p=0.026315 (   49,    1) */\n  { 0x0100,  0x0000,  67,  59 },    /* 181: p=0.005405 (    1,  245) */\n  { 0x0349,  0x0000, 184, 192 },    /* 182: p=0.017621 (   74,    1) */\n  { 0x02a7,  0x0000,  57,  51 },    /* 183: p=0.014256 (    2,  161) */\n  { 0x022e,  0x0000, 186, 190 },    /* 184: p=0.011730 (  112,    1) */\n  { 0x0403,  0x0000,  53,  45 },    /* 185: p=0.021472 (    2,  106) */\n  { 0x0171,  0x0000,  64, 188 },    /* 186: p=0.007767 (  170,    1) */\n  { 0x0608,  0x0000,  47,  41 },    /* 187: p=0.032110 (    2,   70) */\n  { 0x0283,  0x0000,  58,  52 },    /* 188: p=0.013513 (  170,    2) */\n  { 0x0915,  0x0000,  43,  37 },    /* 189: p=0.047945 (    2,   46) */\n  { 0x03cc,  0x0000,  54,  48 },    /* 190: p=0.020349 (  112,    2) */\n  { 0x0db4,  0x0000,  39,  31 },    /* 191: p=0.071428 (    2,   30) */\n  { 0x05b6,  0x0000,  50,  42 },    /* 192: p=0.030434 (   74,    2) */\n  { 0x1417,  0x0000,  33,  25 },    /* 193: p=0.102940 (    2,   20) */\n  { 0x088a,  0x0000,  44, 196 },    /* 194: p=0.045161 (   49,    2) */\n  { 0x1dd6,  0x0000,  29, 197 },    /* 195: p=0.148935 (    2,   13) */\n  { 0x0c16,  0x0000,  40,  34 },    /* 196: p=0.063291 (   49,    3) */\n  { 0x294a,  0x0000,  23,  17 },    /* 197: p=0.199999 (    3,   13) */\n  { 0x0ce2,  0x0000,  40,  32 },    /* 198: p=0.067307 (   32,    2) */\n  { 0x31a3,  0x0000, 201, 243 },    /* 199: p=0.235291 (    1,    4) */\n  { 0x1332,  0x0000,  36, 202 },    /* 200: p=0.098590 (   21,    2) */\n  { 0x235a,  0x0000, 203, 239 },    /* 201: p=0.173910 (    1,    6) */\n  { 0x1adc,  0x0000,  30,  24 },    /* 202: p=0.135134 (   21,    3) */\n  { 0x18b3,  0x0000, 205, 237 },    /* 203: p=0.124998 (    1,    9) */\n  { 0x1be7,  0x0000,  30,  22 },    /* 204: p=0.139999 (   14,    2) */\n  { 0x1073,  0x0000, 207, 235 },    /* 205: p=0.085105 (    1,   14) */\n  { 0x294a,  0x0000,  26,  16 },    /* 206: p=0.199998 (    9,    2) */\n  { 0x0b35,  0x0000, 209, 231 },    /* 207: p=0.058822 (    1,   21) */\n  { 0x3a07,  0x0000,  20, 210 },    /* 208: p=0.269229 (    6,    2) */\n  { 0x0778,  0x0000, 211, 229 },    /* 209: p=0.039603 (    1,   32) */\n  { 0x4e30,  0x0000,  14,   8 },    /* 210: p=0.344827 (    6,    3) */\n  { 0x04ed,  0x0000, 213, 225 },    /* 211: p=0.026315 (    1,   49) */\n  { 0x4fa6,  0x0000,  14, 214 },    /* 212: p=0.349998 (    4,    2) */\n  { 0x0349,  0x0000, 215, 223 },    /* 213: p=0.017621 (    1,   74) */\n  { 0x6966,  0x0000,   8,   2 },    /* 214: p=0.434782 (    4,    3) */\n  { 0x022e,  0x0000, 217, 221 },    /* 215: p=0.011730 (    1,  112) */\n  { 0x8000,  0x0000, 218,  87 },    /* 216: p=0.500000 (    1,    1) */\n  { 0x0171,  0x0000,  63, 219 },    /* 217: p=0.007767 (    1,  170) */\n  { 0x538e,  0x0000, 220, 246 },    /* 218: p=0.363634 (    2,    1) */\n  { 0x0283,  0x0000,  57,  51 },    /* 219: p=0.013513 (    2,  170) */\n  { 0x3e3e,  0x0000, 222, 244 },    /* 220: p=0.285711 (    3,    1) */\n  { 0x03cc,  0x0000,  53,  47 },    /* 221: p=0.020349 (    2,  112) */\n  { 0x294a,  0x0000, 224, 242 },    /* 222: p=0.199997 (    5,    1) */\n  { 0x05b6,  0x0000,  49,  41 },    /* 223: p=0.030434 (    2,   74) */\n  { 0x1b75,  0x0000, 226, 240 },    /* 224: p=0.137929 (    8,    1) */\n  { 0x088a,  0x0000,  43, 227 },    /* 225: p=0.045161 (    2,   49) */\n  { 0x12fc,  0x0000, 228, 238 },    /* 226: p=0.097559 (   12,    1) */\n  { 0x0c16,  0x0000,  39,  33 },    /* 227: p=0.063291 (    3,   49) */\n  { 0x0cfb,  0x0000, 230, 234 },    /* 228: p=0.067795 (   18,    1) */\n  { 0x0ce2,  0x0000,  39,  31 },    /* 229: p=0.067307 (    2,   32) */\n  { 0x08cd,  0x0000, 112, 232 },    /* 230: p=0.046511 (   27,    1) */\n  { 0x1332,  0x0000,  35, 233 },    /* 231: p=0.098590 (    2,   21) */\n  { 0x0f25,  0x0000,  38,  30 },    /* 232: p=0.078651 (   27,    2) */\n  { 0x1adc,  0x0000,  29,  23 },    /* 233: p=0.135134 (    3,   21) */\n  { 0x1629,  0x0000,  34, 236 },    /* 234: p=0.112902 (   18,    2) */\n  { 0x1be7,  0x0000,  29,  21 },    /* 235: p=0.139999 (    2,   14) */\n  { 0x1ee8,  0x0000,  28,  22 },    /* 236: p=0.153845 (   18,    3) */\n  { 0x294a,  0x0000,  25,  15 },    /* 237: p=0.199998 (    2,    9) */\n  { 0x200f,  0x0000,  28,  20 },    /* 238: p=0.159089 (   12,    2) */\n  { 0x3a07,  0x0000,  19, 241 },    /* 239: p=0.269229 (    2,    6) */\n  { 0x2dae,  0x0000,  22,  16 },    /* 240: p=0.218748 (    8,    2) */\n  { 0x4e30,  0x0000,  13,   7 },    /* 241: p=0.344827 (    3,    6) */\n  { 0x4320,  0x0000,  16,   8 },    /* 242: p=0.304346 (    5,    2) */\n  { 0x4fa6,  0x0000,  13, 245 },    /* 243: p=0.349998 (    2,    4) */\n  { 0x620b,  0x0000,  10,   2 },    /* 244: p=0.411764 (    3,    2) */\n  { 0x6966,  0x0000,   7,   1 },    /* 245: p=0.434782 (    3,    4) */\n  { 0x8000,  0x0000, 244,  83 },    /* 246: p=0.500000 (    2,    2) */\n  { 0x8000,  0x0000, 249, 250 },    /* 247: p=0.500000 (    1,    1) */\n  { 0x620b,  0x0000,  10,   2 },    /* 248: p=0.411764 (    3,    2) */\n  { 0x538e,  0x0000,  89, 137 },    /* 249: p=0.363634 (    1,    2) */\n  { 0x538e,  0x0000, 220, 246 },    /* 250: p=0.363634 (    2,    1) */\n#endif\n};\n\n\n\n////////////////////////////////////////////////////////////////\n// CONSTRUCTOR/DESTRUCTOR\n////////////////////////////////////////////////////////////////\n\nclass ZPCodec::Encode : public ZPCodec\n{\npublic:\n  Encode(GP<ByteStream> gbs, const bool djvucompat);\n  virtual ~Encode();\nprivate:\n  void init(void); \n};\n\nZPCodec::Encode::Encode(GP<ByteStream> gbs, const bool djvucompat)\n: ZPCodec(gbs,true,djvucompat)\n{\n  init();\n  // Codebit counter\n#ifdef ZPCODEC_BITCOUNT\n  bitcount = 0;\n#endif\n}\n\nZPCodec::Encode::~Encode()\n{\n  eflush();\n}\n \nclass ZPCodec::Decode : public ZPCodec\n{\npublic:\n  Decode(GP<ByteStream> gbs, const bool djvucompat);\n  virtual ~Decode();\nprivate:\n  void init(void); \n};\n\nZPCodec::Decode::Decode(GP<ByteStream> gbs, const bool djvucompat)\n: ZPCodec(gbs,false,djvucompat)\n{\n  init();\n  // Codebit counter\n#ifdef ZPCODEC_BITCOUNT\n  bitcount = 0;\n#endif\n}\n \nZPCodec::Decode::~Decode() {}\n\nZPCodec::ZPCodec(GP<ByteStream> xgbs, const bool xencoding, const bool djvucompat)\n: gbs(xgbs), bs(xgbs), encoding(xencoding), fence(0), subend(0), buffer(0), nrun(0)\n{\n  // Create machine independent ffz table\n  for (int i=0; i<256; i++)\n    {\n      ffzt[i]=0;\n      for (int j=i; j&0x80; j<<=1)\n        ffzt[i] += 1;\n    }\n  // Initialize table\n  newtable(default_ztable);\n  // Patch table table (and lose DjVu compatibility).\n  if (!djvucompat)\n    {\n      for (int j=0; j<256; j++)\n        {\n          unsigned short a = 0x10000-p[j];\n          while (a>=0x8000)  a=(unsigned short)(a<<1);\n          if (m[j]>0 && a+p[j]>=0x8000 && a>=m[j])\n            {\n              BitContext x = default_ztable[j].dn;\n              BitContext y = default_ztable[x].dn;\n              dn[j] = y;\n            }\n        }\n    }\n}\n\nZPCodec::~ZPCodec() {}\n\nGP<ZPCodec>\nZPCodec::create(GP<ByteStream> gbs, const bool encoding, const bool djvucompat)\n{\n  GP<ZPCodec> retval;\n  if(encoding)\n  {\n    retval=new ZPCodec::Encode(gbs,djvucompat);\n  }else\n  {\n    retval=new ZPCodec::Decode(gbs,djvucompat);\n  }\n  return retval;\n}\n\n////////////////////////////////////////////////////////////////\n// Z CODER DECODE ALGORITHM\n////////////////////////////////////////////////////////////////\n\n\n\nvoid \nZPCodec::Decode::init(void)\n{\n  assert(sizeof(unsigned int)==4);\n  assert(sizeof(unsigned short)==2);\n  a = 0;\n  /* Read first 16 bits of code */\n  if (! bs->read((void*)&byte, 1))\n    byte = 0xff;\n  code = (byte<<8);\n  if (! bs->read((void*)&byte, 1))\n    byte = 0xff;\n  code = code | byte;\n  /* Preload buffer */\n  delay = 25;\n  scount = 0;\n  preload();\n  /* Compute initial fence */\n  fence = code;\n  if (code >= 0x8000)\n    fence = 0x7fff;\n}\n\n\nvoid\nZPCodec::preload(void)\n{\n  while (scount<=24)\n    {\n      if (bs->read((void*)&byte, 1) < 1) \n        {\n          byte = 0xff;\n          if (--delay < 1)\n            G_THROW( ByteStream::EndOfFile );\n        }\n      buffer = (buffer<<8) | byte;\n      scount += 8;\n    }\n}\n\n\ninline int\nZPCodec::ffz(unsigned int x)\n{\n  // DO NOT DEFINE FASTBSR : \n  // Test shows that it hardly helps on a PPro,\n  // and rumors are that BSR is very slow on PPlain.\n#if defined(FASTBSR) && defined(_MSC_VER) && defined(_M_IX86)\n  int r;\n  __asm  { \n        mov  ebx, x\n        xor  ebx, 0xffff\n        mov  eax, -1\n        bsr  eax, ebx\n        mov  r, eax\n  }\n  return 15 - r;\n#elif defined(FASTBSR) && defined(__GNUC__) && defined(__i386__)\n  int r, dummy;\n  __asm__ const ( \"movl %2,%1\\n\\t\"\n                  \"xorl $0xffff, %1\\n\\t\"\n                  \"movl $-1, %0\\n\\t\"\n                  \"bsrl %1, %0\"\n                  : \"=&q\" (r), \"=q\" (dummy) : \"rm\" (x) );\n  return 15 - r;\n#else\n  return (x>=0xff00) ? (ffzt[x&0xff]+8) : (ffzt[(x>>8)&0xff]);\n#endif\n}\n\n\nint \nZPCodec::decode_sub(BitContext &ctx, unsigned int z)\n{\n  /* Save bit */\n  int bit = (ctx & 1);\n  /* Avoid interval reversion */\n#ifdef ZPCODER\n  unsigned int d = 0x6000 + ((z+a)>>2);\n  if (z > d) \n    z = d;\n#endif\n#ifdef ZCODER\n  if (z >= 0x8000)\n    z = 0x4000 + (z>>1);\n#endif\n  /* Test MPS/LPS */\n  if (z > code)\n    {\n      /* LPS branch */\n      z = 0x10000 - z;\n      a = a + z;\n      code = code + z;\n      /* LPS adaptation */\n      ctx = dn[ctx];\n      /* LPS renormalization */\n      int shift = ffz(a);\n      scount -= shift;\n      a = (unsigned short)(a<<shift);\n      code = (unsigned short)(code<<shift) | ((buffer>>scount) & ((1<<shift)-1));\n#ifdef ZPCODEC_BITCOUNT\n      bitcount += shift;\n#endif\n      if (scount<16) preload();\n      /* Adjust fence */\n      fence = code;\n      if (code >= 0x8000)\n        fence = 0x7fff;\n      return bit ^ 1;\n    }\n  else\n    {\n      /* MPS adaptation */\n      if (a >= m[ctx])\n        ctx = up[ctx];\n      /* MPS renormalization */\n      scount -= 1;\n      a = (unsigned short)(z<<1);\n      code = (unsigned short)(code<<1) | ((buffer>>scount) & 1);\n#ifdef ZPCODEC_BITCOUNT\n      bitcount += 1;\n#endif\n      if (scount<16) preload();\n      /* Adjust fence */\n      fence = code;\n      if (code >= 0x8000)\n        fence = 0x7fff;\n      return bit;\n    }\n}\n\n\nint \nZPCodec::decode_sub_simple(int mps, unsigned int z)\n{\n  /* Test MPS/LPS */\n  if (z > code)\n    {\n      /* LPS branch */\n      z = 0x10000 - z;\n      a = a + z;\n      code = code + z;\n      /* LPS renormalization */\n      int shift = ffz(a);\n      scount -= shift;\n      a = (unsigned short)(a<<shift);\n      code = (unsigned short)(code<<shift) | ((buffer>>scount) & ((1<<shift)-1));\n#ifdef ZPCODEC_BITCOUNT\n      bitcount += shift;\n#endif\n      if (scount<16) preload();\n      /* Adjust fence */\n      fence = code;\n      if (code >= 0x8000)\n        fence = 0x7fff;\n      return mps ^ 1;\n    }\n  else\n    {\n      /* MPS renormalization */\n      scount -= 1;\n      a = (unsigned short)(z<<1);\n      code = (unsigned short)(code<<1) | ((buffer>>scount) & 1);\n#ifdef ZPCODEC_BITCOUNT\n      bitcount += 1;\n#endif\n      if (scount<16) preload();\n      /* Adjust fence */\n      fence = code;\n      if (code >= 0x8000)\n        fence = 0x7fff;\n      return mps;\n    }\n}\n\n\nint  \nZPCodec::decode_sub_nolearn(int mps, unsigned int z)\n{\n#ifdef ZPCODER\n  unsigned int d = 0x6000 + ((z+a)>>2);\n  if (z > d) \n        z = d;\n#endif\n#ifdef ZCODER\n  if (z >= 0x8000)\n    z = 0x4000 + (z>>1);\n#endif\n  /* Test MPS/LPS */\n  if (z > code)\n    {\n      /* LPS branch */\n      z = 0x10000 - z;\n      a = a + z;\n      code = code + z;\n      /* LPS renormalization */\n      int shift = ffz(a);\n      scount -= shift;\n      a = (unsigned short)(a<<shift);\n      code = (unsigned short)(code<<shift) | ((buffer>>scount) & ((1<<shift)-1));\n#ifdef ZPCODEC_BITCOUNT\n      bitcount += shift;\n#endif\n      if (scount<16) preload();\n      /* Adjust fence */\n      fence = code;\n      if (code >= 0x8000)\n        fence = 0x7fff;\n      return mps ^ 1;\n    }\n  else\n    {\n      /* MPS renormalization */\n      scount -= 1;\n      a = (unsigned short)(z<<1);\n      code = (unsigned short)(code<<1) | ((buffer>>scount) & 1);\n#ifdef ZPCODEC_BITCOUNT\n      bitcount += 1;\n#endif\n      if (scount<16) preload();\n      /* Adjust fence */\n      fence = code;\n      if (code >= 0x8000)\n        fence = 0x7fff;\n      return mps;\n    }\n}\n\n\n\n\n\n////////////////////////////////////////////////////////////////\n// Z CODER ENCODE ALGORITHM\n////////////////////////////////////////////////////////////////\n\n\n\n\nvoid \nZPCodec::Encode::init(void)\n{\n  assert(sizeof(unsigned int)==4);\n  assert(sizeof(unsigned short)==2);\n  a = 0;\n  scount = 0;\n  byte = 0;\n  delay = 25;\n  subend = 0;\n  buffer = 0xffffff;\n  nrun = 0;\n}\n\nvoid\nZPCodec::outbit(int bit)\n{\n  if (delay > 0)\n    {\n      if (delay < 0xff) // delay=0xff suspends emission forever\n        delay -= 1;\n    }\n  else\n    {\n      /* Insert a bit */\n      byte = (byte<<1) | bit;\n      /* Output a byte */\n      if (++scount == 8)\n        {\n          if (!encoding)\n            G_THROW( ERR_MSG(\"ZPCodec.no_encoding\") );\n          if (bs->write((void*)&byte, 1) != 1)\n            G_THROW( ERR_MSG(\"ZPCodec.write_error\") );\n          scount = 0;\n          byte = 0;\n        }\n    }\n}\n\nvoid \nZPCodec::zemit(int b)\n{\n  /* Shift new bit into 3bytes buffer */\n  buffer = (buffer<<1) + b;\n  /* Examine bit going out of the 3bytes buffer */\n  b = (buffer >> 24);\n  buffer = (buffer & 0xffffff);\n  /* The following lines have been changed in order to emphazise the\n   * similarity between this bit counting and the scheme of Witten, Neal & Cleary\n   * (WN&C).  Corresponding changes have been made in outbit and eflush.\n   * Variable 'nrun' is similar to the 'bits_to_follow' in the W&N code.\n   */\n  switch(b)\n    {\n      /* Similar to WN&C upper renormalization */\n    case 1:\n      outbit(1);\n      while (nrun-- > 0)\n        outbit(0);\n      nrun = 0;\n      break;\n      /* Similar to WN&C lower renormalization */\n    case 0xff:\n      outbit(0);\n      while (nrun-- > 0)\n        outbit(1);\n      nrun = 0;\n      break;\n      /* Similar to WN&C central renormalization */\n    case 0:\n      nrun += 1;\n      break;\n    default:\n      assert(0);\n    }\n  /* Code bit counter */\n#ifdef ZPCODEC_BITCOUNT\n  bitcount += 1;\n#endif\n}\n\nvoid \nZPCodec::eflush()\n{\n  /* adjust subend */\n  if (subend > 0x8000)\n    subend = 0x10000;\n  else if (subend > 0)\n    subend = 0x8000;\n  /* zemit many mps bits */\n  while (buffer != 0xffffff  || subend )\n    {\n      zemit(1 - (subend>>15) );\n      subend = (unsigned short)(subend<<1);\n    }\n  /* zemit pending run */\n  outbit(1);\n  while (nrun-- > 0)\n    outbit(0);\n  nrun = 0;\n  /* zemit 1 until full byte */\n  while (scount > 0)\n    outbit(1);\n  /* prevent further emission */\n  delay = 0xff;\n}\n\nvoid \nZPCodec::encode_mps(BitContext &ctx, unsigned int z)\n{\n  /* Avoid interval reversion */\n#ifdef ZPCODER\n  unsigned int d = 0x6000 + ((z+a)>>2);\n  if (z > d) \n    z = d;\n#endif\n#ifdef ZCODER\n  if (z >= 0x8000)\n    z = 0x4000 + (z>>1);\n#endif\n  /* Adaptation */\n  if (a >= m[ctx])\n    ctx = up[ctx];\n  /* Code MPS */\n  a = z;\n  /* Export bits */\n  if (a >= 0x8000)\n    {\n      zemit(1 - (subend>>15) );\n      subend = (unsigned short)(subend<<1);\n      a = (unsigned short)(a<<1);\n    }\n}\n\n\nvoid \nZPCodec::encode_lps(BitContext &ctx, unsigned int z)\n{\n  /* Avoid interval reversion */\n#ifdef ZPCODER\n  unsigned int d = 0x6000 + ((z+a)>>2);\n  if (z > d) \n    z = d;\n#endif\n#ifdef ZCODER\n  if (z >= 0x8000)\n    z = 0x4000 + (z>>1);\n#endif\n  /* Adaptation */\n  ctx = dn[ctx];\n  /* Code LPS */\n  z = 0x10000 - z;\n  subend += z;\n  a += z;\n  /* Export bits */\n  while (a >= 0x8000)\n    {\n      zemit(1 - (subend>>15) );\n      subend = (unsigned short)(subend<<1);\n      a = (unsigned short)(a<<1);\n    }\n}\n\n\nvoid \nZPCodec::encode_mps_simple(unsigned int z)\n{\n  /* Code MPS */\n  a = z;\n  /* Export bits */\n  if (a >= 0x8000)\n    {\n      zemit(1 - (subend>>15) );\n      subend = (unsigned short)(subend<<1);\n      a = (unsigned short)(a<<1);\n    }\n}\n\nvoid \nZPCodec::encode_lps_simple(unsigned int z)\n{\n  /* Code LPS */\n  z = 0x10000 - z;\n  subend += z;\n  a += z;\n  /* Export bits */\n  while (a >= 0x8000)\n    {\n      zemit(1 - (subend>>15) );\n      subend = (unsigned short)(subend<<1);\n      a = (unsigned short)(a<<1);\n    }\n}\n\n\nvoid \nZPCodec::encode_mps_nolearn(unsigned int z)\n{\n#ifdef ZPCODER\n  unsigned int d = 0x6000 + ((z+a)>>2);\n  if (z > d) \n    z = d;\n#endif\n#ifdef ZCODER\n  if (z >= 0x8000)\n    z = 0x4000 + (z>>1);\n#endif\n  /* Code MPS */\n  a = z;\n  /* Export bits */\n  if (a >= 0x8000)\n    {\n      zemit(1 - (subend>>15) );\n      subend = (unsigned short)(subend<<1);\n      a = (unsigned short)(a<<1);\n    }\n}\n\n\nvoid \nZPCodec::encode_lps_nolearn(unsigned int z)\n{\n#ifdef ZPCODER\n  unsigned int d = 0x6000 + ((z+a)>>2);\n  if (z > d) \n    z = d;\n#endif\n#ifdef ZCODER\n  if (z >= 0x8000)\n    z = 0x4000 + (z>>1);\n#endif\n  /* Code LPS */\n  z = 0x10000 - z;\n  subend += z;\n  a += z;\n  /* Export bits */\n  while (a >= 0x8000)\n    {\n      zemit(1 - (subend>>15) );\n      subend = (unsigned short)(subend<<1);\n      a = (unsigned short)(a<<1);\n    }\n}\n\n\n\n\n\n\n////////////////////////////////////////////////////////////////\n// TABLE AND PARAMETER MANAGEMENT\n////////////////////////////////////////////////////////////////\n\n\n\n\nvoid \nZPCodec::newtable(ZPCodec::Table *table)\n{\n  for (int i=0; i<256; i++)\n    {\n      p[i]  = table[i].p;\n      m[i]  = table[i].m;\n      up[i] = table[i].up;\n      dn[i] = table[i].dn;\n    }\n}\n\nstatic float \np_to_plps(unsigned short p)\n{\n  float fplps;\n  float fp = (float)(p) / (float)(0x10000);\n  const float log2 = (float)0.69314718055994530942;\n#ifdef ZCODER\n  fplps = fp - (fp+0.5) * log(fp+0.5) + (fp-0.5)*log2;\n#endif\n#ifdef ZPCODER\n  if (fp <= (1.0/6.0) )\n    fplps = fp * 2 * log2;\n  else\n    fplps = (float)((1.5*fp-0.25) - (1.5*fp+0.25)*log(1.5*fp+0.25) + (0.5*fp-0.25)*log2);\n#endif\n  return fplps;\n}\n\n\nBitContext \nZPCodec::state(float prob1)\n{\n  // Return a state representing 'prob1' in the steady chain\n  // FixMe: This is quite slow! \n  int mps = (prob1 <= 0.5 ? 0 : 1);\n  float plps = (float)(mps ? 1.0 - prob1 : prob1);\n  // Locate steady chain (ordered, decreasing)\n  int sz = 0;\n  int lo = (mps ? 1 : 2);\n  while (p[lo+sz+sz+2] < p[lo+sz+sz]) sz+=1;\n  // Bisection\n  while (sz > 1)\n    {\n      int nsz = sz >> 1;\n      float nplps = p_to_plps( p[lo+nsz+nsz] );\n      if (nplps < plps)\n        { sz=nsz; }\n      else\n        { lo=lo+nsz+nsz; sz=sz-nsz; }\n    }\n  // Choose closest one\n  float f1 = p_to_plps(p[lo])-plps;\n  float f2 = plps-p_to_plps(p[lo+2]);\n  return (f1<f2) ? lo : lo+2;\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/ZPCodec.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _ZPCODEC_H\n#define _ZPCODEC_H\n#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n// From: Leon Bottou, 1/31/2002\n// Almost equal to my initial code.\n\n#include \"GContainer.h\"\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\nclass ByteStream;\n\n\n\n/** @name ZPCodec.h\n    \n    Files #\"ZPCodec.h\"# and #\"ZPCodec.cpp\"# implement a fast binary adaptive\n    quasi-arithmetic coder named ZP-Coder.  Because of its speed and\n    convenience, the ZP-Coder is used in several parts of the DjVu reference\n    library (See \\Ref{BSByteStream.h}, \\Ref{JB2Image.h}, \\Ref{IW44Image.h}).\n    The following comments avoid the theory (see the historical remarks for\n    useful pointers) and concentrate on the user perspective on the ZP-Coder.\n\n    {\\bf Introduction} ---\n    Encoding consists of transforming a sequence of {\\em message bits} into a\n    sequence of {\\em code bits}. Decoding consists of retrieving the message\n    bits using only the code bits.  We can make the code smaller than the\n    message as soon as we can predict a message bit on the basis of a {\\em\n    coding context} composed of previously encoded or decoded bits. If the\n    prediction is always correct, we do not even need to encode the message\n    bit. If the prediction is totally unreliable, we need to generate one code\n    bit in order to unambiguously specify the message bit.  In other words,\n    the more reliable the prediction, the more compression we get.\n\n    The ZP-Coder handles prediction by means of {\\em context variables} (see\n    \\Ref{BitContext}).  There must be a context variable for each possible\n    combination of context bits.  Both the encoder and the decoder use same\n    context variable for coding each message bit.  For instance, we can code a\n    binary image by successively coding all the pixels (the message bits) in\n    row and column order.  It is reasonable to assume that each pixel can be\n    reasonably well predicted by looking at a few (say 10) neighboring pixels\n    located above and to the left of the current pixel.  Since these 10 pixels\n    make 1024 combinations, we need 1024 context variables. Each pixel is\n    encoded using the context variable corresponding to the values of the 10\n    neighboring pixels.  Each pixel will be decoded by specifying the same\n    context variable corresponding to the values of these 10 pixels. This is\n    possible because these 10 pixels (located above and to the left) have\n    already been decoded and therefore are known by the decoder program.\n\n    The context variables are initially set to zero, which mean that we do not\n    know yet how to predict the current message bit on the basis of the\n    context bits. While coding the message bits, the ZP-Coder automatically\n    estimates the frequencies of #0#s and #1#s coded using each context\n    variable.  These frequencies actually provide a prediction (the most\n    probable bit value) and an estimation of the prediction reliability (how\n    often the prediction was correct in the past).  All this statistical\n    information is stored into the context variable after coding each bit.  In\n    other words, the more we code bits within a particular context, the better\n    the ZP-Coder adapts its prediction model, and the more compression we can\n    obtain.\n\n    All this adaptation works indeed because both the encoder program and the\n    decoder program are always synchronized. Both the encoder and the decoder\n    see the same message bits encoded (or decoded) with the same context\n    variables.  Both the encoder and the decoder apply the same rules to\n    update the context variables and improve the predictors.  Both the encoder\n    and the decoder programs use the same predictors for any given message\n    bit.  The decoder could not work if this was not the case.\n    \n    Just before encoding a message bit, all the context variables in the\n    encoder program contain certain values. Just before decoding this message\n    bit, all the context variables in the decoder program must contain the same\n    values as for the encoder program.  This is guaranteed as long as\n    each prediction only depends on already coded bits: {\\em the coding context,\n    on which the each prediction is based, must be composed of message bits which\n    have already been coded. }\n\n    {\\bf Usage} ---\n    Once you know how to organize the predictions (i.e. which coding context\n    to use, how many context variables to initialize, etc.), using the\n    ZP-Coder is straightforward (see \\Ref{ZPCodec Examples}):\n    \\begin{itemize}\n    \\item The {\\em encoder program} allocates context variables and\n    initializes them to zero. It then constructs a \\Ref{ZPCodec} object for\n    encoding. For each message bit, the encoder program retrieves the context\n    bits, selects a context variable on the basis of the context bits and\n    calls member function \\Ref{ZPCodec::encoder} with the message bit and a\n    reference to the context variable.\n    \\item The {\\em decoder program} allocates context variables and\n    initializes them to zero. It then constructs a \\Ref{ZPCodec} object for\n    decoding. For each message bit, the decoder program retrieves the context\n    bits, selects a context variable on the basis of the context bits and\n    calls member function \\Ref{ZPCodec::decoder} with a reference to the\n    context variable. This function returns the message bit.\n    \\end{itemize}\n    Functions #encoder# and #decoder# only require a few machine cycles to\n    perform two essential tasks, namely {\\em coding} and {\\em context\n    adaptation}.  Function #decoder# often returns after two arithmetic\n    operations only.  To make your program fast, you just need to feed message\n    bits and context variables fast enough.\n\n    {\\bf History} --- The ZP-Coder is similar in function and performance to\n    the seminal Q-Coder (Pennebaker, Mitchell, Langdon, Arps, IBM J. Res\n    Dev. 32, 1988). An improved version of the Q-Coder, named QM-Coder, has\n    been described in certain parts of the JPEG standard.  Unfortunate patent\n    policies have made these coders very difficult to use in general purpose\n    applications.  The Z-Coder is constructed using a new approach based on an\n    extension of the Golomb codes (Bottou, Howard, Bengio, IEEE DCC 98, 1998\n    \\URL[DjVu]{http://www.research.att.com/~leonb/DJVU/bottou-howard-bengio/}\n    \\URL[PostScript]{http://www.research.att.com/~leonb/PS/bottou-howard-bengio.ps.gz})\n    This new approach does not infringe the QM-Coder patents.  Unfortunately\n    the Z-Coder is dangerously close to the patented Arithmetic MEL Coder.\n    Therefore we wrote the ZP-Coder (pronounce Zee-Prime Coder) which we\n    believe is clear of legal problems.  Needless to say, AT&T has patents\n    pending for both the Z-Coder and the ZP-Coder, licenced to LizardTech.\n    The good news however is that we can grant a license to use the ZP-Coder\n    in ``free software'' without further complication. See the Copyright\n    for more information.\n    \n    @memo\n    Binary adaptive quasi-arithmetic coder.\n    @author\n    L\\'eon Bottou <leonb@research.att.com> */\n//@{\n\n\n/** Context variable.  \n    Variables of type #BitContext# hold a single byte describing how to encode\n    or decode message bits with similar statistical properties.  This single\n    byte simultaneously represents the current estimate of the bit probability\n    distribution (which is determined by the frequencies of #1#s and #0#s\n    already coded with this context) and the confidence in this estimate\n    (which determines how fast the estimate can change.)\n\n    A coding program typically allocates hundreds of context variables.  Each\n    coding context is initialized to zero before encoding or decoding.  Value\n    zero represents equal probabilities for #1#s and #0#s with a minimal\n    confidence and therefore a maximum adaptation speed.  Each message bit is\n    encoded using a coding context determined as a function of previously\n    encoded message bits.  The decoder therefore can examine the previously\n    decoded message bits and decode the current bit using the same context as\n    the encoder.  This is critical for proper decoding.  \n*/\ntypedef unsigned char  BitContext;\n\n\n/** Performs ZP-Coder encoding and decoding.  A ZPCodec object must either\n    constructed for encoding or for decoding.  The ZPCodec object is connected\n    with a \\Ref{ByteStream} object specified at construction time.  A ZPCodec\n    object constructed for decoding reads code bits from the ByteStream and\n    returns a message bit whenever function \\Ref{decoder} is called.  A\n    ZPCodec constructed for encoding processes the message bits provided by\n    function \\Ref{encoder} and writes the corresponding code bits to\n    ByteStream #bs#.\n\n    You should never directly access a ByteStream object connected to a valid\n    ZPCodec object. The most direct way to access the ByteStream object\n    consists of using the \"pass-thru\" versions of functions \\Ref{encoder} and\n    \\Ref{decoder}.\n\n    The ByteStream object can be accessed again after the destruction of the\n    ZPCodec object.  Note that the encoder always flushes its internal buffers\n    and writes a few final code bytes when the ZPCodec object is destroyed.\n    Note also that the decoder often reads a few bytes beyond the last code byte\n    written by the encoder.  This lag means that you must reposition the\n    ByteStream after the destruction of the ZPCodec object and before re-using\n    the ByteStream object (see \\Ref{IFFByteStream}.)\n\n    Please note also that the decoder has no way to reliably indicate the end\n    of the message bit sequence.  The content of the message must be designed\n    in a way which indicates when to stop decoding.  Simple ways to achieve\n    this consists of announcing the message length at the beginning (like a\n    pascal style string), or of defining a termination code (like a null\n    terminated string).  */\n\nclass ZPCodec : public GPEnabled {\nprotected:\n  ZPCodec (GP<ByteStream> gbs, const bool encoding, const bool djvucompat=false);\npublic:\n  class Encode;\n  class Decode;\n\n  /// Non-virtual destructor.\n  ~ZPCodec();\n  /** Constructs a ZP-Coder.  If argument #encoding# is zero, the ZP-Coder\n      object will read code bits from the ByteStream #bs# and return a message\n      bit whenever function #decoder# is called.  If flag #encoding# is set\n      the ZP-Coder object will process the message bits provided by function\n      #encoder# and write code bits to ByteStream #bs#.  Optional flag\n      #djvucompat# selects a slightly less efficient adaptation table which is\n      used by the DjVu project.  This is required in order to ensure the\n      bitstream compatibility.  You should not use this flag unless you want\n      to decode JB2, IW44 or BZZ encoded data. */\n  static GP<ZPCodec> create(\n     GP<ByteStream> gbs, const bool encoding, const bool djvucompat=false);\n\n  /** Encodes bit #bit# using context variable #ctx#.  Argument #bit# must be\n      #0# or #1#. This function should only be used with ZP-Coder objects\n      created for encoding. It may modify the contents of variable #ctx# in\n      order to perform context adaptation. */\n  void encoder(int bit, BitContext &ctx);\n\n  /** Decodes a bit using context variable #ctx#. This function should only be\n      used with ZP-Coder objects created for decoding. It may modify the\n      contents of variable #ctx# in order to perform context adaptation. */\n  int  decoder(BitContext &ctx);\n\n  /** Encodes bit #bit# without compression (pass-thru encoder).  Argument\n      #bit# must be #0# or #1#. No compression will be applied. Calling this\n      function always increases the length of the code bit sequence by one\n      bit. */\n  void encoder(int bit);\n\n  /** Decodes a bit without compression (pass-thru decoder).  This function\n      retrieves bits encoded with the pass-thru encoder. */\n  int  decoder(void);\n#ifdef ZPCODEC_BITCOUNT\n  /** Counter for code bits (requires #-DZPCODEC_BITCOUNT#). This member\n      variable is available when the ZP-Coder is compiled with option\n      #-DZPCODEC_BITCOUNT#.  Variable #bitcount# counts the number of code\n      bits processed by the coder since the construction of the object.  This\n      variable can be used to evaluate how many code bits are spent on various\n      components of the message. */\n  int bitcount;\n#endif\n  // Table management (advanced stuff)\n  struct Table { \n    unsigned short p;\n    unsigned short m;\n    BitContext     up;\n    BitContext     dn;\n  };\n  void newtable(ZPCodec::Table *table);\n  BitContext state(float prob1);\n  // Non-adaptive encoder/decoder\n  void encoder_nolearn(int pix, BitContext &ctx);\n  int  decoder_nolearn(BitContext &ctx);\n  inline int  IWdecoder(void);\n  inline void IWencoder(const bool bit);\nprotected:\n  // coder status\n  GP<ByteStream> gbs;           // Where the data goes/comes from\n  ByteStream *bs;               // Where the data goes/comes from\n  const bool encoding;          // Direction (0=decoding, 1=encoding)\n  unsigned char byte;\n  unsigned char scount;\n  unsigned char delay;\n  unsigned int  a;\n  unsigned int  code;\n  unsigned int  fence;\n  unsigned int  subend;\n  unsigned int  buffer;\n  unsigned int  nrun;\n  // table\n  unsigned int  p[256];\n  unsigned int  m[256];\n  BitContext    up[256];\n  BitContext    dn[256];\n  // machine independent ffz\n  char          ffzt[256];\n  // encoder private\n  void einit (void);\n  void eflush (void);\n  void outbit(int bit);\n  void zemit(int b);\n  void encode_mps(BitContext &ctx, unsigned int z);\n  void encode_lps(BitContext &ctx, unsigned int z);\n  void encode_mps_simple(unsigned int z);\n  void encode_lps_simple(unsigned int z);\n  void encode_mps_nolearn(unsigned int z);\n  void encode_lps_nolearn(unsigned int z);\n  // decoder private\n  void dinit(void);\n  void preload(void);\n  int  ffz(unsigned int x);\n  int  decode_sub(BitContext &ctx, unsigned int z);\n  int  decode_sub_simple(int mps, unsigned int z);\n  int  decode_sub_nolearn(int mps, unsigned int z);\nprivate:\n  // no copy allowed (hate c++)\n  ZPCodec(const ZPCodec&);\n  ZPCodec& operator=(const ZPCodec&);\n#ifdef ZPCODEC_FRIEND\n  friend ZPCODEC_FRIEND;\n#endif\n};\n\n\n\n\n\n\n// INLINE CODE\n\ninline void \nZPCodec::encoder(int bit, BitContext &ctx) \n{\n  unsigned int z = a + p[ctx];\n  if (bit != (ctx & 1))\n  {\n    encode_lps(ctx, z);\n  }else if (z >= 0x8000)\n  {\n    encode_mps(ctx, z);\n  }else\n  {\n    a = z;\n  }\n}\n\ninline int\nZPCodec::IWdecoder(void)\n{\n  return decode_sub_simple(0,0x8000 + ((a+a+a) >> 3));\n}\n\ninline int\nZPCodec::decoder(BitContext &ctx) \n{\n  unsigned int z = a + p[ctx];\n  if (z <= fence) \n    { a = z; return (ctx&1); } \n  return decode_sub(ctx, z);\n}\n\ninline void \nZPCodec::encoder_nolearn(int bit, BitContext &ctx) \n{\n  unsigned int z = a + p[ctx];\n  if (bit != (ctx & 1))\n    encode_lps_nolearn(z);\n  else if (z >= 0x8000)\n    encode_mps_nolearn(z);\n  else\n    a = z;\n}\n\ninline int\nZPCodec::decoder_nolearn(BitContext &ctx) \n{\n  unsigned int z = a + p[ctx];\n  if (z <= fence) \n    { a = z; return (ctx&1); } \n  return decode_sub_nolearn( (ctx&1), z);\n}\n\ninline void \nZPCodec::encoder(int bit)\n{\n  if (bit)\n    encode_lps_simple(0x8000 + (a>>1));\n  else\n    encode_mps_simple(0x8000 + (a>>1));\n}\n\ninline int\nZPCodec::decoder(void)\n{\n  return decode_sub_simple(0, 0x8000 + (a>>1));\n}\n\ninline void\nZPCodec::IWencoder(const bool bit)\n{\n  const int z = 0x8000 + ((a+a+a) >> 3);\n  if (bit)\n  {\n    encode_lps_simple(z);\n  }else\n  {\n    encode_mps_simple(z);\n  }\n}\n\n// ------------ ADDITIONAL DOCUMENTATION\n\n/** @name ZPCodec Examples\n    \n    Binary adaptive coders are efficient and very flexible.  Unfortunate\n    intellectual property issues however have limited their popularity.  As a\n    consequence, few programmers have a direct experience of using such a\n    coding device.  The few examples provided in this section demonstrate how\n    we think the ZP-Coder should be used.\n    \n    {\\bf Encoding Multivalued Symbols} ---\n    Since the ZP-Coder is a strictly binary coder, every message must be\n    reduced to a sequence of bits (#0#s or #1#s).  It is often convenient to\n    consider that a message is a sequence of symbols taking more than two\n    values.  For instance, a character string may be a sequence of bytes, and\n    each byte can take 256 values.  Each byte of course is composed of eight\n    bits that we can encode in sequence.  The real issue however consists of\n    deciding how we will use context variables in order to let the ZP-Coder\n    learn the probability distribution of the byte values.\n\n    The most significant bit #b0# decides whether the byte is in range 0..127\n    or in range 128..255.  We let the ZP-Coder learn how to predict this bit\n    by allocating one context variable for it.  The second most significant\n    byte #b1# has two distinct meanings depending of bit #b0#.  If bit #b0# is\n    #0#, bit #b1# decides whether the byte is in range 0..63 or 64..127.  If\n    bit #b0# is #1#, bit #b1# decides whether the byte is in range 128..191 or\n    192..255.  The prediction for bit #b1# must therefore depend on the value\n    of #b0#.  This is why we will allocate two context variables for this bit.\n    If bit #b0# is #0#, we will use the first variable; if bit #b0# is #1#, we\n    will use the second variable.  The next bit #b2# has four meanings and\n    therefore we will use four context variables, etc.  This analysis leads to\n    a total of #1+2+4+...+128# = #255# context variables for encoding one\n    byte.  This encoding procedure can be understood as a binary decision\n    tree with a dedicated context variable for predicting each decision.\n    \\begin{verbatim}\n    [>=128]----n---[>=64?]----n----[>31?]  ... \n           \\              `---y----[>95?]  ...\n            \\\n             `--y---[>=192?]----n---[>=160?] ...\n                            `---y---[>=224?] ...\n    \\end{verbatim}\n    The following decoding function illustrates a very compact way to\n    implement such a decision tree.  Argument #ctx# points to an array of 255\n    #BitContext# variables.  Macro #REPEAT8# is a shorthand notation for eight\n    repetitions of its argument.  \n    \\begin{verbatim}\n    int decode_8_bits(ZPCodec &zp, BitContext *ctx )\n    {\n      int n = 1;\n      REPEAT8( { n = (n<<1) | (zp.decoder(ctx[n-1])); } );\n      return n & 0xff;\n    }\n    \\end{verbatim}\n    The binary representation of variable #n# is always composed of a #1#\n    followed by whichever bits have been decoded so far. This extra bit #1# in\n    fact is a nice trick to flatten out the tree structure and directly\n    address the array of context variables.  Bit #b0# is decoded using the\n    first context variable since #n# is initially #1#.  Bit #b1# is decoded\n    using one of the next two variables in the array, since #n# is either #2#\n    (#10# in binary) or #3# (#11# in binary).  Bit #b2# will be decoded using\n    one of the next four variables, since #n# ranges from #4# (#100# in\n    binary) to #7# (#111# in binary).  The final result is given by removing\n    the extra #1# in variable #n#.\n\n    The corresponding encoding function is almost as compact. Argument #ctx#\n    again is an array of 255 #BitContext# variables.  Each bit of byte #x# is\n    encoded and shifted into variable #n# as in the decoding function.\n    Variable #x# in fact contains the bits to be encoded. Variable #n#\n    contains a #1# followed by the already encoded bits.\n    \\begin{verbatim}\n    void encode_8_bits(ZPCodec &zp, int x, BitContext *ctx )\n    {\n      int n = 1;\n      REPEAT8( { int b=((x&0x80)?1:0);  x=(x<<1);\n                 zp.encoder(b,ctx[n-1]);  n=(n<<1)|(b); } );\n    }\n    \\end{verbatim}\n    The ZP-Coder automatically adjusts the content of the context variables\n    while coding (recall the context variable argument is passed to functions\n    #encoder# and #decoder# by reference).  The whole array of 255 context\n    variables can be understood as a \"byte context variable\".  The estimated\n    probability of each byte value is indeed the product of the estimated\n    probabilities of the eight binary decisions that lead to that value in the\n    decision tree.  All these probabilities are adapted by the underlying\n    adaptation algorithm of the ZP-Coder.\n\n    {\\bf Application} ---\n    We consider now a simple applications consisting of encoding the\n    horizontal and vertical coordinates of a cloud of points. Each coordinate\n    requires one byte.  The following function illustrates a possible\n    implementation:\n    \\begin{verbatim}\n    void encode_points(const char *filename, int n, int *x, int *y)\n    {\n       StdioByteStream bs(filename, \"wb\");\n       bs.write32(n);             // Write number of points.\n       ZPCodec zp(bs, 1);         // Construct encoder and context vars.\n       BitContext ctxX[255], ctxY[255];\n       memset(ctxX, 0, sizeof(ctxX));\n       memset(ctxY, 0, sizeof(ctxY));\n       for (int i=0; i<n; i++) {  // Encode coordinates.\n          encode_8_bits(zp, x[i], ctxX);\n          encode_8_bits(zp, y[i], ctxY);\n       }\n    }\n    \\end{verbatim}\n    The decoding function is very similar to the encoding function:\n    \\begin{verbatim}\n    int decode_points(const char *filename, int *x, int *y)\n    {\n       StdioByteStream bs(filename,\"rb\");\n       int n = bs.read32();      // Read number of points.\n       ZPCodec zp(bs, 0);        // Construct decoder and context vars.\n       BitContext ctxX[255], ctxY[255];\n       memset(ctxX, 0, sizeof(ctxX));\n       memset(ctxY, 0, sizeof(ctxY));\n       for (int i=0; i<n; i++) { // Decode coordinates.\n         x[i] = decode_8_bits(zp, ctxX);\n         y[i] = decode_8_bits(zp, ctxY);\n       }\n       return n;                 // Return number of points.\n    }\n    \\end{verbatim}\n    The ZP-Coder automatically estimates the probability distributions of both\n    the horizontal and vertical coordinates. These estimates are used to\n    efficiently encode the point coordinates.  This particular implementation\n    is a good option if we assume that the order of the points is significant\n    and that successive points are independent.  It would be much smarter\n    otherwise to sort the points and encode relative displacements between\n    successive points.\n\n\n    {\\bf Huffman Coding Tricks} --- \n    Programmers with experience in Huffman codes can see the similarity in the\n    ZP-Coder.  Huffman codes also organize the symbol values as a decision\n    tree. The tree is balanced in such a way that each decision is as\n    unpredictable as possible (i.e. both branches must be equally probable).\n    This is very close to the ZP-Coder technique described above.  Since we\n    allocate one context variable for each decision, our tree need not be\n    balanced: the context variable will track the decision statistics and the\n    ZP-Coder will compensate optimally.\n\n    There are good reasons however to avoid unbalanced trees with the ZP-Coder.\n    Frequent symbol values may be located quite deep in a poorly balanced\n    tree.  This increases the average number of message bits (the number of\n    decisions) required to code a symbol.  The ZP-Coder will be called more\n    often, making the coding program slower.  Furthermore, each message\n    bit is encoded using an estimated distribution.  All these useless message\n    bits mean that the ZP-Coder has more distributions to adapt.  This\n    extra adaptation work will probably increase the file size.\n\n    Huffman codes are very fast when the tree structure is fixed beforehand.\n    Such {\\em static Huffman codes} are unfortunately not very efficient\n    because the tree never matches the actual data distribution.  This is why\n    such programs almost always define a data dependent tree structure.  This\n    structure must then be encoded in the file since the decoder must know it\n    before decoding the symbols.  Static Huffman codes however become very\n    efficient when decisions are encoded with the ZP-Coder.  The tree\n    structure represents a priori knowledge about the distribution of the\n    symbol values.  Small data discrepancies will be addressed transparently\n    by the ZP-Coder.\n\n\n    {\\bf Encoding Numbers} ---\n    This technique is illustrated with the following number encoding example.\n    The multivalued technique described above is not practical with large\n    numbers because the decision tree has too many nodes and requires too many\n    context variables.  This problem can be solved by using a priori knowledge\n    about the probability distribution of our numbers.\n\n    Assume for instance that the distribution is symmetrical and that small\n    numbers are much more probable than large numbers.  We will first group\n    our numbers into several sets.  Each number is coded by first coding which\n    set contains the number and then coding a position within the set.  Each\n    set contains #2^n# numbers that we consider roughly equiprobable.  Since\n    the most probable values occur much more often, we want to model their\n    probability more precisely. Therefore we use small sets for the most\n    probable values and large sets for the least probable values, as\n    demonstrated below.\n    \\begin{verbatim} \n    A---------------- {0}                                 (size=1)\n     `------B---C---- {1}            or {-1}              (size=1)\n             \\   `--- {2,3}          or {-2,-3}           (size=2)\n              D------ {4...131}      or {-4...-131}       (size=128)\n               `----- {132...32899}  or {-132...-32899}   (size=32768)\n    \\end{verbatim}\n    We then organize a decision tree for coding the set identifier.  This\n    decision tree is balanced using whatever a priori knowledge we have about\n    the probability distribution of the number values, just like a static\n    Huffman tree.  Each decision (except the sign decision) is then coded\n    using a dedicated context variable.\n    \\begin{verbatim}\n        if (! zp.decoder(ctx_A)) {             // decision A\n           return 0;\n        } else {\n           if (! zp.decoder(ctx_B)) {          // + decision B\n             if (! zp.decoder(ctx_C)) {        // ++ decision C\n               if (! zp.decoder())             // +++ sign decision\n                 return +1;\n               else\n                 return -1;\n             } else {\n               if (! zp.decoder())             // +++ sign decision\n                 return + 2 + zp.decoder();\n               else\n                 return - 2 - zp.decoder();\n             }\n           } else {\n             if (! zp.decoder(ctx_D)) {        // ++ decision D\n               if (! zp.decoder())             // +++ sign decision\n                 return + 4 + decode_7_bits(zp);\n               else\n                 return - 4 - decode_7_bits(zp);\n             } else {\n               if (! zp.decoder())             // +++ sign decision\n                 return + 132 + decode_15_bits(zp);\n               else\n                 return - 132 - decode_15_bits(zp);\n             }\n           }\n        } \n   \\end{verbatim}\n   Note that the call #zp.decoder()# for coding the sign decision does not use\n   a context variable.  This is a \"pass-thru\" variant of \\Ref{decoder} which\n   bypasses the ZP-Coder and just reads a bit from the code sequence.  There\n   is a corresponding \"pass-thru\" version of \\Ref{encoder} for encoding such\n   bits.  Similarly, functions #decode_7_bits# and #decode_15_bits# do not\n   take an array of context variables because, unlike function #decode_8_bits#\n   listed above, they are based on the pass-thru decoder instead of the\n   regular decoder.\n\n   The ZP-Coder will not learn the probabilities of the numbers within a set\n   since no context variables have been allocated for that purpose.  This\n   could be improved by allocating additional context variables for encoding\n   the position within the smaller sets and using the regular decoding\n   functions instead of the pass-thru variants.  Only experimentation can tell\n   what works best for your particular encoding problem.\n\n\n   {\\bf Understanding Adaptation} ---\n   We have so far explained that the ZP-Coder adaptation algorithm is able to\n   quickly estimate of the probability distribution of the message bits coded\n   using a particular context variable.  It is also able to track slow\n   variations when the actual probabilities change while coding.\n   \n   Let us consider the ``cloud of points'' application presented above.\n   Suppose that we first code points located towards the left side and then\n   slowly move towards points located on the right side.  The ZP-Coder will\n   first estimate that the X coordinates are rather on the left side. This\n   estimation will be progressively revised after seeing more points on the\n   right side.  Such an ordering of the points obviously violates the point\n   independence assumption on which our code is based.  Despite our inexact\n   assumptions, the tracking mechanism allows for better prediction of the X\n   coordinates and therefore better compression.\n\n   However, this is not a perfect solution. The ZP-Coder tracks the changes\n   because every point seems to be a little bit more on the right side than\n   suggested by the previous points.  The ZP-Coder coding algorithm is always\n   slightly misadjusted and we always lose a little on possible compression\n   ratio.  This is not much of a problem when the probabilities drift slowly.\n   On the other hand, this can be very significant if the probabilities change\n   drastically.\n\n   Adaptation is always associated with a small loss of efficiency.  The\n   ZP-Coder updates the probability model whenever it suspects, {\\em after\n   coding}, that the current settings were not optimal.  The model will be\n   better next time, but a slight loss in compression has occurred.  The\n   design of ZP-Coder of course minimizes this effect as much as possible.\n   Yet you will pay a price if you ask too much to the adaptation algorithm.\n   If you have millions of context variables, it will be difficult to train\n   them all.  If the probability distributions change drastically while\n   coding, it will be difficult to track the changes fast enough.\n\n   Adaptation on the other hand is a great simplification.  A good data\n   compression program must (a) represent the data in order to make its\n   predictability apparent, and (b) perform the predictions and generate the\n   code bits.  The ZP-Coder is an efficient and effortless solution for\n   implementing task (b).\n\n\n   {\\bf Practical Debugging Tricks} ---\n   Sometimes you write an encoding program and a decoding program.\n   Unfortunately there is a bug: the decoding program decodes half the file\n   and then just outputs garbage.  There is a simple way to locate the\n   problem.  In the encoding program, after each call to #encoder#, print the\n   encoded bit and the value of the context variable.  In the decoding\n   program, after each call to #decoder#, print the decoded bit and the value\n   of the context variable.  Both program should print exactly the same thing.\n   When you find the difference, you find the bug.\n   \n   @memo Suggestions for efficiently using the ZP-Coder.  */\n//@}\n\n// ------------ THE END\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n\n\n"
  },
  {
    "path": "ext/libdjvu/atomic.cpp",
    "content": "/* -*- C -*-\n// -------------------------------------------------------------------\n// MiniLock - a quick mostly user space lock \n// Copyright (c) 2008  Leon Bottou. All rights reserved\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// ------------------------------------------------------------------- */\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n\n#include <stddef.h>\n#include <stdlib.h>\n#include <assert.h>\n#include \"atomic.h\"\n#if defined(WIN32)\n# include <windows.h>\n#endif\n\n#include \"GThreads.h\"\n// #include <pthread.h>\n// #include <QMutex>\n// #include <QWaitCondition>\n\n#define OBEY_HAVE_INTEL_ATOMIC_BUILTINS 1\n\n\n/* ============================================================ \n// PART1 - THE WAITING .\n// This part must define the four macros MUTEX_ENTER,\n// MUTEX_LEAVE, COND_WAIT and COND_WAKEALL working\n// on a single monitor in a way that is consistent with\n// the pthread semantics. \n*/\n\n\n#if defined(WIN32)\n# define USE_WINDOWS_WAIT 1\n#elif defined(__cplusplus) && defined(_GTHREADS_H_)\n# define USE_GTHREAD_WAIT 1\n#elif defined(__cplusplus) && defined(QMUTEX_H)\n# define USE_QT4_WAIT 1\n#elif defined(PTHREAD_MUTEX_INITIALIZER)\n# define USE_PTHREAD_WAIT 1\n#endif\n\n\n#if USE_PTHREAD_WAIT\nstatic pthread_mutex_t ptm = PTHREAD_MUTEX_INITIALIZER;\nstatic pthread_cond_t  ptc = PTHREAD_COND_INITIALIZER;\n# define MUTEX_ENTER  pthread_mutex_lock(&ptm)\n# define MUTEX_LEAVE  pthread_mutex_unlock(&ptm)\n# define COND_WAIT    pthread_cond_wait(&ptc,&ptm)\n# define COND_WAKEALL pthread_cond_broadcast(&ptc)\n#endif\n\n\n#if USE_GTHREAD_WAIT\nstatic GMonitor m;\n# define MUTEX_ENTER  m.enter()\n# define MUTEX_LEAVE  m.leave()\n# define COND_WAIT    m.wait()\n# define COND_WAKEALL m.broadcast()\n#endif\n\n\n#if USE_QT4_WAIT\nstatic QMutex qtm;\nstatic QWaitCondition qtc;\n# define MUTEX_ENTER  qtm.lock()\n# define MUTEX_LEAVE  qtm.unlock()\n# define COND_WAIT    qtc.wait(&qtm)\n# define COND_WAKEALL qtc.wakeAll()\n#endif\n\n\n#if USE_WINDOWS_WAIT\nstatic LONG ini = 0;\nstatic CRITICAL_SECTION cs;\nstatic HANDLE ev = 0;\nstatic void mutex_enter()\n{\n  if (!InterlockedExchange(&ini, 1))\n    {\n      InitializeCriticalSection(&cs);\n      ev = CreateEvent(NULL, TRUE, FALSE, NULL);\n      assert(ev);\n    }\n  EnterCriticalSection(&cs);\n}\nstatic void cond_wait()\n{\n  ResetEvent(&ev);\n  LeaveCriticalSection(&cs);\n  WaitForSingleObject(ev, INFINITE);\n  EnterCriticalSection(&cs);\n}\n# define MUTEX_ENTER mutex_enter()\n# define MUTEX_LEAVE LeaveCriticalSection(&cs)\n# define COND_WAIT   cond_wait()\n# define COND_WAKEALL SetEvent(ev)\n#endif\n\n#if ! defined(COND_WAKEALL) || ! defined(COND_WAIT)\n# error \"Could not select suitable waiting code\"\n#endif\n\n\n/* ============================================================ \n// PART2 - ATOMIC PRIMITIVES\n// This part should define very fast SYNC_XXX and SYNC_REL\n// macros that perform atomic operations.\n// Intel builtins functions are very nice. \n// Windows interlocked functions are nice.\n// Otherwise we have to use assembly code.\n// When these are not defined we simply use\n// the monitor macros to implement \n// slow replacement functions.\n*/\n\n\n#ifndef OBEY_HAVE_INTEL_ATOMIC_BUILTINS\n# if defined(__INTEL_COMPILER)\n#  define USE_INTEL_ATOMIC_BUILTINS 1\n# elif defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__>= 1)\n#  define USE_INTEL_ATOMIC_BUILTINS 1\n# endif\n#endif\n#if HAVE_INTEL_ATOMIC_BUILTINS\n# define USE_INTEL_ATOMIC_BUILTINS 1\n#elif defined(WIN32) && !defined(USE_WIN32_INTERLOCKED)\n# define USE_WIN32_INTERLOCKED 1\n#elif defined(__GNUC__) && defined(__i386__)\n# define USE_GCC_I386_ASM 1\n#elif defined(__GNUC__) && (defined(__x86_64__) || defined(__amd64__))\n# define USE_GCC_I386_ASM 1\n#elif defined(__GNUC__) && (defined(__ppc__) || defined(__powerpc__))\n# define USE_GCC_PPC_ASM 1\n#endif\n\n\n#if USE_INTEL_ATOMIC_BUILTINS && !HAVE_SYNC\n# define SYNC_ACQ(l)     (! __sync_lock_test_and_set(l, 1))\n# define SYNC_REL(l)     (__sync_lock_release(l))\n# define SYNC_INC(l)     (__sync_add_and_fetch(l, 1))\n# define SYNC_DEC(l)     (__sync_add_and_fetch(l, -1))\n# define SYNC_CAS(l,o,n) (__sync_bool_compare_and_swap(l,o,n))\n# define HAVE_SYNC 1\n#endif\n\n\n#if USE_WIN32_INTERLOCKED && !HAVE_SYNC\n# define SYNC_ACQ(l) \\\n  (!InterlockedExchange((LONG volatile *)(l),1))\n# if defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64)\n#  define SYNC_REL(l) \\\n  (InterlockedExchange((LONG volatile *)(l),0))\n# else\n#  define SYNC_REL(l) \\\n  (*(int volatile *)(l)=0)\n# endif\n# define SYNC_INC(l) \\\n  (InterlockedIncrement((LONG volatile *)(l)))\n# define SYNC_DEC(l) \\\n  (InterlockedDecrement((LONG volatile *)(l)))\n# define SYNC_CAS(l,o,n) \\\n  (InterlockedCompareExchange((LONG volatile *)(l),n,o)==(o))\n# define HAVE_SYNC 1\n#endif\n\n\n#if USE_GCC_I386_ASM && !HAVE_SYNC\nstatic int xchgl(int volatile *atomic, int newval) \n{\n  int oldval;\n  __asm__ __volatile__ (\"xchgl %0, %1\"\n\t\t\t: \"=r\" (oldval), \"+m\" (*atomic)\n\t\t\t: \"0\" (newval), \"m\" (*atomic)); \n  return oldval; \n}\nstatic int xaddl(int volatile *atomic, int add) \n{\n  int val; /* This works for the 486 and later */\n  __asm__ __volatile__(\"lock; xaddl %0, %1\" \n                       : \"=r\" (val), \"+m\" (*atomic) \n                       : \"m\" (*atomic), \"0\" (add) );\n  return val;\n}\nstatic int cmpxchglf(int volatile *atomic, int oldval, int newval)\n{\n  int ret;\n  __asm __volatile (\"lock; cmpxchgl %2, %1\\n\"\n                    \"sete %%al; movzbl %%al,%0\"\n                    : \"=a\" (ret), \"=m\" (*atomic)\n                    : \"r\" (newval), \"m\" (*atomic), \"0\" (oldval));\n  return ret;\n}\n# define SYNC_ACQ(l)     (! xchgl(l,1))\n# define SYNC_REL(l)     (*(int volatile *)l = 0)\n# define SYNC_INC(l)     (xaddl(l, 1) + 1)\n# define SYNC_DEC(l)     (xaddl(l, -1) - 1)\n# define SYNC_CAS(l,o,n) (cmpxchglf(l,o,n))\n# define HAVE_SYNC 1\n#endif\n\n\n#if USE_GCC_PPC_ASM && !HAVE_SYNC\nstatic int xchg_acq(int volatile *atomic, int newval) \n{\n  int oldval;\n  __asm __volatile (\"1: lwarx   %0,0,%2\\n\"\n                    \"   stwcx.  %3,0,%2\\n\"\n                    \"   bne-    1b\\n\"\n                    \"   isync\"\n                    : \"=&r\" (oldval), \"+m\" (*atomic)\n                    : \"b\" (atomic), \"r\" (newval), \"m\" (*atomic)\n                    : \"cr0\", \"memory\");\n  return oldval;\n}\nstatic void st_rel(int volatile *atomic, int newval)\n{\n  __asm __volatile (\"sync\" ::: \"memory\");\n  *atomic = newval;\n}\nstatic int addlx(int volatile *atomic, int add) \n{\n  int val;\n  __asm __volatile (\"1: lwarx  %0,0,%2\\n\"\n                    \"   add    %0,%0,%3\\n\"\n                    \"   stwcx. %0,0,%2\\n\"\n                    \"   bne-   1b\"\n                    : \"=&b\" (val), \"+m\" (*atomic)  \n                    : \"b\" (atomic), \"r\" (add), \"m\" (*atomic)           \n                    : \"cr0\", \"memory\");\n  return val;\n}\nstatic int cmpxchgl(int volatile *atomic, int oldval, int newval)\n{\n  int ret;\n  __asm __volatile (\"   sync\\n\"\n                    \"1: lwarx  %0,0,%1\\n\"\n                    \"   cmpw   %0,%2\\n\"\n                    \"   bne    2f\\n\"\n                    \"   stwcx. %3,0,%1\\n\"\n                    \"   bne-   1b\\n\"\n                    \"2: isync\"\n                    : \"=&r\" (ret)\n                    : \"b\" (atomic), \"r\" (oldval), \"r\" (newval)\n                    : \"cr0\", \"memory\");\n  return ret;\n}\n# define SYNC_ACQ(l)     (!xchg_acq(l,1))\n# define SYNC_REL(l)     (st_rel(l,0))\n# define SYNC_INC(l)     (addlx(l, 1))\n# define SYNC_DEC(l)     (addlx(l, -1))\n# define SYNC_CAS(l,o,n) (cmpxchgl(l,o,n)==o)\n# define HAVE_SYNC 1\n#endif\n\n\n/* ============================================================ \n// PART3 - THE IMPLEMENTATION\n*/\n\n#if HAVE_SYNC\n\n/* We have fast synchronization */\n\nint volatile nwaiters = 0;\nint volatile dummy;\n\nint \natomicAcquire(int volatile *lock)\n{\n  return SYNC_ACQ(lock);\n}\n    \nvoid \natomicAcquireOrSpin(int volatile *lock)\n{\n  int spin = 16;\n  while (spin >= 0 && ! SYNC_ACQ(lock))\n    spin -= 1;\n  if (spin < 0)\n    {\n      MUTEX_ENTER;\n      nwaiters += 1;\n      while (! SYNC_ACQ(lock))\n        COND_WAIT;\n      nwaiters -= 1;\n      MUTEX_LEAVE;\n    }\n}\n\nvoid \natomicRelease(int volatile *lock)\n{\n  SYNC_REL(lock);\n  if (nwaiters > 0)\n    {\n      MUTEX_ENTER;\n      if (nwaiters > 0)\n        COND_WAKEALL;\n      MUTEX_LEAVE;\n    }\n}\n\nint\natomicIncrement(int volatile *var)\n{\n  return SYNC_INC(var);\n}\n\nint \natomicDecrement(int volatile *var)\n{\n  return SYNC_DEC(var);\n}\n\nint \natomicCompareAndSwap(int volatile *var, int oldval, int newval)\n{\n  return SYNC_CAS(var,oldval,newval);\n}\n\n\n\n#else\n\nint \natomicAcquire(int volatile *lock)\n{\n  int tmp;\n  MUTEX_ENTER;\n  if ((tmp = !*lock))\n    *lock = 1;\n  MUTEX_LEAVE;\n  return tmp;\n}\n\nvoid \natomicAcquireOrSpin(int volatile *lock)\n{\n  MUTEX_ENTER;\n  while (*lock)\n    COND_WAIT;\n  *lock = 1;\n  MUTEX_LEAVE;\n}\n\nvoid \natomicRelease(int volatile *lock)\n{\n  MUTEX_ENTER;\n  *lock = 0;\n  COND_WAKEALL;\n  MUTEX_LEAVE;\n}\n\nint\natomicIncrement(int volatile *var)\n{\n  int res;\n  MUTEX_ENTER;\n  res = ++(*var);\n  MUTEX_LEAVE;\n  return res;\n}\n\nint \natomicDecrement(int volatile *var)\n{\n  int res;\n  MUTEX_ENTER;\n  res = --(*var);\n  MUTEX_LEAVE;\n  return res;\n}\n\nint \natomicCompareAndSwap(int volatile *var, int oldval, int newval)\n{\n  int ret;\n  MUTEX_ENTER;\n  ret = *var;\n  if (ret == oldval)\n    *var = newval;\n  MUTEX_LEAVE;\n  return (ret == oldval);\n}\n\n#endif  /* HAVE_SYNC */\n\n\n"
  },
  {
    "path": "ext/libdjvu/atomic.h",
    "content": "/* -*- C -*-\n// -------------------------------------------------------------------\n// MiniLock - a quick user space lock \n// Copyright (c) 2008  Leon Bottou. All rights reserved\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// ------------------------------------------------------------------- */\n\n#ifndef ATOMIC_H\n#define ATOMIC_H\n\n/* ------------------------------------------------------------\n//  These are primitives to implement very quick locks.\n//  \n//  Non-blocking usage:\n//    if (atomicAcquire(&lock)) {\n//      ... // do something protected by the lock\n//      atomicRelease(&lock);\n//    }\n//\n//  Blocking usage:\n//    atomicAcquireOrSpin(&lock);\n//    // do something protected by the lock\n//    atomicRelease(&lock);\n//\n//  Rules of thumb:\n//  - Acquire and release from the same function with \n//    no intervening function calls.\n//  - Do not use AcquireOrSpin for waiting a long time.\n//    No more than a few microseconds please.\n//\n//  Memory ordering:\n//  Viewed from another processor\n//  - load/stores performed by this cpu after the acquire \n//    cannot appear to have happened before the acquire.\n//  - load/stores performed by this cpu before the release \n//    cannot appear to have happened after the release.\n//\n//  Implementation:\n//  All depends on the definitions from the initial include file.\n//  To perform the non blocking operations:\n//  - use intel builtins if available (icc, gcc>=4.1).\n//  - use win32 interlocked operations (win32).\n//  - use inline assembly code for some platforms.\n//  - use pthreads\n//  To perform the waiting when spinning takes to long:\n//  - use win32 critical sections and events.\n//  - use pthreads mutex and conditions.\n//  This is controlled by the preprocessor symbols:\n//    WIN32 \n//    __GNUC__ __GNUC_MAJOR__ __GNUC_MINOR__  \n//    __INTEL_COMPILER\n//  and can be overriden by defining\n//    HAVE_INTEL_ATOMIC_BUILTINS\n//    OBEY_HAVE_INTEL_ATOMIC_BUILTINS\n//  and by tweaking the files include in atomic.h.\n// ------------------------------------------------------------ */\n\n\n# ifdef __cplusplus\nextern \"C\" {\n#endif\n  \n/* { int tmp = *lock; *lock = 1; return !tmp; }. */\nint atomicAcquire(int volatile *lock);\n  \n/* { while (!atomicAcquire(lock)) { spin/yield/wait } } */\nvoid atomicAcquireOrSpin(int volatile *lock);\n\n/* { *lock = 0; } */\nvoid atomicRelease(int volatile *lock);\n\n/* { *var += 1; return *var; } */\nint atomicIncrement(int volatile *var);\n\n/* { *var -= 1; return *var; } */\nint atomicDecrement(int volatile *var);\n\n/* { if (*var == oldval) { *var = newval; return TRUE; } return FALSE; } */\nint atomicCompareAndSwap(int volatile *var, int oldval, int newval);\n\n\n# ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "ext/libdjvu/ddjvuapi.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation \"ddjvuapi.h\"\n#endif\n\n#include <stddef.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include <ctype.h>\n#include <locale.h>\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n  struct ddjvu_context_s;\n  struct ddjvu_job_s;\n  struct ddjvu_document_s;\n  struct ddjvu_page_s;\n  struct ddjvu_format_s;\n  struct ddjvu_message_p;\n  struct ddjvu_thumbnail_p;\n  struct ddjvu_runnablejob_s;\n  struct ddjvu_printjob_s;\n  struct ddjvu_savejob_s;\n}\nusing namespace DJVU;\n# define DJVUNS DJVU::\n#else\n# define DJVUNS /**/\n#endif\n\n#include \"GException.h\"\n#include \"GSmartPointer.h\"\n#include \"GThreads.h\"\n#include \"GContainer.h\"\n#include \"ByteStream.h\"\n#include \"IFFByteStream.h\"\n#include \"BSByteStream.h\"\n#include \"GString.h\"\n#include \"GBitmap.h\"\n#include \"GPixmap.h\"\n#include \"GScaler.h\"\n#include \"DjVuPort.h\"\n#include \"DataPool.h\"\n#include \"DjVuInfo.h\"\n#include \"IW44Image.h\"\n#include \"DjVuImage.h\"\n#include \"DjVuFileCache.h\"\n#include \"DjVuDocument.h\"\n#include \"DjVuDumpHelper.h\"\n#include \"DjVuMessageLite.h\"\n#include \"DjVuMessage.h\"\n#include \"DjVmNav.h\"\n#include \"DjVuText.h\"\n#include \"DjVuAnno.h\"\n#include \"DjVuToPS.h\"\n#include \"DjVmDir.h\"\n#include \"DjVmDir0.h\"\n#include \"DjVuNavDir.h\"\n#include \"DjVmDoc.h\"\n\n\n#include \"miniexp.h\"\n#include \"ddjvuapi.h\"\n\n\n// ----------------------------------------\n// Private structures\n\n\nstruct DJVUNS ddjvu_message_p : public GPEnabled\n{\n  GNativeString tmp1;\n  GNativeString tmp2;\n  ddjvu_message_t p;\n  ddjvu_message_p() { memset(&p, 0, sizeof(p)); }\n};\n\nstruct DJVUNS ddjvu_thumbnail_p : public GPEnabled\n{\n  ddjvu_document_t *document;\n  int pagenum;\n  GTArray<char> data;\n  GP<DataPool> pool;\n  static void callback(void *);\n}; \n\n\n// ----------------------------------------\n// Context, Jobs, Document, Pages\n\n\nstruct DJVUNS ddjvu_context_s : public GPEnabled\n{\n  GMonitor monitor;\n  GP<DjVuFileCache> cache;\n  GPList<ddjvu_message_p> mlist;\n  GP<ddjvu_message_p> mpeeked;\n  int uniqueid;\n  ddjvu_message_callback_t callbackfun;\n  void *callbackarg;\n};\n\nstruct DJVUNS ddjvu_job_s : public DjVuPort\n{\n  GMonitor monitor;\n  void *userdata;\n  GP<ddjvu_context_s> myctx;\n  GP<ddjvu_document_s> mydoc;\n  bool released;\n  ddjvu_job_s();\n  // virtual port functions:\n  virtual bool inherits(const GUTF8String&);\n  virtual bool notify_error(const DjVuPort*, const GUTF8String&);  \n  virtual bool notify_status(const DjVuPort*, const GUTF8String&);\n  // default implementation of virtual job functions:\n  virtual ddjvu_status_t status() {return DDJVU_JOB_NOTSTARTED;}\n  virtual void release() {}\n  virtual void stop() {}\n};\n\nstruct DJVUNS ddjvu_document_s : public ddjvu_job_s\n{\n  GP<DjVuDocument> doc;\n  GPMap<int,DataPool> streams;\n  GMap<GUTF8String, int> names;\n  GPMap<int,ddjvu_thumbnail_p> thumbnails;\n  int streamid;\n  bool fileflag;\n  bool urlflag;\n  bool docinfoflag;\n  bool pageinfoflag;\n  minivar_t protect;\n  // virtual job functions:\n  virtual ddjvu_status_t status();\n  virtual void release();\n  // virtual port functions:\n  virtual bool inherits(const GUTF8String&);\n  virtual bool notify_error(const DjVuPort*, const GUTF8String&);  \n  virtual bool notify_status(const DjVuPort*, const GUTF8String&);\n  virtual void notify_doc_flags_changed(const DjVuDocument*, long, long);\n  virtual GP<DataPool> request_data(const DjVuPort*, const GURL&);\n  static void callback(void *);\n  bool want_pageinfo(void);\n};\n\nstruct DJVUNS ddjvu_page_s : public ddjvu_job_s\n{\n  GP<DjVuImage> img;\n  ddjvu_job_t *job;\n  bool pageinfoflag;            // was the first m_pageinfo sent?\n  bool pagedoneflag;            // was the final m_pageinfo sent?\n  // virtual job functions:\n  virtual ddjvu_status_t status();\n  virtual void release();\n  // virtual port functions:\n  virtual bool inherits(const GUTF8String&);\n  virtual bool notify_error(const DjVuPort*, const GUTF8String&);  \n  virtual bool notify_status(const DjVuPort*, const GUTF8String&);\n  virtual void notify_file_flags_changed(const DjVuFile*, long, long);\n  virtual void notify_relayout(const class DjVuImage*);\n  virtual void notify_redisplay(const class DjVuImage*);\n  virtual void notify_chunk_done(const DjVuPort*, const GUTF8String &);\n  void sendmessages();\n};\n\n\n// ----------------------------------------\n// Helpers\n\n\n// Hack to increment counter\nstatic void \nref(GPEnabled *p)\n{\n  GPBase n(p);\n  char *gn = (char*)&n;\n  *(GPEnabled**)gn = 0;\n  n.assign(0);\n}\n\n// Hack to decrement counter\nstatic void \nunref(GPEnabled *p)\n{\n  GPBase n;\n  char *gn = (char*)&n;\n  *(GPEnabled**)gn = p;\n  n.assign(0);\n}\n\n// Allocate strings\nstatic char *\nxstr(const char *s)\n{\n  int l = strlen(s);\n  char *p = (char*)malloc(l + 1);\n  if (p) \n    {\n      strcpy(p, s);\n      p[l] = 0;\n    }\n  return p;\n}\n\n// Allocate strings\nstatic char *\nxstr(const GNativeString &n)\n{\n  return xstr( (const char*) n );\n}\n\n// Allocate strings\nstatic char *\nxstr(const GUTF8String &u)\n{\n  GNativeString n(u);\n  return xstr( n );\n}\n\n// Fill a message head\nstatic ddjvu_message_any_t \nxhead(ddjvu_message_tag_t tag,\n      ddjvu_context_t *context)\n{\n  ddjvu_message_any_t any;\n  any.tag = tag;\n  any.context = context;\n  any.document = 0;\n  any.page = 0;\n  any.job = 0;\n  return any;\n}\nstatic ddjvu_message_any_t \nxhead(ddjvu_message_tag_t tag,\n      ddjvu_job_t *job)\n{\n  ddjvu_message_any_t any;\n  any.tag = tag;\n  any.context = job->myctx;\n  any.document = job->mydoc;\n  any.page = 0;\n  any.job = job;\n  return any;\n}\nstatic ddjvu_message_any_t \nxhead(ddjvu_message_tag_t tag,\n      ddjvu_document_t *document)\n{\n  ddjvu_message_any_t any;\n  any.tag = tag;\n  any.context = document->myctx;\n  any.document = document;\n  any.page = 0;\n  any.job = document;\n  return any;\n}\nstatic ddjvu_message_any_t \nxhead(ddjvu_message_tag_t tag,\n      ddjvu_page_t *page)\n{\n  ddjvu_message_any_t any;\n  any.tag = tag;\n  any.context = page->myctx;\n  any.document = page->mydoc;\n  any.page = page;\n  any.job = page->job;\n  return any;\n}\n\n\n// ----------------------------------------\n// Version\n\nconst char*\nddjvu_get_version_string(void)\n{\n#ifdef DJVULIBRE_VERSION\n  return \"DjVuLibre-\" DJVULIBRE_VERSION;\n#else\n  return \"DjVuLibre\";\n#endif\n}\n\nint\nddjvu_code_get_version(void)\n{\n  return DJVUVERSION;\n}\n\n\n\n\n// ----------------------------------------\n// Context\n\n\nddjvu_context_t *\nddjvu_context_create(const char *programname)\n{\n  ddjvu_context_t *ctx = 0;\n  G_TRY\n    {\n#ifdef LC_ALL\n      setlocale(LC_ALL,\"\");\n# ifdef LC_NUMERIC\n      setlocale(LC_NUMERIC, \"C\");\n# endif\n#endif\n      if (programname)\n        djvu_programname(programname);\n      DjVuMessage::use_language();\n      DjVuMessageLite::create();\n      ctx = new ddjvu_context_s;\n      ref(ctx);\n      ctx->uniqueid = 0;\n      ctx->callbackfun = 0;\n      ctx->callbackarg = 0;\n      ctx->cache = DjVuFileCache::create();\n    }\n  G_CATCH_ALL\n    {\n      if (ctx)\n        unref(ctx);\n      ctx = 0;\n    }\n  G_ENDCATCH;\n  return ctx;\n}\n\nvoid \nddjvu_context_release(ddjvu_context_t *ctx)\n{\n  G_TRY\n    {\n      if (ctx)\n        unref(ctx);\n    }\n  G_CATCH_ALL\n    {\n    }\n  G_ENDCATCH;\n}\n\n\n// ----------------------------------------\n// Message helpers\n\n\n// post a new message\nstatic void\nmsg_push(const ddjvu_message_any_t &head,\n         GP<ddjvu_message_p> msg = 0)\n{\n  ddjvu_context_t *ctx = head.context;\n  if (! msg) \n    msg = new ddjvu_message_p;\n  msg->p.m_any = head; \n  GMonitorLock lock(&ctx->monitor);\n  if ((head.document && head.document->released) ||\n      (head.page && head.page->released) ||\n      (head.job && head.job->released) )\n    return;\n  if (ctx->callbackfun) \n    (*ctx->callbackfun)(ctx, ctx->callbackarg);\n  ctx->mlist.append(msg);\n  ctx->monitor.broadcast();\n}\n\nstatic void\nmsg_push_nothrow(const ddjvu_message_any_t &head,\n                 GP<ddjvu_message_p> msg = 0)\n{\n  G_TRY\n    {\n      msg_push(head, msg);\n    }\n  G_CATCH_ALL\n    {\n    }\n  G_ENDCATCH;\n}\n\n// prepare error message from string\nstatic GP<ddjvu_message_p>\nmsg_prep_error(GUTF8String message,\n               const char *function=0, \n               const char *filename=0, \n               int lineno=0)\n{\n  GP<ddjvu_message_p> p = new ddjvu_message_p;\n  p->p.m_error.message = 0;\n  p->p.m_error.function = function;\n  p->p.m_error.filename = filename;\n  p->p.m_error.lineno = lineno;\n  G_TRY \n    { \n      p->tmp1 = DjVuMessageLite::LookUpUTF8(message);\n      p->p.m_error.message = (const char*)(p->tmp1);\n    }\n  G_CATCH_ALL \n    {\n    } \n  G_ENDCATCH;\n  return p;\n}\n\n// prepare error message from exception\nstatic GP<ddjvu_message_p>\nmsg_prep_error(const GException &ex,\n               const char *function=0, \n               const char *filename=0, \n               int lineno=0)\n{\n  GP<ddjvu_message_p> p = new ddjvu_message_p;\n  p->p.m_error.message = 0;\n  p->p.m_error.function = function;\n  p->p.m_error.filename = filename;\n  p->p.m_error.lineno = lineno;\n  G_TRY \n    { \n      p->tmp1 = DjVuMessageLite::LookUpUTF8(ex.get_cause());\n      p->p.m_error.message = (const char*)(p->tmp1);\n      p->p.m_error.function = ex.get_function();\n      p->p.m_error.filename = ex.get_file();\n      p->p.m_error.lineno = ex.get_line();\n    }\n  G_CATCH_ALL \n    {\n    } \n  G_ENDCATCH;\n  return p;\n}\n\n// prepare status message\nstatic GP<ddjvu_message_p>\nmsg_prep_info(GUTF8String message)\n{\n  GP<ddjvu_message_p> p = new ddjvu_message_p;\n  p->tmp1 = DjVuMessageLite::LookUpUTF8(message); // i18n nonsense!\n  p->p.m_info.message = (const char*)(p->tmp1);\n  return p;\n}\n\n// ----------------------------------------\n\n\n#ifdef __GNUG__\n# define ERROR1(x, m) \\\n    msg_push_nothrow(xhead(DDJVU_ERROR,x),\\\n                     msg_prep_error(m,__func__,__FILE__,__LINE__))\n#else\n# define ERROR1(x, m) \\\n    msg_push_nothrow(xhead(DDJVU_ERROR,x),\\\n                     msg_prep_error(m,0,__FILE__,__LINE__))\n#endif\n\n\n// ----------------------------------------\n// Cache\n\nvoid\nddjvu_cache_set_size(ddjvu_context_t *ctx,\n                     unsigned long cachesize)\n{\n  G_TRY\n    {\n      GMonitorLock lock(&ctx->monitor);\n      if (ctx->cache && cachesize>0)\n        ctx->cache->set_max_size(cachesize);\n    }\n  G_CATCH(ex) \n    {\n      ERROR1(ctx, ex);\n    }\n  G_ENDCATCH;\n}\n\nDDJVUAPI unsigned long\nddjvu_cache_get_size(ddjvu_context_t *ctx)\n{\n  G_TRY\n    {\n      GMonitorLock lock(&ctx->monitor);\n      if (ctx->cache)\n        return ctx->cache->get_max_size();\n    }\n  G_CATCH(ex) \n    { \n      ERROR1(ctx, ex);\n    }\n  G_ENDCATCH;\n  return 0;\n}\n\nvoid\nddjvu_cache_clear(ddjvu_context_t *ctx)\n{\n  G_TRY\n    {\n      GMonitorLock lock(&ctx->monitor);\n      DataPool::close_all();\n      if (ctx->cache)\n      {\n        ctx->cache->clear();\n        return;\n      }\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(ctx, ex);\n    }\n  G_ENDCATCH;\n }\n\n\n// ----------------------------------------\n// Jobs\n\nddjvu_job_s::ddjvu_job_s()\n  : userdata(0), released(false)\n{\n}\n\nbool\nddjvu_job_s::inherits(const GUTF8String &classname)\n{\n  return (classname == \"ddjvu_job_s\") \n    || DjVuPort::inherits(classname);\n}\n\nbool \nddjvu_job_s::notify_error(const DjVuPort *, const GUTF8String &m)\n{\n  msg_push(xhead(DDJVU_ERROR, this), msg_prep_error(m));\n  return true;\n}\n\nbool \nddjvu_job_s::notify_status(const DjVuPort *p, const GUTF8String &m)\n{\n  msg_push(xhead(DDJVU_INFO, this), msg_prep_info(m));\n  return true;\n}\n\nvoid\nddjvu_job_release(ddjvu_job_t *job)\n{\n  G_TRY\n    {\n      if (!job)\n        return;\n      job->release();\n      job->userdata = 0;\n      job->released = true;\n      // clean all messages\n      ddjvu_context_t *ctx = job->myctx;\n      if (ctx)\n        {\n          GMonitorLock lock(&ctx->monitor);\n          GPosition p = ctx->mlist;\n          while (p) \n            {\n              GPosition s = p; ++p;\n              if (ctx->mlist[s]->p.m_any.job == job ||\n                  ctx->mlist[s]->p.m_any.document == job ||\n                  ctx->mlist[s]->p.m_any.page == job )\n                ctx->mlist.del(s);\n            }\n          // cleanup pointers in current message as well.\n          if (ctx->mpeeked)\n            {\n              ddjvu_message_t *m = &ctx->mpeeked->p;\n              if (m->m_any.job == job)       \n                m->m_any.job = 0;\n              if (m->m_any.document == job)\n                m->m_any.document = 0;\n              if (m->m_any.page == job)\n                m->m_any.page = 0;\n            }\n        }\n      // decrement reference counter\n      unref(job);\n    }\n  G_CATCH_ALL\n    {\n    }\n  G_ENDCATCH;\n}\n\nddjvu_status_t\nddjvu_job_status(ddjvu_job_t *job)\n{\n  G_TRY\n    {\n      if (! job)\n        return DDJVU_JOB_NOTSTARTED;\n      return job->status();\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(job, ex);\n    }\n  G_ENDCATCH;\n  return DDJVU_JOB_FAILED;\n}\n\nvoid\nddjvu_job_stop(ddjvu_job_t *job)\n{\n  G_TRY\n    {\n      if (job)\n        job->stop();\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(job, ex);\n    }\n  G_ENDCATCH;\n}\n\nvoid\nddjvu_job_set_user_data(ddjvu_job_t *job, void *userdata)\n{\n  if (job)\n    job->userdata = userdata;\n}\n\nvoid *\nddjvu_job_get_user_data(ddjvu_job_t *job)\n{\n  if (job)\n    return job->userdata;\n  return 0;\n}\n\n\n// ----------------------------------------\n// Message queue\n\n\nddjvu_message_t *\nddjvu_message_peek(ddjvu_context_t *ctx)\n{\n  G_TRY\n    {\n      GMonitorLock lock(&ctx->monitor);\n      if (ctx->mpeeked)\n        return &ctx->mpeeked->p;        \n      if (! ctx->mlist.size())\n        ctx->monitor.wait(0);\n      GPosition p = ctx->mlist;\n      if (! p)\n        return 0;\n      ctx->mpeeked = ctx->mlist[p];\n      ctx->mlist.del(p);\n      return &ctx->mpeeked->p;\n    }\n  G_CATCH_ALL\n    {\n    }\n  G_ENDCATCH;\n  return 0;\n}\n\nddjvu_message_t *\nddjvu_message_wait(ddjvu_context_t *ctx)\n{\n  G_TRY\n    {\n      GMonitorLock lock(&ctx->monitor);\n      if (ctx->mpeeked)\n        return &ctx->mpeeked->p;        \n      while (! ctx->mlist.size())\n        ctx->monitor.wait();\n      GPosition p = ctx->mlist;\n      if (! p)\n        return 0;\n      ctx->mpeeked = ctx->mlist[p];\n      ctx->mlist.del(p);\n      return &ctx->mpeeked->p;        \n    }\n  G_CATCH_ALL\n    {\n    }\n  G_ENDCATCH;\n  return 0;\n}\n\nvoid\nddjvu_message_pop(ddjvu_context_t *ctx)\n{\n  G_TRY\n    {\n      GMonitorLock lock(&ctx->monitor);\n      ctx->mpeeked = 0;\n    }\n  G_CATCH_ALL\n    {\n    }\n  G_ENDCATCH;\n}\n\nvoid\nddjvu_message_set_callback(ddjvu_context_t *ctx,\n                           ddjvu_message_callback_t callback,\n                           void *closure)\n{\n  GMonitorLock lock(&ctx->monitor);\n  ctx->callbackfun = callback;\n  ctx->callbackarg = closure;\n}\n\n\n// ----------------------------------------\n// Document callbacks\n\n\nvoid\nddjvu_document_s::release()\n{\n  GPosition p;\n  GMonitorLock lock(&monitor);\n  doc = 0;\n  for (p=thumbnails; p; ++p)\n    {\n      ddjvu_thumbnail_p *thumb = thumbnails[p];\n      if (thumb->pool)\n        thumb->pool->del_trigger(ddjvu_thumbnail_p::callback, (void*)thumb);\n    }\n  for (p = streams; p; ++p)\n    {\n      GP<DataPool> pool = streams[p];\n      if (pool)\n        pool->del_trigger(callback, (void*)this);\n      if (pool && !pool->is_eof())\n        pool->stop();\n    }\n}\n\nddjvu_status_t\nddjvu_document_s::status()\n{\n  if (!doc)\n    return DDJVU_JOB_NOTSTARTED;\n  long flags = doc->get_doc_flags();\n  if (flags & DjVuDocument::DOC_INIT_OK)\n    return DDJVU_JOB_OK;\n  else if (flags & DjVuDocument::DOC_INIT_FAILED)\n    return DDJVU_JOB_FAILED;\n  return DDJVU_JOB_STARTED;\n}\n\nbool\nddjvu_document_s::inherits(const GUTF8String &classname)\n{\n  return (classname == \"ddjvu_document_s\")\n    || ddjvu_job_s::inherits(classname);\n}\n\nbool \nddjvu_document_s::notify_error(const DjVuPort *, const GUTF8String &m)\n{\n  if (!doc) return false;\n  msg_push(xhead(DDJVU_ERROR, this), msg_prep_error(m));\n  return true;\n}\n \nbool \nddjvu_document_s::notify_status(const DjVuPort *p, const GUTF8String &m)\n{\n  if (!doc) return false;\n  msg_push(xhead(DDJVU_INFO, this), msg_prep_info(m));\n  return true;\n}\n\nvoid \nddjvu_document_s::notify_doc_flags_changed(const DjVuDocument *, long, long)\n{\n  GMonitorLock lock(&monitor);\n  if (docinfoflag || !doc) return;\n  long flags = doc->get_doc_flags();\n  if ((flags & DjVuDocument::DOC_INIT_OK) ||\n      (flags & DjVuDocument::DOC_INIT_FAILED) )\n  {\n    msg_push(xhead(DDJVU_DOCINFO, this));\n    docinfoflag = true;\n  }\n}\n\n\nvoid \nddjvu_document_s::callback(void *arg)\n{\n  ddjvu_document_t *doc = (ddjvu_document_t *)arg;\n  if (doc && doc->pageinfoflag && !doc->fileflag) \n    msg_push(xhead(DDJVU_PAGEINFO, doc));\n}\n\n\nGP<DataPool> \nddjvu_document_s::request_data(const DjVuPort *p, const GURL &url)\n{\n  // Note: the following line try to restore\n  //       the bytes stored in the djvu file\n  //       despite LT's i18n and gurl classes.\n  GUTF8String name = (const char*)url.fname(); \n  GMonitorLock lock(&monitor);\n  GP<DataPool> pool;\n  if (names.contains(name))\n    {\n      int streamid = names[name];\n      return streams[streamid];\n    }\n  else if (fileflag)\n    {\n      if (doc && url.is_local_file_url())\n        return DataPool::create(url);\n    }\n  else if (doc)\n    {\n      // prepare pool\n      if (++streamid > 0)\n        streams[streamid] = pool = DataPool::create();\n      else\n        pool = streams[(streamid = 0)];\n      names[name] = streamid;\n      pool->add_trigger(-1, callback, (void*)this);\n      // build message\n      GP<ddjvu_message_p> p = new ddjvu_message_p;\n      p->p.m_newstream.streamid = streamid;\n      p->tmp1 = name;\n      p->p.m_newstream.name = (const char*)(p->tmp1);\n      p->p.m_newstream.url = 0;\n      if (urlflag)\n        {\n          // Should be urlencoded.\n          p->tmp2 = (const char*)url.get_string();\n          p->p.m_newstream.url = (const char*)(p->tmp2);\n        }\n      msg_push(xhead(DDJVU_NEWSTREAM, this), p);\n    }\n  return pool;\n}\n\n\nbool\nddjvu_document_s::want_pageinfo()\n{\n  if (doc && docinfoflag && !pageinfoflag)\n    {\n      pageinfoflag = true;\n      int doctype = doc->get_doc_type();\n      if (doctype == DjVuDocument::BUNDLED ||\n          doctype == DjVuDocument::OLD_BUNDLED )\n        {\n          GP<DataPool> pool;\n          {\n            GMonitorLock lock(&monitor);\n            if (streams.contains(0))\n              pool = streams[0];\n          }\n          if (pool && doctype == DjVuDocument::BUNDLED)\n            {\n              GP<DjVmDir> dir = doc->get_djvm_dir();\n              if (dir)\n                for (int i=0; i<dir->get_files_num(); i++)\n                  {\n                    GP<DjVmDir::File> f = dir->pos_to_file(i);\n                    if (! pool->has_data(f->offset, f->size))\n                      pool->add_trigger(f->offset, f->size, callback, (void*)this );\n                  }\n            }\n          else if (pool && doctype == DjVuDocument::OLD_BUNDLED)\n            {\n              GP<DjVmDir0> dir = doc->get_djvm_dir0();\n              if (dir)\n                for (int i=0; i<dir->get_files_num(); i++)\n                  {\n                    GP<DjVmDir0::FileRec> f = dir->get_file(i);\n                    if (! pool->has_data(f->offset, f->size))\n                      pool->add_trigger(f->offset, f->size, callback, (void*)this );\n                  }\n            }\n        }\n    }\n  return pageinfoflag;\n}\n\n\n// ----------------------------------------\n// Documents\n\n\nddjvu_document_t *\nddjvu_document_create(ddjvu_context_t *ctx,\n                      const char *url,\n                      int cache)\n{\n  ddjvu_document_t *d = 0;\n  G_TRY\n    {\n      DjVuFileCache *xcache = ctx->cache;\n      if (! cache) xcache = 0;\n      d = new ddjvu_document_s;\n      ref(d);\n      GMonitorLock lock(&d->monitor);\n      d->streams[0] = DataPool::create();\n      d->streamid = -1;\n      d->fileflag = false;\n      d->docinfoflag = false;\n      d->pageinfoflag = false;\n      d->myctx = ctx;\n      d->mydoc = 0;\n      d->doc = DjVuDocument::create_noinit();\n      if (url)\n        {\n          GURL gurl = GUTF8String(url);\n          gurl.clear_djvu_cgi_arguments();\n          d->urlflag = true;\n          d->doc->start_init(gurl, d, xcache);\n        }\n      else\n        {\n          GUTF8String s;\n          s.format(\"ddjvu:///doc%d/index.djvu\", ++(ctx->uniqueid));;\n          GURL gurl = s;\n          d->urlflag = false;\n          d->doc->start_init(gurl, d, xcache);\n        }\n    }\n  G_CATCH(ex)\n    {\n      if (d) \n        unref(d);\n      d = 0;\n      ERROR1(ctx, ex);\n    }\n  G_ENDCATCH;\n  return d;\n}\n\nstatic ddjvu_document_t *\nddjvu_document_create_by_filename_imp(ddjvu_context_t *ctx,\n                                      const char *filename,\n                                      int cache, int utf8)\n{\n  ddjvu_document_t *d = 0;\n  G_TRY\n    {\n      DjVuFileCache *xcache = ctx->cache;\n      if (! cache) xcache = 0;\n      GURL gurl;\n      if (utf8) \n        gurl = GURL::Filename::UTF8(filename);\n      else\n        gurl = GURL::Filename::Native(filename);\n      d = new ddjvu_document_s;\n      ref(d);\n      GMonitorLock lock(&d->monitor);\n      d->streamid = -1;\n      d->fileflag = true;\n      d->pageinfoflag = false;\n      d->urlflag = false;\n      d->docinfoflag = false;\n      d->myctx = ctx;\n      d->mydoc = 0;\n      d->doc = DjVuDocument::create_noinit();\n      d->doc->start_init(gurl, d, xcache);\n    }\n  G_CATCH(ex)\n    {\n      if (d)\n        unref(d);\n      d = 0;\n      ERROR1(ctx, ex);\n    }\n  G_ENDCATCH;\n  return d;\n}\n\nddjvu_document_t *\nddjvu_document_create_by_filename(ddjvu_context_t *ctx,\n                                  const char *filename,\n                                  int cache)\n{\n  return ddjvu_document_create_by_filename_imp(ctx,filename,cache,0);\n}\n\nddjvu_document_t *\nddjvu_document_create_by_filename_utf8(ddjvu_context_t *ctx,\n                                       const char *filename,\n                                       int cache)\n{\n  return ddjvu_document_create_by_filename_imp(ctx,filename,cache,1);\n}\n\n/* SumatraPDF: ddjvu_document_create_by_data */\nddjvu_document_t *\nddjvu_document_create_by_data(ddjvu_context_t *ctx,\n                              const char *data,\n                              unsigned long datalen)\n{\n  ddjvu_document_t *d = 0;\n  G_TRY\n    {\n      d = new ddjvu_document_s;\n      ref(d);\n      GMonitorLock lock(&d->monitor);\n      d->streams[0] = DataPool::create();\n      d->streamid = -1;\n      d->fileflag = false;\n      d->docinfoflag = false;\n      d->pageinfoflag = false;\n      d->myctx = ctx;\n      d->mydoc = 0;\n      d->doc = DjVuDocument::create_noinit();\n      ddjvu_stream_write(d, 0, data, datalen);\n      ddjvu_stream_close(d, 0, 0);\n      GUTF8String s;\n      s.format(\"ddjvu:///doc%d/index.djvu\", ++(ctx->uniqueid));;\n      GURL gurl = s;\n      d->urlflag = false;\n      d->doc->start_init(gurl, d, 0);\n    }\n  G_CATCH(ex)\n    {\n      if (d) \n        unref(d);\n      d = 0;\n      ERROR1(ctx, ex);\n    }\n  G_ENDCATCH;\n  return d;\n}\n\nddjvu_job_t *\nddjvu_document_job(ddjvu_document_t *document)\n{\n  return document;\n}\n\n\n// ----------------------------------------\n// Streams\n\n\nvoid\nddjvu_stream_write(ddjvu_document_t *doc,\n                   int streamid,\n                   const char *data,\n                   unsigned long datalen )\n{\n  G_TRY\n    {\n      GP<DataPool> pool;\n      { \n        GMonitorLock lock(&doc->monitor); \n        GPosition p = doc->streams.contains(streamid);\n        if (p) pool = doc->streams[p];\n      }\n      if (! pool)\n        G_THROW(\"Unknown stream ID\");\n      if (datalen > 0)\n        pool->add_data(data, datalen);\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(doc,ex);\n    }\n  G_ENDCATCH;\n}\n\nvoid\nddjvu_stream_close(ddjvu_document_t *doc,\n                   int streamid,\n                   int stop )\n{\n  G_TRY\n    {\n      GP<DataPool> pool;\n      { \n        GMonitorLock lock(&doc->monitor); \n        GPosition p = doc->streams.contains(streamid);\n        if (p) pool = doc->streams[p];\n      }\n      if (! pool)\n        G_THROW(\"Unknown stream ID\");\n      if (stop)\n        pool->stop(true);\n      pool->set_eof();\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(doc, ex);\n    }\n  G_ENDCATCH;\n}\n\n\n// ----------------------------------------\n// Document queries\n\n\nddjvu_document_type_t\nddjvu_document_get_type(ddjvu_document_t *document)\n{\n  G_TRY\n    {\n      DjVuDocument *doc = document->doc;\n      if (doc)\n        {\n          switch (doc->get_doc_type())\n            {\n            case DjVuDocument::OLD_BUNDLED:\n              return DDJVU_DOCTYPE_OLD_BUNDLED;\n            case DjVuDocument::OLD_INDEXED:\n              return DDJVU_DOCTYPE_OLD_INDEXED;\n            case DjVuDocument::BUNDLED:\n              return DDJVU_DOCTYPE_BUNDLED;\n            case DjVuDocument::INDIRECT:\n              return DDJVU_DOCTYPE_INDIRECT;\n            case DjVuDocument::SINGLE_PAGE:\n              return DDJVU_DOCTYPE_SINGLEPAGE;\n            default:\n              break;\n            }\n        }\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(document,ex);\n    }\n  G_ENDCATCH;\n  return DDJVU_DOCTYPE_UNKNOWN;\n}\n\n\nint\nddjvu_document_get_pagenum(ddjvu_document_t *document)\n{\n  G_TRY\n    {\n      DjVuDocument *doc = document->doc;\n      if (doc)\n        return doc->get_pages_num();\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(document,ex);\n    }\n  G_ENDCATCH;\n  return 1;\n}\n\n\nint\nddjvu_document_get_filenum(ddjvu_document_t *document)\n{\n  G_TRY\n    {\n      DjVuDocument *doc = document->doc;\n      if (! (doc && doc->is_init_ok()))\n        return 0;\n      int doc_type = doc->get_doc_type();\n      if (doc_type == DjVuDocument::BUNDLED ||\n          doc_type == DjVuDocument::INDIRECT )\n        {\n          GP<DjVmDir> dir = doc->get_djvm_dir();\n          return dir->get_files_num();\n        }\n      else if (doc_type == DjVuDocument::OLD_BUNDLED)\n        {\n          GP<DjVmDir0> dir0 = doc->get_djvm_dir0();\n          return dir0->get_files_num();\n        }\n      else \n        return doc->get_pages_num();\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(document,ex);\n    }\n  G_ENDCATCH;\n  return 0;\n}\n\n\n#undef ddjvu_document_get_fileinfo\n\nextern \"C\" DDJVUAPI ddjvu_status_t\nddjvu_document_get_fileinfo(ddjvu_document_t *d, int f, ddjvu_fileinfo_t *i);\n\nddjvu_status_t\nddjvu_document_get_fileinfo(ddjvu_document_t *d, int f, ddjvu_fileinfo_t *i)\n{\n  // for binary backward compatibility with ddjvuapi=17\n  struct info17_s { char t; int p,s; const char *d, *n, *l; };\n  return ddjvu_document_get_fileinfo_imp(d,f,i,sizeof(info17_s));\n}\n\nddjvu_status_t\nddjvu_document_get_fileinfo_imp(ddjvu_document_t *document, int fileno, \n                                ddjvu_fileinfo_t *info, \n                                unsigned int infosz )\n{\n  G_TRY\n    {\n      ddjvu_fileinfo_t myinfo;\n      memset(info, 0, infosz);\n      if (infosz > sizeof(myinfo))\n        return DDJVU_JOB_FAILED;\n      DjVuDocument *doc = document->doc;\n      if (! doc)\n        return DDJVU_JOB_NOTSTARTED;\n      if (! doc->is_init_ok())\n        return document->status();\n      int type = doc->get_doc_type();\n      if ( type == DjVuDocument::BUNDLED ||\n           type == DjVuDocument::INDIRECT )\n        {\n          GP<DjVmDir> dir = doc->get_djvm_dir();\n          GP<DjVmDir::File> file = dir->pos_to_file(fileno, &myinfo.pageno);\n          if (! file)\n            G_THROW(\"Illegal file number\");\n          myinfo.type = 'I';\n          if (file->is_page())\n            myinfo.type = 'P';\n          else\n            myinfo.pageno = -1;\n          if (file->is_thumbnails())\n            myinfo.type = 'T';\n          if (file->is_shared_anno())\n            myinfo.type = 'S';\n          myinfo.size = file->size;\n          myinfo.id = file->get_load_name();\n          myinfo.name = file->get_save_name();\n          myinfo.title = file->get_title();\n          memcpy(info, &myinfo, infosz);\n          return DDJVU_JOB_OK;\n        }\n      else if (type == DjVuDocument::OLD_BUNDLED)\n        {\n          GP<DjVmDir0> dir0 = doc->get_djvm_dir0();\n          GP<DjVuNavDir> nav = doc->get_nav_dir();\n          GP<DjVmDir0::FileRec> frec = dir0->get_file(fileno);\n          if (! frec)\n            G_THROW(\"Illegal file number\");\n          myinfo.size = frec->size;\n          myinfo.id = (const char*) frec->name;\n          myinfo.name = myinfo.title = myinfo.id;\n          if (! nav)\n            return DDJVU_JOB_STARTED;\n          else if (nav->name_to_page(frec->name) >= 0)\n            myinfo.type = 'P';\n          else\n            myinfo.type = 'I';\n          memcpy(info, &myinfo, infosz);\n          return DDJVU_JOB_OK;\n        }\n      else \n        {\n          if (fileno<0 || fileno>=doc->get_pages_num())\n            G_THROW(\"Illegal file number\");\n          myinfo.type = 'P';\n          myinfo.pageno = fileno;\n          myinfo.size = -1;\n          GP<DjVuNavDir> nav = doc->get_nav_dir();\n          myinfo.id = (nav) ? (const char *) nav->page_to_name(fileno) : 0;\n          myinfo.name = myinfo.title = myinfo.id;\n          GP<DjVuFile> file = doc->get_djvu_file(fileno, true);\n          GP<DataPool> pool; \n          if (file) \n            pool = file->get_init_data_pool();\n          if (pool)\n            myinfo.size = pool->get_length();\n          memcpy(info, &myinfo, infosz);\n          return DDJVU_JOB_OK;\n        }\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(document,ex);\n    }\n  G_ENDCATCH;\n  return DDJVU_JOB_FAILED;\n}\n\n\nint\nddjvu_document_search_pageno(ddjvu_document_t *document, const char *name)\n{\n  G_TRY\n    {\n      DjVuDocument *doc = document->doc;\n      if (! (doc && doc->is_init_ok()))\n        return -1;\n      GP<DjVmDir> dir = doc->get_djvm_dir();\n      if (! dir)\n        return 0;\n      GP<DjVmDir::File> file;\n      if (! (file = dir->id_to_file(GUTF8String(name))))\n        if (! (file = dir->name_to_file(GUTF8String(name))))\n          if (! (file = dir->title_to_file(GUTF8String(name))))\n            {\n              char *edata=0;\n              long int p = strtol(name, &edata, 10);\n              if (edata!=name && !*edata && p>=1)\n                file = dir->page_to_file(p-1);\n            }\n      if (file)\n        {\n          int pageno = -1;\n          int fileno = dir->get_file_pos(file);\n          if (dir->pos_to_file(fileno, &pageno))\n            return pageno;\n        }\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(document,ex);\n    }\n  G_ENDCATCH;\n  return -1;\n}\n\n\n\nint \nddjvu_document_check_pagedata(ddjvu_document_t *document, int pageno)\n{\n  G_TRY\n    {\n      document->want_pageinfo();\n      DjVuDocument *doc = document->doc;\n      if (doc && doc->is_init_ok())\n        {\n          bool dontcreate = false;\n          if (doc->get_doc_type() == DjVuDocument::INDIRECT ||\n              doc->get_doc_type() == DjVuDocument::OLD_INDEXED )\n            {\n              dontcreate = true;\n              GURL url = doc->page_to_url(pageno);\n              if (! url.is_empty())\n                {\n                  GUTF8String name = (const char*)url.fname();\n                  GMonitorLock lock(&document->monitor);\n                  if (document->names.contains(name))\n                    dontcreate = false;\n                }\n            }\n          GP<DjVuFile> file = doc->get_djvu_file(pageno, dontcreate);\n          if (file && file->is_data_present())\n            return 1;\n        }\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(document,ex);\n    }\n  G_ENDCATCH;\n  return 0;\n}\n\n\n#undef ddjvu_document_get_pageinfo\n\nextern \"C\" DDJVUAPI ddjvu_status_t\nddjvu_document_get_pageinfo(ddjvu_document_t *d, int p, ddjvu_pageinfo_t *i);\n\nddjvu_status_t\nddjvu_document_get_pageinfo(ddjvu_document_t *d, int p, ddjvu_pageinfo_t *i)\n{\n  // for binary backward compatibility with ddjvuapi<=17\n  struct info17_s { int w; int h; int d; };\n  return ddjvu_document_get_pageinfo_imp(d,p,i,sizeof(struct info17_s));\n}\n\nddjvu_status_t\nddjvu_document_get_pageinfo_imp(ddjvu_document_t *document, int pageno, \n                                ddjvu_pageinfo_t *pageinfo, \n                                unsigned int infosz)\n{\n  G_TRY\n    {\n      ddjvu_pageinfo_t myinfo;\n      memset(pageinfo, 0, infosz);\n      if (infosz > sizeof(myinfo))\n        return DDJVU_JOB_FAILED;\n      DjVuDocument *doc = document->doc;\n      if (doc)\n        {\n          document->want_pageinfo();\n          GP<DjVuFile> file = doc->get_djvu_file(pageno);\n          if (! file || ! file->is_data_present() )\n            return DDJVU_JOB_STARTED;\n          const GP<ByteStream> pbs(file->get_djvu_bytestream(false, false));\n          const GP<IFFByteStream> iff(IFFByteStream::create(pbs));\n          GUTF8String chkid;\n          if (iff->get_chunk(chkid))\n            {\n              if (chkid == \"FORM:DJVU\")\n                {\n                  while (iff->get_chunk(chkid) && chkid!=\"INFO\")\n                    iff->close_chunk();\n                  if (chkid == \"INFO\")\n                    {\n                      GP<ByteStream> gbs = iff->get_bytestream();\n                      GP<DjVuInfo> info=DjVuInfo::create();\n                      info->decode(*gbs);\n                      int rot = info->orientation;\n                      myinfo.rotation = rot;\n                      myinfo.width = (rot&1) ? info->height : info->width;\n                      myinfo.height = (rot&1) ? info->width : info->height;\n                      myinfo.dpi = info->dpi;\n                      myinfo.version = info->version;\n                      memcpy(pageinfo, &myinfo, infosz);\n                      return DDJVU_JOB_OK;\n                    }\n                }\n              else if (chkid == \"FORM:BM44\" || chkid == \"FORM:PM44\")\n                {\n                  while (iff->get_chunk(chkid) && \n                         chkid!=\"BM44\" && chkid!=\"PM44\")\n                    iff->close_chunk();\n                  if (chkid==\"BM44\" || chkid==\"PM44\")\n                    {\n                      GP<ByteStream> gbs = iff->get_bytestream();\n                      if (gbs->read8() == 0)\n                        {\n                          gbs->read8();\n                          unsigned char vhi = gbs->read8();\n                          unsigned char vlo = gbs->read8();\n                          unsigned char xhi = gbs->read8();\n                          unsigned char xlo = gbs->read8();\n                          unsigned char yhi = gbs->read8();\n                          unsigned char ylo = gbs->read8();\n                          myinfo.width = (xhi<<8)+xlo;\n                          myinfo.height = (yhi<<8)+ylo;\n                          myinfo.dpi = 100;\n                          myinfo.rotation = 0;\n                          myinfo.version = (vhi<<8)+vlo;\n                          memcpy(pageinfo, &myinfo, infosz);\n                        }\n                    }\n                }\n            }\n        }\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(document, ex);\n    }\n  G_ENDCATCH;\n  return DDJVU_JOB_FAILED;\n}\n\n\nstatic char *\nget_file_dump(DjVuFile *file)\n{\n  DjVuDumpHelper dumper;\n  GP<DataPool> pool = file->get_init_data_pool();\n  GP<ByteStream> str = dumper.dump(pool);\n  int size = str->size();\n  char *buffer;\n  if ((size = str->size()) > 0 && (buffer = (char*)malloc(size+1)))\n    {\n      str->seek(0);\n      int len = str->readall(buffer, size);\n      buffer[len] = 0;\n      return buffer;\n    }\n  return 0;\n}\n\n\nchar *\nddjvu_document_get_pagedump(ddjvu_document_t *document, int pageno)\n{\n  G_TRY\n    {\n      DjVuDocument *doc = document->doc;\n      if (doc)\n        {\n          document->want_pageinfo();\n          GP<DjVuFile> file = doc->get_djvu_file(pageno);\n          if (file && file->is_data_present())\n            return get_file_dump(file);\n        }\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(document, ex);\n    }\n  G_ENDCATCH;\n  return 0;\n}\n\n\nchar *\nddjvu_document_get_filedump(ddjvu_document_t *document, int fileno)\n{\n  G_TRY\n    {\n      DjVuDocument *doc = document->doc;\n      document->want_pageinfo();\n      if (doc)\n        {\n          GP<DjVuFile> file;\n          int type = doc->get_doc_type();\n          if ( type != DjVuDocument::BUNDLED &&\n               type != DjVuDocument::INDIRECT )\n            file = doc->get_djvu_file(fileno);\n          else\n            {\n              GP<DjVmDir> dir = doc->get_djvm_dir();\n              GP<DjVmDir::File> fdesc = dir->pos_to_file(fileno);\n              if (fdesc)\n                file = doc->get_djvu_file(fdesc->get_load_name());\n            }\n          if (file && file->is_data_present())\n            return get_file_dump(file);\n        }\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(document, ex);\n    }\n  G_ENDCATCH;\n  return 0;\n}\n\n\n\n// ----------------------------------------\n// Page\n\nstatic ddjvu_page_t *\nddjvu_page_create(ddjvu_document_t *document, ddjvu_job_t *job,\n                  const char *pageid, int pageno)\n{\n  ddjvu_page_t *p = 0;\n  G_TRY\n    {\n      DjVuDocument *doc = document->doc;\n      if (! doc) return 0;\n      p = new ddjvu_page_s;\n      ref(p);\n      GMonitorLock lock(&p->monitor);\n      p->myctx = document->myctx;\n      p->mydoc = document;\n      p->pageinfoflag = false;\n      p->pagedoneflag = false;\n      if (! job)\n        job = p;\n      p->job = job;\n      if (pageid)\n        p->img = doc->get_page(GNativeString(pageid), false, job);\n      else\n        p->img = doc->get_page(pageno, false, job);\n    }\n  G_CATCH(ex)\n    {\n      if (p)\n        unref(p);\n      p = 0;\n      ERROR1(document, ex);\n    }\n  G_ENDCATCH;\n  return p;\n}\n\nddjvu_page_t *\nddjvu_page_create_by_pageno(ddjvu_document_t *document, int pageno)\n{\n  return ddjvu_page_create(document, 0, 0, pageno);\n}\n\nddjvu_page_t *\nddjvu_page_create_by_pageid(ddjvu_document_t *document, const char *pageid)\n{\n  return ddjvu_page_create(document, 0, pageid, 0);\n}\n\nddjvu_job_t *\nddjvu_page_job(ddjvu_page_t *page)\n{\n  return page;\n}\n\n\n// ----------------------------------------\n// Page callbacks\n\nvoid\nddjvu_page_s::release()\n{\n  img = 0;\n}\n\nddjvu_status_t\nddjvu_page_s::status()\n{\n  if (! img)\n    return DDJVU_JOB_NOTSTARTED;        \n  DjVuFile *file = img->get_djvu_file();\n  DjVuInfo *info = img->get_info();\n  if (! file)\n    return DDJVU_JOB_NOTSTARTED;\n  else if (file->is_decode_stopped())\n    return DDJVU_JOB_STOPPED;\n  else if (file->is_decode_failed())\n    return DDJVU_JOB_FAILED;\n  else if (file->is_decode_ok())\n    return (info) ? DDJVU_JOB_OK : DDJVU_JOB_FAILED;\n  else if (file->is_decoding())\n    return DDJVU_JOB_STARTED;\n  return DDJVU_JOB_NOTSTARTED;\n}\n\nbool\nddjvu_page_s::inherits(const GUTF8String &classname)\n{\n  return (classname == \"ddjvu_page_s\")\n    || ddjvu_job_s::inherits(classname);\n}\n\nbool \nddjvu_page_s::notify_error(const DjVuPort *, const GUTF8String &m)\n{\n  if (!img) return false;\n  msg_push(xhead(DDJVU_ERROR, this), msg_prep_error(m));\n  return true;\n}\n \nbool \nddjvu_page_s::notify_status(const DjVuPort *p, const GUTF8String &m)\n{\n  if (!img) return false;\n  msg_push(xhead(DDJVU_INFO, this), msg_prep_info(m));\n  return true;\n}\n\nvoid \nddjvu_page_s::notify_file_flags_changed(const DjVuFile *sender, long, long)\n{\n  GMonitorLock lock(&monitor);\n  if (!img) return;\n  DjVuFile *file = img->get_djvu_file();\n  if (file==0 || file!=sender) return;\n  long flags = file->get_flags();\n  if ((flags & DjVuFile::DECODE_OK) ||\n      (flags & DjVuFile::DECODE_FAILED) ||\n      (flags & DjVuFile::DECODE_STOPPED) )\n    {\n      if (pagedoneflag) return;\n      msg_push(xhead(DDJVU_PAGEINFO, this));\n      pageinfoflag = pagedoneflag = true;\n    }\n}\n\nvoid \nddjvu_page_s::notify_relayout(const DjVuImage *dimg)\n{\n  GMonitorLock lock(&monitor);\n  if (img && !pageinfoflag)\n    {\n      msg_push(xhead(DDJVU_PAGEINFO, this));\n      msg_push(xhead(DDJVU_RELAYOUT, this));\n      pageinfoflag = true;\n    }\n}\n\nvoid \nddjvu_page_s::notify_redisplay(const DjVuImage *dimg)\n{\n  GMonitorLock lock(&monitor);\n  if (img && !pageinfoflag)\n    {\n      msg_push(xhead(DDJVU_PAGEINFO, this));\n      msg_push(xhead(DDJVU_RELAYOUT, this));\n      pageinfoflag = true;\n    }\n  if (img && pageinfoflag)\n    msg_push(xhead(DDJVU_REDISPLAY, this));\n}\n\nvoid \nddjvu_page_s::notify_chunk_done(const DjVuPort*, const GUTF8String &name)\n{\n  GMonitorLock lock(&monitor);\n  if (! img) return;\n  GP<ddjvu_message_p> p = new ddjvu_message_p;\n  p->tmp1 = name;\n  p->p.m_chunk.chunkid = (const char*)(p->tmp1);\n  msg_push(xhead(DDJVU_CHUNK,this), p);\n}\n\n\n// ----------------------------------------\n// Page queries\n\nint\nddjvu_page_get_width(ddjvu_page_t *page)\n{\n  G_TRY\n    {\n      if (page && page->img)\n        return page->img->get_width();\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(page, ex);\n    }\n  G_ENDCATCH;\n  return 0;\n}\n\nint\nddjvu_page_get_height(ddjvu_page_t *page)\n{\n  G_TRY\n    {\n      if (page && page->img)\n        return page->img->get_height();\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(page, ex);\n    }\n  G_ENDCATCH;\n  return 0;\n}\n\nint\nddjvu_page_get_resolution(ddjvu_page_t *page)\n{\n  G_TRY\n    {\n      if (page && page->img)\n        return page->img->get_dpi();\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(page, ex);\n    }\n  G_ENDCATCH;\n  return 0;\n}\n\ndouble\nddjvu_page_get_gamma(ddjvu_page_t *page)\n{\n  G_TRY\n    {\n      if (page && page->img)\n        return page->img->get_gamma();\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(page, ex);\n    }\n  G_ENDCATCH;\n  return 2.2;\n}\n\nint\nddjvu_page_get_version(ddjvu_page_t *page)\n{\n  G_TRY\n    {\n      if (page && page->img)\n        return page->img->get_version();\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(page, ex);\n    }\n  G_ENDCATCH;\n  return DJVUVERSION;\n}\n\nddjvu_page_type_t\nddjvu_page_get_type(ddjvu_page_t *page)\n{\n  G_TRY\n    {\n      if (! (page && page->img))\n        return DDJVU_PAGETYPE_UNKNOWN;\n      else if (page->img->is_legal_bilevel())\n        return DDJVU_PAGETYPE_BITONAL;\n      else if (page->img->is_legal_photo())\n        return DDJVU_PAGETYPE_PHOTO;\n      else if (page->img->is_legal_compound())\n        return DDJVU_PAGETYPE_COMPOUND;\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(page, ex);\n    }\n  G_ENDCATCH;\n  return DDJVU_PAGETYPE_UNKNOWN;\n}\n\nchar *\nddjvu_page_get_short_description(ddjvu_page_t *page)\n{\n  G_TRY\n    {\n      if (page && page->img)\n        {\n          const char *desc = page->img->get_short_description();\n          return xstr(DjVuMessageLite::LookUpUTF8(desc));\n        }\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(page, ex);\n    }\n  G_ENDCATCH;\n  return 0;\n}\n\nchar *\nddjvu_page_get_long_description(ddjvu_page_t *page)\n{\n  G_TRY\n    {\n      if (page && page->img)\n        {\n          const char *desc = page->img->get_long_description();\n          return xstr(DjVuMessageLite::LookUpUTF8(desc));\n        }\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(page, ex);\n    }\n  G_ENDCATCH;\n  return 0;\n}\n\n\n// ----------------------------------------\n// Rotations\n\nvoid\nddjvu_page_set_rotation(ddjvu_page_t *page,\n                        ddjvu_page_rotation_t rot)\n{\n  G_TRY\n    {\n      switch(rot)\n        {\n        case DDJVU_ROTATE_0:\n        case DDJVU_ROTATE_90:\n        case DDJVU_ROTATE_180:\n        case DDJVU_ROTATE_270:\n          if (page && page->img && page->img->get_info())\n            page->img->set_rotate((int)rot);\n          break;\n        default:\n          G_THROW(\"Illegal ddjvu rotation code\");\n          break;\n        }\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(page, ex);\n    }\n  G_ENDCATCH;\n}\n\nddjvu_page_rotation_t\nddjvu_page_get_rotation(ddjvu_page_t *page)\n{\n  ddjvu_page_rotation_t rot = DDJVU_ROTATE_0;\n  G_TRY\n    {\n      if (page && page->img)\n        rot = (ddjvu_page_rotation_t)(page->img->get_rotate() & 3);\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(page, ex);\n    }\n  G_ENDCATCH;\n  return rot;\n}\n\nddjvu_page_rotation_t\nddjvu_page_get_initial_rotation(ddjvu_page_t *page)\n{\n  ddjvu_page_rotation_t rot = DDJVU_ROTATE_0;\n  G_TRY\n    {\n      GP<DjVuInfo> info;\n      if (page && page->img)\n        info = page->img->get_info();\n      if (info)\n        rot = (ddjvu_page_rotation_t)(info->orientation & 3);\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(page, ex);\n    }\n  G_ENDCATCH;\n  return rot;\n}\n\n\n// ----------------------------------------\n// Rectangles\n\nstatic void\nrect2grect(const ddjvu_rect_t *r, GRect &g)\n{\n  g.xmin = r->x;\n  g.ymin = r->y;\n  g.xmax = r->x + r->w;\n  g.ymax = r->y + r->h;\n}\n\nstatic void\ngrect2rect(const GRect &g, ddjvu_rect_t *r)\n{\n  if (g.isempty())\n    {\n      r->x = r->y = 0;\n      r->w = r->h = 0;\n    }\n  else\n    {\n      r->x = g.xmin;\n      r->y = g.ymin;\n      r->w = g.width();\n      r->h = g.height();\n    }\n}\n\nddjvu_rectmapper_t *\nddjvu_rectmapper_create(ddjvu_rect_t *input, ddjvu_rect_t *output)\n{\n  GRect ginput, goutput;\n  rect2grect(input, ginput);\n  rect2grect(output, goutput);\n  GRectMapper *mapper = new GRectMapper;\n  if (!ginput.isempty())\n    mapper->set_input(ginput);\n  if (!goutput.isempty())\n    mapper->set_output(goutput);\n  return (ddjvu_rectmapper_t*)mapper;\n}\n\nvoid\nddjvu_rectmapper_modify(ddjvu_rectmapper_t *mapper,\n                        int rotation, int mirrorx, int mirrory)\n{\n  GRectMapper *gmapper = (GRectMapper*)mapper;\n  if (! gmapper) return;\n  gmapper->rotate(rotation);\n  if (mirrorx & 1)\n    gmapper->mirrorx();\n  if (mirrory & 1)\n    gmapper->mirrory();\n}\n\nvoid \nddjvu_rectmapper_release(ddjvu_rectmapper_t *mapper)\n{\n  GRectMapper *gmapper = (GRectMapper*)mapper;\n  if (! gmapper) return;\n  delete gmapper;\n}\n\nvoid \nddjvu_map_point(ddjvu_rectmapper_t *mapper, int *x, int *y)\n{\n  GRectMapper *gmapper = (GRectMapper*)mapper;\n  if (! gmapper) return;\n  gmapper->map(*x,*y);\n}\n\nvoid \nddjvu_map_rect(ddjvu_rectmapper_t *mapper, ddjvu_rect_t *rect)\n{\n  GRectMapper *gmapper = (GRectMapper*)mapper;\n  if (! gmapper) return;\n  GRect grect;\n  rect2grect(rect,grect);\n  gmapper->map(grect);\n  grect2rect(grect,rect);\n}\n\nvoid \nddjvu_unmap_point(ddjvu_rectmapper_t *mapper, int *x, int *y)\n{\n  GRectMapper *gmapper = (GRectMapper*)mapper;\n  if (! gmapper) return;\n  gmapper->unmap(*x,*y);\n}\n\nvoid \nddjvu_unmap_rect(ddjvu_rectmapper_t *mapper, ddjvu_rect_t *rect)\n{\n  GRectMapper *gmapper = (GRectMapper*)mapper;\n  if (! gmapper) return;\n  GRect grect;\n  rect2grect(rect,grect);\n  gmapper->unmap(grect);\n  grect2rect(grect,rect);\n}\n\n\n// ----------------------------------------\n// Render\n\nstruct DJVUNS ddjvu_format_s\n{\n  ddjvu_format_style_t style;\n  uint32_t rgb[3][256];\n  uint32_t palette[6*6*6];\n  uint32_t xorval;\n  double gamma;\n  GPixel white;\n  char ditherbits;\n  bool rtoptobottom;\n  bool ytoptobottom;\n};\n\nstatic ddjvu_format_t *\nfmt_error(ddjvu_format_t *fmt)\n{\n  delete fmt;\n  return 0;\n}\n\nddjvu_format_t *\nddjvu_format_create(ddjvu_format_style_t style,\n                    int nargs, unsigned int *args)\n{\n  ddjvu_format_t *fmt = new ddjvu_format_s;\n  memset(fmt, 0, sizeof(ddjvu_format_t));\n  fmt->style = style;  \n  fmt->rtoptobottom = false;\n  fmt->ytoptobottom = false;\n  fmt->gamma = 2.2;\n  fmt->white = GPixel::WHITE;\n  // Ditherbits\n  fmt->ditherbits = 32;\n  if (style==DDJVU_FORMAT_RGBMASK16)\n    fmt->ditherbits = 16;\n  else if (style==DDJVU_FORMAT_PALETTE8)\n    fmt->ditherbits = 8;\n  else if (style==DDJVU_FORMAT_MSBTOLSB || style==DDJVU_FORMAT_LSBTOMSB)\n    fmt->ditherbits = 1;\n  // Args\n  switch(style)\n    {\n    case DDJVU_FORMAT_RGBMASK16:\n    case DDJVU_FORMAT_RGBMASK32: \n      {\n        if (sizeof(uint16_t)!=2 || sizeof(uint32_t)!=4)\n          return fmt_error(fmt);\n        if (!args || nargs<3 || nargs>4)\n          return fmt_error(fmt);\n        { // extra nesting for windows\n          for (int j=0; j<3; j++)\n          {\n            int shift = 0;\n            uint32_t mask = args[j];\n            for (shift=0; shift<32 && !(mask & 1); shift++)\n              mask >>= 1;\n            if ((shift>=32) || (mask&(mask+1)))\n              return fmt_error(fmt);\n            for (int i=0; i<256; i++)\n              fmt->rgb[j][i] = (mask & ((int)((i*mask+127.0)/255.0)))<<shift;\n          }\n        }\n        if (nargs >= 4)\n          fmt->xorval = args[3];\n        break;\n      }\n    case DDJVU_FORMAT_PALETTE8:\n      {\n        if (nargs!=6*6*6 || !args)\n          return fmt_error(fmt);\n        { // extra nesting for windows\n          for (int k=0; k<6*6*6; k++)\n            fmt->palette[k] = args[k];\n        }\n        { // extra nesting for windows\n          int j=0;\n          for(int i=0; i<6; i++)\n            for(; j < (i+1)*0x33 - 0x19 && j<256; j++)\n            {\n              fmt->rgb[0][j] = i * 6 * 6;\n              fmt->rgb[1][j] = i * 6;\n              fmt->rgb[2][j] = i;\n            }\n        }\n        break;\n      }\n    case DDJVU_FORMAT_RGB24:\n    case DDJVU_FORMAT_BGR24:\n    case DDJVU_FORMAT_GREY8:\n    case DDJVU_FORMAT_LSBTOMSB:\n    case DDJVU_FORMAT_MSBTOLSB:\n      if (!nargs) \n        break;\n    default:\n      return fmt_error(fmt);\n    }\n  return fmt;\n}\n\nvoid\nddjvu_format_set_row_order(ddjvu_format_t *format, int top_to_bottom)\n{\n  format->rtoptobottom = !! top_to_bottom;\n}\n\nvoid\nddjvu_format_set_y_direction(ddjvu_format_t *format, int top_to_bottom)\n{\n  format->ytoptobottom = !! top_to_bottom;\n}\n\nvoid\nddjvu_format_set_ditherbits(ddjvu_format_t *format, int bits)\n{\n  if (bits>0 && bits<=64)\n    format->ditherbits = bits;\n}\n\nvoid\nddjvu_format_set_gamma(ddjvu_format_t *format, double gamma)\n{\n  if (gamma>=0.5 && gamma<=5.0)\n    format->gamma = gamma;\n}\n\nvoid\nddjvu_format_set_white(ddjvu_format_t *format, \n                       unsigned char b, unsigned char g, unsigned char r)\n{\n  format->white.b = b;\n  format->white.g = g;\n  format->white.r = r;\n}\n\nvoid\nddjvu_format_release(ddjvu_format_t *format)\n{\n  delete format;\n}\n\nstatic void\nfmt_convert_row(const GPixel *p, int w, \n                const ddjvu_format_t *fmt, char *buf)\n{\n  const uint32_t (*r)[256] = fmt->rgb;\n  const uint32_t xorval = fmt->xorval;\n  switch(fmt->style)\n    {\n    case DDJVU_FORMAT_BGR24:    /* truecolor 24 bits in BGR order */\n      {\n        memcpy(buf, (const char*)p, 3*w);\n        break;\n      }\n    case DDJVU_FORMAT_RGB24:    /* truecolor 24 bits in RGB order */\n      { \n        while (--w >= 0) { \n          buf[0]=p->r; buf[1]=p->g; buf[2]=p->b; \n          buf+=3; p+=1; \n        }\n        break;\n      }\n    case DDJVU_FORMAT_RGBMASK16: /* truecolor 16 bits with masks */\n      {\n        uint16_t *b = (uint16_t*)buf;\n        while (--w >= 0) {\n          b[0]=(r[0][p->r]|r[1][p->g]|r[2][p->b])^xorval; \n          b+=1; p+=1; \n        }\n        break;\n      }\n    case DDJVU_FORMAT_RGBMASK32: /* truecolor 32 bits with masks */\n      {\n        uint32_t *b = (uint32_t*)buf;\n        while (--w >= 0) {\n          b[0]=(r[0][p->r]|r[1][p->g]|r[2][p->b])^xorval; \n          b+=1; p+=1; \n        }\n        break;\n      }\n    case DDJVU_FORMAT_GREY8:    /* greylevel 8 bits */\n      {\n        while (--w >= 0) { \n          buf[0]=(5*p->r + 9*p->g + 2*p->b)>>4; \n          buf+=1; p+=1; \n        }\n        break;\n      }\n    case DDJVU_FORMAT_PALETTE8: /* paletized 8 bits (6x6x6 color cube) */\n      {\n        const uint32_t *u = fmt->palette;\n        while (--w >= 0) {\n          buf[0] = u[r[0][p->r]+r[1][p->g]+r[2][p->b]]; \n          buf+=1; p+=1; \n        }\n        break;\n      }\n    case DDJVU_FORMAT_MSBTOLSB: /* packed bits, msb on the left */\n      {\n        int t = (5*fmt->white.r + 9*fmt->white.g + 2*fmt->white.b + 16);\n        t = t * 0xc / 0x10;\n        unsigned char s=0, m=0x80;\n        while (--w >= 0) {\n          if ( 5*p->r + 9*p->g + 2*p->b < t ) { s |= m; }\n          if (! (m >>= 1)) { *buf++ = s; s=0; m=0x80; }\n          p += 1;\n        }\n        if (m < 0x80) { *buf++ = s; }\n        break;\n      }\n    case DDJVU_FORMAT_LSBTOMSB: /* packed bits, lsb on the left */\n      {\n        int t = 5*fmt->white.r + 9*fmt->white.g + 2*fmt->white.b + 16;\n        t = t * 0xc / 0x10;\n        unsigned char s=0, m=0x1;\n        while (--w >= 0) {\n          if ( 5*p->r + 9*p->g + 2*p->b < t ) { s |= m; }\n          if (! (m <<= 1)) { *buf++ = s; s=0; m=0x1; }\n          p += 1;\n        }\n        if (m > 0x1) { *buf++ = s; }\n        break;\n      }\n    }\n}\n\nstatic void\nfmt_convert(GPixmap *pm, const ddjvu_format_t *fmt, char *buffer, int rowsize)\n{\n  int w = pm->columns();\n  int h = pm->rows();\n  // Loop on rows\n  if (fmt->rtoptobottom)\n    {\n      for(int r=h-1; r>=0; r--, buffer+=rowsize)\n        fmt_convert_row((*pm)[r], w, fmt, buffer);\n    }\n  else\n    {\n      for(int r=0; r<h; r++, buffer+=rowsize)\n        fmt_convert_row((*pm)[r], w, fmt, buffer);\n    }\n}\n\nstatic void\nfmt_convert_row(unsigned char *p, unsigned char g[256][4], int w, \n                const ddjvu_format_t *fmt, char *buf)\n{\n  const uint32_t (*r)[256] = fmt->rgb;\n  const uint32_t xorval = fmt->xorval;\n  switch(fmt->style)\n    {\n    case DDJVU_FORMAT_BGR24:    /* truecolor 24 bits in BGR order */\n      { \n        while (--w >= 0) { \n          buf[0]=g[*p][0];\n          buf[1]=g[*p][1];\n          buf[2]=g[*p][2];\n          buf+=3; p+=1; \n        }\n        break;\n      }\n    case DDJVU_FORMAT_RGB24:    /* truecolor 24 bits in RGB order */\n      { \n        while (--w >= 0) { \n          buf[0]=g[*p][2];\n          buf[1]=g[*p][1];\n          buf[2]=g[*p][0];\n          buf+=3; p+=1; \n        }\n        break;\n      }\n    case DDJVU_FORMAT_RGBMASK16: /* truecolor 16 bits with masks */\n      {\n        uint16_t *b = (uint16_t*)buf;\n        while (--w >= 0) {\n          unsigned char x = *p;\n          b[0]=(r[0][g[x][2]]|r[1][g[x][1]]|r[2][g[x][0]])^xorval; \n          b+=1; p+=1; \n        }\n        break;\n      }\n    case DDJVU_FORMAT_RGBMASK32: /* truecolor 32 bits with masks */\n      {\n        uint32_t *b = (uint32_t*)buf;\n        while (--w >= 0) {\n          unsigned char x = *p;\n          b[0]=(r[0][g[x][2]]|r[1][g[x][1]]|r[2][g[x][0]])^xorval; \n          b+=1; p+=1; \n        }\n        break;\n      }\n    case DDJVU_FORMAT_GREY8:    /* greylevel 8 bits */\n      {\n        while (--w >= 0) { \n          buf[0]=g[*p][3];\n          buf+=1; p+=1; \n        }\n        break;\n      }\n    case DDJVU_FORMAT_PALETTE8: /* paletized 8 bits (6x6x6 color cube) */\n      {\n        const uint32_t *u = fmt->palette;\n        while (--w >= 0) {\n          unsigned char x = *p;\n          buf[0] = u[r[0][g[x][0]]+r[1][g[x][1]]+r[2][g[x][2]]]; \n          buf+=1; p+=1; \n        }\n        break;\n      }\n    case DDJVU_FORMAT_MSBTOLSB: /* packed bits, msb on the left */\n      {\n        int t = 5*fmt->white.r + 9*fmt->white.g + 2*fmt->white.b + 16;\n        t = t * 0xc / 0x100;\n        unsigned char s=0, m=0x80;\n        while (--w >= 0) {\n          unsigned char x = *p;\n          if ( g[x][3] < t ) { s |= m; }\n          if (! (m >>= 1)) { *buf++ = s; s=0; m=0x80; }\n          p += 1;\n        }\n        if (m < 0x80) { *buf++ = s; }\n        break;\n      }\n    case DDJVU_FORMAT_LSBTOMSB: /* packed bits, lsb on the left */\n      {\n        int t = 5*fmt->white.r + 9*fmt->white.g + 2*fmt->white.b + 16;\n        t = t * 0xc / 0x100;\n        unsigned char s=0, m=0x1;\n        while (--w >= 0) {\n          unsigned char x = *p;\n          if ( g[x][3] < t ) { s |= m; }\n          if (! (m <<= 1)) { *buf++ = s; s=0; m=0x1; }\n          p += 1;\n        }\n        if (m > 0x1) { *buf++ = s; }\n        break;\n      }\n    }\n}\n\nstatic void\nfmt_convert(GBitmap *bm, const ddjvu_format_t *fmt, char *buffer, int rowsize)\n{\n  int w = bm->columns();\n  int h = bm->rows();\n  int m = bm->get_grays();\n  // Gray levels\n  int i;\n  unsigned char g[256][4];\n  const GPixel &wh = fmt->white;\n  for (i=0; i<m; i++)\n    {\n      g[i][0] = wh.b - ( i * wh.b + (m - 1)/2 ) / (m - 1);\n      g[i][1] = wh.g - ( i * wh.g + (m - 1)/2 ) / (m - 1);\n      g[i][2] = wh.r - ( i * wh.r + (m - 1)/2 ) / (m - 1);\n      g[i][3] = (5*g[i][2] + 9*g[i][1] + 2*g[i][0])>>4; \n    }\n  for (i=m; i<256; i++)\n    g[i][0] = g[i][1] = g[i][2] = g[i][3] = 0;\n  \n  // Loop on rows\n  if (fmt->rtoptobottom)\n    {\n      for(int r=h-1; r>=0; r--, buffer+=rowsize)\n        fmt_convert_row((*bm)[r], g, w, fmt, buffer);\n    }\n  else\n    {\n      for(int r=0; r<h; r++, buffer+=rowsize)\n        fmt_convert_row((*bm)[r], g, w, fmt, buffer);\n    }\n}\n\nstatic void\nfmt_dither(GPixmap *pm, const ddjvu_format_t *fmt, int x, int y)\n{\n  if (fmt->ditherbits < 8)\n    return;\n  else if (fmt->ditherbits < 15)\n    pm->ordered_666_dither(x, y);\n  else if (fmt->ditherbits < 24)\n    pm->ordered_32k_dither(x, y);\n}\n\n\n// ----------------------------------------\n\nint\nddjvu_page_render(ddjvu_page_t *page,\n                  const ddjvu_render_mode_t mode,\n                  const ddjvu_rect_t *pagerect,\n                  const ddjvu_rect_t *renderrect,\n                  const ddjvu_format_t *format,\n                  unsigned long rowsize,\n                  char *imagebuffer )\n{\n  G_TRY\n    {\n      GP<GPixmap> pm;\n      GP<GBitmap> bm;\n      GRect prect, rrect;\n      rect2grect(pagerect, prect);\n      rect2grect(renderrect, rrect);\n      if (format && format->ytoptobottom)\n        {\n          prect.ymin = renderrect->y + renderrect->h;\n          prect.ymax = prect.ymin + pagerect->h;\n          rrect.ymin = pagerect->y + pagerect->h;\n          rrect.ymax = rrect.ymin + renderrect->h;\n        }\n\n      DjVuImage *img = page->img;\n      if (img) \n        {\n          switch (mode)\n            {\n            case DDJVU_RENDER_COLOR:\n              pm = img->get_pixmap(rrect,prect, format->gamma,format->white);\n              if (! pm) \n                bm = img->get_bitmap(rrect,prect);\n              break;\n            case DDJVU_RENDER_BLACK:\n              bm = img->get_bitmap(rrect,prect);\n              if (! bm)\n                pm = img->get_pixmap(rrect,prect, format->gamma,format->white);\n              break;\n            case DDJVU_RENDER_MASKONLY:\n              bm = img->get_bitmap(rrect,prect);\n              break;\n            case DDJVU_RENDER_COLORONLY:\n              pm = img->get_pixmap(rrect,prect, format->gamma,format->white);\n              break;\n            case DDJVU_RENDER_BACKGROUND:\n              pm = img->get_bg_pixmap(rrect,prect, format->gamma,format->white);\n              break;\n            case DDJVU_RENDER_FOREGROUND:\n              pm = img->get_fg_pixmap(rrect,prect, format->gamma,format->white);\n              if (! pm) \n                bm = img->get_bitmap(rrect,prect);\n              break;\n            }\n        }\n      if (pm)\n        {\n          int dx = rrect.xmin - prect.xmin;\n          int dy = rrect.ymin - prect.xmin;\n          fmt_dither(pm, format, dx, dy);\n          fmt_convert(pm, format, imagebuffer, rowsize);\n          return 2;\n        }\n      else if (bm)\n        {\n          fmt_convert(bm, format, imagebuffer, rowsize);\n          return 1;\n        }\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(page, ex);\n    }\n  G_ENDCATCH;\n  return 0;\n}\n\n\n// ----------------------------------------\n// Thumbnails\n\nvoid\nddjvu_thumbnail_p::callback(void *cldata)\n{\n  ddjvu_thumbnail_p *thumb = (ddjvu_thumbnail_p*)cldata;\n  if (thumb->document)\n    {\n      GMonitorLock lock(&thumb->document->monitor);\n      if (thumb->pool && thumb->pool->is_eof())\n        {\n          GP<DataPool> pool = thumb->pool;\n          int size = pool->get_size();\n          thumb->pool = 0;\n          G_TRY\n            {\n              thumb->data.resize(0,size-1);\n              pool->get_data( (void*)(char*)thumb->data, 0, size);\n            }\n          G_CATCH_ALL\n            {\n              thumb->data.empty();\n            }\n          G_ENDCATCH;\n          if (thumb->document->doc)\n            {\n              GP<ddjvu_message_p> p = new ddjvu_message_p;\n              p->p.m_thumbnail.pagenum = thumb->pagenum;\n              msg_push(xhead(DDJVU_THUMBNAIL, thumb->document), p);\n            } \n        }\n    }\n}\n\nddjvu_status_t\nddjvu_thumbnail_status(ddjvu_document_t *document, int pagenum, int start)\n{\n  G_TRY\n    {\n      GP<ddjvu_thumbnail_p> thumb;\n      DjVuDocument* doc = document->doc;\n      if (doc)\n        {\n          GMonitorLock lock(&document->monitor);\n          GPosition p = document->thumbnails.contains(pagenum);\n          if (p)\n            thumb = document->thumbnails[p];\n        }\n      if (!thumb && doc)\n        {\n          GP<DataPool> pool = doc->get_thumbnail(pagenum, !start);\n          if (pool)\n            {\n              GMonitorLock lock(&document->monitor);\n              thumb = new ddjvu_thumbnail_p;\n              thumb->document = document;\n              thumb->pagenum = pagenum;\n              thumb->pool = pool;\n              document->thumbnails[pagenum] = thumb;\n            }\n          if (thumb)\n            pool->add_trigger(-1, ddjvu_thumbnail_p::callback, \n                              (void*)(ddjvu_thumbnail_p*)thumb);\n        } \n      if (! thumb)\n        return DDJVU_JOB_NOTSTARTED;        \n      else if (thumb->pool)\n        return DDJVU_JOB_STARTED;\n      else if (thumb->data.size() > 0)\n        return DDJVU_JOB_OK;\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(document, ex);\n    }\n  G_ENDCATCH;\n  return DDJVU_JOB_FAILED;\n}\n \nint\nddjvu_thumbnail_render(ddjvu_document_t *document, int pagenum, \n                       int *wptr, int *hptr,\n                       const ddjvu_format_t *format,\n                       unsigned long rowsize,\n                       char *imagebuffer)\n{\n  G_TRY\n    {\n      GP<ddjvu_thumbnail_p> thumb;\n      ddjvu_status_t status = ddjvu_thumbnail_status(document,pagenum,FALSE);\n      if (status == DDJVU_JOB_OK)\n        {\n          GMonitorLock lock(&document->monitor);\n          thumb = document->thumbnails[pagenum];\n        }\n      if (! (thumb && wptr && hptr))\n        return FALSE;\n      if (! (thumb->data.size() > 0))\n        return FALSE;\n      /* Decode wavelet data */\n      int size = thumb->data.size();\n      char *data = (char*)thumb->data;\n      GP<IW44Image> iw = IW44Image::create_decode();\n      iw->decode_chunk(ByteStream::create_static((void*)data, size));\n      int w = iw->get_width();\n      int h = iw->get_height();\n      /* Restore aspect ratio */\n      double dw = (double)w / *wptr;\n      double dh = (double)h / *hptr;\n      if (dw > dh) \n        *hptr = (int)(h / dw);\n      else\n        *wptr = (int)(w / dh);\n      if (! imagebuffer)\n        return TRUE;\n      /* Render and scale image */\n      GP<GPixmap> pm = iw->get_pixmap();\n      double thumbgamma = document->doc->get_thumbnails_gamma();\n      pm->color_correct(format->gamma/thumbgamma, format->white);\n      GP<GPixmapScaler> scaler = GPixmapScaler::create(w, h, *wptr, *hptr);\n      GP<GPixmap> scaledpm = GPixmap::create();\n      GRect scaledrect(0, 0, *wptr, *hptr);\n      scaler->scale(GRect(0, 0, w, h), *pm, scaledrect, *scaledpm);\n      /* Convert */\n      fmt_dither(scaledpm, format, 0, 0);\n      fmt_convert(scaledpm, format, imagebuffer, rowsize);\n      return TRUE;\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(document, ex);\n    }\n  G_ENDCATCH;\n  return FALSE;\n}\n\n\n// ----------------------------------------\n// Threaded jobs\n\nstruct DJVUNS ddjvu_runnablejob_s : public ddjvu_job_s\n{\n  bool mystop;\n  int  myprogress;\n  ddjvu_status_t mystatus;\n  // methods\n  ddjvu_runnablejob_s();\n  ddjvu_status_t start();\n  void progress(int p);\n  // thread function\n  virtual ddjvu_status_t run() = 0;\n  // virtual port functions:\n  virtual bool inherits(const GUTF8String&);\n  virtual ddjvu_status_t status();\n  virtual void stop();\nprivate:\n  static void cbstart(void*);\n};\n\nddjvu_runnablejob_s::ddjvu_runnablejob_s()\n  : mystop(false), myprogress(-1),\n    mystatus(DDJVU_JOB_NOTSTARTED) \n{\n}\n\nvoid \nddjvu_runnablejob_s::progress(int x)\n{\n  if ((mystatus>=DDJVU_JOB_OK) || (x>myprogress && x<100))\n    {\n      GMonitorLock lock(&monitor);\n      GP<ddjvu_message_p> p = new ddjvu_message_p;\n      p->p.m_progress.status = mystatus;\n      p->p.m_progress.percent = myprogress = x;\n      msg_push(xhead(DDJVU_PROGRESS,this),p);\n    }\n}\n\nddjvu_status_t\nddjvu_runnablejob_s::start()\n{\n  GMonitorLock lock(&monitor);\n  if (mystatus==DDJVU_JOB_NOTSTARTED && myctx)\n    {\n      GThread thr;\n      thr.create(cbstart, (void*)this);\n      monitor.wait();\n    }\n  return mystatus;\n}\n\nvoid\nddjvu_runnablejob_s::cbstart(void *arg)\n{\n  GP<ddjvu_runnablejob_s> self = (ddjvu_runnablejob_s*)arg;\n  {\n    GMonitorLock lock(&self->monitor);\n    self->mystatus = DDJVU_JOB_STARTED;\n    self->monitor.signal();\n  }\n  ddjvu_status_t r;\n  G_TRY\n    {\n      G_TRY\n        {\n          self->progress(0);\n          r = self->run();\n        }\n      G_CATCH(ex)\n        {\n          ERROR1(self, ex);\n          G_RETHROW;\n        }\n      G_ENDCATCH;\n    }\n  G_CATCH_ALL\n    {\n      r = DDJVU_JOB_FAILED;\n      if (self && self->mystop)\n        r = DDJVU_JOB_STOPPED;\n    }\n  G_ENDCATCH;\n  {\n    GMonitorLock lock(&self->monitor);\n    self->mystatus = r;\n  }\n  if (self && self->mystatus> DDJVU_JOB_OK)\n    self->progress(self->myprogress);\n  else\n    self->progress(100);\n}\n\nbool \nddjvu_runnablejob_s::inherits(const GUTF8String &classname)\n{\n  return (classname == \"ddjvu_runnablejob_s\") \n    || ddjvu_job_s::inherits(classname);\n}\n\nddjvu_status_t \nddjvu_runnablejob_s::status()\n{\n  return mystatus;\n}\n\nvoid\nddjvu_runnablejob_s::stop()\n{\n  mystop = true;\n}\n\n\n// ----------------------------------------\n// Printing\n\nstruct DJVUNS ddjvu_printjob_s : public ddjvu_runnablejob_s\n{\n  DjVuToPS printer;\n  GUTF8String pages;\n  GP<ByteStream> obs;\n  virtual ddjvu_status_t run();\n  // virtual port functions:\n  virtual bool inherits(const GUTF8String&);\n  // progress\n  static void cbrefresh(void*);\n  static void cbprogress(double, void*);\n  static void cbinfo(int, int, int, DjVuToPS::Stage, void*);\n  double progress_low;\n  double progress_high;\n};\n\nbool \nddjvu_printjob_s::inherits(const GUTF8String &classname)\n{\n  return (classname == \"ddjvu_printjob_s\") \n    || ddjvu_runnablejob_s::inherits(classname);\n}\n\nddjvu_status_t \nddjvu_printjob_s::run()\n{\n  mydoc->doc->wait_for_complete_init();\n  progress_low = 0;\n  progress_high = 1;\n  printer.set_refresh_cb(cbrefresh, (void*)this);\n  printer.set_dec_progress_cb(cbprogress, (void*)this);\n  printer.set_prn_progress_cb(cbprogress, (void*)this);\n  printer.set_info_cb(cbinfo, (void*)this);\n  printer.print(*obs, mydoc->doc, pages);\n  return DDJVU_JOB_OK;\n}\n\nvoid\nddjvu_printjob_s::cbrefresh(void *data)\n{\n  ddjvu_printjob_s *self = (ddjvu_printjob_s*)data;\n  if (self->mystop)\n    {\n      msg_push(xhead(DDJVU_INFO,self), msg_prep_info(\"Print job stopped\"));\n      G_THROW(DataPool::Stop);\n    }\n}\n\nvoid\nddjvu_printjob_s::cbprogress(double done, void *data)\n{\n  ddjvu_printjob_s *self = (ddjvu_printjob_s*)data;\n  double &low = self->progress_low;\n  double &high = self->progress_high;\n  double progress = low;\n  if (done >= 1)\n    progress = high;\n  else if (done >= 0)\n    progress = low + done * (high-low);\n  self->progress((int)(progress * 100));\n  ddjvu_printjob_s::cbrefresh(data);\n}\n\nvoid\nddjvu_printjob_s::cbinfo(int pnum, int pcnt, int ptot,\n                         DjVuToPS::Stage stage, void *data)\n{\n  ddjvu_printjob_s *self = (ddjvu_printjob_s*)data;\n  double &low = self->progress_low;\n  double &high = self->progress_high;\n  low = 0;\n  high = 1;\n  if (ptot > 0) \n    {\n      double step = 1.0 / (double)ptot;\n      low = (double)pcnt * step;\n      if (stage != DjVuToPS::DECODING) \n\tlow += step / 2.0;\n      high = low  + step / 2.0;\n    }\n  if (low < 0)\n    low = 0;\n  if (low > 1) \n    low = 1;\n  if (high < low) \n    high = low;\n  if (high > 1)\n    high = 1;\n  self->progress((int)(low * 100));\n  ddjvu_printjob_s::cbrefresh(data);\n}\n\nstatic void\ncomplain(GUTF8String opt, const char *msg)\n{\n  GUTF8String message;\n  if (opt.length() > 0)\n    message = \"Parsing \\\"\" + opt + \"\\\": \" + msg;\n  else\n    message = msg;\n  G_EMTHROW(GException((const char*)message));\n}\n\nddjvu_job_t *\nddjvu_document_print(ddjvu_document_t *document, FILE *output,\n                     int optc, const char * const * optv)\n{\n  ddjvu_printjob_s *job = 0;\n  G_TRY\n    {\n      job = new ddjvu_printjob_s;\n      ref(job);\n      job->myctx = document->myctx;\n      job->mydoc = document;\n      // parse options (see djvups(1))\n      DjVuToPS::Options &options = job->printer.options;\n      GUTF8String &pages = job->pages;\n      while (optc>0)\n        {\n          // normalize\n          GNativeString narg(optv[0]);\n          GUTF8String uarg = narg;\n          const char *s1 = (const char*)narg;\n          if (s1[0] == '-') s1++;\n          if (s1[0] == '-') s1++;\n          // separate arguments\n          const char *s2 = s1;\n          while (*s2 && *s2 != '=') s2++;\n          GUTF8String s( s1, s2-s1 );\n          GUTF8String arg( s2[0] && s2[1] ? s2+1 : \"\" );\n          // rumble!\n          if (s == \"page\" || s == \"pages\")\n            {\n              if (pages.length())\n                pages = pages + \",\";\n              pages = pages + arg;\n            }\n          else if (s == \"format\")\n            {\n              if (arg == \"ps\")\n                options.set_format(DjVuToPS::Options::PS);\n              else if (arg == \"eps\")\n                options.set_format(DjVuToPS::Options::EPS);\n              else\n                complain(uarg,\"Invalid format. Use \\\"ps\\\" or \\\"eps\\\".\");\n            }\n          else if (s == \"level\")\n            {\n              int endpos;\n              int lvl = arg.toLong(0, endpos);\n              if (endpos != (int)arg.length() || lvl < 1 || lvl > 4)\n                complain(uarg,\"Invalid Postscript language level.\");\n              options.set_level(lvl);\n            }\n          else if (s == \"orient\" || s == \"orientation\")\n            {\n              if (arg == \"a\" || arg == \"auto\" )\n                options.set_orientation(DjVuToPS::Options::AUTO);\n              else if (arg == \"l\" || arg == \"landscape\" )\n                options.set_orientation(DjVuToPS::Options::LANDSCAPE);\n              else if (arg == \"p\" || arg == \"portrait\" )\n                options.set_orientation(DjVuToPS::Options::PORTRAIT);\n              else\n                complain(uarg,\"Invalid orientation. Use \\\"auto\\\", \"\n                         \"\\\"landscape\\\" or \\\"portrait\\\".\");\n            }\n          else if (s == \"mode\")\n            {\n              if (arg == \"c\" || arg == \"color\" )\n                options.set_mode(DjVuToPS::Options::COLOR);\n              else if (arg == \"black\" || arg == \"bw\")\n                options.set_mode(DjVuToPS::Options::BW);\n              else if (arg == \"fore\" || arg == \"foreground\")\n                options.set_mode(DjVuToPS::Options::FORE);\n              else if (arg == \"back\" || arg == \"background\" )\n                options.set_mode(DjVuToPS::Options::BACK);\n              else\n                complain(uarg,\"Invalid mode. Use \\\"color\\\", \\\"bw\\\", \"\n                         \"\\\"foreground\\\", or \\\"background\\\".\");\n            }\n          else if (s == \"zoom\")\n            {\n              if (arg == \"auto\" || arg == \"fit\" || arg == \"fit_page\")\n                options.set_zoom(0);\n              else if (arg == \"1to1\" || arg == \"onetoone\")\n                options.set_zoom(100);                \n              else \n                {\n                  int endpos;\n                  int z = arg.toLong(0,endpos);\n                  if (endpos != (int)arg.length() || z < 25 || z > 2400)\n                    complain(uarg,\"Invalid zoom factor.\");\n                  options.set_zoom(z);\n                }\n            }\n          else if (s == \"color\")\n            {\n              if (arg == \"yes\" || arg == \"\")\n                options.set_color(true);\n              else if (arg == \"no\")\n                options.set_color(false);\n              else\n                complain(uarg,\"Invalid argument. Use \\\"yes\\\" or \\\"no\\\".\");\n            }\n          else if (s == \"gray\" || s == \"grayscale\")\n            {\n              if (arg.length())\n                complain(uarg,\"No argument was expected.\");\n              options.set_color(false);\n            }\n          else if (s == \"srgb\" || s == \"colormatch\")\n            {\n              if (arg == \"yes\" || arg == \"\")\n                options.set_sRGB(true);\n              else if (arg == \"no\")\n                options.set_sRGB(false);\n              else\n                complain(uarg,\"Invalid argument. Use \\\"yes\\\" or \\\"no\\\".\");\n            }\n          else if (s == \"gamma\")\n            {\n              int endpos;\n              double g = arg.toDouble(0,endpos);\n              if (endpos != (int)arg.length() || g < 0.3 || g > 5.0)\n                complain(uarg,\"Invalid gamma factor. \"\n                              \"Use a number in range 0.3 ... 5.0.\");\n              options.set_gamma(g);\n            }\n          else if (s == \"copies\")\n            {\n              int endpos;\n              int n = arg.toLong(0, endpos);\n              if (endpos != (int)arg.length() || n < 1 || n > 999999)\n                complain(uarg,\"Invalid number of copies.\");\n              options.set_copies(n);\n            }\n          else if (s == \"frame\")\n            {\n              if (arg == \"yes\" || arg == \"\")\n                options.set_frame(true);\n              else if (arg == \"no\")\n                options.set_frame(false);\n              else\n                complain(uarg,\"Invalid argument. Use \\\"yes\\\" or \\\"no\\\".\");\n            }\n          else if (s == \"cropmarks\")\n            {\n              if (arg == \"yes\" || arg == \"\")\n                options.set_cropmarks(true);\n              else if (arg == \"no\")\n                options.set_cropmarks(false);\n              else\n                complain(uarg,\"Invalid argument. Use \\\"yes\\\" or \\\"no\\\".\");\n            }\n          else if (s == \"text\")\n            {\n              if (arg == \"yes\" || arg == \"\")\n                options.set_text(true);\n              else if (arg == \"no\")\n                options.set_text(false);\n              else\n                complain(uarg,\"Invalid argument. Use \\\"yes\\\" or \\\"no\\\".\");\n            }\n          else if (s == \"booklet\")\n            {\n              if (arg == \"no\")\n                options.set_bookletmode(DjVuToPS::Options::OFF);\n              else if (arg == \"recto\")\n                options.set_bookletmode(DjVuToPS::Options::RECTO);\n              else if (arg == \"verso\")\n                options.set_bookletmode(DjVuToPS::Options::VERSO);\n              else if (arg == \"rectoverso\" || arg==\"yes\" || arg==\"\")\n                options.set_bookletmode(DjVuToPS::Options::RECTOVERSO);\n              else \n                complain(uarg,\"Invalid argument.\"\n                         \"Use \\\"no\\\", \\\"yes\\\", \\\"recto\\\", or \\\"verso\\\".\");\n            }\n          else if (s == \"bookletmax\")\n            {\n              int endpos;\n              int n = arg.toLong(0, endpos);\n              if (endpos != (int)arg.length() || n < 0 || n > 999999)\n                complain(uarg,\"Invalid argument.\");\n              options.set_bookletmax(n);\n            }\n          else if (s == \"bookletalign\")\n            {\n              int endpos;\n              int n = arg.toLong(0, endpos);\n              if (endpos != (int)arg.length() || n < -720 || n > +720)\n                complain(uarg,\"Invalid argument.\");\n              options.set_bookletalign(n);\n            }\n          else if (s == \"bookletfold\")\n            {\n              int endpos = 0;\n              int m = 250;\n              int n = arg.toLong(0, endpos);\n              if (endpos>0 && endpos<(int)arg.length() && arg[endpos]=='+')\n                m = arg.toLong(endpos+1, endpos);\n              if (endpos != (int)arg.length() || m<0 || m>720 || n<0 || n>9999 )\n                complain(uarg,\"Invalid argument.\");\n              options.set_bookletfold(n,m);\n            }\n          else\n            {\n              complain(uarg, \"Unrecognized option.\");\n            }\n          // Next option\n          optc -= 1;\n          optv += 1;\n        }\n      // go\n      job->obs = ByteStream::create(output, \"wb\", false);\n      job->start();\n    }\n  G_CATCH(ex)\n    {\n      if (job) \n        unref(job);\n      job = 0;\n      ERROR1(document, ex);\n    }\n  G_ENDCATCH;\n  return job;\n}\n\n\n\n// ----------------------------------------\n// Saving\n\nstruct DJVUNS ddjvu_savejob_s : public ddjvu_runnablejob_s\n{\n  GP<ByteStream> obs;\n  GURL           odir;  \n  GUTF8String    oname;\n  GUTF8String    pages;\n  GTArray<char>       comp_flags;\n  GArray<GUTF8String> comp_ids;\n  GPArray<DjVuFile>   comp_files;\n  GMonitor monitor;\n  // thread routine\n  virtual ddjvu_status_t run();\n  // virtual port functions:\n  virtual bool inherits(const GUTF8String&);\n  virtual void notify_file_flags_changed(const DjVuFile*, long, long);\n  // helpers\n  bool parse_pagespec(const char *s, int npages, bool *flags);\n  void mark_included_files(DjVuFile *file);\n};\n\nbool \nddjvu_savejob_s::inherits(const GUTF8String &classname)\n{\n  return (classname == \"ddjvu_savejob_s\") \n    || ddjvu_runnablejob_s::inherits(classname);\n}\n\nvoid\nddjvu_savejob_s::notify_file_flags_changed(const DjVuFile *file, \n                                           long mask, long)\n{\n  if (mask & (DjVuFile::ALL_DATA_PRESENT | DjVuFile::DATA_PRESENT |\n              DjVuFile::DECODE_FAILED | DjVuFile::DECODE_STOPPED |\n              DjVuFile::STOPPED | DjVuFile::DECODE_STOPPED ))\n    {\n      GMonitorLock lock(&monitor);\n      monitor.signal();\n    }\n}\n\nbool\nddjvu_savejob_s::parse_pagespec(const char *s, int npages, bool *flags)\n{\n  int spec = 0;\n  int both = 1;\n  int start_page = 1;\n  int end_page = npages;\n  int pageno;\n  char *p = (char*)s;\n  while (*p)\n    {\n      spec = 0;\n      while (*p==' ')\n        p += 1;\n      if (! *p)\n        break;\n      if (*p>='0' && *p<='9') {\n        end_page = strtol(p, &p, 10);\n        spec = 1;\n      } else if (*p=='$') {\n        spec = 1;\n        end_page = npages;\n        p += 1;\n      } else if (both) {\n        end_page = 1;\n      } else {\n        end_page = npages;\n      }\n      while (*p==' ')\n        p += 1;\n      if (both) {\n        start_page = end_page;\n        if (*p == '-') {\n          p += 1;\n          both = 0;\n          continue;\n        }\n      }\n      both = 1;\n      while (*p==' ')\n        p += 1;\n      if (*p && *p != ',')\n        return false;\n      if (*p == ',')\n        p += 1;\n      if (! spec)\n        return false;\n      if (end_page < 0)\n        end_page = 0;\n      if (start_page < 0)\n        start_page = 0;\n      if (end_page > npages)\n        end_page = npages;\n      if (start_page > npages)\n        start_page = npages;\n      if (start_page <= end_page)\n        for(pageno=start_page; pageno<=end_page; pageno++)\n          flags[pageno-1] = true;\n      else\n        for(pageno=start_page; pageno>=end_page; pageno--)\n          flags[pageno-1] = true;\n    }\n  if (!spec)\n    return false;\n  return true;\n}\n\nvoid \nddjvu_savejob_s::mark_included_files(DjVuFile *file)\n{\n  GP<DataPool> pool = file->get_init_data_pool();\n  GP<ByteStream> str(pool->get_stream());\n  GP<IFFByteStream> iff(IFFByteStream::create(str));\n  GUTF8String chkid;\n  if (!iff->get_chunk(chkid)) \n    return;\n  while (iff->get_chunk(chkid))\n    {\n      if (chkid == \"INCL\")\n        {\n          GP<ByteStream> incl = iff->get_bytestream();\n          GUTF8String fileid;\n          char buffer[1024];\n          int length;\n          while((length=incl->read(buffer, 1024)))\n            fileid += GUTF8String(buffer, length);\n          for (int i=0; i<comp_ids.size(); i++)\n            if (fileid == comp_ids[i] && !comp_flags[i])\n              comp_flags[i] = 1;\n        }\n      iff->close_chunk();\n    }\n  iff->close_chunk();\n  pool->clear_stream();\n}\n\nddjvu_status_t \nddjvu_savejob_s::run()\n{\n  DjVuDocument *doc = mydoc->doc;\n  doc->wait_for_complete_init();\n\n  // Determine which pages to save\n  int npages = doc->get_pages_num();\n  GTArray<bool> page_flags(0, npages-1);\n  if (!pages)\n    {\n      for (int pageno=0; pageno<npages; pageno++)\n        page_flags[pageno] = true;\n    }\n  else\n    {\n      const char *s = pages;\n      while (*s && *s!='=')\n        s += 1;\n      for (int pageno=0; pageno<npages; pageno++)\n        page_flags[pageno] = false;\n      if ((*s != '=') || !parse_pagespec(s+1, npages, (bool*)page_flags))\n        complain(pages,\"Illegal page specification\");\n      if (doc->get_doc_type()==DjVuDocument::OLD_BUNDLED ||\n          doc->get_doc_type()==DjVuDocument::OLD_INDEXED )\n        complain(pages,\"Saving subsets of obsolete formats is not supported\");\n    }\n  \n  // Determine which component files to save\n  int ncomps;\n  if (doc->get_doc_type()==DjVuDocument::BUNDLED ||\n      doc->get_doc_type()==DjVuDocument::INDIRECT)\n    {\n      GP<DjVmDir> dir = doc->get_djvm_dir();\n      ncomps = dir->get_files_num();\n      comp_ids.resize(ncomps - 1);\n      comp_flags.resize(ncomps - 1);\n      comp_files.resize(ncomps - 1);\n      int pageno = 0;\n      GPList<DjVmDir::File> flist = dir->get_files_list();\n      GPosition pos=flist;\n      for (int comp=0; comp<ncomps; ++pos, ++comp)\n        {\n          DjVmDir::File *file = flist[pos];\n          comp_ids[comp] = file->get_load_name();\n          comp_flags[comp] = 0;\n          if (file->is_page() && page_flags[pageno++])\n            comp_flags[comp] = 1;\n        }\n    }\n  else\n    {\n      ncomps = npages;\n      comp_flags.resize(ncomps - 1);\n      comp_files.resize(ncomps - 1);\n      for (int comp=0; comp<ncomps; ++comp)\n        comp_flags[comp] = page_flags[comp];\n    }\n  \n  // Download\n  get_portcaster()->add_route(doc, this);\n  while (!mystop)\n    {\n      int comp;\n      int wanted = 0;\n      int loaded = 0;\n      int asked = 0;\n      for (comp=0; comp<ncomps; comp++)\n        {\n          int flags = comp_flags[comp];\n          if (flags > 2)\n            loaded += 1;\n          else if (flags < 2)\n            continue;\n          else if (!comp_files[comp]->is_data_present())\n            asked += 1;\n          else \n            {\n              comp_flags[comp] += 1;\n              mark_included_files(comp_files[comp]);\n            } \n        }\n      for (comp=0; comp<ncomps; comp++)\n        if (comp_flags[comp] > 0)\n          wanted += 1;\n      progress(loaded * 100 / wanted);\n      if (wanted == loaded)\n        break;\n      for (comp=0; comp<ncomps && asked < 2; comp++)\n        if (comp_flags[comp] == 1)\n          {\n            if (comp_ids.size() > 0)\n              comp_files[comp] = doc->get_djvu_file(comp_ids[comp]);\n            else\n              comp_files[comp] = doc->get_djvu_file(comp);\n            comp_flags[comp] += 1;\n            if (!comp_files[comp]->is_data_present())\n              asked += 1;\n          }\n      GMonitorLock lock(&monitor);\n      for (comp=0; comp<ncomps; comp++)\n        if (comp_flags[comp] == 2)\n          if (! comp_files[comp]->is_data_present())\n            {\n              monitor.wait();\n              break;\n            }\n    }\n  if (mystop)\n    G_THROW(DataPool::Stop);\n  // Saving!\n  GP<DjVmDoc> djvm;\n  if (! pages)\n    {\n      djvm = doc->get_djvm_doc();\n    }\n  else\n    {\n      djvm = DjVmDoc::create();\n      GP<DjVmDir> dir = doc->get_djvm_dir();\n      GPList<DjVmDir::File> flist = dir->get_files_list();\n      GPosition pos=flist;\n      int pageno = 0;\n      for (int comp=0; comp<ncomps; ++pos, ++comp)\n        {\n          if (flist[pos]->is_page())\n            pageno += 1;\n          if (comp_flags[comp])\n            {\n              GP<DjVmDir::File> f = new DjVmDir::File(*flist[pos]);\n              if (f->is_page() && f->get_save_name()==f->get_title())\n                f->set_title(GUTF8String(pageno));\n              GP<DjVuFile> file = comp_files[comp];\n              GP<DataPool> data = file->get_init_data_pool();\n              djvm->insert_file(f, data);\n            }\n        }\n    }\n  if (obs)\n    djvm->write(obs);\n  else if (odir.is_valid() && oname.length() > 0)\n    djvm->expand(odir, oname);\n  return DDJVU_JOB_OK;\n}\n\n\nddjvu_job_t *\nddjvu_document_save(ddjvu_document_t *document, FILE *output, \n                    int optc, const char * const * optv)\n{\n  ddjvu_savejob_s *job = 0;\n  G_TRY\n    {\n      job = new ddjvu_savejob_s;\n      ref(job);\n      job->myctx = document->myctx;\n      job->mydoc = document;\n      bool indirect = false;\n      // parse options\n      while (optc>0)\n        {\n          GNativeString narg(optv[0]);\n          GUTF8String uarg = narg;\n          const char *s1 = (const char*)narg;\n          if (s1[0] == '-') s1++;\n          if (s1[0] == '-') s1++;\n          // separate arguments\n          if (!strncmp(s1, \"page=\", 5) ||\n              !strncmp(s1, \"pages=\", 6) )\n            {\n              if (job->pages.length())\n                complain(uarg,\"multiple page specifications\");\n              job->pages = uarg;\n            }\n          else if (!strncmp(s1, \"indirect=\", 9))\n            {\n              GURL oname = GURL::Filename::UTF8(s1 + 9);\n              job->odir = oname.base();\n              job->oname = oname.fname();\n              indirect = true;\n            }\n          else\n            {\n              complain(uarg, \"Unrecognized option.\");\n            }\n          // next option\n          optc -= 1;\n          optv += 1;\n        }\n      // go\n      if (!indirect)\n        job->obs = ByteStream::create(output, \"wb\", false);\n      else \n        job->obs = 0;\n      job->start();\n    }\n  G_CATCH(ex)\n    {\n      if (job) \n        unref(job);\n      job = 0;\n      ERROR1(document, ex);\n    }\n  G_ENDCATCH;\n  return job;\n}\n\n\n\n\n// ----------------------------------------\n// S-Expressions (generic)\n\nstatic miniexp_t\nminiexp_status(ddjvu_status_t status)\n{\n  if (status < DDJVU_JOB_OK)\n    return miniexp_dummy;\n  else if (status == DDJVU_JOB_STOPPED)\n    return miniexp_symbol(\"stopped\");\n  else if (status > DDJVU_JOB_OK)\n    return miniexp_symbol(\"failed\");    \n  return miniexp_nil;\n}\n\nstatic void\nminiexp_protect(ddjvu_document_t *document, miniexp_t expr)\n{\n  { // extra nesting for windows\n    for(miniexp_t p=document->protect; miniexp_consp(p); p=miniexp_cdr(p))\n      if (miniexp_car(p) == expr)\n        return;\n  }\n  if (miniexp_consp(expr) || miniexp_objectp(expr))\n    document->protect = miniexp_cons(expr, document->protect);\n}\n\nvoid\nddjvu_miniexp_release(ddjvu_document_t *document, miniexp_t expr)\n{\n  miniexp_t q = miniexp_nil;\n  miniexp_t p = document->protect;\n  while (miniexp_consp(p))\n    {\n      if (miniexp_car(p) != expr)\n        q = p;\n      else if (q)\n        miniexp_rplacd(q, miniexp_cdr(p));\n      else\n        document->protect = miniexp_cdr(p);\n      p = miniexp_cdr(p);\n    }\n}\n\n\n\n// ----------------------------------------\n// S-Expressions (outline)\n\nstatic miniexp_t\noutline_sub(const GP<DjVmNav> &nav, int &pos, int count)\n{\n  GP<DjVmNav::DjVuBookMark> entry;\n  minivar_t p,q,s;\n  while (count > 0 && pos < nav->getBookMarkCount())\n    {\n      nav->getBookMark(entry, pos++);\n      q = outline_sub(nav, pos, entry->count);\n      s = miniexp_string((const char*)(entry->url));\n      q = miniexp_cons(s, q);\n      s = miniexp_string((const char*)(entry->displayname));\n      q = miniexp_cons(s, q);\n      p = miniexp_cons(q, p);\n      count--;\n    }\n  return miniexp_reverse(p);\n}\n\nminiexp_t\nddjvu_document_get_outline(ddjvu_document_t *document)\n{\n  G_TRY\n    {\n      ddjvu_status_t status = document->status();\n      if (status != DDJVU_JOB_OK)\n        return miniexp_status(status);\n      DjVuDocument *doc = document->doc;\n      if (doc)\n        {\n          GP<DjVmNav> nav = doc->get_djvm_nav();\n          if (! nav) \n            return miniexp_nil;\n          minivar_t result;\n          int pos = 0;\n          result = outline_sub(nav, pos, nav->getBookMarkCount());\n          result = miniexp_cons(miniexp_symbol(\"bookmarks\"), result);\n          miniexp_protect(document, result);\n          return result;\n        }\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(document, ex);\n    }\n  G_ENDCATCH;\n  return miniexp_status(DDJVU_JOB_FAILED);\n}\n\n\n\n\n// ----------------------------------------\n// S-Expressions (text)\n\nstatic struct zone_names_s {\n  const char *name;\n  DjVuTXT::ZoneType ztype;\n  char separator;\n} zone_names[] = {\n  { \"page\",   DjVuTXT::PAGE,      0 },\n  { \"column\", DjVuTXT::COLUMN,    DjVuTXT::end_of_column },\n  { \"region\", DjVuTXT::REGION,    DjVuTXT::end_of_region },\n  { \"para\",   DjVuTXT::PARAGRAPH, DjVuTXT::end_of_paragraph },\n  { \"line\",   DjVuTXT::LINE,      DjVuTXT::end_of_line },\n  { \"word\",   DjVuTXT::WORD,      ' ' },\n  { \"char\",   DjVuTXT::CHARACTER, 0 },\n  { 0, (DjVuTXT::ZoneType)0 ,0 }\n};\n\nstatic miniexp_t\npagetext_sub(const GP<DjVuTXT> &txt, DjVuTXT::Zone &zone, \n             DjVuTXT::ZoneType detail)\n{\n  int zinfo;\n  for (zinfo=0; zone_names[zinfo].name; zinfo++)\n    if (zone.ztype == zone_names[zinfo].ztype)\n      break;\n  minivar_t p;\n  minivar_t a;\n  bool gather = zone.children.isempty();\n  { // extra nesting for windows\n    for (GPosition pos=zone.children; pos; ++pos)\n      if (zone.children[pos].ztype > detail)\n        gather = true;\n  }\n  if (gather)\n    {\n      const char *data = (const char*)(txt->textUTF8) + zone.text_start;\n      int length = zone.text_length;\n      if (length>0 && data[length-1]==zone_names[zinfo].separator)\n        length -= 1;\n      a = miniexp_substring(data, length);\n      p = miniexp_cons(a, p);\n    }\n  else\n    {\n      for (GPosition pos=zone.children; pos; ++pos)\n        {\n          a = pagetext_sub(txt, zone.children[pos], detail);\n          p = miniexp_cons(a, p);\n        }\n    }\n  p = miniexp_reverse(p);\n  const char *s = zone_names[zinfo].name;\n  if (s)\n    {\n      p = miniexp_cons(miniexp_number(zone.rect.ymax), p);\n      p = miniexp_cons(miniexp_number(zone.rect.xmax), p);\n      p = miniexp_cons(miniexp_number(zone.rect.ymin), p);\n      p = miniexp_cons(miniexp_number(zone.rect.xmin), p);\n      p = miniexp_cons(miniexp_symbol(s), p);\n      return p;\n    }\n  return miniexp_nil;\n}\n\nminiexp_t\nddjvu_document_get_pagetext(ddjvu_document_t *document, int pageno,\n                            const char *maxdetail)\n{\n  G_TRY\n    {\n      ddjvu_status_t status = document->status();\n      if (status != DDJVU_JOB_OK)\n        return miniexp_status(status);\n      DjVuDocument *doc = document->doc;\n      if (doc)\n        {\n          document->pageinfoflag = true;\n          GP<DjVuFile> file = doc->get_djvu_file(pageno);\n          if (! file || ! file->is_data_present() )\n            return miniexp_dummy;\n          GP<ByteStream> bs = file->get_text();\n          if (! bs)\n            return miniexp_nil;\n          GP<DjVuText> text = DjVuText::create();\n          text->decode(bs);\n          GP<DjVuTXT> txt = text->txt;\n          if (! txt)\n            return miniexp_nil;\n          minivar_t result;\n          DjVuTXT::ZoneType detail = DjVuTXT::CHARACTER;\n          { // extra nesting for windows\n            for (int i=0; zone_names[i].name; i++)\n              if (maxdetail && !strcmp(maxdetail, zone_names[i].name))\n                detail = zone_names[i].ztype;\n          }\n          result = pagetext_sub(txt, txt->page_zone, detail);\n          miniexp_protect(document, result);\n          return result;\n        }\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(document, ex);\n    }\n  G_ENDCATCH;\n  return miniexp_status(DDJVU_JOB_FAILED);\n}\n\n\n// ----------------------------------------\n// S-Expressions (annotations)\n\n// The difficulty here lies with the syntax of strings in annotation chunks.\n// - Early versions of djvu only had one possible escape \n//   sequence (\\\") in annotation strings. All other characters\n//   are accepted literally until reaching the closing double quote.\n// - Current versions of djvu understand the usual backslash escapes.\n//   All non printable ascii characters must however be escaped.\n//   This is a subset of the miniexp syntax.\n// We first check if strings in the annotation chunk obey the modern syntax.\n// The compatibility mode is turned on if they contain non printable ascii \n// characters or illegal backslash sequences. Function <anno_getc()> then \n// creates the proper escapes on the fly.\n\n\nstruct anno_dat_s {\n  const char *s;\n  char buf[8];\n  int  blen;\n  int  state;\n  bool compat;\n  bool eof;\n};\n\n\nstatic bool\nanno_compat(const char *s)\n{\n  int state = 0;\n  bool compat = false;\n  while (s && *s && !compat)\n    {\n      int i = (int)(unsigned char)*s++;\n      switch(state)\n        {\n        case 0:\n          if (i == '\\\"')\n            state = '\\\"';\n          break;\n        case '\\\"':\n          if (i == '\\\"')\n            state = 0;\n          else if (i == '\\\\')\n            state = '\\\\';\n          else if (isascii(i) && !isprint(i))\n            compat = true;\n          break;\n        case '\\\\':\n          if (!strchr(\"01234567abtnvfr\\\"\\\\\",i))\n            compat = true;\n          state = '\\\"';\n          break;\n        }\n    }\n  return compat;\n}\n\n\nstatic int\nanno_fgetc(miniexp_io_t *io)\n{\n  struct anno_dat_s *anno_dat_p = (struct anno_dat_s*)(io->data[0]);\n  struct anno_dat_s &anno_dat = *anno_dat_p;\n  if (anno_dat.blen>0)\n    {\n      anno_dat.blen--;\n      char c = anno_dat.buf[0];\n      for (int i=0; i<anno_dat.blen; i++)\n        anno_dat.buf[i] = anno_dat.buf[i+1];\n      return c;\n    }\n  if (! *anno_dat.s)\n    return EOF;\n  int c = (int)(unsigned char)*anno_dat.s++;\n  if (anno_dat.compat)\n    {\n      switch (anno_dat.state)\n        {\n        case 0:\n          if (c == '\\\"') \n            anno_dat.state = '\\\"';\n          break;\n        case '\\\"':\n          if (c == '\\\"') \n            anno_dat.state = 0;\n          else if (c == '\\\\')\n            anno_dat.state = '\\\\';\n          else if (isascii(c) && !isprint(c))\n            {\n              sprintf(anno_dat.buf,\"%03o\", c);\n              anno_dat.blen = strlen(anno_dat.buf);\n              c = '\\\\';\n            }\n          break;\n        case '\\\\':\n          anno_dat.state = '\\\"';\n          if (c != '\\\"')\n            {\n              sprintf(anno_dat.buf,\"\\\\%03o\", c);\n              anno_dat.blen = strlen(anno_dat.buf);\n              c = '\\\\';\n            }\n          break;\n        }\n    }\n  return c;\n}\n\n\nstatic int\nanno_ungetc(miniexp_io_t *io, int c)\n{\n  if (c == EOF)\n    return EOF;\n  struct anno_dat_s *anno_dat_p = (struct anno_dat_s*)(io->data[0]);\n  struct anno_dat_s &anno_dat = *anno_dat_p;\n  if (anno_dat.blen>=(int)sizeof(anno_dat.buf))\n    return EOF;\n  for (int i=anno_dat.blen; i>0; i--)\n    anno_dat.buf[i] = anno_dat.buf[i-1];\n  anno_dat.blen += 1;\n  anno_dat.buf[0] = c;\n  return c;\n}\n\n\nstatic void\nanno_sub(ByteStream *bs, miniexp_t &result)\n{\n  // Read bs\n  GUTF8String raw;\n  char buffer[1024];\n  int length;\n  while ((length=bs->read(buffer, sizeof(buffer))))\n    raw += GUTF8String(buffer, length);\n  // Prepare \n  miniexp_t a;\n  struct anno_dat_s anno_dat;\n  anno_dat.s = (const char*)raw;\n  anno_dat.compat = anno_compat(anno_dat.s);\n  anno_dat.blen = 0;\n  anno_dat.state = 0;\n  anno_dat.eof = false;\n  miniexp_io_t io;\n  miniexp_io_init(&io);\n  io.data[0] = (void*)&anno_dat;\n  io.fgetc = anno_fgetc;\n  io.ungetc = anno_ungetc;\n  io.p_macrochar = 0;\n  io.p_diezechar = 0;\n  io.p_macroqueue = 0;\n  // Read\n  while (* anno_dat.s )\n    if ((a = miniexp_read_r(&io)) != miniexp_dummy)\n      result = miniexp_cons(a, result);\n}\n\n\nstatic miniexp_t\nget_bytestream_anno(GP<ByteStream> annobs)\n{\n  if (! (annobs && annobs->size()))\n    return miniexp_nil;\n  GP<IFFByteStream> iff = IFFByteStream::create(annobs);\n  GUTF8String chkid;\n  minivar_t result;\n  while (iff->get_chunk(chkid))\n    {\n      GP<ByteStream> bs;\n      if (chkid == \"ANTa\") \n        bs = iff->get_bytestream();\n      else if (chkid == \"ANTz\")\n        bs = BSByteStream::create(iff->get_bytestream());\n      if (bs)\n        anno_sub(bs, result);\n      iff->close_chunk();\n    }\n  return miniexp_reverse(result);\n}\n\n\nstatic miniexp_t\nget_file_anno(GP<DjVuFile> file)\n{\n  // Make sure all data is present\n  if (! file || ! file->is_all_data_present())\n    {\n      if (file && file->is_data_present())\n        {\n          if (! file->are_incl_files_created())\n            file->process_incl_chunks();\n          if (! file->are_incl_files_created())\n            {\n              if (file->get_flags() & DjVuFile::STOPPED)\n                return miniexp_status(DDJVU_JOB_STOPPED);\n              return miniexp_status(DDJVU_JOB_FAILED);\n            }\n          /* SumatraPDF: TODO: how to prevent a potentially infinite loop? */\n          return miniexp_status(DDJVU_JOB_FAILED);\n        }\n      return miniexp_dummy;\n    }\n  // Access annotation data\n  return get_bytestream_anno(file->get_merged_anno());\n}\n\n\nminiexp_t\nddjvu_document_get_pageanno(ddjvu_document_t *document, int pageno)\n{\n  G_TRY\n    {\n      ddjvu_status_t status = document->status();\n      if (status != DDJVU_JOB_OK)\n        return miniexp_status(status);\n      DjVuDocument *doc = document->doc;\n      if (doc)\n        {\n          document->pageinfoflag = true;\n          minivar_t result = get_file_anno( doc->get_djvu_file(pageno) );\n          if (miniexp_consp(result))\n            miniexp_protect(document, result);\n          return result;\n        }\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(document, ex);\n    }\n  G_ENDCATCH;\n  return miniexp_status(DDJVU_JOB_FAILED);\n}\n\n\nminiexp_t\nddjvu_document_get_anno(ddjvu_document_t *document, int compat)\n{\n  G_TRY\n    {\n      ddjvu_status_t status = document->status();\n      if (status != DDJVU_JOB_OK)\n        return miniexp_status(status);\n      DjVuDocument *doc = document->doc;\n      if (doc)\n        {\n#if EXPERIMENTAL_DOCUMENT_ANNOTATIONS\n          // not yet implemented\n          GP<ByteStream> anno = doc->get_document_anno();\n          if (anno)\n            return get_bytestream_anno(anno);\n#endif\n          if (compat)\n            {\n              // look for shared annotations\n              int doc_type = doc->get_doc_type();\n              if (doc_type != DjVuDocument::BUNDLED &&\n                  doc_type != DjVuDocument::INDIRECT )\n                return miniexp_nil;\n              GP<DjVmDir> dir = doc->get_djvm_dir();\n              int filenum = dir->get_files_num();\n              GP<DjVmDir::File> fdesc;\n              for (int i=0; i<filenum; i++)\n                {\n                  GP<DjVmDir::File> f = dir->pos_to_file(i);\n                  if (!f->is_shared_anno())\n                    continue;\n                  if (fdesc)\n                    return miniexp_nil;\n                  fdesc = f;\n                }\n              if (fdesc)\n                {\n                  GUTF8String id = fdesc->get_load_name();\n                  return get_file_anno(doc->get_djvu_file(id));\n                }\n            }\n          return miniexp_nil;\n        }\n    }\n  G_CATCH(ex)\n    {\n      ERROR1(document, ex);\n    }\n  G_ENDCATCH;\n  return miniexp_status(DDJVU_JOB_FAILED);\n}\n\n\n\n\n/* ------ helpers for annotations ---- */\n\nstatic const char *\nsimple_anno_sub(miniexp_t p, miniexp_t s, int i)\n{\n  const char *result = 0;\n  while (miniexp_consp(p))\n    {\n      miniexp_t a = miniexp_car(p);\n      p = miniexp_cdr(p);\n      if (miniexp_car(a) == s)\n        {\n          miniexp_t q = miniexp_nth(i, a);\n          if (miniexp_symbolp(q))\n            result = miniexp_to_name(q);\n        }\n    }\n  return result;\n}\n\nconst char *\nddjvu_anno_get_bgcolor(miniexp_t p)\n{\n  return simple_anno_sub(p, miniexp_symbol(\"background\"), 1);\n}\n\nconst char *\nddjvu_anno_get_zoom(miniexp_t p)\n{\n  return simple_anno_sub(p, miniexp_symbol(\"zoom\"), 1);\n}\n\nconst char *\nddjvu_anno_get_mode(miniexp_t p)\n{\n  return simple_anno_sub(p, miniexp_symbol(\"mode\"), 1);\n}\n\nconst char *\nddjvu_anno_get_horizalign(miniexp_t p)\n{\n  return simple_anno_sub(p, miniexp_symbol(\"align\"), 1);\n}\n\nconst char *\nddjvu_anno_get_vertalign(miniexp_t p)\n{\n  return simple_anno_sub(p, miniexp_symbol(\"align\"), 2);\n}\n\nminiexp_t *\nddjvu_anno_get_hyperlinks(miniexp_t annotations)\n{\n  miniexp_t p;\n  miniexp_t s_maparea = miniexp_symbol(\"maparea\");\n  int i = 0;\n  for (p = annotations; miniexp_consp(p); p = miniexp_cdr(p))\n    if (miniexp_caar(p) == s_maparea)\n      i += 1;\n  miniexp_t *k = (miniexp_t*)malloc((1+i)*sizeof(miniexp_t));\n  if (! k) return 0;\n  i = 0;\n  for (p = annotations; miniexp_consp(p); p = miniexp_cdr(p))\n    if (miniexp_caar(p) == s_maparea)\n      k[i++] = miniexp_car(p);\n  k[i] = 0;\n  return k;\n}\n\nstatic void\nmetadata_sub(miniexp_t p, GMap<miniexp_t,miniexp_t> &m)\n{\n  miniexp_t s_metadata = miniexp_symbol(\"metadata\");\n  while (miniexp_consp(p))\n    {\n      if (miniexp_caar(p) == s_metadata)\n        {\n          miniexp_t q = miniexp_cdar(p);\n          while (miniexp_consp(q))\n            {\n              miniexp_t a = miniexp_car(q);\n              q = miniexp_cdr(q);\n              if (miniexp_consp(a) && \n                  miniexp_symbolp(miniexp_car(a)) &&\n                  miniexp_stringp(miniexp_cadr(a)) )\n                {\n                  m[miniexp_car(a)] = miniexp_cadr(a);\n                }\n            }\n        }\n      p = miniexp_cdr(p);\n    }\n}\n\nminiexp_t *\nddjvu_anno_get_metadata_keys(miniexp_t p)\n{\n  minivar_t l;\n  GMap<miniexp_t,miniexp_t> m;\n  metadata_sub(p, m);\n  int i = m.size();\n  miniexp_t *k = (miniexp_t*)malloc((1+i)*sizeof(miniexp_t));\n  if (! k) return 0;\n  i = 0;\n  { // extra nesting for windows\n    for (GPosition p=m; p; ++p)\n      k[i++] = m.key(p);\n  }\n  k[i] = 0;\n  return k;\n}\n\nconst char *\nddjvu_anno_get_metadata(miniexp_t p, miniexp_t key)\n{\n  GMap<miniexp_t,miniexp_t> m;\n  metadata_sub(p, m);\n  if (m.contains(key))\n    return miniexp_to_str(m[key]);\n  return 0;\n}\n\nconst char *\nddjvu_anno_get_xmp(miniexp_t p)\n{\n  miniexp_t s = miniexp_symbol(\"xmp\");\n  while (miniexp_consp(p))\n    {\n      miniexp_t a = miniexp_car(p);\n      p = miniexp_cdr(p);\n      if (miniexp_car(a) == s)\n        {\n          miniexp_t q = miniexp_nth(1, a);\n          if (miniexp_stringp(q))\n            return miniexp_to_str(q);\n        }\n    }\n  return 0;\n}\n\n\n// ----------------------------------------\n// Backdoors\n\nGP<DjVuImage>\nddjvu_get_DjVuImage(ddjvu_page_t *page)\n{\n  return page->img;\n}\n\n\nGP<DjVuDocument>\nddjvu_get_DjVuDocument(ddjvu_document_t *document)\n{\n  return document->doc;\n}\n\n\n/* SumatraPDF: access to free() mirroring malloc() above */\nvoid ddjvu_free(void *ptr)\n{\n  free(ptr);\n}\n"
  },
  {
    "path": "ext/libdjvu/ddjvuapi.h",
    "content": "/* \n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n*/\n\n#ifndef DDJVUAPI_H\n#define DDJVUAPI_H\n\n#ifdef __cplusplus\nextern \"C\" { \n#endif\n#if 0\n}\n#endif\n\n#include <stddef.h>\n#include <stdlib.h>\n#include <stdio.h>\n\n#ifndef DDJVUAPI\n# ifdef WIN32\n#  ifdef DLL_EXPORT\n#   define DDJVUAPI __declspec(dllexport)\n#  else\n#   define DDJVUAPI __declspec(dllimport)\n#  endif\n# endif\n#endif\n#ifndef DDJVUAPI\n# define DDJVUAPI /**/\n#endif\n\n#ifndef TRUE\n# define TRUE  (1)\n#endif\n\n#ifndef FALSE\n# define FALSE (0)\n#endif\n\n\n\n/* -------------------------------------------------- */\n/* DDJVU API                                          */\n/* -------------------------------------------------- */\n\n/* The DDJVU API provides for efficiently decoding and\n   displaying DjVu documents.  It provides for displaying\n   images without waiting for the complete DjVu data. Images\n   can be displayed as soon as sufficient data is\n   available. A higher quality image might later be\n   displayed when further data is available.  The DjVu\n   library achieves this using a complicated scheme\n   involving multiple threads. The DDJVU API hides this\n   complexity with a familiar event model.\n*/\n\n/* Compiler symbol DDJVUAPI_VERSION tracks \n   backward compatible additions to the DDJVU API.\n\n   Version   Change\n   -----------------------------\n     21    Added:\n              reentrant version of miniexp input/output\n     20    Added:\n              ddjvu_get_version_string()\n              ddjvu_format_set_white()\n              ddjvu_anno_get_xmp()\n     19    Added:\n              ddjvu_document_create_by_filename_utf8()\n     18    Added:\n              ddjvu_document_get_{anno,pagedump,filedump}()\n           Modifed (binary compatible):\n              ddjvu_document_get_{fileinfo,pageinfo}()   \n              ddjvu_document_save() [--pages, --indirect=]\n           Deprecated:\n              ddjvu_document_search_pageno()\n              ddjvu_page_get_{short,long}_description()\n     17    Added:\n              ddjvu_page_get_initial_rotation(), ddjvu_code_get_version()\n              ddjvu_document_{get_filenum,get_fileinfo}}()\n              ddjvu_document_{search_pageno,check_pagedata}()\n              ddjvu_rectmapper_t and related functions.\n     16    Added:\n              miniexp.h and related functions.\n     15    Added:\n              ddjvu_document_get_pageinfo()\n              ddjvu_document_print()\n     14    Initial version.\n*/\n\n#define DDJVUAPI_VERSION 21\n\ntypedef struct ddjvu_context_s    ddjvu_context_t;\ntypedef union  ddjvu_message_s    ddjvu_message_t;\ntypedef struct ddjvu_job_s        ddjvu_job_t;\ntypedef struct ddjvu_document_s   ddjvu_document_t;\ntypedef struct ddjvu_page_s       ddjvu_page_t;\ntypedef struct ddjvu_format_s     ddjvu_format_t;\ntypedef struct ddjvu_rect_s       ddjvu_rect_t;\ntypedef struct ddjvu_rectmapper_s ddjvu_rectmapper_t;\n\n\n/* GENERAL CONVENTIONS:\n\n   - all strings use locale encoding (unless specified otherwise).\n   - all filenames are unencoded byte strings,\n   - all errors are signaled with error event messages,\n   - all functions returning a pointer might return a null pointer.\n\n   HEADER:\n   Always use the following idiom to include this file.\n\n     #include <libdjvu/ddjvuapi.h>\n     #include <libdjvu/miniexp.h>\n\n   This file does not declare functions ddjvu_get_DjVuImage() \n   and djvu_get_DjVuDocument() unless you include files \n   \"DjVuImage.h\" and \"DjVuDocument.h\" before this file.\n\n   PREREQUISITES:\n   - Please read the djvu man page: <\"tools/djvu.1\">.\n   - Please browse the file format specifications \n     <\"doc/djvu3changes.txt\"> and <\"doc/djvu3spec.djvu\">.\n*/\n\n  \n\n/* -------------------------------------------------- */\n/* DDJVU_CONTEXT_T                                    */\n/* -------------------------------------------------- */\n\n/* There is usually only one <ddjvu_context_t> object.  \n   This object holds global data structures such as the \n   cache of decoded pages, or the list of pending \n   event messages.\n */\n\n\n\n/* ddjvu_get_version_string() ---\n   Returns a string that described the underlying code. */\n\nDDJVUAPI const char*\nddjvu_get_version_string(void);\n\n\n/* ddjvu_context_create ---\n   Creates a <ddjvu_context_t> object.\n   Argument <programname> is the name of the calling executable. */\n\nDDJVUAPI ddjvu_context_t *\nddjvu_context_create(const char *programname);\n\n\n/* ddjvu_context_release ---\n   Release a reference to a <ddjvu_context_t> object.\n   The calling program should no longer reference this object.\n   The object itself will be destroyed as soon as no other object\n   or thread needs it. */\n\nDDJVUAPI void \nddjvu_context_release(ddjvu_context_t *context);\n\n\n\n\n\n/* ------- CACHE ------- */\n\n/* ddjvu_cache_set_size ---\n   Sets the maximum size of the cache of decoded page data.\n   The argument is expressed in bytes. */\n\nDDJVUAPI void\nddjvu_cache_set_size(ddjvu_context_t *context,\n                     unsigned long cachesize);\n\n\n/* ddjvu_cache_get_size ---\n   Returns the maximum size of the cache. */\n\nDDJVUAPI unsigned long\nddjvu_cache_get_size(ddjvu_context_t *context);\n\n\n/* ddjvu_cache_clear ---\n   Clears all cached data. */\n\nDDJVUAPI void\nddjvu_cache_clear(ddjvu_context_t *context);\n\n\n\n/* ------- MESSAGE QUEUE ------- */\n\n/* Messages produced by the ddjvu api accumulate into\n   the message queue. Processing messages is not optional!\n   A typical message handling routine looks like this:\n   \n   void handle_ddjvu_messages(ddjvu_context_t *ctx, int wait)\n   {\n     const ddjvu_message_t *msg;\n     if (wait)\n       ddjvu_message_wait(ctx);\n     while ((msg = ddjvu_message_peek(ctx)))\n     {\n       switch(msg->m_any.tag)\n       { \n       case DDJVU_ERROR:      .... ; break;\n       case DDJVU_INFO:       .... ; break;\n       case DDJVU_NEWSTREAM:  .... ; break;\n       ....\n       default: break;\n       }\n       ddjvu_message_pop(ctx);\n     }\n   }\n*/\n\n\n/* ddjvu_message_peek ---\n   Returns a pointer to the next DDJVU message.\n   This function returns 0 if no message is available.\n   It does not remove the message from the queue. */\n\nDDJVUAPI ddjvu_message_t *\nddjvu_message_peek(ddjvu_context_t *context);\n\n\n/* ddjvu_message_wait ---\n   Returns a pointer to the next DDJVU message.\n   This function waits until a message is available.\n   It does not remove the message from the queue. */\n\nDDJVUAPI ddjvu_message_t *\nddjvu_message_wait(ddjvu_context_t *context);\n\n\n/* ddjvu_message_pop ---\n   Removes one message from the queue.\n   This function must be called after processing the message.\n   Pointers returned by previous calls to <ddjvu_message_peek> \n   or <ddjvu_message_wait> are no longer valid after \n   calling <ddjvu_message_pop>. */\n\nDDJVUAPI void\nddjvu_message_pop(ddjvu_context_t *context);\n\n\n/* ddjvu_message_set_callback ---\n   Defines a callback function invoked whenever\n   a new message is posted to the ddjvuapi message queue,\n   and returns a pointer to the previous callback function.\n   This callback function can be called at any time\n   while other code is executing. Do not call ddjvuapi\n   functions from this callback. It should simply signal\n   the main application event loop that new ddjvuapi messages\n   are available.  Under WIN32, this is usually achieved\n   by posting a user window message.  Under UNIX, this is\n   usually achieved using a pipe: the callback writes \n   a single byte into the pipe; the main application loop\n   monitors the reading end of the pipe and detects\n   the presence of data. */\n\ntypedef void \n(*ddjvu_message_callback_t)(ddjvu_context_t *context, void *closure);\n\nDDJVUAPI void\nddjvu_message_set_callback(ddjvu_context_t *context,\n                           ddjvu_message_callback_t callback,\n                           void *closure);\n\n\n\n/* -------------------------------------------------- */\n/* DDJVU_JOB_T                                        */\n/* -------------------------------------------------- */\n\n\n/* Many essential ddjvuapi functions initiate asynchronous operations. \n   These \"jobs\" run in seperate threads and report their\n   progress by posting messages into the ddjvu context event queue. \n   Jobs are sometimes represented by a ddjvu_job_t object. */\n\n/* ddjvu_job_status ---\n   Returns the status of the specified job. */\n\ntypedef enum {\n  DDJVU_JOB_NOTSTARTED, /* operation was not even started */\n  DDJVU_JOB_STARTED,    /* operation is in progress */\n  DDJVU_JOB_OK,         /* operation terminated successfully */\n  DDJVU_JOB_FAILED,     /* operation failed because of an error */\n  DDJVU_JOB_STOPPED     /* operation was interrupted by user */\n} ddjvu_status_t;\n\nDDJVUAPI ddjvu_status_t\nddjvu_job_status(ddjvu_job_t *job);\n\n#define ddjvu_job_done(job) \\\n    (ddjvu_job_status(job) >= DDJVU_JOB_OK)\n#define ddjvu_job_error(job) \\\n    (ddjvu_job_status(job) >= DDJVU_JOB_FAILED)\n\n\n/* ddjvu_job_stop ---\n   Attempts to cancel the specified job.\n   This is a best effort function. \n   There no guarantee that the job will \n   actually stop.\n */\n\nDDJVUAPI void\nddjvu_job_stop(ddjvu_job_t *job);\n\n\n/* ddjvu_job_set_user_data ---\n   ddjvu_job_get_user_data ---\n   Each job can store an arbitrary pointer\n   that callers can use for any purpose. These two \n   functions provide for accessing or setting this pointer. \n   This pointer is cleared when the job is released */\n\nDDJVUAPI void\nddjvu_job_set_user_data(ddjvu_job_t *job, void *userdata);\n\nDDJVUAPI void *\nddjvu_job_get_user_data(ddjvu_job_t *job);\n\n\n/* ddjvu_job_release ---\n   Releases a reference to a job object and clears its user \n   data field.  This does not cause the job to stop executing.\n   The calling program should no longer reference this object.\n   The object itself will be destroyed as soon as no \n   other object or thread needs it. \n*/\n\nDDJVUAPI void\nddjvu_job_release(ddjvu_job_t *job);\n\n\n\n/* -------------------------------------------------- */\n/* DDJVU_MESSAGE_T                                    */\n/* -------------------------------------------------- */\n\n\n/* ddjvu_message_t ---\n   This union type represents messages delivered by the\n   DDJVU API. Each member of the union pertains to a\n   specific kind of message.  Member <m_any> represents the\n   information common to all kinds of messages.  Given a\n   pointer <p> to a <djvu_message_t>, the message kind can\n   be accessed as <\"p->m_any.tag\">. */\n\n\n/* ddjvu_message_tag_t ---\n   This enumerated type identifies each kind of \n   message delivered by the DDJVU API.  */\n\ntypedef enum {\n  DDJVU_ERROR,\n  DDJVU_INFO,\n  DDJVU_NEWSTREAM,\n  DDJVU_DOCINFO,\n  DDJVU_PAGEINFO,\n  DDJVU_RELAYOUT,\n  DDJVU_REDISPLAY,\n  DDJVU_CHUNK,\n  DDJVU_THUMBNAIL,\n  DDJVU_PROGRESS,\n} ddjvu_message_tag_t;\n\n\n/* ddjvu_message_t::m_any ---\n   This structure is a member of the union <djvu_message_t>.\n   It represents the information common to all kinds of\n   messages.  Member <tag> indicates the kind of message.\n   Members <context>, <document>, <page>, and <job> indicate \n   the origin of the message.  These fields contain null\n   pointers when they are not relevant.\n   These fields are also cleared when the corresponding\n   object is released with <ddjvu_{job,page,document}_release>.\n   If the message has not yet been passed to the user \n   with <ddjvu_message_{peek,wait}>, it is silently \n   removed from the message queue. */\n\ntypedef struct ddjvu_message_any_s {\n  ddjvu_message_tag_t   tag;\n  ddjvu_context_t      *context;\n  ddjvu_document_t     *document;\n  ddjvu_page_t         *page;\n  ddjvu_job_t          *job;\n} ddjvu_message_any_t; \n\n\n/* ddjvu_message_t::m_error ---\n   Error messages are generated whenever the decoder or the\n   DDJVU API encounters an error condition.  All errors are\n   reported as error messages because they can occur\n   asynchronously.  Member <message> is the error message.\n   Members <function>, <filename> and <lineno>\n   indicates the place where the error was detected. */\n\nstruct ddjvu_message_error_s {  /* ddjvu_message_t::m_error */\n  ddjvu_message_any_t   any;\n  const char           *message;\n  const char           *function;\n  const char           *filename;\n  int                   lineno;\n}; \n\n\n/* ddjvu_message_t::m_info ---\n   This messages provides informational text indicating\n   the progress of the decoding process. This might\n   be displayed in the browser status bar. */\n\nstruct ddjvu_message_info_s {   /* ddjvu_message_t::m_info */\n  ddjvu_message_any_t  any;\n  const char          *message;\n}; \n\n\n\n\n/* -------------------------------------------------- */\n/* DDJVU_DOCUMENT_T                                    */\n/* -------------------------------------------------- */\n\n\n/* ddjvu_document_create ---\n   Creates a decoder for a DjVu document and starts\n   decoding.  This function returns immediately.  The\n   decoding job then generates messages to request the raw\n   data and to indicate the state of the decoding process.\n\n   Argument <url> specifies an optional URL for the document.  \n   The URL follows the usual syntax (<\"protocol://machine/path\">). \n   It should not end with a slash. It only serves two purposes:\n   - The URL is used as a key for the cache of decoded pages.\n   - The URL is used to document <m_newstream> messages.\n\n   Setting argument <cache> to <TRUE> indicates that decoded pages\n   should be cached when possible.  This only works when\n   argument <url> is not the null pointer.\n\n   It is important to understand that the URL is not used to\n   access the data.  The document generates <m_newstream>\n   messages to indicate which data is needed.  The caller must \n   then provide the raw data using <ddjvu_stream_write> \n   and <ddjvu_stream_close>.\n\n   Localized characters in argument <url> should be in \n   urlencoded UTF-8 (like \"%2A\"). What is happening for non \n   ascii characters is unclear (probably UTF-8). */\n\nDDJVUAPI ddjvu_document_t *\nddjvu_document_create(ddjvu_context_t *context,\n                      const char *url,\n                      int cache);\n\n\n/* ddjvu_document_create_by_filename ---\n   Creates a document for a DjVu document stored in a file.\n   The document will directly access the specified DjVu file \n   or related files without generating <m_newstream> messages.\n   The standard function expects the filename in locale encoding. \n   The utf8 variant expects an utf8 encoded filename. */\n\nDDJVUAPI ddjvu_document_t *\nddjvu_document_create_by_filename(ddjvu_context_t *context,\n                                  const char *filename,\n                                  int cache);\n\nDDJVUAPI ddjvu_document_t *\nddjvu_document_create_by_filename_utf8(ddjvu_context_t *context,\n                                       const char *filename,\n                                       int cache);\n\n\n/* SumatraPDF: ddvu_document_create_by_data ---\n   Creates a document from in-memory data\n   (needed as an alternative to ddjvu_document_create when\n   compiling libdjvu without thread support) */\n\nDDJVUAPI ddjvu_document_t *\nddjvu_document_create_by_data(ddjvu_context_t *context,\n                              const char *data,\n                              unsigned long datalen);\n\n\n/* ddjvu_document_job ---\n   Access the job object in charge of decoding the document header. \n   In fact <ddjvu_document_t> is a subclass of <ddjvu_job_t>\n   and this function is a type cast. */\n\nDDJVUAPI ddjvu_job_t *\nddjvu_document_job(ddjvu_document_t *document);\n\n\n/* ddjvu_document_release ---\n   Release a reference to a <ddjvu_document_t> object.\n   The calling program should no longer reference this object.  \n   The object itself will be destroyed as soon as no other object\n   or thread needs it. */\n \n#define ddjvu_document_release(document) \\\n   ddjvu_job_release(ddjvu_document_job(document))\n\n\n/* ddjvu_document_set_user_data ---\n   ddjvu_document_get_user_data ---\n   Each <ddjvu_document_t> object can store an arbitray pointer\n   that callers can use for any purpose. These two functions\n   provide for accessing or setting this pointer. */\n\n#define ddjvu_document_set_user_data(document,userdata) \\\n   ddjvu_job_set_user_data(ddjvu_document_job(document),userdata)\n#define ddjvu_document_get_user_data(document) \\\n   ddjvu_job_get_user_data(ddjvu_document_job(document))\n\n/* ddjvu_document_decoding_status ---\n   ddjvu_document_decoding_done, ddjvu_document_decoding_error ---\n   This function returns the status of the document header decoding job */\n   \n#define ddjvu_document_decoding_status(document) \\\n   ddjvu_job_status(ddjvu_document_job(document))\n#define ddjvu_document_decoding_done(document) \\\n   (ddjvu_document_decoding_status(document) >= DDJVU_JOB_OK)\n#define ddjvu_document_decoding_error(document) \\\n   (ddjvu_document_decoding_status(document) >= DDJVU_JOB_FAILED)\n\n\n/* ------- STREAMS ------- */\n\n\n/* ddjvu_message_t::m_newstream --- \n   Newstream messages are generated whenever the decoder\n   needs to access raw DjVu data.  The caller must then\n   provide the requested data using <ddjvu_stream_write> \n   and <ddjvu_stream_close>. \n\n   In the case of indirect documents, a single decoder \n   might simultaneously request several streams of data.  \n   Each stream is identified by a small integer <streamid>.\n\n   The first <m_newstream> message always has member\n   <streamid> set to zero and member <name> set to the null\n   pointer.  It indicates that the decoder needs to access\n   the data in the main DjVu file.  In fact, data can be\n   written to stream <0> as soon as the <ddjvu_document_t>\n   object is created.\n\n   Further <m_newstream> messages are generated to access\n   the auxiliary files of indirect or indexed DjVu\n   documents.  Member <name> then provides the basename of\n   the auxiliary file.\n\n   Member <url> is set according to the url argument\n   provided to function <ddjvu_document_create>.  The first\n   newstream message always contain the url passed to\n   <ddjvu_document_create>.  Subsequent newstream messages\n   contain the url of the auxiliary files for indirect or\n   indexed DjVu documents. */\n   \nstruct ddjvu_message_newstream_s { /* ddjvu_message_t::m_newstream */\n  ddjvu_message_any_t  any;\n  int                  streamid;\n  const char          *name;\n  const char          *url;\n}; \n\n\n/* ddjvu_stream_write ---\n   Provide raw data to the DjVu decoder.\n   This function should be called as soon as the data is available,\n   for instance when receiving DjVu data from a network connection.\n */\n\nDDJVUAPI void\nddjvu_stream_write(ddjvu_document_t *document,\n                   int streamid,\n                   const char *data,\n                   unsigned long datalen );\n\n\n/* ddjvu_stream_close ---\n   Indicates that no more data will be provided on a\n   particular stream.  Argument <stop> most likely should be\n   set to <FALSE>. Setting argument <stop> to <TRUE>\n   indicates that the user has interrupted the data transfer\n   (for instance by pressing the stop button of a browser)\n   and that the decoding threads should be stopped as \n   soon as feasible. */\n\nDDJVUAPI void\nddjvu_stream_close(ddjvu_document_t *document,\n                   int streamid,\n                   int stop );\n\n\n\n/* ------- QUERIES ------- */\n\n\n/* ddjvu_message_t::m_docinfo ---\n   The <m_docinfo> message indicates that basic information\n   about the document has been obtained and decoded.\n   Not much can be done before this happens.\n   Call <ddjvu_document_decoding_status> to determine\n   whether the operation was successful. */\n\nstruct ddjvu_message_docinfo_s {\n  ddjvu_message_any_t  any;\n};\n\n\n/* ddjvu_document_get_type ---\n   Returns the type of a DjVu document.\n   This function might return <DDJVU_DOCTYPE_UNKNOWN>\n   when called before receiving a <m_docinfo> message. */\n\ntypedef enum {\n  DDJVU_DOCTYPE_UNKNOWN=0,\n  DDJVU_DOCTYPE_SINGLEPAGE,\n  DDJVU_DOCTYPE_BUNDLED, \n  DDJVU_DOCTYPE_INDIRECT,\n  DDJVU_DOCTYPE_OLD_BUNDLED, /* obsolete */\n  DDJVU_DOCTYPE_OLD_INDEXED, /* obsolete */\n} ddjvu_document_type_t;\n\nDDJVUAPI ddjvu_document_type_t\nddjvu_document_get_type(ddjvu_document_t *document);\n\n\n/* ddjvu_document_get_pagenum ---\n   Returns the number of pages in a DjVu document.\n   This function might return 1 when called \n   before receiving a <m_docinfo> message */\n   \nDDJVUAPI int\nddjvu_document_get_pagenum(ddjvu_document_t *document);\n\n\n\n/* ------- ADVANCED ------- */\n\n\n/* ddjvu_document_get_filenum --\n   Returns the number of component files.\n   This function might return 0 when called\n   before receiving a <m_docinfo> message */\n   \nDDJVUAPI int\nddjvu_document_get_filenum(ddjvu_document_t *document);\n\n\n/* ddjvu_document_get_fileinfo --\n   Returns information about component file <fileno>.\n   This function might return <DDJVU_JOB_STARTED> when\n   called before receiving a <m_docinfo> message.\n   String pointers in the returned data structure \n   might be null. Strings are UTF8 encoded and remain \n   allocated as long as the ddjvu_document_t object exists.\n\n   Changes for ddjvuapi=18\n   - Redefined as a macro passing the structure size.\n*/\n\ntypedef struct ddjvu_fileinfo_s {\n  char  type;                   /* [P]age, [T]humbnails, [I]nclude. */\n  int   pageno;                 /* Negative when not applicable. */\n  int   size;                   /* Negative when unknown. */\n  const char *id;               /* File identifier. */\n  const char *name;             /* Name for indirect documents. */\n  const char *title;            /* Page title. */\n} ddjvu_fileinfo_t;\n\n#define ddjvu_document_get_fileinfo(d,f,i) \\\n   ddjvu_document_get_fileinfo_imp(d,f,i,sizeof(ddjvu_fileinfo_t))\n\nDDJVUAPI ddjvu_status_t\nddjvu_document_get_fileinfo_imp(ddjvu_document_t *document, int fileno, \n                                ddjvu_fileinfo_t *info, unsigned int infosz);\n\n\n/* ddjvu_document_search_pageno --- DEPRECATED. */\n\nDDJVUAPI int ddjvu_document_search_pageno(ddjvu_document_t*, const char*);\n\n\n/* ddjvu_document_check_pagedata ---\n   Returns a non zero result if the data for page <pageno>\n   is already in memory. When this is the case, functions \n   <ddjvu_document_get_pageinfo> and <ddjvu_document_get_pagetext> \n   return the information immediately.\n   This function causes the emission of <m_pageinfo> messages \n   with zero in the <m_any.page> field whenever a new file\n   is completely downloaded. */\n\nDDJVUAPI int \nddjvu_document_check_pagedata(ddjvu_document_t *document, int pageno);\n\n\n/* ddjvu_document_get_pageinfo ---\n   Attempts to obtain information about page <pageno>\n   without decoding the page. If the information is available,\n   the function returns <DDJVU_JOB_OK> and fills the <info> structure. \n   Otherwise it starts fetching page data and returns <DDJVU_JOB_STARTED>. \n   This function causes the emission of <m_pageinfo> messages \n   with zero in the <m_any.page> field.\n   Typical synchronous usage:\n\n   ddjvu_status_t r;\n   ddjvu_pageinfo_t info;\n   while ((r=ddjvu_document_get_pageinfo(doc,pageno,&info))<DDJVU_JOB_OK)\n     handle_ddjvu_messages(ctx, TRUE);\n   if (r>=DDJVU_JOB_FAILED)\n     signal_error();\n\n   Changes for ddjvuapi=18\n   - Redefined as a macro passing the structure size.\n   - Added fields 'rotation' and 'version'.\n*/      \n\ntypedef struct ddjvu_pageinfo_s {\n  int width;                    /* page width (in pixels) */\n  int height;                   /* page height (in pixels) */\n  int dpi;                      /* page resolution (in dots per inche) */\n  int rotation;                 /* initial page orientation */\n  int version;                  /* page version */\n} ddjvu_pageinfo_t;\n\n#define ddjvu_document_get_pageinfo(d,p,i) \\\n   ddjvu_document_get_pageinfo_imp(d,p,i,sizeof(ddjvu_pageinfo_t))\n\nDDJVUAPI ddjvu_status_t\nddjvu_document_get_pageinfo_imp(ddjvu_document_t *document, int pageno, \n                                ddjvu_pageinfo_t *info, unsigned int infosz );\n\n\n\n\n/* ddjvu_document_get_pagedump --\n   This function returns a UTF8 encoded text describing the contents \n   of page <pageno> using the same format as command <djvudump>. \n   The returned string must be deallocated using <free()>.\n   It returns <0> when the information is not yet available. \n   It may then cause then the emission of <m_pageinfo> \n   messages with null <m_any.page>.\n*/   \n\nDDJVUAPI char *\nddjvu_document_get_pagedump(ddjvu_document_t *document, int pageno);\n\n\n/* ddjvu_document_get_filedump --\n   This function returns a UTF8 encoded text describing the contents \n   of file <fileno> using the same format as command <djvudump>. \n   The returned string must be deallocated using <free()>.\n   It returns <0> when the information is not yet available. \n   It may then cause then the emission of <m_pageinfo> \n   messages with null <m_any.page>.\n*/   \n\nDDJVUAPI char *\nddjvu_document_get_filedump(ddjvu_document_t *document, int fileno);\n\n\n\n\n/* -------------------------------------------------- */\n/* DJVU_PAGE_T                                        */\n/* -------------------------------------------------- */\n\n\n/* ddjvu_page_create_by_pageno ---\n   Each page of a document can be accessed by creating a\n   <ddjvu_page_t> object with this function.  Argument\n   <pageno> indicates the page number, starting with page\n   <0> to <pagenum-1>. This function may return NULL\n   when called before receiving the <m_docinfo> message.\n   Calling this function also initiates the data transfer \n   and the decoding threads for the specified page.  \n   Various messages will document the progress of these \n   operations. Error messages will be generated if \n   the page does not exists. */\n\nDDJVUAPI ddjvu_page_t *\nddjvu_page_create_by_pageno(ddjvu_document_t *document,\n                            int pageno);\n\n/* ddjvu_page_create_by_pageid ---\n   This function is similar to <ddjvu_page_create_by_pageno>\n   but identifies the desired page by name instead of page\n   number. */\n\nDDJVUAPI ddjvu_page_t *\nddjvu_page_create_by_pageid(ddjvu_document_t *document,\n                            const char *pageid);\n\n\n/* ddjvu_page_job ---\n   Access the job object in charge of decoding the document header. \n   In fact <ddjvu_page_t> is a subclass of <ddjvu_job_t>\n   and this function is a type cast. */\n\nDDJVUAPI ddjvu_job_t *\nddjvu_page_job(ddjvu_page_t *page);\n\n\n/* ddjvu_page_release ---\n   Release a reference to a <ddjvu_page_t> object.\n   The calling program should no longer reference this object.\n   The object itself will be destroyed as soon as no other object\n   or thread needs it. */\n\n#define ddjvu_page_release(page) \\\n  ddjvu_job_release(ddjvu_page_job(page))\n\n\n/* ddjvu_page_set_user_data ---\n   ddjvu_page_get_user_data ---\n   Each <ddjvu_paqge_t> object can store an arbitray pointer\n   that callers can use for any purpose. These two functions\n   provide for accessing or setting this pointer. */\n\n#define ddjvu_page_set_user_data(page,userdata) \\\n   ddjvu_job_set_user_data(ddjvu_page_job(page),userdata)\n#define ddjvu_page_get_user_data(page) \\\n   ddjvu_job_get_user_data(ddjvu_page_job(page))\n\n/* ddjvu_page_decoding_status ---\n   ddjvu_page_decoding_done ---\n   ddjvu_page_decoding_error ---\n   These calls return the status of the page decoding job. */\n   \n#define ddjvu_page_decoding_status(page) \\\n   ddjvu_job_status(ddjvu_page_job(page))\n#define ddjvu_page_decoding_done(page) \\\n    (ddjvu_page_decoding_status(page) >= DDJVU_JOB_OK)\n#define ddjvu_page_decoding_error(page) \\\n    (ddjvu_page_decoding_status(page) >= DDJVU_JOB_FAILED)\n\n\n/* ------- MESSAGES ------- */\n\n\n/* ddjvu_message_t::m_pageinfo ---\n   The page decoding process generates this message\n   - when basic page information is available and \n     before any <m_relayout> or <m_redisplay> message,\n   - when the page decoding thread terminates.\n   You can distinguish both cases using \n   function ddjvu_page_decoding_status().\n   Messages <m_pageinfo> are also generated as a consequence of \n   functions such as <ddjvu_document_get_pageinfo>. \n   The field <m_any.page> of such message is null.\n*/\n\nstruct ddjvu_message_pageinfo_s {  /* ddjvu_message_t::m_pageinfo */\n  ddjvu_message_any_t  any;\n}; \n\n\n/* ddjvu_message_t::m_relayout ---\n   This message is generated when a DjVu viewer\n   should recompute the layout of the page viewer\n   because the page size and resolution information has\n   been updated. */\n\nstruct ddjvu_message_relayout_s {  /* ddjvu_message_t::m_relayout */\n  ddjvu_message_any_t  any;\n}; \n\n\n/* ddjvu_message_t::m_redisplay ---\n   This message is generated when a DjVu viewer\n   should call <ddjvu_page_render> and redisplay\n   the page. This happens, for instance, when newly \n   decoded DjVu data provides a better image. */\n\nstruct ddjvu_message_redisplay_s { /* ddjvu_message_t::m_redisplay */\n  ddjvu_message_any_t  any;\n}; \n\n\n/* ddjvu_message_t::m_chunk ---\n   This message indicates that an additional chunk\n   of DjVu data has been decoded.  Member <chunkid>\n   indicates the type of the DjVu chunk. */\n\nstruct ddjvu_message_chunk_s {     /* ddjvu_message_t::m_chunk */\n  ddjvu_message_any_t  any;\n  const char *chunkid;\n}; \n\n/* About page messages --\n   Both the <m_relayout> and <m_redisplay> messages are derived from the\n   <m_chunk> message.  They are intended for driving a djvu image viewer. \n   When receiving <m_relayout>, the viewer should get the image size, decide\n   zoom factors, and place the image area, scrollbars, toolbars, and other gui\n   objects.  When receiving <m_redisplay>, the viewer should invalidate the\n   image area so that the gui toolkit calls the repaint event handler. This\n   handler should call ddjvu_page_render() and paint the part of the\n   image that needs repainting. */\n\n\n\n/* ------- QUERIES ------- */\n\n/* ddjvu_page_get_width ---\n   Returns the page width in pixels. Calling this function \n   before receiving a <m_pageinfo> message always yields <0>. */\n\nDDJVUAPI int\nddjvu_page_get_width(ddjvu_page_t *page);\n\n\n/* ddjvu_page_get_height---\n   Returns the page height in pixels. Calling this function \n   before receiving a <m_pageinfo> message always yields <0>. */\n\nDDJVUAPI int\nddjvu_page_get_height(ddjvu_page_t *page);\n\n/* ddjvu_page_get_resolution ---\n   Returns the page resolution in pixels per inch  (dpi).\n   Calling this function before receiving a <m_pageinfo>\n   message yields a meaningless but plausible value. */\n\nDDJVUAPI int\nddjvu_page_get_resolution(ddjvu_page_t *page);\n\n\n/* ddjvu_page_get_gamma ---\n   Returns the gamma of the display for which this page was designed.\n   Calling this function before receiving a <m_pageinfo>\n   message yields a meaningless but plausible value. */\n\nDDJVUAPI double\nddjvu_page_get_gamma(ddjvu_page_t *page);\n\n\n/* ddjvu_page_get_version ---\n   Returns the version of the djvu file format.\n   Calling this function before receiving a <m_pageinfo>\n   message yields a meaningless but plausible value. */\n\nDDJVUAPI int\nddjvu_page_get_version(ddjvu_page_t *page);\n\n/* ddjvu_code_get_version ---\n   Returns the version of the djvu file format\n   implemented by this library. More or less graceful \n   degradation might arise if this is smaller than\n   the number returned by <ddjvu_page_get_version>. */\n\nDDJVUAPI int\nddjvu_code_get_version(void);\n\n\n/* ddjvu_page_get_type ---\n   Returns the type of the page data.\n   Calling this function before the termination of the\n   decoding process might returns <DDJVU_PAGETYPE_UNKNOWN>. */\n\ntypedef enum {\n  DDJVU_PAGETYPE_UNKNOWN,\n  DDJVU_PAGETYPE_BITONAL,\n  DDJVU_PAGETYPE_PHOTO,\n  DDJVU_PAGETYPE_COMPOUND,\n} ddjvu_page_type_t;\n\nDDJVUAPI ddjvu_page_type_t\nddjvu_page_get_type(ddjvu_page_t *page);\n\n\n/* ddjvu_page_get_{short,long}_description --- DEPRECATED */\n\nDDJVUAPI char *ddjvu_page_get_short_description(ddjvu_page_t *);\nDDJVUAPI char *ddjvu_page_get_long_description(ddjvu_page_t *);\n\n\n/* ddjvu_page_set_rotation ---\n   Changes the counter-clockwise rotation angle for a DjVu page.\n   Calling this function before receiving a <m_pageinfo>\n   message has no good effect. */\n\ntypedef enum {\n  DDJVU_ROTATE_0   = 0,\n  DDJVU_ROTATE_90  = 1,\n  DDJVU_ROTATE_180 = 2,\n  DDJVU_ROTATE_270 = 3,\n} ddjvu_page_rotation_t;\n\nDDJVUAPI void\nddjvu_page_set_rotation(ddjvu_page_t *page,\n                        ddjvu_page_rotation_t rot);\n\n\n/* ddjvu_page_get_rotation ---\n   Returns the counter-clockwise rotation angle for the DjVu page.\n   The rotation is automatically taken into account\n   by <ddjvu_page_render>, <ddjvu_page_get_width>\n   and <ddjvu_page_get_height>. */\n\nDDJVUAPI ddjvu_page_rotation_t\nddjvu_page_get_rotation(ddjvu_page_t *page);\n\n\n/* ddjvu_page_get_initial_rotation ---\n   Returns the page rotation specified by the \n   orientation flags in the DjVu file. \n   [brain damage warning] This is useful because\n   maparea coordinates in the annotation chunks\n   are expressed relative to the rotated coordinates\n   whereas text coordinates in the hidden text data\n   are expressed relative to the unrotated coordinates. */\n\nDDJVUAPI ddjvu_page_rotation_t\nddjvu_page_get_initial_rotation(ddjvu_page_t *page);\n\n\n\n/* ------- RENDER ------- */\n\n\n/* ddjvu_render_mode_t ---\n   Various ways to render a page. */\n\ntypedef enum {\n  DDJVU_RENDER_COLOR = 0,       /* color page or stencil */\n  DDJVU_RENDER_BLACK,           /* stencil or color page */\n  DDJVU_RENDER_COLORONLY,       /* color page or fail */\n  DDJVU_RENDER_MASKONLY,        /* stencil or fail */\n  DDJVU_RENDER_BACKGROUND,      /* color background layer */\n  DDJVU_RENDER_FOREGROUND,      /* color foreground layer */\n} ddjvu_render_mode_t;\n\n\n/* ddjvu_rect_t ---\n   This structure specifies the location of a rectangle.\n   Coordinates are usually expressed in pixels relative to \n   the BOTTOM LEFT CORNER (but see ddjvu_format_set_y_direction).\n   Members <x> and <y> indicate the position of the bottom left \n   corner of the rectangle Members <w> and <h> indicate the \n   width and height of the rectangle. */\n\nstruct ddjvu_rect_s {\n  int x, y;\n  unsigned int w, h;\n};\n\n\n/* ddjvu_page_render --\n   Renders a segment of a page with arbitrary scale.\n   Argument <mode> indicates what image layers \n   should be rendered. \n\n   Conceptually this function renders the full page\n   into a rectangle <pagerect> and copies the\n   pixels specified by rectangle <renderrect>\n   into the buffer starting at position <imagebuffer>.\n   The actual code is much more efficient than that.\n\n   The final image is written into buffer <imagebuffer>.  \n   Argument <pixelformat> specifies the expected pixel format.  \n   Argument <rowsize> specifies the number of BYTES from \n   one row to the next in the buffer. The buffer must be \n   large enough to accomodate the desired image.\n\n   This function makes a best effort to compute an image\n   that reflects the most recently decoded data.  It might\n   return <FALSE> to indicate that no image could be\n   computed at this point, and that nothing was written into\n   the buffer. */\n\nDDJVUAPI int\nddjvu_page_render(ddjvu_page_t *page,\n                  const ddjvu_render_mode_t mode,\n                  const ddjvu_rect_t *pagerect,\n                  const ddjvu_rect_t *renderrect,\n                  const ddjvu_format_t *pixelformat,\n                  unsigned long rowsize,\n                  char *imagebuffer );\n\n\n\n\n/* -------------------------------------------------- */\n/* COORDINATE TRANSFORMS                              */\n/* -------------------------------------------------- */\n\n/* ddjvu_rectmapper_create --\n   Creates a <ddjvu_rectmapper_t> data structure \n   representing an affine coordinate transformation that\n   maps points from rectangle <input> to rectangle <output>.\n   The transformation maintains the positions relative \n   to the coordinates of the rectangle corners. */\n\nDDJVUAPI ddjvu_rectmapper_t *\nddjvu_rectmapper_create(ddjvu_rect_t *input, ddjvu_rect_t *output);\n\n\n/* ddjvu_rectmapper_modify ---\n   Modifies the coordinate transform <mapper> by redefining\n   which corners of the output rectangle match those of the \n   input rectangle. This function first applies a counter-clockwise \n   rotation of <rotation> quarter-turns, and then reverses the X \n   (resp. Y) coordinates when <mirrorx> (resp. <mirrory>) is non zero. */\n\nDDJVUAPI void\nddjvu_rectmapper_modify(ddjvu_rectmapper_t *mapper,\n                        int rotation, int mirrorx, int mirrory);\n\n\n/* ddjvu_rectmapper_release ---\n   Destroys the <ddjvu_rect_mapper_t> structure\n   returned by <ddjvu_rect_mapper_create>. */\n\nDDJVUAPI void \nddjvu_rectmapper_release(ddjvu_rectmapper_t *mapper);\n\n/* ddjvu_map_point, ddjvu_map_rect ---\n   Applies the coordinate transform \n   to a point or a rectangle */\n\nDDJVUAPI void \nddjvu_map_point(ddjvu_rectmapper_t *mapper, int *x, int *y);\n\nDDJVUAPI void \nddjvu_map_rect(ddjvu_rectmapper_t *mapper, ddjvu_rect_t *rect);\n\n\n/* ddjvu_unmap_point, ddjvu_unmap_rect ---\n   Applies the inverse coordinate transform \n   to a point or a rectangle */\n\nDDJVUAPI void \nddjvu_unmap_point(ddjvu_rectmapper_t *mapper, int *x, int *y);\n\nDDJVUAPI void \nddjvu_unmap_rect(ddjvu_rectmapper_t *mapper, ddjvu_rect_t *rect);\n\n\n\n\n/* -------------------------------------------------- */\n/* DJVU_FORMAT_T                                      */\n/* -------------------------------------------------- */\n\n\n/* ddjvu_format_style_t ---\n   Enumerated type for pixel formats. */\n\ntypedef enum {\n  DDJVU_FORMAT_BGR24,           /* truecolor 24 bits in BGR order */\n  DDJVU_FORMAT_RGB24,           /* truecolor 24 bits in RGB order */\n  DDJVU_FORMAT_RGBMASK16,       /* truecolor 16 bits with masks */\n  DDJVU_FORMAT_RGBMASK32,       /* truecolor 32 bits with masks */\n  DDJVU_FORMAT_GREY8,           /* greylevel 8 bits */\n  DDJVU_FORMAT_PALETTE8,        /* paletized 8 bits (6x6x6 color cube) */\n  DDJVU_FORMAT_MSBTOLSB,        /* packed bits, msb on the left */\n  DDJVU_FORMAT_LSBTOMSB,        /* packed bits, lsb on the left */\n} ddjvu_format_style_t;\n   \n\n/* ddjvu_format_create ---\n   Creates a <ddjvu_format_t> object describing a pixel format.\n   Argument <style> describes the generic pixel format.\n   Argument <args> is an array of <nargs> unsigned ints\n   providing additionnal information:\n   - When style is <RGBMASK*>, argument <nargs> must be <3> or <4>.\n     The three first entries of array <args> are three contiguous \n     bit masks for the red, green, and blue components of each pixel.\n     The resulting color is then xored with the optional fourth entry.\n   - When style is <PALETTE*>, argument <nargs> must be <216>\n     and array <args> contains the 6*6*6 entries of a web\n     color cube.\n   - Otherwise <nargs> must be <0>. */\n\nDDJVUAPI ddjvu_format_t *\nddjvu_format_create(ddjvu_format_style_t style, \n                    int nargs, unsigned int *args);\n\n\n/* ddjvu_format_set_row_order ---\n   Sets a flag indicating whether the rows in the pixel buffer\n   are stored starting from the top or the bottom of the image.\n   Default ordering starts from the bottom of the image.\n   This is the opposite of the X11 convention. */\n\nDDJVUAPI void\nddjvu_format_set_row_order(ddjvu_format_t *format, int top_to_bottom);\n\n\n/* ddjvu_format_set_y_direction ---\n   Sets a flag indicating whether the y coordinates in the drawing \n   area are oriented from bottom to top, or from top to botttom.  \n   The default is bottom to top, similar to PostScript.\n   This is the opposite of the X11 convention. */\n\nDDJVUAPI void\nddjvu_format_set_y_direction(ddjvu_format_t *format, int top_to_bottom);\n\n\n/* ddjvu_format_set_ditherbits ---\n   Specifies the final depth of the image on the screen.\n   This is used to decide which dithering algorithm should be used.\n   The default is usually appropriate. */\n\nDDJVUAPI void\nddjvu_format_set_ditherbits(ddjvu_format_t *format, int bits);\n\n\n/* ddjvu_format_set_gamma ---\n   Sets the gamma of the display for which the pixels are\n   intended.  This will be combined with the gamma stored in\n   DjVu documents in order to compute a suitable color\n   correction.  The default value is 2.2. */\n\nDDJVUAPI void\nddjvu_format_set_gamma(ddjvu_format_t *format, double gamma);\n\n\n/* ddjvu_format_set_white ---\n   Sets the whitepoint of the display for which the pixels are\n   intended.  This will be combined with the gamma stored in\n   DjVu documents in order to compute a suitable color\n   correction.  The default value is 0xff,0xff,0xff. */\n\nDDJVUAPI void\nddjvu_format_set_white(ddjvu_format_t *format, \n                       unsigned char b, unsigned char g, unsigned char r);\n\n/* ddjvu_format_release ---\n   Release a reference to a <ddjvu_format_t> object.\n   The calling program should no longer reference this object. */\n\nDDJVUAPI void\nddjvu_format_release(ddjvu_format_t *format);\n\n\n\n\n/* -------------------------------------------------- */\n/* THUMBNAILS                                         */\n/* -------------------------------------------------- */\n\n\n/* ddjvu_thumbnail_status ---\n   Determine whether a thumbnail is available for page <pagenum>.\n   Calling this function with non zero argument <start> initiates\n   a thumbnail calculation job. Regardless of its success,\n   the completion of the job is signalled by a subsequent \n   <m_thumbnail> message. */\n\nDDJVUAPI ddjvu_status_t\nddjvu_thumbnail_status(ddjvu_document_t *document, int pagenum, int start);\n\n\n/* ddjvu_message_t::m_thumbnail ---\n   This message is sent when additional thumbnails are available. */\n\nstruct ddjvu_message_thumbnail_s { /* ddjvu_message_t::m_thumbnail */\n  ddjvu_message_any_t  any;\n  int pagenum;\n}; \n\n\n/* ddjvu_thumbnail_render ---\n   Renders a thumbnail for page <pagenum>.\n   Argument <imagebuffer> must be large enough to contain\n   an image of size <*wptr> by <*hptr> using pixel format\n   <pixelformat>. Argument <rowsize> specifies the number \n   of BYTES from one row to the next in the buffer.\n   This function returns <FALSE> when no thumbnail is available.\n   Otherwise it returns <TRUE>, adjusts <*wptr> and <*hptr> to \n   reflect the thumbnail size, and, if the pointer <imagebuffer>\n   is non zero, writes the pixel data into the image buffer. */\n\nDDJVUAPI int\nddjvu_thumbnail_render(ddjvu_document_t *document, int pagenum, \n                       int *wptr, int *hptr,\n                       const ddjvu_format_t *pixelformat,\n                       unsigned long rowsize,\n                       char *imagebuffer);\n\n\n\n/* -------------------------------------------------- */\n/* SAVE AND PRINT JOBS                                */\n/* -------------------------------------------------- */\n\n\n/* ddjvu_message_t::m_progress ---\n   These messages are generated to indicate progress \n   towards the completion of a print or save job. */\n\nstruct ddjvu_message_progress_s {\n  ddjvu_message_any_t any;\n  ddjvu_status_t status;\n  int percent;\n};\n\n/* ddjvu_document_print ---\n   Converts specified pages of a djvu document into postscript.  \n   This function works asynchronously in a separate thread.\n   You can use the following idiom for synchronous operation:\n\n     ddjvu_job_t *job = ddjvu_document_print(....);\n     while (! ddjvu_job_done(job) )\n       handle_ddjvu_messages(context, TRUE);\n       \n   The postscript data is written to stdio file <output>.\n   Arguments <optc> and <optv> specify printing options.\n   All options described on the <djvups> man page are \n   recognized, except <\"-help\"> and <\"-verbose\">.\n*/\n\nDDJVUAPI ddjvu_job_t *\nddjvu_document_print(ddjvu_document_t *document, FILE *output,\n                     int optc, const char * const * optv);\n\n\n/* ddjvu_document_save ---\n   Saves the djvu document as a bundled djvu file.\n   This function works asynchronously in a separate thread.\n   You can use the following idiom for synchronous operation:\n\n     ddjvu_job_t *job = ddjvu_document_save(....);\n     while (! ddjvu_job_done(job) )\n       handle_ddjvu_messages(context, TRUE);\n     \n   The bundled djvu data is written to file <output>\n   which must be seekable. Arguments <optc> and <optv>\n   can be used to pass the following options:\n   * Option \"-pages=<pagespec>\" specify a subset of pages\n     using the same syntax as program <ddjvu>.\n     Reordering or duplicating pages is prohibited. \n   * Option \"-indirect=<filename>\" causes the creation\n     of an indirect document with index file <filename>\n     and auxiliary files in the same directory.\n     The file name is UTF-8 encoded.\n     When this option is specified, the argument <output>\n     is ignored and should be NULL.\n*/\nDDJVUAPI ddjvu_job_t *\nddjvu_document_save(ddjvu_document_t *document, FILE *output, \n                    int optc, const char * const * optv);\n\n\n\n\n/* -------------------------------------------------- */\n/* S-EXPRESSIONS                                      */\n/* -------------------------------------------------- */\n\n\n/* DjVu files can contain ancillary information such as\n   document outline, hidden text, hyperlinks, and metadata.\n   Program <djvused> provides for manipulating such\n   information.  Like <djvused>, the DDJVU API represents\n   this information using a lisp s-expressions.  See file\n   <\"libdjvu/miniexp.h\"> for the s-expression documentation\n   and manipulation functions.  See the <djvused> man page\n   for the specification of the s-expressions representing\n   outlines, hidden text and annotations. It often help \n   to print s-expressions using function <miniexp_pprint>.\n\n   WARNING: All strings in s-expression are UTF-8 encoded.  \n   Strings returned by miniexp_to_str might have to be \n   converted to the locale encoding. */\n\n\n/* miniexp_t --\n   Opaque type representing s-expressions.\n   The same definition also appears in \n   file <\"libdjvu/miniexp.h\">. */\n\n#ifndef MINIEXP_H\ntypedef struct miniexp_s* miniexp_t;\n#endif\n\n/* ddjvu_miniexp_release -- \n   This function controls the allocation of the\n   s-expressions returned by functions from the DDJVU\n   API. It indicates that the s-expression <expr> is no\n   longer needed and can be deallocated as soon as\n   necessary. Otherwise the s-expression remains allocated\n   as long as the document object exists. */\n\nDDJVUAPI void\nddjvu_miniexp_release(ddjvu_document_t *document, miniexp_t expr);\n\n\n/* ddjvu_document_get_outline -- \n   This function tries to obtain the document outline.  \n   If this information is available, it returns a\n   s-expression with the same syntax as function\n   <print-outline> of program <djvused>.  \n   Otherwise it returns <miniexp_dummy> until \n   the document header gets fully decoded.\n   Typical synchronous usage:\n\n    miniexp_t r;\n    while ((r=ddjvu_document_get_outline(doc))==miniexp_dummy)\n      handle_ddjvu_messages(ctx, TRUE); \n\n   This function returns the empty list <miniexp_nil> when\n   the document contains no outline information. It can also\n   return symbols <failed> or <stopped> when an error occurs\n   while accessing the desired information. */\n\nDDJVUAPI miniexp_t\nddjvu_document_get_outline(ddjvu_document_t *document);\n\n\n/* ddjvu_document_get_anno --\n   This function returns the document-wide annotations.\n   This corresponds to a proposed change in the djvu format.\n   When no new-style document-wide annotations are available\n   and <compat> is true, this function searches a shared \n   annotation chunk and returns its contents.\n\n   This function returns <miniexp_dummy> if the information\n   is not yet available. It may then cause the emission \n   of <m_pageinfo> messages with null <m_any.page>.\n\n   This function returns the empty list <miniexp_nil> when\n   the document does not contain page annotations. It can also\n   return symbols <failed> or <stopped> when an error occurs\n   while accessing the desired information. */\n\nDDJVUAPI miniexp_t\nddjvu_document_get_anno(ddjvu_document_t *document, int compat);\n\n\n/* ddjvu_document_get_pagetext -- \n   This function tries to obtain the text information for\n   page <pageno>. If this information is available, it\n   returns a s-expression with the same syntax as function\n   <print-txt> of program <djvused>.  Otherwise it starts\n   fetching the page data and returns <miniexp_dummy>.\n   This function causes the emission of <m_pageinfo> messages \n   with zero in the <m_any.page> field.\n   Typical synchronous usage:\n\n    miniexp_t r;\n    while ((r=ddjvu_document_get_pagetext(doc,pageno,0))==miniexp_dummy)\n      handle_ddjvu_messages(ctx, TRUE); \n\n   This function returns the empty list <miniexp_nil> when\n   the page contains no text information. It can also return\n   symbols <failed> or <stopped> when an error occurs while\n   accessing the desired information. \n\n   Argument <maxdetail> controls the level of detail in the\n   returned s-expression. Values \"page\", \"column\", \"region\", \"para\", \n   \"line\", and \"word\" restrict the output to the specified granularity.\n   All other values produce a s-expression that represents\n   the hidden text data as finely as possible. */\n\nDDJVUAPI miniexp_t\nddjvu_document_get_pagetext(ddjvu_document_t *document, int pageno, \n                            const char *maxdetail);\n\n\n/* ddjvu_document_get_pageanno -- \n   This function tries to obtain the annotations for\n   page <pageno>. If this information is available, it\n   returns a s-expression with the same syntax as function\n   <print-ant> of program <djvused>.  Otherwise it starts\n   fetching the page data and returns <miniexp_dummy>.\n   This function causes the emission of <m_pageinfo> messages \n   with zero in the <m_any.page> field.\n   Typical synchronous usage:\n\n     miniexp_t r;\n     while ((r = ddjvu_document_get_pageanno(doc,pageno))==miniexp_dummy)\n       handle_ddjvu_messages(ctx, TRUE); \n\n   This function returns the empty list <miniexp_nil> when\n   the page contains no annotations. It can also return\n   symbols <failed> or <stopped> when an error occurs while\n   accessing the desired information. */\n\nDDJVUAPI miniexp_t\nddjvu_document_get_pageanno(ddjvu_document_t *document, int pageno);\n\n\n/* --- Helper functions to parse annotations --- */\n\n/* ddjvu_anno_get_bgcolor --\n   Parse the annotations and extracts the desired \n   background color as a color string (\"#FFFFFF\"). \n   See <(background ...)> in the djvused man page.\n   Returns zero if this information is not specified. */\n\nDDJVUAPI const char *\nddjvu_anno_get_bgcolor(miniexp_t annotations);\n\n\n/* ddjvu_anno_get_zoom --\n   Parse the annotations and extracts the desired zoom factor.\n   See <(zoom ...)> in the djvused man page.\n   Returns zero if this information is not specified. */\n\nDDJVUAPI const char *\nddjvu_anno_get_zoom(miniexp_t annotations);\n\n\n/* ddjvu_anno_get_mode --\n   Parse the annotations and extracts the desired display mode.\n   See <(mode ...)> in the djvused man page.\n   Returns zero if this information is not specified. */\n\nDDJVUAPI const char *\nddjvu_anno_get_mode(miniexp_t annotations);\n\n\n/* ddjvu_anno_get_horizalign --\n   Parse the annotations and extracts how the page\n   image should be aligned horizontally.\n   See <(align ...)> in the djvused man page.\n   Returns zero if this information is not specified. */\n\nDDJVUAPI const char *\nddjvu_anno_get_horizalign(miniexp_t annotations);\n\n\n/* ddjvu_anno_get_vertalign --\n   Parse the annotations and extracts how the page\n   image should be aligned vertically.\n   See <(align ...)> in the djvused man page.\n   Returns zero if this information is not specified. */\n\nDDJVUAPI const char *\nddjvu_anno_get_vertalign(miniexp_t annotations);\n\n\n/* ddjvu_anno_get_hyperlinks --\n   Parse the annotations and returns a zero terminated \n   array of <(maparea ...)> s-expressions.\n   The caller should free this array with function <free>.\n   These s-expressions remain allocated as long\n   as the annotations remain allocated.\n   See also <(maparea ...)> in the djvused man page. */\n\nDDJVUAPI miniexp_t *\nddjvu_anno_get_hyperlinks(miniexp_t annotations);\n\n\n/* ddjvu_anno_get_metadata_keys --\n   Parse the annotations and returns a zero terminated \n   array of key symbols for the page metadata.\n   The caller should free this array with function <free>.\n   See also <(metadata ...)> in the djvused man page. */\n\nDDJVUAPI miniexp_t *\nddjvu_anno_get_metadata_keys(miniexp_t annotations);\n\n\n/* ddjvu_anno_get_metadata --\n   Parse the annotations and returns the metadata string\n   corresponding to the metadata key symbol <key>.\n   The string remains allocated as long as the \n   annotations s-expression remain allocated.\n   Returns zero if no such key is present. */\n\nDDJVUAPI const char *\nddjvu_anno_get_metadata(miniexp_t annotations, miniexp_t key);\n\n\n/* ddjvu_anno_get_xmp --\n   Parse the annotations and returns the xmp metadata string.\n   The string remains allocated as long as the \n   annotations s-expression remain allocated.\n   Returns zero if no such key is present. */\n\nDDJVUAPI const char *\nddjvu_anno_get_xmp(miniexp_t annotations);\n\n\n/* -------------------------------------------------- */\n/* DJVU_MESSAGE_T                                     */\n/* -------------------------------------------------- */\n\n\n/* We can now define the djvu_message_t union */\n\nunion ddjvu_message_s {\n  struct ddjvu_message_any_s        m_any;\n  struct ddjvu_message_error_s      m_error;\n  struct ddjvu_message_info_s       m_info;\n  struct ddjvu_message_newstream_s  m_newstream;\n  struct ddjvu_message_docinfo_s    m_docinfo;\n  struct ddjvu_message_pageinfo_s   m_pageinfo;\n  struct ddjvu_message_chunk_s      m_chunk;\n  struct ddjvu_message_relayout_s   m_relayout;\n  struct ddjvu_message_redisplay_s  m_redisplay;\n  struct ddjvu_message_thumbnail_s  m_thumbnail;\n  struct ddjvu_message_progress_s   m_progress;\n};\n\n\n/* -------------------------------------------------- */\n/* BACKDOORS                                          */\n/* -------------------------------------------------- */\n\n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n\n/* ddjvu_get_DjVuImage ---\n   ddjvu_get_DjVuDocument ---\n   These functions provide an access to the libdjvu objects \n   associated with the ddjvuapi objects.  These backdoors can\n   be useful for advanced manipulations.  These two functions \n   are declared in C++ when file <\"ddjvuapi.h\"> is included \n   after the libdjvu header files <\"DjVuImage.h\"> and\n   <\"DjVuDocument.h\">. */\n\n#ifdef __cplusplus\n# ifndef NOT_USING_DJVU_NAMESPACE\n#  ifdef _DJVUIMAGE_H\nDDJVUAPI GP<DjVuImage>\nddjvu_get_DjVuImage(ddjvu_page_t *page);\n#  endif\n#  ifdef _DJVUDOCUMENT_H\nDDJVUAPI GP<DjVuDocument>\nddjvu_get_DjVuDocument(ddjvu_document_t *document);\n#  endif\n# endif\n#endif\n\n/* SumatraPDF: implementation of <free> mentioned above */\nvoid ddjvu_free(void *ptr);\n\n#endif /* DDJVUAPI_H */\n"
  },
  {
    "path": "ext/libdjvu/ddjvuapi.pc.in",
    "content": "prefix=@prefix@\nexec_prefix=@exec_prefix@\nlibdir = @libdir@\nincludedir = @includedir@\n\nName: ddjvuapi\nDescription: DjVu decoding api.\nVersion: @PACKAGE_VERSION@\nRequires:\nConflicts:\nLibs: -L${libdir} -ldjvulibre \nLibs.private: @JPEG_LIBS@ @PTHREAD_LIBS@ @LIBS@\nCflags: -I${includedir} @JPEG_CFLAGS@ @PTHREAD_CFLAGS@\n"
  },
  {
    "path": "ext/libdjvu/debug.cpp",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation\n#endif\n\n#include \"debug.h\"\n\n#if ( DEBUGLVL > 0 )\n\n#include \"GThreads.h\"\n#include \"GContainer.h\"\n#include \"GString.h\"\n#include \"GString.h\"\n#include \"ByteStream.h\"\n#include \"GURL.h\"\n\n#include <stdarg.h>\n#include <stdio.h>\n#include <errno.h>\n\n#ifdef WIN32\n# include <windows.h>  // OutputDebugString\n#endif \n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n#endif\n#endif\n\n\n#ifndef UNIX\n#ifndef WIN32\n#ifndef macintosh\n#define UNIX\n#endif\n#endif\n#endif\n\nstatic GCriticalSection debug_lock;\n#ifdef RUNTIME_DEBUG_ONLY\nstatic int              debug_level = 0;\n#else\nstatic int              debug_level = DEBUGLVL;\n#endif\nstatic int              debug_id;\nstatic FILE            *debug_file;\nstatic int              debug_file_count;\n\n#if THREADMODEL==NOTHREADS\nstatic DjVuDebug debug_obj;\n#else\nstatic GMap<long, DjVuDebug> &\ndebug_map(void)\n{\n  static GMap<long, DjVuDebug> xmap;\n  return xmap;\n}\n#endif\n\nDjVuDebug::DjVuDebug()\n  : block(0), indent(0)\n{\n  id = debug_id++;\n#ifdef UNIX\n  if (debug_file_count++ == 0 && !debug_file)\n    set_debug_file(stderr);\n#endif\n}\n\nDjVuDebug::~DjVuDebug()\n{\n#ifdef UNIX\n  if (--debug_file_count == 0)\n    {\n      if (debug_file && (debug_file != stderr))\n        fclose(debug_file);\n      debug_file = 0;\n    }\n#endif\n}\n\nvoid   \nDjVuDebug::format(const char *fmt, ... )\n{\n  if (! block)\n    {\n      va_list ap;\n      va_start(ap, fmt);\n      GUTF8String buffer(fmt,ap);\n      va_end(ap);\n      GCriticalSectionLock glock(&debug_lock);\n      if (debug_file)\n        {\n          fprintf(debug_file,\"%s\", (const char*)buffer);\n          fflush(debug_file);\n        }\n#ifdef WIN32\n      else\n        {\n          OutputDebugStringA((const char *)buffer);\n        }\n#endif\n    }\n}\n\nvoid   \nDjVuDebug::set_debug_level(int lvl)\n{\n  debug_level = lvl;\n}\n\nvoid\nDjVuDebug::set_debug_file(FILE * file)\n{\n  GCriticalSectionLock glock(&debug_lock);\n  if (debug_file && (debug_file != stderr))\n    fclose(debug_file);\n  debug_file = file;\n}\n\nvoid\nDjVuDebug::modify_indent(int rindent)\n{\n  indent += rindent;\n}\n\nDjVuDebug& \nDjVuDebug::lock(int lvl, int noindent)\n{\n  int threads_num=1;\n  debug_lock.lock();\n  // Find Debug object\n#if THREADMODEL==NOTHREADS\n  // Get no-threads debug object\n  DjVuDebug &dbg = debug_obj;\n#else\n  // Get per-thread debug object\n  long threadid = (long) GThread::current();\n  DjVuDebug &dbg = debug_map()[threadid];\n  threads_num=debug_map().size();\n#endif\n  // Check level\n  dbg.block = (lvl > debug_level);\n  // Output thread id and indentation\n  if (! noindent)\n    {\n      if (threads_num>1)\n        dbg.format(\"[T%d] \", dbg.id);\n      int ind = dbg.indent;\n      char buffer[257];\n      memset(buffer,' ', sizeof(buffer)-1);\n      buffer[sizeof(buffer)-1] = 0;\n      while (ind > (int)sizeof(buffer)-1)\n        {\n          dbg.format(\"%s\", buffer);\n          ind -= sizeof(buffer)-1;\n        }\n      if (ind > 0)\n        {\n          buffer[ind] = 0;\n          dbg.format(\"%s\", buffer);\n        }\n    }\n  // Return\n  return dbg;\n}\n\nvoid\nDjVuDebug::unlock()\n{\n  debug_lock.unlock();\n}\n\n#define OP(type, fmt) \\\nDjVuDebug& DjVuDebug::operator<<(type arg)\\\n{ format(fmt, arg); return *this; }\n\nDjVuDebug& DjVuDebug::operator<<(bool arg)\n{\n   format(\"%s\", arg ? \"TRUE\" : \"FALSE\"); return *this;\n}\n\nOP(char, \"%c\")\nOP(unsigned char, \"%c\")\nOP(int, \"%d\")\nOP(unsigned int, \"%u\")\nOP(short int, \"%hd\")\nOP(unsigned short int, \"%hu\")\nOP(long, \"%ld\")\nOP(unsigned long, \"%lu\")\nOP(float, \"%g\")\nOP(double, \"%g\")\nOP(const void * const, \"0x%08x\")\n\nDjVuDebug& DjVuDebug::operator<<(const char * const ptr) \n{\n  GUTF8String buffer(ptr?ptr:\"(null)\");\n  if(buffer.length() > 255)\n  {\n    buffer=buffer.substr(0,252)+\"...\";\n  }\n  format(\"%s\", (const char *)buffer);\n  return *this; \n}\n\nDjVuDebug& DjVuDebug::operator<<(const unsigned char * const ptr) \n{ \n  return operator<<( (const char *) ptr );\n}\n\nDjVuDebug& DjVuDebug::operator<<(const GUTF8String &ptr)\n{\n  GUTF8String buffer(ptr);\n  if(buffer.length() > 255)\n    buffer=buffer.substr(0,252)+\"...\";\n  format(\"%s\", (const char *)buffer);\n  return *this; \n}\n\nDjVuDebugIndent::DjVuDebugIndent(int inc)\n  : inc(inc)\n{\n  DjVuDebug &dbg = DjVuDebug::lock(0,1);\n  dbg.modify_indent(inc);\n  dbg.unlock();\n}\n\nDjVuDebugIndent::~DjVuDebugIndent()\n{\n  DjVuDebug &dbg = DjVuDebug::lock(0,1);\n  dbg.modify_indent(-inc);\n  dbg.unlock();\n}\n\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n#endif\n"
  },
  {
    "path": "ext/libdjvu/debug.h",
    "content": "//C-  -*- C++ -*-\n//C- -------------------------------------------------------------------\n//C- DjVuLibre-3.5\n//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.\n//C- Copyright (c) 2001  AT&T\n//C-\n//C- This software is subject to, and may be distributed under, the\n//C- GNU General Public License, either Version 2 of the license,\n//C- or (at your option) any later version. The license should have\n//C- accompanied the software or you may obtain a copy of the license\n//C- from the Free Software Foundation at http://www.fsf.org .\n//C-\n//C- This program is distributed in the hope that it will be useful,\n//C- but WITHOUT ANY WARRANTY; without even the implied warranty of\n//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//C- GNU General Public License for more details.\n//C- \n//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from\n//C- Lizardtech Software.  Lizardtech Software has authorized us to\n//C- replace the original DjVu(r) Reference Library notice by the following\n//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):\n//C-\n//C-  ------------------------------------------------------------------\n//C- | DjVu (r) Reference Library (v. 3.5)\n//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.\n//C- | The DjVu Reference Library is protected by U.S. Pat. No.\n//C- | 6,058,214 and patents pending.\n//C- |\n//C- | This software is subject to, and may be distributed under, the\n//C- | GNU General Public License, either Version 2 of the license,\n//C- | or (at your option) any later version. The license should have\n//C- | accompanied the software or you may obtain a copy of the license\n//C- | from the Free Software Foundation at http://www.fsf.org .\n//C- |\n//C- | The computer code originally released by LizardTech under this\n//C- | license and unmodified by other parties is deemed \"the LIZARDTECH\n//C- | ORIGINAL CODE.\"  Subject to any third party intellectual property\n//C- | claims, LizardTech grants recipient a worldwide, royalty-free, \n//C- | non-exclusive license to make, use, sell, or otherwise dispose of \n//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the \n//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU \n//C- | General Public License.   This grant only confers the right to \n//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to \n//C- | the extent such infringement is reasonably necessary to enable \n//C- | recipient to make, have made, practice, sell, or otherwise dispose \n//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to \n//C- | any greater extent that may be necessary to utilize further \n//C- | modifications or combinations.\n//C- |\n//C- | The LIZARDTECH ORIGINAL CODE is provided \"AS IS\" WITHOUT WARRANTY\n//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF\n//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n//C- +------------------------------------------------------------------\n\n#ifndef _DEBUG_H_\n#define _DEBUG_H_\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma interface\n#endif\n\n#include <stdio.h>\n\n\n#ifdef HAVE_NAMESPACES\nnamespace DJVU {\n# ifdef NOT_DEFINED // Just to fool emacs c++ mode\n}\n# endif\n#endif\n\n/** @name debug.h\n\n    Files #\"debug.h\"# and #\"debug.cpp\"# implement means to print debug\n    messages in a multithread safe way.  Message are also marked with a thread\n    identifier.  Under Windows, debug messages are directly sent to the\n    debugger using the Win32 function #OutputDebugString#.  Under Unix, debug\n    messages are printed on the controlling terminal, preferably using device\n    #/dev/tty#.\n\n    The preprocessor variable #DEBUGLVL# defines which debug code is going to\n    be compiled.  Selecting #-DDEBUGLVL=0# (the default) disables all\n    debugging code.  Selecting a positive values (e.g. #-DDEBUGLVL=4#) enables\n    more and more debugging code.\n\n    Message output is controlled by the current debugging level (an integer\n    between #0# and #DEBUGLVL#). Greater values enable more messages.  The\n    initial debugging level is set to the maximum value.  The debugging level\n    can be changed using macro \\Ref{DEBUG_SET_LEVEL}.\n\n    Message indentation can be modified using macro \\Ref{DEBUG_MAKE_INDENT}.\n    Messages are generated by macro \\Ref{DEBUG_MSG} or its variants.  The\n    argument of the macro can contain several components separated by operator\n    #<<#, as demonstrated in the example below:\n    \\begin{verbatim}\n    DEBUG_MSG(\"The value of a[\" << n << \"] is \" << a[n] << '\\n');\n    \\end{verbatim}\n\n    One more preprocessor variable #RUNTIME_DEBUG_ONLY# enables compilation\n    of debug code, but does not enable the debug messages automatically.\n    In order to see them the program should use \\Ref{DEBUG_SET_LEVEL} to\n    change the level to anything greater than 0. Normally this happens when\n    user specifies option #-debug# in the command line. Usage of\n    #RUNTIME_DEBUG_ONLY# implies #DEBUGLVL=1# if not specified otherwise.\n\n    Finally, #-DNO_DEBUG# or #-DNDEBUG# can be used instead of #-DDEBUGLVL=0#,\n    and #-D_DEBUG# can be used instead of #-DDEBUGLVL=0#.\n\n    {\\bf Historical Comment} --- Debug macros are rarely used in the reference\n    DjVu library because Leon thinks that debugging messages unnecessarily\n    clutter the code.  Debug macros are used everywhere in the plugin code\n    because Andrew thinks that code without debugging messages is close to\n    useless.  No agreement could be reached. Neither could they agree on\n    if cluttering header files with huge documentation chunks helps to\n    improve code readability.\n\n    @memo \n    Macros for printing debug messages.\n    @author\n    Andrew Erofeev <eaf@geocities.com> -- initial implementation \\\\\n    Leon Bottou <leonb@research.att.com> -- cleanups */\n//@{\n\n#ifndef DEBUGLVL\n# ifdef NDEBUG\n#  define DEBUGLVL 0\n# endif \n#endif\n#ifndef DEBUGLVL\n# ifdef NO_DEBUG\n#  define DEBUGLVL 0\n# endif \n#endif\n#ifndef DEBUGLVL\n# ifdef RUNTIME_DEBUG_ONLY\n#  define DEBUGLVL 1\n# endif \n#endif\n#ifndef DEBUGLVL\n# ifdef _DEBUG\n#  define DEBUGLVL 1\n# endif \n#endif\n#ifndef DEBUGLVL\n#  define DEBUGLVL 0\n#endif\n\n#if DEBUGLVL <= 0\n\n# ifndef NO_DEBUG\n#  define NO_DEBUG\n# endif\n# ifndef NDEBUG\n#  define NDEBUG\n# endif\n# ifdef _DEBUG\n#  undef _DEBUG\n# endif\n\n# define DEBUG_MAKE_INDENT(x)\n# define DEBUG_SET_LEVEL(level)\n# define DEBUG_MSG_LVL(level,x)\n# define DEBUG_MSGN_LVL(level,x)\n\n#else\n\n# ifdef NO_DEBUG\n#  undef NO_DEBUG\n# endif\n# ifdef NDEBUG\n#  undef NDEBUG\n# endif\n# ifndef _DEBUG\n#  define _DEBUG\n# endif\n\nclass GUTF8String;\n\n// ------------ SUPPORT\n\nclass DjVuDebug // DJVU_CLASS\n{\nprivate:\n  int    id;\n  int    block;\n  int    indent;\n  void   format(const char *fmt, ... );\npublic:\n  // construction\n  DjVuDebug();\n  ~DjVuDebug();\n  // access\n  static void   set_debug_level(int lvl);\n  static void\tset_debug_file(FILE * file);\n  void          modify_indent(int rindent);\n  static DjVuDebug& lock(int lvl, int noindent);\n  void          unlock();\n  // printing\n  DjVuDebug &\toperator<<(bool b);\n  DjVuDebug &\toperator<<(char c);\n  DjVuDebug &\toperator<<(unsigned char c);\n  DjVuDebug &\toperator<<(int i);\n  DjVuDebug &\toperator<<(unsigned int i);\n  DjVuDebug &\toperator<<(short int i);\n  DjVuDebug &\toperator<<(unsigned short int i);\n  DjVuDebug &\toperator<<(long i);\n  DjVuDebug &\toperator<<(unsigned long i);\n  DjVuDebug &\toperator<<(const char * const ptr);\n  DjVuDebug &\toperator<<(const unsigned char * const ptr);\n  DjVuDebug&    operator<<(const GUTF8String &ptr);\n  DjVuDebug &\toperator<<(float f);\n  DjVuDebug &\toperator<<(double d);\n  DjVuDebug &\toperator<<(const void * const p);\n};\n\nclass DjVuDebugIndent // DJVU_CLASS\n{\nprivate:\n  int inc;\npublic:\n  DjVuDebugIndent(int inc=2);\n  ~DjVuDebugIndent();\n//#define DEBUG_MAKE_INDENT_2(x, y) DjVuDebugIndent debug_indent ## y (x)\n//#define DEBUG_MAKE_INDENT_1(x, y) DEBUG_MAKE_INDENT_2(x, y)\n#define DEBUG_MAKE_INDENT_1(x, y) DjVuDebugIndent debug_indent ## y (x)\n};\n\n// ------------ MAIN MACROS\n\n# define DEBUG_MAKE_INDENT(x)     DEBUG_MAKE_INDENT_1(x, __LINE__)\n# define DEBUG_SET_LEVEL(level)   DjVuDebug::set_debug_level(level)\n# define DEBUG_MSG_LVL(level,x)   { ( DjVuDebug::lock(level,0) << x ).unlock(); }\n# define DEBUG_MSGN_LVL(level,x)  { ( DjVuDebug::lock(level,1) << x ).unlock(); }\n# define DEBUG_MSGF_LVL(level,x)  { ( DjVuDebug::lock(level,1) << x ).unlock(); }\n\n#endif\n\n\n// ------------ EAF MACROS\n\n#if ( DEBUGLVL >= 1 )\n/** Generates a level 1 message */\n# define DEBUG1_MSG(x)  DEBUG_MSG_LVL(1,x)\n# define DEBUG1_MSGF(x) DEBUG_MSGF_LVL(1,x)\n#else\n# define DEBUG1_MSG(x)\n# define DEBUG1_MSGF(x)\n#endif\n#if ( DEBUGLVL >= 2 )\n/** Generates a level 2 message */\n# define DEBUG2_MSG(x)  DEBUG_MSG_LVL(2,x)\n# define DEBUG2_MSGF(x) DEBUG_MSGF_LVL(2,x)\n#else\n# define DEBUG2_MSG(x)\n# define DEBUG2_MSGF(x)\n#endif\n#if ( DEBUGLVL >= 3 )\n/** Generates a level 3 message */\n# define DEBUG3_MSG(x)  DEBUG_MSG_LVL(3,x)\n# define DEBUG3_MSGF(x) DEBUG_MSGF_LVL(3,x)\n#else\n# define DEBUG3_MSG(x)\n# define DEBUG3_MSGF(x)\n#endif\n#if ( DEBUGLVL >= 4 )\n/** Generates a level 4 message */\n# define DEBUG4_MSG(x)  DEBUG_MSG_LVL(4,x)\n# define DEBUG4_MSGF(x) DEBUG_MSGF_LVL(4,x)\n#else\n# define DEBUG4_MSG(x)\n# define DEBUG4_MSGF(x)\n#endif\n\n#define DEBUG_RUNTIME_SET_LEVEL(level) DEBUG_SET_LEVEL(level)\n/** Generates a level 1 message. */\n#define DEBUG_MSG(x)  DEBUG1_MSG(x)\n/** Generates a level 1 message without indentation. */\n#define DEBUG_MSGF(x) DEBUG1_MSGF(x)\n/** Generates a level 1 message terminated with a newline. */\n#define DEBUG_MSGN(x) DEBUG_MSG(x<<'\\n')\n\n//@}\n\n// ------------ THE END\n\n#ifdef HAVE_NAMESPACES\n}\n# ifndef NOT_USING_DJVU_NAMESPACE\nusing namespace DJVU;\n# endif\n#endif\n\n#endif // DEBUG_H\n"
  },
  {
    "path": "ext/libdjvu/djvu_all.cpp",
    "content": "#include \"Arrays.cpp\"\r\n#include \"atomic.cpp\"\r\n#include \"BSByteStream.cpp\"\r\n#include \"BSEncodeByteStream.cpp\"\r\n#include \"ByteStream.cpp\"\r\n#include \"DataPool.cpp\"\r\n#include \"DjVmDir0.cpp\"\r\n#include \"DjVmDoc.cpp\"\r\n#include \"DjVmNav.cpp\"\r\n#include \"DjVuAnno.cpp\"\r\n#include \"DjVuDumpHelper.cpp\"\r\n#include \"DjVuErrorList.cpp\"\r\n#include \"DjVuFile.cpp\"\r\n#include \"DjVuFileCache.cpp\"\r\n#include \"DjVuGlobal.cpp\"\r\n#include \"DjVuGlobalMemory.cpp\"\r\n#include \"DjVuImage.cpp\"\r\n#include \"DjVuInfo.cpp\"\r\n#include \"DjVuMessage.cpp\"\r\n#include \"DjVuNavDir.cpp\"\r\n#include \"DjVuPalette.cpp\"\r\n#include \"DjVuPort.cpp\"\r\n#include \"DjVuText.cpp\"\r\n#include \"GBitmap.cpp\"\r\n#include \"GContainer.cpp\"\r\n#include \"GException.cpp\"\r\n#include \"GIFFManager.cpp\"\r\n#include \"GOS.cpp\"\r\n#include \"GRect.cpp\"\r\n#include \"GSmartPointer.cpp\"\r\n#include \"GString.cpp\"\r\n#include \"GThreads.cpp\"\r\n#include \"GUnicode.cpp\"\r\n#include \"IFFByteStream.cpp\"\r\n#include \"JB2EncodeCodec.cpp\"\r\n#include \"DjVmDir.cpp\"\r\n#include \"MMRDecoder.cpp\"\r\n#include \"MMX.cpp\"\r\n#include \"UnicodeByteStream.cpp\"\r\n#include \"XMLTags.cpp\"\r\n#include \"ZPCodec.cpp\"\r\n#include \"ddjvuapi.cpp\"\r\n#include \"debug.cpp\"\r\n\r\n"
  },
  {
    "path": "ext/libdjvu/miniexp.cpp",
    "content": "/* -*- C++ -*-\n// -------------------------------------------------------------------\n// MiniExp - Library for handling lisp expressions\n// Copyright (c) 2005  Leon Bottou\n//\n// This software is subject to, and may be distributed under, the\n// GNU General Public License, either version 2 of the license\n// or (at your option) any later version. The license should have\n// accompanied the software or you may obtain a copy of the license\n// from the Free Software Foundation at http://www.fsf.org .\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n// -------------------------------------------------------------------\n*/\n\n#ifdef HAVE_CONFIG_H\n# include \"config.h\"\n#endif\n#if NEED_GNUG_PRAGMAS\n# pragma implementation \"miniexp.h\"\n#endif\n\n#include <stddef.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <ctype.h>\n#include <string.h>\n#include <time.h>\n#include <stdarg.h>\n\n#define MINIEXP_IMPLEMENTATION\n\n#include \"miniexp.h\"\n\n#ifdef HAVE_NAMESPACES\n# define BEGIN_ANONYMOUS_NAMESPACE namespace {\n# define END_ANONYMOUS_NAMESPACE }\n#else\n# define BEGIN_ANONYMOUS_NAMESPACE \n# define END_ANONYMOUS_NAMESPACE\n#endif\n\n\n/* -------------------------------------------------- */\n/* ASSERT                                            */\n/* -------------------------------------------------- */\n\n#if defined(__GNUC__)\nstatic void \nassertfail(const char *fn, int ln) \n  __attribute__((noreturn));\n#endif\n\nstatic void\nassertfail(const char *fn, int ln)\n{\n  fprintf(stderr,\"Assertion failed: %s:%d\\n\",fn,ln);\n  abort();\n}\n\n#define ASSERT(x) \\\n  do { if (!(x)) assertfail(__FILE__,__LINE__); } while(0)\n\n\n/* -------------------------------------------------- */\n/* SYMBOLS                                            */\n/* -------------------------------------------------- */\n\nstatic unsigned int \nhashcode(const char *s)\n{\n  long h = 0x1013;\n  while (*s)\n    {\n      h = (h<<6) | ((h&0xfc000000)>>26);\n      h ^= (*s);\n      s++;\n    }\n  return h;\n}\n\nBEGIN_ANONYMOUS_NAMESPACE\n\nclass symtable_t \n{\npublic:\n  int nelems;\n  int nbuckets;\n  struct sym { unsigned int h; struct sym *l; char *n; };\n  struct sym **buckets;\n  symtable_t();\n  ~symtable_t();\n  struct sym *lookup(const char *n, bool create=false);\n  void resize(int); \nprivate:\n  symtable_t(const symtable_t&);\n  symtable_t& operator=(const symtable_t&);\n};\n\nsymtable_t::symtable_t()\n  : nelems(0), nbuckets(0), buckets(0)\n{\n  resize(7);\n}\n\nsymtable_t::~symtable_t()\n{\n  int i=0;\n  for (; i<nbuckets; i++)\n    while (buckets[i])\n      {\n        struct sym *r = buckets[i];\n        buckets[i] = r->l;\n        delete [] r->n;\n        delete r;\n      }\n  delete [] buckets;\n}\n\nvoid\nsymtable_t::resize(int nb)\n{\n  struct sym **b = new sym*[nb];\n  memset(b, 0, nb*sizeof(sym*));\n  int i=0;\n  for (; i<nbuckets; i++)\n    while (buckets[i])\n      {\n        struct sym *s = buckets[i];\n        int j = s->h % nb;\n        buckets[i] = s->l;\n        s->l = b[j];\n        b[j] = s;\n      }\n  delete [] buckets;\n  buckets = b;\n  nbuckets = nb;\n}\n\nstruct symtable_t::sym *\nsymtable_t::lookup(const char *n, bool create)\n{\n  if (nbuckets <= 0) \n    resize(7);\n  unsigned int h = hashcode(n);\n  int i = h % nbuckets;\n  struct sym *r = buckets[i];\n  while (r && strcmp(n,r->n))\n    r = r->l;\n  if (!r && create)\n    {\n      nelems += 1;\n      r = new sym;\n      r->h = h;\n      r->l = buckets[i];\n      r->n = new char [1+strlen(n)];\n      strcpy(r->n, n);\n      buckets[i] = r;\n      if ( 2 * nelems > 3 * nbuckets)\n        resize(2*nbuckets-1);\n    }\n  return r;\n}\n  \nEND_ANONYMOUS_NAMESPACE\n\nstatic symtable_t *symbols;\n \nconst char *\nminiexp_to_name(miniexp_t p)\n{\n  if (miniexp_symbolp(p))\n    {\n      struct symtable_t::sym *r;\n      r = ((symtable_t::sym*)(((size_t)p)&~((size_t)3)));\n      return r->n;\n    }\n  return 0;\n}\n\nminiexp_t \nminiexp_symbol(const char *name)\n{\n  struct symtable_t::sym *r;\n  if (! symbols) \n    symbols = new symtable_t;\n  r = symbols->lookup(name, true);\n  return (miniexp_t)(((size_t)r)|((size_t)2));\n}\n\n\n/* -------------------------------------------------- */\n/* MEMORY AND GARBAGE COLLECTION                      */\n/* -------------------------------------------------- */\n\n// A simple mark-and-sweep garbage collector.\n//\n// Memory is managed in chunks of nptrs_chunk pointers.\n// The first two pointers are used to hold mark bytes for the rest.\n// Chunks are carved from blocks of nptrs_block pointers.\n//\n// Dirty hack: The sixteen most recently created pairs are \n// not destroyed by automatic garbage collection, in order\n// to preserve transient objects created in the course \n// of evaluating complicated expressions.\n\n#define nptrs_chunk  (4*sizeof(void*))\n#define sizeof_chunk (nptrs_chunk*sizeof(void*))\n#define nptrs_block  (16384-8)\n#define recentlog    (4)\n#define recentsize   (1<<recentlog)\n\nstatic inline char *\nmarkbase(void **p)\n{\n  return (char*)(((size_t)p) & ~(sizeof_chunk-1));\n}\n\nstatic inline char *\nmarkbyte(void **p)\n{\n  char *base = markbase(p);\n  return base + ((p - (void**)base)>>1);\n}\n\nstruct block_t {\n  block_t *next;\n  void **lo;\n  void **hi;\n  void *ptrs[nptrs_block];\n};\n\nstatic block_t *\nnew_block(void)\n{\n  block_t *b = new block_t;\n  memset(b, 0, sizeof(block_t));\n  b->lo = (void**)markbase(b->ptrs+nptrs_chunk-1);\n  b->hi = (void**)markbase(b->ptrs+nptrs_block);\n  return b;\n}\n\nstatic void\nclear_marks(block_t *b)\n{\n  for (void** m=b->lo; m<b->hi; m+=nptrs_chunk)\n    m[0] = m[1] = 0;\n}\n\nstatic void\ncollect_free(block_t *b, void **&freelist, int &count, bool destroy)\n{\n  for (void **m=b->lo; m<b->hi; m+=nptrs_chunk)\n    {\n      char *c = (char*)m;\n      for (unsigned int i=1; i<nptrs_chunk/2; i++)\n        if (! c[i])\n          {\n            miniobj_t *obj = (miniobj_t*)m[i+i];\n            if (destroy && obj && m[i+i]==m[i+i+1]) \n              obj->destroy();\n            m[i+i] = (void*)freelist;\n            m[i+i+1] = 0;\n            freelist = &m[i+i];\n            count += 1;\n          }\n    }\n}\n\nstatic struct {\n  int lock;\n  int request;\n  int debug;\n  int      pairs_total;\n  int      pairs_free;\n  void   **pairs_freelist;\n  block_t *pairs_blocks;\n  int      objs_total;\n  int      objs_free;\n  void   **objs_freelist;\n  block_t *objs_blocks;\n  void **recent[recentsize];\n  int    recentindex;\n} gc;\n\nstatic void\nnew_pair_block(void)\n{\n  int count = 0;\n  block_t *b = new_block();\n  b->next = gc.pairs_blocks;\n  gc.pairs_blocks = b;\n  clear_marks(b);\n  collect_free(b, gc.pairs_freelist, count, false);\n  gc.pairs_total += count;\n  gc.pairs_free += count;\n}\n\nstatic void\nnew_obj_block(void)\n{\n  int count = 0;\n  block_t *b = new_block();\n  b->next = gc.objs_blocks;\n  gc.objs_blocks = b;\n  clear_marks(b);\n  collect_free(b, gc.objs_freelist, count, false);\n  gc.objs_total += count;\n  gc.objs_free += count;\n}\n\n#if defined(__GNUC__) && (__GNUC__ >= 3)\nstatic void gc_mark_object(void **v) __attribute__((noinline));\n#else\nstatic void gc_mark_object(void **v);\n#endif\n\nstatic bool\ngc_mark_check(void *p)\n{\n  if (((size_t)p) & 2)\n    return false;\n  void **v = (void**)(((size_t)p) & ~(size_t)3); \n  if (! v)\n    return false;\n  char *m = markbyte(v);\n  if (*m)\n    return false;\n  *m = 1;\n  if (! (((size_t)p) & 1))\n    return true;\n  gc_mark_object((void**)v);\n  return false;\n}\n\nstatic void\ngc_mark_pair(void **v)\n{\n#ifndef MINIEXP_POINTER_REVERSAL\n  // This is a simple recursive code.\n  // Despite the tail recursion for the cdrs,\n  // it consume a stack space that grows like\n  // the longest chain of cars.\n  for(;;)\n    {\n      if (gc_mark_check(v[0]))\n        gc_mark_pair((void**)v[0]);\n      if (! gc_mark_check(v[1]))\n        break;\n      v = (void**)v[1];\n    }\n#else\n  // This is the classic pointer reversion code\n  // It saves stack memory by temporarily reversing the pointers. \n  // This is a bit slower because of all these nonlocal writes.\n  // But it could be useful for memory-starved applications.\n  // That makes no sense for most uses of miniexp.\n  // I leave the code here because of its academic interest.\n  void **w = 0;\n docar:\n  if (gc_mark_check(v[0]))\n    { // reverse car pointer\n      void **p = (void**)v[0];\n      v[0] = (void*)w;\n      w = (void**)(((size_t)v)|(size_t)1);\n      v = p;\n      goto docar;\n    }\n docdr:\n  if (gc_mark_check(v[1]))\n    { // reverse cdr pointer\n      void **p = (void**)v[1];\n      v[1] = (void*)w;\n      w = v;\n      v = p;\n      goto docar;\n    }\n doup:\n  if (w)\n    {\n      if (((size_t)w)&1)\n        { // undo car reversion\n          void **p = (void**)(((size_t)w)&~(size_t)1);\n          w = (void**)p[0];\n          p[0] = (void*)v;\n          v = p;\n          goto docdr;\n        }\n      else\n        { // undo cdr reversion\n          void **p = w;\n          w = (void**)p[1];\n          p[1] = (void*)v;\n          v = p;\n          goto doup;\n        }\n    }\n#endif\n}\n\nstatic void\ngc_mark(miniexp_t *pp)\n{\n  void **v = (void**)*pp;\n  if (gc_mark_check((void**)*pp))\n    gc_mark_pair(v);\n}\n\nstatic void\ngc_mark_object(void **v)\n{\n  ASSERT(v[0] == v[1]);\n  miniobj_t *obj = (miniobj_t*)v[0];\n  if (obj) \n    obj->mark(gc_mark);\n}\n\nstatic void\ngc_run(void)\n{\n  gc.request++;\n  if (gc.lock == 0)\n    {\n      block_t *b;\n      gc.request = 0;\n      // clear marks\n      for (b=gc.objs_blocks; b; b=b->next)\n        clear_marks(b);\n      for (b=gc.pairs_blocks; b; b=b->next)\n        clear_marks(b);\n      // mark\n      minivar_t::mark(gc_mark);\n      for (int i=0; i<recentsize; i++)\n        { // extra cast for strict aliasing rules?\n          char *s = (char*)&gc.recent[i];\n          gc_mark((miniexp_t*)s);\n        }\n      // sweep\n      gc.objs_free = gc.pairs_free = 0;\n      gc.objs_freelist = gc.pairs_freelist = 0;\n      for (b=gc.objs_blocks; b; b=b->next)\n        collect_free(b, gc.objs_freelist, gc.objs_free, true);\n      for (b=gc.pairs_blocks; b; b=b->next)\n        collect_free(b, gc.pairs_freelist, gc.pairs_free, false);\n      // alloc 33% extra space\n      while (gc.objs_free*4 < gc.objs_total)\n        new_obj_block();\n      while (gc.pairs_free*4 < gc.pairs_total)\n        new_pair_block();\n    }\n}\n\nstatic void **\ngc_alloc_pair(void *a, void *d)\n{\n  if (!gc.pairs_freelist)\n    {\n      gc_run();\n      if (!gc.pairs_freelist)\n        new_pair_block();\n    }\n  else if (gc.debug)\n    gc_run();\n  void **p = gc.pairs_freelist;\n  gc.pairs_freelist = (void**)p[0];\n  gc.pairs_free -= 1;\n  p[0] = a;\n  p[1] = d;\n  return p;\n}\n\nstatic void **\ngc_alloc_object(void *obj)\n{\n  if (!gc.objs_freelist)\n    {\n      gc_run();\n      if (!gc.objs_freelist)\n        new_obj_block();\n    }\n  else if (gc.debug)\n    gc_run();\n  void **p = gc.objs_freelist;\n  gc.objs_freelist = (void**)p[0];\n  gc.objs_free -= 1;\n  p[0] = p[1] = obj;\n  return p;\n}\n\n\n\n\n\n/* ---- USER FUNCTIONS --- */\n\nminiexp_t\nminilisp_acquire_gc_lock(miniexp_t x)\n{\n  gc.lock++;\n  return x;\n}\n\nminiexp_t\nminilisp_release_gc_lock(miniexp_t x)\n{\n  if (gc.lock > 0)\n    if (--gc.lock == 0)\n      if (gc.request > 0)\n        {\n          minivar_t v = x;\n          gc_run();\n        }\n  return x;\n}\n\nvoid \nminilisp_gc(void)\n{\n  int i;\n  for (i=0; i<recentsize; i++)\n    gc.recent[i] = 0;\n  gc_run();\n}\n\nvoid \nminilisp_debug(int debug)\n{\n  gc.debug = debug;\n}\n\nvoid \nminilisp_info(void)\n{\n  time_t tim = time(0);\n  const char *dat = ctime(&tim);\n  printf(\"--- begin info -- %s\", dat);\n  printf(\"symbols: %d symbols in %d buckets\\n\", \n         symbols->nelems, symbols->nbuckets);\n  if (gc.debug)\n    printf(\"gc.debug: true\\n\");\n  if (gc.lock)\n    printf(\"gc.locked: true, %d requests\\n\", gc.request);\n  printf(\"gc.pairs: %d free, %d total\\n\", gc.pairs_free, gc.pairs_total);\n  printf(\"gc.objects: %d free, %d total\\n\", gc.objs_free, gc.objs_total);\n  printf(\"--- end info -- %s\", dat);\n}\n\n\n/* -------------------------------------------------- */\n/* MINIVARS                                           */\n/* -------------------------------------------------- */\n\nminivar_t::minivar_t()\n  : data(0)\n{\n  if ((next = vars))\n    next->pprev = &next;\n  pprev = &vars;\n  vars = this;\n}\n\nminivar_t::minivar_t(miniexp_t p)\n  : data(p)\n{\n  if ((next = vars))\n    next->pprev = &next;\n  pprev = &vars;\n  vars = this;\n}\n\nminivar_t::minivar_t(const minivar_t &v)\n  : data(v.data)\n{\n  if ((next = vars))\n    next->pprev = &next;\n  pprev = &vars;\n  vars = this;\n}\n\nminivar_t *minivar_t::vars = 0;\n\nvoid\nminivar_t::mark(minilisp_mark_t *f)\n{\n  for (minivar_t *v = vars; v; v=v->next)\n    (*f)(&v->data);\n}\n\nminivar_t *\nminivar_alloc(void)\n{\n  return new minivar_t;\n}\n\nvoid \nminivar_free(minivar_t *v)\n{\n  delete v;\n}\n\nminiexp_t *\nminivar_pointer(minivar_t *v)\n{\n  return &(*v);\n}\n\n\n/* -------------------------------------------------- */\n/* LISTS                                              */\n/* -------------------------------------------------- */\n\nstatic inline miniexp_t &\ncar(miniexp_t p) {\n  return ((miniexp_t*)p)[0];\n}\n\nstatic inline miniexp_t &\ncdr(miniexp_t p) {\n  return ((miniexp_t*)p)[1];\n}\n\nint \nminiexp_length(miniexp_t p)\n{\n  int n = 0;\n  bool toggle = false;\n  miniexp_t q = p;\n  while (miniexp_consp(p))\n    {\n      p = cdr(p);\n      if (p == q)\n        return -1;\n      if ((toggle = !toggle))\n        q = cdr(q);\n      n += 1;\n    }\n  return n;\n}\n\nminiexp_t \nminiexp_caar(miniexp_t p)\n{\n  return miniexp_car(miniexp_car(p)); \n}\n\nminiexp_t \nminiexp_cadr(miniexp_t p)\n{\n  return miniexp_car(miniexp_cdr(p)); \n}\n\nminiexp_t \nminiexp_cdar(miniexp_t p)\n{\n  return miniexp_cdr(miniexp_car(p)); \n}\n\nminiexp_t \nminiexp_cddr(miniexp_t p)\n{\n  return miniexp_cdr(miniexp_cdr(p)); \n}\n\nminiexp_t \nminiexp_caddr(miniexp_t p)\n{\n  return miniexp_car(miniexp_cdr(miniexp_cdr(p)));\n}\n\nminiexp_t \nminiexp_cdddr(miniexp_t p)\n{\n  return miniexp_cdr(miniexp_cdr(miniexp_cdr(p)));\n}\n\nminiexp_t \nminiexp_nth(int n, miniexp_t l)\n{\n  while (--n>=0 && miniexp_consp(l)) \n    l = cdr(l);\n  return miniexp_car(l);\n}\n\nminiexp_t \nminiexp_cons(miniexp_t a, miniexp_t d)\n{\n  miniexp_t r = (miniexp_t)gc_alloc_pair((void*)a, (void*)d); \n  gc.recent[(++gc.recentindex) & (recentsize-1)] = (void**)r;\n  return r;\n}\n\nminiexp_t \nminiexp_rplaca(miniexp_t pair, miniexp_t newcar)\n{\n  if (miniexp_consp(pair))\n    {\n      car(pair) = newcar;\n      return pair;\n    }\n  return 0;\n}\n\nminiexp_t \nminiexp_rplacd(miniexp_t pair, miniexp_t newcdr)\n{\n  if (miniexp_consp(pair))\n    {\n      cdr(pair) = newcdr;\n      return pair;\n    }\n  return 0;\n}\n\nminiexp_t \nminiexp_reverse(miniexp_t p)\n{\n  miniexp_t l = 0;\n  while (miniexp_consp(p))\n    {\n      miniexp_t q = cdr(p);\n      cdr(p) = l;\n      l = p;\n      p = q;\n    }\n  return l;\n}\n\n\n/* -------------------------------------------------- */\n/* MINIOBJ                                            */\n/* -------------------------------------------------- */\n\nminiobj_t::~miniobj_t()\n{\n}\n\nconst miniexp_t miniobj_t::classname = 0;\n\nbool\nminiobj_t::isa(miniexp_t) const\n{\n  return false;\n}\n\nvoid \nminiobj_t::mark(minilisp_mark_t*)\n{\n}\n\nvoid \nminiobj_t::destroy()\n{\n  delete this;\n}\n\nchar *\nminiobj_t::pname() const\n{\n  const char *cname = miniexp_to_name(classof());\n  char *res = new char[strlen(cname)+24];\n  sprintf(res,\"#%s:<%p>\",cname,this);\n  return res;\n}\n\nminiexp_t \nminiexp_object(miniobj_t *obj)\n{\n  void **v = gc_alloc_object((void*)obj);\n  v = (void**)(((size_t)v)|((size_t)1));\n  gc.recent[(++gc.recentindex) & (recentsize-1)] = v;\n  return (miniexp_t)(v);\n}\n\nminiexp_t \nminiexp_classof(miniexp_t p) \n{\n  miniobj_t *obj = miniexp_to_obj(p);\n  if (obj) return obj->classof();\n  return miniexp_nil;\n}\n\nminiexp_t \nminiexp_isa(miniexp_t p, miniexp_t c)\n{\n  miniobj_t *obj = miniexp_to_obj(p);\n  if (obj && obj->isa(c))\n    return obj->classof();\n  return miniexp_nil;\n}\n\n\n/* -------------------------------------------------- */\n/* STRINGS                                            */\n/* -------------------------------------------------- */\n\nBEGIN_ANONYMOUS_NAMESPACE\n\nclass ministring_t : public miniobj_t \n{\n  MINIOBJ_DECLARE(ministring_t,miniobj_t,\"string\");\npublic:\n  ~ministring_t();\n  ministring_t(const char *s);\n  ministring_t(char *s, bool steal);\n  operator const char*() const { return s; }\n  virtual char *pname() const;\nprivate:\n  char *s;\nprivate:\n  ministring_t(const ministring_t &);\n  ministring_t& operator=(const ministring_t &);\n};\n\nMINIOBJ_IMPLEMENT(ministring_t,miniobj_t,\"string\");\n\nministring_t::~ministring_t()\n{\n  delete [] s;\n}\n\nministring_t::ministring_t(const char *str) \n  : s(new char[strlen(str)+1])\n{\n  strcpy(s,str);\n}\n\nministring_t::ministring_t(char *str, bool steal) \n  : s(str)\n{\n  ASSERT(steal);\n}\n\nEND_ANONYMOUS_NAMESPACE\n\nstatic bool\nchar_quoted(int c, bool eightbits)\n{\n  if (eightbits && c>=0x80)\n    return false;\n  if (c==0x7f || c=='\\\"' || c=='\\\\')\n    return true;\n  if (c>=0x20 && c<0x7f)\n    return false;\n  return true;\n}\n\nstatic void\nchar_out(int c, char* &d, int &n)\n{\n  n++;\n  if (d) \n    *d++ = c;\n}\n\nstatic int\nprint_c_string(const char *s, char *d, bool eightbits)\n{\n  int c;\n  int n = 0;\n  char_out('\\\"', d, n);\n  while ((c = (unsigned char)(*s++)))\n    {\n      if (char_quoted(c, eightbits))\n        {\n          char letter = 0;\n          static const char *tr1 = \"\\\"\\\\tnrbf\";\n          static const char *tr2 = \"\\\"\\\\\\t\\n\\r\\b\\f\";\n          for (int i=0; tr2[i]; i++)\n            if (c == tr2[i])\n              letter = tr1[i];\n          char_out('\\\\', d, n);\n          if (letter)\n            char_out(letter, d, n);\n          else\n            {\n              char_out('0'+ ((c>>6)&3), d, n);\n              char_out('0'+ ((c>>3)&7), d, n);\n              char_out('0'+ (c&7), d, n);\n            }\n          continue;\n        }\n      char_out(c, d, n);\n    }\n  char_out('\\\"', d, n);\n  char_out(0, d, n);\n  return n;\n}\n\nchar *\nministring_t::pname() const\n{\n  int n = print_c_string(s, 0, true);\n  char *d = new char[n];\n  if (d) print_c_string(s, d, true);\n  return d;\n}\n\nint \nminiexp_stringp(miniexp_t p)\n{\n  // SumatraPDF: don't execute code until asked to\n  return miniexp_isa(p, miniexp_symbol(\"string\")) ? 1 : 0;\n}\n\nconst char *\nminiexp_to_str(miniexp_t p)\n{\n  miniobj_t *obj = miniexp_to_obj(p);\n  if (miniexp_stringp(p))\n    return (const char*) * (ministring_t*) obj;\n  return 0;\n}\n\nminiexp_t \nminiexp_string(const char *s)\n{\n  ministring_t *obj = new ministring_t(s);\n  return miniexp_object(obj);\n}\n\nminiexp_t \nminiexp_substring(const char *s, int n)\n{\n  int l = strlen(s);\n  n = (n < l) ? n : l;\n  char *b = new char[n+1];\n  strncpy(b, s, n);\n  b[n] = 0;\n  ministring_t *obj = new ministring_t(b, true);\n  return miniexp_object(obj);\n}\n\nminiexp_t \nminiexp_concat(miniexp_t p)\n{\n  miniexp_t l = p;\n  const char *s;\n  int n = 0;\n  if (miniexp_length(l) < 0)\n    return miniexp_nil;\n  for (p=l; miniexp_consp(p); p=cdr(p))\n    if ((s = miniexp_to_str(car(p))))\n      n += strlen(s);\n  char *b = new char[n+1];\n  char *d = b;\n  for (p=l; miniexp_consp(p); p=cdr(p))\n    if ((s = miniexp_to_str(car(p)))) {\n      strcpy(d, s);\n      d += strlen(d);\n    }\n  ministring_t *obj = new ministring_t(b, true);\n  return miniexp_object(obj);\n}\n\n\n/* -------------------------------------------------- */\n/* INPUT/OUTPUT                                       */\n/* -------------------------------------------------- */\n\nBEGIN_ANONYMOUS_NAMESPACE\n\nstruct CompatCounter \n{\n  static int count;\n  CompatCounter() { count += 1; }\n  ~CompatCounter() { count -= 1; }\n};\n\nint CompatCounter::count = 0;\n\nEND_ANONYMOUS_NAMESPACE\n\nstatic int\ncompat_puts(const char *s)\n{\n  CompatCounter count;\n  return miniexp_io.fputs(&miniexp_io, s);\n}\n\nstatic int\ncompat_getc()\n{\n  CompatCounter count;\n  return miniexp_io.fgetc(&miniexp_io);\n}\n\nstatic int\ncompat_ungetc(int c)\n{\n  CompatCounter count;\n  return miniexp_io.ungetc(&miniexp_io, c);\n}\n\nstatic int \nstdio_fputs(miniexp_io_t *io, const char *s)\n{\n  if (io == &miniexp_io && !CompatCounter::count)\n    return (*minilisp_puts)(s); /* compatibility hack */\n  FILE *f = (io->data[1]) ? (FILE*)(io->data[1]) : stdout;\n  return ::fputs(s, f);\n}\n\nstatic int \nstdio_fgetc(miniexp_io_t *io)\n{\n  if (io == &miniexp_io && !CompatCounter::count)\n    return (*minilisp_getc)(); /* compatibility hack */\n  FILE *f = (io->data[0]) ? (FILE*)(io->data[0]) : stdin;\n  return ::getc(f);\n}\n\nstatic int \nstdio_ungetc(miniexp_io_t *io, int c)\n{\n  if (io == &miniexp_io && !CompatCounter::count)\n    return (*minilisp_ungetc)(c); /* compatibility hack */\n  FILE *f = (io->data[0]) ? (FILE*)(io->data[0]) : stdin;\n  return ::ungetc(c, f);\n}\n\nextern \"C\" \n{ \n  // SunCC needs this to be defined inside extern \"C\" { ... }\n  // Beware the difference between extern \"C\" {...} and extern \"C\".\n  miniexp_t (*minilisp_macrochar_parser[128])(void);\n  miniexp_t (*minilisp_diezechar_parser[128])(void);\n  minivar_t minilisp_macroqueue;\n  int minilisp_print_7bits;\n}\n\n\nminiexp_io_t miniexp_io = { \n  stdio_fputs, stdio_fgetc, stdio_ungetc, { 0, 0, 0, 0 },\n  (int*)&minilisp_print_7bits,\n  (miniexp_macrochar_t*)minilisp_macrochar_parser, \n  (miniexp_macrochar_t*)minilisp_diezechar_parser, \n  (minivar_t*)&minilisp_macroqueue,\n  0\n};  \n\nint (*minilisp_puts)(const char *) = compat_puts;\nint (*minilisp_getc)(void) = compat_getc;\nint (*minilisp_ungetc)(int) = compat_ungetc;\n\nvoid \nminiexp_io_init(miniexp_io_t *io)\n{\n  io->fputs = stdio_fputs;\n  io->fgetc = stdio_fgetc;\n  io->ungetc = stdio_ungetc;\n  io->data[0] = io->data[1] = io->data[2] = io->data[3] = 0;\n  io->p_print7bits = (int*)&minilisp_print_7bits;;\n  io->p_macrochar = (miniexp_macrochar_t*)minilisp_macrochar_parser;\n  io->p_diezechar = (miniexp_macrochar_t*)minilisp_diezechar_parser;\n  io->p_macroqueue = (minivar_t*)&minilisp_macroqueue;\n  io->p_reserved = 0;\n}\n\nvoid \nminiexp_io_set_output(miniexp_io_t* io, FILE *f)\n{\n  io->fputs = stdio_fputs;\n  io->data[1] = f;\n}\n\nvoid \nminiexp_io_set_input(miniexp_io_t* io, FILE *f)\n{\n  io->fgetc = stdio_fgetc;\n  io->ungetc = stdio_ungetc;\n  io->data[0] = f;\n}\n\n\n/* ---- OUTPUT */\n\nBEGIN_ANONYMOUS_NAMESPACE\n\nstruct printer_t \n{\n  int tab;\n  bool dryrun;\n  miniexp_io_t *io;\n  printer_t(miniexp_io_t *io) : tab(0), dryrun(false), io(io) {}\n  void mlput(const char *s);\n  void mltab(int n);\n  void print(miniexp_t p);\n  bool must_quote_symbol(const char *s);\n  virtual miniexp_t begin() { return miniexp_nil; }\n  virtual bool newline() { return false; }\n  virtual void end(miniexp_t) { }\n  virtual ~printer_t() {};\n};\n\nvoid\nprinter_t::mlput(const char *s)\n{\n  if (! dryrun)\n    io->fputs(io, s);\n  while (*s)\n    if (*s++ == '\\n')\n      tab = 0;\n    else\n      tab += 1;\n}\n\nvoid\nprinter_t::mltab(int n)\n{\n  while (tab+8 <= n)\n    mlput(\"        \");\n  while (tab+1 <= n)\n    mlput(\" \");\n}\n\nbool\nprinter_t::must_quote_symbol(const char *s)\n{\n  int c;\n  const char *r = s;\n  while ((c = *r++))\n    if (c=='(' || c==')' || c=='\\\"' || c=='|' || \n        isspace(c) || !isascii(c) || !isprint(c) ||\n        (c >= 0 && c < 128 && io->p_macrochar && io->p_macrochar[c]) )\n      return true;\n  char *end;\n#ifdef __GNUC__\n  long junk __attribute__ ((unused)) =\n#endif\n  strtol(s, &end, 0);\n  return (!*end);\n}\n\nvoid\nprinter_t::print(miniexp_t p)\n{\n  static char buffer[32];\n  miniexp_t b = begin();\n  if (p == miniexp_nil)\n    {\n      mlput(\"()\");\n    }\n  else if (p == miniexp_dummy)\n    {\n      mlput(\"#dummy\");\n    }\n  else if (miniexp_numberp(p))\n    {\n      sprintf(buffer, \"%d\", miniexp_to_int(p));\n      mlput(buffer);\n    }\n  else if (miniexp_symbolp(p))\n    {\n      const char *s = miniexp_to_name(p);\n      bool needquote = must_quote_symbol(s);\n      if (needquote) mlput(\"|\");\n      mlput(s);\n      if (needquote) mlput(\"|\");\n    }\n  else if (miniexp_stringp(p))\n    {\n      const char *s = miniexp_to_str(p);\n      bool print7bits = (io->p_print7bits && *io->p_print7bits);\n      int n = print_c_string(s, 0, !print7bits);\n      char *d = new char[n];\n      if (d) print_c_string(s, d, !print7bits);\n      mlput(d);\n      delete [] d;\n    }\n  else if (miniexp_objectp(p))\n    {\n      miniobj_t *obj = miniexp_to_obj(p);\n      char *s = obj->pname();\n      mlput(s);\n      delete [] s;\n    }\n  else if (miniexp_listp(p))\n    {\n      // TODO - detect more circular structures\n      int skip = 1;\n      int indent = tab + 1;\n      bool multiline = false;\n      bool toggle = true;\n      miniexp_t q = p;\n      mlput(\"(\");\n      if (miniexp_consp(p) && miniexp_symbolp(car(p)))\n        {\n          skip++;\n          indent++;\n        }\n      while (miniexp_consp(p))\n        {\n          skip -= 1;\n\t  if (multiline || (newline() && skip<0 && tab>indent))\n            {\n              mlput(\"\\n\"); \n              mltab(indent); \n              multiline=true; \n            }\n          print(car(p));\n          if ((p = cdr(p)))\n            mlput(\" \");\n          if ((toggle = !toggle))\n            q = cdr(q);\n          if (p == q)\n            {\n              mlput(\"...\");\n              p = 0;\n            }\n        }\n      if (p)\n        {\n          skip -= 1;\n\t  if (multiline || (newline() && skip<0 && tab>indent))\n            {\n              mlput(\"\\n\"); \n              mltab(indent); \n              multiline=true; \n            }\n          mlput(\". \");\n          print(p);\n        }\n      if (multiline)\n        mlput(\" )\");\n      else\n        mlput(\")\");\n    }\n  end(b);\n}\n\nstruct pprinter_t : public printer_t \n{\n  int width;\n  minivar_t l;\n  pprinter_t(miniexp_io_t *io) : printer_t(io) {}\n  virtual miniexp_t begin();\n  virtual bool newline();\n  virtual void end(miniexp_t);\n};\n\nminiexp_t \npprinter_t::begin()\n{\n  if (dryrun)\n    {\n      l = miniexp_cons(miniexp_number(tab), l);\n      return l;\n    }\n  else\n    {\n      ASSERT(miniexp_consp(l));\n      ASSERT(miniexp_numberp(car(l)));\n      l = cdr(l);\n      return miniexp_nil;\n    }\n}\n\nbool \npprinter_t::newline()\n{\n  if (! dryrun)\n    {\n      ASSERT(miniexp_consp(l));\n      ASSERT(miniexp_numberp(car(l)));\n      int len = miniexp_to_int(car(l));\n      if (tab + len >= width)\n        return true;\n    }\n  return false;\n}\n\nvoid \npprinter_t::end(miniexp_t p)\n{\n  if (dryrun)\n    {\n      ASSERT(miniexp_consp(p));\n      ASSERT(miniexp_numberp(car(p)));\n      int pos = miniexp_to_int(car(p));\n      ASSERT(tab >= pos);\n      car(p) = miniexp_number(tab - pos);\n    }\n}\n\nEND_ANONYMOUS_NAMESPACE\n\nminiexp_t \nminiexp_prin_r(miniexp_io_t *io, miniexp_t p)\n{\n  minivar_t xp = p;\n  printer_t printer(io);\n  printer.print(p);\n  return p;\n}\n\nminiexp_t \nminiexp_print_r(miniexp_io_t *io, miniexp_t p)\n{\n  minivar_t xp = p;\n  miniexp_prin_r(io, p);\n  io->fputs(io, \"\\n\");\n  return p;\n}\n\nminiexp_t \nminiexp_pprin_r(miniexp_io_t *io, miniexp_t p, int width)\n{  \n  minivar_t xp = p;\n  pprinter_t printer(io);\n  printer.width = width;\n  // step1 - measure lengths into list <l>\n  printer.tab = 0;\n  printer.dryrun = true;\n  printer.print(p);\n  // step2 - print\n  printer.tab = 0;\n  printer.dryrun = false;\n  printer.l = miniexp_reverse(printer.l);\n  printer.print(p);\n  // check\n  ASSERT(printer.l == 0);\n  return p;\n}\n\nminiexp_t \nminiexp_pprint_r(miniexp_io_t *io, miniexp_t p, int width)\n{\n  miniexp_pprin_r(io, p, width);\n  io->fputs(io, \"\\n\");\n  return p;\n}\n\n\n/* ---- PNAME */\n\n// SumatraPDF: don't compile as it's not used and it's the only place\n// using try/catch, which is not compatible with compiling as /EHs-c-\n#if 0\nstatic int\npname_fputs(miniexp_io_t *io, const char *s)\n{\n  char *b = (char*)(io->data[0]);\n  size_t l = (size_t)(io->data[2]);\n  size_t m = (size_t)(io->data[3]);\n  size_t x = strlen(s);\n  if (l + x >= m)\n    {\n      size_t nm = l + x + 256;\n      char *nb = new char[nm+1];\n      memcpy(nb, b, l);\n      delete [] b;\n      b = nb;\n      m = nm;\n    }\n  strcpy(b + l, s);\n  io->data[0] = (void*)(b);\n  io->data[2] = (void*)(l + x);\n  io->data[3] = (void*)(m);\n  return x;\n}\n\nminiexp_t \nminiexp_pname(miniexp_t p, int width)\n{\n  minivar_t r;\n  miniexp_io_t io;\n  miniexp_io_init(&io);\n  io.fputs = pname_fputs;\n  io.data[0] = io.data[2] = io.data[3] = 0;\n  try\n    {\n      if (width > 0)\n        miniexp_pprin_r(&io, p, width);\n      else\n        miniexp_prin_r(&io, p);\n      if (io.data[0])\n        r = miniexp_string((const char*)io.data[0]);\n      delete [] (char*)(io.data[0]);\n    }\n  catch(...)\n    {\n      delete [] (char*)(io.data[0]);\n    }\n  return r;\n}\n#endif\n\n\n/* ---- INPUT */\n\nstatic void\nappend(int c, char* &s, int &l, int &m)\n{\n  if (l >= m)\n    {\n      int nm = ((m<256)?256:m) + ((m>32000)?32000:m);\n      char *ns = new char[nm+1];\n      memcpy(ns, s, l);\n      delete [] s;\n      m = nm;\n      s = ns;\n    }\n  s[l++] = c;\n  s[l] = 0;\n}\n\nstatic void\nskip_blank(miniexp_io_t *io, int &c)\n{\n  while (isspace(c))\n    c = io->fgetc(io);\n}\n\nstatic miniexp_t\nread_error(miniexp_io_t *io, int &c)\n{\n  while (c!=EOF && c!='\\n')\n    c = io->fgetc(io);\n  return miniexp_dummy;\n}\n\nstatic miniexp_t\nread_c_string(miniexp_io_t *io, int &c)\n{\n  miniexp_t r;\n  char *s = 0;\n  int l = 0;\n  int m = 0;\n  ASSERT(c == '\\\"');\n  c = io->fgetc(io);\n  for(;;)\n    {\n      if (c==EOF || (isascii(c) && !isprint(c)))\n        return read_error(io, c);\n      else if (c=='\\\"')\n        break;\n      else if (c=='\\\\')\n        {\n          c = io->fgetc(io);\n          if (c == '\\n')             // LF\n            {\n              c = io->fgetc(io);\n              if (c == '\\r')         // LFCR\n                c = io->fgetc(io);\n              continue;\n            }\n          else if (c == '\\r')        // CR\n            {\n              c = io->fgetc(io);\n              if (c == '\\n')         // CRLF\n                c = io->fgetc(io);\n              continue;\n            }\n          else if (c>='0' && c<='7')\n            {\n              int x = (c-'0');\n              c = io->fgetc(io);\n              if (c>='0' && c<='7')\n                {\n                  x = (x<<3)+(c-'0');\n                  c = io->fgetc(io);\n                  if (c>='0' && c<='7')\n                    {\n                      x = (x<<3)+(c-'0');\n                      c = io->fgetc(io);\n                    }\n                }\n              append((char)x, s, l, m);\n              continue;\n            }\n          else if (c=='x' || c=='X')\n            {\n              int x = 0;\n              int d = c;\n              c = io->fgetc(io);\n              if (isxdigit(c))\n                {\n                  x = (x<<4) + (isdigit(c) ? c-'0' : toupper(c)-'A'+10);\n                  c = io->fgetc(io);\n                  if (isxdigit(c))\n                    {\n                      x = (x<<4) + (isdigit(c) ? c-'0' : toupper(c)-'A'+10);\n                      c = io->fgetc(io);\n                    }\n                  append((char)x, s, l, m);\n                  continue;\n                }\n              else\n                {\n                  io->ungetc(io, c);\n                  c = d;\n                }\n            }\n          static const char *tr1 = \"tnrbfva\";\n          static const char *tr2 = \"\\t\\n\\r\\b\\f\\013\\007\";\n          for (int i=0; tr1[i]; i++)\n            if (c == tr1[i])\n              c = tr2[i];\n        }\n      append(c,s,l,m);\n      c = io->fgetc(io);\n    }\n  c = io->fgetc(io);\n  r = miniexp_string(s ? s : \"\");\n  delete [] s;\n  return r;\n}\n\nstatic miniexp_t\nread_quoted_symbol(miniexp_io_t *io, int &c)\n{\n  miniexp_t r;\n  char *s = 0;\n  int l = 0;\n  int m = 0;\n  ASSERT(c == '|');\n  for(;;)\n    {\n      c = io->fgetc(io);\n      if (c==EOF || (isascii(c) && !isprint(c)))\n        return read_error(io, c);\n      if (c=='|')\n        break;\n      append(c,s,l,m);\n    }\n  c = io->fgetc(io);\n  r = miniexp_symbol(s ? s : \"\");\n  delete [] s;\n  return r;\n}\n\nstatic miniexp_t\nread_symbol_or_number(miniexp_io_t *io, int &c)\n{\n  miniexp_t r;\n  char *s = 0;\n  int l = 0;\n  int m = 0;\n  for(;;)\n    {\n      if (c==EOF || c=='(' || c==')' || c=='|' || c=='\\\"'  \n          || isspace(c) || !isascii(c) || !isprint(c) \n          || (io->p_macrochar && io->p_macroqueue  \n              && c < 128 && c >= 0 && io->p_macrochar[c] ) )\n        break;\n      append(c,s,l,m);\n      c = io->fgetc(io);\n    }\n  if (l <= 0)\n    return read_error(io, c);\n  char *end;\n  long x = strtol(s, &end, 0);\n  if (*end)\n    r = miniexp_symbol(s);\n  else\n    r = miniexp_number((int)x);\n  delete [] s;\n  return r;\n}\n\nstatic miniexp_t\nread_miniexp(miniexp_io_t *io, int &c)\n{\n  for(;;)\n    {\n      if (io->p_macroqueue && miniexp_consp(*io->p_macroqueue))\n        {\n          miniexp_t p = car(*io->p_macroqueue);\n          *io->p_macroqueue = cdr(*io->p_macroqueue);\n          return p;\n        }\n      skip_blank(io, c);\n      if (c == EOF)\n        {\n          return read_error(io, c);\n        }\n      else if (c == ')')\n        {\n          c = io->fgetc(io);\n          continue;\n        }\n      else if (c == '(')\n        {\n          minivar_t l;\n          miniexp_t *where = &l;\n          minivar_t p;\n          c = io->fgetc(io);\n          for(;;)\n            {\n              skip_blank(io, c);\n              if (c == ')')\n                break;\n              if (c == '.')\n                {\n                  int d = io->fgetc(io);\n                  io->ungetc(io, d);\n                  if (isspace(d)) \n                    break;\n                }\n              p = read_miniexp(io, c);\n              if ((miniexp_t)p == miniexp_dummy)\n                return miniexp_dummy;\n              *where = miniexp_cons(p, miniexp_nil);\n              where = &cdr(*where);\n            }\n          if (c == '.')\n            {\n              c = io->fgetc(io);\n              skip_blank(io, c);\n              if (c != ')')\n                *where = read_miniexp(io, c);\n            }\n          skip_blank(io, c);\n          if (c != ')')\n            return read_error(io, c);\n          c = io->fgetc(io);\n          return l;\n        }\n      else if (c == '\"')\n        {\n          return read_c_string(io, c);\n        }\n      else if (c == '|')\n        {\n          return read_quoted_symbol(io, c);\n        }\n      else if (io->p_macrochar && io->p_macroqueue \n               && c >= 0 && c < 128 && io->p_macrochar[c])\n        {\n          miniexp_t p = io->p_macrochar[c](io);\n          if (miniexp_length(p) > 0)\n            *io->p_macroqueue = p;\n          c = io->fgetc(io);\n          continue;\n        }\n      else if (c == '#' && io->p_diezechar && io->p_macroqueue)\n        {\n          int nc = io->fgetc(io);\n          if (nc >= 0 && nc < 128 && io->p_diezechar[nc])\n            {\n              miniexp_t p = io->p_macrochar[nc](io);\n              if (miniexp_length(p) > 0)\n                *io->p_macroqueue = p;\n              c = io->fgetc(io);\n              continue;\n            }\n          io->ungetc(io, nc);\n          // fall thru\n        }\n      // default\n      return read_symbol_or_number(io, c);\n    }\n}\n\nminiexp_t \nminiexp_read_r(miniexp_io_t *io)\n{\n  int c = io->fgetc(io);\n  miniexp_t p = read_miniexp(io, c);\n  io->ungetc(io, c);\n  return p;\n}\n\n\n/* ---- COMPAT */\n\nminiexp_t miniexp_read(void)\n{\n  return miniexp_read_r(&miniexp_io);\n}\n\nminiexp_t miniexp_prin(miniexp_t p)\n{\n  return miniexp_prin_r(&miniexp_io, p);\n}\n\nminiexp_t miniexp_print(miniexp_t p)\n{\n  return miniexp_print_r(&miniexp_io, p);\n}\n\nminiexp_t miniexp_pprin(miniexp_t p, int w)\n{\n  return miniexp_pprin_r(&miniexp_io, p, w);\n}\n\nminiexp_t miniexp_pprint(miniexp_t p, int w)\n{\n  return miniexp_pprint_r(&miniexp_io, p, w);\n}\n\nvoid \nminilisp_set_output(FILE *f)\n{\n  minilisp_puts = compat_puts;\n  miniexp_io_set_output(&miniexp_io, f);\n}\n\nvoid \nminilisp_set_input(FILE *f)\n{\n  minilisp_getc = compat_getc;\n  minilisp_ungetc = compat_ungetc;\n  miniexp_io_set_input(&miniexp_io, f);\n}\n\n\n\n\n/* -------------------------------------------------- */\n/* CLEANUP (SEE GC ABOVE)                             */\n/* -------------------------------------------------- */\n\nstatic void\ngc_clear(miniexp_t *pp)\n{\n  *pp = 0;\n}\n\nvoid\nminilisp_finish(void)\n{\n  ASSERT(!gc.lock);\n  // clear minivars\n  minivar_t::mark(gc_clear);\n  for (int i=0; i<recentsize; i++)\n    gc.recent[i] = 0;\n  // collect everything\n  gc_run();\n  // deallocate mblocks\n  ASSERT(gc.pairs_free == gc.pairs_total);\n  while (gc.pairs_blocks)\n    {\n      block_t *b = gc.pairs_blocks;\n      gc.pairs_blocks = b->next;\n      delete b;\n    }\n  ASSERT(gc.objs_free == gc.objs_total);\n  while (gc.objs_blocks)\n    {\n      block_t *b = gc.objs_blocks;\n      gc.objs_blocks = b->next;\n      delete b;\n    }\n  // deallocate symbol table\n  delete symbols;\n}\n\n\n"
  },
  {
    "path": "ext/libdjvu/miniexp.h",
    "content": "/* -*- C -*-\n// -------------------------------------------------------------------\n// MiniExp - Library for handling lisp expressions\n// Copyright (c) 2005  Leon Bottou\n//\n// This software is subject to, and may be distributed under, the\n// GNU General Public License, either Version 2 of the license,\n// or (at your option) any later version. The license should have\n// accompanied the software or you may obtain a copy of the license\n// from the Free Software Foundation at http://www.fsf.org .\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n// -------------------------------------------------------------------\n*/\n\n#ifndef MINIEXP_H\n#define MINIEXP_H\n\n#ifdef __cplusplus\nextern \"C\" { \n# ifndef __cplusplus\n}\n# endif\n#endif\n\n#ifndef MINILISPAPI\n# ifdef WIN32\n#  ifdef DLL_EXPORT\n#   define MINILISPAPI __declspec(dllexport)\n#  else\n#   define MINILISPAPI __declspec(dllimport)\n#  endif\n# endif\n#endif\n#ifndef MINILISPAPI\n# define MINILISPAPI /**/\n#endif\n\n#include <stddef.h>  \n\n/* -------------------------------------------------- */\n/* LISP EXPRESSIONS                                   */\n/* -------------------------------------------------- */\n\n/* miniexp_t -- \n   Opaque pointer type representing a lisp expression,\n   also known as s-expression. \n   S-expressions can be viewed as a simple and powerful \n   alternative to XML.  DjVu uses s-expressions to handle\n   annotations. Both the decoding api <ddjvuapi.h> and \n   program <djvused> use s-expressions to describe the \n   hidden text information and the navigation \n   information */\n\n\ntypedef struct miniexp_s* miniexp_t;\n\n\n/* There are four basic types of lisp expressions,\n   numbers, symbols, pairs, and objects.\n   The latter category can represent any c++ object\n   that inherits class <miniobj_t> defined later in this file.\n   The only such objects defined in this file are strings. */\n\n\n/* -------- NUMBERS -------- */\n\n/* Minilisp numbers can represent any integer \n   in range [-2^29...2^29-1] */\n\n\n/* miniexp_numberp --\n   Tests if an expression is a number. */\n\nstatic inline int miniexp_numberp(miniexp_t p) {\n  return (((size_t)(p)&3)==3);\n}\n\n/* miniexp_to_int --\n   Returns the integer corresponding to a lisp expression.\n   Assume that the expression is indeed a number. */\n\nstatic inline int miniexp_to_int(miniexp_t p) {\n  return (((int)(size_t)(p))>>2);\n}\n\n/* miniexp_number --\n   Constructs the expression corresponding to an integer. */\n\nstatic inline miniexp_t miniexp_number(int x) {\n  return (miniexp_t) (size_t) ((x<<2)|3);\n}\n   \n\n\n/* -------- SYMBOLS -------- */\n\n/* The textual representation of a minilisp symbol is a \n   sequence of printable characters forming an identifier. \n   Each symbol has a unique representation and remain \n   permanently allocated. To compare two symbols, \n   simply compare the <miniexp_t> pointers. */\n\n\n/* miniexp_symbolp --\n   Tests if an expression is a symbol. */\n\nstatic inline int miniexp_symbolp(miniexp_t p) {\n  return ((((size_t)p)&3)==2);\n}\n\n/* miniexp_to_name --\n   Returns the symbol name as a string.\n   Returns NULL if the expression is not a symbol. */\n   \nMINILISPAPI const char* miniexp_to_name(miniexp_t p);\n\n/* miniexp_symbol --\n   Returns the unique symbol expression with the specified name. */\n\nMINILISPAPI miniexp_t miniexp_symbol(const char *name);\n\n\n\n/* -------- PAIRS -------- */\n\n/* Pairs (also named \"cons\") are the basic building blocks for \n   minilisp lists. Each pair contains two expression:\n   - the <car> represents the first element of a list.\n   - the <cdr> usually is a pair representing the rest of the list.\n   The empty list is represented by a null pointer. */\n\n\n/* miniexp_nil --\n   The empty list. */\n\n#define miniexp_nil ((miniexp_t)(size_t)0)\n\n/* miniexp_dummy --\n   An invalid expression used to represent\n   various exceptional conditions. */\n\n#define miniexp_dummy ((miniexp_t)(size_t)2)\n\n/* miniexp_listp --\n   Tests if an expression is either a pair or the empty list. */   \n\nstatic inline int miniexp_listp(miniexp_t p) {\n  return ((((size_t)p)&3)==0);\n}\n\n/* miniexp_consp --\n   Tests if an expression is a pair. */\n\nstatic inline int miniexp_consp(miniexp_t p) {\n  return p && miniexp_listp(p);\n}\n\n/* miniexp_length --\n   Returns the length of a list.\n   Returns 0 for non lists, -1 for circular lists. */\n\nMINILISPAPI int miniexp_length(miniexp_t p);\n\n/* miniexp_car --\n   miniexp_cdr --\n   Returns the car or cdr of a pair. */\n\nstatic inline miniexp_t miniexp_car(miniexp_t p) {\n  if (miniexp_consp(p))\n    return ((miniexp_t*)p)[0];\n  return miniexp_nil;\n}\n\nstatic inline miniexp_t miniexp_cdr(miniexp_t p) {\n  if (miniexp_consp(p))\n    return ((miniexp_t*)p)[1];\n  return miniexp_nil;\n}\n\n/* miniexp_cXXr --\n   Represent common combinations of car and cdr. */\n\nMINILISPAPI miniexp_t miniexp_caar (miniexp_t p);\nMINILISPAPI miniexp_t miniexp_cadr (miniexp_t p);\nMINILISPAPI miniexp_t miniexp_cdar (miniexp_t p);\nMINILISPAPI miniexp_t miniexp_cddr (miniexp_t p);\nMINILISPAPI miniexp_t miniexp_caddr(miniexp_t p);\nMINILISPAPI miniexp_t miniexp_cdddr(miniexp_t p);\n\n/* miniexp_nth --\n   Returns the n-th element of a list. */\n\nMINILISPAPI miniexp_t miniexp_nth(int n, miniexp_t l);\n\n/* miniexp_cons --\n   Constructs a pair. */\n\nMINILISPAPI miniexp_t miniexp_cons(miniexp_t car, miniexp_t cdr);\n\n/* miniexp_rplaca --\n   miniexp_rplacd --\n   Changes the car or the cdr of a pair. */\n\nMINILISPAPI miniexp_t miniexp_rplaca(miniexp_t pair, miniexp_t newcar);\nMINILISPAPI miniexp_t miniexp_rplacd(miniexp_t pair, miniexp_t newcdr);\n\n/* miniexp_reverse --\n   Reverses a list in place. */\n\nMINILISPAPI miniexp_t miniexp_reverse(miniexp_t p);\n\n\n/* -------- OBJECTS (GENERIC) -------- */\n\n/* Object expressions represent a c++ object\n   that inherits class <miniobj_t> defined later.\n   Each object expression has a symbolic class name\n   and a pointer to the c++ object. */\n\n/* miniexp_objectp --\n   Tests if an expression is an object. */\n\nstatic inline int miniexp_objectp(miniexp_t p) {\n  return ((((size_t)p)&3)==1);\n}\n\n/* miniexp_classof --\n   Returns the symbolic class of an expression.\n   Returns nil if the expression is not an object. */\n\nMINILISPAPI miniexp_t miniexp_classof(miniexp_t p);\n\n/* miniexp_isa --\n   If <p> is an instance of class named <c> or one of\n   its subclasses, returns the actual class name.\n   Otherwise returns miniexp_nil. */\n\nMINILISPAPI miniexp_t miniexp_isa(miniexp_t p, miniexp_t c);\n\n\n/* -------- OBJECTS (STRINGS) -------- */\n\n/* miniexp_stringp --\n   Tests if an expression is a string. */\n\nMINILISPAPI int miniexp_stringp(miniexp_t p);\n\n/* miniexp_to_str --\n   Returns the c string represented by the expression.\n   Returns NULL if the expression is not a string.\n   The c string remains valid as long as the\n   corresponding lisp object exists. */\n\nMINILISPAPI const char *miniexp_to_str(miniexp_t p);\n\n/* miniexp_string --\n   Constructs a string expression by copying string s. */\n\nMINILISPAPI miniexp_t miniexp_string(const char *s);\n\n/* miniexp_substring --\n   Constructs a string expression by copying \n   at most n character from string s. */\n\nMINILISPAPI miniexp_t miniexp_substring(const char *s, int n);\n\n/* miniexp_concat --\n   Concat all the string expressions in list <l>. */\n\nMINILISPAPI miniexp_t miniexp_concat(miniexp_t l);\n\n\n\n\n\n/* -------------------------------------------------- */\n/* GARBAGE COLLECTION                                 */\n/* -------------------------------------------------- */\n\n\n/* The garbage collector reclaims the memory allocated for\n   lisp expressions no longer in use.  It is automatically\n   invoked by the pair and object allocation functions when\n   the available memory runs low.  It is however possible to\n   temporarily disable it.\n\n   The trick is to determine which lisp expressions are in\n   use at a given moment. This package takes a simplistic\n   approach. All objects of type <minivar_t> are chained and\n   can reference an arbitrary lisp expression.  Garbage\n   collection preserves all lisp expressions referenced by a\n   minivar, as well as all lisp expressions that can be\n   accessed from these. When called automatically, \n   garbage collection also preserves the sixteen most recently \n   created miniexps in order to make sure that temporaries do \n   not vanish in the middle of complicated C expressions.\n     \n   The minivar class is designed such that C++ program can\n   directly use instances of <minivar_t> as normal\n   <miniexp_t> variables.  There is almost no overhead\n   accessing or changing the lisp expression referenced by a\n   minivar. However, the minivar chain must be updated\n   whenever the minivar object is constructed or destructed.\n   \n   Example (in C++ only):\n     miniexp_t copy_in_reverse(miniexp_t p) {\n        minivar_t l = miniexp_nil;\n        while (miniexp_consp(p)) {\n          l = miniexp_cons(miniexp_car(p), l); \n          p = miniexp_cdr(p); \n        }\n        return l;\n     }\n\n   When to use minivar_t instead of miniexp_t?\n\n   * A function that only navigates properly secured\n     s-expressions without modifying them does not need to\n     bother about minivars.\n\n   * Only the following miniexp functions can cause a\n     garbage collection: miniexp_cons(), miniexp_object(),\n     miniexp_string(), miniexp_substring(),\n     miniexp_concat(), miniexp_pprin(), miniexp_pprint(),\n     miniexp_gc(), and minilisp_release_gc_lock().  A\n     function that does not cause calls to these functions\n     does not need to bother about minivars.\n\n   * Other functions should make sure that all useful\n     s-expression are directly or indirectly secured by a\n     minivar_t object. In case of doubt, use minivars\n     everywhere.\n\n   * Function arguments should remain <miniexp_t> in order\n     to allow interoperability with the C language. As a\n     consequence, functions must often copy their arguments\n     into minivars in order to make sure they remain\n     allocated. A small performance improvement can be\n     achieved by deciding that the function should always be\n     called using properly secured arguments. This is more\n     difficult to get right.\n\n   C programs cannot use minivars as easily as C++ programs.\n   Wrappers are provided to allocate minivars and to access\n   their value. This is somehow inconvenient.  It might be\n   more practical to control the garbage collector\n   invocations with <minilisp_acquire_gc_lock()> and\n   <minilisp_release_gc_lock()>...  */\n   \n\n/* minilisp_gc --\n   Invokes the garbage collector now. */\n\nMINILISPAPI void minilisp_gc(void);\n\n/* minilisp_info --\n   Prints garbage collector statistics. */\n\nMINILISPAPI void minilisp_info(void);\n\n/* minilisp_acquire_gc_lock --\n   minilisp_release_gc_lock --\n   Temporarily disables automatic garbage collection.\n   Acquire/release pairs may be nested. \n   Both functions return their argument unmodified.\n   This is practical because <minilisp_release_gc_lock>\n   can invoke the garbage collector. Before doing\n   so it stores its argument in a minivar to \n   preserve it. \n\n   Example (in C):\n     miniexp_t copy_in_reverse(miniexp_t p) {\n        miniexp_t l = 0;\n        minilisp_acquire_gc_lock(0);\n        while (miniexp_consp(p)) {\n          l = miniexp_cons(miniexp_car(p), l); \n          p = miniexp_cdr(p); \n        }\n        return minilisp_release_gc_lock(l); \n     }\n   \n   Disabling garbage collection for a long time \n   increases the memory consumption. */\n\nMINILISPAPI miniexp_t minilisp_acquire_gc_lock(miniexp_t);\nMINILISPAPI miniexp_t minilisp_release_gc_lock(miniexp_t);\n\n/* minivar_t --\n   The minivar type. */\n#ifdef __cplusplus\nclass minivar_t;\n#else\ntypedef struct minivar_s minivar_t;\n#endif\n\n/* minivar_alloc --\n   minivar_free --\n   Wrappers for creating and destroying minivars in C. */\n\nMINILISPAPI minivar_t *minivar_alloc(void);\nMINILISPAPI void minivar_free(minivar_t *v);\n\n/* minivar_pointer --\n   Wrappers to access the lisp expression referenced\n   by a minivar. This function returns a pointer\n   to the actual miniexp_t variable. */\n\nMINILISPAPI miniexp_t *minivar_pointer(minivar_t *v);\n\n/* minilisp_debug -- \n   Setting the debug flag runs the garbage collector \n   very often. This is extremely slow, but can be\n   useful to debug memory allocation problems. */\n\nMINILISPAPI void minilisp_debug(int debugflag);\n\n/* minilisp_finish --\n   Deallocates everything.  This is only useful when using\n   development tools designed to check for memory leaks.  \n   No miniexp function can be used after calling this. */\n\nMINILISPAPI void minilisp_finish(void);\n\n\n/* -------------------------------------------------- */\n/* INPUT/OUTPUT                                       */\n/* -------------------------------------------------- */\n\n/* Notes about the textual representation of miniexps.\n\n   - Special characters are:\n     * the parenthesis <(> and <)>,\n     * the double quote <\">,\n     * the vertical bar <|>,\n     * the dieze character <#>, when followed by an \n       ascii character with a non zero entry in the\n       dieze character array.\n     * any other ascii character with a non zero entry \n       in the macro character array.\n\n   - Symbols are represented by their name.\n     Vertical bars <|> can be used to delimit names that\n     contain blanks, special characters, non printable\n     characters, non ascii characters, or \n     can be confused for a number.\n     \n   - Numbers follow the syntax specified by the C\n     function strtol() with base=0.\n\n   - Strings are delimited by double quotes.\n     All C string escapes are recognized.\n     Non printable ascii characters must be escaped.\n\n   - List are represented by an open parenthesis <(>\n     followed by the space separated list elements,\n     followed by a closing parenthesis <)>.\n     When the cdr of the last pair is non zero,\n     the closed parenthesis is preceded by \n     a space, a dot <.>, a space, and the textual \n     representation of the cdr.\n\n   - When the parser encounters an ascii character corresponding\n     to a non zero function pointer in the macro character array,\n     the function is invoked and must return a possibly empty\n     list of miniexps to be returned by subsequent \n     invocations of the parser. The same process happens when\n     the parser encounters a dieze character followed by an \n     ascii character corresponding to a non zero function pointer\n     int the dieze character array. */\n\n\n/* miniexp_pname --\n   Returns a string containing the textual representation\n   of a minilisp expression. Set argument <width> to zero\n   to output a single line, or to a positive value to\n   perform pretty line breaks for this intended number of columns.\n   This function can cause a garbage collection to occur. */\n\nMINILISPAPI miniexp_t miniexp_pname(miniexp_t p, int width);\n\n\n/* miniexp_io_t -- \n   This structure is used to describe how to perform input/output\n   operations. Input/output operations are performed through function \n   pointers <fputs>, <fgetc>, and <ungetc>, which are similar to their \n   stdio counterparts. Variable <data> defines four pointers that can \n   be used as a closure by the I/O functions.\n      When <p_print7bits> is nonzero and points to a nonzero integer, all\n   non-ascii characters in strings are output as octal escapes. When both\n   <p_macrochar> and <p_macroqueue> are non zero, a non zero entry in\n   <p_macrochar[c]> defines a special parsing function that is called when\n   <miniexp_read_r> encounters the character <c> (in range 0 to 127.) \n   When both <p_diezechar> and <p_macroqueue> are non zero, a non zero \n   entry in <p_diezechar[c]> defines a special parsing function that \n   is called when <miniexp_read_r> encounters the character '#' followed\n   by character <c> (in range 0 to 127.)   These parsing functions return \n   a list of <miniexp_t> that function <miniexp_read_r> returns one-by-one \n   before processing more input. This list is in fact stored in the \n   variable pointed by <io.p_macroqueue>.  */\n\ntypedef struct miniexp_io_s miniexp_io_t;\ntypedef miniexp_t (*miniexp_macrochar_t)(miniexp_io_t*);\n\nstruct miniexp_io_s\n{\n  int (*fputs)(miniexp_io_t*, const char*);\n  int (*fgetc)(miniexp_io_t*);\n  int (*ungetc)(miniexp_io_t*, int);\n  void *data[4];\n  int *p_print7bits;\n  miniexp_macrochar_t *p_macrochar;\n  miniexp_macrochar_t *p_diezechar;\n  minivar_t *p_macroqueue;\n  minivar_t *p_reserved;\n};\n\n/* miniexp_io_init --\n   Initialize a default <miniexp_io_t> structure\n   that reads from stdin and prints to stdout. \n   Field <data[0]> is used to hold the stdin file pointer.\n   Field <data[1]> is used to hold the stdout file pointer.\n   Fields <p_print7bits>, <p_macrochar>, <p_diezechar>\n   and <p_macroqueue> are set to point to zero-initialized\n   shared variables. */\n\nMINILISPAPI void miniexp_io_init(miniexp_io_t *io);\n\n/* miniexp_io_set_{input,output} --\n   Override the file descriptor used for input or output.\n   You must call <miniexp_io_init> before. */\n\n#if defined(stdin)\nMINILISPAPI void miniexp_io_set_output(miniexp_io_t *io, FILE *f);\nMINILISPAPI void miniexp_io_set_input(miniexp_io_t *io, FILE *f);\n#endif\n\n/* miniexp_read_r --\n   Reads an expression by repeatedly\n   invoking <minilisp_getc> and <minilisp_ungetc>.\n   Returns <miniexp_dummy> when an error occurs. */\n\nMINILISPAPI miniexp_t miniexp_read_r(miniexp_io_t *io);\n\n/* miniexp_prin_r, miniexp_print_r --\n   Prints a minilisp expression by repeatedly invoking <minilisp_puts>.\n   Only <minilisp_print> outputs a final newline character. \n   These functions are safe to call anytime. */\n\nMINILISPAPI miniexp_t miniexp_prin_r(miniexp_io_t *io, miniexp_t p);\nMINILISPAPI miniexp_t miniexp_print_r(miniexp_io_t *io, miniexp_t p);\n\n/* miniexp_pprin_r, miniexp_pprint_r --\n   Prints a minilisp expression with reasonably pretty line breaks. \n   Argument <width> is the intended number of columns. \n   Only <minilisp_pprint> outputs a final newline character. \n   These functions can cause a garbage collection to occur. */\n\nMINILISPAPI miniexp_t miniexp_pprin_r(miniexp_io_t *io, miniexp_t p, int w);\nMINILISPAPI miniexp_t miniexp_pprint_r(miniexp_io_t *io, miniexp_t p, int w);\n\n/* miniexp_io, miniexp_read, miniexp_{,p}prin{,t} --\n   Variable <miniexp_io> contains the pre-initialized input/output data\n   structure that is used by the non-reentrant input/output functions. */\n\nextern MINILISPAPI miniexp_io_t miniexp_io;\nMINILISPAPI miniexp_t miniexp_read(void);\nMINILISPAPI miniexp_t miniexp_prin(miniexp_t p);\nMINILISPAPI miniexp_t miniexp_print(miniexp_t p);\nMINILISPAPI miniexp_t miniexp_pprin(miniexp_t p, int width);\nMINILISPAPI miniexp_t miniexp_pprint(miniexp_t p, int width);\n\n/* miniexp_macrochar, miniexp_macroqueue --\n   Function <miniexp_io_init> causes the corresponding pointers in the\n   <miniexp_io_t> structure to point to these variables.  A non zero entry in\n   <io.macrochar> defines a special parsing function that runs when\n   <miniexp_read_r> encounters the corresponding character. The parsing\n   function return a list of <miniexp_t> that function <miniexp_read_r>\n   returns one-by-one before processing more input. This list is in fact\n   stored in the variable pointed to by <io.macroqueue>. */\n \nextern MINILISPAPI miniexp_macrochar_t miniexp_macrochar[128];\nextern MINILISPAPI minivar_t miniexp_macroqueue;\n\n\n/* Backward compatibility. */\nextern MINILISPAPI int (*minilisp_puts)(const char *);\nextern MINILISPAPI int (*minilisp_getc)(void);\nextern MINILISPAPI int (*minilisp_ungetc)(int);\nextern MINILISPAPI miniexp_t (*minilisp_macrochar_parser[128])(void);\nextern MINILISPAPI miniexp_t (*minilisp_diezechar_parser[128])(void);\nextern MINILISPAPI int minilisp_print_7bits;\n#if defined(stdin)\nMINILISPAPI void minilisp_set_output(FILE *f);\nMINILISPAPI void minilisp_set_input(FILE *f);\n#endif\n\n/* -------------------------------------------------- */\n/* STUFF FOR C++ ONLY                                 */\n/* -------------------------------------------------- */\n\n#ifdef __cplusplus\n# ifndef __cplusplus\n{\n# endif\n} // extern \"C\"\n\ntypedef void minilisp_mark_t(miniexp_t *pp);\n\n/* -------- MINIVARS -------- */\n\n/* minivar_t --\n   A class for protected garbage collector variables. */\n\nclass MINILISPAPI \nminivar_t \n{\n  miniexp_t data;\n  minivar_t *next;\n  minivar_t **pprev;\npublic:\n  minivar_t();\n  minivar_t(miniexp_t p);\n  minivar_t(const minivar_t &v);\n  operator miniexp_t&() { return data; }\n  miniexp_t* operator&() { return &data; }\n  minivar_t& operator=(miniexp_t p) { data = p; return *this; }\n  minivar_t& operator=(const minivar_t &v) { data = v.data; return *this; }\n  ~minivar_t() { if ((*pprev = next)) next->pprev = pprev; }\n#ifdef MINIEXP_IMPLEMENTATION\n  static minivar_t *vars;\n  static void mark(minilisp_mark_t*);\n#endif\n};\n\n\n/* -------- MINIOBJ -------- */\n\n\n/* miniobj_t --\n   The base class for c++ objects \n   represented by object expressions. */\n\nclass MINILISPAPI \nminiobj_t {\n public:\n  virtual ~miniobj_t();\n\n  /* --- stuff defined by MINIOBJ_DECLARE --- */\n  /* classname: a symbol characterizing this class. */\n  static const miniexp_t classname;\n  /* classof: class name symbol for this object. */\n  virtual miniexp_t classof() const = 0;\n  /* isa -- tests if this is an instance of <classname>. */\n  virtual bool isa(miniexp_t classname) const;\n\n  /* --- optional stuff --- */\n  /* pname: returns a printable name for this object.\n     The caller must deallocate the result with delete[]. */\n  virtual char *pname() const;\n  /* mark: iterates over miniexps contained by this object\n     for garbage collecting purposes. */\n  virtual void mark(minilisp_mark_t*);\n  /* destroy: called by the garbage collector to\n     deallocate the object. Defaults to 'delete this'. */\n  virtual void destroy();\n     \n};\n\n/* MINIOBJ_DECLARE --\n   MINIOBJ_IMPLEMENT --\n   Useful code fragments for implementing \n   the mandatory part of miniobj subclasses. */\n\n#define MINIOBJ_DECLARE(cls, supercls, name) \\\n  public: static const miniexp_t classname; \\\n          virtual miniexp_t classof() const; \\\n          virtual bool isa(miniexp_t) const; \n\n#define MINIOBJ_IMPLEMENT(cls, supercls, name)\\\n  /* SumatraPDF: don't execute code until asked to */\\\n  const miniexp_t cls::classname = 0;\\\n  miniexp_t cls::classof() const {\\\n    return miniexp_symbol(name); }\\\n  bool cls::isa(miniexp_t n) const {\\\n    return (classof()==n) || (supercls::isa(n)); }\n\n\n/* miniexp_to_obj --\n   Returns a pointer to the object represented by an lisp\n   expression. Returns NULL if the expression is not an\n   object expression.\n*/\n\nstatic inline miniobj_t *miniexp_to_obj(miniexp_t p) {\n  if (miniexp_objectp(p))\n    return ((miniobj_t**)(((size_t)p)&~((size_t)3)))[0];\n  return 0;\n}\n\n/* miniexp_object --\n   Create an object expression for a given object. */\n\nMINILISPAPI miniexp_t miniexp_object(miniobj_t *obj);\n\n\n#endif /* __cplusplus */\n\n\n\n\n\n/* -------------------------------------------------- */\n/* THE END                                            */\n/* -------------------------------------------------- */\n\n#endif /* MINIEXP_H */\n"
  },
  {
    "path": "ext/libjpeg-turbo/BUILDING.txt",
    "content": "*******************************************************************************\n**     Building on Un*x Platforms (including Cygwin and OS X)\n*******************************************************************************\n\n\n==================\nBuild Requirements\n==================\n\n-- autoconf 2.56 or later\n-- automake 1.7 or later\n-- libtool 1.4 or later\n   * If using Xcode 4.3 or later on OS X, autoconf and automake are no longer\n     provided.  The easiest way to obtain them is from MacPorts\n     (http://www.macports.org/).\n\n-- NASM (if building x86 or x86-64 SIMD extensions)\n   * 0.98, or 2.01 or later is required for a 32-bit build\n   * NASM 2.00 or later is required for a 64-bit build\n   * NASM 2.07 or later is required for a 64-bit build on OS X.  This can be\n     obtained from MacPorts (http://www.macports.org/).\n\n   The binary RPMs released by the NASM project do not work on older Linux\n   systems, such as Red Hat Enterprise Linux 4.  On such systems, you can\n   easily build and install NASM from a source RPM by downloading one of the\n   SRPMs from\n\n   http://www.nasm.us/pub/nasm/releasebuilds\n\n   and executing the following as root:\n\n     ARCH=`uname -m`\n     rpmbuild --rebuild nasm-{version}.src.rpm\n     rpm -Uvh /usr/src/redhat/RPMS/$ARCH/nasm-{version}.$ARCH.rpm\n\n   NOTE: the NASM build will fail if texinfo is not installed.\n\n-- GCC v4.1 or later recommended for best performance\n   * Beginning with Xcode 4, Apple stopped distributing GCC and switched to\n     the LLVM compiler.  Xcode v4.0 through v4.6 provides a GCC front end\n     called LLVM-GCC.  Unfortunately, as of this writing, neither LLVM-GCC nor\n     the LLVM (clang) compiler produces optimal performance with libjpeg-turbo.\n     Building libjpeg-turbo with LLVM-GCC v4.2 results in a 10% performance\n     degradation when compressing using 64-bit code, relative to building\n     libjpeg-turbo with GCC v4.2.  Building libjpeg-turbo with LLVM (clang)\n     results in a 20% performance degradation when compressing using 64-bit\n     code, relative to building libjpeg-turbo with GCC v4.2.  If you are\n     running Snow Leopard or earlier, it is suggested that you continue to use\n     Xcode v3.2.6, which provides GCC v4.2.  If you are using Lion or later, it\n     is suggested that you install Apple GCC v4.2 through MacPorts.\n\n-- If building the TurboJPEG Java wrapper, JDK or OpenJDK 1.5 or later is\n   required.  Some systems, such as OS X 10.4, Solaris 10 and later, and Red\n   Hat Enterprise Linux 5 and later, have this pre-installed.  On OS X 10.5 and\n   later, it will be necessary to install the Java Developer Package, which can\n   be downloaded from http://developer.apple.com/downloads (Apple ID required.)\n   For systems that do not have a JDK installed, you can obtain the Oracle Java\n   Development Kit from http://www.java.com.\n\n\n==================\nOut-of-Tree Builds\n==================\n\nBinary objects, libraries, and executables are generated in the same directory\nfrom which configure was executed (the \"binary directory\"), and this directory\nneed not necessarily be the same as the libjpeg-turbo source directory.  You\ncan create multiple independent binary directories, in which different versions\nof libjpeg-turbo can be built from the same source tree using different\ncompilers or settings.  In the sections below, {build_directory} refers to the\nbinary directory, whereas {source_directory} refers to the libjpeg-turbo source\ndirectory.  For in-tree builds, these directories are the same.\n\n\n======================\nBuilding libjpeg-turbo\n======================\n\nThe following procedure will build libjpeg-turbo on Linux, FreeBSD, Cygwin, and\nSolaris/x86 systems (on Solaris, this generates a 32-bit library.  See below\nfor 64-bit build instructions.)\n\n  cd {source_directory}\n  autoreconf -fiv\n  cd {build_directory}\n  sh {source_directory}/configure [additional configure flags]\n  make\n\nNOTE: Running autoreconf in the source directory is usually only necessary if\nbuilding libjpeg-turbo from the SVN repository.\n\nThis will generate the following files under .libs/\n\n  libjpeg.a\n      Static link library for the libjpeg API\n\n  libjpeg.so.{version} (Linux, Unix)\n  libjpeg.{version}.dylib (OS X)\n  cygjpeg-{version}.dll (Cygwin)\n      Shared library for the libjpeg API\n\n  By default, {version} is 62.1.0, 7.1.0, or 8.0.2, depending on whether\n  libjpeg v6b (default), v7, or v8 emulation is enabled.  If using Cygwin,\n  {version} is 62, 7, or 8.\n\n  libjpeg.so (Linux, Unix)\n  libjpeg.dylib (OS X)\n      Development symlink for the libjpeg API\n\n  libjpeg.dll.a (Cygwin)\n      Import library for the libjpeg API\n\n  libturbojpeg.a\n      Static link library for the TurboJPEG API\n\n  libturbojpeg.so.0.0.0 (Linux, Unix)\n  libturbojpeg.0.0.0.dylib (OS X)\n  cygturbojpeg-0.dll (Cygwin)\n      Shared library for the TurboJPEG API\n\n  libturbojpeg.so (Linux, Unix)\n  libturbojpeg.dylib (OS X)\n      Development symlink for the TurboJPEG API\n\n  libturbojpeg.dll.a (Cygwin)\n      Import library for the TurboJPEG API\n\n\nlibjpeg v7 or v8 API/ABI Emulation\n----------------------------------\n\nAdd --with-jpeg7 to the configure command line to build a version of\nlibjpeg-turbo that is API/ABI-compatible with libjpeg v7.  Add --with-jpeg8 to\nthe configure command to build a version of libjpeg-turbo that is\nAPI/ABI-compatible with libjpeg v8.  See README-turbo.txt for more information\non libjpeg v7 and v8 emulation.\n\n\nIn-Memory Source/Destination Managers\n-------------------------------------\n\nWhen using libjpeg v6b or v7 API/ABI emulation, add --without-mem-srcdst to the\nconfigure command line to build a version of libjpeg-turbo that lacks the\njpeg_mem_src() and jpeg_mem_dest() functions.  These functions were not part of\nthe original libjpeg v6b and v7 APIs, so removing them ensures strict\nconformance with those APIs.  See README-turbo.txt for more information.\n\n\nArithmetic Coding Support\n-------------------------\n\nSince the patent on arithmetic coding has expired, this functionality has been\nincluded in this release of libjpeg-turbo.  libjpeg-turbo's implementation is\nbased on the implementation in libjpeg v8, but it works when emulating libjpeg\nv7 or v6b as well.  The default is to enable both arithmetic encoding and\ndecoding, but those who have philosophical objections to arithmetic coding can\nadd --without-arith-enc or --without-arith-dec to the configure command line to\ndisable encoding or decoding (respectively.)\n\n\nTurboJPEG Java Wrapper\n----------------------\nAdd --with-java to the configure command line to incorporate an optional Java\nNative Interface wrapper into the TurboJPEG shared library and build the Java\nfront-end classes to support it.  This allows the TurboJPEG shared library to\nbe used directly from Java applications.  See java/README for more details.\n\nYou can set the JAVAC, JAR, and JAVA configure variables to specify\nalternate commands for javac, jar, and java (respectively.)  You can also\nset the JAVACFLAGS configure variable to specify arguments that should be\npassed to the Java compiler when building the front-end classes, and JNI_CFLAGS\nto specify arguments that should be passed to the C compiler when building the\nJNI wrapper.  Run 'configure --help' for more details.\n\n\n========================\nInstalling libjpeg-turbo\n========================\n\nIf you intend to install these libraries and the associated header files, then\nreplace 'make' in the instructions above with\n\n  make install prefix={base dir} libdir={library directory}\n\nFor example,\n\n  make install prefix=/usr/local libdir=/usr/local/lib64\n\nwill install the header files in /usr/local/include and the library files in\n/usr/local/lib64.  If 'prefix' and 'libdir' are not specified, then the default\nis to install the header files in /opt/libjpeg-turbo/include and the library\nfiles in /opt/libjpeg-turbo/lib32 (32-bit) or /opt/libjpeg-turbo/lib64\n(64-bit.)\n\nNOTE: You can specify a prefix of /usr and a libdir of, for instance,\n/usr/lib64 to overwrite the system's version of libjpeg.  If you do this,\nhowever, then be sure to BACK UP YOUR SYSTEM'S INSTALLATION OF LIBJPEG before\noverwriting it.  It is recommended that you instead install libjpeg-turbo into\na non-system directory and manipulate the LD_LIBRARY_PATH or create symlinks\nto force applications to use libjpeg-turbo instead of libjpeg.  See\nREADME-turbo.txt for more information.\n\n\n=============\nBuild Recipes\n=============\n\n\n32-bit Build on 64-bit Linux\n----------------------------\n\nAdd\n\n  --host i686-pc-linux-gnu CFLAGS='-O3 -m32' LDFLAGS=-m32\n\nto the configure command line.\n\n\n64-bit Build on 64-bit OS X\n---------------------------\n\nAdd\n\n  --host x86_64-apple-darwin NASM=/opt/local/bin/nasm\n\nto the configure command line.  NASM 2.07 or later from MacPorts must be\ninstalled.\n\n\n32-bit Build on 64-bit OS X\n---------------------------\n\nAdd\n\n  --host i686-apple-darwin CFLAGS='-O3 -m32' LDFLAGS=-m32\n\nto the configure command line.\n\n\n64-bit Backward-Compatible Build on 64-bit OS X\n-----------------------------------------------\n\nAdd\n\n  --host x86_64-apple-darwin NASM=/opt/local/bin/nasm \\\n  CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \\\n    -mmacosx-version-min=10.4 -O3' \\\n    LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \\\n    -mmacosx-version-min=10.4'\n\nto the configure command line.  The OS X 10.4 SDK, and NASM 2.07 or later from\nMacPorts, must be installed.\n\n\n32-bit Backward-Compatible Build on OS X\n----------------------------------------\n\nAdd\n\n  --host i686-apple-darwin \\\n    CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \\\n    -mmacosx-version-min=10.4 -O3 -m32' \\\n    LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk \\\n    -mmacosx-version-min=10.4 -m32'\n\nto the configure command line.  The OS X 10.4 SDK must be installed.\n\n\n64-bit Library Build on 64-bit Solaris\n--------------------------------------\n\nAdd\n\n  --host x86_64-pc-solaris CFLAGS='-O3 -m64' LDFLAGS=-m64\n\nto the configure command line.\n\n\n32-bit Build on 64-bit FreeBSD\n------------------------------\n\nAdd\n\n  --host i386-unknown-freebsd CC='gcc -B /usr/lib32' CFLAGS='-O3 -m32' \\\n    LDFLAGS='-B/usr/lib32'\n\nto the configure command line.  NASM 2.07 or later from FreeBSD ports must be\ninstalled.\n\n\nOracle Solaris Studio\n---------------------\n\nAdd\n\n  CC=cc\n\nto the configure command line.  libjpeg-turbo will automatically be built with\nthe maximum optimization level (-xO5) unless you override CFLAGS.\n\nTo build a 64-bit version of libjpeg-turbo using Oracle Solaris Studio, add\n\n  --host x86_64-pc-solaris CC=cc CFLAGS='-xO5 -m64' LDFLAGS=-m64\n\nto the configure command line.\n\n\nMinGW Build on Cygwin\n---------------------\n\nUse CMake (see recipes below)\n\n\n===========\nARM Support\n===========\n\nThis release of libjpeg-turbo can use ARM NEON SIMD instructions to accelerate\nJPEG compression/decompression by approximately 2-4x on ARMv7 and later\nplatforms.  If libjpeg-turbo is configured on an ARM Linux platform, then the\nbuild system will automatically include the NEON SIMD routines, if they are\nsupported.\n\n\nBuilding libjpeg-turbo for iOS\n------------------------------\n\niOS platforms, such as the iPhone and iPad, also use ARM processors, some of\nwhich support NEON instructions.  Additional steps are required to build\nlibjpeg-turbo for these platforms.  The steps below assume iOS SDK v4.3.  If\nyou are using a different SDK version, then you will need to modify the\nexamples accordingly.\n\nAdditional build requirements:\n\n  gas-preprocessor.pl\n  (https://sourceforge.net/p/libjpeg-turbo/code/HEAD/tree/gas-preprocessor)\n  should be installed in your PATH.\n\nSet the following shell variables for simplicity:\n\n  Xcode 3.2.x / iOS 4.3 SDK:\n  IOS_PLATFORMDIR=/Developer/Platforms/iPhoneOS.platform\n  IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS4.3.sdk\n  IOS_GCC=$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2\n\n  Xcode 4.5.x / iOS 6.0 SDK:\n  IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform\n  IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS6.0.sdk\n  IOS_GCC=$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2\n\n  Xcode 4.6.x / iOS 6.1 SDK:\n  IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform\n  IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS6.1.sdk\n  IOS_GCC=$IOS_PLATFORMDIR/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2\n\n  Xcode 5.0.x / iOS 7.0 SDK:\n  IOS_PLATFORMDIR=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform\n  IOS_SYSROOT=$IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS7.0.sdk\n  IOS_GCC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang\n\n  ARM v6 only (up to and including iPhone 3G):\n  [NOTE: Requires Xcode 4.4.x or earlier]\n  IOS_CFLAGS=\"-march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp\"\n\n  ARM v7 only (iPhone 3GS-4S, iPad 1st-3rd Generation):\n  GCC:\n  IOS_CFLAGS=\"-march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon\"\n  Clang:\n  IOS_CFLAGS=\"-arch armv7 -no-integrated-as\"\n\n  ARM v7s only (iPhone 5, iPad 4th Generation):\n  [NOTE: Requires Xcode 4.5 or later]\n  GCC\n  IOS_CFLAGS=\"-march=armv7s -mcpu=swift -mtune=swift -mfpu=neon\"\n  Clang:\n  IOS_CFLAGS=\"-arch armv7s -no-integrated-as\"\n\nFollow the procedure under \"Building libjpeg-turbo\" above, adding\n\n  --host arm-apple-darwin10 --enable-static --disable-shared \\\n    CC=\"$IOS_GCC\" LD=\"$IOS_GCC\" \\\n    CFLAGS=\"-mfloat-abi=softfp -isysroot $IOS_SYSROOT -O3 $IOS_CFLAGS\" \\\n    LDFLAGS=\"-mfloat-abi=softfp -isysroot $IOS_SYSROOT $IOS_CFLAGS\"\n\nto the configure command line.\n\nOnce built, lipo can be used to combine the ARM v6, v7, and/or v7s variants\ninto a universal library.\n\nNOTE: If you are building libjpeg-turbo from the \"official\" project tarball,\nthen it is highly likely that you will need to run 'autoreconf -fiv' in the\nsource tree prior to building ARM v7 or v7s iOS binaries using the techniques\ndescribed above.  Otherwise, you may get a libtool error such as \"unable to\ninfer tagged configuration.\"\n\n\n*******************************************************************************\n**     Building on Windows (Visual C++ or MinGW)\n*******************************************************************************\n\n\n==================\nBuild Requirements\n==================\n\n-- CMake (http://www.cmake.org) v2.6 or later\n\n-- Microsoft Visual C++ 2005 or later\n\n   If you don't already have Visual C++, then the easiest way to get it is by\n   installing the Windows SDK:\n\n   http://msdn.microsoft.com/en-us/windows/bb980924.aspx\n\n   The Windows SDK includes both 32-bit and 64-bit Visual C++ compilers and\n   everything necessary to build libjpeg-turbo.\n\n   * For 32-bit builds, you can also use Microsoft Visual C++ Express\n     Edition.  Visual C++ Express Edition is a free download.\n   * If you intend to build libjpeg-turbo from the command line, then add the\n     appropriate compiler and SDK directories to the INCLUDE, LIB, and PATH\n     environment variables.  This is generally accomplished by executing\n     vcvars32.bat or vcvars64.bat and SetEnv.cmd.  vcvars32.bat and\n     vcvars64.bat are part of Visual C++ and are located in the same directory\n     as the compiler.  SetEnv.cmd is part of the Windows SDK.  You can pass\n     optional arguments to SetEnv.cmd to specify a 32-bit or 64-bit build\n     environment.\n\n... OR ...\n\n-- MinGW\n\n   GCC v4.1 or later recommended for best performance\n\n-- NASM (http://www.nasm.us/) 0.98 or later (NASM 2.05 or later is required for\n   a 64-bit build)\n\n-- If building the TurboJPEG Java wrapper, JDK 1.5 or later is required.  This\n   can be downloaded from http://www.java.com.\n\n\n==================\nOut-of-Tree Builds\n==================\n\nBinary objects, libraries, and executables are generated in the same directory\nfrom which cmake was executed (the \"binary directory\"), and this directory need\nnot necessarily be the same as the libjpeg-turbo source directory.  You can\ncreate multiple independent binary directories, in which different versions of\nlibjpeg-turbo can be built from the same source tree using different compilers\nor settings.  In the sections below, {build_directory} refers to the binary\ndirectory, whereas {source_directory} refers to the libjpeg-turbo source\ndirectory.  For in-tree builds, these directories are the same.\n\n\n======================\nBuilding libjpeg-turbo\n======================\n\n\nVisual C++ (Command Line)\n-------------------------\n\n  cd {build_directory}\n  cmake -G \"NMake Makefiles\" -DCMAKE_BUILD_TYPE=Release {source_directory}\n  nmake\n\nThis will build either a 32-bit or a 64-bit version of libjpeg-turbo, depending\non which version of cl.exe is in the PATH.\n\nThe following files will be generated under {build_directory}:\n\n  jpeg-static.lib\n      Static link library for the libjpeg API\n  sharedlib/jpeg{version}.dll\n      DLL for the libjpeg API\n  sharedlib/jpeg.lib\n      Import library for the libjpeg API\n  turbojpeg-static.lib\n      Static link library for the TurboJPEG API\n  turbojpeg.dll\n      DLL for the TurboJPEG API\n  turbojpeg.lib\n      Import library for the TurboJPEG API\n\n{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or\nv8 emulation is enabled.\n\n\nVisual C++ (IDE)\n----------------\n\nChoose the appropriate CMake generator option for your version of Visual Studio\n(run \"cmake\" with no arguments for a list of available generators.)  For\ninstance:\n\n  cd {build_directory}\n  cmake -G \"Visual Studio 9 2008\" {source_directory}\n\nYou can then open ALL_BUILD.vcproj in Visual Studio and build one of the\nconfigurations in that project (\"Debug\", \"Release\", etc.) to generate a full\nbuild of libjpeg-turbo.\n\nThis will generate the following files under {build_directory}:\n\n  {configuration}/jpeg-static.lib\n      Static link library for the libjpeg API\n  sharedlib/{configuration}/jpeg{version}.dll\n      DLL for the libjpeg API\n  sharedlib/{configuration}/jpeg.lib\n      Import library for the libjpeg API\n  {configuration}/turbojpeg-static.lib\n      Static link library for the TurboJPEG API\n  {configuration}/turbojpeg.dll\n      DLL for the TurboJPEG API\n  {configuration}/turbojpeg.lib\n      Import library for the TurboJPEG API\n\n{configuration} is Debug, Release, RelWithDebInfo, or MinSizeRel, depending on\nthe configuration you built in the IDE, and {version} is 62, 7, or 8,\ndepending on whether libjpeg v6b (default), v7, or v8 emulation is enabled.\n\n\nMinGW\n-----\n\n  cd {build_directory}\n  cmake -G \"MSYS Makefiles\" {source_directory}\n  make\n\nThis will generate the following files under {build_directory}\n\n  libjpeg.a\n      Static link library for the libjpeg API\n  sharedlib/libjpeg-{version}.dll\n      DLL for the libjpeg API\n  sharedlib/libjpeg.dll.a\n      Import library for the libjpeg API\n  libturbojpeg.a\n      Static link library for the TurboJPEG API\n  libturbojpeg.dll\n      DLL for the TurboJPEG API\n  libturbojpeg.dll.a\n      Import library for the TurboJPEG API\n\n{version} is 62, 7, or 8, depending on whether libjpeg v6b (default), v7, or\nv8 emulation is enabled.\n\n\nDebug Build\n-----------\n\nAdd \"-DCMAKE_BUILD_TYPE=Debug\" to the cmake command line.  Or, if building with\nNMake, remove \"-DCMAKE_BUILD_TYPE=Release\" (Debug builds are the default with\nNMake.)\n\n\nlibjpeg v7 or v8 API/ABI Emulation\n-----------------------------------\n\nAdd \"-DWITH_JPEG7=1\" to the cmake command line to build a version of\nlibjpeg-turbo that is API/ABI-compatible with libjpeg v7.  Add \"-DWITH_JPEG8=1\"\nto the cmake command to build a version of libjpeg-turbo that is\nAPI/ABI-compatible with libjpeg v8.  See README-turbo.txt for more information\non libjpeg v7 and v8 emulation.\n\n\nIn-Memory Source/Destination Managers\n-------------------------------------\n\nWhen using libjpeg v6b or v7 API/ABI emulation, add -DWITH_MEM_SRCDST=0 to the\nCMake command line to build a version of libjpeg-turbo that lacks the\njpeg_mem_src() and jpeg_mem_dest() functions.  These functions were not part of\nthe original libjpeg v6b and v7 APIs, so removing them ensures strict\nconformance with those APIs.  See README-turbo.txt for more information.\n\n\nArithmetic Coding Support\n-------------------------\n\nSince the patent on arithmetic coding has expired, this functionality has been\nincluded in this release of libjpeg-turbo.  libjpeg-turbo's implementation is\nbased on the implementation in libjpeg v8, but it works when emulating libjpeg\nv7 or v6b as well.  The default is to enable both arithmetic encoding and\ndecoding, but those who have philosophical objections to arithmetic coding can\nadd \"-DWITH_ARITH_ENC=0\" or \"-DWITH_ARITH_DEC=0\" to the cmake command line to\ndisable encoding or decoding (respectively.)\n\n\nTurboJPEG Java Wrapper\n----------------------\nAdd \"-DWITH_JAVA=1\" to the cmake command line to incorporate an optional Java\nNative Interface wrapper into the TurboJPEG shared library and build the Java\nfront-end classes to support it.  This allows the TurboJPEG shared library to\nbe used directly from Java applications.  See java/README for more details.\n\nIf you are using CMake 2.8, you can set the Java_JAVAC_EXECUTABLE,\nJava_JAVA_EXECUTABLE, and Java_JAR_EXECUTABLE CMake variables to specify\nalternate commands or locations for javac, jar, and java (respectively.)  If\nyou are using CMake 2.6, set JAVA_COMPILE, JAVA_RUNTIME, and JAVA_ARCHIVE\ninstead.  You can also set the JAVACFLAGS CMake variable to specify arguments\nthat should be passed to the Java compiler when building the front-end classes.\n\n\n========================\nInstalling libjpeg-turbo\n========================\n\nYou can use the build system to install libjpeg-turbo into a directory of your\nchoosing (as opposed to creating an installer.)  To do this, add:\n\n  -DCMAKE_INSTALL_PREFIX={install_directory}\n\nto the cmake command line.\n\nFor example,\n\n  cmake -G \"NMake Makefiles\" -DCMAKE_BUILD_TYPE=Release \\\n    -DCMAKE_INSTALL_PREFIX=c:\\libjpeg-turbo {source_directory}\n  nmake install\n\nwill install the header files in c:\\libjpeg-turbo\\include, the library files\nin c:\\libjpeg-turbo\\lib, the DLL's in c:\\libjpeg-turbo\\bin, and the\ndocumentation in c:\\libjpeg-turbo\\doc.\n\n\n=============\nBuild Recipes\n=============\n\n\n64-bit MinGW Build on Cygwin\n----------------------------\n\n  cd {build_directory}\n  CC=/usr/bin/x86_64-w64-mingw32-gcc \\\n    cmake -G \"Unix Makefiles\" -DCMAKE_SYSTEM_NAME=Windows \\\n    -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar \\\n    -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib {source_directory}\n  make\n\nThis produces a 64-bit build of libjpeg-turbo that does not depend on\ncygwin1.dll or other Cygwin DLL's.  The mingw64-x86_64-gcc-core and\nmingw64-x86_64-gcc-g++ packages (and their dependencies) must be installed.\n\n\n32-bit MinGW Build on Cygwin\n----------------------------\n\n  cd {build_directory}\n  CC=/usr/bin/i686-w64-mingw32-gcc \\\n    cmake -G \"Unix Makefiles\" -DCMAKE_SYSTEM_NAME=Windows \\\n    -DDCMAKE_AR=/usr/bin/i686-w64-mingw32-ar \\\n    -DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib {source_directory}\n  make\n\nThis produces a 32-bit build of libjpeg-turbo that does not depend on\ncygwin1.dll or other Cygwin DLL's.  The mingw64-i686-gcc-core and\nmingw64-i686-gcc-g++ packages (and their dependencies) must be installed.\n\n\nMinGW-w64 Build on Windows\n--------------------------\n\nThis produces a 64-bit build of libjpeg-turbo using the \"native\" MinGW-w64\ntoolchain (which is faster than the Cygwin version):\n\n  cd {build_directory}\n  CC={mingw-w64_binary_path}/x86_64-w64-mingw32-gcc \\\n    cmake -G \"MSYS Makefiles\" \\\n    -DCMAKE_AR={mingw-w64_binary_path}/x86_64-w64-mingw32-ar \\\n    -DCMAKE_RANLIB={mingw-w64_binary_path}/x86_64-w64-mingw32-ranlib \\\n    {source_directory}\n  make\n\n\nMinGW Build on Linux\n--------------------\n\n  cd {build_directory}\n  CC={mingw_binary_path}/i386-mingw32-gcc \\\n    cmake -G \"Unix Makefiles\" -DCMAKE_SYSTEM_NAME=Windows \\\n    -DCMAKE_AR={mingw_binary_path}/i386-mingw32-ar \\\n    -DCMAKE_RANLIB={mingw_binary_path}/i386-mingw32-ranlib \\\n    {source_directory}\n  make\n\n\n*******************************************************************************\n**     Creating Release Packages\n*******************************************************************************\n\nThe following commands can be used to create various types of release packages:\n\n\nUnix/Linux\n----------\n\nmake rpm\n\n  Create Red Hat-style binary RPM package.  Requires RPM v4 or later.\n\nmake srpm\n\n  This runs 'make dist' to create a pristine source tarball, then creates a\n  Red Hat-style source RPM package from the tarball.  Requires RPM v4 or later.\n\nmake deb\n\n  Create Debian-style binary package.  Requires dpkg.\n\nmake dmg\n\n  Create Macintosh package/disk image.  This requires the PackageMaker\n  application, which must be installed in /Developer/Applications/Utilities.\n  Note that PackageMaker is not included in recent releases of Xcode, but it\n  can be obtained by downloading the \"Auxiliary Tools for Xcode\" package from\n  http://developer.apple.com/downloads.\n\nmake udmg [BUILDDIR32={32-bit build directory}]\n\n  On 64-bit OS X systems, this creates a Macintosh package and disk image that\n  contains universal i386/x86-64 binaries.  You should first configure a 32-bit\n  out-of-tree build of libjpeg-turbo, then configure a 64-bit out-of-tree\n  build, then run 'make udmg' from the 64-bit build directory.  The build\n  system will look for the 32-bit build under {source_directory}/osxx86 by\n  default, but you can override this by setting the BUILDDIR32 variable on the\n  make command line as shown above.\n\nmake iosdmg [BUILDDIR32={32-bit build directory}] \\\n  [BUILDDIRARMV6={ARM v6 build directory}] \\\n  [BUILDDIRARMV7={ARM v7 build directory}] \\\n  [BUILDDIRARMV7S={ARM v7s build directory}]\n\n  On OS X systems, this creates a Macintosh package and disk image in which the\n  libjpeg-turbo static libraries contain ARM architectures necessary to build\n  iOS applications.  If building on an x86-64 system, the binaries will also\n  contain the i386 architecture, as with 'make udmg' above.  You should first\n  configure ARM v6, ARM v7, and/or ARM v7s out-of-tree builds of libjpeg-turbo\n  (see \"Building libjpeg-turbo for iOS\" above.)  If you are building an x86-64\n  version of libjpeg-turbo, you should configure a 32-bit out-of-tree build as\n  well.  Next, build libjpeg-turbo as you would normally, using an out-of-tree\n  build.  When it is built, run 'make iosdmg' from the build directory.  The\n  build system will look for the ARM v6 build under {source_directory}/iosarmv6\n  by default, the ARM v7 build under {source_directory}/iosarmv7 by default,\n  the ARM v7s build under {source_directory}/iosarmv7s by default, and (if\n  applicable) the 32-bit build under {source_directory}/osxx86 by default, but\n  you can override this by setting the BUILDDIR32, BUILDDIRARMV6,\n  BUILDDIRARMV7, and/or BUILDDIRARMV7S variables on the make command line as\n  shown above.\n\nmake cygwinpkg\n\n  Build a Cygwin binary package.\n\n\nWindows\n-------\n\nIf using NMake:\n\n  cd {build_directory}\n  nmake installer\n\nIf using MinGW:\n\n  cd {build_directory}\n  make installer\n\nIf using the Visual Studio IDE, build the \"installer\" project.\n\nThe installer package (libjpeg-turbo[-gcc][64].exe) will be located under\n{build_directory}.  If building using the Visual Studio IDE, then the installer\npackage will be located in a subdirectory with the same name as the\nconfiguration you built (such as {build_directory}\\Debug\\ or\n{build_directory}\\Release\\).\n\nBuilding a Windows installer requires the Nullsoft Install System\n(http://nsis.sourceforge.net/.)  makensis.exe should be in your PATH.\n\n\n*******************************************************************************\n**     Regression testing\n*******************************************************************************\n\nThe most common way to test libjpeg-turbo is by invoking 'make test' on\nUnix/Linux platforms or 'ctest' on Windows platforms, once the build has\ncompleted.  This runs a series of tests to ensure that mathematical\ncompatibility has been maintained between libjpeg-turbo and libjpeg v6b.  This\nalso invokes the TurboJPEG unit tests, which ensure that the colorspace\nextensions, YUV encoding, decompression scaling, and other features of the\nTurboJPEG C and Java APIs are working properly (and, by extension, that the\nequivalent features of the underlying libjpeg API are also working.)\n\nInvoking 'make testclean' or 'nmake testclean' (if using NMake) or building\nthe 'testclean' target (if using the Visual Studio IDE) will clean up the\noutput images generated by 'make test'.\n\nOn Unix/Linux platforms, more extensive tests of the TurboJPEG C and Java\nwrappers can be run by invoking 'make tjtest'.  These extended TurboJPEG tests\nessentially iterate through all of the available features of the TurboJPEG APIs\nthat are not covered by the TurboJPEG unit tests (this includes the lossless\ntransform options) and compare the images generated by each feature to images\ngenerated using the equivalent feature in the libjpeg API.  The extended\nTurboJPEG tests are meant to test for regressions in the TurboJPEG wrappers,\nnot in the underlying libjpeg API library.\n"
  },
  {
    "path": "ext/libjpeg-turbo/CMakeLists.txt",
    "content": "#\n# Setup\n#\n\ncmake_minimum_required(VERSION 2.8.8)\ncmake_policy(SET CMP0022 OLD)\n\nproject(libjpeg-turbo C)\nset(VERSION 1.3.1)\n\nif(MINGW OR CYGWIN)\n  execute_process(COMMAND \"date\" \"+%Y%m%d\" OUTPUT_VARIABLE BUILD)\n  string(REGEX REPLACE \"\\n\" \"\" BUILD ${BUILD})\nelseif(WIN32)\n  execute_process(COMMAND \"wmic.exe\" \"os\" \"get\" \"LocalDateTime\" OUTPUT_VARIABLE\n    BUILD)\n  string(REGEX REPLACE \"[^0-9]\" \"\" BUILD \"${BUILD}\")\n  if (BUILD STREQUAL \"\")\n    execute_process(COMMAND \"cmd.exe\" \"/C\" \"DATE\" \"/T\" OUTPUT_VARIABLE BUILD)\n    string(REGEX REPLACE \".*[ ]([0-9]*)[/.]([0-9]*)[/.]([0-9]*).*\" \"\\\\3\\\\2\\\\1\" BUILD \"${BUILD}\")\n  else()\n    string(SUBSTRING \"${BUILD}\" 0 8 BUILD)\n  endif()\nelse()\n  message(FATAL_ERROR \"Platform not supported by this build system.  Use autotools instead.\")\nendif()\n\n# This does nothing except when using MinGW.  CMAKE_BUILD_TYPE has no meaning\n# in Visual Studio, and it always defaults to Debug when using NMake.\nif(NOT CMAKE_BUILD_TYPE)\n  set(CMAKE_BUILD_TYPE Release)\nendif()\n\nmessage(STATUS \"CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}\")\n\n# This only works if building from the command line.  There is currently no way\n# to set a variable's value based on the build type when using Visual Studio.\nif(CMAKE_BUILD_TYPE STREQUAL \"Debug\")\n  set(BUILD \"${BUILD}d\")\nendif()\n\nmessage(STATUS \"VERSION = ${VERSION}, BUILD = ${BUILD}\")\n\noption(WITH_SIMD \"Include SIMD extensions\" TRUE)\noption(WITH_ARITH_ENC \"Include arithmetic encoding support\" TRUE)\noption(WITH_ARITH_DEC \"Include arithmetic decoding support\" TRUE)\noption(WITH_JPEG7 \"Emulate libjpeg v7 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b)\" FALSE)\noption(WITH_JPEG8 \"Emulate libjpeg v8 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b)\" FALSE)\noption(WITH_MEM_SRCDST \"Include in-memory source/destination manager functions when emulating the libjpeg v6b or v7 API/ABI\" TRUE)\noption(WITH_JAVA \"Build Java wrapper for the TurboJPEG library\" FALSE)\n\nif(WITH_ARITH_ENC)\n  set(C_ARITH_CODING_SUPPORTED 1)\n  message(STATUS \"Arithmetic encoding support enabled\")\nelse()\n  message(STATUS \"Arithmetic encoding support disabled\")\nendif()\n\nif(WITH_ARITH_DEC)\n  set(D_ARITH_CODING_SUPPORTED 1)\n  message(STATUS \"Arithmetic decoding support enabled\")\nelse()\n  message(STATUS \"Arithmetic decoding support disabled\")\nendif()\n\nif(WITH_JAVA)\n  message(STATUS \"TurboJPEG Java wrapper enabled\")\nelse()\n  message(STATUS \"TurboJPEG Java wrapper disabled\")\nendif()\n\nset(SO_AGE 0)\nif(WITH_MEM_SRCDST)\n  set(SO_AGE 1)\nendif()\n\nset(JPEG_LIB_VERSION 62)\nset(DLL_VERSION ${JPEG_LIB_VERSION})\nset(FULLVERSION ${DLL_VERSION}.${SO_AGE}.0)\nif(WITH_JPEG8)\n  set(JPEG_LIB_VERSION 80)\n  set(DLL_VERSION 8)\n  set(FULLVERSION ${DLL_VERSION}.0.2)\n  message(STATUS \"Emulating libjpeg v8 API/ABI\")\nelseif(WITH_JPEG7)\n  set(JPEG_LIB_VERSION 70)\n  set(DLL_VERSION 7)\n  set(FULLVERSION ${DLL_VERSION}.${SO_AGE}.0)\n  message(STATUS \"Emulating libjpeg v7 API/ABI\")\nendif(WITH_JPEG8)\n\nif(WITH_MEM_SRCDST)\n  set(MEM_SRCDST_SUPPORTED 1)\n  message(STATUS \"In-memory source/destination managers enabled\")\nelse()\n  message(STATUS \"In-memory source/destination managers disabled\")\nendif()\n\nif(MSVC)\n  # Use the static C library for all build types\n  foreach(var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE\n    CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)\n    if(${var} MATCHES \"/MD\")\n      string(REGEX REPLACE \"/MD\" \"/MT\" ${var} \"${${var}}\")\n    endif()\n  endforeach()\n\n  add_definitions(-W3 -wd4996)\nendif()\n\n# Detect whether compiler is 64-bit\nif(MSVC AND CMAKE_CL_64)\n  set(SIMD_X86_64 1)\n  set(64BIT 1)\nelseif(CMAKE_SIZEOF_VOID_P MATCHES 8)\n  set(SIMD_X86_64 1)\n  set(64BIT 1)\nendif()\n\nif(64BIT)\n  message(STATUS \"64-bit build\")\nelse()\n  message(STATUS \"32-bit build\")\nendif()\n\nif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)\n  if(MSVC)\n    set(CMAKE_INSTALL_PREFIX_DEFAULT ${CMAKE_PROJECT_NAME})\n  else()\n    set(CMAKE_INSTALL_PREFIX_DEFAULT ${CMAKE_PROJECT_NAME}-gcc)\n  endif()\n  if(64BIT)\n    set(CMAKE_INSTALL_PREFIX_DEFAULT ${CMAKE_INSTALL_PREFIX_DEFAULT}64)\n  endif()\n  set(CMAKE_INSTALL_PREFIX \"c:/${CMAKE_INSTALL_PREFIX_DEFAULT}\" CACHE PATH\n    \"Directory into which to install libjpeg-turbo (default: c:/${CMAKE_INSTALL_PREFIX_DEFAULT})\"\n    FORCE)\nendif()\n\nmessage(STATUS \"Install directory = ${CMAKE_INSTALL_PREFIX}\")\n\nconfigure_file(win/jconfig.h.in jconfig.h)\nconfigure_file(win/config.h.in config.h)\n\ninclude_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR})\n\nif(WITH_JAVA)\n  find_package(Java)\n  find_package(JNI)\n  if(DEFINED JAVACFLAGS)\n    message(STATUS \"Java compiler flags = ${JAVACFLAGS}\")\n  endif()\nendif()\n\n\n#\n# Targets\n#\n\nset(JPEG_SOURCES jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c\n  jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c jcphuff.c\n  jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c jdatadst.c jdatasrc.c\n  jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c\n  jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.c\n  jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c\n  jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c)\n\nif(WITH_ARITH_ENC OR WITH_ARITH_DEC)\n  set(JPEG_SOURCES ${JPEG_SOURCES} jaricom.c)\nendif()\n\nif(WITH_ARITH_ENC)\n  set(JPEG_SOURCES ${JPEG_SOURCES} jcarith.c)\nendif()\n\nif(WITH_ARITH_DEC)\n  set(JPEG_SOURCES ${JPEG_SOURCES} jdarith.c)\nendif()\n\nif(WITH_SIMD)\n  add_definitions(-DWITH_SIMD)\n  add_subdirectory(simd)\n  if(SIMD_X86_64)\n    set(JPEG_SOURCES ${JPEG_SOURCES} simd/jsimd_x86_64.c)\n  else()\n    set(JPEG_SOURCES ${JPEG_SOURCES} simd/jsimd_i386.c)\n  endif()\n  # This tells CMake that the \"source\" files haven't been generated yet\n  set_source_files_properties(${SIMD_OBJS} PROPERTIES GENERATED 1)\nelse()\n  set(JPEG_SOURCES ${JPEG_SOURCES} jsimd_none.c)\n  message(STATUS \"Not using SIMD acceleration\")\nendif()\n\nif(WITH_JAVA)\n  add_subdirectory(java)\nendif()\n\nadd_subdirectory(sharedlib)\n\nadd_library(jpeg-static STATIC ${JPEG_SOURCES} ${SIMD_OBJS})\nif(NOT MSVC)\n  set_target_properties(jpeg-static PROPERTIES OUTPUT_NAME jpeg)\nendif()\nif(WITH_SIMD)\n  add_dependencies(jpeg-static simd)\nendif()\n\nset(TURBOJPEG_SOURCES turbojpeg.c transupp.c jdatadst-tj.c jdatasrc-tj.c)\nif(WITH_JAVA)\n  set(TURBOJPEG_SOURCES ${TURBOJPEG_SOURCES} turbojpeg-jni.c)\n  include_directories(${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})\nendif()\n\nadd_library(turbojpeg SHARED ${TURBOJPEG_SOURCES})\nset_target_properties(turbojpeg PROPERTIES DEFINE_SYMBOL DLLDEFINE)\nif(MINGW)\n  set_target_properties(turbojpeg PROPERTIES LINK_FLAGS -Wl,--kill-at)\nendif()\ntarget_link_libraries(turbojpeg jpeg-static)\nset_target_properties(turbojpeg PROPERTIES LINK_INTERFACE_LIBRARIES \"\")\n\nadd_library(turbojpeg-static STATIC ${JPEG_SOURCES} ${SIMD_OBJS}\n  turbojpeg.c transupp.c jdatadst-tj.c jdatasrc-tj.c)\nif(NOT MSVC)\n  set_target_properties(turbojpeg-static PROPERTIES OUTPUT_NAME turbojpeg)\nendif()\nif(WITH_SIMD)\n  add_dependencies(turbojpeg-static simd)\nendif()\n\nadd_executable(tjunittest tjunittest.c tjutil.c)\ntarget_link_libraries(tjunittest turbojpeg)\n\nadd_executable(tjunittest-static tjunittest.c tjutil.c)\ntarget_link_libraries(tjunittest-static turbojpeg-static)\n\nadd_executable(tjbench tjbench.c bmp.c tjutil.c rdbmp.c rdppm.c wrbmp.c\n  wrppm.c)\ntarget_link_libraries(tjbench turbojpeg jpeg-static)\nset_property(TARGET tjbench PROPERTY COMPILE_FLAGS\n  \"-DBMP_SUPPORTED -DPPM_SUPPORTED\")\n\nadd_executable(tjbench-static tjbench.c bmp.c tjutil.c rdbmp.c rdppm.c wrbmp.c\n  wrppm.c)\ntarget_link_libraries(tjbench-static turbojpeg-static jpeg-static)\nset_property(TARGET tjbench-static PROPERTY COMPILE_FLAGS\n  \"-DBMP_SUPPORTED -DPPM_SUPPORTED\")\n\nadd_executable(cjpeg-static cjpeg.c cdjpeg.c rdbmp.c rdgif.c rdppm.c rdswitch.c\n  rdtarga.c)\nset_property(TARGET cjpeg-static PROPERTY COMPILE_FLAGS\n  \"-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED -DUSE_SETMODE\")\ntarget_link_libraries(cjpeg-static jpeg-static)\n\nadd_executable(djpeg-static djpeg.c cdjpeg.c rdcolmap.c rdswitch.c wrbmp.c wrgif.c\n  wrppm.c wrtarga.c)\nset_property(TARGET djpeg-static PROPERTY COMPILE_FLAGS\n  \"-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED -DUSE_SETMODE\")\ntarget_link_libraries(djpeg-static jpeg-static)\n\nadd_executable(jpegtran-static jpegtran.c cdjpeg.c rdswitch.c transupp.c)\ntarget_link_libraries(jpegtran-static jpeg-static)\nset_property(TARGET jpegtran-static PROPERTY COMPILE_FLAGS \"-DUSE_SETMODE\")\n\nadd_executable(rdjpgcom rdjpgcom.c)\n\nadd_executable(wrjpgcom rdjpgcom.c)\n\n\n#\n# Tests\n#\n\nif(MSVC_IDE)\n  set(OBJDIR \"\\${CTEST_CONFIGURATION_TYPE}/\")\nelse()\n  set(OBJDIR \"\")\nendif()\n\nenable_testing()\n\nset(MD5_JPEG_INT 9a68f56bc76e466aa7e52f415d0f4a5f)\nset(MD5_JPEG_FAST 0e1502e7fa421835e376a314fac2a39f)\nset(MD5_JPEG_FAST_100 7bf72a8e741d64eecb960c97323af77c)\nset(MD5_JPEG_FLOAT d1623885ffafcd40c684af09e3d65cd5)\nset(MD5_JPEG_FLOAT_NOSIMD fb4884c35f8273f498cb32879de5c455)\nset(MD5_JPEG_INT_GRAY 72b51f894b8f4a10b3ee3066770aa38d)\nset(MD5_PPM_INT d1ed0d11f076b842525271647716aeb8)\nset(MD5_PPM_FAST 048298a2d2410261c0533cb97bcfef23)\nset(MD5_PPM_FLOAT 7f5b446ee36b2630e06785b8d42af15f)\nset(MD5_PPM_FLOAT_NOSIMD 64072f1dbdc5b3a187777788604971a5)\nset(MD5_PPM_INT_2_1 9f9de8c0612f8d06869b960b05abf9c9)\nset(MD5_PPM_INT_15_8 b6875bc070720b899566cc06459b63b7)\nset(MD5_PPM_INT_7_4 06a177eae05f164fac57f7a2c346ee87)\nset(MD5_PPM_INT_13_8 bc3452573c8152f6ae552939ee19f82f)\nset(MD5_PPM_INT_3_2 f5a8b88a8a7f96016f04d259cf82ed67)\nset(MD5_PPM_INT_11_8 d8cc73c0aaacd4556569b59437ba00a5)\nset(MD5_PPM_INT_5_4 32775dd9ad2ab90f4c5b219b53e0c86c)\nset(MD5_PPM_INT_9_8 d25e61bc7eac0002f5b393aa223747b6)\nset(MD5_PPM_INT_7_8 ddb564b7c74a09494016d6cd7502a946)\nset(MD5_PPM_INT_3_4 8ed8e68808c3fbc4ea764fc9d2968646)\nset(MD5_PPM_INT_5_8 a3363274999da2366a024efae6d16c9b)\nset(MD5_PPM_INT_1_2 e692a315cea26b988c8e8b29a5dbcd81)\nset(MD5_PPM_INT_3_8 79eca9175652ced755155c90e785a996)\nset(MD5_PPM_INT_1_4 79cd778f8bf1a117690052cacdd54eca)\nset(MD5_PPM_INT_1_8 391b3d4aca640c8567d6f8745eb2142f)\nset(MD5_PPM_FAST_1_2 f30bcf6d32ccd44cbdd9aeaacbd9454f)\nset(MD5_BMP_256 4980185e3776e89bd931736e1cddeee6)\nset(MD5_JPEG_ARI e986fb0a637a8d833d96e8a6d6d84ea1)\nset(MD5_PPM_ARI 72b59a99bcf1de24c5b27d151bde2437)\nset(MD5_JPEG_PROG 1c4afddc05c0a43489ee54438a482d92)\nset(MD5_JPEG_PROG_ARI 0a8f1c8f66e113c3cf635df0a475a617)\nset(MD5_JPEG_CROP b4197f377e621c4e9b1d20471432610d)\n\nif(WITH_JAVA)\nadd_test(TJUnitTest ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR} TJUnitTest)\nadd_test(TJUnitTest-yuv ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR} TJUnitTest -yuv)\nadd_test(TJUnitTest-bi ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR} TJUnitTest -bi)\nadd_test(TJUnitTest-bi-yuv ${JAVA_RUNTIME} -cp java/${OBJDIR}turbojpeg.jar -Djava.library.path=${CMAKE_CURRENT_BINARY_DIR}/${OBJDIR} TJUnitTest -bi -yuv)\nendif()\nadd_test(tjunittest tjunittest)\nadd_test(tjunittest-alloc tjunittest -alloc)\nadd_test(tjunittest-yuv tjunittest -yuv)\nadd_test(cjpeg-int sharedlib/cjpeg -dct int -outfile testoutint.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)\nadd_test(cjpeg-int-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_INT} -DFILE=testoutint.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nadd_test(cjpeg-fast sharedlib/cjpeg -dct fast -opt -outfile testoutfst.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)\nadd_test(cjpeg-fast-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_FAST} -DFILE=testoutfst.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nadd_test(cjpeg-fast-100 sharedlib/cjpeg -dct fast -quality 100 -opt -outfile testoutfst100.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)\nadd_test(cjpeg-fast-100-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_FAST_100} -DFILE=testoutfst100.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nadd_test(cjpeg-float sharedlib/cjpeg -dct float -outfile testoutflt.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)\nif(WITH_SIMD)\nadd_test(cjpeg-float-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_FLOAT} -DFILE=testoutflt.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nelse()\nadd_test(cjpeg-float-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_FLOAT_NOSIMD} -DFILE=testoutflt.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nendif()\nadd_test(cjpeg-int-gray sharedlib/cjpeg -dct int -grayscale -outfile testoutgray.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)\nadd_test(cjpeg-int-gray-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_INT_GRAY} -DFILE=testoutgray.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nadd_test(djpeg-int sharedlib/djpeg -dct int -fast -ppm -outfile testoutint.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)\nadd_test(djpeg-int-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_INT} -DFILE=testoutint.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nadd_test(djpeg-fast sharedlib/djpeg -dct fast -ppm -outfile testoutfst.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)\nadd_test(djpeg-fast-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_FAST} -DFILE=testoutfst.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nadd_test(djpeg-float sharedlib/djpeg -dct float -ppm -outfile testoutflt.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)\nif(WITH_SIMD)\nadd_test(djpeg-float-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_FLOAT} -DFILE=testoutflt.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nelse()\nadd_test(djpeg-float-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_FLOAT_NOSIMD} -DFILE=testoutflt.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nendif()\nforeach(scale 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8)\nstring(REGEX REPLACE \"_\" \"/\" scalearg ${scale})\nadd_test(djpeg-int-${scale} sharedlib/djpeg -dct int -nosmooth -scale ${scalearg} -ppm -outfile testoutint${scale}.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)\nadd_test(djpeg-int-${scale}-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_INT_${scale}} -DFILE=testoutint${scale}.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nendforeach()\nadd_test(djpeg-fast-1_2 sharedlib/djpeg -dct fast -scale 1/2 -ppm -outfile testoutfst1_2.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)\nadd_test(djpeg-fast-1_2-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_FAST_1_2} -DFILE=testoutfst1_2.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nadd_test(djpeg-256 sharedlib/djpeg -dct int -bmp -colors 256 -outfile testout.bmp  ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)\nadd_test(djpeg-256-cmp ${CMAKE_COMMAND} -DMD5=${MD5_BMP_256} -DFILE=testout.bmp -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nadd_test(cjpeg-prog sharedlib/cjpeg -dct int -progressive -outfile testoutp.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)\nadd_test(cjpeg-prog-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_PROG} -DFILE=testoutp.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nadd_test(jpegtran-prog sharedlib/jpegtran -outfile testoutt.jpg testoutp.jpg)\nadd_test(jpegtran-prog-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_INT} -DFILE=testoutt.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nif(WITH_ARITH_ENC)\nadd_test(cjpeg-ari sharedlib/cjpeg -dct int -arithmetic -outfile testoutari.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)\nadd_test(cjpeg-ari-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_ARI} -DFILE=testoutari.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake )\nadd_test(jpegtran-toari sharedlib/jpegtran -arithmetic -outfile testouta.jpg ${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg)\nadd_test(jpegtran-toari-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_ARI} -DFILE=testouta.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nadd_test(cjpeg-prog-ari sharedlib/cjpeg -dct int -progressive -arithmetic -sample 1x1 -outfile testoutpa.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)\nadd_test(cjpeg-prog-ari-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_PROG_ARI} -DFILE=testoutpa.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake )\nendif()\nif(WITH_ARITH_DEC)\nadd_test(djpeg-ari sharedlib/djpeg -dct int -fast -ppm -outfile testoutari.ppm ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg)\nadd_test(djpeg-ari-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_ARI} -DFILE=testoutari.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nadd_test(jpegtran-fromari\tsharedlib/jpegtran -outfile testouta.jpg ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg)\nadd_test(jpegtran-fromari-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_INT} -DFILE=testouta.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nendif()\nadd_test(jpegtran-crop sharedlib/jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)\nadd_test(jpegtran-crop-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_CROP} -DFILE=testoutcrop.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\n\nadd_test(tjunittest-static tjunittest-static)\nadd_test(tjunittest-static-alloc tjunittest-static -alloc)\nadd_test(tjunittest-static-yuv tjunittest-static -yuv)\nadd_test(cjpeg-static-int cjpeg-static -dct int -outfile testoutint.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)\nadd_test(cjpeg-static-int-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_INT} -DFILE=testoutint.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nadd_test(cjpeg-static-fast cjpeg-static -dct fast -opt -outfile testoutfst.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)\nadd_test(cjpeg-static-fast-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_FAST} -DFILE=testoutfst.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nadd_test(cjpeg-static-fast-100 cjpeg-static -dct fast -quality 100 -opt -outfile testoutfst100.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)\nadd_test(cjpeg-static-fast-100-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_FAST_100} -DFILE=testoutfst100.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nadd_test(cjpeg-static-float cjpeg-static -dct float -outfile testoutflt.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)\nif(WITH_SIMD)\nadd_test(cjpeg-static-float-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_FLOAT} -DFILE=testoutflt.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nelse()\nadd_test(cjpeg-static-float-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_FLOAT_NOSIMD} -DFILE=testoutflt.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nendif()\nadd_test(cjpeg-static-int-gray cjpeg-static -dct int -grayscale -outfile testoutgray.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)\nadd_test(cjpeg-static-int-gray-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_INT_GRAY} -DFILE=testoutgray.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nadd_test(djpeg-static-int djpeg-static -dct int -fast -ppm -outfile testoutint.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)\nadd_test(djpeg-static-int-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_INT} -DFILE=testoutint.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nadd_test(djpeg-static-fast djpeg-static -dct fast -ppm -outfile testoutfst.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)\nadd_test(djpeg-static-fast-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_FAST} -DFILE=testoutfst.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nadd_test(djpeg-static-float djpeg-static -dct float -ppm -outfile testoutflt.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)\nif(WITH_SIMD)\nadd_test(djpeg-static-float-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_FLOAT} -DFILE=testoutflt.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nelse()\nadd_test(djpeg-static-float-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_FLOAT_NOSIMD} -DFILE=testoutflt.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nendif()\nforeach(scale 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8)\nstring(REGEX REPLACE \"_\" \"/\" scalearg ${scale})\nadd_test(djpeg-static-int-${scale} djpeg-static -dct int -nosmooth -scale ${scalearg} -ppm -outfile testoutint${scale}.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)\nadd_test(djpeg-static-int-${scale}-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_INT_${scale}} -DFILE=testoutint${scale}.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nendforeach()\nadd_test(djpeg-static-fast-1_2 djpeg-static -dct fast -scale 1/2 -ppm -outfile testoutfst1_2.ppm ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)\nadd_test(djpeg-static-fast-1_2-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_FAST_1_2} -DFILE=testoutfst1_2.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nadd_test(djpeg-static-256 djpeg-static -dct int -bmp -colors 256 -outfile testout.bmp  ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)\nadd_test(djpeg-static-256-cmp ${CMAKE_COMMAND} -DMD5=${MD5_BMP_256} -DFILE=testout.bmp -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nadd_test(cjpeg-static-prog cjpeg-static -dct int -progressive -outfile testoutp.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)\nadd_test(cjpeg-static-prog-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_PROG} -DFILE=testoutp.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nadd_test(jpegtran-static-prog jpegtran-static -outfile testoutt.jpg testoutp.jpg)\nadd_test(jpegtran-static-prog-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_INT} -DFILE=testoutt.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nif(WITH_ARITH_ENC)\nadd_test(cjpeg-static-ari cjpeg-static -dct int -arithmetic -outfile testoutari.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)\nadd_test(cjpeg-static-ari-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_ARI} -DFILE=testoutari.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake )\nadd_test(jpegtran-static-toari jpegtran-static -arithmetic -outfile testouta.jpg ${CMAKE_SOURCE_DIR}/testimages/testimgint.jpg)\nadd_test(jpegtran-static-toari-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_ARI} -DFILE=testouta.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nadd_test(cjpeg-static-prog-ari cjpeg-static -dct int -progressive -arithmetic -sample 1x1 -outfile testoutpa.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.ppm)\nadd_test(cjpeg-static-prog-ari-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_PROG_ARI} -DFILE=testoutpa.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake )\nendif()\nif(WITH_ARITH_DEC)\nadd_test(djpeg-static-ari djpeg-static -dct int -fast -ppm -outfile testoutari.ppm ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg)\nadd_test(djpeg-static-ari-cmp ${CMAKE_COMMAND} -DMD5=${MD5_PPM_ARI} -DFILE=testoutari.ppm -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nadd_test(jpegtran-static-fromari\tjpegtran-static -outfile testouta.jpg ${CMAKE_SOURCE_DIR}/testimages/testimgari.jpg)\nadd_test(jpegtran-static-fromari-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_INT} -DFILE=testouta.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\nendif()\nadd_test(jpegtran-static-crop jpegtran-static -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)\nadd_test(jpegtran-static-crop-cmp ${CMAKE_COMMAND} -DMD5=${MD5_JPEG_CROP} -DFILE=testoutcrop.jpg -P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)\n\nadd_custom_target(testclean COMMAND ${CMAKE_COMMAND} -P\n  ${CMAKE_SOURCE_DIR}/cmakescripts/testclean.cmake)\n\n\n#\n# Installer\n#\n\nif(MSVC)\n  set(INST_PLATFORM \"Visual C++\")\n  set(INST_NAME ${CMAKE_PROJECT_NAME}-${VERSION}-vc)\n  set(INST_REG_NAME ${CMAKE_PROJECT_NAME})\nelseif(MINGW)\n  set(INST_PLATFORM GCC)\n  set(INST_NAME ${CMAKE_PROJECT_NAME}-${VERSION}-gcc)\n  set(INST_REG_NAME ${CMAKE_PROJECT_NAME}-gcc)\n  set(INST_DEFS -DGCC)\nendif()\n\nif(64BIT)\n  set(INST_PLATFORM \"${INST_PLATFORM} 64-bit\")\n  set(INST_NAME ${INST_NAME}64)\n  set(INST_REG_NAME ${INST_DIR}64)\n  set(INST_DEFS ${INST_DEFS} -DWIN64)\nendif()\n\nif(WITH_JAVA)\n  set(INST_DEFS ${INST_DEFS} -DJAVA)\nendif()\n\nif(MSVC_IDE)\n  set(INST_DEFS ${INST_DEFS} \"-DBUILDDIR=${CMAKE_CFG_INTDIR}\\\\\")\nelse()\n  set(INST_DEFS ${INST_DEFS} \"-DBUILDDIR=\")\nendif()\n\nSTRING(REGEX REPLACE \"/\" \"\\\\\\\\\" INST_DIR ${CMAKE_INSTALL_PREFIX}) \n\nconfigure_file(release/libjpeg-turbo.nsi.in libjpeg-turbo.nsi @ONLY)\n\nif(WITH_JAVA)\n  set(JAVA_DEPEND java)\nendif()\nadd_custom_target(installer\n  makensis -nocd ${INST_DEFS} libjpeg-turbo.nsi\n  DEPENDS jpeg jpeg-static turbojpeg turbojpeg-static rdjpgcom wrjpgcom\n    cjpeg djpeg jpegtran tjbench ${JAVA_DEPEND}\n  SOURCES libjpeg-turbo.nsi)\n\ninstall(TARGETS jpeg-static turbojpeg turbojpeg-static rdjpgcom wrjpgcom tjbench\n  ARCHIVE DESTINATION lib\n  LIBRARY DESTINATION lib\n  RUNTIME DESTINATION bin\n)\n\ninstall(FILES ${CMAKE_SOURCE_DIR}/README ${CMAKE_SOURCE_DIR}/README-turbo.txt\n  ${CMAKE_SOURCE_DIR}/example.c ${CMAKE_SOURCE_DIR}/libjpeg.txt \n  ${CMAKE_SOURCE_DIR}/structure.txt ${CMAKE_SOURCE_DIR}/usage.txt\n  ${CMAKE_SOURCE_DIR}/wizard.txt\n  DESTINATION doc)\n\ninstall(FILES ${CMAKE_BINARY_DIR}/jconfig.h ${CMAKE_SOURCE_DIR}/jerror.h\n  ${CMAKE_SOURCE_DIR}/jmorecfg.h ${CMAKE_SOURCE_DIR}/jpeglib.h\n  ${CMAKE_SOURCE_DIR}/turbojpeg.h DESTINATION include)\n"
  },
  {
    "path": "ext/libjpeg-turbo/ChangeLog.txt",
    "content": "1.3.1\n=====\n\n[1] On Un*x systems, 'make install' now installs the libjpeg-turbo libraries\ninto /opt/libjpeg-turbo/lib32 by default on any 32-bit system, not just x86,\nand into /opt/libjpeg-turbo/lib64 by default on any 64-bit system, not just\nx86-64.  You can override this by overriding either the 'prefix' or 'libdir'\nconfigure variables.\n\n[2] The Windows installer now places a copy of the TurboJPEG DLLs in the same\ndirectory as the rest of the libjpeg-turbo binaries.  This was mainly done\nto support TurboVNC 1.3, which bundles the DLLs in its Windows installation.\nWhen using a 32-bit version of CMake on 64-bit Windows, it is impossible to\naccess the c:\\WINDOWS\\system32 directory, which made it impossible for the\nTurboVNC build scripts to bundle the 64-bit TurboJPEG DLL.\n\n[3] Fixed a bug whereby attempting to encode a progressive JPEG with arithmetic\nentropy coding (by passing arguments of -progressive -arithmetic to cjpeg or\njpegtran, for instance) would result in an error, \"Requested feature was\nomitted at compile time\".\n\n[4] Fixed a couple of issues whereby malformed JPEG images would cause\nlibjpeg-turbo to use uninitialized memory during decompression.\n\n[5] Fixed an error (\"Buffer passed to JPEG library is too small\") that occurred\nwhen calling the TurboJPEG YUV encoding function with a very small (< 5x5)\nsource image, and added a unit test to check for this error.\n\n[6] The Java classes should now build properly under Visual Studio 2010 and\nlater.\n\n[7] Fixed an issue that prevented SRPMs generated using the in-tree packaging\ntools from being rebuilt on certain newer Linux distributions.\n\n[8] Numerous minor fixes to eliminate compilation and build/packaging system\nwarnings, fix cosmetic issues, improve documentation clarity, and other general\nsource cleanup.\n\n\n1.3.0\n=====\n\n[1] 'make test' now works properly on FreeBSD, and it no longer requires the\nmd5sum executable to be present on other Un*x platforms.\n\n[2] Overhauled the packaging system:\n-- To avoid conflict with vendor-supplied libjpeg-turbo packages, the\nofficial RPMs and DEBs for libjpeg-turbo have been renamed to\n\"libjpeg-turbo-official\".\n-- The TurboJPEG libraries are now located under /opt/libjpeg-turbo in the\nofficial Linux and Mac packages, to avoid conflict with vendor-supplied\npackages and also to streamline the packaging system.\n-- Release packages are now created with the directory structure defined\nby the configure variables \"prefix\", \"bindir\", \"libdir\", etc. (Un*x) or by the\nCMAKE_INSTALL_PREFIX variable (Windows.)  The exception is that the docs are\nalways located under the system default documentation directory on Un*x and Mac\nsystems, and on Windows, the TurboJPEG DLL is always located in the Windows\nsystem directory.\n-- To avoid confusion, official libjpeg-turbo packages on Linux/Unix platforms\n(except for Mac) will always install the 32-bit libraries in\n/opt/libjpeg-turbo/lib32 and the 64-bit libraries in /opt/libjpeg-turbo/lib64.\n-- Fixed an issue whereby, in some cases, the libjpeg-turbo executables on Un*x\nsystems were not properly linking with the shared libraries installed by the\nsame package.\n-- Fixed an issue whereby building the \"installer\" target on Windows when\nWITH_JAVA=1 would fail if the TurboJPEG JAR had not been previously built.\n-- Building the \"install\" target on Windows now installs files into the same\nplaces that the installer does.\n\n[3] Fixed a Huffman encoder bug that prevented I/O suspension from working\nproperly.\n\n\n1.2.90 (1.3 beta1)\n==================\n\n[1] Added support for additional scaling factors (3/8, 5/8, 3/4, 7/8, 9/8, 5/4,\n11/8, 3/2, 13/8, 7/4, 15/8, and 2) when decompressing.  Note that the IDCT will\nnot be SIMD-accelerated when using any of these new scaling factors.\n\n[2] The TurboJPEG dynamic library is now versioned.  It was not strictly\nnecessary to do so, because TurboJPEG uses versioned symbols, and if a function\nchanges in an ABI-incompatible way, that function is renamed and a legacy\nfunction is provided to maintain backward compatibility.  However, certain\nLinux distro maintainers have a policy against accepting any library that isn't\nversioned.\n\n[3] Extended the TurboJPEG Java API so that it can be used to compress a JPEG\nimage from and decompress a JPEG image to an arbitrary position in a large\nimage buffer.\n\n[4] The tjDecompressToYUV() function now supports the TJFLAG_FASTDCT flag.\n\n[5] The 32-bit supplementary package for amd64 Debian systems now provides\nsymlinks in /usr/lib/i386-linux-gnu for the TurboJPEG libraries in /usr/lib32.\nThis allows those libraries to be used on MultiArch-compatible systems (such as\nUbuntu 11 and later) without setting the linker path.\n\n[6] The TurboJPEG Java wrapper should now find the JNI library on Mac systems\nwithout having to pass -Djava.library.path=/usr/lib to java.\n\n[7] TJBench has been ported to Java to provide a convenient way of validating\nthe performance of the TurboJPEG Java API.  It can be run with\n'java -cp turbojpeg.jar TJBench'.\n\n[8] cjpeg can now be used to generate JPEG files with the RGB colorspace\n(feature ported from jpeg-8d.)\n\n[9] The width and height in the -crop argument passed to jpegtran can now be\nsuffixed with \"f\" to indicate that, when the upper left corner of the cropping\nregion is automatically moved to the nearest iMCU boundary, the bottom right\ncorner should be moved by the same amount.  In other words, this feature causes\njpegtran to strictly honor the specified width/height rather than the specified\nbottom right corner (feature ported from jpeg-8d.)\n\n[10] JPEG files using the RGB colorspace can now be decompressed into grayscale\nimages (feature ported from jpeg-8d.)\n\n[11] Fixed a regression caused by 1.2.1[7] whereby the build would fail with\nmultiple \"Mismatch in operand sizes\" errors when attempting to build the x86\nSIMD code with NASM 0.98.\n\n[12] The in-memory source/destination managers (jpeg_mem_src() and\njpeg_mem_dest()) are now included by default when building libjpeg-turbo with\nlibjpeg v6b or v7 emulation, so that programs can take advantage of these\nfunctions without requiring the use of the backward-incompatible libjpeg v8\nABI.  The \"age number\" of the libjpeg-turbo library on Un*x systems has been\nincremented by 1 to reflect this.  You can disable this feature with a\nconfigure/CMake switch in order to retain strict API/ABI compatibility with the\nlibjpeg v6b or v7 API/ABI (or with previous versions of libjpeg-turbo.)  See\nREADME-turbo.txt for more details.\n\n[13] Added ARM v7s architecture to libjpeg.a and libturbojpeg.a in the official\nlibjpeg-turbo binary package for OS X, so that those libraries can be used to\nbuild applications that leverage the faster CPUs in the iPhone 5 and iPad 4.\n\n\n1.2.1\n=====\n\n[1] Creating or decoding a JPEG file that uses the RGB colorspace should now\nproperly work when the input or output colorspace is one of the libjpeg-turbo\ncolorspace extensions.\n\n[2] When libjpeg-turbo was built without SIMD support and merged (non-fancy)\nupsampling was used along with an alpha-enabled colorspace during\ndecompression, the unused byte of the decompressed pixels was not being set to\n0xFF.  This has been fixed.  TJUnitTest has also been extended to test for the\ncorrect behavior of the colorspace extensions when merged upsampling is used.\n\n[3] Fixed a bug whereby the libjpeg-turbo SSE2 SIMD code would not preserve the\nupper 64 bits of xmm6 and xmm7 on Win64 platforms, which violated the Win64\ncalling conventions.\n\n[4] Fixed a regression caused by 1.2.0[6] whereby decompressing corrupt JPEG\nimages (specifically, images in which the component count was erroneously set\nto a large value) would cause libjpeg-turbo to segfault.\n\n[5] Worked around a severe performance issue with \"Bobcat\" (AMD Embedded APU)\nprocessors.  The MASKMOVDQU instruction, which was used by the libjpeg-turbo\nSSE2 SIMD code, is apparently implemented in microcode on AMD processors, and\nit is painfully slow on Bobcat processors in particular.  Eliminating the use\nof this instruction improved performance by an order of magnitude on Bobcat\nprocessors and by a small amount (typically 5%) on AMD desktop processors.\n\n[6] Added SIMD acceleration for performing 4:2:2 upsampling on NEON-capable ARM\nplatforms.  This speeds up the decompression of 4:2:2 JPEGs by 20-25% on such\nplatforms.\n\n[7] Fixed a regression caused by 1.2.0[2] whereby, on Linux/x86 platforms\nrunning the 32-bit SSE2 SIMD code in libjpeg-turbo, decompressing a 4:2:0 or\n4:2:2 JPEG image into a 32-bit (RGBX, BGRX, etc.) buffer without using fancy\nupsampling would produce several incorrect columns of pixels at the right-hand\nside of the output image if each row in the output image was not evenly\ndivisible by 16 bytes.\n\n[8] Fixed an issue whereby attempting to build the SIMD extensions with Xcode\n4.3 on OS X platforms would cause NASM to return numerous errors of the form\n\"'%define' expects a macro identifier\".\n\n[9] Added flags to the TurboJPEG API that allow the caller to force the use of\neither the fast or the accurate DCT/IDCT algorithms in the underlying codec.\n\n\n1.2.0\n=====\n\n[1] Fixed build issue with YASM on Unix systems (the libjpeg-turbo build system\nwas not adding the current directory to the assembler include path, so YASM\nwas not able to find jsimdcfg.inc.)\n\n[2] Fixed out-of-bounds read in SSE2 SIMD code that occurred when decompressing\na JPEG image to a bitmap buffer whose size was not a multiple of 16 bytes.\nThis was more of an annoyance than an actual bug, since it did not cause any\nactual run-time problems, but the issue showed up when running libjpeg-turbo in\nvalgrind.  See http://crbug.com/72399 for more information.\n\n[3] Added a compile-time macro (LIBJPEG_TURBO_VERSION) that can be used to\ncheck the version of libjpeg-turbo against which an application was compiled.\n\n[4] Added new RGBA/BGRA/ABGR/ARGB colorspace extension constants (libjpeg API)\nand pixel formats (TurboJPEG API), which allow applications to specify that,\nwhen decompressing to a 4-component RGB buffer, the unused byte should be set\nto 0xFF so that it can be interpreted as an opaque alpha channel.\n\n[5] Fixed regression issue whereby DevIL failed to build against libjpeg-turbo\nbecause libjpeg-turbo's distributed version of jconfig.h contained an INLINE\nmacro, which conflicted with a similar macro in DevIL.  This macro is used only\ninternally when building libjpeg-turbo, so it was moved into config.h.\n\n[6] libjpeg-turbo will now correctly decompress erroneous CMYK/YCCK JPEGs whose\nK component is assigned a component ID of 1 instead of 4.  Although these files\nare in violation of the spec, other JPEG implementations handle them\ncorrectly.\n\n[7] Added ARM v6 and ARM v7 architectures to libjpeg.a and libturbojpeg.a in\nthe official libjpeg-turbo binary package for OS X, so that those libraries can\nbe used to build both OS X and iOS applications.\n\n\n1.1.90 (1.2 beta1)\n==================\n\n[1] Added a Java wrapper for the TurboJPEG API.  See java/README for more\ndetails.\n\n[2] The TurboJPEG API can now be used to scale down images during\ndecompression.\n\n[3] Added SIMD routines for RGB-to-grayscale color conversion, which\nsignificantly improves the performance of grayscale JPEG compression from an\nRGB source image.\n\n[4] Improved the performance of the C color conversion routines, which are used\non platforms for which SIMD acceleration is not available.\n\n[5] Added a function to the TurboJPEG API that performs lossless transforms.\nThis function is implemented using the same back end as jpegtran, but it\nperforms transcoding entirely in memory and allows multiple transforms and/or\ncrop operations to be batched together, so the source coefficients only need to\nbe read once.  This is useful when generating image tiles from a single source\nJPEG.\n\n[6] Added tests for the new TurboJPEG scaled decompression and lossless\ntransform features to tjbench (the TurboJPEG benchmark, formerly called\n\"jpgtest\".)\n\n[7] Added support for 4:4:0 (transposed 4:2:2) subsampling in TurboJPEG, which\nwas necessary in order for it to read 4:2:2 JPEG files that had been losslessly\ntransposed or rotated 90 degrees.\n\n[8] All legacy VirtualGL code has been re-factored, and this has allowed\nlibjpeg-turbo, in its entirety, to be re-licensed under a BSD-style license.\n\n[9] libjpeg-turbo can now be built with YASM.\n\n[10] Added SIMD acceleration for ARM Linux and iOS platforms that support\nNEON instructions.\n\n[11] Refactored the TurboJPEG C API and documented it using Doxygen.  The\nTurboJPEG 1.2 API uses pixel formats to define the size and component order of\nthe uncompressed source/destination images, and it includes a more efficient\nversion of TJBUFSIZE() that computes a worst-case JPEG size based on the level\nof chrominance subsampling.  The refactored implementation of the TurboJPEG API\nnow uses the libjpeg memory source and destination managers, which allows the\nTurboJPEG compressor to grow the JPEG buffer as necessary.\n\n[12] Eliminated errors in the output of jpegtran on Windows that occurred when\nthe application was invoked using I/O redirection\n(jpegtran <input.jpg >output.jpg).\n\n[13] The inclusion of libjpeg v7 and v8 emulation as well as arithmetic coding\nsupport in libjpeg-turbo v1.1.0 introduced several new error constants in\njerror.h, and these were mistakenly enabled for all emulation modes, causing\nthe error enum in libjpeg-turbo to sometimes have different values than the\nsame enum in libjpeg.  This represents an ABI incompatibility, and it caused\nproblems with rare applications that took specific action based on a particular\nerror value.  The fix was to include the new error constants conditionally\nbased on whether libjpeg v7 or v8 emulation was enabled.\n\n[14] Fixed an issue whereby Windows applications that used libjpeg-turbo would\nfail to compile if the Windows system headers were included before jpeglib.h.\nThis issue was caused by a conflict in the definition of the INT32 type.\n\n[15] Fixed 32-bit supplementary package for amd64 Debian systems, which was\nbroken by enhancements to the packaging system in 1.1.\n\n[16] When decompressing a JPEG image using an output colorspace of\nJCS_EXT_RGBX, JCS_EXT_BGRX, JCS_EXT_XBGR, or JCS_EXT_XRGB, libjpeg-turbo will\nnow set the unused byte to 0xFF, which allows applications to interpret that\nbyte as an alpha channel (0xFF = opaque).\n\n\n1.1.1\n=====\n\n[1] Fixed a 1-pixel error in row 0, column 21 of the luminance plane generated\nby tjEncodeYUV().\n\n[2] libjpeg-turbo's accelerated Huffman decoder previously ignored unexpected\nmarkers found in the middle of the JPEG data stream during decompression.  It\nwill now hand off decoding of a particular block to the unaccelerated Huffman\ndecoder if an unexpected marker is found, so that the unaccelerated Huffman\ndecoder can generate an appropriate warning.\n\n[3] Older versions of MinGW64 prefixed symbol names with underscores by\ndefault, which differed from the behavior of 64-bit Visual C++.  MinGW64 1.0\nhas adopted the behavior of 64-bit Visual C++ as the default, so to accommodate\nthis, the libjpeg-turbo SIMD function names are no longer prefixed with an\nunderscore when building with MinGW64.  This means that, when building\nlibjpeg-turbo with older versions of MinGW64, you will now have to add\n-fno-leading-underscore to the CFLAGS.\n\n[4] Fixed a regression bug in the NSIS script that caused the Windows installer\nbuild to fail when using the Visual Studio IDE.\n\n[5] Fixed a bug in jpeg_read_coefficients() whereby it would not initialize\ncinfo->image_width and cinfo->image_height if libjpeg v7 or v8 emulation was\nenabled.  This specifically caused the jpegoptim program to fail if it was\nlinked against a version of libjpeg-turbo that was built with libjpeg v7 or v8\nemulation.\n\n[6] Eliminated excessive I/O overhead that occurred when reading BMP files in\ncjpeg.\n\n[7] Eliminated errors in the output of cjpeg on Windows that occurred when the\napplication was invoked using I/O redirection (cjpeg <inputfile >output.jpg).\n\n\n1.1.0\n=====\n\n[1] The algorithm used by the SIMD quantization function cannot produce correct\nresults when the JPEG quality is >= 98 and the fast integer forward DCT is\nused.  Thus, the non-SIMD quantization function is now used for those cases,\nand libjpeg-turbo should now produce identical output to libjpeg v6b in all\ncases.\n\n[2] Despite the above, the fast integer forward DCT still degrades somewhat for\nJPEG qualities greater than 95, so the TurboJPEG wrapper will now automatically\nuse the slow integer forward DCT when generating JPEG images of quality 96 or\ngreater.  This reduces compression performance by as much as 15% for these\nhigh-quality images but is necessary to ensure that the images are perceptually\nlossless.  It also ensures that the library can avoid the performance pitfall\ncreated by [1].\n\n[3] Ported jpgtest.cxx to pure C to avoid the need for a C++ compiler.\n\n[4] Fixed visual artifacts in grayscale JPEG compression caused by a typo in\nthe RGB-to-luminance lookup tables.\n\n[5] The Windows distribution packages now include the libjpeg run-time programs\n(cjpeg, etc.)\n\n[6] All packages now include jpgtest.\n\n[7] The TurboJPEG dynamic library now uses versioned symbols.\n\n[8] Added two new TurboJPEG API functions, tjEncodeYUV() and\ntjDecompressToYUV(), to replace the somewhat hackish TJ_YUV flag.\n\n\n1.0.90 (1.1 beta1)\n==================\n\n[1] Added emulation of the libjpeg v7 and v8 APIs and ABIs.  See\nREADME-turbo.txt for more details.  This feature was sponsored by CamTrace SAS.\n\n[2] Created a new CMake-based build system for the Visual C++ and MinGW builds.\n\n[3] Grayscale bitmaps can now be compressed from/decompressed to using the\nTurboJPEG API.\n\n[4] jpgtest can now be used to test decompression performance with existing\nJPEG images.\n\n[5] If the default install prefix (/opt/libjpeg-turbo) is used, then\n'make install' now creates /opt/libjpeg-turbo/lib32 and\n/opt/libjpeg-turbo/lib64 sym links to duplicate the behavior of the binary\npackages.\n\n[6] All symbols in the libjpeg-turbo dynamic library are now versioned, even\nwhen the library is built with libjpeg v6b emulation.\n\n[7] Added arithmetic encoding and decoding support (can be disabled with\nconfigure or CMake options)\n\n[8] Added a TJ_YUV flag to the TurboJPEG API, which causes both the compressor\nand decompressor to output planar YUV images.\n\n[9] Added an extended version of tjDecompressHeader() to the TurboJPEG API,\nwhich allows the caller to determine the type of subsampling used in a JPEG\nimage.\n\n[10] Added further protections against invalid Huffman codes.\n\n\n1.0.1\n=====\n\n[1] The Huffman decoder will now handle erroneous Huffman codes (for instance,\nfrom a corrupt JPEG image.)  Previously, these would cause libjpeg-turbo to\ncrash under certain circumstances.\n\n[2] Fixed typo in SIMD dispatch routines that was causing 4:2:2 upsampling to\nbe used instead of 4:2:0 when decompressing JPEG images using SSE2 code.\n\n[3] configure script will now automatically determine whether the\nINCOMPLETE_TYPES_BROKEN macro should be defined.\n\n\n1.0.0\n=====\n\n[1] 2983700: Further FreeBSD build tweaks (no longer necessary to specify\n--host when configuring on a 64-bit system)\n\n[2] Created symlinks in the Unix/Linux packages so that the TurboJPEG\ninclude file can always be found in /opt/libjpeg-turbo/include, the 32-bit\nstatic libraries can always be found in /opt/libjpeg-turbo/lib32, and the\n64-bit static libraries can always be found in /opt/libjpeg-turbo/lib64.\n\n[3] The Unix/Linux distribution packages now include the libjpeg run-time\nprograms (cjpeg, etc.) and man pages.\n\n[4] Created a 32-bit supplementary package for amd64 Debian systems, which\ncontains just the 32-bit libjpeg-turbo libraries.\n\n[5] Moved the libraries from */lib32 to */lib in the i386 Debian package.\n\n[6] Include distribution package for Cygwin\n\n[7] No longer necessary to specify --without-simd on non-x86 architectures, and\nunit tests now work on those architectures.\n\n\n0.0.93\n======\n\n[1] 2982659, Fixed x86-64 build on FreeBSD systems\n\n[2] 2988188: Added support for Windows 64-bit systems\n\n\n0.0.91\n======\n\n[1] Added documentation to .deb packages\n\n[2] 2968313: Fixed data corruption issues when decompressing large JPEG images\nand/or using buffered I/O with the libjpeg-turbo decompressor\n\n\n0.0.90\n======\n\nInitial release\n"
  },
  {
    "path": "ext/libjpeg-turbo/Makefile.am",
    "content": "lib_LTLIBRARIES = libjpeg.la\nlibjpeg_la_LDFLAGS = -version-info ${LIBTOOL_CURRENT}:${SO_MINOR_VERSION}:${SO_AGE} -no-undefined\ninclude_HEADERS = jerror.h jmorecfg.h jpeglib.h\n\nif WITH_TURBOJPEG\nlib_LTLIBRARIES += libturbojpeg.la\nlibturbojpeg_la_LDFLAGS = -version-info 0:0 -no-undefined\ninclude_HEADERS += turbojpeg.h\nendif\n\nnodist_include_HEADERS = jconfig.h\n\n\nHDRS = jchuff.h jdct.h jdhuff.h jerror.h jinclude.h jmemsys.h jmorecfg.h \\\n\tjpegint.h jpeglib.h jversion.h jsimd.h jsimddct.h jpegcomp.h\n\nlibjpeg_la_SOURCES = $(HDRS) jcapimin.c jcapistd.c jccoefct.c jccolor.c \\\n\tjcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \\\n\tjcomapi.c jcparam.c jcphuff.c jcprepct.c jcsample.c jctrans.c \\\n\tjdapimin.c jdapistd.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \\\n\tjddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \\\n\tjdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.c \\\n\tjfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c \\\n\tjidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c\n\nif WITH_ARITH\nlibjpeg_la_SOURCES += jaricom.c\nendif\n\nif WITH_ARITH_ENC\nlibjpeg_la_SOURCES += jcarith.c\nendif\n\nif WITH_ARITH_DEC\nlibjpeg_la_SOURCES += jdarith.c\nendif\n\n\nSUBDIRS = java\n\n\nif WITH_TURBOJPEG\n\nlibturbojpeg_la_SOURCES = $(libjpeg_la_SOURCES) turbojpeg.c turbojpeg.h \\\n\ttransupp.c transupp.h jdatadst-tj.c jdatasrc-tj.c\n\nif WITH_JAVA\n\nlibturbojpeg_la_SOURCES += turbojpeg-jni.c\nlibturbojpeg_la_CFLAGS = ${JNI_CFLAGS}\nTJMAPFILE = turbojpeg-mapfile.jni\n\nelse\n\nTJMAPFILE = turbojpeg-mapfile\n\nendif\n\nlibturbojpeg_la_SOURCES += $(TJMAPFILE)\n\nif VERSION_SCRIPT\nlibturbojpeg_la_LDFLAGS += $(VERSION_SCRIPT_FLAG)$(srcdir)/$(TJMAPFILE)\nendif\n\nendif\n\n\nif VERSION_SCRIPT\nlibjpeg_la_LDFLAGS += $(VERSION_SCRIPT_FLAG)libjpeg.map\nendif\n\n\nif WITH_SIMD\n\nSUBDIRS += simd\nlibjpeg_la_LIBADD = simd/libsimd.la\nlibturbojpeg_la_LIBADD = simd/libsimd.la\n\nelse\n\nlibjpeg_la_SOURCES += jsimd_none.c\n\nendif\n\n\nbin_PROGRAMS = cjpeg djpeg jpegtran rdjpgcom wrjpgcom\nnoinst_PROGRAMS = jcstest\n\n\nif WITH_TURBOJPEG\n\nbin_PROGRAMS += tjbench\n\nnoinst_PROGRAMS += tjunittest\n\ntjbench_SOURCES = tjbench.c bmp.h bmp.c tjutil.h tjutil.c rdbmp.c rdppm.c \\\n\twrbmp.c wrppm.c\n\ntjbench_LDADD = libturbojpeg.la libjpeg.la -lm\n\ntjbench_CFLAGS = -DBMP_SUPPORTED -DPPM_SUPPORTED\n\ntjunittest_SOURCES = tjunittest.c tjutil.h tjutil.c\n\ntjunittest_LDADD = libturbojpeg.la\n\nendif\n\n\ncjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c cjpeg.c rdbmp.c rdgif.c \\\n\trdppm.c rdswitch.c rdtarga.c \n\ncjpeg_LDADD = libjpeg.la\n\ncjpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \\\n\t-DTARGA_SUPPORTED\n\ndjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c djpeg.c rdcolmap.c rdswitch.c \\\n\twrbmp.c wrgif.c wrppm.c wrtarga.c\n\ndjpeg_LDADD = libjpeg.la\n\ndjpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \\\n\t-DTARGA_SUPPORTED\n\njpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c transupp.h\n\njpegtran_LDADD = libjpeg.la\n\nrdjpgcom_SOURCES = rdjpgcom.c\n\nrdjpgcom_LDADD = libjpeg.la\n\nwrjpgcom_SOURCES = wrjpgcom.c\n\nwrjpgcom_LDADD = libjpeg.la\n\njcstest_SOURCES = jcstest.c\n\njcstest_LDADD = libjpeg.la\n\ndist_man1_MANS = cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1\n\nDOCS= coderules.txt jconfig.txt change.log rdrle.c wrrle.c BUILDING.txt \\\n\tChangeLog.txt\n\ndocdir = $(datadir)/doc\ndist_doc_DATA = README README-turbo.txt libjpeg.txt structure.txt usage.txt \\\n\twizard.txt \n\nexampledir = $(datadir)/doc\ndist_example_DATA = example.c\n\n\nEXTRA_DIST = win release $(DOCS) testimages CMakeLists.txt \\\n\tsharedlib/CMakeLists.txt cmakescripts libjpeg.map.in doc doxygen.config \\\n\tjccolext.c jdcolext.c jdmrgext.c\n\ndist-hook:\n\trm -rf `find $(distdir) -name .svn`\n\n\nSUBDIRS += md5\n\nMD5_JPEG_INT = 9a68f56bc76e466aa7e52f415d0f4a5f\nMD5_JPEG_FAST = 0e1502e7fa421835e376a314fac2a39f\nMD5_JPEG_FAST_100 = 7bf72a8e741d64eecb960c97323af77c\nMD5_JPEG_FLOAT = d1623885ffafcd40c684af09e3d65cd5\nMD5_JPEG_FLOAT_NOSIMD = fb4884c35f8273f498cb32879de5c455\nMD5_JPEG_INT_GRAY = 72b51f894b8f4a10b3ee3066770aa38d\nMD5_PPM_INT = d1ed0d11f076b842525271647716aeb8\nMD5_PPM_FAST = 048298a2d2410261c0533cb97bcfef23\nMD5_PPM_FLOAT = 7f5b446ee36b2630e06785b8d42af15f\nMD5_PPM_FLOAT_NOSIMD = 64072f1dbdc5b3a187777788604971a5\nMD5_PPM_INT_2_1 = 9f9de8c0612f8d06869b960b05abf9c9\nMD5_PPM_INT_15_8 = b6875bc070720b899566cc06459b63b7\nMD5_PPM_INT_7_4 = 06a177eae05f164fac57f7a2c346ee87\nMD5_PPM_INT_13_8 = bc3452573c8152f6ae552939ee19f82f\nMD5_PPM_INT_3_2 = f5a8b88a8a7f96016f04d259cf82ed67\nMD5_PPM_INT_11_8 = d8cc73c0aaacd4556569b59437ba00a5\nMD5_PPM_INT_5_4 = 32775dd9ad2ab90f4c5b219b53e0c86c\nMD5_PPM_INT_9_8 = d25e61bc7eac0002f5b393aa223747b6\nMD5_PPM_INT_7_8 = ddb564b7c74a09494016d6cd7502a946\nMD5_PPM_INT_3_4 = 8ed8e68808c3fbc4ea764fc9d2968646\nMD5_PPM_INT_5_8 = a3363274999da2366a024efae6d16c9b\nMD5_PPM_INT_1_2 = e692a315cea26b988c8e8b29a5dbcd81\nMD5_PPM_INT_3_8 = 79eca9175652ced755155c90e785a996\nMD5_PPM_INT_1_4 = 79cd778f8bf1a117690052cacdd54eca\nMD5_PPM_INT_1_8 = 391b3d4aca640c8567d6f8745eb2142f\nMD5_PPM_FAST_1_2 = f30bcf6d32ccd44cbdd9aeaacbd9454f\nMD5_BMP_256 = 4980185e3776e89bd931736e1cddeee6\nMD5_JPEG_ARI = e986fb0a637a8d833d96e8a6d6d84ea1\nMD5_PPM_ARI = 72b59a99bcf1de24c5b27d151bde2437\nMD5_JPEG_PROG = 1c4afddc05c0a43489ee54438a482d92\nMD5_JPEG_PROG_ARI = 0a8f1c8f66e113c3cf635df0a475a617\nMD5_JPEG_CROP = b4197f377e621c4e9b1d20471432610d\n\ntest: testclean all\nif WITH_TURBOJPEG\nif WITH_JAVA\n\t$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest\n\t$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -bi\n\t$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv\n\t$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv -bi\nendif\n\t./tjunittest\n\t./tjunittest -alloc\n\t./tjunittest -yuv\nendif\n\t./cjpeg -dct int -outfile testoutint.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_INT) testoutint.jpg\n\t./cjpeg -dct fast -opt -outfile testoutfst.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_FAST) testoutfst.jpg\n\t./cjpeg -dct fast -quality 100 -opt -outfile testoutfst100.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_FAST_100) testoutfst100.jpg\n\t./cjpeg -dct float -outfile testoutflt.jpg $(srcdir)/testimages/testorig.ppm\nif WITH_SSE_FLOAT_DCT\n\tmd5/md5cmp $(MD5_JPEG_FLOAT) testoutflt.jpg\nelse\n\tmd5/md5cmp $(MD5_JPEG_FLOAT_NOSIMD) testoutflt.jpg\nendif\n\t./cjpeg -dct int -grayscale -outfile testoutgray.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_INT_GRAY) testoutgray.jpg\n\t./djpeg -dct int -fast -ppm -outfile testoutint.ppm $(srcdir)/testimages/testorig.jpg\n\tmd5/md5cmp $(MD5_PPM_INT) testoutint.ppm\n\t./djpeg -dct fast -ppm -outfile testoutfst.ppm $(srcdir)/testimages/testorig.jpg\n\tmd5/md5cmp $(MD5_PPM_FAST) testoutfst.ppm\n\t./djpeg -dct float -ppm -outfile testoutflt.ppm $(srcdir)/testimages/testorig.jpg\nif WITH_SSE_FLOAT_DCT\n\tmd5/md5cmp $(MD5_PPM_FLOAT) testoutflt.ppm\nelse\n\tmd5/md5cmp $(MD5_PPM_FLOAT_NOSIMD) testoutflt.ppm\nendif\n\t./djpeg -dct int -nosmooth -scale 2/1 -ppm -outfile testoutint2_1.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_2_1) testoutint2_1.ppm;\n\t./djpeg -dct int -nosmooth -scale 15/8 -ppm -outfile testoutint15_8.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_15_8) testoutint15_8.ppm;\n\t./djpeg -dct int -nosmooth -scale 7/4 -ppm -outfile testoutint7_4.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_7_4) testoutint7_4.ppm;\n\t./djpeg -dct int -nosmooth -scale 13/8 -ppm -outfile testoutint13_8.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_13_8) testoutint13_8.ppm;\n\t./djpeg -dct int -nosmooth -scale 3/2 -ppm -outfile testoutint3_2.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_3_2) testoutint3_2.ppm;\n\t./djpeg -dct int -nosmooth -scale 11/8 -ppm -outfile testoutint11_8.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_11_8) testoutint11_8.ppm;\n\t./djpeg -dct int -nosmooth -scale 5/4 -ppm -outfile testoutint5_4.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_5_4) testoutint5_4.ppm;\n\t./djpeg -dct int -nosmooth -scale 9/8 -ppm -outfile testoutint9_8.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_9_8) testoutint9_8.ppm;\n\t./djpeg -dct int -nosmooth -scale 7/8 -ppm -outfile testoutint7_8.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_7_8) testoutint7_8.ppm;\n\t./djpeg -dct int -nosmooth -scale 3/4 -ppm -outfile testoutint3_4.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_3_4) testoutint3_4.ppm;\n\t./djpeg -dct int -nosmooth -scale 5/8 -ppm -outfile testoutint5_8.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_5_8) testoutint5_8.ppm;\n\t./djpeg -dct int -nosmooth -scale 1/2 -ppm -outfile testoutint1_2.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_1_2) testoutint1_2.ppm;\n\t./djpeg -dct int -nosmooth -scale 3/8 -ppm -outfile testoutint3_8.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_3_8) testoutint3_8.ppm;\n\t./djpeg -dct int -nosmooth -scale 1/4 -ppm -outfile testoutint1_4.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_1_4) testoutint1_4.ppm;\n\t./djpeg -dct int -nosmooth -scale 1/8 -ppm -outfile testoutint1_8.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_1_8) testoutint1_8.ppm;\n\t./djpeg -dct fast -scale 1/2 -ppm -outfile testoutfst1_2.ppm $(srcdir)/testimages/testorig.jpg\n\tmd5/md5cmp $(MD5_PPM_FAST_1_2) testoutfst1_2.ppm\n\t./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testimages/testorig.jpg\n\tmd5/md5cmp $(MD5_BMP_256) testout.bmp\nif WITH_ARITH_ENC\n\t./cjpeg -dct int -arithmetic -outfile testoutari.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_ARI) testoutari.jpg\n\t./jpegtran -arithmetic -outfile testouta.jpg $(srcdir)/testimages/testimgint.jpg\n\tmd5/md5cmp $(MD5_JPEG_ARI) testouta.jpg\n\t./cjpeg -dct int -progressive -arithmetic -sample 1x1 -outfile testoutpa.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_PROG_ARI) testoutpa.jpg\nendif\nif WITH_ARITH_DEC\n\t./djpeg -dct int -fast -ppm -outfile testoutari.ppm $(srcdir)/testimages/testimgari.jpg\n\tmd5/md5cmp $(MD5_PPM_ARI) testoutari.ppm\n\t./jpegtran -outfile testouta.jpg $(srcdir)/testimages/testimgari.jpg\n\tmd5/md5cmp $(MD5_JPEG_INT) testouta.jpg\nendif\n\t./cjpeg -dct int -progressive -outfile testoutp.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_PROG) testoutp.jpg\n\t./jpegtran -outfile testoutt.jpg testoutp.jpg\n\tmd5/md5cmp $(MD5_JPEG_INT) testoutt.jpg\n\t./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg $(srcdir)/testimages/testorig.jpg\n\tmd5/md5cmp $(MD5_JPEG_CROP) testoutcrop.jpg\n\n\ntestclean:\n\trm -f testout*\n\trm -f *_GRAY_*.bmp\n\trm -f *_GRAY_*.png\n\trm -f *_GRAY_*.ppm\n\trm -f *_GRAY_*.jpg\n\trm -f *_GRAY.yuv\n\trm -f *_420_*.bmp\n\trm -f *_420_*.png\n\trm -f *_420_*.ppm\n\trm -f *_420_*.jpg\n\trm -f *_420.yuv\n\trm -f *_422_*.bmp\n\trm -f *_422_*.png\n\trm -f *_422_*.ppm\n\trm -f *_422_*.jpg\n\trm -f *_422.yuv\n\trm -f *_444_*.bmp\n\trm -f *_444_*.png\n\trm -f *_444_*.ppm\n\trm -f *_444_*.jpg\n\trm -f *_444.yuv\n\trm -f *_440_*.bmp\n\trm -f *_440_*.png\n\trm -f *_440_*.ppm\n\trm -f *_440_*.jpg\n\trm -f *_440.yuv\n\n\ntjtest:\n\tsh ./tjbenchtest\nif WITH_JAVA\n\tsh ./tjbenchtest.java\nendif\n\n\npkgscripts/libjpeg-turbo.spec: pkgscripts/libjpeg-turbo.spec.tmpl\n\tcat pkgscripts/libjpeg-turbo.spec.tmpl | sed s@%{__prefix}@$(prefix)@g | \\\n\t\tsed s@%{__bindir}@$(bindir)@g | sed s@%{__datadir}@$(datadir)@g | \\\n\t\tsed s@%{__docdir}@$(docdir)@g | sed s@%{__includedir}@$(includedir)@g | \\\n\t\tsed s@%{__libdir}@$(libdir)@g | sed s@%{__mandir}@$(mandir)@g \\\n\t\t> pkgscripts/libjpeg-turbo.spec\n\nrpm: all pkgscripts/libjpeg-turbo.spec\n\tTMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \\\n\tmkdir -p $$TMPDIR/RPMS; \\\n\tln -fs `pwd` $$TMPDIR/BUILD; \\\n\trm -f ${PKGNAME}-${VERSION}.${RPMARCH}.rpm; \\\n\trpmbuild -bb --define \"_blddir $$TMPDIR/buildroot\"  \\\n\t\t--define \"_topdir $$TMPDIR\" \\\n\t\t--target ${RPMARCH} pkgscripts/libjpeg-turbo.spec; \\\n\tcp $$TMPDIR/RPMS/${RPMARCH}/${PKGNAME}-${VERSION}-${BUILD}.${RPMARCH}.rpm \\\n\t\t${PKGNAME}-${VERSION}.${RPMARCH}.rpm; \\\n\trm -rf $$TMPDIR\n\nsrpm: dist-gzip pkgscripts/libjpeg-turbo.spec\n\tTMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \\\n\tmkdir -p $$TMPDIR/RPMS; \\\n\tmkdir -p $$TMPDIR/SRPMS; \\\n\tmkdir -p $$TMPDIR/BUILD; \\\n\tmkdir -p $$TMPDIR/SOURCES; \\\n\tmkdir -p $$TMPDIR/SPECS; \\\n\trm -f ${PKGNAME}-${VERSION}.src.rpm; \\\n\tcp ${PACKAGE_NAME}-${VERSION}.tar.gz $$TMPDIR/SOURCES; \\\n\tcat pkgscripts/libjpeg-turbo.spec | sed s/%{_blddir}/%{_tmppath}/g \\\n\t\t| sed s/#--\\>//g \\\n\t\t> $$TMPDIR/SPECS/libjpeg-turbo.spec; \\\n\trpmbuild -bs --define \"_topdir $$TMPDIR\" $$TMPDIR/SPECS/libjpeg-turbo.spec; \\\n\tcp $$TMPDIR/SRPMS/${PKGNAME}-${VERSION}-${BUILD}.src.rpm \\\n\t\t${PKGNAME}-${VERSION}.src.rpm; \\\n\trm -rf $$TMPDIR\n\npkgscripts/makedpkg: pkgscripts/makedpkg.tmpl\n\tcat pkgscripts/makedpkg.tmpl | sed s@%{__prefix}@$(prefix)@g | \\\n\t\tsed s@%{__docdir}@$(docdir)@g | sed s@%{__libdir}@$(libdir)@g \\\n\t\t> pkgscripts/makedpkg\n\ndeb: all pkgscripts/makedpkg\n\tsh pkgscripts/makedpkg\n\npkgscripts/uninstall: pkgscripts/uninstall.tmpl\n\tcat pkgscripts/uninstall.tmpl | sed s@%{__prefix}@$(prefix)@g | \\\n\t\tsed s@%{__bindir}@$(bindir)@g | sed s@%{__datadir}@$(datadir)@g | \\\n\t\tsed s@%{__includedir}@$(includedir)@g | sed s@%{__libdir}@$(libdir)@g | \\\n\t\tsed s@%{__mandir}@$(mandir)@g > pkgscripts/uninstall\n\npkgscripts/makemacpkg: pkgscripts/makemacpkg.tmpl\n\tcat pkgscripts/makemacpkg.tmpl | sed s@%{__prefix}@$(prefix)@g | \\\n\t\tsed s@%{__bindir}@$(bindir)@g | sed s@%{__docdir}@$(docdir)@g | \\\n\t\tsed s@%{__libdir}@$(libdir)@g > pkgscripts/makemacpkg\n\nif X86_64\n\nudmg: all pkgscripts/makemacpkg pkgscripts/uninstall\n\tsh pkgscripts/makemacpkg -build32 ${BUILDDIR32}\n\niosdmg: all pkgscripts/makemacpkg pkgscripts/uninstall\n\tsh pkgscripts/makemacpkg -build32 ${BUILDDIR32} -buildarmv6 ${BUILDDIRARMV6} -buildarmv7 ${BUILDDIRARMV7} -buildarmv7s ${BUILDDIRARMV7S}\n\nelse\n\niosdmg: all pkgscripts/makemacpkg pkgscripts/uninstall\n\tsh pkgscripts/makemacpkg -buildarmv6 ${BUILDDIRARMV6} -buildarmv7 ${BUILDDIRARMV7} -buildarmv7s ${BUILDDIRARMV7S}\n\nendif\n\ndmg: all pkgscripts/makemacpkg pkgscripts/uninstall\n\tsh pkgscripts/makemacpkg\n\npkgscripts/makecygwinpkg: pkgscripts/makecygwinpkg.tmpl\n\tcat pkgscripts/makecygwinpkg.tmpl | sed s@%{__prefix}@$(prefix)@g | \\\n\t\tsed s@%{__docdir}@$(docdir)@g | sed s@%{__libdir}@$(libdir)@g \\\n\t\t> pkgscripts/makecygwinpkg\n\ncygwinpkg: all pkgscripts/makecygwinpkg\n\tsh pkgscripts/makecygwinpkg\n"
  },
  {
    "path": "ext/libjpeg-turbo/Makefile.in",
    "content": "# Makefile.in generated by automake 1.9.2 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,\n# 2003, 2004  Free Software Foundation, Inc.\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\n\n\n\n\nSOURCES = $(libjpeg_la_SOURCES) $(libturbojpeg_la_SOURCES) $(cjpeg_SOURCES) $(djpeg_SOURCES) $(jcstest_SOURCES) $(jpegtran_SOURCES) $(rdjpgcom_SOURCES) $(tjbench_SOURCES) $(tjunittest_SOURCES) $(wrjpgcom_SOURCES)\n\nsrcdir = @srcdir@\ntop_srcdir = @top_srcdir@\nVPATH = @srcdir@\npkgdatadir = $(datadir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\ntop_builddir = .\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\nINSTALL = @INSTALL@\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nbuild_triplet = @build@\nhost_triplet = @host@\n@WITH_TURBOJPEG_TRUE@am__append_1 = libturbojpeg.la\n@WITH_TURBOJPEG_TRUE@am__append_2 = turbojpeg.h\n@WITH_ARITH_TRUE@am__append_3 = jaricom.c\n@WITH_ARITH_ENC_TRUE@am__append_4 = jcarith.c\n@WITH_ARITH_DEC_TRUE@am__append_5 = jdarith.c\n@WITH_JAVA_TRUE@@WITH_TURBOJPEG_TRUE@am__append_6 = turbojpeg-jni.c\n@VERSION_SCRIPT_TRUE@@WITH_TURBOJPEG_TRUE@am__append_7 = $(VERSION_SCRIPT_FLAG)$(srcdir)/$(TJMAPFILE)\n@VERSION_SCRIPT_TRUE@am__append_8 = $(VERSION_SCRIPT_FLAG)libjpeg.map\n@WITH_SIMD_TRUE@am__append_9 = simd\n@WITH_SIMD_FALSE@am__append_10 = jsimd_none.c\nbin_PROGRAMS = cjpeg$(EXEEXT) djpeg$(EXEEXT) jpegtran$(EXEEXT) \\\n\trdjpgcom$(EXEEXT) wrjpgcom$(EXEEXT) $(am__EXEEXT_1)\nnoinst_PROGRAMS = jcstest$(EXEEXT) $(am__EXEEXT_2)\n@WITH_TURBOJPEG_TRUE@am__append_11 = tjbench\n@WITH_TURBOJPEG_TRUE@am__append_12 = tjunittest\nDIST_COMMON = README $(am__configure_deps) $(am__include_HEADERS_DIST) \\\n\t$(dist_doc_DATA) $(dist_example_DATA) $(dist_man1_MANS) \\\n\t$(srcdir)/Makefile.am $(srcdir)/Makefile.in \\\n\t$(srcdir)/config.h.in $(srcdir)/jconfig.h.in \\\n\t$(srcdir)/libjpeg.map.in $(srcdir)/tjbenchtest.in \\\n\t$(srcdir)/tjbenchtest.java.in $(srcdir)/tjexampletest.in \\\n\t$(top_srcdir)/configure \\\n\t$(top_srcdir)/release/Description.plist.in \\\n\t$(top_srcdir)/release/Info.plist.in \\\n\t$(top_srcdir)/release/libjpeg-turbo.spec.in \\\n\t$(top_srcdir)/release/makecygwinpkg.in \\\n\t$(top_srcdir)/release/makedpkg.in \\\n\t$(top_srcdir)/release/makemacpkg.in \\\n\t$(top_srcdir)/release/uninstall.in compile config.guess \\\n\tconfig.sub depcomp install-sh ltmain.sh missing\nsubdir = .\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \\\n\t$(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nam__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \\\n configure.lineno configure.status.lineno\nmkinstalldirs = $(install_sh) -d\nCONFIG_HEADER = config.h jconfig.h\nCONFIG_CLEAN_FILES = pkgscripts/libjpeg-turbo.spec.tmpl \\\n\tpkgscripts/makecygwinpkg.tmpl pkgscripts/makedpkg.tmpl \\\n\tpkgscripts/makemacpkg.tmpl pkgscripts/Description.plist \\\n\tpkgscripts/Info.plist pkgscripts/uninstall.tmpl tjbenchtest \\\n\ttjbenchtest.java tjexampletest libjpeg.map\nam__vpath_adj_setup = srcdirstrip=`echo \"$(srcdir)\" | sed 's|.|.|g'`;\nam__vpath_adj = case $$p in \\\n    $(srcdir)/*) f=`echo \"$$p\" | sed \"s|^$$srcdirstrip/||\"`;; \\\n    *) f=$$p;; \\\n  esac;\nam__strip_dir = `echo $$p | sed -e 's|^.*/||'`;\nam__installdirs = \"$(DESTDIR)$(libdir)\" \"$(DESTDIR)$(bindir)\" \\\n\t\"$(DESTDIR)$(man1dir)\" \"$(DESTDIR)$(docdir)\" \\\n\t\"$(DESTDIR)$(exampledir)\" \"$(DESTDIR)$(includedir)\" \\\n\t\"$(DESTDIR)$(includedir)\"\nlibLTLIBRARIES_INSTALL = $(INSTALL)\nLTLIBRARIES = $(lib_LTLIBRARIES)\n@WITH_SIMD_TRUE@libjpeg_la_DEPENDENCIES = simd/libsimd.la\nam__libjpeg_la_SOURCES_DIST = jchuff.h jdct.h jdhuff.h jerror.h \\\n\tjinclude.h jmemsys.h jmorecfg.h jpegint.h jpeglib.h jversion.h \\\n\tjsimd.h jsimddct.h jpegcomp.h jcapimin.c jcapistd.c jccoefct.c \\\n\tjccolor.c jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c \\\n\tjcmaster.c jcomapi.c jcparam.c jcphuff.c jcprepct.c jcsample.c \\\n\tjctrans.c jdapimin.c jdapistd.c jdatadst.c jdatasrc.c \\\n\tjdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdinput.c jdmainct.c \\\n\tjdmarker.c jdmaster.c jdmerge.c jdphuff.c jdpostct.c \\\n\tjdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c jfdctint.c \\\n\tjidctflt.c jidctfst.c jidctint.c jidctred.c jquant1.c \\\n\tjquant2.c jutils.c jmemmgr.c jmemnobs.c jaricom.c jcarith.c \\\n\tjdarith.c jsimd_none.c\nam__objects_1 =\n@WITH_ARITH_TRUE@am__objects_2 = jaricom.lo\n@WITH_ARITH_ENC_TRUE@am__objects_3 = jcarith.lo\n@WITH_ARITH_DEC_TRUE@am__objects_4 = jdarith.lo\n@WITH_SIMD_FALSE@am__objects_5 = jsimd_none.lo\nam_libjpeg_la_OBJECTS = $(am__objects_1) jcapimin.lo jcapistd.lo \\\n\tjccoefct.lo jccolor.lo jcdctmgr.lo jchuff.lo jcinit.lo \\\n\tjcmainct.lo jcmarker.lo jcmaster.lo jcomapi.lo jcparam.lo \\\n\tjcphuff.lo jcprepct.lo jcsample.lo jctrans.lo jdapimin.lo \\\n\tjdapistd.lo jdatadst.lo jdatasrc.lo jdcoefct.lo jdcolor.lo \\\n\tjddctmgr.lo jdhuff.lo jdinput.lo jdmainct.lo jdmarker.lo \\\n\tjdmaster.lo jdmerge.lo jdphuff.lo jdpostct.lo jdsample.lo \\\n\tjdtrans.lo jerror.lo jfdctflt.lo jfdctfst.lo jfdctint.lo \\\n\tjidctflt.lo jidctfst.lo jidctint.lo jidctred.lo jquant1.lo \\\n\tjquant2.lo jutils.lo jmemmgr.lo jmemnobs.lo $(am__objects_2) \\\n\t$(am__objects_3) $(am__objects_4) $(am__objects_5)\nlibjpeg_la_OBJECTS = $(am_libjpeg_la_OBJECTS)\n@WITH_SIMD_TRUE@libturbojpeg_la_DEPENDENCIES = simd/libsimd.la\nam__libturbojpeg_la_SOURCES_DIST = jchuff.h jdct.h jdhuff.h jerror.h \\\n\tjinclude.h jmemsys.h jmorecfg.h jpegint.h jpeglib.h jversion.h \\\n\tjsimd.h jsimddct.h jpegcomp.h jcapimin.c jcapistd.c jccoefct.c \\\n\tjccolor.c jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c \\\n\tjcmaster.c jcomapi.c jcparam.c jcphuff.c jcprepct.c jcsample.c \\\n\tjctrans.c jdapimin.c jdapistd.c jdatadst.c jdatasrc.c \\\n\tjdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdinput.c jdmainct.c \\\n\tjdmarker.c jdmaster.c jdmerge.c jdphuff.c jdpostct.c \\\n\tjdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c jfdctint.c \\\n\tjidctflt.c jidctfst.c jidctint.c jidctred.c jquant1.c \\\n\tjquant2.c jutils.c jmemmgr.c jmemnobs.c jaricom.c jcarith.c \\\n\tjdarith.c jsimd_none.c turbojpeg.c turbojpeg.h transupp.c \\\n\ttransupp.h jdatadst-tj.c jdatasrc-tj.c turbojpeg-jni.c \\\n\tturbojpeg-mapfile turbojpeg-mapfile.jni\n@WITH_ARITH_TRUE@am__objects_6 = libturbojpeg_la-jaricom.lo\n@WITH_ARITH_ENC_TRUE@am__objects_7 = libturbojpeg_la-jcarith.lo\n@WITH_ARITH_DEC_TRUE@am__objects_8 = libturbojpeg_la-jdarith.lo\n@WITH_SIMD_FALSE@am__objects_9 = libturbojpeg_la-jsimd_none.lo\nam__objects_10 = $(am__objects_1) libturbojpeg_la-jcapimin.lo \\\n\tlibturbojpeg_la-jcapistd.lo libturbojpeg_la-jccoefct.lo \\\n\tlibturbojpeg_la-jccolor.lo libturbojpeg_la-jcdctmgr.lo \\\n\tlibturbojpeg_la-jchuff.lo libturbojpeg_la-jcinit.lo \\\n\tlibturbojpeg_la-jcmainct.lo libturbojpeg_la-jcmarker.lo \\\n\tlibturbojpeg_la-jcmaster.lo libturbojpeg_la-jcomapi.lo \\\n\tlibturbojpeg_la-jcparam.lo libturbojpeg_la-jcphuff.lo \\\n\tlibturbojpeg_la-jcprepct.lo libturbojpeg_la-jcsample.lo \\\n\tlibturbojpeg_la-jctrans.lo libturbojpeg_la-jdapimin.lo \\\n\tlibturbojpeg_la-jdapistd.lo libturbojpeg_la-jdatadst.lo \\\n\tlibturbojpeg_la-jdatasrc.lo libturbojpeg_la-jdcoefct.lo \\\n\tlibturbojpeg_la-jdcolor.lo libturbojpeg_la-jddctmgr.lo \\\n\tlibturbojpeg_la-jdhuff.lo libturbojpeg_la-jdinput.lo \\\n\tlibturbojpeg_la-jdmainct.lo libturbojpeg_la-jdmarker.lo \\\n\tlibturbojpeg_la-jdmaster.lo libturbojpeg_la-jdmerge.lo \\\n\tlibturbojpeg_la-jdphuff.lo libturbojpeg_la-jdpostct.lo \\\n\tlibturbojpeg_la-jdsample.lo libturbojpeg_la-jdtrans.lo \\\n\tlibturbojpeg_la-jerror.lo libturbojpeg_la-jfdctflt.lo \\\n\tlibturbojpeg_la-jfdctfst.lo libturbojpeg_la-jfdctint.lo \\\n\tlibturbojpeg_la-jidctflt.lo libturbojpeg_la-jidctfst.lo \\\n\tlibturbojpeg_la-jidctint.lo libturbojpeg_la-jidctred.lo \\\n\tlibturbojpeg_la-jquant1.lo libturbojpeg_la-jquant2.lo \\\n\tlibturbojpeg_la-jutils.lo libturbojpeg_la-jmemmgr.lo \\\n\tlibturbojpeg_la-jmemnobs.lo $(am__objects_6) $(am__objects_7) \\\n\t$(am__objects_8) $(am__objects_9)\n@WITH_JAVA_TRUE@@WITH_TURBOJPEG_TRUE@am__objects_11 = libturbojpeg_la-turbojpeg-jni.lo\n@WITH_TURBOJPEG_TRUE@am_libturbojpeg_la_OBJECTS = $(am__objects_10) \\\n@WITH_TURBOJPEG_TRUE@\tlibturbojpeg_la-turbojpeg.lo \\\n@WITH_TURBOJPEG_TRUE@\tlibturbojpeg_la-transupp.lo \\\n@WITH_TURBOJPEG_TRUE@\tlibturbojpeg_la-jdatadst-tj.lo \\\n@WITH_TURBOJPEG_TRUE@\tlibturbojpeg_la-jdatasrc-tj.lo \\\n@WITH_TURBOJPEG_TRUE@\t$(am__objects_11) $(am__objects_1)\nlibturbojpeg_la_OBJECTS = $(am_libturbojpeg_la_OBJECTS)\n@WITH_TURBOJPEG_TRUE@am_libturbojpeg_la_rpath = -rpath $(libdir)\n@WITH_TURBOJPEG_TRUE@am__EXEEXT_1 = tjbench$(EXEEXT)\nbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)\n@WITH_TURBOJPEG_TRUE@am__EXEEXT_2 = tjunittest$(EXEEXT)\nPROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)\nam_cjpeg_OBJECTS = cjpeg-cdjpeg.$(OBJEXT) cjpeg-cjpeg.$(OBJEXT) \\\n\tcjpeg-rdbmp.$(OBJEXT) cjpeg-rdgif.$(OBJEXT) \\\n\tcjpeg-rdppm.$(OBJEXT) cjpeg-rdswitch.$(OBJEXT) \\\n\tcjpeg-rdtarga.$(OBJEXT)\ncjpeg_OBJECTS = $(am_cjpeg_OBJECTS)\ncjpeg_DEPENDENCIES = libjpeg.la\nam_djpeg_OBJECTS = djpeg-cdjpeg.$(OBJEXT) djpeg-djpeg.$(OBJEXT) \\\n\tdjpeg-rdcolmap.$(OBJEXT) djpeg-rdswitch.$(OBJEXT) \\\n\tdjpeg-wrbmp.$(OBJEXT) djpeg-wrgif.$(OBJEXT) \\\n\tdjpeg-wrppm.$(OBJEXT) djpeg-wrtarga.$(OBJEXT)\ndjpeg_OBJECTS = $(am_djpeg_OBJECTS)\ndjpeg_DEPENDENCIES = libjpeg.la\nam_jcstest_OBJECTS = jcstest.$(OBJEXT)\njcstest_OBJECTS = $(am_jcstest_OBJECTS)\njcstest_DEPENDENCIES = libjpeg.la\nam_jpegtran_OBJECTS = jpegtran.$(OBJEXT) rdswitch.$(OBJEXT) \\\n\tcdjpeg.$(OBJEXT) transupp.$(OBJEXT)\njpegtran_OBJECTS = $(am_jpegtran_OBJECTS)\njpegtran_DEPENDENCIES = libjpeg.la\nam_rdjpgcom_OBJECTS = rdjpgcom.$(OBJEXT)\nrdjpgcom_OBJECTS = $(am_rdjpgcom_OBJECTS)\nrdjpgcom_DEPENDENCIES = libjpeg.la\nam__tjbench_SOURCES_DIST = tjbench.c bmp.h bmp.c tjutil.h tjutil.c \\\n\trdbmp.c rdppm.c wrbmp.c wrppm.c\n@WITH_TURBOJPEG_TRUE@am_tjbench_OBJECTS = tjbench-tjbench.$(OBJEXT) \\\n@WITH_TURBOJPEG_TRUE@\ttjbench-bmp.$(OBJEXT) \\\n@WITH_TURBOJPEG_TRUE@\ttjbench-tjutil.$(OBJEXT) \\\n@WITH_TURBOJPEG_TRUE@\ttjbench-rdbmp.$(OBJEXT) \\\n@WITH_TURBOJPEG_TRUE@\ttjbench-rdppm.$(OBJEXT) \\\n@WITH_TURBOJPEG_TRUE@\ttjbench-wrbmp.$(OBJEXT) \\\n@WITH_TURBOJPEG_TRUE@\ttjbench-wrppm.$(OBJEXT)\ntjbench_OBJECTS = $(am_tjbench_OBJECTS)\n@WITH_TURBOJPEG_TRUE@tjbench_DEPENDENCIES = libturbojpeg.la libjpeg.la\nam__tjunittest_SOURCES_DIST = tjunittest.c tjutil.h tjutil.c\n@WITH_TURBOJPEG_TRUE@am_tjunittest_OBJECTS = tjunittest.$(OBJEXT) \\\n@WITH_TURBOJPEG_TRUE@\ttjutil.$(OBJEXT)\ntjunittest_OBJECTS = $(am_tjunittest_OBJECTS)\n@WITH_TURBOJPEG_TRUE@tjunittest_DEPENDENCIES = libturbojpeg.la\nam_wrjpgcom_OBJECTS = wrjpgcom.$(OBJEXT)\nwrjpgcom_OBJECTS = $(am_wrjpgcom_OBJECTS)\nwrjpgcom_DEPENDENCIES = libjpeg.la\nDEFAULT_INCLUDES = -I. -I$(srcdir) -I. -I.\ndepcomp = $(SHELL) $(top_srcdir)/depcomp\nam__depfiles_maybe = depfiles\nCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\nLTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \\\n\t$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \\\n\t$(AM_CFLAGS) $(CFLAGS)\nCCLD = $(CC)\nLINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \\\n\t$(AM_LDFLAGS) $(LDFLAGS) -o $@\nSOURCES = $(libjpeg_la_SOURCES) $(libturbojpeg_la_SOURCES) \\\n\t$(cjpeg_SOURCES) $(djpeg_SOURCES) $(jcstest_SOURCES) \\\n\t$(jpegtran_SOURCES) $(rdjpgcom_SOURCES) $(tjbench_SOURCES) \\\n\t$(tjunittest_SOURCES) $(wrjpgcom_SOURCES)\nDIST_SOURCES = $(am__libjpeg_la_SOURCES_DIST) \\\n\t$(am__libturbojpeg_la_SOURCES_DIST) $(cjpeg_SOURCES) \\\n\t$(djpeg_SOURCES) $(jcstest_SOURCES) $(jpegtran_SOURCES) \\\n\t$(rdjpgcom_SOURCES) $(am__tjbench_SOURCES_DIST) \\\n\t$(am__tjunittest_SOURCES_DIST) $(wrjpgcom_SOURCES)\nRECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \\\n\thtml-recursive info-recursive install-data-recursive \\\n\tinstall-exec-recursive install-info-recursive \\\n\tinstall-recursive installcheck-recursive installdirs-recursive \\\n\tpdf-recursive ps-recursive uninstall-info-recursive \\\n\tuninstall-recursive\nman1dir = $(mandir)/man1\nNROFF = nroff\nMANS = $(dist_man1_MANS)\ndist_docDATA_INSTALL = $(INSTALL_DATA)\ndist_exampleDATA_INSTALL = $(INSTALL_DATA)\nDATA = $(dist_doc_DATA) $(dist_example_DATA)\nam__include_HEADERS_DIST = jerror.h jmorecfg.h jpeglib.h turbojpeg.h\nincludeHEADERS_INSTALL = $(INSTALL_HEADER)\nnodist_includeHEADERS_INSTALL = $(INSTALL_HEADER)\nHEADERS = $(include_HEADERS) $(nodist_include_HEADERS)\nETAGS = etags\nCTAGS = ctags\nDIST_SUBDIRS = java simd md5\nDISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)\ndistdir = $(PACKAGE)-$(VERSION)\ntop_distdir = $(distdir)\nam__remove_distdir = \\\n  { test ! -d $(distdir) \\\n    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \\\n         && rm -fr $(distdir); }; }\nDIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2\nGZIP_ENV = --best\ndistuninstallcheck_listfiles = find . -type f -print\ndistcleancheck_listfiles = find . -type f -print\nACLOCAL = @ACLOCAL@\nAMDEP_FALSE = @AMDEP_FALSE@\nAMDEP_TRUE = @AMDEP_TRUE@\nAMTAR = @AMTAR@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAWK = @AWK@\nBUILD = @BUILD@\nCC = @CC@\nCCAS = @CCAS@\nCCASFLAGS = @CCASFLAGS@\nCCDEPMODE = @CCDEPMODE@\nCFLAGS = @CFLAGS@\nCPP = @CPP@\nCPPFLAGS = @CPPFLAGS@\nCXX = @CXX@\nCXXCPP = @CXXCPP@\nCXXDEPMODE = @CXXDEPMODE@\nCXXFLAGS = @CXXFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEBARCH = @DEBARCH@\nDEFS = @DEFS@\nDEPDIR = @DEPDIR@\nECHO = @ECHO@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEGREP = @EGREP@\nEXEEXT = @EXEEXT@\nF77 = @F77@\nFFLAGS = @FFLAGS@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nJAR = @JAR@\nJAVA = @JAVA@\nJAVAC = @JAVAC@\nJAVACFLAGS = @JAVACFLAGS@\nJAVA_RPM_CONTENTS_1 = @JAVA_RPM_CONTENTS_1@\nJAVA_RPM_CONTENTS_2 = @JAVA_RPM_CONTENTS_2@\nJNI_CFLAGS = @JNI_CFLAGS@\nJPEG_LIB_VERSION = @JPEG_LIB_VERSION@\nJPEG_LIB_VERSION_DECIMAL = @JPEG_LIB_VERSION_DECIMAL@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBS = @LIBS@\nLIBTOOL = @LIBTOOL@\nLIBTOOL_CURRENT = @LIBTOOL_CURRENT@\nLN_S = @LN_S@\nLTLIBOBJS = @LTLIBOBJS@\nMAKEINFO = @MAKEINFO@\nMEM_SRCDST_FUNCTIONS = @MEM_SRCDST_FUNCTIONS@\nNAFLAGS = @NAFLAGS@\nNASM = @NASM@\nOBJEXT = @OBJEXT@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nPKGNAME = @PKGNAME@\nRANLIB = @RANLIB@\nRPMARCH = @RPMARCH@\nRPM_CONFIG_ARGS = @RPM_CONFIG_ARGS@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSIMD_ARM_FALSE = @SIMD_ARM_FALSE@\nSIMD_ARM_TRUE = @SIMD_ARM_TRUE@\nSIMD_I386_FALSE = @SIMD_I386_FALSE@\nSIMD_I386_TRUE = @SIMD_I386_TRUE@\nSIMD_X86_64_FALSE = @SIMD_X86_64_FALSE@\nSIMD_X86_64_TRUE = @SIMD_X86_64_TRUE@\nSO_AGE = @SO_AGE@\nSO_MAJOR_VERSION = @SO_MAJOR_VERSION@\nSO_MINOR_VERSION = @SO_MINOR_VERSION@\nSTRIP = @STRIP@\nVERSION = @VERSION@\nVERSION_SCRIPT_FALSE = @VERSION_SCRIPT_FALSE@\nVERSION_SCRIPT_FLAG = @VERSION_SCRIPT_FLAG@\nVERSION_SCRIPT_TRUE = @VERSION_SCRIPT_TRUE@\nWITH_ARITH_DEC_FALSE = @WITH_ARITH_DEC_FALSE@\nWITH_ARITH_DEC_TRUE = @WITH_ARITH_DEC_TRUE@\nWITH_ARITH_ENC_FALSE = @WITH_ARITH_ENC_FALSE@\nWITH_ARITH_ENC_TRUE = @WITH_ARITH_ENC_TRUE@\nWITH_ARITH_FALSE = @WITH_ARITH_FALSE@\nWITH_ARITH_TRUE = @WITH_ARITH_TRUE@\nWITH_JAVA = @WITH_JAVA@\nWITH_JAVA_FALSE = @WITH_JAVA_FALSE@\nWITH_JAVA_TRUE = @WITH_JAVA_TRUE@\nWITH_SIMD_FALSE = @WITH_SIMD_FALSE@\nWITH_SIMD_TRUE = @WITH_SIMD_TRUE@\nWITH_SSE_FLOAT_DCT_FALSE = @WITH_SSE_FLOAT_DCT_FALSE@\nWITH_SSE_FLOAT_DCT_TRUE = @WITH_SSE_FLOAT_DCT_TRUE@\nWITH_TURBOJPEG_FALSE = @WITH_TURBOJPEG_FALSE@\nWITH_TURBOJPEG_TRUE = @WITH_TURBOJPEG_TRUE@\nX86_64_FALSE = @X86_64_FALSE@\nX86_64_TRUE = @X86_64_TRUE@\nac_ct_AR = @ac_ct_AR@\nac_ct_CC = @ac_ct_CC@\nac_ct_CXX = @ac_ct_CXX@\nac_ct_F77 = @ac_ct_F77@\nac_ct_RANLIB = @ac_ct_RANLIB@\nac_ct_STRIP = @ac_ct_STRIP@\nam__fastdepCC_FALSE = @am__fastdepCC_FALSE@\nam__fastdepCC_TRUE = @am__fastdepCC_TRUE@\nam__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@\nam__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@\nam__include = @am__include@\nam__leading_dot = @am__leading_dot@\nam__quote = @am__quote@\nam__tar = @am__tar@\nam__untar = @am__untar@\nbindir = @bindir@\nbuild = @build@\nbuild_alias = @build_alias@\nbuild_cpu = @build_cpu@\nbuild_os = @build_os@\nbuild_vendor = @build_vendor@\ndatadir = @datadir@\nexec_prefix = @exec_prefix@\nhost = @host@\nhost_alias = @host_alias@\nhost_cpu = @host_cpu@\nhost_os = @host_os@\nhost_vendor = @host_vendor@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\nlib_LTLIBRARIES = libjpeg.la $(am__append_1)\nlibjpeg_la_LDFLAGS = -version-info \\\n\t${LIBTOOL_CURRENT}:${SO_MINOR_VERSION}:${SO_AGE} -no-undefined \\\n\t$(am__append_8)\ninclude_HEADERS = jerror.h jmorecfg.h jpeglib.h $(am__append_2)\n@WITH_TURBOJPEG_TRUE@libturbojpeg_la_LDFLAGS = -version-info 0:0 \\\n@WITH_TURBOJPEG_TRUE@\t-no-undefined $(am__append_7)\nnodist_include_HEADERS = jconfig.h\nHDRS = jchuff.h jdct.h jdhuff.h jerror.h jinclude.h jmemsys.h jmorecfg.h \\\n\tjpegint.h jpeglib.h jversion.h jsimd.h jsimddct.h jpegcomp.h\n\nlibjpeg_la_SOURCES = $(HDRS) jcapimin.c jcapistd.c jccoefct.c \\\n\tjccolor.c jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c \\\n\tjcmaster.c jcomapi.c jcparam.c jcphuff.c jcprepct.c jcsample.c \\\n\tjctrans.c jdapimin.c jdapistd.c jdatadst.c jdatasrc.c \\\n\tjdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdinput.c jdmainct.c \\\n\tjdmarker.c jdmaster.c jdmerge.c jdphuff.c jdpostct.c \\\n\tjdsample.c jdtrans.c jerror.c jfdctflt.c jfdctfst.c jfdctint.c \\\n\tjidctflt.c jidctfst.c jidctint.c jidctred.c jquant1.c \\\n\tjquant2.c jutils.c jmemmgr.c jmemnobs.c $(am__append_3) \\\n\t$(am__append_4) $(am__append_5) $(am__append_10)\nSUBDIRS = java $(am__append_9) md5\n@WITH_TURBOJPEG_TRUE@libturbojpeg_la_SOURCES = $(libjpeg_la_SOURCES) \\\n@WITH_TURBOJPEG_TRUE@\tturbojpeg.c turbojpeg.h transupp.c \\\n@WITH_TURBOJPEG_TRUE@\ttransupp.h jdatadst-tj.c jdatasrc-tj.c \\\n@WITH_TURBOJPEG_TRUE@\t$(am__append_6) $(TJMAPFILE)\n@WITH_JAVA_TRUE@@WITH_TURBOJPEG_TRUE@libturbojpeg_la_CFLAGS = ${JNI_CFLAGS}\n@WITH_JAVA_FALSE@@WITH_TURBOJPEG_TRUE@TJMAPFILE = turbojpeg-mapfile\n@WITH_JAVA_TRUE@@WITH_TURBOJPEG_TRUE@TJMAPFILE = turbojpeg-mapfile.jni\n@WITH_SIMD_TRUE@libjpeg_la_LIBADD = simd/libsimd.la\n@WITH_SIMD_TRUE@libturbojpeg_la_LIBADD = simd/libsimd.la\n@WITH_TURBOJPEG_TRUE@tjbench_SOURCES = tjbench.c bmp.h bmp.c tjutil.h tjutil.c rdbmp.c rdppm.c \\\n@WITH_TURBOJPEG_TRUE@\twrbmp.c wrppm.c\n\n@WITH_TURBOJPEG_TRUE@tjbench_LDADD = libturbojpeg.la libjpeg.la -lm\n@WITH_TURBOJPEG_TRUE@tjbench_CFLAGS = -DBMP_SUPPORTED -DPPM_SUPPORTED\n@WITH_TURBOJPEG_TRUE@tjunittest_SOURCES = tjunittest.c tjutil.h tjutil.c\n@WITH_TURBOJPEG_TRUE@tjunittest_LDADD = libturbojpeg.la\ncjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c cjpeg.c rdbmp.c rdgif.c \\\n\trdppm.c rdswitch.c rdtarga.c \n\ncjpeg_LDADD = libjpeg.la\ncjpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \\\n\t-DTARGA_SUPPORTED\n\ndjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c djpeg.c rdcolmap.c rdswitch.c \\\n\twrbmp.c wrgif.c wrppm.c wrtarga.c\n\ndjpeg_LDADD = libjpeg.la\ndjpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \\\n\t-DTARGA_SUPPORTED\n\njpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c transupp.h\njpegtran_LDADD = libjpeg.la\nrdjpgcom_SOURCES = rdjpgcom.c\nrdjpgcom_LDADD = libjpeg.la\nwrjpgcom_SOURCES = wrjpgcom.c\nwrjpgcom_LDADD = libjpeg.la\njcstest_SOURCES = jcstest.c\njcstest_LDADD = libjpeg.la\ndist_man1_MANS = cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1\nDOCS = coderules.txt jconfig.txt change.log rdrle.c wrrle.c BUILDING.txt \\\n\tChangeLog.txt\n\ndocdir = $(datadir)/doc\ndist_doc_DATA = README README-turbo.txt libjpeg.txt structure.txt usage.txt \\\n\twizard.txt \n\nexampledir = $(datadir)/doc\ndist_example_DATA = example.c\nEXTRA_DIST = win release $(DOCS) testimages CMakeLists.txt \\\n\tsharedlib/CMakeLists.txt cmakescripts libjpeg.map.in doc doxygen.config \\\n\tjccolext.c jdcolext.c jdmrgext.c\n\nMD5_JPEG_INT = 9a68f56bc76e466aa7e52f415d0f4a5f\nMD5_JPEG_FAST = 0e1502e7fa421835e376a314fac2a39f\nMD5_JPEG_FAST_100 = 7bf72a8e741d64eecb960c97323af77c\nMD5_JPEG_FLOAT = d1623885ffafcd40c684af09e3d65cd5\nMD5_JPEG_FLOAT_NOSIMD = fb4884c35f8273f498cb32879de5c455\nMD5_JPEG_INT_GRAY = 72b51f894b8f4a10b3ee3066770aa38d\nMD5_PPM_INT = d1ed0d11f076b842525271647716aeb8\nMD5_PPM_FAST = 048298a2d2410261c0533cb97bcfef23\nMD5_PPM_FLOAT = 7f5b446ee36b2630e06785b8d42af15f\nMD5_PPM_FLOAT_NOSIMD = 64072f1dbdc5b3a187777788604971a5\nMD5_PPM_INT_2_1 = 9f9de8c0612f8d06869b960b05abf9c9\nMD5_PPM_INT_15_8 = b6875bc070720b899566cc06459b63b7\nMD5_PPM_INT_7_4 = 06a177eae05f164fac57f7a2c346ee87\nMD5_PPM_INT_13_8 = bc3452573c8152f6ae552939ee19f82f\nMD5_PPM_INT_3_2 = f5a8b88a8a7f96016f04d259cf82ed67\nMD5_PPM_INT_11_8 = d8cc73c0aaacd4556569b59437ba00a5\nMD5_PPM_INT_5_4 = 32775dd9ad2ab90f4c5b219b53e0c86c\nMD5_PPM_INT_9_8 = d25e61bc7eac0002f5b393aa223747b6\nMD5_PPM_INT_7_8 = ddb564b7c74a09494016d6cd7502a946\nMD5_PPM_INT_3_4 = 8ed8e68808c3fbc4ea764fc9d2968646\nMD5_PPM_INT_5_8 = a3363274999da2366a024efae6d16c9b\nMD5_PPM_INT_1_2 = e692a315cea26b988c8e8b29a5dbcd81\nMD5_PPM_INT_3_8 = 79eca9175652ced755155c90e785a996\nMD5_PPM_INT_1_4 = 79cd778f8bf1a117690052cacdd54eca\nMD5_PPM_INT_1_8 = 391b3d4aca640c8567d6f8745eb2142f\nMD5_PPM_FAST_1_2 = f30bcf6d32ccd44cbdd9aeaacbd9454f\nMD5_BMP_256 = 4980185e3776e89bd931736e1cddeee6\nMD5_JPEG_ARI = e986fb0a637a8d833d96e8a6d6d84ea1\nMD5_PPM_ARI = 72b59a99bcf1de24c5b27d151bde2437\nMD5_JPEG_PROG = 1c4afddc05c0a43489ee54438a482d92\nMD5_JPEG_PROG_ARI = 0a8f1c8f66e113c3cf635df0a475a617\nMD5_JPEG_CROP = b4197f377e621c4e9b1d20471432610d\nall: config.h jconfig.h\n\t$(MAKE) $(AM_MAKEFLAGS) all-recursive\n\n.SUFFIXES:\n.SUFFIXES: .c .lo .o .obj\nam--refresh:\n\t@:\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \\\n\t      cd $(srcdir) && $(AUTOMAKE) --foreign  \\\n\t\t&& exit 0; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Makefile'; \\\n\tcd $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign  Makefile\n.PRECIOUS: Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    echo ' $(SHELL) ./config.status'; \\\n\t    $(SHELL) ./config.status;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\t$(SHELL) ./config.status --recheck\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\tcd $(srcdir) && $(AUTOCONF)\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\tcd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)\n\nconfig.h: stamp-h1\n\t@if test ! -f $@; then \\\n\t  rm -f stamp-h1; \\\n\t  $(MAKE) stamp-h1; \\\n\telse :; fi\n\nstamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status\n\t@rm -f stamp-h1\n\tcd $(top_builddir) && $(SHELL) ./config.status config.h\n$(srcdir)/config.h.in:  $(am__configure_deps) \n\tcd $(top_srcdir) && $(AUTOHEADER)\n\trm -f stamp-h1\n\ttouch $@\n\njconfig.h: stamp-h2\n\t@if test ! -f $@; then \\\n\t  rm -f stamp-h2; \\\n\t  $(MAKE) stamp-h2; \\\n\telse :; fi\n\nstamp-h2: $(srcdir)/jconfig.h.in $(top_builddir)/config.status\n\t@rm -f stamp-h2\n\tcd $(top_builddir) && $(SHELL) ./config.status jconfig.h\n\ndistclean-hdr:\n\t-rm -f config.h stamp-h1 jconfig.h stamp-h2\npkgscripts/libjpeg-turbo.spec.tmpl: $(top_builddir)/config.status $(top_srcdir)/release/libjpeg-turbo.spec.in\n\tcd $(top_builddir) && $(SHELL) ./config.status $@\npkgscripts/makecygwinpkg.tmpl: $(top_builddir)/config.status $(top_srcdir)/release/makecygwinpkg.in\n\tcd $(top_builddir) && $(SHELL) ./config.status $@\npkgscripts/makedpkg.tmpl: $(top_builddir)/config.status $(top_srcdir)/release/makedpkg.in\n\tcd $(top_builddir) && $(SHELL) ./config.status $@\npkgscripts/makemacpkg.tmpl: $(top_builddir)/config.status $(top_srcdir)/release/makemacpkg.in\n\tcd $(top_builddir) && $(SHELL) ./config.status $@\npkgscripts/Description.plist: $(top_builddir)/config.status $(top_srcdir)/release/Description.plist.in\n\tcd $(top_builddir) && $(SHELL) ./config.status $@\npkgscripts/Info.plist: $(top_builddir)/config.status $(top_srcdir)/release/Info.plist.in\n\tcd $(top_builddir) && $(SHELL) ./config.status $@\npkgscripts/uninstall.tmpl: $(top_builddir)/config.status $(top_srcdir)/release/uninstall.in\n\tcd $(top_builddir) && $(SHELL) ./config.status $@\ntjbenchtest: $(top_builddir)/config.status $(srcdir)/tjbenchtest.in\n\tcd $(top_builddir) && $(SHELL) ./config.status $@\ntjbenchtest.java: $(top_builddir)/config.status $(srcdir)/tjbenchtest.java.in\n\tcd $(top_builddir) && $(SHELL) ./config.status $@\ntjexampletest: $(top_builddir)/config.status $(srcdir)/tjexampletest.in\n\tcd $(top_builddir) && $(SHELL) ./config.status $@\nlibjpeg.map: $(top_builddir)/config.status $(srcdir)/libjpeg.map.in\n\tcd $(top_builddir) && $(SHELL) ./config.status $@\ninstall-libLTLIBRARIES: $(lib_LTLIBRARIES)\n\t@$(NORMAL_INSTALL)\n\ttest -z \"$(libdir)\" || $(mkdir_p) \"$(DESTDIR)$(libdir)\"\n\t@list='$(lib_LTLIBRARIES)'; for p in $$list; do \\\n\t  if test -f $$p; then \\\n\t    f=$(am__strip_dir) \\\n\t    echo \" $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'\"; \\\n\t    $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) \"$$p\" \"$(DESTDIR)$(libdir)/$$f\"; \\\n\t  else :; fi; \\\n\tdone\n\nuninstall-libLTLIBRARIES:\n\t@$(NORMAL_UNINSTALL)\n\t@set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \\\n\t  p=$(am__strip_dir) \\\n\t  echo \" $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'\"; \\\n\t  $(LIBTOOL) --mode=uninstall rm -f \"$(DESTDIR)$(libdir)/$$p\"; \\\n\tdone\n\nclean-libLTLIBRARIES:\n\t-test -z \"$(lib_LTLIBRARIES)\" || rm -f $(lib_LTLIBRARIES)\n\t@list='$(lib_LTLIBRARIES)'; for p in $$list; do \\\n\t  dir=\"`echo $$p | sed -e 's|/[^/]*$$||'`\"; \\\n\t  test \"$$dir\" != \"$$p\" || dir=.; \\\n\t  echo \"rm -f \\\"$${dir}/so_locations\\\"\"; \\\n\t  rm -f \"$${dir}/so_locations\"; \\\n\tdone\nlibjpeg.la: $(libjpeg_la_OBJECTS) $(libjpeg_la_DEPENDENCIES) \n\t$(LINK) -rpath $(libdir) $(libjpeg_la_LDFLAGS) $(libjpeg_la_OBJECTS) $(libjpeg_la_LIBADD) $(LIBS)\nlibturbojpeg.la: $(libturbojpeg_la_OBJECTS) $(libturbojpeg_la_DEPENDENCIES) \n\t$(LINK) $(am_libturbojpeg_la_rpath) $(libturbojpeg_la_LDFLAGS) $(libturbojpeg_la_OBJECTS) $(libturbojpeg_la_LIBADD) $(LIBS)\ninstall-binPROGRAMS: $(bin_PROGRAMS)\n\t@$(NORMAL_INSTALL)\n\ttest -z \"$(bindir)\" || $(mkdir_p) \"$(DESTDIR)$(bindir)\"\n\t@list='$(bin_PROGRAMS)'; for p in $$list; do \\\n\t  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \\\n\t  if test -f $$p \\\n\t     || test -f $$p1 \\\n\t  ; then \\\n\t    f=`echo \"$$p1\" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \\\n\t   echo \" $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'\"; \\\n\t   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) \"$$p\" \"$(DESTDIR)$(bindir)/$$f\" || exit 1; \\\n\t  else :; fi; \\\n\tdone\n\nuninstall-binPROGRAMS:\n\t@$(NORMAL_UNINSTALL)\n\t@list='$(bin_PROGRAMS)'; for p in $$list; do \\\n\t  f=`echo \"$$p\" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \\\n\t  echo \" rm -f '$(DESTDIR)$(bindir)/$$f'\"; \\\n\t  rm -f \"$(DESTDIR)$(bindir)/$$f\"; \\\n\tdone\n\nclean-binPROGRAMS:\n\t@list='$(bin_PROGRAMS)'; for p in $$list; do \\\n\t  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \\\n\t  echo \" rm -f $$p $$f\"; \\\n\t  rm -f $$p $$f ; \\\n\tdone\n\nclean-noinstPROGRAMS:\n\t@list='$(noinst_PROGRAMS)'; for p in $$list; do \\\n\t  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \\\n\t  echo \" rm -f $$p $$f\"; \\\n\t  rm -f $$p $$f ; \\\n\tdone\ncjpeg$(EXEEXT): $(cjpeg_OBJECTS) $(cjpeg_DEPENDENCIES) \n\t@rm -f cjpeg$(EXEEXT)\n\t$(LINK) $(cjpeg_LDFLAGS) $(cjpeg_OBJECTS) $(cjpeg_LDADD) $(LIBS)\ndjpeg$(EXEEXT): $(djpeg_OBJECTS) $(djpeg_DEPENDENCIES) \n\t@rm -f djpeg$(EXEEXT)\n\t$(LINK) $(djpeg_LDFLAGS) $(djpeg_OBJECTS) $(djpeg_LDADD) $(LIBS)\njcstest$(EXEEXT): $(jcstest_OBJECTS) $(jcstest_DEPENDENCIES) \n\t@rm -f jcstest$(EXEEXT)\n\t$(LINK) $(jcstest_LDFLAGS) $(jcstest_OBJECTS) $(jcstest_LDADD) $(LIBS)\njpegtran$(EXEEXT): $(jpegtran_OBJECTS) $(jpegtran_DEPENDENCIES) \n\t@rm -f jpegtran$(EXEEXT)\n\t$(LINK) $(jpegtran_LDFLAGS) $(jpegtran_OBJECTS) $(jpegtran_LDADD) $(LIBS)\nrdjpgcom$(EXEEXT): $(rdjpgcom_OBJECTS) $(rdjpgcom_DEPENDENCIES) \n\t@rm -f rdjpgcom$(EXEEXT)\n\t$(LINK) $(rdjpgcom_LDFLAGS) $(rdjpgcom_OBJECTS) $(rdjpgcom_LDADD) $(LIBS)\ntjbench$(EXEEXT): $(tjbench_OBJECTS) $(tjbench_DEPENDENCIES) \n\t@rm -f tjbench$(EXEEXT)\n\t$(LINK) $(tjbench_LDFLAGS) $(tjbench_OBJECTS) $(tjbench_LDADD) $(LIBS)\ntjunittest$(EXEEXT): $(tjunittest_OBJECTS) $(tjunittest_DEPENDENCIES) \n\t@rm -f tjunittest$(EXEEXT)\n\t$(LINK) $(tjunittest_LDFLAGS) $(tjunittest_OBJECTS) $(tjunittest_LDADD) $(LIBS)\nwrjpgcom$(EXEEXT): $(wrjpgcom_OBJECTS) $(wrjpgcom_DEPENDENCIES) \n\t@rm -f wrjpgcom$(EXEEXT)\n\t$(LINK) $(wrjpgcom_LDFLAGS) $(wrjpgcom_OBJECTS) $(wrjpgcom_LDADD) $(LIBS)\n\nmostlyclean-compile:\n\t-rm -f *.$(OBJEXT)\n\ndistclean-compile:\n\t-rm -f *.tab.c\n\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdjpeg.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cjpeg-cdjpeg.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cjpeg-cjpeg.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cjpeg-rdbmp.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cjpeg-rdgif.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cjpeg-rdppm.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cjpeg-rdswitch.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cjpeg-rdtarga.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg-cdjpeg.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg-djpeg.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg-rdcolmap.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg-rdswitch.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg-wrbmp.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg-wrgif.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg-wrppm.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/djpeg-wrtarga.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jaricom.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcapimin.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcapistd.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcarith.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jccoefct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jccolor.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcdctmgr.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jchuff.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcinit.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmainct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmarker.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcmaster.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcomapi.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcparam.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcphuff.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcprepct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcsample.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jcstest.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jctrans.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdapimin.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdapistd.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdarith.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdatadst.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdatasrc.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdcoefct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdcolor.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jddctmgr.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdhuff.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdinput.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmainct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmarker.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmaster.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdmerge.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdphuff.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdpostct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdsample.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jdtrans.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jerror.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctflt.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctfst.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jfdctint.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctflt.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctfst.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctint.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jidctred.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jmemmgr.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jmemnobs.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jpegtran.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jquant1.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jquant2.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsimd_none.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jutils.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jaricom.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcapimin.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcapistd.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcarith.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jccoefct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jccolor.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcdctmgr.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jchuff.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcinit.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcmainct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcmarker.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcmaster.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcomapi.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcparam.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcphuff.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcprepct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jcsample.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jctrans.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdapimin.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdapistd.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdarith.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdatadst-tj.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdatadst.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdatasrc-tj.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdatasrc.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdcoefct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdcolor.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jddctmgr.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdhuff.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdinput.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdmainct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdmarker.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdmaster.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdmerge.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdphuff.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdpostct.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdsample.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jdtrans.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jerror.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jfdctflt.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jfdctfst.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jfdctint.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jidctflt.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jidctfst.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jidctint.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jidctred.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jmemmgr.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jmemnobs.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jquant1.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jquant2.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jsimd_none.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-jutils.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-transupp.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-turbojpeg-jni.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libturbojpeg_la-turbojpeg.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdjpgcom.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdswitch.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tjbench-bmp.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tjbench-rdbmp.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tjbench-rdppm.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tjbench-tjbench.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tjbench-tjutil.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tjbench-wrbmp.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tjbench-wrppm.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tjunittest.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tjutil.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transupp.Po@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrjpgcom.Po@am__quote@\n\n.c.o:\n@am__fastdepCC_TRUE@\tif $(COMPILE) -MT $@ -MD -MP -MF \"$(DEPDIR)/$*.Tpo\" -c -o $@ $<; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/$*.Tpo\" \"$(DEPDIR)/$*.Po\"; else rm -f \"$(DEPDIR)/$*.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='$<' object='$@' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(COMPILE) -c $<\n\n.c.obj:\n@am__fastdepCC_TRUE@\tif $(COMPILE) -MT $@ -MD -MP -MF \"$(DEPDIR)/$*.Tpo\" -c -o $@ `$(CYGPATH_W) '$<'`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/$*.Tpo\" \"$(DEPDIR)/$*.Po\"; else rm -f \"$(DEPDIR)/$*.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='$<' object='$@' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(COMPILE) -c `$(CYGPATH_W) '$<'`\n\n.c.lo:\n@am__fastdepCC_TRUE@\tif $(LTCOMPILE) -MT $@ -MD -MP -MF \"$(DEPDIR)/$*.Tpo\" -c -o $@ $<; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/$*.Tpo\" \"$(DEPDIR)/$*.Plo\"; else rm -f \"$(DEPDIR)/$*.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='$<' object='$@' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LTCOMPILE) -c -o $@ $<\n\nlibturbojpeg_la-jcapimin.lo: jcapimin.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcapimin.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jcapimin.Tpo\" -c -o libturbojpeg_la-jcapimin.lo `test -f 'jcapimin.c' || echo '$(srcdir)/'`jcapimin.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jcapimin.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jcapimin.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jcapimin.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jcapimin.c' object='libturbojpeg_la-jcapimin.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcapimin.lo `test -f 'jcapimin.c' || echo '$(srcdir)/'`jcapimin.c\n\nlibturbojpeg_la-jcapistd.lo: jcapistd.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcapistd.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jcapistd.Tpo\" -c -o libturbojpeg_la-jcapistd.lo `test -f 'jcapistd.c' || echo '$(srcdir)/'`jcapistd.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jcapistd.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jcapistd.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jcapistd.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jcapistd.c' object='libturbojpeg_la-jcapistd.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcapistd.lo `test -f 'jcapistd.c' || echo '$(srcdir)/'`jcapistd.c\n\nlibturbojpeg_la-jccoefct.lo: jccoefct.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jccoefct.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jccoefct.Tpo\" -c -o libturbojpeg_la-jccoefct.lo `test -f 'jccoefct.c' || echo '$(srcdir)/'`jccoefct.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jccoefct.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jccoefct.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jccoefct.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jccoefct.c' object='libturbojpeg_la-jccoefct.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jccoefct.lo `test -f 'jccoefct.c' || echo '$(srcdir)/'`jccoefct.c\n\nlibturbojpeg_la-jccolor.lo: jccolor.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jccolor.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jccolor.Tpo\" -c -o libturbojpeg_la-jccolor.lo `test -f 'jccolor.c' || echo '$(srcdir)/'`jccolor.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jccolor.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jccolor.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jccolor.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jccolor.c' object='libturbojpeg_la-jccolor.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jccolor.lo `test -f 'jccolor.c' || echo '$(srcdir)/'`jccolor.c\n\nlibturbojpeg_la-jcdctmgr.lo: jcdctmgr.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcdctmgr.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jcdctmgr.Tpo\" -c -o libturbojpeg_la-jcdctmgr.lo `test -f 'jcdctmgr.c' || echo '$(srcdir)/'`jcdctmgr.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jcdctmgr.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jcdctmgr.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jcdctmgr.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jcdctmgr.c' object='libturbojpeg_la-jcdctmgr.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcdctmgr.lo `test -f 'jcdctmgr.c' || echo '$(srcdir)/'`jcdctmgr.c\n\nlibturbojpeg_la-jchuff.lo: jchuff.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jchuff.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jchuff.Tpo\" -c -o libturbojpeg_la-jchuff.lo `test -f 'jchuff.c' || echo '$(srcdir)/'`jchuff.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jchuff.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jchuff.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jchuff.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jchuff.c' object='libturbojpeg_la-jchuff.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jchuff.lo `test -f 'jchuff.c' || echo '$(srcdir)/'`jchuff.c\n\nlibturbojpeg_la-jcinit.lo: jcinit.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcinit.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jcinit.Tpo\" -c -o libturbojpeg_la-jcinit.lo `test -f 'jcinit.c' || echo '$(srcdir)/'`jcinit.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jcinit.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jcinit.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jcinit.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jcinit.c' object='libturbojpeg_la-jcinit.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcinit.lo `test -f 'jcinit.c' || echo '$(srcdir)/'`jcinit.c\n\nlibturbojpeg_la-jcmainct.lo: jcmainct.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcmainct.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jcmainct.Tpo\" -c -o libturbojpeg_la-jcmainct.lo `test -f 'jcmainct.c' || echo '$(srcdir)/'`jcmainct.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jcmainct.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jcmainct.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jcmainct.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jcmainct.c' object='libturbojpeg_la-jcmainct.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcmainct.lo `test -f 'jcmainct.c' || echo '$(srcdir)/'`jcmainct.c\n\nlibturbojpeg_la-jcmarker.lo: jcmarker.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcmarker.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jcmarker.Tpo\" -c -o libturbojpeg_la-jcmarker.lo `test -f 'jcmarker.c' || echo '$(srcdir)/'`jcmarker.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jcmarker.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jcmarker.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jcmarker.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jcmarker.c' object='libturbojpeg_la-jcmarker.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcmarker.lo `test -f 'jcmarker.c' || echo '$(srcdir)/'`jcmarker.c\n\nlibturbojpeg_la-jcmaster.lo: jcmaster.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcmaster.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jcmaster.Tpo\" -c -o libturbojpeg_la-jcmaster.lo `test -f 'jcmaster.c' || echo '$(srcdir)/'`jcmaster.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jcmaster.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jcmaster.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jcmaster.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jcmaster.c' object='libturbojpeg_la-jcmaster.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcmaster.lo `test -f 'jcmaster.c' || echo '$(srcdir)/'`jcmaster.c\n\nlibturbojpeg_la-jcomapi.lo: jcomapi.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcomapi.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jcomapi.Tpo\" -c -o libturbojpeg_la-jcomapi.lo `test -f 'jcomapi.c' || echo '$(srcdir)/'`jcomapi.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jcomapi.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jcomapi.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jcomapi.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jcomapi.c' object='libturbojpeg_la-jcomapi.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcomapi.lo `test -f 'jcomapi.c' || echo '$(srcdir)/'`jcomapi.c\n\nlibturbojpeg_la-jcparam.lo: jcparam.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcparam.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jcparam.Tpo\" -c -o libturbojpeg_la-jcparam.lo `test -f 'jcparam.c' || echo '$(srcdir)/'`jcparam.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jcparam.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jcparam.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jcparam.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jcparam.c' object='libturbojpeg_la-jcparam.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcparam.lo `test -f 'jcparam.c' || echo '$(srcdir)/'`jcparam.c\n\nlibturbojpeg_la-jcphuff.lo: jcphuff.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcphuff.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jcphuff.Tpo\" -c -o libturbojpeg_la-jcphuff.lo `test -f 'jcphuff.c' || echo '$(srcdir)/'`jcphuff.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jcphuff.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jcphuff.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jcphuff.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jcphuff.c' object='libturbojpeg_la-jcphuff.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcphuff.lo `test -f 'jcphuff.c' || echo '$(srcdir)/'`jcphuff.c\n\nlibturbojpeg_la-jcprepct.lo: jcprepct.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcprepct.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jcprepct.Tpo\" -c -o libturbojpeg_la-jcprepct.lo `test -f 'jcprepct.c' || echo '$(srcdir)/'`jcprepct.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jcprepct.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jcprepct.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jcprepct.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jcprepct.c' object='libturbojpeg_la-jcprepct.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcprepct.lo `test -f 'jcprepct.c' || echo '$(srcdir)/'`jcprepct.c\n\nlibturbojpeg_la-jcsample.lo: jcsample.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcsample.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jcsample.Tpo\" -c -o libturbojpeg_la-jcsample.lo `test -f 'jcsample.c' || echo '$(srcdir)/'`jcsample.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jcsample.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jcsample.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jcsample.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jcsample.c' object='libturbojpeg_la-jcsample.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcsample.lo `test -f 'jcsample.c' || echo '$(srcdir)/'`jcsample.c\n\nlibturbojpeg_la-jctrans.lo: jctrans.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jctrans.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jctrans.Tpo\" -c -o libturbojpeg_la-jctrans.lo `test -f 'jctrans.c' || echo '$(srcdir)/'`jctrans.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jctrans.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jctrans.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jctrans.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jctrans.c' object='libturbojpeg_la-jctrans.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jctrans.lo `test -f 'jctrans.c' || echo '$(srcdir)/'`jctrans.c\n\nlibturbojpeg_la-jdapimin.lo: jdapimin.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdapimin.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jdapimin.Tpo\" -c -o libturbojpeg_la-jdapimin.lo `test -f 'jdapimin.c' || echo '$(srcdir)/'`jdapimin.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jdapimin.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jdapimin.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jdapimin.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jdapimin.c' object='libturbojpeg_la-jdapimin.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdapimin.lo `test -f 'jdapimin.c' || echo '$(srcdir)/'`jdapimin.c\n\nlibturbojpeg_la-jdapistd.lo: jdapistd.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdapistd.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jdapistd.Tpo\" -c -o libturbojpeg_la-jdapistd.lo `test -f 'jdapistd.c' || echo '$(srcdir)/'`jdapistd.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jdapistd.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jdapistd.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jdapistd.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jdapistd.c' object='libturbojpeg_la-jdapistd.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdapistd.lo `test -f 'jdapistd.c' || echo '$(srcdir)/'`jdapistd.c\n\nlibturbojpeg_la-jdatadst.lo: jdatadst.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdatadst.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jdatadst.Tpo\" -c -o libturbojpeg_la-jdatadst.lo `test -f 'jdatadst.c' || echo '$(srcdir)/'`jdatadst.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jdatadst.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jdatadst.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jdatadst.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jdatadst.c' object='libturbojpeg_la-jdatadst.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdatadst.lo `test -f 'jdatadst.c' || echo '$(srcdir)/'`jdatadst.c\n\nlibturbojpeg_la-jdatasrc.lo: jdatasrc.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdatasrc.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jdatasrc.Tpo\" -c -o libturbojpeg_la-jdatasrc.lo `test -f 'jdatasrc.c' || echo '$(srcdir)/'`jdatasrc.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jdatasrc.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jdatasrc.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jdatasrc.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jdatasrc.c' object='libturbojpeg_la-jdatasrc.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdatasrc.lo `test -f 'jdatasrc.c' || echo '$(srcdir)/'`jdatasrc.c\n\nlibturbojpeg_la-jdcoefct.lo: jdcoefct.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdcoefct.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jdcoefct.Tpo\" -c -o libturbojpeg_la-jdcoefct.lo `test -f 'jdcoefct.c' || echo '$(srcdir)/'`jdcoefct.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jdcoefct.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jdcoefct.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jdcoefct.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jdcoefct.c' object='libturbojpeg_la-jdcoefct.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdcoefct.lo `test -f 'jdcoefct.c' || echo '$(srcdir)/'`jdcoefct.c\n\nlibturbojpeg_la-jdcolor.lo: jdcolor.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdcolor.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jdcolor.Tpo\" -c -o libturbojpeg_la-jdcolor.lo `test -f 'jdcolor.c' || echo '$(srcdir)/'`jdcolor.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jdcolor.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jdcolor.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jdcolor.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jdcolor.c' object='libturbojpeg_la-jdcolor.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdcolor.lo `test -f 'jdcolor.c' || echo '$(srcdir)/'`jdcolor.c\n\nlibturbojpeg_la-jddctmgr.lo: jddctmgr.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jddctmgr.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jddctmgr.Tpo\" -c -o libturbojpeg_la-jddctmgr.lo `test -f 'jddctmgr.c' || echo '$(srcdir)/'`jddctmgr.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jddctmgr.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jddctmgr.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jddctmgr.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jddctmgr.c' object='libturbojpeg_la-jddctmgr.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jddctmgr.lo `test -f 'jddctmgr.c' || echo '$(srcdir)/'`jddctmgr.c\n\nlibturbojpeg_la-jdhuff.lo: jdhuff.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdhuff.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jdhuff.Tpo\" -c -o libturbojpeg_la-jdhuff.lo `test -f 'jdhuff.c' || echo '$(srcdir)/'`jdhuff.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jdhuff.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jdhuff.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jdhuff.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jdhuff.c' object='libturbojpeg_la-jdhuff.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdhuff.lo `test -f 'jdhuff.c' || echo '$(srcdir)/'`jdhuff.c\n\nlibturbojpeg_la-jdinput.lo: jdinput.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdinput.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jdinput.Tpo\" -c -o libturbojpeg_la-jdinput.lo `test -f 'jdinput.c' || echo '$(srcdir)/'`jdinput.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jdinput.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jdinput.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jdinput.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jdinput.c' object='libturbojpeg_la-jdinput.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdinput.lo `test -f 'jdinput.c' || echo '$(srcdir)/'`jdinput.c\n\nlibturbojpeg_la-jdmainct.lo: jdmainct.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdmainct.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jdmainct.Tpo\" -c -o libturbojpeg_la-jdmainct.lo `test -f 'jdmainct.c' || echo '$(srcdir)/'`jdmainct.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jdmainct.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jdmainct.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jdmainct.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jdmainct.c' object='libturbojpeg_la-jdmainct.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdmainct.lo `test -f 'jdmainct.c' || echo '$(srcdir)/'`jdmainct.c\n\nlibturbojpeg_la-jdmarker.lo: jdmarker.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdmarker.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jdmarker.Tpo\" -c -o libturbojpeg_la-jdmarker.lo `test -f 'jdmarker.c' || echo '$(srcdir)/'`jdmarker.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jdmarker.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jdmarker.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jdmarker.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jdmarker.c' object='libturbojpeg_la-jdmarker.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdmarker.lo `test -f 'jdmarker.c' || echo '$(srcdir)/'`jdmarker.c\n\nlibturbojpeg_la-jdmaster.lo: jdmaster.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdmaster.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jdmaster.Tpo\" -c -o libturbojpeg_la-jdmaster.lo `test -f 'jdmaster.c' || echo '$(srcdir)/'`jdmaster.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jdmaster.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jdmaster.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jdmaster.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jdmaster.c' object='libturbojpeg_la-jdmaster.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdmaster.lo `test -f 'jdmaster.c' || echo '$(srcdir)/'`jdmaster.c\n\nlibturbojpeg_la-jdmerge.lo: jdmerge.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdmerge.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jdmerge.Tpo\" -c -o libturbojpeg_la-jdmerge.lo `test -f 'jdmerge.c' || echo '$(srcdir)/'`jdmerge.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jdmerge.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jdmerge.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jdmerge.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jdmerge.c' object='libturbojpeg_la-jdmerge.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdmerge.lo `test -f 'jdmerge.c' || echo '$(srcdir)/'`jdmerge.c\n\nlibturbojpeg_la-jdphuff.lo: jdphuff.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdphuff.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jdphuff.Tpo\" -c -o libturbojpeg_la-jdphuff.lo `test -f 'jdphuff.c' || echo '$(srcdir)/'`jdphuff.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jdphuff.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jdphuff.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jdphuff.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jdphuff.c' object='libturbojpeg_la-jdphuff.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdphuff.lo `test -f 'jdphuff.c' || echo '$(srcdir)/'`jdphuff.c\n\nlibturbojpeg_la-jdpostct.lo: jdpostct.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdpostct.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jdpostct.Tpo\" -c -o libturbojpeg_la-jdpostct.lo `test -f 'jdpostct.c' || echo '$(srcdir)/'`jdpostct.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jdpostct.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jdpostct.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jdpostct.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jdpostct.c' object='libturbojpeg_la-jdpostct.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdpostct.lo `test -f 'jdpostct.c' || echo '$(srcdir)/'`jdpostct.c\n\nlibturbojpeg_la-jdsample.lo: jdsample.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdsample.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jdsample.Tpo\" -c -o libturbojpeg_la-jdsample.lo `test -f 'jdsample.c' || echo '$(srcdir)/'`jdsample.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jdsample.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jdsample.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jdsample.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jdsample.c' object='libturbojpeg_la-jdsample.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdsample.lo `test -f 'jdsample.c' || echo '$(srcdir)/'`jdsample.c\n\nlibturbojpeg_la-jdtrans.lo: jdtrans.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdtrans.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jdtrans.Tpo\" -c -o libturbojpeg_la-jdtrans.lo `test -f 'jdtrans.c' || echo '$(srcdir)/'`jdtrans.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jdtrans.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jdtrans.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jdtrans.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jdtrans.c' object='libturbojpeg_la-jdtrans.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdtrans.lo `test -f 'jdtrans.c' || echo '$(srcdir)/'`jdtrans.c\n\nlibturbojpeg_la-jerror.lo: jerror.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jerror.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jerror.Tpo\" -c -o libturbojpeg_la-jerror.lo `test -f 'jerror.c' || echo '$(srcdir)/'`jerror.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jerror.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jerror.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jerror.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jerror.c' object='libturbojpeg_la-jerror.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jerror.lo `test -f 'jerror.c' || echo '$(srcdir)/'`jerror.c\n\nlibturbojpeg_la-jfdctflt.lo: jfdctflt.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jfdctflt.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jfdctflt.Tpo\" -c -o libturbojpeg_la-jfdctflt.lo `test -f 'jfdctflt.c' || echo '$(srcdir)/'`jfdctflt.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jfdctflt.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jfdctflt.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jfdctflt.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jfdctflt.c' object='libturbojpeg_la-jfdctflt.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jfdctflt.lo `test -f 'jfdctflt.c' || echo '$(srcdir)/'`jfdctflt.c\n\nlibturbojpeg_la-jfdctfst.lo: jfdctfst.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jfdctfst.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jfdctfst.Tpo\" -c -o libturbojpeg_la-jfdctfst.lo `test -f 'jfdctfst.c' || echo '$(srcdir)/'`jfdctfst.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jfdctfst.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jfdctfst.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jfdctfst.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jfdctfst.c' object='libturbojpeg_la-jfdctfst.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jfdctfst.lo `test -f 'jfdctfst.c' || echo '$(srcdir)/'`jfdctfst.c\n\nlibturbojpeg_la-jfdctint.lo: jfdctint.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jfdctint.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jfdctint.Tpo\" -c -o libturbojpeg_la-jfdctint.lo `test -f 'jfdctint.c' || echo '$(srcdir)/'`jfdctint.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jfdctint.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jfdctint.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jfdctint.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jfdctint.c' object='libturbojpeg_la-jfdctint.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jfdctint.lo `test -f 'jfdctint.c' || echo '$(srcdir)/'`jfdctint.c\n\nlibturbojpeg_la-jidctflt.lo: jidctflt.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jidctflt.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jidctflt.Tpo\" -c -o libturbojpeg_la-jidctflt.lo `test -f 'jidctflt.c' || echo '$(srcdir)/'`jidctflt.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jidctflt.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jidctflt.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jidctflt.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jidctflt.c' object='libturbojpeg_la-jidctflt.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jidctflt.lo `test -f 'jidctflt.c' || echo '$(srcdir)/'`jidctflt.c\n\nlibturbojpeg_la-jidctfst.lo: jidctfst.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jidctfst.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jidctfst.Tpo\" -c -o libturbojpeg_la-jidctfst.lo `test -f 'jidctfst.c' || echo '$(srcdir)/'`jidctfst.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jidctfst.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jidctfst.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jidctfst.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jidctfst.c' object='libturbojpeg_la-jidctfst.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jidctfst.lo `test -f 'jidctfst.c' || echo '$(srcdir)/'`jidctfst.c\n\nlibturbojpeg_la-jidctint.lo: jidctint.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jidctint.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jidctint.Tpo\" -c -o libturbojpeg_la-jidctint.lo `test -f 'jidctint.c' || echo '$(srcdir)/'`jidctint.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jidctint.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jidctint.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jidctint.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jidctint.c' object='libturbojpeg_la-jidctint.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jidctint.lo `test -f 'jidctint.c' || echo '$(srcdir)/'`jidctint.c\n\nlibturbojpeg_la-jidctred.lo: jidctred.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jidctred.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jidctred.Tpo\" -c -o libturbojpeg_la-jidctred.lo `test -f 'jidctred.c' || echo '$(srcdir)/'`jidctred.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jidctred.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jidctred.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jidctred.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jidctred.c' object='libturbojpeg_la-jidctred.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jidctred.lo `test -f 'jidctred.c' || echo '$(srcdir)/'`jidctred.c\n\nlibturbojpeg_la-jquant1.lo: jquant1.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jquant1.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jquant1.Tpo\" -c -o libturbojpeg_la-jquant1.lo `test -f 'jquant1.c' || echo '$(srcdir)/'`jquant1.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jquant1.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jquant1.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jquant1.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jquant1.c' object='libturbojpeg_la-jquant1.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jquant1.lo `test -f 'jquant1.c' || echo '$(srcdir)/'`jquant1.c\n\nlibturbojpeg_la-jquant2.lo: jquant2.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jquant2.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jquant2.Tpo\" -c -o libturbojpeg_la-jquant2.lo `test -f 'jquant2.c' || echo '$(srcdir)/'`jquant2.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jquant2.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jquant2.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jquant2.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jquant2.c' object='libturbojpeg_la-jquant2.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jquant2.lo `test -f 'jquant2.c' || echo '$(srcdir)/'`jquant2.c\n\nlibturbojpeg_la-jutils.lo: jutils.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jutils.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jutils.Tpo\" -c -o libturbojpeg_la-jutils.lo `test -f 'jutils.c' || echo '$(srcdir)/'`jutils.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jutils.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jutils.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jutils.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jutils.c' object='libturbojpeg_la-jutils.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jutils.lo `test -f 'jutils.c' || echo '$(srcdir)/'`jutils.c\n\nlibturbojpeg_la-jmemmgr.lo: jmemmgr.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jmemmgr.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jmemmgr.Tpo\" -c -o libturbojpeg_la-jmemmgr.lo `test -f 'jmemmgr.c' || echo '$(srcdir)/'`jmemmgr.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jmemmgr.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jmemmgr.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jmemmgr.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jmemmgr.c' object='libturbojpeg_la-jmemmgr.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jmemmgr.lo `test -f 'jmemmgr.c' || echo '$(srcdir)/'`jmemmgr.c\n\nlibturbojpeg_la-jmemnobs.lo: jmemnobs.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jmemnobs.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jmemnobs.Tpo\" -c -o libturbojpeg_la-jmemnobs.lo `test -f 'jmemnobs.c' || echo '$(srcdir)/'`jmemnobs.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jmemnobs.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jmemnobs.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jmemnobs.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jmemnobs.c' object='libturbojpeg_la-jmemnobs.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jmemnobs.lo `test -f 'jmemnobs.c' || echo '$(srcdir)/'`jmemnobs.c\n\nlibturbojpeg_la-jaricom.lo: jaricom.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jaricom.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jaricom.Tpo\" -c -o libturbojpeg_la-jaricom.lo `test -f 'jaricom.c' || echo '$(srcdir)/'`jaricom.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jaricom.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jaricom.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jaricom.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jaricom.c' object='libturbojpeg_la-jaricom.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jaricom.lo `test -f 'jaricom.c' || echo '$(srcdir)/'`jaricom.c\n\nlibturbojpeg_la-jcarith.lo: jcarith.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jcarith.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jcarith.Tpo\" -c -o libturbojpeg_la-jcarith.lo `test -f 'jcarith.c' || echo '$(srcdir)/'`jcarith.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jcarith.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jcarith.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jcarith.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jcarith.c' object='libturbojpeg_la-jcarith.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jcarith.lo `test -f 'jcarith.c' || echo '$(srcdir)/'`jcarith.c\n\nlibturbojpeg_la-jdarith.lo: jdarith.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdarith.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jdarith.Tpo\" -c -o libturbojpeg_la-jdarith.lo `test -f 'jdarith.c' || echo '$(srcdir)/'`jdarith.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jdarith.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jdarith.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jdarith.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jdarith.c' object='libturbojpeg_la-jdarith.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdarith.lo `test -f 'jdarith.c' || echo '$(srcdir)/'`jdarith.c\n\nlibturbojpeg_la-jsimd_none.lo: jsimd_none.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jsimd_none.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jsimd_none.Tpo\" -c -o libturbojpeg_la-jsimd_none.lo `test -f 'jsimd_none.c' || echo '$(srcdir)/'`jsimd_none.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jsimd_none.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jsimd_none.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jsimd_none.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jsimd_none.c' object='libturbojpeg_la-jsimd_none.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jsimd_none.lo `test -f 'jsimd_none.c' || echo '$(srcdir)/'`jsimd_none.c\n\nlibturbojpeg_la-turbojpeg.lo: turbojpeg.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-turbojpeg.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-turbojpeg.Tpo\" -c -o libturbojpeg_la-turbojpeg.lo `test -f 'turbojpeg.c' || echo '$(srcdir)/'`turbojpeg.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-turbojpeg.Tpo\" \"$(DEPDIR)/libturbojpeg_la-turbojpeg.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-turbojpeg.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='turbojpeg.c' object='libturbojpeg_la-turbojpeg.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-turbojpeg.lo `test -f 'turbojpeg.c' || echo '$(srcdir)/'`turbojpeg.c\n\nlibturbojpeg_la-transupp.lo: transupp.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-transupp.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-transupp.Tpo\" -c -o libturbojpeg_la-transupp.lo `test -f 'transupp.c' || echo '$(srcdir)/'`transupp.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-transupp.Tpo\" \"$(DEPDIR)/libturbojpeg_la-transupp.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-transupp.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='transupp.c' object='libturbojpeg_la-transupp.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-transupp.lo `test -f 'transupp.c' || echo '$(srcdir)/'`transupp.c\n\nlibturbojpeg_la-jdatadst-tj.lo: jdatadst-tj.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdatadst-tj.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jdatadst-tj.Tpo\" -c -o libturbojpeg_la-jdatadst-tj.lo `test -f 'jdatadst-tj.c' || echo '$(srcdir)/'`jdatadst-tj.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jdatadst-tj.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jdatadst-tj.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jdatadst-tj.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jdatadst-tj.c' object='libturbojpeg_la-jdatadst-tj.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdatadst-tj.lo `test -f 'jdatadst-tj.c' || echo '$(srcdir)/'`jdatadst-tj.c\n\nlibturbojpeg_la-jdatasrc-tj.lo: jdatasrc-tj.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-jdatasrc-tj.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-jdatasrc-tj.Tpo\" -c -o libturbojpeg_la-jdatasrc-tj.lo `test -f 'jdatasrc-tj.c' || echo '$(srcdir)/'`jdatasrc-tj.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-jdatasrc-tj.Tpo\" \"$(DEPDIR)/libturbojpeg_la-jdatasrc-tj.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-jdatasrc-tj.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='jdatasrc-tj.c' object='libturbojpeg_la-jdatasrc-tj.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-jdatasrc-tj.lo `test -f 'jdatasrc-tj.c' || echo '$(srcdir)/'`jdatasrc-tj.c\n\nlibturbojpeg_la-turbojpeg-jni.lo: turbojpeg-jni.c\n@am__fastdepCC_TRUE@\tif $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -MT libturbojpeg_la-turbojpeg-jni.lo -MD -MP -MF \"$(DEPDIR)/libturbojpeg_la-turbojpeg-jni.Tpo\" -c -o libturbojpeg_la-turbojpeg-jni.lo `test -f 'turbojpeg-jni.c' || echo '$(srcdir)/'`turbojpeg-jni.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/libturbojpeg_la-turbojpeg-jni.Tpo\" \"$(DEPDIR)/libturbojpeg_la-turbojpeg-jni.Plo\"; else rm -f \"$(DEPDIR)/libturbojpeg_la-turbojpeg-jni.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='turbojpeg-jni.c' object='libturbojpeg_la-turbojpeg-jni.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libturbojpeg_la_CFLAGS) $(CFLAGS) -c -o libturbojpeg_la-turbojpeg-jni.lo `test -f 'turbojpeg-jni.c' || echo '$(srcdir)/'`turbojpeg-jni.c\n\ncjpeg-cdjpeg.o: cdjpeg.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-cdjpeg.o -MD -MP -MF \"$(DEPDIR)/cjpeg-cdjpeg.Tpo\" -c -o cjpeg-cdjpeg.o `test -f 'cdjpeg.c' || echo '$(srcdir)/'`cdjpeg.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/cjpeg-cdjpeg.Tpo\" \"$(DEPDIR)/cjpeg-cdjpeg.Po\"; else rm -f \"$(DEPDIR)/cjpeg-cdjpeg.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='cdjpeg.c' object='cjpeg-cdjpeg.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-cdjpeg.o `test -f 'cdjpeg.c' || echo '$(srcdir)/'`cdjpeg.c\n\ncjpeg-cdjpeg.obj: cdjpeg.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-cdjpeg.obj -MD -MP -MF \"$(DEPDIR)/cjpeg-cdjpeg.Tpo\" -c -o cjpeg-cdjpeg.obj `if test -f 'cdjpeg.c'; then $(CYGPATH_W) 'cdjpeg.c'; else $(CYGPATH_W) '$(srcdir)/cdjpeg.c'; fi`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/cjpeg-cdjpeg.Tpo\" \"$(DEPDIR)/cjpeg-cdjpeg.Po\"; else rm -f \"$(DEPDIR)/cjpeg-cdjpeg.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='cdjpeg.c' object='cjpeg-cdjpeg.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-cdjpeg.obj `if test -f 'cdjpeg.c'; then $(CYGPATH_W) 'cdjpeg.c'; else $(CYGPATH_W) '$(srcdir)/cdjpeg.c'; fi`\n\ncjpeg-cjpeg.o: cjpeg.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-cjpeg.o -MD -MP -MF \"$(DEPDIR)/cjpeg-cjpeg.Tpo\" -c -o cjpeg-cjpeg.o `test -f 'cjpeg.c' || echo '$(srcdir)/'`cjpeg.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/cjpeg-cjpeg.Tpo\" \"$(DEPDIR)/cjpeg-cjpeg.Po\"; else rm -f \"$(DEPDIR)/cjpeg-cjpeg.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='cjpeg.c' object='cjpeg-cjpeg.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-cjpeg.o `test -f 'cjpeg.c' || echo '$(srcdir)/'`cjpeg.c\n\ncjpeg-cjpeg.obj: cjpeg.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-cjpeg.obj -MD -MP -MF \"$(DEPDIR)/cjpeg-cjpeg.Tpo\" -c -o cjpeg-cjpeg.obj `if test -f 'cjpeg.c'; then $(CYGPATH_W) 'cjpeg.c'; else $(CYGPATH_W) '$(srcdir)/cjpeg.c'; fi`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/cjpeg-cjpeg.Tpo\" \"$(DEPDIR)/cjpeg-cjpeg.Po\"; else rm -f \"$(DEPDIR)/cjpeg-cjpeg.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='cjpeg.c' object='cjpeg-cjpeg.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-cjpeg.obj `if test -f 'cjpeg.c'; then $(CYGPATH_W) 'cjpeg.c'; else $(CYGPATH_W) '$(srcdir)/cjpeg.c'; fi`\n\ncjpeg-rdbmp.o: rdbmp.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-rdbmp.o -MD -MP -MF \"$(DEPDIR)/cjpeg-rdbmp.Tpo\" -c -o cjpeg-rdbmp.o `test -f 'rdbmp.c' || echo '$(srcdir)/'`rdbmp.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/cjpeg-rdbmp.Tpo\" \"$(DEPDIR)/cjpeg-rdbmp.Po\"; else rm -f \"$(DEPDIR)/cjpeg-rdbmp.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='rdbmp.c' object='cjpeg-rdbmp.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-rdbmp.o `test -f 'rdbmp.c' || echo '$(srcdir)/'`rdbmp.c\n\ncjpeg-rdbmp.obj: rdbmp.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-rdbmp.obj -MD -MP -MF \"$(DEPDIR)/cjpeg-rdbmp.Tpo\" -c -o cjpeg-rdbmp.obj `if test -f 'rdbmp.c'; then $(CYGPATH_W) 'rdbmp.c'; else $(CYGPATH_W) '$(srcdir)/rdbmp.c'; fi`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/cjpeg-rdbmp.Tpo\" \"$(DEPDIR)/cjpeg-rdbmp.Po\"; else rm -f \"$(DEPDIR)/cjpeg-rdbmp.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='rdbmp.c' object='cjpeg-rdbmp.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-rdbmp.obj `if test -f 'rdbmp.c'; then $(CYGPATH_W) 'rdbmp.c'; else $(CYGPATH_W) '$(srcdir)/rdbmp.c'; fi`\n\ncjpeg-rdgif.o: rdgif.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-rdgif.o -MD -MP -MF \"$(DEPDIR)/cjpeg-rdgif.Tpo\" -c -o cjpeg-rdgif.o `test -f 'rdgif.c' || echo '$(srcdir)/'`rdgif.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/cjpeg-rdgif.Tpo\" \"$(DEPDIR)/cjpeg-rdgif.Po\"; else rm -f \"$(DEPDIR)/cjpeg-rdgif.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='rdgif.c' object='cjpeg-rdgif.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-rdgif.o `test -f 'rdgif.c' || echo '$(srcdir)/'`rdgif.c\n\ncjpeg-rdgif.obj: rdgif.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-rdgif.obj -MD -MP -MF \"$(DEPDIR)/cjpeg-rdgif.Tpo\" -c -o cjpeg-rdgif.obj `if test -f 'rdgif.c'; then $(CYGPATH_W) 'rdgif.c'; else $(CYGPATH_W) '$(srcdir)/rdgif.c'; fi`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/cjpeg-rdgif.Tpo\" \"$(DEPDIR)/cjpeg-rdgif.Po\"; else rm -f \"$(DEPDIR)/cjpeg-rdgif.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='rdgif.c' object='cjpeg-rdgif.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-rdgif.obj `if test -f 'rdgif.c'; then $(CYGPATH_W) 'rdgif.c'; else $(CYGPATH_W) '$(srcdir)/rdgif.c'; fi`\n\ncjpeg-rdppm.o: rdppm.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-rdppm.o -MD -MP -MF \"$(DEPDIR)/cjpeg-rdppm.Tpo\" -c -o cjpeg-rdppm.o `test -f 'rdppm.c' || echo '$(srcdir)/'`rdppm.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/cjpeg-rdppm.Tpo\" \"$(DEPDIR)/cjpeg-rdppm.Po\"; else rm -f \"$(DEPDIR)/cjpeg-rdppm.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='rdppm.c' object='cjpeg-rdppm.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-rdppm.o `test -f 'rdppm.c' || echo '$(srcdir)/'`rdppm.c\n\ncjpeg-rdppm.obj: rdppm.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-rdppm.obj -MD -MP -MF \"$(DEPDIR)/cjpeg-rdppm.Tpo\" -c -o cjpeg-rdppm.obj `if test -f 'rdppm.c'; then $(CYGPATH_W) 'rdppm.c'; else $(CYGPATH_W) '$(srcdir)/rdppm.c'; fi`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/cjpeg-rdppm.Tpo\" \"$(DEPDIR)/cjpeg-rdppm.Po\"; else rm -f \"$(DEPDIR)/cjpeg-rdppm.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='rdppm.c' object='cjpeg-rdppm.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-rdppm.obj `if test -f 'rdppm.c'; then $(CYGPATH_W) 'rdppm.c'; else $(CYGPATH_W) '$(srcdir)/rdppm.c'; fi`\n\ncjpeg-rdswitch.o: rdswitch.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-rdswitch.o -MD -MP -MF \"$(DEPDIR)/cjpeg-rdswitch.Tpo\" -c -o cjpeg-rdswitch.o `test -f 'rdswitch.c' || echo '$(srcdir)/'`rdswitch.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/cjpeg-rdswitch.Tpo\" \"$(DEPDIR)/cjpeg-rdswitch.Po\"; else rm -f \"$(DEPDIR)/cjpeg-rdswitch.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='rdswitch.c' object='cjpeg-rdswitch.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-rdswitch.o `test -f 'rdswitch.c' || echo '$(srcdir)/'`rdswitch.c\n\ncjpeg-rdswitch.obj: rdswitch.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-rdswitch.obj -MD -MP -MF \"$(DEPDIR)/cjpeg-rdswitch.Tpo\" -c -o cjpeg-rdswitch.obj `if test -f 'rdswitch.c'; then $(CYGPATH_W) 'rdswitch.c'; else $(CYGPATH_W) '$(srcdir)/rdswitch.c'; fi`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/cjpeg-rdswitch.Tpo\" \"$(DEPDIR)/cjpeg-rdswitch.Po\"; else rm -f \"$(DEPDIR)/cjpeg-rdswitch.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='rdswitch.c' object='cjpeg-rdswitch.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-rdswitch.obj `if test -f 'rdswitch.c'; then $(CYGPATH_W) 'rdswitch.c'; else $(CYGPATH_W) '$(srcdir)/rdswitch.c'; fi`\n\ncjpeg-rdtarga.o: rdtarga.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-rdtarga.o -MD -MP -MF \"$(DEPDIR)/cjpeg-rdtarga.Tpo\" -c -o cjpeg-rdtarga.o `test -f 'rdtarga.c' || echo '$(srcdir)/'`rdtarga.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/cjpeg-rdtarga.Tpo\" \"$(DEPDIR)/cjpeg-rdtarga.Po\"; else rm -f \"$(DEPDIR)/cjpeg-rdtarga.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='rdtarga.c' object='cjpeg-rdtarga.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-rdtarga.o `test -f 'rdtarga.c' || echo '$(srcdir)/'`rdtarga.c\n\ncjpeg-rdtarga.obj: rdtarga.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -MT cjpeg-rdtarga.obj -MD -MP -MF \"$(DEPDIR)/cjpeg-rdtarga.Tpo\" -c -o cjpeg-rdtarga.obj `if test -f 'rdtarga.c'; then $(CYGPATH_W) 'rdtarga.c'; else $(CYGPATH_W) '$(srcdir)/rdtarga.c'; fi`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/cjpeg-rdtarga.Tpo\" \"$(DEPDIR)/cjpeg-rdtarga.Po\"; else rm -f \"$(DEPDIR)/cjpeg-rdtarga.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='rdtarga.c' object='cjpeg-rdtarga.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cjpeg_CFLAGS) $(CFLAGS) -c -o cjpeg-rdtarga.obj `if test -f 'rdtarga.c'; then $(CYGPATH_W) 'rdtarga.c'; else $(CYGPATH_W) '$(srcdir)/rdtarga.c'; fi`\n\ndjpeg-cdjpeg.o: cdjpeg.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-cdjpeg.o -MD -MP -MF \"$(DEPDIR)/djpeg-cdjpeg.Tpo\" -c -o djpeg-cdjpeg.o `test -f 'cdjpeg.c' || echo '$(srcdir)/'`cdjpeg.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/djpeg-cdjpeg.Tpo\" \"$(DEPDIR)/djpeg-cdjpeg.Po\"; else rm -f \"$(DEPDIR)/djpeg-cdjpeg.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='cdjpeg.c' object='djpeg-cdjpeg.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-cdjpeg.o `test -f 'cdjpeg.c' || echo '$(srcdir)/'`cdjpeg.c\n\ndjpeg-cdjpeg.obj: cdjpeg.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-cdjpeg.obj -MD -MP -MF \"$(DEPDIR)/djpeg-cdjpeg.Tpo\" -c -o djpeg-cdjpeg.obj `if test -f 'cdjpeg.c'; then $(CYGPATH_W) 'cdjpeg.c'; else $(CYGPATH_W) '$(srcdir)/cdjpeg.c'; fi`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/djpeg-cdjpeg.Tpo\" \"$(DEPDIR)/djpeg-cdjpeg.Po\"; else rm -f \"$(DEPDIR)/djpeg-cdjpeg.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='cdjpeg.c' object='djpeg-cdjpeg.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-cdjpeg.obj `if test -f 'cdjpeg.c'; then $(CYGPATH_W) 'cdjpeg.c'; else $(CYGPATH_W) '$(srcdir)/cdjpeg.c'; fi`\n\ndjpeg-djpeg.o: djpeg.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-djpeg.o -MD -MP -MF \"$(DEPDIR)/djpeg-djpeg.Tpo\" -c -o djpeg-djpeg.o `test -f 'djpeg.c' || echo '$(srcdir)/'`djpeg.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/djpeg-djpeg.Tpo\" \"$(DEPDIR)/djpeg-djpeg.Po\"; else rm -f \"$(DEPDIR)/djpeg-djpeg.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='djpeg.c' object='djpeg-djpeg.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-djpeg.o `test -f 'djpeg.c' || echo '$(srcdir)/'`djpeg.c\n\ndjpeg-djpeg.obj: djpeg.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-djpeg.obj -MD -MP -MF \"$(DEPDIR)/djpeg-djpeg.Tpo\" -c -o djpeg-djpeg.obj `if test -f 'djpeg.c'; then $(CYGPATH_W) 'djpeg.c'; else $(CYGPATH_W) '$(srcdir)/djpeg.c'; fi`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/djpeg-djpeg.Tpo\" \"$(DEPDIR)/djpeg-djpeg.Po\"; else rm -f \"$(DEPDIR)/djpeg-djpeg.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='djpeg.c' object='djpeg-djpeg.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-djpeg.obj `if test -f 'djpeg.c'; then $(CYGPATH_W) 'djpeg.c'; else $(CYGPATH_W) '$(srcdir)/djpeg.c'; fi`\n\ndjpeg-rdcolmap.o: rdcolmap.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-rdcolmap.o -MD -MP -MF \"$(DEPDIR)/djpeg-rdcolmap.Tpo\" -c -o djpeg-rdcolmap.o `test -f 'rdcolmap.c' || echo '$(srcdir)/'`rdcolmap.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/djpeg-rdcolmap.Tpo\" \"$(DEPDIR)/djpeg-rdcolmap.Po\"; else rm -f \"$(DEPDIR)/djpeg-rdcolmap.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='rdcolmap.c' object='djpeg-rdcolmap.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-rdcolmap.o `test -f 'rdcolmap.c' || echo '$(srcdir)/'`rdcolmap.c\n\ndjpeg-rdcolmap.obj: rdcolmap.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-rdcolmap.obj -MD -MP -MF \"$(DEPDIR)/djpeg-rdcolmap.Tpo\" -c -o djpeg-rdcolmap.obj `if test -f 'rdcolmap.c'; then $(CYGPATH_W) 'rdcolmap.c'; else $(CYGPATH_W) '$(srcdir)/rdcolmap.c'; fi`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/djpeg-rdcolmap.Tpo\" \"$(DEPDIR)/djpeg-rdcolmap.Po\"; else rm -f \"$(DEPDIR)/djpeg-rdcolmap.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='rdcolmap.c' object='djpeg-rdcolmap.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-rdcolmap.obj `if test -f 'rdcolmap.c'; then $(CYGPATH_W) 'rdcolmap.c'; else $(CYGPATH_W) '$(srcdir)/rdcolmap.c'; fi`\n\ndjpeg-rdswitch.o: rdswitch.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-rdswitch.o -MD -MP -MF \"$(DEPDIR)/djpeg-rdswitch.Tpo\" -c -o djpeg-rdswitch.o `test -f 'rdswitch.c' || echo '$(srcdir)/'`rdswitch.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/djpeg-rdswitch.Tpo\" \"$(DEPDIR)/djpeg-rdswitch.Po\"; else rm -f \"$(DEPDIR)/djpeg-rdswitch.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='rdswitch.c' object='djpeg-rdswitch.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-rdswitch.o `test -f 'rdswitch.c' || echo '$(srcdir)/'`rdswitch.c\n\ndjpeg-rdswitch.obj: rdswitch.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-rdswitch.obj -MD -MP -MF \"$(DEPDIR)/djpeg-rdswitch.Tpo\" -c -o djpeg-rdswitch.obj `if test -f 'rdswitch.c'; then $(CYGPATH_W) 'rdswitch.c'; else $(CYGPATH_W) '$(srcdir)/rdswitch.c'; fi`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/djpeg-rdswitch.Tpo\" \"$(DEPDIR)/djpeg-rdswitch.Po\"; else rm -f \"$(DEPDIR)/djpeg-rdswitch.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='rdswitch.c' object='djpeg-rdswitch.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-rdswitch.obj `if test -f 'rdswitch.c'; then $(CYGPATH_W) 'rdswitch.c'; else $(CYGPATH_W) '$(srcdir)/rdswitch.c'; fi`\n\ndjpeg-wrbmp.o: wrbmp.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-wrbmp.o -MD -MP -MF \"$(DEPDIR)/djpeg-wrbmp.Tpo\" -c -o djpeg-wrbmp.o `test -f 'wrbmp.c' || echo '$(srcdir)/'`wrbmp.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/djpeg-wrbmp.Tpo\" \"$(DEPDIR)/djpeg-wrbmp.Po\"; else rm -f \"$(DEPDIR)/djpeg-wrbmp.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='wrbmp.c' object='djpeg-wrbmp.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-wrbmp.o `test -f 'wrbmp.c' || echo '$(srcdir)/'`wrbmp.c\n\ndjpeg-wrbmp.obj: wrbmp.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-wrbmp.obj -MD -MP -MF \"$(DEPDIR)/djpeg-wrbmp.Tpo\" -c -o djpeg-wrbmp.obj `if test -f 'wrbmp.c'; then $(CYGPATH_W) 'wrbmp.c'; else $(CYGPATH_W) '$(srcdir)/wrbmp.c'; fi`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/djpeg-wrbmp.Tpo\" \"$(DEPDIR)/djpeg-wrbmp.Po\"; else rm -f \"$(DEPDIR)/djpeg-wrbmp.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='wrbmp.c' object='djpeg-wrbmp.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-wrbmp.obj `if test -f 'wrbmp.c'; then $(CYGPATH_W) 'wrbmp.c'; else $(CYGPATH_W) '$(srcdir)/wrbmp.c'; fi`\n\ndjpeg-wrgif.o: wrgif.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-wrgif.o -MD -MP -MF \"$(DEPDIR)/djpeg-wrgif.Tpo\" -c -o djpeg-wrgif.o `test -f 'wrgif.c' || echo '$(srcdir)/'`wrgif.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/djpeg-wrgif.Tpo\" \"$(DEPDIR)/djpeg-wrgif.Po\"; else rm -f \"$(DEPDIR)/djpeg-wrgif.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='wrgif.c' object='djpeg-wrgif.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-wrgif.o `test -f 'wrgif.c' || echo '$(srcdir)/'`wrgif.c\n\ndjpeg-wrgif.obj: wrgif.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-wrgif.obj -MD -MP -MF \"$(DEPDIR)/djpeg-wrgif.Tpo\" -c -o djpeg-wrgif.obj `if test -f 'wrgif.c'; then $(CYGPATH_W) 'wrgif.c'; else $(CYGPATH_W) '$(srcdir)/wrgif.c'; fi`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/djpeg-wrgif.Tpo\" \"$(DEPDIR)/djpeg-wrgif.Po\"; else rm -f \"$(DEPDIR)/djpeg-wrgif.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='wrgif.c' object='djpeg-wrgif.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-wrgif.obj `if test -f 'wrgif.c'; then $(CYGPATH_W) 'wrgif.c'; else $(CYGPATH_W) '$(srcdir)/wrgif.c'; fi`\n\ndjpeg-wrppm.o: wrppm.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-wrppm.o -MD -MP -MF \"$(DEPDIR)/djpeg-wrppm.Tpo\" -c -o djpeg-wrppm.o `test -f 'wrppm.c' || echo '$(srcdir)/'`wrppm.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/djpeg-wrppm.Tpo\" \"$(DEPDIR)/djpeg-wrppm.Po\"; else rm -f \"$(DEPDIR)/djpeg-wrppm.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='wrppm.c' object='djpeg-wrppm.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-wrppm.o `test -f 'wrppm.c' || echo '$(srcdir)/'`wrppm.c\n\ndjpeg-wrppm.obj: wrppm.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-wrppm.obj -MD -MP -MF \"$(DEPDIR)/djpeg-wrppm.Tpo\" -c -o djpeg-wrppm.obj `if test -f 'wrppm.c'; then $(CYGPATH_W) 'wrppm.c'; else $(CYGPATH_W) '$(srcdir)/wrppm.c'; fi`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/djpeg-wrppm.Tpo\" \"$(DEPDIR)/djpeg-wrppm.Po\"; else rm -f \"$(DEPDIR)/djpeg-wrppm.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='wrppm.c' object='djpeg-wrppm.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-wrppm.obj `if test -f 'wrppm.c'; then $(CYGPATH_W) 'wrppm.c'; else $(CYGPATH_W) '$(srcdir)/wrppm.c'; fi`\n\ndjpeg-wrtarga.o: wrtarga.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-wrtarga.o -MD -MP -MF \"$(DEPDIR)/djpeg-wrtarga.Tpo\" -c -o djpeg-wrtarga.o `test -f 'wrtarga.c' || echo '$(srcdir)/'`wrtarga.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/djpeg-wrtarga.Tpo\" \"$(DEPDIR)/djpeg-wrtarga.Po\"; else rm -f \"$(DEPDIR)/djpeg-wrtarga.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='wrtarga.c' object='djpeg-wrtarga.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-wrtarga.o `test -f 'wrtarga.c' || echo '$(srcdir)/'`wrtarga.c\n\ndjpeg-wrtarga.obj: wrtarga.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -MT djpeg-wrtarga.obj -MD -MP -MF \"$(DEPDIR)/djpeg-wrtarga.Tpo\" -c -o djpeg-wrtarga.obj `if test -f 'wrtarga.c'; then $(CYGPATH_W) 'wrtarga.c'; else $(CYGPATH_W) '$(srcdir)/wrtarga.c'; fi`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/djpeg-wrtarga.Tpo\" \"$(DEPDIR)/djpeg-wrtarga.Po\"; else rm -f \"$(DEPDIR)/djpeg-wrtarga.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='wrtarga.c' object='djpeg-wrtarga.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(djpeg_CFLAGS) $(CFLAGS) -c -o djpeg-wrtarga.obj `if test -f 'wrtarga.c'; then $(CYGPATH_W) 'wrtarga.c'; else $(CYGPATH_W) '$(srcdir)/wrtarga.c'; fi`\n\ntjbench-tjbench.o: tjbench.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-tjbench.o -MD -MP -MF \"$(DEPDIR)/tjbench-tjbench.Tpo\" -c -o tjbench-tjbench.o `test -f 'tjbench.c' || echo '$(srcdir)/'`tjbench.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/tjbench-tjbench.Tpo\" \"$(DEPDIR)/tjbench-tjbench.Po\"; else rm -f \"$(DEPDIR)/tjbench-tjbench.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='tjbench.c' object='tjbench-tjbench.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-tjbench.o `test -f 'tjbench.c' || echo '$(srcdir)/'`tjbench.c\n\ntjbench-tjbench.obj: tjbench.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-tjbench.obj -MD -MP -MF \"$(DEPDIR)/tjbench-tjbench.Tpo\" -c -o tjbench-tjbench.obj `if test -f 'tjbench.c'; then $(CYGPATH_W) 'tjbench.c'; else $(CYGPATH_W) '$(srcdir)/tjbench.c'; fi`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/tjbench-tjbench.Tpo\" \"$(DEPDIR)/tjbench-tjbench.Po\"; else rm -f \"$(DEPDIR)/tjbench-tjbench.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='tjbench.c' object='tjbench-tjbench.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-tjbench.obj `if test -f 'tjbench.c'; then $(CYGPATH_W) 'tjbench.c'; else $(CYGPATH_W) '$(srcdir)/tjbench.c'; fi`\n\ntjbench-bmp.o: bmp.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-bmp.o -MD -MP -MF \"$(DEPDIR)/tjbench-bmp.Tpo\" -c -o tjbench-bmp.o `test -f 'bmp.c' || echo '$(srcdir)/'`bmp.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/tjbench-bmp.Tpo\" \"$(DEPDIR)/tjbench-bmp.Po\"; else rm -f \"$(DEPDIR)/tjbench-bmp.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='bmp.c' object='tjbench-bmp.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-bmp.o `test -f 'bmp.c' || echo '$(srcdir)/'`bmp.c\n\ntjbench-bmp.obj: bmp.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-bmp.obj -MD -MP -MF \"$(DEPDIR)/tjbench-bmp.Tpo\" -c -o tjbench-bmp.obj `if test -f 'bmp.c'; then $(CYGPATH_W) 'bmp.c'; else $(CYGPATH_W) '$(srcdir)/bmp.c'; fi`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/tjbench-bmp.Tpo\" \"$(DEPDIR)/tjbench-bmp.Po\"; else rm -f \"$(DEPDIR)/tjbench-bmp.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='bmp.c' object='tjbench-bmp.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-bmp.obj `if test -f 'bmp.c'; then $(CYGPATH_W) 'bmp.c'; else $(CYGPATH_W) '$(srcdir)/bmp.c'; fi`\n\ntjbench-tjutil.o: tjutil.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-tjutil.o -MD -MP -MF \"$(DEPDIR)/tjbench-tjutil.Tpo\" -c -o tjbench-tjutil.o `test -f 'tjutil.c' || echo '$(srcdir)/'`tjutil.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/tjbench-tjutil.Tpo\" \"$(DEPDIR)/tjbench-tjutil.Po\"; else rm -f \"$(DEPDIR)/tjbench-tjutil.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='tjutil.c' object='tjbench-tjutil.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-tjutil.o `test -f 'tjutil.c' || echo '$(srcdir)/'`tjutil.c\n\ntjbench-tjutil.obj: tjutil.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-tjutil.obj -MD -MP -MF \"$(DEPDIR)/tjbench-tjutil.Tpo\" -c -o tjbench-tjutil.obj `if test -f 'tjutil.c'; then $(CYGPATH_W) 'tjutil.c'; else $(CYGPATH_W) '$(srcdir)/tjutil.c'; fi`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/tjbench-tjutil.Tpo\" \"$(DEPDIR)/tjbench-tjutil.Po\"; else rm -f \"$(DEPDIR)/tjbench-tjutil.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='tjutil.c' object='tjbench-tjutil.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-tjutil.obj `if test -f 'tjutil.c'; then $(CYGPATH_W) 'tjutil.c'; else $(CYGPATH_W) '$(srcdir)/tjutil.c'; fi`\n\ntjbench-rdbmp.o: rdbmp.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-rdbmp.o -MD -MP -MF \"$(DEPDIR)/tjbench-rdbmp.Tpo\" -c -o tjbench-rdbmp.o `test -f 'rdbmp.c' || echo '$(srcdir)/'`rdbmp.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/tjbench-rdbmp.Tpo\" \"$(DEPDIR)/tjbench-rdbmp.Po\"; else rm -f \"$(DEPDIR)/tjbench-rdbmp.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='rdbmp.c' object='tjbench-rdbmp.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-rdbmp.o `test -f 'rdbmp.c' || echo '$(srcdir)/'`rdbmp.c\n\ntjbench-rdbmp.obj: rdbmp.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-rdbmp.obj -MD -MP -MF \"$(DEPDIR)/tjbench-rdbmp.Tpo\" -c -o tjbench-rdbmp.obj `if test -f 'rdbmp.c'; then $(CYGPATH_W) 'rdbmp.c'; else $(CYGPATH_W) '$(srcdir)/rdbmp.c'; fi`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/tjbench-rdbmp.Tpo\" \"$(DEPDIR)/tjbench-rdbmp.Po\"; else rm -f \"$(DEPDIR)/tjbench-rdbmp.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='rdbmp.c' object='tjbench-rdbmp.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-rdbmp.obj `if test -f 'rdbmp.c'; then $(CYGPATH_W) 'rdbmp.c'; else $(CYGPATH_W) '$(srcdir)/rdbmp.c'; fi`\n\ntjbench-rdppm.o: rdppm.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-rdppm.o -MD -MP -MF \"$(DEPDIR)/tjbench-rdppm.Tpo\" -c -o tjbench-rdppm.o `test -f 'rdppm.c' || echo '$(srcdir)/'`rdppm.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/tjbench-rdppm.Tpo\" \"$(DEPDIR)/tjbench-rdppm.Po\"; else rm -f \"$(DEPDIR)/tjbench-rdppm.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='rdppm.c' object='tjbench-rdppm.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-rdppm.o `test -f 'rdppm.c' || echo '$(srcdir)/'`rdppm.c\n\ntjbench-rdppm.obj: rdppm.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-rdppm.obj -MD -MP -MF \"$(DEPDIR)/tjbench-rdppm.Tpo\" -c -o tjbench-rdppm.obj `if test -f 'rdppm.c'; then $(CYGPATH_W) 'rdppm.c'; else $(CYGPATH_W) '$(srcdir)/rdppm.c'; fi`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/tjbench-rdppm.Tpo\" \"$(DEPDIR)/tjbench-rdppm.Po\"; else rm -f \"$(DEPDIR)/tjbench-rdppm.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='rdppm.c' object='tjbench-rdppm.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-rdppm.obj `if test -f 'rdppm.c'; then $(CYGPATH_W) 'rdppm.c'; else $(CYGPATH_W) '$(srcdir)/rdppm.c'; fi`\n\ntjbench-wrbmp.o: wrbmp.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-wrbmp.o -MD -MP -MF \"$(DEPDIR)/tjbench-wrbmp.Tpo\" -c -o tjbench-wrbmp.o `test -f 'wrbmp.c' || echo '$(srcdir)/'`wrbmp.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/tjbench-wrbmp.Tpo\" \"$(DEPDIR)/tjbench-wrbmp.Po\"; else rm -f \"$(DEPDIR)/tjbench-wrbmp.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='wrbmp.c' object='tjbench-wrbmp.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-wrbmp.o `test -f 'wrbmp.c' || echo '$(srcdir)/'`wrbmp.c\n\ntjbench-wrbmp.obj: wrbmp.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-wrbmp.obj -MD -MP -MF \"$(DEPDIR)/tjbench-wrbmp.Tpo\" -c -o tjbench-wrbmp.obj `if test -f 'wrbmp.c'; then $(CYGPATH_W) 'wrbmp.c'; else $(CYGPATH_W) '$(srcdir)/wrbmp.c'; fi`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/tjbench-wrbmp.Tpo\" \"$(DEPDIR)/tjbench-wrbmp.Po\"; else rm -f \"$(DEPDIR)/tjbench-wrbmp.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='wrbmp.c' object='tjbench-wrbmp.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-wrbmp.obj `if test -f 'wrbmp.c'; then $(CYGPATH_W) 'wrbmp.c'; else $(CYGPATH_W) '$(srcdir)/wrbmp.c'; fi`\n\ntjbench-wrppm.o: wrppm.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-wrppm.o -MD -MP -MF \"$(DEPDIR)/tjbench-wrppm.Tpo\" -c -o tjbench-wrppm.o `test -f 'wrppm.c' || echo '$(srcdir)/'`wrppm.c; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/tjbench-wrppm.Tpo\" \"$(DEPDIR)/tjbench-wrppm.Po\"; else rm -f \"$(DEPDIR)/tjbench-wrppm.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='wrppm.c' object='tjbench-wrppm.o' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-wrppm.o `test -f 'wrppm.c' || echo '$(srcdir)/'`wrppm.c\n\ntjbench-wrppm.obj: wrppm.c\n@am__fastdepCC_TRUE@\tif $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -MT tjbench-wrppm.obj -MD -MP -MF \"$(DEPDIR)/tjbench-wrppm.Tpo\" -c -o tjbench-wrppm.obj `if test -f 'wrppm.c'; then $(CYGPATH_W) 'wrppm.c'; else $(CYGPATH_W) '$(srcdir)/wrppm.c'; fi`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/tjbench-wrppm.Tpo\" \"$(DEPDIR)/tjbench-wrppm.Po\"; else rm -f \"$(DEPDIR)/tjbench-wrppm.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='wrppm.c' object='tjbench-wrppm.obj' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tjbench_CFLAGS) $(CFLAGS) -c -o tjbench-wrppm.obj `if test -f 'wrppm.c'; then $(CYGPATH_W) 'wrppm.c'; else $(CYGPATH_W) '$(srcdir)/wrppm.c'; fi`\n\nmostlyclean-libtool:\n\t-rm -f *.lo\n\nclean-libtool:\n\t-rm -rf .libs _libs\n\ndistclean-libtool:\n\t-rm -f libtool\nuninstall-info-am:\ninstall-man1: $(man1_MANS) $(man_MANS)\n\t@$(NORMAL_INSTALL)\n\ttest -z \"$(man1dir)\" || $(mkdir_p) \"$(DESTDIR)$(man1dir)\"\n\t@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \\\n\tl2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \\\n\tfor i in $$l2; do \\\n\t  case \"$$i\" in \\\n\t    *.1*) list=\"$$list $$i\" ;; \\\n\t  esac; \\\n\tdone; \\\n\tfor i in $$list; do \\\n\t  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \\\n\t  else file=$$i; fi; \\\n\t  ext=`echo $$i | sed -e 's/^.*\\\\.//'`; \\\n\t  case \"$$ext\" in \\\n\t    1*) ;; \\\n\t    *) ext='1' ;; \\\n\t  esac; \\\n\t  inst=`echo $$i | sed -e 's/\\\\.[0-9a-z]*$$//'`; \\\n\t  inst=`echo $$inst | sed -e 's/^.*\\///'`; \\\n\t  inst=`echo $$inst | sed '$(transform)'`.$$ext; \\\n\t  echo \" $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'\"; \\\n\t  $(INSTALL_DATA) \"$$file\" \"$(DESTDIR)$(man1dir)/$$inst\"; \\\n\tdone\nuninstall-man1:\n\t@$(NORMAL_UNINSTALL)\n\t@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \\\n\tl2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \\\n\tfor i in $$l2; do \\\n\t  case \"$$i\" in \\\n\t    *.1*) list=\"$$list $$i\" ;; \\\n\t  esac; \\\n\tdone; \\\n\tfor i in $$list; do \\\n\t  ext=`echo $$i | sed -e 's/^.*\\\\.//'`; \\\n\t  case \"$$ext\" in \\\n\t    1*) ;; \\\n\t    *) ext='1' ;; \\\n\t  esac; \\\n\t  inst=`echo $$i | sed -e 's/\\\\.[0-9a-z]*$$//'`; \\\n\t  inst=`echo $$inst | sed -e 's/^.*\\///'`; \\\n\t  inst=`echo $$inst | sed '$(transform)'`.$$ext; \\\n\t  echo \" rm -f '$(DESTDIR)$(man1dir)/$$inst'\"; \\\n\t  rm -f \"$(DESTDIR)$(man1dir)/$$inst\"; \\\n\tdone\ninstall-dist_docDATA: $(dist_doc_DATA)\n\t@$(NORMAL_INSTALL)\n\ttest -z \"$(docdir)\" || $(mkdir_p) \"$(DESTDIR)$(docdir)\"\n\t@list='$(dist_doc_DATA)'; for p in $$list; do \\\n\t  if test -f \"$$p\"; then d=; else d=\"$(srcdir)/\"; fi; \\\n\t  f=$(am__strip_dir) \\\n\t  echo \" $(dist_docDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(docdir)/$$f'\"; \\\n\t  $(dist_docDATA_INSTALL) \"$$d$$p\" \"$(DESTDIR)$(docdir)/$$f\"; \\\n\tdone\n\nuninstall-dist_docDATA:\n\t@$(NORMAL_UNINSTALL)\n\t@list='$(dist_doc_DATA)'; for p in $$list; do \\\n\t  f=$(am__strip_dir) \\\n\t  echo \" rm -f '$(DESTDIR)$(docdir)/$$f'\"; \\\n\t  rm -f \"$(DESTDIR)$(docdir)/$$f\"; \\\n\tdone\ninstall-dist_exampleDATA: $(dist_example_DATA)\n\t@$(NORMAL_INSTALL)\n\ttest -z \"$(exampledir)\" || $(mkdir_p) \"$(DESTDIR)$(exampledir)\"\n\t@list='$(dist_example_DATA)'; for p in $$list; do \\\n\t  if test -f \"$$p\"; then d=; else d=\"$(srcdir)/\"; fi; \\\n\t  f=$(am__strip_dir) \\\n\t  echo \" $(dist_exampleDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(exampledir)/$$f'\"; \\\n\t  $(dist_exampleDATA_INSTALL) \"$$d$$p\" \"$(DESTDIR)$(exampledir)/$$f\"; \\\n\tdone\n\nuninstall-dist_exampleDATA:\n\t@$(NORMAL_UNINSTALL)\n\t@list='$(dist_example_DATA)'; for p in $$list; do \\\n\t  f=$(am__strip_dir) \\\n\t  echo \" rm -f '$(DESTDIR)$(exampledir)/$$f'\"; \\\n\t  rm -f \"$(DESTDIR)$(exampledir)/$$f\"; \\\n\tdone\ninstall-includeHEADERS: $(include_HEADERS)\n\t@$(NORMAL_INSTALL)\n\ttest -z \"$(includedir)\" || $(mkdir_p) \"$(DESTDIR)$(includedir)\"\n\t@list='$(include_HEADERS)'; for p in $$list; do \\\n\t  if test -f \"$$p\"; then d=; else d=\"$(srcdir)/\"; fi; \\\n\t  f=$(am__strip_dir) \\\n\t  echo \" $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'\"; \\\n\t  $(includeHEADERS_INSTALL) \"$$d$$p\" \"$(DESTDIR)$(includedir)/$$f\"; \\\n\tdone\n\nuninstall-includeHEADERS:\n\t@$(NORMAL_UNINSTALL)\n\t@list='$(include_HEADERS)'; for p in $$list; do \\\n\t  f=$(am__strip_dir) \\\n\t  echo \" rm -f '$(DESTDIR)$(includedir)/$$f'\"; \\\n\t  rm -f \"$(DESTDIR)$(includedir)/$$f\"; \\\n\tdone\ninstall-nodist_includeHEADERS: $(nodist_include_HEADERS)\n\t@$(NORMAL_INSTALL)\n\ttest -z \"$(includedir)\" || $(mkdir_p) \"$(DESTDIR)$(includedir)\"\n\t@list='$(nodist_include_HEADERS)'; for p in $$list; do \\\n\t  if test -f \"$$p\"; then d=; else d=\"$(srcdir)/\"; fi; \\\n\t  f=$(am__strip_dir) \\\n\t  echo \" $(nodist_includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'\"; \\\n\t  $(nodist_includeHEADERS_INSTALL) \"$$d$$p\" \"$(DESTDIR)$(includedir)/$$f\"; \\\n\tdone\n\nuninstall-nodist_includeHEADERS:\n\t@$(NORMAL_UNINSTALL)\n\t@list='$(nodist_include_HEADERS)'; for p in $$list; do \\\n\t  f=$(am__strip_dir) \\\n\t  echo \" rm -f '$(DESTDIR)$(includedir)/$$f'\"; \\\n\t  rm -f \"$(DESTDIR)$(includedir)/$$f\"; \\\n\tdone\n\n# This directory's subdirectories are mostly independent; you can cd\n# into them and run `make' without going through this Makefile.\n# To change the values of `make' variables: instead of editing Makefiles,\n# (1) if the variable is set in `config.status', edit `config.status'\n#     (which will cause the Makefiles to be regenerated when you run `make');\n# (2) otherwise, pass the desired values on the `make' command line.\n$(RECURSIVE_TARGETS):\n\t@set fnord $$MAKEFLAGS; amf=$$2; \\\n\tdot_seen=no; \\\n\ttarget=`echo $@ | sed s/-recursive//`; \\\n\tlist='$(SUBDIRS)'; for subdir in $$list; do \\\n\t  echo \"Making $$target in $$subdir\"; \\\n\t  if test \"$$subdir\" = \".\"; then \\\n\t    dot_seen=yes; \\\n\t    local_target=\"$$target-am\"; \\\n\t  else \\\n\t    local_target=\"$$target\"; \\\n\t  fi; \\\n\t  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \\\n\t   || case \"$$amf\" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \\\n\tdone; \\\n\tif test \"$$dot_seen\" = \"no\"; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) \"$$target-am\" || exit 1; \\\n\tfi; test -z \"$$fail\"\n\nmostlyclean-recursive clean-recursive distclean-recursive \\\nmaintainer-clean-recursive:\n\t@set fnord $$MAKEFLAGS; amf=$$2; \\\n\tdot_seen=no; \\\n\tcase \"$@\" in \\\n\t  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \\\n\t  *) list='$(SUBDIRS)' ;; \\\n\tesac; \\\n\trev=''; for subdir in $$list; do \\\n\t  if test \"$$subdir\" = \".\"; then :; else \\\n\t    rev=\"$$subdir $$rev\"; \\\n\t  fi; \\\n\tdone; \\\n\trev=\"$$rev .\"; \\\n\ttarget=`echo $@ | sed s/-recursive//`; \\\n\tfor subdir in $$rev; do \\\n\t  echo \"Making $$target in $$subdir\"; \\\n\t  if test \"$$subdir\" = \".\"; then \\\n\t    local_target=\"$$target-am\"; \\\n\t  else \\\n\t    local_target=\"$$target\"; \\\n\t  fi; \\\n\t  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \\\n\t   || case \"$$amf\" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \\\n\tdone && test -z \"$$fail\"\ntags-recursive:\n\tlist='$(SUBDIRS)'; for subdir in $$list; do \\\n\t  test \"$$subdir\" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \\\n\tdone\nctags-recursive:\n\tlist='$(SUBDIRS)'; for subdir in $$list; do \\\n\t  test \"$$subdir\" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \\\n\tdone\n\nID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)\n\tlist='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \\\n\tunique=`for i in $$list; do \\\n\t    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n\t  done | \\\n\t  $(AWK) '    { files[$$0] = 1; } \\\n\t       END { for (i in files) print i; }'`; \\\n\tmkid -fID $$unique\ntags: TAGS\n\nTAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in jconfig.h.in $(TAGS_DEPENDENCIES) \\\n\t\t$(TAGS_FILES) $(LISP)\n\ttags=; \\\n\there=`pwd`; \\\n\tif ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \\\n\t  include_option=--etags-include; \\\n\t  empty_fix=.; \\\n\telse \\\n\t  include_option=--include; \\\n\t  empty_fix=; \\\n\tfi; \\\n\tlist='$(SUBDIRS)'; for subdir in $$list; do \\\n\t  if test \"$$subdir\" = .; then :; else \\\n\t    test ! -f $$subdir/TAGS || \\\n\t      tags=\"$$tags $$include_option=$$here/$$subdir/TAGS\"; \\\n\t  fi; \\\n\tdone; \\\n\tlist='$(SOURCES) $(HEADERS) config.h.in jconfig.h.in $(LISP) $(TAGS_FILES)'; \\\n\tunique=`for i in $$list; do \\\n\t    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n\t  done | \\\n\t  $(AWK) '    { files[$$0] = 1; } \\\n\t       END { for (i in files) print i; }'`; \\\n\tif test -z \"$(ETAGS_ARGS)$$tags$$unique\"; then :; else \\\n\t  test -n \"$$unique\" || unique=$$empty_fix; \\\n\t  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t    $$tags $$unique; \\\n\tfi\nctags: CTAGS\nCTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in jconfig.h.in $(TAGS_DEPENDENCIES) \\\n\t\t$(TAGS_FILES) $(LISP)\n\ttags=; \\\n\there=`pwd`; \\\n\tlist='$(SOURCES) $(HEADERS) config.h.in jconfig.h.in $(LISP) $(TAGS_FILES)'; \\\n\tunique=`for i in $$list; do \\\n\t    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n\t  done | \\\n\t  $(AWK) '    { files[$$0] = 1; } \\\n\t       END { for (i in files) print i; }'`; \\\n\ttest -z \"$(CTAGS_ARGS)$$tags$$unique\" \\\n\t  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \\\n\t     $$tags $$unique\n\nGTAGS:\n\there=`$(am__cd) $(top_builddir) && pwd` \\\n\t  && cd $(top_srcdir) \\\n\t  && gtags -i $(GTAGS_ARGS) $$here\n\ndistclean-tags:\n\t-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags\n\ndistdir: $(DISTFILES)\n\t$(am__remove_distdir)\n\tmkdir $(distdir)\n\t$(mkdir_p) $(distdir)/. $(distdir)/release $(distdir)/sharedlib\n\t@srcdirstrip=`echo \"$(srcdir)\" | sed 's|.|.|g'`; \\\n\ttopsrcdirstrip=`echo \"$(top_srcdir)\" | sed 's|.|.|g'`; \\\n\tlist='$(DISTFILES)'; for file in $$list; do \\\n\t  case $$file in \\\n\t    $(srcdir)/*) file=`echo \"$$file\" | sed \"s|^$$srcdirstrip/||\"`;; \\\n\t    $(top_srcdir)/*) file=`echo \"$$file\" | sed \"s|^$$topsrcdirstrip/|$(top_builddir)/|\"`;; \\\n\t  esac; \\\n\t  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \\\n\t  dir=`echo \"$$file\" | sed -e 's,/[^/]*$$,,'`; \\\n\t  if test \"$$dir\" != \"$$file\" && test \"$$dir\" != \".\"; then \\\n\t    dir=\"/$$dir\"; \\\n\t    $(mkdir_p) \"$(distdir)$$dir\"; \\\n\t  else \\\n\t    dir=''; \\\n\t  fi; \\\n\t  if test -d $$d/$$file; then \\\n\t    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \\\n\t      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \\\n\t    fi; \\\n\t    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \\\n\t  else \\\n\t    test -f $(distdir)/$$file \\\n\t    || cp -p $$d/$$file $(distdir)/$$file \\\n\t    || exit 1; \\\n\t  fi; \\\n\tdone\n\tlist='$(DIST_SUBDIRS)'; for subdir in $$list; do \\\n\t  if test \"$$subdir\" = .; then :; else \\\n\t    test -d \"$(distdir)/$$subdir\" \\\n\t    || $(mkdir_p) \"$(distdir)/$$subdir\" \\\n\t    || exit 1; \\\n\t    distdir=`$(am__cd) $(distdir) && pwd`; \\\n\t    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \\\n\t    (cd $$subdir && \\\n\t      $(MAKE) $(AM_MAKEFLAGS) \\\n\t        top_distdir=\"$$top_distdir\" \\\n\t        distdir=\"$$distdir/$$subdir\" \\\n\t        distdir) \\\n\t      || exit 1; \\\n\t  fi; \\\n\tdone\n\t$(MAKE) $(AM_MAKEFLAGS) \\\n\t  top_distdir=\"$(top_distdir)\" distdir=\"$(distdir)\" \\\n\t  dist-hook\n\t-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \\; -o \\\n\t  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \\; -o \\\n\t  ! -type d ! -perm -400 -exec chmod a+r {} \\; -o \\\n\t  ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \\; \\\n\t|| chmod -R a+r $(distdir)\ndist-gzip: distdir\n\ttardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz\n\t$(am__remove_distdir)\ndist-bzip2: distdir\n\ttardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2\n\t$(am__remove_distdir)\n\ndist-tarZ: distdir\n\ttardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z\n\t$(am__remove_distdir)\n\ndist-shar: distdir\n\tshar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz\n\t$(am__remove_distdir)\n\ndist-zip: distdir\n\t-rm -f $(distdir).zip\n\tzip -rq $(distdir).zip $(distdir)\n\t$(am__remove_distdir)\n\ndist dist-all: distdir\n\ttardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz\n\ttardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2\n\t$(am__remove_distdir)\n\n# This target untars the dist file and tries a VPATH configuration.  Then\n# it guarantees that the distribution is self-contained by making another\n# tarfile.\ndistcheck: dist\n\tcase '$(DIST_ARCHIVES)' in \\\n\t*.tar.gz*) \\\n\t  GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\\\n\t*.tar.bz2*) \\\n\t  bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\\\n\t*.tar.Z*) \\\n\t  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\\\n\t*.shar.gz*) \\\n\t  GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\\\n\t*.zip*) \\\n\t  unzip $(distdir).zip ;;\\\n\tesac\n\tchmod -R a-w $(distdir); chmod a+w $(distdir)\n\tmkdir $(distdir)/_build\n\tmkdir $(distdir)/_inst\n\tchmod a-w $(distdir)\n\tdc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\\\/]:[\\\\/],/,'` \\\n\t  && dc_destdir=\"$${TMPDIR-/tmp}/am-dc-$$$$/\" \\\n\t  && cd $(distdir)/_build \\\n\t  && ../configure --srcdir=.. --prefix=\"$$dc_install_base\" \\\n\t    $(DISTCHECK_CONFIGURE_FLAGS) \\\n\t  && $(MAKE) $(AM_MAKEFLAGS) \\\n\t  && $(MAKE) $(AM_MAKEFLAGS) dvi \\\n\t  && $(MAKE) $(AM_MAKEFLAGS) check \\\n\t  && $(MAKE) $(AM_MAKEFLAGS) install \\\n\t  && $(MAKE) $(AM_MAKEFLAGS) installcheck \\\n\t  && $(MAKE) $(AM_MAKEFLAGS) uninstall \\\n\t  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir=\"$$dc_install_base\" \\\n\t        distuninstallcheck \\\n\t  && chmod -R a-w \"$$dc_install_base\" \\\n\t  && ({ \\\n\t       (cd ../.. && umask 077 && mkdir \"$$dc_destdir\") \\\n\t       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR=\"$$dc_destdir\" install \\\n\t       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR=\"$$dc_destdir\" uninstall \\\n\t       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR=\"$$dc_destdir\" \\\n\t            distuninstallcheck_dir=\"$$dc_destdir\" distuninstallcheck; \\\n\t      } || { rm -rf \"$$dc_destdir\"; exit 1; }) \\\n\t  && rm -rf \"$$dc_destdir\" \\\n\t  && $(MAKE) $(AM_MAKEFLAGS) dist \\\n\t  && rm -rf $(DIST_ARCHIVES) \\\n\t  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck\n\t$(am__remove_distdir)\n\t@(echo \"$(distdir) archives ready for distribution: \"; \\\n\t  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \\\n\t  sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'\ndistuninstallcheck:\n\t@cd $(distuninstallcheck_dir) \\\n\t&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \\\n\t   || { echo \"ERROR: files left after uninstall:\" ; \\\n\t        if test -n \"$(DESTDIR)\"; then \\\n\t          echo \"  (check DESTDIR support)\"; \\\n\t        fi ; \\\n\t        $(distuninstallcheck_listfiles) ; \\\n\t        exit 1; } >&2\ndistcleancheck: distclean\n\t@if test '$(srcdir)' = . ; then \\\n\t  echo \"ERROR: distcleancheck can only run from a VPATH build\" ; \\\n\t  exit 1 ; \\\n\tfi\n\t@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \\\n\t  || { echo \"ERROR: files left in build directory after distclean:\" ; \\\n\t       $(distcleancheck_listfiles) ; \\\n\t       exit 1; } >&2\ncheck-am: all-am\ncheck: check-recursive\nall-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(DATA) $(HEADERS) \\\n\t\tconfig.h jconfig.h\ninstall-binPROGRAMS: install-libLTLIBRARIES\n\ninstalldirs: installdirs-recursive\ninstalldirs-am:\n\tfor dir in \"$(DESTDIR)$(libdir)\" \"$(DESTDIR)$(bindir)\" \"$(DESTDIR)$(man1dir)\" \"$(DESTDIR)$(docdir)\" \"$(DESTDIR)$(exampledir)\" \"$(DESTDIR)$(includedir)\" \"$(DESTDIR)$(includedir)\"; do \\\n\t  test -z \"$$dir\" || $(mkdir_p) \"$$dir\"; \\\n\tdone\ninstall: install-recursive\ninstall-exec: install-exec-recursive\ninstall-data: install-data-recursive\nuninstall: uninstall-recursive\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-recursive\ninstall-strip:\n\t$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t  install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t  `test -z '$(STRIP)' || \\\n\t    echo \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\"` install\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\nclean: clean-recursive\n\nclean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \\\n\tclean-libtool clean-noinstPROGRAMS mostlyclean-am\n\ndistclean: distclean-recursive\n\t-rm -f $(am__CONFIG_DISTCLEAN_FILES)\n\t-rm -rf ./$(DEPDIR)\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-compile distclean-generic \\\n\tdistclean-hdr distclean-libtool distclean-tags\n\ndvi: dvi-recursive\n\ndvi-am:\n\nhtml: html-recursive\n\ninfo: info-recursive\n\ninfo-am:\n\ninstall-data-am: install-dist_docDATA install-dist_exampleDATA \\\n\tinstall-includeHEADERS install-man \\\n\tinstall-nodist_includeHEADERS\n\ninstall-exec-am: install-binPROGRAMS install-libLTLIBRARIES\n\ninstall-info: install-info-recursive\n\ninstall-man: install-man1\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-recursive\n\t-rm -f $(am__CONFIG_DISTCLEAN_FILES)\n\t-rm -rf $(top_srcdir)/autom4te.cache\n\t-rm -rf ./$(DEPDIR)\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-recursive\n\nmostlyclean-am: mostlyclean-compile mostlyclean-generic \\\n\tmostlyclean-libtool\n\npdf: pdf-recursive\n\npdf-am:\n\nps: ps-recursive\n\nps-am:\n\nuninstall-am: uninstall-binPROGRAMS uninstall-dist_docDATA \\\n\tuninstall-dist_exampleDATA uninstall-includeHEADERS \\\n\tuninstall-info-am uninstall-libLTLIBRARIES uninstall-man \\\n\tuninstall-nodist_includeHEADERS\n\nuninstall-info: uninstall-info-recursive\n\nuninstall-man: uninstall-man1\n\n.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \\\n\tcheck-am clean clean-binPROGRAMS clean-generic \\\n\tclean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS \\\n\tclean-recursive ctags ctags-recursive dist dist-all dist-bzip2 \\\n\tdist-gzip dist-hook dist-shar dist-tarZ dist-zip distcheck \\\n\tdistclean distclean-compile distclean-generic distclean-hdr \\\n\tdistclean-libtool distclean-recursive distclean-tags \\\n\tdistcleancheck distdir distuninstallcheck dvi dvi-am html \\\n\thtml-am info info-am install install-am install-binPROGRAMS \\\n\tinstall-data install-data-am install-dist_docDATA \\\n\tinstall-dist_exampleDATA install-exec install-exec-am \\\n\tinstall-includeHEADERS install-info install-info-am \\\n\tinstall-libLTLIBRARIES install-man install-man1 \\\n\tinstall-nodist_includeHEADERS install-strip installcheck \\\n\tinstallcheck-am installdirs installdirs-am maintainer-clean \\\n\tmaintainer-clean-generic maintainer-clean-recursive \\\n\tmostlyclean mostlyclean-compile mostlyclean-generic \\\n\tmostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \\\n\ttags tags-recursive uninstall uninstall-am \\\n\tuninstall-binPROGRAMS uninstall-dist_docDATA \\\n\tuninstall-dist_exampleDATA uninstall-includeHEADERS \\\n\tuninstall-info-am uninstall-libLTLIBRARIES uninstall-man \\\n\tuninstall-man1 uninstall-nodist_includeHEADERS\n\n\ndist-hook:\n\trm -rf `find $(distdir) -name .svn`\n\ntest: testclean all\n@WITH_JAVA_TRUE@@WITH_TURBOJPEG_TRUE@\t$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest\n@WITH_JAVA_TRUE@@WITH_TURBOJPEG_TRUE@\t$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -bi\n@WITH_JAVA_TRUE@@WITH_TURBOJPEG_TRUE@\t$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv\n@WITH_JAVA_TRUE@@WITH_TURBOJPEG_TRUE@\t$(JAVA) -cp java/turbojpeg.jar -Djava.library.path=.libs TJUnitTest -yuv -bi\n@WITH_TURBOJPEG_TRUE@\t./tjunittest\n@WITH_TURBOJPEG_TRUE@\t./tjunittest -alloc\n@WITH_TURBOJPEG_TRUE@\t./tjunittest -yuv\n\t./cjpeg -dct int -outfile testoutint.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_INT) testoutint.jpg\n\t./cjpeg -dct fast -opt -outfile testoutfst.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_FAST) testoutfst.jpg\n\t./cjpeg -dct fast -quality 100 -opt -outfile testoutfst100.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_FAST_100) testoutfst100.jpg\n\t./cjpeg -dct float -outfile testoutflt.jpg $(srcdir)/testimages/testorig.ppm\n@WITH_SSE_FLOAT_DCT_TRUE@\tmd5/md5cmp $(MD5_JPEG_FLOAT) testoutflt.jpg\n@WITH_SSE_FLOAT_DCT_FALSE@\tmd5/md5cmp $(MD5_JPEG_FLOAT_NOSIMD) testoutflt.jpg\n\t./cjpeg -dct int -grayscale -outfile testoutgray.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_INT_GRAY) testoutgray.jpg\n\t./djpeg -dct int -fast -ppm -outfile testoutint.ppm $(srcdir)/testimages/testorig.jpg\n\tmd5/md5cmp $(MD5_PPM_INT) testoutint.ppm\n\t./djpeg -dct fast -ppm -outfile testoutfst.ppm $(srcdir)/testimages/testorig.jpg\n\tmd5/md5cmp $(MD5_PPM_FAST) testoutfst.ppm\n\t./djpeg -dct float -ppm -outfile testoutflt.ppm $(srcdir)/testimages/testorig.jpg\n@WITH_SSE_FLOAT_DCT_TRUE@\tmd5/md5cmp $(MD5_PPM_FLOAT) testoutflt.ppm\n@WITH_SSE_FLOAT_DCT_FALSE@\tmd5/md5cmp $(MD5_PPM_FLOAT_NOSIMD) testoutflt.ppm\n\t./djpeg -dct int -nosmooth -scale 2/1 -ppm -outfile testoutint2_1.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_2_1) testoutint2_1.ppm;\n\t./djpeg -dct int -nosmooth -scale 15/8 -ppm -outfile testoutint15_8.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_15_8) testoutint15_8.ppm;\n\t./djpeg -dct int -nosmooth -scale 7/4 -ppm -outfile testoutint7_4.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_7_4) testoutint7_4.ppm;\n\t./djpeg -dct int -nosmooth -scale 13/8 -ppm -outfile testoutint13_8.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_13_8) testoutint13_8.ppm;\n\t./djpeg -dct int -nosmooth -scale 3/2 -ppm -outfile testoutint3_2.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_3_2) testoutint3_2.ppm;\n\t./djpeg -dct int -nosmooth -scale 11/8 -ppm -outfile testoutint11_8.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_11_8) testoutint11_8.ppm;\n\t./djpeg -dct int -nosmooth -scale 5/4 -ppm -outfile testoutint5_4.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_5_4) testoutint5_4.ppm;\n\t./djpeg -dct int -nosmooth -scale 9/8 -ppm -outfile testoutint9_8.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_9_8) testoutint9_8.ppm;\n\t./djpeg -dct int -nosmooth -scale 7/8 -ppm -outfile testoutint7_8.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_7_8) testoutint7_8.ppm;\n\t./djpeg -dct int -nosmooth -scale 3/4 -ppm -outfile testoutint3_4.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_3_4) testoutint3_4.ppm;\n\t./djpeg -dct int -nosmooth -scale 5/8 -ppm -outfile testoutint5_8.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_5_8) testoutint5_8.ppm;\n\t./djpeg -dct int -nosmooth -scale 1/2 -ppm -outfile testoutint1_2.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_1_2) testoutint1_2.ppm;\n\t./djpeg -dct int -nosmooth -scale 3/8 -ppm -outfile testoutint3_8.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_3_8) testoutint3_8.ppm;\n\t./djpeg -dct int -nosmooth -scale 1/4 -ppm -outfile testoutint1_4.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_1_4) testoutint1_4.ppm;\n\t./djpeg -dct int -nosmooth -scale 1/8 -ppm -outfile testoutint1_8.ppm $(srcdir)/testimages/testorig.jpg;\n\tmd5/md5cmp $(MD5_PPM_INT_1_8) testoutint1_8.ppm;\n\t./djpeg -dct fast -scale 1/2 -ppm -outfile testoutfst1_2.ppm $(srcdir)/testimages/testorig.jpg\n\tmd5/md5cmp $(MD5_PPM_FAST_1_2) testoutfst1_2.ppm\n\t./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testimages/testorig.jpg\n\tmd5/md5cmp $(MD5_BMP_256) testout.bmp\n@WITH_ARITH_ENC_TRUE@\t./cjpeg -dct int -arithmetic -outfile testoutari.jpg $(srcdir)/testimages/testorig.ppm\n@WITH_ARITH_ENC_TRUE@\tmd5/md5cmp $(MD5_JPEG_ARI) testoutari.jpg\n@WITH_ARITH_ENC_TRUE@\t./jpegtran -arithmetic -outfile testouta.jpg $(srcdir)/testimages/testimgint.jpg\n@WITH_ARITH_ENC_TRUE@\tmd5/md5cmp $(MD5_JPEG_ARI) testouta.jpg\n@WITH_ARITH_ENC_TRUE@\t./cjpeg -dct int -progressive -arithmetic -sample 1x1 -outfile testoutpa.jpg $(srcdir)/testimages/testorig.ppm\n@WITH_ARITH_ENC_TRUE@\tmd5/md5cmp $(MD5_JPEG_PROG_ARI) testoutpa.jpg\n@WITH_ARITH_DEC_TRUE@\t./djpeg -dct int -fast -ppm -outfile testoutari.ppm $(srcdir)/testimages/testimgari.jpg\n@WITH_ARITH_DEC_TRUE@\tmd5/md5cmp $(MD5_PPM_ARI) testoutari.ppm\n@WITH_ARITH_DEC_TRUE@\t./jpegtran -outfile testouta.jpg $(srcdir)/testimages/testimgari.jpg\n@WITH_ARITH_DEC_TRUE@\tmd5/md5cmp $(MD5_JPEG_INT) testouta.jpg\n\t./cjpeg -dct int -progressive -outfile testoutp.jpg $(srcdir)/testimages/testorig.ppm\n\tmd5/md5cmp $(MD5_JPEG_PROG) testoutp.jpg\n\t./jpegtran -outfile testoutt.jpg testoutp.jpg\n\tmd5/md5cmp $(MD5_JPEG_INT) testoutt.jpg\n\t./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg $(srcdir)/testimages/testorig.jpg\n\tmd5/md5cmp $(MD5_JPEG_CROP) testoutcrop.jpg\n\ntestclean:\n\trm -f testout*\n\trm -f *_GRAY_*.bmp\n\trm -f *_GRAY_*.png\n\trm -f *_GRAY_*.ppm\n\trm -f *_GRAY_*.jpg\n\trm -f *_GRAY.yuv\n\trm -f *_420_*.bmp\n\trm -f *_420_*.png\n\trm -f *_420_*.ppm\n\trm -f *_420_*.jpg\n\trm -f *_420.yuv\n\trm -f *_422_*.bmp\n\trm -f *_422_*.png\n\trm -f *_422_*.ppm\n\trm -f *_422_*.jpg\n\trm -f *_422.yuv\n\trm -f *_444_*.bmp\n\trm -f *_444_*.png\n\trm -f *_444_*.ppm\n\trm -f *_444_*.jpg\n\trm -f *_444.yuv\n\trm -f *_440_*.bmp\n\trm -f *_440_*.png\n\trm -f *_440_*.ppm\n\trm -f *_440_*.jpg\n\trm -f *_440.yuv\n\ntjtest:\n\tsh ./tjbenchtest\n@WITH_JAVA_TRUE@\tsh ./tjbenchtest.java\n\npkgscripts/libjpeg-turbo.spec: pkgscripts/libjpeg-turbo.spec.tmpl\n\tcat pkgscripts/libjpeg-turbo.spec.tmpl | sed s@%{__prefix}@$(prefix)@g | \\\n\t\tsed s@%{__bindir}@$(bindir)@g | sed s@%{__datadir}@$(datadir)@g | \\\n\t\tsed s@%{__docdir}@$(docdir)@g | sed s@%{__includedir}@$(includedir)@g | \\\n\t\tsed s@%{__libdir}@$(libdir)@g | sed s@%{__mandir}@$(mandir)@g \\\n\t\t> pkgscripts/libjpeg-turbo.spec\n\nrpm: all pkgscripts/libjpeg-turbo.spec\n\tTMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \\\n\tmkdir -p $$TMPDIR/RPMS; \\\n\tln -fs `pwd` $$TMPDIR/BUILD; \\\n\trm -f ${PKGNAME}-${VERSION}.${RPMARCH}.rpm; \\\n\trpmbuild -bb --define \"_blddir $$TMPDIR/buildroot\"  \\\n\t\t--define \"_topdir $$TMPDIR\" \\\n\t\t--target ${RPMARCH} pkgscripts/libjpeg-turbo.spec; \\\n\tcp $$TMPDIR/RPMS/${RPMARCH}/${PKGNAME}-${VERSION}-${BUILD}.${RPMARCH}.rpm \\\n\t\t${PKGNAME}-${VERSION}.${RPMARCH}.rpm; \\\n\trm -rf $$TMPDIR\n\nsrpm: dist-gzip pkgscripts/libjpeg-turbo.spec\n\tTMPDIR=`mktemp -d /tmp/${PACKAGE_NAME}-build.XXXXXX`; \\\n\tmkdir -p $$TMPDIR/RPMS; \\\n\tmkdir -p $$TMPDIR/SRPMS; \\\n\tmkdir -p $$TMPDIR/BUILD; \\\n\tmkdir -p $$TMPDIR/SOURCES; \\\n\tmkdir -p $$TMPDIR/SPECS; \\\n\trm -f ${PKGNAME}-${VERSION}.src.rpm; \\\n\tcp ${PACKAGE_NAME}-${VERSION}.tar.gz $$TMPDIR/SOURCES; \\\n\tcat pkgscripts/libjpeg-turbo.spec | sed s/%{_blddir}/%{_tmppath}/g \\\n\t\t| sed s/#--\\>//g \\\n\t\t> $$TMPDIR/SPECS/libjpeg-turbo.spec; \\\n\trpmbuild -bs --define \"_topdir $$TMPDIR\" $$TMPDIR/SPECS/libjpeg-turbo.spec; \\\n\tcp $$TMPDIR/SRPMS/${PKGNAME}-${VERSION}-${BUILD}.src.rpm \\\n\t\t${PKGNAME}-${VERSION}.src.rpm; \\\n\trm -rf $$TMPDIR\n\npkgscripts/makedpkg: pkgscripts/makedpkg.tmpl\n\tcat pkgscripts/makedpkg.tmpl | sed s@%{__prefix}@$(prefix)@g | \\\n\t\tsed s@%{__docdir}@$(docdir)@g | sed s@%{__libdir}@$(libdir)@g \\\n\t\t> pkgscripts/makedpkg\n\ndeb: all pkgscripts/makedpkg\n\tsh pkgscripts/makedpkg\n\npkgscripts/uninstall: pkgscripts/uninstall.tmpl\n\tcat pkgscripts/uninstall.tmpl | sed s@%{__prefix}@$(prefix)@g | \\\n\t\tsed s@%{__bindir}@$(bindir)@g | sed s@%{__datadir}@$(datadir)@g | \\\n\t\tsed s@%{__includedir}@$(includedir)@g | sed s@%{__libdir}@$(libdir)@g | \\\n\t\tsed s@%{__mandir}@$(mandir)@g > pkgscripts/uninstall\n\npkgscripts/makemacpkg: pkgscripts/makemacpkg.tmpl\n\tcat pkgscripts/makemacpkg.tmpl | sed s@%{__prefix}@$(prefix)@g | \\\n\t\tsed s@%{__bindir}@$(bindir)@g | sed s@%{__docdir}@$(docdir)@g | \\\n\t\tsed s@%{__libdir}@$(libdir)@g > pkgscripts/makemacpkg\n\n@X86_64_TRUE@udmg: all pkgscripts/makemacpkg pkgscripts/uninstall\n@X86_64_TRUE@\tsh pkgscripts/makemacpkg -build32 ${BUILDDIR32}\n\n@X86_64_TRUE@iosdmg: all pkgscripts/makemacpkg pkgscripts/uninstall\n@X86_64_TRUE@\tsh pkgscripts/makemacpkg -build32 ${BUILDDIR32} -buildarmv6 ${BUILDDIRARMV6} -buildarmv7 ${BUILDDIRARMV7} -buildarmv7s ${BUILDDIRARMV7S}\n\n@X86_64_FALSE@iosdmg: all pkgscripts/makemacpkg pkgscripts/uninstall\n@X86_64_FALSE@\tsh pkgscripts/makemacpkg -buildarmv6 ${BUILDDIRARMV6} -buildarmv7 ${BUILDDIRARMV7} -buildarmv7s ${BUILDDIRARMV7S}\n\ndmg: all pkgscripts/makemacpkg pkgscripts/uninstall\n\tsh pkgscripts/makemacpkg\n\npkgscripts/makecygwinpkg: pkgscripts/makecygwinpkg.tmpl\n\tcat pkgscripts/makecygwinpkg.tmpl | sed s@%{__prefix}@$(prefix)@g | \\\n\t\tsed s@%{__docdir}@$(docdir)@g | sed s@%{__libdir}@$(libdir)@g \\\n\t\t> pkgscripts/makecygwinpkg\n\ncygwinpkg: all pkgscripts/makecygwinpkg\n\tsh pkgscripts/makecygwinpkg\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "ext/libjpeg-turbo/README",
    "content": "libjpeg-turbo note:  This file has been modified by The libjpeg-turbo Project\nto include only information relevant to libjpeg-turbo, to wordsmith certain\nsections, and to remove impolitic language that existed in the libjpeg v8\nREADME.  It is included only for reference.  Please see README-turbo.txt for\ninformation specific to libjpeg-turbo.\n\n\nThe Independent JPEG Group's JPEG software\n==========================================\n\nThis distribution contains a release of the Independent JPEG Group's free JPEG\nsoftware.  You are welcome to redistribute this software and to use it for any\npurpose, subject to the conditions under LEGAL ISSUES, below.\n\nThis software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone,\nBill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson,\nJulian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers,\nand other members of the Independent JPEG Group.\n\nIJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee\n(also known as JPEG, together with ITU-T SG16).\n\n\nDOCUMENTATION ROADMAP\n=====================\n\nThis file contains the following sections:\n\nOVERVIEW            General description of JPEG and the IJG software.\nLEGAL ISSUES        Copyright, lack of warranty, terms of distribution.\nREFERENCES          Where to learn more about JPEG.\nARCHIVE LOCATIONS   Where to find newer versions of this software.\nFILE FORMAT WARS    Software *not* to get.\nTO DO               Plans for future IJG releases.\n\nOther documentation files in the distribution are:\n\nUser documentation:\n  install.txt       How to configure and install the IJG software.\n  usage.txt         Usage instructions for cjpeg, djpeg, jpegtran,\n                    rdjpgcom, and wrjpgcom.\n  *.1               Unix-style man pages for programs (same info as usage.txt).\n  wizard.txt        Advanced usage instructions for JPEG wizards only.\n  change.log        Version-to-version change highlights.\nProgrammer and internal documentation:\n  libjpeg.txt       How to use the JPEG library in your own programs.\n  example.c         Sample code for calling the JPEG library.\n  structure.txt     Overview of the JPEG library's internal structure.\n  coderules.txt     Coding style rules --- please read if you contribute code.\n\nPlease read at least the files install.txt and usage.txt.  Some information\ncan also be found in the JPEG FAQ (Frequently Asked Questions) article.  See\nARCHIVE LOCATIONS below to find out where to obtain the FAQ article.\n\nIf you want to understand how the JPEG code works, we suggest reading one or\nmore of the REFERENCES, then looking at the documentation files (in roughly\nthe order listed) before diving into the code.\n\n\nOVERVIEW\n========\n\nThis package contains C software to implement JPEG image encoding, decoding,\nand transcoding.  JPEG (pronounced \"jay-peg\") is a standardized compression\nmethod for full-color and gray-scale images.  JPEG's strong suit is compressing\nphotographic images or other types of images that have smooth color and\nbrightness transitions between neighboring pixels.  Images with sharp lines or\nother abrupt features may not compress well with JPEG, and a higher JPEG\nquality may have to be used to avoid visible compression artifacts with such\nimages.\n\nJPEG is lossy, meaning that the output pixels are not necessarily identical to\nthe input pixels.  However, on photographic content and other \"smooth\" images,\nvery good compression ratios can be obtained with no visible compression\nartifacts, and extremely high compression ratios are possible if you are\nwilling to sacrifice image quality (by reducing the \"quality\" setting in the\ncompressor.)\n\nThis software implements JPEG baseline, extended-sequential, and progressive\ncompression processes.  Provision is made for supporting all variants of these\nprocesses, although some uncommon parameter settings aren't implemented yet.\nWe have made no provision for supporting the hierarchical or lossless\nprocesses defined in the standard.\n\nWe provide a set of library routines for reading and writing JPEG image files,\nplus two sample applications \"cjpeg\" and \"djpeg\", which use the library to\nperform conversion between JPEG and some other popular image file formats.\nThe library is intended to be reused in other applications.\n\nIn order to support file conversion and viewing software, we have included\nconsiderable functionality beyond the bare JPEG coding/decoding capability;\nfor example, the color quantization modules are not strictly part of JPEG\ndecoding, but they are essential for output to colormapped file formats or\ncolormapped displays.  These extra functions can be compiled out of the\nlibrary if not required for a particular application.\n\nWe have also included \"jpegtran\", a utility for lossless transcoding between\ndifferent JPEG processes, and \"rdjpgcom\" and \"wrjpgcom\", two simple\napplications for inserting and extracting textual comments in JFIF files.\n\nThe emphasis in designing this software has been on achieving portability and\nflexibility, while also making it fast enough to be useful.  In particular,\nthe software is not intended to be read as a tutorial on JPEG.  (See the\nREFERENCES section for introductory material.)  Rather, it is intended to\nbe reliable, portable, industrial-strength code.  We do not claim to have\nachieved that goal in every aspect of the software, but we strive for it.\n\nWe welcome the use of this software as a component of commercial products.\nNo royalty is required, but we do ask for an acknowledgement in product\ndocumentation, as described under LEGAL ISSUES.\n\n\nLEGAL ISSUES\n============\n\nIn plain English:\n\n1. We don't promise that this software works.  (But if you find any bugs,\n   please let us know!)\n2. You can use this software for whatever you want.  You don't have to pay us.\n3. You may not pretend that you wrote this software.  If you use it in a\n   program, you must acknowledge somewhere in your documentation that\n   you've used the IJG code.\n\nIn legalese:\n\nThe authors make NO WARRANTY or representation, either express or implied,\nwith respect to this software, its quality, accuracy, merchantability, or\nfitness for a particular purpose.  This software is provided \"AS IS\", and you,\nits user, assume the entire risk as to its quality and accuracy.\n\nThis software is copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding.\nAll Rights Reserved except as specified below.\n\nPermission is hereby granted to use, copy, modify, and distribute this\nsoftware (or portions thereof) for any purpose, without fee, subject to these\nconditions:\n(1) If any part of the source code for this software is distributed, then this\nREADME file must be included, with this copyright and no-warranty notice\nunaltered; and any additions, deletions, or changes to the original files\nmust be clearly indicated in accompanying documentation.\n(2) If only executable code is distributed, then the accompanying\ndocumentation must state that \"this software is based in part on the work of\nthe Independent JPEG Group\".\n(3) Permission for use of this software is granted only if the user accepts\nfull responsibility for any undesirable consequences; the authors accept\nNO LIABILITY for damages of any kind.\n\nThese conditions apply to any software derived from or based on the IJG code,\nnot just to the unmodified library.  If you use our work, you ought to\nacknowledge us.\n\nPermission is NOT granted for the use of any IJG author's name or company name\nin advertising or publicity relating to this software or products derived from\nit.  This software may be referred to only as \"the Independent JPEG Group's\nsoftware\".\n\nWe specifically permit and encourage the use of this software as the basis of\ncommercial products, provided that all warranty or liability claims are\nassumed by the product vendor.\n\n\nThe Unix configuration script \"configure\" was produced with GNU Autoconf.\nIt is copyright by the Free Software Foundation but is freely distributable.\nThe same holds for its supporting scripts (config.guess, config.sub,\nltmain.sh).  Another support script, install-sh, is copyright by X Consortium\nbut is also freely distributable.\n\nThe IJG distribution formerly included code to read and write GIF files.\nTo avoid entanglement with the Unisys LZW patent, GIF reading support has\nbeen removed altogether, and the GIF writer has been simplified to produce\n\"uncompressed GIFs\".  This technique does not use the LZW algorithm; the\nresulting GIF files are larger than usual, but are readable by all standard\nGIF decoders.\n\nWe are required to state that\n    \"The Graphics Interchange Format(c) is the Copyright property of\n    CompuServe Incorporated.  GIF(sm) is a Service Mark property of\n    CompuServe Incorporated.\"\n\n\nREFERENCES\n==========\n\nWe recommend reading one or more of these references before trying to\nunderstand the innards of the JPEG software.\n\nThe best short technical introduction to the JPEG compression algorithm is\n\tWallace, Gregory K.  \"The JPEG Still Picture Compression Standard\",\n\tCommunications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.\n(Adjacent articles in that issue discuss MPEG motion picture compression,\napplications of JPEG, and related topics.)  If you don't have the CACM issue\nhandy, a PostScript file containing a revised version of Wallace's article is\navailable at http://www.ijg.org/files/wallace.ps.gz.  The file (actually\na preprint for an article that appeared in IEEE Trans. Consumer Electronics)\nomits the sample images that appeared in CACM, but it includes corrections\nand some added material.  Note: the Wallace article is copyright ACM and IEEE,\nand it may not be used for commercial purposes.\n\nA somewhat less technical, more leisurely introduction to JPEG can be found in\n\"The Data Compression Book\" by Mark Nelson and Jean-loup Gailly, published by\nM&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1.  This book provides\ngood explanations and example C code for a multitude of compression methods\nincluding JPEG.  It is an excellent source if you are comfortable reading C\ncode but don't know much about data compression in general.  The book's JPEG\nsample code is far from industrial-strength, but when you are ready to look\nat a full implementation, you've got one here...\n\nThe best currently available description of JPEG is the textbook \"JPEG Still\nImage Data Compression Standard\" by William B. Pennebaker and Joan L.\nMitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.\nPrice US$59.95, 638 pp.  The book includes the complete text of the ISO JPEG\nstandards (DIS 10918-1 and draft DIS 10918-2).\n\nThe original JPEG standard is divided into two parts, Part 1 being the actual\nspecification, while Part 2 covers compliance testing methods.  Part 1 is\ntitled \"Digital Compression and Coding of Continuous-tone Still Images,\nPart 1: Requirements and guidelines\" and has document numbers ISO/IEC IS\n10918-1, ITU-T T.81.  Part 2 is titled \"Digital Compression and Coding of\nContinuous-tone Still Images, Part 2: Compliance testing\" and has document\nnumbers ISO/IEC IS 10918-2, ITU-T T.83.\n\nThe JPEG standard does not specify all details of an interchangeable file\nformat.  For the omitted details we follow the \"JFIF\" conventions, revision\n1.02.  JFIF 1.02 has been adopted as an Ecma International Technical Report\nand thus received a formal publication status.  It is available as a free\ndownload in PDF format from\nhttp://www.ecma-international.org/publications/techreports/E-TR-098.htm.\nA PostScript version of the JFIF document is available at\nhttp://www.ijg.org/files/jfif.ps.gz.  There is also a plain text version at\nhttp://www.ijg.org/files/jfif.txt.gz, but it is missing the figures.\n\nThe TIFF 6.0 file format specification can be obtained by FTP from\nftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz.  The JPEG incorporation scheme\nfound in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.\nIJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).\nInstead, we recommend the JPEG design proposed by TIFF Technical Note #2\n(Compression tag 7).  Copies of this Note can be obtained from\nhttp://www.ijg.org/files/.  It is expected that the next revision\nof the TIFF spec will replace the 6.0 JPEG design with the Note's design.\nAlthough IJG's own code does not support TIFF/JPEG, the free libtiff library\nuses our library to implement TIFF/JPEG per the Note.\n\n\nARCHIVE LOCATIONS\n=================\n\nThe \"official\" archive site for this software is www.ijg.org.\nThe most recent released version can always be found there in\ndirectory \"files\".  This particular version will be archived as\nhttp://www.ijg.org/files/jpegsrc.v8d.tar.gz, and in Windows-compatible\n\"zip\" archive format as http://www.ijg.org/files/jpegsr8d.zip.\n\nThe JPEG FAQ (Frequently Asked Questions) article is a source of some\ngeneral information about JPEG.\nIt is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/\nand other news.answers archive sites, including the official news.answers\narchive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.\nIf you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu\nwith body\n\tsend usenet/news.answers/jpeg-faq/part1\n\tsend usenet/news.answers/jpeg-faq/part2\n\n\nFILE FORMAT WARS\n================\n\nThe ISO/IEC JTC1/SC29/WG1 standards committee (also known as JPEG, together\nwith ITU-T SG16) currently promotes different formats containing the name\n\"JPEG\" which are incompatible with original DCT-based JPEG.  IJG therefore does\nnot support these formats (see REFERENCES).  Indeed, one of the original\nreasons for developing this free software was to help force convergence on\ncommon, interoperable format standards for JPEG files.\nDon't use an incompatible file format!\n(In any case, our decoder will remain capable of reading existing JPEG\nimage files indefinitely.)\n\n\nTO DO\n=====\n\nPlease send bug reports, offers of help, etc. to jpeg-info@jpegclub.org.\n"
  },
  {
    "path": "ext/libjpeg-turbo/README-turbo.txt",
    "content": "*******************************************************************************\n**     Background\n*******************************************************************************\n\nlibjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2,\nNEON) to accelerate baseline JPEG compression and decompression on x86, x86-64,\nand ARM systems.  On such systems, libjpeg-turbo is generally 2-4x as fast as\nlibjpeg, all else being equal.  On other types of systems, libjpeg-turbo can\nstill outperform libjpeg by a significant amount, by virtue of its\nhighly-optimized Huffman coding routines.  In many cases, the performance of\nlibjpeg-turbo rivals that of proprietary high-speed JPEG codecs.\n\nlibjpeg-turbo implements both the traditional libjpeg API as well as the less\npowerful but more straightforward TurboJPEG API.  libjpeg-turbo also features\ncolorspace extensions that allow it to compress from/decompress to 32-bit and\nbig-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java\ninterface.\n\nlibjpeg-turbo was originally based on libjpeg/SIMD, an MMX-accelerated\nderivative of libjpeg v6b developed by Miyasaka Masaru.  The TigerVNC and\nVirtualGL projects made numerous enhancements to the codec in 2009, and in\nearly 2010, libjpeg-turbo spun off into an independent project, with the goal\nof making high-speed JPEG compression/decompression technology available to a\nbroader range of users and developers.\n\n\n*******************************************************************************\n**     License\n*******************************************************************************\n\nMost of libjpeg-turbo inherits the non-restrictive, BSD-style license used by\nlibjpeg (see README.)  The TurboJPEG wrapper (both C and Java versions) and\nassociated test programs bear a similar license, which is reproduced below:\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice,\n  this list of conditions and the following disclaimer.\n- Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n- Neither the name of the libjpeg-turbo Project nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\nLIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\nCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\nSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.\n\n\n*******************************************************************************\n**     Using libjpeg-turbo\n*******************************************************************************\n\nlibjpeg-turbo includes two APIs that can be used to compress and decompress\nJPEG images:\n\n  TurboJPEG API:  This API provides an easy-to-use interface for compressing\n  and decompressing JPEG images in memory.  It also provides some functionality\n  that would not be straightforward to achieve using the underlying libjpeg\n  API, such as generating planar YUV images and performing multiple\n  simultaneous lossless transforms on an image.  The Java interface for\n  libjpeg-turbo is written on top of the TurboJPEG API.\n\n  libjpeg API:  This is the de facto industry-standard API for compressing and\n  decompressing JPEG images.  It is more difficult to use than the TurboJPEG\n  API but also more powerful.  The libjpeg API implementation in libjpeg-turbo\n  is both API/ABI-compatible and mathematically compatible with libjpeg v6b.\n  It can also optionally be configured to be API/ABI-compatible with libjpeg v7\n  and v8 (see below.)\n\nThere is no significant performance advantage to either API when both are used\nto perform similar operations.\n\n======================\nInstallation Directory\n======================\n\nThis document assumes that libjpeg-turbo will be installed in the default\ndirectory (/opt/libjpeg-turbo on Un*x and Mac systems and\nc:\\libjpeg-turbo[-gcc][64] on Windows systems.  If your installation of\nlibjpeg-turbo resides in a different directory, then adjust the instructions\naccordingly.\n\n=============================\nReplacing libjpeg at Run Time\n=============================\n\nUn*x\n----\n\nIf a Un*x application is dynamically linked with libjpeg, then you can replace\nlibjpeg with libjpeg-turbo at run time by manipulating LD_LIBRARY_PATH.\nFor instance:\n\n  [Using libjpeg]\n  > time cjpeg <vgl_5674_0098.ppm >vgl_5674_0098.jpg\n  real  0m0.392s\n  user  0m0.074s\n  sys   0m0.020s\n\n  [Using libjpeg-turbo]\n  > export LD_LIBRARY_PATH=/opt/libjpeg-turbo/{lib}:$LD_LIBRARY_PATH\n  > time cjpeg <vgl_5674_0098.ppm >vgl_5674_0098.jpg\n  real  0m0.109s\n  user  0m0.029s\n  sys   0m0.010s\n\n({lib} = lib32 or lib64, depending on whether you wish to use the 32-bit or the\n64-bit version of libjpeg-turbo.)\n\nSystem administrators can also replace the libjpeg symlinks in /usr/lib* with\nlinks to the libjpeg-turbo dynamic library located in /opt/libjpeg-turbo/{lib}.\nThis will effectively accelerate every application that uses the libjpeg\ndynamic library on the system.\n\nWindows\n-------\n\nIf a Windows application is dynamically linked with libjpeg, then you can\nreplace libjpeg with libjpeg-turbo at run time by backing up the application's\ncopy of jpeg62.dll, jpeg7.dll, or jpeg8.dll (assuming the application has its\nown local copy of this library) and copying the corresponding DLL from\nlibjpeg-turbo into the application's install directory.  The official\nlibjpeg-turbo binary packages only provide jpeg62.dll.  If the application uses\njpeg7.dll or jpeg8.dll instead, then it will be necessary to build\nlibjpeg-turbo from source (see \"libjpeg v7 and v8 API/ABI Emulation\" below.)\n\nThe following information is specific to the official libjpeg-turbo binary\npackages for Visual C++:\n\n-- jpeg62.dll requires the Visual C++ 2008 C run-time DLL (msvcr90.dll).\nmsvcr90.dll ships with more recent versions of Windows, but users of older\nWindows releases can obtain it from the Visual C++ 2008 Redistributable\nPackage, which is available as a free download from Microsoft's web site.\n\n-- Features of the libjpeg API that require passing a C run-time structure,\nsuch as a file handle, from an application to the library will probably not\nwork with jpeg62.dll, unless the application is also built to use the Visual\nC++ 2008 C run-time DLL.  In particular, this affects jpeg_stdio_dest() and\njpeg_stdio_src().\n\nMac\n---\n\nMac applications typically embed their own copies of the libjpeg dylib inside\nthe (hidden) application bundle, so it is not possible to globally replace\nlibjpeg on OS X systems.  Replacing the application's version of the libjpeg\ndylib would generally involve copying libjpeg.*.dylib from libjpeg-turbo into\nthe appropriate place in the application bundle and using install_name_tool to\nrepoint the libjpeg-turbo dylib to its new directory.  This requires an\nadvanced knowledge of OS X and would not survive an upgrade or a re-install of\nthe application.  Thus, it is not recommended for most users.\n\n========================================\nUsing libjpeg-turbo in Your Own Programs\n========================================\n\nFor the most part, libjpeg-turbo should work identically to libjpeg, so in\nmost cases, an application can be built against libjpeg and then run against\nlibjpeg-turbo.  On Un*x systems and Cygwin, you can build against libjpeg-turbo\ninstead of libjpeg by setting\n\n  CPATH=/opt/libjpeg-turbo/include\n  and\n  LIBRARY_PATH=/opt/libjpeg-turbo/{lib}\n\n({lib} = lib32 or lib64, depending on whether you are building a 32-bit or a\n64-bit application.)\n\nIf using MinGW, then set\n\n  CPATH=/c/libjpeg-turbo-gcc[64]/include\n  and\n  LIBRARY_PATH=/c/libjpeg-turbo-gcc[64]/lib\n\nBuilding against libjpeg-turbo is useful, for instance, if you want to build an\napplication that leverages the libjpeg-turbo colorspace extensions (see below.)\nOn Un*x systems, you would still need to manipulate LD_LIBRARY_PATH or create\nappropriate symlinks to use libjpeg-turbo at run time.  On such systems, you\ncan pass -R /opt/libjpeg-turbo/{lib} to the linker to force the use of\nlibjpeg-turbo at run time rather than libjpeg (also useful if you want to\nleverage the colorspace extensions), or you can link against the libjpeg-turbo\nstatic library.\n\nTo force a Un*x or MinGW application to link against the static version of\nlibjpeg-turbo, you can use the following linker options:\n\n  -Wl,-Bstatic -ljpeg -Wl,-Bdynamic\n\nOn OS X, simply add /opt/libjpeg-turbo/lib/libjpeg.a to the linker command\nline.\n\nTo build Visual C++ applications using libjpeg-turbo, add\nc:\\libjpeg-turbo[64]\\include to the system or user INCLUDE environment\nvariable and c:\\libjpeg-turbo[64]\\lib to the system or user LIB environment\nvariable, and then link against either jpeg.lib (to use the DLL version of\nlibjpeg-turbo) or jpeg-static.lib (to use the static version of libjpeg-turbo.)\n\n=====================\nColorspace Extensions\n=====================\n\nlibjpeg-turbo includes extensions that allow JPEG images to be compressed\ndirectly from (and decompressed directly to) buffers that use BGR, BGRX,\nRGBX, XBGR, and XRGB pixel ordering.  This is implemented with ten new\ncolorspace constants:\n\n  JCS_EXT_RGB   /* red/green/blue */\n  JCS_EXT_RGBX  /* red/green/blue/x */\n  JCS_EXT_BGR   /* blue/green/red */\n  JCS_EXT_BGRX  /* blue/green/red/x */\n  JCS_EXT_XBGR  /* x/blue/green/red */\n  JCS_EXT_XRGB  /* x/red/green/blue */\n  JCS_EXT_RGBA  /* red/green/blue/alpha */\n  JCS_EXT_BGRA  /* blue/green/red/alpha */\n  JCS_EXT_ABGR  /* alpha/blue/green/red */\n  JCS_EXT_ARGB  /* alpha/red/green/blue */\n\nSetting cinfo.in_color_space (compression) or cinfo.out_color_space\n(decompression) to one of these values will cause libjpeg-turbo to read the\nred, green, and blue values from (or write them to) the appropriate position in\nthe pixel when compressing from/decompressing to an RGB buffer.\n\nYour application can check for the existence of these extensions at compile\ntime with:\n\n  #ifdef JCS_EXTENSIONS\n\nAt run time, attempting to use these extensions with a libjpeg implementation\nthat does not support them will result in a \"Bogus input colorspace\" error.\nApplications can trap this error in order to test whether run-time support is\navailable for the colorspace extensions.\n\nWhen using the RGBX, BGRX, XBGR, and XRGB colorspaces during decompression, the\nX byte is undefined, and in order to ensure the best performance, libjpeg-turbo\ncan set that byte to whatever value it wishes.  If an application expects the X\nbyte to be used as an alpha channel, then it should specify JCS_EXT_RGBA,\nJCS_EXT_BGRA, JCS_EXT_ABGR, or JCS_EXT_ARGB.  When these colorspace constants\nare used, the X byte is guaranteed to be 0xFF, which is interpreted as opaque.\n\nYour application can check for the existence of the alpha channel colorspace\nextensions at compile time with:\n\n  #ifdef JCS_ALPHA_EXTENSIONS\n\njcstest.c, located in the libjpeg-turbo source tree, demonstrates how to check\nfor the existence of the colorspace extensions at compile time and run time.\n\n===================================\nlibjpeg v7 and v8 API/ABI Emulation\n===================================\n\nWith libjpeg v7 and v8, new features were added that necessitated extending the\ncompression and decompression structures.  Unfortunately, due to the exposed\nnature of those structures, extending them also necessitated breaking backward\nABI compatibility with previous libjpeg releases.  Thus, programs that were\nbuilt to use libjpeg v7 or v8 did not work with libjpeg-turbo, since it is\nbased on the libjpeg v6b code base.  Although libjpeg v7 and v8 are still not\nas widely used as v6b, enough programs (including a few Linux distros) made\nthe switch that there was a demand to emulate the libjpeg v7 and v8 ABIs\nin libjpeg-turbo.  It should be noted, however, that this feature was added\nprimarily so that applications that had already been compiled to use libjpeg\nv7+ could take advantage of accelerated baseline JPEG encoding/decoding\nwithout recompiling.  libjpeg-turbo does not claim to support all of the\nlibjpeg v7+ features, nor to produce identical output to libjpeg v7+ in all\ncases (see below.)\n\nBy passing an argument of --with-jpeg7 or --with-jpeg8 to configure, or an\nargument of -DWITH_JPEG7=1 or -DWITH_JPEG8=1 to cmake, you can build a version\nof libjpeg-turbo that emulates the libjpeg v7 or v8 ABI, so that programs\nthat are built against libjpeg v7 or v8 can be run with libjpeg-turbo.  The\nfollowing section describes which libjpeg v7+ features are supported and which\naren't.\n\nSupport for libjpeg v7 and v8 Features:\n---------------------------------------\n\nFully supported:\n\n-- libjpeg: IDCT scaling extensions in decompressor\n   libjpeg-turbo supports IDCT scaling with scaling factors of 1/8, 1/4, 3/8,\n   1/2, 5/8, 3/4, 7/8, 9/8, 5/4, 11/8, 3/2, 13/8, 7/4, 15/8, and 2/1 (only 1/4\n   and 1/2 are SIMD-accelerated.)\n\n-- libjpeg: arithmetic coding\n\n-- libjpeg: In-memory source and destination managers\n   See notes below.\n\n-- cjpeg: Separate quality settings for luminance and chrominance\n   Note that the libpjeg v7+ API was extended to accommodate this feature only\n   for convenience purposes.  It has always been possible to implement this\n   feature with libjpeg v6b (see rdswitch.c for an example.)\n\n-- cjpeg: 32-bit BMP support\n\n-- cjpeg: -rgb option\n\n-- jpegtran: lossless cropping\n\n-- jpegtran: -perfect option\n\n-- jpegtran: forcing width/height when performing lossless crop\n\n-- rdjpgcom: -raw option\n\n-- rdjpgcom: locale awareness\n\n\nNot supported:\n\nNOTE:  As of this writing, extensive research has been conducted into the\nusefulness of DCT scaling as a means of data reduction and SmartScale as a\nmeans of quality improvement.  The reader is invited to peruse the research at\nhttp://www.libjpeg-turbo.org/About/SmartScale and draw his/her own conclusions,\nbut it is the general belief of our project that these features have not\ndemonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.\n\n-- libjpeg: DCT scaling in compressor\n   cinfo.scale_num and cinfo.scale_denom are silently ignored.\n   There is no technical reason why DCT scaling could not be supported when\n   emulating the libjpeg v7+ API/ABI, but without the SmartScale extension (see\n   below), only scaling factors of 1/2, 8/15, 4/7, 8/13, 2/3, 8/11, 4/5, and\n   8/9 would be available, which is of limited usefulness.\n\n-- libjpeg: SmartScale\n   cinfo.block_size is silently ignored.\n   SmartScale is an extension to the JPEG format that allows for DCT block\n   sizes other than 8x8.  Providing support for this new format would be\n   feasible (particularly without full acceleration.)  However, until/unless\n   the format becomes either an official industry standard or, at minimum, an\n   accepted solution in the community, we are hesitant to implement it, as\n   there is no sense of whether or how it might change in the future.  It is\n   our belief that SmartScale has not demonstrated sufficient usefulness as a\n   lossless format nor as a means of quality enhancement, and thus, our primary\n   interest in providing this feature would be as a means of supporting\n   additional DCT scaling factors.\n\n-- libjpeg: Fancy downsampling in compressor\n   cinfo.do_fancy_downsampling is silently ignored.\n   This requires the DCT scaling feature, which is not supported.\n\n-- jpegtran: Scaling\n   This requires both the DCT scaling and SmartScale features, which are not\n   supported.\n\n-- Lossless RGB JPEG files\n   This requires the SmartScale feature, which is not supported.\n\nWhat About libjpeg v9?\n----------------------\n\nlibjpeg v9 introduced yet another field to the JPEG compression structure\n(color_transform), thus making the ABI backward incompatible with that of\nlibjpeg v8.  This new field was introduced solely for the purpose of supporting\nlossless SmartScale encoding.  Further, there was actually no reason to extend\nthe API in this manner, as the color transform could have just as easily been\nactivated by way of a new JPEG colorspace constant, thus preserving backward\nABI compatibility.\n\nOur research (see link above) has shown that lossless SmartScale does not\ngenerally accomplish anything that can't already be accomplished better with\nexisting, standard lossless formats.  Thus, at this time, it is our belief that\nthere is not sufficient technical justification for software to upgrade from\nlibjpeg v8 to libjpeg v9, and therefore, not sufficient technical justification\nfor us to emulate the libjpeg v9 ABI.\n\n=====================================\nIn-Memory Source/Destination Managers\n=====================================\n\nBy default, libjpeg-turbo 1.3 and later includes the jpeg_mem_src() and\njpeg_mem_dest() functions, even when not emulating the libjpeg v8 API/ABI.\nPreviously, it was necessary to build libjpeg-turbo from source with libjpeg v8\nAPI/ABI emulation in order to use the in-memory source/destination managers,\nbut several projects requested that those functions be included when emulating\nthe libjpeg v6b API/ABI as well.  This allows the use of those functions by\nprograms that need them without breaking ABI compatibility for programs that\ndon't, and it allows those functions to be provided in the \"official\"\nlibjpeg-turbo binaries.\n\nThose who are concerned about maintaining strict conformance with the libjpeg\nv6b or v7 API can pass an argument of --without-mem-srcdst to configure or\nan argument of -DWITH_MEM_SRCDST=0 to CMake prior to building libjpeg-turbo.\nThis will restore the pre-1.3 behavior, in which jpeg_mem_src() and\njpeg_mem_dest() are only included when emulating the libjpeg v8 API/ABI.\n\nOn Un*x systems, including the in-memory source/destination managers changes\nthe dynamic library version from 62.0.0 to 62.1.0 if using libjpeg v6b API/ABI\nemulation and from 7.0.0 to 7.1.0 if using libjpeg v7 API/ABI emulation.\n\nNote that, on most Un*x systems, the dynamic linker will not look for a\nfunction in a library until that function is actually used.  Thus, if a program\nis built against libjpeg-turbo 1.3+ and uses jpeg_mem_src() or jpeg_mem_dest(),\nthat program will not fail if run against an older version of libjpeg-turbo or\nagainst libjpeg v7- until the program actually tries to call jpeg_mem_src() or\njpeg_mem_dest().  Such is not the case on Windows.  If a program is built\nagainst the libjpeg-turbo 1.3+ DLL and uses jpeg_mem_src() or jpeg_mem_dest(),\nthen it must use the libjpeg-turbo 1.3+ DLL at run time.\n\nBoth cjpeg and djpeg have been extended to allow testing the in-memory\nsource/destination manager functions.  See their respective man pages for more\ndetails.\n\n\n*******************************************************************************\n**     Mathematical Compatibility\n*******************************************************************************\n\nFor the most part, libjpeg-turbo should produce identical output to libjpeg\nv6b.  The one exception to this is when using the floating point DCT/IDCT, in\nwhich case the outputs of libjpeg v6b and libjpeg-turbo are not guaranteed to\nbe identical (the accuracy of the floating point DCT/IDCT is constant when\nusing libjpeg-turbo's SIMD extensions, but otherwise, it can depend heavily on\nthe compiler and compiler settings.)\n\nWhile libjpeg-turbo does emulate the libjpeg v8 API/ABI, under the hood, it is\nstill using the same algorithms as libjpeg v6b, so there are several specific\ncases in which libjpeg-turbo cannot be expected to produce the same output as\nlibjpeg v8:\n\n-- When decompressing using scaling factors of 1/2 and 1/4, because libjpeg v8\n   implements those scaling algorithms a bit differently than libjpeg v6b does,\n   and libjpeg-turbo's SIMD extensions are based on the libjpeg v6b behavior.\n\n-- When using chrominance subsampling, because libjpeg v8 implements this\n   with its DCT/IDCT scaling algorithms rather than with a separate\n   downsampling/upsampling algorithm.\n\n-- When using the floating point IDCT, for the reasons stated above and also\n   because the floating point IDCT algorithm was modified in libjpeg v8a to\n   improve accuracy.\n\n-- When decompressing using a scaling factor > 1 and merged (AKA \"non-fancy\" or\n   \"non-smooth\") chrominance upsampling, because libjpeg v8 does not support\n   merged upsampling with scaling factors > 1.\n\n\n*******************************************************************************\n**     Performance Pitfalls\n*******************************************************************************\n\n===============\nRestart Markers\n===============\n\nThe optimized Huffman decoder in libjpeg-turbo does not handle restart markers\nin a way that makes the rest of the libjpeg infrastructure happy, so it is\nnecessary to use the slow Huffman decoder when decompressing a JPEG image that\nhas restart markers.  This can cause the decompression performance to drop by\nas much as 20%, but the performance will still be much greater than that of\nlibjpeg.  Many consumer packages, such as PhotoShop, use restart markers when\ngenerating JPEG images, so images generated by those programs will experience\nthis issue.\n\n===============================================\nFast Integer Forward DCT at High Quality Levels\n===============================================\n\nThe algorithm used by the SIMD-accelerated quantization function cannot produce\ncorrect results whenever the fast integer forward DCT is used along with a JPEG\nquality of 98-100.  Thus, libjpeg-turbo must use the non-SIMD quantization\nfunction in those cases.  This causes performance to drop by as much as 40%.\nIt is therefore strongly advised that you use the slow integer forward DCT\nwhenever encoding images with a JPEG quality of 98 or higher.\n"
  },
  {
    "path": "ext/libjpeg-turbo/acinclude.m4",
    "content": "# AC_PROG_NASM\n# --------------------------\n# Check that NASM exists and determine flags\nAC_DEFUN([AC_PROG_NASM],[\n\nAC_CHECK_PROGS(NASM, [nasm nasmw yasm])\ntest -z \"$NASM\" && AC_MSG_ERROR([no nasm (Netwide Assembler) found])\n\nAC_MSG_CHECKING([for object file format of host system])\ncase \"$host_os\" in\n  cygwin* | mingw* | pw32* | interix*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='Win64-COFF'\n        ;;\n      *)\n        objfmt='Win32-COFF'\n        ;;\n    esac\n  ;;\n  msdosdjgpp* | go32*)\n    objfmt='COFF'\n  ;;\n  os2-emx*)\t\t\t# not tested\n    objfmt='MSOMF'\t\t# obj\n  ;;\n  linux*coff* | linux*oldld*)\n    objfmt='COFF'\t\t# ???\n  ;;\n  linux*aout*)\n    objfmt='a.out'\n  ;;\n  linux*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='ELF64'\n        ;;\n      *)\n        objfmt='ELF'\n        ;;\n    esac\n  ;;\n  kfreebsd* | freebsd* | netbsd* | openbsd*)\n    if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then\n      objfmt='BSD-a.out'\n    else\n      case \"$host_cpu\" in\n        x86_64 | amd64)\n          objfmt='ELF64'\n          ;;\n        *)\n          objfmt='ELF'\n          ;;\n      esac\n    fi\n  ;;\n  solaris* | sunos* | sysv* | sco*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='ELF64'\n        ;;\n      *)\n        objfmt='ELF'\n        ;;\n    esac\n  ;;\n  darwin* | rhapsody* | nextstep* | openstep* | macos*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='Mach-O64'\n        ;;\n      *)\n        objfmt='Mach-O'\n        ;;\n    esac\n  ;;\n  *)\n    objfmt='ELF ?'\n  ;;\nesac\n\nAC_MSG_RESULT([$objfmt])\nif test \"$objfmt\" = 'ELF ?'; then\n  objfmt='ELF'\n  AC_MSG_WARN([unexpected host system. assumed that the format is $objfmt.])\nfi\n\nAC_MSG_CHECKING([for object file format specifier (NAFLAGS) ])\ncase \"$objfmt\" in\n  MSOMF)      NAFLAGS='-fobj -DOBJ32';;\n  Win32-COFF) NAFLAGS='-fwin32 -DWIN32';;\n  Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';;\n  COFF)       NAFLAGS='-fcoff -DCOFF';;\n  a.out)      NAFLAGS='-faout -DAOUT';;\n  BSD-a.out)  NAFLAGS='-faoutb -DAOUT';;\n  ELF)        NAFLAGS='-felf -DELF';;\n  ELF64)      NAFLAGS='-felf64 -DELF -D__x86_64__';;\n  RDF)        NAFLAGS='-frdf -DRDF';;\n  Mach-O)     NAFLAGS='-fmacho -DMACHO';;\n  Mach-O64)   NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';;\nesac\nAC_MSG_RESULT([$NAFLAGS])\nAC_SUBST([NAFLAGS])\n\nAC_MSG_CHECKING([whether the assembler ($NASM $NAFLAGS) works])\ncat > conftest.asm <<EOF\n[%line __oline__ \"configure\"\n        section .text\n        global  _main,main\n_main:\nmain:   xor     eax,eax\n        ret\n]EOF\ntry_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'\nif AC_TRY_EVAL(try_nasm) && test -s conftest.o; then\n  AC_MSG_RESULT(yes)\nelse\n  echo \"configure: failed program was:\" >&AC_FD_CC\n  cat conftest.asm >&AC_FD_CC\n  rm -rf conftest*\n  AC_MSG_RESULT(no)\n  AC_MSG_ERROR([installation or configuration problem: assembler cannot create object files.])\nfi\n\nAC_MSG_CHECKING([whether the linker accepts assembler output])\ntry_nasm='${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.o $LIBS 1>&AC_FD_CC'\nif AC_TRY_EVAL(try_nasm) && test -s conftest${ac_exeext}; then\n  rm -rf conftest*\n  AC_MSG_RESULT(yes)\nelse\n  rm -rf conftest*\n  AC_MSG_RESULT(no)\n  AC_MSG_ERROR([configuration problem: maybe object file format mismatch.])\nfi\n\n])\n\n# AC_CHECK_COMPATIBLE_ARM_ASSEMBLER_IFELSE\n# --------------------------\n# Test whether the assembler is suitable and supports NEON instructions\nAC_DEFUN([AC_CHECK_COMPATIBLE_ARM_ASSEMBLER_IFELSE],[\n  ac_good_gnu_arm_assembler=no\n  ac_save_CC=\"$CC\"\n  ac_save_CFLAGS=\"$CFLAGS\"\n  CFLAGS=\"$CCASFLAGS -x assembler-with-cpp\"\n  CC=\"$CCAS\"\n  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[\n    .text\n    .fpu neon\n    .arch armv7a\n    .object_arch armv4\n    .arm\n    pld [r0]\n    vmovn.u16 d0, q0]])], ac_good_gnu_arm_assembler=yes)\n\n  ac_use_gas_preprocessor=no\n  if test \"x$ac_good_gnu_arm_assembler\" = \"xno\" ; then\n    CC=\"gas-preprocessor.pl $CCAS\"\n    AC_COMPILE_IFELSE([AC_LANG_SOURCE([[\n      .text\n      .fpu neon\n      .arch armv7a\n      .object_arch armv4\n      .arm\n      pld [r0]\n      vmovn.u16 d0, q0]])], ac_use_gas_preprocessor=yes)\n  fi\n  CFLAGS=\"$ac_save_CFLAGS\"\n  CC=\"$ac_save_CC\"\n\n  if test \"x$ac_use_gas_preprocessor\" = \"xyes\" ; then\n    CCAS=\"gas-preprocessor.pl $CCAS\"\n    AC_SUBST([CCAS])\n    ac_good_gnu_arm_assembler=yes\n  fi\n\n  if test \"x$ac_good_gnu_arm_assembler\" = \"xyes\" ; then\n    $1\n  else\n    $2\n  fi\n])\n"
  },
  {
    "path": "ext/libjpeg-turbo/aclocal.m4",
    "content": "# generated automatically by aclocal 1.9.2 -*- Autoconf -*-\n\n# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004\n# Free Software Foundation, Inc.\n# This file is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-\n\n# serial 47 AC_PROG_LIBTOOL\n\n\n# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)\n# -----------------------------------------------------------\n# If this macro is not defined by Autoconf, define it here.\nm4_ifdef([AC_PROVIDE_IFELSE],\n         [],\n         [m4_define([AC_PROVIDE_IFELSE],\n\t         [m4_ifdef([AC_PROVIDE_$1],\n\t\t           [$2], [$3])])])\n\n\n# AC_PROG_LIBTOOL\n# ---------------\nAC_DEFUN([AC_PROG_LIBTOOL],\n[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl\ndnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX\ndnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.\n  AC_PROVIDE_IFELSE([AC_PROG_CXX],\n    [AC_LIBTOOL_CXX],\n    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX\n  ])])\ndnl And a similar setup for Fortran 77 support\n  AC_PROVIDE_IFELSE([AC_PROG_F77],\n    [AC_LIBTOOL_F77],\n    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77\n])])\n\ndnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.\ndnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run\ndnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.\n  AC_PROVIDE_IFELSE([AC_PROG_GCJ],\n    [AC_LIBTOOL_GCJ],\n    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],\n      [AC_LIBTOOL_GCJ],\n      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],\n\t[AC_LIBTOOL_GCJ],\n      [ifdef([AC_PROG_GCJ],\n\t     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])\n       ifdef([A][M_PROG_GCJ],\n\t     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])\n       ifdef([LT_AC_PROG_GCJ],\n\t     [define([LT_AC_PROG_GCJ],\n\t\tdefn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])\n])])# AC_PROG_LIBTOOL\n\n\n# _AC_PROG_LIBTOOL\n# ----------------\nAC_DEFUN([_AC_PROG_LIBTOOL],\n[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl\nAC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl\nAC_BEFORE([$0],[AC_LIBTOOL_F77])dnl\nAC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl\n\n# This can be used to rebuild libtool when needed\nLIBTOOL_DEPS=\"$ac_aux_dir/ltmain.sh\"\n\n# Always use our own libtool.\nLIBTOOL='$(SHELL) $(top_builddir)/libtool'\nAC_SUBST(LIBTOOL)dnl\n\n# Prevent multiple expansion\ndefine([AC_PROG_LIBTOOL], [])\n])# _AC_PROG_LIBTOOL\n\n\n# AC_LIBTOOL_SETUP\n# ----------------\nAC_DEFUN([AC_LIBTOOL_SETUP],\n[AC_PREREQ(2.50)dnl\nAC_REQUIRE([AC_ENABLE_SHARED])dnl\nAC_REQUIRE([AC_ENABLE_STATIC])dnl\nAC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl\nAC_REQUIRE([AC_CANONICAL_HOST])dnl\nAC_REQUIRE([AC_CANONICAL_BUILD])dnl\nAC_REQUIRE([AC_PROG_CC])dnl\nAC_REQUIRE([AC_PROG_LD])dnl\nAC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl\nAC_REQUIRE([AC_PROG_NM])dnl\n\nAC_REQUIRE([AC_PROG_LN_S])dnl\nAC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl\n# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!\nAC_REQUIRE([AC_OBJEXT])dnl\nAC_REQUIRE([AC_EXEEXT])dnl\ndnl\n\nAC_LIBTOOL_SYS_MAX_CMD_LEN\nAC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE\nAC_LIBTOOL_OBJDIR\n\nAC_REQUIRE([_LT_AC_SYS_COMPILER])dnl\n_LT_AC_PROG_ECHO_BACKSLASH\n\ncase $host_os in\naix3*)\n  # AIX sometimes has problems with the GCC collect2 program.  For some\n  # reason, if we set the COLLECT_NAMES environment variable, the problems\n  # vanish in a puff of smoke.\n  if test \"X${COLLECT_NAMES+set}\" != Xset; then\n    COLLECT_NAMES=\n    export COLLECT_NAMES\n  fi\n  ;;\nesac\n\n# Sed substitution that helps us do robust quoting.  It backslashifies\n# metacharacters that are still active within double-quoted strings.\nXsed='sed -e s/^X//'\n[sed_quote_subst='s/\\([\\\\\"\\\\`$\\\\\\\\]\\)/\\\\\\1/g']\n\n# Same as above, but do not quote variable references.\n[double_quote_subst='s/\\([\\\\\"\\\\`\\\\\\\\]\\)/\\\\\\1/g']\n\n# Sed substitution to delay expansion of an escaped shell variable in a\n# double_quote_subst'ed string.\ndelay_variable_subst='s/\\\\\\\\\\\\\\\\\\\\\\$/\\\\\\\\\\\\$/g'\n\n# Sed substitution to avoid accidental globbing in evaled expressions\nno_glob_subst='s/\\*/\\\\\\*/g'\n\n# Constants:\nrm=\"rm -f\"\n\n# Global variables:\ndefault_ofile=libtool\ncan_build_shared=yes\n\n# All known linkers require a `.a' archive for static linking (except M$VC,\n# which needs '.lib').\nlibext=a\nltmain=\"$ac_aux_dir/ltmain.sh\"\nofile=\"$default_ofile\"\nwith_gnu_ld=\"$lt_cv_prog_gnu_ld\"\n\nAC_CHECK_TOOL(AR, ar, false)\nAC_CHECK_TOOL(RANLIB, ranlib, :)\nAC_CHECK_TOOL(STRIP, strip, :)\n\nold_CC=\"$CC\"\nold_CFLAGS=\"$CFLAGS\"\n\n# Set sane defaults for various variables\ntest -z \"$AR\" && AR=ar\ntest -z \"$AR_FLAGS\" && AR_FLAGS=cru\ntest -z \"$AS\" && AS=as\ntest -z \"$CC\" && CC=cc\ntest -z \"$LTCC\" && LTCC=$CC\ntest -z \"$DLLTOOL\" && DLLTOOL=dlltool\ntest -z \"$LD\" && LD=ld\ntest -z \"$LN_S\" && LN_S=\"ln -s\"\ntest -z \"$MAGIC_CMD\" && MAGIC_CMD=file\ntest -z \"$NM\" && NM=nm\ntest -z \"$SED\" && SED=sed\ntest -z \"$OBJDUMP\" && OBJDUMP=objdump\ntest -z \"$RANLIB\" && RANLIB=:\ntest -z \"$STRIP\" && STRIP=:\ntest -z \"$ac_objext\" && ac_objext=o\n\n# Determine commands to create old-style static archives.\nold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'\nold_postinstall_cmds='chmod 644 $oldlib'\nold_postuninstall_cmds=\n\nif test -n \"$RANLIB\"; then\n  case $host_os in\n  openbsd*)\n    old_postinstall_cmds=\"\\$RANLIB -t \\$oldlib~$old_postinstall_cmds\"\n    ;;\n  *)\n    old_postinstall_cmds=\"\\$RANLIB \\$oldlib~$old_postinstall_cmds\"\n    ;;\n  esac\n  old_archive_cmds=\"$old_archive_cmds~\\$RANLIB \\$oldlib\"\nfi\n\n# Only perform the check for file, if the check method requires it\ncase $deplibs_check_method in\nfile_magic*)\n  if test \"$file_magic_cmd\" = '$MAGIC_CMD'; then\n    AC_PATH_MAGIC\n  fi\n  ;;\nesac\n\nAC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)\nAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],\nenable_win32_dll=yes, enable_win32_dll=no)\n\nAC_ARG_ENABLE([libtool-lock],\n    [AC_HELP_STRING([--disable-libtool-lock],\n\t[avoid locking (might break parallel builds)])])\ntest \"x$enable_libtool_lock\" != xno && enable_libtool_lock=yes\n\nAC_ARG_WITH([pic],\n    [AC_HELP_STRING([--with-pic],\n\t[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],\n    [pic_mode=\"$withval\"],\n    [pic_mode=default])\ntest -z \"$pic_mode\" && pic_mode=default\n\n# Use C for the default configuration in the libtool script\ntagname=\nAC_LIBTOOL_LANG_C_CONFIG\n_LT_AC_TAGCONFIG\n])# AC_LIBTOOL_SETUP\n\n\n# _LT_AC_SYS_COMPILER\n# -------------------\nAC_DEFUN([_LT_AC_SYS_COMPILER],\n[AC_REQUIRE([AC_PROG_CC])dnl\n\n# If no C compiler was specified, use CC.\nLTCC=${LTCC-\"$CC\"}\n\n# Allow CC to be a program name with arguments.\ncompiler=$CC\n])# _LT_AC_SYS_COMPILER\n\n\n# _LT_AC_SYS_LIBPATH_AIX\n# ----------------------\n# Links a minimal program and checks the executable\n# for the system default hardcoded library path. In most cases,\n# this is /usr/lib:/lib, but when the MPI compilers are used\n# the location of the communication and MPI libs are included too.\n# If we don't find anything, use the default library path according\n# to the aix ld manual.\nAC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],\n[AC_LINK_IFELSE(AC_LANG_PROGRAM,[\naix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\\(.*\\)$/\\1/; p; }\n}'`\n# Check for a 64-bit object if we didn't find anything.\nif test -z \"$aix_libpath\"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\\(.*\\)$/\\1/; p; }\n}'`; fi],[])\nif test -z \"$aix_libpath\"; then aix_libpath=\"/usr/lib:/lib\"; fi\n])# _LT_AC_SYS_LIBPATH_AIX\n\n\n# _LT_AC_SHELL_INIT(ARG)\n# ----------------------\nAC_DEFUN([_LT_AC_SHELL_INIT],\n[ifdef([AC_DIVERSION_NOTICE],\n\t     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],\n\t [AC_DIVERT_PUSH(NOTICE)])\n$1\nAC_DIVERT_POP\n])# _LT_AC_SHELL_INIT\n\n\n# _LT_AC_PROG_ECHO_BACKSLASH\n# --------------------------\n# Add some code to the start of the generated configure script which\n# will find an echo command which doesn't interpret backslashes.\nAC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],\n[_LT_AC_SHELL_INIT([\n# Check that we are running under the correct shell.\nSHELL=${CONFIG_SHELL-/bin/sh}\n\ncase X$ECHO in\nX*--fallback-echo)\n  # Remove one level of quotation (which was required for Make).\n  ECHO=`echo \"$ECHO\" | sed 's,\\\\\\\\\\[$]\\\\[$]0,'[$]0','`\n  ;;\nesac\n\necho=${ECHO-echo}\nif test \"X[$]1\" = X--no-reexec; then\n  # Discard the --no-reexec flag, and continue.\n  shift\nelif test \"X[$]1\" = X--fallback-echo; then\n  # Avoid inline document here, it may be left over\n  :\nelif test \"X`($echo '\\t') 2>/dev/null`\" = 'X\\t' ; then\n  # Yippee, $echo works!\n  :\nelse\n  # Restart under the correct shell.\n  exec $SHELL \"[$]0\" --no-reexec ${1+\"[$]@\"}\nfi\n\nif test \"X[$]1\" = X--fallback-echo; then\n  # used as fallback echo\n  shift\n  cat <<EOF\n[$]*\nEOF\n  exit 0\nfi\n\n# The HP-UX ksh and POSIX shell print the target directory to stdout\n# if CDPATH is set.\nif test \"X${CDPATH+set}\" = Xset; then CDPATH=:; export CDPATH; fi\n\nif test -z \"$ECHO\"; then\nif test \"X${echo_test_string+set}\" != Xset; then\n# find a string as large as possible, as long as the shell can cope with it\n  for cmd in 'sed 50q \"[$]0\"' 'sed 20q \"[$]0\"' 'sed 10q \"[$]0\"' 'sed 2q \"[$]0\"' 'echo test'; do\n    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...\n    if (echo_test_string=\"`eval $cmd`\") 2>/dev/null &&\n       echo_test_string=\"`eval $cmd`\" &&\n       (test \"X$echo_test_string\" = \"X$echo_test_string\") 2>/dev/null\n    then\n      break\n    fi\n  done\nfi\n\nif test \"X`($echo '\\t') 2>/dev/null`\" = 'X\\t' &&\n   echo_testing_string=`($echo \"$echo_test_string\") 2>/dev/null` &&\n   test \"X$echo_testing_string\" = \"X$echo_test_string\"; then\n  :\nelse\n  # The Solaris, AIX, and Digital Unix default echo programs unquote\n  # backslashes.  This makes it impossible to quote backslashes using\n  #   echo \"$something\" | sed 's/\\\\/\\\\\\\\/g'\n  #\n  # So, first we look for a working echo in the user's PATH.\n\n  lt_save_ifs=\"$IFS\"; IFS=$PATH_SEPARATOR\n  for dir in $PATH /usr/ucb; do\n    IFS=\"$lt_save_ifs\"\n    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&\n       test \"X`($dir/echo '\\t') 2>/dev/null`\" = 'X\\t' &&\n       echo_testing_string=`($dir/echo \"$echo_test_string\") 2>/dev/null` &&\n       test \"X$echo_testing_string\" = \"X$echo_test_string\"; then\n      echo=\"$dir/echo\"\n      break\n    fi\n  done\n  IFS=\"$lt_save_ifs\"\n\n  if test \"X$echo\" = Xecho; then\n    # We didn't find a better echo, so look for alternatives.\n    if test \"X`(print -r '\\t') 2>/dev/null`\" = 'X\\t' &&\n       echo_testing_string=`(print -r \"$echo_test_string\") 2>/dev/null` &&\n       test \"X$echo_testing_string\" = \"X$echo_test_string\"; then\n      # This shell has a builtin print -r that does the trick.\n      echo='print -r'\n    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&\n\t test \"X$CONFIG_SHELL\" != X/bin/ksh; then\n      # If we have ksh, try running configure again with it.\n      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}\n      export ORIGINAL_CONFIG_SHELL\n      CONFIG_SHELL=/bin/ksh\n      export CONFIG_SHELL\n      exec $CONFIG_SHELL \"[$]0\" --no-reexec ${1+\"[$]@\"}\n    else\n      # Try using printf.\n      echo='printf %s\\n'\n      if test \"X`($echo '\\t') 2>/dev/null`\" = 'X\\t' &&\n\t echo_testing_string=`($echo \"$echo_test_string\") 2>/dev/null` &&\n\t test \"X$echo_testing_string\" = \"X$echo_test_string\"; then\n\t# Cool, printf works\n\t:\n      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL \"[$]0\" --fallback-echo '\\t') 2>/dev/null` &&\n\t   test \"X$echo_testing_string\" = 'X\\t' &&\n\t   echo_testing_string=`($ORIGINAL_CONFIG_SHELL \"[$]0\" --fallback-echo \"$echo_test_string\") 2>/dev/null` &&\n\t   test \"X$echo_testing_string\" = \"X$echo_test_string\"; then\n\tCONFIG_SHELL=$ORIGINAL_CONFIG_SHELL\n\texport CONFIG_SHELL\n\tSHELL=\"$CONFIG_SHELL\"\n\texport SHELL\n\techo=\"$CONFIG_SHELL [$]0 --fallback-echo\"\n      elif echo_testing_string=`($CONFIG_SHELL \"[$]0\" --fallback-echo '\\t') 2>/dev/null` &&\n\t   test \"X$echo_testing_string\" = 'X\\t' &&\n\t   echo_testing_string=`($CONFIG_SHELL \"[$]0\" --fallback-echo \"$echo_test_string\") 2>/dev/null` &&\n\t   test \"X$echo_testing_string\" = \"X$echo_test_string\"; then\n\techo=\"$CONFIG_SHELL [$]0 --fallback-echo\"\n      else\n\t# maybe with a smaller string...\n\tprev=:\n\n\tfor cmd in 'echo test' 'sed 2q \"[$]0\"' 'sed 10q \"[$]0\"' 'sed 20q \"[$]0\"' 'sed 50q \"[$]0\"'; do\n\t  if (test \"X$echo_test_string\" = \"X`eval $cmd`\") 2>/dev/null\n\t  then\n\t    break\n\t  fi\n\t  prev=\"$cmd\"\n\tdone\n\n\tif test \"$prev\" != 'sed 50q \"[$]0\"'; then\n\t  echo_test_string=`eval $prev`\n\t  export echo_test_string\n\t  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} \"[$]0\" ${1+\"[$]@\"}\n\telse\n\t  # Oops.  We lost completely, so just stick with echo.\n\t  echo=echo\n\tfi\n      fi\n    fi\n  fi\nfi\nfi\n\n# Copy echo and quote the copy suitably for passing to libtool from\n# the Makefile, instead of quoting the original, which is used later.\nECHO=$echo\nif test \"X$ECHO\" = \"X$CONFIG_SHELL [$]0 --fallback-echo\"; then\n   ECHO=\"$CONFIG_SHELL \\\\\\$\\[$]0 --fallback-echo\"\nfi\n\nAC_SUBST(ECHO)\n])])# _LT_AC_PROG_ECHO_BACKSLASH\n\n\n# _LT_AC_LOCK\n# -----------\nAC_DEFUN([_LT_AC_LOCK],\n[AC_ARG_ENABLE([libtool-lock],\n    [AC_HELP_STRING([--disable-libtool-lock],\n\t[avoid locking (might break parallel builds)])])\ntest \"x$enable_libtool_lock\" != xno && enable_libtool_lock=yes\n\n# Some flags need to be propagated to the compiler or linker for good\n# libtool support.\ncase $host in\nia64-*-hpux*)\n  # Find out which ABI we are using.\n  echo 'int i;' > conftest.$ac_ext\n  if AC_TRY_EVAL(ac_compile); then\n    case `/usr/bin/file conftest.$ac_objext` in\n    *ELF-32*)\n      HPUX_IA64_MODE=\"32\"\n      ;;\n    *ELF-64*)\n      HPUX_IA64_MODE=\"64\"\n      ;;\n    esac\n  fi\n  rm -rf conftest*\n  ;;\n*-*-irix6*)\n  # Find out which ABI we are using.\n  echo '[#]line __oline__ \"configure\"' > conftest.$ac_ext\n  if AC_TRY_EVAL(ac_compile); then\n   if test \"$lt_cv_prog_gnu_ld\" = yes; then\n    case `/usr/bin/file conftest.$ac_objext` in\n    *32-bit*)\n      LD=\"${LD-ld} -melf32bsmip\"\n      ;;\n    *N32*)\n      LD=\"${LD-ld} -melf32bmipn32\"\n      ;;\n    *64-bit*)\n      LD=\"${LD-ld} -melf64bmip\"\n      ;;\n    esac\n   else\n    case `/usr/bin/file conftest.$ac_objext` in\n    *32-bit*)\n      LD=\"${LD-ld} -32\"\n      ;;\n    *N32*)\n      LD=\"${LD-ld} -n32\"\n      ;;\n    *64-bit*)\n      LD=\"${LD-ld} -64\"\n      ;;\n    esac\n   fi\n  fi\n  rm -rf conftest*\n  ;;\n\nx86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)\n  # Find out which ABI we are using.\n  echo 'int i;' > conftest.$ac_ext\n  if AC_TRY_EVAL(ac_compile); then\n    case \"`/usr/bin/file conftest.o`\" in\n    *32-bit*)\n      case $host in\n        x86_64-*linux*)\n          LD=\"${LD-ld} -m elf_i386\"\n          ;;\n        ppc64-*linux*|powerpc64-*linux*)\n          LD=\"${LD-ld} -m elf32ppclinux\"\n          ;;\n        s390x-*linux*)\n          LD=\"${LD-ld} -m elf_s390\"\n          ;;\n        sparc64-*linux*)\n          LD=\"${LD-ld} -m elf32_sparc\"\n          ;;\n      esac\n      ;;\n    *64-bit*)\n      case $host in\n        x86_64-*linux*)\n          LD=\"${LD-ld} -m elf_x86_64\"\n          ;;\n        ppc*-*linux*|powerpc*-*linux*)\n          LD=\"${LD-ld} -m elf64ppc\"\n          ;;\n        s390*-*linux*)\n          LD=\"${LD-ld} -m elf64_s390\"\n          ;;\n        sparc*-*linux*)\n          LD=\"${LD-ld} -m elf64_sparc\"\n          ;;\n      esac\n      ;;\n    esac\n  fi\n  rm -rf conftest*\n  ;;\n\n*-*-sco3.2v5*)\n  # On SCO OpenServer 5, we need -belf to get full-featured binaries.\n  SAVE_CFLAGS=\"$CFLAGS\"\n  CFLAGS=\"$CFLAGS -belf\"\n  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,\n    [AC_LANG_PUSH(C)\n     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])\n     AC_LANG_POP])\n  if test x\"$lt_cv_cc_needs_belf\" != x\"yes\"; then\n    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf\n    CFLAGS=\"$SAVE_CFLAGS\"\n  fi\n  ;;\nAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],\n[*-*-cygwin* | *-*-mingw* | *-*-pw32*)\n  AC_CHECK_TOOL(DLLTOOL, dlltool, false)\n  AC_CHECK_TOOL(AS, as, false)\n  AC_CHECK_TOOL(OBJDUMP, objdump, false)\n  ;;\n  ])\nesac\n\nneed_locks=\"$enable_libtool_lock\"\n\n])# _LT_AC_LOCK\n\n\n# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,\n#\t\t[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])\n# ----------------------------------------------------------------\n# Check whether the given compiler option works\nAC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],\n[AC_REQUIRE([LT_AC_PROG_SED])\nAC_CACHE_CHECK([$1], [$2],\n  [$2=no\n  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])\n   printf \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n   lt_compiler_flag=\"$3\"\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   # The option is referenced via a variable to avoid confusing sed.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \\\n   -e 's: [[^ ]]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:__oline__: $lt_compile\\\"\" >&AS_MESSAGE_LOG_FD)\n   (eval \"$lt_compile\" 2>conftest.err)\n   ac_status=$?\n   cat conftest.err >&AS_MESSAGE_LOG_FD\n   echo \"$as_me:__oline__: \\$? = $ac_status\" >&AS_MESSAGE_LOG_FD\n   if (exit $ac_status) && test -s \"$ac_outfile\"; then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     if test ! -s conftest.err; then\n       $2=yes\n     fi\n   fi\n   $rm conftest*\n])\n\nif test x\"[$]$2\" = xyes; then\n    ifelse([$5], , :, [$5])\nelse\n    ifelse([$6], , :, [$6])\nfi\n])# AC_LIBTOOL_COMPILER_OPTION\n\n\n# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,\n#                          [ACTION-SUCCESS], [ACTION-FAILURE])\n# ------------------------------------------------------------\n# Check whether the given compiler option works\nAC_DEFUN([AC_LIBTOOL_LINKER_OPTION],\n[AC_CACHE_CHECK([$1], [$2],\n  [$2=no\n   save_LDFLAGS=\"$LDFLAGS\"\n   LDFLAGS=\"$LDFLAGS $3\"\n   printf \"$lt_simple_link_test_code\" > conftest.$ac_ext\n   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     if test -s conftest.err; then\n       # Append any errors to the config.log.\n       cat conftest.err 1>&AS_MESSAGE_LOG_FD\n     else\n       $2=yes\n     fi\n   fi\n   $rm conftest*\n   LDFLAGS=\"$save_LDFLAGS\"\n])\n\nif test x\"[$]$2\" = xyes; then\n    ifelse([$4], , :, [$4])\nelse\n    ifelse([$5], , :, [$5])\nfi\n])# AC_LIBTOOL_LINKER_OPTION\n\n\n# AC_LIBTOOL_SYS_MAX_CMD_LEN\n# --------------------------\nAC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],\n[# find the maximum length of command line arguments\nAC_MSG_CHECKING([the maximum length of command line arguments])\nAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl\n  i=0\n  teststring=\"ABCD\"\n\n  case $build_os in\n  msdosdjgpp*)\n    # On DJGPP, this test can blow up pretty badly due to problems in libc\n    # (any single argument exceeding 2000 bytes causes a buffer overrun\n    # during glob expansion).  Even if it were fixed, the result of this\n    # check would be larger than it should be.\n    lt_cv_sys_max_cmd_len=12288;    # 12K is about right\n    ;;\n\n  gnu*)\n    # Under GNU Hurd, this test is not required because there is\n    # no limit to the length of command line arguments.\n    # Libtool will interpret -1 as no limit whatsoever\n    lt_cv_sys_max_cmd_len=-1;\n    ;;\n\n  cygwin* | mingw*)\n    # On Win9x/ME, this test blows up -- it succeeds, but takes\n    # about 5 minutes as the teststring grows exponentially.\n    # Worse, since 9x/ME are not pre-emptively multitasking,\n    # you end up with a \"frozen\" computer, even though with patience\n    # the test eventually succeeds (with a max line length of 256k).\n    # Instead, let's just punt: use the minimum linelength reported by\n    # all of the supported platforms: 8192 (on NT/2K/XP).\n    lt_cv_sys_max_cmd_len=8192;\n    ;;\n\n  amigaos*)\n    # On AmigaOS with pdksh, this test takes hours, literally.\n    # So we just punt and use a minimum line length of 8192.\n    lt_cv_sys_max_cmd_len=8192;\n    ;;\n\n *)\n    # If test is not a shell built-in, we'll probably end up computing a\n    # maximum length that is only half of the actual maximum length, but\n    # we can't tell.\n    while (test \"X\"`$CONFIG_SHELL [$]0 --fallback-echo \"X$teststring\" 2>/dev/null` \\\n\t       = \"XX$teststring\") >/dev/null 2>&1 &&\n\t    new_result=`expr \"X$teststring\" : \".*\" 2>&1` &&\n\t    lt_cv_sys_max_cmd_len=$new_result &&\n\t    test $i != 17 # 1/2 MB should be enough\n    do\n      i=`expr $i + 1`\n      teststring=$teststring$teststring\n    done\n    teststring=\n    # Add a significant safety factor because C++ compilers can tack on massive\n    # amounts of additional arguments before passing them to the linker.\n    # It appears as though 1/2 is a usable value.\n    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \\/ 2`\n    ;;\n  esac\n])\nif test -n $lt_cv_sys_max_cmd_len ; then\n  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)\nelse\n  AC_MSG_RESULT(none)\nfi\n])# AC_LIBTOOL_SYS_MAX_CMD_LEN\n\n\n# _LT_AC_CHECK_DLFCN\n# --------------------\nAC_DEFUN([_LT_AC_CHECK_DLFCN],\n[AC_CHECK_HEADERS(dlfcn.h)dnl\n])# _LT_AC_CHECK_DLFCN\n\n\n# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,\n#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)\n# ------------------------------------------------------------------\nAC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],\n[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl\nif test \"$cross_compiling\" = yes; then :\n  [$4]\nelse\n  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2\n  lt_status=$lt_dlunknown\n  cat > conftest.$ac_ext <<EOF\n[#line __oline__ \"configure\"\n#include \"confdefs.h\"\n\n#if HAVE_DLFCN_H\n#include <dlfcn.h>\n#endif\n\n#include <stdio.h>\n\n#ifdef RTLD_GLOBAL\n#  define LT_DLGLOBAL\t\tRTLD_GLOBAL\n#else\n#  ifdef DL_GLOBAL\n#    define LT_DLGLOBAL\t\tDL_GLOBAL\n#  else\n#    define LT_DLGLOBAL\t\t0\n#  endif\n#endif\n\n/* We may have to define LT_DLLAZY_OR_NOW in the command line if we\n   find out it does not work in some platform. */\n#ifndef LT_DLLAZY_OR_NOW\n#  ifdef RTLD_LAZY\n#    define LT_DLLAZY_OR_NOW\t\tRTLD_LAZY\n#  else\n#    ifdef DL_LAZY\n#      define LT_DLLAZY_OR_NOW\t\tDL_LAZY\n#    else\n#      ifdef RTLD_NOW\n#        define LT_DLLAZY_OR_NOW\tRTLD_NOW\n#      else\n#        ifdef DL_NOW\n#          define LT_DLLAZY_OR_NOW\tDL_NOW\n#        else\n#          define LT_DLLAZY_OR_NOW\t0\n#        endif\n#      endif\n#    endif\n#  endif\n#endif\n\n#ifdef __cplusplus\nextern \"C\" void exit (int);\n#endif\n\nvoid fnord() { int i=42;}\nint main ()\n{\n  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);\n  int status = $lt_dlunknown;\n\n  if (self)\n    {\n      if (dlsym (self,\"fnord\"))       status = $lt_dlno_uscore;\n      else if (dlsym( self,\"_fnord\")) status = $lt_dlneed_uscore;\n      /* dlclose (self); */\n    }\n\n    exit (status);\n}]\nEOF\n  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then\n    (./conftest; exit; ) 2>/dev/null\n    lt_status=$?\n    case x$lt_status in\n      x$lt_dlno_uscore) $1 ;;\n      x$lt_dlneed_uscore) $2 ;;\n      x$lt_unknown|x*) $3 ;;\n    esac\n  else :\n    # compilation failed\n    $3\n  fi\nfi\nrm -fr conftest*\n])# _LT_AC_TRY_DLOPEN_SELF\n\n\n# AC_LIBTOOL_DLOPEN_SELF\n# -------------------\nAC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],\n[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl\nif test \"x$enable_dlopen\" != xyes; then\n  enable_dlopen=unknown\n  enable_dlopen_self=unknown\n  enable_dlopen_self_static=unknown\nelse\n  lt_cv_dlopen=no\n  lt_cv_dlopen_libs=\n\n  case $host_os in\n  beos*)\n    lt_cv_dlopen=\"load_add_on\"\n    lt_cv_dlopen_libs=\n    lt_cv_dlopen_self=yes\n    ;;\n\n  mingw* | pw32*)\n    lt_cv_dlopen=\"LoadLibrary\"\n    lt_cv_dlopen_libs=\n   ;;\n\n  cygwin*)\n    lt_cv_dlopen=\"dlopen\"\n    lt_cv_dlopen_libs=\n   ;;\n\n  darwin*)\n  # if libdl is installed we need to link against it\n    AC_CHECK_LIB([dl], [dlopen],\n\t\t[lt_cv_dlopen=\"dlopen\" lt_cv_dlopen_libs=\"-ldl\"],[\n    lt_cv_dlopen=\"dyld\"\n    lt_cv_dlopen_libs=\n    lt_cv_dlopen_self=yes\n    ])\n   ;;\n\n  *)\n    AC_CHECK_FUNC([shl_load],\n\t  [lt_cv_dlopen=\"shl_load\"],\n      [AC_CHECK_LIB([dld], [shl_load],\n\t    [lt_cv_dlopen=\"shl_load\" lt_cv_dlopen_libs=\"-dld\"],\n\t[AC_CHECK_FUNC([dlopen],\n\t      [lt_cv_dlopen=\"dlopen\"],\n\t  [AC_CHECK_LIB([dl], [dlopen],\n\t\t[lt_cv_dlopen=\"dlopen\" lt_cv_dlopen_libs=\"-ldl\"],\n\t    [AC_CHECK_LIB([svld], [dlopen],\n\t\t  [lt_cv_dlopen=\"dlopen\" lt_cv_dlopen_libs=\"-lsvld\"],\n\t      [AC_CHECK_LIB([dld], [dld_link],\n\t\t    [lt_cv_dlopen=\"dld_link\" lt_cv_dlopen_libs=\"-dld\"])\n\t      ])\n\t    ])\n\t  ])\n\t])\n      ])\n    ;;\n  esac\n\n  if test \"x$lt_cv_dlopen\" != xno; then\n    enable_dlopen=yes\n  else\n    enable_dlopen=no\n  fi\n\n  case $lt_cv_dlopen in\n  dlopen)\n    save_CPPFLAGS=\"$CPPFLAGS\"\n    test \"x$ac_cv_header_dlfcn_h\" = xyes && CPPFLAGS=\"$CPPFLAGS -DHAVE_DLFCN_H\"\n\n    save_LDFLAGS=\"$LDFLAGS\"\n    eval LDFLAGS=\\\"\\$LDFLAGS $export_dynamic_flag_spec\\\"\n\n    save_LIBS=\"$LIBS\"\n    LIBS=\"$lt_cv_dlopen_libs $LIBS\"\n\n    AC_CACHE_CHECK([whether a program can dlopen itself],\n\t  lt_cv_dlopen_self, [dnl\n\t  _LT_AC_TRY_DLOPEN_SELF(\n\t    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,\n\t    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)\n    ])\n\n    if test \"x$lt_cv_dlopen_self\" = xyes; then\n      LDFLAGS=\"$LDFLAGS $link_static_flag\"\n      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],\n    \t  lt_cv_dlopen_self_static, [dnl\n\t  _LT_AC_TRY_DLOPEN_SELF(\n\t    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,\n\t    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)\n      ])\n    fi\n\n    CPPFLAGS=\"$save_CPPFLAGS\"\n    LDFLAGS=\"$save_LDFLAGS\"\n    LIBS=\"$save_LIBS\"\n    ;;\n  esac\n\n  case $lt_cv_dlopen_self in\n  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;\n  *) enable_dlopen_self=unknown ;;\n  esac\n\n  case $lt_cv_dlopen_self_static in\n  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;\n  *) enable_dlopen_self_static=unknown ;;\n  esac\nfi\n])# AC_LIBTOOL_DLOPEN_SELF\n\n\n# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])\n# ---------------------------------\n# Check to see if options -c and -o are simultaneously supported by compiler\nAC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],\n[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl\nAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],\n  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],\n  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no\n   $rm -r conftest 2>/dev/null\n   mkdir conftest\n   cd conftest\n   mkdir out\n   printf \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n\n   lt_compiler_flag=\"-o out/conftest2.$ac_objext\"\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \\\n   -e 's: [[^ ]]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:__oline__: $lt_compile\\\"\" >&AS_MESSAGE_LOG_FD)\n   (eval \"$lt_compile\" 2>out/conftest.err)\n   ac_status=$?\n   cat out/conftest.err >&AS_MESSAGE_LOG_FD\n   echo \"$as_me:__oline__: \\$? = $ac_status\" >&AS_MESSAGE_LOG_FD\n   if (exit $ac_status) && test -s out/conftest2.$ac_objext\n   then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     if test ! -s out/conftest.err; then\n       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes\n     fi\n   fi\n   chmod u+w .\n   $rm conftest*\n   # SGI C++ compiler will create directory out/ii_files/ for\n   # template instantiation\n   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files\n   $rm out/* && rmdir out\n   cd ..\n   rmdir conftest\n   $rm conftest*\n])\n])# AC_LIBTOOL_PROG_CC_C_O\n\n\n# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])\n# -----------------------------------------\n# Check to see if we can do hard links to lock some files if needed\nAC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],\n[AC_REQUIRE([_LT_AC_LOCK])dnl\n\nhard_links=\"nottested\"\nif test \"$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)\" = no && test \"$need_locks\" != no; then\n  # do not overwrite the value of need_locks provided by the user\n  AC_MSG_CHECKING([if we can lock with hard links])\n  hard_links=yes\n  $rm conftest*\n  ln conftest.a conftest.b 2>/dev/null && hard_links=no\n  touch conftest.a\n  ln conftest.a conftest.b 2>&5 || hard_links=no\n  ln conftest.a conftest.b 2>/dev/null && hard_links=no\n  AC_MSG_RESULT([$hard_links])\n  if test \"$hard_links\" = no; then\n    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])\n    need_locks=warn\n  fi\nelse\n  need_locks=no\nfi\n])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS\n\n\n# AC_LIBTOOL_OBJDIR\n# -----------------\nAC_DEFUN([AC_LIBTOOL_OBJDIR],\n[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],\n[rm -f .libs 2>/dev/null\nmkdir .libs 2>/dev/null\nif test -d .libs; then\n  lt_cv_objdir=.libs\nelse\n  # MS-DOS does not allow filenames that begin with a dot.\n  lt_cv_objdir=_libs\nfi\nrmdir .libs 2>/dev/null])\nobjdir=$lt_cv_objdir\n])# AC_LIBTOOL_OBJDIR\n\n\n# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])\n# ----------------------------------------------\n# Check hardcoding attributes.\nAC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],\n[AC_MSG_CHECKING([how to hardcode library paths into programs])\n_LT_AC_TAGVAR(hardcode_action, $1)=\nif test -n \"$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)\" || \\\n   test -n \"$_LT_AC_TAGVAR(runpath_var $1)\" || \\\n   test \"X$_LT_AC_TAGVAR(hardcode_automatic, $1)\"=\"Xyes\" ; then\n\n  # We can hardcode non-existant directories.\n  if test \"$_LT_AC_TAGVAR(hardcode_direct, $1)\" != no &&\n     # If the only mechanism to avoid hardcoding is shlibpath_var, we\n     # have to relink, otherwise we might link with an installed library\n     # when we should be linking with a yet-to-be-installed one\n     ## test \"$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)\" != no &&\n     test \"$_LT_AC_TAGVAR(hardcode_minus_L, $1)\" != no; then\n    # Linking always hardcodes the temporary library directory.\n    _LT_AC_TAGVAR(hardcode_action, $1)=relink\n  else\n    # We can link without hardcoding, and we can hardcode nonexisting dirs.\n    _LT_AC_TAGVAR(hardcode_action, $1)=immediate\n  fi\nelse\n  # We cannot hardcode anything, or else we can only hardcode existing\n  # directories.\n  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported\nfi\nAC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])\n\nif test \"$_LT_AC_TAGVAR(hardcode_action, $1)\" = relink; then\n  # Fast installation is not supported\n  enable_fast_install=no\nelif test \"$shlibpath_overrides_runpath\" = yes ||\n     test \"$enable_shared\" = no; then\n  # Fast installation is not necessary\n  enable_fast_install=needless\nfi\n])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH\n\n\n# AC_LIBTOOL_SYS_LIB_STRIP\n# ------------------------\nAC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],\n[striplib=\nold_striplib=\nAC_MSG_CHECKING([whether stripping libraries is possible])\nif test -n \"$STRIP\" && $STRIP -V 2>&1 | grep \"GNU strip\" >/dev/null; then\n  test -z \"$old_striplib\" && old_striplib=\"$STRIP --strip-debug\"\n  test -z \"$striplib\" && striplib=\"$STRIP --strip-unneeded\"\n  AC_MSG_RESULT([yes])\nelse\n# FIXME - insert some real tests, host_os isn't really good enough\n  case $host_os in\n   darwin*)\n       if test -n \"$STRIP\" ; then\n         striplib=\"$STRIP -x\"\n         AC_MSG_RESULT([yes])\n       else\n  AC_MSG_RESULT([no])\nfi\n       ;;\n   *)\n  AC_MSG_RESULT([no])\n    ;;\n  esac\nfi\n])# AC_LIBTOOL_SYS_LIB_STRIP\n\n\n# AC_LIBTOOL_SYS_DYNAMIC_LINKER\n# -----------------------------\n# PORTME Fill in your ld.so characteristics\nAC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],\n[AC_MSG_CHECKING([dynamic linker characteristics])\nlibrary_names_spec=\nlibname_spec='lib$name'\nsoname_spec=\nshrext_cmds=\".so\"\npostinstall_cmds=\npostuninstall_cmds=\nfinish_cmds=\nfinish_eval=\nshlibpath_var=\nshlibpath_overrides_runpath=unknown\nversion_type=none\ndynamic_linker=\"$host_os ld.so\"\nsys_lib_dlsearch_path_spec=\"/lib /usr/lib\"\nif test \"$GCC\" = yes; then\n  sys_lib_search_path_spec=`$CC -print-search-dirs | grep \"^libraries:\" | $SED -e \"s/^libraries://\" -e \"s,=/,/,g\"`\n  if echo \"$sys_lib_search_path_spec\" | grep ';' >/dev/null ; then\n    # if the path contains \";\" then we assume it to be the separator\n    # otherwise default to the standard path separator (i.e. \":\") - it is\n    # assumed that no part of a normal pathname contains \";\" but that should\n    # okay in the real world where \";\" in dirpaths is itself problematic.\n    sys_lib_search_path_spec=`echo \"$sys_lib_search_path_spec\" | $SED -e 's/;/ /g'`\n  else\n    sys_lib_search_path_spec=`echo \"$sys_lib_search_path_spec\" | $SED  -e \"s/$PATH_SEPARATOR/ /g\"`\n  fi\nelse\n  sys_lib_search_path_spec=\"/lib /usr/lib /usr/local/lib\"\nfi\nneed_lib_prefix=unknown\nhardcode_into_libs=no\n\n# when you set need_version to no, make sure it does not cause -set_version\n# flags to be left without arguments\nneed_version=unknown\n\ncase $host_os in\naix3*)\n  version_type=linux\n  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'\n  shlibpath_var=LIBPATH\n\n  # AIX 3 has no versioning support, so we append a major version to the name.\n  soname_spec='${libname}${release}${shared_ext}$major'\n  ;;\n\naix4* | aix5*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  hardcode_into_libs=yes\n  if test \"$host_cpu\" = ia64; then\n    # AIX 5 supports IA64\n    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'\n    shlibpath_var=LD_LIBRARY_PATH\n  else\n    # With GCC up to 2.95.x, collect2 would create an import file\n    # for dependence libraries.  The import file would start with\n    # the line `#! .'.  This would cause the generated library to\n    # depend on `.', always an invalid library.  This was fixed in\n    # development snapshots of GCC prior to 3.0.\n    case $host_os in\n      aix4 | aix4.[[01]] | aix4.[[01]].*)\n      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'\n\t   echo ' yes '\n\t   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then\n\t:\n      else\n\tcan_build_shared=no\n      fi\n      ;;\n    esac\n    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct\n    # soname into executable. Probably we can add versioning support to\n    # collect2, so additional links can be useful in future.\n    if test \"$aix_use_runtimelinking\" = yes; then\n      # If using run time linking (on AIX 4.2 or later) use lib<name>.so\n      # instead of lib<name>.a to let people know that these are not\n      # typical AIX shared libraries.\n      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n    else\n      # We preserve .a as extension for shared libraries through AIX4.2\n      # and later when we are not doing run time linking.\n      library_names_spec='${libname}${release}.a $libname.a'\n      soname_spec='${libname}${release}${shared_ext}$major'\n    fi\n    shlibpath_var=LIBPATH\n  fi\n  ;;\n\namigaos*)\n  library_names_spec='$libname.ixlibrary $libname.a'\n  # Create ${libname}_ixlibrary.a entries in /sys/libs.\n  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo \"X$lib\" | $Xsed -e '\\''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'\n  ;;\n\nbeos*)\n  library_names_spec='${libname}${shared_ext}'\n  dynamic_linker=\"$host_os ld.so\"\n  shlibpath_var=LIBRARY_PATH\n  ;;\n\nbsdi4*)\n  version_type=linux\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  sys_lib_search_path_spec=\"/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib\"\n  sys_lib_dlsearch_path_spec=\"/shlib /usr/lib /usr/local/lib\"\n  # the default ld.so.conf also contains /usr/contrib/lib and\n  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow\n  # libtool to hard-code these into programs\n  ;;\n\ncygwin* | mingw* | pw32*)\n  version_type=windows\n  shrext_cmds=\".dll\"\n  need_version=no\n  need_lib_prefix=no\n\n  case $GCC,$host_os in\n  yes,cygwin* | yes,mingw* | yes,pw32*)\n    library_names_spec='$libname.dll.a'\n    # DLL is installed to $(libdir)/../bin by postinstall_cmds\n    postinstall_cmds='base_file=`basename \\${file}`~\n      dlpath=`$SHELL 2>&1 -c '\\''. $dir/'\\''\\${base_file}'\\''i;echo \\$dlname'\\''`~\n      dldir=$destdir/`dirname \\$dlpath`~\n      test -d \\$dldir || mkdir -p \\$dldir~\n      $install_prog $dir/$dlname \\$dldir/$dlname'\n    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\\''. $file; echo \\$dlname'\\''`~\n      dlpath=$dir/\\$dldll~\n       $rm \\$dlpath'\n    shlibpath_overrides_runpath=yes\n\n    case $host_os in\n    cygwin*)\n      # Cygwin DLLs use 'cyg' prefix rather than 'lib'\n      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'\n      sys_lib_search_path_spec=\"/usr/lib /lib/w32api /lib /usr/local/lib\"\n      ;;\n    mingw*)\n      # MinGW DLLs use traditional 'lib' prefix\n      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'\n      sys_lib_search_path_spec=`$CC -print-search-dirs | grep \"^libraries:\" | $SED -e \"s/^libraries://\" -e \"s,=/,/,g\"`\n      if echo \"$sys_lib_search_path_spec\" | [grep ';[c-zC-Z]:/' >/dev/null]; then\n        # It is most probably a Windows format PATH printed by\n        # mingw gcc, but we are running on Cygwin. Gcc prints its search\n        # path with ; separators, and with drive letters. We can handle the\n        # drive letters (cygwin fileutils understands them), so leave them,\n        # especially as we might pass files found there to a mingw objdump,\n        # which wouldn't understand a cygwinified path. Ahh.\n        sys_lib_search_path_spec=`echo \"$sys_lib_search_path_spec\" | $SED -e 's/;/ /g'`\n      else\n        sys_lib_search_path_spec=`echo \"$sys_lib_search_path_spec\" | $SED  -e \"s/$PATH_SEPARATOR/ /g\"`\n      fi\n      ;;\n    pw32*)\n      # pw32 DLLs use 'pw' prefix rather than 'lib'\n      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'\n      ;;\n    esac\n    ;;\n\n  *)\n    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'\n    ;;\n  esac\n  dynamic_linker='Win32 ld.exe'\n  # FIXME: first we should search . and the directory the executable is in\n  shlibpath_var=PATH\n  ;;\n\ndarwin* | rhapsody*)\n  dynamic_linker=\"$host_os dyld\"\n  version_type=darwin\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'\n  soname_spec='${libname}${release}${major}$shared_ext'\n  shlibpath_overrides_runpath=yes\n  shlibpath_var=DYLD_LIBRARY_PATH\n  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'\n  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.\n  if test \"$GCC\" = yes; then\n    sys_lib_search_path_spec=`$CC -print-search-dirs | tr \"\\n\" \"$PATH_SEPARATOR\" | sed -e 's/libraries:/@libraries:/' | tr \"@\" \"\\n\" | grep \"^libraries:\" | sed -e \"s/^libraries://\" -e \"s,=/,/,g\" -e \"s,$PATH_SEPARATOR, ,g\" -e \"s,.*,& /lib /usr/lib /usr/local/lib,g\"`\n  else\n    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'\n  fi\n  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'\n  ;;\n\ndgux*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\nfreebsd1*)\n  dynamic_linker=no\n  ;;\n\nkfreebsd*-gnu)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  dynamic_linker='GNU ld.so'\n  ;;\n\nfreebsd*)\n  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`\n  version_type=freebsd-$objformat\n  case $version_type in\n    freebsd-elf*)\n      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'\n      need_version=no\n      need_lib_prefix=no\n      ;;\n    freebsd-*)\n      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'\n      need_version=yes\n      ;;\n  esac\n  shlibpath_var=LD_LIBRARY_PATH\n  case $host_os in\n  freebsd2*)\n    shlibpath_overrides_runpath=yes\n    ;;\n  freebsd3.[01]* | freebsdelf3.[01]*)\n    shlibpath_overrides_runpath=yes\n    hardcode_into_libs=yes\n    ;;\n  *) # from 3.2 on\n    shlibpath_overrides_runpath=no\n    hardcode_into_libs=yes\n    ;;\n  esac\n  ;;\n\ngnu*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  hardcode_into_libs=yes\n  ;;\n\nhpux9* | hpux10* | hpux11*)\n  # Give a soname corresponding to the major version so that dld.sl refuses to\n  # link against other versions.\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=no\n  case \"$host_cpu\" in\n  ia64*)\n    shrext_cmds='.so'\n    hardcode_into_libs=yes\n    dynamic_linker=\"$host_os dld.so\"\n    shlibpath_var=LD_LIBRARY_PATH\n    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.\n    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n    soname_spec='${libname}${release}${shared_ext}$major'\n    if test \"X$HPUX_IA64_MODE\" = X32; then\n      sys_lib_search_path_spec=\"/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib\"\n    else\n      sys_lib_search_path_spec=\"/usr/lib/hpux64 /usr/local/lib/hpux64\"\n    fi\n    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec\n    ;;\n   hppa*64*)\n     shrext_cmds='.sl'\n     hardcode_into_libs=yes\n     dynamic_linker=\"$host_os dld.sl\"\n     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH\n     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.\n     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n     soname_spec='${libname}${release}${shared_ext}$major'\n     sys_lib_search_path_spec=\"/usr/lib/pa20_64 /usr/ccs/lib/pa20_64\"\n     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec\n     ;;\n   *)\n    shrext_cmds='.sl'\n    dynamic_linker=\"$host_os dld.sl\"\n    shlibpath_var=SHLIB_PATH\n    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH\n    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n    soname_spec='${libname}${release}${shared_ext}$major'\n    ;;\n  esac\n  # HP-UX runs *really* slowly unless shared libraries are mode 555.\n  postinstall_cmds='chmod 555 $lib'\n  ;;\n\nirix5* | irix6* | nonstopux*)\n  case $host_os in\n    nonstopux*) version_type=nonstopux ;;\n    *)\n\tif test \"$lt_cv_prog_gnu_ld\" = yes; then\n\t\tversion_type=linux\n\telse\n\t\tversion_type=irix\n\tfi ;;\n  esac\n  need_lib_prefix=no\n  need_version=no\n  soname_spec='${libname}${release}${shared_ext}$major'\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'\n  case $host_os in\n  irix5* | nonstopux*)\n    libsuff= shlibsuff=\n    ;;\n  *)\n    case $LD in # libtool.m4 will add one of these switches to LD\n    *-32|*\"-32 \"|*-melf32bsmip|*\"-melf32bsmip \")\n      libsuff= shlibsuff= libmagic=32-bit;;\n    *-n32|*\"-n32 \"|*-melf32bmipn32|*\"-melf32bmipn32 \")\n      libsuff=32 shlibsuff=N32 libmagic=N32;;\n    *-64|*\"-64 \"|*-melf64bmip|*\"-melf64bmip \")\n      libsuff=64 shlibsuff=64 libmagic=64-bit;;\n    *) libsuff= shlibsuff= libmagic=never-match;;\n    esac\n    ;;\n  esac\n  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH\n  shlibpath_overrides_runpath=no\n  sys_lib_search_path_spec=\"/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}\"\n  sys_lib_dlsearch_path_spec=\"/usr/lib${libsuff} /lib${libsuff}\"\n  hardcode_into_libs=yes\n  ;;\n\n# No shared lib support for Linux oldld, aout, or coff.\nlinux*oldld* | linux*aout* | linux*coff*)\n  dynamic_linker=no\n  ;;\n\n# This must be Linux ELF.\nlinux*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -n $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  # This implies no fast_install, which is unacceptable.\n  # Some rework will be needed to allow for fast_install\n  # before this can be enabled.\n  hardcode_into_libs=yes\n\n  # find out which ABI we are using\n  libsuff=\n  case \"$host_cpu\" in\n  x86_64*|s390x*|powerpc64*)\n    echo '[#]line __oline__ \"configure\"' > conftest.$ac_ext\n    if AC_TRY_EVAL(ac_compile); then\n      case `/usr/bin/file conftest.$ac_objext` in\n      *64-bit*)\n        libsuff=64\n        sys_lib_search_path_spec=\"/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}\"\n        ;;\n      esac\n    fi\n    rm -rf conftest*\n    ;;\n  esac\n\n  # Append ld.so.conf contents to the search path\n  if test -f /etc/ld.so.conf; then\n    lt_ld_extra=`$SED -e 's/[:,\\t]/ /g;s/=[^=]*$//;s/=[^= ]* / /g' /etc/ld.so.conf | tr '\\n' ' '`\n    sys_lib_dlsearch_path_spec=\"/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra\"\n  fi\n\n  # We used to test for /lib/ld.so.1 and disable shared libraries on\n  # powerpc, because MkLinux only supported shared libraries with the\n  # GNU dynamic linker.  Since this was broken with cross compilers,\n  # most powerpc-linux boxes support dynamic linking these days and\n  # people can always --disable-shared, the test was removed, and we\n  # assume the GNU/Linux dynamic linker is in use.\n  dynamic_linker='GNU/Linux ld.so'\n  ;;\n\nknetbsd*-gnu)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  dynamic_linker='GNU ld.so'\n  ;;\n\nnetbsd*)\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=no\n  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then\n    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'\n    finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -m $libdir'\n    dynamic_linker='NetBSD (a.out) ld.so'\n  else\n    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'\n    soname_spec='${libname}${release}${shared_ext}$major'\n    dynamic_linker='NetBSD ld.elf_so'\n  fi\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  hardcode_into_libs=yes\n  ;;\n\nnewsos6)\n  version_type=linux\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  ;;\n\nnto-qnx*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  ;;\n\nopenbsd*)\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=yes\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -m $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  if test -z \"`echo __ELF__ | $CC -E - | grep __ELF__`\" || test \"$host_os-$host_cpu\" = \"openbsd2.8-powerpc\"; then\n    case $host_os in\n      openbsd2.[[89]] | openbsd2.[[89]].*)\n\tshlibpath_overrides_runpath=no\n\t;;\n      *)\n\tshlibpath_overrides_runpath=yes\n\t;;\n      esac\n  else\n    shlibpath_overrides_runpath=yes\n  fi\n  ;;\n\nos2*)\n  libname_spec='$name'\n  shrext_cmds=\".dll\"\n  need_lib_prefix=no\n  library_names_spec='$libname${shared_ext} $libname.a'\n  dynamic_linker='OS/2 ld.exe'\n  shlibpath_var=LIBPATH\n  ;;\n\nosf3* | osf4* | osf5*)\n  version_type=osf\n  need_lib_prefix=no\n  need_version=no\n  soname_spec='${libname}${release}${shared_ext}$major'\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  shlibpath_var=LD_LIBRARY_PATH\n  sys_lib_search_path_spec=\"/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib\"\n  sys_lib_dlsearch_path_spec=\"$sys_lib_search_path_spec\"\n  ;;\n\nsco3.2v5*)\n  version_type=osf\n  soname_spec='${libname}${release}${shared_ext}$major'\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\nsolaris*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  hardcode_into_libs=yes\n  # ldd complains unless libraries are executable\n  postinstall_cmds='chmod +x $lib'\n  ;;\n\nsunos4*)\n  version_type=sunos\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'\n  finish_cmds='PATH=\"\\$PATH:/usr/etc\" ldconfig $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  if test \"$with_gnu_ld\" = yes; then\n    need_lib_prefix=no\n  fi\n  need_version=yes\n  ;;\n\nsysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)\n  version_type=linux\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  case $host_vendor in\n    sni)\n      shlibpath_overrides_runpath=no\n      need_lib_prefix=no\n      export_dynamic_flag_spec='${wl}-Blargedynsym'\n      runpath_var=LD_RUN_PATH\n      ;;\n    siemens)\n      need_lib_prefix=no\n      ;;\n    motorola)\n      need_lib_prefix=no\n      need_version=no\n      shlibpath_overrides_runpath=no\n      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'\n      ;;\n  esac\n  ;;\n\nsysv4*MP*)\n  if test -d /usr/nec ;then\n    version_type=linux\n    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'\n    soname_spec='$libname${shared_ext}.$major'\n    shlibpath_var=LD_LIBRARY_PATH\n  fi\n  ;;\n\nuts4*)\n  version_type=linux\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\n*)\n  dynamic_linker=no\n  ;;\nesac\nAC_MSG_RESULT([$dynamic_linker])\ntest \"$dynamic_linker\" = no && can_build_shared=no\n])# AC_LIBTOOL_SYS_DYNAMIC_LINKER\n\n\n# _LT_AC_TAGCONFIG\n# ----------------\nAC_DEFUN([_LT_AC_TAGCONFIG],\n[AC_ARG_WITH([tags],\n    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],\n        [include additional configurations @<:@automatic@:>@])],\n    [tagnames=\"$withval\"])\n\nif test -f \"$ltmain\" && test -n \"$tagnames\"; then\n  if test ! -f \"${ofile}\"; then\n    AC_MSG_WARN([output file `$ofile' does not exist])\n  fi\n\n  if test -z \"$LTCC\"; then\n    eval \"`$SHELL ${ofile} --config | grep '^LTCC='`\"\n    if test -z \"$LTCC\"; then\n      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])\n    else\n      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])\n    fi\n  fi\n\n  # Extract list of available tagged configurations in $ofile.\n  # Note that this assumes the entire list is on one line.\n  available_tags=`grep \"^available_tags=\" \"${ofile}\" | $SED -e 's/available_tags=\\(.*$\\)/\\1/' -e 's/\\\"//g'`\n\n  lt_save_ifs=\"$IFS\"; IFS=\"${IFS}$PATH_SEPARATOR,\"\n  for tagname in $tagnames; do\n    IFS=\"$lt_save_ifs\"\n    # Check whether tagname contains only valid characters\n    case `$echo \"X$tagname\" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in\n    \"\") ;;\n    *)  AC_MSG_ERROR([invalid tag name: $tagname])\n\t;;\n    esac\n\n    if grep \"^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$\" < \"${ofile}\" > /dev/null\n    then\n      AC_MSG_ERROR([tag name \\\"$tagname\\\" already exists])\n    fi\n\n    # Update the list of available tags.\n    if test -n \"$tagname\"; then\n      echo appending configuration tag \\\"$tagname\\\" to $ofile\n\n      case $tagname in\n      CXX)\n\tif test -n \"$CXX\" && test \"X$CXX\" != \"Xno\"; then\n\t  AC_LIBTOOL_LANG_CXX_CONFIG\n\telse\n\t  tagname=\"\"\n\tfi\n\t;;\n\n      F77)\n\tif test -n \"$F77\" && test \"X$F77\" != \"Xno\"; then\n\t  AC_LIBTOOL_LANG_F77_CONFIG\n\telse\n\t  tagname=\"\"\n\tfi\n\t;;\n\n      GCJ)\n\tif test -n \"$GCJ\" && test \"X$GCJ\" != \"Xno\"; then\n\t  AC_LIBTOOL_LANG_GCJ_CONFIG\n\telse\n\t  tagname=\"\"\n\tfi\n\t;;\n\n      RC)\n\tAC_LIBTOOL_LANG_RC_CONFIG\n\t;;\n\n      *)\n\tAC_MSG_ERROR([Unsupported tag name: $tagname])\n\t;;\n      esac\n\n      # Append the new tag name to the list of available tags.\n      if test -n \"$tagname\" ; then\n      available_tags=\"$available_tags $tagname\"\n    fi\n    fi\n  done\n  IFS=\"$lt_save_ifs\"\n\n  # Now substitute the updated list of available tags.\n  if eval \"sed -e 's/^available_tags=.*\\$/available_tags=\\\"$available_tags\\\"/' \\\"$ofile\\\" > \\\"${ofile}T\\\"\"; then\n    mv \"${ofile}T\" \"$ofile\"\n    chmod +x \"$ofile\"\n  else\n    rm -f \"${ofile}T\"\n    AC_MSG_ERROR([unable to update list of available tagged configurations.])\n  fi\nfi\n])# _LT_AC_TAGCONFIG\n\n\n# AC_LIBTOOL_DLOPEN\n# -----------------\n# enable checks for dlopen support\nAC_DEFUN([AC_LIBTOOL_DLOPEN],\n [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])\n])# AC_LIBTOOL_DLOPEN\n\n\n# AC_LIBTOOL_WIN32_DLL\n# --------------------\n# declare package support for building win32 dll's\nAC_DEFUN([AC_LIBTOOL_WIN32_DLL],\n[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])\n])# AC_LIBTOOL_WIN32_DLL\n\n\n# AC_ENABLE_SHARED([DEFAULT])\n# ---------------------------\n# implement the --enable-shared flag\n# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.\nAC_DEFUN([AC_ENABLE_SHARED],\n[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl\nAC_ARG_ENABLE([shared],\n    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],\n\t[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],\n    [p=${PACKAGE-default}\n    case $enableval in\n    yes) enable_shared=yes ;;\n    no) enable_shared=no ;;\n    *)\n      enable_shared=no\n      # Look at the argument we got.  We use all the common list separators.\n      lt_save_ifs=\"$IFS\"; IFS=\"${IFS}$PATH_SEPARATOR,\"\n      for pkg in $enableval; do\n\tIFS=\"$lt_save_ifs\"\n\tif test \"X$pkg\" = \"X$p\"; then\n\t  enable_shared=yes\n\tfi\n      done\n      IFS=\"$lt_save_ifs\"\n      ;;\n    esac],\n    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)\n])# AC_ENABLE_SHARED\n\n\n# AC_DISABLE_SHARED\n# -----------------\n#- set the default shared flag to --disable-shared\nAC_DEFUN([AC_DISABLE_SHARED],\n[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl\nAC_ENABLE_SHARED(no)\n])# AC_DISABLE_SHARED\n\n\n# AC_ENABLE_STATIC([DEFAULT])\n# ---------------------------\n# implement the --enable-static flag\n# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.\nAC_DEFUN([AC_ENABLE_STATIC],\n[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl\nAC_ARG_ENABLE([static],\n    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],\n\t[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],\n    [p=${PACKAGE-default}\n    case $enableval in\n    yes) enable_static=yes ;;\n    no) enable_static=no ;;\n    *)\n     enable_static=no\n      # Look at the argument we got.  We use all the common list separators.\n      lt_save_ifs=\"$IFS\"; IFS=\"${IFS}$PATH_SEPARATOR,\"\n      for pkg in $enableval; do\n\tIFS=\"$lt_save_ifs\"\n\tif test \"X$pkg\" = \"X$p\"; then\n\t  enable_static=yes\n\tfi\n      done\n      IFS=\"$lt_save_ifs\"\n      ;;\n    esac],\n    [enable_static=]AC_ENABLE_STATIC_DEFAULT)\n])# AC_ENABLE_STATIC\n\n\n# AC_DISABLE_STATIC\n# -----------------\n# set the default static flag to --disable-static\nAC_DEFUN([AC_DISABLE_STATIC],\n[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl\nAC_ENABLE_STATIC(no)\n])# AC_DISABLE_STATIC\n\n\n# AC_ENABLE_FAST_INSTALL([DEFAULT])\n# ---------------------------------\n# implement the --enable-fast-install flag\n# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.\nAC_DEFUN([AC_ENABLE_FAST_INSTALL],\n[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl\nAC_ARG_ENABLE([fast-install],\n    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],\n    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],\n    [p=${PACKAGE-default}\n    case $enableval in\n    yes) enable_fast_install=yes ;;\n    no) enable_fast_install=no ;;\n    *)\n      enable_fast_install=no\n      # Look at the argument we got.  We use all the common list separators.\n      lt_save_ifs=\"$IFS\"; IFS=\"${IFS}$PATH_SEPARATOR,\"\n      for pkg in $enableval; do\n\tIFS=\"$lt_save_ifs\"\n\tif test \"X$pkg\" = \"X$p\"; then\n\t  enable_fast_install=yes\n\tfi\n      done\n      IFS=\"$lt_save_ifs\"\n      ;;\n    esac],\n    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)\n])# AC_ENABLE_FAST_INSTALL\n\n\n# AC_DISABLE_FAST_INSTALL\n# -----------------------\n# set the default to --disable-fast-install\nAC_DEFUN([AC_DISABLE_FAST_INSTALL],\n[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl\nAC_ENABLE_FAST_INSTALL(no)\n])# AC_DISABLE_FAST_INSTALL\n\n\n# AC_LIBTOOL_PICMODE([MODE])\n# --------------------------\n# implement the --with-pic flag\n# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.\nAC_DEFUN([AC_LIBTOOL_PICMODE],\n[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl\npic_mode=ifelse($#,1,$1,default)\n])# AC_LIBTOOL_PICMODE\n\n\n# AC_PROG_EGREP\n# -------------\n# This is predefined starting with Autoconf 2.54, so this conditional\n# definition can be removed once we require Autoconf 2.54 or later.\nm4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],\n[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],\n   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1\n    then ac_cv_prog_egrep='grep -E'\n    else ac_cv_prog_egrep='egrep'\n    fi])\n EGREP=$ac_cv_prog_egrep\n AC_SUBST([EGREP])\n])])\n\n\n# AC_PATH_TOOL_PREFIX\n# -------------------\n# find a file program which can recognise shared library\nAC_DEFUN([AC_PATH_TOOL_PREFIX],\n[AC_REQUIRE([AC_PROG_EGREP])dnl\nAC_MSG_CHECKING([for $1])\nAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,\n[case $MAGIC_CMD in\n[[\\\\/*] |  ?:[\\\\/]*])\n  lt_cv_path_MAGIC_CMD=\"$MAGIC_CMD\" # Let the user override the test with a path.\n  ;;\n*)\n  lt_save_MAGIC_CMD=\"$MAGIC_CMD\"\n  lt_save_ifs=\"$IFS\"; IFS=$PATH_SEPARATOR\ndnl $ac_dummy forces splitting on constant user-supplied paths.\ndnl POSIX.2 word splitting is done only on the output of word expansions,\ndnl not every word.  This closes a longstanding sh security hole.\n  ac_dummy=\"ifelse([$2], , $PATH, [$2])\"\n  for ac_dir in $ac_dummy; do\n    IFS=\"$lt_save_ifs\"\n    test -z \"$ac_dir\" && ac_dir=.\n    if test -f $ac_dir/$1; then\n      lt_cv_path_MAGIC_CMD=\"$ac_dir/$1\"\n      if test -n \"$file_magic_test_file\"; then\n\tcase $deplibs_check_method in\n\t\"file_magic \"*)\n\t  file_magic_regex=\"`expr \\\"$deplibs_check_method\\\" : \\\"file_magic \\(.*\\)\\\"`\"\n\t  MAGIC_CMD=\"$lt_cv_path_MAGIC_CMD\"\n\t  if eval $file_magic_cmd \\$file_magic_test_file 2> /dev/null |\n\t    $EGREP \"$file_magic_regex\" > /dev/null; then\n\t    :\n\t  else\n\t    cat <<EOF 1>&2\n\n*** Warning: the command libtool uses to detect shared libraries,\n*** $file_magic_cmd, produces output that libtool cannot recognize.\n*** The result is that libtool may fail to recognize shared libraries\n*** as such.  This will affect the creation of libtool libraries that\n*** depend on shared libraries, but programs linked with such libtool\n*** libraries will work regardless of this problem.  Nevertheless, you\n*** may want to report the problem to your system manager and/or to\n*** bug-libtool@gnu.org\n\nEOF\n\t  fi ;;\n\tesac\n      fi\n      break\n    fi\n  done\n  IFS=\"$lt_save_ifs\"\n  MAGIC_CMD=\"$lt_save_MAGIC_CMD\"\n  ;;\nesac])\nMAGIC_CMD=\"$lt_cv_path_MAGIC_CMD\"\nif test -n \"$MAGIC_CMD\"; then\n  AC_MSG_RESULT($MAGIC_CMD)\nelse\n  AC_MSG_RESULT(no)\nfi\n])# AC_PATH_TOOL_PREFIX\n\n\n# AC_PATH_MAGIC\n# -------------\n# find a file program which can recognise a shared library\nAC_DEFUN([AC_PATH_MAGIC],\n[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)\nif test -z \"$lt_cv_path_MAGIC_CMD\"; then\n  if test -n \"$ac_tool_prefix\"; then\n    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)\n  else\n    MAGIC_CMD=:\n  fi\nfi\n])# AC_PATH_MAGIC\n\n\n# AC_PROG_LD\n# ----------\n# find the pathname to the GNU or non-GNU linker\nAC_DEFUN([AC_PROG_LD],\n[AC_ARG_WITH([gnu-ld],\n    [AC_HELP_STRING([--with-gnu-ld],\n\t[assume the C compiler uses GNU ld @<:@default=no@:>@])],\n    [test \"$withval\" = no || with_gnu_ld=yes],\n    [with_gnu_ld=no])\nAC_REQUIRE([LT_AC_PROG_SED])dnl\nAC_REQUIRE([AC_PROG_CC])dnl\nAC_REQUIRE([AC_CANONICAL_HOST])dnl\nAC_REQUIRE([AC_CANONICAL_BUILD])dnl\nac_prog=ld\nif test \"$GCC\" = yes; then\n  # Check if gcc -print-prog-name=ld gives a path.\n  AC_MSG_CHECKING([for ld used by $CC])\n  case $host in\n  *-*-mingw*)\n    # gcc leaves a trailing carriage return which upsets mingw\n    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\\015'` ;;\n  *)\n    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;\n  esac\n  case $ac_prog in\n    # Accept absolute paths.\n    [[\\\\/]]* | ?:[[\\\\/]]*)\n      re_direlt='/[[^/]][[^/]]*/\\.\\./'\n      # Canonicalize the pathname of ld\n      ac_prog=`echo $ac_prog| $SED 's%\\\\\\\\%/%g'`\n      while echo $ac_prog | grep \"$re_direlt\" > /dev/null 2>&1; do\n\tac_prog=`echo $ac_prog| $SED \"s%$re_direlt%/%\"`\n      done\n      test -z \"$LD\" && LD=\"$ac_prog\"\n      ;;\n  \"\")\n    # If it fails, then pretend we aren't using GCC.\n    ac_prog=ld\n    ;;\n  *)\n    # If it is relative, then search for the first ld in PATH.\n    with_gnu_ld=unknown\n    ;;\n  esac\nelif test \"$with_gnu_ld\" = yes; then\n  AC_MSG_CHECKING([for GNU ld])\nelse\n  AC_MSG_CHECKING([for non-GNU ld])\nfi\nAC_CACHE_VAL(lt_cv_path_LD,\n[if test -z \"$LD\"; then\n  lt_save_ifs=\"$IFS\"; IFS=$PATH_SEPARATOR\n  for ac_dir in $PATH; do\n    IFS=\"$lt_save_ifs\"\n    test -z \"$ac_dir\" && ac_dir=.\n    if test -f \"$ac_dir/$ac_prog\" || test -f \"$ac_dir/$ac_prog$ac_exeext\"; then\n      lt_cv_path_LD=\"$ac_dir/$ac_prog\"\n      # Check to see if the program is GNU ld.  I'd rather use --version,\n      # but apparently some GNU ld's only accept -v.\n      # Break only if it was the GNU/non-GNU ld that we prefer.\n      case `\"$lt_cv_path_LD\" -v 2>&1 </dev/null` in\n      *GNU* | *'with BFD'*)\n\ttest \"$with_gnu_ld\" != no && break\n\t;;\n      *)\n\ttest \"$with_gnu_ld\" != yes && break\n\t;;\n      esac\n    fi\n  done\n  IFS=\"$lt_save_ifs\"\nelse\n  lt_cv_path_LD=\"$LD\" # Let the user override the test with a path.\nfi])\nLD=\"$lt_cv_path_LD\"\nif test -n \"$LD\"; then\n  AC_MSG_RESULT($LD)\nelse\n  AC_MSG_RESULT(no)\nfi\ntest -z \"$LD\" && AC_MSG_ERROR([no acceptable ld found in \\$PATH])\nAC_PROG_LD_GNU\n])# AC_PROG_LD\n\n\n# AC_PROG_LD_GNU\n# --------------\nAC_DEFUN([AC_PROG_LD_GNU],\n[AC_REQUIRE([AC_PROG_EGREP])dnl\nAC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,\n[# I'd rather use --version here, but apparently some GNU ld's only accept -v.\ncase `$LD -v 2>&1 </dev/null` in\n*GNU* | *'with BFD'*)\n  lt_cv_prog_gnu_ld=yes\n  ;;\n*)\n  lt_cv_prog_gnu_ld=no\n  ;;\nesac])\nwith_gnu_ld=$lt_cv_prog_gnu_ld\n])# AC_PROG_LD_GNU\n\n\n# AC_PROG_LD_RELOAD_FLAG\n# ----------------------\n# find reload flag for linker\n#   -- PORTME Some linkers may need a different reload flag.\nAC_DEFUN([AC_PROG_LD_RELOAD_FLAG],\n[AC_CACHE_CHECK([for $LD option to reload object files],\n  lt_cv_ld_reload_flag,\n  [lt_cv_ld_reload_flag='-r'])\nreload_flag=$lt_cv_ld_reload_flag\ncase $reload_flag in\n\"\" | \" \"*) ;;\n*) reload_flag=\" $reload_flag\" ;;\nesac\nreload_cmds='$LD$reload_flag -o $output$reload_objs'\n])# AC_PROG_LD_RELOAD_FLAG\n\n\n# AC_DEPLIBS_CHECK_METHOD\n# -----------------------\n# how to check for library dependencies\n#  -- PORTME fill in with the dynamic library characteristics\nAC_DEFUN([AC_DEPLIBS_CHECK_METHOD],\n[AC_CACHE_CHECK([how to recognise dependent libraries],\nlt_cv_deplibs_check_method,\n[lt_cv_file_magic_cmd='$MAGIC_CMD'\nlt_cv_file_magic_test_file=\nlt_cv_deplibs_check_method='unknown'\n# Need to set the preceding variable on all platforms that support\n# interlibrary dependencies.\n# 'none' -- dependencies not supported.\n# `unknown' -- same as none, but documents that we really don't know.\n# 'pass_all' -- all dependencies passed with no checks.\n# 'test_compile' -- check by making test program.\n# 'file_magic [[regex]]' -- check by looking for files in library path\n# which responds to the $file_magic_cmd with a given extended regex.\n# If you have `file' or equivalent on your system and you're not sure\n# whether `pass_all' will *always* work, you probably want this one.\n\ncase $host_os in\naix4* | aix5*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nbeos*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nbsdi4*)\n  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'\n  lt_cv_file_magic_cmd='/usr/bin/file -L'\n  lt_cv_file_magic_test_file=/shlib/libc.so\n  ;;\n\ncygwin*)\n  # func_win32_libid is a shell function defined in ltmain.sh\n  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'\n  lt_cv_file_magic_cmd='func_win32_libid'\n  ;;\n\nmingw* | pw32*)\n  # Base MSYS/MinGW do not provide the 'file' command needed by\n  # func_win32_libid shell function, so use a weaker test based on 'objdump'.\n  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'\n  lt_cv_file_magic_cmd='$OBJDUMP -f'\n  ;;\n\ndarwin* | rhapsody*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nfreebsd* | kfreebsd*-gnu)\n  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then\n    case $host_cpu in\n    i*86 )\n      # Not sure whether the presence of OpenBSD here was a mistake.\n      # Let's accept both of them until this is cleared up.\n      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'\n      lt_cv_file_magic_cmd=/usr/bin/file\n      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`\n      ;;\n    esac\n  else\n    lt_cv_deplibs_check_method=pass_all\n  fi\n  ;;\n\ngnu*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nhpux10.20* | hpux11*)\n  lt_cv_file_magic_cmd=/usr/bin/file\n  case \"$host_cpu\" in\n  ia64*)\n    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'\n    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so\n    ;;\n  hppa*64*)\n    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']\n    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl\n    ;;\n  *)\n    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'\n    lt_cv_file_magic_test_file=/usr/lib/libc.sl\n    ;;\n  esac\n  ;;\n\nirix5* | irix6* | nonstopux*)\n  case $LD in\n  *-32|*\"-32 \") libmagic=32-bit;;\n  *-n32|*\"-n32 \") libmagic=N32;;\n  *-64|*\"-64 \") libmagic=64-bit;;\n  *) libmagic=never-match;;\n  esac\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\n# This must be Linux ELF.\nlinux*)\n  case $host_cpu in\n  alpha*|hppa*|i*86|ia64*|m68*|mips*|powerpc*|sparc*|s390*|sh*|x86_64*)\n    lt_cv_deplibs_check_method=pass_all ;;\n  *)\n    # glibc up to 2.1.1 does not perform some relocations on ARM\n    # this will be overridden with pass_all, but let us keep it just in case\n    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;\n  esac\n  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nnetbsd*)\n  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then\n    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\\.so\\.[[0-9]]+\\.[[0-9]]+|_pic\\.a)$'\n  else\n    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\\.so|_pic\\.a)$'\n  fi\n  ;;\n\nnewos6*)\n  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'\n  lt_cv_file_magic_cmd=/usr/bin/file\n  lt_cv_file_magic_test_file=/usr/lib/libnls.so\n  ;;\n\nnto-qnx*)\n  lt_cv_deplibs_check_method=unknown\n  ;;\n\nopenbsd*)\n  lt_cv_file_magic_cmd=/usr/bin/file\n  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`\n  if test -z \"`echo __ELF__ | $CC -E - | grep __ELF__`\" || test \"$host_os-$host_cpu\" = \"openbsd2.8-powerpc\"; then\n    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'\n  else\n    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'\n  fi\n  ;;\n\nosf3* | osf4* | osf5*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nsco3.2v5*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nsolaris*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nsysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)\n  case $host_vendor in\n  motorola)\n    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]]'\n    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`\n    ;;\n  ncr)\n    lt_cv_deplibs_check_method=pass_all\n    ;;\n  sequent)\n    lt_cv_file_magic_cmd='/bin/file'\n    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'\n    ;;\n  sni)\n    lt_cv_file_magic_cmd='/bin/file'\n    lt_cv_deplibs_check_method=\"file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib\"\n    lt_cv_file_magic_test_file=/lib/libc.so\n    ;;\n  siemens)\n    lt_cv_deplibs_check_method=pass_all\n    ;;\n  esac\n  ;;\n\nsysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\nesac\n])\nfile_magic_cmd=$lt_cv_file_magic_cmd\ndeplibs_check_method=$lt_cv_deplibs_check_method\ntest -z \"$deplibs_check_method\" && deplibs_check_method=unknown\n])# AC_DEPLIBS_CHECK_METHOD\n\n\n# AC_PROG_NM\n# ----------\n# find the pathname to a BSD-compatible name lister\nAC_DEFUN([AC_PROG_NM],\n[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,\n[if test -n \"$NM\"; then\n  # Let the user override the test.\n  lt_cv_path_NM=\"$NM\"\nelse\n  lt_save_ifs=\"$IFS\"; IFS=$PATH_SEPARATOR\n  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do\n    IFS=\"$lt_save_ifs\"\n    test -z \"$ac_dir\" && ac_dir=.\n    tmp_nm=\"$ac_dir/${ac_tool_prefix}nm\"\n    if test -f \"$tmp_nm\" || test -f \"$tmp_nm$ac_exeext\" ; then\n      # Check to see if the nm accepts a BSD-compat flag.\n      # Adding the `sed 1q' prevents false positives on HP-UX, which says:\n      #   nm: unknown option \"B\" ignored\n      # Tru64's nm complains that /dev/null is an invalid object file\n      case `\"$tmp_nm\" -B /dev/null 2>&1 | sed '1q'` in\n      */dev/null* | *'Invalid file or object type'*)\n\tlt_cv_path_NM=\"$tmp_nm -B\"\n\tbreak\n        ;;\n      *)\n\tcase `\"$tmp_nm\" -p /dev/null 2>&1 | sed '1q'` in\n\t*/dev/null*)\n\t  lt_cv_path_NM=\"$tmp_nm -p\"\n\t  break\n\t  ;;\n\t*)\n\t  lt_cv_path_NM=${lt_cv_path_NM=\"$tmp_nm\"} # keep the first match, but\n\t  continue # so that we can try to find one that supports BSD flags\n\t  ;;\n\tesac\n      esac\n    fi\n  done\n  IFS=\"$lt_save_ifs\"\n  test -z \"$lt_cv_path_NM\" && lt_cv_path_NM=nm\nfi])\nNM=\"$lt_cv_path_NM\"\n])# AC_PROG_NM\n\n\n# AC_CHECK_LIBM\n# -------------\n# check for math library\nAC_DEFUN([AC_CHECK_LIBM],\n[AC_REQUIRE([AC_CANONICAL_HOST])dnl\nLIBM=\ncase $host in\n*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)\n  # These system don't have libm, or don't need it\n  ;;\n*-ncr-sysv4.3*)\n  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=\"-lmw\")\n  AC_CHECK_LIB(m, cos, LIBM=\"$LIBM -lm\")\n  ;;\n*)\n  AC_CHECK_LIB(m, cos, LIBM=\"-lm\")\n  ;;\nesac\n])# AC_CHECK_LIBM\n\n\n# AC_LIBLTDL_CONVENIENCE([DIRECTORY])\n# -----------------------------------\n# sets LIBLTDL to the link flags for the libltdl convenience library and\n# LTDLINCL to the include flags for the libltdl header and adds\n# --enable-ltdl-convenience to the configure arguments.  Note that LIBLTDL\n# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If\n# DIRECTORY is not provided, it is assumed to be `libltdl'.  LIBLTDL will\n# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with\n# '${top_srcdir}/' (note the single quotes!).  If your package is not\n# flat and you're not using automake, define top_builddir and\n# top_srcdir appropriately in the Makefiles.\nAC_DEFUN([AC_LIBLTDL_CONVENIENCE],\n[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl\n  case $enable_ltdl_convenience in\n  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;\n  \"\") enable_ltdl_convenience=yes\n      ac_configure_args=\"$ac_configure_args --enable-ltdl-convenience\" ;;\n  esac\n  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la\n  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])\n  # For backwards non-gettext consistent compatibility...\n  INCLTDL=\"$LTDLINCL\"\n])# AC_LIBLTDL_CONVENIENCE\n\n\n# AC_LIBLTDL_INSTALLABLE([DIRECTORY])\n# -----------------------------------\n# sets LIBLTDL to the link flags for the libltdl installable library and\n# LTDLINCL to the include flags for the libltdl header and adds\n# --enable-ltdl-install to the configure arguments.  Note that LIBLTDL\n# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If\n# DIRECTORY is not provided and an installed libltdl is not found, it is\n# assumed to be `libltdl'.  LIBLTDL will be prefixed with '${top_builddir}/'\n# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single\n# quotes!).  If your package is not flat and you're not using automake,\n# define top_builddir and top_srcdir appropriately in the Makefiles.\n# In the future, this macro may have to be called after AC_PROG_LIBTOOL.\nAC_DEFUN([AC_LIBLTDL_INSTALLABLE],\n[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl\n  AC_CHECK_LIB(ltdl, lt_dlinit,\n  [test x\"$enable_ltdl_install\" != xyes && enable_ltdl_install=no],\n  [if test x\"$enable_ltdl_install\" = xno; then\n     AC_MSG_WARN([libltdl not installed, but installation disabled])\n   else\n     enable_ltdl_install=yes\n   fi\n  ])\n  if test x\"$enable_ltdl_install\" = x\"yes\"; then\n    ac_configure_args=\"$ac_configure_args --enable-ltdl-install\"\n    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la\n    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])\n  else\n    ac_configure_args=\"$ac_configure_args --enable-ltdl-install=no\"\n    LIBLTDL=\"-lltdl\"\n    LTDLINCL=\n  fi\n  # For backwards non-gettext consistent compatibility...\n  INCLTDL=\"$LTDLINCL\"\n])# AC_LIBLTDL_INSTALLABLE\n\n\n# AC_LIBTOOL_CXX\n# --------------\n# enable support for C++ libraries\nAC_DEFUN([AC_LIBTOOL_CXX],\n[AC_REQUIRE([_LT_AC_LANG_CXX])\n])# AC_LIBTOOL_CXX\n\n\n# _LT_AC_LANG_CXX\n# ---------------\nAC_DEFUN([_LT_AC_LANG_CXX],\n[AC_REQUIRE([AC_PROG_CXX])\nAC_REQUIRE([AC_PROG_CXXCPP])\n_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])\n])# _LT_AC_LANG_CXX\n\n\n# AC_LIBTOOL_F77\n# --------------\n# enable support for Fortran 77 libraries\nAC_DEFUN([AC_LIBTOOL_F77],\n[AC_REQUIRE([_LT_AC_LANG_F77])\n])# AC_LIBTOOL_F77\n\n\n# _LT_AC_LANG_F77\n# ---------------\nAC_DEFUN([_LT_AC_LANG_F77],\n[AC_REQUIRE([AC_PROG_F77])\n_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])\n])# _LT_AC_LANG_F77\n\n\n# AC_LIBTOOL_GCJ\n# --------------\n# enable support for GCJ libraries\nAC_DEFUN([AC_LIBTOOL_GCJ],\n[AC_REQUIRE([_LT_AC_LANG_GCJ])\n])# AC_LIBTOOL_GCJ\n\n\n# _LT_AC_LANG_GCJ\n# ---------------\nAC_DEFUN([_LT_AC_LANG_GCJ],\n[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],\n  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],\n    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],\n      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],\n\t [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],\n\t   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])\n_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])\n])# _LT_AC_LANG_GCJ\n\n\n# AC_LIBTOOL_RC\n# --------------\n# enable support for Windows resource files\nAC_DEFUN([AC_LIBTOOL_RC],\n[AC_REQUIRE([LT_AC_PROG_RC])\n_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])\n])# AC_LIBTOOL_RC\n\n\n# AC_LIBTOOL_LANG_C_CONFIG\n# ------------------------\n# Ensure that the configuration vars for the C compiler are\n# suitably defined.  Those variables are subsequently used by\n# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.\nAC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])\nAC_DEFUN([_LT_AC_LANG_C_CONFIG],\n[lt_save_CC=\"$CC\"\nAC_LANG_PUSH(C)\n\n# Source file extension for C test sources.\nac_ext=c\n\n# Object file extension for compiled C test sources.\nobjext=o\n_LT_AC_TAGVAR(objext, $1)=$objext\n\n# Code to be used in simple compile tests\nlt_simple_compile_test_code=\"int some_variable = 0;\\n\"\n\n# Code to be used in simple link tests\nlt_simple_link_test_code='int main(){return(0);}\\n'\n\n_LT_AC_SYS_COMPILER\n\n#\n# Check for any special shared library compilation flags.\n#\n_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=\nif test \"$GCC\" = no; then\n  case $host_os in\n  sco3.2v5*)\n    _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'\n    ;;\n  esac\nfi\nif test -n \"$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)\"; then\n  AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])\n  if echo \"$old_CC $old_CFLAGS \" | grep \"[[ \t]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ \t]]\" >/dev/null; then :\n  else\n    AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])\n    _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no\n  fi\nfi\n\n\n#\n# Check to make sure the static flag actually works.\n#\nAC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],\n  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),\n  $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),\n  [],\n  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])\n\n\nAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)\nAC_LIBTOOL_PROG_COMPILER_PIC($1)\nAC_LIBTOOL_PROG_CC_C_O($1)\nAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)\nAC_LIBTOOL_PROG_LD_SHLIBS($1)\nAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)\nAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)\nAC_LIBTOOL_SYS_LIB_STRIP\nAC_LIBTOOL_DLOPEN_SELF($1)\n\n# Report which librarie types wil actually be built\nAC_MSG_CHECKING([if libtool supports shared libraries])\nAC_MSG_RESULT([$can_build_shared])\n\nAC_MSG_CHECKING([whether to build shared libraries])\ntest \"$can_build_shared\" = \"no\" && enable_shared=no\n\n# On AIX, shared libraries and static libraries use the same namespace, and\n# are all built from PIC.\ncase \"$host_os\" in\naix3*)\n  test \"$enable_shared\" = yes && enable_static=no\n  if test -n \"$RANLIB\"; then\n    archive_cmds=\"$archive_cmds~\\$RANLIB \\$lib\"\n    postinstall_cmds='$RANLIB $lib'\n  fi\n  ;;\n\naix4* | aix5*)\n  if test \"$host_cpu\" != ia64 && test \"$aix_use_runtimelinking\" = no ; then\n    test \"$enable_shared\" = yes && enable_static=no\n  fi\n  ;;\n  darwin* | rhapsody*)\n  if test \"$GCC\" = yes; then\n    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no\n    case \"$host_os\" in\n    rhapsody* | darwin1.[[012]])\n      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'\n      ;;\n    *) # Darwin 1.3 on\n      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then\n      \t_LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'\n      else\n        case ${MACOSX_DEPLOYMENT_TARGET} in\n          10.[[012]])\n            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'\n            ;;\n          10.*)\n            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'\n            ;;\n        esac\n      fi\n      ;;\n    esac\n    output_verbose_link_cmd='echo'\n    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'\n    _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'\n    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's\n    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e \"s,#.*,,\" -e \"s,^[    ]*,,\" -e \"s,^\\(..*\\),_&,\" < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'\n    _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e \"s,#.*,,\" -e \"s,^[    ]*,,\" -e \"s,^\\(..*\\),_&,\" < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'\n    _LT_AC_TAGVAR(hardcode_direct, $1)=no\n    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes\n    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported\n    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'\n    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes\n  else\n    _LT_AC_TAGVAR(ld_shlibs, $1)=no\n  fi\n    ;;\nesac\nAC_MSG_RESULT([$enable_shared])\n\nAC_MSG_CHECKING([whether to build static libraries])\n# Make sure either enable_shared or enable_static is yes.\ntest \"$enable_shared\" = yes || enable_static=yes\nAC_MSG_RESULT([$enable_static])\n\nAC_LIBTOOL_CONFIG($1)\n\nAC_LANG_POP\nCC=\"$lt_save_CC\"\n])# AC_LIBTOOL_LANG_C_CONFIG\n\n\n# AC_LIBTOOL_LANG_CXX_CONFIG\n# --------------------------\n# Ensure that the configuration vars for the C compiler are\n# suitably defined.  Those variables are subsequently used by\n# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.\nAC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])\nAC_DEFUN([_LT_AC_LANG_CXX_CONFIG],\n[AC_LANG_PUSH(C++)\nAC_REQUIRE([AC_PROG_CXX])\nAC_REQUIRE([AC_PROG_CXXCPP])\n\n_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no\n_LT_AC_TAGVAR(allow_undefined_flag, $1)=\n_LT_AC_TAGVAR(always_export_symbols, $1)=no\n_LT_AC_TAGVAR(archive_expsym_cmds, $1)=\n_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=\n_LT_AC_TAGVAR(hardcode_direct, $1)=no\n_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=\n_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=\n_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=\n_LT_AC_TAGVAR(hardcode_minus_L, $1)=no\n_LT_AC_TAGVAR(hardcode_automatic, $1)=no\n_LT_AC_TAGVAR(module_cmds, $1)=\n_LT_AC_TAGVAR(module_expsym_cmds, $1)=\n_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown\n_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds\n_LT_AC_TAGVAR(no_undefined_flag, $1)=\n_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=\n_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no\n\n# Dependencies to place before and after the object being linked:\n_LT_AC_TAGVAR(predep_objects, $1)=\n_LT_AC_TAGVAR(postdep_objects, $1)=\n_LT_AC_TAGVAR(predeps, $1)=\n_LT_AC_TAGVAR(postdeps, $1)=\n_LT_AC_TAGVAR(compiler_lib_search_path, $1)=\n\n# Source file extension for C++ test sources.\nac_ext=cc\n\n# Object file extension for compiled C++ test sources.\nobjext=o\n_LT_AC_TAGVAR(objext, $1)=$objext\n\n# Code to be used in simple compile tests\nlt_simple_compile_test_code=\"int some_variable = 0;\\n\"\n\n# Code to be used in simple link tests\nlt_simple_link_test_code='int main(int, char *[]) { return(0); }\\n'\n\n# ltmain only uses $CC for tagged configurations so make sure $CC is set.\n_LT_AC_SYS_COMPILER\n\n# Allow CC to be a program name with arguments.\nlt_save_CC=$CC\nlt_save_LD=$LD\nlt_save_GCC=$GCC\nGCC=$GXX\nlt_save_with_gnu_ld=$with_gnu_ld\nlt_save_path_LD=$lt_cv_path_LD\nif test -n \"${lt_cv_prog_gnu_ldcxx+set}\"; then\n  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx\nelse\n  unset lt_cv_prog_gnu_ld\nfi\nif test -n \"${lt_cv_path_LDCXX+set}\"; then\n  lt_cv_path_LD=$lt_cv_path_LDCXX\nelse\n  unset lt_cv_path_LD\nfi\ntest -z \"${LDCXX+set}\" || LD=$LDCXX\nCC=${CXX-\"c++\"}\ncompiler=$CC\n_LT_AC_TAGVAR(compiler, $1)=$CC\ncc_basename=`$echo X\"$compiler\" | $Xsed -e 's%^.*/%%'`\n\n# We don't want -fno-exception wen compiling C++ code, so set the\n# no_builtin_flag separately\nif test \"$GXX\" = yes; then\n  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'\nelse\n  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=\nfi\n\nif test \"$GXX\" = yes; then\n  # Set up default GNU C++ configuration\n\n  AC_PROG_LD\n\n  # Check if GNU C++ uses GNU ld as the underlying linker, since the\n  # archiving commands below assume that GNU ld is being used.\n  if test \"$with_gnu_ld\" = yes; then\n    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'\n    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'\n\n    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'\n    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'\n\n    # If archive_cmds runs LD, not CC, wlarc should be empty\n    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to\n    #     investigate it a little bit more. (MM)\n    wlarc='${wl}'\n\n    # ancient GNU ld didn't support --whole-archive et. al.\n    if eval \"`$CC -print-prog-name=ld` --help 2>&1\" | \\\n\tgrep 'no-whole-archive' > /dev/null; then\n      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=\"$wlarc\"'--whole-archive$convenience '\"$wlarc\"'--no-whole-archive'\n    else\n      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=\n    fi\n  else\n    with_gnu_ld=no\n    wlarc=\n\n    # A generic and very simple default shared library creation\n    # command for GNU C++ for the case where it uses the native\n    # linker, instead of GNU ld.  If possible, this setting should\n    # overridden to take advantage of the native linker features on\n    # the platform it is being used on.\n    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'\n  fi\n\n  # Commands to make compiler produce verbose output that lists\n  # what \"hidden\" libraries, object files and flags are used when\n  # linking a shared library.\n  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\\-L\"'\n\nelse\n  GXX=no\n  with_gnu_ld=no\n  wlarc=\nfi\n\n# PORTME: fill in a description of your system's C++ link characteristics\nAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])\n_LT_AC_TAGVAR(ld_shlibs, $1)=yes\ncase $host_os in\n  aix3*)\n    # FIXME: insert proper C++ library support\n    _LT_AC_TAGVAR(ld_shlibs, $1)=no\n    ;;\n  aix4* | aix5*)\n    if test \"$host_cpu\" = ia64; then\n      # On IA64, the linker does run time linking by default, so we don't\n      # have to do anything special.\n      aix_use_runtimelinking=no\n      exp_sym_flag='-Bexport'\n      no_entry_flag=\"\"\n    else\n      aix_use_runtimelinking=no\n\n      # Test if we are trying to use run time linking or normal\n      # AIX style linking. If -brtl is somewhere in LDFLAGS, we\n      # need to do runtime linking.\n      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)\n\tfor ld_flag in $LDFLAGS; do\n\t  case $ld_flag in\n\t  *-brtl*)\n\t    aix_use_runtimelinking=yes\n\t    break\n\t    ;;\n\t  esac\n\tdone\n      esac\n\n      exp_sym_flag='-bexport'\n      no_entry_flag='-bnoentry'\n    fi\n\n    # When large executables or shared objects are built, AIX ld can\n    # have problems creating the table of contents.  If linking a library\n    # or program results in \"error TOC overflow\" add -mminimal-toc to\n    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not\n    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.\n\n    _LT_AC_TAGVAR(archive_cmds, $1)=''\n    _LT_AC_TAGVAR(hardcode_direct, $1)=yes\n    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'\n    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes\n\n    if test \"$GXX\" = yes; then\n      case $host_os in aix4.[012]|aix4.[012].*)\n      # We only want to do this on AIX 4.2 and lower, the check\n      # below for broken collect2 doesn't work under 4.3+\n\tcollect2name=`${CC} -print-prog-name=collect2`\n\tif test -f \"$collect2name\" && \\\n\t   strings \"$collect2name\" | grep resolve_lib_name >/dev/null\n\tthen\n\t  # We have reworked collect2\n\t  _LT_AC_TAGVAR(hardcode_direct, $1)=yes\n\telse\n\t  # We have old collect2\n\t  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported\n\t  # It fails to find uninstalled libraries when the uninstalled\n\t  # path is not listed in the libpath.  Setting hardcode_minus_L\n\t  # to unsupported forces relinking\n\t  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes\n\t  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n\t  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=\n\tfi\n      esac\n      shared_flag='-shared'\n    else\n      # not using gcc\n      if test \"$host_cpu\" = ia64; then\n\t# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release\n\t# chokes on -Wl,-G. The following line is correct:\n\tshared_flag='-G'\n      else\n\tif test \"$aix_use_runtimelinking\" = yes; then\n\t  shared_flag='${wl}-G'\n\telse\n\t  shared_flag='${wl}-bM:SRE'\n\tfi\n      fi\n    fi\n\n    # It seems that -bexpall does not export symbols beginning with\n    # underscore (_), so it is better to generate a list of symbols to export.\n    _LT_AC_TAGVAR(always_export_symbols, $1)=yes\n    if test \"$aix_use_runtimelinking\" = yes; then\n      # Warning - without using the other runtime loading flags (-brtl),\n      # -berok will link without error, but may produce a broken library.\n      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'\n      # Determine the default libpath from the value encoded in an empty executable.\n      _LT_AC_SYS_LIBPATH_AIX\n      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'\"$aix_libpath\"\n\n      _LT_AC_TAGVAR(archive_expsym_cmds, $1)=\"\\$CC\"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test \"x${allow_undefined_flag}\" != \"x\"; then echo \"${wl}${allow_undefined_flag}\"; else :; fi` '\"\\${wl}$no_entry_flag \\${wl}$exp_sym_flag:\\$export_symbols $shared_flag\"\n     else\n      if test \"$host_cpu\" = ia64; then\n\t_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'\n\t_LT_AC_TAGVAR(allow_undefined_flag, $1)=\"-z nodefs\"\n\t_LT_AC_TAGVAR(archive_expsym_cmds, $1)=\"\\$CC $shared_flag\"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '\"\\${wl}$no_entry_flag \\${wl}$exp_sym_flag:\\$export_symbols\"\n      else\n\t# Determine the default libpath from the value encoded in an empty executable.\n\t_LT_AC_SYS_LIBPATH_AIX\n\t_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'\"$aix_libpath\"\n\t# Warning - without using the other run time loading flags,\n\t# -berok will link without error, but may produce a broken library.\n\t_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'\n\t_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'\n\t# -bexpall does not export symbols beginning with underscore (_)\n\t_LT_AC_TAGVAR(always_export_symbols, $1)=yes\n\t# Exported symbols can be pulled into shared objects from archives\n\t_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '\n\t_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes\n\t# This is similar to how AIX traditionally builds it's shared libraries.\n\t_LT_AC_TAGVAR(archive_expsym_cmds, $1)=\"\\$CC $shared_flag\"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'\n      fi\n    fi\n    ;;\n  chorus*)\n    case $cc_basename in\n      *)\n\t# FIXME: insert proper C++ library support\n\t_LT_AC_TAGVAR(ld_shlibs, $1)=no\n\t;;\n    esac\n    ;;\n\n  cygwin* | mingw* | pw32*)\n    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,\n    # as there is no search path for DLLs.\n    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported\n    _LT_AC_TAGVAR(always_export_symbols, $1)=no\n    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes\n\n    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then\n      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'\n      # If the export-symbols file already is a .def file (1st line\n      # is EXPORTS), use it as is; otherwise, prepend...\n      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test \"x`$SED 1q $export_symbols`\" = xEXPORTS; then\n\tcp $export_symbols $output_objdir/$soname.def;\n      else\n\techo EXPORTS > $output_objdir/$soname.def;\n\tcat $export_symbols >> $output_objdir/$soname.def;\n      fi~\n      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'\n    else\n      _LT_AC_TAGVAR(ld_shlibs, $1)=no\n    fi\n  ;;\n\n  darwin* | rhapsody*)\n  if test \"$GXX\" = yes; then\n    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no\n    case \"$host_os\" in\n    rhapsody* | darwin1.[[012]])\n      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'\n      ;;\n    *) # Darwin 1.3 on\n      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then\n      \t_LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'\n      else\n        case ${MACOSX_DEPLOYMENT_TARGET} in\n          10.[[012]])\n            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'\n            ;;\n          10.*)\n            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'\n            ;;\n        esac\n      fi\n      ;;\n    esac\n    lt_int_apple_cc_single_mod=no\n    output_verbose_link_cmd='echo'\n    if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then\n      lt_int_apple_cc_single_mod=yes\n    fi\n    if test \"X$lt_int_apple_cc_single_mod\" = Xyes ; then\n      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'\n    else\n      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -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'\n    fi\n    _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'\n\n    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's\n    if test \"X$lt_int_apple_cc_single_mod\" = Xyes ; then\n      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e \"s,#.*,,\" -e \"s,^[    ]*,,\" -e \"s,^\\(..*\\),_&,\" < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'\n    else\n      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e \"s,#.*,,\" -e \"s,^[    ]*,,\" -e \"s,^\\(..*\\),_&,\" < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'\n    fi\n    _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e \"s,#.*,,\" -e \"s,^[    ]*,,\" -e \"s,^\\(..*\\),_&,\" < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'\n    _LT_AC_TAGVAR(hardcode_direct, $1)=no\n    _LT_AC_TAGVAR(hardcode_automatic, $1)=yes\n    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported\n    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'\n    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes\n  else\n    _LT_AC_TAGVAR(ld_shlibs, $1)=no\n  fi\n    ;;\n\n  dgux*)\n    case $cc_basename in\n      ec++)\n\t# FIXME: insert proper C++ library support\n\t_LT_AC_TAGVAR(ld_shlibs, $1)=no\n\t;;\n      ghcx)\n\t# Green Hills C++ Compiler\n\t# FIXME: insert proper C++ library support\n\t_LT_AC_TAGVAR(ld_shlibs, $1)=no\n\t;;\n      *)\n\t# FIXME: insert proper C++ library support\n\t_LT_AC_TAGVAR(ld_shlibs, $1)=no\n\t;;\n    esac\n    ;;\n  freebsd[12]*)\n    # C++ shared libraries reported to be fairly broken before switch to ELF\n    _LT_AC_TAGVAR(ld_shlibs, $1)=no\n    ;;\n  freebsd-elf*)\n    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no\n    ;;\n  freebsd* | kfreebsd*-gnu)\n    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF\n    # conventions\n    _LT_AC_TAGVAR(ld_shlibs, $1)=yes\n    ;;\n  gnu*)\n    ;;\n  hpux9*)\n    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'\n    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:\n    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'\n    _LT_AC_TAGVAR(hardcode_direct, $1)=yes\n    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,\n\t\t\t\t# but as the default\n\t\t\t\t# location of the library.\n\n    case $cc_basename in\n    CC)\n      # FIXME: insert proper C++ library support\n      _LT_AC_TAGVAR(ld_shlibs, $1)=no\n      ;;\n    aCC)\n      _LT_AC_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'\n      # Commands to make compiler produce verbose output that lists\n      # what \"hidden\" libraries, object files and flags are used when\n      # linking a shared library.\n      #\n      # There doesn't appear to be a way to prevent this compiler from\n      # explicitly linking system object files so we need to strip them\n      # from the output so that they don't get included in the library\n      # dependencies.\n      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; echo $list'\n      ;;\n    *)\n      if test \"$GXX\" = yes; then\n        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${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'\n      else\n        # FIXME: insert proper C++ library support\n        _LT_AC_TAGVAR(ld_shlibs, $1)=no\n      fi\n      ;;\n    esac\n    ;;\n  hpux10*|hpux11*)\n    if test $with_gnu_ld = no; then\n      case \"$host_cpu\" in\n      hppa*64*)\n\t_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'\n\t_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'\n\t_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:\n        ;;\n      ia64*)\n\t_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n        ;;\n      *)\n\t_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'\n\t_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:\n\t_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'\n        ;;\n      esac\n    fi\n    case \"$host_cpu\" in\n    hppa*64*)\n      _LT_AC_TAGVAR(hardcode_direct, $1)=no\n      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n    ia64*)\n      _LT_AC_TAGVAR(hardcode_direct, $1)=no\n      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,\n\t\t\t\t\t      # but as the default\n\t\t\t\t\t      # location of the library.\n      ;;\n    *)\n      _LT_AC_TAGVAR(hardcode_direct, $1)=yes\n      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,\n\t\t\t\t\t      # but as the default\n\t\t\t\t\t      # location of the library.\n      ;;\n    esac\n\n    case $cc_basename in\n      CC)\n\t# FIXME: insert proper C++ library support\n\t_LT_AC_TAGVAR(ld_shlibs, $1)=no\n\t;;\n      aCC)\n\tcase \"$host_cpu\" in\n\thppa*64*|ia64*)\n\t  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'\n\t  ;;\n\t*)\n\t  _LT_AC_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'\n\t  ;;\n\tesac\n\t# Commands to make compiler produce verbose output that lists\n\t# what \"hidden\" libraries, object files and flags are used when\n\t# linking a shared library.\n\t#\n\t# There doesn't appear to be a way to prevent this compiler from\n\t# explicitly linking system object files so we need to strip them\n\t# from the output so that they don't get included in the library\n\t# dependencies.\n\toutput_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; echo $list'\n\t;;\n      *)\n\tif test \"$GXX\" = yes; then\n\t  if test $with_gnu_ld = no; then\n\t    case \"$host_cpu\" in\n\t    ia64*|hppa*64*)\n\t      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'\n\t      ;;\n\t    *)\n\t      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'\n\t      ;;\n\t    esac\n\t  fi\n\telse\n\t  # FIXME: insert proper C++ library support\n\t  _LT_AC_TAGVAR(ld_shlibs, $1)=no\n\tfi\n\t;;\n    esac\n    ;;\n  irix5* | irix6*)\n    case $cc_basename in\n      CC)\n\t# SGI C++\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n \"$verstring\" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'\n\n\t# Archives containing C++ object files must be created using\n\t# \"CC -ar\", where \"CC\" is the IRIX C++ compiler.  This is\n\t# necessary to make sure instantiated templates are included\n\t# in the archive.\n\t_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'\n\t;;\n      *)\n\tif test \"$GXX\" = yes; then\n\t  if test \"$with_gnu_ld\" = no; then\n\t    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n \"$verstring\" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'\n\t  else\n\t    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n \"$verstring\" && echo ${wl}-set_version ${wl}$verstring` -o $lib'\n\t  fi\n\tfi\n\t_LT_AC_TAGVAR(link_all_deplibs, $1)=yes\n\t;;\n    esac\n    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'\n    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:\n    ;;\n  linux*)\n    case $cc_basename in\n      KCC)\n\t# Kuck and Associates, Inc. (KAI) C++ Compiler\n\n\t# KCC will only create a shared library if the output file\n\t# ends with \".so\" (or \".sl\" for HP-UX), so rename the library\n\t# to its proper name (with version) after linking.\n\t_LT_AC_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'\n\t_LT_AC_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'\n\t# Commands to make compiler produce verbose output that lists\n\t# what \"hidden\" libraries, object files and flags are used when\n\t# linking a shared library.\n\t#\n\t# There doesn't appear to be a way to prevent this compiler from\n\t# explicitly linking system object files so we need to strip them\n\t# from the output so that they don't get included in the library\n\t# dependencies.\n\toutput_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; echo $list'\n\n\t_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'\n\t_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'\n\n\t# Archives containing C++ object files must be created using\n\t# \"CC -Bstatic\", where \"CC\" is the KAI C++ compiler.\n\t_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'\n\t;;\n      icpc)\n\t# Intel C++\n\twith_gnu_ld=yes\n\t_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'\n\t_LT_AC_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'\n\t_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'\n\t_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'\n\t_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'\n\t;;\n      cxx)\n\t# Compaq C++\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'\n\t_LT_AC_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'\n\n\trunpath_var=LD_RUN_PATH\n\t_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'\n\t_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:\n\n\t# Commands to make compiler produce verbose output that lists\n\t# what \"hidden\" libraries, object files and flags are used when\n\t# linking a shared library.\n\t#\n\t# There doesn't appear to be a way to prevent this compiler from\n\t# explicitly linking system object files so we need to strip them\n\t# from the output so that they don't get included in the library\n\t# dependencies.\n\toutput_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"ld\"`; templist=`echo $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; echo $list'\n\t;;\n    esac\n    ;;\n  lynxos*)\n    # FIXME: insert proper C++ library support\n    _LT_AC_TAGVAR(ld_shlibs, $1)=no\n    ;;\n  m88k*)\n    # FIXME: insert proper C++ library support\n    _LT_AC_TAGVAR(ld_shlibs, $1)=no\n    ;;\n  mvs*)\n    case $cc_basename in\n      cxx)\n\t# FIXME: insert proper C++ library support\n\t_LT_AC_TAGVAR(ld_shlibs, $1)=no\n\t;;\n      *)\n\t# FIXME: insert proper C++ library support\n\t_LT_AC_TAGVAR(ld_shlibs, $1)=no\n\t;;\n    esac\n    ;;\n  netbsd*)\n    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then\n      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'\n      wlarc=\n      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'\n      _LT_AC_TAGVAR(hardcode_direct, $1)=yes\n      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n    fi\n    # Workaround some broken pre-1.5 toolchains\n    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e \"s:-lgcc -lc -lgcc::\"'\n    ;;\n  osf3*)\n    case $cc_basename in\n      KCC)\n\t# Kuck and Associates, Inc. (KAI) C++ Compiler\n\n\t# KCC will only create a shared library if the output file\n\t# ends with \".so\" (or \".sl\" for HP-UX), so rename the library\n\t# to its proper name (with version) after linking.\n\t_LT_AC_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'\n\n\t_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'\n\t_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:\n\n\t# Archives containing C++ object files must be created using\n\t# \"CC -Bstatic\", where \"CC\" is the KAI C++ compiler.\n\t_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'\n\n\t;;\n      RCC)\n\t# Rational C++ 2.4.1\n\t# FIXME: insert proper C++ library support\n\t_LT_AC_TAGVAR(ld_shlibs, $1)=no\n\t;;\n      cxx)\n\t_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\\*'\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n \"$verstring\" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'\n\n\t_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'\n\t_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:\n\n\t# Commands to make compiler produce verbose output that lists\n\t# what \"hidden\" libraries, object files and flags are used when\n\t# linking a shared library.\n\t#\n\t# There doesn't appear to be a way to prevent this compiler from\n\t# explicitly linking system object files so we need to strip them\n\t# from the output so that they don't get included in the library\n\t# dependencies.\n\toutput_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"ld\" | grep -v \"ld:\"`; templist=`echo $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; echo $list'\n\t;;\n      *)\n\tif test \"$GXX\" = yes && test \"$with_gnu_ld\" = no; then\n\t  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\\*'\n\t  _LT_AC_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\" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'\n\n\t  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'\n\t  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:\n\n\t  # Commands to make compiler produce verbose output that lists\n\t  # what \"hidden\" libraries, object files and flags are used when\n\t  # linking a shared library.\n\t  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\\-L\"'\n\n\telse\n\t  # FIXME: insert proper C++ library support\n\t  _LT_AC_TAGVAR(ld_shlibs, $1)=no\n\tfi\n\t;;\n    esac\n    ;;\n  osf4* | osf5*)\n    case $cc_basename in\n      KCC)\n\t# Kuck and Associates, Inc. (KAI) C++ Compiler\n\n\t# KCC will only create a shared library if the output file\n\t# ends with \".so\" (or \".sl\" for HP-UX), so rename the library\n\t# to its proper name (with version) after linking.\n\t_LT_AC_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'\n\n\t_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'\n\t_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:\n\n\t# Archives containing C++ object files must be created using\n\t# the KAI C++ compiler.\n\t_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'\n\t;;\n      RCC)\n\t# Rational C++ 2.4.1\n\t# FIXME: insert proper C++ library support\n\t_LT_AC_TAGVAR(ld_shlibs, $1)=no\n\t;;\n      cxx)\n\t_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \\*'\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n \"$verstring\" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'\n\t_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf \"%s %s\\\\n\" -exported_symbol \"\\$i\" >> $lib.exp; done~\n\t  echo \"-hidden\">> $lib.exp~\n\t  $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\t$verstring` -update_registry $objdir/so_locations -o $lib~\n\t  $rm $lib.exp'\n\n\t_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'\n\t_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:\n\n\t# Commands to make compiler produce verbose output that lists\n\t# what \"hidden\" libraries, object files and flags are used when\n\t# linking a shared library.\n\t#\n\t# There doesn't appear to be a way to prevent this compiler from\n\t# explicitly linking system object files so we need to strip them\n\t# from the output so that they don't get included in the library\n\t# dependencies.\n\toutput_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"ld\" | grep -v \"ld:\"`; templist=`echo $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; echo $list'\n\t;;\n      *)\n\tif test \"$GXX\" = yes && test \"$with_gnu_ld\" = no; then\n\t  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\\*'\n\t _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n \"$verstring\" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'\n\n\t  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'\n\t  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:\n\n\t  # Commands to make compiler produce verbose output that lists\n\t  # what \"hidden\" libraries, object files and flags are used when\n\t  # linking a shared library.\n\t  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\\-L\"'\n\n\telse\n\t  # FIXME: insert proper C++ library support\n\t  _LT_AC_TAGVAR(ld_shlibs, $1)=no\n\tfi\n\t;;\n    esac\n    ;;\n  psos*)\n    # FIXME: insert proper C++ library support\n    _LT_AC_TAGVAR(ld_shlibs, $1)=no\n    ;;\n  sco*)\n    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no\n    case $cc_basename in\n      CC)\n\t# FIXME: insert proper C++ library support\n\t_LT_AC_TAGVAR(ld_shlibs, $1)=no\n\t;;\n      *)\n\t# FIXME: insert proper C++ library support\n\t_LT_AC_TAGVAR(ld_shlibs, $1)=no\n\t;;\n    esac\n    ;;\n  sunos4*)\n    case $cc_basename in\n      CC)\n\t# Sun C++ 4.x\n\t# FIXME: insert proper C++ library support\n\t_LT_AC_TAGVAR(ld_shlibs, $1)=no\n\t;;\n      lcc)\n\t# Lucid\n\t# FIXME: insert proper C++ library support\n\t_LT_AC_TAGVAR(ld_shlibs, $1)=no\n\t;;\n      *)\n\t# FIXME: insert proper C++ library support\n\t_LT_AC_TAGVAR(ld_shlibs, $1)=no\n\t;;\n    esac\n    ;;\n  solaris*)\n    case $cc_basename in\n      CC)\n\t# Sun C++ 4.2, 5.x and Centerline C++\n\t_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'\n\t_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~$echo \"local: *; };\" >> $lib.exp~\n\t$CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'\n\n\t_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'\n\t_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n\tcase $host_os in\n\t  solaris2.[0-5] | solaris2.[0-5].*) ;;\n\t  *)\n\t    # The C++ compiler is used as linker so we must use $wl\n\t    # flag to pass the commands to the underlying system\n\t    # linker.\n\t    # Supported since Solaris 2.6 (maybe 2.5.1?)\n\t    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'\n\t    ;;\n\tesac\n\t_LT_AC_TAGVAR(link_all_deplibs, $1)=yes\n\n\t# Commands to make compiler produce verbose output that lists\n\t# what \"hidden\" libraries, object files and flags are used when\n\t# linking a shared library.\n\t#\n\t# There doesn't appear to be a way to prevent this compiler from\n\t# explicitly linking system object files so we need to strip them\n\t# from the output so that they don't get included in the library\n\t# dependencies.\n\toutput_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\\-[[LR]]\"`; list=\"\"; for z in $templist; do case $z in conftest.$objext) list=\"$list $z\";; *.$objext);; *) list=\"$list $z\";;esac; done; echo $list'\n\n\t# Archives containing C++ object files must be created using\n\t# \"CC -xar\", where \"CC\" is the Sun C++ compiler.  This is\n\t# necessary to make sure instantiated templates are included\n\t# in the archive.\n\t_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'\n\t;;\n      gcx)\n\t# Green Hills C++ Compiler\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'\n\n\t# The C++ compiler must be used to create the archive.\n\t_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'\n\t;;\n      *)\n\t# GNU C++ compiler with Solaris linker\n\tif test \"$GXX\" = yes && test \"$with_gnu_ld\" = no; then\n\t  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'\n\t  if $CC --version | grep -v '^2\\.7' > /dev/null; then\n\t    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'\n\t    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~$echo \"local: *; };\" >> $lib.exp~\n\t\t$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'\n\n\t    # Commands to make compiler produce verbose output that lists\n\t    # what \"hidden\" libraries, object files and flags are used when\n\t    # linking a shared library.\n\t    output_verbose_link_cmd=\"$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \\\"\\-L\\\"\"\n\t  else\n\t    # g++ 2.7 appears to require `-G' NOT `-shared' on this\n\t    # platform.\n\t    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'\n\t    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~$echo \"local: *; };\" >> $lib.exp~\n\t\t$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'\n\n\t    # Commands to make compiler produce verbose output that lists\n\t    # what \"hidden\" libraries, object files and flags are used when\n\t    # linking a shared library.\n\t    output_verbose_link_cmd=\"$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \\\"\\-L\\\"\"\n\t  fi\n\n\t  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'\n\tfi\n\t;;\n    esac\n    ;;\n  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)\n    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no\n    ;;\n  tandem*)\n    case $cc_basename in\n      NCC)\n\t# NonStop-UX NCC 3.20\n\t# FIXME: insert proper C++ library support\n\t_LT_AC_TAGVAR(ld_shlibs, $1)=no\n\t;;\n      *)\n\t# FIXME: insert proper C++ library support\n\t_LT_AC_TAGVAR(ld_shlibs, $1)=no\n\t;;\n    esac\n    ;;\n  vxworks*)\n    # FIXME: insert proper C++ library support\n    _LT_AC_TAGVAR(ld_shlibs, $1)=no\n    ;;\n  *)\n    # FIXME: insert proper C++ library support\n    _LT_AC_TAGVAR(ld_shlibs, $1)=no\n    ;;\nesac\nAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])\ntest \"$_LT_AC_TAGVAR(ld_shlibs, $1)\" = no && can_build_shared=no\n\n_LT_AC_TAGVAR(GCC, $1)=\"$GXX\"\n_LT_AC_TAGVAR(LD, $1)=\"$LD\"\n\nAC_LIBTOOL_POSTDEP_PREDEP($1)\nAC_LIBTOOL_PROG_COMPILER_PIC($1)\nAC_LIBTOOL_PROG_CC_C_O($1)\nAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)\nAC_LIBTOOL_PROG_LD_SHLIBS($1)\nAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)\nAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)\nAC_LIBTOOL_SYS_LIB_STRIP\nAC_LIBTOOL_DLOPEN_SELF($1)\n\nAC_LIBTOOL_CONFIG($1)\n\nAC_LANG_POP\nCC=$lt_save_CC\nLDCXX=$LD\nLD=$lt_save_LD\nGCC=$lt_save_GCC\nwith_gnu_ldcxx=$with_gnu_ld\nwith_gnu_ld=$lt_save_with_gnu_ld\nlt_cv_path_LDCXX=$lt_cv_path_LD\nlt_cv_path_LD=$lt_save_path_LD\nlt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld\nlt_cv_prog_gnu_ld=$lt_save_with_gnu_ld\n])# AC_LIBTOOL_LANG_CXX_CONFIG\n\n# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])\n# ------------------------\n# Figure out \"hidden\" library dependencies from verbose\n# compiler output when linking a shared library.\n# Parse the compiler output and extract the necessary\n# objects, libraries and library flags.\nAC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[\ndnl we can't use the lt_simple_compile_test_code here,\ndnl because it contains code intended for an executable,\ndnl not a library.  It's possible we should let each\ndnl tag define a new lt_????_link_test_code variable,\ndnl but it's only used here...\nifelse([$1],[],[cat > conftest.$ac_ext <<EOF\nint a;\nvoid foo (void) { a = 0; }\nEOF\n],[$1],[CXX],[cat > conftest.$ac_ext <<EOF\nclass Foo\n{\npublic:\n  Foo (void) { a = 0; }\nprivate:\n  int a;\n};\nEOF\n],[$1],[F77],[cat > conftest.$ac_ext <<EOF\n      subroutine foo\n      implicit none\n      integer*4 a\n      a=0\n      return\n      end\nEOF\n],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF\npublic class foo {\n  private int a;\n  public void bar (void) {\n    a = 0;\n  }\n};\nEOF\n])\ndnl Parse the compiler output and extract the necessary\ndnl objects, libraries and library flags.\nif AC_TRY_EVAL(ac_compile); then\n  # Parse the compiler output and extract the necessary\n  # objects, libraries and library flags.\n\n  # Sentinel used to keep track of whether or not we are before\n  # the conftest object file.\n  pre_test_object_deps_done=no\n\n  # The `*' in the case matches for architectures that use `case' in\n  # $output_verbose_cmd can trigger glob expansion during the loop\n  # eval without this substitution.\n  output_verbose_link_cmd=\"`$echo \\\"X$output_verbose_link_cmd\\\" | $Xsed -e \\\"$no_glob_subst\\\"`\"\n\n  for p in `eval $output_verbose_link_cmd`; do\n    case $p in\n\n    -L* | -R* | -l*)\n       # Some compilers place space between \"-{L,R}\" and the path.\n       # Remove the space.\n       if test $p = \"-L\" \\\n\t  || test $p = \"-R\"; then\n\t prev=$p\n\t continue\n       else\n\t prev=\n       fi\n\n       if test \"$pre_test_object_deps_done\" = no; then\n\t case $p in\n\t -L* | -R*)\n\t   # Internal compiler library paths should come after those\n\t   # provided the user.  The postdeps already come after the\n\t   # user supplied libs so there is no need to process them.\n\t   if test -z \"$_LT_AC_TAGVAR(compiler_lib_search_path, $1)\"; then\n\t     _LT_AC_TAGVAR(compiler_lib_search_path, $1)=\"${prev}${p}\"\n\t   else\n\t     _LT_AC_TAGVAR(compiler_lib_search_path, $1)=\"${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}\"\n\t   fi\n\t   ;;\n\t # The \"-l\" case would never come before the object being\n\t # linked, so don't bother handling this case.\n\t esac\n       else\n\t if test -z \"$_LT_AC_TAGVAR(postdeps, $1)\"; then\n\t   _LT_AC_TAGVAR(postdeps, $1)=\"${prev}${p}\"\n\t else\n\t   _LT_AC_TAGVAR(postdeps, $1)=\"${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}\"\n\t fi\n       fi\n       ;;\n\n    *.$objext)\n       # This assumes that the test object file only shows up\n       # once in the compiler output.\n       if test \"$p\" = \"conftest.$objext\"; then\n\t pre_test_object_deps_done=yes\n\t continue\n       fi\n\n       if test \"$pre_test_object_deps_done\" = no; then\n\t if test -z \"$_LT_AC_TAGVAR(predep_objects, $1)\"; then\n\t   _LT_AC_TAGVAR(predep_objects, $1)=\"$p\"\n\t else\n\t   _LT_AC_TAGVAR(predep_objects, $1)=\"$_LT_AC_TAGVAR(predep_objects, $1) $p\"\n\t fi\n       else\n\t if test -z \"$_LT_AC_TAGVAR(postdep_objects, $1)\"; then\n\t   _LT_AC_TAGVAR(postdep_objects, $1)=\"$p\"\n\t else\n\t   _LT_AC_TAGVAR(postdep_objects, $1)=\"$_LT_AC_TAGVAR(postdep_objects, $1) $p\"\n\t fi\n       fi\n       ;;\n\n    *) ;; # Ignore the rest.\n\n    esac\n  done\n\n  # Clean up.\n  rm -f a.out a.exe\nelse\n  echo \"libtool.m4: error: problem compiling $1 test program\"\nfi\n\n$rm -f confest.$objext\n\ncase \" $_LT_AC_TAGVAR(postdeps, $1) \" in\n*\" -lc \"*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;\nesac\n])# AC_LIBTOOL_POSTDEP_PREDEP\n\n# AC_LIBTOOL_LANG_F77_CONFIG\n# ------------------------\n# Ensure that the configuration vars for the C compiler are\n# suitably defined.  Those variables are subsequently used by\n# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.\nAC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])\nAC_DEFUN([_LT_AC_LANG_F77_CONFIG],\n[AC_REQUIRE([AC_PROG_F77])\nAC_LANG_PUSH(Fortran 77)\n\n_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no\n_LT_AC_TAGVAR(allow_undefined_flag, $1)=\n_LT_AC_TAGVAR(always_export_symbols, $1)=no\n_LT_AC_TAGVAR(archive_expsym_cmds, $1)=\n_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=\n_LT_AC_TAGVAR(hardcode_direct, $1)=no\n_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=\n_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=\n_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=\n_LT_AC_TAGVAR(hardcode_minus_L, $1)=no\n_LT_AC_TAGVAR(hardcode_automatic, $1)=no\n_LT_AC_TAGVAR(module_cmds, $1)=\n_LT_AC_TAGVAR(module_expsym_cmds, $1)=\n_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown\n_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds\n_LT_AC_TAGVAR(no_undefined_flag, $1)=\n_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=\n_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no\n\n# Source file extension for f77 test sources.\nac_ext=f\n\n# Object file extension for compiled f77 test sources.\nobjext=o\n_LT_AC_TAGVAR(objext, $1)=$objext\n\n# Code to be used in simple compile tests\nlt_simple_compile_test_code=\"      subroutine t\\n      return\\n      end\\n\"\n\n# Code to be used in simple link tests\nlt_simple_link_test_code=\"      program t\\n      end\\n\"\n\n# ltmain only uses $CC for tagged configurations so make sure $CC is set.\n_LT_AC_SYS_COMPILER\n\n# Allow CC to be a program name with arguments.\nlt_save_CC=\"$CC\"\nCC=${F77-\"f77\"}\ncompiler=$CC\n_LT_AC_TAGVAR(compiler, $1)=$CC\ncc_basename=`$echo X\"$compiler\" | $Xsed -e 's%^.*/%%'`\n\nAC_MSG_CHECKING([if libtool supports shared libraries])\nAC_MSG_RESULT([$can_build_shared])\n\nAC_MSG_CHECKING([whether to build shared libraries])\ntest \"$can_build_shared\" = \"no\" && enable_shared=no\n\n# On AIX, shared libraries and static libraries use the same namespace, and\n# are all built from PIC.\ncase \"$host_os\" in\naix3*)\n  test \"$enable_shared\" = yes && enable_static=no\n  if test -n \"$RANLIB\"; then\n    archive_cmds=\"$archive_cmds~\\$RANLIB \\$lib\"\n    postinstall_cmds='$RANLIB $lib'\n  fi\n  ;;\naix4* | aix5*)\n  test \"$enable_shared\" = yes && enable_static=no\n  ;;\nesac\nAC_MSG_RESULT([$enable_shared])\n\nAC_MSG_CHECKING([whether to build static libraries])\n# Make sure either enable_shared or enable_static is yes.\ntest \"$enable_shared\" = yes || enable_static=yes\nAC_MSG_RESULT([$enable_static])\n\ntest \"$_LT_AC_TAGVAR(ld_shlibs, $1)\" = no && can_build_shared=no\n\n_LT_AC_TAGVAR(GCC, $1)=\"$G77\"\n_LT_AC_TAGVAR(LD, $1)=\"$LD\"\n\nAC_LIBTOOL_PROG_COMPILER_PIC($1)\nAC_LIBTOOL_PROG_CC_C_O($1)\nAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)\nAC_LIBTOOL_PROG_LD_SHLIBS($1)\nAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)\nAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)\nAC_LIBTOOL_SYS_LIB_STRIP\n\n\nAC_LIBTOOL_CONFIG($1)\n\nAC_LANG_POP\nCC=\"$lt_save_CC\"\n])# AC_LIBTOOL_LANG_F77_CONFIG\n\n\n# AC_LIBTOOL_LANG_GCJ_CONFIG\n# --------------------------\n# Ensure that the configuration vars for the C compiler are\n# suitably defined.  Those variables are subsequently used by\n# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.\nAC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])\nAC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],\n[AC_LANG_SAVE\n\n# Source file extension for Java test sources.\nac_ext=java\n\n# Object file extension for compiled Java test sources.\nobjext=o\n_LT_AC_TAGVAR(objext, $1)=$objext\n\n# Code to be used in simple compile tests\nlt_simple_compile_test_code=\"class foo {}\\n\"\n\n# Code to be used in simple link tests\nlt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\\n'\n\n# ltmain only uses $CC for tagged configurations so make sure $CC is set.\n_LT_AC_SYS_COMPILER\n\n# Allow CC to be a program name with arguments.\nlt_save_CC=\"$CC\"\nCC=${GCJ-\"gcj\"}\ncompiler=$CC\n_LT_AC_TAGVAR(compiler, $1)=$CC\n\n# GCJ did not exist at the time GCC didn't implicitly link libc in.\n_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no\n\nAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)\nAC_LIBTOOL_PROG_COMPILER_PIC($1)\nAC_LIBTOOL_PROG_CC_C_O($1)\nAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)\nAC_LIBTOOL_PROG_LD_SHLIBS($1)\nAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)\nAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)\nAC_LIBTOOL_SYS_LIB_STRIP\nAC_LIBTOOL_DLOPEN_SELF($1)\n\nAC_LIBTOOL_CONFIG($1)\n\nAC_LANG_RESTORE\nCC=\"$lt_save_CC\"\n])# AC_LIBTOOL_LANG_GCJ_CONFIG\n\n\n# AC_LIBTOOL_LANG_RC_CONFIG\n# --------------------------\n# Ensure that the configuration vars for the Windows resource compiler are\n# suitably defined.  Those variables are subsequently used by\n# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.\nAC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])\nAC_DEFUN([_LT_AC_LANG_RC_CONFIG],\n[AC_LANG_SAVE\n\n# Source file extension for RC test sources.\nac_ext=rc\n\n# Object file extension for compiled RC test sources.\nobjext=o\n_LT_AC_TAGVAR(objext, $1)=$objext\n\n# Code to be used in simple compile tests\nlt_simple_compile_test_code='sample MENU { MENUITEM \"&Soup\", 100, CHECKED }\\n'\n\n# Code to be used in simple link tests\nlt_simple_link_test_code=\"$lt_simple_compile_test_code\"\n\n# ltmain only uses $CC for tagged configurations so make sure $CC is set.\n_LT_AC_SYS_COMPILER\n\n# Allow CC to be a program name with arguments.\nlt_save_CC=\"$CC\"\nCC=${RC-\"windres\"}\ncompiler=$CC\n_LT_AC_TAGVAR(compiler, $1)=$CC\n_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes\n\nAC_LIBTOOL_CONFIG($1)\n\nAC_LANG_RESTORE\nCC=\"$lt_save_CC\"\n])# AC_LIBTOOL_LANG_RC_CONFIG\n\n\n# AC_LIBTOOL_CONFIG([TAGNAME])\n# ----------------------------\n# If TAGNAME is not passed, then create an initial libtool script\n# with a default configuration from the untagged config vars.  Otherwise\n# add code to config.status for appending the configuration named by\n# TAGNAME from the matching tagged config vars.\nAC_DEFUN([AC_LIBTOOL_CONFIG],\n[# The else clause should only fire when bootstrapping the\n# libtool distribution, otherwise you forgot to ship ltmain.sh\n# with your package, and you will get complaints that there are\n# no rules to generate ltmain.sh.\nif test -f \"$ltmain\"; then\n  # See if we are running on zsh, and set the options which allow our commands through\n  # without removal of \\ escapes.\n  if test -n \"${ZSH_VERSION+set}\" ; then\n    setopt NO_GLOB_SUBST\n  fi\n  # Now quote all the things that may contain metacharacters while being\n  # careful not to overquote the AC_SUBSTed values.  We take copies of the\n  # variables and quote the copies for generation of the libtool script.\n  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \\\n    SED SHELL STRIP \\\n    libname_spec library_names_spec soname_spec extract_expsyms_cmds \\\n    old_striplib striplib file_magic_cmd finish_cmds finish_eval \\\n    deplibs_check_method reload_flag reload_cmds need_locks \\\n    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \\\n    lt_cv_sys_global_symbol_to_c_name_address \\\n    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \\\n    old_postinstall_cmds old_postuninstall_cmds \\\n    _LT_AC_TAGVAR(compiler, $1) \\\n    _LT_AC_TAGVAR(CC, $1) \\\n    _LT_AC_TAGVAR(LD, $1) \\\n    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \\\n    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \\\n    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \\\n    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \\\n    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \\\n    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \\\n    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \\\n    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \\\n    _LT_AC_TAGVAR(old_archive_cmds, $1) \\\n    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \\\n    _LT_AC_TAGVAR(predep_objects, $1) \\\n    _LT_AC_TAGVAR(postdep_objects, $1) \\\n    _LT_AC_TAGVAR(predeps, $1) \\\n    _LT_AC_TAGVAR(postdeps, $1) \\\n    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \\\n    _LT_AC_TAGVAR(archive_cmds, $1) \\\n    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \\\n    _LT_AC_TAGVAR(postinstall_cmds, $1) \\\n    _LT_AC_TAGVAR(postuninstall_cmds, $1) \\\n    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \\\n    _LT_AC_TAGVAR(allow_undefined_flag, $1) \\\n    _LT_AC_TAGVAR(no_undefined_flag, $1) \\\n    _LT_AC_TAGVAR(export_symbols_cmds, $1) \\\n    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \\\n    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \\\n    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \\\n    _LT_AC_TAGVAR(hardcode_automatic, $1) \\\n    _LT_AC_TAGVAR(module_cmds, $1) \\\n    _LT_AC_TAGVAR(module_expsym_cmds, $1) \\\n    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \\\n    _LT_AC_TAGVAR(exclude_expsyms, $1) \\\n    _LT_AC_TAGVAR(include_expsyms, $1); do\n\n    case $var in\n    _LT_AC_TAGVAR(old_archive_cmds, $1) | \\\n    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \\\n    _LT_AC_TAGVAR(archive_cmds, $1) | \\\n    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \\\n    _LT_AC_TAGVAR(module_cmds, $1) | \\\n    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \\\n    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \\\n    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \\\n    extract_expsyms_cmds | reload_cmds | finish_cmds | \\\n    postinstall_cmds | postuninstall_cmds | \\\n    old_postinstall_cmds | old_postuninstall_cmds | \\\n    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)\n      # Double-quote double-evaled strings.\n      eval \"lt_$var=\\\\\\\"\\`\\$echo \\\"X\\$$var\\\" | \\$Xsed -e \\\"\\$double_quote_subst\\\" -e \\\"\\$sed_quote_subst\\\" -e \\\"\\$delay_variable_subst\\\"\\`\\\\\\\"\"\n      ;;\n    *)\n      eval \"lt_$var=\\\\\\\"\\`\\$echo \\\"X\\$$var\\\" | \\$Xsed -e \\\"\\$sed_quote_subst\\\"\\`\\\\\\\"\"\n      ;;\n    esac\n  done\n\n  case $lt_echo in\n  *'\\[$]0 --fallback-echo\"')\n    lt_echo=`$echo \"X$lt_echo\" | $Xsed -e 's/\\\\\\\\\\\\\\[$]0 --fallback-echo\"[$]/[$]0 --fallback-echo\"/'`\n    ;;\n  esac\n\nifelse([$1], [],\n  [cfgfile=\"${ofile}T\"\n  trap \"$rm \\\"$cfgfile\\\"; exit 1\" 1 2 15\n  $rm -f \"$cfgfile\"\n  AC_MSG_NOTICE([creating $ofile])],\n  [cfgfile=\"$ofile\"])\n\n  cat <<__EOF__ >> \"$cfgfile\"\nifelse([$1], [],\n[#! $SHELL\n\n# `$echo \"$cfgfile\" | sed 's%^.*/%%'` - Provide generalized library-building support services.\n# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)\n# NOTE: Changes made to this file will be lost: look at ltmain.sh.\n#\n# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001\n# Free Software Foundation, Inc.\n#\n# This file is part of GNU Libtool:\n# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n#\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that program.\n\n# A sed program that does not truncate output.\nSED=$lt_SED\n\n# Sed that helps us avoid accidentally triggering echo(1) options like -n.\nXsed=\"$SED -e s/^X//\"\n\n# The HP-UX ksh and POSIX shell print the target directory to stdout\n# if CDPATH is set.\nif test \"X\\${CDPATH+set}\" = Xset; then CDPATH=:; export CDPATH; fi\n\n# The names of the tagged configurations supported by this script.\navailable_tags=\n\n# ### BEGIN LIBTOOL CONFIG],\n[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])\n\n# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:\n\n# Shell to use when invoking shell scripts.\nSHELL=$lt_SHELL\n\n# Whether or not to build shared libraries.\nbuild_libtool_libs=$enable_shared\n\n# Whether or not to build static libraries.\nbuild_old_libs=$enable_static\n\n# Whether or not to add -lc for building shared libraries.\nbuild_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)\n\n# Whether or not to disallow shared libs when runtime libs are static\nallow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)\n\n# Whether or not to optimize for fast installation.\nfast_install=$enable_fast_install\n\n# The host system.\nhost_alias=$host_alias\nhost=$host\n\n# An echo program that does not interpret backslashes.\necho=$lt_echo\n\n# The archiver.\nAR=$lt_AR\nAR_FLAGS=$lt_AR_FLAGS\n\n# A C compiler.\nLTCC=$lt_LTCC\n\n# A language-specific compiler.\nCC=$lt_[]_LT_AC_TAGVAR(compiler, $1)\n\n# Is the compiler the GNU C compiler?\nwith_gcc=$_LT_AC_TAGVAR(GCC, $1)\n\n# An ERE matcher.\nEGREP=$lt_EGREP\n\n# The linker used to build libraries.\nLD=$lt_[]_LT_AC_TAGVAR(LD, $1)\n\n# Whether we need hard or soft links.\nLN_S=$lt_LN_S\n\n# A BSD-compatible nm program.\nNM=$lt_NM\n\n# A symbol stripping program\nSTRIP=$lt_STRIP\n\n# Used to examine libraries when file_magic_cmd begins \"file\"\nMAGIC_CMD=$MAGIC_CMD\n\n# Used on cygwin: DLL creation program.\nDLLTOOL=\"$DLLTOOL\"\n\n# Used on cygwin: object dumper.\nOBJDUMP=\"$OBJDUMP\"\n\n# Used on cygwin: assembler.\nAS=\"$AS\"\n\n# The name of the directory that contains temporary libtool files.\nobjdir=$objdir\n\n# How to create reloadable object files.\nreload_flag=$lt_reload_flag\nreload_cmds=$lt_reload_cmds\n\n# How to pass a linker flag through the compiler.\nwl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)\n\n# Object file suffix (normally \"o\").\nobjext=\"$ac_objext\"\n\n# Old archive suffix (normally \"a\").\nlibext=\"$libext\"\n\n# Shared library suffix (normally \".so\").\nshrext_cmds='$shrext_cmds'\n\n# Executable file suffix (normally \"\").\nexeext=\"$exeext\"\n\n# Additional compiler flags for building library objects.\npic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)\npic_mode=$pic_mode\n\n# What is the maximum length of a command?\nmax_cmd_len=$lt_cv_sys_max_cmd_len\n\n# Does compiler simultaneously support -c and -o options?\ncompiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)\n\n# Must we lock files when doing compilation ?\nneed_locks=$lt_need_locks\n\n# Do we need the lib prefix for modules?\nneed_lib_prefix=$need_lib_prefix\n\n# Do we need a version for libraries?\nneed_version=$need_version\n\n# Whether dlopen is supported.\ndlopen_support=$enable_dlopen\n\n# Whether dlopen of programs is supported.\ndlopen_self=$enable_dlopen_self\n\n# Whether dlopen of statically linked programs is supported.\ndlopen_self_static=$enable_dlopen_self_static\n\n# Compiler flag to prevent dynamic linking.\nlink_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\n\n# Compiler flag to turn off builtin functions.\nno_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)\n\n# Compiler flag to allow reflexive dlopens.\nexport_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)\n\n# Compiler flag to generate shared objects directly from archives.\nwhole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)\n\n# Compiler flag to generate thread-safe objects.\nthread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)\n\n# Library versioning type.\nversion_type=$version_type\n\n# Format of library name prefix.\nlibname_spec=$lt_libname_spec\n\n# List of archive names.  First name is the real one, the rest are links.\n# The last name is the one that the linker finds with -lNAME.\nlibrary_names_spec=$lt_library_names_spec\n\n# The coded name of the library, if different from the real name.\nsoname_spec=$lt_soname_spec\n\n# Commands used to build and install an old-style archive.\nRANLIB=$lt_RANLIB\nold_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)\nold_postinstall_cmds=$lt_old_postinstall_cmds\nold_postuninstall_cmds=$lt_old_postuninstall_cmds\n\n# Create an old-style archive from a shared archive.\nold_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)\n\n# Create a temporary old-style archive to link instead of a shared archive.\nold_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)\n\n# Commands used to build and install a shared archive.\narchive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)\narchive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)\npostinstall_cmds=$lt_postinstall_cmds\npostuninstall_cmds=$lt_postuninstall_cmds\n\n# Commands used to build a loadable module (assumed same as above if empty)\nmodule_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)\nmodule_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)\n\n# Commands to strip libraries.\nold_striplib=$lt_old_striplib\nstriplib=$lt_striplib\n\n# Dependencies to place before the objects being linked to create a\n# shared library.\npredep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)\n\n# Dependencies to place after the objects being linked to create a\n# shared library.\npostdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)\n\n# Dependencies to place before the objects being linked to create a\n# shared library.\npredeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)\n\n# Dependencies to place after the objects being linked to create a\n# shared library.\npostdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)\n\n# The library search path used internally by the compiler when linking\n# a shared library.\ncompiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)\n\n# Method to check whether dependent libraries are shared objects.\ndeplibs_check_method=$lt_deplibs_check_method\n\n# Command to use when deplibs_check_method == file_magic.\nfile_magic_cmd=$lt_file_magic_cmd\n\n# Flag that allows shared libraries with undefined symbols to be built.\nallow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)\n\n# Flag that forces no undefined symbols.\nno_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)\n\n# Commands used to finish a libtool library installation in a directory.\nfinish_cmds=$lt_finish_cmds\n\n# Same as above, but a single script fragment to be evaled but not shown.\nfinish_eval=$lt_finish_eval\n\n# Take the output of nm and produce a listing of raw symbols and C names.\nglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe\n\n# Transform the output of nm in a proper C declaration\nglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl\n\n# Transform the output of nm in a C name address pair\nglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address\n\n# This is the shared library runtime path variable.\nrunpath_var=$runpath_var\n\n# This is the shared library path variable.\nshlibpath_var=$shlibpath_var\n\n# Is shlibpath searched before the hard-coded library search path?\nshlibpath_overrides_runpath=$shlibpath_overrides_runpath\n\n# How to hardcode a shared library path into an executable.\nhardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)\n\n# Whether we should hardcode library paths into libraries.\nhardcode_into_libs=$hardcode_into_libs\n\n# Flag to hardcode \\$libdir into a binary during linking.\n# This must work even if \\$libdir does not exist.\nhardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)\n\n# If ld is used when linking, flag to hardcode \\$libdir into\n# a binary during linking. This must work even if \\$libdir does\n# not exist.\nhardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)\n\n# Whether we need a single -rpath flag with a separated argument.\nhardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)\n\n# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the\n# resulting binary.\nhardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)\n\n# Set to yes if using the -LDIR flag during linking hardcodes DIR into the\n# resulting binary.\nhardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)\n\n# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into\n# the resulting binary.\nhardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)\n\n# Set to yes if building a shared library automatically hardcodes DIR into the library\n# and all subsequent libraries and executables linked against it.\nhardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)\n\n# Variables whose values should be saved in libtool wrapper scripts and\n# restored at relink time.\nvariables_saved_for_relink=\"$variables_saved_for_relink\"\n\n# Whether libtool must link a program against all its dependency libraries.\nlink_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)\n\n# Compile-time system search path for libraries\nsys_lib_search_path_spec=$lt_sys_lib_search_path_spec\n\n# Run-time system search path for libraries\nsys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec\n\n# Fix the shell variable \\$srcfile for the compiler.\nfix_srcfile_path=\"$_LT_AC_TAGVAR(fix_srcfile_path, $1)\"\n\n# Set to yes if exported symbols are required.\nalways_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)\n\n# The commands to list exported symbols.\nexport_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)\n\n# The commands to extract the exported symbol list from a shared archive.\nextract_expsyms_cmds=$lt_extract_expsyms_cmds\n\n# Symbols that should not be listed in the preloaded symbols.\nexclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)\n\n# Symbols that must always be exported.\ninclude_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)\n\nifelse([$1],[],\n[# ### END LIBTOOL CONFIG],\n[# ### END LIBTOOL TAG CONFIG: $tagname])\n\n__EOF__\n\nifelse([$1],[], [\n  case $host_os in\n  aix3*)\n    cat <<\\EOF >> \"$cfgfile\"\n\n# AIX sometimes has problems with the GCC collect2 program.  For some\n# reason, if we set the COLLECT_NAMES environment variable, the problems\n# vanish in a puff of smoke.\nif test \"X${COLLECT_NAMES+set}\" != Xset; then\n  COLLECT_NAMES=\n  export COLLECT_NAMES\nfi\nEOF\n    ;;\n  esac\n\n  # We use sed instead of cat because bash on DJGPP gets confused if\n  # if finds mixed CR/LF and LF-only lines.  Since sed operates in\n  # text mode, it properly converts lines to CR/LF.  This bash problem\n  # is reportedly fixed, but why not run on old versions too?\n  sed '$q' \"$ltmain\" >> \"$cfgfile\" || (rm -f \"$cfgfile\"; exit 1)\n\n  mv -f \"$cfgfile\" \"$ofile\" || \\\n    (rm -f \"$ofile\" && cp \"$cfgfile\" \"$ofile\" && rm -f \"$cfgfile\")\n  chmod +x \"$ofile\"\n])\nelse\n  # If there is no Makefile yet, we rely on a make rule to execute\n  # `config.status --recheck' to rerun these tests and create the\n  # libtool script then.\n  ltmain_in=`echo $ltmain | sed -e 's/\\.sh$/.in/'`\n  if test -f \"$ltmain_in\"; then\n    test -f Makefile && make \"$ltmain\"\n  fi\nfi\n])# AC_LIBTOOL_CONFIG\n\n\n# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])\n# -------------------------------------------\nAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],\n[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl\n\n_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=\n\nif test \"$GCC\" = yes; then\n  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'\n\n  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],\n    lt_cv_prog_compiler_rtti_exceptions,\n    [-fno-rtti -fno-exceptions], [],\n    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=\"$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions\"])\nfi\n])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI\n\n\n# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE\n# ---------------------------------\nAC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],\n[AC_REQUIRE([AC_CANONICAL_HOST])\nAC_REQUIRE([AC_PROG_NM])\nAC_REQUIRE([AC_OBJEXT])\n# Check for command to grab the raw symbol name followed by C symbol from nm.\nAC_MSG_CHECKING([command to parse $NM output from $compiler object])\nAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],\n[\n# These are sane defaults that work on at least a few old systems.\n# [They come from Ultrix.  What could be older than Ultrix?!! ;)]\n\n# Character class describing NM global symbol codes.\nsymcode='[[BCDEGRST]]'\n\n# Regexp to match symbols that can be accessed directly from C.\nsympat='\\([[_A-Za-z]][[_A-Za-z0-9]]*\\)'\n\n# Transform the above into a raw symbol and a C symbol.\nsymxfrm='\\1 \\2\\3 \\3'\n\n# Transform an extracted symbol line into a proper C declaration\nlt_cv_sys_global_symbol_to_cdecl=\"sed -n -e 's/^. .* \\(.*\\)$/extern int \\1;/p'\"\n\n# Transform an extracted symbol line into symbol name and symbol address\nlt_cv_sys_global_symbol_to_c_name_address=\"sed -n -e 's/^: \\([[^ ]]*\\) $/  {\\\\\\\"\\1\\\\\\\", (lt_ptr) 0},/p' -e 's/^$symcode \\([[^ ]]*\\) \\([[^ ]]*\\)$/  {\\\"\\2\\\", (lt_ptr) \\&\\2},/p'\"\n\n# Define system-specific variables.\ncase $host_os in\naix*)\n  symcode='[[BCDT]]'\n  ;;\ncygwin* | mingw* | pw32*)\n  symcode='[[ABCDGISTW]]'\n  ;;\nhpux*) # Its linker distinguishes data from code symbols\n  if test \"$host_cpu\" = ia64; then\n    symcode='[[ABCDEGRST]]'\n  fi\n  lt_cv_sys_global_symbol_to_cdecl=\"sed -n -e 's/^T .* \\(.*\\)$/extern int \\1();/p' -e 's/^$symcode* .* \\(.*\\)$/extern char \\1;/p'\"\n  lt_cv_sys_global_symbol_to_c_name_address=\"sed -n -e 's/^: \\([[^ ]]*\\) $/  {\\\\\\\"\\1\\\\\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \\([[^ ]]*\\) \\([[^ ]]*\\)$/  {\\\"\\2\\\", (lt_ptr) \\&\\2},/p'\"\n  ;;\nirix* | nonstopux*)\n  symcode='[[BCDEGRST]]'\n  ;;\nosf*)\n  symcode='[[BCDEGQRST]]'\n  ;;\nsolaris* | sysv5*)\n  symcode='[[BDRT]]'\n  ;;\nsysv4)\n  symcode='[[DFNSTU]]'\n  ;;\nesac\n\n# Handle CRLF in mingw tool chain\nopt_cr=\ncase $build_os in\nmingw*)\n  opt_cr=`echo 'x\\{0,1\\}' | tr x '\\015'` # option cr in regexp\n  ;;\nesac\n\n# If we're using GNU nm, then use its standard symbol codes.\ncase `$NM -V 2>&1` in\n*GNU* | *'with BFD'*)\n  symcode='[[ABCDGIRSTW]]' ;;\nesac\n\n# Try without a prefix undercore, then with it.\nfor ac_symprfx in \"\" \"_\"; do\n\n  # Write the raw and C identifiers.\n  lt_cv_sys_global_symbol_pipe=\"sed -n -e 's/^.*[[ \t]]\\($symcode$symcode*\\)[[ \t]][[ \t]]*\\($ac_symprfx\\)$sympat$opt_cr$/$symxfrm/p'\"\n\n  # Check to see that the pipe works correctly.\n  pipe_works=no\n\n  rm -f conftest*\n  cat > conftest.$ac_ext <<EOF\n#ifdef __cplusplus\nextern \"C\" {\n#endif\nchar nm_test_var;\nvoid nm_test_func(){}\n#ifdef __cplusplus\n}\n#endif\nint main(){nm_test_var='a';nm_test_func();return(0);}\nEOF\n\n  if AC_TRY_EVAL(ac_compile); then\n    # Now try to grab the symbols.\n    nlist=conftest.nm\n    if AC_TRY_EVAL(NM conftest.$ac_objext \\| $lt_cv_sys_global_symbol_pipe \\> $nlist) && test -s \"$nlist\"; then\n      # Try sorting and uniquifying the output.\n      if sort \"$nlist\" | uniq > \"$nlist\"T; then\n\tmv -f \"$nlist\"T \"$nlist\"\n      else\n\trm -f \"$nlist\"T\n      fi\n\n      # Make sure that we snagged all the symbols we need.\n      if grep ' nm_test_var$' \"$nlist\" >/dev/null; then\n\tif grep ' nm_test_func$' \"$nlist\" >/dev/null; then\n\t  cat <<EOF > conftest.$ac_ext\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nEOF\n\t  # Now generate the symbol file.\n\t  eval \"$lt_cv_sys_global_symbol_to_cdecl\"' < \"$nlist\" | grep -v main >> conftest.$ac_ext'\n\n\t  cat <<EOF >> conftest.$ac_ext\n#if defined (__STDC__) && __STDC__\n# define lt_ptr_t void *\n#else\n# define lt_ptr_t char *\n# define const\n#endif\n\n/* The mapping between symbol names and symbols. */\nconst struct {\n  const char *name;\n  lt_ptr_t address;\n}\nlt_preloaded_symbols[[]] =\n{\nEOF\n\t  $SED \"s/^$symcode$symcode* \\(.*\\) \\(.*\\)$/  {\\\"\\2\\\", (lt_ptr_t) \\&\\2},/\" < \"$nlist\" | grep -v main >> conftest.$ac_ext\n\t  cat <<\\EOF >> conftest.$ac_ext\n  {0, (lt_ptr_t) 0}\n};\n\n#ifdef __cplusplus\n}\n#endif\nEOF\n\t  # Now try linking the two files.\n\t  mv conftest.$ac_objext conftstm.$ac_objext\n\t  lt_save_LIBS=\"$LIBS\"\n\t  lt_save_CFLAGS=\"$CFLAGS\"\n\t  LIBS=\"conftstm.$ac_objext\"\n\t  CFLAGS=\"$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)\"\n\t  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then\n\t    pipe_works=yes\n\t  fi\n\t  LIBS=\"$lt_save_LIBS\"\n\t  CFLAGS=\"$lt_save_CFLAGS\"\n\telse\n\t  echo \"cannot find nm_test_func in $nlist\" >&AS_MESSAGE_LOG_FD\n\tfi\n      else\n\techo \"cannot find nm_test_var in $nlist\" >&AS_MESSAGE_LOG_FD\n      fi\n    else\n      echo \"cannot run $lt_cv_sys_global_symbol_pipe\" >&AS_MESSAGE_LOG_FD\n    fi\n  else\n    echo \"$progname: failed program was:\" >&AS_MESSAGE_LOG_FD\n    cat conftest.$ac_ext >&5\n  fi\n  rm -f conftest* conftst*\n\n  # Do not use the global_symbol_pipe unless it works.\n  if test \"$pipe_works\" = yes; then\n    break\n  else\n    lt_cv_sys_global_symbol_pipe=\n  fi\ndone\n])\nif test -z \"$lt_cv_sys_global_symbol_pipe\"; then\n  lt_cv_sys_global_symbol_to_cdecl=\nfi\nif test -z \"$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl\"; then\n  AC_MSG_RESULT(failed)\nelse\n  AC_MSG_RESULT(ok)\nfi\n]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE\n\n\n# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])\n# ---------------------------------------\nAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],\n[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=\n_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=\n_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=\n\nAC_MSG_CHECKING([for $compiler option to produce PIC])\n ifelse([$1],[CXX],[\n  # C++ specific cases for pic, static, wl, etc.\n  if test \"$GXX\" = yes; then\n    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'\n\n    case $host_os in\n    aix*)\n      # All AIX code is PIC.\n      if test \"$host_cpu\" = ia64; then\n\t# AIX 5 now supports IA64 processor\n\t_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      fi\n      ;;\n    amigaos*)\n      # FIXME: we need at least 68020 code to build shared libraries, but\n      # adding the `-m68020' flag to GCC prevents building anything better,\n      # like `-m68040'.\n      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'\n      ;;\n    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)\n      # PIC is the default for these OSes.\n      ;;\n    mingw* | os2* | pw32*)\n      # This hack is so that the source file can tell whether it is being\n      # built for inclusion in a dll (and should export symbols for example).\n      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'\n      ;;\n    darwin* | rhapsody*)\n      # PIC is the default on this platform\n      # Common symbols not allowed in MH_DYLIB files\n      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'\n      ;;\n    *djgpp*)\n      # DJGPP does not support shared libraries at all\n      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=\n      ;;\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\t_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic\n      fi\n      ;;\n    hpux*)\n      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but\n      # not for PA HP-UX.\n      case \"$host_cpu\" in\n      hppa*64*|ia64*)\n\t;;\n      *)\n\t_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n\t;;\n      esac\n      ;;\n    *)\n      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n      ;;\n    esac\n  else\n    case $host_os in\n      aix4* | aix5*)\n\t# All AIX code is PIC.\n\tif test \"$host_cpu\" = ia64; then\n\t  # AIX 5 now supports IA64 processor\n\t  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\telse\n\t  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'\n\tfi\n\t;;\n      chorus*)\n\tcase $cc_basename in\n\tcxch68)\n\t  # Green Hills C++ Compiler\n\t  # _LT_AC_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\"\n\t  ;;\n\tesac\n\t;;\n      dgux*)\n\tcase $cc_basename in\n\t  ec++)\n\t    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t    ;;\n\t  ghcx)\n\t    # Green Hills C++ Compiler\n\t    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      freebsd* | kfreebsd*-gnu)\n\t# FreeBSD uses GNU C++\n\t;;\n      hpux9* | hpux10* | hpux11*)\n\tcase $cc_basename in\n\t  CC)\n\t    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)=\"${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive\"\n\t    if test \"$host_cpu\" != ia64; then\n\t      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'\n\t    fi\n\t    ;;\n\t  aCC)\n\t    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)=\"${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive\"\n\t    case \"$host_cpu\" in\n\t    hppa*64*|ia64*)\n\t      # +Z the default\n\t      ;;\n\t    *)\n\t      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'\n\t      ;;\n\t    esac\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      irix5* | irix6* | nonstopux*)\n\tcase $cc_basename in\n\t  CC)\n\t    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'\n\t    # CC pic flag -KPIC is the default.\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      linux*)\n\tcase $cc_basename in\n\t  KCC)\n\t    # KAI C++ Compiler\n\t    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'\n\t    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n\t    ;;\n\t  icpc)\n\t    # Intel C++\n\t    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'\n\t    ;;\n\t  cxx)\n\t    # Compaq C++\n\t    # Make sure the PIC flag is empty.  It appears that all Alpha\n\t    # Linux and Compaq Tru64 Unix objects are PIC.\n\t    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=\n\t    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      lynxos*)\n\t;;\n      m88k*)\n\t;;\n      mvs*)\n\tcase $cc_basename in\n\t  cxx)\n\t    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      netbsd*)\n\t;;\n      osf3* | osf4* | osf5*)\n\tcase $cc_basename in\n\t  KCC)\n\t    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'\n\t    ;;\n\t  RCC)\n\t    # Rational C++ 2.4.1\n\t    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'\n\t    ;;\n\t  cxx)\n\t    # Digital/Compaq C++\n\t    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t    # Make sure the PIC flag is empty.  It appears that all Alpha\n\t    # Linux and Compaq Tru64 Unix objects are PIC.\n\t    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=\n\t    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      psos*)\n\t;;\n      sco*)\n\tcase $cc_basename in\n\t  CC)\n\t    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      solaris*)\n\tcase $cc_basename in\n\t  CC)\n\t    # Sun C++ 4.2, 5.x and Centerline C++\n\t    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\t    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '\n\t    ;;\n\t  gcx)\n\t    # Green Hills C++ Compiler\n\t    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      sunos4*)\n\tcase $cc_basename in\n\t  CC)\n\t    # Sun C++ 4.x\n\t    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'\n\t    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n\t    ;;\n\t  lcc)\n\t    # Lucid\n\t    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      tandem*)\n\tcase $cc_basename in\n\t  NCC)\n\t    # NonStop-UX NCC 3.20\n\t    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      unixware*)\n\t;;\n      vxworks*)\n\t;;\n      *)\n\t_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no\n\t;;\n    esac\n  fi\n],\n[\n  if test \"$GCC\" = yes; then\n    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'\n\n    case $host_os in\n      aix*)\n      # All AIX code is PIC.\n      if test \"$host_cpu\" = ia64; then\n\t# AIX 5 now supports IA64 processor\n\t_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      fi\n      ;;\n\n    amigaos*)\n      # FIXME: we need at least 68020 code to build shared libraries, but\n      # adding the `-m68020' flag to GCC prevents building anything better,\n      # like `-m68040'.\n      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'\n      ;;\n\n    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)\n      # PIC is the default for these OSes.\n      ;;\n\n    mingw* | pw32* | os2*)\n      # This hack is so that the source file can tell whether it is being\n      # built for inclusion in a dll (and should export symbols for example).\n      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'\n      ;;\n\n    darwin* | rhapsody*)\n      # PIC is the default on this platform\n      # Common symbols not allowed in MH_DYLIB files\n      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'\n      ;;\n\n    msdosdjgpp*)\n      # Just because we use GCC doesn't mean we suddenly get shared libraries\n      # on systems that don't support them.\n      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no\n      enable_shared=no\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\t_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic\n      fi\n      ;;\n\n    hpux*)\n      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but\n      # not for PA HP-UX.\n      case \"$host_cpu\" in\n      hppa*64*|ia64*)\n\t# +Z the default\n\t;;\n      *)\n\t_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n\t;;\n      esac\n      ;;\n\n    *)\n      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'\n      ;;\n    esac\n  else\n    # PORTME Check for flag to pass linker flags through the system compiler.\n    case $host_os in\n    aix*)\n      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n      if test \"$host_cpu\" = ia64; then\n\t# AIX 5 now supports IA64 processor\n\t_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      else\n\t_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'\n      fi\n      ;;\n\n    mingw* | pw32* | os2*)\n      # This hack is so that the source file can tell whether it is being\n      # built for inclusion in a dll (and should export symbols for example).\n      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'\n      ;;\n\n    hpux9* | hpux10* | hpux11*)\n      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but\n      # not for PA HP-UX.\n      case \"$host_cpu\" in\n      hppa*64*|ia64*)\n\t# +Z the default\n\t;;\n      *)\n\t_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'\n\t;;\n      esac\n      # Is there a better lt_prog_compiler_static that works with the bundled CC?\n      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'\n      ;;\n\n    irix5* | irix6* | nonstopux*)\n      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n      # PIC (with -KPIC) is the default.\n      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'\n      ;;\n\n    newsos6)\n      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      ;;\n\n    linux*)\n      case $CC in\n      icc* | ecc*)\n\t_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n\t_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n\t_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'\n        ;;\n      ccc*)\n        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n        # All Alpha code is PIC.\n        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'\n        ;;\n      esac\n      ;;\n\n    osf3* | osf4* | osf5*)\n      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n      # All OSF/1 code is PIC.\n      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'\n      ;;\n\n    sco3.2v5*)\n      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'\n      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'\n      ;;\n\n    solaris*)\n      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      ;;\n\n    sunos4*)\n      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '\n      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'\n      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      ;;\n\n    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)\n      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'\n      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'\n      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec ;then\n\t_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'\n\t_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      fi\n      ;;\n\n    uts4*)\n      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'\n      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'\n      ;;\n\n    *)\n      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no\n      ;;\n    esac\n  fi\n])\nAC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])\n\n#\n# Check to make sure the PIC flag actually works.\n#\nif test -n \"$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)\"; then\n  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],\n    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),\n    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],\n    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in\n     \"\" | \" \"*) ;;\n     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=\" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)\" ;;\n     esac],\n    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=\n     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])\nfi\ncase \"$host_os\" in\n  # For platforms which do not support PIC, -DPIC is meaningless:\n  *djgpp*)\n    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=\n    ;;\n  *)\n    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=\"$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])\"\n    ;;\nesac\n])\n\n\n# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])\n# ------------------------------------\n# See if the linker supports building shared libraries.\nAC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],\n[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])\nifelse([$1],[CXX],[\n  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\\''s/.* //'\\'' | sort | uniq > $export_symbols'\n  case $host_os in\n  aix4* | aix5*)\n    # If we're using GNU nm, then we don't want the \"-C\" option.\n    # -C means demangle to AIX nm, but means don't demangle with GNU nm\n    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then\n      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\\''{ if (((\\[$]2 == \"T\") || (\\[$]2 == \"D\") || (\\[$]2 == \"B\")) && ([substr](\\[$]3,1,1) != \".\")) { print \\[$]3 } }'\\'' | sort -u > $export_symbols'\n    else\n      _LT_AC_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'\n    fi\n    ;;\n  pw32*)\n    _LT_AC_TAGVAR(export_symbols_cmds, $1)=\"$ltdll_cmds\"\n  ;;\n  cygwin* | mingw*)\n    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\\''/^[[BCDGS]] /s/.* \\([[^ ]]*\\)/\\1 DATA/'\\'' | $SED -e '\\''/^[[AITW]] /s/.* //'\\'' | sort | uniq > $export_symbols'\n  ;;\n  *)\n    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\\''s/.* //'\\'' | sort | uniq > $export_symbols'\n  ;;\n  esac\n],[\n  runpath_var=\n  _LT_AC_TAGVAR(allow_undefined_flag, $1)=\n  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no\n  _LT_AC_TAGVAR(archive_cmds, $1)=\n  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=\n  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=\n  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=\n  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=\n  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=\n  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=\n  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=\n  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=\n  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=\n  _LT_AC_TAGVAR(hardcode_direct, $1)=no\n  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no\n  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported\n  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown\n  _LT_AC_TAGVAR(hardcode_automatic, $1)=no\n  _LT_AC_TAGVAR(module_cmds, $1)=\n  _LT_AC_TAGVAR(module_expsym_cmds, $1)=\n  _LT_AC_TAGVAR(always_export_symbols, $1)=no\n  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\\''s/.* //'\\'' | sort | uniq > $export_symbols'\n  # include_expsyms should be a list of space-separated symbols to be *always*\n  # included in the symbol list\n  _LT_AC_TAGVAR(include_expsyms, $1)=\n  # exclude_expsyms can be an extended regexp of symbols to exclude\n  # it will be wrapped by ` (' and `)$', so one must not match beginning or\n  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',\n  # as well as any symbol that contains `d'.\n  _LT_AC_TAGVAR(exclude_expsyms, $1)=\"_GLOBAL_OFFSET_TABLE_\"\n  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out\n  # platforms (ab)use it in PIC code, but their linkers get confused if\n  # the symbol is explicitly referenced.  Since portable code cannot\n  # rely on this symbol name, it's probably fine to never include it in\n  # preloaded symbol tables.\n  extract_expsyms_cmds=\n\n  case $host_os in\n  cygwin* | mingw* | pw32*)\n    # FIXME: the MSVC++ port hasn't been tested in a loooong time\n    # When not using gcc, we currently assume that we are using\n    # Microsoft Visual C++.\n    if test \"$GCC\" != yes; then\n      with_gnu_ld=no\n    fi\n    ;;\n  openbsd*)\n    with_gnu_ld=no\n    ;;\n  esac\n\n  _LT_AC_TAGVAR(ld_shlibs, $1)=yes\n  if test \"$with_gnu_ld\" = yes; then\n    # If archive_cmds runs LD, not CC, wlarc should be empty\n    wlarc='${wl}'\n\n    # See if GNU ld supports shared libraries.\n    case $host_os in\n    aix3* | aix4* | aix5*)\n      # On AIX/PPC, the GNU linker is very broken\n      if test \"$host_cpu\" != ia64; then\n\t_LT_AC_TAGVAR(ld_shlibs, $1)=no\n\tcat <<EOF 1>&2\n\n*** Warning: the GNU linker, at least up to release 2.9.1, is reported\n*** to be unable to reliably create shared libraries on AIX.\n*** Therefore, libtool is disabling shared libraries support.  If you\n*** really care for shared libraries, you may want to modify your PATH\n*** so that a non-GNU linker is found, and then restart.\n\nEOF\n      fi\n      ;;\n\n    amigaos*)\n      _LT_AC_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)'\n      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes\n\n      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports\n      # that the semantics of dynamic libraries on AmigaOS, at least up\n      # to version 4, is to share data among multiple programs linked\n      # with the same dynamic library.  Since this doesn't match the\n      # behavior of shared libraries on other platforms, we can't use\n      # them.\n      _LT_AC_TAGVAR(ld_shlibs, $1)=no\n      ;;\n\n    beos*)\n      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then\n\t_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported\n\t# Joseph Beckenbach <jrb3@best.com> says some releases of gcc\n\t# support --undefined.  This deserves some investigation.  FIXME\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'\n      else\n\t_LT_AC_TAGVAR(ld_shlibs, $1)=no\n      fi\n      ;;\n\n    cygwin* | mingw* | pw32*)\n      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,\n      # as there is no search path for DLLs.\n      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported\n      _LT_AC_TAGVAR(always_export_symbols, $1)=no\n      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes\n      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\\''/^[[BCDGS]] /s/.* \\([[^ ]]*\\)/\\1 DATA/'\\'' | $SED -e '\\''/^[[AITW]] /s/.* //'\\'' | sort | uniq > $export_symbols'\n\n      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then\n        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'\n\t# If the export-symbols file already is a .def file (1st line\n\t# is EXPORTS), use it as is; otherwise, prepend...\n\t_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test \"x`$SED 1q $export_symbols`\" = xEXPORTS; then\n\t  cp $export_symbols $output_objdir/$soname.def;\n\telse\n\t  echo EXPORTS > $output_objdir/$soname.def;\n\t  cat $export_symbols >> $output_objdir/$soname.def;\n\tfi~\n\t$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'\n      else\n\tld_shlibs=no\n      fi\n      ;;\n\n    netbsd*)\n      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'\n\twlarc=\n      else\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'\n\t_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'\n      fi\n      ;;\n\n    solaris* | sysv5*)\n      if $LD -v 2>&1 | grep 'BFD 2\\.8' > /dev/null; then\n\t_LT_AC_TAGVAR(ld_shlibs, $1)=no\n\tcat <<EOF 1>&2\n\n*** Warning: The releases 2.8.* of the GNU linker cannot reliably\n*** create shared libraries on Solaris systems.  Therefore, libtool\n*** is disabling shared libraries support.  We urge you to upgrade GNU\n*** binutils to release 2.9.1 or newer.  Another option is to modify\n*** your PATH or compiler configuration so that the native linker is\n*** used, and then restart.\n\nEOF\n      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'\n\t_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'\n      else\n\t_LT_AC_TAGVAR(ld_shlibs, $1)=no\n      fi\n      ;;\n\n    sunos4*)\n      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'\n      wlarc=\n      _LT_AC_TAGVAR(hardcode_direct, $1)=yes\n      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n  linux*)\n    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then\n        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'\n\t_LT_AC_TAGVAR(archive_cmds, $1)=\"$tmp_archive_cmds\"\n      supports_anon_versioning=no\n      case `$LD -v 2>/dev/null` in\n        *\\ [01].* | *\\ 2.[[0-9]].* | *\\ 2.10.*) ;; # catch versions < 2.11\n        *\\ 2.11.93.0.2\\ *) supports_anon_versioning=yes ;; # RH7.3 ...\n        *\\ 2.11.92.0.12\\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...\n        *\\ 2.11.*) ;; # other 2.11 versions\n        *) supports_anon_versioning=yes ;;\n      esac\n      if test $supports_anon_versioning = yes; then\n        _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo \"{ global:\" > $output_objdir/$libname.ver~\ncat $export_symbols | sed -e \"s/\\(.*\\)/\\1;/\" >> $output_objdir/$libname.ver~\n$echo \"local: *; };\" >> $output_objdir/$libname.ver~\n        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'\n      else\n        _LT_AC_TAGVAR(archive_expsym_cmds, $1)=\"$tmp_archive_cmds\"\n      fi\n    else\n      _LT_AC_TAGVAR(ld_shlibs, $1)=no\n    fi\n    ;;\n\n    *)\n      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'\n\t_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'\n      else\n\t_LT_AC_TAGVAR(ld_shlibs, $1)=no\n      fi\n      ;;\n    esac\n\n    if test \"$_LT_AC_TAGVAR(ld_shlibs, $1)\" = yes; then\n      runpath_var=LD_RUN_PATH\n      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'\n      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'\n      # ancient GNU ld didn't support --whole-archive et. al.\n      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then\n \t_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=\"$wlarc\"'--whole-archive$convenience '\"$wlarc\"'--no-whole-archive'\n      else\n  \t_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=\n      fi\n    fi\n  else\n    # PORTME fill in a description of your system's linker (not GNU ld)\n    case $host_os in\n    aix3*)\n      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported\n      _LT_AC_TAGVAR(always_export_symbols, $1)=yes\n      _LT_AC_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'\n      # Note: this linker hardcodes the directories in LIBPATH if there\n      # are no directories specified by -L.\n      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes\n      if test \"$GCC\" = yes && test -z \"$link_static_flag\"; then\n\t# Neither direct hardcoding nor static linking is supported with a\n\t# broken collect2.\n\t_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported\n      fi\n      ;;\n\n    aix4* | aix5*)\n      if test \"$host_cpu\" = ia64; then\n\t# On IA64, the linker does run time linking by default, so we don't\n\t# have to do anything special.\n\taix_use_runtimelinking=no\n\texp_sym_flag='-Bexport'\n\tno_entry_flag=\"\"\n      else\n\t# If we're using GNU nm, then we don't want the \"-C\" option.\n\t# -C means demangle to AIX nm, but means don't demangle with GNU nm\n\tif $NM -V 2>&1 | grep 'GNU' > /dev/null; then\n\t  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\\''{ if (((\\[$]2 == \"T\") || (\\[$]2 == \"D\") || (\\[$]2 == \"B\")) && ([substr](\\[$]3,1,1) != \".\")) { print \\[$]3 } }'\\'' | sort -u > $export_symbols'\n\telse\n\t  _LT_AC_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'\n\tfi\n\taix_use_runtimelinking=no\n\n\t# Test if we are trying to use run time linking or normal\n\t# AIX style linking. If -brtl is somewhere in LDFLAGS, we\n\t# need to do runtime linking.\n\tcase $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)\n\t  for ld_flag in $LDFLAGS; do\n  \t  if (test $ld_flag = \"-brtl\" || test $ld_flag = \"-Wl,-brtl\"); then\n  \t    aix_use_runtimelinking=yes\n  \t    break\n  \t  fi\n\t  done\n\tesac\n\n\texp_sym_flag='-bexport'\n\tno_entry_flag='-bnoentry'\n      fi\n\n      # When large executables or shared objects are built, AIX ld can\n      # have problems creating the table of contents.  If linking a library\n      # or program results in \"error TOC overflow\" add -mminimal-toc to\n      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not\n      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.\n\n      _LT_AC_TAGVAR(archive_cmds, $1)=''\n      _LT_AC_TAGVAR(hardcode_direct, $1)=yes\n      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'\n      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes\n\n      if test \"$GCC\" = yes; then\n\tcase $host_os in aix4.[012]|aix4.[012].*)\n\t# We only want to do this on AIX 4.2 and lower, the check\n\t# below for broken collect2 doesn't work under 4.3+\n\t  collect2name=`${CC} -print-prog-name=collect2`\n\t  if test -f \"$collect2name\" && \\\n  \t   strings \"$collect2name\" | grep resolve_lib_name >/dev/null\n\t  then\n  \t  # We have reworked collect2\n  \t  _LT_AC_TAGVAR(hardcode_direct, $1)=yes\n\t  else\n  \t  # We have old collect2\n  \t  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported\n  \t  # It fails to find uninstalled libraries when the uninstalled\n  \t  # path is not listed in the libpath.  Setting hardcode_minus_L\n  \t  # to unsupported forces relinking\n  \t  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes\n  \t  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n  \t  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=\n\t  fi\n\tesac\n\tshared_flag='-shared'\n      else\n\t# not using gcc\n\tif test \"$host_cpu\" = ia64; then\n  \t# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release\n  \t# chokes on -Wl,-G. The following line is correct:\n\t  shared_flag='-G'\n\telse\n  \tif test \"$aix_use_runtimelinking\" = yes; then\n\t    shared_flag='${wl}-G'\n\t  else\n\t    shared_flag='${wl}-bM:SRE'\n  \tfi\n\tfi\n      fi\n\n      # It seems that -bexpall does not export symbols beginning with\n      # underscore (_), so it is better to generate a list of symbols to export.\n      _LT_AC_TAGVAR(always_export_symbols, $1)=yes\n      if test \"$aix_use_runtimelinking\" = yes; then\n\t# Warning - without using the other runtime loading flags (-brtl),\n\t# -berok will link without error, but may produce a broken library.\n\t_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'\n       # Determine the default libpath from the value encoded in an empty executable.\n       _LT_AC_SYS_LIBPATH_AIX\n       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'\"$aix_libpath\"\n\t_LT_AC_TAGVAR(archive_expsym_cmds, $1)=\"\\$CC\"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test \"x${allow_undefined_flag}\" != \"x\"; then echo \"${wl}${allow_undefined_flag}\"; else :; fi` '\"\\${wl}$no_entry_flag \\${wl}$exp_sym_flag:\\$export_symbols $shared_flag\"\n       else\n\tif test \"$host_cpu\" = ia64; then\n\t  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'\n\t  _LT_AC_TAGVAR(allow_undefined_flag, $1)=\"-z nodefs\"\n\t  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=\"\\$CC $shared_flag\"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '\"\\${wl}$no_entry_flag \\${wl}$exp_sym_flag:\\$export_symbols\"\n\telse\n\t # Determine the default libpath from the value encoded in an empty executable.\n\t _LT_AC_SYS_LIBPATH_AIX\n\t _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'\"$aix_libpath\"\n\t  # Warning - without using the other run time loading flags,\n\t  # -berok will link without error, but may produce a broken library.\n\t  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'\n\t  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'\n\t  # -bexpall does not export symbols beginning with underscore (_)\n\t  _LT_AC_TAGVAR(always_export_symbols, $1)=yes\n\t  # Exported symbols can be pulled into shared objects from archives\n\t  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '\n\t  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes\n\t  # This is similar to how AIX traditionally builds it's shared libraries.\n\t  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=\"\\$CC $shared_flag\"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'\n\tfi\n      fi\n      ;;\n\n    amigaos*)\n      _LT_AC_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)'\n      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes\n      # see comment about different semantics on the GNU ld section\n      _LT_AC_TAGVAR(ld_shlibs, $1)=no\n      ;;\n\n    bsdi4*)\n      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic\n      ;;\n\n    cygwin* | mingw* | pw32*)\n      # When not using gcc, we currently assume that we are using\n      # Microsoft Visual C++.\n      # hardcode_libdir_flag_spec is actually meaningless, as there is\n      # no search path for DLLs.\n      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '\n      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported\n      # Tell ltmain to make .lib files, not .a files.\n      libext=lib\n      # Tell ltmain to make .dll files, not .so files.\n      shrext_cmds=\".dll\"\n      # FIXME: Setting linknames here is a bad hack.\n      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo \"$deplibs\" | $SED -e '\\''s/ -lc$//'\\''` -link -dll~linknames='\n      # The linker will automatically build a .lib file if we build a DLL.\n      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'\n      # FIXME: Should let the user specify the lib program.\n      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'\n      fix_srcfile_path='`cygpath -w \"$srcfile\"`'\n      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes\n      ;;\n\n    darwin* | rhapsody*)\n    if test \"$GXX\" = yes ; then\n      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no\n      case \"$host_os\" in\n      rhapsody* | darwin1.[[012]])\n\t_LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'\n\t;;\n      *) # Darwin 1.3 on\n      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then\n      \t_LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'\n      else\n        case ${MACOSX_DEPLOYMENT_TARGET} in\n          10.[[012]])\n            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'\n            ;;\n          10.*)\n            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'\n            ;;\n        esac\n      fi\n\t;;\n      esac\n    \tlt_int_apple_cc_single_mod=no\n    \toutput_verbose_link_cmd='echo'\n    \tif $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then\n    \t  lt_int_apple_cc_single_mod=yes\n    \tfi\n    \tif test \"X$lt_int_apple_cc_single_mod\" = Xyes ; then\n    \t  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'\n    \telse\n        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -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'\n      fi\n      _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'\n      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's\n        if test \"X$lt_int_apple_cc_single_mod\" = Xyes ; then\n          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e \"s,#.*,,\" -e \"s,^[    ]*,,\" -e \"s,^\\(..*\\),_&,\" < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'\n        else\n          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e \"s,#.*,,\" -e \"s,^[    ]*,,\" -e \"s,^\\(..*\\),_&,\" < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'\n        fi\n          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e \"s,#.*,,\" -e \"s,^[    ]*,,\" -e \"s,^\\(..*\\),_&,\" < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'\n      _LT_AC_TAGVAR(hardcode_direct, $1)=no\n      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes\n      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported\n      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'\n      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes\n    else\n      _LT_AC_TAGVAR(ld_shlibs, $1)=no\n    fi\n      ;;\n\n    dgux*)\n      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    freebsd1*)\n      _LT_AC_TAGVAR(ld_shlibs, $1)=no\n      ;;\n\n    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor\n    # support.  Future versions do this automatically, but an explicit c++rt0.o\n    # does not break anything, and helps significantly (at the cost of a little\n    # extra space).\n    freebsd2.2*)\n      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'\n      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'\n      _LT_AC_TAGVAR(hardcode_direct, $1)=yes\n      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    # Unfortunately, older versions of FreeBSD 2 do not have this feature.\n    freebsd2*)\n      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'\n      _LT_AC_TAGVAR(hardcode_direct, $1)=yes\n      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes\n      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.\n    freebsd* | kfreebsd*-gnu)\n      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'\n      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'\n      _LT_AC_TAGVAR(hardcode_direct, $1)=yes\n      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    hpux9*)\n      if test \"$GCC\" = yes; then\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'\n      else\n\t_LT_AC_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'\n      fi\n      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'\n      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:\n      _LT_AC_TAGVAR(hardcode_direct, $1)=yes\n\n      # hardcode_minus_L: Not really in the search PATH,\n      # but as the default location of the library.\n      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes\n      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'\n      ;;\n\n    hpux10* | hpux11*)\n      if test \"$GCC\" = yes -a \"$with_gnu_ld\" = no; then\n\tcase \"$host_cpu\" in\n\thppa*64*|ia64*)\n\t  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\t*)\n\t  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\tesac\n      else\n\tcase \"$host_cpu\" in\n\thppa*64*|ia64*)\n\t  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  ;;\n\t*)\n\t  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'\n\t  ;;\n\tesac\n      fi\n      if test \"$with_gnu_ld\" = no; then\n\tcase \"$host_cpu\" in\n\thppa*64*)\n\t  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'\n\t  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'\n\t  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:\n\t  _LT_AC_TAGVAR(hardcode_direct, $1)=no\n\t  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n\t  ;;\n\tia64*)\n\t  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n\t  _LT_AC_TAGVAR(hardcode_direct, $1)=no\n\t  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n\n\t  # hardcode_minus_L: Not really in the search PATH,\n\t  # but as the default location of the library.\n\t  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes\n\t  ;;\n\t*)\n\t  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'\n\t  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:\n\t  _LT_AC_TAGVAR(hardcode_direct, $1)=yes\n\t  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'\n\n\t  # hardcode_minus_L: Not really in the search PATH,\n\t  # but as the default location of the library.\n\t  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes\n\t  ;;\n\tesac\n      fi\n      ;;\n\n    irix5* | irix6* | nonstopux*)\n      if test \"$GCC\" = yes; then\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n \"$verstring\" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'\n      else\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n \"$verstring\" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'\n\t_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'\n      fi\n      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'\n      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:\n      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes\n      ;;\n\n    netbsd*)\n      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out\n      else\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF\n      fi\n      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'\n      _LT_AC_TAGVAR(hardcode_direct, $1)=yes\n      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    newsos6)\n      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      _LT_AC_TAGVAR(hardcode_direct, $1)=yes\n      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'\n      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:\n      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    openbsd*)\n      _LT_AC_TAGVAR(hardcode_direct, $1)=yes\n      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n      if test -z \"`echo __ELF__ | $CC -E - | grep __ELF__`\" || test \"$host_os-$host_cpu\" = \"openbsd2.8-powerpc\"; then\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n\t_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'\n\t_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'\n      else\n       case $host_os in\n\t openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)\n\t   _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'\n\t   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'\n\t   ;;\n\t *)\n\t   _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n\t   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'\n\t   ;;\n       esac\n      fi\n      ;;\n\n    os2*)\n      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes\n      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported\n      _LT_AC_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'\n      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'\n      ;;\n\n    osf3*)\n      if test \"$GCC\" = yes; then\n\t_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\\*'\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n \"$verstring\" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'\n      else\n\t_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \\*'\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n \"$verstring\" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'\n      fi\n      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'\n      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:\n      ;;\n\n    osf4* | osf5*)\t# as osf3* with the addition of -msym flag\n      if test \"$GCC\" = yes; then\n\t_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\\*'\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n \"$verstring\" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'\n\t_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'\n      else\n\t_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \\*'\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n \"$verstring\" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'\n\t_LT_AC_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~\n\t$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n \"$verstring\" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'\n\n\t# Both c and cxx compiler support -rpath directly\n\t_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'\n      fi\n      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:\n      ;;\n\n    sco3.2v5*)\n      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'\n      runpath_var=LD_RUN_PATH\n      hardcode_runpath_var=yes\n      ;;\n\n    solaris*)\n      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'\n      if test \"$GCC\" = yes; then\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~$echo \"local: *; };\" >> $lib.exp~\n\t  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'\n      else\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~$echo \"local: *; };\" >> $lib.exp~\n  \t$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'\n      fi\n      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'\n      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n      case $host_os in\n      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;\n      *) # Supported since Solaris 2.6 (maybe 2.5.1?)\n\t_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;\n      esac\n      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes\n      ;;\n\n    sunos4*)\n      if test \"x$host_vendor\" = xsequent; then\n\t# Use $CC to link under sequent, because it throws in some extra .o\n\t# files that make .init and .fini sections work.\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'\n      fi\n      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n      _LT_AC_TAGVAR(hardcode_direct, $1)=yes\n      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes\n      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    sysv4)\n      case $host_vendor in\n\tsni)\n\t  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???\n\t;;\n\tsiemens)\n\t  ## LD is ld it makes a PLAMLIB\n\t  ## CC just makes a GrossModule.\n\t  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'\n\t  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'\n\t  _LT_AC_TAGVAR(hardcode_direct, $1)=no\n        ;;\n\tmotorola)\n\t  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie\n\t;;\n      esac\n      runpath_var='LD_RUN_PATH'\n      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    sysv4.3*)\n      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n\trunpath_var=LD_RUN_PATH\n\thardcode_runpath_var=yes\n\t_LT_AC_TAGVAR(ld_shlibs, $1)=yes\n      fi\n      ;;\n\n    sysv4.2uw2*)\n      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'\n      _LT_AC_TAGVAR(hardcode_direct, $1)=yes\n      _LT_AC_TAGVAR(hardcode_minus_L, $1)=no\n      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n      hardcode_runpath_var=yes\n      runpath_var=LD_RUN_PATH\n      ;;\n\n   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)\n      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'\n      if test \"$GCC\" = yes; then\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\t_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'\n      fi\n      runpath_var='LD_RUN_PATH'\n      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    sysv5*)\n      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'\n      # $CC -shared without GNU ld will not create a library from C++\n      # object files and a static libstdc++, better avoid it by now\n      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~$echo \"local: *; };\" >> $lib.exp~\n  \t\t$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'\n      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=\n      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n      runpath_var='LD_RUN_PATH'\n      ;;\n\n    uts4*)\n      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'\n      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no\n      ;;\n\n    *)\n      _LT_AC_TAGVAR(ld_shlibs, $1)=no\n      ;;\n    esac\n  fi\n])\nAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])\ntest \"$_LT_AC_TAGVAR(ld_shlibs, $1)\" = no && can_build_shared=no\n\nvariables_saved_for_relink=\"PATH $shlibpath_var $runpath_var\"\nif test \"$GCC\" = yes; then\n  variables_saved_for_relink=\"$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH\"\nfi\n\n#\n# Do we need to explicitly link libc?\n#\ncase \"x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)\" in\nx|xyes)\n  # Assume -lc should be added\n  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes\n\n  if test \"$enable_shared\" = yes && test \"$GCC\" = yes; then\n    case $_LT_AC_TAGVAR(archive_cmds, $1) in\n    *'~'*)\n      # FIXME: we may have to deal with multi-command sequences.\n      ;;\n    '$CC '*)\n      # Test whether the compiler implicitly links with -lc since on some\n      # systems, -lgcc has to come before -lc. If gcc already passes -lc\n      # to ld, don't add -lc before -lgcc.\n      AC_MSG_CHECKING([whether -lc should be explicitly linked in])\n      $rm conftest*\n      printf \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n\n      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then\n        soname=conftest\n        lib=conftest\n        libobjs=conftest.$ac_objext\n        deplibs=\n        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)\n        compiler_flags=-v\n        linker_flags=-v\n        verstring=\n        output_objdir=.\n        libname=conftest\n        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)\n        _LT_AC_TAGVAR(allow_undefined_flag, $1)=\n        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\\>\\&1 \\| grep \\\" -lc \\\" \\>/dev/null 2\\>\\&1)\n        then\n\t  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no\n        else\n\t  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes\n        fi\n        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag\n      else\n        cat conftest.err 1>&5\n      fi\n      $rm conftest*\n      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])\n      ;;\n    esac\n  fi\n  ;;\nesac\n])# AC_LIBTOOL_PROG_LD_SHLIBS\n\n\n# _LT_AC_FILE_LTDLL_C\n# -------------------\n# Be careful that the start marker always follows a newline.\nAC_DEFUN([_LT_AC_FILE_LTDLL_C], [\n# /* ltdll.c starts here */\n# #define WIN32_LEAN_AND_MEAN\n# #include <windows.h>\n# #undef WIN32_LEAN_AND_MEAN\n# #include <stdio.h>\n#\n# #ifndef __CYGWIN__\n# #  ifdef __CYGWIN32__\n# #    define __CYGWIN__ __CYGWIN32__\n# #  endif\n# #endif\n#\n# #ifdef __cplusplus\n# extern \"C\" {\n# #endif\n# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);\n# #ifdef __cplusplus\n# }\n# #endif\n#\n# #ifdef __CYGWIN__\n# #include <cygwin/cygwin_dll.h>\n# DECLARE_CYGWIN_DLL( DllMain );\n# #endif\n# HINSTANCE __hDllInstance_base;\n#\n# BOOL APIENTRY\n# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)\n# {\n#   __hDllInstance_base = hInst;\n#   return TRUE;\n# }\n# /* ltdll.c ends here */\n])# _LT_AC_FILE_LTDLL_C\n\n\n# _LT_AC_TAGVAR(VARNAME, [TAGNAME])\n# ---------------------------------\nAC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])\n\n\n# old names\nAC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])\nAC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])\nAC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])\nAC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])\nAC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])\nAC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])\nAC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])\n\n# This is just to silence aclocal about the macro not being used\nifelse([AC_DISABLE_FAST_INSTALL])\n\nAC_DEFUN([LT_AC_PROG_GCJ],\n[AC_CHECK_TOOL(GCJ, gcj, no)\n  test \"x${GCJFLAGS+set}\" = xset || GCJFLAGS=\"-g -O2\"\n  AC_SUBST(GCJFLAGS)\n])\n\nAC_DEFUN([LT_AC_PROG_RC],\n[AC_CHECK_TOOL(RC, windres, no)\n])\n\n# NOTE: This macro has been submitted for inclusion into   #\n#  GNU Autoconf as AC_PROG_SED.  When it is available in   #\n#  a released version of Autoconf we should remove this    #\n#  macro and use it instead.                               #\n# LT_AC_PROG_SED\n# --------------\n# Check for a fully-functional sed program, that truncates\n# as few characters as possible.  Prefer GNU sed if found.\nAC_DEFUN([LT_AC_PROG_SED],\n[AC_MSG_CHECKING([for a sed that does not truncate output])\nAC_CACHE_VAL(lt_cv_path_SED,\n[# Loop through the user's path and test for sed and gsed.\n# Then use that list of sed's as ones to test for truncation.\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for lt_ac_prog in sed gsed; do\n    for ac_exec_ext in '' $ac_executable_extensions; do\n      if $as_executable_p \"$as_dir/$lt_ac_prog$ac_exec_ext\"; then\n        lt_ac_sed_list=\"$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext\"\n      fi\n    done\n  done\ndone\nlt_ac_max=0\nlt_ac_count=0\n# Add /usr/xpg4/bin/sed as it is typically found on Solaris\n# along with /bin/sed that truncates output.\nfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do\n  test ! -f $lt_ac_sed && break\n  cat /dev/null > conftest.in\n  lt_ac_count=0\n  echo $ECHO_N \"0123456789$ECHO_C\" >conftest.in\n  # Check for GNU sed and select it if it is found.\n  if \"$lt_ac_sed\" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then\n    lt_cv_path_SED=$lt_ac_sed\n    break\n  fi\n  while true; do\n    cat conftest.in conftest.in >conftest.tmp\n    mv conftest.tmp conftest.in\n    cp conftest.in conftest.nl\n    echo >>conftest.nl\n    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break\n    cmp -s conftest.out conftest.nl || break\n    # 10000 chars as input seems more than enough\n    test $lt_ac_count -gt 10 && break\n    lt_ac_count=`expr $lt_ac_count + 1`\n    if test $lt_ac_count -gt $lt_ac_max; then\n      lt_ac_max=$lt_ac_count\n      lt_cv_path_SED=$lt_ac_sed\n    fi\n  done\ndone\nSED=$lt_cv_path_SED\n])\nAC_MSG_RESULT([$SED])\n])\n\n#                                                        -*- Autoconf -*-\n# Copyright (C) 2002, 2003  Free Software Foundation, Inc.\n# Generated from amversion.in; do not edit by hand.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n\n# AM_AUTOMAKE_VERSION(VERSION)\n# ----------------------------\n# Automake X.Y traces this macro to ensure aclocal.m4 has been\n# generated from the m4 files accompanying Automake X.Y.\nAC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version=\"1.9\"])\n\n# AM_SET_CURRENT_AUTOMAKE_VERSION\n# -------------------------------\n# Call AM_AUTOMAKE_VERSION so it can be traced.\n# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.\nAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],\n\t [AM_AUTOMAKE_VERSION([1.9.2])])\n\n# Figure out how to run the assembler.             -*- Autoconf -*-\n\n# serial 3\n\n# Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n# 02111-1307, USA.\n\n# AM_PROG_AS\n# ----------\nAC_DEFUN([AM_PROG_AS],\n[# By default we simply use the C compiler to build assembly code.\nAC_REQUIRE([AC_PROG_CC])\ntest \"${CCAS+set}\" = set || CCAS=$CC\ntest \"${CCASFLAGS+set}\" = set || CCASFLAGS=$CFLAGS\nAC_ARG_VAR([CCAS],      [assembler compiler command (defaults to CC)])\nAC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)])\n])\n\n# AM_AUX_DIR_EXPAND\n\n# Copyright (C) 2001, 2003 Free Software Foundation, Inc.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n# 02111-1307, USA.\n\n# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets\n# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to\n# `$srcdir', `$srcdir/..', or `$srcdir/../..'.\n#\n# Of course, Automake must honor this variable whenever it calls a\n# tool from the auxiliary directory.  The problem is that $srcdir (and\n# therefore $ac_aux_dir as well) can be either absolute or relative,\n# depending on how configure is run.  This is pretty annoying, since\n# it makes $ac_aux_dir quite unusable in subdirectories: in the top\n# source directory, any form will work fine, but in subdirectories a\n# relative path needs to be adjusted first.\n#\n# $ac_aux_dir/missing\n#    fails when called from a subdirectory if $ac_aux_dir is relative\n# $top_srcdir/$ac_aux_dir/missing\n#    fails if $ac_aux_dir is absolute,\n#    fails when called from a subdirectory in a VPATH build with\n#          a relative $ac_aux_dir\n#\n# The reason of the latter failure is that $top_srcdir and $ac_aux_dir\n# are both prefixed by $srcdir.  In an in-source build this is usually\n# harmless because $srcdir is `.', but things will broke when you\n# start a VPATH build or use an absolute $srcdir.\n#\n# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,\n# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:\n#   am_aux_dir='\\$(top_srcdir)/'`expr \"$ac_aux_dir\" : \"$srcdir//*\\(.*\\)\"`\n# and then we would define $MISSING as\n#   MISSING=\"\\${SHELL} $am_aux_dir/missing\"\n# This will work as long as MISSING is not called from configure, because\n# unfortunately $(top_srcdir) has no meaning in configure.\n# However there are other variables, like CC, which are often used in\n# configure, and could therefore not use this \"fixed\" $ac_aux_dir.\n#\n# Another solution, used here, is to always expand $ac_aux_dir to an\n# absolute PATH.  The drawback is that using absolute paths prevent a\n# configured tree to be moved without reconfiguration.\n\nAC_DEFUN([AM_AUX_DIR_EXPAND],\n[dnl Rely on autoconf to set up CDPATH properly.\nAC_PREREQ([2.50])dnl\n# expand $ac_aux_dir to an absolute path\nam_aux_dir=`cd $ac_aux_dir && pwd`\n])\n\n# AM_CONDITIONAL                                              -*- Autoconf -*-\n\n# Copyright (C) 1997, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n# 02111-1307, USA.\n\n# serial 6\n\n# AM_CONDITIONAL(NAME, SHELL-CONDITION)\n# -------------------------------------\n# Define a conditional.\nAC_DEFUN([AM_CONDITIONAL],\n[AC_PREREQ(2.52)dnl\n ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],\n\t[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl\nAC_SUBST([$1_TRUE])\nAC_SUBST([$1_FALSE])\nif $2; then\n  $1_TRUE=\n  $1_FALSE='#'\nelse\n  $1_TRUE='#'\n  $1_FALSE=\nfi\nAC_CONFIG_COMMANDS_PRE(\n[if test -z \"${$1_TRUE}\" && test -z \"${$1_FALSE}\"; then\n  AC_MSG_ERROR([[conditional \"$1\" was never defined.\nUsually this means the macro was only invoked conditionally.]])\nfi])])\n\n# serial 7\t\t\t\t\t\t-*- Autoconf -*-\n\n# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004\n# Free Software Foundation, Inc.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n# 02111-1307, USA.\n\n\n# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be\n# written in clear, in which case automake, when reading aclocal.m4,\n# will think it sees a *use*, and therefore will trigger all it's\n# C support machinery.  Also note that it means that autoscan, seeing\n# CC etc. in the Makefile, will ask for an AC_PROG_CC use...\n\n\n\n# _AM_DEPENDENCIES(NAME)\n# ----------------------\n# See how the compiler implements dependency checking.\n# NAME is \"CC\", \"CXX\", \"GCJ\", or \"OBJC\".\n# We try a few techniques and use that to set a single cache variable.\n#\n# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was\n# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular\n# dependency, and given that the user is not expected to run this macro,\n# just rely on AC_PROG_CC.\nAC_DEFUN([_AM_DEPENDENCIES],\n[AC_REQUIRE([AM_SET_DEPDIR])dnl\nAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl\nAC_REQUIRE([AM_MAKE_INCLUDE])dnl\nAC_REQUIRE([AM_DEP_TRACK])dnl\n\nifelse([$1], CC,   [depcc=\"$CC\"   am_compiler_list=],\n       [$1], CXX,  [depcc=\"$CXX\"  am_compiler_list=],\n       [$1], OBJC, [depcc=\"$OBJC\" am_compiler_list='gcc3 gcc'],\n       [$1], GCJ,  [depcc=\"$GCJ\"  am_compiler_list='gcc3 gcc'],\n                   [depcc=\"$$1\"   am_compiler_list=])\n\nAC_CACHE_CHECK([dependency style of $depcc],\n               [am_cv_$1_dependencies_compiler_type],\n[if test -z \"$AMDEP_TRUE\" && test -f \"$am_depcomp\"; then\n  # We make a subdir and do the tests there.  Otherwise we can end up\n  # making bogus files that we don't know about and never remove.  For\n  # instance it was reported that on HP-UX the gcc test will end up\n  # making a dummy file named `D' -- because `-MD' means `put the output\n  # in D'.\n  mkdir conftest.dir\n  # Copy depcomp to subdir because otherwise we won't find it if we're\n  # using a relative directory.\n  cp \"$am_depcomp\" conftest.dir\n  cd conftest.dir\n  # We will build objects and dependencies in a subdirectory because\n  # it helps to detect inapplicable dependency modes.  For instance\n  # both Tru64's cc and ICC support -MD to output dependencies as a\n  # side effect of compilation, but ICC will put the dependencies in\n  # the current directory while Tru64 will put them in the object\n  # directory.\n  mkdir sub\n\n  am_cv_$1_dependencies_compiler_type=none\n  if test \"$am_compiler_list\" = \"\"; then\n     am_compiler_list=`sed -n ['s/^#*\\([a-zA-Z0-9]*\\))$/\\1/p'] < ./depcomp`\n  fi\n  for depmode in $am_compiler_list; do\n    # Setup a source with many dependencies, because some compilers\n    # like to wrap large dependency lists on column 80 (with \\), and\n    # we should not choose a depcomp mode which is confused by this.\n    #\n    # We need to recreate these files for each test, as the compiler may\n    # overwrite some of them when testing with obscure command lines.\n    # This happens at least with the AIX C compiler.\n    : > sub/conftest.c\n    for i in 1 2 3 4 5 6; do\n      echo '#include \"conftst'$i'.h\"' >> sub/conftest.c\n      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with\n      # Solaris 8's {/usr,}/bin/sh.\n      touch sub/conftst$i.h\n    done\n    echo \"${am__include} ${am__quote}sub/conftest.Po${am__quote}\" > confmf\n\n    case $depmode in\n    nosideeffect)\n      # after this tag, mechanisms are not by side-effect, so they'll\n      # only be used when explicitly requested\n      if test \"x$enable_dependency_tracking\" = xyes; then\n\tcontinue\n      else\n\tbreak\n      fi\n      ;;\n    none) break ;;\n    esac\n    # We check with `-c' and `-o' for the sake of the \"dashmstdout\"\n    # mode.  It turns out that the SunPro C++ compiler does not properly\n    # handle `-M -o', and we need to detect this.\n    if depmode=$depmode \\\n       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \\\n       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \\\n       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \\\n         >/dev/null 2>conftest.err &&\n       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&\n       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&\n       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then\n      # icc doesn't choke on unknown options, it will just issue warnings\n      # or remarks (even with -Werror).  So we grep stderr for any message\n      # that says an option was ignored or not supported.\n      # When given -MP, icc 7.0 and 7.1 complain thusly:\n      #   icc: Command line warning: ignoring option '-M'; no argument required\n      # The diagnosis changed in icc 8.0:\n      #   icc: Command line remark: option '-MP' not supported\n      if (grep 'ignoring option' conftest.err ||\n          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else\n        am_cv_$1_dependencies_compiler_type=$depmode\n        break\n      fi\n    fi\n  done\n\n  cd ..\n  rm -rf conftest.dir\nelse\n  am_cv_$1_dependencies_compiler_type=none\nfi\n])\nAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])\nAM_CONDITIONAL([am__fastdep$1], [\n  test \"x$enable_dependency_tracking\" != xno \\\n  && test \"$am_cv_$1_dependencies_compiler_type\" = gcc3])\n])\n\n\n# AM_SET_DEPDIR\n# -------------\n# Choose a directory name for dependency files.\n# This macro is AC_REQUIREd in _AM_DEPENDENCIES\nAC_DEFUN([AM_SET_DEPDIR],\n[AC_REQUIRE([AM_SET_LEADING_DOT])dnl\nAC_SUBST([DEPDIR], [\"${am__leading_dot}deps\"])dnl\n])\n\n\n# AM_DEP_TRACK\n# ------------\nAC_DEFUN([AM_DEP_TRACK],\n[AC_ARG_ENABLE(dependency-tracking,\n[  --disable-dependency-tracking  speeds up one-time build\n  --enable-dependency-tracking   do not reject slow dependency extractors])\nif test \"x$enable_dependency_tracking\" != xno; then\n  am_depcomp=\"$ac_aux_dir/depcomp\"\n  AMDEPBACKSLASH='\\'\nfi\nAM_CONDITIONAL([AMDEP], [test \"x$enable_dependency_tracking\" != xno])\nAC_SUBST([AMDEPBACKSLASH])\n])\n\n# Generate code to set up dependency tracking.   -*- Autoconf -*-\n\n# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004\n#   Free Software Foundation, Inc.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n# 02111-1307, USA.\n\n#serial 2\n\n# _AM_OUTPUT_DEPENDENCY_COMMANDS\n# ------------------------------\nAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],\n[for mf in $CONFIG_FILES; do\n  # Strip MF so we end up with the name of the file.\n  mf=`echo \"$mf\" | sed -e 's/:.*$//'`\n  # Check whether this is an Automake generated Makefile or not.\n  # We used to match only the files named `Makefile.in', but\n  # some people rename them; so instead we look at the file content.\n  # Grep'ing the first line is not enough: some people post-process\n  # each Makefile.in and add a new line on top of each file to say so.\n  # So let's grep whole file.\n  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then\n    dirpart=`AS_DIRNAME(\"$mf\")`\n  else\n    continue\n  fi\n  # Extract the definition of DEPDIR, am__include, and am__quote\n  # from the Makefile without running `make'.\n  DEPDIR=`sed -n 's/^DEPDIR = //p' < \"$mf\"`\n  test -z \"$DEPDIR\" && continue\n  am__include=`sed -n 's/^am__include = //p' < \"$mf\"`\n  test -z \"am__include\" && continue\n  am__quote=`sed -n 's/^am__quote = //p' < \"$mf\"`\n  # When using ansi2knr, U may be empty or an underscore; expand it\n  U=`sed -n 's/^U = //p' < \"$mf\"`\n  # Find all dependency output files, they are included files with\n  # $(DEPDIR) in their names.  We invoke sed twice because it is the\n  # simplest approach to changing $(DEPDIR) to its actual value in the\n  # expansion.\n  for file in `sed -n \"\n    s/^$am__include $am__quote\\(.*(DEPDIR).*\\)$am__quote\"'$/\\1/p' <\"$mf\" | \\\n       sed -e 's/\\$(DEPDIR)/'\"$DEPDIR\"'/g' -e 's/\\$U/'\"$U\"'/g'`; do\n    # Make sure the directory exists.\n    test -f \"$dirpart/$file\" && continue\n    fdir=`AS_DIRNAME([\"$file\"])`\n    AS_MKDIR_P([$dirpart/$fdir])\n    # echo \"creating $dirpart/$file\"\n    echo '# dummy' > \"$dirpart/$file\"\n  done\ndone\n])# _AM_OUTPUT_DEPENDENCY_COMMANDS\n\n\n# AM_OUTPUT_DEPENDENCY_COMMANDS\n# -----------------------------\n# This macro should only be invoked once -- use via AC_REQUIRE.\n#\n# This code is only required when automatic dependency tracking\n# is enabled.  FIXME.  This creates each `.P' file that we will\n# need in order to bootstrap the dependency handling code.\nAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],\n[AC_CONFIG_COMMANDS([depfiles],\n     [test x\"$AMDEP_TRUE\" != x\"\" || _AM_OUTPUT_DEPENDENCY_COMMANDS],\n     [AMDEP_TRUE=\"$AMDEP_TRUE\" ac_aux_dir=\"$ac_aux_dir\"])\n])\n\n# Do all the work for Automake.                            -*- Autoconf -*-\n\n# This macro actually does too much some checks are only needed if\n# your package does certain things.  But this isn't really a big deal.\n\n# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004\n# Free Software Foundation, Inc.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n# 02111-1307, USA.\n\n# serial 11\n\n# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])\n# AM_INIT_AUTOMAKE([OPTIONS])\n# -----------------------------------------------\n# The call with PACKAGE and VERSION arguments is the old style\n# call (pre autoconf-2.50), which is being phased out.  PACKAGE\n# and VERSION should now be passed to AC_INIT and removed from\n# the call to AM_INIT_AUTOMAKE.\n# We support both call styles for the transition.  After\n# the next Automake release, Autoconf can make the AC_INIT\n# arguments mandatory, and then we can depend on a new Autoconf\n# release and drop the old call support.\nAC_DEFUN([AM_INIT_AUTOMAKE],\n[AC_PREREQ([2.58])dnl\ndnl Autoconf wants to disallow AM_ names.  We explicitly allow\ndnl the ones we care about.\nm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl\nAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl\nAC_REQUIRE([AC_PROG_INSTALL])dnl\n# test to see if srcdir already configured\nif test \"`cd $srcdir && pwd`\" != \"`pwd`\" &&\n   test -f $srcdir/config.status; then\n  AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])\nfi\n\n# test whether we have cygpath\nif test -z \"$CYGPATH_W\"; then\n  if (cygpath --version) >/dev/null 2>/dev/null; then\n    CYGPATH_W='cygpath -w'\n  else\n    CYGPATH_W=echo\n  fi\nfi\nAC_SUBST([CYGPATH_W])\n\n# Define the identity of the package.\ndnl Distinguish between old-style and new-style calls.\nm4_ifval([$2],\n[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl\n AC_SUBST([PACKAGE], [$1])dnl\n AC_SUBST([VERSION], [$2])],\n[_AM_SET_OPTIONS([$1])dnl\n AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl\n AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl\n\n_AM_IF_OPTION([no-define],,\n[AC_DEFINE_UNQUOTED(PACKAGE, \"$PACKAGE\", [Name of package])\n AC_DEFINE_UNQUOTED(VERSION, \"$VERSION\", [Version number of package])])dnl\n\n# Some tools Automake needs.\nAC_REQUIRE([AM_SANITY_CHECK])dnl\nAC_REQUIRE([AC_ARG_PROGRAM])dnl\nAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})\nAM_MISSING_PROG(AUTOCONF, autoconf)\nAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})\nAM_MISSING_PROG(AUTOHEADER, autoheader)\nAM_MISSING_PROG(MAKEINFO, makeinfo)\nAM_PROG_INSTALL_SH\nAM_PROG_INSTALL_STRIP\nAC_REQUIRE([AM_PROG_MKDIR_P])dnl\n# We need awk for the \"check\" target.  The system \"awk\" is bad on\n# some platforms.\nAC_REQUIRE([AC_PROG_AWK])dnl\nAC_REQUIRE([AC_PROG_MAKE_SET])dnl\nAC_REQUIRE([AM_SET_LEADING_DOT])dnl\n_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],\n              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],\n\t      \t\t     [_AM_PROG_TAR([v7])])])\n_AM_IF_OPTION([no-dependencies],,\n[AC_PROVIDE_IFELSE([AC_PROG_CC],\n                  [_AM_DEPENDENCIES(CC)],\n                  [define([AC_PROG_CC],\n                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl\nAC_PROVIDE_IFELSE([AC_PROG_CXX],\n                  [_AM_DEPENDENCIES(CXX)],\n                  [define([AC_PROG_CXX],\n                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl\n])\n])\n\n\n# When config.status generates a header, we must update the stamp-h file.\n# This file resides in the same directory as the config header\n# that is generated.  The stamp files are numbered to have different names.\n\n# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the\n# loop where config.status creates the headers, so we can generate\n# our stamp files there.\nAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],\n[# Compute $1's index in $config_headers.\n_am_stamp_count=1\nfor _am_header in $config_headers :; do\n  case $_am_header in\n    $1 | $1:* )\n      break ;;\n    * )\n      _am_stamp_count=`expr $_am_stamp_count + 1` ;;\n  esac\ndone\necho \"timestamp for $1\" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])\n\n# AM_PROG_INSTALL_SH\n# ------------------\n# Define $install_sh.\n\n# Copyright (C) 2001, 2003 Free Software Foundation, Inc.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n# 02111-1307, USA.\n\nAC_DEFUN([AM_PROG_INSTALL_SH],\n[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl\ninstall_sh=${install_sh-\"$am_aux_dir/install-sh\"}\nAC_SUBST(install_sh)])\n\n#                                                          -*- Autoconf -*-\n# Copyright (C) 2003  Free Software Foundation, Inc.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n# 02111-1307, USA.\n\n# serial 1\n\n# Check whether the underlying file-system supports filenames\n# with a leading dot.  For instance MS-DOS doesn't.\nAC_DEFUN([AM_SET_LEADING_DOT],\n[rm -rf .tst 2>/dev/null\nmkdir .tst 2>/dev/null\nif test -d .tst; then\n  am__leading_dot=.\nelse\n  am__leading_dot=_\nfi\nrmdir .tst 2>/dev/null\nAC_SUBST([am__leading_dot])])\n\n# Check to see how 'make' treats includes.\t-*- Autoconf -*-\n\n# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n# 02111-1307, USA.\n\n# serial 2\n\n# AM_MAKE_INCLUDE()\n# -----------------\n# Check to see how make treats includes.\nAC_DEFUN([AM_MAKE_INCLUDE],\n[am_make=${MAKE-make}\ncat > confinc << 'END'\nam__doit:\n\t@echo done\n.PHONY: am__doit\nEND\n# If we don't find an include directive, just comment out the code.\nAC_MSG_CHECKING([for style of include used by $am_make])\nam__include=\"#\"\nam__quote=\n_am_result=none\n# First try GNU make style include.\necho \"include confinc\" > confmf\n# We grep out `Entering directory' and `Leaving directory'\n# messages which can occur if `w' ends up in MAKEFLAGS.\n# In particular we don't look at `^make:' because GNU make might\n# be invoked under some other name (usually \"gmake\"), in which\n# case it prints its new name instead of `make'.\nif test \"`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`\" = \"done\"; then\n   am__include=include\n   am__quote=\n   _am_result=GNU\nfi\n# Now try BSD make style include.\nif test \"$am__include\" = \"#\"; then\n   echo '.include \"confinc\"' > confmf\n   if test \"`$am_make -s -f confmf 2> /dev/null`\" = \"done\"; then\n      am__include=.include\n      am__quote=\"\\\"\"\n      _am_result=BSD\n   fi\nfi\nAC_SUBST([am__include])\nAC_SUBST([am__quote])\nAC_MSG_RESULT([$_am_result])\nrm -f confinc confmf\n])\n\n# serial 2\n\n# AM_PROG_CC_C_O\n# --------------\n# Like AC_PROG_CC_C_O, but changed for automake.\n\n# Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n# 02111-1307, USA.\n\nAC_DEFUN([AM_PROG_CC_C_O],\n[AC_REQUIRE([AC_PROG_CC_C_O])dnl\nAC_REQUIRE([AM_AUX_DIR_EXPAND])dnl\n# FIXME: we rely on the cache variable name because\n# there is no other way.\nset dummy $CC\nac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`\nif eval \"test \\\"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\\\" != yes\"; then\n   # Losing compiler, so override with the script.\n   # FIXME: It is wrong to rewrite CC.\n   # But if we don't then we get into trouble of one sort or another.\n   # A longer-term fix would be to have automake use am__CC in this case,\n   # and then we could set am__CC=\"\\$(top_srcdir)/compile \\$(CC)\"\n   CC=\"$am_aux_dir/compile $CC\"\nfi\n])\n\n#  -*- Autoconf -*-\n\n\n# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n# 02111-1307, USA.\n\n# serial 3\n\n# AM_MISSING_PROG(NAME, PROGRAM)\n# ------------------------------\nAC_DEFUN([AM_MISSING_PROG],\n[AC_REQUIRE([AM_MISSING_HAS_RUN])\n$1=${$1-\"${am_missing_run}$2\"}\nAC_SUBST($1)])\n\n\n# AM_MISSING_HAS_RUN\n# ------------------\n# Define MISSING if not defined so far and test if it supports --run.\n# If it does, set am_missing_run to use it, otherwise, to nothing.\nAC_DEFUN([AM_MISSING_HAS_RUN],\n[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl\ntest x\"${MISSING+set}\" = xset || MISSING=\"\\${SHELL} $am_aux_dir/missing\"\n# Use eval to expand $SHELL\nif eval \"$MISSING --run true\"; then\n  am_missing_run=\"$MISSING --run \"\nelse\n  am_missing_run=\n  AC_MSG_WARN([`missing' script is too old or missing])\nfi\n])\n\n# AM_PROG_MKDIR_P\n# ---------------\n# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.\n\n# Copyright (C) 2003, 2004 Free Software Foundation, Inc.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n# 02111-1307, USA.\n\n# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories\n# created by `make install' are always world readable, even if the\n# installer happens to have an overly restrictive umask (e.g. 077).\n# This was a mistake.  There are at least two reasons why we must not\n# use `-m 0755':\n#   - it causes special bits like SGID to be ignored,\n#   - it may be too restrictive (some setups expect 775 directories).\n#\n# Do not use -m 0755 and let people choose whatever they expect by\n# setting umask.\n#\n# We cannot accept any implementation of `mkdir' that recognizes `-p'.\n# Some implementations (such as Solaris 8's) are not thread-safe: if a\n# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'\n# concurrently, both version can detect that a/ is missing, but only\n# one can create it and the other will error out.  Consequently we\n# restrict ourselves to GNU make (using the --version option ensures\n# this.)\nAC_DEFUN([AM_PROG_MKDIR_P],\n[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then\n  # We used to keeping the `.' as first argument, in order to\n  # allow $(mkdir_p) to be used without argument.  As in\n  #   $(mkdir_p) $(somedir)\n  # where $(somedir) is conditionally defined.  However this is wrong\n  # for two reasons:\n  #  1. if the package is installed by a user who cannot write `.'\n  #     make install will fail,\n  #  2. the above comment should most certainly read\n  #     $(mkdir_p) $(DESTDIR)$(somedir)\n  #     so it does not work when $(somedir) is undefined and\n  #     $(DESTDIR) is not.\n  #  To support the latter case, we have to write\n  #     test -z \"$(somedir)\" || $(mkdir_p) $(DESTDIR)$(somedir),\n  #  so the `.' trick is pointless.\n  mkdir_p='mkdir -p --'\nelse\n  # On NextStep and OpenStep, the `mkdir' command does not\n  # recognize any option.  It will interpret all options as\n  # directories to create, and then abort because `.' already\n  # exists.\n  for d in ./-p ./--version;\n  do\n    test -d $d && rmdir $d\n  done\n  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.\n  if test -f \"$ac_aux_dir/mkinstalldirs\"; then\n    mkdir_p='$(mkinstalldirs)'\n  else\n    mkdir_p='$(install_sh) -d'\n  fi\nfi\nAC_SUBST([mkdir_p])])\n\n# Helper functions for option handling.                    -*- Autoconf -*-\n\n# Copyright (C) 2001, 2002, 2003  Free Software Foundation, Inc.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n# 02111-1307, USA.\n\n# serial 2\n\n# _AM_MANGLE_OPTION(NAME)\n# -----------------------\nAC_DEFUN([_AM_MANGLE_OPTION],\n[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])\n\n# _AM_SET_OPTION(NAME)\n# ------------------------------\n# Set option NAME.  Presently that only means defining a flag for this option.\nAC_DEFUN([_AM_SET_OPTION],\n[m4_define(_AM_MANGLE_OPTION([$1]), 1)])\n\n# _AM_SET_OPTIONS(OPTIONS)\n# ----------------------------------\n# OPTIONS is a space-separated list of Automake options.\nAC_DEFUN([_AM_SET_OPTIONS],\n[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])\n\n# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])\n# -------------------------------------------\n# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.\nAC_DEFUN([_AM_IF_OPTION],\n[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])\n\n#\n# Check to make sure that the build environment is sane.\n#\n\n# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n# 02111-1307, USA.\n\n# serial 3\n\n# AM_SANITY_CHECK\n# ---------------\nAC_DEFUN([AM_SANITY_CHECK],\n[AC_MSG_CHECKING([whether build environment is sane])\n# Just in case\nsleep 1\necho timestamp > conftest.file\n# Do `set' in a subshell so we don't clobber the current shell's\n# arguments.  Must try -L first in case configure is actually a\n# symlink; some systems play weird games with the mod time of symlinks\n# (eg FreeBSD returns the mod time of the symlink's containing\n# directory).\nif (\n   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`\n   if test \"$[*]\" = \"X\"; then\n      # -L didn't work.\n      set X `ls -t $srcdir/configure conftest.file`\n   fi\n   rm -f conftest.file\n   if test \"$[*]\" != \"X $srcdir/configure conftest.file\" \\\n      && test \"$[*]\" != \"X conftest.file $srcdir/configure\"; then\n\n      # If neither matched, then we have a broken ls.  This can happen\n      # if, for instance, CONFIG_SHELL is bash and it inherits a\n      # broken ls alias from the environment.  This has actually\n      # happened.  Such a system could not be considered \"sane\".\n      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken\nalias in your environment])\n   fi\n\n   test \"$[2]\" = conftest.file\n   )\nthen\n   # Ok.\n   :\nelse\n   AC_MSG_ERROR([newly created file is older than distributed files!\nCheck your system clock])\nfi\nAC_MSG_RESULT(yes)])\n\n# AM_PROG_INSTALL_STRIP\n\n# Copyright (C) 2001, 2003 Free Software Foundation, Inc.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n# 02111-1307, USA.\n\n# One issue with vendor `install' (even GNU) is that you can't\n# specify the program used to strip binaries.  This is especially\n# annoying in cross-compiling environments, where the build's strip\n# is unlikely to handle the host's binaries.\n# Fortunately install-sh will honor a STRIPPROG variable, so we\n# always use install-sh in `make install-strip', and initialize\n# STRIPPROG with the value of the STRIP variable (set by the user).\nAC_DEFUN([AM_PROG_INSTALL_STRIP],\n[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl\n# Installed binaries are usually stripped using `strip' when the user\n# run `make install-strip'.  However `strip' might not be the right\n# tool to use in cross-compilation environments, therefore Automake\n# will honor the `STRIP' environment variable to overrule this program.\ndnl Don't test for $cross_compiling = yes, because it might be `maybe'.\nif test \"$cross_compiling\" != no; then\n  AC_CHECK_TOOL([STRIP], [strip], :)\nfi\nINSTALL_STRIP_PROGRAM=\"\\${SHELL} \\$(install_sh) -c -s\"\nAC_SUBST([INSTALL_STRIP_PROGRAM])])\n\n# Check how to create a tarball.                            -*- Autoconf -*-\n\n# Copyright (C) 2004  Free Software Foundation, Inc.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n# 02111-1307, USA.\n\n# serial 1\n\n\n# _AM_PROG_TAR(FORMAT)\n# --------------------\n# Check how to create a tarball in format FORMAT.\n# FORMAT should be one of `v7', `ustar', or `pax'.\n#\n# Substitute a variable $(am__tar) that is a command\n# writing to stdout a FORMAT-tarball containing the directory\n# $tardir.\n#     tardir=directory && $(am__tar) > result.tar\n#\n# Substitute a variable $(am__untar) that extract such\n# a tarball read from stdin.\n#     $(am__untar) < result.tar\nAC_DEFUN([_AM_PROG_TAR],\n[# Always define AMTAR for backward compatibility.\nAM_MISSING_PROG([AMTAR], [tar])\nm4_if([$1], [v7],\n     [am__tar='${AMTAR} chof - \"$$tardir\"'; am__untar='${AMTAR} xf -'],\n     [m4_case([$1], [ustar],, [pax],,\n              [m4_fatal([Unknown tar format])])\nAC_MSG_CHECKING([how to create a $1 tar archive])\n# Loop over all known methods to create a tar archive until one works.\n_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'\n_am_tools=${am_cv_prog_tar_$1-$_am_tools}\n# Do not fold the above two line into one, because Tru64 sh and\n# Solaris sh will not grok spaces in the rhs of `-'.\nfor _am_tool in $_am_tools\ndo\n  case $_am_tool in\n  gnutar)\n    for _am_tar in tar gnutar gtar;\n    do\n      AM_RUN_LOG([$_am_tar --version]) && break\n    done\n    am__tar=\"$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - \"'\"$$tardir\"'\n    am__tar_=\"$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - \"'\"$tardir\"'\n    am__untar=\"$_am_tar -xf -\"\n    ;;\n  plaintar)\n    # Must skip GNU tar: if it does not support --format= it doesn't create\n    # ustar tarball either.\n    (tar --version) >/dev/null 2>&1 && continue\n    am__tar='tar chf - \"$$tardir\"'\n    am__tar_='tar chf - \"$tardir\"'\n    am__untar='tar xf -'\n    ;;\n  pax)\n    am__tar='pax -L -x $1 -w \"$$tardir\"'\n    am__tar_='pax -L -x $1 -w \"$tardir\"'\n    am__untar='pax -r'\n    ;;\n  cpio)\n    am__tar='find \"$$tardir\" -print | cpio -o -H $1 -L'\n    am__tar_='find \"$tardir\" -print | cpio -o -H $1 -L'\n    am__untar='cpio -i -H $1 -d'\n    ;;\n  none)\n    am__tar=false\n    am__tar_=false\n    am__untar=false\n    ;;\n  esac\n\n  # If the value was cached, stop now.  We just wanted to have am__tar\n  # and am__untar set.\n  test -n \"${am_cv_prog_tar_$1}\" && break\n\n  # tar/untar a dummy directory, and stop if the command works\n  rm -rf conftest.dir\n  mkdir conftest.dir\n  echo GrepMe > conftest.dir/file\n  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])\n  rm -rf conftest.dir\n  if test -s conftest.tar; then\n    AM_RUN_LOG([$am__untar <conftest.tar])\n    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break\n  fi\ndone\nrm -rf conftest.dir\n\nAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])\nAC_MSG_RESULT([$am_cv_prog_tar_$1])])\nAC_SUBST([am__tar])\nAC_SUBST([am__untar])\n]) # _AM_PROG_TAR\n\nm4_include([acinclude.m4])\n"
  },
  {
    "path": "ext/libjpeg-turbo/bmp.c",
    "content": "/*\n * Copyright (C)2011 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include <stdio.h>\n#include <string.h>\n#include <setjmp.h>\n#include <errno.h>\n#include \"cdjpeg.h\"\n#include <jpeglib.h>\n#include <jpegint.h>\n#include \"tjutil.h\"\n#include \"bmp.h\"\n\n\n/* This duplicates the functionality of the VirtualGL bitmap library using\n   the components from cjpeg and djpeg */\n\n\n/* Error handling (based on example in example.c) */\n\nstatic char errStr[JMSG_LENGTH_MAX]=\"No error\";\n\nstruct my_error_mgr\n{\n\tstruct jpeg_error_mgr pub;\n\tjmp_buf setjmp_buffer;\n};\ntypedef struct my_error_mgr *my_error_ptr;\n\nstatic void my_error_exit(j_common_ptr cinfo)\n{\n\tmy_error_ptr myerr=(my_error_ptr)cinfo->err;\n\t(*cinfo->err->output_message)(cinfo);\n\tlongjmp(myerr->setjmp_buffer, 1);\n}\n\n/* Based on output_message() in jerror.c */\n\nstatic void my_output_message(j_common_ptr cinfo)\n{\n\t(*cinfo->err->format_message)(cinfo, errStr);\n}\n\n#define _throw(m) {snprintf(errStr, JMSG_LENGTH_MAX, \"%s\", m);  \\\n\tretval=-1;  goto bailout;}\n#define _throwunix(m) {snprintf(errStr, JMSG_LENGTH_MAX, \"%s\\n%s\", m,  \\\n\tstrerror(errno));  retval=-1;  goto bailout;}\n\n\nstatic void pixelconvert(unsigned char *srcbuf, int srcpf, int srcbottomup,\n\tunsigned char *dstbuf, int dstpf, int dstbottomup, int w, int h)\n{\n\tunsigned char *srcptr=srcbuf, *srcptr2;\n\tint srcps=tjPixelSize[srcpf];\n\tint srcstride=srcbottomup? -w*srcps:w*srcps;\n\tunsigned char *dstptr=dstbuf, *dstptr2;\n\tint dstps=tjPixelSize[dstpf];\n\tint dststride=dstbottomup? -w*dstps:w*dstps;\n\tint row, col;\n\n\tif(srcbottomup) srcptr=&srcbuf[w*srcps*(h-1)];\n\tif(dstbottomup) dstptr=&dstbuf[w*dstps*(h-1)];\n\tfor(row=0; row<h; row++, srcptr+=srcstride, dstptr+=dststride)\n\t{\n\t\tfor(col=0, srcptr2=srcptr, dstptr2=dstptr; col<w; col++, srcptr2+=srcps,\n\t\t\tdstptr2+=dstps)\n\t\t{\n\t\t\tdstptr2[tjRedOffset[dstpf]]=srcptr2[tjRedOffset[srcpf]];\n\t\t\tdstptr2[tjGreenOffset[dstpf]]=srcptr2[tjGreenOffset[srcpf]];\n\t\t\tdstptr2[tjBlueOffset[dstpf]]=srcptr2[tjBlueOffset[srcpf]];\n\t\t}\n\t}\n}\n\n\nint loadbmp(char *filename, unsigned char **buf, int *w, int *h, \n\tint dstpf, int bottomup)\n{\n\tint retval=0, dstps, srcpf, tempc;\n\tstruct jpeg_compress_struct cinfo;\n\tstruct my_error_mgr jerr;\n\tcjpeg_source_ptr src;\n\tFILE *file=NULL;\n\n\tmemset(&cinfo, 0, sizeof(struct jpeg_compress_struct));\n\n\tif(!filename || !buf || !w || !h || dstpf<0 || dstpf>=TJ_NUMPF)\n\t\t_throw(\"loadbmp(): Invalid argument\");\n\n\tif((file=fopen(filename, \"rb\"))==NULL)\n\t\t_throwunix(\"loadbmp(): Cannot open input file\");\n\n\tcinfo.err=jpeg_std_error(&jerr.pub);\n\tjerr.pub.error_exit=my_error_exit;\n\tjerr.pub.output_message=my_output_message;\n\n\tif(setjmp(jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\tretval=-1;  goto bailout;\n\t}\n\n\tjpeg_create_compress(&cinfo);\n\tif((tempc=getc(file))<0 || ungetc(tempc, file)==EOF)\n\t\t_throwunix(\"loadbmp(): Could not read input file\")\n\telse if(tempc==EOF) _throw(\"loadbmp(): Input file contains no data\");\n\n\tif(tempc=='B')\n\t{\n\t\tif((src=jinit_read_bmp(&cinfo))==NULL)\n\t\t\t_throw(\"loadbmp(): Could not initialize bitmap loader\");\n\t}\n\telse if(tempc=='P')\n\t{\n\t\tif((src=jinit_read_ppm(&cinfo))==NULL)\n\t\t\t_throw(\"loadbmp(): Could not initialize bitmap loader\");\n\t}\n\telse _throw(\"loadbmp(): Unsupported file type\");\n\n\tsrc->input_file=file;\n\t(*src->start_input)(&cinfo, src);\n\t(*cinfo.mem->realize_virt_arrays)((j_common_ptr)&cinfo);\n\n\t*w=cinfo.image_width;  *h=cinfo.image_height;\n\n\tif(cinfo.input_components==1 && cinfo.in_color_space==JCS_RGB)\n\t\tsrcpf=TJPF_GRAY;\n\telse srcpf=TJPF_RGB;\n\n\tdstps=tjPixelSize[dstpf];\n\tif((*buf=(unsigned char *)malloc((*w)*(*h)*dstps))==NULL)\n\t\t_throw(\"loadbmp(): Memory allocation failure\");\n\n\twhile(cinfo.next_scanline<cinfo.image_height)\n\t{\n\t\tint i, nlines=(*src->get_pixel_rows)(&cinfo, src);\n\t\tfor(i=0; i<nlines; i++)\n\t\t{\n\t\t\tunsigned char *outbuf;  int row;\n\t\t\trow=cinfo.next_scanline+i;\n\t\t\tif(bottomup) outbuf=&(*buf)[((*h)-row-1)*(*w)*dstps];\n\t\t\telse outbuf=&(*buf)[row*(*w)*dstps];\n\t\t\tpixelconvert(src->buffer[i], srcpf, 0, outbuf, dstpf, bottomup, *w,\n\t\t\t\tnlines);\n\t\t}\n\t\tcinfo.next_scanline+=nlines;\n\t}\n\n\t(*src->finish_input)(&cinfo, src);\n\n\tbailout:\n\tjpeg_destroy_compress(&cinfo);\n\tif(file) fclose(file);\n\tif(retval<0 && buf && *buf) {free(*buf);  *buf=NULL;}\n\treturn retval;\n}\n\n\nint savebmp(char *filename, unsigned char *buf, int w, int h, int srcpf,\n\tint bottomup)\n{\n\tint retval=0, srcps, dstpf;\n\tstruct jpeg_decompress_struct dinfo;\n\tstruct my_error_mgr jerr;\n\tdjpeg_dest_ptr dst;\n\tFILE *file=NULL;\n\tchar *ptr=NULL;\n\n\tmemset(&dinfo, 0, sizeof(struct jpeg_decompress_struct));\n\n\tif(!filename || !buf || w<1 || h<1 || srcpf<0 || srcpf>=TJ_NUMPF)\n\t\t_throw(\"savebmp(): Invalid argument\");\n\n\tif((file=fopen(filename, \"wb\"))==NULL)\n\t\t_throwunix(\"savebmp(): Cannot open output file\");\n\n\tdinfo.err=jpeg_std_error(&jerr.pub);\n\tjerr.pub.error_exit=my_error_exit;\n\tjerr.pub.output_message=my_output_message;\n\n\tif(setjmp(jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\tretval=-1;  goto bailout;\n\t}\n\n\tjpeg_create_decompress(&dinfo);\n\tif(srcpf==TJPF_GRAY)\n\t{\n\t\tdinfo.out_color_components=dinfo.output_components=1;\n\t\tdinfo.out_color_space=JCS_GRAYSCALE;\n\t}\n\telse\n\t{\n\t\tdinfo.out_color_components=dinfo.output_components=3;\n\t\tdinfo.out_color_space=JCS_RGB;\n\t}\n\tdinfo.image_width=w;  dinfo.image_height=h;\n\tdinfo.global_state=DSTATE_READY;\n\tdinfo.scale_num=dinfo.scale_denom=1;\n\n\tptr=strrchr(filename, '.');\n\tif(ptr && !strcasecmp(ptr, \".bmp\"))\n\t{\n\t\tif((dst=jinit_write_bmp(&dinfo, 0))==NULL)\n\t\t\t_throw(\"savebmp(): Could not initialize bitmap writer\");\n\t}\n\telse\n\t{\n\t\tif((dst=jinit_write_ppm(&dinfo))==NULL)\n\t\t\t_throw(\"savebmp(): Could not initialize PPM writer\");\n\t}\n\n\tdst->output_file=file;\n\t(*dst->start_output)(&dinfo, dst);\n\t(*dinfo.mem->realize_virt_arrays)((j_common_ptr)&dinfo);\n\n\tif(srcpf==TJPF_GRAY) dstpf=srcpf;\n\telse dstpf=TJPF_RGB;\n\tsrcps=tjPixelSize[srcpf];\n\n\twhile(dinfo.output_scanline<dinfo.output_height)\n\t{\n\t\tint i, nlines=dst->buffer_height;\n\t\tfor(i=0; i<nlines; i++)\n\t\t{\n\t\t\tunsigned char *inbuf;  int row;\n\t\t\trow=dinfo.output_scanline+i;\n\t\t\tif(bottomup) inbuf=&buf[(h-row-1)*w*srcps];\n\t\t\telse inbuf=&buf[row*w*srcps];\n\t\t\tpixelconvert(inbuf, srcpf, bottomup, dst->buffer[i], dstpf, 0, w,\n\t\t\t\tnlines);\n\t\t}\n\t\t(*dst->put_pixel_rows)(&dinfo, dst, nlines);\n\t\tdinfo.output_scanline+=nlines;\n\t}\n\n\t(*dst->finish_output)(&dinfo, dst);\n\n\tbailout:\n\tjpeg_destroy_decompress(&dinfo);\n\tif(file) fclose(file);\n\treturn retval;\n}\n\nconst char *bmpgeterr(void)\n{\n\treturn errStr;\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/bmp.h",
    "content": "/*\n * Copyright (C)2011 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef __BMP_H__\n#define __BMP_H__\n\n#include \"./turbojpeg.h\"\n\nint loadbmp(char *filename, unsigned char **buf, int *w, int *h, int pf,\n\tint bottomup);\n\nint savebmp(char *filename, unsigned char *buf, int w, int h, int pf,\n\tint bottomup);\n\nconst char *bmpgeterr(void);\n\n#endif\n"
  },
  {
    "path": "ext/libjpeg-turbo/cderror.h",
    "content": "/*\n * cderror.h\n *\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * Modified 2009 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file defines the error and message codes for the cjpeg/djpeg\n * applications.  These strings are not needed as part of the JPEG library\n * proper.\n * Edit this file to add new codes, or to translate the message strings to\n * some other language.\n */\n\n/*\n * To define the enum list of message codes, include this file without\n * defining macro JMESSAGE.  To create a message string table, include it\n * again with a suitable JMESSAGE definition (see jerror.c for an example).\n */\n#ifndef JMESSAGE\n#ifndef CDERROR_H\n#define CDERROR_H\n/* First time through, define the enum list */\n#define JMAKE_ENUM_LIST\n#else\n/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */\n#define JMESSAGE(code,string)\n#endif /* CDERROR_H */\n#endif /* JMESSAGE */\n\n#ifdef JMAKE_ENUM_LIST\n\ntypedef enum {\n\n#define JMESSAGE(code,string)\tcode ,\n\n#endif /* JMAKE_ENUM_LIST */\n\nJMESSAGE(JMSG_FIRSTADDONCODE=1000, NULL) /* Must be first entry! */\n\n#ifdef BMP_SUPPORTED\nJMESSAGE(JERR_BMP_BADCMAP, \"Unsupported BMP colormap format\")\nJMESSAGE(JERR_BMP_BADDEPTH, \"Only 8- and 24-bit BMP files are supported\")\nJMESSAGE(JERR_BMP_BADHEADER, \"Invalid BMP file: bad header length\")\nJMESSAGE(JERR_BMP_BADPLANES, \"Invalid BMP file: biPlanes not equal to 1\")\nJMESSAGE(JERR_BMP_COLORSPACE, \"BMP output must be grayscale or RGB\")\nJMESSAGE(JERR_BMP_COMPRESSED, \"Sorry, compressed BMPs not yet supported\")\nJMESSAGE(JERR_BMP_EMPTY, \"Empty BMP image\")\nJMESSAGE(JERR_BMP_NOT, \"Not a BMP file - does not start with BM\")\nJMESSAGE(JTRC_BMP, \"%ux%u 24-bit BMP image\")\nJMESSAGE(JTRC_BMP_MAPPED, \"%ux%u 8-bit colormapped BMP image\")\nJMESSAGE(JTRC_BMP_OS2, \"%ux%u 24-bit OS2 BMP image\")\nJMESSAGE(JTRC_BMP_OS2_MAPPED, \"%ux%u 8-bit colormapped OS2 BMP image\")\n#endif /* BMP_SUPPORTED */\n\n#ifdef GIF_SUPPORTED\nJMESSAGE(JERR_GIF_BUG, \"GIF output got confused\")\nJMESSAGE(JERR_GIF_CODESIZE, \"Bogus GIF codesize %d\")\nJMESSAGE(JERR_GIF_COLORSPACE, \"GIF output must be grayscale or RGB\")\nJMESSAGE(JERR_GIF_IMAGENOTFOUND, \"Too few images in GIF file\")\nJMESSAGE(JERR_GIF_NOT, \"Not a GIF file\")\nJMESSAGE(JTRC_GIF, \"%ux%ux%d GIF image\")\nJMESSAGE(JTRC_GIF_BADVERSION,\n\t \"Warning: unexpected GIF version number '%c%c%c'\")\nJMESSAGE(JTRC_GIF_EXTENSION, \"Ignoring GIF extension block of type 0x%02x\")\nJMESSAGE(JTRC_GIF_NONSQUARE, \"Caution: nonsquare pixels in input\")\nJMESSAGE(JWRN_GIF_BADDATA, \"Corrupt data in GIF file\")\nJMESSAGE(JWRN_GIF_CHAR, \"Bogus char 0x%02x in GIF file, ignoring\")\nJMESSAGE(JWRN_GIF_ENDCODE, \"Premature end of GIF image\")\nJMESSAGE(JWRN_GIF_NOMOREDATA, \"Ran out of GIF bits\")\n#endif /* GIF_SUPPORTED */\n\n#ifdef PPM_SUPPORTED\nJMESSAGE(JERR_PPM_COLORSPACE, \"PPM output must be grayscale or RGB\")\nJMESSAGE(JERR_PPM_NONNUMERIC, \"Nonnumeric data in PPM file\")\nJMESSAGE(JERR_PPM_NOT, \"Not a PPM/PGM file\")\nJMESSAGE(JTRC_PGM, \"%ux%u PGM image\")\nJMESSAGE(JTRC_PGM_TEXT, \"%ux%u text PGM image\")\nJMESSAGE(JTRC_PPM, \"%ux%u PPM image\")\nJMESSAGE(JTRC_PPM_TEXT, \"%ux%u text PPM image\")\n#endif /* PPM_SUPPORTED */\n\n#ifdef RLE_SUPPORTED\nJMESSAGE(JERR_RLE_BADERROR, \"Bogus error code from RLE library\")\nJMESSAGE(JERR_RLE_COLORSPACE, \"RLE output must be grayscale or RGB\")\nJMESSAGE(JERR_RLE_DIMENSIONS, \"Image dimensions (%ux%u) too large for RLE\")\nJMESSAGE(JERR_RLE_EMPTY, \"Empty RLE file\")\nJMESSAGE(JERR_RLE_EOF, \"Premature EOF in RLE header\")\nJMESSAGE(JERR_RLE_MEM, \"Insufficient memory for RLE header\")\nJMESSAGE(JERR_RLE_NOT, \"Not an RLE file\")\nJMESSAGE(JERR_RLE_TOOMANYCHANNELS, \"Cannot handle %d output channels for RLE\")\nJMESSAGE(JERR_RLE_UNSUPPORTED, \"Cannot handle this RLE setup\")\nJMESSAGE(JTRC_RLE, \"%ux%u full-color RLE file\")\nJMESSAGE(JTRC_RLE_FULLMAP, \"%ux%u full-color RLE file with map of length %d\")\nJMESSAGE(JTRC_RLE_GRAY, \"%ux%u grayscale RLE file\")\nJMESSAGE(JTRC_RLE_MAPGRAY, \"%ux%u grayscale RLE file with map of length %d\")\nJMESSAGE(JTRC_RLE_MAPPED, \"%ux%u colormapped RLE file with map of length %d\")\n#endif /* RLE_SUPPORTED */\n\n#ifdef TARGA_SUPPORTED\nJMESSAGE(JERR_TGA_BADCMAP, \"Unsupported Targa colormap format\")\nJMESSAGE(JERR_TGA_BADPARMS, \"Invalid or unsupported Targa file\")\nJMESSAGE(JERR_TGA_COLORSPACE, \"Targa output must be grayscale or RGB\")\nJMESSAGE(JTRC_TGA, \"%ux%u RGB Targa image\")\nJMESSAGE(JTRC_TGA_GRAY, \"%ux%u grayscale Targa image\")\nJMESSAGE(JTRC_TGA_MAPPED, \"%ux%u colormapped Targa image\")\n#else\nJMESSAGE(JERR_TGA_NOTCOMP, \"Targa support was not compiled\")\n#endif /* TARGA_SUPPORTED */\n\nJMESSAGE(JERR_BAD_CMAP_FILE,\n\t \"Color map file is invalid or of unsupported format\")\nJMESSAGE(JERR_TOO_MANY_COLORS,\n\t \"Output file format cannot handle %d colormap entries\")\nJMESSAGE(JERR_UNGETC_FAILED, \"ungetc failed\")\n#ifdef TARGA_SUPPORTED\nJMESSAGE(JERR_UNKNOWN_FORMAT,\n\t \"Unrecognized input file format --- perhaps you need -targa\")\n#else\nJMESSAGE(JERR_UNKNOWN_FORMAT, \"Unrecognized input file format\")\n#endif\nJMESSAGE(JERR_UNSUPPORTED_FORMAT, \"Unsupported output file format\")\n\n#ifdef JMAKE_ENUM_LIST\n\n  JMSG_LASTADDONCODE\n} ADDON_MESSAGE_CODE;\n\n#undef JMAKE_ENUM_LIST\n#endif /* JMAKE_ENUM_LIST */\n\n/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */\n#undef JMESSAGE\n"
  },
  {
    "path": "ext/libjpeg-turbo/cdjpeg.c",
    "content": "/*\n * cdjpeg.c\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains common support routines used by the IJG application\n * programs (cjpeg, djpeg, jpegtran).\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n#include <ctype.h>\t\t/* to declare isupper(), tolower() */\n#ifdef NEED_SIGNAL_CATCHER\n#include <signal.h>\t\t/* to declare signal() */\n#endif\n#ifdef USE_SETMODE\n#include <fcntl.h>\t\t/* to declare setmode()'s parameter macros */\n/* If you have setmode() but not <io.h>, just delete this line: */\n#include <io.h>\t\t\t/* to declare setmode() */\n#endif\n\n\n/*\n * Signal catcher to ensure that temporary files are removed before aborting.\n * NB: for Amiga Manx C this is actually a global routine named _abort();\n * we put \"#define signal_catcher _abort\" in jconfig.h.  Talk about bogus...\n */\n\n#ifdef NEED_SIGNAL_CATCHER\n\nstatic j_common_ptr sig_cinfo;\n\nvoid\t\t\t\t/* must be global for Manx C */\nsignal_catcher (int signum)\n{\n  if (sig_cinfo != NULL) {\n    if (sig_cinfo->err != NULL) /* turn off trace output */\n      sig_cinfo->err->trace_level = 0;\n    jpeg_destroy(sig_cinfo);\t/* clean up memory allocation & temp files */\n  }\n  exit(EXIT_FAILURE);\n}\n\n\nGLOBAL(void)\nenable_signal_catcher (j_common_ptr cinfo)\n{\n  sig_cinfo = cinfo;\n#ifdef SIGINT\t\t\t/* not all systems have SIGINT */\n  signal(SIGINT, signal_catcher);\n#endif\n#ifdef SIGTERM\t\t\t/* not all systems have SIGTERM */\n  signal(SIGTERM, signal_catcher);\n#endif\n}\n\n#endif\n\n\n/*\n * Optional progress monitor: display a percent-done figure on stderr.\n */\n\n#ifdef PROGRESS_REPORT\n\nMETHODDEF(void)\nprogress_monitor (j_common_ptr cinfo)\n{\n  cd_progress_ptr prog = (cd_progress_ptr) cinfo->progress;\n  int total_passes = prog->pub.total_passes + prog->total_extra_passes;\n  int percent_done = (int) (prog->pub.pass_counter*100L/prog->pub.pass_limit);\n\n  if (percent_done != prog->percent_done) {\n    prog->percent_done = percent_done;\n    if (total_passes > 1) {\n      fprintf(stderr, \"\\rPass %d/%d: %3d%% \",\n\t      prog->pub.completed_passes + prog->completed_extra_passes + 1,\n\t      total_passes, percent_done);\n    } else {\n      fprintf(stderr, \"\\r %3d%% \", percent_done);\n    }\n    fflush(stderr);\n  }\n}\n\n\nGLOBAL(void)\nstart_progress_monitor (j_common_ptr cinfo, cd_progress_ptr progress)\n{\n  /* Enable progress display, unless trace output is on */\n  if (cinfo->err->trace_level == 0) {\n    progress->pub.progress_monitor = progress_monitor;\n    progress->completed_extra_passes = 0;\n    progress->total_extra_passes = 0;\n    progress->percent_done = -1;\n    cinfo->progress = &progress->pub;\n  }\n}\n\n\nGLOBAL(void)\nend_progress_monitor (j_common_ptr cinfo)\n{\n  /* Clear away progress display */\n  if (cinfo->err->trace_level == 0) {\n    fprintf(stderr, \"\\r                \\r\");\n    fflush(stderr);\n  }\n}\n\n#endif\n\n\n/*\n * Case-insensitive matching of possibly-abbreviated keyword switches.\n * keyword is the constant keyword (must be lower case already),\n * minchars is length of minimum legal abbreviation.\n */\n\nGLOBAL(boolean)\nkeymatch (char * arg, const char * keyword, int minchars)\n{\n  register int ca, ck;\n  register int nmatched = 0;\n\n  while ((ca = *arg++) != '\\0') {\n    if ((ck = *keyword++) == '\\0')\n      return FALSE;\t\t/* arg longer than keyword, no good */\n    if (isupper(ca))\t\t/* force arg to lcase (assume ck is already) */\n      ca = tolower(ca);\n    if (ca != ck)\n      return FALSE;\t\t/* no good */\n    nmatched++;\t\t\t/* count matched characters */\n  }\n  /* reached end of argument; fail if it's too short for unique abbrev */\n  if (nmatched < minchars)\n    return FALSE;\n  return TRUE;\t\t\t/* A-OK */\n}\n\n\n/*\n * Routines to establish binary I/O mode for stdin and stdout.\n * Non-Unix systems often require some hacking to get out of text mode.\n */\n\nGLOBAL(FILE *)\nread_stdin (void)\n{\n  FILE * input_file = stdin;\n\n#ifdef USE_SETMODE\t\t/* need to hack file mode? */\n  setmode(fileno(stdin), O_BINARY);\n#endif\n#ifdef USE_FDOPEN\t\t/* need to re-open in binary mode? */\n  if ((input_file = fdopen(fileno(stdin), READ_BINARY)) == NULL) {\n    fprintf(stderr, \"Cannot reopen stdin\\n\");\n    exit(EXIT_FAILURE);\n  }\n#endif\n  return input_file;\n}\n\n\nGLOBAL(FILE *)\nwrite_stdout (void)\n{\n  FILE * output_file = stdout;\n\n#ifdef USE_SETMODE\t\t/* need to hack file mode? */\n  setmode(fileno(stdout), O_BINARY);\n#endif\n#ifdef USE_FDOPEN\t\t/* need to re-open in binary mode? */\n  if ((output_file = fdopen(fileno(stdout), WRITE_BINARY)) == NULL) {\n    fprintf(stderr, \"Cannot reopen stdout\\n\");\n    exit(EXIT_FAILURE);\n  }\n#endif\n  return output_file;\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/cdjpeg.h",
    "content": "/*\n * cdjpeg.h\n *\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains common declarations for the sample applications\n * cjpeg and djpeg.  It is NOT used by the core JPEG library.\n */\n\n#define JPEG_CJPEG_DJPEG\t/* define proper options in jconfig.h */\n#define JPEG_INTERNAL_OPTIONS\t/* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jerror.h\"\t\t/* get library error codes too */\n#include \"cderror.h\"\t\t/* get application-specific error codes */\n\n\n/*\n * Object interface for cjpeg's source file decoding modules\n */\n\ntypedef struct cjpeg_source_struct * cjpeg_source_ptr;\n\nstruct cjpeg_source_struct {\n  JMETHOD(void, start_input, (j_compress_ptr cinfo,\n\t\t\t      cjpeg_source_ptr sinfo));\n  JMETHOD(JDIMENSION, get_pixel_rows, (j_compress_ptr cinfo,\n\t\t\t\t       cjpeg_source_ptr sinfo));\n  JMETHOD(void, finish_input, (j_compress_ptr cinfo,\n\t\t\t       cjpeg_source_ptr sinfo));\n\n  FILE *input_file;\n\n  JSAMPARRAY buffer;\n  JDIMENSION buffer_height;\n};\n\n\n/*\n * Object interface for djpeg's output file encoding modules\n */\n\ntypedef struct djpeg_dest_struct * djpeg_dest_ptr;\n\nstruct djpeg_dest_struct {\n  /* start_output is called after jpeg_start_decompress finishes.\n   * The color map will be ready at this time, if one is needed.\n   */\n  JMETHOD(void, start_output, (j_decompress_ptr cinfo,\n\t\t\t       djpeg_dest_ptr dinfo));\n  /* Emit the specified number of pixel rows from the buffer. */\n  JMETHOD(void, put_pixel_rows, (j_decompress_ptr cinfo,\n\t\t\t\t djpeg_dest_ptr dinfo,\n\t\t\t\t JDIMENSION rows_supplied));\n  /* Finish up at the end of the image. */\n  JMETHOD(void, finish_output, (j_decompress_ptr cinfo,\n\t\t\t\tdjpeg_dest_ptr dinfo));\n\n  /* Target file spec; filled in by djpeg.c after object is created. */\n  FILE * output_file;\n\n  /* Output pixel-row buffer.  Created by module init or start_output.\n   * Width is cinfo->output_width * cinfo->output_components;\n   * height is buffer_height.\n   */\n  JSAMPARRAY buffer;\n  JDIMENSION buffer_height;\n};\n\n\n/*\n * cjpeg/djpeg may need to perform extra passes to convert to or from\n * the source/destination file format.  The JPEG library does not know\n * about these passes, but we'd like them to be counted by the progress\n * monitor.  We use an expanded progress monitor object to hold the\n * additional pass count.\n */\n\nstruct cdjpeg_progress_mgr {\n  struct jpeg_progress_mgr pub;\t/* fields known to JPEG library */\n  int completed_extra_passes;\t/* extra passes completed */\n  int total_extra_passes;\t/* total extra */\n  /* last printed percentage stored here to avoid multiple printouts */\n  int percent_done;\n};\n\ntypedef struct cdjpeg_progress_mgr * cd_progress_ptr;\n\n\n/* Short forms of external names for systems with brain-damaged linkers. */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jinit_read_bmp\t\tjIRdBMP\n#define jinit_write_bmp\t\tjIWrBMP\n#define jinit_read_gif\t\tjIRdGIF\n#define jinit_write_gif\t\tjIWrGIF\n#define jinit_read_ppm\t\tjIRdPPM\n#define jinit_write_ppm\t\tjIWrPPM\n#define jinit_read_rle\t\tjIRdRLE\n#define jinit_write_rle\t\tjIWrRLE\n#define jinit_read_targa\tjIRdTarga\n#define jinit_write_targa\tjIWrTarga\n#define read_quant_tables\tRdQTables\n#define read_scan_script\tRdScnScript\n#define set_quality_ratings     SetQRates\n#define set_quant_slots\t\tSetQSlots\n#define set_sample_factors\tSetSFacts\n#define read_color_map\t\tRdCMap\n#define enable_signal_catcher\tEnSigCatcher\n#define start_progress_monitor\tStProgMon\n#define end_progress_monitor\tEnProgMon\n#define read_stdin\t\tRdStdin\n#define write_stdout\t\tWrStdout\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\n/* Module selection routines for I/O modules. */\n\nEXTERN(cjpeg_source_ptr) jinit_read_bmp JPP((j_compress_ptr cinfo));\nEXTERN(djpeg_dest_ptr) jinit_write_bmp JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t    boolean is_os2));\nEXTERN(cjpeg_source_ptr) jinit_read_gif JPP((j_compress_ptr cinfo));\nEXTERN(djpeg_dest_ptr) jinit_write_gif JPP((j_decompress_ptr cinfo));\nEXTERN(cjpeg_source_ptr) jinit_read_ppm JPP((j_compress_ptr cinfo));\nEXTERN(djpeg_dest_ptr) jinit_write_ppm JPP((j_decompress_ptr cinfo));\nEXTERN(cjpeg_source_ptr) jinit_read_rle JPP((j_compress_ptr cinfo));\nEXTERN(djpeg_dest_ptr) jinit_write_rle JPP((j_decompress_ptr cinfo));\nEXTERN(cjpeg_source_ptr) jinit_read_targa JPP((j_compress_ptr cinfo));\nEXTERN(djpeg_dest_ptr) jinit_write_targa JPP((j_decompress_ptr cinfo));\n\n/* cjpeg support routines (in rdswitch.c) */\n\nEXTERN(boolean) read_quant_tables JPP((j_compress_ptr cinfo, char * filename,\n\t\t\t\t       boolean force_baseline));\nEXTERN(boolean) read_scan_script JPP((j_compress_ptr cinfo, char * filename));\nEXTERN(boolean) set_quality_ratings JPP((j_compress_ptr cinfo, char *arg,\n\t\t\t\t\t boolean force_baseline));\nEXTERN(boolean) set_quant_slots JPP((j_compress_ptr cinfo, char *arg));\nEXTERN(boolean) set_sample_factors JPP((j_compress_ptr cinfo, char *arg));\n\n/* djpeg support routines (in rdcolmap.c) */\n\nEXTERN(void) read_color_map JPP((j_decompress_ptr cinfo, FILE * infile));\n\n/* common support routines (in cdjpeg.c) */\n\nEXTERN(void) enable_signal_catcher JPP((j_common_ptr cinfo));\nEXTERN(void) start_progress_monitor JPP((j_common_ptr cinfo,\n\t\t\t\t\t cd_progress_ptr progress));\nEXTERN(void) end_progress_monitor JPP((j_common_ptr cinfo));\nEXTERN(boolean) keymatch JPP((char * arg, const char * keyword, int minchars));\nEXTERN(FILE *) read_stdin JPP((void));\nEXTERN(FILE *) write_stdout JPP((void));\n\n/* miscellaneous useful macros */\n\n#ifdef DONT_USE_B_MODE\t\t/* define mode parameters for fopen() */\n#define READ_BINARY\t\"r\"\n#define WRITE_BINARY\t\"w\"\n#else\n#ifdef VMS\t\t\t/* VMS is very nonstandard */\n#define READ_BINARY\t\"rb\", \"ctx=stm\"\n#define WRITE_BINARY\t\"wb\", \"ctx=stm\"\n#else\t\t\t\t/* standard ANSI-compliant case */\n#define READ_BINARY\t\"rb\"\n#define WRITE_BINARY\t\"wb\"\n#endif\n#endif\n\n#ifndef EXIT_FAILURE\t\t/* define exit() codes if not provided */\n#define EXIT_FAILURE  1\n#endif\n#ifndef EXIT_SUCCESS\n#ifdef VMS\n#define EXIT_SUCCESS  1\t\t/* VMS is very nonstandard */\n#else\n#define EXIT_SUCCESS  0\n#endif\n#endif\n#ifndef EXIT_WARNING\n#ifdef VMS\n#define EXIT_WARNING  1\t\t/* VMS is very nonstandard */\n#else\n#define EXIT_WARNING  2\n#endif\n#endif\n"
  },
  {
    "path": "ext/libjpeg-turbo/change.log",
    "content": "NOTE:  This file was modified by The libjpeg-turbo Project to include only\ninformation relevant to libjpeg-turbo.\n\nCHANGE LOG for Independent JPEG Group's JPEG software\n\n\nVersion 8d  15-Jan-2012\n-----------------------\n\nAdd cjpeg -rgb option to create RGB JPEG files.\nUsing this switch suppresses the conversion from RGB\ncolorspace input to the default YCbCr JPEG colorspace.\nThank to Michael Koch for the initial suggestion.\n\nAdd option to disable the region adjustment in the transupp crop code.\nThank to Jeffrey Friedl for the suggestion.\n\n\nVersion 8b  16-May-2010\n-----------------------\n\nRepair problem in new memory source manager with corrupt JPEG data.\nThank to Ted Campbell and Samuel Chun for the report.\n\n\nVersion 8a  28-Feb-2010\n-----------------------\n\nWriting tables-only datastreams via jpeg_write_tables works again.\n\nSupport 32-bit BMPs (RGB image with Alpha channel) for read in cjpeg.\nThank to Brett Blackham for the suggestion.\n\n\nVersion 8  10-Jan-2010\n----------------------\n\nAdd sanity check in BMP reader module to avoid cjpeg crash for empty input\nimage (thank to Isaev Ildar of ISP RAS, Moscow, RU for reporting this error).\n\nAdd data source and destination managers for read from and write to\nmemory buffers.  New API functions jpeg_mem_src and jpeg_mem_dest.\nThank to Roberto Boni from Italy for the suggestion.\n\n\nVersion 7  27-Jun-2009\n----------------------\n\nNew scaled DCTs implemented.\ndjpeg now supports scalings N/8 with all N from 1 to 16.\n\ncjpeg -quality option has been extended for support of separate quality\nsettings for luminance and chrominance (or in general, for every provided\nquantization table slot).\nNew API function jpeg_default_qtables() and q_scale_factor array in library.\n\nSupport arithmetic entropy encoding and decoding.\nAdded files jaricom.c, jcarith.c, jdarith.c.\n\njpegtran has a new \"lossless\" cropping feature.\n\nImplement -perfect option in jpegtran, new API function\njtransform_perfect_transform() in transupp. (DP 204_perfect.dpatch)\n\nBetter error messages for jpegtran fopen failure.\n(DP 203_jpegtran_errmsg.dpatch)\n\nFix byte order issue with 16bit PPM/PGM files in rdppm.c/wrppm.c:\naccording to Netpbm, the de facto standard implementation of the PNM formats,\nthe most significant byte is first. (DP 203_rdppm.dpatch)\n\nAdd -raw option to rdjpgcom not to mangle the output.\n(DP 205_rdjpgcom_raw.dpatch)\n\nMake rdjpgcom locale aware. (DP 201_rdjpgcom_locale.dpatch)\n\nAdd extern \"C\" to jpeglib.h.\nThis avoids the need to put extern \"C\" { ... } around #include \"jpeglib.h\"\nin your C++ application.  Defining the symbol DONT_USE_EXTERN_C in the\nconfiguration prevents this. (DP 202_jpeglib.h_c++.dpatch)\n\n\nVersion 6b  27-Mar-1998\n-----------------------\n\njpegtran has new features for lossless image transformations (rotation\nand flipping) as well as \"lossless\" reduction to grayscale.\n\njpegtran now copies comments by default; it has a -copy switch to enable\ncopying all APPn blocks as well, or to suppress comments.  (Formerly it\nalways suppressed comments and APPn blocks.)  jpegtran now also preserves\nJFIF version and resolution information.\n\nNew decompressor library feature: COM and APPn markers found in the input\nfile can be saved in memory for later use by the application.  (Before,\nyou had to code this up yourself with a custom marker processor.)\n\nThere is an unused field \"void * client_data\" now in compress and decompress\nparameter structs; this may be useful in some applications.\n\nJFIF version number information is now saved by the decoder and accepted by\nthe encoder.  jpegtran uses this to copy the source file's version number,\nto ensure \"jpegtran -copy all\" won't create bogus files that contain JFXX\nextensions but claim to be version 1.01.  Applications that generate their\nown JFXX extension markers also (finally) have a supported way to cause the\nencoder to emit JFIF version number 1.02.\n\ndjpeg's trace mode reports JFIF 1.02 thumbnail images as such, rather\nthan as unknown APP0 markers.\n\nIn -verbose mode, djpeg and rdjpgcom will try to print the contents of\nAPP12 markers as text.  Some digital cameras store useful text information\nin APP12 markers.\n\nHandling of truncated data streams is more robust: blocks beyond the one in\nwhich the error occurs will be output as uniform gray, or left unchanged\nif decoding a progressive JPEG.  The appearance no longer depends on the\nHuffman tables being used.\n\nHuffman tables are checked for validity much more carefully than before.\n\nTo avoid the Unisys LZW patent, djpeg's GIF output capability has been\nchanged to produce \"uncompressed GIFs\", and cjpeg's GIF input capability\nhas been removed altogether.  We're not happy about it either, but there\nseems to be no good alternative.\n\nThe configure script now supports building libjpeg as a shared library\non many flavors of Unix (all the ones that GNU libtool knows how to\nbuild shared libraries for).  Use \"./configure --enable-shared\" to\ntry this out.\n\nNew jconfig file and makefiles for Microsoft Visual C++ and Developer Studio.\nAlso, a jconfig file and a build script for Metrowerks CodeWarrior\non Apple Macintosh.  makefile.dj has been updated for DJGPP v2, and there\nare miscellaneous other minor improvements in the makefiles.\n\njmemmac.c now knows how to create temporary files following Mac System 7\nconventions.\n\ndjpeg's -map switch is now able to read raw-format PPM files reliably.\n\ncjpeg -progressive -restart no longer generates any unnecessary DRI markers.\n\nMultiple calls to jpeg_simple_progression for a single JPEG object\nno longer leak memory.\n\n\nVersion 6a  7-Feb-96\n--------------------\n\nLibrary initialization sequence modified to detect version mismatches\nand struct field packing mismatches between library and calling application.\nThis change requires applications to be recompiled, but does not require\nany application source code change.\n\nAll routine declarations changed to the style \"GLOBAL(type) name ...\",\nthat is, GLOBAL, LOCAL, METHODDEF, EXTERN are now macros taking the\nroutine's return type as an argument.  This makes it possible to add\nMicrosoft-style linkage keywords to all the routines by changing just\nthese macros.  Note that any application code that was using these macros\nwill have to be changed.\n\nDCT coefficient quantization tables are now stored in normal array order\nrather than zigzag order.  Application code that calls jpeg_add_quant_table,\nor otherwise manipulates quantization tables directly, will need to be\nchanged.  If you need to make such code work with either older or newer\nversions of the library, a test like \"#if JPEG_LIB_VERSION >= 61\" is\nrecommended.\n\ndjpeg's trace capability now dumps DQT tables in natural order, not zigzag\norder.  This allows the trace output to be made into a \"-qtables\" file\nmore easily.\n\nNew system-dependent memory manager module for use on Apple Macintosh.\n\nFix bug in cjpeg's -smooth option: last one or two scanlines would be\nduplicates of the prior line unless the image height mod 16 was 1 or 2.\n\nRepair minor problems in VMS, BCC, MC6 makefiles.\n\nNew configure script based on latest GNU Autoconf.\n\nCorrect the list of include files needed by MetroWerks C for ccommand().\n\nNumerous small documentation updates.\n\n\nVersion 6  2-Aug-95\n-------------------\n\nProgressive JPEG support: library can read and write full progressive JPEG\nfiles.  A \"buffered image\" mode supports incremental decoding for on-the-fly\ndisplay of progressive images.  Simply recompiling an existing IJG-v5-based\ndecoder with v6 should allow it to read progressive files, though of course\nwithout any special progressive display.\n\nNew \"jpegtran\" application performs lossless transcoding between different\nJPEG formats; primarily, it can be used to convert baseline to progressive\nJPEG and vice versa.  In support of jpegtran, the library now allows lossless\nreading and writing of JPEG files as DCT coefficient arrays.  This ability\nmay be of use in other applications.\n\nNotes for programmers:\n* We changed jpeg_start_decompress() to be able to suspend; this makes all\ndecoding modes available to suspending-input applications.  However,\nexisting applications that use suspending input will need to be changed\nto check the return value from jpeg_start_decompress().  You don't need to\ndo anything if you don't use a suspending data source.\n* We changed the interface to the virtual array routines: access_virt_array\nroutines now take a count of the number of rows to access this time.  The\nlast parameter to request_virt_array routines is now interpreted as the\nmaximum number of rows that may be accessed at once, but not necessarily\nthe height of every access.\n\n\nVersion 5b  15-Mar-95\n---------------------\n\nCorrect bugs with grayscale images having v_samp_factor > 1.\n\njpeg_write_raw_data() now supports output suspension.\n\nCorrect bugs in \"configure\" script for case of compiling in\na directory other than the one containing the source files.\n\nRepair bug in jquant1.c: sometimes didn't use as many colors as it could.\n\nBorland C makefile and jconfig file work under either MS-DOS or OS/2.\n\nMiscellaneous improvements to documentation.\n\n\nVersion 5a  7-Dec-94\n--------------------\n\nChanged color conversion roundoff behavior so that grayscale values are\nrepresented exactly.  (This causes test image files to change.)\n\nMake ordered dither use 16x16 instead of 4x4 pattern for a small quality\nimprovement.\n\nNew configure script based on latest GNU Autoconf.\nFix configure script to handle CFLAGS correctly.\nRename *.auto files to *.cfg, so that configure script still works if\nfile names have been truncated for DOS.\n\nFix bug in rdbmp.c: didn't allow for extra data between header and image.\n\nModify rdppm.c/wrppm.c to handle 2-byte raw PPM/PGM formats for 12-bit data.\n\nFix several bugs in rdrle.c.\n\nNEED_SHORT_EXTERNAL_NAMES option was broken.\n\nRevise jerror.h/jerror.c for more flexibility in message table.\n\nRepair oversight in jmemname.c NO_MKTEMP case: file could be there\nbut unreadable.\n\n\nVersion 5  24-Sep-94\n--------------------\n\nVersion 5 represents a nearly complete redesign and rewrite of the IJG\nsoftware.  Major user-visible changes include:\n  * Automatic configuration simplifies installation for most Unix systems.\n  * A range of speed vs. image quality tradeoffs are supported.\n    This includes resizing of an image during decompression: scaling down\n    by a factor of 1/2, 1/4, or 1/8 is handled very efficiently.\n  * New programs rdjpgcom and wrjpgcom allow insertion and extraction\n    of text comments in a JPEG file.\n\nThe application programmer's interface to the library has changed completely.\nNotable improvements include:\n  * We have eliminated the use of callback routines for handling the\n    uncompressed image data.  The application now sees the library as a\n    set of routines that it calls to read or write image data on a\n    scanline-by-scanline basis.\n  * The application image data is represented in a conventional interleaved-\n    pixel format, rather than as a separate array for each color channel.\n    This can save a copying step in many programs.\n  * The handling of compressed data has been cleaned up: the application can\n    supply routines to source or sink the compressed data.  It is possible to\n    suspend processing on source/sink buffer overrun, although this is not\n    supported in all operating modes.\n  * All static state has been eliminated from the library, so that multiple\n    instances of compression or decompression can be active concurrently.\n  * JPEG abbreviated datastream formats are supported, ie, quantization and\n    Huffman tables can be stored separately from the image data.\n  * And not only that, but the documentation of the library has improved\n    considerably!\n\n\nThe last widely used release before the version 5 rewrite was version 4A of\n18-Feb-93.  Change logs before that point have been discarded, since they\nare not of much interest after the rewrite.\n"
  },
  {
    "path": "ext/libjpeg-turbo/cjpeg.1",
    "content": ".TH CJPEG 1 \"18 January 2013\"\n.SH NAME\ncjpeg \\- compress an image file to a JPEG file\n.SH SYNOPSIS\n.B cjpeg\n[\n.I options\n]\n[\n.I filename\n]\n.LP\n.SH DESCRIPTION\n.LP\n.B cjpeg\ncompresses the named image file, or the standard input if no file is\nnamed, and produces a JPEG/JFIF file on the standard output.\nThe currently supported input file formats are: PPM (PBMPLUS color\nformat), PGM (PBMPLUS gray-scale format), BMP, Targa, and RLE (Utah Raster\nToolkit format).  (RLE is supported only if the URT library is available.)\n.SH OPTIONS\nAll switch names may be abbreviated; for example,\n.B \\-grayscale\nmay be written\n.B \\-gray\nor\n.BR \\-gr .\nMost of the \"basic\" switches can be abbreviated to as little as one letter.\nUpper and lower case are equivalent (thus\n.B \\-BMP\nis the same as\n.BR \\-bmp ).\nBritish spellings are also accepted (e.g.,\n.BR \\-greyscale ),\nthough for brevity these are not mentioned below.\n.PP\nThe basic switches are:\n.TP\n.BI \\-quality \" N[,...]\"\nScale quantization tables to adjust image quality.  Quality is 0 (worst) to\n100 (best); default is 75.  (See below for more info.)\n.TP\n.B \\-grayscale\nCreate monochrome JPEG file from color input.  Be sure to use this switch when\ncompressing a grayscale BMP file, because\n.B cjpeg\nisn't bright enough to notice whether a BMP file uses only shades of gray.\nBy saying\n.BR \\-grayscale ,\nyou'll get a smaller JPEG file that takes less time to process.\n.TP\n.B \\-rgb\nCreate RGB JPEG file.\nUsing this switch suppresses the conversion from RGB\ncolorspace input to the default YCbCr JPEG colorspace.\n.TP\n.B \\-optimize\nPerform optimization of entropy encoding parameters.  Without this, default\nencoding parameters are used.\n.B \\-optimize\nusually makes the JPEG file a little smaller, but\n.B cjpeg\nruns somewhat slower and needs much more memory.  Image quality and speed of\ndecompression are unaffected by\n.BR \\-optimize .\n.TP\n.B \\-progressive\nCreate progressive JPEG file (see below).\n.TP\n.B \\-targa\nInput file is Targa format.  Targa files that contain an \"identification\"\nfield will not be automatically recognized by\n.BR cjpeg ;\nfor such files you must specify\n.B \\-targa\nto make\n.B cjpeg\ntreat the input as Targa format.\nFor most Targa files, you won't need this switch.\n.PP\nThe\n.B \\-quality\nswitch lets you trade off compressed file size against quality of the\nreconstructed image: the higher the quality setting, the larger the JPEG file,\nand the closer the output image will be to the original input.  Normally you\nwant to use the lowest quality setting (smallest file) that decompresses into\nsomething visually indistinguishable from the original image.  For this\npurpose the quality setting should be between 50 and 95; the default of 75 is\noften about right.  If you see defects at\n.B \\-quality\n75, then go up 5 or 10 counts at a time until you are happy with the output\nimage.  (The optimal setting will vary from one image to another.)\n.PP\n.B \\-quality\n100 will generate a quantization table of all 1's, minimizing loss in the\nquantization step (but there is still information loss in subsampling, as well\nas roundoff error).  This setting is mainly of interest for experimental\npurposes.  Quality values above about 95 are\n.B not\nrecommended for normal use; the compressed file size goes up dramatically for\nhardly any gain in output image quality.\n.PP\nIn the other direction, quality values below 50 will produce very small files\nof low image quality.  Settings around 5 to 10 might be useful in preparing an\nindex of a large image library, for example.  Try\n.B \\-quality\n2 (or so) for some amusing Cubist effects.  (Note: quality\nvalues below about 25 generate 2-byte quantization tables, which are\nconsidered optional in the JPEG standard.\n.B cjpeg\nemits a warning message when you give such a quality value, because some\nother JPEG programs may be unable to decode the resulting file.  Use\n.B \\-baseline\nif you need to ensure compatibility at low quality values.)\n.PP\nThe \\fB-quality\\fR option has been extended in this version of \\fBcjpeg\\fR to\nsupport separate quality settings for luminance and chrominance (or, in\ngeneral, separate settings for every quantization table slot.)  The principle\nis the same as chrominance subsampling:  since the human eye is more sensitive\nto spatial changes in brightness than spatial changes in color, the chrominance\ncomponents can be quantized more than the luminance components without\nincurring any visible image quality loss.  However, unlike subsampling, this\nfeature reduces data in the frequency domain instead of the spatial domain,\nwhich allows for more fine-grained control.  This option is useful in\nquality-sensitive applications, for which the artifacts generated by\nsubsampling may be unacceptable.\n.PP\nThe \\fB-quality\\fR option accepts a comma-separated list of parameters, which\nrespectively refer to the quality levels that should be assigned to the\nquantization table slots.  If there are more q-table slots than parameters,\nthen the last parameter is replicated.  Thus, if only one quality parameter is\ngiven, this is used for both luminance and chrominance (slots 0 and 1,\nrespectively), preserving the legacy behavior of cjpeg v6b and prior.\nMore (or customized) quantization tables can be set with the \\fB-qtables\\fR\noption and assigned to components with the \\fB-qslots\\fR option (see the\n\"wizard\" switches below.)\n.PP\nJPEG files generated with separate luminance and chrominance quality are fully\ncompliant with standard JPEG decoders.\n.PP\n.BR CAUTION:\nFor this setting to be useful, be sure to pass an argument of \\fB-sample 1x1\\fR\nto \\fBcjpeg\\fR to disable chrominance subsampling.  Otherwise, the default\nsubsampling level (2x2, AKA \"4:2:0\") will be used.\n.PP\nThe\n.B \\-progressive\nswitch creates a \"progressive JPEG\" file.  In this type of JPEG file, the data\nis stored in multiple scans of increasing quality.  If the file is being\ntransmitted over a slow communications link, the decoder can use the first\nscan to display a low-quality image very quickly, and can then improve the\ndisplay with each subsequent scan.  The final image is exactly equivalent to a\nstandard JPEG file of the same quality setting, and the total file size is\nabout the same --- often a little smaller.\n.PP\nSwitches for advanced users:\n.TP\n.B \\-arithmetic\nUse arithmetic coding.\n.B Caution:\narithmetic coded JPEG is not yet widely implemented, so many decoders will be\nunable to view an arithmetic coded JPEG file at all.\n.TP\n.B \\-dct int\nUse integer DCT method (default).\n.TP\n.B \\-dct fast\nUse fast integer DCT (less accurate).\n.TP\n.B \\-dct float\nUse floating-point DCT method.\nThe float method is very slightly more accurate than the int method, but is\nmuch slower unless your machine has very fast floating-point hardware.  Also\nnote that results of the floating-point method may vary slightly across\nmachines, while the integer methods should give the same results everywhere.\nThe fast integer method is much less accurate than the other two.\n.TP\n.BI \\-restart \" N\"\nEmit a JPEG restart marker every N MCU rows, or every N MCU blocks if \"B\" is\nattached to the number.\n.B \\-restart 0\n(the default) means no restart markers.\n.TP\n.BI \\-smooth \" N\"\nSmooth the input image to eliminate dithering noise.  N, ranging from 1 to\n100, indicates the strength of smoothing.  0 (the default) means no smoothing.\n.TP\n.BI \\-maxmemory \" N\"\nSet limit for amount of memory to use in processing large images.  Value is\nin thousands of bytes, or millions of bytes if \"M\" is attached to the\nnumber.  For example,\n.B \\-max 4m\nselects 4000000 bytes.  If more space is needed, temporary files will be used.\n.TP\n.BI \\-outfile \" name\"\nSend output image to the named file, not to standard output.\n.TP\n.BI \\-memdst\nCompress to memory instead of a file.  This feature was implemented mainly as a\nway of testing the in-memory destination manager (jpeg_mem_dest()), but it is\nalso useful for benchmarking, since it reduces the I/O overhead.\n.TP\n.B \\-verbose\nEnable debug printout.  More\n.BR \\-v 's\ngive more output.  Also, version information is printed at startup.\n.TP\n.B \\-debug\nSame as\n.BR \\-verbose .\n.PP\nThe\n.B \\-restart\noption inserts extra markers that allow a JPEG decoder to resynchronize after\na transmission error.  Without restart markers, any damage to a compressed\nfile will usually ruin the image from the point of the error to the end of the\nimage; with restart markers, the damage is usually confined to the portion of\nthe image up to the next restart marker.  Of course, the restart markers\noccupy extra space.  We recommend\n.B \\-restart 1\nfor images that will be transmitted across unreliable networks such as Usenet.\n.PP\nThe\n.B \\-smooth\noption filters the input to eliminate fine-scale noise.  This is often useful\nwhen converting dithered images to JPEG: a moderate smoothing factor of 10 to\n50 gets rid of dithering patterns in the input file, resulting in a smaller\nJPEG file and a better-looking image.  Too large a smoothing factor will\nvisibly blur the image, however.\n.PP\nSwitches for wizards:\n.TP\n.B \\-baseline\nForce baseline-compatible quantization tables to be generated.  This clamps\nquantization values to 8 bits even at low quality settings.  (This switch is\npoorly named, since it does not ensure that the output is actually baseline\nJPEG.  For example, you can use\n.B \\-baseline\nand\n.B \\-progressive\ntogether.)\n.TP\n.BI \\-qtables \" file\"\nUse the quantization tables given in the specified text file.\n.TP\n.BI \\-qslots \" N[,...]\"\nSelect which quantization table to use for each color component.\n.TP\n.BI \\-sample \" HxV[,...]\"\nSet JPEG sampling factors for each color component.\n.TP\n.BI \\-scans \" file\"\nUse the scan script given in the specified text file.\n.PP\nThe \"wizard\" switches are intended for experimentation with JPEG.  If you\ndon't know what you are doing, \\fBdon't use them\\fR.  These switches are\ndocumented further in the file wizard.txt.\n.SH EXAMPLES\n.LP\nThis example compresses the PPM file foo.ppm with a quality factor of\n60 and saves the output as foo.jpg:\n.IP\n.B cjpeg \\-quality\n.I 60 foo.ppm\n.B >\n.I foo.jpg\n.SH HINTS\nColor GIF files are not the ideal input for JPEG; JPEG is really intended for\ncompressing full-color (24-bit) images.  In particular, don't try to convert\ncartoons, line drawings, and other images that have only a few distinct\ncolors.  GIF works great on these, JPEG does not.  If you want to convert a\nGIF to JPEG, you should experiment with\n.BR cjpeg 's\n.B \\-quality\nand\n.B \\-smooth\noptions to get a satisfactory conversion.\n.B \\-smooth 10\nor so is often helpful.\n.PP\nAvoid running an image through a series of JPEG compression/decompression\ncycles.  Image quality loss will accumulate; after ten or so cycles the image\nmay be noticeably worse than it was after one cycle.  It's best to use a\nlossless format while manipulating an image, then convert to JPEG format when\nyou are ready to file the image away.\n.PP\nThe\n.B \\-optimize\noption to\n.B cjpeg\nis worth using when you are making a \"final\" version for posting or archiving.\nIt's also a win when you are using low quality settings to make very small\nJPEG files; the percentage improvement is often a lot more than it is on\nlarger files.  (At present,\n.B \\-optimize\nmode is always selected when generating progressive JPEG files.)\n.SH ENVIRONMENT\n.TP\n.B JPEGMEM\nIf this environment variable is set, its value is the default memory limit.\nThe value is specified as described for the\n.B \\-maxmemory\nswitch.\n.B JPEGMEM\noverrides the default value specified when the program was compiled, and\nitself is overridden by an explicit\n.BR \\-maxmemory .\n.SH SEE ALSO\n.BR djpeg (1),\n.BR jpegtran (1),\n.BR rdjpgcom (1),\n.BR wrjpgcom (1)\n.br\n.BR ppm (5),\n.BR pgm (5)\n.br\nWallace, Gregory K.  \"The JPEG Still Picture Compression Standard\",\nCommunications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.\n.SH AUTHOR\nIndependent JPEG Group\n.PP\nThis file was modified by The libjpeg-turbo Project to include only information\nrelevant to libjpeg-turbo, to wordsmith certain sections, and to describe\nfeatures not present in libjpeg.\n.SH BUGS\nSupport for GIF input files was removed in cjpeg v6b due to concerns over\nthe Unisys LZW patent.  Although this patent expired in 2006, cjpeg still\nlacks GIF support, for these historical reasons.  (Conversion of GIF files to\nJPEG is usually a bad idea anyway.)\n.PP\nNot all variants of BMP and Targa file formats are supported.\n.PP\nThe\n.B \\-targa\nswitch is not a bug, it's a feature.  (It would be a bug if the Targa format\ndesigners had not been clueless.)\n"
  },
  {
    "path": "ext/libjpeg-turbo/cjpeg.c",
    "content": "/*\n * cjpeg.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * Modified 2003-2011 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010, 2013, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains a command-line user interface for the JPEG compressor.\n * It should work on any system with Unix- or MS-DOS-style command lines.\n *\n * Two different command line styles are permitted, depending on the\n * compile-time switch TWO_FILE_COMMANDLINE:\n *\tcjpeg [options]  inputfile outputfile\n *\tcjpeg [options]  [inputfile]\n * In the second style, output is always to standard output, which you'd\n * normally redirect to a file or pipe to some other program.  Input is\n * either from a named file or from standard input (typically redirected).\n * The second style is convenient on Unix but is unhelpful on systems that\n * don't support pipes.  Also, you MUST use the first style if your system\n * doesn't do binary I/O to stdin/stdout.\n * To simplify script writing, the \"-outfile\" switch is provided.  The syntax\n *\tcjpeg [options]  -outfile outputfile  inputfile\n * works regardless of which command line style is used.\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n#include \"jversion.h\"\t\t/* for version message */\n#include \"config.h\"\n\n#ifdef USE_CCOMMAND\t\t/* command-line reader for Macintosh */\n#ifdef __MWERKS__\n#include <SIOUX.h>              /* Metrowerks needs this */\n#include <console.h>\t\t/* ... and this */\n#endif\n#ifdef THINK_C\n#include <console.h>\t\t/* Think declares it here */\n#endif\n#endif\n\n\n/* Create the add-on message string table. */\n\n#define JMESSAGE(code,string)\tstring ,\n\nstatic const char * const cdjpeg_message_table[] = {\n#include \"cderror.h\"\n  NULL\n};\n\n\n/*\n * This routine determines what format the input file is,\n * and selects the appropriate input-reading module.\n *\n * To determine which family of input formats the file belongs to,\n * we may look only at the first byte of the file, since C does not\n * guarantee that more than one character can be pushed back with ungetc.\n * Looking at additional bytes would require one of these approaches:\n *     1) assume we can fseek() the input file (fails for piped input);\n *     2) assume we can push back more than one character (works in\n *        some C implementations, but unportable);\n *     3) provide our own buffering (breaks input readers that want to use\n *        stdio directly, such as the RLE library);\n * or  4) don't put back the data, and modify the input_init methods to assume\n *        they start reading after the start of file (also breaks RLE library).\n * #1 is attractive for MS-DOS but is untenable on Unix.\n *\n * The most portable solution for file types that can't be identified by their\n * first byte is to make the user tell us what they are.  This is also the\n * only approach for \"raw\" file types that contain only arbitrary values.\n * We presently apply this method for Targa files.  Most of the time Targa\n * files start with 0x00, so we recognize that case.  Potentially, however,\n * a Targa file could start with any byte value (byte 0 is the length of the\n * seldom-used ID field), so we provide a switch to force Targa input mode.\n */\n\nstatic boolean is_targa;\t/* records user -targa switch */\n\n\nLOCAL(cjpeg_source_ptr)\nselect_file_type (j_compress_ptr cinfo, FILE * infile)\n{\n  int c;\n\n  if (is_targa) {\n#ifdef TARGA_SUPPORTED\n    return jinit_read_targa(cinfo);\n#else\n    ERREXIT(cinfo, JERR_TGA_NOTCOMP);\n#endif\n  }\n\n  if ((c = getc(infile)) == EOF)\n    ERREXIT(cinfo, JERR_INPUT_EMPTY);\n  if (ungetc(c, infile) == EOF)\n    ERREXIT(cinfo, JERR_UNGETC_FAILED);\n\n  switch (c) {\n#ifdef BMP_SUPPORTED\n  case 'B':\n    return jinit_read_bmp(cinfo);\n#endif\n#ifdef GIF_SUPPORTED\n  case 'G':\n    return jinit_read_gif(cinfo);\n#endif\n#ifdef PPM_SUPPORTED\n  case 'P':\n    return jinit_read_ppm(cinfo);\n#endif\n#ifdef RLE_SUPPORTED\n  case 'R':\n    return jinit_read_rle(cinfo);\n#endif\n#ifdef TARGA_SUPPORTED\n  case 0x00:\n    return jinit_read_targa(cinfo);\n#endif\n  default:\n    ERREXIT(cinfo, JERR_UNKNOWN_FORMAT);\n    break;\n  }\n\n  return NULL;\t\t\t/* suppress compiler warnings */\n}\n\n\n/*\n * Argument-parsing code.\n * The switch parser is designed to be useful with DOS-style command line\n * syntax, ie, intermixed switches and file names, where only the switches\n * to the left of a given file name affect processing of that file.\n * The main program in this file doesn't actually use this capability...\n */\n\n\nstatic const char * progname;\t/* program name for error messages */\nstatic char * outfilename;\t/* for -outfile switch */\nboolean memdst;  /* for -memdst switch */\n\n\nLOCAL(void)\nusage (void)\n/* complain about bad command line */\n{\n  fprintf(stderr, \"usage: %s [switches] \", progname);\n#ifdef TWO_FILE_COMMANDLINE\n  fprintf(stderr, \"inputfile outputfile\\n\");\n#else\n  fprintf(stderr, \"[inputfile]\\n\");\n#endif\n\n  fprintf(stderr, \"Switches (names may be abbreviated):\\n\");\n  fprintf(stderr, \"  -quality N[,...]   Compression quality (0..100; 5-95 is useful range)\\n\");\n  fprintf(stderr, \"  -grayscale     Create monochrome JPEG file\\n\");\n  fprintf(stderr, \"  -rgb           Create RGB JPEG file\\n\");\n#ifdef ENTROPY_OPT_SUPPORTED\n  fprintf(stderr, \"  -optimize      Optimize Huffman table (smaller file, but slow compression)\\n\");\n#endif\n#ifdef C_PROGRESSIVE_SUPPORTED\n  fprintf(stderr, \"  -progressive   Create progressive JPEG file\\n\");\n#endif\n#ifdef TARGA_SUPPORTED\n  fprintf(stderr, \"  -targa         Input file is Targa format (usually not needed)\\n\");\n#endif\n  fprintf(stderr, \"Switches for advanced users:\\n\");\n#ifdef C_ARITH_CODING_SUPPORTED\n  fprintf(stderr, \"  -arithmetic    Use arithmetic coding\\n\");\n#endif\n#ifdef DCT_ISLOW_SUPPORTED\n  fprintf(stderr, \"  -dct int       Use integer DCT method%s\\n\",\n\t  (JDCT_DEFAULT == JDCT_ISLOW ? \" (default)\" : \"\"));\n#endif\n#ifdef DCT_IFAST_SUPPORTED\n  fprintf(stderr, \"  -dct fast      Use fast integer DCT (less accurate)%s\\n\",\n\t  (JDCT_DEFAULT == JDCT_IFAST ? \" (default)\" : \"\"));\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n  fprintf(stderr, \"  -dct float     Use floating-point DCT method%s\\n\",\n\t  (JDCT_DEFAULT == JDCT_FLOAT ? \" (default)\" : \"\"));\n#endif\n  fprintf(stderr, \"  -restart N     Set restart interval in rows, or in blocks with B\\n\");\n#ifdef INPUT_SMOOTHING_SUPPORTED\n  fprintf(stderr, \"  -smooth N      Smooth dithered input (N=1..100 is strength)\\n\");\n#endif\n  fprintf(stderr, \"  -maxmemory N   Maximum memory to use (in kbytes)\\n\");\n  fprintf(stderr, \"  -outfile name  Specify name for output file\\n\");\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\n  fprintf(stderr, \"  -memdst        Compress to memory instead of file (useful for benchmarking)\\n\");\n#endif\n  fprintf(stderr, \"  -verbose  or  -debug   Emit debug output\\n\");\n  fprintf(stderr, \"Switches for wizards:\\n\");\n  fprintf(stderr, \"  -baseline      Force baseline quantization tables\\n\");\n  fprintf(stderr, \"  -qtables file  Use quantization tables given in file\\n\");\n  fprintf(stderr, \"  -qslots N[,...]    Set component quantization tables\\n\");\n  fprintf(stderr, \"  -sample HxV[,...]  Set component sampling factors\\n\");\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n  fprintf(stderr, \"  -scans file    Create multi-scan JPEG per script file\\n\");\n#endif\n  exit(EXIT_FAILURE);\n}\n\n\nLOCAL(int)\nparse_switches (j_compress_ptr cinfo, int argc, char **argv,\n\t\tint last_file_arg_seen, boolean for_real)\n/* Parse optional switches.\n * Returns argv[] index of first file-name argument (== argc if none).\n * Any file names with indexes <= last_file_arg_seen are ignored;\n * they have presumably been processed in a previous iteration.\n * (Pass 0 for last_file_arg_seen on the first or only iteration.)\n * for_real is FALSE on the first (dummy) pass; we may skip any expensive\n * processing.\n */\n{\n  int argn;\n  char * arg;\n  boolean force_baseline;\n  boolean simple_progressive;\n  char * qualityarg = NULL;\t/* saves -quality parm if any */\n  char * qtablefile = NULL;\t/* saves -qtables filename if any */\n  char * qslotsarg = NULL;\t/* saves -qslots parm if any */\n  char * samplearg = NULL;\t/* saves -sample parm if any */\n  char * scansarg = NULL;\t/* saves -scans parm if any */\n\n  /* Set up default JPEG parameters. */\n\n  force_baseline = FALSE;\t/* by default, allow 16-bit quantizers */\n  simple_progressive = FALSE;\n  is_targa = FALSE;\n  outfilename = NULL;\n  memdst = FALSE;\n  cinfo->err->trace_level = 0;\n\n  /* Scan command line options, adjust parameters */\n\n  for (argn = 1; argn < argc; argn++) {\n    arg = argv[argn];\n    if (*arg != '-') {\n      /* Not a switch, must be a file name argument */\n      if (argn <= last_file_arg_seen) {\n\toutfilename = NULL;\t/* -outfile applies to just one input file */\n\tcontinue;\t\t/* ignore this name if previously processed */\n      }\n      break;\t\t\t/* else done parsing switches */\n    }\n    arg++;\t\t\t/* advance past switch marker character */\n\n    if (keymatch(arg, \"arithmetic\", 1)) {\n      /* Use arithmetic coding. */\n#ifdef C_ARITH_CODING_SUPPORTED\n      cinfo->arith_code = TRUE;\n#else\n      fprintf(stderr, \"%s: sorry, arithmetic coding not supported\\n\",\n\t      progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"baseline\", 1)) {\n      /* Force baseline-compatible output (8-bit quantizer values). */\n      force_baseline = TRUE;\n\n    } else if (keymatch(arg, \"dct\", 2)) {\n      /* Select DCT algorithm. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (keymatch(argv[argn], \"int\", 1)) {\n\tcinfo->dct_method = JDCT_ISLOW;\n      } else if (keymatch(argv[argn], \"fast\", 2)) {\n\tcinfo->dct_method = JDCT_IFAST;\n      } else if (keymatch(argv[argn], \"float\", 2)) {\n\tcinfo->dct_method = JDCT_FLOAT;\n      } else\n\tusage();\n\n    } else if (keymatch(arg, \"debug\", 1) || keymatch(arg, \"verbose\", 1)) {\n      /* Enable debug printouts. */\n      /* On first -d, print version identification */\n      static boolean printed_version = FALSE;\n\n      if (! printed_version) {\n\tfprintf(stderr, \"%s version %s (build %s)\\n\",\n\t\tPACKAGE_NAME, VERSION, BUILD);\n\tfprintf(stderr, \"%s\\n\\n\", JCOPYRIGHT);\n\tfprintf(stderr, \"Emulating The Independent JPEG Group's software, version %s\\n\\n\",\n\t\tJVERSION);\n\tprinted_version = TRUE;\n      }\n      cinfo->err->trace_level++;\n\n    } else if (keymatch(arg, \"grayscale\", 2) || keymatch(arg, \"greyscale\",2)) {\n      /* Force a monochrome JPEG file to be generated. */\n      jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);\n\n    } else if (keymatch(arg, \"rgb\", 3)) {\n      /* Force an RGB JPEG file to be generated. */\n      jpeg_set_colorspace(cinfo, JCS_RGB);\n\n    } else if (keymatch(arg, \"maxmemory\", 3)) {\n      /* Maximum memory in Kb (or Mb with 'm'). */\n      long lval;\n      char ch = 'x';\n\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (sscanf(argv[argn], \"%ld%c\", &lval, &ch) < 1)\n\tusage();\n      if (ch == 'm' || ch == 'M')\n\tlval *= 1000L;\n      cinfo->mem->max_memory_to_use = lval * 1000L;\n\n    } else if (keymatch(arg, \"optimize\", 1) || keymatch(arg, \"optimise\", 1)) {\n      /* Enable entropy parm optimization. */\n#ifdef ENTROPY_OPT_SUPPORTED\n      cinfo->optimize_coding = TRUE;\n#else\n      fprintf(stderr, \"%s: sorry, entropy optimization was not compiled in\\n\",\n\t      progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"outfile\", 4)) {\n      /* Set output file name. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      outfilename = argv[argn];\t/* save it away for later use */\n\n    } else if (keymatch(arg, \"progressive\", 1)) {\n      /* Select simple progressive mode. */\n#ifdef C_PROGRESSIVE_SUPPORTED\n      simple_progressive = TRUE;\n      /* We must postpone execution until num_components is known. */\n#else\n      fprintf(stderr, \"%s: sorry, progressive output was not compiled in\\n\",\n\t      progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"memdst\", 2)) {\n      /* Use in-memory destination manager */\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\n      memdst = TRUE;\n#else\n      fprintf(stderr, \"%s: sorry, in-memory destination manager was not compiled in\\n\",\n              progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"quality\", 1)) {\n      /* Quality ratings (quantization table scaling factors). */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      qualityarg = argv[argn];\n\n    } else if (keymatch(arg, \"qslots\", 2)) {\n      /* Quantization table slot numbers. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      qslotsarg = argv[argn];\n      /* Must delay setting qslots until after we have processed any\n       * colorspace-determining switches, since jpeg_set_colorspace sets\n       * default quant table numbers.\n       */\n\n    } else if (keymatch(arg, \"qtables\", 2)) {\n      /* Quantization tables fetched from file. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      qtablefile = argv[argn];\n      /* We postpone actually reading the file in case -quality comes later. */\n\n    } else if (keymatch(arg, \"restart\", 1)) {\n      /* Restart interval in MCU rows (or in MCUs with 'b'). */\n      long lval;\n      char ch = 'x';\n\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (sscanf(argv[argn], \"%ld%c\", &lval, &ch) < 1)\n\tusage();\n      if (lval < 0 || lval > 65535L)\n\tusage();\n      if (ch == 'b' || ch == 'B') {\n\tcinfo->restart_interval = (unsigned int) lval;\n\tcinfo->restart_in_rows = 0; /* else prior '-restart n' overrides me */\n      } else {\n\tcinfo->restart_in_rows = (int) lval;\n\t/* restart_interval will be computed during startup */\n      }\n\n    } else if (keymatch(arg, \"sample\", 2)) {\n      /* Set sampling factors. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      samplearg = argv[argn];\n      /* Must delay setting sample factors until after we have processed any\n       * colorspace-determining switches, since jpeg_set_colorspace sets\n       * default sampling factors.\n       */\n\n    } else if (keymatch(arg, \"scans\", 4)) {\n      /* Set scan script. */\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      scansarg = argv[argn];\n      /* We must postpone reading the file in case -progressive appears. */\n#else\n      fprintf(stderr, \"%s: sorry, multi-scan output was not compiled in\\n\",\n\t      progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"smooth\", 2)) {\n      /* Set input smoothing factor. */\n      int val;\n\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (sscanf(argv[argn], \"%d\", &val) != 1)\n\tusage();\n      if (val < 0 || val > 100)\n\tusage();\n      cinfo->smoothing_factor = val;\n\n    } else if (keymatch(arg, \"targa\", 1)) {\n      /* Input file is Targa format. */\n      is_targa = TRUE;\n\n    } else {\n      usage();\t\t\t/* bogus switch */\n    }\n  }\n\n  /* Post-switch-scanning cleanup */\n\n  if (for_real) {\n\n    /* Set quantization tables for selected quality. */\n    /* Some or all may be overridden if -qtables is present. */\n    if (qualityarg != NULL)\t/* process -quality if it was present */\n      if (! set_quality_ratings(cinfo, qualityarg, force_baseline))\n\tusage();\n\n    if (qtablefile != NULL)\t/* process -qtables if it was present */\n      if (! read_quant_tables(cinfo, qtablefile, force_baseline))\n\tusage();\n\n    if (qslotsarg != NULL)\t/* process -qslots if it was present */\n      if (! set_quant_slots(cinfo, qslotsarg))\n\tusage();\n\n    if (samplearg != NULL)\t/* process -sample if it was present */\n      if (! set_sample_factors(cinfo, samplearg))\n\tusage();\n\n#ifdef C_PROGRESSIVE_SUPPORTED\n    if (simple_progressive)\t/* process -progressive; -scans can override */\n      jpeg_simple_progression(cinfo);\n#endif\n\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n    if (scansarg != NULL)\t/* process -scans if it was present */\n      if (! read_scan_script(cinfo, scansarg))\n\tusage();\n#endif\n  }\n\n  return argn;\t\t\t/* return index of next arg (file name) */\n}\n\n\n/*\n * The main program.\n */\n\nint\nmain (int argc, char **argv)\n{\n  struct jpeg_compress_struct cinfo;\n  struct jpeg_error_mgr jerr;\n#ifdef PROGRESS_REPORT\n  struct cdjpeg_progress_mgr progress;\n#endif\n  int file_index;\n  cjpeg_source_ptr src_mgr;\n  FILE * input_file;\n  FILE * output_file = NULL;\n  unsigned char *outbuffer = NULL;\n  unsigned long outsize = 0;\n  JDIMENSION num_scanlines;\n\n  /* On Mac, fetch a command line. */\n#ifdef USE_CCOMMAND\n  argc = ccommand(&argv);\n#endif\n\n  progname = argv[0];\n  if (progname == NULL || progname[0] == 0)\n    progname = \"cjpeg\";\t\t/* in case C library doesn't provide it */\n\n  /* Initialize the JPEG compression object with default error handling. */\n  cinfo.err = jpeg_std_error(&jerr);\n  jpeg_create_compress(&cinfo);\n  /* Add some application-specific error messages (from cderror.h) */\n  jerr.addon_message_table = cdjpeg_message_table;\n  jerr.first_addon_message = JMSG_FIRSTADDONCODE;\n  jerr.last_addon_message = JMSG_LASTADDONCODE;\n\n  /* Now safe to enable signal catcher. */\n#ifdef NEED_SIGNAL_CATCHER\n  enable_signal_catcher((j_common_ptr) &cinfo);\n#endif\n\n  /* Initialize JPEG parameters.\n   * Much of this may be overridden later.\n   * In particular, we don't yet know the input file's color space,\n   * but we need to provide some value for jpeg_set_defaults() to work.\n   */\n\n  cinfo.in_color_space = JCS_RGB; /* arbitrary guess */\n  jpeg_set_defaults(&cinfo);\n\n  /* Scan command line to find file names.\n   * It is convenient to use just one switch-parsing routine, but the switch\n   * values read here are ignored; we will rescan the switches after opening\n   * the input file.\n   */\n\n  file_index = parse_switches(&cinfo, argc, argv, 0, FALSE);\n\n#ifdef TWO_FILE_COMMANDLINE\n  if (!memdst) {\n    /* Must have either -outfile switch or explicit output file name */\n    if (outfilename == NULL) {\n      if (file_index != argc-2) {\n        fprintf(stderr, \"%s: must name one input and one output file\\n\",\n                progname);\n        usage();\n      }\n      outfilename = argv[file_index+1];\n    } else {\n      if (file_index != argc-1) {\n        fprintf(stderr, \"%s: must name one input and one output file\\n\",\n                progname);\n        usage();\n      }\n    }\n  }\n#else\n  /* Unix style: expect zero or one file name */\n  if (file_index < argc-1) {\n    fprintf(stderr, \"%s: only one input file\\n\", progname);\n    usage();\n  }\n#endif /* TWO_FILE_COMMANDLINE */\n\n  /* Open the input file. */\n  if (file_index < argc) {\n    if ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s\\n\", progname, argv[file_index]);\n      exit(EXIT_FAILURE);\n    }\n  } else {\n    /* default input file is stdin */\n    input_file = read_stdin();\n  }\n\n  /* Open the output file. */\n  if (outfilename != NULL) {\n    if ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s\\n\", progname, outfilename);\n      exit(EXIT_FAILURE);\n    }\n  } else if (!memdst) {\n    /* default output file is stdout */\n    output_file = write_stdout();\n  }\n\n#ifdef PROGRESS_REPORT\n  start_progress_monitor((j_common_ptr) &cinfo, &progress);\n#endif\n\n  /* Figure out the input file format, and set up to read it. */\n  src_mgr = select_file_type(&cinfo, input_file);\n  src_mgr->input_file = input_file;\n\n  /* Read the input file header to obtain file size & colorspace. */\n  (*src_mgr->start_input) (&cinfo, src_mgr);\n\n  /* Now that we know input colorspace, fix colorspace-dependent defaults */\n  jpeg_default_colorspace(&cinfo);\n\n  /* Adjust default compression parameters by re-parsing the options */\n  file_index = parse_switches(&cinfo, argc, argv, 0, TRUE);\n\n  /* Specify data destination for compression */\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\n  if (memdst)\n    jpeg_mem_dest(&cinfo, &outbuffer, &outsize);\n  else\n#endif\n    jpeg_stdio_dest(&cinfo, output_file);\n\n  /* Start compressor */\n  jpeg_start_compress(&cinfo, TRUE);\n\n  /* Process data */\n  while (cinfo.next_scanline < cinfo.image_height) {\n    num_scanlines = (*src_mgr->get_pixel_rows) (&cinfo, src_mgr);\n    (void) jpeg_write_scanlines(&cinfo, src_mgr->buffer, num_scanlines);\n  }\n\n  /* Finish compression and release memory */\n  (*src_mgr->finish_input) (&cinfo, src_mgr);\n  jpeg_finish_compress(&cinfo);\n  jpeg_destroy_compress(&cinfo);\n\n  /* Close files, if we opened them */\n  if (input_file != stdin)\n    fclose(input_file);\n  if (output_file != stdout && output_file != NULL)\n    fclose(output_file);\n\n#ifdef PROGRESS_REPORT\n  end_progress_monitor((j_common_ptr) &cinfo);\n#endif\n\n  if (memdst) {\n    fprintf(stderr, \"Compressed size:  %lu bytes\\n\", outsize);\n    if (outbuffer != NULL)\n      free(outbuffer);\n  }\n\n  /* All done. */\n  exit(jerr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS);\n  return 0;\t\t\t/* suppress no-return-value warnings */\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/coderules.txt",
    "content": "IJG JPEG LIBRARY:  CODING RULES\n\nCopyright (C) 1991-1996, Thomas G. Lane.\nThis file is part of the Independent JPEG Group's software.\nFor conditions of distribution and use, see the accompanying README file.\n\n\nSince numerous people will be contributing code and bug fixes, it's important\nto establish a common coding style.  The goal of using similar coding styles\nis much more important than the details of just what that style is.\n\nIn general we follow the recommendations of \"Recommended C Style and Coding\nStandards\" revision 6.1 (Cannon et al. as modified by Spencer, Keppel and\nBrader).  This document is available in the IJG FTP archive (see\njpeg/doc/cstyle.ms.tbl.Z, or cstyle.txt.Z for those without nroff/tbl).\n\nBlock comments should be laid out thusly:\n\n/*\n *  Block comments in this style.\n */\n\nWe indent statements in K&R style, e.g.,\n\tif (test) {\n\t  then-part;\n\t} else {\n\t  else-part;\n\t}\nwith two spaces per indentation level.  (This indentation convention is\nhandled automatically by GNU Emacs and many other text editors.)\n\nMulti-word names should be written in lower case with underscores, e.g.,\nmulti_word_name (not multiWordName).  Preprocessor symbols and enum constants\nare similar but upper case (MULTI_WORD_NAME).  Names should be unique within\nthe first fifteen characters.  (On some older systems, global names must be\nunique within six characters.  We accommodate this without cluttering the\nsource code by using macros to substitute shorter names.)\n\nWe use function prototypes everywhere; we rely on automatic source code\ntransformation to feed prototype-less C compilers.  Transformation is done\nby the simple and portable tool 'ansi2knr.c' (courtesy of Ghostscript).\nansi2knr is not very bright, so it imposes a format requirement on function\ndeclarations: the function name MUST BEGIN IN COLUMN 1.  Thus all functions\nshould be written in the following style:\n\nLOCAL(int *)\nfunction_name (int a, char *b)\n{\n    code...\n}\n\nNote that each function definition must begin with GLOBAL(type), LOCAL(type),\nor METHODDEF(type).  These macros expand to \"static type\" or just \"type\" as\nappropriate.  They provide a readable indication of the routine's usage and\ncan readily be changed for special needs.  (For instance, special linkage\nkeywords can be inserted for use in Windows DLLs.)\n\nansi2knr does not transform method declarations (function pointers in\nstructs).  We handle these with a macro JMETHOD, defined as\n\t#ifdef HAVE_PROTOTYPES\n\t#define JMETHOD(type,methodname,arglist)  type (*methodname) arglist\n\t#else\n\t#define JMETHOD(type,methodname,arglist)  type (*methodname) ()\n\t#endif\nwhich is used like this:\n\tstruct function_pointers {\n\t  JMETHOD(void, init_entropy_encoder, (int somearg, jparms *jp));\n\t  JMETHOD(void, term_entropy_encoder, (void));\n\t};\nNote the set of parentheses surrounding the parameter list.\n\nA similar solution is used for forward and external function declarations\n(see the EXTERN and JPP macros).\n\nIf the code is to work on non-ANSI compilers, we cannot rely on a prototype\ndeclaration to coerce actual parameters into the right types.  Therefore, use\nexplicit casts on actual parameters whenever the actual parameter type is not\nidentical to the formal parameter.  Beware of implicit conversions to \"int\".\n\nIt seems there are some non-ANSI compilers in which the sizeof() operator\nis defined to return int, yet size_t is defined as long.  Needless to say,\nthis is brain-damaged.  Always use the SIZEOF() macro in place of sizeof(),\nso that the result is guaranteed to be of type size_t.\n\n\nThe JPEG library is intended to be used within larger programs.  Furthermore,\nwe want it to be reentrant so that it can be used by applications that process\nmultiple images concurrently.  The following rules support these requirements:\n\n1. Avoid direct use of file I/O, \"malloc\", error report printouts, etc;\npass these through the common routines provided.\n\n2. Minimize global namespace pollution.  Functions should be declared static\nwherever possible.  (Note that our method-based calling conventions help this\na lot: in many modules only the initialization function will ever need to be\ncalled directly, so only that function need be externally visible.)  All\nglobal function names should begin with \"jpeg_\", and should have an\nabbreviated name (unique in the first six characters) substituted by macro\nwhen NEED_SHORT_EXTERNAL_NAMES is set.\n\n3. Don't use global variables; anything that must be used in another module\nshould be in the common data structures.\n\n4. Don't use static variables except for read-only constant tables.  Variables\nthat should be private to a module can be placed into private structures (see\nthe system architecture document, structure.txt).\n\n5. Source file names should begin with \"j\" for files that are part of the\nlibrary proper; source files that are not part of the library, such as cjpeg.c\nand djpeg.c, do not begin with \"j\".  Keep source file names to eight\ncharacters (plus \".c\" or \".h\", etc) to make life easy for MS-DOSers.  Keep\ncompression and decompression code in separate source files --- some\napplications may want only one half of the library.\n\nNote: these rules (particularly #4) are not followed religiously in the\nmodules that are used in cjpeg/djpeg but are not part of the JPEG library\nproper.  Those modules are not really intended to be used in other\napplications.\n"
  },
  {
    "path": "ext/libjpeg-turbo/compile",
    "content": "#! /bin/sh\n# Wrapper for compilers which do not understand `-c -o'.\n\nscriptversion=2004-09-10.20\n\n# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc.\n# Written by Tom Tromey <tromey@cygnus.com>.\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that program.\n\n# This file is maintained in Automake, please report\n# bugs to <bug-automake@gnu.org> or send patches to\n# <automake-patches@gnu.org>.\n\ncase $1 in\n  '')\n     echo \"$0: No command.  Try \\`$0 --help' for more information.\" 1>&2\n     exit 1;\n     ;;\n  -h | --h*)\n    cat <<\\EOF\nUsage: compile [--help] [--version] PROGRAM [ARGS]\n\nWrapper for compilers which do not understand `-c -o'.\nRemove `-o dest.o' from ARGS, run PROGRAM with the remaining\narguments, and rename the output as expected.\n\nIf you are trying to build a whole package this is not the\nright script to run: please start by reading the file `INSTALL'.\n\nReport bugs to <bug-automake@gnu.org>.\nEOF\n    exit 0\n    ;;\n  -v | --v*)\n    echo \"compile $scriptversion\"\n    exit 0\n    ;;\nesac\n\nofile=\ncfile=\neat=\n\nfor arg\ndo\n  if test -n \"$eat\"; then\n    eat=\n  else\n    case $1 in\n      -o)\n\t# configure might choose to run compile as `compile cc -o foo foo.c'.\n\t# So we strip `-o arg' only if arg is an object.\n\teat=1\n\tcase $2 in\n\t  *.o | *.obj)\n\t    ofile=$2\n\t    ;;\n\t  *)\n\t    set x \"$@\" -o \"$2\"\n\t    shift\n\t    ;;\n\tesac\n\t;;\n      *.c)\n\tcfile=$1\n\tset x \"$@\" \"$1\"\n\tshift\n\t;;\n      *)\n\tset x \"$@\" \"$1\"\n\tshift\n\t;;\n    esac\n  fi\n  shift\ndone\n\nif test -z \"$ofile\" || test -z \"$cfile\"; then\n  # If no `-o' option was seen then we might have been invoked from a\n  # pattern rule where we don't need one.  That is ok -- this is a\n  # normal compilation that the losing compiler can handle.  If no\n  # `.c' file was seen then we are probably linking.  That is also\n  # ok.\n  exec \"$@\"\nfi\n\n# Name of file we expect compiler to create.\ncofile=`echo \"$cfile\" | sed -e 's|^.*/||' -e 's/\\.c$/.o/'`\n\n# Create the lock directory.\n# Note: use `[/.-]' here to ensure that we don't use the same name\n# that we are using for the .o file.  Also, base the name on the expected\n# object file name, since that is what matters with a parallel build.\nlockdir=`echo \"$cofile\" | sed -e 's|[/.-]|_|g'`.d\nwhile true; do\n  if mkdir \"$lockdir\" >/dev/null 2>&1; then\n    break\n  fi\n  sleep 1\ndone\n# FIXME: race condition here if user kills between mkdir and trap.\ntrap \"rmdir '$lockdir'; exit 1\" 1 2 15\n\n# Run the compile.\n\"$@\"\nret=$?\n\nif test -f \"$cofile\"; then\n  mv \"$cofile\" \"$ofile\"\nfi\n\nrmdir \"$lockdir\"\nexit $ret\n\n# Local Variables:\n# mode: shell-script\n# sh-indentation: 2\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"scriptversion=\"\n# time-stamp-format: \"%:y-%02m-%02d.%02H\"\n# time-stamp-end: \"$\"\n# End:\n"
  },
  {
    "path": "ext/libjpeg-turbo/config.guess",
    "content": "#! /bin/sh\n# Attempt to guess a canonical system name.\n#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,\n#   2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.\n\ntimestamp='2004-09-07'\n\n# This file is free software; you can redistribute it and/or modify it\n# under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n#\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that program.\n\n# Originally written by Per Bothner <per@bothner.com>.\n# Please send patches to <config-patches@gnu.org>.  Submit a context\n# diff and a properly formatted ChangeLog entry.\n#\n# This script attempts to guess a canonical system name similar to\n# config.sub.  If it succeeds, it prints the system name on stdout, and\n# exits with 0.  Otherwise, it exits with 1.\n#\n# The plan is that this can be called by configure scripts if you\n# don't specify an explicit build system type.\n\nme=`echo \"$0\" | sed -e 's,.*/,,'`\n\nusage=\"\\\nUsage: $0 [OPTION]\n\nOutput the configuration name of the system \\`$me' is run on.\n\nOperation modes:\n  -h, --help         print this help, then exit\n  -t, --time-stamp   print date of last modification, then exit\n  -v, --version      print version number, then exit\n\nReport bugs and patches to <config-patches@gnu.org>.\"\n\nversion=\"\\\nGNU config.guess ($timestamp)\n\nOriginally written by Per Bothner.\nCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004\nFree Software Foundation, Inc.\n\nThis is free software; see the source for copying conditions.  There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\"\n\nhelp=\"\nTry \\`$me --help' for more information.\"\n\n# Parse command line\nwhile test $# -gt 0 ; do\n  case $1 in\n    --time-stamp | --time* | -t )\n       echo \"$timestamp\" ; exit 0 ;;\n    --version | -v )\n       echo \"$version\" ; exit 0 ;;\n    --help | --h* | -h )\n       echo \"$usage\"; exit 0 ;;\n    -- )     # Stop option processing\n       shift; break ;;\n    - )\t# Use stdin as input.\n       break ;;\n    -* )\n       echo \"$me: invalid option $1$help\" >&2\n       exit 1 ;;\n    * )\n       break ;;\n  esac\ndone\n\nif test $# != 0; then\n  echo \"$me: too many arguments$help\" >&2\n  exit 1\nfi\n\ntrap 'exit 1' 1 2 15\n\n# CC_FOR_BUILD -- compiler used by this script. Note that the use of a\n# compiler to aid in system detection is discouraged as it requires\n# temporary files to be created and, as you can see below, it is a\n# headache to deal with in a portable fashion.\n\n# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still\n# use `HOST_CC' if defined, but it is deprecated.\n\n# Portable tmp directory creation inspired by the Autoconf team.\n\nset_cc_for_build='\ntrap \"exitcode=\\$?; (rm -f \\$tmpfiles 2>/dev/null; rmdir \\$tmp 2>/dev/null) && exit \\$exitcode\" 0 ;\ntrap \"rm -f \\$tmpfiles 2>/dev/null; rmdir \\$tmp 2>/dev/null; exit 1\" 1 2 13 15 ;\n: ${TMPDIR=/tmp} ;\n { tmp=`(umask 077 && mktemp -d -q \"$TMPDIR/cgXXXXXX\") 2>/dev/null` && test -n \"$tmp\" && test -d \"$tmp\" ; } ||\n { test -n \"$RANDOM\" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||\n { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo \"Warning: creating insecure temp directory\" >&2 ; } ||\n { echo \"$me: cannot create a temporary directory in $TMPDIR\" >&2 ; exit 1 ; } ;\ndummy=$tmp/dummy ;\ntmpfiles=\"$dummy.c $dummy.o $dummy.rel $dummy\" ;\ncase $CC_FOR_BUILD,$HOST_CC,$CC in\n ,,)    echo \"int x;\" > $dummy.c ;\n\tfor c in cc gcc c89 c99 ; do\n\t  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then\n\t     CC_FOR_BUILD=\"$c\"; break ;\n\t  fi ;\n\tdone ;\n\tif test x\"$CC_FOR_BUILD\" = x ; then\n\t  CC_FOR_BUILD=no_compiler_found ;\n\tfi\n\t;;\n ,,*)   CC_FOR_BUILD=$CC ;;\n ,*,*)  CC_FOR_BUILD=$HOST_CC ;;\nesac ;'\n\n# This is needed to find uname on a Pyramid OSx when run in the BSD universe.\n# (ghazi@noc.rutgers.edu 1994-08-24)\nif (test -f /.attbin/uname) >/dev/null 2>&1 ; then\n\tPATH=$PATH:/.attbin ; export PATH\nfi\n\nUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown\nUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown\nUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown\nUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown\n\n# Note: order is significant - the case branches are not exclusive.\n\ncase \"${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}\" in\n    *:NetBSD:*:*)\n\t# NetBSD (nbsd) targets should (where applicable) match one or\n\t# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,\n\t# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently\n\t# switched to ELF, *-*-netbsd* would select the old\n\t# object file format.  This provides both forward\n\t# compatibility and a consistent mechanism for selecting the\n\t# object file format.\n\t#\n\t# Note: NetBSD doesn't particularly care about the vendor\n\t# portion of the name.  We always set it to \"unknown\".\n\tsysctl=\"sysctl -n hw.machine_arch\"\n\tUNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \\\n\t    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`\n\tcase \"${UNAME_MACHINE_ARCH}\" in\n\t    armeb) machine=armeb-unknown ;;\n\t    arm*) machine=arm-unknown ;;\n\t    sh3el) machine=shl-unknown ;;\n\t    sh3eb) machine=sh-unknown ;;\n\t    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;\n\tesac\n\t# The Operating System including object format, if it has switched\n\t# to ELF recently, or will in the future.\n\tcase \"${UNAME_MACHINE_ARCH}\" in\n\t    arm*|i386|m68k|ns32k|sh3*|sparc|vax)\n\t\teval $set_cc_for_build\n\t\tif echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \\\n\t\t\t| grep __ELF__ >/dev/null\n\t\tthen\n\t\t    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).\n\t\t    # Return netbsd for either.  FIX?\n\t\t    os=netbsd\n\t\telse\n\t\t    os=netbsdelf\n\t\tfi\n\t\t;;\n\t    *)\n\t        os=netbsd\n\t\t;;\n\tesac\n\t# The OS release\n\t# Debian GNU/NetBSD machines have a different userland, and\n\t# thus, need a distinct triplet. However, they do not need\n\t# kernel version information, so it can be replaced with a\n\t# suitable tag, in the style of linux-gnu.\n\tcase \"${UNAME_VERSION}\" in\n\t    Debian*)\n\t\trelease='-gnu'\n\t\t;;\n\t    *)\n\t\trelease=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\\./'`\n\t\t;;\n\tesac\n\t# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:\n\t# contains redundant information, the shorter form:\n\t# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.\n\techo \"${machine}-${os}${release}\"\n\texit 0 ;;\n    amd64:OpenBSD:*:*)\n\techo x86_64-unknown-openbsd${UNAME_RELEASE}\n\texit 0 ;;\n    amiga:OpenBSD:*:*)\n\techo m68k-unknown-openbsd${UNAME_RELEASE}\n\texit 0 ;;\n    cats:OpenBSD:*:*)\n\techo arm-unknown-openbsd${UNAME_RELEASE}\n\texit 0 ;;\n    hp300:OpenBSD:*:*)\n\techo m68k-unknown-openbsd${UNAME_RELEASE}\n\texit 0 ;;\n    luna88k:OpenBSD:*:*)\n    \techo m88k-unknown-openbsd${UNAME_RELEASE}\n\texit 0 ;;\n    mac68k:OpenBSD:*:*)\n\techo m68k-unknown-openbsd${UNAME_RELEASE}\n\texit 0 ;;\n    macppc:OpenBSD:*:*)\n\techo powerpc-unknown-openbsd${UNAME_RELEASE}\n\texit 0 ;;\n    mvme68k:OpenBSD:*:*)\n\techo m68k-unknown-openbsd${UNAME_RELEASE}\n\texit 0 ;;\n    mvme88k:OpenBSD:*:*)\n\techo m88k-unknown-openbsd${UNAME_RELEASE}\n\texit 0 ;;\n    mvmeppc:OpenBSD:*:*)\n\techo powerpc-unknown-openbsd${UNAME_RELEASE}\n\texit 0 ;;\n    sgi:OpenBSD:*:*)\n\techo mips64-unknown-openbsd${UNAME_RELEASE}\n\texit 0 ;;\n    sun3:OpenBSD:*:*)\n\techo m68k-unknown-openbsd${UNAME_RELEASE}\n\texit 0 ;;\n    *:OpenBSD:*:*)\n\techo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}\n\texit 0 ;;\n    *:ekkoBSD:*:*)\n\techo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}\n\texit 0 ;;\n    macppc:MirBSD:*:*)\n\techo powerppc-unknown-mirbsd${UNAME_RELEASE}\n\texit 0 ;;\n    *:MirBSD:*:*)\n\techo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}\n\texit 0 ;;\n    alpha:OSF1:*:*)\n\tcase $UNAME_RELEASE in\n\t*4.0)\n\t\tUNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`\n\t\t;;\n\t*5.*)\n\t        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`\n\t\t;;\n\tesac\n\t# According to Compaq, /usr/sbin/psrinfo has been available on\n\t# OSF/1 and Tru64 systems produced since 1995.  I hope that\n\t# covers most systems running today.  This code pipes the CPU\n\t# types through head -n 1, so we only detect the type of CPU 0.\n\tALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \\(.*\\) processor.*$/\\1/p' | head -n 1`\n\tcase \"$ALPHA_CPU_TYPE\" in\n\t    \"EV4 (21064)\")\n\t\tUNAME_MACHINE=\"alpha\" ;;\n\t    \"EV4.5 (21064)\")\n\t\tUNAME_MACHINE=\"alpha\" ;;\n\t    \"LCA4 (21066/21068)\")\n\t\tUNAME_MACHINE=\"alpha\" ;;\n\t    \"EV5 (21164)\")\n\t\tUNAME_MACHINE=\"alphaev5\" ;;\n\t    \"EV5.6 (21164A)\")\n\t\tUNAME_MACHINE=\"alphaev56\" ;;\n\t    \"EV5.6 (21164PC)\")\n\t\tUNAME_MACHINE=\"alphapca56\" ;;\n\t    \"EV5.7 (21164PC)\")\n\t\tUNAME_MACHINE=\"alphapca57\" ;;\n\t    \"EV6 (21264)\")\n\t\tUNAME_MACHINE=\"alphaev6\" ;;\n\t    \"EV6.7 (21264A)\")\n\t\tUNAME_MACHINE=\"alphaev67\" ;;\n\t    \"EV6.8CB (21264C)\")\n\t\tUNAME_MACHINE=\"alphaev68\" ;;\n\t    \"EV6.8AL (21264B)\")\n\t\tUNAME_MACHINE=\"alphaev68\" ;;\n\t    \"EV6.8CX (21264D)\")\n\t\tUNAME_MACHINE=\"alphaev68\" ;;\n\t    \"EV6.9A (21264/EV69A)\")\n\t\tUNAME_MACHINE=\"alphaev69\" ;;\n\t    \"EV7 (21364)\")\n\t\tUNAME_MACHINE=\"alphaev7\" ;;\n\t    \"EV7.9 (21364A)\")\n\t\tUNAME_MACHINE=\"alphaev79\" ;;\n\tesac\n\t# A Pn.n version is a patched version.\n\t# A Vn.n version is a released version.\n\t# A Tn.n version is a released field test version.\n\t# A Xn.n version is an unreleased experimental baselevel.\n\t# 1.2 uses \"1.2\" for uname -r.\n\techo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`\n\texit 0 ;;\n    Alpha\\ *:Windows_NT*:*)\n\t# How do we know it's Interix rather than the generic POSIX subsystem?\n\t# Should we change UNAME_MACHINE based on the output of uname instead\n\t# of the specific Alpha model?\n\techo alpha-pc-interix\n\texit 0 ;;\n    21064:Windows_NT:50:3)\n\techo alpha-dec-winnt3.5\n\texit 0 ;;\n    Amiga*:UNIX_System_V:4.0:*)\n\techo m68k-unknown-sysv4\n\texit 0;;\n    *:[Aa]miga[Oo][Ss]:*:*)\n\techo ${UNAME_MACHINE}-unknown-amigaos\n\texit 0 ;;\n    *:[Mm]orph[Oo][Ss]:*:*)\n\techo ${UNAME_MACHINE}-unknown-morphos\n\texit 0 ;;\n    *:OS/390:*:*)\n\techo i370-ibm-openedition\n\texit 0 ;;\n    *:OS400:*:*)\n        echo powerpc-ibm-os400\n\texit 0 ;;\n    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)\n\techo arm-acorn-riscix${UNAME_RELEASE}\n\texit 0;;\n    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)\n\techo hppa1.1-hitachi-hiuxmpp\n\texit 0;;\n    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)\n\t# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.\n\tif test \"`(/bin/universe) 2>/dev/null`\" = att ; then\n\t\techo pyramid-pyramid-sysv3\n\telse\n\t\techo pyramid-pyramid-bsd\n\tfi\n\texit 0 ;;\n    NILE*:*:*:dcosx)\n\techo pyramid-pyramid-svr4\n\texit 0 ;;\n    DRS?6000:unix:4.0:6*)\n\techo sparc-icl-nx6\n\texit 0 ;;\n    DRS?6000:UNIX_SV:4.2*:7*)\n\tcase `/usr/bin/uname -p` in\n\t    sparc) echo sparc-icl-nx7 && exit 0 ;;\n\tesac ;;\n    sun4H:SunOS:5.*:*)\n\techo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit 0 ;;\n    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)\n\techo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit 0 ;;\n    i86pc:SunOS:5.*:*)\n\techo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit 0 ;;\n    sun4*:SunOS:6*:*)\n\t# According to config.sub, this is the proper way to canonicalize\n\t# SunOS6.  Hard to guess exactly what SunOS6 will be like, but\n\t# it's likely to be more like Solaris than SunOS4.\n\techo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit 0 ;;\n    sun4*:SunOS:*:*)\n\tcase \"`/usr/bin/arch -k`\" in\n\t    Series*|S4*)\n\t\tUNAME_RELEASE=`uname -v`\n\t\t;;\n\tesac\n\t# Japanese Language versions have a version number like `4.1.3-JL'.\n\techo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`\n\texit 0 ;;\n    sun3*:SunOS:*:*)\n\techo m68k-sun-sunos${UNAME_RELEASE}\n\texit 0 ;;\n    sun*:*:4.2BSD:*)\n\tUNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`\n\ttest \"x${UNAME_RELEASE}\" = \"x\" && UNAME_RELEASE=3\n\tcase \"`/bin/arch`\" in\n\t    sun3)\n\t\techo m68k-sun-sunos${UNAME_RELEASE}\n\t\t;;\n\t    sun4)\n\t\techo sparc-sun-sunos${UNAME_RELEASE}\n\t\t;;\n\tesac\n\texit 0 ;;\n    aushp:SunOS:*:*)\n\techo sparc-auspex-sunos${UNAME_RELEASE}\n\texit 0 ;;\n    # The situation for MiNT is a little confusing.  The machine name\n    # can be virtually everything (everything which is not\n    # \"atarist\" or \"atariste\" at least should have a processor\n    # > m68000).  The system name ranges from \"MiNT\" over \"FreeMiNT\"\n    # to the lowercase version \"mint\" (or \"freemint\").  Finally\n    # the system name \"TOS\" denotes a system which is actually not\n    # MiNT.  But MiNT is downward compatible to TOS, so this should\n    # be no problem.\n    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)\n        echo m68k-atari-mint${UNAME_RELEASE}\n\texit 0 ;;\n    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)\n\techo m68k-atari-mint${UNAME_RELEASE}\n        exit 0 ;;\n    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)\n        echo m68k-atari-mint${UNAME_RELEASE}\n\texit 0 ;;\n    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)\n        echo m68k-milan-mint${UNAME_RELEASE}\n        exit 0 ;;\n    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)\n        echo m68k-hades-mint${UNAME_RELEASE}\n        exit 0 ;;\n    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)\n        echo m68k-unknown-mint${UNAME_RELEASE}\n        exit 0 ;;\n    m68k:machten:*:*)\n\techo m68k-apple-machten${UNAME_RELEASE}\n\texit 0 ;;\n    powerpc:machten:*:*)\n\techo powerpc-apple-machten${UNAME_RELEASE}\n\texit 0 ;;\n    RISC*:Mach:*:*)\n\techo mips-dec-mach_bsd4.3\n\texit 0 ;;\n    RISC*:ULTRIX:*:*)\n\techo mips-dec-ultrix${UNAME_RELEASE}\n\texit 0 ;;\n    VAX*:ULTRIX*:*:*)\n\techo vax-dec-ultrix${UNAME_RELEASE}\n\texit 0 ;;\n    2020:CLIX:*:* | 2430:CLIX:*:*)\n\techo clipper-intergraph-clix${UNAME_RELEASE}\n\texit 0 ;;\n    mips:*:*:UMIPS | mips:*:*:RISCos)\n\teval $set_cc_for_build\n\tsed 's/^\t//' << EOF >$dummy.c\n#ifdef __cplusplus\n#include <stdio.h>  /* for printf() prototype */\n\tint main (int argc, char *argv[]) {\n#else\n\tint main (argc, argv) int argc; char *argv[]; {\n#endif\n\t#if defined (host_mips) && defined (MIPSEB)\n\t#if defined (SYSTYPE_SYSV)\n\t  printf (\"mips-mips-riscos%ssysv\\n\", argv[1]); exit (0);\n\t#endif\n\t#if defined (SYSTYPE_SVR4)\n\t  printf (\"mips-mips-riscos%ssvr4\\n\", argv[1]); exit (0);\n\t#endif\n\t#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)\n\t  printf (\"mips-mips-riscos%sbsd\\n\", argv[1]); exit (0);\n\t#endif\n\t#endif\n\t  exit (-1);\n\t}\nEOF\n\t$CC_FOR_BUILD -o $dummy $dummy.c \\\n\t  && $dummy `echo \"${UNAME_RELEASE}\" | sed -n 's/\\([0-9]*\\).*/\\1/p'` \\\n\t  && exit 0\n\techo mips-mips-riscos${UNAME_RELEASE}\n\texit 0 ;;\n    Motorola:PowerMAX_OS:*:*)\n\techo powerpc-motorola-powermax\n\texit 0 ;;\n    Motorola:*:4.3:PL8-*)\n\techo powerpc-harris-powermax\n\texit 0 ;;\n    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)\n\techo powerpc-harris-powermax\n\texit 0 ;;\n    Night_Hawk:Power_UNIX:*:*)\n\techo powerpc-harris-powerunix\n\texit 0 ;;\n    m88k:CX/UX:7*:*)\n\techo m88k-harris-cxux7\n\texit 0 ;;\n    m88k:*:4*:R4*)\n\techo m88k-motorola-sysv4\n\texit 0 ;;\n    m88k:*:3*:R3*)\n\techo m88k-motorola-sysv3\n\texit 0 ;;\n    AViiON:dgux:*:*)\n        # DG/UX returns AViiON for all architectures\n        UNAME_PROCESSOR=`/usr/bin/uname -p`\n\tif [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]\n\tthen\n\t    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \\\n\t       [ ${TARGET_BINARY_INTERFACE}x = x ]\n\t    then\n\t\techo m88k-dg-dgux${UNAME_RELEASE}\n\t    else\n\t\techo m88k-dg-dguxbcs${UNAME_RELEASE}\n\t    fi\n\telse\n\t    echo i586-dg-dgux${UNAME_RELEASE}\n\tfi\n \texit 0 ;;\n    M88*:DolphinOS:*:*)\t# DolphinOS (SVR3)\n\techo m88k-dolphin-sysv3\n\texit 0 ;;\n    M88*:*:R3*:*)\n\t# Delta 88k system running SVR3\n\techo m88k-motorola-sysv3\n\texit 0 ;;\n    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)\n\techo m88k-tektronix-sysv3\n\texit 0 ;;\n    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)\n\techo m68k-tektronix-bsd\n\texit 0 ;;\n    *:IRIX*:*:*)\n\techo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`\n\texit 0 ;;\n    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.\n\techo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id\n\texit 0 ;;              # Note that: echo \"'`uname -s`'\" gives 'AIX '\n    i*86:AIX:*:*)\n\techo i386-ibm-aix\n\texit 0 ;;\n    ia64:AIX:*:*)\n\tif [ -x /usr/bin/oslevel ] ; then\n\t\tIBM_REV=`/usr/bin/oslevel`\n\telse\n\t\tIBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}\n\tfi\n\techo ${UNAME_MACHINE}-ibm-aix${IBM_REV}\n\texit 0 ;;\n    *:AIX:2:3)\n\tif grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then\n\t\teval $set_cc_for_build\n\t\tsed 's/^\t\t//' << EOF >$dummy.c\n\t\t#include <sys/systemcfg.h>\n\n\t\tmain()\n\t\t\t{\n\t\t\tif (!__power_pc())\n\t\t\t\texit(1);\n\t\t\tputs(\"powerpc-ibm-aix3.2.5\");\n\t\t\texit(0);\n\t\t\t}\nEOF\n\t\t$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0\n\t\techo rs6000-ibm-aix3.2.5\n\telif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then\n\t\techo rs6000-ibm-aix3.2.4\n\telse\n\t\techo rs6000-ibm-aix3.2\n\tfi\n\texit 0 ;;\n    *:AIX:*:[45])\n\tIBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`\n\tif /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then\n\t\tIBM_ARCH=rs6000\n\telse\n\t\tIBM_ARCH=powerpc\n\tfi\n\tif [ -x /usr/bin/oslevel ] ; then\n\t\tIBM_REV=`/usr/bin/oslevel`\n\telse\n\t\tIBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}\n\tfi\n\techo ${IBM_ARCH}-ibm-aix${IBM_REV}\n\texit 0 ;;\n    *:AIX:*:*)\n\techo rs6000-ibm-aix\n\texit 0 ;;\n    ibmrt:4.4BSD:*|romp-ibm:BSD:*)\n\techo romp-ibm-bsd4.4\n\texit 0 ;;\n    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and\n\techo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to\n\texit 0 ;;                           # report: romp-ibm BSD 4.3\n    *:BOSX:*:*)\n\techo rs6000-bull-bosx\n\texit 0 ;;\n    DPX/2?00:B.O.S.:*:*)\n\techo m68k-bull-sysv3\n\texit 0 ;;\n    9000/[34]??:4.3bsd:1.*:*)\n\techo m68k-hp-bsd\n\texit 0 ;;\n    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)\n\techo m68k-hp-bsd4.4\n\texit 0 ;;\n    9000/[34678]??:HP-UX:*:*)\n\tHPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`\n\tcase \"${UNAME_MACHINE}\" in\n\t    9000/31? )            HP_ARCH=m68000 ;;\n\t    9000/[34]?? )         HP_ARCH=m68k ;;\n\t    9000/[678][0-9][0-9])\n\t\tif [ -x /usr/bin/getconf ]; then\n\t\t    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`\n                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`\n                    case \"${sc_cpu_version}\" in\n                      523) HP_ARCH=\"hppa1.0\" ;; # CPU_PA_RISC1_0\n                      528) HP_ARCH=\"hppa1.1\" ;; # CPU_PA_RISC1_1\n                      532)                      # CPU_PA_RISC2_0\n                        case \"${sc_kernel_bits}\" in\n                          32) HP_ARCH=\"hppa2.0n\" ;;\n                          64) HP_ARCH=\"hppa2.0w\" ;;\n\t\t\t  '') HP_ARCH=\"hppa2.0\" ;;   # HP-UX 10.20\n                        esac ;;\n                    esac\n\t\tfi\n\t\tif [ \"${HP_ARCH}\" = \"\" ]; then\n\t\t    eval $set_cc_for_build\n\t\t    sed 's/^              //' << EOF >$dummy.c\n\n              #define _HPUX_SOURCE\n              #include <stdlib.h>\n              #include <unistd.h>\n\n              int main ()\n              {\n              #if defined(_SC_KERNEL_BITS)\n                  long bits = sysconf(_SC_KERNEL_BITS);\n              #endif\n                  long cpu  = sysconf (_SC_CPU_VERSION);\n\n                  switch (cpu)\n              \t{\n              \tcase CPU_PA_RISC1_0: puts (\"hppa1.0\"); break;\n              \tcase CPU_PA_RISC1_1: puts (\"hppa1.1\"); break;\n              \tcase CPU_PA_RISC2_0:\n              #if defined(_SC_KERNEL_BITS)\n              \t    switch (bits)\n              \t\t{\n              \t\tcase 64: puts (\"hppa2.0w\"); break;\n              \t\tcase 32: puts (\"hppa2.0n\"); break;\n              \t\tdefault: puts (\"hppa2.0\"); break;\n              \t\t} break;\n              #else  /* !defined(_SC_KERNEL_BITS) */\n              \t    puts (\"hppa2.0\"); break;\n              #endif\n              \tdefault: puts (\"hppa1.0\"); break;\n              \t}\n                  exit (0);\n              }\nEOF\n\t\t    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`\n\t\t    test -z \"$HP_ARCH\" && HP_ARCH=hppa\n\t\tfi ;;\n\tesac\n\tif [ ${HP_ARCH} = \"hppa2.0w\" ]\n\tthen\n\t    # avoid double evaluation of $set_cc_for_build\n\t    test -n \"$CC_FOR_BUILD\" || eval $set_cc_for_build\n\t    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null\n\t    then\n\t\tHP_ARCH=\"hppa2.0w\"\n\t    else\n\t\tHP_ARCH=\"hppa64\"\n\t    fi\n\tfi\n\techo ${HP_ARCH}-hp-hpux${HPUX_REV}\n\texit 0 ;;\n    ia64:HP-UX:*:*)\n\tHPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`\n\techo ia64-hp-hpux${HPUX_REV}\n\texit 0 ;;\n    3050*:HI-UX:*:*)\n\teval $set_cc_for_build\n\tsed 's/^\t//' << EOF >$dummy.c\n\t#include <unistd.h>\n\tint\n\tmain ()\n\t{\n\t  long cpu = sysconf (_SC_CPU_VERSION);\n\t  /* The order matters, because CPU_IS_HP_MC68K erroneously returns\n\t     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct\n\t     results, however.  */\n\t  if (CPU_IS_PA_RISC (cpu))\n\t    {\n\t      switch (cpu)\n\t\t{\n\t\t  case CPU_PA_RISC1_0: puts (\"hppa1.0-hitachi-hiuxwe2\"); break;\n\t\t  case CPU_PA_RISC1_1: puts (\"hppa1.1-hitachi-hiuxwe2\"); break;\n\t\t  case CPU_PA_RISC2_0: puts (\"hppa2.0-hitachi-hiuxwe2\"); break;\n\t\t  default: puts (\"hppa-hitachi-hiuxwe2\"); break;\n\t\t}\n\t    }\n\t  else if (CPU_IS_HP_MC68K (cpu))\n\t    puts (\"m68k-hitachi-hiuxwe2\");\n\t  else puts (\"unknown-hitachi-hiuxwe2\");\n\t  exit (0);\n\t}\nEOF\n\t$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0\n\techo unknown-hitachi-hiuxwe2\n\texit 0 ;;\n    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )\n\techo hppa1.1-hp-bsd\n\texit 0 ;;\n    9000/8??:4.3bsd:*:*)\n\techo hppa1.0-hp-bsd\n\texit 0 ;;\n    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)\n\techo hppa1.0-hp-mpeix\n\texit 0 ;;\n    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )\n\techo hppa1.1-hp-osf\n\texit 0 ;;\n    hp8??:OSF1:*:*)\n\techo hppa1.0-hp-osf\n\texit 0 ;;\n    i*86:OSF1:*:*)\n\tif [ -x /usr/sbin/sysversion ] ; then\n\t    echo ${UNAME_MACHINE}-unknown-osf1mk\n\telse\n\t    echo ${UNAME_MACHINE}-unknown-osf1\n\tfi\n\texit 0 ;;\n    parisc*:Lites*:*:*)\n\techo hppa1.1-hp-lites\n\texit 0 ;;\n    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)\n\techo c1-convex-bsd\n        exit 0 ;;\n    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)\n\tif getsysinfo -f scalar_acc\n\tthen echo c32-convex-bsd\n\telse echo c2-convex-bsd\n\tfi\n        exit 0 ;;\n    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)\n\techo c34-convex-bsd\n        exit 0 ;;\n    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)\n\techo c38-convex-bsd\n        exit 0 ;;\n    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)\n\techo c4-convex-bsd\n        exit 0 ;;\n    CRAY*Y-MP:*:*:*)\n\techo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit 0 ;;\n    CRAY*[A-Z]90:*:*:*)\n\techo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \\\n\t| sed -e 's/CRAY.*\\([A-Z]90\\)/\\1/' \\\n\t      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \\\n\t      -e 's/\\.[^.]*$/.X/'\n\texit 0 ;;\n    CRAY*TS:*:*:*)\n\techo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit 0 ;;\n    CRAY*T3E:*:*:*)\n\techo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit 0 ;;\n    CRAY*SV1:*:*:*)\n\techo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit 0 ;;\n    *:UNICOS/mp:*:*)\n\techo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit 0 ;;\n    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)\n\tFUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`\n        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\\///'`\n        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`\n        echo \"${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}\"\n        exit 0 ;;\n    5000:UNIX_System_V:4.*:*)\n        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\\///'`\n        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`\n        echo \"sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}\"\n\texit 0 ;;\n    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\\ Embedded/OS:*:*)\n\techo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}\n\texit 0 ;;\n    sparc*:BSD/OS:*:*)\n\techo sparc-unknown-bsdi${UNAME_RELEASE}\n\texit 0 ;;\n    *:BSD/OS:*:*)\n\techo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}\n\texit 0 ;;\n    *:FreeBSD:*:*)\n\techo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`\n\texit 0 ;;\n    i*:CYGWIN*:*)\n\techo ${UNAME_MACHINE}-pc-cygwin\n\texit 0 ;;\n    i*:MINGW*:*)\n\techo ${UNAME_MACHINE}-pc-mingw32\n\texit 0 ;;\n    i*:PW*:*)\n\techo ${UNAME_MACHINE}-pc-pw32\n\texit 0 ;;\n    x86:Interix*:[34]*)\n\techo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\\..*//'\n\texit 0 ;;\n    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)\n\techo i${UNAME_MACHINE}-pc-mks\n\texit 0 ;;\n    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)\n\t# How do we know it's Interix rather than the generic POSIX subsystem?\n\t# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we\n\t# UNAME_MACHINE based on the output of uname instead of i386?\n\techo i586-pc-interix\n\texit 0 ;;\n    i*:UWIN*:*)\n\techo ${UNAME_MACHINE}-pc-uwin\n\texit 0 ;;\n    p*:CYGWIN*:*)\n\techo powerpcle-unknown-cygwin\n\texit 0 ;;\n    prep*:SunOS:5.*:*)\n\techo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit 0 ;;\n    *:GNU:*:*)\n\t# the GNU system\n\techo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`\n\texit 0 ;;\n    *:GNU/*:*:*)\n\t# other systems with GNU libc and userland\n\techo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu\n\texit 0 ;;\n    i*86:Minix:*:*)\n\techo ${UNAME_MACHINE}-pc-minix\n\texit 0 ;;\n    arm*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-gnu\n\texit 0 ;;\n    cris:Linux:*:*)\n\techo cris-axis-linux-gnu\n\texit 0 ;;\n    crisv32:Linux:*:*)\n\techo crisv32-axis-linux-gnu\n\texit 0 ;;\n    frv:Linux:*:*)\n    \techo frv-unknown-linux-gnu\n\texit 0 ;;\n    ia64:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-gnu\n\texit 0 ;;\n    m32r*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-gnu\n\texit 0 ;;\n    m68*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-gnu\n\texit 0 ;;\n    mips:Linux:*:*)\n\teval $set_cc_for_build\n\tsed 's/^\t//' << EOF >$dummy.c\n\t#undef CPU\n\t#undef mips\n\t#undef mipsel\n\t#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)\n\tCPU=mipsel\n\t#else\n\t#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)\n\tCPU=mips\n\t#else\n\tCPU=\n\t#endif\n\t#endif\nEOF\n\teval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`\n\ttest x\"${CPU}\" != x && echo \"${CPU}-unknown-linux-gnu\" && exit 0\n\t;;\n    mips64:Linux:*:*)\n\teval $set_cc_for_build\n\tsed 's/^\t//' << EOF >$dummy.c\n\t#undef CPU\n\t#undef mips64\n\t#undef mips64el\n\t#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)\n\tCPU=mips64el\n\t#else\n\t#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)\n\tCPU=mips64\n\t#else\n\tCPU=\n\t#endif\n\t#endif\nEOF\n\teval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`\n\ttest x\"${CPU}\" != x && echo \"${CPU}-unknown-linux-gnu\" && exit 0\n\t;;\n    ppc:Linux:*:*)\n\techo powerpc-unknown-linux-gnu\n\texit 0 ;;\n    ppc64:Linux:*:*)\n\techo powerpc64-unknown-linux-gnu\n\texit 0 ;;\n    alpha:Linux:*:*)\n\tcase `sed -n '/^cpu model/s/^.*: \\(.*\\)/\\1/p' < /proc/cpuinfo` in\n\t  EV5)   UNAME_MACHINE=alphaev5 ;;\n\t  EV56)  UNAME_MACHINE=alphaev56 ;;\n\t  PCA56) UNAME_MACHINE=alphapca56 ;;\n\t  PCA57) UNAME_MACHINE=alphapca56 ;;\n\t  EV6)   UNAME_MACHINE=alphaev6 ;;\n\t  EV67)  UNAME_MACHINE=alphaev67 ;;\n\t  EV68*) UNAME_MACHINE=alphaev68 ;;\n        esac\n\tobjdump --private-headers /bin/sh | grep ld.so.1 >/dev/null\n\tif test \"$?\" = 0 ; then LIBC=\"libc1\" ; else LIBC=\"\" ; fi\n\techo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}\n\texit 0 ;;\n    parisc:Linux:*:* | hppa:Linux:*:*)\n\t# Look for CPU level\n\tcase `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in\n\t  PA7*) echo hppa1.1-unknown-linux-gnu ;;\n\t  PA8*) echo hppa2.0-unknown-linux-gnu ;;\n\t  *)    echo hppa-unknown-linux-gnu ;;\n\tesac\n\texit 0 ;;\n    parisc64:Linux:*:* | hppa64:Linux:*:*)\n\techo hppa64-unknown-linux-gnu\n\texit 0 ;;\n    s390:Linux:*:* | s390x:Linux:*:*)\n\techo ${UNAME_MACHINE}-ibm-linux\n\texit 0 ;;\n    sh64*:Linux:*:*)\n    \techo ${UNAME_MACHINE}-unknown-linux-gnu\n\texit 0 ;;\n    sh*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-gnu\n\texit 0 ;;\n    sparc:Linux:*:* | sparc64:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-gnu\n\texit 0 ;;\n    x86_64:Linux:*:*)\n\techo x86_64-unknown-linux-gnu\n\texit 0 ;;\n    i*86:Linux:*:*)\n\t# The BFD linker knows what the default object file format is, so\n\t# first see if it will tell us. cd to the root directory to prevent\n\t# problems with other programs or directories called `ld' in the path.\n\t# Set LC_ALL=C to ensure ld outputs messages in English.\n\tld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \\\n\t\t\t | sed -ne '/supported targets:/!d\n\t\t\t\t    s/[ \t][ \t]*/ /g\n\t\t\t\t    s/.*supported targets: *//\n\t\t\t\t    s/ .*//\n\t\t\t\t    p'`\n        case \"$ld_supported_targets\" in\n\t  elf32-i386)\n\t\tTENTATIVE=\"${UNAME_MACHINE}-pc-linux-gnu\"\n\t\t;;\n\t  a.out-i386-linux)\n\t\techo \"${UNAME_MACHINE}-pc-linux-gnuaout\"\n\t\texit 0 ;;\n\t  coff-i386)\n\t\techo \"${UNAME_MACHINE}-pc-linux-gnucoff\"\n\t\texit 0 ;;\n\t  \"\")\n\t\t# Either a pre-BFD a.out linker (linux-gnuoldld) or\n\t\t# one that does not give us useful --help.\n\t\techo \"${UNAME_MACHINE}-pc-linux-gnuoldld\"\n\t\texit 0 ;;\n\tesac\n\t# Determine whether the default compiler is a.out or elf\n\teval $set_cc_for_build\n\tsed 's/^\t//' << EOF >$dummy.c\n\t#include <features.h>\n\t#ifdef __ELF__\n\t# ifdef __GLIBC__\n\t#  if __GLIBC__ >= 2\n\tLIBC=gnu\n\t#  else\n\tLIBC=gnulibc1\n\t#  endif\n\t# else\n\tLIBC=gnulibc1\n\t# endif\n\t#else\n\t#ifdef __INTEL_COMPILER\n\tLIBC=gnu\n\t#else\n\tLIBC=gnuaout\n\t#endif\n\t#endif\n\t#ifdef __dietlibc__\n\tLIBC=dietlibc\n\t#endif\nEOF\n\teval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`\n\ttest x\"${LIBC}\" != x && echo \"${UNAME_MACHINE}-pc-linux-${LIBC}\" && exit 0\n\ttest x\"${TENTATIVE}\" != x && echo \"${TENTATIVE}\" && exit 0\n\t;;\n    i*86:DYNIX/ptx:4*:*)\n\t# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.\n\t# earlier versions are messed up and put the nodename in both\n\t# sysname and nodename.\n\techo i386-sequent-sysv4\n\texit 0 ;;\n    i*86:UNIX_SV:4.2MP:2.*)\n        # Unixware is an offshoot of SVR4, but it has its own version\n        # number series starting with 2...\n        # I am not positive that other SVR4 systems won't match this,\n\t# I just have to hope.  -- rms.\n        # Use sysv4.2uw... so that sysv4* matches it.\n\techo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}\n\texit 0 ;;\n    i*86:OS/2:*:*)\n\t# If we were able to find `uname', then EMX Unix compatibility\n\t# is probably installed.\n\techo ${UNAME_MACHINE}-pc-os2-emx\n\texit 0 ;;\n    i*86:XTS-300:*:STOP)\n\techo ${UNAME_MACHINE}-unknown-stop\n\texit 0 ;;\n    i*86:atheos:*:*)\n\techo ${UNAME_MACHINE}-unknown-atheos\n\texit 0 ;;\n\ti*86:syllable:*:*)\n\techo ${UNAME_MACHINE}-pc-syllable\n\texit 0 ;;\n    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)\n\techo i386-unknown-lynxos${UNAME_RELEASE}\n\texit 0 ;;\n    i*86:*DOS:*:*)\n\techo ${UNAME_MACHINE}-pc-msdosdjgpp\n\texit 0 ;;\n    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)\n\tUNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\\/MP$//'`\n\tif grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then\n\t\techo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}\n\telse\n\t\techo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}\n\tfi\n\texit 0 ;;\n    i*86:*:5:[78]*)\n\tcase `/bin/uname -X | grep \"^Machine\"` in\n\t    *486*)\t     UNAME_MACHINE=i486 ;;\n\t    *Pentium)\t     UNAME_MACHINE=i586 ;;\n\t    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;\n\tesac\n\techo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}\n\texit 0 ;;\n    i*86:*:3.2:*)\n\tif test -f /usr/options/cb.name; then\n\t\tUNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`\n\t\techo ${UNAME_MACHINE}-pc-isc$UNAME_REL\n\telif /bin/uname -X 2>/dev/null >/dev/null ; then\n\t\tUNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`\n\t\t(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486\n\t\t(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \\\n\t\t\t&& UNAME_MACHINE=i586\n\t\t(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \\\n\t\t\t&& UNAME_MACHINE=i686\n\t\t(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \\\n\t\t\t&& UNAME_MACHINE=i686\n\t\techo ${UNAME_MACHINE}-pc-sco$UNAME_REL\n\telse\n\t\techo ${UNAME_MACHINE}-pc-sysv32\n\tfi\n\texit 0 ;;\n    pc:*:*:*)\n\t# Left here for compatibility:\n        # uname -m prints for DJGPP always 'pc', but it prints nothing about\n        # the processor, so we play safe by assuming i386.\n\techo i386-pc-msdosdjgpp\n        exit 0 ;;\n    Intel:Mach:3*:*)\n\techo i386-pc-mach3\n\texit 0 ;;\n    paragon:*:*:*)\n\techo i860-intel-osf1\n\texit 0 ;;\n    i860:*:4.*:*) # i860-SVR4\n\tif grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then\n\t  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4\n\telse # Add other i860-SVR4 vendors below as they are discovered.\n\t  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4\n\tfi\n\texit 0 ;;\n    mini*:CTIX:SYS*5:*)\n\t# \"miniframe\"\n\techo m68010-convergent-sysv\n\texit 0 ;;\n    mc68k:UNIX:SYSTEM5:3.51m)\n\techo m68k-convergent-sysv\n\texit 0 ;;\n    M680?0:D-NIX:5.3:*)\n\techo m68k-diab-dnix\n\texit 0 ;;\n    M68*:*:R3V[5678]*:*)\n\ttest -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;\n    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)\n\tOS_REL=''\n\ttest -r /etc/.relid \\\n\t&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \\([0-9][0-9]\\).*/\\1/p' < /etc/.relid`\n\t/bin/uname -p 2>/dev/null | grep 86 >/dev/null \\\n\t  && echo i486-ncr-sysv4.3${OS_REL} && exit 0\n\t/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \\\n\t  && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;\n    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)\n        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \\\n          && echo i486-ncr-sysv4 && exit 0 ;;\n    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)\n\techo m68k-unknown-lynxos${UNAME_RELEASE}\n\texit 0 ;;\n    mc68030:UNIX_System_V:4.*:*)\n\techo m68k-atari-sysv4\n\texit 0 ;;\n    TSUNAMI:LynxOS:2.*:*)\n\techo sparc-unknown-lynxos${UNAME_RELEASE}\n\texit 0 ;;\n    rs6000:LynxOS:2.*:*)\n\techo rs6000-unknown-lynxos${UNAME_RELEASE}\n\texit 0 ;;\n    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)\n\techo powerpc-unknown-lynxos${UNAME_RELEASE}\n\texit 0 ;;\n    SM[BE]S:UNIX_SV:*:*)\n\techo mips-dde-sysv${UNAME_RELEASE}\n\texit 0 ;;\n    RM*:ReliantUNIX-*:*:*)\n\techo mips-sni-sysv4\n\texit 0 ;;\n    RM*:SINIX-*:*:*)\n\techo mips-sni-sysv4\n\texit 0 ;;\n    *:SINIX-*:*:*)\n\tif uname -p 2>/dev/null >/dev/null ; then\n\t\tUNAME_MACHINE=`(uname -p) 2>/dev/null`\n\t\techo ${UNAME_MACHINE}-sni-sysv4\n\telse\n\t\techo ns32k-sni-sysv\n\tfi\n\texit 0 ;;\n    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort\n                      # says <Richard.M.Bartel@ccMail.Census.GOV>\n        echo i586-unisys-sysv4\n        exit 0 ;;\n    *:UNIX_System_V:4*:FTX*)\n\t# From Gerald Hewes <hewes@openmarket.com>.\n\t# How about differentiating between stratus architectures? -djm\n\techo hppa1.1-stratus-sysv4\n\texit 0 ;;\n    *:*:*:FTX*)\n\t# From seanf@swdc.stratus.com.\n\techo i860-stratus-sysv4\n\texit 0 ;;\n    *:VOS:*:*)\n\t# From Paul.Green@stratus.com.\n\techo hppa1.1-stratus-vos\n\texit 0 ;;\n    mc68*:A/UX:*:*)\n\techo m68k-apple-aux${UNAME_RELEASE}\n\texit 0 ;;\n    news*:NEWS-OS:6*:*)\n\techo mips-sony-newsos6\n\texit 0 ;;\n    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)\n\tif [ -d /usr/nec ]; then\n\t        echo mips-nec-sysv${UNAME_RELEASE}\n\telse\n\t        echo mips-unknown-sysv${UNAME_RELEASE}\n\tfi\n        exit 0 ;;\n    BeBox:BeOS:*:*)\t# BeOS running on hardware made by Be, PPC only.\n\techo powerpc-be-beos\n\texit 0 ;;\n    BeMac:BeOS:*:*)\t# BeOS running on Mac or Mac clone, PPC only.\n\techo powerpc-apple-beos\n\texit 0 ;;\n    BePC:BeOS:*:*)\t# BeOS running on Intel PC compatible.\n\techo i586-pc-beos\n\texit 0 ;;\n    SX-4:SUPER-UX:*:*)\n\techo sx4-nec-superux${UNAME_RELEASE}\n\texit 0 ;;\n    SX-5:SUPER-UX:*:*)\n\techo sx5-nec-superux${UNAME_RELEASE}\n\texit 0 ;;\n    SX-6:SUPER-UX:*:*)\n\techo sx6-nec-superux${UNAME_RELEASE}\n\texit 0 ;;\n    Power*:Rhapsody:*:*)\n\techo powerpc-apple-rhapsody${UNAME_RELEASE}\n\texit 0 ;;\n    *:Rhapsody:*:*)\n\techo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}\n\texit 0 ;;\n    *:Darwin:*:*)\n\tUNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown\n\tcase $UNAME_PROCESSOR in\n\t    *86) UNAME_PROCESSOR=i686 ;;\n\t    unknown) UNAME_PROCESSOR=powerpc ;;\n\tesac\n\techo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}\n\texit 0 ;;\n    *:procnto*:*:* | *:QNX:[0123456789]*:*)\n\tUNAME_PROCESSOR=`uname -p`\n\tif test \"$UNAME_PROCESSOR\" = \"x86\"; then\n\t\tUNAME_PROCESSOR=i386\n\t\tUNAME_MACHINE=pc\n\tfi\n\techo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}\n\texit 0 ;;\n    *:QNX:*:4*)\n\techo i386-pc-qnx\n\texit 0 ;;\n    NSR-?:NONSTOP_KERNEL:*:*)\n\techo nsr-tandem-nsk${UNAME_RELEASE}\n\texit 0 ;;\n    *:NonStop-UX:*:*)\n\techo mips-compaq-nonstopux\n\texit 0 ;;\n    BS2000:POSIX*:*:*)\n\techo bs2000-siemens-sysv\n\texit 0 ;;\n    DS/*:UNIX_System_V:*:*)\n\techo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}\n\texit 0 ;;\n    *:Plan9:*:*)\n\t# \"uname -m\" is not consistent, so use $cputype instead. 386\n\t# is converted to i386 for consistency with other x86\n\t# operating systems.\n\tif test \"$cputype\" = \"386\"; then\n\t    UNAME_MACHINE=i386\n\telse\n\t    UNAME_MACHINE=\"$cputype\"\n\tfi\n\techo ${UNAME_MACHINE}-unknown-plan9\n\texit 0 ;;\n    *:TOPS-10:*:*)\n\techo pdp10-unknown-tops10\n\texit 0 ;;\n    *:TENEX:*:*)\n\techo pdp10-unknown-tenex\n\texit 0 ;;\n    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)\n\techo pdp10-dec-tops20\n\texit 0 ;;\n    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)\n\techo pdp10-xkl-tops20\n\texit 0 ;;\n    *:TOPS-20:*:*)\n\techo pdp10-unknown-tops20\n\texit 0 ;;\n    *:ITS:*:*)\n\techo pdp10-unknown-its\n\texit 0 ;;\n    SEI:*:*:SEIUX)\n        echo mips-sei-seiux${UNAME_RELEASE}\n\texit 0 ;;\n    *:DragonFly:*:*)\n\techo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`\n\texit 0 ;;\n    *:*VMS:*:*)\n    \tUNAME_MACHINE=`(uname -p) 2>/dev/null`\n\tcase \"${UNAME_MACHINE}\" in\n\t    A*) echo alpha-dec-vms && exit 0 ;;\n\t    I*) echo ia64-dec-vms && exit 0 ;;\n\t    V*) echo vax-dec-vms && exit 0 ;;\n\tesac\nesac\n\n#echo '(No uname command or uname output not recognized.)' 1>&2\n#echo \"${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}\" 1>&2\n\neval $set_cc_for_build\ncat >$dummy.c <<EOF\n#ifdef _SEQUENT_\n# include <sys/types.h>\n# include <sys/utsname.h>\n#endif\nmain ()\n{\n#if defined (sony)\n#if defined (MIPSEB)\n  /* BFD wants \"bsd\" instead of \"newsos\".  Perhaps BFD should be changed,\n     I don't know....  */\n  printf (\"mips-sony-bsd\\n\"); exit (0);\n#else\n#include <sys/param.h>\n  printf (\"m68k-sony-newsos%s\\n\",\n#ifdef NEWSOS4\n          \"4\"\n#else\n\t  \"\"\n#endif\n         ); exit (0);\n#endif\n#endif\n\n#if defined (__arm) && defined (__acorn) && defined (__unix)\n  printf (\"arm-acorn-riscix\"); exit (0);\n#endif\n\n#if defined (hp300) && !defined (hpux)\n  printf (\"m68k-hp-bsd\\n\"); exit (0);\n#endif\n\n#if defined (NeXT)\n#if !defined (__ARCHITECTURE__)\n#define __ARCHITECTURE__ \"m68k\"\n#endif\n  int version;\n  version=`(hostinfo | sed -n 's/.*NeXT Mach \\([0-9]*\\).*/\\1/p') 2>/dev/null`;\n  if (version < 4)\n    printf (\"%s-next-nextstep%d\\n\", __ARCHITECTURE__, version);\n  else\n    printf (\"%s-next-openstep%d\\n\", __ARCHITECTURE__, version);\n  exit (0);\n#endif\n\n#if defined (MULTIMAX) || defined (n16)\n#if defined (UMAXV)\n  printf (\"ns32k-encore-sysv\\n\"); exit (0);\n#else\n#if defined (CMU)\n  printf (\"ns32k-encore-mach\\n\"); exit (0);\n#else\n  printf (\"ns32k-encore-bsd\\n\"); exit (0);\n#endif\n#endif\n#endif\n\n#if defined (__386BSD__)\n  printf (\"i386-pc-bsd\\n\"); exit (0);\n#endif\n\n#if defined (sequent)\n#if defined (i386)\n  printf (\"i386-sequent-dynix\\n\"); exit (0);\n#endif\n#if defined (ns32000)\n  printf (\"ns32k-sequent-dynix\\n\"); exit (0);\n#endif\n#endif\n\n#if defined (_SEQUENT_)\n    struct utsname un;\n\n    uname(&un);\n\n    if (strncmp(un.version, \"V2\", 2) == 0) {\n\tprintf (\"i386-sequent-ptx2\\n\"); exit (0);\n    }\n    if (strncmp(un.version, \"V1\", 2) == 0) { /* XXX is V1 correct? */\n\tprintf (\"i386-sequent-ptx1\\n\"); exit (0);\n    }\n    printf (\"i386-sequent-ptx\\n\"); exit (0);\n\n#endif\n\n#if defined (vax)\n# if !defined (ultrix)\n#  include <sys/param.h>\n#  if defined (BSD)\n#   if BSD == 43\n      printf (\"vax-dec-bsd4.3\\n\"); exit (0);\n#   else\n#    if BSD == 199006\n      printf (\"vax-dec-bsd4.3reno\\n\"); exit (0);\n#    else\n      printf (\"vax-dec-bsd\\n\"); exit (0);\n#    endif\n#   endif\n#  else\n    printf (\"vax-dec-bsd\\n\"); exit (0);\n#  endif\n# else\n    printf (\"vax-dec-ultrix\\n\"); exit (0);\n# endif\n#endif\n\n#if defined (alliant) && defined (i860)\n  printf (\"i860-alliant-bsd\\n\"); exit (0);\n#endif\n\n  exit (1);\n}\nEOF\n\n$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0\n\n# Apollos put the system type in the environment.\n\ntest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }\n\n# Convex versions that predate uname can use getsysinfo(1)\n\nif [ -x /usr/convex/getsysinfo ]\nthen\n    case `getsysinfo -f cpu_type` in\n    c1*)\n\techo c1-convex-bsd\n\texit 0 ;;\n    c2*)\n\tif getsysinfo -f scalar_acc\n\tthen echo c32-convex-bsd\n\telse echo c2-convex-bsd\n\tfi\n\texit 0 ;;\n    c34*)\n\techo c34-convex-bsd\n\texit 0 ;;\n    c38*)\n\techo c38-convex-bsd\n\texit 0 ;;\n    c4*)\n\techo c4-convex-bsd\n\texit 0 ;;\n    esac\nfi\n\ncat >&2 <<EOF\n$0: unable to guess system type\n\nThis script, last modified $timestamp, has failed to recognize\nthe operating system you are using. It is advised that you\ndownload the most up to date version of the config scripts from\n\n    ftp://ftp.gnu.org/pub/gnu/config/\n\nIf the version you run ($0) is already up to date, please\nsend the following data and any information you think might be\npertinent to <config-patches@gnu.org> in order to provide the needed\ninformation to handle your system.\n\nconfig.guess timestamp = $timestamp\n\nuname -m = `(uname -m) 2>/dev/null || echo unknown`\nuname -r = `(uname -r) 2>/dev/null || echo unknown`\nuname -s = `(uname -s) 2>/dev/null || echo unknown`\nuname -v = `(uname -v) 2>/dev/null || echo unknown`\n\n/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`\n/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`\n\nhostinfo               = `(hostinfo) 2>/dev/null`\n/bin/universe          = `(/bin/universe) 2>/dev/null`\n/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`\n/bin/arch              = `(/bin/arch) 2>/dev/null`\n/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`\n/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`\n\nUNAME_MACHINE = ${UNAME_MACHINE}\nUNAME_RELEASE = ${UNAME_RELEASE}\nUNAME_SYSTEM  = ${UNAME_SYSTEM}\nUNAME_VERSION = ${UNAME_VERSION}\nEOF\n\nexit 1\n\n# Local variables:\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"timestamp='\"\n# time-stamp-format: \"%:y-%02m-%02d\"\n# time-stamp-end: \"'\"\n# End:\n"
  },
  {
    "path": "ext/libjpeg-turbo/config.h",
    "content": "#define VERSION 1.3.1\r\n#define BUILD 0\r\n#define PACKAGE_NAME \"libjpeg-turbo\"\r\n\r\n#ifndef INLINE\r\n#if defined(__GNUC__)\r\n#define INLINE __attribute__((always_inline))\r\n#elif defined(_MSC_VER)\r\n#define INLINE __forceinline\r\n#else\r\n#define INLINE\r\n#endif\r\n#endif\r\n"
  },
  {
    "path": "ext/libjpeg-turbo/config.h.in",
    "content": "/* config.h.in.  Generated from configure.ac by autoheader.  */\n\n/* Build number */\n#undef BUILD\n\n/* Support arithmetic encoding */\n#undef C_ARITH_CODING_SUPPORTED\n\n/* Support arithmetic decoding */\n#undef D_ARITH_CODING_SUPPORTED\n\n/* Define to 1 if you have the <dlfcn.h> header file. */\n#undef HAVE_DLFCN_H\n\n/* Define to 1 if you have the <inttypes.h> header file. */\n#undef HAVE_INTTYPES_H\n\n/* Define to 1 if you have the <jni.h> header file. */\n#undef HAVE_JNI_H\n\n/* Define to 1 if you have the `memcpy' function. */\n#undef HAVE_MEMCPY\n\n/* Define to 1 if you have the <memory.h> header file. */\n#undef HAVE_MEMORY_H\n\n/* Define to 1 if you have the `memset' function. */\n#undef HAVE_MEMSET\n\n/* Define if your compiler supports prototypes */\n#undef HAVE_PROTOTYPES\n\n/* Define to 1 if you have the <stddef.h> header file. */\n#undef HAVE_STDDEF_H\n\n/* Define to 1 if you have the <stdint.h> header file. */\n#undef HAVE_STDINT_H\n\n/* Define to 1 if you have the <stdlib.h> header file. */\n#undef HAVE_STDLIB_H\n\n/* Define to 1 if you have the <strings.h> header file. */\n#undef HAVE_STRINGS_H\n\n/* Define to 1 if you have the <string.h> header file. */\n#undef HAVE_STRING_H\n\n/* Define to 1 if you have the <sys/stat.h> header file. */\n#undef HAVE_SYS_STAT_H\n\n/* Define to 1 if you have the <sys/types.h> header file. */\n#undef HAVE_SYS_TYPES_H\n\n/* Define to 1 if you have the <unistd.h> header file. */\n#undef HAVE_UNISTD_H\n\n/* Define to 1 if the system has the type `unsigned char'. */\n#undef HAVE_UNSIGNED_CHAR\n\n/* Define to 1 if the system has the type `unsigned short'. */\n#undef HAVE_UNSIGNED_SHORT\n\n/* Compiler does not support pointers to undefined structures. */\n#undef INCOMPLETE_TYPES_BROKEN\n\n/* How to obtain function inlining. */\n#undef INLINE\n\n/* libjpeg API version */\n#undef JPEG_LIB_VERSION\n\n/* libjpeg-turbo version */\n#undef LIBJPEG_TURBO_VERSION\n\n/* Support in-memory source/destination managers */\n#undef MEM_SRCDST_SUPPORTED\n\n/* Define if you have BSD-like bzero and bcopy */\n#undef NEED_BSD_STRINGS\n\n/* Define if you need short function names */\n#undef NEED_SHORT_EXTERNAL_NAMES\n\n/* Define if you have sys/types.h */\n#undef NEED_SYS_TYPES_H\n\n/* Define to 1 if your C compiler doesn't accept -c and -o together. */\n#undef NO_MINUS_C_MINUS_O\n\n/* Name of package */\n#undef PACKAGE\n\n/* Define to the address where bug reports for this package should be sent. */\n#undef PACKAGE_BUGREPORT\n\n/* Define to the full name of this package. */\n#undef PACKAGE_NAME\n\n/* Define to the full name and version of this package. */\n#undef PACKAGE_STRING\n\n/* Define to the one symbol short name of this package. */\n#undef PACKAGE_TARNAME\n\n/* Define to the version of this package. */\n#undef PACKAGE_VERSION\n\n/* Define if shift is unsigned */\n#undef RIGHT_SHIFT_IS_UNSIGNED\n\n/* The size of a `long', as computed by sizeof. */\n#undef SIZEOF_LONG\n\n/* Define to 1 if you have the ANSI C header files. */\n#undef STDC_HEADERS\n\n/* Version number of package */\n#undef VERSION\n\n/* Use accelerated SIMD routines. */\n#undef WITH_SIMD\n\n/* Define to 1 if type `char' is unsigned and you are not using gcc.  */\n#ifndef __CHAR_UNSIGNED__\n# undef __CHAR_UNSIGNED__\n#endif\n\n/* Define to empty if `const' does not conform to ANSI C. */\n#undef const\n\n/* Define to `__inline__' or `__inline' if that's what the C compiler\n   calls it, or to nothing if 'inline' is not supported under any name.  */\n#ifndef __cplusplus\n#undef inline\n#endif\n\n/* Define to `unsigned' if <sys/types.h> does not define. */\n#undef size_t\n"
  },
  {
    "path": "ext/libjpeg-turbo/config.sub",
    "content": "#! /bin/sh\n# Configuration validation subroutine script.\n#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,\n#   2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.\n\ntimestamp='2004-08-29'\n\n# This file is (in principle) common to ALL GNU software.\n# The presence of a machine in this file suggests that SOME GNU software\n# can handle that machine.  It does not imply ALL GNU software can.\n#\n# This file is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330,\n# Boston, MA 02111-1307, USA.\n\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that program.\n\n# Please send patches to <config-patches@gnu.org>.  Submit a context\n# diff and a properly formatted ChangeLog entry.\n#\n# Configuration subroutine to validate and canonicalize a configuration type.\n# Supply the specified configuration type as an argument.\n# If it is invalid, we print an error message on stderr and exit with code 1.\n# Otherwise, we print the canonical config type on stdout and succeed.\n\n# This file is supposed to be the same for all GNU packages\n# and recognize all the CPU types, system types and aliases\n# that are meaningful with *any* GNU software.\n# Each package is responsible for reporting which valid configurations\n# it does not support.  The user should be able to distinguish\n# a failure to support a valid configuration from a meaningless\n# configuration.\n\n# The goal of this file is to map all the various variations of a given\n# machine specification into a single specification in the form:\n#\tCPU_TYPE-MANUFACTURER-OPERATING_SYSTEM\n# or in some cases, the newer four-part form:\n#\tCPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM\n# It is wrong to echo any other type of specification.\n\nme=`echo \"$0\" | sed -e 's,.*/,,'`\n\nusage=\"\\\nUsage: $0 [OPTION] CPU-MFR-OPSYS\n       $0 [OPTION] ALIAS\n\nCanonicalize a configuration name.\n\nOperation modes:\n  -h, --help         print this help, then exit\n  -t, --time-stamp   print date of last modification, then exit\n  -v, --version      print version number, then exit\n\nReport bugs and patches to <config-patches@gnu.org>.\"\n\nversion=\"\\\nGNU config.sub ($timestamp)\n\nCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004\nFree Software Foundation, Inc.\n\nThis is free software; see the source for copying conditions.  There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\"\n\nhelp=\"\nTry \\`$me --help' for more information.\"\n\n# Parse command line\nwhile test $# -gt 0 ; do\n  case $1 in\n    --time-stamp | --time* | -t )\n       echo \"$timestamp\" ; exit 0 ;;\n    --version | -v )\n       echo \"$version\" ; exit 0 ;;\n    --help | --h* | -h )\n       echo \"$usage\"; exit 0 ;;\n    -- )     # Stop option processing\n       shift; break ;;\n    - )\t# Use stdin as input.\n       break ;;\n    -* )\n       echo \"$me: invalid option $1$help\"\n       exit 1 ;;\n\n    *local*)\n       # First pass through any local machine types.\n       echo $1\n       exit 0;;\n\n    * )\n       break ;;\n  esac\ndone\n\ncase $# in\n 0) echo \"$me: missing argument$help\" >&2\n    exit 1;;\n 1) ;;\n *) echo \"$me: too many arguments$help\" >&2\n    exit 1;;\nesac\n\n# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).\n# Here we must recognize all the valid KERNEL-OS combinations.\nmaybe_os=`echo $1 | sed 's/^\\(.*\\)-\\([^-]*-[^-]*\\)$/\\2/'`\ncase $maybe_os in\n  nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \\\n  kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)\n    os=-$maybe_os\n    basic_machine=`echo $1 | sed 's/^\\(.*\\)-\\([^-]*-[^-]*\\)$/\\1/'`\n    ;;\n  *)\n    basic_machine=`echo $1 | sed 's/-[^-]*$//'`\n    if [ $basic_machine != $1 ]\n    then os=`echo $1 | sed 's/.*-/-/'`\n    else os=; fi\n    ;;\nesac\n\n### Let's recognize common machines as not being operating systems so\n### that things like config.sub decstation-3100 work.  We also\n### recognize some manufacturers as not being operating systems, so we\n### can provide default operating systems below.\ncase $os in\n\t-sun*os*)\n\t\t# Prevent following clause from handling this invalid input.\n\t\t;;\n\t-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \\\n\t-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \\\n\t-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \\\n\t-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\\\n\t-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \\\n\t-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \\\n\t-apple | -axis | -knuth | -cray)\n\t\tos=\n\t\tbasic_machine=$1\n\t\t;;\n\t-sim | -cisco | -oki | -wec | -winbond)\n\t\tos=\n\t\tbasic_machine=$1\n\t\t;;\n\t-scout)\n\t\t;;\n\t-wrs)\n\t\tos=-vxworks\n\t\tbasic_machine=$1\n\t\t;;\n\t-chorusos*)\n\t\tos=-chorusos\n\t\tbasic_machine=$1\n\t\t;;\n \t-chorusrdb)\n \t\tos=-chorusrdb\n\t\tbasic_machine=$1\n \t\t;;\n\t-hiux*)\n\t\tos=-hiuxwe2\n\t\t;;\n\t-sco5)\n\t\tos=-sco3.2v5\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco4)\n\t\tos=-sco3.2v4\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco3.2.[4-9]*)\n\t\tos=`echo $os | sed -e 's/sco3.2./sco3.2v/'`\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco3.2v[4-9]*)\n\t\t# Don't forget version if it is 3.2v4 or newer.\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco*)\n\t\tos=-sco3.2v2\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-udk*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-isc)\n\t\tos=-isc2.2\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-clix*)\n\t\tbasic_machine=clipper-intergraph\n\t\t;;\n\t-isc*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-lynx*)\n\t\tos=-lynxos\n\t\t;;\n\t-ptx*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`\n\t\t;;\n\t-windowsnt*)\n\t\tos=`echo $os | sed -e 's/windowsnt/winnt/'`\n\t\t;;\n\t-psos*)\n\t\tos=-psos\n\t\t;;\n\t-mint | -mint[0-9]*)\n\t\tbasic_machine=m68k-atari\n\t\tos=-mint\n\t\t;;\nesac\n\n# Decode aliases for certain CPU-COMPANY combinations.\ncase $basic_machine in\n\t# Recognize the basic CPU types without company name.\n\t# Some are omitted here because they have special meanings below.\n\t1750a | 580 \\\n\t| a29k \\\n\t| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \\\n\t| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \\\n\t| am33_2.0 \\\n\t| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \\\n\t| c4x | clipper \\\n\t| d10v | d30v | dlx | dsp16xx \\\n\t| fr30 | frv \\\n\t| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \\\n\t| i370 | i860 | i960 | ia64 \\\n\t| ip2k | iq2000 \\\n\t| m32r | m32rle | m68000 | m68k | m88k | mcore \\\n\t| mips | mipsbe | mipseb | mipsel | mipsle \\\n\t| mips16 \\\n\t| mips64 | mips64el \\\n\t| mips64vr | mips64vrel \\\n\t| mips64orion | mips64orionel \\\n\t| mips64vr4100 | mips64vr4100el \\\n\t| mips64vr4300 | mips64vr4300el \\\n\t| mips64vr5000 | mips64vr5000el \\\n\t| mipsisa32 | mipsisa32el \\\n\t| mipsisa32r2 | mipsisa32r2el \\\n\t| mipsisa64 | mipsisa64el \\\n\t| mipsisa64r2 | mipsisa64r2el \\\n\t| mipsisa64sb1 | mipsisa64sb1el \\\n\t| mipsisa64sr71k | mipsisa64sr71kel \\\n\t| mipstx39 | mipstx39el \\\n\t| mn10200 | mn10300 \\\n\t| msp430 \\\n\t| ns16k | ns32k \\\n\t| openrisc | or32 \\\n\t| pdp10 | pdp11 | pj | pjl \\\n\t| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \\\n\t| pyramid \\\n\t| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \\\n\t| sh64 | sh64le \\\n\t| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \\\n\t| strongarm \\\n\t| tahoe | thumb | tic4x | tic80 | tron \\\n\t| v850 | v850e \\\n\t| we32k \\\n\t| x86 | xscale | xstormy16 | xtensa \\\n\t| z8k)\n\t\tbasic_machine=$basic_machine-unknown\n\t\t;;\n\tm6811 | m68hc11 | m6812 | m68hc12)\n\t\t# Motorola 68HC11/12.\n\t\tbasic_machine=$basic_machine-unknown\n\t\tos=-none\n\t\t;;\n\tm88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)\n\t\t;;\n\n\t# We use `pc' rather than `unknown'\n\t# because (1) that's what they normally are, and\n\t# (2) the word \"unknown\" tends to confuse beginning users.\n\ti*86 | x86_64)\n\t  basic_machine=$basic_machine-pc\n\t  ;;\n\t# Object if more than one company name word.\n\t*-*-*)\n\t\techo Invalid configuration \\`$1\\': machine \\`$basic_machine\\' not recognized 1>&2\n\t\texit 1\n\t\t;;\n\t# Recognize the basic CPU types with company name.\n\t580-* \\\n\t| a29k-* \\\n\t| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \\\n\t| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \\\n\t| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \\\n\t| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \\\n\t| avr-* \\\n\t| bs2000-* \\\n\t| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \\\n\t| clipper-* | craynv-* | cydra-* \\\n\t| d10v-* | d30v-* | dlx-* \\\n\t| elxsi-* \\\n\t| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \\\n\t| h8300-* | h8500-* \\\n\t| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \\\n\t| i*86-* | i860-* | i960-* | ia64-* \\\n\t| ip2k-* | iq2000-* \\\n\t| m32r-* | m32rle-* \\\n\t| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \\\n\t| m88110-* | m88k-* | mcore-* \\\n\t| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \\\n\t| mips16-* \\\n\t| mips64-* | mips64el-* \\\n\t| mips64vr-* | mips64vrel-* \\\n\t| mips64orion-* | mips64orionel-* \\\n\t| mips64vr4100-* | mips64vr4100el-* \\\n\t| mips64vr4300-* | mips64vr4300el-* \\\n\t| mips64vr5000-* | mips64vr5000el-* \\\n\t| mipsisa32-* | mipsisa32el-* \\\n\t| mipsisa32r2-* | mipsisa32r2el-* \\\n\t| mipsisa64-* | mipsisa64el-* \\\n\t| mipsisa64r2-* | mipsisa64r2el-* \\\n\t| mipsisa64sb1-* | mipsisa64sb1el-* \\\n\t| mipsisa64sr71k-* | mipsisa64sr71kel-* \\\n\t| mipstx39-* | mipstx39el-* \\\n\t| mmix-* \\\n\t| msp430-* \\\n\t| none-* | np1-* | ns16k-* | ns32k-* \\\n\t| orion-* \\\n\t| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \\\n\t| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \\\n\t| pyramid-* \\\n\t| romp-* | rs6000-* \\\n\t| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \\\n\t| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \\\n\t| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \\\n\t| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \\\n\t| tahoe-* | thumb-* \\\n\t| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \\\n\t| tron-* \\\n\t| v850-* | v850e-* | vax-* \\\n\t| we32k-* \\\n\t| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \\\n\t| xtensa-* \\\n\t| ymp-* \\\n\t| z8k-*)\n\t\t;;\n\t# Recognize the various machine names and aliases which stand\n\t# for a CPU type and a company and sometimes even an OS.\n\t386bsd)\n\t\tbasic_machine=i386-unknown\n\t\tos=-bsd\n\t\t;;\n\t3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)\n\t\tbasic_machine=m68000-att\n\t\t;;\n\t3b*)\n\t\tbasic_machine=we32k-att\n\t\t;;\n\ta29khif)\n\t\tbasic_machine=a29k-amd\n\t\tos=-udi\n\t\t;;\n    \tabacus)\n\t\tbasic_machine=abacus-unknown\n\t\t;;\n\tadobe68k)\n\t\tbasic_machine=m68010-adobe\n\t\tos=-scout\n\t\t;;\n\talliant | fx80)\n\t\tbasic_machine=fx80-alliant\n\t\t;;\n\taltos | altos3068)\n\t\tbasic_machine=m68k-altos\n\t\t;;\n\tam29k)\n\t\tbasic_machine=a29k-none\n\t\tos=-bsd\n\t\t;;\n\tamd64)\n\t\tbasic_machine=x86_64-pc\n\t\t;;\n\tamd64-*)\n\t\tbasic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tamdahl)\n\t\tbasic_machine=580-amdahl\n\t\tos=-sysv\n\t\t;;\n\tamiga | amiga-*)\n\t\tbasic_machine=m68k-unknown\n\t\t;;\n\tamigaos | amigados)\n\t\tbasic_machine=m68k-unknown\n\t\tos=-amigaos\n\t\t;;\n\tamigaunix | amix)\n\t\tbasic_machine=m68k-unknown\n\t\tos=-sysv4\n\t\t;;\n\tapollo68)\n\t\tbasic_machine=m68k-apollo\n\t\tos=-sysv\n\t\t;;\n\tapollo68bsd)\n\t\tbasic_machine=m68k-apollo\n\t\tos=-bsd\n\t\t;;\n\taux)\n\t\tbasic_machine=m68k-apple\n\t\tos=-aux\n\t\t;;\n\tbalance)\n\t\tbasic_machine=ns32k-sequent\n\t\tos=-dynix\n\t\t;;\n\tc90)\n\t\tbasic_machine=c90-cray\n\t\tos=-unicos\n\t\t;;\n\tconvex-c1)\n\t\tbasic_machine=c1-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c2)\n\t\tbasic_machine=c2-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c32)\n\t\tbasic_machine=c32-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c34)\n\t\tbasic_machine=c34-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c38)\n\t\tbasic_machine=c38-convex\n\t\tos=-bsd\n\t\t;;\n\tcray | j90)\n\t\tbasic_machine=j90-cray\n\t\tos=-unicos\n\t\t;;\n\tcraynv)\n\t\tbasic_machine=craynv-cray\n\t\tos=-unicosmp\n\t\t;;\n\tcr16c)\n\t\tbasic_machine=cr16c-unknown\n\t\tos=-elf\n\t\t;;\n\tcrds | unos)\n\t\tbasic_machine=m68k-crds\n\t\t;;\n\tcrisv32 | crisv32-* | etraxfs*)\n\t\tbasic_machine=crisv32-axis\n\t\t;;\n\tcris | cris-* | etrax*)\n\t\tbasic_machine=cris-axis\n\t\t;;\n\tcrx)\n\t\tbasic_machine=crx-unknown\n\t\tos=-elf\n\t\t;;\n\tda30 | da30-*)\n\t\tbasic_machine=m68k-da30\n\t\t;;\n\tdecstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)\n\t\tbasic_machine=mips-dec\n\t\t;;\n\tdecsystem10* | dec10*)\n\t\tbasic_machine=pdp10-dec\n\t\tos=-tops10\n\t\t;;\n\tdecsystem20* | dec20*)\n\t\tbasic_machine=pdp10-dec\n\t\tos=-tops20\n\t\t;;\n\tdelta | 3300 | motorola-3300 | motorola-delta \\\n\t      | 3300-motorola | delta-motorola)\n\t\tbasic_machine=m68k-motorola\n\t\t;;\n\tdelta88)\n\t\tbasic_machine=m88k-motorola\n\t\tos=-sysv3\n\t\t;;\n\tdpx20 | dpx20-*)\n\t\tbasic_machine=rs6000-bull\n\t\tos=-bosx\n\t\t;;\n\tdpx2* | dpx2*-bull)\n\t\tbasic_machine=m68k-bull\n\t\tos=-sysv3\n\t\t;;\n\tebmon29k)\n\t\tbasic_machine=a29k-amd\n\t\tos=-ebmon\n\t\t;;\n\telxsi)\n\t\tbasic_machine=elxsi-elxsi\n\t\tos=-bsd\n\t\t;;\n\tencore | umax | mmax)\n\t\tbasic_machine=ns32k-encore\n\t\t;;\n\tes1800 | OSE68k | ose68k | ose | OSE)\n\t\tbasic_machine=m68k-ericsson\n\t\tos=-ose\n\t\t;;\n\tfx2800)\n\t\tbasic_machine=i860-alliant\n\t\t;;\n\tgenix)\n\t\tbasic_machine=ns32k-ns\n\t\t;;\n\tgmicro)\n\t\tbasic_machine=tron-gmicro\n\t\tos=-sysv\n\t\t;;\n\tgo32)\n\t\tbasic_machine=i386-pc\n\t\tos=-go32\n\t\t;;\n\th3050r* | hiux*)\n\t\tbasic_machine=hppa1.1-hitachi\n\t\tos=-hiuxwe2\n\t\t;;\n\th8300hms)\n\t\tbasic_machine=h8300-hitachi\n\t\tos=-hms\n\t\t;;\n\th8300xray)\n\t\tbasic_machine=h8300-hitachi\n\t\tos=-xray\n\t\t;;\n\th8500hms)\n\t\tbasic_machine=h8500-hitachi\n\t\tos=-hms\n\t\t;;\n\tharris)\n\t\tbasic_machine=m88k-harris\n\t\tos=-sysv3\n\t\t;;\n\thp300-*)\n\t\tbasic_machine=m68k-hp\n\t\t;;\n\thp300bsd)\n\t\tbasic_machine=m68k-hp\n\t\tos=-bsd\n\t\t;;\n\thp300hpux)\n\t\tbasic_machine=m68k-hp\n\t\tos=-hpux\n\t\t;;\n\thp3k9[0-9][0-9] | hp9[0-9][0-9])\n\t\tbasic_machine=hppa1.0-hp\n\t\t;;\n\thp9k2[0-9][0-9] | hp9k31[0-9])\n\t\tbasic_machine=m68000-hp\n\t\t;;\n\thp9k3[2-9][0-9])\n\t\tbasic_machine=m68k-hp\n\t\t;;\n\thp9k6[0-9][0-9] | hp6[0-9][0-9])\n\t\tbasic_machine=hppa1.0-hp\n\t\t;;\n\thp9k7[0-79][0-9] | hp7[0-79][0-9])\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k78[0-9] | hp78[0-9])\n\t\t# FIXME: really hppa2.0-hp\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)\n\t\t# FIXME: really hppa2.0-hp\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k8[0-9][13679] | hp8[0-9][13679])\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k8[0-9][0-9] | hp8[0-9][0-9])\n\t\tbasic_machine=hppa1.0-hp\n\t\t;;\n\thppa-next)\n\t\tos=-nextstep3\n\t\t;;\n\thppaosf)\n\t\tbasic_machine=hppa1.1-hp\n\t\tos=-osf\n\t\t;;\n\thppro)\n\t\tbasic_machine=hppa1.1-hp\n\t\tos=-proelf\n\t\t;;\n\ti370-ibm* | ibm*)\n\t\tbasic_machine=i370-ibm\n\t\t;;\n# I'm not sure what \"Sysv32\" means.  Should this be sysv3.2?\n\ti*86v32)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-sysv32\n\t\t;;\n\ti*86v4*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-sysv4\n\t\t;;\n\ti*86v)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-sysv\n\t\t;;\n\ti*86sol2)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-solaris2\n\t\t;;\n\ti386mach)\n\t\tbasic_machine=i386-mach\n\t\tos=-mach\n\t\t;;\n\ti386-vsta | vsta)\n\t\tbasic_machine=i386-unknown\n\t\tos=-vsta\n\t\t;;\n\tiris | iris4d)\n\t\tbasic_machine=mips-sgi\n\t\tcase $os in\n\t\t    -irix*)\n\t\t\t;;\n\t\t    *)\n\t\t\tos=-irix4\n\t\t\t;;\n\t\tesac\n\t\t;;\n\tisi68 | isi)\n\t\tbasic_machine=m68k-isi\n\t\tos=-sysv\n\t\t;;\n\tm88k-omron*)\n\t\tbasic_machine=m88k-omron\n\t\t;;\n\tmagnum | m3230)\n\t\tbasic_machine=mips-mips\n\t\tos=-sysv\n\t\t;;\n\tmerlin)\n\t\tbasic_machine=ns32k-utek\n\t\tos=-sysv\n\t\t;;\n\tmingw32)\n\t\tbasic_machine=i386-pc\n\t\tos=-mingw32\n\t\t;;\n\tminiframe)\n\t\tbasic_machine=m68000-convergent\n\t\t;;\n\t*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)\n\t\tbasic_machine=m68k-atari\n\t\tos=-mint\n\t\t;;\n\tmips3*-*)\n\t\tbasic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`\n\t\t;;\n\tmips3*)\n\t\tbasic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown\n\t\t;;\n\tmonitor)\n\t\tbasic_machine=m68k-rom68k\n\t\tos=-coff\n\t\t;;\n\tmorphos)\n\t\tbasic_machine=powerpc-unknown\n\t\tos=-morphos\n\t\t;;\n\tmsdos)\n\t\tbasic_machine=i386-pc\n\t\tos=-msdos\n\t\t;;\n\tmvs)\n\t\tbasic_machine=i370-ibm\n\t\tos=-mvs\n\t\t;;\n\tncr3000)\n\t\tbasic_machine=i486-ncr\n\t\tos=-sysv4\n\t\t;;\n\tnetbsd386)\n\t\tbasic_machine=i386-unknown\n\t\tos=-netbsd\n\t\t;;\n\tnetwinder)\n\t\tbasic_machine=armv4l-rebel\n\t\tos=-linux\n\t\t;;\n\tnews | news700 | news800 | news900)\n\t\tbasic_machine=m68k-sony\n\t\tos=-newsos\n\t\t;;\n\tnews1000)\n\t\tbasic_machine=m68030-sony\n\t\tos=-newsos\n\t\t;;\n\tnews-3600 | risc-news)\n\t\tbasic_machine=mips-sony\n\t\tos=-newsos\n\t\t;;\n\tnecv70)\n\t\tbasic_machine=v70-nec\n\t\tos=-sysv\n\t\t;;\n\tnext | m*-next )\n\t\tbasic_machine=m68k-next\n\t\tcase $os in\n\t\t    -nextstep* )\n\t\t\t;;\n\t\t    -ns2*)\n\t\t      os=-nextstep2\n\t\t\t;;\n\t\t    *)\n\t\t      os=-nextstep3\n\t\t\t;;\n\t\tesac\n\t\t;;\n\tnh3000)\n\t\tbasic_machine=m68k-harris\n\t\tos=-cxux\n\t\t;;\n\tnh[45]000)\n\t\tbasic_machine=m88k-harris\n\t\tos=-cxux\n\t\t;;\n\tnindy960)\n\t\tbasic_machine=i960-intel\n\t\tos=-nindy\n\t\t;;\n\tmon960)\n\t\tbasic_machine=i960-intel\n\t\tos=-mon960\n\t\t;;\n\tnonstopux)\n\t\tbasic_machine=mips-compaq\n\t\tos=-nonstopux\n\t\t;;\n\tnp1)\n\t\tbasic_machine=np1-gould\n\t\t;;\n\tnsr-tandem)\n\t\tbasic_machine=nsr-tandem\n\t\t;;\n\top50n-* | op60c-*)\n\t\tbasic_machine=hppa1.1-oki\n\t\tos=-proelf\n\t\t;;\n\tor32 | or32-*)\n\t\tbasic_machine=or32-unknown\n\t\tos=-coff\n\t\t;;\n\tos400)\n\t\tbasic_machine=powerpc-ibm\n\t\tos=-os400\n\t\t;;\n\tOSE68000 | ose68000)\n\t\tbasic_machine=m68000-ericsson\n\t\tos=-ose\n\t\t;;\n\tos68k)\n\t\tbasic_machine=m68k-none\n\t\tos=-os68k\n\t\t;;\n\tpa-hitachi)\n\t\tbasic_machine=hppa1.1-hitachi\n\t\tos=-hiuxwe2\n\t\t;;\n\tparagon)\n\t\tbasic_machine=i860-intel\n\t\tos=-osf\n\t\t;;\n\tpbd)\n\t\tbasic_machine=sparc-tti\n\t\t;;\n\tpbb)\n\t\tbasic_machine=m68k-tti\n\t\t;;\n\tpc532 | pc532-*)\n\t\tbasic_machine=ns32k-pc532\n\t\t;;\n\tpentium | p5 | k5 | k6 | nexgen | viac3)\n\t\tbasic_machine=i586-pc\n\t\t;;\n\tpentiumpro | p6 | 6x86 | athlon | athlon_*)\n\t\tbasic_machine=i686-pc\n\t\t;;\n\tpentiumii | pentium2 | pentiumiii | pentium3)\n\t\tbasic_machine=i686-pc\n\t\t;;\n\tpentium4)\n\t\tbasic_machine=i786-pc\n\t\t;;\n\tpentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)\n\t\tbasic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentiumpro-* | p6-* | 6x86-* | athlon-*)\n\t\tbasic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)\n\t\tbasic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentium4-*)\n\t\tbasic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpn)\n\t\tbasic_machine=pn-gould\n\t\t;;\n\tpower)\tbasic_machine=power-ibm\n\t\t;;\n\tppc)\tbasic_machine=powerpc-unknown\n\t\t;;\n\tppc-*)\tbasic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tppcle | powerpclittle | ppc-le | powerpc-little)\n\t\tbasic_machine=powerpcle-unknown\n\t\t;;\n\tppcle-* | powerpclittle-*)\n\t\tbasic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tppc64)\tbasic_machine=powerpc64-unknown\n\t\t;;\n\tppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tppc64le | powerpc64little | ppc64-le | powerpc64-little)\n\t\tbasic_machine=powerpc64le-unknown\n\t\t;;\n\tppc64le-* | powerpc64little-*)\n\t\tbasic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tps2)\n\t\tbasic_machine=i386-ibm\n\t\t;;\n\tpw32)\n\t\tbasic_machine=i586-unknown\n\t\tos=-pw32\n\t\t;;\n\trom68k)\n\t\tbasic_machine=m68k-rom68k\n\t\tos=-coff\n\t\t;;\n\trm[46]00)\n\t\tbasic_machine=mips-siemens\n\t\t;;\n\trtpc | rtpc-*)\n\t\tbasic_machine=romp-ibm\n\t\t;;\n\ts390 | s390-*)\n\t\tbasic_machine=s390-ibm\n\t\t;;\n\ts390x | s390x-*)\n\t\tbasic_machine=s390x-ibm\n\t\t;;\n\tsa29200)\n\t\tbasic_machine=a29k-amd\n\t\tos=-udi\n\t\t;;\n\tsb1)\n\t\tbasic_machine=mipsisa64sb1-unknown\n\t\t;;\n\tsb1el)\n\t\tbasic_machine=mipsisa64sb1el-unknown\n\t\t;;\n\tsei)\n\t\tbasic_machine=mips-sei\n\t\tos=-seiux\n\t\t;;\n\tsequent)\n\t\tbasic_machine=i386-sequent\n\t\t;;\n\tsh)\n\t\tbasic_machine=sh-hitachi\n\t\tos=-hms\n\t\t;;\n\tsh64)\n\t\tbasic_machine=sh64-unknown\n\t\t;;\n\tsparclite-wrs | simso-wrs)\n\t\tbasic_machine=sparclite-wrs\n\t\tos=-vxworks\n\t\t;;\n\tsps7)\n\t\tbasic_machine=m68k-bull\n\t\tos=-sysv2\n\t\t;;\n\tspur)\n\t\tbasic_machine=spur-unknown\n\t\t;;\n\tst2000)\n\t\tbasic_machine=m68k-tandem\n\t\t;;\n\tstratus)\n\t\tbasic_machine=i860-stratus\n\t\tos=-sysv4\n\t\t;;\n\tsun2)\n\t\tbasic_machine=m68000-sun\n\t\t;;\n\tsun2os3)\n\t\tbasic_machine=m68000-sun\n\t\tos=-sunos3\n\t\t;;\n\tsun2os4)\n\t\tbasic_machine=m68000-sun\n\t\tos=-sunos4\n\t\t;;\n\tsun3os3)\n\t\tbasic_machine=m68k-sun\n\t\tos=-sunos3\n\t\t;;\n\tsun3os4)\n\t\tbasic_machine=m68k-sun\n\t\tos=-sunos4\n\t\t;;\n\tsun4os3)\n\t\tbasic_machine=sparc-sun\n\t\tos=-sunos3\n\t\t;;\n\tsun4os4)\n\t\tbasic_machine=sparc-sun\n\t\tos=-sunos4\n\t\t;;\n\tsun4sol2)\n\t\tbasic_machine=sparc-sun\n\t\tos=-solaris2\n\t\t;;\n\tsun3 | sun3-*)\n\t\tbasic_machine=m68k-sun\n\t\t;;\n\tsun4)\n\t\tbasic_machine=sparc-sun\n\t\t;;\n\tsun386 | sun386i | roadrunner)\n\t\tbasic_machine=i386-sun\n\t\t;;\n\tsv1)\n\t\tbasic_machine=sv1-cray\n\t\tos=-unicos\n\t\t;;\n\tsymmetry)\n\t\tbasic_machine=i386-sequent\n\t\tos=-dynix\n\t\t;;\n\tt3e)\n\t\tbasic_machine=alphaev5-cray\n\t\tos=-unicos\n\t\t;;\n\tt90)\n\t\tbasic_machine=t90-cray\n\t\tos=-unicos\n\t\t;;\n\ttic54x | c54x*)\n\t\tbasic_machine=tic54x-unknown\n\t\tos=-coff\n\t\t;;\n\ttic55x | c55x*)\n\t\tbasic_machine=tic55x-unknown\n\t\tos=-coff\n\t\t;;\n\ttic6x | c6x*)\n\t\tbasic_machine=tic6x-unknown\n\t\tos=-coff\n\t\t;;\n\ttx39)\n\t\tbasic_machine=mipstx39-unknown\n\t\t;;\n\ttx39el)\n\t\tbasic_machine=mipstx39el-unknown\n\t\t;;\n\ttoad1)\n\t\tbasic_machine=pdp10-xkl\n\t\tos=-tops20\n\t\t;;\n\ttower | tower-32)\n\t\tbasic_machine=m68k-ncr\n\t\t;;\n\ttpf)\n\t\tbasic_machine=s390x-ibm\n\t\tos=-tpf\n\t\t;;\n\tudi29k)\n\t\tbasic_machine=a29k-amd\n\t\tos=-udi\n\t\t;;\n\tultra3)\n\t\tbasic_machine=a29k-nyu\n\t\tos=-sym1\n\t\t;;\n\tv810 | necv810)\n\t\tbasic_machine=v810-nec\n\t\tos=-none\n\t\t;;\n\tvaxv)\n\t\tbasic_machine=vax-dec\n\t\tos=-sysv\n\t\t;;\n\tvms)\n\t\tbasic_machine=vax-dec\n\t\tos=-vms\n\t\t;;\n\tvpp*|vx|vx-*)\n\t\tbasic_machine=f301-fujitsu\n\t\t;;\n\tvxworks960)\n\t\tbasic_machine=i960-wrs\n\t\tos=-vxworks\n\t\t;;\n\tvxworks68)\n\t\tbasic_machine=m68k-wrs\n\t\tos=-vxworks\n\t\t;;\n\tvxworks29k)\n\t\tbasic_machine=a29k-wrs\n\t\tos=-vxworks\n\t\t;;\n\tw65*)\n\t\tbasic_machine=w65-wdc\n\t\tos=-none\n\t\t;;\n\tw89k-*)\n\t\tbasic_machine=hppa1.1-winbond\n\t\tos=-proelf\n\t\t;;\n\txps | xps100)\n\t\tbasic_machine=xps100-honeywell\n\t\t;;\n\tymp)\n\t\tbasic_machine=ymp-cray\n\t\tos=-unicos\n\t\t;;\n\tz8k-*-coff)\n\t\tbasic_machine=z8k-unknown\n\t\tos=-sim\n\t\t;;\n\tnone)\n\t\tbasic_machine=none-none\n\t\tos=-none\n\t\t;;\n\n# Here we handle the default manufacturer of certain CPU types.  It is in\n# some cases the only manufacturer, in others, it is the most popular.\n\tw89k)\n\t\tbasic_machine=hppa1.1-winbond\n\t\t;;\n\top50n)\n\t\tbasic_machine=hppa1.1-oki\n\t\t;;\n\top60c)\n\t\tbasic_machine=hppa1.1-oki\n\t\t;;\n\tromp)\n\t\tbasic_machine=romp-ibm\n\t\t;;\n\tmmix)\n\t\tbasic_machine=mmix-knuth\n\t\t;;\n\trs6000)\n\t\tbasic_machine=rs6000-ibm\n\t\t;;\n\tvax)\n\t\tbasic_machine=vax-dec\n\t\t;;\n\tpdp10)\n\t\t# there are many clones, so DEC is not a safe bet\n\t\tbasic_machine=pdp10-unknown\n\t\t;;\n\tpdp11)\n\t\tbasic_machine=pdp11-dec\n\t\t;;\n\twe32k)\n\t\tbasic_machine=we32k-att\n\t\t;;\n\tsh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)\n\t\tbasic_machine=sh-unknown\n\t\t;;\n\tsh64)\n\t\tbasic_machine=sh64-unknown\n\t\t;;\n\tsparc | sparcv8 | sparcv9 | sparcv9b)\n\t\tbasic_machine=sparc-sun\n\t\t;;\n\tcydra)\n\t\tbasic_machine=cydra-cydrome\n\t\t;;\n\torion)\n\t\tbasic_machine=orion-highlevel\n\t\t;;\n\torion105)\n\t\tbasic_machine=clipper-highlevel\n\t\t;;\n\tmac | mpw | mac-mpw)\n\t\tbasic_machine=m68k-apple\n\t\t;;\n\tpmac | pmac-mpw)\n\t\tbasic_machine=powerpc-apple\n\t\t;;\n\t*-unknown)\n\t\t# Make sure to match an already-canonicalized machine name.\n\t\t;;\n\t*)\n\t\techo Invalid configuration \\`$1\\': machine \\`$basic_machine\\' not recognized 1>&2\n\t\texit 1\n\t\t;;\nesac\n\n# Here we canonicalize certain aliases for manufacturers.\ncase $basic_machine in\n\t*-digital*)\n\t\tbasic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`\n\t\t;;\n\t*-commodore*)\n\t\tbasic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`\n\t\t;;\n\t*)\n\t\t;;\nesac\n\n# Decode manufacturer-specific aliases for certain operating systems.\n\nif [ x\"$os\" != x\"\" ]\nthen\ncase $os in\n        # First match some system type aliases\n        # that might get confused with valid system types.\n\t# -solaris* is a basic system type, with this one exception.\n\t-solaris1 | -solaris1.*)\n\t\tos=`echo $os | sed -e 's|solaris1|sunos4|'`\n\t\t;;\n\t-solaris)\n\t\tos=-solaris2\n\t\t;;\n\t-svr4*)\n\t\tos=-sysv4\n\t\t;;\n\t-unixware*)\n\t\tos=-sysv4.2uw\n\t\t;;\n\t-gnu/linux*)\n\t\tos=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`\n\t\t;;\n\t# First accept the basic system types.\n\t# The portable systems comes first.\n\t# Each alternative MUST END IN A *, to match a version number.\n\t# -sysv* is not here because it comes later, after sysvr4.\n\t-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \\\n\t      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\\\n\t      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \\\n\t      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \\\n\t      | -aos* \\\n\t      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \\\n\t      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \\\n\t      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \\\n\t      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \\\n\t      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \\\n\t      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \\\n\t      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \\\n\t      | -chorusos* | -chorusrdb* \\\n\t      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \\\n\t      | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \\\n\t      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \\\n\t      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \\\n\t      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \\\n\t      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \\\n\t      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \\\n\t      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)\n\t# Remember, each alternative MUST END IN *, to match a version number.\n\t\t;;\n\t-qnx*)\n\t\tcase $basic_machine in\n\t\t    x86-* | i*86-*)\n\t\t\t;;\n\t\t    *)\n\t\t\tos=-nto$os\n\t\t\t;;\n\t\tesac\n\t\t;;\n\t-nto-qnx*)\n\t\t;;\n\t-nto*)\n\t\tos=`echo $os | sed -e 's|nto|nto-qnx|'`\n\t\t;;\n\t-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \\\n\t      | -windows* | -osx | -abug | -netware* | -os9* | -beos* \\\n\t      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)\n\t\t;;\n\t-mac*)\n\t\tos=`echo $os | sed -e 's|mac|macos|'`\n\t\t;;\n\t-linux-dietlibc)\n\t\tos=-linux-dietlibc\n\t\t;;\n\t-linux*)\n\t\tos=`echo $os | sed -e 's|linux|linux-gnu|'`\n\t\t;;\n\t-sunos5*)\n\t\tos=`echo $os | sed -e 's|sunos5|solaris2|'`\n\t\t;;\n\t-sunos6*)\n\t\tos=`echo $os | sed -e 's|sunos6|solaris3|'`\n\t\t;;\n\t-opened*)\n\t\tos=-openedition\n\t\t;;\n        -os400*)\n\t\tos=-os400\n\t\t;;\n\t-wince*)\n\t\tos=-wince\n\t\t;;\n\t-osfrose*)\n\t\tos=-osfrose\n\t\t;;\n\t-osf*)\n\t\tos=-osf\n\t\t;;\n\t-utek*)\n\t\tos=-bsd\n\t\t;;\n\t-dynix*)\n\t\tos=-bsd\n\t\t;;\n\t-acis*)\n\t\tos=-aos\n\t\t;;\n\t-atheos*)\n\t\tos=-atheos\n\t\t;;\n\t-syllable*)\n\t\tos=-syllable\n\t\t;;\n\t-386bsd)\n\t\tos=-bsd\n\t\t;;\n\t-ctix* | -uts*)\n\t\tos=-sysv\n\t\t;;\n\t-nova*)\n\t\tos=-rtmk-nova\n\t\t;;\n\t-ns2 )\n\t\tos=-nextstep2\n\t\t;;\n\t-nsk*)\n\t\tos=-nsk\n\t\t;;\n\t# Preserve the version number of sinix5.\n\t-sinix5.*)\n\t\tos=`echo $os | sed -e 's|sinix|sysv|'`\n\t\t;;\n\t-sinix*)\n\t\tos=-sysv4\n\t\t;;\n        -tpf*)\n\t\tos=-tpf\n\t\t;;\n\t-triton*)\n\t\tos=-sysv3\n\t\t;;\n\t-oss*)\n\t\tos=-sysv3\n\t\t;;\n\t-svr4)\n\t\tos=-sysv4\n\t\t;;\n\t-svr3)\n\t\tos=-sysv3\n\t\t;;\n\t-sysvr4)\n\t\tos=-sysv4\n\t\t;;\n\t# This must come after -sysvr4.\n\t-sysv*)\n\t\t;;\n\t-ose*)\n\t\tos=-ose\n\t\t;;\n\t-es1800*)\n\t\tos=-ose\n\t\t;;\n\t-xenix)\n\t\tos=-xenix\n\t\t;;\n\t-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)\n\t\tos=-mint\n\t\t;;\n\t-aros*)\n\t\tos=-aros\n\t\t;;\n\t-kaos*)\n\t\tos=-kaos\n\t\t;;\n\t-none)\n\t\t;;\n\t*)\n\t\t# Get rid of the `-' at the beginning of $os.\n\t\tos=`echo $os | sed 's/[^-]*-//'`\n\t\techo Invalid configuration \\`$1\\': system \\`$os\\' not recognized 1>&2\n\t\texit 1\n\t\t;;\nesac\nelse\n\n# Here we handle the default operating systems that come with various machines.\n# The value should be what the vendor currently ships out the door with their\n# machine or put another way, the most popular os provided with the machine.\n\n# Note that if you're going to try to match \"-MANUFACTURER\" here (say,\n# \"-sun\"), then you have to tell the case statement up towards the top\n# that MANUFACTURER isn't an operating system.  Otherwise, code above\n# will signal an error saying that MANUFACTURER isn't an operating\n# system, and we'll never get to this point.\n\ncase $basic_machine in\n\t*-acorn)\n\t\tos=-riscix1.2\n\t\t;;\n\tarm*-rebel)\n\t\tos=-linux\n\t\t;;\n\tarm*-semi)\n\t\tos=-aout\n\t\t;;\n    c4x-* | tic4x-*)\n        os=-coff\n        ;;\n\t# This must come before the *-dec entry.\n\tpdp10-*)\n\t\tos=-tops20\n\t\t;;\n\tpdp11-*)\n\t\tos=-none\n\t\t;;\n\t*-dec | vax-*)\n\t\tos=-ultrix4.2\n\t\t;;\n\tm68*-apollo)\n\t\tos=-domain\n\t\t;;\n\ti386-sun)\n\t\tos=-sunos4.0.2\n\t\t;;\n\tm68000-sun)\n\t\tos=-sunos3\n\t\t# This also exists in the configure program, but was not the\n\t\t# default.\n\t\t# os=-sunos4\n\t\t;;\n\tm68*-cisco)\n\t\tos=-aout\n\t\t;;\n\tmips*-cisco)\n\t\tos=-elf\n\t\t;;\n\tmips*-*)\n\t\tos=-elf\n\t\t;;\n\tor32-*)\n\t\tos=-coff\n\t\t;;\n\t*-tti)\t# must be before sparc entry or we get the wrong os.\n\t\tos=-sysv3\n\t\t;;\n\tsparc-* | *-sun)\n\t\tos=-sunos4.1.1\n\t\t;;\n\t*-be)\n\t\tos=-beos\n\t\t;;\n\t*-ibm)\n\t\tos=-aix\n\t\t;;\n    \t*-knuth)\n\t\tos=-mmixware\n\t\t;;\n\t*-wec)\n\t\tos=-proelf\n\t\t;;\n\t*-winbond)\n\t\tos=-proelf\n\t\t;;\n\t*-oki)\n\t\tos=-proelf\n\t\t;;\n\t*-hp)\n\t\tos=-hpux\n\t\t;;\n\t*-hitachi)\n\t\tos=-hiux\n\t\t;;\n\ti860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)\n\t\tos=-sysv\n\t\t;;\n\t*-cbm)\n\t\tos=-amigaos\n\t\t;;\n\t*-dg)\n\t\tos=-dgux\n\t\t;;\n\t*-dolphin)\n\t\tos=-sysv3\n\t\t;;\n\tm68k-ccur)\n\t\tos=-rtu\n\t\t;;\n\tm88k-omron*)\n\t\tos=-luna\n\t\t;;\n\t*-next )\n\t\tos=-nextstep\n\t\t;;\n\t*-sequent)\n\t\tos=-ptx\n\t\t;;\n\t*-crds)\n\t\tos=-unos\n\t\t;;\n\t*-ns)\n\t\tos=-genix\n\t\t;;\n\ti370-*)\n\t\tos=-mvs\n\t\t;;\n\t*-next)\n\t\tos=-nextstep3\n\t\t;;\n\t*-gould)\n\t\tos=-sysv\n\t\t;;\n\t*-highlevel)\n\t\tos=-bsd\n\t\t;;\n\t*-encore)\n\t\tos=-bsd\n\t\t;;\n\t*-sgi)\n\t\tos=-irix\n\t\t;;\n\t*-siemens)\n\t\tos=-sysv4\n\t\t;;\n\t*-masscomp)\n\t\tos=-rtu\n\t\t;;\n\tf30[01]-fujitsu | f700-fujitsu)\n\t\tos=-uxpv\n\t\t;;\n\t*-rom68k)\n\t\tos=-coff\n\t\t;;\n\t*-*bug)\n\t\tos=-coff\n\t\t;;\n\t*-apple)\n\t\tos=-macos\n\t\t;;\n\t*-atari*)\n\t\tos=-mint\n\t\t;;\n\t*)\n\t\tos=-none\n\t\t;;\nesac\nfi\n\n# Here we handle the case where we know the os, and the CPU type, but not the\n# manufacturer.  We pick the logical manufacturer.\nvendor=unknown\ncase $basic_machine in\n\t*-unknown)\n\t\tcase $os in\n\t\t\t-riscix*)\n\t\t\t\tvendor=acorn\n\t\t\t\t;;\n\t\t\t-sunos*)\n\t\t\t\tvendor=sun\n\t\t\t\t;;\n\t\t\t-aix*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-beos*)\n\t\t\t\tvendor=be\n\t\t\t\t;;\n\t\t\t-hpux*)\n\t\t\t\tvendor=hp\n\t\t\t\t;;\n\t\t\t-mpeix*)\n\t\t\t\tvendor=hp\n\t\t\t\t;;\n\t\t\t-hiux*)\n\t\t\t\tvendor=hitachi\n\t\t\t\t;;\n\t\t\t-unos*)\n\t\t\t\tvendor=crds\n\t\t\t\t;;\n\t\t\t-dgux*)\n\t\t\t\tvendor=dg\n\t\t\t\t;;\n\t\t\t-luna*)\n\t\t\t\tvendor=omron\n\t\t\t\t;;\n\t\t\t-genix*)\n\t\t\t\tvendor=ns\n\t\t\t\t;;\n\t\t\t-mvs* | -opened*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-os400*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-ptx*)\n\t\t\t\tvendor=sequent\n\t\t\t\t;;\n\t\t\t-tpf*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-vxsim* | -vxworks* | -windiss*)\n\t\t\t\tvendor=wrs\n\t\t\t\t;;\n\t\t\t-aux*)\n\t\t\t\tvendor=apple\n\t\t\t\t;;\n\t\t\t-hms*)\n\t\t\t\tvendor=hitachi\n\t\t\t\t;;\n\t\t\t-mpw* | -macos*)\n\t\t\t\tvendor=apple\n\t\t\t\t;;\n\t\t\t-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)\n\t\t\t\tvendor=atari\n\t\t\t\t;;\n\t\t\t-vos*)\n\t\t\t\tvendor=stratus\n\t\t\t\t;;\n\t\tesac\n\t\tbasic_machine=`echo $basic_machine | sed \"s/unknown/$vendor/\"`\n\t\t;;\nesac\n\necho $basic_machine$os\nexit 0\n\n# Local variables:\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"timestamp='\"\n# time-stamp-format: \"%:y-%02m-%02d\"\n# time-stamp-end: \"'\"\n# End:\n"
  },
  {
    "path": "ext/libjpeg-turbo/configure",
    "content": "#! /bin/sh\n# Guess values for system-dependent variables and create Makefiles.\n# Generated by GNU Autoconf 2.59 for libjpeg-turbo 1.3.1.\n#\n# Copyright (C) 2003 Free Software Foundation, Inc.\n# This configure script is free software; the Free Software Foundation\n# gives unlimited permission to copy, distribute and modify it.\n## --------------------- ##\n## M4sh Initialization.  ##\n## --------------------- ##\n\n# Be Bourne compatible\nif test -n \"${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then\n  emulate sh\n  NULLCMD=:\n  # Zsh 3.x and 4.x performs word splitting on ${1+\"$@\"}, which\n  # is contrary to our usage.  Disable this feature.\n  alias -g '${1+\"$@\"}'='\"$@\"'\nelif test -n \"${BASH_VERSION+set}\" && (set -o posix) >/dev/null 2>&1; then\n  set -o posix\nfi\nDUALCASE=1; export DUALCASE # for MKS sh\n\n# Support unset when possible.\nif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then\n  as_unset=unset\nelse\n  as_unset=false\nfi\n\n\n# Work around bugs in pre-3.0 UWIN ksh.\n$as_unset ENV MAIL MAILPATH\nPS1='$ '\nPS2='> '\nPS4='+ '\n\n# NLS nuisances.\nfor as_var in \\\n  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \\\n  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \\\n  LC_TELEPHONE LC_TIME\ndo\n  if (set +x; test -z \"`(eval $as_var=C; export $as_var) 2>&1`\"); then\n    eval $as_var=C; export $as_var\n  else\n    $as_unset $as_var\n  fi\ndone\n\n# Required to use basename.\nif expr a : '\\(a\\)' >/dev/null 2>&1; then\n  as_expr=expr\nelse\n  as_expr=false\nfi\n\nif (basename /) >/dev/null 2>&1 && test \"X`basename / 2>&1`\" = \"X/\"; then\n  as_basename=basename\nelse\n  as_basename=false\nfi\n\n\n# Name of the executable.\nas_me=`$as_basename \"$0\" ||\n$as_expr X/\"$0\" : '.*/\\([^/][^/]*\\)/*$' \\| \\\n\t X\"$0\" : 'X\\(//\\)$' \\| \\\n\t X\"$0\" : 'X\\(/\\)$' \\| \\\n\t .     : '\\(.\\)' 2>/dev/null ||\necho X/\"$0\" |\n    sed '/^.*\\/\\([^/][^/]*\\)\\/*$/{ s//\\1/; q; }\n  \t  /^X\\/\\(\\/\\/\\)$/{ s//\\1/; q; }\n  \t  /^X\\/\\(\\/\\).*/{ s//\\1/; q; }\n  \t  s/.*/./; q'`\n\n\n# PATH needs CR, and LINENO needs CR and PATH.\n# Avoid depending upon Character Ranges.\nas_cr_letters='abcdefghijklmnopqrstuvwxyz'\nas_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'\nas_cr_Letters=$as_cr_letters$as_cr_LETTERS\nas_cr_digits='0123456789'\nas_cr_alnum=$as_cr_Letters$as_cr_digits\n\n# The user is always right.\nif test \"${PATH_SEPARATOR+set}\" != set; then\n  echo \"#! /bin/sh\" >conf$$.sh\n  echo  \"exit 0\"   >>conf$$.sh\n  chmod +x conf$$.sh\n  if (PATH=\"/nonexistent;.\"; conf$$.sh) >/dev/null 2>&1; then\n    PATH_SEPARATOR=';'\n  else\n    PATH_SEPARATOR=:\n  fi\n  rm -f conf$$.sh\nfi\n\n\n  as_lineno_1=$LINENO\n  as_lineno_2=$LINENO\n  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`\n  test \"x$as_lineno_1\" != \"x$as_lineno_2\" &&\n  test \"x$as_lineno_3\"  = \"x$as_lineno_2\"  || {\n  # Find who we are.  Look in the path if we contain no path at all\n  # relative or not.\n  case $0 in\n    *[\\\\/]* ) as_myself=$0 ;;\n    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  test -r \"$as_dir/$0\" && as_myself=$as_dir/$0 && break\ndone\n\n       ;;\n  esac\n  # We did not find ourselves, most probably we were run as `sh COMMAND'\n  # in which case we are not to be found in the path.\n  if test \"x$as_myself\" = x; then\n    as_myself=$0\n  fi\n  if test ! -f \"$as_myself\"; then\n    { echo \"$as_me: error: cannot find myself; rerun with an absolute path\" >&2\n   { (exit 1); exit 1; }; }\n  fi\n  case $CONFIG_SHELL in\n  '')\n    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for as_base in sh bash ksh sh5; do\n\t case $as_dir in\n\t /*)\n\t   if (\"$as_dir/$as_base\" -c '\n  as_lineno_1=$LINENO\n  as_lineno_2=$LINENO\n  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`\n  test \"x$as_lineno_1\" != \"x$as_lineno_2\" &&\n  test \"x$as_lineno_3\"  = \"x$as_lineno_2\" ') 2>/dev/null; then\n\t     $as_unset BASH_ENV || test \"${BASH_ENV+set}\" != set || { BASH_ENV=; export BASH_ENV; }\n\t     $as_unset ENV || test \"${ENV+set}\" != set || { ENV=; export ENV; }\n\t     CONFIG_SHELL=$as_dir/$as_base\n\t     export CONFIG_SHELL\n\t     exec \"$CONFIG_SHELL\" \"$0\" ${1+\"$@\"}\n\t   fi;;\n\t esac\n       done\ndone\n;;\n  esac\n\n  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO\n  # uniformly replaced by the line number.  The first 'sed' inserts a\n  # line-number line before each line; the second 'sed' does the real\n  # work.  The second script uses 'N' to pair each line-number line\n  # with the numbered line, and appends trailing '-' during\n  # substitution so that $LINENO is not a special case at line end.\n  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the\n  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)\n  sed '=' <$as_myself |\n    sed '\n      N\n      s,$,-,\n      : loop\n      s,^\\(['$as_cr_digits']*\\)\\(.*\\)[$]LINENO\\([^'$as_cr_alnum'_]\\),\\1\\2\\1\\3,\n      t loop\n      s,-$,,\n      s,^['$as_cr_digits']*\\n,,\n    ' >$as_me.lineno &&\n  chmod +x $as_me.lineno ||\n    { echo \"$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell\" >&2\n   { (exit 1); exit 1; }; }\n\n  # Don't try to exec as it changes $[0], causing all sort of problems\n  # (the dirname of $[0] is not the place where we might find the\n  # original and so on.  Autoconf is especially sensible to this).\n  . ./$as_me.lineno\n  # Exit status is that of the last command.\n  exit\n}\n\n\ncase `echo \"testing\\c\"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in\n  *c*,-n*) ECHO_N= ECHO_C='\n' ECHO_T='\t' ;;\n  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;\n  *)       ECHO_N= ECHO_C='\\c' ECHO_T= ;;\nesac\n\nif expr a : '\\(a\\)' >/dev/null 2>&1; then\n  as_expr=expr\nelse\n  as_expr=false\nfi\n\nrm -f conf$$ conf$$.exe conf$$.file\necho >conf$$.file\nif ln -s conf$$.file conf$$ 2>/dev/null; then\n  # We could just check for DJGPP; but this test a) works b) is more generic\n  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).\n  if test -f conf$$.exe; then\n    # Don't use ln at all; we don't have any links\n    as_ln_s='cp -p'\n  else\n    as_ln_s='ln -s'\n  fi\nelif ln conf$$.file conf$$ 2>/dev/null; then\n  as_ln_s=ln\nelse\n  as_ln_s='cp -p'\nfi\nrm -f conf$$ conf$$.exe conf$$.file\n\nif mkdir -p . 2>/dev/null; then\n  as_mkdir_p=:\nelse\n  test -d ./-p && rmdir ./-p\n  as_mkdir_p=false\nfi\n\nas_executable_p=\"test -f\"\n\n# Sed expression to map a string onto a valid CPP name.\nas_tr_cpp=\"eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'\"\n\n# Sed expression to map a string onto a valid variable name.\nas_tr_sh=\"eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'\"\n\n\n# IFS\n# We need space, tab and new line, in precisely that order.\nas_nl='\n'\nIFS=\" \t$as_nl\"\n\n# CDPATH.\n$as_unset CDPATH\n\n\n\n# Check that we are running under the correct shell.\nSHELL=${CONFIG_SHELL-/bin/sh}\n\ncase X$ECHO in\nX*--fallback-echo)\n  # Remove one level of quotation (which was required for Make).\n  ECHO=`echo \"$ECHO\" | sed 's,\\\\\\\\\\$\\\\$0,'$0','`\n  ;;\nesac\n\necho=${ECHO-echo}\nif test \"X$1\" = X--no-reexec; then\n  # Discard the --no-reexec flag, and continue.\n  shift\nelif test \"X$1\" = X--fallback-echo; then\n  # Avoid inline document here, it may be left over\n  :\nelif test \"X`($echo '\\t') 2>/dev/null`\" = 'X\\t' ; then\n  # Yippee, $echo works!\n  :\nelse\n  # Restart under the correct shell.\n  exec $SHELL \"$0\" --no-reexec ${1+\"$@\"}\nfi\n\nif test \"X$1\" = X--fallback-echo; then\n  # used as fallback echo\n  shift\n  cat <<EOF\n$*\nEOF\n  exit 0\nfi\n\n# The HP-UX ksh and POSIX shell print the target directory to stdout\n# if CDPATH is set.\nif test \"X${CDPATH+set}\" = Xset; then CDPATH=:; export CDPATH; fi\n\nif test -z \"$ECHO\"; then\nif test \"X${echo_test_string+set}\" != Xset; then\n# find a string as large as possible, as long as the shell can cope with it\n  for cmd in 'sed 50q \"$0\"' 'sed 20q \"$0\"' 'sed 10q \"$0\"' 'sed 2q \"$0\"' 'echo test'; do\n    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...\n    if (echo_test_string=\"`eval $cmd`\") 2>/dev/null &&\n       echo_test_string=\"`eval $cmd`\" &&\n       (test \"X$echo_test_string\" = \"X$echo_test_string\") 2>/dev/null\n    then\n      break\n    fi\n  done\nfi\n\nif test \"X`($echo '\\t') 2>/dev/null`\" = 'X\\t' &&\n   echo_testing_string=`($echo \"$echo_test_string\") 2>/dev/null` &&\n   test \"X$echo_testing_string\" = \"X$echo_test_string\"; then\n  :\nelse\n  # The Solaris, AIX, and Digital Unix default echo programs unquote\n  # backslashes.  This makes it impossible to quote backslashes using\n  #   echo \"$something\" | sed 's/\\\\/\\\\\\\\/g'\n  #\n  # So, first we look for a working echo in the user's PATH.\n\n  lt_save_ifs=\"$IFS\"; IFS=$PATH_SEPARATOR\n  for dir in $PATH /usr/ucb; do\n    IFS=\"$lt_save_ifs\"\n    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&\n       test \"X`($dir/echo '\\t') 2>/dev/null`\" = 'X\\t' &&\n       echo_testing_string=`($dir/echo \"$echo_test_string\") 2>/dev/null` &&\n       test \"X$echo_testing_string\" = \"X$echo_test_string\"; then\n      echo=\"$dir/echo\"\n      break\n    fi\n  done\n  IFS=\"$lt_save_ifs\"\n\n  if test \"X$echo\" = Xecho; then\n    # We didn't find a better echo, so look for alternatives.\n    if test \"X`(print -r '\\t') 2>/dev/null`\" = 'X\\t' &&\n       echo_testing_string=`(print -r \"$echo_test_string\") 2>/dev/null` &&\n       test \"X$echo_testing_string\" = \"X$echo_test_string\"; then\n      # This shell has a builtin print -r that does the trick.\n      echo='print -r'\n    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&\n\t test \"X$CONFIG_SHELL\" != X/bin/ksh; then\n      # If we have ksh, try running configure again with it.\n      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}\n      export ORIGINAL_CONFIG_SHELL\n      CONFIG_SHELL=/bin/ksh\n      export CONFIG_SHELL\n      exec $CONFIG_SHELL \"$0\" --no-reexec ${1+\"$@\"}\n    else\n      # Try using printf.\n      echo='printf %s\\n'\n      if test \"X`($echo '\\t') 2>/dev/null`\" = 'X\\t' &&\n\t echo_testing_string=`($echo \"$echo_test_string\") 2>/dev/null` &&\n\t test \"X$echo_testing_string\" = \"X$echo_test_string\"; then\n\t# Cool, printf works\n\t:\n      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL \"$0\" --fallback-echo '\\t') 2>/dev/null` &&\n\t   test \"X$echo_testing_string\" = 'X\\t' &&\n\t   echo_testing_string=`($ORIGINAL_CONFIG_SHELL \"$0\" --fallback-echo \"$echo_test_string\") 2>/dev/null` &&\n\t   test \"X$echo_testing_string\" = \"X$echo_test_string\"; then\n\tCONFIG_SHELL=$ORIGINAL_CONFIG_SHELL\n\texport CONFIG_SHELL\n\tSHELL=\"$CONFIG_SHELL\"\n\texport SHELL\n\techo=\"$CONFIG_SHELL $0 --fallback-echo\"\n      elif echo_testing_string=`($CONFIG_SHELL \"$0\" --fallback-echo '\\t') 2>/dev/null` &&\n\t   test \"X$echo_testing_string\" = 'X\\t' &&\n\t   echo_testing_string=`($CONFIG_SHELL \"$0\" --fallback-echo \"$echo_test_string\") 2>/dev/null` &&\n\t   test \"X$echo_testing_string\" = \"X$echo_test_string\"; then\n\techo=\"$CONFIG_SHELL $0 --fallback-echo\"\n      else\n\t# maybe with a smaller string...\n\tprev=:\n\n\tfor cmd in 'echo test' 'sed 2q \"$0\"' 'sed 10q \"$0\"' 'sed 20q \"$0\"' 'sed 50q \"$0\"'; do\n\t  if (test \"X$echo_test_string\" = \"X`eval $cmd`\") 2>/dev/null\n\t  then\n\t    break\n\t  fi\n\t  prev=\"$cmd\"\n\tdone\n\n\tif test \"$prev\" != 'sed 50q \"$0\"'; then\n\t  echo_test_string=`eval $prev`\n\t  export echo_test_string\n\t  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} \"$0\" ${1+\"$@\"}\n\telse\n\t  # Oops.  We lost completely, so just stick with echo.\n\t  echo=echo\n\tfi\n      fi\n    fi\n  fi\nfi\nfi\n\n# Copy echo and quote the copy suitably for passing to libtool from\n# the Makefile, instead of quoting the original, which is used later.\nECHO=$echo\nif test \"X$ECHO\" = \"X$CONFIG_SHELL $0 --fallback-echo\"; then\n   ECHO=\"$CONFIG_SHELL \\\\\\$\\$0 --fallback-echo\"\nfi\n\n\n\n\ntagnames=${tagnames+${tagnames},}CXX\n\ntagnames=${tagnames+${tagnames},}F77\n\n# Name of the host.\n# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,\n# so uname gets run too.\nac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`\n\nexec 6>&1\n\n#\n# Initializations.\n#\nac_default_prefix=/usr/local\nac_config_libobj_dir=.\ncross_compiling=no\nsubdirs=\nMFLAGS=\nMAKEFLAGS=\nSHELL=${CONFIG_SHELL-/bin/sh}\n\n# Maximum number of lines to put in a shell here document.\n# This variable seems obsolete.  It should probably be removed, and\n# only ac_max_sed_lines should be used.\n: ${ac_max_here_lines=38}\n\n# Identity of this package.\nPACKAGE_NAME='libjpeg-turbo'\nPACKAGE_TARNAME='libjpeg-turbo'\nPACKAGE_VERSION='1.3.1'\nPACKAGE_STRING='libjpeg-turbo 1.3.1'\nPACKAGE_BUGREPORT=''\n\nac_default_prefix=/opt/libjpeg-turbo\n# Factoring default headers for most tests.\nac_includes_default=\"\\\n#include <stdio.h>\n#if HAVE_SYS_TYPES_H\n# include <sys/types.h>\n#endif\n#if HAVE_SYS_STAT_H\n# include <sys/stat.h>\n#endif\n#if STDC_HEADERS\n# include <stdlib.h>\n# include <stddef.h>\n#else\n# if HAVE_STDLIB_H\n#  include <stdlib.h>\n# endif\n#endif\n#if HAVE_STRING_H\n# if !STDC_HEADERS && HAVE_MEMORY_H\n#  include <memory.h>\n# endif\n# include <string.h>\n#endif\n#if HAVE_STRINGS_H\n# include <strings.h>\n#endif\n#if HAVE_INTTYPES_H\n# include <inttypes.h>\n#else\n# if HAVE_STDINT_H\n#  include <stdint.h>\n# endif\n#endif\n#if HAVE_UNISTD_H\n# include <unistd.h>\n#endif\"\n\nac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP CCAS CCASFLAGS build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL JPEG_LIB_VERSION JPEG_LIB_VERSION_DECIMAL SO_MAJOR_VERSION SO_MINOR_VERSION LIBTOOL_CURRENT SO_AGE MEM_SRCDST_FUNCTIONS VERSION_SCRIPT_TRUE VERSION_SCRIPT_FALSE VERSION_SCRIPT_FLAG WITH_ARITH_ENC_TRUE WITH_ARITH_ENC_FALSE WITH_ARITH_DEC_TRUE WITH_ARITH_DEC_FALSE WITH_ARITH_TRUE WITH_ARITH_FALSE JAVAC JAVACFLAGS JAR JAVA JNI_CFLAGS WITH_JAVA_TRUE WITH_JAVA_FALSE WITH_JAVA JAVA_RPM_CONTENTS_1 JAVA_RPM_CONTENTS_2 NASM NAFLAGS WITH_SIMD_TRUE WITH_SIMD_FALSE WITH_SSE_FLOAT_DCT_TRUE WITH_SSE_FLOAT_DCT_FALSE SIMD_I386_TRUE SIMD_I386_FALSE SIMD_X86_64_TRUE SIMD_X86_64_FALSE SIMD_ARM_TRUE SIMD_ARM_FALSE X86_64_TRUE X86_64_FALSE WITH_TURBOJPEG_TRUE WITH_TURBOJPEG_FALSE PKGNAME RPMARCH RPM_CONFIG_ARGS DEBARCH BUILD LIBOBJS LTLIBOBJS'\nac_subst_files=''\n\n# Initialize some variables set by options.\nac_init_help=\nac_init_version=false\n# The variables have the same names as the options, with\n# dashes changed to underlines.\ncache_file=/dev/null\nexec_prefix=NONE\nno_create=\nno_recursion=\nprefix=NONE\nprogram_prefix=NONE\nprogram_suffix=NONE\nprogram_transform_name=s,x,x,\nsilent=\nsite=\nsrcdir=\nverbose=\nx_includes=NONE\nx_libraries=NONE\n\n# Installation directory options.\n# These are left unexpanded so users can \"make install exec_prefix=/foo\"\n# and all the variables that are supposed to be based on exec_prefix\n# by default will actually change.\n# Use braces instead of parens because sh, perl, etc. also accept them.\nbindir='${exec_prefix}/bin'\nsbindir='${exec_prefix}/sbin'\nlibexecdir='${exec_prefix}/libexec'\ndatadir='${prefix}/share'\nsysconfdir='${prefix}/etc'\nsharedstatedir='${prefix}/com'\nlocalstatedir='${prefix}/var'\nlibdir='${exec_prefix}/lib'\nincludedir='${prefix}/include'\noldincludedir='/usr/include'\ninfodir='${prefix}/info'\nmandir='${prefix}/man'\n\nac_prev=\nfor ac_option\ndo\n  # If the previous option needs an argument, assign it.\n  if test -n \"$ac_prev\"; then\n    eval \"$ac_prev=\\$ac_option\"\n    ac_prev=\n    continue\n  fi\n\n  ac_optarg=`expr \"x$ac_option\" : 'x[^=]*=\\(.*\\)'`\n\n  # Accept the important Cygnus configure options, so we can diagnose typos.\n\n  case $ac_option in\n\n  -bindir | --bindir | --bindi | --bind | --bin | --bi)\n    ac_prev=bindir ;;\n  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)\n    bindir=$ac_optarg ;;\n\n  -build | --build | --buil | --bui | --bu)\n    ac_prev=build_alias ;;\n  -build=* | --build=* | --buil=* | --bui=* | --bu=*)\n    build_alias=$ac_optarg ;;\n\n  -cache-file | --cache-file | --cache-fil | --cache-fi \\\n  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)\n    ac_prev=cache_file ;;\n  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \\\n  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)\n    cache_file=$ac_optarg ;;\n\n  --config-cache | -C)\n    cache_file=config.cache ;;\n\n  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)\n    ac_prev=datadir ;;\n  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \\\n  | --da=*)\n    datadir=$ac_optarg ;;\n\n  -disable-* | --disable-*)\n    ac_feature=`expr \"x$ac_option\" : 'x-*disable-\\(.*\\)'`\n    # Reject names that are not valid shell variable names.\n    expr \"x$ac_feature\" : \".*[^-_$as_cr_alnum]\" >/dev/null &&\n      { echo \"$as_me: error: invalid feature name: $ac_feature\" >&2\n   { (exit 1); exit 1; }; }\n    ac_feature=`echo $ac_feature | sed 's/-/_/g'`\n    eval \"enable_$ac_feature=no\" ;;\n\n  -enable-* | --enable-*)\n    ac_feature=`expr \"x$ac_option\" : 'x-*enable-\\([^=]*\\)'`\n    # Reject names that are not valid shell variable names.\n    expr \"x$ac_feature\" : \".*[^-_$as_cr_alnum]\" >/dev/null &&\n      { echo \"$as_me: error: invalid feature name: $ac_feature\" >&2\n   { (exit 1); exit 1; }; }\n    ac_feature=`echo $ac_feature | sed 's/-/_/g'`\n    case $ac_option in\n      *=*) ac_optarg=`echo \"$ac_optarg\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"`;;\n      *) ac_optarg=yes ;;\n    esac\n    eval \"enable_$ac_feature='$ac_optarg'\" ;;\n\n  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \\\n  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \\\n  | --exec | --exe | --ex)\n    ac_prev=exec_prefix ;;\n  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \\\n  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \\\n  | --exec=* | --exe=* | --ex=*)\n    exec_prefix=$ac_optarg ;;\n\n  -gas | --gas | --ga | --g)\n    # Obsolete; use --with-gas.\n    with_gas=yes ;;\n\n  -help | --help | --hel | --he | -h)\n    ac_init_help=long ;;\n  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)\n    ac_init_help=recursive ;;\n  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)\n    ac_init_help=short ;;\n\n  -host | --host | --hos | --ho)\n    ac_prev=host_alias ;;\n  -host=* | --host=* | --hos=* | --ho=*)\n    host_alias=$ac_optarg ;;\n\n  -includedir | --includedir | --includedi | --included | --include \\\n  | --includ | --inclu | --incl | --inc)\n    ac_prev=includedir ;;\n  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \\\n  | --includ=* | --inclu=* | --incl=* | --inc=*)\n    includedir=$ac_optarg ;;\n\n  -infodir | --infodir | --infodi | --infod | --info | --inf)\n    ac_prev=infodir ;;\n  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)\n    infodir=$ac_optarg ;;\n\n  -libdir | --libdir | --libdi | --libd)\n    ac_prev=libdir ;;\n  -libdir=* | --libdir=* | --libdi=* | --libd=*)\n    libdir=$ac_optarg ;;\n\n  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \\\n  | --libexe | --libex | --libe)\n    ac_prev=libexecdir ;;\n  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \\\n  | --libexe=* | --libex=* | --libe=*)\n    libexecdir=$ac_optarg ;;\n\n  -localstatedir | --localstatedir | --localstatedi | --localstated \\\n  | --localstate | --localstat | --localsta | --localst \\\n  | --locals | --local | --loca | --loc | --lo)\n    ac_prev=localstatedir ;;\n  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \\\n  | --localstate=* | --localstat=* | --localsta=* | --localst=* \\\n  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)\n    localstatedir=$ac_optarg ;;\n\n  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)\n    ac_prev=mandir ;;\n  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)\n    mandir=$ac_optarg ;;\n\n  -nfp | --nfp | --nf)\n    # Obsolete; use --without-fp.\n    with_fp=no ;;\n\n  -no-create | --no-create | --no-creat | --no-crea | --no-cre \\\n  | --no-cr | --no-c | -n)\n    no_create=yes ;;\n\n  -no-recursion | --no-recursion | --no-recursio | --no-recursi \\\n  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)\n    no_recursion=yes ;;\n\n  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \\\n  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \\\n  | --oldin | --oldi | --old | --ol | --o)\n    ac_prev=oldincludedir ;;\n  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \\\n  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \\\n  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)\n    oldincludedir=$ac_optarg ;;\n\n  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)\n    ac_prev=prefix ;;\n  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)\n    prefix=$ac_optarg ;;\n\n  -program-prefix | --program-prefix | --program-prefi | --program-pref \\\n  | --program-pre | --program-pr | --program-p)\n    ac_prev=program_prefix ;;\n  -program-prefix=* | --program-prefix=* | --program-prefi=* \\\n  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)\n    program_prefix=$ac_optarg ;;\n\n  -program-suffix | --program-suffix | --program-suffi | --program-suff \\\n  | --program-suf | --program-su | --program-s)\n    ac_prev=program_suffix ;;\n  -program-suffix=* | --program-suffix=* | --program-suffi=* \\\n  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)\n    program_suffix=$ac_optarg ;;\n\n  -program-transform-name | --program-transform-name \\\n  | --program-transform-nam | --program-transform-na \\\n  | --program-transform-n | --program-transform- \\\n  | --program-transform | --program-transfor \\\n  | --program-transfo | --program-transf \\\n  | --program-trans | --program-tran \\\n  | --progr-tra | --program-tr | --program-t)\n    ac_prev=program_transform_name ;;\n  -program-transform-name=* | --program-transform-name=* \\\n  | --program-transform-nam=* | --program-transform-na=* \\\n  | --program-transform-n=* | --program-transform-=* \\\n  | --program-transform=* | --program-transfor=* \\\n  | --program-transfo=* | --program-transf=* \\\n  | --program-trans=* | --program-tran=* \\\n  | --progr-tra=* | --program-tr=* | --program-t=*)\n    program_transform_name=$ac_optarg ;;\n\n  -q | -quiet | --quiet | --quie | --qui | --qu | --q \\\n  | -silent | --silent | --silen | --sile | --sil)\n    silent=yes ;;\n\n  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)\n    ac_prev=sbindir ;;\n  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \\\n  | --sbi=* | --sb=*)\n    sbindir=$ac_optarg ;;\n\n  -sharedstatedir | --sharedstatedir | --sharedstatedi \\\n  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \\\n  | --sharedst | --shareds | --shared | --share | --shar \\\n  | --sha | --sh)\n    ac_prev=sharedstatedir ;;\n  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \\\n  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \\\n  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \\\n  | --sha=* | --sh=*)\n    sharedstatedir=$ac_optarg ;;\n\n  -site | --site | --sit)\n    ac_prev=site ;;\n  -site=* | --site=* | --sit=*)\n    site=$ac_optarg ;;\n\n  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)\n    ac_prev=srcdir ;;\n  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)\n    srcdir=$ac_optarg ;;\n\n  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \\\n  | --syscon | --sysco | --sysc | --sys | --sy)\n    ac_prev=sysconfdir ;;\n  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \\\n  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)\n    sysconfdir=$ac_optarg ;;\n\n  -target | --target | --targe | --targ | --tar | --ta | --t)\n    ac_prev=target_alias ;;\n  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)\n    target_alias=$ac_optarg ;;\n\n  -v | -verbose | --verbose | --verbos | --verbo | --verb)\n    verbose=yes ;;\n\n  -version | --version | --versio | --versi | --vers | -V)\n    ac_init_version=: ;;\n\n  -with-* | --with-*)\n    ac_package=`expr \"x$ac_option\" : 'x-*with-\\([^=]*\\)'`\n    # Reject names that are not valid shell variable names.\n    expr \"x$ac_package\" : \".*[^-_$as_cr_alnum]\" >/dev/null &&\n      { echo \"$as_me: error: invalid package name: $ac_package\" >&2\n   { (exit 1); exit 1; }; }\n    ac_package=`echo $ac_package| sed 's/-/_/g'`\n    case $ac_option in\n      *=*) ac_optarg=`echo \"$ac_optarg\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"`;;\n      *) ac_optarg=yes ;;\n    esac\n    eval \"with_$ac_package='$ac_optarg'\" ;;\n\n  -without-* | --without-*)\n    ac_package=`expr \"x$ac_option\" : 'x-*without-\\(.*\\)'`\n    # Reject names that are not valid shell variable names.\n    expr \"x$ac_package\" : \".*[^-_$as_cr_alnum]\" >/dev/null &&\n      { echo \"$as_me: error: invalid package name: $ac_package\" >&2\n   { (exit 1); exit 1; }; }\n    ac_package=`echo $ac_package | sed 's/-/_/g'`\n    eval \"with_$ac_package=no\" ;;\n\n  --x)\n    # Obsolete; use --with-x.\n    with_x=yes ;;\n\n  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \\\n  | --x-incl | --x-inc | --x-in | --x-i)\n    ac_prev=x_includes ;;\n  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \\\n  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)\n    x_includes=$ac_optarg ;;\n\n  -x-libraries | --x-libraries | --x-librarie | --x-librari \\\n  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)\n    ac_prev=x_libraries ;;\n  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \\\n  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)\n    x_libraries=$ac_optarg ;;\n\n  -*) { echo \"$as_me: error: unrecognized option: $ac_option\nTry \\`$0 --help' for more information.\" >&2\n   { (exit 1); exit 1; }; }\n    ;;\n\n  *=*)\n    ac_envvar=`expr \"x$ac_option\" : 'x\\([^=]*\\)='`\n    # Reject names that are not valid shell variable names.\n    expr \"x$ac_envvar\" : \".*[^_$as_cr_alnum]\" >/dev/null &&\n      { echo \"$as_me: error: invalid variable name: $ac_envvar\" >&2\n   { (exit 1); exit 1; }; }\n    ac_optarg=`echo \"$ac_optarg\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"`\n    eval \"$ac_envvar='$ac_optarg'\"\n    export $ac_envvar ;;\n\n  *)\n    # FIXME: should be removed in autoconf 3.0.\n    echo \"$as_me: WARNING: you should use --build, --host, --target\" >&2\n    expr \"x$ac_option\" : \".*[^-._$as_cr_alnum]\" >/dev/null &&\n      echo \"$as_me: WARNING: invalid host type: $ac_option\" >&2\n    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}\n    ;;\n\n  esac\ndone\n\nif test -n \"$ac_prev\"; then\n  ac_option=--`echo $ac_prev | sed 's/_/-/g'`\n  { echo \"$as_me: error: missing argument to $ac_option\" >&2\n   { (exit 1); exit 1; }; }\nfi\n\n# Be sure to have absolute paths.\nfor ac_var in exec_prefix prefix\ndo\n  eval ac_val=$`echo $ac_var`\n  case $ac_val in\n    [\\\\/$]* | ?:[\\\\/]* | NONE | '' ) ;;\n    *)  { echo \"$as_me: error: expected an absolute directory name for --$ac_var: $ac_val\" >&2\n   { (exit 1); exit 1; }; };;\n  esac\ndone\n\n# Be sure to have absolute paths.\nfor ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \\\n\t      localstatedir libdir includedir oldincludedir infodir mandir\ndo\n  eval ac_val=$`echo $ac_var`\n  case $ac_val in\n    [\\\\/$]* | ?:[\\\\/]* ) ;;\n    *)  { echo \"$as_me: error: expected an absolute directory name for --$ac_var: $ac_val\" >&2\n   { (exit 1); exit 1; }; };;\n  esac\ndone\n\n# There might be people who depend on the old broken behavior: `$host'\n# used to hold the argument of --host etc.\n# FIXME: To remove some day.\nbuild=$build_alias\nhost=$host_alias\ntarget=$target_alias\n\n# FIXME: To remove some day.\nif test \"x$host_alias\" != x; then\n  if test \"x$build_alias\" = x; then\n    cross_compiling=maybe\n    echo \"$as_me: WARNING: If you wanted to set the --build type, don't use --host.\n    If a cross compiler is detected then cross compile mode will be used.\" >&2\n  elif test \"x$build_alias\" != \"x$host_alias\"; then\n    cross_compiling=yes\n  fi\nfi\n\nac_tool_prefix=\ntest -n \"$host_alias\" && ac_tool_prefix=$host_alias-\n\ntest \"$silent\" = yes && exec 6>/dev/null\n\n\n# Find the source files, if location was not specified.\nif test -z \"$srcdir\"; then\n  ac_srcdir_defaulted=yes\n  # Try the directory containing this script, then its parent.\n  ac_confdir=`(dirname \"$0\") 2>/dev/null ||\n$as_expr X\"$0\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$0\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$0\" : 'X\\(//\\)$' \\| \\\n\t X\"$0\" : 'X\\(/\\)' \\| \\\n\t .     : '\\(.\\)' 2>/dev/null ||\necho X\"$0\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\/\\)[^/].*/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\/\\)$/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\).*/{ s//\\1/; q; }\n  \t  s/.*/./; q'`\n  srcdir=$ac_confdir\n  if test ! -r $srcdir/$ac_unique_file; then\n    srcdir=..\n  fi\nelse\n  ac_srcdir_defaulted=no\nfi\nif test ! -r $srcdir/$ac_unique_file; then\n  if test \"$ac_srcdir_defaulted\" = yes; then\n    { echo \"$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or ..\" >&2\n   { (exit 1); exit 1; }; }\n  else\n    { echo \"$as_me: error: cannot find sources ($ac_unique_file) in $srcdir\" >&2\n   { (exit 1); exit 1; }; }\n  fi\nfi\n(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||\n  { echo \"$as_me: error: sources are in $srcdir, but \\`cd $srcdir' does not work\" >&2\n   { (exit 1); exit 1; }; }\nsrcdir=`echo \"$srcdir\" | sed 's%\\([^\\\\/]\\)[\\\\/]*$%\\1%'`\nac_env_build_alias_set=${build_alias+set}\nac_env_build_alias_value=$build_alias\nac_cv_env_build_alias_set=${build_alias+set}\nac_cv_env_build_alias_value=$build_alias\nac_env_host_alias_set=${host_alias+set}\nac_env_host_alias_value=$host_alias\nac_cv_env_host_alias_set=${host_alias+set}\nac_cv_env_host_alias_value=$host_alias\nac_env_target_alias_set=${target_alias+set}\nac_env_target_alias_value=$target_alias\nac_cv_env_target_alias_set=${target_alias+set}\nac_cv_env_target_alias_value=$target_alias\nac_env_CC_set=${CC+set}\nac_env_CC_value=$CC\nac_cv_env_CC_set=${CC+set}\nac_cv_env_CC_value=$CC\nac_env_CFLAGS_set=${CFLAGS+set}\nac_env_CFLAGS_value=$CFLAGS\nac_cv_env_CFLAGS_set=${CFLAGS+set}\nac_cv_env_CFLAGS_value=$CFLAGS\nac_env_LDFLAGS_set=${LDFLAGS+set}\nac_env_LDFLAGS_value=$LDFLAGS\nac_cv_env_LDFLAGS_set=${LDFLAGS+set}\nac_cv_env_LDFLAGS_value=$LDFLAGS\nac_env_CPPFLAGS_set=${CPPFLAGS+set}\nac_env_CPPFLAGS_value=$CPPFLAGS\nac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}\nac_cv_env_CPPFLAGS_value=$CPPFLAGS\nac_env_CPP_set=${CPP+set}\nac_env_CPP_value=$CPP\nac_cv_env_CPP_set=${CPP+set}\nac_cv_env_CPP_value=$CPP\nac_env_CCAS_set=${CCAS+set}\nac_env_CCAS_value=$CCAS\nac_cv_env_CCAS_set=${CCAS+set}\nac_cv_env_CCAS_value=$CCAS\nac_env_CCASFLAGS_set=${CCASFLAGS+set}\nac_env_CCASFLAGS_value=$CCASFLAGS\nac_cv_env_CCASFLAGS_set=${CCASFLAGS+set}\nac_cv_env_CCASFLAGS_value=$CCASFLAGS\nac_env_CXX_set=${CXX+set}\nac_env_CXX_value=$CXX\nac_cv_env_CXX_set=${CXX+set}\nac_cv_env_CXX_value=$CXX\nac_env_CXXFLAGS_set=${CXXFLAGS+set}\nac_env_CXXFLAGS_value=$CXXFLAGS\nac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}\nac_cv_env_CXXFLAGS_value=$CXXFLAGS\nac_env_CXXCPP_set=${CXXCPP+set}\nac_env_CXXCPP_value=$CXXCPP\nac_cv_env_CXXCPP_set=${CXXCPP+set}\nac_cv_env_CXXCPP_value=$CXXCPP\nac_env_F77_set=${F77+set}\nac_env_F77_value=$F77\nac_cv_env_F77_set=${F77+set}\nac_cv_env_F77_value=$F77\nac_env_FFLAGS_set=${FFLAGS+set}\nac_env_FFLAGS_value=$FFLAGS\nac_cv_env_FFLAGS_set=${FFLAGS+set}\nac_cv_env_FFLAGS_value=$FFLAGS\nac_env_JPEG_LIB_VERSION_set=${JPEG_LIB_VERSION+set}\nac_env_JPEG_LIB_VERSION_value=$JPEG_LIB_VERSION\nac_cv_env_JPEG_LIB_VERSION_set=${JPEG_LIB_VERSION+set}\nac_cv_env_JPEG_LIB_VERSION_value=$JPEG_LIB_VERSION\nac_env_SO_MAJOR_VERSION_set=${SO_MAJOR_VERSION+set}\nac_env_SO_MAJOR_VERSION_value=$SO_MAJOR_VERSION\nac_cv_env_SO_MAJOR_VERSION_set=${SO_MAJOR_VERSION+set}\nac_cv_env_SO_MAJOR_VERSION_value=$SO_MAJOR_VERSION\nac_env_SO_MINOR_VERSION_set=${SO_MINOR_VERSION+set}\nac_env_SO_MINOR_VERSION_value=$SO_MINOR_VERSION\nac_cv_env_SO_MINOR_VERSION_set=${SO_MINOR_VERSION+set}\nac_cv_env_SO_MINOR_VERSION_value=$SO_MINOR_VERSION\nac_env_JAVAC_set=${JAVAC+set}\nac_env_JAVAC_value=$JAVAC\nac_cv_env_JAVAC_set=${JAVAC+set}\nac_cv_env_JAVAC_value=$JAVAC\nac_env_JAVACFLAGS_set=${JAVACFLAGS+set}\nac_env_JAVACFLAGS_value=$JAVACFLAGS\nac_cv_env_JAVACFLAGS_set=${JAVACFLAGS+set}\nac_cv_env_JAVACFLAGS_value=$JAVACFLAGS\nac_env_JAR_set=${JAR+set}\nac_env_JAR_value=$JAR\nac_cv_env_JAR_set=${JAR+set}\nac_cv_env_JAR_value=$JAR\nac_env_JAVA_set=${JAVA+set}\nac_env_JAVA_value=$JAVA\nac_cv_env_JAVA_set=${JAVA+set}\nac_cv_env_JAVA_value=$JAVA\nac_env_JNI_CFLAGS_set=${JNI_CFLAGS+set}\nac_env_JNI_CFLAGS_value=$JNI_CFLAGS\nac_cv_env_JNI_CFLAGS_set=${JNI_CFLAGS+set}\nac_cv_env_JNI_CFLAGS_value=$JNI_CFLAGS\nac_env_PKGNAME_set=${PKGNAME+set}\nac_env_PKGNAME_value=$PKGNAME\nac_cv_env_PKGNAME_set=${PKGNAME+set}\nac_cv_env_PKGNAME_value=$PKGNAME\n\n#\n# Report the --help message.\n#\nif test \"$ac_init_help\" = \"long\"; then\n  # Omit some internal or obsolete options to make the list less imposing.\n  # This message is too long to be a string in the A/UX 3.1 sh.\n  cat <<_ACEOF\n\\`configure' configures libjpeg-turbo 1.3.1 to adapt to many kinds of systems.\n\nUsage: $0 [OPTION]... [VAR=VALUE]...\n\nTo assign environment variables (e.g., CC, CFLAGS...), specify them as\nVAR=VALUE.  See below for descriptions of some of the useful variables.\n\nDefaults for the options are specified in brackets.\n\nConfiguration:\n  -h, --help              display this help and exit\n      --help=short        display options specific to this package\n      --help=recursive    display the short help of all the included packages\n  -V, --version           display version information and exit\n  -q, --quiet, --silent   do not print \\`checking...' messages\n      --cache-file=FILE   cache test results in FILE [disabled]\n  -C, --config-cache      alias for \\`--cache-file=config.cache'\n  -n, --no-create         do not create output files\n      --srcdir=DIR        find the sources in DIR [configure dir or \\`..']\n\n_ACEOF\n\n  cat <<_ACEOF\nInstallation directories:\n  --prefix=PREFIX         install architecture-independent files in PREFIX\n\t\t\t  [$ac_default_prefix]\n  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX\n\t\t\t  [PREFIX]\n\nBy default, \\`make install' will install all the files in\n\\`$ac_default_prefix/bin', \\`$ac_default_prefix/lib' etc.  You can specify\nan installation prefix other than \\`$ac_default_prefix' using \\`--prefix',\nfor instance \\`--prefix=\\$HOME'.\n\nFor better control, use the options below.\n\nFine tuning of the installation directories:\n  --bindir=DIR           user executables [EPREFIX/bin]\n  --sbindir=DIR          system admin executables [EPREFIX/sbin]\n  --libexecdir=DIR       program executables [EPREFIX/libexec]\n  --datadir=DIR          read-only architecture-independent data [PREFIX/share]\n  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]\n  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]\n  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]\n  --libdir=DIR           object code libraries [EPREFIX/lib]\n  --includedir=DIR       C header files [PREFIX/include]\n  --oldincludedir=DIR    C header files for non-gcc [/usr/include]\n  --infodir=DIR          info documentation [PREFIX/info]\n  --mandir=DIR           man documentation [PREFIX/man]\n_ACEOF\n\n  cat <<\\_ACEOF\n\nProgram names:\n  --program-prefix=PREFIX            prepend PREFIX to installed program names\n  --program-suffix=SUFFIX            append SUFFIX to installed program names\n  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names\n\nSystem types:\n  --build=BUILD     configure for building on BUILD [guessed]\n  --host=HOST       cross-compile to build programs to run on HOST [BUILD]\n_ACEOF\nfi\n\nif test -n \"$ac_init_help\"; then\n  case $ac_init_help in\n     short | recursive ) echo \"Configuration of libjpeg-turbo 1.3.1:\";;\n   esac\n  cat <<\\_ACEOF\n\nOptional Features:\n  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)\n  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]\n  --disable-dependency-tracking  speeds up one-time build\n  --enable-dependency-tracking   do not reject slow dependency extractors\n  --enable-shared[=PKGS]\n                          build shared libraries [default=yes]\n  --enable-static[=PKGS]\n                          build static libraries [default=yes]\n  --enable-fast-install[=PKGS]\n                          optimize for fast installation [default=yes]\n  --disable-libtool-lock  avoid locking (might break parallel builds)\n  --disable-ld-version-script\n                          Disable linker version script for libjpeg-turbo\n                          (default is to use linker version script if the\n                          linker supports it)\n\nOptional Packages:\n  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]\n  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)\n  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]\n  --with-pic              try to use only PIC/non-PIC objects [default=use\n                          both]\n  --with-tags[=TAGS]\n                          include additional configurations [automatic]\n  --with-jpeg7            Emulate libjpeg v7 API/ABI (this makes libjpeg-turbo\n                          backward incompatible with libjpeg v6b.)\n  --with-jpeg8            Emulate libjpeg v8 API/ABI (this makes libjpeg-turbo\n                          backward incompatible with libjpeg v6b.)\n  --without-mem-srcdst    Do not include in-memory source/destination manager\n                          functions when emulating the libjpeg v6b or v7\n                          API/ABI\n  --without-arith-enc     Do not include arithmetic encoding support\n  --without-arith-dec     Do not include arithmetic decoding support\n  --without-turbojpeg     Do not include the TurboJPEG wrapper library and\n                          associated test programs\n  --with-java             Build Java wrapper for the TurboJPEG library\n  --with-gas-preprocessor Force using gas-preprocessor.pl on ARM.\n  --without-simd          Do not include SIMD extensions\n\nSome influential environment variables:\n  CC          C compiler command\n  CFLAGS      C compiler flags\n  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a\n              nonstandard directory <lib dir>\n  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have\n              headers in a nonstandard directory <include dir>\n  CPP         C preprocessor\n  CCAS        assembler compiler command (defaults to CC)\n  CCASFLAGS   assembler compiler flags (defaults to CFLAGS)\n  CXX         C++ compiler command\n  CXXFLAGS    C++ compiler flags\n  CXXCPP      C++ preprocessor\n  F77         Fortran 77 compiler command\n  FFLAGS      Fortran 77 compiler flags\n  JPEG_LIB_VERSION\n              libjpeg API version (62, 70, or 80)\n  SO_MAJOR_VERSION\n              Major version of the libjpeg-turbo shared library (default is\n              determined by the API version)\n  SO_MINOR_VERSION\n              Minor version of the libjpeg-turbo shared library (default is\n              determined by the API version)\n  JAVAC       Java compiler command (default: javac)\n  JAVACFLAGS  Java compiler flags\n  JAR         Java archive command (default: jar)\n  JAVA        Java runtime command (default: java)\n  JNI_CFLAGS  C compiler flags needed to include jni.h (default:\n              -I/System/Library/Frameworks/JavaVM.framework/Headers on OS X,\n              '-I/usr/java/include -I/usr/java/include/solaris' on Solaris,\n              and '-I/usr/java/default/include\n              -I/usr/java/default/include/linux' on Linux)\n  PKGNAME     distribution package name (default: libjpeg-turbo)\n\nUse these variables to override the choices made by `configure' or to help\nit to find libraries and programs with nonstandard names/locations.\n\n_ACEOF\nfi\n\nif test \"$ac_init_help\" = \"recursive\"; then\n  # If there are subdirs, report their specific --help.\n  ac_popdir=`pwd`\n  for ac_dir in : $ac_subdirs_all; do test \"x$ac_dir\" = x: && continue\n    test -d $ac_dir || continue\n    ac_builddir=.\n\nif test \"$ac_dir\" != .; then\n  ac_dir_suffix=/`echo \"$ac_dir\" | sed 's,^\\.[\\\\/],,'`\n  # A \"../\" for each directory in $ac_dir_suffix.\n  ac_top_builddir=`echo \"$ac_dir_suffix\" | sed 's,/[^\\\\/]*,../,g'`\nelse\n  ac_dir_suffix= ac_top_builddir=\nfi\n\ncase $srcdir in\n  .)  # No --srcdir option.  We are building in place.\n    ac_srcdir=.\n    if test -z \"$ac_top_builddir\"; then\n       ac_top_srcdir=.\n    else\n       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`\n    fi ;;\n  [\\\\/]* | ?:[\\\\/]* )  # Absolute path.\n    ac_srcdir=$srcdir$ac_dir_suffix;\n    ac_top_srcdir=$srcdir ;;\n  *) # Relative path.\n    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix\n    ac_top_srcdir=$ac_top_builddir$srcdir ;;\nesac\n\n# Do not use `cd foo && pwd` to compute absolute paths, because\n# the directories may not exist.\ncase `pwd` in\n.) ac_abs_builddir=\"$ac_dir\";;\n*)\n  case \"$ac_dir\" in\n  .) ac_abs_builddir=`pwd`;;\n  [\\\\/]* | ?:[\\\\/]* ) ac_abs_builddir=\"$ac_dir\";;\n  *) ac_abs_builddir=`pwd`/\"$ac_dir\";;\n  esac;;\nesac\ncase $ac_abs_builddir in\n.) ac_abs_top_builddir=${ac_top_builddir}.;;\n*)\n  case ${ac_top_builddir}. in\n  .) ac_abs_top_builddir=$ac_abs_builddir;;\n  [\\\\/]* | ?:[\\\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;\n  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;\n  esac;;\nesac\ncase $ac_abs_builddir in\n.) ac_abs_srcdir=$ac_srcdir;;\n*)\n  case $ac_srcdir in\n  .) ac_abs_srcdir=$ac_abs_builddir;;\n  [\\\\/]* | ?:[\\\\/]* ) ac_abs_srcdir=$ac_srcdir;;\n  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;\n  esac;;\nesac\ncase $ac_abs_builddir in\n.) ac_abs_top_srcdir=$ac_top_srcdir;;\n*)\n  case $ac_top_srcdir in\n  .) ac_abs_top_srcdir=$ac_abs_builddir;;\n  [\\\\/]* | ?:[\\\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;\n  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;\n  esac;;\nesac\n\n    cd $ac_dir\n    # Check for guested configure; otherwise get Cygnus style configure.\n    if test -f $ac_srcdir/configure.gnu; then\n      echo\n      $SHELL $ac_srcdir/configure.gnu  --help=recursive\n    elif test -f $ac_srcdir/configure; then\n      echo\n      $SHELL $ac_srcdir/configure  --help=recursive\n    elif test -f $ac_srcdir/configure.ac ||\n\t   test -f $ac_srcdir/configure.in; then\n      echo\n      $ac_configure --help\n    else\n      echo \"$as_me: WARNING: no configuration information is in $ac_dir\" >&2\n    fi\n    cd $ac_popdir\n  done\nfi\n\ntest -n \"$ac_init_help\" && exit 0\nif $ac_init_version; then\n  cat <<\\_ACEOF\nlibjpeg-turbo configure 1.3.1\ngenerated by GNU Autoconf 2.59\n\nCopyright (C) 2003 Free Software Foundation, Inc.\nThis configure script is free software; the Free Software Foundation\ngives unlimited permission to copy, distribute and modify it.\n_ACEOF\n  exit 0\nfi\nexec 5>config.log\ncat >&5 <<_ACEOF\nThis file contains any messages produced by compilers while\nrunning configure, to aid debugging if configure makes a mistake.\n\nIt was created by libjpeg-turbo $as_me 1.3.1, which was\ngenerated by GNU Autoconf 2.59.  Invocation command line was\n\n  $ $0 $@\n\n_ACEOF\n{\ncat <<_ASUNAME\n## --------- ##\n## Platform. ##\n## --------- ##\n\nhostname = `(hostname || uname -n) 2>/dev/null | sed 1q`\nuname -m = `(uname -m) 2>/dev/null || echo unknown`\nuname -r = `(uname -r) 2>/dev/null || echo unknown`\nuname -s = `(uname -s) 2>/dev/null || echo unknown`\nuname -v = `(uname -v) 2>/dev/null || echo unknown`\n\n/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`\n/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`\n\n/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`\n/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`\n/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`\nhostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`\n/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`\n/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`\n/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`\n\n_ASUNAME\n\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  echo \"PATH: $as_dir\"\ndone\n\n} >&5\n\ncat >&5 <<_ACEOF\n\n\n## ----------- ##\n## Core tests. ##\n## ----------- ##\n\n_ACEOF\n\n\n# Keep a trace of the command line.\n# Strip out --no-create and --no-recursion so they do not pile up.\n# Strip out --silent because we don't want to record it for future runs.\n# Also quote any args containing shell meta-characters.\n# Make two passes to allow for proper duplicate-argument suppression.\nac_configure_args=\nac_configure_args0=\nac_configure_args1=\nac_sep=\nac_must_keep_next=false\nfor ac_pass in 1 2\ndo\n  for ac_arg\n  do\n    case $ac_arg in\n    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;\n    -q | -quiet | --quiet | --quie | --qui | --qu | --q \\\n    | -silent | --silent | --silen | --sile | --sil)\n      continue ;;\n    *\" \"*|*\"\t\"*|*[\\[\\]\\~\\#\\$\\^\\&\\*\\(\\)\\{\\}\\\\\\|\\;\\<\\>\\?\\\"\\']*)\n      ac_arg=`echo \"$ac_arg\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"` ;;\n    esac\n    case $ac_pass in\n    1) ac_configure_args0=\"$ac_configure_args0 '$ac_arg'\" ;;\n    2)\n      ac_configure_args1=\"$ac_configure_args1 '$ac_arg'\"\n      if test $ac_must_keep_next = true; then\n\tac_must_keep_next=false # Got value, back to normal.\n      else\n\tcase $ac_arg in\n\t  *=* | --config-cache | -C | -disable-* | --disable-* \\\n\t  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \\\n\t  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \\\n\t  | -with-* | --with-* | -without-* | --without-* | --x)\n\t    case \"$ac_configure_args0 \" in\n\t      \"$ac_configure_args1\"*\" '$ac_arg' \"* ) continue ;;\n\t    esac\n\t    ;;\n\t  -* ) ac_must_keep_next=true ;;\n\tesac\n      fi\n      ac_configure_args=\"$ac_configure_args$ac_sep'$ac_arg'\"\n      # Get rid of the leading space.\n      ac_sep=\" \"\n      ;;\n    esac\n  done\ndone\n$as_unset ac_configure_args0 || test \"${ac_configure_args0+set}\" != set || { ac_configure_args0=; export ac_configure_args0; }\n$as_unset ac_configure_args1 || test \"${ac_configure_args1+set}\" != set || { ac_configure_args1=; export ac_configure_args1; }\n\n# When interrupted or exit'd, cleanup temporary files, and complete\n# config.log.  We remove comments because anyway the quotes in there\n# would cause problems or look ugly.\n# WARNING: Be sure not to use single quotes in there, as some shells,\n# such as our DU 5.0 friend, will then `close' the trap.\ntrap 'exit_status=$?\n  # Save into config.log some information that might help in debugging.\n  {\n    echo\n\n    cat <<\\_ASBOX\n## ---------------- ##\n## Cache variables. ##\n## ---------------- ##\n_ASBOX\n    echo\n    # The following way of writing the cache mishandles newlines in values,\n{\n  (set) 2>&1 |\n    case `(ac_space='\"'\"' '\"'\"'; set | grep ac_space) 2>&1` in\n    *ac_space=\\ *)\n      sed -n \\\n\t\"s/'\"'\"'/'\"'\"'\\\\\\\\'\"'\"''\"'\"'/g;\n\t  s/^\\\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\\\)=\\\\(.*\\\\)/\\\\1='\"'\"'\\\\2'\"'\"'/p\"\n      ;;\n    *)\n      sed -n \\\n\t\"s/^\\\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\\\)=\\\\(.*\\\\)/\\\\1=\\\\2/p\"\n      ;;\n    esac;\n}\n    echo\n\n    cat <<\\_ASBOX\n## ----------------- ##\n## Output variables. ##\n## ----------------- ##\n_ASBOX\n    echo\n    for ac_var in $ac_subst_vars\n    do\n      eval ac_val=$`echo $ac_var`\n      echo \"$ac_var='\"'\"'$ac_val'\"'\"'\"\n    done | sort\n    echo\n\n    if test -n \"$ac_subst_files\"; then\n      cat <<\\_ASBOX\n## ------------- ##\n## Output files. ##\n## ------------- ##\n_ASBOX\n      echo\n      for ac_var in $ac_subst_files\n      do\n\teval ac_val=$`echo $ac_var`\n\techo \"$ac_var='\"'\"'$ac_val'\"'\"'\"\n      done | sort\n      echo\n    fi\n\n    if test -s confdefs.h; then\n      cat <<\\_ASBOX\n## ----------- ##\n## confdefs.h. ##\n## ----------- ##\n_ASBOX\n      echo\n      sed \"/^$/d\" confdefs.h | sort\n      echo\n    fi\n    test \"$ac_signal\" != 0 &&\n      echo \"$as_me: caught signal $ac_signal\"\n    echo \"$as_me: exit $exit_status\"\n  } >&5\n  rm -f core *.core &&\n  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&\n    exit $exit_status\n     ' 0\nfor ac_signal in 1 2 13 15; do\n  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal\ndone\nac_signal=0\n\n# confdefs.h avoids OS command line length limits that DEFS can exceed.\nrm -rf conftest* confdefs.h\n# AIX cpp loses on an empty file, so make sure it contains at least a newline.\necho >confdefs.h\n\n# Predefined preprocessor variables.\n\ncat >>confdefs.h <<_ACEOF\n#define PACKAGE_NAME \"$PACKAGE_NAME\"\n_ACEOF\n\n\ncat >>confdefs.h <<_ACEOF\n#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"\n_ACEOF\n\n\ncat >>confdefs.h <<_ACEOF\n#define PACKAGE_VERSION \"$PACKAGE_VERSION\"\n_ACEOF\n\n\ncat >>confdefs.h <<_ACEOF\n#define PACKAGE_STRING \"$PACKAGE_STRING\"\n_ACEOF\n\n\ncat >>confdefs.h <<_ACEOF\n#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"\n_ACEOF\n\n\n# Let the site file select an alternate cache file if it wants to.\n# Prefer explicitly selected file to automatically selected ones.\nif test -z \"$CONFIG_SITE\"; then\n  if test \"x$prefix\" != xNONE; then\n    CONFIG_SITE=\"$prefix/share/config.site $prefix/etc/config.site\"\n  else\n    CONFIG_SITE=\"$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site\"\n  fi\nfi\nfor ac_site_file in $CONFIG_SITE; do\n  if test -r \"$ac_site_file\"; then\n    { echo \"$as_me:$LINENO: loading site script $ac_site_file\" >&5\necho \"$as_me: loading site script $ac_site_file\" >&6;}\n    sed 's/^/| /' \"$ac_site_file\" >&5\n    . \"$ac_site_file\"\n  fi\ndone\n\nif test -r \"$cache_file\"; then\n  # Some versions of bash will fail to source /dev/null (special\n  # files actually), so we avoid doing that.\n  if test -f \"$cache_file\"; then\n    { echo \"$as_me:$LINENO: loading cache $cache_file\" >&5\necho \"$as_me: loading cache $cache_file\" >&6;}\n    case $cache_file in\n      [\\\\/]* | ?:[\\\\/]* ) . $cache_file;;\n      *)                      . ./$cache_file;;\n    esac\n  fi\nelse\n  { echo \"$as_me:$LINENO: creating cache $cache_file\" >&5\necho \"$as_me: creating cache $cache_file\" >&6;}\n  >$cache_file\nfi\n\n# Check that the precious variables saved in the cache have kept the same\n# value.\nac_cache_corrupted=false\nfor ac_var in `(set) 2>&1 |\n\t       sed -n 's/^ac_env_\\([a-zA-Z_0-9]*\\)_set=.*/\\1/p'`; do\n  eval ac_old_set=\\$ac_cv_env_${ac_var}_set\n  eval ac_new_set=\\$ac_env_${ac_var}_set\n  eval ac_old_val=\"\\$ac_cv_env_${ac_var}_value\"\n  eval ac_new_val=\"\\$ac_env_${ac_var}_value\"\n  case $ac_old_set,$ac_new_set in\n    set,)\n      { echo \"$as_me:$LINENO: error: \\`$ac_var' was set to \\`$ac_old_val' in the previous run\" >&5\necho \"$as_me: error: \\`$ac_var' was set to \\`$ac_old_val' in the previous run\" >&2;}\n      ac_cache_corrupted=: ;;\n    ,set)\n      { echo \"$as_me:$LINENO: error: \\`$ac_var' was not set in the previous run\" >&5\necho \"$as_me: error: \\`$ac_var' was not set in the previous run\" >&2;}\n      ac_cache_corrupted=: ;;\n    ,);;\n    *)\n      if test \"x$ac_old_val\" != \"x$ac_new_val\"; then\n\t{ echo \"$as_me:$LINENO: error: \\`$ac_var' has changed since the previous run:\" >&5\necho \"$as_me: error: \\`$ac_var' has changed since the previous run:\" >&2;}\n\t{ echo \"$as_me:$LINENO:   former value:  $ac_old_val\" >&5\necho \"$as_me:   former value:  $ac_old_val\" >&2;}\n\t{ echo \"$as_me:$LINENO:   current value: $ac_new_val\" >&5\necho \"$as_me:   current value: $ac_new_val\" >&2;}\n\tac_cache_corrupted=:\n      fi;;\n  esac\n  # Pass precious variables to config.status.\n  if test \"$ac_new_set\" = set; then\n    case $ac_new_val in\n    *\" \"*|*\"\t\"*|*[\\[\\]\\~\\#\\$\\^\\&\\*\\(\\)\\{\\}\\\\\\|\\;\\<\\>\\?\\\"\\']*)\n      ac_arg=$ac_var=`echo \"$ac_new_val\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"` ;;\n    *) ac_arg=$ac_var=$ac_new_val ;;\n    esac\n    case \" $ac_configure_args \" in\n      *\" '$ac_arg' \"*) ;; # Avoid dups.  Use of quotes ensures accuracy.\n      *) ac_configure_args=\"$ac_configure_args '$ac_arg'\" ;;\n    esac\n  fi\ndone\nif $ac_cache_corrupted; then\n  { echo \"$as_me:$LINENO: error: changes in the environment can compromise the build\" >&5\necho \"$as_me: error: changes in the environment can compromise the build\" >&2;}\n  { { echo \"$as_me:$LINENO: error: run \\`make distclean' and/or \\`rm $cache_file' and start over\" >&5\necho \"$as_me: error: run \\`make distclean' and/or \\`rm $cache_file' and start over\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nBUILD=`date +%Y%m%d`\n\nam__api_version=\"1.9\"\nac_aux_dir=\nfor ac_dir in $srcdir $srcdir/.. $srcdir/../..; do\n  if test -f $ac_dir/install-sh; then\n    ac_aux_dir=$ac_dir\n    ac_install_sh=\"$ac_aux_dir/install-sh -c\"\n    break\n  elif test -f $ac_dir/install.sh; then\n    ac_aux_dir=$ac_dir\n    ac_install_sh=\"$ac_aux_dir/install.sh -c\"\n    break\n  elif test -f $ac_dir/shtool; then\n    ac_aux_dir=$ac_dir\n    ac_install_sh=\"$ac_aux_dir/shtool install -c\"\n    break\n  fi\ndone\nif test -z \"$ac_aux_dir\"; then\n  { { echo \"$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../..\" >&5\necho \"$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../..\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\nac_config_guess=\"$SHELL $ac_aux_dir/config.guess\"\nac_config_sub=\"$SHELL $ac_aux_dir/config.sub\"\nac_configure=\"$SHELL $ac_aux_dir/configure\" # This should be Cygnus configure.\n\n# Find a good install program.  We prefer a C program (faster),\n# so one script is as good as another.  But avoid the broken or\n# incompatible versions:\n# SysV /etc/install, /usr/sbin/install\n# SunOS /usr/etc/install\n# IRIX /sbin/install\n# AIX /bin/install\n# AmigaOS /C/install, which installs bootblocks on floppy discs\n# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag\n# AFS /usr/afsws/bin/install, which mishandles nonexistent args\n# SVR4 /usr/ucb/install, which tries to use the nonexistent group \"staff\"\n# OS/2's system install, which has a completely different semantic\n# ./install, which can be erroneously created by make from ./install.sh.\necho \"$as_me:$LINENO: checking for a BSD-compatible install\" >&5\necho $ECHO_N \"checking for a BSD-compatible install... $ECHO_C\" >&6\nif test -z \"$INSTALL\"; then\nif test \"${ac_cv_path_install+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  # Account for people who put trailing slashes in PATH elements.\ncase $as_dir/ in\n  ./ | .// | /cC/* | \\\n  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \\\n  ?:\\\\/os2\\\\/install\\\\/* | ?:\\\\/OS2\\\\/INSTALL\\\\/* | \\\n  /usr/ucb/* ) ;;\n  *)\n    # OSF1 and SCO ODT 3.0 have their own names for install.\n    # Don't use installbsd from OSF since it installs stuff as root\n    # by default.\n    for ac_prog in ginstall scoinst install; do\n      for ac_exec_ext in '' $ac_executable_extensions; do\n\tif $as_executable_p \"$as_dir/$ac_prog$ac_exec_ext\"; then\n\t  if test $ac_prog = install &&\n\t    grep dspmsg \"$as_dir/$ac_prog$ac_exec_ext\" >/dev/null 2>&1; then\n\t    # AIX install.  It has an incompatible calling convention.\n\t    :\n\t  elif test $ac_prog = install &&\n\t    grep pwplus \"$as_dir/$ac_prog$ac_exec_ext\" >/dev/null 2>&1; then\n\t    # program-specific install script used by HP pwplus--don't use.\n\t    :\n\t  else\n\t    ac_cv_path_install=\"$as_dir/$ac_prog$ac_exec_ext -c\"\n\t    break 3\n\t  fi\n\tfi\n      done\n    done\n    ;;\nesac\ndone\n\n\nfi\n  if test \"${ac_cv_path_install+set}\" = set; then\n    INSTALL=$ac_cv_path_install\n  else\n    # As a last resort, use the slow shell script.  We don't cache a\n    # path for INSTALL within a source directory, because that will\n    # break other packages using the cache if that directory is\n    # removed, or if the path is relative.\n    INSTALL=$ac_install_sh\n  fi\nfi\necho \"$as_me:$LINENO: result: $INSTALL\" >&5\necho \"${ECHO_T}$INSTALL\" >&6\n\n# Use test -z because SunOS4 sh mishandles braces in ${var-val}.\n# It thinks the first close brace ends the variable substitution.\ntest -z \"$INSTALL_PROGRAM\" && INSTALL_PROGRAM='${INSTALL}'\n\ntest -z \"$INSTALL_SCRIPT\" && INSTALL_SCRIPT='${INSTALL}'\n\ntest -z \"$INSTALL_DATA\" && INSTALL_DATA='${INSTALL} -m 644'\n\necho \"$as_me:$LINENO: checking whether build environment is sane\" >&5\necho $ECHO_N \"checking whether build environment is sane... $ECHO_C\" >&6\n# Just in case\nsleep 1\necho timestamp > conftest.file\n# Do `set' in a subshell so we don't clobber the current shell's\n# arguments.  Must try -L first in case configure is actually a\n# symlink; some systems play weird games with the mod time of symlinks\n# (eg FreeBSD returns the mod time of the symlink's containing\n# directory).\nif (\n   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`\n   if test \"$*\" = \"X\"; then\n      # -L didn't work.\n      set X `ls -t $srcdir/configure conftest.file`\n   fi\n   rm -f conftest.file\n   if test \"$*\" != \"X $srcdir/configure conftest.file\" \\\n      && test \"$*\" != \"X conftest.file $srcdir/configure\"; then\n\n      # If neither matched, then we have a broken ls.  This can happen\n      # if, for instance, CONFIG_SHELL is bash and it inherits a\n      # broken ls alias from the environment.  This has actually\n      # happened.  Such a system could not be considered \"sane\".\n      { { echo \"$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken\nalias in your environment\" >&5\necho \"$as_me: error: ls -t appears to fail.  Make sure there is not a broken\nalias in your environment\" >&2;}\n   { (exit 1); exit 1; }; }\n   fi\n\n   test \"$2\" = conftest.file\n   )\nthen\n   # Ok.\n   :\nelse\n   { { echo \"$as_me:$LINENO: error: newly created file is older than distributed files!\nCheck your system clock\" >&5\necho \"$as_me: error: newly created file is older than distributed files!\nCheck your system clock\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\necho \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\ntest \"$program_prefix\" != NONE &&\n  program_transform_name=\"s,^,$program_prefix,;$program_transform_name\"\n# Use a double $ so make ignores it.\ntest \"$program_suffix\" != NONE &&\n  program_transform_name=\"s,\\$,$program_suffix,;$program_transform_name\"\n# Double any \\ or $.  echo might interpret backslashes.\n# By default was `s,x,x', remove it if useless.\ncat <<\\_ACEOF >conftest.sed\ns/[\\\\$]/&&/g;s/;s,x,x,$//\n_ACEOF\nprogram_transform_name=`echo $program_transform_name | sed -f conftest.sed`\nrm conftest.sed\n\n# expand $ac_aux_dir to an absolute path\nam_aux_dir=`cd $ac_aux_dir && pwd`\n\ntest x\"${MISSING+set}\" = xset || MISSING=\"\\${SHELL} $am_aux_dir/missing\"\n# Use eval to expand $SHELL\nif eval \"$MISSING --run true\"; then\n  am_missing_run=\"$MISSING --run \"\nelse\n  am_missing_run=\n  { echo \"$as_me:$LINENO: WARNING: \\`missing' script is too old or missing\" >&5\necho \"$as_me: WARNING: \\`missing' script is too old or missing\" >&2;}\nfi\n\nif mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then\n  # We used to keeping the `.' as first argument, in order to\n  # allow $(mkdir_p) to be used without argument.  As in\n  #   $(mkdir_p) $(somedir)\n  # where $(somedir) is conditionally defined.  However this is wrong\n  # for two reasons:\n  #  1. if the package is installed by a user who cannot write `.'\n  #     make install will fail,\n  #  2. the above comment should most certainly read\n  #     $(mkdir_p) $(DESTDIR)$(somedir)\n  #     so it does not work when $(somedir) is undefined and\n  #     $(DESTDIR) is not.\n  #  To support the latter case, we have to write\n  #     test -z \"$(somedir)\" || $(mkdir_p) $(DESTDIR)$(somedir),\n  #  so the `.' trick is pointless.\n  mkdir_p='mkdir -p --'\nelse\n  # On NextStep and OpenStep, the `mkdir' command does not\n  # recognize any option.  It will interpret all options as\n  # directories to create, and then abort because `.' already\n  # exists.\n  for d in ./-p ./--version;\n  do\n    test -d $d && rmdir $d\n  done\n  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.\n  if test -f \"$ac_aux_dir/mkinstalldirs\"; then\n    mkdir_p='$(mkinstalldirs)'\n  else\n    mkdir_p='$(install_sh) -d'\n  fi\nfi\n\nfor ac_prog in gawk mawk nawk awk\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_AWK+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$AWK\"; then\n  ac_cv_prog_AWK=\"$AWK\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_AWK=\"$ac_prog\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nAWK=$ac_cv_prog_AWK\nif test -n \"$AWK\"; then\n  echo \"$as_me:$LINENO: result: $AWK\" >&5\necho \"${ECHO_T}$AWK\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\n  test -n \"$AWK\" && break\ndone\n\necho \"$as_me:$LINENO: checking whether ${MAKE-make} sets \\$(MAKE)\" >&5\necho $ECHO_N \"checking whether ${MAKE-make} sets \\$(MAKE)... $ECHO_C\" >&6\nset dummy ${MAKE-make}; ac_make=`echo \"$2\" | sed 'y,:./+-,___p_,'`\nif eval \"test \\\"\\${ac_cv_prog_make_${ac_make}_set+set}\\\" = set\"; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.make <<\\_ACEOF\nall:\n\t@echo 'ac_maketemp=\"$(MAKE)\"'\n_ACEOF\n# GNU make sometimes prints \"make[1]: Entering...\", which would confuse us.\neval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`\nif test -n \"$ac_maketemp\"; then\n  eval ac_cv_prog_make_${ac_make}_set=yes\nelse\n  eval ac_cv_prog_make_${ac_make}_set=no\nfi\nrm -f conftest.make\nfi\nif eval \"test \\\"`echo '$ac_cv_prog_make_'${ac_make}_set`\\\" = yes\"; then\n  echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\n  SET_MAKE=\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\n  SET_MAKE=\"MAKE=${MAKE-make}\"\nfi\n\nrm -rf .tst 2>/dev/null\nmkdir .tst 2>/dev/null\nif test -d .tst; then\n  am__leading_dot=.\nelse\n  am__leading_dot=_\nfi\nrmdir .tst 2>/dev/null\n\n# test to see if srcdir already configured\nif test \"`cd $srcdir && pwd`\" != \"`pwd`\" &&\n   test -f $srcdir/config.status; then\n  { { echo \"$as_me:$LINENO: error: source directory already configured; run \\\"make distclean\\\" there first\" >&5\necho \"$as_me: error: source directory already configured; run \\\"make distclean\\\" there first\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\n\n# test whether we have cygpath\nif test -z \"$CYGPATH_W\"; then\n  if (cygpath --version) >/dev/null 2>/dev/null; then\n    CYGPATH_W='cygpath -w'\n  else\n    CYGPATH_W=echo\n  fi\nfi\n\n\n# Define the identity of the package.\n PACKAGE='libjpeg-turbo'\n VERSION='1.3.1'\n\n\ncat >>confdefs.h <<_ACEOF\n#define PACKAGE \"$PACKAGE\"\n_ACEOF\n\n\ncat >>confdefs.h <<_ACEOF\n#define VERSION \"$VERSION\"\n_ACEOF\n\n# Some tools Automake needs.\n\nACLOCAL=${ACLOCAL-\"${am_missing_run}aclocal-${am__api_version}\"}\n\n\nAUTOCONF=${AUTOCONF-\"${am_missing_run}autoconf\"}\n\n\nAUTOMAKE=${AUTOMAKE-\"${am_missing_run}automake-${am__api_version}\"}\n\n\nAUTOHEADER=${AUTOHEADER-\"${am_missing_run}autoheader\"}\n\n\nMAKEINFO=${MAKEINFO-\"${am_missing_run}makeinfo\"}\n\ninstall_sh=${install_sh-\"$am_aux_dir/install-sh\"}\n\n# Installed binaries are usually stripped using `strip' when the user\n# run `make install-strip'.  However `strip' might not be the right\n# tool to use in cross-compilation environments, therefore Automake\n# will honor the `STRIP' environment variable to overrule this program.\nif test \"$cross_compiling\" != no; then\n  if test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}strip\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}strip; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_STRIP+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$STRIP\"; then\n  ac_cv_prog_STRIP=\"$STRIP\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_STRIP=\"${ac_tool_prefix}strip\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nSTRIP=$ac_cv_prog_STRIP\nif test -n \"$STRIP\"; then\n  echo \"$as_me:$LINENO: result: $STRIP\" >&5\necho \"${ECHO_T}$STRIP\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\nfi\nif test -z \"$ac_cv_prog_STRIP\"; then\n  ac_ct_STRIP=$STRIP\n  # Extract the first word of \"strip\", so it can be a program name with args.\nset dummy strip; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_ac_ct_STRIP+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$ac_ct_STRIP\"; then\n  ac_cv_prog_ac_ct_STRIP=\"$ac_ct_STRIP\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_STRIP=\"strip\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\n  test -z \"$ac_cv_prog_ac_ct_STRIP\" && ac_cv_prog_ac_ct_STRIP=\":\"\nfi\nfi\nac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP\nif test -n \"$ac_ct_STRIP\"; then\n  echo \"$as_me:$LINENO: result: $ac_ct_STRIP\" >&5\necho \"${ECHO_T}$ac_ct_STRIP\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\n  STRIP=$ac_ct_STRIP\nelse\n  STRIP=\"$ac_cv_prog_STRIP\"\nfi\n\nfi\nINSTALL_STRIP_PROGRAM=\"\\${SHELL} \\$(install_sh) -c -s\"\n\n# We need awk for the \"check\" target.  The system \"awk\" is bad on\n# some platforms.\n# Always define AMTAR for backward compatibility.\n\nAMTAR=${AMTAR-\"${am_missing_run}tar\"}\n\nam__tar='${AMTAR} chof - \"$$tardir\"'; am__untar='${AMTAR} xf -'\n\n\n\n\n\n\n\n# Always build with prototypes\n\ncat >>confdefs.h <<\\_ACEOF\n#define HAVE_PROTOTYPES 1\n_ACEOF\n\n\n\n\n# Checks for programs.\nSAVED_CFLAGS=${CFLAGS}\nSAVED_CPPFLAGS=${CPPFLAGS}\nDEPDIR=\"${am__leading_dot}deps\"\n\n          ac_config_commands=\"$ac_config_commands depfiles\"\n\n\nam_make=${MAKE-make}\ncat > confinc << 'END'\nam__doit:\n\t@echo done\n.PHONY: am__doit\nEND\n# If we don't find an include directive, just comment out the code.\necho \"$as_me:$LINENO: checking for style of include used by $am_make\" >&5\necho $ECHO_N \"checking for style of include used by $am_make... $ECHO_C\" >&6\nam__include=\"#\"\nam__quote=\n_am_result=none\n# First try GNU make style include.\necho \"include confinc\" > confmf\n# We grep out `Entering directory' and `Leaving directory'\n# messages which can occur if `w' ends up in MAKEFLAGS.\n# In particular we don't look at `^make:' because GNU make might\n# be invoked under some other name (usually \"gmake\"), in which\n# case it prints its new name instead of `make'.\nif test \"`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`\" = \"done\"; then\n   am__include=include\n   am__quote=\n   _am_result=GNU\nfi\n# Now try BSD make style include.\nif test \"$am__include\" = \"#\"; then\n   echo '.include \"confinc\"' > confmf\n   if test \"`$am_make -s -f confmf 2> /dev/null`\" = \"done\"; then\n      am__include=.include\n      am__quote=\"\\\"\"\n      _am_result=BSD\n   fi\nfi\n\n\necho \"$as_me:$LINENO: result: $_am_result\" >&5\necho \"${ECHO_T}$_am_result\" >&6\nrm -f confinc confmf\n\n# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.\nif test \"${enable_dependency_tracking+set}\" = set; then\n  enableval=\"$enable_dependency_tracking\"\n\nfi;\nif test \"x$enable_dependency_tracking\" != xno; then\n  am_depcomp=\"$ac_aux_dir/depcomp\"\n  AMDEPBACKSLASH='\\'\nfi\n\n\nif test \"x$enable_dependency_tracking\" != xno; then\n  AMDEP_TRUE=\n  AMDEP_FALSE='#'\nelse\n  AMDEP_TRUE='#'\n  AMDEP_FALSE=\nfi\n\n\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}gcc\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}gcc; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_CC+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_CC=\"${ac_tool_prefix}gcc\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  echo \"$as_me:$LINENO: result: $CC\" >&5\necho \"${ECHO_T}$CC\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\nfi\nif test -z \"$ac_cv_prog_CC\"; then\n  ac_ct_CC=$CC\n  # Extract the first word of \"gcc\", so it can be a program name with args.\nset dummy gcc; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_ac_ct_CC+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$ac_ct_CC\"; then\n  ac_cv_prog_ac_ct_CC=\"$ac_ct_CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_CC=\"gcc\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nac_ct_CC=$ac_cv_prog_ac_ct_CC\nif test -n \"$ac_ct_CC\"; then\n  echo \"$as_me:$LINENO: result: $ac_ct_CC\" >&5\necho \"${ECHO_T}$ac_ct_CC\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\n  CC=$ac_ct_CC\nelse\n  CC=\"$ac_cv_prog_CC\"\nfi\n\nif test -z \"$CC\"; then\n  if test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}cc\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}cc; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_CC+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_CC=\"${ac_tool_prefix}cc\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  echo \"$as_me:$LINENO: result: $CC\" >&5\necho \"${ECHO_T}$CC\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\nfi\nif test -z \"$ac_cv_prog_CC\"; then\n  ac_ct_CC=$CC\n  # Extract the first word of \"cc\", so it can be a program name with args.\nset dummy cc; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_ac_ct_CC+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$ac_ct_CC\"; then\n  ac_cv_prog_ac_ct_CC=\"$ac_ct_CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_CC=\"cc\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nac_ct_CC=$ac_cv_prog_ac_ct_CC\nif test -n \"$ac_ct_CC\"; then\n  echo \"$as_me:$LINENO: result: $ac_ct_CC\" >&5\necho \"${ECHO_T}$ac_ct_CC\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\n  CC=$ac_ct_CC\nelse\n  CC=\"$ac_cv_prog_CC\"\nfi\n\nfi\nif test -z \"$CC\"; then\n  # Extract the first word of \"cc\", so it can be a program name with args.\nset dummy cc; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_CC+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\n  ac_prog_rejected=no\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    if test \"$as_dir/$ac_word$ac_exec_ext\" = \"/usr/ucb/cc\"; then\n       ac_prog_rejected=yes\n       continue\n     fi\n    ac_cv_prog_CC=\"cc\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nif test $ac_prog_rejected = yes; then\n  # We found a bogon in the path, so make sure we never use it.\n  set dummy $ac_cv_prog_CC\n  shift\n  if test $# != 0; then\n    # We chose a different compiler from the bogus one.\n    # However, it has the same basename, so the bogon will be chosen\n    # first if we set CC to just the basename; use the full file name.\n    shift\n    ac_cv_prog_CC=\"$as_dir/$ac_word${1+' '}$@\"\n  fi\nfi\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  echo \"$as_me:$LINENO: result: $CC\" >&5\necho \"${ECHO_T}$CC\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\nfi\nif test -z \"$CC\"; then\n  if test -n \"$ac_tool_prefix\"; then\n  for ac_prog in cl\n  do\n    # Extract the first word of \"$ac_tool_prefix$ac_prog\", so it can be a program name with args.\nset dummy $ac_tool_prefix$ac_prog; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_CC+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_CC=\"$ac_tool_prefix$ac_prog\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  echo \"$as_me:$LINENO: result: $CC\" >&5\necho \"${ECHO_T}$CC\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\n    test -n \"$CC\" && break\n  done\nfi\nif test -z \"$CC\"; then\n  ac_ct_CC=$CC\n  for ac_prog in cl\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_ac_ct_CC+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$ac_ct_CC\"; then\n  ac_cv_prog_ac_ct_CC=\"$ac_ct_CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_CC=\"$ac_prog\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nac_ct_CC=$ac_cv_prog_ac_ct_CC\nif test -n \"$ac_ct_CC\"; then\n  echo \"$as_me:$LINENO: result: $ac_ct_CC\" >&5\necho \"${ECHO_T}$ac_ct_CC\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\n  test -n \"$ac_ct_CC\" && break\ndone\n\n  CC=$ac_ct_CC\nfi\n\nfi\n\n\ntest -z \"$CC\" && { { echo \"$as_me:$LINENO: error: no acceptable C compiler found in \\$PATH\nSee \\`config.log' for more details.\" >&5\necho \"$as_me: error: no acceptable C compiler found in \\$PATH\nSee \\`config.log' for more details.\" >&2;}\n   { (exit 1); exit 1; }; }\n\n# Provide some information about the compiler.\necho \"$as_me:$LINENO:\" \\\n     \"checking for C compiler version\" >&5\nac_compiler=`set X $ac_compile; echo $2`\n{ (eval echo \"$as_me:$LINENO: \\\"$ac_compiler --version </dev/null >&5\\\"\") >&5\n  (eval $ac_compiler --version </dev/null >&5) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }\n{ (eval echo \"$as_me:$LINENO: \\\"$ac_compiler -v </dev/null >&5\\\"\") >&5\n  (eval $ac_compiler -v </dev/null >&5) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }\n{ (eval echo \"$as_me:$LINENO: \\\"$ac_compiler -V </dev/null >&5\\\"\") >&5\n  (eval $ac_compiler -V </dev/null >&5) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }\n\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nac_clean_files_save=$ac_clean_files\nac_clean_files=\"$ac_clean_files a.out a.exe b.out\"\n# Try to create an executable without -o first, disregard a.out.\n# It will help us diagnose broken compilers, and finding out an intuition\n# of exeext.\necho \"$as_me:$LINENO: checking for C compiler default output file name\" >&5\necho $ECHO_N \"checking for C compiler default output file name... $ECHO_C\" >&6\nac_link_default=`echo \"$ac_link\" | sed 's/ -o *conftest[^ ]*//'`\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link_default\\\"\") >&5\n  (eval $ac_link_default) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; then\n  # Find the output, starting from the most likely.  This scheme is\n# not robust to junk in `.', hence go to wildcards (a.*) only as a last\n# resort.\n\n# Be careful to initialize this variable, since it used to be cached.\n# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.\nac_cv_exeext=\n# b.out is created by i960 compilers.\nfor ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out\ndo\n  test -f \"$ac_file\" || continue\n  case $ac_file in\n    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )\n\t;;\n    conftest.$ac_ext )\n\t# This is the source file.\n\t;;\n    [ab].out )\n\t# We found the default executable, but exeext='' is most\n\t# certainly right.\n\tbreak;;\n    *.* )\n\tac_cv_exeext=`expr \"$ac_file\" : '[^.]*\\(\\..*\\)'`\n\t# FIXME: I believe we export ac_cv_exeext for Libtool,\n\t# but it would be cool to find out if it's true.  Does anybody\n\t# maintain Libtool? --akim.\n\texport ac_cv_exeext\n\tbreak;;\n    * )\n\tbreak;;\n  esac\ndone\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n{ { echo \"$as_me:$LINENO: error: C compiler cannot create executables\nSee \\`config.log' for more details.\" >&5\necho \"$as_me: error: C compiler cannot create executables\nSee \\`config.log' for more details.\" >&2;}\n   { (exit 77); exit 77; }; }\nfi\n\nac_exeext=$ac_cv_exeext\necho \"$as_me:$LINENO: result: $ac_file\" >&5\necho \"${ECHO_T}$ac_file\" >&6\n\n# Check the compiler produces executables we can run.  If not, either\n# the compiler is broken, or we cross compile.\necho \"$as_me:$LINENO: checking whether the C compiler works\" >&5\necho $ECHO_N \"checking whether the C compiler works... $ECHO_C\" >&6\n# FIXME: These cross compiler hacks should be removed for Autoconf 3.0\n# If not cross compiling, check that we can run a simple program.\nif test \"$cross_compiling\" != yes; then\n  if { ac_try='./$ac_file'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n    cross_compiling=no\n  else\n    if test \"$cross_compiling\" = maybe; then\n\tcross_compiling=yes\n    else\n\t{ { echo \"$as_me:$LINENO: error: cannot run C compiled programs.\nIf you meant to cross compile, use \\`--host'.\nSee \\`config.log' for more details.\" >&5\necho \"$as_me: error: cannot run C compiled programs.\nIf you meant to cross compile, use \\`--host'.\nSee \\`config.log' for more details.\" >&2;}\n   { (exit 1); exit 1; }; }\n    fi\n  fi\nfi\necho \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\n\nrm -f a.out a.exe conftest$ac_cv_exeext b.out\nac_clean_files=$ac_clean_files_save\n# Check the compiler produces executables we can run.  If not, either\n# the compiler is broken, or we cross compile.\necho \"$as_me:$LINENO: checking whether we are cross compiling\" >&5\necho $ECHO_N \"checking whether we are cross compiling... $ECHO_C\" >&6\necho \"$as_me:$LINENO: result: $cross_compiling\" >&5\necho \"${ECHO_T}$cross_compiling\" >&6\n\necho \"$as_me:$LINENO: checking for suffix of executables\" >&5\necho $ECHO_N \"checking for suffix of executables... $ECHO_C\" >&6\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; then\n  # If both `conftest.exe' and `conftest' are `present' (well, observable)\n# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will\n# work properly (i.e., refer to `conftest.exe'), while it won't with\n# `rm'.\nfor ac_file in conftest.exe conftest conftest.*; do\n  test -f \"$ac_file\" || continue\n  case $ac_file in\n    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;\n    *.* ) ac_cv_exeext=`expr \"$ac_file\" : '[^.]*\\(\\..*\\)'`\n\t  export ac_cv_exeext\n\t  break;;\n    * ) break;;\n  esac\ndone\nelse\n  { { echo \"$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link\nSee \\`config.log' for more details.\" >&5\necho \"$as_me: error: cannot compute suffix of executables: cannot compile and link\nSee \\`config.log' for more details.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\n\nrm -f conftest$ac_cv_exeext\necho \"$as_me:$LINENO: result: $ac_cv_exeext\" >&5\necho \"${ECHO_T}$ac_cv_exeext\" >&6\n\nrm -f conftest.$ac_ext\nEXEEXT=$ac_cv_exeext\nac_exeext=$EXEEXT\necho \"$as_me:$LINENO: checking for suffix of object files\" >&5\necho $ECHO_N \"checking for suffix of object files... $ECHO_C\" >&6\nif test \"${ac_cv_objext+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.o conftest.obj\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; then\n  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do\n  case $ac_file in\n    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;\n    *) ac_cv_objext=`expr \"$ac_file\" : '.*\\.\\(.*\\)'`\n       break;;\n  esac\ndone\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n{ { echo \"$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile\nSee \\`config.log' for more details.\" >&5\necho \"$as_me: error: cannot compute suffix of object files: cannot compile\nSee \\`config.log' for more details.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\n\nrm -f conftest.$ac_cv_objext conftest.$ac_ext\nfi\necho \"$as_me:$LINENO: result: $ac_cv_objext\" >&5\necho \"${ECHO_T}$ac_cv_objext\" >&6\nOBJEXT=$ac_cv_objext\nac_objext=$OBJEXT\necho \"$as_me:$LINENO: checking whether we are using the GNU C compiler\" >&5\necho $ECHO_N \"checking whether we are using the GNU C compiler... $ECHO_C\" >&6\nif test \"${ac_cv_c_compiler_gnu+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n#ifndef __GNUC__\n       choke me\n#endif\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_compiler_gnu=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_compiler_gnu=no\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\nac_cv_c_compiler_gnu=$ac_compiler_gnu\n\nfi\necho \"$as_me:$LINENO: result: $ac_cv_c_compiler_gnu\" >&5\necho \"${ECHO_T}$ac_cv_c_compiler_gnu\" >&6\nGCC=`test $ac_compiler_gnu = yes && echo yes`\nac_test_CFLAGS=${CFLAGS+set}\nac_save_CFLAGS=$CFLAGS\nCFLAGS=\"-g\"\necho \"$as_me:$LINENO: checking whether $CC accepts -g\" >&5\necho $ECHO_N \"checking whether $CC accepts -g... $ECHO_C\" >&6\nif test \"${ac_cv_prog_cc_g+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_prog_cc_g=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_prog_cc_g=no\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\necho \"$as_me:$LINENO: result: $ac_cv_prog_cc_g\" >&5\necho \"${ECHO_T}$ac_cv_prog_cc_g\" >&6\nif test \"$ac_test_CFLAGS\" = set; then\n  CFLAGS=$ac_save_CFLAGS\nelif test $ac_cv_prog_cc_g = yes; then\n  if test \"$GCC\" = yes; then\n    CFLAGS=\"-g -O2\"\n  else\n    CFLAGS=\"-g\"\n  fi\nelse\n  if test \"$GCC\" = yes; then\n    CFLAGS=\"-O2\"\n  else\n    CFLAGS=\n  fi\nfi\necho \"$as_me:$LINENO: checking for $CC option to accept ANSI C\" >&5\necho $ECHO_N \"checking for $CC option to accept ANSI C... $ECHO_C\" >&6\nif test \"${ac_cv_prog_cc_stdc+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  ac_cv_prog_cc_stdc=no\nac_save_CC=$CC\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#include <stdarg.h>\n#include <stdio.h>\n#include <sys/types.h>\n#include <sys/stat.h>\n/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */\nstruct buf { int x; };\nFILE * (*rcsopen) (struct buf *, struct stat *, int);\nstatic char *e (p, i)\n     char **p;\n     int i;\n{\n  return p[i];\n}\nstatic char *f (char * (*g) (char **, int), char **p, ...)\n{\n  char *s;\n  va_list v;\n  va_start (v,p);\n  s = g (p, va_arg (v,int));\n  va_end (v);\n  return s;\n}\n\n/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has\n   function prototypes and stuff, but not '\\xHH' hex character constants.\n   These don't provoke an error unfortunately, instead are silently treated\n   as 'x'.  The following induces an error, until -std1 is added to get\n   proper ANSI mode.  Curiously '\\x00'!='x' always comes out true, for an\n   array size at least.  It's necessary to write '\\x00'==0 to get something\n   that's true only with -std1.  */\nint osf4_cc_array ['\\x00' == 0 ? 1 : -1];\n\nint test (int i, double x);\nstruct s1 {int (*f) (int a);};\nstruct s2 {int (*f) (double a);};\nint pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);\nint argc;\nchar **argv;\nint\nmain ()\n{\nreturn f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];\n  ;\n  return 0;\n}\n_ACEOF\n# Don't try gcc -ansi; that turns off useful extensions and\n# breaks some systems' header files.\n# AIX\t\t\t-qlanglvl=ansi\n# Ultrix and OSF/1\t-std1\n# HP-UX 10.20 and later\t-Ae\n# HP-UX older versions\t-Aa -D_HPUX_SOURCE\n# SVR4\t\t\t-Xc -D__EXTENSIONS__\nfor ac_arg in \"\" -qlanglvl=ansi -std1 -Ae \"-Aa -D_HPUX_SOURCE\" \"-Xc -D__EXTENSIONS__\"\ndo\n  CC=\"$ac_save_CC $ac_arg\"\n  rm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_prog_cc_stdc=$ac_arg\nbreak\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nfi\nrm -f conftest.err conftest.$ac_objext\ndone\nrm -f conftest.$ac_ext conftest.$ac_objext\nCC=$ac_save_CC\n\nfi\n\ncase \"x$ac_cv_prog_cc_stdc\" in\n  x|xno)\n    echo \"$as_me:$LINENO: result: none needed\" >&5\necho \"${ECHO_T}none needed\" >&6 ;;\n  *)\n    echo \"$as_me:$LINENO: result: $ac_cv_prog_cc_stdc\" >&5\necho \"${ECHO_T}$ac_cv_prog_cc_stdc\" >&6\n    CC=\"$CC $ac_cv_prog_cc_stdc\" ;;\nesac\n\n# Some people use a C++ compiler to compile C.  Since we use `exit',\n# in C++ we need to declare it.  In case someone uses the same compiler\n# for both compiling C and C++ we need to have the C++ compiler decide\n# the declaration of exit, since it's the most demanding environment.\ncat >conftest.$ac_ext <<_ACEOF\n#ifndef __cplusplus\n  choke me\n#endif\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  for ac_declaration in \\\n   '' \\\n   'extern \"C\" void std::exit (int) throw (); using std::exit;' \\\n   'extern \"C\" void std::exit (int); using std::exit;' \\\n   'extern \"C\" void exit (int) throw ();' \\\n   'extern \"C\" void exit (int);' \\\n   'void exit (int);'\ndo\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_declaration\n#include <stdlib.h>\nint\nmain ()\n{\nexit (42);\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  :\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\ncontinue\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_declaration\nint\nmain ()\n{\nexit (42);\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  break\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\ndone\nrm -f conftest*\nif test -n \"$ac_declaration\"; then\n  echo '#ifdef __cplusplus' >>confdefs.h\n  echo $ac_declaration      >>confdefs.h\n  echo '#endif'             >>confdefs.h\nfi\n\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\ndepcc=\"$CC\"   am_compiler_list=\n\necho \"$as_me:$LINENO: checking dependency style of $depcc\" >&5\necho $ECHO_N \"checking dependency style of $depcc... $ECHO_C\" >&6\nif test \"${am_cv_CC_dependencies_compiler_type+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -z \"$AMDEP_TRUE\" && test -f \"$am_depcomp\"; then\n  # We make a subdir and do the tests there.  Otherwise we can end up\n  # making bogus files that we don't know about and never remove.  For\n  # instance it was reported that on HP-UX the gcc test will end up\n  # making a dummy file named `D' -- because `-MD' means `put the output\n  # in D'.\n  mkdir conftest.dir\n  # Copy depcomp to subdir because otherwise we won't find it if we're\n  # using a relative directory.\n  cp \"$am_depcomp\" conftest.dir\n  cd conftest.dir\n  # We will build objects and dependencies in a subdirectory because\n  # it helps to detect inapplicable dependency modes.  For instance\n  # both Tru64's cc and ICC support -MD to output dependencies as a\n  # side effect of compilation, but ICC will put the dependencies in\n  # the current directory while Tru64 will put them in the object\n  # directory.\n  mkdir sub\n\n  am_cv_CC_dependencies_compiler_type=none\n  if test \"$am_compiler_list\" = \"\"; then\n     am_compiler_list=`sed -n 's/^#*\\([a-zA-Z0-9]*\\))$/\\1/p' < ./depcomp`\n  fi\n  for depmode in $am_compiler_list; do\n    # Setup a source with many dependencies, because some compilers\n    # like to wrap large dependency lists on column 80 (with \\), and\n    # we should not choose a depcomp mode which is confused by this.\n    #\n    # We need to recreate these files for each test, as the compiler may\n    # overwrite some of them when testing with obscure command lines.\n    # This happens at least with the AIX C compiler.\n    : > sub/conftest.c\n    for i in 1 2 3 4 5 6; do\n      echo '#include \"conftst'$i'.h\"' >> sub/conftest.c\n      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with\n      # Solaris 8's {/usr,}/bin/sh.\n      touch sub/conftst$i.h\n    done\n    echo \"${am__include} ${am__quote}sub/conftest.Po${am__quote}\" > confmf\n\n    case $depmode in\n    nosideeffect)\n      # after this tag, mechanisms are not by side-effect, so they'll\n      # only be used when explicitly requested\n      if test \"x$enable_dependency_tracking\" = xyes; then\n\tcontinue\n      else\n\tbreak\n      fi\n      ;;\n    none) break ;;\n    esac\n    # We check with `-c' and `-o' for the sake of the \"dashmstdout\"\n    # mode.  It turns out that the SunPro C++ compiler does not properly\n    # handle `-M -o', and we need to detect this.\n    if depmode=$depmode \\\n       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \\\n       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \\\n       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \\\n         >/dev/null 2>conftest.err &&\n       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&\n       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&\n       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then\n      # icc doesn't choke on unknown options, it will just issue warnings\n      # or remarks (even with -Werror).  So we grep stderr for any message\n      # that says an option was ignored or not supported.\n      # When given -MP, icc 7.0 and 7.1 complain thusly:\n      #   icc: Command line warning: ignoring option '-M'; no argument required\n      # The diagnosis changed in icc 8.0:\n      #   icc: Command line remark: option '-MP' not supported\n      if (grep 'ignoring option' conftest.err ||\n          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else\n        am_cv_CC_dependencies_compiler_type=$depmode\n        break\n      fi\n    fi\n  done\n\n  cd ..\n  rm -rf conftest.dir\nelse\n  am_cv_CC_dependencies_compiler_type=none\nfi\n\nfi\necho \"$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type\" >&5\necho \"${ECHO_T}$am_cv_CC_dependencies_compiler_type\" >&6\nCCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type\n\n\n\nif\n  test \"x$enable_dependency_tracking\" != xno \\\n  && test \"$am_cv_CC_dependencies_compiler_type\" = gcc3; then\n  am__fastdepCC_TRUE=\n  am__fastdepCC_FALSE='#'\nelse\n  am__fastdepCC_TRUE='#'\n  am__fastdepCC_FALSE=\nfi\n\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\necho \"$as_me:$LINENO: checking how to run the C preprocessor\" >&5\necho $ECHO_N \"checking how to run the C preprocessor... $ECHO_C\" >&6\n# On Suns, sometimes $CPP names a directory.\nif test -n \"$CPP\" && test -d \"$CPP\"; then\n  CPP=\nfi\nif test -z \"$CPP\"; then\n  if test \"${ac_cv_prog_CPP+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n      # Double quotes because CPP needs to be expanded\n    for CPP in \"$CC -E\" \"$CC -E -traditional-cpp\" \"/lib/cpp\"\n    do\n      ac_preproc_ok=false\nfor ac_c_preproc_warn_flag in '' yes\ndo\n  # Use a header file that comes with gcc, so configuring glibc\n  # with a fresh cross-compiler works.\n  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since\n  # <limits.h> exists even on freestanding compilers.\n  # On the NeXT, cc -E runs the code through the compiler's parser,\n  # not just through cpp. \"Syntax error\" is here to catch this case.\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#ifdef __STDC__\n# include <limits.h>\n#else\n# include <assert.h>\n#endif\n\t\t     Syntax error\n_ACEOF\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_cpp conftest.$ac_ext\\\"\") >&5\n  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } >/dev/null; then\n  if test -s conftest.err; then\n    ac_cpp_err=$ac_c_preproc_warn_flag\n    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag\n  else\n    ac_cpp_err=\n  fi\nelse\n  ac_cpp_err=yes\nfi\nif test -z \"$ac_cpp_err\"; then\n  :\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n  # Broken: fails on valid input.\ncontinue\nfi\nrm -f conftest.err conftest.$ac_ext\n\n  # OK, works on sane cases.  Now check whether non-existent headers\n  # can be detected and how.\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#include <ac_nonexistent.h>\n_ACEOF\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_cpp conftest.$ac_ext\\\"\") >&5\n  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } >/dev/null; then\n  if test -s conftest.err; then\n    ac_cpp_err=$ac_c_preproc_warn_flag\n    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag\n  else\n    ac_cpp_err=\n  fi\nelse\n  ac_cpp_err=yes\nfi\nif test -z \"$ac_cpp_err\"; then\n  # Broken: success on invalid input.\ncontinue\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n  # Passes both tests.\nac_preproc_ok=:\nbreak\nfi\nrm -f conftest.err conftest.$ac_ext\n\ndone\n# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.\nrm -f conftest.err conftest.$ac_ext\nif $ac_preproc_ok; then\n  break\nfi\n\n    done\n    ac_cv_prog_CPP=$CPP\n\nfi\n  CPP=$ac_cv_prog_CPP\nelse\n  ac_cv_prog_CPP=$CPP\nfi\necho \"$as_me:$LINENO: result: $CPP\" >&5\necho \"${ECHO_T}$CPP\" >&6\nac_preproc_ok=false\nfor ac_c_preproc_warn_flag in '' yes\ndo\n  # Use a header file that comes with gcc, so configuring glibc\n  # with a fresh cross-compiler works.\n  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since\n  # <limits.h> exists even on freestanding compilers.\n  # On the NeXT, cc -E runs the code through the compiler's parser,\n  # not just through cpp. \"Syntax error\" is here to catch this case.\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#ifdef __STDC__\n# include <limits.h>\n#else\n# include <assert.h>\n#endif\n\t\t     Syntax error\n_ACEOF\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_cpp conftest.$ac_ext\\\"\") >&5\n  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } >/dev/null; then\n  if test -s conftest.err; then\n    ac_cpp_err=$ac_c_preproc_warn_flag\n    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag\n  else\n    ac_cpp_err=\n  fi\nelse\n  ac_cpp_err=yes\nfi\nif test -z \"$ac_cpp_err\"; then\n  :\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n  # Broken: fails on valid input.\ncontinue\nfi\nrm -f conftest.err conftest.$ac_ext\n\n  # OK, works on sane cases.  Now check whether non-existent headers\n  # can be detected and how.\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#include <ac_nonexistent.h>\n_ACEOF\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_cpp conftest.$ac_ext\\\"\") >&5\n  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } >/dev/null; then\n  if test -s conftest.err; then\n    ac_cpp_err=$ac_c_preproc_warn_flag\n    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag\n  else\n    ac_cpp_err=\n  fi\nelse\n  ac_cpp_err=yes\nfi\nif test -z \"$ac_cpp_err\"; then\n  # Broken: success on invalid input.\ncontinue\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n  # Passes both tests.\nac_preproc_ok=:\nbreak\nfi\nrm -f conftest.err conftest.$ac_ext\n\ndone\n# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.\nrm -f conftest.err conftest.$ac_ext\nif $ac_preproc_ok; then\n  :\nelse\n  { { echo \"$as_me:$LINENO: error: C preprocessor \\\"$CPP\\\" fails sanity check\nSee \\`config.log' for more details.\" >&5\necho \"$as_me: error: C preprocessor \\\"$CPP\\\" fails sanity check\nSee \\`config.log' for more details.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}gcc\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}gcc; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_CC+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_CC=\"${ac_tool_prefix}gcc\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  echo \"$as_me:$LINENO: result: $CC\" >&5\necho \"${ECHO_T}$CC\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\nfi\nif test -z \"$ac_cv_prog_CC\"; then\n  ac_ct_CC=$CC\n  # Extract the first word of \"gcc\", so it can be a program name with args.\nset dummy gcc; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_ac_ct_CC+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$ac_ct_CC\"; then\n  ac_cv_prog_ac_ct_CC=\"$ac_ct_CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_CC=\"gcc\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nac_ct_CC=$ac_cv_prog_ac_ct_CC\nif test -n \"$ac_ct_CC\"; then\n  echo \"$as_me:$LINENO: result: $ac_ct_CC\" >&5\necho \"${ECHO_T}$ac_ct_CC\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\n  CC=$ac_ct_CC\nelse\n  CC=\"$ac_cv_prog_CC\"\nfi\n\nif test -z \"$CC\"; then\n  if test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}cc\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}cc; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_CC+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_CC=\"${ac_tool_prefix}cc\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  echo \"$as_me:$LINENO: result: $CC\" >&5\necho \"${ECHO_T}$CC\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\nfi\nif test -z \"$ac_cv_prog_CC\"; then\n  ac_ct_CC=$CC\n  # Extract the first word of \"cc\", so it can be a program name with args.\nset dummy cc; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_ac_ct_CC+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$ac_ct_CC\"; then\n  ac_cv_prog_ac_ct_CC=\"$ac_ct_CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_CC=\"cc\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nac_ct_CC=$ac_cv_prog_ac_ct_CC\nif test -n \"$ac_ct_CC\"; then\n  echo \"$as_me:$LINENO: result: $ac_ct_CC\" >&5\necho \"${ECHO_T}$ac_ct_CC\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\n  CC=$ac_ct_CC\nelse\n  CC=\"$ac_cv_prog_CC\"\nfi\n\nfi\nif test -z \"$CC\"; then\n  # Extract the first word of \"cc\", so it can be a program name with args.\nset dummy cc; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_CC+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\n  ac_prog_rejected=no\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    if test \"$as_dir/$ac_word$ac_exec_ext\" = \"/usr/ucb/cc\"; then\n       ac_prog_rejected=yes\n       continue\n     fi\n    ac_cv_prog_CC=\"cc\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nif test $ac_prog_rejected = yes; then\n  # We found a bogon in the path, so make sure we never use it.\n  set dummy $ac_cv_prog_CC\n  shift\n  if test $# != 0; then\n    # We chose a different compiler from the bogus one.\n    # However, it has the same basename, so the bogon will be chosen\n    # first if we set CC to just the basename; use the full file name.\n    shift\n    ac_cv_prog_CC=\"$as_dir/$ac_word${1+' '}$@\"\n  fi\nfi\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  echo \"$as_me:$LINENO: result: $CC\" >&5\necho \"${ECHO_T}$CC\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\nfi\nif test -z \"$CC\"; then\n  if test -n \"$ac_tool_prefix\"; then\n  for ac_prog in cl\n  do\n    # Extract the first word of \"$ac_tool_prefix$ac_prog\", so it can be a program name with args.\nset dummy $ac_tool_prefix$ac_prog; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_CC+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_CC=\"$ac_tool_prefix$ac_prog\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  echo \"$as_me:$LINENO: result: $CC\" >&5\necho \"${ECHO_T}$CC\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\n    test -n \"$CC\" && break\n  done\nfi\nif test -z \"$CC\"; then\n  ac_ct_CC=$CC\n  for ac_prog in cl\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_ac_ct_CC+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$ac_ct_CC\"; then\n  ac_cv_prog_ac_ct_CC=\"$ac_ct_CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_CC=\"$ac_prog\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nac_ct_CC=$ac_cv_prog_ac_ct_CC\nif test -n \"$ac_ct_CC\"; then\n  echo \"$as_me:$LINENO: result: $ac_ct_CC\" >&5\necho \"${ECHO_T}$ac_ct_CC\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\n  test -n \"$ac_ct_CC\" && break\ndone\n\n  CC=$ac_ct_CC\nfi\n\nfi\n\n\ntest -z \"$CC\" && { { echo \"$as_me:$LINENO: error: no acceptable C compiler found in \\$PATH\nSee \\`config.log' for more details.\" >&5\necho \"$as_me: error: no acceptable C compiler found in \\$PATH\nSee \\`config.log' for more details.\" >&2;}\n   { (exit 1); exit 1; }; }\n\n# Provide some information about the compiler.\necho \"$as_me:$LINENO:\" \\\n     \"checking for C compiler version\" >&5\nac_compiler=`set X $ac_compile; echo $2`\n{ (eval echo \"$as_me:$LINENO: \\\"$ac_compiler --version </dev/null >&5\\\"\") >&5\n  (eval $ac_compiler --version </dev/null >&5) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }\n{ (eval echo \"$as_me:$LINENO: \\\"$ac_compiler -v </dev/null >&5\\\"\") >&5\n  (eval $ac_compiler -v </dev/null >&5) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }\n{ (eval echo \"$as_me:$LINENO: \\\"$ac_compiler -V </dev/null >&5\\\"\") >&5\n  (eval $ac_compiler -V </dev/null >&5) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }\n\necho \"$as_me:$LINENO: checking whether we are using the GNU C compiler\" >&5\necho $ECHO_N \"checking whether we are using the GNU C compiler... $ECHO_C\" >&6\nif test \"${ac_cv_c_compiler_gnu+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n#ifndef __GNUC__\n       choke me\n#endif\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_compiler_gnu=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_compiler_gnu=no\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\nac_cv_c_compiler_gnu=$ac_compiler_gnu\n\nfi\necho \"$as_me:$LINENO: result: $ac_cv_c_compiler_gnu\" >&5\necho \"${ECHO_T}$ac_cv_c_compiler_gnu\" >&6\nGCC=`test $ac_compiler_gnu = yes && echo yes`\nac_test_CFLAGS=${CFLAGS+set}\nac_save_CFLAGS=$CFLAGS\nCFLAGS=\"-g\"\necho \"$as_me:$LINENO: checking whether $CC accepts -g\" >&5\necho $ECHO_N \"checking whether $CC accepts -g... $ECHO_C\" >&6\nif test \"${ac_cv_prog_cc_g+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_prog_cc_g=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_prog_cc_g=no\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\necho \"$as_me:$LINENO: result: $ac_cv_prog_cc_g\" >&5\necho \"${ECHO_T}$ac_cv_prog_cc_g\" >&6\nif test \"$ac_test_CFLAGS\" = set; then\n  CFLAGS=$ac_save_CFLAGS\nelif test $ac_cv_prog_cc_g = yes; then\n  if test \"$GCC\" = yes; then\n    CFLAGS=\"-g -O2\"\n  else\n    CFLAGS=\"-g\"\n  fi\nelse\n  if test \"$GCC\" = yes; then\n    CFLAGS=\"-O2\"\n  else\n    CFLAGS=\n  fi\nfi\necho \"$as_me:$LINENO: checking for $CC option to accept ANSI C\" >&5\necho $ECHO_N \"checking for $CC option to accept ANSI C... $ECHO_C\" >&6\nif test \"${ac_cv_prog_cc_stdc+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  ac_cv_prog_cc_stdc=no\nac_save_CC=$CC\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#include <stdarg.h>\n#include <stdio.h>\n#include <sys/types.h>\n#include <sys/stat.h>\n/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */\nstruct buf { int x; };\nFILE * (*rcsopen) (struct buf *, struct stat *, int);\nstatic char *e (p, i)\n     char **p;\n     int i;\n{\n  return p[i];\n}\nstatic char *f (char * (*g) (char **, int), char **p, ...)\n{\n  char *s;\n  va_list v;\n  va_start (v,p);\n  s = g (p, va_arg (v,int));\n  va_end (v);\n  return s;\n}\n\n/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has\n   function prototypes and stuff, but not '\\xHH' hex character constants.\n   These don't provoke an error unfortunately, instead are silently treated\n   as 'x'.  The following induces an error, until -std1 is added to get\n   proper ANSI mode.  Curiously '\\x00'!='x' always comes out true, for an\n   array size at least.  It's necessary to write '\\x00'==0 to get something\n   that's true only with -std1.  */\nint osf4_cc_array ['\\x00' == 0 ? 1 : -1];\n\nint test (int i, double x);\nstruct s1 {int (*f) (int a);};\nstruct s2 {int (*f) (double a);};\nint pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);\nint argc;\nchar **argv;\nint\nmain ()\n{\nreturn f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];\n  ;\n  return 0;\n}\n_ACEOF\n# Don't try gcc -ansi; that turns off useful extensions and\n# breaks some systems' header files.\n# AIX\t\t\t-qlanglvl=ansi\n# Ultrix and OSF/1\t-std1\n# HP-UX 10.20 and later\t-Ae\n# HP-UX older versions\t-Aa -D_HPUX_SOURCE\n# SVR4\t\t\t-Xc -D__EXTENSIONS__\nfor ac_arg in \"\" -qlanglvl=ansi -std1 -Ae \"-Aa -D_HPUX_SOURCE\" \"-Xc -D__EXTENSIONS__\"\ndo\n  CC=\"$ac_save_CC $ac_arg\"\n  rm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_prog_cc_stdc=$ac_arg\nbreak\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nfi\nrm -f conftest.err conftest.$ac_objext\ndone\nrm -f conftest.$ac_ext conftest.$ac_objext\nCC=$ac_save_CC\n\nfi\n\ncase \"x$ac_cv_prog_cc_stdc\" in\n  x|xno)\n    echo \"$as_me:$LINENO: result: none needed\" >&5\necho \"${ECHO_T}none needed\" >&6 ;;\n  *)\n    echo \"$as_me:$LINENO: result: $ac_cv_prog_cc_stdc\" >&5\necho \"${ECHO_T}$ac_cv_prog_cc_stdc\" >&6\n    CC=\"$CC $ac_cv_prog_cc_stdc\" ;;\nesac\n\n# Some people use a C++ compiler to compile C.  Since we use `exit',\n# in C++ we need to declare it.  In case someone uses the same compiler\n# for both compiling C and C++ we need to have the C++ compiler decide\n# the declaration of exit, since it's the most demanding environment.\ncat >conftest.$ac_ext <<_ACEOF\n#ifndef __cplusplus\n  choke me\n#endif\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  for ac_declaration in \\\n   '' \\\n   'extern \"C\" void std::exit (int) throw (); using std::exit;' \\\n   'extern \"C\" void std::exit (int); using std::exit;' \\\n   'extern \"C\" void exit (int) throw ();' \\\n   'extern \"C\" void exit (int);' \\\n   'void exit (int);'\ndo\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_declaration\n#include <stdlib.h>\nint\nmain ()\n{\nexit (42);\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  :\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\ncontinue\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_declaration\nint\nmain ()\n{\nexit (42);\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  break\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\ndone\nrm -f conftest*\nif test -n \"$ac_declaration\"; then\n  echo '#ifdef __cplusplus' >>confdefs.h\n  echo $ac_declaration      >>confdefs.h\n  echo '#endif'             >>confdefs.h\nfi\n\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\ndepcc=\"$CC\"   am_compiler_list=\n\necho \"$as_me:$LINENO: checking dependency style of $depcc\" >&5\necho $ECHO_N \"checking dependency style of $depcc... $ECHO_C\" >&6\nif test \"${am_cv_CC_dependencies_compiler_type+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -z \"$AMDEP_TRUE\" && test -f \"$am_depcomp\"; then\n  # We make a subdir and do the tests there.  Otherwise we can end up\n  # making bogus files that we don't know about and never remove.  For\n  # instance it was reported that on HP-UX the gcc test will end up\n  # making a dummy file named `D' -- because `-MD' means `put the output\n  # in D'.\n  mkdir conftest.dir\n  # Copy depcomp to subdir because otherwise we won't find it if we're\n  # using a relative directory.\n  cp \"$am_depcomp\" conftest.dir\n  cd conftest.dir\n  # We will build objects and dependencies in a subdirectory because\n  # it helps to detect inapplicable dependency modes.  For instance\n  # both Tru64's cc and ICC support -MD to output dependencies as a\n  # side effect of compilation, but ICC will put the dependencies in\n  # the current directory while Tru64 will put them in the object\n  # directory.\n  mkdir sub\n\n  am_cv_CC_dependencies_compiler_type=none\n  if test \"$am_compiler_list\" = \"\"; then\n     am_compiler_list=`sed -n 's/^#*\\([a-zA-Z0-9]*\\))$/\\1/p' < ./depcomp`\n  fi\n  for depmode in $am_compiler_list; do\n    # Setup a source with many dependencies, because some compilers\n    # like to wrap large dependency lists on column 80 (with \\), and\n    # we should not choose a depcomp mode which is confused by this.\n    #\n    # We need to recreate these files for each test, as the compiler may\n    # overwrite some of them when testing with obscure command lines.\n    # This happens at least with the AIX C compiler.\n    : > sub/conftest.c\n    for i in 1 2 3 4 5 6; do\n      echo '#include \"conftst'$i'.h\"' >> sub/conftest.c\n      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with\n      # Solaris 8's {/usr,}/bin/sh.\n      touch sub/conftst$i.h\n    done\n    echo \"${am__include} ${am__quote}sub/conftest.Po${am__quote}\" > confmf\n\n    case $depmode in\n    nosideeffect)\n      # after this tag, mechanisms are not by side-effect, so they'll\n      # only be used when explicitly requested\n      if test \"x$enable_dependency_tracking\" = xyes; then\n\tcontinue\n      else\n\tbreak\n      fi\n      ;;\n    none) break ;;\n    esac\n    # We check with `-c' and `-o' for the sake of the \"dashmstdout\"\n    # mode.  It turns out that the SunPro C++ compiler does not properly\n    # handle `-M -o', and we need to detect this.\n    if depmode=$depmode \\\n       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \\\n       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \\\n       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \\\n         >/dev/null 2>conftest.err &&\n       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&\n       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&\n       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then\n      # icc doesn't choke on unknown options, it will just issue warnings\n      # or remarks (even with -Werror).  So we grep stderr for any message\n      # that says an option was ignored or not supported.\n      # When given -MP, icc 7.0 and 7.1 complain thusly:\n      #   icc: Command line warning: ignoring option '-M'; no argument required\n      # The diagnosis changed in icc 8.0:\n      #   icc: Command line remark: option '-MP' not supported\n      if (grep 'ignoring option' conftest.err ||\n          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else\n        am_cv_CC_dependencies_compiler_type=$depmode\n        break\n      fi\n    fi\n  done\n\n  cd ..\n  rm -rf conftest.dir\nelse\n  am_cv_CC_dependencies_compiler_type=none\nfi\n\nfi\necho \"$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type\" >&5\necho \"${ECHO_T}$am_cv_CC_dependencies_compiler_type\" >&6\nCCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type\n\n\n\nif\n  test \"x$enable_dependency_tracking\" != xno \\\n  && test \"$am_cv_CC_dependencies_compiler_type\" = gcc3; then\n  am__fastdepCC_TRUE=\n  am__fastdepCC_FALSE='#'\nelse\n  am__fastdepCC_TRUE='#'\n  am__fastdepCC_FALSE=\nfi\n\n\n\n# By default we simply use the C compiler to build assembly code.\n\ntest \"${CCAS+set}\" = set || CCAS=$CC\ntest \"${CCASFLAGS+set}\" = set || CCASFLAGS=$CFLAGS\n\n\n\nif test \"x$CC\" != xcc; then\n  echo \"$as_me:$LINENO: checking whether $CC and cc understand -c and -o together\" >&5\necho $ECHO_N \"checking whether $CC and cc understand -c and -o together... $ECHO_C\" >&6\nelse\n  echo \"$as_me:$LINENO: checking whether cc understands -c and -o together\" >&5\necho $ECHO_N \"checking whether cc understands -c and -o together... $ECHO_C\" >&6\nfi\nset dummy $CC; ac_cc=`echo $2 |\n\t\t      sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`\nif eval \"test \\\"\\${ac_cv_prog_cc_${ac_cc}_c_o+set}\\\" = set\"; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\n# Make sure it works both with $CC and with simple cc.\n# We do the test twice because some compilers refuse to overwrite an\n# existing .o file with -o, though they will create one.\nac_try='$CC -c conftest.$ac_ext -o conftest.$ac_objext >&5'\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n   test -f conftest.$ac_objext && { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); };\nthen\n  eval ac_cv_prog_cc_${ac_cc}_c_o=yes\n  if test \"x$CC\" != xcc; then\n    # Test first that cc exists at all.\n    if { ac_try='cc -c conftest.$ac_ext >&5'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n      ac_try='cc -c conftest.$ac_ext -o conftest.$ac_objext >&5'\n      if { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t test -f conftest.$ac_objext && { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); };\n      then\n\t# cc works too.\n\t:\n      else\n\t# cc exists but doesn't like -o.\n\teval ac_cv_prog_cc_${ac_cc}_c_o=no\n      fi\n    fi\n  fi\nelse\n  eval ac_cv_prog_cc_${ac_cc}_c_o=no\nfi\nrm -f conftest*\n\nfi\nif eval \"test \\\"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\\\" = yes\"; then\n  echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\n\ncat >>confdefs.h <<\\_ACEOF\n#define NO_MINUS_C_MINUS_O 1\n_ACEOF\n\nfi\n\n# FIXME: we rely on the cache variable name because\n# there is no other way.\nset dummy $CC\nac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`\nif eval \"test \\\"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\\\" != yes\"; then\n   # Losing compiler, so override with the script.\n   # FIXME: It is wrong to rewrite CC.\n   # But if we don't then we get into trouble of one sort or another.\n   # A longer-term fix would be to have automake use am__CC in this case,\n   # and then we could set am__CC=\"\\$(top_srcdir)/compile \\$(CC)\"\n   CC=\"$am_aux_dir/compile $CC\"\nfi\n\n# Find a good install program.  We prefer a C program (faster),\n# so one script is as good as another.  But avoid the broken or\n# incompatible versions:\n# SysV /etc/install, /usr/sbin/install\n# SunOS /usr/etc/install\n# IRIX /sbin/install\n# AIX /bin/install\n# AmigaOS /C/install, which installs bootblocks on floppy discs\n# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag\n# AFS /usr/afsws/bin/install, which mishandles nonexistent args\n# SVR4 /usr/ucb/install, which tries to use the nonexistent group \"staff\"\n# OS/2's system install, which has a completely different semantic\n# ./install, which can be erroneously created by make from ./install.sh.\necho \"$as_me:$LINENO: checking for a BSD-compatible install\" >&5\necho $ECHO_N \"checking for a BSD-compatible install... $ECHO_C\" >&6\nif test -z \"$INSTALL\"; then\nif test \"${ac_cv_path_install+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  # Account for people who put trailing slashes in PATH elements.\ncase $as_dir/ in\n  ./ | .// | /cC/* | \\\n  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \\\n  ?:\\\\/os2\\\\/install\\\\/* | ?:\\\\/OS2\\\\/INSTALL\\\\/* | \\\n  /usr/ucb/* ) ;;\n  *)\n    # OSF1 and SCO ODT 3.0 have their own names for install.\n    # Don't use installbsd from OSF since it installs stuff as root\n    # by default.\n    for ac_prog in ginstall scoinst install; do\n      for ac_exec_ext in '' $ac_executable_extensions; do\n\tif $as_executable_p \"$as_dir/$ac_prog$ac_exec_ext\"; then\n\t  if test $ac_prog = install &&\n\t    grep dspmsg \"$as_dir/$ac_prog$ac_exec_ext\" >/dev/null 2>&1; then\n\t    # AIX install.  It has an incompatible calling convention.\n\t    :\n\t  elif test $ac_prog = install &&\n\t    grep pwplus \"$as_dir/$ac_prog$ac_exec_ext\" >/dev/null 2>&1; then\n\t    # program-specific install script used by HP pwplus--don't use.\n\t    :\n\t  else\n\t    ac_cv_path_install=\"$as_dir/$ac_prog$ac_exec_ext -c\"\n\t    break 3\n\t  fi\n\tfi\n      done\n    done\n    ;;\nesac\ndone\n\n\nfi\n  if test \"${ac_cv_path_install+set}\" = set; then\n    INSTALL=$ac_cv_path_install\n  else\n    # As a last resort, use the slow shell script.  We don't cache a\n    # path for INSTALL within a source directory, because that will\n    # break other packages using the cache if that directory is\n    # removed, or if the path is relative.\n    INSTALL=$ac_install_sh\n  fi\nfi\necho \"$as_me:$LINENO: result: $INSTALL\" >&5\necho \"${ECHO_T}$INSTALL\" >&6\n\n# Use test -z because SunOS4 sh mishandles braces in ${var-val}.\n# It thinks the first close brace ends the variable substitution.\ntest -z \"$INSTALL_PROGRAM\" && INSTALL_PROGRAM='${INSTALL}'\n\ntest -z \"$INSTALL_SCRIPT\" && INSTALL_SCRIPT='${INSTALL}'\n\ntest -z \"$INSTALL_DATA\" && INSTALL_DATA='${INSTALL} -m 644'\n\n# Check whether --enable-shared or --disable-shared was given.\nif test \"${enable_shared+set}\" = set; then\n  enableval=\"$enable_shared\"\n  p=${PACKAGE-default}\n    case $enableval in\n    yes) enable_shared=yes ;;\n    no) enable_shared=no ;;\n    *)\n      enable_shared=no\n      # Look at the argument we got.  We use all the common list separators.\n      lt_save_ifs=\"$IFS\"; IFS=\"${IFS}$PATH_SEPARATOR,\"\n      for pkg in $enableval; do\n\tIFS=\"$lt_save_ifs\"\n\tif test \"X$pkg\" = \"X$p\"; then\n\t  enable_shared=yes\n\tfi\n      done\n      IFS=\"$lt_save_ifs\"\n      ;;\n    esac\nelse\n  enable_shared=yes\nfi;\n\n# Check whether --enable-static or --disable-static was given.\nif test \"${enable_static+set}\" = set; then\n  enableval=\"$enable_static\"\n  p=${PACKAGE-default}\n    case $enableval in\n    yes) enable_static=yes ;;\n    no) enable_static=no ;;\n    *)\n     enable_static=no\n      # Look at the argument we got.  We use all the common list separators.\n      lt_save_ifs=\"$IFS\"; IFS=\"${IFS}$PATH_SEPARATOR,\"\n      for pkg in $enableval; do\n\tIFS=\"$lt_save_ifs\"\n\tif test \"X$pkg\" = \"X$p\"; then\n\t  enable_static=yes\n\tfi\n      done\n      IFS=\"$lt_save_ifs\"\n      ;;\n    esac\nelse\n  enable_static=yes\nfi;\n\n# Check whether --enable-fast-install or --disable-fast-install was given.\nif test \"${enable_fast_install+set}\" = set; then\n  enableval=\"$enable_fast_install\"\n  p=${PACKAGE-default}\n    case $enableval in\n    yes) enable_fast_install=yes ;;\n    no) enable_fast_install=no ;;\n    *)\n      enable_fast_install=no\n      # Look at the argument we got.  We use all the common list separators.\n      lt_save_ifs=\"$IFS\"; IFS=\"${IFS}$PATH_SEPARATOR,\"\n      for pkg in $enableval; do\n\tIFS=\"$lt_save_ifs\"\n\tif test \"X$pkg\" = \"X$p\"; then\n\t  enable_fast_install=yes\n\tfi\n      done\n      IFS=\"$lt_save_ifs\"\n      ;;\n    esac\nelse\n  enable_fast_install=yes\nfi;\n\n# Make sure we can run config.sub.\n$ac_config_sub sun4 >/dev/null 2>&1 ||\n  { { echo \"$as_me:$LINENO: error: cannot run $ac_config_sub\" >&5\necho \"$as_me: error: cannot run $ac_config_sub\" >&2;}\n   { (exit 1); exit 1; }; }\n\necho \"$as_me:$LINENO: checking build system type\" >&5\necho $ECHO_N \"checking build system type... $ECHO_C\" >&6\nif test \"${ac_cv_build+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  ac_cv_build_alias=$build_alias\ntest -z \"$ac_cv_build_alias\" &&\n  ac_cv_build_alias=`$ac_config_guess`\ntest -z \"$ac_cv_build_alias\" &&\n  { { echo \"$as_me:$LINENO: error: cannot guess build type; you must specify one\" >&5\necho \"$as_me: error: cannot guess build type; you must specify one\" >&2;}\n   { (exit 1); exit 1; }; }\nac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||\n  { { echo \"$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed\" >&5\necho \"$as_me: error: $ac_config_sub $ac_cv_build_alias failed\" >&2;}\n   { (exit 1); exit 1; }; }\n\nfi\necho \"$as_me:$LINENO: result: $ac_cv_build\" >&5\necho \"${ECHO_T}$ac_cv_build\" >&6\nbuild=$ac_cv_build\nbuild_cpu=`echo $ac_cv_build | sed 's/^\\([^-]*\\)-\\([^-]*\\)-\\(.*\\)$/\\1/'`\nbuild_vendor=`echo $ac_cv_build | sed 's/^\\([^-]*\\)-\\([^-]*\\)-\\(.*\\)$/\\2/'`\nbuild_os=`echo $ac_cv_build | sed 's/^\\([^-]*\\)-\\([^-]*\\)-\\(.*\\)$/\\3/'`\n\n\necho \"$as_me:$LINENO: checking host system type\" >&5\necho $ECHO_N \"checking host system type... $ECHO_C\" >&6\nif test \"${ac_cv_host+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  ac_cv_host_alias=$host_alias\ntest -z \"$ac_cv_host_alias\" &&\n  ac_cv_host_alias=$ac_cv_build_alias\nac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||\n  { { echo \"$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed\" >&5\necho \"$as_me: error: $ac_config_sub $ac_cv_host_alias failed\" >&2;}\n   { (exit 1); exit 1; }; }\n\nfi\necho \"$as_me:$LINENO: result: $ac_cv_host\" >&5\necho \"${ECHO_T}$ac_cv_host\" >&6\nhost=$ac_cv_host\nhost_cpu=`echo $ac_cv_host | sed 's/^\\([^-]*\\)-\\([^-]*\\)-\\(.*\\)$/\\1/'`\nhost_vendor=`echo $ac_cv_host | sed 's/^\\([^-]*\\)-\\([^-]*\\)-\\(.*\\)$/\\2/'`\nhost_os=`echo $ac_cv_host | sed 's/^\\([^-]*\\)-\\([^-]*\\)-\\(.*\\)$/\\3/'`\n\n\necho \"$as_me:$LINENO: checking for a sed that does not truncate output\" >&5\necho $ECHO_N \"checking for a sed that does not truncate output... $ECHO_C\" >&6\nif test \"${lt_cv_path_SED+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  # Loop through the user's path and test for sed and gsed.\n# Then use that list of sed's as ones to test for truncation.\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for lt_ac_prog in sed gsed; do\n    for ac_exec_ext in '' $ac_executable_extensions; do\n      if $as_executable_p \"$as_dir/$lt_ac_prog$ac_exec_ext\"; then\n        lt_ac_sed_list=\"$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext\"\n      fi\n    done\n  done\ndone\nlt_ac_max=0\nlt_ac_count=0\n# Add /usr/xpg4/bin/sed as it is typically found on Solaris\n# along with /bin/sed that truncates output.\nfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do\n  test ! -f $lt_ac_sed && break\n  cat /dev/null > conftest.in\n  lt_ac_count=0\n  echo $ECHO_N \"0123456789$ECHO_C\" >conftest.in\n  # Check for GNU sed and select it if it is found.\n  if \"$lt_ac_sed\" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then\n    lt_cv_path_SED=$lt_ac_sed\n    break\n  fi\n  while true; do\n    cat conftest.in conftest.in >conftest.tmp\n    mv conftest.tmp conftest.in\n    cp conftest.in conftest.nl\n    echo >>conftest.nl\n    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break\n    cmp -s conftest.out conftest.nl || break\n    # 10000 chars as input seems more than enough\n    test $lt_ac_count -gt 10 && break\n    lt_ac_count=`expr $lt_ac_count + 1`\n    if test $lt_ac_count -gt $lt_ac_max; then\n      lt_ac_max=$lt_ac_count\n      lt_cv_path_SED=$lt_ac_sed\n    fi\n  done\ndone\nSED=$lt_cv_path_SED\n\nfi\n\necho \"$as_me:$LINENO: result: $SED\" >&5\necho \"${ECHO_T}$SED\" >&6\n\necho \"$as_me:$LINENO: checking for egrep\" >&5\necho $ECHO_N \"checking for egrep... $ECHO_C\" >&6\nif test \"${ac_cv_prog_egrep+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if echo a | (grep -E '(a|b)') >/dev/null 2>&1\n    then ac_cv_prog_egrep='grep -E'\n    else ac_cv_prog_egrep='egrep'\n    fi\nfi\necho \"$as_me:$LINENO: result: $ac_cv_prog_egrep\" >&5\necho \"${ECHO_T}$ac_cv_prog_egrep\" >&6\n EGREP=$ac_cv_prog_egrep\n\n\n\n# Check whether --with-gnu-ld or --without-gnu-ld was given.\nif test \"${with_gnu_ld+set}\" = set; then\n  withval=\"$with_gnu_ld\"\n  test \"$withval\" = no || with_gnu_ld=yes\nelse\n  with_gnu_ld=no\nfi;\nac_prog=ld\nif test \"$GCC\" = yes; then\n  # Check if gcc -print-prog-name=ld gives a path.\n  echo \"$as_me:$LINENO: checking for ld used by $CC\" >&5\necho $ECHO_N \"checking for ld used by $CC... $ECHO_C\" >&6\n  case $host in\n  *-*-mingw*)\n    # gcc leaves a trailing carriage return which upsets mingw\n    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\\015'` ;;\n  *)\n    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;\n  esac\n  case $ac_prog in\n    # Accept absolute paths.\n    [\\\\/]* | ?:[\\\\/]*)\n      re_direlt='/[^/][^/]*/\\.\\./'\n      # Canonicalize the pathname of ld\n      ac_prog=`echo $ac_prog| $SED 's%\\\\\\\\%/%g'`\n      while echo $ac_prog | grep \"$re_direlt\" > /dev/null 2>&1; do\n\tac_prog=`echo $ac_prog| $SED \"s%$re_direlt%/%\"`\n      done\n      test -z \"$LD\" && LD=\"$ac_prog\"\n      ;;\n  \"\")\n    # If it fails, then pretend we aren't using GCC.\n    ac_prog=ld\n    ;;\n  *)\n    # If it is relative, then search for the first ld in PATH.\n    with_gnu_ld=unknown\n    ;;\n  esac\nelif test \"$with_gnu_ld\" = yes; then\n  echo \"$as_me:$LINENO: checking for GNU ld\" >&5\necho $ECHO_N \"checking for GNU ld... $ECHO_C\" >&6\nelse\n  echo \"$as_me:$LINENO: checking for non-GNU ld\" >&5\necho $ECHO_N \"checking for non-GNU ld... $ECHO_C\" >&6\nfi\nif test \"${lt_cv_path_LD+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -z \"$LD\"; then\n  lt_save_ifs=\"$IFS\"; IFS=$PATH_SEPARATOR\n  for ac_dir in $PATH; do\n    IFS=\"$lt_save_ifs\"\n    test -z \"$ac_dir\" && ac_dir=.\n    if test -f \"$ac_dir/$ac_prog\" || test -f \"$ac_dir/$ac_prog$ac_exeext\"; then\n      lt_cv_path_LD=\"$ac_dir/$ac_prog\"\n      # Check to see if the program is GNU ld.  I'd rather use --version,\n      # but apparently some GNU ld's only accept -v.\n      # Break only if it was the GNU/non-GNU ld that we prefer.\n      case `\"$lt_cv_path_LD\" -v 2>&1 </dev/null` in\n      *GNU* | *'with BFD'*)\n\ttest \"$with_gnu_ld\" != no && break\n\t;;\n      *)\n\ttest \"$with_gnu_ld\" != yes && break\n\t;;\n      esac\n    fi\n  done\n  IFS=\"$lt_save_ifs\"\nelse\n  lt_cv_path_LD=\"$LD\" # Let the user override the test with a path.\nfi\nfi\n\nLD=\"$lt_cv_path_LD\"\nif test -n \"$LD\"; then\n  echo \"$as_me:$LINENO: result: $LD\" >&5\necho \"${ECHO_T}$LD\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\ntest -z \"$LD\" && { { echo \"$as_me:$LINENO: error: no acceptable ld found in \\$PATH\" >&5\necho \"$as_me: error: no acceptable ld found in \\$PATH\" >&2;}\n   { (exit 1); exit 1; }; }\necho \"$as_me:$LINENO: checking if the linker ($LD) is GNU ld\" >&5\necho $ECHO_N \"checking if the linker ($LD) is GNU ld... $ECHO_C\" >&6\nif test \"${lt_cv_prog_gnu_ld+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  # I'd rather use --version here, but apparently some GNU ld's only accept -v.\ncase `$LD -v 2>&1 </dev/null` in\n*GNU* | *'with BFD'*)\n  lt_cv_prog_gnu_ld=yes\n  ;;\n*)\n  lt_cv_prog_gnu_ld=no\n  ;;\nesac\nfi\necho \"$as_me:$LINENO: result: $lt_cv_prog_gnu_ld\" >&5\necho \"${ECHO_T}$lt_cv_prog_gnu_ld\" >&6\nwith_gnu_ld=$lt_cv_prog_gnu_ld\n\n\necho \"$as_me:$LINENO: checking for $LD option to reload object files\" >&5\necho $ECHO_N \"checking for $LD option to reload object files... $ECHO_C\" >&6\nif test \"${lt_cv_ld_reload_flag+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  lt_cv_ld_reload_flag='-r'\nfi\necho \"$as_me:$LINENO: result: $lt_cv_ld_reload_flag\" >&5\necho \"${ECHO_T}$lt_cv_ld_reload_flag\" >&6\nreload_flag=$lt_cv_ld_reload_flag\ncase $reload_flag in\n\"\" | \" \"*) ;;\n*) reload_flag=\" $reload_flag\" ;;\nesac\nreload_cmds='$LD$reload_flag -o $output$reload_objs'\n\necho \"$as_me:$LINENO: checking for BSD-compatible nm\" >&5\necho $ECHO_N \"checking for BSD-compatible nm... $ECHO_C\" >&6\nif test \"${lt_cv_path_NM+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$NM\"; then\n  # Let the user override the test.\n  lt_cv_path_NM=\"$NM\"\nelse\n  lt_save_ifs=\"$IFS\"; IFS=$PATH_SEPARATOR\n  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do\n    IFS=\"$lt_save_ifs\"\n    test -z \"$ac_dir\" && ac_dir=.\n    tmp_nm=\"$ac_dir/${ac_tool_prefix}nm\"\n    if test -f \"$tmp_nm\" || test -f \"$tmp_nm$ac_exeext\" ; then\n      # Check to see if the nm accepts a BSD-compat flag.\n      # Adding the `sed 1q' prevents false positives on HP-UX, which says:\n      #   nm: unknown option \"B\" ignored\n      # Tru64's nm complains that /dev/null is an invalid object file\n      case `\"$tmp_nm\" -B /dev/null 2>&1 | sed '1q'` in\n      */dev/null* | *'Invalid file or object type'*)\n\tlt_cv_path_NM=\"$tmp_nm -B\"\n\tbreak\n        ;;\n      *)\n\tcase `\"$tmp_nm\" -p /dev/null 2>&1 | sed '1q'` in\n\t*/dev/null*)\n\t  lt_cv_path_NM=\"$tmp_nm -p\"\n\t  break\n\t  ;;\n\t*)\n\t  lt_cv_path_NM=${lt_cv_path_NM=\"$tmp_nm\"} # keep the first match, but\n\t  continue # so that we can try to find one that supports BSD flags\n\t  ;;\n\tesac\n      esac\n    fi\n  done\n  IFS=\"$lt_save_ifs\"\n  test -z \"$lt_cv_path_NM\" && lt_cv_path_NM=nm\nfi\nfi\necho \"$as_me:$LINENO: result: $lt_cv_path_NM\" >&5\necho \"${ECHO_T}$lt_cv_path_NM\" >&6\nNM=\"$lt_cv_path_NM\"\n\necho \"$as_me:$LINENO: checking whether ln -s works\" >&5\necho $ECHO_N \"checking whether ln -s works... $ECHO_C\" >&6\nLN_S=$as_ln_s\nif test \"$LN_S\" = \"ln -s\"; then\n  echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no, using $LN_S\" >&5\necho \"${ECHO_T}no, using $LN_S\" >&6\nfi\n\necho \"$as_me:$LINENO: checking how to recognise dependent libraries\" >&5\necho $ECHO_N \"checking how to recognise dependent libraries... $ECHO_C\" >&6\nif test \"${lt_cv_deplibs_check_method+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  lt_cv_file_magic_cmd='$MAGIC_CMD'\nlt_cv_file_magic_test_file=\nlt_cv_deplibs_check_method='unknown'\n# Need to set the preceding variable on all platforms that support\n# interlibrary dependencies.\n# 'none' -- dependencies not supported.\n# `unknown' -- same as none, but documents that we really don't know.\n# 'pass_all' -- all dependencies passed with no checks.\n# 'test_compile' -- check by making test program.\n# 'file_magic [[regex]]' -- check by looking for files in library path\n# which responds to the $file_magic_cmd with a given extended regex.\n# If you have `file' or equivalent on your system and you're not sure\n# whether `pass_all' will *always* work, you probably want this one.\n\ncase $host_os in\naix4* | aix5*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nbeos*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nbsdi4*)\n  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'\n  lt_cv_file_magic_cmd='/usr/bin/file -L'\n  lt_cv_file_magic_test_file=/shlib/libc.so\n  ;;\n\ncygwin*)\n  # func_win32_libid is a shell function defined in ltmain.sh\n  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'\n  lt_cv_file_magic_cmd='func_win32_libid'\n  ;;\n\nmingw* | pw32*)\n  # Base MSYS/MinGW do not provide the 'file' command needed by\n  # func_win32_libid shell function, so use a weaker test based on 'objdump'.\n  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'\n  lt_cv_file_magic_cmd='$OBJDUMP -f'\n  ;;\n\ndarwin* | rhapsody*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nfreebsd* | kfreebsd*-gnu)\n  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then\n    case $host_cpu in\n    i*86 )\n      # Not sure whether the presence of OpenBSD here was a mistake.\n      # Let's accept both of them until this is cleared up.\n      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'\n      lt_cv_file_magic_cmd=/usr/bin/file\n      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`\n      ;;\n    esac\n  else\n    lt_cv_deplibs_check_method=pass_all\n  fi\n  ;;\n\ngnu*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nhpux10.20* | hpux11*)\n  lt_cv_file_magic_cmd=/usr/bin/file\n  case \"$host_cpu\" in\n  ia64*)\n    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'\n    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so\n    ;;\n  hppa*64*)\n    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'\n    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl\n    ;;\n  *)\n    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'\n    lt_cv_file_magic_test_file=/usr/lib/libc.sl\n    ;;\n  esac\n  ;;\n\nirix5* | irix6* | nonstopux*)\n  case $LD in\n  *-32|*\"-32 \") libmagic=32-bit;;\n  *-n32|*\"-n32 \") libmagic=N32;;\n  *-64|*\"-64 \") libmagic=64-bit;;\n  *) libmagic=never-match;;\n  esac\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\n# This must be Linux ELF.\nlinux*)\n  case $host_cpu in\n  alpha*|hppa*|i*86|ia64*|m68*|mips*|powerpc*|sparc*|s390*|sh*|x86_64*)\n    lt_cv_deplibs_check_method=pass_all ;;\n  *)\n    # glibc up to 2.1.1 does not perform some relocations on ARM\n    # this will be overridden with pass_all, but let us keep it just in case\n    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;\n  esac\n  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nnetbsd*)\n  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then\n    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\\.so\\.[0-9]+\\.[0-9]+|_pic\\.a)$'\n  else\n    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\\.so|_pic\\.a)$'\n  fi\n  ;;\n\nnewos6*)\n  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'\n  lt_cv_file_magic_cmd=/usr/bin/file\n  lt_cv_file_magic_test_file=/usr/lib/libnls.so\n  ;;\n\nnto-qnx*)\n  lt_cv_deplibs_check_method=unknown\n  ;;\n\nopenbsd*)\n  lt_cv_file_magic_cmd=/usr/bin/file\n  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`\n  if test -z \"`echo __ELF__ | $CC -E - | grep __ELF__`\" || test \"$host_os-$host_cpu\" = \"openbsd2.8-powerpc\"; then\n    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'\n  else\n    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'\n  fi\n  ;;\n\nosf3* | osf4* | osf5*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nsco3.2v5*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nsolaris*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\n\nsysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)\n  case $host_vendor in\n  motorola)\n    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]'\n    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`\n    ;;\n  ncr)\n    lt_cv_deplibs_check_method=pass_all\n    ;;\n  sequent)\n    lt_cv_file_magic_cmd='/bin/file'\n    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'\n    ;;\n  sni)\n    lt_cv_file_magic_cmd='/bin/file'\n    lt_cv_deplibs_check_method=\"file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib\"\n    lt_cv_file_magic_test_file=/lib/libc.so\n    ;;\n  siemens)\n    lt_cv_deplibs_check_method=pass_all\n    ;;\n  esac\n  ;;\n\nsysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*)\n  lt_cv_deplibs_check_method=pass_all\n  ;;\nesac\n\nfi\necho \"$as_me:$LINENO: result: $lt_cv_deplibs_check_method\" >&5\necho \"${ECHO_T}$lt_cv_deplibs_check_method\" >&6\nfile_magic_cmd=$lt_cv_file_magic_cmd\ndeplibs_check_method=$lt_cv_deplibs_check_method\ntest -z \"$deplibs_check_method\" && deplibs_check_method=unknown\n\n\n\n\n# If no C compiler was specified, use CC.\nLTCC=${LTCC-\"$CC\"}\n\n# Allow CC to be a program name with arguments.\ncompiler=$CC\n\n\n# Check whether --enable-libtool-lock or --disable-libtool-lock was given.\nif test \"${enable_libtool_lock+set}\" = set; then\n  enableval=\"$enable_libtool_lock\"\n\nfi;\ntest \"x$enable_libtool_lock\" != xno && enable_libtool_lock=yes\n\n# Some flags need to be propagated to the compiler or linker for good\n# libtool support.\ncase $host in\nia64-*-hpux*)\n  # Find out which ABI we are using.\n  echo 'int i;' > conftest.$ac_ext\n  if { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; then\n    case `/usr/bin/file conftest.$ac_objext` in\n    *ELF-32*)\n      HPUX_IA64_MODE=\"32\"\n      ;;\n    *ELF-64*)\n      HPUX_IA64_MODE=\"64\"\n      ;;\n    esac\n  fi\n  rm -rf conftest*\n  ;;\n*-*-irix6*)\n  # Find out which ABI we are using.\n  echo '#line 5018 \"configure\"' > conftest.$ac_ext\n  if { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; then\n   if test \"$lt_cv_prog_gnu_ld\" = yes; then\n    case `/usr/bin/file conftest.$ac_objext` in\n    *32-bit*)\n      LD=\"${LD-ld} -melf32bsmip\"\n      ;;\n    *N32*)\n      LD=\"${LD-ld} -melf32bmipn32\"\n      ;;\n    *64-bit*)\n      LD=\"${LD-ld} -melf64bmip\"\n      ;;\n    esac\n   else\n    case `/usr/bin/file conftest.$ac_objext` in\n    *32-bit*)\n      LD=\"${LD-ld} -32\"\n      ;;\n    *N32*)\n      LD=\"${LD-ld} -n32\"\n      ;;\n    *64-bit*)\n      LD=\"${LD-ld} -64\"\n      ;;\n    esac\n   fi\n  fi\n  rm -rf conftest*\n  ;;\n\nx86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)\n  # Find out which ABI we are using.\n  echo 'int i;' > conftest.$ac_ext\n  if { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; then\n    case \"`/usr/bin/file conftest.o`\" in\n    *32-bit*)\n      case $host in\n        x86_64-*linux*)\n          LD=\"${LD-ld} -m elf_i386\"\n          ;;\n        ppc64-*linux*|powerpc64-*linux*)\n          LD=\"${LD-ld} -m elf32ppclinux\"\n          ;;\n        s390x-*linux*)\n          LD=\"${LD-ld} -m elf_s390\"\n          ;;\n        sparc64-*linux*)\n          LD=\"${LD-ld} -m elf32_sparc\"\n          ;;\n      esac\n      ;;\n    *64-bit*)\n      case $host in\n        x86_64-*linux*)\n          LD=\"${LD-ld} -m elf_x86_64\"\n          ;;\n        ppc*-*linux*|powerpc*-*linux*)\n          LD=\"${LD-ld} -m elf64ppc\"\n          ;;\n        s390*-*linux*)\n          LD=\"${LD-ld} -m elf64_s390\"\n          ;;\n        sparc*-*linux*)\n          LD=\"${LD-ld} -m elf64_sparc\"\n          ;;\n      esac\n      ;;\n    esac\n  fi\n  rm -rf conftest*\n  ;;\n\n*-*-sco3.2v5*)\n  # On SCO OpenServer 5, we need -belf to get full-featured binaries.\n  SAVE_CFLAGS=\"$CFLAGS\"\n  CFLAGS=\"$CFLAGS -belf\"\n  echo \"$as_me:$LINENO: checking whether the C compiler needs -belf\" >&5\necho $ECHO_N \"checking whether the C compiler needs -belf... $ECHO_C\" >&6\nif test \"${lt_cv_cc_needs_belf+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  ac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\n     cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  lt_cv_cc_needs_belf=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nlt_cv_cc_needs_belf=no\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\n     ac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\nfi\necho \"$as_me:$LINENO: result: $lt_cv_cc_needs_belf\" >&5\necho \"${ECHO_T}$lt_cv_cc_needs_belf\" >&6\n  if test x\"$lt_cv_cc_needs_belf\" != x\"yes\"; then\n    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf\n    CFLAGS=\"$SAVE_CFLAGS\"\n  fi\n  ;;\n\nesac\n\nneed_locks=\"$enable_libtool_lock\"\n\n\n\necho \"$as_me:$LINENO: checking for ANSI C header files\" >&5\necho $ECHO_N \"checking for ANSI C header files... $ECHO_C\" >&6\nif test \"${ac_cv_header_stdc+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#include <stdlib.h>\n#include <stdarg.h>\n#include <string.h>\n#include <float.h>\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_header_stdc=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_header_stdc=no\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\n\nif test $ac_cv_header_stdc = yes; then\n  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#include <string.h>\n\n_ACEOF\nif (eval \"$ac_cpp conftest.$ac_ext\") 2>&5 |\n  $EGREP \"memchr\" >/dev/null 2>&1; then\n  :\nelse\n  ac_cv_header_stdc=no\nfi\nrm -f conftest*\n\nfi\n\nif test $ac_cv_header_stdc = yes; then\n  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#include <stdlib.h>\n\n_ACEOF\nif (eval \"$ac_cpp conftest.$ac_ext\") 2>&5 |\n  $EGREP \"free\" >/dev/null 2>&1; then\n  :\nelse\n  ac_cv_header_stdc=no\nfi\nrm -f conftest*\n\nfi\n\nif test $ac_cv_header_stdc = yes; then\n  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.\n  if test \"$cross_compiling\" = yes; then\n  :\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#include <ctype.h>\n#if ((' ' & 0x0FF) == 0x020)\n# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')\n# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))\n#else\n# define ISLOWER(c) \\\n\t\t   (('a' <= (c) && (c) <= 'i') \\\n\t\t     || ('j' <= (c) && (c) <= 'r') \\\n\t\t     || ('s' <= (c) && (c) <= 'z'))\n# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))\n#endif\n\n#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))\nint\nmain ()\n{\n  int i;\n  for (i = 0; i < 256; i++)\n    if (XOR (islower (i), ISLOWER (i))\n\t|| toupper (i) != TOUPPER (i))\n      exit(2);\n  exit (0);\n}\n_ACEOF\nrm -f conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  :\nelse\n  echo \"$as_me: program exited with status $ac_status\" >&5\necho \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n( exit $ac_status )\nac_cv_header_stdc=no\nfi\nrm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext\nfi\nfi\nfi\necho \"$as_me:$LINENO: result: $ac_cv_header_stdc\" >&5\necho \"${ECHO_T}$ac_cv_header_stdc\" >&6\nif test $ac_cv_header_stdc = yes; then\n\ncat >>confdefs.h <<\\_ACEOF\n#define STDC_HEADERS 1\n_ACEOF\n\nfi\n\n# On IRIX 5.3, sys/types and inttypes.h are conflicting.\n\n\n\n\n\n\n\n\n\nfor ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \\\n\t\t  inttypes.h stdint.h unistd.h\ndo\nas_ac_Header=`echo \"ac_cv_header_$ac_header\" | $as_tr_sh`\necho \"$as_me:$LINENO: checking for $ac_header\" >&5\necho $ECHO_N \"checking for $ac_header... $ECHO_C\" >&6\nif eval \"test \\\"\\${$as_ac_Header+set}\\\" = set\"; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_includes_default\n\n#include <$ac_header>\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  eval \"$as_ac_Header=yes\"\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\neval \"$as_ac_Header=no\"\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\necho \"$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`\" >&5\necho \"${ECHO_T}`eval echo '${'$as_ac_Header'}'`\" >&6\nif test `eval echo '${'$as_ac_Header'}'` = yes; then\n  cat >>confdefs.h <<_ACEOF\n#define `echo \"HAVE_$ac_header\" | $as_tr_cpp` 1\n_ACEOF\n\nfi\n\ndone\n\n\n\nfor ac_header in dlfcn.h\ndo\nas_ac_Header=`echo \"ac_cv_header_$ac_header\" | $as_tr_sh`\nif eval \"test \\\"\\${$as_ac_Header+set}\\\" = set\"; then\n  echo \"$as_me:$LINENO: checking for $ac_header\" >&5\necho $ECHO_N \"checking for $ac_header... $ECHO_C\" >&6\nif eval \"test \\\"\\${$as_ac_Header+set}\\\" = set\"; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nfi\necho \"$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`\" >&5\necho \"${ECHO_T}`eval echo '${'$as_ac_Header'}'`\" >&6\nelse\n  # Is the header compilable?\necho \"$as_me:$LINENO: checking $ac_header usability\" >&5\necho $ECHO_N \"checking $ac_header usability... $ECHO_C\" >&6\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_includes_default\n#include <$ac_header>\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_header_compiler=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_header_compiler=no\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\necho \"$as_me:$LINENO: result: $ac_header_compiler\" >&5\necho \"${ECHO_T}$ac_header_compiler\" >&6\n\n# Is the header present?\necho \"$as_me:$LINENO: checking $ac_header presence\" >&5\necho $ECHO_N \"checking $ac_header presence... $ECHO_C\" >&6\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#include <$ac_header>\n_ACEOF\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_cpp conftest.$ac_ext\\\"\") >&5\n  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } >/dev/null; then\n  if test -s conftest.err; then\n    ac_cpp_err=$ac_c_preproc_warn_flag\n    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag\n  else\n    ac_cpp_err=\n  fi\nelse\n  ac_cpp_err=yes\nfi\nif test -z \"$ac_cpp_err\"; then\n  ac_header_preproc=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n  ac_header_preproc=no\nfi\nrm -f conftest.err conftest.$ac_ext\necho \"$as_me:$LINENO: result: $ac_header_preproc\" >&5\necho \"${ECHO_T}$ac_header_preproc\" >&6\n\n# So?  What about this header?\ncase $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in\n  yes:no: )\n    { echo \"$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!\" >&5\necho \"$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result\" >&5\necho \"$as_me: WARNING: $ac_header: proceeding with the compiler's result\" >&2;}\n    ac_header_preproc=yes\n    ;;\n  no:yes:* )\n    { echo \"$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled\" >&5\necho \"$as_me: WARNING: $ac_header: present but cannot be compiled\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?\" >&5\necho \"$as_me: WARNING: $ac_header:     check for missing prerequisite headers?\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation\" >&5\necho \"$as_me: WARNING: $ac_header: see the Autoconf documentation\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: $ac_header:     section \\\"Present But Cannot Be Compiled\\\"\" >&5\necho \"$as_me: WARNING: $ac_header:     section \\\"Present But Cannot Be Compiled\\\"\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result\" >&5\necho \"$as_me: WARNING: $ac_header: proceeding with the preprocessor's result\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence\" >&5\necho \"$as_me: WARNING: $ac_header: in the future, the compiler will take precedence\" >&2;}\n    (\n      cat <<\\_ASBOX\n## ---------------------------------------- ##\n## Report this to the libjpeg-turbo lists.  ##\n## ---------------------------------------- ##\n_ASBOX\n    ) |\n      sed \"s/^/$as_me: WARNING:     /\" >&2\n    ;;\nesac\necho \"$as_me:$LINENO: checking for $ac_header\" >&5\necho $ECHO_N \"checking for $ac_header... $ECHO_C\" >&6\nif eval \"test \\\"\\${$as_ac_Header+set}\\\" = set\"; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  eval \"$as_ac_Header=\\$ac_header_preproc\"\nfi\necho \"$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`\" >&5\necho \"${ECHO_T}`eval echo '${'$as_ac_Header'}'`\" >&6\n\nfi\nif test `eval echo '${'$as_ac_Header'}'` = yes; then\n  cat >>confdefs.h <<_ACEOF\n#define `echo \"HAVE_$ac_header\" | $as_tr_cpp` 1\n_ACEOF\n\nfi\n\ndone\n\nac_ext=cc\nac_cpp='$CXXCPP $CPPFLAGS'\nac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_cxx_compiler_gnu\nif test -n \"$ac_tool_prefix\"; then\n  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC\n  do\n    # Extract the first word of \"$ac_tool_prefix$ac_prog\", so it can be a program name with args.\nset dummy $ac_tool_prefix$ac_prog; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_CXX+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$CXX\"; then\n  ac_cv_prog_CXX=\"$CXX\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_CXX=\"$ac_tool_prefix$ac_prog\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nCXX=$ac_cv_prog_CXX\nif test -n \"$CXX\"; then\n  echo \"$as_me:$LINENO: result: $CXX\" >&5\necho \"${ECHO_T}$CXX\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\n    test -n \"$CXX\" && break\n  done\nfi\nif test -z \"$CXX\"; then\n  ac_ct_CXX=$CXX\n  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_ac_ct_CXX+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$ac_ct_CXX\"; then\n  ac_cv_prog_ac_ct_CXX=\"$ac_ct_CXX\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_CXX=\"$ac_prog\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nac_ct_CXX=$ac_cv_prog_ac_ct_CXX\nif test -n \"$ac_ct_CXX\"; then\n  echo \"$as_me:$LINENO: result: $ac_ct_CXX\" >&5\necho \"${ECHO_T}$ac_ct_CXX\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\n  test -n \"$ac_ct_CXX\" && break\ndone\ntest -n \"$ac_ct_CXX\" || ac_ct_CXX=\"g++\"\n\n  CXX=$ac_ct_CXX\nfi\n\n\n# Provide some information about the compiler.\necho \"$as_me:$LINENO:\" \\\n     \"checking for C++ compiler version\" >&5\nac_compiler=`set X $ac_compile; echo $2`\n{ (eval echo \"$as_me:$LINENO: \\\"$ac_compiler --version </dev/null >&5\\\"\") >&5\n  (eval $ac_compiler --version </dev/null >&5) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }\n{ (eval echo \"$as_me:$LINENO: \\\"$ac_compiler -v </dev/null >&5\\\"\") >&5\n  (eval $ac_compiler -v </dev/null >&5) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }\n{ (eval echo \"$as_me:$LINENO: \\\"$ac_compiler -V </dev/null >&5\\\"\") >&5\n  (eval $ac_compiler -V </dev/null >&5) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }\n\necho \"$as_me:$LINENO: checking whether we are using the GNU C++ compiler\" >&5\necho $ECHO_N \"checking whether we are using the GNU C++ compiler... $ECHO_C\" >&6\nif test \"${ac_cv_cxx_compiler_gnu+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n#ifndef __GNUC__\n       choke me\n#endif\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_cxx_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_compiler_gnu=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_compiler_gnu=no\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\nac_cv_cxx_compiler_gnu=$ac_compiler_gnu\n\nfi\necho \"$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu\" >&5\necho \"${ECHO_T}$ac_cv_cxx_compiler_gnu\" >&6\nGXX=`test $ac_compiler_gnu = yes && echo yes`\nac_test_CXXFLAGS=${CXXFLAGS+set}\nac_save_CXXFLAGS=$CXXFLAGS\nCXXFLAGS=\"-g\"\necho \"$as_me:$LINENO: checking whether $CXX accepts -g\" >&5\necho $ECHO_N \"checking whether $CXX accepts -g... $ECHO_C\" >&6\nif test \"${ac_cv_prog_cxx_g+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_cxx_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_prog_cxx_g=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_prog_cxx_g=no\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\necho \"$as_me:$LINENO: result: $ac_cv_prog_cxx_g\" >&5\necho \"${ECHO_T}$ac_cv_prog_cxx_g\" >&6\nif test \"$ac_test_CXXFLAGS\" = set; then\n  CXXFLAGS=$ac_save_CXXFLAGS\nelif test $ac_cv_prog_cxx_g = yes; then\n  if test \"$GXX\" = yes; then\n    CXXFLAGS=\"-g -O2\"\n  else\n    CXXFLAGS=\"-g\"\n  fi\nelse\n  if test \"$GXX\" = yes; then\n    CXXFLAGS=\"-O2\"\n  else\n    CXXFLAGS=\n  fi\nfi\nfor ac_declaration in \\\n   '' \\\n   'extern \"C\" void std::exit (int) throw (); using std::exit;' \\\n   'extern \"C\" void std::exit (int); using std::exit;' \\\n   'extern \"C\" void exit (int) throw ();' \\\n   'extern \"C\" void exit (int);' \\\n   'void exit (int);'\ndo\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_declaration\n#include <stdlib.h>\nint\nmain ()\n{\nexit (42);\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_cxx_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  :\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\ncontinue\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_declaration\nint\nmain ()\n{\nexit (42);\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_cxx_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  break\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\ndone\nrm -f conftest*\nif test -n \"$ac_declaration\"; then\n  echo '#ifdef __cplusplus' >>confdefs.h\n  echo $ac_declaration      >>confdefs.h\n  echo '#endif'             >>confdefs.h\nfi\n\nac_ext=cc\nac_cpp='$CXXCPP $CPPFLAGS'\nac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_cxx_compiler_gnu\n\ndepcc=\"$CXX\"  am_compiler_list=\n\necho \"$as_me:$LINENO: checking dependency style of $depcc\" >&5\necho $ECHO_N \"checking dependency style of $depcc... $ECHO_C\" >&6\nif test \"${am_cv_CXX_dependencies_compiler_type+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -z \"$AMDEP_TRUE\" && test -f \"$am_depcomp\"; then\n  # We make a subdir and do the tests there.  Otherwise we can end up\n  # making bogus files that we don't know about and never remove.  For\n  # instance it was reported that on HP-UX the gcc test will end up\n  # making a dummy file named `D' -- because `-MD' means `put the output\n  # in D'.\n  mkdir conftest.dir\n  # Copy depcomp to subdir because otherwise we won't find it if we're\n  # using a relative directory.\n  cp \"$am_depcomp\" conftest.dir\n  cd conftest.dir\n  # We will build objects and dependencies in a subdirectory because\n  # it helps to detect inapplicable dependency modes.  For instance\n  # both Tru64's cc and ICC support -MD to output dependencies as a\n  # side effect of compilation, but ICC will put the dependencies in\n  # the current directory while Tru64 will put them in the object\n  # directory.\n  mkdir sub\n\n  am_cv_CXX_dependencies_compiler_type=none\n  if test \"$am_compiler_list\" = \"\"; then\n     am_compiler_list=`sed -n 's/^#*\\([a-zA-Z0-9]*\\))$/\\1/p' < ./depcomp`\n  fi\n  for depmode in $am_compiler_list; do\n    # Setup a source with many dependencies, because some compilers\n    # like to wrap large dependency lists on column 80 (with \\), and\n    # we should not choose a depcomp mode which is confused by this.\n    #\n    # We need to recreate these files for each test, as the compiler may\n    # overwrite some of them when testing with obscure command lines.\n    # This happens at least with the AIX C compiler.\n    : > sub/conftest.c\n    for i in 1 2 3 4 5 6; do\n      echo '#include \"conftst'$i'.h\"' >> sub/conftest.c\n      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with\n      # Solaris 8's {/usr,}/bin/sh.\n      touch sub/conftst$i.h\n    done\n    echo \"${am__include} ${am__quote}sub/conftest.Po${am__quote}\" > confmf\n\n    case $depmode in\n    nosideeffect)\n      # after this tag, mechanisms are not by side-effect, so they'll\n      # only be used when explicitly requested\n      if test \"x$enable_dependency_tracking\" = xyes; then\n\tcontinue\n      else\n\tbreak\n      fi\n      ;;\n    none) break ;;\n    esac\n    # We check with `-c' and `-o' for the sake of the \"dashmstdout\"\n    # mode.  It turns out that the SunPro C++ compiler does not properly\n    # handle `-M -o', and we need to detect this.\n    if depmode=$depmode \\\n       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \\\n       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \\\n       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \\\n         >/dev/null 2>conftest.err &&\n       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&\n       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&\n       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then\n      # icc doesn't choke on unknown options, it will just issue warnings\n      # or remarks (even with -Werror).  So we grep stderr for any message\n      # that says an option was ignored or not supported.\n      # When given -MP, icc 7.0 and 7.1 complain thusly:\n      #   icc: Command line warning: ignoring option '-M'; no argument required\n      # The diagnosis changed in icc 8.0:\n      #   icc: Command line remark: option '-MP' not supported\n      if (grep 'ignoring option' conftest.err ||\n          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else\n        am_cv_CXX_dependencies_compiler_type=$depmode\n        break\n      fi\n    fi\n  done\n\n  cd ..\n  rm -rf conftest.dir\nelse\n  am_cv_CXX_dependencies_compiler_type=none\nfi\n\nfi\necho \"$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type\" >&5\necho \"${ECHO_T}$am_cv_CXX_dependencies_compiler_type\" >&6\nCXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type\n\n\n\nif\n  test \"x$enable_dependency_tracking\" != xno \\\n  && test \"$am_cv_CXX_dependencies_compiler_type\" = gcc3; then\n  am__fastdepCXX_TRUE=\n  am__fastdepCXX_FALSE='#'\nelse\n  am__fastdepCXX_TRUE='#'\n  am__fastdepCXX_FALSE=\nfi\n\n\nac_ext=cc\nac_cpp='$CXXCPP $CPPFLAGS'\nac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_cxx_compiler_gnu\necho \"$as_me:$LINENO: checking how to run the C++ preprocessor\" >&5\necho $ECHO_N \"checking how to run the C++ preprocessor... $ECHO_C\" >&6\nif test -z \"$CXXCPP\"; then\n  if test \"${ac_cv_prog_CXXCPP+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n      # Double quotes because CXXCPP needs to be expanded\n    for CXXCPP in \"$CXX -E\" \"/lib/cpp\"\n    do\n      ac_preproc_ok=false\nfor ac_cxx_preproc_warn_flag in '' yes\ndo\n  # Use a header file that comes with gcc, so configuring glibc\n  # with a fresh cross-compiler works.\n  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since\n  # <limits.h> exists even on freestanding compilers.\n  # On the NeXT, cc -E runs the code through the compiler's parser,\n  # not just through cpp. \"Syntax error\" is here to catch this case.\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#ifdef __STDC__\n# include <limits.h>\n#else\n# include <assert.h>\n#endif\n\t\t     Syntax error\n_ACEOF\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_cpp conftest.$ac_ext\\\"\") >&5\n  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } >/dev/null; then\n  if test -s conftest.err; then\n    ac_cpp_err=$ac_cxx_preproc_warn_flag\n    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag\n  else\n    ac_cpp_err=\n  fi\nelse\n  ac_cpp_err=yes\nfi\nif test -z \"$ac_cpp_err\"; then\n  :\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n  # Broken: fails on valid input.\ncontinue\nfi\nrm -f conftest.err conftest.$ac_ext\n\n  # OK, works on sane cases.  Now check whether non-existent headers\n  # can be detected and how.\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#include <ac_nonexistent.h>\n_ACEOF\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_cpp conftest.$ac_ext\\\"\") >&5\n  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } >/dev/null; then\n  if test -s conftest.err; then\n    ac_cpp_err=$ac_cxx_preproc_warn_flag\n    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag\n  else\n    ac_cpp_err=\n  fi\nelse\n  ac_cpp_err=yes\nfi\nif test -z \"$ac_cpp_err\"; then\n  # Broken: success on invalid input.\ncontinue\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n  # Passes both tests.\nac_preproc_ok=:\nbreak\nfi\nrm -f conftest.err conftest.$ac_ext\n\ndone\n# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.\nrm -f conftest.err conftest.$ac_ext\nif $ac_preproc_ok; then\n  break\nfi\n\n    done\n    ac_cv_prog_CXXCPP=$CXXCPP\n\nfi\n  CXXCPP=$ac_cv_prog_CXXCPP\nelse\n  ac_cv_prog_CXXCPP=$CXXCPP\nfi\necho \"$as_me:$LINENO: result: $CXXCPP\" >&5\necho \"${ECHO_T}$CXXCPP\" >&6\nac_preproc_ok=false\nfor ac_cxx_preproc_warn_flag in '' yes\ndo\n  # Use a header file that comes with gcc, so configuring glibc\n  # with a fresh cross-compiler works.\n  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since\n  # <limits.h> exists even on freestanding compilers.\n  # On the NeXT, cc -E runs the code through the compiler's parser,\n  # not just through cpp. \"Syntax error\" is here to catch this case.\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#ifdef __STDC__\n# include <limits.h>\n#else\n# include <assert.h>\n#endif\n\t\t     Syntax error\n_ACEOF\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_cpp conftest.$ac_ext\\\"\") >&5\n  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } >/dev/null; then\n  if test -s conftest.err; then\n    ac_cpp_err=$ac_cxx_preproc_warn_flag\n    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag\n  else\n    ac_cpp_err=\n  fi\nelse\n  ac_cpp_err=yes\nfi\nif test -z \"$ac_cpp_err\"; then\n  :\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n  # Broken: fails on valid input.\ncontinue\nfi\nrm -f conftest.err conftest.$ac_ext\n\n  # OK, works on sane cases.  Now check whether non-existent headers\n  # can be detected and how.\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#include <ac_nonexistent.h>\n_ACEOF\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_cpp conftest.$ac_ext\\\"\") >&5\n  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } >/dev/null; then\n  if test -s conftest.err; then\n    ac_cpp_err=$ac_cxx_preproc_warn_flag\n    ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag\n  else\n    ac_cpp_err=\n  fi\nelse\n  ac_cpp_err=yes\nfi\nif test -z \"$ac_cpp_err\"; then\n  # Broken: success on invalid input.\ncontinue\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n  # Passes both tests.\nac_preproc_ok=:\nbreak\nfi\nrm -f conftest.err conftest.$ac_ext\n\ndone\n# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.\nrm -f conftest.err conftest.$ac_ext\nif $ac_preproc_ok; then\n  :\nelse\n  { { echo \"$as_me:$LINENO: error: C++ preprocessor \\\"$CXXCPP\\\" fails sanity check\nSee \\`config.log' for more details.\" >&5\necho \"$as_me: error: C++ preprocessor \\\"$CXXCPP\\\" fails sanity check\nSee \\`config.log' for more details.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\n\nac_ext=cc\nac_cpp='$CXXCPP $CPPFLAGS'\nac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_cxx_compiler_gnu\n\n\nac_ext=f\nac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'\nac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_f77_compiler_gnu\nif test -n \"$ac_tool_prefix\"; then\n  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran\n  do\n    # Extract the first word of \"$ac_tool_prefix$ac_prog\", so it can be a program name with args.\nset dummy $ac_tool_prefix$ac_prog; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_F77+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$F77\"; then\n  ac_cv_prog_F77=\"$F77\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_F77=\"$ac_tool_prefix$ac_prog\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nF77=$ac_cv_prog_F77\nif test -n \"$F77\"; then\n  echo \"$as_me:$LINENO: result: $F77\" >&5\necho \"${ECHO_T}$F77\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\n    test -n \"$F77\" && break\n  done\nfi\nif test -z \"$F77\"; then\n  ac_ct_F77=$F77\n  for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_ac_ct_F77+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$ac_ct_F77\"; then\n  ac_cv_prog_ac_ct_F77=\"$ac_ct_F77\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_F77=\"$ac_prog\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nac_ct_F77=$ac_cv_prog_ac_ct_F77\nif test -n \"$ac_ct_F77\"; then\n  echo \"$as_me:$LINENO: result: $ac_ct_F77\" >&5\necho \"${ECHO_T}$ac_ct_F77\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\n  test -n \"$ac_ct_F77\" && break\ndone\n\n  F77=$ac_ct_F77\nfi\n\n\n# Provide some information about the compiler.\necho \"$as_me:6356:\" \\\n     \"checking for Fortran 77 compiler version\" >&5\nac_compiler=`set X $ac_compile; echo $2`\n{ (eval echo \"$as_me:$LINENO: \\\"$ac_compiler --version </dev/null >&5\\\"\") >&5\n  (eval $ac_compiler --version </dev/null >&5) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }\n{ (eval echo \"$as_me:$LINENO: \\\"$ac_compiler -v </dev/null >&5\\\"\") >&5\n  (eval $ac_compiler -v </dev/null >&5) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }\n{ (eval echo \"$as_me:$LINENO: \\\"$ac_compiler -V </dev/null >&5\\\"\") >&5\n  (eval $ac_compiler -V </dev/null >&5) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }\nrm -f a.out\n\n# If we don't use `.F' as extension, the preprocessor is not run on the\n# input file.  (Note that this only needs to work for GNU compilers.)\nac_save_ext=$ac_ext\nac_ext=F\necho \"$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler\" >&5\necho $ECHO_N \"checking whether we are using the GNU Fortran 77 compiler... $ECHO_C\" >&6\nif test \"${ac_cv_f77_compiler_gnu+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n      program main\n#ifndef __GNUC__\n       choke me\n#endif\n\n      end\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_f77_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_compiler_gnu=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_compiler_gnu=no\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\nac_cv_f77_compiler_gnu=$ac_compiler_gnu\n\nfi\necho \"$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu\" >&5\necho \"${ECHO_T}$ac_cv_f77_compiler_gnu\" >&6\nac_ext=$ac_save_ext\nac_test_FFLAGS=${FFLAGS+set}\nac_save_FFLAGS=$FFLAGS\nFFLAGS=\necho \"$as_me:$LINENO: checking whether $F77 accepts -g\" >&5\necho $ECHO_N \"checking whether $F77 accepts -g... $ECHO_C\" >&6\nif test \"${ac_cv_prog_f77_g+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  FFLAGS=-g\ncat >conftest.$ac_ext <<_ACEOF\n      program main\n\n      end\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_f77_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_prog_f77_g=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_prog_f77_g=no\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\n\nfi\necho \"$as_me:$LINENO: result: $ac_cv_prog_f77_g\" >&5\necho \"${ECHO_T}$ac_cv_prog_f77_g\" >&6\nif test \"$ac_test_FFLAGS\" = set; then\n  FFLAGS=$ac_save_FFLAGS\nelif test $ac_cv_prog_f77_g = yes; then\n  if test \"x$ac_cv_f77_compiler_gnu\" = xyes; then\n    FFLAGS=\"-g -O2\"\n  else\n    FFLAGS=\"-g\"\n  fi\nelse\n  if test \"x$ac_cv_f77_compiler_gnu\" = xyes; then\n    FFLAGS=\"-O2\"\n  else\n    FFLAGS=\n  fi\nfi\n\nG77=`test $ac_compiler_gnu = yes && echo yes`\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\n\n\n# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!\n\n# find the maximum length of command line arguments\necho \"$as_me:$LINENO: checking the maximum length of command line arguments\" >&5\necho $ECHO_N \"checking the maximum length of command line arguments... $ECHO_C\" >&6\nif test \"${lt_cv_sys_max_cmd_len+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n    i=0\n  teststring=\"ABCD\"\n\n  case $build_os in\n  msdosdjgpp*)\n    # On DJGPP, this test can blow up pretty badly due to problems in libc\n    # (any single argument exceeding 2000 bytes causes a buffer overrun\n    # during glob expansion).  Even if it were fixed, the result of this\n    # check would be larger than it should be.\n    lt_cv_sys_max_cmd_len=12288;    # 12K is about right\n    ;;\n\n  gnu*)\n    # Under GNU Hurd, this test is not required because there is\n    # no limit to the length of command line arguments.\n    # Libtool will interpret -1 as no limit whatsoever\n    lt_cv_sys_max_cmd_len=-1;\n    ;;\n\n  cygwin* | mingw*)\n    # On Win9x/ME, this test blows up -- it succeeds, but takes\n    # about 5 minutes as the teststring grows exponentially.\n    # Worse, since 9x/ME are not pre-emptively multitasking,\n    # you end up with a \"frozen\" computer, even though with patience\n    # the test eventually succeeds (with a max line length of 256k).\n    # Instead, let's just punt: use the minimum linelength reported by\n    # all of the supported platforms: 8192 (on NT/2K/XP).\n    lt_cv_sys_max_cmd_len=8192;\n    ;;\n\n  amigaos*)\n    # On AmigaOS with pdksh, this test takes hours, literally.\n    # So we just punt and use a minimum line length of 8192.\n    lt_cv_sys_max_cmd_len=8192;\n    ;;\n\n *)\n    # If test is not a shell built-in, we'll probably end up computing a\n    # maximum length that is only half of the actual maximum length, but\n    # we can't tell.\n    while (test \"X\"`$CONFIG_SHELL $0 --fallback-echo \"X$teststring\" 2>/dev/null` \\\n\t       = \"XX$teststring\") >/dev/null 2>&1 &&\n\t    new_result=`expr \"X$teststring\" : \".*\" 2>&1` &&\n\t    lt_cv_sys_max_cmd_len=$new_result &&\n\t    test $i != 17 # 1/2 MB should be enough\n    do\n      i=`expr $i + 1`\n      teststring=$teststring$teststring\n    done\n    teststring=\n    # Add a significant safety factor because C++ compilers can tack on massive\n    # amounts of additional arguments before passing them to the linker.\n    # It appears as though 1/2 is a usable value.\n    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \\/ 2`\n    ;;\n  esac\n\nfi\n\nif test -n $lt_cv_sys_max_cmd_len ; then\n  echo \"$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len\" >&5\necho \"${ECHO_T}$lt_cv_sys_max_cmd_len\" >&6\nelse\n  echo \"$as_me:$LINENO: result: none\" >&5\necho \"${ECHO_T}none\" >&6\nfi\n\n\n\n\n# Check for command to grab the raw symbol name followed by C symbol from nm.\necho \"$as_me:$LINENO: checking command to parse $NM output from $compiler object\" >&5\necho $ECHO_N \"checking command to parse $NM output from $compiler object... $ECHO_C\" >&6\nif test \"${lt_cv_sys_global_symbol_pipe+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n\n# These are sane defaults that work on at least a few old systems.\n# [They come from Ultrix.  What could be older than Ultrix?!! ;)]\n\n# Character class describing NM global symbol codes.\nsymcode='[BCDEGRST]'\n\n# Regexp to match symbols that can be accessed directly from C.\nsympat='\\([_A-Za-z][_A-Za-z0-9]*\\)'\n\n# Transform the above into a raw symbol and a C symbol.\nsymxfrm='\\1 \\2\\3 \\3'\n\n# Transform an extracted symbol line into a proper C declaration\nlt_cv_sys_global_symbol_to_cdecl=\"sed -n -e 's/^. .* \\(.*\\)$/extern int \\1;/p'\"\n\n# Transform an extracted symbol line into symbol name and symbol address\nlt_cv_sys_global_symbol_to_c_name_address=\"sed -n -e 's/^: \\([^ ]*\\) $/  {\\\\\\\"\\1\\\\\\\", (lt_ptr) 0},/p' -e 's/^$symcode \\([^ ]*\\) \\([^ ]*\\)$/  {\\\"\\2\\\", (lt_ptr) \\&\\2},/p'\"\n\n# Define system-specific variables.\ncase $host_os in\naix*)\n  symcode='[BCDT]'\n  ;;\ncygwin* | mingw* | pw32*)\n  symcode='[ABCDGISTW]'\n  ;;\nhpux*) # Its linker distinguishes data from code symbols\n  if test \"$host_cpu\" = ia64; then\n    symcode='[ABCDEGRST]'\n  fi\n  lt_cv_sys_global_symbol_to_cdecl=\"sed -n -e 's/^T .* \\(.*\\)$/extern int \\1();/p' -e 's/^$symcode* .* \\(.*\\)$/extern char \\1;/p'\"\n  lt_cv_sys_global_symbol_to_c_name_address=\"sed -n -e 's/^: \\([^ ]*\\) $/  {\\\\\\\"\\1\\\\\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \\([^ ]*\\) \\([^ ]*\\)$/  {\\\"\\2\\\", (lt_ptr) \\&\\2},/p'\"\n  ;;\nirix* | nonstopux*)\n  symcode='[BCDEGRST]'\n  ;;\nosf*)\n  symcode='[BCDEGQRST]'\n  ;;\nsolaris* | sysv5*)\n  symcode='[BDRT]'\n  ;;\nsysv4)\n  symcode='[DFNSTU]'\n  ;;\nesac\n\n# Handle CRLF in mingw tool chain\nopt_cr=\ncase $build_os in\nmingw*)\n  opt_cr=`echo 'x\\{0,1\\}' | tr x '\\015'` # option cr in regexp\n  ;;\nesac\n\n# If we're using GNU nm, then use its standard symbol codes.\ncase `$NM -V 2>&1` in\n*GNU* | *'with BFD'*)\n  symcode='[ABCDGIRSTW]' ;;\nesac\n\n# Try without a prefix undercore, then with it.\nfor ac_symprfx in \"\" \"_\"; do\n\n  # Write the raw and C identifiers.\n  lt_cv_sys_global_symbol_pipe=\"sed -n -e 's/^.*[ \t]\\($symcode$symcode*\\)[ \t][ \t]*\\($ac_symprfx\\)$sympat$opt_cr$/$symxfrm/p'\"\n\n  # Check to see that the pipe works correctly.\n  pipe_works=no\n\n  rm -f conftest*\n  cat > conftest.$ac_ext <<EOF\n#ifdef __cplusplus\nextern \"C\" {\n#endif\nchar nm_test_var;\nvoid nm_test_func(){}\n#ifdef __cplusplus\n}\n#endif\nint main(){nm_test_var='a';nm_test_func();return(0);}\nEOF\n\n  if { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; then\n    # Now try to grab the symbols.\n    nlist=conftest.nm\n    if { (eval echo \"$as_me:$LINENO: \\\"$NM conftest.$ac_objext \\| $lt_cv_sys_global_symbol_pipe \\> $nlist\\\"\") >&5\n  (eval $NM conftest.$ac_objext \\| $lt_cv_sys_global_symbol_pipe \\> $nlist) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } && test -s \"$nlist\"; then\n      # Try sorting and uniquifying the output.\n      if sort \"$nlist\" | uniq > \"$nlist\"T; then\n\tmv -f \"$nlist\"T \"$nlist\"\n      else\n\trm -f \"$nlist\"T\n      fi\n\n      # Make sure that we snagged all the symbols we need.\n      if grep ' nm_test_var$' \"$nlist\" >/dev/null; then\n\tif grep ' nm_test_func$' \"$nlist\" >/dev/null; then\n\t  cat <<EOF > conftest.$ac_ext\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nEOF\n\t  # Now generate the symbol file.\n\t  eval \"$lt_cv_sys_global_symbol_to_cdecl\"' < \"$nlist\" | grep -v main >> conftest.$ac_ext'\n\n\t  cat <<EOF >> conftest.$ac_ext\n#if defined (__STDC__) && __STDC__\n# define lt_ptr_t void *\n#else\n# define lt_ptr_t char *\n# define const\n#endif\n\n/* The mapping between symbol names and symbols. */\nconst struct {\n  const char *name;\n  lt_ptr_t address;\n}\nlt_preloaded_symbols[] =\n{\nEOF\n\t  $SED \"s/^$symcode$symcode* \\(.*\\) \\(.*\\)$/  {\\\"\\2\\\", (lt_ptr_t) \\&\\2},/\" < \"$nlist\" | grep -v main >> conftest.$ac_ext\n\t  cat <<\\EOF >> conftest.$ac_ext\n  {0, (lt_ptr_t) 0}\n};\n\n#ifdef __cplusplus\n}\n#endif\nEOF\n\t  # Now try linking the two files.\n\t  mv conftest.$ac_objext conftstm.$ac_objext\n\t  lt_save_LIBS=\"$LIBS\"\n\t  lt_save_CFLAGS=\"$CFLAGS\"\n\t  LIBS=\"conftstm.$ac_objext\"\n\t  CFLAGS=\"$CFLAGS$lt_prog_compiler_no_builtin_flag\"\n\t  if { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } && test -s conftest${ac_exeext}; then\n\t    pipe_works=yes\n\t  fi\n\t  LIBS=\"$lt_save_LIBS\"\n\t  CFLAGS=\"$lt_save_CFLAGS\"\n\telse\n\t  echo \"cannot find nm_test_func in $nlist\" >&5\n\tfi\n      else\n\techo \"cannot find nm_test_var in $nlist\" >&5\n      fi\n    else\n      echo \"cannot run $lt_cv_sys_global_symbol_pipe\" >&5\n    fi\n  else\n    echo \"$progname: failed program was:\" >&5\n    cat conftest.$ac_ext >&5\n  fi\n  rm -f conftest* conftst*\n\n  # Do not use the global_symbol_pipe unless it works.\n  if test \"$pipe_works\" = yes; then\n    break\n  else\n    lt_cv_sys_global_symbol_pipe=\n  fi\ndone\n\nfi\n\nif test -z \"$lt_cv_sys_global_symbol_pipe\"; then\n  lt_cv_sys_global_symbol_to_cdecl=\nfi\nif test -z \"$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl\"; then\n  echo \"$as_me:$LINENO: result: failed\" >&5\necho \"${ECHO_T}failed\" >&6\nelse\n  echo \"$as_me:$LINENO: result: ok\" >&5\necho \"${ECHO_T}ok\" >&6\nfi\n\necho \"$as_me:$LINENO: checking for objdir\" >&5\necho $ECHO_N \"checking for objdir... $ECHO_C\" >&6\nif test \"${lt_cv_objdir+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  rm -f .libs 2>/dev/null\nmkdir .libs 2>/dev/null\nif test -d .libs; then\n  lt_cv_objdir=.libs\nelse\n  # MS-DOS does not allow filenames that begin with a dot.\n  lt_cv_objdir=_libs\nfi\nrmdir .libs 2>/dev/null\nfi\necho \"$as_me:$LINENO: result: $lt_cv_objdir\" >&5\necho \"${ECHO_T}$lt_cv_objdir\" >&6\nobjdir=$lt_cv_objdir\n\n\n\n\n\ncase $host_os in\naix3*)\n  # AIX sometimes has problems with the GCC collect2 program.  For some\n  # reason, if we set the COLLECT_NAMES environment variable, the problems\n  # vanish in a puff of smoke.\n  if test \"X${COLLECT_NAMES+set}\" != Xset; then\n    COLLECT_NAMES=\n    export COLLECT_NAMES\n  fi\n  ;;\nesac\n\n# Sed substitution that helps us do robust quoting.  It backslashifies\n# metacharacters that are still active within double-quoted strings.\nXsed='sed -e s/^X//'\nsed_quote_subst='s/\\([\\\\\"\\\\`$\\\\\\\\]\\)/\\\\\\1/g'\n\n# Same as above, but do not quote variable references.\ndouble_quote_subst='s/\\([\\\\\"\\\\`\\\\\\\\]\\)/\\\\\\1/g'\n\n# Sed substitution to delay expansion of an escaped shell variable in a\n# double_quote_subst'ed string.\ndelay_variable_subst='s/\\\\\\\\\\\\\\\\\\\\\\$/\\\\\\\\\\\\$/g'\n\n# Sed substitution to avoid accidental globbing in evaled expressions\nno_glob_subst='s/\\*/\\\\\\*/g'\n\n# Constants:\nrm=\"rm -f\"\n\n# Global variables:\ndefault_ofile=libtool\ncan_build_shared=yes\n\n# All known linkers require a `.a' archive for static linking (except M$VC,\n# which needs '.lib').\nlibext=a\nltmain=\"$ac_aux_dir/ltmain.sh\"\nofile=\"$default_ofile\"\nwith_gnu_ld=\"$lt_cv_prog_gnu_ld\"\n\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}ar\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}ar; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_AR+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$AR\"; then\n  ac_cv_prog_AR=\"$AR\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_AR=\"${ac_tool_prefix}ar\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nAR=$ac_cv_prog_AR\nif test -n \"$AR\"; then\n  echo \"$as_me:$LINENO: result: $AR\" >&5\necho \"${ECHO_T}$AR\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\nfi\nif test -z \"$ac_cv_prog_AR\"; then\n  ac_ct_AR=$AR\n  # Extract the first word of \"ar\", so it can be a program name with args.\nset dummy ar; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_ac_ct_AR+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$ac_ct_AR\"; then\n  ac_cv_prog_ac_ct_AR=\"$ac_ct_AR\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_AR=\"ar\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\n  test -z \"$ac_cv_prog_ac_ct_AR\" && ac_cv_prog_ac_ct_AR=\"false\"\nfi\nfi\nac_ct_AR=$ac_cv_prog_ac_ct_AR\nif test -n \"$ac_ct_AR\"; then\n  echo \"$as_me:$LINENO: result: $ac_ct_AR\" >&5\necho \"${ECHO_T}$ac_ct_AR\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\n  AR=$ac_ct_AR\nelse\n  AR=\"$ac_cv_prog_AR\"\nfi\n\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}ranlib\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}ranlib; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_RANLIB+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$RANLIB\"; then\n  ac_cv_prog_RANLIB=\"$RANLIB\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_RANLIB=\"${ac_tool_prefix}ranlib\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nRANLIB=$ac_cv_prog_RANLIB\nif test -n \"$RANLIB\"; then\n  echo \"$as_me:$LINENO: result: $RANLIB\" >&5\necho \"${ECHO_T}$RANLIB\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\nfi\nif test -z \"$ac_cv_prog_RANLIB\"; then\n  ac_ct_RANLIB=$RANLIB\n  # Extract the first word of \"ranlib\", so it can be a program name with args.\nset dummy ranlib; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_ac_ct_RANLIB+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$ac_ct_RANLIB\"; then\n  ac_cv_prog_ac_ct_RANLIB=\"$ac_ct_RANLIB\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_RANLIB=\"ranlib\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\n  test -z \"$ac_cv_prog_ac_ct_RANLIB\" && ac_cv_prog_ac_ct_RANLIB=\":\"\nfi\nfi\nac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB\nif test -n \"$ac_ct_RANLIB\"; then\n  echo \"$as_me:$LINENO: result: $ac_ct_RANLIB\" >&5\necho \"${ECHO_T}$ac_ct_RANLIB\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\n  RANLIB=$ac_ct_RANLIB\nelse\n  RANLIB=\"$ac_cv_prog_RANLIB\"\nfi\n\nif test -n \"$ac_tool_prefix\"; then\n  # Extract the first word of \"${ac_tool_prefix}strip\", so it can be a program name with args.\nset dummy ${ac_tool_prefix}strip; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_STRIP+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$STRIP\"; then\n  ac_cv_prog_STRIP=\"$STRIP\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_STRIP=\"${ac_tool_prefix}strip\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nSTRIP=$ac_cv_prog_STRIP\nif test -n \"$STRIP\"; then\n  echo \"$as_me:$LINENO: result: $STRIP\" >&5\necho \"${ECHO_T}$STRIP\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\nfi\nif test -z \"$ac_cv_prog_STRIP\"; then\n  ac_ct_STRIP=$STRIP\n  # Extract the first word of \"strip\", so it can be a program name with args.\nset dummy strip; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_ac_ct_STRIP+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$ac_ct_STRIP\"; then\n  ac_cv_prog_ac_ct_STRIP=\"$ac_ct_STRIP\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_STRIP=\"strip\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\n  test -z \"$ac_cv_prog_ac_ct_STRIP\" && ac_cv_prog_ac_ct_STRIP=\":\"\nfi\nfi\nac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP\nif test -n \"$ac_ct_STRIP\"; then\n  echo \"$as_me:$LINENO: result: $ac_ct_STRIP\" >&5\necho \"${ECHO_T}$ac_ct_STRIP\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\n  STRIP=$ac_ct_STRIP\nelse\n  STRIP=\"$ac_cv_prog_STRIP\"\nfi\n\n\nold_CC=\"$CC\"\nold_CFLAGS=\"$CFLAGS\"\n\n# Set sane defaults for various variables\ntest -z \"$AR\" && AR=ar\ntest -z \"$AR_FLAGS\" && AR_FLAGS=cru\ntest -z \"$AS\" && AS=as\ntest -z \"$CC\" && CC=cc\ntest -z \"$LTCC\" && LTCC=$CC\ntest -z \"$DLLTOOL\" && DLLTOOL=dlltool\ntest -z \"$LD\" && LD=ld\ntest -z \"$LN_S\" && LN_S=\"ln -s\"\ntest -z \"$MAGIC_CMD\" && MAGIC_CMD=file\ntest -z \"$NM\" && NM=nm\ntest -z \"$SED\" && SED=sed\ntest -z \"$OBJDUMP\" && OBJDUMP=objdump\ntest -z \"$RANLIB\" && RANLIB=:\ntest -z \"$STRIP\" && STRIP=:\ntest -z \"$ac_objext\" && ac_objext=o\n\n# Determine commands to create old-style static archives.\nold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'\nold_postinstall_cmds='chmod 644 $oldlib'\nold_postuninstall_cmds=\n\nif test -n \"$RANLIB\"; then\n  case $host_os in\n  openbsd*)\n    old_postinstall_cmds=\"\\$RANLIB -t \\$oldlib~$old_postinstall_cmds\"\n    ;;\n  *)\n    old_postinstall_cmds=\"\\$RANLIB \\$oldlib~$old_postinstall_cmds\"\n    ;;\n  esac\n  old_archive_cmds=\"$old_archive_cmds~\\$RANLIB \\$oldlib\"\nfi\n\n# Only perform the check for file, if the check method requires it\ncase $deplibs_check_method in\nfile_magic*)\n  if test \"$file_magic_cmd\" = '$MAGIC_CMD'; then\n    echo \"$as_me:$LINENO: checking for ${ac_tool_prefix}file\" >&5\necho $ECHO_N \"checking for ${ac_tool_prefix}file... $ECHO_C\" >&6\nif test \"${lt_cv_path_MAGIC_CMD+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  case $MAGIC_CMD in\n[\\\\/*] |  ?:[\\\\/]*)\n  lt_cv_path_MAGIC_CMD=\"$MAGIC_CMD\" # Let the user override the test with a path.\n  ;;\n*)\n  lt_save_MAGIC_CMD=\"$MAGIC_CMD\"\n  lt_save_ifs=\"$IFS\"; IFS=$PATH_SEPARATOR\n  ac_dummy=\"/usr/bin$PATH_SEPARATOR$PATH\"\n  for ac_dir in $ac_dummy; do\n    IFS=\"$lt_save_ifs\"\n    test -z \"$ac_dir\" && ac_dir=.\n    if test -f $ac_dir/${ac_tool_prefix}file; then\n      lt_cv_path_MAGIC_CMD=\"$ac_dir/${ac_tool_prefix}file\"\n      if test -n \"$file_magic_test_file\"; then\n\tcase $deplibs_check_method in\n\t\"file_magic \"*)\n\t  file_magic_regex=\"`expr \\\"$deplibs_check_method\\\" : \\\"file_magic \\(.*\\)\\\"`\"\n\t  MAGIC_CMD=\"$lt_cv_path_MAGIC_CMD\"\n\t  if eval $file_magic_cmd \\$file_magic_test_file 2> /dev/null |\n\t    $EGREP \"$file_magic_regex\" > /dev/null; then\n\t    :\n\t  else\n\t    cat <<EOF 1>&2\n\n*** Warning: the command libtool uses to detect shared libraries,\n*** $file_magic_cmd, produces output that libtool cannot recognize.\n*** The result is that libtool may fail to recognize shared libraries\n*** as such.  This will affect the creation of libtool libraries that\n*** depend on shared libraries, but programs linked with such libtool\n*** libraries will work regardless of this problem.  Nevertheless, you\n*** may want to report the problem to your system manager and/or to\n*** bug-libtool@gnu.org\n\nEOF\n\t  fi ;;\n\tesac\n      fi\n      break\n    fi\n  done\n  IFS=\"$lt_save_ifs\"\n  MAGIC_CMD=\"$lt_save_MAGIC_CMD\"\n  ;;\nesac\nfi\n\nMAGIC_CMD=\"$lt_cv_path_MAGIC_CMD\"\nif test -n \"$MAGIC_CMD\"; then\n  echo \"$as_me:$LINENO: result: $MAGIC_CMD\" >&5\necho \"${ECHO_T}$MAGIC_CMD\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\nif test -z \"$lt_cv_path_MAGIC_CMD\"; then\n  if test -n \"$ac_tool_prefix\"; then\n    echo \"$as_me:$LINENO: checking for file\" >&5\necho $ECHO_N \"checking for file... $ECHO_C\" >&6\nif test \"${lt_cv_path_MAGIC_CMD+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  case $MAGIC_CMD in\n[\\\\/*] |  ?:[\\\\/]*)\n  lt_cv_path_MAGIC_CMD=\"$MAGIC_CMD\" # Let the user override the test with a path.\n  ;;\n*)\n  lt_save_MAGIC_CMD=\"$MAGIC_CMD\"\n  lt_save_ifs=\"$IFS\"; IFS=$PATH_SEPARATOR\n  ac_dummy=\"/usr/bin$PATH_SEPARATOR$PATH\"\n  for ac_dir in $ac_dummy; do\n    IFS=\"$lt_save_ifs\"\n    test -z \"$ac_dir\" && ac_dir=.\n    if test -f $ac_dir/file; then\n      lt_cv_path_MAGIC_CMD=\"$ac_dir/file\"\n      if test -n \"$file_magic_test_file\"; then\n\tcase $deplibs_check_method in\n\t\"file_magic \"*)\n\t  file_magic_regex=\"`expr \\\"$deplibs_check_method\\\" : \\\"file_magic \\(.*\\)\\\"`\"\n\t  MAGIC_CMD=\"$lt_cv_path_MAGIC_CMD\"\n\t  if eval $file_magic_cmd \\$file_magic_test_file 2> /dev/null |\n\t    $EGREP \"$file_magic_regex\" > /dev/null; then\n\t    :\n\t  else\n\t    cat <<EOF 1>&2\n\n*** Warning: the command libtool uses to detect shared libraries,\n*** $file_magic_cmd, produces output that libtool cannot recognize.\n*** The result is that libtool may fail to recognize shared libraries\n*** as such.  This will affect the creation of libtool libraries that\n*** depend on shared libraries, but programs linked with such libtool\n*** libraries will work regardless of this problem.  Nevertheless, you\n*** may want to report the problem to your system manager and/or to\n*** bug-libtool@gnu.org\n\nEOF\n\t  fi ;;\n\tesac\n      fi\n      break\n    fi\n  done\n  IFS=\"$lt_save_ifs\"\n  MAGIC_CMD=\"$lt_save_MAGIC_CMD\"\n  ;;\nesac\nfi\n\nMAGIC_CMD=\"$lt_cv_path_MAGIC_CMD\"\nif test -n \"$MAGIC_CMD\"; then\n  echo \"$as_me:$LINENO: result: $MAGIC_CMD\" >&5\necho \"${ECHO_T}$MAGIC_CMD\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\n  else\n    MAGIC_CMD=:\n  fi\nfi\n\n  fi\n  ;;\nesac\n\nenable_dlopen=no\nenable_win32_dll=no\n\n# Check whether --enable-libtool-lock or --disable-libtool-lock was given.\nif test \"${enable_libtool_lock+set}\" = set; then\n  enableval=\"$enable_libtool_lock\"\n\nfi;\ntest \"x$enable_libtool_lock\" != xno && enable_libtool_lock=yes\n\n\n# Check whether --with-pic or --without-pic was given.\nif test \"${with_pic+set}\" = set; then\n  withval=\"$with_pic\"\n  pic_mode=\"$withval\"\nelse\n  pic_mode=default\nfi;\ntest -z \"$pic_mode\" && pic_mode=default\n\n# Use C for the default configuration in the libtool script\ntagname=\nlt_save_CC=\"$CC\"\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\n\n# Source file extension for C test sources.\nac_ext=c\n\n# Object file extension for compiled C test sources.\nobjext=o\nobjext=$objext\n\n# Code to be used in simple compile tests\nlt_simple_compile_test_code=\"int some_variable = 0;\\n\"\n\n# Code to be used in simple link tests\nlt_simple_link_test_code='int main(){return(0);}\\n'\n\n\n# If no C compiler was specified, use CC.\nLTCC=${LTCC-\"$CC\"}\n\n# Allow CC to be a program name with arguments.\ncompiler=$CC\n\n\n#\n# Check for any special shared library compilation flags.\n#\nlt_prog_cc_shlib=\nif test \"$GCC\" = no; then\n  case $host_os in\n  sco3.2v5*)\n    lt_prog_cc_shlib='-belf'\n    ;;\n  esac\nfi\nif test -n \"$lt_prog_cc_shlib\"; then\n  { echo \"$as_me:$LINENO: WARNING: \\`$CC' requires \\`$lt_prog_cc_shlib' to build shared libraries\" >&5\necho \"$as_me: WARNING: \\`$CC' requires \\`$lt_prog_cc_shlib' to build shared libraries\" >&2;}\n  if echo \"$old_CC $old_CFLAGS \" | grep \"[ \t]$lt_prog_cc_shlib[ \t]\" >/dev/null; then :\n  else\n    { echo \"$as_me:$LINENO: WARNING: add \\`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure\" >&5\necho \"$as_me: WARNING: add \\`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure\" >&2;}\n    lt_cv_prog_cc_can_build_shared=no\n  fi\nfi\n\n\n#\n# Check to make sure the static flag actually works.\n#\necho \"$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works\" >&5\necho $ECHO_N \"checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C\" >&6\nif test \"${lt_prog_compiler_static_works+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  lt_prog_compiler_static_works=no\n   save_LDFLAGS=\"$LDFLAGS\"\n   LDFLAGS=\"$LDFLAGS $lt_prog_compiler_static\"\n   printf \"$lt_simple_link_test_code\" > conftest.$ac_ext\n   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     if test -s conftest.err; then\n       # Append any errors to the config.log.\n       cat conftest.err 1>&5\n     else\n       lt_prog_compiler_static_works=yes\n     fi\n   fi\n   $rm conftest*\n   LDFLAGS=\"$save_LDFLAGS\"\n\nfi\necho \"$as_me:$LINENO: result: $lt_prog_compiler_static_works\" >&5\necho \"${ECHO_T}$lt_prog_compiler_static_works\" >&6\n\nif test x\"$lt_prog_compiler_static_works\" = xyes; then\n    :\nelse\n    lt_prog_compiler_static=\nfi\n\n\n\n\nlt_prog_compiler_no_builtin_flag=\n\nif test \"$GCC\" = yes; then\n  lt_prog_compiler_no_builtin_flag=' -fno-builtin'\n\n\necho \"$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions\" >&5\necho $ECHO_N \"checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C\" >&6\nif test \"${lt_cv_prog_compiler_rtti_exceptions+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  lt_cv_prog_compiler_rtti_exceptions=no\n  ac_outfile=conftest.$ac_objext\n   printf \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n   lt_compiler_flag=\"-fno-rtti -fno-exceptions\"\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   # The option is referenced via a variable to avoid confusing sed.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \\\n   -e 's: [^ ]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:7390: $lt_compile\\\"\" >&5)\n   (eval \"$lt_compile\" 2>conftest.err)\n   ac_status=$?\n   cat conftest.err >&5\n   echo \"$as_me:7394: \\$? = $ac_status\" >&5\n   if (exit $ac_status) && test -s \"$ac_outfile\"; then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     if test ! -s conftest.err; then\n       lt_cv_prog_compiler_rtti_exceptions=yes\n     fi\n   fi\n   $rm conftest*\n\nfi\necho \"$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions\" >&5\necho \"${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions\" >&6\n\nif test x\"$lt_cv_prog_compiler_rtti_exceptions\" = xyes; then\n    lt_prog_compiler_no_builtin_flag=\"$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions\"\nelse\n    :\nfi\n\nfi\n\nlt_prog_compiler_wl=\nlt_prog_compiler_pic=\nlt_prog_compiler_static=\n\necho \"$as_me:$LINENO: checking for $compiler option to produce PIC\" >&5\necho $ECHO_N \"checking for $compiler option to produce PIC... $ECHO_C\" >&6\n\n  if test \"$GCC\" = yes; then\n    lt_prog_compiler_wl='-Wl,'\n    lt_prog_compiler_static='-static'\n\n    case $host_os in\n      aix*)\n      # All AIX code is PIC.\n      if test \"$host_cpu\" = ia64; then\n\t# AIX 5 now supports IA64 processor\n\tlt_prog_compiler_static='-Bstatic'\n      fi\n      ;;\n\n    amigaos*)\n      # FIXME: we need at least 68020 code to build shared libraries, but\n      # adding the `-m68020' flag to GCC prevents building anything better,\n      # like `-m68040'.\n      lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'\n      ;;\n\n    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)\n      # PIC is the default for these OSes.\n      ;;\n\n    mingw* | pw32* | os2*)\n      # This hack is so that the source file can tell whether it is being\n      # built for inclusion in a dll (and should export symbols for example).\n      lt_prog_compiler_pic='-DDLL_EXPORT'\n      ;;\n\n    darwin* | rhapsody*)\n      # PIC is the default on this platform\n      # Common symbols not allowed in MH_DYLIB files\n      lt_prog_compiler_pic='-fno-common'\n      ;;\n\n    msdosdjgpp*)\n      # Just because we use GCC doesn't mean we suddenly get shared libraries\n      # on systems that don't support them.\n      lt_prog_compiler_can_build_shared=no\n      enable_shared=no\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\tlt_prog_compiler_pic=-Kconform_pic\n      fi\n      ;;\n\n    hpux*)\n      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but\n      # not for PA HP-UX.\n      case \"$host_cpu\" in\n      hppa*64*|ia64*)\n\t# +Z the default\n\t;;\n      *)\n\tlt_prog_compiler_pic='-fPIC'\n\t;;\n      esac\n      ;;\n\n    *)\n      lt_prog_compiler_pic='-fPIC'\n      ;;\n    esac\n  else\n    # PORTME Check for flag to pass linker flags through the system compiler.\n    case $host_os in\n    aix*)\n      lt_prog_compiler_wl='-Wl,'\n      if test \"$host_cpu\" = ia64; then\n\t# AIX 5 now supports IA64 processor\n\tlt_prog_compiler_static='-Bstatic'\n      else\n\tlt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'\n      fi\n      ;;\n\n    mingw* | pw32* | os2*)\n      # This hack is so that the source file can tell whether it is being\n      # built for inclusion in a dll (and should export symbols for example).\n      lt_prog_compiler_pic='-DDLL_EXPORT'\n      ;;\n\n    hpux9* | hpux10* | hpux11*)\n      lt_prog_compiler_wl='-Wl,'\n      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but\n      # not for PA HP-UX.\n      case \"$host_cpu\" in\n      hppa*64*|ia64*)\n\t# +Z the default\n\t;;\n      *)\n\tlt_prog_compiler_pic='+Z'\n\t;;\n      esac\n      # Is there a better lt_prog_compiler_static that works with the bundled CC?\n      lt_prog_compiler_static='${wl}-a ${wl}archive'\n      ;;\n\n    irix5* | irix6* | nonstopux*)\n      lt_prog_compiler_wl='-Wl,'\n      # PIC (with -KPIC) is the default.\n      lt_prog_compiler_static='-non_shared'\n      ;;\n\n    newsos6)\n      lt_prog_compiler_pic='-KPIC'\n      lt_prog_compiler_static='-Bstatic'\n      ;;\n\n    linux*)\n      case $CC in\n      icc* | ecc*)\n\tlt_prog_compiler_wl='-Wl,'\n\tlt_prog_compiler_pic='-KPIC'\n\tlt_prog_compiler_static='-static'\n        ;;\n      ccc*)\n        lt_prog_compiler_wl='-Wl,'\n        # All Alpha code is PIC.\n        lt_prog_compiler_static='-non_shared'\n        ;;\n      esac\n      ;;\n\n    osf3* | osf4* | osf5*)\n      lt_prog_compiler_wl='-Wl,'\n      # All OSF/1 code is PIC.\n      lt_prog_compiler_static='-non_shared'\n      ;;\n\n    sco3.2v5*)\n      lt_prog_compiler_pic='-Kpic'\n      lt_prog_compiler_static='-dn'\n      ;;\n\n    solaris*)\n      lt_prog_compiler_wl='-Wl,'\n      lt_prog_compiler_pic='-KPIC'\n      lt_prog_compiler_static='-Bstatic'\n      ;;\n\n    sunos4*)\n      lt_prog_compiler_wl='-Qoption ld '\n      lt_prog_compiler_pic='-PIC'\n      lt_prog_compiler_static='-Bstatic'\n      ;;\n\n    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)\n      lt_prog_compiler_wl='-Wl,'\n      lt_prog_compiler_pic='-KPIC'\n      lt_prog_compiler_static='-Bstatic'\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec ;then\n\tlt_prog_compiler_pic='-Kconform_pic'\n\tlt_prog_compiler_static='-Bstatic'\n      fi\n      ;;\n\n    uts4*)\n      lt_prog_compiler_pic='-pic'\n      lt_prog_compiler_static='-Bstatic'\n      ;;\n\n    *)\n      lt_prog_compiler_can_build_shared=no\n      ;;\n    esac\n  fi\n\necho \"$as_me:$LINENO: result: $lt_prog_compiler_pic\" >&5\necho \"${ECHO_T}$lt_prog_compiler_pic\" >&6\n\n#\n# Check to make sure the PIC flag actually works.\n#\nif test -n \"$lt_prog_compiler_pic\"; then\n\necho \"$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works\" >&5\necho $ECHO_N \"checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C\" >&6\nif test \"${lt_prog_compiler_pic_works+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  lt_prog_compiler_pic_works=no\n  ac_outfile=conftest.$ac_objext\n   printf \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n   lt_compiler_flag=\"$lt_prog_compiler_pic -DPIC\"\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   # The option is referenced via a variable to avoid confusing sed.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \\\n   -e 's: [^ ]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:7623: $lt_compile\\\"\" >&5)\n   (eval \"$lt_compile\" 2>conftest.err)\n   ac_status=$?\n   cat conftest.err >&5\n   echo \"$as_me:7627: \\$? = $ac_status\" >&5\n   if (exit $ac_status) && test -s \"$ac_outfile\"; then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     if test ! -s conftest.err; then\n       lt_prog_compiler_pic_works=yes\n     fi\n   fi\n   $rm conftest*\n\nfi\necho \"$as_me:$LINENO: result: $lt_prog_compiler_pic_works\" >&5\necho \"${ECHO_T}$lt_prog_compiler_pic_works\" >&6\n\nif test x\"$lt_prog_compiler_pic_works\" = xyes; then\n    case $lt_prog_compiler_pic in\n     \"\" | \" \"*) ;;\n     *) lt_prog_compiler_pic=\" $lt_prog_compiler_pic\" ;;\n     esac\nelse\n    lt_prog_compiler_pic=\n     lt_prog_compiler_can_build_shared=no\nfi\n\nfi\ncase \"$host_os\" in\n  # For platforms which do not support PIC, -DPIC is meaningless:\n  *djgpp*)\n    lt_prog_compiler_pic=\n    ;;\n  *)\n    lt_prog_compiler_pic=\"$lt_prog_compiler_pic -DPIC\"\n    ;;\nesac\n\necho \"$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext\" >&5\necho $ECHO_N \"checking if $compiler supports -c -o file.$ac_objext... $ECHO_C\" >&6\nif test \"${lt_cv_prog_compiler_c_o+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  lt_cv_prog_compiler_c_o=no\n   $rm -r conftest 2>/dev/null\n   mkdir conftest\n   cd conftest\n   mkdir out\n   printf \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n\n   lt_compiler_flag=\"-o out/conftest2.$ac_objext\"\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \\\n   -e 's: [^ ]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:7683: $lt_compile\\\"\" >&5)\n   (eval \"$lt_compile\" 2>out/conftest.err)\n   ac_status=$?\n   cat out/conftest.err >&5\n   echo \"$as_me:7687: \\$? = $ac_status\" >&5\n   if (exit $ac_status) && test -s out/conftest2.$ac_objext\n   then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     if test ! -s out/conftest.err; then\n       lt_cv_prog_compiler_c_o=yes\n     fi\n   fi\n   chmod u+w .\n   $rm conftest*\n   # SGI C++ compiler will create directory out/ii_files/ for\n   # template instantiation\n   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files\n   $rm out/* && rmdir out\n   cd ..\n   rmdir conftest\n   $rm conftest*\n\nfi\necho \"$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o\" >&5\necho \"${ECHO_T}$lt_cv_prog_compiler_c_o\" >&6\n\n\nhard_links=\"nottested\"\nif test \"$lt_cv_prog_compiler_c_o\" = no && test \"$need_locks\" != no; then\n  # do not overwrite the value of need_locks provided by the user\n  echo \"$as_me:$LINENO: checking if we can lock with hard links\" >&5\necho $ECHO_N \"checking if we can lock with hard links... $ECHO_C\" >&6\n  hard_links=yes\n  $rm conftest*\n  ln conftest.a conftest.b 2>/dev/null && hard_links=no\n  touch conftest.a\n  ln conftest.a conftest.b 2>&5 || hard_links=no\n  ln conftest.a conftest.b 2>/dev/null && hard_links=no\n  echo \"$as_me:$LINENO: result: $hard_links\" >&5\necho \"${ECHO_T}$hard_links\" >&6\n  if test \"$hard_links\" = no; then\n    { echo \"$as_me:$LINENO: WARNING: \\`$CC' does not support \\`-c -o', so \\`make -j' may be unsafe\" >&5\necho \"$as_me: WARNING: \\`$CC' does not support \\`-c -o', so \\`make -j' may be unsafe\" >&2;}\n    need_locks=warn\n  fi\nelse\n  need_locks=no\nfi\n\necho \"$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries\" >&5\necho $ECHO_N \"checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C\" >&6\n\n  runpath_var=\n  allow_undefined_flag=\n  enable_shared_with_static_runtimes=no\n  archive_cmds=\n  archive_expsym_cmds=\n  old_archive_From_new_cmds=\n  old_archive_from_expsyms_cmds=\n  export_dynamic_flag_spec=\n  whole_archive_flag_spec=\n  thread_safe_flag_spec=\n  hardcode_libdir_flag_spec=\n  hardcode_libdir_flag_spec_ld=\n  hardcode_libdir_separator=\n  hardcode_direct=no\n  hardcode_minus_L=no\n  hardcode_shlibpath_var=unsupported\n  link_all_deplibs=unknown\n  hardcode_automatic=no\n  module_cmds=\n  module_expsym_cmds=\n  always_export_symbols=no\n  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\\''s/.* //'\\'' | sort | uniq > $export_symbols'\n  # include_expsyms should be a list of space-separated symbols to be *always*\n  # included in the symbol list\n  include_expsyms=\n  # exclude_expsyms can be an extended regexp of symbols to exclude\n  # it will be wrapped by ` (' and `)$', so one must not match beginning or\n  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',\n  # as well as any symbol that contains `d'.\n  exclude_expsyms=\"_GLOBAL_OFFSET_TABLE_\"\n  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out\n  # platforms (ab)use it in PIC code, but their linkers get confused if\n  # the symbol is explicitly referenced.  Since portable code cannot\n  # rely on this symbol name, it's probably fine to never include it in\n  # preloaded symbol tables.\n  extract_expsyms_cmds=\n\n  case $host_os in\n  cygwin* | mingw* | pw32*)\n    # FIXME: the MSVC++ port hasn't been tested in a loooong time\n    # When not using gcc, we currently assume that we are using\n    # Microsoft Visual C++.\n    if test \"$GCC\" != yes; then\n      with_gnu_ld=no\n    fi\n    ;;\n  openbsd*)\n    with_gnu_ld=no\n    ;;\n  esac\n\n  ld_shlibs=yes\n  if test \"$with_gnu_ld\" = yes; then\n    # If archive_cmds runs LD, not CC, wlarc should be empty\n    wlarc='${wl}'\n\n    # See if GNU ld supports shared libraries.\n    case $host_os in\n    aix3* | aix4* | aix5*)\n      # On AIX/PPC, the GNU linker is very broken\n      if test \"$host_cpu\" != ia64; then\n\tld_shlibs=no\n\tcat <<EOF 1>&2\n\n*** Warning: the GNU linker, at least up to release 2.9.1, is reported\n*** to be unable to reliably create shared libraries on AIX.\n*** Therefore, libtool is disabling shared libraries support.  If you\n*** really care for shared libraries, you may want to modify your PATH\n*** so that a non-GNU linker is found, and then restart.\n\nEOF\n      fi\n      ;;\n\n    amigaos*)\n      archive_cmds='$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)'\n      hardcode_libdir_flag_spec='-L$libdir'\n      hardcode_minus_L=yes\n\n      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports\n      # that the semantics of dynamic libraries on AmigaOS, at least up\n      # to version 4, is to share data among multiple programs linked\n      # with the same dynamic library.  Since this doesn't match the\n      # behavior of shared libraries on other platforms, we can't use\n      # them.\n      ld_shlibs=no\n      ;;\n\n    beos*)\n      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then\n\tallow_undefined_flag=unsupported\n\t# Joseph Beckenbach <jrb3@best.com> says some releases of gcc\n\t# support --undefined.  This deserves some investigation.  FIXME\n\tarchive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'\n      else\n\tld_shlibs=no\n      fi\n      ;;\n\n    cygwin* | mingw* | pw32*)\n      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,\n      # as there is no search path for DLLs.\n      hardcode_libdir_flag_spec='-L$libdir'\n      allow_undefined_flag=unsupported\n      always_export_symbols=no\n      enable_shared_with_static_runtimes=yes\n      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\\''/^[BCDGS] /s/.* \\([^ ]*\\)/\\1 DATA/'\\'' | $SED -e '\\''/^[AITW] /s/.* //'\\'' | sort | uniq > $export_symbols'\n\n      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then\n        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'\n\t# If the export-symbols file already is a .def file (1st line\n\t# is EXPORTS), use it as is; otherwise, prepend...\n\tarchive_expsym_cmds='if test \"x`$SED 1q $export_symbols`\" = xEXPORTS; then\n\t  cp $export_symbols $output_objdir/$soname.def;\n\telse\n\t  echo EXPORTS > $output_objdir/$soname.def;\n\t  cat $export_symbols >> $output_objdir/$soname.def;\n\tfi~\n\t$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'\n      else\n\tld_shlibs=no\n      fi\n      ;;\n\n    netbsd*)\n      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then\n\tarchive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'\n\twlarc=\n      else\n\tarchive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'\n\tarchive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'\n      fi\n      ;;\n\n    solaris* | sysv5*)\n      if $LD -v 2>&1 | grep 'BFD 2\\.8' > /dev/null; then\n\tld_shlibs=no\n\tcat <<EOF 1>&2\n\n*** Warning: The releases 2.8.* of the GNU linker cannot reliably\n*** create shared libraries on Solaris systems.  Therefore, libtool\n*** is disabling shared libraries support.  We urge you to upgrade GNU\n*** binutils to release 2.9.1 or newer.  Another option is to modify\n*** your PATH or compiler configuration so that the native linker is\n*** used, and then restart.\n\nEOF\n      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then\n\tarchive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'\n\tarchive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'\n      else\n\tld_shlibs=no\n      fi\n      ;;\n\n    sunos4*)\n      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'\n      wlarc=\n      hardcode_direct=yes\n      hardcode_shlibpath_var=no\n      ;;\n\n  linux*)\n    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then\n        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'\n\tarchive_cmds=\"$tmp_archive_cmds\"\n      supports_anon_versioning=no\n      case `$LD -v 2>/dev/null` in\n        *\\ 01.* | *\\ 2.[0-9].* | *\\ 2.10.*) ;; # catch versions < 2.11\n        *\\ 2.11.93.0.2\\ *) supports_anon_versioning=yes ;; # RH7.3 ...\n        *\\ 2.11.92.0.12\\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...\n        *\\ 2.11.*) ;; # other 2.11 versions\n        *) supports_anon_versioning=yes ;;\n      esac\n      if test $supports_anon_versioning = yes; then\n        archive_expsym_cmds='$echo \"{ global:\" > $output_objdir/$libname.ver~\ncat $export_symbols | sed -e \"s/\\(.*\\)/\\1;/\" >> $output_objdir/$libname.ver~\n$echo \"local: *; };\" >> $output_objdir/$libname.ver~\n        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'\n      else\n        archive_expsym_cmds=\"$tmp_archive_cmds\"\n      fi\n    else\n      ld_shlibs=no\n    fi\n    ;;\n\n    *)\n      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then\n\tarchive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'\n\tarchive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'\n      else\n\tld_shlibs=no\n      fi\n      ;;\n    esac\n\n    if test \"$ld_shlibs\" = yes; then\n      runpath_var=LD_RUN_PATH\n      hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'\n      export_dynamic_flag_spec='${wl}--export-dynamic'\n      # ancient GNU ld didn't support --whole-archive et. al.\n      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then\n \twhole_archive_flag_spec=\"$wlarc\"'--whole-archive$convenience '\"$wlarc\"'--no-whole-archive'\n      else\n  \twhole_archive_flag_spec=\n      fi\n    fi\n  else\n    # PORTME fill in a description of your system's linker (not GNU ld)\n    case $host_os in\n    aix3*)\n      allow_undefined_flag=unsupported\n      always_export_symbols=yes\n      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'\n      # Note: this linker hardcodes the directories in LIBPATH if there\n      # are no directories specified by -L.\n      hardcode_minus_L=yes\n      if test \"$GCC\" = yes && test -z \"$link_static_flag\"; then\n\t# Neither direct hardcoding nor static linking is supported with a\n\t# broken collect2.\n\thardcode_direct=unsupported\n      fi\n      ;;\n\n    aix4* | aix5*)\n      if test \"$host_cpu\" = ia64; then\n\t# On IA64, the linker does run time linking by default, so we don't\n\t# have to do anything special.\n\taix_use_runtimelinking=no\n\texp_sym_flag='-Bexport'\n\tno_entry_flag=\"\"\n      else\n\t# If we're using GNU nm, then we don't want the \"-C\" option.\n\t# -C means demangle to AIX nm, but means don't demangle with GNU nm\n\tif $NM -V 2>&1 | grep 'GNU' > /dev/null; then\n\t  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\\''{ if (((\\$2 == \"T\") || (\\$2 == \"D\") || (\\$2 == \"B\")) && (substr(\\$3,1,1) != \".\")) { print \\$3 } }'\\'' | sort -u > $export_symbols'\n\telse\n\t  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\\''{ if (((\\$2 == \"T\") || (\\$2 == \"D\") || (\\$2 == \"B\")) && (substr(\\$3,1,1) != \".\")) { print \\$3 } }'\\'' | sort -u > $export_symbols'\n\tfi\n\taix_use_runtimelinking=no\n\n\t# Test if we are trying to use run time linking or normal\n\t# AIX style linking. If -brtl is somewhere in LDFLAGS, we\n\t# need to do runtime linking.\n\tcase $host_os in aix4.[23]|aix4.[23].*|aix5*)\n\t  for ld_flag in $LDFLAGS; do\n  \t  if (test $ld_flag = \"-brtl\" || test $ld_flag = \"-Wl,-brtl\"); then\n  \t    aix_use_runtimelinking=yes\n  \t    break\n  \t  fi\n\t  done\n\tesac\n\n\texp_sym_flag='-bexport'\n\tno_entry_flag='-bnoentry'\n      fi\n\n      # When large executables or shared objects are built, AIX ld can\n      # have problems creating the table of contents.  If linking a library\n      # or program results in \"error TOC overflow\" add -mminimal-toc to\n      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not\n      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.\n\n      archive_cmds=''\n      hardcode_direct=yes\n      hardcode_libdir_separator=':'\n      link_all_deplibs=yes\n\n      if test \"$GCC\" = yes; then\n\tcase $host_os in aix4.012|aix4.012.*)\n\t# We only want to do this on AIX 4.2 and lower, the check\n\t# below for broken collect2 doesn't work under 4.3+\n\t  collect2name=`${CC} -print-prog-name=collect2`\n\t  if test -f \"$collect2name\" && \\\n  \t   strings \"$collect2name\" | grep resolve_lib_name >/dev/null\n\t  then\n  \t  # We have reworked collect2\n  \t  hardcode_direct=yes\n\t  else\n  \t  # We have old collect2\n  \t  hardcode_direct=unsupported\n  \t  # It fails to find uninstalled libraries when the uninstalled\n  \t  # path is not listed in the libpath.  Setting hardcode_minus_L\n  \t  # to unsupported forces relinking\n  \t  hardcode_minus_L=yes\n  \t  hardcode_libdir_flag_spec='-L$libdir'\n  \t  hardcode_libdir_separator=\n\t  fi\n\tesac\n\tshared_flag='-shared'\n      else\n\t# not using gcc\n\tif test \"$host_cpu\" = ia64; then\n  \t# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release\n  \t# chokes on -Wl,-G. The following line is correct:\n\t  shared_flag='-G'\n\telse\n  \tif test \"$aix_use_runtimelinking\" = yes; then\n\t    shared_flag='${wl}-G'\n\t  else\n\t    shared_flag='${wl}-bM:SRE'\n  \tfi\n\tfi\n      fi\n\n      # It seems that -bexpall does not export symbols beginning with\n      # underscore (_), so it is better to generate a list of symbols to export.\n      always_export_symbols=yes\n      if test \"$aix_use_runtimelinking\" = yes; then\n\t# Warning - without using the other runtime loading flags (-brtl),\n\t# -berok will link without error, but may produce a broken library.\n\tallow_undefined_flag='-berok'\n       # Determine the default libpath from the value encoded in an empty executable.\n       cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n\naix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\\(.*\\)$/\\1/; p; }\n}'`\n# Check for a 64-bit object if we didn't find anything.\nif test -z \"$aix_libpath\"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\\(.*\\)$/\\1/; p; }\n}'`; fi\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nif test -z \"$aix_libpath\"; then aix_libpath=\"/usr/lib:/lib\"; fi\n\n       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'\"$aix_libpath\"\n\tarchive_expsym_cmds=\"\\$CC\"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test \"x${allow_undefined_flag}\" != \"x\"; then echo \"${wl}${allow_undefined_flag}\"; else :; fi` '\"\\${wl}$no_entry_flag \\${wl}$exp_sym_flag:\\$export_symbols $shared_flag\"\n       else\n\tif test \"$host_cpu\" = ia64; then\n\t  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'\n\t  allow_undefined_flag=\"-z nodefs\"\n\t  archive_expsym_cmds=\"\\$CC $shared_flag\"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '\"\\${wl}$no_entry_flag \\${wl}$exp_sym_flag:\\$export_symbols\"\n\telse\n\t # Determine the default libpath from the value encoded in an empty executable.\n\t cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n\naix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\\(.*\\)$/\\1/; p; }\n}'`\n# Check for a 64-bit object if we didn't find anything.\nif test -z \"$aix_libpath\"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\\(.*\\)$/\\1/; p; }\n}'`; fi\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nif test -z \"$aix_libpath\"; then aix_libpath=\"/usr/lib:/lib\"; fi\n\n\t hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'\"$aix_libpath\"\n\t  # Warning - without using the other run time loading flags,\n\t  # -berok will link without error, but may produce a broken library.\n\t  no_undefined_flag=' ${wl}-bernotok'\n\t  allow_undefined_flag=' ${wl}-berok'\n\t  # -bexpall does not export symbols beginning with underscore (_)\n\t  always_export_symbols=yes\n\t  # Exported symbols can be pulled into shared objects from archives\n\t  whole_archive_flag_spec=' '\n\t  archive_cmds_need_lc=yes\n\t  # This is similar to how AIX traditionally builds it's shared libraries.\n\t  archive_expsym_cmds=\"\\$CC $shared_flag\"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'\n\tfi\n      fi\n      ;;\n\n    amigaos*)\n      archive_cmds='$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)'\n      hardcode_libdir_flag_spec='-L$libdir'\n      hardcode_minus_L=yes\n      # see comment about different semantics on the GNU ld section\n      ld_shlibs=no\n      ;;\n\n    bsdi4*)\n      export_dynamic_flag_spec=-rdynamic\n      ;;\n\n    cygwin* | mingw* | pw32*)\n      # When not using gcc, we currently assume that we are using\n      # Microsoft Visual C++.\n      # hardcode_libdir_flag_spec is actually meaningless, as there is\n      # no search path for DLLs.\n      hardcode_libdir_flag_spec=' '\n      allow_undefined_flag=unsupported\n      # Tell ltmain to make .lib files, not .a files.\n      libext=lib\n      # Tell ltmain to make .dll files, not .so files.\n      shrext_cmds=\".dll\"\n      # FIXME: Setting linknames here is a bad hack.\n      archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo \"$deplibs\" | $SED -e '\\''s/ -lc$//'\\''` -link -dll~linknames='\n      # The linker will automatically build a .lib file if we build a DLL.\n      old_archive_From_new_cmds='true'\n      # FIXME: Should let the user specify the lib program.\n      old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'\n      fix_srcfile_path='`cygpath -w \"$srcfile\"`'\n      enable_shared_with_static_runtimes=yes\n      ;;\n\n    darwin* | rhapsody*)\n    if test \"$GXX\" = yes ; then\n      archive_cmds_need_lc=no\n      case \"$host_os\" in\n      rhapsody* | darwin1.[012])\n\tallow_undefined_flag='-undefined suppress'\n\t;;\n      *) # Darwin 1.3 on\n      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then\n      \tallow_undefined_flag='-flat_namespace -undefined suppress'\n      else\n        case ${MACOSX_DEPLOYMENT_TARGET} in\n          10.[012])\n            allow_undefined_flag='-flat_namespace -undefined suppress'\n            ;;\n          10.*)\n            allow_undefined_flag='-undefined dynamic_lookup'\n            ;;\n        esac\n      fi\n\t;;\n      esac\n    \tlt_int_apple_cc_single_mod=no\n    \toutput_verbose_link_cmd='echo'\n    \tif $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then\n    \t  lt_int_apple_cc_single_mod=yes\n    \tfi\n    \tif test \"X$lt_int_apple_cc_single_mod\" = Xyes ; then\n    \t  archive_cmds='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'\n    \telse\n        archive_cmds='$CC -r ${wl}-bind_at_load -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'\n      fi\n      module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'\n      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's\n        if test \"X$lt_int_apple_cc_single_mod\" = Xyes ; then\n          archive_expsym_cmds='sed -e \"s,#.*,,\" -e \"s,^[    ]*,,\" -e \"s,^\\(..*\\),_&,\" < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'\n        else\n          archive_expsym_cmds='sed -e \"s,#.*,,\" -e \"s,^[    ]*,,\" -e \"s,^\\(..*\\),_&,\" < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'\n        fi\n          module_expsym_cmds='sed -e \"s,#.*,,\" -e \"s,^[    ]*,,\" -e \"s,^\\(..*\\),_&,\" < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'\n      hardcode_direct=no\n      hardcode_automatic=yes\n      hardcode_shlibpath_var=unsupported\n      whole_archive_flag_spec='-all_load $convenience'\n      link_all_deplibs=yes\n    else\n      ld_shlibs=no\n    fi\n      ;;\n\n    dgux*)\n      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_libdir_flag_spec='-L$libdir'\n      hardcode_shlibpath_var=no\n      ;;\n\n    freebsd1*)\n      ld_shlibs=no\n      ;;\n\n    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor\n    # support.  Future versions do this automatically, but an explicit c++rt0.o\n    # does not break anything, and helps significantly (at the cost of a little\n    # extra space).\n    freebsd2.2*)\n      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'\n      hardcode_libdir_flag_spec='-R$libdir'\n      hardcode_direct=yes\n      hardcode_shlibpath_var=no\n      ;;\n\n    # Unfortunately, older versions of FreeBSD 2 do not have this feature.\n    freebsd2*)\n      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_direct=yes\n      hardcode_minus_L=yes\n      hardcode_shlibpath_var=no\n      ;;\n\n    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.\n    freebsd* | kfreebsd*-gnu)\n      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'\n      hardcode_libdir_flag_spec='-R$libdir'\n      hardcode_direct=yes\n      hardcode_shlibpath_var=no\n      ;;\n\n    hpux9*)\n      if test \"$GCC\" = yes; then\n\tarchive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'\n      else\n\tarchive_cmds='$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'\n      fi\n      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'\n      hardcode_libdir_separator=:\n      hardcode_direct=yes\n\n      # hardcode_minus_L: Not really in the search PATH,\n      # but as the default location of the library.\n      hardcode_minus_L=yes\n      export_dynamic_flag_spec='${wl}-E'\n      ;;\n\n    hpux10* | hpux11*)\n      if test \"$GCC\" = yes -a \"$with_gnu_ld\" = no; then\n\tcase \"$host_cpu\" in\n\thppa*64*|ia64*)\n\t  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\t*)\n\t  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\tesac\n      else\n\tcase \"$host_cpu\" in\n\thppa*64*|ia64*)\n\t  archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  ;;\n\t*)\n\t  archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'\n\t  ;;\n\tesac\n      fi\n      if test \"$with_gnu_ld\" = no; then\n\tcase \"$host_cpu\" in\n\thppa*64*)\n\t  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'\n\t  hardcode_libdir_flag_spec_ld='+b $libdir'\n\t  hardcode_libdir_separator=:\n\t  hardcode_direct=no\n\t  hardcode_shlibpath_var=no\n\t  ;;\n\tia64*)\n\t  hardcode_libdir_flag_spec='-L$libdir'\n\t  hardcode_direct=no\n\t  hardcode_shlibpath_var=no\n\n\t  # hardcode_minus_L: Not really in the search PATH,\n\t  # but as the default location of the library.\n\t  hardcode_minus_L=yes\n\t  ;;\n\t*)\n\t  hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'\n\t  hardcode_libdir_separator=:\n\t  hardcode_direct=yes\n\t  export_dynamic_flag_spec='${wl}-E'\n\n\t  # hardcode_minus_L: Not really in the search PATH,\n\t  # but as the default location of the library.\n\t  hardcode_minus_L=yes\n\t  ;;\n\tesac\n      fi\n      ;;\n\n    irix5* | irix6* | nonstopux*)\n      if test \"$GCC\" = yes; then\n\tarchive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n \"$verstring\" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'\n      else\n\tarchive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n \"$verstring\" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'\n\thardcode_libdir_flag_spec_ld='-rpath $libdir'\n      fi\n      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'\n      hardcode_libdir_separator=:\n      link_all_deplibs=yes\n      ;;\n\n    netbsd*)\n      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then\n\tarchive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out\n      else\n\tarchive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF\n      fi\n      hardcode_libdir_flag_spec='-R$libdir'\n      hardcode_direct=yes\n      hardcode_shlibpath_var=no\n      ;;\n\n    newsos6)\n      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_direct=yes\n      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'\n      hardcode_libdir_separator=:\n      hardcode_shlibpath_var=no\n      ;;\n\n    openbsd*)\n      hardcode_direct=yes\n      hardcode_shlibpath_var=no\n      if test -z \"`echo __ELF__ | $CC -E - | grep __ELF__`\" || test \"$host_os-$host_cpu\" = \"openbsd2.8-powerpc\"; then\n\tarchive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n\thardcode_libdir_flag_spec='${wl}-rpath,$libdir'\n\texport_dynamic_flag_spec='${wl}-E'\n      else\n       case $host_os in\n\t openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)\n\t   archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'\n\t   hardcode_libdir_flag_spec='-R$libdir'\n\t   ;;\n\t *)\n\t   archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n\t   hardcode_libdir_flag_spec='${wl}-rpath,$libdir'\n\t   ;;\n       esac\n      fi\n      ;;\n\n    os2*)\n      hardcode_libdir_flag_spec='-L$libdir'\n      hardcode_minus_L=yes\n      allow_undefined_flag=unsupported\n      archive_cmds='$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'\n      old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'\n      ;;\n\n    osf3*)\n      if test \"$GCC\" = yes; then\n\tallow_undefined_flag=' ${wl}-expect_unresolved ${wl}\\*'\n\tarchive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n \"$verstring\" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'\n      else\n\tallow_undefined_flag=' -expect_unresolved \\*'\n\tarchive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n \"$verstring\" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'\n      fi\n      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'\n      hardcode_libdir_separator=:\n      ;;\n\n    osf4* | osf5*)\t# as osf3* with the addition of -msym flag\n      if test \"$GCC\" = yes; then\n\tallow_undefined_flag=' ${wl}-expect_unresolved ${wl}\\*'\n\tarchive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n \"$verstring\" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'\n\thardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'\n      else\n\tallow_undefined_flag=' -expect_unresolved \\*'\n\tarchive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n \"$verstring\" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'\n\tarchive_expsym_cmds='for i in `cat $export_symbols`; do printf \"%s %s\\\\n\" -exported_symbol \"\\$i\" >> $lib.exp; done; echo \"-hidden\">> $lib.exp~\n\t$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n \"$verstring\" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'\n\n\t# Both c and cxx compiler support -rpath directly\n\thardcode_libdir_flag_spec='-rpath $libdir'\n      fi\n      hardcode_libdir_separator=:\n      ;;\n\n    sco3.2v5*)\n      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_shlibpath_var=no\n      export_dynamic_flag_spec='${wl}-Bexport'\n      runpath_var=LD_RUN_PATH\n      hardcode_runpath_var=yes\n      ;;\n\n    solaris*)\n      no_undefined_flag=' -z text'\n      if test \"$GCC\" = yes; then\n\tarchive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'\n\tarchive_expsym_cmds='$echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~$echo \"local: *; };\" >> $lib.exp~\n\t  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'\n      else\n\tarchive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\tarchive_expsym_cmds='$echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~$echo \"local: *; };\" >> $lib.exp~\n  \t$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'\n      fi\n      hardcode_libdir_flag_spec='-R$libdir'\n      hardcode_shlibpath_var=no\n      case $host_os in\n      solaris2.[0-5] | solaris2.[0-5].*) ;;\n      *) # Supported since Solaris 2.6 (maybe 2.5.1?)\n\twhole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;\n      esac\n      link_all_deplibs=yes\n      ;;\n\n    sunos4*)\n      if test \"x$host_vendor\" = xsequent; then\n\t# Use $CC to link under sequent, because it throws in some extra .o\n\t# files that make .init and .fini sections work.\n\tarchive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\tarchive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'\n      fi\n      hardcode_libdir_flag_spec='-L$libdir'\n      hardcode_direct=yes\n      hardcode_minus_L=yes\n      hardcode_shlibpath_var=no\n      ;;\n\n    sysv4)\n      case $host_vendor in\n\tsni)\n\t  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  hardcode_direct=yes # is this really true???\n\t;;\n\tsiemens)\n\t  ## LD is ld it makes a PLAMLIB\n\t  ## CC just makes a GrossModule.\n\t  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'\n\t  reload_cmds='$CC -r -o $output$reload_objs'\n\t  hardcode_direct=no\n        ;;\n\tmotorola)\n\t  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  hardcode_direct=no #Motorola manual says yes, but my tests say they lie\n\t;;\n      esac\n      runpath_var='LD_RUN_PATH'\n      hardcode_shlibpath_var=no\n      ;;\n\n    sysv4.3*)\n      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_shlibpath_var=no\n      export_dynamic_flag_spec='-Bexport'\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\tarchive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\thardcode_shlibpath_var=no\n\trunpath_var=LD_RUN_PATH\n\thardcode_runpath_var=yes\n\tld_shlibs=yes\n      fi\n      ;;\n\n    sysv4.2uw2*)\n      archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_direct=yes\n      hardcode_minus_L=no\n      hardcode_shlibpath_var=no\n      hardcode_runpath_var=yes\n      runpath_var=LD_RUN_PATH\n      ;;\n\n   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)\n      no_undefined_flag='${wl}-z ${wl}text'\n      if test \"$GCC\" = yes; then\n\tarchive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\tarchive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'\n      fi\n      runpath_var='LD_RUN_PATH'\n      hardcode_shlibpath_var=no\n      ;;\n\n    sysv5*)\n      no_undefined_flag=' -z text'\n      # $CC -shared without GNU ld will not create a library from C++\n      # object files and a static libstdc++, better avoid it by now\n      archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      archive_expsym_cmds='$echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~$echo \"local: *; };\" >> $lib.exp~\n  \t\t$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'\n      hardcode_libdir_flag_spec=\n      hardcode_shlibpath_var=no\n      runpath_var='LD_RUN_PATH'\n      ;;\n\n    uts4*)\n      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_libdir_flag_spec='-L$libdir'\n      hardcode_shlibpath_var=no\n      ;;\n\n    *)\n      ld_shlibs=no\n      ;;\n    esac\n  fi\n\necho \"$as_me:$LINENO: result: $ld_shlibs\" >&5\necho \"${ECHO_T}$ld_shlibs\" >&6\ntest \"$ld_shlibs\" = no && can_build_shared=no\n\nvariables_saved_for_relink=\"PATH $shlibpath_var $runpath_var\"\nif test \"$GCC\" = yes; then\n  variables_saved_for_relink=\"$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH\"\nfi\n\n#\n# Do we need to explicitly link libc?\n#\ncase \"x$archive_cmds_need_lc\" in\nx|xyes)\n  # Assume -lc should be added\n  archive_cmds_need_lc=yes\n\n  if test \"$enable_shared\" = yes && test \"$GCC\" = yes; then\n    case $archive_cmds in\n    *'~'*)\n      # FIXME: we may have to deal with multi-command sequences.\n      ;;\n    '$CC '*)\n      # Test whether the compiler implicitly links with -lc since on some\n      # systems, -lgcc has to come before -lc. If gcc already passes -lc\n      # to ld, don't add -lc before -lgcc.\n      echo \"$as_me:$LINENO: checking whether -lc should be explicitly linked in\" >&5\necho $ECHO_N \"checking whether -lc should be explicitly linked in... $ECHO_C\" >&6\n      $rm conftest*\n      printf \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n\n      if { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } 2>conftest.err; then\n        soname=conftest\n        lib=conftest\n        libobjs=conftest.$ac_objext\n        deplibs=\n        wl=$lt_prog_compiler_wl\n        compiler_flags=-v\n        linker_flags=-v\n        verstring=\n        output_objdir=.\n        libname=conftest\n        lt_save_allow_undefined_flag=$allow_undefined_flag\n        allow_undefined_flag=\n        if { (eval echo \"$as_me:$LINENO: \\\"$archive_cmds 2\\>\\&1 \\| grep \\\" -lc \\\" \\>/dev/null 2\\>\\&1\\\"\") >&5\n  (eval $archive_cmds 2\\>\\&1 \\| grep \\\" -lc \\\" \\>/dev/null 2\\>\\&1) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }\n        then\n\t  archive_cmds_need_lc=no\n        else\n\t  archive_cmds_need_lc=yes\n        fi\n        allow_undefined_flag=$lt_save_allow_undefined_flag\n      else\n        cat conftest.err 1>&5\n      fi\n      $rm conftest*\n      echo \"$as_me:$LINENO: result: $archive_cmds_need_lc\" >&5\necho \"${ECHO_T}$archive_cmds_need_lc\" >&6\n      ;;\n    esac\n  fi\n  ;;\nesac\n\necho \"$as_me:$LINENO: checking dynamic linker characteristics\" >&5\necho $ECHO_N \"checking dynamic linker characteristics... $ECHO_C\" >&6\nlibrary_names_spec=\nlibname_spec='lib$name'\nsoname_spec=\nshrext_cmds=\".so\"\npostinstall_cmds=\npostuninstall_cmds=\nfinish_cmds=\nfinish_eval=\nshlibpath_var=\nshlibpath_overrides_runpath=unknown\nversion_type=none\ndynamic_linker=\"$host_os ld.so\"\nsys_lib_dlsearch_path_spec=\"/lib /usr/lib\"\nif test \"$GCC\" = yes; then\n  sys_lib_search_path_spec=`$CC -print-search-dirs | grep \"^libraries:\" | $SED -e \"s/^libraries://\" -e \"s,=/,/,g\"`\n  if echo \"$sys_lib_search_path_spec\" | grep ';' >/dev/null ; then\n    # if the path contains \";\" then we assume it to be the separator\n    # otherwise default to the standard path separator (i.e. \":\") - it is\n    # assumed that no part of a normal pathname contains \";\" but that should\n    # okay in the real world where \";\" in dirpaths is itself problematic.\n    sys_lib_search_path_spec=`echo \"$sys_lib_search_path_spec\" | $SED -e 's/;/ /g'`\n  else\n    sys_lib_search_path_spec=`echo \"$sys_lib_search_path_spec\" | $SED  -e \"s/$PATH_SEPARATOR/ /g\"`\n  fi\nelse\n  sys_lib_search_path_spec=\"/lib /usr/lib /usr/local/lib\"\nfi\nneed_lib_prefix=unknown\nhardcode_into_libs=no\n\n# when you set need_version to no, make sure it does not cause -set_version\n# flags to be left without arguments\nneed_version=unknown\n\ncase $host_os in\naix3*)\n  version_type=linux\n  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'\n  shlibpath_var=LIBPATH\n\n  # AIX 3 has no versioning support, so we append a major version to the name.\n  soname_spec='${libname}${release}${shared_ext}$major'\n  ;;\n\naix4* | aix5*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  hardcode_into_libs=yes\n  if test \"$host_cpu\" = ia64; then\n    # AIX 5 supports IA64\n    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'\n    shlibpath_var=LD_LIBRARY_PATH\n  else\n    # With GCC up to 2.95.x, collect2 would create an import file\n    # for dependence libraries.  The import file would start with\n    # the line `#! .'.  This would cause the generated library to\n    # depend on `.', always an invalid library.  This was fixed in\n    # development snapshots of GCC prior to 3.0.\n    case $host_os in\n      aix4 | aix4.[01] | aix4.[01].*)\n      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'\n\t   echo ' yes '\n\t   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then\n\t:\n      else\n\tcan_build_shared=no\n      fi\n      ;;\n    esac\n    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct\n    # soname into executable. Probably we can add versioning support to\n    # collect2, so additional links can be useful in future.\n    if test \"$aix_use_runtimelinking\" = yes; then\n      # If using run time linking (on AIX 4.2 or later) use lib<name>.so\n      # instead of lib<name>.a to let people know that these are not\n      # typical AIX shared libraries.\n      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n    else\n      # We preserve .a as extension for shared libraries through AIX4.2\n      # and later when we are not doing run time linking.\n      library_names_spec='${libname}${release}.a $libname.a'\n      soname_spec='${libname}${release}${shared_ext}$major'\n    fi\n    shlibpath_var=LIBPATH\n  fi\n  ;;\n\namigaos*)\n  library_names_spec='$libname.ixlibrary $libname.a'\n  # Create ${libname}_ixlibrary.a entries in /sys/libs.\n  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo \"X$lib\" | $Xsed -e '\\''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'\n  ;;\n\nbeos*)\n  library_names_spec='${libname}${shared_ext}'\n  dynamic_linker=\"$host_os ld.so\"\n  shlibpath_var=LIBRARY_PATH\n  ;;\n\nbsdi4*)\n  version_type=linux\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  sys_lib_search_path_spec=\"/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib\"\n  sys_lib_dlsearch_path_spec=\"/shlib /usr/lib /usr/local/lib\"\n  # the default ld.so.conf also contains /usr/contrib/lib and\n  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow\n  # libtool to hard-code these into programs\n  ;;\n\ncygwin* | mingw* | pw32*)\n  version_type=windows\n  shrext_cmds=\".dll\"\n  need_version=no\n  need_lib_prefix=no\n\n  case $GCC,$host_os in\n  yes,cygwin* | yes,mingw* | yes,pw32*)\n    library_names_spec='$libname.dll.a'\n    # DLL is installed to $(libdir)/../bin by postinstall_cmds\n    postinstall_cmds='base_file=`basename \\${file}`~\n      dlpath=`$SHELL 2>&1 -c '\\''. $dir/'\\''\\${base_file}'\\''i;echo \\$dlname'\\''`~\n      dldir=$destdir/`dirname \\$dlpath`~\n      test -d \\$dldir || mkdir -p \\$dldir~\n      $install_prog $dir/$dlname \\$dldir/$dlname'\n    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\\''. $file; echo \\$dlname'\\''`~\n      dlpath=$dir/\\$dldll~\n       $rm \\$dlpath'\n    shlibpath_overrides_runpath=yes\n\n    case $host_os in\n    cygwin*)\n      # Cygwin DLLs use 'cyg' prefix rather than 'lib'\n      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'\n      sys_lib_search_path_spec=\"/usr/lib /lib/w32api /lib /usr/local/lib\"\n      ;;\n    mingw*)\n      # MinGW DLLs use traditional 'lib' prefix\n      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'\n      sys_lib_search_path_spec=`$CC -print-search-dirs | grep \"^libraries:\" | $SED -e \"s/^libraries://\" -e \"s,=/,/,g\"`\n      if echo \"$sys_lib_search_path_spec\" | grep ';[c-zC-Z]:/' >/dev/null; then\n        # It is most probably a Windows format PATH printed by\n        # mingw gcc, but we are running on Cygwin. Gcc prints its search\n        # path with ; separators, and with drive letters. We can handle the\n        # drive letters (cygwin fileutils understands them), so leave them,\n        # especially as we might pass files found there to a mingw objdump,\n        # which wouldn't understand a cygwinified path. Ahh.\n        sys_lib_search_path_spec=`echo \"$sys_lib_search_path_spec\" | $SED -e 's/;/ /g'`\n      else\n        sys_lib_search_path_spec=`echo \"$sys_lib_search_path_spec\" | $SED  -e \"s/$PATH_SEPARATOR/ /g\"`\n      fi\n      ;;\n    pw32*)\n      # pw32 DLLs use 'pw' prefix rather than 'lib'\n      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'\n      ;;\n    esac\n    ;;\n\n  *)\n    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'\n    ;;\n  esac\n  dynamic_linker='Win32 ld.exe'\n  # FIXME: first we should search . and the directory the executable is in\n  shlibpath_var=PATH\n  ;;\n\ndarwin* | rhapsody*)\n  dynamic_linker=\"$host_os dyld\"\n  version_type=darwin\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'\n  soname_spec='${libname}${release}${major}$shared_ext'\n  shlibpath_overrides_runpath=yes\n  shlibpath_var=DYLD_LIBRARY_PATH\n  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'\n  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.\n  if test \"$GCC\" = yes; then\n    sys_lib_search_path_spec=`$CC -print-search-dirs | tr \"\\n\" \"$PATH_SEPARATOR\" | sed -e 's/libraries:/@libraries:/' | tr \"@\" \"\\n\" | grep \"^libraries:\" | sed -e \"s/^libraries://\" -e \"s,=/,/,g\" -e \"s,$PATH_SEPARATOR, ,g\" -e \"s,.*,& /lib /usr/lib /usr/local/lib,g\"`\n  else\n    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'\n  fi\n  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'\n  ;;\n\ndgux*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\nfreebsd1*)\n  dynamic_linker=no\n  ;;\n\nkfreebsd*-gnu)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  dynamic_linker='GNU ld.so'\n  ;;\n\nfreebsd*)\n  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`\n  version_type=freebsd-$objformat\n  case $version_type in\n    freebsd-elf*)\n      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'\n      need_version=no\n      need_lib_prefix=no\n      ;;\n    freebsd-*)\n      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'\n      need_version=yes\n      ;;\n  esac\n  shlibpath_var=LD_LIBRARY_PATH\n  case $host_os in\n  freebsd2*)\n    shlibpath_overrides_runpath=yes\n    ;;\n  freebsd3.01* | freebsdelf3.01*)\n    shlibpath_overrides_runpath=yes\n    hardcode_into_libs=yes\n    ;;\n  *) # from 3.2 on\n    shlibpath_overrides_runpath=no\n    hardcode_into_libs=yes\n    ;;\n  esac\n  ;;\n\ngnu*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  hardcode_into_libs=yes\n  ;;\n\nhpux9* | hpux10* | hpux11*)\n  # Give a soname corresponding to the major version so that dld.sl refuses to\n  # link against other versions.\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=no\n  case \"$host_cpu\" in\n  ia64*)\n    shrext_cmds='.so'\n    hardcode_into_libs=yes\n    dynamic_linker=\"$host_os dld.so\"\n    shlibpath_var=LD_LIBRARY_PATH\n    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.\n    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n    soname_spec='${libname}${release}${shared_ext}$major'\n    if test \"X$HPUX_IA64_MODE\" = X32; then\n      sys_lib_search_path_spec=\"/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib\"\n    else\n      sys_lib_search_path_spec=\"/usr/lib/hpux64 /usr/local/lib/hpux64\"\n    fi\n    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec\n    ;;\n   hppa*64*)\n     shrext_cmds='.sl'\n     hardcode_into_libs=yes\n     dynamic_linker=\"$host_os dld.sl\"\n     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH\n     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.\n     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n     soname_spec='${libname}${release}${shared_ext}$major'\n     sys_lib_search_path_spec=\"/usr/lib/pa20_64 /usr/ccs/lib/pa20_64\"\n     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec\n     ;;\n   *)\n    shrext_cmds='.sl'\n    dynamic_linker=\"$host_os dld.sl\"\n    shlibpath_var=SHLIB_PATH\n    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH\n    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n    soname_spec='${libname}${release}${shared_ext}$major'\n    ;;\n  esac\n  # HP-UX runs *really* slowly unless shared libraries are mode 555.\n  postinstall_cmds='chmod 555 $lib'\n  ;;\n\nirix5* | irix6* | nonstopux*)\n  case $host_os in\n    nonstopux*) version_type=nonstopux ;;\n    *)\n\tif test \"$lt_cv_prog_gnu_ld\" = yes; then\n\t\tversion_type=linux\n\telse\n\t\tversion_type=irix\n\tfi ;;\n  esac\n  need_lib_prefix=no\n  need_version=no\n  soname_spec='${libname}${release}${shared_ext}$major'\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'\n  case $host_os in\n  irix5* | nonstopux*)\n    libsuff= shlibsuff=\n    ;;\n  *)\n    case $LD in # libtool.m4 will add one of these switches to LD\n    *-32|*\"-32 \"|*-melf32bsmip|*\"-melf32bsmip \")\n      libsuff= shlibsuff= libmagic=32-bit;;\n    *-n32|*\"-n32 \"|*-melf32bmipn32|*\"-melf32bmipn32 \")\n      libsuff=32 shlibsuff=N32 libmagic=N32;;\n    *-64|*\"-64 \"|*-melf64bmip|*\"-melf64bmip \")\n      libsuff=64 shlibsuff=64 libmagic=64-bit;;\n    *) libsuff= shlibsuff= libmagic=never-match;;\n    esac\n    ;;\n  esac\n  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH\n  shlibpath_overrides_runpath=no\n  sys_lib_search_path_spec=\"/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}\"\n  sys_lib_dlsearch_path_spec=\"/usr/lib${libsuff} /lib${libsuff}\"\n  hardcode_into_libs=yes\n  ;;\n\n# No shared lib support for Linux oldld, aout, or coff.\nlinux*oldld* | linux*aout* | linux*coff*)\n  dynamic_linker=no\n  ;;\n\n# This must be Linux ELF.\nlinux*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -n $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  # This implies no fast_install, which is unacceptable.\n  # Some rework will be needed to allow for fast_install\n  # before this can be enabled.\n  hardcode_into_libs=yes\n\n  # find out which ABI we are using\n  libsuff=\n  case \"$host_cpu\" in\n  x86_64*|s390x*|powerpc64*)\n    echo '#line 9017 \"configure\"' > conftest.$ac_ext\n    if { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; then\n      case `/usr/bin/file conftest.$ac_objext` in\n      *64-bit*)\n        libsuff=64\n        sys_lib_search_path_spec=\"/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}\"\n        ;;\n      esac\n    fi\n    rm -rf conftest*\n    ;;\n  esac\n\n  # Append ld.so.conf contents to the search path\n  if test -f /etc/ld.so.conf; then\n    lt_ld_extra=`$SED -e 's/:,\\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\\n' ' '`\n    sys_lib_dlsearch_path_spec=\"/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra\"\n  fi\n\n  # We used to test for /lib/ld.so.1 and disable shared libraries on\n  # powerpc, because MkLinux only supported shared libraries with the\n  # GNU dynamic linker.  Since this was broken with cross compilers,\n  # most powerpc-linux boxes support dynamic linking these days and\n  # people can always --disable-shared, the test was removed, and we\n  # assume the GNU/Linux dynamic linker is in use.\n  dynamic_linker='GNU/Linux ld.so'\n  ;;\n\nknetbsd*-gnu)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  dynamic_linker='GNU ld.so'\n  ;;\n\nnetbsd*)\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=no\n  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then\n    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'\n    finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -m $libdir'\n    dynamic_linker='NetBSD (a.out) ld.so'\n  else\n    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'\n    soname_spec='${libname}${release}${shared_ext}$major'\n    dynamic_linker='NetBSD ld.elf_so'\n  fi\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  hardcode_into_libs=yes\n  ;;\n\nnewsos6)\n  version_type=linux\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  ;;\n\nnto-qnx*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  ;;\n\nopenbsd*)\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=yes\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -m $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  if test -z \"`echo __ELF__ | $CC -E - | grep __ELF__`\" || test \"$host_os-$host_cpu\" = \"openbsd2.8-powerpc\"; then\n    case $host_os in\n      openbsd2.[89] | openbsd2.[89].*)\n\tshlibpath_overrides_runpath=no\n\t;;\n      *)\n\tshlibpath_overrides_runpath=yes\n\t;;\n      esac\n  else\n    shlibpath_overrides_runpath=yes\n  fi\n  ;;\n\nos2*)\n  libname_spec='$name'\n  shrext_cmds=\".dll\"\n  need_lib_prefix=no\n  library_names_spec='$libname${shared_ext} $libname.a'\n  dynamic_linker='OS/2 ld.exe'\n  shlibpath_var=LIBPATH\n  ;;\n\nosf3* | osf4* | osf5*)\n  version_type=osf\n  need_lib_prefix=no\n  need_version=no\n  soname_spec='${libname}${release}${shared_ext}$major'\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  shlibpath_var=LD_LIBRARY_PATH\n  sys_lib_search_path_spec=\"/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib\"\n  sys_lib_dlsearch_path_spec=\"$sys_lib_search_path_spec\"\n  ;;\n\nsco3.2v5*)\n  version_type=osf\n  soname_spec='${libname}${release}${shared_ext}$major'\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\nsolaris*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  hardcode_into_libs=yes\n  # ldd complains unless libraries are executable\n  postinstall_cmds='chmod +x $lib'\n  ;;\n\nsunos4*)\n  version_type=sunos\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'\n  finish_cmds='PATH=\"\\$PATH:/usr/etc\" ldconfig $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  if test \"$with_gnu_ld\" = yes; then\n    need_lib_prefix=no\n  fi\n  need_version=yes\n  ;;\n\nsysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)\n  version_type=linux\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  case $host_vendor in\n    sni)\n      shlibpath_overrides_runpath=no\n      need_lib_prefix=no\n      export_dynamic_flag_spec='${wl}-Blargedynsym'\n      runpath_var=LD_RUN_PATH\n      ;;\n    siemens)\n      need_lib_prefix=no\n      ;;\n    motorola)\n      need_lib_prefix=no\n      need_version=no\n      shlibpath_overrides_runpath=no\n      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'\n      ;;\n  esac\n  ;;\n\nsysv4*MP*)\n  if test -d /usr/nec ;then\n    version_type=linux\n    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'\n    soname_spec='$libname${shared_ext}.$major'\n    shlibpath_var=LD_LIBRARY_PATH\n  fi\n  ;;\n\nuts4*)\n  version_type=linux\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\n*)\n  dynamic_linker=no\n  ;;\nesac\necho \"$as_me:$LINENO: result: $dynamic_linker\" >&5\necho \"${ECHO_T}$dynamic_linker\" >&6\ntest \"$dynamic_linker\" = no && can_build_shared=no\n\necho \"$as_me:$LINENO: checking how to hardcode library paths into programs\" >&5\necho $ECHO_N \"checking how to hardcode library paths into programs... $ECHO_C\" >&6\nhardcode_action=\nif test -n \"$hardcode_libdir_flag_spec\" || \\\n   test -n \"$runpath_var \" || \\\n   test \"X$hardcode_automatic\"=\"Xyes\" ; then\n\n  # We can hardcode non-existant directories.\n  if test \"$hardcode_direct\" != no &&\n     # If the only mechanism to avoid hardcoding is shlibpath_var, we\n     # have to relink, otherwise we might link with an installed library\n     # when we should be linking with a yet-to-be-installed one\n     ## test \"$_LT_AC_TAGVAR(hardcode_shlibpath_var, )\" != no &&\n     test \"$hardcode_minus_L\" != no; then\n    # Linking always hardcodes the temporary library directory.\n    hardcode_action=relink\n  else\n    # We can link without hardcoding, and we can hardcode nonexisting dirs.\n    hardcode_action=immediate\n  fi\nelse\n  # We cannot hardcode anything, or else we can only hardcode existing\n  # directories.\n  hardcode_action=unsupported\nfi\necho \"$as_me:$LINENO: result: $hardcode_action\" >&5\necho \"${ECHO_T}$hardcode_action\" >&6\n\nif test \"$hardcode_action\" = relink; then\n  # Fast installation is not supported\n  enable_fast_install=no\nelif test \"$shlibpath_overrides_runpath\" = yes ||\n     test \"$enable_shared\" = no; then\n  # Fast installation is not necessary\n  enable_fast_install=needless\nfi\n\nstriplib=\nold_striplib=\necho \"$as_me:$LINENO: checking whether stripping libraries is possible\" >&5\necho $ECHO_N \"checking whether stripping libraries is possible... $ECHO_C\" >&6\nif test -n \"$STRIP\" && $STRIP -V 2>&1 | grep \"GNU strip\" >/dev/null; then\n  test -z \"$old_striplib\" && old_striplib=\"$STRIP --strip-debug\"\n  test -z \"$striplib\" && striplib=\"$STRIP --strip-unneeded\"\n  echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\nelse\n# FIXME - insert some real tests, host_os isn't really good enough\n  case $host_os in\n   darwin*)\n       if test -n \"$STRIP\" ; then\n         striplib=\"$STRIP -x\"\n         echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\n       else\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n       ;;\n   *)\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\n    ;;\n  esac\nfi\n\nif test \"x$enable_dlopen\" != xyes; then\n  enable_dlopen=unknown\n  enable_dlopen_self=unknown\n  enable_dlopen_self_static=unknown\nelse\n  lt_cv_dlopen=no\n  lt_cv_dlopen_libs=\n\n  case $host_os in\n  beos*)\n    lt_cv_dlopen=\"load_add_on\"\n    lt_cv_dlopen_libs=\n    lt_cv_dlopen_self=yes\n    ;;\n\n  mingw* | pw32*)\n    lt_cv_dlopen=\"LoadLibrary\"\n    lt_cv_dlopen_libs=\n   ;;\n\n  cygwin*)\n    lt_cv_dlopen=\"dlopen\"\n    lt_cv_dlopen_libs=\n   ;;\n\n  darwin*)\n  # if libdl is installed we need to link against it\n    echo \"$as_me:$LINENO: checking for dlopen in -ldl\" >&5\necho $ECHO_N \"checking for dlopen in -ldl... $ECHO_C\" >&6\nif test \"${ac_cv_lib_dl_dlopen+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-ldl  $LIBS\"\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\n/* Override any gcc2 internal prototype to avoid an error.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\n/* We use char because int might match the return type of a gcc2\n   builtin and then its argument prototype would still apply.  */\nchar dlopen ();\nint\nmain ()\n{\ndlopen ();\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_lib_dl_dlopen=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_lib_dl_dlopen=no\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\necho \"$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen\" >&5\necho \"${ECHO_T}$ac_cv_lib_dl_dlopen\" >&6\nif test $ac_cv_lib_dl_dlopen = yes; then\n  lt_cv_dlopen=\"dlopen\" lt_cv_dlopen_libs=\"-ldl\"\nelse\n\n    lt_cv_dlopen=\"dyld\"\n    lt_cv_dlopen_libs=\n    lt_cv_dlopen_self=yes\n\nfi\n\n   ;;\n\n  *)\n    echo \"$as_me:$LINENO: checking for shl_load\" >&5\necho $ECHO_N \"checking for shl_load... $ECHO_C\" >&6\nif test \"${ac_cv_func_shl_load+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.\n   For example, HP-UX 11i <limits.h> declares gettimeofday.  */\n#define shl_load innocuous_shl_load\n\n/* System header to define __stub macros and hopefully few prototypes,\n    which can conflict with char shl_load (); below.\n    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since\n    <limits.h> exists even on freestanding compilers.  */\n\n#ifdef __STDC__\n# include <limits.h>\n#else\n# include <assert.h>\n#endif\n\n#undef shl_load\n\n/* Override any gcc2 internal prototype to avoid an error.  */\n#ifdef __cplusplus\nextern \"C\"\n{\n#endif\n/* We use char because int might match the return type of a gcc2\n   builtin and then its argument prototype would still apply.  */\nchar shl_load ();\n/* The GNU C library defines this for functions which it implements\n    to always fail with ENOSYS.  Some functions are actually named\n    something starting with __ and the normal name is an alias.  */\n#if defined (__stub_shl_load) || defined (__stub___shl_load)\nchoke me\n#else\nchar (*f) () = shl_load;\n#endif\n#ifdef __cplusplus\n}\n#endif\n\nint\nmain ()\n{\nreturn f != shl_load;\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_func_shl_load=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_func_shl_load=no\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nfi\necho \"$as_me:$LINENO: result: $ac_cv_func_shl_load\" >&5\necho \"${ECHO_T}$ac_cv_func_shl_load\" >&6\nif test $ac_cv_func_shl_load = yes; then\n  lt_cv_dlopen=\"shl_load\"\nelse\n  echo \"$as_me:$LINENO: checking for shl_load in -ldld\" >&5\necho $ECHO_N \"checking for shl_load in -ldld... $ECHO_C\" >&6\nif test \"${ac_cv_lib_dld_shl_load+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-ldld  $LIBS\"\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\n/* Override any gcc2 internal prototype to avoid an error.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\n/* We use char because int might match the return type of a gcc2\n   builtin and then its argument prototype would still apply.  */\nchar shl_load ();\nint\nmain ()\n{\nshl_load ();\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_lib_dld_shl_load=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_lib_dld_shl_load=no\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\necho \"$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load\" >&5\necho \"${ECHO_T}$ac_cv_lib_dld_shl_load\" >&6\nif test $ac_cv_lib_dld_shl_load = yes; then\n  lt_cv_dlopen=\"shl_load\" lt_cv_dlopen_libs=\"-dld\"\nelse\n  echo \"$as_me:$LINENO: checking for dlopen\" >&5\necho $ECHO_N \"checking for dlopen... $ECHO_C\" >&6\nif test \"${ac_cv_func_dlopen+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.\n   For example, HP-UX 11i <limits.h> declares gettimeofday.  */\n#define dlopen innocuous_dlopen\n\n/* System header to define __stub macros and hopefully few prototypes,\n    which can conflict with char dlopen (); below.\n    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since\n    <limits.h> exists even on freestanding compilers.  */\n\n#ifdef __STDC__\n# include <limits.h>\n#else\n# include <assert.h>\n#endif\n\n#undef dlopen\n\n/* Override any gcc2 internal prototype to avoid an error.  */\n#ifdef __cplusplus\nextern \"C\"\n{\n#endif\n/* We use char because int might match the return type of a gcc2\n   builtin and then its argument prototype would still apply.  */\nchar dlopen ();\n/* The GNU C library defines this for functions which it implements\n    to always fail with ENOSYS.  Some functions are actually named\n    something starting with __ and the normal name is an alias.  */\n#if defined (__stub_dlopen) || defined (__stub___dlopen)\nchoke me\n#else\nchar (*f) () = dlopen;\n#endif\n#ifdef __cplusplus\n}\n#endif\n\nint\nmain ()\n{\nreturn f != dlopen;\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_func_dlopen=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_func_dlopen=no\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nfi\necho \"$as_me:$LINENO: result: $ac_cv_func_dlopen\" >&5\necho \"${ECHO_T}$ac_cv_func_dlopen\" >&6\nif test $ac_cv_func_dlopen = yes; then\n  lt_cv_dlopen=\"dlopen\"\nelse\n  echo \"$as_me:$LINENO: checking for dlopen in -ldl\" >&5\necho $ECHO_N \"checking for dlopen in -ldl... $ECHO_C\" >&6\nif test \"${ac_cv_lib_dl_dlopen+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-ldl  $LIBS\"\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\n/* Override any gcc2 internal prototype to avoid an error.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\n/* We use char because int might match the return type of a gcc2\n   builtin and then its argument prototype would still apply.  */\nchar dlopen ();\nint\nmain ()\n{\ndlopen ();\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_lib_dl_dlopen=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_lib_dl_dlopen=no\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\necho \"$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen\" >&5\necho \"${ECHO_T}$ac_cv_lib_dl_dlopen\" >&6\nif test $ac_cv_lib_dl_dlopen = yes; then\n  lt_cv_dlopen=\"dlopen\" lt_cv_dlopen_libs=\"-ldl\"\nelse\n  echo \"$as_me:$LINENO: checking for dlopen in -lsvld\" >&5\necho $ECHO_N \"checking for dlopen in -lsvld... $ECHO_C\" >&6\nif test \"${ac_cv_lib_svld_dlopen+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-lsvld  $LIBS\"\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\n/* Override any gcc2 internal prototype to avoid an error.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\n/* We use char because int might match the return type of a gcc2\n   builtin and then its argument prototype would still apply.  */\nchar dlopen ();\nint\nmain ()\n{\ndlopen ();\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_lib_svld_dlopen=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_lib_svld_dlopen=no\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\necho \"$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen\" >&5\necho \"${ECHO_T}$ac_cv_lib_svld_dlopen\" >&6\nif test $ac_cv_lib_svld_dlopen = yes; then\n  lt_cv_dlopen=\"dlopen\" lt_cv_dlopen_libs=\"-lsvld\"\nelse\n  echo \"$as_me:$LINENO: checking for dld_link in -ldld\" >&5\necho $ECHO_N \"checking for dld_link in -ldld... $ECHO_C\" >&6\nif test \"${ac_cv_lib_dld_dld_link+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-ldld  $LIBS\"\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\n/* Override any gcc2 internal prototype to avoid an error.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\n/* We use char because int might match the return type of a gcc2\n   builtin and then its argument prototype would still apply.  */\nchar dld_link ();\nint\nmain ()\n{\ndld_link ();\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_lib_dld_dld_link=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_lib_dld_dld_link=no\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\necho \"$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link\" >&5\necho \"${ECHO_T}$ac_cv_lib_dld_dld_link\" >&6\nif test $ac_cv_lib_dld_dld_link = yes; then\n  lt_cv_dlopen=\"dld_link\" lt_cv_dlopen_libs=\"-dld\"\nfi\n\n\nfi\n\n\nfi\n\n\nfi\n\n\nfi\n\n\nfi\n\n    ;;\n  esac\n\n  if test \"x$lt_cv_dlopen\" != xno; then\n    enable_dlopen=yes\n  else\n    enable_dlopen=no\n  fi\n\n  case $lt_cv_dlopen in\n  dlopen)\n    save_CPPFLAGS=\"$CPPFLAGS\"\n    test \"x$ac_cv_header_dlfcn_h\" = xyes && CPPFLAGS=\"$CPPFLAGS -DHAVE_DLFCN_H\"\n\n    save_LDFLAGS=\"$LDFLAGS\"\n    eval LDFLAGS=\\\"\\$LDFLAGS $export_dynamic_flag_spec\\\"\n\n    save_LIBS=\"$LIBS\"\n    LIBS=\"$lt_cv_dlopen_libs $LIBS\"\n\n    echo \"$as_me:$LINENO: checking whether a program can dlopen itself\" >&5\necho $ECHO_N \"checking whether a program can dlopen itself... $ECHO_C\" >&6\nif test \"${lt_cv_dlopen_self+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  \t  if test \"$cross_compiling\" = yes; then :\n  lt_cv_dlopen_self=cross\nelse\n  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2\n  lt_status=$lt_dlunknown\n  cat > conftest.$ac_ext <<EOF\n#line 9888 \"configure\"\n#include \"confdefs.h\"\n\n#if HAVE_DLFCN_H\n#include <dlfcn.h>\n#endif\n\n#include <stdio.h>\n\n#ifdef RTLD_GLOBAL\n#  define LT_DLGLOBAL\t\tRTLD_GLOBAL\n#else\n#  ifdef DL_GLOBAL\n#    define LT_DLGLOBAL\t\tDL_GLOBAL\n#  else\n#    define LT_DLGLOBAL\t\t0\n#  endif\n#endif\n\n/* We may have to define LT_DLLAZY_OR_NOW in the command line if we\n   find out it does not work in some platform. */\n#ifndef LT_DLLAZY_OR_NOW\n#  ifdef RTLD_LAZY\n#    define LT_DLLAZY_OR_NOW\t\tRTLD_LAZY\n#  else\n#    ifdef DL_LAZY\n#      define LT_DLLAZY_OR_NOW\t\tDL_LAZY\n#    else\n#      ifdef RTLD_NOW\n#        define LT_DLLAZY_OR_NOW\tRTLD_NOW\n#      else\n#        ifdef DL_NOW\n#          define LT_DLLAZY_OR_NOW\tDL_NOW\n#        else\n#          define LT_DLLAZY_OR_NOW\t0\n#        endif\n#      endif\n#    endif\n#  endif\n#endif\n\n#ifdef __cplusplus\nextern \"C\" void exit (int);\n#endif\n\nvoid fnord() { int i=42;}\nint main ()\n{\n  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);\n  int status = $lt_dlunknown;\n\n  if (self)\n    {\n      if (dlsym (self,\"fnord\"))       status = $lt_dlno_uscore;\n      else if (dlsym( self,\"_fnord\")) status = $lt_dlneed_uscore;\n      /* dlclose (self); */\n    }\n\n    exit (status);\n}\nEOF\n  if { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then\n    (./conftest; exit; ) 2>/dev/null\n    lt_status=$?\n    case x$lt_status in\n      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;\n      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;\n      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;\n    esac\n  else :\n    # compilation failed\n    lt_cv_dlopen_self=no\n  fi\nfi\nrm -fr conftest*\n\n\nfi\necho \"$as_me:$LINENO: result: $lt_cv_dlopen_self\" >&5\necho \"${ECHO_T}$lt_cv_dlopen_self\" >&6\n\n    if test \"x$lt_cv_dlopen_self\" = xyes; then\n      LDFLAGS=\"$LDFLAGS $link_static_flag\"\n      echo \"$as_me:$LINENO: checking whether a statically linked program can dlopen itself\" >&5\necho $ECHO_N \"checking whether a statically linked program can dlopen itself... $ECHO_C\" >&6\nif test \"${lt_cv_dlopen_self_static+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  \t  if test \"$cross_compiling\" = yes; then :\n  lt_cv_dlopen_self_static=cross\nelse\n  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2\n  lt_status=$lt_dlunknown\n  cat > conftest.$ac_ext <<EOF\n#line 9986 \"configure\"\n#include \"confdefs.h\"\n\n#if HAVE_DLFCN_H\n#include <dlfcn.h>\n#endif\n\n#include <stdio.h>\n\n#ifdef RTLD_GLOBAL\n#  define LT_DLGLOBAL\t\tRTLD_GLOBAL\n#else\n#  ifdef DL_GLOBAL\n#    define LT_DLGLOBAL\t\tDL_GLOBAL\n#  else\n#    define LT_DLGLOBAL\t\t0\n#  endif\n#endif\n\n/* We may have to define LT_DLLAZY_OR_NOW in the command line if we\n   find out it does not work in some platform. */\n#ifndef LT_DLLAZY_OR_NOW\n#  ifdef RTLD_LAZY\n#    define LT_DLLAZY_OR_NOW\t\tRTLD_LAZY\n#  else\n#    ifdef DL_LAZY\n#      define LT_DLLAZY_OR_NOW\t\tDL_LAZY\n#    else\n#      ifdef RTLD_NOW\n#        define LT_DLLAZY_OR_NOW\tRTLD_NOW\n#      else\n#        ifdef DL_NOW\n#          define LT_DLLAZY_OR_NOW\tDL_NOW\n#        else\n#          define LT_DLLAZY_OR_NOW\t0\n#        endif\n#      endif\n#    endif\n#  endif\n#endif\n\n#ifdef __cplusplus\nextern \"C\" void exit (int);\n#endif\n\nvoid fnord() { int i=42;}\nint main ()\n{\n  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);\n  int status = $lt_dlunknown;\n\n  if (self)\n    {\n      if (dlsym (self,\"fnord\"))       status = $lt_dlno_uscore;\n      else if (dlsym( self,\"_fnord\")) status = $lt_dlneed_uscore;\n      /* dlclose (self); */\n    }\n\n    exit (status);\n}\nEOF\n  if { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then\n    (./conftest; exit; ) 2>/dev/null\n    lt_status=$?\n    case x$lt_status in\n      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;\n      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;\n      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;\n    esac\n  else :\n    # compilation failed\n    lt_cv_dlopen_self_static=no\n  fi\nfi\nrm -fr conftest*\n\n\nfi\necho \"$as_me:$LINENO: result: $lt_cv_dlopen_self_static\" >&5\necho \"${ECHO_T}$lt_cv_dlopen_self_static\" >&6\n    fi\n\n    CPPFLAGS=\"$save_CPPFLAGS\"\n    LDFLAGS=\"$save_LDFLAGS\"\n    LIBS=\"$save_LIBS\"\n    ;;\n  esac\n\n  case $lt_cv_dlopen_self in\n  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;\n  *) enable_dlopen_self=unknown ;;\n  esac\n\n  case $lt_cv_dlopen_self_static in\n  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;\n  *) enable_dlopen_self_static=unknown ;;\n  esac\nfi\n\n\n# Report which librarie types wil actually be built\necho \"$as_me:$LINENO: checking if libtool supports shared libraries\" >&5\necho $ECHO_N \"checking if libtool supports shared libraries... $ECHO_C\" >&6\necho \"$as_me:$LINENO: result: $can_build_shared\" >&5\necho \"${ECHO_T}$can_build_shared\" >&6\n\necho \"$as_me:$LINENO: checking whether to build shared libraries\" >&5\necho $ECHO_N \"checking whether to build shared libraries... $ECHO_C\" >&6\ntest \"$can_build_shared\" = \"no\" && enable_shared=no\n\n# On AIX, shared libraries and static libraries use the same namespace, and\n# are all built from PIC.\ncase \"$host_os\" in\naix3*)\n  test \"$enable_shared\" = yes && enable_static=no\n  if test -n \"$RANLIB\"; then\n    archive_cmds=\"$archive_cmds~\\$RANLIB \\$lib\"\n    postinstall_cmds='$RANLIB $lib'\n  fi\n  ;;\n\naix4* | aix5*)\n  if test \"$host_cpu\" != ia64 && test \"$aix_use_runtimelinking\" = no ; then\n    test \"$enable_shared\" = yes && enable_static=no\n  fi\n  ;;\n  darwin* | rhapsody*)\n  if test \"$GCC\" = yes; then\n    archive_cmds_need_lc=no\n    case \"$host_os\" in\n    rhapsody* | darwin1.[012])\n      allow_undefined_flag='-undefined suppress'\n      ;;\n    *) # Darwin 1.3 on\n      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then\n      \tallow_undefined_flag='-flat_namespace -undefined suppress'\n      else\n        case ${MACOSX_DEPLOYMENT_TARGET} in\n          10.[012])\n            allow_undefined_flag='-flat_namespace -undefined suppress'\n            ;;\n          10.*)\n            allow_undefined_flag='-undefined dynamic_lookup'\n            ;;\n        esac\n      fi\n      ;;\n    esac\n    output_verbose_link_cmd='echo'\n    archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'\n    module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'\n    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's\n    archive_expsym_cmds='sed -e \"s,#.*,,\" -e \"s,^[    ]*,,\" -e \"s,^\\(..*\\),_&,\" < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag  -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'\n    module_expsym_cmds='sed -e \"s,#.*,,\" -e \"s,^[    ]*,,\" -e \"s,^\\(..*\\),_&,\" < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'\n    hardcode_direct=no\n    hardcode_automatic=yes\n    hardcode_shlibpath_var=unsupported\n    whole_archive_flag_spec='-all_load $convenience'\n    link_all_deplibs=yes\n  else\n    ld_shlibs=no\n  fi\n    ;;\nesac\necho \"$as_me:$LINENO: result: $enable_shared\" >&5\necho \"${ECHO_T}$enable_shared\" >&6\n\necho \"$as_me:$LINENO: checking whether to build static libraries\" >&5\necho $ECHO_N \"checking whether to build static libraries... $ECHO_C\" >&6\n# Make sure either enable_shared or enable_static is yes.\ntest \"$enable_shared\" = yes || enable_static=yes\necho \"$as_me:$LINENO: result: $enable_static\" >&5\necho \"${ECHO_T}$enable_static\" >&6\n\n# The else clause should only fire when bootstrapping the\n# libtool distribution, otherwise you forgot to ship ltmain.sh\n# with your package, and you will get complaints that there are\n# no rules to generate ltmain.sh.\nif test -f \"$ltmain\"; then\n  # See if we are running on zsh, and set the options which allow our commands through\n  # without removal of \\ escapes.\n  if test -n \"${ZSH_VERSION+set}\" ; then\n    setopt NO_GLOB_SUBST\n  fi\n  # Now quote all the things that may contain metacharacters while being\n  # careful not to overquote the AC_SUBSTed values.  We take copies of the\n  # variables and quote the copies for generation of the libtool script.\n  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \\\n    SED SHELL STRIP \\\n    libname_spec library_names_spec soname_spec extract_expsyms_cmds \\\n    old_striplib striplib file_magic_cmd finish_cmds finish_eval \\\n    deplibs_check_method reload_flag reload_cmds need_locks \\\n    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \\\n    lt_cv_sys_global_symbol_to_c_name_address \\\n    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \\\n    old_postinstall_cmds old_postuninstall_cmds \\\n    compiler \\\n    CC \\\n    LD \\\n    lt_prog_compiler_wl \\\n    lt_prog_compiler_pic \\\n    lt_prog_compiler_static \\\n    lt_prog_compiler_no_builtin_flag \\\n    export_dynamic_flag_spec \\\n    thread_safe_flag_spec \\\n    whole_archive_flag_spec \\\n    enable_shared_with_static_runtimes \\\n    old_archive_cmds \\\n    old_archive_from_new_cmds \\\n    predep_objects \\\n    postdep_objects \\\n    predeps \\\n    postdeps \\\n    compiler_lib_search_path \\\n    archive_cmds \\\n    archive_expsym_cmds \\\n    postinstall_cmds \\\n    postuninstall_cmds \\\n    old_archive_from_expsyms_cmds \\\n    allow_undefined_flag \\\n    no_undefined_flag \\\n    export_symbols_cmds \\\n    hardcode_libdir_flag_spec \\\n    hardcode_libdir_flag_spec_ld \\\n    hardcode_libdir_separator \\\n    hardcode_automatic \\\n    module_cmds \\\n    module_expsym_cmds \\\n    lt_cv_prog_compiler_c_o \\\n    exclude_expsyms \\\n    include_expsyms; do\n\n    case $var in\n    old_archive_cmds | \\\n    old_archive_from_new_cmds | \\\n    archive_cmds | \\\n    archive_expsym_cmds | \\\n    module_cmds | \\\n    module_expsym_cmds | \\\n    old_archive_from_expsyms_cmds | \\\n    export_symbols_cmds | \\\n    extract_expsyms_cmds | reload_cmds | finish_cmds | \\\n    postinstall_cmds | postuninstall_cmds | \\\n    old_postinstall_cmds | old_postuninstall_cmds | \\\n    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)\n      # Double-quote double-evaled strings.\n      eval \"lt_$var=\\\\\\\"\\`\\$echo \\\"X\\$$var\\\" | \\$Xsed -e \\\"\\$double_quote_subst\\\" -e \\\"\\$sed_quote_subst\\\" -e \\\"\\$delay_variable_subst\\\"\\`\\\\\\\"\"\n      ;;\n    *)\n      eval \"lt_$var=\\\\\\\"\\`\\$echo \\\"X\\$$var\\\" | \\$Xsed -e \\\"\\$sed_quote_subst\\\"\\`\\\\\\\"\"\n      ;;\n    esac\n  done\n\n  case $lt_echo in\n  *'\\$0 --fallback-echo\"')\n    lt_echo=`$echo \"X$lt_echo\" | $Xsed -e 's/\\\\\\\\\\\\\\$0 --fallback-echo\"$/$0 --fallback-echo\"/'`\n    ;;\n  esac\n\ncfgfile=\"${ofile}T\"\n  trap \"$rm \\\"$cfgfile\\\"; exit 1\" 1 2 15\n  $rm -f \"$cfgfile\"\n  { echo \"$as_me:$LINENO: creating $ofile\" >&5\necho \"$as_me: creating $ofile\" >&6;}\n\n  cat <<__EOF__ >> \"$cfgfile\"\n#! $SHELL\n\n# `$echo \"$cfgfile\" | sed 's%^.*/%%'` - Provide generalized library-building support services.\n# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)\n# NOTE: Changes made to this file will be lost: look at ltmain.sh.\n#\n# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001\n# Free Software Foundation, Inc.\n#\n# This file is part of GNU Libtool:\n# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n#\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that program.\n\n# A sed program that does not truncate output.\nSED=$lt_SED\n\n# Sed that helps us avoid accidentally triggering echo(1) options like -n.\nXsed=\"$SED -e s/^X//\"\n\n# The HP-UX ksh and POSIX shell print the target directory to stdout\n# if CDPATH is set.\nif test \"X\\${CDPATH+set}\" = Xset; then CDPATH=:; export CDPATH; fi\n\n# The names of the tagged configurations supported by this script.\navailable_tags=\n\n# ### BEGIN LIBTOOL CONFIG\n\n# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:\n\n# Shell to use when invoking shell scripts.\nSHELL=$lt_SHELL\n\n# Whether or not to build shared libraries.\nbuild_libtool_libs=$enable_shared\n\n# Whether or not to build static libraries.\nbuild_old_libs=$enable_static\n\n# Whether or not to add -lc for building shared libraries.\nbuild_libtool_need_lc=$archive_cmds_need_lc\n\n# Whether or not to disallow shared libs when runtime libs are static\nallow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes\n\n# Whether or not to optimize for fast installation.\nfast_install=$enable_fast_install\n\n# The host system.\nhost_alias=$host_alias\nhost=$host\n\n# An echo program that does not interpret backslashes.\necho=$lt_echo\n\n# The archiver.\nAR=$lt_AR\nAR_FLAGS=$lt_AR_FLAGS\n\n# A C compiler.\nLTCC=$lt_LTCC\n\n# A language-specific compiler.\nCC=$lt_compiler\n\n# Is the compiler the GNU C compiler?\nwith_gcc=$GCC\n\n# An ERE matcher.\nEGREP=$lt_EGREP\n\n# The linker used to build libraries.\nLD=$lt_LD\n\n# Whether we need hard or soft links.\nLN_S=$lt_LN_S\n\n# A BSD-compatible nm program.\nNM=$lt_NM\n\n# A symbol stripping program\nSTRIP=$lt_STRIP\n\n# Used to examine libraries when file_magic_cmd begins \"file\"\nMAGIC_CMD=$MAGIC_CMD\n\n# Used on cygwin: DLL creation program.\nDLLTOOL=\"$DLLTOOL\"\n\n# Used on cygwin: object dumper.\nOBJDUMP=\"$OBJDUMP\"\n\n# Used on cygwin: assembler.\nAS=\"$AS\"\n\n# The name of the directory that contains temporary libtool files.\nobjdir=$objdir\n\n# How to create reloadable object files.\nreload_flag=$lt_reload_flag\nreload_cmds=$lt_reload_cmds\n\n# How to pass a linker flag through the compiler.\nwl=$lt_lt_prog_compiler_wl\n\n# Object file suffix (normally \"o\").\nobjext=\"$ac_objext\"\n\n# Old archive suffix (normally \"a\").\nlibext=\"$libext\"\n\n# Shared library suffix (normally \".so\").\nshrext_cmds='$shrext_cmds'\n\n# Executable file suffix (normally \"\").\nexeext=\"$exeext\"\n\n# Additional compiler flags for building library objects.\npic_flag=$lt_lt_prog_compiler_pic\npic_mode=$pic_mode\n\n# What is the maximum length of a command?\nmax_cmd_len=$lt_cv_sys_max_cmd_len\n\n# Does compiler simultaneously support -c and -o options?\ncompiler_c_o=$lt_lt_cv_prog_compiler_c_o\n\n# Must we lock files when doing compilation ?\nneed_locks=$lt_need_locks\n\n# Do we need the lib prefix for modules?\nneed_lib_prefix=$need_lib_prefix\n\n# Do we need a version for libraries?\nneed_version=$need_version\n\n# Whether dlopen is supported.\ndlopen_support=$enable_dlopen\n\n# Whether dlopen of programs is supported.\ndlopen_self=$enable_dlopen_self\n\n# Whether dlopen of statically linked programs is supported.\ndlopen_self_static=$enable_dlopen_self_static\n\n# Compiler flag to prevent dynamic linking.\nlink_static_flag=$lt_lt_prog_compiler_static\n\n# Compiler flag to turn off builtin functions.\nno_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag\n\n# Compiler flag to allow reflexive dlopens.\nexport_dynamic_flag_spec=$lt_export_dynamic_flag_spec\n\n# Compiler flag to generate shared objects directly from archives.\nwhole_archive_flag_spec=$lt_whole_archive_flag_spec\n\n# Compiler flag to generate thread-safe objects.\nthread_safe_flag_spec=$lt_thread_safe_flag_spec\n\n# Library versioning type.\nversion_type=$version_type\n\n# Format of library name prefix.\nlibname_spec=$lt_libname_spec\n\n# List of archive names.  First name is the real one, the rest are links.\n# The last name is the one that the linker finds with -lNAME.\nlibrary_names_spec=$lt_library_names_spec\n\n# The coded name of the library, if different from the real name.\nsoname_spec=$lt_soname_spec\n\n# Commands used to build and install an old-style archive.\nRANLIB=$lt_RANLIB\nold_archive_cmds=$lt_old_archive_cmds\nold_postinstall_cmds=$lt_old_postinstall_cmds\nold_postuninstall_cmds=$lt_old_postuninstall_cmds\n\n# Create an old-style archive from a shared archive.\nold_archive_from_new_cmds=$lt_old_archive_from_new_cmds\n\n# Create a temporary old-style archive to link instead of a shared archive.\nold_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds\n\n# Commands used to build and install a shared archive.\narchive_cmds=$lt_archive_cmds\narchive_expsym_cmds=$lt_archive_expsym_cmds\npostinstall_cmds=$lt_postinstall_cmds\npostuninstall_cmds=$lt_postuninstall_cmds\n\n# Commands used to build a loadable module (assumed same as above if empty)\nmodule_cmds=$lt_module_cmds\nmodule_expsym_cmds=$lt_module_expsym_cmds\n\n# Commands to strip libraries.\nold_striplib=$lt_old_striplib\nstriplib=$lt_striplib\n\n# Dependencies to place before the objects being linked to create a\n# shared library.\npredep_objects=$lt_predep_objects\n\n# Dependencies to place after the objects being linked to create a\n# shared library.\npostdep_objects=$lt_postdep_objects\n\n# Dependencies to place before the objects being linked to create a\n# shared library.\npredeps=$lt_predeps\n\n# Dependencies to place after the objects being linked to create a\n# shared library.\npostdeps=$lt_postdeps\n\n# The library search path used internally by the compiler when linking\n# a shared library.\ncompiler_lib_search_path=$lt_compiler_lib_search_path\n\n# Method to check whether dependent libraries are shared objects.\ndeplibs_check_method=$lt_deplibs_check_method\n\n# Command to use when deplibs_check_method == file_magic.\nfile_magic_cmd=$lt_file_magic_cmd\n\n# Flag that allows shared libraries with undefined symbols to be built.\nallow_undefined_flag=$lt_allow_undefined_flag\n\n# Flag that forces no undefined symbols.\nno_undefined_flag=$lt_no_undefined_flag\n\n# Commands used to finish a libtool library installation in a directory.\nfinish_cmds=$lt_finish_cmds\n\n# Same as above, but a single script fragment to be evaled but not shown.\nfinish_eval=$lt_finish_eval\n\n# Take the output of nm and produce a listing of raw symbols and C names.\nglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe\n\n# Transform the output of nm in a proper C declaration\nglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl\n\n# Transform the output of nm in a C name address pair\nglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address\n\n# This is the shared library runtime path variable.\nrunpath_var=$runpath_var\n\n# This is the shared library path variable.\nshlibpath_var=$shlibpath_var\n\n# Is shlibpath searched before the hard-coded library search path?\nshlibpath_overrides_runpath=$shlibpath_overrides_runpath\n\n# How to hardcode a shared library path into an executable.\nhardcode_action=$hardcode_action\n\n# Whether we should hardcode library paths into libraries.\nhardcode_into_libs=$hardcode_into_libs\n\n# Flag to hardcode \\$libdir into a binary during linking.\n# This must work even if \\$libdir does not exist.\nhardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec\n\n# If ld is used when linking, flag to hardcode \\$libdir into\n# a binary during linking. This must work even if \\$libdir does\n# not exist.\nhardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld\n\n# Whether we need a single -rpath flag with a separated argument.\nhardcode_libdir_separator=$lt_hardcode_libdir_separator\n\n# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the\n# resulting binary.\nhardcode_direct=$hardcode_direct\n\n# Set to yes if using the -LDIR flag during linking hardcodes DIR into the\n# resulting binary.\nhardcode_minus_L=$hardcode_minus_L\n\n# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into\n# the resulting binary.\nhardcode_shlibpath_var=$hardcode_shlibpath_var\n\n# Set to yes if building a shared library automatically hardcodes DIR into the library\n# and all subsequent libraries and executables linked against it.\nhardcode_automatic=$hardcode_automatic\n\n# Variables whose values should be saved in libtool wrapper scripts and\n# restored at relink time.\nvariables_saved_for_relink=\"$variables_saved_for_relink\"\n\n# Whether libtool must link a program against all its dependency libraries.\nlink_all_deplibs=$link_all_deplibs\n\n# Compile-time system search path for libraries\nsys_lib_search_path_spec=$lt_sys_lib_search_path_spec\n\n# Run-time system search path for libraries\nsys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec\n\n# Fix the shell variable \\$srcfile for the compiler.\nfix_srcfile_path=\"$fix_srcfile_path\"\n\n# Set to yes if exported symbols are required.\nalways_export_symbols=$always_export_symbols\n\n# The commands to list exported symbols.\nexport_symbols_cmds=$lt_export_symbols_cmds\n\n# The commands to extract the exported symbol list from a shared archive.\nextract_expsyms_cmds=$lt_extract_expsyms_cmds\n\n# Symbols that should not be listed in the preloaded symbols.\nexclude_expsyms=$lt_exclude_expsyms\n\n# Symbols that must always be exported.\ninclude_expsyms=$lt_include_expsyms\n\n# ### END LIBTOOL CONFIG\n\n__EOF__\n\n\n  case $host_os in\n  aix3*)\n    cat <<\\EOF >> \"$cfgfile\"\n\n# AIX sometimes has problems with the GCC collect2 program.  For some\n# reason, if we set the COLLECT_NAMES environment variable, the problems\n# vanish in a puff of smoke.\nif test \"X${COLLECT_NAMES+set}\" != Xset; then\n  COLLECT_NAMES=\n  export COLLECT_NAMES\nfi\nEOF\n    ;;\n  esac\n\n  # We use sed instead of cat because bash on DJGPP gets confused if\n  # if finds mixed CR/LF and LF-only lines.  Since sed operates in\n  # text mode, it properly converts lines to CR/LF.  This bash problem\n  # is reportedly fixed, but why not run on old versions too?\n  sed '$q' \"$ltmain\" >> \"$cfgfile\" || (rm -f \"$cfgfile\"; exit 1)\n\n  mv -f \"$cfgfile\" \"$ofile\" || \\\n    (rm -f \"$ofile\" && cp \"$cfgfile\" \"$ofile\" && rm -f \"$cfgfile\")\n  chmod +x \"$ofile\"\n\nelse\n  # If there is no Makefile yet, we rely on a make rule to execute\n  # `config.status --recheck' to rerun these tests and create the\n  # libtool script then.\n  ltmain_in=`echo $ltmain | sed -e 's/\\.sh$/.in/'`\n  if test -f \"$ltmain_in\"; then\n    test -f Makefile && make \"$ltmain\"\n  fi\nfi\n\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\nCC=\"$lt_save_CC\"\n\n\n# Check whether --with-tags or --without-tags was given.\nif test \"${with_tags+set}\" = set; then\n  withval=\"$with_tags\"\n  tagnames=\"$withval\"\nfi;\n\nif test -f \"$ltmain\" && test -n \"$tagnames\"; then\n  if test ! -f \"${ofile}\"; then\n    { echo \"$as_me:$LINENO: WARNING: output file \\`$ofile' does not exist\" >&5\necho \"$as_me: WARNING: output file \\`$ofile' does not exist\" >&2;}\n  fi\n\n  if test -z \"$LTCC\"; then\n    eval \"`$SHELL ${ofile} --config | grep '^LTCC='`\"\n    if test -z \"$LTCC\"; then\n      { echo \"$as_me:$LINENO: WARNING: output file \\`$ofile' does not look like a libtool script\" >&5\necho \"$as_me: WARNING: output file \\`$ofile' does not look like a libtool script\" >&2;}\n    else\n      { echo \"$as_me:$LINENO: WARNING: using \\`LTCC=$LTCC', extracted from \\`$ofile'\" >&5\necho \"$as_me: WARNING: using \\`LTCC=$LTCC', extracted from \\`$ofile'\" >&2;}\n    fi\n  fi\n\n  # Extract list of available tagged configurations in $ofile.\n  # Note that this assumes the entire list is on one line.\n  available_tags=`grep \"^available_tags=\" \"${ofile}\" | $SED -e 's/available_tags=\\(.*$\\)/\\1/' -e 's/\\\"//g'`\n\n  lt_save_ifs=\"$IFS\"; IFS=\"${IFS}$PATH_SEPARATOR,\"\n  for tagname in $tagnames; do\n    IFS=\"$lt_save_ifs\"\n    # Check whether tagname contains only valid characters\n    case `$echo \"X$tagname\" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in\n    \"\") ;;\n    *)  { { echo \"$as_me:$LINENO: error: invalid tag name: $tagname\" >&5\necho \"$as_me: error: invalid tag name: $tagname\" >&2;}\n   { (exit 1); exit 1; }; }\n\t;;\n    esac\n\n    if grep \"^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$\" < \"${ofile}\" > /dev/null\n    then\n      { { echo \"$as_me:$LINENO: error: tag name \\\"$tagname\\\" already exists\" >&5\necho \"$as_me: error: tag name \\\"$tagname\\\" already exists\" >&2;}\n   { (exit 1); exit 1; }; }\n    fi\n\n    # Update the list of available tags.\n    if test -n \"$tagname\"; then\n      echo appending configuration tag \\\"$tagname\\\" to $ofile\n\n      case $tagname in\n      CXX)\n\tif test -n \"$CXX\" && test \"X$CXX\" != \"Xno\"; then\n\t  ac_ext=cc\nac_cpp='$CXXCPP $CPPFLAGS'\nac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_cxx_compiler_gnu\n\n\n\n\narchive_cmds_need_lc_CXX=no\nallow_undefined_flag_CXX=\nalways_export_symbols_CXX=no\narchive_expsym_cmds_CXX=\nexport_dynamic_flag_spec_CXX=\nhardcode_direct_CXX=no\nhardcode_libdir_flag_spec_CXX=\nhardcode_libdir_flag_spec_ld_CXX=\nhardcode_libdir_separator_CXX=\nhardcode_minus_L_CXX=no\nhardcode_automatic_CXX=no\nmodule_cmds_CXX=\nmodule_expsym_cmds_CXX=\nlink_all_deplibs_CXX=unknown\nold_archive_cmds_CXX=$old_archive_cmds\nno_undefined_flag_CXX=\nwhole_archive_flag_spec_CXX=\nenable_shared_with_static_runtimes_CXX=no\n\n# Dependencies to place before and after the object being linked:\npredep_objects_CXX=\npostdep_objects_CXX=\npredeps_CXX=\npostdeps_CXX=\ncompiler_lib_search_path_CXX=\n\n# Source file extension for C++ test sources.\nac_ext=cc\n\n# Object file extension for compiled C++ test sources.\nobjext=o\nobjext_CXX=$objext\n\n# Code to be used in simple compile tests\nlt_simple_compile_test_code=\"int some_variable = 0;\\n\"\n\n# Code to be used in simple link tests\nlt_simple_link_test_code='int main(int, char *) { return(0); }\\n'\n\n# ltmain only uses $CC for tagged configurations so make sure $CC is set.\n\n# If no C compiler was specified, use CC.\nLTCC=${LTCC-\"$CC\"}\n\n# Allow CC to be a program name with arguments.\ncompiler=$CC\n\n\n# Allow CC to be a program name with arguments.\nlt_save_CC=$CC\nlt_save_LD=$LD\nlt_save_GCC=$GCC\nGCC=$GXX\nlt_save_with_gnu_ld=$with_gnu_ld\nlt_save_path_LD=$lt_cv_path_LD\nif test -n \"${lt_cv_prog_gnu_ldcxx+set}\"; then\n  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx\nelse\n  unset lt_cv_prog_gnu_ld\nfi\nif test -n \"${lt_cv_path_LDCXX+set}\"; then\n  lt_cv_path_LD=$lt_cv_path_LDCXX\nelse\n  unset lt_cv_path_LD\nfi\ntest -z \"${LDCXX+set}\" || LD=$LDCXX\nCC=${CXX-\"c++\"}\ncompiler=$CC\ncompiler_CXX=$CC\ncc_basename=`$echo X\"$compiler\" | $Xsed -e 's%^.*/%%'`\n\n# We don't want -fno-exception wen compiling C++ code, so set the\n# no_builtin_flag separately\nif test \"$GXX\" = yes; then\n  lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'\nelse\n  lt_prog_compiler_no_builtin_flag_CXX=\nfi\n\nif test \"$GXX\" = yes; then\n  # Set up default GNU C++ configuration\n\n\n# Check whether --with-gnu-ld or --without-gnu-ld was given.\nif test \"${with_gnu_ld+set}\" = set; then\n  withval=\"$with_gnu_ld\"\n  test \"$withval\" = no || with_gnu_ld=yes\nelse\n  with_gnu_ld=no\nfi;\nac_prog=ld\nif test \"$GCC\" = yes; then\n  # Check if gcc -print-prog-name=ld gives a path.\n  echo \"$as_me:$LINENO: checking for ld used by $CC\" >&5\necho $ECHO_N \"checking for ld used by $CC... $ECHO_C\" >&6\n  case $host in\n  *-*-mingw*)\n    # gcc leaves a trailing carriage return which upsets mingw\n    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\\015'` ;;\n  *)\n    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;\n  esac\n  case $ac_prog in\n    # Accept absolute paths.\n    [\\\\/]* | ?:[\\\\/]*)\n      re_direlt='/[^/][^/]*/\\.\\./'\n      # Canonicalize the pathname of ld\n      ac_prog=`echo $ac_prog| $SED 's%\\\\\\\\%/%g'`\n      while echo $ac_prog | grep \"$re_direlt\" > /dev/null 2>&1; do\n\tac_prog=`echo $ac_prog| $SED \"s%$re_direlt%/%\"`\n      done\n      test -z \"$LD\" && LD=\"$ac_prog\"\n      ;;\n  \"\")\n    # If it fails, then pretend we aren't using GCC.\n    ac_prog=ld\n    ;;\n  *)\n    # If it is relative, then search for the first ld in PATH.\n    with_gnu_ld=unknown\n    ;;\n  esac\nelif test \"$with_gnu_ld\" = yes; then\n  echo \"$as_me:$LINENO: checking for GNU ld\" >&5\necho $ECHO_N \"checking for GNU ld... $ECHO_C\" >&6\nelse\n  echo \"$as_me:$LINENO: checking for non-GNU ld\" >&5\necho $ECHO_N \"checking for non-GNU ld... $ECHO_C\" >&6\nfi\nif test \"${lt_cv_path_LD+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -z \"$LD\"; then\n  lt_save_ifs=\"$IFS\"; IFS=$PATH_SEPARATOR\n  for ac_dir in $PATH; do\n    IFS=\"$lt_save_ifs\"\n    test -z \"$ac_dir\" && ac_dir=.\n    if test -f \"$ac_dir/$ac_prog\" || test -f \"$ac_dir/$ac_prog$ac_exeext\"; then\n      lt_cv_path_LD=\"$ac_dir/$ac_prog\"\n      # Check to see if the program is GNU ld.  I'd rather use --version,\n      # but apparently some GNU ld's only accept -v.\n      # Break only if it was the GNU/non-GNU ld that we prefer.\n      case `\"$lt_cv_path_LD\" -v 2>&1 </dev/null` in\n      *GNU* | *'with BFD'*)\n\ttest \"$with_gnu_ld\" != no && break\n\t;;\n      *)\n\ttest \"$with_gnu_ld\" != yes && break\n\t;;\n      esac\n    fi\n  done\n  IFS=\"$lt_save_ifs\"\nelse\n  lt_cv_path_LD=\"$LD\" # Let the user override the test with a path.\nfi\nfi\n\nLD=\"$lt_cv_path_LD\"\nif test -n \"$LD\"; then\n  echo \"$as_me:$LINENO: result: $LD\" >&5\necho \"${ECHO_T}$LD\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\ntest -z \"$LD\" && { { echo \"$as_me:$LINENO: error: no acceptable ld found in \\$PATH\" >&5\necho \"$as_me: error: no acceptable ld found in \\$PATH\" >&2;}\n   { (exit 1); exit 1; }; }\necho \"$as_me:$LINENO: checking if the linker ($LD) is GNU ld\" >&5\necho $ECHO_N \"checking if the linker ($LD) is GNU ld... $ECHO_C\" >&6\nif test \"${lt_cv_prog_gnu_ld+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  # I'd rather use --version here, but apparently some GNU ld's only accept -v.\ncase `$LD -v 2>&1 </dev/null` in\n*GNU* | *'with BFD'*)\n  lt_cv_prog_gnu_ld=yes\n  ;;\n*)\n  lt_cv_prog_gnu_ld=no\n  ;;\nesac\nfi\necho \"$as_me:$LINENO: result: $lt_cv_prog_gnu_ld\" >&5\necho \"${ECHO_T}$lt_cv_prog_gnu_ld\" >&6\nwith_gnu_ld=$lt_cv_prog_gnu_ld\n\n\n\n  # Check if GNU C++ uses GNU ld as the underlying linker, since the\n  # archiving commands below assume that GNU ld is being used.\n  if test \"$with_gnu_ld\" = yes; then\n    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'\n    archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'\n\n    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'\n    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'\n\n    # If archive_cmds runs LD, not CC, wlarc should be empty\n    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to\n    #     investigate it a little bit more. (MM)\n    wlarc='${wl}'\n\n    # ancient GNU ld didn't support --whole-archive et. al.\n    if eval \"`$CC -print-prog-name=ld` --help 2>&1\" | \\\n\tgrep 'no-whole-archive' > /dev/null; then\n      whole_archive_flag_spec_CXX=\"$wlarc\"'--whole-archive$convenience '\"$wlarc\"'--no-whole-archive'\n    else\n      whole_archive_flag_spec_CXX=\n    fi\n  else\n    with_gnu_ld=no\n    wlarc=\n\n    # A generic and very simple default shared library creation\n    # command for GNU C++ for the case where it uses the native\n    # linker, instead of GNU ld.  If possible, this setting should\n    # overridden to take advantage of the native linker features on\n    # the platform it is being used on.\n    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'\n  fi\n\n  # Commands to make compiler produce verbose output that lists\n  # what \"hidden\" libraries, object files and flags are used when\n  # linking a shared library.\n  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\\-L\"'\n\nelse\n  GXX=no\n  with_gnu_ld=no\n  wlarc=\nfi\n\n# PORTME: fill in a description of your system's C++ link characteristics\necho \"$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries\" >&5\necho $ECHO_N \"checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C\" >&6\nld_shlibs_CXX=yes\ncase $host_os in\n  aix3*)\n    # FIXME: insert proper C++ library support\n    ld_shlibs_CXX=no\n    ;;\n  aix4* | aix5*)\n    if test \"$host_cpu\" = ia64; then\n      # On IA64, the linker does run time linking by default, so we don't\n      # have to do anything special.\n      aix_use_runtimelinking=no\n      exp_sym_flag='-Bexport'\n      no_entry_flag=\"\"\n    else\n      aix_use_runtimelinking=no\n\n      # Test if we are trying to use run time linking or normal\n      # AIX style linking. If -brtl is somewhere in LDFLAGS, we\n      # need to do runtime linking.\n      case $host_os in aix4.[23]|aix4.[23].*|aix5*)\n\tfor ld_flag in $LDFLAGS; do\n\t  case $ld_flag in\n\t  *-brtl*)\n\t    aix_use_runtimelinking=yes\n\t    break\n\t    ;;\n\t  esac\n\tdone\n      esac\n\n      exp_sym_flag='-bexport'\n      no_entry_flag='-bnoentry'\n    fi\n\n    # When large executables or shared objects are built, AIX ld can\n    # have problems creating the table of contents.  If linking a library\n    # or program results in \"error TOC overflow\" add -mminimal-toc to\n    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not\n    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.\n\n    archive_cmds_CXX=''\n    hardcode_direct_CXX=yes\n    hardcode_libdir_separator_CXX=':'\n    link_all_deplibs_CXX=yes\n\n    if test \"$GXX\" = yes; then\n      case $host_os in aix4.012|aix4.012.*)\n      # We only want to do this on AIX 4.2 and lower, the check\n      # below for broken collect2 doesn't work under 4.3+\n\tcollect2name=`${CC} -print-prog-name=collect2`\n\tif test -f \"$collect2name\" && \\\n\t   strings \"$collect2name\" | grep resolve_lib_name >/dev/null\n\tthen\n\t  # We have reworked collect2\n\t  hardcode_direct_CXX=yes\n\telse\n\t  # We have old collect2\n\t  hardcode_direct_CXX=unsupported\n\t  # It fails to find uninstalled libraries when the uninstalled\n\t  # path is not listed in the libpath.  Setting hardcode_minus_L\n\t  # to unsupported forces relinking\n\t  hardcode_minus_L_CXX=yes\n\t  hardcode_libdir_flag_spec_CXX='-L$libdir'\n\t  hardcode_libdir_separator_CXX=\n\tfi\n      esac\n      shared_flag='-shared'\n    else\n      # not using gcc\n      if test \"$host_cpu\" = ia64; then\n\t# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release\n\t# chokes on -Wl,-G. The following line is correct:\n\tshared_flag='-G'\n      else\n\tif test \"$aix_use_runtimelinking\" = yes; then\n\t  shared_flag='${wl}-G'\n\telse\n\t  shared_flag='${wl}-bM:SRE'\n\tfi\n      fi\n    fi\n\n    # It seems that -bexpall does not export symbols beginning with\n    # underscore (_), so it is better to generate a list of symbols to export.\n    always_export_symbols_CXX=yes\n    if test \"$aix_use_runtimelinking\" = yes; then\n      # Warning - without using the other runtime loading flags (-brtl),\n      # -berok will link without error, but may produce a broken library.\n      allow_undefined_flag_CXX='-berok'\n      # Determine the default libpath from the value encoded in an empty executable.\n      cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_cxx_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n\naix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\\(.*\\)$/\\1/; p; }\n}'`\n# Check for a 64-bit object if we didn't find anything.\nif test -z \"$aix_libpath\"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\\(.*\\)$/\\1/; p; }\n}'`; fi\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nif test -z \"$aix_libpath\"; then aix_libpath=\"/usr/lib:/lib\"; fi\n\n      hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'\"$aix_libpath\"\n\n      archive_expsym_cmds_CXX=\"\\$CC\"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test \"x${allow_undefined_flag}\" != \"x\"; then echo \"${wl}${allow_undefined_flag}\"; else :; fi` '\"\\${wl}$no_entry_flag \\${wl}$exp_sym_flag:\\$export_symbols $shared_flag\"\n     else\n      if test \"$host_cpu\" = ia64; then\n\thardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'\n\tallow_undefined_flag_CXX=\"-z nodefs\"\n\tarchive_expsym_cmds_CXX=\"\\$CC $shared_flag\"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '\"\\${wl}$no_entry_flag \\${wl}$exp_sym_flag:\\$export_symbols\"\n      else\n\t# Determine the default libpath from the value encoded in an empty executable.\n\tcat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_cxx_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n\naix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\\(.*\\)$/\\1/; p; }\n}'`\n# Check for a 64-bit object if we didn't find anything.\nif test -z \"$aix_libpath\"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\\(.*\\)$/\\1/; p; }\n}'`; fi\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nif test -z \"$aix_libpath\"; then aix_libpath=\"/usr/lib:/lib\"; fi\n\n\thardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'\"$aix_libpath\"\n\t# Warning - without using the other run time loading flags,\n\t# -berok will link without error, but may produce a broken library.\n\tno_undefined_flag_CXX=' ${wl}-bernotok'\n\tallow_undefined_flag_CXX=' ${wl}-berok'\n\t# -bexpall does not export symbols beginning with underscore (_)\n\talways_export_symbols_CXX=yes\n\t# Exported symbols can be pulled into shared objects from archives\n\twhole_archive_flag_spec_CXX=' '\n\tarchive_cmds_need_lc_CXX=yes\n\t# This is similar to how AIX traditionally builds it's shared libraries.\n\tarchive_expsym_cmds_CXX=\"\\$CC $shared_flag\"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'\n      fi\n    fi\n    ;;\n  chorus*)\n    case $cc_basename in\n      *)\n\t# FIXME: insert proper C++ library support\n\tld_shlibs_CXX=no\n\t;;\n    esac\n    ;;\n\n  cygwin* | mingw* | pw32*)\n    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,\n    # as there is no search path for DLLs.\n    hardcode_libdir_flag_spec_CXX='-L$libdir'\n    allow_undefined_flag_CXX=unsupported\n    always_export_symbols_CXX=no\n    enable_shared_with_static_runtimes_CXX=yes\n\n    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then\n      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'\n      # If the export-symbols file already is a .def file (1st line\n      # is EXPORTS), use it as is; otherwise, prepend...\n      archive_expsym_cmds_CXX='if test \"x`$SED 1q $export_symbols`\" = xEXPORTS; then\n\tcp $export_symbols $output_objdir/$soname.def;\n      else\n\techo EXPORTS > $output_objdir/$soname.def;\n\tcat $export_symbols >> $output_objdir/$soname.def;\n      fi~\n      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'\n    else\n      ld_shlibs_CXX=no\n    fi\n  ;;\n\n  darwin* | rhapsody*)\n  if test \"$GXX\" = yes; then\n    archive_cmds_need_lc_CXX=no\n    case \"$host_os\" in\n    rhapsody* | darwin1.[012])\n      allow_undefined_flag_CXX='-undefined suppress'\n      ;;\n    *) # Darwin 1.3 on\n      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then\n      \tallow_undefined_flag_CXX='-flat_namespace -undefined suppress'\n      else\n        case ${MACOSX_DEPLOYMENT_TARGET} in\n          10.[012])\n            allow_undefined_flag_CXX='-flat_namespace -undefined suppress'\n            ;;\n          10.*)\n            allow_undefined_flag_CXX='-undefined dynamic_lookup'\n            ;;\n        esac\n      fi\n      ;;\n    esac\n    lt_int_apple_cc_single_mod=no\n    output_verbose_link_cmd='echo'\n    if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then\n      lt_int_apple_cc_single_mod=yes\n    fi\n    if test \"X$lt_int_apple_cc_single_mod\" = Xyes ; then\n      archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'\n    else\n      archive_cmds_CXX='$CC -r ${wl}-bind_at_load -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'\n    fi\n    module_cmds_CXX='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'\n\n    # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's\n    if test \"X$lt_int_apple_cc_single_mod\" = Xyes ; then\n      archive_expsym_cmds_CXX='sed -e \"s,#.*,,\" -e \"s,^[    ]*,,\" -e \"s,^\\(..*\\),_&,\" < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'\n    else\n      archive_expsym_cmds_CXX='sed -e \"s,#.*,,\" -e \"s,^[    ]*,,\" -e \"s,^\\(..*\\),_&,\" < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'\n    fi\n    module_expsym_cmds_CXX='sed -e \"s,#.*,,\" -e \"s,^[    ]*,,\" -e \"s,^\\(..*\\),_&,\" < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'\n    hardcode_direct_CXX=no\n    hardcode_automatic_CXX=yes\n    hardcode_shlibpath_var_CXX=unsupported\n    whole_archive_flag_spec_CXX='-all_load $convenience'\n    link_all_deplibs_CXX=yes\n  else\n    ld_shlibs_CXX=no\n  fi\n    ;;\n\n  dgux*)\n    case $cc_basename in\n      ec++)\n\t# FIXME: insert proper C++ library support\n\tld_shlibs_CXX=no\n\t;;\n      ghcx)\n\t# Green Hills C++ Compiler\n\t# FIXME: insert proper C++ library support\n\tld_shlibs_CXX=no\n\t;;\n      *)\n\t# FIXME: insert proper C++ library support\n\tld_shlibs_CXX=no\n\t;;\n    esac\n    ;;\n  freebsd12*)\n    # C++ shared libraries reported to be fairly broken before switch to ELF\n    ld_shlibs_CXX=no\n    ;;\n  freebsd-elf*)\n    archive_cmds_need_lc_CXX=no\n    ;;\n  freebsd* | kfreebsd*-gnu)\n    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF\n    # conventions\n    ld_shlibs_CXX=yes\n    ;;\n  gnu*)\n    ;;\n  hpux9*)\n    hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'\n    hardcode_libdir_separator_CXX=:\n    export_dynamic_flag_spec_CXX='${wl}-E'\n    hardcode_direct_CXX=yes\n    hardcode_minus_L_CXX=yes # Not in the search PATH,\n\t\t\t\t# but as the default\n\t\t\t\t# location of the library.\n\n    case $cc_basename in\n    CC)\n      # FIXME: insert proper C++ library support\n      ld_shlibs_CXX=no\n      ;;\n    aCC)\n      archive_cmds_CXX='$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'\n      # Commands to make compiler produce verbose output that lists\n      # what \"hidden\" libraries, object files and flags are used when\n      # linking a shared library.\n      #\n      # There doesn't appear to be a way to prevent this compiler from\n      # explicitly linking system object files so we need to strip them\n      # from the output so that they don't get included in the library\n      # dependencies.\n      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; echo $list'\n      ;;\n    *)\n      if test \"$GXX\" = yes; then\n        archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${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'\n      else\n        # FIXME: insert proper C++ library support\n        ld_shlibs_CXX=no\n      fi\n      ;;\n    esac\n    ;;\n  hpux10*|hpux11*)\n    if test $with_gnu_ld = no; then\n      case \"$host_cpu\" in\n      hppa*64*)\n\thardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'\n\thardcode_libdir_flag_spec_ld_CXX='+b $libdir'\n\thardcode_libdir_separator_CXX=:\n        ;;\n      ia64*)\n\thardcode_libdir_flag_spec_CXX='-L$libdir'\n        ;;\n      *)\n\thardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'\n\thardcode_libdir_separator_CXX=:\n\texport_dynamic_flag_spec_CXX='${wl}-E'\n        ;;\n      esac\n    fi\n    case \"$host_cpu\" in\n    hppa*64*)\n      hardcode_direct_CXX=no\n      hardcode_shlibpath_var_CXX=no\n      ;;\n    ia64*)\n      hardcode_direct_CXX=no\n      hardcode_shlibpath_var_CXX=no\n      hardcode_minus_L_CXX=yes # Not in the search PATH,\n\t\t\t\t\t      # but as the default\n\t\t\t\t\t      # location of the library.\n      ;;\n    *)\n      hardcode_direct_CXX=yes\n      hardcode_minus_L_CXX=yes # Not in the search PATH,\n\t\t\t\t\t      # but as the default\n\t\t\t\t\t      # location of the library.\n      ;;\n    esac\n\n    case $cc_basename in\n      CC)\n\t# FIXME: insert proper C++ library support\n\tld_shlibs_CXX=no\n\t;;\n      aCC)\n\tcase \"$host_cpu\" in\n\thppa*64*|ia64*)\n\t  archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'\n\t  ;;\n\t*)\n\t  archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'\n\t  ;;\n\tesac\n\t# Commands to make compiler produce verbose output that lists\n\t# what \"hidden\" libraries, object files and flags are used when\n\t# linking a shared library.\n\t#\n\t# There doesn't appear to be a way to prevent this compiler from\n\t# explicitly linking system object files so we need to strip them\n\t# from the output so that they don't get included in the library\n\t# dependencies.\n\toutput_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; echo $list'\n\t;;\n      *)\n\tif test \"$GXX\" = yes; then\n\t  if test $with_gnu_ld = no; then\n\t    case \"$host_cpu\" in\n\t    ia64*|hppa*64*)\n\t      archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'\n\t      ;;\n\t    *)\n\t      archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'\n\t      ;;\n\t    esac\n\t  fi\n\telse\n\t  # FIXME: insert proper C++ library support\n\t  ld_shlibs_CXX=no\n\tfi\n\t;;\n    esac\n    ;;\n  irix5* | irix6*)\n    case $cc_basename in\n      CC)\n\t# SGI C++\n\tarchive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n \"$verstring\" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'\n\n\t# Archives containing C++ object files must be created using\n\t# \"CC -ar\", where \"CC\" is the IRIX C++ compiler.  This is\n\t# necessary to make sure instantiated templates are included\n\t# in the archive.\n\told_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'\n\t;;\n      *)\n\tif test \"$GXX\" = yes; then\n\t  if test \"$with_gnu_ld\" = no; then\n\t    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n \"$verstring\" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'\n\t  else\n\t    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n \"$verstring\" && echo ${wl}-set_version ${wl}$verstring` -o $lib'\n\t  fi\n\tfi\n\tlink_all_deplibs_CXX=yes\n\t;;\n    esac\n    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'\n    hardcode_libdir_separator_CXX=:\n    ;;\n  linux*)\n    case $cc_basename in\n      KCC)\n\t# Kuck and Associates, Inc. (KAI) C++ Compiler\n\n\t# KCC will only create a shared library if the output file\n\t# ends with \".so\" (or \".sl\" for HP-UX), so rename the library\n\t# to its proper name (with version) after linking.\n\tarchive_cmds_CXX='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'\n\tarchive_expsym_cmds_CXX='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'\n\t# Commands to make compiler produce verbose output that lists\n\t# what \"hidden\" libraries, object files and flags are used when\n\t# linking a shared library.\n\t#\n\t# There doesn't appear to be a way to prevent this compiler from\n\t# explicitly linking system object files so we need to strip them\n\t# from the output so that they don't get included in the library\n\t# dependencies.\n\toutput_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; echo $list'\n\n\thardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'\n\texport_dynamic_flag_spec_CXX='${wl}--export-dynamic'\n\n\t# Archives containing C++ object files must be created using\n\t# \"CC -Bstatic\", where \"CC\" is the KAI C++ compiler.\n\told_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'\n\t;;\n      icpc)\n\t# Intel C++\n\twith_gnu_ld=yes\n\tarchive_cmds_need_lc_CXX=no\n\tarchive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'\n\tarchive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'\n\thardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'\n\texport_dynamic_flag_spec_CXX='${wl}--export-dynamic'\n\twhole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'\n\t;;\n      cxx)\n\t# Compaq C++\n\tarchive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'\n\tarchive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'\n\n\trunpath_var=LD_RUN_PATH\n\thardcode_libdir_flag_spec_CXX='-rpath $libdir'\n\thardcode_libdir_separator_CXX=:\n\n\t# Commands to make compiler produce verbose output that lists\n\t# what \"hidden\" libraries, object files and flags are used when\n\t# linking a shared library.\n\t#\n\t# There doesn't appear to be a way to prevent this compiler from\n\t# explicitly linking system object files so we need to strip them\n\t# from the output so that they don't get included in the library\n\t# dependencies.\n\toutput_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"ld\"`; templist=`echo $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; echo $list'\n\t;;\n    esac\n    ;;\n  lynxos*)\n    # FIXME: insert proper C++ library support\n    ld_shlibs_CXX=no\n    ;;\n  m88k*)\n    # FIXME: insert proper C++ library support\n    ld_shlibs_CXX=no\n    ;;\n  mvs*)\n    case $cc_basename in\n      cxx)\n\t# FIXME: insert proper C++ library support\n\tld_shlibs_CXX=no\n\t;;\n      *)\n\t# FIXME: insert proper C++ library support\n\tld_shlibs_CXX=no\n\t;;\n    esac\n    ;;\n  netbsd*)\n    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then\n      archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'\n      wlarc=\n      hardcode_libdir_flag_spec_CXX='-R$libdir'\n      hardcode_direct_CXX=yes\n      hardcode_shlibpath_var_CXX=no\n    fi\n    # Workaround some broken pre-1.5 toolchains\n    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e \"s:-lgcc -lc -lgcc::\"'\n    ;;\n  osf3*)\n    case $cc_basename in\n      KCC)\n\t# Kuck and Associates, Inc. (KAI) C++ Compiler\n\n\t# KCC will only create a shared library if the output file\n\t# ends with \".so\" (or \".sl\" for HP-UX), so rename the library\n\t# to its proper name (with version) after linking.\n\tarchive_cmds_CXX='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'\n\n\thardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'\n\thardcode_libdir_separator_CXX=:\n\n\t# Archives containing C++ object files must be created using\n\t# \"CC -Bstatic\", where \"CC\" is the KAI C++ compiler.\n\told_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'\n\n\t;;\n      RCC)\n\t# Rational C++ 2.4.1\n\t# FIXME: insert proper C++ library support\n\tld_shlibs_CXX=no\n\t;;\n      cxx)\n\tallow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\\*'\n\tarchive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n \"$verstring\" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'\n\n\thardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'\n\thardcode_libdir_separator_CXX=:\n\n\t# Commands to make compiler produce verbose output that lists\n\t# what \"hidden\" libraries, object files and flags are used when\n\t# linking a shared library.\n\t#\n\t# There doesn't appear to be a way to prevent this compiler from\n\t# explicitly linking system object files so we need to strip them\n\t# from the output so that they don't get included in the library\n\t# dependencies.\n\toutput_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"ld\" | grep -v \"ld:\"`; templist=`echo $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; echo $list'\n\t;;\n      *)\n\tif test \"$GXX\" = yes && test \"$with_gnu_ld\" = no; then\n\t  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\\*'\n\t  archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n \"$verstring\" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'\n\n\t  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'\n\t  hardcode_libdir_separator_CXX=:\n\n\t  # Commands to make compiler produce verbose output that lists\n\t  # what \"hidden\" libraries, object files and flags are used when\n\t  # linking a shared library.\n\t  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\\-L\"'\n\n\telse\n\t  # FIXME: insert proper C++ library support\n\t  ld_shlibs_CXX=no\n\tfi\n\t;;\n    esac\n    ;;\n  osf4* | osf5*)\n    case $cc_basename in\n      KCC)\n\t# Kuck and Associates, Inc. (KAI) C++ Compiler\n\n\t# KCC will only create a shared library if the output file\n\t# ends with \".so\" (or \".sl\" for HP-UX), so rename the library\n\t# to its proper name (with version) after linking.\n\tarchive_cmds_CXX='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'\n\n\thardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'\n\thardcode_libdir_separator_CXX=:\n\n\t# Archives containing C++ object files must be created using\n\t# the KAI C++ compiler.\n\told_archive_cmds_CXX='$CC -o $oldlib $oldobjs'\n\t;;\n      RCC)\n\t# Rational C++ 2.4.1\n\t# FIXME: insert proper C++ library support\n\tld_shlibs_CXX=no\n\t;;\n      cxx)\n\tallow_undefined_flag_CXX=' -expect_unresolved \\*'\n\tarchive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n \"$verstring\" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'\n\tarchive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf \"%s %s\\\\n\" -exported_symbol \"\\$i\" >> $lib.exp; done~\n\t  echo \"-hidden\">> $lib.exp~\n\t  $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\t$verstring` -update_registry $objdir/so_locations -o $lib~\n\t  $rm $lib.exp'\n\n\thardcode_libdir_flag_spec_CXX='-rpath $libdir'\n\thardcode_libdir_separator_CXX=:\n\n\t# Commands to make compiler produce verbose output that lists\n\t# what \"hidden\" libraries, object files and flags are used when\n\t# linking a shared library.\n\t#\n\t# There doesn't appear to be a way to prevent this compiler from\n\t# explicitly linking system object files so we need to strip them\n\t# from the output so that they don't get included in the library\n\t# dependencies.\n\toutput_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"ld\" | grep -v \"ld:\"`; templist=`echo $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; echo $list'\n\t;;\n      *)\n\tif test \"$GXX\" = yes && test \"$with_gnu_ld\" = no; then\n\t  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\\*'\n\t archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n \"$verstring\" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'\n\n\t  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'\n\t  hardcode_libdir_separator_CXX=:\n\n\t  # Commands to make compiler produce verbose output that lists\n\t  # what \"hidden\" libraries, object files and flags are used when\n\t  # linking a shared library.\n\t  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\\-L\"'\n\n\telse\n\t  # FIXME: insert proper C++ library support\n\t  ld_shlibs_CXX=no\n\tfi\n\t;;\n    esac\n    ;;\n  psos*)\n    # FIXME: insert proper C++ library support\n    ld_shlibs_CXX=no\n    ;;\n  sco*)\n    archive_cmds_need_lc_CXX=no\n    case $cc_basename in\n      CC)\n\t# FIXME: insert proper C++ library support\n\tld_shlibs_CXX=no\n\t;;\n      *)\n\t# FIXME: insert proper C++ library support\n\tld_shlibs_CXX=no\n\t;;\n    esac\n    ;;\n  sunos4*)\n    case $cc_basename in\n      CC)\n\t# Sun C++ 4.x\n\t# FIXME: insert proper C++ library support\n\tld_shlibs_CXX=no\n\t;;\n      lcc)\n\t# Lucid\n\t# FIXME: insert proper C++ library support\n\tld_shlibs_CXX=no\n\t;;\n      *)\n\t# FIXME: insert proper C++ library support\n\tld_shlibs_CXX=no\n\t;;\n    esac\n    ;;\n  solaris*)\n    case $cc_basename in\n      CC)\n\t# Sun C++ 4.2, 5.x and Centerline C++\n\tno_undefined_flag_CXX=' -zdefs'\n\tarchive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'\n\tarchive_expsym_cmds_CXX='$echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~$echo \"local: *; };\" >> $lib.exp~\n\t$CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'\n\n\thardcode_libdir_flag_spec_CXX='-R$libdir'\n\thardcode_shlibpath_var_CXX=no\n\tcase $host_os in\n\t  solaris2.0-5 | solaris2.0-5.*) ;;\n\t  *)\n\t    # The C++ compiler is used as linker so we must use $wl\n\t    # flag to pass the commands to the underlying system\n\t    # linker.\n\t    # Supported since Solaris 2.6 (maybe 2.5.1?)\n\t    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'\n\t    ;;\n\tesac\n\tlink_all_deplibs_CXX=yes\n\n\t# Commands to make compiler produce verbose output that lists\n\t# what \"hidden\" libraries, object files and flags are used when\n\t# linking a shared library.\n\t#\n\t# There doesn't appear to be a way to prevent this compiler from\n\t# explicitly linking system object files so we need to strip them\n\t# from the output so that they don't get included in the library\n\t# dependencies.\n\toutput_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\\-[LR]\"`; list=\"\"; for z in $templist; do case $z in conftest.$objext) list=\"$list $z\";; *.$objext);; *) list=\"$list $z\";;esac; done; echo $list'\n\n\t# Archives containing C++ object files must be created using\n\t# \"CC -xar\", where \"CC\" is the Sun C++ compiler.  This is\n\t# necessary to make sure instantiated templates are included\n\t# in the archive.\n\told_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'\n\t;;\n      gcx)\n\t# Green Hills C++ Compiler\n\tarchive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'\n\n\t# The C++ compiler must be used to create the archive.\n\told_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'\n\t;;\n      *)\n\t# GNU C++ compiler with Solaris linker\n\tif test \"$GXX\" = yes && test \"$with_gnu_ld\" = no; then\n\t  no_undefined_flag_CXX=' ${wl}-z ${wl}defs'\n\t  if $CC --version | grep -v '^2\\.7' > /dev/null; then\n\t    archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'\n\t    archive_expsym_cmds_CXX='$echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~$echo \"local: *; };\" >> $lib.exp~\n\t\t$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'\n\n\t    # Commands to make compiler produce verbose output that lists\n\t    # what \"hidden\" libraries, object files and flags are used when\n\t    # linking a shared library.\n\t    output_verbose_link_cmd=\"$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \\\"\\-L\\\"\"\n\t  else\n\t    # g++ 2.7 appears to require `-G' NOT `-shared' on this\n\t    # platform.\n\t    archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'\n\t    archive_expsym_cmds_CXX='$echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~$echo \"local: *; };\" >> $lib.exp~\n\t\t$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'\n\n\t    # Commands to make compiler produce verbose output that lists\n\t    # what \"hidden\" libraries, object files and flags are used when\n\t    # linking a shared library.\n\t    output_verbose_link_cmd=\"$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \\\"\\-L\\\"\"\n\t  fi\n\n\t  hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'\n\tfi\n\t;;\n    esac\n    ;;\n  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)\n    archive_cmds_need_lc_CXX=no\n    ;;\n  tandem*)\n    case $cc_basename in\n      NCC)\n\t# NonStop-UX NCC 3.20\n\t# FIXME: insert proper C++ library support\n\tld_shlibs_CXX=no\n\t;;\n      *)\n\t# FIXME: insert proper C++ library support\n\tld_shlibs_CXX=no\n\t;;\n    esac\n    ;;\n  vxworks*)\n    # FIXME: insert proper C++ library support\n    ld_shlibs_CXX=no\n    ;;\n  *)\n    # FIXME: insert proper C++ library support\n    ld_shlibs_CXX=no\n    ;;\nesac\necho \"$as_me:$LINENO: result: $ld_shlibs_CXX\" >&5\necho \"${ECHO_T}$ld_shlibs_CXX\" >&6\ntest \"$ld_shlibs_CXX\" = no && can_build_shared=no\n\nGCC_CXX=\"$GXX\"\nLD_CXX=\"$LD\"\n\n\ncat > conftest.$ac_ext <<EOF\nclass Foo\n{\npublic:\n  Foo (void) { a = 0; }\nprivate:\n  int a;\n};\nEOF\n\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; then\n  # Parse the compiler output and extract the necessary\n  # objects, libraries and library flags.\n\n  # Sentinel used to keep track of whether or not we are before\n  # the conftest object file.\n  pre_test_object_deps_done=no\n\n  # The `*' in the case matches for architectures that use `case' in\n  # $output_verbose_cmd can trigger glob expansion during the loop\n  # eval without this substitution.\n  output_verbose_link_cmd=\"`$echo \\\"X$output_verbose_link_cmd\\\" | $Xsed -e \\\"$no_glob_subst\\\"`\"\n\n  for p in `eval $output_verbose_link_cmd`; do\n    case $p in\n\n    -L* | -R* | -l*)\n       # Some compilers place space between \"-{L,R}\" and the path.\n       # Remove the space.\n       if test $p = \"-L\" \\\n\t  || test $p = \"-R\"; then\n\t prev=$p\n\t continue\n       else\n\t prev=\n       fi\n\n       if test \"$pre_test_object_deps_done\" = no; then\n\t case $p in\n\t -L* | -R*)\n\t   # Internal compiler library paths should come after those\n\t   # provided the user.  The postdeps already come after the\n\t   # user supplied libs so there is no need to process them.\n\t   if test -z \"$compiler_lib_search_path_CXX\"; then\n\t     compiler_lib_search_path_CXX=\"${prev}${p}\"\n\t   else\n\t     compiler_lib_search_path_CXX=\"${compiler_lib_search_path_CXX} ${prev}${p}\"\n\t   fi\n\t   ;;\n\t # The \"-l\" case would never come before the object being\n\t # linked, so don't bother handling this case.\n\t esac\n       else\n\t if test -z \"$postdeps_CXX\"; then\n\t   postdeps_CXX=\"${prev}${p}\"\n\t else\n\t   postdeps_CXX=\"${postdeps_CXX} ${prev}${p}\"\n\t fi\n       fi\n       ;;\n\n    *.$objext)\n       # This assumes that the test object file only shows up\n       # once in the compiler output.\n       if test \"$p\" = \"conftest.$objext\"; then\n\t pre_test_object_deps_done=yes\n\t continue\n       fi\n\n       if test \"$pre_test_object_deps_done\" = no; then\n\t if test -z \"$predep_objects_CXX\"; then\n\t   predep_objects_CXX=\"$p\"\n\t else\n\t   predep_objects_CXX=\"$predep_objects_CXX $p\"\n\t fi\n       else\n\t if test -z \"$postdep_objects_CXX\"; then\n\t   postdep_objects_CXX=\"$p\"\n\t else\n\t   postdep_objects_CXX=\"$postdep_objects_CXX $p\"\n\t fi\n       fi\n       ;;\n\n    *) ;; # Ignore the rest.\n\n    esac\n  done\n\n  # Clean up.\n  rm -f a.out a.exe\nelse\n  echo \"libtool.m4: error: problem compiling CXX test program\"\nfi\n\n$rm -f confest.$objext\n\ncase \" $postdeps_CXX \" in\n*\" -lc \"*) archive_cmds_need_lc_CXX=no ;;\nesac\n\nlt_prog_compiler_wl_CXX=\nlt_prog_compiler_pic_CXX=\nlt_prog_compiler_static_CXX=\n\necho \"$as_me:$LINENO: checking for $compiler option to produce PIC\" >&5\necho $ECHO_N \"checking for $compiler option to produce PIC... $ECHO_C\" >&6\n\n  # C++ specific cases for pic, static, wl, etc.\n  if test \"$GXX\" = yes; then\n    lt_prog_compiler_wl_CXX='-Wl,'\n    lt_prog_compiler_static_CXX='-static'\n\n    case $host_os in\n    aix*)\n      # All AIX code is PIC.\n      if test \"$host_cpu\" = ia64; then\n\t# AIX 5 now supports IA64 processor\n\tlt_prog_compiler_static_CXX='-Bstatic'\n      fi\n      ;;\n    amigaos*)\n      # FIXME: we need at least 68020 code to build shared libraries, but\n      # adding the `-m68020' flag to GCC prevents building anything better,\n      # like `-m68040'.\n      lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'\n      ;;\n    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)\n      # PIC is the default for these OSes.\n      ;;\n    mingw* | os2* | pw32*)\n      # This hack is so that the source file can tell whether it is being\n      # built for inclusion in a dll (and should export symbols for example).\n      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'\n      ;;\n    darwin* | rhapsody*)\n      # PIC is the default on this platform\n      # Common symbols not allowed in MH_DYLIB files\n      lt_prog_compiler_pic_CXX='-fno-common'\n      ;;\n    *djgpp*)\n      # DJGPP does not support shared libraries at all\n      lt_prog_compiler_pic_CXX=\n      ;;\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\tlt_prog_compiler_pic_CXX=-Kconform_pic\n      fi\n      ;;\n    hpux*)\n      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but\n      # not for PA HP-UX.\n      case \"$host_cpu\" in\n      hppa*64*|ia64*)\n\t;;\n      *)\n\tlt_prog_compiler_pic_CXX='-fPIC'\n\t;;\n      esac\n      ;;\n    *)\n      lt_prog_compiler_pic_CXX='-fPIC'\n      ;;\n    esac\n  else\n    case $host_os in\n      aix4* | aix5*)\n\t# All AIX code is PIC.\n\tif test \"$host_cpu\" = ia64; then\n\t  # AIX 5 now supports IA64 processor\n\t  lt_prog_compiler_static_CXX='-Bstatic'\n\telse\n\t  lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'\n\tfi\n\t;;\n      chorus*)\n\tcase $cc_basename in\n\tcxch68)\n\t  # Green Hills C++ Compiler\n\t  # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)=\"--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\"\n\t  ;;\n\tesac\n\t;;\n      dgux*)\n\tcase $cc_basename in\n\t  ec++)\n\t    lt_prog_compiler_pic_CXX='-KPIC'\n\t    ;;\n\t  ghcx)\n\t    # Green Hills C++ Compiler\n\t    lt_prog_compiler_pic_CXX='-pic'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      freebsd* | kfreebsd*-gnu)\n\t# FreeBSD uses GNU C++\n\t;;\n      hpux9* | hpux10* | hpux11*)\n\tcase $cc_basename in\n\t  CC)\n\t    lt_prog_compiler_wl_CXX='-Wl,'\n\t    lt_prog_compiler_static_CXX=\"${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive\"\n\t    if test \"$host_cpu\" != ia64; then\n\t      lt_prog_compiler_pic_CXX='+Z'\n\t    fi\n\t    ;;\n\t  aCC)\n\t    lt_prog_compiler_wl_CXX='-Wl,'\n\t    lt_prog_compiler_static_CXX=\"${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive\"\n\t    case \"$host_cpu\" in\n\t    hppa*64*|ia64*)\n\t      # +Z the default\n\t      ;;\n\t    *)\n\t      lt_prog_compiler_pic_CXX='+Z'\n\t      ;;\n\t    esac\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      irix5* | irix6* | nonstopux*)\n\tcase $cc_basename in\n\t  CC)\n\t    lt_prog_compiler_wl_CXX='-Wl,'\n\t    lt_prog_compiler_static_CXX='-non_shared'\n\t    # CC pic flag -KPIC is the default.\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      linux*)\n\tcase $cc_basename in\n\t  KCC)\n\t    # KAI C++ Compiler\n\t    lt_prog_compiler_wl_CXX='--backend -Wl,'\n\t    lt_prog_compiler_pic_CXX='-fPIC'\n\t    ;;\n\t  icpc)\n\t    # Intel C++\n\t    lt_prog_compiler_wl_CXX='-Wl,'\n\t    lt_prog_compiler_pic_CXX='-KPIC'\n\t    lt_prog_compiler_static_CXX='-static'\n\t    ;;\n\t  cxx)\n\t    # Compaq C++\n\t    # Make sure the PIC flag is empty.  It appears that all Alpha\n\t    # Linux and Compaq Tru64 Unix objects are PIC.\n\t    lt_prog_compiler_pic_CXX=\n\t    lt_prog_compiler_static_CXX='-non_shared'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      lynxos*)\n\t;;\n      m88k*)\n\t;;\n      mvs*)\n\tcase $cc_basename in\n\t  cxx)\n\t    lt_prog_compiler_pic_CXX='-W c,exportall'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      netbsd*)\n\t;;\n      osf3* | osf4* | osf5*)\n\tcase $cc_basename in\n\t  KCC)\n\t    lt_prog_compiler_wl_CXX='--backend -Wl,'\n\t    ;;\n\t  RCC)\n\t    # Rational C++ 2.4.1\n\t    lt_prog_compiler_pic_CXX='-pic'\n\t    ;;\n\t  cxx)\n\t    # Digital/Compaq C++\n\t    lt_prog_compiler_wl_CXX='-Wl,'\n\t    # Make sure the PIC flag is empty.  It appears that all Alpha\n\t    # Linux and Compaq Tru64 Unix objects are PIC.\n\t    lt_prog_compiler_pic_CXX=\n\t    lt_prog_compiler_static_CXX='-non_shared'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      psos*)\n\t;;\n      sco*)\n\tcase $cc_basename in\n\t  CC)\n\t    lt_prog_compiler_pic_CXX='-fPIC'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      solaris*)\n\tcase $cc_basename in\n\t  CC)\n\t    # Sun C++ 4.2, 5.x and Centerline C++\n\t    lt_prog_compiler_pic_CXX='-KPIC'\n\t    lt_prog_compiler_static_CXX='-Bstatic'\n\t    lt_prog_compiler_wl_CXX='-Qoption ld '\n\t    ;;\n\t  gcx)\n\t    # Green Hills C++ Compiler\n\t    lt_prog_compiler_pic_CXX='-PIC'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      sunos4*)\n\tcase $cc_basename in\n\t  CC)\n\t    # Sun C++ 4.x\n\t    lt_prog_compiler_pic_CXX='-pic'\n\t    lt_prog_compiler_static_CXX='-Bstatic'\n\t    ;;\n\t  lcc)\n\t    # Lucid\n\t    lt_prog_compiler_pic_CXX='-pic'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      tandem*)\n\tcase $cc_basename in\n\t  NCC)\n\t    # NonStop-UX NCC 3.20\n\t    lt_prog_compiler_pic_CXX='-KPIC'\n\t    ;;\n\t  *)\n\t    ;;\n\tesac\n\t;;\n      unixware*)\n\t;;\n      vxworks*)\n\t;;\n      *)\n\tlt_prog_compiler_can_build_shared_CXX=no\n\t;;\n    esac\n  fi\n\necho \"$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX\" >&5\necho \"${ECHO_T}$lt_prog_compiler_pic_CXX\" >&6\n\n#\n# Check to make sure the PIC flag actually works.\n#\nif test -n \"$lt_prog_compiler_pic_CXX\"; then\n\necho \"$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works\" >&5\necho $ECHO_N \"checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C\" >&6\nif test \"${lt_prog_compiler_pic_works_CXX+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  lt_prog_compiler_pic_works_CXX=no\n  ac_outfile=conftest.$ac_objext\n   printf \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n   lt_compiler_flag=\"$lt_prog_compiler_pic_CXX -DPIC\"\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   # The option is referenced via a variable to avoid confusing sed.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \\\n   -e 's: [^ ]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:12165: $lt_compile\\\"\" >&5)\n   (eval \"$lt_compile\" 2>conftest.err)\n   ac_status=$?\n   cat conftest.err >&5\n   echo \"$as_me:12169: \\$? = $ac_status\" >&5\n   if (exit $ac_status) && test -s \"$ac_outfile\"; then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     if test ! -s conftest.err; then\n       lt_prog_compiler_pic_works_CXX=yes\n     fi\n   fi\n   $rm conftest*\n\nfi\necho \"$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX\" >&5\necho \"${ECHO_T}$lt_prog_compiler_pic_works_CXX\" >&6\n\nif test x\"$lt_prog_compiler_pic_works_CXX\" = xyes; then\n    case $lt_prog_compiler_pic_CXX in\n     \"\" | \" \"*) ;;\n     *) lt_prog_compiler_pic_CXX=\" $lt_prog_compiler_pic_CXX\" ;;\n     esac\nelse\n    lt_prog_compiler_pic_CXX=\n     lt_prog_compiler_can_build_shared_CXX=no\nfi\n\nfi\ncase \"$host_os\" in\n  # For platforms which do not support PIC, -DPIC is meaningless:\n  *djgpp*)\n    lt_prog_compiler_pic_CXX=\n    ;;\n  *)\n    lt_prog_compiler_pic_CXX=\"$lt_prog_compiler_pic_CXX -DPIC\"\n    ;;\nesac\n\necho \"$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext\" >&5\necho $ECHO_N \"checking if $compiler supports -c -o file.$ac_objext... $ECHO_C\" >&6\nif test \"${lt_cv_prog_compiler_c_o_CXX+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  lt_cv_prog_compiler_c_o_CXX=no\n   $rm -r conftest 2>/dev/null\n   mkdir conftest\n   cd conftest\n   mkdir out\n   printf \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n\n   lt_compiler_flag=\"-o out/conftest2.$ac_objext\"\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \\\n   -e 's: [^ ]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:12225: $lt_compile\\\"\" >&5)\n   (eval \"$lt_compile\" 2>out/conftest.err)\n   ac_status=$?\n   cat out/conftest.err >&5\n   echo \"$as_me:12229: \\$? = $ac_status\" >&5\n   if (exit $ac_status) && test -s out/conftest2.$ac_objext\n   then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     if test ! -s out/conftest.err; then\n       lt_cv_prog_compiler_c_o_CXX=yes\n     fi\n   fi\n   chmod u+w .\n   $rm conftest*\n   # SGI C++ compiler will create directory out/ii_files/ for\n   # template instantiation\n   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files\n   $rm out/* && rmdir out\n   cd ..\n   rmdir conftest\n   $rm conftest*\n\nfi\necho \"$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX\" >&5\necho \"${ECHO_T}$lt_cv_prog_compiler_c_o_CXX\" >&6\n\n\nhard_links=\"nottested\"\nif test \"$lt_cv_prog_compiler_c_o_CXX\" = no && test \"$need_locks\" != no; then\n  # do not overwrite the value of need_locks provided by the user\n  echo \"$as_me:$LINENO: checking if we can lock with hard links\" >&5\necho $ECHO_N \"checking if we can lock with hard links... $ECHO_C\" >&6\n  hard_links=yes\n  $rm conftest*\n  ln conftest.a conftest.b 2>/dev/null && hard_links=no\n  touch conftest.a\n  ln conftest.a conftest.b 2>&5 || hard_links=no\n  ln conftest.a conftest.b 2>/dev/null && hard_links=no\n  echo \"$as_me:$LINENO: result: $hard_links\" >&5\necho \"${ECHO_T}$hard_links\" >&6\n  if test \"$hard_links\" = no; then\n    { echo \"$as_me:$LINENO: WARNING: \\`$CC' does not support \\`-c -o', so \\`make -j' may be unsafe\" >&5\necho \"$as_me: WARNING: \\`$CC' does not support \\`-c -o', so \\`make -j' may be unsafe\" >&2;}\n    need_locks=warn\n  fi\nelse\n  need_locks=no\nfi\n\necho \"$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries\" >&5\necho $ECHO_N \"checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C\" >&6\n\n  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\\''s/.* //'\\'' | sort | uniq > $export_symbols'\n  case $host_os in\n  aix4* | aix5*)\n    # If we're using GNU nm, then we don't want the \"-C\" option.\n    # -C means demangle to AIX nm, but means don't demangle with GNU nm\n    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then\n      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\\''{ if (((\\$2 == \"T\") || (\\$2 == \"D\") || (\\$2 == \"B\")) && (substr(\\$3,1,1) != \".\")) { print \\$3 } }'\\'' | sort -u > $export_symbols'\n    else\n      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\\''{ if (((\\$2 == \"T\") || (\\$2 == \"D\") || (\\$2 == \"B\")) && (substr(\\$3,1,1) != \".\")) { print \\$3 } }'\\'' | sort -u > $export_symbols'\n    fi\n    ;;\n  pw32*)\n    export_symbols_cmds_CXX=\"$ltdll_cmds\"\n  ;;\n  cygwin* | mingw*)\n    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\\''/^[BCDGS] /s/.* \\([^ ]*\\)/\\1 DATA/'\\'' | $SED -e '\\''/^[AITW] /s/.* //'\\'' | sort | uniq > $export_symbols'\n  ;;\n  *)\n    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\\''s/.* //'\\'' | sort | uniq > $export_symbols'\n  ;;\n  esac\n\necho \"$as_me:$LINENO: result: $ld_shlibs_CXX\" >&5\necho \"${ECHO_T}$ld_shlibs_CXX\" >&6\ntest \"$ld_shlibs_CXX\" = no && can_build_shared=no\n\nvariables_saved_for_relink=\"PATH $shlibpath_var $runpath_var\"\nif test \"$GCC\" = yes; then\n  variables_saved_for_relink=\"$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH\"\nfi\n\n#\n# Do we need to explicitly link libc?\n#\ncase \"x$archive_cmds_need_lc_CXX\" in\nx|xyes)\n  # Assume -lc should be added\n  archive_cmds_need_lc_CXX=yes\n\n  if test \"$enable_shared\" = yes && test \"$GCC\" = yes; then\n    case $archive_cmds_CXX in\n    *'~'*)\n      # FIXME: we may have to deal with multi-command sequences.\n      ;;\n    '$CC '*)\n      # Test whether the compiler implicitly links with -lc since on some\n      # systems, -lgcc has to come before -lc. If gcc already passes -lc\n      # to ld, don't add -lc before -lgcc.\n      echo \"$as_me:$LINENO: checking whether -lc should be explicitly linked in\" >&5\necho $ECHO_N \"checking whether -lc should be explicitly linked in... $ECHO_C\" >&6\n      $rm conftest*\n      printf \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n\n      if { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } 2>conftest.err; then\n        soname=conftest\n        lib=conftest\n        libobjs=conftest.$ac_objext\n        deplibs=\n        wl=$lt_prog_compiler_wl_CXX\n        compiler_flags=-v\n        linker_flags=-v\n        verstring=\n        output_objdir=.\n        libname=conftest\n        lt_save_allow_undefined_flag=$allow_undefined_flag_CXX\n        allow_undefined_flag_CXX=\n        if { (eval echo \"$as_me:$LINENO: \\\"$archive_cmds_CXX 2\\>\\&1 \\| grep \\\" -lc \\\" \\>/dev/null 2\\>\\&1\\\"\") >&5\n  (eval $archive_cmds_CXX 2\\>\\&1 \\| grep \\\" -lc \\\" \\>/dev/null 2\\>\\&1) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }\n        then\n\t  archive_cmds_need_lc_CXX=no\n        else\n\t  archive_cmds_need_lc_CXX=yes\n        fi\n        allow_undefined_flag_CXX=$lt_save_allow_undefined_flag\n      else\n        cat conftest.err 1>&5\n      fi\n      $rm conftest*\n      echo \"$as_me:$LINENO: result: $archive_cmds_need_lc_CXX\" >&5\necho \"${ECHO_T}$archive_cmds_need_lc_CXX\" >&6\n      ;;\n    esac\n  fi\n  ;;\nesac\n\necho \"$as_me:$LINENO: checking dynamic linker characteristics\" >&5\necho $ECHO_N \"checking dynamic linker characteristics... $ECHO_C\" >&6\nlibrary_names_spec=\nlibname_spec='lib$name'\nsoname_spec=\nshrext_cmds=\".so\"\npostinstall_cmds=\npostuninstall_cmds=\nfinish_cmds=\nfinish_eval=\nshlibpath_var=\nshlibpath_overrides_runpath=unknown\nversion_type=none\ndynamic_linker=\"$host_os ld.so\"\nsys_lib_dlsearch_path_spec=\"/lib /usr/lib\"\nif test \"$GCC\" = yes; then\n  sys_lib_search_path_spec=`$CC -print-search-dirs | grep \"^libraries:\" | $SED -e \"s/^libraries://\" -e \"s,=/,/,g\"`\n  if echo \"$sys_lib_search_path_spec\" | grep ';' >/dev/null ; then\n    # if the path contains \";\" then we assume it to be the separator\n    # otherwise default to the standard path separator (i.e. \":\") - it is\n    # assumed that no part of a normal pathname contains \";\" but that should\n    # okay in the real world where \";\" in dirpaths is itself problematic.\n    sys_lib_search_path_spec=`echo \"$sys_lib_search_path_spec\" | $SED -e 's/;/ /g'`\n  else\n    sys_lib_search_path_spec=`echo \"$sys_lib_search_path_spec\" | $SED  -e \"s/$PATH_SEPARATOR/ /g\"`\n  fi\nelse\n  sys_lib_search_path_spec=\"/lib /usr/lib /usr/local/lib\"\nfi\nneed_lib_prefix=unknown\nhardcode_into_libs=no\n\n# when you set need_version to no, make sure it does not cause -set_version\n# flags to be left without arguments\nneed_version=unknown\n\ncase $host_os in\naix3*)\n  version_type=linux\n  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'\n  shlibpath_var=LIBPATH\n\n  # AIX 3 has no versioning support, so we append a major version to the name.\n  soname_spec='${libname}${release}${shared_ext}$major'\n  ;;\n\naix4* | aix5*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  hardcode_into_libs=yes\n  if test \"$host_cpu\" = ia64; then\n    # AIX 5 supports IA64\n    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'\n    shlibpath_var=LD_LIBRARY_PATH\n  else\n    # With GCC up to 2.95.x, collect2 would create an import file\n    # for dependence libraries.  The import file would start with\n    # the line `#! .'.  This would cause the generated library to\n    # depend on `.', always an invalid library.  This was fixed in\n    # development snapshots of GCC prior to 3.0.\n    case $host_os in\n      aix4 | aix4.[01] | aix4.[01].*)\n      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'\n\t   echo ' yes '\n\t   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then\n\t:\n      else\n\tcan_build_shared=no\n      fi\n      ;;\n    esac\n    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct\n    # soname into executable. Probably we can add versioning support to\n    # collect2, so additional links can be useful in future.\n    if test \"$aix_use_runtimelinking\" = yes; then\n      # If using run time linking (on AIX 4.2 or later) use lib<name>.so\n      # instead of lib<name>.a to let people know that these are not\n      # typical AIX shared libraries.\n      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n    else\n      # We preserve .a as extension for shared libraries through AIX4.2\n      # and later when we are not doing run time linking.\n      library_names_spec='${libname}${release}.a $libname.a'\n      soname_spec='${libname}${release}${shared_ext}$major'\n    fi\n    shlibpath_var=LIBPATH\n  fi\n  ;;\n\namigaos*)\n  library_names_spec='$libname.ixlibrary $libname.a'\n  # Create ${libname}_ixlibrary.a entries in /sys/libs.\n  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo \"X$lib\" | $Xsed -e '\\''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'\n  ;;\n\nbeos*)\n  library_names_spec='${libname}${shared_ext}'\n  dynamic_linker=\"$host_os ld.so\"\n  shlibpath_var=LIBRARY_PATH\n  ;;\n\nbsdi4*)\n  version_type=linux\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  sys_lib_search_path_spec=\"/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib\"\n  sys_lib_dlsearch_path_spec=\"/shlib /usr/lib /usr/local/lib\"\n  # the default ld.so.conf also contains /usr/contrib/lib and\n  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow\n  # libtool to hard-code these into programs\n  ;;\n\ncygwin* | mingw* | pw32*)\n  version_type=windows\n  shrext_cmds=\".dll\"\n  need_version=no\n  need_lib_prefix=no\n\n  case $GCC,$host_os in\n  yes,cygwin* | yes,mingw* | yes,pw32*)\n    library_names_spec='$libname.dll.a'\n    # DLL is installed to $(libdir)/../bin by postinstall_cmds\n    postinstall_cmds='base_file=`basename \\${file}`~\n      dlpath=`$SHELL 2>&1 -c '\\''. $dir/'\\''\\${base_file}'\\''i;echo \\$dlname'\\''`~\n      dldir=$destdir/`dirname \\$dlpath`~\n      test -d \\$dldir || mkdir -p \\$dldir~\n      $install_prog $dir/$dlname \\$dldir/$dlname'\n    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\\''. $file; echo \\$dlname'\\''`~\n      dlpath=$dir/\\$dldll~\n       $rm \\$dlpath'\n    shlibpath_overrides_runpath=yes\n\n    case $host_os in\n    cygwin*)\n      # Cygwin DLLs use 'cyg' prefix rather than 'lib'\n      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'\n      sys_lib_search_path_spec=\"/usr/lib /lib/w32api /lib /usr/local/lib\"\n      ;;\n    mingw*)\n      # MinGW DLLs use traditional 'lib' prefix\n      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'\n      sys_lib_search_path_spec=`$CC -print-search-dirs | grep \"^libraries:\" | $SED -e \"s/^libraries://\" -e \"s,=/,/,g\"`\n      if echo \"$sys_lib_search_path_spec\" | grep ';[c-zC-Z]:/' >/dev/null; then\n        # It is most probably a Windows format PATH printed by\n        # mingw gcc, but we are running on Cygwin. Gcc prints its search\n        # path with ; separators, and with drive letters. We can handle the\n        # drive letters (cygwin fileutils understands them), so leave them,\n        # especially as we might pass files found there to a mingw objdump,\n        # which wouldn't understand a cygwinified path. Ahh.\n        sys_lib_search_path_spec=`echo \"$sys_lib_search_path_spec\" | $SED -e 's/;/ /g'`\n      else\n        sys_lib_search_path_spec=`echo \"$sys_lib_search_path_spec\" | $SED  -e \"s/$PATH_SEPARATOR/ /g\"`\n      fi\n      ;;\n    pw32*)\n      # pw32 DLLs use 'pw' prefix rather than 'lib'\n      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'\n      ;;\n    esac\n    ;;\n\n  *)\n    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'\n    ;;\n  esac\n  dynamic_linker='Win32 ld.exe'\n  # FIXME: first we should search . and the directory the executable is in\n  shlibpath_var=PATH\n  ;;\n\ndarwin* | rhapsody*)\n  dynamic_linker=\"$host_os dyld\"\n  version_type=darwin\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'\n  soname_spec='${libname}${release}${major}$shared_ext'\n  shlibpath_overrides_runpath=yes\n  shlibpath_var=DYLD_LIBRARY_PATH\n  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'\n  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.\n  if test \"$GCC\" = yes; then\n    sys_lib_search_path_spec=`$CC -print-search-dirs | tr \"\\n\" \"$PATH_SEPARATOR\" | sed -e 's/libraries:/@libraries:/' | tr \"@\" \"\\n\" | grep \"^libraries:\" | sed -e \"s/^libraries://\" -e \"s,=/,/,g\" -e \"s,$PATH_SEPARATOR, ,g\" -e \"s,.*,& /lib /usr/lib /usr/local/lib,g\"`\n  else\n    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'\n  fi\n  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'\n  ;;\n\ndgux*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\nfreebsd1*)\n  dynamic_linker=no\n  ;;\n\nkfreebsd*-gnu)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  dynamic_linker='GNU ld.so'\n  ;;\n\nfreebsd*)\n  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`\n  version_type=freebsd-$objformat\n  case $version_type in\n    freebsd-elf*)\n      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'\n      need_version=no\n      need_lib_prefix=no\n      ;;\n    freebsd-*)\n      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'\n      need_version=yes\n      ;;\n  esac\n  shlibpath_var=LD_LIBRARY_PATH\n  case $host_os in\n  freebsd2*)\n    shlibpath_overrides_runpath=yes\n    ;;\n  freebsd3.01* | freebsdelf3.01*)\n    shlibpath_overrides_runpath=yes\n    hardcode_into_libs=yes\n    ;;\n  *) # from 3.2 on\n    shlibpath_overrides_runpath=no\n    hardcode_into_libs=yes\n    ;;\n  esac\n  ;;\n\ngnu*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  hardcode_into_libs=yes\n  ;;\n\nhpux9* | hpux10* | hpux11*)\n  # Give a soname corresponding to the major version so that dld.sl refuses to\n  # link against other versions.\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=no\n  case \"$host_cpu\" in\n  ia64*)\n    shrext_cmds='.so'\n    hardcode_into_libs=yes\n    dynamic_linker=\"$host_os dld.so\"\n    shlibpath_var=LD_LIBRARY_PATH\n    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.\n    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n    soname_spec='${libname}${release}${shared_ext}$major'\n    if test \"X$HPUX_IA64_MODE\" = X32; then\n      sys_lib_search_path_spec=\"/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib\"\n    else\n      sys_lib_search_path_spec=\"/usr/lib/hpux64 /usr/local/lib/hpux64\"\n    fi\n    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec\n    ;;\n   hppa*64*)\n     shrext_cmds='.sl'\n     hardcode_into_libs=yes\n     dynamic_linker=\"$host_os dld.sl\"\n     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH\n     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.\n     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n     soname_spec='${libname}${release}${shared_ext}$major'\n     sys_lib_search_path_spec=\"/usr/lib/pa20_64 /usr/ccs/lib/pa20_64\"\n     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec\n     ;;\n   *)\n    shrext_cmds='.sl'\n    dynamic_linker=\"$host_os dld.sl\"\n    shlibpath_var=SHLIB_PATH\n    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH\n    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n    soname_spec='${libname}${release}${shared_ext}$major'\n    ;;\n  esac\n  # HP-UX runs *really* slowly unless shared libraries are mode 555.\n  postinstall_cmds='chmod 555 $lib'\n  ;;\n\nirix5* | irix6* | nonstopux*)\n  case $host_os in\n    nonstopux*) version_type=nonstopux ;;\n    *)\n\tif test \"$lt_cv_prog_gnu_ld\" = yes; then\n\t\tversion_type=linux\n\telse\n\t\tversion_type=irix\n\tfi ;;\n  esac\n  need_lib_prefix=no\n  need_version=no\n  soname_spec='${libname}${release}${shared_ext}$major'\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'\n  case $host_os in\n  irix5* | nonstopux*)\n    libsuff= shlibsuff=\n    ;;\n  *)\n    case $LD in # libtool.m4 will add one of these switches to LD\n    *-32|*\"-32 \"|*-melf32bsmip|*\"-melf32bsmip \")\n      libsuff= shlibsuff= libmagic=32-bit;;\n    *-n32|*\"-n32 \"|*-melf32bmipn32|*\"-melf32bmipn32 \")\n      libsuff=32 shlibsuff=N32 libmagic=N32;;\n    *-64|*\"-64 \"|*-melf64bmip|*\"-melf64bmip \")\n      libsuff=64 shlibsuff=64 libmagic=64-bit;;\n    *) libsuff= shlibsuff= libmagic=never-match;;\n    esac\n    ;;\n  esac\n  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH\n  shlibpath_overrides_runpath=no\n  sys_lib_search_path_spec=\"/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}\"\n  sys_lib_dlsearch_path_spec=\"/usr/lib${libsuff} /lib${libsuff}\"\n  hardcode_into_libs=yes\n  ;;\n\n# No shared lib support for Linux oldld, aout, or coff.\nlinux*oldld* | linux*aout* | linux*coff*)\n  dynamic_linker=no\n  ;;\n\n# This must be Linux ELF.\nlinux*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -n $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  # This implies no fast_install, which is unacceptable.\n  # Some rework will be needed to allow for fast_install\n  # before this can be enabled.\n  hardcode_into_libs=yes\n\n  # find out which ABI we are using\n  libsuff=\n  case \"$host_cpu\" in\n  x86_64*|s390x*|powerpc64*)\n    echo '#line 12736 \"configure\"' > conftest.$ac_ext\n    if { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; then\n      case `/usr/bin/file conftest.$ac_objext` in\n      *64-bit*)\n        libsuff=64\n        sys_lib_search_path_spec=\"/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}\"\n        ;;\n      esac\n    fi\n    rm -rf conftest*\n    ;;\n  esac\n\n  # Append ld.so.conf contents to the search path\n  if test -f /etc/ld.so.conf; then\n    lt_ld_extra=`$SED -e 's/:,\\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\\n' ' '`\n    sys_lib_dlsearch_path_spec=\"/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra\"\n  fi\n\n  # We used to test for /lib/ld.so.1 and disable shared libraries on\n  # powerpc, because MkLinux only supported shared libraries with the\n  # GNU dynamic linker.  Since this was broken with cross compilers,\n  # most powerpc-linux boxes support dynamic linking these days and\n  # people can always --disable-shared, the test was removed, and we\n  # assume the GNU/Linux dynamic linker is in use.\n  dynamic_linker='GNU/Linux ld.so'\n  ;;\n\nknetbsd*-gnu)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  dynamic_linker='GNU ld.so'\n  ;;\n\nnetbsd*)\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=no\n  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then\n    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'\n    finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -m $libdir'\n    dynamic_linker='NetBSD (a.out) ld.so'\n  else\n    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'\n    soname_spec='${libname}${release}${shared_ext}$major'\n    dynamic_linker='NetBSD ld.elf_so'\n  fi\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  hardcode_into_libs=yes\n  ;;\n\nnewsos6)\n  version_type=linux\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  ;;\n\nnto-qnx*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  ;;\n\nopenbsd*)\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=yes\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -m $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  if test -z \"`echo __ELF__ | $CC -E - | grep __ELF__`\" || test \"$host_os-$host_cpu\" = \"openbsd2.8-powerpc\"; then\n    case $host_os in\n      openbsd2.[89] | openbsd2.[89].*)\n\tshlibpath_overrides_runpath=no\n\t;;\n      *)\n\tshlibpath_overrides_runpath=yes\n\t;;\n      esac\n  else\n    shlibpath_overrides_runpath=yes\n  fi\n  ;;\n\nos2*)\n  libname_spec='$name'\n  shrext_cmds=\".dll\"\n  need_lib_prefix=no\n  library_names_spec='$libname${shared_ext} $libname.a'\n  dynamic_linker='OS/2 ld.exe'\n  shlibpath_var=LIBPATH\n  ;;\n\nosf3* | osf4* | osf5*)\n  version_type=osf\n  need_lib_prefix=no\n  need_version=no\n  soname_spec='${libname}${release}${shared_ext}$major'\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  shlibpath_var=LD_LIBRARY_PATH\n  sys_lib_search_path_spec=\"/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib\"\n  sys_lib_dlsearch_path_spec=\"$sys_lib_search_path_spec\"\n  ;;\n\nsco3.2v5*)\n  version_type=osf\n  soname_spec='${libname}${release}${shared_ext}$major'\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\nsolaris*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  hardcode_into_libs=yes\n  # ldd complains unless libraries are executable\n  postinstall_cmds='chmod +x $lib'\n  ;;\n\nsunos4*)\n  version_type=sunos\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'\n  finish_cmds='PATH=\"\\$PATH:/usr/etc\" ldconfig $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  if test \"$with_gnu_ld\" = yes; then\n    need_lib_prefix=no\n  fi\n  need_version=yes\n  ;;\n\nsysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)\n  version_type=linux\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  case $host_vendor in\n    sni)\n      shlibpath_overrides_runpath=no\n      need_lib_prefix=no\n      export_dynamic_flag_spec='${wl}-Blargedynsym'\n      runpath_var=LD_RUN_PATH\n      ;;\n    siemens)\n      need_lib_prefix=no\n      ;;\n    motorola)\n      need_lib_prefix=no\n      need_version=no\n      shlibpath_overrides_runpath=no\n      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'\n      ;;\n  esac\n  ;;\n\nsysv4*MP*)\n  if test -d /usr/nec ;then\n    version_type=linux\n    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'\n    soname_spec='$libname${shared_ext}.$major'\n    shlibpath_var=LD_LIBRARY_PATH\n  fi\n  ;;\n\nuts4*)\n  version_type=linux\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\n*)\n  dynamic_linker=no\n  ;;\nesac\necho \"$as_me:$LINENO: result: $dynamic_linker\" >&5\necho \"${ECHO_T}$dynamic_linker\" >&6\ntest \"$dynamic_linker\" = no && can_build_shared=no\n\necho \"$as_me:$LINENO: checking how to hardcode library paths into programs\" >&5\necho $ECHO_N \"checking how to hardcode library paths into programs... $ECHO_C\" >&6\nhardcode_action_CXX=\nif test -n \"$hardcode_libdir_flag_spec_CXX\" || \\\n   test -n \"$runpath_var CXX\" || \\\n   test \"X$hardcode_automatic_CXX\"=\"Xyes\" ; then\n\n  # We can hardcode non-existant directories.\n  if test \"$hardcode_direct_CXX\" != no &&\n     # If the only mechanism to avoid hardcoding is shlibpath_var, we\n     # have to relink, otherwise we might link with an installed library\n     # when we should be linking with a yet-to-be-installed one\n     ## test \"$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)\" != no &&\n     test \"$hardcode_minus_L_CXX\" != no; then\n    # Linking always hardcodes the temporary library directory.\n    hardcode_action_CXX=relink\n  else\n    # We can link without hardcoding, and we can hardcode nonexisting dirs.\n    hardcode_action_CXX=immediate\n  fi\nelse\n  # We cannot hardcode anything, or else we can only hardcode existing\n  # directories.\n  hardcode_action_CXX=unsupported\nfi\necho \"$as_me:$LINENO: result: $hardcode_action_CXX\" >&5\necho \"${ECHO_T}$hardcode_action_CXX\" >&6\n\nif test \"$hardcode_action_CXX\" = relink; then\n  # Fast installation is not supported\n  enable_fast_install=no\nelif test \"$shlibpath_overrides_runpath\" = yes ||\n     test \"$enable_shared\" = no; then\n  # Fast installation is not necessary\n  enable_fast_install=needless\nfi\n\nstriplib=\nold_striplib=\necho \"$as_me:$LINENO: checking whether stripping libraries is possible\" >&5\necho $ECHO_N \"checking whether stripping libraries is possible... $ECHO_C\" >&6\nif test -n \"$STRIP\" && $STRIP -V 2>&1 | grep \"GNU strip\" >/dev/null; then\n  test -z \"$old_striplib\" && old_striplib=\"$STRIP --strip-debug\"\n  test -z \"$striplib\" && striplib=\"$STRIP --strip-unneeded\"\n  echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\nelse\n# FIXME - insert some real tests, host_os isn't really good enough\n  case $host_os in\n   darwin*)\n       if test -n \"$STRIP\" ; then\n         striplib=\"$STRIP -x\"\n         echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\n       else\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n       ;;\n   *)\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\n    ;;\n  esac\nfi\n\nif test \"x$enable_dlopen\" != xyes; then\n  enable_dlopen=unknown\n  enable_dlopen_self=unknown\n  enable_dlopen_self_static=unknown\nelse\n  lt_cv_dlopen=no\n  lt_cv_dlopen_libs=\n\n  case $host_os in\n  beos*)\n    lt_cv_dlopen=\"load_add_on\"\n    lt_cv_dlopen_libs=\n    lt_cv_dlopen_self=yes\n    ;;\n\n  mingw* | pw32*)\n    lt_cv_dlopen=\"LoadLibrary\"\n    lt_cv_dlopen_libs=\n   ;;\n\n  cygwin*)\n    lt_cv_dlopen=\"dlopen\"\n    lt_cv_dlopen_libs=\n   ;;\n\n  darwin*)\n  # if libdl is installed we need to link against it\n    echo \"$as_me:$LINENO: checking for dlopen in -ldl\" >&5\necho $ECHO_N \"checking for dlopen in -ldl... $ECHO_C\" >&6\nif test \"${ac_cv_lib_dl_dlopen+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-ldl  $LIBS\"\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\n/* Override any gcc2 internal prototype to avoid an error.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\n/* We use char because int might match the return type of a gcc2\n   builtin and then its argument prototype would still apply.  */\nchar dlopen ();\nint\nmain ()\n{\ndlopen ();\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_cxx_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_lib_dl_dlopen=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_lib_dl_dlopen=no\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\necho \"$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen\" >&5\necho \"${ECHO_T}$ac_cv_lib_dl_dlopen\" >&6\nif test $ac_cv_lib_dl_dlopen = yes; then\n  lt_cv_dlopen=\"dlopen\" lt_cv_dlopen_libs=\"-ldl\"\nelse\n\n    lt_cv_dlopen=\"dyld\"\n    lt_cv_dlopen_libs=\n    lt_cv_dlopen_self=yes\n\nfi\n\n   ;;\n\n  *)\n    echo \"$as_me:$LINENO: checking for shl_load\" >&5\necho $ECHO_N \"checking for shl_load... $ECHO_C\" >&6\nif test \"${ac_cv_func_shl_load+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.\n   For example, HP-UX 11i <limits.h> declares gettimeofday.  */\n#define shl_load innocuous_shl_load\n\n/* System header to define __stub macros and hopefully few prototypes,\n    which can conflict with char shl_load (); below.\n    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since\n    <limits.h> exists even on freestanding compilers.  */\n\n#ifdef __STDC__\n# include <limits.h>\n#else\n# include <assert.h>\n#endif\n\n#undef shl_load\n\n/* Override any gcc2 internal prototype to avoid an error.  */\n#ifdef __cplusplus\nextern \"C\"\n{\n#endif\n/* We use char because int might match the return type of a gcc2\n   builtin and then its argument prototype would still apply.  */\nchar shl_load ();\n/* The GNU C library defines this for functions which it implements\n    to always fail with ENOSYS.  Some functions are actually named\n    something starting with __ and the normal name is an alias.  */\n#if defined (__stub_shl_load) || defined (__stub___shl_load)\nchoke me\n#else\nchar (*f) () = shl_load;\n#endif\n#ifdef __cplusplus\n}\n#endif\n\nint\nmain ()\n{\nreturn f != shl_load;\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_cxx_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_func_shl_load=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_func_shl_load=no\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nfi\necho \"$as_me:$LINENO: result: $ac_cv_func_shl_load\" >&5\necho \"${ECHO_T}$ac_cv_func_shl_load\" >&6\nif test $ac_cv_func_shl_load = yes; then\n  lt_cv_dlopen=\"shl_load\"\nelse\n  echo \"$as_me:$LINENO: checking for shl_load in -ldld\" >&5\necho $ECHO_N \"checking for shl_load in -ldld... $ECHO_C\" >&6\nif test \"${ac_cv_lib_dld_shl_load+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-ldld  $LIBS\"\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\n/* Override any gcc2 internal prototype to avoid an error.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\n/* We use char because int might match the return type of a gcc2\n   builtin and then its argument prototype would still apply.  */\nchar shl_load ();\nint\nmain ()\n{\nshl_load ();\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_cxx_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_lib_dld_shl_load=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_lib_dld_shl_load=no\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\necho \"$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load\" >&5\necho \"${ECHO_T}$ac_cv_lib_dld_shl_load\" >&6\nif test $ac_cv_lib_dld_shl_load = yes; then\n  lt_cv_dlopen=\"shl_load\" lt_cv_dlopen_libs=\"-dld\"\nelse\n  echo \"$as_me:$LINENO: checking for dlopen\" >&5\necho $ECHO_N \"checking for dlopen... $ECHO_C\" >&6\nif test \"${ac_cv_func_dlopen+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.\n   For example, HP-UX 11i <limits.h> declares gettimeofday.  */\n#define dlopen innocuous_dlopen\n\n/* System header to define __stub macros and hopefully few prototypes,\n    which can conflict with char dlopen (); below.\n    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since\n    <limits.h> exists even on freestanding compilers.  */\n\n#ifdef __STDC__\n# include <limits.h>\n#else\n# include <assert.h>\n#endif\n\n#undef dlopen\n\n/* Override any gcc2 internal prototype to avoid an error.  */\n#ifdef __cplusplus\nextern \"C\"\n{\n#endif\n/* We use char because int might match the return type of a gcc2\n   builtin and then its argument prototype would still apply.  */\nchar dlopen ();\n/* The GNU C library defines this for functions which it implements\n    to always fail with ENOSYS.  Some functions are actually named\n    something starting with __ and the normal name is an alias.  */\n#if defined (__stub_dlopen) || defined (__stub___dlopen)\nchoke me\n#else\nchar (*f) () = dlopen;\n#endif\n#ifdef __cplusplus\n}\n#endif\n\nint\nmain ()\n{\nreturn f != dlopen;\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_cxx_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_func_dlopen=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_func_dlopen=no\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nfi\necho \"$as_me:$LINENO: result: $ac_cv_func_dlopen\" >&5\necho \"${ECHO_T}$ac_cv_func_dlopen\" >&6\nif test $ac_cv_func_dlopen = yes; then\n  lt_cv_dlopen=\"dlopen\"\nelse\n  echo \"$as_me:$LINENO: checking for dlopen in -ldl\" >&5\necho $ECHO_N \"checking for dlopen in -ldl... $ECHO_C\" >&6\nif test \"${ac_cv_lib_dl_dlopen+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-ldl  $LIBS\"\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\n/* Override any gcc2 internal prototype to avoid an error.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\n/* We use char because int might match the return type of a gcc2\n   builtin and then its argument prototype would still apply.  */\nchar dlopen ();\nint\nmain ()\n{\ndlopen ();\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_cxx_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_lib_dl_dlopen=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_lib_dl_dlopen=no\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\necho \"$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen\" >&5\necho \"${ECHO_T}$ac_cv_lib_dl_dlopen\" >&6\nif test $ac_cv_lib_dl_dlopen = yes; then\n  lt_cv_dlopen=\"dlopen\" lt_cv_dlopen_libs=\"-ldl\"\nelse\n  echo \"$as_me:$LINENO: checking for dlopen in -lsvld\" >&5\necho $ECHO_N \"checking for dlopen in -lsvld... $ECHO_C\" >&6\nif test \"${ac_cv_lib_svld_dlopen+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-lsvld  $LIBS\"\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\n/* Override any gcc2 internal prototype to avoid an error.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\n/* We use char because int might match the return type of a gcc2\n   builtin and then its argument prototype would still apply.  */\nchar dlopen ();\nint\nmain ()\n{\ndlopen ();\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_cxx_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_lib_svld_dlopen=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_lib_svld_dlopen=no\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\necho \"$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen\" >&5\necho \"${ECHO_T}$ac_cv_lib_svld_dlopen\" >&6\nif test $ac_cv_lib_svld_dlopen = yes; then\n  lt_cv_dlopen=\"dlopen\" lt_cv_dlopen_libs=\"-lsvld\"\nelse\n  echo \"$as_me:$LINENO: checking for dld_link in -ldld\" >&5\necho $ECHO_N \"checking for dld_link in -ldld... $ECHO_C\" >&6\nif test \"${ac_cv_lib_dld_dld_link+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-ldld  $LIBS\"\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\n/* Override any gcc2 internal prototype to avoid an error.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\n/* We use char because int might match the return type of a gcc2\n   builtin and then its argument prototype would still apply.  */\nchar dld_link ();\nint\nmain ()\n{\ndld_link ();\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_cxx_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_lib_dld_dld_link=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_lib_dld_dld_link=no\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\necho \"$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link\" >&5\necho \"${ECHO_T}$ac_cv_lib_dld_dld_link\" >&6\nif test $ac_cv_lib_dld_dld_link = yes; then\n  lt_cv_dlopen=\"dld_link\" lt_cv_dlopen_libs=\"-dld\"\nfi\n\n\nfi\n\n\nfi\n\n\nfi\n\n\nfi\n\n\nfi\n\n    ;;\n  esac\n\n  if test \"x$lt_cv_dlopen\" != xno; then\n    enable_dlopen=yes\n  else\n    enable_dlopen=no\n  fi\n\n  case $lt_cv_dlopen in\n  dlopen)\n    save_CPPFLAGS=\"$CPPFLAGS\"\n    test \"x$ac_cv_header_dlfcn_h\" = xyes && CPPFLAGS=\"$CPPFLAGS -DHAVE_DLFCN_H\"\n\n    save_LDFLAGS=\"$LDFLAGS\"\n    eval LDFLAGS=\\\"\\$LDFLAGS $export_dynamic_flag_spec\\\"\n\n    save_LIBS=\"$LIBS\"\n    LIBS=\"$lt_cv_dlopen_libs $LIBS\"\n\n    echo \"$as_me:$LINENO: checking whether a program can dlopen itself\" >&5\necho $ECHO_N \"checking whether a program can dlopen itself... $ECHO_C\" >&6\nif test \"${lt_cv_dlopen_self+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  \t  if test \"$cross_compiling\" = yes; then :\n  lt_cv_dlopen_self=cross\nelse\n  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2\n  lt_status=$lt_dlunknown\n  cat > conftest.$ac_ext <<EOF\n#line 13607 \"configure\"\n#include \"confdefs.h\"\n\n#if HAVE_DLFCN_H\n#include <dlfcn.h>\n#endif\n\n#include <stdio.h>\n\n#ifdef RTLD_GLOBAL\n#  define LT_DLGLOBAL\t\tRTLD_GLOBAL\n#else\n#  ifdef DL_GLOBAL\n#    define LT_DLGLOBAL\t\tDL_GLOBAL\n#  else\n#    define LT_DLGLOBAL\t\t0\n#  endif\n#endif\n\n/* We may have to define LT_DLLAZY_OR_NOW in the command line if we\n   find out it does not work in some platform. */\n#ifndef LT_DLLAZY_OR_NOW\n#  ifdef RTLD_LAZY\n#    define LT_DLLAZY_OR_NOW\t\tRTLD_LAZY\n#  else\n#    ifdef DL_LAZY\n#      define LT_DLLAZY_OR_NOW\t\tDL_LAZY\n#    else\n#      ifdef RTLD_NOW\n#        define LT_DLLAZY_OR_NOW\tRTLD_NOW\n#      else\n#        ifdef DL_NOW\n#          define LT_DLLAZY_OR_NOW\tDL_NOW\n#        else\n#          define LT_DLLAZY_OR_NOW\t0\n#        endif\n#      endif\n#    endif\n#  endif\n#endif\n\n#ifdef __cplusplus\nextern \"C\" void exit (int);\n#endif\n\nvoid fnord() { int i=42;}\nint main ()\n{\n  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);\n  int status = $lt_dlunknown;\n\n  if (self)\n    {\n      if (dlsym (self,\"fnord\"))       status = $lt_dlno_uscore;\n      else if (dlsym( self,\"_fnord\")) status = $lt_dlneed_uscore;\n      /* dlclose (self); */\n    }\n\n    exit (status);\n}\nEOF\n  if { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then\n    (./conftest; exit; ) 2>/dev/null\n    lt_status=$?\n    case x$lt_status in\n      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;\n      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;\n      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;\n    esac\n  else :\n    # compilation failed\n    lt_cv_dlopen_self=no\n  fi\nfi\nrm -fr conftest*\n\n\nfi\necho \"$as_me:$LINENO: result: $lt_cv_dlopen_self\" >&5\necho \"${ECHO_T}$lt_cv_dlopen_self\" >&6\n\n    if test \"x$lt_cv_dlopen_self\" = xyes; then\n      LDFLAGS=\"$LDFLAGS $link_static_flag\"\n      echo \"$as_me:$LINENO: checking whether a statically linked program can dlopen itself\" >&5\necho $ECHO_N \"checking whether a statically linked program can dlopen itself... $ECHO_C\" >&6\nif test \"${lt_cv_dlopen_self_static+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  \t  if test \"$cross_compiling\" = yes; then :\n  lt_cv_dlopen_self_static=cross\nelse\n  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2\n  lt_status=$lt_dlunknown\n  cat > conftest.$ac_ext <<EOF\n#line 13705 \"configure\"\n#include \"confdefs.h\"\n\n#if HAVE_DLFCN_H\n#include <dlfcn.h>\n#endif\n\n#include <stdio.h>\n\n#ifdef RTLD_GLOBAL\n#  define LT_DLGLOBAL\t\tRTLD_GLOBAL\n#else\n#  ifdef DL_GLOBAL\n#    define LT_DLGLOBAL\t\tDL_GLOBAL\n#  else\n#    define LT_DLGLOBAL\t\t0\n#  endif\n#endif\n\n/* We may have to define LT_DLLAZY_OR_NOW in the command line if we\n   find out it does not work in some platform. */\n#ifndef LT_DLLAZY_OR_NOW\n#  ifdef RTLD_LAZY\n#    define LT_DLLAZY_OR_NOW\t\tRTLD_LAZY\n#  else\n#    ifdef DL_LAZY\n#      define LT_DLLAZY_OR_NOW\t\tDL_LAZY\n#    else\n#      ifdef RTLD_NOW\n#        define LT_DLLAZY_OR_NOW\tRTLD_NOW\n#      else\n#        ifdef DL_NOW\n#          define LT_DLLAZY_OR_NOW\tDL_NOW\n#        else\n#          define LT_DLLAZY_OR_NOW\t0\n#        endif\n#      endif\n#    endif\n#  endif\n#endif\n\n#ifdef __cplusplus\nextern \"C\" void exit (int);\n#endif\n\nvoid fnord() { int i=42;}\nint main ()\n{\n  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);\n  int status = $lt_dlunknown;\n\n  if (self)\n    {\n      if (dlsym (self,\"fnord\"))       status = $lt_dlno_uscore;\n      else if (dlsym( self,\"_fnord\")) status = $lt_dlneed_uscore;\n      /* dlclose (self); */\n    }\n\n    exit (status);\n}\nEOF\n  if { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then\n    (./conftest; exit; ) 2>/dev/null\n    lt_status=$?\n    case x$lt_status in\n      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;\n      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;\n      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;\n    esac\n  else :\n    # compilation failed\n    lt_cv_dlopen_self_static=no\n  fi\nfi\nrm -fr conftest*\n\n\nfi\necho \"$as_me:$LINENO: result: $lt_cv_dlopen_self_static\" >&5\necho \"${ECHO_T}$lt_cv_dlopen_self_static\" >&6\n    fi\n\n    CPPFLAGS=\"$save_CPPFLAGS\"\n    LDFLAGS=\"$save_LDFLAGS\"\n    LIBS=\"$save_LIBS\"\n    ;;\n  esac\n\n  case $lt_cv_dlopen_self in\n  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;\n  *) enable_dlopen_self=unknown ;;\n  esac\n\n  case $lt_cv_dlopen_self_static in\n  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;\n  *) enable_dlopen_self_static=unknown ;;\n  esac\nfi\n\n\n# The else clause should only fire when bootstrapping the\n# libtool distribution, otherwise you forgot to ship ltmain.sh\n# with your package, and you will get complaints that there are\n# no rules to generate ltmain.sh.\nif test -f \"$ltmain\"; then\n  # See if we are running on zsh, and set the options which allow our commands through\n  # without removal of \\ escapes.\n  if test -n \"${ZSH_VERSION+set}\" ; then\n    setopt NO_GLOB_SUBST\n  fi\n  # Now quote all the things that may contain metacharacters while being\n  # careful not to overquote the AC_SUBSTed values.  We take copies of the\n  # variables and quote the copies for generation of the libtool script.\n  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \\\n    SED SHELL STRIP \\\n    libname_spec library_names_spec soname_spec extract_expsyms_cmds \\\n    old_striplib striplib file_magic_cmd finish_cmds finish_eval \\\n    deplibs_check_method reload_flag reload_cmds need_locks \\\n    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \\\n    lt_cv_sys_global_symbol_to_c_name_address \\\n    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \\\n    old_postinstall_cmds old_postuninstall_cmds \\\n    compiler_CXX \\\n    CC_CXX \\\n    LD_CXX \\\n    lt_prog_compiler_wl_CXX \\\n    lt_prog_compiler_pic_CXX \\\n    lt_prog_compiler_static_CXX \\\n    lt_prog_compiler_no_builtin_flag_CXX \\\n    export_dynamic_flag_spec_CXX \\\n    thread_safe_flag_spec_CXX \\\n    whole_archive_flag_spec_CXX \\\n    enable_shared_with_static_runtimes_CXX \\\n    old_archive_cmds_CXX \\\n    old_archive_from_new_cmds_CXX \\\n    predep_objects_CXX \\\n    postdep_objects_CXX \\\n    predeps_CXX \\\n    postdeps_CXX \\\n    compiler_lib_search_path_CXX \\\n    archive_cmds_CXX \\\n    archive_expsym_cmds_CXX \\\n    postinstall_cmds_CXX \\\n    postuninstall_cmds_CXX \\\n    old_archive_from_expsyms_cmds_CXX \\\n    allow_undefined_flag_CXX \\\n    no_undefined_flag_CXX \\\n    export_symbols_cmds_CXX \\\n    hardcode_libdir_flag_spec_CXX \\\n    hardcode_libdir_flag_spec_ld_CXX \\\n    hardcode_libdir_separator_CXX \\\n    hardcode_automatic_CXX \\\n    module_cmds_CXX \\\n    module_expsym_cmds_CXX \\\n    lt_cv_prog_compiler_c_o_CXX \\\n    exclude_expsyms_CXX \\\n    include_expsyms_CXX; do\n\n    case $var in\n    old_archive_cmds_CXX | \\\n    old_archive_from_new_cmds_CXX | \\\n    archive_cmds_CXX | \\\n    archive_expsym_cmds_CXX | \\\n    module_cmds_CXX | \\\n    module_expsym_cmds_CXX | \\\n    old_archive_from_expsyms_cmds_CXX | \\\n    export_symbols_cmds_CXX | \\\n    extract_expsyms_cmds | reload_cmds | finish_cmds | \\\n    postinstall_cmds | postuninstall_cmds | \\\n    old_postinstall_cmds | old_postuninstall_cmds | \\\n    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)\n      # Double-quote double-evaled strings.\n      eval \"lt_$var=\\\\\\\"\\`\\$echo \\\"X\\$$var\\\" | \\$Xsed -e \\\"\\$double_quote_subst\\\" -e \\\"\\$sed_quote_subst\\\" -e \\\"\\$delay_variable_subst\\\"\\`\\\\\\\"\"\n      ;;\n    *)\n      eval \"lt_$var=\\\\\\\"\\`\\$echo \\\"X\\$$var\\\" | \\$Xsed -e \\\"\\$sed_quote_subst\\\"\\`\\\\\\\"\"\n      ;;\n    esac\n  done\n\n  case $lt_echo in\n  *'\\$0 --fallback-echo\"')\n    lt_echo=`$echo \"X$lt_echo\" | $Xsed -e 's/\\\\\\\\\\\\\\$0 --fallback-echo\"$/$0 --fallback-echo\"/'`\n    ;;\n  esac\n\ncfgfile=\"$ofile\"\n\n  cat <<__EOF__ >> \"$cfgfile\"\n# ### BEGIN LIBTOOL TAG CONFIG: $tagname\n\n# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:\n\n# Shell to use when invoking shell scripts.\nSHELL=$lt_SHELL\n\n# Whether or not to build shared libraries.\nbuild_libtool_libs=$enable_shared\n\n# Whether or not to build static libraries.\nbuild_old_libs=$enable_static\n\n# Whether or not to add -lc for building shared libraries.\nbuild_libtool_need_lc=$archive_cmds_need_lc_CXX\n\n# Whether or not to disallow shared libs when runtime libs are static\nallow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX\n\n# Whether or not to optimize for fast installation.\nfast_install=$enable_fast_install\n\n# The host system.\nhost_alias=$host_alias\nhost=$host\n\n# An echo program that does not interpret backslashes.\necho=$lt_echo\n\n# The archiver.\nAR=$lt_AR\nAR_FLAGS=$lt_AR_FLAGS\n\n# A C compiler.\nLTCC=$lt_LTCC\n\n# A language-specific compiler.\nCC=$lt_compiler_CXX\n\n# Is the compiler the GNU C compiler?\nwith_gcc=$GCC_CXX\n\n# An ERE matcher.\nEGREP=$lt_EGREP\n\n# The linker used to build libraries.\nLD=$lt_LD_CXX\n\n# Whether we need hard or soft links.\nLN_S=$lt_LN_S\n\n# A BSD-compatible nm program.\nNM=$lt_NM\n\n# A symbol stripping program\nSTRIP=$lt_STRIP\n\n# Used to examine libraries when file_magic_cmd begins \"file\"\nMAGIC_CMD=$MAGIC_CMD\n\n# Used on cygwin: DLL creation program.\nDLLTOOL=\"$DLLTOOL\"\n\n# Used on cygwin: object dumper.\nOBJDUMP=\"$OBJDUMP\"\n\n# Used on cygwin: assembler.\nAS=\"$AS\"\n\n# The name of the directory that contains temporary libtool files.\nobjdir=$objdir\n\n# How to create reloadable object files.\nreload_flag=$lt_reload_flag\nreload_cmds=$lt_reload_cmds\n\n# How to pass a linker flag through the compiler.\nwl=$lt_lt_prog_compiler_wl_CXX\n\n# Object file suffix (normally \"o\").\nobjext=\"$ac_objext\"\n\n# Old archive suffix (normally \"a\").\nlibext=\"$libext\"\n\n# Shared library suffix (normally \".so\").\nshrext_cmds='$shrext_cmds'\n\n# Executable file suffix (normally \"\").\nexeext=\"$exeext\"\n\n# Additional compiler flags for building library objects.\npic_flag=$lt_lt_prog_compiler_pic_CXX\npic_mode=$pic_mode\n\n# What is the maximum length of a command?\nmax_cmd_len=$lt_cv_sys_max_cmd_len\n\n# Does compiler simultaneously support -c and -o options?\ncompiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX\n\n# Must we lock files when doing compilation ?\nneed_locks=$lt_need_locks\n\n# Do we need the lib prefix for modules?\nneed_lib_prefix=$need_lib_prefix\n\n# Do we need a version for libraries?\nneed_version=$need_version\n\n# Whether dlopen is supported.\ndlopen_support=$enable_dlopen\n\n# Whether dlopen of programs is supported.\ndlopen_self=$enable_dlopen_self\n\n# Whether dlopen of statically linked programs is supported.\ndlopen_self_static=$enable_dlopen_self_static\n\n# Compiler flag to prevent dynamic linking.\nlink_static_flag=$lt_lt_prog_compiler_static_CXX\n\n# Compiler flag to turn off builtin functions.\nno_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX\n\n# Compiler flag to allow reflexive dlopens.\nexport_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX\n\n# Compiler flag to generate shared objects directly from archives.\nwhole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX\n\n# Compiler flag to generate thread-safe objects.\nthread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX\n\n# Library versioning type.\nversion_type=$version_type\n\n# Format of library name prefix.\nlibname_spec=$lt_libname_spec\n\n# List of archive names.  First name is the real one, the rest are links.\n# The last name is the one that the linker finds with -lNAME.\nlibrary_names_spec=$lt_library_names_spec\n\n# The coded name of the library, if different from the real name.\nsoname_spec=$lt_soname_spec\n\n# Commands used to build and install an old-style archive.\nRANLIB=$lt_RANLIB\nold_archive_cmds=$lt_old_archive_cmds_CXX\nold_postinstall_cmds=$lt_old_postinstall_cmds\nold_postuninstall_cmds=$lt_old_postuninstall_cmds\n\n# Create an old-style archive from a shared archive.\nold_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX\n\n# Create a temporary old-style archive to link instead of a shared archive.\nold_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX\n\n# Commands used to build and install a shared archive.\narchive_cmds=$lt_archive_cmds_CXX\narchive_expsym_cmds=$lt_archive_expsym_cmds_CXX\npostinstall_cmds=$lt_postinstall_cmds\npostuninstall_cmds=$lt_postuninstall_cmds\n\n# Commands used to build a loadable module (assumed same as above if empty)\nmodule_cmds=$lt_module_cmds_CXX\nmodule_expsym_cmds=$lt_module_expsym_cmds_CXX\n\n# Commands to strip libraries.\nold_striplib=$lt_old_striplib\nstriplib=$lt_striplib\n\n# Dependencies to place before the objects being linked to create a\n# shared library.\npredep_objects=$lt_predep_objects_CXX\n\n# Dependencies to place after the objects being linked to create a\n# shared library.\npostdep_objects=$lt_postdep_objects_CXX\n\n# Dependencies to place before the objects being linked to create a\n# shared library.\npredeps=$lt_predeps_CXX\n\n# Dependencies to place after the objects being linked to create a\n# shared library.\npostdeps=$lt_postdeps_CXX\n\n# The library search path used internally by the compiler when linking\n# a shared library.\ncompiler_lib_search_path=$lt_compiler_lib_search_path_CXX\n\n# Method to check whether dependent libraries are shared objects.\ndeplibs_check_method=$lt_deplibs_check_method\n\n# Command to use when deplibs_check_method == file_magic.\nfile_magic_cmd=$lt_file_magic_cmd\n\n# Flag that allows shared libraries with undefined symbols to be built.\nallow_undefined_flag=$lt_allow_undefined_flag_CXX\n\n# Flag that forces no undefined symbols.\nno_undefined_flag=$lt_no_undefined_flag_CXX\n\n# Commands used to finish a libtool library installation in a directory.\nfinish_cmds=$lt_finish_cmds\n\n# Same as above, but a single script fragment to be evaled but not shown.\nfinish_eval=$lt_finish_eval\n\n# Take the output of nm and produce a listing of raw symbols and C names.\nglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe\n\n# Transform the output of nm in a proper C declaration\nglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl\n\n# Transform the output of nm in a C name address pair\nglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address\n\n# This is the shared library runtime path variable.\nrunpath_var=$runpath_var\n\n# This is the shared library path variable.\nshlibpath_var=$shlibpath_var\n\n# Is shlibpath searched before the hard-coded library search path?\nshlibpath_overrides_runpath=$shlibpath_overrides_runpath\n\n# How to hardcode a shared library path into an executable.\nhardcode_action=$hardcode_action_CXX\n\n# Whether we should hardcode library paths into libraries.\nhardcode_into_libs=$hardcode_into_libs\n\n# Flag to hardcode \\$libdir into a binary during linking.\n# This must work even if \\$libdir does not exist.\nhardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX\n\n# If ld is used when linking, flag to hardcode \\$libdir into\n# a binary during linking. This must work even if \\$libdir does\n# not exist.\nhardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX\n\n# Whether we need a single -rpath flag with a separated argument.\nhardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX\n\n# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the\n# resulting binary.\nhardcode_direct=$hardcode_direct_CXX\n\n# Set to yes if using the -LDIR flag during linking hardcodes DIR into the\n# resulting binary.\nhardcode_minus_L=$hardcode_minus_L_CXX\n\n# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into\n# the resulting binary.\nhardcode_shlibpath_var=$hardcode_shlibpath_var_CXX\n\n# Set to yes if building a shared library automatically hardcodes DIR into the library\n# and all subsequent libraries and executables linked against it.\nhardcode_automatic=$hardcode_automatic_CXX\n\n# Variables whose values should be saved in libtool wrapper scripts and\n# restored at relink time.\nvariables_saved_for_relink=\"$variables_saved_for_relink\"\n\n# Whether libtool must link a program against all its dependency libraries.\nlink_all_deplibs=$link_all_deplibs_CXX\n\n# Compile-time system search path for libraries\nsys_lib_search_path_spec=$lt_sys_lib_search_path_spec\n\n# Run-time system search path for libraries\nsys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec\n\n# Fix the shell variable \\$srcfile for the compiler.\nfix_srcfile_path=\"$fix_srcfile_path_CXX\"\n\n# Set to yes if exported symbols are required.\nalways_export_symbols=$always_export_symbols_CXX\n\n# The commands to list exported symbols.\nexport_symbols_cmds=$lt_export_symbols_cmds_CXX\n\n# The commands to extract the exported symbol list from a shared archive.\nextract_expsyms_cmds=$lt_extract_expsyms_cmds\n\n# Symbols that should not be listed in the preloaded symbols.\nexclude_expsyms=$lt_exclude_expsyms_CXX\n\n# Symbols that must always be exported.\ninclude_expsyms=$lt_include_expsyms_CXX\n\n# ### END LIBTOOL TAG CONFIG: $tagname\n\n__EOF__\n\n\nelse\n  # If there is no Makefile yet, we rely on a make rule to execute\n  # `config.status --recheck' to rerun these tests and create the\n  # libtool script then.\n  ltmain_in=`echo $ltmain | sed -e 's/\\.sh$/.in/'`\n  if test -f \"$ltmain_in\"; then\n    test -f Makefile && make \"$ltmain\"\n  fi\nfi\n\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\nCC=$lt_save_CC\nLDCXX=$LD\nLD=$lt_save_LD\nGCC=$lt_save_GCC\nwith_gnu_ldcxx=$with_gnu_ld\nwith_gnu_ld=$lt_save_with_gnu_ld\nlt_cv_path_LDCXX=$lt_cv_path_LD\nlt_cv_path_LD=$lt_save_path_LD\nlt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld\nlt_cv_prog_gnu_ld=$lt_save_with_gnu_ld\n\n\telse\n\t  tagname=\"\"\n\tfi\n\t;;\n\n      F77)\n\tif test -n \"$F77\" && test \"X$F77\" != \"Xno\"; then\n\nac_ext=f\nac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'\nac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_f77_compiler_gnu\n\n\narchive_cmds_need_lc_F77=no\nallow_undefined_flag_F77=\nalways_export_symbols_F77=no\narchive_expsym_cmds_F77=\nexport_dynamic_flag_spec_F77=\nhardcode_direct_F77=no\nhardcode_libdir_flag_spec_F77=\nhardcode_libdir_flag_spec_ld_F77=\nhardcode_libdir_separator_F77=\nhardcode_minus_L_F77=no\nhardcode_automatic_F77=no\nmodule_cmds_F77=\nmodule_expsym_cmds_F77=\nlink_all_deplibs_F77=unknown\nold_archive_cmds_F77=$old_archive_cmds\nno_undefined_flag_F77=\nwhole_archive_flag_spec_F77=\nenable_shared_with_static_runtimes_F77=no\n\n# Source file extension for f77 test sources.\nac_ext=f\n\n# Object file extension for compiled f77 test sources.\nobjext=o\nobjext_F77=$objext\n\n# Code to be used in simple compile tests\nlt_simple_compile_test_code=\"      subroutine t\\n      return\\n      end\\n\"\n\n# Code to be used in simple link tests\nlt_simple_link_test_code=\"      program t\\n      end\\n\"\n\n# ltmain only uses $CC for tagged configurations so make sure $CC is set.\n\n# If no C compiler was specified, use CC.\nLTCC=${LTCC-\"$CC\"}\n\n# Allow CC to be a program name with arguments.\ncompiler=$CC\n\n\n# Allow CC to be a program name with arguments.\nlt_save_CC=\"$CC\"\nCC=${F77-\"f77\"}\ncompiler=$CC\ncompiler_F77=$CC\ncc_basename=`$echo X\"$compiler\" | $Xsed -e 's%^.*/%%'`\n\necho \"$as_me:$LINENO: checking if libtool supports shared libraries\" >&5\necho $ECHO_N \"checking if libtool supports shared libraries... $ECHO_C\" >&6\necho \"$as_me:$LINENO: result: $can_build_shared\" >&5\necho \"${ECHO_T}$can_build_shared\" >&6\n\necho \"$as_me:$LINENO: checking whether to build shared libraries\" >&5\necho $ECHO_N \"checking whether to build shared libraries... $ECHO_C\" >&6\ntest \"$can_build_shared\" = \"no\" && enable_shared=no\n\n# On AIX, shared libraries and static libraries use the same namespace, and\n# are all built from PIC.\ncase \"$host_os\" in\naix3*)\n  test \"$enable_shared\" = yes && enable_static=no\n  if test -n \"$RANLIB\"; then\n    archive_cmds=\"$archive_cmds~\\$RANLIB \\$lib\"\n    postinstall_cmds='$RANLIB $lib'\n  fi\n  ;;\naix4* | aix5*)\n  test \"$enable_shared\" = yes && enable_static=no\n  ;;\nesac\necho \"$as_me:$LINENO: result: $enable_shared\" >&5\necho \"${ECHO_T}$enable_shared\" >&6\n\necho \"$as_me:$LINENO: checking whether to build static libraries\" >&5\necho $ECHO_N \"checking whether to build static libraries... $ECHO_C\" >&6\n# Make sure either enable_shared or enable_static is yes.\ntest \"$enable_shared\" = yes || enable_static=yes\necho \"$as_me:$LINENO: result: $enable_static\" >&5\necho \"${ECHO_T}$enable_static\" >&6\n\ntest \"$ld_shlibs_F77\" = no && can_build_shared=no\n\nGCC_F77=\"$G77\"\nLD_F77=\"$LD\"\n\nlt_prog_compiler_wl_F77=\nlt_prog_compiler_pic_F77=\nlt_prog_compiler_static_F77=\n\necho \"$as_me:$LINENO: checking for $compiler option to produce PIC\" >&5\necho $ECHO_N \"checking for $compiler option to produce PIC... $ECHO_C\" >&6\n\n  if test \"$GCC\" = yes; then\n    lt_prog_compiler_wl_F77='-Wl,'\n    lt_prog_compiler_static_F77='-static'\n\n    case $host_os in\n      aix*)\n      # All AIX code is PIC.\n      if test \"$host_cpu\" = ia64; then\n\t# AIX 5 now supports IA64 processor\n\tlt_prog_compiler_static_F77='-Bstatic'\n      fi\n      ;;\n\n    amigaos*)\n      # FIXME: we need at least 68020 code to build shared libraries, but\n      # adding the `-m68020' flag to GCC prevents building anything better,\n      # like `-m68040'.\n      lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'\n      ;;\n\n    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)\n      # PIC is the default for these OSes.\n      ;;\n\n    mingw* | pw32* | os2*)\n      # This hack is so that the source file can tell whether it is being\n      # built for inclusion in a dll (and should export symbols for example).\n      lt_prog_compiler_pic_F77='-DDLL_EXPORT'\n      ;;\n\n    darwin* | rhapsody*)\n      # PIC is the default on this platform\n      # Common symbols not allowed in MH_DYLIB files\n      lt_prog_compiler_pic_F77='-fno-common'\n      ;;\n\n    msdosdjgpp*)\n      # Just because we use GCC doesn't mean we suddenly get shared libraries\n      # on systems that don't support them.\n      lt_prog_compiler_can_build_shared_F77=no\n      enable_shared=no\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\tlt_prog_compiler_pic_F77=-Kconform_pic\n      fi\n      ;;\n\n    hpux*)\n      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but\n      # not for PA HP-UX.\n      case \"$host_cpu\" in\n      hppa*64*|ia64*)\n\t# +Z the default\n\t;;\n      *)\n\tlt_prog_compiler_pic_F77='-fPIC'\n\t;;\n      esac\n      ;;\n\n    *)\n      lt_prog_compiler_pic_F77='-fPIC'\n      ;;\n    esac\n  else\n    # PORTME Check for flag to pass linker flags through the system compiler.\n    case $host_os in\n    aix*)\n      lt_prog_compiler_wl_F77='-Wl,'\n      if test \"$host_cpu\" = ia64; then\n\t# AIX 5 now supports IA64 processor\n\tlt_prog_compiler_static_F77='-Bstatic'\n      else\n\tlt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'\n      fi\n      ;;\n\n    mingw* | pw32* | os2*)\n      # This hack is so that the source file can tell whether it is being\n      # built for inclusion in a dll (and should export symbols for example).\n      lt_prog_compiler_pic_F77='-DDLL_EXPORT'\n      ;;\n\n    hpux9* | hpux10* | hpux11*)\n      lt_prog_compiler_wl_F77='-Wl,'\n      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but\n      # not for PA HP-UX.\n      case \"$host_cpu\" in\n      hppa*64*|ia64*)\n\t# +Z the default\n\t;;\n      *)\n\tlt_prog_compiler_pic_F77='+Z'\n\t;;\n      esac\n      # Is there a better lt_prog_compiler_static that works with the bundled CC?\n      lt_prog_compiler_static_F77='${wl}-a ${wl}archive'\n      ;;\n\n    irix5* | irix6* | nonstopux*)\n      lt_prog_compiler_wl_F77='-Wl,'\n      # PIC (with -KPIC) is the default.\n      lt_prog_compiler_static_F77='-non_shared'\n      ;;\n\n    newsos6)\n      lt_prog_compiler_pic_F77='-KPIC'\n      lt_prog_compiler_static_F77='-Bstatic'\n      ;;\n\n    linux*)\n      case $CC in\n      icc* | ecc*)\n\tlt_prog_compiler_wl_F77='-Wl,'\n\tlt_prog_compiler_pic_F77='-KPIC'\n\tlt_prog_compiler_static_F77='-static'\n        ;;\n      ccc*)\n        lt_prog_compiler_wl_F77='-Wl,'\n        # All Alpha code is PIC.\n        lt_prog_compiler_static_F77='-non_shared'\n        ;;\n      esac\n      ;;\n\n    osf3* | osf4* | osf5*)\n      lt_prog_compiler_wl_F77='-Wl,'\n      # All OSF/1 code is PIC.\n      lt_prog_compiler_static_F77='-non_shared'\n      ;;\n\n    sco3.2v5*)\n      lt_prog_compiler_pic_F77='-Kpic'\n      lt_prog_compiler_static_F77='-dn'\n      ;;\n\n    solaris*)\n      lt_prog_compiler_wl_F77='-Wl,'\n      lt_prog_compiler_pic_F77='-KPIC'\n      lt_prog_compiler_static_F77='-Bstatic'\n      ;;\n\n    sunos4*)\n      lt_prog_compiler_wl_F77='-Qoption ld '\n      lt_prog_compiler_pic_F77='-PIC'\n      lt_prog_compiler_static_F77='-Bstatic'\n      ;;\n\n    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)\n      lt_prog_compiler_wl_F77='-Wl,'\n      lt_prog_compiler_pic_F77='-KPIC'\n      lt_prog_compiler_static_F77='-Bstatic'\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec ;then\n\tlt_prog_compiler_pic_F77='-Kconform_pic'\n\tlt_prog_compiler_static_F77='-Bstatic'\n      fi\n      ;;\n\n    uts4*)\n      lt_prog_compiler_pic_F77='-pic'\n      lt_prog_compiler_static_F77='-Bstatic'\n      ;;\n\n    *)\n      lt_prog_compiler_can_build_shared_F77=no\n      ;;\n    esac\n  fi\n\necho \"$as_me:$LINENO: result: $lt_prog_compiler_pic_F77\" >&5\necho \"${ECHO_T}$lt_prog_compiler_pic_F77\" >&6\n\n#\n# Check to make sure the PIC flag actually works.\n#\nif test -n \"$lt_prog_compiler_pic_F77\"; then\n\necho \"$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works\" >&5\necho $ECHO_N \"checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C\" >&6\nif test \"${lt_prog_compiler_pic_works_F77+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  lt_prog_compiler_pic_works_F77=no\n  ac_outfile=conftest.$ac_objext\n   printf \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n   lt_compiler_flag=\"$lt_prog_compiler_pic_F77\"\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   # The option is referenced via a variable to avoid confusing sed.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \\\n   -e 's: [^ ]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:14532: $lt_compile\\\"\" >&5)\n   (eval \"$lt_compile\" 2>conftest.err)\n   ac_status=$?\n   cat conftest.err >&5\n   echo \"$as_me:14536: \\$? = $ac_status\" >&5\n   if (exit $ac_status) && test -s \"$ac_outfile\"; then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     if test ! -s conftest.err; then\n       lt_prog_compiler_pic_works_F77=yes\n     fi\n   fi\n   $rm conftest*\n\nfi\necho \"$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77\" >&5\necho \"${ECHO_T}$lt_prog_compiler_pic_works_F77\" >&6\n\nif test x\"$lt_prog_compiler_pic_works_F77\" = xyes; then\n    case $lt_prog_compiler_pic_F77 in\n     \"\" | \" \"*) ;;\n     *) lt_prog_compiler_pic_F77=\" $lt_prog_compiler_pic_F77\" ;;\n     esac\nelse\n    lt_prog_compiler_pic_F77=\n     lt_prog_compiler_can_build_shared_F77=no\nfi\n\nfi\ncase \"$host_os\" in\n  # For platforms which do not support PIC, -DPIC is meaningless:\n  *djgpp*)\n    lt_prog_compiler_pic_F77=\n    ;;\n  *)\n    lt_prog_compiler_pic_F77=\"$lt_prog_compiler_pic_F77\"\n    ;;\nesac\n\necho \"$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext\" >&5\necho $ECHO_N \"checking if $compiler supports -c -o file.$ac_objext... $ECHO_C\" >&6\nif test \"${lt_cv_prog_compiler_c_o_F77+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  lt_cv_prog_compiler_c_o_F77=no\n   $rm -r conftest 2>/dev/null\n   mkdir conftest\n   cd conftest\n   mkdir out\n   printf \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n\n   lt_compiler_flag=\"-o out/conftest2.$ac_objext\"\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \\\n   -e 's: [^ ]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:14592: $lt_compile\\\"\" >&5)\n   (eval \"$lt_compile\" 2>out/conftest.err)\n   ac_status=$?\n   cat out/conftest.err >&5\n   echo \"$as_me:14596: \\$? = $ac_status\" >&5\n   if (exit $ac_status) && test -s out/conftest2.$ac_objext\n   then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     if test ! -s out/conftest.err; then\n       lt_cv_prog_compiler_c_o_F77=yes\n     fi\n   fi\n   chmod u+w .\n   $rm conftest*\n   # SGI C++ compiler will create directory out/ii_files/ for\n   # template instantiation\n   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files\n   $rm out/* && rmdir out\n   cd ..\n   rmdir conftest\n   $rm conftest*\n\nfi\necho \"$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77\" >&5\necho \"${ECHO_T}$lt_cv_prog_compiler_c_o_F77\" >&6\n\n\nhard_links=\"nottested\"\nif test \"$lt_cv_prog_compiler_c_o_F77\" = no && test \"$need_locks\" != no; then\n  # do not overwrite the value of need_locks provided by the user\n  echo \"$as_me:$LINENO: checking if we can lock with hard links\" >&5\necho $ECHO_N \"checking if we can lock with hard links... $ECHO_C\" >&6\n  hard_links=yes\n  $rm conftest*\n  ln conftest.a conftest.b 2>/dev/null && hard_links=no\n  touch conftest.a\n  ln conftest.a conftest.b 2>&5 || hard_links=no\n  ln conftest.a conftest.b 2>/dev/null && hard_links=no\n  echo \"$as_me:$LINENO: result: $hard_links\" >&5\necho \"${ECHO_T}$hard_links\" >&6\n  if test \"$hard_links\" = no; then\n    { echo \"$as_me:$LINENO: WARNING: \\`$CC' does not support \\`-c -o', so \\`make -j' may be unsafe\" >&5\necho \"$as_me: WARNING: \\`$CC' does not support \\`-c -o', so \\`make -j' may be unsafe\" >&2;}\n    need_locks=warn\n  fi\nelse\n  need_locks=no\nfi\n\necho \"$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries\" >&5\necho $ECHO_N \"checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C\" >&6\n\n  runpath_var=\n  allow_undefined_flag_F77=\n  enable_shared_with_static_runtimes_F77=no\n  archive_cmds_F77=\n  archive_expsym_cmds_F77=\n  old_archive_From_new_cmds_F77=\n  old_archive_from_expsyms_cmds_F77=\n  export_dynamic_flag_spec_F77=\n  whole_archive_flag_spec_F77=\n  thread_safe_flag_spec_F77=\n  hardcode_libdir_flag_spec_F77=\n  hardcode_libdir_flag_spec_ld_F77=\n  hardcode_libdir_separator_F77=\n  hardcode_direct_F77=no\n  hardcode_minus_L_F77=no\n  hardcode_shlibpath_var_F77=unsupported\n  link_all_deplibs_F77=unknown\n  hardcode_automatic_F77=no\n  module_cmds_F77=\n  module_expsym_cmds_F77=\n  always_export_symbols_F77=no\n  export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\\''s/.* //'\\'' | sort | uniq > $export_symbols'\n  # include_expsyms should be a list of space-separated symbols to be *always*\n  # included in the symbol list\n  include_expsyms_F77=\n  # exclude_expsyms can be an extended regexp of symbols to exclude\n  # it will be wrapped by ` (' and `)$', so one must not match beginning or\n  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',\n  # as well as any symbol that contains `d'.\n  exclude_expsyms_F77=\"_GLOBAL_OFFSET_TABLE_\"\n  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out\n  # platforms (ab)use it in PIC code, but their linkers get confused if\n  # the symbol is explicitly referenced.  Since portable code cannot\n  # rely on this symbol name, it's probably fine to never include it in\n  # preloaded symbol tables.\n  extract_expsyms_cmds=\n\n  case $host_os in\n  cygwin* | mingw* | pw32*)\n    # FIXME: the MSVC++ port hasn't been tested in a loooong time\n    # When not using gcc, we currently assume that we are using\n    # Microsoft Visual C++.\n    if test \"$GCC\" != yes; then\n      with_gnu_ld=no\n    fi\n    ;;\n  openbsd*)\n    with_gnu_ld=no\n    ;;\n  esac\n\n  ld_shlibs_F77=yes\n  if test \"$with_gnu_ld\" = yes; then\n    # If archive_cmds runs LD, not CC, wlarc should be empty\n    wlarc='${wl}'\n\n    # See if GNU ld supports shared libraries.\n    case $host_os in\n    aix3* | aix4* | aix5*)\n      # On AIX/PPC, the GNU linker is very broken\n      if test \"$host_cpu\" != ia64; then\n\tld_shlibs_F77=no\n\tcat <<EOF 1>&2\n\n*** Warning: the GNU linker, at least up to release 2.9.1, is reported\n*** to be unable to reliably create shared libraries on AIX.\n*** Therefore, libtool is disabling shared libraries support.  If you\n*** really care for shared libraries, you may want to modify your PATH\n*** so that a non-GNU linker is found, and then restart.\n\nEOF\n      fi\n      ;;\n\n    amigaos*)\n      archive_cmds_F77='$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)'\n      hardcode_libdir_flag_spec_F77='-L$libdir'\n      hardcode_minus_L_F77=yes\n\n      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports\n      # that the semantics of dynamic libraries on AmigaOS, at least up\n      # to version 4, is to share data among multiple programs linked\n      # with the same dynamic library.  Since this doesn't match the\n      # behavior of shared libraries on other platforms, we can't use\n      # them.\n      ld_shlibs_F77=no\n      ;;\n\n    beos*)\n      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then\n\tallow_undefined_flag_F77=unsupported\n\t# Joseph Beckenbach <jrb3@best.com> says some releases of gcc\n\t# support --undefined.  This deserves some investigation.  FIXME\n\tarchive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'\n      else\n\tld_shlibs_F77=no\n      fi\n      ;;\n\n    cygwin* | mingw* | pw32*)\n      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,\n      # as there is no search path for DLLs.\n      hardcode_libdir_flag_spec_F77='-L$libdir'\n      allow_undefined_flag_F77=unsupported\n      always_export_symbols_F77=no\n      enable_shared_with_static_runtimes_F77=yes\n      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\\''/^[BCDGS] /s/.* \\([^ ]*\\)/\\1 DATA/'\\'' | $SED -e '\\''/^[AITW] /s/.* //'\\'' | sort | uniq > $export_symbols'\n\n      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then\n        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'\n\t# If the export-symbols file already is a .def file (1st line\n\t# is EXPORTS), use it as is; otherwise, prepend...\n\tarchive_expsym_cmds_F77='if test \"x`$SED 1q $export_symbols`\" = xEXPORTS; then\n\t  cp $export_symbols $output_objdir/$soname.def;\n\telse\n\t  echo EXPORTS > $output_objdir/$soname.def;\n\t  cat $export_symbols >> $output_objdir/$soname.def;\n\tfi~\n\t$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'\n      else\n\tld_shlibs=no\n      fi\n      ;;\n\n    netbsd*)\n      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then\n\tarchive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'\n\twlarc=\n      else\n\tarchive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'\n\tarchive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'\n      fi\n      ;;\n\n    solaris* | sysv5*)\n      if $LD -v 2>&1 | grep 'BFD 2\\.8' > /dev/null; then\n\tld_shlibs_F77=no\n\tcat <<EOF 1>&2\n\n*** Warning: The releases 2.8.* of the GNU linker cannot reliably\n*** create shared libraries on Solaris systems.  Therefore, libtool\n*** is disabling shared libraries support.  We urge you to upgrade GNU\n*** binutils to release 2.9.1 or newer.  Another option is to modify\n*** your PATH or compiler configuration so that the native linker is\n*** used, and then restart.\n\nEOF\n      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then\n\tarchive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'\n\tarchive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'\n      else\n\tld_shlibs_F77=no\n      fi\n      ;;\n\n    sunos4*)\n      archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'\n      wlarc=\n      hardcode_direct_F77=yes\n      hardcode_shlibpath_var_F77=no\n      ;;\n\n  linux*)\n    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then\n        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'\n\tarchive_cmds_F77=\"$tmp_archive_cmds\"\n      supports_anon_versioning=no\n      case `$LD -v 2>/dev/null` in\n        *\\ 01.* | *\\ 2.[0-9].* | *\\ 2.10.*) ;; # catch versions < 2.11\n        *\\ 2.11.93.0.2\\ *) supports_anon_versioning=yes ;; # RH7.3 ...\n        *\\ 2.11.92.0.12\\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...\n        *\\ 2.11.*) ;; # other 2.11 versions\n        *) supports_anon_versioning=yes ;;\n      esac\n      if test $supports_anon_versioning = yes; then\n        archive_expsym_cmds_F77='$echo \"{ global:\" > $output_objdir/$libname.ver~\ncat $export_symbols | sed -e \"s/\\(.*\\)/\\1;/\" >> $output_objdir/$libname.ver~\n$echo \"local: *; };\" >> $output_objdir/$libname.ver~\n        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'\n      else\n        archive_expsym_cmds_F77=\"$tmp_archive_cmds\"\n      fi\n    else\n      ld_shlibs_F77=no\n    fi\n    ;;\n\n    *)\n      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then\n\tarchive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'\n\tarchive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'\n      else\n\tld_shlibs_F77=no\n      fi\n      ;;\n    esac\n\n    if test \"$ld_shlibs_F77\" = yes; then\n      runpath_var=LD_RUN_PATH\n      hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'\n      export_dynamic_flag_spec_F77='${wl}--export-dynamic'\n      # ancient GNU ld didn't support --whole-archive et. al.\n      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then\n \twhole_archive_flag_spec_F77=\"$wlarc\"'--whole-archive$convenience '\"$wlarc\"'--no-whole-archive'\n      else\n  \twhole_archive_flag_spec_F77=\n      fi\n    fi\n  else\n    # PORTME fill in a description of your system's linker (not GNU ld)\n    case $host_os in\n    aix3*)\n      allow_undefined_flag_F77=unsupported\n      always_export_symbols_F77=yes\n      archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'\n      # Note: this linker hardcodes the directories in LIBPATH if there\n      # are no directories specified by -L.\n      hardcode_minus_L_F77=yes\n      if test \"$GCC\" = yes && test -z \"$link_static_flag\"; then\n\t# Neither direct hardcoding nor static linking is supported with a\n\t# broken collect2.\n\thardcode_direct_F77=unsupported\n      fi\n      ;;\n\n    aix4* | aix5*)\n      if test \"$host_cpu\" = ia64; then\n\t# On IA64, the linker does run time linking by default, so we don't\n\t# have to do anything special.\n\taix_use_runtimelinking=no\n\texp_sym_flag='-Bexport'\n\tno_entry_flag=\"\"\n      else\n\t# If we're using GNU nm, then we don't want the \"-C\" option.\n\t# -C means demangle to AIX nm, but means don't demangle with GNU nm\n\tif $NM -V 2>&1 | grep 'GNU' > /dev/null; then\n\t  export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\\''{ if (((\\$2 == \"T\") || (\\$2 == \"D\") || (\\$2 == \"B\")) && (substr(\\$3,1,1) != \".\")) { print \\$3 } }'\\'' | sort -u > $export_symbols'\n\telse\n\t  export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\\''{ if (((\\$2 == \"T\") || (\\$2 == \"D\") || (\\$2 == \"B\")) && (substr(\\$3,1,1) != \".\")) { print \\$3 } }'\\'' | sort -u > $export_symbols'\n\tfi\n\taix_use_runtimelinking=no\n\n\t# Test if we are trying to use run time linking or normal\n\t# AIX style linking. If -brtl is somewhere in LDFLAGS, we\n\t# need to do runtime linking.\n\tcase $host_os in aix4.[23]|aix4.[23].*|aix5*)\n\t  for ld_flag in $LDFLAGS; do\n  \t  if (test $ld_flag = \"-brtl\" || test $ld_flag = \"-Wl,-brtl\"); then\n  \t    aix_use_runtimelinking=yes\n  \t    break\n  \t  fi\n\t  done\n\tesac\n\n\texp_sym_flag='-bexport'\n\tno_entry_flag='-bnoentry'\n      fi\n\n      # When large executables or shared objects are built, AIX ld can\n      # have problems creating the table of contents.  If linking a library\n      # or program results in \"error TOC overflow\" add -mminimal-toc to\n      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not\n      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.\n\n      archive_cmds_F77=''\n      hardcode_direct_F77=yes\n      hardcode_libdir_separator_F77=':'\n      link_all_deplibs_F77=yes\n\n      if test \"$GCC\" = yes; then\n\tcase $host_os in aix4.012|aix4.012.*)\n\t# We only want to do this on AIX 4.2 and lower, the check\n\t# below for broken collect2 doesn't work under 4.3+\n\t  collect2name=`${CC} -print-prog-name=collect2`\n\t  if test -f \"$collect2name\" && \\\n  \t   strings \"$collect2name\" | grep resolve_lib_name >/dev/null\n\t  then\n  \t  # We have reworked collect2\n  \t  hardcode_direct_F77=yes\n\t  else\n  \t  # We have old collect2\n  \t  hardcode_direct_F77=unsupported\n  \t  # It fails to find uninstalled libraries when the uninstalled\n  \t  # path is not listed in the libpath.  Setting hardcode_minus_L\n  \t  # to unsupported forces relinking\n  \t  hardcode_minus_L_F77=yes\n  \t  hardcode_libdir_flag_spec_F77='-L$libdir'\n  \t  hardcode_libdir_separator_F77=\n\t  fi\n\tesac\n\tshared_flag='-shared'\n      else\n\t# not using gcc\n\tif test \"$host_cpu\" = ia64; then\n  \t# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release\n  \t# chokes on -Wl,-G. The following line is correct:\n\t  shared_flag='-G'\n\telse\n  \tif test \"$aix_use_runtimelinking\" = yes; then\n\t    shared_flag='${wl}-G'\n\t  else\n\t    shared_flag='${wl}-bM:SRE'\n  \tfi\n\tfi\n      fi\n\n      # It seems that -bexpall does not export symbols beginning with\n      # underscore (_), so it is better to generate a list of symbols to export.\n      always_export_symbols_F77=yes\n      if test \"$aix_use_runtimelinking\" = yes; then\n\t# Warning - without using the other runtime loading flags (-brtl),\n\t# -berok will link without error, but may produce a broken library.\n\tallow_undefined_flag_F77='-berok'\n       # Determine the default libpath from the value encoded in an empty executable.\n       cat >conftest.$ac_ext <<_ACEOF\n      program main\n\n      end\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_f77_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n\naix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\\(.*\\)$/\\1/; p; }\n}'`\n# Check for a 64-bit object if we didn't find anything.\nif test -z \"$aix_libpath\"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\\(.*\\)$/\\1/; p; }\n}'`; fi\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nif test -z \"$aix_libpath\"; then aix_libpath=\"/usr/lib:/lib\"; fi\n\n       hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'\"$aix_libpath\"\n\tarchive_expsym_cmds_F77=\"\\$CC\"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test \"x${allow_undefined_flag}\" != \"x\"; then echo \"${wl}${allow_undefined_flag}\"; else :; fi` '\"\\${wl}$no_entry_flag \\${wl}$exp_sym_flag:\\$export_symbols $shared_flag\"\n       else\n\tif test \"$host_cpu\" = ia64; then\n\t  hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'\n\t  allow_undefined_flag_F77=\"-z nodefs\"\n\t  archive_expsym_cmds_F77=\"\\$CC $shared_flag\"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '\"\\${wl}$no_entry_flag \\${wl}$exp_sym_flag:\\$export_symbols\"\n\telse\n\t # Determine the default libpath from the value encoded in an empty executable.\n\t cat >conftest.$ac_ext <<_ACEOF\n      program main\n\n      end\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_f77_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n\naix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\\(.*\\)$/\\1/; p; }\n}'`\n# Check for a 64-bit object if we didn't find anything.\nif test -z \"$aix_libpath\"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\\(.*\\)$/\\1/; p; }\n}'`; fi\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nif test -z \"$aix_libpath\"; then aix_libpath=\"/usr/lib:/lib\"; fi\n\n\t hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'\"$aix_libpath\"\n\t  # Warning - without using the other run time loading flags,\n\t  # -berok will link without error, but may produce a broken library.\n\t  no_undefined_flag_F77=' ${wl}-bernotok'\n\t  allow_undefined_flag_F77=' ${wl}-berok'\n\t  # -bexpall does not export symbols beginning with underscore (_)\n\t  always_export_symbols_F77=yes\n\t  # Exported symbols can be pulled into shared objects from archives\n\t  whole_archive_flag_spec_F77=' '\n\t  archive_cmds_need_lc_F77=yes\n\t  # This is similar to how AIX traditionally builds it's shared libraries.\n\t  archive_expsym_cmds_F77=\"\\$CC $shared_flag\"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'\n\tfi\n      fi\n      ;;\n\n    amigaos*)\n      archive_cmds_F77='$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)'\n      hardcode_libdir_flag_spec_F77='-L$libdir'\n      hardcode_minus_L_F77=yes\n      # see comment about different semantics on the GNU ld section\n      ld_shlibs_F77=no\n      ;;\n\n    bsdi4*)\n      export_dynamic_flag_spec_F77=-rdynamic\n      ;;\n\n    cygwin* | mingw* | pw32*)\n      # When not using gcc, we currently assume that we are using\n      # Microsoft Visual C++.\n      # hardcode_libdir_flag_spec is actually meaningless, as there is\n      # no search path for DLLs.\n      hardcode_libdir_flag_spec_F77=' '\n      allow_undefined_flag_F77=unsupported\n      # Tell ltmain to make .lib files, not .a files.\n      libext=lib\n      # Tell ltmain to make .dll files, not .so files.\n      shrext_cmds=\".dll\"\n      # FIXME: Setting linknames here is a bad hack.\n      archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo \"$deplibs\" | $SED -e '\\''s/ -lc$//'\\''` -link -dll~linknames='\n      # The linker will automatically build a .lib file if we build a DLL.\n      old_archive_From_new_cmds_F77='true'\n      # FIXME: Should let the user specify the lib program.\n      old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'\n      fix_srcfile_path='`cygpath -w \"$srcfile\"`'\n      enable_shared_with_static_runtimes_F77=yes\n      ;;\n\n    darwin* | rhapsody*)\n    if test \"$GXX\" = yes ; then\n      archive_cmds_need_lc_F77=no\n      case \"$host_os\" in\n      rhapsody* | darwin1.[012])\n\tallow_undefined_flag_F77='-undefined suppress'\n\t;;\n      *) # Darwin 1.3 on\n      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then\n      \tallow_undefined_flag_F77='-flat_namespace -undefined suppress'\n      else\n        case ${MACOSX_DEPLOYMENT_TARGET} in\n          10.[012])\n            allow_undefined_flag_F77='-flat_namespace -undefined suppress'\n            ;;\n          10.*)\n            allow_undefined_flag_F77='-undefined dynamic_lookup'\n            ;;\n        esac\n      fi\n\t;;\n      esac\n    \tlt_int_apple_cc_single_mod=no\n    \toutput_verbose_link_cmd='echo'\n    \tif $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then\n    \t  lt_int_apple_cc_single_mod=yes\n    \tfi\n    \tif test \"X$lt_int_apple_cc_single_mod\" = Xyes ; then\n    \t  archive_cmds_F77='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'\n    \telse\n        archive_cmds_F77='$CC -r ${wl}-bind_at_load -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'\n      fi\n      module_cmds_F77='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'\n      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's\n        if test \"X$lt_int_apple_cc_single_mod\" = Xyes ; then\n          archive_expsym_cmds_F77='sed -e \"s,#.*,,\" -e \"s,^[    ]*,,\" -e \"s,^\\(..*\\),_&,\" < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'\n        else\n          archive_expsym_cmds_F77='sed -e \"s,#.*,,\" -e \"s,^[    ]*,,\" -e \"s,^\\(..*\\),_&,\" < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'\n        fi\n          module_expsym_cmds_F77='sed -e \"s,#.*,,\" -e \"s,^[    ]*,,\" -e \"s,^\\(..*\\),_&,\" < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'\n      hardcode_direct_F77=no\n      hardcode_automatic_F77=yes\n      hardcode_shlibpath_var_F77=unsupported\n      whole_archive_flag_spec_F77='-all_load $convenience'\n      link_all_deplibs_F77=yes\n    else\n      ld_shlibs_F77=no\n    fi\n      ;;\n\n    dgux*)\n      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_libdir_flag_spec_F77='-L$libdir'\n      hardcode_shlibpath_var_F77=no\n      ;;\n\n    freebsd1*)\n      ld_shlibs_F77=no\n      ;;\n\n    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor\n    # support.  Future versions do this automatically, but an explicit c++rt0.o\n    # does not break anything, and helps significantly (at the cost of a little\n    # extra space).\n    freebsd2.2*)\n      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'\n      hardcode_libdir_flag_spec_F77='-R$libdir'\n      hardcode_direct_F77=yes\n      hardcode_shlibpath_var_F77=no\n      ;;\n\n    # Unfortunately, older versions of FreeBSD 2 do not have this feature.\n    freebsd2*)\n      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_direct_F77=yes\n      hardcode_minus_L_F77=yes\n      hardcode_shlibpath_var_F77=no\n      ;;\n\n    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.\n    freebsd* | kfreebsd*-gnu)\n      archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'\n      hardcode_libdir_flag_spec_F77='-R$libdir'\n      hardcode_direct_F77=yes\n      hardcode_shlibpath_var_F77=no\n      ;;\n\n    hpux9*)\n      if test \"$GCC\" = yes; then\n\tarchive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'\n      else\n\tarchive_cmds_F77='$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'\n      fi\n      hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'\n      hardcode_libdir_separator_F77=:\n      hardcode_direct_F77=yes\n\n      # hardcode_minus_L: Not really in the search PATH,\n      # but as the default location of the library.\n      hardcode_minus_L_F77=yes\n      export_dynamic_flag_spec_F77='${wl}-E'\n      ;;\n\n    hpux10* | hpux11*)\n      if test \"$GCC\" = yes -a \"$with_gnu_ld\" = no; then\n\tcase \"$host_cpu\" in\n\thppa*64*|ia64*)\n\t  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\t*)\n\t  archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\tesac\n      else\n\tcase \"$host_cpu\" in\n\thppa*64*|ia64*)\n\t  archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  ;;\n\t*)\n\t  archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'\n\t  ;;\n\tesac\n      fi\n      if test \"$with_gnu_ld\" = no; then\n\tcase \"$host_cpu\" in\n\thppa*64*)\n\t  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'\n\t  hardcode_libdir_flag_spec_ld_F77='+b $libdir'\n\t  hardcode_libdir_separator_F77=:\n\t  hardcode_direct_F77=no\n\t  hardcode_shlibpath_var_F77=no\n\t  ;;\n\tia64*)\n\t  hardcode_libdir_flag_spec_F77='-L$libdir'\n\t  hardcode_direct_F77=no\n\t  hardcode_shlibpath_var_F77=no\n\n\t  # hardcode_minus_L: Not really in the search PATH,\n\t  # but as the default location of the library.\n\t  hardcode_minus_L_F77=yes\n\t  ;;\n\t*)\n\t  hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'\n\t  hardcode_libdir_separator_F77=:\n\t  hardcode_direct_F77=yes\n\t  export_dynamic_flag_spec_F77='${wl}-E'\n\n\t  # hardcode_minus_L: Not really in the search PATH,\n\t  # but as the default location of the library.\n\t  hardcode_minus_L_F77=yes\n\t  ;;\n\tesac\n      fi\n      ;;\n\n    irix5* | irix6* | nonstopux*)\n      if test \"$GCC\" = yes; then\n\tarchive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n \"$verstring\" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'\n      else\n\tarchive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n \"$verstring\" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'\n\thardcode_libdir_flag_spec_ld_F77='-rpath $libdir'\n      fi\n      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'\n      hardcode_libdir_separator_F77=:\n      link_all_deplibs_F77=yes\n      ;;\n\n    netbsd*)\n      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then\n\tarchive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out\n      else\n\tarchive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF\n      fi\n      hardcode_libdir_flag_spec_F77='-R$libdir'\n      hardcode_direct_F77=yes\n      hardcode_shlibpath_var_F77=no\n      ;;\n\n    newsos6)\n      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_direct_F77=yes\n      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'\n      hardcode_libdir_separator_F77=:\n      hardcode_shlibpath_var_F77=no\n      ;;\n\n    openbsd*)\n      hardcode_direct_F77=yes\n      hardcode_shlibpath_var_F77=no\n      if test -z \"`echo __ELF__ | $CC -E - | grep __ELF__`\" || test \"$host_os-$host_cpu\" = \"openbsd2.8-powerpc\"; then\n\tarchive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n\thardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'\n\texport_dynamic_flag_spec_F77='${wl}-E'\n      else\n       case $host_os in\n\t openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)\n\t   archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'\n\t   hardcode_libdir_flag_spec_F77='-R$libdir'\n\t   ;;\n\t *)\n\t   archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n\t   hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'\n\t   ;;\n       esac\n      fi\n      ;;\n\n    os2*)\n      hardcode_libdir_flag_spec_F77='-L$libdir'\n      hardcode_minus_L_F77=yes\n      allow_undefined_flag_F77=unsupported\n      archive_cmds_F77='$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'\n      old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'\n      ;;\n\n    osf3*)\n      if test \"$GCC\" = yes; then\n\tallow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\\*'\n\tarchive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n \"$verstring\" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'\n      else\n\tallow_undefined_flag_F77=' -expect_unresolved \\*'\n\tarchive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n \"$verstring\" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'\n      fi\n      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'\n      hardcode_libdir_separator_F77=:\n      ;;\n\n    osf4* | osf5*)\t# as osf3* with the addition of -msym flag\n      if test \"$GCC\" = yes; then\n\tallow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\\*'\n\tarchive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n \"$verstring\" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'\n\thardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'\n      else\n\tallow_undefined_flag_F77=' -expect_unresolved \\*'\n\tarchive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n \"$verstring\" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'\n\tarchive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf \"%s %s\\\\n\" -exported_symbol \"\\$i\" >> $lib.exp; done; echo \"-hidden\">> $lib.exp~\n\t$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n \"$verstring\" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'\n\n\t# Both c and cxx compiler support -rpath directly\n\thardcode_libdir_flag_spec_F77='-rpath $libdir'\n      fi\n      hardcode_libdir_separator_F77=:\n      ;;\n\n    sco3.2v5*)\n      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_shlibpath_var_F77=no\n      export_dynamic_flag_spec_F77='${wl}-Bexport'\n      runpath_var=LD_RUN_PATH\n      hardcode_runpath_var=yes\n      ;;\n\n    solaris*)\n      no_undefined_flag_F77=' -z text'\n      if test \"$GCC\" = yes; then\n\tarchive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'\n\tarchive_expsym_cmds_F77='$echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~$echo \"local: *; };\" >> $lib.exp~\n\t  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'\n      else\n\tarchive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\tarchive_expsym_cmds_F77='$echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~$echo \"local: *; };\" >> $lib.exp~\n  \t$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'\n      fi\n      hardcode_libdir_flag_spec_F77='-R$libdir'\n      hardcode_shlibpath_var_F77=no\n      case $host_os in\n      solaris2.[0-5] | solaris2.[0-5].*) ;;\n      *) # Supported since Solaris 2.6 (maybe 2.5.1?)\n\twhole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;\n      esac\n      link_all_deplibs_F77=yes\n      ;;\n\n    sunos4*)\n      if test \"x$host_vendor\" = xsequent; then\n\t# Use $CC to link under sequent, because it throws in some extra .o\n\t# files that make .init and .fini sections work.\n\tarchive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\tarchive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'\n      fi\n      hardcode_libdir_flag_spec_F77='-L$libdir'\n      hardcode_direct_F77=yes\n      hardcode_minus_L_F77=yes\n      hardcode_shlibpath_var_F77=no\n      ;;\n\n    sysv4)\n      case $host_vendor in\n\tsni)\n\t  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  hardcode_direct_F77=yes # is this really true???\n\t;;\n\tsiemens)\n\t  ## LD is ld it makes a PLAMLIB\n\t  ## CC just makes a GrossModule.\n\t  archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'\n\t  reload_cmds_F77='$CC -r -o $output$reload_objs'\n\t  hardcode_direct_F77=no\n        ;;\n\tmotorola)\n\t  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie\n\t;;\n      esac\n      runpath_var='LD_RUN_PATH'\n      hardcode_shlibpath_var_F77=no\n      ;;\n\n    sysv4.3*)\n      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_shlibpath_var_F77=no\n      export_dynamic_flag_spec_F77='-Bexport'\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\tarchive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\thardcode_shlibpath_var_F77=no\n\trunpath_var=LD_RUN_PATH\n\thardcode_runpath_var=yes\n\tld_shlibs_F77=yes\n      fi\n      ;;\n\n    sysv4.2uw2*)\n      archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_direct_F77=yes\n      hardcode_minus_L_F77=no\n      hardcode_shlibpath_var_F77=no\n      hardcode_runpath_var=yes\n      runpath_var=LD_RUN_PATH\n      ;;\n\n   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)\n      no_undefined_flag_F77='${wl}-z ${wl}text'\n      if test \"$GCC\" = yes; then\n\tarchive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\tarchive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'\n      fi\n      runpath_var='LD_RUN_PATH'\n      hardcode_shlibpath_var_F77=no\n      ;;\n\n    sysv5*)\n      no_undefined_flag_F77=' -z text'\n      # $CC -shared without GNU ld will not create a library from C++\n      # object files and a static libstdc++, better avoid it by now\n      archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      archive_expsym_cmds_F77='$echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~$echo \"local: *; };\" >> $lib.exp~\n  \t\t$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'\n      hardcode_libdir_flag_spec_F77=\n      hardcode_shlibpath_var_F77=no\n      runpath_var='LD_RUN_PATH'\n      ;;\n\n    uts4*)\n      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_libdir_flag_spec_F77='-L$libdir'\n      hardcode_shlibpath_var_F77=no\n      ;;\n\n    *)\n      ld_shlibs_F77=no\n      ;;\n    esac\n  fi\n\necho \"$as_me:$LINENO: result: $ld_shlibs_F77\" >&5\necho \"${ECHO_T}$ld_shlibs_F77\" >&6\ntest \"$ld_shlibs_F77\" = no && can_build_shared=no\n\nvariables_saved_for_relink=\"PATH $shlibpath_var $runpath_var\"\nif test \"$GCC\" = yes; then\n  variables_saved_for_relink=\"$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH\"\nfi\n\n#\n# Do we need to explicitly link libc?\n#\ncase \"x$archive_cmds_need_lc_F77\" in\nx|xyes)\n  # Assume -lc should be added\n  archive_cmds_need_lc_F77=yes\n\n  if test \"$enable_shared\" = yes && test \"$GCC\" = yes; then\n    case $archive_cmds_F77 in\n    *'~'*)\n      # FIXME: we may have to deal with multi-command sequences.\n      ;;\n    '$CC '*)\n      # Test whether the compiler implicitly links with -lc since on some\n      # systems, -lgcc has to come before -lc. If gcc already passes -lc\n      # to ld, don't add -lc before -lgcc.\n      echo \"$as_me:$LINENO: checking whether -lc should be explicitly linked in\" >&5\necho $ECHO_N \"checking whether -lc should be explicitly linked in... $ECHO_C\" >&6\n      $rm conftest*\n      printf \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n\n      if { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } 2>conftest.err; then\n        soname=conftest\n        lib=conftest\n        libobjs=conftest.$ac_objext\n        deplibs=\n        wl=$lt_prog_compiler_wl_F77\n        compiler_flags=-v\n        linker_flags=-v\n        verstring=\n        output_objdir=.\n        libname=conftest\n        lt_save_allow_undefined_flag=$allow_undefined_flag_F77\n        allow_undefined_flag_F77=\n        if { (eval echo \"$as_me:$LINENO: \\\"$archive_cmds_F77 2\\>\\&1 \\| grep \\\" -lc \\\" \\>/dev/null 2\\>\\&1\\\"\") >&5\n  (eval $archive_cmds_F77 2\\>\\&1 \\| grep \\\" -lc \\\" \\>/dev/null 2\\>\\&1) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }\n        then\n\t  archive_cmds_need_lc_F77=no\n        else\n\t  archive_cmds_need_lc_F77=yes\n        fi\n        allow_undefined_flag_F77=$lt_save_allow_undefined_flag\n      else\n        cat conftest.err 1>&5\n      fi\n      $rm conftest*\n      echo \"$as_me:$LINENO: result: $archive_cmds_need_lc_F77\" >&5\necho \"${ECHO_T}$archive_cmds_need_lc_F77\" >&6\n      ;;\n    esac\n  fi\n  ;;\nesac\n\necho \"$as_me:$LINENO: checking dynamic linker characteristics\" >&5\necho $ECHO_N \"checking dynamic linker characteristics... $ECHO_C\" >&6\nlibrary_names_spec=\nlibname_spec='lib$name'\nsoname_spec=\nshrext_cmds=\".so\"\npostinstall_cmds=\npostuninstall_cmds=\nfinish_cmds=\nfinish_eval=\nshlibpath_var=\nshlibpath_overrides_runpath=unknown\nversion_type=none\ndynamic_linker=\"$host_os ld.so\"\nsys_lib_dlsearch_path_spec=\"/lib /usr/lib\"\nif test \"$GCC\" = yes; then\n  sys_lib_search_path_spec=`$CC -print-search-dirs | grep \"^libraries:\" | $SED -e \"s/^libraries://\" -e \"s,=/,/,g\"`\n  if echo \"$sys_lib_search_path_spec\" | grep ';' >/dev/null ; then\n    # if the path contains \";\" then we assume it to be the separator\n    # otherwise default to the standard path separator (i.e. \":\") - it is\n    # assumed that no part of a normal pathname contains \";\" but that should\n    # okay in the real world where \";\" in dirpaths is itself problematic.\n    sys_lib_search_path_spec=`echo \"$sys_lib_search_path_spec\" | $SED -e 's/;/ /g'`\n  else\n    sys_lib_search_path_spec=`echo \"$sys_lib_search_path_spec\" | $SED  -e \"s/$PATH_SEPARATOR/ /g\"`\n  fi\nelse\n  sys_lib_search_path_spec=\"/lib /usr/lib /usr/local/lib\"\nfi\nneed_lib_prefix=unknown\nhardcode_into_libs=no\n\n# when you set need_version to no, make sure it does not cause -set_version\n# flags to be left without arguments\nneed_version=unknown\n\ncase $host_os in\naix3*)\n  version_type=linux\n  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'\n  shlibpath_var=LIBPATH\n\n  # AIX 3 has no versioning support, so we append a major version to the name.\n  soname_spec='${libname}${release}${shared_ext}$major'\n  ;;\n\naix4* | aix5*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  hardcode_into_libs=yes\n  if test \"$host_cpu\" = ia64; then\n    # AIX 5 supports IA64\n    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'\n    shlibpath_var=LD_LIBRARY_PATH\n  else\n    # With GCC up to 2.95.x, collect2 would create an import file\n    # for dependence libraries.  The import file would start with\n    # the line `#! .'.  This would cause the generated library to\n    # depend on `.', always an invalid library.  This was fixed in\n    # development snapshots of GCC prior to 3.0.\n    case $host_os in\n      aix4 | aix4.[01] | aix4.[01].*)\n      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'\n\t   echo ' yes '\n\t   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then\n\t:\n      else\n\tcan_build_shared=no\n      fi\n      ;;\n    esac\n    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct\n    # soname into executable. Probably we can add versioning support to\n    # collect2, so additional links can be useful in future.\n    if test \"$aix_use_runtimelinking\" = yes; then\n      # If using run time linking (on AIX 4.2 or later) use lib<name>.so\n      # instead of lib<name>.a to let people know that these are not\n      # typical AIX shared libraries.\n      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n    else\n      # We preserve .a as extension for shared libraries through AIX4.2\n      # and later when we are not doing run time linking.\n      library_names_spec='${libname}${release}.a $libname.a'\n      soname_spec='${libname}${release}${shared_ext}$major'\n    fi\n    shlibpath_var=LIBPATH\n  fi\n  ;;\n\namigaos*)\n  library_names_spec='$libname.ixlibrary $libname.a'\n  # Create ${libname}_ixlibrary.a entries in /sys/libs.\n  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo \"X$lib\" | $Xsed -e '\\''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'\n  ;;\n\nbeos*)\n  library_names_spec='${libname}${shared_ext}'\n  dynamic_linker=\"$host_os ld.so\"\n  shlibpath_var=LIBRARY_PATH\n  ;;\n\nbsdi4*)\n  version_type=linux\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  sys_lib_search_path_spec=\"/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib\"\n  sys_lib_dlsearch_path_spec=\"/shlib /usr/lib /usr/local/lib\"\n  # the default ld.so.conf also contains /usr/contrib/lib and\n  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow\n  # libtool to hard-code these into programs\n  ;;\n\ncygwin* | mingw* | pw32*)\n  version_type=windows\n  shrext_cmds=\".dll\"\n  need_version=no\n  need_lib_prefix=no\n\n  case $GCC,$host_os in\n  yes,cygwin* | yes,mingw* | yes,pw32*)\n    library_names_spec='$libname.dll.a'\n    # DLL is installed to $(libdir)/../bin by postinstall_cmds\n    postinstall_cmds='base_file=`basename \\${file}`~\n      dlpath=`$SHELL 2>&1 -c '\\''. $dir/'\\''\\${base_file}'\\''i;echo \\$dlname'\\''`~\n      dldir=$destdir/`dirname \\$dlpath`~\n      test -d \\$dldir || mkdir -p \\$dldir~\n      $install_prog $dir/$dlname \\$dldir/$dlname'\n    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\\''. $file; echo \\$dlname'\\''`~\n      dlpath=$dir/\\$dldll~\n       $rm \\$dlpath'\n    shlibpath_overrides_runpath=yes\n\n    case $host_os in\n    cygwin*)\n      # Cygwin DLLs use 'cyg' prefix rather than 'lib'\n      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'\n      sys_lib_search_path_spec=\"/usr/lib /lib/w32api /lib /usr/local/lib\"\n      ;;\n    mingw*)\n      # MinGW DLLs use traditional 'lib' prefix\n      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'\n      sys_lib_search_path_spec=`$CC -print-search-dirs | grep \"^libraries:\" | $SED -e \"s/^libraries://\" -e \"s,=/,/,g\"`\n      if echo \"$sys_lib_search_path_spec\" | grep ';[c-zC-Z]:/' >/dev/null; then\n        # It is most probably a Windows format PATH printed by\n        # mingw gcc, but we are running on Cygwin. Gcc prints its search\n        # path with ; separators, and with drive letters. We can handle the\n        # drive letters (cygwin fileutils understands them), so leave them,\n        # especially as we might pass files found there to a mingw objdump,\n        # which wouldn't understand a cygwinified path. Ahh.\n        sys_lib_search_path_spec=`echo \"$sys_lib_search_path_spec\" | $SED -e 's/;/ /g'`\n      else\n        sys_lib_search_path_spec=`echo \"$sys_lib_search_path_spec\" | $SED  -e \"s/$PATH_SEPARATOR/ /g\"`\n      fi\n      ;;\n    pw32*)\n      # pw32 DLLs use 'pw' prefix rather than 'lib'\n      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'\n      ;;\n    esac\n    ;;\n\n  *)\n    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'\n    ;;\n  esac\n  dynamic_linker='Win32 ld.exe'\n  # FIXME: first we should search . and the directory the executable is in\n  shlibpath_var=PATH\n  ;;\n\ndarwin* | rhapsody*)\n  dynamic_linker=\"$host_os dyld\"\n  version_type=darwin\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'\n  soname_spec='${libname}${release}${major}$shared_ext'\n  shlibpath_overrides_runpath=yes\n  shlibpath_var=DYLD_LIBRARY_PATH\n  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'\n  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.\n  if test \"$GCC\" = yes; then\n    sys_lib_search_path_spec=`$CC -print-search-dirs | tr \"\\n\" \"$PATH_SEPARATOR\" | sed -e 's/libraries:/@libraries:/' | tr \"@\" \"\\n\" | grep \"^libraries:\" | sed -e \"s/^libraries://\" -e \"s,=/,/,g\" -e \"s,$PATH_SEPARATOR, ,g\" -e \"s,.*,& /lib /usr/lib /usr/local/lib,g\"`\n  else\n    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'\n  fi\n  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'\n  ;;\n\ndgux*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\nfreebsd1*)\n  dynamic_linker=no\n  ;;\n\nkfreebsd*-gnu)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  dynamic_linker='GNU ld.so'\n  ;;\n\nfreebsd*)\n  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`\n  version_type=freebsd-$objformat\n  case $version_type in\n    freebsd-elf*)\n      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'\n      need_version=no\n      need_lib_prefix=no\n      ;;\n    freebsd-*)\n      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'\n      need_version=yes\n      ;;\n  esac\n  shlibpath_var=LD_LIBRARY_PATH\n  case $host_os in\n  freebsd2*)\n    shlibpath_overrides_runpath=yes\n    ;;\n  freebsd3.01* | freebsdelf3.01*)\n    shlibpath_overrides_runpath=yes\n    hardcode_into_libs=yes\n    ;;\n  *) # from 3.2 on\n    shlibpath_overrides_runpath=no\n    hardcode_into_libs=yes\n    ;;\n  esac\n  ;;\n\ngnu*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  hardcode_into_libs=yes\n  ;;\n\nhpux9* | hpux10* | hpux11*)\n  # Give a soname corresponding to the major version so that dld.sl refuses to\n  # link against other versions.\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=no\n  case \"$host_cpu\" in\n  ia64*)\n    shrext_cmds='.so'\n    hardcode_into_libs=yes\n    dynamic_linker=\"$host_os dld.so\"\n    shlibpath_var=LD_LIBRARY_PATH\n    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.\n    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n    soname_spec='${libname}${release}${shared_ext}$major'\n    if test \"X$HPUX_IA64_MODE\" = X32; then\n      sys_lib_search_path_spec=\"/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib\"\n    else\n      sys_lib_search_path_spec=\"/usr/lib/hpux64 /usr/local/lib/hpux64\"\n    fi\n    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec\n    ;;\n   hppa*64*)\n     shrext_cmds='.sl'\n     hardcode_into_libs=yes\n     dynamic_linker=\"$host_os dld.sl\"\n     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH\n     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.\n     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n     soname_spec='${libname}${release}${shared_ext}$major'\n     sys_lib_search_path_spec=\"/usr/lib/pa20_64 /usr/ccs/lib/pa20_64\"\n     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec\n     ;;\n   *)\n    shrext_cmds='.sl'\n    dynamic_linker=\"$host_os dld.sl\"\n    shlibpath_var=SHLIB_PATH\n    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH\n    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n    soname_spec='${libname}${release}${shared_ext}$major'\n    ;;\n  esac\n  # HP-UX runs *really* slowly unless shared libraries are mode 555.\n  postinstall_cmds='chmod 555 $lib'\n  ;;\n\nirix5* | irix6* | nonstopux*)\n  case $host_os in\n    nonstopux*) version_type=nonstopux ;;\n    *)\n\tif test \"$lt_cv_prog_gnu_ld\" = yes; then\n\t\tversion_type=linux\n\telse\n\t\tversion_type=irix\n\tfi ;;\n  esac\n  need_lib_prefix=no\n  need_version=no\n  soname_spec='${libname}${release}${shared_ext}$major'\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'\n  case $host_os in\n  irix5* | nonstopux*)\n    libsuff= shlibsuff=\n    ;;\n  *)\n    case $LD in # libtool.m4 will add one of these switches to LD\n    *-32|*\"-32 \"|*-melf32bsmip|*\"-melf32bsmip \")\n      libsuff= shlibsuff= libmagic=32-bit;;\n    *-n32|*\"-n32 \"|*-melf32bmipn32|*\"-melf32bmipn32 \")\n      libsuff=32 shlibsuff=N32 libmagic=N32;;\n    *-64|*\"-64 \"|*-melf64bmip|*\"-melf64bmip \")\n      libsuff=64 shlibsuff=64 libmagic=64-bit;;\n    *) libsuff= shlibsuff= libmagic=never-match;;\n    esac\n    ;;\n  esac\n  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH\n  shlibpath_overrides_runpath=no\n  sys_lib_search_path_spec=\"/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}\"\n  sys_lib_dlsearch_path_spec=\"/usr/lib${libsuff} /lib${libsuff}\"\n  hardcode_into_libs=yes\n  ;;\n\n# No shared lib support for Linux oldld, aout, or coff.\nlinux*oldld* | linux*aout* | linux*coff*)\n  dynamic_linker=no\n  ;;\n\n# This must be Linux ELF.\nlinux*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -n $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  # This implies no fast_install, which is unacceptable.\n  # Some rework will be needed to allow for fast_install\n  # before this can be enabled.\n  hardcode_into_libs=yes\n\n  # find out which ABI we are using\n  libsuff=\n  case \"$host_cpu\" in\n  x86_64*|s390x*|powerpc64*)\n    echo '#line 15906 \"configure\"' > conftest.$ac_ext\n    if { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; then\n      case `/usr/bin/file conftest.$ac_objext` in\n      *64-bit*)\n        libsuff=64\n        sys_lib_search_path_spec=\"/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}\"\n        ;;\n      esac\n    fi\n    rm -rf conftest*\n    ;;\n  esac\n\n  # Append ld.so.conf contents to the search path\n  if test -f /etc/ld.so.conf; then\n    lt_ld_extra=`$SED -e 's/:,\\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\\n' ' '`\n    sys_lib_dlsearch_path_spec=\"/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra\"\n  fi\n\n  # We used to test for /lib/ld.so.1 and disable shared libraries on\n  # powerpc, because MkLinux only supported shared libraries with the\n  # GNU dynamic linker.  Since this was broken with cross compilers,\n  # most powerpc-linux boxes support dynamic linking these days and\n  # people can always --disable-shared, the test was removed, and we\n  # assume the GNU/Linux dynamic linker is in use.\n  dynamic_linker='GNU/Linux ld.so'\n  ;;\n\nknetbsd*-gnu)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  dynamic_linker='GNU ld.so'\n  ;;\n\nnetbsd*)\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=no\n  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then\n    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'\n    finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -m $libdir'\n    dynamic_linker='NetBSD (a.out) ld.so'\n  else\n    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'\n    soname_spec='${libname}${release}${shared_ext}$major'\n    dynamic_linker='NetBSD ld.elf_so'\n  fi\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  hardcode_into_libs=yes\n  ;;\n\nnewsos6)\n  version_type=linux\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  ;;\n\nnto-qnx*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  ;;\n\nopenbsd*)\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=yes\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -m $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  if test -z \"`echo __ELF__ | $CC -E - | grep __ELF__`\" || test \"$host_os-$host_cpu\" = \"openbsd2.8-powerpc\"; then\n    case $host_os in\n      openbsd2.[89] | openbsd2.[89].*)\n\tshlibpath_overrides_runpath=no\n\t;;\n      *)\n\tshlibpath_overrides_runpath=yes\n\t;;\n      esac\n  else\n    shlibpath_overrides_runpath=yes\n  fi\n  ;;\n\nos2*)\n  libname_spec='$name'\n  shrext_cmds=\".dll\"\n  need_lib_prefix=no\n  library_names_spec='$libname${shared_ext} $libname.a'\n  dynamic_linker='OS/2 ld.exe'\n  shlibpath_var=LIBPATH\n  ;;\n\nosf3* | osf4* | osf5*)\n  version_type=osf\n  need_lib_prefix=no\n  need_version=no\n  soname_spec='${libname}${release}${shared_ext}$major'\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  shlibpath_var=LD_LIBRARY_PATH\n  sys_lib_search_path_spec=\"/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib\"\n  sys_lib_dlsearch_path_spec=\"$sys_lib_search_path_spec\"\n  ;;\n\nsco3.2v5*)\n  version_type=osf\n  soname_spec='${libname}${release}${shared_ext}$major'\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\nsolaris*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  hardcode_into_libs=yes\n  # ldd complains unless libraries are executable\n  postinstall_cmds='chmod +x $lib'\n  ;;\n\nsunos4*)\n  version_type=sunos\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'\n  finish_cmds='PATH=\"\\$PATH:/usr/etc\" ldconfig $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  if test \"$with_gnu_ld\" = yes; then\n    need_lib_prefix=no\n  fi\n  need_version=yes\n  ;;\n\nsysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)\n  version_type=linux\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  case $host_vendor in\n    sni)\n      shlibpath_overrides_runpath=no\n      need_lib_prefix=no\n      export_dynamic_flag_spec='${wl}-Blargedynsym'\n      runpath_var=LD_RUN_PATH\n      ;;\n    siemens)\n      need_lib_prefix=no\n      ;;\n    motorola)\n      need_lib_prefix=no\n      need_version=no\n      shlibpath_overrides_runpath=no\n      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'\n      ;;\n  esac\n  ;;\n\nsysv4*MP*)\n  if test -d /usr/nec ;then\n    version_type=linux\n    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'\n    soname_spec='$libname${shared_ext}.$major'\n    shlibpath_var=LD_LIBRARY_PATH\n  fi\n  ;;\n\nuts4*)\n  version_type=linux\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\n*)\n  dynamic_linker=no\n  ;;\nesac\necho \"$as_me:$LINENO: result: $dynamic_linker\" >&5\necho \"${ECHO_T}$dynamic_linker\" >&6\ntest \"$dynamic_linker\" = no && can_build_shared=no\n\necho \"$as_me:$LINENO: checking how to hardcode library paths into programs\" >&5\necho $ECHO_N \"checking how to hardcode library paths into programs... $ECHO_C\" >&6\nhardcode_action_F77=\nif test -n \"$hardcode_libdir_flag_spec_F77\" || \\\n   test -n \"$runpath_var F77\" || \\\n   test \"X$hardcode_automatic_F77\"=\"Xyes\" ; then\n\n  # We can hardcode non-existant directories.\n  if test \"$hardcode_direct_F77\" != no &&\n     # If the only mechanism to avoid hardcoding is shlibpath_var, we\n     # have to relink, otherwise we might link with an installed library\n     # when we should be linking with a yet-to-be-installed one\n     ## test \"$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)\" != no &&\n     test \"$hardcode_minus_L_F77\" != no; then\n    # Linking always hardcodes the temporary library directory.\n    hardcode_action_F77=relink\n  else\n    # We can link without hardcoding, and we can hardcode nonexisting dirs.\n    hardcode_action_F77=immediate\n  fi\nelse\n  # We cannot hardcode anything, or else we can only hardcode existing\n  # directories.\n  hardcode_action_F77=unsupported\nfi\necho \"$as_me:$LINENO: result: $hardcode_action_F77\" >&5\necho \"${ECHO_T}$hardcode_action_F77\" >&6\n\nif test \"$hardcode_action_F77\" = relink; then\n  # Fast installation is not supported\n  enable_fast_install=no\nelif test \"$shlibpath_overrides_runpath\" = yes ||\n     test \"$enable_shared\" = no; then\n  # Fast installation is not necessary\n  enable_fast_install=needless\nfi\n\nstriplib=\nold_striplib=\necho \"$as_me:$LINENO: checking whether stripping libraries is possible\" >&5\necho $ECHO_N \"checking whether stripping libraries is possible... $ECHO_C\" >&6\nif test -n \"$STRIP\" && $STRIP -V 2>&1 | grep \"GNU strip\" >/dev/null; then\n  test -z \"$old_striplib\" && old_striplib=\"$STRIP --strip-debug\"\n  test -z \"$striplib\" && striplib=\"$STRIP --strip-unneeded\"\n  echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\nelse\n# FIXME - insert some real tests, host_os isn't really good enough\n  case $host_os in\n   darwin*)\n       if test -n \"$STRIP\" ; then\n         striplib=\"$STRIP -x\"\n         echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\n       else\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n       ;;\n   *)\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\n    ;;\n  esac\nfi\n\n\n\n# The else clause should only fire when bootstrapping the\n# libtool distribution, otherwise you forgot to ship ltmain.sh\n# with your package, and you will get complaints that there are\n# no rules to generate ltmain.sh.\nif test -f \"$ltmain\"; then\n  # See if we are running on zsh, and set the options which allow our commands through\n  # without removal of \\ escapes.\n  if test -n \"${ZSH_VERSION+set}\" ; then\n    setopt NO_GLOB_SUBST\n  fi\n  # Now quote all the things that may contain metacharacters while being\n  # careful not to overquote the AC_SUBSTed values.  We take copies of the\n  # variables and quote the copies for generation of the libtool script.\n  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \\\n    SED SHELL STRIP \\\n    libname_spec library_names_spec soname_spec extract_expsyms_cmds \\\n    old_striplib striplib file_magic_cmd finish_cmds finish_eval \\\n    deplibs_check_method reload_flag reload_cmds need_locks \\\n    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \\\n    lt_cv_sys_global_symbol_to_c_name_address \\\n    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \\\n    old_postinstall_cmds old_postuninstall_cmds \\\n    compiler_F77 \\\n    CC_F77 \\\n    LD_F77 \\\n    lt_prog_compiler_wl_F77 \\\n    lt_prog_compiler_pic_F77 \\\n    lt_prog_compiler_static_F77 \\\n    lt_prog_compiler_no_builtin_flag_F77 \\\n    export_dynamic_flag_spec_F77 \\\n    thread_safe_flag_spec_F77 \\\n    whole_archive_flag_spec_F77 \\\n    enable_shared_with_static_runtimes_F77 \\\n    old_archive_cmds_F77 \\\n    old_archive_from_new_cmds_F77 \\\n    predep_objects_F77 \\\n    postdep_objects_F77 \\\n    predeps_F77 \\\n    postdeps_F77 \\\n    compiler_lib_search_path_F77 \\\n    archive_cmds_F77 \\\n    archive_expsym_cmds_F77 \\\n    postinstall_cmds_F77 \\\n    postuninstall_cmds_F77 \\\n    old_archive_from_expsyms_cmds_F77 \\\n    allow_undefined_flag_F77 \\\n    no_undefined_flag_F77 \\\n    export_symbols_cmds_F77 \\\n    hardcode_libdir_flag_spec_F77 \\\n    hardcode_libdir_flag_spec_ld_F77 \\\n    hardcode_libdir_separator_F77 \\\n    hardcode_automatic_F77 \\\n    module_cmds_F77 \\\n    module_expsym_cmds_F77 \\\n    lt_cv_prog_compiler_c_o_F77 \\\n    exclude_expsyms_F77 \\\n    include_expsyms_F77; do\n\n    case $var in\n    old_archive_cmds_F77 | \\\n    old_archive_from_new_cmds_F77 | \\\n    archive_cmds_F77 | \\\n    archive_expsym_cmds_F77 | \\\n    module_cmds_F77 | \\\n    module_expsym_cmds_F77 | \\\n    old_archive_from_expsyms_cmds_F77 | \\\n    export_symbols_cmds_F77 | \\\n    extract_expsyms_cmds | reload_cmds | finish_cmds | \\\n    postinstall_cmds | postuninstall_cmds | \\\n    old_postinstall_cmds | old_postuninstall_cmds | \\\n    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)\n      # Double-quote double-evaled strings.\n      eval \"lt_$var=\\\\\\\"\\`\\$echo \\\"X\\$$var\\\" | \\$Xsed -e \\\"\\$double_quote_subst\\\" -e \\\"\\$sed_quote_subst\\\" -e \\\"\\$delay_variable_subst\\\"\\`\\\\\\\"\"\n      ;;\n    *)\n      eval \"lt_$var=\\\\\\\"\\`\\$echo \\\"X\\$$var\\\" | \\$Xsed -e \\\"\\$sed_quote_subst\\\"\\`\\\\\\\"\"\n      ;;\n    esac\n  done\n\n  case $lt_echo in\n  *'\\$0 --fallback-echo\"')\n    lt_echo=`$echo \"X$lt_echo\" | $Xsed -e 's/\\\\\\\\\\\\\\$0 --fallback-echo\"$/$0 --fallback-echo\"/'`\n    ;;\n  esac\n\ncfgfile=\"$ofile\"\n\n  cat <<__EOF__ >> \"$cfgfile\"\n# ### BEGIN LIBTOOL TAG CONFIG: $tagname\n\n# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:\n\n# Shell to use when invoking shell scripts.\nSHELL=$lt_SHELL\n\n# Whether or not to build shared libraries.\nbuild_libtool_libs=$enable_shared\n\n# Whether or not to build static libraries.\nbuild_old_libs=$enable_static\n\n# Whether or not to add -lc for building shared libraries.\nbuild_libtool_need_lc=$archive_cmds_need_lc_F77\n\n# Whether or not to disallow shared libs when runtime libs are static\nallow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77\n\n# Whether or not to optimize for fast installation.\nfast_install=$enable_fast_install\n\n# The host system.\nhost_alias=$host_alias\nhost=$host\n\n# An echo program that does not interpret backslashes.\necho=$lt_echo\n\n# The archiver.\nAR=$lt_AR\nAR_FLAGS=$lt_AR_FLAGS\n\n# A C compiler.\nLTCC=$lt_LTCC\n\n# A language-specific compiler.\nCC=$lt_compiler_F77\n\n# Is the compiler the GNU C compiler?\nwith_gcc=$GCC_F77\n\n# An ERE matcher.\nEGREP=$lt_EGREP\n\n# The linker used to build libraries.\nLD=$lt_LD_F77\n\n# Whether we need hard or soft links.\nLN_S=$lt_LN_S\n\n# A BSD-compatible nm program.\nNM=$lt_NM\n\n# A symbol stripping program\nSTRIP=$lt_STRIP\n\n# Used to examine libraries when file_magic_cmd begins \"file\"\nMAGIC_CMD=$MAGIC_CMD\n\n# Used on cygwin: DLL creation program.\nDLLTOOL=\"$DLLTOOL\"\n\n# Used on cygwin: object dumper.\nOBJDUMP=\"$OBJDUMP\"\n\n# Used on cygwin: assembler.\nAS=\"$AS\"\n\n# The name of the directory that contains temporary libtool files.\nobjdir=$objdir\n\n# How to create reloadable object files.\nreload_flag=$lt_reload_flag\nreload_cmds=$lt_reload_cmds\n\n# How to pass a linker flag through the compiler.\nwl=$lt_lt_prog_compiler_wl_F77\n\n# Object file suffix (normally \"o\").\nobjext=\"$ac_objext\"\n\n# Old archive suffix (normally \"a\").\nlibext=\"$libext\"\n\n# Shared library suffix (normally \".so\").\nshrext_cmds='$shrext_cmds'\n\n# Executable file suffix (normally \"\").\nexeext=\"$exeext\"\n\n# Additional compiler flags for building library objects.\npic_flag=$lt_lt_prog_compiler_pic_F77\npic_mode=$pic_mode\n\n# What is the maximum length of a command?\nmax_cmd_len=$lt_cv_sys_max_cmd_len\n\n# Does compiler simultaneously support -c and -o options?\ncompiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77\n\n# Must we lock files when doing compilation ?\nneed_locks=$lt_need_locks\n\n# Do we need the lib prefix for modules?\nneed_lib_prefix=$need_lib_prefix\n\n# Do we need a version for libraries?\nneed_version=$need_version\n\n# Whether dlopen is supported.\ndlopen_support=$enable_dlopen\n\n# Whether dlopen of programs is supported.\ndlopen_self=$enable_dlopen_self\n\n# Whether dlopen of statically linked programs is supported.\ndlopen_self_static=$enable_dlopen_self_static\n\n# Compiler flag to prevent dynamic linking.\nlink_static_flag=$lt_lt_prog_compiler_static_F77\n\n# Compiler flag to turn off builtin functions.\nno_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77\n\n# Compiler flag to allow reflexive dlopens.\nexport_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77\n\n# Compiler flag to generate shared objects directly from archives.\nwhole_archive_flag_spec=$lt_whole_archive_flag_spec_F77\n\n# Compiler flag to generate thread-safe objects.\nthread_safe_flag_spec=$lt_thread_safe_flag_spec_F77\n\n# Library versioning type.\nversion_type=$version_type\n\n# Format of library name prefix.\nlibname_spec=$lt_libname_spec\n\n# List of archive names.  First name is the real one, the rest are links.\n# The last name is the one that the linker finds with -lNAME.\nlibrary_names_spec=$lt_library_names_spec\n\n# The coded name of the library, if different from the real name.\nsoname_spec=$lt_soname_spec\n\n# Commands used to build and install an old-style archive.\nRANLIB=$lt_RANLIB\nold_archive_cmds=$lt_old_archive_cmds_F77\nold_postinstall_cmds=$lt_old_postinstall_cmds\nold_postuninstall_cmds=$lt_old_postuninstall_cmds\n\n# Create an old-style archive from a shared archive.\nold_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77\n\n# Create a temporary old-style archive to link instead of a shared archive.\nold_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77\n\n# Commands used to build and install a shared archive.\narchive_cmds=$lt_archive_cmds_F77\narchive_expsym_cmds=$lt_archive_expsym_cmds_F77\npostinstall_cmds=$lt_postinstall_cmds\npostuninstall_cmds=$lt_postuninstall_cmds\n\n# Commands used to build a loadable module (assumed same as above if empty)\nmodule_cmds=$lt_module_cmds_F77\nmodule_expsym_cmds=$lt_module_expsym_cmds_F77\n\n# Commands to strip libraries.\nold_striplib=$lt_old_striplib\nstriplib=$lt_striplib\n\n# Dependencies to place before the objects being linked to create a\n# shared library.\npredep_objects=$lt_predep_objects_F77\n\n# Dependencies to place after the objects being linked to create a\n# shared library.\npostdep_objects=$lt_postdep_objects_F77\n\n# Dependencies to place before the objects being linked to create a\n# shared library.\npredeps=$lt_predeps_F77\n\n# Dependencies to place after the objects being linked to create a\n# shared library.\npostdeps=$lt_postdeps_F77\n\n# The library search path used internally by the compiler when linking\n# a shared library.\ncompiler_lib_search_path=$lt_compiler_lib_search_path_F77\n\n# Method to check whether dependent libraries are shared objects.\ndeplibs_check_method=$lt_deplibs_check_method\n\n# Command to use when deplibs_check_method == file_magic.\nfile_magic_cmd=$lt_file_magic_cmd\n\n# Flag that allows shared libraries with undefined symbols to be built.\nallow_undefined_flag=$lt_allow_undefined_flag_F77\n\n# Flag that forces no undefined symbols.\nno_undefined_flag=$lt_no_undefined_flag_F77\n\n# Commands used to finish a libtool library installation in a directory.\nfinish_cmds=$lt_finish_cmds\n\n# Same as above, but a single script fragment to be evaled but not shown.\nfinish_eval=$lt_finish_eval\n\n# Take the output of nm and produce a listing of raw symbols and C names.\nglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe\n\n# Transform the output of nm in a proper C declaration\nglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl\n\n# Transform the output of nm in a C name address pair\nglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address\n\n# This is the shared library runtime path variable.\nrunpath_var=$runpath_var\n\n# This is the shared library path variable.\nshlibpath_var=$shlibpath_var\n\n# Is shlibpath searched before the hard-coded library search path?\nshlibpath_overrides_runpath=$shlibpath_overrides_runpath\n\n# How to hardcode a shared library path into an executable.\nhardcode_action=$hardcode_action_F77\n\n# Whether we should hardcode library paths into libraries.\nhardcode_into_libs=$hardcode_into_libs\n\n# Flag to hardcode \\$libdir into a binary during linking.\n# This must work even if \\$libdir does not exist.\nhardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77\n\n# If ld is used when linking, flag to hardcode \\$libdir into\n# a binary during linking. This must work even if \\$libdir does\n# not exist.\nhardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77\n\n# Whether we need a single -rpath flag with a separated argument.\nhardcode_libdir_separator=$lt_hardcode_libdir_separator_F77\n\n# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the\n# resulting binary.\nhardcode_direct=$hardcode_direct_F77\n\n# Set to yes if using the -LDIR flag during linking hardcodes DIR into the\n# resulting binary.\nhardcode_minus_L=$hardcode_minus_L_F77\n\n# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into\n# the resulting binary.\nhardcode_shlibpath_var=$hardcode_shlibpath_var_F77\n\n# Set to yes if building a shared library automatically hardcodes DIR into the library\n# and all subsequent libraries and executables linked against it.\nhardcode_automatic=$hardcode_automatic_F77\n\n# Variables whose values should be saved in libtool wrapper scripts and\n# restored at relink time.\nvariables_saved_for_relink=\"$variables_saved_for_relink\"\n\n# Whether libtool must link a program against all its dependency libraries.\nlink_all_deplibs=$link_all_deplibs_F77\n\n# Compile-time system search path for libraries\nsys_lib_search_path_spec=$lt_sys_lib_search_path_spec\n\n# Run-time system search path for libraries\nsys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec\n\n# Fix the shell variable \\$srcfile for the compiler.\nfix_srcfile_path=\"$fix_srcfile_path_F77\"\n\n# Set to yes if exported symbols are required.\nalways_export_symbols=$always_export_symbols_F77\n\n# The commands to list exported symbols.\nexport_symbols_cmds=$lt_export_symbols_cmds_F77\n\n# The commands to extract the exported symbol list from a shared archive.\nextract_expsyms_cmds=$lt_extract_expsyms_cmds\n\n# Symbols that should not be listed in the preloaded symbols.\nexclude_expsyms=$lt_exclude_expsyms_F77\n\n# Symbols that must always be exported.\ninclude_expsyms=$lt_include_expsyms_F77\n\n# ### END LIBTOOL TAG CONFIG: $tagname\n\n__EOF__\n\n\nelse\n  # If there is no Makefile yet, we rely on a make rule to execute\n  # `config.status --recheck' to rerun these tests and create the\n  # libtool script then.\n  ltmain_in=`echo $ltmain | sed -e 's/\\.sh$/.in/'`\n  if test -f \"$ltmain_in\"; then\n    test -f Makefile && make \"$ltmain\"\n  fi\nfi\n\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\nCC=\"$lt_save_CC\"\n\n\telse\n\t  tagname=\"\"\n\tfi\n\t;;\n\n      GCJ)\n\tif test -n \"$GCJ\" && test \"X$GCJ\" != \"Xno\"; then\n\n\n\n# Source file extension for Java test sources.\nac_ext=java\n\n# Object file extension for compiled Java test sources.\nobjext=o\nobjext_GCJ=$objext\n\n# Code to be used in simple compile tests\nlt_simple_compile_test_code=\"class foo {}\\n\"\n\n# Code to be used in simple link tests\nlt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\\n'\n\n# ltmain only uses $CC for tagged configurations so make sure $CC is set.\n\n# If no C compiler was specified, use CC.\nLTCC=${LTCC-\"$CC\"}\n\n# Allow CC to be a program name with arguments.\ncompiler=$CC\n\n\n# Allow CC to be a program name with arguments.\nlt_save_CC=\"$CC\"\nCC=${GCJ-\"gcj\"}\ncompiler=$CC\ncompiler_GCJ=$CC\n\n# GCJ did not exist at the time GCC didn't implicitly link libc in.\narchive_cmds_need_lc_GCJ=no\n\n\nlt_prog_compiler_no_builtin_flag_GCJ=\n\nif test \"$GCC\" = yes; then\n  lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'\n\n\necho \"$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions\" >&5\necho $ECHO_N \"checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C\" >&6\nif test \"${lt_cv_prog_compiler_rtti_exceptions+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  lt_cv_prog_compiler_rtti_exceptions=no\n  ac_outfile=conftest.$ac_objext\n   printf \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n   lt_compiler_flag=\"-fno-rtti -fno-exceptions\"\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   # The option is referenced via a variable to avoid confusing sed.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \\\n   -e 's: [^ ]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:16647: $lt_compile\\\"\" >&5)\n   (eval \"$lt_compile\" 2>conftest.err)\n   ac_status=$?\n   cat conftest.err >&5\n   echo \"$as_me:16651: \\$? = $ac_status\" >&5\n   if (exit $ac_status) && test -s \"$ac_outfile\"; then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     if test ! -s conftest.err; then\n       lt_cv_prog_compiler_rtti_exceptions=yes\n     fi\n   fi\n   $rm conftest*\n\nfi\necho \"$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions\" >&5\necho \"${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions\" >&6\n\nif test x\"$lt_cv_prog_compiler_rtti_exceptions\" = xyes; then\n    lt_prog_compiler_no_builtin_flag_GCJ=\"$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions\"\nelse\n    :\nfi\n\nfi\n\nlt_prog_compiler_wl_GCJ=\nlt_prog_compiler_pic_GCJ=\nlt_prog_compiler_static_GCJ=\n\necho \"$as_me:$LINENO: checking for $compiler option to produce PIC\" >&5\necho $ECHO_N \"checking for $compiler option to produce PIC... $ECHO_C\" >&6\n\n  if test \"$GCC\" = yes; then\n    lt_prog_compiler_wl_GCJ='-Wl,'\n    lt_prog_compiler_static_GCJ='-static'\n\n    case $host_os in\n      aix*)\n      # All AIX code is PIC.\n      if test \"$host_cpu\" = ia64; then\n\t# AIX 5 now supports IA64 processor\n\tlt_prog_compiler_static_GCJ='-Bstatic'\n      fi\n      ;;\n\n    amigaos*)\n      # FIXME: we need at least 68020 code to build shared libraries, but\n      # adding the `-m68020' flag to GCC prevents building anything better,\n      # like `-m68040'.\n      lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'\n      ;;\n\n    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)\n      # PIC is the default for these OSes.\n      ;;\n\n    mingw* | pw32* | os2*)\n      # This hack is so that the source file can tell whether it is being\n      # built for inclusion in a dll (and should export symbols for example).\n      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'\n      ;;\n\n    darwin* | rhapsody*)\n      # PIC is the default on this platform\n      # Common symbols not allowed in MH_DYLIB files\n      lt_prog_compiler_pic_GCJ='-fno-common'\n      ;;\n\n    msdosdjgpp*)\n      # Just because we use GCC doesn't mean we suddenly get shared libraries\n      # on systems that don't support them.\n      lt_prog_compiler_can_build_shared_GCJ=no\n      enable_shared=no\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\tlt_prog_compiler_pic_GCJ=-Kconform_pic\n      fi\n      ;;\n\n    hpux*)\n      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but\n      # not for PA HP-UX.\n      case \"$host_cpu\" in\n      hppa*64*|ia64*)\n\t# +Z the default\n\t;;\n      *)\n\tlt_prog_compiler_pic_GCJ='-fPIC'\n\t;;\n      esac\n      ;;\n\n    *)\n      lt_prog_compiler_pic_GCJ='-fPIC'\n      ;;\n    esac\n  else\n    # PORTME Check for flag to pass linker flags through the system compiler.\n    case $host_os in\n    aix*)\n      lt_prog_compiler_wl_GCJ='-Wl,'\n      if test \"$host_cpu\" = ia64; then\n\t# AIX 5 now supports IA64 processor\n\tlt_prog_compiler_static_GCJ='-Bstatic'\n      else\n\tlt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'\n      fi\n      ;;\n\n    mingw* | pw32* | os2*)\n      # This hack is so that the source file can tell whether it is being\n      # built for inclusion in a dll (and should export symbols for example).\n      lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'\n      ;;\n\n    hpux9* | hpux10* | hpux11*)\n      lt_prog_compiler_wl_GCJ='-Wl,'\n      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but\n      # not for PA HP-UX.\n      case \"$host_cpu\" in\n      hppa*64*|ia64*)\n\t# +Z the default\n\t;;\n      *)\n\tlt_prog_compiler_pic_GCJ='+Z'\n\t;;\n      esac\n      # Is there a better lt_prog_compiler_static that works with the bundled CC?\n      lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'\n      ;;\n\n    irix5* | irix6* | nonstopux*)\n      lt_prog_compiler_wl_GCJ='-Wl,'\n      # PIC (with -KPIC) is the default.\n      lt_prog_compiler_static_GCJ='-non_shared'\n      ;;\n\n    newsos6)\n      lt_prog_compiler_pic_GCJ='-KPIC'\n      lt_prog_compiler_static_GCJ='-Bstatic'\n      ;;\n\n    linux*)\n      case $CC in\n      icc* | ecc*)\n\tlt_prog_compiler_wl_GCJ='-Wl,'\n\tlt_prog_compiler_pic_GCJ='-KPIC'\n\tlt_prog_compiler_static_GCJ='-static'\n        ;;\n      ccc*)\n        lt_prog_compiler_wl_GCJ='-Wl,'\n        # All Alpha code is PIC.\n        lt_prog_compiler_static_GCJ='-non_shared'\n        ;;\n      esac\n      ;;\n\n    osf3* | osf4* | osf5*)\n      lt_prog_compiler_wl_GCJ='-Wl,'\n      # All OSF/1 code is PIC.\n      lt_prog_compiler_static_GCJ='-non_shared'\n      ;;\n\n    sco3.2v5*)\n      lt_prog_compiler_pic_GCJ='-Kpic'\n      lt_prog_compiler_static_GCJ='-dn'\n      ;;\n\n    solaris*)\n      lt_prog_compiler_wl_GCJ='-Wl,'\n      lt_prog_compiler_pic_GCJ='-KPIC'\n      lt_prog_compiler_static_GCJ='-Bstatic'\n      ;;\n\n    sunos4*)\n      lt_prog_compiler_wl_GCJ='-Qoption ld '\n      lt_prog_compiler_pic_GCJ='-PIC'\n      lt_prog_compiler_static_GCJ='-Bstatic'\n      ;;\n\n    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)\n      lt_prog_compiler_wl_GCJ='-Wl,'\n      lt_prog_compiler_pic_GCJ='-KPIC'\n      lt_prog_compiler_static_GCJ='-Bstatic'\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec ;then\n\tlt_prog_compiler_pic_GCJ='-Kconform_pic'\n\tlt_prog_compiler_static_GCJ='-Bstatic'\n      fi\n      ;;\n\n    uts4*)\n      lt_prog_compiler_pic_GCJ='-pic'\n      lt_prog_compiler_static_GCJ='-Bstatic'\n      ;;\n\n    *)\n      lt_prog_compiler_can_build_shared_GCJ=no\n      ;;\n    esac\n  fi\n\necho \"$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ\" >&5\necho \"${ECHO_T}$lt_prog_compiler_pic_GCJ\" >&6\n\n#\n# Check to make sure the PIC flag actually works.\n#\nif test -n \"$lt_prog_compiler_pic_GCJ\"; then\n\necho \"$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works\" >&5\necho $ECHO_N \"checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C\" >&6\nif test \"${lt_prog_compiler_pic_works_GCJ+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  lt_prog_compiler_pic_works_GCJ=no\n  ac_outfile=conftest.$ac_objext\n   printf \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n   lt_compiler_flag=\"$lt_prog_compiler_pic_GCJ\"\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   # The option is referenced via a variable to avoid confusing sed.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \\\n   -e 's: [^ ]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:16880: $lt_compile\\\"\" >&5)\n   (eval \"$lt_compile\" 2>conftest.err)\n   ac_status=$?\n   cat conftest.err >&5\n   echo \"$as_me:16884: \\$? = $ac_status\" >&5\n   if (exit $ac_status) && test -s \"$ac_outfile\"; then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     if test ! -s conftest.err; then\n       lt_prog_compiler_pic_works_GCJ=yes\n     fi\n   fi\n   $rm conftest*\n\nfi\necho \"$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ\" >&5\necho \"${ECHO_T}$lt_prog_compiler_pic_works_GCJ\" >&6\n\nif test x\"$lt_prog_compiler_pic_works_GCJ\" = xyes; then\n    case $lt_prog_compiler_pic_GCJ in\n     \"\" | \" \"*) ;;\n     *) lt_prog_compiler_pic_GCJ=\" $lt_prog_compiler_pic_GCJ\" ;;\n     esac\nelse\n    lt_prog_compiler_pic_GCJ=\n     lt_prog_compiler_can_build_shared_GCJ=no\nfi\n\nfi\ncase \"$host_os\" in\n  # For platforms which do not support PIC, -DPIC is meaningless:\n  *djgpp*)\n    lt_prog_compiler_pic_GCJ=\n    ;;\n  *)\n    lt_prog_compiler_pic_GCJ=\"$lt_prog_compiler_pic_GCJ\"\n    ;;\nesac\n\necho \"$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext\" >&5\necho $ECHO_N \"checking if $compiler supports -c -o file.$ac_objext... $ECHO_C\" >&6\nif test \"${lt_cv_prog_compiler_c_o_GCJ+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  lt_cv_prog_compiler_c_o_GCJ=no\n   $rm -r conftest 2>/dev/null\n   mkdir conftest\n   cd conftest\n   mkdir out\n   printf \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n\n   lt_compiler_flag=\"-o out/conftest2.$ac_objext\"\n   # Insert the option either (1) after the last *FLAGS variable, or\n   # (2) before a word containing \"conftest.\", or (3) at the end.\n   # Note that $ac_compile itself does not contain backslashes and begins\n   # with a dollar sign (not a hyphen), so the echo should work correctly.\n   lt_compile=`echo \"$ac_compile\" | $SED \\\n   -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \\\n   -e 's: [^ ]*conftest\\.: $lt_compiler_flag&:; t' \\\n   -e 's:$: $lt_compiler_flag:'`\n   (eval echo \"\\\"\\$as_me:16940: $lt_compile\\\"\" >&5)\n   (eval \"$lt_compile\" 2>out/conftest.err)\n   ac_status=$?\n   cat out/conftest.err >&5\n   echo \"$as_me:16944: \\$? = $ac_status\" >&5\n   if (exit $ac_status) && test -s out/conftest2.$ac_objext\n   then\n     # The compiler can only warn and ignore the option if not recognized\n     # So say no if there are warnings\n     if test ! -s out/conftest.err; then\n       lt_cv_prog_compiler_c_o_GCJ=yes\n     fi\n   fi\n   chmod u+w .\n   $rm conftest*\n   # SGI C++ compiler will create directory out/ii_files/ for\n   # template instantiation\n   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files\n   $rm out/* && rmdir out\n   cd ..\n   rmdir conftest\n   $rm conftest*\n\nfi\necho \"$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ\" >&5\necho \"${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ\" >&6\n\n\nhard_links=\"nottested\"\nif test \"$lt_cv_prog_compiler_c_o_GCJ\" = no && test \"$need_locks\" != no; then\n  # do not overwrite the value of need_locks provided by the user\n  echo \"$as_me:$LINENO: checking if we can lock with hard links\" >&5\necho $ECHO_N \"checking if we can lock with hard links... $ECHO_C\" >&6\n  hard_links=yes\n  $rm conftest*\n  ln conftest.a conftest.b 2>/dev/null && hard_links=no\n  touch conftest.a\n  ln conftest.a conftest.b 2>&5 || hard_links=no\n  ln conftest.a conftest.b 2>/dev/null && hard_links=no\n  echo \"$as_me:$LINENO: result: $hard_links\" >&5\necho \"${ECHO_T}$hard_links\" >&6\n  if test \"$hard_links\" = no; then\n    { echo \"$as_me:$LINENO: WARNING: \\`$CC' does not support \\`-c -o', so \\`make -j' may be unsafe\" >&5\necho \"$as_me: WARNING: \\`$CC' does not support \\`-c -o', so \\`make -j' may be unsafe\" >&2;}\n    need_locks=warn\n  fi\nelse\n  need_locks=no\nfi\n\necho \"$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries\" >&5\necho $ECHO_N \"checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C\" >&6\n\n  runpath_var=\n  allow_undefined_flag_GCJ=\n  enable_shared_with_static_runtimes_GCJ=no\n  archive_cmds_GCJ=\n  archive_expsym_cmds_GCJ=\n  old_archive_From_new_cmds_GCJ=\n  old_archive_from_expsyms_cmds_GCJ=\n  export_dynamic_flag_spec_GCJ=\n  whole_archive_flag_spec_GCJ=\n  thread_safe_flag_spec_GCJ=\n  hardcode_libdir_flag_spec_GCJ=\n  hardcode_libdir_flag_spec_ld_GCJ=\n  hardcode_libdir_separator_GCJ=\n  hardcode_direct_GCJ=no\n  hardcode_minus_L_GCJ=no\n  hardcode_shlibpath_var_GCJ=unsupported\n  link_all_deplibs_GCJ=unknown\n  hardcode_automatic_GCJ=no\n  module_cmds_GCJ=\n  module_expsym_cmds_GCJ=\n  always_export_symbols_GCJ=no\n  export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\\''s/.* //'\\'' | sort | uniq > $export_symbols'\n  # include_expsyms should be a list of space-separated symbols to be *always*\n  # included in the symbol list\n  include_expsyms_GCJ=\n  # exclude_expsyms can be an extended regexp of symbols to exclude\n  # it will be wrapped by ` (' and `)$', so one must not match beginning or\n  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',\n  # as well as any symbol that contains `d'.\n  exclude_expsyms_GCJ=\"_GLOBAL_OFFSET_TABLE_\"\n  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out\n  # platforms (ab)use it in PIC code, but their linkers get confused if\n  # the symbol is explicitly referenced.  Since portable code cannot\n  # rely on this symbol name, it's probably fine to never include it in\n  # preloaded symbol tables.\n  extract_expsyms_cmds=\n\n  case $host_os in\n  cygwin* | mingw* | pw32*)\n    # FIXME: the MSVC++ port hasn't been tested in a loooong time\n    # When not using gcc, we currently assume that we are using\n    # Microsoft Visual C++.\n    if test \"$GCC\" != yes; then\n      with_gnu_ld=no\n    fi\n    ;;\n  openbsd*)\n    with_gnu_ld=no\n    ;;\n  esac\n\n  ld_shlibs_GCJ=yes\n  if test \"$with_gnu_ld\" = yes; then\n    # If archive_cmds runs LD, not CC, wlarc should be empty\n    wlarc='${wl}'\n\n    # See if GNU ld supports shared libraries.\n    case $host_os in\n    aix3* | aix4* | aix5*)\n      # On AIX/PPC, the GNU linker is very broken\n      if test \"$host_cpu\" != ia64; then\n\tld_shlibs_GCJ=no\n\tcat <<EOF 1>&2\n\n*** Warning: the GNU linker, at least up to release 2.9.1, is reported\n*** to be unable to reliably create shared libraries on AIX.\n*** Therefore, libtool is disabling shared libraries support.  If you\n*** really care for shared libraries, you may want to modify your PATH\n*** so that a non-GNU linker is found, and then restart.\n\nEOF\n      fi\n      ;;\n\n    amigaos*)\n      archive_cmds_GCJ='$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)'\n      hardcode_libdir_flag_spec_GCJ='-L$libdir'\n      hardcode_minus_L_GCJ=yes\n\n      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports\n      # that the semantics of dynamic libraries on AmigaOS, at least up\n      # to version 4, is to share data among multiple programs linked\n      # with the same dynamic library.  Since this doesn't match the\n      # behavior of shared libraries on other platforms, we can't use\n      # them.\n      ld_shlibs_GCJ=no\n      ;;\n\n    beos*)\n      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then\n\tallow_undefined_flag_GCJ=unsupported\n\t# Joseph Beckenbach <jrb3@best.com> says some releases of gcc\n\t# support --undefined.  This deserves some investigation.  FIXME\n\tarchive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'\n      else\n\tld_shlibs_GCJ=no\n      fi\n      ;;\n\n    cygwin* | mingw* | pw32*)\n      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,\n      # as there is no search path for DLLs.\n      hardcode_libdir_flag_spec_GCJ='-L$libdir'\n      allow_undefined_flag_GCJ=unsupported\n      always_export_symbols_GCJ=no\n      enable_shared_with_static_runtimes_GCJ=yes\n      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\\''/^[BCDGS] /s/.* \\([^ ]*\\)/\\1 DATA/'\\'' | $SED -e '\\''/^[AITW] /s/.* //'\\'' | sort | uniq > $export_symbols'\n\n      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then\n        archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'\n\t# If the export-symbols file already is a .def file (1st line\n\t# is EXPORTS), use it as is; otherwise, prepend...\n\tarchive_expsym_cmds_GCJ='if test \"x`$SED 1q $export_symbols`\" = xEXPORTS; then\n\t  cp $export_symbols $output_objdir/$soname.def;\n\telse\n\t  echo EXPORTS > $output_objdir/$soname.def;\n\t  cat $export_symbols >> $output_objdir/$soname.def;\n\tfi~\n\t$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'\n      else\n\tld_shlibs=no\n      fi\n      ;;\n\n    netbsd*)\n      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then\n\tarchive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'\n\twlarc=\n      else\n\tarchive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'\n\tarchive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'\n      fi\n      ;;\n\n    solaris* | sysv5*)\n      if $LD -v 2>&1 | grep 'BFD 2\\.8' > /dev/null; then\n\tld_shlibs_GCJ=no\n\tcat <<EOF 1>&2\n\n*** Warning: The releases 2.8.* of the GNU linker cannot reliably\n*** create shared libraries on Solaris systems.  Therefore, libtool\n*** is disabling shared libraries support.  We urge you to upgrade GNU\n*** binutils to release 2.9.1 or newer.  Another option is to modify\n*** your PATH or compiler configuration so that the native linker is\n*** used, and then restart.\n\nEOF\n      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then\n\tarchive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'\n\tarchive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'\n      else\n\tld_shlibs_GCJ=no\n      fi\n      ;;\n\n    sunos4*)\n      archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'\n      wlarc=\n      hardcode_direct_GCJ=yes\n      hardcode_shlibpath_var_GCJ=no\n      ;;\n\n  linux*)\n    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then\n        tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'\n\tarchive_cmds_GCJ=\"$tmp_archive_cmds\"\n      supports_anon_versioning=no\n      case `$LD -v 2>/dev/null` in\n        *\\ 01.* | *\\ 2.[0-9].* | *\\ 2.10.*) ;; # catch versions < 2.11\n        *\\ 2.11.93.0.2\\ *) supports_anon_versioning=yes ;; # RH7.3 ...\n        *\\ 2.11.92.0.12\\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...\n        *\\ 2.11.*) ;; # other 2.11 versions\n        *) supports_anon_versioning=yes ;;\n      esac\n      if test $supports_anon_versioning = yes; then\n        archive_expsym_cmds_GCJ='$echo \"{ global:\" > $output_objdir/$libname.ver~\ncat $export_symbols | sed -e \"s/\\(.*\\)/\\1;/\" >> $output_objdir/$libname.ver~\n$echo \"local: *; };\" >> $output_objdir/$libname.ver~\n        $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'\n      else\n        archive_expsym_cmds_GCJ=\"$tmp_archive_cmds\"\n      fi\n    else\n      ld_shlibs_GCJ=no\n    fi\n    ;;\n\n    *)\n      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then\n\tarchive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'\n\tarchive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'\n      else\n\tld_shlibs_GCJ=no\n      fi\n      ;;\n    esac\n\n    if test \"$ld_shlibs_GCJ\" = yes; then\n      runpath_var=LD_RUN_PATH\n      hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'\n      export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'\n      # ancient GNU ld didn't support --whole-archive et. al.\n      if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then\n \twhole_archive_flag_spec_GCJ=\"$wlarc\"'--whole-archive$convenience '\"$wlarc\"'--no-whole-archive'\n      else\n  \twhole_archive_flag_spec_GCJ=\n      fi\n    fi\n  else\n    # PORTME fill in a description of your system's linker (not GNU ld)\n    case $host_os in\n    aix3*)\n      allow_undefined_flag_GCJ=unsupported\n      always_export_symbols_GCJ=yes\n      archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'\n      # Note: this linker hardcodes the directories in LIBPATH if there\n      # are no directories specified by -L.\n      hardcode_minus_L_GCJ=yes\n      if test \"$GCC\" = yes && test -z \"$link_static_flag\"; then\n\t# Neither direct hardcoding nor static linking is supported with a\n\t# broken collect2.\n\thardcode_direct_GCJ=unsupported\n      fi\n      ;;\n\n    aix4* | aix5*)\n      if test \"$host_cpu\" = ia64; then\n\t# On IA64, the linker does run time linking by default, so we don't\n\t# have to do anything special.\n\taix_use_runtimelinking=no\n\texp_sym_flag='-Bexport'\n\tno_entry_flag=\"\"\n      else\n\t# If we're using GNU nm, then we don't want the \"-C\" option.\n\t# -C means demangle to AIX nm, but means don't demangle with GNU nm\n\tif $NM -V 2>&1 | grep 'GNU' > /dev/null; then\n\t  export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\\''{ if (((\\$2 == \"T\") || (\\$2 == \"D\") || (\\$2 == \"B\")) && (substr(\\$3,1,1) != \".\")) { print \\$3 } }'\\'' | sort -u > $export_symbols'\n\telse\n\t  export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\\''{ if (((\\$2 == \"T\") || (\\$2 == \"D\") || (\\$2 == \"B\")) && (substr(\\$3,1,1) != \".\")) { print \\$3 } }'\\'' | sort -u > $export_symbols'\n\tfi\n\taix_use_runtimelinking=no\n\n\t# Test if we are trying to use run time linking or normal\n\t# AIX style linking. If -brtl is somewhere in LDFLAGS, we\n\t# need to do runtime linking.\n\tcase $host_os in aix4.[23]|aix4.[23].*|aix5*)\n\t  for ld_flag in $LDFLAGS; do\n  \t  if (test $ld_flag = \"-brtl\" || test $ld_flag = \"-Wl,-brtl\"); then\n  \t    aix_use_runtimelinking=yes\n  \t    break\n  \t  fi\n\t  done\n\tesac\n\n\texp_sym_flag='-bexport'\n\tno_entry_flag='-bnoentry'\n      fi\n\n      # When large executables or shared objects are built, AIX ld can\n      # have problems creating the table of contents.  If linking a library\n      # or program results in \"error TOC overflow\" add -mminimal-toc to\n      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not\n      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.\n\n      archive_cmds_GCJ=''\n      hardcode_direct_GCJ=yes\n      hardcode_libdir_separator_GCJ=':'\n      link_all_deplibs_GCJ=yes\n\n      if test \"$GCC\" = yes; then\n\tcase $host_os in aix4.012|aix4.012.*)\n\t# We only want to do this on AIX 4.2 and lower, the check\n\t# below for broken collect2 doesn't work under 4.3+\n\t  collect2name=`${CC} -print-prog-name=collect2`\n\t  if test -f \"$collect2name\" && \\\n  \t   strings \"$collect2name\" | grep resolve_lib_name >/dev/null\n\t  then\n  \t  # We have reworked collect2\n  \t  hardcode_direct_GCJ=yes\n\t  else\n  \t  # We have old collect2\n  \t  hardcode_direct_GCJ=unsupported\n  \t  # It fails to find uninstalled libraries when the uninstalled\n  \t  # path is not listed in the libpath.  Setting hardcode_minus_L\n  \t  # to unsupported forces relinking\n  \t  hardcode_minus_L_GCJ=yes\n  \t  hardcode_libdir_flag_spec_GCJ='-L$libdir'\n  \t  hardcode_libdir_separator_GCJ=\n\t  fi\n\tesac\n\tshared_flag='-shared'\n      else\n\t# not using gcc\n\tif test \"$host_cpu\" = ia64; then\n  \t# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release\n  \t# chokes on -Wl,-G. The following line is correct:\n\t  shared_flag='-G'\n\telse\n  \tif test \"$aix_use_runtimelinking\" = yes; then\n\t    shared_flag='${wl}-G'\n\t  else\n\t    shared_flag='${wl}-bM:SRE'\n  \tfi\n\tfi\n      fi\n\n      # It seems that -bexpall does not export symbols beginning with\n      # underscore (_), so it is better to generate a list of symbols to export.\n      always_export_symbols_GCJ=yes\n      if test \"$aix_use_runtimelinking\" = yes; then\n\t# Warning - without using the other runtime loading flags (-brtl),\n\t# -berok will link without error, but may produce a broken library.\n\tallow_undefined_flag_GCJ='-berok'\n       # Determine the default libpath from the value encoded in an empty executable.\n       cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n\naix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\\(.*\\)$/\\1/; p; }\n}'`\n# Check for a 64-bit object if we didn't find anything.\nif test -z \"$aix_libpath\"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\\(.*\\)$/\\1/; p; }\n}'`; fi\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nif test -z \"$aix_libpath\"; then aix_libpath=\"/usr/lib:/lib\"; fi\n\n       hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'\"$aix_libpath\"\n\tarchive_expsym_cmds_GCJ=\"\\$CC\"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test \"x${allow_undefined_flag}\" != \"x\"; then echo \"${wl}${allow_undefined_flag}\"; else :; fi` '\"\\${wl}$no_entry_flag \\${wl}$exp_sym_flag:\\$export_symbols $shared_flag\"\n       else\n\tif test \"$host_cpu\" = ia64; then\n\t  hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'\n\t  allow_undefined_flag_GCJ=\"-z nodefs\"\n\t  archive_expsym_cmds_GCJ=\"\\$CC $shared_flag\"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '\"\\${wl}$no_entry_flag \\${wl}$exp_sym_flag:\\$export_symbols\"\n\telse\n\t # Determine the default libpath from the value encoded in an empty executable.\n\t cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n\naix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\\(.*\\)$/\\1/; p; }\n}'`\n# Check for a 64-bit object if we didn't find anything.\nif test -z \"$aix_libpath\"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\\(.*\\)$/\\1/; p; }\n}'`; fi\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nif test -z \"$aix_libpath\"; then aix_libpath=\"/usr/lib:/lib\"; fi\n\n\t hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'\"$aix_libpath\"\n\t  # Warning - without using the other run time loading flags,\n\t  # -berok will link without error, but may produce a broken library.\n\t  no_undefined_flag_GCJ=' ${wl}-bernotok'\n\t  allow_undefined_flag_GCJ=' ${wl}-berok'\n\t  # -bexpall does not export symbols beginning with underscore (_)\n\t  always_export_symbols_GCJ=yes\n\t  # Exported symbols can be pulled into shared objects from archives\n\t  whole_archive_flag_spec_GCJ=' '\n\t  archive_cmds_need_lc_GCJ=yes\n\t  # This is similar to how AIX traditionally builds it's shared libraries.\n\t  archive_expsym_cmds_GCJ=\"\\$CC $shared_flag\"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'\n\tfi\n      fi\n      ;;\n\n    amigaos*)\n      archive_cmds_GCJ='$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)'\n      hardcode_libdir_flag_spec_GCJ='-L$libdir'\n      hardcode_minus_L_GCJ=yes\n      # see comment about different semantics on the GNU ld section\n      ld_shlibs_GCJ=no\n      ;;\n\n    bsdi4*)\n      export_dynamic_flag_spec_GCJ=-rdynamic\n      ;;\n\n    cygwin* | mingw* | pw32*)\n      # When not using gcc, we currently assume that we are using\n      # Microsoft Visual C++.\n      # hardcode_libdir_flag_spec is actually meaningless, as there is\n      # no search path for DLLs.\n      hardcode_libdir_flag_spec_GCJ=' '\n      allow_undefined_flag_GCJ=unsupported\n      # Tell ltmain to make .lib files, not .a files.\n      libext=lib\n      # Tell ltmain to make .dll files, not .so files.\n      shrext_cmds=\".dll\"\n      # FIXME: Setting linknames here is a bad hack.\n      archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo \"$deplibs\" | $SED -e '\\''s/ -lc$//'\\''` -link -dll~linknames='\n      # The linker will automatically build a .lib file if we build a DLL.\n      old_archive_From_new_cmds_GCJ='true'\n      # FIXME: Should let the user specify the lib program.\n      old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'\n      fix_srcfile_path='`cygpath -w \"$srcfile\"`'\n      enable_shared_with_static_runtimes_GCJ=yes\n      ;;\n\n    darwin* | rhapsody*)\n    if test \"$GXX\" = yes ; then\n      archive_cmds_need_lc_GCJ=no\n      case \"$host_os\" in\n      rhapsody* | darwin1.[012])\n\tallow_undefined_flag_GCJ='-undefined suppress'\n\t;;\n      *) # Darwin 1.3 on\n      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then\n      \tallow_undefined_flag_GCJ='-flat_namespace -undefined suppress'\n      else\n        case ${MACOSX_DEPLOYMENT_TARGET} in\n          10.[012])\n            allow_undefined_flag_GCJ='-flat_namespace -undefined suppress'\n            ;;\n          10.*)\n            allow_undefined_flag_GCJ='-undefined dynamic_lookup'\n            ;;\n        esac\n      fi\n\t;;\n      esac\n    \tlt_int_apple_cc_single_mod=no\n    \toutput_verbose_link_cmd='echo'\n    \tif $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then\n    \t  lt_int_apple_cc_single_mod=yes\n    \tfi\n    \tif test \"X$lt_int_apple_cc_single_mod\" = Xyes ; then\n    \t  archive_cmds_GCJ='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'\n    \telse\n        archive_cmds_GCJ='$CC -r ${wl}-bind_at_load -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'\n      fi\n      module_cmds_GCJ='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'\n      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's\n        if test \"X$lt_int_apple_cc_single_mod\" = Xyes ; then\n          archive_expsym_cmds_GCJ='sed -e \"s,#.*,,\" -e \"s,^[    ]*,,\" -e \"s,^\\(..*\\),_&,\" < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'\n        else\n          archive_expsym_cmds_GCJ='sed -e \"s,#.*,,\" -e \"s,^[    ]*,,\" -e \"s,^\\(..*\\),_&,\" < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'\n        fi\n          module_expsym_cmds_GCJ='sed -e \"s,#.*,,\" -e \"s,^[    ]*,,\" -e \"s,^\\(..*\\),_&,\" < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'\n      hardcode_direct_GCJ=no\n      hardcode_automatic_GCJ=yes\n      hardcode_shlibpath_var_GCJ=unsupported\n      whole_archive_flag_spec_GCJ='-all_load $convenience'\n      link_all_deplibs_GCJ=yes\n    else\n      ld_shlibs_GCJ=no\n    fi\n      ;;\n\n    dgux*)\n      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_libdir_flag_spec_GCJ='-L$libdir'\n      hardcode_shlibpath_var_GCJ=no\n      ;;\n\n    freebsd1*)\n      ld_shlibs_GCJ=no\n      ;;\n\n    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor\n    # support.  Future versions do this automatically, but an explicit c++rt0.o\n    # does not break anything, and helps significantly (at the cost of a little\n    # extra space).\n    freebsd2.2*)\n      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'\n      hardcode_libdir_flag_spec_GCJ='-R$libdir'\n      hardcode_direct_GCJ=yes\n      hardcode_shlibpath_var_GCJ=no\n      ;;\n\n    # Unfortunately, older versions of FreeBSD 2 do not have this feature.\n    freebsd2*)\n      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_direct_GCJ=yes\n      hardcode_minus_L_GCJ=yes\n      hardcode_shlibpath_var_GCJ=no\n      ;;\n\n    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.\n    freebsd* | kfreebsd*-gnu)\n      archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'\n      hardcode_libdir_flag_spec_GCJ='-R$libdir'\n      hardcode_direct_GCJ=yes\n      hardcode_shlibpath_var_GCJ=no\n      ;;\n\n    hpux9*)\n      if test \"$GCC\" = yes; then\n\tarchive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'\n      else\n\tarchive_cmds_GCJ='$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'\n      fi\n      hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'\n      hardcode_libdir_separator_GCJ=:\n      hardcode_direct_GCJ=yes\n\n      # hardcode_minus_L: Not really in the search PATH,\n      # but as the default location of the library.\n      hardcode_minus_L_GCJ=yes\n      export_dynamic_flag_spec_GCJ='${wl}-E'\n      ;;\n\n    hpux10* | hpux11*)\n      if test \"$GCC\" = yes -a \"$with_gnu_ld\" = no; then\n\tcase \"$host_cpu\" in\n\thppa*64*|ia64*)\n\t  archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\t*)\n\t  archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'\n\t  ;;\n\tesac\n      else\n\tcase \"$host_cpu\" in\n\thppa*64*|ia64*)\n\t  archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  ;;\n\t*)\n\t  archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'\n\t  ;;\n\tesac\n      fi\n      if test \"$with_gnu_ld\" = no; then\n\tcase \"$host_cpu\" in\n\thppa*64*)\n\t  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'\n\t  hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'\n\t  hardcode_libdir_separator_GCJ=:\n\t  hardcode_direct_GCJ=no\n\t  hardcode_shlibpath_var_GCJ=no\n\t  ;;\n\tia64*)\n\t  hardcode_libdir_flag_spec_GCJ='-L$libdir'\n\t  hardcode_direct_GCJ=no\n\t  hardcode_shlibpath_var_GCJ=no\n\n\t  # hardcode_minus_L: Not really in the search PATH,\n\t  # but as the default location of the library.\n\t  hardcode_minus_L_GCJ=yes\n\t  ;;\n\t*)\n\t  hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'\n\t  hardcode_libdir_separator_GCJ=:\n\t  hardcode_direct_GCJ=yes\n\t  export_dynamic_flag_spec_GCJ='${wl}-E'\n\n\t  # hardcode_minus_L: Not really in the search PATH,\n\t  # but as the default location of the library.\n\t  hardcode_minus_L_GCJ=yes\n\t  ;;\n\tesac\n      fi\n      ;;\n\n    irix5* | irix6* | nonstopux*)\n      if test \"$GCC\" = yes; then\n\tarchive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n \"$verstring\" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'\n      else\n\tarchive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n \"$verstring\" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'\n\thardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'\n      fi\n      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'\n      hardcode_libdir_separator_GCJ=:\n      link_all_deplibs_GCJ=yes\n      ;;\n\n    netbsd*)\n      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then\n\tarchive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out\n      else\n\tarchive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF\n      fi\n      hardcode_libdir_flag_spec_GCJ='-R$libdir'\n      hardcode_direct_GCJ=yes\n      hardcode_shlibpath_var_GCJ=no\n      ;;\n\n    newsos6)\n      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_direct_GCJ=yes\n      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'\n      hardcode_libdir_separator_GCJ=:\n      hardcode_shlibpath_var_GCJ=no\n      ;;\n\n    openbsd*)\n      hardcode_direct_GCJ=yes\n      hardcode_shlibpath_var_GCJ=no\n      if test -z \"`echo __ELF__ | $CC -E - | grep __ELF__`\" || test \"$host_os-$host_cpu\" = \"openbsd2.8-powerpc\"; then\n\tarchive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n\thardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'\n\texport_dynamic_flag_spec_GCJ='${wl}-E'\n      else\n       case $host_os in\n\t openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)\n\t   archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'\n\t   hardcode_libdir_flag_spec_GCJ='-R$libdir'\n\t   ;;\n\t *)\n\t   archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'\n\t   hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'\n\t   ;;\n       esac\n      fi\n      ;;\n\n    os2*)\n      hardcode_libdir_flag_spec_GCJ='-L$libdir'\n      hardcode_minus_L_GCJ=yes\n      allow_undefined_flag_GCJ=unsupported\n      archive_cmds_GCJ='$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'\n      old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'\n      ;;\n\n    osf3*)\n      if test \"$GCC\" = yes; then\n\tallow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\\*'\n\tarchive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n \"$verstring\" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'\n      else\n\tallow_undefined_flag_GCJ=' -expect_unresolved \\*'\n\tarchive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n \"$verstring\" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'\n      fi\n      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'\n      hardcode_libdir_separator_GCJ=:\n      ;;\n\n    osf4* | osf5*)\t# as osf3* with the addition of -msym flag\n      if test \"$GCC\" = yes; then\n\tallow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\\*'\n\tarchive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n \"$verstring\" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'\n\thardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'\n      else\n\tallow_undefined_flag_GCJ=' -expect_unresolved \\*'\n\tarchive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n \"$verstring\" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'\n\tarchive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf \"%s %s\\\\n\" -exported_symbol \"\\$i\" >> $lib.exp; done; echo \"-hidden\">> $lib.exp~\n\t$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n \"$verstring\" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'\n\n\t# Both c and cxx compiler support -rpath directly\n\thardcode_libdir_flag_spec_GCJ='-rpath $libdir'\n      fi\n      hardcode_libdir_separator_GCJ=:\n      ;;\n\n    sco3.2v5*)\n      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_shlibpath_var_GCJ=no\n      export_dynamic_flag_spec_GCJ='${wl}-Bexport'\n      runpath_var=LD_RUN_PATH\n      hardcode_runpath_var=yes\n      ;;\n\n    solaris*)\n      no_undefined_flag_GCJ=' -z text'\n      if test \"$GCC\" = yes; then\n\tarchive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'\n\tarchive_expsym_cmds_GCJ='$echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~$echo \"local: *; };\" >> $lib.exp~\n\t  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'\n      else\n\tarchive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\tarchive_expsym_cmds_GCJ='$echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~$echo \"local: *; };\" >> $lib.exp~\n  \t$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'\n      fi\n      hardcode_libdir_flag_spec_GCJ='-R$libdir'\n      hardcode_shlibpath_var_GCJ=no\n      case $host_os in\n      solaris2.[0-5] | solaris2.[0-5].*) ;;\n      *) # Supported since Solaris 2.6 (maybe 2.5.1?)\n\twhole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;\n      esac\n      link_all_deplibs_GCJ=yes\n      ;;\n\n    sunos4*)\n      if test \"x$host_vendor\" = xsequent; then\n\t# Use $CC to link under sequent, because it throws in some extra .o\n\t# files that make .init and .fini sections work.\n\tarchive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\tarchive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'\n      fi\n      hardcode_libdir_flag_spec_GCJ='-L$libdir'\n      hardcode_direct_GCJ=yes\n      hardcode_minus_L_GCJ=yes\n      hardcode_shlibpath_var_GCJ=no\n      ;;\n\n    sysv4)\n      case $host_vendor in\n\tsni)\n\t  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  hardcode_direct_GCJ=yes # is this really true???\n\t;;\n\tsiemens)\n\t  ## LD is ld it makes a PLAMLIB\n\t  ## CC just makes a GrossModule.\n\t  archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'\n\t  reload_cmds_GCJ='$CC -r -o $output$reload_objs'\n\t  hardcode_direct_GCJ=no\n        ;;\n\tmotorola)\n\t  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\t  hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie\n\t;;\n      esac\n      runpath_var='LD_RUN_PATH'\n      hardcode_shlibpath_var_GCJ=no\n      ;;\n\n    sysv4.3*)\n      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_shlibpath_var_GCJ=no\n      export_dynamic_flag_spec_GCJ='-Bexport'\n      ;;\n\n    sysv4*MP*)\n      if test -d /usr/nec; then\n\tarchive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n\thardcode_shlibpath_var_GCJ=no\n\trunpath_var=LD_RUN_PATH\n\thardcode_runpath_var=yes\n\tld_shlibs_GCJ=yes\n      fi\n      ;;\n\n    sysv4.2uw2*)\n      archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_direct_GCJ=yes\n      hardcode_minus_L_GCJ=no\n      hardcode_shlibpath_var_GCJ=no\n      hardcode_runpath_var=yes\n      runpath_var=LD_RUN_PATH\n      ;;\n\n   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)\n      no_undefined_flag_GCJ='${wl}-z ${wl}text'\n      if test \"$GCC\" = yes; then\n\tarchive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'\n      else\n\tarchive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'\n      fi\n      runpath_var='LD_RUN_PATH'\n      hardcode_shlibpath_var_GCJ=no\n      ;;\n\n    sysv5*)\n      no_undefined_flag_GCJ=' -z text'\n      # $CC -shared without GNU ld will not create a library from C++\n      # object files and a static libstdc++, better avoid it by now\n      archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      archive_expsym_cmds_GCJ='$echo \"{ global:\" > $lib.exp~cat $export_symbols | $SED -e \"s/\\(.*\\)/\\1;/\" >> $lib.exp~$echo \"local: *; };\" >> $lib.exp~\n  \t\t$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'\n      hardcode_libdir_flag_spec_GCJ=\n      hardcode_shlibpath_var_GCJ=no\n      runpath_var='LD_RUN_PATH'\n      ;;\n\n    uts4*)\n      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'\n      hardcode_libdir_flag_spec_GCJ='-L$libdir'\n      hardcode_shlibpath_var_GCJ=no\n      ;;\n\n    *)\n      ld_shlibs_GCJ=no\n      ;;\n    esac\n  fi\n\necho \"$as_me:$LINENO: result: $ld_shlibs_GCJ\" >&5\necho \"${ECHO_T}$ld_shlibs_GCJ\" >&6\ntest \"$ld_shlibs_GCJ\" = no && can_build_shared=no\n\nvariables_saved_for_relink=\"PATH $shlibpath_var $runpath_var\"\nif test \"$GCC\" = yes; then\n  variables_saved_for_relink=\"$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH\"\nfi\n\n#\n# Do we need to explicitly link libc?\n#\ncase \"x$archive_cmds_need_lc_GCJ\" in\nx|xyes)\n  # Assume -lc should be added\n  archive_cmds_need_lc_GCJ=yes\n\n  if test \"$enable_shared\" = yes && test \"$GCC\" = yes; then\n    case $archive_cmds_GCJ in\n    *'~'*)\n      # FIXME: we may have to deal with multi-command sequences.\n      ;;\n    '$CC '*)\n      # Test whether the compiler implicitly links with -lc since on some\n      # systems, -lgcc has to come before -lc. If gcc already passes -lc\n      # to ld, don't add -lc before -lgcc.\n      echo \"$as_me:$LINENO: checking whether -lc should be explicitly linked in\" >&5\necho $ECHO_N \"checking whether -lc should be explicitly linked in... $ECHO_C\" >&6\n      $rm conftest*\n      printf \"$lt_simple_compile_test_code\" > conftest.$ac_ext\n\n      if { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } 2>conftest.err; then\n        soname=conftest\n        lib=conftest\n        libobjs=conftest.$ac_objext\n        deplibs=\n        wl=$lt_prog_compiler_wl_GCJ\n        compiler_flags=-v\n        linker_flags=-v\n        verstring=\n        output_objdir=.\n        libname=conftest\n        lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ\n        allow_undefined_flag_GCJ=\n        if { (eval echo \"$as_me:$LINENO: \\\"$archive_cmds_GCJ 2\\>\\&1 \\| grep \\\" -lc \\\" \\>/dev/null 2\\>\\&1\\\"\") >&5\n  (eval $archive_cmds_GCJ 2\\>\\&1 \\| grep \\\" -lc \\\" \\>/dev/null 2\\>\\&1) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }\n        then\n\t  archive_cmds_need_lc_GCJ=no\n        else\n\t  archive_cmds_need_lc_GCJ=yes\n        fi\n        allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag\n      else\n        cat conftest.err 1>&5\n      fi\n      $rm conftest*\n      echo \"$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ\" >&5\necho \"${ECHO_T}$archive_cmds_need_lc_GCJ\" >&6\n      ;;\n    esac\n  fi\n  ;;\nesac\n\necho \"$as_me:$LINENO: checking dynamic linker characteristics\" >&5\necho $ECHO_N \"checking dynamic linker characteristics... $ECHO_C\" >&6\nlibrary_names_spec=\nlibname_spec='lib$name'\nsoname_spec=\nshrext_cmds=\".so\"\npostinstall_cmds=\npostuninstall_cmds=\nfinish_cmds=\nfinish_eval=\nshlibpath_var=\nshlibpath_overrides_runpath=unknown\nversion_type=none\ndynamic_linker=\"$host_os ld.so\"\nsys_lib_dlsearch_path_spec=\"/lib /usr/lib\"\nif test \"$GCC\" = yes; then\n  sys_lib_search_path_spec=`$CC -print-search-dirs | grep \"^libraries:\" | $SED -e \"s/^libraries://\" -e \"s,=/,/,g\"`\n  if echo \"$sys_lib_search_path_spec\" | grep ';' >/dev/null ; then\n    # if the path contains \";\" then we assume it to be the separator\n    # otherwise default to the standard path separator (i.e. \":\") - it is\n    # assumed that no part of a normal pathname contains \";\" but that should\n    # okay in the real world where \";\" in dirpaths is itself problematic.\n    sys_lib_search_path_spec=`echo \"$sys_lib_search_path_spec\" | $SED -e 's/;/ /g'`\n  else\n    sys_lib_search_path_spec=`echo \"$sys_lib_search_path_spec\" | $SED  -e \"s/$PATH_SEPARATOR/ /g\"`\n  fi\nelse\n  sys_lib_search_path_spec=\"/lib /usr/lib /usr/local/lib\"\nfi\nneed_lib_prefix=unknown\nhardcode_into_libs=no\n\n# when you set need_version to no, make sure it does not cause -set_version\n# flags to be left without arguments\nneed_version=unknown\n\ncase $host_os in\naix3*)\n  version_type=linux\n  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'\n  shlibpath_var=LIBPATH\n\n  # AIX 3 has no versioning support, so we append a major version to the name.\n  soname_spec='${libname}${release}${shared_ext}$major'\n  ;;\n\naix4* | aix5*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  hardcode_into_libs=yes\n  if test \"$host_cpu\" = ia64; then\n    # AIX 5 supports IA64\n    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'\n    shlibpath_var=LD_LIBRARY_PATH\n  else\n    # With GCC up to 2.95.x, collect2 would create an import file\n    # for dependence libraries.  The import file would start with\n    # the line `#! .'.  This would cause the generated library to\n    # depend on `.', always an invalid library.  This was fixed in\n    # development snapshots of GCC prior to 3.0.\n    case $host_os in\n      aix4 | aix4.[01] | aix4.[01].*)\n      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'\n\t   echo ' yes '\n\t   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then\n\t:\n      else\n\tcan_build_shared=no\n      fi\n      ;;\n    esac\n    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct\n    # soname into executable. Probably we can add versioning support to\n    # collect2, so additional links can be useful in future.\n    if test \"$aix_use_runtimelinking\" = yes; then\n      # If using run time linking (on AIX 4.2 or later) use lib<name>.so\n      # instead of lib<name>.a to let people know that these are not\n      # typical AIX shared libraries.\n      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n    else\n      # We preserve .a as extension for shared libraries through AIX4.2\n      # and later when we are not doing run time linking.\n      library_names_spec='${libname}${release}.a $libname.a'\n      soname_spec='${libname}${release}${shared_ext}$major'\n    fi\n    shlibpath_var=LIBPATH\n  fi\n  ;;\n\namigaos*)\n  library_names_spec='$libname.ixlibrary $libname.a'\n  # Create ${libname}_ixlibrary.a entries in /sys/libs.\n  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo \"X$lib\" | $Xsed -e '\\''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'\n  ;;\n\nbeos*)\n  library_names_spec='${libname}${shared_ext}'\n  dynamic_linker=\"$host_os ld.so\"\n  shlibpath_var=LIBRARY_PATH\n  ;;\n\nbsdi4*)\n  version_type=linux\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  sys_lib_search_path_spec=\"/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib\"\n  sys_lib_dlsearch_path_spec=\"/shlib /usr/lib /usr/local/lib\"\n  # the default ld.so.conf also contains /usr/contrib/lib and\n  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow\n  # libtool to hard-code these into programs\n  ;;\n\ncygwin* | mingw* | pw32*)\n  version_type=windows\n  shrext_cmds=\".dll\"\n  need_version=no\n  need_lib_prefix=no\n\n  case $GCC,$host_os in\n  yes,cygwin* | yes,mingw* | yes,pw32*)\n    library_names_spec='$libname.dll.a'\n    # DLL is installed to $(libdir)/../bin by postinstall_cmds\n    postinstall_cmds='base_file=`basename \\${file}`~\n      dlpath=`$SHELL 2>&1 -c '\\''. $dir/'\\''\\${base_file}'\\''i;echo \\$dlname'\\''`~\n      dldir=$destdir/`dirname \\$dlpath`~\n      test -d \\$dldir || mkdir -p \\$dldir~\n      $install_prog $dir/$dlname \\$dldir/$dlname'\n    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\\''. $file; echo \\$dlname'\\''`~\n      dlpath=$dir/\\$dldll~\n       $rm \\$dlpath'\n    shlibpath_overrides_runpath=yes\n\n    case $host_os in\n    cygwin*)\n      # Cygwin DLLs use 'cyg' prefix rather than 'lib'\n      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'\n      sys_lib_search_path_spec=\"/usr/lib /lib/w32api /lib /usr/local/lib\"\n      ;;\n    mingw*)\n      # MinGW DLLs use traditional 'lib' prefix\n      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'\n      sys_lib_search_path_spec=`$CC -print-search-dirs | grep \"^libraries:\" | $SED -e \"s/^libraries://\" -e \"s,=/,/,g\"`\n      if echo \"$sys_lib_search_path_spec\" | grep ';[c-zC-Z]:/' >/dev/null; then\n        # It is most probably a Windows format PATH printed by\n        # mingw gcc, but we are running on Cygwin. Gcc prints its search\n        # path with ; separators, and with drive letters. We can handle the\n        # drive letters (cygwin fileutils understands them), so leave them,\n        # especially as we might pass files found there to a mingw objdump,\n        # which wouldn't understand a cygwinified path. Ahh.\n        sys_lib_search_path_spec=`echo \"$sys_lib_search_path_spec\" | $SED -e 's/;/ /g'`\n      else\n        sys_lib_search_path_spec=`echo \"$sys_lib_search_path_spec\" | $SED  -e \"s/$PATH_SEPARATOR/ /g\"`\n      fi\n      ;;\n    pw32*)\n      # pw32 DLLs use 'pw' prefix rather than 'lib'\n      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'\n      ;;\n    esac\n    ;;\n\n  *)\n    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'\n    ;;\n  esac\n  dynamic_linker='Win32 ld.exe'\n  # FIXME: first we should search . and the directory the executable is in\n  shlibpath_var=PATH\n  ;;\n\ndarwin* | rhapsody*)\n  dynamic_linker=\"$host_os dyld\"\n  version_type=darwin\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'\n  soname_spec='${libname}${release}${major}$shared_ext'\n  shlibpath_overrides_runpath=yes\n  shlibpath_var=DYLD_LIBRARY_PATH\n  shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'\n  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.\n  if test \"$GCC\" = yes; then\n    sys_lib_search_path_spec=`$CC -print-search-dirs | tr \"\\n\" \"$PATH_SEPARATOR\" | sed -e 's/libraries:/@libraries:/' | tr \"@\" \"\\n\" | grep \"^libraries:\" | sed -e \"s/^libraries://\" -e \"s,=/,/,g\" -e \"s,$PATH_SEPARATOR, ,g\" -e \"s,.*,& /lib /usr/lib /usr/local/lib,g\"`\n  else\n    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'\n  fi\n  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'\n  ;;\n\ndgux*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\nfreebsd1*)\n  dynamic_linker=no\n  ;;\n\nkfreebsd*-gnu)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  dynamic_linker='GNU ld.so'\n  ;;\n\nfreebsd*)\n  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`\n  version_type=freebsd-$objformat\n  case $version_type in\n    freebsd-elf*)\n      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'\n      need_version=no\n      need_lib_prefix=no\n      ;;\n    freebsd-*)\n      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'\n      need_version=yes\n      ;;\n  esac\n  shlibpath_var=LD_LIBRARY_PATH\n  case $host_os in\n  freebsd2*)\n    shlibpath_overrides_runpath=yes\n    ;;\n  freebsd3.01* | freebsdelf3.01*)\n    shlibpath_overrides_runpath=yes\n    hardcode_into_libs=yes\n    ;;\n  *) # from 3.2 on\n    shlibpath_overrides_runpath=no\n    hardcode_into_libs=yes\n    ;;\n  esac\n  ;;\n\ngnu*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  hardcode_into_libs=yes\n  ;;\n\nhpux9* | hpux10* | hpux11*)\n  # Give a soname corresponding to the major version so that dld.sl refuses to\n  # link against other versions.\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=no\n  case \"$host_cpu\" in\n  ia64*)\n    shrext_cmds='.so'\n    hardcode_into_libs=yes\n    dynamic_linker=\"$host_os dld.so\"\n    shlibpath_var=LD_LIBRARY_PATH\n    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.\n    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n    soname_spec='${libname}${release}${shared_ext}$major'\n    if test \"X$HPUX_IA64_MODE\" = X32; then\n      sys_lib_search_path_spec=\"/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib\"\n    else\n      sys_lib_search_path_spec=\"/usr/lib/hpux64 /usr/local/lib/hpux64\"\n    fi\n    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec\n    ;;\n   hppa*64*)\n     shrext_cmds='.sl'\n     hardcode_into_libs=yes\n     dynamic_linker=\"$host_os dld.sl\"\n     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH\n     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.\n     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n     soname_spec='${libname}${release}${shared_ext}$major'\n     sys_lib_search_path_spec=\"/usr/lib/pa20_64 /usr/ccs/lib/pa20_64\"\n     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec\n     ;;\n   *)\n    shrext_cmds='.sl'\n    dynamic_linker=\"$host_os dld.sl\"\n    shlibpath_var=SHLIB_PATH\n    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH\n    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n    soname_spec='${libname}${release}${shared_ext}$major'\n    ;;\n  esac\n  # HP-UX runs *really* slowly unless shared libraries are mode 555.\n  postinstall_cmds='chmod 555 $lib'\n  ;;\n\nirix5* | irix6* | nonstopux*)\n  case $host_os in\n    nonstopux*) version_type=nonstopux ;;\n    *)\n\tif test \"$lt_cv_prog_gnu_ld\" = yes; then\n\t\tversion_type=linux\n\telse\n\t\tversion_type=irix\n\tfi ;;\n  esac\n  need_lib_prefix=no\n  need_version=no\n  soname_spec='${libname}${release}${shared_ext}$major'\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'\n  case $host_os in\n  irix5* | nonstopux*)\n    libsuff= shlibsuff=\n    ;;\n  *)\n    case $LD in # libtool.m4 will add one of these switches to LD\n    *-32|*\"-32 \"|*-melf32bsmip|*\"-melf32bsmip \")\n      libsuff= shlibsuff= libmagic=32-bit;;\n    *-n32|*\"-n32 \"|*-melf32bmipn32|*\"-melf32bmipn32 \")\n      libsuff=32 shlibsuff=N32 libmagic=N32;;\n    *-64|*\"-64 \"|*-melf64bmip|*\"-melf64bmip \")\n      libsuff=64 shlibsuff=64 libmagic=64-bit;;\n    *) libsuff= shlibsuff= libmagic=never-match;;\n    esac\n    ;;\n  esac\n  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH\n  shlibpath_overrides_runpath=no\n  sys_lib_search_path_spec=\"/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}\"\n  sys_lib_dlsearch_path_spec=\"/usr/lib${libsuff} /lib${libsuff}\"\n  hardcode_into_libs=yes\n  ;;\n\n# No shared lib support for Linux oldld, aout, or coff.\nlinux*oldld* | linux*aout* | linux*coff*)\n  dynamic_linker=no\n  ;;\n\n# This must be Linux ELF.\nlinux*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -n $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  # This implies no fast_install, which is unacceptable.\n  # Some rework will be needed to allow for fast_install\n  # before this can be enabled.\n  hardcode_into_libs=yes\n\n  # find out which ABI we are using\n  libsuff=\n  case \"$host_cpu\" in\n  x86_64*|s390x*|powerpc64*)\n    echo '#line 18274 \"configure\"' > conftest.$ac_ext\n    if { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; then\n      case `/usr/bin/file conftest.$ac_objext` in\n      *64-bit*)\n        libsuff=64\n        sys_lib_search_path_spec=\"/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}\"\n        ;;\n      esac\n    fi\n    rm -rf conftest*\n    ;;\n  esac\n\n  # Append ld.so.conf contents to the search path\n  if test -f /etc/ld.so.conf; then\n    lt_ld_extra=`$SED -e 's/:,\\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\\n' ' '`\n    sys_lib_dlsearch_path_spec=\"/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra\"\n  fi\n\n  # We used to test for /lib/ld.so.1 and disable shared libraries on\n  # powerpc, because MkLinux only supported shared libraries with the\n  # GNU dynamic linker.  Since this was broken with cross compilers,\n  # most powerpc-linux boxes support dynamic linking these days and\n  # people can always --disable-shared, the test was removed, and we\n  # assume the GNU/Linux dynamic linker is in use.\n  dynamic_linker='GNU/Linux ld.so'\n  ;;\n\nknetbsd*-gnu)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=no\n  hardcode_into_libs=yes\n  dynamic_linker='GNU ld.so'\n  ;;\n\nnetbsd*)\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=no\n  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then\n    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'\n    finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -m $libdir'\n    dynamic_linker='NetBSD (a.out) ld.so'\n  else\n    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'\n    soname_spec='${libname}${release}${shared_ext}$major'\n    dynamic_linker='NetBSD ld.elf_so'\n  fi\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  hardcode_into_libs=yes\n  ;;\n\nnewsos6)\n  version_type=linux\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  ;;\n\nnto-qnx*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  ;;\n\nopenbsd*)\n  version_type=sunos\n  need_lib_prefix=no\n  need_version=yes\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'\n  finish_cmds='PATH=\"\\$PATH:/sbin\" ldconfig -m $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  if test -z \"`echo __ELF__ | $CC -E - | grep __ELF__`\" || test \"$host_os-$host_cpu\" = \"openbsd2.8-powerpc\"; then\n    case $host_os in\n      openbsd2.[89] | openbsd2.[89].*)\n\tshlibpath_overrides_runpath=no\n\t;;\n      *)\n\tshlibpath_overrides_runpath=yes\n\t;;\n      esac\n  else\n    shlibpath_overrides_runpath=yes\n  fi\n  ;;\n\nos2*)\n  libname_spec='$name'\n  shrext_cmds=\".dll\"\n  need_lib_prefix=no\n  library_names_spec='$libname${shared_ext} $libname.a'\n  dynamic_linker='OS/2 ld.exe'\n  shlibpath_var=LIBPATH\n  ;;\n\nosf3* | osf4* | osf5*)\n  version_type=osf\n  need_lib_prefix=no\n  need_version=no\n  soname_spec='${libname}${release}${shared_ext}$major'\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  shlibpath_var=LD_LIBRARY_PATH\n  sys_lib_search_path_spec=\"/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib\"\n  sys_lib_dlsearch_path_spec=\"$sys_lib_search_path_spec\"\n  ;;\n\nsco3.2v5*)\n  version_type=osf\n  soname_spec='${libname}${release}${shared_ext}$major'\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\nsolaris*)\n  version_type=linux\n  need_lib_prefix=no\n  need_version=no\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  hardcode_into_libs=yes\n  # ldd complains unless libraries are executable\n  postinstall_cmds='chmod +x $lib'\n  ;;\n\nsunos4*)\n  version_type=sunos\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'\n  finish_cmds='PATH=\"\\$PATH:/usr/etc\" ldconfig $libdir'\n  shlibpath_var=LD_LIBRARY_PATH\n  shlibpath_overrides_runpath=yes\n  if test \"$with_gnu_ld\" = yes; then\n    need_lib_prefix=no\n  fi\n  need_version=yes\n  ;;\n\nsysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)\n  version_type=linux\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  case $host_vendor in\n    sni)\n      shlibpath_overrides_runpath=no\n      need_lib_prefix=no\n      export_dynamic_flag_spec='${wl}-Blargedynsym'\n      runpath_var=LD_RUN_PATH\n      ;;\n    siemens)\n      need_lib_prefix=no\n      ;;\n    motorola)\n      need_lib_prefix=no\n      need_version=no\n      shlibpath_overrides_runpath=no\n      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'\n      ;;\n  esac\n  ;;\n\nsysv4*MP*)\n  if test -d /usr/nec ;then\n    version_type=linux\n    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'\n    soname_spec='$libname${shared_ext}.$major'\n    shlibpath_var=LD_LIBRARY_PATH\n  fi\n  ;;\n\nuts4*)\n  version_type=linux\n  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'\n  soname_spec='${libname}${release}${shared_ext}$major'\n  shlibpath_var=LD_LIBRARY_PATH\n  ;;\n\n*)\n  dynamic_linker=no\n  ;;\nesac\necho \"$as_me:$LINENO: result: $dynamic_linker\" >&5\necho \"${ECHO_T}$dynamic_linker\" >&6\ntest \"$dynamic_linker\" = no && can_build_shared=no\n\necho \"$as_me:$LINENO: checking how to hardcode library paths into programs\" >&5\necho $ECHO_N \"checking how to hardcode library paths into programs... $ECHO_C\" >&6\nhardcode_action_GCJ=\nif test -n \"$hardcode_libdir_flag_spec_GCJ\" || \\\n   test -n \"$runpath_var GCJ\" || \\\n   test \"X$hardcode_automatic_GCJ\"=\"Xyes\" ; then\n\n  # We can hardcode non-existant directories.\n  if test \"$hardcode_direct_GCJ\" != no &&\n     # If the only mechanism to avoid hardcoding is shlibpath_var, we\n     # have to relink, otherwise we might link with an installed library\n     # when we should be linking with a yet-to-be-installed one\n     ## test \"$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)\" != no &&\n     test \"$hardcode_minus_L_GCJ\" != no; then\n    # Linking always hardcodes the temporary library directory.\n    hardcode_action_GCJ=relink\n  else\n    # We can link without hardcoding, and we can hardcode nonexisting dirs.\n    hardcode_action_GCJ=immediate\n  fi\nelse\n  # We cannot hardcode anything, or else we can only hardcode existing\n  # directories.\n  hardcode_action_GCJ=unsupported\nfi\necho \"$as_me:$LINENO: result: $hardcode_action_GCJ\" >&5\necho \"${ECHO_T}$hardcode_action_GCJ\" >&6\n\nif test \"$hardcode_action_GCJ\" = relink; then\n  # Fast installation is not supported\n  enable_fast_install=no\nelif test \"$shlibpath_overrides_runpath\" = yes ||\n     test \"$enable_shared\" = no; then\n  # Fast installation is not necessary\n  enable_fast_install=needless\nfi\n\nstriplib=\nold_striplib=\necho \"$as_me:$LINENO: checking whether stripping libraries is possible\" >&5\necho $ECHO_N \"checking whether stripping libraries is possible... $ECHO_C\" >&6\nif test -n \"$STRIP\" && $STRIP -V 2>&1 | grep \"GNU strip\" >/dev/null; then\n  test -z \"$old_striplib\" && old_striplib=\"$STRIP --strip-debug\"\n  test -z \"$striplib\" && striplib=\"$STRIP --strip-unneeded\"\n  echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\nelse\n# FIXME - insert some real tests, host_os isn't really good enough\n  case $host_os in\n   darwin*)\n       if test -n \"$STRIP\" ; then\n         striplib=\"$STRIP -x\"\n         echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\n       else\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n       ;;\n   *)\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\n    ;;\n  esac\nfi\n\nif test \"x$enable_dlopen\" != xyes; then\n  enable_dlopen=unknown\n  enable_dlopen_self=unknown\n  enable_dlopen_self_static=unknown\nelse\n  lt_cv_dlopen=no\n  lt_cv_dlopen_libs=\n\n  case $host_os in\n  beos*)\n    lt_cv_dlopen=\"load_add_on\"\n    lt_cv_dlopen_libs=\n    lt_cv_dlopen_self=yes\n    ;;\n\n  mingw* | pw32*)\n    lt_cv_dlopen=\"LoadLibrary\"\n    lt_cv_dlopen_libs=\n   ;;\n\n  cygwin*)\n    lt_cv_dlopen=\"dlopen\"\n    lt_cv_dlopen_libs=\n   ;;\n\n  darwin*)\n  # if libdl is installed we need to link against it\n    echo \"$as_me:$LINENO: checking for dlopen in -ldl\" >&5\necho $ECHO_N \"checking for dlopen in -ldl... $ECHO_C\" >&6\nif test \"${ac_cv_lib_dl_dlopen+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-ldl  $LIBS\"\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\n/* Override any gcc2 internal prototype to avoid an error.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\n/* We use char because int might match the return type of a gcc2\n   builtin and then its argument prototype would still apply.  */\nchar dlopen ();\nint\nmain ()\n{\ndlopen ();\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_lib_dl_dlopen=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_lib_dl_dlopen=no\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\necho \"$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen\" >&5\necho \"${ECHO_T}$ac_cv_lib_dl_dlopen\" >&6\nif test $ac_cv_lib_dl_dlopen = yes; then\n  lt_cv_dlopen=\"dlopen\" lt_cv_dlopen_libs=\"-ldl\"\nelse\n\n    lt_cv_dlopen=\"dyld\"\n    lt_cv_dlopen_libs=\n    lt_cv_dlopen_self=yes\n\nfi\n\n   ;;\n\n  *)\n    echo \"$as_me:$LINENO: checking for shl_load\" >&5\necho $ECHO_N \"checking for shl_load... $ECHO_C\" >&6\nif test \"${ac_cv_func_shl_load+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.\n   For example, HP-UX 11i <limits.h> declares gettimeofday.  */\n#define shl_load innocuous_shl_load\n\n/* System header to define __stub macros and hopefully few prototypes,\n    which can conflict with char shl_load (); below.\n    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since\n    <limits.h> exists even on freestanding compilers.  */\n\n#ifdef __STDC__\n# include <limits.h>\n#else\n# include <assert.h>\n#endif\n\n#undef shl_load\n\n/* Override any gcc2 internal prototype to avoid an error.  */\n#ifdef __cplusplus\nextern \"C\"\n{\n#endif\n/* We use char because int might match the return type of a gcc2\n   builtin and then its argument prototype would still apply.  */\nchar shl_load ();\n/* The GNU C library defines this for functions which it implements\n    to always fail with ENOSYS.  Some functions are actually named\n    something starting with __ and the normal name is an alias.  */\n#if defined (__stub_shl_load) || defined (__stub___shl_load)\nchoke me\n#else\nchar (*f) () = shl_load;\n#endif\n#ifdef __cplusplus\n}\n#endif\n\nint\nmain ()\n{\nreturn f != shl_load;\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_func_shl_load=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_func_shl_load=no\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nfi\necho \"$as_me:$LINENO: result: $ac_cv_func_shl_load\" >&5\necho \"${ECHO_T}$ac_cv_func_shl_load\" >&6\nif test $ac_cv_func_shl_load = yes; then\n  lt_cv_dlopen=\"shl_load\"\nelse\n  echo \"$as_me:$LINENO: checking for shl_load in -ldld\" >&5\necho $ECHO_N \"checking for shl_load in -ldld... $ECHO_C\" >&6\nif test \"${ac_cv_lib_dld_shl_load+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-ldld  $LIBS\"\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\n/* Override any gcc2 internal prototype to avoid an error.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\n/* We use char because int might match the return type of a gcc2\n   builtin and then its argument prototype would still apply.  */\nchar shl_load ();\nint\nmain ()\n{\nshl_load ();\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_lib_dld_shl_load=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_lib_dld_shl_load=no\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\necho \"$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load\" >&5\necho \"${ECHO_T}$ac_cv_lib_dld_shl_load\" >&6\nif test $ac_cv_lib_dld_shl_load = yes; then\n  lt_cv_dlopen=\"shl_load\" lt_cv_dlopen_libs=\"-dld\"\nelse\n  echo \"$as_me:$LINENO: checking for dlopen\" >&5\necho $ECHO_N \"checking for dlopen... $ECHO_C\" >&6\nif test \"${ac_cv_func_dlopen+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.\n   For example, HP-UX 11i <limits.h> declares gettimeofday.  */\n#define dlopen innocuous_dlopen\n\n/* System header to define __stub macros and hopefully few prototypes,\n    which can conflict with char dlopen (); below.\n    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since\n    <limits.h> exists even on freestanding compilers.  */\n\n#ifdef __STDC__\n# include <limits.h>\n#else\n# include <assert.h>\n#endif\n\n#undef dlopen\n\n/* Override any gcc2 internal prototype to avoid an error.  */\n#ifdef __cplusplus\nextern \"C\"\n{\n#endif\n/* We use char because int might match the return type of a gcc2\n   builtin and then its argument prototype would still apply.  */\nchar dlopen ();\n/* The GNU C library defines this for functions which it implements\n    to always fail with ENOSYS.  Some functions are actually named\n    something starting with __ and the normal name is an alias.  */\n#if defined (__stub_dlopen) || defined (__stub___dlopen)\nchoke me\n#else\nchar (*f) () = dlopen;\n#endif\n#ifdef __cplusplus\n}\n#endif\n\nint\nmain ()\n{\nreturn f != dlopen;\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_func_dlopen=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_func_dlopen=no\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nfi\necho \"$as_me:$LINENO: result: $ac_cv_func_dlopen\" >&5\necho \"${ECHO_T}$ac_cv_func_dlopen\" >&6\nif test $ac_cv_func_dlopen = yes; then\n  lt_cv_dlopen=\"dlopen\"\nelse\n  echo \"$as_me:$LINENO: checking for dlopen in -ldl\" >&5\necho $ECHO_N \"checking for dlopen in -ldl... $ECHO_C\" >&6\nif test \"${ac_cv_lib_dl_dlopen+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-ldl  $LIBS\"\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\n/* Override any gcc2 internal prototype to avoid an error.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\n/* We use char because int might match the return type of a gcc2\n   builtin and then its argument prototype would still apply.  */\nchar dlopen ();\nint\nmain ()\n{\ndlopen ();\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_lib_dl_dlopen=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_lib_dl_dlopen=no\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\necho \"$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen\" >&5\necho \"${ECHO_T}$ac_cv_lib_dl_dlopen\" >&6\nif test $ac_cv_lib_dl_dlopen = yes; then\n  lt_cv_dlopen=\"dlopen\" lt_cv_dlopen_libs=\"-ldl\"\nelse\n  echo \"$as_me:$LINENO: checking for dlopen in -lsvld\" >&5\necho $ECHO_N \"checking for dlopen in -lsvld... $ECHO_C\" >&6\nif test \"${ac_cv_lib_svld_dlopen+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-lsvld  $LIBS\"\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\n/* Override any gcc2 internal prototype to avoid an error.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\n/* We use char because int might match the return type of a gcc2\n   builtin and then its argument prototype would still apply.  */\nchar dlopen ();\nint\nmain ()\n{\ndlopen ();\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_lib_svld_dlopen=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_lib_svld_dlopen=no\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\necho \"$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen\" >&5\necho \"${ECHO_T}$ac_cv_lib_svld_dlopen\" >&6\nif test $ac_cv_lib_svld_dlopen = yes; then\n  lt_cv_dlopen=\"dlopen\" lt_cv_dlopen_libs=\"-lsvld\"\nelse\n  echo \"$as_me:$LINENO: checking for dld_link in -ldld\" >&5\necho $ECHO_N \"checking for dld_link in -ldld... $ECHO_C\" >&6\nif test \"${ac_cv_lib_dld_dld_link+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-ldld  $LIBS\"\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\n/* Override any gcc2 internal prototype to avoid an error.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\n/* We use char because int might match the return type of a gcc2\n   builtin and then its argument prototype would still apply.  */\nchar dld_link ();\nint\nmain ()\n{\ndld_link ();\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_lib_dld_dld_link=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_lib_dld_dld_link=no\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS\nfi\necho \"$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link\" >&5\necho \"${ECHO_T}$ac_cv_lib_dld_dld_link\" >&6\nif test $ac_cv_lib_dld_dld_link = yes; then\n  lt_cv_dlopen=\"dld_link\" lt_cv_dlopen_libs=\"-dld\"\nfi\n\n\nfi\n\n\nfi\n\n\nfi\n\n\nfi\n\n\nfi\n\n    ;;\n  esac\n\n  if test \"x$lt_cv_dlopen\" != xno; then\n    enable_dlopen=yes\n  else\n    enable_dlopen=no\n  fi\n\n  case $lt_cv_dlopen in\n  dlopen)\n    save_CPPFLAGS=\"$CPPFLAGS\"\n    test \"x$ac_cv_header_dlfcn_h\" = xyes && CPPFLAGS=\"$CPPFLAGS -DHAVE_DLFCN_H\"\n\n    save_LDFLAGS=\"$LDFLAGS\"\n    eval LDFLAGS=\\\"\\$LDFLAGS $export_dynamic_flag_spec\\\"\n\n    save_LIBS=\"$LIBS\"\n    LIBS=\"$lt_cv_dlopen_libs $LIBS\"\n\n    echo \"$as_me:$LINENO: checking whether a program can dlopen itself\" >&5\necho $ECHO_N \"checking whether a program can dlopen itself... $ECHO_C\" >&6\nif test \"${lt_cv_dlopen_self+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  \t  if test \"$cross_compiling\" = yes; then :\n  lt_cv_dlopen_self=cross\nelse\n  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2\n  lt_status=$lt_dlunknown\n  cat > conftest.$ac_ext <<EOF\n#line 19145 \"configure\"\n#include \"confdefs.h\"\n\n#if HAVE_DLFCN_H\n#include <dlfcn.h>\n#endif\n\n#include <stdio.h>\n\n#ifdef RTLD_GLOBAL\n#  define LT_DLGLOBAL\t\tRTLD_GLOBAL\n#else\n#  ifdef DL_GLOBAL\n#    define LT_DLGLOBAL\t\tDL_GLOBAL\n#  else\n#    define LT_DLGLOBAL\t\t0\n#  endif\n#endif\n\n/* We may have to define LT_DLLAZY_OR_NOW in the command line if we\n   find out it does not work in some platform. */\n#ifndef LT_DLLAZY_OR_NOW\n#  ifdef RTLD_LAZY\n#    define LT_DLLAZY_OR_NOW\t\tRTLD_LAZY\n#  else\n#    ifdef DL_LAZY\n#      define LT_DLLAZY_OR_NOW\t\tDL_LAZY\n#    else\n#      ifdef RTLD_NOW\n#        define LT_DLLAZY_OR_NOW\tRTLD_NOW\n#      else\n#        ifdef DL_NOW\n#          define LT_DLLAZY_OR_NOW\tDL_NOW\n#        else\n#          define LT_DLLAZY_OR_NOW\t0\n#        endif\n#      endif\n#    endif\n#  endif\n#endif\n\n#ifdef __cplusplus\nextern \"C\" void exit (int);\n#endif\n\nvoid fnord() { int i=42;}\nint main ()\n{\n  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);\n  int status = $lt_dlunknown;\n\n  if (self)\n    {\n      if (dlsym (self,\"fnord\"))       status = $lt_dlno_uscore;\n      else if (dlsym( self,\"_fnord\")) status = $lt_dlneed_uscore;\n      /* dlclose (self); */\n    }\n\n    exit (status);\n}\nEOF\n  if { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then\n    (./conftest; exit; ) 2>/dev/null\n    lt_status=$?\n    case x$lt_status in\n      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;\n      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;\n      x$lt_unknown|x*) lt_cv_dlopen_self=no ;;\n    esac\n  else :\n    # compilation failed\n    lt_cv_dlopen_self=no\n  fi\nfi\nrm -fr conftest*\n\n\nfi\necho \"$as_me:$LINENO: result: $lt_cv_dlopen_self\" >&5\necho \"${ECHO_T}$lt_cv_dlopen_self\" >&6\n\n    if test \"x$lt_cv_dlopen_self\" = xyes; then\n      LDFLAGS=\"$LDFLAGS $link_static_flag\"\n      echo \"$as_me:$LINENO: checking whether a statically linked program can dlopen itself\" >&5\necho $ECHO_N \"checking whether a statically linked program can dlopen itself... $ECHO_C\" >&6\nif test \"${lt_cv_dlopen_self_static+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  \t  if test \"$cross_compiling\" = yes; then :\n  lt_cv_dlopen_self_static=cross\nelse\n  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2\n  lt_status=$lt_dlunknown\n  cat > conftest.$ac_ext <<EOF\n#line 19243 \"configure\"\n#include \"confdefs.h\"\n\n#if HAVE_DLFCN_H\n#include <dlfcn.h>\n#endif\n\n#include <stdio.h>\n\n#ifdef RTLD_GLOBAL\n#  define LT_DLGLOBAL\t\tRTLD_GLOBAL\n#else\n#  ifdef DL_GLOBAL\n#    define LT_DLGLOBAL\t\tDL_GLOBAL\n#  else\n#    define LT_DLGLOBAL\t\t0\n#  endif\n#endif\n\n/* We may have to define LT_DLLAZY_OR_NOW in the command line if we\n   find out it does not work in some platform. */\n#ifndef LT_DLLAZY_OR_NOW\n#  ifdef RTLD_LAZY\n#    define LT_DLLAZY_OR_NOW\t\tRTLD_LAZY\n#  else\n#    ifdef DL_LAZY\n#      define LT_DLLAZY_OR_NOW\t\tDL_LAZY\n#    else\n#      ifdef RTLD_NOW\n#        define LT_DLLAZY_OR_NOW\tRTLD_NOW\n#      else\n#        ifdef DL_NOW\n#          define LT_DLLAZY_OR_NOW\tDL_NOW\n#        else\n#          define LT_DLLAZY_OR_NOW\t0\n#        endif\n#      endif\n#    endif\n#  endif\n#endif\n\n#ifdef __cplusplus\nextern \"C\" void exit (int);\n#endif\n\nvoid fnord() { int i=42;}\nint main ()\n{\n  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);\n  int status = $lt_dlunknown;\n\n  if (self)\n    {\n      if (dlsym (self,\"fnord\"))       status = $lt_dlno_uscore;\n      else if (dlsym( self,\"_fnord\")) status = $lt_dlneed_uscore;\n      /* dlclose (self); */\n    }\n\n    exit (status);\n}\nEOF\n  if { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then\n    (./conftest; exit; ) 2>/dev/null\n    lt_status=$?\n    case x$lt_status in\n      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;\n      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;\n      x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;\n    esac\n  else :\n    # compilation failed\n    lt_cv_dlopen_self_static=no\n  fi\nfi\nrm -fr conftest*\n\n\nfi\necho \"$as_me:$LINENO: result: $lt_cv_dlopen_self_static\" >&5\necho \"${ECHO_T}$lt_cv_dlopen_self_static\" >&6\n    fi\n\n    CPPFLAGS=\"$save_CPPFLAGS\"\n    LDFLAGS=\"$save_LDFLAGS\"\n    LIBS=\"$save_LIBS\"\n    ;;\n  esac\n\n  case $lt_cv_dlopen_self in\n  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;\n  *) enable_dlopen_self=unknown ;;\n  esac\n\n  case $lt_cv_dlopen_self_static in\n  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;\n  *) enable_dlopen_self_static=unknown ;;\n  esac\nfi\n\n\n# The else clause should only fire when bootstrapping the\n# libtool distribution, otherwise you forgot to ship ltmain.sh\n# with your package, and you will get complaints that there are\n# no rules to generate ltmain.sh.\nif test -f \"$ltmain\"; then\n  # See if we are running on zsh, and set the options which allow our commands through\n  # without removal of \\ escapes.\n  if test -n \"${ZSH_VERSION+set}\" ; then\n    setopt NO_GLOB_SUBST\n  fi\n  # Now quote all the things that may contain metacharacters while being\n  # careful not to overquote the AC_SUBSTed values.  We take copies of the\n  # variables and quote the copies for generation of the libtool script.\n  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \\\n    SED SHELL STRIP \\\n    libname_spec library_names_spec soname_spec extract_expsyms_cmds \\\n    old_striplib striplib file_magic_cmd finish_cmds finish_eval \\\n    deplibs_check_method reload_flag reload_cmds need_locks \\\n    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \\\n    lt_cv_sys_global_symbol_to_c_name_address \\\n    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \\\n    old_postinstall_cmds old_postuninstall_cmds \\\n    compiler_GCJ \\\n    CC_GCJ \\\n    LD_GCJ \\\n    lt_prog_compiler_wl_GCJ \\\n    lt_prog_compiler_pic_GCJ \\\n    lt_prog_compiler_static_GCJ \\\n    lt_prog_compiler_no_builtin_flag_GCJ \\\n    export_dynamic_flag_spec_GCJ \\\n    thread_safe_flag_spec_GCJ \\\n    whole_archive_flag_spec_GCJ \\\n    enable_shared_with_static_runtimes_GCJ \\\n    old_archive_cmds_GCJ \\\n    old_archive_from_new_cmds_GCJ \\\n    predep_objects_GCJ \\\n    postdep_objects_GCJ \\\n    predeps_GCJ \\\n    postdeps_GCJ \\\n    compiler_lib_search_path_GCJ \\\n    archive_cmds_GCJ \\\n    archive_expsym_cmds_GCJ \\\n    postinstall_cmds_GCJ \\\n    postuninstall_cmds_GCJ \\\n    old_archive_from_expsyms_cmds_GCJ \\\n    allow_undefined_flag_GCJ \\\n    no_undefined_flag_GCJ \\\n    export_symbols_cmds_GCJ \\\n    hardcode_libdir_flag_spec_GCJ \\\n    hardcode_libdir_flag_spec_ld_GCJ \\\n    hardcode_libdir_separator_GCJ \\\n    hardcode_automatic_GCJ \\\n    module_cmds_GCJ \\\n    module_expsym_cmds_GCJ \\\n    lt_cv_prog_compiler_c_o_GCJ \\\n    exclude_expsyms_GCJ \\\n    include_expsyms_GCJ; do\n\n    case $var in\n    old_archive_cmds_GCJ | \\\n    old_archive_from_new_cmds_GCJ | \\\n    archive_cmds_GCJ | \\\n    archive_expsym_cmds_GCJ | \\\n    module_cmds_GCJ | \\\n    module_expsym_cmds_GCJ | \\\n    old_archive_from_expsyms_cmds_GCJ | \\\n    export_symbols_cmds_GCJ | \\\n    extract_expsyms_cmds | reload_cmds | finish_cmds | \\\n    postinstall_cmds | postuninstall_cmds | \\\n    old_postinstall_cmds | old_postuninstall_cmds | \\\n    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)\n      # Double-quote double-evaled strings.\n      eval \"lt_$var=\\\\\\\"\\`\\$echo \\\"X\\$$var\\\" | \\$Xsed -e \\\"\\$double_quote_subst\\\" -e \\\"\\$sed_quote_subst\\\" -e \\\"\\$delay_variable_subst\\\"\\`\\\\\\\"\"\n      ;;\n    *)\n      eval \"lt_$var=\\\\\\\"\\`\\$echo \\\"X\\$$var\\\" | \\$Xsed -e \\\"\\$sed_quote_subst\\\"\\`\\\\\\\"\"\n      ;;\n    esac\n  done\n\n  case $lt_echo in\n  *'\\$0 --fallback-echo\"')\n    lt_echo=`$echo \"X$lt_echo\" | $Xsed -e 's/\\\\\\\\\\\\\\$0 --fallback-echo\"$/$0 --fallback-echo\"/'`\n    ;;\n  esac\n\ncfgfile=\"$ofile\"\n\n  cat <<__EOF__ >> \"$cfgfile\"\n# ### BEGIN LIBTOOL TAG CONFIG: $tagname\n\n# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:\n\n# Shell to use when invoking shell scripts.\nSHELL=$lt_SHELL\n\n# Whether or not to build shared libraries.\nbuild_libtool_libs=$enable_shared\n\n# Whether or not to build static libraries.\nbuild_old_libs=$enable_static\n\n# Whether or not to add -lc for building shared libraries.\nbuild_libtool_need_lc=$archive_cmds_need_lc_GCJ\n\n# Whether or not to disallow shared libs when runtime libs are static\nallow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ\n\n# Whether or not to optimize for fast installation.\nfast_install=$enable_fast_install\n\n# The host system.\nhost_alias=$host_alias\nhost=$host\n\n# An echo program that does not interpret backslashes.\necho=$lt_echo\n\n# The archiver.\nAR=$lt_AR\nAR_FLAGS=$lt_AR_FLAGS\n\n# A C compiler.\nLTCC=$lt_LTCC\n\n# A language-specific compiler.\nCC=$lt_compiler_GCJ\n\n# Is the compiler the GNU C compiler?\nwith_gcc=$GCC_GCJ\n\n# An ERE matcher.\nEGREP=$lt_EGREP\n\n# The linker used to build libraries.\nLD=$lt_LD_GCJ\n\n# Whether we need hard or soft links.\nLN_S=$lt_LN_S\n\n# A BSD-compatible nm program.\nNM=$lt_NM\n\n# A symbol stripping program\nSTRIP=$lt_STRIP\n\n# Used to examine libraries when file_magic_cmd begins \"file\"\nMAGIC_CMD=$MAGIC_CMD\n\n# Used on cygwin: DLL creation program.\nDLLTOOL=\"$DLLTOOL\"\n\n# Used on cygwin: object dumper.\nOBJDUMP=\"$OBJDUMP\"\n\n# Used on cygwin: assembler.\nAS=\"$AS\"\n\n# The name of the directory that contains temporary libtool files.\nobjdir=$objdir\n\n# How to create reloadable object files.\nreload_flag=$lt_reload_flag\nreload_cmds=$lt_reload_cmds\n\n# How to pass a linker flag through the compiler.\nwl=$lt_lt_prog_compiler_wl_GCJ\n\n# Object file suffix (normally \"o\").\nobjext=\"$ac_objext\"\n\n# Old archive suffix (normally \"a\").\nlibext=\"$libext\"\n\n# Shared library suffix (normally \".so\").\nshrext_cmds='$shrext_cmds'\n\n# Executable file suffix (normally \"\").\nexeext=\"$exeext\"\n\n# Additional compiler flags for building library objects.\npic_flag=$lt_lt_prog_compiler_pic_GCJ\npic_mode=$pic_mode\n\n# What is the maximum length of a command?\nmax_cmd_len=$lt_cv_sys_max_cmd_len\n\n# Does compiler simultaneously support -c and -o options?\ncompiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ\n\n# Must we lock files when doing compilation ?\nneed_locks=$lt_need_locks\n\n# Do we need the lib prefix for modules?\nneed_lib_prefix=$need_lib_prefix\n\n# Do we need a version for libraries?\nneed_version=$need_version\n\n# Whether dlopen is supported.\ndlopen_support=$enable_dlopen\n\n# Whether dlopen of programs is supported.\ndlopen_self=$enable_dlopen_self\n\n# Whether dlopen of statically linked programs is supported.\ndlopen_self_static=$enable_dlopen_self_static\n\n# Compiler flag to prevent dynamic linking.\nlink_static_flag=$lt_lt_prog_compiler_static_GCJ\n\n# Compiler flag to turn off builtin functions.\nno_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ\n\n# Compiler flag to allow reflexive dlopens.\nexport_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ\n\n# Compiler flag to generate shared objects directly from archives.\nwhole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ\n\n# Compiler flag to generate thread-safe objects.\nthread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ\n\n# Library versioning type.\nversion_type=$version_type\n\n# Format of library name prefix.\nlibname_spec=$lt_libname_spec\n\n# List of archive names.  First name is the real one, the rest are links.\n# The last name is the one that the linker finds with -lNAME.\nlibrary_names_spec=$lt_library_names_spec\n\n# The coded name of the library, if different from the real name.\nsoname_spec=$lt_soname_spec\n\n# Commands used to build and install an old-style archive.\nRANLIB=$lt_RANLIB\nold_archive_cmds=$lt_old_archive_cmds_GCJ\nold_postinstall_cmds=$lt_old_postinstall_cmds\nold_postuninstall_cmds=$lt_old_postuninstall_cmds\n\n# Create an old-style archive from a shared archive.\nold_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ\n\n# Create a temporary old-style archive to link instead of a shared archive.\nold_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ\n\n# Commands used to build and install a shared archive.\narchive_cmds=$lt_archive_cmds_GCJ\narchive_expsym_cmds=$lt_archive_expsym_cmds_GCJ\npostinstall_cmds=$lt_postinstall_cmds\npostuninstall_cmds=$lt_postuninstall_cmds\n\n# Commands used to build a loadable module (assumed same as above if empty)\nmodule_cmds=$lt_module_cmds_GCJ\nmodule_expsym_cmds=$lt_module_expsym_cmds_GCJ\n\n# Commands to strip libraries.\nold_striplib=$lt_old_striplib\nstriplib=$lt_striplib\n\n# Dependencies to place before the objects being linked to create a\n# shared library.\npredep_objects=$lt_predep_objects_GCJ\n\n# Dependencies to place after the objects being linked to create a\n# shared library.\npostdep_objects=$lt_postdep_objects_GCJ\n\n# Dependencies to place before the objects being linked to create a\n# shared library.\npredeps=$lt_predeps_GCJ\n\n# Dependencies to place after the objects being linked to create a\n# shared library.\npostdeps=$lt_postdeps_GCJ\n\n# The library search path used internally by the compiler when linking\n# a shared library.\ncompiler_lib_search_path=$lt_compiler_lib_search_path_GCJ\n\n# Method to check whether dependent libraries are shared objects.\ndeplibs_check_method=$lt_deplibs_check_method\n\n# Command to use when deplibs_check_method == file_magic.\nfile_magic_cmd=$lt_file_magic_cmd\n\n# Flag that allows shared libraries with undefined symbols to be built.\nallow_undefined_flag=$lt_allow_undefined_flag_GCJ\n\n# Flag that forces no undefined symbols.\nno_undefined_flag=$lt_no_undefined_flag_GCJ\n\n# Commands used to finish a libtool library installation in a directory.\nfinish_cmds=$lt_finish_cmds\n\n# Same as above, but a single script fragment to be evaled but not shown.\nfinish_eval=$lt_finish_eval\n\n# Take the output of nm and produce a listing of raw symbols and C names.\nglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe\n\n# Transform the output of nm in a proper C declaration\nglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl\n\n# Transform the output of nm in a C name address pair\nglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address\n\n# This is the shared library runtime path variable.\nrunpath_var=$runpath_var\n\n# This is the shared library path variable.\nshlibpath_var=$shlibpath_var\n\n# Is shlibpath searched before the hard-coded library search path?\nshlibpath_overrides_runpath=$shlibpath_overrides_runpath\n\n# How to hardcode a shared library path into an executable.\nhardcode_action=$hardcode_action_GCJ\n\n# Whether we should hardcode library paths into libraries.\nhardcode_into_libs=$hardcode_into_libs\n\n# Flag to hardcode \\$libdir into a binary during linking.\n# This must work even if \\$libdir does not exist.\nhardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ\n\n# If ld is used when linking, flag to hardcode \\$libdir into\n# a binary during linking. This must work even if \\$libdir does\n# not exist.\nhardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ\n\n# Whether we need a single -rpath flag with a separated argument.\nhardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ\n\n# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the\n# resulting binary.\nhardcode_direct=$hardcode_direct_GCJ\n\n# Set to yes if using the -LDIR flag during linking hardcodes DIR into the\n# resulting binary.\nhardcode_minus_L=$hardcode_minus_L_GCJ\n\n# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into\n# the resulting binary.\nhardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ\n\n# Set to yes if building a shared library automatically hardcodes DIR into the library\n# and all subsequent libraries and executables linked against it.\nhardcode_automatic=$hardcode_automatic_GCJ\n\n# Variables whose values should be saved in libtool wrapper scripts and\n# restored at relink time.\nvariables_saved_for_relink=\"$variables_saved_for_relink\"\n\n# Whether libtool must link a program against all its dependency libraries.\nlink_all_deplibs=$link_all_deplibs_GCJ\n\n# Compile-time system search path for libraries\nsys_lib_search_path_spec=$lt_sys_lib_search_path_spec\n\n# Run-time system search path for libraries\nsys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec\n\n# Fix the shell variable \\$srcfile for the compiler.\nfix_srcfile_path=\"$fix_srcfile_path_GCJ\"\n\n# Set to yes if exported symbols are required.\nalways_export_symbols=$always_export_symbols_GCJ\n\n# The commands to list exported symbols.\nexport_symbols_cmds=$lt_export_symbols_cmds_GCJ\n\n# The commands to extract the exported symbol list from a shared archive.\nextract_expsyms_cmds=$lt_extract_expsyms_cmds\n\n# Symbols that should not be listed in the preloaded symbols.\nexclude_expsyms=$lt_exclude_expsyms_GCJ\n\n# Symbols that must always be exported.\ninclude_expsyms=$lt_include_expsyms_GCJ\n\n# ### END LIBTOOL TAG CONFIG: $tagname\n\n__EOF__\n\n\nelse\n  # If there is no Makefile yet, we rely on a make rule to execute\n  # `config.status --recheck' to rerun these tests and create the\n  # libtool script then.\n  ltmain_in=`echo $ltmain | sed -e 's/\\.sh$/.in/'`\n  if test -f \"$ltmain_in\"; then\n    test -f Makefile && make \"$ltmain\"\n  fi\nfi\n\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\nCC=\"$lt_save_CC\"\n\n\telse\n\t  tagname=\"\"\n\tfi\n\t;;\n\n      RC)\n\n\n\n# Source file extension for RC test sources.\nac_ext=rc\n\n# Object file extension for compiled RC test sources.\nobjext=o\nobjext_RC=$objext\n\n# Code to be used in simple compile tests\nlt_simple_compile_test_code='sample MENU { MENUITEM \"&Soup\", 100, CHECKED }\\n'\n\n# Code to be used in simple link tests\nlt_simple_link_test_code=\"$lt_simple_compile_test_code\"\n\n# ltmain only uses $CC for tagged configurations so make sure $CC is set.\n\n# If no C compiler was specified, use CC.\nLTCC=${LTCC-\"$CC\"}\n\n# Allow CC to be a program name with arguments.\ncompiler=$CC\n\n\n# Allow CC to be a program name with arguments.\nlt_save_CC=\"$CC\"\nCC=${RC-\"windres\"}\ncompiler=$CC\ncompiler_RC=$CC\nlt_cv_prog_compiler_c_o_RC=yes\n\n# The else clause should only fire when bootstrapping the\n# libtool distribution, otherwise you forgot to ship ltmain.sh\n# with your package, and you will get complaints that there are\n# no rules to generate ltmain.sh.\nif test -f \"$ltmain\"; then\n  # See if we are running on zsh, and set the options which allow our commands through\n  # without removal of \\ escapes.\n  if test -n \"${ZSH_VERSION+set}\" ; then\n    setopt NO_GLOB_SUBST\n  fi\n  # Now quote all the things that may contain metacharacters while being\n  # careful not to overquote the AC_SUBSTed values.  We take copies of the\n  # variables and quote the copies for generation of the libtool script.\n  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \\\n    SED SHELL STRIP \\\n    libname_spec library_names_spec soname_spec extract_expsyms_cmds \\\n    old_striplib striplib file_magic_cmd finish_cmds finish_eval \\\n    deplibs_check_method reload_flag reload_cmds need_locks \\\n    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \\\n    lt_cv_sys_global_symbol_to_c_name_address \\\n    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \\\n    old_postinstall_cmds old_postuninstall_cmds \\\n    compiler_RC \\\n    CC_RC \\\n    LD_RC \\\n    lt_prog_compiler_wl_RC \\\n    lt_prog_compiler_pic_RC \\\n    lt_prog_compiler_static_RC \\\n    lt_prog_compiler_no_builtin_flag_RC \\\n    export_dynamic_flag_spec_RC \\\n    thread_safe_flag_spec_RC \\\n    whole_archive_flag_spec_RC \\\n    enable_shared_with_static_runtimes_RC \\\n    old_archive_cmds_RC \\\n    old_archive_from_new_cmds_RC \\\n    predep_objects_RC \\\n    postdep_objects_RC \\\n    predeps_RC \\\n    postdeps_RC \\\n    compiler_lib_search_path_RC \\\n    archive_cmds_RC \\\n    archive_expsym_cmds_RC \\\n    postinstall_cmds_RC \\\n    postuninstall_cmds_RC \\\n    old_archive_from_expsyms_cmds_RC \\\n    allow_undefined_flag_RC \\\n    no_undefined_flag_RC \\\n    export_symbols_cmds_RC \\\n    hardcode_libdir_flag_spec_RC \\\n    hardcode_libdir_flag_spec_ld_RC \\\n    hardcode_libdir_separator_RC \\\n    hardcode_automatic_RC \\\n    module_cmds_RC \\\n    module_expsym_cmds_RC \\\n    lt_cv_prog_compiler_c_o_RC \\\n    exclude_expsyms_RC \\\n    include_expsyms_RC; do\n\n    case $var in\n    old_archive_cmds_RC | \\\n    old_archive_from_new_cmds_RC | \\\n    archive_cmds_RC | \\\n    archive_expsym_cmds_RC | \\\n    module_cmds_RC | \\\n    module_expsym_cmds_RC | \\\n    old_archive_from_expsyms_cmds_RC | \\\n    export_symbols_cmds_RC | \\\n    extract_expsyms_cmds | reload_cmds | finish_cmds | \\\n    postinstall_cmds | postuninstall_cmds | \\\n    old_postinstall_cmds | old_postuninstall_cmds | \\\n    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)\n      # Double-quote double-evaled strings.\n      eval \"lt_$var=\\\\\\\"\\`\\$echo \\\"X\\$$var\\\" | \\$Xsed -e \\\"\\$double_quote_subst\\\" -e \\\"\\$sed_quote_subst\\\" -e \\\"\\$delay_variable_subst\\\"\\`\\\\\\\"\"\n      ;;\n    *)\n      eval \"lt_$var=\\\\\\\"\\`\\$echo \\\"X\\$$var\\\" | \\$Xsed -e \\\"\\$sed_quote_subst\\\"\\`\\\\\\\"\"\n      ;;\n    esac\n  done\n\n  case $lt_echo in\n  *'\\$0 --fallback-echo\"')\n    lt_echo=`$echo \"X$lt_echo\" | $Xsed -e 's/\\\\\\\\\\\\\\$0 --fallback-echo\"$/$0 --fallback-echo\"/'`\n    ;;\n  esac\n\ncfgfile=\"$ofile\"\n\n  cat <<__EOF__ >> \"$cfgfile\"\n# ### BEGIN LIBTOOL TAG CONFIG: $tagname\n\n# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:\n\n# Shell to use when invoking shell scripts.\nSHELL=$lt_SHELL\n\n# Whether or not to build shared libraries.\nbuild_libtool_libs=$enable_shared\n\n# Whether or not to build static libraries.\nbuild_old_libs=$enable_static\n\n# Whether or not to add -lc for building shared libraries.\nbuild_libtool_need_lc=$archive_cmds_need_lc_RC\n\n# Whether or not to disallow shared libs when runtime libs are static\nallow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC\n\n# Whether or not to optimize for fast installation.\nfast_install=$enable_fast_install\n\n# The host system.\nhost_alias=$host_alias\nhost=$host\n\n# An echo program that does not interpret backslashes.\necho=$lt_echo\n\n# The archiver.\nAR=$lt_AR\nAR_FLAGS=$lt_AR_FLAGS\n\n# A C compiler.\nLTCC=$lt_LTCC\n\n# A language-specific compiler.\nCC=$lt_compiler_RC\n\n# Is the compiler the GNU C compiler?\nwith_gcc=$GCC_RC\n\n# An ERE matcher.\nEGREP=$lt_EGREP\n\n# The linker used to build libraries.\nLD=$lt_LD_RC\n\n# Whether we need hard or soft links.\nLN_S=$lt_LN_S\n\n# A BSD-compatible nm program.\nNM=$lt_NM\n\n# A symbol stripping program\nSTRIP=$lt_STRIP\n\n# Used to examine libraries when file_magic_cmd begins \"file\"\nMAGIC_CMD=$MAGIC_CMD\n\n# Used on cygwin: DLL creation program.\nDLLTOOL=\"$DLLTOOL\"\n\n# Used on cygwin: object dumper.\nOBJDUMP=\"$OBJDUMP\"\n\n# Used on cygwin: assembler.\nAS=\"$AS\"\n\n# The name of the directory that contains temporary libtool files.\nobjdir=$objdir\n\n# How to create reloadable object files.\nreload_flag=$lt_reload_flag\nreload_cmds=$lt_reload_cmds\n\n# How to pass a linker flag through the compiler.\nwl=$lt_lt_prog_compiler_wl_RC\n\n# Object file suffix (normally \"o\").\nobjext=\"$ac_objext\"\n\n# Old archive suffix (normally \"a\").\nlibext=\"$libext\"\n\n# Shared library suffix (normally \".so\").\nshrext_cmds='$shrext_cmds'\n\n# Executable file suffix (normally \"\").\nexeext=\"$exeext\"\n\n# Additional compiler flags for building library objects.\npic_flag=$lt_lt_prog_compiler_pic_RC\npic_mode=$pic_mode\n\n# What is the maximum length of a command?\nmax_cmd_len=$lt_cv_sys_max_cmd_len\n\n# Does compiler simultaneously support -c and -o options?\ncompiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC\n\n# Must we lock files when doing compilation ?\nneed_locks=$lt_need_locks\n\n# Do we need the lib prefix for modules?\nneed_lib_prefix=$need_lib_prefix\n\n# Do we need a version for libraries?\nneed_version=$need_version\n\n# Whether dlopen is supported.\ndlopen_support=$enable_dlopen\n\n# Whether dlopen of programs is supported.\ndlopen_self=$enable_dlopen_self\n\n# Whether dlopen of statically linked programs is supported.\ndlopen_self_static=$enable_dlopen_self_static\n\n# Compiler flag to prevent dynamic linking.\nlink_static_flag=$lt_lt_prog_compiler_static_RC\n\n# Compiler flag to turn off builtin functions.\nno_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC\n\n# Compiler flag to allow reflexive dlopens.\nexport_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC\n\n# Compiler flag to generate shared objects directly from archives.\nwhole_archive_flag_spec=$lt_whole_archive_flag_spec_RC\n\n# Compiler flag to generate thread-safe objects.\nthread_safe_flag_spec=$lt_thread_safe_flag_spec_RC\n\n# Library versioning type.\nversion_type=$version_type\n\n# Format of library name prefix.\nlibname_spec=$lt_libname_spec\n\n# List of archive names.  First name is the real one, the rest are links.\n# The last name is the one that the linker finds with -lNAME.\nlibrary_names_spec=$lt_library_names_spec\n\n# The coded name of the library, if different from the real name.\nsoname_spec=$lt_soname_spec\n\n# Commands used to build and install an old-style archive.\nRANLIB=$lt_RANLIB\nold_archive_cmds=$lt_old_archive_cmds_RC\nold_postinstall_cmds=$lt_old_postinstall_cmds\nold_postuninstall_cmds=$lt_old_postuninstall_cmds\n\n# Create an old-style archive from a shared archive.\nold_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC\n\n# Create a temporary old-style archive to link instead of a shared archive.\nold_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC\n\n# Commands used to build and install a shared archive.\narchive_cmds=$lt_archive_cmds_RC\narchive_expsym_cmds=$lt_archive_expsym_cmds_RC\npostinstall_cmds=$lt_postinstall_cmds\npostuninstall_cmds=$lt_postuninstall_cmds\n\n# Commands used to build a loadable module (assumed same as above if empty)\nmodule_cmds=$lt_module_cmds_RC\nmodule_expsym_cmds=$lt_module_expsym_cmds_RC\n\n# Commands to strip libraries.\nold_striplib=$lt_old_striplib\nstriplib=$lt_striplib\n\n# Dependencies to place before the objects being linked to create a\n# shared library.\npredep_objects=$lt_predep_objects_RC\n\n# Dependencies to place after the objects being linked to create a\n# shared library.\npostdep_objects=$lt_postdep_objects_RC\n\n# Dependencies to place before the objects being linked to create a\n# shared library.\npredeps=$lt_predeps_RC\n\n# Dependencies to place after the objects being linked to create a\n# shared library.\npostdeps=$lt_postdeps_RC\n\n# The library search path used internally by the compiler when linking\n# a shared library.\ncompiler_lib_search_path=$lt_compiler_lib_search_path_RC\n\n# Method to check whether dependent libraries are shared objects.\ndeplibs_check_method=$lt_deplibs_check_method\n\n# Command to use when deplibs_check_method == file_magic.\nfile_magic_cmd=$lt_file_magic_cmd\n\n# Flag that allows shared libraries with undefined symbols to be built.\nallow_undefined_flag=$lt_allow_undefined_flag_RC\n\n# Flag that forces no undefined symbols.\nno_undefined_flag=$lt_no_undefined_flag_RC\n\n# Commands used to finish a libtool library installation in a directory.\nfinish_cmds=$lt_finish_cmds\n\n# Same as above, but a single script fragment to be evaled but not shown.\nfinish_eval=$lt_finish_eval\n\n# Take the output of nm and produce a listing of raw symbols and C names.\nglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe\n\n# Transform the output of nm in a proper C declaration\nglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl\n\n# Transform the output of nm in a C name address pair\nglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address\n\n# This is the shared library runtime path variable.\nrunpath_var=$runpath_var\n\n# This is the shared library path variable.\nshlibpath_var=$shlibpath_var\n\n# Is shlibpath searched before the hard-coded library search path?\nshlibpath_overrides_runpath=$shlibpath_overrides_runpath\n\n# How to hardcode a shared library path into an executable.\nhardcode_action=$hardcode_action_RC\n\n# Whether we should hardcode library paths into libraries.\nhardcode_into_libs=$hardcode_into_libs\n\n# Flag to hardcode \\$libdir into a binary during linking.\n# This must work even if \\$libdir does not exist.\nhardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC\n\n# If ld is used when linking, flag to hardcode \\$libdir into\n# a binary during linking. This must work even if \\$libdir does\n# not exist.\nhardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC\n\n# Whether we need a single -rpath flag with a separated argument.\nhardcode_libdir_separator=$lt_hardcode_libdir_separator_RC\n\n# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the\n# resulting binary.\nhardcode_direct=$hardcode_direct_RC\n\n# Set to yes if using the -LDIR flag during linking hardcodes DIR into the\n# resulting binary.\nhardcode_minus_L=$hardcode_minus_L_RC\n\n# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into\n# the resulting binary.\nhardcode_shlibpath_var=$hardcode_shlibpath_var_RC\n\n# Set to yes if building a shared library automatically hardcodes DIR into the library\n# and all subsequent libraries and executables linked against it.\nhardcode_automatic=$hardcode_automatic_RC\n\n# Variables whose values should be saved in libtool wrapper scripts and\n# restored at relink time.\nvariables_saved_for_relink=\"$variables_saved_for_relink\"\n\n# Whether libtool must link a program against all its dependency libraries.\nlink_all_deplibs=$link_all_deplibs_RC\n\n# Compile-time system search path for libraries\nsys_lib_search_path_spec=$lt_sys_lib_search_path_spec\n\n# Run-time system search path for libraries\nsys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec\n\n# Fix the shell variable \\$srcfile for the compiler.\nfix_srcfile_path=\"$fix_srcfile_path_RC\"\n\n# Set to yes if exported symbols are required.\nalways_export_symbols=$always_export_symbols_RC\n\n# The commands to list exported symbols.\nexport_symbols_cmds=$lt_export_symbols_cmds_RC\n\n# The commands to extract the exported symbol list from a shared archive.\nextract_expsyms_cmds=$lt_extract_expsyms_cmds\n\n# Symbols that should not be listed in the preloaded symbols.\nexclude_expsyms=$lt_exclude_expsyms_RC\n\n# Symbols that must always be exported.\ninclude_expsyms=$lt_include_expsyms_RC\n\n# ### END LIBTOOL TAG CONFIG: $tagname\n\n__EOF__\n\n\nelse\n  # If there is no Makefile yet, we rely on a make rule to execute\n  # `config.status --recheck' to rerun these tests and create the\n  # libtool script then.\n  ltmain_in=`echo $ltmain | sed -e 's/\\.sh$/.in/'`\n  if test -f \"$ltmain_in\"; then\n    test -f Makefile && make \"$ltmain\"\n  fi\nfi\n\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\nCC=\"$lt_save_CC\"\n\n\t;;\n\n      *)\n\t{ { echo \"$as_me:$LINENO: error: Unsupported tag name: $tagname\" >&5\necho \"$as_me: error: Unsupported tag name: $tagname\" >&2;}\n   { (exit 1); exit 1; }; }\n\t;;\n      esac\n\n      # Append the new tag name to the list of available tags.\n      if test -n \"$tagname\" ; then\n      available_tags=\"$available_tags $tagname\"\n    fi\n    fi\n  done\n  IFS=\"$lt_save_ifs\"\n\n  # Now substitute the updated list of available tags.\n  if eval \"sed -e 's/^available_tags=.*\\$/available_tags=\\\"$available_tags\\\"/' \\\"$ofile\\\" > \\\"${ofile}T\\\"\"; then\n    mv \"${ofile}T\" \"$ofile\"\n    chmod +x \"$ofile\"\n  else\n    rm -f \"${ofile}T\"\n    { { echo \"$as_me:$LINENO: error: unable to update list of available tagged configurations.\" >&5\necho \"$as_me: error: unable to update list of available tagged configurations.\" >&2;}\n   { (exit 1); exit 1; }; }\n  fi\nfi\n\n\n\n# This can be used to rebuild libtool when needed\nLIBTOOL_DEPS=\"$ac_aux_dir/ltmain.sh\"\n\n# Always use our own libtool.\nLIBTOOL='$(SHELL) $(top_builddir)/libtool'\n\n# Prevent multiple expansion\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\necho \"$as_me:$LINENO: checking whether ln -s works\" >&5\necho $ECHO_N \"checking whether ln -s works... $ECHO_C\" >&6\nLN_S=$as_ln_s\nif test \"$LN_S\" = \"ln -s\"; then\n  echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no, using $LN_S\" >&5\necho \"${ECHO_T}no, using $LN_S\" >&6\nfi\n\n\n# When the prefix is /opt/libjpeg-turbo, we assume that an \"official\" binary is\n# being created, and thus we install things into specific locations.\n\nold_prefix=${prefix}\nif test \"x$prefix\" = \"xNONE\" -a \"x$ac_default_prefix\" != \"x\"; then\n  prefix=$ac_default_prefix\nfi\nDATADIR=`eval echo ${datadir}`\nDATADIR=`eval echo $DATADIR`\nif test \"$DATADIR\" = \"/opt/libjpeg-turbo/share\"; then\n  datadir='${prefix}'\nfi\nDATADIR=`eval echo ${datarootdir}`\nDATADIR=`eval echo $DATADIR`\nif test \"$DATADIR\" = \"/opt/libjpeg-turbo/share\"; then\n  datarootdir='${prefix}'\nfi\n\nold_exec_prefix=${exec_prefix}\nif test \"x$exec_prefix\" = \"xNONE\"; then\n  exec_prefix=${prefix}\nfi\n\nif test \"x${libdir}\" = 'x${exec_prefix}/lib' -o \"x${libdir}\" = 'x${prefix}/lib'; then\n  LIBDIR=`eval echo ${libdir}`\n  LIBDIR=`eval echo $LIBDIR`\n  if test \"$LIBDIR\" = \"/opt/libjpeg-turbo/lib\"; then\n    case $host_os in\n      darwin*)\n        ;;\n      *)\n        echo \"$as_me:$LINENO: checking for long\" >&5\necho $ECHO_N \"checking for long... $ECHO_C\" >&6\nif test \"${ac_cv_type_long+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_includes_default\nint\nmain ()\n{\nif ((long *) 0)\n  return 0;\nif (sizeof (long))\n  return 0;\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_type_long=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_type_long=no\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\necho \"$as_me:$LINENO: result: $ac_cv_type_long\" >&5\necho \"${ECHO_T}$ac_cv_type_long\" >&6\n\necho \"$as_me:$LINENO: checking size of long\" >&5\necho $ECHO_N \"checking size of long... $ECHO_C\" >&6\nif test \"${ac_cv_sizeof_long+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test \"$ac_cv_type_long\" = yes; then\n  # The cast to unsigned long works around a bug in the HP C Compiler\n  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects\n  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.\n  # This bug is HP SR number 8606223364.\n  if test \"$cross_compiling\" = yes; then\n  # Depending upon the size, compute the lo and hi bounds.\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_includes_default\nint\nmain ()\n{\nstatic int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)];\ntest_array [0] = 0\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_lo=0 ac_mid=0\n  while :; do\n    cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_includes_default\nint\nmain ()\n{\nstatic int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];\ntest_array [0] = 0\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_hi=$ac_mid; break\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_lo=`expr $ac_mid + 1`\n\t\t    if test $ac_lo -le $ac_mid; then\n\t\t      ac_lo= ac_hi=\n\t\t      break\n\t\t    fi\n\t\t    ac_mid=`expr 2 '*' $ac_mid + 1`\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\n  done\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_includes_default\nint\nmain ()\n{\nstatic int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)];\ntest_array [0] = 0\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_hi=-1 ac_mid=-1\n  while :; do\n    cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_includes_default\nint\nmain ()\n{\nstatic int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)];\ntest_array [0] = 0\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_lo=$ac_mid; break\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_hi=`expr '(' $ac_mid ')' - 1`\n\t\t       if test $ac_mid -le $ac_hi; then\n\t\t\t ac_lo= ac_hi=\n\t\t\t break\n\t\t       fi\n\t\t       ac_mid=`expr 2 '*' $ac_mid`\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\n  done\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_lo= ac_hi=\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\n# Binary search between lo and hi bounds.\nwhile test \"x$ac_lo\" != \"x$ac_hi\"; do\n  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_includes_default\nint\nmain ()\n{\nstatic int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];\ntest_array [0] = 0\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_hi=$ac_mid\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_lo=`expr '(' $ac_mid ')' + 1`\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\ndone\ncase $ac_lo in\n?*) ac_cv_sizeof_long=$ac_lo;;\n'') { { echo \"$as_me:$LINENO: error: cannot compute sizeof (long), 77\nSee \\`config.log' for more details.\" >&5\necho \"$as_me: error: cannot compute sizeof (long), 77\nSee \\`config.log' for more details.\" >&2;}\n   { (exit 1); exit 1; }; } ;;\nesac\nelse\n  if test \"$cross_compiling\" = yes; then\n  { { echo \"$as_me:$LINENO: error: cannot run test program while cross compiling\nSee \\`config.log' for more details.\" >&5\necho \"$as_me: error: cannot run test program while cross compiling\nSee \\`config.log' for more details.\" >&2;}\n   { (exit 1); exit 1; }; }\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_includes_default\nlong longval () { return (long) (sizeof (long)); }\nunsigned long ulongval () { return (long) (sizeof (long)); }\n#include <stdio.h>\n#include <stdlib.h>\nint\nmain ()\n{\n\n  FILE *f = fopen (\"conftest.val\", \"w\");\n  if (! f)\n    exit (1);\n  if (((long) (sizeof (long))) < 0)\n    {\n      long i = longval ();\n      if (i != ((long) (sizeof (long))))\n\texit (1);\n      fprintf (f, \"%ld\\n\", i);\n    }\n  else\n    {\n      unsigned long i = ulongval ();\n      if (i != ((long) (sizeof (long))))\n\texit (1);\n      fprintf (f, \"%lu\\n\", i);\n    }\n  exit (ferror (f) || fclose (f) != 0);\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_sizeof_long=`cat conftest.val`\nelse\n  echo \"$as_me: program exited with status $ac_status\" >&5\necho \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n( exit $ac_status )\n{ { echo \"$as_me:$LINENO: error: cannot compute sizeof (long), 77\nSee \\`config.log' for more details.\" >&5\necho \"$as_me: error: cannot compute sizeof (long), 77\nSee \\`config.log' for more details.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\nrm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext\nfi\nfi\nrm -f conftest.val\nelse\n  ac_cv_sizeof_long=0\nfi\nfi\necho \"$as_me:$LINENO: result: $ac_cv_sizeof_long\" >&5\necho \"${ECHO_T}$ac_cv_sizeof_long\" >&6\ncat >>confdefs.h <<_ACEOF\n#define SIZEOF_LONG $ac_cv_sizeof_long\n_ACEOF\n\n\n        if test \"${ac_cv_sizeof_long}\" = \"8\"; then\n          libdir='${exec_prefix}/lib64'\n        elif test \"${ac_cv_sizeof_long}\" = \"4\"; then\n          libdir='${exec_prefix}/lib32'\n        fi\n        ;;\n    esac\n  fi\nfi\nexec_prefix=${old_exec_prefix}\nprefix=${old_prefix}\n\n# Check whether compiler supports pointers to undefined structures\necho \"$as_me:$LINENO: checking whether compiler supports pointers to undefined structures\" >&5\necho $ECHO_N \"checking whether compiler supports pointers to undefined structures... $ECHO_C\" >&6\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n typedef struct undefined_structure * undef_struct_ptr;\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\necho \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\n\ncat >>confdefs.h <<\\_ACEOF\n#define INCOMPLETE_TYPES_BROKEN 1\n_ACEOF\n\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\n\nif test \"x${GCC}\" = \"xyes\"; then\n  if test \"x${SAVED_CFLAGS}\" = \"x\"; then\n    CFLAGS=-O3\n  fi\n  if test \"x${SAVED_CPPFLAGS}\" = \"x\"; then\n    CPPFLAGS=-Wall\n  fi\nfi\n\necho \"$as_me:$LINENO: checking whether __SUNPRO_C is declared\" >&5\necho $ECHO_N \"checking whether __SUNPRO_C is declared... $ECHO_C\" >&6\nif test \"${ac_cv_have_decl___SUNPRO_C+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_includes_default\nint\nmain ()\n{\n#ifndef __SUNPRO_C\n  char *p = (char *) __SUNPRO_C;\n#endif\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_have_decl___SUNPRO_C=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_have_decl___SUNPRO_C=no\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\necho \"$as_me:$LINENO: result: $ac_cv_have_decl___SUNPRO_C\" >&5\necho \"${ECHO_T}$ac_cv_have_decl___SUNPRO_C\" >&6\nif test $ac_cv_have_decl___SUNPRO_C = yes; then\n  SUNCC=\"yes\"\nelse\n  SUNCC=\"no\"\nfi\n\nif test \"x${SUNCC}\" = \"xyes\"; then\n  if test \"x${SAVED_CFLAGS}\" = \"x\"; then\n    CFLAGS=-xO5\n  fi\nfi\n\n# Checks for libraries.\n\n# Checks for header files.\necho \"$as_me:$LINENO: checking for ANSI C header files\" >&5\necho $ECHO_N \"checking for ANSI C header files... $ECHO_C\" >&6\nif test \"${ac_cv_header_stdc+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#include <stdlib.h>\n#include <stdarg.h>\n#include <string.h>\n#include <float.h>\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_header_stdc=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_header_stdc=no\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\n\nif test $ac_cv_header_stdc = yes; then\n  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#include <string.h>\n\n_ACEOF\nif (eval \"$ac_cpp conftest.$ac_ext\") 2>&5 |\n  $EGREP \"memchr\" >/dev/null 2>&1; then\n  :\nelse\n  ac_cv_header_stdc=no\nfi\nrm -f conftest*\n\nfi\n\nif test $ac_cv_header_stdc = yes; then\n  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#include <stdlib.h>\n\n_ACEOF\nif (eval \"$ac_cpp conftest.$ac_ext\") 2>&5 |\n  $EGREP \"free\" >/dev/null 2>&1; then\n  :\nelse\n  ac_cv_header_stdc=no\nfi\nrm -f conftest*\n\nfi\n\nif test $ac_cv_header_stdc = yes; then\n  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.\n  if test \"$cross_compiling\" = yes; then\n  :\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#include <ctype.h>\n#if ((' ' & 0x0FF) == 0x020)\n# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')\n# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))\n#else\n# define ISLOWER(c) \\\n\t\t   (('a' <= (c) && (c) <= 'i') \\\n\t\t     || ('j' <= (c) && (c) <= 'r') \\\n\t\t     || ('s' <= (c) && (c) <= 'z'))\n# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))\n#endif\n\n#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))\nint\nmain ()\n{\n  int i;\n  for (i = 0; i < 256; i++)\n    if (XOR (islower (i), ISLOWER (i))\n\t|| toupper (i) != TOUPPER (i))\n      exit(2);\n  exit (0);\n}\n_ACEOF\nrm -f conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  :\nelse\n  echo \"$as_me: program exited with status $ac_status\" >&5\necho \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n( exit $ac_status )\nac_cv_header_stdc=no\nfi\nrm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext\nfi\nfi\nfi\necho \"$as_me:$LINENO: result: $ac_cv_header_stdc\" >&5\necho \"${ECHO_T}$ac_cv_header_stdc\" >&6\nif test $ac_cv_header_stdc = yes; then\n\ncat >>confdefs.h <<\\_ACEOF\n#define STDC_HEADERS 1\n_ACEOF\n\nfi\n\n\n\n\nfor ac_header in stddef.h stdlib.h string.h\ndo\nas_ac_Header=`echo \"ac_cv_header_$ac_header\" | $as_tr_sh`\nif eval \"test \\\"\\${$as_ac_Header+set}\\\" = set\"; then\n  echo \"$as_me:$LINENO: checking for $ac_header\" >&5\necho $ECHO_N \"checking for $ac_header... $ECHO_C\" >&6\nif eval \"test \\\"\\${$as_ac_Header+set}\\\" = set\"; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nfi\necho \"$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`\" >&5\necho \"${ECHO_T}`eval echo '${'$as_ac_Header'}'`\" >&6\nelse\n  # Is the header compilable?\necho \"$as_me:$LINENO: checking $ac_header usability\" >&5\necho $ECHO_N \"checking $ac_header usability... $ECHO_C\" >&6\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_includes_default\n#include <$ac_header>\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_header_compiler=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_header_compiler=no\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\necho \"$as_me:$LINENO: result: $ac_header_compiler\" >&5\necho \"${ECHO_T}$ac_header_compiler\" >&6\n\n# Is the header present?\necho \"$as_me:$LINENO: checking $ac_header presence\" >&5\necho $ECHO_N \"checking $ac_header presence... $ECHO_C\" >&6\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#include <$ac_header>\n_ACEOF\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_cpp conftest.$ac_ext\\\"\") >&5\n  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } >/dev/null; then\n  if test -s conftest.err; then\n    ac_cpp_err=$ac_c_preproc_warn_flag\n    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag\n  else\n    ac_cpp_err=\n  fi\nelse\n  ac_cpp_err=yes\nfi\nif test -z \"$ac_cpp_err\"; then\n  ac_header_preproc=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n  ac_header_preproc=no\nfi\nrm -f conftest.err conftest.$ac_ext\necho \"$as_me:$LINENO: result: $ac_header_preproc\" >&5\necho \"${ECHO_T}$ac_header_preproc\" >&6\n\n# So?  What about this header?\ncase $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in\n  yes:no: )\n    { echo \"$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!\" >&5\necho \"$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result\" >&5\necho \"$as_me: WARNING: $ac_header: proceeding with the compiler's result\" >&2;}\n    ac_header_preproc=yes\n    ;;\n  no:yes:* )\n    { echo \"$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled\" >&5\necho \"$as_me: WARNING: $ac_header: present but cannot be compiled\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?\" >&5\necho \"$as_me: WARNING: $ac_header:     check for missing prerequisite headers?\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation\" >&5\necho \"$as_me: WARNING: $ac_header: see the Autoconf documentation\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: $ac_header:     section \\\"Present But Cannot Be Compiled\\\"\" >&5\necho \"$as_me: WARNING: $ac_header:     section \\\"Present But Cannot Be Compiled\\\"\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result\" >&5\necho \"$as_me: WARNING: $ac_header: proceeding with the preprocessor's result\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence\" >&5\necho \"$as_me: WARNING: $ac_header: in the future, the compiler will take precedence\" >&2;}\n    (\n      cat <<\\_ASBOX\n## ---------------------------------------- ##\n## Report this to the libjpeg-turbo lists.  ##\n## ---------------------------------------- ##\n_ASBOX\n    ) |\n      sed \"s/^/$as_me: WARNING:     /\" >&2\n    ;;\nesac\necho \"$as_me:$LINENO: checking for $ac_header\" >&5\necho $ECHO_N \"checking for $ac_header... $ECHO_C\" >&6\nif eval \"test \\\"\\${$as_ac_Header+set}\\\" = set\"; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  eval \"$as_ac_Header=\\$ac_header_preproc\"\nfi\necho \"$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`\" >&5\necho \"${ECHO_T}`eval echo '${'$as_ac_Header'}'`\" >&6\n\nfi\nif test `eval echo '${'$as_ac_Header'}'` = yes; then\n  cat >>confdefs.h <<_ACEOF\n#define `echo \"HAVE_$ac_header\" | $as_tr_cpp` 1\n_ACEOF\n\nfi\n\ndone\n\nif test \"${ac_cv_header_sys_types_h+set}\" = set; then\n  echo \"$as_me:$LINENO: checking for sys/types.h\" >&5\necho $ECHO_N \"checking for sys/types.h... $ECHO_C\" >&6\nif test \"${ac_cv_header_sys_types_h+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nfi\necho \"$as_me:$LINENO: result: $ac_cv_header_sys_types_h\" >&5\necho \"${ECHO_T}$ac_cv_header_sys_types_h\" >&6\nelse\n  # Is the header compilable?\necho \"$as_me:$LINENO: checking sys/types.h usability\" >&5\necho $ECHO_N \"checking sys/types.h usability... $ECHO_C\" >&6\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_includes_default\n#include <sys/types.h>\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_header_compiler=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_header_compiler=no\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\necho \"$as_me:$LINENO: result: $ac_header_compiler\" >&5\necho \"${ECHO_T}$ac_header_compiler\" >&6\n\n# Is the header present?\necho \"$as_me:$LINENO: checking sys/types.h presence\" >&5\necho $ECHO_N \"checking sys/types.h presence... $ECHO_C\" >&6\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#include <sys/types.h>\n_ACEOF\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_cpp conftest.$ac_ext\\\"\") >&5\n  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } >/dev/null; then\n  if test -s conftest.err; then\n    ac_cpp_err=$ac_c_preproc_warn_flag\n    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag\n  else\n    ac_cpp_err=\n  fi\nelse\n  ac_cpp_err=yes\nfi\nif test -z \"$ac_cpp_err\"; then\n  ac_header_preproc=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n  ac_header_preproc=no\nfi\nrm -f conftest.err conftest.$ac_ext\necho \"$as_me:$LINENO: result: $ac_header_preproc\" >&5\necho \"${ECHO_T}$ac_header_preproc\" >&6\n\n# So?  What about this header?\ncase $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in\n  yes:no: )\n    { echo \"$as_me:$LINENO: WARNING: sys/types.h: accepted by the compiler, rejected by the preprocessor!\" >&5\necho \"$as_me: WARNING: sys/types.h: accepted by the compiler, rejected by the preprocessor!\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: sys/types.h: proceeding with the compiler's result\" >&5\necho \"$as_me: WARNING: sys/types.h: proceeding with the compiler's result\" >&2;}\n    ac_header_preproc=yes\n    ;;\n  no:yes:* )\n    { echo \"$as_me:$LINENO: WARNING: sys/types.h: present but cannot be compiled\" >&5\necho \"$as_me: WARNING: sys/types.h: present but cannot be compiled\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: sys/types.h:     check for missing prerequisite headers?\" >&5\necho \"$as_me: WARNING: sys/types.h:     check for missing prerequisite headers?\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: sys/types.h: see the Autoconf documentation\" >&5\necho \"$as_me: WARNING: sys/types.h: see the Autoconf documentation\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: sys/types.h:     section \\\"Present But Cannot Be Compiled\\\"\" >&5\necho \"$as_me: WARNING: sys/types.h:     section \\\"Present But Cannot Be Compiled\\\"\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: sys/types.h: proceeding with the preprocessor's result\" >&5\necho \"$as_me: WARNING: sys/types.h: proceeding with the preprocessor's result\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: sys/types.h: in the future, the compiler will take precedence\" >&5\necho \"$as_me: WARNING: sys/types.h: in the future, the compiler will take precedence\" >&2;}\n    (\n      cat <<\\_ASBOX\n## ---------------------------------------- ##\n## Report this to the libjpeg-turbo lists.  ##\n## ---------------------------------------- ##\n_ASBOX\n    ) |\n      sed \"s/^/$as_me: WARNING:     /\" >&2\n    ;;\nesac\necho \"$as_me:$LINENO: checking for sys/types.h\" >&5\necho $ECHO_N \"checking for sys/types.h... $ECHO_C\" >&6\nif test \"${ac_cv_header_sys_types_h+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  ac_cv_header_sys_types_h=$ac_header_preproc\nfi\necho \"$as_me:$LINENO: result: $ac_cv_header_sys_types_h\" >&5\necho \"${ECHO_T}$ac_cv_header_sys_types_h\" >&6\n\nfi\nif test $ac_cv_header_sys_types_h = yes; then\n\ncat >>confdefs.h <<\\_ACEOF\n#define NEED_SYS_TYPES_H 1\n_ACEOF\n\nfi\n\n\n\n# Checks for typedefs, structures, and compiler characteristics.\necho \"$as_me:$LINENO: checking for an ANSI C-conforming const\" >&5\necho $ECHO_N \"checking for an ANSI C-conforming const... $ECHO_C\" >&6\nif test \"${ac_cv_c_const+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n/* FIXME: Include the comments suggested by Paul. */\n#ifndef __cplusplus\n  /* Ultrix mips cc rejects this.  */\n  typedef int charset[2];\n  const charset x;\n  /* SunOS 4.1.1 cc rejects this.  */\n  char const *const *ccp;\n  char **p;\n  /* NEC SVR4.0.2 mips cc rejects this.  */\n  struct point {int x, y;};\n  static struct point const zero = {0,0};\n  /* AIX XL C 1.02.0.0 rejects this.\n     It does not let you subtract one const X* pointer from another in\n     an arm of an if-expression whose if-part is not a constant\n     expression */\n  const char *g = \"string\";\n  ccp = &g + (g ? g-g : 0);\n  /* HPUX 7.0 cc rejects these. */\n  ++ccp;\n  p = (char**) ccp;\n  ccp = (char const *const *) p;\n  { /* SCO 3.2v4 cc rejects this.  */\n    char *t;\n    char const *s = 0 ? (char *) 0 : (char const *) 0;\n\n    *t++ = 0;\n  }\n  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */\n    int x[] = {25, 17};\n    const int *foo = &x[0];\n    ++foo;\n  }\n  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */\n    typedef const int *iptr;\n    iptr p = 0;\n    ++p;\n  }\n  { /* AIX XL C 1.02.0.0 rejects this saying\n       \"k.c\", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */\n    struct s { int j; const int *ap[3]; };\n    struct s *b; b->j = 5;\n  }\n  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */\n    const int foo = 10;\n  }\n#endif\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_c_const=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_c_const=no\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\necho \"$as_me:$LINENO: result: $ac_cv_c_const\" >&5\necho \"${ECHO_T}$ac_cv_c_const\" >&6\nif test $ac_cv_c_const = no; then\n\ncat >>confdefs.h <<\\_ACEOF\n#define const\n_ACEOF\n\nfi\n\n\necho \"$as_me:$LINENO: checking whether char is unsigned\" >&5\necho $ECHO_N \"checking whether char is unsigned... $ECHO_C\" >&6\nif test \"${ac_cv_c_char_unsigned+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_includes_default\nint\nmain ()\n{\nstatic int test_array [1 - 2 * !(((char) -1) < 0)];\ntest_array [0] = 0\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_c_char_unsigned=no\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_c_char_unsigned=yes\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\necho \"$as_me:$LINENO: result: $ac_cv_c_char_unsigned\" >&5\necho \"${ECHO_T}$ac_cv_c_char_unsigned\" >&6\nif test $ac_cv_c_char_unsigned = yes && test \"$GCC\" != yes; then\n  cat >>confdefs.h <<\\_ACEOF\n#define __CHAR_UNSIGNED__ 1\n_ACEOF\n\nfi\n\necho \"$as_me:$LINENO: checking for inline\" >&5\necho $ECHO_N \"checking for inline... $ECHO_C\" >&6\nif test \"${ac_cv_c_inline+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  ac_cv_c_inline=no\nfor ac_kw in inline __inline__ __inline; do\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#ifndef __cplusplus\ntypedef int foo_t;\nstatic $ac_kw foo_t static_foo () {return 0; }\n$ac_kw foo_t foo () {return 0; }\n#endif\n\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_c_inline=$ac_kw; break\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\ndone\n\nfi\necho \"$as_me:$LINENO: result: $ac_cv_c_inline\" >&5\necho \"${ECHO_T}$ac_cv_c_inline\" >&6\n\n\ncase $ac_cv_c_inline in\n  inline | yes) ;;\n  *)\n    case $ac_cv_c_inline in\n      no) ac_val=;;\n      *) ac_val=$ac_cv_c_inline;;\n    esac\n    cat >>confdefs.h <<_ACEOF\n#ifndef __cplusplus\n#define inline $ac_val\n#endif\n_ACEOF\n    ;;\nesac\n\necho \"$as_me:$LINENO: checking for size_t\" >&5\necho $ECHO_N \"checking for size_t... $ECHO_C\" >&6\nif test \"${ac_cv_type_size_t+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_includes_default\nint\nmain ()\n{\nif ((size_t *) 0)\n  return 0;\nif (sizeof (size_t))\n  return 0;\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_type_size_t=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_type_size_t=no\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\necho \"$as_me:$LINENO: result: $ac_cv_type_size_t\" >&5\necho \"${ECHO_T}$ac_cv_type_size_t\" >&6\nif test $ac_cv_type_size_t = yes; then\n  :\nelse\n\ncat >>confdefs.h <<_ACEOF\n#define size_t unsigned\n_ACEOF\n\nfi\n\necho \"$as_me:$LINENO: checking for unsigned char\" >&5\necho $ECHO_N \"checking for unsigned char... $ECHO_C\" >&6\nif test \"${ac_cv_type_unsigned_char+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_includes_default\nint\nmain ()\n{\nif ((unsigned char *) 0)\n  return 0;\nif (sizeof (unsigned char))\n  return 0;\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_type_unsigned_char=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_type_unsigned_char=no\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\necho \"$as_me:$LINENO: result: $ac_cv_type_unsigned_char\" >&5\necho \"${ECHO_T}$ac_cv_type_unsigned_char\" >&6\nif test $ac_cv_type_unsigned_char = yes; then\n\ncat >>confdefs.h <<_ACEOF\n#define HAVE_UNSIGNED_CHAR 1\n_ACEOF\n\n\nfi\necho \"$as_me:$LINENO: checking for unsigned short\" >&5\necho $ECHO_N \"checking for unsigned short... $ECHO_C\" >&6\nif test \"${ac_cv_type_unsigned_short+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_includes_default\nint\nmain ()\n{\nif ((unsigned short *) 0)\n  return 0;\nif (sizeof (unsigned short))\n  return 0;\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_cv_type_unsigned_short=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_cv_type_unsigned_short=no\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\necho \"$as_me:$LINENO: result: $ac_cv_type_unsigned_short\" >&5\necho \"${ECHO_T}$ac_cv_type_unsigned_short\" >&6\nif test $ac_cv_type_unsigned_short = yes; then\n\ncat >>confdefs.h <<_ACEOF\n#define HAVE_UNSIGNED_SHORT 1\n_ACEOF\n\n\nfi\n\n\necho \"$as_me:$LINENO: checking if right shift is signed\" >&5\necho $ECHO_N \"checking if right shift is signed... $ECHO_C\" >&6\nif test \"$cross_compiling\" = yes; then\n  echo \"$as_me:$LINENO: result: Assuming that right shift is signed on target machine.\" >&5\necho \"${ECHO_T}Assuming that right shift is signed on target machine.\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#include <stdio.h>\n   int is_shifting_signed (long arg) {\n     long res = arg >> 4;\n\n     if (res == -0x7F7E80CL)\n       return 1; /* right shift is signed */\n\n     /* see if unsigned-shift hack will fix it. */\n     /* we can't just test exact value since it depends on width of long... */\n     res |= (~0L) << (32-4);\n     if (res == -0x7F7E80CL)\n       return 0; /* right shift is unsigned */\n\n     printf(\"Right shift isn't acting as I expect it to.\\n\");\n     printf(\"I fear the JPEG software will not work at all.\\n\\n\");\n     return 0; /* try it with unsigned anyway */\n   }\n   int main (void) {\n     exit(is_shifting_signed(-0x7F7E80B1L));\n   }\n_ACEOF\nrm -f conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\n\ncat >>confdefs.h <<\\_ACEOF\n#define RIGHT_SHIFT_IS_UNSIGNED 1\n_ACEOF\n\nelse\n  echo \"$as_me: program exited with status $ac_status\" >&5\necho \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n( exit $ac_status )\necho \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\nfi\nrm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext\nfi\n\n# test whether global names are unique to at least 15 chars\necho \"$as_me:$LINENO: checking for short external names\" >&5\necho $ECHO_N \"checking for short external names... $ECHO_C\" >&6\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\nint possibly_duplicate_function () { return 0; }\n   int possibly_dupli_function () { return 1; }\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  echo \"$as_me:$LINENO: result: ok\" >&5\necho \"${ECHO_T}ok\" >&6\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\necho \"$as_me:$LINENO: result: short\" >&5\necho \"${ECHO_T}short\" >&6\n\ncat >>confdefs.h <<\\_ACEOF\n#define NEED_SHORT_EXTERNAL_NAMES 1\n_ACEOF\n\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\n\n# Checks for library functions.\n\n\nfor ac_func in memset memcpy\ndo\nas_ac_var=`echo \"ac_cv_func_$ac_func\" | $as_tr_sh`\necho \"$as_me:$LINENO: checking for $ac_func\" >&5\necho $ECHO_N \"checking for $ac_func... $ECHO_C\" >&6\nif eval \"test \\\"\\${$as_ac_var+set}\\\" = set\"; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.\n   For example, HP-UX 11i <limits.h> declares gettimeofday.  */\n#define $ac_func innocuous_$ac_func\n\n/* System header to define __stub macros and hopefully few prototypes,\n    which can conflict with char $ac_func (); below.\n    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since\n    <limits.h> exists even on freestanding compilers.  */\n\n#ifdef __STDC__\n# include <limits.h>\n#else\n# include <assert.h>\n#endif\n\n#undef $ac_func\n\n/* Override any gcc2 internal prototype to avoid an error.  */\n#ifdef __cplusplus\nextern \"C\"\n{\n#endif\n/* We use char because int might match the return type of a gcc2\n   builtin and then its argument prototype would still apply.  */\nchar $ac_func ();\n/* The GNU C library defines this for functions which it implements\n    to always fail with ENOSYS.  Some functions are actually named\n    something starting with __ and the normal name is an alias.  */\n#if defined (__stub_$ac_func) || defined (__stub___$ac_func)\nchoke me\n#else\nchar (*f) () = $ac_func;\n#endif\n#ifdef __cplusplus\n}\n#endif\n\nint\nmain ()\n{\nreturn f != $ac_func;\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  eval \"$as_ac_var=yes\"\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\neval \"$as_ac_var=no\"\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nfi\necho \"$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`\" >&5\necho \"${ECHO_T}`eval echo '${'$as_ac_var'}'`\" >&6\nif test `eval echo '${'$as_ac_var'}'` = yes; then\n  cat >>confdefs.h <<_ACEOF\n#define `echo \"HAVE_$ac_func\" | $as_tr_cpp` 1\n_ACEOF\n\nelse\n\ncat >>confdefs.h <<\\_ACEOF\n#define NEED_BSD_STRINGS 1\n_ACEOF\n\nfi\ndone\n\n\necho \"$as_me:$LINENO: checking libjpeg API version\" >&5\necho $ECHO_N \"checking libjpeg API version... $ECHO_C\" >&6\n\nif test \"x$JPEG_LIB_VERSION\" = \"x\"; then\n\n# Check whether --with-jpeg7 or --without-jpeg7 was given.\nif test \"${with_jpeg7+set}\" = set; then\n  withval=\"$with_jpeg7\"\n\nfi;\n\n# Check whether --with-jpeg8 or --without-jpeg8 was given.\nif test \"${with_jpeg8+set}\" = set; then\n  withval=\"$with_jpeg8\"\n\nfi;\n  if test \"x${with_jpeg8}\" = \"xyes\"; then\n    JPEG_LIB_VERSION=80\n  else\n    if test \"x${with_jpeg7}\" = \"xyes\"; then\n      JPEG_LIB_VERSION=70\n    else\n      JPEG_LIB_VERSION=62\n    fi\n  fi\nfi\nJPEG_LIB_VERSION_DECIMAL=`expr $JPEG_LIB_VERSION / 10`.`expr $JPEG_LIB_VERSION % 10`\n\necho \"$as_me:$LINENO: result: $JPEG_LIB_VERSION_DECIMAL\" >&5\necho \"${ECHO_T}$JPEG_LIB_VERSION_DECIMAL\" >&6\n\ncat >>confdefs.h <<_ACEOF\n#define JPEG_LIB_VERSION $JPEG_LIB_VERSION\n_ACEOF\n\n\n\n\nif test \"x$SO_MAJOR_VERSION\" = \"x\"; then\n  case \"$JPEG_LIB_VERSION\" in\n    62)  SO_MAJOR_VERSION=$JPEG_LIB_VERSION ;;\n    *)   SO_MAJOR_VERSION=`expr $JPEG_LIB_VERSION / 10` ;;\n  esac\nfi\nif test \"x$SO_MINOR_VERSION\" = \"x\"; then\n  case \"$JPEG_LIB_VERSION\" in\n    80)  SO_MINOR_VERSION=2 ;;\n    *)   SO_MINOR_VERSION=0 ;;\n  esac\nfi\n\nRPM_CONFIG_ARGS=\n\n# Memory source/destination managers\nSO_AGE=0\nMEM_SRCDST_FUNCTIONS=\nif test \"x${with_jpeg8}\" != \"xyes\"; then\n  echo \"$as_me:$LINENO: checking whether to include in-memory source/destination managers\" >&5\necho $ECHO_N \"checking whether to include in-memory source/destination managers... $ECHO_C\" >&6\n\n# Check whether --with-mem-srcdst or --without-mem-srcdst was given.\nif test \"${with_mem_srcdst+set}\" = set; then\n  withval=\"$with_mem_srcdst\"\n\nfi;\n  if test \"x$with_mem_srcdst\" != \"xno\"; then\n    echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\n\ncat >>confdefs.h <<\\_ACEOF\n#define MEM_SRCDST_SUPPORTED 1\n_ACEOF\n\n    SO_AGE=1\n    MEM_SRCDST_FUNCTIONS=\"global:  jpeg_mem_dest;  jpeg_mem_src;\";\n  else\n    echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\n    RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --without-mem-srcdst\"\n  fi\nfi\n\necho \"$as_me:$LINENO: checking libjpeg shared library version\" >&5\necho $ECHO_N \"checking libjpeg shared library version... $ECHO_C\" >&6\necho \"$as_me:$LINENO: result: $SO_MAJOR_VERSION.$SO_AGE.$SO_MINOR_VERSION\" >&5\necho \"${ECHO_T}$SO_MAJOR_VERSION.$SO_AGE.$SO_MINOR_VERSION\" >&6\nLIBTOOL_CURRENT=`expr $SO_MAJOR_VERSION + $SO_AGE`\n\n\n\n\n\n\n\ncat >>confdefs.h <<_ACEOF\n#define LIBJPEG_TURBO_VERSION $VERSION\n_ACEOF\n\n\nVERSION_SCRIPT=yes\n# Check whether --enable-ld-version-script or --disable-ld-version-script was given.\nif test \"${enable_ld_version_script+set}\" = set; then\n  enableval=\"$enable_ld_version_script\"\n  VERSION_SCRIPT=$enableval\nfi;\n\necho \"$as_me:$LINENO: checking whether the linker supports version scripts\" >&5\necho $ECHO_N \"checking whether the linker supports version scripts... $ECHO_C\" >&6\nSAVED_LDFLAGS=\"$LDFLAGS\"\nLDFLAGS=\"$LDFLAGS -Wl,--version-script,conftest.map\"\ncat > conftest.map <<EOF\nVERS_1 {\n  global: *;\n};\nEOF\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  VERSION_SCRIPT_FLAG=-Wl,--version-script,;\n   echo \"$as_me:$LINENO: result: yes (GNU style)\" >&5\necho \"${ECHO_T}yes (GNU style)\" >&6\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nif test \"x$VERSION_SCRIPT_FLAG\" = \"x\"; then\n  LDFLAGS=\"$SAVED_LDFLAGS -Wl,-M,conftest.map\"\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext conftest$ac_exeext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_link\\\"\") >&5\n  (eval $ac_link) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest$ac_exeext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  VERSION_SCRIPT_FLAG=-Wl,-M,;\n     echo \"$as_me:$LINENO: result: yes (Sun style)\" >&5\necho \"${ECHO_T}yes (Sun style)\" >&6\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nfi\nrm -f conftest.err conftest.$ac_objext \\\n      conftest$ac_exeext conftest.$ac_ext\nfi\nif test \"x$VERSION_SCRIPT_FLAG\" = \"x\"; then\n  VERSION_SCRIPT=no\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\nLDFLAGS=\"$SAVED_LDFLAGS\"\n\necho \"$as_me:$LINENO: checking whether to use version script when building libjpeg-turbo\" >&5\necho $ECHO_N \"checking whether to use version script when building libjpeg-turbo... $ECHO_C\" >&6\necho \"$as_me:$LINENO: result: $VERSION_SCRIPT\" >&5\necho \"${ECHO_T}$VERSION_SCRIPT\" >&6\n\n\n\nif test \"x$VERSION_SCRIPT\" = \"xyes\"; then\n  VERSION_SCRIPT_TRUE=\n  VERSION_SCRIPT_FALSE='#'\nelse\n  VERSION_SCRIPT_TRUE='#'\n  VERSION_SCRIPT_FALSE=\nfi\n\n\n\n# Check for non-broken inline under various spellings\necho \"$as_me:$LINENO: checking for inline\" >&5\necho $ECHO_N \"checking for inline... $ECHO_C\" >&6\nljt_cv_inline=\"\"\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n} __attribute__((always_inline)) int foo() { return 0; }\nint bar() { return foo();\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ljt_cv_inline=\"inline __attribute__((always_inline))\"\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n} __inline__ int foo() { return 0; }\nint bar() { return foo();\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ljt_cv_inline=\"__inline__\"\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n} __inline int foo() { return 0; }\nint bar() { return foo();\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ljt_cv_inline=\"__inline\"\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\nint\nmain ()\n{\n} inline int foo() { return 0; }\nint bar() { return foo();\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ljt_cv_inline=\"inline\"\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\necho \"$as_me:$LINENO: result: $ljt_cv_inline\" >&5\necho \"${ECHO_T}$ljt_cv_inline\" >&6\n\ncat >>confdefs.h <<_ACEOF\n#define INLINE $ljt_cv_inline\n_ACEOF\n\n\n# Arithmetic coding support\necho \"$as_me:$LINENO: checking whether to include arithmetic encoding support\" >&5\necho $ECHO_N \"checking whether to include arithmetic encoding support... $ECHO_C\" >&6\n\n# Check whether --with-arith-enc or --without-arith-enc was given.\nif test \"${with_arith_enc+set}\" = set; then\n  withval=\"$with_arith_enc\"\n\nfi;\nif test \"x$with_arith_enc\" = \"xno\"; then\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\n  RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --without-arith-enc\"\nelse\n\ncat >>confdefs.h <<\\_ACEOF\n#define C_ARITH_CODING_SUPPORTED 1\n_ACEOF\n\n  echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\nfi\n\n\nif test \"x$with_arith_enc\" != \"xno\"; then\n  WITH_ARITH_ENC_TRUE=\n  WITH_ARITH_ENC_FALSE='#'\nelse\n  WITH_ARITH_ENC_TRUE='#'\n  WITH_ARITH_ENC_FALSE=\nfi\n\n\necho \"$as_me:$LINENO: checking whether to include arithmetic decoding support\" >&5\necho $ECHO_N \"checking whether to include arithmetic decoding support... $ECHO_C\" >&6\n\n# Check whether --with-arith-dec or --without-arith-dec was given.\nif test \"${with_arith_dec+set}\" = set; then\n  withval=\"$with_arith_dec\"\n\nfi;\nif test \"x$with_arith_dec\" = \"xno\"; then\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\n  RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --without-arith-dec\"\nelse\n\ncat >>confdefs.h <<\\_ACEOF\n#define D_ARITH_CODING_SUPPORTED 1\n_ACEOF\n\n  echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\nfi\n\n\nif test \"x$with_arith_dec\" != \"xno\"; then\n  WITH_ARITH_DEC_TRUE=\n  WITH_ARITH_DEC_FALSE='#'\nelse\n  WITH_ARITH_DEC_TRUE='#'\n  WITH_ARITH_DEC_FALSE=\nfi\n\n\n\n\nif test \"x$with_arith_dec\" != \"xno\" -o \"x$with_arith_enc\" != \"xno\"; then\n  WITH_ARITH_TRUE=\n  WITH_ARITH_FALSE='#'\nelse\n  WITH_ARITH_TRUE='#'\n  WITH_ARITH_FALSE=\nfi\n\n\n# TurboJPEG support\necho \"$as_me:$LINENO: checking whether to build TurboJPEG C wrapper\" >&5\necho $ECHO_N \"checking whether to build TurboJPEG C wrapper... $ECHO_C\" >&6\n\n# Check whether --with-turbojpeg or --without-turbojpeg was given.\nif test \"${with_turbojpeg+set}\" = set; then\n  withval=\"$with_turbojpeg\"\n\nfi;\nif test \"x$with_turbojpeg\" = \"xno\"; then\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\n  RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --without-turbojpeg\"\nelse\n  echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\nfi\n\n# Java support\n\nif test \"x$JAVAC\" = \"x\"; then\n  JAVAC=javac\nfi\n\n\n\n\nif test \"x$JAR\" = \"x\"; then\n  JAR=jar\nfi\n\n\nif test \"x$JAVA\" = \"x\"; then\n  JAVA=java\nfi\n\n\n\necho \"$as_me:$LINENO: checking whether to build TurboJPEG Java wrapper\" >&5\necho $ECHO_N \"checking whether to build TurboJPEG Java wrapper... $ECHO_C\" >&6\n\n# Check whether --with-java or --without-java was given.\nif test \"${with_java+set}\" = set; then\n  withval=\"$with_java\"\n\nfi;\nif test \"x$with_turbojpeg\" = \"xno\"; then\n  with_java=no\nfi\n\nWITH_JAVA=0\nif test \"x$with_java\" = \"xyes\"; then\n  echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\n\n  case $host_os in\n    darwin*)\n      DEFAULT_JNI_CFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers\n      ;;\n    solaris*)\n      DEFAULT_JNI_CFLAGS='-I/usr/java/include -I/usr/java/include/solaris'\n      ;;\n    linux*)\n      DEFAULT_JNI_CFLAGS='-I/usr/java/default/include -I/usr/java/default/include/linux'\n      ;;\n  esac\n  if test \"x$JNI_CFLAGS\" = \"x\"; then\n    JNI_CFLAGS=$DEFAULT_JNI_CFLAGS\n  fi\n\n  SAVE_CPPFLAGS=${CPPFLAGS}\n  CPPFLAGS=\"${CPPFLAGS} ${JNI_CFLAGS}\"\n\nfor ac_header in jni.h\ndo\nas_ac_Header=`echo \"ac_cv_header_$ac_header\" | $as_tr_sh`\nif eval \"test \\\"\\${$as_ac_Header+set}\\\" = set\"; then\n  echo \"$as_me:$LINENO: checking for $ac_header\" >&5\necho $ECHO_N \"checking for $ac_header... $ECHO_C\" >&6\nif eval \"test \\\"\\${$as_ac_Header+set}\\\" = set\"; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nfi\necho \"$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`\" >&5\necho \"${ECHO_T}`eval echo '${'$as_ac_Header'}'`\" >&6\nelse\n  # Is the header compilable?\necho \"$as_me:$LINENO: checking $ac_header usability\" >&5\necho $ECHO_N \"checking $ac_header usability... $ECHO_C\" >&6\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n$ac_includes_default\n#include <$ac_header>\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_header_compiler=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nac_header_compiler=no\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\necho \"$as_me:$LINENO: result: $ac_header_compiler\" >&5\necho \"${ECHO_T}$ac_header_compiler\" >&6\n\n# Is the header present?\necho \"$as_me:$LINENO: checking $ac_header presence\" >&5\necho $ECHO_N \"checking $ac_header presence... $ECHO_C\" >&6\ncat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n#include <$ac_header>\n_ACEOF\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_cpp conftest.$ac_ext\\\"\") >&5\n  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } >/dev/null; then\n  if test -s conftest.err; then\n    ac_cpp_err=$ac_c_preproc_warn_flag\n    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag\n  else\n    ac_cpp_err=\n  fi\nelse\n  ac_cpp_err=yes\nfi\nif test -z \"$ac_cpp_err\"; then\n  ac_header_preproc=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n  ac_header_preproc=no\nfi\nrm -f conftest.err conftest.$ac_ext\necho \"$as_me:$LINENO: result: $ac_header_preproc\" >&5\necho \"${ECHO_T}$ac_header_preproc\" >&6\n\n# So?  What about this header?\ncase $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in\n  yes:no: )\n    { echo \"$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!\" >&5\necho \"$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result\" >&5\necho \"$as_me: WARNING: $ac_header: proceeding with the compiler's result\" >&2;}\n    ac_header_preproc=yes\n    ;;\n  no:yes:* )\n    { echo \"$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled\" >&5\necho \"$as_me: WARNING: $ac_header: present but cannot be compiled\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?\" >&5\necho \"$as_me: WARNING: $ac_header:     check for missing prerequisite headers?\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation\" >&5\necho \"$as_me: WARNING: $ac_header: see the Autoconf documentation\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: $ac_header:     section \\\"Present But Cannot Be Compiled\\\"\" >&5\necho \"$as_me: WARNING: $ac_header:     section \\\"Present But Cannot Be Compiled\\\"\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result\" >&5\necho \"$as_me: WARNING: $ac_header: proceeding with the preprocessor's result\" >&2;}\n    { echo \"$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence\" >&5\necho \"$as_me: WARNING: $ac_header: in the future, the compiler will take precedence\" >&2;}\n    (\n      cat <<\\_ASBOX\n## ---------------------------------------- ##\n## Report this to the libjpeg-turbo lists.  ##\n## ---------------------------------------- ##\n_ASBOX\n    ) |\n      sed \"s/^/$as_me: WARNING:     /\" >&2\n    ;;\nesac\necho \"$as_me:$LINENO: checking for $ac_header\" >&5\necho $ECHO_N \"checking for $ac_header... $ECHO_C\" >&6\nif eval \"test \\\"\\${$as_ac_Header+set}\\\" = set\"; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  eval \"$as_ac_Header=\\$ac_header_preproc\"\nfi\necho \"$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`\" >&5\necho \"${ECHO_T}`eval echo '${'$as_ac_Header'}'`\" >&6\n\nfi\nif test `eval echo '${'$as_ac_Header'}'` = yes; then\n  cat >>confdefs.h <<_ACEOF\n#define `echo \"HAVE_$ac_header\" | $as_tr_cpp` 1\n_ACEOF\n DUMMY=1\nelse\n  { { echo \"$as_me:$LINENO: error: Could not find JNI header file\" >&5\necho \"$as_me: error: Could not find JNI header file\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\n\ndone\n\n  CPPFLAGS=${SAVE_CPPFLAGS}\n\n\n  RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --with-java\"\n  JAVA_RPM_CONTENTS_1='%dir %{_datadir}/classes'\n  JAVA_RPM_CONTENTS_2=%{_datadir}/classes/turbojpeg.jar\n  WITH_JAVA=1\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\n\nif test \"x$with_java\" = \"xyes\"; then\n  WITH_JAVA_TRUE=\n  WITH_JAVA_FALSE='#'\nelse\n  WITH_JAVA_TRUE='#'\n  WITH_JAVA_FALSE=\nfi\n\n\n\n\n\n# optionally force using gas-preprocessor.pl for compatibility testing\n\n# Check whether --with-gas-preprocessor or --without-gas-preprocessor was given.\nif test \"${with_gas_preprocessor+set}\" = set; then\n  withval=\"$with_gas_preprocessor\"\n\nfi;\nif test \"x${with_gas_preprocessor}\" = \"xyes\"; then\n  case $host_os in\n    darwin*)\n      CCAS=\"gas-preprocessor.pl -fix-unreq $CC\"\n      ;;\n    *)\n      CCAS=\"gas-preprocessor.pl -no-fix-unreq $CC\"\n      ;;\n  esac\n\nfi\n\n# SIMD is optional\n\n# Check whether --with-simd or --without-simd was given.\nif test \"${with_simd+set}\" = set; then\n  withval=\"$with_simd\"\n\nfi;\nif test \"x${with_simd}\" != \"xno\"; then\n  require_simd=no\n  if test \"x${with_simd}\" = \"xyes\"; then\n    require_simd=yes\n  fi\n  # Check if we're on a supported CPU\n  echo \"$as_me:$LINENO: checking if we have SIMD optimisations for cpu type\" >&5\necho $ECHO_N \"checking if we have SIMD optimisations for cpu type... $ECHO_C\" >&6\n  case \"$host_cpu\" in\n    x86_64 | amd64)\n      echo \"$as_me:$LINENO: result: yes (x86_64)\" >&5\necho \"${ECHO_T}yes (x86_64)\" >&6\n\n\nfor ac_prog in nasm nasmw yasm\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_NASM+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$NASM\"; then\n  ac_cv_prog_NASM=\"$NASM\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_NASM=\"$ac_prog\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nNASM=$ac_cv_prog_NASM\nif test -n \"$NASM\"; then\n  echo \"$as_me:$LINENO: result: $NASM\" >&5\necho \"${ECHO_T}$NASM\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\n  test -n \"$NASM\" && break\ndone\n\ntest -z \"$NASM\" && { { echo \"$as_me:$LINENO: error: no nasm (Netwide Assembler) found\" >&5\necho \"$as_me: error: no nasm (Netwide Assembler) found\" >&2;}\n   { (exit 1); exit 1; }; }\n\necho \"$as_me:$LINENO: checking for object file format of host system\" >&5\necho $ECHO_N \"checking for object file format of host system... $ECHO_C\" >&6\ncase \"$host_os\" in\n  cygwin* | mingw* | pw32* | interix*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='Win64-COFF'\n        ;;\n      *)\n        objfmt='Win32-COFF'\n        ;;\n    esac\n  ;;\n  msdosdjgpp* | go32*)\n    objfmt='COFF'\n  ;;\n  os2-emx*)\t\t\t# not tested\n    objfmt='MSOMF'\t\t# obj\n  ;;\n  linux*coff* | linux*oldld*)\n    objfmt='COFF'\t\t# ???\n  ;;\n  linux*aout*)\n    objfmt='a.out'\n  ;;\n  linux*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='ELF64'\n        ;;\n      *)\n        objfmt='ELF'\n        ;;\n    esac\n  ;;\n  kfreebsd* | freebsd* | netbsd* | openbsd*)\n    if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then\n      objfmt='BSD-a.out'\n    else\n      case \"$host_cpu\" in\n        x86_64 | amd64)\n          objfmt='ELF64'\n          ;;\n        *)\n          objfmt='ELF'\n          ;;\n      esac\n    fi\n  ;;\n  solaris* | sunos* | sysv* | sco*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='ELF64'\n        ;;\n      *)\n        objfmt='ELF'\n        ;;\n    esac\n  ;;\n  darwin* | rhapsody* | nextstep* | openstep* | macos*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='Mach-O64'\n        ;;\n      *)\n        objfmt='Mach-O'\n        ;;\n    esac\n  ;;\n  *)\n    objfmt='ELF ?'\n  ;;\nesac\n\necho \"$as_me:$LINENO: result: $objfmt\" >&5\necho \"${ECHO_T}$objfmt\" >&6\nif test \"$objfmt\" = 'ELF ?'; then\n  objfmt='ELF'\n  { echo \"$as_me:$LINENO: WARNING: unexpected host system. assumed that the format is $objfmt.\" >&5\necho \"$as_me: WARNING: unexpected host system. assumed that the format is $objfmt.\" >&2;}\nfi\n\necho \"$as_me:$LINENO: checking for object file format specifier (NAFLAGS) \" >&5\necho $ECHO_N \"checking for object file format specifier (NAFLAGS) ... $ECHO_C\" >&6\ncase \"$objfmt\" in\n  MSOMF)      NAFLAGS='-fobj -DOBJ32';;\n  Win32-COFF) NAFLAGS='-fwin32 -DWIN32';;\n  Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';;\n  COFF)       NAFLAGS='-fcoff -DCOFF';;\n  a.out)      NAFLAGS='-faout -DAOUT';;\n  BSD-a.out)  NAFLAGS='-faoutb -DAOUT';;\n  ELF)        NAFLAGS='-felf -DELF';;\n  ELF64)      NAFLAGS='-felf64 -DELF -D__x86_64__';;\n  RDF)        NAFLAGS='-frdf -DRDF';;\n  Mach-O)     NAFLAGS='-fmacho -DMACHO';;\n  Mach-O64)   NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';;\nesac\necho \"$as_me:$LINENO: result: $NAFLAGS\" >&5\necho \"${ECHO_T}$NAFLAGS\" >&6\n\n\necho \"$as_me:$LINENO: checking whether the assembler ($NASM $NAFLAGS) works\" >&5\necho $ECHO_N \"checking whether the assembler ($NASM $NAFLAGS) works... $ECHO_C\" >&6\ncat > conftest.asm <<EOF\n%line 22940 \"configure\"\n        section .text\n        global  _main,main\n_main:\nmain:   xor     eax,eax\n        ret\nEOF\ntry_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'\nif { (eval echo \"$as_me:$LINENO: \\\"$try_nasm\\\"\") >&5\n  (eval $try_nasm) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } && test -s conftest.o; then\n  echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\nelse\n  echo \"configure: failed program was:\" >&5\n  cat conftest.asm >&5\n  rm -rf conftest*\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\n  { { echo \"$as_me:$LINENO: error: installation or configuration problem: assembler cannot create object files.\" >&5\necho \"$as_me: error: installation or configuration problem: assembler cannot create object files.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\n\necho \"$as_me:$LINENO: checking whether the linker accepts assembler output\" >&5\necho $ECHO_N \"checking whether the linker accepts assembler output... $ECHO_C\" >&6\ntry_nasm='${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.o $LIBS 1>&5'\nif { (eval echo \"$as_me:$LINENO: \\\"$try_nasm\\\"\") >&5\n  (eval $try_nasm) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } && test -s conftest${ac_exeext}; then\n  rm -rf conftest*\n  echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\nelse\n  rm -rf conftest*\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\n  { { echo \"$as_me:$LINENO: error: configuration problem: maybe object file format mismatch.\" >&5\necho \"$as_me: error: configuration problem: maybe object file format mismatch.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\n\n\n      simd_arch=x86_64\n      ;;\n    i*86 | x86 | ia32)\n      echo \"$as_me:$LINENO: result: yes (i386)\" >&5\necho \"${ECHO_T}yes (i386)\" >&6\n\n\nfor ac_prog in nasm nasmw yasm\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\necho \"$as_me:$LINENO: checking for $ac_word\" >&5\necho $ECHO_N \"checking for $ac_word... $ECHO_C\" >&6\nif test \"${ac_cv_prog_NASM+set}\" = set; then\n  echo $ECHO_N \"(cached) $ECHO_C\" >&6\nelse\n  if test -n \"$NASM\"; then\n  ac_cv_prog_NASM=\"$NASM\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for ac_exec_ext in '' $ac_executable_extensions; do\n  if $as_executable_p \"$as_dir/$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_NASM=\"$ac_prog\"\n    echo \"$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\ndone\n\nfi\nfi\nNASM=$ac_cv_prog_NASM\nif test -n \"$NASM\"; then\n  echo \"$as_me:$LINENO: result: $NASM\" >&5\necho \"${ECHO_T}$NASM\" >&6\nelse\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\nfi\n\n  test -n \"$NASM\" && break\ndone\n\ntest -z \"$NASM\" && { { echo \"$as_me:$LINENO: error: no nasm (Netwide Assembler) found\" >&5\necho \"$as_me: error: no nasm (Netwide Assembler) found\" >&2;}\n   { (exit 1); exit 1; }; }\n\necho \"$as_me:$LINENO: checking for object file format of host system\" >&5\necho $ECHO_N \"checking for object file format of host system... $ECHO_C\" >&6\ncase \"$host_os\" in\n  cygwin* | mingw* | pw32* | interix*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='Win64-COFF'\n        ;;\n      *)\n        objfmt='Win32-COFF'\n        ;;\n    esac\n  ;;\n  msdosdjgpp* | go32*)\n    objfmt='COFF'\n  ;;\n  os2-emx*)\t\t\t# not tested\n    objfmt='MSOMF'\t\t# obj\n  ;;\n  linux*coff* | linux*oldld*)\n    objfmt='COFF'\t\t# ???\n  ;;\n  linux*aout*)\n    objfmt='a.out'\n  ;;\n  linux*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='ELF64'\n        ;;\n      *)\n        objfmt='ELF'\n        ;;\n    esac\n  ;;\n  kfreebsd* | freebsd* | netbsd* | openbsd*)\n    if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then\n      objfmt='BSD-a.out'\n    else\n      case \"$host_cpu\" in\n        x86_64 | amd64)\n          objfmt='ELF64'\n          ;;\n        *)\n          objfmt='ELF'\n          ;;\n      esac\n    fi\n  ;;\n  solaris* | sunos* | sysv* | sco*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='ELF64'\n        ;;\n      *)\n        objfmt='ELF'\n        ;;\n    esac\n  ;;\n  darwin* | rhapsody* | nextstep* | openstep* | macos*)\n    case \"$host_cpu\" in\n      x86_64)\n        objfmt='Mach-O64'\n        ;;\n      *)\n        objfmt='Mach-O'\n        ;;\n    esac\n  ;;\n  *)\n    objfmt='ELF ?'\n  ;;\nesac\n\necho \"$as_me:$LINENO: result: $objfmt\" >&5\necho \"${ECHO_T}$objfmt\" >&6\nif test \"$objfmt\" = 'ELF ?'; then\n  objfmt='ELF'\n  { echo \"$as_me:$LINENO: WARNING: unexpected host system. assumed that the format is $objfmt.\" >&5\necho \"$as_me: WARNING: unexpected host system. assumed that the format is $objfmt.\" >&2;}\nfi\n\necho \"$as_me:$LINENO: checking for object file format specifier (NAFLAGS) \" >&5\necho $ECHO_N \"checking for object file format specifier (NAFLAGS) ... $ECHO_C\" >&6\ncase \"$objfmt\" in\n  MSOMF)      NAFLAGS='-fobj -DOBJ32';;\n  Win32-COFF) NAFLAGS='-fwin32 -DWIN32';;\n  Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';;\n  COFF)       NAFLAGS='-fcoff -DCOFF';;\n  a.out)      NAFLAGS='-faout -DAOUT';;\n  BSD-a.out)  NAFLAGS='-faoutb -DAOUT';;\n  ELF)        NAFLAGS='-felf -DELF';;\n  ELF64)      NAFLAGS='-felf64 -DELF -D__x86_64__';;\n  RDF)        NAFLAGS='-frdf -DRDF';;\n  Mach-O)     NAFLAGS='-fmacho -DMACHO';;\n  Mach-O64)   NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';;\nesac\necho \"$as_me:$LINENO: result: $NAFLAGS\" >&5\necho \"${ECHO_T}$NAFLAGS\" >&6\n\n\necho \"$as_me:$LINENO: checking whether the assembler ($NASM $NAFLAGS) works\" >&5\necho $ECHO_N \"checking whether the assembler ($NASM $NAFLAGS) works... $ECHO_C\" >&6\ncat > conftest.asm <<EOF\n%line 23142 \"configure\"\n        section .text\n        global  _main,main\n_main:\nmain:   xor     eax,eax\n        ret\nEOF\ntry_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'\nif { (eval echo \"$as_me:$LINENO: \\\"$try_nasm\\\"\") >&5\n  (eval $try_nasm) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } && test -s conftest.o; then\n  echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\nelse\n  echo \"configure: failed program was:\" >&5\n  cat conftest.asm >&5\n  rm -rf conftest*\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\n  { { echo \"$as_me:$LINENO: error: installation or configuration problem: assembler cannot create object files.\" >&5\necho \"$as_me: error: installation or configuration problem: assembler cannot create object files.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\n\necho \"$as_me:$LINENO: checking whether the linker accepts assembler output\" >&5\necho $ECHO_N \"checking whether the linker accepts assembler output... $ECHO_C\" >&6\ntry_nasm='${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.o $LIBS 1>&5'\nif { (eval echo \"$as_me:$LINENO: \\\"$try_nasm\\\"\") >&5\n  (eval $try_nasm) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } && test -s conftest${ac_exeext}; then\n  rm -rf conftest*\n  echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\nelse\n  rm -rf conftest*\n  echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\n  { { echo \"$as_me:$LINENO: error: configuration problem: maybe object file format mismatch.\" >&5\necho \"$as_me: error: configuration problem: maybe object file format mismatch.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\n\n\n      simd_arch=i386\n      ;;\n    arm*)\n      echo \"$as_me:$LINENO: result: yes (arm)\" >&5\necho \"${ECHO_T}yes (arm)\" >&6\n      echo \"$as_me:$LINENO: checking if the assembler is GNU-compatible and can be used\" >&5\necho $ECHO_N \"checking if the assembler is GNU-compatible and can be used... $ECHO_C\" >&6\n\n  ac_good_gnu_arm_assembler=no\n  ac_save_CC=\"$CC\"\n  ac_save_CFLAGS=\"$CFLAGS\"\n  CFLAGS=\"$CCASFLAGS -x assembler-with-cpp\"\n  CC=\"$CCAS\"\n  cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\n    .text\n    .fpu neon\n    .arch armv7a\n    .object_arch armv4\n    .arm\n    pld [r0]\n    vmovn.u16 d0, q0\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_good_gnu_arm_assembler=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\n\n  ac_use_gas_preprocessor=no\n  if test \"x$ac_good_gnu_arm_assembler\" = \"xno\" ; then\n    CC=\"gas-preprocessor.pl $CCAS\"\n    cat >conftest.$ac_ext <<_ACEOF\n/* confdefs.h.  */\n_ACEOF\ncat confdefs.h >>conftest.$ac_ext\ncat >>conftest.$ac_ext <<_ACEOF\n/* end confdefs.h.  */\n\n      .text\n      .fpu neon\n      .arch armv7a\n      .object_arch armv4\n      .arm\n      pld [r0]\n      vmovn.u16 d0, q0\n_ACEOF\nrm -f conftest.$ac_objext\nif { (eval echo \"$as_me:$LINENO: \\\"$ac_compile\\\"\") >&5\n  (eval $ac_compile) 2>conftest.er1\n  ac_status=$?\n  grep -v '^ *+' conftest.er1 >conftest.err\n  rm -f conftest.er1\n  cat conftest.err >&5\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); } &&\n\t { ac_try='test -z \"$ac_c_werror_flag\"\n\t\t\t || test ! -s conftest.err'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; } &&\n\t { ac_try='test -s conftest.$ac_objext'\n  { (eval echo \"$as_me:$LINENO: \\\"$ac_try\\\"\") >&5\n  (eval $ac_try) 2>&5\n  ac_status=$?\n  echo \"$as_me:$LINENO: \\$? = $ac_status\" >&5\n  (exit $ac_status); }; }; then\n  ac_use_gas_preprocessor=yes\nelse\n  echo \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\nfi\nrm -f conftest.err conftest.$ac_objext conftest.$ac_ext\n  fi\n  CFLAGS=\"$ac_save_CFLAGS\"\n  CC=\"$ac_save_CC\"\n\n  if test \"x$ac_use_gas_preprocessor\" = \"xyes\" ; then\n    CCAS=\"gas-preprocessor.pl $CCAS\"\n\n    ac_good_gnu_arm_assembler=yes\n  fi\n\n  if test \"x$ac_good_gnu_arm_assembler\" = \"xyes\" ; then\n    echo \"$as_me:$LINENO: result: yes\" >&5\necho \"${ECHO_T}yes\" >&6\n         simd_arch=arm\n  else\n    echo \"$as_me:$LINENO: result: no\" >&5\necho \"${ECHO_T}no\" >&6\n         with_simd=no\n  fi\n\n      if test \"x${with_simd}\" = \"xno\"; then\n        if test \"x${require_simd}\" = \"xyes\"; then\n          { { echo \"$as_me:$LINENO: error: SIMD support can't be enabled.\" >&5\necho \"$as_me: error: SIMD support can't be enabled.\" >&2;}\n   { (exit 1); exit 1; }; }\n        else\n          { echo \"$as_me:$LINENO: WARNING: SIMD support can't be enabled.  Performance will suffer.\" >&5\necho \"$as_me: WARNING: SIMD support can't be enabled.  Performance will suffer.\" >&2;}\n        fi\n      fi\n      ;;\n    *)\n      echo \"$as_me:$LINENO: result: no (\\\"$host_cpu\\\")\" >&5\necho \"${ECHO_T}no (\\\"$host_cpu\\\")\" >&6\n      with_simd=no;\n      if test \"x${require_simd}\" = \"xyes\"; then\n        { { echo \"$as_me:$LINENO: error: SIMD support not available for this CPU.\" >&5\necho \"$as_me: error: SIMD support not available for this CPU.\" >&2;}\n   { (exit 1); exit 1; }; }\n      else\n        { echo \"$as_me:$LINENO: WARNING: SIMD support not available for this CPU.  Performance will suffer.\" >&5\necho \"$as_me: WARNING: SIMD support not available for this CPU.  Performance will suffer.\" >&2;}\n      fi\n      ;;\n  esac\n\n  if test \"x${with_simd}\" != \"xno\"; then\n\ncat >>confdefs.h <<\\_ACEOF\n#define WITH_SIMD 1\n_ACEOF\n\n  fi\nelse\n  RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --without-simd\"\nfi\n\n\n\nif test \"x$with_simd\" != \"xno\"; then\n  WITH_SIMD_TRUE=\n  WITH_SIMD_FALSE='#'\nelse\n  WITH_SIMD_TRUE='#'\n  WITH_SIMD_FALSE=\nfi\n\n\n\nif test \"x$simd_arch\" = \"xx86_64\" -o \"x$simd_arch\" = \"xi386\"; then\n  WITH_SSE_FLOAT_DCT_TRUE=\n  WITH_SSE_FLOAT_DCT_FALSE='#'\nelse\n  WITH_SSE_FLOAT_DCT_TRUE='#'\n  WITH_SSE_FLOAT_DCT_FALSE=\nfi\n\n\n\nif test \"x$simd_arch\" = \"xi386\"; then\n  SIMD_I386_TRUE=\n  SIMD_I386_FALSE='#'\nelse\n  SIMD_I386_TRUE='#'\n  SIMD_I386_FALSE=\nfi\n\n\n\nif test \"x$simd_arch\" = \"xx86_64\"; then\n  SIMD_X86_64_TRUE=\n  SIMD_X86_64_FALSE='#'\nelse\n  SIMD_X86_64_TRUE='#'\n  SIMD_X86_64_FALSE=\nfi\n\n\n\nif test \"x$simd_arch\" = \"xarm\"; then\n  SIMD_ARM_TRUE=\n  SIMD_ARM_FALSE='#'\nelse\n  SIMD_ARM_TRUE='#'\n  SIMD_ARM_FALSE=\nfi\n\n\n\nif test \"x$host_cpu\" = \"xx86_64\" -o \"x$host_cpu\" = \"xamd64\"; then\n  X86_64_TRUE=\n  X86_64_FALSE='#'\nelse\n  X86_64_TRUE='#'\n  X86_64_FALSE=\nfi\n\n\n\nif test \"x$with_turbojpeg\" != \"xno\"; then\n  WITH_TURBOJPEG_TRUE=\n  WITH_TURBOJPEG_FALSE='#'\nelse\n  WITH_TURBOJPEG_TRUE='#'\n  WITH_TURBOJPEG_FALSE=\nfi\n\n\n\nif test \"x$PKGNAME\" = \"x\"; then\n  PKGNAME=$PACKAGE_NAME\nfi\n\n\ncase \"$host_cpu\" in\n  x86_64)\n    RPMARCH=x86_64\n    DEBARCH=amd64\n    ;;\n  i*86 | x86 | ia32)\n    RPMARCH=i386\n    DEBARCH=i386\n    ;;\nesac\n\n\n\n\n\n\ncat >>confdefs.h <<_ACEOF\n#define BUILD \"$BUILD\"\n_ACEOF\n\n\n# jconfig.h is the file we use, but we have another before that to\n# fool autoheader. the reason is that we include this header in our\n# API headers, which can screw things up for users of the lib.\n# jconfig.h is a minimal version that allows this package to be built\n          ac_config_headers=\"$ac_config_headers config.h\"\n\n          ac_config_headers=\"$ac_config_headers jconfig.h\"\n\n          ac_config_files=\"$ac_config_files pkgscripts/libjpeg-turbo.spec.tmpl:release/libjpeg-turbo.spec.in\"\n\n          ac_config_files=\"$ac_config_files pkgscripts/makecygwinpkg.tmpl:release/makecygwinpkg.in\"\n\n          ac_config_files=\"$ac_config_files pkgscripts/makedpkg.tmpl:release/makedpkg.in\"\n\n          ac_config_files=\"$ac_config_files pkgscripts/makemacpkg.tmpl:release/makemacpkg.in\"\n\n          ac_config_files=\"$ac_config_files pkgscripts/Description.plist:release/Description.plist.in\"\n\n          ac_config_files=\"$ac_config_files pkgscripts/Info.plist:release/Info.plist.in\"\n\n          ac_config_files=\"$ac_config_files pkgscripts/uninstall.tmpl:release/uninstall.in\"\n\nif test \"x$with_turbojpeg\" != \"xno\"; then\n            ac_config_files=\"$ac_config_files tjbenchtest\"\n\nfi\nif test \"x$with_java\" = \"xyes\"; then\n            ac_config_files=\"$ac_config_files tjbenchtest.java\"\n\n            ac_config_files=\"$ac_config_files tjexampletest\"\n\nfi\n          ac_config_files=\"$ac_config_files libjpeg.map\"\n\n                    ac_config_files=\"$ac_config_files Makefile simd/Makefile\"\n\n          ac_config_files=\"$ac_config_files java/Makefile\"\n\n          ac_config_files=\"$ac_config_files md5/Makefile\"\n\ncat >confcache <<\\_ACEOF\n# This file is a shell script that caches the results of configure\n# tests run on this system so they can be shared between configure\n# scripts and configure runs, see configure's option --config-cache.\n# It is not useful on other systems.  If it contains results you don't\n# want to keep, you may remove or edit it.\n#\n# config.status only pays attention to the cache file if you give it\n# the --recheck option to rerun configure.\n#\n# `ac_cv_env_foo' variables (set or unset) will be overridden when\n# loading this file, other *unset* `ac_cv_foo' will be assigned the\n# following values.\n\n_ACEOF\n\n# The following way of writing the cache mishandles newlines in values,\n# but we know of no workaround that is simple, portable, and efficient.\n# So, don't put newlines in cache variables' values.\n# Ultrix sh set writes to stderr and can't be redirected directly,\n# and sets the high bit in the cache file unless we assign to the vars.\n{\n  (set) 2>&1 |\n    case `(ac_space=' '; set | grep ac_space) 2>&1` in\n    *ac_space=\\ *)\n      # `set' does not quote correctly, so add quotes (double-quote\n      # substitution turns \\\\\\\\ into \\\\, and sed turns \\\\ into \\).\n      sed -n \\\n\t\"s/'/'\\\\\\\\''/g;\n\t  s/^\\\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\\\)=\\\\(.*\\\\)/\\\\1='\\\\2'/p\"\n      ;;\n    *)\n      # `set' quotes correctly as required by POSIX, so do not add quotes.\n      sed -n \\\n\t\"s/^\\\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\\\)=\\\\(.*\\\\)/\\\\1=\\\\2/p\"\n      ;;\n    esac;\n} |\n  sed '\n     t clear\n     : clear\n     s/^\\([^=]*\\)=\\(.*[{}].*\\)$/test \"${\\1+set}\" = set || &/\n     t end\n     /^ac_cv_env/!s/^\\([^=]*\\)=\\(.*\\)$/\\1=${\\1=\\2}/\n     : end' >>confcache\nif diff $cache_file confcache >/dev/null 2>&1; then :; else\n  if test -w $cache_file; then\n    test \"x$cache_file\" != \"x/dev/null\" && echo \"updating cache $cache_file\"\n    cat confcache >$cache_file\n  else\n    echo \"not updating unwritable cache $cache_file\"\n  fi\nfi\nrm -f confcache\n\ntest \"x$prefix\" = xNONE && prefix=$ac_default_prefix\n# Let make expand exec_prefix.\ntest \"x$exec_prefix\" = xNONE && exec_prefix='${prefix}'\n\n# VPATH may cause trouble with some makes, so we remove $(srcdir),\n# ${srcdir} and @srcdir@ from VPATH if srcdir is \".\", strip leading and\n# trailing colons and then remove the whole line if VPATH becomes empty\n# (actually we leave an empty line to preserve line numbers).\nif test \"x$srcdir\" = x.; then\n  ac_vpsub='/^[\t ]*VPATH[\t ]*=/{\ns/:*\\$(srcdir):*/:/;\ns/:*\\${srcdir}:*/:/;\ns/:*@srcdir@:*/:/;\ns/^\\([^=]*=[\t ]*\\):*/\\1/;\ns/:*$//;\ns/^[^=]*=[\t ]*$//;\n}'\nfi\n\nDEFS=-DHAVE_CONFIG_H\n\nac_libobjs=\nac_ltlibobjs=\nfor ac_i in : $LIBOBJS; do test \"x$ac_i\" = x: && continue\n  # 1. Remove the extension, and $U if already installed.\n  ac_i=`echo \"$ac_i\" |\n\t sed 's/\\$U\\././;s/\\.o$//;s/\\.obj$//'`\n  # 2. Add them.\n  ac_libobjs=\"$ac_libobjs $ac_i\\$U.$ac_objext\"\n  ac_ltlibobjs=\"$ac_ltlibobjs $ac_i\"'$U.lo'\ndone\nLIBOBJS=$ac_libobjs\n\nLTLIBOBJS=$ac_ltlibobjs\n\n\nif test -z \"${AMDEP_TRUE}\" && test -z \"${AMDEP_FALSE}\"; then\n  { { echo \"$as_me:$LINENO: error: conditional \\\"AMDEP\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&5\necho \"$as_me: error: conditional \\\"AMDEP\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\nif test -z \"${am__fastdepCC_TRUE}\" && test -z \"${am__fastdepCC_FALSE}\"; then\n  { { echo \"$as_me:$LINENO: error: conditional \\\"am__fastdepCC\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&5\necho \"$as_me: error: conditional \\\"am__fastdepCC\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\nif test -z \"${am__fastdepCC_TRUE}\" && test -z \"${am__fastdepCC_FALSE}\"; then\n  { { echo \"$as_me:$LINENO: error: conditional \\\"am__fastdepCC\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&5\necho \"$as_me: error: conditional \\\"am__fastdepCC\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\nif test -z \"${am__fastdepCXX_TRUE}\" && test -z \"${am__fastdepCXX_FALSE}\"; then\n  { { echo \"$as_me:$LINENO: error: conditional \\\"am__fastdepCXX\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&5\necho \"$as_me: error: conditional \\\"am__fastdepCXX\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\nif test -z \"${VERSION_SCRIPT_TRUE}\" && test -z \"${VERSION_SCRIPT_FALSE}\"; then\n  { { echo \"$as_me:$LINENO: error: conditional \\\"VERSION_SCRIPT\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&5\necho \"$as_me: error: conditional \\\"VERSION_SCRIPT\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\nif test -z \"${WITH_ARITH_ENC_TRUE}\" && test -z \"${WITH_ARITH_ENC_FALSE}\"; then\n  { { echo \"$as_me:$LINENO: error: conditional \\\"WITH_ARITH_ENC\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&5\necho \"$as_me: error: conditional \\\"WITH_ARITH_ENC\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\nif test -z \"${WITH_ARITH_DEC_TRUE}\" && test -z \"${WITH_ARITH_DEC_FALSE}\"; then\n  { { echo \"$as_me:$LINENO: error: conditional \\\"WITH_ARITH_DEC\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&5\necho \"$as_me: error: conditional \\\"WITH_ARITH_DEC\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\nif test -z \"${WITH_ARITH_TRUE}\" && test -z \"${WITH_ARITH_FALSE}\"; then\n  { { echo \"$as_me:$LINENO: error: conditional \\\"WITH_ARITH\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&5\necho \"$as_me: error: conditional \\\"WITH_ARITH\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\nif test -z \"${WITH_JAVA_TRUE}\" && test -z \"${WITH_JAVA_FALSE}\"; then\n  { { echo \"$as_me:$LINENO: error: conditional \\\"WITH_JAVA\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&5\necho \"$as_me: error: conditional \\\"WITH_JAVA\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\nif test -z \"${WITH_SIMD_TRUE}\" && test -z \"${WITH_SIMD_FALSE}\"; then\n  { { echo \"$as_me:$LINENO: error: conditional \\\"WITH_SIMD\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&5\necho \"$as_me: error: conditional \\\"WITH_SIMD\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\nif test -z \"${WITH_SSE_FLOAT_DCT_TRUE}\" && test -z \"${WITH_SSE_FLOAT_DCT_FALSE}\"; then\n  { { echo \"$as_me:$LINENO: error: conditional \\\"WITH_SSE_FLOAT_DCT\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&5\necho \"$as_me: error: conditional \\\"WITH_SSE_FLOAT_DCT\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\nif test -z \"${SIMD_I386_TRUE}\" && test -z \"${SIMD_I386_FALSE}\"; then\n  { { echo \"$as_me:$LINENO: error: conditional \\\"SIMD_I386\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&5\necho \"$as_me: error: conditional \\\"SIMD_I386\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\nif test -z \"${SIMD_X86_64_TRUE}\" && test -z \"${SIMD_X86_64_FALSE}\"; then\n  { { echo \"$as_me:$LINENO: error: conditional \\\"SIMD_X86_64\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&5\necho \"$as_me: error: conditional \\\"SIMD_X86_64\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\nif test -z \"${SIMD_ARM_TRUE}\" && test -z \"${SIMD_ARM_FALSE}\"; then\n  { { echo \"$as_me:$LINENO: error: conditional \\\"SIMD_ARM\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&5\necho \"$as_me: error: conditional \\\"SIMD_ARM\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\nif test -z \"${X86_64_TRUE}\" && test -z \"${X86_64_FALSE}\"; then\n  { { echo \"$as_me:$LINENO: error: conditional \\\"X86_64\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&5\necho \"$as_me: error: conditional \\\"X86_64\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\nif test -z \"${WITH_TURBOJPEG_TRUE}\" && test -z \"${WITH_TURBOJPEG_FALSE}\"; then\n  { { echo \"$as_me:$LINENO: error: conditional \\\"WITH_TURBOJPEG\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&5\necho \"$as_me: error: conditional \\\"WITH_TURBOJPEG\\\" was never defined.\nUsually this means the macro was only invoked conditionally.\" >&2;}\n   { (exit 1); exit 1; }; }\nfi\n\n: ${CONFIG_STATUS=./config.status}\nac_clean_files_save=$ac_clean_files\nac_clean_files=\"$ac_clean_files $CONFIG_STATUS\"\n{ echo \"$as_me:$LINENO: creating $CONFIG_STATUS\" >&5\necho \"$as_me: creating $CONFIG_STATUS\" >&6;}\ncat >$CONFIG_STATUS <<_ACEOF\n#! $SHELL\n# Generated by $as_me.\n# Run this file to recreate the current configuration.\n# Compiler output produced by configure, useful for debugging\n# configure, is in config.log if it exists.\n\ndebug=false\nac_cs_recheck=false\nac_cs_silent=false\nSHELL=\\${CONFIG_SHELL-$SHELL}\n_ACEOF\n\ncat >>$CONFIG_STATUS <<\\_ACEOF\n## --------------------- ##\n## M4sh Initialization.  ##\n## --------------------- ##\n\n# Be Bourne compatible\nif test -n \"${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then\n  emulate sh\n  NULLCMD=:\n  # Zsh 3.x and 4.x performs word splitting on ${1+\"$@\"}, which\n  # is contrary to our usage.  Disable this feature.\n  alias -g '${1+\"$@\"}'='\"$@\"'\nelif test -n \"${BASH_VERSION+set}\" && (set -o posix) >/dev/null 2>&1; then\n  set -o posix\nfi\nDUALCASE=1; export DUALCASE # for MKS sh\n\n# Support unset when possible.\nif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then\n  as_unset=unset\nelse\n  as_unset=false\nfi\n\n\n# Work around bugs in pre-3.0 UWIN ksh.\n$as_unset ENV MAIL MAILPATH\nPS1='$ '\nPS2='> '\nPS4='+ '\n\n# NLS nuisances.\nfor as_var in \\\n  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \\\n  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \\\n  LC_TELEPHONE LC_TIME\ndo\n  if (set +x; test -z \"`(eval $as_var=C; export $as_var) 2>&1`\"); then\n    eval $as_var=C; export $as_var\n  else\n    $as_unset $as_var\n  fi\ndone\n\n# Required to use basename.\nif expr a : '\\(a\\)' >/dev/null 2>&1; then\n  as_expr=expr\nelse\n  as_expr=false\nfi\n\nif (basename /) >/dev/null 2>&1 && test \"X`basename / 2>&1`\" = \"X/\"; then\n  as_basename=basename\nelse\n  as_basename=false\nfi\n\n\n# Name of the executable.\nas_me=`$as_basename \"$0\" ||\n$as_expr X/\"$0\" : '.*/\\([^/][^/]*\\)/*$' \\| \\\n\t X\"$0\" : 'X\\(//\\)$' \\| \\\n\t X\"$0\" : 'X\\(/\\)$' \\| \\\n\t .     : '\\(.\\)' 2>/dev/null ||\necho X/\"$0\" |\n    sed '/^.*\\/\\([^/][^/]*\\)\\/*$/{ s//\\1/; q; }\n  \t  /^X\\/\\(\\/\\/\\)$/{ s//\\1/; q; }\n  \t  /^X\\/\\(\\/\\).*/{ s//\\1/; q; }\n  \t  s/.*/./; q'`\n\n\n# PATH needs CR, and LINENO needs CR and PATH.\n# Avoid depending upon Character Ranges.\nas_cr_letters='abcdefghijklmnopqrstuvwxyz'\nas_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'\nas_cr_Letters=$as_cr_letters$as_cr_LETTERS\nas_cr_digits='0123456789'\nas_cr_alnum=$as_cr_Letters$as_cr_digits\n\n# The user is always right.\nif test \"${PATH_SEPARATOR+set}\" != set; then\n  echo \"#! /bin/sh\" >conf$$.sh\n  echo  \"exit 0\"   >>conf$$.sh\n  chmod +x conf$$.sh\n  if (PATH=\"/nonexistent;.\"; conf$$.sh) >/dev/null 2>&1; then\n    PATH_SEPARATOR=';'\n  else\n    PATH_SEPARATOR=:\n  fi\n  rm -f conf$$.sh\nfi\n\n\n  as_lineno_1=$LINENO\n  as_lineno_2=$LINENO\n  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`\n  test \"x$as_lineno_1\" != \"x$as_lineno_2\" &&\n  test \"x$as_lineno_3\"  = \"x$as_lineno_2\"  || {\n  # Find who we are.  Look in the path if we contain no path at all\n  # relative or not.\n  case $0 in\n    *[\\\\/]* ) as_myself=$0 ;;\n    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  test -r \"$as_dir/$0\" && as_myself=$as_dir/$0 && break\ndone\n\n       ;;\n  esac\n  # We did not find ourselves, most probably we were run as `sh COMMAND'\n  # in which case we are not to be found in the path.\n  if test \"x$as_myself\" = x; then\n    as_myself=$0\n  fi\n  if test ! -f \"$as_myself\"; then\n    { { echo \"$as_me:$LINENO: error: cannot find myself; rerun with an absolute path\" >&5\necho \"$as_me: error: cannot find myself; rerun with an absolute path\" >&2;}\n   { (exit 1); exit 1; }; }\n  fi\n  case $CONFIG_SHELL in\n  '')\n    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH\ndo\n  IFS=$as_save_IFS\n  test -z \"$as_dir\" && as_dir=.\n  for as_base in sh bash ksh sh5; do\n\t case $as_dir in\n\t /*)\n\t   if (\"$as_dir/$as_base\" -c '\n  as_lineno_1=$LINENO\n  as_lineno_2=$LINENO\n  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`\n  test \"x$as_lineno_1\" != \"x$as_lineno_2\" &&\n  test \"x$as_lineno_3\"  = \"x$as_lineno_2\" ') 2>/dev/null; then\n\t     $as_unset BASH_ENV || test \"${BASH_ENV+set}\" != set || { BASH_ENV=; export BASH_ENV; }\n\t     $as_unset ENV || test \"${ENV+set}\" != set || { ENV=; export ENV; }\n\t     CONFIG_SHELL=$as_dir/$as_base\n\t     export CONFIG_SHELL\n\t     exec \"$CONFIG_SHELL\" \"$0\" ${1+\"$@\"}\n\t   fi;;\n\t esac\n       done\ndone\n;;\n  esac\n\n  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO\n  # uniformly replaced by the line number.  The first 'sed' inserts a\n  # line-number line before each line; the second 'sed' does the real\n  # work.  The second script uses 'N' to pair each line-number line\n  # with the numbered line, and appends trailing '-' during\n  # substitution so that $LINENO is not a special case at line end.\n  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the\n  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)\n  sed '=' <$as_myself |\n    sed '\n      N\n      s,$,-,\n      : loop\n      s,^\\(['$as_cr_digits']*\\)\\(.*\\)[$]LINENO\\([^'$as_cr_alnum'_]\\),\\1\\2\\1\\3,\n      t loop\n      s,-$,,\n      s,^['$as_cr_digits']*\\n,,\n    ' >$as_me.lineno &&\n  chmod +x $as_me.lineno ||\n    { { echo \"$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell\" >&5\necho \"$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell\" >&2;}\n   { (exit 1); exit 1; }; }\n\n  # Don't try to exec as it changes $[0], causing all sort of problems\n  # (the dirname of $[0] is not the place where we might find the\n  # original and so on.  Autoconf is especially sensible to this).\n  . ./$as_me.lineno\n  # Exit status is that of the last command.\n  exit\n}\n\n\ncase `echo \"testing\\c\"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in\n  *c*,-n*) ECHO_N= ECHO_C='\n' ECHO_T='\t' ;;\n  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;\n  *)       ECHO_N= ECHO_C='\\c' ECHO_T= ;;\nesac\n\nif expr a : '\\(a\\)' >/dev/null 2>&1; then\n  as_expr=expr\nelse\n  as_expr=false\nfi\n\nrm -f conf$$ conf$$.exe conf$$.file\necho >conf$$.file\nif ln -s conf$$.file conf$$ 2>/dev/null; then\n  # We could just check for DJGPP; but this test a) works b) is more generic\n  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).\n  if test -f conf$$.exe; then\n    # Don't use ln at all; we don't have any links\n    as_ln_s='cp -p'\n  else\n    as_ln_s='ln -s'\n  fi\nelif ln conf$$.file conf$$ 2>/dev/null; then\n  as_ln_s=ln\nelse\n  as_ln_s='cp -p'\nfi\nrm -f conf$$ conf$$.exe conf$$.file\n\nif mkdir -p . 2>/dev/null; then\n  as_mkdir_p=:\nelse\n  test -d ./-p && rmdir ./-p\n  as_mkdir_p=false\nfi\n\nas_executable_p=\"test -f\"\n\n# Sed expression to map a string onto a valid CPP name.\nas_tr_cpp=\"eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'\"\n\n# Sed expression to map a string onto a valid variable name.\nas_tr_sh=\"eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'\"\n\n\n# IFS\n# We need space, tab and new line, in precisely that order.\nas_nl='\n'\nIFS=\" \t$as_nl\"\n\n# CDPATH.\n$as_unset CDPATH\n\nexec 6>&1\n\n# Open the log real soon, to keep \\$[0] and so on meaningful, and to\n# report actual input values of CONFIG_FILES etc. instead of their\n# values after options handling.  Logging --version etc. is OK.\nexec 5>>config.log\n{\n  echo\n  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX\n## Running $as_me. ##\n_ASBOX\n} >&5\ncat >&5 <<_CSEOF\n\nThis file was extended by libjpeg-turbo $as_me 1.3.1, which was\ngenerated by GNU Autoconf 2.59.  Invocation command line was\n\n  CONFIG_FILES    = $CONFIG_FILES\n  CONFIG_HEADERS  = $CONFIG_HEADERS\n  CONFIG_LINKS    = $CONFIG_LINKS\n  CONFIG_COMMANDS = $CONFIG_COMMANDS\n  $ $0 $@\n\n_CSEOF\necho \"on `(hostname || uname -n) 2>/dev/null | sed 1q`\" >&5\necho >&5\n_ACEOF\n\n# Files that config.status was made for.\nif test -n \"$ac_config_files\"; then\n  echo \"config_files=\\\"$ac_config_files\\\"\" >>$CONFIG_STATUS\nfi\n\nif test -n \"$ac_config_headers\"; then\n  echo \"config_headers=\\\"$ac_config_headers\\\"\" >>$CONFIG_STATUS\nfi\n\nif test -n \"$ac_config_links\"; then\n  echo \"config_links=\\\"$ac_config_links\\\"\" >>$CONFIG_STATUS\nfi\n\nif test -n \"$ac_config_commands\"; then\n  echo \"config_commands=\\\"$ac_config_commands\\\"\" >>$CONFIG_STATUS\nfi\n\ncat >>$CONFIG_STATUS <<\\_ACEOF\n\nac_cs_usage=\"\\\n\\`$as_me' instantiates files from templates according to the\ncurrent configuration.\n\nUsage: $0 [OPTIONS] [FILE]...\n\n  -h, --help       print this help, then exit\n  -V, --version    print version number, then exit\n  -q, --quiet      do not print progress messages\n  -d, --debug      don't remove temporary files\n      --recheck    update $as_me by reconfiguring in the same conditions\n  --file=FILE[:TEMPLATE]\n\t\t   instantiate the configuration file FILE\n  --header=FILE[:TEMPLATE]\n\t\t   instantiate the configuration header FILE\n\nConfiguration files:\n$config_files\n\nConfiguration headers:\n$config_headers\n\nConfiguration commands:\n$config_commands\n\nReport bugs to <bug-autoconf@gnu.org>.\"\n_ACEOF\n\ncat >>$CONFIG_STATUS <<_ACEOF\nac_cs_version=\"\\\\\nlibjpeg-turbo config.status 1.3.1\nconfigured by $0, generated by GNU Autoconf 2.59,\n  with options \\\\\"`echo \"$ac_configure_args\" | sed 's/[\\\\\"\"\\`\\$]/\\\\\\\\&/g'`\\\\\"\n\nCopyright (C) 2003 Free Software Foundation, Inc.\nThis config.status script is free software; the Free Software Foundation\ngives unlimited permission to copy, distribute and modify it.\"\nsrcdir=$srcdir\nINSTALL=\"$INSTALL\"\n_ACEOF\n\ncat >>$CONFIG_STATUS <<\\_ACEOF\n# If no file are specified by the user, then we need to provide default\n# value.  By we need to know if files were specified by the user.\nac_need_defaults=:\nwhile test $# != 0\ndo\n  case $1 in\n  --*=*)\n    ac_option=`expr \"x$1\" : 'x\\([^=]*\\)='`\n    ac_optarg=`expr \"x$1\" : 'x[^=]*=\\(.*\\)'`\n    ac_shift=:\n    ;;\n  -*)\n    ac_option=$1\n    ac_optarg=$2\n    ac_shift=shift\n    ;;\n  *) # This is not an option, so the user has probably given explicit\n     # arguments.\n     ac_option=$1\n     ac_need_defaults=false;;\n  esac\n\n  case $ac_option in\n  # Handling of the options.\n_ACEOF\ncat >>$CONFIG_STATUS <<\\_ACEOF\n  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)\n    ac_cs_recheck=: ;;\n  --version | --vers* | -V )\n    echo \"$ac_cs_version\"; exit 0 ;;\n  --he | --h)\n    # Conflict between --help and --header\n    { { echo \"$as_me:$LINENO: error: ambiguous option: $1\nTry \\`$0 --help' for more information.\" >&5\necho \"$as_me: error: ambiguous option: $1\nTry \\`$0 --help' for more information.\" >&2;}\n   { (exit 1); exit 1; }; };;\n  --help | --hel | -h )\n    echo \"$ac_cs_usage\"; exit 0 ;;\n  --debug | --d* | -d )\n    debug=: ;;\n  --file | --fil | --fi | --f )\n    $ac_shift\n    CONFIG_FILES=\"$CONFIG_FILES $ac_optarg\"\n    ac_need_defaults=false;;\n  --header | --heade | --head | --hea )\n    $ac_shift\n    CONFIG_HEADERS=\"$CONFIG_HEADERS $ac_optarg\"\n    ac_need_defaults=false;;\n  -q | -quiet | --quiet | --quie | --qui | --qu | --q \\\n  | -silent | --silent | --silen | --sile | --sil | --si | --s)\n    ac_cs_silent=: ;;\n\n  # This is an error.\n  -*) { { echo \"$as_me:$LINENO: error: unrecognized option: $1\nTry \\`$0 --help' for more information.\" >&5\necho \"$as_me: error: unrecognized option: $1\nTry \\`$0 --help' for more information.\" >&2;}\n   { (exit 1); exit 1; }; } ;;\n\n  *) ac_config_targets=\"$ac_config_targets $1\" ;;\n\n  esac\n  shift\ndone\n\nac_configure_extra_args=\n\nif $ac_cs_silent; then\n  exec 6>/dev/null\n  ac_configure_extra_args=\"$ac_configure_extra_args --silent\"\nfi\n\n_ACEOF\ncat >>$CONFIG_STATUS <<_ACEOF\nif \\$ac_cs_recheck; then\n  echo \"running $SHELL $0 \" $ac_configure_args \\$ac_configure_extra_args \" --no-create --no-recursion\" >&6\n  exec $SHELL $0 $ac_configure_args \\$ac_configure_extra_args --no-create --no-recursion\nfi\n\n_ACEOF\n\ncat >>$CONFIG_STATUS <<_ACEOF\n#\n# INIT-COMMANDS section.\n#\n\nAMDEP_TRUE=\"$AMDEP_TRUE\" ac_aux_dir=\"$ac_aux_dir\"\n\n_ACEOF\n\n\n\ncat >>$CONFIG_STATUS <<\\_ACEOF\nfor ac_config_target in $ac_config_targets\ndo\n  case \"$ac_config_target\" in\n  # Handling of arguments.\n  \"pkgscripts/libjpeg-turbo.spec.tmpl\" ) CONFIG_FILES=\"$CONFIG_FILES pkgscripts/libjpeg-turbo.spec.tmpl:release/libjpeg-turbo.spec.in\" ;;\n  \"pkgscripts/makecygwinpkg.tmpl\" ) CONFIG_FILES=\"$CONFIG_FILES pkgscripts/makecygwinpkg.tmpl:release/makecygwinpkg.in\" ;;\n  \"pkgscripts/makedpkg.tmpl\" ) CONFIG_FILES=\"$CONFIG_FILES pkgscripts/makedpkg.tmpl:release/makedpkg.in\" ;;\n  \"pkgscripts/makemacpkg.tmpl\" ) CONFIG_FILES=\"$CONFIG_FILES pkgscripts/makemacpkg.tmpl:release/makemacpkg.in\" ;;\n  \"pkgscripts/Description.plist\" ) CONFIG_FILES=\"$CONFIG_FILES pkgscripts/Description.plist:release/Description.plist.in\" ;;\n  \"pkgscripts/Info.plist\" ) CONFIG_FILES=\"$CONFIG_FILES pkgscripts/Info.plist:release/Info.plist.in\" ;;\n  \"pkgscripts/uninstall.tmpl\" ) CONFIG_FILES=\"$CONFIG_FILES pkgscripts/uninstall.tmpl:release/uninstall.in\" ;;\n  \"tjbenchtest\" ) CONFIG_FILES=\"$CONFIG_FILES tjbenchtest\" ;;\n  \"tjbenchtest.java\" ) CONFIG_FILES=\"$CONFIG_FILES tjbenchtest.java\" ;;\n  \"tjexampletest\" ) CONFIG_FILES=\"$CONFIG_FILES tjexampletest\" ;;\n  \"libjpeg.map\" ) CONFIG_FILES=\"$CONFIG_FILES libjpeg.map\" ;;\n  \"Makefile\" ) CONFIG_FILES=\"$CONFIG_FILES Makefile\" ;;\n  \"simd/Makefile\" ) CONFIG_FILES=\"$CONFIG_FILES simd/Makefile\" ;;\n  \"java/Makefile\" ) CONFIG_FILES=\"$CONFIG_FILES java/Makefile\" ;;\n  \"md5/Makefile\" ) CONFIG_FILES=\"$CONFIG_FILES md5/Makefile\" ;;\n  \"depfiles\" ) CONFIG_COMMANDS=\"$CONFIG_COMMANDS depfiles\" ;;\n  \"config.h\" ) CONFIG_HEADERS=\"$CONFIG_HEADERS config.h\" ;;\n  \"jconfig.h\" ) CONFIG_HEADERS=\"$CONFIG_HEADERS jconfig.h\" ;;\n  *) { { echo \"$as_me:$LINENO: error: invalid argument: $ac_config_target\" >&5\necho \"$as_me: error: invalid argument: $ac_config_target\" >&2;}\n   { (exit 1); exit 1; }; };;\n  esac\ndone\n\n# If the user did not use the arguments to specify the items to instantiate,\n# then the envvar interface is used.  Set only those that are not.\n# We use the long form for the default assignment because of an extremely\n# bizarre bug on SunOS 4.1.3.\nif $ac_need_defaults; then\n  test \"${CONFIG_FILES+set}\" = set || CONFIG_FILES=$config_files\n  test \"${CONFIG_HEADERS+set}\" = set || CONFIG_HEADERS=$config_headers\n  test \"${CONFIG_COMMANDS+set}\" = set || CONFIG_COMMANDS=$config_commands\nfi\n\n# Have a temporary directory for convenience.  Make it in the build tree\n# simply because there is no reason to put it here, and in addition,\n# creating and moving files from /tmp can sometimes cause problems.\n# Create a temporary directory, and hook for its removal unless debugging.\n$debug ||\n{\n  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0\n  trap '{ (exit 1); exit 1; }' 1 2 13 15\n}\n\n# Create a (secure) tmp directory for tmp files.\n\n{\n  tmp=`(umask 077 && mktemp -d -q \"./confstatXXXXXX\") 2>/dev/null` &&\n  test -n \"$tmp\" && test -d \"$tmp\"\n}  ||\n{\n  tmp=./confstat$$-$RANDOM\n  (umask 077 && mkdir $tmp)\n} ||\n{\n   echo \"$me: cannot create a temporary directory in .\" >&2\n   { (exit 1); exit 1; }\n}\n\n_ACEOF\n\ncat >>$CONFIG_STATUS <<_ACEOF\n\n#\n# CONFIG_FILES section.\n#\n\n# No need to generate the scripts if there are no CONFIG_FILES.\n# This happens for instance when ./config.status config.h\nif test -n \"\\$CONFIG_FILES\"; then\n  # Protect against being on the right side of a sed subst in config.status.\n  sed 's/,@/@@/; s/@,/@@/; s/,;t t\\$/@;t t/; /@;t t\\$/s/[\\\\\\\\&,]/\\\\\\\\&/g;\n   s/@@/,@/; s/@@/@,/; s/@;t t\\$/,;t t/' >\\$tmp/subs.sed <<\\\\CEOF\ns,@SHELL@,$SHELL,;t t\ns,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t\ns,@PACKAGE_NAME@,$PACKAGE_NAME,;t t\ns,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t\ns,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t\ns,@PACKAGE_STRING@,$PACKAGE_STRING,;t t\ns,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t\ns,@exec_prefix@,$exec_prefix,;t t\ns,@prefix@,$prefix,;t t\ns,@program_transform_name@,$program_transform_name,;t t\ns,@bindir@,$bindir,;t t\ns,@sbindir@,$sbindir,;t t\ns,@libexecdir@,$libexecdir,;t t\ns,@datadir@,$datadir,;t t\ns,@sysconfdir@,$sysconfdir,;t t\ns,@sharedstatedir@,$sharedstatedir,;t t\ns,@localstatedir@,$localstatedir,;t t\ns,@libdir@,$libdir,;t t\ns,@includedir@,$includedir,;t t\ns,@oldincludedir@,$oldincludedir,;t t\ns,@infodir@,$infodir,;t t\ns,@mandir@,$mandir,;t t\ns,@build_alias@,$build_alias,;t t\ns,@host_alias@,$host_alias,;t t\ns,@target_alias@,$target_alias,;t t\ns,@DEFS@,$DEFS,;t t\ns,@ECHO_C@,$ECHO_C,;t t\ns,@ECHO_N@,$ECHO_N,;t t\ns,@ECHO_T@,$ECHO_T,;t t\ns,@LIBS@,$LIBS,;t t\ns,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t\ns,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t\ns,@INSTALL_DATA@,$INSTALL_DATA,;t t\ns,@CYGPATH_W@,$CYGPATH_W,;t t\ns,@PACKAGE@,$PACKAGE,;t t\ns,@VERSION@,$VERSION,;t t\ns,@ACLOCAL@,$ACLOCAL,;t t\ns,@AUTOCONF@,$AUTOCONF,;t t\ns,@AUTOMAKE@,$AUTOMAKE,;t t\ns,@AUTOHEADER@,$AUTOHEADER,;t t\ns,@MAKEINFO@,$MAKEINFO,;t t\ns,@install_sh@,$install_sh,;t t\ns,@STRIP@,$STRIP,;t t\ns,@ac_ct_STRIP@,$ac_ct_STRIP,;t t\ns,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t\ns,@mkdir_p@,$mkdir_p,;t t\ns,@AWK@,$AWK,;t t\ns,@SET_MAKE@,$SET_MAKE,;t t\ns,@am__leading_dot@,$am__leading_dot,;t t\ns,@AMTAR@,$AMTAR,;t t\ns,@am__tar@,$am__tar,;t t\ns,@am__untar@,$am__untar,;t t\ns,@CC@,$CC,;t t\ns,@CFLAGS@,$CFLAGS,;t t\ns,@LDFLAGS@,$LDFLAGS,;t t\ns,@CPPFLAGS@,$CPPFLAGS,;t t\ns,@ac_ct_CC@,$ac_ct_CC,;t t\ns,@EXEEXT@,$EXEEXT,;t t\ns,@OBJEXT@,$OBJEXT,;t t\ns,@DEPDIR@,$DEPDIR,;t t\ns,@am__include@,$am__include,;t t\ns,@am__quote@,$am__quote,;t t\ns,@AMDEP_TRUE@,$AMDEP_TRUE,;t t\ns,@AMDEP_FALSE@,$AMDEP_FALSE,;t t\ns,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t\ns,@CCDEPMODE@,$CCDEPMODE,;t t\ns,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t\ns,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t\ns,@CPP@,$CPP,;t t\ns,@CCAS@,$CCAS,;t t\ns,@CCASFLAGS@,$CCASFLAGS,;t t\ns,@build@,$build,;t t\ns,@build_cpu@,$build_cpu,;t t\ns,@build_vendor@,$build_vendor,;t t\ns,@build_os@,$build_os,;t t\ns,@host@,$host,;t t\ns,@host_cpu@,$host_cpu,;t t\ns,@host_vendor@,$host_vendor,;t t\ns,@host_os@,$host_os,;t t\ns,@EGREP@,$EGREP,;t t\ns,@LN_S@,$LN_S,;t t\ns,@ECHO@,$ECHO,;t t\ns,@AR@,$AR,;t t\ns,@ac_ct_AR@,$ac_ct_AR,;t t\ns,@RANLIB@,$RANLIB,;t t\ns,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t\ns,@CXX@,$CXX,;t t\ns,@CXXFLAGS@,$CXXFLAGS,;t t\ns,@ac_ct_CXX@,$ac_ct_CXX,;t t\ns,@CXXDEPMODE@,$CXXDEPMODE,;t t\ns,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t\ns,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t\ns,@CXXCPP@,$CXXCPP,;t t\ns,@F77@,$F77,;t t\ns,@FFLAGS@,$FFLAGS,;t t\ns,@ac_ct_F77@,$ac_ct_F77,;t t\ns,@LIBTOOL@,$LIBTOOL,;t t\ns,@JPEG_LIB_VERSION@,$JPEG_LIB_VERSION,;t t\ns,@JPEG_LIB_VERSION_DECIMAL@,$JPEG_LIB_VERSION_DECIMAL,;t t\ns,@SO_MAJOR_VERSION@,$SO_MAJOR_VERSION,;t t\ns,@SO_MINOR_VERSION@,$SO_MINOR_VERSION,;t t\ns,@LIBTOOL_CURRENT@,$LIBTOOL_CURRENT,;t t\ns,@SO_AGE@,$SO_AGE,;t t\ns,@MEM_SRCDST_FUNCTIONS@,$MEM_SRCDST_FUNCTIONS,;t t\ns,@VERSION_SCRIPT_TRUE@,$VERSION_SCRIPT_TRUE,;t t\ns,@VERSION_SCRIPT_FALSE@,$VERSION_SCRIPT_FALSE,;t t\ns,@VERSION_SCRIPT_FLAG@,$VERSION_SCRIPT_FLAG,;t t\ns,@WITH_ARITH_ENC_TRUE@,$WITH_ARITH_ENC_TRUE,;t t\ns,@WITH_ARITH_ENC_FALSE@,$WITH_ARITH_ENC_FALSE,;t t\ns,@WITH_ARITH_DEC_TRUE@,$WITH_ARITH_DEC_TRUE,;t t\ns,@WITH_ARITH_DEC_FALSE@,$WITH_ARITH_DEC_FALSE,;t t\ns,@WITH_ARITH_TRUE@,$WITH_ARITH_TRUE,;t t\ns,@WITH_ARITH_FALSE@,$WITH_ARITH_FALSE,;t t\ns,@JAVAC@,$JAVAC,;t t\ns,@JAVACFLAGS@,$JAVACFLAGS,;t t\ns,@JAR@,$JAR,;t t\ns,@JAVA@,$JAVA,;t t\ns,@JNI_CFLAGS@,$JNI_CFLAGS,;t t\ns,@WITH_JAVA_TRUE@,$WITH_JAVA_TRUE,;t t\ns,@WITH_JAVA_FALSE@,$WITH_JAVA_FALSE,;t t\ns,@WITH_JAVA@,$WITH_JAVA,;t t\ns,@JAVA_RPM_CONTENTS_1@,$JAVA_RPM_CONTENTS_1,;t t\ns,@JAVA_RPM_CONTENTS_2@,$JAVA_RPM_CONTENTS_2,;t t\ns,@NASM@,$NASM,;t t\ns,@NAFLAGS@,$NAFLAGS,;t t\ns,@WITH_SIMD_TRUE@,$WITH_SIMD_TRUE,;t t\ns,@WITH_SIMD_FALSE@,$WITH_SIMD_FALSE,;t t\ns,@WITH_SSE_FLOAT_DCT_TRUE@,$WITH_SSE_FLOAT_DCT_TRUE,;t t\ns,@WITH_SSE_FLOAT_DCT_FALSE@,$WITH_SSE_FLOAT_DCT_FALSE,;t t\ns,@SIMD_I386_TRUE@,$SIMD_I386_TRUE,;t t\ns,@SIMD_I386_FALSE@,$SIMD_I386_FALSE,;t t\ns,@SIMD_X86_64_TRUE@,$SIMD_X86_64_TRUE,;t t\ns,@SIMD_X86_64_FALSE@,$SIMD_X86_64_FALSE,;t t\ns,@SIMD_ARM_TRUE@,$SIMD_ARM_TRUE,;t t\ns,@SIMD_ARM_FALSE@,$SIMD_ARM_FALSE,;t t\ns,@X86_64_TRUE@,$X86_64_TRUE,;t t\ns,@X86_64_FALSE@,$X86_64_FALSE,;t t\ns,@WITH_TURBOJPEG_TRUE@,$WITH_TURBOJPEG_TRUE,;t t\ns,@WITH_TURBOJPEG_FALSE@,$WITH_TURBOJPEG_FALSE,;t t\ns,@PKGNAME@,$PKGNAME,;t t\ns,@RPMARCH@,$RPMARCH,;t t\ns,@RPM_CONFIG_ARGS@,$RPM_CONFIG_ARGS,;t t\ns,@DEBARCH@,$DEBARCH,;t t\ns,@BUILD@,$BUILD,;t t\ns,@LIBOBJS@,$LIBOBJS,;t t\ns,@LTLIBOBJS@,$LTLIBOBJS,;t t\nCEOF\n\n_ACEOF\n\n  cat >>$CONFIG_STATUS <<\\_ACEOF\n  # Split the substitutions into bite-sized pieces for seds with\n  # small command number limits, like on Digital OSF/1 and HP-UX.\n  ac_max_sed_lines=48\n  ac_sed_frag=1 # Number of current file.\n  ac_beg=1 # First line for current file.\n  ac_end=$ac_max_sed_lines # Line after last line for current file.\n  ac_more_lines=:\n  ac_sed_cmds=\n  while $ac_more_lines; do\n    if test $ac_beg -gt 1; then\n      sed \"1,${ac_beg}d; ${ac_end}q\" $tmp/subs.sed >$tmp/subs.frag\n    else\n      sed \"${ac_end}q\" $tmp/subs.sed >$tmp/subs.frag\n    fi\n    if test ! -s $tmp/subs.frag; then\n      ac_more_lines=false\n    else\n      # The purpose of the label and of the branching condition is to\n      # speed up the sed processing (if there are no `@' at all, there\n      # is no need to browse any of the substitutions).\n      # These are the two extra sed commands mentioned above.\n      (echo ':t\n  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed\n      if test -z \"$ac_sed_cmds\"; then\n\tac_sed_cmds=\"sed -f $tmp/subs-$ac_sed_frag.sed\"\n      else\n\tac_sed_cmds=\"$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed\"\n      fi\n      ac_sed_frag=`expr $ac_sed_frag + 1`\n      ac_beg=$ac_end\n      ac_end=`expr $ac_end + $ac_max_sed_lines`\n    fi\n  done\n  if test -z \"$ac_sed_cmds\"; then\n    ac_sed_cmds=cat\n  fi\nfi # test -n \"$CONFIG_FILES\"\n\n_ACEOF\ncat >>$CONFIG_STATUS <<\\_ACEOF\nfor ac_file in : $CONFIG_FILES; do test \"x$ac_file\" = x: && continue\n  # Support \"outfile[:infile[:infile...]]\", defaulting infile=\"outfile.in\".\n  case $ac_file in\n  - | *:- | *:-:* ) # input from stdin\n\tcat >$tmp/stdin\n\tac_file_in=`echo \"$ac_file\" | sed 's,[^:]*:,,'`\n\tac_file=`echo \"$ac_file\" | sed 's,:.*,,'` ;;\n  *:* ) ac_file_in=`echo \"$ac_file\" | sed 's,[^:]*:,,'`\n\tac_file=`echo \"$ac_file\" | sed 's,:.*,,'` ;;\n  * )   ac_file_in=$ac_file.in ;;\n  esac\n\n  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.\n  ac_dir=`(dirname \"$ac_file\") 2>/dev/null ||\n$as_expr X\"$ac_file\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$ac_file\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$ac_file\" : 'X\\(//\\)$' \\| \\\n\t X\"$ac_file\" : 'X\\(/\\)' \\| \\\n\t .     : '\\(.\\)' 2>/dev/null ||\necho X\"$ac_file\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\/\\)[^/].*/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\/\\)$/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\).*/{ s//\\1/; q; }\n  \t  s/.*/./; q'`\n  { if $as_mkdir_p; then\n    mkdir -p \"$ac_dir\"\n  else\n    as_dir=\"$ac_dir\"\n    as_dirs=\n    while test ! -d \"$as_dir\"; do\n      as_dirs=\"$as_dir $as_dirs\"\n      as_dir=`(dirname \"$as_dir\") 2>/dev/null ||\n$as_expr X\"$as_dir\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)$' \\| \\\n\t X\"$as_dir\" : 'X\\(/\\)' \\| \\\n\t .     : '\\(.\\)' 2>/dev/null ||\necho X\"$as_dir\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\/\\)[^/].*/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\/\\)$/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\).*/{ s//\\1/; q; }\n  \t  s/.*/./; q'`\n    done\n    test ! -n \"$as_dirs\" || mkdir $as_dirs\n  fi || { { echo \"$as_me:$LINENO: error: cannot create directory \\\"$ac_dir\\\"\" >&5\necho \"$as_me: error: cannot create directory \\\"$ac_dir\\\"\" >&2;}\n   { (exit 1); exit 1; }; }; }\n\n  ac_builddir=.\n\nif test \"$ac_dir\" != .; then\n  ac_dir_suffix=/`echo \"$ac_dir\" | sed 's,^\\.[\\\\/],,'`\n  # A \"../\" for each directory in $ac_dir_suffix.\n  ac_top_builddir=`echo \"$ac_dir_suffix\" | sed 's,/[^\\\\/]*,../,g'`\nelse\n  ac_dir_suffix= ac_top_builddir=\nfi\n\ncase $srcdir in\n  .)  # No --srcdir option.  We are building in place.\n    ac_srcdir=.\n    if test -z \"$ac_top_builddir\"; then\n       ac_top_srcdir=.\n    else\n       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`\n    fi ;;\n  [\\\\/]* | ?:[\\\\/]* )  # Absolute path.\n    ac_srcdir=$srcdir$ac_dir_suffix;\n    ac_top_srcdir=$srcdir ;;\n  *) # Relative path.\n    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix\n    ac_top_srcdir=$ac_top_builddir$srcdir ;;\nesac\n\n# Do not use `cd foo && pwd` to compute absolute paths, because\n# the directories may not exist.\ncase `pwd` in\n.) ac_abs_builddir=\"$ac_dir\";;\n*)\n  case \"$ac_dir\" in\n  .) ac_abs_builddir=`pwd`;;\n  [\\\\/]* | ?:[\\\\/]* ) ac_abs_builddir=\"$ac_dir\";;\n  *) ac_abs_builddir=`pwd`/\"$ac_dir\";;\n  esac;;\nesac\ncase $ac_abs_builddir in\n.) ac_abs_top_builddir=${ac_top_builddir}.;;\n*)\n  case ${ac_top_builddir}. in\n  .) ac_abs_top_builddir=$ac_abs_builddir;;\n  [\\\\/]* | ?:[\\\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;\n  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;\n  esac;;\nesac\ncase $ac_abs_builddir in\n.) ac_abs_srcdir=$ac_srcdir;;\n*)\n  case $ac_srcdir in\n  .) ac_abs_srcdir=$ac_abs_builddir;;\n  [\\\\/]* | ?:[\\\\/]* ) ac_abs_srcdir=$ac_srcdir;;\n  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;\n  esac;;\nesac\ncase $ac_abs_builddir in\n.) ac_abs_top_srcdir=$ac_top_srcdir;;\n*)\n  case $ac_top_srcdir in\n  .) ac_abs_top_srcdir=$ac_abs_builddir;;\n  [\\\\/]* | ?:[\\\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;\n  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;\n  esac;;\nesac\n\n\n  case $INSTALL in\n  [\\\\/$]* | ?:[\\\\/]* ) ac_INSTALL=$INSTALL ;;\n  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;\n  esac\n\n  if test x\"$ac_file\" != x-; then\n    { echo \"$as_me:$LINENO: creating $ac_file\" >&5\necho \"$as_me: creating $ac_file\" >&6;}\n    rm -f \"$ac_file\"\n  fi\n  # Let's still pretend it is `configure' which instantiates (i.e., don't\n  # use $as_me), people would be surprised to read:\n  #    /* config.h.  Generated by config.status.  */\n  if test x\"$ac_file\" = x-; then\n    configure_input=\n  else\n    configure_input=\"$ac_file.  \"\n  fi\n  configure_input=$configure_input\"Generated from `echo $ac_file_in |\n\t\t\t\t     sed 's,.*/,,'` by configure.\"\n\n  # First look for the input files in the build tree, otherwise in the\n  # src tree.\n  ac_file_inputs=`IFS=:\n    for f in $ac_file_in; do\n      case $f in\n      -) echo $tmp/stdin ;;\n      [\\\\/$]*)\n\t # Absolute (can't be DOS-style, as IFS=:)\n\t test -f \"$f\" || { { echo \"$as_me:$LINENO: error: cannot find input file: $f\" >&5\necho \"$as_me: error: cannot find input file: $f\" >&2;}\n   { (exit 1); exit 1; }; }\n\t echo \"$f\";;\n      *) # Relative\n\t if test -f \"$f\"; then\n\t   # Build tree\n\t   echo \"$f\"\n\t elif test -f \"$srcdir/$f\"; then\n\t   # Source tree\n\t   echo \"$srcdir/$f\"\n\t else\n\t   # /dev/null tree\n\t   { { echo \"$as_me:$LINENO: error: cannot find input file: $f\" >&5\necho \"$as_me: error: cannot find input file: $f\" >&2;}\n   { (exit 1); exit 1; }; }\n\t fi;;\n      esac\n    done` || { (exit 1); exit 1; }\n_ACEOF\ncat >>$CONFIG_STATUS <<_ACEOF\n  sed \"$ac_vpsub\n$extrasub\n_ACEOF\ncat >>$CONFIG_STATUS <<\\_ACEOF\n:t\n/@[a-zA-Z_][a-zA-Z_0-9]*@/!b\ns,@configure_input@,$configure_input,;t t\ns,@srcdir@,$ac_srcdir,;t t\ns,@abs_srcdir@,$ac_abs_srcdir,;t t\ns,@top_srcdir@,$ac_top_srcdir,;t t\ns,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t\ns,@builddir@,$ac_builddir,;t t\ns,@abs_builddir@,$ac_abs_builddir,;t t\ns,@top_builddir@,$ac_top_builddir,;t t\ns,@abs_top_builddir@,$ac_abs_top_builddir,;t t\ns,@INSTALL@,$ac_INSTALL,;t t\n\" $ac_file_inputs | (eval \"$ac_sed_cmds\") >$tmp/out\n  rm -f $tmp/stdin\n  if test x\"$ac_file\" != x-; then\n    mv $tmp/out $ac_file\n  else\n    cat $tmp/out\n    rm -f $tmp/out\n  fi\n\ndone\n_ACEOF\ncat >>$CONFIG_STATUS <<\\_ACEOF\n\n#\n# CONFIG_HEADER section.\n#\n\n# These sed commands are passed to sed as \"A NAME B NAME C VALUE D\", where\n# NAME is the cpp macro being defined and VALUE is the value it is being given.\n#\n# ac_d sets the value in \"#define NAME VALUE\" lines.\nac_dA='s,^\\([\t ]*\\)#\\([\t ]*define[\t ][\t ]*\\)'\nac_dB='[\t ].*$,\\1#\\2'\nac_dC=' '\nac_dD=',;t'\n# ac_u turns \"#undef NAME\" without trailing blanks into \"#define NAME VALUE\".\nac_uA='s,^\\([\t ]*\\)#\\([\t ]*\\)undef\\([\t ][\t ]*\\)'\nac_uB='$,\\1#\\2define\\3'\nac_uC=' '\nac_uD=',;t'\n\nfor ac_file in : $CONFIG_HEADERS; do test \"x$ac_file\" = x: && continue\n  # Support \"outfile[:infile[:infile...]]\", defaulting infile=\"outfile.in\".\n  case $ac_file in\n  - | *:- | *:-:* ) # input from stdin\n\tcat >$tmp/stdin\n\tac_file_in=`echo \"$ac_file\" | sed 's,[^:]*:,,'`\n\tac_file=`echo \"$ac_file\" | sed 's,:.*,,'` ;;\n  *:* ) ac_file_in=`echo \"$ac_file\" | sed 's,[^:]*:,,'`\n\tac_file=`echo \"$ac_file\" | sed 's,:.*,,'` ;;\n  * )   ac_file_in=$ac_file.in ;;\n  esac\n\n  test x\"$ac_file\" != x- && { echo \"$as_me:$LINENO: creating $ac_file\" >&5\necho \"$as_me: creating $ac_file\" >&6;}\n\n  # First look for the input files in the build tree, otherwise in the\n  # src tree.\n  ac_file_inputs=`IFS=:\n    for f in $ac_file_in; do\n      case $f in\n      -) echo $tmp/stdin ;;\n      [\\\\/$]*)\n\t # Absolute (can't be DOS-style, as IFS=:)\n\t test -f \"$f\" || { { echo \"$as_me:$LINENO: error: cannot find input file: $f\" >&5\necho \"$as_me: error: cannot find input file: $f\" >&2;}\n   { (exit 1); exit 1; }; }\n\t # Do quote $f, to prevent DOS paths from being IFS'd.\n\t echo \"$f\";;\n      *) # Relative\n\t if test -f \"$f\"; then\n\t   # Build tree\n\t   echo \"$f\"\n\t elif test -f \"$srcdir/$f\"; then\n\t   # Source tree\n\t   echo \"$srcdir/$f\"\n\t else\n\t   # /dev/null tree\n\t   { { echo \"$as_me:$LINENO: error: cannot find input file: $f\" >&5\necho \"$as_me: error: cannot find input file: $f\" >&2;}\n   { (exit 1); exit 1; }; }\n\t fi;;\n      esac\n    done` || { (exit 1); exit 1; }\n  # Remove the trailing spaces.\n  sed 's/[\t ]*$//' $ac_file_inputs >$tmp/in\n\n_ACEOF\n\n# Transform confdefs.h into two sed scripts, `conftest.defines' and\n# `conftest.undefs', that substitutes the proper values into\n# config.h.in to produce config.h.  The first handles `#define'\n# templates, and the second `#undef' templates.\n# And first: Protect against being on the right side of a sed subst in\n# config.status.  Protect against being in an unquoted here document\n# in config.status.\nrm -f conftest.defines conftest.undefs\n# Using a here document instead of a string reduces the quoting nightmare.\n# Putting comments in sed scripts is not portable.\n#\n# `end' is used to avoid that the second main sed command (meant for\n# 0-ary CPP macros) applies to n-ary macro definitions.\n# See the Autoconf documentation for `clear'.\ncat >confdef2sed.sed <<\\_ACEOF\ns/[\\\\&,]/\\\\&/g\ns,[\\\\$`],\\\\&,g\nt clear\n: clear\ns,^[\t ]*#[\t ]*define[\t ][\t ]*\\([^\t (][^\t (]*\\)\\(([^)]*)\\)[\t ]*\\(.*\\)$,${ac_dA}\\1${ac_dB}\\1\\2${ac_dC}\\3${ac_dD},gp\nt end\ns,^[\t ]*#[\t ]*define[\t ][\t ]*\\([^\t ][^\t ]*\\)[\t ]*\\(.*\\)$,${ac_dA}\\1${ac_dB}\\1${ac_dC}\\2${ac_dD},gp\n: end\n_ACEOF\n# If some macros were called several times there might be several times\n# the same #defines, which is useless.  Nevertheless, we may not want to\n# sort them, since we want the *last* AC-DEFINE to be honored.\nuniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines\nsed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs\nrm -f confdef2sed.sed\n\n# This sed command replaces #undef with comments.  This is necessary, for\n# example, in the case of _POSIX_SOURCE, which is predefined and required\n# on some systems where configure will not decide to define it.\ncat >>conftest.undefs <<\\_ACEOF\ns,^[\t ]*#[\t ]*undef[\t ][\t ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,\n_ACEOF\n\n# Break up conftest.defines because some shells have a limit on the size\n# of here documents, and old seds have small limits too (100 cmds).\necho '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS\necho '  if grep \"^[\t ]*#[\t ]*define\" $tmp/in >/dev/null; then' >>$CONFIG_STATUS\necho '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS\necho '  :' >>$CONFIG_STATUS\nrm -f conftest.tail\nwhile grep . conftest.defines >/dev/null\ndo\n  # Write a limited-size here document to $tmp/defines.sed.\n  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS\n  # Speed up: don't consider the non `#define' lines.\n  echo '/^[\t ]*#[\t ]*define/!b' >>$CONFIG_STATUS\n  # Work around the forget-to-reset-the-flag bug.\n  echo 't clr' >>$CONFIG_STATUS\n  echo ': clr' >>$CONFIG_STATUS\n  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS\n  echo 'CEOF\n  sed -f $tmp/defines.sed $tmp/in >$tmp/out\n  rm -f $tmp/in\n  mv $tmp/out $tmp/in\n' >>$CONFIG_STATUS\n  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail\n  rm -f conftest.defines\n  mv conftest.tail conftest.defines\ndone\nrm -f conftest.defines\necho '  fi # grep' >>$CONFIG_STATUS\necho >>$CONFIG_STATUS\n\n# Break up conftest.undefs because some shells have a limit on the size\n# of here documents, and old seds have small limits too (100 cmds).\necho '  # Handle all the #undef templates' >>$CONFIG_STATUS\nrm -f conftest.tail\nwhile grep . conftest.undefs >/dev/null\ndo\n  # Write a limited-size here document to $tmp/undefs.sed.\n  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS\n  # Speed up: don't consider the non `#undef'\n  echo '/^[\t ]*#[\t ]*undef/!b' >>$CONFIG_STATUS\n  # Work around the forget-to-reset-the-flag bug.\n  echo 't clr' >>$CONFIG_STATUS\n  echo ': clr' >>$CONFIG_STATUS\n  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS\n  echo 'CEOF\n  sed -f $tmp/undefs.sed $tmp/in >$tmp/out\n  rm -f $tmp/in\n  mv $tmp/out $tmp/in\n' >>$CONFIG_STATUS\n  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail\n  rm -f conftest.undefs\n  mv conftest.tail conftest.undefs\ndone\nrm -f conftest.undefs\n\ncat >>$CONFIG_STATUS <<\\_ACEOF\n  # Let's still pretend it is `configure' which instantiates (i.e., don't\n  # use $as_me), people would be surprised to read:\n  #    /* config.h.  Generated by config.status.  */\n  if test x\"$ac_file\" = x-; then\n    echo \"/* Generated by configure.  */\" >$tmp/config.h\n  else\n    echo \"/* $ac_file.  Generated by configure.  */\" >$tmp/config.h\n  fi\n  cat $tmp/in >>$tmp/config.h\n  rm -f $tmp/in\n  if test x\"$ac_file\" != x-; then\n    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then\n      { echo \"$as_me:$LINENO: $ac_file is unchanged\" >&5\necho \"$as_me: $ac_file is unchanged\" >&6;}\n    else\n      ac_dir=`(dirname \"$ac_file\") 2>/dev/null ||\n$as_expr X\"$ac_file\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$ac_file\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$ac_file\" : 'X\\(//\\)$' \\| \\\n\t X\"$ac_file\" : 'X\\(/\\)' \\| \\\n\t .     : '\\(.\\)' 2>/dev/null ||\necho X\"$ac_file\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\/\\)[^/].*/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\/\\)$/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\).*/{ s//\\1/; q; }\n  \t  s/.*/./; q'`\n      { if $as_mkdir_p; then\n    mkdir -p \"$ac_dir\"\n  else\n    as_dir=\"$ac_dir\"\n    as_dirs=\n    while test ! -d \"$as_dir\"; do\n      as_dirs=\"$as_dir $as_dirs\"\n      as_dir=`(dirname \"$as_dir\") 2>/dev/null ||\n$as_expr X\"$as_dir\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)$' \\| \\\n\t X\"$as_dir\" : 'X\\(/\\)' \\| \\\n\t .     : '\\(.\\)' 2>/dev/null ||\necho X\"$as_dir\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\/\\)[^/].*/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\/\\)$/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\).*/{ s//\\1/; q; }\n  \t  s/.*/./; q'`\n    done\n    test ! -n \"$as_dirs\" || mkdir $as_dirs\n  fi || { { echo \"$as_me:$LINENO: error: cannot create directory \\\"$ac_dir\\\"\" >&5\necho \"$as_me: error: cannot create directory \\\"$ac_dir\\\"\" >&2;}\n   { (exit 1); exit 1; }; }; }\n\n      rm -f $ac_file\n      mv $tmp/config.h $ac_file\n    fi\n  else\n    cat $tmp/config.h\n    rm -f $tmp/config.h\n  fi\n# Compute $ac_file's index in $config_headers.\n_am_stamp_count=1\nfor _am_header in $config_headers :; do\n  case $_am_header in\n    $ac_file | $ac_file:* )\n      break ;;\n    * )\n      _am_stamp_count=`expr $_am_stamp_count + 1` ;;\n  esac\ndone\necho \"timestamp for $ac_file\" >`(dirname $ac_file) 2>/dev/null ||\n$as_expr X$ac_file : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X$ac_file : 'X\\(//\\)[^/]' \\| \\\n\t X$ac_file : 'X\\(//\\)$' \\| \\\n\t X$ac_file : 'X\\(/\\)' \\| \\\n\t .     : '\\(.\\)' 2>/dev/null ||\necho X$ac_file |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\/\\)[^/].*/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\/\\)$/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\).*/{ s//\\1/; q; }\n  \t  s/.*/./; q'`/stamp-h$_am_stamp_count\ndone\n_ACEOF\ncat >>$CONFIG_STATUS <<\\_ACEOF\n\n#\n# CONFIG_COMMANDS section.\n#\nfor ac_file in : $CONFIG_COMMANDS; do test \"x$ac_file\" = x: && continue\n  ac_dest=`echo \"$ac_file\" | sed 's,:.*,,'`\n  ac_source=`echo \"$ac_file\" | sed 's,[^:]*:,,'`\n  ac_dir=`(dirname \"$ac_dest\") 2>/dev/null ||\n$as_expr X\"$ac_dest\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$ac_dest\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$ac_dest\" : 'X\\(//\\)$' \\| \\\n\t X\"$ac_dest\" : 'X\\(/\\)' \\| \\\n\t .     : '\\(.\\)' 2>/dev/null ||\necho X\"$ac_dest\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\/\\)[^/].*/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\/\\)$/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\).*/{ s//\\1/; q; }\n  \t  s/.*/./; q'`\n  { if $as_mkdir_p; then\n    mkdir -p \"$ac_dir\"\n  else\n    as_dir=\"$ac_dir\"\n    as_dirs=\n    while test ! -d \"$as_dir\"; do\n      as_dirs=\"$as_dir $as_dirs\"\n      as_dir=`(dirname \"$as_dir\") 2>/dev/null ||\n$as_expr X\"$as_dir\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)$' \\| \\\n\t X\"$as_dir\" : 'X\\(/\\)' \\| \\\n\t .     : '\\(.\\)' 2>/dev/null ||\necho X\"$as_dir\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\/\\)[^/].*/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\/\\)$/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\).*/{ s//\\1/; q; }\n  \t  s/.*/./; q'`\n    done\n    test ! -n \"$as_dirs\" || mkdir $as_dirs\n  fi || { { echo \"$as_me:$LINENO: error: cannot create directory \\\"$ac_dir\\\"\" >&5\necho \"$as_me: error: cannot create directory \\\"$ac_dir\\\"\" >&2;}\n   { (exit 1); exit 1; }; }; }\n\n  ac_builddir=.\n\nif test \"$ac_dir\" != .; then\n  ac_dir_suffix=/`echo \"$ac_dir\" | sed 's,^\\.[\\\\/],,'`\n  # A \"../\" for each directory in $ac_dir_suffix.\n  ac_top_builddir=`echo \"$ac_dir_suffix\" | sed 's,/[^\\\\/]*,../,g'`\nelse\n  ac_dir_suffix= ac_top_builddir=\nfi\n\ncase $srcdir in\n  .)  # No --srcdir option.  We are building in place.\n    ac_srcdir=.\n    if test -z \"$ac_top_builddir\"; then\n       ac_top_srcdir=.\n    else\n       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`\n    fi ;;\n  [\\\\/]* | ?:[\\\\/]* )  # Absolute path.\n    ac_srcdir=$srcdir$ac_dir_suffix;\n    ac_top_srcdir=$srcdir ;;\n  *) # Relative path.\n    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix\n    ac_top_srcdir=$ac_top_builddir$srcdir ;;\nesac\n\n# Do not use `cd foo && pwd` to compute absolute paths, because\n# the directories may not exist.\ncase `pwd` in\n.) ac_abs_builddir=\"$ac_dir\";;\n*)\n  case \"$ac_dir\" in\n  .) ac_abs_builddir=`pwd`;;\n  [\\\\/]* | ?:[\\\\/]* ) ac_abs_builddir=\"$ac_dir\";;\n  *) ac_abs_builddir=`pwd`/\"$ac_dir\";;\n  esac;;\nesac\ncase $ac_abs_builddir in\n.) ac_abs_top_builddir=${ac_top_builddir}.;;\n*)\n  case ${ac_top_builddir}. in\n  .) ac_abs_top_builddir=$ac_abs_builddir;;\n  [\\\\/]* | ?:[\\\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;\n  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;\n  esac;;\nesac\ncase $ac_abs_builddir in\n.) ac_abs_srcdir=$ac_srcdir;;\n*)\n  case $ac_srcdir in\n  .) ac_abs_srcdir=$ac_abs_builddir;;\n  [\\\\/]* | ?:[\\\\/]* ) ac_abs_srcdir=$ac_srcdir;;\n  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;\n  esac;;\nesac\ncase $ac_abs_builddir in\n.) ac_abs_top_srcdir=$ac_top_srcdir;;\n*)\n  case $ac_top_srcdir in\n  .) ac_abs_top_srcdir=$ac_abs_builddir;;\n  [\\\\/]* | ?:[\\\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;\n  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;\n  esac;;\nesac\n\n\n  { echo \"$as_me:$LINENO: executing $ac_dest commands\" >&5\necho \"$as_me: executing $ac_dest commands\" >&6;}\n  case $ac_dest in\n    depfiles ) test x\"$AMDEP_TRUE\" != x\"\" || for mf in $CONFIG_FILES; do\n  # Strip MF so we end up with the name of the file.\n  mf=`echo \"$mf\" | sed -e 's/:.*$//'`\n  # Check whether this is an Automake generated Makefile or not.\n  # We used to match only the files named `Makefile.in', but\n  # some people rename them; so instead we look at the file content.\n  # Grep'ing the first line is not enough: some people post-process\n  # each Makefile.in and add a new line on top of each file to say so.\n  # So let's grep whole file.\n  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then\n    dirpart=`(dirname \"$mf\") 2>/dev/null ||\n$as_expr X\"$mf\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$mf\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$mf\" : 'X\\(//\\)$' \\| \\\n\t X\"$mf\" : 'X\\(/\\)' \\| \\\n\t .     : '\\(.\\)' 2>/dev/null ||\necho X\"$mf\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\/\\)[^/].*/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\/\\)$/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\).*/{ s//\\1/; q; }\n  \t  s/.*/./; q'`\n  else\n    continue\n  fi\n  # Extract the definition of DEPDIR, am__include, and am__quote\n  # from the Makefile without running `make'.\n  DEPDIR=`sed -n 's/^DEPDIR = //p' < \"$mf\"`\n  test -z \"$DEPDIR\" && continue\n  am__include=`sed -n 's/^am__include = //p' < \"$mf\"`\n  test -z \"am__include\" && continue\n  am__quote=`sed -n 's/^am__quote = //p' < \"$mf\"`\n  # When using ansi2knr, U may be empty or an underscore; expand it\n  U=`sed -n 's/^U = //p' < \"$mf\"`\n  # Find all dependency output files, they are included files with\n  # $(DEPDIR) in their names.  We invoke sed twice because it is the\n  # simplest approach to changing $(DEPDIR) to its actual value in the\n  # expansion.\n  for file in `sed -n \"\n    s/^$am__include $am__quote\\(.*(DEPDIR).*\\)$am__quote\"'$/\\1/p' <\"$mf\" | \\\n       sed -e 's/\\$(DEPDIR)/'\"$DEPDIR\"'/g' -e 's/\\$U/'\"$U\"'/g'`; do\n    # Make sure the directory exists.\n    test -f \"$dirpart/$file\" && continue\n    fdir=`(dirname \"$file\") 2>/dev/null ||\n$as_expr X\"$file\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$file\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$file\" : 'X\\(//\\)$' \\| \\\n\t X\"$file\" : 'X\\(/\\)' \\| \\\n\t .     : '\\(.\\)' 2>/dev/null ||\necho X\"$file\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\/\\)[^/].*/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\/\\)$/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\).*/{ s//\\1/; q; }\n  \t  s/.*/./; q'`\n    { if $as_mkdir_p; then\n    mkdir -p $dirpart/$fdir\n  else\n    as_dir=$dirpart/$fdir\n    as_dirs=\n    while test ! -d \"$as_dir\"; do\n      as_dirs=\"$as_dir $as_dirs\"\n      as_dir=`(dirname \"$as_dir\") 2>/dev/null ||\n$as_expr X\"$as_dir\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)$' \\| \\\n\t X\"$as_dir\" : 'X\\(/\\)' \\| \\\n\t .     : '\\(.\\)' 2>/dev/null ||\necho X\"$as_dir\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\/\\)[^/].*/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\/\\)$/{ s//\\1/; q; }\n  \t  /^X\\(\\/\\).*/{ s//\\1/; q; }\n  \t  s/.*/./; q'`\n    done\n    test ! -n \"$as_dirs\" || mkdir $as_dirs\n  fi || { { echo \"$as_me:$LINENO: error: cannot create directory $dirpart/$fdir\" >&5\necho \"$as_me: error: cannot create directory $dirpart/$fdir\" >&2;}\n   { (exit 1); exit 1; }; }; }\n\n    # echo \"creating $dirpart/$file\"\n    echo '# dummy' > \"$dirpart/$file\"\n  done\ndone\n ;;\n  esac\ndone\n_ACEOF\n\ncat >>$CONFIG_STATUS <<\\_ACEOF\n\n{ (exit 0); exit 0; }\n_ACEOF\nchmod +x $CONFIG_STATUS\nac_clean_files=$ac_clean_files_save\n\n\n# configure is writing to config.log, and then calls config.status.\n# config.status does its own redirection, appending to config.log.\n# Unfortunately, on DOS this fails, as config.log is still kept open\n# by configure, so config.status won't be able to write to it; its\n# output is simply discarded.  So we exec the FD to /dev/null,\n# effectively closing config.log, so it can be properly (re)opened and\n# appended to by config.status.  When coming back to configure, we\n# need to make the FD available again.\nif test \"$no_create\" != yes; then\n  ac_cs_success=:\n  ac_config_status_args=\n  test \"$silent\" = yes &&\n    ac_config_status_args=\"$ac_config_status_args --quiet\"\n  exec 5>/dev/null\n  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false\n  exec 5>>config.log\n  # Use ||, not &&, to avoid exiting from the if with $? = 1, which\n  # would make configure fail if this is the last instruction.\n  $ac_cs_success || { (exit 1); exit 1; }\nfi\n\n"
  },
  {
    "path": "ext/libjpeg-turbo/configure.ac",
    "content": "#                                               -*- Autoconf -*-\n# Process this file with autoconf to produce a configure script.\n\nAC_PREREQ([2.56])\nAC_INIT([libjpeg-turbo], [1.3.1])\nBUILD=`date +%Y%m%d`\n\nAM_INIT_AUTOMAKE([-Wall foreign dist-bzip2])\nAC_PREFIX_DEFAULT(/opt/libjpeg-turbo)\n\n# Always build with prototypes\nAC_DEFINE([HAVE_PROTOTYPES], 1, [Define if your compiler supports prototypes])\n\nm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])\n\n# Checks for programs.\nSAVED_CFLAGS=${CFLAGS}\nSAVED_CPPFLAGS=${CPPFLAGS}\nAC_PROG_CPP\nAC_PROG_CC\nm4_ifdef([AM_PROG_AR], [AM_PROG_AR])\nAM_PROG_AS\nAM_PROG_CC_C_O\nAC_PROG_INSTALL\nAC_PROG_LIBTOOL\nAC_PROG_LN_S\n\n# When the prefix is /opt/libjpeg-turbo, we assume that an \"official\" binary is\n# being created, and thus we install things into specific locations.\n\nold_prefix=${prefix}\nif test \"x$prefix\" = \"xNONE\" -a \"x$ac_default_prefix\" != \"x\"; then\n  prefix=$ac_default_prefix\nfi\nDATADIR=`eval echo ${datadir}`\nDATADIR=`eval echo $DATADIR`\nif test \"$DATADIR\" = \"/opt/libjpeg-turbo/share\"; then\n  datadir='${prefix}'\nfi\nDATADIR=`eval echo ${datarootdir}`\nDATADIR=`eval echo $DATADIR`\nif test \"$DATADIR\" = \"/opt/libjpeg-turbo/share\"; then\n  datarootdir='${prefix}'\nfi\n\nold_exec_prefix=${exec_prefix}\nif test \"x$exec_prefix\" = \"xNONE\"; then\n  exec_prefix=${prefix}\nfi\n\nif test \"x${libdir}\" = 'x${exec_prefix}/lib' -o \"x${libdir}\" = 'x${prefix}/lib'; then\n  LIBDIR=`eval echo ${libdir}`\n  LIBDIR=`eval echo $LIBDIR`\n  if test \"$LIBDIR\" = \"/opt/libjpeg-turbo/lib\"; then\n    case $host_os in\n      darwin*)\n        ;;\n      *)\n        AC_CHECK_SIZEOF(long)\n        if test \"${ac_cv_sizeof_long}\" = \"8\"; then\n          libdir='${exec_prefix}/lib64'\n        elif test \"${ac_cv_sizeof_long}\" = \"4\"; then\n          libdir='${exec_prefix}/lib32'\n        fi\n        ;;\n    esac\n  fi\nfi\nexec_prefix=${old_exec_prefix}\nprefix=${old_prefix}\n\n# Check whether compiler supports pointers to undefined structures\nAC_MSG_CHECKING(whether compiler supports pointers to undefined structures)\nAC_TRY_COMPILE([ typedef struct undefined_structure * undef_struct_ptr; ], ,\n  AC_MSG_RESULT(yes),\n  [AC_MSG_RESULT(no)\n   AC_DEFINE([INCOMPLETE_TYPES_BROKEN], [1],\n     [Compiler does not support pointers to undefined structures.])])\n\nif test \"x${GCC}\" = \"xyes\"; then\n  if test \"x${SAVED_CFLAGS}\" = \"x\"; then\n    CFLAGS=-O3\n  fi\n  if test \"x${SAVED_CPPFLAGS}\" = \"x\"; then\n    CPPFLAGS=-Wall\n  fi\nfi\n\nAC_CHECK_DECL([__SUNPRO_C], [SUNCC=\"yes\"], [SUNCC=\"no\"])\nif test \"x${SUNCC}\" = \"xyes\"; then\n  if test \"x${SAVED_CFLAGS}\" = \"x\"; then\n    CFLAGS=-xO5\n  fi\nfi\n\n# Checks for libraries.\n\n# Checks for header files.\nAC_HEADER_STDC\nAC_CHECK_HEADERS([stddef.h stdlib.h string.h])\nAC_CHECK_HEADER([sys/types.h],\n  AC_DEFINE([NEED_SYS_TYPES_H], 1, [Define if you have sys/types.h]))\n\n# Checks for typedefs, structures, and compiler characteristics.\nAC_C_CONST\nAC_C_CHAR_UNSIGNED\nAC_C_INLINE\nAC_TYPE_SIZE_T\nAC_CHECK_TYPES([unsigned char, unsigned short])\n\nAC_MSG_CHECKING([if right shift is signed])\nAC_TRY_RUN(\n  [#include <stdio.h>\n   int is_shifting_signed (long arg) {\n     long res = arg >> 4;\n\n     if (res == -0x7F7E80CL)\n       return 1; /* right shift is signed */\n\n     /* see if unsigned-shift hack will fix it. */\n     /* we can't just test exact value since it depends on width of long... */\n     res |= (~0L) << (32-4);\n     if (res == -0x7F7E80CL)\n       return 0; /* right shift is unsigned */\n\n     printf(\"Right shift isn't acting as I expect it to.\\n\");\n     printf(\"I fear the JPEG software will not work at all.\\n\\n\");\n     return 0; /* try it with unsigned anyway */\n   }\n   int main (void) {\n     exit(is_shifting_signed(-0x7F7E80B1L));\n   }],\n  [AC_MSG_RESULT(no)\n   AC_DEFINE([RIGHT_SHIFT_IS_UNSIGNED], 1, [Define if shift is unsigned])],\n  [AC_MSG_RESULT(yes)],\n  [AC_MSG_RESULT(Assuming that right shift is signed on target machine.)])\n\n# test whether global names are unique to at least 15 chars\nAC_MSG_CHECKING([for short external names])\nAC_TRY_LINK(\n  [int possibly_duplicate_function () { return 0; }\n   int possibly_dupli_function () { return 1; }], [ ],\n  [AC_MSG_RESULT(ok)],\n  [AC_MSG_RESULT(short)\n   AC_DEFINE([NEED_SHORT_EXTERNAL_NAMES], 1,\n     [Define if you need short function names])])\n\n# Checks for library functions.\nAC_CHECK_FUNCS([memset memcpy], [],\n  [AC_DEFINE([NEED_BSD_STRINGS], 1,\n     [Define if you have BSD-like bzero and bcopy])])\n\nAC_MSG_CHECKING([libjpeg API version])\nAC_ARG_VAR(JPEG_LIB_VERSION, [libjpeg API version (62, 70, or 80)])\nif test \"x$JPEG_LIB_VERSION\" = \"x\"; then\n  AC_ARG_WITH([jpeg7],\n    AC_HELP_STRING([--with-jpeg7],\n      [Emulate libjpeg v7 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b.)]))\n  AC_ARG_WITH([jpeg8],\n    AC_HELP_STRING([--with-jpeg8],\n      [Emulate libjpeg v8 API/ABI (this makes libjpeg-turbo backward incompatible with libjpeg v6b.)]))\n  if test \"x${with_jpeg8}\" = \"xyes\"; then\n    JPEG_LIB_VERSION=80\n  else\n    if test \"x${with_jpeg7}\" = \"xyes\"; then\n      JPEG_LIB_VERSION=70\n    else\n      JPEG_LIB_VERSION=62\n    fi\n  fi\nfi\nJPEG_LIB_VERSION_DECIMAL=`expr $JPEG_LIB_VERSION / 10`.`expr $JPEG_LIB_VERSION % 10`\nAC_SUBST(JPEG_LIB_VERSION_DECIMAL)\nAC_MSG_RESULT([$JPEG_LIB_VERSION_DECIMAL])\nAC_DEFINE_UNQUOTED(JPEG_LIB_VERSION, [$JPEG_LIB_VERSION],\n  [libjpeg API version])\n\nAC_ARG_VAR(SO_MAJOR_VERSION,\n  [Major version of the libjpeg-turbo shared library (default is determined by the API version)])\nAC_ARG_VAR(SO_MINOR_VERSION,\n  [Minor version of the libjpeg-turbo shared library (default is determined by the API version)])\nif test \"x$SO_MAJOR_VERSION\" = \"x\"; then\n  case \"$JPEG_LIB_VERSION\" in\n    62)  SO_MAJOR_VERSION=$JPEG_LIB_VERSION ;;\n    *)   SO_MAJOR_VERSION=`expr $JPEG_LIB_VERSION / 10` ;;\n  esac\nfi\nif test \"x$SO_MINOR_VERSION\" = \"x\"; then\n  case \"$JPEG_LIB_VERSION\" in\n    80)  SO_MINOR_VERSION=2 ;;\n    *)   SO_MINOR_VERSION=0 ;;\n  esac\nfi\n\nRPM_CONFIG_ARGS=\n\n# Memory source/destination managers\nSO_AGE=0\nMEM_SRCDST_FUNCTIONS=\nif test \"x${with_jpeg8}\" != \"xyes\"; then\n  AC_MSG_CHECKING([whether to include in-memory source/destination managers])\n  AC_ARG_WITH([mem-srcdst],\n    AC_HELP_STRING([--without-mem-srcdst],\n      [Do not include in-memory source/destination manager functions when emulating the libjpeg v6b or v7 API/ABI]))\n  if test \"x$with_mem_srcdst\" != \"xno\"; then\n    AC_MSG_RESULT(yes)\n    AC_DEFINE([MEM_SRCDST_SUPPORTED], [1],\n      [Support in-memory source/destination managers])\n    SO_AGE=1\n    MEM_SRCDST_FUNCTIONS=\"global:  jpeg_mem_dest;  jpeg_mem_src;\";\n  else\n    AC_MSG_RESULT(no)\n    RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --without-mem-srcdst\"\n  fi\nfi\n\nAC_MSG_CHECKING([libjpeg shared library version])\nAC_MSG_RESULT([$SO_MAJOR_VERSION.$SO_AGE.$SO_MINOR_VERSION])\nLIBTOOL_CURRENT=`expr $SO_MAJOR_VERSION + $SO_AGE`\nAC_SUBST(LIBTOOL_CURRENT)\nAC_SUBST(SO_MAJOR_VERSION)\nAC_SUBST(SO_MINOR_VERSION)\nAC_SUBST(SO_AGE)\nAC_SUBST(MEM_SRCDST_FUNCTIONS)\n\nAC_DEFINE_UNQUOTED(LIBJPEG_TURBO_VERSION, [$VERSION], [libjpeg-turbo version])\n\nVERSION_SCRIPT=yes\nAC_ARG_ENABLE([ld-version-script],\n  AS_HELP_STRING([--disable-ld-version-script],\n    [Disable linker version script for libjpeg-turbo (default is to use linker version script if the linker supports it)]),\n  [VERSION_SCRIPT=$enableval], [])\n\nAC_MSG_CHECKING([whether the linker supports version scripts])\nSAVED_LDFLAGS=\"$LDFLAGS\"\nLDFLAGS=\"$LDFLAGS -Wl,--version-script,conftest.map\"\ncat > conftest.map <<EOF\nVERS_1 {\n  global: *;\n};\nEOF\nAC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],\n  [VERSION_SCRIPT_FLAG=-Wl,--version-script,;\n   AC_MSG_RESULT([yes (GNU style)])],\n  [])\nif test \"x$VERSION_SCRIPT_FLAG\" = \"x\"; then\n  LDFLAGS=\"$SAVED_LDFLAGS -Wl,-M,conftest.map\"\n  AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],\n    [VERSION_SCRIPT_FLAG=-Wl,-M,;\n     AC_MSG_RESULT([yes (Sun style)])],\n    [])\nfi\nif test \"x$VERSION_SCRIPT_FLAG\" = \"x\"; then\n  VERSION_SCRIPT=no\n  AC_MSG_RESULT(no)\nfi\nLDFLAGS=\"$SAVED_LDFLAGS\"\n\nAC_MSG_CHECKING([whether to use version script when building libjpeg-turbo])\nAC_MSG_RESULT($VERSION_SCRIPT)\n\nAM_CONDITIONAL(VERSION_SCRIPT, test \"x$VERSION_SCRIPT\" = \"xyes\")\nAC_SUBST(VERSION_SCRIPT_FLAG)\n\n# Check for non-broken inline under various spellings\nAC_MSG_CHECKING(for inline)\nljt_cv_inline=\"\"\nAC_TRY_COMPILE(, [} __attribute__((always_inline)) int foo() { return 0; }\nint bar() { return foo();], ljt_cv_inline=\"inline __attribute__((always_inline))\",\nAC_TRY_COMPILE(, [} __inline__ int foo() { return 0; }\nint bar() { return foo();], ljt_cv_inline=\"__inline__\",\nAC_TRY_COMPILE(, [} __inline int foo() { return 0; }\nint bar() { return foo();], ljt_cv_inline=\"__inline\",\nAC_TRY_COMPILE(, [} inline int foo() { return 0; }\nint bar() { return foo();], ljt_cv_inline=\"inline\"))))\nAC_MSG_RESULT($ljt_cv_inline)\nAC_DEFINE_UNQUOTED([INLINE],[$ljt_cv_inline],[How to obtain function inlining.])\n\n# Arithmetic coding support\nAC_MSG_CHECKING([whether to include arithmetic encoding support])\nAC_ARG_WITH([arith-enc],\n  AC_HELP_STRING([--without-arith-enc],\n    [Do not include arithmetic encoding support]))\nif test \"x$with_arith_enc\" = \"xno\"; then\n  AC_MSG_RESULT(no)\n  RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --without-arith-enc\"\nelse\n  AC_DEFINE([C_ARITH_CODING_SUPPORTED], [1], [Support arithmetic encoding])\n  AC_MSG_RESULT(yes)\nfi\nAM_CONDITIONAL([WITH_ARITH_ENC], [test \"x$with_arith_enc\" != \"xno\"])\n\nAC_MSG_CHECKING([whether to include arithmetic decoding support])\nAC_ARG_WITH([arith-dec],\n  AC_HELP_STRING([--without-arith-dec],\n    [Do not include arithmetic decoding support]))\nif test \"x$with_arith_dec\" = \"xno\"; then\n  AC_MSG_RESULT(no)\n  RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --without-arith-dec\"\nelse\n  AC_DEFINE([D_ARITH_CODING_SUPPORTED], [1], [Support arithmetic decoding])\n  AC_MSG_RESULT(yes)\nfi\nAM_CONDITIONAL([WITH_ARITH_DEC], [test \"x$with_arith_dec\" != \"xno\"])\n\nAM_CONDITIONAL([WITH_ARITH],\n  [test \"x$with_arith_dec\" != \"xno\" -o \"x$with_arith_enc\" != \"xno\"])\n\n# TurboJPEG support\nAC_MSG_CHECKING([whether to build TurboJPEG C wrapper])\nAC_ARG_WITH([turbojpeg],\n  AC_HELP_STRING([--without-turbojpeg],\n    [Do not include the TurboJPEG wrapper library and associated test programs]))\nif test \"x$with_turbojpeg\" = \"xno\"; then\n  AC_MSG_RESULT(no)\n  RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --without-turbojpeg\"\nelse\n  AC_MSG_RESULT(yes)\nfi\n\n# Java support\nAC_ARG_VAR(JAVAC, [Java compiler command (default: javac)])\nif test \"x$JAVAC\" = \"x\"; then\n  JAVAC=javac\nfi\nAC_SUBST(JAVAC)\nAC_ARG_VAR(JAVACFLAGS, [Java compiler flags])\nAC_SUBST(JAVACFLAGS)\nAC_ARG_VAR(JAR, [Java archive command (default: jar)])\nif test \"x$JAR\" = \"x\"; then\n  JAR=jar\nfi\nAC_SUBST(JAR)\nAC_ARG_VAR(JAVA, [Java runtime command (default: java)])\nif test \"x$JAVA\" = \"x\"; then\n  JAVA=java\nfi\nAC_SUBST(JAVA)\nAC_ARG_VAR(JNI_CFLAGS,\n  [C compiler flags needed to include jni.h (default: -I/System/Library/Frameworks/JavaVM.framework/Headers on OS X, '-I/usr/java/include -I/usr/java/include/solaris' on Solaris, and '-I/usr/java/default/include -I/usr/java/default/include/linux' on Linux)])\n\nAC_MSG_CHECKING([whether to build TurboJPEG Java wrapper])\nAC_ARG_WITH([java],\n  AC_HELP_STRING([--with-java], [Build Java wrapper for the TurboJPEG library]))\nif test \"x$with_turbojpeg\" = \"xno\"; then\n  with_java=no\nfi\n\nWITH_JAVA=0\nif test \"x$with_java\" = \"xyes\"; then\n  AC_MSG_RESULT(yes)\n\n  case $host_os in\n    darwin*)\n      DEFAULT_JNI_CFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Headers\n      ;;\n    solaris*)\n      DEFAULT_JNI_CFLAGS='-I/usr/java/include -I/usr/java/include/solaris'\n      ;;\n    linux*)\n      DEFAULT_JNI_CFLAGS='-I/usr/java/default/include -I/usr/java/default/include/linux'\n      ;;\n  esac\n  if test \"x$JNI_CFLAGS\" = \"x\"; then\n    JNI_CFLAGS=$DEFAULT_JNI_CFLAGS\n  fi\n\n  SAVE_CPPFLAGS=${CPPFLAGS}\n  CPPFLAGS=\"${CPPFLAGS} ${JNI_CFLAGS}\"\n  AC_CHECK_HEADERS([jni.h], [DUMMY=1],\n    [AC_MSG_ERROR([Could not find JNI header file])])\n  CPPFLAGS=${SAVE_CPPFLAGS}\n  AC_SUBST(JNI_CFLAGS)\n\n  RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --with-java\"\n  JAVA_RPM_CONTENTS_1='%dir %{_datadir}/classes'\n  JAVA_RPM_CONTENTS_2=%{_datadir}/classes/turbojpeg.jar\n  WITH_JAVA=1\nelse\n  AC_MSG_RESULT(no)\nfi\nAM_CONDITIONAL([WITH_JAVA], [test \"x$with_java\" = \"xyes\"])\nAC_SUBST(WITH_JAVA)\nAC_SUBST(JAVA_RPM_CONTENTS_1)\nAC_SUBST(JAVA_RPM_CONTENTS_2)\n\n# optionally force using gas-preprocessor.pl for compatibility testing\nAC_ARG_WITH([gas-preprocessor],\n  AC_HELP_STRING([--with-gas-preprocessor],\n    [Force using gas-preprocessor.pl on ARM.]))\nif test \"x${with_gas_preprocessor}\" = \"xyes\"; then\n  case $host_os in\n    darwin*)\n      CCAS=\"gas-preprocessor.pl -fix-unreq $CC\"\n      ;;\n    *)\n      CCAS=\"gas-preprocessor.pl -no-fix-unreq $CC\"\n      ;;\n  esac\n  AC_SUBST([CCAS])\nfi\n\n# SIMD is optional\nAC_ARG_WITH([simd],\n  AC_HELP_STRING([--without-simd], [Do not include SIMD extensions]))\nif test \"x${with_simd}\" != \"xno\"; then\n  require_simd=no\n  if test \"x${with_simd}\" = \"xyes\"; then\n    require_simd=yes\n  fi\n  # Check if we're on a supported CPU\n  AC_MSG_CHECKING([if we have SIMD optimisations for cpu type])\n  case \"$host_cpu\" in\n    x86_64 | amd64)\n      AC_MSG_RESULT([yes (x86_64)])\n      AC_PROG_NASM\n      simd_arch=x86_64\n      ;;\n    i*86 | x86 | ia32)\n      AC_MSG_RESULT([yes (i386)])\n      AC_PROG_NASM\n      simd_arch=i386\n      ;;\n    arm*)\n      AC_MSG_RESULT([yes (arm)])\n      AC_MSG_CHECKING([if the assembler is GNU-compatible and can be used])\n      AC_CHECK_COMPATIBLE_ARM_ASSEMBLER_IFELSE(\n        [AC_MSG_RESULT([yes])\n         simd_arch=arm],\n        [AC_MSG_RESULT([no])\n         with_simd=no])\n      if test \"x${with_simd}\" = \"xno\"; then\n        if test \"x${require_simd}\" = \"xyes\"; then\n          AC_MSG_ERROR([SIMD support can't be enabled.])\n        else\n          AC_MSG_WARN([SIMD support can't be enabled.  Performance will suffer.])\n        fi\n      fi\n      ;;\n    *)\n      AC_MSG_RESULT([no (\"$host_cpu\")])\n      with_simd=no;\n      if test \"x${require_simd}\" = \"xyes\"; then\n        AC_MSG_ERROR([SIMD support not available for this CPU.])\n      else\n        AC_MSG_WARN([SIMD support not available for this CPU.  Performance will suffer.])\n      fi\n      ;;\n  esac\n\n  if test \"x${with_simd}\" != \"xno\"; then\n    AC_DEFINE([WITH_SIMD], [1], [Use accelerated SIMD routines.])\n  fi\nelse\n  RPM_CONFIG_ARGS=\"$RPM_CONFIG_ARGS --without-simd\"\nfi\n\nAM_CONDITIONAL([WITH_SIMD], [test \"x$with_simd\" != \"xno\"])\nAM_CONDITIONAL([WITH_SSE_FLOAT_DCT], [test \"x$simd_arch\" = \"xx86_64\" -o \"x$simd_arch\" = \"xi386\"])\nAM_CONDITIONAL([SIMD_I386], [test \"x$simd_arch\" = \"xi386\"])\nAM_CONDITIONAL([SIMD_X86_64], [test \"x$simd_arch\" = \"xx86_64\"])\nAM_CONDITIONAL([SIMD_ARM], [test \"x$simd_arch\" = \"xarm\"])\nAM_CONDITIONAL([X86_64], [test \"x$host_cpu\" = \"xx86_64\" -o \"x$host_cpu\" = \"xamd64\"])\nAM_CONDITIONAL([WITH_TURBOJPEG], [test \"x$with_turbojpeg\" != \"xno\"])\n\nAC_ARG_VAR(PKGNAME, [distribution package name (default: libjpeg-turbo)])\nif test \"x$PKGNAME\" = \"x\"; then\n  PKGNAME=$PACKAGE_NAME\nfi\nAC_SUBST(PKGNAME)\n\ncase \"$host_cpu\" in\n  x86_64)\n    RPMARCH=x86_64\n    DEBARCH=amd64\n    ;;\n  i*86 | x86 | ia32)\n    RPMARCH=i386\n    DEBARCH=i386\n    ;;\nesac\n\nAC_SUBST(RPMARCH)\nAC_SUBST(RPM_CONFIG_ARGS)\nAC_SUBST(DEBARCH)\nAC_SUBST(BUILD)\nAC_DEFINE_UNQUOTED([BUILD], \"$BUILD\", [Build number])\n\n# jconfig.h is the file we use, but we have another before that to\n# fool autoheader. the reason is that we include this header in our\n# API headers, which can screw things up for users of the lib.\n# jconfig.h is a minimal version that allows this package to be built\nAC_CONFIG_HEADERS([config.h])\nAC_CONFIG_HEADERS([jconfig.h])\nAC_CONFIG_FILES([pkgscripts/libjpeg-turbo.spec.tmpl:release/libjpeg-turbo.spec.in])\nAC_CONFIG_FILES([pkgscripts/makecygwinpkg.tmpl:release/makecygwinpkg.in])\nAC_CONFIG_FILES([pkgscripts/makedpkg.tmpl:release/makedpkg.in])\nAC_CONFIG_FILES([pkgscripts/makemacpkg.tmpl:release/makemacpkg.in])\nAC_CONFIG_FILES([pkgscripts/Description.plist:release/Description.plist.in])\nAC_CONFIG_FILES([pkgscripts/Info.plist:release/Info.plist.in])\nAC_CONFIG_FILES([pkgscripts/uninstall.tmpl:release/uninstall.in])\nif test \"x$with_turbojpeg\" != \"xno\"; then\n  AC_CONFIG_FILES([tjbenchtest])\nfi\nif test \"x$with_java\" = \"xyes\"; then\n  AC_CONFIG_FILES([tjbenchtest.java])\n  AC_CONFIG_FILES([tjexampletest])\nfi\nAC_CONFIG_FILES([libjpeg.map])\nAC_CONFIG_FILES([Makefile simd/Makefile])\nAC_CONFIG_FILES([java/Makefile])\nAC_CONFIG_FILES([md5/Makefile])\nAC_OUTPUT\n"
  },
  {
    "path": "ext/libjpeg-turbo/depcomp",
    "content": "#! /bin/sh\n# depcomp - compile a program generating dependencies as side-effects\n\nscriptversion=2004-05-31.23\n\n# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n# 02111-1307, USA.\n\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that program.\n\n# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.\n\ncase $1 in\n  '')\n     echo \"$0: No command.  Try \\`$0 --help' for more information.\" 1>&2\n     exit 1;\n     ;;\n  -h | --h*)\n    cat <<\\EOF\nUsage: depcomp [--help] [--version] PROGRAM [ARGS]\n\nRun PROGRAMS ARGS to compile a file, generating dependencies\nas side-effects.\n\nEnvironment variables:\n  depmode     Dependency tracking mode.\n  source      Source file read by `PROGRAMS ARGS'.\n  object      Object file output by `PROGRAMS ARGS'.\n  DEPDIR      directory where to store dependencies.\n  depfile     Dependency file to output.\n  tmpdepfile  Temporary file to use when outputing dependencies.\n  libtool     Whether libtool is used (yes/no).\n\nReport bugs to <bug-automake@gnu.org>.\nEOF\n    exit 0\n    ;;\n  -v | --v*)\n    echo \"depcomp $scriptversion\"\n    exit 0\n    ;;\nesac\n\nif test -z \"$depmode\" || test -z \"$source\" || test -z \"$object\"; then\n  echo \"depcomp: Variables source, object and depmode must be set\" 1>&2\n  exit 1\nfi\n\n# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.\ndepfile=${depfile-`echo \"$object\" |\n  sed 's|[^\\\\/]*$|'${DEPDIR-.deps}'/&|;s|\\.\\([^.]*\\)$|.P\\1|;s|Pobj$|Po|'`}\ntmpdepfile=${tmpdepfile-`echo \"$depfile\" | sed 's/\\.\\([^.]*\\)$/.T\\1/'`}\n\nrm -f \"$tmpdepfile\"\n\n# Some modes work just like other modes, but use different flags.  We\n# parameterize here, but still list the modes in the big case below,\n# to make depend.m4 easier to write.  Note that we *cannot* use a case\n# here, because this file can only contain one case statement.\nif test \"$depmode\" = hp; then\n  # HP compiler uses -M and no extra arg.\n  gccflag=-M\n  depmode=gcc\nfi\n\nif test \"$depmode\" = dashXmstdout; then\n   # This is just like dashmstdout with a different argument.\n   dashmflag=-xM\n   depmode=dashmstdout\nfi\n\ncase \"$depmode\" in\ngcc3)\n## gcc 3 implements dependency tracking that does exactly what\n## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like\n## it if -MD -MP comes after the -MF stuff.  Hmm.\n  \"$@\" -MT \"$object\" -MD -MP -MF \"$tmpdepfile\"\n  stat=$?\n  if test $stat -eq 0; then :\n  else\n    rm -f \"$tmpdepfile\"\n    exit $stat\n  fi\n  mv \"$tmpdepfile\" \"$depfile\"\n  ;;\n\ngcc)\n## There are various ways to get dependency output from gcc.  Here's\n## why we pick this rather obscure method:\n## - Don't want to use -MD because we'd like the dependencies to end\n##   up in a subdir.  Having to rename by hand is ugly.\n##   (We might end up doing this anyway to support other compilers.)\n## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like\n##   -MM, not -M (despite what the docs say).\n## - Using -M directly means running the compiler twice (even worse\n##   than renaming).\n  if test -z \"$gccflag\"; then\n    gccflag=-MD,\n  fi\n  \"$@\" -Wp,\"$gccflag$tmpdepfile\"\n  stat=$?\n  if test $stat -eq 0; then :\n  else\n    rm -f \"$tmpdepfile\"\n    exit $stat\n  fi\n  rm -f \"$depfile\"\n  echo \"$object : \\\\\" > \"$depfile\"\n  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\n## The second -e expression handles DOS-style file names with drive letters.\n  sed -e 's/^[^:]*: / /' \\\n      -e 's/^['$alpha']:\\/[^:]*: / /' < \"$tmpdepfile\" >> \"$depfile\"\n## This next piece of magic avoids the `deleted header file' problem.\n## The problem is that when a header file which appears in a .P file\n## is deleted, the dependency causes make to die (because there is\n## typically no way to rebuild the header).  We avoid this by adding\n## dummy dependencies for each header file.  Too bad gcc doesn't do\n## this for us directly.\n  tr ' ' '\n' < \"$tmpdepfile\" |\n## Some versions of gcc put a space before the `:'.  On the theory\n## that the space means something, we add a space to the output as\n## well.\n## Some versions of the HPUX 10.20 sed can't process this invocation\n## correctly.  Breaking it into two sed invocations is a workaround.\n    sed -e 's/^\\\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> \"$depfile\"\n  rm -f \"$tmpdepfile\"\n  ;;\n\nhp)\n  # This case exists only to let depend.m4 do its work.  It works by\n  # looking at the text of this script.  This case will never be run,\n  # since it is checked for above.\n  exit 1\n  ;;\n\nsgi)\n  if test \"$libtool\" = yes; then\n    \"$@\" \"-Wp,-MDupdate,$tmpdepfile\"\n  else\n    \"$@\" -MDupdate \"$tmpdepfile\"\n  fi\n  stat=$?\n  if test $stat -eq 0; then :\n  else\n    rm -f \"$tmpdepfile\"\n    exit $stat\n  fi\n  rm -f \"$depfile\"\n\n  if test -f \"$tmpdepfile\"; then  # yes, the sourcefile depend on other files\n    echo \"$object : \\\\\" > \"$depfile\"\n\n    # Clip off the initial element (the dependent).  Don't try to be\n    # clever and replace this with sed code, as IRIX sed won't handle\n    # lines with more than a fixed number of characters (4096 in\n    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;\n    # the IRIX cc adds comments like `#:fec' to the end of the\n    # dependency line.\n    tr ' ' '\n' < \"$tmpdepfile\" \\\n    | sed -e 's/^.*\\.o://' -e 's/#.*$//' -e '/^$/ d' | \\\n    tr '\n' ' ' >> $depfile\n    echo >> $depfile\n\n    # The second pass generates a dummy entry for each header file.\n    tr ' ' '\n' < \"$tmpdepfile\" \\\n   | sed -e 's/^.*\\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \\\n   >> $depfile\n  else\n    # The sourcefile does not contain any dependencies, so just\n    # store a dummy comment line, to avoid errors with the Makefile\n    # \"include basename.Plo\" scheme.\n    echo \"#dummy\" > \"$depfile\"\n  fi\n  rm -f \"$tmpdepfile\"\n  ;;\n\naix)\n  # The C for AIX Compiler uses -M and outputs the dependencies\n  # in a .u file.  In older versions, this file always lives in the\n  # current directory.  Also, the AIX compiler puts `$object:' at the\n  # start of each line; $object doesn't have directory information.\n  # Version 6 uses the directory in both cases.\n  stripped=`echo \"$object\" | sed 's/\\(.*\\)\\..*$/\\1/'`\n  tmpdepfile=\"$stripped.u\"\n  if test \"$libtool\" = yes; then\n    \"$@\" -Wc,-M\n  else\n    \"$@\" -M\n  fi\n  stat=$?\n\n  if test -f \"$tmpdepfile\"; then :\n  else\n    stripped=`echo \"$stripped\" | sed 's,^.*/,,'`\n    tmpdepfile=\"$stripped.u\"\n  fi\n\n  if test $stat -eq 0; then :\n  else\n    rm -f \"$tmpdepfile\"\n    exit $stat\n  fi\n\n  if test -f \"$tmpdepfile\"; then\n    outname=\"$stripped.o\"\n    # Each line is of the form `foo.o: dependent.h'.\n    # Do two passes, one to just change these to\n    # `$object: dependent.h' and one to simply `dependent.h:'.\n    sed -e \"s,^$outname:,$object :,\" < \"$tmpdepfile\" > \"$depfile\"\n    sed -e \"s,^$outname: \\(.*\\)$,\\1:,\" < \"$tmpdepfile\" >> \"$depfile\"\n  else\n    # The sourcefile does not contain any dependencies, so just\n    # store a dummy comment line, to avoid errors with the Makefile\n    # \"include basename.Plo\" scheme.\n    echo \"#dummy\" > \"$depfile\"\n  fi\n  rm -f \"$tmpdepfile\"\n  ;;\n\nicc)\n  # Intel's C compiler understands `-MD -MF file'.  However on\n  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c\n  # ICC 7.0 will fill foo.d with something like\n  #    foo.o: sub/foo.c\n  #    foo.o: sub/foo.h\n  # which is wrong.  We want:\n  #    sub/foo.o: sub/foo.c\n  #    sub/foo.o: sub/foo.h\n  #    sub/foo.c:\n  #    sub/foo.h:\n  # ICC 7.1 will output\n  #    foo.o: sub/foo.c sub/foo.h\n  # and will wrap long lines using \\ :\n  #    foo.o: sub/foo.c ... \\\n  #     sub/foo.h ... \\\n  #     ...\n\n  \"$@\" -MD -MF \"$tmpdepfile\"\n  stat=$?\n  if test $stat -eq 0; then :\n  else\n    rm -f \"$tmpdepfile\"\n    exit $stat\n  fi\n  rm -f \"$depfile\"\n  # Each line is of the form `foo.o: dependent.h',\n  # or `foo.o: dep1.h dep2.h \\', or ` dep3.h dep4.h \\'.\n  # Do two passes, one to just change these to\n  # `$object: dependent.h' and one to simply `dependent.h:'.\n  sed \"s,^[^:]*:,$object :,\" < \"$tmpdepfile\" > \"$depfile\"\n  # Some versions of the HPUX 10.20 sed can't process this invocation\n  # correctly.  Breaking it into two sed invocations is a workaround.\n  sed 's,^[^:]*: \\(.*\\)$,\\1,;s/^\\\\$//;/^$/d;/:$/d' < \"$tmpdepfile\" |\n    sed -e 's/$/ :/' >> \"$depfile\"\n  rm -f \"$tmpdepfile\"\n  ;;\n\ntru64)\n   # The Tru64 compiler uses -MD to generate dependencies as a side\n   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.\n   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put\n   # dependencies in `foo.d' instead, so we check for that too.\n   # Subdirectories are respected.\n   dir=`echo \"$object\" | sed -e 's|/[^/]*$|/|'`\n   test \"x$dir\" = \"x$object\" && dir=\n   base=`echo \"$object\" | sed -e 's|^.*/||' -e 's/\\.o$//' -e 's/\\.lo$//'`\n\n   if test \"$libtool\" = yes; then\n      # Dependencies are output in .lo.d with libtool 1.4.\n      # With libtool 1.5 they are output both in $dir.libs/$base.o.d\n      # and in $dir.libs/$base.o.d and $dir$base.o.d.  We process the\n      # latter, because the former will be cleaned when $dir.libs is\n      # erased.\n      tmpdepfile1=\"$dir.libs/$base.lo.d\"\n      tmpdepfile2=\"$dir$base.o.d\"\n      tmpdepfile3=\"$dir.libs/$base.d\"\n      \"$@\" -Wc,-MD\n   else\n      tmpdepfile1=\"$dir$base.o.d\"\n      tmpdepfile2=\"$dir$base.d\"\n      tmpdepfile3=\"$dir$base.d\"\n      \"$@\" -MD\n   fi\n\n   stat=$?\n   if test $stat -eq 0; then :\n   else\n      rm -f \"$tmpdepfile1\" \"$tmpdepfile2\" \"$tmpdepfile3\"\n      exit $stat\n   fi\n\n   if test -f \"$tmpdepfile1\"; then\n      tmpdepfile=\"$tmpdepfile1\"\n   elif test -f \"$tmpdepfile2\"; then\n      tmpdepfile=\"$tmpdepfile2\"\n   else\n      tmpdepfile=\"$tmpdepfile3\"\n   fi\n   if test -f \"$tmpdepfile\"; then\n      sed -e \"s,^.*\\.[a-z]*:,$object:,\" < \"$tmpdepfile\" > \"$depfile\"\n      # That's a tab and a space in the [].\n      sed -e 's,^.*\\.[a-z]*:[\t ]*,,' -e 's,$,:,' < \"$tmpdepfile\" >> \"$depfile\"\n   else\n      echo \"#dummy\" > \"$depfile\"\n   fi\n   rm -f \"$tmpdepfile\"\n   ;;\n\n#nosideeffect)\n  # This comment above is used by automake to tell side-effect\n  # dependency tracking mechanisms from slower ones.\n\ndashmstdout)\n  # Important note: in order to support this mode, a compiler *must*\n  # always write the preprocessed file to stdout, regardless of -o.\n  \"$@\" || exit $?\n\n  # Remove the call to Libtool.\n  if test \"$libtool\" = yes; then\n    while test $1 != '--mode=compile'; do\n      shift\n    done\n    shift\n  fi\n\n  # Remove `-o $object'.\n  IFS=\" \"\n  for arg\n  do\n    case $arg in\n    -o)\n      shift\n      ;;\n    $object)\n      shift\n      ;;\n    *)\n      set fnord \"$@\" \"$arg\"\n      shift # fnord\n      shift # $arg\n      ;;\n    esac\n  done\n\n  test -z \"$dashmflag\" && dashmflag=-M\n  # Require at least two characters before searching for `:'\n  # in the target name.  This is to cope with DOS-style filenames:\n  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.\n  \"$@\" $dashmflag |\n    sed 's:^[  ]*[^: ][^:][^:]*\\:[    ]*:'\"$object\"'\\: :' > \"$tmpdepfile\"\n  rm -f \"$depfile\"\n  cat < \"$tmpdepfile\" > \"$depfile\"\n  tr ' ' '\n' < \"$tmpdepfile\" | \\\n## Some versions of the HPUX 10.20 sed can't process this invocation\n## correctly.  Breaking it into two sed invocations is a workaround.\n    sed -e 's/^\\\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> \"$depfile\"\n  rm -f \"$tmpdepfile\"\n  ;;\n\ndashXmstdout)\n  # This case only exists to satisfy depend.m4.  It is never actually\n  # run, as this mode is specially recognized in the preamble.\n  exit 1\n  ;;\n\nmakedepend)\n  \"$@\" || exit $?\n  # Remove any Libtool call\n  if test \"$libtool\" = yes; then\n    while test $1 != '--mode=compile'; do\n      shift\n    done\n    shift\n  fi\n  # X makedepend\n  shift\n  cleared=no\n  for arg in \"$@\"; do\n    case $cleared in\n    no)\n      set \"\"; shift\n      cleared=yes ;;\n    esac\n    case \"$arg\" in\n    -D*|-I*)\n      set fnord \"$@\" \"$arg\"; shift ;;\n    # Strip any option that makedepend may not understand.  Remove\n    # the object too, otherwise makedepend will parse it as a source file.\n    -*|$object)\n      ;;\n    *)\n      set fnord \"$@\" \"$arg\"; shift ;;\n    esac\n  done\n  obj_suffix=\"`echo $object | sed 's/^.*\\././'`\"\n  touch \"$tmpdepfile\"\n  ${MAKEDEPEND-makedepend} -o\"$obj_suffix\" -f\"$tmpdepfile\" \"$@\"\n  rm -f \"$depfile\"\n  cat < \"$tmpdepfile\" > \"$depfile\"\n  sed '1,2d' \"$tmpdepfile\" | tr ' ' '\n' | \\\n## Some versions of the HPUX 10.20 sed can't process this invocation\n## correctly.  Breaking it into two sed invocations is a workaround.\n    sed -e 's/^\\\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> \"$depfile\"\n  rm -f \"$tmpdepfile\" \"$tmpdepfile\".bak\n  ;;\n\ncpp)\n  # Important note: in order to support this mode, a compiler *must*\n  # always write the preprocessed file to stdout.\n  \"$@\" || exit $?\n\n  # Remove the call to Libtool.\n  if test \"$libtool\" = yes; then\n    while test $1 != '--mode=compile'; do\n      shift\n    done\n    shift\n  fi\n\n  # Remove `-o $object'.\n  IFS=\" \"\n  for arg\n  do\n    case $arg in\n    -o)\n      shift\n      ;;\n    $object)\n      shift\n      ;;\n    *)\n      set fnord \"$@\" \"$arg\"\n      shift # fnord\n      shift # $arg\n      ;;\n    esac\n  done\n\n  \"$@\" -E |\n    sed -n '/^# [0-9][0-9]* \"\\([^\"]*\\)\".*/ s:: \\1 \\\\:p' |\n    sed '$ s: \\\\$::' > \"$tmpdepfile\"\n  rm -f \"$depfile\"\n  echo \"$object : \\\\\" > \"$depfile\"\n  cat < \"$tmpdepfile\" >> \"$depfile\"\n  sed < \"$tmpdepfile\" '/^$/d;s/^ //;s/ \\\\$//;s/$/ :/' >> \"$depfile\"\n  rm -f \"$tmpdepfile\"\n  ;;\n\nmsvisualcpp)\n  # Important note: in order to support this mode, a compiler *must*\n  # always write the preprocessed file to stdout, regardless of -o,\n  # because we must use -o when running libtool.\n  \"$@\" || exit $?\n  IFS=\" \"\n  for arg\n  do\n    case \"$arg\" in\n    \"-Gm\"|\"/Gm\"|\"-Gi\"|\"/Gi\"|\"-ZI\"|\"/ZI\")\n\tset fnord \"$@\"\n\tshift\n\tshift\n\t;;\n    *)\n\tset fnord \"$@\" \"$arg\"\n\tshift\n\tshift\n\t;;\n    esac\n  done\n  \"$@\" -E |\n  sed -n '/^#line [0-9][0-9]* \"\\([^\"]*\\)\"/ s::echo \"`cygpath -u \\\\\"\\1\\\\\"`\":p' | sort | uniq > \"$tmpdepfile\"\n  rm -f \"$depfile\"\n  echo \"$object : \\\\\" > \"$depfile\"\n  . \"$tmpdepfile\" | sed 's% %\\\\ %g' | sed -n '/^\\(.*\\)$/ s::\t\\1 \\\\:p' >> \"$depfile\"\n  echo \"\t\" >> \"$depfile\"\n  . \"$tmpdepfile\" | sed 's% %\\\\ %g' | sed -n '/^\\(.*\\)$/ s::\\1\\::p' >> \"$depfile\"\n  rm -f \"$tmpdepfile\"\n  ;;\n\nnone)\n  exec \"$@\"\n  ;;\n\n*)\n  echo \"Unknown depmode $depmode\" 1>&2\n  exit 1\n  ;;\nesac\n\nexit 0\n\n# Local Variables:\n# mode: shell-script\n# sh-indentation: 2\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"scriptversion=\"\n# time-stamp-format: \"%:y-%02m-%02d.%02H\"\n# time-stamp-end: \"$\"\n# End:\n"
  },
  {
    "path": "ext/libjpeg-turbo/djpeg.1",
    "content": ".TH DJPEG 1 \"18 January 2013\"\n.SH NAME\ndjpeg \\- decompress a JPEG file to an image file\n.SH SYNOPSIS\n.B djpeg\n[\n.I options\n]\n[\n.I filename\n]\n.LP\n.SH DESCRIPTION\n.LP\n.B djpeg\ndecompresses the named JPEG file, or the standard input if no file is named,\nand produces an image file on the standard output.  PBMPLUS (PPM/PGM), BMP,\nGIF, Targa, or RLE (Utah Raster Toolkit) output format can be selected.\n(RLE is supported only if the URT library is available.)\n.SH OPTIONS\nAll switch names may be abbreviated; for example,\n.B \\-grayscale\nmay be written\n.B \\-gray\nor\n.BR \\-gr .\nMost of the \"basic\" switches can be abbreviated to as little as one letter.\nUpper and lower case are equivalent (thus\n.B \\-BMP\nis the same as\n.BR \\-bmp ).\nBritish spellings are also accepted (e.g.,\n.BR \\-greyscale ),\nthough for brevity these are not mentioned below.\n.PP\nThe basic switches are:\n.TP\n.BI \\-colors \" N\"\nReduce image to at most N colors.  This reduces the number of colors used in\nthe output image, so that it can be displayed on a colormapped display or\nstored in a colormapped file format.  For example, if you have an 8-bit\ndisplay, you'd need to reduce to 256 or fewer colors.\n.TP\n.BI \\-quantize \" N\"\nSame as\n.BR \\-colors .\n.B \\-colors\nis the recommended name,\n.B \\-quantize\nis provided only for backwards compatibility.\n.TP\n.B \\-fast\nSelect recommended processing options for fast, low quality output.  (The\ndefault options are chosen for highest quality output.)  Currently, this is\nequivalent to \\fB\\-dct fast \\-nosmooth \\-onepass \\-dither ordered\\fR.\n.TP\n.B \\-grayscale\nForce gray-scale output even if JPEG file is color.  Useful for viewing on\nmonochrome displays; also,\n.B djpeg\nruns noticeably faster in this mode.\n.TP\n.BI \\-scale \" M/N\"\nScale the output image by a factor M/N.  Currently the scale factor must be\nM/8, where M is an integer between 1 and 16 inclusive, or any reduced fraction\nthereof (such as 1/2, 3/4, etc.)  Scaling is handy if the image is larger than\nyour screen; also,\n.B djpeg\nruns much faster when scaling down the output.\n.TP\n.B \\-bmp\nSelect BMP output format (Windows flavor).  8-bit colormapped format is\nemitted if\n.B \\-colors\nor\n.B \\-grayscale\nis specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color\nformat is emitted.\n.TP\n.B \\-gif\nSelect GIF output format.  Since GIF does not support more than 256 colors,\n.B \\-colors 256\nis assumed (unless you specify a smaller number of colors).\n.TP\n.B \\-os2\nSelect BMP output format (OS/2 1.x flavor).  8-bit colormapped format is\nemitted if\n.B \\-colors\nor\n.B \\-grayscale\nis specified, or if the JPEG file is gray-scale; otherwise, 24-bit full-color\nformat is emitted.\n.TP\n.B \\-pnm\nSelect PBMPLUS (PPM/PGM) output format (this is the default format).\nPGM is emitted if the JPEG file is gray-scale or if\n.B \\-grayscale\nis specified; otherwise PPM is emitted.\n.TP\n.B \\-rle\nSelect RLE output format.  (Requires URT library.)\n.TP\n.B \\-targa\nSelect Targa output format.  Gray-scale format is emitted if the JPEG file is\ngray-scale or if\n.B \\-grayscale\nis specified; otherwise, colormapped format is emitted if\n.B \\-colors\nis specified; otherwise, 24-bit full-color format is emitted.\n.PP\nSwitches for advanced users:\n.TP\n.B \\-dct int\nUse integer DCT method (default).\n.TP\n.B \\-dct fast\nUse fast integer DCT (less accurate).\n.TP\n.B \\-dct float\nUse floating-point DCT method.\nThe float method is very slightly more accurate than the int method, but is\nmuch slower unless your machine has very fast floating-point hardware.  Also\nnote that results of the floating-point method may vary slightly across\nmachines, while the integer methods should give the same results everywhere.\nThe fast integer method is much less accurate than the other two.\n.TP\n.B \\-dither fs\nUse Floyd-Steinberg dithering in color quantization.\n.TP\n.B \\-dither ordered\nUse ordered dithering in color quantization.\n.TP\n.B \\-dither none\nDo not use dithering in color quantization.\nBy default, Floyd-Steinberg dithering is applied when quantizing colors; this\nis slow but usually produces the best results.  Ordered dither is a compromise\nbetween speed and quality; no dithering is fast but usually looks awful.  Note\nthat these switches have no effect unless color quantization is being done.\nOrdered dither is only available in\n.B \\-onepass\nmode.\n.TP\n.BI \\-map \" file\"\nQuantize to the colors used in the specified image file.  This is useful for\nproducing multiple files with identical color maps, or for forcing a\npredefined set of colors to be used.  The\n.I file\nmust be a GIF or PPM file. This option overrides\n.B \\-colors\nand\n.BR \\-onepass .\n.TP\n.B \\-nosmooth\nUse a faster, lower-quality upsampling routine.\n.TP\n.B \\-onepass\nUse one-pass instead of two-pass color quantization.  The one-pass method is\nfaster and needs less memory, but it produces a lower-quality image.\n.B \\-onepass\nis ignored unless you also say\n.B \\-colors\n.IR N .\nAlso, the one-pass method is always used for gray-scale output (the two-pass\nmethod is no improvement then).\n.TP\n.BI \\-maxmemory \" N\"\nSet limit for amount of memory to use in processing large images.  Value is\nin thousands of bytes, or millions of bytes if \"M\" is attached to the\nnumber.  For example,\n.B \\-max 4m\nselects 4000000 bytes.  If more space is needed, temporary files will be used.\n.TP\n.BI \\-outfile \" name\"\nSend output image to the named file, not to standard output.\n.TP\n.BI \\-memsrc\nLoad input file into memory before decompressing.  This feature was implemented\nmainly as a way of testing the in-memory source manager (jpeg_mem_src().)\n.TP\n.B \\-verbose\nEnable debug printout.  More\n.BR \\-v 's\ngive more output.  Also, version information is printed at startup.\n.TP\n.B \\-debug\nSame as\n.BR \\-verbose .\n.SH EXAMPLES\n.LP\nThis example decompresses the JPEG file foo.jpg, quantizes it to\n256 colors, and saves the output in 8-bit BMP format in foo.bmp:\n.IP\n.B djpeg \\-colors 256 \\-bmp\n.I foo.jpg\n.B >\n.I foo.bmp\n.SH HINTS\nTo get a quick preview of an image, use the\n.B \\-grayscale\nand/or\n.B \\-scale\nswitches.\n.B \\-grayscale \\-scale 1/8\nis the fastest case.\n.PP\nSeveral options are available that trade off image quality to gain speed.\n.B \\-fast\nturns on the recommended settings.\n.PP\n.B \\-dct fast\nand/or\n.B \\-nosmooth\ngain speed at a small sacrifice in quality.\nWhen producing a color-quantized image,\n.B \\-onepass \\-dither ordered\nis fast but much lower quality than the default behavior.\n.B \\-dither none\nmay give acceptable results in two-pass mode, but is seldom tolerable in\none-pass mode.\n.PP\nIf you are fortunate enough to have very fast floating point hardware,\n\\fB\\-dct float\\fR may be even faster than \\fB\\-dct fast\\fR.  But on most\nmachines \\fB\\-dct float\\fR is slower than \\fB\\-dct int\\fR; in this case it is\nnot worth using, because its theoretical accuracy advantage is too small to be\nsignificant in practice.\n.SH ENVIRONMENT\n.TP\n.B JPEGMEM\nIf this environment variable is set, its value is the default memory limit.\nThe value is specified as described for the\n.B \\-maxmemory\nswitch.\n.B JPEGMEM\noverrides the default value specified when the program was compiled, and\nitself is overridden by an explicit\n.BR \\-maxmemory .\n.SH SEE ALSO\n.BR cjpeg (1),\n.BR jpegtran (1),\n.BR rdjpgcom (1),\n.BR wrjpgcom (1)\n.br\n.BR ppm (5),\n.BR pgm (5)\n.br\nWallace, Gregory K.  \"The JPEG Still Picture Compression Standard\",\nCommunications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.\n.SH AUTHOR\nIndependent JPEG Group\n.PP\nThis file was modified by The libjpeg-turbo Project to include only information\nrelevant to libjpeg-turbo, to wordsmith certain sections, and to describe\nfeatures not present in libjpeg.\n.SH BUGS\nTo avoid the Unisys LZW patent,\n.B djpeg\nproduces uncompressed GIF files.  These are larger than they should be, but\nare readable by standard GIF decoders.\n"
  },
  {
    "path": "ext/libjpeg-turbo/djpeg.c",
    "content": "/*\n * djpeg.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010-2011, 2013, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains a command-line user interface for the JPEG decompressor.\n * It should work on any system with Unix- or MS-DOS-style command lines.\n *\n * Two different command line styles are permitted, depending on the\n * compile-time switch TWO_FILE_COMMANDLINE:\n *\tdjpeg [options]  inputfile outputfile\n *\tdjpeg [options]  [inputfile]\n * In the second style, output is always to standard output, which you'd\n * normally redirect to a file or pipe to some other program.  Input is\n * either from a named file or from standard input (typically redirected).\n * The second style is convenient on Unix but is unhelpful on systems that\n * don't support pipes.  Also, you MUST use the first style if your system\n * doesn't do binary I/O to stdin/stdout.\n * To simplify script writing, the \"-outfile\" switch is provided.  The syntax\n *\tdjpeg [options]  -outfile outputfile  inputfile\n * works regardless of which command line style is used.\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n#include \"jversion.h\"\t\t/* for version message */\n#include \"config.h\"\n\n#include <ctype.h>\t\t/* to declare isprint() */\n\n#ifdef USE_CCOMMAND\t\t/* command-line reader for Macintosh */\n#ifdef __MWERKS__\n#include <SIOUX.h>              /* Metrowerks needs this */\n#include <console.h>\t\t/* ... and this */\n#endif\n#ifdef THINK_C\n#include <console.h>\t\t/* Think declares it here */\n#endif\n#endif\n\n\n/* Create the add-on message string table. */\n\n#define JMESSAGE(code,string)\tstring ,\n\nstatic const char * const cdjpeg_message_table[] = {\n#include \"cderror.h\"\n  NULL\n};\n\n\n/*\n * This list defines the known output image formats\n * (not all of which need be supported by a given version).\n * You can change the default output format by defining DEFAULT_FMT;\n * indeed, you had better do so if you undefine PPM_SUPPORTED.\n */\n\ntypedef enum {\n\tFMT_BMP,\t\t/* BMP format (Windows flavor) */\n\tFMT_GIF,\t\t/* GIF format */\n\tFMT_OS2,\t\t/* BMP format (OS/2 flavor) */\n\tFMT_PPM,\t\t/* PPM/PGM (PBMPLUS formats) */\n\tFMT_RLE,\t\t/* RLE format */\n\tFMT_TARGA,\t\t/* Targa format */\n\tFMT_TIFF\t\t/* TIFF format */\n} IMAGE_FORMATS;\n\n#ifndef DEFAULT_FMT\t\t/* so can override from CFLAGS in Makefile */\n#define DEFAULT_FMT\tFMT_PPM\n#endif\n\nstatic IMAGE_FORMATS requested_fmt;\n\n\n/*\n * Argument-parsing code.\n * The switch parser is designed to be useful with DOS-style command line\n * syntax, ie, intermixed switches and file names, where only the switches\n * to the left of a given file name affect processing of that file.\n * The main program in this file doesn't actually use this capability...\n */\n\n\nstatic const char * progname;\t/* program name for error messages */\nstatic char * outfilename;\t/* for -outfile switch */\nboolean memsrc;  /* for -memsrc switch */\n#define INPUT_BUF_SIZE  4096\n\n\nLOCAL(void)\nusage (void)\n/* complain about bad command line */\n{\n  fprintf(stderr, \"usage: %s [switches] \", progname);\n#ifdef TWO_FILE_COMMANDLINE\n  fprintf(stderr, \"inputfile outputfile\\n\");\n#else\n  fprintf(stderr, \"[inputfile]\\n\");\n#endif\n\n  fprintf(stderr, \"Switches (names may be abbreviated):\\n\");\n  fprintf(stderr, \"  -colors N      Reduce image to no more than N colors\\n\");\n  fprintf(stderr, \"  -fast          Fast, low-quality processing\\n\");\n  fprintf(stderr, \"  -grayscale     Force grayscale output\\n\");\n  fprintf(stderr, \"  -rgb           Force RGB output\\n\");\n#ifdef IDCT_SCALING_SUPPORTED\n  fprintf(stderr, \"  -scale M/N     Scale output image by fraction M/N, eg, 1/8\\n\");\n#endif\n#ifdef BMP_SUPPORTED\n  fprintf(stderr, \"  -bmp           Select BMP output format (Windows style)%s\\n\",\n\t  (DEFAULT_FMT == FMT_BMP ? \" (default)\" : \"\"));\n#endif\n#ifdef GIF_SUPPORTED\n  fprintf(stderr, \"  -gif           Select GIF output format%s\\n\",\n\t  (DEFAULT_FMT == FMT_GIF ? \" (default)\" : \"\"));\n#endif\n#ifdef BMP_SUPPORTED\n  fprintf(stderr, \"  -os2           Select BMP output format (OS/2 style)%s\\n\",\n\t  (DEFAULT_FMT == FMT_OS2 ? \" (default)\" : \"\"));\n#endif\n#ifdef PPM_SUPPORTED\n  fprintf(stderr, \"  -pnm           Select PBMPLUS (PPM/PGM) output format%s\\n\",\n\t  (DEFAULT_FMT == FMT_PPM ? \" (default)\" : \"\"));\n#endif\n#ifdef RLE_SUPPORTED\n  fprintf(stderr, \"  -rle           Select Utah RLE output format%s\\n\",\n\t  (DEFAULT_FMT == FMT_RLE ? \" (default)\" : \"\"));\n#endif\n#ifdef TARGA_SUPPORTED\n  fprintf(stderr, \"  -targa         Select Targa output format%s\\n\",\n\t  (DEFAULT_FMT == FMT_TARGA ? \" (default)\" : \"\"));\n#endif\n  fprintf(stderr, \"Switches for advanced users:\\n\");\n#ifdef DCT_ISLOW_SUPPORTED\n  fprintf(stderr, \"  -dct int       Use integer DCT method%s\\n\",\n\t  (JDCT_DEFAULT == JDCT_ISLOW ? \" (default)\" : \"\"));\n#endif\n#ifdef DCT_IFAST_SUPPORTED\n  fprintf(stderr, \"  -dct fast      Use fast integer DCT (less accurate)%s\\n\",\n\t  (JDCT_DEFAULT == JDCT_IFAST ? \" (default)\" : \"\"));\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n  fprintf(stderr, \"  -dct float     Use floating-point DCT method%s\\n\",\n\t  (JDCT_DEFAULT == JDCT_FLOAT ? \" (default)\" : \"\"));\n#endif\n  fprintf(stderr, \"  -dither fs     Use F-S dithering (default)\\n\");\n  fprintf(stderr, \"  -dither none   Don't use dithering in quantization\\n\");\n  fprintf(stderr, \"  -dither ordered  Use ordered dither (medium speed, quality)\\n\");\n#ifdef QUANT_2PASS_SUPPORTED\n  fprintf(stderr, \"  -map FILE      Map to colors used in named image file\\n\");\n#endif\n  fprintf(stderr, \"  -nosmooth      Don't use high-quality upsampling\\n\");\n#ifdef QUANT_1PASS_SUPPORTED\n  fprintf(stderr, \"  -onepass       Use 1-pass quantization (fast, low quality)\\n\");\n#endif\n  fprintf(stderr, \"  -maxmemory N   Maximum memory to use (in kbytes)\\n\");\n  fprintf(stderr, \"  -outfile name  Specify name for output file\\n\");\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\n  fprintf(stderr, \"  -memsrc        Load input file into memory before decompressing\\n\");\n#endif\n\n  fprintf(stderr, \"  -verbose  or  -debug   Emit debug output\\n\");\n  exit(EXIT_FAILURE);\n}\n\n\nLOCAL(int)\nparse_switches (j_decompress_ptr cinfo, int argc, char **argv,\n\t\tint last_file_arg_seen, boolean for_real)\n/* Parse optional switches.\n * Returns argv[] index of first file-name argument (== argc if none).\n * Any file names with indexes <= last_file_arg_seen are ignored;\n * they have presumably been processed in a previous iteration.\n * (Pass 0 for last_file_arg_seen on the first or only iteration.)\n * for_real is FALSE on the first (dummy) pass; we may skip any expensive\n * processing.\n */\n{\n  int argn;\n  char * arg;\n\n  /* Set up default JPEG parameters. */\n  requested_fmt = DEFAULT_FMT;\t/* set default output file format */\n  outfilename = NULL;\n  memsrc = FALSE;\n  cinfo->err->trace_level = 0;\n\n  /* Scan command line options, adjust parameters */\n\n  for (argn = 1; argn < argc; argn++) {\n    arg = argv[argn];\n    if (*arg != '-') {\n      /* Not a switch, must be a file name argument */\n      if (argn <= last_file_arg_seen) {\n\toutfilename = NULL;\t/* -outfile applies to just one input file */\n\tcontinue;\t\t/* ignore this name if previously processed */\n      }\n      break;\t\t\t/* else done parsing switches */\n    }\n    arg++;\t\t\t/* advance past switch marker character */\n\n    if (keymatch(arg, \"bmp\", 1)) {\n      /* BMP output format. */\n      requested_fmt = FMT_BMP;\n\n    } else if (keymatch(arg, \"colors\", 1) || keymatch(arg, \"colours\", 1) ||\n\t       keymatch(arg, \"quantize\", 1) || keymatch(arg, \"quantise\", 1)) {\n      /* Do color quantization. */\n      int val;\n\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (sscanf(argv[argn], \"%d\", &val) != 1)\n\tusage();\n      cinfo->desired_number_of_colors = val;\n      cinfo->quantize_colors = TRUE;\n\n    } else if (keymatch(arg, \"dct\", 2)) {\n      /* Select IDCT algorithm. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (keymatch(argv[argn], \"int\", 1)) {\n\tcinfo->dct_method = JDCT_ISLOW;\n      } else if (keymatch(argv[argn], \"fast\", 2)) {\n\tcinfo->dct_method = JDCT_IFAST;\n      } else if (keymatch(argv[argn], \"float\", 2)) {\n\tcinfo->dct_method = JDCT_FLOAT;\n      } else\n\tusage();\n\n    } else if (keymatch(arg, \"dither\", 2)) {\n      /* Select dithering algorithm. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (keymatch(argv[argn], \"fs\", 2)) {\n\tcinfo->dither_mode = JDITHER_FS;\n      } else if (keymatch(argv[argn], \"none\", 2)) {\n\tcinfo->dither_mode = JDITHER_NONE;\n      } else if (keymatch(argv[argn], \"ordered\", 2)) {\n\tcinfo->dither_mode = JDITHER_ORDERED;\n      } else\n\tusage();\n\n    } else if (keymatch(arg, \"debug\", 1) || keymatch(arg, \"verbose\", 1)) {\n      /* Enable debug printouts. */\n      /* On first -d, print version identification */\n      static boolean printed_version = FALSE;\n\n      if (! printed_version) {\n\tfprintf(stderr, \"%s version %s (build %s)\\n\",\n\t\tPACKAGE_NAME, VERSION, BUILD);\n\tfprintf(stderr, \"%s\\n\\n\", JCOPYRIGHT);\n\tfprintf(stderr, \"Emulating The Independent JPEG Group's software, version %s\\n\\n\",\n\t\tJVERSION);\n\tprinted_version = TRUE;\n      }\n      cinfo->err->trace_level++;\n\n    } else if (keymatch(arg, \"fast\", 1)) {\n      /* Select recommended processing options for quick-and-dirty output. */\n      cinfo->two_pass_quantize = FALSE;\n      cinfo->dither_mode = JDITHER_ORDERED;\n      if (! cinfo->quantize_colors) /* don't override an earlier -colors */\n\tcinfo->desired_number_of_colors = 216;\n      cinfo->dct_method = JDCT_FASTEST;\n      cinfo->do_fancy_upsampling = FALSE;\n\n    } else if (keymatch(arg, \"gif\", 1)) {\n      /* GIF output format. */\n      requested_fmt = FMT_GIF;\n\n    } else if (keymatch(arg, \"grayscale\", 2) || keymatch(arg, \"greyscale\",2)) {\n      /* Force monochrome output. */\n      cinfo->out_color_space = JCS_GRAYSCALE;\n\n    } else if (keymatch(arg, \"rgb\", 2)) {\n      /* Force RGB output. */\n      cinfo->out_color_space = JCS_RGB;\n\n    } else if (keymatch(arg, \"map\", 3)) {\n      /* Quantize to a color map taken from an input file. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (for_real) {\t\t/* too expensive to do twice! */\n#ifdef QUANT_2PASS_SUPPORTED\t/* otherwise can't quantize to supplied map */\n\tFILE * mapfile;\n\n\tif ((mapfile = fopen(argv[argn], READ_BINARY)) == NULL) {\n\t  fprintf(stderr, \"%s: can't open %s\\n\", progname, argv[argn]);\n\t  exit(EXIT_FAILURE);\n\t}\n\tread_color_map(cinfo, mapfile);\n\tfclose(mapfile);\n\tcinfo->quantize_colors = TRUE;\n#else\n\tERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n      }\n\n    } else if (keymatch(arg, \"maxmemory\", 3)) {\n      /* Maximum memory in Kb (or Mb with 'm'). */\n      long lval;\n      char ch = 'x';\n\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (sscanf(argv[argn], \"%ld%c\", &lval, &ch) < 1)\n\tusage();\n      if (ch == 'm' || ch == 'M')\n\tlval *= 1000L;\n      cinfo->mem->max_memory_to_use = lval * 1000L;\n\n    } else if (keymatch(arg, \"nosmooth\", 3)) {\n      /* Suppress fancy upsampling */\n      cinfo->do_fancy_upsampling = FALSE;\n\n    } else if (keymatch(arg, \"onepass\", 3)) {\n      /* Use fast one-pass quantization. */\n      cinfo->two_pass_quantize = FALSE;\n\n    } else if (keymatch(arg, \"os2\", 3)) {\n      /* BMP output format (OS/2 flavor). */\n      requested_fmt = FMT_OS2;\n\n    } else if (keymatch(arg, \"outfile\", 4)) {\n      /* Set output file name. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      outfilename = argv[argn];\t/* save it away for later use */\n\n    } else if (keymatch(arg, \"memsrc\", 2)) {\n      /* Use in-memory source manager */\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\n      memsrc = TRUE;\n#else\n      fprintf(stderr, \"%s: sorry, in-memory source manager was not compiled in\\n\",\n              progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"pnm\", 1) || keymatch(arg, \"ppm\", 1)) {\n      /* PPM/PGM output format. */\n      requested_fmt = FMT_PPM;\n\n    } else if (keymatch(arg, \"rle\", 1)) {\n      /* RLE output format. */\n      requested_fmt = FMT_RLE;\n\n    } else if (keymatch(arg, \"scale\", 1)) {\n      /* Scale the output image by a fraction M/N. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (sscanf(argv[argn], \"%d/%d\",\n\t\t &cinfo->scale_num, &cinfo->scale_denom) != 2)\n\tusage();\n\n    } else if (keymatch(arg, \"targa\", 1)) {\n      /* Targa output format. */\n      requested_fmt = FMT_TARGA;\n\n    } else {\n      usage();\t\t\t/* bogus switch */\n    }\n  }\n\n  return argn;\t\t\t/* return index of next arg (file name) */\n}\n\n\n/*\n * Marker processor for COM and interesting APPn markers.\n * This replaces the library's built-in processor, which just skips the marker.\n * We want to print out the marker as text, to the extent possible.\n * Note this code relies on a non-suspending data source.\n */\n\nLOCAL(unsigned int)\njpeg_getc (j_decompress_ptr cinfo)\n/* Read next byte */\n{\n  struct jpeg_source_mgr * datasrc = cinfo->src;\n\n  if (datasrc->bytes_in_buffer == 0) {\n    if (! (*datasrc->fill_input_buffer) (cinfo))\n      ERREXIT(cinfo, JERR_CANT_SUSPEND);\n  }\n  datasrc->bytes_in_buffer--;\n  return GETJOCTET(*datasrc->next_input_byte++);\n}\n\n\nMETHODDEF(boolean)\nprint_text_marker (j_decompress_ptr cinfo)\n{\n  boolean traceit = (cinfo->err->trace_level >= 1);\n  INT32 length;\n  unsigned int ch;\n  unsigned int lastch = 0;\n\n  length = jpeg_getc(cinfo) << 8;\n  length += jpeg_getc(cinfo);\n  length -= 2;\t\t\t/* discount the length word itself */\n\n  if (traceit) {\n    if (cinfo->unread_marker == JPEG_COM)\n      fprintf(stderr, \"Comment, length %ld:\\n\", (long) length);\n    else\t\t\t/* assume it is an APPn otherwise */\n      fprintf(stderr, \"APP%d, length %ld:\\n\",\n\t      cinfo->unread_marker - JPEG_APP0, (long) length);\n  }\n\n  while (--length >= 0) {\n    ch = jpeg_getc(cinfo);\n    if (traceit) {\n      /* Emit the character in a readable form.\n       * Nonprintables are converted to \\nnn form,\n       * while \\ is converted to \\\\.\n       * Newlines in CR, CR/LF, or LF form will be printed as one newline.\n       */\n      if (ch == '\\r') {\n\tfprintf(stderr, \"\\n\");\n      } else if (ch == '\\n') {\n\tif (lastch != '\\r')\n\t  fprintf(stderr, \"\\n\");\n      } else if (ch == '\\\\') {\n\tfprintf(stderr, \"\\\\\\\\\");\n      } else if (isprint(ch)) {\n\tputc(ch, stderr);\n      } else {\n\tfprintf(stderr, \"\\\\%03o\", ch);\n      }\n      lastch = ch;\n    }\n  }\n\n  if (traceit)\n    fprintf(stderr, \"\\n\");\n\n  return TRUE;\n}\n\n\n/*\n * The main program.\n */\n\nint\nmain (int argc, char **argv)\n{\n  struct jpeg_decompress_struct cinfo;\n  struct jpeg_error_mgr jerr;\n#ifdef PROGRESS_REPORT\n  struct cdjpeg_progress_mgr progress;\n#endif\n  int file_index;\n  djpeg_dest_ptr dest_mgr = NULL;\n  FILE * input_file;\n  FILE * output_file;\n  unsigned char *inbuffer = NULL;\n  unsigned long insize = 0;\n  JDIMENSION num_scanlines;\n\n  /* On Mac, fetch a command line. */\n#ifdef USE_CCOMMAND\n  argc = ccommand(&argv);\n#endif\n\n  progname = argv[0];\n  if (progname == NULL || progname[0] == 0)\n    progname = \"djpeg\";\t\t/* in case C library doesn't provide it */\n\n  /* Initialize the JPEG decompression object with default error handling. */\n  cinfo.err = jpeg_std_error(&jerr);\n  jpeg_create_decompress(&cinfo);\n  /* Add some application-specific error messages (from cderror.h) */\n  jerr.addon_message_table = cdjpeg_message_table;\n  jerr.first_addon_message = JMSG_FIRSTADDONCODE;\n  jerr.last_addon_message = JMSG_LASTADDONCODE;\n\n  /* Insert custom marker processor for COM and APP12.\n   * APP12 is used by some digital camera makers for textual info,\n   * so we provide the ability to display it as text.\n   * If you like, additional APPn marker types can be selected for display,\n   * but don't try to override APP0 or APP14 this way (see libjpeg.txt).\n   */\n  jpeg_set_marker_processor(&cinfo, JPEG_COM, print_text_marker);\n  jpeg_set_marker_processor(&cinfo, JPEG_APP0+12, print_text_marker);\n\n  /* Now safe to enable signal catcher. */\n#ifdef NEED_SIGNAL_CATCHER\n  enable_signal_catcher((j_common_ptr) &cinfo);\n#endif\n\n  /* Scan command line to find file names. */\n  /* It is convenient to use just one switch-parsing routine, but the switch\n   * values read here are ignored; we will rescan the switches after opening\n   * the input file.\n   * (Exception: tracing level set here controls verbosity for COM markers\n   * found during jpeg_read_header...)\n   */\n\n  file_index = parse_switches(&cinfo, argc, argv, 0, FALSE);\n\n#ifdef TWO_FILE_COMMANDLINE\n  /* Must have either -outfile switch or explicit output file name */\n  if (outfilename == NULL) {\n    if (file_index != argc-2) {\n      fprintf(stderr, \"%s: must name one input and one output file\\n\",\n\t      progname);\n      usage();\n    }\n    outfilename = argv[file_index+1];\n  } else {\n    if (file_index != argc-1) {\n      fprintf(stderr, \"%s: must name one input and one output file\\n\",\n\t      progname);\n      usage();\n    }\n  }\n#else\n  /* Unix style: expect zero or one file name */\n  if (file_index < argc-1) {\n    fprintf(stderr, \"%s: only one input file\\n\", progname);\n    usage();\n  }\n#endif /* TWO_FILE_COMMANDLINE */\n\n  /* Open the input file. */\n  if (file_index < argc) {\n    if ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s\\n\", progname, argv[file_index]);\n      exit(EXIT_FAILURE);\n    }\n  } else {\n    /* default input file is stdin */\n    input_file = read_stdin();\n  }\n\n  /* Open the output file. */\n  if (outfilename != NULL) {\n    if ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s\\n\", progname, outfilename);\n      exit(EXIT_FAILURE);\n    }\n  } else {\n    /* default output file is stdout */\n    output_file = write_stdout();\n  }\n\n#ifdef PROGRESS_REPORT\n  start_progress_monitor((j_common_ptr) &cinfo, &progress);\n#endif\n\n  /* Specify data source for decompression */\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\n  if (memsrc) {\n    size_t nbytes;\n    do {\n      inbuffer = (unsigned char *)realloc(inbuffer, insize + INPUT_BUF_SIZE);\n      if (inbuffer == NULL) {\n        fprintf(stderr, \"%s: memory allocation failure\\n\", progname);\n        exit(EXIT_FAILURE);\n      }\n      nbytes = JFREAD(input_file, &inbuffer[insize], INPUT_BUF_SIZE);\n      if (nbytes < INPUT_BUF_SIZE && ferror(input_file)) {\n        if (file_index < argc)\n          fprintf(stderr, \"%s: can't read from %s\\n\", progname,\n                  argv[file_index]);\n        else\n          fprintf(stderr, \"%s: can't read from stdin\\n\", progname);\n      }\n      insize += (unsigned long)nbytes;\n    } while (nbytes == INPUT_BUF_SIZE);\n    fprintf(stderr, \"Compressed size:  %lu bytes\\n\", insize);\n    jpeg_mem_src(&cinfo, inbuffer, insize);\n  } else\n#endif\n    jpeg_stdio_src(&cinfo, input_file);\n\n  /* Read file header, set default decompression parameters */\n  (void) jpeg_read_header(&cinfo, TRUE);\n\n  /* Adjust default decompression parameters by re-parsing the options */\n  file_index = parse_switches(&cinfo, argc, argv, 0, TRUE);\n\n  /* Initialize the output module now to let it override any crucial\n   * option settings (for instance, GIF wants to force color quantization).\n   */\n  switch (requested_fmt) {\n#ifdef BMP_SUPPORTED\n  case FMT_BMP:\n    dest_mgr = jinit_write_bmp(&cinfo, FALSE);\n    break;\n  case FMT_OS2:\n    dest_mgr = jinit_write_bmp(&cinfo, TRUE);\n    break;\n#endif\n#ifdef GIF_SUPPORTED\n  case FMT_GIF:\n    dest_mgr = jinit_write_gif(&cinfo);\n    break;\n#endif\n#ifdef PPM_SUPPORTED\n  case FMT_PPM:\n    dest_mgr = jinit_write_ppm(&cinfo);\n    break;\n#endif\n#ifdef RLE_SUPPORTED\n  case FMT_RLE:\n    dest_mgr = jinit_write_rle(&cinfo);\n    break;\n#endif\n#ifdef TARGA_SUPPORTED\n  case FMT_TARGA:\n    dest_mgr = jinit_write_targa(&cinfo);\n    break;\n#endif\n  default:\n    ERREXIT(&cinfo, JERR_UNSUPPORTED_FORMAT);\n    break;\n  }\n  dest_mgr->output_file = output_file;\n\n  /* Start decompressor */\n  (void) jpeg_start_decompress(&cinfo);\n\n  /* Write output file header */\n  (*dest_mgr->start_output) (&cinfo, dest_mgr);\n\n  /* Process data */\n  while (cinfo.output_scanline < cinfo.output_height) {\n    num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer,\n\t\t\t\t\tdest_mgr->buffer_height);\n    (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);\n  }\n\n#ifdef PROGRESS_REPORT\n  /* Hack: count final pass as done in case finish_output does an extra pass.\n   * The library won't have updated completed_passes.\n   */\n  progress.pub.completed_passes = progress.pub.total_passes;\n#endif\n\n  /* Finish decompression and release memory.\n   * I must do it in this order because output module has allocated memory\n   * of lifespan JPOOL_IMAGE; it needs to finish before releasing memory.\n   */\n  (*dest_mgr->finish_output) (&cinfo, dest_mgr);\n  (void) jpeg_finish_decompress(&cinfo);\n  jpeg_destroy_decompress(&cinfo);\n\n  /* Close files, if we opened them */\n  if (input_file != stdin)\n    fclose(input_file);\n  if (output_file != stdout)\n    fclose(output_file);\n\n#ifdef PROGRESS_REPORT\n  end_progress_monitor((j_common_ptr) &cinfo);\n#endif\n\n  if (memsrc && inbuffer != NULL)\n    free(inbuffer);\n\n  /* All done. */\n  exit(jerr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS);\n  return 0;\t\t\t/* suppress no-return-value warnings */\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/doxygen.config",
    "content": "PROJECT_NAME = TurboJPEG\nPROJECT_NUMBER = 1.2.1\nOUTPUT_DIRECTORY = doc/\nUSE_WINDOWS_ENCODING = NO\nOPTIMIZE_OUTPUT_FOR_C = YES\nWARN_NO_PARAMDOC = YES\nGENERATE_LATEX = NO\nFILE_PATTERNS = turbojpeg.h\nHIDE_UNDOC_MEMBERS = YES\nVERBATIM_HEADERS = NO\nEXTRACT_STATIC = YES\nJAVADOC_AUTOBRIEF = YES\nMAX_INITIALIZER_LINES = 0\nALWAYS_DETAILED_SEC = YES\nHTML_TIMESTAMP = NO\n"
  },
  {
    "path": "ext/libjpeg-turbo/example.c",
    "content": "/*\n * example.c\n *\n * This file illustrates how to use the IJG code as a subroutine library\n * to read or write JPEG image files.  You should look at this code in\n * conjunction with the documentation file libjpeg.txt.\n *\n * This code will not do anything useful as-is, but it may be helpful as a\n * skeleton for constructing routines that call the JPEG library.  \n *\n * We present these routines in the same coding style used in the JPEG code\n * (ANSI function definitions, etc); but you are of course free to code your\n * routines in a different style if you prefer.\n */\n\n#include <stdio.h>\n\n/*\n * Include file for users of JPEG library.\n * You will need to have included system headers that define at least\n * the typedefs FILE and size_t before you can include jpeglib.h.\n * (stdio.h is sufficient on ANSI-conforming systems.)\n * You may also wish to include \"jerror.h\".\n */\n\n#include \"jpeglib.h\"\n\n/*\n * <setjmp.h> is used for the optional error recovery mechanism shown in\n * the second part of the example.\n */\n\n#include <setjmp.h>\n\n\n\n/******************** JPEG COMPRESSION SAMPLE INTERFACE *******************/\n\n/* This half of the example shows how to feed data into the JPEG compressor.\n * We present a minimal version that does not worry about refinements such\n * as error recovery (the JPEG code will just exit() if it gets an error).\n */\n\n\n/*\n * IMAGE DATA FORMATS:\n *\n * The standard input image format is a rectangular array of pixels, with\n * each pixel having the same number of \"component\" values (color channels).\n * Each pixel row is an array of JSAMPLEs (which typically are unsigned chars).\n * If you are working with color data, then the color values for each pixel\n * must be adjacent in the row; for example, R,G,B,R,G,B,R,G,B,... for 24-bit\n * RGB color.\n *\n * For this example, we'll assume that this data structure matches the way\n * our application has stored the image in memory, so we can just pass a\n * pointer to our image buffer.  In particular, let's say that the image is\n * RGB color and is described by:\n */\n\nextern JSAMPLE * image_buffer;\t/* Points to large array of R,G,B-order data */\nextern int image_height;\t/* Number of rows in image */\nextern int image_width;\t\t/* Number of columns in image */\n\n\n/*\n * Sample routine for JPEG compression.  We assume that the target file name\n * and a compression quality factor are passed in.\n */\n\nGLOBAL(void)\nwrite_JPEG_file (char * filename, int quality)\n{\n  /* This struct contains the JPEG compression parameters and pointers to\n   * working space (which is allocated as needed by the JPEG library).\n   * It is possible to have several such structures, representing multiple\n   * compression/decompression processes, in existence at once.  We refer\n   * to any one struct (and its associated working data) as a \"JPEG object\".\n   */\n  struct jpeg_compress_struct cinfo;\n  /* This struct represents a JPEG error handler.  It is declared separately\n   * because applications often want to supply a specialized error handler\n   * (see the second half of this file for an example).  But here we just\n   * take the easy way out and use the standard error handler, which will\n   * print a message on stderr and call exit() if compression fails.\n   * Note that this struct must live as long as the main JPEG parameter\n   * struct, to avoid dangling-pointer problems.\n   */\n  struct jpeg_error_mgr jerr;\n  /* More stuff */\n  FILE * outfile;\t\t/* target file */\n  JSAMPROW row_pointer[1];\t/* pointer to JSAMPLE row[s] */\n  int row_stride;\t\t/* physical row width in image buffer */\n\n  /* Step 1: allocate and initialize JPEG compression object */\n\n  /* We have to set up the error handler first, in case the initialization\n   * step fails.  (Unlikely, but it could happen if you are out of memory.)\n   * This routine fills in the contents of struct jerr, and returns jerr's\n   * address which we place into the link field in cinfo.\n   */\n  cinfo.err = jpeg_std_error(&jerr);\n  /* Now we can initialize the JPEG compression object. */\n  jpeg_create_compress(&cinfo);\n\n  /* Step 2: specify data destination (eg, a file) */\n  /* Note: steps 2 and 3 can be done in either order. */\n\n  /* Here we use the library-supplied code to send compressed data to a\n   * stdio stream.  You can also write your own code to do something else.\n   * VERY IMPORTANT: use \"b\" option to fopen() if you are on a machine that\n   * requires it in order to write binary files.\n   */\n  if ((outfile = fopen(filename, \"wb\")) == NULL) {\n    fprintf(stderr, \"can't open %s\\n\", filename);\n    exit(1);\n  }\n  jpeg_stdio_dest(&cinfo, outfile);\n\n  /* Step 3: set parameters for compression */\n\n  /* First we supply a description of the input image.\n   * Four fields of the cinfo struct must be filled in:\n   */\n  cinfo.image_width = image_width; \t/* image width and height, in pixels */\n  cinfo.image_height = image_height;\n  cinfo.input_components = 3;\t\t/* # of color components per pixel */\n  cinfo.in_color_space = JCS_RGB; \t/* colorspace of input image */\n  /* Now use the library's routine to set default compression parameters.\n   * (You must set at least cinfo.in_color_space before calling this,\n   * since the defaults depend on the source color space.)\n   */\n  jpeg_set_defaults(&cinfo);\n  /* Now you can set any non-default parameters you wish to.\n   * Here we just illustrate the use of quality (quantization table) scaling:\n   */\n  jpeg_set_quality(&cinfo, quality, TRUE /* limit to baseline-JPEG values */);\n\n  /* Step 4: Start compressor */\n\n  /* TRUE ensures that we will write a complete interchange-JPEG file.\n   * Pass TRUE unless you are very sure of what you're doing.\n   */\n  jpeg_start_compress(&cinfo, TRUE);\n\n  /* Step 5: while (scan lines remain to be written) */\n  /*           jpeg_write_scanlines(...); */\n\n  /* Here we use the library's state variable cinfo.next_scanline as the\n   * loop counter, so that we don't have to keep track ourselves.\n   * To keep things simple, we pass one scanline per call; you can pass\n   * more if you wish, though.\n   */\n  row_stride = image_width * 3;\t/* JSAMPLEs per row in image_buffer */\n\n  while (cinfo.next_scanline < cinfo.image_height) {\n    /* jpeg_write_scanlines expects an array of pointers to scanlines.\n     * Here the array is only one element long, but you could pass\n     * more than one scanline at a time if that's more convenient.\n     */\n    row_pointer[0] = & image_buffer[cinfo.next_scanline * row_stride];\n    (void) jpeg_write_scanlines(&cinfo, row_pointer, 1);\n  }\n\n  /* Step 6: Finish compression */\n\n  jpeg_finish_compress(&cinfo);\n  /* After finish_compress, we can close the output file. */\n  fclose(outfile);\n\n  /* Step 7: release JPEG compression object */\n\n  /* This is an important step since it will release a good deal of memory. */\n  jpeg_destroy_compress(&cinfo);\n\n  /* And we're done! */\n}\n\n\n/*\n * SOME FINE POINTS:\n *\n * In the above loop, we ignored the return value of jpeg_write_scanlines,\n * which is the number of scanlines actually written.  We could get away\n * with this because we were only relying on the value of cinfo.next_scanline,\n * which will be incremented correctly.  If you maintain additional loop\n * variables then you should be careful to increment them properly.\n * Actually, for output to a stdio stream you needn't worry, because\n * then jpeg_write_scanlines will write all the lines passed (or else exit\n * with a fatal error).  Partial writes can only occur if you use a data\n * destination module that can demand suspension of the compressor.\n * (If you don't know what that's for, you don't need it.)\n *\n * If the compressor requires full-image buffers (for entropy-coding\n * optimization or a multi-scan JPEG file), it will create temporary\n * files for anything that doesn't fit within the maximum-memory setting.\n * (Note that temp files are NOT needed if you use the default parameters.)\n * On some systems you may need to set up a signal handler to ensure that\n * temporary files are deleted if the program is interrupted.  See libjpeg.txt.\n *\n * Scanlines MUST be supplied in top-to-bottom order if you want your JPEG\n * files to be compatible with everyone else's.  If you cannot readily read\n * your data in that order, you'll need an intermediate array to hold the\n * image.  See rdtarga.c or rdbmp.c for examples of handling bottom-to-top\n * source data using the JPEG code's internal virtual-array mechanisms.\n */\n\n\n\n/******************** JPEG DECOMPRESSION SAMPLE INTERFACE *******************/\n\n/* This half of the example shows how to read data from the JPEG decompressor.\n * It's a bit more refined than the above, in that we show:\n *   (a) how to modify the JPEG library's standard error-reporting behavior;\n *   (b) how to allocate workspace using the library's memory manager.\n *\n * Just to make this example a little different from the first one, we'll\n * assume that we do not intend to put the whole image into an in-memory\n * buffer, but to send it line-by-line someplace else.  We need a one-\n * scanline-high JSAMPLE array as a work buffer, and we will let the JPEG\n * memory manager allocate it for us.  This approach is actually quite useful\n * because we don't need to remember to deallocate the buffer separately: it\n * will go away automatically when the JPEG object is cleaned up.\n */\n\n\n/*\n * ERROR HANDLING:\n *\n * The JPEG library's standard error handler (jerror.c) is divided into\n * several \"methods\" which you can override individually.  This lets you\n * adjust the behavior without duplicating a lot of code, which you might\n * have to update with each future release.\n *\n * Our example here shows how to override the \"error_exit\" method so that\n * control is returned to the library's caller when a fatal error occurs,\n * rather than calling exit() as the standard error_exit method does.\n *\n * We use C's setjmp/longjmp facility to return control.  This means that the\n * routine which calls the JPEG library must first execute a setjmp() call to\n * establish the return point.  We want the replacement error_exit to do a\n * longjmp().  But we need to make the setjmp buffer accessible to the\n * error_exit routine.  To do this, we make a private extension of the\n * standard JPEG error handler object.  (If we were using C++, we'd say we\n * were making a subclass of the regular error handler.)\n *\n * Here's the extended error handler struct:\n */\n\nstruct my_error_mgr {\n  struct jpeg_error_mgr pub;\t/* \"public\" fields */\n\n  jmp_buf setjmp_buffer;\t/* for return to caller */\n};\n\ntypedef struct my_error_mgr * my_error_ptr;\n\n/*\n * Here's the routine that will replace the standard error_exit method:\n */\n\nMETHODDEF(void)\nmy_error_exit (j_common_ptr cinfo)\n{\n  /* cinfo->err really points to a my_error_mgr struct, so coerce pointer */\n  my_error_ptr myerr = (my_error_ptr) cinfo->err;\n\n  /* Always display the message. */\n  /* We could postpone this until after returning, if we chose. */\n  (*cinfo->err->output_message) (cinfo);\n\n  /* Return control to the setjmp point */\n  longjmp(myerr->setjmp_buffer, 1);\n}\n\n\n/*\n * Sample routine for JPEG decompression.  We assume that the source file name\n * is passed in.  We want to return 1 on success, 0 on error.\n */\n\n\nGLOBAL(int)\nread_JPEG_file (char * filename)\n{\n  /* This struct contains the JPEG decompression parameters and pointers to\n   * working space (which is allocated as needed by the JPEG library).\n   */\n  struct jpeg_decompress_struct cinfo;\n  /* We use our private extension JPEG error handler.\n   * Note that this struct must live as long as the main JPEG parameter\n   * struct, to avoid dangling-pointer problems.\n   */\n  struct my_error_mgr jerr;\n  /* More stuff */\n  FILE * infile;\t\t/* source file */\n  JSAMPARRAY buffer;\t\t/* Output row buffer */\n  int row_stride;\t\t/* physical row width in output buffer */\n\n  /* In this example we want to open the input file before doing anything else,\n   * so that the setjmp() error recovery below can assume the file is open.\n   * VERY IMPORTANT: use \"b\" option to fopen() if you are on a machine that\n   * requires it in order to read binary files.\n   */\n\n  if ((infile = fopen(filename, \"rb\")) == NULL) {\n    fprintf(stderr, \"can't open %s\\n\", filename);\n    return 0;\n  }\n\n  /* Step 1: allocate and initialize JPEG decompression object */\n\n  /* We set up the normal JPEG error routines, then override error_exit. */\n  cinfo.err = jpeg_std_error(&jerr.pub);\n  jerr.pub.error_exit = my_error_exit;\n  /* Establish the setjmp return context for my_error_exit to use. */\n  if (setjmp(jerr.setjmp_buffer)) {\n    /* If we get here, the JPEG code has signaled an error.\n     * We need to clean up the JPEG object, close the input file, and return.\n     */\n    jpeg_destroy_decompress(&cinfo);\n    fclose(infile);\n    return 0;\n  }\n  /* Now we can initialize the JPEG decompression object. */\n  jpeg_create_decompress(&cinfo);\n\n  /* Step 2: specify data source (eg, a file) */\n\n  jpeg_stdio_src(&cinfo, infile);\n\n  /* Step 3: read file parameters with jpeg_read_header() */\n\n  (void) jpeg_read_header(&cinfo, TRUE);\n  /* We can ignore the return value from jpeg_read_header since\n   *   (a) suspension is not possible with the stdio data source, and\n   *   (b) we passed TRUE to reject a tables-only JPEG file as an error.\n   * See libjpeg.txt for more info.\n   */\n\n  /* Step 4: set parameters for decompression */\n\n  /* In this example, we don't need to change any of the defaults set by\n   * jpeg_read_header(), so we do nothing here.\n   */\n\n  /* Step 5: Start decompressor */\n\n  (void) jpeg_start_decompress(&cinfo);\n  /* We can ignore the return value since suspension is not possible\n   * with the stdio data source.\n   */\n\n  /* We may need to do some setup of our own at this point before reading\n   * the data.  After jpeg_start_decompress() we have the correct scaled\n   * output image dimensions available, as well as the output colormap\n   * if we asked for color quantization.\n   * In this example, we need to make an output work buffer of the right size.\n   */ \n  /* JSAMPLEs per row in output buffer */\n  row_stride = cinfo.output_width * cinfo.output_components;\n  /* Make a one-row-high sample array that will go away when done with image */\n  buffer = (*cinfo.mem->alloc_sarray)\n\t\t((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1);\n\n  /* Step 6: while (scan lines remain to be read) */\n  /*           jpeg_read_scanlines(...); */\n\n  /* Here we use the library's state variable cinfo.output_scanline as the\n   * loop counter, so that we don't have to keep track ourselves.\n   */\n  while (cinfo.output_scanline < cinfo.output_height) {\n    /* jpeg_read_scanlines expects an array of pointers to scanlines.\n     * Here the array is only one element long, but you could ask for\n     * more than one scanline at a time if that's more convenient.\n     */\n    (void) jpeg_read_scanlines(&cinfo, buffer, 1);\n    /* Assume put_scanline_someplace wants a pointer and sample count. */\n    put_scanline_someplace(buffer[0], row_stride);\n  }\n\n  /* Step 7: Finish decompression */\n\n  (void) jpeg_finish_decompress(&cinfo);\n  /* We can ignore the return value since suspension is not possible\n   * with the stdio data source.\n   */\n\n  /* Step 8: Release JPEG decompression object */\n\n  /* This is an important step since it will release a good deal of memory. */\n  jpeg_destroy_decompress(&cinfo);\n\n  /* After finish_decompress, we can close the input file.\n   * Here we postpone it until after no more JPEG errors are possible,\n   * so as to simplify the setjmp error logic above.  (Actually, I don't\n   * think that jpeg_destroy can do an error exit, but why assume anything...)\n   */\n  fclose(infile);\n\n  /* At this point you may want to check to see whether any corrupt-data\n   * warnings occurred (test whether jerr.pub.num_warnings is nonzero).\n   */\n\n  /* And we're done! */\n  return 1;\n}\n\n\n/*\n * SOME FINE POINTS:\n *\n * In the above code, we ignored the return value of jpeg_read_scanlines,\n * which is the number of scanlines actually read.  We could get away with\n * this because we asked for only one line at a time and we weren't using\n * a suspending data source.  See libjpeg.txt for more info.\n *\n * We cheated a bit by calling alloc_sarray() after jpeg_start_decompress();\n * we should have done it beforehand to ensure that the space would be\n * counted against the JPEG max_memory setting.  In some systems the above\n * code would risk an out-of-memory error.  However, in general we don't\n * know the output image dimensions before jpeg_start_decompress(), unless we\n * call jpeg_calc_output_dimensions().  See libjpeg.txt for more about this.\n *\n * Scanlines are returned in the same order as they appear in the JPEG file,\n * which is standardly top-to-bottom.  If you must emit data bottom-to-top,\n * you can use one of the virtual arrays provided by the JPEG memory manager\n * to invert the data.  See wrbmp.c for an example.\n *\n * As with compression, some operating modes may require temporary files.\n * On some systems you may need to set up a signal handler to ensure that\n * temporary files are deleted if the program is interrupted.  See libjpeg.txt.\n */\n"
  },
  {
    "path": "ext/libjpeg-turbo/install-sh",
    "content": "#!/bin/sh\n# install - install a program, script, or datafile\n\nscriptversion=2004-09-10.20\n\n# This originates from X11R5 (mit/util/scripts/install.sh), which was\n# later released in X11R6 (xc/config/util/install.sh) with the\n# following copyright and license.\n#\n# Copyright (C) 1994 X Consortium\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to\n# deal in the Software without restriction, including without limitation the\n# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n# sell copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\n# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\n# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-\n# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n# Except as contained in this notice, the name of the X Consortium shall not\n# be used in advertising or otherwise to promote the sale, use or other deal-\n# ings in this Software without prior written authorization from the X Consor-\n# tium.\n#\n#\n# FSF changes to this file are in the public domain.\n#\n# Calling this script install-sh is preferred over install.sh, to prevent\n# `make' implicit rules from creating a file called install from it\n# when there is no Makefile.\n#\n# This script is compatible with the BSD install script, but was written\n# from scratch.  It can only install one file at a time, a restriction\n# shared with many OS's install programs.\n\n# set DOITPROG to echo to test this script\n\n# Don't use :- since 4.3BSD and earlier shells don't like it.\ndoit=\"${DOITPROG-}\"\n\n# put in absolute paths if you don't have them in your path; or use env. vars.\n\nmvprog=\"${MVPROG-mv}\"\ncpprog=\"${CPPROG-cp}\"\nchmodprog=\"${CHMODPROG-chmod}\"\nchownprog=\"${CHOWNPROG-chown}\"\nchgrpprog=\"${CHGRPPROG-chgrp}\"\nstripprog=\"${STRIPPROG-strip}\"\nrmprog=\"${RMPROG-rm}\"\nmkdirprog=\"${MKDIRPROG-mkdir}\"\n\nchmodcmd=\"$chmodprog 0755\"\nchowncmd=\nchgrpcmd=\nstripcmd=\nrmcmd=\"$rmprog -f\"\nmvcmd=\"$mvprog\"\nsrc=\ndst=\ndir_arg=\ndstarg=\nno_target_directory=\n\nusage=\"Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE\n   or: $0 [OPTION]... SRCFILES... DIRECTORY\n   or: $0 [OPTION]... -t DIRECTORY SRCFILES...\n   or: $0 [OPTION]... -d DIRECTORIES...\n\nIn the 1st form, copy SRCFILE to DSTFILE.\nIn the 2nd and 3rd, copy all SRCFILES to DIRECTORY.\nIn the 4th, create DIRECTORIES.\n\nOptions:\n-c         (ignored)\n-d         create directories instead of installing files.\n-g GROUP   $chgrpprog installed files to GROUP.\n-m MODE    $chmodprog installed files to MODE.\n-o USER    $chownprog installed files to USER.\n-s         $stripprog installed files.\n-t DIRECTORY  install into DIRECTORY.\n-T         report an error if DSTFILE is a directory.\n--help     display this help and exit.\n--version  display version info and exit.\n\nEnvironment variables override the default commands:\n  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG\n\"\n\nwhile test -n \"$1\"; do\n  case $1 in\n    -c) shift\n        continue;;\n\n    -d) dir_arg=true\n        shift\n        continue;;\n\n    -g) chgrpcmd=\"$chgrpprog $2\"\n        shift\n        shift\n        continue;;\n\n    --help) echo \"$usage\"; exit 0;;\n\n    -m) chmodcmd=\"$chmodprog $2\"\n        shift\n        shift\n        continue;;\n\n    -o) chowncmd=\"$chownprog $2\"\n        shift\n        shift\n        continue;;\n\n    -s) stripcmd=$stripprog\n        shift\n        continue;;\n\n    -t) dstarg=$2\n\tshift\n\tshift\n\tcontinue;;\n\n    -T) no_target_directory=true\n\tshift\n\tcontinue;;\n\n    --version) echo \"$0 $scriptversion\"; exit 0;;\n\n    *)  # When -d is used, all remaining arguments are directories to create.\n\t# When -t is used, the destination is already specified.\n\ttest -n \"$dir_arg$dstarg\" && break\n        # Otherwise, the last argument is the destination.  Remove it from $@.\n\tfor arg\n\tdo\n          if test -n \"$dstarg\"; then\n\t    # $@ is not empty: it contains at least $arg.\n\t    set fnord \"$@\" \"$dstarg\"\n\t    shift # fnord\n\t  fi\n\t  shift # arg\n\t  dstarg=$arg\n\tdone\n\tbreak;;\n  esac\ndone\n\nif test -z \"$1\"; then\n  if test -z \"$dir_arg\"; then\n    echo \"$0: no input file specified.\" >&2\n    exit 1\n  fi\n  # It's OK to call `install-sh -d' without argument.\n  # This can happen when creating conditional directories.\n  exit 0\nfi\n\nfor src\ndo\n  # Protect names starting with `-'.\n  case $src in\n    -*) src=./$src ;;\n  esac\n\n  if test -n \"$dir_arg\"; then\n    dst=$src\n    src=\n\n    if test -d \"$dst\"; then\n      mkdircmd=:\n      chmodcmd=\n    else\n      mkdircmd=$mkdirprog\n    fi\n  else\n    # Waiting for this to be detected by the \"$cpprog $src $dsttmp\" command\n    # might cause directories to be created, which would be especially bad\n    # if $src (and thus $dsttmp) contains '*'.\n    if test ! -f \"$src\" && test ! -d \"$src\"; then\n      echo \"$0: $src does not exist.\" >&2\n      exit 1\n    fi\n\n    if test -z \"$dstarg\"; then\n      echo \"$0: no destination specified.\" >&2\n      exit 1\n    fi\n\n    dst=$dstarg\n    # Protect names starting with `-'.\n    case $dst in\n      -*) dst=./$dst ;;\n    esac\n\n    # If destination is a directory, append the input filename; won't work\n    # if double slashes aren't ignored.\n    if test -d \"$dst\"; then\n      if test -n \"$no_target_directory\"; then\n\techo \"$0: $dstarg: Is a directory\" >&2\n\texit 1\n      fi\n      dst=$dst/`basename \"$src\"`\n    fi\n  fi\n\n  # This sed command emulates the dirname command.\n  dstdir=`echo \"$dst\" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`\n\n  # Make sure that the destination directory exists.\n\n  # Skip lots of stat calls in the usual case.\n  if test ! -d \"$dstdir\"; then\n    defaultIFS='\n\t '\n    IFS=\"${IFS-$defaultIFS}\"\n\n    oIFS=$IFS\n    # Some sh's can't handle IFS=/ for some reason.\n    IFS='%'\n    set - `echo \"$dstdir\" | sed -e 's@/@%@g' -e 's@^%@/@'`\n    IFS=$oIFS\n\n    pathcomp=\n\n    while test $# -ne 0 ; do\n      pathcomp=$pathcomp$1\n      shift\n      if test ! -d \"$pathcomp\"; then\n        $mkdirprog \"$pathcomp\"\n\t# mkdir can fail with a `File exist' error in case several\n\t# install-sh are creating the directory concurrently.  This\n\t# is OK.\n\ttest -d \"$pathcomp\" || exit\n      fi\n      pathcomp=$pathcomp/\n    done\n  fi\n\n  if test -n \"$dir_arg\"; then\n    $doit $mkdircmd \"$dst\" \\\n      && { test -z \"$chowncmd\" || $doit $chowncmd \"$dst\"; } \\\n      && { test -z \"$chgrpcmd\" || $doit $chgrpcmd \"$dst\"; } \\\n      && { test -z \"$stripcmd\" || $doit $stripcmd \"$dst\"; } \\\n      && { test -z \"$chmodcmd\" || $doit $chmodcmd \"$dst\"; }\n\n  else\n    dstfile=`basename \"$dst\"`\n\n    # Make a couple of temp file names in the proper directory.\n    dsttmp=$dstdir/_inst.$$_\n    rmtmp=$dstdir/_rm.$$_\n\n    # Trap to clean up those temp files at exit.\n    trap 'ret=$?; rm -f \"$dsttmp\" \"$rmtmp\" && exit $ret' 0\n    trap '(exit $?); exit' 1 2 13 15\n\n    # Copy the file name to the temp name.\n    $doit $cpprog \"$src\" \"$dsttmp\" &&\n\n    # and set any options; do chmod last to preserve setuid bits.\n    #\n    # If any of these fail, we abort the whole thing.  If we want to\n    # ignore errors from any of these, just make sure not to ignore\n    # errors from the above \"$doit $cpprog $src $dsttmp\" command.\n    #\n    { test -z \"$chowncmd\" || $doit $chowncmd \"$dsttmp\"; } \\\n      && { test -z \"$chgrpcmd\" || $doit $chgrpcmd \"$dsttmp\"; } \\\n      && { test -z \"$stripcmd\" || $doit $stripcmd \"$dsttmp\"; } \\\n      && { test -z \"$chmodcmd\" || $doit $chmodcmd \"$dsttmp\"; } &&\n\n    # Now rename the file to the real destination.\n    { $doit $mvcmd -f \"$dsttmp\" \"$dstdir/$dstfile\" 2>/dev/null \\\n      || {\n\t   # The rename failed, perhaps because mv can't rename something else\n\t   # to itself, or perhaps because mv is so ancient that it does not\n\t   # support -f.\n\n\t   # Now remove or move aside any old file at destination location.\n\t   # We try this two ways since rm can't unlink itself on some\n\t   # systems and the destination file might be busy for other\n\t   # reasons.  In this case, the final cleanup might fail but the new\n\t   # file should still install successfully.\n\t   {\n\t     if test -f \"$dstdir/$dstfile\"; then\n\t       $doit $rmcmd -f \"$dstdir/$dstfile\" 2>/dev/null \\\n\t       || $doit $mvcmd -f \"$dstdir/$dstfile\" \"$rmtmp\" 2>/dev/null \\\n\t       || {\n\t\t echo \"$0: cannot unlink or rename $dstdir/$dstfile\" >&2\n\t\t (exit 1); exit\n\t       }\n\t     else\n\t       :\n\t     fi\n\t   } &&\n\n\t   # Now rename the file to the real destination.\n\t   $doit $mvcmd \"$dsttmp\" \"$dstdir/$dstfile\"\n\t }\n    }\n  fi || { (exit 1); exit; }\ndone\n\n# The final little trick to \"correctly\" pass the exit status to the exit trap.\n{\n  (exit 0); exit\n}\n\n# Local variables:\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"scriptversion=\"\n# time-stamp-format: \"%:y-%02m-%02d.%02H\"\n# time-stamp-end: \"$\"\n# End:\n"
  },
  {
    "path": "ext/libjpeg-turbo/jaricom.c",
    "content": "/*\n * jaricom.c\n *\n * Developed 1997-2009 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains probability estimation tables for common use in\n * arithmetic entropy encoding and decoding routines.\n *\n * This data represents Table D.2 in the JPEG spec (ISO/IEC IS 10918-1\n * and CCITT Recommendation ITU-T T.81) and Table 24 in the JBIG spec\n * (ISO/IEC IS 11544 and CCITT Recommendation ITU-T T.82).\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n/* The following #define specifies the packing of the four components\n * into the compact INT32 representation.\n * Note that this formula must match the actual arithmetic encoder\n * and decoder implementation.  The implementation has to be changed\n * if this formula is changed.\n * The current organization is leaned on Markus Kuhn's JBIG\n * implementation (jbig_tab.c).\n */\n\n#define V(i,a,b,c,d) (((INT32)a << 16) | ((INT32)c << 8) | ((INT32)d << 7) | b)\n\nconst INT32 jpeg_aritab[113+1] = {\n/*\n * Index, Qe_Value, Next_Index_LPS, Next_Index_MPS, Switch_MPS\n */\n  V(   0, 0x5a1d,   1,   1, 1 ),\n  V(   1, 0x2586,  14,   2, 0 ),\n  V(   2, 0x1114,  16,   3, 0 ),\n  V(   3, 0x080b,  18,   4, 0 ),\n  V(   4, 0x03d8,  20,   5, 0 ),\n  V(   5, 0x01da,  23,   6, 0 ),\n  V(   6, 0x00e5,  25,   7, 0 ),\n  V(   7, 0x006f,  28,   8, 0 ),\n  V(   8, 0x0036,  30,   9, 0 ),\n  V(   9, 0x001a,  33,  10, 0 ),\n  V(  10, 0x000d,  35,  11, 0 ),\n  V(  11, 0x0006,   9,  12, 0 ),\n  V(  12, 0x0003,  10,  13, 0 ),\n  V(  13, 0x0001,  12,  13, 0 ),\n  V(  14, 0x5a7f,  15,  15, 1 ),\n  V(  15, 0x3f25,  36,  16, 0 ),\n  V(  16, 0x2cf2,  38,  17, 0 ),\n  V(  17, 0x207c,  39,  18, 0 ),\n  V(  18, 0x17b9,  40,  19, 0 ),\n  V(  19, 0x1182,  42,  20, 0 ),\n  V(  20, 0x0cef,  43,  21, 0 ),\n  V(  21, 0x09a1,  45,  22, 0 ),\n  V(  22, 0x072f,  46,  23, 0 ),\n  V(  23, 0x055c,  48,  24, 0 ),\n  V(  24, 0x0406,  49,  25, 0 ),\n  V(  25, 0x0303,  51,  26, 0 ),\n  V(  26, 0x0240,  52,  27, 0 ),\n  V(  27, 0x01b1,  54,  28, 0 ),\n  V(  28, 0x0144,  56,  29, 0 ),\n  V(  29, 0x00f5,  57,  30, 0 ),\n  V(  30, 0x00b7,  59,  31, 0 ),\n  V(  31, 0x008a,  60,  32, 0 ),\n  V(  32, 0x0068,  62,  33, 0 ),\n  V(  33, 0x004e,  63,  34, 0 ),\n  V(  34, 0x003b,  32,  35, 0 ),\n  V(  35, 0x002c,  33,   9, 0 ),\n  V(  36, 0x5ae1,  37,  37, 1 ),\n  V(  37, 0x484c,  64,  38, 0 ),\n  V(  38, 0x3a0d,  65,  39, 0 ),\n  V(  39, 0x2ef1,  67,  40, 0 ),\n  V(  40, 0x261f,  68,  41, 0 ),\n  V(  41, 0x1f33,  69,  42, 0 ),\n  V(  42, 0x19a8,  70,  43, 0 ),\n  V(  43, 0x1518,  72,  44, 0 ),\n  V(  44, 0x1177,  73,  45, 0 ),\n  V(  45, 0x0e74,  74,  46, 0 ),\n  V(  46, 0x0bfb,  75,  47, 0 ),\n  V(  47, 0x09f8,  77,  48, 0 ),\n  V(  48, 0x0861,  78,  49, 0 ),\n  V(  49, 0x0706,  79,  50, 0 ),\n  V(  50, 0x05cd,  48,  51, 0 ),\n  V(  51, 0x04de,  50,  52, 0 ),\n  V(  52, 0x040f,  50,  53, 0 ),\n  V(  53, 0x0363,  51,  54, 0 ),\n  V(  54, 0x02d4,  52,  55, 0 ),\n  V(  55, 0x025c,  53,  56, 0 ),\n  V(  56, 0x01f8,  54,  57, 0 ),\n  V(  57, 0x01a4,  55,  58, 0 ),\n  V(  58, 0x0160,  56,  59, 0 ),\n  V(  59, 0x0125,  57,  60, 0 ),\n  V(  60, 0x00f6,  58,  61, 0 ),\n  V(  61, 0x00cb,  59,  62, 0 ),\n  V(  62, 0x00ab,  61,  63, 0 ),\n  V(  63, 0x008f,  61,  32, 0 ),\n  V(  64, 0x5b12,  65,  65, 1 ),\n  V(  65, 0x4d04,  80,  66, 0 ),\n  V(  66, 0x412c,  81,  67, 0 ),\n  V(  67, 0x37d8,  82,  68, 0 ),\n  V(  68, 0x2fe8,  83,  69, 0 ),\n  V(  69, 0x293c,  84,  70, 0 ),\n  V(  70, 0x2379,  86,  71, 0 ),\n  V(  71, 0x1edf,  87,  72, 0 ),\n  V(  72, 0x1aa9,  87,  73, 0 ),\n  V(  73, 0x174e,  72,  74, 0 ),\n  V(  74, 0x1424,  72,  75, 0 ),\n  V(  75, 0x119c,  74,  76, 0 ),\n  V(  76, 0x0f6b,  74,  77, 0 ),\n  V(  77, 0x0d51,  75,  78, 0 ),\n  V(  78, 0x0bb6,  77,  79, 0 ),\n  V(  79, 0x0a40,  77,  48, 0 ),\n  V(  80, 0x5832,  80,  81, 1 ),\n  V(  81, 0x4d1c,  88,  82, 0 ),\n  V(  82, 0x438e,  89,  83, 0 ),\n  V(  83, 0x3bdd,  90,  84, 0 ),\n  V(  84, 0x34ee,  91,  85, 0 ),\n  V(  85, 0x2eae,  92,  86, 0 ),\n  V(  86, 0x299a,  93,  87, 0 ),\n  V(  87, 0x2516,  86,  71, 0 ),\n  V(  88, 0x5570,  88,  89, 1 ),\n  V(  89, 0x4ca9,  95,  90, 0 ),\n  V(  90, 0x44d9,  96,  91, 0 ),\n  V(  91, 0x3e22,  97,  92, 0 ),\n  V(  92, 0x3824,  99,  93, 0 ),\n  V(  93, 0x32b4,  99,  94, 0 ),\n  V(  94, 0x2e17,  93,  86, 0 ),\n  V(  95, 0x56a8,  95,  96, 1 ),\n  V(  96, 0x4f46, 101,  97, 0 ),\n  V(  97, 0x47e5, 102,  98, 0 ),\n  V(  98, 0x41cf, 103,  99, 0 ),\n  V(  99, 0x3c3d, 104, 100, 0 ),\n  V( 100, 0x375e,  99,  93, 0 ),\n  V( 101, 0x5231, 105, 102, 0 ),\n  V( 102, 0x4c0f, 106, 103, 0 ),\n  V( 103, 0x4639, 107, 104, 0 ),\n  V( 104, 0x415e, 103,  99, 0 ),\n  V( 105, 0x5627, 105, 106, 1 ),\n  V( 106, 0x50e7, 108, 107, 0 ),\n  V( 107, 0x4b85, 109, 103, 0 ),\n  V( 108, 0x5597, 110, 109, 0 ),\n  V( 109, 0x504f, 111, 107, 0 ),\n  V( 110, 0x5a10, 110, 111, 1 ),\n  V( 111, 0x5522, 112, 109, 0 ),\n  V( 112, 0x59eb, 112, 111, 1 ),\n/*\n * This last entry is used for fixed probability estimate of 0.5\n * as recommended in Section 10.3 Table 5 of ITU-T Rec. T.851.\n */\n  V( 113, 0x5a1d, 113, 113, 0 )\n};\n"
  },
  {
    "path": "ext/libjpeg-turbo/jcapimin.c",
    "content": "/*\n * jcapimin.c\n *\n * Copyright (C) 1994-1998, Thomas G. Lane.\n * Modified 2003-2010 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains application interface code for the compression half\n * of the JPEG library.  These are the \"minimum\" API routines that may be\n * needed in either the normal full-compression case or the transcoding-only\n * case.\n *\n * Most of the routines intended to be called directly by an application\n * are in this file or in jcapistd.c.  But also see jcparam.c for\n * parameter-setup helper routines, jcomapi.c for routines shared by\n * compression and decompression, and jctrans.c for the transcoding case.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/*\n * Initialization of a JPEG compression object.\n * The error manager must already be set up (in case memory manager fails).\n */\n\nGLOBAL(void)\njpeg_CreateCompress (j_compress_ptr cinfo, int version, size_t structsize)\n{\n  int i;\n\n  /* Guard against version mismatches between library and caller. */\n  cinfo->mem = NULL;\t\t/* so jpeg_destroy knows mem mgr not called */\n  if (version != JPEG_LIB_VERSION)\n    ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);\n  if (structsize != SIZEOF(struct jpeg_compress_struct))\n    ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, \n\t     (int) SIZEOF(struct jpeg_compress_struct), (int) structsize);\n\n  /* For debugging purposes, we zero the whole master structure.\n   * But the application has already set the err pointer, and may have set\n   * client_data, so we have to save and restore those fields.\n   * Note: if application hasn't set client_data, tools like Purify may\n   * complain here.\n   */\n  {\n    struct jpeg_error_mgr * err = cinfo->err;\n    void * client_data = cinfo->client_data; /* ignore Purify complaint here */\n    MEMZERO(cinfo, SIZEOF(struct jpeg_compress_struct));\n    cinfo->err = err;\n    cinfo->client_data = client_data;\n  }\n  cinfo->is_decompressor = FALSE;\n\n  /* Initialize a memory manager instance for this object */\n  jinit_memory_mgr((j_common_ptr) cinfo);\n\n  /* Zero out pointers to permanent structures. */\n  cinfo->progress = NULL;\n  cinfo->dest = NULL;\n\n  cinfo->comp_info = NULL;\n\n  for (i = 0; i < NUM_QUANT_TBLS; i++) {\n    cinfo->quant_tbl_ptrs[i] = NULL;\n#if JPEG_LIB_VERSION >= 70\n    cinfo->q_scale_factor[i] = 100;\n#endif\n  }\n\n  for (i = 0; i < NUM_HUFF_TBLS; i++) {\n    cinfo->dc_huff_tbl_ptrs[i] = NULL;\n    cinfo->ac_huff_tbl_ptrs[i] = NULL;\n  }\n\n#if JPEG_LIB_VERSION >= 80\n  /* Must do it here for emit_dqt in case jpeg_write_tables is used */\n  cinfo->block_size = DCTSIZE;\n  cinfo->natural_order = jpeg_natural_order;\n  cinfo->lim_Se = DCTSIZE2-1;\n#endif\n\n  cinfo->script_space = NULL;\n\n  cinfo->input_gamma = 1.0;\t/* in case application forgets */\n\n  /* OK, I'm ready */\n  cinfo->global_state = CSTATE_START;\n}\n\n\n/*\n * Destruction of a JPEG compression object\n */\n\nGLOBAL(void)\njpeg_destroy_compress (j_compress_ptr cinfo)\n{\n  jpeg_destroy((j_common_ptr) cinfo); /* use common routine */\n}\n\n\n/*\n * Abort processing of a JPEG compression operation,\n * but don't destroy the object itself.\n */\n\nGLOBAL(void)\njpeg_abort_compress (j_compress_ptr cinfo)\n{\n  jpeg_abort((j_common_ptr) cinfo); /* use common routine */\n}\n\n\n/*\n * Forcibly suppress or un-suppress all quantization and Huffman tables.\n * Marks all currently defined tables as already written (if suppress)\n * or not written (if !suppress).  This will control whether they get emitted\n * by a subsequent jpeg_start_compress call.\n *\n * This routine is exported for use by applications that want to produce\n * abbreviated JPEG datastreams.  It logically belongs in jcparam.c, but\n * since it is called by jpeg_start_compress, we put it here --- otherwise\n * jcparam.o would be linked whether the application used it or not.\n */\n\nGLOBAL(void)\njpeg_suppress_tables (j_compress_ptr cinfo, boolean suppress)\n{\n  int i;\n  JQUANT_TBL * qtbl;\n  JHUFF_TBL * htbl;\n\n  for (i = 0; i < NUM_QUANT_TBLS; i++) {\n    if ((qtbl = cinfo->quant_tbl_ptrs[i]) != NULL)\n      qtbl->sent_table = suppress;\n  }\n\n  for (i = 0; i < NUM_HUFF_TBLS; i++) {\n    if ((htbl = cinfo->dc_huff_tbl_ptrs[i]) != NULL)\n      htbl->sent_table = suppress;\n    if ((htbl = cinfo->ac_huff_tbl_ptrs[i]) != NULL)\n      htbl->sent_table = suppress;\n  }\n}\n\n\n/*\n * Finish JPEG compression.\n *\n * If a multipass operating mode was selected, this may do a great deal of\n * work including most of the actual output.\n */\n\nGLOBAL(void)\njpeg_finish_compress (j_compress_ptr cinfo)\n{\n  JDIMENSION iMCU_row;\n\n  if (cinfo->global_state == CSTATE_SCANNING ||\n      cinfo->global_state == CSTATE_RAW_OK) {\n    /* Terminate first pass */\n    if (cinfo->next_scanline < cinfo->image_height)\n      ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);\n    (*cinfo->master->finish_pass) (cinfo);\n  } else if (cinfo->global_state != CSTATE_WRCOEFS)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  /* Perform any remaining passes */\n  while (! cinfo->master->is_last_pass) {\n    (*cinfo->master->prepare_for_pass) (cinfo);\n    for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) {\n      if (cinfo->progress != NULL) {\n\tcinfo->progress->pass_counter = (long) iMCU_row;\n\tcinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows;\n\t(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n      }\n      /* We bypass the main controller and invoke coef controller directly;\n       * all work is being done from the coefficient buffer.\n       */\n      if (! (*cinfo->coef->compress_data) (cinfo, (JSAMPIMAGE) NULL))\n\tERREXIT(cinfo, JERR_CANT_SUSPEND);\n    }\n    (*cinfo->master->finish_pass) (cinfo);\n  }\n  /* Write EOI, do final cleanup */\n  (*cinfo->marker->write_file_trailer) (cinfo);\n  (*cinfo->dest->term_destination) (cinfo);\n  /* We can use jpeg_abort to release memory and reset global_state */\n  jpeg_abort((j_common_ptr) cinfo);\n}\n\n\n/*\n * Write a special marker.\n * This is only recommended for writing COM or APPn markers.\n * Must be called after jpeg_start_compress() and before\n * first call to jpeg_write_scanlines() or jpeg_write_raw_data().\n */\n\nGLOBAL(void)\njpeg_write_marker (j_compress_ptr cinfo, int marker,\n\t\t   const JOCTET *dataptr, unsigned int datalen)\n{\n  JMETHOD(void, write_marker_byte, (j_compress_ptr info, int val));\n\n  if (cinfo->next_scanline != 0 ||\n      (cinfo->global_state != CSTATE_SCANNING &&\n       cinfo->global_state != CSTATE_RAW_OK &&\n       cinfo->global_state != CSTATE_WRCOEFS))\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  (*cinfo->marker->write_marker_header) (cinfo, marker, datalen);\n  write_marker_byte = cinfo->marker->write_marker_byte;\t/* copy for speed */\n  while (datalen--) {\n    (*write_marker_byte) (cinfo, *dataptr);\n    dataptr++;\n  }\n}\n\n/* Same, but piecemeal. */\n\nGLOBAL(void)\njpeg_write_m_header (j_compress_ptr cinfo, int marker, unsigned int datalen)\n{\n  if (cinfo->next_scanline != 0 ||\n      (cinfo->global_state != CSTATE_SCANNING &&\n       cinfo->global_state != CSTATE_RAW_OK &&\n       cinfo->global_state != CSTATE_WRCOEFS))\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  (*cinfo->marker->write_marker_header) (cinfo, marker, datalen);\n}\n\nGLOBAL(void)\njpeg_write_m_byte (j_compress_ptr cinfo, int val)\n{\n  (*cinfo->marker->write_marker_byte) (cinfo, val);\n}\n\n\n/*\n * Alternate compression function: just write an abbreviated table file.\n * Before calling this, all parameters and a data destination must be set up.\n *\n * To produce a pair of files containing abbreviated tables and abbreviated\n * image data, one would proceed as follows:\n *\n *\t\tinitialize JPEG object\n *\t\tset JPEG parameters\n *\t\tset destination to table file\n *\t\tjpeg_write_tables(cinfo);\n *\t\tset destination to image file\n *\t\tjpeg_start_compress(cinfo, FALSE);\n *\t\twrite data...\n *\t\tjpeg_finish_compress(cinfo);\n *\n * jpeg_write_tables has the side effect of marking all tables written\n * (same as jpeg_suppress_tables(..., TRUE)).  Thus a subsequent start_compress\n * will not re-emit the tables unless it is passed write_all_tables=TRUE.\n */\n\nGLOBAL(void)\njpeg_write_tables (j_compress_ptr cinfo)\n{\n  if (cinfo->global_state != CSTATE_START)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  /* (Re)initialize error mgr and destination modules */\n  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);\n  (*cinfo->dest->init_destination) (cinfo);\n  /* Initialize the marker writer ... bit of a crock to do it here. */\n  jinit_marker_writer(cinfo);\n  /* Write them tables! */\n  (*cinfo->marker->write_tables_only) (cinfo);\n  /* And clean up. */\n  (*cinfo->dest->term_destination) (cinfo);\n  /*\n   * In library releases up through v6a, we called jpeg_abort() here to free\n   * any working memory allocated by the destination manager and marker\n   * writer.  Some applications had a problem with that: they allocated space\n   * of their own from the library memory manager, and didn't want it to go\n   * away during write_tables.  So now we do nothing.  This will cause a\n   * memory leak if an app calls write_tables repeatedly without doing a full\n   * compression cycle or otherwise resetting the JPEG object.  However, that\n   * seems less bad than unexpectedly freeing memory in the normal case.\n   * An app that prefers the old behavior can call jpeg_abort for itself after\n   * each call to jpeg_write_tables().\n   */\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jcapistd.c",
    "content": "/*\n * jcapistd.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains application interface code for the compression half\n * of the JPEG library.  These are the \"standard\" API routines that are\n * used in the normal full-compression case.  They are not used by a\n * transcoding-only application.  Note that if an application links in\n * jpeg_start_compress, it will end up linking in the entire compressor.\n * We thus must separate this file from jcapimin.c to avoid linking the\n * whole compression library into a transcoder.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/*\n * Compression initialization.\n * Before calling this, all parameters and a data destination must be set up.\n *\n * We require a write_all_tables parameter as a failsafe check when writing\n * multiple datastreams from the same compression object.  Since prior runs\n * will have left all the tables marked sent_table=TRUE, a subsequent run\n * would emit an abbreviated stream (no tables) by default.  This may be what\n * is wanted, but for safety's sake it should not be the default behavior:\n * programmers should have to make a deliberate choice to emit abbreviated\n * images.  Therefore the documentation and examples should encourage people\n * to pass write_all_tables=TRUE; then it will take active thought to do the\n * wrong thing.\n */\n\nGLOBAL(void)\njpeg_start_compress (j_compress_ptr cinfo, boolean write_all_tables)\n{\n  if (cinfo->global_state != CSTATE_START)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  if (write_all_tables)\n    jpeg_suppress_tables(cinfo, FALSE);\t/* mark all tables to be written */\n\n  /* (Re)initialize error mgr and destination modules */\n  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);\n  (*cinfo->dest->init_destination) (cinfo);\n  /* Perform master selection of active modules */\n  jinit_compress_master(cinfo);\n  /* Set up for the first pass */\n  (*cinfo->master->prepare_for_pass) (cinfo);\n  /* Ready for application to drive first pass through jpeg_write_scanlines\n   * or jpeg_write_raw_data.\n   */\n  cinfo->next_scanline = 0;\n  cinfo->global_state = (cinfo->raw_data_in ? CSTATE_RAW_OK : CSTATE_SCANNING);\n}\n\n\n/*\n * Write some scanlines of data to the JPEG compressor.\n *\n * The return value will be the number of lines actually written.\n * This should be less than the supplied num_lines only in case that\n * the data destination module has requested suspension of the compressor,\n * or if more than image_height scanlines are passed in.\n *\n * Note: we warn about excess calls to jpeg_write_scanlines() since\n * this likely signals an application programmer error.  However,\n * excess scanlines passed in the last valid call are *silently* ignored,\n * so that the application need not adjust num_lines for end-of-image\n * when using a multiple-scanline buffer.\n */\n\nGLOBAL(JDIMENSION)\njpeg_write_scanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines,\n\t\t      JDIMENSION num_lines)\n{\n  JDIMENSION row_ctr, rows_left;\n\n  if (cinfo->global_state != CSTATE_SCANNING)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  if (cinfo->next_scanline >= cinfo->image_height)\n    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);\n\n  /* Call progress monitor hook if present */\n  if (cinfo->progress != NULL) {\n    cinfo->progress->pass_counter = (long) cinfo->next_scanline;\n    cinfo->progress->pass_limit = (long) cinfo->image_height;\n    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n  }\n\n  /* Give master control module another chance if this is first call to\n   * jpeg_write_scanlines.  This lets output of the frame/scan headers be\n   * delayed so that application can write COM, etc, markers between\n   * jpeg_start_compress and jpeg_write_scanlines.\n   */\n  if (cinfo->master->call_pass_startup)\n    (*cinfo->master->pass_startup) (cinfo);\n\n  /* Ignore any extra scanlines at bottom of image. */\n  rows_left = cinfo->image_height - cinfo->next_scanline;\n  if (num_lines > rows_left)\n    num_lines = rows_left;\n\n  row_ctr = 0;\n  (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines);\n  cinfo->next_scanline += row_ctr;\n  return row_ctr;\n}\n\n\n/*\n * Alternate entry point to write raw data.\n * Processes exactly one iMCU row per call, unless suspended.\n */\n\nGLOBAL(JDIMENSION)\njpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data,\n\t\t     JDIMENSION num_lines)\n{\n  JDIMENSION lines_per_iMCU_row;\n\n  if (cinfo->global_state != CSTATE_RAW_OK)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  if (cinfo->next_scanline >= cinfo->image_height) {\n    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);\n    return 0;\n  }\n\n  /* Call progress monitor hook if present */\n  if (cinfo->progress != NULL) {\n    cinfo->progress->pass_counter = (long) cinfo->next_scanline;\n    cinfo->progress->pass_limit = (long) cinfo->image_height;\n    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n  }\n\n  /* Give master control module another chance if this is first call to\n   * jpeg_write_raw_data.  This lets output of the frame/scan headers be\n   * delayed so that application can write COM, etc, markers between\n   * jpeg_start_compress and jpeg_write_raw_data.\n   */\n  if (cinfo->master->call_pass_startup)\n    (*cinfo->master->pass_startup) (cinfo);\n\n  /* Verify that at least one iMCU row has been passed. */\n  lines_per_iMCU_row = cinfo->max_v_samp_factor * DCTSIZE;\n  if (num_lines < lines_per_iMCU_row)\n    ERREXIT(cinfo, JERR_BUFFER_SIZE);\n\n  /* Directly compress the row. */\n  if (! (*cinfo->coef->compress_data) (cinfo, data)) {\n    /* If compressor did not consume the whole row, suspend processing. */\n    return 0;\n  }\n\n  /* OK, we processed one iMCU row. */\n  cinfo->next_scanline += lines_per_iMCU_row;\n  return lines_per_iMCU_row;\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jcarith.c",
    "content": "/*\n * jcarith.c\n *\n * Developed 1997-2009 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains portable arithmetic entropy encoding routines for JPEG\n * (implementing the ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81).\n *\n * Both sequential and progressive modes are supported in this single module.\n *\n * Suspension is not currently supported in this module.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Expanded entropy encoder object for arithmetic encoding. */\n\ntypedef struct {\n  struct jpeg_entropy_encoder pub; /* public fields */\n\n  INT32 c; /* C register, base of coding interval, layout as in sec. D.1.3 */\n  INT32 a;               /* A register, normalized size of coding interval */\n  INT32 sc;        /* counter for stacked 0xFF values which might overflow */\n  INT32 zc;          /* counter for pending 0x00 output values which might *\n                          * be discarded at the end (\"Pacman\" termination) */\n  int ct;  /* bit shift counter, determines when next byte will be written */\n  int buffer;                /* buffer for most recent output byte != 0xFF */\n\n  int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */\n  int dc_context[MAX_COMPS_IN_SCAN]; /* context index for DC conditioning */\n\n  unsigned int restarts_to_go;\t/* MCUs left in this restart interval */\n  int next_restart_num;\t\t/* next restart number to write (0-7) */\n\n  /* Pointers to statistics areas (these workspaces have image lifespan) */\n  unsigned char * dc_stats[NUM_ARITH_TBLS];\n  unsigned char * ac_stats[NUM_ARITH_TBLS];\n\n  /* Statistics bin for coding with fixed probability 0.5 */\n  unsigned char fixed_bin[4];\n} arith_entropy_encoder;\n\ntypedef arith_entropy_encoder * arith_entropy_ptr;\n\n/* The following two definitions specify the allocation chunk size\n * for the statistics area.\n * According to sections F.1.4.4.1.3 and F.1.4.4.2, we need at least\n * 49 statistics bins for DC, and 245 statistics bins for AC coding.\n *\n * We use a compact representation with 1 byte per statistics bin,\n * thus the numbers directly represent byte sizes.\n * This 1 byte per statistics bin contains the meaning of the MPS\n * (more probable symbol) in the highest bit (mask 0x80), and the\n * index into the probability estimation state machine table\n * in the lower bits (mask 0x7F).\n */\n\n#define DC_STAT_BINS 64\n#define AC_STAT_BINS 256\n\n/* NOTE: Uncomment the following #define if you want to use the\n * given formula for calculating the AC conditioning parameter Kx\n * for spectral selection progressive coding in section G.1.3.2\n * of the spec (Kx = Kmin + SRL (8 + Se - Kmin) 4).\n * Although the spec and P&M authors claim that this \"has proven\n * to give good results for 8 bit precision samples\", I'm not\n * convinced yet that this is really beneficial.\n * Early tests gave only very marginal compression enhancements\n * (a few - around 5 or so - bytes even for very large files),\n * which would turn out rather negative if we'd suppress the\n * DAC (Define Arithmetic Conditioning) marker segments for\n * the default parameters in the future.\n * Note that currently the marker writing module emits 12-byte\n * DAC segments for a full-component scan in a color image.\n * This is not worth worrying about IMHO. However, since the\n * spec defines the default values to be used if the tables\n * are omitted (unlike Huffman tables, which are required\n * anyway), one might optimize this behaviour in the future,\n * and then it would be disadvantageous to use custom tables if\n * they don't provide sufficient gain to exceed the DAC size.\n *\n * On the other hand, I'd consider it as a reasonable result\n * that the conditioning has no significant influence on the\n * compression performance. This means that the basic\n * statistical model is already rather stable.\n *\n * Thus, at the moment, we use the default conditioning values\n * anyway, and do not use the custom formula.\n *\n#define CALCULATE_SPECTRAL_CONDITIONING\n */\n\n/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than INT32.\n * We assume that int right shift is unsigned if INT32 right shift is,\n * which should be safe.\n */\n\n#ifdef RIGHT_SHIFT_IS_UNSIGNED\n#define ISHIFT_TEMPS\tint ishift_temp;\n#define IRIGHT_SHIFT(x,shft)  \\\n\t((ishift_temp = (x)) < 0 ? \\\n\t (ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \\\n\t (ishift_temp >> (shft)))\n#else\n#define ISHIFT_TEMPS\n#define IRIGHT_SHIFT(x,shft)\t((x) >> (shft))\n#endif\n\n\nLOCAL(void)\nemit_byte (int val, j_compress_ptr cinfo)\n/* Write next output byte; we do not support suspension in this module. */\n{\n  struct jpeg_destination_mgr * dest = cinfo->dest;\n\n  *dest->next_output_byte++ = (JOCTET) val;\n  if (--dest->free_in_buffer == 0)\n    if (! (*dest->empty_output_buffer) (cinfo))\n      ERREXIT(cinfo, JERR_CANT_SUSPEND);\n}\n\n\n/*\n * Finish up at the end of an arithmetic-compressed scan.\n */\n\nMETHODDEF(void)\nfinish_pass (j_compress_ptr cinfo)\n{\n  arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy;\n  INT32 temp;\n\n  /* Section D.1.8: Termination of encoding */\n\n  /* Find the e->c in the coding interval with the largest\n   * number of trailing zero bits */\n  if ((temp = (e->a - 1 + e->c) & 0xFFFF0000L) < e->c)\n    e->c = temp + 0x8000L;\n  else\n    e->c = temp;\n  /* Send remaining bytes to output */\n  e->c <<= e->ct;\n  if (e->c & 0xF8000000L) {\n    /* One final overflow has to be handled */\n    if (e->buffer >= 0) {\n      if (e->zc)\n\tdo emit_byte(0x00, cinfo);\n\twhile (--e->zc);\n      emit_byte(e->buffer + 1, cinfo);\n      if (e->buffer + 1 == 0xFF)\n\temit_byte(0x00, cinfo);\n    }\n    e->zc += e->sc;  /* carry-over converts stacked 0xFF bytes to 0x00 */\n    e->sc = 0;\n  } else {\n    if (e->buffer == 0)\n      ++e->zc;\n    else if (e->buffer >= 0) {\n      if (e->zc)\n\tdo emit_byte(0x00, cinfo);\n\twhile (--e->zc);\n      emit_byte(e->buffer, cinfo);\n    }\n    if (e->sc) {\n      if (e->zc)\n\tdo emit_byte(0x00, cinfo);\n\twhile (--e->zc);\n      do {\n\temit_byte(0xFF, cinfo);\n\temit_byte(0x00, cinfo);\n      } while (--e->sc);\n    }\n  }\n  /* Output final bytes only if they are not 0x00 */\n  if (e->c & 0x7FFF800L) {\n    if (e->zc)  /* output final pending zero bytes */\n      do emit_byte(0x00, cinfo);\n      while (--e->zc);\n    emit_byte((e->c >> 19) & 0xFF, cinfo);\n    if (((e->c >> 19) & 0xFF) == 0xFF)\n      emit_byte(0x00, cinfo);\n    if (e->c & 0x7F800L) {\n      emit_byte((e->c >> 11) & 0xFF, cinfo);\n      if (((e->c >> 11) & 0xFF) == 0xFF)\n\temit_byte(0x00, cinfo);\n    }\n  }\n}\n\n\n/*\n * The core arithmetic encoding routine (common in JPEG and JBIG).\n * This needs to go as fast as possible.\n * Machine-dependent optimization facilities\n * are not utilized in this portable implementation.\n * However, this code should be fairly efficient and\n * may be a good base for further optimizations anyway.\n *\n * Parameter 'val' to be encoded may be 0 or 1 (binary decision).\n *\n * Note: I've added full \"Pacman\" termination support to the\n * byte output routines, which is equivalent to the optional\n * Discard_final_zeros procedure (Figure D.15) in the spec.\n * Thus, we always produce the shortest possible output\n * stream compliant to the spec (no trailing zero bytes,\n * except for FF stuffing).\n *\n * I've also introduced a new scheme for accessing\n * the probability estimation state machine table,\n * derived from Markus Kuhn's JBIG implementation.\n */\n\nLOCAL(void)\narith_encode (j_compress_ptr cinfo, unsigned char *st, int val) \n{\n  register arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy;\n  register unsigned char nl, nm;\n  register INT32 qe, temp;\n  register int sv;\n\n  /* Fetch values from our compact representation of Table D.2:\n   * Qe values and probability estimation state machine\n   */\n  sv = *st;\n  qe = jpeg_aritab[sv & 0x7F];\t/* => Qe_Value */\n  nl = qe & 0xFF; qe >>= 8;\t/* Next_Index_LPS + Switch_MPS */\n  nm = qe & 0xFF; qe >>= 8;\t/* Next_Index_MPS */\n\n  /* Encode & estimation procedures per sections D.1.4 & D.1.5 */\n  e->a -= qe;\n  if (val != (sv >> 7)) {\n    /* Encode the less probable symbol */\n    if (e->a >= qe) {\n      /* If the interval size (qe) for the less probable symbol (LPS)\n       * is larger than the interval size for the MPS, then exchange\n       * the two symbols for coding efficiency, otherwise code the LPS\n       * as usual: */\n      e->c += e->a;\n      e->a = qe;\n    }\n    *st = (sv & 0x80) ^ nl;\t/* Estimate_after_LPS */\n  } else {\n    /* Encode the more probable symbol */\n    if (e->a >= 0x8000L)\n      return;  /* A >= 0x8000 -> ready, no renormalization required */\n    if (e->a < qe) {\n      /* If the interval size (qe) for the less probable symbol (LPS)\n       * is larger than the interval size for the MPS, then exchange\n       * the two symbols for coding efficiency: */\n      e->c += e->a;\n      e->a = qe;\n    }\n    *st = (sv & 0x80) ^ nm;\t/* Estimate_after_MPS */\n  }\n\n  /* Renormalization & data output per section D.1.6 */\n  do {\n    e->a <<= 1;\n    e->c <<= 1;\n    if (--e->ct == 0) {\n      /* Another byte is ready for output */\n      temp = e->c >> 19;\n      if (temp > 0xFF) {\n\t/* Handle overflow over all stacked 0xFF bytes */\n\tif (e->buffer >= 0) {\n\t  if (e->zc)\n\t    do emit_byte(0x00, cinfo);\n\t    while (--e->zc);\n\t  emit_byte(e->buffer + 1, cinfo);\n\t  if (e->buffer + 1 == 0xFF)\n\t    emit_byte(0x00, cinfo);\n\t}\n\te->zc += e->sc;  /* carry-over converts stacked 0xFF bytes to 0x00 */\n\te->sc = 0;\n\t/* Note: The 3 spacer bits in the C register guarantee\n\t * that the new buffer byte can't be 0xFF here\n\t * (see page 160 in the P&M JPEG book). */\n\te->buffer = temp & 0xFF;  /* new output byte, might overflow later */\n      } else if (temp == 0xFF) {\n\t++e->sc;  /* stack 0xFF byte (which might overflow later) */\n      } else {\n\t/* Output all stacked 0xFF bytes, they will not overflow any more */\n\tif (e->buffer == 0)\n\t  ++e->zc;\n\telse if (e->buffer >= 0) {\n\t  if (e->zc)\n\t    do emit_byte(0x00, cinfo);\n\t    while (--e->zc);\n\t  emit_byte(e->buffer, cinfo);\n\t}\n\tif (e->sc) {\n\t  if (e->zc)\n\t    do emit_byte(0x00, cinfo);\n\t    while (--e->zc);\n\t  do {\n\t    emit_byte(0xFF, cinfo);\n\t    emit_byte(0x00, cinfo);\n\t  } while (--e->sc);\n\t}\n\te->buffer = temp & 0xFF;  /* new output byte (can still overflow) */\n      }\n      e->c &= 0x7FFFFL;\n      e->ct += 8;\n    }\n  } while (e->a < 0x8000L);\n}\n\n\n/*\n * Emit a restart marker & resynchronize predictions.\n */\n\nLOCAL(void)\nemit_restart (j_compress_ptr cinfo, int restart_num)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  int ci;\n  jpeg_component_info * compptr;\n\n  finish_pass(cinfo);\n\n  emit_byte(0xFF, cinfo);\n  emit_byte(JPEG_RST0 + restart_num, cinfo);\n\n  /* Re-initialize statistics areas */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    /* DC needs no table for refinement scan */\n    if (cinfo->progressive_mode == 0 || (cinfo->Ss == 0 && cinfo->Ah == 0)) {\n      MEMZERO(entropy->dc_stats[compptr->dc_tbl_no], DC_STAT_BINS);\n      /* Reset DC predictions to 0 */\n      entropy->last_dc_val[ci] = 0;\n      entropy->dc_context[ci] = 0;\n    }\n    /* AC needs no table when not present */\n    if (cinfo->progressive_mode == 0 || cinfo->Se) {\n      MEMZERO(entropy->ac_stats[compptr->ac_tbl_no], AC_STAT_BINS);\n    }\n  }\n\n  /* Reset arithmetic encoding variables */\n  entropy->c = 0;\n  entropy->a = 0x10000L;\n  entropy->sc = 0;\n  entropy->zc = 0;\n  entropy->ct = 11;\n  entropy->buffer = -1;  /* empty */\n}\n\n\n/*\n * MCU encoding for DC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\nencode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  JBLOCKROW block;\n  unsigned char *st;\n  int blkn, ci, tbl;\n  int v, v2, m;\n  ISHIFT_TEMPS\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      emit_restart(cinfo, entropy->next_restart_num);\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  /* Encode the MCU data blocks */\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    block = MCU_data[blkn];\n    ci = cinfo->MCU_membership[blkn];\n    tbl = cinfo->cur_comp_info[ci]->dc_tbl_no;\n\n    /* Compute the DC value after the required point transform by Al.\n     * This is simply an arithmetic right shift.\n     */\n    m = IRIGHT_SHIFT((int) ((*block)[0]), cinfo->Al);\n\n    /* Sections F.1.4.1 & F.1.4.4.1: Encoding of DC coefficients */\n\n    /* Table F.4: Point to statistics bin S0 for DC coefficient coding */\n    st = entropy->dc_stats[tbl] + entropy->dc_context[ci];\n\n    /* Figure F.4: Encode_DC_DIFF */\n    if ((v = m - entropy->last_dc_val[ci]) == 0) {\n      arith_encode(cinfo, st, 0);\n      entropy->dc_context[ci] = 0;\t/* zero diff category */\n    } else {\n      entropy->last_dc_val[ci] = m;\n      arith_encode(cinfo, st, 1);\n      /* Figure F.6: Encoding nonzero value v */\n      /* Figure F.7: Encoding the sign of v */\n      if (v > 0) {\n\tarith_encode(cinfo, st + 1, 0);\t/* Table F.4: SS = S0 + 1 */\n\tst += 2;\t\t\t/* Table F.4: SP = S0 + 2 */\n\tentropy->dc_context[ci] = 4;\t/* small positive diff category */\n      } else {\n\tv = -v;\n\tarith_encode(cinfo, st + 1, 1);\t/* Table F.4: SS = S0 + 1 */\n\tst += 3;\t\t\t/* Table F.4: SN = S0 + 3 */\n\tentropy->dc_context[ci] = 8;\t/* small negative diff category */\n      }\n      /* Figure F.8: Encoding the magnitude category of v */\n      m = 0;\n      if (v -= 1) {\n\tarith_encode(cinfo, st, 1);\n\tm = 1;\n\tv2 = v;\n\tst = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */\n\twhile (v2 >>= 1) {\n\t  arith_encode(cinfo, st, 1);\n\t  m <<= 1;\n\t  st += 1;\n\t}\n      }\n      arith_encode(cinfo, st, 0);\n      /* Section F.1.4.4.1.2: Establish dc_context conditioning category */\n      if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))\n\tentropy->dc_context[ci] = 0;\t/* zero diff category */\n      else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))\n\tentropy->dc_context[ci] += 8;\t/* large diff category */\n      /* Figure F.9: Encoding the magnitude bit pattern of v */\n      st += 14;\n      while (m >>= 1)\n\tarith_encode(cinfo, st, (m & v) ? 1 : 0);\n    }\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU encoding for AC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\nencode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  JBLOCKROW block;\n  unsigned char *st;\n  int tbl, k, ke;\n  int v, v2, m;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      emit_restart(cinfo, entropy->next_restart_num);\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  /* Encode the MCU data block */\n  block = MCU_data[0];\n  tbl = cinfo->cur_comp_info[0]->ac_tbl_no;\n\n  /* Sections F.1.4.2 & F.1.4.4.2: Encoding of AC coefficients */\n\n  /* Establish EOB (end-of-block) index */\n  for (ke = cinfo->Se; ke > 0; ke--)\n    /* We must apply the point transform by Al.  For AC coefficients this\n     * is an integer division with rounding towards 0.  To do this portably\n     * in C, we shift after obtaining the absolute value.\n     */\n    if ((v = (*block)[jpeg_natural_order[ke]]) >= 0) {\n      if (v >>= cinfo->Al) break;\n    } else {\n      v = -v;\n      if (v >>= cinfo->Al) break;\n    }\n\n  /* Figure F.5: Encode_AC_Coefficients */\n  for (k = cinfo->Ss; k <= ke; k++) {\n    st = entropy->ac_stats[tbl] + 3 * (k - 1);\n    arith_encode(cinfo, st, 0);\t\t/* EOB decision */\n    for (;;) {\n      if ((v = (*block)[jpeg_natural_order[k]]) >= 0) {\n\tif (v >>= cinfo->Al) {\n\t  arith_encode(cinfo, st + 1, 1);\n\t  arith_encode(cinfo, entropy->fixed_bin, 0);\n\t  break;\n\t}\n      } else {\n\tv = -v;\n\tif (v >>= cinfo->Al) {\n\t  arith_encode(cinfo, st + 1, 1);\n\t  arith_encode(cinfo, entropy->fixed_bin, 1);\n\t  break;\n\t}\n      }\n      arith_encode(cinfo, st + 1, 0); st += 3; k++;\n    }\n    st += 2;\n    /* Figure F.8: Encoding the magnitude category of v */\n    m = 0;\n    if (v -= 1) {\n      arith_encode(cinfo, st, 1);\n      m = 1;\n      v2 = v;\n      if (v2 >>= 1) {\n\tarith_encode(cinfo, st, 1);\n\tm <<= 1;\n\tst = entropy->ac_stats[tbl] +\n\t     (k <= cinfo->arith_ac_K[tbl] ? 189 : 217);\n\twhile (v2 >>= 1) {\n\t  arith_encode(cinfo, st, 1);\n\t  m <<= 1;\n\t  st += 1;\n\t}\n      }\n    }\n    arith_encode(cinfo, st, 0);\n    /* Figure F.9: Encoding the magnitude bit pattern of v */\n    st += 14;\n    while (m >>= 1)\n      arith_encode(cinfo, st, (m & v) ? 1 : 0);\n  }\n  /* Encode EOB decision only if k <= cinfo->Se */\n  if (k <= cinfo->Se) {\n    st = entropy->ac_stats[tbl] + 3 * (k - 1);\n    arith_encode(cinfo, st, 1);\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU encoding for DC successive approximation refinement scan.\n */\n\nMETHODDEF(boolean)\nencode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  unsigned char *st;\n  int Al, blkn;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      emit_restart(cinfo, entropy->next_restart_num);\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  st = entropy->fixed_bin;\t/* use fixed probability estimation */\n  Al = cinfo->Al;\n\n  /* Encode the MCU data blocks */\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    /* We simply emit the Al'th bit of the DC coefficient value. */\n    arith_encode(cinfo, st, (MCU_data[blkn][0][0] >> Al) & 1);\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU encoding for AC successive approximation refinement scan.\n */\n\nMETHODDEF(boolean)\nencode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  JBLOCKROW block;\n  unsigned char *st;\n  int tbl, k, ke, kex;\n  int v;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      emit_restart(cinfo, entropy->next_restart_num);\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  /* Encode the MCU data block */\n  block = MCU_data[0];\n  tbl = cinfo->cur_comp_info[0]->ac_tbl_no;\n\n  /* Section G.1.3.3: Encoding of AC coefficients */\n\n  /* Establish EOB (end-of-block) index */\n  for (ke = cinfo->Se; ke > 0; ke--)\n    /* We must apply the point transform by Al.  For AC coefficients this\n     * is an integer division with rounding towards 0.  To do this portably\n     * in C, we shift after obtaining the absolute value.\n     */\n    if ((v = (*block)[jpeg_natural_order[ke]]) >= 0) {\n      if (v >>= cinfo->Al) break;\n    } else {\n      v = -v;\n      if (v >>= cinfo->Al) break;\n    }\n\n  /* Establish EOBx (previous stage end-of-block) index */\n  for (kex = ke; kex > 0; kex--)\n    if ((v = (*block)[jpeg_natural_order[kex]]) >= 0) {\n      if (v >>= cinfo->Ah) break;\n    } else {\n      v = -v;\n      if (v >>= cinfo->Ah) break;\n    }\n\n  /* Figure G.10: Encode_AC_Coefficients_SA */\n  for (k = cinfo->Ss; k <= ke; k++) {\n    st = entropy->ac_stats[tbl] + 3 * (k - 1);\n    if (k > kex)\n      arith_encode(cinfo, st, 0);\t/* EOB decision */\n    for (;;) {\n      if ((v = (*block)[jpeg_natural_order[k]]) >= 0) {\n\tif (v >>= cinfo->Al) {\n\t  if (v >> 1)\t\t\t/* previously nonzero coef */\n\t    arith_encode(cinfo, st + 2, (v & 1));\n\t  else {\t\t\t/* newly nonzero coef */\n\t    arith_encode(cinfo, st + 1, 1);\n\t    arith_encode(cinfo, entropy->fixed_bin, 0);\n\t  }\n\t  break;\n\t}\n      } else {\n\tv = -v;\n\tif (v >>= cinfo->Al) {\n\t  if (v >> 1)\t\t\t/* previously nonzero coef */\n\t    arith_encode(cinfo, st + 2, (v & 1));\n\t  else {\t\t\t/* newly nonzero coef */\n\t    arith_encode(cinfo, st + 1, 1);\n\t    arith_encode(cinfo, entropy->fixed_bin, 1);\n\t  }\n\t  break;\n\t}\n      }\n      arith_encode(cinfo, st + 1, 0); st += 3; k++;\n    }\n  }\n  /* Encode EOB decision only if k <= cinfo->Se */\n  if (k <= cinfo->Se) {\n    st = entropy->ac_stats[tbl] + 3 * (k - 1);\n    arith_encode(cinfo, st, 1);\n  }\n\n  return TRUE;\n}\n\n\n/*\n * Encode and output one MCU's worth of arithmetic-compressed coefficients.\n */\n\nMETHODDEF(boolean)\nencode_mcu (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  jpeg_component_info * compptr;\n  JBLOCKROW block;\n  unsigned char *st;\n  int blkn, ci, tbl, k, ke;\n  int v, v2, m;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      emit_restart(cinfo, entropy->next_restart_num);\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  /* Encode the MCU data blocks */\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    block = MCU_data[blkn];\n    ci = cinfo->MCU_membership[blkn];\n    compptr = cinfo->cur_comp_info[ci];\n\n    /* Sections F.1.4.1 & F.1.4.4.1: Encoding of DC coefficients */\n\n    tbl = compptr->dc_tbl_no;\n\n    /* Table F.4: Point to statistics bin S0 for DC coefficient coding */\n    st = entropy->dc_stats[tbl] + entropy->dc_context[ci];\n\n    /* Figure F.4: Encode_DC_DIFF */\n    if ((v = (*block)[0] - entropy->last_dc_val[ci]) == 0) {\n      arith_encode(cinfo, st, 0);\n      entropy->dc_context[ci] = 0;\t/* zero diff category */\n    } else {\n      entropy->last_dc_val[ci] = (*block)[0];\n      arith_encode(cinfo, st, 1);\n      /* Figure F.6: Encoding nonzero value v */\n      /* Figure F.7: Encoding the sign of v */\n      if (v > 0) {\n\tarith_encode(cinfo, st + 1, 0);\t/* Table F.4: SS = S0 + 1 */\n\tst += 2;\t\t\t/* Table F.4: SP = S0 + 2 */\n\tentropy->dc_context[ci] = 4;\t/* small positive diff category */\n      } else {\n\tv = -v;\n\tarith_encode(cinfo, st + 1, 1);\t/* Table F.4: SS = S0 + 1 */\n\tst += 3;\t\t\t/* Table F.4: SN = S0 + 3 */\n\tentropy->dc_context[ci] = 8;\t/* small negative diff category */\n      }\n      /* Figure F.8: Encoding the magnitude category of v */\n      m = 0;\n      if (v -= 1) {\n\tarith_encode(cinfo, st, 1);\n\tm = 1;\n\tv2 = v;\n\tst = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */\n\twhile (v2 >>= 1) {\n\t  arith_encode(cinfo, st, 1);\n\t  m <<= 1;\n\t  st += 1;\n\t}\n      }\n      arith_encode(cinfo, st, 0);\n      /* Section F.1.4.4.1.2: Establish dc_context conditioning category */\n      if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))\n\tentropy->dc_context[ci] = 0;\t/* zero diff category */\n      else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))\n\tentropy->dc_context[ci] += 8;\t/* large diff category */\n      /* Figure F.9: Encoding the magnitude bit pattern of v */\n      st += 14;\n      while (m >>= 1)\n\tarith_encode(cinfo, st, (m & v) ? 1 : 0);\n    }\n\n    /* Sections F.1.4.2 & F.1.4.4.2: Encoding of AC coefficients */\n\n    tbl = compptr->ac_tbl_no;\n\n    /* Establish EOB (end-of-block) index */\n    for (ke = DCTSIZE2 - 1; ke > 0; ke--)\n      if ((*block)[jpeg_natural_order[ke]]) break;\n\n    /* Figure F.5: Encode_AC_Coefficients */\n    for (k = 1; k <= ke; k++) {\n      st = entropy->ac_stats[tbl] + 3 * (k - 1);\n      arith_encode(cinfo, st, 0);\t/* EOB decision */\n      while ((v = (*block)[jpeg_natural_order[k]]) == 0) {\n\tarith_encode(cinfo, st + 1, 0); st += 3; k++;\n      }\n      arith_encode(cinfo, st + 1, 1);\n      /* Figure F.6: Encoding nonzero value v */\n      /* Figure F.7: Encoding the sign of v */\n      if (v > 0) {\n\tarith_encode(cinfo, entropy->fixed_bin, 0);\n      } else {\n\tv = -v;\n\tarith_encode(cinfo, entropy->fixed_bin, 1);\n      }\n      st += 2;\n      /* Figure F.8: Encoding the magnitude category of v */\n      m = 0;\n      if (v -= 1) {\n\tarith_encode(cinfo, st, 1);\n\tm = 1;\n\tv2 = v;\n\tif (v2 >>= 1) {\n\t  arith_encode(cinfo, st, 1);\n\t  m <<= 1;\n\t  st = entropy->ac_stats[tbl] +\n\t       (k <= cinfo->arith_ac_K[tbl] ? 189 : 217);\n\t  while (v2 >>= 1) {\n\t    arith_encode(cinfo, st, 1);\n\t    m <<= 1;\n\t    st += 1;\n\t  }\n\t}\n      }\n      arith_encode(cinfo, st, 0);\n      /* Figure F.9: Encoding the magnitude bit pattern of v */\n      st += 14;\n      while (m >>= 1)\n\tarith_encode(cinfo, st, (m & v) ? 1 : 0);\n    }\n    /* Encode EOB decision only if k <= DCTSIZE2 - 1 */\n    if (k <= DCTSIZE2 - 1) {\n      st = entropy->ac_stats[tbl] + 3 * (k - 1);\n      arith_encode(cinfo, st, 1);\n    }\n  }\n\n  return TRUE;\n}\n\n\n/*\n * Initialize for an arithmetic-compressed scan.\n */\n\nMETHODDEF(void)\nstart_pass (j_compress_ptr cinfo, boolean gather_statistics)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  int ci, tbl;\n  jpeg_component_info * compptr;\n\n  if (gather_statistics)\n    /* Make sure to avoid that in the master control logic!\n     * We are fully adaptive here and need no extra\n     * statistics gathering pass!\n     */\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n\n  /* We assume jcmaster.c already validated the progressive scan parameters. */\n\n  /* Select execution routines */\n  if (cinfo->progressive_mode) {\n    if (cinfo->Ah == 0) {\n      if (cinfo->Ss == 0)\n\tentropy->pub.encode_mcu = encode_mcu_DC_first;\n      else\n\tentropy->pub.encode_mcu = encode_mcu_AC_first;\n    } else {\n      if (cinfo->Ss == 0)\n\tentropy->pub.encode_mcu = encode_mcu_DC_refine;\n      else\n\tentropy->pub.encode_mcu = encode_mcu_AC_refine;\n    }\n  } else\n    entropy->pub.encode_mcu = encode_mcu;\n\n  /* Allocate & initialize requested statistics areas */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    /* DC needs no table for refinement scan */\n    if (cinfo->progressive_mode == 0 || (cinfo->Ss == 0 && cinfo->Ah == 0)) {\n      tbl = compptr->dc_tbl_no;\n      if (tbl < 0 || tbl >= NUM_ARITH_TBLS)\n\tERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);\n      if (entropy->dc_stats[tbl] == NULL)\n\tentropy->dc_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)\n\t  ((j_common_ptr) cinfo, JPOOL_IMAGE, DC_STAT_BINS);\n      MEMZERO(entropy->dc_stats[tbl], DC_STAT_BINS);\n      /* Initialize DC predictions to 0 */\n      entropy->last_dc_val[ci] = 0;\n      entropy->dc_context[ci] = 0;\n    }\n    /* AC needs no table when not present */\n    if (cinfo->progressive_mode == 0 || cinfo->Se) {\n      tbl = compptr->ac_tbl_no;\n      if (tbl < 0 || tbl >= NUM_ARITH_TBLS)\n\tERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);\n      if (entropy->ac_stats[tbl] == NULL)\n\tentropy->ac_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)\n\t  ((j_common_ptr) cinfo, JPOOL_IMAGE, AC_STAT_BINS);\n      MEMZERO(entropy->ac_stats[tbl], AC_STAT_BINS);\n#ifdef CALCULATE_SPECTRAL_CONDITIONING\n      if (cinfo->progressive_mode)\n\t/* Section G.1.3.2: Set appropriate arithmetic conditioning value Kx */\n\tcinfo->arith_ac_K[tbl] = cinfo->Ss + ((8 + cinfo->Se - cinfo->Ss) >> 4);\n#endif\n    }\n  }\n\n  /* Initialize arithmetic encoding variables */\n  entropy->c = 0;\n  entropy->a = 0x10000L;\n  entropy->sc = 0;\n  entropy->zc = 0;\n  entropy->ct = 11;\n  entropy->buffer = -1;  /* empty */\n\n  /* Initialize restart stuff */\n  entropy->restarts_to_go = cinfo->restart_interval;\n  entropy->next_restart_num = 0;\n}\n\n\n/*\n * Module initialization routine for arithmetic entropy encoding.\n */\n\nGLOBAL(void)\njinit_arith_encoder (j_compress_ptr cinfo)\n{\n  arith_entropy_ptr entropy;\n  int i;\n\n  entropy = (arith_entropy_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(arith_entropy_encoder));\n  cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;\n  entropy->pub.start_pass = start_pass;\n  entropy->pub.finish_pass = finish_pass;\n\n  /* Mark tables unallocated */\n  for (i = 0; i < NUM_ARITH_TBLS; i++) {\n    entropy->dc_stats[i] = NULL;\n    entropy->ac_stats[i] = NULL;\n  }\n\n  /* Initialize index for fixed probability estimation */\n  entropy->fixed_bin[0] = 113;\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jccoefct.c",
    "content": "/*\n * jccoefct.c\n *\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains the coefficient buffer controller for compression.\n * This controller is the top level of the JPEG compressor proper.\n * The coefficient buffer lies between forward-DCT and entropy encoding steps.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* We use a full-image coefficient buffer when doing Huffman optimization,\n * and also for writing multiple-scan JPEG files.  In all cases, the DCT\n * step is run during the first pass, and subsequent passes need only read\n * the buffered coefficients.\n */\n#ifdef ENTROPY_OPT_SUPPORTED\n#define FULL_COEF_BUFFER_SUPPORTED\n#else\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n#define FULL_COEF_BUFFER_SUPPORTED\n#endif\n#endif\n\n\n/* Private buffer controller object */\n\ntypedef struct {\n  struct jpeg_c_coef_controller pub; /* public fields */\n\n  JDIMENSION iMCU_row_num;\t/* iMCU row # within image */\n  JDIMENSION mcu_ctr;\t\t/* counts MCUs processed in current row */\n  int MCU_vert_offset;\t\t/* counts MCU rows within iMCU row */\n  int MCU_rows_per_iMCU_row;\t/* number of such rows needed */\n\n  /* For single-pass compression, it's sufficient to buffer just one MCU\n   * (although this may prove a bit slow in practice).  We allocate a\n   * workspace of C_MAX_BLOCKS_IN_MCU coefficient blocks, and reuse it for each\n   * MCU constructed and sent.  (On 80x86, the workspace is FAR even though\n   * it's not really very big; this is to keep the module interfaces unchanged\n   * when a large coefficient buffer is necessary.)\n   * In multi-pass modes, this array points to the current MCU's blocks\n   * within the virtual arrays.\n   */\n  JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];\n\n  /* In multi-pass modes, we need a virtual block array for each component. */\n  jvirt_barray_ptr whole_image[MAX_COMPONENTS];\n} my_coef_controller;\n\ntypedef my_coef_controller * my_coef_ptr;\n\n\n/* Forward declarations */\nMETHODDEF(boolean) compress_data\n    JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));\n#ifdef FULL_COEF_BUFFER_SUPPORTED\nMETHODDEF(boolean) compress_first_pass\n    JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));\nMETHODDEF(boolean) compress_output\n    JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));\n#endif\n\n\nLOCAL(void)\nstart_iMCU_row (j_compress_ptr cinfo)\n/* Reset within-iMCU-row counters for a new row */\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n\n  /* In an interleaved scan, an MCU row is the same as an iMCU row.\n   * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.\n   * But at the bottom of the image, process only what's left.\n   */\n  if (cinfo->comps_in_scan > 1) {\n    coef->MCU_rows_per_iMCU_row = 1;\n  } else {\n    if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1))\n      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;\n    else\n      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;\n  }\n\n  coef->mcu_ctr = 0;\n  coef->MCU_vert_offset = 0;\n}\n\n\n/*\n * Initialize for a processing pass.\n */\n\nMETHODDEF(void)\nstart_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n\n  coef->iMCU_row_num = 0;\n  start_iMCU_row(cinfo);\n\n  switch (pass_mode) {\n  case JBUF_PASS_THRU:\n    if (coef->whole_image[0] != NULL)\n      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    coef->pub.compress_data = compress_data;\n    break;\n#ifdef FULL_COEF_BUFFER_SUPPORTED\n  case JBUF_SAVE_AND_PASS:\n    if (coef->whole_image[0] == NULL)\n      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    coef->pub.compress_data = compress_first_pass;\n    break;\n  case JBUF_CRANK_DEST:\n    if (coef->whole_image[0] == NULL)\n      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    coef->pub.compress_data = compress_output;\n    break;\n#endif\n  default:\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    break;\n  }\n}\n\n\n/*\n * Process some data in the single-pass case.\n * We process the equivalent of one fully interleaved MCU row (\"iMCU\" row)\n * per call, ie, v_samp_factor block rows for each component in the image.\n * Returns TRUE if the iMCU row is completed, FALSE if suspended.\n *\n * NB: input_buf contains a plane for each component in image,\n * which we index according to the component's SOF position.\n */\n\nMETHODDEF(boolean)\ncompress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION MCU_col_num;\t/* index of current MCU within row */\n  JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;\n  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;\n  int blkn, bi, ci, yindex, yoffset, blockcnt;\n  JDIMENSION ypos, xpos;\n  jpeg_component_info *compptr;\n\n  /* Loop to write as much as one whole iMCU row */\n  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;\n       yoffset++) {\n    for (MCU_col_num = coef->mcu_ctr; MCU_col_num <= last_MCU_col;\n\t MCU_col_num++) {\n      /* Determine where data comes from in input_buf and do the DCT thing.\n       * Each call on forward_DCT processes a horizontal row of DCT blocks\n       * as wide as an MCU; we rely on having allocated the MCU_buffer[] blocks\n       * sequentially.  Dummy blocks at the right or bottom edge are filled in\n       * specially.  The data in them does not matter for image reconstruction,\n       * so we fill them with values that will encode to the smallest amount of\n       * data, viz: all zeroes in the AC entries, DC entries equal to previous\n       * block's DC value.  (Thanks to Thomas Kinsman for this idea.)\n       */\n      blkn = 0;\n      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n\tcompptr = cinfo->cur_comp_info[ci];\n\tblockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width\n\t\t\t\t\t\t: compptr->last_col_width;\n\txpos = MCU_col_num * compptr->MCU_sample_width;\n\typos = yoffset * DCTSIZE; /* ypos == (yoffset+yindex) * DCTSIZE */\n\tfor (yindex = 0; yindex < compptr->MCU_height; yindex++) {\n\t  if (coef->iMCU_row_num < last_iMCU_row ||\n\t      yoffset+yindex < compptr->last_row_height) {\n\t    (*cinfo->fdct->forward_DCT) (cinfo, compptr,\n\t\t\t\t\t input_buf[compptr->component_index],\n\t\t\t\t\t coef->MCU_buffer[blkn],\n\t\t\t\t\t ypos, xpos, (JDIMENSION) blockcnt);\n\t    if (blockcnt < compptr->MCU_width) {\n\t      /* Create some dummy blocks at the right edge of the image. */\n\t      jzero_far((void FAR *) coef->MCU_buffer[blkn + blockcnt],\n\t\t\t(compptr->MCU_width - blockcnt) * SIZEOF(JBLOCK));\n\t      for (bi = blockcnt; bi < compptr->MCU_width; bi++) {\n\t\tcoef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn+bi-1][0][0];\n\t      }\n\t    }\n\t  } else {\n\t    /* Create a row of dummy blocks at the bottom of the image. */\n\t    jzero_far((void FAR *) coef->MCU_buffer[blkn],\n\t\t      compptr->MCU_width * SIZEOF(JBLOCK));\n\t    for (bi = 0; bi < compptr->MCU_width; bi++) {\n\t      coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn-1][0][0];\n\t    }\n\t  }\n\t  blkn += compptr->MCU_width;\n\t  ypos += DCTSIZE;\n\t}\n      }\n      /* Try to write the MCU.  In event of a suspension failure, we will\n       * re-DCT the MCU on restart (a bit inefficient, could be fixed...)\n       */\n      if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {\n\t/* Suspension forced; update state counters and exit */\n\tcoef->MCU_vert_offset = yoffset;\n\tcoef->mcu_ctr = MCU_col_num;\n\treturn FALSE;\n      }\n    }\n    /* Completed an MCU row, but perhaps not an iMCU row */\n    coef->mcu_ctr = 0;\n  }\n  /* Completed the iMCU row, advance counters for next one */\n  coef->iMCU_row_num++;\n  start_iMCU_row(cinfo);\n  return TRUE;\n}\n\n\n#ifdef FULL_COEF_BUFFER_SUPPORTED\n\n/*\n * Process some data in the first pass of a multi-pass case.\n * We process the equivalent of one fully interleaved MCU row (\"iMCU\" row)\n * per call, ie, v_samp_factor block rows for each component in the image.\n * This amount of data is read from the source buffer, DCT'd and quantized,\n * and saved into the virtual arrays.  We also generate suitable dummy blocks\n * as needed at the right and lower edges.  (The dummy blocks are constructed\n * in the virtual arrays, which have been padded appropriately.)  This makes\n * it possible for subsequent passes not to worry about real vs. dummy blocks.\n *\n * We must also emit the data to the entropy encoder.  This is conveniently\n * done by calling compress_output() after we've loaded the current strip\n * of the virtual arrays.\n *\n * NB: input_buf contains a plane for each component in image.  All\n * components are DCT'd and loaded into the virtual arrays in this pass.\n * However, it may be that only a subset of the components are emitted to\n * the entropy encoder during this first pass; be careful about looking\n * at the scan-dependent variables (MCU dimensions, etc).\n */\n\nMETHODDEF(boolean)\ncompress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;\n  JDIMENSION blocks_across, MCUs_across, MCUindex;\n  int bi, ci, h_samp_factor, block_row, block_rows, ndummy;\n  JCOEF lastDC;\n  jpeg_component_info *compptr;\n  JBLOCKARRAY buffer;\n  JBLOCKROW thisblockrow, lastblockrow;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Align the virtual buffer for this component. */\n    buffer = (*cinfo->mem->access_virt_barray)\n      ((j_common_ptr) cinfo, coef->whole_image[ci],\n       coef->iMCU_row_num * compptr->v_samp_factor,\n       (JDIMENSION) compptr->v_samp_factor, TRUE);\n    /* Count non-dummy DCT block rows in this iMCU row. */\n    if (coef->iMCU_row_num < last_iMCU_row)\n      block_rows = compptr->v_samp_factor;\n    else {\n      /* NB: can't use last_row_height here, since may not be set! */\n      block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);\n      if (block_rows == 0) block_rows = compptr->v_samp_factor;\n    }\n    blocks_across = compptr->width_in_blocks;\n    h_samp_factor = compptr->h_samp_factor;\n    /* Count number of dummy blocks to be added at the right margin. */\n    ndummy = (int) (blocks_across % h_samp_factor);\n    if (ndummy > 0)\n      ndummy = h_samp_factor - ndummy;\n    /* Perform DCT for all non-dummy blocks in this iMCU row.  Each call\n     * on forward_DCT processes a complete horizontal row of DCT blocks.\n     */\n    for (block_row = 0; block_row < block_rows; block_row++) {\n      thisblockrow = buffer[block_row];\n      (*cinfo->fdct->forward_DCT) (cinfo, compptr,\n\t\t\t\t   input_buf[ci], thisblockrow,\n\t\t\t\t   (JDIMENSION) (block_row * DCTSIZE),\n\t\t\t\t   (JDIMENSION) 0, blocks_across);\n      if (ndummy > 0) {\n\t/* Create dummy blocks at the right edge of the image. */\n\tthisblockrow += blocks_across; /* => first dummy block */\n\tjzero_far((void FAR *) thisblockrow, ndummy * SIZEOF(JBLOCK));\n\tlastDC = thisblockrow[-1][0];\n\tfor (bi = 0; bi < ndummy; bi++) {\n\t  thisblockrow[bi][0] = lastDC;\n\t}\n      }\n    }\n    /* If at end of image, create dummy block rows as needed.\n     * The tricky part here is that within each MCU, we want the DC values\n     * of the dummy blocks to match the last real block's DC value.\n     * This squeezes a few more bytes out of the resulting file...\n     */\n    if (coef->iMCU_row_num == last_iMCU_row) {\n      blocks_across += ndummy;\t/* include lower right corner */\n      MCUs_across = blocks_across / h_samp_factor;\n      for (block_row = block_rows; block_row < compptr->v_samp_factor;\n\t   block_row++) {\n\tthisblockrow = buffer[block_row];\n\tlastblockrow = buffer[block_row-1];\n\tjzero_far((void FAR *) thisblockrow,\n\t\t  (size_t) (blocks_across * SIZEOF(JBLOCK)));\n\tfor (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) {\n\t  lastDC = lastblockrow[h_samp_factor-1][0];\n\t  for (bi = 0; bi < h_samp_factor; bi++) {\n\t    thisblockrow[bi][0] = lastDC;\n\t  }\n\t  thisblockrow += h_samp_factor; /* advance to next MCU in row */\n\t  lastblockrow += h_samp_factor;\n\t}\n      }\n    }\n  }\n  /* NB: compress_output will increment iMCU_row_num if successful.\n   * A suspension return will result in redoing all the work above next time.\n   */\n\n  /* Emit data to the entropy encoder, sharing code with subsequent passes */\n  return compress_output(cinfo, input_buf);\n}\n\n\n/*\n * Process some data in subsequent passes of a multi-pass case.\n * We process the equivalent of one fully interleaved MCU row (\"iMCU\" row)\n * per call, ie, v_samp_factor block rows for each component in the scan.\n * The data is obtained from the virtual arrays and fed to the entropy coder.\n * Returns TRUE if the iMCU row is completed, FALSE if suspended.\n *\n * NB: input_buf is ignored; it is likely to be a NULL pointer.\n */\n\nMETHODDEF(boolean)\ncompress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION MCU_col_num;\t/* index of current MCU within row */\n  int blkn, ci, xindex, yindex, yoffset;\n  JDIMENSION start_col;\n  JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];\n  JBLOCKROW buffer_ptr;\n  jpeg_component_info *compptr;\n\n  /* Align the virtual buffers for the components used in this scan.\n   * NB: during first pass, this is safe only because the buffers will\n   * already be aligned properly, so jmemmgr.c won't need to do any I/O.\n   */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    buffer[ci] = (*cinfo->mem->access_virt_barray)\n      ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],\n       coef->iMCU_row_num * compptr->v_samp_factor,\n       (JDIMENSION) compptr->v_samp_factor, FALSE);\n  }\n\n  /* Loop to process one whole iMCU row */\n  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;\n       yoffset++) {\n    for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;\n\t MCU_col_num++) {\n      /* Construct list of pointers to DCT blocks belonging to this MCU */\n      blkn = 0;\t\t\t/* index of current DCT block within MCU */\n      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n\tcompptr = cinfo->cur_comp_info[ci];\n\tstart_col = MCU_col_num * compptr->MCU_width;\n\tfor (yindex = 0; yindex < compptr->MCU_height; yindex++) {\n\t  buffer_ptr = buffer[ci][yindex+yoffset] + start_col;\n\t  for (xindex = 0; xindex < compptr->MCU_width; xindex++) {\n\t    coef->MCU_buffer[blkn++] = buffer_ptr++;\n\t  }\n\t}\n      }\n      /* Try to write the MCU. */\n      if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {\n\t/* Suspension forced; update state counters and exit */\n\tcoef->MCU_vert_offset = yoffset;\n\tcoef->mcu_ctr = MCU_col_num;\n\treturn FALSE;\n      }\n    }\n    /* Completed an MCU row, but perhaps not an iMCU row */\n    coef->mcu_ctr = 0;\n  }\n  /* Completed the iMCU row, advance counters for next one */\n  coef->iMCU_row_num++;\n  start_iMCU_row(cinfo);\n  return TRUE;\n}\n\n#endif /* FULL_COEF_BUFFER_SUPPORTED */\n\n\n/*\n * Initialize coefficient buffer controller.\n */\n\nGLOBAL(void)\njinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer)\n{\n  my_coef_ptr coef;\n\n  coef = (my_coef_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_coef_controller));\n  cinfo->coef = (struct jpeg_c_coef_controller *) coef;\n  coef->pub.start_pass = start_pass_coef;\n\n  /* Create the coefficient buffer. */\n  if (need_full_buffer) {\n#ifdef FULL_COEF_BUFFER_SUPPORTED\n    /* Allocate a full-image virtual array for each component, */\n    /* padded to a multiple of samp_factor DCT blocks in each direction. */\n    int ci;\n    jpeg_component_info *compptr;\n\n    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n\t ci++, compptr++) {\n      coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)\n\t((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n\t (JDIMENSION) jround_up((long) compptr->width_in_blocks,\n\t\t\t\t(long) compptr->h_samp_factor),\n\t (JDIMENSION) jround_up((long) compptr->height_in_blocks,\n\t\t\t\t(long) compptr->v_samp_factor),\n\t (JDIMENSION) compptr->v_samp_factor);\n    }\n#else\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n#endif\n  } else {\n    /* We only need a single-MCU buffer. */\n    JBLOCKROW buffer;\n    int i;\n\n    buffer = (JBLOCKROW)\n      (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));\n    for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {\n      coef->MCU_buffer[i] = buffer + i;\n    }\n    coef->whole_image[0] = NULL; /* flag for no virtual arrays */\n  }\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jccolext.c",
    "content": "/*\n * jccolext.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2009-2012, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains input colorspace conversion routines.\n */\n\n\n/* This file is included by jccolor.c */\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n *\n * Note that we change from the application's interleaved-pixel format\n * to our internal noninterleaved, one-plane-per-component format.\n * The input buffer is therefore three times as wide as the output buffer.\n *\n * A starting row offset is provided only for the output buffer.  The caller\n * can easily adjust the passed input_buf value to accommodate any row\n * offset required on that side.\n */\n\nINLINE\nLOCAL(void)\nrgb_ycc_convert_internal (j_compress_ptr cinfo,\n                          JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                          JDIMENSION output_row, int num_rows)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  register int r, g, b;\n  register INT32 * ctab = cconvert->rgb_ycc_tab;\n  register JSAMPROW inptr;\n  register JSAMPROW outptr0, outptr1, outptr2;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->image_width;\n\n  while (--num_rows >= 0) {\n    inptr = *input_buf++;\n    outptr0 = output_buf[0][output_row];\n    outptr1 = output_buf[1][output_row];\n    outptr2 = output_buf[2][output_row];\n    output_row++;\n    for (col = 0; col < num_cols; col++) {\n      r = GETJSAMPLE(inptr[RGB_RED]);\n      g = GETJSAMPLE(inptr[RGB_GREEN]);\n      b = GETJSAMPLE(inptr[RGB_BLUE]);\n      inptr += RGB_PIXELSIZE;\n      /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations\n       * must be too; we do not need an explicit range-limiting operation.\n       * Hence the value being shifted is never negative, and we don't\n       * need the general RIGHT_SHIFT macro.\n       */\n      /* Y */\n      outptr0[col] = (JSAMPLE)\n\t\t((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])\n\t\t >> SCALEBITS);\n      /* Cb */\n      outptr1[col] = (JSAMPLE)\n\t\t((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])\n\t\t >> SCALEBITS);\n      /* Cr */\n      outptr2[col] = (JSAMPLE)\n\t\t((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])\n\t\t >> SCALEBITS);\n    }\n  }\n}\n\n\n/**************** Cases other than RGB -> YCbCr **************/\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n * This version handles RGB->grayscale conversion, which is the same\n * as the RGB->Y portion of RGB->YCbCr.\n * We assume rgb_ycc_start has been called (we only use the Y tables).\n */\n\nINLINE\nLOCAL(void)\nrgb_gray_convert_internal (j_compress_ptr cinfo,\n                           JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                           JDIMENSION output_row, int num_rows)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  register int r, g, b;\n  register INT32 * ctab = cconvert->rgb_ycc_tab;\n  register JSAMPROW inptr;\n  register JSAMPROW outptr;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->image_width;\n\n  while (--num_rows >= 0) {\n    inptr = *input_buf++;\n    outptr = output_buf[0][output_row];\n    output_row++;\n    for (col = 0; col < num_cols; col++) {\n      r = GETJSAMPLE(inptr[RGB_RED]);\n      g = GETJSAMPLE(inptr[RGB_GREEN]);\n      b = GETJSAMPLE(inptr[RGB_BLUE]);\n      inptr += RGB_PIXELSIZE;\n      /* Y */\n      outptr[col] = (JSAMPLE)\n\t\t((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])\n\t\t >> SCALEBITS);\n    }\n  }\n}\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n * This version handles extended RGB->plain RGB conversion\n */\n\nINLINE\nLOCAL(void)\nrgb_rgb_convert_internal (j_compress_ptr cinfo,\n                          JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                          JDIMENSION output_row, int num_rows)\n{\n  register JSAMPROW inptr;\n  register JSAMPROW outptr0, outptr1, outptr2;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->image_width;\n\n  while (--num_rows >= 0) {\n    inptr = *input_buf++;\n    outptr0 = output_buf[0][output_row];\n    outptr1 = output_buf[1][output_row];\n    outptr2 = output_buf[2][output_row];\n    output_row++;\n    for (col = 0; col < num_cols; col++) {\n      outptr0[col] = GETJSAMPLE(inptr[RGB_RED]);\n      outptr1[col] = GETJSAMPLE(inptr[RGB_GREEN]);\n      outptr2[col] = GETJSAMPLE(inptr[RGB_BLUE]);\n      inptr += RGB_PIXELSIZE;\n    }\n  }\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jccolor.c",
    "content": "/*\n * jccolor.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright (C) 2009-2012, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains input colorspace conversion routines.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jsimd.h\"\n#include \"config.h\"\n\n\n/* Private subobject */\n\ntypedef struct {\n  struct jpeg_color_converter pub; /* public fields */\n\n  /* Private state for RGB->YCC conversion */\n  INT32 * rgb_ycc_tab;\t\t/* => table for RGB to YCbCr conversion */\n} my_color_converter;\n\ntypedef my_color_converter * my_cconvert_ptr;\n\n\n/**************** RGB -> YCbCr conversion: most common case **************/\n\n/*\n * YCbCr is defined per CCIR 601-1, except that Cb and Cr are\n * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.\n * The conversion equations to be implemented are therefore\n *\tY  =  0.29900 * R + 0.58700 * G + 0.11400 * B\n *\tCb = -0.16874 * R - 0.33126 * G + 0.50000 * B  + CENTERJSAMPLE\n *\tCr =  0.50000 * R - 0.41869 * G - 0.08131 * B  + CENTERJSAMPLE\n * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)\n * Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2,\n * rather than CENTERJSAMPLE, for Cb and Cr.  This gave equal positive and\n * negative swings for Cb/Cr, but meant that grayscale values (Cb=Cr=0)\n * were not represented exactly.  Now we sacrifice exact representation of\n * maximum red and maximum blue in order to get exact grayscales.\n *\n * To avoid floating-point arithmetic, we represent the fractional constants\n * as integers scaled up by 2^16 (about 4 digits precision); we have to divide\n * the products by 2^16, with appropriate rounding, to get the correct answer.\n *\n * For even more speed, we avoid doing any multiplications in the inner loop\n * by precalculating the constants times R,G,B for all possible values.\n * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);\n * for 12-bit samples it is still acceptable.  It's not very reasonable for\n * 16-bit samples, but if you want lossless storage you shouldn't be changing\n * colorspace anyway.\n * The CENTERJSAMPLE offsets and the rounding fudge-factor of 0.5 are included\n * in the tables to save adding them separately in the inner loop.\n */\n\n#define SCALEBITS\t16\t/* speediest right-shift on some machines */\n#define CBCR_OFFSET\t((INT32) CENTERJSAMPLE << SCALEBITS)\n#define ONE_HALF\t((INT32) 1 << (SCALEBITS-1))\n#define FIX(x)\t\t((INT32) ((x) * (1L<<SCALEBITS) + 0.5))\n\n/* We allocate one big table and divide it up into eight parts, instead of\n * doing eight alloc_small requests.  This lets us use a single table base\n * address, which can be held in a register in the inner loops on many\n * machines (more than can hold all eight addresses, anyway).\n */\n\n#define R_Y_OFF\t\t0\t\t\t/* offset to R => Y section */\n#define G_Y_OFF\t\t(1*(MAXJSAMPLE+1))\t/* offset to G => Y section */\n#define B_Y_OFF\t\t(2*(MAXJSAMPLE+1))\t/* etc. */\n#define R_CB_OFF\t(3*(MAXJSAMPLE+1))\n#define G_CB_OFF\t(4*(MAXJSAMPLE+1))\n#define B_CB_OFF\t(5*(MAXJSAMPLE+1))\n#define R_CR_OFF\tB_CB_OFF\t\t/* B=>Cb, R=>Cr are the same */\n#define G_CR_OFF\t(6*(MAXJSAMPLE+1))\n#define B_CR_OFF\t(7*(MAXJSAMPLE+1))\n#define TABLE_SIZE\t(8*(MAXJSAMPLE+1))\n\n\n/* Include inline routines for colorspace extensions */\n\n#include \"jccolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n\n#define RGB_RED EXT_RGB_RED\n#define RGB_GREEN EXT_RGB_GREEN\n#define RGB_BLUE EXT_RGB_BLUE\n#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n#define rgb_ycc_convert_internal extrgb_ycc_convert_internal\n#define rgb_gray_convert_internal extrgb_gray_convert_internal\n#define rgb_rgb_convert_internal extrgb_rgb_convert_internal\n#include \"jccolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n#undef rgb_ycc_convert_internal\n#undef rgb_gray_convert_internal\n#undef rgb_rgb_convert_internal\n\n#define RGB_RED EXT_RGBX_RED\n#define RGB_GREEN EXT_RGBX_GREEN\n#define RGB_BLUE EXT_RGBX_BLUE\n#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n#define rgb_ycc_convert_internal extrgbx_ycc_convert_internal\n#define rgb_gray_convert_internal extrgbx_gray_convert_internal\n#define rgb_rgb_convert_internal extrgbx_rgb_convert_internal\n#include \"jccolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n#undef rgb_ycc_convert_internal\n#undef rgb_gray_convert_internal\n#undef rgb_rgb_convert_internal\n\n#define RGB_RED EXT_BGR_RED\n#define RGB_GREEN EXT_BGR_GREEN\n#define RGB_BLUE EXT_BGR_BLUE\n#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n#define rgb_ycc_convert_internal extbgr_ycc_convert_internal\n#define rgb_gray_convert_internal extbgr_gray_convert_internal\n#define rgb_rgb_convert_internal extbgr_rgb_convert_internal\n#include \"jccolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n#undef rgb_ycc_convert_internal\n#undef rgb_gray_convert_internal\n#undef rgb_rgb_convert_internal\n\n#define RGB_RED EXT_BGRX_RED\n#define RGB_GREEN EXT_BGRX_GREEN\n#define RGB_BLUE EXT_BGRX_BLUE\n#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n#define rgb_ycc_convert_internal extbgrx_ycc_convert_internal\n#define rgb_gray_convert_internal extbgrx_gray_convert_internal\n#define rgb_rgb_convert_internal extbgrx_rgb_convert_internal\n#include \"jccolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n#undef rgb_ycc_convert_internal\n#undef rgb_gray_convert_internal\n#undef rgb_rgb_convert_internal\n\n#define RGB_RED EXT_XBGR_RED\n#define RGB_GREEN EXT_XBGR_GREEN\n#define RGB_BLUE EXT_XBGR_BLUE\n#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n#define rgb_ycc_convert_internal extxbgr_ycc_convert_internal\n#define rgb_gray_convert_internal extxbgr_gray_convert_internal\n#define rgb_rgb_convert_internal extxbgr_rgb_convert_internal\n#include \"jccolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n#undef rgb_ycc_convert_internal\n#undef rgb_gray_convert_internal\n#undef rgb_rgb_convert_internal\n\n#define RGB_RED EXT_XRGB_RED\n#define RGB_GREEN EXT_XRGB_GREEN\n#define RGB_BLUE EXT_XRGB_BLUE\n#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n#define rgb_ycc_convert_internal extxrgb_ycc_convert_internal\n#define rgb_gray_convert_internal extxrgb_gray_convert_internal\n#define rgb_rgb_convert_internal extxrgb_rgb_convert_internal\n#include \"jccolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n#undef rgb_ycc_convert_internal\n#undef rgb_gray_convert_internal\n#undef rgb_rgb_convert_internal\n\n\n/*\n * Initialize for RGB->YCC colorspace conversion.\n */\n\nMETHODDEF(void)\nrgb_ycc_start (j_compress_ptr cinfo)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  INT32 * rgb_ycc_tab;\n  INT32 i;\n\n  /* Allocate and fill in the conversion tables. */\n  cconvert->rgb_ycc_tab = rgb_ycc_tab = (INT32 *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(TABLE_SIZE * SIZEOF(INT32)));\n\n  for (i = 0; i <= MAXJSAMPLE; i++) {\n    rgb_ycc_tab[i+R_Y_OFF] = FIX(0.29900) * i;\n    rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i;\n    rgb_ycc_tab[i+B_Y_OFF] = FIX(0.11400) * i     + ONE_HALF;\n    rgb_ycc_tab[i+R_CB_OFF] = (-FIX(0.16874)) * i;\n    rgb_ycc_tab[i+G_CB_OFF] = (-FIX(0.33126)) * i;\n    /* We use a rounding fudge-factor of 0.5-epsilon for Cb and Cr.\n     * This ensures that the maximum output will round to MAXJSAMPLE\n     * not MAXJSAMPLE+1, and thus that we don't have to range-limit.\n     */\n    rgb_ycc_tab[i+B_CB_OFF] = FIX(0.50000) * i    + CBCR_OFFSET + ONE_HALF-1;\n/*  B=>Cb and R=>Cr tables are the same\n    rgb_ycc_tab[i+R_CR_OFF] = FIX(0.50000) * i    + CBCR_OFFSET + ONE_HALF-1;\n*/\n    rgb_ycc_tab[i+G_CR_OFF] = (-FIX(0.41869)) * i;\n    rgb_ycc_tab[i+B_CR_OFF] = (-FIX(0.08131)) * i;\n  }\n}\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n */\n\nMETHODDEF(void)\nrgb_ycc_convert (j_compress_ptr cinfo,\n\t\t JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n\t\t JDIMENSION output_row, int num_rows)\n{\n  switch (cinfo->in_color_space) {\n    case JCS_EXT_RGB:\n      extrgb_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                  num_rows);\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      extrgbx_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                   num_rows);\n      break;\n    case JCS_EXT_BGR:\n      extbgr_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                  num_rows);\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      extbgrx_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                   num_rows);\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      extxbgr_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                   num_rows);\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      extxrgb_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                   num_rows);\n      break;\n    default:\n      rgb_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,\n                               num_rows);\n      break;\n  }\n}\n\n\n/**************** Cases other than RGB -> YCbCr **************/\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n */\n\nMETHODDEF(void)\nrgb_gray_convert (j_compress_ptr cinfo,\n\t\t  JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n\t\t  JDIMENSION output_row, int num_rows)\n{\n  switch (cinfo->in_color_space) {\n    case JCS_EXT_RGB:\n      extrgb_gray_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                   num_rows);\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      extrgbx_gray_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                    num_rows);\n      break;\n    case JCS_EXT_BGR:\n      extbgr_gray_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                   num_rows);\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      extbgrx_gray_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                    num_rows);\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      extxbgr_gray_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                    num_rows);\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      extxrgb_gray_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                    num_rows);\n      break;\n    default:\n      rgb_gray_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                num_rows);\n      break;\n  }\n}\n\n\n/*\n * Extended RGB to plain RGB conversion\n */\n\nMETHODDEF(void)\nrgb_rgb_convert (j_compress_ptr cinfo,\n\t\t  JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n\t\t  JDIMENSION output_row, int num_rows)\n{\n  switch (cinfo->in_color_space) {\n    case JCS_EXT_RGB:\n      extrgb_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                  num_rows);\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      extrgbx_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                   num_rows);\n      break;\n    case JCS_EXT_BGR:\n      extbgr_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                  num_rows);\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      extbgrx_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                   num_rows);\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      extxbgr_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                   num_rows);\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      extxrgb_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,\n                                   num_rows);\n      break;\n    default:\n      rgb_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,\n                               num_rows);\n      break;\n  }\n}\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n * This version handles Adobe-style CMYK->YCCK conversion,\n * where we convert R=1-C, G=1-M, and B=1-Y to YCbCr using the same\n * conversion as above, while passing K (black) unchanged.\n * We assume rgb_ycc_start has been called.\n */\n\nMETHODDEF(void)\ncmyk_ycck_convert (j_compress_ptr cinfo,\n\t\t   JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n\t\t   JDIMENSION output_row, int num_rows)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  register int r, g, b;\n  register INT32 * ctab = cconvert->rgb_ycc_tab;\n  register JSAMPROW inptr;\n  register JSAMPROW outptr0, outptr1, outptr2, outptr3;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->image_width;\n\n  while (--num_rows >= 0) {\n    inptr = *input_buf++;\n    outptr0 = output_buf[0][output_row];\n    outptr1 = output_buf[1][output_row];\n    outptr2 = output_buf[2][output_row];\n    outptr3 = output_buf[3][output_row];\n    output_row++;\n    for (col = 0; col < num_cols; col++) {\n      r = MAXJSAMPLE - GETJSAMPLE(inptr[0]);\n      g = MAXJSAMPLE - GETJSAMPLE(inptr[1]);\n      b = MAXJSAMPLE - GETJSAMPLE(inptr[2]);\n      /* K passes through as-is */\n      outptr3[col] = inptr[3];\t/* don't need GETJSAMPLE here */\n      inptr += 4;\n      /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations\n       * must be too; we do not need an explicit range-limiting operation.\n       * Hence the value being shifted is never negative, and we don't\n       * need the general RIGHT_SHIFT macro.\n       */\n      /* Y */\n      outptr0[col] = (JSAMPLE)\n\t\t((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])\n\t\t >> SCALEBITS);\n      /* Cb */\n      outptr1[col] = (JSAMPLE)\n\t\t((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF])\n\t\t >> SCALEBITS);\n      /* Cr */\n      outptr2[col] = (JSAMPLE)\n\t\t((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF])\n\t\t >> SCALEBITS);\n    }\n  }\n}\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n * This version handles grayscale output with no conversion.\n * The source can be either plain grayscale or YCbCr (since Y == gray).\n */\n\nMETHODDEF(void)\ngrayscale_convert (j_compress_ptr cinfo,\n\t\t   JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n\t\t   JDIMENSION output_row, int num_rows)\n{\n  register JSAMPROW inptr;\n  register JSAMPROW outptr;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->image_width;\n  int instride = cinfo->input_components;\n\n  while (--num_rows >= 0) {\n    inptr = *input_buf++;\n    outptr = output_buf[0][output_row];\n    output_row++;\n    for (col = 0; col < num_cols; col++) {\n      outptr[col] = inptr[0];\t/* don't need GETJSAMPLE() here */\n      inptr += instride;\n    }\n  }\n}\n\n\n/*\n * Convert some rows of samples to the JPEG colorspace.\n * This version handles multi-component colorspaces without conversion.\n * We assume input_components == num_components.\n */\n\nMETHODDEF(void)\nnull_convert (j_compress_ptr cinfo,\n\t      JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n\t      JDIMENSION output_row, int num_rows)\n{\n  register JSAMPROW inptr;\n  register JSAMPROW outptr;\n  register JDIMENSION col;\n  register int ci;\n  int nc = cinfo->num_components;\n  JDIMENSION num_cols = cinfo->image_width;\n\n  while (--num_rows >= 0) {\n    /* It seems fastest to make a separate pass for each component. */\n    for (ci = 0; ci < nc; ci++) {\n      inptr = *input_buf;\n      outptr = output_buf[ci][output_row];\n      for (col = 0; col < num_cols; col++) {\n\toutptr[col] = inptr[ci]; /* don't need GETJSAMPLE() here */\n\tinptr += nc;\n      }\n    }\n    input_buf++;\n    output_row++;\n  }\n}\n\n\n/*\n * Empty method for start_pass.\n */\n\nMETHODDEF(void)\nnull_method (j_compress_ptr cinfo)\n{\n  /* no work needed */\n}\n\n\n/*\n * Module initialization routine for input colorspace conversion.\n */\n\nGLOBAL(void)\njinit_color_converter (j_compress_ptr cinfo)\n{\n  my_cconvert_ptr cconvert;\n\n  cconvert = (my_cconvert_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_color_converter));\n  cinfo->cconvert = (struct jpeg_color_converter *) cconvert;\n  /* set start_pass to null method until we find out differently */\n  cconvert->pub.start_pass = null_method;\n\n  /* Make sure input_components agrees with in_color_space */\n  switch (cinfo->in_color_space) {\n  case JCS_GRAYSCALE:\n    if (cinfo->input_components != 1)\n      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);\n    break;\n\n  case JCS_RGB:\n  case JCS_EXT_RGB:\n  case JCS_EXT_RGBX:\n  case JCS_EXT_BGR:\n  case JCS_EXT_BGRX:\n  case JCS_EXT_XBGR:\n  case JCS_EXT_XRGB:\n  case JCS_EXT_RGBA:\n  case JCS_EXT_BGRA:\n  case JCS_EXT_ABGR:\n  case JCS_EXT_ARGB:\n    if (cinfo->input_components != rgb_pixelsize[cinfo->in_color_space])\n      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);\n    break;\n\n  case JCS_YCbCr:\n    if (cinfo->input_components != 3)\n      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);\n    break;\n\n  case JCS_CMYK:\n  case JCS_YCCK:\n    if (cinfo->input_components != 4)\n      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);\n    break;\n\n  default:\t\t\t/* JCS_UNKNOWN can be anything */\n    if (cinfo->input_components < 1)\n      ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);\n    break;\n  }\n\n  /* Check num_components, set conversion method based on requested space */\n  switch (cinfo->jpeg_color_space) {\n  case JCS_GRAYSCALE:\n    if (cinfo->num_components != 1)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    if (cinfo->in_color_space == JCS_GRAYSCALE)\n      cconvert->pub.color_convert = grayscale_convert;\n    else if (cinfo->in_color_space == JCS_RGB ||\n             cinfo->in_color_space == JCS_EXT_RGB ||\n             cinfo->in_color_space == JCS_EXT_RGBX ||\n             cinfo->in_color_space == JCS_EXT_BGR ||\n             cinfo->in_color_space == JCS_EXT_BGRX ||\n             cinfo->in_color_space == JCS_EXT_XBGR ||\n             cinfo->in_color_space == JCS_EXT_XRGB ||\n             cinfo->in_color_space == JCS_EXT_RGBA ||\n             cinfo->in_color_space == JCS_EXT_BGRA ||\n             cinfo->in_color_space == JCS_EXT_ABGR ||\n             cinfo->in_color_space == JCS_EXT_ARGB) {\n      if (jsimd_can_rgb_gray())\n        cconvert->pub.color_convert = jsimd_rgb_gray_convert;\n      else {\n        cconvert->pub.start_pass = rgb_ycc_start;\n        cconvert->pub.color_convert = rgb_gray_convert;\n      }\n    } else if (cinfo->in_color_space == JCS_YCbCr)\n      cconvert->pub.color_convert = grayscale_convert;\n    else\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    break;\n\n  case JCS_RGB:\n    if (cinfo->num_components != 3)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    if (rgb_red[cinfo->in_color_space] == 0 &&\n        rgb_green[cinfo->in_color_space] == 1 &&\n        rgb_blue[cinfo->in_color_space] == 2 &&\n        rgb_pixelsize[cinfo->in_color_space] == 3)\n      cconvert->pub.color_convert = null_convert;\n    else if (cinfo->in_color_space == JCS_RGB ||\n             cinfo->in_color_space == JCS_EXT_RGB ||\n             cinfo->in_color_space == JCS_EXT_RGBX ||\n             cinfo->in_color_space == JCS_EXT_BGR ||\n             cinfo->in_color_space == JCS_EXT_BGRX ||\n             cinfo->in_color_space == JCS_EXT_XBGR ||\n             cinfo->in_color_space == JCS_EXT_XRGB ||\n             cinfo->in_color_space == JCS_EXT_RGBA ||\n             cinfo->in_color_space == JCS_EXT_BGRA ||\n             cinfo->in_color_space == JCS_EXT_ABGR ||\n             cinfo->in_color_space == JCS_EXT_ARGB)\n      cconvert->pub.color_convert = rgb_rgb_convert;\n    else\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    break;\n\n  case JCS_YCbCr:\n    if (cinfo->num_components != 3)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    if (cinfo->in_color_space == JCS_RGB ||\n        cinfo->in_color_space == JCS_EXT_RGB ||\n        cinfo->in_color_space == JCS_EXT_RGBX ||\n        cinfo->in_color_space == JCS_EXT_BGR ||\n        cinfo->in_color_space == JCS_EXT_BGRX ||\n        cinfo->in_color_space == JCS_EXT_XBGR ||\n        cinfo->in_color_space == JCS_EXT_XRGB ||\n        cinfo->in_color_space == JCS_EXT_RGBA ||\n        cinfo->in_color_space == JCS_EXT_BGRA ||\n        cinfo->in_color_space == JCS_EXT_ABGR ||\n        cinfo->in_color_space == JCS_EXT_ARGB) {\n      if (jsimd_can_rgb_ycc())\n        cconvert->pub.color_convert = jsimd_rgb_ycc_convert;\n      else {\n        cconvert->pub.start_pass = rgb_ycc_start;\n        cconvert->pub.color_convert = rgb_ycc_convert;\n      }\n    } else if (cinfo->in_color_space == JCS_YCbCr)\n      cconvert->pub.color_convert = null_convert;\n    else\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    break;\n\n  case JCS_CMYK:\n    if (cinfo->num_components != 4)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    if (cinfo->in_color_space == JCS_CMYK)\n      cconvert->pub.color_convert = null_convert;\n    else\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    break;\n\n  case JCS_YCCK:\n    if (cinfo->num_components != 4)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    if (cinfo->in_color_space == JCS_CMYK) {\n      cconvert->pub.start_pass = rgb_ycc_start;\n      cconvert->pub.color_convert = cmyk_ycck_convert;\n    } else if (cinfo->in_color_space == JCS_YCCK)\n      cconvert->pub.color_convert = null_convert;\n    else\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    break;\n\n  default:\t\t\t/* allow null conversion of JCS_UNKNOWN */\n    if (cinfo->jpeg_color_space != cinfo->in_color_space ||\n\tcinfo->num_components != cinfo->input_components)\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    cconvert->pub.color_convert = null_convert;\n    break;\n  }\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jcdctmgr.c",
    "content": "/*\n * jcdctmgr.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 1999-2006, MIYASAKA Masaru.\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright (C) 2011 D. R. Commander\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains the forward-DCT management logic.\n * This code selects a particular DCT implementation to be used,\n * and it performs related housekeeping chores including coefficient\n * quantization.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"\t\t/* Private declarations for DCT subsystem */\n#include \"jsimddct.h\"\n\n\n/* Private subobject for this module */\n\ntypedef JMETHOD(void, forward_DCT_method_ptr, (DCTELEM * data));\ntypedef JMETHOD(void, float_DCT_method_ptr, (FAST_FLOAT * data));\n\ntypedef JMETHOD(void, convsamp_method_ptr,\n                (JSAMPARRAY sample_data, JDIMENSION start_col,\n                 DCTELEM * workspace));\ntypedef JMETHOD(void, float_convsamp_method_ptr,\n                (JSAMPARRAY sample_data, JDIMENSION start_col,\n                 FAST_FLOAT *workspace));\n\ntypedef JMETHOD(void, quantize_method_ptr,\n                (JCOEFPTR coef_block, DCTELEM * divisors,\n                 DCTELEM * workspace));\ntypedef JMETHOD(void, float_quantize_method_ptr,\n                (JCOEFPTR coef_block, FAST_FLOAT * divisors,\n                 FAST_FLOAT * workspace));\n\nMETHODDEF(void) quantize (JCOEFPTR, DCTELEM *, DCTELEM *);\n\ntypedef struct {\n  struct jpeg_forward_dct pub;\t/* public fields */\n\n  /* Pointer to the DCT routine actually in use */\n  forward_DCT_method_ptr dct;\n  convsamp_method_ptr convsamp;\n  quantize_method_ptr quantize;\n\n  /* The actual post-DCT divisors --- not identical to the quant table\n   * entries, because of scaling (especially for an unnormalized DCT).\n   * Each table is given in normal array order.\n   */\n  DCTELEM * divisors[NUM_QUANT_TBLS];\n\n  /* work area for FDCT subroutine */\n  DCTELEM * workspace;\n\n#ifdef DCT_FLOAT_SUPPORTED\n  /* Same as above for the floating-point case. */\n  float_DCT_method_ptr float_dct;\n  float_convsamp_method_ptr float_convsamp;\n  float_quantize_method_ptr float_quantize;\n  FAST_FLOAT * float_divisors[NUM_QUANT_TBLS];\n  FAST_FLOAT * float_workspace;\n#endif\n} my_fdct_controller;\n\ntypedef my_fdct_controller * my_fdct_ptr;\n\n\n/*\n * Find the highest bit in an integer through binary search.\n */\nLOCAL(int)\nflss (UINT16 val)\n{\n  int bit;\n\n  bit = 16;\n\n  if (!val)\n    return 0;\n\n  if (!(val & 0xff00)) {\n    bit -= 8;\n    val <<= 8;\n  }\n  if (!(val & 0xf000)) {\n    bit -= 4;\n    val <<= 4;\n  }\n  if (!(val & 0xc000)) {\n    bit -= 2;\n    val <<= 2;\n  }\n  if (!(val & 0x8000)) {\n    bit -= 1;\n    val <<= 1;\n  }\n\n  return bit;\n}\n\n/*\n * Compute values to do a division using reciprocal.\n *\n * This implementation is based on an algorithm described in\n *   \"How to optimize for the Pentium family of microprocessors\"\n *   (http://www.agner.org/assem/).\n * More information about the basic algorithm can be found in\n * the paper \"Integer Division Using Reciprocals\" by Robert Alverson.\n *\n * The basic idea is to replace x/d by x * d^-1. In order to store\n * d^-1 with enough precision we shift it left a few places. It turns\n * out that this algoright gives just enough precision, and also fits\n * into DCTELEM:\n *\n *   b = (the number of significant bits in divisor) - 1\n *   r = (word size) + b\n *   f = 2^r / divisor\n *\n * f will not be an integer for most cases, so we need to compensate\n * for the rounding error introduced:\n *\n *   no fractional part:\n *\n *       result = input >> r\n *\n *   fractional part of f < 0.5:\n *\n *       round f down to nearest integer\n *       result = ((input + 1) * f) >> r\n *\n *   fractional part of f > 0.5:\n *\n *       round f up to nearest integer\n *       result = (input * f) >> r\n *\n * This is the original algorithm that gives truncated results. But we\n * want properly rounded results, so we replace \"input\" with\n * \"input + divisor/2\".\n *\n * In order to allow SIMD implementations we also tweak the values to\n * allow the same calculation to be made at all times:\n * \n *   dctbl[0] = f rounded to nearest integer\n *   dctbl[1] = divisor / 2 (+ 1 if fractional part of f < 0.5)\n *   dctbl[2] = 1 << ((word size) * 2 - r)\n *   dctbl[3] = r - (word size)\n *\n * dctbl[2] is for stupid instruction sets where the shift operation\n * isn't member wise (e.g. MMX).\n *\n * The reason dctbl[2] and dctbl[3] reduce the shift with (word size)\n * is that most SIMD implementations have a \"multiply and store top\n * half\" operation.\n *\n * Lastly, we store each of the values in their own table instead\n * of in a consecutive manner, yet again in order to allow SIMD\n * routines.\n */\nLOCAL(int)\ncompute_reciprocal (UINT16 divisor, DCTELEM * dtbl)\n{\n  UDCTELEM2 fq, fr;\n  UDCTELEM c;\n  int b, r;\n\n  b = flss(divisor) - 1;\n  r  = sizeof(DCTELEM) * 8 + b;\n\n  fq = ((UDCTELEM2)1 << r) / divisor;\n  fr = ((UDCTELEM2)1 << r) % divisor;\n\n  c = divisor / 2; /* for rounding */\n\n  if (fr == 0) { /* divisor is power of two */\n    /* fq will be one bit too large to fit in DCTELEM, so adjust */\n    fq >>= 1;\n    r--;\n  } else if (fr <= (divisor / 2U)) { /* fractional part is < 0.5 */\n    c++;\n  } else { /* fractional part is > 0.5 */\n    fq++;\n  }\n\n  dtbl[DCTSIZE2 * 0] = (DCTELEM) fq;      /* reciprocal */\n  dtbl[DCTSIZE2 * 1] = (DCTELEM) c;       /* correction + roundfactor */\n  dtbl[DCTSIZE2 * 2] = (DCTELEM) (1 << (sizeof(DCTELEM)*8*2 - r));  /* scale */\n  dtbl[DCTSIZE2 * 3] = (DCTELEM) r - sizeof(DCTELEM)*8; /* shift */\n\n  if(r <= 16) return 0;\n  else return 1;\n}\n\n/*\n * Initialize for a processing pass.\n * Verify that all referenced Q-tables are present, and set up\n * the divisor table for each one.\n * In the current implementation, DCT of all components is done during\n * the first pass, even if only some components will be output in the\n * first scan.  Hence all components should be examined here.\n */\n\nMETHODDEF(void)\nstart_pass_fdctmgr (j_compress_ptr cinfo)\n{\n  my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;\n  int ci, qtblno, i;\n  jpeg_component_info *compptr;\n  JQUANT_TBL * qtbl;\n  DCTELEM * dtbl;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    qtblno = compptr->quant_tbl_no;\n    /* Make sure specified quantization table is present */\n    if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS ||\n\tcinfo->quant_tbl_ptrs[qtblno] == NULL)\n      ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);\n    qtbl = cinfo->quant_tbl_ptrs[qtblno];\n    /* Compute divisors for this quant table */\n    /* We may do this more than once for same table, but it's not a big deal */\n    switch (cinfo->dct_method) {\n#ifdef DCT_ISLOW_SUPPORTED\n    case JDCT_ISLOW:\n      /* For LL&M IDCT method, divisors are equal to raw quantization\n       * coefficients multiplied by 8 (to counteract scaling).\n       */\n      if (fdct->divisors[qtblno] == NULL) {\n\tfdct->divisors[qtblno] = (DCTELEM *)\n\t  (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t      (DCTSIZE2 * 4) * SIZEOF(DCTELEM));\n      }\n      dtbl = fdct->divisors[qtblno];\n      for (i = 0; i < DCTSIZE2; i++) {\n\tif(!compute_reciprocal(qtbl->quantval[i] << 3, &dtbl[i])\n\t  && fdct->quantize == jsimd_quantize)\n\t  fdct->quantize = quantize;\n      }\n      break;\n#endif\n#ifdef DCT_IFAST_SUPPORTED\n    case JDCT_IFAST:\n      {\n\t/* For AA&N IDCT method, divisors are equal to quantization\n\t * coefficients scaled by scalefactor[row]*scalefactor[col], where\n\t *   scalefactor[0] = 1\n\t *   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7\n\t * We apply a further scale factor of 8.\n\t */\n#define CONST_BITS 14\n\tstatic const INT16 aanscales[DCTSIZE2] = {\n\t  /* precomputed values scaled up by 14 bits */\n\t  16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,\n\t  22725, 31521, 29692, 26722, 22725, 17855, 12299,  6270,\n\t  21407, 29692, 27969, 25172, 21407, 16819, 11585,  5906,\n\t  19266, 26722, 25172, 22654, 19266, 15137, 10426,  5315,\n\t  16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,\n\t  12873, 17855, 16819, 15137, 12873, 10114,  6967,  3552,\n\t   8867, 12299, 11585, 10426,  8867,  6967,  4799,  2446,\n\t   4520,  6270,  5906,  5315,  4520,  3552,  2446,  1247\n\t};\n\tSHIFT_TEMPS\n\n\tif (fdct->divisors[qtblno] == NULL) {\n\t  fdct->divisors[qtblno] = (DCTELEM *)\n\t    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t\t(DCTSIZE2 * 4) * SIZEOF(DCTELEM));\n\t}\n\tdtbl = fdct->divisors[qtblno];\n\tfor (i = 0; i < DCTSIZE2; i++) {\n\t  if(!compute_reciprocal(\n\t    DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],\n\t\t\t\t  (INT32) aanscales[i]),\n\t\t    CONST_BITS-3), &dtbl[i])\n\t    && fdct->quantize == jsimd_quantize)\n\t    fdct->quantize = quantize;\n\t}\n      }\n      break;\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n    case JDCT_FLOAT:\n      {\n\t/* For float AA&N IDCT method, divisors are equal to quantization\n\t * coefficients scaled by scalefactor[row]*scalefactor[col], where\n\t *   scalefactor[0] = 1\n\t *   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7\n\t * We apply a further scale factor of 8.\n\t * What's actually stored is 1/divisor so that the inner loop can\n\t * use a multiplication rather than a division.\n\t */\n\tFAST_FLOAT * fdtbl;\n\tint row, col;\n\tstatic const double aanscalefactor[DCTSIZE] = {\n\t  1.0, 1.387039845, 1.306562965, 1.175875602,\n\t  1.0, 0.785694958, 0.541196100, 0.275899379\n\t};\n\n\tif (fdct->float_divisors[qtblno] == NULL) {\n\t  fdct->float_divisors[qtblno] = (FAST_FLOAT *)\n\t    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t\tDCTSIZE2 * SIZEOF(FAST_FLOAT));\n\t}\n\tfdtbl = fdct->float_divisors[qtblno];\n\ti = 0;\n\tfor (row = 0; row < DCTSIZE; row++) {\n\t  for (col = 0; col < DCTSIZE; col++) {\n\t    fdtbl[i] = (FAST_FLOAT)\n\t      (1.0 / (((double) qtbl->quantval[i] *\n\t\t       aanscalefactor[row] * aanscalefactor[col] * 8.0)));\n\t    i++;\n\t  }\n\t}\n      }\n      break;\n#endif\n    default:\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n      break;\n    }\n  }\n}\n\n\n/*\n * Load data into workspace, applying unsigned->signed conversion.\n */\n\nMETHODDEF(void)\nconvsamp (JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM * workspace)\n{\n  register DCTELEM *workspaceptr;\n  register JSAMPROW elemptr;\n  register int elemr;\n\n  workspaceptr = workspace;\n  for (elemr = 0; elemr < DCTSIZE; elemr++) {\n    elemptr = sample_data[elemr] + start_col;\n\n#if DCTSIZE == 8\t\t/* unroll the inner loop */\n    *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;\n    *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;\n    *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;\n    *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;\n    *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;\n    *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;\n    *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;\n    *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;\n#else\n    {\n      register int elemc;\n      for (elemc = DCTSIZE; elemc > 0; elemc--)\n        *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;\n    }\n#endif\n  }\n}\n\n\n/*\n * Quantize/descale the coefficients, and store into coef_blocks[].\n */\n\nMETHODDEF(void)\nquantize (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace)\n{\n  int i;\n  DCTELEM temp;\n  UDCTELEM recip, corr, shift;\n  UDCTELEM2 product;\n  JCOEFPTR output_ptr = coef_block;\n\n  for (i = 0; i < DCTSIZE2; i++) {\n    temp = workspace[i];\n    recip = divisors[i + DCTSIZE2 * 0];\n    corr =  divisors[i + DCTSIZE2 * 1];\n    shift = divisors[i + DCTSIZE2 * 3];\n\n    if (temp < 0) {\n      temp = -temp;\n      product = (UDCTELEM2)(temp + corr) * recip;\n      product >>= shift + sizeof(DCTELEM)*8;\n      temp = product;\n      temp = -temp;\n    } else {\n      product = (UDCTELEM2)(temp + corr) * recip;\n      product >>= shift + sizeof(DCTELEM)*8;\n      temp = product;\n    }\n\n    output_ptr[i] = (JCOEF) temp;\n  }\n}\n\n\n/*\n * Perform forward DCT on one or more blocks of a component.\n *\n * The input samples are taken from the sample_data[] array starting at\n * position start_row/start_col, and moving to the right for any additional\n * blocks. The quantized coefficients are returned in coef_blocks[].\n */\n\nMETHODDEF(void)\nforward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr,\n\t     JSAMPARRAY sample_data, JBLOCKROW coef_blocks,\n\t     JDIMENSION start_row, JDIMENSION start_col,\n\t     JDIMENSION num_blocks)\n/* This version is used for integer DCT implementations. */\n{\n  /* This routine is heavily used, so it's worth coding it tightly. */\n  my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;\n  DCTELEM * divisors = fdct->divisors[compptr->quant_tbl_no];\n  DCTELEM * workspace;\n  JDIMENSION bi;\n\n  /* Make sure the compiler doesn't look up these every pass */\n  forward_DCT_method_ptr do_dct = fdct->dct;\n  convsamp_method_ptr do_convsamp = fdct->convsamp;\n  quantize_method_ptr do_quantize = fdct->quantize;\n  workspace = fdct->workspace;\n\n  sample_data += start_row;\t/* fold in the vertical offset once */\n\n  for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) {\n    /* Load data into workspace, applying unsigned->signed conversion */\n    (*do_convsamp) (sample_data, start_col, workspace);\n\n    /* Perform the DCT */\n    (*do_dct) (workspace);\n\n    /* Quantize/descale the coefficients, and store into coef_blocks[] */\n    (*do_quantize) (coef_blocks[bi], divisors, workspace);\n  }\n}\n\n\n#ifdef DCT_FLOAT_SUPPORTED\n\n\nMETHODDEF(void)\nconvsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col, FAST_FLOAT * workspace)\n{\n  register FAST_FLOAT *workspaceptr;\n  register JSAMPROW elemptr;\n  register int elemr;\n\n  workspaceptr = workspace;\n  for (elemr = 0; elemr < DCTSIZE; elemr++) {\n    elemptr = sample_data[elemr] + start_col;\n#if DCTSIZE == 8\t\t/* unroll the inner loop */\n    *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);\n    *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);\n    *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);\n    *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);\n    *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);\n    *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);\n    *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);\n    *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);\n#else\n    {\n      register int elemc;\n      for (elemc = DCTSIZE; elemc > 0; elemc--)\n        *workspaceptr++ = (FAST_FLOAT)\n                          (GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);\n    }\n#endif\n  }\n}\n\n\nMETHODDEF(void)\nquantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors, FAST_FLOAT * workspace)\n{\n  register FAST_FLOAT temp;\n  register int i;\n  register JCOEFPTR output_ptr = coef_block;\n\n  for (i = 0; i < DCTSIZE2; i++) {\n    /* Apply the quantization and scaling factor */\n    temp = workspace[i] * divisors[i];\n\n    /* Round to nearest integer.\n     * Since C does not specify the direction of rounding for negative\n     * quotients, we have to force the dividend positive for portability.\n     * The maximum coefficient size is +-16K (for 12-bit data), so this\n     * code should work for either 16-bit or 32-bit ints.\n     */\n    output_ptr[i] = (JCOEF) ((int) (temp + (FAST_FLOAT) 16384.5) - 16384);\n  }\n}\n\n\nMETHODDEF(void)\nforward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr,\n\t\t   JSAMPARRAY sample_data, JBLOCKROW coef_blocks,\n\t\t   JDIMENSION start_row, JDIMENSION start_col,\n\t\t   JDIMENSION num_blocks)\n/* This version is used for floating-point DCT implementations. */\n{\n  /* This routine is heavily used, so it's worth coding it tightly. */\n  my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;\n  FAST_FLOAT * divisors = fdct->float_divisors[compptr->quant_tbl_no];\n  FAST_FLOAT * workspace;\n  JDIMENSION bi;\n\n\n  /* Make sure the compiler doesn't look up these every pass */\n  float_DCT_method_ptr do_dct = fdct->float_dct;\n  float_convsamp_method_ptr do_convsamp = fdct->float_convsamp;\n  float_quantize_method_ptr do_quantize = fdct->float_quantize;\n  workspace = fdct->float_workspace;\n\n  sample_data += start_row;\t/* fold in the vertical offset once */\n\n  for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) {\n    /* Load data into workspace, applying unsigned->signed conversion */\n    (*do_convsamp) (sample_data, start_col, workspace);\n\n    /* Perform the DCT */\n    (*do_dct) (workspace);\n\n    /* Quantize/descale the coefficients, and store into coef_blocks[] */\n    (*do_quantize) (coef_blocks[bi], divisors, workspace);\n  }\n}\n\n#endif /* DCT_FLOAT_SUPPORTED */\n\n\n/*\n * Initialize FDCT manager.\n */\n\nGLOBAL(void)\njinit_forward_dct (j_compress_ptr cinfo)\n{\n  my_fdct_ptr fdct;\n  int i;\n\n  fdct = (my_fdct_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_fdct_controller));\n  cinfo->fdct = (struct jpeg_forward_dct *) fdct;\n  fdct->pub.start_pass = start_pass_fdctmgr;\n\n  /* First determine the DCT... */\n  switch (cinfo->dct_method) {\n#ifdef DCT_ISLOW_SUPPORTED\n  case JDCT_ISLOW:\n    fdct->pub.forward_DCT = forward_DCT;\n    if (jsimd_can_fdct_islow())\n      fdct->dct = jsimd_fdct_islow;\n    else\n      fdct->dct = jpeg_fdct_islow;\n    break;\n#endif\n#ifdef DCT_IFAST_SUPPORTED\n  case JDCT_IFAST:\n    fdct->pub.forward_DCT = forward_DCT;\n    if (jsimd_can_fdct_ifast())\n      fdct->dct = jsimd_fdct_ifast;\n    else\n      fdct->dct = jpeg_fdct_ifast;\n    break;\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n  case JDCT_FLOAT:\n    fdct->pub.forward_DCT = forward_DCT_float;\n    if (jsimd_can_fdct_float())\n      fdct->float_dct = jsimd_fdct_float;\n    else\n      fdct->float_dct = jpeg_fdct_float;\n    break;\n#endif\n  default:\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n    break;\n  }\n\n  /* ...then the supporting stages. */\n  switch (cinfo->dct_method) {\n#ifdef DCT_ISLOW_SUPPORTED\n  case JDCT_ISLOW:\n#endif\n#ifdef DCT_IFAST_SUPPORTED\n  case JDCT_IFAST:\n#endif\n#if defined(DCT_ISLOW_SUPPORTED) || defined(DCT_IFAST_SUPPORTED)\n    if (jsimd_can_convsamp())\n      fdct->convsamp = jsimd_convsamp;\n    else\n      fdct->convsamp = convsamp;\n    if (jsimd_can_quantize())\n      fdct->quantize = jsimd_quantize;\n    else\n      fdct->quantize = quantize;\n    break;\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n  case JDCT_FLOAT:\n    if (jsimd_can_convsamp_float())\n      fdct->float_convsamp = jsimd_convsamp_float;\n    else\n      fdct->float_convsamp = convsamp_float;\n    if (jsimd_can_quantize_float())\n      fdct->float_quantize = jsimd_quantize_float;\n    else\n      fdct->float_quantize = quantize_float;\n    break;\n#endif\n  default:\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n    break;\n  }\n\n  /* Allocate workspace memory */\n#ifdef DCT_FLOAT_SUPPORTED\n  if (cinfo->dct_method == JDCT_FLOAT)\n    fdct->float_workspace = (FAST_FLOAT *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(FAST_FLOAT) * DCTSIZE2);\n  else\n#endif\n    fdct->workspace = (DCTELEM *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(DCTELEM) * DCTSIZE2);\n\n  /* Mark divisor tables unallocated */\n  for (i = 0; i < NUM_QUANT_TBLS; i++) {\n    fdct->divisors[i] = NULL;\n#ifdef DCT_FLOAT_SUPPORTED\n    fdct->float_divisors[i] = NULL;\n#endif\n  }\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jchuff.c",
    "content": "/*\n * jchuff.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2009-2011, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains Huffman entropy encoding routines.\n *\n * Much of the complexity here has to do with supporting output suspension.\n * If the data destination module demands suspension, we want to be able to\n * back up to the start of the current MCU.  To do this, we copy state\n * variables into local working storage, and update them back to the\n * permanent JPEG objects only upon successful completion of an MCU.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jchuff.h\"\t\t/* Declarations shared with jcphuff.c */\n#include <limits.h>\n\nstatic unsigned char jpeg_nbits_table[65536];\nstatic int jpeg_nbits_table_init = 0;\n\n#ifndef min\n #define min(a,b) ((a)<(b)?(a):(b))\n#endif\n\n\n/* Expanded entropy encoder object for Huffman encoding.\n *\n * The savable_state subrecord contains fields that change within an MCU,\n * but must not be updated permanently until we complete the MCU.\n */\n\ntypedef struct {\n  size_t put_buffer;\t\t/* current bit-accumulation buffer */\n  int put_bits;\t\t\t/* # of bits now in it */\n  int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */\n} savable_state;\n\n/* This macro is to work around compilers with missing or broken\n * structure assignment.  You'll need to fix this code if you have\n * such a compiler and you change MAX_COMPS_IN_SCAN.\n */\n\n#ifndef NO_STRUCT_ASSIGN\n#define ASSIGN_STATE(dest,src)  ((dest) = (src))\n#else\n#if MAX_COMPS_IN_SCAN == 4\n#define ASSIGN_STATE(dest,src)  \\\n\t((dest).put_buffer = (src).put_buffer, \\\n\t (dest).put_bits = (src).put_bits, \\\n\t (dest).last_dc_val[0] = (src).last_dc_val[0], \\\n\t (dest).last_dc_val[1] = (src).last_dc_val[1], \\\n\t (dest).last_dc_val[2] = (src).last_dc_val[2], \\\n\t (dest).last_dc_val[3] = (src).last_dc_val[3])\n#endif\n#endif\n\n\ntypedef struct {\n  struct jpeg_entropy_encoder pub; /* public fields */\n\n  savable_state saved;\t\t/* Bit buffer & DC state at start of MCU */\n\n  /* These fields are NOT loaded into local working state. */\n  unsigned int restarts_to_go;\t/* MCUs left in this restart interval */\n  int next_restart_num;\t\t/* next restart number to write (0-7) */\n\n  /* Pointers to derived tables (these workspaces have image lifespan) */\n  c_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS];\n  c_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS];\n\n#ifdef ENTROPY_OPT_SUPPORTED\t/* Statistics tables for optimization */\n  long * dc_count_ptrs[NUM_HUFF_TBLS];\n  long * ac_count_ptrs[NUM_HUFF_TBLS];\n#endif\n} huff_entropy_encoder;\n\ntypedef huff_entropy_encoder * huff_entropy_ptr;\n\n/* Working state while writing an MCU.\n * This struct contains all the fields that are needed by subroutines.\n */\n\ntypedef struct {\n  JOCTET * next_output_byte;\t/* => next byte to write in buffer */\n  size_t free_in_buffer;\t/* # of byte spaces remaining in buffer */\n  savable_state cur;\t\t/* Current bit buffer & DC state */\n  j_compress_ptr cinfo;\t\t/* dump_buffer needs access to this */\n} working_state;\n\n\n/* Forward declarations */\nMETHODDEF(boolean) encode_mcu_huff JPP((j_compress_ptr cinfo,\n\t\t\t\t\tJBLOCKROW *MCU_data));\nMETHODDEF(void) finish_pass_huff JPP((j_compress_ptr cinfo));\n#ifdef ENTROPY_OPT_SUPPORTED\nMETHODDEF(boolean) encode_mcu_gather JPP((j_compress_ptr cinfo,\n\t\t\t\t\t  JBLOCKROW *MCU_data));\nMETHODDEF(void) finish_pass_gather JPP((j_compress_ptr cinfo));\n#endif\n\n\n/*\n * Initialize for a Huffman-compressed scan.\n * If gather_statistics is TRUE, we do not output anything during the scan,\n * just count the Huffman symbols used and generate Huffman code tables.\n */\n\nMETHODDEF(void)\nstart_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  int ci, dctbl, actbl;\n  jpeg_component_info * compptr;\n\n  if (gather_statistics) {\n#ifdef ENTROPY_OPT_SUPPORTED\n    entropy->pub.encode_mcu = encode_mcu_gather;\n    entropy->pub.finish_pass = finish_pass_gather;\n#else\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n  } else {\n    entropy->pub.encode_mcu = encode_mcu_huff;\n    entropy->pub.finish_pass = finish_pass_huff;\n  }\n\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    dctbl = compptr->dc_tbl_no;\n    actbl = compptr->ac_tbl_no;\n    if (gather_statistics) {\n#ifdef ENTROPY_OPT_SUPPORTED\n      /* Check for invalid table indexes */\n      /* (make_c_derived_tbl does this in the other path) */\n      if (dctbl < 0 || dctbl >= NUM_HUFF_TBLS)\n\tERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dctbl);\n      if (actbl < 0 || actbl >= NUM_HUFF_TBLS)\n\tERREXIT1(cinfo, JERR_NO_HUFF_TABLE, actbl);\n      /* Allocate and zero the statistics tables */\n      /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */\n      if (entropy->dc_count_ptrs[dctbl] == NULL)\n\tentropy->dc_count_ptrs[dctbl] = (long *)\n\t  (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t      257 * SIZEOF(long));\n      MEMZERO(entropy->dc_count_ptrs[dctbl], 257 * SIZEOF(long));\n      if (entropy->ac_count_ptrs[actbl] == NULL)\n\tentropy->ac_count_ptrs[actbl] = (long *)\n\t  (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t      257 * SIZEOF(long));\n      MEMZERO(entropy->ac_count_ptrs[actbl], 257 * SIZEOF(long));\n#endif\n    } else {\n      /* Compute derived values for Huffman tables */\n      /* We may do this more than once for a table, but it's not expensive */\n      jpeg_make_c_derived_tbl(cinfo, TRUE, dctbl,\n\t\t\t      & entropy->dc_derived_tbls[dctbl]);\n      jpeg_make_c_derived_tbl(cinfo, FALSE, actbl,\n\t\t\t      & entropy->ac_derived_tbls[actbl]);\n    }\n    /* Initialize DC predictions to 0 */\n    entropy->saved.last_dc_val[ci] = 0;\n  }\n\n  /* Initialize bit buffer to empty */\n  entropy->saved.put_buffer = 0;\n  entropy->saved.put_bits = 0;\n\n  /* Initialize restart stuff */\n  entropy->restarts_to_go = cinfo->restart_interval;\n  entropy->next_restart_num = 0;\n}\n\n\n/*\n * Compute the derived values for a Huffman table.\n * This routine also performs some validation checks on the table.\n *\n * Note this is also used by jcphuff.c.\n */\n\nGLOBAL(void)\njpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,\n\t\t\t c_derived_tbl ** pdtbl)\n{\n  JHUFF_TBL *htbl;\n  c_derived_tbl *dtbl;\n  int p, i, l, lastp, si, maxsymbol;\n  char huffsize[257];\n  unsigned int huffcode[257];\n  unsigned int code;\n\n  /* Note that huffsize[] and huffcode[] are filled in code-length order,\n   * paralleling the order of the symbols themselves in htbl->huffval[].\n   */\n\n  /* Find the input Huffman table */\n  if (tblno < 0 || tblno >= NUM_HUFF_TBLS)\n    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);\n  htbl =\n    isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];\n  if (htbl == NULL)\n    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);\n\n  /* Allocate a workspace if we haven't already done so. */\n  if (*pdtbl == NULL)\n    *pdtbl = (c_derived_tbl *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(c_derived_tbl));\n  dtbl = *pdtbl;\n  \n  /* Figure C.1: make table of Huffman code length for each symbol */\n\n  p = 0;\n  for (l = 1; l <= 16; l++) {\n    i = (int) htbl->bits[l];\n    if (i < 0 || p + i > 256)\t/* protect against table overrun */\n      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n    while (i--)\n      huffsize[p++] = (char) l;\n  }\n  huffsize[p] = 0;\n  lastp = p;\n  \n  /* Figure C.2: generate the codes themselves */\n  /* We also validate that the counts represent a legal Huffman code tree. */\n\n  code = 0;\n  si = huffsize[0];\n  p = 0;\n  while (huffsize[p]) {\n    while (((int) huffsize[p]) == si) {\n      huffcode[p++] = code;\n      code++;\n    }\n    /* code is now 1 more than the last code used for codelength si; but\n     * it must still fit in si bits, since no code is allowed to be all ones.\n     */\n    if (((INT32) code) >= (((INT32) 1) << si))\n      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n    code <<= 1;\n    si++;\n  }\n  \n  /* Figure C.3: generate encoding tables */\n  /* These are code and size indexed by symbol value */\n\n  /* Set all codeless symbols to have code length 0;\n   * this lets us detect duplicate VAL entries here, and later\n   * allows emit_bits to detect any attempt to emit such symbols.\n   */\n  MEMZERO(dtbl->ehufsi, SIZEOF(dtbl->ehufsi));\n\n  /* This is also a convenient place to check for out-of-range\n   * and duplicated VAL entries.  We allow 0..255 for AC symbols\n   * but only 0..15 for DC.  (We could constrain them further\n   * based on data depth and mode, but this seems enough.)\n   */\n  maxsymbol = isDC ? 15 : 255;\n\n  for (p = 0; p < lastp; p++) {\n    i = htbl->huffval[p];\n    if (i < 0 || i > maxsymbol || dtbl->ehufsi[i])\n      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n    dtbl->ehufco[i] = huffcode[p];\n    dtbl->ehufsi[i] = huffsize[p];\n  }\n\n  if(!jpeg_nbits_table_init) {\n    for(i = 0; i < 65536; i++) {\n      int nbits = 0, temp = i;\n      while (temp) {temp >>= 1;  nbits++;}\n      jpeg_nbits_table[i] = nbits;\n    }\n    jpeg_nbits_table_init = 1;\n  }\n}\n\n\n/* Outputting bytes to the file */\n\n/* Emit a byte, taking 'action' if must suspend. */\n#define emit_byte(state,val,action)  \\\n\t{ *(state)->next_output_byte++ = (JOCTET) (val);  \\\n\t  if (--(state)->free_in_buffer == 0)  \\\n\t    if (! dump_buffer(state))  \\\n\t      { action; } }\n\n\nLOCAL(boolean)\ndump_buffer (working_state * state)\n/* Empty the output buffer; return TRUE if successful, FALSE if must suspend */\n{\n  struct jpeg_destination_mgr * dest = state->cinfo->dest;\n\n  if (! (*dest->empty_output_buffer) (state->cinfo))\n    return FALSE;\n  /* After a successful buffer dump, must reset buffer pointers */\n  state->next_output_byte = dest->next_output_byte;\n  state->free_in_buffer = dest->free_in_buffer;\n  return TRUE;\n}\n\n\n/* Outputting bits to the file */\n\n/* These macros perform the same task as the emit_bits() function in the\n * original libjpeg code.  In addition to reducing overhead by explicitly\n * inlining the code, additional performance is achieved by taking into\n * account the size of the bit buffer and waiting until it is almost full\n * before emptying it.  This mostly benefits 64-bit platforms, since 6\n * bytes can be stored in a 64-bit bit buffer before it has to be emptied.\n */\n\n#define EMIT_BYTE() { \\\n  JOCTET c; \\\n  put_bits -= 8; \\\n  c = (JOCTET)GETJOCTET(put_buffer >> put_bits); \\\n  *buffer++ = c; \\\n  if (c == 0xFF)  /* need to stuff a zero byte? */ \\\n    *buffer++ = 0; \\\n }\n\n#define PUT_BITS(code, size) { \\\n  put_bits += size; \\\n  put_buffer = (put_buffer << size) | code; \\\n}\n\n#define CHECKBUF15() { \\\n  if (put_bits > 15) { \\\n    EMIT_BYTE() \\\n    EMIT_BYTE() \\\n  } \\\n}\n\n#define CHECKBUF31() { \\\n  if (put_bits > 31) { \\\n    EMIT_BYTE() \\\n    EMIT_BYTE() \\\n    EMIT_BYTE() \\\n    EMIT_BYTE() \\\n  } \\\n}\n\n#define CHECKBUF47() { \\\n  if (put_bits > 47) { \\\n    EMIT_BYTE() \\\n    EMIT_BYTE() \\\n    EMIT_BYTE() \\\n    EMIT_BYTE() \\\n    EMIT_BYTE() \\\n    EMIT_BYTE() \\\n  } \\\n}\n\n#if __WORDSIZE==64 || defined(_WIN64)\n\n#define EMIT_BITS(code, size) { \\\n  CHECKBUF47() \\\n  PUT_BITS(code, size) \\\n}\n\n#define EMIT_CODE(code, size) { \\\n  temp2 &= (((INT32) 1)<<nbits) - 1; \\\n  CHECKBUF31() \\\n  PUT_BITS(code, size) \\\n  PUT_BITS(temp2, nbits) \\\n }\n\n#else\n\n#define EMIT_BITS(code, size) { \\\n  PUT_BITS(code, size) \\\n  CHECKBUF15() \\\n}\n\n#define EMIT_CODE(code, size) { \\\n  temp2 &= (((INT32) 1)<<nbits) - 1; \\\n  PUT_BITS(code, size) \\\n  CHECKBUF15() \\\n  PUT_BITS(temp2, nbits) \\\n  CHECKBUF15() \\\n }\n\n#endif\n\n\n#define BUFSIZE (DCTSIZE2 * 2)\n\n#define LOAD_BUFFER() { \\\n  if (state->free_in_buffer < BUFSIZE) { \\\n    localbuf = 1; \\\n    buffer = _buffer; \\\n  } \\\n  else buffer = state->next_output_byte; \\\n }\n\n#define STORE_BUFFER() { \\\n  if (localbuf) { \\\n    bytes = buffer - _buffer; \\\n    buffer = _buffer; \\\n    while (bytes > 0) { \\\n      bytestocopy = min(bytes, state->free_in_buffer); \\\n      MEMCOPY(state->next_output_byte, buffer, bytestocopy); \\\n      state->next_output_byte += bytestocopy; \\\n      buffer += bytestocopy; \\\n      state->free_in_buffer -= bytestocopy; \\\n      if (state->free_in_buffer == 0) \\\n        if (! dump_buffer(state)) return FALSE; \\\n      bytes -= bytestocopy; \\\n    } \\\n  } \\\n  else { \\\n    state->free_in_buffer -= (buffer - state->next_output_byte); \\\n    state->next_output_byte = buffer; \\\n  } \\\n }\n\n\nLOCAL(boolean)\nflush_bits (working_state * state)\n{\n  JOCTET _buffer[BUFSIZE], *buffer;\n  size_t put_buffer;  int put_bits;\n  size_t bytes, bytestocopy;  int localbuf = 0;\n\n  put_buffer = state->cur.put_buffer;\n  put_bits = state->cur.put_bits;\n  LOAD_BUFFER()\n\n  /* fill any partial byte with ones */\n  PUT_BITS(0x7F, 7)\n  while (put_bits >= 8) EMIT_BYTE()\n\n  state->cur.put_buffer = 0;\t/* and reset bit-buffer to empty */\n  state->cur.put_bits = 0;\n  STORE_BUFFER()\n\n  return TRUE;\n}\n\n\n/* Encode a single block's worth of coefficients */\n\nLOCAL(boolean)\nencode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,\n\t\t  c_derived_tbl *dctbl, c_derived_tbl *actbl)\n{\n  int temp, temp2, temp3;\n  int nbits;\n  int r, code, size;\n  JOCTET _buffer[BUFSIZE], *buffer;\n  size_t put_buffer;  int put_bits;\n  int code_0xf0 = actbl->ehufco[0xf0], size_0xf0 = actbl->ehufsi[0xf0];\n  size_t bytes, bytestocopy;  int localbuf = 0;\n\n  put_buffer = state->cur.put_buffer;\n  put_bits = state->cur.put_bits;\n  LOAD_BUFFER()\n\n  /* Encode the DC coefficient difference per section F.1.2.1 */\n  \n  temp = temp2 = block[0] - last_dc_val;\n\n /* This is a well-known technique for obtaining the absolute value without a\n  * branch.  It is derived from an assembly language technique presented in\n  * \"How to Optimize for the Pentium Processors\", Copyright (c) 1996, 1997 by\n  * Agner Fog.\n  */\n  temp3 = temp >> (CHAR_BIT * sizeof(int) - 1);\n  temp ^= temp3;\n  temp -= temp3;\n\n  /* For a negative input, want temp2 = bitwise complement of abs(input) */\n  /* This code assumes we are on a two's complement machine */\n  temp2 += temp3;\n\n  /* Find the number of bits needed for the magnitude of the coefficient */\n  nbits = jpeg_nbits_table[temp];\n\n  /* Emit the Huffman-coded symbol for the number of bits */\n  code = dctbl->ehufco[nbits];\n  size = dctbl->ehufsi[nbits];\n  PUT_BITS(code, size)\n  CHECKBUF15()\n\n  /* Mask off any extra bits in code */\n  temp2 &= (((INT32) 1)<<nbits) - 1;\n\n  /* Emit that number of bits of the value, if positive, */\n  /* or the complement of its magnitude, if negative. */\n  PUT_BITS(temp2, nbits)\n  CHECKBUF15()\n\n  /* Encode the AC coefficients per section F.1.2.2 */\n  \n  r = 0;\t\t\t/* r = run length of zeros */\n\n/* Manually unroll the k loop to eliminate the counter variable.  This\n * improves performance greatly on systems with a limited number of\n * registers (such as x86.)\n */\n#define kloop(jpeg_natural_order_of_k) {  \\\n  if ((temp = block[jpeg_natural_order_of_k]) == 0) { \\\n    r++; \\\n  } else { \\\n    temp2 = temp; \\\n    /* Branch-less absolute value, bitwise complement, etc., same as above */ \\\n    temp3 = temp >> (CHAR_BIT * sizeof(int) - 1); \\\n    temp ^= temp3; \\\n    temp -= temp3; \\\n    temp2 += temp3; \\\n    nbits = jpeg_nbits_table[temp]; \\\n    /* if run length > 15, must emit special run-length-16 codes (0xF0) */ \\\n    while (r > 15) { \\\n      EMIT_BITS(code_0xf0, size_0xf0) \\\n      r -= 16; \\\n    } \\\n    /* Emit Huffman symbol for run length / number of bits */ \\\n    temp3 = (r << 4) + nbits;  \\\n    code = actbl->ehufco[temp3]; \\\n    size = actbl->ehufsi[temp3]; \\\n    EMIT_CODE(code, size) \\\n    r = 0;  \\\n  } \\\n}\n\n  /* One iteration for each value in jpeg_natural_order[] */\n  kloop(1);   kloop(8);   kloop(16);  kloop(9);   kloop(2);   kloop(3);\n  kloop(10);  kloop(17);  kloop(24);  kloop(32);  kloop(25);  kloop(18);\n  kloop(11);  kloop(4);   kloop(5);   kloop(12);  kloop(19);  kloop(26);\n  kloop(33);  kloop(40);  kloop(48);  kloop(41);  kloop(34);  kloop(27);\n  kloop(20);  kloop(13);  kloop(6);   kloop(7);   kloop(14);  kloop(21);\n  kloop(28);  kloop(35);  kloop(42);  kloop(49);  kloop(56);  kloop(57);\n  kloop(50);  kloop(43);  kloop(36);  kloop(29);  kloop(22);  kloop(15);\n  kloop(23);  kloop(30);  kloop(37);  kloop(44);  kloop(51);  kloop(58);\n  kloop(59);  kloop(52);  kloop(45);  kloop(38);  kloop(31);  kloop(39);\n  kloop(46);  kloop(53);  kloop(60);  kloop(61);  kloop(54);  kloop(47);\n  kloop(55);  kloop(62);  kloop(63);\n\n  /* If the last coef(s) were zero, emit an end-of-block code */\n  if (r > 0) {\n    code = actbl->ehufco[0];\n    size = actbl->ehufsi[0];\n    EMIT_BITS(code, size)\n  }\n\n  state->cur.put_buffer = put_buffer;\n  state->cur.put_bits = put_bits;\n  STORE_BUFFER()\n\n  return TRUE;\n}\n\n\n/*\n * Emit a restart marker & resynchronize predictions.\n */\n\nLOCAL(boolean)\nemit_restart (working_state * state, int restart_num)\n{\n  int ci;\n\n  if (! flush_bits(state))\n    return FALSE;\n\n  emit_byte(state, 0xFF, return FALSE);\n  emit_byte(state, JPEG_RST0 + restart_num, return FALSE);\n\n  /* Re-initialize DC predictions to 0 */\n  for (ci = 0; ci < state->cinfo->comps_in_scan; ci++)\n    state->cur.last_dc_val[ci] = 0;\n\n  /* The restart counter is not updated until we successfully write the MCU. */\n\n  return TRUE;\n}\n\n\n/*\n * Encode and output one MCU's worth of Huffman-compressed coefficients.\n */\n\nMETHODDEF(boolean)\nencode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  working_state state;\n  int blkn, ci;\n  jpeg_component_info * compptr;\n\n  /* Load up working state */\n  state.next_output_byte = cinfo->dest->next_output_byte;\n  state.free_in_buffer = cinfo->dest->free_in_buffer;\n  ASSIGN_STATE(state.cur, entropy->saved);\n  state.cinfo = cinfo;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      if (! emit_restart(&state, entropy->next_restart_num))\n\treturn FALSE;\n  }\n\n  /* Encode the MCU data blocks */\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    ci = cinfo->MCU_membership[blkn];\n    compptr = cinfo->cur_comp_info[ci];\n    if (! encode_one_block(&state,\n\t\t\t   MCU_data[blkn][0], state.cur.last_dc_val[ci],\n\t\t\t   entropy->dc_derived_tbls[compptr->dc_tbl_no],\n\t\t\t   entropy->ac_derived_tbls[compptr->ac_tbl_no]))\n      return FALSE;\n    /* Update last_dc_val */\n    state.cur.last_dc_val[ci] = MCU_data[blkn][0][0];\n  }\n\n  /* Completed MCU, so update state */\n  cinfo->dest->next_output_byte = state.next_output_byte;\n  cinfo->dest->free_in_buffer = state.free_in_buffer;\n  ASSIGN_STATE(entropy->saved, state.cur);\n\n  /* Update restart-interval state too */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  return TRUE;\n}\n\n\n/*\n * Finish up at the end of a Huffman-compressed scan.\n */\n\nMETHODDEF(void)\nfinish_pass_huff (j_compress_ptr cinfo)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  working_state state;\n\n  /* Load up working state ... flush_bits needs it */\n  state.next_output_byte = cinfo->dest->next_output_byte;\n  state.free_in_buffer = cinfo->dest->free_in_buffer;\n  ASSIGN_STATE(state.cur, entropy->saved);\n  state.cinfo = cinfo;\n\n  /* Flush out the last data */\n  if (! flush_bits(&state))\n    ERREXIT(cinfo, JERR_CANT_SUSPEND);\n\n  /* Update state */\n  cinfo->dest->next_output_byte = state.next_output_byte;\n  cinfo->dest->free_in_buffer = state.free_in_buffer;\n  ASSIGN_STATE(entropy->saved, state.cur);\n}\n\n\n/*\n * Huffman coding optimization.\n *\n * We first scan the supplied data and count the number of uses of each symbol\n * that is to be Huffman-coded. (This process MUST agree with the code above.)\n * Then we build a Huffman coding tree for the observed counts.\n * Symbols which are not needed at all for the particular image are not\n * assigned any code, which saves space in the DHT marker as well as in\n * the compressed data.\n */\n\n#ifdef ENTROPY_OPT_SUPPORTED\n\n\n/* Process a single block's worth of coefficients */\n\nLOCAL(void)\nhtest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val,\n\t\t long dc_counts[], long ac_counts[])\n{\n  register int temp;\n  register int nbits;\n  register int k, r;\n  \n  /* Encode the DC coefficient difference per section F.1.2.1 */\n  \n  temp = block[0] - last_dc_val;\n  if (temp < 0)\n    temp = -temp;\n  \n  /* Find the number of bits needed for the magnitude of the coefficient */\n  nbits = 0;\n  while (temp) {\n    nbits++;\n    temp >>= 1;\n  }\n  /* Check for out-of-range coefficient values.\n   * Since we're encoding a difference, the range limit is twice as much.\n   */\n  if (nbits > MAX_COEF_BITS+1)\n    ERREXIT(cinfo, JERR_BAD_DCT_COEF);\n\n  /* Count the Huffman symbol for the number of bits */\n  dc_counts[nbits]++;\n  \n  /* Encode the AC coefficients per section F.1.2.2 */\n  \n  r = 0;\t\t\t/* r = run length of zeros */\n  \n  for (k = 1; k < DCTSIZE2; k++) {\n    if ((temp = block[jpeg_natural_order[k]]) == 0) {\n      r++;\n    } else {\n      /* if run length > 15, must emit special run-length-16 codes (0xF0) */\n      while (r > 15) {\n\tac_counts[0xF0]++;\n\tr -= 16;\n      }\n      \n      /* Find the number of bits needed for the magnitude of the coefficient */\n      if (temp < 0)\n\ttemp = -temp;\n      \n      /* Find the number of bits needed for the magnitude of the coefficient */\n      nbits = 1;\t\t/* there must be at least one 1 bit */\n      while ((temp >>= 1))\n\tnbits++;\n      /* Check for out-of-range coefficient values */\n      if (nbits > MAX_COEF_BITS)\n\tERREXIT(cinfo, JERR_BAD_DCT_COEF);\n      \n      /* Count Huffman symbol for run length / number of bits */\n      ac_counts[(r << 4) + nbits]++;\n      \n      r = 0;\n    }\n  }\n\n  /* If the last coef(s) were zero, emit an end-of-block code */\n  if (r > 0)\n    ac_counts[0]++;\n}\n\n\n/*\n * Trial-encode one MCU's worth of Huffman-compressed coefficients.\n * No data is actually output, so no suspension return is possible.\n */\n\nMETHODDEF(boolean)\nencode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  int blkn, ci;\n  jpeg_component_info * compptr;\n\n  /* Take care of restart intervals if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      /* Re-initialize DC predictions to 0 */\n      for (ci = 0; ci < cinfo->comps_in_scan; ci++)\n\tentropy->saved.last_dc_val[ci] = 0;\n      /* Update restart state */\n      entropy->restarts_to_go = cinfo->restart_interval;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    ci = cinfo->MCU_membership[blkn];\n    compptr = cinfo->cur_comp_info[ci];\n    htest_one_block(cinfo, MCU_data[blkn][0], entropy->saved.last_dc_val[ci],\n\t\t    entropy->dc_count_ptrs[compptr->dc_tbl_no],\n\t\t    entropy->ac_count_ptrs[compptr->ac_tbl_no]);\n    entropy->saved.last_dc_val[ci] = MCU_data[blkn][0][0];\n  }\n\n  return TRUE;\n}\n\n\n/*\n * Generate the best Huffman code table for the given counts, fill htbl.\n * Note this is also used by jcphuff.c.\n *\n * The JPEG standard requires that no symbol be assigned a codeword of all\n * one bits (so that padding bits added at the end of a compressed segment\n * can't look like a valid code).  Because of the canonical ordering of\n * codewords, this just means that there must be an unused slot in the\n * longest codeword length category.  Section K.2 of the JPEG spec suggests\n * reserving such a slot by pretending that symbol 256 is a valid symbol\n * with count 1.  In theory that's not optimal; giving it count zero but\n * including it in the symbol set anyway should give a better Huffman code.\n * But the theoretically better code actually seems to come out worse in\n * practice, because it produces more all-ones bytes (which incur stuffed\n * zero bytes in the final file).  In any case the difference is tiny.\n *\n * The JPEG standard requires Huffman codes to be no more than 16 bits long.\n * If some symbols have a very small but nonzero probability, the Huffman tree\n * must be adjusted to meet the code length restriction.  We currently use\n * the adjustment method suggested in JPEG section K.2.  This method is *not*\n * optimal; it may not choose the best possible limited-length code.  But\n * typically only very-low-frequency symbols will be given less-than-optimal\n * lengths, so the code is almost optimal.  Experimental comparisons against\n * an optimal limited-length-code algorithm indicate that the difference is\n * microscopic --- usually less than a hundredth of a percent of total size.\n * So the extra complexity of an optimal algorithm doesn't seem worthwhile.\n */\n\nGLOBAL(void)\njpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])\n{\n#define MAX_CLEN 32\t\t/* assumed maximum initial code length */\n  UINT8 bits[MAX_CLEN+1];\t/* bits[k] = # of symbols with code length k */\n  int codesize[257];\t\t/* codesize[k] = code length of symbol k */\n  int others[257];\t\t/* next symbol in current branch of tree */\n  int c1, c2;\n  int p, i, j;\n  long v;\n\n  /* This algorithm is explained in section K.2 of the JPEG standard */\n\n  MEMZERO(bits, SIZEOF(bits));\n  MEMZERO(codesize, SIZEOF(codesize));\n  for (i = 0; i < 257; i++)\n    others[i] = -1;\t\t/* init links to empty */\n  \n  freq[256] = 1;\t\t/* make sure 256 has a nonzero count */\n  /* Including the pseudo-symbol 256 in the Huffman procedure guarantees\n   * that no real symbol is given code-value of all ones, because 256\n   * will be placed last in the largest codeword category.\n   */\n\n  /* Huffman's basic algorithm to assign optimal code lengths to symbols */\n\n  for (;;) {\n    /* Find the smallest nonzero frequency, set c1 = its symbol */\n    /* In case of ties, take the larger symbol number */\n    c1 = -1;\n    v = 1000000000L;\n    for (i = 0; i <= 256; i++) {\n      if (freq[i] && freq[i] <= v) {\n\tv = freq[i];\n\tc1 = i;\n      }\n    }\n\n    /* Find the next smallest nonzero frequency, set c2 = its symbol */\n    /* In case of ties, take the larger symbol number */\n    c2 = -1;\n    v = 1000000000L;\n    for (i = 0; i <= 256; i++) {\n      if (freq[i] && freq[i] <= v && i != c1) {\n\tv = freq[i];\n\tc2 = i;\n      }\n    }\n\n    /* Done if we've merged everything into one frequency */\n    if (c2 < 0)\n      break;\n    \n    /* Else merge the two counts/trees */\n    freq[c1] += freq[c2];\n    freq[c2] = 0;\n\n    /* Increment the codesize of everything in c1's tree branch */\n    codesize[c1]++;\n    while (others[c1] >= 0) {\n      c1 = others[c1];\n      codesize[c1]++;\n    }\n    \n    others[c1] = c2;\t\t/* chain c2 onto c1's tree branch */\n    \n    /* Increment the codesize of everything in c2's tree branch */\n    codesize[c2]++;\n    while (others[c2] >= 0) {\n      c2 = others[c2];\n      codesize[c2]++;\n    }\n  }\n\n  /* Now count the number of symbols of each code length */\n  for (i = 0; i <= 256; i++) {\n    if (codesize[i]) {\n      /* The JPEG standard seems to think that this can't happen, */\n      /* but I'm paranoid... */\n      if (codesize[i] > MAX_CLEN)\n\tERREXIT(cinfo, JERR_HUFF_CLEN_OVERFLOW);\n\n      bits[codesize[i]]++;\n    }\n  }\n\n  /* JPEG doesn't allow symbols with code lengths over 16 bits, so if the pure\n   * Huffman procedure assigned any such lengths, we must adjust the coding.\n   * Here is what the JPEG spec says about how this next bit works:\n   * Since symbols are paired for the longest Huffman code, the symbols are\n   * removed from this length category two at a time.  The prefix for the pair\n   * (which is one bit shorter) is allocated to one of the pair; then,\n   * skipping the BITS entry for that prefix length, a code word from the next\n   * shortest nonzero BITS entry is converted into a prefix for two code words\n   * one bit longer.\n   */\n  \n  for (i = MAX_CLEN; i > 16; i--) {\n    while (bits[i] > 0) {\n      j = i - 2;\t\t/* find length of new prefix to be used */\n      while (bits[j] == 0)\n\tj--;\n      \n      bits[i] -= 2;\t\t/* remove two symbols */\n      bits[i-1]++;\t\t/* one goes in this length */\n      bits[j+1] += 2;\t\t/* two new symbols in this length */\n      bits[j]--;\t\t/* symbol of this length is now a prefix */\n    }\n  }\n\n  /* Remove the count for the pseudo-symbol 256 from the largest codelength */\n  while (bits[i] == 0)\t\t/* find largest codelength still in use */\n    i--;\n  bits[i]--;\n  \n  /* Return final symbol counts (only for lengths 0..16) */\n  MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits));\n  \n  /* Return a list of the symbols sorted by code length */\n  /* It's not real clear to me why we don't need to consider the codelength\n   * changes made above, but the JPEG spec seems to think this works.\n   */\n  p = 0;\n  for (i = 1; i <= MAX_CLEN; i++) {\n    for (j = 0; j <= 255; j++) {\n      if (codesize[j] == i) {\n\thtbl->huffval[p] = (UINT8) j;\n\tp++;\n      }\n    }\n  }\n\n  /* Set sent_table FALSE so updated table will be written to JPEG file. */\n  htbl->sent_table = FALSE;\n}\n\n\n/*\n * Finish up a statistics-gathering pass and create the new Huffman tables.\n */\n\nMETHODDEF(void)\nfinish_pass_gather (j_compress_ptr cinfo)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  int ci, dctbl, actbl;\n  jpeg_component_info * compptr;\n  JHUFF_TBL **htblptr;\n  boolean did_dc[NUM_HUFF_TBLS];\n  boolean did_ac[NUM_HUFF_TBLS];\n\n  /* It's important not to apply jpeg_gen_optimal_table more than once\n   * per table, because it clobbers the input frequency counts!\n   */\n  MEMZERO(did_dc, SIZEOF(did_dc));\n  MEMZERO(did_ac, SIZEOF(did_ac));\n\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    dctbl = compptr->dc_tbl_no;\n    actbl = compptr->ac_tbl_no;\n    if (! did_dc[dctbl]) {\n      htblptr = & cinfo->dc_huff_tbl_ptrs[dctbl];\n      if (*htblptr == NULL)\n\t*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);\n      jpeg_gen_optimal_table(cinfo, *htblptr, entropy->dc_count_ptrs[dctbl]);\n      did_dc[dctbl] = TRUE;\n    }\n    if (! did_ac[actbl]) {\n      htblptr = & cinfo->ac_huff_tbl_ptrs[actbl];\n      if (*htblptr == NULL)\n\t*htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);\n      jpeg_gen_optimal_table(cinfo, *htblptr, entropy->ac_count_ptrs[actbl]);\n      did_ac[actbl] = TRUE;\n    }\n  }\n}\n\n\n#endif /* ENTROPY_OPT_SUPPORTED */\n\n\n/*\n * Module initialization routine for Huffman entropy encoding.\n */\n\nGLOBAL(void)\njinit_huff_encoder (j_compress_ptr cinfo)\n{\n  huff_entropy_ptr entropy;\n  int i;\n\n  entropy = (huff_entropy_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(huff_entropy_encoder));\n  cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;\n  entropy->pub.start_pass = start_pass_huff;\n\n  /* Mark tables unallocated */\n  for (i = 0; i < NUM_HUFF_TBLS; i++) {\n    entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;\n#ifdef ENTROPY_OPT_SUPPORTED\n    entropy->dc_count_ptrs[i] = entropy->ac_count_ptrs[i] = NULL;\n#endif\n  }\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jchuff.h",
    "content": "/*\n * jchuff.h\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains declarations for Huffman entropy encoding routines\n * that are shared between the sequential encoder (jchuff.c) and the\n * progressive encoder (jcphuff.c).  No other modules need to see these.\n */\n\n/* The legal range of a DCT coefficient is\n *  -1024 .. +1023  for 8-bit data;\n * -16384 .. +16383 for 12-bit data.\n * Hence the magnitude should always fit in 10 or 14 bits respectively.\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define MAX_COEF_BITS 10\n#else\n#define MAX_COEF_BITS 14\n#endif\n\n/* Derived data constructed for each Huffman table */\n\ntypedef struct {\n  unsigned int ehufco[256];\t/* code for each symbol */\n  char ehufsi[256];\t\t/* length of code for each symbol */\n  /* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */\n} c_derived_tbl;\n\n/* Short forms of external names for systems with brain-damaged linkers. */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jpeg_make_c_derived_tbl\tjMkCDerived\n#define jpeg_gen_optimal_table\tjGenOptTbl\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\n/* Expand a Huffman table definition into the derived format */\nEXTERN(void) jpeg_make_c_derived_tbl\n\tJPP((j_compress_ptr cinfo, boolean isDC, int tblno,\n\t     c_derived_tbl ** pdtbl));\n\n/* Generate an optimal table definition given the specified counts */\nEXTERN(void) jpeg_gen_optimal_table\n\tJPP((j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]));\n"
  },
  {
    "path": "ext/libjpeg-turbo/jcinit.c",
    "content": "/*\n * jcinit.c\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains initialization logic for the JPEG compressor.\n * This routine is in charge of selecting the modules to be executed and\n * making an initialization call to each one.\n *\n * Logically, this code belongs in jcmaster.c.  It's split out because\n * linking this routine implies linking the entire compression library.\n * For a transcoding-only application, we want to be able to use jcmaster.c\n * without linking in the whole library.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/*\n * Master selection of compression modules.\n * This is done once at the start of processing an image.  We determine\n * which modules will be used and give them appropriate initialization calls.\n */\n\nGLOBAL(void)\njinit_compress_master (j_compress_ptr cinfo)\n{\n  /* Initialize master control (includes parameter checking/processing) */\n  jinit_c_master_control(cinfo, FALSE /* full compression */);\n\n  /* Preprocessing */\n  if (! cinfo->raw_data_in) {\n    jinit_color_converter(cinfo);\n    jinit_downsampler(cinfo);\n    jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */);\n  }\n  /* Forward DCT */\n  jinit_forward_dct(cinfo);\n  /* Entropy encoding: either Huffman or arithmetic coding. */\n  if (cinfo->arith_code) {\n#ifdef C_ARITH_CODING_SUPPORTED\n    jinit_arith_encoder(cinfo);\n#else\n    ERREXIT(cinfo, JERR_ARITH_NOTIMPL);\n#endif\n  } else {\n    if (cinfo->progressive_mode) {\n#ifdef C_PROGRESSIVE_SUPPORTED\n      jinit_phuff_encoder(cinfo);\n#else\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n    } else\n      jinit_huff_encoder(cinfo);\n  }\n\n  /* Need a full-image coefficient buffer in any multi-pass mode. */\n  jinit_c_coef_controller(cinfo,\n\t\t(boolean) (cinfo->num_scans > 1 || cinfo->optimize_coding));\n  jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */);\n\n  jinit_marker_writer(cinfo);\n\n  /* We can now tell the memory manager to allocate virtual arrays. */\n  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);\n\n  /* Write the datastream header (SOI) immediately.\n   * Frame and scan headers are postponed till later.\n   * This lets application insert special markers after the SOI.\n   */\n  (*cinfo->marker->write_file_header) (cinfo);\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jcmainct.c",
    "content": "/*\n * jcmainct.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains the main buffer controller for compression.\n * The main buffer lies between the pre-processor and the JPEG\n * compressor proper; it holds downsampled data in the JPEG colorspace.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Note: currently, there is no operating mode in which a full-image buffer\n * is needed at this step.  If there were, that mode could not be used with\n * \"raw data\" input, since this module is bypassed in that case.  However,\n * we've left the code here for possible use in special applications.\n */\n#undef FULL_MAIN_BUFFER_SUPPORTED\n\n\n/* Private buffer controller object */\n\ntypedef struct {\n  struct jpeg_c_main_controller pub; /* public fields */\n\n  JDIMENSION cur_iMCU_row;\t/* number of current iMCU row */\n  JDIMENSION rowgroup_ctr;\t/* counts row groups received in iMCU row */\n  boolean suspended;\t\t/* remember if we suspended output */\n  J_BUF_MODE pass_mode;\t\t/* current operating mode */\n\n  /* If using just a strip buffer, this points to the entire set of buffers\n   * (we allocate one for each component).  In the full-image case, this\n   * points to the currently accessible strips of the virtual arrays.\n   */\n  JSAMPARRAY buffer[MAX_COMPONENTS];\n\n#ifdef FULL_MAIN_BUFFER_SUPPORTED\n  /* If using full-image storage, this array holds pointers to virtual-array\n   * control blocks for each component.  Unused if not full-image storage.\n   */\n  jvirt_sarray_ptr whole_image[MAX_COMPONENTS];\n#endif\n} my_main_controller;\n\ntypedef my_main_controller * my_main_ptr;\n\n\n/* Forward declarations */\nMETHODDEF(void) process_data_simple_main\n\tJPP((j_compress_ptr cinfo, JSAMPARRAY input_buf,\n\t     JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail));\n#ifdef FULL_MAIN_BUFFER_SUPPORTED\nMETHODDEF(void) process_data_buffer_main\n\tJPP((j_compress_ptr cinfo, JSAMPARRAY input_buf,\n\t     JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail));\n#endif\n\n\n/*\n * Initialize for a processing pass.\n */\n\nMETHODDEF(void)\nstart_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode)\n{\n  my_main_ptr main_ptr = (my_main_ptr) cinfo->main;\n\n  /* Do nothing in raw-data mode. */\n  if (cinfo->raw_data_in)\n    return;\n\n  main_ptr->cur_iMCU_row = 0;\t/* initialize counters */\n  main_ptr->rowgroup_ctr = 0;\n  main_ptr->suspended = FALSE;\n  main_ptr->pass_mode = pass_mode;\t/* save mode for use by process_data */\n\n  switch (pass_mode) {\n  case JBUF_PASS_THRU:\n#ifdef FULL_MAIN_BUFFER_SUPPORTED\n    if (main_ptr->whole_image[0] != NULL)\n      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n#endif\n    main_ptr->pub.process_data = process_data_simple_main;\n    break;\n#ifdef FULL_MAIN_BUFFER_SUPPORTED\n  case JBUF_SAVE_SOURCE:\n  case JBUF_CRANK_DEST:\n  case JBUF_SAVE_AND_PASS:\n    if (main_ptr->whole_image[0] == NULL)\n      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    main_ptr->pub.process_data = process_data_buffer_main;\n    break;\n#endif\n  default:\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    break;\n  }\n}\n\n\n/*\n * Process some data.\n * This routine handles the simple pass-through mode,\n * where we have only a strip buffer.\n */\n\nMETHODDEF(void)\nprocess_data_simple_main (j_compress_ptr cinfo,\n\t\t\t  JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,\n\t\t\t  JDIMENSION in_rows_avail)\n{\n  my_main_ptr main_ptr = (my_main_ptr) cinfo->main;\n\n  while (main_ptr->cur_iMCU_row < cinfo->total_iMCU_rows) {\n    /* Read input data if we haven't filled the main buffer yet */\n    if (main_ptr->rowgroup_ctr < DCTSIZE)\n      (*cinfo->prep->pre_process_data) (cinfo,\n\t\t\t\t\tinput_buf, in_row_ctr, in_rows_avail,\n\t\t\t\t\tmain_ptr->buffer, &main_ptr->rowgroup_ctr,\n\t\t\t\t\t(JDIMENSION) DCTSIZE);\n\n    /* If we don't have a full iMCU row buffered, return to application for\n     * more data.  Note that preprocessor will always pad to fill the iMCU row\n     * at the bottom of the image.\n     */\n    if (main_ptr->rowgroup_ctr != DCTSIZE)\n      return;\n\n    /* Send the completed row to the compressor */\n    if (! (*cinfo->coef->compress_data) (cinfo, main_ptr->buffer)) {\n      /* If compressor did not consume the whole row, then we must need to\n       * suspend processing and return to the application.  In this situation\n       * we pretend we didn't yet consume the last input row; otherwise, if\n       * it happened to be the last row of the image, the application would\n       * think we were done.\n       */\n      if (! main_ptr->suspended) {\n\t(*in_row_ctr)--;\n\tmain_ptr->suspended = TRUE;\n      }\n      return;\n    }\n    /* We did finish the row.  Undo our little suspension hack if a previous\n     * call suspended; then mark the main buffer empty.\n     */\n    if (main_ptr->suspended) {\n      (*in_row_ctr)++;\n      main_ptr->suspended = FALSE;\n    }\n    main_ptr->rowgroup_ctr = 0;\n    main_ptr->cur_iMCU_row++;\n  }\n}\n\n\n#ifdef FULL_MAIN_BUFFER_SUPPORTED\n\n/*\n * Process some data.\n * This routine handles all of the modes that use a full-size buffer.\n */\n\nMETHODDEF(void)\nprocess_data_buffer_main (j_compress_ptr cinfo,\n\t\t\t  JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,\n\t\t\t  JDIMENSION in_rows_avail)\n{\n  my_main_ptr main_ptr = (my_main_ptr) cinfo->main;\n  int ci;\n  jpeg_component_info *compptr;\n  boolean writing = (main_ptr->pass_mode != JBUF_CRANK_DEST);\n\n  while (main_ptr->cur_iMCU_row < cinfo->total_iMCU_rows) {\n    /* Realign the virtual buffers if at the start of an iMCU row. */\n    if (main_ptr->rowgroup_ctr == 0) {\n      for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n\t   ci++, compptr++) {\n\tmain_ptr->buffer[ci] = (*cinfo->mem->access_virt_sarray)\n\t  ((j_common_ptr) cinfo, main_ptr->whole_image[ci],\n\t   main_ptr->cur_iMCU_row * (compptr->v_samp_factor * DCTSIZE),\n\t   (JDIMENSION) (compptr->v_samp_factor * DCTSIZE), writing);\n      }\n      /* In a read pass, pretend we just read some source data. */\n      if (! writing) {\n\t*in_row_ctr += cinfo->max_v_samp_factor * DCTSIZE;\n\tmain_ptr->rowgroup_ctr = DCTSIZE;\n      }\n    }\n\n    /* If a write pass, read input data until the current iMCU row is full. */\n    /* Note: preprocessor will pad if necessary to fill the last iMCU row. */\n    if (writing) {\n      (*cinfo->prep->pre_process_data) (cinfo,\n\t\t\t\t\tinput_buf, in_row_ctr, in_rows_avail,\n\t\t\t\t\tmain_ptr->buffer, &main_ptr->rowgroup_ctr,\n\t\t\t\t\t(JDIMENSION) DCTSIZE);\n      /* Return to application if we need more data to fill the iMCU row. */\n      if (main_ptr->rowgroup_ctr < DCTSIZE)\n\treturn;\n    }\n\n    /* Emit data, unless this is a sink-only pass. */\n    if (main_ptr->pass_mode != JBUF_SAVE_SOURCE) {\n      if (! (*cinfo->coef->compress_data) (cinfo, main_ptr->buffer)) {\n\t/* If compressor did not consume the whole row, then we must need to\n\t * suspend processing and return to the application.  In this situation\n\t * we pretend we didn't yet consume the last input row; otherwise, if\n\t * it happened to be the last row of the image, the application would\n\t * think we were done.\n\t */\n\tif (! main_ptr->suspended) {\n\t  (*in_row_ctr)--;\n\t  main_ptr->suspended = TRUE;\n\t}\n\treturn;\n      }\n      /* We did finish the row.  Undo our little suspension hack if a previous\n       * call suspended; then mark the main buffer empty.\n       */\n      if (main_ptr->suspended) {\n\t(*in_row_ctr)++;\n\tmain_ptr->suspended = FALSE;\n      }\n    }\n\n    /* If get here, we are done with this iMCU row.  Mark buffer empty. */\n    main_ptr->rowgroup_ctr = 0;\n    main_ptr->cur_iMCU_row++;\n  }\n}\n\n#endif /* FULL_MAIN_BUFFER_SUPPORTED */\n\n\n/*\n * Initialize main buffer controller.\n */\n\nGLOBAL(void)\njinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer)\n{\n  my_main_ptr main_ptr;\n  int ci;\n  jpeg_component_info *compptr;\n\n  main_ptr = (my_main_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_main_controller));\n  cinfo->main = (struct jpeg_c_main_controller *) main_ptr;\n  main_ptr->pub.start_pass = start_pass_main;\n\n  /* We don't need to create a buffer in raw-data mode. */\n  if (cinfo->raw_data_in)\n    return;\n\n  /* Create the buffer.  It holds downsampled data, so each component\n   * may be of a different size.\n   */\n  if (need_full_buffer) {\n#ifdef FULL_MAIN_BUFFER_SUPPORTED\n    /* Allocate a full-image virtual array for each component */\n    /* Note we pad the bottom to a multiple of the iMCU height */\n    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n\t ci++, compptr++) {\n      main_ptr->whole_image[ci] = (*cinfo->mem->request_virt_sarray)\n\t((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n\t compptr->width_in_blocks * DCTSIZE,\n\t (JDIMENSION) jround_up((long) compptr->height_in_blocks,\n\t\t\t\t(long) compptr->v_samp_factor) * DCTSIZE,\n\t (JDIMENSION) (compptr->v_samp_factor * DCTSIZE));\n    }\n#else\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n#endif\n  } else {\n#ifdef FULL_MAIN_BUFFER_SUPPORTED\n    main_ptr->whole_image[0] = NULL; /* flag for no virtual arrays */\n#endif\n    /* Allocate a strip buffer for each component */\n    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n\t ci++, compptr++) {\n      main_ptr->buffer[ci] = (*cinfo->mem->alloc_sarray)\n\t((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t compptr->width_in_blocks * DCTSIZE,\n\t (JDIMENSION) (compptr->v_samp_factor * DCTSIZE));\n    }\n  }\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jcmarker.c",
    "content": "/*\n * jcmarker.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * Modified 2003-2010 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to write JPEG datastream markers.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jpegcomp.h\"\n\n\ntypedef enum {\t\t\t/* JPEG marker codes */\n  M_SOF0  = 0xc0,\n  M_SOF1  = 0xc1,\n  M_SOF2  = 0xc2,\n  M_SOF3  = 0xc3,\n\n  M_SOF5  = 0xc5,\n  M_SOF6  = 0xc6,\n  M_SOF7  = 0xc7,\n\n  M_JPG   = 0xc8,\n  M_SOF9  = 0xc9,\n  M_SOF10 = 0xca,\n  M_SOF11 = 0xcb,\n\n  M_SOF13 = 0xcd,\n  M_SOF14 = 0xce,\n  M_SOF15 = 0xcf,\n\n  M_DHT   = 0xc4,\n\n  M_DAC   = 0xcc,\n\n  M_RST0  = 0xd0,\n  M_RST1  = 0xd1,\n  M_RST2  = 0xd2,\n  M_RST3  = 0xd3,\n  M_RST4  = 0xd4,\n  M_RST5  = 0xd5,\n  M_RST6  = 0xd6,\n  M_RST7  = 0xd7,\n\n  M_SOI   = 0xd8,\n  M_EOI   = 0xd9,\n  M_SOS   = 0xda,\n  M_DQT   = 0xdb,\n  M_DNL   = 0xdc,\n  M_DRI   = 0xdd,\n  M_DHP   = 0xde,\n  M_EXP   = 0xdf,\n\n  M_APP0  = 0xe0,\n  M_APP1  = 0xe1,\n  M_APP2  = 0xe2,\n  M_APP3  = 0xe3,\n  M_APP4  = 0xe4,\n  M_APP5  = 0xe5,\n  M_APP6  = 0xe6,\n  M_APP7  = 0xe7,\n  M_APP8  = 0xe8,\n  M_APP9  = 0xe9,\n  M_APP10 = 0xea,\n  M_APP11 = 0xeb,\n  M_APP12 = 0xec,\n  M_APP13 = 0xed,\n  M_APP14 = 0xee,\n  M_APP15 = 0xef,\n\n  M_JPG0  = 0xf0,\n  M_JPG13 = 0xfd,\n  M_COM   = 0xfe,\n\n  M_TEM   = 0x01,\n\n  M_ERROR = 0x100\n} JPEG_MARKER;\n\n\n/* Private state */\n\ntypedef struct {\n  struct jpeg_marker_writer pub; /* public fields */\n\n  unsigned int last_restart_interval; /* last DRI value emitted; 0 after SOI */\n} my_marker_writer;\n\ntypedef my_marker_writer * my_marker_ptr;\n\n\n/*\n * Basic output routines.\n *\n * Note that we do not support suspension while writing a marker.\n * Therefore, an application using suspension must ensure that there is\n * enough buffer space for the initial markers (typ. 600-700 bytes) before\n * calling jpeg_start_compress, and enough space to write the trailing EOI\n * (a few bytes) before calling jpeg_finish_compress.  Multipass compression\n * modes are not supported at all with suspension, so those two are the only\n * points where markers will be written.\n */\n\nLOCAL(void)\nemit_byte (j_compress_ptr cinfo, int val)\n/* Emit a byte */\n{\n  struct jpeg_destination_mgr * dest = cinfo->dest;\n\n  *(dest->next_output_byte)++ = (JOCTET) val;\n  if (--dest->free_in_buffer == 0) {\n    if (! (*dest->empty_output_buffer) (cinfo))\n      ERREXIT(cinfo, JERR_CANT_SUSPEND);\n  }\n}\n\n\nLOCAL(void)\nemit_marker (j_compress_ptr cinfo, JPEG_MARKER mark)\n/* Emit a marker code */\n{\n  emit_byte(cinfo, 0xFF);\n  emit_byte(cinfo, (int) mark);\n}\n\n\nLOCAL(void)\nemit_2bytes (j_compress_ptr cinfo, int value)\n/* Emit a 2-byte integer; these are always MSB first in JPEG files */\n{\n  emit_byte(cinfo, (value >> 8) & 0xFF);\n  emit_byte(cinfo, value & 0xFF);\n}\n\n\n/*\n * Routines to write specific marker types.\n */\n\nLOCAL(int)\nemit_dqt (j_compress_ptr cinfo, int index)\n/* Emit a DQT marker */\n/* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */\n{\n  JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[index];\n  int prec;\n  int i;\n\n  if (qtbl == NULL)\n    ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, index);\n\n  prec = 0;\n  for (i = 0; i < DCTSIZE2; i++) {\n    if (qtbl->quantval[i] > 255)\n      prec = 1;\n  }\n\n  if (! qtbl->sent_table) {\n    emit_marker(cinfo, M_DQT);\n\n    emit_2bytes(cinfo, prec ? DCTSIZE2*2 + 1 + 2 : DCTSIZE2 + 1 + 2);\n\n    emit_byte(cinfo, index + (prec<<4));\n\n    for (i = 0; i < DCTSIZE2; i++) {\n      /* The table entries must be emitted in zigzag order. */\n      unsigned int qval = qtbl->quantval[jpeg_natural_order[i]];\n      if (prec)\n\temit_byte(cinfo, (int) (qval >> 8));\n      emit_byte(cinfo, (int) (qval & 0xFF));\n    }\n\n    qtbl->sent_table = TRUE;\n  }\n\n  return prec;\n}\n\n\nLOCAL(void)\nemit_dht (j_compress_ptr cinfo, int index, boolean is_ac)\n/* Emit a DHT marker */\n{\n  JHUFF_TBL * htbl;\n  int length, i;\n  \n  if (is_ac) {\n    htbl = cinfo->ac_huff_tbl_ptrs[index];\n    index += 0x10;\t\t/* output index has AC bit set */\n  } else {\n    htbl = cinfo->dc_huff_tbl_ptrs[index];\n  }\n\n  if (htbl == NULL)\n    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, index);\n  \n  if (! htbl->sent_table) {\n    emit_marker(cinfo, M_DHT);\n    \n    length = 0;\n    for (i = 1; i <= 16; i++)\n      length += htbl->bits[i];\n    \n    emit_2bytes(cinfo, length + 2 + 1 + 16);\n    emit_byte(cinfo, index);\n    \n    for (i = 1; i <= 16; i++)\n      emit_byte(cinfo, htbl->bits[i]);\n    \n    for (i = 0; i < length; i++)\n      emit_byte(cinfo, htbl->huffval[i]);\n    \n    htbl->sent_table = TRUE;\n  }\n}\n\n\nLOCAL(void)\nemit_dac (j_compress_ptr cinfo)\n/* Emit a DAC marker */\n/* Since the useful info is so small, we want to emit all the tables in */\n/* one DAC marker.  Therefore this routine does its own scan of the table. */\n{\n#ifdef C_ARITH_CODING_SUPPORTED\n  char dc_in_use[NUM_ARITH_TBLS];\n  char ac_in_use[NUM_ARITH_TBLS];\n  int length, i;\n  jpeg_component_info *compptr;\n\n  for (i = 0; i < NUM_ARITH_TBLS; i++)\n    dc_in_use[i] = ac_in_use[i] = 0;\n\n  for (i = 0; i < cinfo->comps_in_scan; i++) {\n    compptr = cinfo->cur_comp_info[i];\n    /* DC needs no table for refinement scan */\n    if (cinfo->Ss == 0 && cinfo->Ah == 0)\n      dc_in_use[compptr->dc_tbl_no] = 1;\n    /* AC needs no table when not present */\n    if (cinfo->Se)\n      ac_in_use[compptr->ac_tbl_no] = 1;\n  }\n\n  length = 0;\n  for (i = 0; i < NUM_ARITH_TBLS; i++)\n    length += dc_in_use[i] + ac_in_use[i];\n\n  if (length) {\n    emit_marker(cinfo, M_DAC);\n\n    emit_2bytes(cinfo, length*2 + 2);\n\n    for (i = 0; i < NUM_ARITH_TBLS; i++) {\n      if (dc_in_use[i]) {\n\temit_byte(cinfo, i);\n\temit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4));\n      }\n      if (ac_in_use[i]) {\n\temit_byte(cinfo, i + 0x10);\n\temit_byte(cinfo, cinfo->arith_ac_K[i]);\n      }\n    }\n  }\n#endif /* C_ARITH_CODING_SUPPORTED */\n}\n\n\nLOCAL(void)\nemit_dri (j_compress_ptr cinfo)\n/* Emit a DRI marker */\n{\n  emit_marker(cinfo, M_DRI);\n  \n  emit_2bytes(cinfo, 4);\t/* fixed length */\n\n  emit_2bytes(cinfo, (int) cinfo->restart_interval);\n}\n\n\nLOCAL(void)\nemit_sof (j_compress_ptr cinfo, JPEG_MARKER code)\n/* Emit a SOF marker */\n{\n  int ci;\n  jpeg_component_info *compptr;\n  \n  emit_marker(cinfo, code);\n  \n  emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */\n\n  /* Make sure image isn't bigger than SOF field can handle */\n  if ((long) cinfo->_jpeg_height > 65535L ||\n      (long) cinfo->_jpeg_width > 65535L)\n    ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) 65535);\n\n  emit_byte(cinfo, cinfo->data_precision);\n  emit_2bytes(cinfo, (int) cinfo->_jpeg_height);\n  emit_2bytes(cinfo, (int) cinfo->_jpeg_width);\n\n  emit_byte(cinfo, cinfo->num_components);\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    emit_byte(cinfo, compptr->component_id);\n    emit_byte(cinfo, (compptr->h_samp_factor << 4) + compptr->v_samp_factor);\n    emit_byte(cinfo, compptr->quant_tbl_no);\n  }\n}\n\n\nLOCAL(void)\nemit_sos (j_compress_ptr cinfo)\n/* Emit a SOS marker */\n{\n  int i, td, ta;\n  jpeg_component_info *compptr;\n  \n  emit_marker(cinfo, M_SOS);\n  \n  emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3); /* length */\n  \n  emit_byte(cinfo, cinfo->comps_in_scan);\n  \n  for (i = 0; i < cinfo->comps_in_scan; i++) {\n    compptr = cinfo->cur_comp_info[i];\n    emit_byte(cinfo, compptr->component_id);\n\n    /* We emit 0 for unused field(s); this is recommended by the P&M text\n     * but does not seem to be specified in the standard.\n     */\n\n    /* DC needs no table for refinement scan */\n    td = cinfo->Ss == 0 && cinfo->Ah == 0 ? compptr->dc_tbl_no : 0;\n    /* AC needs no table when not present */\n    ta = cinfo->Se ? compptr->ac_tbl_no : 0;\n\n    emit_byte(cinfo, (td << 4) + ta);\n  }\n\n  emit_byte(cinfo, cinfo->Ss);\n  emit_byte(cinfo, cinfo->Se);\n  emit_byte(cinfo, (cinfo->Ah << 4) + cinfo->Al);\n}\n\n\nLOCAL(void)\nemit_jfif_app0 (j_compress_ptr cinfo)\n/* Emit a JFIF-compliant APP0 marker */\n{\n  /*\n   * Length of APP0 block\t(2 bytes)\n   * Block ID\t\t\t(4 bytes - ASCII \"JFIF\")\n   * Zero byte\t\t\t(1 byte to terminate the ID string)\n   * Version Major, Minor\t(2 bytes - major first)\n   * Units\t\t\t(1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm)\n   * Xdpu\t\t\t(2 bytes - dots per unit horizontal)\n   * Ydpu\t\t\t(2 bytes - dots per unit vertical)\n   * Thumbnail X size\t\t(1 byte)\n   * Thumbnail Y size\t\t(1 byte)\n   */\n  \n  emit_marker(cinfo, M_APP0);\n  \n  emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); /* length */\n\n  emit_byte(cinfo, 0x4A);\t/* Identifier: ASCII \"JFIF\" */\n  emit_byte(cinfo, 0x46);\n  emit_byte(cinfo, 0x49);\n  emit_byte(cinfo, 0x46);\n  emit_byte(cinfo, 0);\n  emit_byte(cinfo, cinfo->JFIF_major_version); /* Version fields */\n  emit_byte(cinfo, cinfo->JFIF_minor_version);\n  emit_byte(cinfo, cinfo->density_unit); /* Pixel size information */\n  emit_2bytes(cinfo, (int) cinfo->X_density);\n  emit_2bytes(cinfo, (int) cinfo->Y_density);\n  emit_byte(cinfo, 0);\t\t/* No thumbnail image */\n  emit_byte(cinfo, 0);\n}\n\n\nLOCAL(void)\nemit_adobe_app14 (j_compress_ptr cinfo)\n/* Emit an Adobe APP14 marker */\n{\n  /*\n   * Length of APP14 block\t(2 bytes)\n   * Block ID\t\t\t(5 bytes - ASCII \"Adobe\")\n   * Version Number\t\t(2 bytes - currently 100)\n   * Flags0\t\t\t(2 bytes - currently 0)\n   * Flags1\t\t\t(2 bytes - currently 0)\n   * Color transform\t\t(1 byte)\n   *\n   * Although Adobe TN 5116 mentions Version = 101, all the Adobe files\n   * now in circulation seem to use Version = 100, so that's what we write.\n   *\n   * We write the color transform byte as 1 if the JPEG color space is\n   * YCbCr, 2 if it's YCCK, 0 otherwise.  Adobe's definition has to do with\n   * whether the encoder performed a transformation, which is pretty useless.\n   */\n  \n  emit_marker(cinfo, M_APP14);\n  \n  emit_2bytes(cinfo, 2 + 5 + 2 + 2 + 2 + 1); /* length */\n\n  emit_byte(cinfo, 0x41);\t/* Identifier: ASCII \"Adobe\" */\n  emit_byte(cinfo, 0x64);\n  emit_byte(cinfo, 0x6F);\n  emit_byte(cinfo, 0x62);\n  emit_byte(cinfo, 0x65);\n  emit_2bytes(cinfo, 100);\t/* Version */\n  emit_2bytes(cinfo, 0);\t/* Flags0 */\n  emit_2bytes(cinfo, 0);\t/* Flags1 */\n  switch (cinfo->jpeg_color_space) {\n  case JCS_YCbCr:\n    emit_byte(cinfo, 1);\t/* Color transform = 1 */\n    break;\n  case JCS_YCCK:\n    emit_byte(cinfo, 2);\t/* Color transform = 2 */\n    break;\n  default:\n    emit_byte(cinfo, 0);\t/* Color transform = 0 */\n    break;\n  }\n}\n\n\n/*\n * These routines allow writing an arbitrary marker with parameters.\n * The only intended use is to emit COM or APPn markers after calling\n * write_file_header and before calling write_frame_header.\n * Other uses are not guaranteed to produce desirable results.\n * Counting the parameter bytes properly is the caller's responsibility.\n */\n\nMETHODDEF(void)\nwrite_marker_header (j_compress_ptr cinfo, int marker, unsigned int datalen)\n/* Emit an arbitrary marker header */\n{\n  if (datalen > (unsigned int) 65533)\t\t/* safety check */\n    ERREXIT(cinfo, JERR_BAD_LENGTH);\n\n  emit_marker(cinfo, (JPEG_MARKER) marker);\n\n  emit_2bytes(cinfo, (int) (datalen + 2));\t/* total length */\n}\n\nMETHODDEF(void)\nwrite_marker_byte (j_compress_ptr cinfo, int val)\n/* Emit one byte of marker parameters following write_marker_header */\n{\n  emit_byte(cinfo, val);\n}\n\n\n/*\n * Write datastream header.\n * This consists of an SOI and optional APPn markers.\n * We recommend use of the JFIF marker, but not the Adobe marker,\n * when using YCbCr or grayscale data.  The JFIF marker should NOT\n * be used for any other JPEG colorspace.  The Adobe marker is helpful\n * to distinguish RGB, CMYK, and YCCK colorspaces.\n * Note that an application can write additional header markers after\n * jpeg_start_compress returns.\n */\n\nMETHODDEF(void)\nwrite_file_header (j_compress_ptr cinfo)\n{\n  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;\n\n  emit_marker(cinfo, M_SOI);\t/* first the SOI */\n\n  /* SOI is defined to reset restart interval to 0 */\n  marker->last_restart_interval = 0;\n\n  if (cinfo->write_JFIF_header)\t/* next an optional JFIF APP0 */\n    emit_jfif_app0(cinfo);\n  if (cinfo->write_Adobe_marker) /* next an optional Adobe APP14 */\n    emit_adobe_app14(cinfo);\n}\n\n\n/*\n * Write frame header.\n * This consists of DQT and SOFn markers.\n * Note that we do not emit the SOF until we have emitted the DQT(s).\n * This avoids compatibility problems with incorrect implementations that\n * try to error-check the quant table numbers as soon as they see the SOF.\n */\n\nMETHODDEF(void)\nwrite_frame_header (j_compress_ptr cinfo)\n{\n  int ci, prec;\n  boolean is_baseline;\n  jpeg_component_info *compptr;\n  \n  /* Emit DQT for each quantization table.\n   * Note that emit_dqt() suppresses any duplicate tables.\n   */\n  prec = 0;\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    prec += emit_dqt(cinfo, compptr->quant_tbl_no);\n  }\n  /* now prec is nonzero iff there are any 16-bit quant tables. */\n\n  /* Check for a non-baseline specification.\n   * Note we assume that Huffman table numbers won't be changed later.\n   */\n  if (cinfo->arith_code || cinfo->progressive_mode ||\n      cinfo->data_precision != 8) {\n    is_baseline = FALSE;\n  } else {\n    is_baseline = TRUE;\n    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n\t ci++, compptr++) {\n      if (compptr->dc_tbl_no > 1 || compptr->ac_tbl_no > 1)\n\tis_baseline = FALSE;\n    }\n    if (prec && is_baseline) {\n      is_baseline = FALSE;\n      /* If it's baseline except for quantizer size, warn the user */\n      TRACEMS(cinfo, 0, JTRC_16BIT_TABLES);\n    }\n  }\n\n  /* Emit the proper SOF marker */\n  if (cinfo->arith_code) {\n    if (cinfo->progressive_mode)\n      emit_sof(cinfo, M_SOF10); /* SOF code for progressive arithmetic */\n    else\n      emit_sof(cinfo, M_SOF9);  /* SOF code for sequential arithmetic */\n  } else {\n    if (cinfo->progressive_mode)\n      emit_sof(cinfo, M_SOF2);\t/* SOF code for progressive Huffman */\n    else if (is_baseline)\n      emit_sof(cinfo, M_SOF0);\t/* SOF code for baseline implementation */\n    else\n      emit_sof(cinfo, M_SOF1);\t/* SOF code for non-baseline Huffman file */\n  }\n}\n\n\n/*\n * Write scan header.\n * This consists of DHT or DAC markers, optional DRI, and SOS.\n * Compressed data will be written following the SOS.\n */\n\nMETHODDEF(void)\nwrite_scan_header (j_compress_ptr cinfo)\n{\n  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;\n  int i;\n  jpeg_component_info *compptr;\n\n  if (cinfo->arith_code) {\n    /* Emit arith conditioning info.  We may have some duplication\n     * if the file has multiple scans, but it's so small it's hardly\n     * worth worrying about.\n     */\n    emit_dac(cinfo);\n  } else {\n    /* Emit Huffman tables.\n     * Note that emit_dht() suppresses any duplicate tables.\n     */\n    for (i = 0; i < cinfo->comps_in_scan; i++) {\n      compptr = cinfo->cur_comp_info[i];\n      /* DC needs no table for refinement scan */\n      if (cinfo->Ss == 0 && cinfo->Ah == 0)\n\temit_dht(cinfo, compptr->dc_tbl_no, FALSE);\n      /* AC needs no table when not present */\n      if (cinfo->Se)\n\temit_dht(cinfo, compptr->ac_tbl_no, TRUE);\n    }\n  }\n\n  /* Emit DRI if required --- note that DRI value could change for each scan.\n   * We avoid wasting space with unnecessary DRIs, however.\n   */\n  if (cinfo->restart_interval != marker->last_restart_interval) {\n    emit_dri(cinfo);\n    marker->last_restart_interval = cinfo->restart_interval;\n  }\n\n  emit_sos(cinfo);\n}\n\n\n/*\n * Write datastream trailer.\n */\n\nMETHODDEF(void)\nwrite_file_trailer (j_compress_ptr cinfo)\n{\n  emit_marker(cinfo, M_EOI);\n}\n\n\n/*\n * Write an abbreviated table-specification datastream.\n * This consists of SOI, DQT and DHT tables, and EOI.\n * Any table that is defined and not marked sent_table = TRUE will be\n * emitted.  Note that all tables will be marked sent_table = TRUE at exit.\n */\n\nMETHODDEF(void)\nwrite_tables_only (j_compress_ptr cinfo)\n{\n  int i;\n\n  emit_marker(cinfo, M_SOI);\n\n  for (i = 0; i < NUM_QUANT_TBLS; i++) {\n    if (cinfo->quant_tbl_ptrs[i] != NULL)\n      (void) emit_dqt(cinfo, i);\n  }\n\n  if (! cinfo->arith_code) {\n    for (i = 0; i < NUM_HUFF_TBLS; i++) {\n      if (cinfo->dc_huff_tbl_ptrs[i] != NULL)\n\temit_dht(cinfo, i, FALSE);\n      if (cinfo->ac_huff_tbl_ptrs[i] != NULL)\n\temit_dht(cinfo, i, TRUE);\n    }\n  }\n\n  emit_marker(cinfo, M_EOI);\n}\n\n\n/*\n * Initialize the marker writer module.\n */\n\nGLOBAL(void)\njinit_marker_writer (j_compress_ptr cinfo)\n{\n  my_marker_ptr marker;\n\n  /* Create the subobject */\n  marker = (my_marker_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_marker_writer));\n  cinfo->marker = (struct jpeg_marker_writer *) marker;\n  /* Initialize method pointers */\n  marker->pub.write_file_header = write_file_header;\n  marker->pub.write_frame_header = write_frame_header;\n  marker->pub.write_scan_header = write_scan_header;\n  marker->pub.write_file_trailer = write_file_trailer;\n  marker->pub.write_tables_only = write_tables_only;\n  marker->pub.write_marker_header = write_marker_header;\n  marker->pub.write_marker_byte = write_marker_byte;\n  /* Initialize private state */\n  marker->last_restart_interval = 0;\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jcmaster.c",
    "content": "/*\n * jcmaster.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 2003-2010 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains master control logic for the JPEG compressor.\n * These routines are concerned with parameter validation, initial setup,\n * and inter-pass control (determining the number of passes and the work \n * to be done in each pass).\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jpegcomp.h\"\n\n\n/* Private state */\n\ntypedef enum {\n\tmain_pass,\t\t/* input data, also do first output step */\n\thuff_opt_pass,\t\t/* Huffman code optimization pass */\n\toutput_pass\t\t/* data output pass */\n} c_pass_type;\n\ntypedef struct {\n  struct jpeg_comp_master pub;\t/* public fields */\n\n  c_pass_type pass_type;\t/* the type of the current pass */\n\n  int pass_number;\t\t/* # of passes completed */\n  int total_passes;\t\t/* total # of passes needed */\n\n  int scan_number;\t\t/* current index in scan_info[] */\n} my_comp_master;\n\ntypedef my_comp_master * my_master_ptr;\n\n\n/*\n * Support routines that do various essential calculations.\n */\n\n#if JPEG_LIB_VERSION >= 70\n/*\n * Compute JPEG image dimensions and related values.\n * NOTE: this is exported for possible use by application.\n * Hence it mustn't do anything that can't be done twice.\n */\n\nGLOBAL(void)\njpeg_calc_jpeg_dimensions (j_compress_ptr cinfo)\n/* Do computations that are needed before master selection phase */\n{\n  /* Hardwire it to \"no scaling\" */\n  cinfo->jpeg_width = cinfo->image_width;\n  cinfo->jpeg_height = cinfo->image_height;\n  cinfo->min_DCT_h_scaled_size = DCTSIZE;\n  cinfo->min_DCT_v_scaled_size = DCTSIZE;\n}\n#endif\n\n\nLOCAL(void)\ninitial_setup (j_compress_ptr cinfo, boolean transcode_only)\n/* Do computations that are needed before master selection phase */\n{\n  int ci;\n  jpeg_component_info *compptr;\n  long samplesperrow;\n  JDIMENSION jd_samplesperrow;\n\n#if JPEG_LIB_VERSION >= 70\n#if JPEG_LIB_VERSION >= 80\n  if (!transcode_only)\n#endif\n    jpeg_calc_jpeg_dimensions(cinfo);\n#endif\n\n  /* Sanity check on image dimensions */\n  if (cinfo->_jpeg_height <= 0 || cinfo->_jpeg_width <= 0\n      || cinfo->num_components <= 0 || cinfo->input_components <= 0)\n    ERREXIT(cinfo, JERR_EMPTY_IMAGE);\n\n  /* Make sure image isn't bigger than I can handle */\n  if ((long) cinfo->_jpeg_height > (long) JPEG_MAX_DIMENSION ||\n      (long) cinfo->_jpeg_width > (long) JPEG_MAX_DIMENSION)\n    ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);\n\n  /* Width of an input scanline must be representable as JDIMENSION. */\n  samplesperrow = (long) cinfo->image_width * (long) cinfo->input_components;\n  jd_samplesperrow = (JDIMENSION) samplesperrow;\n  if ((long) jd_samplesperrow != samplesperrow)\n    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);\n\n  /* For now, precision must match compiled-in value... */\n  if (cinfo->data_precision != BITS_IN_JSAMPLE)\n    ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);\n\n  /* Check that number of components won't exceed internal array sizes */\n  if (cinfo->num_components > MAX_COMPONENTS)\n    ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,\n\t     MAX_COMPONENTS);\n\n  /* Compute maximum sampling factors; check factor validity */\n  cinfo->max_h_samp_factor = 1;\n  cinfo->max_v_samp_factor = 1;\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR ||\n\tcompptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)\n      ERREXIT(cinfo, JERR_BAD_SAMPLING);\n    cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,\n\t\t\t\t   compptr->h_samp_factor);\n    cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,\n\t\t\t\t   compptr->v_samp_factor);\n  }\n\n  /* Compute dimensions of components */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Fill in the correct component_index value; don't rely on application */\n    compptr->component_index = ci;\n    /* For compression, we never do DCT scaling. */\n#if JPEG_LIB_VERSION >= 70\n    compptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size = DCTSIZE;\n#else\n    compptr->DCT_scaled_size = DCTSIZE;\n#endif\n    /* Size in DCT blocks */\n    compptr->width_in_blocks = (JDIMENSION)\n      jdiv_round_up((long) cinfo->_jpeg_width * (long) compptr->h_samp_factor,\n\t\t    (long) (cinfo->max_h_samp_factor * DCTSIZE));\n    compptr->height_in_blocks = (JDIMENSION)\n      jdiv_round_up((long) cinfo->_jpeg_height * (long) compptr->v_samp_factor,\n\t\t    (long) (cinfo->max_v_samp_factor * DCTSIZE));\n    /* Size in samples */\n    compptr->downsampled_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->_jpeg_width * (long) compptr->h_samp_factor,\n\t\t    (long) cinfo->max_h_samp_factor);\n    compptr->downsampled_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->_jpeg_height * (long) compptr->v_samp_factor,\n\t\t    (long) cinfo->max_v_samp_factor);\n    /* Mark component needed (this flag isn't actually used for compression) */\n    compptr->component_needed = TRUE;\n  }\n\n  /* Compute number of fully interleaved MCU rows (number of times that\n   * main controller will call coefficient controller).\n   */\n  cinfo->total_iMCU_rows = (JDIMENSION)\n    jdiv_round_up((long) cinfo->_jpeg_height,\n\t\t  (long) (cinfo->max_v_samp_factor*DCTSIZE));\n}\n\n\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n\nLOCAL(void)\nvalidate_script (j_compress_ptr cinfo)\n/* Verify that the scan script in cinfo->scan_info[] is valid; also\n * determine whether it uses progressive JPEG, and set cinfo->progressive_mode.\n */\n{\n  const jpeg_scan_info * scanptr;\n  int scanno, ncomps, ci, coefi, thisi;\n  int Ss, Se, Ah, Al;\n  boolean component_sent[MAX_COMPONENTS];\n#ifdef C_PROGRESSIVE_SUPPORTED\n  int * last_bitpos_ptr;\n  int last_bitpos[MAX_COMPONENTS][DCTSIZE2];\n  /* -1 until that coefficient has been seen; then last Al for it */\n#endif\n\n  if (cinfo->num_scans <= 0)\n    ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, 0);\n\n  /* For sequential JPEG, all scans must have Ss=0, Se=DCTSIZE2-1;\n   * for progressive JPEG, no scan can have this.\n   */\n  scanptr = cinfo->scan_info;\n  if (scanptr->Ss != 0 || scanptr->Se != DCTSIZE2-1) {\n#ifdef C_PROGRESSIVE_SUPPORTED\n    cinfo->progressive_mode = TRUE;\n    last_bitpos_ptr = & last_bitpos[0][0];\n    for (ci = 0; ci < cinfo->num_components; ci++) \n      for (coefi = 0; coefi < DCTSIZE2; coefi++)\n\t*last_bitpos_ptr++ = -1;\n#else\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n  } else {\n    cinfo->progressive_mode = FALSE;\n    for (ci = 0; ci < cinfo->num_components; ci++) \n      component_sent[ci] = FALSE;\n  }\n\n  for (scanno = 1; scanno <= cinfo->num_scans; scanptr++, scanno++) {\n    /* Validate component indexes */\n    ncomps = scanptr->comps_in_scan;\n    if (ncomps <= 0 || ncomps > MAX_COMPS_IN_SCAN)\n      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, ncomps, MAX_COMPS_IN_SCAN);\n    for (ci = 0; ci < ncomps; ci++) {\n      thisi = scanptr->component_index[ci];\n      if (thisi < 0 || thisi >= cinfo->num_components)\n\tERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);\n      /* Components must appear in SOF order within each scan */\n      if (ci > 0 && thisi <= scanptr->component_index[ci-1])\n\tERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);\n    }\n    /* Validate progression parameters */\n    Ss = scanptr->Ss;\n    Se = scanptr->Se;\n    Ah = scanptr->Ah;\n    Al = scanptr->Al;\n    if (cinfo->progressive_mode) {\n#ifdef C_PROGRESSIVE_SUPPORTED\n      /* The JPEG spec simply gives the ranges 0..13 for Ah and Al, but that\n       * seems wrong: the upper bound ought to depend on data precision.\n       * Perhaps they really meant 0..N+1 for N-bit precision.\n       * Here we allow 0..10 for 8-bit data; Al larger than 10 results in\n       * out-of-range reconstructed DC values during the first DC scan,\n       * which might cause problems for some decoders.\n       */\n#if BITS_IN_JSAMPLE == 8\n#define MAX_AH_AL 10\n#else\n#define MAX_AH_AL 13\n#endif\n      if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 ||\n\t  Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL)\n\tERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);\n      if (Ss == 0) {\n\tif (Se != 0)\t\t/* DC and AC together not OK */\n\t  ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);\n      } else {\n\tif (ncomps != 1)\t/* AC scans must be for only one component */\n\t  ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);\n      }\n      for (ci = 0; ci < ncomps; ci++) {\n\tlast_bitpos_ptr = & last_bitpos[scanptr->component_index[ci]][0];\n\tif (Ss != 0 && last_bitpos_ptr[0] < 0) /* AC without prior DC scan */\n\t  ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);\n\tfor (coefi = Ss; coefi <= Se; coefi++) {\n\t  if (last_bitpos_ptr[coefi] < 0) {\n\t    /* first scan of this coefficient */\n\t    if (Ah != 0)\n\t      ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);\n\t  } else {\n\t    /* not first scan */\n\t    if (Ah != last_bitpos_ptr[coefi] || Al != Ah-1)\n\t      ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);\n\t  }\n\t  last_bitpos_ptr[coefi] = Al;\n\t}\n      }\n#endif\n    } else {\n      /* For sequential JPEG, all progression parameters must be these: */\n      if (Ss != 0 || Se != DCTSIZE2-1 || Ah != 0 || Al != 0)\n\tERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);\n      /* Make sure components are not sent twice */\n      for (ci = 0; ci < ncomps; ci++) {\n\tthisi = scanptr->component_index[ci];\n\tif (component_sent[thisi])\n\t  ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);\n\tcomponent_sent[thisi] = TRUE;\n      }\n    }\n  }\n\n  /* Now verify that everything got sent. */\n  if (cinfo->progressive_mode) {\n#ifdef C_PROGRESSIVE_SUPPORTED\n    /* For progressive mode, we only check that at least some DC data\n     * got sent for each component; the spec does not require that all bits\n     * of all coefficients be transmitted.  Would it be wiser to enforce\n     * transmission of all coefficient bits??\n     */\n    for (ci = 0; ci < cinfo->num_components; ci++) {\n      if (last_bitpos[ci][0] < 0)\n\tERREXIT(cinfo, JERR_MISSING_DATA);\n    }\n#endif\n  } else {\n    for (ci = 0; ci < cinfo->num_components; ci++) {\n      if (! component_sent[ci])\n\tERREXIT(cinfo, JERR_MISSING_DATA);\n    }\n  }\n}\n\n#endif /* C_MULTISCAN_FILES_SUPPORTED */\n\n\nLOCAL(void)\nselect_scan_parameters (j_compress_ptr cinfo)\n/* Set up the scan parameters for the current scan */\n{\n  int ci;\n\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n  if (cinfo->scan_info != NULL) {\n    /* Prepare for current scan --- the script is already validated */\n    my_master_ptr master = (my_master_ptr) cinfo->master;\n    const jpeg_scan_info * scanptr = cinfo->scan_info + master->scan_number;\n\n    cinfo->comps_in_scan = scanptr->comps_in_scan;\n    for (ci = 0; ci < scanptr->comps_in_scan; ci++) {\n      cinfo->cur_comp_info[ci] =\n\t&cinfo->comp_info[scanptr->component_index[ci]];\n    }\n    cinfo->Ss = scanptr->Ss;\n    cinfo->Se = scanptr->Se;\n    cinfo->Ah = scanptr->Ah;\n    cinfo->Al = scanptr->Al;\n  }\n  else\n#endif\n  {\n    /* Prepare for single sequential-JPEG scan containing all components */\n    if (cinfo->num_components > MAX_COMPS_IN_SCAN)\n      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,\n\t       MAX_COMPS_IN_SCAN);\n    cinfo->comps_in_scan = cinfo->num_components;\n    for (ci = 0; ci < cinfo->num_components; ci++) {\n      cinfo->cur_comp_info[ci] = &cinfo->comp_info[ci];\n    }\n    cinfo->Ss = 0;\n    cinfo->Se = DCTSIZE2-1;\n    cinfo->Ah = 0;\n    cinfo->Al = 0;\n  }\n}\n\n\nLOCAL(void)\nper_scan_setup (j_compress_ptr cinfo)\n/* Do computations that are needed before processing a JPEG scan */\n/* cinfo->comps_in_scan and cinfo->cur_comp_info[] are already set */\n{\n  int ci, mcublks, tmp;\n  jpeg_component_info *compptr;\n  \n  if (cinfo->comps_in_scan == 1) {\n    \n    /* Noninterleaved (single-component) scan */\n    compptr = cinfo->cur_comp_info[0];\n    \n    /* Overall image size in MCUs */\n    cinfo->MCUs_per_row = compptr->width_in_blocks;\n    cinfo->MCU_rows_in_scan = compptr->height_in_blocks;\n    \n    /* For noninterleaved scan, always one block per MCU */\n    compptr->MCU_width = 1;\n    compptr->MCU_height = 1;\n    compptr->MCU_blocks = 1;\n    compptr->MCU_sample_width = DCTSIZE;\n    compptr->last_col_width = 1;\n    /* For noninterleaved scans, it is convenient to define last_row_height\n     * as the number of block rows present in the last iMCU row.\n     */\n    tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor);\n    if (tmp == 0) tmp = compptr->v_samp_factor;\n    compptr->last_row_height = tmp;\n    \n    /* Prepare array describing MCU composition */\n    cinfo->blocks_in_MCU = 1;\n    cinfo->MCU_membership[0] = 0;\n    \n  } else {\n    \n    /* Interleaved (multi-component) scan */\n    if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)\n      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,\n\t       MAX_COMPS_IN_SCAN);\n    \n    /* Overall image size in MCUs */\n    cinfo->MCUs_per_row = (JDIMENSION)\n      jdiv_round_up((long) cinfo->_jpeg_width,\n\t\t    (long) (cinfo->max_h_samp_factor*DCTSIZE));\n    cinfo->MCU_rows_in_scan = (JDIMENSION)\n      jdiv_round_up((long) cinfo->_jpeg_height,\n\t\t    (long) (cinfo->max_v_samp_factor*DCTSIZE));\n    \n    cinfo->blocks_in_MCU = 0;\n    \n    for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n      compptr = cinfo->cur_comp_info[ci];\n      /* Sampling factors give # of blocks of component in each MCU */\n      compptr->MCU_width = compptr->h_samp_factor;\n      compptr->MCU_height = compptr->v_samp_factor;\n      compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height;\n      compptr->MCU_sample_width = compptr->MCU_width * DCTSIZE;\n      /* Figure number of non-dummy blocks in last MCU column & row */\n      tmp = (int) (compptr->width_in_blocks % compptr->MCU_width);\n      if (tmp == 0) tmp = compptr->MCU_width;\n      compptr->last_col_width = tmp;\n      tmp = (int) (compptr->height_in_blocks % compptr->MCU_height);\n      if (tmp == 0) tmp = compptr->MCU_height;\n      compptr->last_row_height = tmp;\n      /* Prepare array describing MCU composition */\n      mcublks = compptr->MCU_blocks;\n      if (cinfo->blocks_in_MCU + mcublks > C_MAX_BLOCKS_IN_MCU)\n\tERREXIT(cinfo, JERR_BAD_MCU_SIZE);\n      while (mcublks-- > 0) {\n\tcinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;\n      }\n    }\n    \n  }\n\n  /* Convert restart specified in rows to actual MCU count. */\n  /* Note that count must fit in 16 bits, so we provide limiting. */\n  if (cinfo->restart_in_rows > 0) {\n    long nominal = (long) cinfo->restart_in_rows * (long) cinfo->MCUs_per_row;\n    cinfo->restart_interval = (unsigned int) MIN(nominal, 65535L);\n  }\n}\n\n\n/*\n * Per-pass setup.\n * This is called at the beginning of each pass.  We determine which modules\n * will be active during this pass and give them appropriate start_pass calls.\n * We also set is_last_pass to indicate whether any more passes will be\n * required.\n */\n\nMETHODDEF(void)\nprepare_for_pass (j_compress_ptr cinfo)\n{\n  my_master_ptr master = (my_master_ptr) cinfo->master;\n\n  switch (master->pass_type) {\n  case main_pass:\n    /* Initial pass: will collect input data, and do either Huffman\n     * optimization or data output for the first scan.\n     */\n    select_scan_parameters(cinfo);\n    per_scan_setup(cinfo);\n    if (! cinfo->raw_data_in) {\n      (*cinfo->cconvert->start_pass) (cinfo);\n      (*cinfo->downsample->start_pass) (cinfo);\n      (*cinfo->prep->start_pass) (cinfo, JBUF_PASS_THRU);\n    }\n    (*cinfo->fdct->start_pass) (cinfo);\n    (*cinfo->entropy->start_pass) (cinfo, cinfo->optimize_coding);\n    (*cinfo->coef->start_pass) (cinfo,\n\t\t\t\t(master->total_passes > 1 ?\n\t\t\t\t JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));\n    (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);\n    if (cinfo->optimize_coding) {\n      /* No immediate data output; postpone writing frame/scan headers */\n      master->pub.call_pass_startup = FALSE;\n    } else {\n      /* Will write frame/scan headers at first jpeg_write_scanlines call */\n      master->pub.call_pass_startup = TRUE;\n    }\n    break;\n#ifdef ENTROPY_OPT_SUPPORTED\n  case huff_opt_pass:\n    /* Do Huffman optimization for a scan after the first one. */\n    select_scan_parameters(cinfo);\n    per_scan_setup(cinfo);\n    if (cinfo->Ss != 0 || cinfo->Ah == 0 || cinfo->arith_code) {\n      (*cinfo->entropy->start_pass) (cinfo, TRUE);\n      (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST);\n      master->pub.call_pass_startup = FALSE;\n      break;\n    }\n    /* Special case: Huffman DC refinement scans need no Huffman table\n     * and therefore we can skip the optimization pass for them.\n     */\n    master->pass_type = output_pass;\n    master->pass_number++;\n    /*FALLTHROUGH*/\n#endif\n  case output_pass:\n    /* Do a data-output pass. */\n    /* We need not repeat per-scan setup if prior optimization pass did it. */\n    if (! cinfo->optimize_coding) {\n      select_scan_parameters(cinfo);\n      per_scan_setup(cinfo);\n    }\n    (*cinfo->entropy->start_pass) (cinfo, FALSE);\n    (*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST);\n    /* We emit frame/scan headers now */\n    if (master->scan_number == 0)\n      (*cinfo->marker->write_frame_header) (cinfo);\n    (*cinfo->marker->write_scan_header) (cinfo);\n    master->pub.call_pass_startup = FALSE;\n    break;\n  default:\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n  }\n\n  master->pub.is_last_pass = (master->pass_number == master->total_passes-1);\n\n  /* Set up progress monitor's pass info if present */\n  if (cinfo->progress != NULL) {\n    cinfo->progress->completed_passes = master->pass_number;\n    cinfo->progress->total_passes = master->total_passes;\n  }\n}\n\n\n/*\n * Special start-of-pass hook.\n * This is called by jpeg_write_scanlines if call_pass_startup is TRUE.\n * In single-pass processing, we need this hook because we don't want to\n * write frame/scan headers during jpeg_start_compress; we want to let the\n * application write COM markers etc. between jpeg_start_compress and the\n * jpeg_write_scanlines loop.\n * In multi-pass processing, this routine is not used.\n */\n\nMETHODDEF(void)\npass_startup (j_compress_ptr cinfo)\n{\n  cinfo->master->call_pass_startup = FALSE; /* reset flag so call only once */\n\n  (*cinfo->marker->write_frame_header) (cinfo);\n  (*cinfo->marker->write_scan_header) (cinfo);\n}\n\n\n/*\n * Finish up at end of pass.\n */\n\nMETHODDEF(void)\nfinish_pass_master (j_compress_ptr cinfo)\n{\n  my_master_ptr master = (my_master_ptr) cinfo->master;\n\n  /* The entropy coder always needs an end-of-pass call,\n   * either to analyze statistics or to flush its output buffer.\n   */\n  (*cinfo->entropy->finish_pass) (cinfo);\n\n  /* Update state for next pass */\n  switch (master->pass_type) {\n  case main_pass:\n    /* next pass is either output of scan 0 (after optimization)\n     * or output of scan 1 (if no optimization).\n     */\n    master->pass_type = output_pass;\n    if (! cinfo->optimize_coding)\n      master->scan_number++;\n    break;\n  case huff_opt_pass:\n    /* next pass is always output of current scan */\n    master->pass_type = output_pass;\n    break;\n  case output_pass:\n    /* next pass is either optimization or output of next scan */\n    if (cinfo->optimize_coding)\n      master->pass_type = huff_opt_pass;\n    master->scan_number++;\n    break;\n  }\n\n  master->pass_number++;\n}\n\n\n/*\n * Initialize master compression control.\n */\n\nGLOBAL(void)\njinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)\n{\n  my_master_ptr master;\n\n  master = (my_master_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(my_comp_master));\n  cinfo->master = (struct jpeg_comp_master *) master;\n  master->pub.prepare_for_pass = prepare_for_pass;\n  master->pub.pass_startup = pass_startup;\n  master->pub.finish_pass = finish_pass_master;\n  master->pub.is_last_pass = FALSE;\n\n  /* Validate parameters, determine derived values */\n  initial_setup(cinfo, transcode_only);\n\n  if (cinfo->scan_info != NULL) {\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n    validate_script(cinfo);\n#else\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n  } else {\n    cinfo->progressive_mode = FALSE;\n    cinfo->num_scans = 1;\n  }\n\n  if (cinfo->progressive_mode && !cinfo->arith_code)\t/*  TEMPORARY HACK ??? */\n    cinfo->optimize_coding = TRUE; /* assume default tables no good for progressive mode */\n\n  /* Initialize my private state */\n  if (transcode_only) {\n    /* no main pass in transcoding */\n    if (cinfo->optimize_coding)\n      master->pass_type = huff_opt_pass;\n    else\n      master->pass_type = output_pass;\n  } else {\n    /* for normal compression, first pass is always this type: */\n    master->pass_type = main_pass;\n  }\n  master->scan_number = 0;\n  master->pass_number = 0;\n  if (cinfo->optimize_coding)\n    master->total_passes = cinfo->num_scans * 2;\n  else\n    master->total_passes = cinfo->num_scans;\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jcomapi.c",
    "content": "/*\n * jcomapi.c\n *\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains application interface routines that are used for both\n * compression and decompression.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/*\n * Abort processing of a JPEG compression or decompression operation,\n * but don't destroy the object itself.\n *\n * For this, we merely clean up all the nonpermanent memory pools.\n * Note that temp files (virtual arrays) are not allowed to belong to\n * the permanent pool, so we will be able to close all temp files here.\n * Closing a data source or destination, if necessary, is the application's\n * responsibility.\n */\n\nGLOBAL(void)\njpeg_abort (j_common_ptr cinfo)\n{\n  int pool;\n\n  /* Do nothing if called on a not-initialized or destroyed JPEG object. */\n  if (cinfo->mem == NULL)\n    return;\n\n  /* Releasing pools in reverse order might help avoid fragmentation\n   * with some (brain-damaged) malloc libraries.\n   */\n  for (pool = JPOOL_NUMPOOLS-1; pool > JPOOL_PERMANENT; pool--) {\n    (*cinfo->mem->free_pool) (cinfo, pool);\n  }\n\n  /* Reset overall state for possible reuse of object */\n  if (cinfo->is_decompressor) {\n    cinfo->global_state = DSTATE_START;\n    /* Try to keep application from accessing now-deleted marker list.\n     * A bit kludgy to do it here, but this is the most central place.\n     */\n    ((j_decompress_ptr) cinfo)->marker_list = NULL;\n  } else {\n    cinfo->global_state = CSTATE_START;\n  }\n}\n\n\n/*\n * Destruction of a JPEG object.\n *\n * Everything gets deallocated except the master jpeg_compress_struct itself\n * and the error manager struct.  Both of these are supplied by the application\n * and must be freed, if necessary, by the application.  (Often they are on\n * the stack and so don't need to be freed anyway.)\n * Closing a data source or destination, if necessary, is the application's\n * responsibility.\n */\n\nGLOBAL(void)\njpeg_destroy (j_common_ptr cinfo)\n{\n  /* We need only tell the memory manager to release everything. */\n  /* NB: mem pointer is NULL if memory mgr failed to initialize. */\n  if (cinfo->mem != NULL)\n    (*cinfo->mem->self_destruct) (cinfo);\n  cinfo->mem = NULL;\t\t/* be safe if jpeg_destroy is called twice */\n  cinfo->global_state = 0;\t/* mark it destroyed */\n}\n\n\n/*\n * Convenience routines for allocating quantization and Huffman tables.\n * (Would jutils.c be a more reasonable place to put these?)\n */\n\nGLOBAL(JQUANT_TBL *)\njpeg_alloc_quant_table (j_common_ptr cinfo)\n{\n  JQUANT_TBL *tbl;\n\n  tbl = (JQUANT_TBL *)\n    (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JQUANT_TBL));\n  tbl->sent_table = FALSE;\t/* make sure this is false in any new table */\n  return tbl;\n}\n\n\nGLOBAL(JHUFF_TBL *)\njpeg_alloc_huff_table (j_common_ptr cinfo)\n{\n  JHUFF_TBL *tbl;\n\n  tbl = (JHUFF_TBL *)\n    (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, SIZEOF(JHUFF_TBL));\n  tbl->sent_table = FALSE;\t/* make sure this is false in any new table */\n  return tbl;\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jconfig.h",
    "content": "/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */\n/* see jconfig.txt for explanations */\n\n#define JPEG_LIB_VERSION 80\n#define LIBJPEG_TURBO_VERSION 1.3.1\n#define C_ARITH_CODING_SUPPORTED\n#define D_ARITH_CODING_SUPPORTED\n\n#define HAVE_PROTOTYPES\n#define HAVE_UNSIGNED_CHAR\n#define HAVE_UNSIGNED_SHORT\n/* #define void char */\n/* #define const */\n#undef CHAR_IS_UNSIGNED\n#define HAVE_STDDEF_H\n#define HAVE_STDLIB_H\n#undef NEED_BSD_STRINGS\n#undef NEED_SYS_TYPES_H\n#undef NEED_FAR_POINTERS\t/* we presume a 32-bit flat memory model */\n#undef NEED_SHORT_EXTERNAL_NAMES\n#undef INCOMPLETE_TYPES_BROKEN\n\n/* Define \"boolean\" as unsigned char, not int, per Windows custom */\n#ifndef __RPCNDR_H__\t\t/* don't conflict if rpcndr.h already read */\ntypedef unsigned char boolean;\n#endif\n#define HAVE_BOOLEAN\t\t/* prevent jmorecfg.h from redefining it */\n\n/* Define \"INT32\" as int, not long, per Windows custom */\n#if !(defined(_BASETSD_H_) || defined(_BASETSD_H))   /* don't conflict if basetsd.h already read */\ntypedef short INT16;\ntypedef signed int INT32;\n#endif\n#define XMD_H                   /* prevent jmorecfg.h from redefining it */\n\n#ifdef JPEG_INTERNALS\n\n#undef RIGHT_SHIFT_IS_UNSIGNED\n\n#endif /* JPEG_INTERNALS */\n\n/* SumatraPDF: enable SIMD under Win32 */\n#define WITH_SIMD\n"
  },
  {
    "path": "ext/libjpeg-turbo/jconfig.h.in",
    "content": "/* Version ID for the JPEG library.\n * Might be useful for tests like \"#if JPEG_LIB_VERSION >= 60\".\n */\n#define JPEG_LIB_VERSION  62\t/* Version 6b */\n\n/* libjpeg-turbo version */\n#define LIBJPEG_TURBO_VERSION 0\n\n/* Support arithmetic encoding */\n#undef C_ARITH_CODING_SUPPORTED\n\n/* Support arithmetic decoding */\n#undef D_ARITH_CODING_SUPPORTED\n\n/* Support in-memory source/destination managers */\n#undef MEM_SRCDST_SUPPORTED\n\n/* Compiler supports function prototypes. */\n#undef HAVE_PROTOTYPES\n\n/* Define to 1 if you have the <stddef.h> header file. */\n#undef HAVE_STDDEF_H\n\n/* Define to 1 if you have the <stdlib.h> header file. */\n#undef HAVE_STDLIB_H\n\n/* Compiler supports 'unsigned char'. */\n#undef HAVE_UNSIGNED_CHAR\n\n/* Compiler supports 'unsigned short'. */\n#undef HAVE_UNSIGNED_SHORT\n\n/* Compiler does not support pointers to unspecified structures. */\n#undef INCOMPLETE_TYPES_BROKEN\n\n/* Compiler has <strings.h> rather than standard <string.h>. */\n#undef NEED_BSD_STRINGS\n\n/* Linker requires that global names be unique in first 15 characters. */\n#undef NEED_SHORT_EXTERNAL_NAMES\n\n/* Need to include <sys/types.h> in order to obtain size_t. */\n#undef NEED_SYS_TYPES_H\n\n/* Broken compiler shifts signed values as an unsigned shift. */\n#undef RIGHT_SHIFT_IS_UNSIGNED\n\n/* Use accelerated SIMD routines. */\n#undef WITH_SIMD\n\n/* Define to 1 if type `char' is unsigned and you are not using gcc.  */\n#ifndef __CHAR_UNSIGNED__\n# undef __CHAR_UNSIGNED__\n#endif\n\n/* Define to empty if `const' does not conform to ANSI C. */\n#undef const\n\n/* Define to `unsigned int' if <sys/types.h> does not define. */\n#undef size_t\n"
  },
  {
    "path": "ext/libjpeg-turbo/jconfig.txt",
    "content": "/*\n * jconfig.txt\n *\n * Copyright (C) 1991-1994, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file documents the configuration options that are required to\n * customize the JPEG software for a particular system.\n *\n * The actual configuration options for a particular installation are stored\n * in jconfig.h.  On many machines, jconfig.h can be generated automatically\n * or copied from one of the \"canned\" jconfig files that we supply.  But if\n * you need to generate a jconfig.h file by hand, this file tells you how.\n *\n * DO NOT EDIT THIS FILE --- IT WON'T ACCOMPLISH ANYTHING.\n * EDIT A COPY NAMED JCONFIG.H.\n */\n\n\n/*\n * These symbols indicate the properties of your machine or compiler.\n * #define the symbol if yes, #undef it if no.\n */\n\n/* Does your compiler support function prototypes?\n * (If not, you also need to use ansi2knr, see install.txt)\n */\n#define HAVE_PROTOTYPES\n\n/* Does your compiler support the declaration \"unsigned char\" ?\n * How about \"unsigned short\" ?\n */\n#define HAVE_UNSIGNED_CHAR\n#define HAVE_UNSIGNED_SHORT\n\n/* Define \"void\" as \"char\" if your compiler doesn't know about type void.\n * NOTE: be sure to define void such that \"void *\" represents the most general\n * pointer type, e.g., that returned by malloc().\n */\n/* #define void char */\n\n/* Define \"const\" as empty if your compiler doesn't know the \"const\" keyword.\n */\n/* #define const */\n\n/* Define this if an ordinary \"char\" type is unsigned.\n * If you're not sure, leaving it undefined will work at some cost in speed.\n * If you defined HAVE_UNSIGNED_CHAR then the speed difference is minimal.\n */\n#undef CHAR_IS_UNSIGNED\n\n/* Define this if your system has an ANSI-conforming <stddef.h> file.\n */\n#define HAVE_STDDEF_H\n\n/* Define this if your system has an ANSI-conforming <stdlib.h> file.\n */\n#define HAVE_STDLIB_H\n\n/* Define this if your system does not have an ANSI/SysV <string.h>,\n * but does have a BSD-style <strings.h>.\n */\n#undef NEED_BSD_STRINGS\n\n/* Define this if your system does not provide typedef size_t in any of the\n * ANSI-standard places (stddef.h, stdlib.h, or stdio.h), but places it in\n * <sys/types.h> instead.\n */\n#undef NEED_SYS_TYPES_H\n\n/* For 80x86 machines, you need to define NEED_FAR_POINTERS,\n * unless you are using a large-data memory model or 80386 flat-memory mode.\n * On less brain-damaged CPUs this symbol must not be defined.\n * (Defining this symbol causes large data structures to be referenced through\n * \"far\" pointers and to be allocated with a special version of malloc.)\n */\n#undef NEED_FAR_POINTERS\n\n/* Define this if your linker needs global names to be unique in less\n * than the first 15 characters.\n */\n#undef NEED_SHORT_EXTERNAL_NAMES\n\n/* Although a real ANSI C compiler can deal perfectly well with pointers to\n * unspecified structures (see \"incomplete types\" in the spec), a few pre-ANSI\n * and pseudo-ANSI compilers get confused.  To keep one of these bozos happy,\n * define INCOMPLETE_TYPES_BROKEN.  This is not recommended unless you\n * actually get \"missing structure definition\" warnings or errors while\n * compiling the JPEG code.\n */\n#undef INCOMPLETE_TYPES_BROKEN\n\n/* Define \"boolean\" as unsigned char, not int, on Windows systems.\n */\n#ifdef _WIN32\n#ifndef __RPCNDR_H__\t\t/* don't conflict if rpcndr.h already read */\ntypedef unsigned char boolean;\n#endif\n#define HAVE_BOOLEAN\t\t/* prevent jmorecfg.h from redefining it */\n#endif\n\n\n/*\n * The following options affect code selection within the JPEG library,\n * but they don't need to be visible to applications using the library.\n * To minimize application namespace pollution, the symbols won't be\n * defined unless JPEG_INTERNALS has been defined.\n */\n\n#ifdef JPEG_INTERNALS\n\n/* Define this if your compiler implements \">>\" on signed values as a logical\n * (unsigned) shift; leave it undefined if \">>\" is a signed (arithmetic) shift,\n * which is the normal and rational definition.\n */\n#undef RIGHT_SHIFT_IS_UNSIGNED\n\n\n#endif /* JPEG_INTERNALS */\n\n\n/*\n * The remaining options do not affect the JPEG library proper,\n * but only the sample applications cjpeg/djpeg (see cjpeg.c, djpeg.c).\n * Other applications can ignore these.\n */\n\n#ifdef JPEG_CJPEG_DJPEG\n\n/* These defines indicate which image (non-JPEG) file formats are allowed. */\n\n#define BMP_SUPPORTED\t\t/* BMP image file format */\n#define GIF_SUPPORTED\t\t/* GIF image file format */\n#define PPM_SUPPORTED\t\t/* PBMPLUS PPM/PGM image file format */\n#undef RLE_SUPPORTED\t\t/* Utah RLE image file format */\n#define TARGA_SUPPORTED\t\t/* Targa image file format */\n\n/* Define this if you want to name both input and output files on the command\n * line, rather than using stdout and optionally stdin.  You MUST do this if\n * your system can't cope with binary I/O to stdin/stdout.  See comments at\n * head of cjpeg.c or djpeg.c.\n */\n#undef TWO_FILE_COMMANDLINE\n\n/* Define this if your system needs explicit cleanup of temporary files.\n * This is crucial under MS-DOS, where the temporary \"files\" may be areas\n * of extended memory; on most other systems it's not as important.\n */\n#undef NEED_SIGNAL_CATCHER\n\n/* By default, we open image files with fopen(...,\"rb\") or fopen(...,\"wb\").\n * This is necessary on systems that distinguish text files from binary files,\n * and is harmless on most systems that don't.  If you have one of the rare\n * systems that complains about the \"b\" spec, define this symbol.\n */\n#undef DONT_USE_B_MODE\n\n/* Define this if you want percent-done progress reports from cjpeg/djpeg.\n */\n#undef PROGRESS_REPORT\n\n\n#endif /* JPEG_CJPEG_DJPEG */\n"
  },
  {
    "path": "ext/libjpeg-turbo/jcparam.c",
    "content": "/*\n * jcparam.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * Modified 2003-2008 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2009-2011, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains optional default-setting code for the JPEG compressor.\n * Applications do not have to use this file, but those that don't use it\n * must know a lot more about the innards of the JPEG code.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/*\n * Quantization table setup routines\n */\n\nGLOBAL(void)\njpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,\n\t\t      const unsigned int *basic_table,\n\t\t      int scale_factor, boolean force_baseline)\n/* Define a quantization table equal to the basic_table times\n * a scale factor (given as a percentage).\n * If force_baseline is TRUE, the computed quantization table entries\n * are limited to 1..255 for JPEG baseline compatibility.\n */\n{\n  JQUANT_TBL ** qtblptr;\n  int i;\n  long temp;\n\n  /* Safety check to ensure start_compress not called yet. */\n  if (cinfo->global_state != CSTATE_START)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  if (which_tbl < 0 || which_tbl >= NUM_QUANT_TBLS)\n    ERREXIT1(cinfo, JERR_DQT_INDEX, which_tbl);\n\n  qtblptr = & cinfo->quant_tbl_ptrs[which_tbl];\n\n  if (*qtblptr == NULL)\n    *qtblptr = jpeg_alloc_quant_table((j_common_ptr) cinfo);\n\n  for (i = 0; i < DCTSIZE2; i++) {\n    temp = ((long) basic_table[i] * scale_factor + 50L) / 100L;\n    /* limit the values to the valid range */\n    if (temp <= 0L) temp = 1L;\n    if (temp > 32767L) temp = 32767L; /* max quantizer needed for 12 bits */\n    if (force_baseline && temp > 255L)\n      temp = 255L;\t\t/* limit to baseline range if requested */\n    (*qtblptr)->quantval[i] = (UINT16) temp;\n  }\n\n  /* Initialize sent_table FALSE so table will be written to JPEG file. */\n  (*qtblptr)->sent_table = FALSE;\n}\n\n\n/* These are the sample quantization tables given in JPEG spec section K.1.\n * The spec says that the values given produce \"good\" quality, and\n * when divided by 2, \"very good\" quality.\n */\nstatic const unsigned int std_luminance_quant_tbl[DCTSIZE2] = {\n  16,  11,  10,  16,  24,  40,  51,  61,\n  12,  12,  14,  19,  26,  58,  60,  55,\n  14,  13,  16,  24,  40,  57,  69,  56,\n  14,  17,  22,  29,  51,  87,  80,  62,\n  18,  22,  37,  56,  68, 109, 103,  77,\n  24,  35,  55,  64,  81, 104, 113,  92,\n  49,  64,  78,  87, 103, 121, 120, 101,\n  72,  92,  95,  98, 112, 100, 103,  99\n};\nstatic const unsigned int std_chrominance_quant_tbl[DCTSIZE2] = {\n  17,  18,  24,  47,  99,  99,  99,  99,\n  18,  21,  26,  66,  99,  99,  99,  99,\n  24,  26,  56,  99,  99,  99,  99,  99,\n  47,  66,  99,  99,  99,  99,  99,  99,\n  99,  99,  99,  99,  99,  99,  99,  99,\n  99,  99,  99,  99,  99,  99,  99,  99,\n  99,  99,  99,  99,  99,  99,  99,  99,\n  99,  99,  99,  99,  99,  99,  99,  99\n};\n\n\n#if JPEG_LIB_VERSION >= 70\nGLOBAL(void)\njpeg_default_qtables (j_compress_ptr cinfo, boolean force_baseline)\n/* Set or change the 'quality' (quantization) setting, using default tables\n * and straight percentage-scaling quality scales.\n * This entry point allows different scalings for luminance and chrominance.\n */\n{\n  /* Set up two quantization tables using the specified scaling */\n  jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,\n\t\t       cinfo->q_scale_factor[0], force_baseline);\n  jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,\n\t\t       cinfo->q_scale_factor[1], force_baseline);\n}\n#endif\n\n\nGLOBAL(void)\njpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,\n\t\t\t boolean force_baseline)\n/* Set or change the 'quality' (quantization) setting, using default tables\n * and a straight percentage-scaling quality scale.  In most cases it's better\n * to use jpeg_set_quality (below); this entry point is provided for\n * applications that insist on a linear percentage scaling.\n */\n{\n  /* Set up two quantization tables using the specified scaling */\n  jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,\n\t\t       scale_factor, force_baseline);\n  jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,\n\t\t       scale_factor, force_baseline);\n}\n\n\nGLOBAL(int)\njpeg_quality_scaling (int quality)\n/* Convert a user-specified quality rating to a percentage scaling factor\n * for an underlying quantization table, using our recommended scaling curve.\n * The input 'quality' factor should be 0 (terrible) to 100 (very good).\n */\n{\n  /* Safety limit on quality factor.  Convert 0 to 1 to avoid zero divide. */\n  if (quality <= 0) quality = 1;\n  if (quality > 100) quality = 100;\n\n  /* The basic table is used as-is (scaling 100) for a quality of 50.\n   * Qualities 50..100 are converted to scaling percentage 200 - 2*Q;\n   * note that at Q=100 the scaling is 0, which will cause jpeg_add_quant_table\n   * to make all the table entries 1 (hence, minimum quantization loss).\n   * Qualities 1..50 are converted to scaling percentage 5000/Q.\n   */\n  if (quality < 50)\n    quality = 5000 / quality;\n  else\n    quality = 200 - quality*2;\n\n  return quality;\n}\n\n\nGLOBAL(void)\njpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)\n/* Set or change the 'quality' (quantization) setting, using default tables.\n * This is the standard quality-adjusting entry point for typical user\n * interfaces; only those who want detailed control over quantization tables\n * would use the preceding three routines directly.\n */\n{\n  /* Convert user 0-100 rating to percentage scaling */\n  quality = jpeg_quality_scaling(quality);\n\n  /* Set up standard quality tables */\n  jpeg_set_linear_quality(cinfo, quality, force_baseline);\n}\n\n\n/*\n * Huffman table setup routines\n */\n\nLOCAL(void)\nadd_huff_table (j_compress_ptr cinfo,\n\t\tJHUFF_TBL **htblptr, const UINT8 *bits, const UINT8 *val)\n/* Define a Huffman table */\n{\n  int nsymbols, len;\n\n  if (*htblptr == NULL)\n    *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);\n\n  /* Copy the number-of-symbols-of-each-code-length counts */\n  MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));\n\n  /* Validate the counts.  We do this here mainly so we can copy the right\n   * number of symbols from the val[] array, without risking marching off\n   * the end of memory.  jchuff.c will do a more thorough test later.\n   */\n  nsymbols = 0;\n  for (len = 1; len <= 16; len++)\n    nsymbols += bits[len];\n  if (nsymbols < 1 || nsymbols > 256)\n    ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n\n  MEMCOPY((*htblptr)->huffval, val, nsymbols * SIZEOF(UINT8));\n\n  /* Initialize sent_table FALSE so table will be written to JPEG file. */\n  (*htblptr)->sent_table = FALSE;\n}\n\n\nLOCAL(void)\nstd_huff_tables (j_compress_ptr cinfo)\n/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */\n/* IMPORTANT: these are only valid for 8-bit data precision! */\n{\n  static const UINT8 bits_dc_luminance[17] =\n    { /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };\n  static const UINT8 val_dc_luminance[] =\n    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };\n  \n  static const UINT8 bits_dc_chrominance[17] =\n    { /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };\n  static const UINT8 val_dc_chrominance[] =\n    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };\n  \n  static const UINT8 bits_ac_luminance[17] =\n    { /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };\n  static const UINT8 val_ac_luminance[] =\n    { 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,\n      0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,\n      0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,\n      0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,\n      0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,\n      0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,\n      0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,\n      0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,\n      0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,\n      0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,\n      0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,\n      0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,\n      0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,\n      0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,\n      0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,\n      0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,\n      0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,\n      0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,\n      0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,\n      0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,\n      0xf9, 0xfa };\n  \n  static const UINT8 bits_ac_chrominance[17] =\n    { /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 };\n  static const UINT8 val_ac_chrominance[] =\n    { 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,\n      0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,\n      0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,\n      0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,\n      0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,\n      0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,\n      0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,\n      0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,\n      0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,\n      0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,\n      0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,\n      0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,\n      0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,\n      0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,\n      0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,\n      0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,\n      0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,\n      0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,\n      0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,\n      0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,\n      0xf9, 0xfa };\n  \n  add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[0],\n\t\t bits_dc_luminance, val_dc_luminance);\n  add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[0],\n\t\t bits_ac_luminance, val_ac_luminance);\n  add_huff_table(cinfo, &cinfo->dc_huff_tbl_ptrs[1],\n\t\t bits_dc_chrominance, val_dc_chrominance);\n  add_huff_table(cinfo, &cinfo->ac_huff_tbl_ptrs[1],\n\t\t bits_ac_chrominance, val_ac_chrominance);\n}\n\n\n/*\n * Default parameter setup for compression.\n *\n * Applications that don't choose to use this routine must do their\n * own setup of all these parameters.  Alternately, you can call this\n * to establish defaults and then alter parameters selectively.  This\n * is the recommended approach since, if we add any new parameters,\n * your code will still work (they'll be set to reasonable defaults).\n */\n\nGLOBAL(void)\njpeg_set_defaults (j_compress_ptr cinfo)\n{\n  int i;\n\n  /* Safety check to ensure start_compress not called yet. */\n  if (cinfo->global_state != CSTATE_START)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  /* Allocate comp_info array large enough for maximum component count.\n   * Array is made permanent in case application wants to compress\n   * multiple images at same param settings.\n   */\n  if (cinfo->comp_info == NULL)\n    cinfo->comp_info = (jpeg_component_info *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n\t\t\t\t  MAX_COMPONENTS * SIZEOF(jpeg_component_info));\n\n  /* Initialize everything not dependent on the color space */\n\n#if JPEG_LIB_VERSION >= 70\n  cinfo->scale_num = 1;\t\t/* 1:1 scaling */\n  cinfo->scale_denom = 1;\n#endif\n  cinfo->data_precision = BITS_IN_JSAMPLE;\n  /* Set up two quantization tables using default quality of 75 */\n  jpeg_set_quality(cinfo, 75, TRUE);\n  /* Set up two Huffman tables */\n  std_huff_tables(cinfo);\n\n  /* Initialize default arithmetic coding conditioning */\n  for (i = 0; i < NUM_ARITH_TBLS; i++) {\n    cinfo->arith_dc_L[i] = 0;\n    cinfo->arith_dc_U[i] = 1;\n    cinfo->arith_ac_K[i] = 5;\n  }\n\n  /* Default is no multiple-scan output */\n  cinfo->scan_info = NULL;\n  cinfo->num_scans = 0;\n\n  /* Expect normal source image, not raw downsampled data */\n  cinfo->raw_data_in = FALSE;\n\n  /* Use Huffman coding, not arithmetic coding, by default */\n  cinfo->arith_code = FALSE;\n\n  /* By default, don't do extra passes to optimize entropy coding */\n  cinfo->optimize_coding = FALSE;\n  /* The standard Huffman tables are only valid for 8-bit data precision.\n   * If the precision is higher, force optimization on so that usable\n   * tables will be computed.  This test can be removed if default tables\n   * are supplied that are valid for the desired precision.\n   */\n  if (cinfo->data_precision > 8)\n    cinfo->optimize_coding = TRUE;\n\n  /* By default, use the simpler non-cosited sampling alignment */\n  cinfo->CCIR601_sampling = FALSE;\n\n#if JPEG_LIB_VERSION >= 70\n  /* By default, apply fancy downsampling */\n  cinfo->do_fancy_downsampling = TRUE;\n#endif\n\n  /* No input smoothing */\n  cinfo->smoothing_factor = 0;\n\n  /* DCT algorithm preference */\n  cinfo->dct_method = JDCT_DEFAULT;\n\n  /* No restart markers */\n  cinfo->restart_interval = 0;\n  cinfo->restart_in_rows = 0;\n\n  /* Fill in default JFIF marker parameters.  Note that whether the marker\n   * will actually be written is determined by jpeg_set_colorspace.\n   *\n   * By default, the library emits JFIF version code 1.01.\n   * An application that wants to emit JFIF 1.02 extension markers should set\n   * JFIF_minor_version to 2.  We could probably get away with just defaulting\n   * to 1.02, but there may still be some decoders in use that will complain\n   * about that; saying 1.01 should minimize compatibility problems.\n   */\n  cinfo->JFIF_major_version = 1; /* Default JFIF version = 1.01 */\n  cinfo->JFIF_minor_version = 1;\n  cinfo->density_unit = 0;\t/* Pixel size is unknown by default */\n  cinfo->X_density = 1;\t\t/* Pixel aspect ratio is square by default */\n  cinfo->Y_density = 1;\n\n  /* Choose JPEG colorspace based on input space, set defaults accordingly */\n\n  jpeg_default_colorspace(cinfo);\n}\n\n\n/*\n * Select an appropriate JPEG colorspace for in_color_space.\n */\n\nGLOBAL(void)\njpeg_default_colorspace (j_compress_ptr cinfo)\n{\n  switch (cinfo->in_color_space) {\n  case JCS_GRAYSCALE:\n    jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);\n    break;\n  case JCS_RGB:\n  case JCS_EXT_RGB:\n  case JCS_EXT_RGBX:\n  case JCS_EXT_BGR:\n  case JCS_EXT_BGRX:\n  case JCS_EXT_XBGR:\n  case JCS_EXT_XRGB:\n  case JCS_EXT_RGBA:\n  case JCS_EXT_BGRA:\n  case JCS_EXT_ABGR:\n  case JCS_EXT_ARGB:\n    jpeg_set_colorspace(cinfo, JCS_YCbCr);\n    break;\n  case JCS_YCbCr:\n    jpeg_set_colorspace(cinfo, JCS_YCbCr);\n    break;\n  case JCS_CMYK:\n    jpeg_set_colorspace(cinfo, JCS_CMYK); /* By default, no translation */\n    break;\n  case JCS_YCCK:\n    jpeg_set_colorspace(cinfo, JCS_YCCK);\n    break;\n  case JCS_UNKNOWN:\n    jpeg_set_colorspace(cinfo, JCS_UNKNOWN);\n    break;\n  default:\n    ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);\n  }\n}\n\n\n/*\n * Set the JPEG colorspace, and choose colorspace-dependent default values.\n */\n\nGLOBAL(void)\njpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)\n{\n  jpeg_component_info * compptr;\n  int ci;\n\n#define SET_COMP(index,id,hsamp,vsamp,quant,dctbl,actbl)  \\\n  (compptr = &cinfo->comp_info[index], \\\n   compptr->component_id = (id), \\\n   compptr->h_samp_factor = (hsamp), \\\n   compptr->v_samp_factor = (vsamp), \\\n   compptr->quant_tbl_no = (quant), \\\n   compptr->dc_tbl_no = (dctbl), \\\n   compptr->ac_tbl_no = (actbl) )\n\n  /* Safety check to ensure start_compress not called yet. */\n  if (cinfo->global_state != CSTATE_START)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  /* For all colorspaces, we use Q and Huff tables 0 for luminance components,\n   * tables 1 for chrominance components.\n   */\n\n  cinfo->jpeg_color_space = colorspace;\n\n  cinfo->write_JFIF_header = FALSE; /* No marker for non-JFIF colorspaces */\n  cinfo->write_Adobe_marker = FALSE; /* write no Adobe marker by default */\n\n  switch (colorspace) {\n  case JCS_GRAYSCALE:\n    cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */\n    cinfo->num_components = 1;\n    /* JFIF specifies component ID 1 */\n    SET_COMP(0, 1, 1,1, 0, 0,0);\n    break;\n  case JCS_RGB:\n    cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */\n    cinfo->num_components = 3;\n    SET_COMP(0, 0x52 /* 'R' */, 1,1, 0, 0,0);\n    SET_COMP(1, 0x47 /* 'G' */, 1,1, 0, 0,0);\n    SET_COMP(2, 0x42 /* 'B' */, 1,1, 0, 0,0);\n    break;\n  case JCS_YCbCr:\n    cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */\n    cinfo->num_components = 3;\n    /* JFIF specifies component IDs 1,2,3 */\n    /* We default to 2x2 subsamples of chrominance */\n    SET_COMP(0, 1, 2,2, 0, 0,0);\n    SET_COMP(1, 2, 1,1, 1, 1,1);\n    SET_COMP(2, 3, 1,1, 1, 1,1);\n    break;\n  case JCS_CMYK:\n    cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag CMYK */\n    cinfo->num_components = 4;\n    SET_COMP(0, 0x43 /* 'C' */, 1,1, 0, 0,0);\n    SET_COMP(1, 0x4D /* 'M' */, 1,1, 0, 0,0);\n    SET_COMP(2, 0x59 /* 'Y' */, 1,1, 0, 0,0);\n    SET_COMP(3, 0x4B /* 'K' */, 1,1, 0, 0,0);\n    break;\n  case JCS_YCCK:\n    cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag YCCK */\n    cinfo->num_components = 4;\n    SET_COMP(0, 1, 2,2, 0, 0,0);\n    SET_COMP(1, 2, 1,1, 1, 1,1);\n    SET_COMP(2, 3, 1,1, 1, 1,1);\n    SET_COMP(3, 4, 2,2, 0, 0,0);\n    break;\n  case JCS_UNKNOWN:\n    cinfo->num_components = cinfo->input_components;\n    if (cinfo->num_components < 1 || cinfo->num_components > MAX_COMPONENTS)\n      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,\n\t       MAX_COMPONENTS);\n    for (ci = 0; ci < cinfo->num_components; ci++) {\n      SET_COMP(ci, ci, 1,1, 0, 0,0);\n    }\n    break;\n  default:\n    ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n  }\n}\n\n\n#ifdef C_PROGRESSIVE_SUPPORTED\n\nLOCAL(jpeg_scan_info *)\nfill_a_scan (jpeg_scan_info * scanptr, int ci,\n\t     int Ss, int Se, int Ah, int Al)\n/* Support routine: generate one scan for specified component */\n{\n  scanptr->comps_in_scan = 1;\n  scanptr->component_index[0] = ci;\n  scanptr->Ss = Ss;\n  scanptr->Se = Se;\n  scanptr->Ah = Ah;\n  scanptr->Al = Al;\n  scanptr++;\n  return scanptr;\n}\n\nLOCAL(jpeg_scan_info *)\nfill_scans (jpeg_scan_info * scanptr, int ncomps,\n\t    int Ss, int Se, int Ah, int Al)\n/* Support routine: generate one scan for each component */\n{\n  int ci;\n\n  for (ci = 0; ci < ncomps; ci++) {\n    scanptr->comps_in_scan = 1;\n    scanptr->component_index[0] = ci;\n    scanptr->Ss = Ss;\n    scanptr->Se = Se;\n    scanptr->Ah = Ah;\n    scanptr->Al = Al;\n    scanptr++;\n  }\n  return scanptr;\n}\n\nLOCAL(jpeg_scan_info *)\nfill_dc_scans (jpeg_scan_info * scanptr, int ncomps, int Ah, int Al)\n/* Support routine: generate interleaved DC scan if possible, else N scans */\n{\n  int ci;\n\n  if (ncomps <= MAX_COMPS_IN_SCAN) {\n    /* Single interleaved DC scan */\n    scanptr->comps_in_scan = ncomps;\n    for (ci = 0; ci < ncomps; ci++)\n      scanptr->component_index[ci] = ci;\n    scanptr->Ss = scanptr->Se = 0;\n    scanptr->Ah = Ah;\n    scanptr->Al = Al;\n    scanptr++;\n  } else {\n    /* Noninterleaved DC scan for each component */\n    scanptr = fill_scans(scanptr, ncomps, 0, 0, Ah, Al);\n  }\n  return scanptr;\n}\n\n\n/*\n * Create a recommended progressive-JPEG script.\n * cinfo->num_components and cinfo->jpeg_color_space must be correct.\n */\n\nGLOBAL(void)\njpeg_simple_progression (j_compress_ptr cinfo)\n{\n  int ncomps = cinfo->num_components;\n  int nscans;\n  jpeg_scan_info * scanptr;\n\n  /* Safety check to ensure start_compress not called yet. */\n  if (cinfo->global_state != CSTATE_START)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  /* Figure space needed for script.  Calculation must match code below! */\n  if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {\n    /* Custom script for YCbCr color images. */\n    nscans = 10;\n  } else {\n    /* All-purpose script for other color spaces. */\n    if (ncomps > MAX_COMPS_IN_SCAN)\n      nscans = 6 * ncomps;\t/* 2 DC + 4 AC scans per component */\n    else\n      nscans = 2 + 4 * ncomps;\t/* 2 DC scans; 4 AC scans per component */\n  }\n\n  /* Allocate space for script.\n   * We need to put it in the permanent pool in case the application performs\n   * multiple compressions without changing the settings.  To avoid a memory\n   * leak if jpeg_simple_progression is called repeatedly for the same JPEG\n   * object, we try to re-use previously allocated space, and we allocate\n   * enough space to handle YCbCr even if initially asked for grayscale.\n   */\n  if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) {\n    cinfo->script_space_size = MAX(nscans, 10);\n    cinfo->script_space = (jpeg_scan_info *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n\t\t\tcinfo->script_space_size * SIZEOF(jpeg_scan_info));\n  }\n  scanptr = cinfo->script_space;\n  cinfo->scan_info = scanptr;\n  cinfo->num_scans = nscans;\n\n  if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {\n    /* Custom script for YCbCr color images. */\n    /* Initial DC scan */\n    scanptr = fill_dc_scans(scanptr, ncomps, 0, 1);\n    /* Initial AC scan: get some luma data out in a hurry */\n    scanptr = fill_a_scan(scanptr, 0, 1, 5, 0, 2);\n    /* Chroma data is too small to be worth expending many scans on */\n    scanptr = fill_a_scan(scanptr, 2, 1, 63, 0, 1);\n    scanptr = fill_a_scan(scanptr, 1, 1, 63, 0, 1);\n    /* Complete spectral selection for luma AC */\n    scanptr = fill_a_scan(scanptr, 0, 6, 63, 0, 2);\n    /* Refine next bit of luma AC */\n    scanptr = fill_a_scan(scanptr, 0, 1, 63, 2, 1);\n    /* Finish DC successive approximation */\n    scanptr = fill_dc_scans(scanptr, ncomps, 1, 0);\n    /* Finish AC successive approximation */\n    scanptr = fill_a_scan(scanptr, 2, 1, 63, 1, 0);\n    scanptr = fill_a_scan(scanptr, 1, 1, 63, 1, 0);\n    /* Luma bottom bit comes last since it's usually largest scan */\n    scanptr = fill_a_scan(scanptr, 0, 1, 63, 1, 0);\n  } else {\n    /* All-purpose script for other color spaces. */\n    /* Successive approximation first pass */\n    scanptr = fill_dc_scans(scanptr, ncomps, 0, 1);\n    scanptr = fill_scans(scanptr, ncomps, 1, 5, 0, 2);\n    scanptr = fill_scans(scanptr, ncomps, 6, 63, 0, 2);\n    /* Successive approximation second pass */\n    scanptr = fill_scans(scanptr, ncomps, 1, 63, 2, 1);\n    /* Successive approximation final pass */\n    scanptr = fill_dc_scans(scanptr, ncomps, 1, 0);\n    scanptr = fill_scans(scanptr, ncomps, 1, 63, 1, 0);\n  }\n}\n\n#endif /* C_PROGRESSIVE_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/jcphuff.c",
    "content": "/*\n * jcphuff.c\n *\n * Copyright (C) 1995-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains Huffman entropy encoding routines for progressive JPEG.\n *\n * We do not support output suspension in this module, since the library\n * currently does not allow multiple-scan files to be written with output\n * suspension.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jchuff.h\"\t\t/* Declarations shared with jchuff.c */\n\n#ifdef C_PROGRESSIVE_SUPPORTED\n\n/* Expanded entropy encoder object for progressive Huffman encoding. */\n\ntypedef struct {\n  struct jpeg_entropy_encoder pub; /* public fields */\n\n  /* Mode flag: TRUE for optimization, FALSE for actual data output */\n  boolean gather_statistics;\n\n  /* Bit-level coding status.\n   * next_output_byte/free_in_buffer are local copies of cinfo->dest fields.\n   */\n  JOCTET * next_output_byte;\t/* => next byte to write in buffer */\n  size_t free_in_buffer;\t/* # of byte spaces remaining in buffer */\n  INT32 put_buffer;\t\t/* current bit-accumulation buffer */\n  int put_bits;\t\t\t/* # of bits now in it */\n  j_compress_ptr cinfo;\t\t/* link to cinfo (needed for dump_buffer) */\n\n  /* Coding status for DC components */\n  int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */\n\n  /* Coding status for AC components */\n  int ac_tbl_no;\t\t/* the table number of the single component */\n  unsigned int EOBRUN;\t\t/* run length of EOBs */\n  unsigned int BE;\t\t/* # of buffered correction bits before MCU */\n  char * bit_buffer;\t\t/* buffer for correction bits (1 per char) */\n  /* packing correction bits tightly would save some space but cost time... */\n\n  unsigned int restarts_to_go;\t/* MCUs left in this restart interval */\n  int next_restart_num;\t\t/* next restart number to write (0-7) */\n\n  /* Pointers to derived tables (these workspaces have image lifespan).\n   * Since any one scan codes only DC or only AC, we only need one set\n   * of tables, not one for DC and one for AC.\n   */\n  c_derived_tbl * derived_tbls[NUM_HUFF_TBLS];\n\n  /* Statistics tables for optimization; again, one set is enough */\n  long * count_ptrs[NUM_HUFF_TBLS];\n} phuff_entropy_encoder;\n\ntypedef phuff_entropy_encoder * phuff_entropy_ptr;\n\n/* MAX_CORR_BITS is the number of bits the AC refinement correction-bit\n * buffer can hold.  Larger sizes may slightly improve compression, but\n * 1000 is already well into the realm of overkill.\n * The minimum safe size is 64 bits.\n */\n\n#define MAX_CORR_BITS  1000\t/* Max # of correction bits I can buffer */\n\n/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than INT32.\n * We assume that int right shift is unsigned if INT32 right shift is,\n * which should be safe.\n */\n\n#ifdef RIGHT_SHIFT_IS_UNSIGNED\n#define ISHIFT_TEMPS\tint ishift_temp;\n#define IRIGHT_SHIFT(x,shft)  \\\n\t((ishift_temp = (x)) < 0 ? \\\n\t (ishift_temp >> (shft)) | ((~0) << (16-(shft))) : \\\n\t (ishift_temp >> (shft)))\n#else\n#define ISHIFT_TEMPS\n#define IRIGHT_SHIFT(x,shft)\t((x) >> (shft))\n#endif\n\n/* Forward declarations */\nMETHODDEF(boolean) encode_mcu_DC_first JPP((j_compress_ptr cinfo,\n\t\t\t\t\t    JBLOCKROW *MCU_data));\nMETHODDEF(boolean) encode_mcu_AC_first JPP((j_compress_ptr cinfo,\n\t\t\t\t\t    JBLOCKROW *MCU_data));\nMETHODDEF(boolean) encode_mcu_DC_refine JPP((j_compress_ptr cinfo,\n\t\t\t\t\t     JBLOCKROW *MCU_data));\nMETHODDEF(boolean) encode_mcu_AC_refine JPP((j_compress_ptr cinfo,\n\t\t\t\t\t     JBLOCKROW *MCU_data));\nMETHODDEF(void) finish_pass_phuff JPP((j_compress_ptr cinfo));\nMETHODDEF(void) finish_pass_gather_phuff JPP((j_compress_ptr cinfo));\n\n\n/*\n * Initialize for a Huffman-compressed scan using progressive JPEG.\n */\n\nMETHODDEF(void)\nstart_pass_phuff (j_compress_ptr cinfo, boolean gather_statistics)\n{  \n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  boolean is_DC_band;\n  int ci, tbl;\n  jpeg_component_info * compptr;\n\n  entropy->cinfo = cinfo;\n  entropy->gather_statistics = gather_statistics;\n\n  is_DC_band = (cinfo->Ss == 0);\n\n  /* We assume jcmaster.c already validated the scan parameters. */\n\n  /* Select execution routines */\n  if (cinfo->Ah == 0) {\n    if (is_DC_band)\n      entropy->pub.encode_mcu = encode_mcu_DC_first;\n    else\n      entropy->pub.encode_mcu = encode_mcu_AC_first;\n  } else {\n    if (is_DC_band)\n      entropy->pub.encode_mcu = encode_mcu_DC_refine;\n    else {\n      entropy->pub.encode_mcu = encode_mcu_AC_refine;\n      /* AC refinement needs a correction bit buffer */\n      if (entropy->bit_buffer == NULL)\n\tentropy->bit_buffer = (char *)\n\t  (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t      MAX_CORR_BITS * SIZEOF(char));\n    }\n  }\n  if (gather_statistics)\n    entropy->pub.finish_pass = finish_pass_gather_phuff;\n  else\n    entropy->pub.finish_pass = finish_pass_phuff;\n\n  /* Only DC coefficients may be interleaved, so cinfo->comps_in_scan = 1\n   * for AC coefficients.\n   */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    /* Initialize DC predictions to 0 */\n    entropy->last_dc_val[ci] = 0;\n    /* Get table index */\n    if (is_DC_band) {\n      if (cinfo->Ah != 0)\t/* DC refinement needs no table */\n\tcontinue;\n      tbl = compptr->dc_tbl_no;\n    } else {\n      entropy->ac_tbl_no = tbl = compptr->ac_tbl_no;\n    }\n    if (gather_statistics) {\n      /* Check for invalid table index */\n      /* (make_c_derived_tbl does this in the other path) */\n      if (tbl < 0 || tbl >= NUM_HUFF_TBLS)\n        ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tbl);\n      /* Allocate and zero the statistics tables */\n      /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */\n      if (entropy->count_ptrs[tbl] == NULL)\n\tentropy->count_ptrs[tbl] = (long *)\n\t  (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t      257 * SIZEOF(long));\n      MEMZERO(entropy->count_ptrs[tbl], 257 * SIZEOF(long));\n    } else {\n      /* Compute derived values for Huffman table */\n      /* We may do this more than once for a table, but it's not expensive */\n      jpeg_make_c_derived_tbl(cinfo, is_DC_band, tbl,\n\t\t\t      & entropy->derived_tbls[tbl]);\n    }\n  }\n\n  /* Initialize AC stuff */\n  entropy->EOBRUN = 0;\n  entropy->BE = 0;\n\n  /* Initialize bit buffer to empty */\n  entropy->put_buffer = 0;\n  entropy->put_bits = 0;\n\n  /* Initialize restart stuff */\n  entropy->restarts_to_go = cinfo->restart_interval;\n  entropy->next_restart_num = 0;\n}\n\n\n/* Outputting bytes to the file.\n * NB: these must be called only when actually outputting,\n * that is, entropy->gather_statistics == FALSE.\n */\n\n/* Emit a byte */\n#define emit_byte(entropy,val)  \\\n\t{ *(entropy)->next_output_byte++ = (JOCTET) (val);  \\\n\t  if (--(entropy)->free_in_buffer == 0)  \\\n\t    dump_buffer(entropy); }\n\n\nLOCAL(void)\ndump_buffer (phuff_entropy_ptr entropy)\n/* Empty the output buffer; we do not support suspension in this module. */\n{\n  struct jpeg_destination_mgr * dest = entropy->cinfo->dest;\n\n  if (! (*dest->empty_output_buffer) (entropy->cinfo))\n    ERREXIT(entropy->cinfo, JERR_CANT_SUSPEND);\n  /* After a successful buffer dump, must reset buffer pointers */\n  entropy->next_output_byte = dest->next_output_byte;\n  entropy->free_in_buffer = dest->free_in_buffer;\n}\n\n\n/* Outputting bits to the file */\n\n/* Only the right 24 bits of put_buffer are used; the valid bits are\n * left-justified in this part.  At most 16 bits can be passed to emit_bits\n * in one call, and we never retain more than 7 bits in put_buffer\n * between calls, so 24 bits are sufficient.\n */\n\nLOCAL(void)\nemit_bits (phuff_entropy_ptr entropy, unsigned int code, int size)\n/* Emit some bits, unless we are in gather mode */\n{\n  /* This routine is heavily used, so it's worth coding tightly. */\n  register INT32 put_buffer = (INT32) code;\n  register int put_bits = entropy->put_bits;\n\n  /* if size is 0, caller used an invalid Huffman table entry */\n  if (size == 0)\n    ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);\n\n  if (entropy->gather_statistics)\n    return;\t\t\t/* do nothing if we're only getting stats */\n\n  put_buffer &= (((INT32) 1)<<size) - 1; /* mask off any extra bits in code */\n  \n  put_bits += size;\t\t/* new number of bits in buffer */\n  \n  put_buffer <<= 24 - put_bits; /* align incoming bits */\n\n  put_buffer |= entropy->put_buffer; /* and merge with old buffer contents */\n\n  while (put_bits >= 8) {\n    int c = (int) ((put_buffer >> 16) & 0xFF);\n    \n    emit_byte(entropy, c);\n    if (c == 0xFF) {\t\t/* need to stuff a zero byte? */\n      emit_byte(entropy, 0);\n    }\n    put_buffer <<= 8;\n    put_bits -= 8;\n  }\n\n  entropy->put_buffer = put_buffer; /* update variables */\n  entropy->put_bits = put_bits;\n}\n\n\nLOCAL(void)\nflush_bits (phuff_entropy_ptr entropy)\n{\n  emit_bits(entropy, 0x7F, 7); /* fill any partial byte with ones */\n  entropy->put_buffer = 0;     /* and reset bit-buffer to empty */\n  entropy->put_bits = 0;\n}\n\n\n/*\n * Emit (or just count) a Huffman symbol.\n */\n\nLOCAL(void)\nemit_symbol (phuff_entropy_ptr entropy, int tbl_no, int symbol)\n{\n  if (entropy->gather_statistics)\n    entropy->count_ptrs[tbl_no][symbol]++;\n  else {\n    c_derived_tbl * tbl = entropy->derived_tbls[tbl_no];\n    emit_bits(entropy, tbl->ehufco[symbol], tbl->ehufsi[symbol]);\n  }\n}\n\n\n/*\n * Emit bits from a correction bit buffer.\n */\n\nLOCAL(void)\nemit_buffered_bits (phuff_entropy_ptr entropy, char * bufstart,\n\t\t    unsigned int nbits)\n{\n  if (entropy->gather_statistics)\n    return;\t\t\t/* no real work */\n\n  while (nbits > 0) {\n    emit_bits(entropy, (unsigned int) (*bufstart), 1);\n    bufstart++;\n    nbits--;\n  }\n}\n\n\n/*\n * Emit any pending EOBRUN symbol.\n */\n\nLOCAL(void)\nemit_eobrun (phuff_entropy_ptr entropy)\n{\n  register int temp, nbits;\n\n  if (entropy->EOBRUN > 0) {\t/* if there is any pending EOBRUN */\n    temp = entropy->EOBRUN;\n    nbits = 0;\n    while ((temp >>= 1))\n      nbits++;\n    /* safety check: shouldn't happen given limited correction-bit buffer */\n    if (nbits > 14)\n      ERREXIT(entropy->cinfo, JERR_HUFF_MISSING_CODE);\n\n    emit_symbol(entropy, entropy->ac_tbl_no, nbits << 4);\n    if (nbits)\n      emit_bits(entropy, entropy->EOBRUN, nbits);\n\n    entropy->EOBRUN = 0;\n\n    /* Emit any buffered correction bits */\n    emit_buffered_bits(entropy, entropy->bit_buffer, entropy->BE);\n    entropy->BE = 0;\n  }\n}\n\n\n/*\n * Emit a restart marker & resynchronize predictions.\n */\n\nLOCAL(void)\nemit_restart (phuff_entropy_ptr entropy, int restart_num)\n{\n  int ci;\n\n  emit_eobrun(entropy);\n\n  if (! entropy->gather_statistics) {\n    flush_bits(entropy);\n    emit_byte(entropy, 0xFF);\n    emit_byte(entropy, JPEG_RST0 + restart_num);\n  }\n\n  if (entropy->cinfo->Ss == 0) {\n    /* Re-initialize DC predictions to 0 */\n    for (ci = 0; ci < entropy->cinfo->comps_in_scan; ci++)\n      entropy->last_dc_val[ci] = 0;\n  } else {\n    /* Re-initialize all AC-related fields to 0 */\n    entropy->EOBRUN = 0;\n    entropy->BE = 0;\n  }\n}\n\n\n/*\n * MCU encoding for DC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\nencode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  register int temp, temp2;\n  register int nbits;\n  int blkn, ci;\n  int Al = cinfo->Al;\n  JBLOCKROW block;\n  jpeg_component_info * compptr;\n  ISHIFT_TEMPS\n\n  entropy->next_output_byte = cinfo->dest->next_output_byte;\n  entropy->free_in_buffer = cinfo->dest->free_in_buffer;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval)\n    if (entropy->restarts_to_go == 0)\n      emit_restart(entropy, entropy->next_restart_num);\n\n  /* Encode the MCU data blocks */\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    block = MCU_data[blkn];\n    ci = cinfo->MCU_membership[blkn];\n    compptr = cinfo->cur_comp_info[ci];\n\n    /* Compute the DC value after the required point transform by Al.\n     * This is simply an arithmetic right shift.\n     */\n    temp2 = IRIGHT_SHIFT((int) ((*block)[0]), Al);\n\n    /* DC differences are figured on the point-transformed values. */\n    temp = temp2 - entropy->last_dc_val[ci];\n    entropy->last_dc_val[ci] = temp2;\n\n    /* Encode the DC coefficient difference per section G.1.2.1 */\n    temp2 = temp;\n    if (temp < 0) {\n      temp = -temp;\t\t/* temp is abs value of input */\n      /* For a negative input, want temp2 = bitwise complement of abs(input) */\n      /* This code assumes we are on a two's complement machine */\n      temp2--;\n    }\n    \n    /* Find the number of bits needed for the magnitude of the coefficient */\n    nbits = 0;\n    while (temp) {\n      nbits++;\n      temp >>= 1;\n    }\n    /* Check for out-of-range coefficient values.\n     * Since we're encoding a difference, the range limit is twice as much.\n     */\n    if (nbits > MAX_COEF_BITS+1)\n      ERREXIT(cinfo, JERR_BAD_DCT_COEF);\n    \n    /* Count/emit the Huffman-coded symbol for the number of bits */\n    emit_symbol(entropy, compptr->dc_tbl_no, nbits);\n    \n    /* Emit that number of bits of the value, if positive, */\n    /* or the complement of its magnitude, if negative. */\n    if (nbits)\t\t\t/* emit_bits rejects calls with size 0 */\n      emit_bits(entropy, (unsigned int) temp2, nbits);\n  }\n\n  cinfo->dest->next_output_byte = entropy->next_output_byte;\n  cinfo->dest->free_in_buffer = entropy->free_in_buffer;\n\n  /* Update restart-interval state too */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU encoding for AC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\nencode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  register int temp, temp2;\n  register int nbits;\n  register int r, k;\n  int Se = cinfo->Se;\n  int Al = cinfo->Al;\n  JBLOCKROW block;\n\n  entropy->next_output_byte = cinfo->dest->next_output_byte;\n  entropy->free_in_buffer = cinfo->dest->free_in_buffer;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval)\n    if (entropy->restarts_to_go == 0)\n      emit_restart(entropy, entropy->next_restart_num);\n\n  /* Encode the MCU data block */\n  block = MCU_data[0];\n\n  /* Encode the AC coefficients per section G.1.2.2, fig. G.3 */\n  \n  r = 0;\t\t\t/* r = run length of zeros */\n   \n  for (k = cinfo->Ss; k <= Se; k++) {\n    if ((temp = (*block)[jpeg_natural_order[k]]) == 0) {\n      r++;\n      continue;\n    }\n    /* We must apply the point transform by Al.  For AC coefficients this\n     * is an integer division with rounding towards 0.  To do this portably\n     * in C, we shift after obtaining the absolute value; so the code is\n     * interwoven with finding the abs value (temp) and output bits (temp2).\n     */\n    if (temp < 0) {\n      temp = -temp;\t\t/* temp is abs value of input */\n      temp >>= Al;\t\t/* apply the point transform */\n      /* For a negative coef, want temp2 = bitwise complement of abs(coef) */\n      temp2 = ~temp;\n    } else {\n      temp >>= Al;\t\t/* apply the point transform */\n      temp2 = temp;\n    }\n    /* Watch out for case that nonzero coef is zero after point transform */\n    if (temp == 0) {\n      r++;\n      continue;\n    }\n\n    /* Emit any pending EOBRUN */\n    if (entropy->EOBRUN > 0)\n      emit_eobrun(entropy);\n    /* if run length > 15, must emit special run-length-16 codes (0xF0) */\n    while (r > 15) {\n      emit_symbol(entropy, entropy->ac_tbl_no, 0xF0);\n      r -= 16;\n    }\n\n    /* Find the number of bits needed for the magnitude of the coefficient */\n    nbits = 1;\t\t\t/* there must be at least one 1 bit */\n    while ((temp >>= 1))\n      nbits++;\n    /* Check for out-of-range coefficient values */\n    if (nbits > MAX_COEF_BITS)\n      ERREXIT(cinfo, JERR_BAD_DCT_COEF);\n\n    /* Count/emit Huffman symbol for run length / number of bits */\n    emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + nbits);\n\n    /* Emit that number of bits of the value, if positive, */\n    /* or the complement of its magnitude, if negative. */\n    emit_bits(entropy, (unsigned int) temp2, nbits);\n\n    r = 0;\t\t\t/* reset zero run length */\n  }\n\n  if (r > 0) {\t\t\t/* If there are trailing zeroes, */\n    entropy->EOBRUN++;\t\t/* count an EOB */\n    if (entropy->EOBRUN == 0x7FFF)\n      emit_eobrun(entropy);\t/* force it out to avoid overflow */\n  }\n\n  cinfo->dest->next_output_byte = entropy->next_output_byte;\n  cinfo->dest->free_in_buffer = entropy->free_in_buffer;\n\n  /* Update restart-interval state too */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU encoding for DC successive approximation refinement scan.\n * Note: we assume such scans can be multi-component, although the spec\n * is not very clear on the point.\n */\n\nMETHODDEF(boolean)\nencode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  register int temp;\n  int blkn;\n  int Al = cinfo->Al;\n  JBLOCKROW block;\n\n  entropy->next_output_byte = cinfo->dest->next_output_byte;\n  entropy->free_in_buffer = cinfo->dest->free_in_buffer;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval)\n    if (entropy->restarts_to_go == 0)\n      emit_restart(entropy, entropy->next_restart_num);\n\n  /* Encode the MCU data blocks */\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    block = MCU_data[blkn];\n\n    /* We simply emit the Al'th bit of the DC coefficient value. */\n    temp = (*block)[0];\n    emit_bits(entropy, (unsigned int) (temp >> Al), 1);\n  }\n\n  cinfo->dest->next_output_byte = entropy->next_output_byte;\n  cinfo->dest->free_in_buffer = entropy->free_in_buffer;\n\n  /* Update restart-interval state too */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU encoding for AC successive approximation refinement scan.\n */\n\nMETHODDEF(boolean)\nencode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  register int temp;\n  register int r, k;\n  int EOB;\n  char *BR_buffer;\n  unsigned int BR;\n  int Se = cinfo->Se;\n  int Al = cinfo->Al;\n  JBLOCKROW block;\n  int absvalues[DCTSIZE2];\n\n  entropy->next_output_byte = cinfo->dest->next_output_byte;\n  entropy->free_in_buffer = cinfo->dest->free_in_buffer;\n\n  /* Emit restart marker if needed */\n  if (cinfo->restart_interval)\n    if (entropy->restarts_to_go == 0)\n      emit_restart(entropy, entropy->next_restart_num);\n\n  /* Encode the MCU data block */\n  block = MCU_data[0];\n\n  /* It is convenient to make a pre-pass to determine the transformed\n   * coefficients' absolute values and the EOB position.\n   */\n  EOB = 0;\n  for (k = cinfo->Ss; k <= Se; k++) {\n    temp = (*block)[jpeg_natural_order[k]];\n    /* We must apply the point transform by Al.  For AC coefficients this\n     * is an integer division with rounding towards 0.  To do this portably\n     * in C, we shift after obtaining the absolute value.\n     */\n    if (temp < 0)\n      temp = -temp;\t\t/* temp is abs value of input */\n    temp >>= Al;\t\t/* apply the point transform */\n    absvalues[k] = temp;\t/* save abs value for main pass */\n    if (temp == 1)\n      EOB = k;\t\t\t/* EOB = index of last newly-nonzero coef */\n  }\n\n  /* Encode the AC coefficients per section G.1.2.3, fig. G.7 */\n  \n  r = 0;\t\t\t/* r = run length of zeros */\n  BR = 0;\t\t\t/* BR = count of buffered bits added now */\n  BR_buffer = entropy->bit_buffer + entropy->BE; /* Append bits to buffer */\n\n  for (k = cinfo->Ss; k <= Se; k++) {\n    if ((temp = absvalues[k]) == 0) {\n      r++;\n      continue;\n    }\n\n    /* Emit any required ZRLs, but not if they can be folded into EOB */\n    while (r > 15 && k <= EOB) {\n      /* emit any pending EOBRUN and the BE correction bits */\n      emit_eobrun(entropy);\n      /* Emit ZRL */\n      emit_symbol(entropy, entropy->ac_tbl_no, 0xF0);\n      r -= 16;\n      /* Emit buffered correction bits that must be associated with ZRL */\n      emit_buffered_bits(entropy, BR_buffer, BR);\n      BR_buffer = entropy->bit_buffer; /* BE bits are gone now */\n      BR = 0;\n    }\n\n    /* If the coef was previously nonzero, it only needs a correction bit.\n     * NOTE: a straight translation of the spec's figure G.7 would suggest\n     * that we also need to test r > 15.  But if r > 15, we can only get here\n     * if k > EOB, which implies that this coefficient is not 1.\n     */\n    if (temp > 1) {\n      /* The correction bit is the next bit of the absolute value. */\n      BR_buffer[BR++] = (char) (temp & 1);\n      continue;\n    }\n\n    /* Emit any pending EOBRUN and the BE correction bits */\n    emit_eobrun(entropy);\n\n    /* Count/emit Huffman symbol for run length / number of bits */\n    emit_symbol(entropy, entropy->ac_tbl_no, (r << 4) + 1);\n\n    /* Emit output bit for newly-nonzero coef */\n    temp = ((*block)[jpeg_natural_order[k]] < 0) ? 0 : 1;\n    emit_bits(entropy, (unsigned int) temp, 1);\n\n    /* Emit buffered correction bits that must be associated with this code */\n    emit_buffered_bits(entropy, BR_buffer, BR);\n    BR_buffer = entropy->bit_buffer; /* BE bits are gone now */\n    BR = 0;\n    r = 0;\t\t\t/* reset zero run length */\n  }\n\n  if (r > 0 || BR > 0) {\t/* If there are trailing zeroes, */\n    entropy->EOBRUN++;\t\t/* count an EOB */\n    entropy->BE += BR;\t\t/* concat my correction bits to older ones */\n    /* We force out the EOB if we risk either:\n     * 1. overflow of the EOB counter;\n     * 2. overflow of the correction bit buffer during the next MCU.\n     */\n    if (entropy->EOBRUN == 0x7FFF || entropy->BE > (MAX_CORR_BITS-DCTSIZE2+1))\n      emit_eobrun(entropy);\n  }\n\n  cinfo->dest->next_output_byte = entropy->next_output_byte;\n  cinfo->dest->free_in_buffer = entropy->free_in_buffer;\n\n  /* Update restart-interval state too */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0) {\n      entropy->restarts_to_go = cinfo->restart_interval;\n      entropy->next_restart_num++;\n      entropy->next_restart_num &= 7;\n    }\n    entropy->restarts_to_go--;\n  }\n\n  return TRUE;\n}\n\n\n/*\n * Finish up at the end of a Huffman-compressed progressive scan.\n */\n\nMETHODDEF(void)\nfinish_pass_phuff (j_compress_ptr cinfo)\n{   \n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n\n  entropy->next_output_byte = cinfo->dest->next_output_byte;\n  entropy->free_in_buffer = cinfo->dest->free_in_buffer;\n\n  /* Flush out any buffered data */\n  emit_eobrun(entropy);\n  flush_bits(entropy);\n\n  cinfo->dest->next_output_byte = entropy->next_output_byte;\n  cinfo->dest->free_in_buffer = entropy->free_in_buffer;\n}\n\n\n/*\n * Finish up a statistics-gathering pass and create the new Huffman tables.\n */\n\nMETHODDEF(void)\nfinish_pass_gather_phuff (j_compress_ptr cinfo)\n{\n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  boolean is_DC_band;\n  int ci, tbl;\n  jpeg_component_info * compptr;\n  JHUFF_TBL **htblptr;\n  boolean did[NUM_HUFF_TBLS];\n\n  /* Flush out buffered data (all we care about is counting the EOB symbol) */\n  emit_eobrun(entropy);\n\n  is_DC_band = (cinfo->Ss == 0);\n\n  /* It's important not to apply jpeg_gen_optimal_table more than once\n   * per table, because it clobbers the input frequency counts!\n   */\n  MEMZERO(did, SIZEOF(did));\n\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    if (is_DC_band) {\n      if (cinfo->Ah != 0)\t/* DC refinement needs no table */\n\tcontinue;\n      tbl = compptr->dc_tbl_no;\n    } else {\n      tbl = compptr->ac_tbl_no;\n    }\n    if (! did[tbl]) {\n      if (is_DC_band)\n        htblptr = & cinfo->dc_huff_tbl_ptrs[tbl];\n      else\n        htblptr = & cinfo->ac_huff_tbl_ptrs[tbl];\n      if (*htblptr == NULL)\n        *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);\n      jpeg_gen_optimal_table(cinfo, *htblptr, entropy->count_ptrs[tbl]);\n      did[tbl] = TRUE;\n    }\n  }\n}\n\n\n/*\n * Module initialization routine for progressive Huffman entropy encoding.\n */\n\nGLOBAL(void)\njinit_phuff_encoder (j_compress_ptr cinfo)\n{\n  phuff_entropy_ptr entropy;\n  int i;\n\n  entropy = (phuff_entropy_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(phuff_entropy_encoder));\n  cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;\n  entropy->pub.start_pass = start_pass_phuff;\n\n  /* Mark tables unallocated */\n  for (i = 0; i < NUM_HUFF_TBLS; i++) {\n    entropy->derived_tbls[i] = NULL;\n    entropy->count_ptrs[i] = NULL;\n  }\n  entropy->bit_buffer = NULL;\t/* needed only in AC refinement scan */\n}\n\n#endif /* C_PROGRESSIVE_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/jcprepct.c",
    "content": "/*\n * jcprepct.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains the compression preprocessing controller.\n * This controller manages the color conversion, downsampling,\n * and edge expansion steps.\n *\n * Most of the complexity here is associated with buffering input rows\n * as required by the downsampler.  See the comments at the head of\n * jcsample.c for the downsampler's needs.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* At present, jcsample.c can request context rows only for smoothing.\n * In the future, we might also need context rows for CCIR601 sampling\n * or other more-complex downsampling procedures.  The code to support\n * context rows should be compiled only if needed.\n */\n#ifdef INPUT_SMOOTHING_SUPPORTED\n#define CONTEXT_ROWS_SUPPORTED\n#endif\n\n\n/*\n * For the simple (no-context-row) case, we just need to buffer one\n * row group's worth of pixels for the downsampling step.  At the bottom of\n * the image, we pad to a full row group by replicating the last pixel row.\n * The downsampler's last output row is then replicated if needed to pad\n * out to a full iMCU row.\n *\n * When providing context rows, we must buffer three row groups' worth of\n * pixels.  Three row groups are physically allocated, but the row pointer\n * arrays are made five row groups high, with the extra pointers above and\n * below \"wrapping around\" to point to the last and first real row groups.\n * This allows the downsampler to access the proper context rows.\n * At the top and bottom of the image, we create dummy context rows by\n * copying the first or last real pixel row.  This copying could be avoided\n * by pointer hacking as is done in jdmainct.c, but it doesn't seem worth the\n * trouble on the compression side.\n */\n\n\n/* Private buffer controller object */\n\ntypedef struct {\n  struct jpeg_c_prep_controller pub; /* public fields */\n\n  /* Downsampling input buffer.  This buffer holds color-converted data\n   * until we have enough to do a downsample step.\n   */\n  JSAMPARRAY color_buf[MAX_COMPONENTS];\n\n  JDIMENSION rows_to_go;\t/* counts rows remaining in source image */\n  int next_buf_row;\t\t/* index of next row to store in color_buf */\n\n#ifdef CONTEXT_ROWS_SUPPORTED\t/* only needed for context case */\n  int this_row_group;\t\t/* starting row index of group to process */\n  int next_buf_stop;\t\t/* downsample when we reach this index */\n#endif\n} my_prep_controller;\n\ntypedef my_prep_controller * my_prep_ptr;\n\n\n/*\n * Initialize for a processing pass.\n */\n\nMETHODDEF(void)\nstart_pass_prep (j_compress_ptr cinfo, J_BUF_MODE pass_mode)\n{\n  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;\n\n  if (pass_mode != JBUF_PASS_THRU)\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n\n  /* Initialize total-height counter for detecting bottom of image */\n  prep->rows_to_go = cinfo->image_height;\n  /* Mark the conversion buffer empty */\n  prep->next_buf_row = 0;\n#ifdef CONTEXT_ROWS_SUPPORTED\n  /* Preset additional state variables for context mode.\n   * These aren't used in non-context mode, so we needn't test which mode.\n   */\n  prep->this_row_group = 0;\n  /* Set next_buf_stop to stop after two row groups have been read in. */\n  prep->next_buf_stop = 2 * cinfo->max_v_samp_factor;\n#endif\n}\n\n\n/*\n * Expand an image vertically from height input_rows to height output_rows,\n * by duplicating the bottom row.\n */\n\nLOCAL(void)\nexpand_bottom_edge (JSAMPARRAY image_data, JDIMENSION num_cols,\n\t\t    int input_rows, int output_rows)\n{\n  register int row;\n\n  for (row = input_rows; row < output_rows; row++) {\n    jcopy_sample_rows(image_data, input_rows-1, image_data, row,\n\t\t      1, num_cols);\n  }\n}\n\n\n/*\n * Process some data in the simple no-context case.\n *\n * Preprocessor output data is counted in \"row groups\".  A row group\n * is defined to be v_samp_factor sample rows of each component.\n * Downsampling will produce this much data from each max_v_samp_factor\n * input rows.\n */\n\nMETHODDEF(void)\npre_process_data (j_compress_ptr cinfo,\n\t\t  JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,\n\t\t  JDIMENSION in_rows_avail,\n\t\t  JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,\n\t\t  JDIMENSION out_row_groups_avail)\n{\n  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;\n  int numrows, ci;\n  JDIMENSION inrows;\n  jpeg_component_info * compptr;\n\n  while (*in_row_ctr < in_rows_avail &&\n\t *out_row_group_ctr < out_row_groups_avail) {\n    /* Do color conversion to fill the conversion buffer. */\n    inrows = in_rows_avail - *in_row_ctr;\n    numrows = cinfo->max_v_samp_factor - prep->next_buf_row;\n    numrows = (int) MIN((JDIMENSION) numrows, inrows);\n    (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,\n\t\t\t\t       prep->color_buf,\n\t\t\t\t       (JDIMENSION) prep->next_buf_row,\n\t\t\t\t       numrows);\n    *in_row_ctr += numrows;\n    prep->next_buf_row += numrows;\n    prep->rows_to_go -= numrows;\n    /* If at bottom of image, pad to fill the conversion buffer. */\n    if (prep->rows_to_go == 0 &&\n\tprep->next_buf_row < cinfo->max_v_samp_factor) {\n      for (ci = 0; ci < cinfo->num_components; ci++) {\n\texpand_bottom_edge(prep->color_buf[ci], cinfo->image_width,\n\t\t\t   prep->next_buf_row, cinfo->max_v_samp_factor);\n      }\n      prep->next_buf_row = cinfo->max_v_samp_factor;\n    }\n    /* If we've filled the conversion buffer, empty it. */\n    if (prep->next_buf_row == cinfo->max_v_samp_factor) {\n      (*cinfo->downsample->downsample) (cinfo,\n\t\t\t\t\tprep->color_buf, (JDIMENSION) 0,\n\t\t\t\t\toutput_buf, *out_row_group_ctr);\n      prep->next_buf_row = 0;\n      (*out_row_group_ctr)++;\n    }\n    /* If at bottom of image, pad the output to a full iMCU height.\n     * Note we assume the caller is providing a one-iMCU-height output buffer!\n     */\n    if (prep->rows_to_go == 0 &&\n\t*out_row_group_ctr < out_row_groups_avail) {\n      for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n\t   ci++, compptr++) {\n\texpand_bottom_edge(output_buf[ci],\n\t\t\t   compptr->width_in_blocks * DCTSIZE,\n\t\t\t   (int) (*out_row_group_ctr * compptr->v_samp_factor),\n\t\t\t   (int) (out_row_groups_avail * compptr->v_samp_factor));\n      }\n      *out_row_group_ctr = out_row_groups_avail;\n      break;\t\t\t/* can exit outer loop without test */\n    }\n  }\n}\n\n\n#ifdef CONTEXT_ROWS_SUPPORTED\n\n/*\n * Process some data in the context case.\n */\n\nMETHODDEF(void)\npre_process_context (j_compress_ptr cinfo,\n\t\t     JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,\n\t\t     JDIMENSION in_rows_avail,\n\t\t     JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,\n\t\t     JDIMENSION out_row_groups_avail)\n{\n  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;\n  int numrows, ci;\n  int buf_height = cinfo->max_v_samp_factor * 3;\n  JDIMENSION inrows;\n\n  while (*out_row_group_ctr < out_row_groups_avail) {\n    if (*in_row_ctr < in_rows_avail) {\n      /* Do color conversion to fill the conversion buffer. */\n      inrows = in_rows_avail - *in_row_ctr;\n      numrows = prep->next_buf_stop - prep->next_buf_row;\n      numrows = (int) MIN((JDIMENSION) numrows, inrows);\n      (*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,\n\t\t\t\t\t prep->color_buf,\n\t\t\t\t\t (JDIMENSION) prep->next_buf_row,\n\t\t\t\t\t numrows);\n      /* Pad at top of image, if first time through */\n      if (prep->rows_to_go == cinfo->image_height) {\n\tfor (ci = 0; ci < cinfo->num_components; ci++) {\n\t  int row;\n\t  for (row = 1; row <= cinfo->max_v_samp_factor; row++) {\n\t    jcopy_sample_rows(prep->color_buf[ci], 0,\n\t\t\t      prep->color_buf[ci], -row,\n\t\t\t      1, cinfo->image_width);\n\t  }\n\t}\n      }\n      *in_row_ctr += numrows;\n      prep->next_buf_row += numrows;\n      prep->rows_to_go -= numrows;\n    } else {\n      /* Return for more data, unless we are at the bottom of the image. */\n      if (prep->rows_to_go != 0)\n\tbreak;\n      /* When at bottom of image, pad to fill the conversion buffer. */\n      if (prep->next_buf_row < prep->next_buf_stop) {\n\tfor (ci = 0; ci < cinfo->num_components; ci++) {\n\t  expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,\n\t\t\t     prep->next_buf_row, prep->next_buf_stop);\n\t}\n\tprep->next_buf_row = prep->next_buf_stop;\n      }\n    }\n    /* If we've gotten enough data, downsample a row group. */\n    if (prep->next_buf_row == prep->next_buf_stop) {\n      (*cinfo->downsample->downsample) (cinfo,\n\t\t\t\t\tprep->color_buf,\n\t\t\t\t\t(JDIMENSION) prep->this_row_group,\n\t\t\t\t\toutput_buf, *out_row_group_ctr);\n      (*out_row_group_ctr)++;\n      /* Advance pointers with wraparound as necessary. */\n      prep->this_row_group += cinfo->max_v_samp_factor;\n      if (prep->this_row_group >= buf_height)\n\tprep->this_row_group = 0;\n      if (prep->next_buf_row >= buf_height)\n\tprep->next_buf_row = 0;\n      prep->next_buf_stop = prep->next_buf_row + cinfo->max_v_samp_factor;\n    }\n  }\n}\n\n\n/*\n * Create the wrapped-around downsampling input buffer needed for context mode.\n */\n\nLOCAL(void)\ncreate_context_buffer (j_compress_ptr cinfo)\n{\n  my_prep_ptr prep = (my_prep_ptr) cinfo->prep;\n  int rgroup_height = cinfo->max_v_samp_factor;\n  int ci, i;\n  jpeg_component_info * compptr;\n  JSAMPARRAY true_buffer, fake_buffer;\n\n  /* Grab enough space for fake row pointers for all the components;\n   * we need five row groups' worth of pointers for each component.\n   */\n  fake_buffer = (JSAMPARRAY)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(cinfo->num_components * 5 * rgroup_height) *\n\t\t\t\tSIZEOF(JSAMPROW));\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Allocate the actual buffer space (3 row groups) for this component.\n     * We make the buffer wide enough to allow the downsampler to edge-expand\n     * horizontally within the buffer, if it so chooses.\n     */\n    true_buffer = (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       (JDIMENSION) (((long) compptr->width_in_blocks * DCTSIZE *\n\t\t      cinfo->max_h_samp_factor) / compptr->h_samp_factor),\n       (JDIMENSION) (3 * rgroup_height));\n    /* Copy true buffer row pointers into the middle of the fake row array */\n    MEMCOPY(fake_buffer + rgroup_height, true_buffer,\n\t    3 * rgroup_height * SIZEOF(JSAMPROW));\n    /* Fill in the above and below wraparound pointers */\n    for (i = 0; i < rgroup_height; i++) {\n      fake_buffer[i] = true_buffer[2 * rgroup_height + i];\n      fake_buffer[4 * rgroup_height + i] = true_buffer[i];\n    }\n    prep->color_buf[ci] = fake_buffer + rgroup_height;\n    fake_buffer += 5 * rgroup_height; /* point to space for next component */\n  }\n}\n\n#endif /* CONTEXT_ROWS_SUPPORTED */\n\n\n/*\n * Initialize preprocessing controller.\n */\n\nGLOBAL(void)\njinit_c_prep_controller (j_compress_ptr cinfo, boolean need_full_buffer)\n{\n  my_prep_ptr prep;\n  int ci;\n  jpeg_component_info * compptr;\n\n  if (need_full_buffer)\t\t/* safety check */\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n\n  prep = (my_prep_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_prep_controller));\n  cinfo->prep = (struct jpeg_c_prep_controller *) prep;\n  prep->pub.start_pass = start_pass_prep;\n\n  /* Allocate the color conversion buffer.\n   * We make the buffer wide enough to allow the downsampler to edge-expand\n   * horizontally within the buffer, if it so chooses.\n   */\n  if (cinfo->downsample->need_context_rows) {\n    /* Set up to provide context rows */\n#ifdef CONTEXT_ROWS_SUPPORTED\n    prep->pub.pre_process_data = pre_process_context;\n    create_context_buffer(cinfo);\n#else\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n  } else {\n    /* No context, just make it tall enough for one row group */\n    prep->pub.pre_process_data = pre_process_data;\n    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n\t ci++, compptr++) {\n      prep->color_buf[ci] = (*cinfo->mem->alloc_sarray)\n\t((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t (JDIMENSION) (((long) compptr->width_in_blocks * DCTSIZE *\n\t\t\tcinfo->max_h_samp_factor) / compptr->h_samp_factor),\n\t (JDIMENSION) cinfo->max_v_samp_factor);\n    }\n  }\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jcsample.c",
    "content": "/*\n * jcsample.c\n *\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains downsampling routines.\n *\n * Downsampling input data is counted in \"row groups\".  A row group\n * is defined to be max_v_samp_factor pixel rows of each component,\n * from which the downsampler produces v_samp_factor sample rows.\n * A single row group is processed in each call to the downsampler module.\n *\n * The downsampler is responsible for edge-expansion of its output data\n * to fill an integral number of DCT blocks horizontally.  The source buffer\n * may be modified if it is helpful for this purpose (the source buffer is\n * allocated wide enough to correspond to the desired output width).\n * The caller (the prep controller) is responsible for vertical padding.\n *\n * The downsampler may request \"context rows\" by setting need_context_rows\n * during startup.  In this case, the input arrays will contain at least\n * one row group's worth of pixels above and below the passed-in data;\n * the caller will create dummy rows at image top and bottom by replicating\n * the first or last real pixel row.\n *\n * An excellent reference for image resampling is\n *   Digital Image Warping, George Wolberg, 1990.\n *   Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7.\n *\n * The downsampling algorithm used here is a simple average of the source\n * pixels covered by the output pixel.  The hi-falutin sampling literature\n * refers to this as a \"box filter\".  In general the characteristics of a box\n * filter are not very good, but for the specific cases we normally use (1:1\n * and 2:1 ratios) the box is equivalent to a \"triangle filter\" which is not\n * nearly so bad.  If you intend to use other sampling ratios, you'd be well\n * advised to improve this code.\n *\n * A simple input-smoothing capability is provided.  This is mainly intended\n * for cleaning up color-dithered GIF input files (if you find it inadequate,\n * we suggest using an external filtering program such as pnmconvol).  When\n * enabled, each input pixel P is replaced by a weighted sum of itself and its\n * eight neighbors.  P's weight is 1-8*SF and each neighbor's weight is SF,\n * where SF = (smoothing_factor / 1024).\n * Currently, smoothing is only supported for 2h2v sampling factors.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jsimd.h\"\n\n\n/* Pointer to routine to downsample a single component */\ntypedef JMETHOD(void, downsample1_ptr,\n\t\t(j_compress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JSAMPARRAY input_data, JSAMPARRAY output_data));\n\n/* Private subobject */\n\ntypedef struct {\n  struct jpeg_downsampler pub;\t/* public fields */\n\n  /* Downsampling method pointers, one per component */\n  downsample1_ptr methods[MAX_COMPONENTS];\n} my_downsampler;\n\ntypedef my_downsampler * my_downsample_ptr;\n\n\n/*\n * Initialize for a downsampling pass.\n */\n\nMETHODDEF(void)\nstart_pass_downsample (j_compress_ptr cinfo)\n{\n  /* no work for now */\n}\n\n\n/*\n * Expand a component horizontally from width input_cols to width output_cols,\n * by duplicating the rightmost samples.\n */\n\nLOCAL(void)\nexpand_right_edge (JSAMPARRAY image_data, int num_rows,\n\t\t   JDIMENSION input_cols, JDIMENSION output_cols)\n{\n  register JSAMPROW ptr;\n  register JSAMPLE pixval;\n  register int count;\n  int row;\n  int numcols = (int) (output_cols - input_cols);\n\n  if (numcols > 0) {\n    for (row = 0; row < num_rows; row++) {\n      ptr = image_data[row] + input_cols;\n      pixval = ptr[-1];\t\t/* don't need GETJSAMPLE() here */\n      for (count = numcols; count > 0; count--)\n\t*ptr++ = pixval;\n    }\n  }\n}\n\n\n/*\n * Do downsampling for a whole row group (all components).\n *\n * In this version we simply downsample each component independently.\n */\n\nMETHODDEF(void)\nsep_downsample (j_compress_ptr cinfo,\n\t\tJSAMPIMAGE input_buf, JDIMENSION in_row_index,\n\t\tJSAMPIMAGE output_buf, JDIMENSION out_row_group_index)\n{\n  my_downsample_ptr downsample = (my_downsample_ptr) cinfo->downsample;\n  int ci;\n  jpeg_component_info * compptr;\n  JSAMPARRAY in_ptr, out_ptr;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    in_ptr = input_buf[ci] + in_row_index;\n    out_ptr = output_buf[ci] + (out_row_group_index * compptr->v_samp_factor);\n    (*downsample->methods[ci]) (cinfo, compptr, in_ptr, out_ptr);\n  }\n}\n\n\n/*\n * Downsample pixel values of a single component.\n * One row group is processed per call.\n * This version handles arbitrary integral sampling ratios, without smoothing.\n * Note that this version is not actually used for customary sampling ratios.\n */\n\nMETHODDEF(void)\nint_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,\n\t\tJSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  int inrow, outrow, h_expand, v_expand, numpix, numpix2, h, v;\n  JDIMENSION outcol, outcol_h;\t/* outcol_h == outcol*h_expand */\n  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;\n  JSAMPROW inptr, outptr;\n  INT32 outvalue;\n\n  h_expand = cinfo->max_h_samp_factor / compptr->h_samp_factor;\n  v_expand = cinfo->max_v_samp_factor / compptr->v_samp_factor;\n  numpix = h_expand * v_expand;\n  numpix2 = numpix/2;\n\n  /* Expand input data enough to let all the output samples be generated\n   * by the standard loop.  Special-casing padded output would be more\n   * efficient.\n   */\n  expand_right_edge(input_data, cinfo->max_v_samp_factor,\n\t\t    cinfo->image_width, output_cols * h_expand);\n\n  inrow = 0;\n  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {\n    outptr = output_data[outrow];\n    for (outcol = 0, outcol_h = 0; outcol < output_cols;\n\t outcol++, outcol_h += h_expand) {\n      outvalue = 0;\n      for (v = 0; v < v_expand; v++) {\n\tinptr = input_data[inrow+v] + outcol_h;\n\tfor (h = 0; h < h_expand; h++) {\n\t  outvalue += (INT32) GETJSAMPLE(*inptr++);\n\t}\n      }\n      *outptr++ = (JSAMPLE) ((outvalue + numpix2) / numpix);\n    }\n    inrow += v_expand;\n  }\n}\n\n\n/*\n * Downsample pixel values of a single component.\n * This version handles the special case of a full-size component,\n * without smoothing.\n */\n\nMETHODDEF(void)\nfullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,\n\t\t     JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  /* Copy the data */\n  jcopy_sample_rows(input_data, 0, output_data, 0,\n\t\t    cinfo->max_v_samp_factor, cinfo->image_width);\n  /* Edge-expand */\n  expand_right_edge(output_data, cinfo->max_v_samp_factor,\n\t\t    cinfo->image_width, compptr->width_in_blocks * DCTSIZE);\n}\n\n\n/*\n * Downsample pixel values of a single component.\n * This version handles the common case of 2:1 horizontal and 1:1 vertical,\n * without smoothing.\n *\n * A note about the \"bias\" calculations: when rounding fractional values to\n * integer, we do not want to always round 0.5 up to the next integer.\n * If we did that, we'd introduce a noticeable bias towards larger values.\n * Instead, this code is arranged so that 0.5 will be rounded up or down at\n * alternate pixel locations (a simple ordered dither pattern).\n */\n\nMETHODDEF(void)\nh2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  int outrow;\n  JDIMENSION outcol;\n  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;\n  register JSAMPROW inptr, outptr;\n  register int bias;\n\n  /* Expand input data enough to let all the output samples be generated\n   * by the standard loop.  Special-casing padded output would be more\n   * efficient.\n   */\n  expand_right_edge(input_data, cinfo->max_v_samp_factor,\n\t\t    cinfo->image_width, output_cols * 2);\n\n  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {\n    outptr = output_data[outrow];\n    inptr = input_data[outrow];\n    bias = 0;\t\t\t/* bias = 0,1,0,1,... for successive samples */\n    for (outcol = 0; outcol < output_cols; outcol++) {\n      *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr) + GETJSAMPLE(inptr[1])\n\t\t\t      + bias) >> 1);\n      bias ^= 1;\t\t/* 0=>1, 1=>0 */\n      inptr += 2;\n    }\n  }\n}\n\n\n/*\n * Downsample pixel values of a single component.\n * This version handles the standard case of 2:1 horizontal and 2:1 vertical,\n * without smoothing.\n */\n\nMETHODDEF(void)\nh2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  int inrow, outrow;\n  JDIMENSION outcol;\n  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;\n  register JSAMPROW inptr0, inptr1, outptr;\n  register int bias;\n\n  /* Expand input data enough to let all the output samples be generated\n   * by the standard loop.  Special-casing padded output would be more\n   * efficient.\n   */\n  expand_right_edge(input_data, cinfo->max_v_samp_factor,\n\t\t    cinfo->image_width, output_cols * 2);\n\n  inrow = 0;\n  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {\n    outptr = output_data[outrow];\n    inptr0 = input_data[inrow];\n    inptr1 = input_data[inrow+1];\n    bias = 1;\t\t\t/* bias = 1,2,1,2,... for successive samples */\n    for (outcol = 0; outcol < output_cols; outcol++) {\n      *outptr++ = (JSAMPLE) ((GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +\n\t\t\t      GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1])\n\t\t\t      + bias) >> 2);\n      bias ^= 3;\t\t/* 1=>2, 2=>1 */\n      inptr0 += 2; inptr1 += 2;\n    }\n    inrow += 2;\n  }\n}\n\n\n#ifdef INPUT_SMOOTHING_SUPPORTED\n\n/*\n * Downsample pixel values of a single component.\n * This version handles the standard case of 2:1 horizontal and 2:1 vertical,\n * with smoothing.  One row of context is required.\n */\n\nMETHODDEF(void)\nh2v2_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,\n\t\t\tJSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  int inrow, outrow;\n  JDIMENSION colctr;\n  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;\n  register JSAMPROW inptr0, inptr1, above_ptr, below_ptr, outptr;\n  INT32 membersum, neighsum, memberscale, neighscale;\n\n  /* Expand input data enough to let all the output samples be generated\n   * by the standard loop.  Special-casing padded output would be more\n   * efficient.\n   */\n  expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2,\n\t\t    cinfo->image_width, output_cols * 2);\n\n  /* We don't bother to form the individual \"smoothed\" input pixel values;\n   * we can directly compute the output which is the average of the four\n   * smoothed values.  Each of the four member pixels contributes a fraction\n   * (1-8*SF) to its own smoothed image and a fraction SF to each of the three\n   * other smoothed pixels, therefore a total fraction (1-5*SF)/4 to the final\n   * output.  The four corner-adjacent neighbor pixels contribute a fraction\n   * SF to just one smoothed pixel, or SF/4 to the final output; while the\n   * eight edge-adjacent neighbors contribute SF to each of two smoothed\n   * pixels, or SF/2 overall.  In order to use integer arithmetic, these\n   * factors are scaled by 2^16 = 65536.\n   * Also recall that SF = smoothing_factor / 1024.\n   */\n\n  memberscale = 16384 - cinfo->smoothing_factor * 80; /* scaled (1-5*SF)/4 */\n  neighscale = cinfo->smoothing_factor * 16; /* scaled SF/4 */\n\n  inrow = 0;\n  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {\n    outptr = output_data[outrow];\n    inptr0 = input_data[inrow];\n    inptr1 = input_data[inrow+1];\n    above_ptr = input_data[inrow-1];\n    below_ptr = input_data[inrow+2];\n\n    /* Special case for first column: pretend column -1 is same as column 0 */\n    membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +\n\t\tGETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);\n    neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +\n\t       GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +\n\t       GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[2]) +\n\t       GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[2]);\n    neighsum += neighsum;\n    neighsum += GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[2]) +\n\t\tGETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[2]);\n    membersum = membersum * memberscale + neighsum * neighscale;\n    *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);\n    inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;\n\n    for (colctr = output_cols - 2; colctr > 0; colctr--) {\n      /* sum of pixels directly mapped to this output element */\n      membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +\n\t\t  GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);\n      /* sum of edge-neighbor pixels */\n      neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +\n\t\t GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +\n\t\t GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[2]) +\n\t\t GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[2]);\n      /* The edge-neighbors count twice as much as corner-neighbors */\n      neighsum += neighsum;\n      /* Add in the corner-neighbors */\n      neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[2]) +\n\t\t  GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[2]);\n      /* form final output scaled up by 2^16 */\n      membersum = membersum * memberscale + neighsum * neighscale;\n      /* round, descale and output it */\n      *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);\n      inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;\n    }\n\n    /* Special case for last column */\n    membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +\n\t\tGETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);\n    neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +\n\t       GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +\n\t       GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[1]) +\n\t       GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[1]);\n    neighsum += neighsum;\n    neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[1]) +\n\t\tGETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[1]);\n    membersum = membersum * memberscale + neighsum * neighscale;\n    *outptr = (JSAMPLE) ((membersum + 32768) >> 16);\n\n    inrow += 2;\n  }\n}\n\n\n/*\n * Downsample pixel values of a single component.\n * This version handles the special case of a full-size component,\n * with smoothing.  One row of context is required.\n */\n\nMETHODDEF(void)\nfullsize_smooth_downsample (j_compress_ptr cinfo, jpeg_component_info *compptr,\n\t\t\t    JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  int outrow;\n  JDIMENSION colctr;\n  JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;\n  register JSAMPROW inptr, above_ptr, below_ptr, outptr;\n  INT32 membersum, neighsum, memberscale, neighscale;\n  int colsum, lastcolsum, nextcolsum;\n\n  /* Expand input data enough to let all the output samples be generated\n   * by the standard loop.  Special-casing padded output would be more\n   * efficient.\n   */\n  expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2,\n\t\t    cinfo->image_width, output_cols);\n\n  /* Each of the eight neighbor pixels contributes a fraction SF to the\n   * smoothed pixel, while the main pixel contributes (1-8*SF).  In order\n   * to use integer arithmetic, these factors are multiplied by 2^16 = 65536.\n   * Also recall that SF = smoothing_factor / 1024.\n   */\n\n  memberscale = 65536L - cinfo->smoothing_factor * 512L; /* scaled 1-8*SF */\n  neighscale = cinfo->smoothing_factor * 64; /* scaled SF */\n\n  for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {\n    outptr = output_data[outrow];\n    inptr = input_data[outrow];\n    above_ptr = input_data[outrow-1];\n    below_ptr = input_data[outrow+1];\n\n    /* Special case for first column */\n    colsum = GETJSAMPLE(*above_ptr++) + GETJSAMPLE(*below_ptr++) +\n\t     GETJSAMPLE(*inptr);\n    membersum = GETJSAMPLE(*inptr++);\n    nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +\n\t\t GETJSAMPLE(*inptr);\n    neighsum = colsum + (colsum - membersum) + nextcolsum;\n    membersum = membersum * memberscale + neighsum * neighscale;\n    *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);\n    lastcolsum = colsum; colsum = nextcolsum;\n\n    for (colctr = output_cols - 2; colctr > 0; colctr--) {\n      membersum = GETJSAMPLE(*inptr++);\n      above_ptr++; below_ptr++;\n      nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +\n\t\t   GETJSAMPLE(*inptr);\n      neighsum = lastcolsum + (colsum - membersum) + nextcolsum;\n      membersum = membersum * memberscale + neighsum * neighscale;\n      *outptr++ = (JSAMPLE) ((membersum + 32768) >> 16);\n      lastcolsum = colsum; colsum = nextcolsum;\n    }\n\n    /* Special case for last column */\n    membersum = GETJSAMPLE(*inptr);\n    neighsum = lastcolsum + (colsum - membersum) + colsum;\n    membersum = membersum * memberscale + neighsum * neighscale;\n    *outptr = (JSAMPLE) ((membersum + 32768) >> 16);\n\n  }\n}\n\n#endif /* INPUT_SMOOTHING_SUPPORTED */\n\n\n/*\n * Module initialization routine for downsampling.\n * Note that we must select a routine for each component.\n */\n\nGLOBAL(void)\njinit_downsampler (j_compress_ptr cinfo)\n{\n  my_downsample_ptr downsample;\n  int ci;\n  jpeg_component_info * compptr;\n  boolean smoothok = TRUE;\n\n  downsample = (my_downsample_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_downsampler));\n  cinfo->downsample = (struct jpeg_downsampler *) downsample;\n  downsample->pub.start_pass = start_pass_downsample;\n  downsample->pub.downsample = sep_downsample;\n  downsample->pub.need_context_rows = FALSE;\n\n  if (cinfo->CCIR601_sampling)\n    ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);\n\n  /* Verify we can handle the sampling factors, and set up method pointers */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    if (compptr->h_samp_factor == cinfo->max_h_samp_factor &&\n\tcompptr->v_samp_factor == cinfo->max_v_samp_factor) {\n#ifdef INPUT_SMOOTHING_SUPPORTED\n      if (cinfo->smoothing_factor) {\n\tdownsample->methods[ci] = fullsize_smooth_downsample;\n\tdownsample->pub.need_context_rows = TRUE;\n      } else\n#endif\n\tdownsample->methods[ci] = fullsize_downsample;\n    } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor &&\n\t       compptr->v_samp_factor == cinfo->max_v_samp_factor) {\n      smoothok = FALSE;\n      if (jsimd_can_h2v1_downsample())\n        downsample->methods[ci] = jsimd_h2v1_downsample;\n      else\n        downsample->methods[ci] = h2v1_downsample;\n    } else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor &&\n\t       compptr->v_samp_factor * 2 == cinfo->max_v_samp_factor) {\n#ifdef INPUT_SMOOTHING_SUPPORTED\n      if (cinfo->smoothing_factor) {\n\tdownsample->methods[ci] = h2v2_smooth_downsample;\n\tdownsample->pub.need_context_rows = TRUE;\n      } else\n#endif\n\tif (jsimd_can_h2v2_downsample())\n\t  downsample->methods[ci] = jsimd_h2v2_downsample;\n\telse\n\t  downsample->methods[ci] = h2v2_downsample;\n    } else if ((cinfo->max_h_samp_factor % compptr->h_samp_factor) == 0 &&\n\t       (cinfo->max_v_samp_factor % compptr->v_samp_factor) == 0) {\n      smoothok = FALSE;\n      downsample->methods[ci] = int_downsample;\n    } else\n      ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);\n  }\n\n#ifdef INPUT_SMOOTHING_SUPPORTED\n  if (cinfo->smoothing_factor && !smoothok)\n    TRACEMS(cinfo, 0, JTRC_SMOOTH_NOTIMPL);\n#endif\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jcstest.c",
    "content": "/*\n * Copyright (C)2011 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* This program demonstrates how to check for the colorspace extension\n   capabilities of libjpeg-turbo at both compile time and run time. */\n\n#include <stdio.h>\n#include <jpeglib.h>\n#include <jerror.h>\n#include <setjmp.h>\n\n#ifndef JCS_EXTENSIONS\n#define JCS_EXT_RGB 6\n#endif\n#if !defined(JCS_EXTENSIONS) || !defined(JCS_ALPHA_EXTENSIONS)\n#define JCS_EXT_RGBA 12\n#endif\n\nstatic char lasterror[JMSG_LENGTH_MAX] = \"No error\";\n\ntypedef struct _error_mgr {\n  struct jpeg_error_mgr pub;\n  jmp_buf jb;\n} error_mgr;\n\nstatic void my_error_exit(j_common_ptr cinfo)\n{\n  error_mgr *myerr = (error_mgr *)cinfo->err;\n  (*cinfo->err->output_message)(cinfo);\n  longjmp(myerr->jb, 1);\n}\n\nstatic void my_output_message(j_common_ptr cinfo)\n{\n  (*cinfo->err->format_message)(cinfo, lasterror);\n}\n\nint main(void)\n{\n  int jcs_valid = -1, jcs_alpha_valid = -1;\n  struct jpeg_compress_struct cinfo;\n  error_mgr jerr;\n\n  printf(\"libjpeg-turbo colorspace extensions:\\n\");\n  #if JCS_EXTENSIONS\n  printf(\"  Present at compile time\\n\");\n  #else\n  printf(\"  Not present at compile time\\n\");\n  #endif\n\n  cinfo.err = jpeg_std_error(&jerr.pub);\n  jerr.pub.error_exit = my_error_exit;\n  jerr.pub.output_message = my_output_message;\n\n  if(setjmp(jerr.jb)) {\n    /* this will execute if libjpeg has an error */\n    jcs_valid = 0;\n    goto done;\n  }\n\n  jpeg_create_compress(&cinfo);\n  cinfo.input_components = 3;\n  jpeg_set_defaults(&cinfo);\n  cinfo.in_color_space = JCS_EXT_RGB;\n  jpeg_default_colorspace(&cinfo);\n  jcs_valid = 1;\n\n  done:\n  if (jcs_valid)\n    printf(\"  Working properly\\n\");\n  else\n    printf(\"  Not working properly.  Error returned was:\\n    %s\\n\",\n           lasterror);\n\n  printf(\"libjpeg-turbo alpha colorspace extensions:\\n\");\n  #if JCS_ALPHA_EXTENSIONS\n  printf(\"  Present at compile time\\n\");\n  #else\n  printf(\"  Not present at compile time\\n\");\n  #endif\n\n  if(setjmp(jerr.jb)) {\n    /* this will execute if libjpeg has an error */\n    jcs_alpha_valid = 0;\n    goto done2;\n  }\n\n  cinfo.in_color_space = JCS_EXT_RGBA;\n  jpeg_default_colorspace(&cinfo);\n  jcs_alpha_valid = 1;\n\n  done2:\n  if (jcs_alpha_valid)\n    printf(\"  Working properly\\n\");\n  else\n    printf(\"  Not working properly.  Error returned was:\\n    %s\\n\",\n           lasterror);\n\n  jpeg_destroy_compress(&cinfo);\n  return 0;\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jctrans.c",
    "content": "/*\n * jctrans.c\n *\n * Copyright (C) 1995-1998, Thomas G. Lane.\n * Modified 2000-2009 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains library routines for transcoding compression,\n * that is, writing raw DCT coefficient arrays to an output JPEG file.\n * The routines in jcapimin.c will also be needed by a transcoder.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Forward declarations */\nLOCAL(void) transencode_master_selection\n\tJPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays));\nLOCAL(void) transencode_coef_controller\n\tJPP((j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays));\n\n\n/*\n * Compression initialization for writing raw-coefficient data.\n * Before calling this, all parameters and a data destination must be set up.\n * Call jpeg_finish_compress() to actually write the data.\n *\n * The number of passed virtual arrays must match cinfo->num_components.\n * Note that the virtual arrays need not be filled or even realized at\n * the time write_coefficients is called; indeed, if the virtual arrays\n * were requested from this compression object's memory manager, they\n * typically will be realized during this routine and filled afterwards.\n */\n\nGLOBAL(void)\njpeg_write_coefficients (j_compress_ptr cinfo, jvirt_barray_ptr * coef_arrays)\n{\n  if (cinfo->global_state != CSTATE_START)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  /* Mark all tables to be written */\n  jpeg_suppress_tables(cinfo, FALSE);\n  /* (Re)initialize error mgr and destination modules */\n  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);\n  (*cinfo->dest->init_destination) (cinfo);\n  /* Perform master selection of active modules */\n  transencode_master_selection(cinfo, coef_arrays);\n  /* Wait for jpeg_finish_compress() call */\n  cinfo->next_scanline = 0;\t/* so jpeg_write_marker works */\n  cinfo->global_state = CSTATE_WRCOEFS;\n}\n\n\n/*\n * Initialize the compression object with default parameters,\n * then copy from the source object all parameters needed for lossless\n * transcoding.  Parameters that can be varied without loss (such as\n * scan script and Huffman optimization) are left in their default states.\n */\n\nGLOBAL(void)\njpeg_copy_critical_parameters (j_decompress_ptr srcinfo,\n\t\t\t       j_compress_ptr dstinfo)\n{\n  JQUANT_TBL ** qtblptr;\n  jpeg_component_info *incomp, *outcomp;\n  JQUANT_TBL *c_quant, *slot_quant;\n  int tblno, ci, coefi;\n\n  /* Safety check to ensure start_compress not called yet. */\n  if (dstinfo->global_state != CSTATE_START)\n    ERREXIT1(dstinfo, JERR_BAD_STATE, dstinfo->global_state);\n  /* Copy fundamental image dimensions */\n  dstinfo->image_width = srcinfo->image_width;\n  dstinfo->image_height = srcinfo->image_height;\n  dstinfo->input_components = srcinfo->num_components;\n  dstinfo->in_color_space = srcinfo->jpeg_color_space;\n#if JPEG_LIB_VERSION >= 70\n  dstinfo->jpeg_width = srcinfo->output_width;\n  dstinfo->jpeg_height = srcinfo->output_height;\n  dstinfo->min_DCT_h_scaled_size = srcinfo->min_DCT_h_scaled_size;\n  dstinfo->min_DCT_v_scaled_size = srcinfo->min_DCT_v_scaled_size;\n#endif\n  /* Initialize all parameters to default values */\n  jpeg_set_defaults(dstinfo);\n  /* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB.\n   * Fix it to get the right header markers for the image colorspace.\n   */\n  jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space);\n  dstinfo->data_precision = srcinfo->data_precision;\n  dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling;\n  /* Copy the source's quantization tables. */\n  for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {\n    if (srcinfo->quant_tbl_ptrs[tblno] != NULL) {\n      qtblptr = & dstinfo->quant_tbl_ptrs[tblno];\n      if (*qtblptr == NULL)\n\t*qtblptr = jpeg_alloc_quant_table((j_common_ptr) dstinfo);\n      MEMCOPY((*qtblptr)->quantval,\n\t      srcinfo->quant_tbl_ptrs[tblno]->quantval,\n\t      SIZEOF((*qtblptr)->quantval));\n      (*qtblptr)->sent_table = FALSE;\n    }\n  }\n  /* Copy the source's per-component info.\n   * Note we assume jpeg_set_defaults has allocated the dest comp_info array.\n   */\n  dstinfo->num_components = srcinfo->num_components;\n  if (dstinfo->num_components < 1 || dstinfo->num_components > MAX_COMPONENTS)\n    ERREXIT2(dstinfo, JERR_COMPONENT_COUNT, dstinfo->num_components,\n\t     MAX_COMPONENTS);\n  for (ci = 0, incomp = srcinfo->comp_info, outcomp = dstinfo->comp_info;\n       ci < dstinfo->num_components; ci++, incomp++, outcomp++) {\n    outcomp->component_id = incomp->component_id;\n    outcomp->h_samp_factor = incomp->h_samp_factor;\n    outcomp->v_samp_factor = incomp->v_samp_factor;\n    outcomp->quant_tbl_no = incomp->quant_tbl_no;\n    /* Make sure saved quantization table for component matches the qtable\n     * slot.  If not, the input file re-used this qtable slot.\n     * IJG encoder currently cannot duplicate this.\n     */\n    tblno = outcomp->quant_tbl_no;\n    if (tblno < 0 || tblno >= NUM_QUANT_TBLS ||\n\tsrcinfo->quant_tbl_ptrs[tblno] == NULL)\n      ERREXIT1(dstinfo, JERR_NO_QUANT_TABLE, tblno);\n    slot_quant = srcinfo->quant_tbl_ptrs[tblno];\n    c_quant = incomp->quant_table;\n    if (c_quant != NULL) {\n      for (coefi = 0; coefi < DCTSIZE2; coefi++) {\n\tif (c_quant->quantval[coefi] != slot_quant->quantval[coefi])\n\t  ERREXIT1(dstinfo, JERR_MISMATCHED_QUANT_TABLE, tblno);\n      }\n    }\n    /* Note: we do not copy the source's Huffman table assignments;\n     * instead we rely on jpeg_set_colorspace to have made a suitable choice.\n     */\n  }\n  /* Also copy JFIF version and resolution information, if available.\n   * Strictly speaking this isn't \"critical\" info, but it's nearly\n   * always appropriate to copy it if available.  In particular,\n   * if the application chooses to copy JFIF 1.02 extension markers from\n   * the source file, we need to copy the version to make sure we don't\n   * emit a file that has 1.02 extensions but a claimed version of 1.01.\n   * We will *not*, however, copy version info from mislabeled \"2.01\" files.\n   */\n  if (srcinfo->saw_JFIF_marker) {\n    if (srcinfo->JFIF_major_version == 1) {\n      dstinfo->JFIF_major_version = srcinfo->JFIF_major_version;\n      dstinfo->JFIF_minor_version = srcinfo->JFIF_minor_version;\n    }\n    dstinfo->density_unit = srcinfo->density_unit;\n    dstinfo->X_density = srcinfo->X_density;\n    dstinfo->Y_density = srcinfo->Y_density;\n  }\n}\n\n\n/*\n * Master selection of compression modules for transcoding.\n * This substitutes for jcinit.c's initialization of the full compressor.\n */\n\nLOCAL(void)\ntransencode_master_selection (j_compress_ptr cinfo,\n\t\t\t      jvirt_barray_ptr * coef_arrays)\n{\n  /* Although we don't actually use input_components for transcoding,\n   * jcmaster.c's initial_setup will complain if input_components is 0.\n   */\n  cinfo->input_components = 1;\n  /* Initialize master control (includes parameter checking/processing) */\n  jinit_c_master_control(cinfo, TRUE /* transcode only */);\n\n  /* Entropy encoding: either Huffman or arithmetic coding. */\n  if (cinfo->arith_code) {\n#ifdef C_ARITH_CODING_SUPPORTED\n    jinit_arith_encoder(cinfo);\n#else\n    ERREXIT(cinfo, JERR_ARITH_NOTIMPL);\n#endif\n  } else {\n    if (cinfo->progressive_mode) {\n#ifdef C_PROGRESSIVE_SUPPORTED\n      jinit_phuff_encoder(cinfo);\n#else\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n    } else\n      jinit_huff_encoder(cinfo);\n  }\n\n  /* We need a special coefficient buffer controller. */\n  transencode_coef_controller(cinfo, coef_arrays);\n\n  jinit_marker_writer(cinfo);\n\n  /* We can now tell the memory manager to allocate virtual arrays. */\n  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);\n\n  /* Write the datastream header (SOI, JFIF) immediately.\n   * Frame and scan headers are postponed till later.\n   * This lets application insert special markers after the SOI.\n   */\n  (*cinfo->marker->write_file_header) (cinfo);\n}\n\n\n/*\n * The rest of this file is a special implementation of the coefficient\n * buffer controller.  This is similar to jccoefct.c, but it handles only\n * output from presupplied virtual arrays.  Furthermore, we generate any\n * dummy padding blocks on-the-fly rather than expecting them to be present\n * in the arrays.\n */\n\n/* Private buffer controller object */\n\ntypedef struct {\n  struct jpeg_c_coef_controller pub; /* public fields */\n\n  JDIMENSION iMCU_row_num;\t/* iMCU row # within image */\n  JDIMENSION mcu_ctr;\t\t/* counts MCUs processed in current row */\n  int MCU_vert_offset;\t\t/* counts MCU rows within iMCU row */\n  int MCU_rows_per_iMCU_row;\t/* number of such rows needed */\n\n  /* Virtual block array for each component. */\n  jvirt_barray_ptr * whole_image;\n\n  /* Workspace for constructing dummy blocks at right/bottom edges. */\n  JBLOCKROW dummy_buffer[C_MAX_BLOCKS_IN_MCU];\n} my_coef_controller;\n\ntypedef my_coef_controller * my_coef_ptr;\n\n\nLOCAL(void)\nstart_iMCU_row (j_compress_ptr cinfo)\n/* Reset within-iMCU-row counters for a new row */\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n\n  /* In an interleaved scan, an MCU row is the same as an iMCU row.\n   * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.\n   * But at the bottom of the image, process only what's left.\n   */\n  if (cinfo->comps_in_scan > 1) {\n    coef->MCU_rows_per_iMCU_row = 1;\n  } else {\n    if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1))\n      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;\n    else\n      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;\n  }\n\n  coef->mcu_ctr = 0;\n  coef->MCU_vert_offset = 0;\n}\n\n\n/*\n * Initialize for a processing pass.\n */\n\nMETHODDEF(void)\nstart_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n\n  if (pass_mode != JBUF_CRANK_DEST)\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n\n  coef->iMCU_row_num = 0;\n  start_iMCU_row(cinfo);\n}\n\n\n/*\n * Process some data.\n * We process the equivalent of one fully interleaved MCU row (\"iMCU\" row)\n * per call, ie, v_samp_factor block rows for each component in the scan.\n * The data is obtained from the virtual arrays and fed to the entropy coder.\n * Returns TRUE if the iMCU row is completed, FALSE if suspended.\n *\n * NB: input_buf is ignored; it is likely to be a NULL pointer.\n */\n\nMETHODDEF(boolean)\ncompress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION MCU_col_num;\t/* index of current MCU within row */\n  JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;\n  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;\n  int blkn, ci, xindex, yindex, yoffset, blockcnt;\n  JDIMENSION start_col;\n  JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];\n  JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];\n  JBLOCKROW buffer_ptr;\n  jpeg_component_info *compptr;\n\n  /* Align the virtual buffers for the components used in this scan. */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    buffer[ci] = (*cinfo->mem->access_virt_barray)\n      ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],\n       coef->iMCU_row_num * compptr->v_samp_factor,\n       (JDIMENSION) compptr->v_samp_factor, FALSE);\n  }\n\n  /* Loop to process one whole iMCU row */\n  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;\n       yoffset++) {\n    for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;\n\t MCU_col_num++) {\n      /* Construct list of pointers to DCT blocks belonging to this MCU */\n      blkn = 0;\t\t\t/* index of current DCT block within MCU */\n      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n\tcompptr = cinfo->cur_comp_info[ci];\n\tstart_col = MCU_col_num * compptr->MCU_width;\n\tblockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width\n\t\t\t\t\t\t: compptr->last_col_width;\n\tfor (yindex = 0; yindex < compptr->MCU_height; yindex++) {\n\t  if (coef->iMCU_row_num < last_iMCU_row ||\n\t      yindex+yoffset < compptr->last_row_height) {\n\t    /* Fill in pointers to real blocks in this row */\n\t    buffer_ptr = buffer[ci][yindex+yoffset] + start_col;\n\t    for (xindex = 0; xindex < blockcnt; xindex++)\n\t      MCU_buffer[blkn++] = buffer_ptr++;\n\t  } else {\n\t    /* At bottom of image, need a whole row of dummy blocks */\n\t    xindex = 0;\n\t  }\n\t  /* Fill in any dummy blocks needed in this row.\n\t   * Dummy blocks are filled in the same way as in jccoefct.c:\n\t   * all zeroes in the AC entries, DC entries equal to previous\n\t   * block's DC value.  The init routine has already zeroed the\n\t   * AC entries, so we need only set the DC entries correctly.\n\t   */\n\t  for (; xindex < compptr->MCU_width; xindex++) {\n\t    MCU_buffer[blkn] = coef->dummy_buffer[blkn];\n\t    MCU_buffer[blkn][0][0] = MCU_buffer[blkn-1][0][0];\n\t    blkn++;\n\t  }\n\t}\n      }\n      /* Try to write the MCU. */\n      if (! (*cinfo->entropy->encode_mcu) (cinfo, MCU_buffer)) {\n\t/* Suspension forced; update state counters and exit */\n\tcoef->MCU_vert_offset = yoffset;\n\tcoef->mcu_ctr = MCU_col_num;\n\treturn FALSE;\n      }\n    }\n    /* Completed an MCU row, but perhaps not an iMCU row */\n    coef->mcu_ctr = 0;\n  }\n  /* Completed the iMCU row, advance counters for next one */\n  coef->iMCU_row_num++;\n  start_iMCU_row(cinfo);\n  return TRUE;\n}\n\n\n/*\n * Initialize coefficient buffer controller.\n *\n * Each passed coefficient array must be the right size for that\n * coefficient: width_in_blocks wide and height_in_blocks high,\n * with unitheight at least v_samp_factor.\n */\n\nLOCAL(void)\ntransencode_coef_controller (j_compress_ptr cinfo,\n\t\t\t     jvirt_barray_ptr * coef_arrays)\n{\n  my_coef_ptr coef;\n  JBLOCKROW buffer;\n  int i;\n\n  coef = (my_coef_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_coef_controller));\n  cinfo->coef = (struct jpeg_c_coef_controller *) coef;\n  coef->pub.start_pass = start_pass_coef;\n  coef->pub.compress_data = compress_output;\n\n  /* Save pointer to virtual arrays */\n  coef->whole_image = coef_arrays;\n\n  /* Allocate and pre-zero space for dummy DCT blocks. */\n  buffer = (JBLOCKROW)\n    (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tC_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));\n  jzero_far((void FAR *) buffer, C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));\n  for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {\n    coef->dummy_buffer[i] = buffer + i;\n  }\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdapimin.c",
    "content": "/*\n * jdapimin.c\n *\n * Copyright (C) 1994-1998, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains application interface code for the decompression half\n * of the JPEG library.  These are the \"minimum\" API routines that may be\n * needed in either the normal full-decompression case or the\n * transcoding-only case.\n *\n * Most of the routines intended to be called directly by an application\n * are in this file or in jdapistd.c.  But also see jcomapi.c for routines\n * shared by compression and decompression, and jdtrans.c for the transcoding\n * case.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/*\n * Initialization of a JPEG decompression object.\n * The error manager must already be set up (in case memory manager fails).\n */\n\nGLOBAL(void)\njpeg_CreateDecompress (j_decompress_ptr cinfo, int version, size_t structsize)\n{\n  int i;\n\n  /* Guard against version mismatches between library and caller. */\n  cinfo->mem = NULL;\t\t/* so jpeg_destroy knows mem mgr not called */\n  if (version != JPEG_LIB_VERSION)\n    ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);\n  if (structsize != SIZEOF(struct jpeg_decompress_struct))\n    ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE, \n\t     (int) SIZEOF(struct jpeg_decompress_struct), (int) structsize);\n\n  /* For debugging purposes, we zero the whole master structure.\n   * But the application has already set the err pointer, and may have set\n   * client_data, so we have to save and restore those fields.\n   * Note: if application hasn't set client_data, tools like Purify may\n   * complain here.\n   */\n  {\n    struct jpeg_error_mgr * err = cinfo->err;\n    void * client_data = cinfo->client_data; /* ignore Purify complaint here */\n    MEMZERO(cinfo, SIZEOF(struct jpeg_decompress_struct));\n    cinfo->err = err;\n    cinfo->client_data = client_data;\n  }\n  cinfo->is_decompressor = TRUE;\n\n  /* Initialize a memory manager instance for this object */\n  jinit_memory_mgr((j_common_ptr) cinfo);\n\n  /* Zero out pointers to permanent structures. */\n  cinfo->progress = NULL;\n  cinfo->src = NULL;\n\n  for (i = 0; i < NUM_QUANT_TBLS; i++)\n    cinfo->quant_tbl_ptrs[i] = NULL;\n\n  for (i = 0; i < NUM_HUFF_TBLS; i++) {\n    cinfo->dc_huff_tbl_ptrs[i] = NULL;\n    cinfo->ac_huff_tbl_ptrs[i] = NULL;\n  }\n\n  /* Initialize marker processor so application can override methods\n   * for COM, APPn markers before calling jpeg_read_header.\n   */\n  cinfo->marker_list = NULL;\n  jinit_marker_reader(cinfo);\n\n  /* And initialize the overall input controller. */\n  jinit_input_controller(cinfo);\n\n  /* OK, I'm ready */\n  cinfo->global_state = DSTATE_START;\n}\n\n\n/*\n * Destruction of a JPEG decompression object\n */\n\nGLOBAL(void)\njpeg_destroy_decompress (j_decompress_ptr cinfo)\n{\n  jpeg_destroy((j_common_ptr) cinfo); /* use common routine */\n}\n\n\n/*\n * Abort processing of a JPEG decompression operation,\n * but don't destroy the object itself.\n */\n\nGLOBAL(void)\njpeg_abort_decompress (j_decompress_ptr cinfo)\n{\n  jpeg_abort((j_common_ptr) cinfo); /* use common routine */\n}\n\n\n/*\n * Set default decompression parameters.\n */\n\nLOCAL(void)\ndefault_decompress_parms (j_decompress_ptr cinfo)\n{\n  /* Guess the input colorspace, and set output colorspace accordingly. */\n  /* (Wish JPEG committee had provided a real way to specify this...) */\n  /* Note application may override our guesses. */\n  switch (cinfo->num_components) {\n  case 1:\n    cinfo->jpeg_color_space = JCS_GRAYSCALE;\n    cinfo->out_color_space = JCS_GRAYSCALE;\n    break;\n    \n  case 3:\n    if (cinfo->saw_JFIF_marker) {\n      cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */\n    } else if (cinfo->saw_Adobe_marker) {\n      switch (cinfo->Adobe_transform) {\n      case 0:\n\tcinfo->jpeg_color_space = JCS_RGB;\n\tbreak;\n      case 1:\n\tcinfo->jpeg_color_space = JCS_YCbCr;\n\tbreak;\n      default:\n\tWARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);\n\tcinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */\n\tbreak;\n      }\n    } else {\n      /* Saw no special markers, try to guess from the component IDs */\n      int cid0 = cinfo->comp_info[0].component_id;\n      int cid1 = cinfo->comp_info[1].component_id;\n      int cid2 = cinfo->comp_info[2].component_id;\n\n      if (cid0 == 1 && cid1 == 2 && cid2 == 3)\n\tcinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */\n      else if (cid0 == 82 && cid1 == 71 && cid2 == 66)\n\tcinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */\n      else {\n\tTRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2);\n\tcinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */\n      }\n    }\n    /* Always guess RGB is proper output colorspace. */\n    cinfo->out_color_space = JCS_RGB;\n    break;\n    \n  case 4:\n    if (cinfo->saw_Adobe_marker) {\n      switch (cinfo->Adobe_transform) {\n      case 0:\n\tcinfo->jpeg_color_space = JCS_CMYK;\n\tbreak;\n      case 2:\n\tcinfo->jpeg_color_space = JCS_YCCK;\n\tbreak;\n      default:\n\tWARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);\n\tcinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */\n\tbreak;\n      }\n    } else {\n      /* No special markers, assume straight CMYK. */\n      cinfo->jpeg_color_space = JCS_CMYK;\n    }\n    cinfo->out_color_space = JCS_CMYK;\n    break;\n    \n  default:\n    cinfo->jpeg_color_space = JCS_UNKNOWN;\n    cinfo->out_color_space = JCS_UNKNOWN;\n    break;\n  }\n\n  /* Set defaults for other decompression parameters. */\n  cinfo->scale_num = 1;\t\t/* 1:1 scaling */\n  cinfo->scale_denom = 1;\n  cinfo->output_gamma = 1.0;\n  cinfo->buffered_image = FALSE;\n  cinfo->raw_data_out = FALSE;\n  cinfo->dct_method = JDCT_DEFAULT;\n  cinfo->do_fancy_upsampling = TRUE;\n  cinfo->do_block_smoothing = TRUE;\n  cinfo->quantize_colors = FALSE;\n  /* We set these in case application only sets quantize_colors. */\n  cinfo->dither_mode = JDITHER_FS;\n#ifdef QUANT_2PASS_SUPPORTED\n  cinfo->two_pass_quantize = TRUE;\n#else\n  cinfo->two_pass_quantize = FALSE;\n#endif\n  cinfo->desired_number_of_colors = 256;\n  cinfo->colormap = NULL;\n  /* Initialize for no mode change in buffered-image mode. */\n  cinfo->enable_1pass_quant = FALSE;\n  cinfo->enable_external_quant = FALSE;\n  cinfo->enable_2pass_quant = FALSE;\n}\n\n\n/*\n * Decompression startup: read start of JPEG datastream to see what's there.\n * Need only initialize JPEG object and supply a data source before calling.\n *\n * This routine will read as far as the first SOS marker (ie, actual start of\n * compressed data), and will save all tables and parameters in the JPEG\n * object.  It will also initialize the decompression parameters to default\n * values, and finally return JPEG_HEADER_OK.  On return, the application may\n * adjust the decompression parameters and then call jpeg_start_decompress.\n * (Or, if the application only wanted to determine the image parameters,\n * the data need not be decompressed.  In that case, call jpeg_abort or\n * jpeg_destroy to release any temporary space.)\n * If an abbreviated (tables only) datastream is presented, the routine will\n * return JPEG_HEADER_TABLES_ONLY upon reaching EOI.  The application may then\n * re-use the JPEG object to read the abbreviated image datastream(s).\n * It is unnecessary (but OK) to call jpeg_abort in this case.\n * The JPEG_SUSPENDED return code only occurs if the data source module\n * requests suspension of the decompressor.  In this case the application\n * should load more source data and then re-call jpeg_read_header to resume\n * processing.\n * If a non-suspending data source is used and require_image is TRUE, then the\n * return code need not be inspected since only JPEG_HEADER_OK is possible.\n *\n * This routine is now just a front end to jpeg_consume_input, with some\n * extra error checking.\n */\n\nGLOBAL(int)\njpeg_read_header (j_decompress_ptr cinfo, boolean require_image)\n{\n  int retcode;\n\n  if (cinfo->global_state != DSTATE_START &&\n      cinfo->global_state != DSTATE_INHEADER)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  retcode = jpeg_consume_input(cinfo);\n\n  switch (retcode) {\n  case JPEG_REACHED_SOS:\n    retcode = JPEG_HEADER_OK;\n    break;\n  case JPEG_REACHED_EOI:\n    if (require_image)\t\t/* Complain if application wanted an image */\n      ERREXIT(cinfo, JERR_NO_IMAGE);\n    /* Reset to start state; it would be safer to require the application to\n     * call jpeg_abort, but we can't change it now for compatibility reasons.\n     * A side effect is to free any temporary memory (there shouldn't be any).\n     */\n    jpeg_abort((j_common_ptr) cinfo); /* sets state = DSTATE_START */\n    retcode = JPEG_HEADER_TABLES_ONLY;\n    break;\n  case JPEG_SUSPENDED:\n    /* no work */\n    break;\n  }\n\n  return retcode;\n}\n\n\n/*\n * Consume data in advance of what the decompressor requires.\n * This can be called at any time once the decompressor object has\n * been created and a data source has been set up.\n *\n * This routine is essentially a state machine that handles a couple\n * of critical state-transition actions, namely initial setup and\n * transition from header scanning to ready-for-start_decompress.\n * All the actual input is done via the input controller's consume_input\n * method.\n */\n\nGLOBAL(int)\njpeg_consume_input (j_decompress_ptr cinfo)\n{\n  int retcode = JPEG_SUSPENDED;\n\n  /* NB: every possible DSTATE value should be listed in this switch */\n  switch (cinfo->global_state) {\n  case DSTATE_START:\n    /* Start-of-datastream actions: reset appropriate modules */\n    (*cinfo->inputctl->reset_input_controller) (cinfo);\n    /* Initialize application's data source module */\n    (*cinfo->src->init_source) (cinfo);\n    cinfo->global_state = DSTATE_INHEADER;\n    /*FALLTHROUGH*/\n  case DSTATE_INHEADER:\n    retcode = (*cinfo->inputctl->consume_input) (cinfo);\n    if (retcode == JPEG_REACHED_SOS) { /* Found SOS, prepare to decompress */\n      /* Set up default parameters based on header data */\n      default_decompress_parms(cinfo);\n      /* Set global state: ready for start_decompress */\n      cinfo->global_state = DSTATE_READY;\n    }\n    break;\n  case DSTATE_READY:\n    /* Can't advance past first SOS until start_decompress is called */\n    retcode = JPEG_REACHED_SOS;\n    break;\n  case DSTATE_PRELOAD:\n  case DSTATE_PRESCAN:\n  case DSTATE_SCANNING:\n  case DSTATE_RAW_OK:\n  case DSTATE_BUFIMAGE:\n  case DSTATE_BUFPOST:\n  case DSTATE_STOPPING:\n    retcode = (*cinfo->inputctl->consume_input) (cinfo);\n    break;\n  default:\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  }\n  return retcode;\n}\n\n\n/*\n * Have we finished reading the input file?\n */\n\nGLOBAL(boolean)\njpeg_input_complete (j_decompress_ptr cinfo)\n{\n  /* Check for valid jpeg object */\n  if (cinfo->global_state < DSTATE_START ||\n      cinfo->global_state > DSTATE_STOPPING)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  return cinfo->inputctl->eoi_reached;\n}\n\n\n/*\n * Is there more than one scan?\n */\n\nGLOBAL(boolean)\njpeg_has_multiple_scans (j_decompress_ptr cinfo)\n{\n  /* Only valid after jpeg_read_header completes */\n  if (cinfo->global_state < DSTATE_READY ||\n      cinfo->global_state > DSTATE_STOPPING)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  return cinfo->inputctl->has_multiple_scans;\n}\n\n\n/*\n * Finish JPEG decompression.\n *\n * This will normally just verify the file trailer and release temp storage.\n *\n * Returns FALSE if suspended.  The return value need be inspected only if\n * a suspending data source is used.\n */\n\nGLOBAL(boolean)\njpeg_finish_decompress (j_decompress_ptr cinfo)\n{\n  if ((cinfo->global_state == DSTATE_SCANNING ||\n       cinfo->global_state == DSTATE_RAW_OK) && ! cinfo->buffered_image) {\n    /* Terminate final pass of non-buffered mode */\n    if (cinfo->output_scanline < cinfo->output_height)\n      ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);\n    (*cinfo->master->finish_output_pass) (cinfo);\n    cinfo->global_state = DSTATE_STOPPING;\n  } else if (cinfo->global_state == DSTATE_BUFIMAGE) {\n    /* Finishing after a buffered-image operation */\n    cinfo->global_state = DSTATE_STOPPING;\n  } else if (cinfo->global_state != DSTATE_STOPPING) {\n    /* STOPPING = repeat call after a suspension, anything else is error */\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  }\n  /* Read until EOI */\n  while (! cinfo->inputctl->eoi_reached) {\n    if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)\n      return FALSE;\t\t/* Suspend, come back later */\n  }\n  /* Do final cleanup */\n  (*cinfo->src->term_source) (cinfo);\n  /* We can use jpeg_abort to release memory and reset global_state */\n  jpeg_abort((j_common_ptr) cinfo);\n  return TRUE;\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdapistd.c",
    "content": "/*\n * jdapistd.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains application interface code for the decompression half\n * of the JPEG library.  These are the \"standard\" API routines that are\n * used in the normal full-decompression case.  They are not used by a\n * transcoding-only application.  Note that if an application links in\n * jpeg_start_decompress, it will end up linking in the entire decompressor.\n * We thus must separate this file from jdapimin.c to avoid linking the\n * whole decompression library into a transcoder.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jpegcomp.h\"\n\n\n/* Forward declarations */\nLOCAL(boolean) output_pass_setup JPP((j_decompress_ptr cinfo));\n\n\n/*\n * Decompression initialization.\n * jpeg_read_header must be completed before calling this.\n *\n * If a multipass operating mode was selected, this will do all but the\n * last pass, and thus may take a great deal of time.\n *\n * Returns FALSE if suspended.  The return value need be inspected only if\n * a suspending data source is used.\n */\n\nGLOBAL(boolean)\njpeg_start_decompress (j_decompress_ptr cinfo)\n{\n  if (cinfo->global_state == DSTATE_READY) {\n    /* First call: initialize master control, select active modules */\n    jinit_master_decompress(cinfo);\n    if (cinfo->buffered_image) {\n      /* No more work here; expecting jpeg_start_output next */\n      cinfo->global_state = DSTATE_BUFIMAGE;\n      return TRUE;\n    }\n    cinfo->global_state = DSTATE_PRELOAD;\n  }\n  if (cinfo->global_state == DSTATE_PRELOAD) {\n    /* If file has multiple scans, absorb them all into the coef buffer */\n    if (cinfo->inputctl->has_multiple_scans) {\n#ifdef D_MULTISCAN_FILES_SUPPORTED\n      for (;;) {\n\tint retcode;\n\t/* Call progress monitor hook if present */\n\tif (cinfo->progress != NULL)\n\t  (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n\t/* Absorb some more input */\n\tretcode = (*cinfo->inputctl->consume_input) (cinfo);\n\tif (retcode == JPEG_SUSPENDED)\n\t  return FALSE;\n\tif (retcode == JPEG_REACHED_EOI)\n\t  break;\n\t/* Advance progress counter if appropriate */\n\tif (cinfo->progress != NULL &&\n\t    (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {\n\t  if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {\n\t    /* jdmaster underestimated number of scans; ratchet up one scan */\n\t    cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows;\n\t  }\n\t}\n      }\n#else\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif /* D_MULTISCAN_FILES_SUPPORTED */\n    }\n    cinfo->output_scan_number = cinfo->input_scan_number;\n  } else if (cinfo->global_state != DSTATE_PRESCAN)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  /* Perform any dummy output passes, and set up for the final pass */\n  return output_pass_setup(cinfo);\n}\n\n\n/*\n * Set up for an output pass, and perform any dummy pass(es) needed.\n * Common subroutine for jpeg_start_decompress and jpeg_start_output.\n * Entry: global_state = DSTATE_PRESCAN only if previously suspended.\n * Exit: If done, returns TRUE and sets global_state for proper output mode.\n *       If suspended, returns FALSE and sets global_state = DSTATE_PRESCAN.\n */\n\nLOCAL(boolean)\noutput_pass_setup (j_decompress_ptr cinfo)\n{\n  if (cinfo->global_state != DSTATE_PRESCAN) {\n    /* First call: do pass setup */\n    (*cinfo->master->prepare_for_output_pass) (cinfo);\n    cinfo->output_scanline = 0;\n    cinfo->global_state = DSTATE_PRESCAN;\n  }\n  /* Loop over any required dummy passes */\n  while (cinfo->master->is_dummy_pass) {\n#ifdef QUANT_2PASS_SUPPORTED\n    /* Crank through the dummy pass */\n    while (cinfo->output_scanline < cinfo->output_height) {\n      JDIMENSION last_scanline;\n      /* Call progress monitor hook if present */\n      if (cinfo->progress != NULL) {\n\tcinfo->progress->pass_counter = (long) cinfo->output_scanline;\n\tcinfo->progress->pass_limit = (long) cinfo->output_height;\n\t(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n      }\n      /* Process some data */\n      last_scanline = cinfo->output_scanline;\n      (*cinfo->main->process_data) (cinfo, (JSAMPARRAY) NULL,\n\t\t\t\t    &cinfo->output_scanline, (JDIMENSION) 0);\n      if (cinfo->output_scanline == last_scanline)\n\treturn FALSE;\t\t/* No progress made, must suspend */\n    }\n    /* Finish up dummy pass, and set up for another one */\n    (*cinfo->master->finish_output_pass) (cinfo);\n    (*cinfo->master->prepare_for_output_pass) (cinfo);\n    cinfo->output_scanline = 0;\n#else\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif /* QUANT_2PASS_SUPPORTED */\n  }\n  /* Ready for application to drive output pass through\n   * jpeg_read_scanlines or jpeg_read_raw_data.\n   */\n  cinfo->global_state = cinfo->raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING;\n  return TRUE;\n}\n\n\n/*\n * Read some scanlines of data from the JPEG decompressor.\n *\n * The return value will be the number of lines actually read.\n * This may be less than the number requested in several cases,\n * including bottom of image, data source suspension, and operating\n * modes that emit multiple scanlines at a time.\n *\n * Note: we warn about excess calls to jpeg_read_scanlines() since\n * this likely signals an application programmer error.  However,\n * an oversize buffer (max_lines > scanlines remaining) is not an error.\n */\n\nGLOBAL(JDIMENSION)\njpeg_read_scanlines (j_decompress_ptr cinfo, JSAMPARRAY scanlines,\n\t\t     JDIMENSION max_lines)\n{\n  JDIMENSION row_ctr;\n\n  if (cinfo->global_state != DSTATE_SCANNING)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  if (cinfo->output_scanline >= cinfo->output_height) {\n    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);\n    return 0;\n  }\n\n  /* Call progress monitor hook if present */\n  if (cinfo->progress != NULL) {\n    cinfo->progress->pass_counter = (long) cinfo->output_scanline;\n    cinfo->progress->pass_limit = (long) cinfo->output_height;\n    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n  }\n\n  /* Process some data */\n  row_ctr = 0;\n  (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, max_lines);\n  cinfo->output_scanline += row_ctr;\n  return row_ctr;\n}\n\n\n/*\n * Alternate entry point to read raw data.\n * Processes exactly one iMCU row per call, unless suspended.\n */\n\nGLOBAL(JDIMENSION)\njpeg_read_raw_data (j_decompress_ptr cinfo, JSAMPIMAGE data,\n\t\t    JDIMENSION max_lines)\n{\n  JDIMENSION lines_per_iMCU_row;\n\n  if (cinfo->global_state != DSTATE_RAW_OK)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  if (cinfo->output_scanline >= cinfo->output_height) {\n    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);\n    return 0;\n  }\n\n  /* Call progress monitor hook if present */\n  if (cinfo->progress != NULL) {\n    cinfo->progress->pass_counter = (long) cinfo->output_scanline;\n    cinfo->progress->pass_limit = (long) cinfo->output_height;\n    (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n  }\n\n  /* Verify that at least one iMCU row can be returned. */\n  lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->_min_DCT_scaled_size;\n  if (max_lines < lines_per_iMCU_row)\n    ERREXIT(cinfo, JERR_BUFFER_SIZE);\n\n  /* Decompress directly into user's buffer. */\n  if (! (*cinfo->coef->decompress_data) (cinfo, data))\n    return 0;\t\t\t/* suspension forced, can do nothing more */\n\n  /* OK, we processed one iMCU row. */\n  cinfo->output_scanline += lines_per_iMCU_row;\n  return lines_per_iMCU_row;\n}\n\n\n/* Additional entry points for buffered-image mode. */\n\n#ifdef D_MULTISCAN_FILES_SUPPORTED\n\n/*\n * Initialize for an output pass in buffered-image mode.\n */\n\nGLOBAL(boolean)\njpeg_start_output (j_decompress_ptr cinfo, int scan_number)\n{\n  if (cinfo->global_state != DSTATE_BUFIMAGE &&\n      cinfo->global_state != DSTATE_PRESCAN)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  /* Limit scan number to valid range */\n  if (scan_number <= 0)\n    scan_number = 1;\n  if (cinfo->inputctl->eoi_reached &&\n      scan_number > cinfo->input_scan_number)\n    scan_number = cinfo->input_scan_number;\n  cinfo->output_scan_number = scan_number;\n  /* Perform any dummy output passes, and set up for the real pass */\n  return output_pass_setup(cinfo);\n}\n\n\n/*\n * Finish up after an output pass in buffered-image mode.\n *\n * Returns FALSE if suspended.  The return value need be inspected only if\n * a suspending data source is used.\n */\n\nGLOBAL(boolean)\njpeg_finish_output (j_decompress_ptr cinfo)\n{\n  if ((cinfo->global_state == DSTATE_SCANNING ||\n       cinfo->global_state == DSTATE_RAW_OK) && cinfo->buffered_image) {\n    /* Terminate this pass. */\n    /* We do not require the whole pass to have been completed. */\n    (*cinfo->master->finish_output_pass) (cinfo);\n    cinfo->global_state = DSTATE_BUFPOST;\n  } else if (cinfo->global_state != DSTATE_BUFPOST) {\n    /* BUFPOST = repeat call after a suspension, anything else is error */\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  }\n  /* Read markers looking for SOS or EOI */\n  while (cinfo->input_scan_number <= cinfo->output_scan_number &&\n\t ! cinfo->inputctl->eoi_reached) {\n    if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)\n      return FALSE;\t\t/* Suspend, come back later */\n  }\n  cinfo->global_state = DSTATE_BUFIMAGE;\n  return TRUE;\n}\n\n#endif /* D_MULTISCAN_FILES_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdarith.c",
    "content": "/*\n * jdarith.c\n *\n * Developed 1997-2009 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains portable arithmetic entropy decoding routines for JPEG\n * (implementing the ISO/IEC IS 10918-1 and CCITT Recommendation ITU-T T.81).\n *\n * Both sequential and progressive modes are supported in this single module.\n *\n * Suspension is not currently supported in this module.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Expanded entropy decoder object for arithmetic decoding. */\n\ntypedef struct {\n  struct jpeg_entropy_decoder pub; /* public fields */\n\n  INT32 c;       /* C register, base of coding interval + input bit buffer */\n  INT32 a;               /* A register, normalized size of coding interval */\n  int ct;     /* bit shift counter, # of bits left in bit buffer part of C */\n                                                         /* init: ct = -16 */\n                                                         /* run: ct = 0..7 */\n                                                         /* error: ct = -1 */\n  int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */\n  int dc_context[MAX_COMPS_IN_SCAN]; /* context index for DC conditioning */\n\n  unsigned int restarts_to_go;\t/* MCUs left in this restart interval */\n\n  /* Pointers to statistics areas (these workspaces have image lifespan) */\n  unsigned char * dc_stats[NUM_ARITH_TBLS];\n  unsigned char * ac_stats[NUM_ARITH_TBLS];\n\n  /* Statistics bin for coding with fixed probability 0.5 */\n  unsigned char fixed_bin[4];\n} arith_entropy_decoder;\n\ntypedef arith_entropy_decoder * arith_entropy_ptr;\n\n/* The following two definitions specify the allocation chunk size\n * for the statistics area.\n * According to sections F.1.4.4.1.3 and F.1.4.4.2, we need at least\n * 49 statistics bins for DC, and 245 statistics bins for AC coding.\n *\n * We use a compact representation with 1 byte per statistics bin,\n * thus the numbers directly represent byte sizes.\n * This 1 byte per statistics bin contains the meaning of the MPS\n * (more probable symbol) in the highest bit (mask 0x80), and the\n * index into the probability estimation state machine table\n * in the lower bits (mask 0x7F).\n */\n\n#define DC_STAT_BINS 64\n#define AC_STAT_BINS 256\n\n\nLOCAL(int)\nget_byte (j_decompress_ptr cinfo)\n/* Read next input byte; we do not support suspension in this module. */\n{\n  struct jpeg_source_mgr * src = cinfo->src;\n\n  if (src->bytes_in_buffer == 0)\n    if (! (*src->fill_input_buffer) (cinfo))\n      ERREXIT(cinfo, JERR_CANT_SUSPEND);\n  src->bytes_in_buffer--;\n  return GETJOCTET(*src->next_input_byte++);\n}\n\n\n/*\n * The core arithmetic decoding routine (common in JPEG and JBIG).\n * This needs to go as fast as possible.\n * Machine-dependent optimization facilities\n * are not utilized in this portable implementation.\n * However, this code should be fairly efficient and\n * may be a good base for further optimizations anyway.\n *\n * Return value is 0 or 1 (binary decision).\n *\n * Note: I've changed the handling of the code base & bit\n * buffer register C compared to other implementations\n * based on the standards layout & procedures.\n * While it also contains both the actual base of the\n * coding interval (16 bits) and the next-bits buffer,\n * the cut-point between these two parts is floating\n * (instead of fixed) with the bit shift counter CT.\n * Thus, we also need only one (variable instead of\n * fixed size) shift for the LPS/MPS decision, and\n * we can get away with any renormalization update\n * of C (except for new data insertion, of course).\n *\n * I've also introduced a new scheme for accessing\n * the probability estimation state machine table,\n * derived from Markus Kuhn's JBIG implementation.\n */\n\nLOCAL(int)\narith_decode (j_decompress_ptr cinfo, unsigned char *st)\n{\n  register arith_entropy_ptr e = (arith_entropy_ptr) cinfo->entropy;\n  register unsigned char nl, nm;\n  register INT32 qe, temp;\n  register int sv, data;\n\n  /* Renormalization & data input per section D.2.6 */\n  while (e->a < 0x8000L) {\n    if (--e->ct < 0) {\n      /* Need to fetch next data byte */\n      if (cinfo->unread_marker)\n\tdata = 0;\t\t/* stuff zero data */\n      else {\n\tdata = get_byte(cinfo);\t/* read next input byte */\n\tif (data == 0xFF) {\t/* zero stuff or marker code */\n\t  do data = get_byte(cinfo);\n\t  while (data == 0xFF);\t/* swallow extra 0xFF bytes */\n\t  if (data == 0)\n\t    data = 0xFF;\t/* discard stuffed zero byte */\n\t  else {\n\t    /* Note: Different from the Huffman decoder, hitting\n\t     * a marker while processing the compressed data\n\t     * segment is legal in arithmetic coding.\n\t     * The convention is to supply zero data\n\t     * then until decoding is complete.\n\t     */\n\t    cinfo->unread_marker = data;\n\t    data = 0;\n\t  }\n\t}\n      }\n      e->c = (e->c << 8) | data; /* insert data into C register */\n      if ((e->ct += 8) < 0)\t /* update bit shift counter */\n\t/* Need more initial bytes */\n\tif (++e->ct == 0)\n\t  /* Got 2 initial bytes -> re-init A and exit loop */\n\t  e->a = 0x8000L; /* => e->a = 0x10000L after loop exit */\n    }\n    e->a <<= 1;\n  }\n\n  /* Fetch values from our compact representation of Table D.2:\n   * Qe values and probability estimation state machine\n   */\n  sv = *st;\n  qe = jpeg_aritab[sv & 0x7F];\t/* => Qe_Value */\n  nl = qe & 0xFF; qe >>= 8;\t/* Next_Index_LPS + Switch_MPS */\n  nm = qe & 0xFF; qe >>= 8;\t/* Next_Index_MPS */\n\n  /* Decode & estimation procedures per sections D.2.4 & D.2.5 */\n  temp = e->a - qe;\n  e->a = temp;\n  temp <<= e->ct;\n  if (e->c >= temp) {\n    e->c -= temp;\n    /* Conditional LPS (less probable symbol) exchange */\n    if (e->a < qe) {\n      e->a = qe;\n      *st = (sv & 0x80) ^ nm;\t/* Estimate_after_MPS */\n    } else {\n      e->a = qe;\n      *st = (sv & 0x80) ^ nl;\t/* Estimate_after_LPS */\n      sv ^= 0x80;\t\t/* Exchange LPS/MPS */\n    }\n  } else if (e->a < 0x8000L) {\n    /* Conditional MPS (more probable symbol) exchange */\n    if (e->a < qe) {\n      *st = (sv & 0x80) ^ nl;\t/* Estimate_after_LPS */\n      sv ^= 0x80;\t\t/* Exchange LPS/MPS */\n    } else {\n      *st = (sv & 0x80) ^ nm;\t/* Estimate_after_MPS */\n    }\n  }\n\n  return sv >> 7;\n}\n\n\n/*\n * Check for a restart marker & resynchronize decoder.\n */\n\nLOCAL(void)\nprocess_restart (j_decompress_ptr cinfo)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  int ci;\n  jpeg_component_info * compptr;\n\n  /* Advance past the RSTn marker */\n  if (! (*cinfo->marker->read_restart_marker) (cinfo))\n    ERREXIT(cinfo, JERR_CANT_SUSPEND);\n\n  /* Re-initialize statistics areas */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    if (! cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) {\n      MEMZERO(entropy->dc_stats[compptr->dc_tbl_no], DC_STAT_BINS);\n      /* Reset DC predictions to 0 */\n      entropy->last_dc_val[ci] = 0;\n      entropy->dc_context[ci] = 0;\n    }\n    if (! cinfo->progressive_mode || cinfo->Ss) {\n      MEMZERO(entropy->ac_stats[compptr->ac_tbl_no], AC_STAT_BINS);\n    }\n  }\n\n  /* Reset arithmetic decoding variables */\n  entropy->c = 0;\n  entropy->a = 0;\n  entropy->ct = -16;\t/* force reading 2 initial bytes to fill C */\n\n  /* Reset restart counter */\n  entropy->restarts_to_go = cinfo->restart_interval;\n}\n\n\n/*\n * Arithmetic MCU decoding.\n * Each of these routines decodes and returns one MCU's worth of\n * arithmetic-compressed coefficients.\n * The coefficients are reordered from zigzag order into natural array order,\n * but are not dequantized.\n *\n * The i'th block of the MCU is stored into the block pointed to by\n * MCU_data[i].  WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER.\n */\n\n/*\n * MCU decoding for DC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\ndecode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  JBLOCKROW block;\n  unsigned char *st;\n  int blkn, ci, tbl, sign;\n  int v, m;\n\n  /* Process restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      process_restart(cinfo);\n    entropy->restarts_to_go--;\n  }\n\n  if (entropy->ct == -1) return TRUE;\t/* if error do nothing */\n\n  /* Outer loop handles each block in the MCU */\n\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    block = MCU_data[blkn];\n    ci = cinfo->MCU_membership[blkn];\n    tbl = cinfo->cur_comp_info[ci]->dc_tbl_no;\n\n    /* Sections F.2.4.1 & F.1.4.4.1: Decoding of DC coefficients */\n\n    /* Table F.4: Point to statistics bin S0 for DC coefficient coding */\n    st = entropy->dc_stats[tbl] + entropy->dc_context[ci];\n\n    /* Figure F.19: Decode_DC_DIFF */\n    if (arith_decode(cinfo, st) == 0)\n      entropy->dc_context[ci] = 0;\n    else {\n      /* Figure F.21: Decoding nonzero value v */\n      /* Figure F.22: Decoding the sign of v */\n      sign = arith_decode(cinfo, st + 1);\n      st += 2; st += sign;\n      /* Figure F.23: Decoding the magnitude category of v */\n      if ((m = arith_decode(cinfo, st)) != 0) {\n\tst = entropy->dc_stats[tbl] + 20;\t/* Table F.4: X1 = 20 */\n\twhile (arith_decode(cinfo, st)) {\n\t  if ((m <<= 1) == 0x8000) {\n\t    WARNMS(cinfo, JWRN_ARITH_BAD_CODE);\n\t    entropy->ct = -1;\t\t\t/* magnitude overflow */\n\t    return TRUE;\n\t  }\n\t  st += 1;\n\t}\n      }\n      /* Section F.1.4.4.1.2: Establish dc_context conditioning category */\n      if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))\n\tentropy->dc_context[ci] = 0;\t\t   /* zero diff category */\n      else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))\n\tentropy->dc_context[ci] = 12 + (sign * 4); /* large diff category */\n      else\n\tentropy->dc_context[ci] = 4 + (sign * 4);  /* small diff category */\n      v = m;\n      /* Figure F.24: Decoding the magnitude bit pattern of v */\n      st += 14;\n      while (m >>= 1)\n\tif (arith_decode(cinfo, st)) v |= m;\n      v += 1; if (sign) v = -v;\n      entropy->last_dc_val[ci] += v;\n    }\n\n    /* Scale and output the DC coefficient (assumes jpeg_natural_order[0]=0) */\n    (*block)[0] = (JCOEF) (entropy->last_dc_val[ci] << cinfo->Al);\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU decoding for AC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\ndecode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  JBLOCKROW block;\n  unsigned char *st;\n  int tbl, sign, k;\n  int v, m;\n\n  /* Process restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      process_restart(cinfo);\n    entropy->restarts_to_go--;\n  }\n\n  if (entropy->ct == -1) return TRUE;\t/* if error do nothing */\n\n  /* There is always only one block per MCU */\n  block = MCU_data[0];\n  tbl = cinfo->cur_comp_info[0]->ac_tbl_no;\n\n  /* Sections F.2.4.2 & F.1.4.4.2: Decoding of AC coefficients */\n\n  /* Figure F.20: Decode_AC_coefficients */\n  for (k = cinfo->Ss; k <= cinfo->Se; k++) {\n    st = entropy->ac_stats[tbl] + 3 * (k - 1);\n    if (arith_decode(cinfo, st)) break;\t\t/* EOB flag */\n    while (arith_decode(cinfo, st + 1) == 0) {\n      st += 3; k++;\n      if (k > cinfo->Se) {\n\tWARNMS(cinfo, JWRN_ARITH_BAD_CODE);\n\tentropy->ct = -1;\t\t\t/* spectral overflow */\n\treturn TRUE;\n      }\n    }\n    /* Figure F.21: Decoding nonzero value v */\n    /* Figure F.22: Decoding the sign of v */\n    sign = arith_decode(cinfo, entropy->fixed_bin);\n    st += 2;\n    /* Figure F.23: Decoding the magnitude category of v */\n    if ((m = arith_decode(cinfo, st)) != 0) {\n      if (arith_decode(cinfo, st)) {\n\tm <<= 1;\n\tst = entropy->ac_stats[tbl] +\n\t     (k <= cinfo->arith_ac_K[tbl] ? 189 : 217);\n\twhile (arith_decode(cinfo, st)) {\n\t  if ((m <<= 1) == 0x8000) {\n\t    WARNMS(cinfo, JWRN_ARITH_BAD_CODE);\n\t    entropy->ct = -1;\t\t\t/* magnitude overflow */\n\t    return TRUE;\n\t  }\n\t  st += 1;\n\t}\n      }\n    }\n    v = m;\n    /* Figure F.24: Decoding the magnitude bit pattern of v */\n    st += 14;\n    while (m >>= 1)\n      if (arith_decode(cinfo, st)) v |= m;\n    v += 1; if (sign) v = -v;\n    /* Scale and output coefficient in natural (dezigzagged) order */\n    (*block)[jpeg_natural_order[k]] = (JCOEF) (v << cinfo->Al);\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU decoding for DC successive approximation refinement scan.\n */\n\nMETHODDEF(boolean)\ndecode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  unsigned char *st;\n  int p1, blkn;\n\n  /* Process restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      process_restart(cinfo);\n    entropy->restarts_to_go--;\n  }\n\n  st = entropy->fixed_bin;\t/* use fixed probability estimation */\n  p1 = 1 << cinfo->Al;\t\t/* 1 in the bit position being coded */\n\n  /* Outer loop handles each block in the MCU */\n\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    /* Encoded data is simply the next bit of the two's-complement DC value */\n    if (arith_decode(cinfo, st))\n      MCU_data[blkn][0][0] |= p1;\n  }\n\n  return TRUE;\n}\n\n\n/*\n * MCU decoding for AC successive approximation refinement scan.\n */\n\nMETHODDEF(boolean)\ndecode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  JBLOCKROW block;\n  JCOEFPTR thiscoef;\n  unsigned char *st;\n  int tbl, k, kex;\n  int p1, m1;\n\n  /* Process restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      process_restart(cinfo);\n    entropy->restarts_to_go--;\n  }\n\n  if (entropy->ct == -1) return TRUE;\t/* if error do nothing */\n\n  /* There is always only one block per MCU */\n  block = MCU_data[0];\n  tbl = cinfo->cur_comp_info[0]->ac_tbl_no;\n\n  p1 = 1 << cinfo->Al;\t\t/* 1 in the bit position being coded */\n  m1 = (-1) << cinfo->Al;\t/* -1 in the bit position being coded */\n\n  /* Establish EOBx (previous stage end-of-block) index */\n  for (kex = cinfo->Se; kex > 0; kex--)\n    if ((*block)[jpeg_natural_order[kex]]) break;\n\n  for (k = cinfo->Ss; k <= cinfo->Se; k++) {\n    st = entropy->ac_stats[tbl] + 3 * (k - 1);\n    if (k > kex)\n      if (arith_decode(cinfo, st)) break;\t/* EOB flag */\n    for (;;) {\n      thiscoef = *block + jpeg_natural_order[k];\n      if (*thiscoef) {\t\t\t\t/* previously nonzero coef */\n\tif (arith_decode(cinfo, st + 2)) {\n\t  if (*thiscoef < 0)\n\t    *thiscoef += m1;\n\t  else\n\t    *thiscoef += p1;\n\t}\n\tbreak;\n      }\n      if (arith_decode(cinfo, st + 1)) {\t/* newly nonzero coef */\n\tif (arith_decode(cinfo, entropy->fixed_bin))\n\t  *thiscoef = m1;\n\telse\n\t  *thiscoef = p1;\n\tbreak;\n      }\n      st += 3; k++;\n      if (k > cinfo->Se) {\n\tWARNMS(cinfo, JWRN_ARITH_BAD_CODE);\n\tentropy->ct = -1;\t\t\t/* spectral overflow */\n\treturn TRUE;\n      }\n    }\n  }\n\n  return TRUE;\n}\n\n\n/*\n * Decode one MCU's worth of arithmetic-compressed coefficients.\n */\n\nMETHODDEF(boolean)\ndecode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  jpeg_component_info * compptr;\n  JBLOCKROW block;\n  unsigned char *st;\n  int blkn, ci, tbl, sign, k;\n  int v, m;\n\n  /* Process restart marker if needed */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      process_restart(cinfo);\n    entropy->restarts_to_go--;\n  }\n\n  if (entropy->ct == -1) return TRUE;\t/* if error do nothing */\n\n  /* Outer loop handles each block in the MCU */\n\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    block = MCU_data[blkn];\n    ci = cinfo->MCU_membership[blkn];\n    compptr = cinfo->cur_comp_info[ci];\n\n    /* Sections F.2.4.1 & F.1.4.4.1: Decoding of DC coefficients */\n\n    tbl = compptr->dc_tbl_no;\n\n    /* Table F.4: Point to statistics bin S0 for DC coefficient coding */\n    st = entropy->dc_stats[tbl] + entropy->dc_context[ci];\n\n    /* Figure F.19: Decode_DC_DIFF */\n    if (arith_decode(cinfo, st) == 0)\n      entropy->dc_context[ci] = 0;\n    else {\n      /* Figure F.21: Decoding nonzero value v */\n      /* Figure F.22: Decoding the sign of v */\n      sign = arith_decode(cinfo, st + 1);\n      st += 2; st += sign;\n      /* Figure F.23: Decoding the magnitude category of v */\n      if ((m = arith_decode(cinfo, st)) != 0) {\n\tst = entropy->dc_stats[tbl] + 20;\t/* Table F.4: X1 = 20 */\n\twhile (arith_decode(cinfo, st)) {\n\t  if ((m <<= 1) == 0x8000) {\n\t    WARNMS(cinfo, JWRN_ARITH_BAD_CODE);\n\t    entropy->ct = -1;\t\t\t/* magnitude overflow */\n\t    return TRUE;\n\t  }\n\t  st += 1;\n\t}\n      }\n      /* Section F.1.4.4.1.2: Establish dc_context conditioning category */\n      if (m < (int) ((1L << cinfo->arith_dc_L[tbl]) >> 1))\n\tentropy->dc_context[ci] = 0;\t\t   /* zero diff category */\n      else if (m > (int) ((1L << cinfo->arith_dc_U[tbl]) >> 1))\n\tentropy->dc_context[ci] = 12 + (sign * 4); /* large diff category */\n      else\n\tentropy->dc_context[ci] = 4 + (sign * 4);  /* small diff category */\n      v = m;\n      /* Figure F.24: Decoding the magnitude bit pattern of v */\n      st += 14;\n      while (m >>= 1)\n\tif (arith_decode(cinfo, st)) v |= m;\n      v += 1; if (sign) v = -v;\n      entropy->last_dc_val[ci] += v;\n    }\n\n    (*block)[0] = (JCOEF) entropy->last_dc_val[ci];\n\n    /* Sections F.2.4.2 & F.1.4.4.2: Decoding of AC coefficients */\n\n    tbl = compptr->ac_tbl_no;\n\n    /* Figure F.20: Decode_AC_coefficients */\n    for (k = 1; k <= DCTSIZE2 - 1; k++) {\n      st = entropy->ac_stats[tbl] + 3 * (k - 1);\n      if (arith_decode(cinfo, st)) break;\t/* EOB flag */\n      while (arith_decode(cinfo, st + 1) == 0) {\n\tst += 3; k++;\n\tif (k > DCTSIZE2 - 1) {\n\t  WARNMS(cinfo, JWRN_ARITH_BAD_CODE);\n\t  entropy->ct = -1;\t\t\t/* spectral overflow */\n\t  return TRUE;\n\t}\n      }\n      /* Figure F.21: Decoding nonzero value v */\n      /* Figure F.22: Decoding the sign of v */\n      sign = arith_decode(cinfo, entropy->fixed_bin);\n      st += 2;\n      /* Figure F.23: Decoding the magnitude category of v */\n      if ((m = arith_decode(cinfo, st)) != 0) {\n\tif (arith_decode(cinfo, st)) {\n\t  m <<= 1;\n\t  st = entropy->ac_stats[tbl] +\n\t       (k <= cinfo->arith_ac_K[tbl] ? 189 : 217);\n\t  while (arith_decode(cinfo, st)) {\n\t    if ((m <<= 1) == 0x8000) {\n\t      WARNMS(cinfo, JWRN_ARITH_BAD_CODE);\n\t      entropy->ct = -1;\t\t\t/* magnitude overflow */\n\t      return TRUE;\n\t    }\n\t    st += 1;\n\t  }\n\t}\n      }\n      v = m;\n      /* Figure F.24: Decoding the magnitude bit pattern of v */\n      st += 14;\n      while (m >>= 1)\n\tif (arith_decode(cinfo, st)) v |= m;\n      v += 1; if (sign) v = -v;\n      (*block)[jpeg_natural_order[k]] = (JCOEF) v;\n    }\n  }\n\n  return TRUE;\n}\n\n\n/*\n * Initialize for an arithmetic-compressed scan.\n */\n\nMETHODDEF(void)\nstart_pass (j_decompress_ptr cinfo)\n{\n  arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;\n  int ci, tbl;\n  jpeg_component_info * compptr;\n\n  if (cinfo->progressive_mode) {\n    /* Validate progressive scan parameters */\n    if (cinfo->Ss == 0) {\n      if (cinfo->Se != 0)\n\tgoto bad;\n    } else {\n      /* need not check Ss/Se < 0 since they came from unsigned bytes */\n      if (cinfo->Se < cinfo->Ss || cinfo->Se > DCTSIZE2 - 1)\n\tgoto bad;\n      /* AC scans may have only one component */\n      if (cinfo->comps_in_scan != 1)\n\tgoto bad;\n    }\n    if (cinfo->Ah != 0) {\n      /* Successive approximation refinement scan: must have Al = Ah-1. */\n      if (cinfo->Ah-1 != cinfo->Al)\n\tgoto bad;\n    }\n    if (cinfo->Al > 13) {\t/* need not check for < 0 */\n      bad:\n      ERREXIT4(cinfo, JERR_BAD_PROGRESSION,\n\t       cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al);\n    }\n    /* Update progression status, and verify that scan order is legal.\n     * Note that inter-scan inconsistencies are treated as warnings\n     * not fatal errors ... not clear if this is right way to behave.\n     */\n    for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n      int coefi, cindex = cinfo->cur_comp_info[ci]->component_index;\n      int *coef_bit_ptr = & cinfo->coef_bits[cindex][0];\n      if (cinfo->Ss && coef_bit_ptr[0] < 0) /* AC without prior DC scan */\n\tWARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);\n      for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) {\n\tint expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];\n\tif (cinfo->Ah != expected)\n\t  WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi);\n\tcoef_bit_ptr[coefi] = cinfo->Al;\n      }\n    }\n    /* Select MCU decoding routine */\n    if (cinfo->Ah == 0) {\n      if (cinfo->Ss == 0)\n\tentropy->pub.decode_mcu = decode_mcu_DC_first;\n      else\n\tentropy->pub.decode_mcu = decode_mcu_AC_first;\n    } else {\n      if (cinfo->Ss == 0)\n\tentropy->pub.decode_mcu = decode_mcu_DC_refine;\n      else\n\tentropy->pub.decode_mcu = decode_mcu_AC_refine;\n    }\n  } else {\n    /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG.\n     * This ought to be an error condition, but we make it a warning.\n     */\n    if (cinfo->Ss != 0 || cinfo->Ah != 0 || cinfo->Al != 0 ||\n\t(cinfo->Se < DCTSIZE2 && cinfo->Se != DCTSIZE2 - 1))\n      WARNMS(cinfo, JWRN_NOT_SEQUENTIAL);\n    /* Select MCU decoding routine */\n    entropy->pub.decode_mcu = decode_mcu;\n  }\n\n  /* Allocate & initialize requested statistics areas */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    if (! cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) {\n      tbl = compptr->dc_tbl_no;\n      if (tbl < 0 || tbl >= NUM_ARITH_TBLS)\n\tERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);\n      if (entropy->dc_stats[tbl] == NULL)\n\tentropy->dc_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)\n\t  ((j_common_ptr) cinfo, JPOOL_IMAGE, DC_STAT_BINS);\n      MEMZERO(entropy->dc_stats[tbl], DC_STAT_BINS);\n      /* Initialize DC predictions to 0 */\n      entropy->last_dc_val[ci] = 0;\n      entropy->dc_context[ci] = 0;\n    }\n    if (! cinfo->progressive_mode || cinfo->Ss) {\n      tbl = compptr->ac_tbl_no;\n      if (tbl < 0 || tbl >= NUM_ARITH_TBLS)\n\tERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);\n      if (entropy->ac_stats[tbl] == NULL)\n\tentropy->ac_stats[tbl] = (unsigned char *) (*cinfo->mem->alloc_small)\n\t  ((j_common_ptr) cinfo, JPOOL_IMAGE, AC_STAT_BINS);\n      MEMZERO(entropy->ac_stats[tbl], AC_STAT_BINS);\n    }\n  }\n\n  /* Initialize arithmetic decoding variables */\n  entropy->c = 0;\n  entropy->a = 0;\n  entropy->ct = -16;\t/* force reading 2 initial bytes to fill C */\n\n  /* Initialize restart counter */\n  entropy->restarts_to_go = cinfo->restart_interval;\n}\n\n\n/*\n * Module initialization routine for arithmetic entropy decoding.\n */\n\nGLOBAL(void)\njinit_arith_decoder (j_decompress_ptr cinfo)\n{\n  arith_entropy_ptr entropy;\n  int i;\n\n  entropy = (arith_entropy_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(arith_entropy_decoder));\n  cinfo->entropy = (struct jpeg_entropy_decoder *) entropy;\n  entropy->pub.start_pass = start_pass;\n\n  /* Mark tables unallocated */\n  for (i = 0; i < NUM_ARITH_TBLS; i++) {\n    entropy->dc_stats[i] = NULL;\n    entropy->ac_stats[i] = NULL;\n  }\n\n  /* Initialize index for fixed probability estimation */\n  entropy->fixed_bin[0] = 113;\n\n  if (cinfo->progressive_mode) {\n    /* Create progression status table */\n    int *coef_bit_ptr, ci;\n    cinfo->coef_bits = (int (*)[DCTSIZE2])\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  cinfo->num_components*DCTSIZE2*SIZEOF(int));\n    coef_bit_ptr = & cinfo->coef_bits[0][0];\n    for (ci = 0; ci < cinfo->num_components; ci++) \n      for (i = 0; i < DCTSIZE2; i++)\n\t*coef_bit_ptr++ = -1;\n  }\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdatadst-tj.c",
    "content": "/*\n * jdatadst-tj.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2009-2012 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2011, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains compression data destination routines for the case of\n * emitting JPEG data to memory or to a file (or any stdio stream).\n * While these routines are sufficient for most applications,\n * some will want to use a different destination manager.\n * IMPORTANT: we assume that fwrite() will correctly transcribe an array of\n * JOCTETs into 8-bit-wide elements on external storage.  If char is wider\n * than 8 bits on your machine, you may need to do some tweaking.\n */\n\n/* this is not a core library module, so it doesn't define JPEG_INTERNALS */\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jerror.h\"\n\n#ifndef HAVE_STDLIB_H\t\t/* <stdlib.h> should declare malloc(),free() */\nextern void * malloc JPP((size_t size));\nextern void free JPP((void *ptr));\n#endif\n\n\n#define OUTPUT_BUF_SIZE  4096\t/* choose an efficiently fwrite'able size */\n\n\n/* Expanded data destination object for memory output */\n\ntypedef struct {\n  struct jpeg_destination_mgr pub; /* public fields */\n\n  unsigned char ** outbuffer;\t/* target buffer */\n  unsigned long * outsize;\n  unsigned char * newbuffer;\t/* newly allocated buffer */\n  JOCTET * buffer;\t\t/* start of buffer */\n  size_t bufsize;\n  boolean alloc;\n} my_mem_destination_mgr;\n\ntypedef my_mem_destination_mgr * my_mem_dest_ptr;\n\n\n/*\n * Initialize destination --- called by jpeg_start_compress\n * before any data is actually written.\n */\n\nMETHODDEF(void)\ninit_mem_destination (j_compress_ptr cinfo)\n{\n  /* no work necessary here */\n}\n\n\n/*\n * Empty the output buffer --- called whenever buffer fills up.\n *\n * In typical applications, this should write the entire output buffer\n * (ignoring the current state of next_output_byte & free_in_buffer),\n * reset the pointer & count to the start of the buffer, and return TRUE\n * indicating that the buffer has been dumped.\n *\n * In applications that need to be able to suspend compression due to output\n * overrun, a FALSE return indicates that the buffer cannot be emptied now.\n * In this situation, the compressor will return to its caller (possibly with\n * an indication that it has not accepted all the supplied scanlines).  The\n * application should resume compression after it has made more room in the\n * output buffer.  Note that there are substantial restrictions on the use of\n * suspension --- see the documentation.\n *\n * When suspending, the compressor will back up to a convenient restart point\n * (typically the start of the current MCU). next_output_byte & free_in_buffer\n * indicate where the restart point will be if the current call returns FALSE.\n * Data beyond this point will be regenerated after resumption, so do not\n * write it out when emptying the buffer externally.\n */\n\nMETHODDEF(boolean)\nempty_mem_output_buffer (j_compress_ptr cinfo)\n{\n  size_t nextsize;\n  JOCTET * nextbuffer;\n  my_mem_dest_ptr dest = (my_mem_dest_ptr) cinfo->dest;\n\n  if (!dest->alloc) ERREXIT(cinfo, JERR_BUFFER_SIZE);\n\n  /* Try to allocate new buffer with double size */\n  nextsize = dest->bufsize * 2;\n  nextbuffer = (JOCTET *) malloc(nextsize);\n\n  if (nextbuffer == NULL)\n    ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10);\n\n  MEMCOPY(nextbuffer, dest->buffer, dest->bufsize);\n\n  if (dest->newbuffer != NULL)\n    free(dest->newbuffer);\n\n  dest->newbuffer = nextbuffer;\n\n  dest->pub.next_output_byte = nextbuffer + dest->bufsize;\n  dest->pub.free_in_buffer = dest->bufsize;\n\n  dest->buffer = nextbuffer;\n  dest->bufsize = nextsize;\n\n  return TRUE;\n}\n\n\n/*\n * Terminate destination --- called by jpeg_finish_compress\n * after all data has been written.  Usually needs to flush buffer.\n *\n * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding\n * application must deal with any cleanup that should happen even\n * for error exit.\n */\n\nMETHODDEF(void)\nterm_mem_destination (j_compress_ptr cinfo)\n{\n  my_mem_dest_ptr dest = (my_mem_dest_ptr) cinfo->dest;\n\n  if(dest->alloc) *dest->outbuffer = dest->buffer;\n  *dest->outsize = (unsigned long)(dest->bufsize - dest->pub.free_in_buffer);\n}\n\n\n/*\n * Prepare for output to a memory buffer.\n * The caller may supply an own initial buffer with appropriate size.\n * Otherwise, or when the actual data output exceeds the given size,\n * the library adapts the buffer size as necessary.\n * The standard library functions malloc/free are used for allocating\n * larger memory, so the buffer is available to the application after\n * finishing compression, and then the application is responsible for\n * freeing the requested memory.\n */\n\nGLOBAL(void)\njpeg_mem_dest_tj (j_compress_ptr cinfo,\n\t       unsigned char ** outbuffer, unsigned long * outsize,\n\t       boolean alloc)\n{\n  my_mem_dest_ptr dest;\n\n  if (outbuffer == NULL || outsize == NULL)\t/* sanity check */\n    ERREXIT(cinfo, JERR_BUFFER_SIZE);\n\n  /* The destination object is made permanent so that multiple JPEG images\n   * can be written to the same buffer without re-executing jpeg_mem_dest.\n   */\n  if (cinfo->dest == NULL) {\t/* first time for this JPEG object? */\n    cinfo->dest = (struct jpeg_destination_mgr *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n\t\t\t\t  SIZEOF(my_mem_destination_mgr));\n    dest = (my_mem_dest_ptr) cinfo->dest;\n    dest->newbuffer = NULL;\n  }\n\n  dest = (my_mem_dest_ptr) cinfo->dest;\n  dest->pub.init_destination = init_mem_destination;\n  dest->pub.empty_output_buffer = empty_mem_output_buffer;\n  dest->pub.term_destination = term_mem_destination;\n  dest->outbuffer = outbuffer;\n  dest->outsize = outsize;\n  dest->alloc = alloc;\n\n  if (*outbuffer == NULL || *outsize == 0) {\n    if (alloc) {\n      /* Allocate initial buffer */\n      dest->newbuffer = *outbuffer = (unsigned char *) malloc(OUTPUT_BUF_SIZE);\n      if (dest->newbuffer == NULL)\n        ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10);\n      *outsize = OUTPUT_BUF_SIZE;\n    }\n    else ERREXIT(cinfo, JERR_BUFFER_SIZE);\n  }\n\n  dest->pub.next_output_byte = dest->buffer = *outbuffer;\n  dest->pub.free_in_buffer = dest->bufsize = *outsize;\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdatadst.c",
    "content": "/*\n * jdatadst.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2009-2012 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2013, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains compression data destination routines for the case of\n * emitting JPEG data to memory or to a file (or any stdio stream).\n * While these routines are sufficient for most applications,\n * some will want to use a different destination manager.\n * IMPORTANT: we assume that fwrite() will correctly transcribe an array of\n * JOCTETs into 8-bit-wide elements on external storage.  If char is wider\n * than 8 bits on your machine, you may need to do some tweaking.\n */\n\n/* this is not a core library module, so it doesn't define JPEG_INTERNALS */\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jerror.h\"\n\n#ifndef HAVE_STDLIB_H\t\t/* <stdlib.h> should declare malloc(),free() */\nextern void * malloc JPP((size_t size));\nextern void free JPP((void *ptr));\n#endif\n\n\n/* Expanded data destination object for stdio output */\n\ntypedef struct {\n  struct jpeg_destination_mgr pub; /* public fields */\n\n  FILE * outfile;\t\t/* target stream */\n  JOCTET * buffer;\t\t/* start of buffer */\n} my_destination_mgr;\n\ntypedef my_destination_mgr * my_dest_ptr;\n\n#define OUTPUT_BUF_SIZE  4096\t/* choose an efficiently fwrite'able size */\n\n\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\n/* Expanded data destination object for memory output */\n\ntypedef struct {\n  struct jpeg_destination_mgr pub; /* public fields */\n\n  unsigned char ** outbuffer;\t/* target buffer */\n  unsigned long * outsize;\n  unsigned char * newbuffer;\t/* newly allocated buffer */\n  JOCTET * buffer;\t\t/* start of buffer */\n  size_t bufsize;\n} my_mem_destination_mgr;\n\ntypedef my_mem_destination_mgr * my_mem_dest_ptr;\n#endif\n\n\n/*\n * Initialize destination --- called by jpeg_start_compress\n * before any data is actually written.\n */\n\nMETHODDEF(void)\ninit_destination (j_compress_ptr cinfo)\n{\n  my_dest_ptr dest = (my_dest_ptr) cinfo->dest;\n\n  /* Allocate the output buffer --- it will be released when done with image */\n  dest->buffer = (JOCTET *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  OUTPUT_BUF_SIZE * SIZEOF(JOCTET));\n\n  dest->pub.next_output_byte = dest->buffer;\n  dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;\n}\n\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\nMETHODDEF(void)\ninit_mem_destination (j_compress_ptr cinfo)\n{\n  /* no work necessary here */\n}\n#endif\n\n\n/*\n * Empty the output buffer --- called whenever buffer fills up.\n *\n * In typical applications, this should write the entire output buffer\n * (ignoring the current state of next_output_byte & free_in_buffer),\n * reset the pointer & count to the start of the buffer, and return TRUE\n * indicating that the buffer has been dumped.\n *\n * In applications that need to be able to suspend compression due to output\n * overrun, a FALSE return indicates that the buffer cannot be emptied now.\n * In this situation, the compressor will return to its caller (possibly with\n * an indication that it has not accepted all the supplied scanlines).  The\n * application should resume compression after it has made more room in the\n * output buffer.  Note that there are substantial restrictions on the use of\n * suspension --- see the documentation.\n *\n * When suspending, the compressor will back up to a convenient restart point\n * (typically the start of the current MCU). next_output_byte & free_in_buffer\n * indicate where the restart point will be if the current call returns FALSE.\n * Data beyond this point will be regenerated after resumption, so do not\n * write it out when emptying the buffer externally.\n */\n\nMETHODDEF(boolean)\nempty_output_buffer (j_compress_ptr cinfo)\n{\n  my_dest_ptr dest = (my_dest_ptr) cinfo->dest;\n\n  if (JFWRITE(dest->outfile, dest->buffer, OUTPUT_BUF_SIZE) !=\n      (size_t) OUTPUT_BUF_SIZE)\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n\n  dest->pub.next_output_byte = dest->buffer;\n  dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;\n\n  return TRUE;\n}\n\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\nMETHODDEF(boolean)\nempty_mem_output_buffer (j_compress_ptr cinfo)\n{\n  size_t nextsize;\n  JOCTET * nextbuffer;\n  my_mem_dest_ptr dest = (my_mem_dest_ptr) cinfo->dest;\n\n  /* Try to allocate new buffer with double size */\n  nextsize = dest->bufsize * 2;\n  nextbuffer = (JOCTET *) malloc(nextsize);\n\n  if (nextbuffer == NULL)\n    ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10);\n\n  MEMCOPY(nextbuffer, dest->buffer, dest->bufsize);\n\n  if (dest->newbuffer != NULL)\n    free(dest->newbuffer);\n\n  dest->newbuffer = nextbuffer;\n\n  dest->pub.next_output_byte = nextbuffer + dest->bufsize;\n  dest->pub.free_in_buffer = dest->bufsize;\n\n  dest->buffer = nextbuffer;\n  dest->bufsize = nextsize;\n\n  return TRUE;\n}\n#endif\n\n\n/*\n * Terminate destination --- called by jpeg_finish_compress\n * after all data has been written.  Usually needs to flush buffer.\n *\n * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding\n * application must deal with any cleanup that should happen even\n * for error exit.\n */\n\nMETHODDEF(void)\nterm_destination (j_compress_ptr cinfo)\n{\n  my_dest_ptr dest = (my_dest_ptr) cinfo->dest;\n  size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer;\n\n  /* Write any data remaining in the buffer */\n  if (datacount > 0) {\n    if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount)\n      ERREXIT(cinfo, JERR_FILE_WRITE);\n  }\n  fflush(dest->outfile);\n  /* Make sure we wrote the output file OK */\n  if (ferror(dest->outfile))\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n}\n\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\nMETHODDEF(void)\nterm_mem_destination (j_compress_ptr cinfo)\n{\n  my_mem_dest_ptr dest = (my_mem_dest_ptr) cinfo->dest;\n\n  *dest->outbuffer = dest->buffer;\n  *dest->outsize = (unsigned long)(dest->bufsize - dest->pub.free_in_buffer);\n}\n#endif\n\n\n/*\n * Prepare for output to a stdio stream.\n * The caller must have already opened the stream, and is responsible\n * for closing it after finishing compression.\n */\n\nGLOBAL(void)\njpeg_stdio_dest (j_compress_ptr cinfo, FILE * outfile)\n{\n  my_dest_ptr dest;\n\n  /* The destination object is made permanent so that multiple JPEG images\n   * can be written to the same file without re-executing jpeg_stdio_dest.\n   * This makes it dangerous to use this manager and a different destination\n   * manager serially with the same JPEG object, because their private object\n   * sizes may be different.  Caveat programmer.\n   */\n  if (cinfo->dest == NULL) {\t/* first time for this JPEG object? */\n    cinfo->dest = (struct jpeg_destination_mgr *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n\t\t\t\t  SIZEOF(my_destination_mgr));\n  }\n\n  dest = (my_dest_ptr) cinfo->dest;\n  dest->pub.init_destination = init_destination;\n  dest->pub.empty_output_buffer = empty_output_buffer;\n  dest->pub.term_destination = term_destination;\n  dest->outfile = outfile;\n}\n\n\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\n/*\n * Prepare for output to a memory buffer.\n * The caller may supply an own initial buffer with appropriate size.\n * Otherwise, or when the actual data output exceeds the given size,\n * the library adapts the buffer size as necessary.\n * The standard library functions malloc/free are used for allocating\n * larger memory, so the buffer is available to the application after\n * finishing compression, and then the application is responsible for\n * freeing the requested memory.\n */\n\nGLOBAL(void)\njpeg_mem_dest (j_compress_ptr cinfo,\n\t       unsigned char ** outbuffer, unsigned long * outsize)\n{\n  my_mem_dest_ptr dest;\n\n  if (outbuffer == NULL || outsize == NULL)\t/* sanity check */\n    ERREXIT(cinfo, JERR_BUFFER_SIZE);\n\n  /* The destination object is made permanent so that multiple JPEG images\n   * can be written to the same buffer without re-executing jpeg_mem_dest.\n   */\n  if (cinfo->dest == NULL) {\t/* first time for this JPEG object? */\n    cinfo->dest = (struct jpeg_destination_mgr *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n\t\t\t\t  SIZEOF(my_mem_destination_mgr));\n  }\n\n  dest = (my_mem_dest_ptr) cinfo->dest;\n  dest->pub.init_destination = init_mem_destination;\n  dest->pub.empty_output_buffer = empty_mem_output_buffer;\n  dest->pub.term_destination = term_mem_destination;\n  dest->outbuffer = outbuffer;\n  dest->outsize = outsize;\n  dest->newbuffer = NULL;\n\n  if (*outbuffer == NULL || *outsize == 0) {\n    /* Allocate initial buffer */\n    dest->newbuffer = *outbuffer = (unsigned char *) malloc(OUTPUT_BUF_SIZE);\n    if (dest->newbuffer == NULL)\n      ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10);\n    *outsize = OUTPUT_BUF_SIZE;\n  }\n\n  dest->pub.next_output_byte = dest->buffer = *outbuffer;\n  dest->pub.free_in_buffer = dest->bufsize = *outsize;\n}\n#endif\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdatasrc-tj.c",
    "content": "/*\n * jdatasrc-tj.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2009-2011 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2011, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains decompression data source routines for the case of\n * reading JPEG data from memory or from a file (or any stdio stream).\n * While these routines are sufficient for most applications,\n * some will want to use a different source manager.\n * IMPORTANT: we assume that fread() will correctly transcribe an array of\n * JOCTETs from 8-bit-wide elements on external storage.  If char is wider\n * than 8 bits on your machine, you may need to do some tweaking.\n */\n\n/* this is not a core library module, so it doesn't define JPEG_INTERNALS */\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jerror.h\"\n\n\n/*\n * Initialize source --- called by jpeg_read_header\n * before any data is actually read.\n */\n\nMETHODDEF(void)\ninit_mem_source (j_decompress_ptr cinfo)\n{\n  /* no work necessary here */\n}\n\n\n/*\n * Fill the input buffer --- called whenever buffer is emptied.\n *\n * In typical applications, this should read fresh data into the buffer\n * (ignoring the current state of next_input_byte & bytes_in_buffer),\n * reset the pointer & count to the start of the buffer, and return TRUE\n * indicating that the buffer has been reloaded.  It is not necessary to\n * fill the buffer entirely, only to obtain at least one more byte.\n *\n * There is no such thing as an EOF return.  If the end of the file has been\n * reached, the routine has a choice of ERREXIT() or inserting fake data into\n * the buffer.  In most cases, generating a warning message and inserting a\n * fake EOI marker is the best course of action --- this will allow the\n * decompressor to output however much of the image is there.  However,\n * the resulting error message is misleading if the real problem is an empty\n * input file, so we handle that case specially.\n *\n * In applications that need to be able to suspend compression due to input\n * not being available yet, a FALSE return indicates that no more data can be\n * obtained right now, but more may be forthcoming later.  In this situation,\n * the decompressor will return to its caller (with an indication of the\n * number of scanlines it has read, if any).  The application should resume\n * decompression after it has loaded more data into the input buffer.  Note\n * that there are substantial restrictions on the use of suspension --- see\n * the documentation.\n *\n * When suspending, the decompressor will back up to a convenient restart point\n * (typically the start of the current MCU). next_input_byte & bytes_in_buffer\n * indicate where the restart point will be if the current call returns FALSE.\n * Data beyond this point must be rescanned after resumption, so move it to\n * the front of the buffer rather than discarding it.\n */\n\nMETHODDEF(boolean)\nfill_mem_input_buffer (j_decompress_ptr cinfo)\n{\n  static const JOCTET mybuffer[4] = {\n    (JOCTET) 0xFF, (JOCTET) JPEG_EOI, 0, 0\n  };\n\n  /* The whole JPEG data is expected to reside in the supplied memory\n   * buffer, so any request for more data beyond the given buffer size\n   * is treated as an error.\n   */\n  WARNMS(cinfo, JWRN_JPEG_EOF);\n\n  /* Insert a fake EOI marker */\n\n  cinfo->src->next_input_byte = mybuffer;\n  cinfo->src->bytes_in_buffer = 2;\n\n  return TRUE;\n}\n\n\n/*\n * Skip data --- used to skip over a potentially large amount of\n * uninteresting data (such as an APPn marker).\n *\n * Writers of suspendable-input applications must note that skip_input_data\n * is not granted the right to give a suspension return.  If the skip extends\n * beyond the data currently in the buffer, the buffer can be marked empty so\n * that the next read will cause a fill_input_buffer call that can suspend.\n * Arranging for additional bytes to be discarded before reloading the input\n * buffer is the application writer's problem.\n */\n\nMETHODDEF(void)\nskip_input_data (j_decompress_ptr cinfo, long num_bytes)\n{\n  struct jpeg_source_mgr * src = cinfo->src;\n\n  /* Just a dumb implementation for now.  Could use fseek() except\n   * it doesn't work on pipes.  Not clear that being smart is worth\n   * any trouble anyway --- large skips are infrequent.\n   */\n  if (num_bytes > 0) {\n    while (num_bytes > (long) src->bytes_in_buffer) {\n      num_bytes -= (long) src->bytes_in_buffer;\n      (void) (*src->fill_input_buffer) (cinfo);\n      /* note we assume that fill_input_buffer will never return FALSE,\n       * so suspension need not be handled.\n       */\n    }\n    src->next_input_byte += (size_t) num_bytes;\n    src->bytes_in_buffer -= (size_t) num_bytes;\n  }\n}\n\n\n/*\n * An additional method that can be provided by data source modules is the\n * resync_to_restart method for error recovery in the presence of RST markers.\n * For the moment, this source module just uses the default resync method\n * provided by the JPEG library.  That method assumes that no backtracking\n * is possible.\n */\n\n\n/*\n * Terminate source --- called by jpeg_finish_decompress\n * after all data has been read.  Often a no-op.\n *\n * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding\n * application must deal with any cleanup that should happen even\n * for error exit.\n */\n\nMETHODDEF(void)\nterm_source (j_decompress_ptr cinfo)\n{\n  /* no work necessary here */\n}\n\n\n/*\n * Prepare for input from a supplied memory buffer.\n * The buffer must contain the whole JPEG data.\n */\n\nGLOBAL(void)\njpeg_mem_src_tj (j_decompress_ptr cinfo,\n\t      unsigned char * inbuffer, unsigned long insize)\n{\n  struct jpeg_source_mgr * src;\n\n  if (inbuffer == NULL || insize == 0)\t/* Treat empty input as fatal error */\n    ERREXIT(cinfo, JERR_INPUT_EMPTY);\n\n  /* The source object is made permanent so that a series of JPEG images\n   * can be read from the same buffer by calling jpeg_mem_src only before\n   * the first one.\n   */\n  if (cinfo->src == NULL) {\t/* first time for this JPEG object? */\n    cinfo->src = (struct jpeg_source_mgr *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n\t\t\t\t  SIZEOF(struct jpeg_source_mgr));\n  }\n\n  src = cinfo->src;\n  src->init_source = init_mem_source;\n  src->fill_input_buffer = fill_mem_input_buffer;\n  src->skip_input_data = skip_input_data;\n  src->resync_to_restart = jpeg_resync_to_restart; /* use default method */\n  src->term_source = term_source;\n  src->bytes_in_buffer = (size_t) insize;\n  src->next_input_byte = (JOCTET *) inbuffer;\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdatasrc.c",
    "content": "/*\n * jdatasrc.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2009-2011 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2013, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains decompression data source routines for the case of\n * reading JPEG data from memory or from a file (or any stdio stream).\n * While these routines are sufficient for most applications,\n * some will want to use a different source manager.\n * IMPORTANT: we assume that fread() will correctly transcribe an array of\n * JOCTETs from 8-bit-wide elements on external storage.  If char is wider\n * than 8 bits on your machine, you may need to do some tweaking.\n */\n\n/* this is not a core library module, so it doesn't define JPEG_INTERNALS */\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jerror.h\"\n\n\n/* Expanded data source object for stdio input */\n\ntypedef struct {\n  struct jpeg_source_mgr pub;\t/* public fields */\n\n  FILE * infile;\t\t/* source stream */\n  JOCTET * buffer;\t\t/* start of buffer */\n  boolean start_of_file;\t/* have we gotten any data yet? */\n} my_source_mgr;\n\ntypedef my_source_mgr * my_src_ptr;\n\n#define INPUT_BUF_SIZE  4096\t/* choose an efficiently fread'able size */\n\n\n/*\n * Initialize source --- called by jpeg_read_header\n * before any data is actually read.\n */\n\nMETHODDEF(void)\ninit_source (j_decompress_ptr cinfo)\n{\n  my_src_ptr src = (my_src_ptr) cinfo->src;\n\n  /* We reset the empty-input-file flag for each image,\n   * but we don't clear the input buffer.\n   * This is correct behavior for reading a series of images from one source.\n   */\n  src->start_of_file = TRUE;\n}\n\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\nMETHODDEF(void)\ninit_mem_source (j_decompress_ptr cinfo)\n{\n  /* no work necessary here */\n}\n#endif\n\n\n/*\n * Fill the input buffer --- called whenever buffer is emptied.\n *\n * In typical applications, this should read fresh data into the buffer\n * (ignoring the current state of next_input_byte & bytes_in_buffer),\n * reset the pointer & count to the start of the buffer, and return TRUE\n * indicating that the buffer has been reloaded.  It is not necessary to\n * fill the buffer entirely, only to obtain at least one more byte.\n *\n * There is no such thing as an EOF return.  If the end of the file has been\n * reached, the routine has a choice of ERREXIT() or inserting fake data into\n * the buffer.  In most cases, generating a warning message and inserting a\n * fake EOI marker is the best course of action --- this will allow the\n * decompressor to output however much of the image is there.  However,\n * the resulting error message is misleading if the real problem is an empty\n * input file, so we handle that case specially.\n *\n * In applications that need to be able to suspend compression due to input\n * not being available yet, a FALSE return indicates that no more data can be\n * obtained right now, but more may be forthcoming later.  In this situation,\n * the decompressor will return to its caller (with an indication of the\n * number of scanlines it has read, if any).  The application should resume\n * decompression after it has loaded more data into the input buffer.  Note\n * that there are substantial restrictions on the use of suspension --- see\n * the documentation.\n *\n * When suspending, the decompressor will back up to a convenient restart point\n * (typically the start of the current MCU). next_input_byte & bytes_in_buffer\n * indicate where the restart point will be if the current call returns FALSE.\n * Data beyond this point must be rescanned after resumption, so move it to\n * the front of the buffer rather than discarding it.\n */\n\nMETHODDEF(boolean)\nfill_input_buffer (j_decompress_ptr cinfo)\n{\n  my_src_ptr src = (my_src_ptr) cinfo->src;\n  size_t nbytes;\n\n  nbytes = JFREAD(src->infile, src->buffer, INPUT_BUF_SIZE);\n\n  if (nbytes <= 0) {\n    if (src->start_of_file)\t/* Treat empty input file as fatal error */\n      ERREXIT(cinfo, JERR_INPUT_EMPTY);\n    WARNMS(cinfo, JWRN_JPEG_EOF);\n    /* Insert a fake EOI marker */\n    src->buffer[0] = (JOCTET) 0xFF;\n    src->buffer[1] = (JOCTET) JPEG_EOI;\n    nbytes = 2;\n  }\n\n  src->pub.next_input_byte = src->buffer;\n  src->pub.bytes_in_buffer = nbytes;\n  src->start_of_file = FALSE;\n\n  return TRUE;\n}\n\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\nMETHODDEF(boolean)\nfill_mem_input_buffer (j_decompress_ptr cinfo)\n{\n  static const JOCTET mybuffer[4] = {\n    (JOCTET) 0xFF, (JOCTET) JPEG_EOI, 0, 0\n  };\n\n  /* The whole JPEG data is expected to reside in the supplied memory\n   * buffer, so any request for more data beyond the given buffer size\n   * is treated as an error.\n   */\n  WARNMS(cinfo, JWRN_JPEG_EOF);\n\n  /* Insert a fake EOI marker */\n\n  cinfo->src->next_input_byte = mybuffer;\n  cinfo->src->bytes_in_buffer = 2;\n\n  return TRUE;\n}\n#endif\n\n\n/*\n * Skip data --- used to skip over a potentially large amount of\n * uninteresting data (such as an APPn marker).\n *\n * Writers of suspendable-input applications must note that skip_input_data\n * is not granted the right to give a suspension return.  If the skip extends\n * beyond the data currently in the buffer, the buffer can be marked empty so\n * that the next read will cause a fill_input_buffer call that can suspend.\n * Arranging for additional bytes to be discarded before reloading the input\n * buffer is the application writer's problem.\n */\n\nMETHODDEF(void)\nskip_input_data (j_decompress_ptr cinfo, long num_bytes)\n{\n  struct jpeg_source_mgr * src = cinfo->src;\n\n  /* Just a dumb implementation for now.  Could use fseek() except\n   * it doesn't work on pipes.  Not clear that being smart is worth\n   * any trouble anyway --- large skips are infrequent.\n   */\n  if (num_bytes > 0) {\n    while (num_bytes > (long) src->bytes_in_buffer) {\n      num_bytes -= (long) src->bytes_in_buffer;\n      (void) (*src->fill_input_buffer) (cinfo);\n      /* note we assume that fill_input_buffer will never return FALSE,\n       * so suspension need not be handled.\n       */\n    }\n    src->next_input_byte += (size_t) num_bytes;\n    src->bytes_in_buffer -= (size_t) num_bytes;\n  }\n}\n\n\n/*\n * An additional method that can be provided by data source modules is the\n * resync_to_restart method for error recovery in the presence of RST markers.\n * For the moment, this source module just uses the default resync method\n * provided by the JPEG library.  That method assumes that no backtracking\n * is possible.\n */\n\n\n/*\n * Terminate source --- called by jpeg_finish_decompress\n * after all data has been read.  Often a no-op.\n *\n * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding\n * application must deal with any cleanup that should happen even\n * for error exit.\n */\n\nMETHODDEF(void)\nterm_source (j_decompress_ptr cinfo)\n{\n  /* no work necessary here */\n}\n\n\n/*\n * Prepare for input from a stdio stream.\n * The caller must have already opened the stream, and is responsible\n * for closing it after finishing decompression.\n */\n\nGLOBAL(void)\njpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile)\n{\n  my_src_ptr src;\n\n  /* The source object and input buffer are made permanent so that a series\n   * of JPEG images can be read from the same file by calling jpeg_stdio_src\n   * only before the first one.  (If we discarded the buffer at the end of\n   * one image, we'd likely lose the start of the next one.)\n   * This makes it unsafe to use this manager and a different source\n   * manager serially with the same JPEG object.  Caveat programmer.\n   */\n  if (cinfo->src == NULL) {\t/* first time for this JPEG object? */\n    cinfo->src = (struct jpeg_source_mgr *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n\t\t\t\t  SIZEOF(my_source_mgr));\n    src = (my_src_ptr) cinfo->src;\n    src->buffer = (JOCTET *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n\t\t\t\t  INPUT_BUF_SIZE * SIZEOF(JOCTET));\n  }\n\n  src = (my_src_ptr) cinfo->src;\n  src->pub.init_source = init_source;\n  src->pub.fill_input_buffer = fill_input_buffer;\n  src->pub.skip_input_data = skip_input_data;\n  src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */\n  src->pub.term_source = term_source;\n  src->infile = infile;\n  src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */\n  src->pub.next_input_byte = NULL; /* until buffer loaded */\n}\n\n\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\n/*\n * Prepare for input from a supplied memory buffer.\n * The buffer must contain the whole JPEG data.\n */\n\nGLOBAL(void)\njpeg_mem_src (j_decompress_ptr cinfo,\n\t      unsigned char * inbuffer, unsigned long insize)\n{\n  struct jpeg_source_mgr * src;\n\n  if (inbuffer == NULL || insize == 0)\t/* Treat empty input as fatal error */\n    ERREXIT(cinfo, JERR_INPUT_EMPTY);\n\n  /* The source object is made permanent so that a series of JPEG images\n   * can be read from the same buffer by calling jpeg_mem_src only before\n   * the first one.\n   */\n  if (cinfo->src == NULL) {\t/* first time for this JPEG object? */\n    cinfo->src = (struct jpeg_source_mgr *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n\t\t\t\t  SIZEOF(struct jpeg_source_mgr));\n  }\n\n  src = cinfo->src;\n  src->init_source = init_mem_source;\n  src->fill_input_buffer = fill_mem_input_buffer;\n  src->skip_input_data = skip_input_data;\n  src->resync_to_restart = jpeg_resync_to_restart; /* use default method */\n  src->term_source = term_source;\n  src->bytes_in_buffer = (size_t) insize;\n  src->next_input_byte = (JOCTET *) inbuffer;\n}\n#endif\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdcoefct.c",
    "content": "/*\n * jdcoefct.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains the coefficient buffer controller for decompression.\n * This controller is the top level of the JPEG decompressor proper.\n * The coefficient buffer lies between entropy decoding and inverse-DCT steps.\n *\n * In buffered-image mode, this controller is the interface between\n * input-oriented processing and output-oriented processing.\n * Also, the input side (only) is used when reading a file for transcoding.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jpegcomp.h\"\n\n/* Block smoothing is only applicable for progressive JPEG, so: */\n#ifndef D_PROGRESSIVE_SUPPORTED\n#undef BLOCK_SMOOTHING_SUPPORTED\n#endif\n\n/* Private buffer controller object */\n\ntypedef struct {\n  struct jpeg_d_coef_controller pub; /* public fields */\n\n  /* These variables keep track of the current location of the input side. */\n  /* cinfo->input_iMCU_row is also used for this. */\n  JDIMENSION MCU_ctr;\t\t/* counts MCUs processed in current row */\n  int MCU_vert_offset;\t\t/* counts MCU rows within iMCU row */\n  int MCU_rows_per_iMCU_row;\t/* number of such rows needed */\n\n  /* The output side's location is represented by cinfo->output_iMCU_row. */\n\n  /* In single-pass modes, it's sufficient to buffer just one MCU.\n   * We allocate a workspace of D_MAX_BLOCKS_IN_MCU coefficient blocks,\n   * and let the entropy decoder write into that workspace each time.\n   * (On 80x86, the workspace is FAR even though it's not really very big;\n   * this is to keep the module interfaces unchanged when a large coefficient\n   * buffer is necessary.)\n   * In multi-pass modes, this array points to the current MCU's blocks\n   * within the virtual arrays; it is used only by the input side.\n   */\n  JBLOCKROW MCU_buffer[D_MAX_BLOCKS_IN_MCU];\n\n  /* Temporary workspace for one MCU */\n  JCOEF * workspace;\n\n#ifdef D_MULTISCAN_FILES_SUPPORTED\n  /* In multi-pass modes, we need a virtual block array for each component. */\n  jvirt_barray_ptr whole_image[MAX_COMPONENTS];\n#endif\n\n#ifdef BLOCK_SMOOTHING_SUPPORTED\n  /* When doing block smoothing, we latch coefficient Al values here */\n  int * coef_bits_latch;\n#define SAVED_COEFS  6\t\t/* we save coef_bits[0..5] */\n#endif\n} my_coef_controller;\n\ntypedef my_coef_controller * my_coef_ptr;\n\n/* Forward declarations */\nMETHODDEF(int) decompress_onepass\n\tJPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));\n#ifdef D_MULTISCAN_FILES_SUPPORTED\nMETHODDEF(int) decompress_data\n\tJPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));\n#endif\n#ifdef BLOCK_SMOOTHING_SUPPORTED\nLOCAL(boolean) smoothing_ok JPP((j_decompress_ptr cinfo));\nMETHODDEF(int) decompress_smooth_data\n\tJPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));\n#endif\n\n\nLOCAL(void)\nstart_iMCU_row (j_decompress_ptr cinfo)\n/* Reset within-iMCU-row counters for a new row (input side) */\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n\n  /* In an interleaved scan, an MCU row is the same as an iMCU row.\n   * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.\n   * But at the bottom of the image, process only what's left.\n   */\n  if (cinfo->comps_in_scan > 1) {\n    coef->MCU_rows_per_iMCU_row = 1;\n  } else {\n    if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows-1))\n      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;\n    else\n      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;\n  }\n\n  coef->MCU_ctr = 0;\n  coef->MCU_vert_offset = 0;\n}\n\n\n/*\n * Initialize for an input processing pass.\n */\n\nMETHODDEF(void)\nstart_input_pass (j_decompress_ptr cinfo)\n{\n  cinfo->input_iMCU_row = 0;\n  start_iMCU_row(cinfo);\n}\n\n\n/*\n * Initialize for an output processing pass.\n */\n\nMETHODDEF(void)\nstart_output_pass (j_decompress_ptr cinfo)\n{\n#ifdef BLOCK_SMOOTHING_SUPPORTED\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n\n  /* If multipass, check to see whether to use block smoothing on this pass */\n  if (coef->pub.coef_arrays != NULL) {\n    if (cinfo->do_block_smoothing && smoothing_ok(cinfo))\n      coef->pub.decompress_data = decompress_smooth_data;\n    else\n      coef->pub.decompress_data = decompress_data;\n  }\n#endif\n  cinfo->output_iMCU_row = 0;\n}\n\n\n/*\n * Decompress and return some data in the single-pass case.\n * Always attempts to emit one fully interleaved MCU row (\"iMCU\" row).\n * Input and output must run in lockstep since we have only a one-MCU buffer.\n * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.\n *\n * NB: output_buf contains a plane for each component in image,\n * which we index according to the component's SOF position.\n */\n\nMETHODDEF(int)\ndecompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION MCU_col_num;\t/* index of current MCU within row */\n  JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;\n  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;\n  int blkn, ci, xindex, yindex, yoffset, useful_width;\n  JSAMPARRAY output_ptr;\n  JDIMENSION start_col, output_col;\n  jpeg_component_info *compptr;\n  inverse_DCT_method_ptr inverse_DCT;\n\n  /* Loop to process as much as one whole iMCU row */\n  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;\n       yoffset++) {\n    for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col;\n\t MCU_col_num++) {\n      /* Try to fetch an MCU.  Entropy decoder expects buffer to be zeroed. */\n      jzero_far((void FAR *) coef->MCU_buffer[0],\n\t\t(size_t) (cinfo->blocks_in_MCU * SIZEOF(JBLOCK)));\n      if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {\n\t/* Suspension forced; update state counters and exit */\n\tcoef->MCU_vert_offset = yoffset;\n\tcoef->MCU_ctr = MCU_col_num;\n\treturn JPEG_SUSPENDED;\n      }\n      /* Determine where data should go in output_buf and do the IDCT thing.\n       * We skip dummy blocks at the right and bottom edges (but blkn gets\n       * incremented past them!).  Note the inner loop relies on having\n       * allocated the MCU_buffer[] blocks sequentially.\n       */\n      blkn = 0;\t\t\t/* index of current DCT block within MCU */\n      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n\tcompptr = cinfo->cur_comp_info[ci];\n\t/* Don't bother to IDCT an uninteresting component. */\n\tif (! compptr->component_needed) {\n\t  blkn += compptr->MCU_blocks;\n\t  continue;\n\t}\n\tinverse_DCT = cinfo->idct->inverse_DCT[compptr->component_index];\n\tuseful_width = (MCU_col_num < last_MCU_col) ? compptr->MCU_width\n\t\t\t\t\t\t    : compptr->last_col_width;\n\toutput_ptr = output_buf[compptr->component_index] +\n\t  yoffset * compptr->_DCT_scaled_size;\n\tstart_col = MCU_col_num * compptr->MCU_sample_width;\n\tfor (yindex = 0; yindex < compptr->MCU_height; yindex++) {\n\t  if (cinfo->input_iMCU_row < last_iMCU_row ||\n\t      yoffset+yindex < compptr->last_row_height) {\n\t    output_col = start_col;\n\t    for (xindex = 0; xindex < useful_width; xindex++) {\n\t      (*inverse_DCT) (cinfo, compptr,\n\t\t\t      (JCOEFPTR) coef->MCU_buffer[blkn+xindex],\n\t\t\t      output_ptr, output_col);\n\t      output_col += compptr->_DCT_scaled_size;\n\t    }\n\t  }\n\t  blkn += compptr->MCU_width;\n\t  output_ptr += compptr->_DCT_scaled_size;\n\t}\n      }\n    }\n    /* Completed an MCU row, but perhaps not an iMCU row */\n    coef->MCU_ctr = 0;\n  }\n  /* Completed the iMCU row, advance counters for next one */\n  cinfo->output_iMCU_row++;\n  if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {\n    start_iMCU_row(cinfo);\n    return JPEG_ROW_COMPLETED;\n  }\n  /* Completed the scan */\n  (*cinfo->inputctl->finish_input_pass) (cinfo);\n  return JPEG_SCAN_COMPLETED;\n}\n\n\n/*\n * Dummy consume-input routine for single-pass operation.\n */\n\nMETHODDEF(int)\ndummy_consume_data (j_decompress_ptr cinfo)\n{\n  return JPEG_SUSPENDED;\t/* Always indicate nothing was done */\n}\n\n\n#ifdef D_MULTISCAN_FILES_SUPPORTED\n\n/*\n * Consume input data and store it in the full-image coefficient buffer.\n * We read as much as one fully interleaved MCU row (\"iMCU\" row) per call,\n * ie, v_samp_factor block rows for each component in the scan.\n * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.\n */\n\nMETHODDEF(int)\nconsume_data (j_decompress_ptr cinfo)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION MCU_col_num;\t/* index of current MCU within row */\n  int blkn, ci, xindex, yindex, yoffset;\n  JDIMENSION start_col;\n  JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];\n  JBLOCKROW buffer_ptr;\n  jpeg_component_info *compptr;\n\n  /* Align the virtual buffers for the components used in this scan. */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    buffer[ci] = (*cinfo->mem->access_virt_barray)\n      ((j_common_ptr) cinfo, coef->whole_image[compptr->component_index],\n       cinfo->input_iMCU_row * compptr->v_samp_factor,\n       (JDIMENSION) compptr->v_samp_factor, TRUE);\n    /* Note: entropy decoder expects buffer to be zeroed,\n     * but this is handled automatically by the memory manager\n     * because we requested a pre-zeroed array.\n     */\n  }\n\n  /* Loop to process one whole iMCU row */\n  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;\n       yoffset++) {\n    for (MCU_col_num = coef->MCU_ctr; MCU_col_num < cinfo->MCUs_per_row;\n\t MCU_col_num++) {\n      /* Construct list of pointers to DCT blocks belonging to this MCU */\n      blkn = 0;\t\t\t/* index of current DCT block within MCU */\n      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n\tcompptr = cinfo->cur_comp_info[ci];\n\tstart_col = MCU_col_num * compptr->MCU_width;\n\tfor (yindex = 0; yindex < compptr->MCU_height; yindex++) {\n\t  buffer_ptr = buffer[ci][yindex+yoffset] + start_col;\n\t  for (xindex = 0; xindex < compptr->MCU_width; xindex++) {\n\t    coef->MCU_buffer[blkn++] = buffer_ptr++;\n\t  }\n\t}\n      }\n      /* Try to fetch the MCU. */\n      if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {\n\t/* Suspension forced; update state counters and exit */\n\tcoef->MCU_vert_offset = yoffset;\n\tcoef->MCU_ctr = MCU_col_num;\n\treturn JPEG_SUSPENDED;\n      }\n    }\n    /* Completed an MCU row, but perhaps not an iMCU row */\n    coef->MCU_ctr = 0;\n  }\n  /* Completed the iMCU row, advance counters for next one */\n  if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {\n    start_iMCU_row(cinfo);\n    return JPEG_ROW_COMPLETED;\n  }\n  /* Completed the scan */\n  (*cinfo->inputctl->finish_input_pass) (cinfo);\n  return JPEG_SCAN_COMPLETED;\n}\n\n\n/*\n * Decompress and return some data in the multi-pass case.\n * Always attempts to emit one fully interleaved MCU row (\"iMCU\" row).\n * Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.\n *\n * NB: output_buf contains a plane for each component in image.\n */\n\nMETHODDEF(int)\ndecompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;\n  JDIMENSION block_num;\n  int ci, block_row, block_rows;\n  JBLOCKARRAY buffer;\n  JBLOCKROW buffer_ptr;\n  JSAMPARRAY output_ptr;\n  JDIMENSION output_col;\n  jpeg_component_info *compptr;\n  inverse_DCT_method_ptr inverse_DCT;\n\n  /* Force some input to be done if we are getting ahead of the input. */\n  while (cinfo->input_scan_number < cinfo->output_scan_number ||\n\t (cinfo->input_scan_number == cinfo->output_scan_number &&\n\t  cinfo->input_iMCU_row <= cinfo->output_iMCU_row)) {\n    if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED)\n      return JPEG_SUSPENDED;\n  }\n\n  /* OK, output from the virtual arrays. */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Don't bother to IDCT an uninteresting component. */\n    if (! compptr->component_needed)\n      continue;\n    /* Align the virtual buffer for this component. */\n    buffer = (*cinfo->mem->access_virt_barray)\n      ((j_common_ptr) cinfo, coef->whole_image[ci],\n       cinfo->output_iMCU_row * compptr->v_samp_factor,\n       (JDIMENSION) compptr->v_samp_factor, FALSE);\n    /* Count non-dummy DCT block rows in this iMCU row. */\n    if (cinfo->output_iMCU_row < last_iMCU_row)\n      block_rows = compptr->v_samp_factor;\n    else {\n      /* NB: can't use last_row_height here; it is input-side-dependent! */\n      block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);\n      if (block_rows == 0) block_rows = compptr->v_samp_factor;\n    }\n    inverse_DCT = cinfo->idct->inverse_DCT[ci];\n    output_ptr = output_buf[ci];\n    /* Loop over all DCT blocks to be processed. */\n    for (block_row = 0; block_row < block_rows; block_row++) {\n      buffer_ptr = buffer[block_row];\n      output_col = 0;\n      for (block_num = 0; block_num < compptr->width_in_blocks; block_num++) {\n\t(*inverse_DCT) (cinfo, compptr, (JCOEFPTR) buffer_ptr,\n\t\t\toutput_ptr, output_col);\n\tbuffer_ptr++;\n\toutput_col += compptr->_DCT_scaled_size;\n      }\n      output_ptr += compptr->_DCT_scaled_size;\n    }\n  }\n\n  if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)\n    return JPEG_ROW_COMPLETED;\n  return JPEG_SCAN_COMPLETED;\n}\n\n#endif /* D_MULTISCAN_FILES_SUPPORTED */\n\n\n#ifdef BLOCK_SMOOTHING_SUPPORTED\n\n/*\n * This code applies interblock smoothing as described by section K.8\n * of the JPEG standard: the first 5 AC coefficients are estimated from\n * the DC values of a DCT block and its 8 neighboring blocks.\n * We apply smoothing only for progressive JPEG decoding, and only if\n * the coefficients it can estimate are not yet known to full precision.\n */\n\n/* Natural-order array positions of the first 5 zigzag-order coefficients */\n#define Q01_POS  1\n#define Q10_POS  8\n#define Q20_POS  16\n#define Q11_POS  9\n#define Q02_POS  2\n\n/*\n * Determine whether block smoothing is applicable and safe.\n * We also latch the current states of the coef_bits[] entries for the\n * AC coefficients; otherwise, if the input side of the decompressor\n * advances into a new scan, we might think the coefficients are known\n * more accurately than they really are.\n */\n\nLOCAL(boolean)\nsmoothing_ok (j_decompress_ptr cinfo)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  boolean smoothing_useful = FALSE;\n  int ci, coefi;\n  jpeg_component_info *compptr;\n  JQUANT_TBL * qtable;\n  int * coef_bits;\n  int * coef_bits_latch;\n\n  if (! cinfo->progressive_mode || cinfo->coef_bits == NULL)\n    return FALSE;\n\n  /* Allocate latch area if not already done */\n  if (coef->coef_bits_latch == NULL)\n    coef->coef_bits_latch = (int *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  cinfo->num_components *\n\t\t\t\t  (SAVED_COEFS * SIZEOF(int)));\n  coef_bits_latch = coef->coef_bits_latch;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* All components' quantization values must already be latched. */\n    if ((qtable = compptr->quant_table) == NULL)\n      return FALSE;\n    /* Verify DC & first 5 AC quantizers are nonzero to avoid zero-divide. */\n    if (qtable->quantval[0] == 0 ||\n\tqtable->quantval[Q01_POS] == 0 ||\n\tqtable->quantval[Q10_POS] == 0 ||\n\tqtable->quantval[Q20_POS] == 0 ||\n\tqtable->quantval[Q11_POS] == 0 ||\n\tqtable->quantval[Q02_POS] == 0)\n      return FALSE;\n    /* DC values must be at least partly known for all components. */\n    coef_bits = cinfo->coef_bits[ci];\n    if (coef_bits[0] < 0)\n      return FALSE;\n    /* Block smoothing is helpful if some AC coefficients remain inaccurate. */\n    for (coefi = 1; coefi <= 5; coefi++) {\n      coef_bits_latch[coefi] = coef_bits[coefi];\n      if (coef_bits[coefi] != 0)\n\tsmoothing_useful = TRUE;\n    }\n    coef_bits_latch += SAVED_COEFS;\n  }\n\n  return smoothing_useful;\n}\n\n\n/*\n * Variant of decompress_data for use when doing block smoothing.\n */\n\nMETHODDEF(int)\ndecompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)\n{\n  my_coef_ptr coef = (my_coef_ptr) cinfo->coef;\n  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;\n  JDIMENSION block_num, last_block_column;\n  int ci, block_row, block_rows, access_rows;\n  JBLOCKARRAY buffer;\n  JBLOCKROW buffer_ptr, prev_block_row, next_block_row;\n  JSAMPARRAY output_ptr;\n  JDIMENSION output_col;\n  jpeg_component_info *compptr;\n  inverse_DCT_method_ptr inverse_DCT;\n  boolean first_row, last_row;\n  JCOEF * workspace;\n  int *coef_bits;\n  JQUANT_TBL *quanttbl;\n  INT32 Q00,Q01,Q02,Q10,Q11,Q20, num;\n  int DC1,DC2,DC3,DC4,DC5,DC6,DC7,DC8,DC9;\n  int Al, pred;\n\n  /* Keep a local variable to avoid looking it up more than once */\n  workspace = coef->workspace;\n\n  /* Force some input to be done if we are getting ahead of the input. */\n  while (cinfo->input_scan_number <= cinfo->output_scan_number &&\n\t ! cinfo->inputctl->eoi_reached) {\n    if (cinfo->input_scan_number == cinfo->output_scan_number) {\n      /* If input is working on current scan, we ordinarily want it to\n       * have completed the current row.  But if input scan is DC,\n       * we want it to keep one row ahead so that next block row's DC\n       * values are up to date.\n       */\n      JDIMENSION delta = (cinfo->Ss == 0) ? 1 : 0;\n      if (cinfo->input_iMCU_row > cinfo->output_iMCU_row+delta)\n\tbreak;\n    }\n    if ((*cinfo->inputctl->consume_input)(cinfo) == JPEG_SUSPENDED)\n      return JPEG_SUSPENDED;\n  }\n\n  /* OK, output from the virtual arrays. */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Don't bother to IDCT an uninteresting component. */\n    if (! compptr->component_needed)\n      continue;\n    /* Count non-dummy DCT block rows in this iMCU row. */\n    if (cinfo->output_iMCU_row < last_iMCU_row) {\n      block_rows = compptr->v_samp_factor;\n      access_rows = block_rows * 2; /* this and next iMCU row */\n      last_row = FALSE;\n    } else {\n      /* NB: can't use last_row_height here; it is input-side-dependent! */\n      block_rows = (int) (compptr->height_in_blocks % compptr->v_samp_factor);\n      if (block_rows == 0) block_rows = compptr->v_samp_factor;\n      access_rows = block_rows; /* this iMCU row only */\n      last_row = TRUE;\n    }\n    /* Align the virtual buffer for this component. */\n    if (cinfo->output_iMCU_row > 0) {\n      access_rows += compptr->v_samp_factor; /* prior iMCU row too */\n      buffer = (*cinfo->mem->access_virt_barray)\n\t((j_common_ptr) cinfo, coef->whole_image[ci],\n\t (cinfo->output_iMCU_row - 1) * compptr->v_samp_factor,\n\t (JDIMENSION) access_rows, FALSE);\n      buffer += compptr->v_samp_factor;\t/* point to current iMCU row */\n      first_row = FALSE;\n    } else {\n      buffer = (*cinfo->mem->access_virt_barray)\n\t((j_common_ptr) cinfo, coef->whole_image[ci],\n\t (JDIMENSION) 0, (JDIMENSION) access_rows, FALSE);\n      first_row = TRUE;\n    }\n    /* Fetch component-dependent info */\n    coef_bits = coef->coef_bits_latch + (ci * SAVED_COEFS);\n    quanttbl = compptr->quant_table;\n    Q00 = quanttbl->quantval[0];\n    Q01 = quanttbl->quantval[Q01_POS];\n    Q10 = quanttbl->quantval[Q10_POS];\n    Q20 = quanttbl->quantval[Q20_POS];\n    Q11 = quanttbl->quantval[Q11_POS];\n    Q02 = quanttbl->quantval[Q02_POS];\n    inverse_DCT = cinfo->idct->inverse_DCT[ci];\n    output_ptr = output_buf[ci];\n    /* Loop over all DCT blocks to be processed. */\n    for (block_row = 0; block_row < block_rows; block_row++) {\n      buffer_ptr = buffer[block_row];\n      if (first_row && block_row == 0)\n\tprev_block_row = buffer_ptr;\n      else\n\tprev_block_row = buffer[block_row-1];\n      if (last_row && block_row == block_rows-1)\n\tnext_block_row = buffer_ptr;\n      else\n\tnext_block_row = buffer[block_row+1];\n      /* We fetch the surrounding DC values using a sliding-register approach.\n       * Initialize all nine here so as to do the right thing on narrow pics.\n       */\n      DC1 = DC2 = DC3 = (int) prev_block_row[0][0];\n      DC4 = DC5 = DC6 = (int) buffer_ptr[0][0];\n      DC7 = DC8 = DC9 = (int) next_block_row[0][0];\n      output_col = 0;\n      last_block_column = compptr->width_in_blocks - 1;\n      for (block_num = 0; block_num <= last_block_column; block_num++) {\n\t/* Fetch current DCT block into workspace so we can modify it. */\n\tjcopy_block_row(buffer_ptr, (JBLOCKROW) workspace, (JDIMENSION) 1);\n\t/* Update DC values */\n\tif (block_num < last_block_column) {\n\t  DC3 = (int) prev_block_row[1][0];\n\t  DC6 = (int) buffer_ptr[1][0];\n\t  DC9 = (int) next_block_row[1][0];\n\t}\n\t/* Compute coefficient estimates per K.8.\n\t * An estimate is applied only if coefficient is still zero,\n\t * and is not known to be fully accurate.\n\t */\n\t/* AC01 */\n\tif ((Al=coef_bits[1]) != 0 && workspace[1] == 0) {\n\t  num = 36 * Q00 * (DC4 - DC6);\n\t  if (num >= 0) {\n\t    pred = (int) (((Q01<<7) + num) / (Q01<<8));\n\t    if (Al > 0 && pred >= (1<<Al))\n\t      pred = (1<<Al)-1;\n\t  } else {\n\t    pred = (int) (((Q01<<7) - num) / (Q01<<8));\n\t    if (Al > 0 && pred >= (1<<Al))\n\t      pred = (1<<Al)-1;\n\t    pred = -pred;\n\t  }\n\t  workspace[1] = (JCOEF) pred;\n\t}\n\t/* AC10 */\n\tif ((Al=coef_bits[2]) != 0 && workspace[8] == 0) {\n\t  num = 36 * Q00 * (DC2 - DC8);\n\t  if (num >= 0) {\n\t    pred = (int) (((Q10<<7) + num) / (Q10<<8));\n\t    if (Al > 0 && pred >= (1<<Al))\n\t      pred = (1<<Al)-1;\n\t  } else {\n\t    pred = (int) (((Q10<<7) - num) / (Q10<<8));\n\t    if (Al > 0 && pred >= (1<<Al))\n\t      pred = (1<<Al)-1;\n\t    pred = -pred;\n\t  }\n\t  workspace[8] = (JCOEF) pred;\n\t}\n\t/* AC20 */\n\tif ((Al=coef_bits[3]) != 0 && workspace[16] == 0) {\n\t  num = 9 * Q00 * (DC2 + DC8 - 2*DC5);\n\t  if (num >= 0) {\n\t    pred = (int) (((Q20<<7) + num) / (Q20<<8));\n\t    if (Al > 0 && pred >= (1<<Al))\n\t      pred = (1<<Al)-1;\n\t  } else {\n\t    pred = (int) (((Q20<<7) - num) / (Q20<<8));\n\t    if (Al > 0 && pred >= (1<<Al))\n\t      pred = (1<<Al)-1;\n\t    pred = -pred;\n\t  }\n\t  workspace[16] = (JCOEF) pred;\n\t}\n\t/* AC11 */\n\tif ((Al=coef_bits[4]) != 0 && workspace[9] == 0) {\n\t  num = 5 * Q00 * (DC1 - DC3 - DC7 + DC9);\n\t  if (num >= 0) {\n\t    pred = (int) (((Q11<<7) + num) / (Q11<<8));\n\t    if (Al > 0 && pred >= (1<<Al))\n\t      pred = (1<<Al)-1;\n\t  } else {\n\t    pred = (int) (((Q11<<7) - num) / (Q11<<8));\n\t    if (Al > 0 && pred >= (1<<Al))\n\t      pred = (1<<Al)-1;\n\t    pred = -pred;\n\t  }\n\t  workspace[9] = (JCOEF) pred;\n\t}\n\t/* AC02 */\n\tif ((Al=coef_bits[5]) != 0 && workspace[2] == 0) {\n\t  num = 9 * Q00 * (DC4 + DC6 - 2*DC5);\n\t  if (num >= 0) {\n\t    pred = (int) (((Q02<<7) + num) / (Q02<<8));\n\t    if (Al > 0 && pred >= (1<<Al))\n\t      pred = (1<<Al)-1;\n\t  } else {\n\t    pred = (int) (((Q02<<7) - num) / (Q02<<8));\n\t    if (Al > 0 && pred >= (1<<Al))\n\t      pred = (1<<Al)-1;\n\t    pred = -pred;\n\t  }\n\t  workspace[2] = (JCOEF) pred;\n\t}\n\t/* OK, do the IDCT */\n\t(*inverse_DCT) (cinfo, compptr, (JCOEFPTR) workspace,\n\t\t\toutput_ptr, output_col);\n\t/* Advance for next column */\n\tDC1 = DC2; DC2 = DC3;\n\tDC4 = DC5; DC5 = DC6;\n\tDC7 = DC8; DC8 = DC9;\n\tbuffer_ptr++, prev_block_row++, next_block_row++;\n\toutput_col += compptr->_DCT_scaled_size;\n      }\n      output_ptr += compptr->_DCT_scaled_size;\n    }\n  }\n\n  if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)\n    return JPEG_ROW_COMPLETED;\n  return JPEG_SCAN_COMPLETED;\n}\n\n#endif /* BLOCK_SMOOTHING_SUPPORTED */\n\n\n/*\n * Initialize coefficient buffer controller.\n */\n\nGLOBAL(void)\njinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer)\n{\n  my_coef_ptr coef;\n\n  coef = (my_coef_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_coef_controller));\n  cinfo->coef = (struct jpeg_d_coef_controller *) coef;\n  coef->pub.start_input_pass = start_input_pass;\n  coef->pub.start_output_pass = start_output_pass;\n#ifdef BLOCK_SMOOTHING_SUPPORTED\n  coef->coef_bits_latch = NULL;\n#endif\n\n  /* Create the coefficient buffer. */\n  if (need_full_buffer) {\n#ifdef D_MULTISCAN_FILES_SUPPORTED\n    /* Allocate a full-image virtual array for each component, */\n    /* padded to a multiple of samp_factor DCT blocks in each direction. */\n    /* Note we ask for a pre-zeroed array. */\n    int ci, access_rows;\n    jpeg_component_info *compptr;\n\n    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n\t ci++, compptr++) {\n      access_rows = compptr->v_samp_factor;\n#ifdef BLOCK_SMOOTHING_SUPPORTED\n      /* If block smoothing could be used, need a bigger window */\n      if (cinfo->progressive_mode)\n\taccess_rows *= 3;\n#endif\n      coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)\n\t((j_common_ptr) cinfo, JPOOL_IMAGE, TRUE,\n\t (JDIMENSION) jround_up((long) compptr->width_in_blocks,\n\t\t\t\t(long) compptr->h_samp_factor),\n\t (JDIMENSION) jround_up((long) compptr->height_in_blocks,\n\t\t\t\t(long) compptr->v_samp_factor),\n\t (JDIMENSION) access_rows);\n    }\n    coef->pub.consume_data = consume_data;\n    coef->pub.decompress_data = decompress_data;\n    coef->pub.coef_arrays = coef->whole_image; /* link to virtual arrays */\n#else\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n  } else {\n    /* We only need a single-MCU buffer. */\n    JBLOCKROW buffer;\n    int i;\n\n    buffer = (JBLOCKROW)\n      (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  D_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));\n    for (i = 0; i < D_MAX_BLOCKS_IN_MCU; i++) {\n      coef->MCU_buffer[i] = buffer + i;\n    }\n    coef->pub.consume_data = dummy_consume_data;\n    coef->pub.decompress_data = decompress_onepass;\n    coef->pub.coef_arrays = NULL; /* flag for no virtual arrays */\n  }\n\n  /* Allocate the workspace buffer */\n  coef->workspace = (JCOEF *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                SIZEOF(JCOEF) * DCTSIZE2);\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdcolext.c",
    "content": "/*\n * jdcolext.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2009, 2011, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains output colorspace conversion routines.\n */\n\n\n/* This file is included by jdcolor.c */\n\n\n/*\n * Convert some rows of samples to the output colorspace.\n *\n * Note that we change from noninterleaved, one-plane-per-component format\n * to interleaved-pixel format.  The output buffer is therefore three times\n * as wide as the input buffer.\n * A starting row offset is provided only for the input buffer.  The caller\n * can easily adjust the passed output_buf value to accommodate any row\n * offset required on that side.\n */\n\nINLINE\nLOCAL(void)\nycc_rgb_convert_internal (j_decompress_ptr cinfo,\n                          JSAMPIMAGE input_buf, JDIMENSION input_row,\n                          JSAMPARRAY output_buf, int num_rows)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  register int y, cb, cr;\n  register JSAMPROW outptr;\n  register JSAMPROW inptr0, inptr1, inptr2;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->output_width;\n  /* copy these pointers into registers if possible */\n  register JSAMPLE * range_limit = cinfo->sample_range_limit;\n  register int * Crrtab = cconvert->Cr_r_tab;\n  register int * Cbbtab = cconvert->Cb_b_tab;\n  register INT32 * Crgtab = cconvert->Cr_g_tab;\n  register INT32 * Cbgtab = cconvert->Cb_g_tab;\n  SHIFT_TEMPS\n\n  while (--num_rows >= 0) {\n    inptr0 = input_buf[0][input_row];\n    inptr1 = input_buf[1][input_row];\n    inptr2 = input_buf[2][input_row];\n    input_row++;\n    outptr = *output_buf++;\n    for (col = 0; col < num_cols; col++) {\n      y  = GETJSAMPLE(inptr0[col]);\n      cb = GETJSAMPLE(inptr1[col]);\n      cr = GETJSAMPLE(inptr2[col]);\n      /* Range-limiting is essential due to noise introduced by DCT losses. */\n      outptr[RGB_RED] =   range_limit[y + Crrtab[cr]];\n      outptr[RGB_GREEN] = range_limit[y +\n\t\t\t      ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],\n\t\t\t\t\t\t SCALEBITS))];\n      outptr[RGB_BLUE] =  range_limit[y + Cbbtab[cb]];\n      /* Set unused byte to 0xFF so it can be interpreted as an opaque */\n      /* alpha channel value */\n#ifdef RGB_ALPHA\n      outptr[RGB_ALPHA] = 0xFF;\n#endif\n      outptr += RGB_PIXELSIZE;\n    }\n  }\n}\n\n\n/*\n * Convert grayscale to RGB: just duplicate the graylevel three times.\n * This is provided to support applications that don't want to cope\n * with grayscale as a separate case.\n */\n\nINLINE\nLOCAL(void)\ngray_rgb_convert_internal (j_decompress_ptr cinfo,\n                           JSAMPIMAGE input_buf, JDIMENSION input_row,\n                           JSAMPARRAY output_buf, int num_rows)\n{\n  register JSAMPROW inptr, outptr;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->output_width;\n\n  while (--num_rows >= 0) {\n    inptr = input_buf[0][input_row++];\n    outptr = *output_buf++;\n    for (col = 0; col < num_cols; col++) {\n      /* We can dispense with GETJSAMPLE() here */\n      outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];\n      /* Set unused byte to 0xFF so it can be interpreted as an opaque */\n      /* alpha channel value */\n#ifdef RGB_ALPHA\n      outptr[RGB_ALPHA] = 0xFF;\n#endif\n      outptr += RGB_PIXELSIZE;\n    }\n  }\n}\n\n\n/*\n * Convert RGB to extended RGB: just swap the order of source pixels\n */\n\nINLINE\nLOCAL(void)\nrgb_rgb_convert_internal (j_decompress_ptr cinfo,\n                          JSAMPIMAGE input_buf, JDIMENSION input_row,\n                          JSAMPARRAY output_buf, int num_rows)\n{\n  register JSAMPROW inptr0, inptr1, inptr2;\n  register JSAMPROW outptr;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->output_width;\n\n  while (--num_rows >= 0) {\n    inptr0 = input_buf[0][input_row];\n    inptr1 = input_buf[1][input_row];\n    inptr2 = input_buf[2][input_row];\n    input_row++;\n    outptr = *output_buf++;\n    for (col = 0; col < num_cols; col++) {\n      /* We can dispense with GETJSAMPLE() here */\n      outptr[RGB_RED] = inptr0[col];\n      outptr[RGB_GREEN] = inptr1[col];\n      outptr[RGB_BLUE] = inptr2[col];\n      /* Set unused byte to 0xFF so it can be interpreted as an opaque */\n      /* alpha channel value */\n#ifdef RGB_ALPHA\n      outptr[RGB_ALPHA] = 0xFF;\n#endif\n      outptr += RGB_PIXELSIZE;\n    }\n  }\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdcolor.c",
    "content": "/*\n * jdcolor.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 2011 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright (C) 2009, 2011-2012, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains output colorspace conversion routines.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jsimd.h\"\n#include \"config.h\"\n\n\n/* Private subobject */\n\ntypedef struct {\n  struct jpeg_color_deconverter pub; /* public fields */\n\n  /* Private state for YCC->RGB conversion */\n  int * Cr_r_tab;\t\t/* => table for Cr to R conversion */\n  int * Cb_b_tab;\t\t/* => table for Cb to B conversion */\n  INT32 * Cr_g_tab;\t\t/* => table for Cr to G conversion */\n  INT32 * Cb_g_tab;\t\t/* => table for Cb to G conversion */\n\n  /* Private state for RGB->Y conversion */\n  INT32 * rgb_y_tab;\t\t/* => table for RGB to Y conversion */\n} my_color_deconverter;\n\ntypedef my_color_deconverter * my_cconvert_ptr;\n\n\n/**************** YCbCr -> RGB conversion: most common case **************/\n/****************   RGB -> Y   conversion: less common case **************/\n\n/*\n * YCbCr is defined per CCIR 601-1, except that Cb and Cr are\n * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.\n * The conversion equations to be implemented are therefore\n *\n *\tR = Y                + 1.40200 * Cr\n *\tG = Y - 0.34414 * Cb - 0.71414 * Cr\n *\tB = Y + 1.77200 * Cb\n *\n *\tY = 0.29900 * R + 0.58700 * G + 0.11400 * B\n *\n * where Cb and Cr represent the incoming values less CENTERJSAMPLE.\n * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)\n *\n * To avoid floating-point arithmetic, we represent the fractional constants\n * as integers scaled up by 2^16 (about 4 digits precision); we have to divide\n * the products by 2^16, with appropriate rounding, to get the correct answer.\n * Notice that Y, being an integral input, does not contribute any fraction\n * so it need not participate in the rounding.\n *\n * For even more speed, we avoid doing any multiplications in the inner loop\n * by precalculating the constants times Cb and Cr for all possible values.\n * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);\n * for 12-bit samples it is still acceptable.  It's not very reasonable for\n * 16-bit samples, but if you want lossless storage you shouldn't be changing\n * colorspace anyway.\n * The Cr=>R and Cb=>B values can be rounded to integers in advance; the\n * values for the G calculation are left scaled up, since we must add them\n * together before rounding.\n */\n\n#define SCALEBITS\t16\t/* speediest right-shift on some machines */\n#define ONE_HALF\t((INT32) 1 << (SCALEBITS-1))\n#define FIX(x)\t\t((INT32) ((x) * (1L<<SCALEBITS) + 0.5))\n\n/* We allocate one big table for RGB->Y conversion and divide it up into\n * three parts, instead of doing three alloc_small requests.  This lets us\n * use a single table base address, which can be held in a register in the\n * inner loops on many machines (more than can hold all three addresses,\n * anyway).\n */\n\n#define R_Y_OFF\t\t0\t\t\t/* offset to R => Y section */\n#define G_Y_OFF\t\t(1*(MAXJSAMPLE+1))\t/* offset to G => Y section */\n#define B_Y_OFF\t\t(2*(MAXJSAMPLE+1))\t/* etc. */\n#define TABLE_SIZE\t(3*(MAXJSAMPLE+1))\n\n\n/* Include inline routines for colorspace extensions */\n\n#include \"jdcolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n\n#define RGB_RED EXT_RGB_RED\n#define RGB_GREEN EXT_RGB_GREEN\n#define RGB_BLUE EXT_RGB_BLUE\n#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n#define ycc_rgb_convert_internal ycc_extrgb_convert_internal\n#define gray_rgb_convert_internal gray_extrgb_convert_internal\n#define rgb_rgb_convert_internal rgb_extrgb_convert_internal\n#include \"jdcolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n#undef ycc_rgb_convert_internal\n#undef gray_rgb_convert_internal\n#undef rgb_rgb_convert_internal\n\n#define RGB_RED EXT_RGBX_RED\n#define RGB_GREEN EXT_RGBX_GREEN\n#define RGB_BLUE EXT_RGBX_BLUE\n#define RGB_ALPHA 3\n#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n#define ycc_rgb_convert_internal ycc_extrgbx_convert_internal\n#define gray_rgb_convert_internal gray_extrgbx_convert_internal\n#define rgb_rgb_convert_internal rgb_extrgbx_convert_internal\n#include \"jdcolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_ALPHA\n#undef RGB_PIXELSIZE\n#undef ycc_rgb_convert_internal\n#undef gray_rgb_convert_internal\n#undef rgb_rgb_convert_internal\n\n#define RGB_RED EXT_BGR_RED\n#define RGB_GREEN EXT_BGR_GREEN\n#define RGB_BLUE EXT_BGR_BLUE\n#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n#define ycc_rgb_convert_internal ycc_extbgr_convert_internal\n#define gray_rgb_convert_internal gray_extbgr_convert_internal\n#define rgb_rgb_convert_internal rgb_extbgr_convert_internal\n#include \"jdcolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n#undef ycc_rgb_convert_internal\n#undef gray_rgb_convert_internal\n#undef rgb_rgb_convert_internal\n\n#define RGB_RED EXT_BGRX_RED\n#define RGB_GREEN EXT_BGRX_GREEN\n#define RGB_BLUE EXT_BGRX_BLUE\n#define RGB_ALPHA 3\n#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n#define ycc_rgb_convert_internal ycc_extbgrx_convert_internal\n#define gray_rgb_convert_internal gray_extbgrx_convert_internal\n#define rgb_rgb_convert_internal rgb_extbgrx_convert_internal\n#include \"jdcolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_ALPHA\n#undef RGB_PIXELSIZE\n#undef ycc_rgb_convert_internal\n#undef gray_rgb_convert_internal\n#undef rgb_rgb_convert_internal\n\n#define RGB_RED EXT_XBGR_RED\n#define RGB_GREEN EXT_XBGR_GREEN\n#define RGB_BLUE EXT_XBGR_BLUE\n#define RGB_ALPHA 0\n#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n#define ycc_rgb_convert_internal ycc_extxbgr_convert_internal\n#define gray_rgb_convert_internal gray_extxbgr_convert_internal\n#define rgb_rgb_convert_internal rgb_extxbgr_convert_internal\n#include \"jdcolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_ALPHA\n#undef RGB_PIXELSIZE\n#undef ycc_rgb_convert_internal\n#undef gray_rgb_convert_internal\n#undef rgb_rgb_convert_internal\n\n#define RGB_RED EXT_XRGB_RED\n#define RGB_GREEN EXT_XRGB_GREEN\n#define RGB_BLUE EXT_XRGB_BLUE\n#define RGB_ALPHA 0\n#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n#define ycc_rgb_convert_internal ycc_extxrgb_convert_internal\n#define gray_rgb_convert_internal gray_extxrgb_convert_internal\n#define rgb_rgb_convert_internal rgb_extxrgb_convert_internal\n#include \"jdcolext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_ALPHA\n#undef RGB_PIXELSIZE\n#undef ycc_rgb_convert_internal\n#undef gray_rgb_convert_internal\n#undef rgb_rgb_convert_internal\n\n\n/*\n * Initialize tables for YCC->RGB colorspace conversion.\n */\n\nLOCAL(void)\nbuild_ycc_rgb_table (j_decompress_ptr cinfo)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  int i;\n  INT32 x;\n  SHIFT_TEMPS\n\n  cconvert->Cr_r_tab = (int *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(MAXJSAMPLE+1) * SIZEOF(int));\n  cconvert->Cb_b_tab = (int *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(MAXJSAMPLE+1) * SIZEOF(int));\n  cconvert->Cr_g_tab = (INT32 *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(MAXJSAMPLE+1) * SIZEOF(INT32));\n  cconvert->Cb_g_tab = (INT32 *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(MAXJSAMPLE+1) * SIZEOF(INT32));\n\n  for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {\n    /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */\n    /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */\n    /* Cr=>R value is nearest int to 1.40200 * x */\n    cconvert->Cr_r_tab[i] = (int)\n\t\t    RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);\n    /* Cb=>B value is nearest int to 1.77200 * x */\n    cconvert->Cb_b_tab[i] = (int)\n\t\t    RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);\n    /* Cr=>G value is scaled-up -0.71414 * x */\n    cconvert->Cr_g_tab[i] = (- FIX(0.71414)) * x;\n    /* Cb=>G value is scaled-up -0.34414 * x */\n    /* We also add in ONE_HALF so that need not do it in inner loop */\n    cconvert->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF;\n  }\n}\n\n\n/*\n * Convert some rows of samples to the output colorspace.\n */\n\nMETHODDEF(void)\nycc_rgb_convert (j_decompress_ptr cinfo,\n\t\t JSAMPIMAGE input_buf, JDIMENSION input_row,\n\t\t JSAMPARRAY output_buf, int num_rows)\n{\n  switch (cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      ycc_extrgb_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                  num_rows);\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      ycc_extrgbx_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                   num_rows);\n      break;\n    case JCS_EXT_BGR:\n      ycc_extbgr_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                  num_rows);\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      ycc_extbgrx_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                   num_rows);\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      ycc_extxbgr_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                   num_rows);\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      ycc_extxrgb_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                   num_rows);\n      break;\n    default:\n      ycc_rgb_convert_internal(cinfo, input_buf, input_row, output_buf,\n                               num_rows);\n      break;\n  }\n}\n\n\n/**************** Cases other than YCbCr -> RGB **************/\n\n\n/*\n * Initialize for RGB->grayscale colorspace conversion.\n */\n\nLOCAL(void)\nbuild_rgb_y_table (j_decompress_ptr cinfo)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  INT32 * rgb_y_tab;\n  INT32 i;\n\n  /* Allocate and fill in the conversion tables. */\n  cconvert->rgb_y_tab = rgb_y_tab = (INT32 *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(TABLE_SIZE * SIZEOF(INT32)));\n\n  for (i = 0; i <= MAXJSAMPLE; i++) {\n    rgb_y_tab[i+R_Y_OFF] = FIX(0.29900) * i;\n    rgb_y_tab[i+G_Y_OFF] = FIX(0.58700) * i;\n    rgb_y_tab[i+B_Y_OFF] = FIX(0.11400) * i + ONE_HALF;\n  }\n}\n\n\n/*\n * Convert RGB to grayscale.\n */\n\nMETHODDEF(void)\nrgb_gray_convert (j_decompress_ptr cinfo,\n\t\t  JSAMPIMAGE input_buf, JDIMENSION input_row,\n\t\t  JSAMPARRAY output_buf, int num_rows)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  register int r, g, b;\n  register INT32 * ctab = cconvert->rgb_y_tab;\n  register JSAMPROW outptr;\n  register JSAMPROW inptr0, inptr1, inptr2;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->output_width;\n\n  while (--num_rows >= 0) {\n    inptr0 = input_buf[0][input_row];\n    inptr1 = input_buf[1][input_row];\n    inptr2 = input_buf[2][input_row];\n    input_row++;\n    outptr = *output_buf++;\n    for (col = 0; col < num_cols; col++) {\n      r = GETJSAMPLE(inptr0[col]);\n      g = GETJSAMPLE(inptr1[col]);\n      b = GETJSAMPLE(inptr2[col]);\n      /* Y */\n      outptr[col] = (JSAMPLE)\n\t\t((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])\n\t\t >> SCALEBITS);\n    }\n  }\n}\n\n\n/*\n * Color conversion for no colorspace change: just copy the data,\n * converting from separate-planes to interleaved representation.\n */\n\nMETHODDEF(void)\nnull_convert (j_decompress_ptr cinfo,\n\t      JSAMPIMAGE input_buf, JDIMENSION input_row,\n\t      JSAMPARRAY output_buf, int num_rows)\n{\n  register JSAMPROW inptr, outptr;\n  register JDIMENSION count;\n  register int num_components = cinfo->num_components;\n  JDIMENSION num_cols = cinfo->output_width;\n  int ci;\n\n  while (--num_rows >= 0) {\n    for (ci = 0; ci < num_components; ci++) {\n      inptr = input_buf[ci][input_row];\n      outptr = output_buf[0] + ci;\n      for (count = num_cols; count > 0; count--) {\n\t*outptr = *inptr++;\t/* needn't bother with GETJSAMPLE() here */\n\toutptr += num_components;\n      }\n    }\n    input_row++;\n    output_buf++;\n  }\n}\n\n\n/*\n * Color conversion for grayscale: just copy the data.\n * This also works for YCbCr -> grayscale conversion, in which\n * we just copy the Y (luminance) component and ignore chrominance.\n */\n\nMETHODDEF(void)\ngrayscale_convert (j_decompress_ptr cinfo,\n\t\t   JSAMPIMAGE input_buf, JDIMENSION input_row,\n\t\t   JSAMPARRAY output_buf, int num_rows)\n{\n  jcopy_sample_rows(input_buf[0], (int) input_row, output_buf, 0,\n\t\t    num_rows, cinfo->output_width);\n}\n\n\n/*\n * Convert grayscale to RGB\n */\n\nMETHODDEF(void)\ngray_rgb_convert (j_decompress_ptr cinfo,\n\t\t  JSAMPIMAGE input_buf, JDIMENSION input_row,\n\t\t  JSAMPARRAY output_buf, int num_rows)\n{\n  switch (cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      gray_extrgb_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                   num_rows);\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      gray_extrgbx_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                    num_rows);\n      break;\n    case JCS_EXT_BGR:\n      gray_extbgr_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                   num_rows);\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      gray_extbgrx_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                    num_rows);\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      gray_extxbgr_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                    num_rows);\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      gray_extxrgb_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                    num_rows);\n      break;\n    default:\n      gray_rgb_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                num_rows);\n      break;\n  }\n}\n\n\n/*\n * Convert plain RGB to extended RGB\n */\n\nMETHODDEF(void)\nrgb_rgb_convert (j_decompress_ptr cinfo,\n\t\t  JSAMPIMAGE input_buf, JDIMENSION input_row,\n\t\t  JSAMPARRAY output_buf, int num_rows)\n{\n  switch (cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      rgb_extrgb_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                  num_rows);\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      rgb_extrgbx_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                   num_rows);\n      break;\n    case JCS_EXT_BGR:\n      rgb_extbgr_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                  num_rows);\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      rgb_extbgrx_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                   num_rows);\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      rgb_extxbgr_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                   num_rows);\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      rgb_extxrgb_convert_internal(cinfo, input_buf, input_row, output_buf,\n                                   num_rows);\n      break;\n    default:\n      rgb_rgb_convert_internal(cinfo, input_buf, input_row, output_buf,\n                               num_rows);\n      break;\n  }\n}\n\n\n/*\n * Adobe-style YCCK->CMYK conversion.\n * We convert YCbCr to R=1-C, G=1-M, and B=1-Y using the same\n * conversion as above, while passing K (black) unchanged.\n * We assume build_ycc_rgb_table has been called.\n */\n\nMETHODDEF(void)\nycck_cmyk_convert (j_decompress_ptr cinfo,\n\t\t   JSAMPIMAGE input_buf, JDIMENSION input_row,\n\t\t   JSAMPARRAY output_buf, int num_rows)\n{\n  my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;\n  register int y, cb, cr;\n  register JSAMPROW outptr;\n  register JSAMPROW inptr0, inptr1, inptr2, inptr3;\n  register JDIMENSION col;\n  JDIMENSION num_cols = cinfo->output_width;\n  /* copy these pointers into registers if possible */\n  register JSAMPLE * range_limit = cinfo->sample_range_limit;\n  register int * Crrtab = cconvert->Cr_r_tab;\n  register int * Cbbtab = cconvert->Cb_b_tab;\n  register INT32 * Crgtab = cconvert->Cr_g_tab;\n  register INT32 * Cbgtab = cconvert->Cb_g_tab;\n  SHIFT_TEMPS\n\n  while (--num_rows >= 0) {\n    inptr0 = input_buf[0][input_row];\n    inptr1 = input_buf[1][input_row];\n    inptr2 = input_buf[2][input_row];\n    inptr3 = input_buf[3][input_row];\n    input_row++;\n    outptr = *output_buf++;\n    for (col = 0; col < num_cols; col++) {\n      y  = GETJSAMPLE(inptr0[col]);\n      cb = GETJSAMPLE(inptr1[col]);\n      cr = GETJSAMPLE(inptr2[col]);\n      /* Range-limiting is essential due to noise introduced by DCT losses. */\n      outptr[0] = range_limit[MAXJSAMPLE - (y + Crrtab[cr])];\t/* red */\n      outptr[1] = range_limit[MAXJSAMPLE - (y +\t\t\t/* green */\n\t\t\t      ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],\n\t\t\t\t\t\t SCALEBITS)))];\n      outptr[2] = range_limit[MAXJSAMPLE - (y + Cbbtab[cb])];\t/* blue */\n      /* K passes through unchanged */\n      outptr[3] = inptr3[col];\t/* don't need GETJSAMPLE here */\n      outptr += 4;\n    }\n  }\n}\n\n\n/*\n * Empty method for start_pass.\n */\n\nMETHODDEF(void)\nstart_pass_dcolor (j_decompress_ptr cinfo)\n{\n  /* no work needed */\n}\n\n\n/*\n * Module initialization routine for output colorspace conversion.\n */\n\nGLOBAL(void)\njinit_color_deconverter (j_decompress_ptr cinfo)\n{\n  my_cconvert_ptr cconvert;\n  int ci;\n\n  cconvert = (my_cconvert_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_color_deconverter));\n  cinfo->cconvert = (struct jpeg_color_deconverter *) cconvert;\n  cconvert->pub.start_pass = start_pass_dcolor;\n\n  /* Make sure num_components agrees with jpeg_color_space */\n  switch (cinfo->jpeg_color_space) {\n  case JCS_GRAYSCALE:\n    if (cinfo->num_components != 1)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    break;\n\n  case JCS_RGB:\n  case JCS_YCbCr:\n    if (cinfo->num_components != 3)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    break;\n\n  case JCS_CMYK:\n  case JCS_YCCK:\n    if (cinfo->num_components != 4)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    break;\n\n  default:\t\t\t/* JCS_UNKNOWN can be anything */\n    if (cinfo->num_components < 1)\n      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);\n    break;\n  }\n\n  /* Set out_color_components and conversion method based on requested space.\n   * Also clear the component_needed flags for any unused components,\n   * so that earlier pipeline stages can avoid useless computation.\n   */\n\n  switch (cinfo->out_color_space) {\n  case JCS_GRAYSCALE:\n    cinfo->out_color_components = 1;\n    if (cinfo->jpeg_color_space == JCS_GRAYSCALE ||\n\tcinfo->jpeg_color_space == JCS_YCbCr) {\n      cconvert->pub.color_convert = grayscale_convert;\n      /* For color->grayscale conversion, only the Y (0) component is needed */\n      for (ci = 1; ci < cinfo->num_components; ci++)\n\tcinfo->comp_info[ci].component_needed = FALSE;\n    } else if (cinfo->jpeg_color_space == JCS_RGB) {\n      cconvert->pub.color_convert = rgb_gray_convert;\n      build_rgb_y_table(cinfo);\n    } else\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    break;\n\n  case JCS_RGB:\n  case JCS_EXT_RGB:\n  case JCS_EXT_RGBX:\n  case JCS_EXT_BGR:\n  case JCS_EXT_BGRX:\n  case JCS_EXT_XBGR:\n  case JCS_EXT_XRGB:\n  case JCS_EXT_RGBA:\n  case JCS_EXT_BGRA:\n  case JCS_EXT_ABGR:\n  case JCS_EXT_ARGB:\n    cinfo->out_color_components = rgb_pixelsize[cinfo->out_color_space];\n    if (cinfo->jpeg_color_space == JCS_YCbCr) {\n      if (jsimd_can_ycc_rgb())\n        cconvert->pub.color_convert = jsimd_ycc_rgb_convert;\n      else {\n        cconvert->pub.color_convert = ycc_rgb_convert;\n        build_ycc_rgb_table(cinfo);\n      }\n    } else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {\n      cconvert->pub.color_convert = gray_rgb_convert;\n    } else if (cinfo->jpeg_color_space == JCS_RGB) {\n      if (rgb_red[cinfo->out_color_space] == 0 &&\n          rgb_green[cinfo->out_color_space] == 1 &&\n          rgb_blue[cinfo->out_color_space] == 2 &&\n          rgb_pixelsize[cinfo->out_color_space] == 3)\n        cconvert->pub.color_convert = null_convert;\n      else\n        cconvert->pub.color_convert = rgb_rgb_convert;\n    } else\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    break;\n\n  case JCS_CMYK:\n    cinfo->out_color_components = 4;\n    if (cinfo->jpeg_color_space == JCS_YCCK) {\n      cconvert->pub.color_convert = ycck_cmyk_convert;\n      build_ycc_rgb_table(cinfo);\n    } else if (cinfo->jpeg_color_space == JCS_CMYK) {\n      cconvert->pub.color_convert = null_convert;\n    } else\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    break;\n\n  default:\n    /* Permit null conversion to same output space */\n    if (cinfo->out_color_space == cinfo->jpeg_color_space) {\n      cinfo->out_color_components = cinfo->num_components;\n      cconvert->pub.color_convert = null_convert;\n    } else\t\t\t/* unsupported non-null conversion */\n      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);\n    break;\n  }\n\n  if (cinfo->quantize_colors)\n    cinfo->output_components = 1; /* single colormapped output component */\n  else\n    cinfo->output_components = cinfo->out_color_components;\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdct.h",
    "content": "/*\n * jdct.h\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This include file contains common declarations for the forward and\n * inverse DCT modules.  These declarations are private to the DCT managers\n * (jcdctmgr.c, jddctmgr.c) and the individual DCT algorithms.\n * The individual DCT algorithms are kept in separate files to ease \n * machine-dependent tuning (e.g., assembly coding).\n */\n\n\n/*\n * A forward DCT routine is given a pointer to a work area of type DCTELEM[];\n * the DCT is to be performed in-place in that buffer.  Type DCTELEM is int\n * for 8-bit samples, INT32 for 12-bit samples.  (NOTE: Floating-point DCT\n * implementations use an array of type FAST_FLOAT, instead.)\n * The DCT inputs are expected to be signed (range +-CENTERJSAMPLE).\n * The DCT outputs are returned scaled up by a factor of 8; they therefore\n * have a range of +-8K for 8-bit data, +-128K for 12-bit data.  This\n * convention improves accuracy in integer implementations and saves some\n * work in floating-point ones.\n * Quantization of the output coefficients is done by jcdctmgr.c. This\n * step requires an unsigned type and also one with twice the bits.\n */\n\n#if BITS_IN_JSAMPLE == 8\n#ifndef WITH_SIMD\ntypedef int DCTELEM;\t\t/* 16 or 32 bits is fine */\ntypedef unsigned int UDCTELEM;\ntypedef unsigned long long UDCTELEM2;\n#else\ntypedef short DCTELEM;  /* prefer 16 bit with SIMD for parellelism */\ntypedef unsigned short UDCTELEM;\ntypedef unsigned int UDCTELEM2;\n#endif\n#else\ntypedef INT32 DCTELEM;\t\t/* must have 32 bits */\ntypedef UINT32 UDCTELEM;\ntypedef unsigned long long UDCTELEM2;\n#endif\n\n\n/*\n * An inverse DCT routine is given a pointer to the input JBLOCK and a pointer\n * to an output sample array.  The routine must dequantize the input data as\n * well as perform the IDCT; for dequantization, it uses the multiplier table\n * pointed to by compptr->dct_table.  The output data is to be placed into the\n * sample array starting at a specified column.  (Any row offset needed will\n * be applied to the array pointer before it is passed to the IDCT code.)\n * Note that the number of samples emitted by the IDCT routine is\n * DCT_scaled_size * DCT_scaled_size.\n */\n\n/* typedef inverse_DCT_method_ptr is declared in jpegint.h */\n\n/*\n * Each IDCT routine has its own ideas about the best dct_table element type.\n */\n\ntypedef MULTIPLIER ISLOW_MULT_TYPE; /* short or int, whichever is faster */\n#if BITS_IN_JSAMPLE == 8\ntypedef MULTIPLIER IFAST_MULT_TYPE; /* 16 bits is OK, use short if faster */\n#define IFAST_SCALE_BITS  2\t/* fractional bits in scale factors */\n#else\ntypedef INT32 IFAST_MULT_TYPE;\t/* need 32 bits for scaled quantizers */\n#define IFAST_SCALE_BITS  13\t/* fractional bits in scale factors */\n#endif\ntypedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */\n\n\n/*\n * Each IDCT routine is responsible for range-limiting its results and\n * converting them to unsigned form (0..MAXJSAMPLE).  The raw outputs could\n * be quite far out of range if the input data is corrupt, so a bulletproof\n * range-limiting step is required.  We use a mask-and-table-lookup method\n * to do the combined operations quickly.  See the comments with\n * prepare_range_limit_table (in jdmaster.c) for more info.\n */\n\n#define IDCT_range_limit(cinfo)  ((cinfo)->sample_range_limit + CENTERJSAMPLE)\n\n#define RANGE_MASK  (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */\n\n\n/* Short forms of external names for systems with brain-damaged linkers. */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jpeg_fdct_islow\t\tjFDislow\n#define jpeg_fdct_ifast\t\tjFDifast\n#define jpeg_fdct_float\t\tjFDfloat\n#define jpeg_idct_islow\t\tjRDislow\n#define jpeg_idct_ifast\t\tjRDifast\n#define jpeg_idct_float\t\tjRDfloat\n#define jpeg_idct_7x7\t\tjRD7x7\n#define jpeg_idct_6x6\t\tjRD6x6\n#define jpeg_idct_5x5\t\tjRD5x5\n#define jpeg_idct_4x4\t\tjRD4x4\n#define jpeg_idct_3x3\t\tjRD3x3\n#define jpeg_idct_2x2\t\tjRD2x2\n#define jpeg_idct_1x1\t\tjRD1x1\n#define jpeg_idct_9x9\t\tjRD9x9\n#define jpeg_idct_10x10\t\tjRD10x10\n#define jpeg_idct_11x11\t\tjRD11x11\n#define jpeg_idct_12x12\t\tjRD12x12\n#define jpeg_idct_13x13\t\tjRD13x13\n#define jpeg_idct_14x14\t\tjRD14x14\n#define jpeg_idct_15x15\t\tjRD15x15\n#define jpeg_idct_16x16\t\tjRD16x16\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\n/* Extern declarations for the forward and inverse DCT routines. */\n\nEXTERN(void) jpeg_fdct_islow JPP((DCTELEM * data));\nEXTERN(void) jpeg_fdct_ifast JPP((DCTELEM * data));\nEXTERN(void) jpeg_fdct_float JPP((FAST_FLOAT * data));\n\nEXTERN(void) jpeg_idct_islow\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_ifast\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_float\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_7x7\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_6x6\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_5x5\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_4x4\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_3x3\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_2x2\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_1x1\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_9x9\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_10x10\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_11x11\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_12x12\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_13x13\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_14x14\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_15x15\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\nEXTERN(void) jpeg_idct_16x16\n    JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t JCOEFPTR coef_block, JSAMPARRAY output_buf, JDIMENSION output_col));\n\n\n/*\n * Macros for handling fixed-point arithmetic; these are used by many\n * but not all of the DCT/IDCT modules.\n *\n * All values are expected to be of type INT32.\n * Fractional constants are scaled left by CONST_BITS bits.\n * CONST_BITS is defined within each module using these macros,\n * and may differ from one module to the next.\n */\n\n#define ONE\t((INT32) 1)\n#define CONST_SCALE (ONE << CONST_BITS)\n\n/* Convert a positive real constant to an integer scaled by CONST_SCALE.\n * Caution: some C compilers fail to reduce \"FIX(constant)\" at compile time,\n * thus causing a lot of useless floating-point operations at run time.\n */\n\n#define FIX(x)\t((INT32) ((x) * CONST_SCALE + 0.5))\n\n/* Descale and correctly round an INT32 value that's scaled by N bits.\n * We assume RIGHT_SHIFT rounds towards minus infinity, so adding\n * the fudge factor is correct for either sign of X.\n */\n\n#define DESCALE(x,n)  RIGHT_SHIFT((x) + (ONE << ((n)-1)), n)\n\n/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.\n * This macro is used only when the two inputs will actually be no more than\n * 16 bits wide, so that a 16x16->32 bit multiply can be used instead of a\n * full 32x32 multiply.  This provides a useful speedup on many machines.\n * Unfortunately there is no way to specify a 16x16->32 multiply portably\n * in C, but some C compilers will do the right thing if you provide the\n * correct combination of casts.\n */\n\n#ifdef SHORTxSHORT_32\t\t/* may work if 'int' is 32 bits */\n#define MULTIPLY16C16(var,const)  (((INT16) (var)) * ((INT16) (const)))\n#endif\n#ifdef SHORTxLCONST_32\t\t/* known to work with Microsoft C 6.0 */\n#define MULTIPLY16C16(var,const)  (((INT16) (var)) * ((INT32) (const)))\n#endif\n\n#ifndef MULTIPLY16C16\t\t/* default definition */\n#define MULTIPLY16C16(var,const)  ((var) * (const))\n#endif\n\n/* Same except both inputs are variables. */\n\n#ifdef SHORTxSHORT_32\t\t/* may work if 'int' is 32 bits */\n#define MULTIPLY16V16(var1,var2)  (((INT16) (var1)) * ((INT16) (var2)))\n#endif\n\n#ifndef MULTIPLY16V16\t\t/* default definition */\n#define MULTIPLY16V16(var1,var2)  ((var1) * (var2))\n#endif\n"
  },
  {
    "path": "ext/libjpeg-turbo/jddctmgr.c",
    "content": "/*\n * jddctmgr.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2002-2010 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright (C) 2010, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains the inverse-DCT management logic.\n * This code selects a particular IDCT implementation to be used,\n * and it performs related housekeeping chores.  No code in this file\n * is executed per IDCT step, only during output pass setup.\n *\n * Note that the IDCT routines are responsible for performing coefficient\n * dequantization as well as the IDCT proper.  This module sets up the\n * dequantization multiplier table needed by the IDCT routine.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"\t\t/* Private declarations for DCT subsystem */\n#include \"jsimddct.h\"\n#include \"jpegcomp.h\"\n\n\n/*\n * The decompressor input side (jdinput.c) saves away the appropriate\n * quantization table for each component at the start of the first scan\n * involving that component.  (This is necessary in order to correctly\n * decode files that reuse Q-table slots.)\n * When we are ready to make an output pass, the saved Q-table is converted\n * to a multiplier table that will actually be used by the IDCT routine.\n * The multiplier table contents are IDCT-method-dependent.  To support\n * application changes in IDCT method between scans, we can remake the\n * multiplier tables if necessary.\n * In buffered-image mode, the first output pass may occur before any data\n * has been seen for some components, and thus before their Q-tables have\n * been saved away.  To handle this case, multiplier tables are preset\n * to zeroes; the result of the IDCT will be a neutral gray level.\n */\n\n\n/* Private subobject for this module */\n\ntypedef struct {\n  struct jpeg_inverse_dct pub;\t/* public fields */\n\n  /* This array contains the IDCT method code that each multiplier table\n   * is currently set up for, or -1 if it's not yet set up.\n   * The actual multiplier tables are pointed to by dct_table in the\n   * per-component comp_info structures.\n   */\n  int cur_method[MAX_COMPONENTS];\n} my_idct_controller;\n\ntypedef my_idct_controller * my_idct_ptr;\n\n\n/* Allocated multiplier tables: big enough for any supported variant */\n\ntypedef union {\n  ISLOW_MULT_TYPE islow_array[DCTSIZE2];\n#ifdef DCT_IFAST_SUPPORTED\n  IFAST_MULT_TYPE ifast_array[DCTSIZE2];\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n  FLOAT_MULT_TYPE float_array[DCTSIZE2];\n#endif\n} multiplier_table;\n\n\n/* The current scaled-IDCT routines require ISLOW-style multiplier tables,\n * so be sure to compile that code if either ISLOW or SCALING is requested.\n */\n#ifdef DCT_ISLOW_SUPPORTED\n#define PROVIDE_ISLOW_TABLES\n#else\n#ifdef IDCT_SCALING_SUPPORTED\n#define PROVIDE_ISLOW_TABLES\n#endif\n#endif\n\n\n/*\n * Prepare for an output pass.\n * Here we select the proper IDCT routine for each component and build\n * a matching multiplier table.\n */\n\nMETHODDEF(void)\nstart_pass (j_decompress_ptr cinfo)\n{\n  my_idct_ptr idct = (my_idct_ptr) cinfo->idct;\n  int ci, i;\n  jpeg_component_info *compptr;\n  int method = 0;\n  inverse_DCT_method_ptr method_ptr = NULL;\n  JQUANT_TBL * qtbl;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Select the proper IDCT routine for this component's scaling */\n    switch (compptr->_DCT_scaled_size) {\n#ifdef IDCT_SCALING_SUPPORTED\n    case 1:\n      method_ptr = jpeg_idct_1x1;\n      method = JDCT_ISLOW;\t/* jidctred uses islow-style table */\n      break;\n    case 2:\n      if (jsimd_can_idct_2x2())\n        method_ptr = jsimd_idct_2x2;\n      else\n        method_ptr = jpeg_idct_2x2;\n      method = JDCT_ISLOW;\t/* jidctred uses islow-style table */\n      break;\n    case 3:\n      method_ptr = jpeg_idct_3x3;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case 4:\n      if (jsimd_can_idct_4x4())\n        method_ptr = jsimd_idct_4x4;\n      else\n        method_ptr = jpeg_idct_4x4;\n      method = JDCT_ISLOW;\t/* jidctred uses islow-style table */\n      break;\n    case 5:\n      method_ptr = jpeg_idct_5x5;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case 6:\n      method_ptr = jpeg_idct_6x6;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case 7:\n      method_ptr = jpeg_idct_7x7;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n#endif\n    case DCTSIZE:\n      switch (cinfo->dct_method) {\n#ifdef DCT_ISLOW_SUPPORTED\n      case JDCT_ISLOW:\n\tif (jsimd_can_idct_islow())\n\t  method_ptr = jsimd_idct_islow;\n\telse\n\t  method_ptr = jpeg_idct_islow;\n\tmethod = JDCT_ISLOW;\n\tbreak;\n#endif\n#ifdef DCT_IFAST_SUPPORTED\n      case JDCT_IFAST:\n\tif (jsimd_can_idct_ifast())\n\t  method_ptr = jsimd_idct_ifast;\n\telse\n\t  method_ptr = jpeg_idct_ifast;\n\tmethod = JDCT_IFAST;\n\tbreak;\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n      case JDCT_FLOAT:\n\tif (jsimd_can_idct_float())\n\t  method_ptr = jsimd_idct_float;\n\telse\n\t  method_ptr = jpeg_idct_float;\n\tmethod = JDCT_FLOAT;\n\tbreak;\n#endif\n      default:\n\tERREXIT(cinfo, JERR_NOT_COMPILED);\n\tbreak;\n      }\n      break;\n    case 9:\n      method_ptr = jpeg_idct_9x9;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case 10:\n      method_ptr = jpeg_idct_10x10;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case 11:\n      method_ptr = jpeg_idct_11x11;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case 12:\n      method_ptr = jpeg_idct_12x12;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case 13:\n      method_ptr = jpeg_idct_13x13;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case 14:\n      method_ptr = jpeg_idct_14x14;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case 15:\n      method_ptr = jpeg_idct_15x15;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    case 16:\n      method_ptr = jpeg_idct_16x16;\n      method = JDCT_ISLOW;\t/* jidctint uses islow-style table */\n      break;\n    default:\n      ERREXIT1(cinfo, JERR_BAD_DCTSIZE, compptr->_DCT_scaled_size);\n      break;\n    }\n    idct->pub.inverse_DCT[ci] = method_ptr;\n    /* Create multiplier table from quant table.\n     * However, we can skip this if the component is uninteresting\n     * or if we already built the table.  Also, if no quant table\n     * has yet been saved for the component, we leave the\n     * multiplier table all-zero; we'll be reading zeroes from the\n     * coefficient controller's buffer anyway.\n     */\n    if (! compptr->component_needed || idct->cur_method[ci] == method)\n      continue;\n    qtbl = compptr->quant_table;\n    if (qtbl == NULL)\t\t/* happens if no data yet for component */\n      continue;\n    idct->cur_method[ci] = method;\n    switch (method) {\n#ifdef PROVIDE_ISLOW_TABLES\n    case JDCT_ISLOW:\n      {\n\t/* For LL&M IDCT method, multipliers are equal to raw quantization\n\t * coefficients, but are stored as ints to ensure access efficiency.\n\t */\n\tISLOW_MULT_TYPE * ismtbl = (ISLOW_MULT_TYPE *) compptr->dct_table;\n\tfor (i = 0; i < DCTSIZE2; i++) {\n\t  ismtbl[i] = (ISLOW_MULT_TYPE) qtbl->quantval[i];\n\t}\n      }\n      break;\n#endif\n#ifdef DCT_IFAST_SUPPORTED\n    case JDCT_IFAST:\n      {\n\t/* For AA&N IDCT method, multipliers are equal to quantization\n\t * coefficients scaled by scalefactor[row]*scalefactor[col], where\n\t *   scalefactor[0] = 1\n\t *   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7\n\t * For integer operation, the multiplier table is to be scaled by\n\t * IFAST_SCALE_BITS.\n\t */\n\tIFAST_MULT_TYPE * ifmtbl = (IFAST_MULT_TYPE *) compptr->dct_table;\n#define CONST_BITS 14\n\tstatic const INT16 aanscales[DCTSIZE2] = {\n\t  /* precomputed values scaled up by 14 bits */\n\t  16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,\n\t  22725, 31521, 29692, 26722, 22725, 17855, 12299,  6270,\n\t  21407, 29692, 27969, 25172, 21407, 16819, 11585,  5906,\n\t  19266, 26722, 25172, 22654, 19266, 15137, 10426,  5315,\n\t  16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,\n\t  12873, 17855, 16819, 15137, 12873, 10114,  6967,  3552,\n\t   8867, 12299, 11585, 10426,  8867,  6967,  4799,  2446,\n\t   4520,  6270,  5906,  5315,  4520,  3552,  2446,  1247\n\t};\n\tSHIFT_TEMPS\n\n\tfor (i = 0; i < DCTSIZE2; i++) {\n\t  ifmtbl[i] = (IFAST_MULT_TYPE)\n\t    DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],\n\t\t\t\t  (INT32) aanscales[i]),\n\t\t    CONST_BITS-IFAST_SCALE_BITS);\n\t}\n      }\n      break;\n#endif\n#ifdef DCT_FLOAT_SUPPORTED\n    case JDCT_FLOAT:\n      {\n\t/* For float AA&N IDCT method, multipliers are equal to quantization\n\t * coefficients scaled by scalefactor[row]*scalefactor[col], where\n\t *   scalefactor[0] = 1\n\t *   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7\n\t */\n\tFLOAT_MULT_TYPE * fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table;\n\tint row, col;\n\tstatic const double aanscalefactor[DCTSIZE] = {\n\t  1.0, 1.387039845, 1.306562965, 1.175875602,\n\t  1.0, 0.785694958, 0.541196100, 0.275899379\n\t};\n\n\ti = 0;\n\tfor (row = 0; row < DCTSIZE; row++) {\n\t  for (col = 0; col < DCTSIZE; col++) {\n\t    fmtbl[i] = (FLOAT_MULT_TYPE)\n\t      ((double) qtbl->quantval[i] *\n\t       aanscalefactor[row] * aanscalefactor[col]);\n\t    i++;\n\t  }\n\t}\n      }\n      break;\n#endif\n    default:\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n      break;\n    }\n  }\n}\n\n\n/*\n * Initialize IDCT manager.\n */\n\nGLOBAL(void)\njinit_inverse_dct (j_decompress_ptr cinfo)\n{\n  my_idct_ptr idct;\n  int ci;\n  jpeg_component_info *compptr;\n\n  idct = (my_idct_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_idct_controller));\n  cinfo->idct = (struct jpeg_inverse_dct *) idct;\n  idct->pub.start_pass = start_pass;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Allocate and pre-zero a multiplier table for each component */\n    compptr->dct_table =\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(multiplier_table));\n    MEMZERO(compptr->dct_table, SIZEOF(multiplier_table));\n    /* Mark multiplier table not yet set up for any method */\n    idct->cur_method[ci] = -1;\n  }\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdhuff.c",
    "content": "/*\n * jdhuff.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2009-2011, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains Huffman entropy decoding routines.\n *\n * Much of the complexity here has to do with supporting input suspension.\n * If the data source module demands suspension, we want to be able to back\n * up to the start of the current MCU.  To do this, we copy state variables\n * into local working storage, and update them back to the permanent\n * storage only upon successful completion of an MCU.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdhuff.h\"\t\t/* Declarations shared with jdphuff.c */\n#include \"jpegcomp.h\"\n\n\n/*\n * Expanded entropy decoder object for Huffman decoding.\n *\n * The savable_state subrecord contains fields that change within an MCU,\n * but must not be updated permanently until we complete the MCU.\n */\n\ntypedef struct {\n  int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */\n} savable_state;\n\n/* This macro is to work around compilers with missing or broken\n * structure assignment.  You'll need to fix this code if you have\n * such a compiler and you change MAX_COMPS_IN_SCAN.\n */\n\n#ifndef NO_STRUCT_ASSIGN\n#define ASSIGN_STATE(dest,src)  ((dest) = (src))\n#else\n#if MAX_COMPS_IN_SCAN == 4\n#define ASSIGN_STATE(dest,src)  \\\n\t((dest).last_dc_val[0] = (src).last_dc_val[0], \\\n\t (dest).last_dc_val[1] = (src).last_dc_val[1], \\\n\t (dest).last_dc_val[2] = (src).last_dc_val[2], \\\n\t (dest).last_dc_val[3] = (src).last_dc_val[3])\n#endif\n#endif\n\n\ntypedef struct {\n  struct jpeg_entropy_decoder pub; /* public fields */\n\n  /* These fields are loaded into local variables at start of each MCU.\n   * In case of suspension, we exit WITHOUT updating them.\n   */\n  bitread_perm_state bitstate;\t/* Bit buffer at start of MCU */\n  savable_state saved;\t\t/* Other state at start of MCU */\n\n  /* These fields are NOT loaded into local working state. */\n  unsigned int restarts_to_go;\t/* MCUs left in this restart interval */\n\n  /* Pointers to derived tables (these workspaces have image lifespan) */\n  d_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS];\n  d_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS];\n\n  /* Precalculated info set up by start_pass for use in decode_mcu: */\n\n  /* Pointers to derived tables to be used for each block within an MCU */\n  d_derived_tbl * dc_cur_tbls[D_MAX_BLOCKS_IN_MCU];\n  d_derived_tbl * ac_cur_tbls[D_MAX_BLOCKS_IN_MCU];\n  /* Whether we care about the DC and AC coefficient values for each block */\n  boolean dc_needed[D_MAX_BLOCKS_IN_MCU];\n  boolean ac_needed[D_MAX_BLOCKS_IN_MCU];\n} huff_entropy_decoder;\n\ntypedef huff_entropy_decoder * huff_entropy_ptr;\n\n\n/*\n * Initialize for a Huffman-compressed scan.\n */\n\nMETHODDEF(void)\nstart_pass_huff_decoder (j_decompress_ptr cinfo)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  int ci, blkn, dctbl, actbl;\n  jpeg_component_info * compptr;\n\n  /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG.\n   * This ought to be an error condition, but we make it a warning because\n   * there are some baseline files out there with all zeroes in these bytes.\n   */\n  if (cinfo->Ss != 0 || cinfo->Se != DCTSIZE2-1 ||\n      cinfo->Ah != 0 || cinfo->Al != 0)\n    WARNMS(cinfo, JWRN_NOT_SEQUENTIAL);\n\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    dctbl = compptr->dc_tbl_no;\n    actbl = compptr->ac_tbl_no;\n    /* Compute derived values for Huffman tables */\n    /* We may do this more than once for a table, but it's not expensive */\n    jpeg_make_d_derived_tbl(cinfo, TRUE, dctbl,\n\t\t\t    & entropy->dc_derived_tbls[dctbl]);\n    jpeg_make_d_derived_tbl(cinfo, FALSE, actbl,\n\t\t\t    & entropy->ac_derived_tbls[actbl]);\n    /* Initialize DC predictions to 0 */\n    entropy->saved.last_dc_val[ci] = 0;\n  }\n\n  /* Precalculate decoding info for each block in an MCU of this scan */\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    ci = cinfo->MCU_membership[blkn];\n    compptr = cinfo->cur_comp_info[ci];\n    /* Precalculate which table to use for each block */\n    entropy->dc_cur_tbls[blkn] = entropy->dc_derived_tbls[compptr->dc_tbl_no];\n    entropy->ac_cur_tbls[blkn] = entropy->ac_derived_tbls[compptr->ac_tbl_no];\n    /* Decide whether we really care about the coefficient values */\n    if (compptr->component_needed) {\n      entropy->dc_needed[blkn] = TRUE;\n      /* we don't need the ACs if producing a 1/8th-size image */\n      entropy->ac_needed[blkn] = (compptr->_DCT_scaled_size > 1);\n    } else {\n      entropy->dc_needed[blkn] = entropy->ac_needed[blkn] = FALSE;\n    }\n  }\n\n  /* Initialize bitread state variables */\n  entropy->bitstate.bits_left = 0;\n  entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */\n  entropy->pub.insufficient_data = FALSE;\n\n  /* Initialize restart counter */\n  entropy->restarts_to_go = cinfo->restart_interval;\n}\n\n\n/*\n * Compute the derived values for a Huffman table.\n * This routine also performs some validation checks on the table.\n *\n * Note this is also used by jdphuff.c.\n */\n\nGLOBAL(void)\njpeg_make_d_derived_tbl (j_decompress_ptr cinfo, boolean isDC, int tblno,\n\t\t\t d_derived_tbl ** pdtbl)\n{\n  JHUFF_TBL *htbl;\n  d_derived_tbl *dtbl;\n  int p, i, l, si, numsymbols;\n  int lookbits, ctr;\n  char huffsize[257];\n  unsigned int huffcode[257];\n  unsigned int code;\n\n  /* Note that huffsize[] and huffcode[] are filled in code-length order,\n   * paralleling the order of the symbols themselves in htbl->huffval[].\n   */\n\n  /* Find the input Huffman table */\n  if (tblno < 0 || tblno >= NUM_HUFF_TBLS)\n    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);\n  htbl =\n    isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];\n  if (htbl == NULL)\n    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);\n\n  /* Allocate a workspace if we haven't already done so. */\n  if (*pdtbl == NULL)\n    *pdtbl = (d_derived_tbl *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(d_derived_tbl));\n  dtbl = *pdtbl;\n  dtbl->pub = htbl;\t\t/* fill in back link */\n  \n  /* Figure C.1: make table of Huffman code length for each symbol */\n\n  p = 0;\n  for (l = 1; l <= 16; l++) {\n    i = (int) htbl->bits[l];\n    if (i < 0 || p + i > 256)\t/* protect against table overrun */\n      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n    while (i--)\n      huffsize[p++] = (char) l;\n  }\n  huffsize[p] = 0;\n  numsymbols = p;\n  \n  /* Figure C.2: generate the codes themselves */\n  /* We also validate that the counts represent a legal Huffman code tree. */\n  \n  code = 0;\n  si = huffsize[0];\n  p = 0;\n  while (huffsize[p]) {\n    while (((int) huffsize[p]) == si) {\n      huffcode[p++] = code;\n      code++;\n    }\n    /* code is now 1 more than the last code used for codelength si; but\n     * it must still fit in si bits, since no code is allowed to be all ones.\n     */\n    if (((INT32) code) >= (((INT32) 1) << si))\n      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n    code <<= 1;\n    si++;\n  }\n\n  /* Figure F.15: generate decoding tables for bit-sequential decoding */\n\n  p = 0;\n  for (l = 1; l <= 16; l++) {\n    if (htbl->bits[l]) {\n      /* valoffset[l] = huffval[] index of 1st symbol of code length l,\n       * minus the minimum code of length l\n       */\n      dtbl->valoffset[l] = (INT32) p - (INT32) huffcode[p];\n      p += htbl->bits[l];\n      dtbl->maxcode[l] = huffcode[p-1]; /* maximum code of length l */\n    } else {\n      dtbl->maxcode[l] = -1;\t/* -1 if no codes of this length */\n    }\n  }\n  dtbl->valoffset[17] = 0;\n  dtbl->maxcode[17] = 0xFFFFFL; /* ensures jpeg_huff_decode terminates */\n\n  /* Compute lookahead tables to speed up decoding.\n   * First we set all the table entries to 0, indicating \"too long\";\n   * then we iterate through the Huffman codes that are short enough and\n   * fill in all the entries that correspond to bit sequences starting\n   * with that code.\n   */\n\n   for (i = 0; i < (1 << HUFF_LOOKAHEAD); i++)\n     dtbl->lookup[i] = (HUFF_LOOKAHEAD + 1) << HUFF_LOOKAHEAD;\n\n  p = 0;\n  for (l = 1; l <= HUFF_LOOKAHEAD; l++) {\n    for (i = 1; i <= (int) htbl->bits[l]; i++, p++) {\n      /* l = current code's length, p = its index in huffcode[] & huffval[]. */\n      /* Generate left-justified code followed by all possible bit sequences */\n      lookbits = huffcode[p] << (HUFF_LOOKAHEAD-l);\n      for (ctr = 1 << (HUFF_LOOKAHEAD-l); ctr > 0; ctr--) {\n\tdtbl->lookup[lookbits] = (l << HUFF_LOOKAHEAD) | htbl->huffval[p];\n\tlookbits++;\n      }\n    }\n  }\n\n  /* Validate symbols as being reasonable.\n   * For AC tables, we make no check, but accept all byte values 0..255.\n   * For DC tables, we require the symbols to be in range 0..15.\n   * (Tighter bounds could be applied depending on the data depth and mode,\n   * but this is sufficient to ensure safe decoding.)\n   */\n  if (isDC) {\n    for (i = 0; i < numsymbols; i++) {\n      int sym = htbl->huffval[i];\n      if (sym < 0 || sym > 15)\n\tERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n    }\n  }\n}\n\n\n/*\n * Out-of-line code for bit fetching (shared with jdphuff.c).\n * See jdhuff.h for info about usage.\n * Note: current values of get_buffer and bits_left are passed as parameters,\n * but are returned in the corresponding fields of the state struct.\n *\n * On most machines MIN_GET_BITS should be 25 to allow the full 32-bit width\n * of get_buffer to be used.  (On machines with wider words, an even larger\n * buffer could be used.)  However, on some machines 32-bit shifts are\n * quite slow and take time proportional to the number of places shifted.\n * (This is true with most PC compilers, for instance.)  In this case it may\n * be a win to set MIN_GET_BITS to the minimum value of 15.  This reduces the\n * average shift distance at the cost of more calls to jpeg_fill_bit_buffer.\n */\n\n#ifdef SLOW_SHIFT_32\n#define MIN_GET_BITS  15\t/* minimum allowable value */\n#else\n#define MIN_GET_BITS  (BIT_BUF_SIZE-7)\n#endif\n\n\nGLOBAL(boolean)\njpeg_fill_bit_buffer (bitread_working_state * state,\n\t\t      register bit_buf_type get_buffer, register int bits_left,\n\t\t      int nbits)\n/* Load up the bit buffer to a depth of at least nbits */\n{\n  /* Copy heavily used state fields into locals (hopefully registers) */\n  register const JOCTET * next_input_byte = state->next_input_byte;\n  register size_t bytes_in_buffer = state->bytes_in_buffer;\n  j_decompress_ptr cinfo = state->cinfo;\n\n  /* Attempt to load at least MIN_GET_BITS bits into get_buffer. */\n  /* (It is assumed that no request will be for more than that many bits.) */\n  /* We fail to do so only if we hit a marker or are forced to suspend. */\n\n  if (cinfo->unread_marker == 0) {\t/* cannot advance past a marker */\n    while (bits_left < MIN_GET_BITS) {\n      register int c;\n\n      /* Attempt to read a byte */\n      if (bytes_in_buffer == 0) {\n\tif (! (*cinfo->src->fill_input_buffer) (cinfo))\n\t  return FALSE;\n\tnext_input_byte = cinfo->src->next_input_byte;\n\tbytes_in_buffer = cinfo->src->bytes_in_buffer;\n      }\n      bytes_in_buffer--;\n      c = GETJOCTET(*next_input_byte++);\n\n      /* If it's 0xFF, check and discard stuffed zero byte */\n      if (c == 0xFF) {\n\t/* Loop here to discard any padding FF's on terminating marker,\n\t * so that we can save a valid unread_marker value.  NOTE: we will\n\t * accept multiple FF's followed by a 0 as meaning a single FF data\n\t * byte.  This data pattern is not valid according to the standard.\n\t */\n\tdo {\n\t  if (bytes_in_buffer == 0) {\n\t    if (! (*cinfo->src->fill_input_buffer) (cinfo))\n\t      return FALSE;\n\t    next_input_byte = cinfo->src->next_input_byte;\n\t    bytes_in_buffer = cinfo->src->bytes_in_buffer;\n\t  }\n\t  bytes_in_buffer--;\n\t  c = GETJOCTET(*next_input_byte++);\n\t} while (c == 0xFF);\n\n\tif (c == 0) {\n\t  /* Found FF/00, which represents an FF data byte */\n\t  c = 0xFF;\n\t} else {\n\t  /* Oops, it's actually a marker indicating end of compressed data.\n\t   * Save the marker code for later use.\n\t   * Fine point: it might appear that we should save the marker into\n\t   * bitread working state, not straight into permanent state.  But\n\t   * once we have hit a marker, we cannot need to suspend within the\n\t   * current MCU, because we will read no more bytes from the data\n\t   * source.  So it is OK to update permanent state right away.\n\t   */\n\t  cinfo->unread_marker = c;\n\t  /* See if we need to insert some fake zero bits. */\n\t  goto no_more_bytes;\n\t}\n      }\n\n      /* OK, load c into get_buffer */\n      get_buffer = (get_buffer << 8) | c;\n      bits_left += 8;\n    } /* end while */\n  } else {\n  no_more_bytes:\n    /* We get here if we've read the marker that terminates the compressed\n     * data segment.  There should be enough bits in the buffer register\n     * to satisfy the request; if so, no problem.\n     */\n    if (nbits > bits_left) {\n      /* Uh-oh.  Report corrupted data to user and stuff zeroes into\n       * the data stream, so that we can produce some kind of image.\n       * We use a nonvolatile flag to ensure that only one warning message\n       * appears per data segment.\n       */\n      if (! cinfo->entropy->insufficient_data) {\n\tWARNMS(cinfo, JWRN_HIT_MARKER);\n\tcinfo->entropy->insufficient_data = TRUE;\n      }\n      /* Fill the buffer with zero bits */\n      get_buffer <<= MIN_GET_BITS - bits_left;\n      bits_left = MIN_GET_BITS;\n    }\n  }\n\n  /* Unload the local registers */\n  state->next_input_byte = next_input_byte;\n  state->bytes_in_buffer = bytes_in_buffer;\n  state->get_buffer = get_buffer;\n  state->bits_left = bits_left;\n\n  return TRUE;\n}\n\n\n/* Macro version of the above, which performs much better but does not\n   handle markers.  We have to hand off any blocks with markers to the\n   slower routines. */\n\n#define GET_BYTE \\\n{ \\\n  register int c0, c1; \\\n  c0 = GETJOCTET(*buffer++); \\\n  c1 = GETJOCTET(*buffer); \\\n  /* Pre-execute most common case */ \\\n  get_buffer = (get_buffer << 8) | c0; \\\n  bits_left += 8; \\\n  if (c0 == 0xFF) { \\\n    /* Pre-execute case of FF/00, which represents an FF data byte */ \\\n    buffer++; \\\n    if (c1 != 0) { \\\n      /* Oops, it's actually a marker indicating end of compressed data. */ \\\n      cinfo->unread_marker = c1; \\\n      /* Back out pre-execution and fill the buffer with zero bits */ \\\n      buffer -= 2; \\\n      get_buffer &= ~0xFF; \\\n    } \\\n  } \\\n}\n\n#if __WORDSIZE == 64 || defined(_WIN64)\n\n/* Pre-fetch 48 bytes, because the holding register is 64-bit */\n#define FILL_BIT_BUFFER_FAST \\\n  if (bits_left < 16) { \\\n    GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \\\n  }\n\n#else\n\n/* Pre-fetch 16 bytes, because the holding register is 32-bit */\n#define FILL_BIT_BUFFER_FAST \\\n  if (bits_left < 16) { \\\n    GET_BYTE GET_BYTE \\\n  }\n\n#endif\n\n\n/*\n * Out-of-line code for Huffman code decoding.\n * See jdhuff.h for info about usage.\n */\n\nGLOBAL(int)\njpeg_huff_decode (bitread_working_state * state,\n\t\t  register bit_buf_type get_buffer, register int bits_left,\n\t\t  d_derived_tbl * htbl, int min_bits)\n{\n  register int l = min_bits;\n  register INT32 code;\n\n  /* HUFF_DECODE has determined that the code is at least min_bits */\n  /* bits long, so fetch that many bits in one swoop. */\n\n  CHECK_BIT_BUFFER(*state, l, return -1);\n  code = GET_BITS(l);\n\n  /* Collect the rest of the Huffman code one bit at a time. */\n  /* This is per Figure F.16 in the JPEG spec. */\n\n  while (code > htbl->maxcode[l]) {\n    code <<= 1;\n    CHECK_BIT_BUFFER(*state, 1, return -1);\n    code |= GET_BITS(1);\n    l++;\n  }\n\n  /* Unload the local registers */\n  state->get_buffer = get_buffer;\n  state->bits_left = bits_left;\n\n  /* With garbage input we may reach the sentinel value l = 17. */\n\n  if (l > 16) {\n    WARNMS(state->cinfo, JWRN_HUFF_BAD_CODE);\n    return 0;\t\t\t/* fake a zero as the safest result */\n  }\n\n  return htbl->pub->huffval[ (int) (code + htbl->valoffset[l]) ];\n}\n\n\n/*\n * Figure F.12: extend sign bit.\n * On some machines, a shift and add will be faster than a table lookup.\n */\n\n#define AVOID_TABLES\n#ifdef AVOID_TABLES\n\n#define HUFF_EXTEND(x,s)  ((x) + ((((x) - (1<<((s)-1))) >> 31) & (((-1)<<(s)) + 1)))\n\n#else\n\n#define HUFF_EXTEND(x,s)  ((x) < extend_test[s] ? (x) + extend_offset[s] : (x))\n\nstatic const int extend_test[16] =   /* entry n is 2**(n-1) */\n  { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,\n    0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };\n\nstatic const int extend_offset[16] = /* entry n is (-1 << n) + 1 */\n  { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1,\n    ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1,\n    ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1,\n    ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };\n\n#endif /* AVOID_TABLES */\n\n\n/*\n * Check for a restart marker & resynchronize decoder.\n * Returns FALSE if must suspend.\n */\n\nLOCAL(boolean)\nprocess_restart (j_decompress_ptr cinfo)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  int ci;\n\n  /* Throw away any unused bits remaining in bit buffer; */\n  /* include any full bytes in next_marker's count of discarded bytes */\n  cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;\n  entropy->bitstate.bits_left = 0;\n\n  /* Advance past the RSTn marker */\n  if (! (*cinfo->marker->read_restart_marker) (cinfo))\n    return FALSE;\n\n  /* Re-initialize DC predictions to 0 */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++)\n    entropy->saved.last_dc_val[ci] = 0;\n\n  /* Reset restart counter */\n  entropy->restarts_to_go = cinfo->restart_interval;\n\n  /* Reset out-of-data flag, unless read_restart_marker left us smack up\n   * against a marker.  In that case we will end up treating the next data\n   * segment as empty, and we can avoid producing bogus output pixels by\n   * leaving the flag set.\n   */\n  if (cinfo->unread_marker == 0)\n    entropy->pub.insufficient_data = FALSE;\n\n  return TRUE;\n}\n\n\nLOCAL(boolean)\ndecode_mcu_slow (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  BITREAD_STATE_VARS;\n  int blkn;\n  savable_state state;\n  /* Outer loop handles each block in the MCU */\n\n  /* Load up working state */\n  BITREAD_LOAD_STATE(cinfo,entropy->bitstate);\n  ASSIGN_STATE(state, entropy->saved);\n\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    JBLOCKROW block = MCU_data[blkn];\n    d_derived_tbl * dctbl = entropy->dc_cur_tbls[blkn];\n    d_derived_tbl * actbl = entropy->ac_cur_tbls[blkn];\n    register int s, k, r;\n\n    /* Decode a single block's worth of coefficients */\n\n    /* Section F.2.2.1: decode the DC coefficient difference */\n    HUFF_DECODE(s, br_state, dctbl, return FALSE, label1);\n    if (s) {\n      CHECK_BIT_BUFFER(br_state, s, return FALSE);\n      r = GET_BITS(s);\n      s = HUFF_EXTEND(r, s);\n    }\n\n    if (entropy->dc_needed[blkn]) {\n      /* Convert DC difference to actual value, update last_dc_val */\n      int ci = cinfo->MCU_membership[blkn];\n      s += state.last_dc_val[ci];\n      state.last_dc_val[ci] = s;\n      /* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */\n      (*block)[0] = (JCOEF) s;\n    }\n\n    if (entropy->ac_needed[blkn]) {\n\n      /* Section F.2.2.2: decode the AC coefficients */\n      /* Since zeroes are skipped, output area must be cleared beforehand */\n      for (k = 1; k < DCTSIZE2; k++) {\n        HUFF_DECODE(s, br_state, actbl, return FALSE, label2);\n\n        r = s >> 4;\n        s &= 15;\n      \n        if (s) {\n          k += r;\n          CHECK_BIT_BUFFER(br_state, s, return FALSE);\n          r = GET_BITS(s);\n          s = HUFF_EXTEND(r, s);\n          /* Output coefficient in natural (dezigzagged) order.\n           * Note: the extra entries in jpeg_natural_order[] will save us\n           * if k >= DCTSIZE2, which could happen if the data is corrupted.\n           */\n          (*block)[jpeg_natural_order[k]] = (JCOEF) s;\n        } else {\n          if (r != 15)\n            break;\n          k += 15;\n        }\n      }\n\n    } else {\n\n      /* Section F.2.2.2: decode the AC coefficients */\n      /* In this path we just discard the values */\n      for (k = 1; k < DCTSIZE2; k++) {\n        HUFF_DECODE(s, br_state, actbl, return FALSE, label3);\n\n        r = s >> 4;\n        s &= 15;\n\n        if (s) {\n          k += r;\n          CHECK_BIT_BUFFER(br_state, s, return FALSE);\n          DROP_BITS(s);\n        } else {\n          if (r != 15)\n            break;\n          k += 15;\n        }\n      }\n    }\n  }\n\n  /* Completed MCU, so update state */\n  BITREAD_SAVE_STATE(cinfo,entropy->bitstate);\n  ASSIGN_STATE(entropy->saved, state);\n  return TRUE;\n}\n\n\nLOCAL(boolean)\ndecode_mcu_fast (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  BITREAD_STATE_VARS;\n  JOCTET *buffer;\n  int blkn;\n  savable_state state;\n  /* Outer loop handles each block in the MCU */\n\n  /* Load up working state */\n  BITREAD_LOAD_STATE(cinfo,entropy->bitstate);\n  buffer = (JOCTET *) br_state.next_input_byte;\n  ASSIGN_STATE(state, entropy->saved);\n\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    JBLOCKROW block = MCU_data[blkn];\n    d_derived_tbl * dctbl = entropy->dc_cur_tbls[blkn];\n    d_derived_tbl * actbl = entropy->ac_cur_tbls[blkn];\n    register int s, k, r, l;\n\n    HUFF_DECODE_FAST(s, l, dctbl);\n    if (s) {\n      FILL_BIT_BUFFER_FAST\n      r = GET_BITS(s);\n      s = HUFF_EXTEND(r, s);\n    }\n\n    if (entropy->dc_needed[blkn]) {\n      int ci = cinfo->MCU_membership[blkn];\n      s += state.last_dc_val[ci];\n      state.last_dc_val[ci] = s;\n      (*block)[0] = (JCOEF) s;\n    }\n\n    if (entropy->ac_needed[blkn]) {\n\n      for (k = 1; k < DCTSIZE2; k++) {\n        HUFF_DECODE_FAST(s, l, actbl);\n        r = s >> 4;\n        s &= 15;\n      \n        if (s) {\n          k += r;\n          FILL_BIT_BUFFER_FAST\n          r = GET_BITS(s);\n          s = HUFF_EXTEND(r, s);\n          (*block)[jpeg_natural_order[k]] = (JCOEF) s;\n        } else {\n          if (r != 15) break;\n          k += 15;\n        }\n      }\n\n    } else {\n\n      for (k = 1; k < DCTSIZE2; k++) {\n        HUFF_DECODE_FAST(s, l, actbl);\n        r = s >> 4;\n        s &= 15;\n\n        if (s) {\n          k += r;\n          FILL_BIT_BUFFER_FAST\n          DROP_BITS(s);\n        } else {\n          if (r != 15) break;\n          k += 15;\n        }\n      }\n    }\n  }\n\n  if (cinfo->unread_marker != 0) {\n    cinfo->unread_marker = 0;\n    return FALSE;\n  }\n\n  br_state.bytes_in_buffer -= (buffer - br_state.next_input_byte);\n  br_state.next_input_byte = buffer;\n  BITREAD_SAVE_STATE(cinfo,entropy->bitstate);\n  ASSIGN_STATE(entropy->saved, state);\n  return TRUE;\n}\n\n\n/*\n * Decode and return one MCU's worth of Huffman-compressed coefficients.\n * The coefficients are reordered from zigzag order into natural array order,\n * but are not dequantized.\n *\n * The i'th block of the MCU is stored into the block pointed to by\n * MCU_data[i].  WE ASSUME THIS AREA HAS BEEN ZEROED BY THE CALLER.\n * (Wholesale zeroing is usually a little faster than retail...)\n *\n * Returns FALSE if data source requested suspension.  In that case no\n * changes have been made to permanent state.  (Exception: some output\n * coefficients may already have been assigned.  This is harmless for\n * this module, since we'll just re-assign them on the next call.)\n */\n\n#define BUFSIZE (DCTSIZE2 * 2)\n\nMETHODDEF(boolean)\ndecode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{\n  huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;\n  int usefast = 1;\n\n  /* Process restart marker if needed; may have to suspend */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      if (! process_restart(cinfo))\n\treturn FALSE;\n    usefast = 0;\n  }\n\n  if (cinfo->src->bytes_in_buffer < BUFSIZE * (size_t)cinfo->blocks_in_MCU\n    || cinfo->unread_marker != 0)\n    usefast = 0;\n\n  /* If we've run out of data, just leave the MCU set to zeroes.\n   * This way, we return uniform gray for the remainder of the segment.\n   */\n  if (! entropy->pub.insufficient_data) {\n\n    if (usefast) {\n      if (!decode_mcu_fast(cinfo, MCU_data)) goto use_slow;\n    }\n    else {\n      use_slow:\n      if (!decode_mcu_slow(cinfo, MCU_data)) return FALSE;\n    }\n\n  }\n\n  /* Account for restart interval (no-op if not using restarts) */\n  entropy->restarts_to_go--;\n\n  return TRUE;\n}\n\n\n/*\n * Module initialization routine for Huffman entropy decoding.\n */\n\nGLOBAL(void)\njinit_huff_decoder (j_decompress_ptr cinfo)\n{\n  huff_entropy_ptr entropy;\n  int i;\n\n  entropy = (huff_entropy_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(huff_entropy_decoder));\n  cinfo->entropy = (struct jpeg_entropy_decoder *) entropy;\n  entropy->pub.start_pass = start_pass_huff_decoder;\n  entropy->pub.decode_mcu = decode_mcu;\n\n  /* Mark tables unallocated */\n  for (i = 0; i < NUM_HUFF_TBLS; i++) {\n    entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;\n  }\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdhuff.h",
    "content": "/*\n * jdhuff.h\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modifications:\n * Copyright (C) 2010-2011, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains declarations for Huffman entropy decoding routines\n * that are shared between the sequential decoder (jdhuff.c) and the\n * progressive decoder (jdphuff.c).  No other modules need to see these.\n */\n\n/* Short forms of external names for systems with brain-damaged linkers. */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jpeg_make_d_derived_tbl\tjMkDDerived\n#define jpeg_fill_bit_buffer\tjFilBitBuf\n#define jpeg_huff_decode\tjHufDecode\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\n\n/* Derived data constructed for each Huffman table */\n\n#define HUFF_LOOKAHEAD\t8\t/* # of bits of lookahead */\n\ntypedef struct {\n  /* Basic tables: (element [0] of each array is unused) */\n  INT32 maxcode[18];\t\t/* largest code of length k (-1 if none) */\n  /* (maxcode[17] is a sentinel to ensure jpeg_huff_decode terminates) */\n  INT32 valoffset[18];\t\t/* huffval[] offset for codes of length k */\n  /* valoffset[k] = huffval[] index of 1st symbol of code length k, less\n   * the smallest code of length k; so given a code of length k, the\n   * corresponding symbol is huffval[code + valoffset[k]]\n   */\n\n  /* Link to public Huffman table (needed only in jpeg_huff_decode) */\n  JHUFF_TBL *pub;\n\n  /* Lookahead table: indexed by the next HUFF_LOOKAHEAD bits of\n   * the input data stream.  If the next Huffman code is no more\n   * than HUFF_LOOKAHEAD bits long, we can obtain its length and\n   * the corresponding symbol directly from this tables.\n   *\n   * The lower 8 bits of each table entry contain the number of\n   * bits in the corresponding Huffman code, or HUFF_LOOKAHEAD + 1\n   * if too long.  The next 8 bits of each entry contain the\n   * symbol.\n   */\n  int lookup[1<<HUFF_LOOKAHEAD];\n} d_derived_tbl;\n\n/* Expand a Huffman table definition into the derived format */\nEXTERN(void) jpeg_make_d_derived_tbl\n\tJPP((j_decompress_ptr cinfo, boolean isDC, int tblno,\n\t     d_derived_tbl ** pdtbl));\n\n\n/*\n * Fetching the next N bits from the input stream is a time-critical operation\n * for the Huffman decoders.  We implement it with a combination of inline\n * macros and out-of-line subroutines.  Note that N (the number of bits\n * demanded at one time) never exceeds 15 for JPEG use.\n *\n * We read source bytes into get_buffer and dole out bits as needed.\n * If get_buffer already contains enough bits, they are fetched in-line\n * by the macros CHECK_BIT_BUFFER and GET_BITS.  When there aren't enough\n * bits, jpeg_fill_bit_buffer is called; it will attempt to fill get_buffer\n * as full as possible (not just to the number of bits needed; this\n * prefetching reduces the overhead cost of calling jpeg_fill_bit_buffer).\n * Note that jpeg_fill_bit_buffer may return FALSE to indicate suspension.\n * On TRUE return, jpeg_fill_bit_buffer guarantees that get_buffer contains\n * at least the requested number of bits --- dummy zeroes are inserted if\n * necessary.\n */\n\n#if __WORDSIZE == 64 || defined(_WIN64)\n\ntypedef size_t bit_buf_type;\t/* type of bit-extraction buffer */\n#define BIT_BUF_SIZE  64\t\t/* size of buffer in bits */\n\n#else\n\ntypedef INT32 bit_buf_type;\t/* type of bit-extraction buffer */\n#define BIT_BUF_SIZE  32\t\t/* size of buffer in bits */\n\n#endif\n\n/* If long is > 32 bits on your machine, and shifting/masking longs is\n * reasonably fast, making bit_buf_type be long and setting BIT_BUF_SIZE\n * appropriately should be a win.  Unfortunately we can't define the size\n * with something like  #define BIT_BUF_SIZE (sizeof(bit_buf_type)*8)\n * because not all machines measure sizeof in 8-bit bytes.\n */\n\ntypedef struct {\t\t/* Bitreading state saved across MCUs */\n  bit_buf_type get_buffer;\t/* current bit-extraction buffer */\n  int bits_left;\t\t/* # of unused bits in it */\n} bitread_perm_state;\n\ntypedef struct {\t\t/* Bitreading working state within an MCU */\n  /* Current data source location */\n  /* We need a copy, rather than munging the original, in case of suspension */\n  const JOCTET * next_input_byte; /* => next byte to read from source */\n  size_t bytes_in_buffer;\t/* # of bytes remaining in source buffer */\n  /* Bit input buffer --- note these values are kept in register variables,\n   * not in this struct, inside the inner loops.\n   */\n  bit_buf_type get_buffer;\t/* current bit-extraction buffer */\n  int bits_left;\t\t/* # of unused bits in it */\n  /* Pointer needed by jpeg_fill_bit_buffer. */\n  j_decompress_ptr cinfo;\t/* back link to decompress master record */\n} bitread_working_state;\n\n/* Macros to declare and load/save bitread local variables. */\n#define BITREAD_STATE_VARS  \\\n\tregister bit_buf_type get_buffer;  \\\n\tregister int bits_left;  \\\n\tbitread_working_state br_state\n\n#define BITREAD_LOAD_STATE(cinfop,permstate)  \\\n\tbr_state.cinfo = cinfop; \\\n\tbr_state.next_input_byte = cinfop->src->next_input_byte; \\\n\tbr_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \\\n\tget_buffer = permstate.get_buffer; \\\n\tbits_left = permstate.bits_left;\n\n#define BITREAD_SAVE_STATE(cinfop,permstate)  \\\n\tcinfop->src->next_input_byte = br_state.next_input_byte; \\\n\tcinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \\\n\tpermstate.get_buffer = get_buffer; \\\n\tpermstate.bits_left = bits_left\n\n/*\n * These macros provide the in-line portion of bit fetching.\n * Use CHECK_BIT_BUFFER to ensure there are N bits in get_buffer\n * before using GET_BITS, PEEK_BITS, or DROP_BITS.\n * The variables get_buffer and bits_left are assumed to be locals,\n * but the state struct might not be (jpeg_huff_decode needs this).\n *\tCHECK_BIT_BUFFER(state,n,action);\n *\t\tEnsure there are N bits in get_buffer; if suspend, take action.\n *      val = GET_BITS(n);\n *\t\tFetch next N bits.\n *      val = PEEK_BITS(n);\n *\t\tFetch next N bits without removing them from the buffer.\n *\tDROP_BITS(n);\n *\t\tDiscard next N bits.\n * The value N should be a simple variable, not an expression, because it\n * is evaluated multiple times.\n */\n\n#define CHECK_BIT_BUFFER(state,nbits,action) \\\n\t{ if (bits_left < (nbits)) {  \\\n\t    if (! jpeg_fill_bit_buffer(&(state),get_buffer,bits_left,nbits))  \\\n\t      { action; }  \\\n\t    get_buffer = (state).get_buffer; bits_left = (state).bits_left; } }\n\n#define GET_BITS(nbits) \\\n\t(((int) (get_buffer >> (bits_left -= (nbits)))) & ((1<<(nbits))-1))\n\n#define PEEK_BITS(nbits) \\\n\t(((int) (get_buffer >> (bits_left -  (nbits)))) & ((1<<(nbits))-1))\n\n#define DROP_BITS(nbits) \\\n\t(bits_left -= (nbits))\n\n/* Load up the bit buffer to a depth of at least nbits */\nEXTERN(boolean) jpeg_fill_bit_buffer\n\tJPP((bitread_working_state * state, register bit_buf_type get_buffer,\n\t     register int bits_left, int nbits));\n\n\n/*\n * Code for extracting next Huffman-coded symbol from input bit stream.\n * Again, this is time-critical and we make the main paths be macros.\n *\n * We use a lookahead table to process codes of up to HUFF_LOOKAHEAD bits\n * without looping.  Usually, more than 95% of the Huffman codes will be 8\n * or fewer bits long.  The few overlength codes are handled with a loop,\n * which need not be inline code.\n *\n * Notes about the HUFF_DECODE macro:\n * 1. Near the end of the data segment, we may fail to get enough bits\n *    for a lookahead.  In that case, we do it the hard way.\n * 2. If the lookahead table contains no entry, the next code must be\n *    more than HUFF_LOOKAHEAD bits long.\n * 3. jpeg_huff_decode returns -1 if forced to suspend.\n */\n\n#define HUFF_DECODE(result,state,htbl,failaction,slowlabel) \\\n{ register int nb, look; \\\n  if (bits_left < HUFF_LOOKAHEAD) { \\\n    if (! jpeg_fill_bit_buffer(&state,get_buffer,bits_left, 0)) {failaction;} \\\n    get_buffer = state.get_buffer; bits_left = state.bits_left; \\\n    if (bits_left < HUFF_LOOKAHEAD) { \\\n      nb = 1; goto slowlabel; \\\n    } \\\n  } \\\n  look = PEEK_BITS(HUFF_LOOKAHEAD); \\\n  if ((nb = (htbl->lookup[look] >> HUFF_LOOKAHEAD)) <= HUFF_LOOKAHEAD) { \\\n    DROP_BITS(nb); \\\n    result = htbl->lookup[look] & ((1 << HUFF_LOOKAHEAD) - 1); \\\n  } else { \\\nslowlabel: \\\n    if ((result=jpeg_huff_decode(&state,get_buffer,bits_left,htbl,nb)) < 0) \\\n\t{ failaction; } \\\n    get_buffer = state.get_buffer; bits_left = state.bits_left; \\\n  } \\\n}\n\n#define HUFF_DECODE_FAST(s,nb,htbl) \\\n  FILL_BIT_BUFFER_FAST; \\\n  s = PEEK_BITS(HUFF_LOOKAHEAD); \\\n  s = htbl->lookup[s]; \\\n  nb = s >> HUFF_LOOKAHEAD; \\\n  /* Pre-execute the common case of nb <= HUFF_LOOKAHEAD */ \\\n  DROP_BITS(nb); \\\n  s = s & ((1 << HUFF_LOOKAHEAD) - 1); \\\n  if (nb > HUFF_LOOKAHEAD) { \\\n    /* Equivalent of jpeg_huff_decode() */ \\\n    /* Don't use GET_BITS() here because we don't want to modify bits_left */ \\\n    s = (get_buffer >> bits_left) & ((1 << (nb)) - 1); \\\n    while (s > htbl->maxcode[nb]) { \\\n      s <<= 1; \\\n      s |= GET_BITS(1); \\\n      nb++; \\\n    } \\\n    s = htbl->pub->huffval[ (int) (s + htbl->valoffset[nb]) & 0xFF ]; \\\n  }\n\n/* Out-of-line case for Huffman code fetching */\nEXTERN(int) jpeg_huff_decode\n\tJPP((bitread_working_state * state, register bit_buf_type get_buffer,\n\t     register int bits_left, d_derived_tbl * htbl, int min_bits));\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdinput.c",
    "content": "/*\n * jdinput.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains input control logic for the JPEG decompressor.\n * These routines are concerned with controlling the decompressor's input\n * processing (marker reading and coefficient decoding).  The actual input\n * reading is done in jdmarker.c, jdhuff.c, and jdphuff.c.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jpegcomp.h\"\n\n\n/* Private state */\n\ntypedef struct {\n  struct jpeg_input_controller pub; /* public fields */\n\n  boolean inheaders;\t\t/* TRUE until first SOS is reached */\n} my_input_controller;\n\ntypedef my_input_controller * my_inputctl_ptr;\n\n\n/* Forward declarations */\nMETHODDEF(int) consume_markers JPP((j_decompress_ptr cinfo));\n\n\n/*\n * Routines to calculate various quantities related to the size of the image.\n */\n\nLOCAL(void)\ninitial_setup (j_decompress_ptr cinfo)\n/* Called once, when first SOS marker is reached */\n{\n  int ci;\n  jpeg_component_info *compptr;\n\n  /* Make sure image isn't bigger than I can handle */\n  if ((long) cinfo->image_height > (long) JPEG_MAX_DIMENSION ||\n      (long) cinfo->image_width > (long) JPEG_MAX_DIMENSION)\n    ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);\n\n  /* For now, precision must match compiled-in value... */\n  if (cinfo->data_precision != BITS_IN_JSAMPLE)\n    ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);\n\n  /* Check that number of components won't exceed internal array sizes */\n  if (cinfo->num_components > MAX_COMPONENTS)\n    ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,\n\t     MAX_COMPONENTS);\n\n  /* Compute maximum sampling factors; check factor validity */\n  cinfo->max_h_samp_factor = 1;\n  cinfo->max_v_samp_factor = 1;\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    if (compptr->h_samp_factor<=0 || compptr->h_samp_factor>MAX_SAMP_FACTOR ||\n\tcompptr->v_samp_factor<=0 || compptr->v_samp_factor>MAX_SAMP_FACTOR)\n      ERREXIT(cinfo, JERR_BAD_SAMPLING);\n    cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,\n\t\t\t\t   compptr->h_samp_factor);\n    cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,\n\t\t\t\t   compptr->v_samp_factor);\n  }\n\n#if JPEG_LIB_VERSION >=80\n    cinfo->block_size = DCTSIZE;\n    cinfo->natural_order = jpeg_natural_order;\n    cinfo->lim_Se = DCTSIZE2-1;\n#endif\n\n  /* We initialize DCT_scaled_size and min_DCT_scaled_size to DCTSIZE.\n   * In the full decompressor, this will be overridden by jdmaster.c;\n   * but in the transcoder, jdmaster.c is not used, so we must do it here.\n   */\n#if JPEG_LIB_VERSION >= 70\n  cinfo->min_DCT_h_scaled_size = cinfo->min_DCT_v_scaled_size = DCTSIZE;\n#else\n  cinfo->min_DCT_scaled_size = DCTSIZE;\n#endif\n\n  /* Compute dimensions of components */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n#if JPEG_LIB_VERSION >= 70\n    compptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size = DCTSIZE;\n#else\n    compptr->DCT_scaled_size = DCTSIZE;\n#endif\n    /* Size in DCT blocks */\n    compptr->width_in_blocks = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,\n\t\t    (long) (cinfo->max_h_samp_factor * DCTSIZE));\n    compptr->height_in_blocks = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,\n\t\t    (long) (cinfo->max_v_samp_factor * DCTSIZE));\n    /* downsampled_width and downsampled_height will also be overridden by\n     * jdmaster.c if we are doing full decompression.  The transcoder library\n     * doesn't use these values, but the calling application might.\n     */\n    /* Size in samples */\n    compptr->downsampled_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * (long) compptr->h_samp_factor,\n\t\t    (long) cinfo->max_h_samp_factor);\n    compptr->downsampled_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * (long) compptr->v_samp_factor,\n\t\t    (long) cinfo->max_v_samp_factor);\n    /* Mark component needed, until color conversion says otherwise */\n    compptr->component_needed = TRUE;\n    /* Mark no quantization table yet saved for component */\n    compptr->quant_table = NULL;\n  }\n\n  /* Compute number of fully interleaved MCU rows. */\n  cinfo->total_iMCU_rows = (JDIMENSION)\n    jdiv_round_up((long) cinfo->image_height,\n\t\t  (long) (cinfo->max_v_samp_factor*DCTSIZE));\n\n  /* Decide whether file contains multiple scans */\n  if (cinfo->comps_in_scan < cinfo->num_components || cinfo->progressive_mode)\n    cinfo->inputctl->has_multiple_scans = TRUE;\n  else\n    cinfo->inputctl->has_multiple_scans = FALSE;\n}\n\n\nLOCAL(void)\nper_scan_setup (j_decompress_ptr cinfo)\n/* Do computations that are needed before processing a JPEG scan */\n/* cinfo->comps_in_scan and cinfo->cur_comp_info[] were set from SOS marker */\n{\n  int ci, mcublks, tmp;\n  jpeg_component_info *compptr;\n  \n  if (cinfo->comps_in_scan == 1) {\n    \n    /* Noninterleaved (single-component) scan */\n    compptr = cinfo->cur_comp_info[0];\n    \n    /* Overall image size in MCUs */\n    cinfo->MCUs_per_row = compptr->width_in_blocks;\n    cinfo->MCU_rows_in_scan = compptr->height_in_blocks;\n    \n    /* For noninterleaved scan, always one block per MCU */\n    compptr->MCU_width = 1;\n    compptr->MCU_height = 1;\n    compptr->MCU_blocks = 1;\n    compptr->MCU_sample_width = compptr->_DCT_scaled_size;\n    compptr->last_col_width = 1;\n    /* For noninterleaved scans, it is convenient to define last_row_height\n     * as the number of block rows present in the last iMCU row.\n     */\n    tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor);\n    if (tmp == 0) tmp = compptr->v_samp_factor;\n    compptr->last_row_height = tmp;\n    \n    /* Prepare array describing MCU composition */\n    cinfo->blocks_in_MCU = 1;\n    cinfo->MCU_membership[0] = 0;\n    \n  } else {\n    \n    /* Interleaved (multi-component) scan */\n    if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)\n      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,\n\t       MAX_COMPS_IN_SCAN);\n    \n    /* Overall image size in MCUs */\n    cinfo->MCUs_per_row = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width,\n\t\t    (long) (cinfo->max_h_samp_factor*DCTSIZE));\n    cinfo->MCU_rows_in_scan = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height,\n\t\t    (long) (cinfo->max_v_samp_factor*DCTSIZE));\n    \n    cinfo->blocks_in_MCU = 0;\n    \n    for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n      compptr = cinfo->cur_comp_info[ci];\n      /* Sampling factors give # of blocks of component in each MCU */\n      compptr->MCU_width = compptr->h_samp_factor;\n      compptr->MCU_height = compptr->v_samp_factor;\n      compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height;\n      compptr->MCU_sample_width = compptr->MCU_width * compptr->_DCT_scaled_size;\n      /* Figure number of non-dummy blocks in last MCU column & row */\n      tmp = (int) (compptr->width_in_blocks % compptr->MCU_width);\n      if (tmp == 0) tmp = compptr->MCU_width;\n      compptr->last_col_width = tmp;\n      tmp = (int) (compptr->height_in_blocks % compptr->MCU_height);\n      if (tmp == 0) tmp = compptr->MCU_height;\n      compptr->last_row_height = tmp;\n      /* Prepare array describing MCU composition */\n      mcublks = compptr->MCU_blocks;\n      if (cinfo->blocks_in_MCU + mcublks > D_MAX_BLOCKS_IN_MCU)\n\tERREXIT(cinfo, JERR_BAD_MCU_SIZE);\n      while (mcublks-- > 0) {\n\tcinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;\n      }\n    }\n    \n  }\n}\n\n\n/*\n * Save away a copy of the Q-table referenced by each component present\n * in the current scan, unless already saved during a prior scan.\n *\n * In a multiple-scan JPEG file, the encoder could assign different components\n * the same Q-table slot number, but change table definitions between scans\n * so that each component uses a different Q-table.  (The IJG encoder is not\n * currently capable of doing this, but other encoders might.)  Since we want\n * to be able to dequantize all the components at the end of the file, this\n * means that we have to save away the table actually used for each component.\n * We do this by copying the table at the start of the first scan containing\n * the component.\n * The JPEG spec prohibits the encoder from changing the contents of a Q-table\n * slot between scans of a component using that slot.  If the encoder does so\n * anyway, this decoder will simply use the Q-table values that were current\n * at the start of the first scan for the component.\n *\n * The decompressor output side looks only at the saved quant tables,\n * not at the current Q-table slots.\n */\n\nLOCAL(void)\nlatch_quant_tables (j_decompress_ptr cinfo)\n{\n  int ci, qtblno;\n  jpeg_component_info *compptr;\n  JQUANT_TBL * qtbl;\n\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    /* No work if we already saved Q-table for this component */\n    if (compptr->quant_table != NULL)\n      continue;\n    /* Make sure specified quantization table is present */\n    qtblno = compptr->quant_tbl_no;\n    if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS ||\n\tcinfo->quant_tbl_ptrs[qtblno] == NULL)\n      ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);\n    /* OK, save away the quantization table */\n    qtbl = (JQUANT_TBL *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(JQUANT_TBL));\n    MEMCOPY(qtbl, cinfo->quant_tbl_ptrs[qtblno], SIZEOF(JQUANT_TBL));\n    compptr->quant_table = qtbl;\n  }\n}\n\n\n/*\n * Initialize the input modules to read a scan of compressed data.\n * The first call to this is done by jdmaster.c after initializing\n * the entire decompressor (during jpeg_start_decompress).\n * Subsequent calls come from consume_markers, below.\n */\n\nMETHODDEF(void)\nstart_input_pass (j_decompress_ptr cinfo)\n{\n  per_scan_setup(cinfo);\n  latch_quant_tables(cinfo);\n  (*cinfo->entropy->start_pass) (cinfo);\n  (*cinfo->coef->start_input_pass) (cinfo);\n  cinfo->inputctl->consume_input = cinfo->coef->consume_data;\n}\n\n\n/*\n * Finish up after inputting a compressed-data scan.\n * This is called by the coefficient controller after it's read all\n * the expected data of the scan.\n */\n\nMETHODDEF(void)\nfinish_input_pass (j_decompress_ptr cinfo)\n{\n  cinfo->inputctl->consume_input = consume_markers;\n}\n\n\n/*\n * Read JPEG markers before, between, or after compressed-data scans.\n * Change state as necessary when a new scan is reached.\n * Return value is JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.\n *\n * The consume_input method pointer points either here or to the\n * coefficient controller's consume_data routine, depending on whether\n * we are reading a compressed data segment or inter-segment markers.\n */\n\nMETHODDEF(int)\nconsume_markers (j_decompress_ptr cinfo)\n{\n  my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl;\n  int val;\n\n  if (inputctl->pub.eoi_reached) /* After hitting EOI, read no further */\n    return JPEG_REACHED_EOI;\n\n  val = (*cinfo->marker->read_markers) (cinfo);\n\n  switch (val) {\n  case JPEG_REACHED_SOS:\t/* Found SOS */\n    if (inputctl->inheaders) {\t/* 1st SOS */\n      initial_setup(cinfo);\n      inputctl->inheaders = FALSE;\n      /* Note: start_input_pass must be called by jdmaster.c\n       * before any more input can be consumed.  jdapimin.c is\n       * responsible for enforcing this sequencing.\n       */\n    } else {\t\t\t/* 2nd or later SOS marker */\n      if (! inputctl->pub.has_multiple_scans)\n\tERREXIT(cinfo, JERR_EOI_EXPECTED); /* Oops, I wasn't expecting this! */\n      start_input_pass(cinfo);\n    }\n    break;\n  case JPEG_REACHED_EOI:\t/* Found EOI */\n    inputctl->pub.eoi_reached = TRUE;\n    if (inputctl->inheaders) {\t/* Tables-only datastream, apparently */\n      if (cinfo->marker->saw_SOF)\n\tERREXIT(cinfo, JERR_SOF_NO_SOS);\n    } else {\n      /* Prevent infinite loop in coef ctlr's decompress_data routine\n       * if user set output_scan_number larger than number of scans.\n       */\n      if (cinfo->output_scan_number > cinfo->input_scan_number)\n\tcinfo->output_scan_number = cinfo->input_scan_number;\n    }\n    break;\n  case JPEG_SUSPENDED:\n    break;\n  }\n\n  return val;\n}\n\n\n/*\n * Reset state to begin a fresh datastream.\n */\n\nMETHODDEF(void)\nreset_input_controller (j_decompress_ptr cinfo)\n{\n  my_inputctl_ptr inputctl = (my_inputctl_ptr) cinfo->inputctl;\n\n  inputctl->pub.consume_input = consume_markers;\n  inputctl->pub.has_multiple_scans = FALSE; /* \"unknown\" would be better */\n  inputctl->pub.eoi_reached = FALSE;\n  inputctl->inheaders = TRUE;\n  /* Reset other modules */\n  (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo);\n  (*cinfo->marker->reset_marker_reader) (cinfo);\n  /* Reset progression state -- would be cleaner if entropy decoder did this */\n  cinfo->coef_bits = NULL;\n}\n\n\n/*\n * Initialize the input controller module.\n * This is called only once, when the decompression object is created.\n */\n\nGLOBAL(void)\njinit_input_controller (j_decompress_ptr cinfo)\n{\n  my_inputctl_ptr inputctl;\n\n  /* Create subobject in permanent pool */\n  inputctl = (my_inputctl_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n\t\t\t\tSIZEOF(my_input_controller));\n  cinfo->inputctl = (struct jpeg_input_controller *) inputctl;\n  /* Initialize method pointers */\n  inputctl->pub.consume_input = consume_markers;\n  inputctl->pub.reset_input_controller = reset_input_controller;\n  inputctl->pub.start_input_pass = start_input_pass;\n  inputctl->pub.finish_input_pass = finish_input_pass;\n  /* Initialize state: can't use reset_input_controller since we don't\n   * want to try to reset other modules yet.\n   */\n  inputctl->pub.has_multiple_scans = FALSE; /* \"unknown\" would be better */\n  inputctl->pub.eoi_reached = FALSE;\n  inputctl->inheaders = TRUE;\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdmainct.c",
    "content": "/*\n * jdmainct.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains the main buffer controller for decompression.\n * The main buffer lies between the JPEG decompressor proper and the\n * post-processor; it holds downsampled data in the JPEG colorspace.\n *\n * Note that this code is bypassed in raw-data mode, since the application\n * supplies the equivalent of the main buffer in that case.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jpegcomp.h\"\n\n\n/*\n * In the current system design, the main buffer need never be a full-image\n * buffer; any full-height buffers will be found inside the coefficient or\n * postprocessing controllers.  Nonetheless, the main controller is not\n * trivial.  Its responsibility is to provide context rows for upsampling/\n * rescaling, and doing this in an efficient fashion is a bit tricky.\n *\n * Postprocessor input data is counted in \"row groups\".  A row group\n * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size)\n * sample rows of each component.  (We require DCT_scaled_size values to be\n * chosen such that these numbers are integers.  In practice DCT_scaled_size\n * values will likely be powers of two, so we actually have the stronger\n * condition that DCT_scaled_size / min_DCT_scaled_size is an integer.)\n * Upsampling will typically produce max_v_samp_factor pixel rows from each\n * row group (times any additional scale factor that the upsampler is\n * applying).\n *\n * The coefficient controller will deliver data to us one iMCU row at a time;\n * each iMCU row contains v_samp_factor * DCT_scaled_size sample rows, or\n * exactly min_DCT_scaled_size row groups.  (This amount of data corresponds\n * to one row of MCUs when the image is fully interleaved.)  Note that the\n * number of sample rows varies across components, but the number of row\n * groups does not.  Some garbage sample rows may be included in the last iMCU\n * row at the bottom of the image.\n *\n * Depending on the vertical scaling algorithm used, the upsampler may need\n * access to the sample row(s) above and below its current input row group.\n * The upsampler is required to set need_context_rows TRUE at global selection\n * time if so.  When need_context_rows is FALSE, this controller can simply\n * obtain one iMCU row at a time from the coefficient controller and dole it\n * out as row groups to the postprocessor.\n *\n * When need_context_rows is TRUE, this controller guarantees that the buffer\n * passed to postprocessing contains at least one row group's worth of samples\n * above and below the row group(s) being processed.  Note that the context\n * rows \"above\" the first passed row group appear at negative row offsets in\n * the passed buffer.  At the top and bottom of the image, the required\n * context rows are manufactured by duplicating the first or last real sample\n * row; this avoids having special cases in the upsampling inner loops.\n *\n * The amount of context is fixed at one row group just because that's a\n * convenient number for this controller to work with.  The existing\n * upsamplers really only need one sample row of context.  An upsampler\n * supporting arbitrary output rescaling might wish for more than one row\n * group of context when shrinking the image; tough, we don't handle that.\n * (This is justified by the assumption that downsizing will be handled mostly\n * by adjusting the DCT_scaled_size values, so that the actual scale factor at\n * the upsample step needn't be much less than one.)\n *\n * To provide the desired context, we have to retain the last two row groups\n * of one iMCU row while reading in the next iMCU row.  (The last row group\n * can't be processed until we have another row group for its below-context,\n * and so we have to save the next-to-last group too for its above-context.)\n * We could do this most simply by copying data around in our buffer, but\n * that'd be very slow.  We can avoid copying any data by creating a rather\n * strange pointer structure.  Here's how it works.  We allocate a workspace\n * consisting of M+2 row groups (where M = min_DCT_scaled_size is the number\n * of row groups per iMCU row).  We create two sets of redundant pointers to\n * the workspace.  Labeling the physical row groups 0 to M+1, the synthesized\n * pointer lists look like this:\n *                   M+1                          M-1\n * master pointer --> 0         master pointer --> 0\n *                    1                            1\n *                   ...                          ...\n *                   M-3                          M-3\n *                   M-2                           M\n *                   M-1                          M+1\n *                    M                           M-2\n *                   M+1                          M-1\n *                    0                            0\n * We read alternate iMCU rows using each master pointer; thus the last two\n * row groups of the previous iMCU row remain un-overwritten in the workspace.\n * The pointer lists are set up so that the required context rows appear to\n * be adjacent to the proper places when we pass the pointer lists to the\n * upsampler.\n *\n * The above pictures describe the normal state of the pointer lists.\n * At top and bottom of the image, we diddle the pointer lists to duplicate\n * the first or last sample row as necessary (this is cheaper than copying\n * sample rows around).\n *\n * This scheme breaks down if M < 2, ie, min_DCT_scaled_size is 1.  In that\n * situation each iMCU row provides only one row group so the buffering logic\n * must be different (eg, we must read two iMCU rows before we can emit the\n * first row group).  For now, we simply do not support providing context\n * rows when min_DCT_scaled_size is 1.  That combination seems unlikely to\n * be worth providing --- if someone wants a 1/8th-size preview, they probably\n * want it quick and dirty, so a context-free upsampler is sufficient.\n */\n\n\n/* Private buffer controller object */\n\ntypedef struct {\n  struct jpeg_d_main_controller pub; /* public fields */\n\n  /* Pointer to allocated workspace (M or M+2 row groups). */\n  JSAMPARRAY buffer[MAX_COMPONENTS];\n\n  boolean buffer_full;\t\t/* Have we gotten an iMCU row from decoder? */\n  JDIMENSION rowgroup_ctr;\t/* counts row groups output to postprocessor */\n\n  /* Remaining fields are only used in the context case. */\n\n  /* These are the master pointers to the funny-order pointer lists. */\n  JSAMPIMAGE xbuffer[2];\t/* pointers to weird pointer lists */\n\n  int whichptr;\t\t\t/* indicates which pointer set is now in use */\n  int context_state;\t\t/* process_data state machine status */\n  JDIMENSION rowgroups_avail;\t/* row groups available to postprocessor */\n  JDIMENSION iMCU_row_ctr;\t/* counts iMCU rows to detect image top/bot */\n} my_main_controller;\n\ntypedef my_main_controller * my_main_ptr;\n\n/* context_state values: */\n#define CTX_PREPARE_FOR_IMCU\t0\t/* need to prepare for MCU row */\n#define CTX_PROCESS_IMCU\t1\t/* feeding iMCU to postprocessor */\n#define CTX_POSTPONED_ROW\t2\t/* feeding postponed row group */\n\n\n/* Forward declarations */\nMETHODDEF(void) process_data_simple_main\n\tJPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,\n\t     JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));\nMETHODDEF(void) process_data_context_main\n\tJPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,\n\t     JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));\n#ifdef QUANT_2PASS_SUPPORTED\nMETHODDEF(void) process_data_crank_post\n\tJPP((j_decompress_ptr cinfo, JSAMPARRAY output_buf,\n\t     JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail));\n#endif\n\n\nLOCAL(void)\nalloc_funny_pointers (j_decompress_ptr cinfo)\n/* Allocate space for the funny pointer lists.\n * This is done only once, not once per pass.\n */\n{\n  my_main_ptr main_ptr = (my_main_ptr) cinfo->main;\n  int ci, rgroup;\n  int M = cinfo->_min_DCT_scaled_size;\n  jpeg_component_info *compptr;\n  JSAMPARRAY xbuf;\n\n  /* Get top-level space for component array pointers.\n   * We alloc both arrays with one call to save a few cycles.\n   */\n  main_ptr->xbuffer[0] = (JSAMPIMAGE)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tcinfo->num_components * 2 * SIZEOF(JSAMPARRAY));\n  main_ptr->xbuffer[1] = main_ptr->xbuffer[0] + cinfo->num_components;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    rgroup = (compptr->v_samp_factor * compptr->_DCT_scaled_size) /\n      cinfo->_min_DCT_scaled_size; /* height of a row group of component */\n    /* Get space for pointer lists --- M+4 row groups in each list.\n     * We alloc both pointer lists with one call to save a few cycles.\n     */\n    xbuf = (JSAMPARRAY)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  2 * (rgroup * (M + 4)) * SIZEOF(JSAMPROW));\n    xbuf += rgroup;\t\t/* want one row group at negative offsets */\n    main_ptr->xbuffer[0][ci] = xbuf;\n    xbuf += rgroup * (M + 4);\n    main_ptr->xbuffer[1][ci] = xbuf;\n  }\n}\n\n\nLOCAL(void)\nmake_funny_pointers (j_decompress_ptr cinfo)\n/* Create the funny pointer lists discussed in the comments above.\n * The actual workspace is already allocated (in main_ptr->buffer),\n * and the space for the pointer lists is allocated too.\n * This routine just fills in the curiously ordered lists.\n * This will be repeated at the beginning of each pass.\n */\n{\n  my_main_ptr main_ptr = (my_main_ptr) cinfo->main;\n  int ci, i, rgroup;\n  int M = cinfo->_min_DCT_scaled_size;\n  jpeg_component_info *compptr;\n  JSAMPARRAY buf, xbuf0, xbuf1;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    rgroup = (compptr->v_samp_factor * compptr->_DCT_scaled_size) /\n      cinfo->_min_DCT_scaled_size; /* height of a row group of component */\n    xbuf0 = main_ptr->xbuffer[0][ci];\n    xbuf1 = main_ptr->xbuffer[1][ci];\n    /* First copy the workspace pointers as-is */\n    buf = main_ptr->buffer[ci];\n    for (i = 0; i < rgroup * (M + 2); i++) {\n      xbuf0[i] = xbuf1[i] = buf[i];\n    }\n    /* In the second list, put the last four row groups in swapped order */\n    for (i = 0; i < rgroup * 2; i++) {\n      xbuf1[rgroup*(M-2) + i] = buf[rgroup*M + i];\n      xbuf1[rgroup*M + i] = buf[rgroup*(M-2) + i];\n    }\n    /* The wraparound pointers at top and bottom will be filled later\n     * (see set_wraparound_pointers, below).  Initially we want the \"above\"\n     * pointers to duplicate the first actual data line.  This only needs\n     * to happen in xbuffer[0].\n     */\n    for (i = 0; i < rgroup; i++) {\n      xbuf0[i - rgroup] = xbuf0[0];\n    }\n  }\n}\n\n\nLOCAL(void)\nset_wraparound_pointers (j_decompress_ptr cinfo)\n/* Set up the \"wraparound\" pointers at top and bottom of the pointer lists.\n * This changes the pointer list state from top-of-image to the normal state.\n */\n{\n  my_main_ptr main_ptr = (my_main_ptr) cinfo->main;\n  int ci, i, rgroup;\n  int M = cinfo->_min_DCT_scaled_size;\n  jpeg_component_info *compptr;\n  JSAMPARRAY xbuf0, xbuf1;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    rgroup = (compptr->v_samp_factor * compptr->_DCT_scaled_size) /\n      cinfo->_min_DCT_scaled_size; /* height of a row group of component */\n    xbuf0 = main_ptr->xbuffer[0][ci];\n    xbuf1 = main_ptr->xbuffer[1][ci];\n    for (i = 0; i < rgroup; i++) {\n      xbuf0[i - rgroup] = xbuf0[rgroup*(M+1) + i];\n      xbuf1[i - rgroup] = xbuf1[rgroup*(M+1) + i];\n      xbuf0[rgroup*(M+2) + i] = xbuf0[i];\n      xbuf1[rgroup*(M+2) + i] = xbuf1[i];\n    }\n  }\n}\n\n\nLOCAL(void)\nset_bottom_pointers (j_decompress_ptr cinfo)\n/* Change the pointer lists to duplicate the last sample row at the bottom\n * of the image.  whichptr indicates which xbuffer holds the final iMCU row.\n * Also sets rowgroups_avail to indicate number of nondummy row groups in row.\n */\n{\n  my_main_ptr main_ptr = (my_main_ptr) cinfo->main;\n  int ci, i, rgroup, iMCUheight, rows_left;\n  jpeg_component_info *compptr;\n  JSAMPARRAY xbuf;\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Count sample rows in one iMCU row and in one row group */\n    iMCUheight = compptr->v_samp_factor * compptr->_DCT_scaled_size;\n    rgroup = iMCUheight / cinfo->_min_DCT_scaled_size;\n    /* Count nondummy sample rows remaining for this component */\n    rows_left = (int) (compptr->downsampled_height % (JDIMENSION) iMCUheight);\n    if (rows_left == 0) rows_left = iMCUheight;\n    /* Count nondummy row groups.  Should get same answer for each component,\n     * so we need only do it once.\n     */\n    if (ci == 0) {\n      main_ptr->rowgroups_avail = (JDIMENSION) ((rows_left-1) / rgroup + 1);\n    }\n    /* Duplicate the last real sample row rgroup*2 times; this pads out the\n     * last partial rowgroup and ensures at least one full rowgroup of context.\n     */\n    xbuf = main_ptr->xbuffer[main_ptr->whichptr][ci];\n    for (i = 0; i < rgroup * 2; i++) {\n      xbuf[rows_left + i] = xbuf[rows_left-1];\n    }\n  }\n}\n\n\n/*\n * Initialize for a processing pass.\n */\n\nMETHODDEF(void)\nstart_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)\n{\n  my_main_ptr main_ptr = (my_main_ptr) cinfo->main;\n\n  switch (pass_mode) {\n  case JBUF_PASS_THRU:\n    if (cinfo->upsample->need_context_rows) {\n      main_ptr->pub.process_data = process_data_context_main;\n      make_funny_pointers(cinfo); /* Create the xbuffer[] lists */\n      main_ptr->whichptr = 0;\t/* Read first iMCU row into xbuffer[0] */\n      main_ptr->context_state = CTX_PREPARE_FOR_IMCU;\n      main_ptr->iMCU_row_ctr = 0;\n    } else {\n      /* Simple case with no context needed */\n      main_ptr->pub.process_data = process_data_simple_main;\n    }\n    main_ptr->buffer_full = FALSE;\t/* Mark buffer empty */\n    main_ptr->rowgroup_ctr = 0;\n    break;\n#ifdef QUANT_2PASS_SUPPORTED\n  case JBUF_CRANK_DEST:\n    /* For last pass of 2-pass quantization, just crank the postprocessor */\n    main_ptr->pub.process_data = process_data_crank_post;\n    break;\n#endif\n  default:\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    break;\n  }\n}\n\n\n/*\n * Process some data.\n * This handles the simple case where no context is required.\n */\n\nMETHODDEF(void)\nprocess_data_simple_main (j_decompress_ptr cinfo,\n\t\t\t  JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t\t\t  JDIMENSION out_rows_avail)\n{\n  my_main_ptr main_ptr = (my_main_ptr) cinfo->main;\n  JDIMENSION rowgroups_avail;\n\n  /* Read input data if we haven't filled the main buffer yet */\n  if (! main_ptr->buffer_full) {\n    if (! (*cinfo->coef->decompress_data) (cinfo, main_ptr->buffer))\n      return;\t\t\t/* suspension forced, can do nothing more */\n    main_ptr->buffer_full = TRUE;\t/* OK, we have an iMCU row to work with */\n  }\n\n  /* There are always min_DCT_scaled_size row groups in an iMCU row. */\n  rowgroups_avail = (JDIMENSION) cinfo->_min_DCT_scaled_size;\n  /* Note: at the bottom of the image, we may pass extra garbage row groups\n   * to the postprocessor.  The postprocessor has to check for bottom\n   * of image anyway (at row resolution), so no point in us doing it too.\n   */\n\n  /* Feed the postprocessor */\n  (*cinfo->post->post_process_data) (cinfo, main_ptr->buffer,\n\t\t\t\t     &main_ptr->rowgroup_ctr, rowgroups_avail,\n\t\t\t\t     output_buf, out_row_ctr, out_rows_avail);\n\n  /* Has postprocessor consumed all the data yet? If so, mark buffer empty */\n  if (main_ptr->rowgroup_ctr >= rowgroups_avail) {\n    main_ptr->buffer_full = FALSE;\n    main_ptr->rowgroup_ctr = 0;\n  }\n}\n\n\n/*\n * Process some data.\n * This handles the case where context rows must be provided.\n */\n\nMETHODDEF(void)\nprocess_data_context_main (j_decompress_ptr cinfo,\n\t\t\t   JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t\t\t   JDIMENSION out_rows_avail)\n{\n  my_main_ptr main_ptr = (my_main_ptr) cinfo->main;\n\n  /* Read input data if we haven't filled the main buffer yet */\n  if (! main_ptr->buffer_full) {\n    if (! (*cinfo->coef->decompress_data) (cinfo,\n\t\t\t\t\t   main_ptr->xbuffer[main_ptr->whichptr]))\n      return;\t\t\t/* suspension forced, can do nothing more */\n    main_ptr->buffer_full = TRUE;\t/* OK, we have an iMCU row to work with */\n    main_ptr->iMCU_row_ctr++;\t/* count rows received */\n  }\n\n  /* Postprocessor typically will not swallow all the input data it is handed\n   * in one call (due to filling the output buffer first).  Must be prepared\n   * to exit and restart.  This switch lets us keep track of how far we got.\n   * Note that each case falls through to the next on successful completion.\n   */\n  switch (main_ptr->context_state) {\n  case CTX_POSTPONED_ROW:\n    /* Call postprocessor using previously set pointers for postponed row */\n    (*cinfo->post->post_process_data) (cinfo, main_ptr->xbuffer[main_ptr->whichptr],\n\t\t\t&main_ptr->rowgroup_ctr, main_ptr->rowgroups_avail,\n\t\t\toutput_buf, out_row_ctr, out_rows_avail);\n    if (main_ptr->rowgroup_ctr < main_ptr->rowgroups_avail)\n      return;\t\t\t/* Need to suspend */\n    main_ptr->context_state = CTX_PREPARE_FOR_IMCU;\n    if (*out_row_ctr >= out_rows_avail)\n      return;\t\t\t/* Postprocessor exactly filled output buf */\n    /*FALLTHROUGH*/\n  case CTX_PREPARE_FOR_IMCU:\n    /* Prepare to process first M-1 row groups of this iMCU row */\n    main_ptr->rowgroup_ctr = 0;\n    main_ptr->rowgroups_avail = (JDIMENSION) (cinfo->_min_DCT_scaled_size - 1);\n    /* Check for bottom of image: if so, tweak pointers to \"duplicate\"\n     * the last sample row, and adjust rowgroups_avail to ignore padding rows.\n     */\n    if (main_ptr->iMCU_row_ctr == cinfo->total_iMCU_rows)\n      set_bottom_pointers(cinfo);\n    main_ptr->context_state = CTX_PROCESS_IMCU;\n    /*FALLTHROUGH*/\n  case CTX_PROCESS_IMCU:\n    /* Call postprocessor using previously set pointers */\n    (*cinfo->post->post_process_data) (cinfo, main_ptr->xbuffer[main_ptr->whichptr],\n\t\t\t&main_ptr->rowgroup_ctr, main_ptr->rowgroups_avail,\n\t\t\toutput_buf, out_row_ctr, out_rows_avail);\n    if (main_ptr->rowgroup_ctr < main_ptr->rowgroups_avail)\n      return;\t\t\t/* Need to suspend */\n    /* After the first iMCU, change wraparound pointers to normal state */\n    if (main_ptr->iMCU_row_ctr == 1)\n      set_wraparound_pointers(cinfo);\n    /* Prepare to load new iMCU row using other xbuffer list */\n    main_ptr->whichptr ^= 1;\t/* 0=>1 or 1=>0 */\n    main_ptr->buffer_full = FALSE;\n    /* Still need to process last row group of this iMCU row, */\n    /* which is saved at index M+1 of the other xbuffer */\n    main_ptr->rowgroup_ctr = (JDIMENSION) (cinfo->_min_DCT_scaled_size + 1);\n    main_ptr->rowgroups_avail = (JDIMENSION) (cinfo->_min_DCT_scaled_size + 2);\n    main_ptr->context_state = CTX_POSTPONED_ROW;\n  }\n}\n\n\n/*\n * Process some data.\n * Final pass of two-pass quantization: just call the postprocessor.\n * Source data will be the postprocessor controller's internal buffer.\n */\n\n#ifdef QUANT_2PASS_SUPPORTED\n\nMETHODDEF(void)\nprocess_data_crank_post (j_decompress_ptr cinfo,\n\t\t\t JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t\t\t JDIMENSION out_rows_avail)\n{\n  (*cinfo->post->post_process_data) (cinfo, (JSAMPIMAGE) NULL,\n\t\t\t\t     (JDIMENSION *) NULL, (JDIMENSION) 0,\n\t\t\t\t     output_buf, out_row_ctr, out_rows_avail);\n}\n\n#endif /* QUANT_2PASS_SUPPORTED */\n\n\n/*\n * Initialize main buffer controller.\n */\n\nGLOBAL(void)\njinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer)\n{\n  my_main_ptr main_ptr;\n  int ci, rgroup, ngroups;\n  jpeg_component_info *compptr;\n\n  main_ptr = (my_main_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_main_controller));\n  cinfo->main = (struct jpeg_d_main_controller *) main_ptr;\n  main_ptr->pub.start_pass = start_pass_main;\n\n  if (need_full_buffer)\t\t/* shouldn't happen */\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n\n  /* Allocate the workspace.\n   * ngroups is the number of row groups we need.\n   */\n  if (cinfo->upsample->need_context_rows) {\n    if (cinfo->_min_DCT_scaled_size < 2) /* unsupported, see comments above */\n      ERREXIT(cinfo, JERR_NOTIMPL);\n    alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */\n    ngroups = cinfo->_min_DCT_scaled_size + 2;\n  } else {\n    ngroups = cinfo->_min_DCT_scaled_size;\n  }\n\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    rgroup = (compptr->v_samp_factor * compptr->_DCT_scaled_size) /\n      cinfo->_min_DCT_scaled_size; /* height of a row group of component */\n    main_ptr->buffer[ci] = (*cinfo->mem->alloc_sarray)\n\t\t\t((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t compptr->width_in_blocks * compptr->_DCT_scaled_size,\n\t\t\t (JDIMENSION) (rgroup * ngroups));\n  }\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdmarker.c",
    "content": "/*\n * jdmarker.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2012, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to decode JPEG datastream markers.\n * Most of the complexity arises from our desire to support input\n * suspension: if not all of the data for a marker is available,\n * we must exit back to the application.  On resumption, we reprocess\n * the marker.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\ntypedef enum {\t\t\t/* JPEG marker codes */\n  M_SOF0  = 0xc0,\n  M_SOF1  = 0xc1,\n  M_SOF2  = 0xc2,\n  M_SOF3  = 0xc3,\n  \n  M_SOF5  = 0xc5,\n  M_SOF6  = 0xc6,\n  M_SOF7  = 0xc7,\n  \n  M_JPG   = 0xc8,\n  M_SOF9  = 0xc9,\n  M_SOF10 = 0xca,\n  M_SOF11 = 0xcb,\n  \n  M_SOF13 = 0xcd,\n  M_SOF14 = 0xce,\n  M_SOF15 = 0xcf,\n  \n  M_DHT   = 0xc4,\n  \n  M_DAC   = 0xcc,\n  \n  M_RST0  = 0xd0,\n  M_RST1  = 0xd1,\n  M_RST2  = 0xd2,\n  M_RST3  = 0xd3,\n  M_RST4  = 0xd4,\n  M_RST5  = 0xd5,\n  M_RST6  = 0xd6,\n  M_RST7  = 0xd7,\n  \n  M_SOI   = 0xd8,\n  M_EOI   = 0xd9,\n  M_SOS   = 0xda,\n  M_DQT   = 0xdb,\n  M_DNL   = 0xdc,\n  M_DRI   = 0xdd,\n  M_DHP   = 0xde,\n  M_EXP   = 0xdf,\n  \n  M_APP0  = 0xe0,\n  M_APP1  = 0xe1,\n  M_APP2  = 0xe2,\n  M_APP3  = 0xe3,\n  M_APP4  = 0xe4,\n  M_APP5  = 0xe5,\n  M_APP6  = 0xe6,\n  M_APP7  = 0xe7,\n  M_APP8  = 0xe8,\n  M_APP9  = 0xe9,\n  M_APP10 = 0xea,\n  M_APP11 = 0xeb,\n  M_APP12 = 0xec,\n  M_APP13 = 0xed,\n  M_APP14 = 0xee,\n  M_APP15 = 0xef,\n  \n  M_JPG0  = 0xf0,\n  M_JPG13 = 0xfd,\n  M_COM   = 0xfe,\n  \n  M_TEM   = 0x01,\n  \n  M_ERROR = 0x100\n} JPEG_MARKER;\n\n\n/* Private state */\n\ntypedef struct {\n  struct jpeg_marker_reader pub; /* public fields */\n\n  /* Application-overridable marker processing methods */\n  jpeg_marker_parser_method process_COM;\n  jpeg_marker_parser_method process_APPn[16];\n\n  /* Limit on marker data length to save for each marker type */\n  unsigned int length_limit_COM;\n  unsigned int length_limit_APPn[16];\n\n  /* Status of COM/APPn marker saving */\n  jpeg_saved_marker_ptr cur_marker;\t/* NULL if not processing a marker */\n  unsigned int bytes_read;\t\t/* data bytes read so far in marker */\n  /* Note: cur_marker is not linked into marker_list until it's all read. */\n} my_marker_reader;\n\ntypedef my_marker_reader * my_marker_ptr;\n\n\n/*\n * Macros for fetching data from the data source module.\n *\n * At all times, cinfo->src->next_input_byte and ->bytes_in_buffer reflect\n * the current restart point; we update them only when we have reached a\n * suitable place to restart if a suspension occurs.\n */\n\n/* Declare and initialize local copies of input pointer/count */\n#define INPUT_VARS(cinfo)  \\\n\tstruct jpeg_source_mgr * datasrc = (cinfo)->src;  \\\n\tconst JOCTET * next_input_byte = datasrc->next_input_byte;  \\\n\tsize_t bytes_in_buffer = datasrc->bytes_in_buffer\n\n/* Unload the local copies --- do this only at a restart boundary */\n#define INPUT_SYNC(cinfo)  \\\n\t( datasrc->next_input_byte = next_input_byte,  \\\n\t  datasrc->bytes_in_buffer = bytes_in_buffer )\n\n/* Reload the local copies --- used only in MAKE_BYTE_AVAIL */\n#define INPUT_RELOAD(cinfo)  \\\n\t( next_input_byte = datasrc->next_input_byte,  \\\n\t  bytes_in_buffer = datasrc->bytes_in_buffer )\n\n/* Internal macro for INPUT_BYTE and INPUT_2BYTES: make a byte available.\n * Note we do *not* do INPUT_SYNC before calling fill_input_buffer,\n * but we must reload the local copies after a successful fill.\n */\n#define MAKE_BYTE_AVAIL(cinfo,action)  \\\n\tif (bytes_in_buffer == 0) {  \\\n\t  if (! (*datasrc->fill_input_buffer) (cinfo))  \\\n\t    { action; }  \\\n\t  INPUT_RELOAD(cinfo);  \\\n\t}\n\n/* Read a byte into variable V.\n * If must suspend, take the specified action (typically \"return FALSE\").\n */\n#define INPUT_BYTE(cinfo,V,action)  \\\n\tMAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \\\n\t\t  bytes_in_buffer--; \\\n\t\t  V = GETJOCTET(*next_input_byte++); )\n\n/* As above, but read two bytes interpreted as an unsigned 16-bit integer.\n * V should be declared unsigned int or perhaps INT32.\n */\n#define INPUT_2BYTES(cinfo,V,action)  \\\n\tMAKESTMT( MAKE_BYTE_AVAIL(cinfo,action); \\\n\t\t  bytes_in_buffer--; \\\n\t\t  V = ((unsigned int) GETJOCTET(*next_input_byte++)) << 8; \\\n\t\t  MAKE_BYTE_AVAIL(cinfo,action); \\\n\t\t  bytes_in_buffer--; \\\n\t\t  V += GETJOCTET(*next_input_byte++); )\n\n\n/*\n * Routines to process JPEG markers.\n *\n * Entry condition: JPEG marker itself has been read and its code saved\n *   in cinfo->unread_marker; input restart point is just after the marker.\n *\n * Exit: if return TRUE, have read and processed any parameters, and have\n *   updated the restart point to point after the parameters.\n *   If return FALSE, was forced to suspend before reaching end of\n *   marker parameters; restart point has not been moved.  Same routine\n *   will be called again after application supplies more input data.\n *\n * This approach to suspension assumes that all of a marker's parameters\n * can fit into a single input bufferload.  This should hold for \"normal\"\n * markers.  Some COM/APPn markers might have large parameter segments\n * that might not fit.  If we are simply dropping such a marker, we use\n * skip_input_data to get past it, and thereby put the problem on the\n * source manager's shoulders.  If we are saving the marker's contents\n * into memory, we use a slightly different convention: when forced to\n * suspend, the marker processor updates the restart point to the end of\n * what it's consumed (ie, the end of the buffer) before returning FALSE.\n * On resumption, cinfo->unread_marker still contains the marker code,\n * but the data source will point to the next chunk of marker data.\n * The marker processor must retain internal state to deal with this.\n *\n * Note that we don't bother to avoid duplicate trace messages if a\n * suspension occurs within marker parameters.  Other side effects\n * require more care.\n */\n\n\nLOCAL(boolean)\nget_soi (j_decompress_ptr cinfo)\n/* Process an SOI marker */\n{\n  int i;\n  \n  TRACEMS(cinfo, 1, JTRC_SOI);\n\n  if (cinfo->marker->saw_SOI)\n    ERREXIT(cinfo, JERR_SOI_DUPLICATE);\n\n  /* Reset all parameters that are defined to be reset by SOI */\n\n  for (i = 0; i < NUM_ARITH_TBLS; i++) {\n    cinfo->arith_dc_L[i] = 0;\n    cinfo->arith_dc_U[i] = 1;\n    cinfo->arith_ac_K[i] = 5;\n  }\n  cinfo->restart_interval = 0;\n\n  /* Set initial assumptions for colorspace etc */\n\n  cinfo->jpeg_color_space = JCS_UNKNOWN;\n  cinfo->CCIR601_sampling = FALSE; /* Assume non-CCIR sampling??? */\n\n  cinfo->saw_JFIF_marker = FALSE;\n  cinfo->JFIF_major_version = 1; /* set default JFIF APP0 values */\n  cinfo->JFIF_minor_version = 1;\n  cinfo->density_unit = 0;\n  cinfo->X_density = 1;\n  cinfo->Y_density = 1;\n  cinfo->saw_Adobe_marker = FALSE;\n  cinfo->Adobe_transform = 0;\n\n  cinfo->marker->saw_SOI = TRUE;\n\n  return TRUE;\n}\n\n\nLOCAL(boolean)\nget_sof (j_decompress_ptr cinfo, boolean is_prog, boolean is_arith)\n/* Process a SOFn marker */\n{\n  INT32 length;\n  int c, ci;\n  jpeg_component_info * compptr;\n  INPUT_VARS(cinfo);\n\n  cinfo->progressive_mode = is_prog;\n  cinfo->arith_code = is_arith;\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n\n  INPUT_BYTE(cinfo, cinfo->data_precision, return FALSE);\n  INPUT_2BYTES(cinfo, cinfo->image_height, return FALSE);\n  INPUT_2BYTES(cinfo, cinfo->image_width, return FALSE);\n  INPUT_BYTE(cinfo, cinfo->num_components, return FALSE);\n\n  length -= 8;\n\n  TRACEMS4(cinfo, 1, JTRC_SOF, cinfo->unread_marker,\n\t   (int) cinfo->image_width, (int) cinfo->image_height,\n\t   cinfo->num_components);\n\n  if (cinfo->marker->saw_SOF)\n    ERREXIT(cinfo, JERR_SOF_DUPLICATE);\n\n  /* We don't support files in which the image height is initially specified */\n  /* as 0 and is later redefined by DNL.  As long as we have to check that,  */\n  /* might as well have a general sanity check. */\n  if (cinfo->image_height <= 0 || cinfo->image_width <= 0\n      || cinfo->num_components <= 0)\n    ERREXIT(cinfo, JERR_EMPTY_IMAGE);\n\n  if (length != (cinfo->num_components * 3))\n    ERREXIT(cinfo, JERR_BAD_LENGTH);\n\n  if (cinfo->comp_info == NULL)\t/* do only once, even if suspend */\n    cinfo->comp_info = (jpeg_component_info *) (*cinfo->mem->alloc_small)\n\t\t\t((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t cinfo->num_components * SIZEOF(jpeg_component_info));\n  \n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    compptr->component_index = ci;\n    INPUT_BYTE(cinfo, compptr->component_id, return FALSE);\n    INPUT_BYTE(cinfo, c, return FALSE);\n    compptr->h_samp_factor = (c >> 4) & 15;\n    compptr->v_samp_factor = (c     ) & 15;\n    INPUT_BYTE(cinfo, compptr->quant_tbl_no, return FALSE);\n\n    TRACEMS4(cinfo, 1, JTRC_SOF_COMPONENT,\n\t     compptr->component_id, compptr->h_samp_factor,\n\t     compptr->v_samp_factor, compptr->quant_tbl_no);\n  }\n\n  cinfo->marker->saw_SOF = TRUE;\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n\nLOCAL(boolean)\nget_sos (j_decompress_ptr cinfo)\n/* Process a SOS marker */\n{\n  INT32 length;\n  int i, ci, n, c, cc, pi;\n  jpeg_component_info * compptr;\n  INPUT_VARS(cinfo);\n\n  if (! cinfo->marker->saw_SOF)\n    ERREXIT(cinfo, JERR_SOS_NO_SOF);\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n\n  INPUT_BYTE(cinfo, n, return FALSE); /* Number of components */\n\n  TRACEMS1(cinfo, 1, JTRC_SOS, n);\n\n  if (length != (n * 2 + 6) || n < 1 || n > MAX_COMPS_IN_SCAN)\n    ERREXIT(cinfo, JERR_BAD_LENGTH);\n\n  cinfo->comps_in_scan = n;\n\n  /* Collect the component-spec parameters */\n\n  for (i = 0; i < MAX_COMPS_IN_SCAN; i++)\n    cinfo->cur_comp_info[i] = NULL;\n\n  for (i = 0; i < n; i++) {\n    INPUT_BYTE(cinfo, cc, return FALSE);\n    INPUT_BYTE(cinfo, c, return FALSE);\n    \n    for (ci = 0, compptr = cinfo->comp_info;\n\t ci < cinfo->num_components && ci < MAX_COMPS_IN_SCAN;\n\t ci++, compptr++) {\n      if (cc == compptr->component_id && !cinfo->cur_comp_info[ci])\n\tgoto id_found;\n    }\n\n    ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc);\n\n  id_found:\n\n    cinfo->cur_comp_info[i] = compptr;\n    compptr->dc_tbl_no = (c >> 4) & 15;\n    compptr->ac_tbl_no = (c     ) & 15;\n    \n    TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc,\n\t     compptr->dc_tbl_no, compptr->ac_tbl_no);\n\n    /* This CSi (cc) should differ from the previous CSi */\n    for (pi = 0; pi < i; pi++) {\n      if (cinfo->cur_comp_info[pi] == compptr) {\n        ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc);\n      }\n    }\n  }\n\n  /* Collect the additional scan parameters Ss, Se, Ah/Al. */\n  INPUT_BYTE(cinfo, c, return FALSE);\n  cinfo->Ss = c;\n  INPUT_BYTE(cinfo, c, return FALSE);\n  cinfo->Se = c;\n  INPUT_BYTE(cinfo, c, return FALSE);\n  cinfo->Ah = (c >> 4) & 15;\n  cinfo->Al = (c     ) & 15;\n\n  TRACEMS4(cinfo, 1, JTRC_SOS_PARAMS, cinfo->Ss, cinfo->Se,\n\t   cinfo->Ah, cinfo->Al);\n\n  /* Prepare to scan data & restart markers */\n  cinfo->marker->next_restart_num = 0;\n\n  /* Count another SOS marker */\n  cinfo->input_scan_number++;\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n\n#ifdef D_ARITH_CODING_SUPPORTED\n\nLOCAL(boolean)\nget_dac (j_decompress_ptr cinfo)\n/* Process a DAC marker */\n{\n  INT32 length;\n  int index, val;\n  INPUT_VARS(cinfo);\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n  length -= 2;\n  \n  while (length > 0) {\n    INPUT_BYTE(cinfo, index, return FALSE);\n    INPUT_BYTE(cinfo, val, return FALSE);\n\n    length -= 2;\n\n    TRACEMS2(cinfo, 1, JTRC_DAC, index, val);\n\n    if (index < 0 || index >= (2*NUM_ARITH_TBLS))\n      ERREXIT1(cinfo, JERR_DAC_INDEX, index);\n\n    if (index >= NUM_ARITH_TBLS) { /* define AC table */\n      cinfo->arith_ac_K[index-NUM_ARITH_TBLS] = (UINT8) val;\n    } else {\t\t\t/* define DC table */\n      cinfo->arith_dc_L[index] = (UINT8) (val & 0x0F);\n      cinfo->arith_dc_U[index] = (UINT8) (val >> 4);\n      if (cinfo->arith_dc_L[index] > cinfo->arith_dc_U[index])\n\tERREXIT1(cinfo, JERR_DAC_VALUE, val);\n    }\n  }\n\n  if (length != 0)\n    ERREXIT(cinfo, JERR_BAD_LENGTH);\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n#else /* ! D_ARITH_CODING_SUPPORTED */\n\n#define get_dac(cinfo)  skip_variable(cinfo)\n\n#endif /* D_ARITH_CODING_SUPPORTED */\n\n\nLOCAL(boolean)\nget_dht (j_decompress_ptr cinfo)\n/* Process a DHT marker */\n{\n  INT32 length;\n  UINT8 bits[17];\n  UINT8 huffval[256];\n  int i, index, count;\n  JHUFF_TBL **htblptr;\n  INPUT_VARS(cinfo);\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n  length -= 2;\n  \n  while (length > 16) {\n    INPUT_BYTE(cinfo, index, return FALSE);\n\n    TRACEMS1(cinfo, 1, JTRC_DHT, index);\n      \n    bits[0] = 0;\n    count = 0;\n    for (i = 1; i <= 16; i++) {\n      INPUT_BYTE(cinfo, bits[i], return FALSE);\n      count += bits[i];\n    }\n\n    length -= 1 + 16;\n\n    TRACEMS8(cinfo, 2, JTRC_HUFFBITS,\n\t     bits[1], bits[2], bits[3], bits[4],\n\t     bits[5], bits[6], bits[7], bits[8]);\n    TRACEMS8(cinfo, 2, JTRC_HUFFBITS,\n\t     bits[9], bits[10], bits[11], bits[12],\n\t     bits[13], bits[14], bits[15], bits[16]);\n\n    /* Here we just do minimal validation of the counts to avoid walking\n     * off the end of our table space.  jdhuff.c will check more carefully.\n     */\n    if (count > 256 || ((INT32) count) > length)\n      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);\n\n    for (i = 0; i < count; i++)\n      INPUT_BYTE(cinfo, huffval[i], return FALSE);\n\n    MEMZERO(&huffval[count], (256 - count) * SIZEOF(UINT8));\n\n    length -= count;\n\n    if (index & 0x10) {\t\t/* AC table definition */\n      index -= 0x10;\n      if (index < 0 || index >= NUM_HUFF_TBLS)\n        ERREXIT1(cinfo, JERR_DHT_INDEX, index);\n      htblptr = &cinfo->ac_huff_tbl_ptrs[index];\n    } else {\t\t\t/* DC table definition */\n      if (index < 0 || index >= NUM_HUFF_TBLS)\n        ERREXIT1(cinfo, JERR_DHT_INDEX, index);\n      htblptr = &cinfo->dc_huff_tbl_ptrs[index];\n    }\n\n    if (*htblptr == NULL)\n      *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);\n  \n    MEMCOPY((*htblptr)->bits, bits, SIZEOF((*htblptr)->bits));\n    MEMCOPY((*htblptr)->huffval, huffval, SIZEOF((*htblptr)->huffval));\n  }\n\n  if (length != 0)\n    ERREXIT(cinfo, JERR_BAD_LENGTH);\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n\nLOCAL(boolean)\nget_dqt (j_decompress_ptr cinfo)\n/* Process a DQT marker */\n{\n  INT32 length;\n  int n, i, prec;\n  unsigned int tmp;\n  JQUANT_TBL *quant_ptr;\n  INPUT_VARS(cinfo);\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n  length -= 2;\n\n  while (length > 0) {\n    INPUT_BYTE(cinfo, n, return FALSE);\n    prec = n >> 4;\n    n &= 0x0F;\n\n    TRACEMS2(cinfo, 1, JTRC_DQT, n, prec);\n\n    if (n >= NUM_QUANT_TBLS)\n      ERREXIT1(cinfo, JERR_DQT_INDEX, n);\n      \n    if (cinfo->quant_tbl_ptrs[n] == NULL)\n      cinfo->quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) cinfo);\n    quant_ptr = cinfo->quant_tbl_ptrs[n];\n\n    for (i = 0; i < DCTSIZE2; i++) {\n      if (prec)\n\tINPUT_2BYTES(cinfo, tmp, return FALSE);\n      else\n\tINPUT_BYTE(cinfo, tmp, return FALSE);\n      /* We convert the zigzag-order table to natural array order. */\n      quant_ptr->quantval[jpeg_natural_order[i]] = (UINT16) tmp;\n    }\n\n    if (cinfo->err->trace_level >= 2) {\n      for (i = 0; i < DCTSIZE2; i += 8) {\n\tTRACEMS8(cinfo, 2, JTRC_QUANTVALS,\n\t\t quant_ptr->quantval[i],   quant_ptr->quantval[i+1],\n\t\t quant_ptr->quantval[i+2], quant_ptr->quantval[i+3],\n\t\t quant_ptr->quantval[i+4], quant_ptr->quantval[i+5],\n\t\t quant_ptr->quantval[i+6], quant_ptr->quantval[i+7]);\n      }\n    }\n\n    length -= DCTSIZE2+1;\n    if (prec) length -= DCTSIZE2;\n  }\n\n  if (length != 0)\n    ERREXIT(cinfo, JERR_BAD_LENGTH);\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n\nLOCAL(boolean)\nget_dri (j_decompress_ptr cinfo)\n/* Process a DRI marker */\n{\n  INT32 length;\n  unsigned int tmp;\n  INPUT_VARS(cinfo);\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n  \n  if (length != 4)\n    ERREXIT(cinfo, JERR_BAD_LENGTH);\n\n  INPUT_2BYTES(cinfo, tmp, return FALSE);\n\n  TRACEMS1(cinfo, 1, JTRC_DRI, tmp);\n\n  cinfo->restart_interval = tmp;\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n\n/*\n * Routines for processing APPn and COM markers.\n * These are either saved in memory or discarded, per application request.\n * APP0 and APP14 are specially checked to see if they are\n * JFIF and Adobe markers, respectively.\n */\n\n#define APP0_DATA_LEN\t14\t/* Length of interesting data in APP0 */\n#define APP14_DATA_LEN\t12\t/* Length of interesting data in APP14 */\n#define APPN_DATA_LEN\t14\t/* Must be the largest of the above!! */\n\n\nLOCAL(void)\nexamine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data,\n\t      unsigned int datalen, INT32 remaining)\n/* Examine first few bytes from an APP0.\n * Take appropriate action if it is a JFIF marker.\n * datalen is # of bytes at data[], remaining is length of rest of marker data.\n */\n{\n  INT32 totallen = (INT32) datalen + remaining;\n\n  if (datalen >= APP0_DATA_LEN &&\n      GETJOCTET(data[0]) == 0x4A &&\n      GETJOCTET(data[1]) == 0x46 &&\n      GETJOCTET(data[2]) == 0x49 &&\n      GETJOCTET(data[3]) == 0x46 &&\n      GETJOCTET(data[4]) == 0) {\n    /* Found JFIF APP0 marker: save info */\n    cinfo->saw_JFIF_marker = TRUE;\n    cinfo->JFIF_major_version = GETJOCTET(data[5]);\n    cinfo->JFIF_minor_version = GETJOCTET(data[6]);\n    cinfo->density_unit = GETJOCTET(data[7]);\n    cinfo->X_density = (GETJOCTET(data[8]) << 8) + GETJOCTET(data[9]);\n    cinfo->Y_density = (GETJOCTET(data[10]) << 8) + GETJOCTET(data[11]);\n    /* Check version.\n     * Major version must be 1, anything else signals an incompatible change.\n     * (We used to treat this as an error, but now it's a nonfatal warning,\n     * because some bozo at Hijaak couldn't read the spec.)\n     * Minor version should be 0..2, but process anyway if newer.\n     */\n    if (cinfo->JFIF_major_version != 1)\n      WARNMS2(cinfo, JWRN_JFIF_MAJOR,\n\t      cinfo->JFIF_major_version, cinfo->JFIF_minor_version);\n    /* Generate trace messages */\n    TRACEMS5(cinfo, 1, JTRC_JFIF,\n\t     cinfo->JFIF_major_version, cinfo->JFIF_minor_version,\n\t     cinfo->X_density, cinfo->Y_density, cinfo->density_unit);\n    /* Validate thumbnail dimensions and issue appropriate messages */\n    if (GETJOCTET(data[12]) | GETJOCTET(data[13]))\n      TRACEMS2(cinfo, 1, JTRC_JFIF_THUMBNAIL,\n\t       GETJOCTET(data[12]), GETJOCTET(data[13]));\n    totallen -= APP0_DATA_LEN;\n    if (totallen !=\n\t((INT32)GETJOCTET(data[12]) * (INT32)GETJOCTET(data[13]) * (INT32) 3))\n      TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, (int) totallen);\n  } else if (datalen >= 6 &&\n      GETJOCTET(data[0]) == 0x4A &&\n      GETJOCTET(data[1]) == 0x46 &&\n      GETJOCTET(data[2]) == 0x58 &&\n      GETJOCTET(data[3]) == 0x58 &&\n      GETJOCTET(data[4]) == 0) {\n    /* Found JFIF \"JFXX\" extension APP0 marker */\n    /* The library doesn't actually do anything with these,\n     * but we try to produce a helpful trace message.\n     */\n    switch (GETJOCTET(data[5])) {\n    case 0x10:\n      TRACEMS1(cinfo, 1, JTRC_THUMB_JPEG, (int) totallen);\n      break;\n    case 0x11:\n      TRACEMS1(cinfo, 1, JTRC_THUMB_PALETTE, (int) totallen);\n      break;\n    case 0x13:\n      TRACEMS1(cinfo, 1, JTRC_THUMB_RGB, (int) totallen);\n      break;\n    default:\n      TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION,\n\t       GETJOCTET(data[5]), (int) totallen);\n      break;\n    }\n  } else {\n    /* Start of APP0 does not match \"JFIF\" or \"JFXX\", or too short */\n    TRACEMS1(cinfo, 1, JTRC_APP0, (int) totallen);\n  }\n}\n\n\nLOCAL(void)\nexamine_app14 (j_decompress_ptr cinfo, JOCTET FAR * data,\n\t       unsigned int datalen, INT32 remaining)\n/* Examine first few bytes from an APP14.\n * Take appropriate action if it is an Adobe marker.\n * datalen is # of bytes at data[], remaining is length of rest of marker data.\n */\n{\n  unsigned int version, flags0, flags1, transform;\n\n  if (datalen >= APP14_DATA_LEN &&\n      GETJOCTET(data[0]) == 0x41 &&\n      GETJOCTET(data[1]) == 0x64 &&\n      GETJOCTET(data[2]) == 0x6F &&\n      GETJOCTET(data[3]) == 0x62 &&\n      GETJOCTET(data[4]) == 0x65) {\n    /* Found Adobe APP14 marker */\n    version = (GETJOCTET(data[5]) << 8) + GETJOCTET(data[6]);\n    flags0 = (GETJOCTET(data[7]) << 8) + GETJOCTET(data[8]);\n    flags1 = (GETJOCTET(data[9]) << 8) + GETJOCTET(data[10]);\n    transform = GETJOCTET(data[11]);\n    TRACEMS4(cinfo, 1, JTRC_ADOBE, version, flags0, flags1, transform);\n    cinfo->saw_Adobe_marker = TRUE;\n    cinfo->Adobe_transform = (UINT8) transform;\n  } else {\n    /* Start of APP14 does not match \"Adobe\", or too short */\n    TRACEMS1(cinfo, 1, JTRC_APP14, (int) (datalen + remaining));\n  }\n}\n\n\nMETHODDEF(boolean)\nget_interesting_appn (j_decompress_ptr cinfo)\n/* Process an APP0 or APP14 marker without saving it */\n{\n  INT32 length;\n  JOCTET b[APPN_DATA_LEN];\n  unsigned int i, numtoread;\n  INPUT_VARS(cinfo);\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n  length -= 2;\n\n  /* get the interesting part of the marker data */\n  if (length >= APPN_DATA_LEN)\n    numtoread = APPN_DATA_LEN;\n  else if (length > 0)\n    numtoread = (unsigned int) length;\n  else\n    numtoread = 0;\n  for (i = 0; i < numtoread; i++)\n    INPUT_BYTE(cinfo, b[i], return FALSE);\n  length -= numtoread;\n\n  /* process it */\n  switch (cinfo->unread_marker) {\n  case M_APP0:\n    examine_app0(cinfo, (JOCTET FAR *) b, numtoread, length);\n    break;\n  case M_APP14:\n    examine_app14(cinfo, (JOCTET FAR *) b, numtoread, length);\n    break;\n  default:\n    /* can't get here unless jpeg_save_markers chooses wrong processor */\n    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);\n    break;\n  }\n\n  /* skip any remaining data -- could be lots */\n  INPUT_SYNC(cinfo);\n  if (length > 0)\n    (*cinfo->src->skip_input_data) (cinfo, (long) length);\n\n  return TRUE;\n}\n\n\n#ifdef SAVE_MARKERS_SUPPORTED\n\nMETHODDEF(boolean)\nsave_marker (j_decompress_ptr cinfo)\n/* Save an APPn or COM marker into the marker list */\n{\n  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;\n  jpeg_saved_marker_ptr cur_marker = marker->cur_marker;\n  unsigned int bytes_read, data_length;\n  JOCTET FAR * data;\n  INT32 length = 0;\n  INPUT_VARS(cinfo);\n\n  if (cur_marker == NULL) {\n    /* begin reading a marker */\n    INPUT_2BYTES(cinfo, length, return FALSE);\n    length -= 2;\n    if (length >= 0) {\t\t/* watch out for bogus length word */\n      /* figure out how much we want to save */\n      unsigned int limit;\n      if (cinfo->unread_marker == (int) M_COM)\n\tlimit = marker->length_limit_COM;\n      else\n\tlimit = marker->length_limit_APPn[cinfo->unread_marker - (int) M_APP0];\n      if ((unsigned int) length < limit)\n\tlimit = (unsigned int) length;\n      /* allocate and initialize the marker item */\n      cur_marker = (jpeg_saved_marker_ptr)\n\t(*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t    SIZEOF(struct jpeg_marker_struct) + limit);\n      cur_marker->next = NULL;\n      cur_marker->marker = (UINT8) cinfo->unread_marker;\n      cur_marker->original_length = (unsigned int) length;\n      cur_marker->data_length = limit;\n      /* data area is just beyond the jpeg_marker_struct */\n      data = cur_marker->data = (JOCTET FAR *) (cur_marker + 1);\n      marker->cur_marker = cur_marker;\n      marker->bytes_read = 0;\n      bytes_read = 0;\n      data_length = limit;\n    } else {\n      /* deal with bogus length word */\n      bytes_read = data_length = 0;\n      data = NULL;\n    }\n  } else {\n    /* resume reading a marker */\n    bytes_read = marker->bytes_read;\n    data_length = cur_marker->data_length;\n    data = cur_marker->data + bytes_read;\n  }\n\n  while (bytes_read < data_length) {\n    INPUT_SYNC(cinfo);\t\t/* move the restart point to here */\n    marker->bytes_read = bytes_read;\n    /* If there's not at least one byte in buffer, suspend */\n    MAKE_BYTE_AVAIL(cinfo, return FALSE);\n    /* Copy bytes with reasonable rapidity */\n    while (bytes_read < data_length && bytes_in_buffer > 0) {\n      *data++ = *next_input_byte++;\n      bytes_in_buffer--;\n      bytes_read++;\n    }\n  }\n\n  /* Done reading what we want to read */\n  if (cur_marker != NULL) {\t/* will be NULL if bogus length word */\n    /* Add new marker to end of list */\n    if (cinfo->marker_list == NULL) {\n      cinfo->marker_list = cur_marker;\n    } else {\n      jpeg_saved_marker_ptr prev = cinfo->marker_list;\n      while (prev->next != NULL)\n\tprev = prev->next;\n      prev->next = cur_marker;\n    }\n    /* Reset pointer & calc remaining data length */\n    data = cur_marker->data;\n    length = cur_marker->original_length - data_length;\n  }\n  /* Reset to initial state for next marker */\n  marker->cur_marker = NULL;\n\n  /* Process the marker if interesting; else just make a generic trace msg */\n  switch (cinfo->unread_marker) {\n  case M_APP0:\n    examine_app0(cinfo, data, data_length, length);\n    break;\n  case M_APP14:\n    examine_app14(cinfo, data, data_length, length);\n    break;\n  default:\n    TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker,\n\t     (int) (data_length + length));\n    break;\n  }\n\n  /* skip any remaining data -- could be lots */\n  INPUT_SYNC(cinfo);\t\t/* do before skip_input_data */\n  if (length > 0)\n    (*cinfo->src->skip_input_data) (cinfo, (long) length);\n\n  return TRUE;\n}\n\n#endif /* SAVE_MARKERS_SUPPORTED */\n\n\nMETHODDEF(boolean)\nskip_variable (j_decompress_ptr cinfo)\n/* Skip over an unknown or uninteresting variable-length marker */\n{\n  INT32 length;\n  INPUT_VARS(cinfo);\n\n  INPUT_2BYTES(cinfo, length, return FALSE);\n  length -= 2;\n  \n  TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, (int) length);\n\n  INPUT_SYNC(cinfo);\t\t/* do before skip_input_data */\n  if (length > 0)\n    (*cinfo->src->skip_input_data) (cinfo, (long) length);\n\n  return TRUE;\n}\n\n\n/*\n * Find the next JPEG marker, save it in cinfo->unread_marker.\n * Returns FALSE if had to suspend before reaching a marker;\n * in that case cinfo->unread_marker is unchanged.\n *\n * Note that the result might not be a valid marker code,\n * but it will never be 0 or FF.\n */\n\nLOCAL(boolean)\nnext_marker (j_decompress_ptr cinfo)\n{\n  int c;\n  INPUT_VARS(cinfo);\n\n  for (;;) {\n    INPUT_BYTE(cinfo, c, return FALSE);\n    /* Skip any non-FF bytes.\n     * This may look a bit inefficient, but it will not occur in a valid file.\n     * We sync after each discarded byte so that a suspending data source\n     * can discard the byte from its buffer.\n     */\n    while (c != 0xFF) {\n      cinfo->marker->discarded_bytes++;\n      INPUT_SYNC(cinfo);\n      INPUT_BYTE(cinfo, c, return FALSE);\n    }\n    /* This loop swallows any duplicate FF bytes.  Extra FFs are legal as\n     * pad bytes, so don't count them in discarded_bytes.  We assume there\n     * will not be so many consecutive FF bytes as to overflow a suspending\n     * data source's input buffer.\n     */\n    do {\n      INPUT_BYTE(cinfo, c, return FALSE);\n    } while (c == 0xFF);\n    if (c != 0)\n      break;\t\t\t/* found a valid marker, exit loop */\n    /* Reach here if we found a stuffed-zero data sequence (FF/00).\n     * Discard it and loop back to try again.\n     */\n    cinfo->marker->discarded_bytes += 2;\n    INPUT_SYNC(cinfo);\n  }\n\n  if (cinfo->marker->discarded_bytes != 0) {\n    WARNMS2(cinfo, JWRN_EXTRANEOUS_DATA, cinfo->marker->discarded_bytes, c);\n    cinfo->marker->discarded_bytes = 0;\n  }\n\n  cinfo->unread_marker = c;\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n\nLOCAL(boolean)\nfirst_marker (j_decompress_ptr cinfo)\n/* Like next_marker, but used to obtain the initial SOI marker. */\n/* For this marker, we do not allow preceding garbage or fill; otherwise,\n * we might well scan an entire input file before realizing it ain't JPEG.\n * If an application wants to process non-JFIF files, it must seek to the\n * SOI before calling the JPEG library.\n */\n{\n  int c, c2;\n  INPUT_VARS(cinfo);\n\n  INPUT_BYTE(cinfo, c, return FALSE);\n  INPUT_BYTE(cinfo, c2, return FALSE);\n  if (c != 0xFF || c2 != (int) M_SOI)\n    ERREXIT2(cinfo, JERR_NO_SOI, c, c2);\n\n  cinfo->unread_marker = c2;\n\n  INPUT_SYNC(cinfo);\n  return TRUE;\n}\n\n\n/*\n * Read markers until SOS or EOI.\n *\n * Returns same codes as are defined for jpeg_consume_input:\n * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.\n */\n\nMETHODDEF(int)\nread_markers (j_decompress_ptr cinfo)\n{\n  /* Outer loop repeats once for each marker. */\n  for (;;) {\n    /* Collect the marker proper, unless we already did. */\n    /* NB: first_marker() enforces the requirement that SOI appear first. */\n    if (cinfo->unread_marker == 0) {\n      if (! cinfo->marker->saw_SOI) {\n\tif (! first_marker(cinfo))\n\t  return JPEG_SUSPENDED;\n      } else {\n\tif (! next_marker(cinfo))\n\t  return JPEG_SUSPENDED;\n      }\n    }\n    /* At this point cinfo->unread_marker contains the marker code and the\n     * input point is just past the marker proper, but before any parameters.\n     * A suspension will cause us to return with this state still true.\n     */\n    switch (cinfo->unread_marker) {\n    case M_SOI:\n      if (! get_soi(cinfo))\n\treturn JPEG_SUSPENDED;\n      break;\n\n    case M_SOF0:\t\t/* Baseline */\n    case M_SOF1:\t\t/* Extended sequential, Huffman */\n      if (! get_sof(cinfo, FALSE, FALSE))\n\treturn JPEG_SUSPENDED;\n      break;\n\n    case M_SOF2:\t\t/* Progressive, Huffman */\n      if (! get_sof(cinfo, TRUE, FALSE))\n\treturn JPEG_SUSPENDED;\n      break;\n\n    case M_SOF9:\t\t/* Extended sequential, arithmetic */\n      if (! get_sof(cinfo, FALSE, TRUE))\n\treturn JPEG_SUSPENDED;\n      break;\n\n    case M_SOF10:\t\t/* Progressive, arithmetic */\n      if (! get_sof(cinfo, TRUE, TRUE))\n\treturn JPEG_SUSPENDED;\n      break;\n\n    /* Currently unsupported SOFn types */\n    case M_SOF3:\t\t/* Lossless, Huffman */\n    case M_SOF5:\t\t/* Differential sequential, Huffman */\n    case M_SOF6:\t\t/* Differential progressive, Huffman */\n    case M_SOF7:\t\t/* Differential lossless, Huffman */\n    case M_JPG:\t\t\t/* Reserved for JPEG extensions */\n    case M_SOF11:\t\t/* Lossless, arithmetic */\n    case M_SOF13:\t\t/* Differential sequential, arithmetic */\n    case M_SOF14:\t\t/* Differential progressive, arithmetic */\n    case M_SOF15:\t\t/* Differential lossless, arithmetic */\n      ERREXIT1(cinfo, JERR_SOF_UNSUPPORTED, cinfo->unread_marker);\n      break;\n\n    case M_SOS:\n      if (! get_sos(cinfo))\n\treturn JPEG_SUSPENDED;\n      cinfo->unread_marker = 0;\t/* processed the marker */\n      return JPEG_REACHED_SOS;\n    \n    case M_EOI:\n      TRACEMS(cinfo, 1, JTRC_EOI);\n      cinfo->unread_marker = 0;\t/* processed the marker */\n      return JPEG_REACHED_EOI;\n      \n    case M_DAC:\n      if (! get_dac(cinfo))\n\treturn JPEG_SUSPENDED;\n      break;\n      \n    case M_DHT:\n      if (! get_dht(cinfo))\n\treturn JPEG_SUSPENDED;\n      break;\n      \n    case M_DQT:\n      if (! get_dqt(cinfo))\n\treturn JPEG_SUSPENDED;\n      break;\n      \n    case M_DRI:\n      if (! get_dri(cinfo))\n\treturn JPEG_SUSPENDED;\n      break;\n      \n    case M_APP0:\n    case M_APP1:\n    case M_APP2:\n    case M_APP3:\n    case M_APP4:\n    case M_APP5:\n    case M_APP6:\n    case M_APP7:\n    case M_APP8:\n    case M_APP9:\n    case M_APP10:\n    case M_APP11:\n    case M_APP12:\n    case M_APP13:\n    case M_APP14:\n    case M_APP15:\n      if (! (*((my_marker_ptr) cinfo->marker)->process_APPn[\n\t\tcinfo->unread_marker - (int) M_APP0]) (cinfo))\n\treturn JPEG_SUSPENDED;\n      break;\n      \n    case M_COM:\n      if (! (*((my_marker_ptr) cinfo->marker)->process_COM) (cinfo))\n\treturn JPEG_SUSPENDED;\n      break;\n\n    case M_RST0:\t\t/* these are all parameterless */\n    case M_RST1:\n    case M_RST2:\n    case M_RST3:\n    case M_RST4:\n    case M_RST5:\n    case M_RST6:\n    case M_RST7:\n    case M_TEM:\n      TRACEMS1(cinfo, 1, JTRC_PARMLESS_MARKER, cinfo->unread_marker);\n      break;\n\n    case M_DNL:\t\t\t/* Ignore DNL ... perhaps the wrong thing */\n      if (! skip_variable(cinfo))\n\treturn JPEG_SUSPENDED;\n      break;\n\n    default:\t\t\t/* must be DHP, EXP, JPGn, or RESn */\n      /* For now, we treat the reserved markers as fatal errors since they are\n       * likely to be used to signal incompatible JPEG Part 3 extensions.\n       * Once the JPEG 3 version-number marker is well defined, this code\n       * ought to change!\n       */\n      ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);\n      break;\n    }\n    /* Successfully processed marker, so reset state variable */\n    cinfo->unread_marker = 0;\n  } /* end loop */\n}\n\n\n/*\n * Read a restart marker, which is expected to appear next in the datastream;\n * if the marker is not there, take appropriate recovery action.\n * Returns FALSE if suspension is required.\n *\n * This is called by the entropy decoder after it has read an appropriate\n * number of MCUs.  cinfo->unread_marker may be nonzero if the entropy decoder\n * has already read a marker from the data source.  Under normal conditions\n * cinfo->unread_marker will be reset to 0 before returning; if not reset,\n * it holds a marker which the decoder will be unable to read past.\n */\n\nMETHODDEF(boolean)\nread_restart_marker (j_decompress_ptr cinfo)\n{\n  /* Obtain a marker unless we already did. */\n  /* Note that next_marker will complain if it skips any data. */\n  if (cinfo->unread_marker == 0) {\n    if (! next_marker(cinfo))\n      return FALSE;\n  }\n\n  if (cinfo->unread_marker ==\n      ((int) M_RST0 + cinfo->marker->next_restart_num)) {\n    /* Normal case --- swallow the marker and let entropy decoder continue */\n    TRACEMS1(cinfo, 3, JTRC_RST, cinfo->marker->next_restart_num);\n    cinfo->unread_marker = 0;\n  } else {\n    /* Uh-oh, the restart markers have been messed up. */\n    /* Let the data source manager determine how to resync. */\n    if (! (*cinfo->src->resync_to_restart) (cinfo,\n\t\t\t\t\t    cinfo->marker->next_restart_num))\n      return FALSE;\n  }\n\n  /* Update next-restart state */\n  cinfo->marker->next_restart_num = (cinfo->marker->next_restart_num + 1) & 7;\n\n  return TRUE;\n}\n\n\n/*\n * This is the default resync_to_restart method for data source managers\n * to use if they don't have any better approach.  Some data source managers\n * may be able to back up, or may have additional knowledge about the data\n * which permits a more intelligent recovery strategy; such managers would\n * presumably supply their own resync method.\n *\n * read_restart_marker calls resync_to_restart if it finds a marker other than\n * the restart marker it was expecting.  (This code is *not* used unless\n * a nonzero restart interval has been declared.)  cinfo->unread_marker is\n * the marker code actually found (might be anything, except 0 or FF).\n * The desired restart marker number (0..7) is passed as a parameter.\n * This routine is supposed to apply whatever error recovery strategy seems\n * appropriate in order to position the input stream to the next data segment.\n * Note that cinfo->unread_marker is treated as a marker appearing before\n * the current data-source input point; usually it should be reset to zero\n * before returning.\n * Returns FALSE if suspension is required.\n *\n * This implementation is substantially constrained by wanting to treat the\n * input as a data stream; this means we can't back up.  Therefore, we have\n * only the following actions to work with:\n *   1. Simply discard the marker and let the entropy decoder resume at next\n *      byte of file.\n *   2. Read forward until we find another marker, discarding intervening\n *      data.  (In theory we could look ahead within the current bufferload,\n *      without having to discard data if we don't find the desired marker.\n *      This idea is not implemented here, in part because it makes behavior\n *      dependent on buffer size and chance buffer-boundary positions.)\n *   3. Leave the marker unread (by failing to zero cinfo->unread_marker).\n *      This will cause the entropy decoder to process an empty data segment,\n *      inserting dummy zeroes, and then we will reprocess the marker.\n *\n * #2 is appropriate if we think the desired marker lies ahead, while #3 is\n * appropriate if the found marker is a future restart marker (indicating\n * that we have missed the desired restart marker, probably because it got\n * corrupted).\n * We apply #2 or #3 if the found marker is a restart marker no more than\n * two counts behind or ahead of the expected one.  We also apply #2 if the\n * found marker is not a legal JPEG marker code (it's certainly bogus data).\n * If the found marker is a restart marker more than 2 counts away, we do #1\n * (too much risk that the marker is erroneous; with luck we will be able to\n * resync at some future point).\n * For any valid non-restart JPEG marker, we apply #3.  This keeps us from\n * overrunning the end of a scan.  An implementation limited to single-scan\n * files might find it better to apply #2 for markers other than EOI, since\n * any other marker would have to be bogus data in that case.\n */\n\nGLOBAL(boolean)\njpeg_resync_to_restart (j_decompress_ptr cinfo, int desired)\n{\n  int marker = cinfo->unread_marker;\n  int action = 1;\n  \n  /* Always put up a warning. */\n  WARNMS2(cinfo, JWRN_MUST_RESYNC, marker, desired);\n  \n  /* Outer loop handles repeated decision after scanning forward. */\n  for (;;) {\n    if (marker < (int) M_SOF0)\n      action = 2;\t\t/* invalid marker */\n    else if (marker < (int) M_RST0 || marker > (int) M_RST7)\n      action = 3;\t\t/* valid non-restart marker */\n    else {\n      if (marker == ((int) M_RST0 + ((desired+1) & 7)) ||\n\t  marker == ((int) M_RST0 + ((desired+2) & 7)))\n\taction = 3;\t\t/* one of the next two expected restarts */\n      else if (marker == ((int) M_RST0 + ((desired-1) & 7)) ||\n\t       marker == ((int) M_RST0 + ((desired-2) & 7)))\n\taction = 2;\t\t/* a prior restart, so advance */\n      else\n\taction = 1;\t\t/* desired restart or too far away */\n    }\n    TRACEMS2(cinfo, 4, JTRC_RECOVERY_ACTION, marker, action);\n    switch (action) {\n    case 1:\n      /* Discard marker and let entropy decoder resume processing. */\n      cinfo->unread_marker = 0;\n      return TRUE;\n    case 2:\n      /* Scan to the next marker, and repeat the decision loop. */\n      if (! next_marker(cinfo))\n\treturn FALSE;\n      marker = cinfo->unread_marker;\n      break;\n    case 3:\n      /* Return without advancing past this marker. */\n      /* Entropy decoder will be forced to process an empty segment. */\n      return TRUE;\n    }\n  } /* end loop */\n}\n\n\n/*\n * Reset marker processing state to begin a fresh datastream.\n */\n\nMETHODDEF(void)\nreset_marker_reader (j_decompress_ptr cinfo)\n{\n  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;\n\n  cinfo->comp_info = NULL;\t\t/* until allocated by get_sof */\n  cinfo->input_scan_number = 0;\t\t/* no SOS seen yet */\n  cinfo->unread_marker = 0;\t\t/* no pending marker */\n  marker->pub.saw_SOI = FALSE;\t\t/* set internal state too */\n  marker->pub.saw_SOF = FALSE;\n  marker->pub.discarded_bytes = 0;\n  marker->cur_marker = NULL;\n}\n\n\n/*\n * Initialize the marker reader module.\n * This is called only once, when the decompression object is created.\n */\n\nGLOBAL(void)\njinit_marker_reader (j_decompress_ptr cinfo)\n{\n  my_marker_ptr marker;\n  int i;\n\n  /* Create subobject in permanent pool */\n  marker = (my_marker_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,\n\t\t\t\tSIZEOF(my_marker_reader));\n  cinfo->marker = (struct jpeg_marker_reader *) marker;\n  /* Initialize public method pointers */\n  marker->pub.reset_marker_reader = reset_marker_reader;\n  marker->pub.read_markers = read_markers;\n  marker->pub.read_restart_marker = read_restart_marker;\n  /* Initialize COM/APPn processing.\n   * By default, we examine and then discard APP0 and APP14,\n   * but simply discard COM and all other APPn.\n   */\n  marker->process_COM = skip_variable;\n  marker->length_limit_COM = 0;\n  for (i = 0; i < 16; i++) {\n    marker->process_APPn[i] = skip_variable;\n    marker->length_limit_APPn[i] = 0;\n  }\n  marker->process_APPn[0] = get_interesting_appn;\n  marker->process_APPn[14] = get_interesting_appn;\n  /* Reset marker processing state */\n  reset_marker_reader(cinfo);\n}\n\n\n/*\n * Control saving of COM and APPn markers into marker_list.\n */\n\n#ifdef SAVE_MARKERS_SUPPORTED\n\nGLOBAL(void)\njpeg_save_markers (j_decompress_ptr cinfo, int marker_code,\n\t\t   unsigned int length_limit)\n{\n  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;\n  long maxlength;\n  jpeg_marker_parser_method processor;\n\n  /* Length limit mustn't be larger than what we can allocate\n   * (should only be a concern in a 16-bit environment).\n   */\n  maxlength = cinfo->mem->max_alloc_chunk - SIZEOF(struct jpeg_marker_struct);\n  if (((long) length_limit) > maxlength)\n    length_limit = (unsigned int) maxlength;\n\n  /* Choose processor routine to use.\n   * APP0/APP14 have special requirements.\n   */\n  if (length_limit) {\n    processor = save_marker;\n    /* If saving APP0/APP14, save at least enough for our internal use. */\n    if (marker_code == (int) M_APP0 && length_limit < APP0_DATA_LEN)\n      length_limit = APP0_DATA_LEN;\n    else if (marker_code == (int) M_APP14 && length_limit < APP14_DATA_LEN)\n      length_limit = APP14_DATA_LEN;\n  } else {\n    processor = skip_variable;\n    /* If discarding APP0/APP14, use our regular on-the-fly processor. */\n    if (marker_code == (int) M_APP0 || marker_code == (int) M_APP14)\n      processor = get_interesting_appn;\n  }\n\n  if (marker_code == (int) M_COM) {\n    marker->process_COM = processor;\n    marker->length_limit_COM = length_limit;\n  } else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15) {\n    marker->process_APPn[marker_code - (int) M_APP0] = processor;\n    marker->length_limit_APPn[marker_code - (int) M_APP0] = length_limit;\n  } else\n    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code);\n}\n\n#endif /* SAVE_MARKERS_SUPPORTED */\n\n\n/*\n * Install a special processing method for COM or APPn markers.\n */\n\nGLOBAL(void)\njpeg_set_marker_processor (j_decompress_ptr cinfo, int marker_code,\n\t\t\t   jpeg_marker_parser_method routine)\n{\n  my_marker_ptr marker = (my_marker_ptr) cinfo->marker;\n\n  if (marker_code == (int) M_COM)\n    marker->process_COM = routine;\n  else if (marker_code >= (int) M_APP0 && marker_code <= (int) M_APP15)\n    marker->process_APPn[marker_code - (int) M_APP0] = routine;\n  else\n    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, marker_code);\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdmaster.c",
    "content": "/*\n * jdmaster.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 2002-2009 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2009-2011, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains master control logic for the JPEG decompressor.\n * These routines are concerned with selecting the modules to be executed\n * and with determining the number of passes and the work to be done in each\n * pass.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jpegcomp.h\"\n\n\n/* Private state */\n\ntypedef struct {\n  struct jpeg_decomp_master pub; /* public fields */\n\n  int pass_number;\t\t/* # of passes completed */\n\n  boolean using_merged_upsample; /* TRUE if using merged upsample/cconvert */\n\n  /* Saved references to initialized quantizer modules,\n   * in case we need to switch modes.\n   */\n  struct jpeg_color_quantizer * quantizer_1pass;\n  struct jpeg_color_quantizer * quantizer_2pass;\n} my_decomp_master;\n\ntypedef my_decomp_master * my_master_ptr;\n\n\n/*\n * Determine whether merged upsample/color conversion should be used.\n * CRUCIAL: this must match the actual capabilities of jdmerge.c!\n */\n\nLOCAL(boolean)\nuse_merged_upsample (j_decompress_ptr cinfo)\n{\n#ifdef UPSAMPLE_MERGING_SUPPORTED\n  /* Merging is the equivalent of plain box-filter upsampling */\n  if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling)\n    return FALSE;\n  /* jdmerge.c only supports YCC=>RGB color conversion */\n  if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 ||\n      (cinfo->out_color_space != JCS_RGB &&\n      cinfo->out_color_space != JCS_EXT_RGB &&\n      cinfo->out_color_space != JCS_EXT_RGBX &&\n      cinfo->out_color_space != JCS_EXT_BGR &&\n      cinfo->out_color_space != JCS_EXT_BGRX &&\n      cinfo->out_color_space != JCS_EXT_XBGR &&\n      cinfo->out_color_space != JCS_EXT_XRGB &&\n      cinfo->out_color_space != JCS_EXT_RGBA &&\n      cinfo->out_color_space != JCS_EXT_BGRA &&\n      cinfo->out_color_space != JCS_EXT_ABGR &&\n      cinfo->out_color_space != JCS_EXT_ARGB) ||\n      cinfo->out_color_components != rgb_pixelsize[cinfo->out_color_space])\n    return FALSE;\n  /* and it only handles 2h1v or 2h2v sampling ratios */\n  if (cinfo->comp_info[0].h_samp_factor != 2 ||\n      cinfo->comp_info[1].h_samp_factor != 1 ||\n      cinfo->comp_info[2].h_samp_factor != 1 ||\n      cinfo->comp_info[0].v_samp_factor >  2 ||\n      cinfo->comp_info[1].v_samp_factor != 1 ||\n      cinfo->comp_info[2].v_samp_factor != 1)\n    return FALSE;\n  /* furthermore, it doesn't work if we've scaled the IDCTs differently */\n  if (cinfo->comp_info[0]._DCT_scaled_size != cinfo->_min_DCT_scaled_size ||\n      cinfo->comp_info[1]._DCT_scaled_size != cinfo->_min_DCT_scaled_size ||\n      cinfo->comp_info[2]._DCT_scaled_size != cinfo->_min_DCT_scaled_size)\n    return FALSE;\n  /* ??? also need to test for upsample-time rescaling, when & if supported */\n  return TRUE;\t\t\t/* by golly, it'll work... */\n#else\n  return FALSE;\n#endif\n}\n\n\n/*\n * Compute output image dimensions and related values.\n * NOTE: this is exported for possible use by application.\n * Hence it mustn't do anything that can't be done twice.\n */\n\n#if JPEG_LIB_VERSION >= 80\nGLOBAL(void)\n#else\nLOCAL(void)\n#endif\njpeg_core_output_dimensions (j_decompress_ptr cinfo)\n/* Do computations that are needed before master selection phase.\n * This function is used for transcoding and full decompression.\n */\n{\n#ifdef IDCT_SCALING_SUPPORTED\n  int ci;\n  jpeg_component_info *compptr;\n\n  /* Compute actual output image dimensions and DCT scaling choices. */\n  if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom) {\n    /* Provide 1/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 1;\n    cinfo->_min_DCT_v_scaled_size = 1;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 2) {\n    /* Provide 2/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 2L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 2L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 2;\n    cinfo->_min_DCT_v_scaled_size = 2;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 3) {\n    /* Provide 3/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 3L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 3L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 3;\n    cinfo->_min_DCT_v_scaled_size = 3;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 4) {\n    /* Provide 4/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 4L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 4L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 4;\n    cinfo->_min_DCT_v_scaled_size = 4;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 5) {\n    /* Provide 5/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 5L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 5L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 5;\n    cinfo->_min_DCT_v_scaled_size = 5;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 6) {\n    /* Provide 6/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 6L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 6L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 6;\n    cinfo->_min_DCT_v_scaled_size = 6;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 7) {\n    /* Provide 7/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 7L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 7L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 7;\n    cinfo->_min_DCT_v_scaled_size = 7;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 8) {\n    /* Provide 8/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 8L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 8L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 8;\n    cinfo->_min_DCT_v_scaled_size = 8;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 9) {\n    /* Provide 9/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 9L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 9L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 9;\n    cinfo->_min_DCT_v_scaled_size = 9;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 10) {\n    /* Provide 10/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 10L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 10L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 10;\n    cinfo->_min_DCT_v_scaled_size = 10;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 11) {\n    /* Provide 11/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 11L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 11L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 11;\n    cinfo->_min_DCT_v_scaled_size = 11;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 12) {\n    /* Provide 12/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 12L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 12L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 12;\n    cinfo->_min_DCT_v_scaled_size = 12;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 13) {\n    /* Provide 13/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 13L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 13L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 13;\n    cinfo->_min_DCT_v_scaled_size = 13;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 14) {\n    /* Provide 14/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 14L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 14L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 14;\n    cinfo->_min_DCT_v_scaled_size = 14;\n  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 15) {\n    /* Provide 15/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 15L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 15L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 15;\n    cinfo->_min_DCT_v_scaled_size = 15;\n  } else {\n    /* Provide 16/block_size scaling */\n    cinfo->output_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width * 16L, (long) DCTSIZE);\n    cinfo->output_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height * 16L, (long) DCTSIZE);\n    cinfo->_min_DCT_h_scaled_size = 16;\n    cinfo->_min_DCT_v_scaled_size = 16;\n  }\n\n  /* Recompute dimensions of components */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    compptr->_DCT_h_scaled_size = cinfo->_min_DCT_h_scaled_size;\n    compptr->_DCT_v_scaled_size = cinfo->_min_DCT_v_scaled_size;\n  }\n\n#else /* !IDCT_SCALING_SUPPORTED */\n\n  /* Hardwire it to \"no scaling\" */\n  cinfo->output_width = cinfo->image_width;\n  cinfo->output_height = cinfo->image_height;\n  /* jdinput.c has already initialized DCT_scaled_size,\n   * and has computed unscaled downsampled_width and downsampled_height.\n   */\n\n#endif /* IDCT_SCALING_SUPPORTED */\n}\n\n\n/*\n * Compute output image dimensions and related values.\n * NOTE: this is exported for possible use by application.\n * Hence it mustn't do anything that can't be done twice.\n * Also note that it may be called before the master module is initialized!\n */\n\nGLOBAL(void)\njpeg_calc_output_dimensions (j_decompress_ptr cinfo)\n/* Do computations that are needed before master selection phase */\n{\n#ifdef IDCT_SCALING_SUPPORTED\n  int ci;\n  jpeg_component_info *compptr;\n#endif\n\n  /* Prevent application from calling me at wrong times */\n  if (cinfo->global_state != DSTATE_READY)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  /* Compute core output image dimensions and DCT scaling choices. */\n  jpeg_core_output_dimensions(cinfo);\n\n#ifdef IDCT_SCALING_SUPPORTED\n\n  /* In selecting the actual DCT scaling for each component, we try to\n   * scale up the chroma components via IDCT scaling rather than upsampling.\n   * This saves time if the upsampler gets to use 1:1 scaling.\n   * Note this code adapts subsampling ratios which are powers of 2.\n   */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    int ssize = cinfo->_min_DCT_scaled_size;\n    while (ssize < DCTSIZE &&\n\t   ((cinfo->max_h_samp_factor * cinfo->_min_DCT_scaled_size) %\n\t    (compptr->h_samp_factor * ssize * 2) == 0) &&\n\t   ((cinfo->max_v_samp_factor * cinfo->_min_DCT_scaled_size) %\n\t    (compptr->v_samp_factor * ssize * 2) == 0)) {\n      ssize = ssize * 2;\n    }\n#if JPEG_LIB_VERSION >= 70\n    compptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size = ssize;\n#else\n    compptr->DCT_scaled_size = ssize;\n#endif\n  }\n\n  /* Recompute downsampled dimensions of components;\n   * application needs to know these if using raw downsampled data.\n   */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Size in samples, after IDCT scaling */\n    compptr->downsampled_width = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_width *\n\t\t    (long) (compptr->h_samp_factor * compptr->_DCT_scaled_size),\n\t\t    (long) (cinfo->max_h_samp_factor * DCTSIZE));\n    compptr->downsampled_height = (JDIMENSION)\n      jdiv_round_up((long) cinfo->image_height *\n\t\t    (long) (compptr->v_samp_factor * compptr->_DCT_scaled_size),\n\t\t    (long) (cinfo->max_v_samp_factor * DCTSIZE));\n  }\n\n#else /* !IDCT_SCALING_SUPPORTED */\n\n  /* Hardwire it to \"no scaling\" */\n  cinfo->output_width = cinfo->image_width;\n  cinfo->output_height = cinfo->image_height;\n  /* jdinput.c has already initialized DCT_scaled_size to DCTSIZE,\n   * and has computed unscaled downsampled_width and downsampled_height.\n   */\n\n#endif /* IDCT_SCALING_SUPPORTED */\n\n  /* Report number of components in selected colorspace. */\n  /* Probably this should be in the color conversion module... */\n  switch (cinfo->out_color_space) {\n  case JCS_GRAYSCALE:\n    cinfo->out_color_components = 1;\n    break;\n  case JCS_RGB:\n  case JCS_EXT_RGB:\n  case JCS_EXT_RGBX:\n  case JCS_EXT_BGR:\n  case JCS_EXT_BGRX:\n  case JCS_EXT_XBGR:\n  case JCS_EXT_XRGB:\n  case JCS_EXT_RGBA:\n  case JCS_EXT_BGRA:\n  case JCS_EXT_ABGR:\n  case JCS_EXT_ARGB:\n    cinfo->out_color_components = rgb_pixelsize[cinfo->out_color_space];\n    break;\n  case JCS_YCbCr:\n    cinfo->out_color_components = 3;\n    break;\n  case JCS_CMYK:\n  case JCS_YCCK:\n    cinfo->out_color_components = 4;\n    break;\n  default:\t\t\t/* else must be same colorspace as in file */\n    cinfo->out_color_components = cinfo->num_components;\n    break;\n  }\n  cinfo->output_components = (cinfo->quantize_colors ? 1 :\n\t\t\t      cinfo->out_color_components);\n\n  /* See if upsampler will want to emit more than one row at a time */\n  if (use_merged_upsample(cinfo))\n    cinfo->rec_outbuf_height = cinfo->max_v_samp_factor;\n  else\n    cinfo->rec_outbuf_height = 1;\n}\n\n\n/*\n * Several decompression processes need to range-limit values to the range\n * 0..MAXJSAMPLE; the input value may fall somewhat outside this range\n * due to noise introduced by quantization, roundoff error, etc.  These\n * processes are inner loops and need to be as fast as possible.  On most\n * machines, particularly CPUs with pipelines or instruction prefetch,\n * a (subscript-check-less) C table lookup\n *\t\tx = sample_range_limit[x];\n * is faster than explicit tests\n *\t\tif (x < 0)  x = 0;\n *\t\telse if (x > MAXJSAMPLE)  x = MAXJSAMPLE;\n * These processes all use a common table prepared by the routine below.\n *\n * For most steps we can mathematically guarantee that the initial value\n * of x is within MAXJSAMPLE+1 of the legal range, so a table running from\n * -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient.  But for the initial\n * limiting step (just after the IDCT), a wildly out-of-range value is \n * possible if the input data is corrupt.  To avoid any chance of indexing\n * off the end of memory and getting a bad-pointer trap, we perform the\n * post-IDCT limiting thus:\n *\t\tx = range_limit[x & MASK];\n * where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit\n * samples.  Under normal circumstances this is more than enough range and\n * a correct output will be generated; with bogus input data the mask will\n * cause wraparound, and we will safely generate a bogus-but-in-range output.\n * For the post-IDCT step, we want to convert the data from signed to unsigned\n * representation by adding CENTERJSAMPLE at the same time that we limit it.\n * So the post-IDCT limiting table ends up looking like this:\n *   CENTERJSAMPLE,CENTERJSAMPLE+1,...,MAXJSAMPLE,\n *   MAXJSAMPLE (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),\n *   0          (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),\n *   0,1,...,CENTERJSAMPLE-1\n * Negative inputs select values from the upper half of the table after\n * masking.\n *\n * We can save some space by overlapping the start of the post-IDCT table\n * with the simpler range limiting table.  The post-IDCT table begins at\n * sample_range_limit + CENTERJSAMPLE.\n *\n * Note that the table is allocated in near data space on PCs; it's small\n * enough and used often enough to justify this.\n */\n\nLOCAL(void)\nprepare_range_limit_table (j_decompress_ptr cinfo)\n/* Allocate and fill in the sample_range_limit table */\n{\n  JSAMPLE * table;\n  int i;\n\n  table = (JSAMPLE *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t(5 * (MAXJSAMPLE+1) + CENTERJSAMPLE) * SIZEOF(JSAMPLE));\n  table += (MAXJSAMPLE+1);\t/* allow negative subscripts of simple table */\n  cinfo->sample_range_limit = table;\n  /* First segment of \"simple\" table: limit[x] = 0 for x < 0 */\n  MEMZERO(table - (MAXJSAMPLE+1), (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));\n  /* Main part of \"simple\" table: limit[x] = x */\n  for (i = 0; i <= MAXJSAMPLE; i++)\n    table[i] = (JSAMPLE) i;\n  table += CENTERJSAMPLE;\t/* Point to where post-IDCT table starts */\n  /* End of simple table, rest of first half of post-IDCT table */\n  for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++)\n    table[i] = MAXJSAMPLE;\n  /* Second half of post-IDCT table */\n  MEMZERO(table + (2 * (MAXJSAMPLE+1)),\n\t  (2 * (MAXJSAMPLE+1) - CENTERJSAMPLE) * SIZEOF(JSAMPLE));\n  MEMCOPY(table + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE),\n\t  cinfo->sample_range_limit, CENTERJSAMPLE * SIZEOF(JSAMPLE));\n}\n\n\n/*\n * Master selection of decompression modules.\n * This is done once at jpeg_start_decompress time.  We determine\n * which modules will be used and give them appropriate initialization calls.\n * We also initialize the decompressor input side to begin consuming data.\n *\n * Since jpeg_read_header has finished, we know what is in the SOF\n * and (first) SOS markers.  We also have all the application parameter\n * settings.\n */\n\nLOCAL(void)\nmaster_selection (j_decompress_ptr cinfo)\n{\n  my_master_ptr master = (my_master_ptr) cinfo->master;\n  boolean use_c_buffer;\n  long samplesperrow;\n  JDIMENSION jd_samplesperrow;\n\n  /* Initialize dimensions and other stuff */\n  jpeg_calc_output_dimensions(cinfo);\n  prepare_range_limit_table(cinfo);\n\n  /* Width of an output scanline must be representable as JDIMENSION. */\n  samplesperrow = (long) cinfo->output_width * (long) cinfo->out_color_components;\n  jd_samplesperrow = (JDIMENSION) samplesperrow;\n  if ((long) jd_samplesperrow != samplesperrow)\n    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);\n\n  /* Initialize my private state */\n  master->pass_number = 0;\n  master->using_merged_upsample = use_merged_upsample(cinfo);\n\n  /* Color quantizer selection */\n  master->quantizer_1pass = NULL;\n  master->quantizer_2pass = NULL;\n  /* No mode changes if not using buffered-image mode. */\n  if (! cinfo->quantize_colors || ! cinfo->buffered_image) {\n    cinfo->enable_1pass_quant = FALSE;\n    cinfo->enable_external_quant = FALSE;\n    cinfo->enable_2pass_quant = FALSE;\n  }\n  if (cinfo->quantize_colors) {\n    if (cinfo->raw_data_out)\n      ERREXIT(cinfo, JERR_NOTIMPL);\n    /* 2-pass quantizer only works in 3-component color space. */\n    if (cinfo->out_color_components != 3) {\n      cinfo->enable_1pass_quant = TRUE;\n      cinfo->enable_external_quant = FALSE;\n      cinfo->enable_2pass_quant = FALSE;\n      cinfo->colormap = NULL;\n    } else if (cinfo->colormap != NULL) {\n      cinfo->enable_external_quant = TRUE;\n    } else if (cinfo->two_pass_quantize) {\n      cinfo->enable_2pass_quant = TRUE;\n    } else {\n      cinfo->enable_1pass_quant = TRUE;\n    }\n\n    if (cinfo->enable_1pass_quant) {\n#ifdef QUANT_1PASS_SUPPORTED\n      jinit_1pass_quantizer(cinfo);\n      master->quantizer_1pass = cinfo->cquantize;\n#else\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n    }\n\n    /* We use the 2-pass code to map to external colormaps. */\n    if (cinfo->enable_2pass_quant || cinfo->enable_external_quant) {\n#ifdef QUANT_2PASS_SUPPORTED\n      jinit_2pass_quantizer(cinfo);\n      master->quantizer_2pass = cinfo->cquantize;\n#else\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n    }\n    /* If both quantizers are initialized, the 2-pass one is left active;\n     * this is necessary for starting with quantization to an external map.\n     */\n  }\n\n  /* Post-processing: in particular, color conversion first */\n  if (! cinfo->raw_data_out) {\n    if (master->using_merged_upsample) {\n#ifdef UPSAMPLE_MERGING_SUPPORTED\n      jinit_merged_upsampler(cinfo); /* does color conversion too */\n#else\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n    } else {\n      jinit_color_deconverter(cinfo);\n      jinit_upsampler(cinfo);\n    }\n    jinit_d_post_controller(cinfo, cinfo->enable_2pass_quant);\n  }\n  /* Inverse DCT */\n  jinit_inverse_dct(cinfo);\n  /* Entropy decoding: either Huffman or arithmetic coding. */\n  if (cinfo->arith_code) {\n#ifdef D_ARITH_CODING_SUPPORTED\n    jinit_arith_decoder(cinfo);\n#else\n    ERREXIT(cinfo, JERR_ARITH_NOTIMPL);\n#endif\n  } else {\n    if (cinfo->progressive_mode) {\n#ifdef D_PROGRESSIVE_SUPPORTED\n      jinit_phuff_decoder(cinfo);\n#else\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n    } else\n      jinit_huff_decoder(cinfo);\n  }\n\n  /* Initialize principal buffer controllers. */\n  use_c_buffer = cinfo->inputctl->has_multiple_scans || cinfo->buffered_image;\n  jinit_d_coef_controller(cinfo, use_c_buffer);\n\n  if (! cinfo->raw_data_out)\n    jinit_d_main_controller(cinfo, FALSE /* never need full buffer here */);\n\n  /* We can now tell the memory manager to allocate virtual arrays. */\n  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);\n\n  /* Initialize input side of decompressor to consume first scan. */\n  (*cinfo->inputctl->start_input_pass) (cinfo);\n\n#ifdef D_MULTISCAN_FILES_SUPPORTED\n  /* If jpeg_start_decompress will read the whole file, initialize\n   * progress monitoring appropriately.  The input step is counted\n   * as one pass.\n   */\n  if (cinfo->progress != NULL && ! cinfo->buffered_image &&\n      cinfo->inputctl->has_multiple_scans) {\n    int nscans;\n    /* Estimate number of scans to set pass_limit. */\n    if (cinfo->progressive_mode) {\n      /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */\n      nscans = 2 + 3 * cinfo->num_components;\n    } else {\n      /* For a nonprogressive multiscan file, estimate 1 scan per component. */\n      nscans = cinfo->num_components;\n    }\n    cinfo->progress->pass_counter = 0L;\n    cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans;\n    cinfo->progress->completed_passes = 0;\n    cinfo->progress->total_passes = (cinfo->enable_2pass_quant ? 3 : 2);\n    /* Count the input pass as done */\n    master->pass_number++;\n  }\n#endif /* D_MULTISCAN_FILES_SUPPORTED */\n}\n\n\n/*\n * Per-pass setup.\n * This is called at the beginning of each output pass.  We determine which\n * modules will be active during this pass and give them appropriate\n * start_pass calls.  We also set is_dummy_pass to indicate whether this\n * is a \"real\" output pass or a dummy pass for color quantization.\n * (In the latter case, jdapistd.c will crank the pass to completion.)\n */\n\nMETHODDEF(void)\nprepare_for_output_pass (j_decompress_ptr cinfo)\n{\n  my_master_ptr master = (my_master_ptr) cinfo->master;\n\n  if (master->pub.is_dummy_pass) {\n#ifdef QUANT_2PASS_SUPPORTED\n    /* Final pass of 2-pass quantization */\n    master->pub.is_dummy_pass = FALSE;\n    (*cinfo->cquantize->start_pass) (cinfo, FALSE);\n    (*cinfo->post->start_pass) (cinfo, JBUF_CRANK_DEST);\n    (*cinfo->main->start_pass) (cinfo, JBUF_CRANK_DEST);\n#else\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif /* QUANT_2PASS_SUPPORTED */\n  } else {\n    if (cinfo->quantize_colors && cinfo->colormap == NULL) {\n      /* Select new quantization method */\n      if (cinfo->two_pass_quantize && cinfo->enable_2pass_quant) {\n\tcinfo->cquantize = master->quantizer_2pass;\n\tmaster->pub.is_dummy_pass = TRUE;\n      } else if (cinfo->enable_1pass_quant) {\n\tcinfo->cquantize = master->quantizer_1pass;\n      } else {\n\tERREXIT(cinfo, JERR_MODE_CHANGE);\n      }\n    }\n    (*cinfo->idct->start_pass) (cinfo);\n    (*cinfo->coef->start_output_pass) (cinfo);\n    if (! cinfo->raw_data_out) {\n      if (! master->using_merged_upsample)\n\t(*cinfo->cconvert->start_pass) (cinfo);\n      (*cinfo->upsample->start_pass) (cinfo);\n      if (cinfo->quantize_colors)\n\t(*cinfo->cquantize->start_pass) (cinfo, master->pub.is_dummy_pass);\n      (*cinfo->post->start_pass) (cinfo,\n\t    (master->pub.is_dummy_pass ? JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));\n      (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);\n    }\n  }\n\n  /* Set up progress monitor's pass info if present */\n  if (cinfo->progress != NULL) {\n    cinfo->progress->completed_passes = master->pass_number;\n    cinfo->progress->total_passes = master->pass_number +\n\t\t\t\t    (master->pub.is_dummy_pass ? 2 : 1);\n    /* In buffered-image mode, we assume one more output pass if EOI not\n     * yet reached, but no more passes if EOI has been reached.\n     */\n    if (cinfo->buffered_image && ! cinfo->inputctl->eoi_reached) {\n      cinfo->progress->total_passes += (cinfo->enable_2pass_quant ? 2 : 1);\n    }\n  }\n}\n\n\n/*\n * Finish up at end of an output pass.\n */\n\nMETHODDEF(void)\nfinish_output_pass (j_decompress_ptr cinfo)\n{\n  my_master_ptr master = (my_master_ptr) cinfo->master;\n\n  if (cinfo->quantize_colors)\n    (*cinfo->cquantize->finish_pass) (cinfo);\n  master->pass_number++;\n}\n\n\n#ifdef D_MULTISCAN_FILES_SUPPORTED\n\n/*\n * Switch to a new external colormap between output passes.\n */\n\nGLOBAL(void)\njpeg_new_colormap (j_decompress_ptr cinfo)\n{\n  my_master_ptr master = (my_master_ptr) cinfo->master;\n\n  /* Prevent application from calling me at wrong times */\n  if (cinfo->global_state != DSTATE_BUFIMAGE)\n    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n\n  if (cinfo->quantize_colors && cinfo->enable_external_quant &&\n      cinfo->colormap != NULL) {\n    /* Select 2-pass quantizer for external colormap use */\n    cinfo->cquantize = master->quantizer_2pass;\n    /* Notify quantizer of colormap change */\n    (*cinfo->cquantize->new_color_map) (cinfo);\n    master->pub.is_dummy_pass = FALSE; /* just in case */\n  } else\n    ERREXIT(cinfo, JERR_MODE_CHANGE);\n}\n\n#endif /* D_MULTISCAN_FILES_SUPPORTED */\n\n\n/*\n * Initialize master decompression control and select active modules.\n * This is performed at the start of jpeg_start_decompress.\n */\n\nGLOBAL(void)\njinit_master_decompress (j_decompress_ptr cinfo)\n{\n  my_master_ptr master;\n\n  master = (my_master_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(my_decomp_master));\n  cinfo->master = (struct jpeg_decomp_master *) master;\n  master->pub.prepare_for_output_pass = prepare_for_output_pass;\n  master->pub.finish_output_pass = finish_output_pass;\n\n  master->pub.is_dummy_pass = FALSE;\n\n  master_selection(cinfo);\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdmerge.c",
    "content": "/*\n * jdmerge.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * libjpeg-turbo Modifications:\n * Copyright (C) 2009, 2011, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains code for merged upsampling/color conversion.\n *\n * This file combines functions from jdsample.c and jdcolor.c;\n * read those files first to understand what's going on.\n *\n * When the chroma components are to be upsampled by simple replication\n * (ie, box filtering), we can save some work in color conversion by\n * calculating all the output pixels corresponding to a pair of chroma\n * samples at one time.  In the conversion equations\n *\tR = Y           + K1 * Cr\n *\tG = Y + K2 * Cb + K3 * Cr\n *\tB = Y + K4 * Cb\n * only the Y term varies among the group of pixels corresponding to a pair\n * of chroma samples, so the rest of the terms can be calculated just once.\n * At typical sampling ratios, this eliminates half or three-quarters of the\n * multiplications needed for color conversion.\n *\n * This file currently provides implementations for the following cases:\n *\tYCbCr => RGB color conversion only.\n *\tSampling ratios of 2h1v or 2h2v.\n *\tNo scaling needed at upsample time.\n *\tCorner-aligned (non-CCIR601) sampling alignment.\n * Other special cases could be added, but in most applications these are\n * the only common cases.  (For uncommon cases we fall back on the more\n * general code in jdsample.c and jdcolor.c.)\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jsimd.h\"\n#include \"config.h\"\n\n#ifdef UPSAMPLE_MERGING_SUPPORTED\n\n\n/* Private subobject */\n\ntypedef struct {\n  struct jpeg_upsampler pub;\t/* public fields */\n\n  /* Pointer to routine to do actual upsampling/conversion of one row group */\n  JMETHOD(void, upmethod, (j_decompress_ptr cinfo,\n\t\t\t   JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,\n\t\t\t   JSAMPARRAY output_buf));\n\n  /* Private state for YCC->RGB conversion */\n  int * Cr_r_tab;\t\t/* => table for Cr to R conversion */\n  int * Cb_b_tab;\t\t/* => table for Cb to B conversion */\n  INT32 * Cr_g_tab;\t\t/* => table for Cr to G conversion */\n  INT32 * Cb_g_tab;\t\t/* => table for Cb to G conversion */\n\n  /* For 2:1 vertical sampling, we produce two output rows at a time.\n   * We need a \"spare\" row buffer to hold the second output row if the\n   * application provides just a one-row buffer; we also use the spare\n   * to discard the dummy last row if the image height is odd.\n   */\n  JSAMPROW spare_row;\n  boolean spare_full;\t\t/* T if spare buffer is occupied */\n\n  JDIMENSION out_row_width;\t/* samples per output row */\n  JDIMENSION rows_to_go;\t/* counts rows remaining in image */\n} my_upsampler;\n\ntypedef my_upsampler * my_upsample_ptr;\n\n#define SCALEBITS\t16\t/* speediest right-shift on some machines */\n#define ONE_HALF\t((INT32) 1 << (SCALEBITS-1))\n#define FIX(x)\t\t((INT32) ((x) * (1L<<SCALEBITS) + 0.5))\n\n\n/* Include inline routines for colorspace extensions */\n\n#include \"jdmrgext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n\n#define RGB_RED EXT_RGB_RED\n#define RGB_GREEN EXT_RGB_GREEN\n#define RGB_BLUE EXT_RGB_BLUE\n#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n#define h2v1_merged_upsample_internal extrgb_h2v1_merged_upsample_internal\n#define h2v2_merged_upsample_internal extrgb_h2v2_merged_upsample_internal\n#include \"jdmrgext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n#undef h2v1_merged_upsample_internal\n#undef h2v2_merged_upsample_internal\n\n#define RGB_RED EXT_RGBX_RED\n#define RGB_GREEN EXT_RGBX_GREEN\n#define RGB_BLUE EXT_RGBX_BLUE\n#define RGB_ALPHA 3\n#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n#define h2v1_merged_upsample_internal extrgbx_h2v1_merged_upsample_internal\n#define h2v2_merged_upsample_internal extrgbx_h2v2_merged_upsample_internal\n#include \"jdmrgext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_ALPHA\n#undef RGB_PIXELSIZE\n#undef h2v1_merged_upsample_internal\n#undef h2v2_merged_upsample_internal\n\n#define RGB_RED EXT_BGR_RED\n#define RGB_GREEN EXT_BGR_GREEN\n#define RGB_BLUE EXT_BGR_BLUE\n#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n#define h2v1_merged_upsample_internal extbgr_h2v1_merged_upsample_internal\n#define h2v2_merged_upsample_internal extbgr_h2v2_merged_upsample_internal\n#include \"jdmrgext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_PIXELSIZE\n#undef h2v1_merged_upsample_internal\n#undef h2v2_merged_upsample_internal\n\n#define RGB_RED EXT_BGRX_RED\n#define RGB_GREEN EXT_BGRX_GREEN\n#define RGB_BLUE EXT_BGRX_BLUE\n#define RGB_ALPHA 3\n#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n#define h2v1_merged_upsample_internal extbgrx_h2v1_merged_upsample_internal\n#define h2v2_merged_upsample_internal extbgrx_h2v2_merged_upsample_internal\n#include \"jdmrgext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_ALPHA\n#undef RGB_PIXELSIZE\n#undef h2v1_merged_upsample_internal\n#undef h2v2_merged_upsample_internal\n\n#define RGB_RED EXT_XBGR_RED\n#define RGB_GREEN EXT_XBGR_GREEN\n#define RGB_BLUE EXT_XBGR_BLUE\n#define RGB_ALPHA 0\n#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n#define h2v1_merged_upsample_internal extxbgr_h2v1_merged_upsample_internal\n#define h2v2_merged_upsample_internal extxbgr_h2v2_merged_upsample_internal\n#include \"jdmrgext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_ALPHA\n#undef RGB_PIXELSIZE\n#undef h2v1_merged_upsample_internal\n#undef h2v2_merged_upsample_internal\n\n#define RGB_RED EXT_XRGB_RED\n#define RGB_GREEN EXT_XRGB_GREEN\n#define RGB_BLUE EXT_XRGB_BLUE\n#define RGB_ALPHA 0\n#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n#define h2v1_merged_upsample_internal extxrgb_h2v1_merged_upsample_internal\n#define h2v2_merged_upsample_internal extxrgb_h2v2_merged_upsample_internal\n#include \"jdmrgext.c\"\n#undef RGB_RED\n#undef RGB_GREEN\n#undef RGB_BLUE\n#undef RGB_ALPHA\n#undef RGB_PIXELSIZE\n#undef h2v1_merged_upsample_internal\n#undef h2v2_merged_upsample_internal\n\n\n/*\n * Initialize tables for YCC->RGB colorspace conversion.\n * This is taken directly from jdcolor.c; see that file for more info.\n */\n\nLOCAL(void)\nbuild_ycc_rgb_table (j_decompress_ptr cinfo)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  int i;\n  INT32 x;\n  SHIFT_TEMPS\n\n  upsample->Cr_r_tab = (int *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(MAXJSAMPLE+1) * SIZEOF(int));\n  upsample->Cb_b_tab = (int *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(MAXJSAMPLE+1) * SIZEOF(int));\n  upsample->Cr_g_tab = (INT32 *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(MAXJSAMPLE+1) * SIZEOF(INT32));\n  upsample->Cb_g_tab = (INT32 *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(MAXJSAMPLE+1) * SIZEOF(INT32));\n\n  for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {\n    /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */\n    /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */\n    /* Cr=>R value is nearest int to 1.40200 * x */\n    upsample->Cr_r_tab[i] = (int)\n\t\t    RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);\n    /* Cb=>B value is nearest int to 1.77200 * x */\n    upsample->Cb_b_tab[i] = (int)\n\t\t    RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);\n    /* Cr=>G value is scaled-up -0.71414 * x */\n    upsample->Cr_g_tab[i] = (- FIX(0.71414)) * x;\n    /* Cb=>G value is scaled-up -0.34414 * x */\n    /* We also add in ONE_HALF so that need not do it in inner loop */\n    upsample->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF;\n  }\n}\n\n\n/*\n * Initialize for an upsampling pass.\n */\n\nMETHODDEF(void)\nstart_pass_merged_upsample (j_decompress_ptr cinfo)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n\n  /* Mark the spare buffer empty */\n  upsample->spare_full = FALSE;\n  /* Initialize total-height counter for detecting bottom of image */\n  upsample->rows_to_go = cinfo->output_height;\n}\n\n\n/*\n * Control routine to do upsampling (and color conversion).\n *\n * The control routine just handles the row buffering considerations.\n */\n\nMETHODDEF(void)\nmerged_2v_upsample (j_decompress_ptr cinfo,\n\t\t    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n\t\t    JDIMENSION in_row_groups_avail,\n\t\t    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t\t    JDIMENSION out_rows_avail)\n/* 2:1 vertical sampling case: may need a spare row. */\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  JSAMPROW work_ptrs[2];\n  JDIMENSION num_rows;\t\t/* number of rows returned to caller */\n\n  if (upsample->spare_full) {\n    /* If we have a spare row saved from a previous cycle, just return it. */\n    jcopy_sample_rows(& upsample->spare_row, 0, output_buf + *out_row_ctr, 0,\n\t\t      1, upsample->out_row_width);\n    num_rows = 1;\n    upsample->spare_full = FALSE;\n  } else {\n    /* Figure number of rows to return to caller. */\n    num_rows = 2;\n    /* Not more than the distance to the end of the image. */\n    if (num_rows > upsample->rows_to_go)\n      num_rows = upsample->rows_to_go;\n    /* And not more than what the client can accept: */\n    out_rows_avail -= *out_row_ctr;\n    if (num_rows > out_rows_avail)\n      num_rows = out_rows_avail;\n    /* Create output pointer array for upsampler. */\n    work_ptrs[0] = output_buf[*out_row_ctr];\n    if (num_rows > 1) {\n      work_ptrs[1] = output_buf[*out_row_ctr + 1];\n    } else {\n      work_ptrs[1] = upsample->spare_row;\n      upsample->spare_full = TRUE;\n    }\n    /* Now do the upsampling. */\n    (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, work_ptrs);\n  }\n\n  /* Adjust counts */\n  *out_row_ctr += num_rows;\n  upsample->rows_to_go -= num_rows;\n  /* When the buffer is emptied, declare this input row group consumed */\n  if (! upsample->spare_full)\n    (*in_row_group_ctr)++;\n}\n\n\nMETHODDEF(void)\nmerged_1v_upsample (j_decompress_ptr cinfo,\n\t\t    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n\t\t    JDIMENSION in_row_groups_avail,\n\t\t    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t\t    JDIMENSION out_rows_avail)\n/* 1:1 vertical sampling case: much easier, never need a spare row. */\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n\n  /* Just do the upsampling. */\n  (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr,\n\t\t\t output_buf + *out_row_ctr);\n  /* Adjust counts */\n  (*out_row_ctr)++;\n  (*in_row_group_ctr)++;\n}\n\n\n/*\n * These are the routines invoked by the control routines to do\n * the actual upsampling/conversion.  One row group is processed per call.\n *\n * Note: since we may be writing directly into application-supplied buffers,\n * we have to be honest about the output width; we can't assume the buffer\n * has been rounded up to an even width.\n */\n\n\n/*\n * Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical.\n */\n\nMETHODDEF(void)\nh2v1_merged_upsample (j_decompress_ptr cinfo,\n\t\t      JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,\n\t\t      JSAMPARRAY output_buf)\n{\n  switch (cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      extrgb_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                           output_buf);\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      extrgbx_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                            output_buf);\n      break;\n    case JCS_EXT_BGR:\n      extbgr_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                           output_buf);\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      extbgrx_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                            output_buf);\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      extxbgr_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                            output_buf);\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      extxrgb_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                            output_buf);\n      break;\n    default:\n      h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                    output_buf);\n      break;\n  }\n}\n\n\n/*\n * Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical.\n */\n\nMETHODDEF(void)\nh2v2_merged_upsample (j_decompress_ptr cinfo,\n\t\t      JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,\n\t\t      JSAMPARRAY output_buf)\n{\n  switch (cinfo->out_color_space) {\n    case JCS_EXT_RGB:\n      extrgb_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                           output_buf);\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      extrgbx_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                            output_buf);\n      break;\n    case JCS_EXT_BGR:\n      extbgr_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                           output_buf);\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      extbgrx_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                            output_buf);\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      extxbgr_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                            output_buf);\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      extxrgb_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                            output_buf);\n      break;\n    default:\n      h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr,\n                                    output_buf);\n      break;\n  }\n}\n\n\n/*\n * Module initialization routine for merged upsampling/color conversion.\n *\n * NB: this is called under the conditions determined by use_merged_upsample()\n * in jdmaster.c.  That routine MUST correspond to the actual capabilities\n * of this module; no safety checks are made here.\n */\n\nGLOBAL(void)\njinit_merged_upsampler (j_decompress_ptr cinfo)\n{\n  my_upsample_ptr upsample;\n\n  upsample = (my_upsample_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_upsampler));\n  cinfo->upsample = (struct jpeg_upsampler *) upsample;\n  upsample->pub.start_pass = start_pass_merged_upsample;\n  upsample->pub.need_context_rows = FALSE;\n\n  upsample->out_row_width = cinfo->output_width * cinfo->out_color_components;\n\n  if (cinfo->max_v_samp_factor == 2) {\n    upsample->pub.upsample = merged_2v_upsample;\n    if (jsimd_can_h2v2_merged_upsample())\n      upsample->upmethod = jsimd_h2v2_merged_upsample;\n    else\n      upsample->upmethod = h2v2_merged_upsample;\n    /* Allocate a spare row buffer */\n    upsample->spare_row = (JSAMPROW)\n      (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t(size_t) (upsample->out_row_width * SIZEOF(JSAMPLE)));\n  } else {\n    upsample->pub.upsample = merged_1v_upsample;\n    if (jsimd_can_h2v1_merged_upsample())\n      upsample->upmethod = jsimd_h2v1_merged_upsample;\n    else\n      upsample->upmethod = h2v1_merged_upsample;\n    /* No spare row needed */\n    upsample->spare_row = NULL;\n  }\n\n  build_ycc_rgb_table(cinfo);\n}\n\n#endif /* UPSAMPLE_MERGING_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdmrgext.c",
    "content": "/*\n * jdmrgext.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2011, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains code for merged upsampling/color conversion.\n */\n\n\n/* This file is included by jdmerge.c */\n\n\n/*\n * Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical.\n */\n\nINLINE\nLOCAL(void)\nh2v1_merged_upsample_internal (j_decompress_ptr cinfo,\n                               JSAMPIMAGE input_buf,\n                               JDIMENSION in_row_group_ctr,\n                               JSAMPARRAY output_buf)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  register int y, cred, cgreen, cblue;\n  int cb, cr;\n  register JSAMPROW outptr;\n  JSAMPROW inptr0, inptr1, inptr2;\n  JDIMENSION col;\n  /* copy these pointers into registers if possible */\n  register JSAMPLE * range_limit = cinfo->sample_range_limit;\n  int * Crrtab = upsample->Cr_r_tab;\n  int * Cbbtab = upsample->Cb_b_tab;\n  INT32 * Crgtab = upsample->Cr_g_tab;\n  INT32 * Cbgtab = upsample->Cb_g_tab;\n  SHIFT_TEMPS\n\n  inptr0 = input_buf[0][in_row_group_ctr];\n  inptr1 = input_buf[1][in_row_group_ctr];\n  inptr2 = input_buf[2][in_row_group_ctr];\n  outptr = output_buf[0];\n  /* Loop for each pair of output pixels */\n  for (col = cinfo->output_width >> 1; col > 0; col--) {\n    /* Do the chroma part of the calculation */\n    cb = GETJSAMPLE(*inptr1++);\n    cr = GETJSAMPLE(*inptr2++);\n    cred = Crrtab[cr];\n    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);\n    cblue = Cbbtab[cb];\n    /* Fetch 2 Y values and emit 2 pixels */\n    y  = GETJSAMPLE(*inptr0++);\n    outptr[RGB_RED] =   range_limit[y + cred];\n    outptr[RGB_GREEN] = range_limit[y + cgreen];\n    outptr[RGB_BLUE] =  range_limit[y + cblue];\n#ifdef RGB_ALPHA\n    outptr[RGB_ALPHA] = 0xFF;\n#endif\n    outptr += RGB_PIXELSIZE;\n    y  = GETJSAMPLE(*inptr0++);\n    outptr[RGB_RED] =   range_limit[y + cred];\n    outptr[RGB_GREEN] = range_limit[y + cgreen];\n    outptr[RGB_BLUE] =  range_limit[y + cblue];\n#ifdef RGB_ALPHA\n    outptr[RGB_ALPHA] = 0xFF;\n#endif\n    outptr += RGB_PIXELSIZE;\n  }\n  /* If image width is odd, do the last output column separately */\n  if (cinfo->output_width & 1) {\n    cb = GETJSAMPLE(*inptr1);\n    cr = GETJSAMPLE(*inptr2);\n    cred = Crrtab[cr];\n    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);\n    cblue = Cbbtab[cb];\n    y  = GETJSAMPLE(*inptr0);\n    outptr[RGB_RED] =   range_limit[y + cred];\n    outptr[RGB_GREEN] = range_limit[y + cgreen];\n    outptr[RGB_BLUE] =  range_limit[y + cblue];\n#ifdef RGB_ALPHA\n    outptr[RGB_ALPHA] = 0xFF;\n#endif\n  }\n}\n\n\n/*\n * Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical.\n */\n\nINLINE\nLOCAL(void)\nh2v2_merged_upsample_internal (j_decompress_ptr cinfo,\n                               JSAMPIMAGE input_buf,\n                               JDIMENSION in_row_group_ctr,\n                               JSAMPARRAY output_buf)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  register int y, cred, cgreen, cblue;\n  int cb, cr;\n  register JSAMPROW outptr0, outptr1;\n  JSAMPROW inptr00, inptr01, inptr1, inptr2;\n  JDIMENSION col;\n  /* copy these pointers into registers if possible */\n  register JSAMPLE * range_limit = cinfo->sample_range_limit;\n  int * Crrtab = upsample->Cr_r_tab;\n  int * Cbbtab = upsample->Cb_b_tab;\n  INT32 * Crgtab = upsample->Cr_g_tab;\n  INT32 * Cbgtab = upsample->Cb_g_tab;\n  SHIFT_TEMPS\n\n  inptr00 = input_buf[0][in_row_group_ctr*2];\n  inptr01 = input_buf[0][in_row_group_ctr*2 + 1];\n  inptr1 = input_buf[1][in_row_group_ctr];\n  inptr2 = input_buf[2][in_row_group_ctr];\n  outptr0 = output_buf[0];\n  outptr1 = output_buf[1];\n  /* Loop for each group of output pixels */\n  for (col = cinfo->output_width >> 1; col > 0; col--) {\n    /* Do the chroma part of the calculation */\n    cb = GETJSAMPLE(*inptr1++);\n    cr = GETJSAMPLE(*inptr2++);\n    cred = Crrtab[cr];\n    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);\n    cblue = Cbbtab[cb];\n    /* Fetch 4 Y values and emit 4 pixels */\n    y  = GETJSAMPLE(*inptr00++);\n    outptr0[RGB_RED] =   range_limit[y + cred];\n    outptr0[RGB_GREEN] = range_limit[y + cgreen];\n    outptr0[RGB_BLUE] =  range_limit[y + cblue];\n#ifdef RGB_ALPHA\n    outptr0[RGB_ALPHA] = 0xFF;\n#endif\n    outptr0 += RGB_PIXELSIZE;\n    y  = GETJSAMPLE(*inptr00++);\n    outptr0[RGB_RED] =   range_limit[y + cred];\n    outptr0[RGB_GREEN] = range_limit[y + cgreen];\n    outptr0[RGB_BLUE] =  range_limit[y + cblue];\n#ifdef RGB_ALPHA\n    outptr0[RGB_ALPHA] = 0xFF;\n#endif\n    outptr0 += RGB_PIXELSIZE;\n    y  = GETJSAMPLE(*inptr01++);\n    outptr1[RGB_RED] =   range_limit[y + cred];\n    outptr1[RGB_GREEN] = range_limit[y + cgreen];\n    outptr1[RGB_BLUE] =  range_limit[y + cblue];\n#ifdef RGB_ALPHA\n    outptr1[RGB_ALPHA] = 0xFF;\n#endif\n    outptr1 += RGB_PIXELSIZE;\n    y  = GETJSAMPLE(*inptr01++);\n    outptr1[RGB_RED] =   range_limit[y + cred];\n    outptr1[RGB_GREEN] = range_limit[y + cgreen];\n    outptr1[RGB_BLUE] =  range_limit[y + cblue];\n#ifdef RGB_ALPHA\n    outptr1[RGB_ALPHA] = 0xFF;\n#endif\n    outptr1 += RGB_PIXELSIZE;\n  }\n  /* If image width is odd, do the last output column separately */\n  if (cinfo->output_width & 1) {\n    cb = GETJSAMPLE(*inptr1);\n    cr = GETJSAMPLE(*inptr2);\n    cred = Crrtab[cr];\n    cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);\n    cblue = Cbbtab[cb];\n    y  = GETJSAMPLE(*inptr00);\n    outptr0[RGB_RED] =   range_limit[y + cred];\n    outptr0[RGB_GREEN] = range_limit[y + cgreen];\n    outptr0[RGB_BLUE] =  range_limit[y + cblue];\n#ifdef RGB_ALPHA\n    outptr0[RGB_ALPHA] = 0xFF;\n#endif\n    y  = GETJSAMPLE(*inptr01);\n    outptr1[RGB_RED] =   range_limit[y + cred];\n    outptr1[RGB_GREEN] = range_limit[y + cgreen];\n    outptr1[RGB_BLUE] =  range_limit[y + cblue];\n#ifdef RGB_ALPHA\n    outptr1[RGB_ALPHA] = 0xFF;\n#endif\n  }\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdphuff.c",
    "content": "/*\n * jdphuff.c\n *\n * Copyright (C) 1995-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains Huffman entropy decoding routines for progressive JPEG.\n *\n * Much of the complexity here has to do with supporting input suspension.\n * If the data source module demands suspension, we want to be able to back\n * up to the start of the current MCU.  To do this, we copy state variables\n * into local working storage, and update them back to the permanent\n * storage only upon successful completion of an MCU.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdhuff.h\"\t\t/* Declarations shared with jdhuff.c */\n\n\n#ifdef D_PROGRESSIVE_SUPPORTED\n\n/*\n * Expanded entropy decoder object for progressive Huffman decoding.\n *\n * The savable_state subrecord contains fields that change within an MCU,\n * but must not be updated permanently until we complete the MCU.\n */\n\ntypedef struct {\n  unsigned int EOBRUN;\t\t\t/* remaining EOBs in EOBRUN */\n  int last_dc_val[MAX_COMPS_IN_SCAN];\t/* last DC coef for each component */\n} savable_state;\n\n/* This macro is to work around compilers with missing or broken\n * structure assignment.  You'll need to fix this code if you have\n * such a compiler and you change MAX_COMPS_IN_SCAN.\n */\n\n#ifndef NO_STRUCT_ASSIGN\n#define ASSIGN_STATE(dest,src)  ((dest) = (src))\n#else\n#if MAX_COMPS_IN_SCAN == 4\n#define ASSIGN_STATE(dest,src)  \\\n\t((dest).EOBRUN = (src).EOBRUN, \\\n\t (dest).last_dc_val[0] = (src).last_dc_val[0], \\\n\t (dest).last_dc_val[1] = (src).last_dc_val[1], \\\n\t (dest).last_dc_val[2] = (src).last_dc_val[2], \\\n\t (dest).last_dc_val[3] = (src).last_dc_val[3])\n#endif\n#endif\n\n\ntypedef struct {\n  struct jpeg_entropy_decoder pub; /* public fields */\n\n  /* These fields are loaded into local variables at start of each MCU.\n   * In case of suspension, we exit WITHOUT updating them.\n   */\n  bitread_perm_state bitstate;\t/* Bit buffer at start of MCU */\n  savable_state saved;\t\t/* Other state at start of MCU */\n\n  /* These fields are NOT loaded into local working state. */\n  unsigned int restarts_to_go;\t/* MCUs left in this restart interval */\n\n  /* Pointers to derived tables (these workspaces have image lifespan) */\n  d_derived_tbl * derived_tbls[NUM_HUFF_TBLS];\n\n  d_derived_tbl * ac_derived_tbl; /* active table during an AC scan */\n} phuff_entropy_decoder;\n\ntypedef phuff_entropy_decoder * phuff_entropy_ptr;\n\n/* Forward declarations */\nMETHODDEF(boolean) decode_mcu_DC_first JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t    JBLOCKROW *MCU_data));\nMETHODDEF(boolean) decode_mcu_AC_first JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t    JBLOCKROW *MCU_data));\nMETHODDEF(boolean) decode_mcu_DC_refine JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t     JBLOCKROW *MCU_data));\nMETHODDEF(boolean) decode_mcu_AC_refine JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t     JBLOCKROW *MCU_data));\n\n\n/*\n * Initialize for a Huffman-compressed scan.\n */\n\nMETHODDEF(void)\nstart_pass_phuff_decoder (j_decompress_ptr cinfo)\n{\n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  boolean is_DC_band, bad;\n  int ci, coefi, tbl;\n  int *coef_bit_ptr;\n  jpeg_component_info * compptr;\n\n  is_DC_band = (cinfo->Ss == 0);\n\n  /* Validate scan parameters */\n  bad = FALSE;\n  if (is_DC_band) {\n    if (cinfo->Se != 0)\n      bad = TRUE;\n  } else {\n    /* need not check Ss/Se < 0 since they came from unsigned bytes */\n    if (cinfo->Ss > cinfo->Se || cinfo->Se >= DCTSIZE2)\n      bad = TRUE;\n    /* AC scans may have only one component */\n    if (cinfo->comps_in_scan != 1)\n      bad = TRUE;\n  }\n  if (cinfo->Ah != 0) {\n    /* Successive approximation refinement scan: must have Al = Ah-1. */\n    if (cinfo->Al != cinfo->Ah-1)\n      bad = TRUE;\n  }\n  if (cinfo->Al > 13)\t\t/* need not check for < 0 */\n    bad = TRUE;\n  /* Arguably the maximum Al value should be less than 13 for 8-bit precision,\n   * but the spec doesn't say so, and we try to be liberal about what we\n   * accept.  Note: large Al values could result in out-of-range DC\n   * coefficients during early scans, leading to bizarre displays due to\n   * overflows in the IDCT math.  But we won't crash.\n   */\n  if (bad)\n    ERREXIT4(cinfo, JERR_BAD_PROGRESSION,\n\t     cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al);\n  /* Update progression status, and verify that scan order is legal.\n   * Note that inter-scan inconsistencies are treated as warnings\n   * not fatal errors ... not clear if this is right way to behave.\n   */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    int cindex = cinfo->cur_comp_info[ci]->component_index;\n    coef_bit_ptr = & cinfo->coef_bits[cindex][0];\n    if (!is_DC_band && coef_bit_ptr[0] < 0) /* AC without prior DC scan */\n      WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);\n    for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) {\n      int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];\n      if (cinfo->Ah != expected)\n\tWARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi);\n      coef_bit_ptr[coefi] = cinfo->Al;\n    }\n  }\n\n  /* Select MCU decoding routine */\n  if (cinfo->Ah == 0) {\n    if (is_DC_band)\n      entropy->pub.decode_mcu = decode_mcu_DC_first;\n    else\n      entropy->pub.decode_mcu = decode_mcu_AC_first;\n  } else {\n    if (is_DC_band)\n      entropy->pub.decode_mcu = decode_mcu_DC_refine;\n    else\n      entropy->pub.decode_mcu = decode_mcu_AC_refine;\n  }\n\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {\n    compptr = cinfo->cur_comp_info[ci];\n    /* Make sure requested tables are present, and compute derived tables.\n     * We may build same derived table more than once, but it's not expensive.\n     */\n    if (is_DC_band) {\n      if (cinfo->Ah == 0) {\t/* DC refinement needs no table */\n\ttbl = compptr->dc_tbl_no;\n\tjpeg_make_d_derived_tbl(cinfo, TRUE, tbl,\n\t\t\t\t& entropy->derived_tbls[tbl]);\n      }\n    } else {\n      tbl = compptr->ac_tbl_no;\n      jpeg_make_d_derived_tbl(cinfo, FALSE, tbl,\n\t\t\t      & entropy->derived_tbls[tbl]);\n      /* remember the single active table */\n      entropy->ac_derived_tbl = entropy->derived_tbls[tbl];\n    }\n    /* Initialize DC predictions to 0 */\n    entropy->saved.last_dc_val[ci] = 0;\n  }\n\n  /* Initialize bitread state variables */\n  entropy->bitstate.bits_left = 0;\n  entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */\n  entropy->pub.insufficient_data = FALSE;\n\n  /* Initialize private state variables */\n  entropy->saved.EOBRUN = 0;\n\n  /* Initialize restart counter */\n  entropy->restarts_to_go = cinfo->restart_interval;\n}\n\n\n/*\n * Figure F.12: extend sign bit.\n * On some machines, a shift and add will be faster than a table lookup.\n */\n\n#define AVOID_TABLES\n#ifdef AVOID_TABLES\n\n#define HUFF_EXTEND(x,s)  ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x))\n\n#else\n\n#define HUFF_EXTEND(x,s)  ((x) < extend_test[s] ? (x) + extend_offset[s] : (x))\n\nstatic const int extend_test[16] =   /* entry n is 2**(n-1) */\n  { 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,\n    0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };\n\nstatic const int extend_offset[16] = /* entry n is (-1 << n) + 1 */\n  { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1,\n    ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1,\n    ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1,\n    ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };\n\n#endif /* AVOID_TABLES */\n\n\n/*\n * Check for a restart marker & resynchronize decoder.\n * Returns FALSE if must suspend.\n */\n\nLOCAL(boolean)\nprocess_restart (j_decompress_ptr cinfo)\n{\n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  int ci;\n\n  /* Throw away any unused bits remaining in bit buffer; */\n  /* include any full bytes in next_marker's count of discarded bytes */\n  cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;\n  entropy->bitstate.bits_left = 0;\n\n  /* Advance past the RSTn marker */\n  if (! (*cinfo->marker->read_restart_marker) (cinfo))\n    return FALSE;\n\n  /* Re-initialize DC predictions to 0 */\n  for (ci = 0; ci < cinfo->comps_in_scan; ci++)\n    entropy->saved.last_dc_val[ci] = 0;\n  /* Re-init EOB run count, too */\n  entropy->saved.EOBRUN = 0;\n\n  /* Reset restart counter */\n  entropy->restarts_to_go = cinfo->restart_interval;\n\n  /* Reset out-of-data flag, unless read_restart_marker left us smack up\n   * against a marker.  In that case we will end up treating the next data\n   * segment as empty, and we can avoid producing bogus output pixels by\n   * leaving the flag set.\n   */\n  if (cinfo->unread_marker == 0)\n    entropy->pub.insufficient_data = FALSE;\n\n  return TRUE;\n}\n\n\n/*\n * Huffman MCU decoding.\n * Each of these routines decodes and returns one MCU's worth of\n * Huffman-compressed coefficients. \n * The coefficients are reordered from zigzag order into natural array order,\n * but are not dequantized.\n *\n * The i'th block of the MCU is stored into the block pointed to by\n * MCU_data[i].  WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER.\n *\n * We return FALSE if data source requested suspension.  In that case no\n * changes have been made to permanent state.  (Exception: some output\n * coefficients may already have been assigned.  This is harmless for\n * spectral selection, since we'll just re-assign them on the next call.\n * Successive approximation AC refinement has to be more careful, however.)\n */\n\n/*\n * MCU decoding for DC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\ndecode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{   \n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  int Al = cinfo->Al;\n  register int s, r;\n  int blkn, ci;\n  JBLOCKROW block;\n  BITREAD_STATE_VARS;\n  savable_state state;\n  d_derived_tbl * tbl;\n  jpeg_component_info * compptr;\n\n  /* Process restart marker if needed; may have to suspend */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      if (! process_restart(cinfo))\n\treturn FALSE;\n  }\n\n  /* If we've run out of data, just leave the MCU set to zeroes.\n   * This way, we return uniform gray for the remainder of the segment.\n   */\n  if (! entropy->pub.insufficient_data) {\n\n    /* Load up working state */\n    BITREAD_LOAD_STATE(cinfo,entropy->bitstate);\n    ASSIGN_STATE(state, entropy->saved);\n\n    /* Outer loop handles each block in the MCU */\n\n    for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n      block = MCU_data[blkn];\n      ci = cinfo->MCU_membership[blkn];\n      compptr = cinfo->cur_comp_info[ci];\n      tbl = entropy->derived_tbls[compptr->dc_tbl_no];\n\n      /* Decode a single block's worth of coefficients */\n\n      /* Section F.2.2.1: decode the DC coefficient difference */\n      HUFF_DECODE(s, br_state, tbl, return FALSE, label1);\n      if (s) {\n\tCHECK_BIT_BUFFER(br_state, s, return FALSE);\n\tr = GET_BITS(s);\n\ts = HUFF_EXTEND(r, s);\n      }\n\n      /* Convert DC difference to actual value, update last_dc_val */\n      s += state.last_dc_val[ci];\n      state.last_dc_val[ci] = s;\n      /* Scale and output the coefficient (assumes jpeg_natural_order[0]=0) */\n      (*block)[0] = (JCOEF) (s << Al);\n    }\n\n    /* Completed MCU, so update state */\n    BITREAD_SAVE_STATE(cinfo,entropy->bitstate);\n    ASSIGN_STATE(entropy->saved, state);\n  }\n\n  /* Account for restart interval (no-op if not using restarts) */\n  entropy->restarts_to_go--;\n\n  return TRUE;\n}\n\n\n/*\n * MCU decoding for AC initial scan (either spectral selection,\n * or first pass of successive approximation).\n */\n\nMETHODDEF(boolean)\ndecode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{   \n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  int Se = cinfo->Se;\n  int Al = cinfo->Al;\n  register int s, k, r;\n  unsigned int EOBRUN;\n  JBLOCKROW block;\n  BITREAD_STATE_VARS;\n  d_derived_tbl * tbl;\n\n  /* Process restart marker if needed; may have to suspend */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      if (! process_restart(cinfo))\n\treturn FALSE;\n  }\n\n  /* If we've run out of data, just leave the MCU set to zeroes.\n   * This way, we return uniform gray for the remainder of the segment.\n   */\n  if (! entropy->pub.insufficient_data) {\n\n    /* Load up working state.\n     * We can avoid loading/saving bitread state if in an EOB run.\n     */\n    EOBRUN = entropy->saved.EOBRUN;\t/* only part of saved state we need */\n\n    /* There is always only one block per MCU */\n\n    if (EOBRUN > 0)\t\t/* if it's a band of zeroes... */\n      EOBRUN--;\t\t\t/* ...process it now (we do nothing) */\n    else {\n      BITREAD_LOAD_STATE(cinfo,entropy->bitstate);\n      block = MCU_data[0];\n      tbl = entropy->ac_derived_tbl;\n\n      for (k = cinfo->Ss; k <= Se; k++) {\n\tHUFF_DECODE(s, br_state, tbl, return FALSE, label2);\n\tr = s >> 4;\n\ts &= 15;\n\tif (s) {\n\t  k += r;\n\t  CHECK_BIT_BUFFER(br_state, s, return FALSE);\n\t  r = GET_BITS(s);\n\t  s = HUFF_EXTEND(r, s);\n\t  /* Scale and output coefficient in natural (dezigzagged) order */\n\t  (*block)[jpeg_natural_order[k]] = (JCOEF) (s << Al);\n\t} else {\n\t  if (r == 15) {\t/* ZRL */\n\t    k += 15;\t\t/* skip 15 zeroes in band */\n\t  } else {\t\t/* EOBr, run length is 2^r + appended bits */\n\t    EOBRUN = 1 << r;\n\t    if (r) {\t\t/* EOBr, r > 0 */\n\t      CHECK_BIT_BUFFER(br_state, r, return FALSE);\n\t      r = GET_BITS(r);\n\t      EOBRUN += r;\n\t    }\n\t    EOBRUN--;\t\t/* this band is processed at this moment */\n\t    break;\t\t/* force end-of-band */\n\t  }\n\t}\n      }\n\n      BITREAD_SAVE_STATE(cinfo,entropy->bitstate);\n    }\n\n    /* Completed MCU, so update state */\n    entropy->saved.EOBRUN = EOBRUN;\t/* only part of saved state we need */\n  }\n\n  /* Account for restart interval (no-op if not using restarts) */\n  entropy->restarts_to_go--;\n\n  return TRUE;\n}\n\n\n/*\n * MCU decoding for DC successive approximation refinement scan.\n * Note: we assume such scans can be multi-component, although the spec\n * is not very clear on the point.\n */\n\nMETHODDEF(boolean)\ndecode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{   \n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  int p1 = 1 << cinfo->Al;\t/* 1 in the bit position being coded */\n  int blkn;\n  JBLOCKROW block;\n  BITREAD_STATE_VARS;\n\n  /* Process restart marker if needed; may have to suspend */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      if (! process_restart(cinfo))\n\treturn FALSE;\n  }\n\n  /* Not worth the cycles to check insufficient_data here,\n   * since we will not change the data anyway if we read zeroes.\n   */\n\n  /* Load up working state */\n  BITREAD_LOAD_STATE(cinfo,entropy->bitstate);\n\n  /* Outer loop handles each block in the MCU */\n\n  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {\n    block = MCU_data[blkn];\n\n    /* Encoded data is simply the next bit of the two's-complement DC value */\n    CHECK_BIT_BUFFER(br_state, 1, return FALSE);\n    if (GET_BITS(1))\n      (*block)[0] |= p1;\n    /* Note: since we use |=, repeating the assignment later is safe */\n  }\n\n  /* Completed MCU, so update state */\n  BITREAD_SAVE_STATE(cinfo,entropy->bitstate);\n\n  /* Account for restart interval (no-op if not using restarts) */\n  entropy->restarts_to_go--;\n\n  return TRUE;\n}\n\n\n/*\n * MCU decoding for AC successive approximation refinement scan.\n */\n\nMETHODDEF(boolean)\ndecode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)\n{   \n  phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;\n  int Se = cinfo->Se;\n  int p1 = 1 << cinfo->Al;\t/* 1 in the bit position being coded */\n  int m1 = (-1) << cinfo->Al;\t/* -1 in the bit position being coded */\n  register int s, k, r;\n  unsigned int EOBRUN;\n  JBLOCKROW block;\n  JCOEFPTR thiscoef;\n  BITREAD_STATE_VARS;\n  d_derived_tbl * tbl;\n  int num_newnz;\n  int newnz_pos[DCTSIZE2];\n\n  /* Process restart marker if needed; may have to suspend */\n  if (cinfo->restart_interval) {\n    if (entropy->restarts_to_go == 0)\n      if (! process_restart(cinfo))\n\treturn FALSE;\n  }\n\n  /* If we've run out of data, don't modify the MCU.\n   */\n  if (! entropy->pub.insufficient_data) {\n\n    /* Load up working state */\n    BITREAD_LOAD_STATE(cinfo,entropy->bitstate);\n    EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */\n\n    /* There is always only one block per MCU */\n    block = MCU_data[0];\n    tbl = entropy->ac_derived_tbl;\n\n    /* If we are forced to suspend, we must undo the assignments to any newly\n     * nonzero coefficients in the block, because otherwise we'd get confused\n     * next time about which coefficients were already nonzero.\n     * But we need not undo addition of bits to already-nonzero coefficients;\n     * instead, we can test the current bit to see if we already did it.\n     */\n    num_newnz = 0;\n\n    /* initialize coefficient loop counter to start of band */\n    k = cinfo->Ss;\n\n    if (EOBRUN == 0) {\n      for (; k <= Se; k++) {\n\tHUFF_DECODE(s, br_state, tbl, goto undoit, label3);\n\tr = s >> 4;\n\ts &= 15;\n\tif (s) {\n\t  if (s != 1)\t\t/* size of new coef should always be 1 */\n\t    WARNMS(cinfo, JWRN_HUFF_BAD_CODE);\n\t  CHECK_BIT_BUFFER(br_state, 1, goto undoit);\n\t  if (GET_BITS(1))\n\t    s = p1;\t\t/* newly nonzero coef is positive */\n\t  else\n\t    s = m1;\t\t/* newly nonzero coef is negative */\n\t} else {\n\t  if (r != 15) {\n\t    EOBRUN = 1 << r;\t/* EOBr, run length is 2^r + appended bits */\n\t    if (r) {\n\t      CHECK_BIT_BUFFER(br_state, r, goto undoit);\n\t      r = GET_BITS(r);\n\t      EOBRUN += r;\n\t    }\n\t    break;\t\t/* rest of block is handled by EOB logic */\n\t  }\n\t  /* note s = 0 for processing ZRL */\n\t}\n\t/* Advance over already-nonzero coefs and r still-zero coefs,\n\t * appending correction bits to the nonzeroes.  A correction bit is 1\n\t * if the absolute value of the coefficient must be increased.\n\t */\n\tdo {\n\t  thiscoef = *block + jpeg_natural_order[k];\n\t  if (*thiscoef != 0) {\n\t    CHECK_BIT_BUFFER(br_state, 1, goto undoit);\n\t    if (GET_BITS(1)) {\n\t      if ((*thiscoef & p1) == 0) { /* do nothing if already set it */\n\t\tif (*thiscoef >= 0)\n\t\t  *thiscoef += p1;\n\t\telse\n\t\t  *thiscoef += m1;\n\t      }\n\t    }\n\t  } else {\n\t    if (--r < 0)\n\t      break;\t\t/* reached target zero coefficient */\n\t  }\n\t  k++;\n\t} while (k <= Se);\n\tif (s) {\n\t  int pos = jpeg_natural_order[k];\n\t  /* Output newly nonzero coefficient */\n\t  (*block)[pos] = (JCOEF) s;\n\t  /* Remember its position in case we have to suspend */\n\t  newnz_pos[num_newnz++] = pos;\n\t}\n      }\n    }\n\n    if (EOBRUN > 0) {\n      /* Scan any remaining coefficient positions after the end-of-band\n       * (the last newly nonzero coefficient, if any).  Append a correction\n       * bit to each already-nonzero coefficient.  A correction bit is 1\n       * if the absolute value of the coefficient must be increased.\n       */\n      for (; k <= Se; k++) {\n\tthiscoef = *block + jpeg_natural_order[k];\n\tif (*thiscoef != 0) {\n\t  CHECK_BIT_BUFFER(br_state, 1, goto undoit);\n\t  if (GET_BITS(1)) {\n\t    if ((*thiscoef & p1) == 0) { /* do nothing if already changed it */\n\t      if (*thiscoef >= 0)\n\t\t*thiscoef += p1;\n\t      else\n\t\t*thiscoef += m1;\n\t    }\n\t  }\n\t}\n      }\n      /* Count one block completed in EOB run */\n      EOBRUN--;\n    }\n\n    /* Completed MCU, so update state */\n    BITREAD_SAVE_STATE(cinfo,entropy->bitstate);\n    entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */\n  }\n\n  /* Account for restart interval (no-op if not using restarts) */\n  entropy->restarts_to_go--;\n\n  return TRUE;\n\nundoit:\n  /* Re-zero any output coefficients that we made newly nonzero */\n  while (num_newnz > 0)\n    (*block)[newnz_pos[--num_newnz]] = 0;\n\n  return FALSE;\n}\n\n\n/*\n * Module initialization routine for progressive Huffman entropy decoding.\n */\n\nGLOBAL(void)\njinit_phuff_decoder (j_decompress_ptr cinfo)\n{\n  phuff_entropy_ptr entropy;\n  int *coef_bit_ptr;\n  int ci, i;\n\n  entropy = (phuff_entropy_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(phuff_entropy_decoder));\n  cinfo->entropy = (struct jpeg_entropy_decoder *) entropy;\n  entropy->pub.start_pass = start_pass_phuff_decoder;\n\n  /* Mark derived tables unallocated */\n  for (i = 0; i < NUM_HUFF_TBLS; i++) {\n    entropy->derived_tbls[i] = NULL;\n  }\n\n  /* Create progression status table */\n  cinfo->coef_bits = (int (*)[DCTSIZE2])\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tcinfo->num_components*DCTSIZE2*SIZEOF(int));\n  coef_bit_ptr = & cinfo->coef_bits[0][0];\n  for (ci = 0; ci < cinfo->num_components; ci++) \n    for (i = 0; i < DCTSIZE2; i++)\n      *coef_bit_ptr++ = -1;\n}\n\n#endif /* D_PROGRESSIVE_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdpostct.c",
    "content": "/*\n * jdpostct.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains the decompression postprocessing controller.\n * This controller manages the upsampling, color conversion, and color\n * quantization/reduction steps; specifically, it controls the buffering\n * between upsample/color conversion and color quantization/reduction.\n *\n * If no color quantization/reduction is required, then this module has no\n * work to do, and it just hands off to the upsample/color conversion code.\n * An integrated upsample/convert/quantize process would replace this module\n * entirely.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Private buffer controller object */\n\ntypedef struct {\n  struct jpeg_d_post_controller pub; /* public fields */\n\n  /* Color quantization source buffer: this holds output data from\n   * the upsample/color conversion step to be passed to the quantizer.\n   * For two-pass color quantization, we need a full-image buffer;\n   * for one-pass operation, a strip buffer is sufficient.\n   */\n  jvirt_sarray_ptr whole_image;\t/* virtual array, or NULL if one-pass */\n  JSAMPARRAY buffer;\t\t/* strip buffer, or current strip of virtual */\n  JDIMENSION strip_height;\t/* buffer size in rows */\n  /* for two-pass mode only: */\n  JDIMENSION starting_row;\t/* row # of first row in current strip */\n  JDIMENSION next_row;\t\t/* index of next row to fill/empty in strip */\n} my_post_controller;\n\ntypedef my_post_controller * my_post_ptr;\n\n\n/* Forward declarations */\nMETHODDEF(void) post_process_1pass\n\tJPP((j_decompress_ptr cinfo,\n\t     JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n\t     JDIMENSION in_row_groups_avail,\n\t     JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t     JDIMENSION out_rows_avail));\n#ifdef QUANT_2PASS_SUPPORTED\nMETHODDEF(void) post_process_prepass\n\tJPP((j_decompress_ptr cinfo,\n\t     JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n\t     JDIMENSION in_row_groups_avail,\n\t     JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t     JDIMENSION out_rows_avail));\nMETHODDEF(void) post_process_2pass\n\tJPP((j_decompress_ptr cinfo,\n\t     JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n\t     JDIMENSION in_row_groups_avail,\n\t     JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t     JDIMENSION out_rows_avail));\n#endif\n\n\n/*\n * Initialize for a processing pass.\n */\n\nMETHODDEF(void)\nstart_pass_dpost (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)\n{\n  my_post_ptr post = (my_post_ptr) cinfo->post;\n\n  switch (pass_mode) {\n  case JBUF_PASS_THRU:\n    if (cinfo->quantize_colors) {\n      /* Single-pass processing with color quantization. */\n      post->pub.post_process_data = post_process_1pass;\n      /* We could be doing buffered-image output before starting a 2-pass\n       * color quantization; in that case, jinit_d_post_controller did not\n       * allocate a strip buffer.  Use the virtual-array buffer as workspace.\n       */\n      if (post->buffer == NULL) {\n\tpost->buffer = (*cinfo->mem->access_virt_sarray)\n\t  ((j_common_ptr) cinfo, post->whole_image,\n\t   (JDIMENSION) 0, post->strip_height, TRUE);\n      }\n    } else {\n      /* For single-pass processing without color quantization,\n       * I have no work to do; just call the upsampler directly.\n       */\n      post->pub.post_process_data = cinfo->upsample->upsample;\n    }\n    break;\n#ifdef QUANT_2PASS_SUPPORTED\n  case JBUF_SAVE_AND_PASS:\n    /* First pass of 2-pass quantization */\n    if (post->whole_image == NULL)\n      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    post->pub.post_process_data = post_process_prepass;\n    break;\n  case JBUF_CRANK_DEST:\n    /* Second pass of 2-pass quantization */\n    if (post->whole_image == NULL)\n      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    post->pub.post_process_data = post_process_2pass;\n    break;\n#endif /* QUANT_2PASS_SUPPORTED */\n  default:\n    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n    break;\n  }\n  post->starting_row = post->next_row = 0;\n}\n\n\n/*\n * Process some data in the one-pass (strip buffer) case.\n * This is used for color precision reduction as well as one-pass quantization.\n */\n\nMETHODDEF(void)\npost_process_1pass (j_decompress_ptr cinfo,\n\t\t    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n\t\t    JDIMENSION in_row_groups_avail,\n\t\t    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t\t    JDIMENSION out_rows_avail)\n{\n  my_post_ptr post = (my_post_ptr) cinfo->post;\n  JDIMENSION num_rows, max_rows;\n\n  /* Fill the buffer, but not more than what we can dump out in one go. */\n  /* Note we rely on the upsampler to detect bottom of image. */\n  max_rows = out_rows_avail - *out_row_ctr;\n  if (max_rows > post->strip_height)\n    max_rows = post->strip_height;\n  num_rows = 0;\n  (*cinfo->upsample->upsample) (cinfo,\n\t\tinput_buf, in_row_group_ctr, in_row_groups_avail,\n\t\tpost->buffer, &num_rows, max_rows);\n  /* Quantize and emit data. */\n  (*cinfo->cquantize->color_quantize) (cinfo,\n\t\tpost->buffer, output_buf + *out_row_ctr, (int) num_rows);\n  *out_row_ctr += num_rows;\n}\n\n\n#ifdef QUANT_2PASS_SUPPORTED\n\n/*\n * Process some data in the first pass of 2-pass quantization.\n */\n\nMETHODDEF(void)\npost_process_prepass (j_decompress_ptr cinfo,\n\t\t      JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n\t\t      JDIMENSION in_row_groups_avail,\n\t\t      JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t\t      JDIMENSION out_rows_avail)\n{\n  my_post_ptr post = (my_post_ptr) cinfo->post;\n  JDIMENSION old_next_row, num_rows;\n\n  /* Reposition virtual buffer if at start of strip. */\n  if (post->next_row == 0) {\n    post->buffer = (*cinfo->mem->access_virt_sarray)\n\t((j_common_ptr) cinfo, post->whole_image,\n\t post->starting_row, post->strip_height, TRUE);\n  }\n\n  /* Upsample some data (up to a strip height's worth). */\n  old_next_row = post->next_row;\n  (*cinfo->upsample->upsample) (cinfo,\n\t\tinput_buf, in_row_group_ctr, in_row_groups_avail,\n\t\tpost->buffer, &post->next_row, post->strip_height);\n\n  /* Allow quantizer to scan new data.  No data is emitted, */\n  /* but we advance out_row_ctr so outer loop can tell when we're done. */\n  if (post->next_row > old_next_row) {\n    num_rows = post->next_row - old_next_row;\n    (*cinfo->cquantize->color_quantize) (cinfo, post->buffer + old_next_row,\n\t\t\t\t\t (JSAMPARRAY) NULL, (int) num_rows);\n    *out_row_ctr += num_rows;\n  }\n\n  /* Advance if we filled the strip. */\n  if (post->next_row >= post->strip_height) {\n    post->starting_row += post->strip_height;\n    post->next_row = 0;\n  }\n}\n\n\n/*\n * Process some data in the second pass of 2-pass quantization.\n */\n\nMETHODDEF(void)\npost_process_2pass (j_decompress_ptr cinfo,\n\t\t    JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n\t\t    JDIMENSION in_row_groups_avail,\n\t\t    JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t\t    JDIMENSION out_rows_avail)\n{\n  my_post_ptr post = (my_post_ptr) cinfo->post;\n  JDIMENSION num_rows, max_rows;\n\n  /* Reposition virtual buffer if at start of strip. */\n  if (post->next_row == 0) {\n    post->buffer = (*cinfo->mem->access_virt_sarray)\n\t((j_common_ptr) cinfo, post->whole_image,\n\t post->starting_row, post->strip_height, FALSE);\n  }\n\n  /* Determine number of rows to emit. */\n  num_rows = post->strip_height - post->next_row; /* available in strip */\n  max_rows = out_rows_avail - *out_row_ctr; /* available in output area */\n  if (num_rows > max_rows)\n    num_rows = max_rows;\n  /* We have to check bottom of image here, can't depend on upsampler. */\n  max_rows = cinfo->output_height - post->starting_row;\n  if (num_rows > max_rows)\n    num_rows = max_rows;\n\n  /* Quantize and emit data. */\n  (*cinfo->cquantize->color_quantize) (cinfo,\n\t\tpost->buffer + post->next_row, output_buf + *out_row_ctr,\n\t\t(int) num_rows);\n  *out_row_ctr += num_rows;\n\n  /* Advance if we filled the strip. */\n  post->next_row += num_rows;\n  if (post->next_row >= post->strip_height) {\n    post->starting_row += post->strip_height;\n    post->next_row = 0;\n  }\n}\n\n#endif /* QUANT_2PASS_SUPPORTED */\n\n\n/*\n * Initialize postprocessing controller.\n */\n\nGLOBAL(void)\njinit_d_post_controller (j_decompress_ptr cinfo, boolean need_full_buffer)\n{\n  my_post_ptr post;\n\n  post = (my_post_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_post_controller));\n  cinfo->post = (struct jpeg_d_post_controller *) post;\n  post->pub.start_pass = start_pass_dpost;\n  post->whole_image = NULL;\t/* flag for no virtual arrays */\n  post->buffer = NULL;\t\t/* flag for no strip buffer */\n\n  /* Create the quantization buffer, if needed */\n  if (cinfo->quantize_colors) {\n    /* The buffer strip height is max_v_samp_factor, which is typically\n     * an efficient number of rows for upsampling to return.\n     * (In the presence of output rescaling, we might want to be smarter?)\n     */\n    post->strip_height = (JDIMENSION) cinfo->max_v_samp_factor;\n    if (need_full_buffer) {\n      /* Two-pass color quantization: need full-image storage. */\n      /* We round up the number of rows to a multiple of the strip height. */\n#ifdef QUANT_2PASS_SUPPORTED\n      post->whole_image = (*cinfo->mem->request_virt_sarray)\n\t((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n\t cinfo->output_width * cinfo->out_color_components,\n\t (JDIMENSION) jround_up((long) cinfo->output_height,\n\t\t\t\t(long) post->strip_height),\n\t post->strip_height);\n#else\n      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);\n#endif /* QUANT_2PASS_SUPPORTED */\n    } else {\n      /* One-pass color quantization: just make a strip buffer. */\n      post->buffer = (*cinfo->mem->alloc_sarray)\n\t((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t cinfo->output_width * cinfo->out_color_components,\n\t post->strip_height);\n    }\n  }\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdsample.c",
    "content": "/*\n * jdsample.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright (C) 2010, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains upsampling routines.\n *\n * Upsampling input data is counted in \"row groups\".  A row group\n * is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size)\n * sample rows of each component.  Upsampling will normally produce\n * max_v_samp_factor pixel rows from each row group (but this could vary\n * if the upsampler is applying a scale factor of its own).\n *\n * An excellent reference for image resampling is\n *   Digital Image Warping, George Wolberg, 1990.\n *   Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jsimd.h\"\n#include \"jpegcomp.h\"\n\n\n/* Pointer to routine to upsample a single component */\ntypedef JMETHOD(void, upsample1_ptr,\n\t\t(j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));\n\n/* Private subobject */\n\ntypedef struct {\n  struct jpeg_upsampler pub;\t/* public fields */\n\n  /* Color conversion buffer.  When using separate upsampling and color\n   * conversion steps, this buffer holds one upsampled row group until it\n   * has been color converted and output.\n   * Note: we do not allocate any storage for component(s) which are full-size,\n   * ie do not need rescaling.  The corresponding entry of color_buf[] is\n   * simply set to point to the input data array, thereby avoiding copying.\n   */\n  JSAMPARRAY color_buf[MAX_COMPONENTS];\n\n  /* Per-component upsampling method pointers */\n  upsample1_ptr methods[MAX_COMPONENTS];\n\n  int next_row_out;\t\t/* counts rows emitted from color_buf */\n  JDIMENSION rows_to_go;\t/* counts rows remaining in image */\n\n  /* Height of an input row group for each component. */\n  int rowgroup_height[MAX_COMPONENTS];\n\n  /* These arrays save pixel expansion factors so that int_expand need not\n   * recompute them each time.  They are unused for other upsampling methods.\n   */\n  UINT8 h_expand[MAX_COMPONENTS];\n  UINT8 v_expand[MAX_COMPONENTS];\n} my_upsampler;\n\ntypedef my_upsampler * my_upsample_ptr;\n\n\n/*\n * Initialize for an upsampling pass.\n */\n\nMETHODDEF(void)\nstart_pass_upsample (j_decompress_ptr cinfo)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n\n  /* Mark the conversion buffer empty */\n  upsample->next_row_out = cinfo->max_v_samp_factor;\n  /* Initialize total-height counter for detecting bottom of image */\n  upsample->rows_to_go = cinfo->output_height;\n}\n\n\n/*\n * Control routine to do upsampling (and color conversion).\n *\n * In this version we upsample each component independently.\n * We upsample one row group into the conversion buffer, then apply\n * color conversion a row at a time.\n */\n\nMETHODDEF(void)\nsep_upsample (j_decompress_ptr cinfo,\n\t      JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr,\n\t      JDIMENSION in_row_groups_avail,\n\t      JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t      JDIMENSION out_rows_avail)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  int ci;\n  jpeg_component_info * compptr;\n  JDIMENSION num_rows;\n\n  /* Fill the conversion buffer, if it's empty */\n  if (upsample->next_row_out >= cinfo->max_v_samp_factor) {\n    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n\t ci++, compptr++) {\n      /* Invoke per-component upsample method.  Notice we pass a POINTER\n       * to color_buf[ci], so that fullsize_upsample can change it.\n       */\n      (*upsample->methods[ci]) (cinfo, compptr,\n\tinput_buf[ci] + (*in_row_group_ctr * upsample->rowgroup_height[ci]),\n\tupsample->color_buf + ci);\n    }\n    upsample->next_row_out = 0;\n  }\n\n  /* Color-convert and emit rows */\n\n  /* How many we have in the buffer: */\n  num_rows = (JDIMENSION) (cinfo->max_v_samp_factor - upsample->next_row_out);\n  /* Not more than the distance to the end of the image.  Need this test\n   * in case the image height is not a multiple of max_v_samp_factor:\n   */\n  if (num_rows > upsample->rows_to_go) \n    num_rows = upsample->rows_to_go;\n  /* And not more than what the client can accept: */\n  out_rows_avail -= *out_row_ctr;\n  if (num_rows > out_rows_avail)\n    num_rows = out_rows_avail;\n\n  (*cinfo->cconvert->color_convert) (cinfo, upsample->color_buf,\n\t\t\t\t     (JDIMENSION) upsample->next_row_out,\n\t\t\t\t     output_buf + *out_row_ctr,\n\t\t\t\t     (int) num_rows);\n\n  /* Adjust counts */\n  *out_row_ctr += num_rows;\n  upsample->rows_to_go -= num_rows;\n  upsample->next_row_out += num_rows;\n  /* When the buffer is emptied, declare this input row group consumed */\n  if (upsample->next_row_out >= cinfo->max_v_samp_factor)\n    (*in_row_group_ctr)++;\n}\n\n\n/*\n * These are the routines invoked by sep_upsample to upsample pixel values\n * of a single component.  One row group is processed per call.\n */\n\n\n/*\n * For full-size components, we just make color_buf[ci] point at the\n * input buffer, and thus avoid copying any data.  Note that this is\n * safe only because sep_upsample doesn't declare the input row group\n * \"consumed\" until we are done color converting and emitting it.\n */\n\nMETHODDEF(void)\nfullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t   JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)\n{\n  *output_data_ptr = input_data;\n}\n\n\n/*\n * This is a no-op version used for \"uninteresting\" components.\n * These components will not be referenced by color conversion.\n */\n\nMETHODDEF(void)\nnoop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)\n{\n  *output_data_ptr = NULL;\t/* safety check */\n}\n\n\n/*\n * This version handles any integral sampling ratios.\n * This is not used for typical JPEG files, so it need not be fast.\n * Nor, for that matter, is it particularly accurate: the algorithm is\n * simple replication of the input pixel onto the corresponding output\n * pixels.  The hi-falutin sampling literature refers to this as a\n * \"box filter\".  A box filter tends to introduce visible artifacts,\n * so if you are actually going to use 3:1 or 4:1 sampling ratios\n * you would be well advised to improve this code.\n */\n\nMETHODDEF(void)\nint_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t      JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)\n{\n  my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;\n  JSAMPARRAY output_data = *output_data_ptr;\n  register JSAMPROW inptr, outptr;\n  register JSAMPLE invalue;\n  register int h;\n  JSAMPROW outend;\n  int h_expand, v_expand;\n  int inrow, outrow;\n\n  h_expand = upsample->h_expand[compptr->component_index];\n  v_expand = upsample->v_expand[compptr->component_index];\n\n  inrow = outrow = 0;\n  while (outrow < cinfo->max_v_samp_factor) {\n    /* Generate one output row with proper horizontal expansion */\n    inptr = input_data[inrow];\n    outptr = output_data[outrow];\n    outend = outptr + cinfo->output_width;\n    while (outptr < outend) {\n      invalue = *inptr++;\t/* don't need GETJSAMPLE() here */\n      for (h = h_expand; h > 0; h--) {\n\t*outptr++ = invalue;\n      }\n    }\n    /* Generate any additional output rows by duplicating the first one */\n    if (v_expand > 1) {\n      jcopy_sample_rows(output_data, outrow, output_data, outrow+1,\n\t\t\tv_expand-1, cinfo->output_width);\n    }\n    inrow++;\n    outrow += v_expand;\n  }\n}\n\n\n/*\n * Fast processing for the common case of 2:1 horizontal and 1:1 vertical.\n * It's still a box filter.\n */\n\nMETHODDEF(void)\nh2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)\n{\n  JSAMPARRAY output_data = *output_data_ptr;\n  register JSAMPROW inptr, outptr;\n  register JSAMPLE invalue;\n  JSAMPROW outend;\n  int inrow;\n\n  for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {\n    inptr = input_data[inrow];\n    outptr = output_data[inrow];\n    outend = outptr + cinfo->output_width;\n    while (outptr < outend) {\n      invalue = *inptr++;\t/* don't need GETJSAMPLE() here */\n      *outptr++ = invalue;\n      *outptr++ = invalue;\n    }\n  }\n}\n\n\n/*\n * Fast processing for the common case of 2:1 horizontal and 2:1 vertical.\n * It's still a box filter.\n */\n\nMETHODDEF(void)\nh2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)\n{\n  JSAMPARRAY output_data = *output_data_ptr;\n  register JSAMPROW inptr, outptr;\n  register JSAMPLE invalue;\n  JSAMPROW outend;\n  int inrow, outrow;\n\n  inrow = outrow = 0;\n  while (outrow < cinfo->max_v_samp_factor) {\n    inptr = input_data[inrow];\n    outptr = output_data[outrow];\n    outend = outptr + cinfo->output_width;\n    while (outptr < outend) {\n      invalue = *inptr++;\t/* don't need GETJSAMPLE() here */\n      *outptr++ = invalue;\n      *outptr++ = invalue;\n    }\n    jcopy_sample_rows(output_data, outrow, output_data, outrow+1,\n\t\t      1, cinfo->output_width);\n    inrow++;\n    outrow += 2;\n  }\n}\n\n\n/*\n * Fancy processing for the common case of 2:1 horizontal and 1:1 vertical.\n *\n * The upsampling algorithm is linear interpolation between pixel centers,\n * also known as a \"triangle filter\".  This is a good compromise between\n * speed and visual quality.  The centers of the output pixels are 1/4 and 3/4\n * of the way between input pixel centers.\n *\n * A note about the \"bias\" calculations: when rounding fractional values to\n * integer, we do not want to always round 0.5 up to the next integer.\n * If we did that, we'd introduce a noticeable bias towards larger values.\n * Instead, this code is arranged so that 0.5 will be rounded up or down at\n * alternate pixel locations (a simple ordered dither pattern).\n */\n\nMETHODDEF(void)\nh2v1_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t     JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)\n{\n  JSAMPARRAY output_data = *output_data_ptr;\n  register JSAMPROW inptr, outptr;\n  register int invalue;\n  register JDIMENSION colctr;\n  int inrow;\n\n  for (inrow = 0; inrow < cinfo->max_v_samp_factor; inrow++) {\n    inptr = input_data[inrow];\n    outptr = output_data[inrow];\n    /* Special case for first column */\n    invalue = GETJSAMPLE(*inptr++);\n    *outptr++ = (JSAMPLE) invalue;\n    *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(*inptr) + 2) >> 2);\n\n    for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) {\n      /* General case: 3/4 * nearer pixel + 1/4 * further pixel */\n      invalue = GETJSAMPLE(*inptr++) * 3;\n      *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(inptr[-2]) + 1) >> 2);\n      *outptr++ = (JSAMPLE) ((invalue + GETJSAMPLE(*inptr) + 2) >> 2);\n    }\n\n    /* Special case for last column */\n    invalue = GETJSAMPLE(*inptr);\n    *outptr++ = (JSAMPLE) ((invalue * 3 + GETJSAMPLE(inptr[-1]) + 1) >> 2);\n    *outptr++ = (JSAMPLE) invalue;\n  }\n}\n\n\n/*\n * Fancy processing for the common case of 2:1 horizontal and 2:1 vertical.\n * Again a triangle filter; see comments for h2v1 case, above.\n *\n * It is OK for us to reference the adjacent input rows because we demanded\n * context from the main buffer controller (see initialization code).\n */\n\nMETHODDEF(void)\nh2v2_fancy_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t     JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)\n{\n  JSAMPARRAY output_data = *output_data_ptr;\n  register JSAMPROW inptr0, inptr1, outptr;\n#if BITS_IN_JSAMPLE == 8\n  register int thiscolsum, lastcolsum, nextcolsum;\n#else\n  register INT32 thiscolsum, lastcolsum, nextcolsum;\n#endif\n  register JDIMENSION colctr;\n  int inrow, outrow, v;\n\n  inrow = outrow = 0;\n  while (outrow < cinfo->max_v_samp_factor) {\n    for (v = 0; v < 2; v++) {\n      /* inptr0 points to nearest input row, inptr1 points to next nearest */\n      inptr0 = input_data[inrow];\n      if (v == 0)\t\t/* next nearest is row above */\n\tinptr1 = input_data[inrow-1];\n      else\t\t\t/* next nearest is row below */\n\tinptr1 = input_data[inrow+1];\n      outptr = output_data[outrow++];\n\n      /* Special case for first column */\n      thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);\n      nextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);\n      *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 8) >> 4);\n      *outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4);\n      lastcolsum = thiscolsum; thiscolsum = nextcolsum;\n\n      for (colctr = compptr->downsampled_width - 2; colctr > 0; colctr--) {\n\t/* General case: 3/4 * nearer pixel + 1/4 * further pixel in each */\n\t/* dimension, thus 9/16, 3/16, 3/16, 1/16 overall */\n\tnextcolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);\n\t*outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4);\n\t*outptr++ = (JSAMPLE) ((thiscolsum * 3 + nextcolsum + 7) >> 4);\n\tlastcolsum = thiscolsum; thiscolsum = nextcolsum;\n      }\n\n      /* Special case for last column */\n      *outptr++ = (JSAMPLE) ((thiscolsum * 3 + lastcolsum + 8) >> 4);\n      *outptr++ = (JSAMPLE) ((thiscolsum * 4 + 7) >> 4);\n    }\n    inrow++;\n  }\n}\n\n\n/*\n * Module initialization routine for upsampling.\n */\n\nGLOBAL(void)\njinit_upsampler (j_decompress_ptr cinfo)\n{\n  my_upsample_ptr upsample;\n  int ci;\n  jpeg_component_info * compptr;\n  boolean need_buffer, do_fancy;\n  int h_in_group, v_in_group, h_out_group, v_out_group;\n\n  upsample = (my_upsample_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_upsampler));\n  cinfo->upsample = (struct jpeg_upsampler *) upsample;\n  upsample->pub.start_pass = start_pass_upsample;\n  upsample->pub.upsample = sep_upsample;\n  upsample->pub.need_context_rows = FALSE; /* until we find out differently */\n\n  if (cinfo->CCIR601_sampling)\t/* this isn't supported */\n    ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);\n\n  /* jdmainct.c doesn't support context rows when min_DCT_scaled_size = 1,\n   * so don't ask for it.\n   */\n  do_fancy = cinfo->do_fancy_upsampling && cinfo->_min_DCT_scaled_size > 1;\n\n  /* Verify we can handle the sampling factors, select per-component methods,\n   * and create storage as needed.\n   */\n  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;\n       ci++, compptr++) {\n    /* Compute size of an \"input group\" after IDCT scaling.  This many samples\n     * are to be converted to max_h_samp_factor * max_v_samp_factor pixels.\n     */\n    h_in_group = (compptr->h_samp_factor * compptr->_DCT_scaled_size) /\n\t\t cinfo->_min_DCT_scaled_size;\n    v_in_group = (compptr->v_samp_factor * compptr->_DCT_scaled_size) /\n\t\t cinfo->_min_DCT_scaled_size;\n    h_out_group = cinfo->max_h_samp_factor;\n    v_out_group = cinfo->max_v_samp_factor;\n    upsample->rowgroup_height[ci] = v_in_group; /* save for use later */\n    need_buffer = TRUE;\n    if (! compptr->component_needed) {\n      /* Don't bother to upsample an uninteresting component. */\n      upsample->methods[ci] = noop_upsample;\n      need_buffer = FALSE;\n    } else if (h_in_group == h_out_group && v_in_group == v_out_group) {\n      /* Fullsize components can be processed without any work. */\n      upsample->methods[ci] = fullsize_upsample;\n      need_buffer = FALSE;\n    } else if (h_in_group * 2 == h_out_group &&\n\t       v_in_group == v_out_group) {\n      /* Special cases for 2h1v upsampling */\n      if (do_fancy && compptr->downsampled_width > 2) {\n\tif (jsimd_can_h2v1_fancy_upsample())\n\t  upsample->methods[ci] = jsimd_h2v1_fancy_upsample;\n\telse\n\t  upsample->methods[ci] = h2v1_fancy_upsample;\n      } else {\n\tif (jsimd_can_h2v1_upsample())\n\t  upsample->methods[ci] = jsimd_h2v1_upsample;\n\telse\n\t  upsample->methods[ci] = h2v1_upsample;\n      }\n    } else if (h_in_group * 2 == h_out_group &&\n\t       v_in_group * 2 == v_out_group) {\n      /* Special cases for 2h2v upsampling */\n      if (do_fancy && compptr->downsampled_width > 2) {\n\tif (jsimd_can_h2v2_fancy_upsample())\n\t  upsample->methods[ci] = jsimd_h2v2_fancy_upsample;\n\telse\n\t  upsample->methods[ci] = h2v2_fancy_upsample;\n\tupsample->pub.need_context_rows = TRUE;\n      } else {\n\tif (jsimd_can_h2v2_upsample())\n\t  upsample->methods[ci] = jsimd_h2v2_upsample;\n\telse\n\t  upsample->methods[ci] = h2v2_upsample;\n      }\n    } else if ((h_out_group % h_in_group) == 0 &&\n\t       (v_out_group % v_in_group) == 0) {\n      /* Generic integral-factors upsampling method */\n      upsample->methods[ci] = int_upsample;\n      upsample->h_expand[ci] = (UINT8) (h_out_group / h_in_group);\n      upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group);\n    } else\n      ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);\n    if (need_buffer) {\n      upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray)\n\t((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t (JDIMENSION) jround_up((long) cinfo->output_width,\n\t\t\t\t(long) cinfo->max_h_samp_factor),\n\t (JDIMENSION) cinfo->max_v_samp_factor);\n    }\n  }\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jdtrans.c",
    "content": "/*\n * jdtrans.c\n *\n * Copyright (C) 1995-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains library routines for transcoding decompression,\n * that is, reading raw DCT coefficient arrays from an input JPEG file.\n * The routines in jdapimin.c will also be needed by a transcoder.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/* Forward declarations */\nLOCAL(void) transdecode_master_selection JPP((j_decompress_ptr cinfo));\n\n\n/*\n * Read the coefficient arrays from a JPEG file.\n * jpeg_read_header must be completed before calling this.\n *\n * The entire image is read into a set of virtual coefficient-block arrays,\n * one per component.  The return value is a pointer to the array of\n * virtual-array descriptors.  These can be manipulated directly via the\n * JPEG memory manager, or handed off to jpeg_write_coefficients().\n * To release the memory occupied by the virtual arrays, call\n * jpeg_finish_decompress() when done with the data.\n *\n * An alternative usage is to simply obtain access to the coefficient arrays\n * during a buffered-image-mode decompression operation.  This is allowed\n * after any jpeg_finish_output() call.  The arrays can be accessed until\n * jpeg_finish_decompress() is called.  (Note that any call to the library\n * may reposition the arrays, so don't rely on access_virt_barray() results\n * to stay valid across library calls.)\n *\n * Returns NULL if suspended.  This case need be checked only if\n * a suspending data source is used.\n */\n\nGLOBAL(jvirt_barray_ptr *)\njpeg_read_coefficients (j_decompress_ptr cinfo)\n{\n  if (cinfo->global_state == DSTATE_READY) {\n    /* First call: initialize active modules */\n    transdecode_master_selection(cinfo);\n    cinfo->global_state = DSTATE_RDCOEFS;\n  }\n  if (cinfo->global_state == DSTATE_RDCOEFS) {\n    /* Absorb whole file into the coef buffer */\n    for (;;) {\n      int retcode;\n      /* Call progress monitor hook if present */\n      if (cinfo->progress != NULL)\n\t(*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo);\n      /* Absorb some more input */\n      retcode = (*cinfo->inputctl->consume_input) (cinfo);\n      if (retcode == JPEG_SUSPENDED)\n\treturn NULL;\n      if (retcode == JPEG_REACHED_EOI)\n\tbreak;\n      /* Advance progress counter if appropriate */\n      if (cinfo->progress != NULL &&\n\t  (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {\n\tif (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {\n\t  /* startup underestimated number of scans; ratchet up one scan */\n\t  cinfo->progress->pass_limit += (long) cinfo->total_iMCU_rows;\n\t}\n      }\n    }\n    /* Set state so that jpeg_finish_decompress does the right thing */\n    cinfo->global_state = DSTATE_STOPPING;\n  }\n  /* At this point we should be in state DSTATE_STOPPING if being used\n   * standalone, or in state DSTATE_BUFIMAGE if being invoked to get access\n   * to the coefficients during a full buffered-image-mode decompression.\n   */\n  if ((cinfo->global_state == DSTATE_STOPPING ||\n       cinfo->global_state == DSTATE_BUFIMAGE) && cinfo->buffered_image) {\n    return cinfo->coef->coef_arrays;\n  }\n  /* Oops, improper usage */\n  ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);\n  return NULL;\t\t\t/* keep compiler happy */\n}\n\n\n/*\n * Master selection of decompression modules for transcoding.\n * This substitutes for jdmaster.c's initialization of the full decompressor.\n */\n\nLOCAL(void)\ntransdecode_master_selection (j_decompress_ptr cinfo)\n{\n  /* This is effectively a buffered-image operation. */\n  cinfo->buffered_image = TRUE;\n\n#if JPEG_LIB_VERSION >= 80\n  /* Compute output image dimensions and related values. */\n  jpeg_core_output_dimensions(cinfo);\n#endif\n\n  /* Entropy decoding: either Huffman or arithmetic coding. */\n  if (cinfo->arith_code) {\n#ifdef D_ARITH_CODING_SUPPORTED\n    jinit_arith_decoder(cinfo);\n#else\n    ERREXIT(cinfo, JERR_ARITH_NOTIMPL);\n#endif\n  } else {\n    if (cinfo->progressive_mode) {\n#ifdef D_PROGRESSIVE_SUPPORTED\n      jinit_phuff_decoder(cinfo);\n#else\n      ERREXIT(cinfo, JERR_NOT_COMPILED);\n#endif\n    } else\n      jinit_huff_decoder(cinfo);\n  }\n\n  /* Always get a full-image coefficient buffer. */\n  jinit_d_coef_controller(cinfo, TRUE);\n\n  /* We can now tell the memory manager to allocate virtual arrays. */\n  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);\n\n  /* Initialize input side of decompressor to consume first scan. */\n  (*cinfo->inputctl->start_input_pass) (cinfo);\n\n  /* Initialize progress monitoring. */\n  if (cinfo->progress != NULL) {\n    int nscans;\n    /* Estimate number of scans to set pass_limit. */\n    if (cinfo->progressive_mode) {\n      /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */\n      nscans = 2 + 3 * cinfo->num_components;\n    } else if (cinfo->inputctl->has_multiple_scans) {\n      /* For a nonprogressive multiscan file, estimate 1 scan per component. */\n      nscans = cinfo->num_components;\n    } else {\n      nscans = 1;\n    }\n    cinfo->progress->pass_counter = 0L;\n    cinfo->progress->pass_limit = (long) cinfo->total_iMCU_rows * nscans;\n    cinfo->progress->completed_passes = 0;\n    cinfo->progress->total_passes = 1;\n  }\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jerror.c",
    "content": "/*\n * jerror.c\n *\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains simple error-reporting and trace-message routines.\n * These are suitable for Unix-like systems and others where writing to\n * stderr is the right thing to do.  Many applications will want to replace\n * some or all of these routines.\n *\n * If you define USE_WINDOWS_MESSAGEBOX in jconfig.h or in the makefile,\n * you get a Windows-specific hack to display error messages in a dialog box.\n * It ain't much, but it beats dropping error messages into the bit bucket,\n * which is what happens to output to stderr under most Windows C compilers.\n *\n * These routines are used by both the compression and decompression code.\n */\n\n/* this is not a core library module, so it doesn't define JPEG_INTERNALS */\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jversion.h\"\n#include \"jerror.h\"\n\n#ifdef USE_WINDOWS_MESSAGEBOX\n#include <windows.h>\n#endif\n\n#ifndef EXIT_FAILURE\t\t/* define exit() codes if not provided */\n#define EXIT_FAILURE  1\n#endif\n\n\n/*\n * Create the message string table.\n * We do this from the master message list in jerror.h by re-reading\n * jerror.h with a suitable definition for macro JMESSAGE.\n * The message table is made an external symbol just in case any applications\n * want to refer to it directly.\n */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jpeg_std_message_table\tjMsgTable\n#endif\n\n#define JMESSAGE(code,string)\tstring ,\n\nconst char * const jpeg_std_message_table[] = {\n#include \"jerror.h\"\n  NULL\n};\n\n\n/*\n * Error exit handler: must not return to caller.\n *\n * Applications may override this if they want to get control back after\n * an error.  Typically one would longjmp somewhere instead of exiting.\n * The setjmp buffer can be made a private field within an expanded error\n * handler object.  Note that the info needed to generate an error message\n * is stored in the error object, so you can generate the message now or\n * later, at your convenience.\n * You should make sure that the JPEG object is cleaned up (with jpeg_abort\n * or jpeg_destroy) at some point.\n */\n\nMETHODDEF(void)\nerror_exit (j_common_ptr cinfo)\n{\n  /* Always display the message */\n  (*cinfo->err->output_message) (cinfo);\n\n  /* Let the memory manager delete any temp files before we die */\n  jpeg_destroy(cinfo);\n\n  exit(EXIT_FAILURE);\n}\n\n\n/*\n * Actual output of an error or trace message.\n * Applications may override this method to send JPEG messages somewhere\n * other than stderr.\n *\n * On Windows, printing to stderr is generally completely useless,\n * so we provide optional code to produce an error-dialog popup.\n * Most Windows applications will still prefer to override this routine,\n * but if they don't, it'll do something at least marginally useful.\n *\n * NOTE: to use the library in an environment that doesn't support the\n * C stdio library, you may have to delete the call to fprintf() entirely,\n * not just not use this routine.\n */\n\nMETHODDEF(void)\noutput_message (j_common_ptr cinfo)\n{\n  char buffer[JMSG_LENGTH_MAX];\n\n  /* Create the message */\n  (*cinfo->err->format_message) (cinfo, buffer);\n\n#ifdef USE_WINDOWS_MESSAGEBOX\n  /* Display it in a message dialog box */\n  MessageBox(GetActiveWindow(), buffer, \"JPEG Library Error\",\n\t     MB_OK | MB_ICONERROR);\n#else\n  /* Send it to stderr, adding a newline */\n  fprintf(stderr, \"%s\\n\", buffer);\n#endif\n}\n\n\n/*\n * Decide whether to emit a trace or warning message.\n * msg_level is one of:\n *   -1: recoverable corrupt-data warning, may want to abort.\n *    0: important advisory messages (always display to user).\n *    1: first level of tracing detail.\n *    2,3,...: successively more detailed tracing messages.\n * An application might override this method if it wanted to abort on warnings\n * or change the policy about which messages to display.\n */\n\nMETHODDEF(void)\nemit_message (j_common_ptr cinfo, int msg_level)\n{\n  struct jpeg_error_mgr * err = cinfo->err;\n\n  if (msg_level < 0) {\n    /* It's a warning message.  Since corrupt files may generate many warnings,\n     * the policy implemented here is to show only the first warning,\n     * unless trace_level >= 3.\n     */\n    if (err->num_warnings == 0 || err->trace_level >= 3)\n      (*err->output_message) (cinfo);\n    /* Always count warnings in num_warnings. */\n    err->num_warnings++;\n  } else {\n    /* It's a trace message.  Show it if trace_level >= msg_level. */\n    if (err->trace_level >= msg_level)\n      (*err->output_message) (cinfo);\n  }\n}\n\n\n/*\n * Format a message string for the most recent JPEG error or message.\n * The message is stored into buffer, which should be at least JMSG_LENGTH_MAX\n * characters.  Note that no '\\n' character is added to the string.\n * Few applications should need to override this method.\n */\n\nMETHODDEF(void)\nformat_message (j_common_ptr cinfo, char * buffer)\n{\n  struct jpeg_error_mgr * err = cinfo->err;\n  int msg_code = err->msg_code;\n  const char * msgtext = NULL;\n  const char * msgptr;\n  char ch;\n  boolean isstring;\n\n  /* Look up message string in proper table */\n  if (msg_code > 0 && msg_code <= err->last_jpeg_message) {\n    msgtext = err->jpeg_message_table[msg_code];\n  } else if (err->addon_message_table != NULL &&\n\t     msg_code >= err->first_addon_message &&\n\t     msg_code <= err->last_addon_message) {\n    msgtext = err->addon_message_table[msg_code - err->first_addon_message];\n  }\n\n  /* Defend against bogus message number */\n  if (msgtext == NULL) {\n    err->msg_parm.i[0] = msg_code;\n    msgtext = err->jpeg_message_table[0];\n  }\n\n  /* Check for string parameter, as indicated by %s in the message text */\n  isstring = FALSE;\n  msgptr = msgtext;\n  while ((ch = *msgptr++) != '\\0') {\n    if (ch == '%') {\n      if (*msgptr == 's') isstring = TRUE;\n      break;\n    }\n  }\n\n  /* Format the message into the passed buffer */\n  if (isstring)\n    sprintf(buffer, msgtext, err->msg_parm.s);\n  else\n    sprintf(buffer, msgtext,\n\t    err->msg_parm.i[0], err->msg_parm.i[1],\n\t    err->msg_parm.i[2], err->msg_parm.i[3],\n\t    err->msg_parm.i[4], err->msg_parm.i[5],\n\t    err->msg_parm.i[6], err->msg_parm.i[7]);\n}\n\n\n/*\n * Reset error state variables at start of a new image.\n * This is called during compression startup to reset trace/error\n * processing to default state, without losing any application-specific\n * method pointers.  An application might possibly want to override\n * this method if it has additional error processing state.\n */\n\nMETHODDEF(void)\nreset_error_mgr (j_common_ptr cinfo)\n{\n  cinfo->err->num_warnings = 0;\n  /* trace_level is not reset since it is an application-supplied parameter */\n  cinfo->err->msg_code = 0;\t/* may be useful as a flag for \"no error\" */\n}\n\n\n/*\n * Fill in the standard error-handling methods in a jpeg_error_mgr object.\n * Typical call is:\n *\tstruct jpeg_compress_struct cinfo;\n *\tstruct jpeg_error_mgr err;\n *\n *\tcinfo.err = jpeg_std_error(&err);\n * after which the application may override some of the methods.\n */\n\nGLOBAL(struct jpeg_error_mgr *)\njpeg_std_error (struct jpeg_error_mgr * err)\n{\n  err->error_exit = error_exit;\n  err->emit_message = emit_message;\n  err->output_message = output_message;\n  err->format_message = format_message;\n  err->reset_error_mgr = reset_error_mgr;\n\n  err->trace_level = 0;\t\t/* default = no tracing */\n  err->num_warnings = 0;\t/* no warnings emitted yet */\n  err->msg_code = 0;\t\t/* may be useful as a flag for \"no error\" */\n\n  /* Initialize message table pointers */\n  err->jpeg_message_table = jpeg_std_message_table;\n  err->last_jpeg_message = (int) JMSG_LASTMSGCODE - 1;\n\n  err->addon_message_table = NULL;\n  err->first_addon_message = 0;\t/* for safety */\n  err->last_addon_message = 0;\n\n  return err;\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jerror.h",
    "content": "/*\n * jerror.h\n *\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * Modified 1997-2009 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file defines the error and message codes for the JPEG library.\n * Edit this file to add new codes, or to translate the message strings to\n * some other language.\n * A set of error-reporting macros are defined too.  Some applications using\n * the JPEG library may wish to include this file to get the error codes\n * and/or the macros.\n */\n\n/*\n * To define the enum list of message codes, include this file without\n * defining macro JMESSAGE.  To create a message string table, include it\n * again with a suitable JMESSAGE definition (see jerror.c for an example).\n */\n#ifndef JMESSAGE\n#ifndef JERROR_H\n/* First time through, define the enum list */\n#define JMAKE_ENUM_LIST\n#else\n/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */\n#define JMESSAGE(code,string)\n#endif /* JERROR_H */\n#endif /* JMESSAGE */\n\n#ifdef JMAKE_ENUM_LIST\n\ntypedef enum {\n\n#define JMESSAGE(code,string)\tcode ,\n\n#endif /* JMAKE_ENUM_LIST */\n\nJMESSAGE(JMSG_NOMESSAGE, \"Bogus message code %d\") /* Must be first entry! */\n\n/* For maintenance convenience, list is alphabetical by message code name */\n#if JPEG_LIB_VERSION < 70\nJMESSAGE(JERR_ARITH_NOTIMPL,\n\t \"Sorry, arithmetic coding is not implemented\")\n#endif\nJMESSAGE(JERR_BAD_ALIGN_TYPE, \"ALIGN_TYPE is wrong, please fix\")\nJMESSAGE(JERR_BAD_ALLOC_CHUNK, \"MAX_ALLOC_CHUNK is wrong, please fix\")\nJMESSAGE(JERR_BAD_BUFFER_MODE, \"Bogus buffer control mode\")\nJMESSAGE(JERR_BAD_COMPONENT_ID, \"Invalid component ID %d in SOS\")\n#if JPEG_LIB_VERSION >= 70\nJMESSAGE(JERR_BAD_CROP_SPEC, \"Invalid crop request\")\n#endif\nJMESSAGE(JERR_BAD_DCT_COEF, \"DCT coefficient out of range\")\nJMESSAGE(JERR_BAD_DCTSIZE, \"IDCT output block size %d not supported\")\n#if JPEG_LIB_VERSION >= 70\nJMESSAGE(JERR_BAD_DROP_SAMPLING,\n\t \"Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c\")\n#endif\nJMESSAGE(JERR_BAD_HUFF_TABLE, \"Bogus Huffman table definition\")\nJMESSAGE(JERR_BAD_IN_COLORSPACE, \"Bogus input colorspace\")\nJMESSAGE(JERR_BAD_J_COLORSPACE, \"Bogus JPEG colorspace\")\nJMESSAGE(JERR_BAD_LENGTH, \"Bogus marker length\")\nJMESSAGE(JERR_BAD_LIB_VERSION,\n\t \"Wrong JPEG library version: library is %d, caller expects %d\")\nJMESSAGE(JERR_BAD_MCU_SIZE, \"Sampling factors too large for interleaved scan\")\nJMESSAGE(JERR_BAD_POOL_ID, \"Invalid memory pool code %d\")\nJMESSAGE(JERR_BAD_PRECISION, \"Unsupported JPEG data precision %d\")\nJMESSAGE(JERR_BAD_PROGRESSION,\n\t \"Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d\")\nJMESSAGE(JERR_BAD_PROG_SCRIPT,\n\t \"Invalid progressive parameters at scan script entry %d\")\nJMESSAGE(JERR_BAD_SAMPLING, \"Bogus sampling factors\")\nJMESSAGE(JERR_BAD_SCAN_SCRIPT, \"Invalid scan script at entry %d\")\nJMESSAGE(JERR_BAD_STATE, \"Improper call to JPEG library in state %d\")\nJMESSAGE(JERR_BAD_STRUCT_SIZE,\n\t \"JPEG parameter struct mismatch: library thinks size is %u, caller expects %u\")\nJMESSAGE(JERR_BAD_VIRTUAL_ACCESS, \"Bogus virtual array access\")\nJMESSAGE(JERR_BUFFER_SIZE, \"Buffer passed to JPEG library is too small\")\nJMESSAGE(JERR_CANT_SUSPEND, \"Suspension not allowed here\")\nJMESSAGE(JERR_CCIR601_NOTIMPL, \"CCIR601 sampling not implemented yet\")\nJMESSAGE(JERR_COMPONENT_COUNT, \"Too many color components: %d, max %d\")\nJMESSAGE(JERR_CONVERSION_NOTIMPL, \"Unsupported color conversion request\")\nJMESSAGE(JERR_DAC_INDEX, \"Bogus DAC index %d\")\nJMESSAGE(JERR_DAC_VALUE, \"Bogus DAC value 0x%x\")\nJMESSAGE(JERR_DHT_INDEX, \"Bogus DHT index %d\")\nJMESSAGE(JERR_DQT_INDEX, \"Bogus DQT index %d\")\nJMESSAGE(JERR_EMPTY_IMAGE, \"Empty JPEG image (DNL not supported)\")\nJMESSAGE(JERR_EMS_READ, \"Read from EMS failed\")\nJMESSAGE(JERR_EMS_WRITE, \"Write to EMS failed\")\nJMESSAGE(JERR_EOI_EXPECTED, \"Didn't expect more than one scan\")\nJMESSAGE(JERR_FILE_READ, \"Input file read error\")\nJMESSAGE(JERR_FILE_WRITE, \"Output file write error --- out of disk space?\")\nJMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, \"Fractional sampling not implemented yet\")\nJMESSAGE(JERR_HUFF_CLEN_OVERFLOW, \"Huffman code size table overflow\")\nJMESSAGE(JERR_HUFF_MISSING_CODE, \"Missing Huffman code table entry\")\nJMESSAGE(JERR_IMAGE_TOO_BIG, \"Maximum supported image dimension is %u pixels\")\nJMESSAGE(JERR_INPUT_EMPTY, \"Empty input file\")\nJMESSAGE(JERR_INPUT_EOF, \"Premature end of input file\")\nJMESSAGE(JERR_MISMATCHED_QUANT_TABLE,\n\t \"Cannot transcode due to multiple use of quantization table %d\")\nJMESSAGE(JERR_MISSING_DATA, \"Scan script does not transmit all data\")\nJMESSAGE(JERR_MODE_CHANGE, \"Invalid color quantization mode change\")\nJMESSAGE(JERR_NOTIMPL, \"Not implemented yet\")\nJMESSAGE(JERR_NOT_COMPILED, \"Requested feature was omitted at compile time\")\n#if JPEG_LIB_VERSION >= 70\nJMESSAGE(JERR_NO_ARITH_TABLE, \"Arithmetic table 0x%02x was not defined\")\n#endif\nJMESSAGE(JERR_NO_BACKING_STORE, \"Backing store not supported\")\nJMESSAGE(JERR_NO_HUFF_TABLE, \"Huffman table 0x%02x was not defined\")\nJMESSAGE(JERR_NO_IMAGE, \"JPEG datastream contains no image\")\nJMESSAGE(JERR_NO_QUANT_TABLE, \"Quantization table 0x%02x was not defined\")\nJMESSAGE(JERR_NO_SOI, \"Not a JPEG file: starts with 0x%02x 0x%02x\")\nJMESSAGE(JERR_OUT_OF_MEMORY, \"Insufficient memory (case %d)\")\nJMESSAGE(JERR_QUANT_COMPONENTS,\n\t \"Cannot quantize more than %d color components\")\nJMESSAGE(JERR_QUANT_FEW_COLORS, \"Cannot quantize to fewer than %d colors\")\nJMESSAGE(JERR_QUANT_MANY_COLORS, \"Cannot quantize to more than %d colors\")\nJMESSAGE(JERR_SOF_DUPLICATE, \"Invalid JPEG file structure: two SOF markers\")\nJMESSAGE(JERR_SOF_NO_SOS, \"Invalid JPEG file structure: missing SOS marker\")\nJMESSAGE(JERR_SOF_UNSUPPORTED, \"Unsupported JPEG process: SOF type 0x%02x\")\nJMESSAGE(JERR_SOI_DUPLICATE, \"Invalid JPEG file structure: two SOI markers\")\nJMESSAGE(JERR_SOS_NO_SOF, \"Invalid JPEG file structure: SOS before SOF\")\nJMESSAGE(JERR_TFILE_CREATE, \"Failed to create temporary file %s\")\nJMESSAGE(JERR_TFILE_READ, \"Read failed on temporary file\")\nJMESSAGE(JERR_TFILE_SEEK, \"Seek failed on temporary file\")\nJMESSAGE(JERR_TFILE_WRITE,\n\t \"Write failed on temporary file --- out of disk space?\")\nJMESSAGE(JERR_TOO_LITTLE_DATA, \"Application transferred too few scanlines\")\nJMESSAGE(JERR_UNKNOWN_MARKER, \"Unsupported marker type 0x%02x\")\nJMESSAGE(JERR_VIRTUAL_BUG, \"Virtual array controller messed up\")\nJMESSAGE(JERR_WIDTH_OVERFLOW, \"Image too wide for this implementation\")\nJMESSAGE(JERR_XMS_READ, \"Read from XMS failed\")\nJMESSAGE(JERR_XMS_WRITE, \"Write to XMS failed\")\nJMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT)\nJMESSAGE(JMSG_VERSION, JVERSION)\nJMESSAGE(JTRC_16BIT_TABLES,\n\t \"Caution: quantization tables are too coarse for baseline JPEG\")\nJMESSAGE(JTRC_ADOBE,\n\t \"Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d\")\nJMESSAGE(JTRC_APP0, \"Unknown APP0 marker (not JFIF), length %u\")\nJMESSAGE(JTRC_APP14, \"Unknown APP14 marker (not Adobe), length %u\")\nJMESSAGE(JTRC_DAC, \"Define Arithmetic Table 0x%02x: 0x%02x\")\nJMESSAGE(JTRC_DHT, \"Define Huffman Table 0x%02x\")\nJMESSAGE(JTRC_DQT, \"Define Quantization Table %d  precision %d\")\nJMESSAGE(JTRC_DRI, \"Define Restart Interval %u\")\nJMESSAGE(JTRC_EMS_CLOSE, \"Freed EMS handle %u\")\nJMESSAGE(JTRC_EMS_OPEN, \"Obtained EMS handle %u\")\nJMESSAGE(JTRC_EOI, \"End Of Image\")\nJMESSAGE(JTRC_HUFFBITS, \"        %3d %3d %3d %3d %3d %3d %3d %3d\")\nJMESSAGE(JTRC_JFIF, \"JFIF APP0 marker: version %d.%02d, density %dx%d  %d\")\nJMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE,\n\t \"Warning: thumbnail image size does not match data length %u\")\nJMESSAGE(JTRC_JFIF_EXTENSION,\n\t \"JFIF extension marker: type 0x%02x, length %u\")\nJMESSAGE(JTRC_JFIF_THUMBNAIL, \"    with %d x %d thumbnail image\")\nJMESSAGE(JTRC_MISC_MARKER, \"Miscellaneous marker 0x%02x, length %u\")\nJMESSAGE(JTRC_PARMLESS_MARKER, \"Unexpected marker 0x%02x\")\nJMESSAGE(JTRC_QUANTVALS, \"        %4u %4u %4u %4u %4u %4u %4u %4u\")\nJMESSAGE(JTRC_QUANT_3_NCOLORS, \"Quantizing to %d = %d*%d*%d colors\")\nJMESSAGE(JTRC_QUANT_NCOLORS, \"Quantizing to %d colors\")\nJMESSAGE(JTRC_QUANT_SELECTED, \"Selected %d colors for quantization\")\nJMESSAGE(JTRC_RECOVERY_ACTION, \"At marker 0x%02x, recovery action %d\")\nJMESSAGE(JTRC_RST, \"RST%d\")\nJMESSAGE(JTRC_SMOOTH_NOTIMPL,\n\t \"Smoothing not supported with nonstandard sampling ratios\")\nJMESSAGE(JTRC_SOF, \"Start Of Frame 0x%02x: width=%u, height=%u, components=%d\")\nJMESSAGE(JTRC_SOF_COMPONENT, \"    Component %d: %dhx%dv q=%d\")\nJMESSAGE(JTRC_SOI, \"Start of Image\")\nJMESSAGE(JTRC_SOS, \"Start Of Scan: %d components\")\nJMESSAGE(JTRC_SOS_COMPONENT, \"    Component %d: dc=%d ac=%d\")\nJMESSAGE(JTRC_SOS_PARAMS, \"  Ss=%d, Se=%d, Ah=%d, Al=%d\")\nJMESSAGE(JTRC_TFILE_CLOSE, \"Closed temporary file %s\")\nJMESSAGE(JTRC_TFILE_OPEN, \"Opened temporary file %s\")\nJMESSAGE(JTRC_THUMB_JPEG,\n\t \"JFIF extension marker: JPEG-compressed thumbnail image, length %u\")\nJMESSAGE(JTRC_THUMB_PALETTE,\n\t \"JFIF extension marker: palette thumbnail image, length %u\")\nJMESSAGE(JTRC_THUMB_RGB,\n\t \"JFIF extension marker: RGB thumbnail image, length %u\")\nJMESSAGE(JTRC_UNKNOWN_IDS,\n\t \"Unrecognized component IDs %d %d %d, assuming YCbCr\")\nJMESSAGE(JTRC_XMS_CLOSE, \"Freed XMS handle %u\")\nJMESSAGE(JTRC_XMS_OPEN, \"Obtained XMS handle %u\")\nJMESSAGE(JWRN_ADOBE_XFORM, \"Unknown Adobe color transform code %d\")\n#if JPEG_LIB_VERSION >= 70\nJMESSAGE(JWRN_ARITH_BAD_CODE, \"Corrupt JPEG data: bad arithmetic code\")\n#endif\nJMESSAGE(JWRN_BOGUS_PROGRESSION,\n\t \"Inconsistent progression sequence for component %d coefficient %d\")\nJMESSAGE(JWRN_EXTRANEOUS_DATA,\n\t \"Corrupt JPEG data: %u extraneous bytes before marker 0x%02x\")\nJMESSAGE(JWRN_HIT_MARKER, \"Corrupt JPEG data: premature end of data segment\")\nJMESSAGE(JWRN_HUFF_BAD_CODE, \"Corrupt JPEG data: bad Huffman code\")\nJMESSAGE(JWRN_JFIF_MAJOR, \"Warning: unknown JFIF revision number %d.%02d\")\nJMESSAGE(JWRN_JPEG_EOF, \"Premature end of JPEG file\")\nJMESSAGE(JWRN_MUST_RESYNC,\n\t \"Corrupt JPEG data: found marker 0x%02x instead of RST%d\")\nJMESSAGE(JWRN_NOT_SEQUENTIAL, \"Invalid SOS parameters for sequential JPEG\")\nJMESSAGE(JWRN_TOO_MUCH_DATA, \"Application transferred too many scanlines\")\n#if JPEG_LIB_VERSION < 70\nJMESSAGE(JERR_BAD_CROP_SPEC, \"Invalid crop request\")\n#if defined(C_ARITH_CODING_SUPPORTED) || defined(D_ARITH_CODING_SUPPORTED)\nJMESSAGE(JERR_NO_ARITH_TABLE, \"Arithmetic table 0x%02x was not defined\")\nJMESSAGE(JWRN_ARITH_BAD_CODE, \"Corrupt JPEG data: bad arithmetic code\")\n#endif\n#endif\n\n#ifdef JMAKE_ENUM_LIST\n\n  JMSG_LASTMSGCODE\n} J_MESSAGE_CODE;\n\n#undef JMAKE_ENUM_LIST\n#endif /* JMAKE_ENUM_LIST */\n\n/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */\n#undef JMESSAGE\n\n\n#ifndef JERROR_H\n#define JERROR_H\n\n/* Macros to simplify using the error and trace message stuff */\n/* The first parameter is either type of cinfo pointer */\n\n/* Fatal errors (print message and exit) */\n#define ERREXIT(cinfo,code)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n#define ERREXIT1(cinfo,code,p1)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n#define ERREXIT2(cinfo,code,p1,p2)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (cinfo)->err->msg_parm.i[1] = (p2), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n#define ERREXIT3(cinfo,code,p1,p2,p3)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (cinfo)->err->msg_parm.i[1] = (p2), \\\n   (cinfo)->err->msg_parm.i[2] = (p3), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n#define ERREXIT4(cinfo,code,p1,p2,p3,p4)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (cinfo)->err->msg_parm.i[1] = (p2), \\\n   (cinfo)->err->msg_parm.i[2] = (p3), \\\n   (cinfo)->err->msg_parm.i[3] = (p4), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n#define ERREXITS(cinfo,code,str)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \\\n   (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))\n\n#define MAKESTMT(stuff)\t\tdo { stuff } while (0)\n\n/* Nonfatal errors (we can keep going, but the data is probably corrupt) */\n#define WARNMS(cinfo,code)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))\n#define WARNMS1(cinfo,code,p1)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))\n#define WARNMS2(cinfo,code,p1,p2)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (cinfo)->err->msg_parm.i[1] = (p2), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1))\n\n/* Informational/debugging messages */\n#define TRACEMS(cinfo,lvl,code)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))\n#define TRACEMS1(cinfo,lvl,code,p1)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))\n#define TRACEMS2(cinfo,lvl,code,p1,p2)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   (cinfo)->err->msg_parm.i[0] = (p1), \\\n   (cinfo)->err->msg_parm.i[1] = (p2), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))\n#define TRACEMS3(cinfo,lvl,code,p1,p2,p3)  \\\n  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \\\n\t   _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \\\n\t   (cinfo)->err->msg_code = (code); \\\n\t   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )\n#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4)  \\\n  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \\\n\t   _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \\\n\t   (cinfo)->err->msg_code = (code); \\\n\t   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )\n#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5)  \\\n  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \\\n\t   _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \\\n\t   _mp[4] = (p5); \\\n\t   (cinfo)->err->msg_code = (code); \\\n\t   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )\n#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8)  \\\n  MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \\\n\t   _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \\\n\t   _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \\\n\t   (cinfo)->err->msg_code = (code); \\\n\t   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); )\n#define TRACEMSS(cinfo,lvl,code,str)  \\\n  ((cinfo)->err->msg_code = (code), \\\n   strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \\\n   (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)))\n\n#endif /* JERROR_H */\n"
  },
  {
    "path": "ext/libjpeg-turbo/jfdctflt.c",
    "content": "/*\n * jfdctflt.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains a floating-point implementation of the\n * forward DCT (Discrete Cosine Transform).\n *\n * This implementation should be more accurate than either of the integer\n * DCT implementations.  However, it may not give the same results on all\n * machines because of differences in roundoff behavior.  Speed will depend\n * on the hardware's floating point capacity.\n *\n * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT\n * on each column.  Direct algorithms are also available, but they are\n * much more complex and seem not to be any faster when reduced to code.\n *\n * This implementation is based on Arai, Agui, and Nakajima's algorithm for\n * scaled DCT.  Their original paper (Trans. IEICE E-71(11):1095) is in\n * Japanese, but the algorithm is described in the Pennebaker & Mitchell\n * JPEG textbook (see REFERENCES section in file README).  The following code\n * is based directly on figure 4-8 in P&M.\n * While an 8-point DCT cannot be done in less than 11 multiplies, it is\n * possible to arrange the computation so that many of the multiplies are\n * simple scalings of the final outputs.  These multiplies can then be\n * folded into the multiplications or divisions by the JPEG quantization\n * table entries.  The AA&N method leaves only 5 multiplies and 29 adds\n * to be done in the DCT itself.\n * The primary disadvantage of this method is that with a fixed-point\n * implementation, accuracy is lost due to imprecise representation of the\n * scaled quantization values.  However, that problem does not arise if\n * we use floating point arithmetic.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"\t\t/* Private declarations for DCT subsystem */\n\n#ifdef DCT_FLOAT_SUPPORTED\n\n\n/*\n * This module is specialized to the case DCTSIZE = 8.\n */\n\n#if DCTSIZE != 8\n  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */\n#endif\n\n\n/*\n * Perform the forward DCT on one block of samples.\n */\n\nGLOBAL(void)\njpeg_fdct_float (FAST_FLOAT * data)\n{\n  FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;\n  FAST_FLOAT tmp10, tmp11, tmp12, tmp13;\n  FAST_FLOAT z1, z2, z3, z4, z5, z11, z13;\n  FAST_FLOAT *dataptr;\n  int ctr;\n\n  /* Pass 1: process rows. */\n\n  dataptr = data;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    tmp0 = dataptr[0] + dataptr[7];\n    tmp7 = dataptr[0] - dataptr[7];\n    tmp1 = dataptr[1] + dataptr[6];\n    tmp6 = dataptr[1] - dataptr[6];\n    tmp2 = dataptr[2] + dataptr[5];\n    tmp5 = dataptr[2] - dataptr[5];\n    tmp3 = dataptr[3] + dataptr[4];\n    tmp4 = dataptr[3] - dataptr[4];\n    \n    /* Even part */\n    \n    tmp10 = tmp0 + tmp3;\t/* phase 2 */\n    tmp13 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp12 = tmp1 - tmp2;\n    \n    dataptr[0] = tmp10 + tmp11; /* phase 3 */\n    dataptr[4] = tmp10 - tmp11;\n    \n    z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */\n    dataptr[2] = tmp13 + z1;\t/* phase 5 */\n    dataptr[6] = tmp13 - z1;\n    \n    /* Odd part */\n\n    tmp10 = tmp4 + tmp5;\t/* phase 2 */\n    tmp11 = tmp5 + tmp6;\n    tmp12 = tmp6 + tmp7;\n\n    /* The rotator is modified from fig 4-8 to avoid extra negations. */\n    z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */\n    z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */\n    z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */\n    z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */\n\n    z11 = tmp7 + z3;\t\t/* phase 5 */\n    z13 = tmp7 - z3;\n\n    dataptr[5] = z13 + z2;\t/* phase 6 */\n    dataptr[3] = z13 - z2;\n    dataptr[1] = z11 + z4;\n    dataptr[7] = z11 - z4;\n\n    dataptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns. */\n\n  dataptr = data;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];\n    tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];\n    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];\n    tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];\n    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];\n    tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];\n    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];\n    tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];\n    \n    /* Even part */\n    \n    tmp10 = tmp0 + tmp3;\t/* phase 2 */\n    tmp13 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp12 = tmp1 - tmp2;\n    \n    dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */\n    dataptr[DCTSIZE*4] = tmp10 - tmp11;\n    \n    z1 = (tmp12 + tmp13) * ((FAST_FLOAT) 0.707106781); /* c4 */\n    dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */\n    dataptr[DCTSIZE*6] = tmp13 - z1;\n    \n    /* Odd part */\n\n    tmp10 = tmp4 + tmp5;\t/* phase 2 */\n    tmp11 = tmp5 + tmp6;\n    tmp12 = tmp6 + tmp7;\n\n    /* The rotator is modified from fig 4-8 to avoid extra negations. */\n    z5 = (tmp10 - tmp12) * ((FAST_FLOAT) 0.382683433); /* c6 */\n    z2 = ((FAST_FLOAT) 0.541196100) * tmp10 + z5; /* c2-c6 */\n    z4 = ((FAST_FLOAT) 1.306562965) * tmp12 + z5; /* c2+c6 */\n    z3 = tmp11 * ((FAST_FLOAT) 0.707106781); /* c4 */\n\n    z11 = tmp7 + z3;\t\t/* phase 5 */\n    z13 = tmp7 - z3;\n\n    dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */\n    dataptr[DCTSIZE*3] = z13 - z2;\n    dataptr[DCTSIZE*1] = z11 + z4;\n    dataptr[DCTSIZE*7] = z11 - z4;\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n#endif /* DCT_FLOAT_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/jfdctfst.c",
    "content": "/*\n * jfdctfst.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains a fast, not so accurate integer implementation of the\n * forward DCT (Discrete Cosine Transform).\n *\n * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT\n * on each column.  Direct algorithms are also available, but they are\n * much more complex and seem not to be any faster when reduced to code.\n *\n * This implementation is based on Arai, Agui, and Nakajima's algorithm for\n * scaled DCT.  Their original paper (Trans. IEICE E-71(11):1095) is in\n * Japanese, but the algorithm is described in the Pennebaker & Mitchell\n * JPEG textbook (see REFERENCES section in file README).  The following code\n * is based directly on figure 4-8 in P&M.\n * While an 8-point DCT cannot be done in less than 11 multiplies, it is\n * possible to arrange the computation so that many of the multiplies are\n * simple scalings of the final outputs.  These multiplies can then be\n * folded into the multiplications or divisions by the JPEG quantization\n * table entries.  The AA&N method leaves only 5 multiplies and 29 adds\n * to be done in the DCT itself.\n * The primary disadvantage of this method is that with fixed-point math,\n * accuracy is lost due to imprecise representation of the scaled\n * quantization values.  The smaller the quantization table entry, the less\n * precise the scaled value, so this implementation does worse with high-\n * quality-setting files than with low-quality ones.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"\t\t/* Private declarations for DCT subsystem */\n\n#ifdef DCT_IFAST_SUPPORTED\n\n\n/*\n * This module is specialized to the case DCTSIZE = 8.\n */\n\n#if DCTSIZE != 8\n  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */\n#endif\n\n\n/* Scaling decisions are generally the same as in the LL&M algorithm;\n * see jfdctint.c for more details.  However, we choose to descale\n * (right shift) multiplication products as soon as they are formed,\n * rather than carrying additional fractional bits into subsequent additions.\n * This compromises accuracy slightly, but it lets us save a few shifts.\n * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples)\n * everywhere except in the multiplications proper; this saves a good deal\n * of work on 16-bit-int machines.\n *\n * Again to save a few shifts, the intermediate results between pass 1 and\n * pass 2 are not upscaled, but are represented only to integral precision.\n *\n * A final compromise is to represent the multiplicative constants to only\n * 8 fractional bits, rather than 13.  This saves some shifting work on some\n * machines, and may also reduce the cost of multiplication (since there\n * are fewer one-bits in the constants).\n */\n\n#define CONST_BITS  8\n\n\n/* Some C compilers fail to reduce \"FIX(constant)\" at compile time, thus\n * causing a lot of useless floating-point operations at run time.\n * To get around this we use the following pre-calculated constants.\n * If you change CONST_BITS you may want to add appropriate values.\n * (With a reasonable C compiler, you can just rely on the FIX() macro...)\n */\n\n#if CONST_BITS == 8\n#define FIX_0_382683433  ((INT32)   98)\t\t/* FIX(0.382683433) */\n#define FIX_0_541196100  ((INT32)  139)\t\t/* FIX(0.541196100) */\n#define FIX_0_707106781  ((INT32)  181)\t\t/* FIX(0.707106781) */\n#define FIX_1_306562965  ((INT32)  334)\t\t/* FIX(1.306562965) */\n#else\n#define FIX_0_382683433  FIX(0.382683433)\n#define FIX_0_541196100  FIX(0.541196100)\n#define FIX_0_707106781  FIX(0.707106781)\n#define FIX_1_306562965  FIX(1.306562965)\n#endif\n\n\n/* We can gain a little more speed, with a further compromise in accuracy,\n * by omitting the addition in a descaling shift.  This yields an incorrectly\n * rounded result half the time...\n */\n\n#ifndef USE_ACCURATE_ROUNDING\n#undef DESCALE\n#define DESCALE(x,n)  RIGHT_SHIFT(x, n)\n#endif\n\n\n/* Multiply a DCTELEM variable by an INT32 constant, and immediately\n * descale to yield a DCTELEM result.\n */\n\n#define MULTIPLY(var,const)  ((DCTELEM) DESCALE((var) * (const), CONST_BITS))\n\n\n/*\n * Perform the forward DCT on one block of samples.\n */\n\nGLOBAL(void)\njpeg_fdct_ifast (DCTELEM * data)\n{\n  DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;\n  DCTELEM tmp10, tmp11, tmp12, tmp13;\n  DCTELEM z1, z2, z3, z4, z5, z11, z13;\n  DCTELEM *dataptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pass 1: process rows. */\n\n  dataptr = data;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    tmp0 = dataptr[0] + dataptr[7];\n    tmp7 = dataptr[0] - dataptr[7];\n    tmp1 = dataptr[1] + dataptr[6];\n    tmp6 = dataptr[1] - dataptr[6];\n    tmp2 = dataptr[2] + dataptr[5];\n    tmp5 = dataptr[2] - dataptr[5];\n    tmp3 = dataptr[3] + dataptr[4];\n    tmp4 = dataptr[3] - dataptr[4];\n    \n    /* Even part */\n    \n    tmp10 = tmp0 + tmp3;\t/* phase 2 */\n    tmp13 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp12 = tmp1 - tmp2;\n    \n    dataptr[0] = tmp10 + tmp11; /* phase 3 */\n    dataptr[4] = tmp10 - tmp11;\n    \n    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */\n    dataptr[2] = tmp13 + z1;\t/* phase 5 */\n    dataptr[6] = tmp13 - z1;\n    \n    /* Odd part */\n\n    tmp10 = tmp4 + tmp5;\t/* phase 2 */\n    tmp11 = tmp5 + tmp6;\n    tmp12 = tmp6 + tmp7;\n\n    /* The rotator is modified from fig 4-8 to avoid extra negations. */\n    z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */\n    z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */\n    z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */\n    z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */\n\n    z11 = tmp7 + z3;\t\t/* phase 5 */\n    z13 = tmp7 - z3;\n\n    dataptr[5] = z13 + z2;\t/* phase 6 */\n    dataptr[3] = z13 - z2;\n    dataptr[1] = z11 + z4;\n    dataptr[7] = z11 - z4;\n\n    dataptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns. */\n\n  dataptr = data;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];\n    tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];\n    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];\n    tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];\n    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];\n    tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];\n    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];\n    tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];\n    \n    /* Even part */\n    \n    tmp10 = tmp0 + tmp3;\t/* phase 2 */\n    tmp13 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp12 = tmp1 - tmp2;\n    \n    dataptr[DCTSIZE*0] = tmp10 + tmp11; /* phase 3 */\n    dataptr[DCTSIZE*4] = tmp10 - tmp11;\n    \n    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_707106781); /* c4 */\n    dataptr[DCTSIZE*2] = tmp13 + z1; /* phase 5 */\n    dataptr[DCTSIZE*6] = tmp13 - z1;\n    \n    /* Odd part */\n\n    tmp10 = tmp4 + tmp5;\t/* phase 2 */\n    tmp11 = tmp5 + tmp6;\n    tmp12 = tmp6 + tmp7;\n\n    /* The rotator is modified from fig 4-8 to avoid extra negations. */\n    z5 = MULTIPLY(tmp10 - tmp12, FIX_0_382683433); /* c6 */\n    z2 = MULTIPLY(tmp10, FIX_0_541196100) + z5; /* c2-c6 */\n    z4 = MULTIPLY(tmp12, FIX_1_306562965) + z5; /* c2+c6 */\n    z3 = MULTIPLY(tmp11, FIX_0_707106781); /* c4 */\n\n    z11 = tmp7 + z3;\t\t/* phase 5 */\n    z13 = tmp7 - z3;\n\n    dataptr[DCTSIZE*5] = z13 + z2; /* phase 6 */\n    dataptr[DCTSIZE*3] = z13 - z2;\n    dataptr[DCTSIZE*1] = z11 + z4;\n    dataptr[DCTSIZE*7] = z11 - z4;\n\n    dataptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n#endif /* DCT_IFAST_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/jfdctint.c",
    "content": "/*\n * jfdctint.c\n *\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains a slow-but-accurate integer implementation of the\n * forward DCT (Discrete Cosine Transform).\n *\n * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT\n * on each column.  Direct algorithms are also available, but they are\n * much more complex and seem not to be any faster when reduced to code.\n *\n * This implementation is based on an algorithm described in\n *   C. Loeffler, A. Ligtenberg and G. Moschytz, \"Practical Fast 1-D DCT\n *   Algorithms with 11 Multiplications\", Proc. Int'l. Conf. on Acoustics,\n *   Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.\n * The primary algorithm described there uses 11 multiplies and 29 adds.\n * We use their alternate method with 12 multiplies and 32 adds.\n * The advantage of this method is that no data path contains more than one\n * multiplication; this allows a very simple and accurate implementation in\n * scaled fixed-point arithmetic, with a minimal number of shifts.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"\t\t/* Private declarations for DCT subsystem */\n\n#ifdef DCT_ISLOW_SUPPORTED\n\n\n/*\n * This module is specialized to the case DCTSIZE = 8.\n */\n\n#if DCTSIZE != 8\n  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */\n#endif\n\n\n/*\n * The poop on this scaling stuff is as follows:\n *\n * Each 1-D DCT step produces outputs which are a factor of sqrt(N)\n * larger than the true DCT outputs.  The final outputs are therefore\n * a factor of N larger than desired; since N=8 this can be cured by\n * a simple right shift at the end of the algorithm.  The advantage of\n * this arrangement is that we save two multiplications per 1-D DCT,\n * because the y0 and y4 outputs need not be divided by sqrt(N).\n * In the IJG code, this factor of 8 is removed by the quantization step\n * (in jcdctmgr.c), NOT in this module.\n *\n * We have to do addition and subtraction of the integer inputs, which\n * is no problem, and multiplication by fractional constants, which is\n * a problem to do in integer arithmetic.  We multiply all the constants\n * by CONST_SCALE and convert them to integer constants (thus retaining\n * CONST_BITS bits of precision in the constants).  After doing a\n * multiplication we have to divide the product by CONST_SCALE, with proper\n * rounding, to produce the correct output.  This division can be done\n * cheaply as a right shift of CONST_BITS bits.  We postpone shifting\n * as long as possible so that partial sums can be added together with\n * full fractional precision.\n *\n * The outputs of the first pass are scaled up by PASS1_BITS bits so that\n * they are represented to better-than-integral precision.  These outputs\n * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word\n * with the recommended scaling.  (For 12-bit sample data, the intermediate\n * array is INT32 anyway.)\n *\n * To avoid overflow of the 32-bit intermediate results in pass 2, we must\n * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26.  Error analysis\n * shows that the values given below are the most effective.\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define CONST_BITS  13\n#define PASS1_BITS  2\n#else\n#define CONST_BITS  13\n#define PASS1_BITS  1\t\t/* lose a little precision to avoid overflow */\n#endif\n\n/* Some C compilers fail to reduce \"FIX(constant)\" at compile time, thus\n * causing a lot of useless floating-point operations at run time.\n * To get around this we use the following pre-calculated constants.\n * If you change CONST_BITS you may want to add appropriate values.\n * (With a reasonable C compiler, you can just rely on the FIX() macro...)\n */\n\n#if CONST_BITS == 13\n#define FIX_0_298631336  ((INT32)  2446)\t/* FIX(0.298631336) */\n#define FIX_0_390180644  ((INT32)  3196)\t/* FIX(0.390180644) */\n#define FIX_0_541196100  ((INT32)  4433)\t/* FIX(0.541196100) */\n#define FIX_0_765366865  ((INT32)  6270)\t/* FIX(0.765366865) */\n#define FIX_0_899976223  ((INT32)  7373)\t/* FIX(0.899976223) */\n#define FIX_1_175875602  ((INT32)  9633)\t/* FIX(1.175875602) */\n#define FIX_1_501321110  ((INT32)  12299)\t/* FIX(1.501321110) */\n#define FIX_1_847759065  ((INT32)  15137)\t/* FIX(1.847759065) */\n#define FIX_1_961570560  ((INT32)  16069)\t/* FIX(1.961570560) */\n#define FIX_2_053119869  ((INT32)  16819)\t/* FIX(2.053119869) */\n#define FIX_2_562915447  ((INT32)  20995)\t/* FIX(2.562915447) */\n#define FIX_3_072711026  ((INT32)  25172)\t/* FIX(3.072711026) */\n#else\n#define FIX_0_298631336  FIX(0.298631336)\n#define FIX_0_390180644  FIX(0.390180644)\n#define FIX_0_541196100  FIX(0.541196100)\n#define FIX_0_765366865  FIX(0.765366865)\n#define FIX_0_899976223  FIX(0.899976223)\n#define FIX_1_175875602  FIX(1.175875602)\n#define FIX_1_501321110  FIX(1.501321110)\n#define FIX_1_847759065  FIX(1.847759065)\n#define FIX_1_961570560  FIX(1.961570560)\n#define FIX_2_053119869  FIX(2.053119869)\n#define FIX_2_562915447  FIX(2.562915447)\n#define FIX_3_072711026  FIX(3.072711026)\n#endif\n\n\n/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.\n * For 8-bit samples with the recommended scaling, all the variable\n * and constant values involved are no more than 16 bits wide, so a\n * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.\n * For 12-bit samples, a full 32-bit multiplication will be needed.\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define MULTIPLY(var,const)  MULTIPLY16C16(var,const)\n#else\n#define MULTIPLY(var,const)  ((var) * (const))\n#endif\n\n\n/*\n * Perform the forward DCT on one block of samples.\n */\n\nGLOBAL(void)\njpeg_fdct_islow (DCTELEM * data)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;\n  INT32 tmp10, tmp11, tmp12, tmp13;\n  INT32 z1, z2, z3, z4, z5;\n  DCTELEM *dataptr;\n  int ctr;\n  SHIFT_TEMPS\n\n  /* Pass 1: process rows. */\n  /* Note results are scaled up by sqrt(8) compared to a true DCT; */\n  /* furthermore, we scale the results by 2**PASS1_BITS. */\n\n  dataptr = data;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    tmp0 = dataptr[0] + dataptr[7];\n    tmp7 = dataptr[0] - dataptr[7];\n    tmp1 = dataptr[1] + dataptr[6];\n    tmp6 = dataptr[1] - dataptr[6];\n    tmp2 = dataptr[2] + dataptr[5];\n    tmp5 = dataptr[2] - dataptr[5];\n    tmp3 = dataptr[3] + dataptr[4];\n    tmp4 = dataptr[3] - dataptr[4];\n    \n    /* Even part per LL&M figure 1 --- note that published figure is faulty;\n     * rotator \"sqrt(2)*c1\" should be \"sqrt(2)*c6\".\n     */\n    \n    tmp10 = tmp0 + tmp3;\n    tmp13 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp12 = tmp1 - tmp2;\n    \n    dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS);\n    dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS);\n    \n    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);\n    dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),\n\t\t\t\t   CONST_BITS-PASS1_BITS);\n    dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),\n\t\t\t\t   CONST_BITS-PASS1_BITS);\n    \n    /* Odd part per figure 8 --- note paper omits factor of sqrt(2).\n     * cK represents cos(K*pi/16).\n     * i0..i3 in the paper are tmp4..tmp7 here.\n     */\n    \n    z1 = tmp4 + tmp7;\n    z2 = tmp5 + tmp6;\n    z3 = tmp4 + tmp6;\n    z4 = tmp5 + tmp7;\n    z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */\n    \n    tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */\n    tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */\n    tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */\n    tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */\n    z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */\n    z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */\n    z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */\n    z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */\n    \n    z3 += z5;\n    z4 += z5;\n    \n    dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS);\n    dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS);\n    dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS);\n    dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS);\n    \n    dataptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n\n  /* Pass 2: process columns.\n   * We remove the PASS1_BITS scaling, but leave the results scaled up\n   * by an overall factor of 8.\n   */\n\n  dataptr = data;\n  for (ctr = DCTSIZE-1; ctr >= 0; ctr--) {\n    tmp0 = dataptr[DCTSIZE*0] + dataptr[DCTSIZE*7];\n    tmp7 = dataptr[DCTSIZE*0] - dataptr[DCTSIZE*7];\n    tmp1 = dataptr[DCTSIZE*1] + dataptr[DCTSIZE*6];\n    tmp6 = dataptr[DCTSIZE*1] - dataptr[DCTSIZE*6];\n    tmp2 = dataptr[DCTSIZE*2] + dataptr[DCTSIZE*5];\n    tmp5 = dataptr[DCTSIZE*2] - dataptr[DCTSIZE*5];\n    tmp3 = dataptr[DCTSIZE*3] + dataptr[DCTSIZE*4];\n    tmp4 = dataptr[DCTSIZE*3] - dataptr[DCTSIZE*4];\n    \n    /* Even part per LL&M figure 1 --- note that published figure is faulty;\n     * rotator \"sqrt(2)*c1\" should be \"sqrt(2)*c6\".\n     */\n    \n    tmp10 = tmp0 + tmp3;\n    tmp13 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp12 = tmp1 - tmp2;\n    \n    dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp11, PASS1_BITS);\n    dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp10 - tmp11, PASS1_BITS);\n    \n    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);\n    dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),\n\t\t\t\t\t   CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),\n\t\t\t\t\t   CONST_BITS+PASS1_BITS);\n    \n    /* Odd part per figure 8 --- note paper omits factor of sqrt(2).\n     * cK represents cos(K*pi/16).\n     * i0..i3 in the paper are tmp4..tmp7 here.\n     */\n    \n    z1 = tmp4 + tmp7;\n    z2 = tmp5 + tmp6;\n    z3 = tmp4 + tmp6;\n    z4 = tmp5 + tmp7;\n    z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */\n    \n    tmp4 = MULTIPLY(tmp4, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */\n    tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */\n    tmp6 = MULTIPLY(tmp6, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */\n    tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */\n    z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */\n    z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */\n    z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */\n    z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */\n    \n    z3 += z5;\n    z4 += z5;\n    \n    dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp4 + z1 + z3,\n\t\t\t\t\t   CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp5 + z2 + z4,\n\t\t\t\t\t   CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp6 + z2 + z3,\n\t\t\t\t\t   CONST_BITS+PASS1_BITS);\n    dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp7 + z1 + z4,\n\t\t\t\t\t   CONST_BITS+PASS1_BITS);\n    \n    dataptr++;\t\t\t/* advance pointer to next column */\n  }\n}\n\n#endif /* DCT_ISLOW_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/jidctflt.c",
    "content": "/*\n * jidctflt.c\n *\n * Copyright (C) 1994-1998, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains a floating-point implementation of the\n * inverse DCT (Discrete Cosine Transform).  In the IJG code, this routine\n * must also perform dequantization of the input coefficients.\n *\n * This implementation should be more accurate than either of the integer\n * IDCT implementations.  However, it may not give the same results on all\n * machines because of differences in roundoff behavior.  Speed will depend\n * on the hardware's floating point capacity.\n *\n * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT\n * on each row (or vice versa, but it's more convenient to emit a row at\n * a time).  Direct algorithms are also available, but they are much more\n * complex and seem not to be any faster when reduced to code.\n *\n * This implementation is based on Arai, Agui, and Nakajima's algorithm for\n * scaled DCT.  Their original paper (Trans. IEICE E-71(11):1095) is in\n * Japanese, but the algorithm is described in the Pennebaker & Mitchell\n * JPEG textbook (see REFERENCES section in file README).  The following code\n * is based directly on figure 4-8 in P&M.\n * While an 8-point DCT cannot be done in less than 11 multiplies, it is\n * possible to arrange the computation so that many of the multiplies are\n * simple scalings of the final outputs.  These multiplies can then be\n * folded into the multiplications or divisions by the JPEG quantization\n * table entries.  The AA&N method leaves only 5 multiplies and 29 adds\n * to be done in the DCT itself.\n * The primary disadvantage of this method is that with a fixed-point\n * implementation, accuracy is lost due to imprecise representation of the\n * scaled quantization values.  However, that problem does not arise if\n * we use floating point arithmetic.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"\t\t/* Private declarations for DCT subsystem */\n\n#ifdef DCT_FLOAT_SUPPORTED\n\n\n/*\n * This module is specialized to the case DCTSIZE = 8.\n */\n\n#if DCTSIZE != 8\n  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */\n#endif\n\n\n/* Dequantize a coefficient by multiplying it by the multiplier-table\n * entry; produce a float result.\n */\n\n#define DEQUANTIZE(coef,quantval)  (((FAST_FLOAT) (coef)) * (quantval))\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients.\n */\n\nGLOBAL(void)\njpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JCOEFPTR coef_block,\n\t\t JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;\n  FAST_FLOAT tmp10, tmp11, tmp12, tmp13;\n  FAST_FLOAT z5, z10, z11, z12, z13;\n  JCOEFPTR inptr;\n  FLOAT_MULT_TYPE * quantptr;\n  FAST_FLOAT * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  FAST_FLOAT workspace[DCTSIZE2]; /* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (FLOAT_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = DCTSIZE; ctr > 0; ctr--) {\n    /* Due to quantization, we will usually find that many of the input\n     * coefficients are zero, especially the AC terms.  We can exploit this\n     * by short-circuiting the IDCT calculation for any column in which all\n     * the AC terms are zero.  In that case each output is equal to the\n     * DC coefficient (with scale factor as needed).\n     * With typical images and quantization tables, half or more of the\n     * column DCT calculations can be simplified this way.\n     */\n    \n    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&\n\tinptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&\n\tinptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&\n\tinptr[DCTSIZE*7] == 0) {\n      /* AC terms all zero */\n      FAST_FLOAT dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n      \n      wsptr[DCTSIZE*0] = dcval;\n      wsptr[DCTSIZE*1] = dcval;\n      wsptr[DCTSIZE*2] = dcval;\n      wsptr[DCTSIZE*3] = dcval;\n      wsptr[DCTSIZE*4] = dcval;\n      wsptr[DCTSIZE*5] = dcval;\n      wsptr[DCTSIZE*6] = dcval;\n      wsptr[DCTSIZE*7] = dcval;\n      \n      inptr++;\t\t\t/* advance pointers to next column */\n      quantptr++;\n      wsptr++;\n      continue;\n    }\n    \n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp10 = tmp0 + tmp2;\t/* phase 3 */\n    tmp11 = tmp0 - tmp2;\n\n    tmp13 = tmp1 + tmp3;\t/* phases 5-3 */\n    tmp12 = (tmp1 - tmp3) * ((FAST_FLOAT) 1.414213562) - tmp13; /* 2*c4 */\n\n    tmp0 = tmp10 + tmp13;\t/* phase 2 */\n    tmp3 = tmp10 - tmp13;\n    tmp1 = tmp11 + tmp12;\n    tmp2 = tmp11 - tmp12;\n    \n    /* Odd part */\n\n    tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    z13 = tmp6 + tmp5;\t\t/* phase 6 */\n    z10 = tmp6 - tmp5;\n    z11 = tmp4 + tmp7;\n    z12 = tmp4 - tmp7;\n\n    tmp7 = z11 + z13;\t\t/* phase 5 */\n    tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); /* 2*c4 */\n\n    z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */\n    tmp10 = ((FAST_FLOAT) 1.082392200) * z12 - z5; /* 2*(c2-c6) */\n    tmp12 = ((FAST_FLOAT) -2.613125930) * z10 + z5; /* -2*(c2+c6) */\n\n    tmp6 = tmp12 - tmp7;\t/* phase 2 */\n    tmp5 = tmp11 - tmp6;\n    tmp4 = tmp10 + tmp5;\n\n    wsptr[DCTSIZE*0] = tmp0 + tmp7;\n    wsptr[DCTSIZE*7] = tmp0 - tmp7;\n    wsptr[DCTSIZE*1] = tmp1 + tmp6;\n    wsptr[DCTSIZE*6] = tmp1 - tmp6;\n    wsptr[DCTSIZE*2] = tmp2 + tmp5;\n    wsptr[DCTSIZE*5] = tmp2 - tmp5;\n    wsptr[DCTSIZE*4] = tmp3 + tmp4;\n    wsptr[DCTSIZE*3] = tmp3 - tmp4;\n\n    inptr++;\t\t\t/* advance pointers to next column */\n    quantptr++;\n    wsptr++;\n  }\n  \n  /* Pass 2: process rows from work array, store into output array. */\n  /* Note that we must descale the results by a factor of 8 == 2**3. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < DCTSIZE; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n    /* Rows of zeroes can be exploited in the same way as we did with columns.\n     * However, the column calculation has created many nonzero AC terms, so\n     * the simplification applies less often (typically 5% to 10% of the time).\n     * And testing floats for zero is relatively expensive, so we don't bother.\n     */\n    \n    /* Even part */\n\n    tmp10 = wsptr[0] + wsptr[4];\n    tmp11 = wsptr[0] - wsptr[4];\n\n    tmp13 = wsptr[2] + wsptr[6];\n    tmp12 = (wsptr[2] - wsptr[6]) * ((FAST_FLOAT) 1.414213562) - tmp13;\n\n    tmp0 = tmp10 + tmp13;\n    tmp3 = tmp10 - tmp13;\n    tmp1 = tmp11 + tmp12;\n    tmp2 = tmp11 - tmp12;\n\n    /* Odd part */\n\n    z13 = wsptr[5] + wsptr[3];\n    z10 = wsptr[5] - wsptr[3];\n    z11 = wsptr[1] + wsptr[7];\n    z12 = wsptr[1] - wsptr[7];\n\n    tmp7 = z11 + z13;\n    tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562);\n\n    z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */\n    tmp10 = ((FAST_FLOAT) 1.082392200) * z12 - z5; /* 2*(c2-c6) */\n    tmp12 = ((FAST_FLOAT) -2.613125930) * z10 + z5; /* -2*(c2+c6) */\n\n    tmp6 = tmp12 - tmp7;\n    tmp5 = tmp11 - tmp6;\n    tmp4 = tmp10 + tmp5;\n\n    /* Final output stage: scale down by a factor of 8 and range-limit */\n\n    outptr[0] = range_limit[(int) DESCALE((INT32) (tmp0 + tmp7), 3)\n\t\t\t    & RANGE_MASK];\n    outptr[7] = range_limit[(int) DESCALE((INT32) (tmp0 - tmp7), 3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) DESCALE((INT32) (tmp1 + tmp6), 3)\n\t\t\t    & RANGE_MASK];\n    outptr[6] = range_limit[(int) DESCALE((INT32) (tmp1 - tmp6), 3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) DESCALE((INT32) (tmp2 + tmp5), 3)\n\t\t\t    & RANGE_MASK];\n    outptr[5] = range_limit[(int) DESCALE((INT32) (tmp2 - tmp5), 3)\n\t\t\t    & RANGE_MASK];\n    outptr[4] = range_limit[(int) DESCALE((INT32) (tmp3 + tmp4), 3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) DESCALE((INT32) (tmp3 - tmp4), 3)\n\t\t\t    & RANGE_MASK];\n    \n    wsptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n}\n\n#endif /* DCT_FLOAT_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/jidctfst.c",
    "content": "/*\n * jidctfst.c\n *\n * Copyright (C) 1994-1998, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains a fast, not so accurate integer implementation of the\n * inverse DCT (Discrete Cosine Transform).  In the IJG code, this routine\n * must also perform dequantization of the input coefficients.\n *\n * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT\n * on each row (or vice versa, but it's more convenient to emit a row at\n * a time).  Direct algorithms are also available, but they are much more\n * complex and seem not to be any faster when reduced to code.\n *\n * This implementation is based on Arai, Agui, and Nakajima's algorithm for\n * scaled DCT.  Their original paper (Trans. IEICE E-71(11):1095) is in\n * Japanese, but the algorithm is described in the Pennebaker & Mitchell\n * JPEG textbook (see REFERENCES section in file README).  The following code\n * is based directly on figure 4-8 in P&M.\n * While an 8-point DCT cannot be done in less than 11 multiplies, it is\n * possible to arrange the computation so that many of the multiplies are\n * simple scalings of the final outputs.  These multiplies can then be\n * folded into the multiplications or divisions by the JPEG quantization\n * table entries.  The AA&N method leaves only 5 multiplies and 29 adds\n * to be done in the DCT itself.\n * The primary disadvantage of this method is that with fixed-point math,\n * accuracy is lost due to imprecise representation of the scaled\n * quantization values.  The smaller the quantization table entry, the less\n * precise the scaled value, so this implementation does worse with high-\n * quality-setting files than with low-quality ones.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"\t\t/* Private declarations for DCT subsystem */\n\n#ifdef DCT_IFAST_SUPPORTED\n\n\n/*\n * This module is specialized to the case DCTSIZE = 8.\n */\n\n#if DCTSIZE != 8\n  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */\n#endif\n\n\n/* Scaling decisions are generally the same as in the LL&M algorithm;\n * see jidctint.c for more details.  However, we choose to descale\n * (right shift) multiplication products as soon as they are formed,\n * rather than carrying additional fractional bits into subsequent additions.\n * This compromises accuracy slightly, but it lets us save a few shifts.\n * More importantly, 16-bit arithmetic is then adequate (for 8-bit samples)\n * everywhere except in the multiplications proper; this saves a good deal\n * of work on 16-bit-int machines.\n *\n * The dequantized coefficients are not integers because the AA&N scaling\n * factors have been incorporated.  We represent them scaled up by PASS1_BITS,\n * so that the first and second IDCT rounds have the same input scaling.\n * For 8-bit JSAMPLEs, we choose IFAST_SCALE_BITS = PASS1_BITS so as to\n * avoid a descaling shift; this compromises accuracy rather drastically\n * for small quantization table entries, but it saves a lot of shifts.\n * For 12-bit JSAMPLEs, there's no hope of using 16x16 multiplies anyway,\n * so we use a much larger scaling factor to preserve accuracy.\n *\n * A final compromise is to represent the multiplicative constants to only\n * 8 fractional bits, rather than 13.  This saves some shifting work on some\n * machines, and may also reduce the cost of multiplication (since there\n * are fewer one-bits in the constants).\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define CONST_BITS  8\n#define PASS1_BITS  2\n#else\n#define CONST_BITS  8\n#define PASS1_BITS  1\t\t/* lose a little precision to avoid overflow */\n#endif\n\n/* Some C compilers fail to reduce \"FIX(constant)\" at compile time, thus\n * causing a lot of useless floating-point operations at run time.\n * To get around this we use the following pre-calculated constants.\n * If you change CONST_BITS you may want to add appropriate values.\n * (With a reasonable C compiler, you can just rely on the FIX() macro...)\n */\n\n#if CONST_BITS == 8\n#define FIX_1_082392200  ((INT32)  277)\t\t/* FIX(1.082392200) */\n#define FIX_1_414213562  ((INT32)  362)\t\t/* FIX(1.414213562) */\n#define FIX_1_847759065  ((INT32)  473)\t\t/* FIX(1.847759065) */\n#define FIX_2_613125930  ((INT32)  669)\t\t/* FIX(2.613125930) */\n#else\n#define FIX_1_082392200  FIX(1.082392200)\n#define FIX_1_414213562  FIX(1.414213562)\n#define FIX_1_847759065  FIX(1.847759065)\n#define FIX_2_613125930  FIX(2.613125930)\n#endif\n\n\n/* We can gain a little more speed, with a further compromise in accuracy,\n * by omitting the addition in a descaling shift.  This yields an incorrectly\n * rounded result half the time...\n */\n\n#ifndef USE_ACCURATE_ROUNDING\n#undef DESCALE\n#define DESCALE(x,n)  RIGHT_SHIFT(x, n)\n#endif\n\n\n/* Multiply a DCTELEM variable by an INT32 constant, and immediately\n * descale to yield a DCTELEM result.\n */\n\n#define MULTIPLY(var,const)  ((DCTELEM) DESCALE((var) * (const), CONST_BITS))\n\n\n/* Dequantize a coefficient by multiplying it by the multiplier-table\n * entry; produce a DCTELEM result.  For 8-bit data a 16x16->16\n * multiplication will do.  For 12-bit data, the multiplier table is\n * declared INT32, so a 32-bit multiply will be used.\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define DEQUANTIZE(coef,quantval)  (((IFAST_MULT_TYPE) (coef)) * (quantval))\n#else\n#define DEQUANTIZE(coef,quantval)  \\\n\tDESCALE((coef)*(quantval), IFAST_SCALE_BITS-PASS1_BITS)\n#endif\n\n\n/* Like DESCALE, but applies to a DCTELEM and produces an int.\n * We assume that int right shift is unsigned if INT32 right shift is.\n */\n\n#ifdef RIGHT_SHIFT_IS_UNSIGNED\n#define ISHIFT_TEMPS\tDCTELEM ishift_temp;\n#if BITS_IN_JSAMPLE == 8\n#define DCTELEMBITS  16\t\t/* DCTELEM may be 16 or 32 bits */\n#else\n#define DCTELEMBITS  32\t\t/* DCTELEM must be 32 bits */\n#endif\n#define IRIGHT_SHIFT(x,shft)  \\\n    ((ishift_temp = (x)) < 0 ? \\\n     (ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (DCTELEMBITS-(shft))) : \\\n     (ishift_temp >> (shft)))\n#else\n#define ISHIFT_TEMPS\n#define IRIGHT_SHIFT(x,shft)\t((x) >> (shft))\n#endif\n\n#ifdef USE_ACCURATE_ROUNDING\n#define IDESCALE(x,n)  ((int) IRIGHT_SHIFT((x) + (1 << ((n)-1)), n))\n#else\n#define IDESCALE(x,n)  ((int) IRIGHT_SHIFT(x, n))\n#endif\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients.\n */\n\nGLOBAL(void)\njpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JCOEFPTR coef_block,\n\t\t JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  DCTELEM tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;\n  DCTELEM tmp10, tmp11, tmp12, tmp13;\n  DCTELEM z5, z10, z11, z12, z13;\n  JCOEFPTR inptr;\n  IFAST_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[DCTSIZE2];\t/* buffers data between passes */\n  SHIFT_TEMPS\t\t\t/* for DESCALE */\n  ISHIFT_TEMPS\t\t\t/* for IDESCALE */\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (IFAST_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = DCTSIZE; ctr > 0; ctr--) {\n    /* Due to quantization, we will usually find that many of the input\n     * coefficients are zero, especially the AC terms.  We can exploit this\n     * by short-circuiting the IDCT calculation for any column in which all\n     * the AC terms are zero.  In that case each output is equal to the\n     * DC coefficient (with scale factor as needed).\n     * With typical images and quantization tables, half or more of the\n     * column DCT calculations can be simplified this way.\n     */\n    \n    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&\n\tinptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&\n\tinptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&\n\tinptr[DCTSIZE*7] == 0) {\n      /* AC terms all zero */\n      int dcval = (int) DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n\n      wsptr[DCTSIZE*0] = dcval;\n      wsptr[DCTSIZE*1] = dcval;\n      wsptr[DCTSIZE*2] = dcval;\n      wsptr[DCTSIZE*3] = dcval;\n      wsptr[DCTSIZE*4] = dcval;\n      wsptr[DCTSIZE*5] = dcval;\n      wsptr[DCTSIZE*6] = dcval;\n      wsptr[DCTSIZE*7] = dcval;\n      \n      inptr++;\t\t\t/* advance pointers to next column */\n      quantptr++;\n      wsptr++;\n      continue;\n    }\n    \n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp10 = tmp0 + tmp2;\t/* phase 3 */\n    tmp11 = tmp0 - tmp2;\n\n    tmp13 = tmp1 + tmp3;\t/* phases 5-3 */\n    tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; /* 2*c4 */\n\n    tmp0 = tmp10 + tmp13;\t/* phase 2 */\n    tmp3 = tmp10 - tmp13;\n    tmp1 = tmp11 + tmp12;\n    tmp2 = tmp11 - tmp12;\n    \n    /* Odd part */\n\n    tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    z13 = tmp6 + tmp5;\t\t/* phase 6 */\n    z10 = tmp6 - tmp5;\n    z11 = tmp4 + tmp7;\n    z12 = tmp4 - tmp7;\n\n    tmp7 = z11 + z13;\t\t/* phase 5 */\n    tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */\n\n    z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */\n    tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */\n    tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */\n\n    tmp6 = tmp12 - tmp7;\t/* phase 2 */\n    tmp5 = tmp11 - tmp6;\n    tmp4 = tmp10 + tmp5;\n\n    wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7);\n    wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7);\n    wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6);\n    wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6);\n    wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5);\n    wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5);\n    wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4);\n    wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4);\n\n    inptr++;\t\t\t/* advance pointers to next column */\n    quantptr++;\n    wsptr++;\n  }\n  \n  /* Pass 2: process rows from work array, store into output array. */\n  /* Note that we must descale the results by a factor of 8 == 2**3, */\n  /* and also undo the PASS1_BITS scaling. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < DCTSIZE; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n    /* Rows of zeroes can be exploited in the same way as we did with columns.\n     * However, the column calculation has created many nonzero AC terms, so\n     * the simplification applies less often (typically 5% to 10% of the time).\n     * On machines with very fast multiplication, it's possible that the\n     * test takes more time than it's worth.  In that case this section\n     * may be commented out.\n     */\n    \n#ifndef NO_ZERO_ROW_TEST\n    if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&\n\twsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {\n      /* AC terms all zero */\n      JSAMPLE dcval = range_limit[IDESCALE(wsptr[0], PASS1_BITS+3)\n\t\t\t\t  & RANGE_MASK];\n      \n      outptr[0] = dcval;\n      outptr[1] = dcval;\n      outptr[2] = dcval;\n      outptr[3] = dcval;\n      outptr[4] = dcval;\n      outptr[5] = dcval;\n      outptr[6] = dcval;\n      outptr[7] = dcval;\n\n      wsptr += DCTSIZE;\t\t/* advance pointer to next row */\n      continue;\n    }\n#endif\n    \n    /* Even part */\n\n    tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]);\n    tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]);\n\n    tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]);\n    tmp12 = MULTIPLY((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6], FIX_1_414213562)\n\t    - tmp13;\n\n    tmp0 = tmp10 + tmp13;\n    tmp3 = tmp10 - tmp13;\n    tmp1 = tmp11 + tmp12;\n    tmp2 = tmp11 - tmp12;\n\n    /* Odd part */\n\n    z13 = (DCTELEM) wsptr[5] + (DCTELEM) wsptr[3];\n    z10 = (DCTELEM) wsptr[5] - (DCTELEM) wsptr[3];\n    z11 = (DCTELEM) wsptr[1] + (DCTELEM) wsptr[7];\n    z12 = (DCTELEM) wsptr[1] - (DCTELEM) wsptr[7];\n\n    tmp7 = z11 + z13;\t\t/* phase 5 */\n    tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */\n\n    z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */\n    tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */\n    tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */\n\n    tmp6 = tmp12 - tmp7;\t/* phase 2 */\n    tmp5 = tmp11 - tmp6;\n    tmp4 = tmp10 + tmp5;\n\n    /* Final output stage: scale down by a factor of 8 and range-limit */\n\n    outptr[0] = range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[7] = range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[4] = range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n}\n\n#endif /* DCT_IFAST_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/jidctint.c",
    "content": "/*\n * jidctint.c\n *\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * Modification developed 2002-2009 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains a slow-but-accurate integer implementation of the\n * inverse DCT (Discrete Cosine Transform).  In the IJG code, this routine\n * must also perform dequantization of the input coefficients.\n *\n * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT\n * on each row (or vice versa, but it's more convenient to emit a row at\n * a time).  Direct algorithms are also available, but they are much more\n * complex and seem not to be any faster when reduced to code.\n *\n * This implementation is based on an algorithm described in\n *   C. Loeffler, A. Ligtenberg and G. Moschytz, \"Practical Fast 1-D DCT\n *   Algorithms with 11 Multiplications\", Proc. Int'l. Conf. on Acoustics,\n *   Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.\n * The primary algorithm described there uses 11 multiplies and 29 adds.\n * We use their alternate method with 12 multiplies and 32 adds.\n * The advantage of this method is that no data path contains more than one\n * multiplication; this allows a very simple and accurate implementation in\n * scaled fixed-point arithmetic, with a minimal number of shifts.\n *\n * We also provide IDCT routines with various output sample block sizes for\n * direct resolution reduction or enlargement without additional resampling:\n * NxN (N=1...16) pixels for one 8x8 input DCT block.\n *\n * For N<8 we simply take the corresponding low-frequency coefficients of\n * the 8x8 input DCT block and apply an NxN point IDCT on the sub-block\n * to yield the downscaled outputs.\n * This can be seen as direct low-pass downsampling from the DCT domain\n * point of view rather than the usual spatial domain point of view,\n * yielding significant computational savings and results at least\n * as good as common bilinear (averaging) spatial downsampling.\n *\n * For N>8 we apply a partial NxN IDCT on the 8 input coefficients as\n * lower frequencies and higher frequencies assumed to be zero.\n * It turns out that the computational effort is similar to the 8x8 IDCT\n * regarding the output size.\n * Furthermore, the scaling and descaling is the same for all IDCT sizes.\n *\n * CAUTION: We rely on the FIX() macro except for the N=1,2,4,8 cases\n * since there would be too many additional constants to pre-calculate.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"\t\t/* Private declarations for DCT subsystem */\n\n#ifdef DCT_ISLOW_SUPPORTED\n\n\n/*\n * This module is specialized to the case DCTSIZE = 8.\n */\n\n#if DCTSIZE != 8\n  Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */\n#endif\n\n\n/*\n * The poop on this scaling stuff is as follows:\n *\n * Each 1-D IDCT step produces outputs which are a factor of sqrt(N)\n * larger than the true IDCT outputs.  The final outputs are therefore\n * a factor of N larger than desired; since N=8 this can be cured by\n * a simple right shift at the end of the algorithm.  The advantage of\n * this arrangement is that we save two multiplications per 1-D IDCT,\n * because the y0 and y4 inputs need not be divided by sqrt(N).\n *\n * We have to do addition and subtraction of the integer inputs, which\n * is no problem, and multiplication by fractional constants, which is\n * a problem to do in integer arithmetic.  We multiply all the constants\n * by CONST_SCALE and convert them to integer constants (thus retaining\n * CONST_BITS bits of precision in the constants).  After doing a\n * multiplication we have to divide the product by CONST_SCALE, with proper\n * rounding, to produce the correct output.  This division can be done\n * cheaply as a right shift of CONST_BITS bits.  We postpone shifting\n * as long as possible so that partial sums can be added together with\n * full fractional precision.\n *\n * The outputs of the first pass are scaled up by PASS1_BITS bits so that\n * they are represented to better-than-integral precision.  These outputs\n * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word\n * with the recommended scaling.  (To scale up 12-bit sample data further, an\n * intermediate INT32 array would be needed.)\n *\n * To avoid overflow of the 32-bit intermediate results in pass 2, we must\n * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26.  Error analysis\n * shows that the values given below are the most effective.\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define CONST_BITS  13\n#define PASS1_BITS  2\n#else\n#define CONST_BITS  13\n#define PASS1_BITS  1\t\t/* lose a little precision to avoid overflow */\n#endif\n\n/* Some C compilers fail to reduce \"FIX(constant)\" at compile time, thus\n * causing a lot of useless floating-point operations at run time.\n * To get around this we use the following pre-calculated constants.\n * If you change CONST_BITS you may want to add appropriate values.\n * (With a reasonable C compiler, you can just rely on the FIX() macro...)\n */\n\n#if CONST_BITS == 13\n#define FIX_0_298631336  ((INT32)  2446)\t/* FIX(0.298631336) */\n#define FIX_0_390180644  ((INT32)  3196)\t/* FIX(0.390180644) */\n#define FIX_0_541196100  ((INT32)  4433)\t/* FIX(0.541196100) */\n#define FIX_0_765366865  ((INT32)  6270)\t/* FIX(0.765366865) */\n#define FIX_0_899976223  ((INT32)  7373)\t/* FIX(0.899976223) */\n#define FIX_1_175875602  ((INT32)  9633)\t/* FIX(1.175875602) */\n#define FIX_1_501321110  ((INT32)  12299)\t/* FIX(1.501321110) */\n#define FIX_1_847759065  ((INT32)  15137)\t/* FIX(1.847759065) */\n#define FIX_1_961570560  ((INT32)  16069)\t/* FIX(1.961570560) */\n#define FIX_2_053119869  ((INT32)  16819)\t/* FIX(2.053119869) */\n#define FIX_2_562915447  ((INT32)  20995)\t/* FIX(2.562915447) */\n#define FIX_3_072711026  ((INT32)  25172)\t/* FIX(3.072711026) */\n#else\n#define FIX_0_298631336  FIX(0.298631336)\n#define FIX_0_390180644  FIX(0.390180644)\n#define FIX_0_541196100  FIX(0.541196100)\n#define FIX_0_765366865  FIX(0.765366865)\n#define FIX_0_899976223  FIX(0.899976223)\n#define FIX_1_175875602  FIX(1.175875602)\n#define FIX_1_501321110  FIX(1.501321110)\n#define FIX_1_847759065  FIX(1.847759065)\n#define FIX_1_961570560  FIX(1.961570560)\n#define FIX_2_053119869  FIX(2.053119869)\n#define FIX_2_562915447  FIX(2.562915447)\n#define FIX_3_072711026  FIX(3.072711026)\n#endif\n\n\n/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.\n * For 8-bit samples with the recommended scaling, all the variable\n * and constant values involved are no more than 16 bits wide, so a\n * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.\n * For 12-bit samples, a full 32-bit multiplication will be needed.\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define MULTIPLY(var,const)  MULTIPLY16C16(var,const)\n#else\n#define MULTIPLY(var,const)  ((var) * (const))\n#endif\n\n\n/* Dequantize a coefficient by multiplying it by the multiplier-table\n * entry; produce an int result.  In this module, both inputs and result\n * are 16 bits or less, so either int or short multiply will work.\n */\n\n#define DEQUANTIZE(coef,quantval)  (((ISLOW_MULT_TYPE) (coef)) * (quantval))\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients.\n */\n\nGLOBAL(void)\njpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JCOEFPTR coef_block,\n\t\t JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3;\n  INT32 tmp10, tmp11, tmp12, tmp13;\n  INT32 z1, z2, z3, z4, z5;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[DCTSIZE2];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n  /* Note results are scaled up by sqrt(8) compared to a true IDCT; */\n  /* furthermore, we scale the results by 2**PASS1_BITS. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = DCTSIZE; ctr > 0; ctr--) {\n    /* Due to quantization, we will usually find that many of the input\n     * coefficients are zero, especially the AC terms.  We can exploit this\n     * by short-circuiting the IDCT calculation for any column in which all\n     * the AC terms are zero.  In that case each output is equal to the\n     * DC coefficient (with scale factor as needed).\n     * With typical images and quantization tables, half or more of the\n     * column DCT calculations can be simplified this way.\n     */\n    \n    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&\n\tinptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&\n\tinptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&\n\tinptr[DCTSIZE*7] == 0) {\n      /* AC terms all zero */\n      int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS;\n      \n      wsptr[DCTSIZE*0] = dcval;\n      wsptr[DCTSIZE*1] = dcval;\n      wsptr[DCTSIZE*2] = dcval;\n      wsptr[DCTSIZE*3] = dcval;\n      wsptr[DCTSIZE*4] = dcval;\n      wsptr[DCTSIZE*5] = dcval;\n      wsptr[DCTSIZE*6] = dcval;\n      wsptr[DCTSIZE*7] = dcval;\n      \n      inptr++;\t\t\t/* advance pointers to next column */\n      quantptr++;\n      wsptr++;\n      continue;\n    }\n    \n    /* Even part: reverse the even part of the forward DCT. */\n    /* The rotator is sqrt(2)*c(-6). */\n    \n    z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n    \n    z1 = MULTIPLY(z2 + z3, FIX_0_541196100);\n    tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065);\n    tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865);\n    \n    z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n\n    tmp0 = (z2 + z3) << CONST_BITS;\n    tmp1 = (z2 - z3) << CONST_BITS;\n    \n    tmp10 = tmp0 + tmp3;\n    tmp13 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp12 = tmp1 - tmp2;\n    \n    /* Odd part per figure 8; the matrix is unitary and hence its\n     * transpose is its inverse.  i0..i3 are y7,y5,y3,y1 respectively.\n     */\n    \n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n    tmp1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    tmp3 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    \n    z1 = tmp0 + tmp3;\n    z2 = tmp1 + tmp2;\n    z3 = tmp0 + tmp2;\n    z4 = tmp1 + tmp3;\n    z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */\n    \n    tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */\n    tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */\n    tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */\n    tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */\n    z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */\n    z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */\n    z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */\n    z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */\n    \n    z3 += z5;\n    z4 += z5;\n    \n    tmp0 += z1 + z3;\n    tmp1 += z2 + z4;\n    tmp2 += z2 + z3;\n    tmp3 += z1 + z4;\n    \n    /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */\n    \n    wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*7] = (int) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*1] = (int) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*6] = (int) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*5] = (int) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*3] = (int) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[DCTSIZE*4] = (int) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS);\n    \n    inptr++;\t\t\t/* advance pointers to next column */\n    quantptr++;\n    wsptr++;\n  }\n  \n  /* Pass 2: process rows from work array, store into output array. */\n  /* Note that we must descale the results by a factor of 8 == 2**3, */\n  /* and also undo the PASS1_BITS scaling. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < DCTSIZE; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n    /* Rows of zeroes can be exploited in the same way as we did with columns.\n     * However, the column calculation has created many nonzero AC terms, so\n     * the simplification applies less often (typically 5% to 10% of the time).\n     * On machines with very fast multiplication, it's possible that the\n     * test takes more time than it's worth.  In that case this section\n     * may be commented out.\n     */\n    \n#ifndef NO_ZERO_ROW_TEST\n    if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&\n\twsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {\n      /* AC terms all zero */\n      JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3)\n\t\t\t\t  & RANGE_MASK];\n      \n      outptr[0] = dcval;\n      outptr[1] = dcval;\n      outptr[2] = dcval;\n      outptr[3] = dcval;\n      outptr[4] = dcval;\n      outptr[5] = dcval;\n      outptr[6] = dcval;\n      outptr[7] = dcval;\n\n      wsptr += DCTSIZE;\t\t/* advance pointer to next row */\n      continue;\n    }\n#endif\n    \n    /* Even part: reverse the even part of the forward DCT. */\n    /* The rotator is sqrt(2)*c(-6). */\n    \n    z2 = (INT32) wsptr[2];\n    z3 = (INT32) wsptr[6];\n    \n    z1 = MULTIPLY(z2 + z3, FIX_0_541196100);\n    tmp2 = z1 + MULTIPLY(z3, - FIX_1_847759065);\n    tmp3 = z1 + MULTIPLY(z2, FIX_0_765366865);\n    \n    tmp0 = ((INT32) wsptr[0] + (INT32) wsptr[4]) << CONST_BITS;\n    tmp1 = ((INT32) wsptr[0] - (INT32) wsptr[4]) << CONST_BITS;\n    \n    tmp10 = tmp0 + tmp3;\n    tmp13 = tmp0 - tmp3;\n    tmp11 = tmp1 + tmp2;\n    tmp12 = tmp1 - tmp2;\n    \n    /* Odd part per figure 8; the matrix is unitary and hence its\n     * transpose is its inverse.  i0..i3 are y7,y5,y3,y1 respectively.\n     */\n    \n    tmp0 = (INT32) wsptr[7];\n    tmp1 = (INT32) wsptr[5];\n    tmp2 = (INT32) wsptr[3];\n    tmp3 = (INT32) wsptr[1];\n    \n    z1 = tmp0 + tmp3;\n    z2 = tmp1 + tmp2;\n    z3 = tmp0 + tmp2;\n    z4 = tmp1 + tmp3;\n    z5 = MULTIPLY(z3 + z4, FIX_1_175875602); /* sqrt(2) * c3 */\n    \n    tmp0 = MULTIPLY(tmp0, FIX_0_298631336); /* sqrt(2) * (-c1+c3+c5-c7) */\n    tmp1 = MULTIPLY(tmp1, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */\n    tmp2 = MULTIPLY(tmp2, FIX_3_072711026); /* sqrt(2) * ( c1+c3+c5-c7) */\n    tmp3 = MULTIPLY(tmp3, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */\n    z1 = MULTIPLY(z1, - FIX_0_899976223); /* sqrt(2) * (c7-c3) */\n    z2 = MULTIPLY(z2, - FIX_2_562915447); /* sqrt(2) * (-c1-c3) */\n    z3 = MULTIPLY(z3, - FIX_1_961570560); /* sqrt(2) * (-c3-c5) */\n    z4 = MULTIPLY(z4, - FIX_0_390180644); /* sqrt(2) * (c5-c3) */\n    \n    z3 += z5;\n    z4 += z5;\n    \n    tmp0 += z1 + z3;\n    tmp1 += z2 + z4;\n    tmp2 += z2 + z3;\n    tmp3 += z1 + z4;\n    \n    /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */\n    \n    outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp3,\n\t\t\t\t\t  CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[7] = range_limit[(int) DESCALE(tmp10 - tmp3,\n\t\t\t\t\t  CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) DESCALE(tmp11 + tmp2,\n\t\t\t\t\t  CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[6] = range_limit[(int) DESCALE(tmp11 - tmp2,\n\t\t\t\t\t  CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) DESCALE(tmp12 + tmp1,\n\t\t\t\t\t  CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[5] = range_limit[(int) DESCALE(tmp12 - tmp1,\n\t\t\t\t\t  CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) DESCALE(tmp13 + tmp0,\n\t\t\t\t\t  CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[4] = range_limit[(int) DESCALE(tmp13 - tmp0,\n\t\t\t\t\t  CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    \n    wsptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n}\n\n#ifdef IDCT_SCALING_SUPPORTED\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 7x7 output block.\n *\n * Optimized algorithm with 12 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/14).\n */\n\nGLOBAL(void)\njpeg_idct_7x7 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp10, tmp11, tmp12, tmp13;\n  INT32 z1, z2, z3;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[7*7];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 7; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp13 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp13 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    tmp13 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp10 = MULTIPLY(z2 - z3, FIX(0.881747734));     /* c4 */\n    tmp12 = MULTIPLY(z1 - z2, FIX(0.314692123));     /* c6 */\n    tmp11 = tmp10 + tmp12 + tmp13 - MULTIPLY(z2, FIX(1.841218003)); /* c2+c4-c6 */\n    tmp0 = z1 + z3;\n    z2 -= tmp0;\n    tmp0 = MULTIPLY(tmp0, FIX(1.274162392)) + tmp13; /* c2 */\n    tmp10 += tmp0 - MULTIPLY(z3, FIX(0.077722536));  /* c2-c4-c6 */\n    tmp12 += tmp0 - MULTIPLY(z1, FIX(2.470602249));  /* c2+c4+c6 */\n    tmp13 += MULTIPLY(z2, FIX(1.414213562));         /* c0 */\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n\n    tmp1 = MULTIPLY(z1 + z2, FIX(0.935414347));      /* (c3+c1-c5)/2 */\n    tmp2 = MULTIPLY(z1 - z2, FIX(0.170262339));      /* (c3+c5-c1)/2 */\n    tmp0 = tmp1 - tmp2;\n    tmp1 += tmp2;\n    tmp2 = MULTIPLY(z2 + z3, - FIX(1.378756276));    /* -c1 */\n    tmp1 += tmp2;\n    z2 = MULTIPLY(z1 + z3, FIX(0.613604268));        /* c5 */\n    tmp0 += z2;\n    tmp2 += z2 + MULTIPLY(z3, FIX(1.870828693));     /* c3+c1-c5 */\n\n    /* Final output stage */\n\n    wsptr[7*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[7*6] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[7*1] = (int) RIGHT_SHIFT(tmp11 + tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[7*5] = (int) RIGHT_SHIFT(tmp11 - tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[7*2] = (int) RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[7*4] = (int) RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[7*3] = (int) RIGHT_SHIFT(tmp13, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 7 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 7; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp13 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp13 <<= CONST_BITS;\n\n    z1 = (INT32) wsptr[2];\n    z2 = (INT32) wsptr[4];\n    z3 = (INT32) wsptr[6];\n\n    tmp10 = MULTIPLY(z2 - z3, FIX(0.881747734));     /* c4 */\n    tmp12 = MULTIPLY(z1 - z2, FIX(0.314692123));     /* c6 */\n    tmp11 = tmp10 + tmp12 + tmp13 - MULTIPLY(z2, FIX(1.841218003)); /* c2+c4-c6 */\n    tmp0 = z1 + z3;\n    z2 -= tmp0;\n    tmp0 = MULTIPLY(tmp0, FIX(1.274162392)) + tmp13; /* c2 */\n    tmp10 += tmp0 - MULTIPLY(z3, FIX(0.077722536));  /* c2-c4-c6 */\n    tmp12 += tmp0 - MULTIPLY(z1, FIX(2.470602249));  /* c2+c4+c6 */\n    tmp13 += MULTIPLY(z2, FIX(1.414213562));         /* c0 */\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n\n    tmp1 = MULTIPLY(z1 + z2, FIX(0.935414347));      /* (c3+c1-c5)/2 */\n    tmp2 = MULTIPLY(z1 - z2, FIX(0.170262339));      /* (c3+c5-c1)/2 */\n    tmp0 = tmp1 - tmp2;\n    tmp1 += tmp2;\n    tmp2 = MULTIPLY(z2 + z3, - FIX(1.378756276));    /* -c1 */\n    tmp1 += tmp2;\n    z2 = MULTIPLY(z1 + z3, FIX(0.613604268));        /* c5 */\n    tmp0 += z2;\n    tmp2 += z2 + MULTIPLY(z3, FIX(1.870828693));     /* c3+c1-c5 */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp13,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += 7;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a reduced-size 6x6 output block.\n *\n * Optimized algorithm with 3 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/12).\n */\n\nGLOBAL(void)\njpeg_idct_6x6 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp10, tmp11, tmp12;\n  INT32 z1, z2, z3;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[6*6];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 6; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp0 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    tmp0 += ONE << (CONST_BITS-PASS1_BITS-1);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    tmp10 = MULTIPLY(tmp2, FIX(0.707106781));   /* c4 */\n    tmp1 = tmp0 + tmp10;\n    tmp11 = RIGHT_SHIFT(tmp0 - tmp10 - tmp10, CONST_BITS-PASS1_BITS);\n    tmp10 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    tmp0 = MULTIPLY(tmp10, FIX(1.224744871));   /* c2 */\n    tmp10 = tmp1 + tmp0;\n    tmp12 = tmp1 - tmp0;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    tmp1 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */\n    tmp0 = tmp1 + ((z1 + z2) << CONST_BITS);\n    tmp2 = tmp1 + ((z3 - z2) << CONST_BITS);\n    tmp1 = (z1 - z2 - z3) << PASS1_BITS;\n\n    /* Final output stage */\n\n    wsptr[6*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[6*5] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[6*1] = (int) (tmp11 + tmp1);\n    wsptr[6*4] = (int) (tmp11 - tmp1);\n    wsptr[6*2] = (int) RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[6*3] = (int) RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 6 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 6; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp0 <<= CONST_BITS;\n    tmp2 = (INT32) wsptr[4];\n    tmp10 = MULTIPLY(tmp2, FIX(0.707106781));   /* c4 */\n    tmp1 = tmp0 + tmp10;\n    tmp11 = tmp0 - tmp10 - tmp10;\n    tmp10 = (INT32) wsptr[2];\n    tmp0 = MULTIPLY(tmp10, FIX(1.224744871));   /* c2 */\n    tmp10 = tmp1 + tmp0;\n    tmp12 = tmp1 - tmp0;\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n    tmp1 = MULTIPLY(z1 + z3, FIX(0.366025404)); /* c5 */\n    tmp0 = tmp1 + ((z1 + z2) << CONST_BITS);\n    tmp2 = tmp1 + ((z3 - z2) << CONST_BITS);\n    tmp1 = (z1 - z2 - z3) << CONST_BITS;\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += 6;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a reduced-size 5x5 output block.\n *\n * Optimized algorithm with 5 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/10).\n */\n\nGLOBAL(void)\njpeg_idct_5x5 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp1, tmp10, tmp11, tmp12;\n  INT32 z1, z2, z3;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[5*5];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 5; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp12 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp12 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    tmp12 += ONE << (CONST_BITS-PASS1_BITS-1);\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    tmp1 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z1 = MULTIPLY(tmp0 + tmp1, FIX(0.790569415)); /* (c2+c4)/2 */\n    z2 = MULTIPLY(tmp0 - tmp1, FIX(0.353553391)); /* (c2-c4)/2 */\n    z3 = tmp12 + z2;\n    tmp10 = z3 + z1;\n    tmp11 = z3 - z1;\n    tmp12 -= z2 << 2;\n\n    /* Odd part */\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n\n    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));     /* c3 */\n    tmp0 = z1 + MULTIPLY(z2, FIX(0.513743148));   /* c1-c3 */\n    tmp1 = z1 - MULTIPLY(z3, FIX(2.176250899));   /* c1+c3 */\n\n    /* Final output stage */\n\n    wsptr[5*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[5*4] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[5*1] = (int) RIGHT_SHIFT(tmp11 + tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[5*3] = (int) RIGHT_SHIFT(tmp11 - tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[5*2] = (int) RIGHT_SHIFT(tmp12, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 5 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 5; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp12 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp12 <<= CONST_BITS;\n    tmp0 = (INT32) wsptr[2];\n    tmp1 = (INT32) wsptr[4];\n    z1 = MULTIPLY(tmp0 + tmp1, FIX(0.790569415)); /* (c2+c4)/2 */\n    z2 = MULTIPLY(tmp0 - tmp1, FIX(0.353553391)); /* (c2-c4)/2 */\n    z3 = tmp12 + z2;\n    tmp10 = z3 + z1;\n    tmp11 = z3 - z1;\n    tmp12 -= z2 << 2;\n\n    /* Odd part */\n\n    z2 = (INT32) wsptr[1];\n    z3 = (INT32) wsptr[3];\n\n    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));     /* c3 */\n    tmp0 = z1 + MULTIPLY(z2, FIX(0.513743148));   /* c1-c3 */\n    tmp1 = z1 - MULTIPLY(z3, FIX(2.176250899));   /* c1+c3 */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += 5;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a reduced-size 3x3 output block.\n *\n * Optimized algorithm with 2 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/6).\n */\n\nGLOBAL(void)\njpeg_idct_3x3 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp2, tmp10, tmp12;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[3*3];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 3; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp0 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    tmp0 += ONE << (CONST_BITS-PASS1_BITS-1);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */\n    tmp10 = tmp0 + tmp12;\n    tmp2 = tmp0 - tmp12 - tmp12;\n\n    /* Odd part */\n\n    tmp12 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    tmp0 = MULTIPLY(tmp12, FIX(1.224744871)); /* c1 */\n\n    /* Final output stage */\n\n    wsptr[3*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[3*2] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[3*1] = (int) RIGHT_SHIFT(tmp2, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 3 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 3; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp0 <<= CONST_BITS;\n    tmp2 = (INT32) wsptr[2];\n    tmp12 = MULTIPLY(tmp2, FIX(0.707106781)); /* c2 */\n    tmp10 = tmp0 + tmp12;\n    tmp2 = tmp0 - tmp12 - tmp12;\n\n    /* Odd part */\n\n    tmp12 = (INT32) wsptr[1];\n    tmp0 = MULTIPLY(tmp12, FIX(1.224744871)); /* c1 */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += 3;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 9x9 output block.\n *\n * Optimized algorithm with 10 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/18).\n */\n\nGLOBAL(void)\njpeg_idct_9x9 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13, tmp14;\n  INT32 z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*9];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp0 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    tmp0 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp3 = MULTIPLY(z3, FIX(0.707106781));      /* c6 */\n    tmp1 = tmp0 + tmp3;\n    tmp2 = tmp0 - tmp3 - tmp3;\n\n    tmp0 = MULTIPLY(z1 - z2, FIX(0.707106781)); /* c6 */\n    tmp11 = tmp2 + tmp0;\n    tmp14 = tmp2 - tmp0 - tmp0;\n\n    tmp0 = MULTIPLY(z1 + z2, FIX(1.328926049)); /* c2 */\n    tmp2 = MULTIPLY(z1, FIX(1.083350441));      /* c4 */\n    tmp3 = MULTIPLY(z2, FIX(0.245575608));      /* c8 */\n\n    tmp10 = tmp1 + tmp0 - tmp3;\n    tmp12 = tmp1 - tmp0 + tmp2;\n    tmp13 = tmp1 - tmp2 + tmp3;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    z2 = MULTIPLY(z2, - FIX(1.224744871));           /* -c3 */\n\n    tmp2 = MULTIPLY(z1 + z3, FIX(0.909038955));      /* c5 */\n    tmp3 = MULTIPLY(z1 + z4, FIX(0.483689525));      /* c7 */\n    tmp0 = tmp2 + tmp3 - z2;\n    tmp1 = MULTIPLY(z3 - z4, FIX(1.392728481));      /* c1 */\n    tmp2 += z2 - tmp1;\n    tmp3 += z2 + tmp1;\n    tmp1 = MULTIPLY(z1 - z3 - z4, FIX(1.224744871)); /* c3 */\n\n    /* Final output stage */\n\n    wsptr[8*0] = (int) RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[8*8] = (int) RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS-PASS1_BITS);\n    wsptr[8*1] = (int) RIGHT_SHIFT(tmp11 + tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[8*7] = (int) RIGHT_SHIFT(tmp11 - tmp1, CONST_BITS-PASS1_BITS);\n    wsptr[8*2] = (int) RIGHT_SHIFT(tmp12 + tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[8*6] = (int) RIGHT_SHIFT(tmp12 - tmp2, CONST_BITS-PASS1_BITS);\n    wsptr[8*3] = (int) RIGHT_SHIFT(tmp13 + tmp3, CONST_BITS-PASS1_BITS);\n    wsptr[8*5] = (int) RIGHT_SHIFT(tmp13 - tmp3, CONST_BITS-PASS1_BITS);\n    wsptr[8*4] = (int) RIGHT_SHIFT(tmp14, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 9 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 9; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp0 <<= CONST_BITS;\n\n    z1 = (INT32) wsptr[2];\n    z2 = (INT32) wsptr[4];\n    z3 = (INT32) wsptr[6];\n\n    tmp3 = MULTIPLY(z3, FIX(0.707106781));      /* c6 */\n    tmp1 = tmp0 + tmp3;\n    tmp2 = tmp0 - tmp3 - tmp3;\n\n    tmp0 = MULTIPLY(z1 - z2, FIX(0.707106781)); /* c6 */\n    tmp11 = tmp2 + tmp0;\n    tmp14 = tmp2 - tmp0 - tmp0;\n\n    tmp0 = MULTIPLY(z1 + z2, FIX(1.328926049)); /* c2 */\n    tmp2 = MULTIPLY(z1, FIX(1.083350441));      /* c4 */\n    tmp3 = MULTIPLY(z2, FIX(0.245575608));      /* c8 */\n\n    tmp10 = tmp1 + tmp0 - tmp3;\n    tmp12 = tmp1 - tmp0 + tmp2;\n    tmp13 = tmp1 - tmp2 + tmp3;\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n    z4 = (INT32) wsptr[7];\n\n    z2 = MULTIPLY(z2, - FIX(1.224744871));           /* -c3 */\n\n    tmp2 = MULTIPLY(z1 + z3, FIX(0.909038955));      /* c5 */\n    tmp3 = MULTIPLY(z1 + z4, FIX(0.483689525));      /* c7 */\n    tmp0 = tmp2 + tmp3 - z2;\n    tmp1 = MULTIPLY(z3 - z4, FIX(1.392728481));      /* c1 */\n    tmp2 += z2 - tmp1;\n    tmp3 += z2 + tmp1;\n    tmp1 = MULTIPLY(z1 - z3 - z4, FIX(1.224744871)); /* c3 */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp10 + tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp10 - tmp0,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp11 + tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp11 - tmp1,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp12 + tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp12 - tmp2,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp13 + tmp3,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp13 - tmp3,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp14,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += 8;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 10x10 output block.\n *\n * Optimized algorithm with 12 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/20).\n */\n\nGLOBAL(void)\njpeg_idct_10x10 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JCOEFPTR coef_block,\n\t\t JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14;\n  INT32 tmp20, tmp21, tmp22, tmp23, tmp24;\n  INT32 z1, z2, z3, z4, z5;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*10];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z3 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    z3 += ONE << (CONST_BITS-PASS1_BITS-1);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z1 = MULTIPLY(z4, FIX(1.144122806));         /* c4 */\n    z2 = MULTIPLY(z4, FIX(0.437016024));         /* c8 */\n    tmp10 = z3 + z1;\n    tmp11 = z3 - z2;\n\n    tmp22 = RIGHT_SHIFT(z3 - ((z1 - z2) << 1),   /* c0 = (c4-c8)*2 */\n\t\t\tCONST_BITS-PASS1_BITS);\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));    /* c6 */\n    tmp12 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c2-c6 */\n    tmp13 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c2+c6 */\n\n    tmp20 = tmp10 + tmp12;\n    tmp24 = tmp10 - tmp12;\n    tmp21 = tmp11 + tmp13;\n    tmp23 = tmp11 - tmp13;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    tmp11 = z2 + z4;\n    tmp13 = z2 - z4;\n\n    tmp12 = MULTIPLY(tmp13, FIX(0.309016994));        /* (c3-c7)/2 */\n    z5 = z3 << CONST_BITS;\n\n    z2 = MULTIPLY(tmp11, FIX(0.951056516));           /* (c3+c7)/2 */\n    z4 = z5 + tmp12;\n\n    tmp10 = MULTIPLY(z1, FIX(1.396802247)) + z2 + z4; /* c1 */\n    tmp14 = MULTIPLY(z1, FIX(0.221231742)) - z2 + z4; /* c9 */\n\n    z2 = MULTIPLY(tmp11, FIX(0.587785252));           /* (c1-c9)/2 */\n    z4 = z5 - tmp12 - (tmp13 << (CONST_BITS - 1));\n\n    tmp12 = (z1 - tmp13 - z3) << PASS1_BITS;\n\n    tmp11 = MULTIPLY(z1, FIX(1.260073511)) - z2 - z4; /* c3 */\n    tmp13 = MULTIPLY(z1, FIX(0.642039522)) - z2 + z4; /* c7 */\n\n    /* Final output stage */\n\n    wsptr[8*0] = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*9] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*1] = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*8] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*2] = (int) (tmp22 + tmp12);\n    wsptr[8*7] = (int) (tmp22 - tmp12);\n    wsptr[8*3] = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*6] = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*4] = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*5] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 10 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 10; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    z3 <<= CONST_BITS;\n    z4 = (INT32) wsptr[4];\n    z1 = MULTIPLY(z4, FIX(1.144122806));         /* c4 */\n    z2 = MULTIPLY(z4, FIX(0.437016024));         /* c8 */\n    tmp10 = z3 + z1;\n    tmp11 = z3 - z2;\n\n    tmp22 = z3 - ((z1 - z2) << 1);               /* c0 = (c4-c8)*2 */\n\n    z2 = (INT32) wsptr[2];\n    z3 = (INT32) wsptr[6];\n\n    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));    /* c6 */\n    tmp12 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c2-c6 */\n    tmp13 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c2+c6 */\n\n    tmp20 = tmp10 + tmp12;\n    tmp24 = tmp10 - tmp12;\n    tmp21 = tmp11 + tmp13;\n    tmp23 = tmp11 - tmp13;\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n    z3 <<= CONST_BITS;\n    z4 = (INT32) wsptr[7];\n\n    tmp11 = z2 + z4;\n    tmp13 = z2 - z4;\n\n    tmp12 = MULTIPLY(tmp13, FIX(0.309016994));        /* (c3-c7)/2 */\n\n    z2 = MULTIPLY(tmp11, FIX(0.951056516));           /* (c3+c7)/2 */\n    z4 = z3 + tmp12;\n\n    tmp10 = MULTIPLY(z1, FIX(1.396802247)) + z2 + z4; /* c1 */\n    tmp14 = MULTIPLY(z1, FIX(0.221231742)) - z2 + z4; /* c9 */\n\n    z2 = MULTIPLY(tmp11, FIX(0.587785252));           /* (c1-c9)/2 */\n    z4 = z3 - tmp12 - (tmp13 << (CONST_BITS - 1));\n\n    tmp12 = ((z1 - tmp13) << CONST_BITS) - z3;\n\n    tmp11 = MULTIPLY(z1, FIX(1.260073511)) - z2 - z4; /* c3 */\n    tmp13 = MULTIPLY(z1, FIX(0.642039522)) - z2 + z4; /* c7 */\n\n    /* Final output stage */\n\n    outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[9] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[8] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[7] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[6] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[4] = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n    outptr[5] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,\n\t\t\t\t\t      CONST_BITS+PASS1_BITS+3)\n\t\t\t    & RANGE_MASK];\n\n    wsptr += 8;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 11x11 output block.\n *\n * Optimized algorithm with 24 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/22).\n */\n\nGLOBAL(void)\njpeg_idct_11x11 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JCOEFPTR coef_block,\n\t\t JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14;\n  INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25;\n  INT32 z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*11];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp10 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp10 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    tmp10 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp20 = MULTIPLY(z2 - z3, FIX(2.546640132));     /* c2+c4 */\n    tmp23 = MULTIPLY(z2 - z1, FIX(0.430815045));     /* c2-c6 */\n    z4 = z1 + z3;\n    tmp24 = MULTIPLY(z4, - FIX(1.155664402));        /* -(c2-c10) */\n    z4 -= z2;\n    tmp25 = tmp10 + MULTIPLY(z4, FIX(1.356927976));  /* c2 */\n    tmp21 = tmp20 + tmp23 + tmp25 -\n\t    MULTIPLY(z2, FIX(1.821790775));          /* c2+c4+c10-c6 */\n    tmp20 += tmp25 + MULTIPLY(z3, FIX(2.115825087)); /* c4+c6 */\n    tmp23 += tmp25 - MULTIPLY(z1, FIX(1.513598477)); /* c6+c8 */\n    tmp24 += tmp25;\n    tmp22 = tmp24 - MULTIPLY(z3, FIX(0.788749120));  /* c8+c10 */\n    tmp24 += MULTIPLY(z2, FIX(1.944413522)) -        /* c2+c8 */\n\t     MULTIPLY(z1, FIX(1.390975730));         /* c4+c10 */\n    tmp25 = tmp10 - MULTIPLY(z4, FIX(1.414213562));  /* c0 */\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    tmp11 = z1 + z2;\n    tmp14 = MULTIPLY(tmp11 + z3 + z4, FIX(0.398430003)); /* c9 */\n    tmp11 = MULTIPLY(tmp11, FIX(0.887983902));           /* c3-c9 */\n    tmp12 = MULTIPLY(z1 + z3, FIX(0.670361295));         /* c5-c9 */\n    tmp13 = tmp14 + MULTIPLY(z1 + z4, FIX(0.366151574)); /* c7-c9 */\n    tmp10 = tmp11 + tmp12 + tmp13 -\n\t    MULTIPLY(z1, FIX(0.923107866));              /* c7+c5+c3-c1-2*c9 */\n    z1    = tmp14 - MULTIPLY(z2 + z3, FIX(1.163011579)); /* c7+c9 */\n    tmp11 += z1 + MULTIPLY(z2, FIX(2.073276588));        /* c1+c7+3*c9-c3 */\n    tmp12 += z1 - MULTIPLY(z3, FIX(1.192193623));        /* c3+c5-c7-c9 */\n    z1    = MULTIPLY(z2 + z4, - FIX(1.798248910));       /* -(c1+c9) */\n    tmp11 += z1;\n    tmp13 += z1 + MULTIPLY(z4, FIX(2.102458632));        /* c1+c5+c9-c7 */\n    tmp14 += MULTIPLY(z2, - FIX(1.467221301)) +          /* -(c5+c9) */\n\t     MULTIPLY(z3, FIX(1.001388905)) -            /* c1-c9 */\n\t     MULTIPLY(z4, FIX(1.684843907));             /* c3+c9 */\n\n    /* Final output stage */\n\n    wsptr[8*0]  = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*10] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*1]  = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*9]  = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*2]  = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*8]  = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*3]  = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*7]  = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*4]  = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*6]  = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*5]  = (int) RIGHT_SHIFT(tmp25, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 11 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 11; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp10 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp10 <<= CONST_BITS;\n\n    z1 = (INT32) wsptr[2];\n    z2 = (INT32) wsptr[4];\n    z3 = (INT32) wsptr[6];\n\n    tmp20 = MULTIPLY(z2 - z3, FIX(2.546640132));     /* c2+c4 */\n    tmp23 = MULTIPLY(z2 - z1, FIX(0.430815045));     /* c2-c6 */\n    z4 = z1 + z3;\n    tmp24 = MULTIPLY(z4, - FIX(1.155664402));        /* -(c2-c10) */\n    z4 -= z2;\n    tmp25 = tmp10 + MULTIPLY(z4, FIX(1.356927976));  /* c2 */\n    tmp21 = tmp20 + tmp23 + tmp25 -\n\t    MULTIPLY(z2, FIX(1.821790775));          /* c2+c4+c10-c6 */\n    tmp20 += tmp25 + MULTIPLY(z3, FIX(2.115825087)); /* c4+c6 */\n    tmp23 += tmp25 - MULTIPLY(z1, FIX(1.513598477)); /* c6+c8 */\n    tmp24 += tmp25;\n    tmp22 = tmp24 - MULTIPLY(z3, FIX(0.788749120));  /* c8+c10 */\n    tmp24 += MULTIPLY(z2, FIX(1.944413522)) -        /* c2+c8 */\n\t     MULTIPLY(z1, FIX(1.390975730));         /* c4+c10 */\n    tmp25 = tmp10 - MULTIPLY(z4, FIX(1.414213562));  /* c0 */\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n    z4 = (INT32) wsptr[7];\n\n    tmp11 = z1 + z2;\n    tmp14 = MULTIPLY(tmp11 + z3 + z4, FIX(0.398430003)); /* c9 */\n    tmp11 = MULTIPLY(tmp11, FIX(0.887983902));           /* c3-c9 */\n    tmp12 = MULTIPLY(z1 + z3, FIX(0.670361295));         /* c5-c9 */\n    tmp13 = tmp14 + MULTIPLY(z1 + z4, FIX(0.366151574)); /* c7-c9 */\n    tmp10 = tmp11 + tmp12 + tmp13 -\n\t    MULTIPLY(z1, FIX(0.923107866));              /* c7+c5+c3-c1-2*c9 */\n    z1    = tmp14 - MULTIPLY(z2 + z3, FIX(1.163011579)); /* c7+c9 */\n    tmp11 += z1 + MULTIPLY(z2, FIX(2.073276588));        /* c1+c7+3*c9-c3 */\n    tmp12 += z1 - MULTIPLY(z3, FIX(1.192193623));        /* c3+c5-c7-c9 */\n    z1    = MULTIPLY(z2 + z4, - FIX(1.798248910));       /* -(c1+c9) */\n    tmp11 += z1;\n    tmp13 += z1 + MULTIPLY(z4, FIX(2.102458632));        /* c1+c5+c9-c7 */\n    tmp14 += MULTIPLY(z2, - FIX(1.467221301)) +          /* -(c5+c9) */\n\t     MULTIPLY(z3, FIX(1.001388905)) -            /* c1-c9 */\n\t     MULTIPLY(z4, FIX(1.684843907));             /* c3+c9 */\n\n    /* Final output stage */\n\n    outptr[0]  = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[1]  = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[9]  = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[2]  = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[8]  = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[3]  = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[7]  = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[4]  = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[6]  = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[5]  = range_limit[(int) RIGHT_SHIFT(tmp25,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n\n    wsptr += 8;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 12x12 output block.\n *\n * Optimized algorithm with 15 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/24).\n */\n\nGLOBAL(void)\njpeg_idct_12x12 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JCOEFPTR coef_block,\n\t\t JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;\n  INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25;\n  INT32 z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*12];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    z3 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z3 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    z3 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z4 = MULTIPLY(z4, FIX(1.224744871)); /* c4 */\n\n    tmp10 = z3 + z4;\n    tmp11 = z3 - z4;\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z4 = MULTIPLY(z1, FIX(1.366025404)); /* c2 */\n    z1 <<= CONST_BITS;\n    z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n    z2 <<= CONST_BITS;\n\n    tmp12 = z1 - z2;\n\n    tmp21 = z3 + tmp12;\n    tmp24 = z3 - tmp12;\n\n    tmp12 = z4 + z2;\n\n    tmp20 = tmp10 + tmp12;\n    tmp25 = tmp10 - tmp12;\n\n    tmp12 = z4 - z1 - z2;\n\n    tmp22 = tmp11 + tmp12;\n    tmp23 = tmp11 - tmp12;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    tmp11 = MULTIPLY(z2, FIX(1.306562965));                  /* c3 */\n    tmp14 = MULTIPLY(z2, - FIX_0_541196100);                 /* -c9 */\n\n    tmp10 = z1 + z3;\n    tmp15 = MULTIPLY(tmp10 + z4, FIX(0.860918669));          /* c7 */\n    tmp12 = tmp15 + MULTIPLY(tmp10, FIX(0.261052384));       /* c5-c7 */\n    tmp10 = tmp12 + tmp11 + MULTIPLY(z1, FIX(0.280143716));  /* c1-c5 */\n    tmp13 = MULTIPLY(z3 + z4, - FIX(1.045510580));           /* -(c7+c11) */\n    tmp12 += tmp13 + tmp14 - MULTIPLY(z3, FIX(1.478575242)); /* c1+c5-c7-c11 */\n    tmp13 += tmp15 - tmp11 + MULTIPLY(z4, FIX(1.586706681)); /* c1+c11 */\n    tmp15 += tmp14 - MULTIPLY(z1, FIX(0.676326758)) -        /* c7-c11 */\n\t     MULTIPLY(z4, FIX(1.982889723));                 /* c5+c7 */\n\n    z1 -= z4;\n    z2 -= z3;\n    z3 = MULTIPLY(z1 + z2, FIX_0_541196100);                 /* c9 */\n    tmp11 = z3 + MULTIPLY(z1, FIX_0_765366865);              /* c3-c9 */\n    tmp14 = z3 - MULTIPLY(z2, FIX_1_847759065);              /* c3+c9 */\n\n    /* Final output stage */\n\n    wsptr[8*0]  = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*11] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*1]  = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*10] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*2]  = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*9]  = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*3]  = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*8]  = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*4]  = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*7]  = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*5]  = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[8*6]  = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 12 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 12; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    z3 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    z3 <<= CONST_BITS;\n\n    z4 = (INT32) wsptr[4];\n    z4 = MULTIPLY(z4, FIX(1.224744871)); /* c4 */\n\n    tmp10 = z3 + z4;\n    tmp11 = z3 - z4;\n\n    z1 = (INT32) wsptr[2];\n    z4 = MULTIPLY(z1, FIX(1.366025404)); /* c2 */\n    z1 <<= CONST_BITS;\n    z2 = (INT32) wsptr[6];\n    z2 <<= CONST_BITS;\n\n    tmp12 = z1 - z2;\n\n    tmp21 = z3 + tmp12;\n    tmp24 = z3 - tmp12;\n\n    tmp12 = z4 + z2;\n\n    tmp20 = tmp10 + tmp12;\n    tmp25 = tmp10 - tmp12;\n\n    tmp12 = z4 - z1 - z2;\n\n    tmp22 = tmp11 + tmp12;\n    tmp23 = tmp11 - tmp12;\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n    z4 = (INT32) wsptr[7];\n\n    tmp11 = MULTIPLY(z2, FIX(1.306562965));                  /* c3 */\n    tmp14 = MULTIPLY(z2, - FIX_0_541196100);                 /* -c9 */\n\n    tmp10 = z1 + z3;\n    tmp15 = MULTIPLY(tmp10 + z4, FIX(0.860918669));          /* c7 */\n    tmp12 = tmp15 + MULTIPLY(tmp10, FIX(0.261052384));       /* c5-c7 */\n    tmp10 = tmp12 + tmp11 + MULTIPLY(z1, FIX(0.280143716));  /* c1-c5 */\n    tmp13 = MULTIPLY(z3 + z4, - FIX(1.045510580));           /* -(c7+c11) */\n    tmp12 += tmp13 + tmp14 - MULTIPLY(z3, FIX(1.478575242)); /* c1+c5-c7-c11 */\n    tmp13 += tmp15 - tmp11 + MULTIPLY(z4, FIX(1.586706681)); /* c1+c11 */\n    tmp15 += tmp14 - MULTIPLY(z1, FIX(0.676326758)) -        /* c7-c11 */\n\t     MULTIPLY(z4, FIX(1.982889723));                 /* c5+c7 */\n\n    z1 -= z4;\n    z2 -= z3;\n    z3 = MULTIPLY(z1 + z2, FIX_0_541196100);                 /* c9 */\n    tmp11 = z3 + MULTIPLY(z1, FIX_0_765366865);              /* c3-c9 */\n    tmp14 = z3 - MULTIPLY(z2, FIX_1_847759065);              /* c3+c9 */\n\n    /* Final output stage */\n\n    outptr[0]  = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[1]  = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[2]  = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[9]  = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[3]  = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[8]  = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[4]  = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[7]  = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[5]  = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[6]  = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n\n    wsptr += 8;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 13x13 output block.\n *\n * Optimized algorithm with 29 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/26).\n */\n\nGLOBAL(void)\njpeg_idct_13x13 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JCOEFPTR coef_block,\n\t\t JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;\n  INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26;\n  INT32 z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*13];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z1 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    z1 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp10 = z3 + z4;\n    tmp11 = z3 - z4;\n\n    tmp12 = MULTIPLY(tmp10, FIX(1.155388986));                /* (c4+c6)/2 */\n    tmp13 = MULTIPLY(tmp11, FIX(0.096834934)) + z1;           /* (c4-c6)/2 */\n\n    tmp20 = MULTIPLY(z2, FIX(1.373119086)) + tmp12 + tmp13;   /* c2 */\n    tmp22 = MULTIPLY(z2, FIX(0.501487041)) - tmp12 + tmp13;   /* c10 */\n\n    tmp12 = MULTIPLY(tmp10, FIX(0.316450131));                /* (c8-c12)/2 */\n    tmp13 = MULTIPLY(tmp11, FIX(0.486914739)) + z1;           /* (c8+c12)/2 */\n\n    tmp21 = MULTIPLY(z2, FIX(1.058554052)) - tmp12 + tmp13;   /* c6 */\n    tmp25 = MULTIPLY(z2, - FIX(1.252223920)) + tmp12 + tmp13; /* c4 */\n\n    tmp12 = MULTIPLY(tmp10, FIX(0.435816023));                /* (c2-c10)/2 */\n    tmp13 = MULTIPLY(tmp11, FIX(0.937303064)) - z1;           /* (c2+c10)/2 */\n\n    tmp23 = MULTIPLY(z2, - FIX(0.170464608)) - tmp12 - tmp13; /* c12 */\n    tmp24 = MULTIPLY(z2, - FIX(0.803364869)) + tmp12 - tmp13; /* c8 */\n\n    tmp26 = MULTIPLY(tmp11 - z2, FIX(1.414213562)) + z1;      /* c0 */\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    tmp11 = MULTIPLY(z1 + z2, FIX(1.322312651));     /* c3 */\n    tmp12 = MULTIPLY(z1 + z3, FIX(1.163874945));     /* c5 */\n    tmp15 = z1 + z4;\n    tmp13 = MULTIPLY(tmp15, FIX(0.937797057));       /* c7 */\n    tmp10 = tmp11 + tmp12 + tmp13 -\n\t    MULTIPLY(z1, FIX(2.020082300));          /* c7+c5+c3-c1 */\n    tmp14 = MULTIPLY(z2 + z3, - FIX(0.338443458));   /* -c11 */\n    tmp11 += tmp14 + MULTIPLY(z2, FIX(0.837223564)); /* c5+c9+c11-c3 */\n    tmp12 += tmp14 - MULTIPLY(z3, FIX(1.572116027)); /* c1+c5-c9-c11 */\n    tmp14 = MULTIPLY(z2 + z4, - FIX(1.163874945));   /* -c5 */\n    tmp11 += tmp14;\n    tmp13 += tmp14 + MULTIPLY(z4, FIX(2.205608352)); /* c3+c5+c9-c7 */\n    tmp14 = MULTIPLY(z3 + z4, - FIX(0.657217813));   /* -c9 */\n    tmp12 += tmp14;\n    tmp13 += tmp14;\n    tmp15 = MULTIPLY(tmp15, FIX(0.338443458));       /* c11 */\n    tmp14 = tmp15 + MULTIPLY(z1, FIX(0.318774355)) - /* c9-c11 */\n\t    MULTIPLY(z2, FIX(0.466105296));          /* c1-c7 */\n    z1    = MULTIPLY(z3 - z2, FIX(0.937797057));     /* c7 */\n    tmp14 += z1;\n    tmp15 += z1 + MULTIPLY(z3, FIX(0.384515595)) -   /* c3-c7 */\n\t     MULTIPLY(z4, FIX(1.742345811));         /* c1+c11 */\n\n    /* Final output stage */\n\n    wsptr[8*0]  = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*12] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*1]  = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*11] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*2]  = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*10] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*3]  = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*9]  = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*4]  = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*8]  = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*5]  = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[8*7]  = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[8*6]  = (int) RIGHT_SHIFT(tmp26, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 13 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 13; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    z1 <<= CONST_BITS;\n\n    z2 = (INT32) wsptr[2];\n    z3 = (INT32) wsptr[4];\n    z4 = (INT32) wsptr[6];\n\n    tmp10 = z3 + z4;\n    tmp11 = z3 - z4;\n\n    tmp12 = MULTIPLY(tmp10, FIX(1.155388986));                /* (c4+c6)/2 */\n    tmp13 = MULTIPLY(tmp11, FIX(0.096834934)) + z1;           /* (c4-c6)/2 */\n\n    tmp20 = MULTIPLY(z2, FIX(1.373119086)) + tmp12 + tmp13;   /* c2 */\n    tmp22 = MULTIPLY(z2, FIX(0.501487041)) - tmp12 + tmp13;   /* c10 */\n\n    tmp12 = MULTIPLY(tmp10, FIX(0.316450131));                /* (c8-c12)/2 */\n    tmp13 = MULTIPLY(tmp11, FIX(0.486914739)) + z1;           /* (c8+c12)/2 */\n\n    tmp21 = MULTIPLY(z2, FIX(1.058554052)) - tmp12 + tmp13;   /* c6 */\n    tmp25 = MULTIPLY(z2, - FIX(1.252223920)) + tmp12 + tmp13; /* c4 */\n\n    tmp12 = MULTIPLY(tmp10, FIX(0.435816023));                /* (c2-c10)/2 */\n    tmp13 = MULTIPLY(tmp11, FIX(0.937303064)) - z1;           /* (c2+c10)/2 */\n\n    tmp23 = MULTIPLY(z2, - FIX(0.170464608)) - tmp12 - tmp13; /* c12 */\n    tmp24 = MULTIPLY(z2, - FIX(0.803364869)) + tmp12 - tmp13; /* c8 */\n\n    tmp26 = MULTIPLY(tmp11 - z2, FIX(1.414213562)) + z1;      /* c0 */\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n    z4 = (INT32) wsptr[7];\n\n    tmp11 = MULTIPLY(z1 + z2, FIX(1.322312651));     /* c3 */\n    tmp12 = MULTIPLY(z1 + z3, FIX(1.163874945));     /* c5 */\n    tmp15 = z1 + z4;\n    tmp13 = MULTIPLY(tmp15, FIX(0.937797057));       /* c7 */\n    tmp10 = tmp11 + tmp12 + tmp13 -\n\t    MULTIPLY(z1, FIX(2.020082300));          /* c7+c5+c3-c1 */\n    tmp14 = MULTIPLY(z2 + z3, - FIX(0.338443458));   /* -c11 */\n    tmp11 += tmp14 + MULTIPLY(z2, FIX(0.837223564)); /* c5+c9+c11-c3 */\n    tmp12 += tmp14 - MULTIPLY(z3, FIX(1.572116027)); /* c1+c5-c9-c11 */\n    tmp14 = MULTIPLY(z2 + z4, - FIX(1.163874945));   /* -c5 */\n    tmp11 += tmp14;\n    tmp13 += tmp14 + MULTIPLY(z4, FIX(2.205608352)); /* c3+c5+c9-c7 */\n    tmp14 = MULTIPLY(z3 + z4, - FIX(0.657217813));   /* -c9 */\n    tmp12 += tmp14;\n    tmp13 += tmp14;\n    tmp15 = MULTIPLY(tmp15, FIX(0.338443458));       /* c11 */\n    tmp14 = tmp15 + MULTIPLY(z1, FIX(0.318774355)) - /* c9-c11 */\n\t    MULTIPLY(z2, FIX(0.466105296));          /* c1-c7 */\n    z1    = MULTIPLY(z3 - z2, FIX(0.937797057));     /* c7 */\n    tmp14 += z1;\n    tmp15 += z1 + MULTIPLY(z3, FIX(0.384515595)) -   /* c3-c7 */\n\t     MULTIPLY(z4, FIX(1.742345811));         /* c1+c11 */\n\n    /* Final output stage */\n\n    outptr[0]  = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[1]  = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[2]  = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[3]  = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[9]  = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[4]  = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[8]  = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[5]  = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[7]  = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[6]  = range_limit[(int) RIGHT_SHIFT(tmp26,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n\n    wsptr += 8;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 14x14 output block.\n *\n * Optimized algorithm with 20 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/28).\n */\n\nGLOBAL(void)\njpeg_idct_14x14 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JCOEFPTR coef_block,\n\t\t JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;\n  INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26;\n  INT32 z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*14];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z1 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    z1 += ONE << (CONST_BITS-PASS1_BITS-1);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z2 = MULTIPLY(z4, FIX(1.274162392));         /* c4 */\n    z3 = MULTIPLY(z4, FIX(0.314692123));         /* c12 */\n    z4 = MULTIPLY(z4, FIX(0.881747734));         /* c8 */\n\n    tmp10 = z1 + z2;\n    tmp11 = z1 + z3;\n    tmp12 = z1 - z4;\n\n    tmp23 = RIGHT_SHIFT(z1 - ((z2 + z3 - z4) << 1), /* c0 = (c4+c12-c8)*2 */\n\t\t\tCONST_BITS-PASS1_BITS);\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    z3 = MULTIPLY(z1 + z2, FIX(1.105676686));    /* c6 */\n\n    tmp13 = z3 + MULTIPLY(z1, FIX(0.273079590)); /* c2-c6 */\n    tmp14 = z3 - MULTIPLY(z2, FIX(1.719280954)); /* c6+c10 */\n    tmp15 = MULTIPLY(z1, FIX(0.613604268)) -     /* c10 */\n\t    MULTIPLY(z2, FIX(1.378756276));      /* c2 */\n\n    tmp20 = tmp10 + tmp13;\n    tmp26 = tmp10 - tmp13;\n    tmp21 = tmp11 + tmp14;\n    tmp25 = tmp11 - tmp14;\n    tmp22 = tmp12 + tmp15;\n    tmp24 = tmp12 - tmp15;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n    tmp13 = z4 << CONST_BITS;\n\n    tmp14 = z1 + z3;\n    tmp11 = MULTIPLY(z1 + z2, FIX(1.334852607));           /* c3 */\n    tmp12 = MULTIPLY(tmp14, FIX(1.197448846));             /* c5 */\n    tmp10 = tmp11 + tmp12 + tmp13 - MULTIPLY(z1, FIX(1.126980169)); /* c3+c5-c1 */\n    tmp14 = MULTIPLY(tmp14, FIX(0.752406978));             /* c9 */\n    tmp16 = tmp14 - MULTIPLY(z1, FIX(1.061150426));        /* c9+c11-c13 */\n    z1    -= z2;\n    tmp15 = MULTIPLY(z1, FIX(0.467085129)) - tmp13;        /* c11 */\n    tmp16 += tmp15;\n    z1    += z4;\n    z4    = MULTIPLY(z2 + z3, - FIX(0.158341681)) - tmp13; /* -c13 */\n    tmp11 += z4 - MULTIPLY(z2, FIX(0.424103948));          /* c3-c9-c13 */\n    tmp12 += z4 - MULTIPLY(z3, FIX(2.373959773));          /* c3+c5-c13 */\n    z4    = MULTIPLY(z3 - z2, FIX(1.405321284));           /* c1 */\n    tmp14 += z4 + tmp13 - MULTIPLY(z3, FIX(1.6906431334)); /* c1+c9-c11 */\n    tmp15 += z4 + MULTIPLY(z2, FIX(0.674957567));          /* c1+c11-c5 */\n\n    tmp13 = (z1 - z3) << PASS1_BITS;\n\n    /* Final output stage */\n\n    wsptr[8*0]  = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*13] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*1]  = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*12] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*2]  = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*11] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*3]  = (int) (tmp23 + tmp13);\n    wsptr[8*10] = (int) (tmp23 - tmp13);\n    wsptr[8*4]  = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*9]  = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*5]  = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[8*8]  = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[8*6]  = (int) RIGHT_SHIFT(tmp26 + tmp16, CONST_BITS-PASS1_BITS);\n    wsptr[8*7]  = (int) RIGHT_SHIFT(tmp26 - tmp16, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 14 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 14; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    z1 <<= CONST_BITS;\n    z4 = (INT32) wsptr[4];\n    z2 = MULTIPLY(z4, FIX(1.274162392));         /* c4 */\n    z3 = MULTIPLY(z4, FIX(0.314692123));         /* c12 */\n    z4 = MULTIPLY(z4, FIX(0.881747734));         /* c8 */\n\n    tmp10 = z1 + z2;\n    tmp11 = z1 + z3;\n    tmp12 = z1 - z4;\n\n    tmp23 = z1 - ((z2 + z3 - z4) << 1);          /* c0 = (c4+c12-c8)*2 */\n\n    z1 = (INT32) wsptr[2];\n    z2 = (INT32) wsptr[6];\n\n    z3 = MULTIPLY(z1 + z2, FIX(1.105676686));    /* c6 */\n\n    tmp13 = z3 + MULTIPLY(z1, FIX(0.273079590)); /* c2-c6 */\n    tmp14 = z3 - MULTIPLY(z2, FIX(1.719280954)); /* c6+c10 */\n    tmp15 = MULTIPLY(z1, FIX(0.613604268)) -     /* c10 */\n\t    MULTIPLY(z2, FIX(1.378756276));      /* c2 */\n\n    tmp20 = tmp10 + tmp13;\n    tmp26 = tmp10 - tmp13;\n    tmp21 = tmp11 + tmp14;\n    tmp25 = tmp11 - tmp14;\n    tmp22 = tmp12 + tmp15;\n    tmp24 = tmp12 - tmp15;\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n    z4 = (INT32) wsptr[7];\n    z4 <<= CONST_BITS;\n\n    tmp14 = z1 + z3;\n    tmp11 = MULTIPLY(z1 + z2, FIX(1.334852607));           /* c3 */\n    tmp12 = MULTIPLY(tmp14, FIX(1.197448846));             /* c5 */\n    tmp10 = tmp11 + tmp12 + z4 - MULTIPLY(z1, FIX(1.126980169)); /* c3+c5-c1 */\n    tmp14 = MULTIPLY(tmp14, FIX(0.752406978));             /* c9 */\n    tmp16 = tmp14 - MULTIPLY(z1, FIX(1.061150426));        /* c9+c11-c13 */\n    z1    -= z2;\n    tmp15 = MULTIPLY(z1, FIX(0.467085129)) - z4;           /* c11 */\n    tmp16 += tmp15;\n    tmp13 = MULTIPLY(z2 + z3, - FIX(0.158341681)) - z4;    /* -c13 */\n    tmp11 += tmp13 - MULTIPLY(z2, FIX(0.424103948));       /* c3-c9-c13 */\n    tmp12 += tmp13 - MULTIPLY(z3, FIX(2.373959773));       /* c3+c5-c13 */\n    tmp13 = MULTIPLY(z3 - z2, FIX(1.405321284));           /* c1 */\n    tmp14 += tmp13 + z4 - MULTIPLY(z3, FIX(1.6906431334)); /* c1+c9-c11 */\n    tmp15 += tmp13 + MULTIPLY(z2, FIX(0.674957567));       /* c1+c11-c5 */\n\n    tmp13 = ((z1 - z3) << CONST_BITS) + z4;\n\n    /* Final output stage */\n\n    outptr[0]  = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[13] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[1]  = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[2]  = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[3]  = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[4]  = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[9]  = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[5]  = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[8]  = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[6]  = range_limit[(int) RIGHT_SHIFT(tmp26 + tmp16,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[7]  = range_limit[(int) RIGHT_SHIFT(tmp26 - tmp16,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n\n    wsptr += 8;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 15x15 output block.\n *\n * Optimized algorithm with 22 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/30).\n */\n\nGLOBAL(void)\njpeg_idct_15x15 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JCOEFPTR coef_block,\n\t\t JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp10, tmp11, tmp12, tmp13, tmp14, tmp15, tmp16;\n  INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;\n  INT32 z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*15];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    z1 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    z1 += ONE << (CONST_BITS-PASS1_BITS-1);\n\n    z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp10 = MULTIPLY(z4, FIX(0.437016024)); /* c12 */\n    tmp11 = MULTIPLY(z4, FIX(1.144122806)); /* c6 */\n\n    tmp12 = z1 - tmp10;\n    tmp13 = z1 + tmp11;\n    z1 -= (tmp11 - tmp10) << 1;             /* c0 = (c6-c12)*2 */\n\n    z4 = z2 - z3;\n    z3 += z2;\n    tmp10 = MULTIPLY(z3, FIX(1.337628990)); /* (c2+c4)/2 */\n    tmp11 = MULTIPLY(z4, FIX(0.045680613)); /* (c2-c4)/2 */\n    z2 = MULTIPLY(z2, FIX(1.439773946));    /* c4+c14 */\n\n    tmp20 = tmp13 + tmp10 + tmp11;\n    tmp23 = tmp12 - tmp10 + tmp11 + z2;\n\n    tmp10 = MULTIPLY(z3, FIX(0.547059574)); /* (c8+c14)/2 */\n    tmp11 = MULTIPLY(z4, FIX(0.399234004)); /* (c8-c14)/2 */\n\n    tmp25 = tmp13 - tmp10 - tmp11;\n    tmp26 = tmp12 + tmp10 - tmp11 - z2;\n\n    tmp10 = MULTIPLY(z3, FIX(0.790569415)); /* (c6+c12)/2 */\n    tmp11 = MULTIPLY(z4, FIX(0.353553391)); /* (c6-c12)/2 */\n\n    tmp21 = tmp12 + tmp10 + tmp11;\n    tmp24 = tmp13 - tmp10 + tmp11;\n    tmp11 += tmp11;\n    tmp22 = z1 + tmp11;                     /* c10 = c6-c12 */\n    tmp27 = z1 - tmp11 - tmp11;             /* c0 = (c6-c12)*2 */\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z3 = MULTIPLY(z4, FIX(1.224744871));                    /* c5 */\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    tmp13 = z2 - z4;\n    tmp15 = MULTIPLY(z1 + tmp13, FIX(0.831253876));         /* c9 */\n    tmp11 = tmp15 + MULTIPLY(z1, FIX(0.513743148));         /* c3-c9 */\n    tmp14 = tmp15 - MULTIPLY(tmp13, FIX(2.176250899));      /* c3+c9 */\n\n    tmp13 = MULTIPLY(z2, - FIX(0.831253876));               /* -c9 */\n    tmp15 = MULTIPLY(z2, - FIX(1.344997024));               /* -c3 */\n    z2 = z1 - z4;\n    tmp12 = z3 + MULTIPLY(z2, FIX(1.406466353));            /* c1 */\n\n    tmp10 = tmp12 + MULTIPLY(z4, FIX(2.457431844)) - tmp15; /* c1+c7 */\n    tmp16 = tmp12 - MULTIPLY(z1, FIX(1.112434820)) + tmp13; /* c1-c13 */\n    tmp12 = MULTIPLY(z2, FIX(1.224744871)) - z3;            /* c5 */\n    z2 = MULTIPLY(z1 + z4, FIX(0.575212477));               /* c11 */\n    tmp13 += z2 + MULTIPLY(z1, FIX(0.475753014)) - z3;      /* c7-c11 */\n    tmp15 += z2 - MULTIPLY(z4, FIX(0.869244010)) + z3;      /* c11+c13 */\n\n    /* Final output stage */\n\n    wsptr[8*0]  = (int) RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*14] = (int) RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*1]  = (int) RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*13] = (int) RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*2]  = (int) RIGHT_SHIFT(tmp22 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*12] = (int) RIGHT_SHIFT(tmp22 - tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*3]  = (int) RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*11] = (int) RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*4]  = (int) RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*10] = (int) RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS-PASS1_BITS);\n    wsptr[8*5]  = (int) RIGHT_SHIFT(tmp25 + tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[8*9]  = (int) RIGHT_SHIFT(tmp25 - tmp15, CONST_BITS-PASS1_BITS);\n    wsptr[8*6]  = (int) RIGHT_SHIFT(tmp26 + tmp16, CONST_BITS-PASS1_BITS);\n    wsptr[8*8]  = (int) RIGHT_SHIFT(tmp26 - tmp16, CONST_BITS-PASS1_BITS);\n    wsptr[8*7]  = (int) RIGHT_SHIFT(tmp27, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 15 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 15; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    z1 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    z1 <<= CONST_BITS;\n\n    z2 = (INT32) wsptr[2];\n    z3 = (INT32) wsptr[4];\n    z4 = (INT32) wsptr[6];\n\n    tmp10 = MULTIPLY(z4, FIX(0.437016024)); /* c12 */\n    tmp11 = MULTIPLY(z4, FIX(1.144122806)); /* c6 */\n\n    tmp12 = z1 - tmp10;\n    tmp13 = z1 + tmp11;\n    z1 -= (tmp11 - tmp10) << 1;             /* c0 = (c6-c12)*2 */\n\n    z4 = z2 - z3;\n    z3 += z2;\n    tmp10 = MULTIPLY(z3, FIX(1.337628990)); /* (c2+c4)/2 */\n    tmp11 = MULTIPLY(z4, FIX(0.045680613)); /* (c2-c4)/2 */\n    z2 = MULTIPLY(z2, FIX(1.439773946));    /* c4+c14 */\n\n    tmp20 = tmp13 + tmp10 + tmp11;\n    tmp23 = tmp12 - tmp10 + tmp11 + z2;\n\n    tmp10 = MULTIPLY(z3, FIX(0.547059574)); /* (c8+c14)/2 */\n    tmp11 = MULTIPLY(z4, FIX(0.399234004)); /* (c8-c14)/2 */\n\n    tmp25 = tmp13 - tmp10 - tmp11;\n    tmp26 = tmp12 + tmp10 - tmp11 - z2;\n\n    tmp10 = MULTIPLY(z3, FIX(0.790569415)); /* (c6+c12)/2 */\n    tmp11 = MULTIPLY(z4, FIX(0.353553391)); /* (c6-c12)/2 */\n\n    tmp21 = tmp12 + tmp10 + tmp11;\n    tmp24 = tmp13 - tmp10 + tmp11;\n    tmp11 += tmp11;\n    tmp22 = z1 + tmp11;                     /* c10 = c6-c12 */\n    tmp27 = z1 - tmp11 - tmp11;             /* c0 = (c6-c12)*2 */\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z4 = (INT32) wsptr[5];\n    z3 = MULTIPLY(z4, FIX(1.224744871));                    /* c5 */\n    z4 = (INT32) wsptr[7];\n\n    tmp13 = z2 - z4;\n    tmp15 = MULTIPLY(z1 + tmp13, FIX(0.831253876));         /* c9 */\n    tmp11 = tmp15 + MULTIPLY(z1, FIX(0.513743148));         /* c3-c9 */\n    tmp14 = tmp15 - MULTIPLY(tmp13, FIX(2.176250899));      /* c3+c9 */\n\n    tmp13 = MULTIPLY(z2, - FIX(0.831253876));               /* -c9 */\n    tmp15 = MULTIPLY(z2, - FIX(1.344997024));               /* -c3 */\n    z2 = z1 - z4;\n    tmp12 = z3 + MULTIPLY(z2, FIX(1.406466353));            /* c1 */\n\n    tmp10 = tmp12 + MULTIPLY(z4, FIX(2.457431844)) - tmp15; /* c1+c7 */\n    tmp16 = tmp12 - MULTIPLY(z1, FIX(1.112434820)) + tmp13; /* c1-c13 */\n    tmp12 = MULTIPLY(z2, FIX(1.224744871)) - z3;            /* c5 */\n    z2 = MULTIPLY(z1 + z4, FIX(0.575212477));               /* c11 */\n    tmp13 += z2 + MULTIPLY(z1, FIX(0.475753014)) - z3;      /* c7-c11 */\n    tmp15 += z2 - MULTIPLY(z4, FIX(0.869244010)) + z3;      /* c11+c13 */\n\n    /* Final output stage */\n\n    outptr[0]  = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[14] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[1]  = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[13] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[2]  = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[3]  = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[4]  = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp14,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[5]  = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp15,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[9]  = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp15,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[6]  = range_limit[(int) RIGHT_SHIFT(tmp26 + tmp16,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[8]  = range_limit[(int) RIGHT_SHIFT(tmp26 - tmp16,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[7]  = range_limit[(int) RIGHT_SHIFT(tmp27,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n\n    wsptr += 8;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a 16x16 output block.\n *\n * Optimized algorithm with 28 multiplications in the 1-D kernel.\n * cK represents sqrt(2) * cos(K*pi/32).\n */\n\nGLOBAL(void)\njpeg_idct_16x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JCOEFPTR coef_block,\n\t\t JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp1, tmp2, tmp3, tmp10, tmp11, tmp12, tmp13;\n  INT32 tmp20, tmp21, tmp22, tmp23, tmp24, tmp25, tmp26, tmp27;\n  INT32 z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[8*16];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {\n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp0 <<= CONST_BITS;\n    /* Add fudge factor here for final descale. */\n    tmp0 += 1 << (CONST_BITS-PASS1_BITS-1);\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    tmp1 = MULTIPLY(z1, FIX(1.306562965));      /* c4[16] = c2[8] */\n    tmp2 = MULTIPLY(z1, FIX_0_541196100);       /* c12[16] = c6[8] */\n\n    tmp10 = tmp0 + tmp1;\n    tmp11 = tmp0 - tmp1;\n    tmp12 = tmp0 + tmp2;\n    tmp13 = tmp0 - tmp2;\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n    z3 = z1 - z2;\n    z4 = MULTIPLY(z3, FIX(0.275899379));        /* c14[16] = c7[8] */\n    z3 = MULTIPLY(z3, FIX(1.387039845));        /* c2[16] = c1[8] */\n\n    tmp0 = z3 + MULTIPLY(z2, FIX_2_562915447);  /* (c6+c2)[16] = (c3+c1)[8] */\n    tmp1 = z4 + MULTIPLY(z1, FIX_0_899976223);  /* (c6-c14)[16] = (c3-c7)[8] */\n    tmp2 = z3 - MULTIPLY(z1, FIX(0.601344887)); /* (c2-c10)[16] = (c1-c5)[8] */\n    tmp3 = z4 - MULTIPLY(z2, FIX(0.509795579)); /* (c10-c14)[16] = (c5-c7)[8] */\n\n    tmp20 = tmp10 + tmp0;\n    tmp27 = tmp10 - tmp0;\n    tmp21 = tmp12 + tmp1;\n    tmp26 = tmp12 - tmp1;\n    tmp22 = tmp13 + tmp2;\n    tmp25 = tmp13 - tmp2;\n    tmp23 = tmp11 + tmp3;\n    tmp24 = tmp11 - tmp3;\n\n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    tmp11 = z1 + z3;\n\n    tmp1  = MULTIPLY(z1 + z2, FIX(1.353318001));   /* c3 */\n    tmp2  = MULTIPLY(tmp11,   FIX(1.247225013));   /* c5 */\n    tmp3  = MULTIPLY(z1 + z4, FIX(1.093201867));   /* c7 */\n    tmp10 = MULTIPLY(z1 - z4, FIX(0.897167586));   /* c9 */\n    tmp11 = MULTIPLY(tmp11,   FIX(0.666655658));   /* c11 */\n    tmp12 = MULTIPLY(z1 - z2, FIX(0.410524528));   /* c13 */\n    tmp0  = tmp1 + tmp2 + tmp3 -\n\t    MULTIPLY(z1, FIX(2.286341144));        /* c7+c5+c3-c1 */\n    tmp13 = tmp10 + tmp11 + tmp12 -\n\t    MULTIPLY(z1, FIX(1.835730603));        /* c9+c11+c13-c15 */\n    z1    = MULTIPLY(z2 + z3, FIX(0.138617169));   /* c15 */\n    tmp1  += z1 + MULTIPLY(z2, FIX(0.071888074));  /* c9+c11-c3-c15 */\n    tmp2  += z1 - MULTIPLY(z3, FIX(1.125726048));  /* c5+c7+c15-c3 */\n    z1    = MULTIPLY(z3 - z2, FIX(1.407403738));   /* c1 */\n    tmp11 += z1 - MULTIPLY(z3, FIX(0.766367282));  /* c1+c11-c9-c13 */\n    tmp12 += z1 + MULTIPLY(z2, FIX(1.971951411));  /* c1+c5+c13-c7 */\n    z2    += z4;\n    z1    = MULTIPLY(z2, - FIX(0.666655658));      /* -c11 */\n    tmp1  += z1;\n    tmp3  += z1 + MULTIPLY(z4, FIX(1.065388962));  /* c3+c11+c15-c7 */\n    z2    = MULTIPLY(z2, - FIX(1.247225013));      /* -c5 */\n    tmp10 += z2 + MULTIPLY(z4, FIX(3.141271809));  /* c1+c5+c9-c13 */\n    tmp12 += z2;\n    z2    = MULTIPLY(z3 + z4, - FIX(1.353318001)); /* -c3 */\n    tmp2  += z2;\n    tmp3  += z2;\n    z2    = MULTIPLY(z4 - z3, FIX(0.410524528));   /* c13 */\n    tmp10 += z2;\n    tmp11 += z2;\n\n    /* Final output stage */\n\n    wsptr[8*0]  = (int) RIGHT_SHIFT(tmp20 + tmp0,  CONST_BITS-PASS1_BITS);\n    wsptr[8*15] = (int) RIGHT_SHIFT(tmp20 - tmp0,  CONST_BITS-PASS1_BITS);\n    wsptr[8*1]  = (int) RIGHT_SHIFT(tmp21 + tmp1,  CONST_BITS-PASS1_BITS);\n    wsptr[8*14] = (int) RIGHT_SHIFT(tmp21 - tmp1,  CONST_BITS-PASS1_BITS);\n    wsptr[8*2]  = (int) RIGHT_SHIFT(tmp22 + tmp2,  CONST_BITS-PASS1_BITS);\n    wsptr[8*13] = (int) RIGHT_SHIFT(tmp22 - tmp2,  CONST_BITS-PASS1_BITS);\n    wsptr[8*3]  = (int) RIGHT_SHIFT(tmp23 + tmp3,  CONST_BITS-PASS1_BITS);\n    wsptr[8*12] = (int) RIGHT_SHIFT(tmp23 - tmp3,  CONST_BITS-PASS1_BITS);\n    wsptr[8*4]  = (int) RIGHT_SHIFT(tmp24 + tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*11] = (int) RIGHT_SHIFT(tmp24 - tmp10, CONST_BITS-PASS1_BITS);\n    wsptr[8*5]  = (int) RIGHT_SHIFT(tmp25 + tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*10] = (int) RIGHT_SHIFT(tmp25 - tmp11, CONST_BITS-PASS1_BITS);\n    wsptr[8*6]  = (int) RIGHT_SHIFT(tmp26 + tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*9]  = (int) RIGHT_SHIFT(tmp26 - tmp12, CONST_BITS-PASS1_BITS);\n    wsptr[8*7]  = (int) RIGHT_SHIFT(tmp27 + tmp13, CONST_BITS-PASS1_BITS);\n    wsptr[8*8]  = (int) RIGHT_SHIFT(tmp27 - tmp13, CONST_BITS-PASS1_BITS);\n  }\n\n  /* Pass 2: process 16 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 16; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n\n    /* Even part */\n\n    /* Add fudge factor here for final descale. */\n    tmp0 = (INT32) wsptr[0] + (ONE << (PASS1_BITS+2));\n    tmp0 <<= CONST_BITS;\n\n    z1 = (INT32) wsptr[4];\n    tmp1 = MULTIPLY(z1, FIX(1.306562965));      /* c4[16] = c2[8] */\n    tmp2 = MULTIPLY(z1, FIX_0_541196100);       /* c12[16] = c6[8] */\n\n    tmp10 = tmp0 + tmp1;\n    tmp11 = tmp0 - tmp1;\n    tmp12 = tmp0 + tmp2;\n    tmp13 = tmp0 - tmp2;\n\n    z1 = (INT32) wsptr[2];\n    z2 = (INT32) wsptr[6];\n    z3 = z1 - z2;\n    z4 = MULTIPLY(z3, FIX(0.275899379));        /* c14[16] = c7[8] */\n    z3 = MULTIPLY(z3, FIX(1.387039845));        /* c2[16] = c1[8] */\n\n    tmp0 = z3 + MULTIPLY(z2, FIX_2_562915447);  /* (c6+c2)[16] = (c3+c1)[8] */\n    tmp1 = z4 + MULTIPLY(z1, FIX_0_899976223);  /* (c6-c14)[16] = (c3-c7)[8] */\n    tmp2 = z3 - MULTIPLY(z1, FIX(0.601344887)); /* (c2-c10)[16] = (c1-c5)[8] */\n    tmp3 = z4 - MULTIPLY(z2, FIX(0.509795579)); /* (c10-c14)[16] = (c5-c7)[8] */\n\n    tmp20 = tmp10 + tmp0;\n    tmp27 = tmp10 - tmp0;\n    tmp21 = tmp12 + tmp1;\n    tmp26 = tmp12 - tmp1;\n    tmp22 = tmp13 + tmp2;\n    tmp25 = tmp13 - tmp2;\n    tmp23 = tmp11 + tmp3;\n    tmp24 = tmp11 - tmp3;\n\n    /* Odd part */\n\n    z1 = (INT32) wsptr[1];\n    z2 = (INT32) wsptr[3];\n    z3 = (INT32) wsptr[5];\n    z4 = (INT32) wsptr[7];\n\n    tmp11 = z1 + z3;\n\n    tmp1  = MULTIPLY(z1 + z2, FIX(1.353318001));   /* c3 */\n    tmp2  = MULTIPLY(tmp11,   FIX(1.247225013));   /* c5 */\n    tmp3  = MULTIPLY(z1 + z4, FIX(1.093201867));   /* c7 */\n    tmp10 = MULTIPLY(z1 - z4, FIX(0.897167586));   /* c9 */\n    tmp11 = MULTIPLY(tmp11,   FIX(0.666655658));   /* c11 */\n    tmp12 = MULTIPLY(z1 - z2, FIX(0.410524528));   /* c13 */\n    tmp0  = tmp1 + tmp2 + tmp3 -\n\t    MULTIPLY(z1, FIX(2.286341144));        /* c7+c5+c3-c1 */\n    tmp13 = tmp10 + tmp11 + tmp12 -\n\t    MULTIPLY(z1, FIX(1.835730603));        /* c9+c11+c13-c15 */\n    z1    = MULTIPLY(z2 + z3, FIX(0.138617169));   /* c15 */\n    tmp1  += z1 + MULTIPLY(z2, FIX(0.071888074));  /* c9+c11-c3-c15 */\n    tmp2  += z1 - MULTIPLY(z3, FIX(1.125726048));  /* c5+c7+c15-c3 */\n    z1    = MULTIPLY(z3 - z2, FIX(1.407403738));   /* c1 */\n    tmp11 += z1 - MULTIPLY(z3, FIX(0.766367282));  /* c1+c11-c9-c13 */\n    tmp12 += z1 + MULTIPLY(z2, FIX(1.971951411));  /* c1+c5+c13-c7 */\n    z2    += z4;\n    z1    = MULTIPLY(z2, - FIX(0.666655658));      /* -c11 */\n    tmp1  += z1;\n    tmp3  += z1 + MULTIPLY(z4, FIX(1.065388962));  /* c3+c11+c15-c7 */\n    z2    = MULTIPLY(z2, - FIX(1.247225013));      /* -c5 */\n    tmp10 += z2 + MULTIPLY(z4, FIX(3.141271809));  /* c1+c5+c9-c13 */\n    tmp12 += z2;\n    z2    = MULTIPLY(z3 + z4, - FIX(1.353318001)); /* -c3 */\n    tmp2  += z2;\n    tmp3  += z2;\n    z2    = MULTIPLY(z4 - z3, FIX(0.410524528));   /* c13 */\n    tmp10 += z2;\n    tmp11 += z2;\n\n    /* Final output stage */\n\n    outptr[0]  = range_limit[(int) RIGHT_SHIFT(tmp20 + tmp0,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[15] = range_limit[(int) RIGHT_SHIFT(tmp20 - tmp0,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[1]  = range_limit[(int) RIGHT_SHIFT(tmp21 + tmp1,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[14] = range_limit[(int) RIGHT_SHIFT(tmp21 - tmp1,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[2]  = range_limit[(int) RIGHT_SHIFT(tmp22 + tmp2,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[13] = range_limit[(int) RIGHT_SHIFT(tmp22 - tmp2,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[3]  = range_limit[(int) RIGHT_SHIFT(tmp23 + tmp3,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[12] = range_limit[(int) RIGHT_SHIFT(tmp23 - tmp3,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[4]  = range_limit[(int) RIGHT_SHIFT(tmp24 + tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[11] = range_limit[(int) RIGHT_SHIFT(tmp24 - tmp10,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[5]  = range_limit[(int) RIGHT_SHIFT(tmp25 + tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[10] = range_limit[(int) RIGHT_SHIFT(tmp25 - tmp11,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[6]  = range_limit[(int) RIGHT_SHIFT(tmp26 + tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[9]  = range_limit[(int) RIGHT_SHIFT(tmp26 - tmp12,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[7]  = range_limit[(int) RIGHT_SHIFT(tmp27 + tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n    outptr[8]  = range_limit[(int) RIGHT_SHIFT(tmp27 - tmp13,\n\t\t\t\t\t       CONST_BITS+PASS1_BITS+3)\n\t\t\t     & RANGE_MASK];\n\n    wsptr += 8;\t\t/* advance pointer to next row */\n  }\n}\n\n#endif /* IDCT_SCALING_SUPPORTED */\n#endif /* DCT_ISLOW_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/jidctred.c",
    "content": "/*\n * jidctred.c\n *\n * Copyright (C) 1994-1998, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains inverse-DCT routines that produce reduced-size output:\n * either 4x4, 2x2, or 1x1 pixels from an 8x8 DCT block.\n *\n * The implementation is based on the Loeffler, Ligtenberg and Moschytz (LL&M)\n * algorithm used in jidctint.c.  We simply replace each 8-to-8 1-D IDCT step\n * with an 8-to-4 step that produces the four averages of two adjacent outputs\n * (or an 8-to-2 step producing two averages of four outputs, for 2x2 output).\n * These steps were derived by computing the corresponding values at the end\n * of the normal LL&M code, then simplifying as much as possible.\n *\n * 1x1 is trivial: just take the DC coefficient divided by 8.\n *\n * See jidctint.c for additional comments.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jdct.h\"\t\t/* Private declarations for DCT subsystem */\n\n#ifdef IDCT_SCALING_SUPPORTED\n\n\n/*\n * This module is specialized to the case DCTSIZE = 8.\n */\n\n#if DCTSIZE != 8\n  Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */\n#endif\n\n\n/* Scaling is the same as in jidctint.c. */\n\n#if BITS_IN_JSAMPLE == 8\n#define CONST_BITS  13\n#define PASS1_BITS  2\n#else\n#define CONST_BITS  13\n#define PASS1_BITS  1\t\t/* lose a little precision to avoid overflow */\n#endif\n\n/* Some C compilers fail to reduce \"FIX(constant)\" at compile time, thus\n * causing a lot of useless floating-point operations at run time.\n * To get around this we use the following pre-calculated constants.\n * If you change CONST_BITS you may want to add appropriate values.\n * (With a reasonable C compiler, you can just rely on the FIX() macro...)\n */\n\n#if CONST_BITS == 13\n#define FIX_0_211164243  ((INT32)  1730)\t/* FIX(0.211164243) */\n#define FIX_0_509795579  ((INT32)  4176)\t/* FIX(0.509795579) */\n#define FIX_0_601344887  ((INT32)  4926)\t/* FIX(0.601344887) */\n#define FIX_0_720959822  ((INT32)  5906)\t/* FIX(0.720959822) */\n#define FIX_0_765366865  ((INT32)  6270)\t/* FIX(0.765366865) */\n#define FIX_0_850430095  ((INT32)  6967)\t/* FIX(0.850430095) */\n#define FIX_0_899976223  ((INT32)  7373)\t/* FIX(0.899976223) */\n#define FIX_1_061594337  ((INT32)  8697)\t/* FIX(1.061594337) */\n#define FIX_1_272758580  ((INT32)  10426)\t/* FIX(1.272758580) */\n#define FIX_1_451774981  ((INT32)  11893)\t/* FIX(1.451774981) */\n#define FIX_1_847759065  ((INT32)  15137)\t/* FIX(1.847759065) */\n#define FIX_2_172734803  ((INT32)  17799)\t/* FIX(2.172734803) */\n#define FIX_2_562915447  ((INT32)  20995)\t/* FIX(2.562915447) */\n#define FIX_3_624509785  ((INT32)  29692)\t/* FIX(3.624509785) */\n#else\n#define FIX_0_211164243  FIX(0.211164243)\n#define FIX_0_509795579  FIX(0.509795579)\n#define FIX_0_601344887  FIX(0.601344887)\n#define FIX_0_720959822  FIX(0.720959822)\n#define FIX_0_765366865  FIX(0.765366865)\n#define FIX_0_850430095  FIX(0.850430095)\n#define FIX_0_899976223  FIX(0.899976223)\n#define FIX_1_061594337  FIX(1.061594337)\n#define FIX_1_272758580  FIX(1.272758580)\n#define FIX_1_451774981  FIX(1.451774981)\n#define FIX_1_847759065  FIX(1.847759065)\n#define FIX_2_172734803  FIX(2.172734803)\n#define FIX_2_562915447  FIX(2.562915447)\n#define FIX_3_624509785  FIX(3.624509785)\n#endif\n\n\n/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result.\n * For 8-bit samples with the recommended scaling, all the variable\n * and constant values involved are no more than 16 bits wide, so a\n * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.\n * For 12-bit samples, a full 32-bit multiplication will be needed.\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define MULTIPLY(var,const)  MULTIPLY16C16(var,const)\n#else\n#define MULTIPLY(var,const)  ((var) * (const))\n#endif\n\n\n/* Dequantize a coefficient by multiplying it by the multiplier-table\n * entry; produce an int result.  In this module, both inputs and result\n * are 16 bits or less, so either int or short multiply will work.\n */\n\n#define DEQUANTIZE(coef,quantval)  (((ISLOW_MULT_TYPE) (coef)) * (quantval))\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a reduced-size 4x4 output block.\n */\n\nGLOBAL(void)\njpeg_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp2, tmp10, tmp12;\n  INT32 z1, z2, z3, z4;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[DCTSIZE*4];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = DCTSIZE; ctr > 0; inptr++, quantptr++, wsptr++, ctr--) {\n    /* Don't bother to process column 4, because second pass won't use it */\n    if (ctr == DCTSIZE-4)\n      continue;\n    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&\n\tinptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*5] == 0 &&\n\tinptr[DCTSIZE*6] == 0 && inptr[DCTSIZE*7] == 0) {\n      /* AC terms all zero; we need not examine term 4 for 4x4 output */\n      int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS;\n      \n      wsptr[DCTSIZE*0] = dcval;\n      wsptr[DCTSIZE*1] = dcval;\n      wsptr[DCTSIZE*2] = dcval;\n      wsptr[DCTSIZE*3] = dcval;\n      \n      continue;\n    }\n    \n    /* Even part */\n    \n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp0 <<= (CONST_BITS+1);\n    \n    z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp2 = MULTIPLY(z2, FIX_1_847759065) + MULTIPLY(z3, - FIX_0_765366865);\n    \n    tmp10 = tmp0 + tmp2;\n    tmp12 = tmp0 - tmp2;\n    \n    /* Odd part */\n    \n    z1 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n    z2 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    z3 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    z4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    \n    tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */\n\t + MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */\n\t + MULTIPLY(z3, - FIX_2_172734803) /* sqrt(2) * (-c1-c5) */\n\t + MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * (c5+c7) */\n    \n    tmp2 = MULTIPLY(z1, - FIX_0_509795579) /* sqrt(2) * (c7-c5) */\n\t + MULTIPLY(z2, - FIX_0_601344887) /* sqrt(2) * (c5-c1) */\n\t + MULTIPLY(z3, FIX_0_899976223) /* sqrt(2) * (c3-c7) */\n\t + MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */\n\n    /* Final output stage */\n    \n    wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp2, CONST_BITS-PASS1_BITS+1);\n    wsptr[DCTSIZE*3] = (int) DESCALE(tmp10 - tmp2, CONST_BITS-PASS1_BITS+1);\n    wsptr[DCTSIZE*1] = (int) DESCALE(tmp12 + tmp0, CONST_BITS-PASS1_BITS+1);\n    wsptr[DCTSIZE*2] = (int) DESCALE(tmp12 - tmp0, CONST_BITS-PASS1_BITS+1);\n  }\n  \n  /* Pass 2: process 4 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 4; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n    /* It's not clear whether a zero row test is worthwhile here ... */\n\n#ifndef NO_ZERO_ROW_TEST\n    if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 &&\n\twsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {\n      /* AC terms all zero */\n      JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3)\n\t\t\t\t  & RANGE_MASK];\n      \n      outptr[0] = dcval;\n      outptr[1] = dcval;\n      outptr[2] = dcval;\n      outptr[3] = dcval;\n      \n      wsptr += DCTSIZE;\t\t/* advance pointer to next row */\n      continue;\n    }\n#endif\n    \n    /* Even part */\n    \n    tmp0 = ((INT32) wsptr[0]) << (CONST_BITS+1);\n    \n    tmp2 = MULTIPLY((INT32) wsptr[2], FIX_1_847759065)\n\t + MULTIPLY((INT32) wsptr[6], - FIX_0_765366865);\n    \n    tmp10 = tmp0 + tmp2;\n    tmp12 = tmp0 - tmp2;\n    \n    /* Odd part */\n    \n    z1 = (INT32) wsptr[7];\n    z2 = (INT32) wsptr[5];\n    z3 = (INT32) wsptr[3];\n    z4 = (INT32) wsptr[1];\n    \n    tmp0 = MULTIPLY(z1, - FIX_0_211164243) /* sqrt(2) * (c3-c1) */\n\t + MULTIPLY(z2, FIX_1_451774981) /* sqrt(2) * (c3+c7) */\n\t + MULTIPLY(z3, - FIX_2_172734803) /* sqrt(2) * (-c1-c5) */\n\t + MULTIPLY(z4, FIX_1_061594337); /* sqrt(2) * (c5+c7) */\n    \n    tmp2 = MULTIPLY(z1, - FIX_0_509795579) /* sqrt(2) * (c7-c5) */\n\t + MULTIPLY(z2, - FIX_0_601344887) /* sqrt(2) * (c5-c1) */\n\t + MULTIPLY(z3, FIX_0_899976223) /* sqrt(2) * (c3-c7) */\n\t + MULTIPLY(z4, FIX_2_562915447); /* sqrt(2) * (c1+c3) */\n\n    /* Final output stage */\n    \n    outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp2,\n\t\t\t\t\t  CONST_BITS+PASS1_BITS+3+1)\n\t\t\t    & RANGE_MASK];\n    outptr[3] = range_limit[(int) DESCALE(tmp10 - tmp2,\n\t\t\t\t\t  CONST_BITS+PASS1_BITS+3+1)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) DESCALE(tmp12 + tmp0,\n\t\t\t\t\t  CONST_BITS+PASS1_BITS+3+1)\n\t\t\t    & RANGE_MASK];\n    outptr[2] = range_limit[(int) DESCALE(tmp12 - tmp0,\n\t\t\t\t\t  CONST_BITS+PASS1_BITS+3+1)\n\t\t\t    & RANGE_MASK];\n    \n    wsptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a reduced-size 2x2 output block.\n */\n\nGLOBAL(void)\njpeg_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  INT32 tmp0, tmp10, z1;\n  JCOEFPTR inptr;\n  ISLOW_MULT_TYPE * quantptr;\n  int * wsptr;\n  JSAMPROW outptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  int ctr;\n  int workspace[DCTSIZE*2];\t/* buffers data between passes */\n  SHIFT_TEMPS\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = coef_block;\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  wsptr = workspace;\n  for (ctr = DCTSIZE; ctr > 0; inptr++, quantptr++, wsptr++, ctr--) {\n    /* Don't bother to process columns 2,4,6 */\n    if (ctr == DCTSIZE-2 || ctr == DCTSIZE-4 || ctr == DCTSIZE-6)\n      continue;\n    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*3] == 0 &&\n\tinptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*7] == 0) {\n      /* AC terms all zero; we need not examine terms 2,4,6 for 2x2 output */\n      int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]) << PASS1_BITS;\n      \n      wsptr[DCTSIZE*0] = dcval;\n      wsptr[DCTSIZE*1] = dcval;\n      \n      continue;\n    }\n    \n    /* Even part */\n    \n    z1 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp10 = z1 << (CONST_BITS+2);\n    \n    /* Odd part */\n\n    z1 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n    tmp0 = MULTIPLY(z1, - FIX_0_720959822); /* sqrt(2) * (c7-c5+c3-c1) */\n    z1 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    tmp0 += MULTIPLY(z1, FIX_0_850430095); /* sqrt(2) * (-c1+c3+c5+c7) */\n    z1 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    tmp0 += MULTIPLY(z1, - FIX_1_272758580); /* sqrt(2) * (-c1+c3-c5-c7) */\n    z1 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    tmp0 += MULTIPLY(z1, FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */\n\n    /* Final output stage */\n    \n    wsptr[DCTSIZE*0] = (int) DESCALE(tmp10 + tmp0, CONST_BITS-PASS1_BITS+2);\n    wsptr[DCTSIZE*1] = (int) DESCALE(tmp10 - tmp0, CONST_BITS-PASS1_BITS+2);\n  }\n  \n  /* Pass 2: process 2 rows from work array, store into output array. */\n\n  wsptr = workspace;\n  for (ctr = 0; ctr < 2; ctr++) {\n    outptr = output_buf[ctr] + output_col;\n    /* It's not clear whether a zero row test is worthwhile here ... */\n\n#ifndef NO_ZERO_ROW_TEST\n    if (wsptr[1] == 0 && wsptr[3] == 0 && wsptr[5] == 0 && wsptr[7] == 0) {\n      /* AC terms all zero */\n      JSAMPLE dcval = range_limit[(int) DESCALE((INT32) wsptr[0], PASS1_BITS+3)\n\t\t\t\t  & RANGE_MASK];\n      \n      outptr[0] = dcval;\n      outptr[1] = dcval;\n      \n      wsptr += DCTSIZE;\t\t/* advance pointer to next row */\n      continue;\n    }\n#endif\n    \n    /* Even part */\n    \n    tmp10 = ((INT32) wsptr[0]) << (CONST_BITS+2);\n    \n    /* Odd part */\n\n    tmp0 = MULTIPLY((INT32) wsptr[7], - FIX_0_720959822) /* sqrt(2) * (c7-c5+c3-c1) */\n\t + MULTIPLY((INT32) wsptr[5], FIX_0_850430095) /* sqrt(2) * (-c1+c3+c5+c7) */\n\t + MULTIPLY((INT32) wsptr[3], - FIX_1_272758580) /* sqrt(2) * (-c1+c3-c5-c7) */\n\t + MULTIPLY((INT32) wsptr[1], FIX_3_624509785); /* sqrt(2) * (c1+c3+c5+c7) */\n\n    /* Final output stage */\n    \n    outptr[0] = range_limit[(int) DESCALE(tmp10 + tmp0,\n\t\t\t\t\t  CONST_BITS+PASS1_BITS+3+2)\n\t\t\t    & RANGE_MASK];\n    outptr[1] = range_limit[(int) DESCALE(tmp10 - tmp0,\n\t\t\t\t\t  CONST_BITS+PASS1_BITS+3+2)\n\t\t\t    & RANGE_MASK];\n    \n    wsptr += DCTSIZE;\t\t/* advance pointer to next row */\n  }\n}\n\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients,\n * producing a reduced-size 1x1 output block.\n */\n\nGLOBAL(void)\njpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t       JCOEFPTR coef_block,\n\t       JSAMPARRAY output_buf, JDIMENSION output_col)\n{\n  int dcval;\n  ISLOW_MULT_TYPE * quantptr;\n  JSAMPLE *range_limit = IDCT_range_limit(cinfo);\n  SHIFT_TEMPS\n\n  /* We hardly need an inverse DCT routine for this: just take the\n   * average pixel value, which is one-eighth of the DC coefficient.\n   */\n  quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;\n  dcval = DEQUANTIZE(coef_block[0], quantptr[0]);\n  dcval = (int) DESCALE((INT32) dcval, 3);\n\n  output_buf[0][output_col] = range_limit[dcval & RANGE_MASK];\n}\n\n#endif /* IDCT_SCALING_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/jinclude.h",
    "content": "/*\n * jinclude.h\n *\n * Copyright (C) 1991-1994, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file exists to provide a single place to fix any problems with\n * including the wrong system include files.  (Common problems are taken\n * care of by the standard jconfig symbols, but on really weird systems\n * you may have to edit this file.)\n *\n * NOTE: this file is NOT intended to be included by applications using the\n * JPEG library.  Most applications need only include jpeglib.h.\n */\n\n\n/* Include auto-config file to find out which system include files we need. */\n\n#include \"jconfig.h\"\t\t/* auto configuration options */\n#define JCONFIG_INCLUDED\t/* so that jpeglib.h doesn't do it again */\n\n/*\n * We need the NULL macro and size_t typedef.\n * On an ANSI-conforming system it is sufficient to include <stddef.h>.\n * Otherwise, we get them from <stdlib.h> or <stdio.h>; we may have to\n * pull in <sys/types.h> as well.\n * Note that the core JPEG library does not require <stdio.h>;\n * only the default error handler and data source/destination modules do.\n * But we must pull it in because of the references to FILE in jpeglib.h.\n * You can remove those references if you want to compile without <stdio.h>.\n */\n\n#ifdef HAVE_STDDEF_H\n#include <stddef.h>\n#endif\n\n#ifdef HAVE_STDLIB_H\n#include <stdlib.h>\n#endif\n\n#ifdef NEED_SYS_TYPES_H\n#include <sys/types.h>\n#endif\n\n#include <stdio.h>\n\n/*\n * We need memory copying and zeroing functions, plus strncpy().\n * ANSI and System V implementations declare these in <string.h>.\n * BSD doesn't have the mem() functions, but it does have bcopy()/bzero().\n * Some systems may declare memset and memcpy in <memory.h>.\n *\n * NOTE: we assume the size parameters to these functions are of type size_t.\n * Change the casts in these macros if not!\n */\n\n#ifdef NEED_BSD_STRINGS\n\n#include <strings.h>\n#define MEMZERO(target,size)\tbzero((void *)(target), (size_t)(size))\n#define MEMCOPY(dest,src,size)\tbcopy((const void *)(src), (void *)(dest), (size_t)(size))\n\n#else /* not BSD, assume ANSI/SysV string lib */\n\n#include <string.h>\n#define MEMZERO(target,size)\tmemset((void *)(target), 0, (size_t)(size))\n#define MEMCOPY(dest,src,size)\tmemcpy((void *)(dest), (const void *)(src), (size_t)(size))\n\n#endif\n\n/*\n * In ANSI C, and indeed any rational implementation, size_t is also the\n * type returned by sizeof().  However, it seems there are some irrational\n * implementations out there, in which sizeof() returns an int even though\n * size_t is defined as long or unsigned long.  To ensure consistent results\n * we always use this SIZEOF() macro in place of using sizeof() directly.\n */\n\n#define SIZEOF(object)\t((size_t) sizeof(object))\n\n/*\n * The modules that use fread() and fwrite() always invoke them through\n * these macros.  On some systems you may need to twiddle the argument casts.\n * CAUTION: argument order is different from underlying functions!\n */\n\n#define JFREAD(file,buf,sizeofbuf)  \\\n  ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))\n#define JFWRITE(file,buf,sizeofbuf)  \\\n  ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))\n"
  },
  {
    "path": "ext/libjpeg-turbo/jmemmgr.c",
    "content": "/*\n * jmemmgr.c\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains the JPEG system-independent memory management\n * routines.  This code is usable across a wide variety of machines; most\n * of the system dependencies have been isolated in a separate file.\n * The major functions provided here are:\n *   * pool-based allocation and freeing of memory;\n *   * policy decisions about how to divide available memory among the\n *     virtual arrays;\n *   * control logic for swapping virtual arrays between main memory and\n *     backing storage.\n * The separate system-dependent file provides the actual backing-storage\n * access code, and it contains the policy decision about how much total\n * main memory to use.\n * This file is system-dependent in the sense that some of its functions\n * are unnecessary in some systems.  For example, if there is enough virtual\n * memory so that backing storage will never be used, much of the virtual\n * array control logic could be removed.  (Of course, if you have that much\n * memory then you shouldn't care about a little bit of unused code...)\n */\n\n#define JPEG_INTERNALS\n#define AM_MEMORY_MANAGER\t/* we define jvirt_Xarray_control structs */\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jmemsys.h\"\t\t/* import the system-dependent declarations */\n\n#ifndef NO_GETENV\n#ifndef HAVE_STDLIB_H\t\t/* <stdlib.h> should declare getenv() */\nextern char * getenv JPP((const char * name));\n#endif\n#endif\n\n\nLOCAL(size_t)\nround_up_pow2 (size_t a, size_t b)\n/* a rounded up to the next multiple of b, i.e. ceil(a/b)*b */\n/* Assumes a >= 0, b > 0, and b is a power of 2 */\n{\n  return ((a + b - 1) & (~(b - 1)));\n}\n\n\n/*\n * Some important notes:\n *   The allocation routines provided here must never return NULL.\n *   They should exit to error_exit if unsuccessful.\n *\n *   It's not a good idea to try to merge the sarray and barray routines,\n *   even though they are textually almost the same, because samples are\n *   usually stored as bytes while coefficients are shorts or ints.  Thus,\n *   in machines where byte pointers have a different representation from\n *   word pointers, the resulting machine code could not be the same.\n */\n\n\n/*\n * Many machines require storage alignment: longs must start on 4-byte\n * boundaries, doubles on 8-byte boundaries, etc.  On such machines, malloc()\n * always returns pointers that are multiples of the worst-case alignment\n * requirement, and we had better do so too.\n * There isn't any really portable way to determine the worst-case alignment\n * requirement.  This module assumes that the alignment requirement is\n * multiples of ALIGN_SIZE.\n * By default, we define ALIGN_SIZE as sizeof(double).  This is necessary on some\n * workstations (where doubles really do need 8-byte alignment) and will work\n * fine on nearly everything.  If your machine has lesser alignment needs,\n * you can save a few bytes by making ALIGN_SIZE smaller.\n * The only place I know of where this will NOT work is certain Macintosh\n * 680x0 compilers that define double as a 10-byte IEEE extended float.\n * Doing 10-byte alignment is counterproductive because longwords won't be\n * aligned well.  Put \"#define ALIGN_SIZE 4\" in jconfig.h if you have\n * such a compiler.\n */\n\n#ifndef ALIGN_SIZE\t\t/* so can override from jconfig.h */\n#ifndef WITH_SIMD\n#define ALIGN_SIZE  SIZEOF(double)\n#else\n#define ALIGN_SIZE  16 /* Most SIMD implementations require this */\n#endif\n#endif\n\n/*\n * We allocate objects from \"pools\", where each pool is gotten with a single\n * request to jpeg_get_small() or jpeg_get_large().  There is no per-object\n * overhead within a pool, except for alignment padding.  Each pool has a\n * header with a link to the next pool of the same class.\n * Small and large pool headers are identical except that the latter's\n * link pointer must be FAR on 80x86 machines.\n */\n\ntypedef struct small_pool_struct * small_pool_ptr;\n\ntypedef struct small_pool_struct {\n  small_pool_ptr next;\t/* next in list of pools */\n  size_t bytes_used;\t\t/* how many bytes already used within pool */\n  size_t bytes_left;\t\t/* bytes still available in this pool */\n} small_pool_hdr;\n\ntypedef struct large_pool_struct FAR * large_pool_ptr;\n\ntypedef struct large_pool_struct {\n  large_pool_ptr next;\t/* next in list of pools */\n  size_t bytes_used;\t\t/* how many bytes already used within pool */\n  size_t bytes_left;\t\t/* bytes still available in this pool */\n} large_pool_hdr;\n\n/*\n * Here is the full definition of a memory manager object.\n */\n\ntypedef struct {\n  struct jpeg_memory_mgr pub;\t/* public fields */\n\n  /* Each pool identifier (lifetime class) names a linked list of pools. */\n  small_pool_ptr small_list[JPOOL_NUMPOOLS];\n  large_pool_ptr large_list[JPOOL_NUMPOOLS];\n\n  /* Since we only have one lifetime class of virtual arrays, only one\n   * linked list is necessary (for each datatype).  Note that the virtual\n   * array control blocks being linked together are actually stored somewhere\n   * in the small-pool list.\n   */\n  jvirt_sarray_ptr virt_sarray_list;\n  jvirt_barray_ptr virt_barray_list;\n\n  /* This counts total space obtained from jpeg_get_small/large */\n  size_t total_space_allocated;\n\n  /* alloc_sarray and alloc_barray set this value for use by virtual\n   * array routines.\n   */\n  JDIMENSION last_rowsperchunk;\t/* from most recent alloc_sarray/barray */\n} my_memory_mgr;\n\ntypedef my_memory_mgr * my_mem_ptr;\n\n\n/*\n * The control blocks for virtual arrays.\n * Note that these blocks are allocated in the \"small\" pool area.\n * System-dependent info for the associated backing store (if any) is hidden\n * inside the backing_store_info struct.\n */\n\nstruct jvirt_sarray_control {\n  JSAMPARRAY mem_buffer;\t/* => the in-memory buffer */\n  JDIMENSION rows_in_array;\t/* total virtual array height */\n  JDIMENSION samplesperrow;\t/* width of array (and of memory buffer) */\n  JDIMENSION maxaccess;\t\t/* max rows accessed by access_virt_sarray */\n  JDIMENSION rows_in_mem;\t/* height of memory buffer */\n  JDIMENSION rowsperchunk;\t/* allocation chunk size in mem_buffer */\n  JDIMENSION cur_start_row;\t/* first logical row # in the buffer */\n  JDIMENSION first_undef_row;\t/* row # of first uninitialized row */\n  boolean pre_zero;\t\t/* pre-zero mode requested? */\n  boolean dirty;\t\t/* do current buffer contents need written? */\n  boolean b_s_open;\t\t/* is backing-store data valid? */\n  jvirt_sarray_ptr next;\t/* link to next virtual sarray control block */\n  backing_store_info b_s_info;\t/* System-dependent control info */\n};\n\nstruct jvirt_barray_control {\n  JBLOCKARRAY mem_buffer;\t/* => the in-memory buffer */\n  JDIMENSION rows_in_array;\t/* total virtual array height */\n  JDIMENSION blocksperrow;\t/* width of array (and of memory buffer) */\n  JDIMENSION maxaccess;\t\t/* max rows accessed by access_virt_barray */\n  JDIMENSION rows_in_mem;\t/* height of memory buffer */\n  JDIMENSION rowsperchunk;\t/* allocation chunk size in mem_buffer */\n  JDIMENSION cur_start_row;\t/* first logical row # in the buffer */\n  JDIMENSION first_undef_row;\t/* row # of first uninitialized row */\n  boolean pre_zero;\t\t/* pre-zero mode requested? */\n  boolean dirty;\t\t/* do current buffer contents need written? */\n  boolean b_s_open;\t\t/* is backing-store data valid? */\n  jvirt_barray_ptr next;\t/* link to next virtual barray control block */\n  backing_store_info b_s_info;\t/* System-dependent control info */\n};\n\n\n#ifdef MEM_STATS\t\t/* optional extra stuff for statistics */\n\nLOCAL(void)\nprint_mem_stats (j_common_ptr cinfo, int pool_id)\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  small_pool_ptr shdr_ptr;\n  large_pool_ptr lhdr_ptr;\n\n  /* Since this is only a debugging stub, we can cheat a little by using\n   * fprintf directly rather than going through the trace message code.\n   * This is helpful because message parm array can't handle longs.\n   */\n  fprintf(stderr, \"Freeing pool %d, total space = %ld\\n\",\n\t  pool_id, mem->total_space_allocated);\n\n  for (lhdr_ptr = mem->large_list[pool_id]; lhdr_ptr != NULL;\n       lhdr_ptr = lhdr_ptr->next) {\n    fprintf(stderr, \"  Large chunk used %ld\\n\",\n\t    (long) lhdr_ptr->bytes_used);\n  }\n\n  for (shdr_ptr = mem->small_list[pool_id]; shdr_ptr != NULL;\n       shdr_ptr = shdr_ptr->next) {\n    fprintf(stderr, \"  Small chunk used %ld free %ld\\n\",\n\t    (long) shdr_ptr->bytes_used,\n\t    (long) shdr_ptr->bytes_left);\n  }\n}\n\n#endif /* MEM_STATS */\n\n\nLOCAL(void)\nout_of_memory (j_common_ptr cinfo, int which)\n/* Report an out-of-memory error and stop execution */\n/* If we compiled MEM_STATS support, report alloc requests before dying */\n{\n#ifdef MEM_STATS\n  cinfo->err->trace_level = 2;\t/* force self_destruct to report stats */\n#endif\n  ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, which);\n}\n\n\n/*\n * Allocation of \"small\" objects.\n *\n * For these, we use pooled storage.  When a new pool must be created,\n * we try to get enough space for the current request plus a \"slop\" factor,\n * where the slop will be the amount of leftover space in the new pool.\n * The speed vs. space tradeoff is largely determined by the slop values.\n * A different slop value is provided for each pool class (lifetime),\n * and we also distinguish the first pool of a class from later ones.\n * NOTE: the values given work fairly well on both 16- and 32-bit-int\n * machines, but may be too small if longs are 64 bits or more.\n *\n * Since we do not know what alignment malloc() gives us, we have to\n * allocate ALIGN_SIZE-1 extra space per pool to have room for alignment\n * adjustment.\n */\n\nstatic const size_t first_pool_slop[JPOOL_NUMPOOLS] = \n{\n\t1600,\t\t\t/* first PERMANENT pool */\n\t16000\t\t\t/* first IMAGE pool */\n};\n\nstatic const size_t extra_pool_slop[JPOOL_NUMPOOLS] = \n{\n\t0,\t\t\t/* additional PERMANENT pools */\n\t5000\t\t\t/* additional IMAGE pools */\n};\n\n#define MIN_SLOP  50\t\t/* greater than 0 to avoid futile looping */\n\n\nMETHODDEF(void *)\nalloc_small (j_common_ptr cinfo, int pool_id, size_t sizeofobject)\n/* Allocate a \"small\" object */\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  small_pool_ptr hdr_ptr, prev_hdr_ptr;\n  char * data_ptr;\n  size_t min_request, slop;\n\n  /*\n   * Round up the requested size to a multiple of ALIGN_SIZE in order\n   * to assure alignment for the next object allocated in the same pool\n   * and so that algorithms can straddle outside the proper area up\n   * to the next alignment.\n   */\n  sizeofobject = round_up_pow2(sizeofobject, ALIGN_SIZE);\n\n  /* Check for unsatisfiable request (do now to ensure no overflow below) */\n  if ((SIZEOF(small_pool_hdr) + sizeofobject + ALIGN_SIZE - 1) > MAX_ALLOC_CHUNK)\n    out_of_memory(cinfo, 1);\t/* request exceeds malloc's ability */\n\n  /* See if space is available in any existing pool */\n  if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)\n    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);\t/* safety check */\n  prev_hdr_ptr = NULL;\n  hdr_ptr = mem->small_list[pool_id];\n  while (hdr_ptr != NULL) {\n    if (hdr_ptr->bytes_left >= sizeofobject)\n      break;\t\t\t/* found pool with enough space */\n    prev_hdr_ptr = hdr_ptr;\n    hdr_ptr = hdr_ptr->next;\n  }\n\n  /* Time to make a new pool? */\n  if (hdr_ptr == NULL) {\n    /* min_request is what we need now, slop is what will be leftover */\n    min_request = SIZEOF(small_pool_hdr) + sizeofobject + ALIGN_SIZE - 1;\n    if (prev_hdr_ptr == NULL)\t/* first pool in class? */\n      slop = first_pool_slop[pool_id];\n    else\n      slop = extra_pool_slop[pool_id];\n    /* Don't ask for more than MAX_ALLOC_CHUNK */\n    if (slop > (size_t) (MAX_ALLOC_CHUNK-min_request))\n      slop = (size_t) (MAX_ALLOC_CHUNK-min_request);\n    /* Try to get space, if fail reduce slop and try again */\n    for (;;) {\n      hdr_ptr = (small_pool_ptr) jpeg_get_small(cinfo, min_request + slop);\n      if (hdr_ptr != NULL)\n\tbreak;\n      slop /= 2;\n      if (slop < MIN_SLOP)\t/* give up when it gets real small */\n\tout_of_memory(cinfo, 2); /* jpeg_get_small failed */\n    }\n    mem->total_space_allocated += min_request + slop;\n    /* Success, initialize the new pool header and add to end of list */\n    hdr_ptr->next = NULL;\n    hdr_ptr->bytes_used = 0;\n    hdr_ptr->bytes_left = sizeofobject + slop;\n    if (prev_hdr_ptr == NULL)\t/* first pool in class? */\n      mem->small_list[pool_id] = hdr_ptr;\n    else\n      prev_hdr_ptr->next = hdr_ptr;\n  }\n\n  /* OK, allocate the object from the current pool */\n  data_ptr = (char *) hdr_ptr; /* point to first data byte in pool... */\n  data_ptr += SIZEOF(small_pool_hdr); /* ...by skipping the header... */\n  if ((size_t)data_ptr % ALIGN_SIZE) /* ...and adjust for alignment */\n    data_ptr += ALIGN_SIZE - (size_t)data_ptr % ALIGN_SIZE;\n  data_ptr += hdr_ptr->bytes_used; /* point to place for object */\n  hdr_ptr->bytes_used += sizeofobject;\n  hdr_ptr->bytes_left -= sizeofobject;\n\n  return (void *) data_ptr;\n}\n\n\n/*\n * Allocation of \"large\" objects.\n *\n * The external semantics of these are the same as \"small\" objects,\n * except that FAR pointers are used on 80x86.  However the pool\n * management heuristics are quite different.  We assume that each\n * request is large enough that it may as well be passed directly to\n * jpeg_get_large; the pool management just links everything together\n * so that we can free it all on demand.\n * Note: the major use of \"large\" objects is in JSAMPARRAY and JBLOCKARRAY\n * structures.  The routines that create these structures (see below)\n * deliberately bunch rows together to ensure a large request size.\n */\n\nMETHODDEF(void FAR *)\nalloc_large (j_common_ptr cinfo, int pool_id, size_t sizeofobject)\n/* Allocate a \"large\" object */\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  large_pool_ptr hdr_ptr;\n  char FAR * data_ptr;\n\n  /*\n   * Round up the requested size to a multiple of ALIGN_SIZE so that\n   * algorithms can straddle outside the proper area up to the next\n   * alignment.\n   */\n  sizeofobject = round_up_pow2(sizeofobject, ALIGN_SIZE);\n\n  /* Check for unsatisfiable request (do now to ensure no overflow below) */\n  if ((SIZEOF(large_pool_hdr) + sizeofobject + ALIGN_SIZE - 1) > MAX_ALLOC_CHUNK)\n    out_of_memory(cinfo, 3);\t/* request exceeds malloc's ability */\n\n  /* Always make a new pool */\n  if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)\n    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);\t/* safety check */\n\n  hdr_ptr = (large_pool_ptr) jpeg_get_large(cinfo, sizeofobject +\n\t\t\t\t\t    SIZEOF(large_pool_hdr) +\n\t\t\t\t\t    ALIGN_SIZE - 1);\n  if (hdr_ptr == NULL)\n    out_of_memory(cinfo, 4);\t/* jpeg_get_large failed */\n  mem->total_space_allocated += sizeofobject + SIZEOF(large_pool_hdr) + ALIGN_SIZE - 1;\n\n  /* Success, initialize the new pool header and add to list */\n  hdr_ptr->next = mem->large_list[pool_id];\n  /* We maintain space counts in each pool header for statistical purposes,\n   * even though they are not needed for allocation.\n   */\n  hdr_ptr->bytes_used = sizeofobject;\n  hdr_ptr->bytes_left = 0;\n  mem->large_list[pool_id] = hdr_ptr;\n\n  data_ptr = (char *) hdr_ptr; /* point to first data byte in pool... */\n  data_ptr += SIZEOF(small_pool_hdr); /* ...by skipping the header... */\n  if ((size_t)data_ptr % ALIGN_SIZE) /* ...and adjust for alignment */\n    data_ptr += ALIGN_SIZE - (size_t)data_ptr % ALIGN_SIZE;\n\n  return (void FAR *) data_ptr;\n}\n\n\n/*\n * Creation of 2-D sample arrays.\n * The pointers are in near heap, the samples themselves in FAR heap.\n *\n * To minimize allocation overhead and to allow I/O of large contiguous\n * blocks, we allocate the sample rows in groups of as many rows as possible\n * without exceeding MAX_ALLOC_CHUNK total bytes per allocation request.\n * NB: the virtual array control routines, later in this file, know about\n * this chunking of rows.  The rowsperchunk value is left in the mem manager\n * object so that it can be saved away if this sarray is the workspace for\n * a virtual array.\n *\n * Since we are often upsampling with a factor 2, we align the size (not\n * the start) to 2 * ALIGN_SIZE so that the upsampling routines don't have\n * to be as careful about size.\n */\n\nMETHODDEF(JSAMPARRAY)\nalloc_sarray (j_common_ptr cinfo, int pool_id,\n\t      JDIMENSION samplesperrow, JDIMENSION numrows)\n/* Allocate a 2-D sample array */\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  JSAMPARRAY result;\n  JSAMPROW workspace;\n  JDIMENSION rowsperchunk, currow, i;\n  long ltemp;\n\n  /* Make sure each row is properly aligned */\n  if ((ALIGN_SIZE % SIZEOF(JSAMPLE)) != 0)\n    out_of_memory(cinfo, 5);\t/* safety check */\n  samplesperrow = (JDIMENSION)round_up_pow2(samplesperrow, (2 * ALIGN_SIZE) / SIZEOF(JSAMPLE));\n\n  /* Calculate max # of rows allowed in one allocation chunk */\n  ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) /\n\t  ((long) samplesperrow * SIZEOF(JSAMPLE));\n  if (ltemp <= 0)\n    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);\n  if (ltemp < (long) numrows)\n    rowsperchunk = (JDIMENSION) ltemp;\n  else\n    rowsperchunk = numrows;\n  mem->last_rowsperchunk = rowsperchunk;\n\n  /* Get space for row pointers (small object) */\n  result = (JSAMPARRAY) alloc_small(cinfo, pool_id,\n\t\t\t\t    (size_t) (numrows * SIZEOF(JSAMPROW)));\n\n  /* Get the rows themselves (large objects) */\n  currow = 0;\n  while (currow < numrows) {\n    rowsperchunk = MIN(rowsperchunk, numrows - currow);\n    workspace = (JSAMPROW) alloc_large(cinfo, pool_id,\n\t(size_t) ((size_t) rowsperchunk * (size_t) samplesperrow\n\t\t  * SIZEOF(JSAMPLE)));\n    for (i = rowsperchunk; i > 0; i--) {\n      result[currow++] = workspace;\n      workspace += samplesperrow;\n    }\n  }\n\n  return result;\n}\n\n\n/*\n * Creation of 2-D coefficient-block arrays.\n * This is essentially the same as the code for sample arrays, above.\n */\n\nMETHODDEF(JBLOCKARRAY)\nalloc_barray (j_common_ptr cinfo, int pool_id,\n\t      JDIMENSION blocksperrow, JDIMENSION numrows)\n/* Allocate a 2-D coefficient-block array */\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  JBLOCKARRAY result;\n  JBLOCKROW workspace;\n  JDIMENSION rowsperchunk, currow, i;\n  long ltemp;\n\n  /* Make sure each row is properly aligned */\n  if ((SIZEOF(JBLOCK) % ALIGN_SIZE) != 0)\n    out_of_memory(cinfo, 6);\t/* safety check */\n\n  /* Calculate max # of rows allowed in one allocation chunk */\n  ltemp = (MAX_ALLOC_CHUNK-SIZEOF(large_pool_hdr)) /\n\t  ((long) blocksperrow * SIZEOF(JBLOCK));\n  if (ltemp <= 0)\n    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);\n  if (ltemp < (long) numrows)\n    rowsperchunk = (JDIMENSION) ltemp;\n  else\n    rowsperchunk = numrows;\n  mem->last_rowsperchunk = rowsperchunk;\n\n  /* Get space for row pointers (small object) */\n  result = (JBLOCKARRAY) alloc_small(cinfo, pool_id,\n\t\t\t\t     (size_t) (numrows * SIZEOF(JBLOCKROW)));\n\n  /* Get the rows themselves (large objects) */\n  currow = 0;\n  while (currow < numrows) {\n    rowsperchunk = MIN(rowsperchunk, numrows - currow);\n    workspace = (JBLOCKROW) alloc_large(cinfo, pool_id,\n\t(size_t) ((size_t) rowsperchunk * (size_t) blocksperrow\n\t\t  * SIZEOF(JBLOCK)));\n    for (i = rowsperchunk; i > 0; i--) {\n      result[currow++] = workspace;\n      workspace += blocksperrow;\n    }\n  }\n\n  return result;\n}\n\n\n/*\n * About virtual array management:\n *\n * The above \"normal\" array routines are only used to allocate strip buffers\n * (as wide as the image, but just a few rows high).  Full-image-sized buffers\n * are handled as \"virtual\" arrays.  The array is still accessed a strip at a\n * time, but the memory manager must save the whole array for repeated\n * accesses.  The intended implementation is that there is a strip buffer in\n * memory (as high as is possible given the desired memory limit), plus a\n * backing file that holds the rest of the array.\n *\n * The request_virt_array routines are told the total size of the image and\n * the maximum number of rows that will be accessed at once.  The in-memory\n * buffer must be at least as large as the maxaccess value.\n *\n * The request routines create control blocks but not the in-memory buffers.\n * That is postponed until realize_virt_arrays is called.  At that time the\n * total amount of space needed is known (approximately, anyway), so free\n * memory can be divided up fairly.\n *\n * The access_virt_array routines are responsible for making a specific strip\n * area accessible (after reading or writing the backing file, if necessary).\n * Note that the access routines are told whether the caller intends to modify\n * the accessed strip; during a read-only pass this saves having to rewrite\n * data to disk.  The access routines are also responsible for pre-zeroing\n * any newly accessed rows, if pre-zeroing was requested.\n *\n * In current usage, the access requests are usually for nonoverlapping\n * strips; that is, successive access start_row numbers differ by exactly\n * num_rows = maxaccess.  This means we can get good performance with simple\n * buffer dump/reload logic, by making the in-memory buffer be a multiple\n * of the access height; then there will never be accesses across bufferload\n * boundaries.  The code will still work with overlapping access requests,\n * but it doesn't handle bufferload overlaps very efficiently.\n */\n\n\nMETHODDEF(jvirt_sarray_ptr)\nrequest_virt_sarray (j_common_ptr cinfo, int pool_id, boolean pre_zero,\n\t\t     JDIMENSION samplesperrow, JDIMENSION numrows,\n\t\t     JDIMENSION maxaccess)\n/* Request a virtual 2-D sample array */\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  jvirt_sarray_ptr result;\n\n  /* Only IMAGE-lifetime virtual arrays are currently supported */\n  if (pool_id != JPOOL_IMAGE)\n    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);\t/* safety check */\n\n  /* get control block */\n  result = (jvirt_sarray_ptr) alloc_small(cinfo, pool_id,\n\t\t\t\t\t  SIZEOF(struct jvirt_sarray_control));\n\n  result->mem_buffer = NULL;\t/* marks array not yet realized */\n  result->rows_in_array = numrows;\n  result->samplesperrow = samplesperrow;\n  result->maxaccess = maxaccess;\n  result->pre_zero = pre_zero;\n  result->b_s_open = FALSE;\t/* no associated backing-store object */\n  result->next = mem->virt_sarray_list; /* add to list of virtual arrays */\n  mem->virt_sarray_list = result;\n\n  return result;\n}\n\n\nMETHODDEF(jvirt_barray_ptr)\nrequest_virt_barray (j_common_ptr cinfo, int pool_id, boolean pre_zero,\n\t\t     JDIMENSION blocksperrow, JDIMENSION numrows,\n\t\t     JDIMENSION maxaccess)\n/* Request a virtual 2-D coefficient-block array */\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  jvirt_barray_ptr result;\n\n  /* Only IMAGE-lifetime virtual arrays are currently supported */\n  if (pool_id != JPOOL_IMAGE)\n    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);\t/* safety check */\n\n  /* get control block */\n  result = (jvirt_barray_ptr) alloc_small(cinfo, pool_id,\n\t\t\t\t\t  SIZEOF(struct jvirt_barray_control));\n\n  result->mem_buffer = NULL;\t/* marks array not yet realized */\n  result->rows_in_array = numrows;\n  result->blocksperrow = blocksperrow;\n  result->maxaccess = maxaccess;\n  result->pre_zero = pre_zero;\n  result->b_s_open = FALSE;\t/* no associated backing-store object */\n  result->next = mem->virt_barray_list; /* add to list of virtual arrays */\n  mem->virt_barray_list = result;\n\n  return result;\n}\n\n\nMETHODDEF(void)\nrealize_virt_arrays (j_common_ptr cinfo)\n/* Allocate the in-memory buffers for any unrealized virtual arrays */\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  size_t space_per_minheight, maximum_space, avail_mem;\n  size_t minheights, max_minheights;\n  jvirt_sarray_ptr sptr;\n  jvirt_barray_ptr bptr;\n\n  /* Compute the minimum space needed (maxaccess rows in each buffer)\n   * and the maximum space needed (full image height in each buffer).\n   * These may be of use to the system-dependent jpeg_mem_available routine.\n   */\n  space_per_minheight = 0;\n  maximum_space = 0;\n  for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {\n    if (sptr->mem_buffer == NULL) { /* if not realized yet */\n      space_per_minheight += (long) sptr->maxaccess *\n\t\t\t     (long) sptr->samplesperrow * SIZEOF(JSAMPLE);\n      maximum_space += (long) sptr->rows_in_array *\n\t\t       (long) sptr->samplesperrow * SIZEOF(JSAMPLE);\n    }\n  }\n  for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {\n    if (bptr->mem_buffer == NULL) { /* if not realized yet */\n      space_per_minheight += (long) bptr->maxaccess *\n\t\t\t     (long) bptr->blocksperrow * SIZEOF(JBLOCK);\n      maximum_space += (long) bptr->rows_in_array *\n\t\t       (long) bptr->blocksperrow * SIZEOF(JBLOCK);\n    }\n  }\n\n  if (space_per_minheight <= 0)\n    return;\t\t\t/* no unrealized arrays, no work */\n\n  /* Determine amount of memory to actually use; this is system-dependent. */\n  avail_mem = jpeg_mem_available(cinfo, space_per_minheight, maximum_space,\n\t\t\t\t mem->total_space_allocated);\n\n  /* If the maximum space needed is available, make all the buffers full\n   * height; otherwise parcel it out with the same number of minheights\n   * in each buffer.\n   */\n  if (avail_mem >= maximum_space)\n    max_minheights = 1000000000L;\n  else {\n    max_minheights = avail_mem / space_per_minheight;\n    /* If there doesn't seem to be enough space, try to get the minimum\n     * anyway.  This allows a \"stub\" implementation of jpeg_mem_available().\n     */\n    if (max_minheights <= 0)\n      max_minheights = 1;\n  }\n\n  /* Allocate the in-memory buffers and initialize backing store as needed. */\n\n  for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {\n    if (sptr->mem_buffer == NULL) { /* if not realized yet */\n      minheights = ((long) sptr->rows_in_array - 1L) / sptr->maxaccess + 1L;\n      if (minheights <= max_minheights) {\n\t/* This buffer fits in memory */\n\tsptr->rows_in_mem = sptr->rows_in_array;\n      } else {\n\t/* It doesn't fit in memory, create backing store. */\n\tsptr->rows_in_mem = (JDIMENSION) (max_minheights * sptr->maxaccess);\n\tjpeg_open_backing_store(cinfo, & sptr->b_s_info,\n\t\t\t\t(long) sptr->rows_in_array *\n\t\t\t\t(long) sptr->samplesperrow *\n\t\t\t\t(long) SIZEOF(JSAMPLE));\n\tsptr->b_s_open = TRUE;\n      }\n      sptr->mem_buffer = alloc_sarray(cinfo, JPOOL_IMAGE,\n\t\t\t\t      sptr->samplesperrow, sptr->rows_in_mem);\n      sptr->rowsperchunk = mem->last_rowsperchunk;\n      sptr->cur_start_row = 0;\n      sptr->first_undef_row = 0;\n      sptr->dirty = FALSE;\n    }\n  }\n\n  for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {\n    if (bptr->mem_buffer == NULL) { /* if not realized yet */\n      minheights = ((long) bptr->rows_in_array - 1L) / bptr->maxaccess + 1L;\n      if (minheights <= max_minheights) {\n\t/* This buffer fits in memory */\n\tbptr->rows_in_mem = bptr->rows_in_array;\n      } else {\n\t/* It doesn't fit in memory, create backing store. */\n\tbptr->rows_in_mem = (JDIMENSION) (max_minheights * bptr->maxaccess);\n\tjpeg_open_backing_store(cinfo, & bptr->b_s_info,\n\t\t\t\t(long) bptr->rows_in_array *\n\t\t\t\t(long) bptr->blocksperrow *\n\t\t\t\t(long) SIZEOF(JBLOCK));\n\tbptr->b_s_open = TRUE;\n      }\n      bptr->mem_buffer = alloc_barray(cinfo, JPOOL_IMAGE,\n\t\t\t\t      bptr->blocksperrow, bptr->rows_in_mem);\n      bptr->rowsperchunk = mem->last_rowsperchunk;\n      bptr->cur_start_row = 0;\n      bptr->first_undef_row = 0;\n      bptr->dirty = FALSE;\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_sarray_io (j_common_ptr cinfo, jvirt_sarray_ptr ptr, boolean writing)\n/* Do backing store read or write of a virtual sample array */\n{\n  long bytesperrow, file_offset, byte_count, rows, thisrow, i;\n\n  bytesperrow = (long) ptr->samplesperrow * SIZEOF(JSAMPLE);\n  file_offset = ptr->cur_start_row * bytesperrow;\n  /* Loop to read or write each allocation chunk in mem_buffer */\n  for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {\n    /* One chunk, but check for short chunk at end of buffer */\n    rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i);\n    /* Transfer no more than is currently defined */\n    thisrow = (long) ptr->cur_start_row + i;\n    rows = MIN(rows, (long) ptr->first_undef_row - thisrow);\n    /* Transfer no more than fits in file */\n    rows = MIN(rows, (long) ptr->rows_in_array - thisrow);\n    if (rows <= 0)\t\t/* this chunk might be past end of file! */\n      break;\n    byte_count = rows * bytesperrow;\n    if (writing)\n      (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info,\n\t\t\t\t\t    (void FAR *) ptr->mem_buffer[i],\n\t\t\t\t\t    file_offset, byte_count);\n    else\n      (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info,\n\t\t\t\t\t   (void FAR *) ptr->mem_buffer[i],\n\t\t\t\t\t   file_offset, byte_count);\n    file_offset += byte_count;\n  }\n}\n\n\nLOCAL(void)\ndo_barray_io (j_common_ptr cinfo, jvirt_barray_ptr ptr, boolean writing)\n/* Do backing store read or write of a virtual coefficient-block array */\n{\n  long bytesperrow, file_offset, byte_count, rows, thisrow, i;\n\n  bytesperrow = (long) ptr->blocksperrow * SIZEOF(JBLOCK);\n  file_offset = ptr->cur_start_row * bytesperrow;\n  /* Loop to read or write each allocation chunk in mem_buffer */\n  for (i = 0; i < (long) ptr->rows_in_mem; i += ptr->rowsperchunk) {\n    /* One chunk, but check for short chunk at end of buffer */\n    rows = MIN((long) ptr->rowsperchunk, (long) ptr->rows_in_mem - i);\n    /* Transfer no more than is currently defined */\n    thisrow = (long) ptr->cur_start_row + i;\n    rows = MIN(rows, (long) ptr->first_undef_row - thisrow);\n    /* Transfer no more than fits in file */\n    rows = MIN(rows, (long) ptr->rows_in_array - thisrow);\n    if (rows <= 0)\t\t/* this chunk might be past end of file! */\n      break;\n    byte_count = rows * bytesperrow;\n    if (writing)\n      (*ptr->b_s_info.write_backing_store) (cinfo, & ptr->b_s_info,\n\t\t\t\t\t    (void FAR *) ptr->mem_buffer[i],\n\t\t\t\t\t    file_offset, byte_count);\n    else\n      (*ptr->b_s_info.read_backing_store) (cinfo, & ptr->b_s_info,\n\t\t\t\t\t   (void FAR *) ptr->mem_buffer[i],\n\t\t\t\t\t   file_offset, byte_count);\n    file_offset += byte_count;\n  }\n}\n\n\nMETHODDEF(JSAMPARRAY)\naccess_virt_sarray (j_common_ptr cinfo, jvirt_sarray_ptr ptr,\n\t\t    JDIMENSION start_row, JDIMENSION num_rows,\n\t\t    boolean writable)\n/* Access the part of a virtual sample array starting at start_row */\n/* and extending for num_rows rows.  writable is true if  */\n/* caller intends to modify the accessed area. */\n{\n  JDIMENSION end_row = start_row + num_rows;\n  JDIMENSION undef_row;\n\n  /* debugging check */\n  if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess ||\n      ptr->mem_buffer == NULL)\n    ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);\n\n  /* Make the desired part of the virtual array accessible */\n  if (start_row < ptr->cur_start_row ||\n      end_row > ptr->cur_start_row+ptr->rows_in_mem) {\n    if (! ptr->b_s_open)\n      ERREXIT(cinfo, JERR_VIRTUAL_BUG);\n    /* Flush old buffer contents if necessary */\n    if (ptr->dirty) {\n      do_sarray_io(cinfo, ptr, TRUE);\n      ptr->dirty = FALSE;\n    }\n    /* Decide what part of virtual array to access.\n     * Algorithm: if target address > current window, assume forward scan,\n     * load starting at target address.  If target address < current window,\n     * assume backward scan, load so that target area is top of window.\n     * Note that when switching from forward write to forward read, will have\n     * start_row = 0, so the limiting case applies and we load from 0 anyway.\n     */\n    if (start_row > ptr->cur_start_row) {\n      ptr->cur_start_row = start_row;\n    } else {\n      /* use long arithmetic here to avoid overflow & unsigned problems */\n      long ltemp;\n\n      ltemp = (long) end_row - (long) ptr->rows_in_mem;\n      if (ltemp < 0)\n\tltemp = 0;\t\t/* don't fall off front end of file */\n      ptr->cur_start_row = (JDIMENSION) ltemp;\n    }\n    /* Read in the selected part of the array.\n     * During the initial write pass, we will do no actual read\n     * because the selected part is all undefined.\n     */\n    do_sarray_io(cinfo, ptr, FALSE);\n  }\n  /* Ensure the accessed part of the array is defined; prezero if needed.\n   * To improve locality of access, we only prezero the part of the array\n   * that the caller is about to access, not the entire in-memory array.\n   */\n  if (ptr->first_undef_row < end_row) {\n    if (ptr->first_undef_row < start_row) {\n      if (writable)\t\t/* writer skipped over a section of array */\n\tERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);\n      undef_row = start_row;\t/* but reader is allowed to read ahead */\n    } else {\n      undef_row = ptr->first_undef_row;\n    }\n    if (writable)\n      ptr->first_undef_row = end_row;\n    if (ptr->pre_zero) {\n      size_t bytesperrow = (size_t) ptr->samplesperrow * SIZEOF(JSAMPLE);\n      undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */\n      end_row -= ptr->cur_start_row;\n      while (undef_row < end_row) {\n\tjzero_far((void FAR *) ptr->mem_buffer[undef_row], bytesperrow);\n\tundef_row++;\n      }\n    } else {\n      if (! writable)\t\t/* reader looking at undefined data */\n\tERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);\n    }\n  }\n  /* Flag the buffer dirty if caller will write in it */\n  if (writable)\n    ptr->dirty = TRUE;\n  /* Return address of proper part of the buffer */\n  return ptr->mem_buffer + (start_row - ptr->cur_start_row);\n}\n\n\nMETHODDEF(JBLOCKARRAY)\naccess_virt_barray (j_common_ptr cinfo, jvirt_barray_ptr ptr,\n\t\t    JDIMENSION start_row, JDIMENSION num_rows,\n\t\t    boolean writable)\n/* Access the part of a virtual block array starting at start_row */\n/* and extending for num_rows rows.  writable is true if  */\n/* caller intends to modify the accessed area. */\n{\n  JDIMENSION end_row = start_row + num_rows;\n  JDIMENSION undef_row;\n\n  /* debugging check */\n  if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess ||\n      ptr->mem_buffer == NULL)\n    ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);\n\n  /* Make the desired part of the virtual array accessible */\n  if (start_row < ptr->cur_start_row ||\n      end_row > ptr->cur_start_row+ptr->rows_in_mem) {\n    if (! ptr->b_s_open)\n      ERREXIT(cinfo, JERR_VIRTUAL_BUG);\n    /* Flush old buffer contents if necessary */\n    if (ptr->dirty) {\n      do_barray_io(cinfo, ptr, TRUE);\n      ptr->dirty = FALSE;\n    }\n    /* Decide what part of virtual array to access.\n     * Algorithm: if target address > current window, assume forward scan,\n     * load starting at target address.  If target address < current window,\n     * assume backward scan, load so that target area is top of window.\n     * Note that when switching from forward write to forward read, will have\n     * start_row = 0, so the limiting case applies and we load from 0 anyway.\n     */\n    if (start_row > ptr->cur_start_row) {\n      ptr->cur_start_row = start_row;\n    } else {\n      /* use long arithmetic here to avoid overflow & unsigned problems */\n      long ltemp;\n\n      ltemp = (long) end_row - (long) ptr->rows_in_mem;\n      if (ltemp < 0)\n\tltemp = 0;\t\t/* don't fall off front end of file */\n      ptr->cur_start_row = (JDIMENSION) ltemp;\n    }\n    /* Read in the selected part of the array.\n     * During the initial write pass, we will do no actual read\n     * because the selected part is all undefined.\n     */\n    do_barray_io(cinfo, ptr, FALSE);\n  }\n  /* Ensure the accessed part of the array is defined; prezero if needed.\n   * To improve locality of access, we only prezero the part of the array\n   * that the caller is about to access, not the entire in-memory array.\n   */\n  if (ptr->first_undef_row < end_row) {\n    if (ptr->first_undef_row < start_row) {\n      if (writable)\t\t/* writer skipped over a section of array */\n\tERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);\n      undef_row = start_row;\t/* but reader is allowed to read ahead */\n    } else {\n      undef_row = ptr->first_undef_row;\n    }\n    if (writable)\n      ptr->first_undef_row = end_row;\n    if (ptr->pre_zero) {\n      size_t bytesperrow = (size_t) ptr->blocksperrow * SIZEOF(JBLOCK);\n      undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */\n      end_row -= ptr->cur_start_row;\n      while (undef_row < end_row) {\n\tjzero_far((void FAR *) ptr->mem_buffer[undef_row], bytesperrow);\n\tundef_row++;\n      }\n    } else {\n      if (! writable)\t\t/* reader looking at undefined data */\n\tERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);\n    }\n  }\n  /* Flag the buffer dirty if caller will write in it */\n  if (writable)\n    ptr->dirty = TRUE;\n  /* Return address of proper part of the buffer */\n  return ptr->mem_buffer + (start_row - ptr->cur_start_row);\n}\n\n\n/*\n * Release all objects belonging to a specified pool.\n */\n\nMETHODDEF(void)\nfree_pool (j_common_ptr cinfo, int pool_id)\n{\n  my_mem_ptr mem = (my_mem_ptr) cinfo->mem;\n  small_pool_ptr shdr_ptr;\n  large_pool_ptr lhdr_ptr;\n  size_t space_freed;\n\n  if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)\n    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id);\t/* safety check */\n\n#ifdef MEM_STATS\n  if (cinfo->err->trace_level > 1)\n    print_mem_stats(cinfo, pool_id); /* print pool's memory usage statistics */\n#endif\n\n  /* If freeing IMAGE pool, close any virtual arrays first */\n  if (pool_id == JPOOL_IMAGE) {\n    jvirt_sarray_ptr sptr;\n    jvirt_barray_ptr bptr;\n\n    for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {\n      if (sptr->b_s_open) {\t/* there may be no backing store */\n\tsptr->b_s_open = FALSE;\t/* prevent recursive close if error */\n\t(*sptr->b_s_info.close_backing_store) (cinfo, & sptr->b_s_info);\n      }\n    }\n    mem->virt_sarray_list = NULL;\n    for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {\n      if (bptr->b_s_open) {\t/* there may be no backing store */\n\tbptr->b_s_open = FALSE;\t/* prevent recursive close if error */\n\t(*bptr->b_s_info.close_backing_store) (cinfo, & bptr->b_s_info);\n      }\n    }\n    mem->virt_barray_list = NULL;\n  }\n\n  /* Release large objects */\n  lhdr_ptr = mem->large_list[pool_id];\n  mem->large_list[pool_id] = NULL;\n\n  while (lhdr_ptr != NULL) {\n    large_pool_ptr next_lhdr_ptr = lhdr_ptr->next;\n    space_freed = lhdr_ptr->bytes_used +\n\t\t  lhdr_ptr->bytes_left +\n\t\t  SIZEOF(large_pool_hdr);\n    jpeg_free_large(cinfo, (void FAR *) lhdr_ptr, space_freed);\n    mem->total_space_allocated -= space_freed;\n    lhdr_ptr = next_lhdr_ptr;\n  }\n\n  /* Release small objects */\n  shdr_ptr = mem->small_list[pool_id];\n  mem->small_list[pool_id] = NULL;\n\n  while (shdr_ptr != NULL) {\n    small_pool_ptr next_shdr_ptr = shdr_ptr->next;\n    space_freed = shdr_ptr->bytes_used +\n\t\t  shdr_ptr->bytes_left +\n\t\t  SIZEOF(small_pool_hdr);\n    jpeg_free_small(cinfo, (void *) shdr_ptr, space_freed);\n    mem->total_space_allocated -= space_freed;\n    shdr_ptr = next_shdr_ptr;\n  }\n}\n\n\n/*\n * Close up shop entirely.\n * Note that this cannot be called unless cinfo->mem is non-NULL.\n */\n\nMETHODDEF(void)\nself_destruct (j_common_ptr cinfo)\n{\n  int pool;\n\n  /* Close all backing store, release all memory.\n   * Releasing pools in reverse order might help avoid fragmentation\n   * with some (brain-damaged) malloc libraries.\n   */\n  for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) {\n    free_pool(cinfo, pool);\n  }\n\n  /* Release the memory manager control block too. */\n  jpeg_free_small(cinfo, (void *) cinfo->mem, SIZEOF(my_memory_mgr));\n  cinfo->mem = NULL;\t\t/* ensures I will be called only once */\n\n  jpeg_mem_term(cinfo);\t\t/* system-dependent cleanup */\n}\n\n\n/*\n * Memory manager initialization.\n * When this is called, only the error manager pointer is valid in cinfo!\n */\n\nGLOBAL(void)\njinit_memory_mgr (j_common_ptr cinfo)\n{\n  my_mem_ptr mem;\n  long max_to_use;\n  int pool;\n  size_t test_mac;\n\n  cinfo->mem = NULL;\t\t/* for safety if init fails */\n\n  /* Check for configuration errors.\n   * SIZEOF(ALIGN_TYPE) should be a power of 2; otherwise, it probably\n   * doesn't reflect any real hardware alignment requirement.\n   * The test is a little tricky: for X>0, X and X-1 have no one-bits\n   * in common if and only if X is a power of 2, ie has only one one-bit.\n   * Some compilers may give an \"unreachable code\" warning here; ignore it.\n   */\n  if ((ALIGN_SIZE & (ALIGN_SIZE-1)) != 0)\n    ERREXIT(cinfo, JERR_BAD_ALIGN_TYPE);\n  /* MAX_ALLOC_CHUNK must be representable as type size_t, and must be\n   * a multiple of ALIGN_SIZE.\n   * Again, an \"unreachable code\" warning may be ignored here.\n   * But a \"constant too large\" warning means you need to fix MAX_ALLOC_CHUNK.\n   */\n  test_mac = (size_t) MAX_ALLOC_CHUNK;\n  if ((long) test_mac != MAX_ALLOC_CHUNK ||\n      (MAX_ALLOC_CHUNK % ALIGN_SIZE) != 0)\n    ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK);\n\n  max_to_use = jpeg_mem_init(cinfo); /* system-dependent initialization */\n\n  /* Attempt to allocate memory manager's control block */\n  mem = (my_mem_ptr) jpeg_get_small(cinfo, SIZEOF(my_memory_mgr));\n\n  if (mem == NULL) {\n    jpeg_mem_term(cinfo);\t/* system-dependent cleanup */\n    ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 0);\n  }\n\n  /* OK, fill in the method pointers */\n  mem->pub.alloc_small = alloc_small;\n  mem->pub.alloc_large = alloc_large;\n  mem->pub.alloc_sarray = alloc_sarray;\n  mem->pub.alloc_barray = alloc_barray;\n  mem->pub.request_virt_sarray = request_virt_sarray;\n  mem->pub.request_virt_barray = request_virt_barray;\n  mem->pub.realize_virt_arrays = realize_virt_arrays;\n  mem->pub.access_virt_sarray = access_virt_sarray;\n  mem->pub.access_virt_barray = access_virt_barray;\n  mem->pub.free_pool = free_pool;\n  mem->pub.self_destruct = self_destruct;\n\n  /* Make MAX_ALLOC_CHUNK accessible to other modules */\n  mem->pub.max_alloc_chunk = MAX_ALLOC_CHUNK;\n\n  /* Initialize working state */\n  mem->pub.max_memory_to_use = max_to_use;\n\n  for (pool = JPOOL_NUMPOOLS-1; pool >= JPOOL_PERMANENT; pool--) {\n    mem->small_list[pool] = NULL;\n    mem->large_list[pool] = NULL;\n  }\n  mem->virt_sarray_list = NULL;\n  mem->virt_barray_list = NULL;\n\n  mem->total_space_allocated = SIZEOF(my_memory_mgr);\n\n  /* Declare ourselves open for business */\n  cinfo->mem = & mem->pub;\n\n  /* Check for an environment variable JPEGMEM; if found, override the\n   * default max_memory setting from jpeg_mem_init.  Note that the\n   * surrounding application may again override this value.\n   * If your system doesn't support getenv(), define NO_GETENV to disable\n   * this feature.\n   */\n#ifndef NO_GETENV\n  { char * memenv;\n\n    if ((memenv = getenv(\"JPEGMEM\")) != NULL) {\n      char ch = 'x';\n\n      if (sscanf(memenv, \"%ld%c\", &max_to_use, &ch) > 0) {\n\tif (ch == 'm' || ch == 'M')\n\t  max_to_use *= 1000L;\n\tmem->pub.max_memory_to_use = max_to_use * 1000L;\n      }\n    }\n  }\n#endif\n\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jmemnobs.c",
    "content": "/*\n * jmemnobs.c\n *\n * Copyright (C) 1992-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file provides a really simple implementation of the system-\n * dependent portion of the JPEG memory manager.  This implementation\n * assumes that no backing-store files are needed: all required space\n * can be obtained from malloc().\n * This is very portable in the sense that it'll compile on almost anything,\n * but you'd better have lots of main memory (or virtual memory) if you want\n * to process big images.\n * Note that the max_memory_to_use option is ignored by this implementation.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jmemsys.h\"\t\t/* import the system-dependent declarations */\n\n#ifndef HAVE_STDLIB_H\t\t/* <stdlib.h> should declare malloc(),free() */\nextern void * malloc JPP((size_t size));\nextern void free JPP((void *ptr));\n#endif\n\n\n/*\n * Memory allocation and freeing are controlled by the regular library\n * routines malloc() and free().\n */\n\nGLOBAL(void *)\njpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)\n{\n  return (void *) malloc(sizeofobject);\n}\n\nGLOBAL(void)\njpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)\n{\n  free(object);\n}\n\n\n/*\n * \"Large\" objects are treated the same as \"small\" ones.\n * NB: although we include FAR keywords in the routine declarations,\n * this file won't actually work in 80x86 small/medium model; at least,\n * you probably won't be able to process useful-size images in only 64KB.\n */\n\nGLOBAL(void FAR *)\njpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)\n{\n  return (void FAR *) malloc(sizeofobject);\n}\n\nGLOBAL(void)\njpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)\n{\n  free(object);\n}\n\n\n/*\n * This routine computes the total memory space available for allocation.\n * Here we always say, \"we got all you want bud!\"\n */\n\nGLOBAL(size_t)\njpeg_mem_available (j_common_ptr cinfo, size_t min_bytes_needed,\n\t\t    size_t max_bytes_needed, size_t already_allocated)\n{\n  return max_bytes_needed;\n}\n\n\n/*\n * Backing store (temporary file) management.\n * Since jpeg_mem_available always promised the moon,\n * this should never be called and we can just error out.\n */\n\nGLOBAL(void)\njpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,\n\t\t\t long total_bytes_needed)\n{\n  ERREXIT(cinfo, JERR_NO_BACKING_STORE);\n}\n\n\n/*\n * These routines take care of any system-dependent initialization and\n * cleanup required.  Here, there isn't any.\n */\n\nGLOBAL(long)\njpeg_mem_init (j_common_ptr cinfo)\n{\n  return 0;\t\t\t/* just set max_memory_to_use to 0 */\n}\n\nGLOBAL(void)\njpeg_mem_term (j_common_ptr cinfo)\n{\n  /* no work */\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jmemsys.h",
    "content": "/*\n * jmemsys.h\n *\n * Copyright (C) 1992-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This include file defines the interface between the system-independent\n * and system-dependent portions of the JPEG memory manager.  No other\n * modules need include it.  (The system-independent portion is jmemmgr.c;\n * there are several different versions of the system-dependent portion.)\n *\n * This file works as-is for the system-dependent memory managers supplied\n * in the IJG distribution.  You may need to modify it if you write a\n * custom memory manager.  If system-dependent changes are needed in\n * this file, the best method is to #ifdef them based on a configuration\n * symbol supplied in jconfig.h, as we have done with USE_MSDOS_MEMMGR\n * and USE_MAC_MEMMGR.\n */\n\n\n/* Short forms of external names for systems with brain-damaged linkers. */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jpeg_get_small\t\tjGetSmall\n#define jpeg_free_small\t\tjFreeSmall\n#define jpeg_get_large\t\tjGetLarge\n#define jpeg_free_large\t\tjFreeLarge\n#define jpeg_mem_available\tjMemAvail\n#define jpeg_open_backing_store\tjOpenBackStore\n#define jpeg_mem_init\t\tjMemInit\n#define jpeg_mem_term\t\tjMemTerm\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\n\n/*\n * These two functions are used to allocate and release small chunks of\n * memory.  (Typically the total amount requested through jpeg_get_small is\n * no more than 20K or so; this will be requested in chunks of a few K each.)\n * Behavior should be the same as for the standard library functions malloc\n * and free; in particular, jpeg_get_small must return NULL on failure.\n * On most systems, these ARE malloc and free.  jpeg_free_small is passed the\n * size of the object being freed, just in case it's needed.\n * On an 80x86 machine using small-data memory model, these manage near heap.\n */\n\nEXTERN(void *) jpeg_get_small JPP((j_common_ptr cinfo, size_t sizeofobject));\nEXTERN(void) jpeg_free_small JPP((j_common_ptr cinfo, void * object,\n\t\t\t\t  size_t sizeofobject));\n\n/*\n * These two functions are used to allocate and release large chunks of\n * memory (up to the total free space designated by jpeg_mem_available).\n * The interface is the same as above, except that on an 80x86 machine,\n * far pointers are used.  On most other machines these are identical to\n * the jpeg_get/free_small routines; but we keep them separate anyway,\n * in case a different allocation strategy is desirable for large chunks.\n */\n\nEXTERN(void FAR *) jpeg_get_large JPP((j_common_ptr cinfo,\n\t\t\t\t       size_t sizeofobject));\nEXTERN(void) jpeg_free_large JPP((j_common_ptr cinfo, void FAR * object,\n\t\t\t\t  size_t sizeofobject));\n\n/*\n * The macro MAX_ALLOC_CHUNK designates the maximum number of bytes that may\n * be requested in a single call to jpeg_get_large (and jpeg_get_small for that\n * matter, but that case should never come into play).  This macro is needed\n * to model the 64Kb-segment-size limit of far addressing on 80x86 machines.\n * On those machines, we expect that jconfig.h will provide a proper value.\n * On machines with 32-bit flat address spaces, any large constant may be used.\n *\n * NB: jmemmgr.c expects that MAX_ALLOC_CHUNK will be representable as type\n * size_t and will be a multiple of sizeof(align_type).\n */\n\n#ifndef MAX_ALLOC_CHUNK\t\t/* may be overridden in jconfig.h */\n#define MAX_ALLOC_CHUNK  1000000000L\n#endif\n\n/*\n * This routine computes the total space still available for allocation by\n * jpeg_get_large.  If more space than this is needed, backing store will be\n * used.  NOTE: any memory already allocated must not be counted.\n *\n * There is a minimum space requirement, corresponding to the minimum\n * feasible buffer sizes; jmemmgr.c will request that much space even if\n * jpeg_mem_available returns zero.  The maximum space needed, enough to hold\n * all working storage in memory, is also passed in case it is useful.\n * Finally, the total space already allocated is passed.  If no better\n * method is available, cinfo->mem->max_memory_to_use - already_allocated\n * is often a suitable calculation.\n *\n * It is OK for jpeg_mem_available to underestimate the space available\n * (that'll just lead to more backing-store access than is really necessary).\n * However, an overestimate will lead to failure.  Hence it's wise to subtract\n * a slop factor from the true available space.  5% should be enough.\n *\n * On machines with lots of virtual memory, any large constant may be returned.\n * Conversely, zero may be returned to always use the minimum amount of memory.\n */\n\nEXTERN(size_t) jpeg_mem_available JPP((j_common_ptr cinfo,\n\t\t\t\t     size_t min_bytes_needed,\n\t\t\t\t     size_t max_bytes_needed,\n\t\t\t\t     size_t already_allocated));\n\n\n/*\n * This structure holds whatever state is needed to access a single\n * backing-store object.  The read/write/close method pointers are called\n * by jmemmgr.c to manipulate the backing-store object; all other fields\n * are private to the system-dependent backing store routines.\n */\n\n#define TEMP_NAME_LENGTH   64\t/* max length of a temporary file's name */\n\n\n#ifdef USE_MSDOS_MEMMGR\t\t/* DOS-specific junk */\n\ntypedef unsigned short XMSH;\t/* type of extended-memory handles */\ntypedef unsigned short EMSH;\t/* type of expanded-memory handles */\n\ntypedef union {\n  short file_handle;\t\t/* DOS file handle if it's a temp file */\n  XMSH xms_handle;\t\t/* handle if it's a chunk of XMS */\n  EMSH ems_handle;\t\t/* handle if it's a chunk of EMS */\n} handle_union;\n\n#endif /* USE_MSDOS_MEMMGR */\n\n#ifdef USE_MAC_MEMMGR\t\t/* Mac-specific junk */\n#include <Files.h>\n#endif /* USE_MAC_MEMMGR */\n\n\ntypedef struct backing_store_struct * backing_store_ptr;\n\ntypedef struct backing_store_struct {\n  /* Methods for reading/writing/closing this backing-store object */\n  JMETHOD(void, read_backing_store, (j_common_ptr cinfo,\n\t\t\t\t     backing_store_ptr info,\n\t\t\t\t     void FAR * buffer_address,\n\t\t\t\t     long file_offset, long byte_count));\n  JMETHOD(void, write_backing_store, (j_common_ptr cinfo,\n\t\t\t\t      backing_store_ptr info,\n\t\t\t\t      void FAR * buffer_address,\n\t\t\t\t      long file_offset, long byte_count));\n  JMETHOD(void, close_backing_store, (j_common_ptr cinfo,\n\t\t\t\t      backing_store_ptr info));\n\n  /* Private fields for system-dependent backing-store management */\n#ifdef USE_MSDOS_MEMMGR\n  /* For the MS-DOS manager (jmemdos.c), we need: */\n  handle_union handle;\t\t/* reference to backing-store storage object */\n  char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */\n#else\n#ifdef USE_MAC_MEMMGR\n  /* For the Mac manager (jmemmac.c), we need: */\n  short temp_file;\t\t/* file reference number to temp file */\n  FSSpec tempSpec;\t\t/* the FSSpec for the temp file */\n  char temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */\n#else\n  /* For a typical implementation with temp files, we need: */\n  FILE * temp_file;\t\t/* stdio reference to temp file */\n  char temp_name[TEMP_NAME_LENGTH]; /* name of temp file */\n#endif\n#endif\n} backing_store_info;\n\n\n/*\n * Initial opening of a backing-store object.  This must fill in the\n * read/write/close pointers in the object.  The read/write routines\n * may take an error exit if the specified maximum file size is exceeded.\n * (If jpeg_mem_available always returns a large value, this routine can\n * just take an error exit.)\n */\n\nEXTERN(void) jpeg_open_backing_store JPP((j_common_ptr cinfo,\n\t\t\t\t\t  backing_store_ptr info,\n\t\t\t\t\t  long total_bytes_needed));\n\n\n/*\n * These routines take care of any system-dependent initialization and\n * cleanup required.  jpeg_mem_init will be called before anything is\n * allocated (and, therefore, nothing in cinfo is of use except the error\n * manager pointer).  It should return a suitable default value for\n * max_memory_to_use; this may subsequently be overridden by the surrounding\n * application.  (Note that max_memory_to_use is only important if\n * jpeg_mem_available chooses to consult it ... no one else will.)\n * jpeg_mem_term may assume that all requested memory has been freed and that\n * all opened backing-store objects have been closed.\n */\n\nEXTERN(long) jpeg_mem_init JPP((j_common_ptr cinfo));\nEXTERN(void) jpeg_mem_term JPP((j_common_ptr cinfo));\n"
  },
  {
    "path": "ext/libjpeg-turbo/jmorecfg.h",
    "content": "/*\n * jmorecfg.h\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modifications:\n * Copyright (C) 2009, 2011, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains additional configuration options that customize the\n * JPEG software for special applications or support machine-dependent\n * optimizations.  Most users will not need to touch this file.\n */\n\n\n/*\n * Define BITS_IN_JSAMPLE as either\n *   8   for 8-bit sample values (the usual setting)\n *   12  for 12-bit sample values\n * Only 8 and 12 are legal data precisions for lossy JPEG according to the\n * JPEG standard, and the IJG code does not support anything else!\n * We do not support run-time selection of data precision, sorry.\n */\n\n#define BITS_IN_JSAMPLE  8\t/* use 8 or 12 */\n\n\n/*\n * Maximum number of components (color channels) allowed in JPEG image.\n * To meet the letter of the JPEG spec, set this to 255.  However, darn\n * few applications need more than 4 channels (maybe 5 for CMYK + alpha\n * mask).  We recommend 10 as a reasonable compromise; use 4 if you are\n * really short on memory.  (Each allowed component costs a hundred or so\n * bytes of storage, whether actually used in an image or not.)\n */\n\n#define MAX_COMPONENTS  10\t/* maximum number of image components */\n\n\n/*\n * Basic data types.\n * You may need to change these if you have a machine with unusual data\n * type sizes; for example, \"char\" not 8 bits, \"short\" not 16 bits,\n * or \"long\" not 32 bits.  We don't care whether \"int\" is 16 or 32 bits,\n * but it had better be at least 16.\n */\n\n/* Representation of a single sample (pixel element value).\n * We frequently allocate large arrays of these, so it's important to keep\n * them small.  But if you have memory to burn and access to char or short\n * arrays is very slow on your hardware, you might want to change these.\n */\n\n#if BITS_IN_JSAMPLE == 8\n/* JSAMPLE should be the smallest type that will hold the values 0..255.\n * You can use a signed char by having GETJSAMPLE mask it with 0xFF.\n */\n\n#ifdef HAVE_UNSIGNED_CHAR\n\ntypedef unsigned char JSAMPLE;\n#define GETJSAMPLE(value)  ((int) (value))\n\n#else /* not HAVE_UNSIGNED_CHAR */\n\ntypedef char JSAMPLE;\n#ifdef __CHAR_UNSIGNED__\n#define GETJSAMPLE(value)  ((int) (value))\n#else\n#define GETJSAMPLE(value)  ((int) (value) & 0xFF)\n#endif /* __CHAR_UNSIGNED__ */\n\n#endif /* HAVE_UNSIGNED_CHAR */\n\n#define MAXJSAMPLE\t255\n#define CENTERJSAMPLE\t128\n\n#endif /* BITS_IN_JSAMPLE == 8 */\n\n\n#if BITS_IN_JSAMPLE == 12\n/* JSAMPLE should be the smallest type that will hold the values 0..4095.\n * On nearly all machines \"short\" will do nicely.\n */\n\ntypedef short JSAMPLE;\n#define GETJSAMPLE(value)  ((int) (value))\n\n#define MAXJSAMPLE\t4095\n#define CENTERJSAMPLE\t2048\n\n#endif /* BITS_IN_JSAMPLE == 12 */\n\n\n/* Representation of a DCT frequency coefficient.\n * This should be a signed value of at least 16 bits; \"short\" is usually OK.\n * Again, we allocate large arrays of these, but you can change to int\n * if you have memory to burn and \"short\" is really slow.\n */\n\ntypedef short JCOEF;\n\n\n/* Compressed datastreams are represented as arrays of JOCTET.\n * These must be EXACTLY 8 bits wide, at least once they are written to\n * external storage.  Note that when using the stdio data source/destination\n * managers, this is also the data type passed to fread/fwrite.\n */\n\n#ifdef HAVE_UNSIGNED_CHAR\n\ntypedef unsigned char JOCTET;\n#define GETJOCTET(value)  (value)\n\n#else /* not HAVE_UNSIGNED_CHAR */\n\ntypedef char JOCTET;\n#ifdef __CHAR_UNSIGNED__\n#define GETJOCTET(value)  (value)\n#else\n#define GETJOCTET(value)  ((value) & 0xFF)\n#endif /* __CHAR_UNSIGNED__ */\n\n#endif /* HAVE_UNSIGNED_CHAR */\n\n\n/* These typedefs are used for various table entries and so forth.\n * They must be at least as wide as specified; but making them too big\n * won't cost a huge amount of memory, so we don't provide special\n * extraction code like we did for JSAMPLE.  (In other words, these\n * typedefs live at a different point on the speed/space tradeoff curve.)\n */\n\n/* UINT8 must hold at least the values 0..255. */\n\n#ifdef HAVE_UNSIGNED_CHAR\ntypedef unsigned char UINT8;\n#else /* not HAVE_UNSIGNED_CHAR */\n#ifdef __CHAR_UNSIGNED__\ntypedef char UINT8;\n#else /* not __CHAR_UNSIGNED__ */\ntypedef short UINT8;\n#endif /* __CHAR_UNSIGNED__ */\n#endif /* HAVE_UNSIGNED_CHAR */\n\n/* UINT16 must hold at least the values 0..65535. */\n\n#ifdef HAVE_UNSIGNED_SHORT\ntypedef unsigned short UINT16;\n#else /* not HAVE_UNSIGNED_SHORT */\ntypedef unsigned int UINT16;\n#endif /* HAVE_UNSIGNED_SHORT */\n\n/* INT16 must hold at least the values -32768..32767. */\n\n#ifndef XMD_H\t\t\t/* X11/xmd.h correctly defines INT16 */\ntypedef short INT16;\n#endif\n\n/* INT32 must hold at least signed 32-bit values. */\n\n#ifndef XMD_H\t\t\t/* X11/xmd.h correctly defines INT32 */\ntypedef long INT32;\n#endif\n\n/* Datatype used for image dimensions.  The JPEG standard only supports\n * images up to 64K*64K due to 16-bit fields in SOF markers.  Therefore\n * \"unsigned int\" is sufficient on all machines.  However, if you need to\n * handle larger images and you don't mind deviating from the spec, you\n * can change this datatype.\n */\n\ntypedef unsigned int JDIMENSION;\n\n#define JPEG_MAX_DIMENSION  65500L  /* a tad under 64K to prevent overflows */\n\n\n/* These macros are used in all function definitions and extern declarations.\n * You could modify them if you need to change function linkage conventions;\n * in particular, you'll need to do that to make the library a Windows DLL.\n * Another application is to make all functions global for use with debuggers\n * or code profilers that require it.\n */\n\n/* a function called through method pointers: */\n#define METHODDEF(type)\t\tstatic type\n/* a function used only in its module: */\n#define LOCAL(type)\t\tstatic type\n/* a function referenced thru EXTERNs: */\n#define GLOBAL(type)\t\ttype\n/* a reference to a GLOBAL function: */\n#define EXTERN(type)\t\textern type\n\n\n/* This macro is used to declare a \"method\", that is, a function pointer.\n * We want to supply prototype parameters if the compiler can cope.\n * Note that the arglist parameter must be parenthesized!\n * Again, you can customize this if you need special linkage keywords.\n */\n\n#ifdef HAVE_PROTOTYPES\n#define JMETHOD(type,methodname,arglist)  type (*methodname) arglist\n#else\n#define JMETHOD(type,methodname,arglist)  type (*methodname) ()\n#endif\n\n\n/* Here is the pseudo-keyword for declaring pointers that must be \"far\"\n * on 80x86 machines.  Most of the specialized coding for 80x86 is handled\n * by just saying \"FAR *\" where such a pointer is needed.  In a few places\n * explicit coding is needed; see uses of the NEED_FAR_POINTERS symbol.\n */\n\n#ifdef NEED_FAR_POINTERS\n#ifndef FAR\n#define FAR  far\n#endif\n#else\n#undef FAR\n#define FAR\n#endif\n\n\n/*\n * On a few systems, type boolean and/or its values FALSE, TRUE may appear\n * in standard header files.  Or you may have conflicts with application-\n * specific header files that you want to include together with these files.\n * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.\n */\n\n#ifndef HAVE_BOOLEAN\ntypedef int boolean;\n#endif\n#ifndef FALSE\t\t\t/* in case these macros already exist */\n#define FALSE\t0\t\t/* values of boolean */\n#endif\n#ifndef TRUE\n#define TRUE\t1\n#endif\n\n\n/*\n * The remaining options affect code selection within the JPEG library,\n * but they don't need to be visible to most applications using the library.\n * To minimize application namespace pollution, the symbols won't be\n * defined unless JPEG_INTERNALS or JPEG_INTERNAL_OPTIONS has been defined.\n */\n\n#ifdef JPEG_INTERNALS\n#define JPEG_INTERNAL_OPTIONS\n#endif\n\n#ifdef JPEG_INTERNAL_OPTIONS\n\n\n/*\n * These defines indicate whether to include various optional functions.\n * Undefining some of these symbols will produce a smaller but less capable\n * library.  Note that you can leave certain source files out of the\n * compilation/linking process if you've #undef'd the corresponding symbols.\n * (You may HAVE to do that if your compiler doesn't like null source files.)\n */\n\n/* Capability options common to encoder and decoder: */\n\n#define DCT_ISLOW_SUPPORTED\t/* slow but accurate integer algorithm */\n#define DCT_IFAST_SUPPORTED\t/* faster, less accurate integer method */\n#define DCT_FLOAT_SUPPORTED\t/* floating-point: accurate, fast on fast HW */\n\n/* Encoder capability options: */\n\n#define C_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */\n#define C_PROGRESSIVE_SUPPORTED\t    /* Progressive JPEG? (Requires MULTISCAN)*/\n#define ENTROPY_OPT_SUPPORTED\t    /* Optimization of entropy coding parms? */\n/* Note: if you selected 12-bit data precision, it is dangerous to turn off\n * ENTROPY_OPT_SUPPORTED.  The standard Huffman tables are only good for 8-bit\n * precision, so jchuff.c normally uses entropy optimization to compute\n * usable tables for higher precision.  If you don't want to do optimization,\n * you'll have to supply different default Huffman tables.\n * The exact same statements apply for progressive JPEG: the default tables\n * don't work for progressive mode.  (This may get fixed, however.)\n */\n#define INPUT_SMOOTHING_SUPPORTED   /* Input image smoothing option? */\n\n/* Decoder capability options: */\n\n#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */\n#define D_PROGRESSIVE_SUPPORTED\t    /* Progressive JPEG? (Requires MULTISCAN)*/\n#define SAVE_MARKERS_SUPPORTED\t    /* jpeg_save_markers() needed? */\n#define BLOCK_SMOOTHING_SUPPORTED   /* Block smoothing? (Progressive only) */\n#define IDCT_SCALING_SUPPORTED\t    /* Output rescaling via IDCT? */\n#undef  UPSAMPLE_SCALING_SUPPORTED  /* Output rescaling at upsample stage? */\n#define UPSAMPLE_MERGING_SUPPORTED  /* Fast path for sloppy upsampling? */\n#define QUANT_1PASS_SUPPORTED\t    /* 1-pass color quantization? */\n#define QUANT_2PASS_SUPPORTED\t    /* 2-pass color quantization? */\n\n/* more capability options later, no doubt */\n\n\n/*\n * Ordering of RGB data in scanlines passed to or from the application.\n * If your application wants to deal with data in the order B,G,R, just\n * change these macros.  You can also deal with formats such as R,G,B,X\n * (one extra byte per pixel) by changing RGB_PIXELSIZE.  Note that changing\n * the offsets will also change the order in which colormap data is organized.\n * RESTRICTIONS:\n * 1. The sample applications cjpeg,djpeg do NOT support modified RGB formats.\n * 2. These macros only affect RGB<=>YCbCr color conversion, so they are not\n *    useful if you are using JPEG color spaces other than YCbCr or grayscale.\n * 3. The color quantizer modules will not behave desirably if RGB_PIXELSIZE\n *    is not 3 (they don't understand about dummy color components!).  So you\n *    can't use color quantization if you change that value.\n */\n\n#define RGB_RED\t\t0\t/* Offset of Red in an RGB scanline element */\n#define RGB_GREEN\t1\t/* Offset of Green */\n#define RGB_BLUE\t2\t/* Offset of Blue */\n#define RGB_PIXELSIZE\t3\t/* JSAMPLEs per RGB scanline element */\n\n#define JPEG_NUMCS 16\n\n#define EXT_RGB_RED        0\n#define EXT_RGB_GREEN      1\n#define EXT_RGB_BLUE       2\n#define EXT_RGB_PIXELSIZE  3\n\n#define EXT_RGBX_RED       0\n#define EXT_RGBX_GREEN     1\n#define EXT_RGBX_BLUE      2\n#define EXT_RGBX_PIXELSIZE 4\n\n#define EXT_BGR_RED        2\n#define EXT_BGR_GREEN      1\n#define EXT_BGR_BLUE       0\n#define EXT_BGR_PIXELSIZE  3\n\n#define EXT_BGRX_RED       2\n#define EXT_BGRX_GREEN     1\n#define EXT_BGRX_BLUE      0\n#define EXT_BGRX_PIXELSIZE 4\n\n#define EXT_XBGR_RED       3\n#define EXT_XBGR_GREEN     2\n#define EXT_XBGR_BLUE      1\n#define EXT_XBGR_PIXELSIZE 4\n\n#define EXT_XRGB_RED       1\n#define EXT_XRGB_GREEN     2\n#define EXT_XRGB_BLUE      3\n#define EXT_XRGB_PIXELSIZE 4\n\nstatic const int rgb_red[JPEG_NUMCS] = {\n  -1, -1, RGB_RED, -1, -1, -1, EXT_RGB_RED, EXT_RGBX_RED,\n  EXT_BGR_RED, EXT_BGRX_RED, EXT_XBGR_RED, EXT_XRGB_RED,\n  EXT_RGBX_RED, EXT_BGRX_RED, EXT_XBGR_RED, EXT_XRGB_RED\n};\n\nstatic const int rgb_green[JPEG_NUMCS] = {\n  -1, -1, RGB_GREEN, -1, -1, -1, EXT_RGB_GREEN, EXT_RGBX_GREEN,\n  EXT_BGR_GREEN, EXT_BGRX_GREEN, EXT_XBGR_GREEN, EXT_XRGB_GREEN,\n  EXT_RGBX_GREEN, EXT_BGRX_GREEN, EXT_XBGR_GREEN, EXT_XRGB_GREEN\n};\n\nstatic const int rgb_blue[JPEG_NUMCS] = {\n  -1, -1, RGB_BLUE, -1, -1, -1, EXT_RGB_BLUE, EXT_RGBX_BLUE,\n  EXT_BGR_BLUE, EXT_BGRX_BLUE, EXT_XBGR_BLUE, EXT_XRGB_BLUE,\n  EXT_RGBX_BLUE, EXT_BGRX_BLUE, EXT_XBGR_BLUE, EXT_XRGB_BLUE\n};\n\nstatic const int rgb_pixelsize[JPEG_NUMCS] = {\n  -1, -1, RGB_PIXELSIZE, -1, -1, -1, EXT_RGB_PIXELSIZE, EXT_RGBX_PIXELSIZE,\n  EXT_BGR_PIXELSIZE, EXT_BGRX_PIXELSIZE, EXT_XBGR_PIXELSIZE, EXT_XRGB_PIXELSIZE,\n  EXT_RGBX_PIXELSIZE, EXT_BGRX_PIXELSIZE, EXT_XBGR_PIXELSIZE, EXT_XRGB_PIXELSIZE\n};\n\n/* Definitions for speed-related optimizations. */\n\n/* On some machines (notably 68000 series) \"int\" is 32 bits, but multiplying\n * two 16-bit shorts is faster than multiplying two ints.  Define MULTIPLIER\n * as short on such a machine.  MULTIPLIER must be at least 16 bits wide.\n */\n\n#ifndef MULTIPLIER\n#ifndef WITH_SIMD\n#define MULTIPLIER  int\t\t/* type for fastest integer multiply */\n#else\n#define MULTIPLIER short  /* prefer 16-bit with SIMD for parellelism */\n#endif\n#endif\n\n\n/* FAST_FLOAT should be either float or double, whichever is done faster\n * by your compiler.  (Note that this type is only used in the floating point\n * DCT routines, so it only matters if you've defined DCT_FLOAT_SUPPORTED.)\n * Typically, float is faster in ANSI C compilers, while double is faster in\n * pre-ANSI compilers (because they insist on converting to double anyway).\n * The code below therefore chooses float if we have ANSI-style prototypes.\n */\n\n#ifndef FAST_FLOAT\n#ifdef HAVE_PROTOTYPES\n#define FAST_FLOAT  float\n#else\n#define FAST_FLOAT  double\n#endif\n#endif\n\n#endif /* JPEG_INTERNAL_OPTIONS */\n"
  },
  {
    "path": "ext/libjpeg-turbo/jpegcomp.h",
    "content": "/*\n * jpegcomp.h\n *\n * Copyright (C) 2010, D. R. Commander\n * For conditions of distribution and use, see the accompanying README file.\n *\n * JPEG compatibility macros\n * These declarations are considered internal to the JPEG library; most\n * applications using the library shouldn't need to include this file.\n */\n\n#if JPEG_LIB_VERSION >= 70\n#define _DCT_scaled_size DCT_h_scaled_size\n#define _DCT_h_scaled_size DCT_h_scaled_size\n#define _DCT_v_scaled_size DCT_v_scaled_size\n#define _min_DCT_scaled_size min_DCT_h_scaled_size\n#define _min_DCT_h_scaled_size min_DCT_h_scaled_size\n#define _min_DCT_v_scaled_size min_DCT_v_scaled_size\n#define _jpeg_width jpeg_width\n#define _jpeg_height jpeg_height\n#else\n#define _DCT_scaled_size DCT_scaled_size\n#define _DCT_h_scaled_size DCT_scaled_size\n#define _DCT_v_scaled_size DCT_scaled_size\n#define _min_DCT_scaled_size min_DCT_scaled_size\n#define _min_DCT_h_scaled_size min_DCT_scaled_size\n#define _min_DCT_v_scaled_size min_DCT_scaled_size\n#define _jpeg_width image_width\n#define _jpeg_height image_height\n#endif\n"
  },
  {
    "path": "ext/libjpeg-turbo/jpegint.h",
    "content": "/*\n * jpegint.h\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 1997-2009 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file provides common declarations for the various JPEG modules.\n * These declarations are considered internal to the JPEG library; most\n * applications using the library shouldn't need to include this file.\n */\n\n\n/* Declarations for both compression & decompression */\n\ntypedef enum {\t\t\t/* Operating modes for buffer controllers */\n\tJBUF_PASS_THRU,\t\t/* Plain stripwise operation */\n\t/* Remaining modes require a full-image buffer to have been created */\n\tJBUF_SAVE_SOURCE,\t/* Run source subobject only, save output */\n\tJBUF_CRANK_DEST,\t/* Run dest subobject only, using saved data */\n\tJBUF_SAVE_AND_PASS\t/* Run both subobjects, save output */\n} J_BUF_MODE;\n\n/* Values of global_state field (jdapi.c has some dependencies on ordering!) */\n#define CSTATE_START\t100\t/* after create_compress */\n#define CSTATE_SCANNING\t101\t/* start_compress done, write_scanlines OK */\n#define CSTATE_RAW_OK\t102\t/* start_compress done, write_raw_data OK */\n#define CSTATE_WRCOEFS\t103\t/* jpeg_write_coefficients done */\n#define DSTATE_START\t200\t/* after create_decompress */\n#define DSTATE_INHEADER\t201\t/* reading header markers, no SOS yet */\n#define DSTATE_READY\t202\t/* found SOS, ready for start_decompress */\n#define DSTATE_PRELOAD\t203\t/* reading multiscan file in start_decompress*/\n#define DSTATE_PRESCAN\t204\t/* performing dummy pass for 2-pass quant */\n#define DSTATE_SCANNING\t205\t/* start_decompress done, read_scanlines OK */\n#define DSTATE_RAW_OK\t206\t/* start_decompress done, read_raw_data OK */\n#define DSTATE_BUFIMAGE\t207\t/* expecting jpeg_start_output */\n#define DSTATE_BUFPOST\t208\t/* looking for SOS/EOI in jpeg_finish_output */\n#define DSTATE_RDCOEFS\t209\t/* reading file in jpeg_read_coefficients */\n#define DSTATE_STOPPING\t210\t/* looking for EOI in jpeg_finish_decompress */\n\n\n/* Declarations for compression modules */\n\n/* Master control module */\nstruct jpeg_comp_master {\n  JMETHOD(void, prepare_for_pass, (j_compress_ptr cinfo));\n  JMETHOD(void, pass_startup, (j_compress_ptr cinfo));\n  JMETHOD(void, finish_pass, (j_compress_ptr cinfo));\n\n  /* State variables made visible to other modules */\n  boolean call_pass_startup;\t/* True if pass_startup must be called */\n  boolean is_last_pass;\t\t/* True during last pass */\n};\n\n/* Main buffer control (downsampled-data buffer) */\nstruct jpeg_c_main_controller {\n  JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));\n  JMETHOD(void, process_data, (j_compress_ptr cinfo,\n\t\t\t       JSAMPARRAY input_buf, JDIMENSION *in_row_ctr,\n\t\t\t       JDIMENSION in_rows_avail));\n};\n\n/* Compression preprocessing (downsampling input buffer control) */\nstruct jpeg_c_prep_controller {\n  JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));\n  JMETHOD(void, pre_process_data, (j_compress_ptr cinfo,\n\t\t\t\t   JSAMPARRAY input_buf,\n\t\t\t\t   JDIMENSION *in_row_ctr,\n\t\t\t\t   JDIMENSION in_rows_avail,\n\t\t\t\t   JSAMPIMAGE output_buf,\n\t\t\t\t   JDIMENSION *out_row_group_ctr,\n\t\t\t\t   JDIMENSION out_row_groups_avail));\n};\n\n/* Coefficient buffer control */\nstruct jpeg_c_coef_controller {\n  JMETHOD(void, start_pass, (j_compress_ptr cinfo, J_BUF_MODE pass_mode));\n  JMETHOD(boolean, compress_data, (j_compress_ptr cinfo,\n\t\t\t\t   JSAMPIMAGE input_buf));\n};\n\n/* Colorspace conversion */\nstruct jpeg_color_converter {\n  JMETHOD(void, start_pass, (j_compress_ptr cinfo));\n  JMETHOD(void, color_convert, (j_compress_ptr cinfo,\n\t\t\t\tJSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n\t\t\t\tJDIMENSION output_row, int num_rows));\n};\n\n/* Downsampling */\nstruct jpeg_downsampler {\n  JMETHOD(void, start_pass, (j_compress_ptr cinfo));\n  JMETHOD(void, downsample, (j_compress_ptr cinfo,\n\t\t\t     JSAMPIMAGE input_buf, JDIMENSION in_row_index,\n\t\t\t     JSAMPIMAGE output_buf,\n\t\t\t     JDIMENSION out_row_group_index));\n\n  boolean need_context_rows;\t/* TRUE if need rows above & below */\n};\n\n/* Forward DCT (also controls coefficient quantization) */\nstruct jpeg_forward_dct {\n  JMETHOD(void, start_pass, (j_compress_ptr cinfo));\n  /* perhaps this should be an array??? */\n  JMETHOD(void, forward_DCT, (j_compress_ptr cinfo,\n\t\t\t      jpeg_component_info * compptr,\n\t\t\t      JSAMPARRAY sample_data, JBLOCKROW coef_blocks,\n\t\t\t      JDIMENSION start_row, JDIMENSION start_col,\n\t\t\t      JDIMENSION num_blocks));\n};\n\n/* Entropy encoding */\nstruct jpeg_entropy_encoder {\n  JMETHOD(void, start_pass, (j_compress_ptr cinfo, boolean gather_statistics));\n  JMETHOD(boolean, encode_mcu, (j_compress_ptr cinfo, JBLOCKROW *MCU_data));\n  JMETHOD(void, finish_pass, (j_compress_ptr cinfo));\n};\n\n/* Marker writing */\nstruct jpeg_marker_writer {\n  JMETHOD(void, write_file_header, (j_compress_ptr cinfo));\n  JMETHOD(void, write_frame_header, (j_compress_ptr cinfo));\n  JMETHOD(void, write_scan_header, (j_compress_ptr cinfo));\n  JMETHOD(void, write_file_trailer, (j_compress_ptr cinfo));\n  JMETHOD(void, write_tables_only, (j_compress_ptr cinfo));\n  /* These routines are exported to allow insertion of extra markers */\n  /* Probably only COM and APPn markers should be written this way */\n  JMETHOD(void, write_marker_header, (j_compress_ptr cinfo, int marker,\n\t\t\t\t      unsigned int datalen));\n  JMETHOD(void, write_marker_byte, (j_compress_ptr cinfo, int val));\n};\n\n\n/* Declarations for decompression modules */\n\n/* Master control module */\nstruct jpeg_decomp_master {\n  JMETHOD(void, prepare_for_output_pass, (j_decompress_ptr cinfo));\n  JMETHOD(void, finish_output_pass, (j_decompress_ptr cinfo));\n\n  /* State variables made visible to other modules */\n  boolean is_dummy_pass;\t/* True during 1st pass for 2-pass quant */\n};\n\n/* Input control module */\nstruct jpeg_input_controller {\n  JMETHOD(int, consume_input, (j_decompress_ptr cinfo));\n  JMETHOD(void, reset_input_controller, (j_decompress_ptr cinfo));\n  JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo));\n  JMETHOD(void, finish_input_pass, (j_decompress_ptr cinfo));\n\n  /* State variables made visible to other modules */\n  boolean has_multiple_scans;\t/* True if file has multiple scans */\n  boolean eoi_reached;\t\t/* True when EOI has been consumed */\n};\n\n/* Main buffer control (downsampled-data buffer) */\nstruct jpeg_d_main_controller {\n  JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));\n  JMETHOD(void, process_data, (j_decompress_ptr cinfo,\n\t\t\t       JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,\n\t\t\t       JDIMENSION out_rows_avail));\n};\n\n/* Coefficient buffer control */\nstruct jpeg_d_coef_controller {\n  JMETHOD(void, start_input_pass, (j_decompress_ptr cinfo));\n  JMETHOD(int, consume_data, (j_decompress_ptr cinfo));\n  JMETHOD(void, start_output_pass, (j_decompress_ptr cinfo));\n  JMETHOD(int, decompress_data, (j_decompress_ptr cinfo,\n\t\t\t\t JSAMPIMAGE output_buf));\n  /* Pointer to array of coefficient virtual arrays, or NULL if none */\n  jvirt_barray_ptr *coef_arrays;\n};\n\n/* Decompression postprocessing (color quantization buffer control) */\nstruct jpeg_d_post_controller {\n  JMETHOD(void, start_pass, (j_decompress_ptr cinfo, J_BUF_MODE pass_mode));\n  JMETHOD(void, post_process_data, (j_decompress_ptr cinfo,\n\t\t\t\t    JSAMPIMAGE input_buf,\n\t\t\t\t    JDIMENSION *in_row_group_ctr,\n\t\t\t\t    JDIMENSION in_row_groups_avail,\n\t\t\t\t    JSAMPARRAY output_buf,\n\t\t\t\t    JDIMENSION *out_row_ctr,\n\t\t\t\t    JDIMENSION out_rows_avail));\n};\n\n/* Marker reading & parsing */\nstruct jpeg_marker_reader {\n  JMETHOD(void, reset_marker_reader, (j_decompress_ptr cinfo));\n  /* Read markers until SOS or EOI.\n   * Returns same codes as are defined for jpeg_consume_input:\n   * JPEG_SUSPENDED, JPEG_REACHED_SOS, or JPEG_REACHED_EOI.\n   */\n  JMETHOD(int, read_markers, (j_decompress_ptr cinfo));\n  /* Read a restart marker --- exported for use by entropy decoder only */\n  jpeg_marker_parser_method read_restart_marker;\n\n  /* State of marker reader --- nominally internal, but applications\n   * supplying COM or APPn handlers might like to know the state.\n   */\n  boolean saw_SOI;\t\t/* found SOI? */\n  boolean saw_SOF;\t\t/* found SOF? */\n  int next_restart_num;\t\t/* next restart number expected (0-7) */\n  unsigned int discarded_bytes;\t/* # of bytes skipped looking for a marker */\n};\n\n/* Entropy decoding */\nstruct jpeg_entropy_decoder {\n  JMETHOD(void, start_pass, (j_decompress_ptr cinfo));\n  JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo,\n\t\t\t\tJBLOCKROW *MCU_data));\n\n  /* This is here to share code between baseline and progressive decoders; */\n  /* other modules probably should not use it */\n  boolean insufficient_data;\t/* set TRUE after emitting warning */\n};\n\n/* Inverse DCT (also performs dequantization) */\ntypedef JMETHOD(void, inverse_DCT_method_ptr,\n\t\t(j_decompress_ptr cinfo, jpeg_component_info * compptr,\n\t\t JCOEFPTR coef_block,\n\t\t JSAMPARRAY output_buf, JDIMENSION output_col));\n\nstruct jpeg_inverse_dct {\n  JMETHOD(void, start_pass, (j_decompress_ptr cinfo));\n  /* It is useful to allow each component to have a separate IDCT method. */\n  inverse_DCT_method_ptr inverse_DCT[MAX_COMPONENTS];\n};\n\n/* Upsampling (note that upsampler must also call color converter) */\nstruct jpeg_upsampler {\n  JMETHOD(void, start_pass, (j_decompress_ptr cinfo));\n  JMETHOD(void, upsample, (j_decompress_ptr cinfo,\n\t\t\t   JSAMPIMAGE input_buf,\n\t\t\t   JDIMENSION *in_row_group_ctr,\n\t\t\t   JDIMENSION in_row_groups_avail,\n\t\t\t   JSAMPARRAY output_buf,\n\t\t\t   JDIMENSION *out_row_ctr,\n\t\t\t   JDIMENSION out_rows_avail));\n\n  boolean need_context_rows;\t/* TRUE if need rows above & below */\n};\n\n/* Colorspace conversion */\nstruct jpeg_color_deconverter {\n  JMETHOD(void, start_pass, (j_decompress_ptr cinfo));\n  JMETHOD(void, color_convert, (j_decompress_ptr cinfo,\n\t\t\t\tJSAMPIMAGE input_buf, JDIMENSION input_row,\n\t\t\t\tJSAMPARRAY output_buf, int num_rows));\n};\n\n/* Color quantization or color precision reduction */\nstruct jpeg_color_quantizer {\n  JMETHOD(void, start_pass, (j_decompress_ptr cinfo, boolean is_pre_scan));\n  JMETHOD(void, color_quantize, (j_decompress_ptr cinfo,\n\t\t\t\t JSAMPARRAY input_buf, JSAMPARRAY output_buf,\n\t\t\t\t int num_rows));\n  JMETHOD(void, finish_pass, (j_decompress_ptr cinfo));\n  JMETHOD(void, new_color_map, (j_decompress_ptr cinfo));\n};\n\n\n/* Miscellaneous useful macros */\n\n#undef MAX\n#define MAX(a,b)\t((a) > (b) ? (a) : (b))\n#undef MIN\n#define MIN(a,b)\t((a) < (b) ? (a) : (b))\n\n\n/* We assume that right shift corresponds to signed division by 2 with\n * rounding towards minus infinity.  This is correct for typical \"arithmetic\n * shift\" instructions that shift in copies of the sign bit.  But some\n * C compilers implement >> with an unsigned shift.  For these machines you\n * must define RIGHT_SHIFT_IS_UNSIGNED.\n * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity.\n * It is only applied with constant shift counts.  SHIFT_TEMPS must be\n * included in the variables of any routine using RIGHT_SHIFT.\n */\n\n#ifdef RIGHT_SHIFT_IS_UNSIGNED\n#define SHIFT_TEMPS\tINT32 shift_temp;\n#define RIGHT_SHIFT(x,shft)  \\\n\t((shift_temp = (x)) < 0 ? \\\n\t (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \\\n\t (shift_temp >> (shft)))\n#else\n#define SHIFT_TEMPS\n#define RIGHT_SHIFT(x,shft)\t((x) >> (shft))\n#endif\n\n\n/* Short forms of external names for systems with brain-damaged linkers. */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jinit_compress_master\tjICompress\n#define jinit_c_master_control\tjICMaster\n#define jinit_c_main_controller\tjICMainC\n#define jinit_c_prep_controller\tjICPrepC\n#define jinit_c_coef_controller\tjICCoefC\n#define jinit_color_converter\tjICColor\n#define jinit_downsampler\tjIDownsampler\n#define jinit_forward_dct\tjIFDCT\n#define jinit_huff_encoder\tjIHEncoder\n#define jinit_phuff_encoder\tjIPHEncoder\n#define jinit_arith_encoder\tjIAEncoder\n#define jinit_marker_writer\tjIMWriter\n#define jinit_master_decompress\tjIDMaster\n#define jinit_d_main_controller\tjIDMainC\n#define jinit_d_coef_controller\tjIDCoefC\n#define jinit_d_post_controller\tjIDPostC\n#define jinit_input_controller\tjIInCtlr\n#define jinit_marker_reader\tjIMReader\n#define jinit_huff_decoder\tjIHDecoder\n#define jinit_phuff_decoder\tjIPHDecoder\n#define jinit_arith_decoder\tjIADecoder\n#define jinit_inverse_dct\tjIIDCT\n#define jinit_upsampler\t\tjIUpsampler\n#define jinit_color_deconverter\tjIDColor\n#define jinit_1pass_quantizer\tjI1Quant\n#define jinit_2pass_quantizer\tjI2Quant\n#define jinit_merged_upsampler\tjIMUpsampler\n#define jinit_memory_mgr\tjIMemMgr\n#define jdiv_round_up\t\tjDivRound\n#define jround_up\t\tjRound\n#define jcopy_sample_rows\tjCopySamples\n#define jcopy_block_row\t\tjCopyBlocks\n#define jzero_far\t\tjZeroFar\n#define jpeg_zigzag_order\tjZIGTable\n#define jpeg_natural_order\tjZAGTable\n#define jpeg_aritab\t\tjAriTab\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\n\n/* Compression module initialization routines */\nEXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo));\nEXTERN(void) jinit_c_master_control JPP((j_compress_ptr cinfo,\n\t\t\t\t\t boolean transcode_only));\nEXTERN(void) jinit_c_main_controller JPP((j_compress_ptr cinfo,\n\t\t\t\t\t  boolean need_full_buffer));\nEXTERN(void) jinit_c_prep_controller JPP((j_compress_ptr cinfo,\n\t\t\t\t\t  boolean need_full_buffer));\nEXTERN(void) jinit_c_coef_controller JPP((j_compress_ptr cinfo,\n\t\t\t\t\t  boolean need_full_buffer));\nEXTERN(void) jinit_color_converter JPP((j_compress_ptr cinfo));\nEXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo));\nEXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo));\nEXTERN(void) jinit_huff_encoder JPP((j_compress_ptr cinfo));\nEXTERN(void) jinit_phuff_encoder JPP((j_compress_ptr cinfo));\nEXTERN(void) jinit_arith_encoder JPP((j_compress_ptr cinfo));\nEXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo));\n/* Decompression module initialization routines */\nEXTERN(void) jinit_master_decompress JPP((j_decompress_ptr cinfo));\nEXTERN(void) jinit_d_main_controller JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t  boolean need_full_buffer));\nEXTERN(void) jinit_d_coef_controller JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t  boolean need_full_buffer));\nEXTERN(void) jinit_d_post_controller JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t  boolean need_full_buffer));\nEXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo));\nEXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo));\nEXTERN(void) jinit_huff_decoder JPP((j_decompress_ptr cinfo));\nEXTERN(void) jinit_phuff_decoder JPP((j_decompress_ptr cinfo));\nEXTERN(void) jinit_arith_decoder JPP((j_decompress_ptr cinfo));\nEXTERN(void) jinit_inverse_dct JPP((j_decompress_ptr cinfo));\nEXTERN(void) jinit_upsampler JPP((j_decompress_ptr cinfo));\nEXTERN(void) jinit_color_deconverter JPP((j_decompress_ptr cinfo));\nEXTERN(void) jinit_1pass_quantizer JPP((j_decompress_ptr cinfo));\nEXTERN(void) jinit_2pass_quantizer JPP((j_decompress_ptr cinfo));\nEXTERN(void) jinit_merged_upsampler JPP((j_decompress_ptr cinfo));\n/* Memory manager initialization */\nEXTERN(void) jinit_memory_mgr JPP((j_common_ptr cinfo));\n\n/* Utility routines in jutils.c */\nEXTERN(long) jdiv_round_up JPP((long a, long b));\nEXTERN(long) jround_up JPP((long a, long b));\nEXTERN(void) jcopy_sample_rows JPP((JSAMPARRAY input_array, int source_row,\n\t\t\t\t    JSAMPARRAY output_array, int dest_row,\n\t\t\t\t    int num_rows, JDIMENSION num_cols));\nEXTERN(void) jcopy_block_row JPP((JBLOCKROW input_row, JBLOCKROW output_row,\n\t\t\t\t  JDIMENSION num_blocks));\nEXTERN(void) jzero_far JPP((void FAR * target, size_t bytestozero));\n/* Constant tables in jutils.c */\n#if 0\t\t\t\t/* This table is not actually needed in v6a */\nextern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */\n#endif\nextern const int jpeg_natural_order[]; /* zigzag coef order to natural order */\n\n/* Arithmetic coding probability estimation tables in jaricom.c */\nextern const INT32 jpeg_aritab[];\n\n/* Suppress undefined-structure complaints if necessary. */\n\n#ifdef INCOMPLETE_TYPES_BROKEN\n#ifndef AM_MEMORY_MANAGER\t/* only jmemmgr.c defines these */\nstruct jvirt_sarray_control { long dummy; };\nstruct jvirt_barray_control { long dummy; };\n#endif\n#endif /* INCOMPLETE_TYPES_BROKEN */\n"
  },
  {
    "path": "ext/libjpeg-turbo/jpeglib.h",
    "content": "/*\n * jpeglib.h\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1998, Thomas G. Lane.\n * Modified 2002-2009 by Guido Vollbeding.\n * Modifications:\n * Copyright (C) 2009-2011, 2013, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file defines the application interface for the JPEG library.\n * Most applications using the library need only include this file,\n * and perhaps jerror.h if they want to know the exact error codes.\n */\n\n#ifndef JPEGLIB_H\n#define JPEGLIB_H\n\n/*\n * First we include the configuration files that record how this\n * installation of the JPEG library is set up.  jconfig.h can be\n * generated automatically for many systems.  jmorecfg.h contains\n * manual configuration options that most people need not worry about.\n */\n\n#ifndef JCONFIG_INCLUDED\t/* in case jinclude.h already did */\n#include \"jconfig.h\"\t\t/* widely used configuration options */\n#endif\n#include \"jmorecfg.h\"\t\t/* seldom changed options */\n\n\n#ifdef __cplusplus\n#ifndef DONT_USE_EXTERN_C\nextern \"C\" {\n#endif\n#endif\n\n\n/* Various constants determining the sizes of things.\n * All of these are specified by the JPEG standard, so don't change them\n * if you want to be compatible.\n */\n\n#define DCTSIZE\t\t    8\t/* The basic DCT block is 8x8 samples */\n#define DCTSIZE2\t    64\t/* DCTSIZE squared; # of elements in a block */\n#define NUM_QUANT_TBLS      4\t/* Quantization tables are numbered 0..3 */\n#define NUM_HUFF_TBLS       4\t/* Huffman tables are numbered 0..3 */\n#define NUM_ARITH_TBLS      16\t/* Arith-coding tables are numbered 0..15 */\n#define MAX_COMPS_IN_SCAN   4\t/* JPEG limit on # of components in one scan */\n#define MAX_SAMP_FACTOR     4\t/* JPEG limit on sampling factors */\n/* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard;\n * the PostScript DCT filter can emit files with many more than 10 blocks/MCU.\n * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU\n * to handle it.  We even let you do this from the jconfig.h file.  However,\n * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe\n * sometimes emits noncompliant files doesn't mean you should too.\n */\n#define C_MAX_BLOCKS_IN_MCU   10 /* compressor's limit on blocks per MCU */\n#ifndef D_MAX_BLOCKS_IN_MCU\n#define D_MAX_BLOCKS_IN_MCU   10 /* decompressor's limit on blocks per MCU */\n#endif\n\n\n/* Data structures for images (arrays of samples and of DCT coefficients).\n * On 80x86 machines, the image arrays are too big for near pointers,\n * but the pointer arrays can fit in near memory.\n */\n\ntypedef JSAMPLE FAR *JSAMPROW;\t/* ptr to one image row of pixel samples. */\ntypedef JSAMPROW *JSAMPARRAY;\t/* ptr to some rows (a 2-D sample array) */\ntypedef JSAMPARRAY *JSAMPIMAGE;\t/* a 3-D sample array: top index is color */\n\ntypedef JCOEF JBLOCK[DCTSIZE2];\t/* one block of coefficients */\ntypedef JBLOCK FAR *JBLOCKROW;\t/* pointer to one row of coefficient blocks */\ntypedef JBLOCKROW *JBLOCKARRAY;\t\t/* a 2-D array of coefficient blocks */\ntypedef JBLOCKARRAY *JBLOCKIMAGE;\t/* a 3-D array of coefficient blocks */\n\ntypedef JCOEF FAR *JCOEFPTR;\t/* useful in a couple of places */\n\n\n/* Types for JPEG compression parameters and working tables. */\n\n\n/* DCT coefficient quantization tables. */\n\ntypedef struct {\n  /* This array gives the coefficient quantizers in natural array order\n   * (not the zigzag order in which they are stored in a JPEG DQT marker).\n   * CAUTION: IJG versions prior to v6a kept this array in zigzag order.\n   */\n  UINT16 quantval[DCTSIZE2];\t/* quantization step for each coefficient */\n  /* This field is used only during compression.  It's initialized FALSE when\n   * the table is created, and set TRUE when it's been output to the file.\n   * You could suppress output of a table by setting this to TRUE.\n   * (See jpeg_suppress_tables for an example.)\n   */\n  boolean sent_table;\t\t/* TRUE when table has been output */\n} JQUANT_TBL;\n\n\n/* Huffman coding tables. */\n\ntypedef struct {\n  /* These two fields directly represent the contents of a JPEG DHT marker */\n  UINT8 bits[17];\t\t/* bits[k] = # of symbols with codes of */\n\t\t\t\t/* length k bits; bits[0] is unused */\n  UINT8 huffval[256];\t\t/* The symbols, in order of incr code length */\n  /* This field is used only during compression.  It's initialized FALSE when\n   * the table is created, and set TRUE when it's been output to the file.\n   * You could suppress output of a table by setting this to TRUE.\n   * (See jpeg_suppress_tables for an example.)\n   */\n  boolean sent_table;\t\t/* TRUE when table has been output */\n} JHUFF_TBL;\n\n\n/* Basic info about one component (color channel). */\n\ntypedef struct {\n  /* These values are fixed over the whole image. */\n  /* For compression, they must be supplied by parameter setup; */\n  /* for decompression, they are read from the SOF marker. */\n  int component_id;\t\t/* identifier for this component (0..255) */\n  int component_index;\t\t/* its index in SOF or cinfo->comp_info[] */\n  int h_samp_factor;\t\t/* horizontal sampling factor (1..4) */\n  int v_samp_factor;\t\t/* vertical sampling factor (1..4) */\n  int quant_tbl_no;\t\t/* quantization table selector (0..3) */\n  /* These values may vary between scans. */\n  /* For compression, they must be supplied by parameter setup; */\n  /* for decompression, they are read from the SOS marker. */\n  /* The decompressor output side may not use these variables. */\n  int dc_tbl_no;\t\t/* DC entropy table selector (0..3) */\n  int ac_tbl_no;\t\t/* AC entropy table selector (0..3) */\n  \n  /* Remaining fields should be treated as private by applications. */\n  \n  /* These values are computed during compression or decompression startup: */\n  /* Component's size in DCT blocks.\n   * Any dummy blocks added to complete an MCU are not counted; therefore\n   * these values do not depend on whether a scan is interleaved or not.\n   */\n  JDIMENSION width_in_blocks;\n  JDIMENSION height_in_blocks;\n  /* Size of a DCT block in samples.  Always DCTSIZE for compression.\n   * For decompression this is the size of the output from one DCT block,\n   * reflecting any scaling we choose to apply during the IDCT step.\n   * Values of 1,2,4,8 are likely to be supported.  Note that different\n   * components may receive different IDCT scalings.\n   */\n#if JPEG_LIB_VERSION >= 70\n  int DCT_h_scaled_size;\n  int DCT_v_scaled_size;\n#else\n  int DCT_scaled_size;\n#endif\n  /* The downsampled dimensions are the component's actual, unpadded number\n   * of samples at the main buffer (preprocessing/compression interface), thus\n   * downsampled_width = ceil(image_width * Hi/Hmax)\n   * and similarly for height.  For decompression, IDCT scaling is included, so\n   * downsampled_width = ceil(image_width * Hi/Hmax * DCT_[h_]scaled_size/DCTSIZE)\n   */\n  JDIMENSION downsampled_width;\t /* actual width in samples */\n  JDIMENSION downsampled_height; /* actual height in samples */\n  /* This flag is used only for decompression.  In cases where some of the\n   * components will be ignored (eg grayscale output from YCbCr image),\n   * we can skip most computations for the unused components.\n   */\n  boolean component_needed;\t/* do we need the value of this component? */\n\n  /* These values are computed before starting a scan of the component. */\n  /* The decompressor output side may not use these variables. */\n  int MCU_width;\t\t/* number of blocks per MCU, horizontally */\n  int MCU_height;\t\t/* number of blocks per MCU, vertically */\n  int MCU_blocks;\t\t/* MCU_width * MCU_height */\n  int MCU_sample_width;\t\t/* MCU width in samples, MCU_width*DCT_[h_]scaled_size */\n  int last_col_width;\t\t/* # of non-dummy blocks across in last MCU */\n  int last_row_height;\t\t/* # of non-dummy blocks down in last MCU */\n\n  /* Saved quantization table for component; NULL if none yet saved.\n   * See jdinput.c comments about the need for this information.\n   * This field is currently used only for decompression.\n   */\n  JQUANT_TBL * quant_table;\n\n  /* Private per-component storage for DCT or IDCT subsystem. */\n  void * dct_table;\n} jpeg_component_info;\n\n\n/* The script for encoding a multiple-scan file is an array of these: */\n\ntypedef struct {\n  int comps_in_scan;\t\t/* number of components encoded in this scan */\n  int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */\n  int Ss, Se;\t\t\t/* progressive JPEG spectral selection parms */\n  int Ah, Al;\t\t\t/* progressive JPEG successive approx. parms */\n} jpeg_scan_info;\n\n/* The decompressor can save APPn and COM markers in a list of these: */\n\ntypedef struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr;\n\nstruct jpeg_marker_struct {\n  jpeg_saved_marker_ptr next;\t/* next in list, or NULL */\n  UINT8 marker;\t\t\t/* marker code: JPEG_COM, or JPEG_APP0+n */\n  unsigned int original_length;\t/* # bytes of data in the file */\n  unsigned int data_length;\t/* # bytes of data saved at data[] */\n  JOCTET FAR * data;\t\t/* the data contained in the marker */\n  /* the marker length word is not counted in data_length or original_length */\n};\n\n/* Known color spaces. */\n\n#define JCS_EXTENSIONS 1\n#define JCS_ALPHA_EXTENSIONS 1\n\ntypedef enum {\n\tJCS_UNKNOWN,\t\t/* error/unspecified */\n\tJCS_GRAYSCALE,\t\t/* monochrome */\n\tJCS_RGB,\t\t/* red/green/blue as specified by the RGB_RED, RGB_GREEN,\n\t\t\t\t   RGB_BLUE, and RGB_PIXELSIZE macros */\n\tJCS_YCbCr,\t\t/* Y/Cb/Cr (also known as YUV) */\n\tJCS_CMYK,\t\t/* C/M/Y/K */\n\tJCS_YCCK,\t\t/* Y/Cb/Cr/K */\n\tJCS_EXT_RGB,\t\t/* red/green/blue */\n\tJCS_EXT_RGBX,\t\t/* red/green/blue/x */\n\tJCS_EXT_BGR,\t\t/* blue/green/red */\n\tJCS_EXT_BGRX,\t\t/* blue/green/red/x */\n\tJCS_EXT_XBGR,\t\t/* x/blue/green/red */\n\tJCS_EXT_XRGB,\t\t/* x/red/green/blue */\n\t/* When out_color_space it set to JCS_EXT_RGBX, JCS_EXT_BGRX,\n\t   JCS_EXT_XBGR, or JCS_EXT_XRGB during decompression, the X byte is\n\t   undefined, and in order to ensure the best performance,\n\t   libjpeg-turbo can set that byte to whatever value it wishes.  Use\n\t   the following colorspace constants to ensure that the X byte is set\n\t   to 0xFF, so that it can be interpreted as an opaque alpha\n\t   channel. */\n\tJCS_EXT_RGBA,\t\t/* red/green/blue/alpha */\n\tJCS_EXT_BGRA,\t\t/* blue/green/red/alpha */\n\tJCS_EXT_ABGR,\t\t/* alpha/blue/green/red */\n\tJCS_EXT_ARGB\t\t/* alpha/red/green/blue */\n} J_COLOR_SPACE;\n\n/* DCT/IDCT algorithm options. */\n\ntypedef enum {\n\tJDCT_ISLOW,\t\t/* slow but accurate integer algorithm */\n\tJDCT_IFAST,\t\t/* faster, less accurate integer method */\n\tJDCT_FLOAT\t\t/* floating-point: accurate, fast on fast HW */\n} J_DCT_METHOD;\n\n#ifndef JDCT_DEFAULT\t\t/* may be overridden in jconfig.h */\n#define JDCT_DEFAULT  JDCT_ISLOW\n#endif\n#ifndef JDCT_FASTEST\t\t/* may be overridden in jconfig.h */\n#define JDCT_FASTEST  JDCT_IFAST\n#endif\n\n/* Dithering options for decompression. */\n\ntypedef enum {\n\tJDITHER_NONE,\t\t/* no dithering */\n\tJDITHER_ORDERED,\t/* simple ordered dither */\n\tJDITHER_FS\t\t/* Floyd-Steinberg error diffusion dither */\n} J_DITHER_MODE;\n\n\n/* Common fields between JPEG compression and decompression master structs. */\n\n#define jpeg_common_fields \\\n  struct jpeg_error_mgr * err;\t/* Error handler module */\\\n  struct jpeg_memory_mgr * mem;\t/* Memory manager module */\\\n  struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\\\n  void * client_data;\t\t/* Available for use by application */\\\n  boolean is_decompressor;\t/* So common code can tell which is which */\\\n  int global_state\t\t/* For checking call sequence validity */\n\n/* Routines that are to be used by both halves of the library are declared\n * to receive a pointer to this structure.  There are no actual instances of\n * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct.\n */\nstruct jpeg_common_struct {\n  jpeg_common_fields;\t\t/* Fields common to both master struct types */\n  /* Additional fields follow in an actual jpeg_compress_struct or\n   * jpeg_decompress_struct.  All three structs must agree on these\n   * initial fields!  (This would be a lot cleaner in C++.)\n   */\n};\n\ntypedef struct jpeg_common_struct * j_common_ptr;\ntypedef struct jpeg_compress_struct * j_compress_ptr;\ntypedef struct jpeg_decompress_struct * j_decompress_ptr;\n\n\n/* Master record for a compression instance */\n\nstruct jpeg_compress_struct {\n  jpeg_common_fields;\t\t/* Fields shared with jpeg_decompress_struct */\n\n  /* Destination for compressed data */\n  struct jpeg_destination_mgr * dest;\n\n  /* Description of source image --- these fields must be filled in by\n   * outer application before starting compression.  in_color_space must\n   * be correct before you can even call jpeg_set_defaults().\n   */\n\n  JDIMENSION image_width;\t/* input image width */\n  JDIMENSION image_height;\t/* input image height */\n  int input_components;\t\t/* # of color components in input image */\n  J_COLOR_SPACE in_color_space;\t/* colorspace of input image */\n\n  double input_gamma;\t\t/* image gamma of input image */\n\n  /* Compression parameters --- these fields must be set before calling\n   * jpeg_start_compress().  We recommend calling jpeg_set_defaults() to\n   * initialize everything to reasonable defaults, then changing anything\n   * the application specifically wants to change.  That way you won't get\n   * burnt when new parameters are added.  Also note that there are several\n   * helper routines to simplify changing parameters.\n   */\n\n#if JPEG_LIB_VERSION >= 70\n  unsigned int scale_num, scale_denom; /* fraction by which to scale image */\n\n  JDIMENSION jpeg_width;\t/* scaled JPEG image width */\n  JDIMENSION jpeg_height;\t/* scaled JPEG image height */\n  /* Dimensions of actual JPEG image that will be written to file,\n   * derived from input dimensions by scaling factors above.\n   * These fields are computed by jpeg_start_compress().\n   * You can also use jpeg_calc_jpeg_dimensions() to determine these values\n   * in advance of calling jpeg_start_compress().\n   */\n#endif\n\n  int data_precision;\t\t/* bits of precision in image data */\n\n  int num_components;\t\t/* # of color components in JPEG image */\n  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */\n\n  jpeg_component_info * comp_info;\n  /* comp_info[i] describes component that appears i'th in SOF */\n\n  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];\n#if JPEG_LIB_VERSION >= 70\n  int q_scale_factor[NUM_QUANT_TBLS];\n#endif\n  /* ptrs to coefficient quantization tables, or NULL if not defined,\n   * and corresponding scale factors (percentage, initialized 100).\n   */\n\n  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  /* ptrs to Huffman coding tables, or NULL if not defined */\n\n  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */\n  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */\n  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */\n\n  int num_scans;\t\t/* # of entries in scan_info array */\n  const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */\n  /* The default value of scan_info is NULL, which causes a single-scan\n   * sequential JPEG file to be emitted.  To create a multi-scan file,\n   * set num_scans and scan_info to point to an array of scan definitions.\n   */\n\n  boolean raw_data_in;\t\t/* TRUE=caller supplies downsampled data */\n  boolean arith_code;\t\t/* TRUE=arithmetic coding, FALSE=Huffman */\n  boolean optimize_coding;\t/* TRUE=optimize entropy encoding parms */\n  boolean CCIR601_sampling;\t/* TRUE=first samples are cosited */\n#if JPEG_LIB_VERSION >= 70\n  boolean do_fancy_downsampling; /* TRUE=apply fancy downsampling */\n#endif\n  int smoothing_factor;\t\t/* 1..100, or 0 for no input smoothing */\n  J_DCT_METHOD dct_method;\t/* DCT algorithm selector */\n\n  /* The restart interval can be specified in absolute MCUs by setting\n   * restart_interval, or in MCU rows by setting restart_in_rows\n   * (in which case the correct restart_interval will be figured\n   * for each scan).\n   */\n  unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */\n  int restart_in_rows;\t\t/* if > 0, MCU rows per restart interval */\n\n  /* Parameters controlling emission of special markers. */\n\n  boolean write_JFIF_header;\t/* should a JFIF marker be written? */\n  UINT8 JFIF_major_version;\t/* What to write for the JFIF version number */\n  UINT8 JFIF_minor_version;\n  /* These three values are not used by the JPEG code, merely copied */\n  /* into the JFIF APP0 marker.  density_unit can be 0 for unknown, */\n  /* 1 for dots/inch, or 2 for dots/cm.  Note that the pixel aspect */\n  /* ratio is defined by X_density/Y_density even when density_unit=0. */\n  UINT8 density_unit;\t\t/* JFIF code for pixel size units */\n  UINT16 X_density;\t\t/* Horizontal pixel density */\n  UINT16 Y_density;\t\t/* Vertical pixel density */\n  boolean write_Adobe_marker;\t/* should an Adobe marker be written? */\n  \n  /* State variable: index of next scanline to be written to\n   * jpeg_write_scanlines().  Application may use this to control its\n   * processing loop, e.g., \"while (next_scanline < image_height)\".\n   */\n\n  JDIMENSION next_scanline;\t/* 0 .. image_height-1  */\n\n  /* Remaining fields are known throughout compressor, but generally\n   * should not be touched by a surrounding application.\n   */\n\n  /*\n   * These fields are computed during compression startup\n   */\n  boolean progressive_mode;\t/* TRUE if scan script uses progressive mode */\n  int max_h_samp_factor;\t/* largest h_samp_factor */\n  int max_v_samp_factor;\t/* largest v_samp_factor */\n\n#if JPEG_LIB_VERSION >= 70\n  int min_DCT_h_scaled_size;\t/* smallest DCT_h_scaled_size of any component */\n  int min_DCT_v_scaled_size;\t/* smallest DCT_v_scaled_size of any component */\n#endif\n\n  JDIMENSION total_iMCU_rows;\t/* # of iMCU rows to be input to coef ctlr */\n  /* The coefficient controller receives data in units of MCU rows as defined\n   * for fully interleaved scans (whether the JPEG file is interleaved or not).\n   * There are v_samp_factor * DCTSIZE sample rows of each component in an\n   * \"iMCU\" (interleaved MCU) row.\n   */\n  \n  /*\n   * These fields are valid during any one scan.\n   * They describe the components and MCUs actually appearing in the scan.\n   */\n  int comps_in_scan;\t\t/* # of JPEG components in this scan */\n  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];\n  /* *cur_comp_info[i] describes component that appears i'th in SOS */\n  \n  JDIMENSION MCUs_per_row;\t/* # of MCUs across the image */\n  JDIMENSION MCU_rows_in_scan;\t/* # of MCU rows in the image */\n  \n  int blocks_in_MCU;\t\t/* # of DCT blocks per MCU */\n  int MCU_membership[C_MAX_BLOCKS_IN_MCU];\n  /* MCU_membership[i] is index in cur_comp_info of component owning */\n  /* i'th block in an MCU */\n\n  int Ss, Se, Ah, Al;\t\t/* progressive JPEG parameters for scan */\n\n#if JPEG_LIB_VERSION >= 80\n  int block_size;\t\t/* the basic DCT block size: 1..16 */\n  const int * natural_order;\t/* natural-order position array */\n  int lim_Se;\t\t\t/* min( Se, DCTSIZE2-1 ) */\n#endif\n\n  /*\n   * Links to compression subobjects (methods and private variables of modules)\n   */\n  struct jpeg_comp_master * master;\n  struct jpeg_c_main_controller * main;\n  struct jpeg_c_prep_controller * prep;\n  struct jpeg_c_coef_controller * coef;\n  struct jpeg_marker_writer * marker;\n  struct jpeg_color_converter * cconvert;\n  struct jpeg_downsampler * downsample;\n  struct jpeg_forward_dct * fdct;\n  struct jpeg_entropy_encoder * entropy;\n  jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */\n  int script_space_size;\n};\n\n\n/* Master record for a decompression instance */\n\nstruct jpeg_decompress_struct {\n  jpeg_common_fields;\t\t/* Fields shared with jpeg_compress_struct */\n\n  /* Source of compressed data */\n  struct jpeg_source_mgr * src;\n\n  /* Basic description of image --- filled in by jpeg_read_header(). */\n  /* Application may inspect these values to decide how to process image. */\n\n  JDIMENSION image_width;\t/* nominal image width (from SOF marker) */\n  JDIMENSION image_height;\t/* nominal image height */\n  int num_components;\t\t/* # of color components in JPEG image */\n  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */\n\n  /* Decompression processing parameters --- these fields must be set before\n   * calling jpeg_start_decompress().  Note that jpeg_read_header() initializes\n   * them to default values.\n   */\n\n  J_COLOR_SPACE out_color_space; /* colorspace for output */\n\n  unsigned int scale_num, scale_denom; /* fraction by which to scale image */\n\n  double output_gamma;\t\t/* image gamma wanted in output */\n\n  boolean buffered_image;\t/* TRUE=multiple output passes */\n  boolean raw_data_out;\t\t/* TRUE=downsampled data wanted */\n\n  J_DCT_METHOD dct_method;\t/* IDCT algorithm selector */\n  boolean do_fancy_upsampling;\t/* TRUE=apply fancy upsampling */\n  boolean do_block_smoothing;\t/* TRUE=apply interblock smoothing */\n\n  boolean quantize_colors;\t/* TRUE=colormapped output wanted */\n  /* the following are ignored if not quantize_colors: */\n  J_DITHER_MODE dither_mode;\t/* type of color dithering to use */\n  boolean two_pass_quantize;\t/* TRUE=use two-pass color quantization */\n  int desired_number_of_colors;\t/* max # colors to use in created colormap */\n  /* these are significant only in buffered-image mode: */\n  boolean enable_1pass_quant;\t/* enable future use of 1-pass quantizer */\n  boolean enable_external_quant;/* enable future use of external colormap */\n  boolean enable_2pass_quant;\t/* enable future use of 2-pass quantizer */\n\n  /* Description of actual output image that will be returned to application.\n   * These fields are computed by jpeg_start_decompress().\n   * You can also use jpeg_calc_output_dimensions() to determine these values\n   * in advance of calling jpeg_start_decompress().\n   */\n\n  JDIMENSION output_width;\t/* scaled image width */\n  JDIMENSION output_height;\t/* scaled image height */\n  int out_color_components;\t/* # of color components in out_color_space */\n  int output_components;\t/* # of color components returned */\n  /* output_components is 1 (a colormap index) when quantizing colors;\n   * otherwise it equals out_color_components.\n   */\n  int rec_outbuf_height;\t/* min recommended height of scanline buffer */\n  /* If the buffer passed to jpeg_read_scanlines() is less than this many rows\n   * high, space and time will be wasted due to unnecessary data copying.\n   * Usually rec_outbuf_height will be 1 or 2, at most 4.\n   */\n\n  /* When quantizing colors, the output colormap is described by these fields.\n   * The application can supply a colormap by setting colormap non-NULL before\n   * calling jpeg_start_decompress; otherwise a colormap is created during\n   * jpeg_start_decompress or jpeg_start_output.\n   * The map has out_color_components rows and actual_number_of_colors columns.\n   */\n  int actual_number_of_colors;\t/* number of entries in use */\n  JSAMPARRAY colormap;\t\t/* The color map as a 2-D pixel array */\n\n  /* State variables: these variables indicate the progress of decompression.\n   * The application may examine these but must not modify them.\n   */\n\n  /* Row index of next scanline to be read from jpeg_read_scanlines().\n   * Application may use this to control its processing loop, e.g.,\n   * \"while (output_scanline < output_height)\".\n   */\n  JDIMENSION output_scanline;\t/* 0 .. output_height-1  */\n\n  /* Current input scan number and number of iMCU rows completed in scan.\n   * These indicate the progress of the decompressor input side.\n   */\n  int input_scan_number;\t/* Number of SOS markers seen so far */\n  JDIMENSION input_iMCU_row;\t/* Number of iMCU rows completed */\n\n  /* The \"output scan number\" is the notional scan being displayed by the\n   * output side.  The decompressor will not allow output scan/row number\n   * to get ahead of input scan/row, but it can fall arbitrarily far behind.\n   */\n  int output_scan_number;\t/* Nominal scan number being displayed */\n  JDIMENSION output_iMCU_row;\t/* Number of iMCU rows read */\n\n  /* Current progression status.  coef_bits[c][i] indicates the precision\n   * with which component c's DCT coefficient i (in zigzag order) is known.\n   * It is -1 when no data has yet been received, otherwise it is the point\n   * transform (shift) value for the most recent scan of the coefficient\n   * (thus, 0 at completion of the progression).\n   * This pointer is NULL when reading a non-progressive file.\n   */\n  int (*coef_bits)[DCTSIZE2];\t/* -1 or current Al value for each coef */\n\n  /* Internal JPEG parameters --- the application usually need not look at\n   * these fields.  Note that the decompressor output side may not use\n   * any parameters that can change between scans.\n   */\n\n  /* Quantization and Huffman tables are carried forward across input\n   * datastreams when processing abbreviated JPEG datastreams.\n   */\n\n  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];\n  /* ptrs to coefficient quantization tables, or NULL if not defined */\n\n  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];\n  /* ptrs to Huffman coding tables, or NULL if not defined */\n\n  /* These parameters are never carried across datastreams, since they\n   * are given in SOF/SOS markers or defined to be reset by SOI.\n   */\n\n  int data_precision;\t\t/* bits of precision in image data */\n\n  jpeg_component_info * comp_info;\n  /* comp_info[i] describes component that appears i'th in SOF */\n\n#if JPEG_LIB_VERSION >= 80\n  boolean is_baseline;\t\t/* TRUE if Baseline SOF0 encountered */\n#endif\n  boolean progressive_mode;\t/* TRUE if SOFn specifies progressive mode */\n  boolean arith_code;\t\t/* TRUE=arithmetic coding, FALSE=Huffman */\n\n  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */\n  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */\n  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */\n\n  unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */\n\n  /* These fields record data obtained from optional markers recognized by\n   * the JPEG library.\n   */\n  boolean saw_JFIF_marker;\t/* TRUE iff a JFIF APP0 marker was found */\n  /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */\n  UINT8 JFIF_major_version;\t/* JFIF version number */\n  UINT8 JFIF_minor_version;\n  UINT8 density_unit;\t\t/* JFIF code for pixel size units */\n  UINT16 X_density;\t\t/* Horizontal pixel density */\n  UINT16 Y_density;\t\t/* Vertical pixel density */\n  boolean saw_Adobe_marker;\t/* TRUE iff an Adobe APP14 marker was found */\n  UINT8 Adobe_transform;\t/* Color transform code from Adobe marker */\n\n  boolean CCIR601_sampling;\t/* TRUE=first samples are cosited */\n\n  /* Aside from the specific data retained from APPn markers known to the\n   * library, the uninterpreted contents of any or all APPn and COM markers\n   * can be saved in a list for examination by the application.\n   */\n  jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */\n\n  /* Remaining fields are known throughout decompressor, but generally\n   * should not be touched by a surrounding application.\n   */\n\n  /*\n   * These fields are computed during decompression startup\n   */\n  int max_h_samp_factor;\t/* largest h_samp_factor */\n  int max_v_samp_factor;\t/* largest v_samp_factor */\n\n#if JPEG_LIB_VERSION >= 70\n  int min_DCT_h_scaled_size;\t/* smallest DCT_h_scaled_size of any component */\n  int min_DCT_v_scaled_size;\t/* smallest DCT_v_scaled_size of any component */\n#else\n  int min_DCT_scaled_size;\t/* smallest DCT_scaled_size of any component */\n#endif\n\n  JDIMENSION total_iMCU_rows;\t/* # of iMCU rows in image */\n  /* The coefficient controller's input and output progress is measured in\n   * units of \"iMCU\" (interleaved MCU) rows.  These are the same as MCU rows\n   * in fully interleaved JPEG scans, but are used whether the scan is\n   * interleaved or not.  We define an iMCU row as v_samp_factor DCT block\n   * rows of each component.  Therefore, the IDCT output contains\n   * v_samp_factor*DCT_[v_]scaled_size sample rows of a component per iMCU row.\n   */\n\n  JSAMPLE * sample_range_limit; /* table for fast range-limiting */\n\n  /*\n   * These fields are valid during any one scan.\n   * They describe the components and MCUs actually appearing in the scan.\n   * Note that the decompressor output side must not use these fields.\n   */\n  int comps_in_scan;\t\t/* # of JPEG components in this scan */\n  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];\n  /* *cur_comp_info[i] describes component that appears i'th in SOS */\n\n  JDIMENSION MCUs_per_row;\t/* # of MCUs across the image */\n  JDIMENSION MCU_rows_in_scan;\t/* # of MCU rows in the image */\n\n  int blocks_in_MCU;\t\t/* # of DCT blocks per MCU */\n  int MCU_membership[D_MAX_BLOCKS_IN_MCU];\n  /* MCU_membership[i] is index in cur_comp_info of component owning */\n  /* i'th block in an MCU */\n\n  int Ss, Se, Ah, Al;\t\t/* progressive JPEG parameters for scan */\n\n#if JPEG_LIB_VERSION >= 80\n  /* These fields are derived from Se of first SOS marker.\n   */\n  int block_size;\t\t/* the basic DCT block size: 1..16 */\n  const int * natural_order; /* natural-order position array for entropy decode */\n  int lim_Se;\t\t\t/* min( Se, DCTSIZE2-1 ) for entropy decode */\n#endif\n\n  /* This field is shared between entropy decoder and marker parser.\n   * It is either zero or the code of a JPEG marker that has been\n   * read from the data source, but has not yet been processed.\n   */\n  int unread_marker;\n\n  /*\n   * Links to decompression subobjects (methods, private variables of modules)\n   */\n  struct jpeg_decomp_master * master;\n  struct jpeg_d_main_controller * main;\n  struct jpeg_d_coef_controller * coef;\n  struct jpeg_d_post_controller * post;\n  struct jpeg_input_controller * inputctl;\n  struct jpeg_marker_reader * marker;\n  struct jpeg_entropy_decoder * entropy;\n  struct jpeg_inverse_dct * idct;\n  struct jpeg_upsampler * upsample;\n  struct jpeg_color_deconverter * cconvert;\n  struct jpeg_color_quantizer * cquantize;\n};\n\n\n/* \"Object\" declarations for JPEG modules that may be supplied or called\n * directly by the surrounding application.\n * As with all objects in the JPEG library, these structs only define the\n * publicly visible methods and state variables of a module.  Additional\n * private fields may exist after the public ones.\n */\n\n\n/* Error handler object */\n\nstruct jpeg_error_mgr {\n  /* Error exit handler: does not return to caller */\n  JMETHOD(void, error_exit, (j_common_ptr cinfo));\n  /* Conditionally emit a trace or warning message */\n  JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level));\n  /* Routine that actually outputs a trace or error message */\n  JMETHOD(void, output_message, (j_common_ptr cinfo));\n  /* Format a message string for the most recent JPEG error or message */\n  JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer));\n#define JMSG_LENGTH_MAX  200\t/* recommended size of format_message buffer */\n  /* Reset error state variables at start of a new image */\n  JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));\n  \n  /* The message ID code and any parameters are saved here.\n   * A message can have one string parameter or up to 8 int parameters.\n   */\n  int msg_code;\n#define JMSG_STR_PARM_MAX  80\n  union {\n    int i[8];\n    char s[JMSG_STR_PARM_MAX];\n  } msg_parm;\n  \n  /* Standard state variables for error facility */\n  \n  int trace_level;\t\t/* max msg_level that will be displayed */\n  \n  /* For recoverable corrupt-data errors, we emit a warning message,\n   * but keep going unless emit_message chooses to abort.  emit_message\n   * should count warnings in num_warnings.  The surrounding application\n   * can check for bad data by seeing if num_warnings is nonzero at the\n   * end of processing.\n   */\n  long num_warnings;\t\t/* number of corrupt-data warnings */\n\n  /* These fields point to the table(s) of error message strings.\n   * An application can change the table pointer to switch to a different\n   * message list (typically, to change the language in which errors are\n   * reported).  Some applications may wish to add additional error codes\n   * that will be handled by the JPEG library error mechanism; the second\n   * table pointer is used for this purpose.\n   *\n   * First table includes all errors generated by JPEG library itself.\n   * Error code 0 is reserved for a \"no such error string\" message.\n   */\n  const char * const * jpeg_message_table; /* Library errors */\n  int last_jpeg_message;    /* Table contains strings 0..last_jpeg_message */\n  /* Second table can be added by application (see cjpeg/djpeg for example).\n   * It contains strings numbered first_addon_message..last_addon_message.\n   */\n  const char * const * addon_message_table; /* Non-library errors */\n  int first_addon_message;\t/* code for first string in addon table */\n  int last_addon_message;\t/* code for last string in addon table */\n};\n\n\n/* Progress monitor object */\n\nstruct jpeg_progress_mgr {\n  JMETHOD(void, progress_monitor, (j_common_ptr cinfo));\n\n  long pass_counter;\t\t/* work units completed in this pass */\n  long pass_limit;\t\t/* total number of work units in this pass */\n  int completed_passes;\t\t/* passes completed so far */\n  int total_passes;\t\t/* total number of passes expected */\n};\n\n\n/* Data destination object for compression */\n\nstruct jpeg_destination_mgr {\n  JOCTET * next_output_byte;\t/* => next byte to write in buffer */\n  size_t free_in_buffer;\t/* # of byte spaces remaining in buffer */\n\n  JMETHOD(void, init_destination, (j_compress_ptr cinfo));\n  JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo));\n  JMETHOD(void, term_destination, (j_compress_ptr cinfo));\n};\n\n\n/* Data source object for decompression */\n\nstruct jpeg_source_mgr {\n  const JOCTET * next_input_byte; /* => next byte to read from buffer */\n  size_t bytes_in_buffer;\t/* # of bytes remaining in buffer */\n\n  JMETHOD(void, init_source, (j_decompress_ptr cinfo));\n  JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo));\n  JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes));\n  JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired));\n  JMETHOD(void, term_source, (j_decompress_ptr cinfo));\n};\n\n\n/* Memory manager object.\n * Allocates \"small\" objects (a few K total), \"large\" objects (tens of K),\n * and \"really big\" objects (virtual arrays with backing store if needed).\n * The memory manager does not allow individual objects to be freed; rather,\n * each created object is assigned to a pool, and whole pools can be freed\n * at once.  This is faster and more convenient than remembering exactly what\n * to free, especially where malloc()/free() are not too speedy.\n * NB: alloc routines never return NULL.  They exit to error_exit if not\n * successful.\n */\n\n#define JPOOL_PERMANENT\t0\t/* lasts until master record is destroyed */\n#define JPOOL_IMAGE\t1\t/* lasts until done with image/datastream */\n#define JPOOL_NUMPOOLS\t2\n\ntypedef struct jvirt_sarray_control * jvirt_sarray_ptr;\ntypedef struct jvirt_barray_control * jvirt_barray_ptr;\n\n\nstruct jpeg_memory_mgr {\n  /* Method pointers */\n  JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id,\n\t\t\t\tsize_t sizeofobject));\n  JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id,\n\t\t\t\t     size_t sizeofobject));\n  JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id,\n\t\t\t\t     JDIMENSION samplesperrow,\n\t\t\t\t     JDIMENSION numrows));\n  JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id,\n\t\t\t\t      JDIMENSION blocksperrow,\n\t\t\t\t      JDIMENSION numrows));\n  JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo,\n\t\t\t\t\t\t  int pool_id,\n\t\t\t\t\t\t  boolean pre_zero,\n\t\t\t\t\t\t  JDIMENSION samplesperrow,\n\t\t\t\t\t\t  JDIMENSION numrows,\n\t\t\t\t\t\t  JDIMENSION maxaccess));\n  JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo,\n\t\t\t\t\t\t  int pool_id,\n\t\t\t\t\t\t  boolean pre_zero,\n\t\t\t\t\t\t  JDIMENSION blocksperrow,\n\t\t\t\t\t\t  JDIMENSION numrows,\n\t\t\t\t\t\t  JDIMENSION maxaccess));\n  JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo));\n  JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo,\n\t\t\t\t\t   jvirt_sarray_ptr ptr,\n\t\t\t\t\t   JDIMENSION start_row,\n\t\t\t\t\t   JDIMENSION num_rows,\n\t\t\t\t\t   boolean writable));\n  JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo,\n\t\t\t\t\t    jvirt_barray_ptr ptr,\n\t\t\t\t\t    JDIMENSION start_row,\n\t\t\t\t\t    JDIMENSION num_rows,\n\t\t\t\t\t    boolean writable));\n  JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id));\n  JMETHOD(void, self_destruct, (j_common_ptr cinfo));\n\n  /* Limit on memory allocation for this JPEG object.  (Note that this is\n   * merely advisory, not a guaranteed maximum; it only affects the space\n   * used for virtual-array buffers.)  May be changed by outer application\n   * after creating the JPEG object.\n   */\n  long max_memory_to_use;\n\n  /* Maximum allocation request accepted by alloc_large. */\n  long max_alloc_chunk;\n};\n\n\n/* Routine signature for application-supplied marker processing methods.\n * Need not pass marker code since it is stored in cinfo->unread_marker.\n */\ntypedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));\n\n\n/* Declarations for routines called by application.\n * The JPP macro hides prototype parameters from compilers that can't cope.\n * Note JPP requires double parentheses.\n */\n\n#ifdef HAVE_PROTOTYPES\n#define JPP(arglist)\targlist\n#else\n#define JPP(arglist)\t()\n#endif\n\n\n/* Short forms of external names for systems with brain-damaged linkers.\n * We shorten external names to be unique in the first six letters, which\n * is good enough for all known systems.\n * (If your compiler itself needs names to be unique in less than 15 \n * characters, you are out of luck.  Get a better compiler.)\n */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jpeg_std_error\t\tjStdError\n#define jpeg_CreateCompress\tjCreaCompress\n#define jpeg_CreateDecompress\tjCreaDecompress\n#define jpeg_destroy_compress\tjDestCompress\n#define jpeg_destroy_decompress\tjDestDecompress\n#define jpeg_stdio_dest\t\tjStdDest\n#define jpeg_stdio_src\t\tjStdSrc\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\n#define jpeg_mem_dest\t\tjMemDest\n#define jpeg_mem_src\t\tjMemSrc\n#endif\n#define jpeg_set_defaults\tjSetDefaults\n#define jpeg_set_colorspace\tjSetColorspace\n#define jpeg_default_colorspace\tjDefColorspace\n#define jpeg_set_quality\tjSetQuality\n#define jpeg_set_linear_quality\tjSetLQuality\n#if JPEG_LIB_VERSION >= 70\n#define jpeg_default_qtables\tjDefQTables\n#endif\n#define jpeg_add_quant_table\tjAddQuantTable\n#define jpeg_quality_scaling\tjQualityScaling\n#define jpeg_simple_progression\tjSimProgress\n#define jpeg_suppress_tables\tjSuppressTables\n#define jpeg_alloc_quant_table\tjAlcQTable\n#define jpeg_alloc_huff_table\tjAlcHTable\n#define jpeg_start_compress\tjStrtCompress\n#define jpeg_write_scanlines\tjWrtScanlines\n#define jpeg_finish_compress\tjFinCompress\n#if JPEG_LIB_VERSION >= 70\n#define jpeg_calc_jpeg_dimensions\tjCjpegDimensions\n#endif\n#define jpeg_write_raw_data\tjWrtRawData\n#define jpeg_write_marker\tjWrtMarker\n#define jpeg_write_m_header\tjWrtMHeader\n#define jpeg_write_m_byte\tjWrtMByte\n#define jpeg_write_tables\tjWrtTables\n#define jpeg_read_header\tjReadHeader\n#define jpeg_start_decompress\tjStrtDecompress\n#define jpeg_read_scanlines\tjReadScanlines\n#define jpeg_finish_decompress\tjFinDecompress\n#define jpeg_read_raw_data\tjReadRawData\n#define jpeg_has_multiple_scans\tjHasMultScn\n#define jpeg_start_output\tjStrtOutput\n#define jpeg_finish_output\tjFinOutput\n#define jpeg_input_complete\tjInComplete\n#define jpeg_new_colormap\tjNewCMap\n#define jpeg_consume_input\tjConsumeInput\n#if JPEG_LIB_VERSION >= 80\n#define jpeg_core_output_dimensions\tjCoreDimensions\n#endif\n#define jpeg_calc_output_dimensions\tjCalcDimensions\n#define jpeg_save_markers\tjSaveMarkers\n#define jpeg_set_marker_processor\tjSetMarker\n#define jpeg_read_coefficients\tjReadCoefs\n#define jpeg_write_coefficients\tjWrtCoefs\n#define jpeg_copy_critical_parameters\tjCopyCrit\n#define jpeg_abort_compress\tjAbrtCompress\n#define jpeg_abort_decompress\tjAbrtDecompress\n#define jpeg_abort\t\tjAbort\n#define jpeg_destroy\t\tjDestroy\n#define jpeg_resync_to_restart\tjResyncRestart\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\n\n/* Default error-management setup */\nEXTERN(struct jpeg_error_mgr *) jpeg_std_error\n\tJPP((struct jpeg_error_mgr * err));\n\n/* Initialization of JPEG compression objects.\n * jpeg_create_compress() and jpeg_create_decompress() are the exported\n * names that applications should call.  These expand to calls on\n * jpeg_CreateCompress and jpeg_CreateDecompress with additional information\n * passed for version mismatch checking.\n * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx.\n */\n#define jpeg_create_compress(cinfo) \\\n    jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \\\n\t\t\t(size_t) sizeof(struct jpeg_compress_struct))\n#define jpeg_create_decompress(cinfo) \\\n    jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \\\n\t\t\t  (size_t) sizeof(struct jpeg_decompress_struct))\nEXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo,\n\t\t\t\t      int version, size_t structsize));\nEXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo,\n\t\t\t\t\tint version, size_t structsize));\n/* Destruction of JPEG compression objects */\nEXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo));\n\n/* Standard data source and destination managers: stdio streams. */\n/* Caller is responsible for opening the file before and closing after. */\nEXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile));\nEXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile));\n\n#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)\n/* Data source and destination managers: memory buffers. */\nEXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,\n\t\t\t       unsigned char ** outbuffer,\n\t\t\t       unsigned long * outsize));\nEXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo,\n\t\t\t      unsigned char * inbuffer,\n\t\t\t      unsigned long insize));\n#endif\n\n/* Default parameter setup for compression */\nEXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));\n/* Compression parameter setup aids */\nEXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo,\n\t\t\t\t      J_COLOR_SPACE colorspace));\nEXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality,\n\t\t\t\t   boolean force_baseline));\nEXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo,\n\t\t\t\t\t  int scale_factor,\n\t\t\t\t\t  boolean force_baseline));\n#if JPEG_LIB_VERSION >= 70\nEXTERN(void) jpeg_default_qtables JPP((j_compress_ptr cinfo,\n\t\t\t\t       boolean force_baseline));\n#endif\nEXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl,\n\t\t\t\t       const unsigned int *basic_table,\n\t\t\t\t       int scale_factor,\n\t\t\t\t       boolean force_baseline));\nEXTERN(int) jpeg_quality_scaling JPP((int quality));\nEXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,\n\t\t\t\t       boolean suppress));\nEXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));\nEXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));\n\n/* Main entry points for compression */\nEXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,\n\t\t\t\t      boolean write_all_tables));\nEXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo,\n\t\t\t\t\t     JSAMPARRAY scanlines,\n\t\t\t\t\t     JDIMENSION num_lines));\nEXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo));\n\n#if JPEG_LIB_VERSION >= 70\n/* Precalculate JPEG dimensions for current compression parameters. */\nEXTERN(void) jpeg_calc_jpeg_dimensions JPP((j_compress_ptr cinfo));\n#endif\n\n/* Replaces jpeg_write_scanlines when writing raw downsampled data. */\nEXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo,\n\t\t\t\t\t    JSAMPIMAGE data,\n\t\t\t\t\t    JDIMENSION num_lines));\n\n/* Write a special marker.  See libjpeg.txt concerning safe usage. */\nEXTERN(void) jpeg_write_marker\n\tJPP((j_compress_ptr cinfo, int marker,\n\t     const JOCTET * dataptr, unsigned int datalen));\n/* Same, but piecemeal. */\nEXTERN(void) jpeg_write_m_header\n\tJPP((j_compress_ptr cinfo, int marker, unsigned int datalen));\nEXTERN(void) jpeg_write_m_byte\n\tJPP((j_compress_ptr cinfo, int val));\n\n/* Alternate compression function: just write an abbreviated table file */\nEXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo));\n\n/* Decompression startup: read start of JPEG datastream to see what's there */\nEXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,\n\t\t\t\t  boolean require_image));\n/* Return value is one of: */\n#define JPEG_SUSPENDED\t\t0 /* Suspended due to lack of input data */\n#define JPEG_HEADER_OK\t\t1 /* Found valid image datastream */\n#define JPEG_HEADER_TABLES_ONLY\t2 /* Found valid table-specs-only datastream */\n/* If you pass require_image = TRUE (normal case), you need not check for\n * a TABLES_ONLY return code; an abbreviated file will cause an error exit.\n * JPEG_SUSPENDED is only possible if you use a data source module that can\n * give a suspension return (the stdio source module doesn't).\n */\n\n/* Main entry points for decompression */\nEXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo));\nEXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t    JSAMPARRAY scanlines,\n\t\t\t\t\t    JDIMENSION max_lines));\nEXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo));\n\n/* Replaces jpeg_read_scanlines when reading raw downsampled data. */\nEXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t   JSAMPIMAGE data,\n\t\t\t\t\t   JDIMENSION max_lines));\n\n/* Additional entry points for buffered-image mode. */\nEXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo));\nEXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo,\n\t\t\t\t       int scan_number));\nEXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo));\nEXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo));\nEXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo));\nEXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo));\n/* Return value is one of: */\n/* #define JPEG_SUSPENDED\t0    Suspended due to lack of input data */\n#define JPEG_REACHED_SOS\t1 /* Reached start of new scan */\n#define JPEG_REACHED_EOI\t2 /* Reached end of image */\n#define JPEG_ROW_COMPLETED\t3 /* Completed one iMCU row */\n#define JPEG_SCAN_COMPLETED\t4 /* Completed last iMCU row of a scan */\n\n/* Precalculate output dimensions for current decompression parameters. */\n#if JPEG_LIB_VERSION >= 80\nEXTERN(void) jpeg_core_output_dimensions JPP((j_decompress_ptr cinfo));\n#endif\nEXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo));\n\n/* Control saving of COM and APPn markers into marker_list. */\nEXTERN(void) jpeg_save_markers\n\tJPP((j_decompress_ptr cinfo, int marker_code,\n\t     unsigned int length_limit));\n\n/* Install a special processing method for COM or APPn markers. */\nEXTERN(void) jpeg_set_marker_processor\n\tJPP((j_decompress_ptr cinfo, int marker_code,\n\t     jpeg_marker_parser_method routine));\n\n/* Read or write raw DCT coefficients --- useful for lossless transcoding. */\nEXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo));\nEXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo,\n\t\t\t\t\t  jvirt_barray_ptr * coef_arrays));\nEXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo,\n\t\t\t\t\t\tj_compress_ptr dstinfo));\n\n/* If you choose to abort compression or decompression before completing\n * jpeg_finish_(de)compress, then you need to clean up to release memory,\n * temporary files, etc.  You can just call jpeg_destroy_(de)compress\n * if you're done with the JPEG object, but if you want to clean it up and\n * reuse it, call this:\n */\nEXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo));\nEXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo));\n\n/* Generic versions of jpeg_abort and jpeg_destroy that work on either\n * flavor of JPEG object.  These may be more convenient in some places.\n */\nEXTERN(void) jpeg_abort JPP((j_common_ptr cinfo));\nEXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo));\n\n/* Default restart-marker-resync procedure for use by data source modules */\nEXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo,\n\t\t\t\t\t    int desired));\n\n\n/* These marker codes are exported since applications and data source modules\n * are likely to want to use them.\n */\n\n#define JPEG_RST0\t0xD0\t/* RST0 marker code */\n#define JPEG_EOI\t0xD9\t/* EOI marker code */\n#define JPEG_APP0\t0xE0\t/* APP0 marker code */\n#define JPEG_COM\t0xFE\t/* COM marker code */\n\n\n/* If we have a brain-damaged compiler that emits warnings (or worse, errors)\n * for structure definitions that are never filled in, keep it quiet by\n * supplying dummy definitions for the various substructures.\n */\n\n#ifdef INCOMPLETE_TYPES_BROKEN\n#ifndef JPEG_INTERNALS\t\t/* will be defined in jpegint.h */\nstruct jvirt_sarray_control { long dummy; };\nstruct jvirt_barray_control { long dummy; };\nstruct jpeg_comp_master { long dummy; };\nstruct jpeg_c_main_controller { long dummy; };\nstruct jpeg_c_prep_controller { long dummy; };\nstruct jpeg_c_coef_controller { long dummy; };\nstruct jpeg_marker_writer { long dummy; };\nstruct jpeg_color_converter { long dummy; };\nstruct jpeg_downsampler { long dummy; };\nstruct jpeg_forward_dct { long dummy; };\nstruct jpeg_entropy_encoder { long dummy; };\nstruct jpeg_decomp_master { long dummy; };\nstruct jpeg_d_main_controller { long dummy; };\nstruct jpeg_d_coef_controller { long dummy; };\nstruct jpeg_d_post_controller { long dummy; };\nstruct jpeg_input_controller { long dummy; };\nstruct jpeg_marker_reader { long dummy; };\nstruct jpeg_entropy_decoder { long dummy; };\nstruct jpeg_inverse_dct { long dummy; };\nstruct jpeg_upsampler { long dummy; };\nstruct jpeg_color_deconverter { long dummy; };\nstruct jpeg_color_quantizer { long dummy; };\n#endif /* JPEG_INTERNALS */\n#endif /* INCOMPLETE_TYPES_BROKEN */\n\n\n/*\n * The JPEG library modules define JPEG_INTERNALS before including this file.\n * The internal structure declarations are read only when that is true.\n * Applications using the library should not include jpegint.h, but may wish\n * to include jerror.h.\n */\n\n#ifdef JPEG_INTERNALS\n#include \"jpegint.h\"\t\t/* fetch private declarations */\n#include \"jerror.h\"\t\t/* fetch error codes too */\n#endif\n\n#ifdef __cplusplus\n#ifndef DONT_USE_EXTERN_C\n}\n#endif\n#endif\n\n#endif /* JPEGLIB_H */\n"
  },
  {
    "path": "ext/libjpeg-turbo/jpegtran.1",
    "content": ".TH JPEGTRAN 1 \"1 January 2013\"\n.SH NAME\njpegtran \\- lossless transformation of JPEG files\n.SH SYNOPSIS\n.B jpegtran\n[\n.I options\n]\n[\n.I filename\n]\n.LP\n.SH DESCRIPTION\n.LP\n.B jpegtran\nperforms various useful transformations of JPEG files.\nIt can translate the coded representation from one variant of JPEG to another,\nfor example from baseline JPEG to progressive JPEG or vice versa.  It can also\nperform some rearrangements of the image data, for example turning an image\nfrom landscape to portrait format by rotation.\n.PP\n.B jpegtran\nworks by rearranging the compressed data (DCT coefficients), without\never fully decoding the image.  Therefore, its transformations are lossless:\nthere is no image degradation at all, which would not be true if you used\n.B djpeg\nfollowed by\n.B cjpeg\nto accomplish the same conversion.  But by the same token,\n.B jpegtran\ncannot perform lossy operations such as changing the image quality.\n.PP\n.B jpegtran\nreads the named JPEG/JFIF file, or the standard input if no file is\nnamed, and produces a JPEG/JFIF file on the standard output.\n.SH OPTIONS\nAll switch names may be abbreviated; for example,\n.B \\-optimize\nmay be written\n.B \\-opt\nor\n.BR \\-o .\nUpper and lower case are equivalent.\nBritish spellings are also accepted (e.g.,\n.BR \\-optimise ),\nthough for brevity these are not mentioned below.\n.PP\nTo specify the coded JPEG representation used in the output file,\n.B jpegtran\naccepts a subset of the switches recognized by\n.BR cjpeg :\n.TP\n.B \\-optimize\nPerform optimization of entropy encoding parameters.\n.TP\n.B \\-progressive\nCreate progressive JPEG file.\n.TP\n.BI \\-restart \" N\"\nEmit a JPEG restart marker every N MCU rows, or every N MCU blocks if \"B\" is\nattached to the number.\n.TP\n.B \\-arithmetic\nUse arithmetic coding.\n.TP\n.BI \\-scans \" file\"\nUse the scan script given in the specified text file.\n.PP\nSee\n.BR cjpeg (1)\nfor more details about these switches.\nIf you specify none of these switches, you get a plain baseline-JPEG output\nfile.  The quality setting and so forth are determined by the input file.\n.PP\nThe image can be losslessly transformed by giving one of these switches:\n.TP\n.B \\-flip horizontal\nMirror image horizontally (left-right).\n.TP\n.B \\-flip vertical\nMirror image vertically (top-bottom).\n.TP\n.B \\-rotate 90\nRotate image 90 degrees clockwise.\n.TP\n.B \\-rotate 180\nRotate image 180 degrees.\n.TP\n.B \\-rotate 270\nRotate image 270 degrees clockwise (or 90 ccw).\n.TP\n.B \\-transpose\nTranspose image (across UL-to-LR axis).\n.TP\n.B \\-transverse\nTransverse transpose (across UR-to-LL axis).\n.PP\nThe transpose transformation has no restrictions regarding image dimensions.\nThe other transformations operate rather oddly if the image dimensions are not\na multiple of the iMCU size (usually 8 or 16 pixels), because they can only\ntransform complete blocks of DCT coefficient data in the desired way.\n.PP\n.BR jpegtran 's\ndefault behavior when transforming an odd-size image is designed\nto preserve exact reversibility and mathematical consistency of the\ntransformation set.  As stated, transpose is able to flip the entire image\narea.  Horizontal mirroring leaves any partial iMCU column at the right edge\nuntouched, but is able to flip all rows of the image.  Similarly, vertical\nmirroring leaves any partial iMCU row at the bottom edge untouched, but is\nable to flip all columns.  The other transforms can be built up as sequences\nof transpose and flip operations; for consistency, their actions on edge\npixels are defined to be the same as the end result of the corresponding\ntranspose-and-flip sequence.\n.PP\nFor practical use, you may prefer to discard any untransformable edge pixels\nrather than having a strange-looking strip along the right and/or bottom edges\nof a transformed image.  To do this, add the\n.B \\-trim\nswitch:\n.TP\n.B \\-trim\nDrop non-transformable edge blocks.\n.IP\nObviously, a transformation with\n.B \\-trim\nis not reversible, so strictly speaking\n.B jpegtran\nwith this switch is not lossless.  Also, the expected mathematical\nequivalences between the transformations no longer hold.  For example,\n.B \\-rot 270 -trim\ntrims only the bottom edge, but\n.B \\-rot 90 -trim\nfollowed by\n.B \\-rot 180 -trim\ntrims both edges.\n.TP\n.B \\-perfect\nIf you are only interested in perfect transformations, add the\n.B \\-perfect\nswitch.  This causes\n.B jpegtran\nto fail with an error if the transformation is not perfect.\n.IP\nFor example, you may want to do\n.IP\n.B (jpegtran \\-rot 90 -perfect\n.I foo.jpg\n.B || djpeg\n.I foo.jpg\n.B | pnmflip \\-r90 | cjpeg)\n.IP\nto do a perfect rotation, if available, or an approximated one if not.\n.TP\n.B \\-crop WxH+X+Y\nCrop the image to a rectangular region of width W and height H, starting at\npoint X,Y.  The lossless crop feature discards data outside of a given image\nregion but losslessly preserves what is inside.  Like the rotate and flip\ntransforms, lossless crop is restricted by the current JPEG format; the upper\nleft corner of the selected region must fall on an iMCU boundary.  If it\ndoesn't, then it is silently moved up and/or left to the nearest iMCU boundary\n(the lower right corner is unchanged.)\n.PP\nOther not-strictly-lossless transformation switches are:\n.TP\n.B \\-grayscale\nForce grayscale output.\n.IP\nThis option discards the chrominance channels if the input image is YCbCr\n(ie, a standard color JPEG), resulting in a grayscale JPEG file.  The\nluminance channel is preserved exactly, so this is a better method of reducing\nto grayscale than decompression, conversion, and recompression.  This switch\nis particularly handy for fixing a monochrome picture that was mistakenly\nencoded as a color JPEG.  (In such a case, the space savings from getting rid\nof the near-empty chroma channels won't be large; but the decoding time for\na grayscale JPEG is substantially less than that for a color JPEG.)\n.PP\n.B jpegtran\nalso recognizes these switches that control what to do with \"extra\" markers,\nsuch as comment blocks:\n.TP\n.B \\-copy none\nCopy no extra markers from source file.  This setting suppresses all\ncomments and other excess baggage present in the source file.\n.TP\n.B \\-copy comments\nCopy only comment markers.  This setting copies comments from the source file\nbut discards any other data that is inessential for image display.\n.TP\n.B \\-copy all\nCopy all extra markers.  This setting preserves miscellaneous markers\nfound in the source file, such as JFIF thumbnails, Exif data, and Photoshop\nsettings.  In some files, these extra markers can be sizable.\n.PP\nThe default behavior is \\fB-copy comments\\fR.  (Note: in IJG releases v6 and\nv6a, \\fBjpegtran\\fR always did the equivalent of \\fB-copy none\\fR.)\n.PP\nAdditional switches recognized by jpegtran are:\n.TP\n.BI \\-maxmemory \" N\"\nSet limit for amount of memory to use in processing large images.  Value is\nin thousands of bytes, or millions of bytes if \"M\" is attached to the\nnumber.  For example,\n.B \\-max 4m\nselects 4000000 bytes.  If more space is needed, temporary files will be used.\n.TP\n.BI \\-outfile \" name\"\nSend output image to the named file, not to standard output.\n.TP\n.B \\-verbose\nEnable debug printout.  More\n.BR \\-v 's\ngive more output.  Also, version information is printed at startup.\n.TP\n.B \\-debug\nSame as\n.BR \\-verbose .\n.SH EXAMPLES\n.LP\nThis example converts a baseline JPEG file to progressive form:\n.IP\n.B jpegtran \\-progressive\n.I foo.jpg\n.B >\n.I fooprog.jpg\n.PP\nThis example rotates an image 90 degrees clockwise, discarding any\nunrotatable edge pixels:\n.IP\n.B jpegtran \\-rot 90 -trim\n.I foo.jpg\n.B >\n.I foo90.jpg\n.SH ENVIRONMENT\n.TP\n.B JPEGMEM\nIf this environment variable is set, its value is the default memory limit.\nThe value is specified as described for the\n.B \\-maxmemory\nswitch.\n.B JPEGMEM\noverrides the default value specified when the program was compiled, and\nitself is overridden by an explicit\n.BR \\-maxmemory .\n.SH SEE ALSO\n.BR cjpeg (1),\n.BR djpeg (1),\n.BR rdjpgcom (1),\n.BR wrjpgcom (1)\n.br\nWallace, Gregory K.  \"The JPEG Still Picture Compression Standard\",\nCommunications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.\n.SH AUTHOR\nIndependent JPEG Group\n.PP\nThis file was modified by The libjpeg-turbo Project to include only information\nrelevant to libjpeg-turbo and to wordsmith certain sections.\n.SH BUGS\nThe transform options can't transform odd-size images perfectly.  Use\n.B \\-trim\nor\n.B \\-perfect\nif you don't like the results.\n.PP\nThe entire image is read into memory and then written out again, even in\ncases where this isn't really necessary.  Expect swapping on large images,\nespecially when using the more complex transform options.\n"
  },
  {
    "path": "ext/libjpeg-turbo/jpegtran.c",
    "content": "/*\n * jpegtran.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1995-2010, Thomas G. Lane, Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains a command-line user interface for JPEG transcoding.\n * It is very similar to cjpeg.c, and partly to djpeg.c, but provides\n * lossless transcoding between different JPEG file formats.  It also\n * provides some lossless and sort-of-lossless transformations of JPEG data.\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n#include \"transupp.h\"\t\t/* Support routines for jpegtran */\n#include \"jversion.h\"\t\t/* for version message */\n#include \"config.h\"\n\n#ifdef USE_CCOMMAND\t\t/* command-line reader for Macintosh */\n#ifdef __MWERKS__\n#include <SIOUX.h>              /* Metrowerks needs this */\n#include <console.h>\t\t/* ... and this */\n#endif\n#ifdef THINK_C\n#include <console.h>\t\t/* Think declares it here */\n#endif\n#endif\n\n\n/*\n * Argument-parsing code.\n * The switch parser is designed to be useful with DOS-style command line\n * syntax, ie, intermixed switches and file names, where only the switches\n * to the left of a given file name affect processing of that file.\n * The main program in this file doesn't actually use this capability...\n */\n\n\nstatic const char * progname;\t/* program name for error messages */\nstatic char * outfilename;\t/* for -outfile switch */\nstatic JCOPY_OPTION copyoption;\t/* -copy switch */\nstatic jpeg_transform_info transformoption; /* image transformation options */\n\n\nLOCAL(void)\nusage (void)\n/* complain about bad command line */\n{\n  fprintf(stderr, \"usage: %s [switches] \", progname);\n#ifdef TWO_FILE_COMMANDLINE\n  fprintf(stderr, \"inputfile outputfile\\n\");\n#else\n  fprintf(stderr, \"[inputfile]\\n\");\n#endif\n\n  fprintf(stderr, \"Switches (names may be abbreviated):\\n\");\n  fprintf(stderr, \"  -copy none     Copy no extra markers from source file\\n\");\n  fprintf(stderr, \"  -copy comments Copy only comment markers (default)\\n\");\n  fprintf(stderr, \"  -copy all      Copy all extra markers\\n\");\n#ifdef ENTROPY_OPT_SUPPORTED\n  fprintf(stderr, \"  -optimize      Optimize Huffman table (smaller file, but slow compression)\\n\");\n#endif\n#ifdef C_PROGRESSIVE_SUPPORTED\n  fprintf(stderr, \"  -progressive   Create progressive JPEG file\\n\");\n#endif\n  fprintf(stderr, \"Switches for modifying the image:\\n\");\n#if TRANSFORMS_SUPPORTED\n  fprintf(stderr, \"  -crop WxH+X+Y  Crop to a rectangular subarea\\n\");\n  fprintf(stderr, \"  -grayscale     Reduce to grayscale (omit color data)\\n\");\n  fprintf(stderr, \"  -flip [horizontal|vertical]  Mirror image (left-right or top-bottom)\\n\");\n  fprintf(stderr, \"  -perfect       Fail if there is non-transformable edge blocks\\n\");\n  fprintf(stderr, \"  -rotate [90|180|270]         Rotate image (degrees clockwise)\\n\");\n#endif\n#if TRANSFORMS_SUPPORTED\n  fprintf(stderr, \"  -transpose     Transpose image\\n\");\n  fprintf(stderr, \"  -transverse    Transverse transpose image\\n\");\n  fprintf(stderr, \"  -trim          Drop non-transformable edge blocks\\n\");\n#endif\n  fprintf(stderr, \"Switches for advanced users:\\n\");\n#ifdef C_ARITH_CODING_SUPPORTED\n  fprintf(stderr, \"  -arithmetic    Use arithmetic coding\\n\");\n#endif\n  fprintf(stderr, \"  -restart N     Set restart interval in rows, or in blocks with B\\n\");\n  fprintf(stderr, \"  -maxmemory N   Maximum memory to use (in kbytes)\\n\");\n  fprintf(stderr, \"  -outfile name  Specify name for output file\\n\");\n  fprintf(stderr, \"  -verbose  or  -debug   Emit debug output\\n\");\n  fprintf(stderr, \"Switches for wizards:\\n\");\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n  fprintf(stderr, \"  -scans file    Create multi-scan JPEG per script file\\n\");\n#endif\n  exit(EXIT_FAILURE);\n}\n\n\nLOCAL(void)\nselect_transform (JXFORM_CODE transform)\n/* Silly little routine to detect multiple transform options,\n * which we can't handle.\n */\n{\n#if TRANSFORMS_SUPPORTED\n  if (transformoption.transform == JXFORM_NONE ||\n      transformoption.transform == transform) {\n    transformoption.transform = transform;\n  } else {\n    fprintf(stderr, \"%s: can only do one image transformation at a time\\n\",\n\t    progname);\n    usage();\n  }\n#else\n  fprintf(stderr, \"%s: sorry, image transformation was not compiled\\n\",\n\t  progname);\n  exit(EXIT_FAILURE);\n#endif\n}\n\n\nLOCAL(int)\nparse_switches (j_compress_ptr cinfo, int argc, char **argv,\n\t\tint last_file_arg_seen, boolean for_real)\n/* Parse optional switches.\n * Returns argv[] index of first file-name argument (== argc if none).\n * Any file names with indexes <= last_file_arg_seen are ignored;\n * they have presumably been processed in a previous iteration.\n * (Pass 0 for last_file_arg_seen on the first or only iteration.)\n * for_real is FALSE on the first (dummy) pass; we may skip any expensive\n * processing.\n */\n{\n  int argn;\n  char * arg;\n  boolean simple_progressive;\n  char * scansarg = NULL;\t/* saves -scans parm if any */\n\n  /* Set up default JPEG parameters. */\n  simple_progressive = FALSE;\n  outfilename = NULL;\n  copyoption = JCOPYOPT_DEFAULT;\n  transformoption.transform = JXFORM_NONE;\n  transformoption.perfect = FALSE;\n  transformoption.trim = FALSE;\n  transformoption.force_grayscale = FALSE;\n  transformoption.crop = FALSE;\n  transformoption.slow_hflip = FALSE;\n  cinfo->err->trace_level = 0;\n\n  /* Scan command line options, adjust parameters */\n\n  for (argn = 1; argn < argc; argn++) {\n    arg = argv[argn];\n    if (*arg != '-') {\n      /* Not a switch, must be a file name argument */\n      if (argn <= last_file_arg_seen) {\n\toutfilename = NULL;\t/* -outfile applies to just one input file */\n\tcontinue;\t\t/* ignore this name if previously processed */\n      }\n      break;\t\t\t/* else done parsing switches */\n    }\n    arg++;\t\t\t/* advance past switch marker character */\n\n    if (keymatch(arg, \"arithmetic\", 1)) {\n      /* Use arithmetic coding. */\n#ifdef C_ARITH_CODING_SUPPORTED\n      cinfo->arith_code = TRUE;\n#else\n      fprintf(stderr, \"%s: sorry, arithmetic coding not supported\\n\",\n\t      progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"copy\", 2)) {\n      /* Select which extra markers to copy. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (keymatch(argv[argn], \"none\", 1)) {\n\tcopyoption = JCOPYOPT_NONE;\n      } else if (keymatch(argv[argn], \"comments\", 1)) {\n\tcopyoption = JCOPYOPT_COMMENTS;\n      } else if (keymatch(argv[argn], \"all\", 1)) {\n\tcopyoption = JCOPYOPT_ALL;\n      } else\n\tusage();\n\n    } else if (keymatch(arg, \"crop\", 2)) {\n      /* Perform lossless cropping. */\n#if TRANSFORMS_SUPPORTED\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (! jtransform_parse_crop_spec(&transformoption, argv[argn])) {\n\tfprintf(stderr, \"%s: bogus -crop argument '%s'\\n\",\n\t\tprogname, argv[argn]);\n\texit(EXIT_FAILURE);\n      }\n#else\n      select_transform(JXFORM_NONE);\t/* force an error */\n#endif\n\n    } else if (keymatch(arg, \"debug\", 1) || keymatch(arg, \"verbose\", 1)) {\n      /* Enable debug printouts. */\n      /* On first -d, print version identification */\n      static boolean printed_version = FALSE;\n\n      if (! printed_version) {\n\tfprintf(stderr, \"%s version %s (build %s)\\n\",\n\t\tPACKAGE_NAME, VERSION, BUILD);\n\tfprintf(stderr, \"%s\\n\\n\", JCOPYRIGHT);\n\tfprintf(stderr, \"Emulating The Independent JPEG Group's software, version %s\\n\\n\",\n\t\tJVERSION);\n\tprinted_version = TRUE;\n      }\n      cinfo->err->trace_level++;\n\n    } else if (keymatch(arg, \"flip\", 1)) {\n      /* Mirror left-right or top-bottom. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (keymatch(argv[argn], \"horizontal\", 1))\n\tselect_transform(JXFORM_FLIP_H);\n      else if (keymatch(argv[argn], \"vertical\", 1))\n\tselect_transform(JXFORM_FLIP_V);\n      else\n\tusage();\n\n    } else if (keymatch(arg, \"grayscale\", 1) || keymatch(arg, \"greyscale\",1)) {\n      /* Force to grayscale. */\n#if TRANSFORMS_SUPPORTED\n      transformoption.force_grayscale = TRUE;\n#else\n      select_transform(JXFORM_NONE);\t/* force an error */\n#endif\n\n    } else if (keymatch(arg, \"maxmemory\", 3)) {\n      /* Maximum memory in Kb (or Mb with 'm'). */\n      long lval;\n      char ch = 'x';\n\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (sscanf(argv[argn], \"%ld%c\", &lval, &ch) < 1)\n\tusage();\n      if (ch == 'm' || ch == 'M')\n\tlval *= 1000L;\n      cinfo->mem->max_memory_to_use = lval * 1000L;\n\n    } else if (keymatch(arg, \"optimize\", 1) || keymatch(arg, \"optimise\", 1)) {\n      /* Enable entropy parm optimization. */\n#ifdef ENTROPY_OPT_SUPPORTED\n      cinfo->optimize_coding = TRUE;\n#else\n      fprintf(stderr, \"%s: sorry, entropy optimization was not compiled\\n\",\n\t      progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"outfile\", 4)) {\n      /* Set output file name. */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      outfilename = argv[argn];\t/* save it away for later use */\n\n    } else if (keymatch(arg, \"perfect\", 2)) {\n      /* Fail if there is any partial edge MCUs that the transform can't\n       * handle. */\n      transformoption.perfect = TRUE;\n\n    } else if (keymatch(arg, \"progressive\", 2)) {\n      /* Select simple progressive mode. */\n#ifdef C_PROGRESSIVE_SUPPORTED\n      simple_progressive = TRUE;\n      /* We must postpone execution until num_components is known. */\n#else\n      fprintf(stderr, \"%s: sorry, progressive output was not compiled\\n\",\n\t      progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"restart\", 1)) {\n      /* Restart interval in MCU rows (or in MCUs with 'b'). */\n      long lval;\n      char ch = 'x';\n\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (sscanf(argv[argn], \"%ld%c\", &lval, &ch) < 1)\n\tusage();\n      if (lval < 0 || lval > 65535L)\n\tusage();\n      if (ch == 'b' || ch == 'B') {\n\tcinfo->restart_interval = (unsigned int) lval;\n\tcinfo->restart_in_rows = 0; /* else prior '-restart n' overrides me */\n      } else {\n\tcinfo->restart_in_rows = (int) lval;\n\t/* restart_interval will be computed during startup */\n      }\n\n    } else if (keymatch(arg, \"rotate\", 2)) {\n      /* Rotate 90, 180, or 270 degrees (measured clockwise). */\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      if (keymatch(argv[argn], \"90\", 2))\n\tselect_transform(JXFORM_ROT_90);\n      else if (keymatch(argv[argn], \"180\", 3))\n\tselect_transform(JXFORM_ROT_180);\n      else if (keymatch(argv[argn], \"270\", 3))\n\tselect_transform(JXFORM_ROT_270);\n      else\n\tusage();\n\n    } else if (keymatch(arg, \"scans\", 1)) {\n      /* Set scan script. */\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n      if (++argn >= argc)\t/* advance to next argument */\n\tusage();\n      scansarg = argv[argn];\n      /* We must postpone reading the file in case -progressive appears. */\n#else\n      fprintf(stderr, \"%s: sorry, multi-scan output was not compiled\\n\",\n\t      progname);\n      exit(EXIT_FAILURE);\n#endif\n\n    } else if (keymatch(arg, \"transpose\", 1)) {\n      /* Transpose (across UL-to-LR axis). */\n      select_transform(JXFORM_TRANSPOSE);\n\n    } else if (keymatch(arg, \"transverse\", 6)) {\n      /* Transverse transpose (across UR-to-LL axis). */\n      select_transform(JXFORM_TRANSVERSE);\n\n    } else if (keymatch(arg, \"trim\", 3)) {\n      /* Trim off any partial edge MCUs that the transform can't handle. */\n      transformoption.trim = TRUE;\n\n    } else {\n      usage();\t\t\t/* bogus switch */\n    }\n  }\n\n  /* Post-switch-scanning cleanup */\n\n  if (for_real) {\n\n#ifdef C_PROGRESSIVE_SUPPORTED\n    if (simple_progressive)\t/* process -progressive; -scans can override */\n      jpeg_simple_progression(cinfo);\n#endif\n\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n    if (scansarg != NULL)\t/* process -scans if it was present */\n      if (! read_scan_script(cinfo, scansarg))\n\tusage();\n#endif\n  }\n\n  return argn;\t\t\t/* return index of next arg (file name) */\n}\n\n\n/*\n * The main program.\n */\n\nint\nmain (int argc, char **argv)\n{\n  struct jpeg_decompress_struct srcinfo;\n  struct jpeg_compress_struct dstinfo;\n  struct jpeg_error_mgr jsrcerr, jdsterr;\n#ifdef PROGRESS_REPORT\n  struct cdjpeg_progress_mgr progress;\n#endif\n  jvirt_barray_ptr * src_coef_arrays;\n  jvirt_barray_ptr * dst_coef_arrays;\n  int file_index;\n  /* We assume all-in-memory processing and can therefore use only a\n   * single file pointer for sequential input and output operation. \n   */\n  FILE * fp;\n\n  /* On Mac, fetch a command line. */\n#ifdef USE_CCOMMAND\n  argc = ccommand(&argv);\n#endif\n\n  progname = argv[0];\n  if (progname == NULL || progname[0] == 0)\n    progname = \"jpegtran\";\t/* in case C library doesn't provide it */\n\n  /* Initialize the JPEG decompression object with default error handling. */\n  srcinfo.err = jpeg_std_error(&jsrcerr);\n  jpeg_create_decompress(&srcinfo);\n  /* Initialize the JPEG compression object with default error handling. */\n  dstinfo.err = jpeg_std_error(&jdsterr);\n  jpeg_create_compress(&dstinfo);\n\n  /* Now safe to enable signal catcher.\n   * Note: we assume only the decompression object will have virtual arrays.\n   */\n#ifdef NEED_SIGNAL_CATCHER\n  enable_signal_catcher((j_common_ptr) &srcinfo);\n#endif\n\n  /* Scan command line to find file names.\n   * It is convenient to use just one switch-parsing routine, but the switch\n   * values read here are mostly ignored; we will rescan the switches after\n   * opening the input file.  Also note that most of the switches affect the\n   * destination JPEG object, so we parse into that and then copy over what\n   * needs to affects the source too.\n   */\n\n  file_index = parse_switches(&dstinfo, argc, argv, 0, FALSE);\n  jsrcerr.trace_level = jdsterr.trace_level;\n  srcinfo.mem->max_memory_to_use = dstinfo.mem->max_memory_to_use;\n\n#ifdef TWO_FILE_COMMANDLINE\n  /* Must have either -outfile switch or explicit output file name */\n  if (outfilename == NULL) {\n    if (file_index != argc-2) {\n      fprintf(stderr, \"%s: must name one input and one output file\\n\",\n\t      progname);\n      usage();\n    }\n    outfilename = argv[file_index+1];\n  } else {\n    if (file_index != argc-1) {\n      fprintf(stderr, \"%s: must name one input and one output file\\n\",\n\t      progname);\n      usage();\n    }\n  }\n#else\n  /* Unix style: expect zero or one file name */\n  if (file_index < argc-1) {\n    fprintf(stderr, \"%s: only one input file\\n\", progname);\n    usage();\n  }\n#endif /* TWO_FILE_COMMANDLINE */\n\n  /* Open the input file. */\n  if (file_index < argc) {\n    if ((fp = fopen(argv[file_index], READ_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s for reading\\n\", progname, argv[file_index]);\n      exit(EXIT_FAILURE);\n    }\n  } else {\n    /* default input file is stdin */\n    fp = read_stdin();\n  }\n\n#ifdef PROGRESS_REPORT\n  start_progress_monitor((j_common_ptr) &dstinfo, &progress);\n#endif\n\n  /* Specify data source for decompression */\n  jpeg_stdio_src(&srcinfo, fp);\n\n  /* Enable saving of extra markers that we want to copy */\n  jcopy_markers_setup(&srcinfo, copyoption);\n\n  /* Read file header */\n  (void) jpeg_read_header(&srcinfo, TRUE);\n\n  /* Any space needed by a transform option must be requested before\n   * jpeg_read_coefficients so that memory allocation will be done right.\n   */\n#if TRANSFORMS_SUPPORTED\n  /* Fail right away if -perfect is given and transformation is not perfect.\n   */\n  if (!jtransform_request_workspace(&srcinfo, &transformoption)) {\n    fprintf(stderr, \"%s: transformation is not perfect\\n\", progname);\n    exit(EXIT_FAILURE);\n  }\n#endif\n\n  /* Read source file as DCT coefficients */\n  src_coef_arrays = jpeg_read_coefficients(&srcinfo);\n\n  /* Initialize destination compression parameters from source values */\n  jpeg_copy_critical_parameters(&srcinfo, &dstinfo);\n\n  /* Adjust destination parameters if required by transform options;\n   * also find out which set of coefficient arrays will hold the output.\n   */\n#if TRANSFORMS_SUPPORTED\n  dst_coef_arrays = jtransform_adjust_parameters(&srcinfo, &dstinfo,\n\t\t\t\t\t\t src_coef_arrays,\n\t\t\t\t\t\t &transformoption);\n#else\n  dst_coef_arrays = src_coef_arrays;\n#endif\n\n  /* Close input file, if we opened it.\n   * Note: we assume that jpeg_read_coefficients consumed all input\n   * until JPEG_REACHED_EOI, and that jpeg_finish_decompress will\n   * only consume more while (! cinfo->inputctl->eoi_reached).\n   * We cannot call jpeg_finish_decompress here since we still need the\n   * virtual arrays allocated from the source object for processing.\n   */\n  if (fp != stdin)\n    fclose(fp);\n\n  /* Open the output file. */\n  if (outfilename != NULL) {\n    if ((fp = fopen(outfilename, WRITE_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s for writing\\n\", progname, outfilename);\n      exit(EXIT_FAILURE);\n    }\n  } else {\n    /* default output file is stdout */\n    fp = write_stdout();\n  }\n\n  /* Adjust default compression parameters by re-parsing the options */\n  file_index = parse_switches(&dstinfo, argc, argv, 0, TRUE);\n\n  /* Specify data destination for compression */\n  jpeg_stdio_dest(&dstinfo, fp);\n\n  /* Start compressor (note no image data is actually written here) */\n  jpeg_write_coefficients(&dstinfo, dst_coef_arrays);\n\n  /* Copy to the output file any extra markers that we want to preserve */\n  jcopy_markers_execute(&srcinfo, &dstinfo, copyoption);\n\n  /* Execute image transformation, if any */\n#if TRANSFORMS_SUPPORTED\n  jtransform_execute_transformation(&srcinfo, &dstinfo,\n\t\t\t\t    src_coef_arrays,\n\t\t\t\t    &transformoption);\n#endif\n\n  /* Finish compression and release memory */\n  jpeg_finish_compress(&dstinfo);\n  jpeg_destroy_compress(&dstinfo);\n  (void) jpeg_finish_decompress(&srcinfo);\n  jpeg_destroy_decompress(&srcinfo);\n\n  /* Close output file, if we opened it */\n  if (fp != stdout)\n    fclose(fp);\n\n#ifdef PROGRESS_REPORT\n  end_progress_monitor((j_common_ptr) &dstinfo);\n#endif\n\n  /* All done. */\n  exit(jsrcerr.num_warnings + jdsterr.num_warnings ?EXIT_WARNING:EXIT_SUCCESS);\n  return 0;\t\t\t/* suppress no-return-value warnings */\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jquant1.c",
    "content": "/*\n * jquant1.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2009, D. R. Commander\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains 1-pass color quantization (color mapping) routines.\n * These routines provide mapping to a fixed color map using equally spaced\n * color values.  Optional Floyd-Steinberg or ordered dithering is available.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n#ifdef QUANT_1PASS_SUPPORTED\n\n\n/*\n * The main purpose of 1-pass quantization is to provide a fast, if not very\n * high quality, colormapped output capability.  A 2-pass quantizer usually\n * gives better visual quality; however, for quantized grayscale output this\n * quantizer is perfectly adequate.  Dithering is highly recommended with this\n * quantizer, though you can turn it off if you really want to.\n *\n * In 1-pass quantization the colormap must be chosen in advance of seeing the\n * image.  We use a map consisting of all combinations of Ncolors[i] color\n * values for the i'th component.  The Ncolors[] values are chosen so that\n * their product, the total number of colors, is no more than that requested.\n * (In most cases, the product will be somewhat less.)\n *\n * Since the colormap is orthogonal, the representative value for each color\n * component can be determined without considering the other components;\n * then these indexes can be combined into a colormap index by a standard\n * N-dimensional-array-subscript calculation.  Most of the arithmetic involved\n * can be precalculated and stored in the lookup table colorindex[].\n * colorindex[i][j] maps pixel value j in component i to the nearest\n * representative value (grid plane) for that component; this index is\n * multiplied by the array stride for component i, so that the\n * index of the colormap entry closest to a given pixel value is just\n *    sum( colorindex[component-number][pixel-component-value] )\n * Aside from being fast, this scheme allows for variable spacing between\n * representative values with no additional lookup cost.\n *\n * If gamma correction has been applied in color conversion, it might be wise\n * to adjust the color grid spacing so that the representative colors are\n * equidistant in linear space.  At this writing, gamma correction is not\n * implemented by jdcolor, so nothing is done here.\n */\n\n\n/* Declarations for ordered dithering.\n *\n * We use a standard 16x16 ordered dither array.  The basic concept of ordered\n * dithering is described in many references, for instance Dale Schumacher's\n * chapter II.2 of Graphics Gems II (James Arvo, ed. Academic Press, 1991).\n * In place of Schumacher's comparisons against a \"threshold\" value, we add a\n * \"dither\" value to the input pixel and then round the result to the nearest\n * output value.  The dither value is equivalent to (0.5 - threshold) times\n * the distance between output values.  For ordered dithering, we assume that\n * the output colors are equally spaced; if not, results will probably be\n * worse, since the dither may be too much or too little at a given point.\n *\n * The normal calculation would be to form pixel value + dither, range-limit\n * this to 0..MAXJSAMPLE, and then index into the colorindex table as usual.\n * We can skip the separate range-limiting step by extending the colorindex\n * table in both directions.\n */\n\n#define ODITHER_SIZE  16\t/* dimension of dither matrix */\n/* NB: if ODITHER_SIZE is not a power of 2, ODITHER_MASK uses will break */\n#define ODITHER_CELLS (ODITHER_SIZE*ODITHER_SIZE)\t/* # cells in matrix */\n#define ODITHER_MASK  (ODITHER_SIZE-1) /* mask for wrapping around counters */\n\ntypedef int ODITHER_MATRIX[ODITHER_SIZE][ODITHER_SIZE];\ntypedef int (*ODITHER_MATRIX_PTR)[ODITHER_SIZE];\n\nstatic const UINT8 base_dither_matrix[ODITHER_SIZE][ODITHER_SIZE] = {\n  /* Bayer's order-4 dither array.  Generated by the code given in\n   * Stephen Hawley's article \"Ordered Dithering\" in Graphics Gems I.\n   * The values in this array must range from 0 to ODITHER_CELLS-1.\n   */\n  {   0,192, 48,240, 12,204, 60,252,  3,195, 51,243, 15,207, 63,255 },\n  { 128, 64,176,112,140, 76,188,124,131, 67,179,115,143, 79,191,127 },\n  {  32,224, 16,208, 44,236, 28,220, 35,227, 19,211, 47,239, 31,223 },\n  { 160, 96,144, 80,172,108,156, 92,163, 99,147, 83,175,111,159, 95 },\n  {   8,200, 56,248,  4,196, 52,244, 11,203, 59,251,  7,199, 55,247 },\n  { 136, 72,184,120,132, 68,180,116,139, 75,187,123,135, 71,183,119 },\n  {  40,232, 24,216, 36,228, 20,212, 43,235, 27,219, 39,231, 23,215 },\n  { 168,104,152, 88,164,100,148, 84,171,107,155, 91,167,103,151, 87 },\n  {   2,194, 50,242, 14,206, 62,254,  1,193, 49,241, 13,205, 61,253 },\n  { 130, 66,178,114,142, 78,190,126,129, 65,177,113,141, 77,189,125 },\n  {  34,226, 18,210, 46,238, 30,222, 33,225, 17,209, 45,237, 29,221 },\n  { 162, 98,146, 82,174,110,158, 94,161, 97,145, 81,173,109,157, 93 },\n  {  10,202, 58,250,  6,198, 54,246,  9,201, 57,249,  5,197, 53,245 },\n  { 138, 74,186,122,134, 70,182,118,137, 73,185,121,133, 69,181,117 },\n  {  42,234, 26,218, 38,230, 22,214, 41,233, 25,217, 37,229, 21,213 },\n  { 170,106,154, 90,166,102,150, 86,169,105,153, 89,165,101,149, 85 }\n};\n\n\n/* Declarations for Floyd-Steinberg dithering.\n *\n * Errors are accumulated into the array fserrors[], at a resolution of\n * 1/16th of a pixel count.  The error at a given pixel is propagated\n * to its not-yet-processed neighbors using the standard F-S fractions,\n *\t\t...\t(here)\t7/16\n *\t\t3/16\t5/16\t1/16\n * We work left-to-right on even rows, right-to-left on odd rows.\n *\n * We can get away with a single array (holding one row's worth of errors)\n * by using it to store the current row's errors at pixel columns not yet\n * processed, but the next row's errors at columns already processed.  We\n * need only a few extra variables to hold the errors immediately around the\n * current column.  (If we are lucky, those variables are in registers, but\n * even if not, they're probably cheaper to access than array elements are.)\n *\n * The fserrors[] array is indexed [component#][position].\n * We provide (#columns + 2) entries per component; the extra entry at each\n * end saves us from special-casing the first and last pixels.\n *\n * Note: on a wide image, we might not have enough room in a PC's near data\n * segment to hold the error array; so it is allocated with alloc_large.\n */\n\n#if BITS_IN_JSAMPLE == 8\ntypedef INT16 FSERROR;\t\t/* 16 bits should be enough */\ntypedef int LOCFSERROR;\t\t/* use 'int' for calculation temps */\n#else\ntypedef INT32 FSERROR;\t\t/* may need more than 16 bits */\ntypedef INT32 LOCFSERROR;\t/* be sure calculation temps are big enough */\n#endif\n\ntypedef FSERROR FAR *FSERRPTR;\t/* pointer to error array (in FAR storage!) */\n\n\n/* Private subobject */\n\n#define MAX_Q_COMPS 4\t\t/* max components I can handle */\n\ntypedef struct {\n  struct jpeg_color_quantizer pub; /* public fields */\n\n  /* Initially allocated colormap is saved here */\n  JSAMPARRAY sv_colormap;\t/* The color map as a 2-D pixel array */\n  int sv_actual;\t\t/* number of entries in use */\n\n  JSAMPARRAY colorindex;\t/* Precomputed mapping for speed */\n  /* colorindex[i][j] = index of color closest to pixel value j in component i,\n   * premultiplied as described above.  Since colormap indexes must fit into\n   * JSAMPLEs, the entries of this array will too.\n   */\n  boolean is_padded;\t\t/* is the colorindex padded for odither? */\n\n  int Ncolors[MAX_Q_COMPS];\t/* # of values alloced to each component */\n\n  /* Variables for ordered dithering */\n  int row_index;\t\t/* cur row's vertical index in dither matrix */\n  ODITHER_MATRIX_PTR odither[MAX_Q_COMPS]; /* one dither array per component */\n\n  /* Variables for Floyd-Steinberg dithering */\n  FSERRPTR fserrors[MAX_Q_COMPS]; /* accumulated errors */\n  boolean on_odd_row;\t\t/* flag to remember which row we are on */\n} my_cquantizer;\n\ntypedef my_cquantizer * my_cquantize_ptr;\n\n\n/*\n * Policy-making subroutines for create_colormap and create_colorindex.\n * These routines determine the colormap to be used.  The rest of the module\n * only assumes that the colormap is orthogonal.\n *\n *  * select_ncolors decides how to divvy up the available colors\n *    among the components.\n *  * output_value defines the set of representative values for a component.\n *  * largest_input_value defines the mapping from input values to\n *    representative values for a component.\n * Note that the latter two routines may impose different policies for\n * different components, though this is not currently done.\n */\n\n\nLOCAL(int)\nselect_ncolors (j_decompress_ptr cinfo, int Ncolors[])\n/* Determine allocation of desired colors to components, */\n/* and fill in Ncolors[] array to indicate choice. */\n/* Return value is total number of colors (product of Ncolors[] values). */\n{\n  int nc = cinfo->out_color_components; /* number of color components */\n  int max_colors = cinfo->desired_number_of_colors;\n  int total_colors, iroot, i, j;\n  boolean changed;\n  long temp;\n  int RGB_order[3] = { RGB_GREEN, RGB_RED, RGB_BLUE };\n  RGB_order[0] = rgb_green[cinfo->out_color_space];\n  RGB_order[1] = rgb_red[cinfo->out_color_space];\n  RGB_order[2] = rgb_blue[cinfo->out_color_space];\n\n  /* We can allocate at least the nc'th root of max_colors per component. */\n  /* Compute floor(nc'th root of max_colors). */\n  iroot = 1;\n  do {\n    iroot++;\n    temp = iroot;\t\t/* set temp = iroot ** nc */\n    for (i = 1; i < nc; i++)\n      temp *= iroot;\n  } while (temp <= (long) max_colors); /* repeat till iroot exceeds root */\n  iroot--;\t\t\t/* now iroot = floor(root) */\n\n  /* Must have at least 2 color values per component */\n  if (iroot < 2)\n    ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, (int) temp);\n\n  /* Initialize to iroot color values for each component */\n  total_colors = 1;\n  for (i = 0; i < nc; i++) {\n    Ncolors[i] = iroot;\n    total_colors *= iroot;\n  }\n  /* We may be able to increment the count for one or more components without\n   * exceeding max_colors, though we know not all can be incremented.\n   * Sometimes, the first component can be incremented more than once!\n   * (Example: for 16 colors, we start at 2*2*2, go to 3*2*2, then 4*2*2.)\n   * In RGB colorspace, try to increment G first, then R, then B.\n   */\n  do {\n    changed = FALSE;\n    for (i = 0; i < nc; i++) {\n      j = (cinfo->out_color_space == JCS_RGB ? RGB_order[i] : i);\n      /* calculate new total_colors if Ncolors[j] is incremented */\n      temp = total_colors / Ncolors[j];\n      temp *= Ncolors[j]+1;\t/* done in long arith to avoid oflo */\n      if (temp > (long) max_colors)\n\tbreak;\t\t\t/* won't fit, done with this pass */\n      Ncolors[j]++;\t\t/* OK, apply the increment */\n      total_colors = (int) temp;\n      changed = TRUE;\n    }\n  } while (changed);\n\n  return total_colors;\n}\n\n\nLOCAL(int)\noutput_value (j_decompress_ptr cinfo, int ci, int j, int maxj)\n/* Return j'th output value, where j will range from 0 to maxj */\n/* The output values must fall in 0..MAXJSAMPLE in increasing order */\n{\n  /* We always provide values 0 and MAXJSAMPLE for each component;\n   * any additional values are equally spaced between these limits.\n   * (Forcing the upper and lower values to the limits ensures that\n   * dithering can't produce a color outside the selected gamut.)\n   */\n  return (int) (((INT32) j * MAXJSAMPLE + maxj/2) / maxj);\n}\n\n\nLOCAL(int)\nlargest_input_value (j_decompress_ptr cinfo, int ci, int j, int maxj)\n/* Return largest input value that should map to j'th output value */\n/* Must have largest(j=0) >= 0, and largest(j=maxj) >= MAXJSAMPLE */\n{\n  /* Breakpoints are halfway between values returned by output_value */\n  return (int) (((INT32) (2*j + 1) * MAXJSAMPLE + maxj) / (2*maxj));\n}\n\n\n/*\n * Create the colormap.\n */\n\nLOCAL(void)\ncreate_colormap (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  JSAMPARRAY colormap;\t\t/* Created colormap */\n  int total_colors;\t\t/* Number of distinct output colors */\n  int i,j,k, nci, blksize, blkdist, ptr, val;\n\n  /* Select number of colors for each component */\n  total_colors = select_ncolors(cinfo, cquantize->Ncolors);\n\n  /* Report selected color counts */\n  if (cinfo->out_color_components == 3)\n    TRACEMS4(cinfo, 1, JTRC_QUANT_3_NCOLORS,\n\t     total_colors, cquantize->Ncolors[0],\n\t     cquantize->Ncolors[1], cquantize->Ncolors[2]);\n  else\n    TRACEMS1(cinfo, 1, JTRC_QUANT_NCOLORS, total_colors);\n\n  /* Allocate and fill in the colormap. */\n  /* The colors are ordered in the map in standard row-major order, */\n  /* i.e. rightmost (highest-indexed) color changes most rapidly. */\n\n  colormap = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE,\n     (JDIMENSION) total_colors, (JDIMENSION) cinfo->out_color_components);\n\n  /* blksize is number of adjacent repeated entries for a component */\n  /* blkdist is distance between groups of identical entries for a component */\n  blkdist = total_colors;\n\n  for (i = 0; i < cinfo->out_color_components; i++) {\n    /* fill in colormap entries for i'th color component */\n    nci = cquantize->Ncolors[i]; /* # of distinct values for this color */\n    blksize = blkdist / nci;\n    for (j = 0; j < nci; j++) {\n      /* Compute j'th output value (out of nci) for component */\n      val = output_value(cinfo, i, j, nci-1);\n      /* Fill in all colormap entries that have this value of this component */\n      for (ptr = j * blksize; ptr < total_colors; ptr += blkdist) {\n\t/* fill in blksize entries beginning at ptr */\n\tfor (k = 0; k < blksize; k++)\n\t  colormap[i][ptr+k] = (JSAMPLE) val;\n      }\n    }\n    blkdist = blksize;\t\t/* blksize of this color is blkdist of next */\n  }\n\n  /* Save the colormap in private storage,\n   * where it will survive color quantization mode changes.\n   */\n  cquantize->sv_colormap = colormap;\n  cquantize->sv_actual = total_colors;\n}\n\n\n/*\n * Create the color index table.\n */\n\nLOCAL(void)\ncreate_colorindex (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  JSAMPROW indexptr;\n  int i,j,k, nci, blksize, val, pad;\n\n  /* For ordered dither, we pad the color index tables by MAXJSAMPLE in\n   * each direction (input index values can be -MAXJSAMPLE .. 2*MAXJSAMPLE).\n   * This is not necessary in the other dithering modes.  However, we\n   * flag whether it was done in case user changes dithering mode.\n   */\n  if (cinfo->dither_mode == JDITHER_ORDERED) {\n    pad = MAXJSAMPLE*2;\n    cquantize->is_padded = TRUE;\n  } else {\n    pad = 0;\n    cquantize->is_padded = FALSE;\n  }\n\n  cquantize->colorindex = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE,\n     (JDIMENSION) (MAXJSAMPLE+1 + pad),\n     (JDIMENSION) cinfo->out_color_components);\n\n  /* blksize is number of adjacent repeated entries for a component */\n  blksize = cquantize->sv_actual;\n\n  for (i = 0; i < cinfo->out_color_components; i++) {\n    /* fill in colorindex entries for i'th color component */\n    nci = cquantize->Ncolors[i]; /* # of distinct values for this color */\n    blksize = blksize / nci;\n\n    /* adjust colorindex pointers to provide padding at negative indexes. */\n    if (pad)\n      cquantize->colorindex[i] += MAXJSAMPLE;\n\n    /* in loop, val = index of current output value, */\n    /* and k = largest j that maps to current val */\n    indexptr = cquantize->colorindex[i];\n    val = 0;\n    k = largest_input_value(cinfo, i, 0, nci-1);\n    for (j = 0; j <= MAXJSAMPLE; j++) {\n      while (j > k)\t\t/* advance val if past boundary */\n\tk = largest_input_value(cinfo, i, ++val, nci-1);\n      /* premultiply so that no multiplication needed in main processing */\n      indexptr[j] = (JSAMPLE) (val * blksize);\n    }\n    /* Pad at both ends if necessary */\n    if (pad)\n      for (j = 1; j <= MAXJSAMPLE; j++) {\n\tindexptr[-j] = indexptr[0];\n\tindexptr[MAXJSAMPLE+j] = indexptr[MAXJSAMPLE];\n      }\n  }\n}\n\n\n/*\n * Create an ordered-dither array for a component having ncolors\n * distinct output values.\n */\n\nLOCAL(ODITHER_MATRIX_PTR)\nmake_odither_array (j_decompress_ptr cinfo, int ncolors)\n{\n  ODITHER_MATRIX_PTR odither;\n  int j,k;\n  INT32 num,den;\n\n  odither = (ODITHER_MATRIX_PTR)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(ODITHER_MATRIX));\n  /* The inter-value distance for this color is MAXJSAMPLE/(ncolors-1).\n   * Hence the dither value for the matrix cell with fill order f\n   * (f=0..N-1) should be (N-1-2*f)/(2*N) * MAXJSAMPLE/(ncolors-1).\n   * On 16-bit-int machine, be careful to avoid overflow.\n   */\n  den = 2 * ODITHER_CELLS * ((INT32) (ncolors - 1));\n  for (j = 0; j < ODITHER_SIZE; j++) {\n    for (k = 0; k < ODITHER_SIZE; k++) {\n      num = ((INT32) (ODITHER_CELLS-1 - 2*((int)base_dither_matrix[j][k])))\n\t    * MAXJSAMPLE;\n      /* Ensure round towards zero despite C's lack of consistency\n       * about rounding negative values in integer division...\n       */\n      odither[j][k] = (int) (num<0 ? -((-num)/den) : num/den);\n    }\n  }\n  return odither;\n}\n\n\n/*\n * Create the ordered-dither tables.\n * Components having the same number of representative colors may \n * share a dither table.\n */\n\nLOCAL(void)\ncreate_odither_tables (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  ODITHER_MATRIX_PTR odither;\n  int i, j, nci;\n\n  for (i = 0; i < cinfo->out_color_components; i++) {\n    nci = cquantize->Ncolors[i]; /* # of distinct values for this color */\n    odither = NULL;\t\t/* search for matching prior component */\n    for (j = 0; j < i; j++) {\n      if (nci == cquantize->Ncolors[j]) {\n\todither = cquantize->odither[j];\n\tbreak;\n      }\n    }\n    if (odither == NULL)\t/* need a new table? */\n      odither = make_odither_array(cinfo, nci);\n    cquantize->odither[i] = odither;\n  }\n}\n\n\n/*\n * Map some rows of pixels to the output colormapped representation.\n */\n\nMETHODDEF(void)\ncolor_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,\n\t\tJSAMPARRAY output_buf, int num_rows)\n/* General case, no dithering */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  JSAMPARRAY colorindex = cquantize->colorindex;\n  register int pixcode, ci;\n  register JSAMPROW ptrin, ptrout;\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n  register int nc = cinfo->out_color_components;\n\n  for (row = 0; row < num_rows; row++) {\n    ptrin = input_buf[row];\n    ptrout = output_buf[row];\n    for (col = width; col > 0; col--) {\n      pixcode = 0;\n      for (ci = 0; ci < nc; ci++) {\n\tpixcode += GETJSAMPLE(colorindex[ci][GETJSAMPLE(*ptrin++)]);\n      }\n      *ptrout++ = (JSAMPLE) pixcode;\n    }\n  }\n}\n\n\nMETHODDEF(void)\ncolor_quantize3 (j_decompress_ptr cinfo, JSAMPARRAY input_buf,\n\t\t JSAMPARRAY output_buf, int num_rows)\n/* Fast path for out_color_components==3, no dithering */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  register int pixcode;\n  register JSAMPROW ptrin, ptrout;\n  JSAMPROW colorindex0 = cquantize->colorindex[0];\n  JSAMPROW colorindex1 = cquantize->colorindex[1];\n  JSAMPROW colorindex2 = cquantize->colorindex[2];\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n\n  for (row = 0; row < num_rows; row++) {\n    ptrin = input_buf[row];\n    ptrout = output_buf[row];\n    for (col = width; col > 0; col--) {\n      pixcode  = GETJSAMPLE(colorindex0[GETJSAMPLE(*ptrin++)]);\n      pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*ptrin++)]);\n      pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*ptrin++)]);\n      *ptrout++ = (JSAMPLE) pixcode;\n    }\n  }\n}\n\n\nMETHODDEF(void)\nquantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,\n\t\t     JSAMPARRAY output_buf, int num_rows)\n/* General case, with ordered dithering */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  register JSAMPROW input_ptr;\n  register JSAMPROW output_ptr;\n  JSAMPROW colorindex_ci;\n  int * dither;\t\t\t/* points to active row of dither matrix */\n  int row_index, col_index;\t/* current indexes into dither matrix */\n  int nc = cinfo->out_color_components;\n  int ci;\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n\n  for (row = 0; row < num_rows; row++) {\n    /* Initialize output values to 0 so can process components separately */\n    jzero_far((void FAR *) output_buf[row],\n\t      (size_t) (width * SIZEOF(JSAMPLE)));\n    row_index = cquantize->row_index;\n    for (ci = 0; ci < nc; ci++) {\n      input_ptr = input_buf[row] + ci;\n      output_ptr = output_buf[row];\n      colorindex_ci = cquantize->colorindex[ci];\n      dither = cquantize->odither[ci][row_index];\n      col_index = 0;\n\n      for (col = width; col > 0; col--) {\n\t/* Form pixel value + dither, range-limit to 0..MAXJSAMPLE,\n\t * select output value, accumulate into output code for this pixel.\n\t * Range-limiting need not be done explicitly, as we have extended\n\t * the colorindex table to produce the right answers for out-of-range\n\t * inputs.  The maximum dither is +- MAXJSAMPLE; this sets the\n\t * required amount of padding.\n\t */\n\t*output_ptr += colorindex_ci[GETJSAMPLE(*input_ptr)+dither[col_index]];\n\tinput_ptr += nc;\n\toutput_ptr++;\n\tcol_index = (col_index + 1) & ODITHER_MASK;\n      }\n    }\n    /* Advance row index for next row */\n    row_index = (row_index + 1) & ODITHER_MASK;\n    cquantize->row_index = row_index;\n  }\n}\n\n\nMETHODDEF(void)\nquantize3_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,\n\t\t      JSAMPARRAY output_buf, int num_rows)\n/* Fast path for out_color_components==3, with ordered dithering */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  register int pixcode;\n  register JSAMPROW input_ptr;\n  register JSAMPROW output_ptr;\n  JSAMPROW colorindex0 = cquantize->colorindex[0];\n  JSAMPROW colorindex1 = cquantize->colorindex[1];\n  JSAMPROW colorindex2 = cquantize->colorindex[2];\n  int * dither0;\t\t/* points to active row of dither matrix */\n  int * dither1;\n  int * dither2;\n  int row_index, col_index;\t/* current indexes into dither matrix */\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n\n  for (row = 0; row < num_rows; row++) {\n    row_index = cquantize->row_index;\n    input_ptr = input_buf[row];\n    output_ptr = output_buf[row];\n    dither0 = cquantize->odither[0][row_index];\n    dither1 = cquantize->odither[1][row_index];\n    dither2 = cquantize->odither[2][row_index];\n    col_index = 0;\n\n    for (col = width; col > 0; col--) {\n      pixcode  = GETJSAMPLE(colorindex0[GETJSAMPLE(*input_ptr++) +\n\t\t\t\t\tdither0[col_index]]);\n      pixcode += GETJSAMPLE(colorindex1[GETJSAMPLE(*input_ptr++) +\n\t\t\t\t\tdither1[col_index]]);\n      pixcode += GETJSAMPLE(colorindex2[GETJSAMPLE(*input_ptr++) +\n\t\t\t\t\tdither2[col_index]]);\n      *output_ptr++ = (JSAMPLE) pixcode;\n      col_index = (col_index + 1) & ODITHER_MASK;\n    }\n    row_index = (row_index + 1) & ODITHER_MASK;\n    cquantize->row_index = row_index;\n  }\n}\n\n\nMETHODDEF(void)\nquantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,\n\t\t    JSAMPARRAY output_buf, int num_rows)\n/* General case, with Floyd-Steinberg dithering */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  register LOCFSERROR cur;\t/* current error or pixel value */\n  LOCFSERROR belowerr;\t\t/* error for pixel below cur */\n  LOCFSERROR bpreverr;\t\t/* error for below/prev col */\n  LOCFSERROR bnexterr;\t\t/* error for below/next col */\n  LOCFSERROR delta;\n  register FSERRPTR errorptr;\t/* => fserrors[] at column before current */\n  register JSAMPROW input_ptr;\n  register JSAMPROW output_ptr;\n  JSAMPROW colorindex_ci;\n  JSAMPROW colormap_ci;\n  int pixcode;\n  int nc = cinfo->out_color_components;\n  int dir;\t\t\t/* 1 for left-to-right, -1 for right-to-left */\n  int dirnc;\t\t\t/* dir * nc */\n  int ci;\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n  JSAMPLE *range_limit = cinfo->sample_range_limit;\n  SHIFT_TEMPS\n\n  for (row = 0; row < num_rows; row++) {\n    /* Initialize output values to 0 so can process components separately */\n    jzero_far((void FAR *) output_buf[row],\n\t      (size_t) (width * SIZEOF(JSAMPLE)));\n    for (ci = 0; ci < nc; ci++) {\n      input_ptr = input_buf[row] + ci;\n      output_ptr = output_buf[row];\n      if (cquantize->on_odd_row) {\n\t/* work right to left in this row */\n\tinput_ptr += (width-1) * nc; /* so point to rightmost pixel */\n\toutput_ptr += width-1;\n\tdir = -1;\n\tdirnc = -nc;\n\terrorptr = cquantize->fserrors[ci] + (width+1); /* => entry after last column */\n      } else {\n\t/* work left to right in this row */\n\tdir = 1;\n\tdirnc = nc;\n\terrorptr = cquantize->fserrors[ci]; /* => entry before first column */\n      }\n      colorindex_ci = cquantize->colorindex[ci];\n      colormap_ci = cquantize->sv_colormap[ci];\n      /* Preset error values: no error propagated to first pixel from left */\n      cur = 0;\n      /* and no error propagated to row below yet */\n      belowerr = bpreverr = 0;\n\n      for (col = width; col > 0; col--) {\n\t/* cur holds the error propagated from the previous pixel on the\n\t * current line.  Add the error propagated from the previous line\n\t * to form the complete error correction term for this pixel, and\n\t * round the error term (which is expressed * 16) to an integer.\n\t * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct\n\t * for either sign of the error value.\n\t * Note: errorptr points to *previous* column's array entry.\n\t */\n\tcur = RIGHT_SHIFT(cur + errorptr[dir] + 8, 4);\n\t/* Form pixel value + error, and range-limit to 0..MAXJSAMPLE.\n\t * The maximum error is +- MAXJSAMPLE; this sets the required size\n\t * of the range_limit array.\n\t */\n\tcur += GETJSAMPLE(*input_ptr);\n\tcur = GETJSAMPLE(range_limit[cur]);\n\t/* Select output value, accumulate into output code for this pixel */\n\tpixcode = GETJSAMPLE(colorindex_ci[cur]);\n\t*output_ptr += (JSAMPLE) pixcode;\n\t/* Compute actual representation error at this pixel */\n\t/* Note: we can do this even though we don't have the final */\n\t/* pixel code, because the colormap is orthogonal. */\n\tcur -= GETJSAMPLE(colormap_ci[pixcode]);\n\t/* Compute error fractions to be propagated to adjacent pixels.\n\t * Add these into the running sums, and simultaneously shift the\n\t * next-line error sums left by 1 column.\n\t */\n\tbnexterr = cur;\n\tdelta = cur * 2;\n\tcur += delta;\t\t/* form error * 3 */\n\terrorptr[0] = (FSERROR) (bpreverr + cur);\n\tcur += delta;\t\t/* form error * 5 */\n\tbpreverr = belowerr + cur;\n\tbelowerr = bnexterr;\n\tcur += delta;\t\t/* form error * 7 */\n\t/* At this point cur contains the 7/16 error value to be propagated\n\t * to the next pixel on the current line, and all the errors for the\n\t * next line have been shifted over. We are therefore ready to move on.\n\t */\n\tinput_ptr += dirnc;\t/* advance input ptr to next column */\n\toutput_ptr += dir;\t/* advance output ptr to next column */\n\terrorptr += dir;\t/* advance errorptr to current column */\n      }\n      /* Post-loop cleanup: we must unload the final error value into the\n       * final fserrors[] entry.  Note we need not unload belowerr because\n       * it is for the dummy column before or after the actual array.\n       */\n      errorptr[0] = (FSERROR) bpreverr; /* unload prev err into array */\n    }\n    cquantize->on_odd_row = (cquantize->on_odd_row ? FALSE : TRUE);\n  }\n}\n\n\n/*\n * Allocate workspace for Floyd-Steinberg errors.\n */\n\nLOCAL(void)\nalloc_fs_workspace (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  size_t arraysize;\n  int i;\n\n  arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR));\n  for (i = 0; i < cinfo->out_color_components; i++) {\n    cquantize->fserrors[i] = (FSERRPTR)\n      (*cinfo->mem->alloc_large)((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize);\n  }\n}\n\n\n/*\n * Initialize for one-pass color quantization.\n */\n\nMETHODDEF(void)\nstart_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  size_t arraysize;\n  int i;\n\n  /* Install my colormap. */\n  cinfo->colormap = cquantize->sv_colormap;\n  cinfo->actual_number_of_colors = cquantize->sv_actual;\n\n  /* Initialize for desired dithering mode. */\n  switch (cinfo->dither_mode) {\n  case JDITHER_NONE:\n    if (cinfo->out_color_components == 3)\n      cquantize->pub.color_quantize = color_quantize3;\n    else\n      cquantize->pub.color_quantize = color_quantize;\n    break;\n  case JDITHER_ORDERED:\n    if (cinfo->out_color_components == 3)\n      cquantize->pub.color_quantize = quantize3_ord_dither;\n    else\n      cquantize->pub.color_quantize = quantize_ord_dither;\n    cquantize->row_index = 0;\t/* initialize state for ordered dither */\n    /* If user changed to ordered dither from another mode,\n     * we must recreate the color index table with padding.\n     * This will cost extra space, but probably isn't very likely.\n     */\n    if (! cquantize->is_padded)\n      create_colorindex(cinfo);\n    /* Create ordered-dither tables if we didn't already. */\n    if (cquantize->odither[0] == NULL)\n      create_odither_tables(cinfo);\n    break;\n  case JDITHER_FS:\n    cquantize->pub.color_quantize = quantize_fs_dither;\n    cquantize->on_odd_row = FALSE; /* initialize state for F-S dither */\n    /* Allocate Floyd-Steinberg workspace if didn't already. */\n    if (cquantize->fserrors[0] == NULL)\n      alloc_fs_workspace(cinfo);\n    /* Initialize the propagated errors to zero. */\n    arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR));\n    for (i = 0; i < cinfo->out_color_components; i++)\n      jzero_far((void FAR *) cquantize->fserrors[i], arraysize);\n    break;\n  default:\n    ERREXIT(cinfo, JERR_NOT_COMPILED);\n    break;\n  }\n}\n\n\n/*\n * Finish up at the end of the pass.\n */\n\nMETHODDEF(void)\nfinish_pass_1_quant (j_decompress_ptr cinfo)\n{\n  /* no work in 1-pass case */\n}\n\n\n/*\n * Switch to a new external colormap between output passes.\n * Shouldn't get to this module!\n */\n\nMETHODDEF(void)\nnew_color_map_1_quant (j_decompress_ptr cinfo)\n{\n  ERREXIT(cinfo, JERR_MODE_CHANGE);\n}\n\n\n/*\n * Module initialization routine for 1-pass color quantization.\n */\n\nGLOBAL(void)\njinit_1pass_quantizer (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize;\n\n  cquantize = (my_cquantize_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_cquantizer));\n  cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize;\n  cquantize->pub.start_pass = start_pass_1_quant;\n  cquantize->pub.finish_pass = finish_pass_1_quant;\n  cquantize->pub.new_color_map = new_color_map_1_quant;\n  cquantize->fserrors[0] = NULL; /* Flag FS workspace not allocated */\n  cquantize->odither[0] = NULL;\t/* Also flag odither arrays not allocated */\n\n  /* Make sure my internal arrays won't overflow */\n  if (cinfo->out_color_components > MAX_Q_COMPS)\n    ERREXIT1(cinfo, JERR_QUANT_COMPONENTS, MAX_Q_COMPS);\n  /* Make sure colormap indexes can be represented by JSAMPLEs */\n  if (cinfo->desired_number_of_colors > (MAXJSAMPLE+1))\n    ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXJSAMPLE+1);\n\n  /* Create the colormap and color index table. */\n  create_colormap(cinfo);\n  create_colorindex(cinfo);\n\n  /* Allocate Floyd-Steinberg workspace now if requested.\n   * We do this now since it is FAR storage and may affect the memory\n   * manager's space calculations.  If the user changes to FS dither\n   * mode in a later pass, we will allocate the space then, and will\n   * possibly overrun the max_memory_to_use setting.\n   */\n  if (cinfo->dither_mode == JDITHER_FS)\n    alloc_fs_workspace(cinfo);\n}\n\n#endif /* QUANT_1PASS_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/jquant2.c",
    "content": "/*\n * jquant2.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2009, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains 2-pass color quantization (color mapping) routines.\n * These routines provide selection of a custom color map for an image,\n * followed by mapping of the image to that color map, with optional\n * Floyd-Steinberg dithering.\n * It is also possible to use just the second pass to map to an arbitrary\n * externally-given color map.\n *\n * Note: ordered dithering is not supported, since there isn't any fast\n * way to compute intercolor distances; it's unclear that ordered dither's\n * fundamental assumptions even hold with an irregularly spaced color map.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n#ifdef QUANT_2PASS_SUPPORTED\n\n\n/*\n * This module implements the well-known Heckbert paradigm for color\n * quantization.  Most of the ideas used here can be traced back to\n * Heckbert's seminal paper\n *   Heckbert, Paul.  \"Color Image Quantization for Frame Buffer Display\",\n *   Proc. SIGGRAPH '82, Computer Graphics v.16 #3 (July 1982), pp 297-304.\n *\n * In the first pass over the image, we accumulate a histogram showing the\n * usage count of each possible color.  To keep the histogram to a reasonable\n * size, we reduce the precision of the input; typical practice is to retain\n * 5 or 6 bits per color, so that 8 or 4 different input values are counted\n * in the same histogram cell.\n *\n * Next, the color-selection step begins with a box representing the whole\n * color space, and repeatedly splits the \"largest\" remaining box until we\n * have as many boxes as desired colors.  Then the mean color in each\n * remaining box becomes one of the possible output colors.\n * \n * The second pass over the image maps each input pixel to the closest output\n * color (optionally after applying a Floyd-Steinberg dithering correction).\n * This mapping is logically trivial, but making it go fast enough requires\n * considerable care.\n *\n * Heckbert-style quantizers vary a good deal in their policies for choosing\n * the \"largest\" box and deciding where to cut it.  The particular policies\n * used here have proved out well in experimental comparisons, but better ones\n * may yet be found.\n *\n * In earlier versions of the IJG code, this module quantized in YCbCr color\n * space, processing the raw upsampled data without a color conversion step.\n * This allowed the color conversion math to be done only once per colormap\n * entry, not once per pixel.  However, that optimization precluded other\n * useful optimizations (such as merging color conversion with upsampling)\n * and it also interfered with desired capabilities such as quantizing to an\n * externally-supplied colormap.  We have therefore abandoned that approach.\n * The present code works in the post-conversion color space, typically RGB.\n *\n * To improve the visual quality of the results, we actually work in scaled\n * RGB space, giving G distances more weight than R, and R in turn more than\n * B.  To do everything in integer math, we must use integer scale factors.\n * The 2/3/1 scale factors used here correspond loosely to the relative\n * weights of the colors in the NTSC grayscale equation.\n * If you want to use this code to quantize a non-RGB color space, you'll\n * probably need to change these scale factors.\n */\n\n#define R_SCALE 2\t\t/* scale R distances by this much */\n#define G_SCALE 3\t\t/* scale G distances by this much */\n#define B_SCALE 1\t\t/* and B by this much */\n\nstatic const int c_scales[3]={R_SCALE, G_SCALE, B_SCALE};\n#define C0_SCALE c_scales[rgb_red[cinfo->out_color_space]]\n#define C1_SCALE c_scales[rgb_green[cinfo->out_color_space]]\n#define C2_SCALE c_scales[rgb_blue[cinfo->out_color_space]]\n\n/*\n * First we have the histogram data structure and routines for creating it.\n *\n * The number of bits of precision can be adjusted by changing these symbols.\n * We recommend keeping 6 bits for G and 5 each for R and B.\n * If you have plenty of memory and cycles, 6 bits all around gives marginally\n * better results; if you are short of memory, 5 bits all around will save\n * some space but degrade the results.\n * To maintain a fully accurate histogram, we'd need to allocate a \"long\"\n * (preferably unsigned long) for each cell.  In practice this is overkill;\n * we can get by with 16 bits per cell.  Few of the cell counts will overflow,\n * and clamping those that do overflow to the maximum value will give close-\n * enough results.  This reduces the recommended histogram size from 256Kb\n * to 128Kb, which is a useful savings on PC-class machines.\n * (In the second pass the histogram space is re-used for pixel mapping data;\n * in that capacity, each cell must be able to store zero to the number of\n * desired colors.  16 bits/cell is plenty for that too.)\n * Since the JPEG code is intended to run in small memory model on 80x86\n * machines, we can't just allocate the histogram in one chunk.  Instead\n * of a true 3-D array, we use a row of pointers to 2-D arrays.  Each\n * pointer corresponds to a C0 value (typically 2^5 = 32 pointers) and\n * each 2-D array has 2^6*2^5 = 2048 or 2^6*2^6 = 4096 entries.  Note that\n * on 80x86 machines, the pointer row is in near memory but the actual\n * arrays are in far memory (same arrangement as we use for image arrays).\n */\n\n#define MAXNUMCOLORS  (MAXJSAMPLE+1) /* maximum size of colormap */\n\n/* These will do the right thing for either R,G,B or B,G,R color order,\n * but you may not like the results for other color orders.\n */\n#define HIST_C0_BITS  5\t\t/* bits of precision in R/B histogram */\n#define HIST_C1_BITS  6\t\t/* bits of precision in G histogram */\n#define HIST_C2_BITS  5\t\t/* bits of precision in B/R histogram */\n\n/* Number of elements along histogram axes. */\n#define HIST_C0_ELEMS  (1<<HIST_C0_BITS)\n#define HIST_C1_ELEMS  (1<<HIST_C1_BITS)\n#define HIST_C2_ELEMS  (1<<HIST_C2_BITS)\n\n/* These are the amounts to shift an input value to get a histogram index. */\n#define C0_SHIFT  (BITS_IN_JSAMPLE-HIST_C0_BITS)\n#define C1_SHIFT  (BITS_IN_JSAMPLE-HIST_C1_BITS)\n#define C2_SHIFT  (BITS_IN_JSAMPLE-HIST_C2_BITS)\n\n\ntypedef UINT16 histcell;\t/* histogram cell; prefer an unsigned type */\n\ntypedef histcell FAR * histptr;\t/* for pointers to histogram cells */\n\ntypedef histcell hist1d[HIST_C2_ELEMS]; /* typedefs for the array */\ntypedef hist1d FAR * hist2d;\t/* type for the 2nd-level pointers */\ntypedef hist2d * hist3d;\t/* type for top-level pointer */\n\n\n/* Declarations for Floyd-Steinberg dithering.\n *\n * Errors are accumulated into the array fserrors[], at a resolution of\n * 1/16th of a pixel count.  The error at a given pixel is propagated\n * to its not-yet-processed neighbors using the standard F-S fractions,\n *\t\t...\t(here)\t7/16\n *\t\t3/16\t5/16\t1/16\n * We work left-to-right on even rows, right-to-left on odd rows.\n *\n * We can get away with a single array (holding one row's worth of errors)\n * by using it to store the current row's errors at pixel columns not yet\n * processed, but the next row's errors at columns already processed.  We\n * need only a few extra variables to hold the errors immediately around the\n * current column.  (If we are lucky, those variables are in registers, but\n * even if not, they're probably cheaper to access than array elements are.)\n *\n * The fserrors[] array has (#columns + 2) entries; the extra entry at\n * each end saves us from special-casing the first and last pixels.\n * Each entry is three values long, one value for each color component.\n *\n * Note: on a wide image, we might not have enough room in a PC's near data\n * segment to hold the error array; so it is allocated with alloc_large.\n */\n\n#if BITS_IN_JSAMPLE == 8\ntypedef INT16 FSERROR;\t\t/* 16 bits should be enough */\ntypedef int LOCFSERROR;\t\t/* use 'int' for calculation temps */\n#else\ntypedef INT32 FSERROR;\t\t/* may need more than 16 bits */\ntypedef INT32 LOCFSERROR;\t/* be sure calculation temps are big enough */\n#endif\n\ntypedef FSERROR FAR *FSERRPTR;\t/* pointer to error array (in FAR storage!) */\n\n\n/* Private subobject */\n\ntypedef struct {\n  struct jpeg_color_quantizer pub; /* public fields */\n\n  /* Space for the eventually created colormap is stashed here */\n  JSAMPARRAY sv_colormap;\t/* colormap allocated at init time */\n  int desired;\t\t\t/* desired # of colors = size of colormap */\n\n  /* Variables for accumulating image statistics */\n  hist3d histogram;\t\t/* pointer to the histogram */\n\n  boolean needs_zeroed;\t\t/* TRUE if next pass must zero histogram */\n\n  /* Variables for Floyd-Steinberg dithering */\n  FSERRPTR fserrors;\t\t/* accumulated errors */\n  boolean on_odd_row;\t\t/* flag to remember which row we are on */\n  int * error_limiter;\t\t/* table for clamping the applied error */\n} my_cquantizer;\n\ntypedef my_cquantizer * my_cquantize_ptr;\n\n\n/*\n * Prescan some rows of pixels.\n * In this module the prescan simply updates the histogram, which has been\n * initialized to zeroes by start_pass.\n * An output_buf parameter is required by the method signature, but no data\n * is actually output (in fact the buffer controller is probably passing a\n * NULL pointer).\n */\n\nMETHODDEF(void)\nprescan_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,\n\t\t  JSAMPARRAY output_buf, int num_rows)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  register JSAMPROW ptr;\n  register histptr histp;\n  register hist3d histogram = cquantize->histogram;\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n\n  for (row = 0; row < num_rows; row++) {\n    ptr = input_buf[row];\n    for (col = width; col > 0; col--) {\n      /* get pixel value and index into the histogram */\n      histp = & histogram[GETJSAMPLE(ptr[0]) >> C0_SHIFT]\n\t\t\t [GETJSAMPLE(ptr[1]) >> C1_SHIFT]\n\t\t\t [GETJSAMPLE(ptr[2]) >> C2_SHIFT];\n      /* increment, check for overflow and undo increment if so. */\n      if (++(*histp) <= 0)\n\t(*histp)--;\n      ptr += 3;\n    }\n  }\n}\n\n\n/*\n * Next we have the really interesting routines: selection of a colormap\n * given the completed histogram.\n * These routines work with a list of \"boxes\", each representing a rectangular\n * subset of the input color space (to histogram precision).\n */\n\ntypedef struct {\n  /* The bounds of the box (inclusive); expressed as histogram indexes */\n  int c0min, c0max;\n  int c1min, c1max;\n  int c2min, c2max;\n  /* The volume (actually 2-norm) of the box */\n  INT32 volume;\n  /* The number of nonzero histogram cells within this box */\n  long colorcount;\n} box;\n\ntypedef box * boxptr;\n\n\nLOCAL(boxptr)\nfind_biggest_color_pop (boxptr boxlist, int numboxes)\n/* Find the splittable box with the largest color population */\n/* Returns NULL if no splittable boxes remain */\n{\n  register boxptr boxp;\n  register int i;\n  register long maxc = 0;\n  boxptr which = NULL;\n  \n  for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {\n    if (boxp->colorcount > maxc && boxp->volume > 0) {\n      which = boxp;\n      maxc = boxp->colorcount;\n    }\n  }\n  return which;\n}\n\n\nLOCAL(boxptr)\nfind_biggest_volume (boxptr boxlist, int numboxes)\n/* Find the splittable box with the largest (scaled) volume */\n/* Returns NULL if no splittable boxes remain */\n{\n  register boxptr boxp;\n  register int i;\n  register INT32 maxv = 0;\n  boxptr which = NULL;\n  \n  for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {\n    if (boxp->volume > maxv) {\n      which = boxp;\n      maxv = boxp->volume;\n    }\n  }\n  return which;\n}\n\n\nLOCAL(void)\nupdate_box (j_decompress_ptr cinfo, boxptr boxp)\n/* Shrink the min/max bounds of a box to enclose only nonzero elements, */\n/* and recompute its volume and population */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  hist3d histogram = cquantize->histogram;\n  histptr histp;\n  int c0,c1,c2;\n  int c0min,c0max,c1min,c1max,c2min,c2max;\n  INT32 dist0,dist1,dist2;\n  long ccount;\n  \n  c0min = boxp->c0min;  c0max = boxp->c0max;\n  c1min = boxp->c1min;  c1max = boxp->c1max;\n  c2min = boxp->c2min;  c2max = boxp->c2max;\n  \n  if (c0max > c0min)\n    for (c0 = c0min; c0 <= c0max; c0++)\n      for (c1 = c1min; c1 <= c1max; c1++) {\n\thistp = & histogram[c0][c1][c2min];\n\tfor (c2 = c2min; c2 <= c2max; c2++)\n\t  if (*histp++ != 0) {\n\t    boxp->c0min = c0min = c0;\n\t    goto have_c0min;\n\t  }\n      }\n have_c0min:\n  if (c0max > c0min)\n    for (c0 = c0max; c0 >= c0min; c0--)\n      for (c1 = c1min; c1 <= c1max; c1++) {\n\thistp = & histogram[c0][c1][c2min];\n\tfor (c2 = c2min; c2 <= c2max; c2++)\n\t  if (*histp++ != 0) {\n\t    boxp->c0max = c0max = c0;\n\t    goto have_c0max;\n\t  }\n      }\n have_c0max:\n  if (c1max > c1min)\n    for (c1 = c1min; c1 <= c1max; c1++)\n      for (c0 = c0min; c0 <= c0max; c0++) {\n\thistp = & histogram[c0][c1][c2min];\n\tfor (c2 = c2min; c2 <= c2max; c2++)\n\t  if (*histp++ != 0) {\n\t    boxp->c1min = c1min = c1;\n\t    goto have_c1min;\n\t  }\n      }\n have_c1min:\n  if (c1max > c1min)\n    for (c1 = c1max; c1 >= c1min; c1--)\n      for (c0 = c0min; c0 <= c0max; c0++) {\n\thistp = & histogram[c0][c1][c2min];\n\tfor (c2 = c2min; c2 <= c2max; c2++)\n\t  if (*histp++ != 0) {\n\t    boxp->c1max = c1max = c1;\n\t    goto have_c1max;\n\t  }\n      }\n have_c1max:\n  if (c2max > c2min)\n    for (c2 = c2min; c2 <= c2max; c2++)\n      for (c0 = c0min; c0 <= c0max; c0++) {\n\thistp = & histogram[c0][c1min][c2];\n\tfor (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS)\n\t  if (*histp != 0) {\n\t    boxp->c2min = c2min = c2;\n\t    goto have_c2min;\n\t  }\n      }\n have_c2min:\n  if (c2max > c2min)\n    for (c2 = c2max; c2 >= c2min; c2--)\n      for (c0 = c0min; c0 <= c0max; c0++) {\n\thistp = & histogram[c0][c1min][c2];\n\tfor (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS)\n\t  if (*histp != 0) {\n\t    boxp->c2max = c2max = c2;\n\t    goto have_c2max;\n\t  }\n      }\n have_c2max:\n\n  /* Update box volume.\n   * We use 2-norm rather than real volume here; this biases the method\n   * against making long narrow boxes, and it has the side benefit that\n   * a box is splittable iff norm > 0.\n   * Since the differences are expressed in histogram-cell units,\n   * we have to shift back to JSAMPLE units to get consistent distances;\n   * after which, we scale according to the selected distance scale factors.\n   */\n  dist0 = ((c0max - c0min) << C0_SHIFT) * C0_SCALE;\n  dist1 = ((c1max - c1min) << C1_SHIFT) * C1_SCALE;\n  dist2 = ((c2max - c2min) << C2_SHIFT) * C2_SCALE;\n  boxp->volume = dist0*dist0 + dist1*dist1 + dist2*dist2;\n  \n  /* Now scan remaining volume of box and compute population */\n  ccount = 0;\n  for (c0 = c0min; c0 <= c0max; c0++)\n    for (c1 = c1min; c1 <= c1max; c1++) {\n      histp = & histogram[c0][c1][c2min];\n      for (c2 = c2min; c2 <= c2max; c2++, histp++)\n\tif (*histp != 0) {\n\t  ccount++;\n\t}\n    }\n  boxp->colorcount = ccount;\n}\n\n\nLOCAL(int)\nmedian_cut (j_decompress_ptr cinfo, boxptr boxlist, int numboxes,\n\t    int desired_colors)\n/* Repeatedly select and split the largest box until we have enough boxes */\n{\n  int n,lb;\n  int c0,c1,c2,cmax;\n  register boxptr b1,b2;\n\n  while (numboxes < desired_colors) {\n    /* Select box to split.\n     * Current algorithm: by population for first half, then by volume.\n     */\n    if (numboxes*2 <= desired_colors) {\n      b1 = find_biggest_color_pop(boxlist, numboxes);\n    } else {\n      b1 = find_biggest_volume(boxlist, numboxes);\n    }\n    if (b1 == NULL)\t\t/* no splittable boxes left! */\n      break;\n    b2 = &boxlist[numboxes];\t/* where new box will go */\n    /* Copy the color bounds to the new box. */\n    b2->c0max = b1->c0max; b2->c1max = b1->c1max; b2->c2max = b1->c2max;\n    b2->c0min = b1->c0min; b2->c1min = b1->c1min; b2->c2min = b1->c2min;\n    /* Choose which axis to split the box on.\n     * Current algorithm: longest scaled axis.\n     * See notes in update_box about scaling distances.\n     */\n    c0 = ((b1->c0max - b1->c0min) << C0_SHIFT) * C0_SCALE;\n    c1 = ((b1->c1max - b1->c1min) << C1_SHIFT) * C1_SCALE;\n    c2 = ((b1->c2max - b1->c2min) << C2_SHIFT) * C2_SCALE;\n    /* We want to break any ties in favor of green, then red, blue last.\n     * This code does the right thing for R,G,B or B,G,R color orders only.\n     */\n    if (rgb_red[cinfo->out_color_space] == 0) {\n      cmax = c1; n = 1;\n      if (c0 > cmax) { cmax = c0; n = 0; }\n      if (c2 > cmax) { n = 2; }\n    }\n    else {\n      cmax = c1; n = 1;\n      if (c2 > cmax) { cmax = c2; n = 2; }\n      if (c0 > cmax) { n = 0; }\n    }\n    /* Choose split point along selected axis, and update box bounds.\n     * Current algorithm: split at halfway point.\n     * (Since the box has been shrunk to minimum volume,\n     * any split will produce two nonempty subboxes.)\n     * Note that lb value is max for lower box, so must be < old max.\n     */\n    switch (n) {\n    case 0:\n      lb = (b1->c0max + b1->c0min) / 2;\n      b1->c0max = lb;\n      b2->c0min = lb+1;\n      break;\n    case 1:\n      lb = (b1->c1max + b1->c1min) / 2;\n      b1->c1max = lb;\n      b2->c1min = lb+1;\n      break;\n    case 2:\n      lb = (b1->c2max + b1->c2min) / 2;\n      b1->c2max = lb;\n      b2->c2min = lb+1;\n      break;\n    }\n    /* Update stats for boxes */\n    update_box(cinfo, b1);\n    update_box(cinfo, b2);\n    numboxes++;\n  }\n  return numboxes;\n}\n\n\nLOCAL(void)\ncompute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor)\n/* Compute representative color for a box, put it in colormap[icolor] */\n{\n  /* Current algorithm: mean weighted by pixels (not colors) */\n  /* Note it is important to get the rounding correct! */\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  hist3d histogram = cquantize->histogram;\n  histptr histp;\n  int c0,c1,c2;\n  int c0min,c0max,c1min,c1max,c2min,c2max;\n  long count;\n  long total = 0;\n  long c0total = 0;\n  long c1total = 0;\n  long c2total = 0;\n  \n  c0min = boxp->c0min;  c0max = boxp->c0max;\n  c1min = boxp->c1min;  c1max = boxp->c1max;\n  c2min = boxp->c2min;  c2max = boxp->c2max;\n  \n  for (c0 = c0min; c0 <= c0max; c0++)\n    for (c1 = c1min; c1 <= c1max; c1++) {\n      histp = & histogram[c0][c1][c2min];\n      for (c2 = c2min; c2 <= c2max; c2++) {\n\tif ((count = *histp++) != 0) {\n\t  total += count;\n\t  c0total += ((c0 << C0_SHIFT) + ((1<<C0_SHIFT)>>1)) * count;\n\t  c1total += ((c1 << C1_SHIFT) + ((1<<C1_SHIFT)>>1)) * count;\n\t  c2total += ((c2 << C2_SHIFT) + ((1<<C2_SHIFT)>>1)) * count;\n\t}\n      }\n    }\n  \n  cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total>>1)) / total);\n  cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total>>1)) / total);\n  cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total>>1)) / total);\n}\n\n\nLOCAL(void)\nselect_colors (j_decompress_ptr cinfo, int desired_colors)\n/* Master routine for color selection */\n{\n  boxptr boxlist;\n  int numboxes;\n  int i;\n\n  /* Allocate workspace for box list */\n  boxlist = (boxptr) (*cinfo->mem->alloc_small)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, desired_colors * SIZEOF(box));\n  /* Initialize one box containing whole space */\n  numboxes = 1;\n  boxlist[0].c0min = 0;\n  boxlist[0].c0max = MAXJSAMPLE >> C0_SHIFT;\n  boxlist[0].c1min = 0;\n  boxlist[0].c1max = MAXJSAMPLE >> C1_SHIFT;\n  boxlist[0].c2min = 0;\n  boxlist[0].c2max = MAXJSAMPLE >> C2_SHIFT;\n  /* Shrink it to actually-used volume and set its statistics */\n  update_box(cinfo, & boxlist[0]);\n  /* Perform median-cut to produce final box list */\n  numboxes = median_cut(cinfo, boxlist, numboxes, desired_colors);\n  /* Compute the representative color for each box, fill colormap */\n  for (i = 0; i < numboxes; i++)\n    compute_color(cinfo, & boxlist[i], i);\n  cinfo->actual_number_of_colors = numboxes;\n  TRACEMS1(cinfo, 1, JTRC_QUANT_SELECTED, numboxes);\n}\n\n\n/*\n * These routines are concerned with the time-critical task of mapping input\n * colors to the nearest color in the selected colormap.\n *\n * We re-use the histogram space as an \"inverse color map\", essentially a\n * cache for the results of nearest-color searches.  All colors within a\n * histogram cell will be mapped to the same colormap entry, namely the one\n * closest to the cell's center.  This may not be quite the closest entry to\n * the actual input color, but it's almost as good.  A zero in the cache\n * indicates we haven't found the nearest color for that cell yet; the array\n * is cleared to zeroes before starting the mapping pass.  When we find the\n * nearest color for a cell, its colormap index plus one is recorded in the\n * cache for future use.  The pass2 scanning routines call fill_inverse_cmap\n * when they need to use an unfilled entry in the cache.\n *\n * Our method of efficiently finding nearest colors is based on the \"locally\n * sorted search\" idea described by Heckbert and on the incremental distance\n * calculation described by Spencer W. Thomas in chapter III.1 of Graphics\n * Gems II (James Arvo, ed.  Academic Press, 1991).  Thomas points out that\n * the distances from a given colormap entry to each cell of the histogram can\n * be computed quickly using an incremental method: the differences between\n * distances to adjacent cells themselves differ by a constant.  This allows a\n * fairly fast implementation of the \"brute force\" approach of computing the\n * distance from every colormap entry to every histogram cell.  Unfortunately,\n * it needs a work array to hold the best-distance-so-far for each histogram\n * cell (because the inner loop has to be over cells, not colormap entries).\n * The work array elements have to be INT32s, so the work array would need\n * 256Kb at our recommended precision.  This is not feasible in DOS machines.\n *\n * To get around these problems, we apply Thomas' method to compute the\n * nearest colors for only the cells within a small subbox of the histogram.\n * The work array need be only as big as the subbox, so the memory usage\n * problem is solved.  Furthermore, we need not fill subboxes that are never\n * referenced in pass2; many images use only part of the color gamut, so a\n * fair amount of work is saved.  An additional advantage of this\n * approach is that we can apply Heckbert's locality criterion to quickly\n * eliminate colormap entries that are far away from the subbox; typically\n * three-fourths of the colormap entries are rejected by Heckbert's criterion,\n * and we need not compute their distances to individual cells in the subbox.\n * The speed of this approach is heavily influenced by the subbox size: too\n * small means too much overhead, too big loses because Heckbert's criterion\n * can't eliminate as many colormap entries.  Empirically the best subbox\n * size seems to be about 1/512th of the histogram (1/8th in each direction).\n *\n * Thomas' article also describes a refined method which is asymptotically\n * faster than the brute-force method, but it is also far more complex and\n * cannot efficiently be applied to small subboxes.  It is therefore not\n * useful for programs intended to be portable to DOS machines.  On machines\n * with plenty of memory, filling the whole histogram in one shot with Thomas'\n * refined method might be faster than the present code --- but then again,\n * it might not be any faster, and it's certainly more complicated.\n */\n\n\n/* log2(histogram cells in update box) for each axis; this can be adjusted */\n#define BOX_C0_LOG  (HIST_C0_BITS-3)\n#define BOX_C1_LOG  (HIST_C1_BITS-3)\n#define BOX_C2_LOG  (HIST_C2_BITS-3)\n\n#define BOX_C0_ELEMS  (1<<BOX_C0_LOG) /* # of hist cells in update box */\n#define BOX_C1_ELEMS  (1<<BOX_C1_LOG)\n#define BOX_C2_ELEMS  (1<<BOX_C2_LOG)\n\n#define BOX_C0_SHIFT  (C0_SHIFT + BOX_C0_LOG)\n#define BOX_C1_SHIFT  (C1_SHIFT + BOX_C1_LOG)\n#define BOX_C2_SHIFT  (C2_SHIFT + BOX_C2_LOG)\n\n\n/*\n * The next three routines implement inverse colormap filling.  They could\n * all be folded into one big routine, but splitting them up this way saves\n * some stack space (the mindist[] and bestdist[] arrays need not coexist)\n * and may allow some compilers to produce better code by registerizing more\n * inner-loop variables.\n */\n\nLOCAL(int)\nfind_nearby_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,\n\t\t    JSAMPLE colorlist[])\n/* Locate the colormap entries close enough to an update box to be candidates\n * for the nearest entry to some cell(s) in the update box.  The update box\n * is specified by the center coordinates of its first cell.  The number of\n * candidate colormap entries is returned, and their colormap indexes are\n * placed in colorlist[].\n * This routine uses Heckbert's \"locally sorted search\" criterion to select\n * the colors that need further consideration.\n */\n{\n  int numcolors = cinfo->actual_number_of_colors;\n  int maxc0, maxc1, maxc2;\n  int centerc0, centerc1, centerc2;\n  int i, x, ncolors;\n  INT32 minmaxdist, min_dist, max_dist, tdist;\n  INT32 mindist[MAXNUMCOLORS];\t/* min distance to colormap entry i */\n\n  /* Compute true coordinates of update box's upper corner and center.\n   * Actually we compute the coordinates of the center of the upper-corner\n   * histogram cell, which are the upper bounds of the volume we care about.\n   * Note that since \">>\" rounds down, the \"center\" values may be closer to\n   * min than to max; hence comparisons to them must be \"<=\", not \"<\".\n   */\n  maxc0 = minc0 + ((1 << BOX_C0_SHIFT) - (1 << C0_SHIFT));\n  centerc0 = (minc0 + maxc0) >> 1;\n  maxc1 = minc1 + ((1 << BOX_C1_SHIFT) - (1 << C1_SHIFT));\n  centerc1 = (minc1 + maxc1) >> 1;\n  maxc2 = minc2 + ((1 << BOX_C2_SHIFT) - (1 << C2_SHIFT));\n  centerc2 = (minc2 + maxc2) >> 1;\n\n  /* For each color in colormap, find:\n   *  1. its minimum squared-distance to any point in the update box\n   *     (zero if color is within update box);\n   *  2. its maximum squared-distance to any point in the update box.\n   * Both of these can be found by considering only the corners of the box.\n   * We save the minimum distance for each color in mindist[];\n   * only the smallest maximum distance is of interest.\n   */\n  minmaxdist = 0x7FFFFFFFL;\n\n  for (i = 0; i < numcolors; i++) {\n    /* We compute the squared-c0-distance term, then add in the other two. */\n    x = GETJSAMPLE(cinfo->colormap[0][i]);\n    if (x < minc0) {\n      tdist = (x - minc0) * C0_SCALE;\n      min_dist = tdist*tdist;\n      tdist = (x - maxc0) * C0_SCALE;\n      max_dist = tdist*tdist;\n    } else if (x > maxc0) {\n      tdist = (x - maxc0) * C0_SCALE;\n      min_dist = tdist*tdist;\n      tdist = (x - minc0) * C0_SCALE;\n      max_dist = tdist*tdist;\n    } else {\n      /* within cell range so no contribution to min_dist */\n      min_dist = 0;\n      if (x <= centerc0) {\n\ttdist = (x - maxc0) * C0_SCALE;\n\tmax_dist = tdist*tdist;\n      } else {\n\ttdist = (x - minc0) * C0_SCALE;\n\tmax_dist = tdist*tdist;\n      }\n    }\n\n    x = GETJSAMPLE(cinfo->colormap[1][i]);\n    if (x < minc1) {\n      tdist = (x - minc1) * C1_SCALE;\n      min_dist += tdist*tdist;\n      tdist = (x - maxc1) * C1_SCALE;\n      max_dist += tdist*tdist;\n    } else if (x > maxc1) {\n      tdist = (x - maxc1) * C1_SCALE;\n      min_dist += tdist*tdist;\n      tdist = (x - minc1) * C1_SCALE;\n      max_dist += tdist*tdist;\n    } else {\n      /* within cell range so no contribution to min_dist */\n      if (x <= centerc1) {\n\ttdist = (x - maxc1) * C1_SCALE;\n\tmax_dist += tdist*tdist;\n      } else {\n\ttdist = (x - minc1) * C1_SCALE;\n\tmax_dist += tdist*tdist;\n      }\n    }\n\n    x = GETJSAMPLE(cinfo->colormap[2][i]);\n    if (x < minc2) {\n      tdist = (x - minc2) * C2_SCALE;\n      min_dist += tdist*tdist;\n      tdist = (x - maxc2) * C2_SCALE;\n      max_dist += tdist*tdist;\n    } else if (x > maxc2) {\n      tdist = (x - maxc2) * C2_SCALE;\n      min_dist += tdist*tdist;\n      tdist = (x - minc2) * C2_SCALE;\n      max_dist += tdist*tdist;\n    } else {\n      /* within cell range so no contribution to min_dist */\n      if (x <= centerc2) {\n\ttdist = (x - maxc2) * C2_SCALE;\n\tmax_dist += tdist*tdist;\n      } else {\n\ttdist = (x - minc2) * C2_SCALE;\n\tmax_dist += tdist*tdist;\n      }\n    }\n\n    mindist[i] = min_dist;\t/* save away the results */\n    if (max_dist < minmaxdist)\n      minmaxdist = max_dist;\n  }\n\n  /* Now we know that no cell in the update box is more than minmaxdist\n   * away from some colormap entry.  Therefore, only colors that are\n   * within minmaxdist of some part of the box need be considered.\n   */\n  ncolors = 0;\n  for (i = 0; i < numcolors; i++) {\n    if (mindist[i] <= minmaxdist)\n      colorlist[ncolors++] = (JSAMPLE) i;\n  }\n  return ncolors;\n}\n\n\nLOCAL(void)\nfind_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,\n\t\t  int numcolors, JSAMPLE colorlist[], JSAMPLE bestcolor[])\n/* Find the closest colormap entry for each cell in the update box,\n * given the list of candidate colors prepared by find_nearby_colors.\n * Return the indexes of the closest entries in the bestcolor[] array.\n * This routine uses Thomas' incremental distance calculation method to\n * find the distance from a colormap entry to successive cells in the box.\n */\n{\n  int ic0, ic1, ic2;\n  int i, icolor;\n  register INT32 * bptr;\t/* pointer into bestdist[] array */\n  JSAMPLE * cptr;\t\t/* pointer into bestcolor[] array */\n  INT32 dist0, dist1;\t\t/* initial distance values */\n  register INT32 dist2;\t\t/* current distance in inner loop */\n  INT32 xx0, xx1;\t\t/* distance increments */\n  register INT32 xx2;\n  INT32 inc0, inc1, inc2;\t/* initial values for increments */\n  /* This array holds the distance to the nearest-so-far color for each cell */\n  INT32 bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS];\n\n  /* Initialize best-distance for each cell of the update box */\n  bptr = bestdist;\n  for (i = BOX_C0_ELEMS*BOX_C1_ELEMS*BOX_C2_ELEMS-1; i >= 0; i--)\n    *bptr++ = 0x7FFFFFFFL;\n  \n  /* For each color selected by find_nearby_colors,\n   * compute its distance to the center of each cell in the box.\n   * If that's less than best-so-far, update best distance and color number.\n   */\n  \n  /* Nominal steps between cell centers (\"x\" in Thomas article) */\n#define STEP_C0  ((1 << C0_SHIFT) * C0_SCALE)\n#define STEP_C1  ((1 << C1_SHIFT) * C1_SCALE)\n#define STEP_C2  ((1 << C2_SHIFT) * C2_SCALE)\n  \n  for (i = 0; i < numcolors; i++) {\n    icolor = GETJSAMPLE(colorlist[i]);\n    /* Compute (square of) distance from minc0/c1/c2 to this color */\n    inc0 = (minc0 - GETJSAMPLE(cinfo->colormap[0][icolor])) * C0_SCALE;\n    dist0 = inc0*inc0;\n    inc1 = (minc1 - GETJSAMPLE(cinfo->colormap[1][icolor])) * C1_SCALE;\n    dist0 += inc1*inc1;\n    inc2 = (minc2 - GETJSAMPLE(cinfo->colormap[2][icolor])) * C2_SCALE;\n    dist0 += inc2*inc2;\n    /* Form the initial difference increments */\n    inc0 = inc0 * (2 * STEP_C0) + STEP_C0 * STEP_C0;\n    inc1 = inc1 * (2 * STEP_C1) + STEP_C1 * STEP_C1;\n    inc2 = inc2 * (2 * STEP_C2) + STEP_C2 * STEP_C2;\n    /* Now loop over all cells in box, updating distance per Thomas method */\n    bptr = bestdist;\n    cptr = bestcolor;\n    xx0 = inc0;\n    for (ic0 = BOX_C0_ELEMS-1; ic0 >= 0; ic0--) {\n      dist1 = dist0;\n      xx1 = inc1;\n      for (ic1 = BOX_C1_ELEMS-1; ic1 >= 0; ic1--) {\n\tdist2 = dist1;\n\txx2 = inc2;\n\tfor (ic2 = BOX_C2_ELEMS-1; ic2 >= 0; ic2--) {\n\t  if (dist2 < *bptr) {\n\t    *bptr = dist2;\n\t    *cptr = (JSAMPLE) icolor;\n\t  }\n\t  dist2 += xx2;\n\t  xx2 += 2 * STEP_C2 * STEP_C2;\n\t  bptr++;\n\t  cptr++;\n\t}\n\tdist1 += xx1;\n\txx1 += 2 * STEP_C1 * STEP_C1;\n      }\n      dist0 += xx0;\n      xx0 += 2 * STEP_C0 * STEP_C0;\n    }\n  }\n}\n\n\nLOCAL(void)\nfill_inverse_cmap (j_decompress_ptr cinfo, int c0, int c1, int c2)\n/* Fill the inverse-colormap entries in the update box that contains */\n/* histogram cell c0/c1/c2.  (Only that one cell MUST be filled, but */\n/* we can fill as many others as we wish.) */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  hist3d histogram = cquantize->histogram;\n  int minc0, minc1, minc2;\t/* lower left corner of update box */\n  int ic0, ic1, ic2;\n  register JSAMPLE * cptr;\t/* pointer into bestcolor[] array */\n  register histptr cachep;\t/* pointer into main cache array */\n  /* This array lists the candidate colormap indexes. */\n  JSAMPLE colorlist[MAXNUMCOLORS];\n  int numcolors;\t\t/* number of candidate colors */\n  /* This array holds the actually closest colormap index for each cell. */\n  JSAMPLE bestcolor[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS];\n\n  /* Convert cell coordinates to update box ID */\n  c0 >>= BOX_C0_LOG;\n  c1 >>= BOX_C1_LOG;\n  c2 >>= BOX_C2_LOG;\n\n  /* Compute true coordinates of update box's origin corner.\n   * Actually we compute the coordinates of the center of the corner\n   * histogram cell, which are the lower bounds of the volume we care about.\n   */\n  minc0 = (c0 << BOX_C0_SHIFT) + ((1 << C0_SHIFT) >> 1);\n  minc1 = (c1 << BOX_C1_SHIFT) + ((1 << C1_SHIFT) >> 1);\n  minc2 = (c2 << BOX_C2_SHIFT) + ((1 << C2_SHIFT) >> 1);\n  \n  /* Determine which colormap entries are close enough to be candidates\n   * for the nearest entry to some cell in the update box.\n   */\n  numcolors = find_nearby_colors(cinfo, minc0, minc1, minc2, colorlist);\n\n  /* Determine the actually nearest colors. */\n  find_best_colors(cinfo, minc0, minc1, minc2, numcolors, colorlist,\n\t\t   bestcolor);\n\n  /* Save the best color numbers (plus 1) in the main cache array */\n  c0 <<= BOX_C0_LOG;\t\t/* convert ID back to base cell indexes */\n  c1 <<= BOX_C1_LOG;\n  c2 <<= BOX_C2_LOG;\n  cptr = bestcolor;\n  for (ic0 = 0; ic0 < BOX_C0_ELEMS; ic0++) {\n    for (ic1 = 0; ic1 < BOX_C1_ELEMS; ic1++) {\n      cachep = & histogram[c0+ic0][c1+ic1][c2];\n      for (ic2 = 0; ic2 < BOX_C2_ELEMS; ic2++) {\n\t*cachep++ = (histcell) (GETJSAMPLE(*cptr++) + 1);\n      }\n    }\n  }\n}\n\n\n/*\n * Map some rows of pixels to the output colormapped representation.\n */\n\nMETHODDEF(void)\npass2_no_dither (j_decompress_ptr cinfo,\n\t\t JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)\n/* This version performs no dithering */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  hist3d histogram = cquantize->histogram;\n  register JSAMPROW inptr, outptr;\n  register histptr cachep;\n  register int c0, c1, c2;\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n\n  for (row = 0; row < num_rows; row++) {\n    inptr = input_buf[row];\n    outptr = output_buf[row];\n    for (col = width; col > 0; col--) {\n      /* get pixel value and index into the cache */\n      c0 = GETJSAMPLE(*inptr++) >> C0_SHIFT;\n      c1 = GETJSAMPLE(*inptr++) >> C1_SHIFT;\n      c2 = GETJSAMPLE(*inptr++) >> C2_SHIFT;\n      cachep = & histogram[c0][c1][c2];\n      /* If we have not seen this color before, find nearest colormap entry */\n      /* and update the cache */\n      if (*cachep == 0)\n\tfill_inverse_cmap(cinfo, c0,c1,c2);\n      /* Now emit the colormap index for this cell */\n      *outptr++ = (JSAMPLE) (*cachep - 1);\n    }\n  }\n}\n\n\nMETHODDEF(void)\npass2_fs_dither (j_decompress_ptr cinfo,\n\t\t JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)\n/* This version performs Floyd-Steinberg dithering */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  hist3d histogram = cquantize->histogram;\n  register LOCFSERROR cur0, cur1, cur2;\t/* current error or pixel value */\n  LOCFSERROR belowerr0, belowerr1, belowerr2; /* error for pixel below cur */\n  LOCFSERROR bpreverr0, bpreverr1, bpreverr2; /* error for below/prev col */\n  register FSERRPTR errorptr;\t/* => fserrors[] at column before current */\n  JSAMPROW inptr;\t\t/* => current input pixel */\n  JSAMPROW outptr;\t\t/* => current output pixel */\n  histptr cachep;\n  int dir;\t\t\t/* +1 or -1 depending on direction */\n  int dir3;\t\t\t/* 3*dir, for advancing inptr & errorptr */\n  int row;\n  JDIMENSION col;\n  JDIMENSION width = cinfo->output_width;\n  JSAMPLE *range_limit = cinfo->sample_range_limit;\n  int *error_limit = cquantize->error_limiter;\n  JSAMPROW colormap0 = cinfo->colormap[0];\n  JSAMPROW colormap1 = cinfo->colormap[1];\n  JSAMPROW colormap2 = cinfo->colormap[2];\n  SHIFT_TEMPS\n\n  for (row = 0; row < num_rows; row++) {\n    inptr = input_buf[row];\n    outptr = output_buf[row];\n    if (cquantize->on_odd_row) {\n      /* work right to left in this row */\n      inptr += (width-1) * 3;\t/* so point to rightmost pixel */\n      outptr += width-1;\n      dir = -1;\n      dir3 = -3;\n      errorptr = cquantize->fserrors + (width+1)*3; /* => entry after last column */\n      cquantize->on_odd_row = FALSE; /* flip for next time */\n    } else {\n      /* work left to right in this row */\n      dir = 1;\n      dir3 = 3;\n      errorptr = cquantize->fserrors; /* => entry before first real column */\n      cquantize->on_odd_row = TRUE; /* flip for next time */\n    }\n    /* Preset error values: no error propagated to first pixel from left */\n    cur0 = cur1 = cur2 = 0;\n    /* and no error propagated to row below yet */\n    belowerr0 = belowerr1 = belowerr2 = 0;\n    bpreverr0 = bpreverr1 = bpreverr2 = 0;\n\n    for (col = width; col > 0; col--) {\n      /* curN holds the error propagated from the previous pixel on the\n       * current line.  Add the error propagated from the previous line\n       * to form the complete error correction term for this pixel, and\n       * round the error term (which is expressed * 16) to an integer.\n       * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct\n       * for either sign of the error value.\n       * Note: errorptr points to *previous* column's array entry.\n       */\n      cur0 = RIGHT_SHIFT(cur0 + errorptr[dir3+0] + 8, 4);\n      cur1 = RIGHT_SHIFT(cur1 + errorptr[dir3+1] + 8, 4);\n      cur2 = RIGHT_SHIFT(cur2 + errorptr[dir3+2] + 8, 4);\n      /* Limit the error using transfer function set by init_error_limit.\n       * See comments with init_error_limit for rationale.\n       */\n      cur0 = error_limit[cur0];\n      cur1 = error_limit[cur1];\n      cur2 = error_limit[cur2];\n      /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE.\n       * The maximum error is +- MAXJSAMPLE (or less with error limiting);\n       * this sets the required size of the range_limit array.\n       */\n      cur0 += GETJSAMPLE(inptr[0]);\n      cur1 += GETJSAMPLE(inptr[1]);\n      cur2 += GETJSAMPLE(inptr[2]);\n      cur0 = GETJSAMPLE(range_limit[cur0]);\n      cur1 = GETJSAMPLE(range_limit[cur1]);\n      cur2 = GETJSAMPLE(range_limit[cur2]);\n      /* Index into the cache with adjusted pixel value */\n      cachep = & histogram[cur0>>C0_SHIFT][cur1>>C1_SHIFT][cur2>>C2_SHIFT];\n      /* If we have not seen this color before, find nearest colormap */\n      /* entry and update the cache */\n      if (*cachep == 0)\n\tfill_inverse_cmap(cinfo, cur0>>C0_SHIFT,cur1>>C1_SHIFT,cur2>>C2_SHIFT);\n      /* Now emit the colormap index for this cell */\n      { register int pixcode = *cachep - 1;\n\t*outptr = (JSAMPLE) pixcode;\n\t/* Compute representation error for this pixel */\n\tcur0 -= GETJSAMPLE(colormap0[pixcode]);\n\tcur1 -= GETJSAMPLE(colormap1[pixcode]);\n\tcur2 -= GETJSAMPLE(colormap2[pixcode]);\n      }\n      /* Compute error fractions to be propagated to adjacent pixels.\n       * Add these into the running sums, and simultaneously shift the\n       * next-line error sums left by 1 column.\n       */\n      { register LOCFSERROR bnexterr, delta;\n\n\tbnexterr = cur0;\t/* Process component 0 */\n\tdelta = cur0 * 2;\n\tcur0 += delta;\t\t/* form error * 3 */\n\terrorptr[0] = (FSERROR) (bpreverr0 + cur0);\n\tcur0 += delta;\t\t/* form error * 5 */\n\tbpreverr0 = belowerr0 + cur0;\n\tbelowerr0 = bnexterr;\n\tcur0 += delta;\t\t/* form error * 7 */\n\tbnexterr = cur1;\t/* Process component 1 */\n\tdelta = cur1 * 2;\n\tcur1 += delta;\t\t/* form error * 3 */\n\terrorptr[1] = (FSERROR) (bpreverr1 + cur1);\n\tcur1 += delta;\t\t/* form error * 5 */\n\tbpreverr1 = belowerr1 + cur1;\n\tbelowerr1 = bnexterr;\n\tcur1 += delta;\t\t/* form error * 7 */\n\tbnexterr = cur2;\t/* Process component 2 */\n\tdelta = cur2 * 2;\n\tcur2 += delta;\t\t/* form error * 3 */\n\terrorptr[2] = (FSERROR) (bpreverr2 + cur2);\n\tcur2 += delta;\t\t/* form error * 5 */\n\tbpreverr2 = belowerr2 + cur2;\n\tbelowerr2 = bnexterr;\n\tcur2 += delta;\t\t/* form error * 7 */\n      }\n      /* At this point curN contains the 7/16 error value to be propagated\n       * to the next pixel on the current line, and all the errors for the\n       * next line have been shifted over.  We are therefore ready to move on.\n       */\n      inptr += dir3;\t\t/* Advance pixel pointers to next column */\n      outptr += dir;\n      errorptr += dir3;\t\t/* advance errorptr to current column */\n    }\n    /* Post-loop cleanup: we must unload the final error values into the\n     * final fserrors[] entry.  Note we need not unload belowerrN because\n     * it is for the dummy column before or after the actual array.\n     */\n    errorptr[0] = (FSERROR) bpreverr0; /* unload prev errs into array */\n    errorptr[1] = (FSERROR) bpreverr1;\n    errorptr[2] = (FSERROR) bpreverr2;\n  }\n}\n\n\n/*\n * Initialize the error-limiting transfer function (lookup table).\n * The raw F-S error computation can potentially compute error values of up to\n * +- MAXJSAMPLE.  But we want the maximum correction applied to a pixel to be\n * much less, otherwise obviously wrong pixels will be created.  (Typical\n * effects include weird fringes at color-area boundaries, isolated bright\n * pixels in a dark area, etc.)  The standard advice for avoiding this problem\n * is to ensure that the \"corners\" of the color cube are allocated as output\n * colors; then repeated errors in the same direction cannot cause cascading\n * error buildup.  However, that only prevents the error from getting\n * completely out of hand; Aaron Giles reports that error limiting improves\n * the results even with corner colors allocated.\n * A simple clamping of the error values to about +- MAXJSAMPLE/8 works pretty\n * well, but the smoother transfer function used below is even better.  Thanks\n * to Aaron Giles for this idea.\n */\n\nLOCAL(void)\ninit_error_limit (j_decompress_ptr cinfo)\n/* Allocate and fill in the error_limiter table */\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  int * table;\n  int in, out;\n\n  table = (int *) (*cinfo->mem->alloc_small)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE*2+1) * SIZEOF(int));\n  table += MAXJSAMPLE;\t\t/* so can index -MAXJSAMPLE .. +MAXJSAMPLE */\n  cquantize->error_limiter = table;\n\n#define STEPSIZE ((MAXJSAMPLE+1)/16)\n  /* Map errors 1:1 up to +- MAXJSAMPLE/16 */\n  out = 0;\n  for (in = 0; in < STEPSIZE; in++, out++) {\n    table[in] = out; table[-in] = -out;\n  }\n  /* Map errors 1:2 up to +- 3*MAXJSAMPLE/16 */\n  for (; in < STEPSIZE*3; in++, out += (in&1) ? 0 : 1) {\n    table[in] = out; table[-in] = -out;\n  }\n  /* Clamp the rest to final out value (which is (MAXJSAMPLE+1)/8) */\n  for (; in <= MAXJSAMPLE; in++) {\n    table[in] = out; table[-in] = -out;\n  }\n#undef STEPSIZE\n}\n\n\n/*\n * Finish up at the end of each pass.\n */\n\nMETHODDEF(void)\nfinish_pass1 (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n\n  /* Select the representative colors and fill in cinfo->colormap */\n  cinfo->colormap = cquantize->sv_colormap;\n  select_colors(cinfo, cquantize->desired);\n  /* Force next pass to zero the color index table */\n  cquantize->needs_zeroed = TRUE;\n}\n\n\nMETHODDEF(void)\nfinish_pass2 (j_decompress_ptr cinfo)\n{\n  /* no work */\n}\n\n\n/*\n * Initialize for each processing pass.\n */\n\nMETHODDEF(void)\nstart_pass_2_quant (j_decompress_ptr cinfo, boolean is_pre_scan)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n  hist3d histogram = cquantize->histogram;\n  int i;\n\n  /* Only F-S dithering or no dithering is supported. */\n  /* If user asks for ordered dither, give him F-S. */\n  if (cinfo->dither_mode != JDITHER_NONE)\n    cinfo->dither_mode = JDITHER_FS;\n\n  if (is_pre_scan) {\n    /* Set up method pointers */\n    cquantize->pub.color_quantize = prescan_quantize;\n    cquantize->pub.finish_pass = finish_pass1;\n    cquantize->needs_zeroed = TRUE; /* Always zero histogram */\n  } else {\n    /* Set up method pointers */\n    if (cinfo->dither_mode == JDITHER_FS)\n      cquantize->pub.color_quantize = pass2_fs_dither;\n    else\n      cquantize->pub.color_quantize = pass2_no_dither;\n    cquantize->pub.finish_pass = finish_pass2;\n\n    /* Make sure color count is acceptable */\n    i = cinfo->actual_number_of_colors;\n    if (i < 1)\n      ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 1);\n    if (i > MAXNUMCOLORS)\n      ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS);\n\n    if (cinfo->dither_mode == JDITHER_FS) {\n      size_t arraysize = (size_t) ((cinfo->output_width + 2) *\n\t\t\t\t   (3 * SIZEOF(FSERROR)));\n      /* Allocate Floyd-Steinberg workspace if we didn't already. */\n      if (cquantize->fserrors == NULL)\n\tcquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large)\n\t  ((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize);\n      /* Initialize the propagated errors to zero. */\n      jzero_far((void FAR *) cquantize->fserrors, arraysize);\n      /* Make the error-limit table if we didn't already. */\n      if (cquantize->error_limiter == NULL)\n\tinit_error_limit(cinfo);\n      cquantize->on_odd_row = FALSE;\n    }\n\n  }\n  /* Zero the histogram or inverse color map, if necessary */\n  if (cquantize->needs_zeroed) {\n    for (i = 0; i < HIST_C0_ELEMS; i++) {\n      jzero_far((void FAR *) histogram[i],\n\t\tHIST_C1_ELEMS*HIST_C2_ELEMS * SIZEOF(histcell));\n    }\n    cquantize->needs_zeroed = FALSE;\n  }\n}\n\n\n/*\n * Switch to a new external colormap between output passes.\n */\n\nMETHODDEF(void)\nnew_color_map_2_quant (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;\n\n  /* Reset the inverse color map */\n  cquantize->needs_zeroed = TRUE;\n}\n\n\n/*\n * Module initialization routine for 2-pass color quantization.\n */\n\nGLOBAL(void)\njinit_2pass_quantizer (j_decompress_ptr cinfo)\n{\n  my_cquantize_ptr cquantize;\n  int i;\n\n  cquantize = (my_cquantize_ptr)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\tSIZEOF(my_cquantizer));\n  cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize;\n  cquantize->pub.start_pass = start_pass_2_quant;\n  cquantize->pub.new_color_map = new_color_map_2_quant;\n  cquantize->fserrors = NULL;\t/* flag optional arrays not allocated */\n  cquantize->error_limiter = NULL;\n\n  /* Make sure jdmaster didn't give me a case I can't handle */\n  if (cinfo->out_color_components != 3)\n    ERREXIT(cinfo, JERR_NOTIMPL);\n\n  /* Allocate the histogram/inverse colormap storage */\n  cquantize->histogram = (hist3d) (*cinfo->mem->alloc_small)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, HIST_C0_ELEMS * SIZEOF(hist2d));\n  for (i = 0; i < HIST_C0_ELEMS; i++) {\n    cquantize->histogram[i] = (hist2d) (*cinfo->mem->alloc_large)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       HIST_C1_ELEMS*HIST_C2_ELEMS * SIZEOF(histcell));\n  }\n  cquantize->needs_zeroed = TRUE; /* histogram is garbage now */\n\n  /* Allocate storage for the completed colormap, if required.\n   * We do this now since it is FAR storage and may affect\n   * the memory manager's space calculations.\n   */\n  if (cinfo->enable_2pass_quant) {\n    /* Make sure color count is acceptable */\n    int desired = cinfo->desired_number_of_colors;\n    /* Lower bound on # of colors ... somewhat arbitrary as long as > 0 */\n    if (desired < 8)\n      ERREXIT1(cinfo, JERR_QUANT_FEW_COLORS, 8);\n    /* Make sure colormap indexes can be represented by JSAMPLEs */\n    if (desired > MAXNUMCOLORS)\n      ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS);\n    cquantize->sv_colormap = (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo,JPOOL_IMAGE, (JDIMENSION) desired, (JDIMENSION) 3);\n    cquantize->desired = desired;\n  } else\n    cquantize->sv_colormap = NULL;\n\n  /* Only F-S dithering or no dithering is supported. */\n  /* If user asks for ordered dither, give him F-S. */\n  if (cinfo->dither_mode != JDITHER_NONE)\n    cinfo->dither_mode = JDITHER_FS;\n\n  /* Allocate Floyd-Steinberg workspace if necessary.\n   * This isn't really needed until pass 2, but again it is FAR storage.\n   * Although we will cope with a later change in dither_mode,\n   * we do not promise to honor max_memory_to_use if dither_mode changes.\n   */\n  if (cinfo->dither_mode == JDITHER_FS) {\n    cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       (size_t) ((cinfo->output_width + 2) * (3 * SIZEOF(FSERROR))));\n    /* Might as well create the error-limiting table too. */\n    init_error_limit(cinfo);\n  }\n}\n\n#endif /* QUANT_2PASS_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/jsimd.h",
    "content": "/*\n * jsimd.h\n *\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright 2011 D. R. Commander\n * \n * Based on the x86 SIMD extension for IJG JPEG library,\n * Copyright (C) 1999-2006, MIYASAKA Masaru.\n * For conditions of distribution and use, see copyright notice in jsimdext.inc\n *\n */\n\n/* Short forms of external names for systems with brain-damaged linkers. */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jsimd_can_rgb_ycc                 jSCanRgbYcc\n#define jsimd_can_rgb_gray                jSCanRgbGry\n#define jsimd_can_ycc_rgb                 jSCanYccRgb\n#define jsimd_rgb_ycc_convert             jSRgbYccConv\n#define jsimd_rgb_gray_convert            jSRgbGryConv\n#define jsimd_ycc_rgb_convert             jSYccRgbConv\n#define jsimd_can_h2v2_downsample         jSCanH2V2Down\n#define jsimd_can_h2v1_downsample         jSCanH2V1Down\n#define jsimd_h2v2_downsample             jSH2V2Down\n#define jsimd_h2v1_downsample             jSH2V1Down\n#define jsimd_can_h2v2_upsample           jSCanH2V2Up\n#define jsimd_can_h2v1_upsample           jSCanH2V1Up\n#define jsimd_h2v2_upsample               jSH2V2Up\n#define jsimd_h2v1_upsample               jSH2V1Up\n#define jsimd_can_h2v2_fancy_upsample     jSCanH2V2FUp\n#define jsimd_can_h2v1_fancy_upsample     jSCanH2V1FUp\n#define jsimd_h2v2_fancy_upsample         jSH2V2FUp\n#define jsimd_h2v1_fancy_upsample         jSH2V1FUp\n#define jsimd_can_h2v2_merged_upsample    jSCanH2V2MUp\n#define jsimd_can_h2v1_merged_upsample    jSCanH2V1MUp\n#define jsimd_h2v2_merged_upsample        jSH2V2MUp\n#define jsimd_h2v1_merged_upsample        jSH2V1MUp\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\nEXTERN(int) jsimd_can_rgb_ycc JPP((void));\nEXTERN(int) jsimd_can_rgb_gray JPP((void));\nEXTERN(int) jsimd_can_ycc_rgb JPP((void));\n\nEXTERN(void) jsimd_rgb_ycc_convert\n        JPP((j_compress_ptr cinfo,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_rgb_gray_convert\n        JPP((j_compress_ptr cinfo,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_ycc_rgb_convert\n        JPP((j_decompress_ptr cinfo,\n             JSAMPIMAGE input_buf, JDIMENSION input_row,\n             JSAMPARRAY output_buf, int num_rows));\n\nEXTERN(int) jsimd_can_h2v2_downsample JPP((void));\nEXTERN(int) jsimd_can_h2v1_downsample JPP((void));\n\nEXTERN(void) jsimd_h2v2_downsample\n        JPP((j_compress_ptr cinfo, jpeg_component_info * compptr,\n             JSAMPARRAY input_data, JSAMPARRAY output_data));\nEXTERN(void) jsimd_h2v1_downsample\n        JPP((j_compress_ptr cinfo, jpeg_component_info * compptr,\n             JSAMPARRAY input_data, JSAMPARRAY output_data));\n\nEXTERN(int) jsimd_can_h2v2_upsample JPP((void));\nEXTERN(int) jsimd_can_h2v1_upsample JPP((void));\n\nEXTERN(void) jsimd_h2v2_upsample\n        JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n             JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));\nEXTERN(void) jsimd_h2v1_upsample\n        JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n             JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));\n\nEXTERN(int) jsimd_can_h2v2_fancy_upsample JPP((void));\nEXTERN(int) jsimd_can_h2v1_fancy_upsample JPP((void));\n\nEXTERN(void) jsimd_h2v2_fancy_upsample\n        JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n             JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));\nEXTERN(void) jsimd_h2v1_fancy_upsample\n        JPP((j_decompress_ptr cinfo, jpeg_component_info * compptr,\n             JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));\n\nEXTERN(int) jsimd_can_h2v2_merged_upsample JPP((void));\nEXTERN(int) jsimd_can_h2v1_merged_upsample JPP((void));\n\nEXTERN(void) jsimd_h2v2_merged_upsample\n        JPP((j_decompress_ptr cinfo,\n             JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,\n             JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v1_merged_upsample\n        JPP((j_decompress_ptr cinfo,\n             JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,\n             JSAMPARRAY output_buf));\n\n"
  },
  {
    "path": "ext/libjpeg-turbo/jsimd_none.c",
    "content": "/*\n * jsimd_none.c\n *\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright 2009-2011 D. R. Commander\n * \n * Based on the x86 SIMD extension for IJG JPEG library,\n * Copyright (C) 1999-2006, MIYASAKA Masaru.\n * For conditions of distribution and use, see copyright notice in jsimdext.inc\n *\n * This file contains stubs for when there is no SIMD support available.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"jsimd.h\"\n#include \"jdct.h\"\n#include \"jsimddct.h\"\n\nGLOBAL(int)\njsimd_can_rgb_ycc (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_rgb_gray (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_ycc_rgb (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_rgb_ycc_convert (j_compress_ptr cinfo,\n                       JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                       JDIMENSION output_row, int num_rows)\n{\n}\n\nGLOBAL(void)\njsimd_rgb_gray_convert (j_compress_ptr cinfo,\n                        JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                        JDIMENSION output_row, int num_rows)\n{\n}\n\nGLOBAL(void)\njsimd_ycc_rgb_convert (j_decompress_ptr cinfo,\n                       JSAMPIMAGE input_buf, JDIMENSION input_row,\n                       JSAMPARRAY output_buf, int num_rows)\n{\n}\n\nGLOBAL(int)\njsimd_can_h2v2_downsample (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_downsample (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,\n                       JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n}\n\nGLOBAL(void)\njsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,\n                       JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n}\n\nGLOBAL(int)\njsimd_can_h2v2_upsample (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_upsample (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_upsample (j_decompress_ptr cinfo,\n                     jpeg_component_info * compptr, \n                     JSAMPARRAY input_data,\n                     JSAMPARRAY * output_data_ptr)\n{\n}\n\nGLOBAL(void)\njsimd_h2v1_upsample (j_decompress_ptr cinfo,\n                     jpeg_component_info * compptr, \n                     JSAMPARRAY input_data,\n                     JSAMPARRAY * output_data_ptr)\n{\n}\n\nGLOBAL(int)\njsimd_can_h2v2_fancy_upsample (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_fancy_upsample (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo,\n                           jpeg_component_info * compptr, \n                           JSAMPARRAY input_data,\n                           JSAMPARRAY * output_data_ptr)\n{\n}\n\nGLOBAL(void)\njsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo,\n                           jpeg_component_info * compptr, \n                           JSAMPARRAY input_data,\n                           JSAMPARRAY * output_data_ptr)\n{\n}\n\nGLOBAL(int)\njsimd_can_h2v2_merged_upsample (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_merged_upsample (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,\n                            JSAMPIMAGE input_buf,\n                            JDIMENSION in_row_group_ctr,\n                            JSAMPARRAY output_buf)\n{\n}\n\nGLOBAL(void)\njsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,\n                            JSAMPIMAGE input_buf,\n                            JDIMENSION in_row_group_ctr,\n                            JSAMPARRAY output_buf)\n{\n}\n\nGLOBAL(int)\njsimd_can_convsamp (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_convsamp_float (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col,\n                DCTELEM * workspace)\n{\n}\n\nGLOBAL(void)\njsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col,\n                      FAST_FLOAT * workspace)\n{\n}\n\nGLOBAL(int)\njsimd_can_fdct_islow (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_fdct_ifast (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_fdct_float (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_fdct_islow (DCTELEM * data)\n{\n}\n\nGLOBAL(void)\njsimd_fdct_ifast (DCTELEM * data)\n{\n}\n\nGLOBAL(void)\njsimd_fdct_float (FAST_FLOAT * data)\n{\n}\n\nGLOBAL(int)\njsimd_can_quantize (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_quantize_float (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors,\n                DCTELEM * workspace)\n{\n}\n\nGLOBAL(void)\njsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors,\n                      FAST_FLOAT * workspace)\n{\n}\n\nGLOBAL(int)\njsimd_can_idct_2x2 (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_4x4 (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n}\n\nGLOBAL(void)\njsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n}\n\nGLOBAL(int)\njsimd_can_idct_islow (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_ifast (void)\n{\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_float (void)\n{\n  return 0;\n}\n\nGLOBAL(void)\njsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n}\n\nGLOBAL(void)\njsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n}\n\nGLOBAL(void)\njsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n}\n\n"
  },
  {
    "path": "ext/libjpeg-turbo/jsimddct.h",
    "content": "/*\n * jsimddct.h\n *\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * \n * Based on the x86 SIMD extension for IJG JPEG library,\n * Copyright (C) 1999-2006, MIYASAKA Masaru.\n * For conditions of distribution and use, see copyright notice in jsimdext.inc\n *\n */\n\n/* Short forms of external names for systems with brain-damaged linkers. */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jsimd_can_convsamp                jSCanConv\n#define jsimd_can_convsamp_float          jSCanConvF\n#define jsimd_convsamp                    jSConv\n#define jsimd_convsamp_float              jSConvF\n#define jsimd_can_fdct_islow              jSCanFDCTIS\n#define jsimd_can_fdct_ifast              jSCanFDCTIF\n#define jsimd_can_fdct_float              jSCanFDCTFl\n#define jsimd_fdct_islow                  jSFDCTIS\n#define jsimd_fdct_ifast                  jSFDCTIF\n#define jsimd_fdct_float                  jSFDCTFl\n#define jsimd_can_quantize                jSCanQuant\n#define jsimd_can_quantize_float          jSCanQuantF\n#define jsimd_quantize                    jSQuant\n#define jsimd_quantize_float              jSQuantF\n#define jsimd_can_idct_2x2                jSCanIDCT22\n#define jsimd_can_idct_4x4                jSCanIDCT44\n#define jsimd_idct_2x2                    jSIDCT22\n#define jsimd_idct_4x4                    jSIDCT44\n#define jsimd_can_idct_islow              jSCanIDCTIS\n#define jsimd_can_idct_ifast              jSCanIDCTIF\n#define jsimd_can_idct_float              jSCanIDCTFl\n#define jsimd_idct_islow                  jSIDCTIS\n#define jsimd_idct_ifast                  jSIDCTIF\n#define jsimd_idct_float                  jSIDCTFl\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\nEXTERN(int) jsimd_can_convsamp JPP((void));\nEXTERN(int) jsimd_can_convsamp_float JPP((void));\n\nEXTERN(void) jsimd_convsamp JPP((JSAMPARRAY sample_data,\n                                 JDIMENSION start_col,\n                                 DCTELEM * workspace));\nEXTERN(void) jsimd_convsamp_float JPP((JSAMPARRAY sample_data,\n                                       JDIMENSION start_col,\n                                       FAST_FLOAT * workspace));\n\nEXTERN(int) jsimd_can_fdct_islow JPP((void));\nEXTERN(int) jsimd_can_fdct_ifast JPP((void));\nEXTERN(int) jsimd_can_fdct_float JPP((void));\n\nEXTERN(void) jsimd_fdct_islow JPP((DCTELEM * data));\nEXTERN(void) jsimd_fdct_ifast JPP((DCTELEM * data));\nEXTERN(void) jsimd_fdct_float JPP((FAST_FLOAT * data));\n\nEXTERN(int) jsimd_can_quantize JPP((void));\nEXTERN(int) jsimd_can_quantize_float JPP((void));\n\nEXTERN(void) jsimd_quantize JPP((JCOEFPTR coef_block,\n                                 DCTELEM * divisors,\n                                 DCTELEM * workspace));\nEXTERN(void) jsimd_quantize_float JPP((JCOEFPTR coef_block,\n                                       FAST_FLOAT * divisors,\n                                       FAST_FLOAT * workspace));\n\nEXTERN(int) jsimd_can_idct_2x2 JPP((void));\nEXTERN(int) jsimd_can_idct_4x4 JPP((void));\n\nEXTERN(void) jsimd_idct_2x2 JPP((j_decompress_ptr cinfo,\n                                 jpeg_component_info * compptr,\n                                 JCOEFPTR coef_block,\n                                 JSAMPARRAY output_buf,\n                                 JDIMENSION output_col));\nEXTERN(void) jsimd_idct_4x4 JPP((j_decompress_ptr cinfo,\n                                 jpeg_component_info * compptr,\n                                 JCOEFPTR coef_block,\n                                 JSAMPARRAY output_buf,\n                                 JDIMENSION output_col));\n\nEXTERN(int) jsimd_can_idct_islow JPP((void));\nEXTERN(int) jsimd_can_idct_ifast JPP((void));\nEXTERN(int) jsimd_can_idct_float JPP((void));\n\nEXTERN(void) jsimd_idct_islow JPP((j_decompress_ptr cinfo,\n                                   jpeg_component_info * compptr,\n                                   JCOEFPTR coef_block,\n                                   JSAMPARRAY output_buf,\n                                   JDIMENSION output_col));\nEXTERN(void) jsimd_idct_ifast JPP((j_decompress_ptr cinfo,\n                                   jpeg_component_info * compptr,\n                                   JCOEFPTR coef_block,\n                                   JSAMPARRAY output_buf,\n                                   JDIMENSION output_col));\nEXTERN(void) jsimd_idct_float JPP((j_decompress_ptr cinfo,\n                                   jpeg_component_info * compptr,\n                                   JCOEFPTR coef_block,\n                                   JSAMPARRAY output_buf,\n                                   JDIMENSION output_col));\n\n"
  },
  {
    "path": "ext/libjpeg-turbo/jutils.c",
    "content": "/*\n * jutils.c\n *\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains tables and miscellaneous utility routines needed\n * for both compression and decompression.\n * Note we prefix all global names with \"j\" to minimize conflicts with\n * a surrounding application.\n */\n\n#define JPEG_INTERNALS\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n\n\n/*\n * jpeg_zigzag_order[i] is the zigzag-order position of the i'th element\n * of a DCT block read in natural order (left to right, top to bottom).\n */\n\n#if 0\t\t\t\t/* This table is not actually needed in v6a */\n\nconst int jpeg_zigzag_order[DCTSIZE2] = {\n   0,  1,  5,  6, 14, 15, 27, 28,\n   2,  4,  7, 13, 16, 26, 29, 42,\n   3,  8, 12, 17, 25, 30, 41, 43,\n   9, 11, 18, 24, 31, 40, 44, 53,\n  10, 19, 23, 32, 39, 45, 52, 54,\n  20, 22, 33, 38, 46, 51, 55, 60,\n  21, 34, 37, 47, 50, 56, 59, 61,\n  35, 36, 48, 49, 57, 58, 62, 63\n};\n\n#endif\n\n/*\n * jpeg_natural_order[i] is the natural-order position of the i'th element\n * of zigzag order.\n *\n * When reading corrupted data, the Huffman decoders could attempt\n * to reference an entry beyond the end of this array (if the decoded\n * zero run length reaches past the end of the block).  To prevent\n * wild stores without adding an inner-loop test, we put some extra\n * \"63\"s after the real entries.  This will cause the extra coefficient\n * to be stored in location 63 of the block, not somewhere random.\n * The worst case would be a run-length of 15, which means we need 16\n * fake entries.\n */\n\nconst int jpeg_natural_order[DCTSIZE2+16] = {\n  0,  1,  8, 16,  9,  2,  3, 10,\n 17, 24, 32, 25, 18, 11,  4,  5,\n 12, 19, 26, 33, 40, 48, 41, 34,\n 27, 20, 13,  6,  7, 14, 21, 28,\n 35, 42, 49, 56, 57, 50, 43, 36,\n 29, 22, 15, 23, 30, 37, 44, 51,\n 58, 59, 52, 45, 38, 31, 39, 46,\n 53, 60, 61, 54, 47, 55, 62, 63,\n 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */\n 63, 63, 63, 63, 63, 63, 63, 63\n};\n\n\n/*\n * Arithmetic utilities\n */\n\nGLOBAL(long)\njdiv_round_up (long a, long b)\n/* Compute a/b rounded up to next integer, ie, ceil(a/b) */\n/* Assumes a >= 0, b > 0 */\n{\n  return (a + b - 1L) / b;\n}\n\n\nGLOBAL(long)\njround_up (long a, long b)\n/* Compute a rounded up to next multiple of b, ie, ceil(a/b)*b */\n/* Assumes a >= 0, b > 0 */\n{\n  a += b - 1L;\n  return a - (a % b);\n}\n\n\n/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays\n * and coefficient-block arrays.  This won't work on 80x86 because the arrays\n * are FAR and we're assuming a small-pointer memory model.  However, some\n * DOS compilers provide far-pointer versions of memcpy() and memset() even\n * in the small-model libraries.  These will be used if USE_FMEM is defined.\n * Otherwise, the routines below do it the hard way.  (The performance cost\n * is not all that great, because these routines aren't very heavily used.)\n */\n\n#ifndef NEED_FAR_POINTERS\t/* normal case, same as regular macros */\n#define FMEMCOPY(dest,src,size)\tMEMCOPY(dest,src,size)\n#define FMEMZERO(target,size)\tMEMZERO(target,size)\n#else\t\t\t\t/* 80x86 case, define if we can */\n#ifdef USE_FMEM\n#define FMEMCOPY(dest,src,size)\t_fmemcpy((void FAR *)(dest), (const void FAR *)(src), (size_t)(size))\n#define FMEMZERO(target,size)\t_fmemset((void FAR *)(target), 0, (size_t)(size))\n#endif\n#endif\n\n\nGLOBAL(void)\njcopy_sample_rows (JSAMPARRAY input_array, int source_row,\n\t\t   JSAMPARRAY output_array, int dest_row,\n\t\t   int num_rows, JDIMENSION num_cols)\n/* Copy some rows of samples from one place to another.\n * num_rows rows are copied from input_array[source_row++]\n * to output_array[dest_row++]; these areas may overlap for duplication.\n * The source and destination arrays must be at least as wide as num_cols.\n */\n{\n  register JSAMPROW inptr, outptr;\n#ifdef FMEMCOPY\n  register size_t count = (size_t) (num_cols * SIZEOF(JSAMPLE));\n#else\n  register JDIMENSION count;\n#endif\n  register int row;\n\n  input_array += source_row;\n  output_array += dest_row;\n\n  for (row = num_rows; row > 0; row--) {\n    inptr = *input_array++;\n    outptr = *output_array++;\n#ifdef FMEMCOPY\n    FMEMCOPY(outptr, inptr, count);\n#else\n    for (count = num_cols; count > 0; count--)\n      *outptr++ = *inptr++;\t/* needn't bother with GETJSAMPLE() here */\n#endif\n  }\n}\n\n\nGLOBAL(void)\njcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row,\n\t\t JDIMENSION num_blocks)\n/* Copy a row of coefficient blocks from one place to another. */\n{\n#ifdef FMEMCOPY\n  FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF)));\n#else\n  register JCOEFPTR inptr, outptr;\n  register long count;\n\n  inptr = (JCOEFPTR) input_row;\n  outptr = (JCOEFPTR) output_row;\n  for (count = (long) num_blocks * DCTSIZE2; count > 0; count--) {\n    *outptr++ = *inptr++;\n  }\n#endif\n}\n\n\nGLOBAL(void)\njzero_far (void FAR * target, size_t bytestozero)\n/* Zero out a chunk of FAR memory. */\n/* This might be sample-array data, block-array data, or alloc_large data. */\n{\n#ifdef FMEMZERO\n  FMEMZERO(target, bytestozero);\n#else\n  register char FAR * ptr = (char FAR *) target;\n  register size_t count;\n\n  for (count = bytestozero; count > 0; count--) {\n    *ptr++ = 0;\n  }\n#endif\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/jversion.h",
    "content": "/*\n * jversion.h\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding.\n * Modifications:\n * Copyright (C) 2010, 2012-2014, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains software version identification.\n */\n\n\n#if JPEG_LIB_VERSION >= 80\n\n#define JVERSION\t\"8d  15-Jan-2012\"\n\n#elif JPEG_LIB_VERSION >= 70\n\n#define JVERSION\t\"7  27-Jun-2009\"\n\n#else\n\n#define JVERSION\t\"6b  27-Mar-1998\"\n\n#endif\n\n#define JCOPYRIGHT\t\"Copyright (C) 1991-2012 Thomas G. Lane, Guido Vollbeding\\n\" \\\n\t\t\t\"Copyright (C) 1999-2006 MIYASAKA Masaru\\n\" \\\n\t\t\t\"Copyright (C) 2009 Pierre Ossman for Cendio AB\\n\" \\\n\t\t\t\"Copyright (C) 2009-2014 D. R. Commander\\n\" \\\n\t\t\t\"Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\"\n"
  },
  {
    "path": "ext/libjpeg-turbo/libjpeg.map.in",
    "content": "LIBJPEGTURBO_@JPEG_LIB_VERSION_DECIMAL@ {\n  @MEM_SRCDST_FUNCTIONS@\n  local:\n    jsimd_*;\n    jconst_*;\n};\n\nLIBJPEG_@JPEG_LIB_VERSION_DECIMAL@ {\n  global:\n    *;\n};\n"
  },
  {
    "path": "ext/libjpeg-turbo/libjpeg.txt",
    "content": "USING THE IJG JPEG LIBRARY\n\nThis file was part of the Independent JPEG Group's software:\nCopyright (C) 1994-2011, Thomas G. Lane, Guido Vollbeding.\nModifications:\nCopyright (C) 2010, D. R. Commander.\nFor conditions of distribution and use, see the accompanying README file.\n\n\nThis file describes how to use the IJG JPEG library within an application\nprogram.  Read it if you want to write a program that uses the library.\n\nThe file example.c provides heavily commented skeleton code for calling the\nJPEG library.  Also see jpeglib.h (the include file to be used by application\nprograms) for full details about data structures and function parameter lists.\nThe library source code, of course, is the ultimate reference.\n\nNote that there have been *major* changes from the application interface\npresented by IJG version 4 and earlier versions.  The old design had several\ninherent limitations, and it had accumulated a lot of cruft as we added\nfeatures while trying to minimize application-interface changes.  We have\nsacrificed backward compatibility in the version 5 rewrite, but we think the\nimprovements justify this.\n\n\nTABLE OF CONTENTS\n-----------------\n\nOverview:\n\tFunctions provided by the library\n\tOutline of typical usage\nBasic library usage:\n\tData formats\n\tCompression details\n\tDecompression details\n\tMechanics of usage: include files, linking, etc\nAdvanced features:\n\tCompression parameter selection\n\tDecompression parameter selection\n\tSpecial color spaces\n\tError handling\n\tCompressed data handling (source and destination managers)\n\tI/O suspension\n\tProgressive JPEG support\n\tBuffered-image mode\n\tAbbreviated datastreams and multiple images\n\tSpecial markers\n\tRaw (downsampled) image data\n\tReally raw data: DCT coefficients\n\tProgress monitoring\n\tMemory management\n\tMemory usage\n\tLibrary compile-time options\n\tPortability considerations\n\tNotes for MS-DOS implementors\n\nYou should read at least the overview and basic usage sections before trying\nto program with the library.  The sections on advanced features can be read\nif and when you need them.\n\n\nOVERVIEW\n========\n\nFunctions provided by the library\n---------------------------------\n\nThe IJG JPEG library provides C code to read and write JPEG-compressed image\nfiles.  The surrounding application program receives or supplies image data a\nscanline at a time, using a straightforward uncompressed image format.  All\ndetails of color conversion and other preprocessing/postprocessing can be\nhandled by the library.\n\nThe library includes a substantial amount of code that is not covered by the\nJPEG standard but is necessary for typical applications of JPEG.  These\nfunctions preprocess the image before JPEG compression or postprocess it after\ndecompression.  They include colorspace conversion, downsampling/upsampling,\nand color quantization.  The application indirectly selects use of this code\nby specifying the format in which it wishes to supply or receive image data.\nFor example, if colormapped output is requested, then the decompression\nlibrary automatically invokes color quantization.\n\nA wide range of quality vs. speed tradeoffs are possible in JPEG processing,\nand even more so in decompression postprocessing.  The decompression library\nprovides multiple implementations that cover most of the useful tradeoffs,\nranging from very-high-quality down to fast-preview operation.  On the\ncompression side we have generally not provided low-quality choices, since\ncompression is normally less time-critical.  It should be understood that the\nlow-quality modes may not meet the JPEG standard's accuracy requirements;\nnonetheless, they are useful for viewers.\n\nA word about functions *not* provided by the library.  We handle a subset of\nthe ISO JPEG standard; most baseline, extended-sequential, and progressive\nJPEG processes are supported.  (Our subset includes all features now in common\nuse.)  Unsupported ISO options include:\n\t* Hierarchical storage\n\t* Lossless JPEG\n\t* DNL marker\n\t* Nonintegral subsampling ratios\nWe support both 8- and 12-bit data precision, but this is a compile-time\nchoice rather than a run-time choice; hence it is difficult to use both\nprecisions in a single application.\n\nBy itself, the library handles only interchange JPEG datastreams --- in\nparticular the widely used JFIF file format.  The library can be used by\nsurrounding code to process interchange or abbreviated JPEG datastreams that\nare embedded in more complex file formats.  (For example, this library is\nused by the free LIBTIFF library to support JPEG compression in TIFF.)\n\n\nOutline of typical usage\n------------------------\n\nThe rough outline of a JPEG compression operation is:\n\n\tAllocate and initialize a JPEG compression object\n\tSpecify the destination for the compressed data (eg, a file)\n\tSet parameters for compression, including image size & colorspace\n\tjpeg_start_compress(...);\n\twhile (scan lines remain to be written)\n\t\tjpeg_write_scanlines(...);\n\tjpeg_finish_compress(...);\n\tRelease the JPEG compression object\n\nA JPEG compression object holds parameters and working state for the JPEG\nlibrary.  We make creation/destruction of the object separate from starting\nor finishing compression of an image; the same object can be re-used for a\nseries of image compression operations.  This makes it easy to re-use the\nsame parameter settings for a sequence of images.  Re-use of a JPEG object\nalso has important implications for processing abbreviated JPEG datastreams,\nas discussed later.\n\nThe image data to be compressed is supplied to jpeg_write_scanlines() from\nin-memory buffers.  If the application is doing file-to-file compression,\nreading image data from the source file is the application's responsibility.\nThe library emits compressed data by calling a \"data destination manager\",\nwhich typically will write the data into a file; but the application can\nprovide its own destination manager to do something else.\n\nSimilarly, the rough outline of a JPEG decompression operation is:\n\n\tAllocate and initialize a JPEG decompression object\n\tSpecify the source of the compressed data (eg, a file)\n\tCall jpeg_read_header() to obtain image info\n\tSet parameters for decompression\n\tjpeg_start_decompress(...);\n\twhile (scan lines remain to be read)\n\t\tjpeg_read_scanlines(...);\n\tjpeg_finish_decompress(...);\n\tRelease the JPEG decompression object\n\nThis is comparable to the compression outline except that reading the\ndatastream header is a separate step.  This is helpful because information\nabout the image's size, colorspace, etc is available when the application\nselects decompression parameters.  For example, the application can choose an\noutput scaling ratio that will fit the image into the available screen size.\n\nThe decompression library obtains compressed data by calling a data source\nmanager, which typically will read the data from a file; but other behaviors\ncan be obtained with a custom source manager.  Decompressed data is delivered\ninto in-memory buffers passed to jpeg_read_scanlines().\n\nIt is possible to abort an incomplete compression or decompression operation\nby calling jpeg_abort(); or, if you do not need to retain the JPEG object,\nsimply release it by calling jpeg_destroy().\n\nJPEG compression and decompression objects are two separate struct types.\nHowever, they share some common fields, and certain routines such as\njpeg_destroy() can work on either type of object.\n\nThe JPEG library has no static variables: all state is in the compression\nor decompression object.  Therefore it is possible to process multiple\ncompression and decompression operations concurrently, using multiple JPEG\nobjects.\n\nBoth compression and decompression can be done in an incremental memory-to-\nmemory fashion, if suitable source/destination managers are used.  See the\nsection on \"I/O suspension\" for more details.\n\n\nBASIC LIBRARY USAGE\n===================\n\nData formats\n------------\n\nBefore diving into procedural details, it is helpful to understand the\nimage data format that the JPEG library expects or returns.\n\nThe standard input image format is a rectangular array of pixels, with each\npixel having the same number of \"component\" or \"sample\" values (color\nchannels).  You must specify how many components there are and the colorspace\ninterpretation of the components.  Most applications will use RGB data\n(three components per pixel) or grayscale data (one component per pixel).\nPLEASE NOTE THAT RGB DATA IS THREE SAMPLES PER PIXEL, GRAYSCALE ONLY ONE.\nA remarkable number of people manage to miss this, only to find that their\nprograms don't work with grayscale JPEG files.\n\nThere is no provision for colormapped input.  JPEG files are always full-color\nor full grayscale (or sometimes another colorspace such as CMYK).  You can\nfeed in a colormapped image by expanding it to full-color format.  However\nJPEG often doesn't work very well with source data that has been colormapped,\nbecause of dithering noise.  This is discussed in more detail in the JPEG FAQ\nand the other references mentioned in the README file.\n\nPixels are stored by scanlines, with each scanline running from left to\nright.  The component values for each pixel are adjacent in the row; for\nexample, R,G,B,R,G,B,R,G,B,... for 24-bit RGB color.  Each scanline is an\narray of data type JSAMPLE --- which is typically \"unsigned char\", unless\nyou've changed jmorecfg.h.  (You can also change the RGB pixel layout, say\nto B,G,R order, by modifying jmorecfg.h.  But see the restrictions listed in\nthat file before doing so.)\n\nA 2-D array of pixels is formed by making a list of pointers to the starts of\nscanlines; so the scanlines need not be physically adjacent in memory.  Even\nif you process just one scanline at a time, you must make a one-element\npointer array to conform to this structure.  Pointers to JSAMPLE rows are of\ntype JSAMPROW, and the pointer to the pointer array is of type JSAMPARRAY.\n\nThe library accepts or supplies one or more complete scanlines per call.\nIt is not possible to process part of a row at a time.  Scanlines are always\nprocessed top-to-bottom.  You can process an entire image in one call if you\nhave it all in memory, but usually it's simplest to process one scanline at\na time.\n\nFor best results, source data values should have the precision specified by\nBITS_IN_JSAMPLE (normally 8 bits).  For instance, if you choose to compress\ndata that's only 6 bits/channel, you should left-justify each value in a\nbyte before passing it to the compressor.  If you need to compress data\nthat has more than 8 bits/channel, compile with BITS_IN_JSAMPLE = 12.\n(See \"Library compile-time options\", later.)\n\n\nThe data format returned by the decompressor is the same in all details,\nexcept that colormapped output is supported.  (Again, a JPEG file is never\ncolormapped.  But you can ask the decompressor to perform on-the-fly color\nquantization to deliver colormapped output.)  If you request colormapped\noutput then the returned data array contains a single JSAMPLE per pixel;\nits value is an index into a color map.  The color map is represented as\na 2-D JSAMPARRAY in which each row holds the values of one color component,\nthat is, colormap[i][j] is the value of the i'th color component for pixel\nvalue (map index) j.  Note that since the colormap indexes are stored in\nJSAMPLEs, the maximum number of colors is limited by the size of JSAMPLE\n(ie, at most 256 colors for an 8-bit JPEG library).\n\n\nCompression details\n-------------------\n\nHere we revisit the JPEG compression outline given in the overview.\n\n1. Allocate and initialize a JPEG compression object.\n\nA JPEG compression object is a \"struct jpeg_compress_struct\".  (It also has\na bunch of subsidiary structures which are allocated via malloc(), but the\napplication doesn't control those directly.)  This struct can be just a local\nvariable in the calling routine, if a single routine is going to execute the\nwhole JPEG compression sequence.  Otherwise it can be static or allocated\nfrom malloc().\n\nYou will also need a structure representing a JPEG error handler.  The part\nof this that the library cares about is a \"struct jpeg_error_mgr\".  If you\nare providing your own error handler, you'll typically want to embed the\njpeg_error_mgr struct in a larger structure; this is discussed later under\n\"Error handling\".  For now we'll assume you are just using the default error\nhandler.  The default error handler will print JPEG error/warning messages\non stderr, and it will call exit() if a fatal error occurs.\n\nYou must initialize the error handler structure, store a pointer to it into\nthe JPEG object's \"err\" field, and then call jpeg_create_compress() to\ninitialize the rest of the JPEG object.\n\nTypical code for this step, if you are using the default error handler, is\n\n\tstruct jpeg_compress_struct cinfo;\n\tstruct jpeg_error_mgr jerr;\n\t...\n\tcinfo.err = jpeg_std_error(&jerr);\n\tjpeg_create_compress(&cinfo);\n\njpeg_create_compress allocates a small amount of memory, so it could fail\nif you are out of memory.  In that case it will exit via the error handler;\nthat's why the error handler must be initialized first.\n\n\n2. Specify the destination for the compressed data (eg, a file).\n\nAs previously mentioned, the JPEG library delivers compressed data to a\n\"data destination\" module.  The library includes one data destination\nmodule which knows how to write to a stdio stream.  You can use your own\ndestination module if you want to do something else, as discussed later.\n\nIf you use the standard destination module, you must open the target stdio\nstream beforehand.  Typical code for this step looks like:\n\n\tFILE * outfile;\n\t...\n\tif ((outfile = fopen(filename, \"wb\")) == NULL) {\n\t    fprintf(stderr, \"can't open %s\\n\", filename);\n\t    exit(1);\n\t}\n\tjpeg_stdio_dest(&cinfo, outfile);\n\nwhere the last line invokes the standard destination module.\n\nWARNING: it is critical that the binary compressed data be delivered to the\noutput file unchanged.  On non-Unix systems the stdio library may perform\nnewline translation or otherwise corrupt binary data.  To suppress this\nbehavior, you may need to use a \"b\" option to fopen (as shown above), or use\nsetmode() or another routine to put the stdio stream in binary mode.  See\ncjpeg.c and djpeg.c for code that has been found to work on many systems.\n\nYou can select the data destination after setting other parameters (step 3),\nif that's more convenient.  You may not change the destination between\ncalling jpeg_start_compress() and jpeg_finish_compress().\n\n\n3. Set parameters for compression, including image size & colorspace.\n\nYou must supply information about the source image by setting the following\nfields in the JPEG object (cinfo structure):\n\n\timage_width\t\tWidth of image, in pixels\n\timage_height\t\tHeight of image, in pixels\n\tinput_components\tNumber of color channels (samples per pixel)\n\tin_color_space\t\tColor space of source image\n\nThe image dimensions are, hopefully, obvious.  JPEG supports image dimensions\nof 1 to 64K pixels in either direction.  The input color space is typically\nRGB or grayscale, and input_components is 3 or 1 accordingly.  (See \"Special\ncolor spaces\", later, for more info.)  The in_color_space field must be\nassigned one of the J_COLOR_SPACE enum constants, typically JCS_RGB or\nJCS_GRAYSCALE.\n\nJPEG has a large number of compression parameters that determine how the\nimage is encoded.  Most applications don't need or want to know about all\nthese parameters.  You can set all the parameters to reasonable defaults by\ncalling jpeg_set_defaults(); then, if there are particular values you want\nto change, you can do so after that.  The \"Compression parameter selection\"\nsection tells about all the parameters.\n\nYou must set in_color_space correctly before calling jpeg_set_defaults(),\nbecause the defaults depend on the source image colorspace.  However the\nother three source image parameters need not be valid until you call\njpeg_start_compress().  There's no harm in calling jpeg_set_defaults() more\nthan once, if that happens to be convenient.\n\nTypical code for a 24-bit RGB source image is\n\n\tcinfo.image_width = Width; \t/* image width and height, in pixels */\n\tcinfo.image_height = Height;\n\tcinfo.input_components = 3;\t/* # of color components per pixel */\n\tcinfo.in_color_space = JCS_RGB; /* colorspace of input image */\n\n\tjpeg_set_defaults(&cinfo);\n\t/* Make optional parameter settings here */\n\n\n4. jpeg_start_compress(...);\n\nAfter you have established the data destination and set all the necessary\nsource image info and other parameters, call jpeg_start_compress() to begin\na compression cycle.  This will initialize internal state, allocate working\nstorage, and emit the first few bytes of the JPEG datastream header.\n\nTypical code:\n\n\tjpeg_start_compress(&cinfo, TRUE);\n\nThe \"TRUE\" parameter ensures that a complete JPEG interchange datastream\nwill be written.  This is appropriate in most cases.  If you think you might\nwant to use an abbreviated datastream, read the section on abbreviated\ndatastreams, below.\n\nOnce you have called jpeg_start_compress(), you may not alter any JPEG\nparameters or other fields of the JPEG object until you have completed\nthe compression cycle.\n\n\n5. while (scan lines remain to be written)\n\tjpeg_write_scanlines(...);\n\nNow write all the required image data by calling jpeg_write_scanlines()\none or more times.  You can pass one or more scanlines in each call, up\nto the total image height.  In most applications it is convenient to pass\njust one or a few scanlines at a time.  The expected format for the passed\ndata is discussed under \"Data formats\", above.\n\nImage data should be written in top-to-bottom scanline order.  The JPEG spec\ncontains some weasel wording about how top and bottom are application-defined\nterms (a curious interpretation of the English language...) but if you want\nyour files to be compatible with everyone else's, you WILL use top-to-bottom\norder.  If the source data must be read in bottom-to-top order, you can use\nthe JPEG library's virtual array mechanism to invert the data efficiently.\nExamples of this can be found in the sample application cjpeg.\n\nThe library maintains a count of the number of scanlines written so far\nin the next_scanline field of the JPEG object.  Usually you can just use\nthis variable as the loop counter, so that the loop test looks like\n\"while (cinfo.next_scanline < cinfo.image_height)\".\n\nCode for this step depends heavily on the way that you store the source data.\nexample.c shows the following code for the case of a full-size 2-D source\narray containing 3-byte RGB pixels:\n\n\tJSAMPROW row_pointer[1];\t/* pointer to a single row */\n\tint row_stride;\t\t\t/* physical row width in buffer */\n\n\trow_stride = image_width * 3;\t/* JSAMPLEs per row in image_buffer */\n\n\twhile (cinfo.next_scanline < cinfo.image_height) {\n\t    row_pointer[0] = & image_buffer[cinfo.next_scanline * row_stride];\n\t    jpeg_write_scanlines(&cinfo, row_pointer, 1);\n\t}\n\njpeg_write_scanlines() returns the number of scanlines actually written.\nThis will normally be equal to the number passed in, so you can usually\nignore the return value.  It is different in just two cases:\n  * If you try to write more scanlines than the declared image height,\n    the additional scanlines are ignored.\n  * If you use a suspending data destination manager, output buffer overrun\n    will cause the compressor to return before accepting all the passed lines.\n    This feature is discussed under \"I/O suspension\", below.  The normal\n    stdio destination manager will NOT cause this to happen.\nIn any case, the return value is the same as the change in the value of\nnext_scanline.\n\n\n6. jpeg_finish_compress(...);\n\nAfter all the image data has been written, call jpeg_finish_compress() to\ncomplete the compression cycle.  This step is ESSENTIAL to ensure that the\nlast bufferload of data is written to the data destination.\njpeg_finish_compress() also releases working memory associated with the JPEG\nobject.\n\nTypical code:\n\n\tjpeg_finish_compress(&cinfo);\n\nIf using the stdio destination manager, don't forget to close the output\nstdio stream (if necessary) afterwards.\n\nIf you have requested a multi-pass operating mode, such as Huffman code\noptimization, jpeg_finish_compress() will perform the additional passes using\ndata buffered by the first pass.  In this case jpeg_finish_compress() may take\nquite a while to complete.  With the default compression parameters, this will\nnot happen.\n\nIt is an error to call jpeg_finish_compress() before writing the necessary\ntotal number of scanlines.  If you wish to abort compression, call\njpeg_abort() as discussed below.\n\nAfter completing a compression cycle, you may dispose of the JPEG object\nas discussed next, or you may use it to compress another image.  In that case\nreturn to step 2, 3, or 4 as appropriate.  If you do not change the\ndestination manager, the new datastream will be written to the same target.\nIf you do not change any JPEG parameters, the new datastream will be written\nwith the same parameters as before.  Note that you can change the input image\ndimensions freely between cycles, but if you change the input colorspace, you\nshould call jpeg_set_defaults() to adjust for the new colorspace; and then\nyou'll need to repeat all of step 3.\n\n\n7. Release the JPEG compression object.\n\nWhen you are done with a JPEG compression object, destroy it by calling\njpeg_destroy_compress().  This will free all subsidiary memory (regardless of\nthe previous state of the object).  Or you can call jpeg_destroy(), which\nworks for either compression or decompression objects --- this may be more\nconvenient if you are sharing code between compression and decompression\ncases.  (Actually, these routines are equivalent except for the declared type\nof the passed pointer.  To avoid gripes from ANSI C compilers, jpeg_destroy()\nshould be passed a j_common_ptr.)\n\nIf you allocated the jpeg_compress_struct structure from malloc(), freeing\nit is your responsibility --- jpeg_destroy() won't.  Ditto for the error\nhandler structure.\n\nTypical code:\n\n\tjpeg_destroy_compress(&cinfo);\n\n\n8. Aborting.\n\nIf you decide to abort a compression cycle before finishing, you can clean up\nin either of two ways:\n\n* If you don't need the JPEG object any more, just call\n  jpeg_destroy_compress() or jpeg_destroy() to release memory.  This is\n  legitimate at any point after calling jpeg_create_compress() --- in fact,\n  it's safe even if jpeg_create_compress() fails.\n\n* If you want to re-use the JPEG object, call jpeg_abort_compress(), or call\n  jpeg_abort() which works on both compression and decompression objects.\n  This will return the object to an idle state, releasing any working memory.\n  jpeg_abort() is allowed at any time after successful object creation.\n\nNote that cleaning up the data destination, if required, is your\nresponsibility; neither of these routines will call term_destination().\n(See \"Compressed data handling\", below, for more about that.)\n\njpeg_destroy() and jpeg_abort() are the only safe calls to make on a JPEG\nobject that has reported an error by calling error_exit (see \"Error handling\"\nfor more info).  The internal state of such an object is likely to be out of\nwhack.  Either of these two routines will return the object to a known state.\n\n\nDecompression details\n---------------------\n\nHere we revisit the JPEG decompression outline given in the overview.\n\n1. Allocate and initialize a JPEG decompression object.\n\nThis is just like initialization for compression, as discussed above,\nexcept that the object is a \"struct jpeg_decompress_struct\" and you\ncall jpeg_create_decompress().  Error handling is exactly the same.\n\nTypical code:\n\n\tstruct jpeg_decompress_struct cinfo;\n\tstruct jpeg_error_mgr jerr;\n\t...\n\tcinfo.err = jpeg_std_error(&jerr);\n\tjpeg_create_decompress(&cinfo);\n\n(Both here and in the IJG code, we usually use variable name \"cinfo\" for\nboth compression and decompression objects.)\n\n\n2. Specify the source of the compressed data (eg, a file).\n\nAs previously mentioned, the JPEG library reads compressed data from a \"data\nsource\" module.  The library includes one data source module which knows how\nto read from a stdio stream.  You can use your own source module if you want\nto do something else, as discussed later.\n\nIf you use the standard source module, you must open the source stdio stream\nbeforehand.  Typical code for this step looks like:\n\n\tFILE * infile;\n\t...\n\tif ((infile = fopen(filename, \"rb\")) == NULL) {\n\t    fprintf(stderr, \"can't open %s\\n\", filename);\n\t    exit(1);\n\t}\n\tjpeg_stdio_src(&cinfo, infile);\n\nwhere the last line invokes the standard source module.\n\nWARNING: it is critical that the binary compressed data be read unchanged.\nOn non-Unix systems the stdio library may perform newline translation or\notherwise corrupt binary data.  To suppress this behavior, you may need to use\na \"b\" option to fopen (as shown above), or use setmode() or another routine to\nput the stdio stream in binary mode.  See cjpeg.c and djpeg.c for code that\nhas been found to work on many systems.\n\nYou may not change the data source between calling jpeg_read_header() and\njpeg_finish_decompress().  If you wish to read a series of JPEG images from\na single source file, you should repeat the jpeg_read_header() to\njpeg_finish_decompress() sequence without reinitializing either the JPEG\nobject or the data source module; this prevents buffered input data from\nbeing discarded.\n\n\n3. Call jpeg_read_header() to obtain image info.\n\nTypical code for this step is just\n\n\tjpeg_read_header(&cinfo, TRUE);\n\nThis will read the source datastream header markers, up to the beginning\nof the compressed data proper.  On return, the image dimensions and other\ninfo have been stored in the JPEG object.  The application may wish to\nconsult this information before selecting decompression parameters.\n\nMore complex code is necessary if\n  * A suspending data source is used --- in that case jpeg_read_header()\n    may return before it has read all the header data.  See \"I/O suspension\",\n    below.  The normal stdio source manager will NOT cause this to happen.\n  * Abbreviated JPEG files are to be processed --- see the section on\n    abbreviated datastreams.  Standard applications that deal only in\n    interchange JPEG files need not be concerned with this case either.\n\nIt is permissible to stop at this point if you just wanted to find out the\nimage dimensions and other header info for a JPEG file.  In that case,\ncall jpeg_destroy() when you are done with the JPEG object, or call\njpeg_abort() to return it to an idle state before selecting a new data\nsource and reading another header.\n\n\n4. Set parameters for decompression.\n\njpeg_read_header() sets appropriate default decompression parameters based on\nthe properties of the image (in particular, its colorspace).  However, you\nmay well want to alter these defaults before beginning the decompression.\nFor example, the default is to produce full color output from a color file.\nIf you want colormapped output you must ask for it.  Other options allow the\nreturned image to be scaled and allow various speed/quality tradeoffs to be\nselected.  \"Decompression parameter selection\", below, gives details.\n\nIf the defaults are appropriate, nothing need be done at this step.\n\nNote that all default values are set by each call to jpeg_read_header().\nIf you reuse a decompression object, you cannot expect your parameter\nsettings to be preserved across cycles, as you can for compression.\nYou must set desired parameter values each time.\n\n\n5. jpeg_start_decompress(...);\n\nOnce the parameter values are satisfactory, call jpeg_start_decompress() to\nbegin decompression.  This will initialize internal state, allocate working\nmemory, and prepare for returning data.\n\nTypical code is just\n\n\tjpeg_start_decompress(&cinfo);\n\nIf you have requested a multi-pass operating mode, such as 2-pass color\nquantization, jpeg_start_decompress() will do everything needed before data\noutput can begin.  In this case jpeg_start_decompress() may take quite a while\nto complete.  With a single-scan (non progressive) JPEG file and default\ndecompression parameters, this will not happen; jpeg_start_decompress() will\nreturn quickly.\n\nAfter this call, the final output image dimensions, including any requested\nscaling, are available in the JPEG object; so is the selected colormap, if\ncolormapped output has been requested.  Useful fields include\n\n\toutput_width\t\timage width and height, as scaled\n\toutput_height\n\tout_color_components\t# of color components in out_color_space\n\toutput_components\t# of color components returned per pixel\n\tcolormap\t\tthe selected colormap, if any\n\tactual_number_of_colors\t\tnumber of entries in colormap\n\noutput_components is 1 (a colormap index) when quantizing colors; otherwise it\nequals out_color_components.  It is the number of JSAMPLE values that will be\nemitted per pixel in the output arrays.\n\nTypically you will need to allocate data buffers to hold the incoming image.\nYou will need output_width * output_components JSAMPLEs per scanline in your\noutput buffer, and a total of output_height scanlines will be returned.\n\nNote: if you are using the JPEG library's internal memory manager to allocate\ndata buffers (as djpeg does), then the manager's protocol requires that you\nrequest large buffers *before* calling jpeg_start_decompress().  This is a\nlittle tricky since the output_XXX fields are not normally valid then.  You\ncan make them valid by calling jpeg_calc_output_dimensions() after setting the\nrelevant parameters (scaling, output color space, and quantization flag).\n\n\n6. while (scan lines remain to be read)\n\tjpeg_read_scanlines(...);\n\nNow you can read the decompressed image data by calling jpeg_read_scanlines()\none or more times.  At each call, you pass in the maximum number of scanlines\nto be read (ie, the height of your working buffer); jpeg_read_scanlines()\nwill return up to that many lines.  The return value is the number of lines\nactually read.  The format of the returned data is discussed under \"Data\nformats\", above.  Don't forget that grayscale and color JPEGs will return\ndifferent data formats!\n\nImage data is returned in top-to-bottom scanline order.  If you must write\nout the image in bottom-to-top order, you can use the JPEG library's virtual\narray mechanism to invert the data efficiently.  Examples of this can be\nfound in the sample application djpeg.\n\nThe library maintains a count of the number of scanlines returned so far\nin the output_scanline field of the JPEG object.  Usually you can just use\nthis variable as the loop counter, so that the loop test looks like\n\"while (cinfo.output_scanline < cinfo.output_height)\".  (Note that the test\nshould NOT be against image_height, unless you never use scaling.  The\nimage_height field is the height of the original unscaled image.)\nThe return value always equals the change in the value of output_scanline.\n\nIf you don't use a suspending data source, it is safe to assume that\njpeg_read_scanlines() reads at least one scanline per call, until the\nbottom of the image has been reached.\n\nIf you use a buffer larger than one scanline, it is NOT safe to assume that\njpeg_read_scanlines() fills it.  (The current implementation returns only a\nfew scanlines per call, no matter how large a buffer you pass.)  So you must\nalways provide a loop that calls jpeg_read_scanlines() repeatedly until the\nwhole image has been read.\n\n\n7. jpeg_finish_decompress(...);\n\nAfter all the image data has been read, call jpeg_finish_decompress() to\ncomplete the decompression cycle.  This causes working memory associated\nwith the JPEG object to be released.\n\nTypical code:\n\n\tjpeg_finish_decompress(&cinfo);\n\nIf using the stdio source manager, don't forget to close the source stdio\nstream if necessary.\n\nIt is an error to call jpeg_finish_decompress() before reading the correct\ntotal number of scanlines.  If you wish to abort decompression, call\njpeg_abort() as discussed below.\n\nAfter completing a decompression cycle, you may dispose of the JPEG object as\ndiscussed next, or you may use it to decompress another image.  In that case\nreturn to step 2 or 3 as appropriate.  If you do not change the source\nmanager, the next image will be read from the same source.\n\n\n8. Release the JPEG decompression object.\n\nWhen you are done with a JPEG decompression object, destroy it by calling\njpeg_destroy_decompress() or jpeg_destroy().  The previous discussion of\ndestroying compression objects applies here too.\n\nTypical code:\n\n\tjpeg_destroy_decompress(&cinfo);\n\n\n9. Aborting.\n\nYou can abort a decompression cycle by calling jpeg_destroy_decompress() or\njpeg_destroy() if you don't need the JPEG object any more, or\njpeg_abort_decompress() or jpeg_abort() if you want to reuse the object.\nThe previous discussion of aborting compression cycles applies here too.\n\n\nMechanics of usage: include files, linking, etc\n-----------------------------------------------\n\nApplications using the JPEG library should include the header file jpeglib.h\nto obtain declarations of data types and routines.  Before including\njpeglib.h, include system headers that define at least the typedefs FILE and\nsize_t.  On ANSI-conforming systems, including <stdio.h> is sufficient; on\nolder Unix systems, you may need <sys/types.h> to define size_t.\n\nIf the application needs to refer to individual JPEG library error codes, also\ninclude jerror.h to define those symbols.\n\njpeglib.h indirectly includes the files jconfig.h and jmorecfg.h.  If you are\ninstalling the JPEG header files in a system directory, you will want to\ninstall all four files: jpeglib.h, jerror.h, jconfig.h, jmorecfg.h.\n\nThe most convenient way to include the JPEG code into your executable program\nis to prepare a library file (\"libjpeg.a\", or a corresponding name on non-Unix\nmachines) and reference it at your link step.  If you use only half of the\nlibrary (only compression or only decompression), only that much code will be\nincluded from the library, unless your linker is hopelessly brain-damaged.\nThe supplied makefiles build libjpeg.a automatically (see install.txt).\n\nWhile you can build the JPEG library as a shared library if the whim strikes\nyou, we don't really recommend it.  The trouble with shared libraries is that\nat some point you'll probably try to substitute a new version of the library\nwithout recompiling the calling applications.  That generally doesn't work\nbecause the parameter struct declarations usually change with each new\nversion.  In other words, the library's API is *not* guaranteed binary\ncompatible across versions; we only try to ensure source-code compatibility.\n(In hindsight, it might have been smarter to hide the parameter structs from\napplications and introduce a ton of access functions instead.  Too late now,\nhowever.)\n\nOn some systems your application may need to set up a signal handler to ensure\nthat temporary files are deleted if the program is interrupted.  This is most\ncritical if you are on MS-DOS and use the jmemdos.c memory manager back end;\nit will try to grab extended memory for temp files, and that space will NOT be\nfreed automatically.  See cjpeg.c or djpeg.c for an example signal handler.\n\nIt may be worth pointing out that the core JPEG library does not actually\nrequire the stdio library: only the default source/destination managers and\nerror handler need it.  You can use the library in a stdio-less environment\nif you replace those modules and use jmemnobs.c (or another memory manager of\nyour own devising).  More info about the minimum system library requirements\nmay be found in jinclude.h.\n\n\nADVANCED FEATURES\n=================\n\nCompression parameter selection\n-------------------------------\n\nThis section describes all the optional parameters you can set for JPEG\ncompression, as well as the \"helper\" routines provided to assist in this\ntask.  Proper setting of some parameters requires detailed understanding\nof the JPEG standard; if you don't know what a parameter is for, it's best\nnot to mess with it!  See REFERENCES in the README file for pointers to\nmore info about JPEG.\n\nIt's a good idea to call jpeg_set_defaults() first, even if you plan to set\nall the parameters; that way your code is more likely to work with future JPEG\nlibraries that have additional parameters.  For the same reason, we recommend\nyou use a helper routine where one is provided, in preference to twiddling\ncinfo fields directly.\n\nThe helper routines are:\n\njpeg_set_defaults (j_compress_ptr cinfo)\n\tThis routine sets all JPEG parameters to reasonable defaults, using\n\tonly the input image's color space (field in_color_space, which must\n\talready be set in cinfo).  Many applications will only need to use\n\tthis routine and perhaps jpeg_set_quality().\n\njpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)\n\tSets the JPEG file's colorspace (field jpeg_color_space) as specified,\n\tand sets other color-space-dependent parameters appropriately.  See\n\t\"Special color spaces\", below, before using this.  A large number of\n\tparameters, including all per-component parameters, are set by this\n\troutine; if you want to twiddle individual parameters you should call\n\tjpeg_set_colorspace() before rather than after.\n\njpeg_default_colorspace (j_compress_ptr cinfo)\n\tSelects an appropriate JPEG colorspace based on cinfo->in_color_space,\n\tand calls jpeg_set_colorspace().  This is actually a subroutine of\n\tjpeg_set_defaults().  It's broken out in case you want to change\n\tjust the colorspace-dependent JPEG parameters.\n\njpeg_set_quality (j_compress_ptr cinfo, int quality, boolean force_baseline)\n\tConstructs JPEG quantization tables appropriate for the indicated\n\tquality setting.  The quality value is expressed on the 0..100 scale\n\trecommended by IJG (cjpeg's \"-quality\" switch uses this routine).\n\tNote that the exact mapping from quality values to tables may change\n\tin future IJG releases as more is learned about DCT quantization.\n\tIf the force_baseline parameter is TRUE, then the quantization table\n\tentries are constrained to the range 1..255 for full JPEG baseline\n\tcompatibility.  In the current implementation, this only makes a\n\tdifference for quality settings below 25, and it effectively prevents\n\tvery small/low quality files from being generated.  The IJG decoder\n\tis capable of reading the non-baseline files generated at low quality\n\tsettings when force_baseline is FALSE, but other decoders may not be.\n\njpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,\n\t\t\t boolean force_baseline)\n\tSame as jpeg_set_quality() except that the generated tables are the\n\tsample tables given in the JPEC spec section K.1, multiplied by the\n\tspecified scale factor (which is expressed as a percentage; thus\n\tscale_factor = 100 reproduces the spec's tables).  Note that larger\n\tscale factors give lower quality.  This entry point is useful for\n\tconforming to the Adobe PostScript DCT conventions, but we do not\n\trecommend linear scaling as a user-visible quality scale otherwise.\n\tforce_baseline again constrains the computed table entries to 1..255.\n\nint jpeg_quality_scaling (int quality)\n\tConverts a value on the IJG-recommended quality scale to a linear\n\tscaling percentage.  Note that this routine may change or go away\n\tin future releases --- IJG may choose to adopt a scaling method that\n\tcan't be expressed as a simple scalar multiplier, in which case the\n\tpremise of this routine collapses.  Caveat user.\n\njpeg_default_qtables (j_compress_ptr cinfo, boolean force_baseline)\n\t[libjpeg v7+ API/ABI emulation only]\n\tSet default quantization tables with linear q_scale_factor[] values\n\t(see below).\n\njpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,\n\t\t      const unsigned int *basic_table,\n\t\t      int scale_factor, boolean force_baseline)\n\tAllows an arbitrary quantization table to be created.  which_tbl\n\tindicates which table slot to fill.  basic_table points to an array\n\tof 64 unsigned ints given in normal array order.  These values are\n\tmultiplied by scale_factor/100 and then clamped to the range 1..65535\n\t(or to 1..255 if force_baseline is TRUE).\n\tCAUTION: prior to library version 6a, jpeg_add_quant_table expected\n\tthe basic table to be given in JPEG zigzag order.  If you need to\n\twrite code that works with either older or newer versions of this\n\troutine, you must check the library version number.  Something like\n\t\"#if JPEG_LIB_VERSION >= 61\" is the right test.\n\njpeg_simple_progression (j_compress_ptr cinfo)\n\tGenerates a default scan script for writing a progressive-JPEG file.\n\tThis is the recommended method of creating a progressive file,\n\tunless you want to make a custom scan sequence.  You must ensure that\n\tthe JPEG color space is set correctly before calling this routine.\n\n\nCompression parameters (cinfo fields) include:\n\nJ_DCT_METHOD dct_method\n\tSelects the algorithm used for the DCT step.  Choices are:\n\t\tJDCT_ISLOW: slow but accurate integer algorithm\n\t\tJDCT_IFAST: faster, less accurate integer method\n\t\tJDCT_FLOAT: floating-point method\n\t\tJDCT_DEFAULT: default method (normally JDCT_ISLOW)\n\t\tJDCT_FASTEST: fastest method (normally JDCT_IFAST)\n\tThe FLOAT method is very slightly more accurate than the ISLOW method,\n\tbut may give different results on different machines due to varying\n\troundoff behavior.  The integer methods should give the same results\n\ton all machines.  On machines with sufficiently fast FP hardware, the\n\tfloating-point method may also be the fastest.  The IFAST method is\n\tconsiderably less accurate than the other two; its use is not\n\trecommended if high quality is a concern.  JDCT_DEFAULT and\n\tJDCT_FASTEST are macros configurable by each installation.\n\nJ_COLOR_SPACE jpeg_color_space\nint num_components\n\tThe JPEG color space and corresponding number of components; see\n\t\"Special color spaces\", below, for more info.  We recommend using\n\tjpeg_set_color_space() if you want to change these.\n\nboolean optimize_coding\n\tTRUE causes the compressor to compute optimal Huffman coding tables\n\tfor the image.  This requires an extra pass over the data and\n\ttherefore costs a good deal of space and time.  The default is\n\tFALSE, which tells the compressor to use the supplied or default\n\tHuffman tables.  In most cases optimal tables save only a few percent\n\tof file size compared to the default tables.  Note that when this is\n\tTRUE, you need not supply Huffman tables at all, and any you do\n\tsupply will be overwritten.\n\nunsigned int restart_interval\nint restart_in_rows\n\tTo emit restart markers in the JPEG file, set one of these nonzero.\n\tSet restart_interval to specify the exact interval in MCU blocks.\n\tSet restart_in_rows to specify the interval in MCU rows.  (If\n\trestart_in_rows is not 0, then restart_interval is set after the\n\timage width in MCUs is computed.)  Defaults are zero (no restarts).\n\tOne restart marker per MCU row is often a good choice.\n\tNOTE: the overhead of restart markers is higher in grayscale JPEG\n\tfiles than in color files, and MUCH higher in progressive JPEGs.\n\tIf you use restarts, you may want to use larger intervals in those\n\tcases.\n\nconst jpeg_scan_info * scan_info\nint num_scans\n\tBy default, scan_info is NULL; this causes the compressor to write a\n\tsingle-scan sequential JPEG file.  If not NULL, scan_info points to\n\tan array of scan definition records of length num_scans.  The\n\tcompressor will then write a JPEG file having one scan for each scan\n\tdefinition record.  This is used to generate noninterleaved or\n\tprogressive JPEG files.  The library checks that the scan array\n\tdefines a valid JPEG scan sequence.  (jpeg_simple_progression creates\n\ta suitable scan definition array for progressive JPEG.)  This is\n\tdiscussed further under \"Progressive JPEG support\".\n\nint smoothing_factor\n\tIf non-zero, the input image is smoothed; the value should be 1 for\n\tminimal smoothing to 100 for maximum smoothing.  Consult jcsample.c\n\tfor details of the smoothing algorithm.  The default is zero.\n\nboolean write_JFIF_header\n\tIf TRUE, a JFIF APP0 marker is emitted.  jpeg_set_defaults() and\n\tjpeg_set_colorspace() set this TRUE if a JFIF-legal JPEG color space\n\t(ie, YCbCr or grayscale) is selected, otherwise FALSE.\n\nUINT8 JFIF_major_version\nUINT8 JFIF_minor_version\n\tThe version number to be written into the JFIF marker.\n\tjpeg_set_defaults() initializes the version to 1.01 (major=minor=1).\n\tYou should set it to 1.02 (major=1, minor=2) if you plan to write\n\tany JFIF 1.02 extension markers.\n\nUINT8 density_unit\nUINT16 X_density\nUINT16 Y_density\n\tThe resolution information to be written into the JFIF marker;\n\tnot used otherwise.  density_unit may be 0 for unknown,\n\t1 for dots/inch, or 2 for dots/cm.  The default values are 0,1,1\n\tindicating square pixels of unknown size.\n\nboolean write_Adobe_marker\n\tIf TRUE, an Adobe APP14 marker is emitted.  jpeg_set_defaults() and\n\tjpeg_set_colorspace() set this TRUE if JPEG color space RGB, CMYK,\n\tor YCCK is selected, otherwise FALSE.  It is generally a bad idea\n\tto set both write_JFIF_header and write_Adobe_marker.  In fact,\n\tyou probably shouldn't change the default settings at all --- the\n\tdefault behavior ensures that the JPEG file's color space can be\n\trecognized by the decoder.\n\nJQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS]\n\tPointers to coefficient quantization tables, one per table slot,\n\tor NULL if no table is defined for a slot.  Usually these should\n\tbe set via one of the above helper routines; jpeg_add_quant_table()\n\tis general enough to define any quantization table.  The other\n\troutines will set up table slot 0 for luminance quality and table\n\tslot 1 for chrominance.\n\nint q_scale_factor[NUM_QUANT_TBLS]\n\t[libjpeg v7+ API/ABI emulation only]\n\tLinear quantization scaling factors (0-100, default 100)\n\tfor use with jpeg_default_qtables().\n\tSee rdswitch.c and cjpeg.c for an example of usage.\n\tNote that the q_scale_factor[] values use \"linear\" scales, so JPEG\n\tquality levels chosen by the user must be converted to these scales\n\tusing jpeg_quality_scaling().  Here is an example that corresponds to\n\tcjpeg -quality 90,70:\n\n\t\tjpeg_set_defaults(cinfo);\n\n\t\t/* Set luminance quality 90. */\n\t\tcinfo->q_scale_factor[0] = jpeg_quality_scaling(90);\n\t\t/* Set chrominance quality 70. */\n\t\tcinfo->q_scale_factor[1] = jpeg_quality_scaling(70);\n\n\t\tjpeg_default_qtables(cinfo, force_baseline);\n\n\tCAUTION: Setting separate quality levels for chrominance and luminance\n\tis mainly only useful if chrominance subsampling is disabled.  2x2\n\tchrominance subsampling (AKA \"4:2:0\") is the default, but you can\n\texplicitly disable subsampling as follows:\n\n\t\tcinfo->comp_info[0].v_samp_factor = 1;\n\t\tcinfo->comp_info[0].h_samp_factor = 1;\n\nJHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]\nJHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]\n\tPointers to Huffman coding tables, one per table slot, or NULL if\n\tno table is defined for a slot.  Slots 0 and 1 are filled with the\n\tJPEG sample tables by jpeg_set_defaults().  If you need to allocate\n\tmore table structures, jpeg_alloc_huff_table() may be used.\n\tNote that optimal Huffman tables can be computed for an image\n\tby setting optimize_coding, as discussed above; there's seldom\n\tany need to mess with providing your own Huffman tables.\n\n\n[libjpeg v7+ API/ABI emulation only]\nThe actual dimensions of the JPEG image that will be written to the file are\ngiven by the following fields.  These are computed from the input image\ndimensions and the compression parameters by jpeg_start_compress().  You can\nalso call jpeg_calc_jpeg_dimensions() to obtain the values that will result\nfrom the current parameter settings.  This can be useful if you are trying\nto pick a scaling ratio that will get close to a desired target size.\n\nJDIMENSION jpeg_width\t\tActual dimensions of output image.\nJDIMENSION jpeg_height\n\n\nPer-component parameters are stored in the struct cinfo.comp_info[i] for\ncomponent number i.  Note that components here refer to components of the\nJPEG color space, *not* the source image color space.  A suitably large\ncomp_info[] array is allocated by jpeg_set_defaults(); if you choose not\nto use that routine, it's up to you to allocate the array.\n\nint component_id\n\tThe one-byte identifier code to be recorded in the JPEG file for\n\tthis component.  For the standard color spaces, we recommend you\n\tleave the default values alone.\n\nint h_samp_factor\nint v_samp_factor\n\tHorizontal and vertical sampling factors for the component; must\n\tbe 1..4 according to the JPEG standard.  Note that larger sampling\n\tfactors indicate a higher-resolution component; many people find\n\tthis behavior quite unintuitive.  The default values are 2,2 for\n\tluminance components and 1,1 for chrominance components, except\n\tfor grayscale where 1,1 is used.\n\nint quant_tbl_no\n\tQuantization table number for component.  The default value is\n\t0 for luminance components and 1 for chrominance components.\n\nint dc_tbl_no\nint ac_tbl_no\n\tDC and AC entropy coding table numbers.  The default values are\n\t0 for luminance components and 1 for chrominance components.\n\nint component_index\n\tMust equal the component's index in comp_info[].  (Beginning in\n\trelease v6, the compressor library will fill this in automatically;\n\tyou don't have to.)\n\n\nDecompression parameter selection\n---------------------------------\n\nDecompression parameter selection is somewhat simpler than compression\nparameter selection, since all of the JPEG internal parameters are\nrecorded in the source file and need not be supplied by the application.\n(Unless you are working with abbreviated files, in which case see\n\"Abbreviated datastreams\", below.)  Decompression parameters control\nthe postprocessing done on the image to deliver it in a format suitable\nfor the application's use.  Many of the parameters control speed/quality\ntradeoffs, in which faster decompression may be obtained at the price of\na poorer-quality image.  The defaults select the highest quality (slowest)\nprocessing.\n\nThe following fields in the JPEG object are set by jpeg_read_header() and\nmay be useful to the application in choosing decompression parameters:\n\nJDIMENSION image_width\t\t\tWidth and height of image\nJDIMENSION image_height\nint num_components\t\t\tNumber of color components\nJ_COLOR_SPACE jpeg_color_space\t\tColorspace of image\nboolean saw_JFIF_marker\t\t\tTRUE if a JFIF APP0 marker was seen\n  UINT8 JFIF_major_version\t\tVersion information from JFIF marker\n  UINT8 JFIF_minor_version\n  UINT8 density_unit\t\t\tResolution data from JFIF marker\n  UINT16 X_density\n  UINT16 Y_density\nboolean saw_Adobe_marker\t\tTRUE if an Adobe APP14 marker was seen\n  UINT8 Adobe_transform\t\t\tColor transform code from Adobe marker\n\nThe JPEG color space, unfortunately, is something of a guess since the JPEG\nstandard proper does not provide a way to record it.  In practice most files\nadhere to the JFIF or Adobe conventions, and the decoder will recognize these\ncorrectly.  See \"Special color spaces\", below, for more info.\n\n\nThe decompression parameters that determine the basic properties of the\nreturned image are:\n\nJ_COLOR_SPACE out_color_space\n\tOutput color space.  jpeg_read_header() sets an appropriate default\n\tbased on jpeg_color_space; typically it will be RGB or grayscale.\n\tThe application can change this field to request output in a different\n\tcolorspace.  For example, set it to JCS_GRAYSCALE to get grayscale\n\toutput from a color file.  (This is useful for previewing: grayscale\n\toutput is faster than full color since the color components need not\n\tbe processed.)  Note that not all possible color space transforms are\n\tcurrently implemented; you may need to extend jdcolor.c if you want an\n\tunusual conversion.\n\nunsigned int scale_num, scale_denom\n\tScale the image by the fraction scale_num/scale_denom.  Default is\n\t1/1, or no scaling.  Currently, the only supported scaling ratios\n\tare M/8 with all M from 1 to 16, or any reduced fraction thereof (such\n\tas 1/2, 3/4, etc.)  (The library design allows for arbitrary\n\tscaling ratios but this is not likely to be implemented any time soon.)\n\tSmaller scaling ratios permit significantly faster decoding since\n\tfewer pixels need be processed and a simpler IDCT method can be used.\n\nboolean quantize_colors\n\tIf set TRUE, colormapped output will be delivered.  Default is FALSE,\n\tmeaning that full-color output will be delivered.\n\nThe next three parameters are relevant only if quantize_colors is TRUE.\n\nint desired_number_of_colors\n\tMaximum number of colors to use in generating a library-supplied color\n\tmap (the actual number of colors is returned in a different field).\n\tDefault 256.  Ignored when the application supplies its own color map.\n\nboolean two_pass_quantize\n\tIf TRUE, an extra pass over the image is made to select a custom color\n\tmap for the image.  This usually looks a lot better than the one-size-\n\tfits-all colormap that is used otherwise.  Default is TRUE.  Ignored\n\twhen the application supplies its own color map.\n\nJ_DITHER_MODE dither_mode\n\tSelects color dithering method.  Supported values are:\n\t\tJDITHER_NONE\tno dithering: fast, very low quality\n\t\tJDITHER_ORDERED\tordered dither: moderate speed and quality\n\t\tJDITHER_FS\tFloyd-Steinberg dither: slow, high quality\n\tDefault is JDITHER_FS.  (At present, ordered dither is implemented\n\tonly in the single-pass, standard-colormap case.  If you ask for\n\tordered dither when two_pass_quantize is TRUE or when you supply\n\tan external color map, you'll get F-S dithering.)\n\nWhen quantize_colors is TRUE, the target color map is described by the next\ntwo fields.  colormap is set to NULL by jpeg_read_header().  The application\ncan supply a color map by setting colormap non-NULL and setting\nactual_number_of_colors to the map size.  Otherwise, jpeg_start_decompress()\nselects a suitable color map and sets these two fields itself.\n[Implementation restriction: at present, an externally supplied colormap is\nonly accepted for 3-component output color spaces.]\n\nJSAMPARRAY colormap\n\tThe color map, represented as a 2-D pixel array of out_color_components\n\trows and actual_number_of_colors columns.  Ignored if not quantizing.\n\tCAUTION: if the JPEG library creates its own colormap, the storage\n\tpointed to by this field is released by jpeg_finish_decompress().\n\tCopy the colormap somewhere else first, if you want to save it.\n\nint actual_number_of_colors\n\tThe number of colors in the color map.\n\nAdditional decompression parameters that the application may set include:\n\nJ_DCT_METHOD dct_method\n\tSelects the algorithm used for the DCT step.  Choices are the same\n\tas described above for compression.\n\nboolean do_fancy_upsampling\n\tIf TRUE, do careful upsampling of chroma components.  If FALSE,\n\ta faster but sloppier method is used.  Default is TRUE.  The visual\n\timpact of the sloppier method is often very small.\n\nboolean do_block_smoothing\n\tIf TRUE, interblock smoothing is applied in early stages of decoding\n\tprogressive JPEG files; if FALSE, not.  Default is TRUE.  Early\n\tprogression stages look \"fuzzy\" with smoothing, \"blocky\" without.\n\tIn any case, block smoothing ceases to be applied after the first few\n\tAC coefficients are known to full accuracy, so it is relevant only\n\twhen using buffered-image mode for progressive images.\n\nboolean enable_1pass_quant\nboolean enable_external_quant\nboolean enable_2pass_quant\n\tThese are significant only in buffered-image mode, which is\n\tdescribed in its own section below.\n\n\nThe output image dimensions are given by the following fields.  These are\ncomputed from the source image dimensions and the decompression parameters\nby jpeg_start_decompress().  You can also call jpeg_calc_output_dimensions()\nto obtain the values that will result from the current parameter settings.\nThis can be useful if you are trying to pick a scaling ratio that will get\nclose to a desired target size.  It's also important if you are using the\nJPEG library's memory manager to allocate output buffer space, because you\nare supposed to request such buffers *before* jpeg_start_decompress().\n\nJDIMENSION output_width\t\tActual dimensions of output image.\nJDIMENSION output_height\nint out_color_components\tNumber of color components in out_color_space.\nint output_components\t\tNumber of color components returned.\nint rec_outbuf_height\t\tRecommended height of scanline buffer.\n\nWhen quantizing colors, output_components is 1, indicating a single color map\nindex per pixel.  Otherwise it equals out_color_components.  The output arrays\nare required to be output_width * output_components JSAMPLEs wide.\n\nrec_outbuf_height is the recommended minimum height (in scanlines) of the\nbuffer passed to jpeg_read_scanlines().  If the buffer is smaller, the\nlibrary will still work, but time will be wasted due to unnecessary data\ncopying.  In high-quality modes, rec_outbuf_height is always 1, but some\nfaster, lower-quality modes set it to larger values (typically 2 to 4).\nIf you are going to ask for a high-speed processing mode, you may as well\ngo to the trouble of honoring rec_outbuf_height so as to avoid data copying.\n(An output buffer larger than rec_outbuf_height lines is OK, but won't\nprovide any material speed improvement over that height.)\n\n\nSpecial color spaces\n--------------------\n\nThe JPEG standard itself is \"color blind\" and doesn't specify any particular\ncolor space.  It is customary to convert color data to a luminance/chrominance\ncolor space before compressing, since this permits greater compression.  The\nexisting de-facto JPEG file format standards specify YCbCr or grayscale data\n(JFIF), or grayscale, RGB, YCbCr, CMYK, or YCCK (Adobe).  For special\napplications such as multispectral images, other color spaces can be used,\nbut it must be understood that such files will be unportable.\n\nThe JPEG library can handle the most common colorspace conversions (namely\nRGB <=> YCbCr and CMYK <=> YCCK).  It can also deal with data of an unknown\ncolor space, passing it through without conversion.  If you deal extensively\nwith an unusual color space, you can easily extend the library to understand\nadditional color spaces and perform appropriate conversions.\n\nFor compression, the source data's color space is specified by field\nin_color_space.  This is transformed to the JPEG file's color space given\nby jpeg_color_space.  jpeg_set_defaults() chooses a reasonable JPEG color\nspace depending on in_color_space, but you can override this by calling\njpeg_set_colorspace().  Of course you must select a supported transformation.\njccolor.c currently supports the following transformations:\n\tRGB => YCbCr\n\tRGB => GRAYSCALE\n\tYCbCr => GRAYSCALE\n\tCMYK => YCCK\nplus the null transforms: GRAYSCALE => GRAYSCALE, RGB => RGB,\nYCbCr => YCbCr, CMYK => CMYK, YCCK => YCCK, and UNKNOWN => UNKNOWN.\n\nThe de-facto file format standards (JFIF and Adobe) specify APPn markers that\nindicate the color space of the JPEG file.  It is important to ensure that\nthese are written correctly, or omitted if the JPEG file's color space is not\none of the ones supported by the de-facto standards.  jpeg_set_colorspace()\nwill set the compression parameters to include or omit the APPn markers\nproperly, so long as it is told the truth about the JPEG color space.\nFor example, if you are writing some random 3-component color space without\nconversion, don't try to fake out the library by setting in_color_space and\njpeg_color_space to JCS_YCbCr; use JCS_UNKNOWN.  You may want to write an\nAPPn marker of your own devising to identify the colorspace --- see \"Special\nmarkers\", below.\n\nWhen told that the color space is UNKNOWN, the library will default to using\nluminance-quality compression parameters for all color components.  You may\nwell want to change these parameters.  See the source code for\njpeg_set_colorspace(), in jcparam.c, for details.\n\nFor decompression, the JPEG file's color space is given in jpeg_color_space,\nand this is transformed to the output color space out_color_space.\njpeg_read_header's setting of jpeg_color_space can be relied on if the file\nconforms to JFIF or Adobe conventions, but otherwise it is no better than a\nguess.  If you know the JPEG file's color space for certain, you can override\njpeg_read_header's guess by setting jpeg_color_space.  jpeg_read_header also\nselects a default output color space based on (its guess of) jpeg_color_space;\nset out_color_space to override this.  Again, you must select a supported\ntransformation.  jdcolor.c currently supports\n\tYCbCr => RGB\n\tYCbCr => GRAYSCALE\n\tRGB => GRAYSCALE\n\tGRAYSCALE => RGB\n\tYCCK => CMYK\nas well as the null transforms.  (Since GRAYSCALE=>RGB is provided, an\napplication can force grayscale JPEGs to look like color JPEGs if it only\nwants to handle one case.)\n\nThe two-pass color quantizer, jquant2.c, is specialized to handle RGB data\n(it weights distances appropriately for RGB colors).  You'll need to modify\nthe code if you want to use it for non-RGB output color spaces.  Note that\njquant2.c is used to map to an application-supplied colormap as well as for\nthe normal two-pass colormap selection process.\n\nCAUTION: it appears that Adobe Photoshop writes inverted data in CMYK JPEG\nfiles: 0 represents 100% ink coverage, rather than 0% ink as you'd expect.\nThis is arguably a bug in Photoshop, but if you need to work with Photoshop\nCMYK files, you will have to deal with it in your application.  We cannot\n\"fix\" this in the library by inverting the data during the CMYK<=>YCCK\ntransform, because that would break other applications, notably Ghostscript.\nPhotoshop versions prior to 3.0 write EPS files containing JPEG-encoded CMYK\ndata in the same inverted-YCCK representation used in bare JPEG files, but\nthe surrounding PostScript code performs an inversion using the PS image\noperator.  I am told that Photoshop 3.0 will write uninverted YCCK in\nEPS/JPEG files, and will omit the PS-level inversion.  (But the data\npolarity used in bare JPEG files will not change in 3.0.)  In either case,\nthe JPEG library must not invert the data itself, or else Ghostscript would\nread these EPS files incorrectly.\n\n\nError handling\n--------------\n\nWhen the default error handler is used, any error detected inside the JPEG\nroutines will cause a message to be printed on stderr, followed by exit().\nYou can supply your own error handling routines to override this behavior\nand to control the treatment of nonfatal warnings and trace/debug messages.\nThe file example.c illustrates the most common case, which is to have the\napplication regain control after an error rather than exiting.\n\nThe JPEG library never writes any message directly; it always goes through\nthe error handling routines.  Three classes of messages are recognized:\n  * Fatal errors: the library cannot continue.\n  * Warnings: the library can continue, but the data is corrupt, and a\n    damaged output image is likely to result.\n  * Trace/informational messages.  These come with a trace level indicating\n    the importance of the message; you can control the verbosity of the\n    program by adjusting the maximum trace level that will be displayed.\n\nYou may, if you wish, simply replace the entire JPEG error handling module\n(jerror.c) with your own code.  However, you can avoid code duplication by\nonly replacing some of the routines depending on the behavior you need.\nThis is accomplished by calling jpeg_std_error() as usual, but then overriding\nsome of the method pointers in the jpeg_error_mgr struct, as illustrated by\nexample.c.\n\nAll of the error handling routines will receive a pointer to the JPEG object\n(a j_common_ptr which points to either a jpeg_compress_struct or a\njpeg_decompress_struct; if you need to tell which, test the is_decompressor\nfield).  This struct includes a pointer to the error manager struct in its\n\"err\" field.  Frequently, custom error handler routines will need to access\nadditional data which is not known to the JPEG library or the standard error\nhandler.  The most convenient way to do this is to embed either the JPEG\nobject or the jpeg_error_mgr struct in a larger structure that contains\nadditional fields; then casting the passed pointer provides access to the\nadditional fields.  Again, see example.c for one way to do it.  (Beginning\nwith IJG version 6b, there is also a void pointer \"client_data\" in each\nJPEG object, which the application can also use to find related data.\nThe library does not touch client_data at all.)\n\nThe individual methods that you might wish to override are:\n\nerror_exit (j_common_ptr cinfo)\n\tReceives control for a fatal error.  Information sufficient to\n\tgenerate the error message has been stored in cinfo->err; call\n\toutput_message to display it.  Control must NOT return to the caller;\n\tgenerally this routine will exit() or longjmp() somewhere.\n\tTypically you would override this routine to get rid of the exit()\n\tdefault behavior.  Note that if you continue processing, you should\n\tclean up the JPEG object with jpeg_abort() or jpeg_destroy().\n\noutput_message (j_common_ptr cinfo)\n\tActual output of any JPEG message.  Override this to send messages\n\tsomewhere other than stderr.  Note that this method does not know\n\thow to generate a message, only where to send it.\n\nformat_message (j_common_ptr cinfo, char * buffer)\n\tConstructs a readable error message string based on the error info\n\tstored in cinfo->err.  This method is called by output_message.  Few\n\tapplications should need to override this method.  One possible\n\treason for doing so is to implement dynamic switching of error message\n\tlanguage.\n\nemit_message (j_common_ptr cinfo, int msg_level)\n\tDecide whether or not to emit a warning or trace message; if so,\n\tcalls output_message.  The main reason for overriding this method\n\twould be to abort on warnings.  msg_level is -1 for warnings,\n\t0 and up for trace messages.\n\nOnly error_exit() and emit_message() are called from the rest of the JPEG\nlibrary; the other two are internal to the error handler.\n\nThe actual message texts are stored in an array of strings which is pointed to\nby the field err->jpeg_message_table.  The messages are numbered from 0 to\nerr->last_jpeg_message, and it is these code numbers that are used in the\nJPEG library code.  You could replace the message texts (for instance, with\nmessages in French or German) by changing the message table pointer.  See\njerror.h for the default texts.  CAUTION: this table will almost certainly\nchange or grow from one library version to the next.\n\nIt may be useful for an application to add its own message texts that are\nhandled by the same mechanism.  The error handler supports a second \"add-on\"\nmessage table for this purpose.  To define an addon table, set the pointer\nerr->addon_message_table and the message numbers err->first_addon_message and\nerr->last_addon_message.  If you number the addon messages beginning at 1000\nor so, you won't have to worry about conflicts with the library's built-in\nmessages.  See the sample applications cjpeg/djpeg for an example of using\naddon messages (the addon messages are defined in cderror.h).\n\nActual invocation of the error handler is done via macros defined in jerror.h:\n\tERREXITn(...)\tfor fatal errors\n\tWARNMSn(...)\tfor corrupt-data warnings\n\tTRACEMSn(...)\tfor trace and informational messages.\nThese macros store the message code and any additional parameters into the\nerror handler struct, then invoke the error_exit() or emit_message() method.\nThe variants of each macro are for varying numbers of additional parameters.\nThe additional parameters are inserted into the generated message using\nstandard printf() format codes.\n\nSee jerror.h and jerror.c for further details.\n\n\nCompressed data handling (source and destination managers)\n----------------------------------------------------------\n\nThe JPEG compression library sends its compressed data to a \"destination\nmanager\" module.  The default destination manager just writes the data to a\nmemory buffer or to a stdio stream, but you can provide your own manager to\ndo something else.  Similarly, the decompression library calls a \"source\nmanager\" to obtain the compressed data; you can provide your own source\nmanager if you want the data to come from somewhere other than a memory\nbuffer or a stdio stream.\n\nIn both cases, compressed data is processed a bufferload at a time: the\ndestination or source manager provides a work buffer, and the library invokes\nthe manager only when the buffer is filled or emptied.  (You could define a\none-character buffer to force the manager to be invoked for each byte, but\nthat would be rather inefficient.)  The buffer's size and location are\ncontrolled by the manager, not by the library.  For example, the memory\nsource manager just makes the buffer pointer and length point to the original\ndata in memory.  In this case the buffer-reload procedure will be invoked\nonly if the decompressor ran off the end of the datastream, which would\nindicate an erroneous datastream.\n\nThe work buffer is defined as an array of datatype JOCTET, which is generally\n\"char\" or \"unsigned char\".  On a machine where char is not exactly 8 bits\nwide, you must define JOCTET as a wider data type and then modify the data\nsource and destination modules to transcribe the work arrays into 8-bit units\non external storage.\n\nA data destination manager struct contains a pointer and count defining the\nnext byte to write in the work buffer and the remaining free space:\n\n\tJOCTET * next_output_byte;  /* => next byte to write in buffer */\n\tsize_t free_in_buffer;      /* # of byte spaces remaining in buffer */\n\nThe library increments the pointer and decrements the count until the buffer\nis filled.  The manager's empty_output_buffer method must reset the pointer\nand count.  The manager is expected to remember the buffer's starting address\nand total size in private fields not visible to the library.\n\nA data destination manager provides three methods:\n\ninit_destination (j_compress_ptr cinfo)\n\tInitialize destination.  This is called by jpeg_start_compress()\n\tbefore any data is actually written.  It must initialize\n\tnext_output_byte and free_in_buffer.  free_in_buffer must be\n\tinitialized to a positive value.\n\nempty_output_buffer (j_compress_ptr cinfo)\n\tThis is called whenever the buffer has filled (free_in_buffer\n\treaches zero).  In typical applications, it should write out the\n\t*entire* buffer (use the saved start address and buffer length;\n\tignore the current state of next_output_byte and free_in_buffer).\n\tThen reset the pointer & count to the start of the buffer, and\n\treturn TRUE indicating that the buffer has been dumped.\n\tfree_in_buffer must be set to a positive value when TRUE is\n\treturned.  A FALSE return should only be used when I/O suspension is\n\tdesired (this operating mode is discussed in the next section).\n\nterm_destination (j_compress_ptr cinfo)\n\tTerminate destination --- called by jpeg_finish_compress() after all\n\tdata has been written.  In most applications, this must flush any\n\tdata remaining in the buffer.  Use either next_output_byte or\n\tfree_in_buffer to determine how much data is in the buffer.\n\nterm_destination() is NOT called by jpeg_abort() or jpeg_destroy().  If you\nwant the destination manager to be cleaned up during an abort, you must do it\nyourself.\n\nYou will also need code to create a jpeg_destination_mgr struct, fill in its\nmethod pointers, and insert a pointer to the struct into the \"dest\" field of\nthe JPEG compression object.  This can be done in-line in your setup code if\nyou like, but it's probably cleaner to provide a separate routine similar to\nthe jpeg_stdio_dest() or jpeg_mem_dest() routines of the supplied destination\nmanagers.\n\nDecompression source managers follow a parallel design, but with some\nadditional frammishes.  The source manager struct contains a pointer and count\ndefining the next byte to read from the work buffer and the number of bytes\nremaining:\n\n\tconst JOCTET * next_input_byte; /* => next byte to read from buffer */\n\tsize_t bytes_in_buffer;         /* # of bytes remaining in buffer */\n\nThe library increments the pointer and decrements the count until the buffer\nis emptied.  The manager's fill_input_buffer method must reset the pointer and\ncount.  In most applications, the manager must remember the buffer's starting\naddress and total size in private fields not visible to the library.\n\nA data source manager provides five methods:\n\ninit_source (j_decompress_ptr cinfo)\n\tInitialize source.  This is called by jpeg_read_header() before any\n\tdata is actually read.  Unlike init_destination(), it may leave\n\tbytes_in_buffer set to 0 (in which case a fill_input_buffer() call\n\twill occur immediately).\n\nfill_input_buffer (j_decompress_ptr cinfo)\n\tThis is called whenever bytes_in_buffer has reached zero and more\n\tdata is wanted.  In typical applications, it should read fresh data\n\tinto the buffer (ignoring the current state of next_input_byte and\n\tbytes_in_buffer), reset the pointer & count to the start of the\n\tbuffer, and return TRUE indicating that the buffer has been reloaded.\n\tIt is not necessary to fill the buffer entirely, only to obtain at\n\tleast one more byte.  bytes_in_buffer MUST be set to a positive value\n\tif TRUE is returned.  A FALSE return should only be used when I/O\n\tsuspension is desired (this mode is discussed in the next section).\n\nskip_input_data (j_decompress_ptr cinfo, long num_bytes)\n\tSkip num_bytes worth of data.  The buffer pointer and count should\n\tbe advanced over num_bytes input bytes, refilling the buffer as\n\tneeded.  This is used to skip over a potentially large amount of\n\tuninteresting data (such as an APPn marker).  In some applications\n\tit may be possible to optimize away the reading of the skipped data,\n\tbut it's not clear that being smart is worth much trouble; large\n\tskips are uncommon.  bytes_in_buffer may be zero on return.\n\tA zero or negative skip count should be treated as a no-op.\n\nresync_to_restart (j_decompress_ptr cinfo, int desired)\n\tThis routine is called only when the decompressor has failed to find\n\ta restart (RSTn) marker where one is expected.  Its mission is to\n\tfind a suitable point for resuming decompression.  For most\n\tapplications, we recommend that you just use the default resync\n\tprocedure, jpeg_resync_to_restart().  However, if you are able to back\n\tup in the input data stream, or if you have a-priori knowledge about\n\tthe likely location of restart markers, you may be able to do better.\n\tRead the read_restart_marker() and jpeg_resync_to_restart() routines\n\tin jdmarker.c if you think you'd like to implement your own resync\n\tprocedure.\n\nterm_source (j_decompress_ptr cinfo)\n\tTerminate source --- called by jpeg_finish_decompress() after all\n\tdata has been read.  Often a no-op.\n\nFor both fill_input_buffer() and skip_input_data(), there is no such thing\nas an EOF return.  If the end of the file has been reached, the routine has\na choice of exiting via ERREXIT() or inserting fake data into the buffer.\nIn most cases, generating a warning message and inserting a fake EOI marker\nis the best course of action --- this will allow the decompressor to output\nhowever much of the image is there.  In pathological cases, the decompressor\nmay swallow the EOI and again demand data ... just keep feeding it fake EOIs.\njdatasrc.c illustrates the recommended error recovery behavior.\n\nterm_source() is NOT called by jpeg_abort() or jpeg_destroy().  If you want\nthe source manager to be cleaned up during an abort, you must do it yourself.\n\nYou will also need code to create a jpeg_source_mgr struct, fill in its method\npointers, and insert a pointer to the struct into the \"src\" field of the JPEG\ndecompression object.  This can be done in-line in your setup code if you\nlike, but it's probably cleaner to provide a separate routine similar to the\njpeg_stdio_src() or jpeg_mem_src() routines of the supplied source managers.\n\nFor more information, consult the memory and stdio source and destination\nmanagers in jdatasrc.c and jdatadst.c.\n\n\nI/O suspension\n--------------\n\nSome applications need to use the JPEG library as an incremental memory-to-\nmemory filter: when the compressed data buffer is filled or emptied, they want\ncontrol to return to the outer loop, rather than expecting that the buffer can\nbe emptied or reloaded within the data source/destination manager subroutine.\nThe library supports this need by providing an \"I/O suspension\" mode, which we\ndescribe in this section.\n\nThe I/O suspension mode is not a panacea: nothing is guaranteed about the\nmaximum amount of time spent in any one call to the library, so it will not\neliminate response-time problems in single-threaded applications.  If you\nneed guaranteed response time, we suggest you \"bite the bullet\" and implement\na real multi-tasking capability.\n\nTo use I/O suspension, cooperation is needed between the calling application\nand the data source or destination manager; you will always need a custom\nsource/destination manager.  (Please read the previous section if you haven't\nalready.)  The basic idea is that the empty_output_buffer() or\nfill_input_buffer() routine is a no-op, merely returning FALSE to indicate\nthat it has done nothing.  Upon seeing this, the JPEG library suspends\noperation and returns to its caller.  The surrounding application is\nresponsible for emptying or refilling the work buffer before calling the\nJPEG library again.\n\nCompression suspension:\n\nFor compression suspension, use an empty_output_buffer() routine that returns\nFALSE; typically it will not do anything else.  This will cause the\ncompressor to return to the caller of jpeg_write_scanlines(), with the return\nvalue indicating that not all the supplied scanlines have been accepted.\nThe application must make more room in the output buffer, adjust the output\nbuffer pointer/count appropriately, and then call jpeg_write_scanlines()\nagain, pointing to the first unconsumed scanline.\n\nWhen forced to suspend, the compressor will backtrack to a convenient stopping\npoint (usually the start of the current MCU); it will regenerate some output\ndata when restarted.  Therefore, although empty_output_buffer() is only\ncalled when the buffer is filled, you should NOT write out the entire buffer\nafter a suspension.  Write only the data up to the current position of\nnext_output_byte/free_in_buffer.  The data beyond that point will be\nregenerated after resumption.\n\nBecause of the backtracking behavior, a good-size output buffer is essential\nfor efficiency; you don't want the compressor to suspend often.  (In fact, an\noverly small buffer could lead to infinite looping, if a single MCU required\nmore data than would fit in the buffer.)  We recommend a buffer of at least\nseveral Kbytes.  You may want to insert explicit code to ensure that you don't\ncall jpeg_write_scanlines() unless there is a reasonable amount of space in\nthe output buffer; in other words, flush the buffer before trying to compress\nmore data.\n\nThe compressor does not allow suspension while it is trying to write JPEG\nmarkers at the beginning and end of the file.  This means that:\n  * At the beginning of a compression operation, there must be enough free\n    space in the output buffer to hold the header markers (typically 600 or\n    so bytes).  The recommended buffer size is bigger than this anyway, so\n    this is not a problem as long as you start with an empty buffer.  However,\n    this restriction might catch you if you insert large special markers, such\n    as a JFIF thumbnail image, without flushing the buffer afterwards.\n  * When you call jpeg_finish_compress(), there must be enough space in the\n    output buffer to emit any buffered data and the final EOI marker.  In the\n    current implementation, half a dozen bytes should suffice for this, but\n    for safety's sake we recommend ensuring that at least 100 bytes are free\n    before calling jpeg_finish_compress().\n\nA more significant restriction is that jpeg_finish_compress() cannot suspend.\nThis means you cannot use suspension with multi-pass operating modes, namely\nHuffman code optimization and multiple-scan output.  Those modes write the\nwhole file during jpeg_finish_compress(), which will certainly result in\nbuffer overrun.  (Note that this restriction applies only to compression,\nnot decompression.  The decompressor supports input suspension in all of its\noperating modes.)\n\nDecompression suspension:\n\nFor decompression suspension, use a fill_input_buffer() routine that simply\nreturns FALSE (except perhaps during error recovery, as discussed below).\nThis will cause the decompressor to return to its caller with an indication\nthat suspension has occurred.  This can happen at four places:\n  * jpeg_read_header(): will return JPEG_SUSPENDED.\n  * jpeg_start_decompress(): will return FALSE, rather than its usual TRUE.\n  * jpeg_read_scanlines(): will return the number of scanlines already\n\tcompleted (possibly 0).\n  * jpeg_finish_decompress(): will return FALSE, rather than its usual TRUE.\nThe surrounding application must recognize these cases, load more data into\nthe input buffer, and repeat the call.  In the case of jpeg_read_scanlines(),\nincrement the passed pointers past any scanlines successfully read.\n\nJust as with compression, the decompressor will typically backtrack to a\nconvenient restart point before suspending.  When fill_input_buffer() is\ncalled, next_input_byte/bytes_in_buffer point to the current restart point,\nwhich is where the decompressor will backtrack to if FALSE is returned.\nThe data beyond that position must NOT be discarded if you suspend; it needs\nto be re-read upon resumption.  In most implementations, you'll need to shift\nthis data down to the start of your work buffer and then load more data after\nit.  Again, this behavior means that a several-Kbyte work buffer is essential\nfor decent performance; furthermore, you should load a reasonable amount of\nnew data before resuming decompression.  (If you loaded, say, only one new\nbyte each time around, you could waste a LOT of cycles.)\n\nThe skip_input_data() source manager routine requires special care in a\nsuspension scenario.  This routine is NOT granted the ability to suspend the\ndecompressor; it can decrement bytes_in_buffer to zero, but no more.  If the\nrequested skip distance exceeds the amount of data currently in the input\nbuffer, then skip_input_data() must set bytes_in_buffer to zero and record the\nadditional skip distance somewhere else.  The decompressor will immediately\ncall fill_input_buffer(), which should return FALSE, which will cause a\nsuspension return.  The surrounding application must then arrange to discard\nthe recorded number of bytes before it resumes loading the input buffer.\n(Yes, this design is rather baroque, but it avoids complexity in the far more\ncommon case where a non-suspending source manager is used.)\n\nIf the input data has been exhausted, we recommend that you emit a warning\nand insert dummy EOI markers just as a non-suspending data source manager\nwould do.  This can be handled either in the surrounding application logic or\nwithin fill_input_buffer(); the latter is probably more efficient.  If\nfill_input_buffer() knows that no more data is available, it can set the\npointer/count to point to a dummy EOI marker and then return TRUE just as\nthough it had read more data in a non-suspending situation.\n\nThe decompressor does not attempt to suspend within standard JPEG markers;\ninstead it will backtrack to the start of the marker and reprocess the whole\nmarker next time.  Hence the input buffer must be large enough to hold the\nlongest standard marker in the file.  Standard JPEG markers should normally\nnot exceed a few hundred bytes each (DHT tables are typically the longest).\nWe recommend at least a 2K buffer for performance reasons, which is much\nlarger than any correct marker is likely to be.  For robustness against\ndamaged marker length counts, you may wish to insert a test in your\napplication for the case that the input buffer is completely full and yet\nthe decoder has suspended without consuming any data --- otherwise, if this\nsituation did occur, it would lead to an endless loop.  (The library can't\nprovide this test since it has no idea whether \"the buffer is full\", or\neven whether there is a fixed-size input buffer.)\n\nThe input buffer would need to be 64K to allow for arbitrary COM or APPn\nmarkers, but these are handled specially: they are either saved into allocated\nmemory, or skipped over by calling skip_input_data().  In the former case,\nsuspension is handled correctly, and in the latter case, the problem of\nbuffer overrun is placed on skip_input_data's shoulders, as explained above.\nNote that if you provide your own marker handling routine for large markers,\nyou should consider how to deal with buffer overflow.\n\nMultiple-buffer management:\n\nIn some applications it is desirable to store the compressed data in a linked\nlist of buffer areas, so as to avoid data copying.  This can be handled by\nhaving empty_output_buffer() or fill_input_buffer() set the pointer and count\nto reference the next available buffer; FALSE is returned only if no more\nbuffers are available.  Although seemingly straightforward, there is a\npitfall in this approach: the backtrack that occurs when FALSE is returned\ncould back up into an earlier buffer.  For example, when fill_input_buffer()\nis called, the current pointer & count indicate the backtrack restart point.\nSince fill_input_buffer() will set the pointer and count to refer to a new\nbuffer, the restart position must be saved somewhere else.  Suppose a second\ncall to fill_input_buffer() occurs in the same library call, and no\nadditional input data is available, so fill_input_buffer must return FALSE.\nIf the JPEG library has not moved the pointer/count forward in the current\nbuffer, then *the correct restart point is the saved position in the prior\nbuffer*.  Prior buffers may be discarded only after the library establishes\na restart point within a later buffer.  Similar remarks apply for output into\na chain of buffers.\n\nThe library will never attempt to backtrack over a skip_input_data() call,\nso any skipped data can be permanently discarded.  You still have to deal\nwith the case of skipping not-yet-received data, however.\n\nIt's much simpler to use only a single buffer; when fill_input_buffer() is\ncalled, move any unconsumed data (beyond the current pointer/count) down to\nthe beginning of this buffer and then load new data into the remaining buffer\nspace.  This approach requires a little more data copying but is far easier\nto get right.\n\n\nProgressive JPEG support\n------------------------\n\nProgressive JPEG rearranges the stored data into a series of scans of\nincreasing quality.  In situations where a JPEG file is transmitted across a\nslow communications link, a decoder can generate a low-quality image very\nquickly from the first scan, then gradually improve the displayed quality as\nmore scans are received.  The final image after all scans are complete is\nidentical to that of a regular (sequential) JPEG file of the same quality\nsetting.  Progressive JPEG files are often slightly smaller than equivalent\nsequential JPEG files, but the possibility of incremental display is the main\nreason for using progressive JPEG.\n\nThe IJG encoder library generates progressive JPEG files when given a\nsuitable \"scan script\" defining how to divide the data into scans.\nCreation of progressive JPEG files is otherwise transparent to the encoder.\nProgressive JPEG files can also be read transparently by the decoder library.\nIf the decoding application simply uses the library as defined above, it\nwill receive a final decoded image without any indication that the file was\nprogressive.  Of course, this approach does not allow incremental display.\nTo perform incremental display, an application needs to use the decoder\nlibrary's \"buffered-image\" mode, in which it receives a decoded image\nmultiple times.\n\nEach displayed scan requires about as much work to decode as a full JPEG\nimage of the same size, so the decoder must be fairly fast in relation to the\ndata transmission rate in order to make incremental display useful.  However,\nit is possible to skip displaying the image and simply add the incoming bits\nto the decoder's coefficient buffer.  This is fast because only Huffman\ndecoding need be done, not IDCT, upsampling, colorspace conversion, etc.\nThe IJG decoder library allows the application to switch dynamically between\ndisplaying the image and simply absorbing the incoming bits.  A properly\ncoded application can automatically adapt the number of display passes to\nsuit the time available as the image is received.  Also, a final\nhigher-quality display cycle can be performed from the buffered data after\nthe end of the file is reached.\n\nProgressive compression:\n\nTo create a progressive JPEG file (or a multiple-scan sequential JPEG file),\nset the scan_info cinfo field to point to an array of scan descriptors, and\nperform compression as usual.  Instead of constructing your own scan list,\nyou can call the jpeg_simple_progression() helper routine to create a\nrecommended progression sequence; this method should be used by all\napplications that don't want to get involved in the nitty-gritty of\nprogressive scan sequence design.  (If you want to provide user control of\nscan sequences, you may wish to borrow the scan script reading code found\nin rdswitch.c, so that you can read scan script files just like cjpeg's.)\nWhen scan_info is not NULL, the compression library will store DCT'd data\ninto a buffer array as jpeg_write_scanlines() is called, and will emit all\nthe requested scans during jpeg_finish_compress().  This implies that\nmultiple-scan output cannot be created with a suspending data destination\nmanager, since jpeg_finish_compress() does not support suspension.  We\nshould also note that the compressor currently forces Huffman optimization\nmode when creating a progressive JPEG file, because the default Huffman\ntables are unsuitable for progressive files.\n\nProgressive decompression:\n\nWhen buffered-image mode is not used, the decoder library will read all of\na multi-scan file during jpeg_start_decompress(), so that it can provide a\nfinal decoded image.  (Here \"multi-scan\" means either progressive or\nmulti-scan sequential.)  This makes multi-scan files transparent to the\ndecoding application.  However, existing applications that used suspending\ninput with version 5 of the IJG library will need to be modified to check\nfor a suspension return from jpeg_start_decompress().\n\nTo perform incremental display, an application must use the library's\nbuffered-image mode.  This is described in the next section.\n\n\nBuffered-image mode\n-------------------\n\nIn buffered-image mode, the library stores the partially decoded image in a\ncoefficient buffer, from which it can be read out as many times as desired.\nThis mode is typically used for incremental display of progressive JPEG files,\nbut it can be used with any JPEG file.  Each scan of a progressive JPEG file\nadds more data (more detail) to the buffered image.  The application can\ndisplay in lockstep with the source file (one display pass per input scan),\nor it can allow input processing to outrun display processing.  By making\ninput and display processing run independently, it is possible for the\napplication to adapt progressive display to a wide range of data transmission\nrates.\n\nThe basic control flow for buffered-image decoding is\n\n\tjpeg_create_decompress()\n\tset data source\n\tjpeg_read_header()\n\tset overall decompression parameters\n\tcinfo.buffered_image = TRUE;\t/* select buffered-image mode */\n\tjpeg_start_decompress()\n\tfor (each output pass) {\n\t    adjust output decompression parameters if required\n\t    jpeg_start_output()\t\t/* start a new output pass */\n\t    for (all scanlines in image) {\n\t        jpeg_read_scanlines()\n\t        display scanlines\n\t    }\n\t    jpeg_finish_output()\t/* terminate output pass */\n\t}\n\tjpeg_finish_decompress()\n\tjpeg_destroy_decompress()\n\nThis differs from ordinary unbuffered decoding in that there is an additional\nlevel of looping.  The application can choose how many output passes to make\nand how to display each pass.\n\nThe simplest approach to displaying progressive images is to do one display\npass for each scan appearing in the input file.  In this case the outer loop\ncondition is typically\n\twhile (! jpeg_input_complete(&cinfo))\nand the start-output call should read\n\tjpeg_start_output(&cinfo, cinfo.input_scan_number);\nThe second parameter to jpeg_start_output() indicates which scan of the input\nfile is to be displayed; the scans are numbered starting at 1 for this\npurpose.  (You can use a loop counter starting at 1 if you like, but using\nthe library's input scan counter is easier.)  The library automatically reads\ndata as necessary to complete each requested scan, and jpeg_finish_output()\nadvances to the next scan or end-of-image marker (hence input_scan_number\nwill be incremented by the time control arrives back at jpeg_start_output()).\nWith this technique, data is read from the input file only as needed, and\ninput and output processing run in lockstep.\n\nAfter reading the final scan and reaching the end of the input file, the\nbuffered image remains available; it can be read additional times by\nrepeating the jpeg_start_output()/jpeg_read_scanlines()/jpeg_finish_output()\nsequence.  For example, a useful technique is to use fast one-pass color\nquantization for display passes made while the image is arriving, followed by\na final display pass using two-pass quantization for highest quality.  This\nis done by changing the library parameters before the final output pass.\nChanging parameters between passes is discussed in detail below.\n\nIn general the last scan of a progressive file cannot be recognized as such\nuntil after it is read, so a post-input display pass is the best approach if\nyou want special processing in the final pass.\n\nWhen done with the image, be sure to call jpeg_finish_decompress() to release\nthe buffered image (or just use jpeg_destroy_decompress()).\n\nIf input data arrives faster than it can be displayed, the application can\ncause the library to decode input data in advance of what's needed to produce\noutput.  This is done by calling the routine jpeg_consume_input().\nThe return value is one of the following:\n\tJPEG_REACHED_SOS:    reached an SOS marker (the start of a new scan)\n\tJPEG_REACHED_EOI:    reached the EOI marker (end of image)\n\tJPEG_ROW_COMPLETED:  completed reading one MCU row of compressed data\n\tJPEG_SCAN_COMPLETED: completed reading last MCU row of current scan\n\tJPEG_SUSPENDED:      suspended before completing any of the above\n(JPEG_SUSPENDED can occur only if a suspending data source is used.)  This\nroutine can be called at any time after initializing the JPEG object.  It\nreads some additional data and returns when one of the indicated significant\nevents occurs.  (If called after the EOI marker is reached, it will\nimmediately return JPEG_REACHED_EOI without attempting to read more data.)\n\nThe library's output processing will automatically call jpeg_consume_input()\nwhenever the output processing overtakes the input; thus, simple lockstep\ndisplay requires no direct calls to jpeg_consume_input().  But by adding\ncalls to jpeg_consume_input(), you can absorb data in advance of what is\nbeing displayed.  This has two benefits:\n  * You can limit buildup of unprocessed data in your input buffer.\n  * You can eliminate extra display passes by paying attention to the\n    state of the library's input processing.\n\nThe first of these benefits only requires interspersing calls to\njpeg_consume_input() with your display operations and any other processing\nyou may be doing.  To avoid wasting cycles due to backtracking, it's best to\ncall jpeg_consume_input() only after a hundred or so new bytes have arrived.\nThis is discussed further under \"I/O suspension\", above.  (Note: the JPEG\nlibrary currently is not thread-safe.  You must not call jpeg_consume_input()\nfrom one thread of control if a different library routine is working on the\nsame JPEG object in another thread.)\n\nWhen input arrives fast enough that more than one new scan is available\nbefore you start a new output pass, you may as well skip the output pass\ncorresponding to the completed scan.  This occurs for free if you pass\ncinfo.input_scan_number as the target scan number to jpeg_start_output().\nThe input_scan_number field is simply the index of the scan currently being\nconsumed by the input processor.  You can ensure that this is up-to-date by\nemptying the input buffer just before calling jpeg_start_output(): call\njpeg_consume_input() repeatedly until it returns JPEG_SUSPENDED or\nJPEG_REACHED_EOI.\n\nThe target scan number passed to jpeg_start_output() is saved in the\ncinfo.output_scan_number field.  The library's output processing calls\njpeg_consume_input() whenever the current input scan number and row within\nthat scan is less than or equal to the current output scan number and row.\nThus, input processing can \"get ahead\" of the output processing but is not\nallowed to \"fall behind\".  You can achieve several different effects by\nmanipulating this interlock rule.  For example, if you pass a target scan\nnumber greater than the current input scan number, the output processor will\nwait until that scan starts to arrive before producing any output.  (To avoid\nan infinite loop, the target scan number is automatically reset to the last\nscan number when the end of image is reached.  Thus, if you specify a large\ntarget scan number, the library will just absorb the entire input file and\nthen perform an output pass.  This is effectively the same as what\njpeg_start_decompress() does when you don't select buffered-image mode.)\nWhen you pass a target scan number equal to the current input scan number,\nthe image is displayed no faster than the current input scan arrives.  The\nfinal possibility is to pass a target scan number less than the current input\nscan number; this disables the input/output interlock and causes the output\nprocessor to simply display whatever it finds in the image buffer, without\nwaiting for input.  (However, the library will not accept a target scan\nnumber less than one, so you can't avoid waiting for the first scan.)\n\nWhen data is arriving faster than the output display processing can advance\nthrough the image, jpeg_consume_input() will store data into the buffered\nimage beyond the point at which the output processing is reading data out\nagain.  If the input arrives fast enough, it may \"wrap around\" the buffer to\nthe point where the input is more than one whole scan ahead of the output.\nIf the output processing simply proceeds through its display pass without\npaying attention to the input, the effect seen on-screen is that the lower\npart of the image is one or more scans better in quality than the upper part.\nThen, when the next output scan is started, you have a choice of what target\nscan number to use.  The recommended choice is to use the current input scan\nnumber at that time, which implies that you've skipped the output scans\ncorresponding to the input scans that were completed while you processed the\nprevious output scan.  In this way, the decoder automatically adapts its\nspeed to the arriving data, by skipping output scans as necessary to keep up\nwith the arriving data.\n\nWhen using this strategy, you'll want to be sure that you perform a final\noutput pass after receiving all the data; otherwise your last display may not\nbe full quality across the whole screen.  So the right outer loop logic is\nsomething like this:\n\tdo {\n\t    absorb any waiting input by calling jpeg_consume_input()\n\t    final_pass = jpeg_input_complete(&cinfo);\n\t    adjust output decompression parameters if required\n\t    jpeg_start_output(&cinfo, cinfo.input_scan_number);\n\t    ...\n\t    jpeg_finish_output()\n\t} while (! final_pass);\nrather than quitting as soon as jpeg_input_complete() returns TRUE.  This\narrangement makes it simple to use higher-quality decoding parameters\nfor the final pass.  But if you don't want to use special parameters for\nthe final pass, the right loop logic is like this:\n\tfor (;;) {\n\t    absorb any waiting input by calling jpeg_consume_input()\n\t    jpeg_start_output(&cinfo, cinfo.input_scan_number);\n\t    ...\n\t    jpeg_finish_output()\n\t    if (jpeg_input_complete(&cinfo) &&\n\t        cinfo.input_scan_number == cinfo.output_scan_number)\n\t      break;\n\t}\nIn this case you don't need to know in advance whether an output pass is to\nbe the last one, so it's not necessary to have reached EOF before starting\nthe final output pass; rather, what you want to test is whether the output\npass was performed in sync with the final input scan.  This form of the loop\nwill avoid an extra output pass whenever the decoder is able (or nearly able)\nto keep up with the incoming data.\n\nWhen the data transmission speed is high, you might begin a display pass,\nthen find that much or all of the file has arrived before you can complete\nthe pass.  (You can detect this by noting the JPEG_REACHED_EOI return code\nfrom jpeg_consume_input(), or equivalently by testing jpeg_input_complete().)\nIn this situation you may wish to abort the current display pass and start a\nnew one using the newly arrived information.  To do so, just call\njpeg_finish_output() and then start a new pass with jpeg_start_output().\n\nA variant strategy is to abort and restart display if more than one complete\nscan arrives during an output pass; this can be detected by noting\nJPEG_REACHED_SOS returns and/or examining cinfo.input_scan_number.  This\nidea should be employed with caution, however, since the display process\nmight never get to the bottom of the image before being aborted, resulting\nin the lower part of the screen being several passes worse than the upper.\nIn most cases it's probably best to abort an output pass only if the whole\nfile has arrived and you want to begin the final output pass immediately.\n\nWhen receiving data across a communication link, we recommend always using\nthe current input scan number for the output target scan number; if a\nhigher-quality final pass is to be done, it should be started (aborting any\nincomplete output pass) as soon as the end of file is received.  However,\nmany other strategies are possible.  For example, the application can examine\nthe parameters of the current input scan and decide whether to display it or\nnot.  If the scan contains only chroma data, one might choose not to use it\nas the target scan, expecting that the scan will be small and will arrive\nquickly.  To skip to the next scan, call jpeg_consume_input() until it\nreturns JPEG_REACHED_SOS or JPEG_REACHED_EOI.  Or just use the next higher\nnumber as the target scan for jpeg_start_output(); but that method doesn't\nlet you inspect the next scan's parameters before deciding to display it.\n\n\nIn buffered-image mode, jpeg_start_decompress() never performs input and\nthus never suspends.  An application that uses input suspension with\nbuffered-image mode must be prepared for suspension returns from these\nroutines:\n* jpeg_start_output() performs input only if you request 2-pass quantization\n  and the target scan isn't fully read yet.  (This is discussed below.)\n* jpeg_read_scanlines(), as always, returns the number of scanlines that it\n  was able to produce before suspending.\n* jpeg_finish_output() will read any markers following the target scan,\n  up to the end of the file or the SOS marker that begins another scan.\n  (But it reads no input if jpeg_consume_input() has already reached the\n  end of the file or a SOS marker beyond the target output scan.)\n* jpeg_finish_decompress() will read until the end of file, and thus can\n  suspend if the end hasn't already been reached (as can be tested by\n  calling jpeg_input_complete()).\njpeg_start_output(), jpeg_finish_output(), and jpeg_finish_decompress()\nall return TRUE if they completed their tasks, FALSE if they had to suspend.\nIn the event of a FALSE return, the application must load more input data\nand repeat the call.  Applications that use non-suspending data sources need\nnot check the return values of these three routines.\n\n\nIt is possible to change decoding parameters between output passes in the\nbuffered-image mode.  The decoder library currently supports only very\nlimited changes of parameters.  ONLY THE FOLLOWING parameter changes are\nallowed after jpeg_start_decompress() is called:\n* dct_method can be changed before each call to jpeg_start_output().\n  For example, one could use a fast DCT method for early scans, changing\n  to a higher quality method for the final scan.\n* dither_mode can be changed before each call to jpeg_start_output();\n  of course this has no impact if not using color quantization.  Typically\n  one would use ordered dither for initial passes, then switch to\n  Floyd-Steinberg dither for the final pass.  Caution: changing dither mode\n  can cause more memory to be allocated by the library.  Although the amount\n  of memory involved is not large (a scanline or so), it may cause the\n  initial max_memory_to_use specification to be exceeded, which in the worst\n  case would result in an out-of-memory failure.\n* do_block_smoothing can be changed before each call to jpeg_start_output().\n  This setting is relevant only when decoding a progressive JPEG image.\n  During the first DC-only scan, block smoothing provides a very \"fuzzy\" look\n  instead of the very \"blocky\" look seen without it; which is better seems a\n  matter of personal taste.  But block smoothing is nearly always a win\n  during later stages, especially when decoding a successive-approximation\n  image: smoothing helps to hide the slight blockiness that otherwise shows\n  up on smooth gradients until the lowest coefficient bits are sent.\n* Color quantization mode can be changed under the rules described below.\n  You *cannot* change between full-color and quantized output (because that\n  would alter the required I/O buffer sizes), but you can change which\n  quantization method is used.\n\nWhen generating color-quantized output, changing quantization method is a\nvery useful way of switching between high-speed and high-quality display.\nThe library allows you to change among its three quantization methods:\n1. Single-pass quantization to a fixed color cube.\n   Selected by cinfo.two_pass_quantize = FALSE and cinfo.colormap = NULL.\n2. Single-pass quantization to an application-supplied colormap.\n   Selected by setting cinfo.colormap to point to the colormap (the value of\n   two_pass_quantize is ignored); also set cinfo.actual_number_of_colors.\n3. Two-pass quantization to a colormap chosen specifically for the image.\n   Selected by cinfo.two_pass_quantize = TRUE and cinfo.colormap = NULL.\n   (This is the default setting selected by jpeg_read_header, but it is\n   probably NOT what you want for the first pass of progressive display!)\nThese methods offer successively better quality and lesser speed.  However,\nonly the first method is available for quantizing in non-RGB color spaces.\n\nIMPORTANT: because the different quantizer methods have very different\nworking-storage requirements, the library requires you to indicate which\none(s) you intend to use before you call jpeg_start_decompress().  (If we did\nnot require this, the max_memory_to_use setting would be a complete fiction.)\nYou do this by setting one or more of these three cinfo fields to TRUE:\n\tenable_1pass_quant\t\tFixed color cube colormap\n\tenable_external_quant\t\tExternally-supplied colormap\n\tenable_2pass_quant\t\tTwo-pass custom colormap\nAll three are initialized FALSE by jpeg_read_header().  But\njpeg_start_decompress() automatically sets TRUE the one selected by the\ncurrent two_pass_quantize and colormap settings, so you only need to set the\nenable flags for any other quantization methods you plan to change to later.\n\nAfter setting the enable flags correctly at jpeg_start_decompress() time, you\ncan change to any enabled quantization method by setting two_pass_quantize\nand colormap properly just before calling jpeg_start_output().  The following\nspecial rules apply:\n1. You must explicitly set cinfo.colormap to NULL when switching to 1-pass\n   or 2-pass mode from a different mode, or when you want the 2-pass\n   quantizer to be re-run to generate a new colormap.\n2. To switch to an external colormap, or to change to a different external\n   colormap than was used on the prior pass, you must call\n   jpeg_new_colormap() after setting cinfo.colormap.\nNOTE: if you want to use the same colormap as was used in the prior pass,\nyou should not do either of these things.  This will save some nontrivial\nswitchover costs.\n(These requirements exist because cinfo.colormap will always be non-NULL\nafter completing a prior output pass, since both the 1-pass and 2-pass\nquantizers set it to point to their output colormaps.  Thus you have to\ndo one of these two things to notify the library that something has changed.\nYup, it's a bit klugy, but it's necessary to do it this way for backwards\ncompatibility.)\n\nNote that in buffered-image mode, the library generates any requested colormap\nduring jpeg_start_output(), not during jpeg_start_decompress().\n\nWhen using two-pass quantization, jpeg_start_output() makes a pass over the\nbuffered image to determine the optimum color map; it therefore may take a\nsignificant amount of time, whereas ordinarily it does little work.  The\nprogress monitor hook is called during this pass, if defined.  It is also\nimportant to realize that if the specified target scan number is greater than\nor equal to the current input scan number, jpeg_start_output() will attempt\nto consume input as it makes this pass.  If you use a suspending data source,\nyou need to check for a FALSE return from jpeg_start_output() under these\nconditions.  The combination of 2-pass quantization and a not-yet-fully-read\ntarget scan is the only case in which jpeg_start_output() will consume input.\n\n\nApplication authors who support buffered-image mode may be tempted to use it\nfor all JPEG images, even single-scan ones.  This will work, but it is\ninefficient: there is no need to create an image-sized coefficient buffer for\nsingle-scan images.  Requesting buffered-image mode for such an image wastes\nmemory.  Worse, it can cost time on large images, since the buffered data has\nto be swapped out or written to a temporary file.  If you are concerned about\nmaximum performance on baseline JPEG files, you should use buffered-image\nmode only when the incoming file actually has multiple scans.  This can be\ntested by calling jpeg_has_multiple_scans(), which will return a correct\nresult at any time after jpeg_read_header() completes.\n\nIt is also worth noting that when you use jpeg_consume_input() to let input\nprocessing get ahead of output processing, the resulting pattern of access to\nthe coefficient buffer is quite nonsequential.  It's best to use the memory\nmanager jmemnobs.c if you can (ie, if you have enough real or virtual main\nmemory).  If not, at least make sure that max_memory_to_use is set as high as\npossible.  If the JPEG memory manager has to use a temporary file, you will\nprobably see a lot of disk traffic and poor performance.  (This could be\nimproved with additional work on the memory manager, but we haven't gotten\naround to it yet.)\n\nIn some applications it may be convenient to use jpeg_consume_input() for all\ninput processing, including reading the initial markers; that is, you may\nwish to call jpeg_consume_input() instead of jpeg_read_header() during\nstartup.  This works, but note that you must check for JPEG_REACHED_SOS and\nJPEG_REACHED_EOI return codes as the equivalent of jpeg_read_header's codes.\nOnce the first SOS marker has been reached, you must call\njpeg_start_decompress() before jpeg_consume_input() will consume more input;\nit'll just keep returning JPEG_REACHED_SOS until you do.  If you read a\ntables-only file this way, jpeg_consume_input() will return JPEG_REACHED_EOI\nwithout ever returning JPEG_REACHED_SOS; be sure to check for this case.\nIf this happens, the decompressor will not read any more input until you call\njpeg_abort() to reset it.  It is OK to call jpeg_consume_input() even when not\nusing buffered-image mode, but in that case it's basically a no-op after the\ninitial markers have been read: it will just return JPEG_SUSPENDED.\n\n\nAbbreviated datastreams and multiple images\n-------------------------------------------\n\nA JPEG compression or decompression object can be reused to process multiple\nimages.  This saves a small amount of time per image by eliminating the\n\"create\" and \"destroy\" operations, but that isn't the real purpose of the\nfeature.  Rather, reuse of an object provides support for abbreviated JPEG\ndatastreams.  Object reuse can also simplify processing a series of images in\na single input or output file.  This section explains these features.\n\nA JPEG file normally contains several hundred bytes worth of quantization\nand Huffman tables.  In a situation where many images will be stored or\ntransmitted with identical tables, this may represent an annoying overhead.\nThe JPEG standard therefore permits tables to be omitted.  The standard\ndefines three classes of JPEG datastreams:\n  * \"Interchange\" datastreams contain an image and all tables needed to decode\n     the image.  These are the usual kind of JPEG file.\n  * \"Abbreviated image\" datastreams contain an image, but are missing some or\n    all of the tables needed to decode that image.\n  * \"Abbreviated table specification\" (henceforth \"tables-only\") datastreams\n    contain only table specifications.\nTo decode an abbreviated image, it is necessary to load the missing table(s)\ninto the decoder beforehand.  This can be accomplished by reading a separate\ntables-only file.  A variant scheme uses a series of images in which the first\nimage is an interchange (complete) datastream, while subsequent ones are\nabbreviated and rely on the tables loaded by the first image.  It is assumed\nthat once the decoder has read a table, it will remember that table until a\nnew definition for the same table number is encountered.\n\nIt is the application designer's responsibility to figure out how to associate\nthe correct tables with an abbreviated image.  While abbreviated datastreams\ncan be useful in a closed environment, their use is strongly discouraged in\nany situation where data exchange with other applications might be needed.\nCaveat designer.\n\nThe JPEG library provides support for reading and writing any combination of\ntables-only datastreams and abbreviated images.  In both compression and\ndecompression objects, a quantization or Huffman table will be retained for\nthe lifetime of the object, unless it is overwritten by a new table definition.\n\n\nTo create abbreviated image datastreams, it is only necessary to tell the\ncompressor not to emit some or all of the tables it is using.  Each\nquantization and Huffman table struct contains a boolean field \"sent_table\",\nwhich normally is initialized to FALSE.  For each table used by the image, the\nheader-writing process emits the table and sets sent_table = TRUE unless it is\nalready TRUE.  (In normal usage, this prevents outputting the same table\ndefinition multiple times, as would otherwise occur because the chroma\ncomponents typically share tables.)  Thus, setting this field to TRUE before\ncalling jpeg_start_compress() will prevent the table from being written at\nall.\n\nIf you want to create a \"pure\" abbreviated image file containing no tables,\njust call \"jpeg_suppress_tables(&cinfo, TRUE)\" after constructing all the\ntables.  If you want to emit some but not all tables, you'll need to set the\nindividual sent_table fields directly.\n\nTo create an abbreviated image, you must also call jpeg_start_compress()\nwith a second parameter of FALSE, not TRUE.  Otherwise jpeg_start_compress()\nwill force all the sent_table fields to FALSE.  (This is a safety feature to\nprevent abbreviated images from being created accidentally.)\n\nTo create a tables-only file, perform the same parameter setup that you\nnormally would, but instead of calling jpeg_start_compress() and so on, call\njpeg_write_tables(&cinfo).  This will write an abbreviated datastream\ncontaining only SOI, DQT and/or DHT markers, and EOI.  All the quantization\nand Huffman tables that are currently defined in the compression object will\nbe emitted unless their sent_tables flag is already TRUE, and then all the\nsent_tables flags will be set TRUE.\n\nA sure-fire way to create matching tables-only and abbreviated image files\nis to proceed as follows:\n\n\tcreate JPEG compression object\n\tset JPEG parameters\n\tset destination to tables-only file\n\tjpeg_write_tables(&cinfo);\n\tset destination to image file\n\tjpeg_start_compress(&cinfo, FALSE);\n\twrite data...\n\tjpeg_finish_compress(&cinfo);\n\nSince the JPEG parameters are not altered between writing the table file and\nthe abbreviated image file, the same tables are sure to be used.  Of course,\nyou can repeat the jpeg_start_compress() ... jpeg_finish_compress() sequence\nmany times to produce many abbreviated image files matching the table file.\n\nYou cannot suppress output of the computed Huffman tables when Huffman\noptimization is selected.  (If you could, there'd be no way to decode the\nimage...)  Generally, you don't want to set optimize_coding = TRUE when\nyou are trying to produce abbreviated files.\n\nIn some cases you might want to compress an image using tables which are\nnot stored in the application, but are defined in an interchange or\ntables-only file readable by the application.  This can be done by setting up\na JPEG decompression object to read the specification file, then copying the\ntables into your compression object.  See jpeg_copy_critical_parameters()\nfor an example of copying quantization tables.\n\n\nTo read abbreviated image files, you simply need to load the proper tables\ninto the decompression object before trying to read the abbreviated image.\nIf the proper tables are stored in the application program, you can just\nallocate the table structs and fill in their contents directly.  For example,\nto load a fixed quantization table into table slot \"n\":\n\n    if (cinfo.quant_tbl_ptrs[n] == NULL)\n      cinfo.quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr) &cinfo);\n    quant_ptr = cinfo.quant_tbl_ptrs[n];\t/* quant_ptr is JQUANT_TBL* */\n    for (i = 0; i < 64; i++) {\n      /* Qtable[] is desired quantization table, in natural array order */\n      quant_ptr->quantval[i] = Qtable[i];\n    }\n\nCode to load a fixed Huffman table is typically (for AC table \"n\"):\n\n    if (cinfo.ac_huff_tbl_ptrs[n] == NULL)\n      cinfo.ac_huff_tbl_ptrs[n] = jpeg_alloc_huff_table((j_common_ptr) &cinfo);\n    huff_ptr = cinfo.ac_huff_tbl_ptrs[n];\t/* huff_ptr is JHUFF_TBL* */\n    for (i = 1; i <= 16; i++) {\n      /* counts[i] is number of Huffman codes of length i bits, i=1..16 */\n      huff_ptr->bits[i] = counts[i];\n    }\n    for (i = 0; i < 256; i++) {\n      /* symbols[] is the list of Huffman symbols, in code-length order */\n      huff_ptr->huffval[i] = symbols[i];\n    }\n\n(Note that trying to set cinfo.quant_tbl_ptrs[n] to point directly at a\nconstant JQUANT_TBL object is not safe.  If the incoming file happened to\ncontain a quantization table definition, your master table would get\noverwritten!  Instead allocate a working table copy and copy the master table\ninto it, as illustrated above.  Ditto for Huffman tables, of course.)\n\nYou might want to read the tables from a tables-only file, rather than\nhard-wiring them into your application.  The jpeg_read_header() call is\nsufficient to read a tables-only file.  You must pass a second parameter of\nFALSE to indicate that you do not require an image to be present.  Thus, the\ntypical scenario is\n\n\tcreate JPEG decompression object\n\tset source to tables-only file\n\tjpeg_read_header(&cinfo, FALSE);\n\tset source to abbreviated image file\n\tjpeg_read_header(&cinfo, TRUE);\n\tset decompression parameters\n\tjpeg_start_decompress(&cinfo);\n\tread data...\n\tjpeg_finish_decompress(&cinfo);\n\nIn some cases, you may want to read a file without knowing whether it contains\nan image or just tables.  In that case, pass FALSE and check the return value\nfrom jpeg_read_header(): it will be JPEG_HEADER_OK if an image was found,\nJPEG_HEADER_TABLES_ONLY if only tables were found.  (A third return value,\nJPEG_SUSPENDED, is possible when using a suspending data source manager.)\nNote that jpeg_read_header() will not complain if you read an abbreviated\nimage for which you haven't loaded the missing tables; the missing-table check\noccurs later, in jpeg_start_decompress().\n\n\nIt is possible to read a series of images from a single source file by\nrepeating the jpeg_read_header() ... jpeg_finish_decompress() sequence,\nwithout releasing/recreating the JPEG object or the data source module.\n(If you did reinitialize, any partial bufferload left in the data source\nbuffer at the end of one image would be discarded, causing you to lose the\nstart of the next image.)  When you use this method, stored tables are\nautomatically carried forward, so some of the images can be abbreviated images\nthat depend on tables from earlier images.\n\nIf you intend to write a series of images into a single destination file,\nyou might want to make a specialized data destination module that doesn't\nflush the output buffer at term_destination() time.  This would speed things\nup by some trifling amount.  Of course, you'd need to remember to flush the\nbuffer after the last image.  You can make the later images be abbreviated\nones by passing FALSE to jpeg_start_compress().\n\n\nSpecial markers\n---------------\n\nSome applications may need to insert or extract special data in the JPEG\ndatastream.  The JPEG standard provides marker types \"COM\" (comment) and\n\"APP0\" through \"APP15\" (application) to hold application-specific data.\nUnfortunately, the use of these markers is not specified by the standard.\nCOM markers are fairly widely used to hold user-supplied text.  The JFIF file\nformat spec uses APP0 markers with specified initial strings to hold certain\ndata.  Adobe applications use APP14 markers beginning with the string \"Adobe\"\nfor miscellaneous data.  Other APPn markers are rarely seen, but might\ncontain almost anything.\n\nIf you wish to store user-supplied text, we recommend you use COM markers\nand place readable 7-bit ASCII text in them.  Newline conventions are not\nstandardized --- expect to find LF (Unix style), CR/LF (DOS style), or CR\n(Mac style).  A robust COM reader should be able to cope with random binary\ngarbage, including nulls, since some applications generate COM markers\ncontaining non-ASCII junk.  (But yours should not be one of them.)\n\nFor program-supplied data, use an APPn marker, and be sure to begin it with an\nidentifying string so that you can tell whether the marker is actually yours.\nIt's probably best to avoid using APP0 or APP14 for any private markers.\n(NOTE: the upcoming SPIFF standard will use APP8 markers; we recommend you\nnot use APP8 markers for any private purposes, either.)\n\nKeep in mind that at most 65533 bytes can be put into one marker, but you\ncan have as many markers as you like.\n\nBy default, the IJG compression library will write a JFIF APP0 marker if the\nselected JPEG colorspace is grayscale or YCbCr, or an Adobe APP14 marker if\nthe selected colorspace is RGB, CMYK, or YCCK.  You can disable this, but\nwe don't recommend it.  The decompression library will recognize JFIF and\nAdobe markers and will set the JPEG colorspace properly when one is found.\n\n\nYou can write special markers immediately following the datastream header by\ncalling jpeg_write_marker() after jpeg_start_compress() and before the first\ncall to jpeg_write_scanlines().  When you do this, the markers appear after\nthe SOI and the JFIF APP0 and Adobe APP14 markers (if written), but before\nall else.  Specify the marker type parameter as \"JPEG_COM\" for COM or\n\"JPEG_APP0 + n\" for APPn.  (Actually, jpeg_write_marker will let you write\nany marker type, but we don't recommend writing any other kinds of marker.)\nFor example, to write a user comment string pointed to by comment_text:\n\tjpeg_write_marker(cinfo, JPEG_COM, comment_text, strlen(comment_text));\n\nIf it's not convenient to store all the marker data in memory at once,\nyou can instead call jpeg_write_m_header() followed by multiple calls to\njpeg_write_m_byte().  If you do it this way, it's your responsibility to\ncall jpeg_write_m_byte() exactly the number of times given in the length\nparameter to jpeg_write_m_header().  (This method lets you empty the\noutput buffer partway through a marker, which might be important when\nusing a suspending data destination module.  In any case, if you are using\na suspending destination, you should flush its buffer after inserting\nany special markers.  See \"I/O suspension\".)\n\nOr, if you prefer to synthesize the marker byte sequence yourself,\nyou can just cram it straight into the data destination module.\n\nIf you are writing JFIF 1.02 extension markers (thumbnail images), don't\nforget to set cinfo.JFIF_minor_version = 2 so that the encoder will write the\ncorrect JFIF version number in the JFIF header marker.  The library's default\nis to write version 1.01, but that's wrong if you insert any 1.02 extension\nmarkers.  (We could probably get away with just defaulting to 1.02, but there\nused to be broken decoders that would complain about unknown minor version\nnumbers.  To reduce compatibility risks it's safest not to write 1.02 unless\nyou are actually using 1.02 extensions.)\n\n\nWhen reading, two methods of handling special markers are available:\n1. You can ask the library to save the contents of COM and/or APPn markers\ninto memory, and then examine them at your leisure afterwards.\n2. You can supply your own routine to process COM and/or APPn markers\non-the-fly as they are read.\nThe first method is simpler to use, especially if you are using a suspending\ndata source; writing a marker processor that copes with input suspension is\nnot easy (consider what happens if the marker is longer than your available\ninput buffer).  However, the second method conserves memory since the marker\ndata need not be kept around after it's been processed.\n\nFor either method, you'd normally set up marker handling after creating a\ndecompression object and before calling jpeg_read_header(), because the\nmarkers of interest will typically be near the head of the file and so will\nbe scanned by jpeg_read_header.  Once you've established a marker handling\nmethod, it will be used for the life of that decompression object\n(potentially many datastreams), unless you change it.  Marker handling is\ndetermined separately for COM markers and for each APPn marker code.\n\n\nTo save the contents of special markers in memory, call\n\tjpeg_save_markers(cinfo, marker_code, length_limit)\nwhere marker_code is the marker type to save, JPEG_COM or JPEG_APP0+n.\n(To arrange to save all the special marker types, you need to call this\nroutine 17 times, for COM and APP0-APP15.)  If the incoming marker is longer\nthan length_limit data bytes, only length_limit bytes will be saved; this\nparameter allows you to avoid chewing up memory when you only need to see the\nfirst few bytes of a potentially large marker.  If you want to save all the\ndata, set length_limit to 0xFFFF; that is enough since marker lengths are only\n16 bits.  As a special case, setting length_limit to 0 prevents that marker\ntype from being saved at all.  (That is the default behavior, in fact.)\n\nAfter jpeg_read_header() completes, you can examine the special markers by\nfollowing the cinfo->marker_list pointer chain.  All the special markers in\nthe file appear in this list, in order of their occurrence in the file (but\nomitting any markers of types you didn't ask for).  Both the original data\nlength and the saved data length are recorded for each list entry; the latter\nwill not exceed length_limit for the particular marker type.  Note that these\nlengths exclude the marker length word, whereas the stored representation\nwithin the JPEG file includes it.  (Hence the maximum data length is really\nonly 65533.)\n\nIt is possible that additional special markers appear in the file beyond the\nSOS marker at which jpeg_read_header stops; if so, the marker list will be\nextended during reading of the rest of the file.  This is not expected to be\ncommon, however.  If you are short on memory you may want to reset the length\nlimit to zero for all marker types after finishing jpeg_read_header, to\nensure that the max_memory_to_use setting cannot be exceeded due to addition\nof later markers.\n\nThe marker list remains stored until you call jpeg_finish_decompress or\njpeg_abort, at which point the memory is freed and the list is set to empty.\n(jpeg_destroy also releases the storage, of course.)\n\nNote that the library is internally interested in APP0 and APP14 markers;\nif you try to set a small nonzero length limit on these types, the library\nwill silently force the length up to the minimum it wants.  (But you can set\na zero length limit to prevent them from being saved at all.)  Also, in a\n16-bit environment, the maximum length limit may be constrained to less than\n65533 by malloc() limitations.  It is therefore best not to assume that the\neffective length limit is exactly what you set it to be.\n\n\nIf you want to supply your own marker-reading routine, you do it by calling\njpeg_set_marker_processor().  A marker processor routine must have the\nsignature\n\tboolean jpeg_marker_parser_method (j_decompress_ptr cinfo)\nAlthough the marker code is not explicitly passed, the routine can find it\nin cinfo->unread_marker.  At the time of call, the marker proper has been\nread from the data source module.  The processor routine is responsible for\nreading the marker length word and the remaining parameter bytes, if any.\nReturn TRUE to indicate success.  (FALSE should be returned only if you are\nusing a suspending data source and it tells you to suspend.  See the standard\nmarker processors in jdmarker.c for appropriate coding methods if you need to\nuse a suspending data source.)\n\nIf you override the default APP0 or APP14 processors, it is up to you to\nrecognize JFIF and Adobe markers if you want colorspace recognition to occur\nproperly.  We recommend copying and extending the default processors if you\nwant to do that.  (A better idea is to save these marker types for later\nexamination by calling jpeg_save_markers(); that method doesn't interfere\nwith the library's own processing of these markers.)\n\njpeg_set_marker_processor() and jpeg_save_markers() are mutually exclusive\n--- if you call one it overrides any previous call to the other, for the\nparticular marker type specified.\n\nA simple example of an external COM processor can be found in djpeg.c.\nAlso, see jpegtran.c for an example of using jpeg_save_markers.\n\n\nRaw (downsampled) image data\n----------------------------\n\nSome applications need to supply already-downsampled image data to the JPEG\ncompressor, or to receive raw downsampled data from the decompressor.  The\nlibrary supports this requirement by allowing the application to write or\nread raw data, bypassing the normal preprocessing or postprocessing steps.\nThe interface is different from the standard one and is somewhat harder to\nuse.  If your interest is merely in bypassing color conversion, we recommend\nthat you use the standard interface and simply set jpeg_color_space =\nin_color_space (or jpeg_color_space = out_color_space for decompression).\nThe mechanism described in this section is necessary only to supply or\nreceive downsampled image data, in which not all components have the same\ndimensions.\n\n\nTo compress raw data, you must supply the data in the colorspace to be used\nin the JPEG file (please read the earlier section on Special color spaces)\nand downsampled to the sampling factors specified in the JPEG parameters.\nYou must supply the data in the format used internally by the JPEG library,\nnamely a JSAMPIMAGE array.  This is an array of pointers to two-dimensional\narrays, each of type JSAMPARRAY.  Each 2-D array holds the values for one\ncolor component.  This structure is necessary since the components are of\ndifferent sizes.  If the image dimensions are not a multiple of the MCU size,\nyou must also pad the data correctly (usually, this is done by replicating\nthe last column and/or row).  The data must be padded to a multiple of a DCT\nblock in each component: that is, each downsampled row must contain a\nmultiple of 8 valid samples, and there must be a multiple of 8 sample rows\nfor each component.  (For applications such as conversion of digital TV\nimages, the standard image size is usually a multiple of the DCT block size,\nso that no padding need actually be done.)\n\nThe procedure for compression of raw data is basically the same as normal\ncompression, except that you call jpeg_write_raw_data() in place of\njpeg_write_scanlines().  Before calling jpeg_start_compress(), you must do\nthe following:\n  * Set cinfo->raw_data_in to TRUE.  (It is set FALSE by jpeg_set_defaults().)\n    This notifies the library that you will be supplying raw data.\n  * Ensure jpeg_color_space is correct --- an explicit jpeg_set_colorspace()\n    call is a good idea.  Note that since color conversion is bypassed,\n    in_color_space is ignored, except that jpeg_set_defaults() uses it to\n    choose the default jpeg_color_space setting.\n  * Ensure the sampling factors, cinfo->comp_info[i].h_samp_factor and\n    cinfo->comp_info[i].v_samp_factor, are correct.  Since these indicate the\n    dimensions of the data you are supplying, it's wise to set them\n    explicitly, rather than assuming the library's defaults are what you want.\n\nTo pass raw data to the library, call jpeg_write_raw_data() in place of\njpeg_write_scanlines().  The two routines work similarly except that\njpeg_write_raw_data takes a JSAMPIMAGE data array rather than JSAMPARRAY.\nThe scanlines count passed to and returned from jpeg_write_raw_data is\nmeasured in terms of the component with the largest v_samp_factor.\n\njpeg_write_raw_data() processes one MCU row per call, which is to say\nv_samp_factor*DCTSIZE sample rows of each component.  The passed num_lines\nvalue must be at least max_v_samp_factor*DCTSIZE, and the return value will\nbe exactly that amount (or possibly some multiple of that amount, in future\nlibrary versions).  This is true even on the last call at the bottom of the\nimage; don't forget to pad your data as necessary.\n\nThe required dimensions of the supplied data can be computed for each\ncomponent as\n\tcinfo->comp_info[i].width_in_blocks*DCTSIZE  samples per row\n\tcinfo->comp_info[i].height_in_blocks*DCTSIZE rows in image\nafter jpeg_start_compress() has initialized those fields.  If the valid data\nis smaller than this, it must be padded appropriately.  For some sampling\nfactors and image sizes, additional dummy DCT blocks are inserted to make\nthe image a multiple of the MCU dimensions.  The library creates such dummy\nblocks itself; it does not read them from your supplied data.  Therefore you\nneed never pad by more than DCTSIZE samples.  An example may help here.\nAssume 2h2v downsampling of YCbCr data, that is\n\tcinfo->comp_info[0].h_samp_factor = 2\t\tfor Y\n\tcinfo->comp_info[0].v_samp_factor = 2\n\tcinfo->comp_info[1].h_samp_factor = 1\t\tfor Cb\n\tcinfo->comp_info[1].v_samp_factor = 1\n\tcinfo->comp_info[2].h_samp_factor = 1\t\tfor Cr\n\tcinfo->comp_info[2].v_samp_factor = 1\nand suppose that the nominal image dimensions (cinfo->image_width and\ncinfo->image_height) are 101x101 pixels.  Then jpeg_start_compress() will\ncompute downsampled_width = 101 and width_in_blocks = 13 for Y,\ndownsampled_width = 51 and width_in_blocks = 7 for Cb and Cr (and the same\nfor the height fields).  You must pad the Y data to at least 13*8 = 104\ncolumns and rows, the Cb/Cr data to at least 7*8 = 56 columns and rows.  The\nMCU height is max_v_samp_factor = 2 DCT rows so you must pass at least 16\nscanlines on each call to jpeg_write_raw_data(), which is to say 16 actual\nsample rows of Y and 8 each of Cb and Cr.  A total of 7 MCU rows are needed,\nso you must pass a total of 7*16 = 112 \"scanlines\".  The last DCT block row\nof Y data is dummy, so it doesn't matter what you pass for it in the data\narrays, but the scanlines count must total up to 112 so that all of the Cb\nand Cr data gets passed.\n\nOutput suspension is supported with raw-data compression: if the data\ndestination module suspends, jpeg_write_raw_data() will return 0.\nIn this case the same data rows must be passed again on the next call.\n\n\nDecompression with raw data output implies bypassing all postprocessing:\nyou cannot ask for rescaling or color quantization, for instance.  More\nseriously, you must deal with the color space and sampling factors present in\nthe incoming file.  If your application only handles, say, 2h1v YCbCr data,\nyou must check for and fail on other color spaces or other sampling factors.\nThe library will not convert to a different color space for you.\n\nTo obtain raw data output, set cinfo->raw_data_out = TRUE before\njpeg_start_decompress() (it is set FALSE by jpeg_read_header()).  Be sure to\nverify that the color space and sampling factors are ones you can handle.\nThen call jpeg_read_raw_data() in place of jpeg_read_scanlines().  The\ndecompression process is otherwise the same as usual.\n\njpeg_read_raw_data() returns one MCU row per call, and thus you must pass a\nbuffer of at least max_v_samp_factor*DCTSIZE scanlines (scanline counting is\nthe same as for raw-data compression).  The buffer you pass must be large\nenough to hold the actual data plus padding to DCT-block boundaries.  As with\ncompression, any entirely dummy DCT blocks are not processed so you need not\nallocate space for them, but the total scanline count includes them.  The\nabove example of computing buffer dimensions for raw-data compression is\nequally valid for decompression.\n\nInput suspension is supported with raw-data decompression: if the data source\nmodule suspends, jpeg_read_raw_data() will return 0.  You can also use\nbuffered-image mode to read raw data in multiple passes.\n\n\nReally raw data: DCT coefficients\n---------------------------------\n\nIt is possible to read or write the contents of a JPEG file as raw DCT\ncoefficients.  This facility is mainly intended for use in lossless\ntranscoding between different JPEG file formats.  Other possible applications\ninclude lossless cropping of a JPEG image, lossless reassembly of a\nmulti-strip or multi-tile TIFF/JPEG file into a single JPEG datastream, etc.\n\nTo read the contents of a JPEG file as DCT coefficients, open the file and do\njpeg_read_header() as usual.  But instead of calling jpeg_start_decompress()\nand jpeg_read_scanlines(), call jpeg_read_coefficients().  This will read the\nentire image into a set of virtual coefficient-block arrays, one array per\ncomponent.  The return value is a pointer to an array of virtual-array\ndescriptors.  Each virtual array can be accessed directly using the JPEG\nmemory manager's access_virt_barray method (see Memory management, below,\nand also read structure.txt's discussion of virtual array handling).  Or,\nfor simple transcoding to a different JPEG file format, the array list can\njust be handed directly to jpeg_write_coefficients().\n\nEach block in the block arrays contains quantized coefficient values in\nnormal array order (not JPEG zigzag order).  The block arrays contain only\nDCT blocks containing real data; any entirely-dummy blocks added to fill out\ninterleaved MCUs at the right or bottom edges of the image are discarded\nduring reading and are not stored in the block arrays.  (The size of each\nblock array can be determined from the width_in_blocks and height_in_blocks\nfields of the component's comp_info entry.)  This is also the data format\nexpected by jpeg_write_coefficients().\n\nWhen you are done using the virtual arrays, call jpeg_finish_decompress()\nto release the array storage and return the decompression object to an idle\nstate; or just call jpeg_destroy() if you don't need to reuse the object.\n\nIf you use a suspending data source, jpeg_read_coefficients() will return\nNULL if it is forced to suspend; a non-NULL return value indicates successful\ncompletion.  You need not test for a NULL return value when using a\nnon-suspending data source.\n\nIt is also possible to call jpeg_read_coefficients() to obtain access to the\ndecoder's coefficient arrays during a normal decode cycle in buffered-image\nmode.  This frammish might be useful for progressively displaying an incoming\nimage and then re-encoding it without loss.  To do this, decode in buffered-\nimage mode as discussed previously, then call jpeg_read_coefficients() after\nthe last jpeg_finish_output() call.  The arrays will be available for your use\nuntil you call jpeg_finish_decompress().\n\n\nTo write the contents of a JPEG file as DCT coefficients, you must provide\nthe DCT coefficients stored in virtual block arrays.  You can either pass\nblock arrays read from an input JPEG file by jpeg_read_coefficients(), or\nallocate virtual arrays from the JPEG compression object and fill them\nyourself.  In either case, jpeg_write_coefficients() is substituted for\njpeg_start_compress() and jpeg_write_scanlines().  Thus the sequence is\n  * Create compression object\n  * Set all compression parameters as necessary\n  * Request virtual arrays if needed\n  * jpeg_write_coefficients()\n  * jpeg_finish_compress()\n  * Destroy or re-use compression object\njpeg_write_coefficients() is passed a pointer to an array of virtual block\narray descriptors; the number of arrays is equal to cinfo.num_components.\n\nThe virtual arrays need only have been requested, not realized, before\njpeg_write_coefficients() is called.  A side-effect of\njpeg_write_coefficients() is to realize any virtual arrays that have been\nrequested from the compression object's memory manager.  Thus, when obtaining\nthe virtual arrays from the compression object, you should fill the arrays\nafter calling jpeg_write_coefficients().  The data is actually written out\nwhen you call jpeg_finish_compress(); jpeg_write_coefficients() only writes\nthe file header.\n\nWhen writing raw DCT coefficients, it is crucial that the JPEG quantization\ntables and sampling factors match the way the data was encoded, or the\nresulting file will be invalid.  For transcoding from an existing JPEG file,\nwe recommend using jpeg_copy_critical_parameters().  This routine initializes\nall the compression parameters to default values (like jpeg_set_defaults()),\nthen copies the critical information from a source decompression object.\nThe decompression object should have just been used to read the entire\nJPEG input file --- that is, it should be awaiting jpeg_finish_decompress().\n\njpeg_write_coefficients() marks all tables stored in the compression object\nas needing to be written to the output file (thus, it acts like\njpeg_start_compress(cinfo, TRUE)).  This is for safety's sake, to avoid\nemitting abbreviated JPEG files by accident.  If you really want to emit an\nabbreviated JPEG file, call jpeg_suppress_tables(), or set the tables'\nindividual sent_table flags, between calling jpeg_write_coefficients() and\njpeg_finish_compress().\n\n\nProgress monitoring\n-------------------\n\nSome applications may need to regain control from the JPEG library every so\noften.  The typical use of this feature is to produce a percent-done bar or\nother progress display.  (For a simple example, see cjpeg.c or djpeg.c.)\nAlthough you do get control back frequently during the data-transferring pass\n(the jpeg_read_scanlines or jpeg_write_scanlines loop), any additional passes\nwill occur inside jpeg_finish_compress or jpeg_start_decompress; those\nroutines may take a long time to execute, and you don't get control back\nuntil they are done.\n\nYou can define a progress-monitor routine which will be called periodically\nby the library.  No guarantees are made about how often this call will occur,\nso we don't recommend you use it for mouse tracking or anything like that.\nAt present, a call will occur once per MCU row, scanline, or sample row\ngroup, whichever unit is convenient for the current processing mode; so the\nwider the image, the longer the time between calls.  During the data\ntransferring pass, only one call occurs per call of jpeg_read_scanlines or\njpeg_write_scanlines, so don't pass a large number of scanlines at once if\nyou want fine resolution in the progress count.  (If you really need to use\nthe callback mechanism for time-critical tasks like mouse tracking, you could\ninsert additional calls inside some of the library's inner loops.)\n\nTo establish a progress-monitor callback, create a struct jpeg_progress_mgr,\nfill in its progress_monitor field with a pointer to your callback routine,\nand set cinfo->progress to point to the struct.  The callback will be called\nwhenever cinfo->progress is non-NULL.  (This pointer is set to NULL by\njpeg_create_compress or jpeg_create_decompress; the library will not change\nit thereafter.  So if you allocate dynamic storage for the progress struct,\nmake sure it will live as long as the JPEG object does.  Allocating from the\nJPEG memory manager with lifetime JPOOL_PERMANENT will work nicely.)  You\ncan use the same callback routine for both compression and decompression.\n\nThe jpeg_progress_mgr struct contains four fields which are set by the library:\n\tlong pass_counter;\t/* work units completed in this pass */\n\tlong pass_limit;\t/* total number of work units in this pass */\n\tint completed_passes;\t/* passes completed so far */\n\tint total_passes;\t/* total number of passes expected */\nDuring any one pass, pass_counter increases from 0 up to (not including)\npass_limit; the step size is usually but not necessarily 1.  The pass_limit\nvalue may change from one pass to another.  The expected total number of\npasses is in total_passes, and the number of passes already completed is in\ncompleted_passes.  Thus the fraction of work completed may be estimated as\n\t\tcompleted_passes + (pass_counter/pass_limit)\n\t\t--------------------------------------------\n\t\t\t\ttotal_passes\nignoring the fact that the passes may not be equal amounts of work.\n\nWhen decompressing, pass_limit can even change within a pass, because it\ndepends on the number of scans in the JPEG file, which isn't always known in\nadvance.  The computed fraction-of-work-done may jump suddenly (if the library\ndiscovers it has overestimated the number of scans) or even decrease (in the\nopposite case).  It is not wise to put great faith in the work estimate.\n\nWhen using the decompressor's buffered-image mode, the progress monitor work\nestimate is likely to be completely unhelpful, because the library has no way\nto know how many output passes will be demanded of it.  Currently, the library\nsets total_passes based on the assumption that there will be one more output\npass if the input file end hasn't yet been read (jpeg_input_complete() isn't\nTRUE), but no more output passes if the file end has been reached when the\noutput pass is started.  This means that total_passes will rise as additional\noutput passes are requested.  If you have a way of determining the input file\nsize, estimating progress based on the fraction of the file that's been read\nwill probably be more useful than using the library's value.\n\n\nMemory management\n-----------------\n\nThis section covers some key facts about the JPEG library's built-in memory\nmanager.  For more info, please read structure.txt's section about the memory\nmanager, and consult the source code if necessary.\n\nAll memory and temporary file allocation within the library is done via the\nmemory manager.  If necessary, you can replace the \"back end\" of the memory\nmanager to control allocation yourself (for example, if you don't want the\nlibrary to use malloc() and free() for some reason).\n\nSome data is allocated \"permanently\" and will not be freed until the JPEG\nobject is destroyed.  Most data is allocated \"per image\" and is freed by\njpeg_finish_compress, jpeg_finish_decompress, or jpeg_abort.  You can call the\nmemory manager yourself to allocate structures that will automatically be\nfreed at these times.  Typical code for this is\n  ptr = (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, size);\nUse JPOOL_PERMANENT to get storage that lasts as long as the JPEG object.\nUse alloc_large instead of alloc_small for anything bigger than a few Kbytes.\nThere are also alloc_sarray and alloc_barray routines that automatically\nbuild 2-D sample or block arrays.\n\nThe library's minimum space requirements to process an image depend on the\nimage's width, but not on its height, because the library ordinarily works\nwith \"strip\" buffers that are as wide as the image but just a few rows high.\nSome operating modes (eg, two-pass color quantization) require full-image\nbuffers.  Such buffers are treated as \"virtual arrays\": only the current strip\nneed be in memory, and the rest can be swapped out to a temporary file.\n\nIf you use the simplest memory manager back end (jmemnobs.c), then no\ntemporary files are used; virtual arrays are simply malloc()'d.  Images bigger\nthan memory can be processed only if your system supports virtual memory.\nThe other memory manager back ends support temporary files of various flavors\nand thus work in machines without virtual memory.  They may also be useful on\nUnix machines if you need to process images that exceed available swap space.\n\nWhen using temporary files, the library will make the in-memory buffers for\nits virtual arrays just big enough to stay within a \"maximum memory\" setting.\nYour application can set this limit by setting cinfo->mem->max_memory_to_use\nafter creating the JPEG object.  (Of course, there is still a minimum size for\nthe buffers, so the max-memory setting is effective only if it is bigger than\nthe minimum space needed.)  If you allocate any large structures yourself, you\nmust allocate them before jpeg_start_compress() or jpeg_start_decompress() in\norder to have them counted against the max memory limit.  Also keep in mind\nthat space allocated with alloc_small() is ignored, on the assumption that\nit's too small to be worth worrying about; so a reasonable safety margin\nshould be left when setting max_memory_to_use.\n\nIf you use the jmemname.c or jmemdos.c memory manager back end, it is\nimportant to clean up the JPEG object properly to ensure that the temporary\nfiles get deleted.  (This is especially crucial with jmemdos.c, where the\n\"temporary files\" may be extended-memory segments; if they are not freed,\nDOS will require a reboot to recover the memory.)  Thus, with these memory\nmanagers, it's a good idea to provide a signal handler that will trap any\nearly exit from your program.  The handler should call either jpeg_abort()\nor jpeg_destroy() for any active JPEG objects.  A handler is not needed with\njmemnobs.c, and shouldn't be necessary with jmemansi.c or jmemmac.c either,\nsince the C library is supposed to take care of deleting files made with\ntmpfile().\n\n\nMemory usage\n------------\n\nWorking memory requirements while performing compression or decompression\ndepend on image dimensions, image characteristics (such as colorspace and\nJPEG process), and operating mode (application-selected options).\n\nAs of v6b, the decompressor requires:\n 1. About 24K in more-or-less-fixed-size data.  This varies a bit depending\n    on operating mode and image characteristics (particularly color vs.\n    grayscale), but it doesn't depend on image dimensions.\n 2. Strip buffers (of size proportional to the image width) for IDCT and\n    upsampling results.  The worst case for commonly used sampling factors\n    is about 34 bytes * width in pixels for a color image.  A grayscale image\n    only needs about 8 bytes per pixel column.\n 3. A full-image DCT coefficient buffer is needed to decode a multi-scan JPEG\n    file (including progressive JPEGs), or whenever you select buffered-image\n    mode.  This takes 2 bytes/coefficient.  At typical 2x2 sampling, that's\n    3 bytes per pixel for a color image.  Worst case (1x1 sampling) requires\n    6 bytes/pixel.  For grayscale, figure 2 bytes/pixel.\n 4. To perform 2-pass color quantization, the decompressor also needs a\n    128K color lookup table and a full-image pixel buffer (3 bytes/pixel).\nThis does not count any memory allocated by the application, such as a\nbuffer to hold the final output image.\n\nThe above figures are valid for 8-bit JPEG data precision and a machine with\n32-bit ints.  For 12-bit JPEG data, double the size of the strip buffers and\nquantization pixel buffer.  The \"fixed-size\" data will be somewhat smaller\nwith 16-bit ints, larger with 64-bit ints.  Also, CMYK or other unusual\ncolor spaces will require different amounts of space.\n\nThe full-image coefficient and pixel buffers, if needed at all, do not\nhave to be fully RAM resident; you can have the library use temporary\nfiles instead when the total memory usage would exceed a limit you set.\n(But if your OS supports virtual memory, it's probably better to just use\njmemnobs and let the OS do the swapping.)\n\nThe compressor's memory requirements are similar, except that it has no need\nfor color quantization.  Also, it needs a full-image DCT coefficient buffer\nif Huffman-table optimization is asked for, even if progressive mode is not\nrequested.\n\nIf you need more detailed information about memory usage in a particular\nsituation, you can enable the MEM_STATS code in jmemmgr.c.\n\n\nLibrary compile-time options\n----------------------------\n\nA number of compile-time options are available by modifying jmorecfg.h.\n\nThe JPEG standard provides for both the baseline 8-bit DCT process and\na 12-bit DCT process.  The IJG code supports 12-bit lossy JPEG if you define\nBITS_IN_JSAMPLE as 12 rather than 8.  Note that this causes JSAMPLE to be\nlarger than a char, so it affects the surrounding application's image data.\nThe sample applications cjpeg and djpeg can support 12-bit mode only for PPM\nand GIF file formats; you must disable the other file formats to compile a\n12-bit cjpeg or djpeg.  (install.txt has more information about that.)\nAt present, a 12-bit library can handle *only* 12-bit images, not both\nprecisions.  (If you need to include both 8- and 12-bit libraries in a single\napplication, you could probably do it by defining NEED_SHORT_EXTERNAL_NAMES\nfor just one of the copies.  You'd have to access the 8-bit and 12-bit copies\nfrom separate application source files.  This is untested ... if you try it,\nwe'd like to hear whether it works!)\n\nNote that a 12-bit library always compresses in Huffman optimization mode,\nin order to generate valid Huffman tables.  This is necessary because our\ndefault Huffman tables only cover 8-bit data.  If you need to output 12-bit\nfiles in one pass, you'll have to supply suitable default Huffman tables.\nYou may also want to supply your own DCT quantization tables; the existing\nquality-scaling code has been developed for 8-bit use, and probably doesn't\ngenerate especially good tables for 12-bit.\n\nThe maximum number of components (color channels) in the image is determined\nby MAX_COMPONENTS.  The JPEG standard allows up to 255 components, but we\nexpect that few applications will need more than four or so.\n\nOn machines with unusual data type sizes, you may be able to improve\nperformance or reduce memory space by tweaking the various typedefs in\njmorecfg.h.  In particular, on some RISC CPUs, access to arrays of \"short\"s\nis quite slow; consider trading memory for speed by making JCOEF, INT16, and\nUINT16 be \"int\" or \"unsigned int\".  UINT8 is also a candidate to become int.\nYou probably don't want to make JSAMPLE be int unless you have lots of memory\nto burn.\n\nYou can reduce the size of the library by compiling out various optional\nfunctions.  To do this, undefine xxx_SUPPORTED symbols as necessary.\n\nYou can also save a few K by not having text error messages in the library;\nthe standard error message table occupies about 5Kb.  This is particularly\nreasonable for embedded applications where there's no good way to display \na message anyway.  To do this, remove the creation of the message table\n(jpeg_std_message_table[]) from jerror.c, and alter format_message to do\nsomething reasonable without it.  You could output the numeric value of the\nmessage code number, for example.  If you do this, you can also save a couple\nmore K by modifying the TRACEMSn() macros in jerror.h to expand to nothing;\nyou don't need trace capability anyway, right?\n\n\nPortability considerations\n--------------------------\n\nThe JPEG library has been written to be extremely portable; the sample\napplications cjpeg and djpeg are slightly less so.  This section summarizes\nthe design goals in this area.  (If you encounter any bugs that cause the\nlibrary to be less portable than is claimed here, we'd appreciate hearing\nabout them.)\n\nThe code works fine on ANSI C, C++, and pre-ANSI C compilers, using any of\nthe popular system include file setups, and some not-so-popular ones too.\nSee install.txt for configuration procedures.\n\nThe code is not dependent on the exact sizes of the C data types.  As\ndistributed, we make the assumptions that\n\tchar\tis at least 8 bits wide\n\tshort\tis at least 16 bits wide\n\tint\tis at least 16 bits wide\n\tlong\tis at least 32 bits wide\n(These are the minimum requirements of the ANSI C standard.)  Wider types will\nwork fine, although memory may be used inefficiently if char is much larger\nthan 8 bits or short is much bigger than 16 bits.  The code should work\nequally well with 16- or 32-bit ints.\n\nIn a system where these assumptions are not met, you may be able to make the\ncode work by modifying the typedefs in jmorecfg.h.  However, you will probably\nhave difficulty if int is less than 16 bits wide, since references to plain\nint abound in the code.\n\nchar can be either signed or unsigned, although the code runs faster if an\nunsigned char type is available.  If char is wider than 8 bits, you will need\nto redefine JOCTET and/or provide custom data source/destination managers so\nthat JOCTET represents exactly 8 bits of data on external storage.\n\nThe JPEG library proper does not assume ASCII representation of characters.\nBut some of the image file I/O modules in cjpeg/djpeg do have ASCII\ndependencies in file-header manipulation; so does cjpeg's select_file_type()\nroutine.\n\nThe JPEG library does not rely heavily on the C library.  In particular, C\nstdio is used only by the data source/destination modules and the error\nhandler, all of which are application-replaceable.  (cjpeg/djpeg are more\nheavily dependent on stdio.)  malloc and free are called only from the memory\nmanager \"back end\" module, so you can use a different memory allocator by\nreplacing that one file.\n\nThe code generally assumes that C names must be unique in the first 15\ncharacters.  However, global function names can be made unique in the\nfirst 6 characters by defining NEED_SHORT_EXTERNAL_NAMES.\n\nMore info about porting the code may be gleaned by reading jconfig.txt,\njmorecfg.h, and jinclude.h.\n\n\nNotes for MS-DOS implementors\n-----------------------------\n\nThe IJG code is designed to work efficiently in 80x86 \"small\" or \"medium\"\nmemory models (i.e., data pointers are 16 bits unless explicitly declared\n\"far\"; code pointers can be either size).  You may be able to use small\nmodel to compile cjpeg or djpeg by itself, but you will probably have to use\nmedium model for any larger application.  This won't make much difference in\nperformance.  You *will* take a noticeable performance hit if you use a\nlarge-data memory model (perhaps 10%-25%), and you should avoid \"huge\" model\nif at all possible.\n\nThe JPEG library typically needs 2Kb-3Kb of stack space.  It will also\nmalloc about 20K-30K of near heap space while executing (and lots of far\nheap, but that doesn't count in this calculation).  This figure will vary\ndepending on selected operating mode, and to a lesser extent on image size.\nThere is also about 5Kb-6Kb of constant data which will be allocated in the\nnear data segment (about 4Kb of this is the error message table).\nThus you have perhaps 20K available for other modules' static data and near\nheap space before you need to go to a larger memory model.  The C library's\nstatic data will account for several K of this, but that still leaves a good\ndeal for your needs.  (If you are tight on space, you could reduce the sizes\nof the I/O buffers allocated by jdatasrc.c and jdatadst.c, say from 4K to\n1K.  Another possibility is to move the error message table to far memory;\nthis should be doable with only localized hacking on jerror.c.)\n\nAbout 2K of the near heap space is \"permanent\" memory that will not be\nreleased until you destroy the JPEG object.  This is only an issue if you\nsave a JPEG object between compression or decompression operations.\n\nFar data space may also be a tight resource when you are dealing with large\nimages.  The most memory-intensive case is decompression with two-pass color\nquantization, or single-pass quantization to an externally supplied color\nmap.  This requires a 128Kb color lookup table plus strip buffers amounting\nto about 40 bytes per column for typical sampling ratios (eg, about 25600\nbytes for a 640-pixel-wide image).  You may not be able to process wide\nimages if you have large data structures of your own.\n\nOf course, all of these concerns vanish if you use a 32-bit flat-memory-model\ncompiler, such as DJGPP or Watcom C.  We highly recommend flat model if you\ncan use it; the JPEG library is significantly faster in flat model.\n"
  },
  {
    "path": "ext/libjpeg-turbo/ltmain.sh",
    "content": "# ltmain.sh - Provide generalized library-building support services.\n# NOTE: Changing this file will not affect anything until you rerun configure.\n#\n# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004\n# Free Software Foundation, Inc.\n# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996\n#\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n#\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that program.\n\nbasename=\"s,^.*/,,g\"\n\n# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh\n# is ksh but when the shell is invoked as \"sh\" and the current value of\n# the _XPG environment variable is not equal to 1 (one), the special\n# positional parameter $0, within a function call, is the name of the\n# function.\nprogpath=\"$0\"\n\n# RH: define SED for historic ltconfig's generated by Libtool 1.3\n[ -z \"$SED\" ] && SED=sed\n\n# The name of this program:\nprogname=`echo \"$progpath\" | $SED $basename`\nmodename=\"$progname\"\n\n# Global variables:\nEXIT_SUCCESS=0\nEXIT_FAILURE=1\n\nPROGRAM=ltmain.sh\nPACKAGE=libtool\nVERSION=1.5.6\nTIMESTAMP=\" (1.1220.2.95 2004/04/11 05:50:42)\"\nEGREP=\"grep -E\"\n\n\n# Check that we have a working $echo.\nif test \"X$1\" = X--no-reexec; then\n  # Discard the --no-reexec flag, and continue.\n  shift\nelif test \"X$1\" = X--fallback-echo; then\n  # Avoid inline document here, it may be left over\n  :\nelif test \"X`($echo '\\t') 2>/dev/null`\" = 'X\\t'; then\n  # Yippee, $echo works!\n  :\nelse\n  # Restart under the correct shell, and then maybe $echo will work.\n  exec $SHELL \"$progpath\" --no-reexec ${1+\"$@\"}\nfi\n\nif test \"X$1\" = X--fallback-echo; then\n  # used as fallback echo\n  shift\n  cat <<EOF\n$*\nEOF\n  exit $EXIT_SUCCESS\nfi\n\ndefault_mode=\nhelp=\"Try \\`$progname --help' for more information.\"\nmagic=\"%%%MAGIC variable%%%\"\nmkdir=\"mkdir\"\nmv=\"mv -f\"\nrm=\"rm -f\"\n\n# Sed substitution that helps us do robust quoting.  It backslashifies\n# metacharacters that are still active within double-quoted strings.\nXsed=\"${SED}\"' -e 1s/^X//'\nsed_quote_subst='s/\\([\\\\`\\\\\"$\\\\\\\\]\\)/\\\\\\1/g'\n# test EBCDIC or ASCII\ncase `echo A|tr A '\\301'` in\n A) # EBCDIC based system\n  SP2NL=\"tr '\\100' '\\n'\"\n  NL2SP=\"tr '\\r\\n' '\\100\\100'\"\n  ;;\n *) # Assume ASCII based system\n  SP2NL=\"tr '\\040' '\\012'\"\n  NL2SP=\"tr '\\015\\012' '\\040\\040'\"\n  ;;\nesac\n\n# NLS nuisances.\n# Only set LANG and LC_ALL to C if already set.\n# These must not be set unconditionally because not all systems understand\n# e.g. LANG=C (notably SCO).\n# We save the old values to restore during execute mode.\nif test \"${LC_ALL+set}\" = set; then\n  save_LC_ALL=\"$LC_ALL\"; LC_ALL=C; export LC_ALL\nfi\nif test \"${LANG+set}\" = set; then\n  save_LANG=\"$LANG\"; LANG=C; export LANG\nfi\n\n# Make sure IFS has a sensible default\n: ${IFS=\" \t\n\"}\n\nif test \"$build_libtool_libs\" != yes && test \"$build_old_libs\" != yes; then\n  $echo \"$modename: not configured to build any kind of library\" 1>&2\n  $echo \"Fatal configuration error.  See the $PACKAGE docs for more information.\" 1>&2\n  exit $EXIT_FAILURE\nfi\n\n# Global variables.\nmode=$default_mode\nnonopt=\nprev=\nprevopt=\nrun=\nshow=\"$echo\"\nshow_help=\nexecute_dlfiles=\nlo2o=\"s/\\\\.lo\\$/.${objext}/\"\no2lo=\"s/\\\\.${objext}\\$/.lo/\"\n\n#####################################\n# Shell function definitions:\n# This seems to be the best place for them\n\n# func_win32_libid arg\n# return the library type of file 'arg'\n#\n# Need a lot of goo to handle *both* DLLs and import libs\n# Has to be a shell function in order to 'eat' the argument\n# that is supplied when $file_magic_command is called.\nfunc_win32_libid () {\n  win32_libid_type=\"unknown\"\n  win32_fileres=`file -L $1 2>/dev/null`\n  case $win32_fileres in\n  *ar\\ archive\\ import\\ library*) # definitely import\n    win32_libid_type=\"x86 archive import\"\n    ;;\n  *ar\\ archive*) # could be an import, or static\n    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \\\n      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then\n      win32_nmres=`eval $NM -f posix -A $1 | \\\n\tsed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`\n      if test \"X$win32_nmres\" = \"Ximport\" ; then\n        win32_libid_type=\"x86 archive import\"\n      else\n        win32_libid_type=\"x86 archive static\"\n      fi\n    fi\n    ;;\n  *DLL*)\n    win32_libid_type=\"x86 DLL\"\n    ;;\n  *executable*) # but shell scripts are \"executable\" too...\n    case $win32_fileres in\n    *MS\\ Windows\\ PE\\ Intel*)\n      win32_libid_type=\"x86 DLL\"\n      ;;\n    esac\n    ;;\n  esac\n  $echo $win32_libid_type\n}\n\n\n# func_infer_tag arg\n# Infer tagged configuration to use if any are available and\n# if one wasn't chosen via the \"--tag\" command line option.\n# Only attempt this if the compiler in the base compile\n# command doesn't match the default compiler.\n# arg is usually of the form 'gcc ...'\nfunc_infer_tag () {\n    if test -n \"$available_tags\" && test -z \"$tagname\"; then\n      CC_quoted=\n      for arg in $CC; do\n\tcase $arg in\n\t  *[\\[\\~\\#\\^\\&\\*\\(\\)\\{\\}\\|\\;\\<\\>\\?\\'\\ \\\t]*|*]*|\"\")\n\t  arg=\"\\\"$arg\\\"\"\n\t  ;;\n\tesac\n\tCC_quoted=\"$CC_quoted $arg\"\n      done\n      case $@ in\n      # Blanks in the command may have been stripped by the calling shell,\n      # but not from the CC environment variable when configure was run.\n      \" $CC \"* | \"$CC \"* | \" `$echo $CC` \"* | \"`$echo $CC` \"* | \" $CC_quoted\"* | \"$CC_quoted \"* | \" `$echo $CC_quoted` \"* | \"`$echo $CC_quoted` \"*) ;;\n      # Blanks at the start of $base_compile will cause this to fail\n      # if we don't check for them as well.\n      *)\n\tfor z in $available_tags; do\n\t  if grep \"^# ### BEGIN LIBTOOL TAG CONFIG: $z$\" < \"$progpath\" > /dev/null; then\n\t    # Evaluate the configuration.\n\t    eval \"`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`\"\n\t    CC_quoted=\n\t    for arg in $CC; do\n\t    # Double-quote args containing other shell metacharacters.\n\t    case $arg in\n\t      *[\\[\\~\\#\\^\\&\\*\\(\\)\\{\\}\\|\\;\\<\\>\\?\\'\\ \\\t]*|*]*|\"\")\n\t      arg=\"\\\"$arg\\\"\"\n\t      ;;\n\t    esac\n\t    CC_quoted=\"$CC_quoted $arg\"\n\t  done\n\t    case \"$@ \" in\n\t      \" $CC \"* | \"$CC \"* | \" `$echo $CC` \"* | \"`$echo $CC` \"* | \" $CC_quoted\"* | \"$CC_quoted \"* | \" `$echo $CC_quoted` \"* | \"`$echo $CC_quoted` \"*)\n\t      # The compiler in the base compile command matches\n\t      # the one in the tagged configuration.\n\t      # Assume this is the tagged configuration we want.\n\t      tagname=$z\n\t      break\n\t      ;;\n\t    esac\n\t  fi\n\tdone\n\t# If $tagname still isn't set, then no tagged configuration\n\t# was found and let the user know that the \"--tag\" command\n\t# line option must be used.\n\tif test -z \"$tagname\"; then\n\t  $echo \"$modename: unable to infer tagged configuration\"\n\t  $echo \"$modename: specify a tag with \\`--tag'\" 1>&2\n\t  exit $EXIT_FAILURE\n#        else\n#          $echo \"$modename: using $tagname tagged configuration\"\n\tfi\n\t;;\n      esac\n    fi\n}\n# End of Shell function definitions\n#####################################\n\n# Darwin sucks\neval std_shrext=\\\"$shrext_cmds\\\"\n\n# Parse our command line options once, thoroughly.\nwhile test \"$#\" -gt 0\ndo\n  arg=\"$1\"\n  shift\n\n  case $arg in\n  -*=*) optarg=`$echo \"X$arg\" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;\n  *) optarg= ;;\n  esac\n\n  # If the previous option needs an argument, assign it.\n  if test -n \"$prev\"; then\n    case $prev in\n    execute_dlfiles)\n      execute_dlfiles=\"$execute_dlfiles $arg\"\n      ;;\n    tag)\n      tagname=\"$arg\"\n      preserve_args=\"${preserve_args}=$arg\"\n\n      # Check whether tagname contains only valid characters\n      case $tagname in\n      *[!-_A-Za-z0-9,/]*)\n\t$echo \"$progname: invalid tag name: $tagname\" 1>&2\n\texit $EXIT_FAILURE\n\t;;\n      esac\n\n      case $tagname in\n      CC)\n\t# Don't test for the \"default\" C tag, as we know, it's there, but\n\t# not specially marked.\n\t;;\n      *)\n\tif grep \"^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$\" < \"$progpath\" > /dev/null; then\n\t  taglist=\"$taglist $tagname\"\n\t  # Evaluate the configuration.\n\t  eval \"`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`\"\n\telse\n\t  $echo \"$progname: ignoring unknown tag $tagname\" 1>&2\n\tfi\n\t;;\n      esac\n      ;;\n    *)\n      eval \"$prev=\\$arg\"\n      ;;\n    esac\n\n    prev=\n    prevopt=\n    continue\n  fi\n\n  # Have we seen a non-optional argument yet?\n  case $arg in\n  --help)\n    show_help=yes\n    ;;\n\n  --version)\n    $echo \"$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP\"\n    $echo\n    $echo \"Copyright (C) 2003  Free Software Foundation, Inc.\"\n    $echo \"This is free software; see the source for copying conditions.  There is NO\"\n    $echo \"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\"\n    exit $EXIT_SUCCESS\n    ;;\n\n  --config)\n    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath\n    # Now print the configurations for the tags.\n    for tagname in $taglist; do\n      ${SED} -n -e \"/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p\" < \"$progpath\"\n    done\n    exit $EXIT_SUCCESS\n    ;;\n\n  --debug)\n    $echo \"$progname: enabling shell trace mode\"\n    set -x\n    preserve_args=\"$preserve_args $arg\"\n    ;;\n\n  --dry-run | -n)\n    run=:\n    ;;\n\n  --features)\n    $echo \"host: $host\"\n    if test \"$build_libtool_libs\" = yes; then\n      $echo \"enable shared libraries\"\n    else\n      $echo \"disable shared libraries\"\n    fi\n    if test \"$build_old_libs\" = yes; then\n      $echo \"enable static libraries\"\n    else\n      $echo \"disable static libraries\"\n    fi\n    exit $EXIT_SUCCESS\n    ;;\n\n  --finish) mode=\"finish\" ;;\n\n  --mode) prevopt=\"--mode\" prev=mode ;;\n  --mode=*) mode=\"$optarg\" ;;\n\n  --preserve-dup-deps) duplicate_deps=\"yes\" ;;\n\n  --quiet | --silent)\n    show=:\n    preserve_args=\"$preserve_args $arg\"\n    ;;\n\n  --tag) prevopt=\"--tag\" prev=tag ;;\n  --tag=*)\n    set tag \"$optarg\" ${1+\"$@\"}\n    shift\n    prev=tag\n    preserve_args=\"$preserve_args --tag\"\n    ;;\n\n  -dlopen)\n    prevopt=\"-dlopen\"\n    prev=execute_dlfiles\n    ;;\n\n  -*)\n    $echo \"$modename: unrecognized option \\`$arg'\" 1>&2\n    $echo \"$help\" 1>&2\n    exit $EXIT_FAILURE\n    ;;\n\n  *)\n    nonopt=\"$arg\"\n    break\n    ;;\n  esac\ndone\n\nif test -n \"$prevopt\"; then\n  $echo \"$modename: option \\`$prevopt' requires an argument\" 1>&2\n  $echo \"$help\" 1>&2\n  exit $EXIT_FAILURE\nfi\n\n# If this variable is set in any of the actions, the command in it\n# will be execed at the end.  This prevents here-documents from being\n# left over by shells.\nexec_cmd=\n\nif test -z \"$show_help\"; then\n\n  # Infer the operation mode.\n  if test -z \"$mode\"; then\n    $echo \"*** Warning: inferring the mode of operation is deprecated.\" 1>&2\n    $echo \"*** Future versions of Libtool will require -mode=MODE be specified.\" 1>&2\n    case $nonopt in\n    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)\n      mode=link\n      for arg\n      do\n\tcase $arg in\n\t-c)\n\t   mode=compile\n\t   break\n\t   ;;\n\tesac\n      done\n      ;;\n    *db | *dbx | *strace | *truss)\n      mode=execute\n      ;;\n    *install*|cp|mv)\n      mode=install\n      ;;\n    *rm)\n      mode=uninstall\n      ;;\n    *)\n      # If we have no mode, but dlfiles were specified, then do execute mode.\n      test -n \"$execute_dlfiles\" && mode=execute\n\n      # Just use the default operation mode.\n      if test -z \"$mode\"; then\n\tif test -n \"$nonopt\"; then\n\t  $echo \"$modename: warning: cannot infer operation mode from \\`$nonopt'\" 1>&2\n\telse\n\t  $echo \"$modename: warning: cannot infer operation mode without MODE-ARGS\" 1>&2\n\tfi\n      fi\n      ;;\n    esac\n  fi\n\n  # Only execute mode is allowed to have -dlopen flags.\n  if test -n \"$execute_dlfiles\" && test \"$mode\" != execute; then\n    $echo \"$modename: unrecognized option \\`-dlopen'\" 1>&2\n    $echo \"$help\" 1>&2\n    exit $EXIT_FAILURE\n  fi\n\n  # Change the help message to a mode-specific one.\n  generic_help=\"$help\"\n  help=\"Try \\`$modename --help --mode=$mode' for more information.\"\n\n  # These modes are in order of execution frequency so that they run quickly.\n  case $mode in\n  # libtool compile mode\n  compile)\n    modename=\"$modename: compile\"\n    # Get the compilation command and the source file.\n    base_compile=\n    srcfile=\"$nonopt\"  #  always keep a non-empty value in \"srcfile\"\n    suppress_opt=yes\n    suppress_output=\n    arg_mode=normal\n    libobj=\n    later=\n\n    for arg\n    do\n      case \"$arg_mode\" in\n      arg  )\n\t# do not \"continue\".  Instead, add this to base_compile\n\tlastarg=\"$arg\"\n\targ_mode=normal\n\t;;\n\n      target )\n\tlibobj=\"$arg\"\n\targ_mode=normal\n\tcontinue\n\t;;\n\n      normal )\n\t# Accept any command-line options.\n\tcase $arg in\n\t-o)\n\t  if test -n \"$libobj\" ; then\n\t    $echo \"$modename: you cannot specify \\`-o' more than once\" 1>&2\n\t    exit $EXIT_FAILURE\n\t  fi\n\t  arg_mode=target\n\t  continue\n\t  ;;\n\n\t-static | -prefer-pic | -prefer-non-pic)\n\t  later=\"$later $arg\"\n\t  continue\n\t  ;;\n\n\t-no-suppress)\n\t  suppress_opt=no\n\t  continue\n\t  ;;\n\n\t-Xcompiler)\n\t  arg_mode=arg  #  the next one goes into the \"base_compile\" arg list\n\t  continue      #  The current \"srcfile\" will either be retained or\n\t  ;;            #  replaced later.  I would guess that would be a bug.\n\n\t-Wc,*)\n\t  args=`$echo \"X$arg\" | $Xsed -e \"s/^-Wc,//\"`\n\t  lastarg=\n\t  save_ifs=\"$IFS\"; IFS=','\n \t  for arg in $args; do\n\t    IFS=\"$save_ifs\"\n\n\t    # Double-quote args containing other shell metacharacters.\n\t    # Many Bourne shells cannot handle close brackets correctly\n\t    # in scan sets, so we specify it separately.\n\t    case $arg in\n\t      *[\\[\\~\\#\\^\\&\\*\\(\\)\\{\\}\\|\\;\\<\\>\\?\\'\\ \\\t]*|*]*|\"\")\n\t      arg=\"\\\"$arg\\\"\"\n\t      ;;\n\t    esac\n\t    lastarg=\"$lastarg $arg\"\n\t  done\n\t  IFS=\"$save_ifs\"\n\t  lastarg=`$echo \"X$lastarg\" | $Xsed -e \"s/^ //\"`\n\n\t  # Add the arguments to base_compile.\n\t  base_compile=\"$base_compile $lastarg\"\n\t  continue\n\t  ;;\n\n\t* )\n\t  # Accept the current argument as the source file.\n\t  # The previous \"srcfile\" becomes the current argument.\n\t  #\n\t  lastarg=\"$srcfile\"\n\t  srcfile=\"$arg\"\n\t  ;;\n\tesac  #  case $arg\n\t;;\n      esac    #  case $arg_mode\n\n      # Aesthetically quote the previous argument.\n      lastarg=`$echo \"X$lastarg\" | $Xsed -e \"$sed_quote_subst\"`\n\n      case $lastarg in\n      # Double-quote args containing other shell metacharacters.\n      # Many Bourne shells cannot handle close brackets correctly\n      # in scan sets, so we specify it separately.\n      *[\\[\\~\\#\\^\\&\\*\\(\\)\\{\\}\\|\\;\\<\\>\\?\\'\\ \\\t]*|*]*|\"\")\n\tlastarg=\"\\\"$lastarg\\\"\"\n\t;;\n      esac\n\n      base_compile=\"$base_compile $lastarg\"\n    done # for arg\n\n    case $arg_mode in\n    arg)\n      $echo \"$modename: you must specify an argument for -Xcompile\"\n      exit $EXIT_FAILURE\n      ;;\n    target)\n      $echo \"$modename: you must specify a target with \\`-o'\" 1>&2\n      exit $EXIT_FAILURE\n      ;;\n    *)\n      # Get the name of the library object.\n      [ -z \"$libobj\" ] && libobj=`$echo \"X$srcfile\" | $Xsed -e 's%^.*/%%'`\n      ;;\n    esac\n\n    # Recognize several different file suffixes.\n    # If the user specifies -o file.o, it is replaced with file.lo\n    xform='[cCFSifmso]'\n    case $libobj in\n    *.ada) xform=ada ;;\n    *.adb) xform=adb ;;\n    *.ads) xform=ads ;;\n    *.asm) xform=asm ;;\n    *.c++) xform=c++ ;;\n    *.cc) xform=cc ;;\n    *.ii) xform=ii ;;\n    *.class) xform=class ;;\n    *.cpp) xform=cpp ;;\n    *.cxx) xform=cxx ;;\n    *.f90) xform=f90 ;;\n    *.for) xform=for ;;\n    *.java) xform=java ;;\n    esac\n\n    libobj=`$echo \"X$libobj\" | $Xsed -e \"s/\\.$xform$/.lo/\"`\n\n    case $libobj in\n    *.lo) obj=`$echo \"X$libobj\" | $Xsed -e \"$lo2o\"` ;;\n    *)\n      $echo \"$modename: cannot determine name of library object from \\`$libobj'\" 1>&2\n      exit $EXIT_FAILURE\n      ;;\n    esac\n\n    func_infer_tag $base_compile\n\n    for arg in $later; do\n      case $arg in\n      -static)\n\tbuild_old_libs=yes\n\tcontinue\n\t;;\n\n      -prefer-pic)\n\tpic_mode=yes\n\tcontinue\n\t;;\n\n      -prefer-non-pic)\n\tpic_mode=no\n\tcontinue\n\t;;\n      esac\n    done\n\n    objname=`$echo \"X$obj\" | $Xsed -e 's%^.*/%%'`\n    xdir=`$echo \"X$obj\" | $Xsed -e 's%/[^/]*$%%'`\n    if test \"X$xdir\" = \"X$obj\"; then\n      xdir=\n    else\n      xdir=$xdir/\n    fi\n    lobj=${xdir}$objdir/$objname\n\n    if test -z \"$base_compile\"; then\n      $echo \"$modename: you must specify a compilation command\" 1>&2\n      $echo \"$help\" 1>&2\n      exit $EXIT_FAILURE\n    fi\n\n    # Delete any leftover library objects.\n    if test \"$build_old_libs\" = yes; then\n      removelist=\"$obj $lobj $libobj ${libobj}T\"\n    else\n      removelist=\"$lobj $libobj ${libobj}T\"\n    fi\n\n    $run $rm $removelist\n    trap \"$run $rm $removelist; exit $EXIT_FAILURE\" 1 2 15\n\n    # On Cygwin there's no \"real\" PIC flag so we must build both object types\n    case $host_os in\n    cygwin* | mingw* | pw32* | os2*)\n      pic_mode=default\n      ;;\n    esac\n    if test \"$pic_mode\" = no && test \"$deplibs_check_method\" != pass_all; then\n      # non-PIC code in shared libraries is not supported\n      pic_mode=default\n    fi\n\n    # Calculate the filename of the output object if compiler does\n    # not support -o with -c\n    if test \"$compiler_c_o\" = no; then\n      output_obj=`$echo \"X$srcfile\" | $Xsed -e 's%^.*/%%' -e 's%\\.[^.]*$%%'`.${objext}\n      lockfile=\"$output_obj.lock\"\n      removelist=\"$removelist $output_obj $lockfile\"\n      trap \"$run $rm $removelist; exit $EXIT_FAILURE\" 1 2 15\n    else\n      output_obj=\n      need_locks=no\n      lockfile=\n    fi\n\n    # Lock this critical section if it is needed\n    # We use this script file to make the link, it avoids creating a new file\n    if test \"$need_locks\" = yes; then\n      until $run ln \"$progpath\" \"$lockfile\" 2>/dev/null; do\n\t$show \"Waiting for $lockfile to be removed\"\n\tsleep 2\n      done\n    elif test \"$need_locks\" = warn; then\n      if test -f \"$lockfile\"; then\n\t$echo \"\\\n*** ERROR, $lockfile exists and contains:\n`cat $lockfile 2>/dev/null`\n\nThis indicates that another process is trying to use the same\ntemporary object file, and libtool could not work around it because\nyour compiler does not support \\`-c' and \\`-o' together.  If you\nrepeat this compilation, it may succeed, by chance, but you had better\navoid parallel builds (make -j) in this platform, or get a better\ncompiler.\"\n\n\t$run $rm $removelist\n\texit $EXIT_FAILURE\n      fi\n      $echo $srcfile > \"$lockfile\"\n    fi\n\n    if test -n \"$fix_srcfile_path\"; then\n      eval srcfile=\\\"$fix_srcfile_path\\\"\n    fi\n\n    $run $rm \"$libobj\" \"${libobj}T\"\n\n    # Create a libtool object file (analogous to a \".la\" file),\n    # but don't create it if we're doing a dry run.\n    test -z \"$run\" && cat > ${libobj}T <<EOF\n# $libobj - a libtool object file\n# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP\n#\n# Please DO NOT delete this file!\n# It is necessary for linking the library.\n\n# Name of the PIC object.\nEOF\n\n    # Only build a PIC object if we are building libtool libraries.\n    if test \"$build_libtool_libs\" = yes; then\n      # Without this assignment, base_compile gets emptied.\n      fbsd_hideous_sh_bug=$base_compile\n\n      if test \"$pic_mode\" != no; then\n\tcommand=\"$base_compile $srcfile $pic_flag\"\n      else\n\t# Don't build PIC code\n\tcommand=\"$base_compile $srcfile\"\n      fi\n\n      if test ! -d \"${xdir}$objdir\"; then\n\t$show \"$mkdir ${xdir}$objdir\"\n\t$run $mkdir ${xdir}$objdir\n\tstatus=$?\n\tif test \"$status\" -ne 0 && test ! -d \"${xdir}$objdir\"; then\n\t  exit $status\n\tfi\n      fi\n\n      if test -z \"$output_obj\"; then\n\t# Place PIC objects in $objdir\n\tcommand=\"$command -o $lobj\"\n      fi\n\n      $run $rm \"$lobj\" \"$output_obj\"\n\n      $show \"$command\"\n      if $run eval \"$command\"; then :\n      else\n\ttest -n \"$output_obj\" && $run $rm $removelist\n\texit $EXIT_FAILURE\n      fi\n\n      if test \"$need_locks\" = warn &&\n\t test \"X`cat $lockfile 2>/dev/null`\" != \"X$srcfile\"; then\n\t$echo \"\\\n*** ERROR, $lockfile contains:\n`cat $lockfile 2>/dev/null`\n\nbut it should contain:\n$srcfile\n\nThis indicates that another process is trying to use the same\ntemporary object file, and libtool could not work around it because\nyour compiler does not support \\`-c' and \\`-o' together.  If you\nrepeat this compilation, it may succeed, by chance, but you had better\navoid parallel builds (make -j) in this platform, or get a better\ncompiler.\"\n\n\t$run $rm $removelist\n\texit $EXIT_FAILURE\n      fi\n\n      # Just move the object if needed, then go on to compile the next one\n      if test -n \"$output_obj\" && test \"X$output_obj\" != \"X$lobj\"; then\n\t$show \"$mv $output_obj $lobj\"\n\tif $run $mv $output_obj $lobj; then :\n\telse\n\t  error=$?\n\t  $run $rm $removelist\n\t  exit $error\n\tfi\n      fi\n\n      # Append the name of the PIC object to the libtool object file.\n      test -z \"$run\" && cat >> ${libobj}T <<EOF\npic_object='$objdir/$objname'\n\nEOF\n\n      # Allow error messages only from the first compilation.\n      if test \"$suppress_opt\" = yes; then\n        suppress_output=' >/dev/null 2>&1'\n      fi\n    else\n      # No PIC object so indicate it doesn't exist in the libtool\n      # object file.\n      test -z \"$run\" && cat >> ${libobj}T <<EOF\npic_object=none\n\nEOF\n    fi\n\n    # Only build a position-dependent object if we build old libraries.\n    if test \"$build_old_libs\" = yes; then\n      if test \"$pic_mode\" != yes; then\n\t# Don't build PIC code\n\tcommand=\"$base_compile $srcfile\"\n      else\n\tcommand=\"$base_compile $srcfile $pic_flag\"\n      fi\n      if test \"$compiler_c_o\" = yes; then\n\tcommand=\"$command -o $obj\"\n      fi\n\n      # Suppress compiler output if we already did a PIC compilation.\n      command=\"$command$suppress_output\"\n      $run $rm \"$obj\" \"$output_obj\"\n      $show \"$command\"\n      if $run eval \"$command\"; then :\n      else\n\t$run $rm $removelist\n\texit $EXIT_FAILURE\n      fi\n\n      if test \"$need_locks\" = warn &&\n\t test \"X`cat $lockfile 2>/dev/null`\" != \"X$srcfile\"; then\n\t$echo \"\\\n*** ERROR, $lockfile contains:\n`cat $lockfile 2>/dev/null`\n\nbut it should contain:\n$srcfile\n\nThis indicates that another process is trying to use the same\ntemporary object file, and libtool could not work around it because\nyour compiler does not support \\`-c' and \\`-o' together.  If you\nrepeat this compilation, it may succeed, by chance, but you had better\navoid parallel builds (make -j) in this platform, or get a better\ncompiler.\"\n\n\t$run $rm $removelist\n\texit $EXIT_FAILURE\n      fi\n\n      # Just move the object if needed\n      if test -n \"$output_obj\" && test \"X$output_obj\" != \"X$obj\"; then\n\t$show \"$mv $output_obj $obj\"\n\tif $run $mv $output_obj $obj; then :\n\telse\n\t  error=$?\n\t  $run $rm $removelist\n\t  exit $error\n\tfi\n      fi\n\n      # Append the name of the non-PIC object the libtool object file.\n      # Only append if the libtool object file exists.\n      test -z \"$run\" && cat >> ${libobj}T <<EOF\n# Name of the non-PIC object.\nnon_pic_object='$objname'\n\nEOF\n    else\n      # Append the name of the non-PIC object the libtool object file.\n      # Only append if the libtool object file exists.\n      test -z \"$run\" && cat >> ${libobj}T <<EOF\n# Name of the non-PIC object.\nnon_pic_object=none\n\nEOF\n    fi\n\n    $run $mv \"${libobj}T\" \"${libobj}\"\n\n    # Unlock the critical section if it was locked\n    if test \"$need_locks\" != no; then\n      $run $rm \"$lockfile\"\n    fi\n\n    exit $EXIT_SUCCESS\n    ;;\n\n  # libtool link mode\n  link | relink)\n    modename=\"$modename: link\"\n    case $host in\n    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)\n      # It is impossible to link a dll without this setting, and\n      # we shouldn't force the makefile maintainer to figure out\n      # which system we are compiling for in order to pass an extra\n      # flag for every libtool invocation.\n      # allow_undefined=no\n\n      # FIXME: Unfortunately, there are problems with the above when trying\n      # to make a dll which has undefined symbols, in which case not\n      # even a static library is built.  For now, we need to specify\n      # -no-undefined on the libtool link line when we can be certain\n      # that all symbols are satisfied, otherwise we get a static library.\n      allow_undefined=yes\n      ;;\n    *)\n      allow_undefined=yes\n      ;;\n    esac\n    libtool_args=\"$nonopt\"\n    base_compile=\"$nonopt $@\"\n    compile_command=\"$nonopt\"\n    finalize_command=\"$nonopt\"\n\n    compile_rpath=\n    finalize_rpath=\n    compile_shlibpath=\n    finalize_shlibpath=\n    convenience=\n    old_convenience=\n    deplibs=\n    old_deplibs=\n    compiler_flags=\n    linker_flags=\n    dllsearchpath=\n    lib_search_path=`pwd`\n    inst_prefix_dir=\n\n    avoid_version=no\n    dlfiles=\n    dlprefiles=\n    dlself=no\n    export_dynamic=no\n    export_symbols=\n    export_symbols_regex=\n    generated=\n    libobjs=\n    ltlibs=\n    module=no\n    no_install=no\n    objs=\n    non_pic_objects=\n    precious_files_regex=\n    prefer_static_libs=no\n    preload=no\n    prev=\n    prevarg=\n    release=\n    rpath=\n    xrpath=\n    perm_rpath=\n    temp_rpath=\n    thread_safe=no\n    vinfo=\n    vinfo_number=no\n\n    func_infer_tag $base_compile\n\n    # We need to know -static, to get the right output filenames.\n    for arg\n    do\n      case $arg in\n      -all-static | -static)\n\tif test \"X$arg\" = \"X-all-static\"; then\n\t  if test \"$build_libtool_libs\" = yes && test -z \"$link_static_flag\"; then\n\t    $echo \"$modename: warning: complete static linking is impossible in this configuration\" 1>&2\n\t  fi\n\t  if test -n \"$link_static_flag\"; then\n\t    dlopen_self=$dlopen_self_static\n\t  fi\n\telse\n\t  if test -z \"$pic_flag\" && test -n \"$link_static_flag\"; then\n\t    dlopen_self=$dlopen_self_static\n\t  fi\n\tfi\n\tbuild_libtool_libs=no\n\tbuild_old_libs=yes\n\tprefer_static_libs=yes\n\tbreak\n\t;;\n      esac\n    done\n\n    # See if our shared archives depend on static archives.\n    test -n \"$old_archive_from_new_cmds\" && build_old_libs=yes\n\n    # Go through the arguments, transforming them on the way.\n    while test \"$#\" -gt 0; do\n      arg=\"$1\"\n      shift\n      case $arg in\n      *[\\[\\~\\#\\^\\&\\*\\(\\)\\{\\}\\|\\;\\<\\>\\?\\'\\ \\\t]*|*]*|\"\")\n\tqarg=\\\"`$echo \"X$arg\" | $Xsed -e \"$sed_quote_subst\"`\\\" ### testsuite: skip nested quoting test\n\t;;\n      *) qarg=$arg ;;\n      esac\n      libtool_args=\"$libtool_args $qarg\"\n\n      # If the previous option needs an argument, assign it.\n      if test -n \"$prev\"; then\n\tcase $prev in\n\toutput)\n\t  compile_command=\"$compile_command @OUTPUT@\"\n\t  finalize_command=\"$finalize_command @OUTPUT@\"\n\t  ;;\n\tesac\n\n\tcase $prev in\n\tdlfiles|dlprefiles)\n\t  if test \"$preload\" = no; then\n\t    # Add the symbol object into the linking commands.\n\t    compile_command=\"$compile_command @SYMFILE@\"\n\t    finalize_command=\"$finalize_command @SYMFILE@\"\n\t    preload=yes\n\t  fi\n\t  case $arg in\n\t  *.la | *.lo) ;;  # We handle these cases below.\n\t  force)\n\t    if test \"$dlself\" = no; then\n\t      dlself=needless\n\t      export_dynamic=yes\n\t    fi\n\t    prev=\n\t    continue\n\t    ;;\n\t  self)\n\t    if test \"$prev\" = dlprefiles; then\n\t      dlself=yes\n\t    elif test \"$prev\" = dlfiles && test \"$dlopen_self\" != yes; then\n\t      dlself=yes\n\t    else\n\t      dlself=needless\n\t      export_dynamic=yes\n\t    fi\n\t    prev=\n\t    continue\n\t    ;;\n\t  *)\n\t    if test \"$prev\" = dlfiles; then\n\t      dlfiles=\"$dlfiles $arg\"\n\t    else\n\t      dlprefiles=\"$dlprefiles $arg\"\n\t    fi\n\t    prev=\n\t    continue\n\t    ;;\n\t  esac\n\t  ;;\n\texpsyms)\n\t  export_symbols=\"$arg\"\n\t  if test ! -f \"$arg\"; then\n\t    $echo \"$modename: symbol file \\`$arg' does not exist\"\n\t    exit $EXIT_FAILURE\n\t  fi\n\t  prev=\n\t  continue\n\t  ;;\n\texpsyms_regex)\n\t  export_symbols_regex=\"$arg\"\n\t  prev=\n\t  continue\n\t  ;;\n\tinst_prefix)\n\t  inst_prefix_dir=\"$arg\"\n\t  prev=\n\t  continue\n\t  ;;\n\tprecious_regex)\n\t  precious_files_regex=\"$arg\"\n\t  prev=\n\t  continue\n\t  ;;\n\trelease)\n\t  release=\"-$arg\"\n\t  prev=\n\t  continue\n\t  ;;\n\tobjectlist)\n\t  if test -f \"$arg\"; then\n\t    save_arg=$arg\n\t    moreargs=\n\t    for fil in `cat $save_arg`\n\t    do\n#\t      moreargs=\"$moreargs $fil\"\n\t      arg=$fil\n\t      # A libtool-controlled object.\n\n\t      # Check to see that this really is a libtool object.\n\t      if (${SED} -e '2q' $arg | grep \"^# Generated by .*$PACKAGE\") >/dev/null 2>&1; then\n\t\tpic_object=\n\t\tnon_pic_object=\n\n\t\t# Read the .lo file\n\t\t# If there is no directory component, then add one.\n\t\tcase $arg in\n\t\t*/* | *\\\\*) . $arg ;;\n\t\t*) . ./$arg ;;\n\t\tesac\n\n\t\tif test -z \"$pic_object\" || \\\n\t\t   test -z \"$non_pic_object\" ||\n\t\t   test \"$pic_object\" = none && \\\n\t\t   test \"$non_pic_object\" = none; then\n\t\t  $echo \"$modename: cannot find name of object for \\`$arg'\" 1>&2\n\t\t  exit $EXIT_FAILURE\n\t\tfi\n\n\t\t# Extract subdirectory from the argument.\n\t\txdir=`$echo \"X$arg\" | $Xsed -e 's%/[^/]*$%%'`\n\t\tif test \"X$xdir\" = \"X$arg\"; then\n\t\t  xdir=\n\t\telse\n\t\t  xdir=\"$xdir/\"\n\t\tfi\n\n\t\tif test \"$pic_object\" != none; then\n\t\t  # Prepend the subdirectory the object is found in.\n\t\t  pic_object=\"$xdir$pic_object\"\n\n\t\t  if test \"$prev\" = dlfiles; then\n\t\t    if test \"$build_libtool_libs\" = yes && test \"$dlopen_support\" = yes; then\n\t\t      dlfiles=\"$dlfiles $pic_object\"\n\t\t      prev=\n\t\t      continue\n\t\t    else\n\t\t      # If libtool objects are unsupported, then we need to preload.\n\t\t      prev=dlprefiles\n\t\t    fi\n\t\t  fi\n\n\t\t  # CHECK ME:  I think I busted this.  -Ossama\n\t\t  if test \"$prev\" = dlprefiles; then\n\t\t    # Preload the old-style object.\n\t\t    dlprefiles=\"$dlprefiles $pic_object\"\n\t\t    prev=\n\t\t  fi\n\n\t\t  # A PIC object.\n\t\t  libobjs=\"$libobjs $pic_object\"\n\t\t  arg=\"$pic_object\"\n\t\tfi\n\n\t\t# Non-PIC object.\n\t\tif test \"$non_pic_object\" != none; then\n\t\t  # Prepend the subdirectory the object is found in.\n\t\t  non_pic_object=\"$xdir$non_pic_object\"\n\n\t\t  # A standard non-PIC object\n\t\t  non_pic_objects=\"$non_pic_objects $non_pic_object\"\n\t\t  if test -z \"$pic_object\" || test \"$pic_object\" = none ; then\n\t\t    arg=\"$non_pic_object\"\n\t\t  fi\n\t\tfi\n\t      else\n\t\t# Only an error if not doing a dry-run.\n\t\tif test -z \"$run\"; then\n\t\t  $echo \"$modename: \\`$arg' is not a valid libtool object\" 1>&2\n\t\t  exit $EXIT_FAILURE\n\t\telse\n\t\t  # Dry-run case.\n\n\t\t  # Extract subdirectory from the argument.\n\t\t  xdir=`$echo \"X$arg\" | $Xsed -e 's%/[^/]*$%%'`\n\t\t  if test \"X$xdir\" = \"X$arg\"; then\n\t\t    xdir=\n\t\t  else\n\t\t    xdir=\"$xdir/\"\n\t\t  fi\n\n\t\t  pic_object=`$echo \"X${xdir}${objdir}/${arg}\" | $Xsed -e \"$lo2o\"`\n\t\t  non_pic_object=`$echo \"X${xdir}${arg}\" | $Xsed -e \"$lo2o\"`\n\t\t  libobjs=\"$libobjs $pic_object\"\n\t\t  non_pic_objects=\"$non_pic_objects $non_pic_object\"\n\t\tfi\n\t      fi\n\t    done\n\t  else\n\t    $echo \"$modename: link input file \\`$save_arg' does not exist\"\n\t    exit $EXIT_FAILURE\n\t  fi\n\t  arg=$save_arg\n\t  prev=\n\t  continue\n\t  ;;\n\trpath | xrpath)\n\t  # We need an absolute path.\n\t  case $arg in\n\t  [\\\\/]* | [A-Za-z]:[\\\\/]*) ;;\n\t  *)\n\t    $echo \"$modename: only absolute run-paths are allowed\" 1>&2\n\t    exit $EXIT_FAILURE\n\t    ;;\n\t  esac\n\t  if test \"$prev\" = rpath; then\n\t    case \"$rpath \" in\n\t    *\" $arg \"*) ;;\n\t    *) rpath=\"$rpath $arg\" ;;\n\t    esac\n\t  else\n\t    case \"$xrpath \" in\n\t    *\" $arg \"*) ;;\n\t    *) xrpath=\"$xrpath $arg\" ;;\n\t    esac\n\t  fi\n\t  prev=\n\t  continue\n\t  ;;\n\txcompiler)\n\t  compiler_flags=\"$compiler_flags $qarg\"\n\t  prev=\n\t  compile_command=\"$compile_command $qarg\"\n\t  finalize_command=\"$finalize_command $qarg\"\n\t  continue\n\t  ;;\n\txlinker)\n\t  linker_flags=\"$linker_flags $qarg\"\n\t  compiler_flags=\"$compiler_flags $wl$qarg\"\n\t  prev=\n\t  compile_command=\"$compile_command $wl$qarg\"\n\t  finalize_command=\"$finalize_command $wl$qarg\"\n\t  continue\n\t  ;;\n\txcclinker)\n\t  linker_flags=\"$linker_flags $qarg\"\n\t  compiler_flags=\"$compiler_flags $qarg\"\n\t  prev=\n\t  compile_command=\"$compile_command $qarg\"\n\t  finalize_command=\"$finalize_command $qarg\"\n\t  continue\n\t  ;;\n\tshrext)\n  \t  shrext_cmds=\"$arg\"\n\t  prev=\n\t  continue\n\t  ;;\n\t*)\n\t  eval \"$prev=\\\"\\$arg\\\"\"\n\t  prev=\n\t  continue\n\t  ;;\n\tesac\n      fi # test -n \"$prev\"\n\n      prevarg=\"$arg\"\n\n      case $arg in\n      -all-static)\n\tif test -n \"$link_static_flag\"; then\n\t  compile_command=\"$compile_command $link_static_flag\"\n\t  finalize_command=\"$finalize_command $link_static_flag\"\n\tfi\n\tcontinue\n\t;;\n\n      -allow-undefined)\n\t# FIXME: remove this flag sometime in the future.\n\t$echo \"$modename: \\`-allow-undefined' is deprecated because it is the default\" 1>&2\n\tcontinue\n\t;;\n\n      -avoid-version)\n\tavoid_version=yes\n\tcontinue\n\t;;\n\n      -dlopen)\n\tprev=dlfiles\n\tcontinue\n\t;;\n\n      -dlpreopen)\n\tprev=dlprefiles\n\tcontinue\n\t;;\n\n      -export-dynamic)\n\texport_dynamic=yes\n\tcontinue\n\t;;\n\n      -export-symbols | -export-symbols-regex)\n\tif test -n \"$export_symbols\" || test -n \"$export_symbols_regex\"; then\n\t  $echo \"$modename: more than one -exported-symbols argument is not allowed\"\n\t  exit $EXIT_FAILURE\n\tfi\n\tif test \"X$arg\" = \"X-export-symbols\"; then\n\t  prev=expsyms\n\telse\n\t  prev=expsyms_regex\n\tfi\n\tcontinue\n\t;;\n\n      -inst-prefix-dir)\n\tprev=inst_prefix\n\tcontinue\n\t;;\n\n      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*\n      # so, if we see these flags be careful not to treat them like -L\n      -L[A-Z][A-Z]*:*)\n\tcase $with_gcc/$host in\n\tno/*-*-irix* | /*-*-irix*)\n\t  compile_command=\"$compile_command $arg\"\n\t  finalize_command=\"$finalize_command $arg\"\n\t  ;;\n\tesac\n\tcontinue\n\t;;\n\n      -L*)\n\tdir=`$echo \"X$arg\" | $Xsed -e 's/^-L//'`\n\t# We need an absolute path.\n\tcase $dir in\n\t[\\\\/]* | [A-Za-z]:[\\\\/]*) ;;\n\t*)\n\t  absdir=`cd \"$dir\" && pwd`\n\t  if test -z \"$absdir\"; then\n\t    $echo \"$modename: cannot determine absolute directory name of \\`$dir'\" 1>&2\n\t    exit $EXIT_FAILURE\n\t  fi\n\t  dir=\"$absdir\"\n\t  ;;\n\tesac\n\tcase \"$deplibs \" in\n\t*\" -L$dir \"*) ;;\n\t*)\n\t  deplibs=\"$deplibs -L$dir\"\n\t  lib_search_path=\"$lib_search_path $dir\"\n\t  ;;\n\tesac\n\tcase $host in\n\t*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)\n\t  case :$dllsearchpath: in\n\t  *\":$dir:\"*) ;;\n\t  *) dllsearchpath=\"$dllsearchpath:$dir\";;\n\t  esac\n\t  ;;\n\tesac\n\tcontinue\n\t;;\n\n      -l*)\n\tif test \"X$arg\" = \"X-lc\" || test \"X$arg\" = \"X-lm\"; then\n\t  case $host in\n\t  *-*-cygwin* | *-*-pw32* | *-*-beos*)\n\t    # These systems don't actually have a C or math library (as such)\n\t    continue\n\t    ;;\n\t  *-*-mingw* | *-*-os2*)\n\t    # These systems don't actually have a C library (as such)\n\t    test \"X$arg\" = \"X-lc\" && continue\n\t    ;;\n\t  *-*-openbsd* | *-*-freebsd*)\n\t    # Do not include libc due to us having libc/libc_r.\n\t    test \"X$arg\" = \"X-lc\" && continue\n\t    ;;\n\t  *-*-rhapsody* | *-*-darwin1.[012])\n\t    # Rhapsody C and math libraries are in the System framework\n\t    deplibs=\"$deplibs -framework System\"\n\t    continue\n\t  esac\n\telif test \"X$arg\" = \"X-lc_r\"; then\n\t case $host in\n\t *-*-openbsd* | *-*-freebsd*)\n\t   # Do not include libc_r directly, use -pthread flag.\n\t   continue\n\t   ;;\n\t esac\n\tfi\n\tdeplibs=\"$deplibs $arg\"\n\tcontinue\n\t;;\n\n     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)\n\tdeplibs=\"$deplibs $arg\"\n\tcontinue\n\t;;\n\n      -module)\n\tmodule=yes\n\tcontinue\n\t;;\n\n      # gcc -m* arguments should be passed to the linker via $compiler_flags\n      # in order to pass architecture information to the linker\n      # (e.g. 32 vs 64-bit).  This may also be accomplished via -Wl,-mfoo\n      # but this is not reliable with gcc because gcc may use -mfoo to\n      # select a different linker, different libraries, etc, while\n      # -Wl,-mfoo simply passes -mfoo to the linker.\n      -m*)\n\t# Unknown arguments in both finalize_command and compile_command need\n\t# to be aesthetically quoted because they are evaled later.\n\targ=`$echo \"X$arg\" | $Xsed -e \"$sed_quote_subst\"`\n\tcase $arg in\n\t*[\\[\\~\\#\\^\\&\\*\\(\\)\\{\\}\\|\\;\\<\\>\\?\\'\\ \\\t]*|*]*|\"\")\n\t  arg=\"\\\"$arg\\\"\"\n\t  ;;\n\tesac\n        compile_command=\"$compile_command $arg\"\n        finalize_command=\"$finalize_command $arg\"\n        if test \"$with_gcc\" = \"yes\" ; then\n          compiler_flags=\"$compiler_flags $arg\"\n        fi\n        continue\n        ;;\n\n      -shrext)\n\tprev=shrext\n\tcontinue\n\t;;\n\n      -no-fast-install)\n\tfast_install=no\n\tcontinue\n\t;;\n\n      -no-install)\n\tcase $host in\n\t*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)\n\t  # The PATH hackery in wrapper scripts is required on Windows\n\t  # in order for the loader to find any dlls it needs.\n\t  $echo \"$modename: warning: \\`-no-install' is ignored for $host\" 1>&2\n\t  $echo \"$modename: warning: assuming \\`-no-fast-install' instead\" 1>&2\n\t  fast_install=no\n\t  ;;\n\t*) no_install=yes ;;\n\tesac\n\tcontinue\n\t;;\n\n      -no-undefined)\n\tallow_undefined=no\n\tcontinue\n\t;;\n\n      -objectlist)\n\tprev=objectlist\n\tcontinue\n\t;;\n\n      -o) prev=output ;;\n\n      -precious-files-regex)\n\tprev=precious_regex\n\tcontinue\n\t;;\n\n      -release)\n\tprev=release\n\tcontinue\n\t;;\n\n      -rpath)\n\tprev=rpath\n\tcontinue\n\t;;\n\n      -R)\n\tprev=xrpath\n\tcontinue\n\t;;\n\n      -R*)\n\tdir=`$echo \"X$arg\" | $Xsed -e 's/^-R//'`\n\t# We need an absolute path.\n\tcase $dir in\n\t[\\\\/]* | [A-Za-z]:[\\\\/]*) ;;\n\t*)\n\t  $echo \"$modename: only absolute run-paths are allowed\" 1>&2\n\t  exit $EXIT_FAILURE\n\t  ;;\n\tesac\n\tcase \"$xrpath \" in\n\t*\" $dir \"*) ;;\n\t*) xrpath=\"$xrpath $dir\" ;;\n\tesac\n\tcontinue\n\t;;\n\n      -static)\n\t# The effects of -static are defined in a previous loop.\n\t# We used to do the same as -all-static on platforms that\n\t# didn't have a PIC flag, but the assumption that the effects\n\t# would be equivalent was wrong.  It would break on at least\n\t# Digital Unix and AIX.\n\tcontinue\n\t;;\n\n      -thread-safe)\n\tthread_safe=yes\n\tcontinue\n\t;;\n\n      -version-info)\n\tprev=vinfo\n\tcontinue\n\t;;\n      -version-number)\n\tprev=vinfo\n\tvinfo_number=yes\n\tcontinue\n\t;;\n\n      -Wc,*)\n\targs=`$echo \"X$arg\" | $Xsed -e \"$sed_quote_subst\" -e 's/^-Wc,//'`\n\targ=\n\tsave_ifs=\"$IFS\"; IFS=','\n\tfor flag in $args; do\n\t  IFS=\"$save_ifs\"\n\t  case $flag in\n\t    *[\\[\\~\\#\\^\\&\\*\\(\\)\\{\\}\\|\\;\\<\\>\\?\\'\\ \\\t]*|*]*|\"\")\n\t    flag=\"\\\"$flag\\\"\"\n\t    ;;\n\t  esac\n\t  arg=\"$arg $wl$flag\"\n\t  compiler_flags=\"$compiler_flags $flag\"\n\tdone\n\tIFS=\"$save_ifs\"\n\targ=`$echo \"X$arg\" | $Xsed -e \"s/^ //\"`\n\t;;\n\n      -Wl,*)\n\targs=`$echo \"X$arg\" | $Xsed -e \"$sed_quote_subst\" -e 's/^-Wl,//'`\n\targ=\n\tsave_ifs=\"$IFS\"; IFS=','\n\tfor flag in $args; do\n\t  IFS=\"$save_ifs\"\n\t  case $flag in\n\t    *[\\[\\~\\#\\^\\&\\*\\(\\)\\{\\}\\|\\;\\<\\>\\?\\'\\ \\\t]*|*]*|\"\")\n\t    flag=\"\\\"$flag\\\"\"\n\t    ;;\n\t  esac\n\t  arg=\"$arg $wl$flag\"\n\t  compiler_flags=\"$compiler_flags $wl$flag\"\n\t  linker_flags=\"$linker_flags $flag\"\n\tdone\n\tIFS=\"$save_ifs\"\n\targ=`$echo \"X$arg\" | $Xsed -e \"s/^ //\"`\n\t;;\n\n      -Xcompiler)\n\tprev=xcompiler\n\tcontinue\n\t;;\n\n      -Xlinker)\n\tprev=xlinker\n\tcontinue\n\t;;\n\n      -XCClinker)\n\tprev=xcclinker\n\tcontinue\n\t;;\n\n      # Some other compiler flag.\n      -* | +*)\n\t# Unknown arguments in both finalize_command and compile_command need\n\t# to be aesthetically quoted because they are evaled later.\n\targ=`$echo \"X$arg\" | $Xsed -e \"$sed_quote_subst\"`\n\tcase $arg in\n\t*[\\[\\~\\#\\^\\&\\*\\(\\)\\{\\}\\|\\;\\<\\>\\?\\'\\ \\\t]*|*]*|\"\")\n\t  arg=\"\\\"$arg\\\"\"\n\t  ;;\n\tesac\n\t;;\n\n      *.$objext)\n\t# A standard object.\n\tobjs=\"$objs $arg\"\n\t;;\n\n      *.lo)\n\t# A libtool-controlled object.\n\n\t# Check to see that this really is a libtool object.\n\tif (${SED} -e '2q' $arg | grep \"^# Generated by .*$PACKAGE\") >/dev/null 2>&1; then\n\t  pic_object=\n\t  non_pic_object=\n\n\t  # Read the .lo file\n\t  # If there is no directory component, then add one.\n\t  case $arg in\n\t  */* | *\\\\*) . $arg ;;\n\t  *) . ./$arg ;;\n\t  esac\n\n\t  if test -z \"$pic_object\" || \\\n\t     test -z \"$non_pic_object\" ||\n\t     test \"$pic_object\" = none && \\\n\t     test \"$non_pic_object\" = none; then\n\t    $echo \"$modename: cannot find name of object for \\`$arg'\" 1>&2\n\t    exit $EXIT_FAILURE\n\t  fi\n\n\t  # Extract subdirectory from the argument.\n\t  xdir=`$echo \"X$arg\" | $Xsed -e 's%/[^/]*$%%'`\n\t  if test \"X$xdir\" = \"X$arg\"; then\n\t    xdir=\n \t  else\n\t    xdir=\"$xdir/\"\n\t  fi\n\n\t  if test \"$pic_object\" != none; then\n\t    # Prepend the subdirectory the object is found in.\n\t    pic_object=\"$xdir$pic_object\"\n\n\t    if test \"$prev\" = dlfiles; then\n\t      if test \"$build_libtool_libs\" = yes && test \"$dlopen_support\" = yes; then\n\t\tdlfiles=\"$dlfiles $pic_object\"\n\t\tprev=\n\t\tcontinue\n\t      else\n\t\t# If libtool objects are unsupported, then we need to preload.\n\t\tprev=dlprefiles\n\t      fi\n\t    fi\n\n\t    # CHECK ME:  I think I busted this.  -Ossama\n\t    if test \"$prev\" = dlprefiles; then\n\t      # Preload the old-style object.\n\t      dlprefiles=\"$dlprefiles $pic_object\"\n\t      prev=\n\t    fi\n\n\t    # A PIC object.\n\t    libobjs=\"$libobjs $pic_object\"\n\t    arg=\"$pic_object\"\n\t  fi\n\n\t  # Non-PIC object.\n\t  if test \"$non_pic_object\" != none; then\n\t    # Prepend the subdirectory the object is found in.\n\t    non_pic_object=\"$xdir$non_pic_object\"\n\n\t    # A standard non-PIC object\n\t    non_pic_objects=\"$non_pic_objects $non_pic_object\"\n\t    if test -z \"$pic_object\" || test \"$pic_object\" = none ; then\n\t      arg=\"$non_pic_object\"\n\t    fi\n\t  fi\n\telse\n\t  # Only an error if not doing a dry-run.\n\t  if test -z \"$run\"; then\n\t    $echo \"$modename: \\`$arg' is not a valid libtool object\" 1>&2\n\t    exit $EXIT_FAILURE\n\t  else\n\t    # Dry-run case.\n\n\t    # Extract subdirectory from the argument.\n\t    xdir=`$echo \"X$arg\" | $Xsed -e 's%/[^/]*$%%'`\n\t    if test \"X$xdir\" = \"X$arg\"; then\n\t      xdir=\n\t    else\n\t      xdir=\"$xdir/\"\n\t    fi\n\n\t    pic_object=`$echo \"X${xdir}${objdir}/${arg}\" | $Xsed -e \"$lo2o\"`\n\t    non_pic_object=`$echo \"X${xdir}${arg}\" | $Xsed -e \"$lo2o\"`\n\t    libobjs=\"$libobjs $pic_object\"\n\t    non_pic_objects=\"$non_pic_objects $non_pic_object\"\n\t  fi\n\tfi\n\t;;\n\n      *.$libext)\n\t# An archive.\n\tdeplibs=\"$deplibs $arg\"\n\told_deplibs=\"$old_deplibs $arg\"\n\tcontinue\n\t;;\n\n      *.la)\n\t# A libtool-controlled library.\n\n\tif test \"$prev\" = dlfiles; then\n\t  # This library was specified with -dlopen.\n\t  dlfiles=\"$dlfiles $arg\"\n\t  prev=\n\telif test \"$prev\" = dlprefiles; then\n\t  # The library was specified with -dlpreopen.\n\t  dlprefiles=\"$dlprefiles $arg\"\n\t  prev=\n\telse\n\t  deplibs=\"$deplibs $arg\"\n\tfi\n\tcontinue\n\t;;\n\n      # Some other compiler argument.\n      *)\n\t# Unknown arguments in both finalize_command and compile_command need\n\t# to be aesthetically quoted because they are evaled later.\n\targ=`$echo \"X$arg\" | $Xsed -e \"$sed_quote_subst\"`\n\tcase $arg in\n\t*[\\[\\~\\#\\^\\&\\*\\(\\)\\{\\}\\|\\;\\<\\>\\?\\'\\ \\\t]*|*]*|\"\")\n\t  arg=\"\\\"$arg\\\"\"\n\t  ;;\n\tesac\n\t;;\n      esac # arg\n\n      # Now actually substitute the argument into the commands.\n      if test -n \"$arg\"; then\n\tcompile_command=\"$compile_command $arg\"\n\tfinalize_command=\"$finalize_command $arg\"\n      fi\n    done # argument parsing loop\n\n    if test -n \"$prev\"; then\n      $echo \"$modename: the \\`$prevarg' option requires an argument\" 1>&2\n      $echo \"$help\" 1>&2\n      exit $EXIT_FAILURE\n    fi\n\n    if test \"$export_dynamic\" = yes && test -n \"$export_dynamic_flag_spec\"; then\n      eval arg=\\\"$export_dynamic_flag_spec\\\"\n      compile_command=\"$compile_command $arg\"\n      finalize_command=\"$finalize_command $arg\"\n    fi\n\n    oldlibs=\n    # calculate the name of the file, without its directory\n    outputname=`$echo \"X$output\" | $Xsed -e 's%^.*/%%'`\n    libobjs_save=\"$libobjs\"\n\n    if test -n \"$shlibpath_var\"; then\n      # get the directories listed in $shlibpath_var\n      eval shlib_search_path=\\`\\$echo \\\"X\\${$shlibpath_var}\\\" \\| \\$Xsed -e \\'s/:/ /g\\'\\`\n    else\n      shlib_search_path=\n    fi\n    eval sys_lib_search_path=\\\"$sys_lib_search_path_spec\\\"\n    eval sys_lib_dlsearch_path=\\\"$sys_lib_dlsearch_path_spec\\\"\n\n    output_objdir=`$echo \"X$output\" | $Xsed -e 's%/[^/]*$%%'`\n    if test \"X$output_objdir\" = \"X$output\"; then\n      output_objdir=\"$objdir\"\n    else\n      output_objdir=\"$output_objdir/$objdir\"\n    fi\n    # Create the object directory.\n    if test ! -d \"$output_objdir\"; then\n      $show \"$mkdir $output_objdir\"\n      $run $mkdir $output_objdir\n      status=$?\n      if test \"$status\" -ne 0 && test ! -d \"$output_objdir\"; then\n\texit $status\n      fi\n    fi\n\n    # Determine the type of output\n    case $output in\n    \"\")\n      $echo \"$modename: you must specify an output file\" 1>&2\n      $echo \"$help\" 1>&2\n      exit $EXIT_FAILURE\n      ;;\n    *.$libext) linkmode=oldlib ;;\n    *.lo | *.$objext) linkmode=obj ;;\n    *.la) linkmode=lib ;;\n    *) linkmode=prog ;; # Anything else should be a program.\n    esac\n\n    case $host in\n    *cygwin* | *mingw* | *pw32*)\n      # don't eliminate duplications in $postdeps and $predeps\n      duplicate_compiler_generated_deps=yes\n      ;;\n    *)\n      duplicate_compiler_generated_deps=$duplicate_deps\n      ;;\n    esac\n    specialdeplibs=\n\n    libs=\n    # Find all interdependent deplibs by searching for libraries\n    # that are linked more than once (e.g. -la -lb -la)\n    for deplib in $deplibs; do\n      if test \"X$duplicate_deps\" = \"Xyes\" ; then\n\tcase \"$libs \" in\n\t*\" $deplib \"*) specialdeplibs=\"$specialdeplibs $deplib\" ;;\n\tesac\n      fi\n      libs=\"$libs $deplib\"\n    done\n\n    if test \"$linkmode\" = lib; then\n      libs=\"$predeps $libs $compiler_lib_search_path $postdeps\"\n\n      # Compute libraries that are listed more than once in $predeps\n      # $postdeps and mark them as special (i.e., whose duplicates are\n      # not to be eliminated).\n      pre_post_deps=\n      if test \"X$duplicate_compiler_generated_deps\" = \"Xyes\" ; then\n\tfor pre_post_dep in $predeps $postdeps; do\n\t  case \"$pre_post_deps \" in\n\t  *\" $pre_post_dep \"*) specialdeplibs=\"$specialdeplibs $pre_post_deps\" ;;\n\t  esac\n\t  pre_post_deps=\"$pre_post_deps $pre_post_dep\"\n\tdone\n      fi\n      pre_post_deps=\n    fi\n\n    deplibs=\n    newdependency_libs=\n    newlib_search_path=\n    need_relink=no # whether we're linking any uninstalled libtool libraries\n    notinst_deplibs= # not-installed libtool libraries\n    notinst_path= # paths that contain not-installed libtool libraries\n    case $linkmode in\n    lib)\n\tpasses=\"conv link\"\n\tfor file in $dlfiles $dlprefiles; do\n\t  case $file in\n\t  *.la) ;;\n\t  *)\n\t    $echo \"$modename: libraries can \\`-dlopen' only libtool libraries: $file\" 1>&2\n\t    exit $EXIT_FAILURE\n\t    ;;\n\t  esac\n\tdone\n\t;;\n    prog)\n\tcompile_deplibs=\n\tfinalize_deplibs=\n\talldeplibs=no\n\tnewdlfiles=\n\tnewdlprefiles=\n\tpasses=\"conv scan dlopen dlpreopen link\"\n\t;;\n    *)  passes=\"conv\"\n\t;;\n    esac\n    for pass in $passes; do\n      if test \"$linkmode,$pass\" = \"lib,link\" ||\n\t test \"$linkmode,$pass\" = \"prog,scan\"; then\n\tlibs=\"$deplibs\"\n\tdeplibs=\n      fi\n      if test \"$linkmode\" = prog; then\n\tcase $pass in\n\tdlopen) libs=\"$dlfiles\" ;;\n\tdlpreopen) libs=\"$dlprefiles\" ;;\n\tlink) libs=\"$deplibs %DEPLIBS% $dependency_libs\" ;;\n\tesac\n      fi\n      if test \"$pass\" = dlopen; then\n\t# Collect dlpreopened libraries\n\tsave_deplibs=\"$deplibs\"\n\tdeplibs=\n      fi\n      for deplib in $libs; do\n\tlib=\n\tfound=no\n\tcase $deplib in\n\t-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)\n\t  if test \"$linkmode,$pass\" = \"prog,link\"; then\n\t    compile_deplibs=\"$deplib $compile_deplibs\"\n\t    finalize_deplibs=\"$deplib $finalize_deplibs\"\n\t  else\n\t    deplibs=\"$deplib $deplibs\"\n\t  fi\n\t  continue\n\t  ;;\n\t-l*)\n\t  if test \"$linkmode\" != lib && test \"$linkmode\" != prog; then\n\t    $echo \"$modename: warning: \\`-l' is ignored for archives/objects\" 1>&2\n\t    continue\n\t  fi\n\t  if test \"$pass\" = conv; then\n\t    deplibs=\"$deplib $deplibs\"\n\t    continue\n\t  fi\n\t  name=`$echo \"X$deplib\" | $Xsed -e 's/^-l//'`\n\t  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do\n\t    for search_ext in .la $std_shrext .so .a; do\n\t      # Search the libtool library\n\t      lib=\"$searchdir/lib${name}${search_ext}\"\n\t      if test -f \"$lib\"; then\n\t\tif test \"$search_ext\" = \".la\"; then\n\t\t  found=yes\n\t\telse\n\t\t  found=no\n\t\tfi\n\t\tbreak 2\n\t      fi\n\t    done\n\t  done\n\t  if test \"$found\" != yes; then\n\t    # deplib doesn't seem to be a libtool library\n\t    if test \"$linkmode,$pass\" = \"prog,link\"; then\n\t      compile_deplibs=\"$deplib $compile_deplibs\"\n\t      finalize_deplibs=\"$deplib $finalize_deplibs\"\n\t    else\n\t      deplibs=\"$deplib $deplibs\"\n\t      test \"$linkmode\" = lib && newdependency_libs=\"$deplib $newdependency_libs\"\n\t    fi\n\t    continue\n\t  else # deplib is a libtool library\n\t    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,\n\t    # We need to do some special things here, and not later.\n\t    if test \"X$allow_libtool_libs_with_static_runtimes\" = \"Xyes\" ; then\n\t      case \" $predeps $postdeps \" in\n\t      *\" $deplib \"*)\n\t\tif (${SED} -e '2q' $lib |\n                    grep \"^# Generated by .*$PACKAGE\") >/dev/null 2>&1; then\n\t\t  library_names=\n\t\t  old_library=\n\t\t  case $lib in\n\t\t  */* | *\\\\*) . $lib ;;\n\t\t  *) . ./$lib ;;\n\t\t  esac\n\t\t  for l in $old_library $library_names; do\n\t\t    ll=\"$l\"\n\t\t  done\n\t\t  if test \"X$ll\" = \"X$old_library\" ; then # only static version available\n\t\t    found=no\n\t\t    ladir=`$echo \"X$lib\" | $Xsed -e 's%/[^/]*$%%'`\n\t\t    test \"X$ladir\" = \"X$lib\" && ladir=\".\"\n\t\t    lib=$ladir/$old_library\n\t\t    if test \"$linkmode,$pass\" = \"prog,link\"; then\n\t\t      compile_deplibs=\"$deplib $compile_deplibs\"\n\t\t      finalize_deplibs=\"$deplib $finalize_deplibs\"\n\t\t    else\n\t\t      deplibs=\"$deplib $deplibs\"\n\t\t      test \"$linkmode\" = lib && newdependency_libs=\"$deplib $newdependency_libs\"\n\t\t    fi\n\t\t    continue\n\t\t  fi\n\t\tfi\n\t        ;;\n\t      *) ;;\n\t      esac\n\t    fi\n\t  fi\n\t  ;; # -l\n\t-L*)\n\t  case $linkmode in\n\t  lib)\n\t    deplibs=\"$deplib $deplibs\"\n\t    test \"$pass\" = conv && continue\n\t    newdependency_libs=\"$deplib $newdependency_libs\"\n\t    newlib_search_path=\"$newlib_search_path \"`$echo \"X$deplib\" | $Xsed -e 's/^-L//'`\n\t    ;;\n\t  prog)\n\t    if test \"$pass\" = conv; then\n\t      deplibs=\"$deplib $deplibs\"\n\t      continue\n\t    fi\n\t    if test \"$pass\" = scan; then\n\t      deplibs=\"$deplib $deplibs\"\n\t    else\n\t      compile_deplibs=\"$deplib $compile_deplibs\"\n\t      finalize_deplibs=\"$deplib $finalize_deplibs\"\n\t    fi\n\t    newlib_search_path=\"$newlib_search_path \"`$echo \"X$deplib\" | $Xsed -e 's/^-L//'`\n\t    ;;\n\t  *)\n\t    $echo \"$modename: warning: \\`-L' is ignored for archives/objects\" 1>&2\n\t    ;;\n\t  esac # linkmode\n\t  continue\n\t  ;; # -L\n\t-R*)\n\t  if test \"$pass\" = link; then\n\t    dir=`$echo \"X$deplib\" | $Xsed -e 's/^-R//'`\n\t    # Make sure the xrpath contains only unique directories.\n\t    case \"$xrpath \" in\n\t    *\" $dir \"*) ;;\n\t    *) xrpath=\"$xrpath $dir\" ;;\n\t    esac\n\t  fi\n\t  deplibs=\"$deplib $deplibs\"\n\t  continue\n\t  ;;\n\t*.la) lib=\"$deplib\" ;;\n\t*.$libext)\n\t  if test \"$pass\" = conv; then\n\t    deplibs=\"$deplib $deplibs\"\n\t    continue\n\t  fi\n\t  case $linkmode in\n\t  lib)\n\t    if test \"$deplibs_check_method\" != pass_all; then\n\t      $echo\n\t      $echo \"*** Warning: Trying to link with static lib archive $deplib.\"\n\t      $echo \"*** I have the capability to make that library automatically link in when\"\n\t      $echo \"*** you link to this library.  But I can only do this if you have a\"\n\t      $echo \"*** shared version of the library, which you do not appear to have\"\n\t      $echo \"*** because the file extensions .$libext of this argument makes me believe\"\n\t      $echo \"*** that it is just a static archive that I should not used here.\"\n\t    else\n\t      $echo\n\t      $echo \"*** Warning: Linking the shared library $output against the\"\n\t      $echo \"*** static library $deplib is not portable!\"\n\t      deplibs=\"$deplib $deplibs\"\n\t    fi\n\t    continue\n\t    ;;\n\t  prog)\n\t    if test \"$pass\" != link; then\n\t      deplibs=\"$deplib $deplibs\"\n\t    else\n\t      compile_deplibs=\"$deplib $compile_deplibs\"\n\t      finalize_deplibs=\"$deplib $finalize_deplibs\"\n\t    fi\n\t    continue\n\t    ;;\n\t  esac # linkmode\n\t  ;; # *.$libext\n\t*.lo | *.$objext)\n\t  if test \"$pass\" = conv; then\n\t    deplibs=\"$deplib $deplibs\"\n\t  elif test \"$linkmode\" = prog; then\n\t    if test \"$pass\" = dlpreopen || test \"$dlopen_support\" != yes || test \"$build_libtool_libs\" = no; then\n\t      # If there is no dlopen support or we're linking statically,\n\t      # we need to preload.\n\t      newdlprefiles=\"$newdlprefiles $deplib\"\n\t      compile_deplibs=\"$deplib $compile_deplibs\"\n\t      finalize_deplibs=\"$deplib $finalize_deplibs\"\n\t    else\n\t      newdlfiles=\"$newdlfiles $deplib\"\n\t    fi\n\t  fi\n\t  continue\n\t  ;;\n\t%DEPLIBS%)\n\t  alldeplibs=yes\n\t  continue\n\t  ;;\n\tesac # case $deplib\n\tif test \"$found\" = yes || test -f \"$lib\"; then :\n\telse\n\t  $echo \"$modename: cannot find the library \\`$lib'\" 1>&2\n\t  exit $EXIT_FAILURE\n\tfi\n\n\t# Check to see that this really is a libtool archive.\n\tif (${SED} -e '2q' $lib | grep \"^# Generated by .*$PACKAGE\") >/dev/null 2>&1; then :\n\telse\n\t  $echo \"$modename: \\`$lib' is not a valid libtool archive\" 1>&2\n\t  exit $EXIT_FAILURE\n\tfi\n\n\tladir=`$echo \"X$lib\" | $Xsed -e 's%/[^/]*$%%'`\n\ttest \"X$ladir\" = \"X$lib\" && ladir=\".\"\n\n\tdlname=\n\tdlopen=\n\tdlpreopen=\n\tlibdir=\n\tlibrary_names=\n\told_library=\n\t# If the library was installed with an old release of libtool,\n\t# it will not redefine variables installed, or shouldnotlink\n\tinstalled=yes\n\tshouldnotlink=no\n\n\t# Read the .la file\n\tcase $lib in\n\t*/* | *\\\\*) . $lib ;;\n\t*) . ./$lib ;;\n\tesac\n\n\tif test \"$linkmode,$pass\" = \"lib,link\" ||\n\t   test \"$linkmode,$pass\" = \"prog,scan\" ||\n\t   { test \"$linkmode\" != prog && test \"$linkmode\" != lib; }; then\n\t  test -n \"$dlopen\" && dlfiles=\"$dlfiles $dlopen\"\n\t  test -n \"$dlpreopen\" && dlprefiles=\"$dlprefiles $dlpreopen\"\n\tfi\n\n\tif test \"$pass\" = conv; then\n\t  # Only check for convenience libraries\n\t  deplibs=\"$lib $deplibs\"\n\t  if test -z \"$libdir\"; then\n\t    if test -z \"$old_library\"; then\n\t      $echo \"$modename: cannot find name of link library for \\`$lib'\" 1>&2\n\t      exit $EXIT_FAILURE\n\t    fi\n\t    # It is a libtool convenience library, so add in its objects.\n\t    convenience=\"$convenience $ladir/$objdir/$old_library\"\n\t    old_convenience=\"$old_convenience $ladir/$objdir/$old_library\"\n\t    tmp_libs=\n\t    for deplib in $dependency_libs; do\n\t      deplibs=\"$deplib $deplibs\"\n              if test \"X$duplicate_deps\" = \"Xyes\" ; then\n\t        case \"$tmp_libs \" in\n\t        *\" $deplib \"*) specialdeplibs=\"$specialdeplibs $deplib\" ;;\n\t        esac\n              fi\n\t      tmp_libs=\"$tmp_libs $deplib\"\n\t    done\n\t  elif test \"$linkmode\" != prog && test \"$linkmode\" != lib; then\n\t    $echo \"$modename: \\`$lib' is not a convenience library\" 1>&2\n\t    exit $EXIT_FAILURE\n\t  fi\n\t  continue\n\tfi # $pass = conv\n\n\n\t# Get the name of the library we link against.\n\tlinklib=\n\tfor l in $old_library $library_names; do\n\t  linklib=\"$l\"\n\tdone\n\tif test -z \"$linklib\"; then\n\t  $echo \"$modename: cannot find name of link library for \\`$lib'\" 1>&2\n\t  exit $EXIT_FAILURE\n\tfi\n\n\t# This library was specified with -dlopen.\n\tif test \"$pass\" = dlopen; then\n\t  if test -z \"$libdir\"; then\n\t    $echo \"$modename: cannot -dlopen a convenience library: \\`$lib'\" 1>&2\n\t    exit $EXIT_FAILURE\n\t  fi\n\t  if test -z \"$dlname\" ||\n\t     test \"$dlopen_support\" != yes ||\n\t     test \"$build_libtool_libs\" = no; then\n\t    # If there is no dlname, no dlopen support or we're linking\n\t    # statically, we need to preload.  We also need to preload any\n\t    # dependent libraries so libltdl's deplib preloader doesn't\n\t    # bomb out in the load deplibs phase.\n\t    dlprefiles=\"$dlprefiles $lib $dependency_libs\"\n\t  else\n\t    newdlfiles=\"$newdlfiles $lib\"\n\t  fi\n\t  continue\n\tfi # $pass = dlopen\n\n\t# We need an absolute path.\n\tcase $ladir in\n\t[\\\\/]* | [A-Za-z]:[\\\\/]*) abs_ladir=\"$ladir\" ;;\n\t*)\n\t  abs_ladir=`cd \"$ladir\" && pwd`\n\t  if test -z \"$abs_ladir\"; then\n\t    $echo \"$modename: warning: cannot determine absolute directory name of \\`$ladir'\" 1>&2\n\t    $echo \"$modename: passing it literally to the linker, although it might fail\" 1>&2\n\t    abs_ladir=\"$ladir\"\n\t  fi\n\t  ;;\n\tesac\n\tlaname=`$echo \"X$lib\" | $Xsed -e 's%^.*/%%'`\n\n\t# Find the relevant object directory and library name.\n\tif test \"X$installed\" = Xyes; then\n\t  if test ! -f \"$libdir/$linklib\" && test -f \"$abs_ladir/$linklib\"; then\n\t    $echo \"$modename: warning: library \\`$lib' was moved.\" 1>&2\n\t    dir=\"$ladir\"\n\t    absdir=\"$abs_ladir\"\n\t    libdir=\"$abs_ladir\"\n\t  else\n\t    dir=\"$libdir\"\n\t    absdir=\"$libdir\"\n\t  fi\n\telse\n\t  dir=\"$ladir/$objdir\"\n\t  absdir=\"$abs_ladir/$objdir\"\n\t  # Remove this search path later\n\t  notinst_path=\"$notinst_path $abs_ladir\"\n\tfi # $installed = yes\n\tname=`$echo \"X$laname\" | $Xsed -e 's/\\.la$//' -e 's/^lib//'`\n\n\t# This library was specified with -dlpreopen.\n\tif test \"$pass\" = dlpreopen; then\n\t  if test -z \"$libdir\"; then\n\t    $echo \"$modename: cannot -dlpreopen a convenience library: \\`$lib'\" 1>&2\n\t    exit $EXIT_FAILURE\n\t  fi\n\t  # Prefer using a static library (so that no silly _DYNAMIC symbols\n\t  # are required to link).\n\t  if test -n \"$old_library\"; then\n\t    newdlprefiles=\"$newdlprefiles $dir/$old_library\"\n\t  # Otherwise, use the dlname, so that lt_dlopen finds it.\n\t  elif test -n \"$dlname\"; then\n\t    newdlprefiles=\"$newdlprefiles $dir/$dlname\"\n\t  else\n\t    newdlprefiles=\"$newdlprefiles $dir/$linklib\"\n\t  fi\n\tfi # $pass = dlpreopen\n\n\tif test -z \"$libdir\"; then\n\t  # Link the convenience library\n\t  if test \"$linkmode\" = lib; then\n\t    deplibs=\"$dir/$old_library $deplibs\"\n\t  elif test \"$linkmode,$pass\" = \"prog,link\"; then\n\t    compile_deplibs=\"$dir/$old_library $compile_deplibs\"\n\t    finalize_deplibs=\"$dir/$old_library $finalize_deplibs\"\n\t  else\n\t    deplibs=\"$lib $deplibs\" # used for prog,scan pass\n\t  fi\n\t  continue\n\tfi\n\n\n\tif test \"$linkmode\" = prog && test \"$pass\" != link; then\n\t  newlib_search_path=\"$newlib_search_path $ladir\"\n\t  deplibs=\"$lib $deplibs\"\n\n\t  linkalldeplibs=no\n\t  if test \"$link_all_deplibs\" != no || test -z \"$library_names\" ||\n\t     test \"$build_libtool_libs\" = no; then\n\t    linkalldeplibs=yes\n\t  fi\n\n\t  tmp_libs=\n\t  for deplib in $dependency_libs; do\n\t    case $deplib in\n\t    -L*) newlib_search_path=\"$newlib_search_path \"`$echo \"X$deplib\" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test\n\t    esac\n\t    # Need to link against all dependency_libs?\n\t    if test \"$linkalldeplibs\" = yes; then\n\t      deplibs=\"$deplib $deplibs\"\n\t    else\n\t      # Need to hardcode shared library paths\n\t      # or/and link against static libraries\n\t      newdependency_libs=\"$deplib $newdependency_libs\"\n\t    fi\n\t    if test \"X$duplicate_deps\" = \"Xyes\" ; then\n\t      case \"$tmp_libs \" in\n\t      *\" $deplib \"*) specialdeplibs=\"$specialdeplibs $deplib\" ;;\n\t      esac\n\t    fi\n\t    tmp_libs=\"$tmp_libs $deplib\"\n\t  done # for deplib\n\t  continue\n\tfi # $linkmode = prog...\n\n\tif test \"$linkmode,$pass\" = \"prog,link\"; then\n\t  if test -n \"$library_names\" &&\n\t     { test \"$prefer_static_libs\" = no || test -z \"$old_library\"; }; then\n\t    # We need to hardcode the library path\n\t    if test -n \"$shlibpath_var\"; then\n\t      # Make sure the rpath contains only unique directories.\n\t      case \"$temp_rpath \" in\n\t      *\" $dir \"*) ;;\n\t      *\" $absdir \"*) ;;\n\t      *) temp_rpath=\"$temp_rpath $dir\" ;;\n\t      esac\n\t    fi\n\n\t    # Hardcode the library path.\n\t    # Skip directories that are in the system default run-time\n\t    # search path.\n\t    case \" $sys_lib_dlsearch_path \" in\n\t    *\" $absdir \"*) ;;\n\t    *)\n\t      case \"$compile_rpath \" in\n\t      *\" $absdir \"*) ;;\n\t      *) compile_rpath=\"$compile_rpath $absdir\"\n\t      esac\n\t      ;;\n\t    esac\n\t    case \" $sys_lib_dlsearch_path \" in\n\t    *\" $libdir \"*) ;;\n\t    *)\n\t      case \"$finalize_rpath \" in\n\t      *\" $libdir \"*) ;;\n\t      *) finalize_rpath=\"$finalize_rpath $libdir\"\n\t      esac\n\t      ;;\n\t    esac\n\t  fi # $linkmode,$pass = prog,link...\n\n\t  if test \"$alldeplibs\" = yes &&\n\t     { test \"$deplibs_check_method\" = pass_all ||\n\t       { test \"$build_libtool_libs\" = yes &&\n\t\t test -n \"$library_names\"; }; }; then\n\t    # We only need to search for static libraries\n\t    continue\n\t  fi\n\tfi\n\n\tlink_static=no # Whether the deplib will be linked statically\n\tif test -n \"$library_names\" &&\n\t   { test \"$prefer_static_libs\" = no || test -z \"$old_library\"; }; then\n\t  if test \"$installed\" = no; then\n\t    notinst_deplibs=\"$notinst_deplibs $lib\"\n\t    need_relink=yes\n\t  fi\n\t  # This is a shared library\n\n\t  # Warn about portability, can't link against -module's on\n\t  # some systems (darwin)\n\t  if test \"$shouldnotlink\" = yes && test \"$pass\" = link ; then\n\t    $echo\n\t    if test \"$linkmode\" = prog; then\n\t      $echo \"*** Warning: Linking the executable $output against the loadable module\"\n\t    else\n\t      $echo \"*** Warning: Linking the shared library $output against the loadable module\"\n\t    fi\n\t    $echo \"*** $linklib is not portable!\"\n\t  fi\n\t  if test \"$linkmode\" = lib &&\n\t     test \"$hardcode_into_libs\" = yes; then\n\t    # Hardcode the library path.\n\t    # Skip directories that are in the system default run-time\n\t    # search path.\n\t    case \" $sys_lib_dlsearch_path \" in\n\t    *\" $absdir \"*) ;;\n\t    *)\n\t      case \"$compile_rpath \" in\n\t      *\" $absdir \"*) ;;\n\t      *) compile_rpath=\"$compile_rpath $absdir\"\n\t      esac\n\t      ;;\n\t    esac\n\t    case \" $sys_lib_dlsearch_path \" in\n\t    *\" $libdir \"*) ;;\n\t    *)\n\t      case \"$finalize_rpath \" in\n\t      *\" $libdir \"*) ;;\n\t      *) finalize_rpath=\"$finalize_rpath $libdir\"\n\t      esac\n\t      ;;\n\t    esac\n\t  fi\n\n\t  if test -n \"$old_archive_from_expsyms_cmds\"; then\n\t    # figure out the soname\n\t    set dummy $library_names\n\t    realname=\"$2\"\n\t    shift; shift\n\t    libname=`eval \\\\$echo \\\"$libname_spec\\\"`\n\t    # use dlname if we got it. it's perfectly good, no?\n\t    if test -n \"$dlname\"; then\n\t      soname=\"$dlname\"\n\t    elif test -n \"$soname_spec\"; then\n\t      # bleh windows\n\t      case $host in\n\t      *cygwin* | mingw*)\n\t\tmajor=`expr $current - $age`\n\t\tversuffix=\"-$major\"\n\t\t;;\n\t      esac\n\t      eval soname=\\\"$soname_spec\\\"\n\t    else\n\t      soname=\"$realname\"\n\t    fi\n\n\t    # Make a new name for the extract_expsyms_cmds to use\n\t    soroot=\"$soname\"\n\t    soname=`$echo $soroot | ${SED} -e 's/^.*\\///'`\n\t    newlib=\"libimp-`$echo $soname | ${SED} 's/^lib//;s/\\.dll$//'`.a\"\n\n\t    # If the library has no export list, then create one now\n\t    if test -f \"$output_objdir/$soname-def\"; then :\n\t    else\n\t      $show \"extracting exported symbol list from \\`$soname'\"\n\t      save_ifs=\"$IFS\"; IFS='~'\n\t      cmds=$extract_expsyms_cmds\n\t      for cmd in $cmds; do\n\t\tIFS=\"$save_ifs\"\n\t\teval cmd=\\\"$cmd\\\"\n\t\t$show \"$cmd\"\n\t\t$run eval \"$cmd\" || exit $?\n\t      done\n\t      IFS=\"$save_ifs\"\n\t    fi\n\n\t    # Create $newlib\n\t    if test -f \"$output_objdir/$newlib\"; then :; else\n\t      $show \"generating import library for \\`$soname'\"\n\t      save_ifs=\"$IFS\"; IFS='~'\n\t      cmds=$old_archive_from_expsyms_cmds\n\t      for cmd in $cmds; do\n\t\tIFS=\"$save_ifs\"\n\t\teval cmd=\\\"$cmd\\\"\n\t\t$show \"$cmd\"\n\t\t$run eval \"$cmd\" || exit $?\n\t      done\n\t      IFS=\"$save_ifs\"\n\t    fi\n\t    # make sure the library variables are pointing to the new library\n\t    dir=$output_objdir\n\t    linklib=$newlib\n\t  fi # test -n \"$old_archive_from_expsyms_cmds\"\n\n\t  if test \"$linkmode\" = prog || test \"$mode\" != relink; then\n\t    add_shlibpath=\n\t    add_dir=\n\t    add=\n\t    lib_linked=yes\n\t    case $hardcode_action in\n\t    immediate | unsupported)\n\t      if test \"$hardcode_direct\" = no; then\n\t\tadd=\"$dir/$linklib\"\n\t\tcase $host in\n\t\t  *-*-sco3.2v5* ) add_dir=\"-L$dir\" ;;\n\t\t  *-*-darwin* )\n\t\t    # if the lib is a module then we can not link against\n\t\t    # it, someone is ignoring the new warnings I added\n\t\t    if /usr/bin/file -L $add 2> /dev/null | $EGREP \"bundle\" >/dev/null ; then\n\t\t      $echo \"** Warning, lib $linklib is a module, not a shared library\"\n\t\t      if test -z \"$old_library\" ; then\n\t\t        $echo\n\t\t        $echo \"** And there doesn't seem to be a static archive available\"\n\t\t        $echo \"** The link will probably fail, sorry\"\n\t\t      else\n\t\t        add=\"$dir/$old_library\"\n\t\t      fi\n\t\t    fi\n\t\tesac\n\t      elif test \"$hardcode_minus_L\" = no; then\n\t\tcase $host in\n\t\t*-*-sunos*) add_shlibpath=\"$dir\" ;;\n\t\tesac\n\t\tadd_dir=\"-L$dir\"\n\t\tadd=\"-l$name\"\n\t      elif test \"$hardcode_shlibpath_var\" = no; then\n\t\tadd_shlibpath=\"$dir\"\n\t\tadd=\"-l$name\"\n\t      else\n\t\tlib_linked=no\n\t      fi\n\t      ;;\n\t    relink)\n\t      if test \"$hardcode_direct\" = yes; then\n\t\tadd=\"$dir/$linklib\"\n\t      elif test \"$hardcode_minus_L\" = yes; then\n\t\tadd_dir=\"-L$dir\"\n\t\t# Try looking first in the location we're being installed to.\n\t\tif test -n \"$inst_prefix_dir\"; then\n\t\t  case \"$libdir\" in\n\t\t    [\\\\/]*)\n\t\t      add_dir=\"$add_dir -L$inst_prefix_dir$libdir\"\n\t\t      ;;\n\t\t  esac\n\t\tfi\n\t\tadd=\"-l$name\"\n\t      elif test \"$hardcode_shlibpath_var\" = yes; then\n\t\tadd_shlibpath=\"$dir\"\n\t\tadd=\"-l$name\"\n\t      else\n\t\tlib_linked=no\n\t      fi\n\t      ;;\n\t    *) lib_linked=no ;;\n\t    esac\n\n\t    if test \"$lib_linked\" != yes; then\n\t      $echo \"$modename: configuration error: unsupported hardcode properties\"\n\t      exit $EXIT_FAILURE\n\t    fi\n\n\t    if test -n \"$add_shlibpath\"; then\n\t      case :$compile_shlibpath: in\n\t      *\":$add_shlibpath:\"*) ;;\n\t      *) compile_shlibpath=\"$compile_shlibpath$add_shlibpath:\" ;;\n\t      esac\n\t    fi\n\t    if test \"$linkmode\" = prog; then\n\t      test -n \"$add_dir\" && compile_deplibs=\"$add_dir $compile_deplibs\"\n\t      test -n \"$add\" && compile_deplibs=\"$add $compile_deplibs\"\n\t    else\n\t      test -n \"$add_dir\" && deplibs=\"$add_dir $deplibs\"\n\t      test -n \"$add\" && deplibs=\"$add $deplibs\"\n\t      if test \"$hardcode_direct\" != yes && \\\n\t\t test \"$hardcode_minus_L\" != yes && \\\n\t\t test \"$hardcode_shlibpath_var\" = yes; then\n\t\tcase :$finalize_shlibpath: in\n\t\t*\":$libdir:\"*) ;;\n\t\t*) finalize_shlibpath=\"$finalize_shlibpath$libdir:\" ;;\n\t\tesac\n\t      fi\n\t    fi\n\t  fi\n\n\t  if test \"$linkmode\" = prog || test \"$mode\" = relink; then\n\t    add_shlibpath=\n\t    add_dir=\n\t    add=\n\t    # Finalize command for both is simple: just hardcode it.\n\t    if test \"$hardcode_direct\" = yes; then\n\t      add=\"$libdir/$linklib\"\n\t    elif test \"$hardcode_minus_L\" = yes; then\n\t      add_dir=\"-L$libdir\"\n\t      add=\"-l$name\"\n\t    elif test \"$hardcode_shlibpath_var\" = yes; then\n\t      case :$finalize_shlibpath: in\n\t      *\":$libdir:\"*) ;;\n\t      *) finalize_shlibpath=\"$finalize_shlibpath$libdir:\" ;;\n\t      esac\n\t      add=\"-l$name\"\n\t    elif test \"$hardcode_automatic\" = yes; then\n\t      if test -n \"$inst_prefix_dir\" &&\n\t\t test -f \"$inst_prefix_dir$libdir/$linklib\" ; then\n\t        add=\"$inst_prefix_dir$libdir/$linklib\"\n\t      else\n\t        add=\"$libdir/$linklib\"\n\t      fi\n\t    else\n\t      # We cannot seem to hardcode it, guess we'll fake it.\n\t      add_dir=\"-L$libdir\"\n\t      # Try looking first in the location we're being installed to.\n\t      if test -n \"$inst_prefix_dir\"; then\n\t\tcase \"$libdir\" in\n\t\t  [\\\\/]*)\n\t\t    add_dir=\"$add_dir -L$inst_prefix_dir$libdir\"\n\t\t    ;;\n\t\tesac\n\t      fi\n\t      add=\"-l$name\"\n\t    fi\n\n\t    if test \"$linkmode\" = prog; then\n\t      test -n \"$add_dir\" && finalize_deplibs=\"$add_dir $finalize_deplibs\"\n\t      test -n \"$add\" && finalize_deplibs=\"$add $finalize_deplibs\"\n\t    else\n\t      test -n \"$add_dir\" && deplibs=\"$add_dir $deplibs\"\n\t      test -n \"$add\" && deplibs=\"$add $deplibs\"\n\t    fi\n\t  fi\n\telif test \"$linkmode\" = prog; then\n\t  # Here we assume that one of hardcode_direct or hardcode_minus_L\n\t  # is not unsupported.  This is valid on all known static and\n\t  # shared platforms.\n\t  if test \"$hardcode_direct\" != unsupported; then\n\t    test -n \"$old_library\" && linklib=\"$old_library\"\n\t    compile_deplibs=\"$dir/$linklib $compile_deplibs\"\n\t    finalize_deplibs=\"$dir/$linklib $finalize_deplibs\"\n\t  else\n\t    compile_deplibs=\"-l$name -L$dir $compile_deplibs\"\n\t    finalize_deplibs=\"-l$name -L$dir $finalize_deplibs\"\n\t  fi\n\telif test \"$build_libtool_libs\" = yes; then\n\t  # Not a shared library\n\t  if test \"$deplibs_check_method\" != pass_all; then\n\t    # We're trying link a shared library against a static one\n\t    # but the system doesn't support it.\n\n\t    # Just print a warning and add the library to dependency_libs so\n\t    # that the program can be linked against the static library.\n\t    $echo\n\t    $echo \"*** Warning: This system can not link to static lib archive $lib.\"\n\t    $echo \"*** I have the capability to make that library automatically link in when\"\n\t    $echo \"*** you link to this library.  But I can only do this if you have a\"\n\t    $echo \"*** shared version of the library, which you do not appear to have.\"\n\t    if test \"$module\" = yes; then\n\t      $echo \"*** But as you try to build a module library, libtool will still create \"\n\t      $echo \"*** a static module, that should work as long as the dlopening application\"\n\t      $echo \"*** is linked with the -dlopen flag to resolve symbols at runtime.\"\n\t      if test -z \"$global_symbol_pipe\"; then\n\t\t$echo\n\t\t$echo \"*** However, this would only work if libtool was able to extract symbol\"\n\t\t$echo \"*** lists from a program, using \\`nm' or equivalent, but libtool could\"\n\t\t$echo \"*** not find such a program.  So, this module is probably useless.\"\n\t\t$echo \"*** \\`nm' from GNU binutils and a full rebuild may help.\"\n\t      fi\n\t      if test \"$build_old_libs\" = no; then\n\t\tbuild_libtool_libs=module\n\t\tbuild_old_libs=yes\n\t      else\n\t\tbuild_libtool_libs=no\n\t      fi\n\t    fi\n\t  else\n\t    convenience=\"$convenience $dir/$old_library\"\n\t    old_convenience=\"$old_convenience $dir/$old_library\"\n\t    deplibs=\"$dir/$old_library $deplibs\"\n\t    link_static=yes\n\t  fi\n\tfi # link shared/static library?\n\n\tif test \"$linkmode\" = lib; then\n\t  if test -n \"$dependency_libs\" &&\n\t     { test \"$hardcode_into_libs\" != yes ||\n\t       test \"$build_old_libs\" = yes ||\n\t       test \"$link_static\" = yes; }; then\n\t    # Extract -R from dependency_libs\n\t    temp_deplibs=\n\t    for libdir in $dependency_libs; do\n\t      case $libdir in\n\t      -R*) temp_xrpath=`$echo \"X$libdir\" | $Xsed -e 's/^-R//'`\n\t\t   case \" $xrpath \" in\n\t\t   *\" $temp_xrpath \"*) ;;\n\t\t   *) xrpath=\"$xrpath $temp_xrpath\";;\n\t\t   esac;;\n\t      *) temp_deplibs=\"$temp_deplibs $libdir\";;\n\t      esac\n\t    done\n\t    dependency_libs=\"$temp_deplibs\"\n\t  fi\n\n\t  newlib_search_path=\"$newlib_search_path $absdir\"\n\t  # Link against this library\n\t  test \"$link_static\" = no && newdependency_libs=\"$abs_ladir/$laname $newdependency_libs\"\n\t  # ... and its dependency_libs\n\t  tmp_libs=\n\t  for deplib in $dependency_libs; do\n\t    newdependency_libs=\"$deplib $newdependency_libs\"\n\t    if test \"X$duplicate_deps\" = \"Xyes\" ; then\n\t      case \"$tmp_libs \" in\n\t      *\" $deplib \"*) specialdeplibs=\"$specialdeplibs $deplib\" ;;\n\t      esac\n\t    fi\n\t    tmp_libs=\"$tmp_libs $deplib\"\n\t  done\n\n\t  if test \"$link_all_deplibs\" != no; then\n\t    # Add the search paths of all dependency libraries\n\t    for deplib in $dependency_libs; do\n\t      case $deplib in\n\t      -L*) path=\"$deplib\" ;;\n\t      *.la)\n\t\tdir=`$echo \"X$deplib\" | $Xsed -e 's%/[^/]*$%%'`\n\t\ttest \"X$dir\" = \"X$deplib\" && dir=\".\"\n\t\t# We need an absolute path.\n\t\tcase $dir in\n\t\t[\\\\/]* | [A-Za-z]:[\\\\/]*) absdir=\"$dir\" ;;\n\t\t*)\n\t\t  absdir=`cd \"$dir\" && pwd`\n\t\t  if test -z \"$absdir\"; then\n\t\t    $echo \"$modename: warning: cannot determine absolute directory name of \\`$dir'\" 1>&2\n\t\t    absdir=\"$dir\"\n\t\t  fi\n\t\t  ;;\n\t\tesac\n\t\tif grep \"^installed=no\" $deplib > /dev/null; then\n\t\t  path=\"$absdir/$objdir\"\n\t\telse\n\t\t  eval libdir=`${SED} -n -e 's/^libdir=\\(.*\\)$/\\1/p' $deplib`\n\t\t  if test -z \"$libdir\"; then\n\t\t    $echo \"$modename: \\`$deplib' is not a valid libtool archive\" 1>&2\n\t\t    exit $EXIT_FAILURE\n\t\t  fi\n\t\t  if test \"$absdir\" != \"$libdir\"; then\n\t\t    $echo \"$modename: warning: \\`$deplib' seems to be moved\" 1>&2\n\t\t  fi\n\t\t  path=\"$absdir\"\n\t\tfi\n\t\tdepdepl=\n\t\tcase $host in\n\t\t*-*-darwin*)\n\t\t  # we do not want to link against static libs,\n\t\t  # but need to link against shared\n\t\t  eval deplibrary_names=`${SED} -n -e 's/^library_names=\\(.*\\)$/\\1/p' $deplib`\n\t\t  if test -n \"$deplibrary_names\" ; then\n\t\t    for tmp in $deplibrary_names ; do\n\t\t      depdepl=$tmp\n\t\t    done\n\t\t    if test -f \"$path/$depdepl\" ; then\n\t\t      depdepl=\"$path/$depdepl\"\n\t\t    fi\n\t\t    # do not add paths which are already there\n\t\t    case \" $newlib_search_path \" in\n\t\t    *\" $path \"*) ;;\n\t\t    *) newlib_search_path=\"$newlib_search_path $path\";;\n\t\t    esac\n\t\t  fi\n\t\t  path=\"\"\n\t\t  ;;\n\t\t*)\n\t\t  path=\"-L$path\"\n\t\t  ;;\n\t\tesac\n\t\t;;\n\t      -l*)\n\t\tcase $host in\n\t\t*-*-darwin*)\n\t\t  # Again, we only want to link against shared libraries\n\t\t  eval tmp_libs=`$echo \"X$deplib\" | $Xsed -e \"s,^\\-l,,\"`\n\t\t  for tmp in $newlib_search_path ; do\n\t\t    if test -f \"$tmp/lib$tmp_libs.dylib\" ; then\n\t\t      eval depdepl=\"$tmp/lib$tmp_libs.dylib\"\n\t\t      break\n\t\t    fi\n\t\t  done\n\t\t  path=\"\"\n\t\t  ;;\n\t\t*) continue ;;\n\t\tesac\n\t\t;;\n\t      *) continue ;;\n\t      esac\n\t      case \" $deplibs \" in\n\t      *\" $depdepl \"*) ;;\n\t      *) deplibs=\"$depdepl $deplibs\" ;;\n\t      esac\n\t      case \" $deplibs \" in\n\t      *\" $path \"*) ;;\n\t      *) deplibs=\"$deplibs $path\" ;;\n\t      esac\n\t    done\n\t  fi # link_all_deplibs != no\n\tfi # linkmode = lib\n      done # for deplib in $libs\n      dependency_libs=\"$newdependency_libs\"\n      if test \"$pass\" = dlpreopen; then\n\t# Link the dlpreopened libraries before other libraries\n\tfor deplib in $save_deplibs; do\n\t  deplibs=\"$deplib $deplibs\"\n\tdone\n      fi\n      if test \"$pass\" != dlopen; then\n\tif test \"$pass\" != conv; then\n\t  # Make sure lib_search_path contains only unique directories.\n\t  lib_search_path=\n\t  for dir in $newlib_search_path; do\n\t    case \"$lib_search_path \" in\n\t    *\" $dir \"*) ;;\n\t    *) lib_search_path=\"$lib_search_path $dir\" ;;\n\t    esac\n\t  done\n\t  newlib_search_path=\n\tfi\n\n\tif test \"$linkmode,$pass\" != \"prog,link\"; then\n\t  vars=\"deplibs\"\n\telse\n\t  vars=\"compile_deplibs finalize_deplibs\"\n\tfi\n\tfor var in $vars dependency_libs; do\n\t  # Add libraries to $var in reverse order\n\t  eval tmp_libs=\\\"\\$$var\\\"\n\t  new_libs=\n\t  for deplib in $tmp_libs; do\n\t    # FIXME: Pedantically, this is the right thing to do, so\n\t    #        that some nasty dependency loop isn't accidentally\n\t    #        broken:\n\t    #new_libs=\"$deplib $new_libs\"\n\t    # Pragmatically, this seems to cause very few problems in\n\t    # practice:\n\t    case $deplib in\n\t    -L*) new_libs=\"$deplib $new_libs\" ;;\n\t    -R*) ;;\n\t    *)\n\t      # And here is the reason: when a library appears more\n\t      # than once as an explicit dependence of a library, or\n\t      # is implicitly linked in more than once by the\n\t      # compiler, it is considered special, and multiple\n\t      # occurrences thereof are not removed.  Compare this\n\t      # with having the same library being listed as a\n\t      # dependency of multiple other libraries: in this case,\n\t      # we know (pedantically, we assume) the library does not\n\t      # need to be listed more than once, so we keep only the\n\t      # last copy.  This is not always right, but it is rare\n\t      # enough that we require users that really mean to play\n\t      # such unportable linking tricks to link the library\n\t      # using -Wl,-lname, so that libtool does not consider it\n\t      # for duplicate removal.\n\t      case \" $specialdeplibs \" in\n\t      *\" $deplib \"*) new_libs=\"$deplib $new_libs\" ;;\n\t      *)\n\t\tcase \" $new_libs \" in\n\t\t*\" $deplib \"*) ;;\n\t\t*) new_libs=\"$deplib $new_libs\" ;;\n\t\tesac\n\t\t;;\n\t      esac\n\t      ;;\n\t    esac\n\t  done\n\t  tmp_libs=\n\t  for deplib in $new_libs; do\n\t    case $deplib in\n\t    -L*)\n\t      case \" $tmp_libs \" in\n\t      *\" $deplib \"*) ;;\n\t      *) tmp_libs=\"$tmp_libs $deplib\" ;;\n\t      esac\n\t      ;;\n\t    *) tmp_libs=\"$tmp_libs $deplib\" ;;\n\t    esac\n\t  done\n\t  eval $var=\\\"$tmp_libs\\\"\n\tdone # for var\n      fi\n      # Last step: remove runtime libs from dependency_libs\n      # (they stay in deplibs)\n      tmp_libs=\n      for i in $dependency_libs ; do\n\tcase \" $predeps $postdeps $compiler_lib_search_path \" in\n\t*\" $i \"*)\n\t  i=\"\"\n\t  ;;\n\tesac\n\tif test -n \"$i\" ; then\n\t  tmp_libs=\"$tmp_libs $i\"\n\tfi\n      done\n      dependency_libs=$tmp_libs\n    done # for pass\n    if test \"$linkmode\" = prog; then\n      dlfiles=\"$newdlfiles\"\n      dlprefiles=\"$newdlprefiles\"\n    fi\n\n    case $linkmode in\n    oldlib)\n      if test -n \"$deplibs\"; then\n\t$echo \"$modename: warning: \\`-l' and \\`-L' are ignored for archives\" 1>&2\n      fi\n\n      if test -n \"$dlfiles$dlprefiles\" || test \"$dlself\" != no; then\n\t$echo \"$modename: warning: \\`-dlopen' is ignored for archives\" 1>&2\n      fi\n\n      if test -n \"$rpath\"; then\n\t$echo \"$modename: warning: \\`-rpath' is ignored for archives\" 1>&2\n      fi\n\n      if test -n \"$xrpath\"; then\n\t$echo \"$modename: warning: \\`-R' is ignored for archives\" 1>&2\n      fi\n\n      if test -n \"$vinfo\"; then\n\t$echo \"$modename: warning: \\`-version-info/-version-number' is ignored for archives\" 1>&2\n      fi\n\n      if test -n \"$release\"; then\n\t$echo \"$modename: warning: \\`-release' is ignored for archives\" 1>&2\n      fi\n\n      if test -n \"$export_symbols\" || test -n \"$export_symbols_regex\"; then\n\t$echo \"$modename: warning: \\`-export-symbols' is ignored for archives\" 1>&2\n      fi\n\n      # Now set the variables for building old libraries.\n      build_libtool_libs=no\n      oldlibs=\"$output\"\n      objs=\"$objs$old_deplibs\"\n      ;;\n\n    lib)\n      # Make sure we only generate libraries of the form `libNAME.la'.\n      case $outputname in\n      lib*)\n\tname=`$echo \"X$outputname\" | $Xsed -e 's/\\.la$//' -e 's/^lib//'`\n\teval shared_ext=\\\"$shrext_cmds\\\"\n\teval libname=\\\"$libname_spec\\\"\n\t;;\n      *)\n\tif test \"$module\" = no; then\n\t  $echo \"$modename: libtool library \\`$output' must begin with \\`lib'\" 1>&2\n\t  $echo \"$help\" 1>&2\n\t  exit $EXIT_FAILURE\n\tfi\n\tif test \"$need_lib_prefix\" != no; then\n\t  # Add the \"lib\" prefix for modules if required\n\t  name=`$echo \"X$outputname\" | $Xsed -e 's/\\.la$//'`\n\t  eval shared_ext=\\\"$shrext_cmds\\\"\n\t  eval libname=\\\"$libname_spec\\\"\n\telse\n\t  libname=`$echo \"X$outputname\" | $Xsed -e 's/\\.la$//'`\n\tfi\n\t;;\n      esac\n\n      if test -n \"$objs\"; then\n\tif test \"$deplibs_check_method\" != pass_all; then\n\t  $echo \"$modename: cannot build libtool library \\`$output' from non-libtool objects on this host:$objs\" 2>&1\n\t  exit $EXIT_FAILURE\n\telse\n\t  $echo\n\t  $echo \"*** Warning: Linking the shared library $output against the non-libtool\"\n\t  $echo \"*** objects $objs is not portable!\"\n\t  libobjs=\"$libobjs $objs\"\n\tfi\n      fi\n\n      if test \"$dlself\" != no; then\n\t$echo \"$modename: warning: \\`-dlopen self' is ignored for libtool libraries\" 1>&2\n      fi\n\n      set dummy $rpath\n      if test \"$#\" -gt 2; then\n\t$echo \"$modename: warning: ignoring multiple \\`-rpath's for a libtool library\" 1>&2\n      fi\n      install_libdir=\"$2\"\n\n      oldlibs=\n      if test -z \"$rpath\"; then\n\tif test \"$build_libtool_libs\" = yes; then\n\t  # Building a libtool convenience library.\n\t  # Some compilers have problems with a `.al' extension so\n\t  # convenience libraries should have the same extension an\n\t  # archive normally would.\n\t  oldlibs=\"$output_objdir/$libname.$libext $oldlibs\"\n\t  build_libtool_libs=convenience\n\t  build_old_libs=yes\n\tfi\n\n\tif test -n \"$vinfo\"; then\n\t  $echo \"$modename: warning: \\`-version-info/-version-number' is ignored for convenience libraries\" 1>&2\n\tfi\n\n\tif test -n \"$release\"; then\n\t  $echo \"$modename: warning: \\`-release' is ignored for convenience libraries\" 1>&2\n\tfi\n      else\n\n\t# Parse the version information argument.\n\tsave_ifs=\"$IFS\"; IFS=':'\n\tset dummy $vinfo 0 0 0\n\tIFS=\"$save_ifs\"\n\n\tif test -n \"$8\"; then\n\t  $echo \"$modename: too many parameters to \\`-version-info'\" 1>&2\n\t  $echo \"$help\" 1>&2\n\t  exit $EXIT_FAILURE\n\tfi\n\n\t# convert absolute version numbers to libtool ages\n\t# this retains compatibility with .la files and attempts\n\t# to make the code below a bit more comprehensible\n\n\tcase $vinfo_number in\n\tyes)\n\t  number_major=\"$2\"\n\t  number_minor=\"$3\"\n\t  number_revision=\"$4\"\n\t  #\n\t  # There are really only two kinds -- those that\n\t  # use the current revision as the major version\n\t  # and those that subtract age and use age as\n\t  # a minor version.  But, then there is irix\n\t  # which has an extra 1 added just for fun\n\t  #\n\t  case $version_type in\n\t  darwin|linux|osf|windows)\n\t    current=`expr $number_major + $number_minor`\n\t    age=\"$number_minor\"\n\t    revision=\"$number_revision\"\n\t    ;;\n\t  freebsd-aout|freebsd-elf|sunos)\n\t    current=\"$number_major\"\n\t    revision=\"$number_minor\"\n\t    age=\"0\"\n\t    ;;\n\t  irix|nonstopux)\n\t    current=`expr $number_major + $number_minor - 1`\n\t    age=\"$number_minor\"\n\t    revision=\"$number_minor\"\n\t    ;;\n\t  esac\n\t  ;;\n\tno)\n\t  current=\"$2\"\n\t  revision=\"$3\"\n\t  age=\"$4\"\n\t  ;;\n\tesac\n\n\t# Check that each of the things are valid numbers.\n\tcase $current in\n\t[0-9]*) ;;\n\t*)\n\t  $echo \"$modename: CURRENT \\`$current' is not a nonnegative integer\" 1>&2\n\t  $echo \"$modename: \\`$vinfo' is not valid version information\" 1>&2\n\t  exit $EXIT_FAILURE\n\t  ;;\n\tesac\n\n\tcase $revision in\n\t[0-9]*) ;;\n\t*)\n\t  $echo \"$modename: REVISION \\`$revision' is not a nonnegative integer\" 1>&2\n\t  $echo \"$modename: \\`$vinfo' is not valid version information\" 1>&2\n\t  exit $EXIT_FAILURE\n\t  ;;\n\tesac\n\n\tcase $age in\n\t[0-9]*) ;;\n\t*)\n\t  $echo \"$modename: AGE \\`$age' is not a nonnegative integer\" 1>&2\n\t  $echo \"$modename: \\`$vinfo' is not valid version information\" 1>&2\n\t  exit $EXIT_FAILURE\n\t  ;;\n\tesac\n\n\tif test \"$age\" -gt \"$current\"; then\n\t  $echo \"$modename: AGE \\`$age' is greater than the current interface number \\`$current'\" 1>&2\n\t  $echo \"$modename: \\`$vinfo' is not valid version information\" 1>&2\n\t  exit $EXIT_FAILURE\n\tfi\n\n\t# Calculate the version variables.\n\tmajor=\n\tversuffix=\n\tverstring=\n\tcase $version_type in\n\tnone) ;;\n\n\tdarwin)\n\t  # Like Linux, but with the current version available in\n\t  # verstring for coding it into the library header\n\t  major=.`expr $current - $age`\n\t  versuffix=\"$major.$age.$revision\"\n\t  # Darwin ld doesn't like 0 for these options...\n\t  minor_current=`expr $current + 1`\n\t  verstring=\"-compatibility_version $minor_current -current_version $minor_current.$revision\"\n\t  ;;\n\n\tfreebsd-aout)\n\t  major=\".$current\"\n\t  versuffix=\".$current.$revision\";\n\t  ;;\n\n\tfreebsd-elf)\n\t  major=\".$current\"\n\t  versuffix=\".$current\";\n\t  ;;\n\n\tirix | nonstopux)\n\t  major=`expr $current - $age + 1`\n\n\t  case $version_type in\n\t    nonstopux) verstring_prefix=nonstopux ;;\n\t    *)         verstring_prefix=sgi ;;\n\t  esac\n\t  verstring=\"$verstring_prefix$major.$revision\"\n\n\t  # Add in all the interfaces that we are compatible with.\n\t  loop=$revision\n\t  while test \"$loop\" -ne 0; do\n\t    iface=`expr $revision - $loop`\n\t    loop=`expr $loop - 1`\n\t    verstring=\"$verstring_prefix$major.$iface:$verstring\"\n\t  done\n\n\t  # Before this point, $major must not contain `.'.\n\t  major=.$major\n\t  versuffix=\"$major.$revision\"\n\t  ;;\n\n\tlinux)\n\t  major=.`expr $current - $age`\n\t  versuffix=\"$major.$age.$revision\"\n\t  ;;\n\n\tosf)\n\t  major=.`expr $current - $age`\n\t  versuffix=\".$current.$age.$revision\"\n\t  verstring=\"$current.$age.$revision\"\n\n\t  # Add in all the interfaces that we are compatible with.\n\t  loop=$age\n\t  while test \"$loop\" -ne 0; do\n\t    iface=`expr $current - $loop`\n\t    loop=`expr $loop - 1`\n\t    verstring=\"$verstring:${iface}.0\"\n\t  done\n\n\t  # Make executables depend on our current version.\n\t  verstring=\"$verstring:${current}.0\"\n\t  ;;\n\n\tsunos)\n\t  major=\".$current\"\n\t  versuffix=\".$current.$revision\"\n\t  ;;\n\n\twindows)\n\t  # Use '-' rather than '.', since we only want one\n\t  # extension on DOS 8.3 filesystems.\n\t  major=`expr $current - $age`\n\t  versuffix=\"-$major\"\n\t  ;;\n\n\t*)\n\t  $echo \"$modename: unknown library version type \\`$version_type'\" 1>&2\n\t  $echo \"Fatal configuration error.  See the $PACKAGE docs for more information.\" 1>&2\n\t  exit $EXIT_FAILURE\n\t  ;;\n\tesac\n\n\t# Clear the version info if we defaulted, and they specified a release.\n\tif test -z \"$vinfo\" && test -n \"$release\"; then\n\t  major=\n\t  case $version_type in\n\t  darwin)\n\t    # we can't check for \"0.0\" in archive_cmds due to quoting\n\t    # problems, so we reset it completely\n\t    verstring=\n\t    ;;\n\t  *)\n\t    verstring=\"0.0\"\n\t    ;;\n\t  esac\n\t  if test \"$need_version\" = no; then\n\t    versuffix=\n\t  else\n\t    versuffix=\".0.0\"\n\t  fi\n\tfi\n\n\t# Remove version info from name if versioning should be avoided\n\tif test \"$avoid_version\" = yes && test \"$need_version\" = no; then\n\t  major=\n\t  versuffix=\n\t  verstring=\"\"\n\tfi\n\n\t# Check to see if the archive will have undefined symbols.\n\tif test \"$allow_undefined\" = yes; then\n\t  if test \"$allow_undefined_flag\" = unsupported; then\n\t    $echo \"$modename: warning: undefined symbols not allowed in $host shared libraries\" 1>&2\n\t    build_libtool_libs=no\n\t    build_old_libs=yes\n\t  fi\n\telse\n\t  # Don't allow undefined symbols.\n\t  allow_undefined_flag=\"$no_undefined_flag\"\n\tfi\n      fi\n\n      if test \"$mode\" != relink; then\n\t# Remove our outputs, but don't remove object files since they\n\t# may have been created when compiling PIC objects.\n\tremovelist=\n\ttempremovelist=`$echo \"$output_objdir/*\"`\n\tfor p in $tempremovelist; do\n\t  case $p in\n\t    *.$objext)\n\t       ;;\n\t    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)\n\t       if test \"X$precious_files_regex\" != \"X\"; then\n\t         if echo $p | $EGREP -e \"$precious_files_regex\" >/dev/null 2>&1\n\t         then\n\t\t   continue\n\t\t fi\n\t       fi\n\t       removelist=\"$removelist $p\"\n\t       ;;\n\t    *) ;;\n\t  esac\n\tdone\n\tif test -n \"$removelist\"; then\n\t  $show \"${rm}r $removelist\"\n\t  $run ${rm}r $removelist\n\tfi\n      fi\n\n      # Now set the variables for building old libraries.\n      if test \"$build_old_libs\" = yes && test \"$build_libtool_libs\" != convenience ; then\n\toldlibs=\"$oldlibs $output_objdir/$libname.$libext\"\n\n\t# Transform .lo files to .o files.\n\toldobjs=\"$objs \"`$echo \"X$libobjs\" | $SP2NL | $Xsed -e '/\\.'${libext}'$/d' -e \"$lo2o\" | $NL2SP`\n      fi\n\n      # Eliminate all temporary directories.\n      for path in $notinst_path; do\n\tlib_search_path=`$echo \"$lib_search_path \" | ${SED} -e 's% $path % %g'`\n\tdeplibs=`$echo \"$deplibs \" | ${SED} -e 's% -L$path % %g'`\n\tdependency_libs=`$echo \"$dependency_libs \" | ${SED} -e 's% -L$path % %g'`\n      done\n\n      if test -n \"$xrpath\"; then\n\t# If the user specified any rpath flags, then add them.\n\ttemp_xrpath=\n\tfor libdir in $xrpath; do\n\t  temp_xrpath=\"$temp_xrpath -R$libdir\"\n\t  case \"$finalize_rpath \" in\n\t  *\" $libdir \"*) ;;\n\t  *) finalize_rpath=\"$finalize_rpath $libdir\" ;;\n\t  esac\n\tdone\n\tif test \"$hardcode_into_libs\" != yes || test \"$build_old_libs\" = yes; then\n\t  dependency_libs=\"$temp_xrpath $dependency_libs\"\n\tfi\n      fi\n\n      # Make sure dlfiles contains only unique files that won't be dlpreopened\n      old_dlfiles=\"$dlfiles\"\n      dlfiles=\n      for lib in $old_dlfiles; do\n\tcase \" $dlprefiles $dlfiles \" in\n\t*\" $lib \"*) ;;\n\t*) dlfiles=\"$dlfiles $lib\" ;;\n\tesac\n      done\n\n      # Make sure dlprefiles contains only unique files\n      old_dlprefiles=\"$dlprefiles\"\n      dlprefiles=\n      for lib in $old_dlprefiles; do\n\tcase \"$dlprefiles \" in\n\t*\" $lib \"*) ;;\n\t*) dlprefiles=\"$dlprefiles $lib\" ;;\n\tesac\n      done\n\n      if test \"$build_libtool_libs\" = yes; then\n\tif test -n \"$rpath\"; then\n\t  case $host in\n\t  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)\n\t    # these systems don't actually have a c library (as such)!\n\t    ;;\n\t  *-*-rhapsody* | *-*-darwin1.[012])\n\t    # Rhapsody C library is in the System framework\n\t    deplibs=\"$deplibs -framework System\"\n\t    ;;\n\t  *-*-netbsd*)\n\t    # Don't link with libc until the a.out ld.so is fixed.\n\t    ;;\n\t  *-*-openbsd* | *-*-freebsd*)\n\t    # Do not include libc due to us having libc/libc_r.\n\t    test \"X$arg\" = \"X-lc\" && continue\n\t    ;;\n \t  *)\n\t    # Add libc to deplibs on all other systems if necessary.\n\t    if test \"$build_libtool_need_lc\" = \"yes\"; then\n\t      deplibs=\"$deplibs -lc\"\n\t    fi\n\t    ;;\n\t  esac\n\tfi\n\n\t# Transform deplibs into only deplibs that can be linked in shared.\n\tname_save=$name\n\tlibname_save=$libname\n\trelease_save=$release\n\tversuffix_save=$versuffix\n\tmajor_save=$major\n\t# I'm not sure if I'm treating the release correctly.  I think\n\t# release should show up in the -l (ie -lgmp5) so we don't want to\n\t# add it in twice.  Is that correct?\n\trelease=\"\"\n\tversuffix=\"\"\n\tmajor=\"\"\n\tnewdeplibs=\n\tdroppeddeps=no\n\tcase $deplibs_check_method in\n\tpass_all)\n\t  # Don't check for shared/static.  Everything works.\n\t  # This might be a little naive.  We might want to check\n\t  # whether the library exists or not.  But this is on\n\t  # osf3 & osf4 and I'm not really sure... Just\n\t  # implementing what was already the behavior.\n\t  newdeplibs=$deplibs\n\t  ;;\n\ttest_compile)\n\t  # This code stresses the \"libraries are programs\" paradigm to its\n\t  # limits. Maybe even breaks it.  We compile a program, linking it\n\t  # against the deplibs as a proxy for the library.  Then we can check\n\t  # whether they linked in statically or dynamically with ldd.\n\t  $rm conftest.c\n\t  cat > conftest.c <<EOF\n\t  int main() { return 0; }\nEOF\n\t  $rm conftest\n\t  $LTCC -o conftest conftest.c $deplibs\n\t  if test \"$?\" -eq 0 ; then\n\t    ldd_output=`ldd conftest`\n\t    for i in $deplibs; do\n\t      name=\"`expr $i : '-l\\(.*\\)'`\"\n\t      # If $name is empty we are operating on a -L argument.\n              if test \"$name\" != \"\" && test \"$name\" -ne \"0\"; then\n\t\tif test \"X$allow_libtool_libs_with_static_runtimes\" = \"Xyes\" ; then\n\t\t  case \" $predeps $postdeps \" in\n\t\t  *\" $i \"*)\n\t\t    newdeplibs=\"$newdeplibs $i\"\n\t\t    i=\"\"\n\t\t    ;;\n\t\t  esac\n\t        fi\n\t\tif test -n \"$i\" ; then\n\t\t  libname=`eval \\\\$echo \\\"$libname_spec\\\"`\n\t\t  deplib_matches=`eval \\\\$echo \\\"$library_names_spec\\\"`\n\t\t  set dummy $deplib_matches\n\t\t  deplib_match=$2\n\t\t  if test `expr \"$ldd_output\" : \".*$deplib_match\"` -ne 0 ; then\n\t\t    newdeplibs=\"$newdeplibs $i\"\n\t\t  else\n\t\t    droppeddeps=yes\n\t\t    $echo\n\t\t    $echo \"*** Warning: dynamic linker does not accept needed library $i.\"\n\t\t    $echo \"*** I have the capability to make that library automatically link in when\"\n\t\t    $echo \"*** you link to this library.  But I can only do this if you have a\"\n\t\t    $echo \"*** shared version of the library, which I believe you do not have\"\n\t\t    $echo \"*** because a test_compile did reveal that the linker did not use it for\"\n\t\t    $echo \"*** its dynamic dependency list that programs get resolved with at runtime.\"\n\t\t  fi\n\t\tfi\n\t      else\n\t\tnewdeplibs=\"$newdeplibs $i\"\n\t      fi\n\t    done\n\t  else\n\t    # Error occurred in the first compile.  Let's try to salvage\n\t    # the situation: Compile a separate program for each library.\n\t    for i in $deplibs; do\n\t      name=\"`expr $i : '-l\\(.*\\)'`\"\n\t      # If $name is empty we are operating on a -L argument.\n              if test \"$name\" != \"\" && test \"$name\" != \"0\"; then\n\t\t$rm conftest\n\t\t$LTCC -o conftest conftest.c $i\n\t\t# Did it work?\n\t\tif test \"$?\" -eq 0 ; then\n\t\t  ldd_output=`ldd conftest`\n\t\t  if test \"X$allow_libtool_libs_with_static_runtimes\" = \"Xyes\" ; then\n\t\t    case \" $predeps $postdeps \" in\n\t\t    *\" $i \"*)\n\t\t      newdeplibs=\"$newdeplibs $i\"\n\t\t      i=\"\"\n\t\t      ;;\n\t\t    esac\n\t\t  fi\n\t\t  if test -n \"$i\" ; then\n\t\t    libname=`eval \\\\$echo \\\"$libname_spec\\\"`\n\t\t    deplib_matches=`eval \\\\$echo \\\"$library_names_spec\\\"`\n\t\t    set dummy $deplib_matches\n\t\t    deplib_match=$2\n\t\t    if test `expr \"$ldd_output\" : \".*$deplib_match\"` -ne 0 ; then\n\t\t      newdeplibs=\"$newdeplibs $i\"\n\t\t    else\n\t\t      droppeddeps=yes\n\t\t      $echo\n\t\t      $echo \"*** Warning: dynamic linker does not accept needed library $i.\"\n\t\t      $echo \"*** I have the capability to make that library automatically link in when\"\n\t\t      $echo \"*** you link to this library.  But I can only do this if you have a\"\n\t\t      $echo \"*** shared version of the library, which you do not appear to have\"\n\t\t      $echo \"*** because a test_compile did reveal that the linker did not use this one\"\n\t\t      $echo \"*** as a dynamic dependency that programs can get resolved with at runtime.\"\n\t\t    fi\n\t\t  fi\n\t\telse\n\t\t  droppeddeps=yes\n\t\t  $echo\n\t\t  $echo \"*** Warning!  Library $i is needed by this library but I was not able to\"\n\t\t  $echo \"***  make it link in!  You will probably need to install it or some\"\n\t\t  $echo \"*** library that it depends on before this library will be fully\"\n\t\t  $echo \"*** functional.  Installing it before continuing would be even better.\"\n\t\tfi\n\t      else\n\t\tnewdeplibs=\"$newdeplibs $i\"\n\t      fi\n\t    done\n\t  fi\n\t  ;;\n\tfile_magic*)\n\t  set dummy $deplibs_check_method\n\t  file_magic_regex=`expr \"$deplibs_check_method\" : \"$2 \\(.*\\)\"`\n\t  for a_deplib in $deplibs; do\n\t    name=\"`expr $a_deplib : '-l\\(.*\\)'`\"\n\t    # If $name is empty we are operating on a -L argument.\n            if test \"$name\" != \"\" && test  \"$name\" != \"0\"; then\n\t      if test \"X$allow_libtool_libs_with_static_runtimes\" = \"Xyes\" ; then\n\t\tcase \" $predeps $postdeps \" in\n\t\t*\" $a_deplib \"*)\n\t\t  newdeplibs=\"$newdeplibs $a_deplib\"\n\t\t  a_deplib=\"\"\n\t\t  ;;\n\t\tesac\n\t      fi\n\t      if test -n \"$a_deplib\" ; then\n\t\tlibname=`eval \\\\$echo \\\"$libname_spec\\\"`\n\t\tfor i in $lib_search_path $sys_lib_search_path $shlib_search_path; do\n\t\t  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`\n\t\t  for potent_lib in $potential_libs; do\n\t\t      # Follow soft links.\n\t\t      if ls -lLd \"$potent_lib\" 2>/dev/null \\\n\t\t\t | grep \" -> \" >/dev/null; then\n\t\t\tcontinue\n\t\t      fi\n\t\t      # The statement above tries to avoid entering an\n\t\t      # endless loop below, in case of cyclic links.\n\t\t      # We might still enter an endless loop, since a link\n\t\t      # loop can be closed while we follow links,\n\t\t      # but so what?\n\t\t      potlib=\"$potent_lib\"\n\t\t      while test -h \"$potlib\" 2>/dev/null; do\n\t\t\tpotliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`\n\t\t\tcase $potliblink in\n\t\t\t[\\\\/]* | [A-Za-z]:[\\\\/]*) potlib=\"$potliblink\";;\n\t\t\t*) potlib=`$echo \"X$potlib\" | $Xsed -e 's,[^/]*$,,'`\"$potliblink\";;\n\t\t\tesac\n\t\t      done\n\t\t      if eval $file_magic_cmd \\\"\\$potlib\\\" 2>/dev/null \\\n\t\t\t | ${SED} 10q \\\n\t\t\t | $EGREP \"$file_magic_regex\" > /dev/null; then\n\t\t\tnewdeplibs=\"$newdeplibs $a_deplib\"\n\t\t\ta_deplib=\"\"\n\t\t\tbreak 2\n\t\t      fi\n\t\t  done\n\t\tdone\n\t      fi\n\t      if test -n \"$a_deplib\" ; then\n\t\tdroppeddeps=yes\n\t\t$echo\n\t\t$echo \"*** Warning: linker path does not have real file for library $a_deplib.\"\n\t\t$echo \"*** I have the capability to make that library automatically link in when\"\n\t\t$echo \"*** you link to this library.  But I can only do this if you have a\"\n\t\t$echo \"*** shared version of the library, which you do not appear to have\"\n\t\t$echo \"*** because I did check the linker path looking for a file starting\"\n\t\tif test -z \"$potlib\" ; then\n\t\t  $echo \"*** with $libname but no candidates were found. (...for file magic test)\"\n\t\telse\n\t\t  $echo \"*** with $libname and none of the candidates passed a file format test\"\n\t\t  $echo \"*** using a file magic. Last file checked: $potlib\"\n\t\tfi\n\t      fi\n\t    else\n\t      # Add a -L argument.\n\t      newdeplibs=\"$newdeplibs $a_deplib\"\n\t    fi\n\t  done # Gone through all deplibs.\n\t  ;;\n\tmatch_pattern*)\n\t  set dummy $deplibs_check_method\n\t  match_pattern_regex=`expr \"$deplibs_check_method\" : \"$2 \\(.*\\)\"`\n\t  for a_deplib in $deplibs; do\n\t    name=\"`expr $a_deplib : '-l\\(.*\\)'`\"\n\t    # If $name is empty we are operating on a -L argument.\n\t    if test -n \"$name\" && test \"$name\" != \"0\"; then\n\t      if test \"X$allow_libtool_libs_with_static_runtimes\" = \"Xyes\" ; then\n\t\tcase \" $predeps $postdeps \" in\n\t\t*\" $a_deplib \"*)\n\t\t  newdeplibs=\"$newdeplibs $a_deplib\"\n\t\t  a_deplib=\"\"\n\t\t  ;;\n\t\tesac\n\t      fi\n\t      if test -n \"$a_deplib\" ; then\n\t\tlibname=`eval \\\\$echo \\\"$libname_spec\\\"`\n\t\tfor i in $lib_search_path $sys_lib_search_path $shlib_search_path; do\n\t\t  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`\n\t\t  for potent_lib in $potential_libs; do\n\t\t    potlib=\"$potent_lib\" # see symlink-check above in file_magic test\n\t\t    if eval $echo \\\"$potent_lib\\\" 2>/dev/null \\\n\t\t        | ${SED} 10q \\\n\t\t        | $EGREP \"$match_pattern_regex\" > /dev/null; then\n\t\t      newdeplibs=\"$newdeplibs $a_deplib\"\n\t\t      a_deplib=\"\"\n\t\t      break 2\n\t\t    fi\n\t\t  done\n\t\tdone\n\t      fi\n\t      if test -n \"$a_deplib\" ; then\n\t\tdroppeddeps=yes\n\t\t$echo\n\t\t$echo \"*** Warning: linker path does not have real file for library $a_deplib.\"\n\t\t$echo \"*** I have the capability to make that library automatically link in when\"\n\t\t$echo \"*** you link to this library.  But I can only do this if you have a\"\n\t\t$echo \"*** shared version of the library, which you do not appear to have\"\n\t\t$echo \"*** because I did check the linker path looking for a file starting\"\n\t\tif test -z \"$potlib\" ; then\n\t\t  $echo \"*** with $libname but no candidates were found. (...for regex pattern test)\"\n\t\telse\n\t\t  $echo \"*** with $libname and none of the candidates passed a file format test\"\n\t\t  $echo \"*** using a regex pattern. Last file checked: $potlib\"\n\t\tfi\n\t      fi\n\t    else\n\t      # Add a -L argument.\n\t      newdeplibs=\"$newdeplibs $a_deplib\"\n\t    fi\n\t  done # Gone through all deplibs.\n\t  ;;\n\tnone | unknown | *)\n\t  newdeplibs=\"\"\n\t  tmp_deplibs=`$echo \"X $deplibs\" | $Xsed -e 's/ -lc$//' \\\n\t    -e 's/ -[LR][^ ]*//g'`\n\t  if test \"X$allow_libtool_libs_with_static_runtimes\" = \"Xyes\" ; then\n\t    for i in $predeps $postdeps ; do\n\t      # can't use Xsed below, because $i might contain '/'\n\t      tmp_deplibs=`$echo \"X $tmp_deplibs\" | ${SED} -e \"1s,^X,,\" -e \"s,$i,,\"`\n\t    done\n\t  fi\n\t  if $echo \"X $tmp_deplibs\" | $Xsed -e 's/[ \t]//g' \\\n\t    | grep . >/dev/null; then\n\t    $echo\n\t    if test \"X$deplibs_check_method\" = \"Xnone\"; then\n\t      $echo \"*** Warning: inter-library dependencies are not supported in this platform.\"\n\t    else\n\t      $echo \"*** Warning: inter-library dependencies are not known to be supported.\"\n\t    fi\n\t    $echo \"*** All declared inter-library dependencies are being dropped.\"\n\t    droppeddeps=yes\n\t  fi\n\t  ;;\n\tesac\n\tversuffix=$versuffix_save\n\tmajor=$major_save\n\trelease=$release_save\n\tlibname=$libname_save\n\tname=$name_save\n\n\tcase $host in\n\t*-*-rhapsody* | *-*-darwin1.[012])\n\t  # On Rhapsody replace the C library is the System framework\n\t  newdeplibs=`$echo \"X $newdeplibs\" | $Xsed -e 's/ -lc / -framework System /'`\n\t  ;;\n\tesac\n\n\tif test \"$droppeddeps\" = yes; then\n\t  if test \"$module\" = yes; then\n\t    $echo\n\t    $echo \"*** Warning: libtool could not satisfy all declared inter-library\"\n\t    $echo \"*** dependencies of module $libname.  Therefore, libtool will create\"\n\t    $echo \"*** a static module, that should work as long as the dlopening\"\n\t    $echo \"*** application is linked with the -dlopen flag.\"\n\t    if test -z \"$global_symbol_pipe\"; then\n\t      $echo\n\t      $echo \"*** However, this would only work if libtool was able to extract symbol\"\n\t      $echo \"*** lists from a program, using \\`nm' or equivalent, but libtool could\"\n\t      $echo \"*** not find such a program.  So, this module is probably useless.\"\n\t      $echo \"*** \\`nm' from GNU binutils and a full rebuild may help.\"\n\t    fi\n\t    if test \"$build_old_libs\" = no; then\n\t      oldlibs=\"$output_objdir/$libname.$libext\"\n\t      build_libtool_libs=module\n\t      build_old_libs=yes\n\t    else\n\t      build_libtool_libs=no\n\t    fi\n\t  else\n\t    $echo \"*** The inter-library dependencies that have been dropped here will be\"\n\t    $echo \"*** automatically added whenever a program is linked with this library\"\n\t    $echo \"*** or is declared to -dlopen it.\"\n\n\t    if test \"$allow_undefined\" = no; then\n\t      $echo\n\t      $echo \"*** Since this library must not contain undefined symbols,\"\n\t      $echo \"*** because either the platform does not support them or\"\n\t      $echo \"*** it was explicitly requested with -no-undefined,\"\n\t      $echo \"*** libtool will only create a static version of it.\"\n\t      if test \"$build_old_libs\" = no; then\n\t\toldlibs=\"$output_objdir/$libname.$libext\"\n\t\tbuild_libtool_libs=module\n\t\tbuild_old_libs=yes\n\t      else\n\t\tbuild_libtool_libs=no\n\t      fi\n\t    fi\n\t  fi\n\tfi\n\t# Done checking deplibs!\n\tdeplibs=$newdeplibs\n      fi\n\n      # All the library-specific variables (install_libdir is set above).\n      library_names=\n      old_library=\n      dlname=\n\n      # Test again, we may have decided not to build it any more\n      if test \"$build_libtool_libs\" = yes; then\n\tif test \"$hardcode_into_libs\" = yes; then\n\t  # Hardcode the library paths\n\t  hardcode_libdirs=\n\t  dep_rpath=\n\t  rpath=\"$finalize_rpath\"\n\t  test \"$mode\" != relink && rpath=\"$compile_rpath$rpath\"\n\t  for libdir in $rpath; do\n\t    if test -n \"$hardcode_libdir_flag_spec\"; then\n\t      if test -n \"$hardcode_libdir_separator\"; then\n\t\tif test -z \"$hardcode_libdirs\"; then\n\t\t  hardcode_libdirs=\"$libdir\"\n\t\telse\n\t\t  # Just accumulate the unique libdirs.\n\t\t  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in\n\t\t  *\"$hardcode_libdir_separator$libdir$hardcode_libdir_separator\"*)\n\t\t    ;;\n\t\t  *)\n\t\t    hardcode_libdirs=\"$hardcode_libdirs$hardcode_libdir_separator$libdir\"\n\t\t    ;;\n\t\t  esac\n\t\tfi\n\t      else\n\t\teval flag=\\\"$hardcode_libdir_flag_spec\\\"\n\t\tdep_rpath=\"$dep_rpath $flag\"\n\t      fi\n\t    elif test -n \"$runpath_var\"; then\n\t      case \"$perm_rpath \" in\n\t      *\" $libdir \"*) ;;\n\t      *) perm_rpath=\"$perm_rpath $libdir\" ;;\n\t      esac\n\t    fi\n\t  done\n\t  # Substitute the hardcoded libdirs into the rpath.\n\t  if test -n \"$hardcode_libdir_separator\" &&\n\t     test -n \"$hardcode_libdirs\"; then\n\t    libdir=\"$hardcode_libdirs\"\n\t    if test -n \"$hardcode_libdir_flag_spec_ld\"; then\n\t      eval dep_rpath=\\\"$hardcode_libdir_flag_spec_ld\\\"\n\t    else\n\t      eval dep_rpath=\\\"$hardcode_libdir_flag_spec\\\"\n\t    fi\n\t  fi\n\t  if test -n \"$runpath_var\" && test -n \"$perm_rpath\"; then\n\t    # We should set the runpath_var.\n\t    rpath=\n\t    for dir in $perm_rpath; do\n\t      rpath=\"$rpath$dir:\"\n\t    done\n\t    eval \"$runpath_var='$rpath\\$$runpath_var'; export $runpath_var\"\n\t  fi\n\t  test -n \"$dep_rpath\" && deplibs=\"$dep_rpath $deplibs\"\n\tfi\n\n\tshlibpath=\"$finalize_shlibpath\"\n\ttest \"$mode\" != relink && shlibpath=\"$compile_shlibpath$shlibpath\"\n\tif test -n \"$shlibpath\"; then\n\t  eval \"$shlibpath_var='$shlibpath\\$$shlibpath_var'; export $shlibpath_var\"\n\tfi\n\n\t# Get the real and link names of the library.\n\teval shared_ext=\\\"$shrext_cmds\\\"\n\teval library_names=\\\"$library_names_spec\\\"\n\tset dummy $library_names\n\trealname=\"$2\"\n\tshift; shift\n\n\tif test -n \"$soname_spec\"; then\n\t  eval soname=\\\"$soname_spec\\\"\n\telse\n\t  soname=\"$realname\"\n\tfi\n\tif test -z \"$dlname\"; then\n\t  dlname=$soname\n\tfi\n\n\tlib=\"$output_objdir/$realname\"\n\tfor link\n\tdo\n\t  linknames=\"$linknames $link\"\n\tdone\n\n\t# Use standard objects if they are pic\n\ttest -z \"$pic_flag\" && libobjs=`$echo \"X$libobjs\" | $SP2NL | $Xsed -e \"$lo2o\" | $NL2SP`\n\n\t# Prepare the list of exported symbols\n\tif test -z \"$export_symbols\"; then\n\t  if test \"$always_export_symbols\" = yes || test -n \"$export_symbols_regex\"; then\n\t    $show \"generating symbol list for \\`$libname.la'\"\n\t    export_symbols=\"$output_objdir/$libname.exp\"\n\t    $run $rm $export_symbols\n\t    cmds=$export_symbols_cmds\n\t    save_ifs=\"$IFS\"; IFS='~'\n\t    for cmd in $cmds; do\n\t      IFS=\"$save_ifs\"\n\t      eval cmd=\\\"$cmd\\\"\n\t      if len=`expr \"X$cmd\" : \".*\"` &&\n\t       test \"$len\" -le \"$max_cmd_len\" || test \"$max_cmd_len\" -le -1; then\n\t        $show \"$cmd\"\n\t        $run eval \"$cmd\" || exit $?\n\t        skipped_export=false\n\t      else\n\t        # The command line is too long to execute in one step.\n\t        $show \"using reloadable object file for export list...\"\n\t        skipped_export=:\n\t      fi\n\t    done\n\t    IFS=\"$save_ifs\"\n\t    if test -n \"$export_symbols_regex\"; then\n\t      $show \"$EGREP -e \\\"$export_symbols_regex\\\" \\\"$export_symbols\\\" > \\\"${export_symbols}T\\\"\"\n\t      $run eval '$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"'\n\t      $show \"$mv \\\"${export_symbols}T\\\" \\\"$export_symbols\\\"\"\n\t      $run eval '$mv \"${export_symbols}T\" \"$export_symbols\"'\n\t    fi\n\t  fi\n\tfi\n\n\tif test -n \"$export_symbols\" && test -n \"$include_expsyms\"; then\n\t  $run eval '$echo \"X$include_expsyms\" | $SP2NL >> \"$export_symbols\"'\n\tfi\n\n\ttmp_deplibs=\n\tfor test_deplib in $deplibs; do\n\t\tcase \" $convenience \" in\n\t\t*\" $test_deplib \"*) ;;\n\t\t*)\n\t\t\ttmp_deplibs=\"$tmp_deplibs $test_deplib\"\n\t\t\t;;\n\t\tesac\n\tdone\n\tdeplibs=\"$tmp_deplibs\"\n\n\tif test -n \"$convenience\"; then\n\t  if test -n \"$whole_archive_flag_spec\"; then\n\t    save_libobjs=$libobjs\n\t    eval libobjs=\\\"\\$libobjs $whole_archive_flag_spec\\\"\n\t  else\n\t    gentop=\"$output_objdir/${outputname}x\"\n\t    $show \"${rm}r $gentop\"\n\t    $run ${rm}r \"$gentop\"\n\t    $show \"$mkdir $gentop\"\n\t    $run $mkdir \"$gentop\"\n\t    status=$?\n\t    if test \"$status\" -ne 0 && test ! -d \"$gentop\"; then\n\t      exit $status\n\t    fi\n\t    generated=\"$generated $gentop\"\n\n\t    for xlib in $convenience; do\n\t      # Extract the objects.\n\t      case $xlib in\n\t      [\\\\/]* | [A-Za-z]:[\\\\/]*) xabs=\"$xlib\" ;;\n\t      *) xabs=`pwd`\"/$xlib\" ;;\n\t      esac\n\t      xlib=`$echo \"X$xlib\" | $Xsed -e 's%^.*/%%'`\n\t      xdir=\"$gentop/$xlib\"\n\n\t      $show \"${rm}r $xdir\"\n\t      $run ${rm}r \"$xdir\"\n\t      $show \"$mkdir $xdir\"\n\t      $run $mkdir \"$xdir\"\n\t      status=$?\n\t      if test \"$status\" -ne 0 && test ! -d \"$xdir\"; then\n\t\texit $status\n\t      fi\n\t      # We will extract separately just the conflicting names and we will no\n\t      # longer touch any unique names. It is faster to leave these extract\n\t      # automatically by $AR in one run.\n\t      $show \"(cd $xdir && $AR x $xabs)\"\n\t      $run eval \"(cd \\$xdir && $AR x \\$xabs)\" || exit $?\n\t      if ($AR t \"$xabs\" | sort | sort -uc >/dev/null 2>&1); then\n\t\t:\n\t      else\n\t\t$echo \"$modename: warning: object name conflicts; renaming object files\" 1>&2\n\t\t$echo \"$modename: warning: to ensure that they will not overwrite\" 1>&2\n\t\t$AR t \"$xabs\" | sort | uniq -cd | while read -r count name\n\t\tdo\n\t\t  i=1\n\t\t  while test \"$i\" -le \"$count\"\n\t\t  do\n\t\t   # Put our $i before any first dot (extension)\n\t\t   # Never overwrite any file\n\t\t   name_to=\"$name\"\n\t\t   while test \"X$name_to\" = \"X$name\" || test -f \"$xdir/$name_to\"\n\t\t   do\n\t\t     name_to=`$echo \"X$name_to\" | $Xsed -e \"s/\\([^.]*\\)/\\1-$i/\"`\n\t\t   done\n\t\t   $show \"(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')\"\n\t\t   $run eval \"(cd \\$xdir && $AR xN $i \\$xabs '$name' && $mv '$name' '$name_to')\" || exit $?\n\t\t   i=`expr $i + 1`\n\t\t  done\n\t\tdone\n\t      fi\n\n\t      libobjs=\"$libobjs \"`find $xdir -name \\*.$objext -print -o -name \\*.lo -print | $NL2SP`\n\t    done\n\t  fi\n\tfi\n\n\tif test \"$thread_safe\" = yes && test -n \"$thread_safe_flag_spec\"; then\n\t  eval flag=\\\"$thread_safe_flag_spec\\\"\n\t  linker_flags=\"$linker_flags $flag\"\n\tfi\n\n\t# Make a backup of the uninstalled library when relinking\n\tif test \"$mode\" = relink; then\n\t  $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?\n\tfi\n\n\t# Do each of the archive commands.\n\tif test \"$module\" = yes && test -n \"$module_cmds\" ; then\n\t  if test -n \"$export_symbols\" && test -n \"$module_expsym_cmds\"; then\n\t    eval test_cmds=\\\"$module_expsym_cmds\\\"\n\t    cmds=$module_expsym_cmds\n\t  else\n\t    eval test_cmds=\\\"$module_cmds\\\"\n\t    cmds=$module_cmds\n\t  fi\n\telse\n\tif test -n \"$export_symbols\" && test -n \"$archive_expsym_cmds\"; then\n\t  eval test_cmds=\\\"$archive_expsym_cmds\\\"\n\t  cmds=$archive_expsym_cmds\n\telse\n\t  eval test_cmds=\\\"$archive_cmds\\\"\n\t  cmds=$archive_cmds\n\t  fi\n\tfi\n\n\tif test \"X$skipped_export\" != \"X:\" && len=`expr \"X$test_cmds\" : \".*\"` &&\n\t   test \"$len\" -le \"$max_cmd_len\" || test \"$max_cmd_len\" -le -1; then\n\t  :\n\telse\n\t  # The command line is too long to link in one step, link piecewise.\n\t  $echo \"creating reloadable object files...\"\n\n\t  # Save the value of $output and $libobjs because we want to\n\t  # use them later.  If we have whole_archive_flag_spec, we\n\t  # want to use save_libobjs as it was before\n\t  # whole_archive_flag_spec was expanded, because we can't\n\t  # assume the linker understands whole_archive_flag_spec.\n\t  # This may have to be revisited, in case too many\n\t  # convenience libraries get linked in and end up exceeding\n\t  # the spec.\n\t  if test -z \"$convenience\" || test -z \"$whole_archive_flag_spec\"; then\n\t    save_libobjs=$libobjs\n\t  fi\n\t  save_output=$output\n\n\t  # Clear the reloadable object creation command queue and\n\t  # initialize k to one.\n\t  test_cmds=\n\t  concat_cmds=\n\t  objlist=\n\t  delfiles=\n\t  last_robj=\n\t  k=1\n\t  output=$output_objdir/$save_output-${k}.$objext\n\t  # Loop over the list of objects to be linked.\n\t  for obj in $save_libobjs\n\t  do\n\t    eval test_cmds=\\\"$reload_cmds $objlist $last_robj\\\"\n\t    if test \"X$objlist\" = X ||\n\t       { len=`expr \"X$test_cmds\" : \".*\"` &&\n\t\t test \"$len\" -le \"$max_cmd_len\"; }; then\n\t      objlist=\"$objlist $obj\"\n\t    else\n\t      # The command $test_cmds is almost too long, add a\n\t      # command to the queue.\n\t      if test \"$k\" -eq 1 ; then\n\t\t# The first file doesn't have a previous command to add.\n\t\teval concat_cmds=\\\"$reload_cmds $objlist $last_robj\\\"\n\t      else\n\t\t# All subsequent reloadable object files will link in\n\t\t# the last one created.\n\t\teval concat_cmds=\\\"\\$concat_cmds~$reload_cmds $objlist $last_robj\\\"\n\t      fi\n\t      last_robj=$output_objdir/$save_output-${k}.$objext\n\t      k=`expr $k + 1`\n\t      output=$output_objdir/$save_output-${k}.$objext\n\t      objlist=$obj\n\t      len=1\n\t    fi\n\t  done\n\t  # Handle the remaining objects by creating one last\n\t  # reloadable object file.  All subsequent reloadable object\n\t  # files will link in the last one created.\n\t  test -z \"$concat_cmds\" || concat_cmds=$concat_cmds~\n\t  eval concat_cmds=\\\"\\${concat_cmds}$reload_cmds $objlist $last_robj\\\"\n\n\t  if ${skipped_export-false}; then\n\t    $show \"generating symbol list for \\`$libname.la'\"\n\t    export_symbols=\"$output_objdir/$libname.exp\"\n\t    $run $rm $export_symbols\n\t    libobjs=$output\n\t    # Append the command to create the export file.\n\t    eval concat_cmds=\\\"\\$concat_cmds~$export_symbols_cmds\\\"\n          fi\n\n\t  # Set up a command to remove the reloadale object files\n\t  # after they are used.\n\t  i=0\n\t  while test \"$i\" -lt \"$k\"\n\t  do\n\t    i=`expr $i + 1`\n\t    delfiles=\"$delfiles $output_objdir/$save_output-${i}.$objext\"\n\t  done\n\n\t  $echo \"creating a temporary reloadable object file: $output\"\n\n\t  # Loop through the commands generated above and execute them.\n\t  save_ifs=\"$IFS\"; IFS='~'\n\t  for cmd in $concat_cmds; do\n\t    IFS=\"$save_ifs\"\n\t    $show \"$cmd\"\n\t    $run eval \"$cmd\" || exit $?\n\t  done\n\t  IFS=\"$save_ifs\"\n\n\t  libobjs=$output\n\t  # Restore the value of output.\n\t  output=$save_output\n\n\t  if test -n \"$convenience\" && test -n \"$whole_archive_flag_spec\"; then\n\t    eval libobjs=\\\"\\$libobjs $whole_archive_flag_spec\\\"\n\t  fi\n\t  # Expand the library linking commands again to reset the\n\t  # value of $libobjs for piecewise linking.\n\n\t  # Do each of the archive commands.\n\t  if test \"$module\" = yes && test -n \"$module_cmds\" ; then\n\t    if test -n \"$export_symbols\" && test -n \"$module_expsym_cmds\"; then\n\t      cmds=$module_expsym_cmds\n\t    else\n\t      cmds=$module_cmds\n\t    fi\n\t  else\n\t  if test -n \"$export_symbols\" && test -n \"$archive_expsym_cmds\"; then\n\t    cmds=$archive_expsym_cmds\n\t  else\n\t    cmds=$archive_cmds\n\t    fi\n\t  fi\n\n\t  # Append the command to remove the reloadable object files\n\t  # to the just-reset $cmds.\n\t  eval cmds=\\\"\\$cmds~\\$rm $delfiles\\\"\n\tfi\n\tsave_ifs=\"$IFS\"; IFS='~'\n\tfor cmd in $cmds; do\n\t  IFS=\"$save_ifs\"\n\t  eval cmd=\\\"$cmd\\\"\n\t  $show \"$cmd\"\n\t  $run eval \"$cmd\" || exit $?\n\tdone\n\tIFS=\"$save_ifs\"\n\n\t# Restore the uninstalled library and exit\n\tif test \"$mode\" = relink; then\n\t  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv \"$realname\"U $realname)' || exit $?\n\t  exit $EXIT_SUCCESS\n\tfi\n\n\t# Create links to the real library.\n\tfor linkname in $linknames; do\n\t  if test \"$realname\" != \"$linkname\"; then\n\t    $show \"(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)\"\n\t    $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?\n\t  fi\n\tdone\n\n\t# If -module or -export-dynamic was specified, set the dlname.\n\tif test \"$module\" = yes || test \"$export_dynamic\" = yes; then\n\t  # On all known operating systems, these are identical.\n\t  dlname=\"$soname\"\n\tfi\n      fi\n      ;;\n\n    obj)\n      if test -n \"$deplibs\"; then\n\t$echo \"$modename: warning: \\`-l' and \\`-L' are ignored for objects\" 1>&2\n      fi\n\n      if test -n \"$dlfiles$dlprefiles\" || test \"$dlself\" != no; then\n\t$echo \"$modename: warning: \\`-dlopen' is ignored for objects\" 1>&2\n      fi\n\n      if test -n \"$rpath\"; then\n\t$echo \"$modename: warning: \\`-rpath' is ignored for objects\" 1>&2\n      fi\n\n      if test -n \"$xrpath\"; then\n\t$echo \"$modename: warning: \\`-R' is ignored for objects\" 1>&2\n      fi\n\n      if test -n \"$vinfo\"; then\n\t$echo \"$modename: warning: \\`-version-info' is ignored for objects\" 1>&2\n      fi\n\n      if test -n \"$release\"; then\n\t$echo \"$modename: warning: \\`-release' is ignored for objects\" 1>&2\n      fi\n\n      case $output in\n      *.lo)\n\tif test -n \"$objs$old_deplibs\"; then\n\t  $echo \"$modename: cannot build library object \\`$output' from non-libtool objects\" 1>&2\n\t  exit $EXIT_FAILURE\n\tfi\n\tlibobj=\"$output\"\n\tobj=`$echo \"X$output\" | $Xsed -e \"$lo2o\"`\n\t;;\n      *)\n\tlibobj=\n\tobj=\"$output\"\n\t;;\n      esac\n\n      # Delete the old objects.\n      $run $rm $obj $libobj\n\n      # Objects from convenience libraries.  This assumes\n      # single-version convenience libraries.  Whenever we create\n      # different ones for PIC/non-PIC, this we'll have to duplicate\n      # the extraction.\n      reload_conv_objs=\n      gentop=\n      # reload_cmds runs $LD directly, so let us get rid of\n      # -Wl from whole_archive_flag_spec\n      wl=\n\n      if test -n \"$convenience\"; then\n\tif test -n \"$whole_archive_flag_spec\"; then\n\t  eval reload_conv_objs=\\\"\\$reload_objs $whole_archive_flag_spec\\\"\n\telse\n\t  gentop=\"$output_objdir/${obj}x\"\n\t  $show \"${rm}r $gentop\"\n\t  $run ${rm}r \"$gentop\"\n\t  $show \"$mkdir $gentop\"\n\t  $run $mkdir \"$gentop\"\n\t  status=$?\n\t  if test \"$status\" -ne 0 && test ! -d \"$gentop\"; then\n\t    exit $status\n\t  fi\n\t  generated=\"$generated $gentop\"\n\n\t  for xlib in $convenience; do\n\t    # Extract the objects.\n\t    case $xlib in\n\t    [\\\\/]* | [A-Za-z]:[\\\\/]*) xabs=\"$xlib\" ;;\n\t    *) xabs=`pwd`\"/$xlib\" ;;\n\t    esac\n\t    xlib=`$echo \"X$xlib\" | $Xsed -e 's%^.*/%%'`\n\t    xdir=\"$gentop/$xlib\"\n\n\t    $show \"${rm}r $xdir\"\n\t    $run ${rm}r \"$xdir\"\n\t    $show \"$mkdir $xdir\"\n\t    $run $mkdir \"$xdir\"\n\t    status=$?\n\t    if test \"$status\" -ne 0 && test ! -d \"$xdir\"; then\n\t      exit $status\n\t    fi\n\t    # We will extract separately just the conflicting names and we will no\n\t    # longer touch any unique names. It is faster to leave these extract\n\t    # automatically by $AR in one run.\n\t    $show \"(cd $xdir && $AR x $xabs)\"\n\t    $run eval \"(cd \\$xdir && $AR x \\$xabs)\" || exit $?\n\t    if ($AR t \"$xabs\" | sort | sort -uc >/dev/null 2>&1); then\n\t      :\n\t    else\n\t      $echo \"$modename: warning: object name conflicts; renaming object files\" 1>&2\n\t      $echo \"$modename: warning: to ensure that they will not overwrite\" 1>&2\n\t      $AR t \"$xabs\" | sort | uniq -cd | while read -r count name\n\t      do\n\t\ti=1\n\t\twhile test \"$i\" -le \"$count\"\n\t\tdo\n\t\t # Put our $i before any first dot (extension)\n\t\t # Never overwrite any file\n\t\t name_to=\"$name\"\n\t\t while test \"X$name_to\" = \"X$name\" || test -f \"$xdir/$name_to\"\n\t\t do\n\t\t   name_to=`$echo \"X$name_to\" | $Xsed -e \"s/\\([^.]*\\)/\\1-$i/\"`\n\t\t done\n\t\t $show \"(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')\"\n\t\t $run eval \"(cd \\$xdir && $AR xN $i \\$xabs '$name' && $mv '$name' '$name_to')\" || exit $?\n\t\t i=`expr $i + 1`\n\t\tdone\n\t      done\n\t    fi\n\n\t    reload_conv_objs=\"$reload_objs \"`find $xdir -name \\*.$objext -print -o -name \\*.lo -print | $NL2SP`\n\t  done\n\tfi\n      fi\n\n      # Create the old-style object.\n      reload_objs=\"$objs$old_deplibs \"`$echo \"X$libobjs\" | $SP2NL | $Xsed -e '/\\.'${libext}$'/d' -e '/\\.lib$/d' -e \"$lo2o\" | $NL2SP`\" $reload_conv_objs\" ### testsuite: skip nested quoting test\n\n      output=\"$obj\"\n      cmds=$reload_cmds\n      save_ifs=\"$IFS\"; IFS='~'\n      for cmd in $cmds; do\n\tIFS=\"$save_ifs\"\n\teval cmd=\\\"$cmd\\\"\n\t$show \"$cmd\"\n\t$run eval \"$cmd\" || exit $?\n      done\n      IFS=\"$save_ifs\"\n\n      # Exit if we aren't doing a library object file.\n      if test -z \"$libobj\"; then\n\tif test -n \"$gentop\"; then\n\t  $show \"${rm}r $gentop\"\n\t  $run ${rm}r $gentop\n\tfi\n\n\texit $EXIT_SUCCESS\n      fi\n\n      if test \"$build_libtool_libs\" != yes; then\n\tif test -n \"$gentop\"; then\n\t  $show \"${rm}r $gentop\"\n\t  $run ${rm}r $gentop\n\tfi\n\n\t# Create an invalid libtool object if no PIC, so that we don't\n\t# accidentally link it into a program.\n\t# $show \"echo timestamp > $libobj\"\n\t# $run eval \"echo timestamp > $libobj\" || exit $?\n\texit $EXIT_SUCCESS\n      fi\n\n      if test -n \"$pic_flag\" || test \"$pic_mode\" != default; then\n\t# Only do commands if we really have different PIC objects.\n\treload_objs=\"$libobjs $reload_conv_objs\"\n\toutput=\"$libobj\"\n\tcmds=$reload_cmds\n\tsave_ifs=\"$IFS\"; IFS='~'\n\tfor cmd in $cmds; do\n\t  IFS=\"$save_ifs\"\n\t  eval cmd=\\\"$cmd\\\"\n\t  $show \"$cmd\"\n\t  $run eval \"$cmd\" || exit $?\n\tdone\n\tIFS=\"$save_ifs\"\n      fi\n\n      if test -n \"$gentop\"; then\n\t$show \"${rm}r $gentop\"\n\t$run ${rm}r $gentop\n      fi\n\n      exit $EXIT_SUCCESS\n      ;;\n\n    prog)\n      case $host in\n\t*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;\n      esac\n      if test -n \"$vinfo\"; then\n\t$echo \"$modename: warning: \\`-version-info' is ignored for programs\" 1>&2\n      fi\n\n      if test -n \"$release\"; then\n\t$echo \"$modename: warning: \\`-release' is ignored for programs\" 1>&2\n      fi\n\n      if test \"$preload\" = yes; then\n\tif test \"$dlopen_support\" = unknown && test \"$dlopen_self\" = unknown &&\n\t   test \"$dlopen_self_static\" = unknown; then\n\t  $echo \"$modename: warning: \\`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support.\"\n\tfi\n      fi\n\n      case $host in\n      *-*-rhapsody* | *-*-darwin1.[012])\n\t# On Rhapsody replace the C library is the System framework\n\tcompile_deplibs=`$echo \"X $compile_deplibs\" | $Xsed -e 's/ -lc / -framework System /'`\n\tfinalize_deplibs=`$echo \"X $finalize_deplibs\" | $Xsed -e 's/ -lc / -framework System /'`\n\t;;\n      esac\n\n      case $host in\n      *darwin*)\n        # Don't allow lazy linking, it breaks C++ global constructors\n        if test \"$tagname\" = CXX ; then\n        compile_command=\"$compile_command ${wl}-bind_at_load\"\n        finalize_command=\"$finalize_command ${wl}-bind_at_load\"\n        fi\n        ;;\n      esac\n\n      compile_command=\"$compile_command $compile_deplibs\"\n      finalize_command=\"$finalize_command $finalize_deplibs\"\n\n      if test -n \"$rpath$xrpath\"; then\n\t# If the user specified any rpath flags, then add them.\n\tfor libdir in $rpath $xrpath; do\n\t  # This is the magic to use -rpath.\n\t  case \"$finalize_rpath \" in\n\t  *\" $libdir \"*) ;;\n\t  *) finalize_rpath=\"$finalize_rpath $libdir\" ;;\n\t  esac\n\tdone\n      fi\n\n      # Now hardcode the library paths\n      rpath=\n      hardcode_libdirs=\n      for libdir in $compile_rpath $finalize_rpath; do\n\tif test -n \"$hardcode_libdir_flag_spec\"; then\n\t  if test -n \"$hardcode_libdir_separator\"; then\n\t    if test -z \"$hardcode_libdirs\"; then\n\t      hardcode_libdirs=\"$libdir\"\n\t    else\n\t      # Just accumulate the unique libdirs.\n\t      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in\n\t      *\"$hardcode_libdir_separator$libdir$hardcode_libdir_separator\"*)\n\t\t;;\n\t      *)\n\t\thardcode_libdirs=\"$hardcode_libdirs$hardcode_libdir_separator$libdir\"\n\t\t;;\n\t      esac\n\t    fi\n\t  else\n\t    eval flag=\\\"$hardcode_libdir_flag_spec\\\"\n\t    rpath=\"$rpath $flag\"\n\t  fi\n\telif test -n \"$runpath_var\"; then\n\t  case \"$perm_rpath \" in\n\t  *\" $libdir \"*) ;;\n\t  *) perm_rpath=\"$perm_rpath $libdir\" ;;\n\t  esac\n\tfi\n\tcase $host in\n\t*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)\n\t  case :$dllsearchpath: in\n\t  *\":$libdir:\"*) ;;\n\t  *) dllsearchpath=\"$dllsearchpath:$libdir\";;\n\t  esac\n\t  ;;\n\tesac\n      done\n      # Substitute the hardcoded libdirs into the rpath.\n      if test -n \"$hardcode_libdir_separator\" &&\n\t test -n \"$hardcode_libdirs\"; then\n\tlibdir=\"$hardcode_libdirs\"\n\teval rpath=\\\" $hardcode_libdir_flag_spec\\\"\n      fi\n      compile_rpath=\"$rpath\"\n\n      rpath=\n      hardcode_libdirs=\n      for libdir in $finalize_rpath; do\n\tif test -n \"$hardcode_libdir_flag_spec\"; then\n\t  if test -n \"$hardcode_libdir_separator\"; then\n\t    if test -z \"$hardcode_libdirs\"; then\n\t      hardcode_libdirs=\"$libdir\"\n\t    else\n\t      # Just accumulate the unique libdirs.\n\t      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in\n\t      *\"$hardcode_libdir_separator$libdir$hardcode_libdir_separator\"*)\n\t\t;;\n\t      *)\n\t\thardcode_libdirs=\"$hardcode_libdirs$hardcode_libdir_separator$libdir\"\n\t\t;;\n\t      esac\n\t    fi\n\t  else\n\t    eval flag=\\\"$hardcode_libdir_flag_spec\\\"\n\t    rpath=\"$rpath $flag\"\n\t  fi\n\telif test -n \"$runpath_var\"; then\n\t  case \"$finalize_perm_rpath \" in\n\t  *\" $libdir \"*) ;;\n\t  *) finalize_perm_rpath=\"$finalize_perm_rpath $libdir\" ;;\n\t  esac\n\tfi\n      done\n      # Substitute the hardcoded libdirs into the rpath.\n      if test -n \"$hardcode_libdir_separator\" &&\n\t test -n \"$hardcode_libdirs\"; then\n\tlibdir=\"$hardcode_libdirs\"\n\teval rpath=\\\" $hardcode_libdir_flag_spec\\\"\n      fi\n      finalize_rpath=\"$rpath\"\n\n      if test -n \"$libobjs\" && test \"$build_old_libs\" = yes; then\n\t# Transform all the library objects into standard objects.\n\tcompile_command=`$echo \"X$compile_command\" | $SP2NL | $Xsed -e \"$lo2o\" | $NL2SP`\n\tfinalize_command=`$echo \"X$finalize_command\" | $SP2NL | $Xsed -e \"$lo2o\" | $NL2SP`\n      fi\n\n      dlsyms=\n      if test -n \"$dlfiles$dlprefiles\" || test \"$dlself\" != no; then\n\tif test -n \"$NM\" && test -n \"$global_symbol_pipe\"; then\n\t  dlsyms=\"${outputname}S.c\"\n\telse\n\t  $echo \"$modename: not configured to extract global symbols from dlpreopened files\" 1>&2\n\tfi\n      fi\n\n      if test -n \"$dlsyms\"; then\n\tcase $dlsyms in\n\t\"\") ;;\n\t*.c)\n\t  # Discover the nlist of each of the dlfiles.\n\t  nlist=\"$output_objdir/${outputname}.nm\"\n\n\t  $show \"$rm $nlist ${nlist}S ${nlist}T\"\n\t  $run $rm \"$nlist\" \"${nlist}S\" \"${nlist}T\"\n\n\t  # Parse the name list into a source file.\n\t  $show \"creating $output_objdir/$dlsyms\"\n\n\t  test -z \"$run\" && $echo > \"$output_objdir/$dlsyms\" \"\\\n/* $dlsyms - symbol resolution table for \\`$outputname' dlsym emulation. */\n/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */\n\n#ifdef __cplusplus\nextern \\\"C\\\" {\n#endif\n\n/* Prevent the only kind of declaration conflicts we can make. */\n#define lt_preloaded_symbols some_other_symbol\n\n/* External symbol declarations for the compiler. */\\\n\"\n\n\t  if test \"$dlself\" = yes; then\n\t    $show \"generating symbol list for \\`$output'\"\n\n\t    test -z \"$run\" && $echo ': @PROGRAM@ ' > \"$nlist\"\n\n\t    # Add our own program objects to the symbol list.\n\t    progfiles=`$echo \"X$objs$old_deplibs\" | $SP2NL | $Xsed -e \"$lo2o\" | $NL2SP`\n\t    for arg in $progfiles; do\n\t      $show \"extracting global C symbols from \\`$arg'\"\n\t      $run eval \"$NM $arg | $global_symbol_pipe >> '$nlist'\"\n\t    done\n\n\t    if test -n \"$exclude_expsyms\"; then\n\t      $run eval '$EGREP -v \" ($exclude_expsyms)$\" \"$nlist\" > \"$nlist\"T'\n\t      $run eval '$mv \"$nlist\"T \"$nlist\"'\n\t    fi\n\n\t    if test -n \"$export_symbols_regex\"; then\n\t      $run eval '$EGREP -e \"$export_symbols_regex\" \"$nlist\" > \"$nlist\"T'\n\t      $run eval '$mv \"$nlist\"T \"$nlist\"'\n\t    fi\n\n\t    # Prepare the list of exported symbols\n\t    if test -z \"$export_symbols\"; then\n\t      export_symbols=\"$output_objdir/$output.exp\"\n\t      $run $rm $export_symbols\n\t      $run eval \"${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \\(.*\\)$/\\1/p' \"'< \"$nlist\" > \"$export_symbols\"'\n\t    else\n\t      $run eval \"${SED} -e 's/\\([][.*^$]\\)/\\\\\\1/g' -e 's/^/ /' -e 's/$/$/'\"' < \"$export_symbols\" > \"$output_objdir/$output.exp\"'\n\t      $run eval 'grep -f \"$output_objdir/$output.exp\" < \"$nlist\" > \"$nlist\"T'\n\t      $run eval 'mv \"$nlist\"T \"$nlist\"'\n\t    fi\n\t  fi\n\n\t  for arg in $dlprefiles; do\n\t    $show \"extracting global C symbols from \\`$arg'\"\n\t    name=`$echo \"$arg\" | ${SED} -e 's%^.*/%%'`\n\t    $run eval '$echo \": $name \" >> \"$nlist\"'\n\t    $run eval \"$NM $arg | $global_symbol_pipe >> '$nlist'\"\n\t  done\n\n\t  if test -z \"$run\"; then\n\t    # Make sure we have at least an empty file.\n\t    test -f \"$nlist\" || : > \"$nlist\"\n\n\t    if test -n \"$exclude_expsyms\"; then\n\t      $EGREP -v \" ($exclude_expsyms)$\" \"$nlist\" > \"$nlist\"T\n\t      $mv \"$nlist\"T \"$nlist\"\n\t    fi\n\n\t    # Try sorting and uniquifying the output.\n\t    if grep -v \"^: \" < \"$nlist\" |\n\t\tif sort -k 3 </dev/null >/dev/null 2>&1; then\n\t\t  sort -k 3\n\t\telse\n\t\t  sort +2\n\t\tfi |\n\t\tuniq > \"$nlist\"S; then\n\t      :\n\t    else\n\t      grep -v \"^: \" < \"$nlist\" > \"$nlist\"S\n\t    fi\n\n\t    if test -f \"$nlist\"S; then\n\t      eval \"$global_symbol_to_cdecl\"' < \"$nlist\"S >> \"$output_objdir/$dlsyms\"'\n\t    else\n\t      $echo '/* NONE */' >> \"$output_objdir/$dlsyms\"\n\t    fi\n\n\t    $echo >> \"$output_objdir/$dlsyms\" \"\\\n\n#undef lt_preloaded_symbols\n\n#if defined (__STDC__) && __STDC__\n# define lt_ptr void *\n#else\n# define lt_ptr char *\n# define const\n#endif\n\n/* The mapping between symbol names and symbols. */\nconst struct {\n  const char *name;\n  lt_ptr address;\n}\nlt_preloaded_symbols[] =\n{\\\n\"\n\n\t    eval \"$global_symbol_to_c_name_address\" < \"$nlist\" >> \"$output_objdir/$dlsyms\"\n\n\t    $echo >> \"$output_objdir/$dlsyms\" \"\\\n  {0, (lt_ptr) 0}\n};\n\n/* This works around a problem in FreeBSD linker */\n#ifdef FREEBSD_WORKAROUND\nstatic const void *lt_preloaded_setup() {\n  return lt_preloaded_symbols;\n}\n#endif\n\n#ifdef __cplusplus\n}\n#endif\\\n\"\n\t  fi\n\n\t  pic_flag_for_symtable=\n\t  case $host in\n\t  # compiling the symbol table file with pic_flag works around\n\t  # a FreeBSD bug that causes programs to crash when -lm is\n\t  # linked before any other PIC object.  But we must not use\n\t  # pic_flag when linking with -static.  The problem exists in\n\t  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.\n\t  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)\n\t    case \"$compile_command \" in\n\t    *\" -static \"*) ;;\n\t    *) pic_flag_for_symtable=\" $pic_flag -DFREEBSD_WORKAROUND\";;\n\t    esac;;\n\t  *-*-hpux*)\n\t    case \"$compile_command \" in\n\t    *\" -static \"*) ;;\n\t    *) pic_flag_for_symtable=\" $pic_flag\";;\n\t    esac\n\t  esac\n\n\t  # Now compile the dynamic symbol file.\n\t  $show \"(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \\\"$dlsyms\\\")\"\n\t  $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")' || exit $?\n\n\t  # Clean up the generated files.\n\t  $show \"$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T\"\n\t  $run $rm \"$output_objdir/$dlsyms\" \"$nlist\" \"${nlist}S\" \"${nlist}T\"\n\n\t  # Transform the symbol file into the correct name.\n\t  compile_command=`$echo \"X$compile_command\" | $Xsed -e \"s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%\"`\n\t  finalize_command=`$echo \"X$finalize_command\" | $Xsed -e \"s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%\"`\n\t  ;;\n\t*)\n\t  $echo \"$modename: unknown suffix for \\`$dlsyms'\" 1>&2\n\t  exit $EXIT_FAILURE\n\t  ;;\n\tesac\n      else\n\t# We keep going just in case the user didn't refer to\n\t# lt_preloaded_symbols.  The linker will fail if global_symbol_pipe\n\t# really was required.\n\n\t# Nullify the symbol file.\n\tcompile_command=`$echo \"X$compile_command\" | $Xsed -e \"s% @SYMFILE@%%\"`\n\tfinalize_command=`$echo \"X$finalize_command\" | $Xsed -e \"s% @SYMFILE@%%\"`\n      fi\n\n      if test \"$need_relink\" = no || test \"$build_libtool_libs\" != yes; then\n\t# Replace the output file specification.\n\tcompile_command=`$echo \"X$compile_command\" | $Xsed -e 's%@OUTPUT@%'\"$output\"'%g'`\n\tlink_command=\"$compile_command$compile_rpath\"\n\n\t# We have no uninstalled library dependencies, so finalize right now.\n\t$show \"$link_command\"\n\t$run eval \"$link_command\"\n\tstatus=$?\n\n\t# Delete the generated files.\n\tif test -n \"$dlsyms\"; then\n\t  $show \"$rm $output_objdir/${outputname}S.${objext}\"\n\t  $run $rm \"$output_objdir/${outputname}S.${objext}\"\n\tfi\n\n\texit $status\n      fi\n\n      if test -n \"$shlibpath_var\"; then\n\t# We should set the shlibpath_var\n\trpath=\n\tfor dir in $temp_rpath; do\n\t  case $dir in\n\t  [\\\\/]* | [A-Za-z]:[\\\\/]*)\n\t    # Absolute path.\n\t    rpath=\"$rpath$dir:\"\n\t    ;;\n\t  *)\n\t    # Relative path: add a thisdir entry.\n\t    rpath=\"$rpath\\$thisdir/$dir:\"\n\t    ;;\n\t  esac\n\tdone\n\ttemp_rpath=\"$rpath\"\n      fi\n\n      if test -n \"$compile_shlibpath$finalize_shlibpath\"; then\n\tcompile_command=\"$shlibpath_var=\\\"$compile_shlibpath$finalize_shlibpath\\$$shlibpath_var\\\" $compile_command\"\n      fi\n      if test -n \"$finalize_shlibpath\"; then\n\tfinalize_command=\"$shlibpath_var=\\\"$finalize_shlibpath\\$$shlibpath_var\\\" $finalize_command\"\n      fi\n\n      compile_var=\n      finalize_var=\n      if test -n \"$runpath_var\"; then\n\tif test -n \"$perm_rpath\"; then\n\t  # We should set the runpath_var.\n\t  rpath=\n\t  for dir in $perm_rpath; do\n\t    rpath=\"$rpath$dir:\"\n\t  done\n\t  compile_var=\"$runpath_var=\\\"$rpath\\$$runpath_var\\\" \"\n\tfi\n\tif test -n \"$finalize_perm_rpath\"; then\n\t  # We should set the runpath_var.\n\t  rpath=\n\t  for dir in $finalize_perm_rpath; do\n\t    rpath=\"$rpath$dir:\"\n\t  done\n\t  finalize_var=\"$runpath_var=\\\"$rpath\\$$runpath_var\\\" \"\n\tfi\n      fi\n\n      if test \"$no_install\" = yes; then\n\t# We don't need to create a wrapper script.\n\tlink_command=\"$compile_var$compile_command$compile_rpath\"\n\t# Replace the output file specification.\n\tlink_command=`$echo \"X$link_command\" | $Xsed -e 's%@OUTPUT@%'\"$output\"'%g'`\n\t# Delete the old output file.\n\t$run $rm $output\n\t# Link the executable and exit\n\t$show \"$link_command\"\n\t$run eval \"$link_command\" || exit $?\n\texit $EXIT_SUCCESS\n      fi\n\n      if test \"$hardcode_action\" = relink; then\n\t# Fast installation is not supported\n\tlink_command=\"$compile_var$compile_command$compile_rpath\"\n\trelink_command=\"$finalize_var$finalize_command$finalize_rpath\"\n\n\t$echo \"$modename: warning: this platform does not like uninstalled shared libraries\" 1>&2\n\t$echo \"$modename: \\`$output' will be relinked during installation\" 1>&2\n      else\n\tif test \"$fast_install\" != no; then\n\t  link_command=\"$finalize_var$compile_command$finalize_rpath\"\n\t  if test \"$fast_install\" = yes; then\n\t    relink_command=`$echo \"X$compile_var$compile_command$compile_rpath\" | $Xsed -e 's%@OUTPUT@%\\$progdir/\\$file%g'`\n\t  else\n\t    # fast_install is set to needless\n\t    relink_command=\n\t  fi\n\telse\n\t  link_command=\"$compile_var$compile_command$compile_rpath\"\n\t  relink_command=\"$finalize_var$finalize_command$finalize_rpath\"\n\tfi\n      fi\n\n      # Replace the output file specification.\n      link_command=`$echo \"X$link_command\" | $Xsed -e 's%@OUTPUT@%'\"$output_objdir/$outputname\"'%g'`\n\n      # Delete the old output files.\n      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname\n\n      $show \"$link_command\"\n      $run eval \"$link_command\" || exit $?\n\n      # Now create the wrapper script.\n      $show \"creating $output\"\n\n      # Quote the relink command for shipping.\n      if test -n \"$relink_command\"; then\n\t# Preserve any variables that may affect compiler behavior\n\tfor var in $variables_saved_for_relink; do\n\t  if eval test -z \\\"\\${$var+set}\\\"; then\n\t    relink_command=\"{ test -z \\\"\\${$var+set}\\\" || unset $var || { $var=; export $var; }; }; $relink_command\"\n\t  elif eval var_value=\\$$var; test -z \"$var_value\"; then\n\t    relink_command=\"$var=; export $var; $relink_command\"\n\t  else\n\t    var_value=`$echo \"X$var_value\" | $Xsed -e \"$sed_quote_subst\"`\n\t    relink_command=\"$var=\\\"$var_value\\\"; export $var; $relink_command\"\n\t  fi\n\tdone\n\trelink_command=\"(cd `pwd`; $relink_command)\"\n\trelink_command=`$echo \"X$relink_command\" | $Xsed -e \"$sed_quote_subst\"`\n      fi\n\n      # Quote $echo for shipping.\n      if test \"X$echo\" = \"X$SHELL $progpath --fallback-echo\"; then\n\tcase $progpath in\n\t[\\\\/]* | [A-Za-z]:[\\\\/]*) qecho=\"$SHELL $progpath --fallback-echo\";;\n\t*) qecho=\"$SHELL `pwd`/$progpath --fallback-echo\";;\n\tesac\n\tqecho=`$echo \"X$qecho\" | $Xsed -e \"$sed_quote_subst\"`\n      else\n\tqecho=`$echo \"X$echo\" | $Xsed -e \"$sed_quote_subst\"`\n      fi\n\n      # Only actually do things if our run command is non-null.\n      if test -z \"$run\"; then\n\t# win32 will think the script is a binary if it has\n\t# a .exe suffix, so we strip it off here.\n\tcase $output in\n\t  *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;\n\tesac\n\t# test for cygwin because mv fails w/o .exe extensions\n\tcase $host in\n\t  *cygwin*)\n\t    exeext=.exe\n\t    outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;\n\t  *) exeext= ;;\n\tesac\n\tcase $host in\n\t  *cygwin* | *mingw* )\n\t    cwrappersource=`$echo ${objdir}/lt-${output}.c`\n\t    cwrapper=`$echo ${output}.exe`\n\t    $rm $cwrappersource $cwrapper\n\t    trap \"$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE\" 1 2 15\n\n\t    cat > $cwrappersource <<EOF\n\n/* $cwrappersource - temporary wrapper executable for $objdir/$outputname\n   Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP\n\n   The $output program cannot be directly executed until all the libtool\n   libraries that it depends on are installed.\n\n   This wrapper executable should never be moved out of the build directory.\n   If it is, it will not operate correctly.\n\n   Currently, it simply execs the wrapper *script* \"/bin/sh $output\",\n   but could eventually absorb all of the scripts functionality and\n   exec $objdir/$outputname directly.\n*/\nEOF\n\t    cat >> $cwrappersource<<\"EOF\"\n#include <stdio.h>\n#include <stdlib.h>\n#include <unistd.h>\n#include <malloc.h>\n#include <stdarg.h>\n#include <assert.h>\n\n#if defined(PATH_MAX)\n# define LT_PATHMAX PATH_MAX\n#elif defined(MAXPATHLEN)\n# define LT_PATHMAX MAXPATHLEN\n#else\n# define LT_PATHMAX 1024\n#endif\n\n#ifndef DIR_SEPARATOR\n#define DIR_SEPARATOR '/'\n#endif\n\n#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \\\n  defined (__OS2__)\n#define HAVE_DOS_BASED_FILE_SYSTEM\n#ifndef DIR_SEPARATOR_2\n#define DIR_SEPARATOR_2 '\\\\'\n#endif\n#endif\n\n#ifndef DIR_SEPARATOR_2\n# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)\n#else /* DIR_SEPARATOR_2 */\n# define IS_DIR_SEPARATOR(ch) \\\n        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))\n#endif /* DIR_SEPARATOR_2 */\n\n#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))\n#define XFREE(stale) do { \\\n  if (stale) { free ((void *) stale); stale = 0; } \\\n} while (0)\n\nconst char *program_name = NULL;\n\nvoid * xmalloc (size_t num);\nchar * xstrdup (const char *string);\nchar * basename (const char *name);\nchar * fnqualify(const char *path);\nchar * strendzap(char *str, const char *pat);\nvoid lt_fatal (const char *message, ...);\n\nint\nmain (int argc, char *argv[])\n{\n  char **newargz;\n  int i;\n\n  program_name = (char *) xstrdup ((char *) basename (argv[0]));\n  newargz = XMALLOC(char *, argc+2);\nEOF\n\n\t    cat >> $cwrappersource <<EOF\n  newargz[0] = \"$SHELL\";\nEOF\n\n\t    cat >> $cwrappersource <<\"EOF\"\n  newargz[1] = fnqualify(argv[0]);\n  /* we know the script has the same name, without the .exe */\n  /* so make sure newargz[1] doesn't end in .exe */\n  strendzap(newargz[1],\".exe\");\n  for (i = 1; i < argc; i++)\n    newargz[i+1] = xstrdup(argv[i]);\n  newargz[argc+1] = NULL;\nEOF\n\n\t    cat >> $cwrappersource <<EOF\n  execv(\"$SHELL\",newargz);\nEOF\n\n\t    cat >> $cwrappersource <<\"EOF\"\n}\n\nvoid *\nxmalloc (size_t num)\n{\n  void * p = (void *) malloc (num);\n  if (!p)\n    lt_fatal (\"Memory exhausted\");\n\n  return p;\n}\n\nchar *\nxstrdup (const char *string)\n{\n  return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL\n;\n}\n\nchar *\nbasename (const char *name)\n{\n  const char *base;\n\n#if defined (HAVE_DOS_BASED_FILE_SYSTEM)\n  /* Skip over the disk name in MSDOS pathnames. */\n  if (isalpha (name[0]) && name[1] == ':')\n    name += 2;\n#endif\n\n  for (base = name; *name; name++)\n    if (IS_DIR_SEPARATOR (*name))\n      base = name + 1;\n  return (char *) base;\n}\n\nchar *\nfnqualify(const char *path)\n{\n  size_t size;\n  char *p;\n  char tmp[LT_PATHMAX + 1];\n\n  assert(path != NULL);\n\n  /* Is it qualified already? */\n#if defined (HAVE_DOS_BASED_FILE_SYSTEM)\n  if (isalpha (path[0]) && path[1] == ':')\n    return xstrdup (path);\n#endif\n  if (IS_DIR_SEPARATOR (path[0]))\n    return xstrdup (path);\n\n  /* prepend the current directory */\n  /* doesn't handle '~' */\n  if (getcwd (tmp, LT_PATHMAX) == NULL)\n    lt_fatal (\"getcwd failed\");\n  size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\\0' */\n  p = XMALLOC(char, size);\n  sprintf(p, \"%s%c%s\", tmp, DIR_SEPARATOR, path);\n  return p;\n}\n\nchar *\nstrendzap(char *str, const char *pat)\n{\n  size_t len, patlen;\n\n  assert(str != NULL);\n  assert(pat != NULL);\n\n  len = strlen(str);\n  patlen = strlen(pat);\n\n  if (patlen <= len)\n  {\n    str += len - patlen;\n    if (strcmp(str, pat) == 0)\n      *str = '\\0';\n  }\n  return str;\n}\n\nstatic void\nlt_error_core (int exit_status, const char * mode,\n          const char * message, va_list ap)\n{\n  fprintf (stderr, \"%s: %s: \", program_name, mode);\n  vfprintf (stderr, message, ap);\n  fprintf (stderr, \".\\n\");\n\n  if (exit_status >= 0)\n    exit (exit_status);\n}\n\nvoid\nlt_fatal (const char *message, ...)\n{\n  va_list ap;\n  va_start (ap, message);\n  lt_error_core (EXIT_FAILURE, \"FATAL\", message, ap);\n  va_end (ap);\n}\nEOF\n\t  # we should really use a build-platform specific compiler\n\t  # here, but OTOH, the wrappers (shell script and this C one)\n\t  # are only useful if you want to execute the \"real\" binary.\n\t  # Since the \"real\" binary is built for $host, then this\n\t  # wrapper might as well be built for $host, too.\n\t  $run $LTCC -s -o $cwrapper $cwrappersource\n\t  ;;\n\tesac\n\t$rm $output\n\ttrap \"$rm $output; exit $EXIT_FAILURE\" 1 2 15\n\n\t$echo > $output \"\\\n#! $SHELL\n\n# $output - temporary wrapper script for $objdir/$outputname\n# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP\n#\n# The $output program cannot be directly executed until all the libtool\n# libraries that it depends on are installed.\n#\n# This wrapper script should never be moved out of the build directory.\n# If it is, it will not operate correctly.\n\n# Sed substitution that helps us do robust quoting.  It backslashifies\n# metacharacters that are still active within double-quoted strings.\nXsed='${SED} -e 1s/^X//'\nsed_quote_subst='$sed_quote_subst'\n\n# The HP-UX ksh and POSIX shell print the target directory to stdout\n# if CDPATH is set.\nif test \\\"\\${CDPATH+set}\\\" = set; then CDPATH=:; export CDPATH; fi\n\nrelink_command=\\\"$relink_command\\\"\n\n# This environment variable determines our operation mode.\nif test \\\"\\$libtool_install_magic\\\" = \\\"$magic\\\"; then\n  # install mode needs the following variable:\n  notinst_deplibs='$notinst_deplibs'\nelse\n  # When we are sourced in execute mode, \\$file and \\$echo are already set.\n  if test \\\"\\$libtool_execute_magic\\\" != \\\"$magic\\\"; then\n    echo=\\\"$qecho\\\"\n    file=\\\"\\$0\\\"\n    # Make sure echo works.\n    if test \\\"X\\$1\\\" = X--no-reexec; then\n      # Discard the --no-reexec flag, and continue.\n      shift\n    elif test \\\"X\\`(\\$echo '\\t') 2>/dev/null\\`\\\" = 'X\\t'; then\n      # Yippee, \\$echo works!\n      :\n    else\n      # Restart under the correct shell, and then maybe \\$echo will work.\n      exec $SHELL \\\"\\$0\\\" --no-reexec \\${1+\\\"\\$@\\\"}\n    fi\n  fi\\\n\"\n\t$echo >> $output \"\\\n\n  # Find the directory that this script lives in.\n  thisdir=\\`\\$echo \\\"X\\$file\\\" | \\$Xsed -e 's%/[^/]*$%%'\\`\n  test \\\"x\\$thisdir\\\" = \\\"x\\$file\\\" && thisdir=.\n\n  # Follow symbolic links until we get to the real thisdir.\n  file=\\`ls -ld \\\"\\$file\\\" | ${SED} -n 's/.*-> //p'\\`\n  while test -n \\\"\\$file\\\"; do\n    destdir=\\`\\$echo \\\"X\\$file\\\" | \\$Xsed -e 's%/[^/]*\\$%%'\\`\n\n    # If there was a directory component, then change thisdir.\n    if test \\\"x\\$destdir\\\" != \\\"x\\$file\\\"; then\n      case \\\"\\$destdir\\\" in\n      [\\\\\\\\/]* | [A-Za-z]:[\\\\\\\\/]*) thisdir=\\\"\\$destdir\\\" ;;\n      *) thisdir=\\\"\\$thisdir/\\$destdir\\\" ;;\n      esac\n    fi\n\n    file=\\`\\$echo \\\"X\\$file\\\" | \\$Xsed -e 's%^.*/%%'\\`\n    file=\\`ls -ld \\\"\\$thisdir/\\$file\\\" | ${SED} -n 's/.*-> //p'\\`\n  done\n\n  # Try to get the absolute directory name.\n  absdir=\\`cd \\\"\\$thisdir\\\" && pwd\\`\n  test -n \\\"\\$absdir\\\" && thisdir=\\\"\\$absdir\\\"\n\"\n\n\tif test \"$fast_install\" = yes; then\n\t  $echo >> $output \"\\\n  program=lt-'$outputname'$exeext\n  progdir=\\\"\\$thisdir/$objdir\\\"\n\n  if test ! -f \\\"\\$progdir/\\$program\\\" || \\\\\n     { file=\\`ls -1dt \\\"\\$progdir/\\$program\\\" \\\"\\$progdir/../\\$program\\\" 2>/dev/null | ${SED} 1q\\`; \\\\\n       test \\\"X\\$file\\\" != \\\"X\\$progdir/\\$program\\\"; }; then\n\n    file=\\\"\\$\\$-\\$program\\\"\n\n    if test ! -d \\\"\\$progdir\\\"; then\n      $mkdir \\\"\\$progdir\\\"\n    else\n      $rm \\\"\\$progdir/\\$file\\\"\n    fi\"\n\n\t  $echo >> $output \"\\\n\n    # relink executable if necessary\n    if test -n \\\"\\$relink_command\\\"; then\n      if relink_command_output=\\`eval \\$relink_command 2>&1\\`; then :\n      else\n\t$echo \\\"\\$relink_command_output\\\" >&2\n\t$rm \\\"\\$progdir/\\$file\\\"\n\texit $EXIT_FAILURE\n      fi\n    fi\n\n    $mv \\\"\\$progdir/\\$file\\\" \\\"\\$progdir/\\$program\\\" 2>/dev/null ||\n    { $rm \\\"\\$progdir/\\$program\\\";\n      $mv \\\"\\$progdir/\\$file\\\" \\\"\\$progdir/\\$program\\\"; }\n    $rm \\\"\\$progdir/\\$file\\\"\n  fi\"\n\telse\n\t  $echo >> $output \"\\\n  program='$outputname'\n  progdir=\\\"\\$thisdir/$objdir\\\"\n\"\n\tfi\n\n\t$echo >> $output \"\\\n\n  if test -f \\\"\\$progdir/\\$program\\\"; then\"\n\n\t# Export our shlibpath_var if we have one.\n\tif test \"$shlibpath_overrides_runpath\" = yes && test -n \"$shlibpath_var\" && test -n \"$temp_rpath\"; then\n\t  $echo >> $output \"\\\n    # Add our own library path to $shlibpath_var\n    $shlibpath_var=\\\"$temp_rpath\\$$shlibpath_var\\\"\n\n    # Some systems cannot cope with colon-terminated $shlibpath_var\n    # The second colon is a workaround for a bug in BeOS R4 sed\n    $shlibpath_var=\\`\\$echo \\\"X\\$$shlibpath_var\\\" | \\$Xsed -e 's/::*\\$//'\\`\n\n    export $shlibpath_var\n\"\n\tfi\n\n\t# fixup the dll searchpath if we need to.\n\tif test -n \"$dllsearchpath\"; then\n\t  $echo >> $output \"\\\n    # Add the dll search path components to the executable PATH\n    PATH=$dllsearchpath:\\$PATH\n\"\n\tfi\n\n\t$echo >> $output \"\\\n    if test \\\"\\$libtool_execute_magic\\\" != \\\"$magic\\\"; then\n      # Run the actual program with our arguments.\n\"\n\tcase $host in\n\t# Backslashes separate directories on plain windows\n\t*-*-mingw | *-*-os2*)\n\t  $echo >> $output \"\\\n      exec \\$progdir\\\\\\\\\\$program \\${1+\\\"\\$@\\\"}\n\"\n\t  ;;\n\n\t*)\n\t  $echo >> $output \"\\\n      exec \\$progdir/\\$program \\${1+\\\"\\$@\\\"}\n\"\n\t  ;;\n\tesac\n\t$echo >> $output \"\\\n      \\$echo \\\"\\$0: cannot exec \\$program \\${1+\\\"\\$@\\\"}\\\"\n      exit $EXIT_FAILURE\n    fi\n  else\n    # The program doesn't exist.\n    \\$echo \\\"\\$0: error: \\$progdir/\\$program does not exist\\\" 1>&2\n    \\$echo \\\"This script is just a wrapper for \\$program.\\\" 1>&2\n    $echo \\\"See the $PACKAGE documentation for more information.\\\" 1>&2\n    exit $EXIT_FAILURE\n  fi\nfi\\\n\"\n\tchmod +x $output\n      fi\n      exit $EXIT_SUCCESS\n      ;;\n    esac\n\n    # See if we need to build an old-fashioned archive.\n    for oldlib in $oldlibs; do\n\n      if test \"$build_libtool_libs\" = convenience; then\n\toldobjs=\"$libobjs_save\"\n\taddlibs=\"$convenience\"\n\tbuild_libtool_libs=no\n      else\n\tif test \"$build_libtool_libs\" = module; then\n\t  oldobjs=\"$libobjs_save\"\n\t  build_libtool_libs=no\n\telse\n\t  oldobjs=\"$old_deplibs $non_pic_objects\"\n\tfi\n\taddlibs=\"$old_convenience\"\n      fi\n\n      if test -n \"$addlibs\"; then\n\tgentop=\"$output_objdir/${outputname}x\"\n\t$show \"${rm}r $gentop\"\n\t$run ${rm}r \"$gentop\"\n\t$show \"$mkdir $gentop\"\n\t$run $mkdir \"$gentop\"\n\tstatus=$?\n\tif test \"$status\" -ne 0 && test ! -d \"$gentop\"; then\n\t  exit $status\n\tfi\n\tgenerated=\"$generated $gentop\"\n\n\t# Add in members from convenience archives.\n\tfor xlib in $addlibs; do\n\t  # Extract the objects.\n\t  case $xlib in\n\t  [\\\\/]* | [A-Za-z]:[\\\\/]*) xabs=\"$xlib\" ;;\n\t  *) xabs=`pwd`\"/$xlib\" ;;\n\t  esac\n\t  xlib=`$echo \"X$xlib\" | $Xsed -e 's%^.*/%%'`\n\t  xdir=\"$gentop/$xlib\"\n\n\t  $show \"${rm}r $xdir\"\n\t  $run ${rm}r \"$xdir\"\n\t  $show \"$mkdir $xdir\"\n\t  $run $mkdir \"$xdir\"\n\t  status=$?\n\t  if test \"$status\" -ne 0 && test ! -d \"$xdir\"; then\n\t    exit $status\n\t  fi\n\t  # We will extract separately just the conflicting names and we will no\n\t  # longer touch any unique names. It is faster to leave these extract\n\t  # automatically by $AR in one run.\n\t  $show \"(cd $xdir && $AR x $xabs)\"\n\t  $run eval \"(cd \\$xdir && $AR x \\$xabs)\" || exit $?\n\t  if ($AR t \"$xabs\" | sort | sort -uc >/dev/null 2>&1); then\n\t    :\n\t  else\n\t    $echo \"$modename: warning: object name conflicts; renaming object files\" 1>&2\n\t    $echo \"$modename: warning: to ensure that they will not overwrite\" 1>&2\n\t    $AR t \"$xabs\" | sort | uniq -cd | while read -r count name\n\t    do\n\t      i=1\n\t      while test \"$i\" -le \"$count\"\n\t      do\n\t       # Put our $i before any first dot (extension)\n\t       # Never overwrite any file\n\t       name_to=\"$name\"\n\t       while test \"X$name_to\" = \"X$name\" || test -f \"$xdir/$name_to\"\n\t       do\n\t\t name_to=`$echo \"X$name_to\" | $Xsed -e \"s/\\([^.]*\\)/\\1-$i/\"`\n\t       done\n\t       $show \"(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')\"\n\t       $run eval \"(cd \\$xdir && $AR xN $i \\$xabs '$name' && $mv '$name' '$name_to')\" || exit $?\n\t       i=`expr $i + 1`\n\t      done\n\t    done\n\t  fi\n\n\t  oldobjs=\"$oldobjs \"`find $xdir -name \\*.${objext} -print -o -name \\*.lo -print | $NL2SP`\n\tdone\n      fi\n\n      # Do each command in the archive commands.\n      if test -n \"$old_archive_from_new_cmds\" && test \"$build_libtool_libs\" = yes; then\n       cmds=$old_archive_from_new_cmds\n      else\n\teval cmds=\\\"$old_archive_cmds\\\"\n\n\tif len=`expr \"X$cmds\" : \".*\"` &&\n\t     test \"$len\" -le \"$max_cmd_len\" || test \"$max_cmd_len\" -le -1; then\n\t  cmds=$old_archive_cmds\n\telse\n\t  # the command line is too long to link in one step, link in parts\n\t  $echo \"using piecewise archive linking...\"\n\t  save_RANLIB=$RANLIB\n\t  RANLIB=:\n\t  objlist=\n\t  concat_cmds=\n\t  save_oldobjs=$oldobjs\n\t  # GNU ar 2.10+ was changed to match POSIX; thus no paths are\n\t  # encoded into archives.  This makes 'ar r' malfunction in\n\t  # this piecewise linking case whenever conflicting object\n\t  # names appear in distinct ar calls; check, warn and compensate.\n\t    if (for obj in $save_oldobjs\n\t    do\n\t      $echo \"X$obj\" | $Xsed -e 's%^.*/%%'\n\t    done | sort | sort -uc >/dev/null 2>&1); then\n\t    :\n\t  else\n\t    $echo \"$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'\" 1>&2\n\t    $echo \"$modename: warning: to ensure that POSIX-compatible ar will work\" 1>&2\n\t    AR_FLAGS=cq\n\t  fi\n\t  # Is there a better way of finding the last object in the list?\n\t  for obj in $save_oldobjs\n\t  do\n\t    last_oldobj=$obj\n\t  done\n\t  for obj in $save_oldobjs\n\t  do\n\t    oldobjs=\"$objlist $obj\"\n\t    objlist=\"$objlist $obj\"\n\t    eval test_cmds=\\\"$old_archive_cmds\\\"\n\t    if len=`expr \"X$test_cmds\" : \".*\"` &&\n\t       test \"$len\" -le \"$max_cmd_len\"; then\n\t      :\n\t    else\n\t      # the above command should be used before it gets too long\n\t      oldobjs=$objlist\n\t      if test \"$obj\" = \"$last_oldobj\" ; then\n\t        RANLIB=$save_RANLIB\n\t      fi\n\t      test -z \"$concat_cmds\" || concat_cmds=$concat_cmds~\n\t      eval concat_cmds=\\\"\\${concat_cmds}$old_archive_cmds\\\"\n\t      objlist=\n\t    fi\n\t  done\n\t  RANLIB=$save_RANLIB\n\t  oldobjs=$objlist\n\t  if test \"X$oldobjs\" = \"X\" ; then\n\t    eval cmds=\\\"\\$concat_cmds\\\"\n\t  else\n\t    eval cmds=\\\"\\$concat_cmds~\\$old_archive_cmds\\\"\n\t  fi\n\tfi\n      fi\n      save_ifs=\"$IFS\"; IFS='~'\n      for cmd in $cmds; do\n        eval cmd=\\\"$cmd\\\"\n\tIFS=\"$save_ifs\"\n\t$show \"$cmd\"\n\t$run eval \"$cmd\" || exit $?\n      done\n      IFS=\"$save_ifs\"\n    done\n\n    if test -n \"$generated\"; then\n      $show \"${rm}r$generated\"\n      $run ${rm}r$generated\n    fi\n\n    # Now create the libtool archive.\n    case $output in\n    *.la)\n      old_library=\n      test \"$build_old_libs\" = yes && old_library=\"$libname.$libext\"\n      $show \"creating $output\"\n\n      # Preserve any variables that may affect compiler behavior\n      for var in $variables_saved_for_relink; do\n\tif eval test -z \\\"\\${$var+set}\\\"; then\n\t  relink_command=\"{ test -z \\\"\\${$var+set}\\\" || unset $var || { $var=; export $var; }; }; $relink_command\"\n\telif eval var_value=\\$$var; test -z \"$var_value\"; then\n\t  relink_command=\"$var=; export $var; $relink_command\"\n\telse\n\t  var_value=`$echo \"X$var_value\" | $Xsed -e \"$sed_quote_subst\"`\n\t  relink_command=\"$var=\\\"$var_value\\\"; export $var; $relink_command\"\n\tfi\n      done\n      # Quote the link command for shipping.\n      relink_command=\"(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)\"\n      relink_command=`$echo \"X$relink_command\" | $Xsed -e \"$sed_quote_subst\"`\n      if test \"$hardcode_automatic\" = yes ; then\n\trelink_command=\n      fi\n\n\n      # Only create the output if not a dry run.\n      if test -z \"$run\"; then\n\tfor installed in no yes; do\n\t  if test \"$installed\" = yes; then\n\t    if test -z \"$install_libdir\"; then\n\t      break\n\t    fi\n\t    output=\"$output_objdir/$outputname\"i\n\t    # Replace all uninstalled libtool libraries with the installed ones\n\t    newdependency_libs=\n\t    for deplib in $dependency_libs; do\n\t      case $deplib in\n\t      *.la)\n\t\tname=`$echo \"X$deplib\" | $Xsed -e 's%^.*/%%'`\n\t\teval libdir=`${SED} -n -e 's/^libdir=\\(.*\\)$/\\1/p' $deplib`\n\t\tif test -z \"$libdir\"; then\n\t\t  $echo \"$modename: \\`$deplib' is not a valid libtool archive\" 1>&2\n\t\t  exit $EXIT_FAILURE\n\t\tfi\n\t\tnewdependency_libs=\"$newdependency_libs $libdir/$name\"\n\t\t;;\n\t      *) newdependency_libs=\"$newdependency_libs $deplib\" ;;\n\t      esac\n\t    done\n\t    dependency_libs=\"$newdependency_libs\"\n\t    newdlfiles=\n\t    for lib in $dlfiles; do\n\t      name=`$echo \"X$lib\" | $Xsed -e 's%^.*/%%'`\n\t      eval libdir=`${SED} -n -e 's/^libdir=\\(.*\\)$/\\1/p' $lib`\n\t      if test -z \"$libdir\"; then\n\t\t$echo \"$modename: \\`$lib' is not a valid libtool archive\" 1>&2\n\t\texit $EXIT_FAILURE\n\t      fi\n\t      newdlfiles=\"$newdlfiles $libdir/$name\"\n\t    done\n\t    dlfiles=\"$newdlfiles\"\n\t    newdlprefiles=\n\t    for lib in $dlprefiles; do\n\t      name=`$echo \"X$lib\" | $Xsed -e 's%^.*/%%'`\n\t      eval libdir=`${SED} -n -e 's/^libdir=\\(.*\\)$/\\1/p' $lib`\n\t      if test -z \"$libdir\"; then\n\t\t$echo \"$modename: \\`$lib' is not a valid libtool archive\" 1>&2\n\t\texit $EXIT_FAILURE\n\t      fi\n\t      newdlprefiles=\"$newdlprefiles $libdir/$name\"\n\t    done\n\t    dlprefiles=\"$newdlprefiles\"\n\t  else\n\t    newdlfiles=\n\t    for lib in $dlfiles; do\n\t      case $lib in\n\t\t[\\\\/]* | [A-Za-z]:[\\\\/]*) abs=\"$lib\" ;;\n\t\t*) abs=`pwd`\"/$lib\" ;;\n\t      esac\n\t      newdlfiles=\"$newdlfiles $abs\"\n\t    done\n\t    dlfiles=\"$newdlfiles\"\n\t    newdlprefiles=\n\t    for lib in $dlprefiles; do\n\t      case $lib in\n\t\t[\\\\/]* | [A-Za-z]:[\\\\/]*) abs=\"$lib\" ;;\n\t\t*) abs=`pwd`\"/$lib\" ;;\n\t      esac\n\t      newdlprefiles=\"$newdlprefiles $abs\"\n\t    done\n\t    dlprefiles=\"$newdlprefiles\"\n\t  fi\n\t  $rm $output\n\t  # place dlname in correct position for cygwin\n\t  tdlname=$dlname\n\t  case $host,$output,$installed,$module,$dlname in\n\t    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;\n\t  esac\n\t  $echo > $output \"\\\n# $outputname - a libtool library file\n# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP\n#\n# Please DO NOT delete this file!\n# It is necessary for linking the library.\n\n# The name that we can dlopen(3).\ndlname='$tdlname'\n\n# Names of this library.\nlibrary_names='$library_names'\n\n# The name of the static archive.\nold_library='$old_library'\n\n# Libraries that this one depends upon.\ndependency_libs='$dependency_libs'\n\n# Version information for $libname.\ncurrent=$current\nage=$age\nrevision=$revision\n\n# Is this an already installed library?\ninstalled=$installed\n\n# Should we warn about portability when linking against -modules?\nshouldnotlink=$module\n\n# Files to dlopen/dlpreopen\ndlopen='$dlfiles'\ndlpreopen='$dlprefiles'\n\n# Directory that this library needs to be installed in:\nlibdir='$install_libdir'\"\n\t  if test \"$installed\" = no && test \"$need_relink\" = yes; then\n\t    $echo >> $output \"\\\nrelink_command=\\\"$relink_command\\\"\"\n\t  fi\n\tdone\n      fi\n\n      # Do a symbolic link so that the libtool archive can be found in\n      # LD_LIBRARY_PATH before the program is installed.\n      $show \"(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)\"\n      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?\n      ;;\n    esac\n    exit $EXIT_SUCCESS\n    ;;\n\n  # libtool install mode\n  install)\n    modename=\"$modename: install\"\n\n    # There may be an optional sh(1) argument at the beginning of\n    # install_prog (especially on Windows NT).\n    if test \"$nonopt\" = \"$SHELL\" || test \"$nonopt\" = /bin/sh ||\n       # Allow the use of GNU shtool's install command.\n       $echo \"X$nonopt\" | $Xsed | grep shtool > /dev/null; then\n      # Aesthetically quote it.\n      arg=`$echo \"X$nonopt\" | $Xsed -e \"$sed_quote_subst\"`\n      case $arg in\n      *[\\[\\~\\#\\^\\&\\*\\(\\)\\{\\}\\|\\;\\<\\>\\?\\'\\ \\\t]*|*]*)\n\targ=\"\\\"$arg\\\"\"\n\t;;\n      esac\n      install_prog=\"$arg \"\n      arg=\"$1\"\n      shift\n    else\n      install_prog=\n      arg=\"$nonopt\"\n    fi\n\n    # The real first argument should be the name of the installation program.\n    # Aesthetically quote it.\n    arg=`$echo \"X$arg\" | $Xsed -e \"$sed_quote_subst\"`\n    case $arg in\n    *[\\[\\~\\#\\^\\&\\*\\(\\)\\{\\}\\|\\;\\<\\>\\?\\'\\ \\\t]*|*]*)\n      arg=\"\\\"$arg\\\"\"\n      ;;\n    esac\n    install_prog=\"$install_prog$arg\"\n\n    # We need to accept at least all the BSD install flags.\n    dest=\n    files=\n    opts=\n    prev=\n    install_type=\n    isdir=no\n    stripme=\n    for arg\n    do\n      if test -n \"$dest\"; then\n\tfiles=\"$files $dest\"\n\tdest=\"$arg\"\n\tcontinue\n      fi\n\n      case $arg in\n      -d) isdir=yes ;;\n      -f) prev=\"-f\" ;;\n      -g) prev=\"-g\" ;;\n      -m) prev=\"-m\" ;;\n      -o) prev=\"-o\" ;;\n      -s)\n\tstripme=\" -s\"\n\tcontinue\n\t;;\n      -*) ;;\n\n      *)\n\t# If the previous option needed an argument, then skip it.\n\tif test -n \"$prev\"; then\n\t  prev=\n\telse\n\t  dest=\"$arg\"\n\t  continue\n\tfi\n\t;;\n      esac\n\n      # Aesthetically quote the argument.\n      arg=`$echo \"X$arg\" | $Xsed -e \"$sed_quote_subst\"`\n      case $arg in\n      *[\\[\\~\\#\\^\\&\\*\\(\\)\\{\\}\\|\\;\\<\\>\\?\\'\\ \\\t]*|*]*)\n\targ=\"\\\"$arg\\\"\"\n\t;;\n      esac\n      install_prog=\"$install_prog $arg\"\n    done\n\n    if test -z \"$install_prog\"; then\n      $echo \"$modename: you must specify an install program\" 1>&2\n      $echo \"$help\" 1>&2\n      exit $EXIT_FAILURE\n    fi\n\n    if test -n \"$prev\"; then\n      $echo \"$modename: the \\`$prev' option requires an argument\" 1>&2\n      $echo \"$help\" 1>&2\n      exit $EXIT_FAILURE\n    fi\n\n    if test -z \"$files\"; then\n      if test -z \"$dest\"; then\n\t$echo \"$modename: no file or destination specified\" 1>&2\n      else\n\t$echo \"$modename: you must specify a destination\" 1>&2\n      fi\n      $echo \"$help\" 1>&2\n      exit $EXIT_FAILURE\n    fi\n\n    # Strip any trailing slash from the destination.\n    dest=`$echo \"X$dest\" | $Xsed -e 's%/$%%'`\n\n    # Check to see that the destination is a directory.\n    test -d \"$dest\" && isdir=yes\n    if test \"$isdir\" = yes; then\n      destdir=\"$dest\"\n      destname=\n    else\n      destdir=`$echo \"X$dest\" | $Xsed -e 's%/[^/]*$%%'`\n      test \"X$destdir\" = \"X$dest\" && destdir=.\n      destname=`$echo \"X$dest\" | $Xsed -e 's%^.*/%%'`\n\n      # Not a directory, so check to see that there is only one file specified.\n      set dummy $files\n      if test \"$#\" -gt 2; then\n\t$echo \"$modename: \\`$dest' is not a directory\" 1>&2\n\t$echo \"$help\" 1>&2\n\texit $EXIT_FAILURE\n      fi\n    fi\n    case $destdir in\n    [\\\\/]* | [A-Za-z]:[\\\\/]*) ;;\n    *)\n      for file in $files; do\n\tcase $file in\n\t*.lo) ;;\n\t*)\n\t  $echo \"$modename: \\`$destdir' must be an absolute directory name\" 1>&2\n\t  $echo \"$help\" 1>&2\n\t  exit $EXIT_FAILURE\n\t  ;;\n\tesac\n      done\n      ;;\n    esac\n\n    # This variable tells wrapper scripts just to set variables rather\n    # than running their programs.\n    libtool_install_magic=\"$magic\"\n\n    staticlibs=\n    future_libdirs=\n    current_libdirs=\n    for file in $files; do\n\n      # Do each installation.\n      case $file in\n      *.$libext)\n\t# Do the static libraries later.\n\tstaticlibs=\"$staticlibs $file\"\n\t;;\n\n      *.la)\n\t# Check to see that this really is a libtool archive.\n\tif (${SED} -e '2q' $file | grep \"^# Generated by .*$PACKAGE\") >/dev/null 2>&1; then :\n\telse\n\t  $echo \"$modename: \\`$file' is not a valid libtool archive\" 1>&2\n\t  $echo \"$help\" 1>&2\n\t  exit $EXIT_FAILURE\n\tfi\n\n\tlibrary_names=\n\told_library=\n\trelink_command=\n\t# If there is no directory component, then add one.\n\tcase $file in\n\t*/* | *\\\\*) . $file ;;\n\t*) . ./$file ;;\n\tesac\n\n\t# Add the libdir to current_libdirs if it is the destination.\n\tif test \"X$destdir\" = \"X$libdir\"; then\n\t  case \"$current_libdirs \" in\n\t  *\" $libdir \"*) ;;\n\t  *) current_libdirs=\"$current_libdirs $libdir\" ;;\n\t  esac\n\telse\n\t  # Note the libdir as a future libdir.\n\t  case \"$future_libdirs \" in\n\t  *\" $libdir \"*) ;;\n\t  *) future_libdirs=\"$future_libdirs $libdir\" ;;\n\t  esac\n\tfi\n\n\tdir=`$echo \"X$file\" | $Xsed -e 's%/[^/]*$%%'`/\n\ttest \"X$dir\" = \"X$file/\" && dir=\n\tdir=\"$dir$objdir\"\n\n\tif test -n \"$relink_command\"; then\n\t  # Determine the prefix the user has applied to our future dir.\n\t  inst_prefix_dir=`$echo \"$destdir\" | $SED \"s%$libdir\\$%%\"`\n\n\t  # Don't allow the user to place us outside of our expected\n\t  # location b/c this prevents finding dependent libraries that\n\t  # are installed to the same prefix.\n\t  # At present, this check doesn't affect windows .dll's that\n\t  # are installed into $libdir/../bin (currently, that works fine)\n\t  # but it's something to keep an eye on.\n\t  if test \"$inst_prefix_dir\" = \"$destdir\"; then\n\t    $echo \"$modename: error: cannot install \\`$file' to a directory not ending in $libdir\" 1>&2\n\t    exit $EXIT_FAILURE\n\t  fi\n\n\t  if test -n \"$inst_prefix_dir\"; then\n\t    # Stick the inst_prefix_dir data into the link command.\n\t    relink_command=`$echo \"$relink_command\" | $SED \"s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%\"`\n\t  else\n\t    relink_command=`$echo \"$relink_command\" | $SED \"s%@inst_prefix_dir@%%\"`\n\t  fi\n\n\t  $echo \"$modename: warning: relinking \\`$file'\" 1>&2\n\t  $show \"$relink_command\"\n\t  if $run eval \"$relink_command\"; then :\n\t  else\n\t    $echo \"$modename: error: relink \\`$file' with the above command before installing it\" 1>&2\n\t    exit $EXIT_FAILURE\n\t  fi\n\tfi\n\n\t# See the names of the shared library.\n\tset dummy $library_names\n\tif test -n \"$2\"; then\n\t  realname=\"$2\"\n\t  shift\n\t  shift\n\n\t  srcname=\"$realname\"\n\t  test -n \"$relink_command\" && srcname=\"$realname\"T\n\n\t  # Install the shared library and build the symlinks.\n\t  $show \"$install_prog $dir/$srcname $destdir/$realname\"\n\t  $run eval \"$install_prog $dir/$srcname $destdir/$realname\" || exit $?\n\t  if test -n \"$stripme\" && test -n \"$striplib\"; then\n\t    $show \"$striplib $destdir/$realname\"\n\t    $run eval \"$striplib $destdir/$realname\" || exit $?\n\t  fi\n\n\t  if test \"$#\" -gt 0; then\n\t    # Delete the old symlinks, and create new ones.\n\t    for linkname\n\t    do\n\t      if test \"$linkname\" != \"$realname\"; then\n\t\t$show \"(cd $destdir && $rm $linkname && $LN_S $realname $linkname)\"\n\t\t$run eval \"(cd $destdir && $rm $linkname && $LN_S $realname $linkname)\"\n\t      fi\n\t    done\n\t  fi\n\n\t  # Do each command in the postinstall commands.\n\t  lib=\"$destdir/$realname\"\n\t  cmds=$postinstall_cmds\n\t  save_ifs=\"$IFS\"; IFS='~'\n\t  for cmd in $cmds; do\n\t    IFS=\"$save_ifs\"\n\t    eval cmd=\\\"$cmd\\\"\n\t    $show \"$cmd\"\n\t    $run eval \"$cmd\" || exit $?\n\t  done\n\t  IFS=\"$save_ifs\"\n\tfi\n\n\t# Install the pseudo-library for information purposes.\n\tname=`$echo \"X$file\" | $Xsed -e 's%^.*/%%'`\n\tinstname=\"$dir/$name\"i\n\t$show \"$install_prog $instname $destdir/$name\"\n\t$run eval \"$install_prog $instname $destdir/$name\" || exit $?\n\n\t# Maybe install the static library, too.\n\ttest -n \"$old_library\" && staticlibs=\"$staticlibs $dir/$old_library\"\n\t;;\n\n      *.lo)\n\t# Install (i.e. copy) a libtool object.\n\n\t# Figure out destination file name, if it wasn't already specified.\n\tif test -n \"$destname\"; then\n\t  destfile=\"$destdir/$destname\"\n\telse\n\t  destfile=`$echo \"X$file\" | $Xsed -e 's%^.*/%%'`\n\t  destfile=\"$destdir/$destfile\"\n\tfi\n\n\t# Deduce the name of the destination old-style object file.\n\tcase $destfile in\n\t*.lo)\n\t  staticdest=`$echo \"X$destfile\" | $Xsed -e \"$lo2o\"`\n\t  ;;\n\t*.$objext)\n\t  staticdest=\"$destfile\"\n\t  destfile=\n\t  ;;\n\t*)\n\t  $echo \"$modename: cannot copy a libtool object to \\`$destfile'\" 1>&2\n\t  $echo \"$help\" 1>&2\n\t  exit $EXIT_FAILURE\n\t  ;;\n\tesac\n\n\t# Install the libtool object if requested.\n\tif test -n \"$destfile\"; then\n\t  $show \"$install_prog $file $destfile\"\n\t  $run eval \"$install_prog $file $destfile\" || exit $?\n\tfi\n\n\t# Install the old object if enabled.\n\tif test \"$build_old_libs\" = yes; then\n\t  # Deduce the name of the old-style object file.\n\t  staticobj=`$echo \"X$file\" | $Xsed -e \"$lo2o\"`\n\n\t  $show \"$install_prog $staticobj $staticdest\"\n\t  $run eval \"$install_prog \\$staticobj \\$staticdest\" || exit $?\n\tfi\n\texit $EXIT_SUCCESS\n\t;;\n\n      *)\n\t# Figure out destination file name, if it wasn't already specified.\n\tif test -n \"$destname\"; then\n\t  destfile=\"$destdir/$destname\"\n\telse\n\t  destfile=`$echo \"X$file\" | $Xsed -e 's%^.*/%%'`\n\t  destfile=\"$destdir/$destfile\"\n\tfi\n\n\t# If the file is missing, and there is a .exe on the end, strip it\n\t# because it is most likely a libtool script we actually want to\n\t# install\n\tstripped_ext=\"\"\n\tcase $file in\n\t  *.exe)\n\t    if test ! -f \"$file\"; then\n\t      file=`$echo $file|${SED} 's,.exe$,,'`\n\t      stripped_ext=\".exe\"\n\t    fi\n\t    ;;\n\tesac\n\n\t# Do a test to see if this is really a libtool program.\n\tcase $host in\n\t*cygwin*|*mingw*)\n\t    wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`\n\t    ;;\n\t*)\n\t    wrapper=$file\n\t    ;;\n\tesac\n\tif (${SED} -e '4q' $wrapper | grep \"^# Generated by .*$PACKAGE\")>/dev/null 2>&1; then\n\t  notinst_deplibs=\n\t  relink_command=\n\n\t  # To insure that \"foo\" is sourced, and not \"foo.exe\",\n\t  # finese the cygwin/MSYS system by explicitly sourcing \"foo.\"\n\t  # which disallows the automatic-append-.exe behavior.\n\t  case $build in\n\t  *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;\n\t  *) wrapperdot=${wrapper} ;;\n\t  esac\n\t  # If there is no directory component, then add one.\n\t  case $file in\n\t  */* | *\\\\*) . ${wrapperdot} ;;\n\t  *) . ./${wrapperdot} ;;\n\t  esac\n\n\t  # Check the variables that should have been set.\n\t  if test -z \"$notinst_deplibs\"; then\n\t    $echo \"$modename: invalid libtool wrapper script \\`$wrapper'\" 1>&2\n\t    exit $EXIT_FAILURE\n\t  fi\n\n\t  finalize=yes\n\t  for lib in $notinst_deplibs; do\n\t    # Check to see that each library is installed.\n\t    libdir=\n\t    if test -f \"$lib\"; then\n\t      # If there is no directory component, then add one.\n\t      case $lib in\n\t      */* | *\\\\*) . $lib ;;\n\t      *) . ./$lib ;;\n\t      esac\n\t    fi\n\t    libfile=\"$libdir/\"`$echo \"X$lib\" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test\n\t    if test -n \"$libdir\" && test ! -f \"$libfile\"; then\n\t      $echo \"$modename: warning: \\`$lib' has not been installed in \\`$libdir'\" 1>&2\n\t      finalize=no\n\t    fi\n\t  done\n\n\t  relink_command=\n\t  # To insure that \"foo\" is sourced, and not \"foo.exe\",\n\t  # finese the cygwin/MSYS system by explicitly sourcing \"foo.\"\n\t  # which disallows the automatic-append-.exe behavior.\n\t  case $build in\n\t  *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;\n\t  *) wrapperdot=${wrapper} ;;\n\t  esac\n\t  # If there is no directory component, then add one.\n\t  case $file in\n\t  */* | *\\\\*) . ${wrapperdot} ;;\n\t  *) . ./${wrapperdot} ;;\n\t  esac\n\n\t  outputname=\n\t  if test \"$fast_install\" = no && test -n \"$relink_command\"; then\n\t    if test \"$finalize\" = yes && test -z \"$run\"; then\n\t      tmpdir=\"/tmp\"\n\t      test -n \"$TMPDIR\" && tmpdir=\"$TMPDIR\"\n\t      tmpdir=\"$tmpdir/libtool-$$\"\n\t      save_umask=`umask`\n\t      umask 0077\n\t      if $mkdir \"$tmpdir\"; then\n\t        umask $save_umask\n\t      else\n\t        umask $save_umask\n\t\t$echo \"$modename: error: cannot create temporary directory \\`$tmpdir'\" 1>&2\n\t\tcontinue\n\t      fi\n\t      file=`$echo \"X$file$stripped_ext\" | $Xsed -e 's%^.*/%%'`\n\t      outputname=\"$tmpdir/$file\"\n\t      # Replace the output file specification.\n\t      relink_command=`$echo \"X$relink_command\" | $Xsed -e 's%@OUTPUT@%'\"$outputname\"'%g'`\n\n\t      $show \"$relink_command\"\n\t      if $run eval \"$relink_command\"; then :\n\t      else\n\t\t$echo \"$modename: error: relink \\`$file' with the above command before installing it\" 1>&2\n\t\t${rm}r \"$tmpdir\"\n\t\tcontinue\n\t      fi\n\t      file=\"$outputname\"\n\t    else\n\t      $echo \"$modename: warning: cannot relink \\`$file'\" 1>&2\n\t    fi\n\t  else\n\t    # Install the binary that we compiled earlier.\n\t    file=`$echo \"X$file$stripped_ext\" | $Xsed -e \"s%\\([^/]*\\)$%$objdir/\\1%\"`\n\t  fi\n\tfi\n\n\t# remove .exe since cygwin /usr/bin/install will append another\n\t# one anyways\n\tcase $install_prog,$host in\n\t*/usr/bin/install*,*cygwin*)\n\t  case $file:$destfile in\n\t  *.exe:*.exe)\n\t    # this is ok\n\t    ;;\n\t  *.exe:*)\n\t    destfile=$destfile.exe\n\t    ;;\n\t  *:*.exe)\n\t    destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`\n\t    ;;\n\t  esac\n\t  ;;\n\tesac\n\t$show \"$install_prog$stripme $file $destfile\"\n\t$run eval \"$install_prog\\$stripme \\$file \\$destfile\" || exit $?\n\ttest -n \"$outputname\" && ${rm}r \"$tmpdir\"\n\t;;\n      esac\n    done\n\n    for file in $staticlibs; do\n      name=`$echo \"X$file\" | $Xsed -e 's%^.*/%%'`\n\n      # Set up the ranlib parameters.\n      oldlib=\"$destdir/$name\"\n\n      $show \"$install_prog $file $oldlib\"\n      $run eval \"$install_prog \\$file \\$oldlib\" || exit $?\n\n      if test -n \"$stripme\" && test -n \"$old_striplib\"; then\n\t$show \"$old_striplib $oldlib\"\n\t$run eval \"$old_striplib $oldlib\" || exit $?\n      fi\n\n      # Do each command in the postinstall commands.\n      cmds=$old_postinstall_cmds\n      save_ifs=\"$IFS\"; IFS='~'\n      for cmd in $cmds; do\n\tIFS=\"$save_ifs\"\n\teval cmd=\\\"$cmd\\\"\n\t$show \"$cmd\"\n\t$run eval \"$cmd\" || exit $?\n      done\n      IFS=\"$save_ifs\"\n    done\n\n    if test -n \"$future_libdirs\"; then\n      $echo \"$modename: warning: remember to run \\`$progname --finish$future_libdirs'\" 1>&2\n    fi\n\n    if test -n \"$current_libdirs\"; then\n      # Maybe just do a dry run.\n      test -n \"$run\" && current_libdirs=\" -n$current_libdirs\"\n      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'\n    else\n      exit $EXIT_SUCCESS\n    fi\n    ;;\n\n  # libtool finish mode\n  finish)\n    modename=\"$modename: finish\"\n    libdirs=\"$nonopt\"\n    admincmds=\n\n    if test -n \"$finish_cmds$finish_eval\" && test -n \"$libdirs\"; then\n      for dir\n      do\n\tlibdirs=\"$libdirs $dir\"\n      done\n\n      for libdir in $libdirs; do\n\tif test -n \"$finish_cmds\"; then\n\t  # Do each command in the finish commands.\n\t  cmds=$finish_cmds\n\t  save_ifs=\"$IFS\"; IFS='~'\n\t  for cmd in $cmds; do\n\t    IFS=\"$save_ifs\"\n\t    eval cmd=\\\"$cmd\\\"\n\t    $show \"$cmd\"\n\t    $run eval \"$cmd\" || admincmds=\"$admincmds\n       $cmd\"\n\t  done\n\t  IFS=\"$save_ifs\"\n\tfi\n\tif test -n \"$finish_eval\"; then\n\t  # Do the single finish_eval.\n\t  eval cmds=\\\"$finish_eval\\\"\n\t  $run eval \"$cmds\" || admincmds=\"$admincmds\n       $cmds\"\n\tfi\n      done\n    fi\n\n    # Exit here if they wanted silent mode.\n    test \"$show\" = : && exit $EXIT_SUCCESS\n\n    $echo \"----------------------------------------------------------------------\"\n    $echo \"Libraries have been installed in:\"\n    for libdir in $libdirs; do\n      $echo \"   $libdir\"\n    done\n    $echo\n    $echo \"If you ever happen to want to link against installed libraries\"\n    $echo \"in a given directory, LIBDIR, you must either use libtool, and\"\n    $echo \"specify the full pathname of the library, or use the \\`-LLIBDIR'\"\n    $echo \"flag during linking and do at least one of the following:\"\n    if test -n \"$shlibpath_var\"; then\n      $echo \"   - add LIBDIR to the \\`$shlibpath_var' environment variable\"\n      $echo \"     during execution\"\n    fi\n    if test -n \"$runpath_var\"; then\n      $echo \"   - add LIBDIR to the \\`$runpath_var' environment variable\"\n      $echo \"     during linking\"\n    fi\n    if test -n \"$hardcode_libdir_flag_spec\"; then\n      libdir=LIBDIR\n      eval flag=\\\"$hardcode_libdir_flag_spec\\\"\n\n      $echo \"   - use the \\`$flag' linker flag\"\n    fi\n    if test -n \"$admincmds\"; then\n      $echo \"   - have your system administrator run these commands:$admincmds\"\n    fi\n    if test -f /etc/ld.so.conf; then\n      $echo \"   - have your system administrator add LIBDIR to \\`/etc/ld.so.conf'\"\n    fi\n    $echo\n    $echo \"See any operating system documentation about shared libraries for\"\n    $echo \"more information, such as the ld(1) and ld.so(8) manual pages.\"\n    $echo \"----------------------------------------------------------------------\"\n    exit $EXIT_SUCCESS\n    ;;\n\n  # libtool execute mode\n  execute)\n    modename=\"$modename: execute\"\n\n    # The first argument is the command name.\n    cmd=\"$nonopt\"\n    if test -z \"$cmd\"; then\n      $echo \"$modename: you must specify a COMMAND\" 1>&2\n      $echo \"$help\"\n      exit $EXIT_FAILURE\n    fi\n\n    # Handle -dlopen flags immediately.\n    for file in $execute_dlfiles; do\n      if test ! -f \"$file\"; then\n\t$echo \"$modename: \\`$file' is not a file\" 1>&2\n\t$echo \"$help\" 1>&2\n\texit $EXIT_FAILURE\n      fi\n\n      dir=\n      case $file in\n      *.la)\n\t# Check to see that this really is a libtool archive.\n\tif (${SED} -e '2q' $file | grep \"^# Generated by .*$PACKAGE\") >/dev/null 2>&1; then :\n\telse\n\t  $echo \"$modename: \\`$lib' is not a valid libtool archive\" 1>&2\n\t  $echo \"$help\" 1>&2\n\t  exit $EXIT_FAILURE\n\tfi\n\n\t# Read the libtool library.\n\tdlname=\n\tlibrary_names=\n\n\t# If there is no directory component, then add one.\n\tcase $file in\n\t*/* | *\\\\*) . $file ;;\n\t*) . ./$file ;;\n\tesac\n\n\t# Skip this library if it cannot be dlopened.\n\tif test -z \"$dlname\"; then\n\t  # Warn if it was a shared library.\n\t  test -n \"$library_names\" && $echo \"$modename: warning: \\`$file' was not linked with \\`-export-dynamic'\"\n\t  continue\n\tfi\n\n\tdir=`$echo \"X$file\" | $Xsed -e 's%/[^/]*$%%'`\n\ttest \"X$dir\" = \"X$file\" && dir=.\n\n\tif test -f \"$dir/$objdir/$dlname\"; then\n\t  dir=\"$dir/$objdir\"\n\telse\n\t  $echo \"$modename: cannot find \\`$dlname' in \\`$dir' or \\`$dir/$objdir'\" 1>&2\n\t  exit $EXIT_FAILURE\n\tfi\n\t;;\n\n      *.lo)\n\t# Just add the directory containing the .lo file.\n\tdir=`$echo \"X$file\" | $Xsed -e 's%/[^/]*$%%'`\n\ttest \"X$dir\" = \"X$file\" && dir=.\n\t;;\n\n      *)\n\t$echo \"$modename: warning \\`-dlopen' is ignored for non-libtool libraries and objects\" 1>&2\n\tcontinue\n\t;;\n      esac\n\n      # Get the absolute pathname.\n      absdir=`cd \"$dir\" && pwd`\n      test -n \"$absdir\" && dir=\"$absdir\"\n\n      # Now add the directory to shlibpath_var.\n      if eval \"test -z \\\"\\$$shlibpath_var\\\"\"; then\n\teval \"$shlibpath_var=\\\"\\$dir\\\"\"\n      else\n\teval \"$shlibpath_var=\\\"\\$dir:\\$$shlibpath_var\\\"\"\n      fi\n    done\n\n    # This variable tells wrapper scripts just to set shlibpath_var\n    # rather than running their programs.\n    libtool_execute_magic=\"$magic\"\n\n    # Check if any of the arguments is a wrapper script.\n    args=\n    for file\n    do\n      case $file in\n      -*) ;;\n      *)\n\t# Do a test to see if this is really a libtool program.\n\tif (${SED} -e '4q' $file | grep \"^# Generated by .*$PACKAGE\") >/dev/null 2>&1; then\n\t  # If there is no directory component, then add one.\n\t  case $file in\n\t  */* | *\\\\*) . $file ;;\n\t  *) . ./$file ;;\n\t  esac\n\n\t  # Transform arg to wrapped name.\n\t  file=\"$progdir/$program\"\n\tfi\n\t;;\n      esac\n      # Quote arguments (to preserve shell metacharacters).\n      file=`$echo \"X$file\" | $Xsed -e \"$sed_quote_subst\"`\n      args=\"$args \\\"$file\\\"\"\n    done\n\n    if test -z \"$run\"; then\n      if test -n \"$shlibpath_var\"; then\n\t# Export the shlibpath_var.\n\teval \"export $shlibpath_var\"\n      fi\n\n      # Restore saved environment variables\n      if test \"${save_LC_ALL+set}\" = set; then\n\tLC_ALL=\"$save_LC_ALL\"; export LC_ALL\n      fi\n      if test \"${save_LANG+set}\" = set; then\n\tLANG=\"$save_LANG\"; export LANG\n      fi\n\n      # Now prepare to actually exec the command.\n      exec_cmd=\"\\$cmd$args\"\n    else\n      # Display what would be done.\n      if test -n \"$shlibpath_var\"; then\n\teval \"\\$echo \\\"\\$shlibpath_var=\\$$shlibpath_var\\\"\"\n\t$echo \"export $shlibpath_var\"\n      fi\n      $echo \"$cmd$args\"\n      exit $EXIT_SUCCESS\n    fi\n    ;;\n\n  # libtool clean and uninstall mode\n  clean | uninstall)\n    modename=\"$modename: $mode\"\n    rm=\"$nonopt\"\n    files=\n    rmforce=\n    exit_status=0\n\n    # This variable tells wrapper scripts just to set variables rather\n    # than running their programs.\n    libtool_install_magic=\"$magic\"\n\n    for arg\n    do\n      case $arg in\n      -f) rm=\"$rm $arg\"; rmforce=yes ;;\n      -*) rm=\"$rm $arg\" ;;\n      *) files=\"$files $arg\" ;;\n      esac\n    done\n\n    if test -z \"$rm\"; then\n      $echo \"$modename: you must specify an RM program\" 1>&2\n      $echo \"$help\" 1>&2\n      exit $EXIT_FAILURE\n    fi\n\n    rmdirs=\n\n    origobjdir=\"$objdir\"\n    for file in $files; do\n      dir=`$echo \"X$file\" | $Xsed -e 's%/[^/]*$%%'`\n      if test \"X$dir\" = \"X$file\"; then\n\tdir=.\n\tobjdir=\"$origobjdir\"\n      else\n\tobjdir=\"$dir/$origobjdir\"\n      fi\n      name=`$echo \"X$file\" | $Xsed -e 's%^.*/%%'`\n      test \"$mode\" = uninstall && objdir=\"$dir\"\n\n      # Remember objdir for removal later, being careful to avoid duplicates\n      if test \"$mode\" = clean; then\n\tcase \" $rmdirs \" in\n\t  *\" $objdir \"*) ;;\n\t  *) rmdirs=\"$rmdirs $objdir\" ;;\n\tesac\n      fi\n\n      # Don't error if the file doesn't exist and rm -f was used.\n      if (test -L \"$file\") >/dev/null 2>&1 \\\n\t|| (test -h \"$file\") >/dev/null 2>&1 \\\n\t|| test -f \"$file\"; then\n\t:\n      elif test -d \"$file\"; then\n\texit_status=1\n\tcontinue\n      elif test \"$rmforce\" = yes; then\n\tcontinue\n      fi\n\n      rmfiles=\"$file\"\n\n      case $name in\n      *.la)\n\t# Possibly a libtool archive, so verify it.\n\tif (${SED} -e '2q' $file | grep \"^# Generated by .*$PACKAGE\") >/dev/null 2>&1; then\n\t  . $dir/$name\n\n\t  # Delete the libtool libraries and symlinks.\n\t  for n in $library_names; do\n\t    rmfiles=\"$rmfiles $objdir/$n\"\n\t  done\n\t  test -n \"$old_library\" && rmfiles=\"$rmfiles $objdir/$old_library\"\n\t  test \"$mode\" = clean && rmfiles=\"$rmfiles $objdir/$name $objdir/${name}i\"\n\n\t  if test \"$mode\" = uninstall; then\n\t    if test -n \"$library_names\"; then\n\t      # Do each command in the postuninstall commands.\n\t      cmds=$postuninstall_cmds\n\t      save_ifs=\"$IFS\"; IFS='~'\n\t      for cmd in $cmds; do\n\t\tIFS=\"$save_ifs\"\n\t\teval cmd=\\\"$cmd\\\"\n\t\t$show \"$cmd\"\n\t\t$run eval \"$cmd\"\n\t\tif test \"$?\" -ne 0 && test \"$rmforce\" != yes; then\n\t\t  exit_status=1\n\t\tfi\n\t      done\n\t      IFS=\"$save_ifs\"\n\t    fi\n\n\t    if test -n \"$old_library\"; then\n\t      # Do each command in the old_postuninstall commands.\n\t      cmds=$old_postuninstall_cmds\n\t      save_ifs=\"$IFS\"; IFS='~'\n\t      for cmd in $cmds; do\n\t\tIFS=\"$save_ifs\"\n\t\teval cmd=\\\"$cmd\\\"\n\t\t$show \"$cmd\"\n\t\t$run eval \"$cmd\"\n\t\tif test \"$?\" -ne 0 && test \"$rmforce\" != yes; then\n\t\t  exit_status=1\n\t\tfi\n\t      done\n\t      IFS=\"$save_ifs\"\n\t    fi\n\t    # FIXME: should reinstall the best remaining shared library.\n\t  fi\n\tfi\n\t;;\n\n      *.lo)\n\t# Possibly a libtool object, so verify it.\n\tif (${SED} -e '2q' $file | grep \"^# Generated by .*$PACKAGE\") >/dev/null 2>&1; then\n\n\t  # Read the .lo file\n\t  . $dir/$name\n\n\t  # Add PIC object to the list of files to remove.\n\t  if test -n \"$pic_object\" \\\n\t     && test \"$pic_object\" != none; then\n\t    rmfiles=\"$rmfiles $dir/$pic_object\"\n\t  fi\n\n\t  # Add non-PIC object to the list of files to remove.\n\t  if test -n \"$non_pic_object\" \\\n\t     && test \"$non_pic_object\" != none; then\n\t    rmfiles=\"$rmfiles $dir/$non_pic_object\"\n\t  fi\n\tfi\n\t;;\n\n      *)\n\tif test \"$mode\" = clean ; then\n\t  noexename=$name\n\t  case $file in\n\t  *.exe)\n\t    file=`$echo $file|${SED} 's,.exe$,,'`\n\t    noexename=`$echo $name|${SED} 's,.exe$,,'`\n\t    # $file with .exe has already been added to rmfiles,\n\t    # add $file without .exe\n\t    rmfiles=\"$rmfiles $file\"\n\t    ;;\n\t  esac\n\t  # Do a test to see if this is a libtool program.\n\t  if (${SED} -e '4q' $file | grep \"^# Generated by .*$PACKAGE\") >/dev/null 2>&1; then\n\t    relink_command=\n\t    . $dir/$noexename\n\n\t    # note $name still contains .exe if it was in $file originally\n\t    # as does the version of $file that was added into $rmfiles\n\t    rmfiles=\"$rmfiles $objdir/$name $objdir/${name}S.${objext}\"\n\t    if test \"$fast_install\" = yes && test -n \"$relink_command\"; then\n\t      rmfiles=\"$rmfiles $objdir/lt-$name\"\n\t    fi\n\t    if test \"X$noexename\" != \"X$name\" ; then\n\t      rmfiles=\"$rmfiles $objdir/lt-${noexename}.c\"\n\t    fi\n\t  fi\n\tfi\n\t;;\n      esac\n      $show \"$rm $rmfiles\"\n      $run $rm $rmfiles || exit_status=1\n    done\n    objdir=\"$origobjdir\"\n\n    # Try to remove the ${objdir}s in the directories where we deleted files\n    for dir in $rmdirs; do\n      if test -d \"$dir\"; then\n\t$show \"rmdir $dir\"\n\t$run rmdir $dir >/dev/null 2>&1\n      fi\n    done\n\n    exit $exit_status\n    ;;\n\n  \"\")\n    $echo \"$modename: you must specify a MODE\" 1>&2\n    $echo \"$generic_help\" 1>&2\n    exit $EXIT_FAILURE\n    ;;\n  esac\n\n  if test -z \"$exec_cmd\"; then\n    $echo \"$modename: invalid operation mode \\`$mode'\" 1>&2\n    $echo \"$generic_help\" 1>&2\n    exit $EXIT_FAILURE\n  fi\nfi # test -z \"$show_help\"\n\nif test -n \"$exec_cmd\"; then\n  eval exec $exec_cmd\n  exit $EXIT_FAILURE\nfi\n\n# We need to display help for each of the modes.\ncase $mode in\n\"\") $echo \\\n\"Usage: $modename [OPTION]... [MODE-ARG]...\n\nProvide generalized library-building support services.\n\n    --config          show all configuration variables\n    --debug           enable verbose shell tracing\n-n, --dry-run         display commands without modifying any files\n    --features        display basic configuration information and exit\n    --finish          same as \\`--mode=finish'\n    --help            display this help message and exit\n    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]\n    --quiet           same as \\`--silent'\n    --silent          don't print informational messages\n    --tag=TAG         use configuration variables from tag TAG\n    --version         print version information\n\nMODE must be one of the following:\n\n      clean           remove files from the build directory\n      compile         compile a source file into a libtool object\n      execute         automatically set library path, then run a program\n      finish          complete the installation of libtool libraries\n      install         install libraries or executables\n      link            create a library or an executable\n      uninstall       remove libraries from an installed directory\n\nMODE-ARGS vary depending on the MODE.  Try \\`$modename --help --mode=MODE' for\na more detailed description of MODE.\n\nReport bugs to <bug-libtool@gnu.org>.\"\n  exit $EXIT_SUCCESS\n  ;;\n\nclean)\n  $echo \\\n\"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...\n\nRemove files from the build directory.\n\nRM is the name of the program to use to delete files associated with each FILE\n(typically \\`/bin/rm').  RM-OPTIONS are options (such as \\`-f') to be passed\nto RM.\n\nIf FILE is a libtool library, object or program, all the files associated\nwith it are deleted. Otherwise, only FILE itself is deleted using RM.\"\n  ;;\n\ncompile)\n  $echo \\\n\"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE\n\nCompile a source file into a libtool library object.\n\nThis mode accepts the following additional options:\n\n  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE\n  -prefer-pic       try to building PIC objects only\n  -prefer-non-pic   try to building non-PIC objects only\n  -static           always build a \\`.o' file suitable for static linking\n\nCOMPILE-COMMAND is a command to be used in creating a \\`standard' object file\nfrom the given SOURCEFILE.\n\nThe output file name is determined by removing the directory component from\nSOURCEFILE, then substituting the C source code suffix \\`.c' with the\nlibrary object suffix, \\`.lo'.\"\n  ;;\n\nexecute)\n  $echo \\\n\"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...\n\nAutomatically set library path, then run a program.\n\nThis mode accepts the following additional options:\n\n  -dlopen FILE      add the directory containing FILE to the library path\n\nThis mode sets the library path environment variable according to \\`-dlopen'\nflags.\n\nIf any of the ARGS are libtool executable wrappers, then they are translated\ninto their corresponding uninstalled binary, and any of their required library\ndirectories are added to the library path.\n\nThen, COMMAND is executed, with ARGS as arguments.\"\n  ;;\n\nfinish)\n  $echo \\\n\"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...\n\nComplete the installation of libtool libraries.\n\nEach LIBDIR is a directory that contains libtool libraries.\n\nThe commands that this mode executes may require superuser privileges.  Use\nthe \\`--dry-run' option if you just want to see what would be executed.\"\n  ;;\n\ninstall)\n  $echo \\\n\"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...\n\nInstall executables or libraries.\n\nINSTALL-COMMAND is the installation command.  The first component should be\neither the \\`install' or \\`cp' program.\n\nThe rest of the components are interpreted as arguments to that command (only\nBSD-compatible install options are recognized).\"\n  ;;\n\nlink)\n  $echo \\\n\"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...\n\nLink object files or libraries together to form another library, or to\ncreate an executable program.\n\nLINK-COMMAND is a command using the C compiler that you would use to create\na program from several object files.\n\nThe following components of LINK-COMMAND are treated specially:\n\n  -all-static       do not do any dynamic linking at all\n  -avoid-version    do not add a version suffix if possible\n  -dlopen FILE      \\`-dlpreopen' FILE if it cannot be dlopened at runtime\n  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols\n  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)\n  -export-symbols SYMFILE\n\t\t    try to export only the symbols listed in SYMFILE\n  -export-symbols-regex REGEX\n\t\t    try to export only the symbols matching REGEX\n  -LLIBDIR          search LIBDIR for required installed libraries\n  -lNAME            OUTPUT-FILE requires the installed library libNAME\n  -module           build a library that can dlopened\n  -no-fast-install  disable the fast-install mode\n  -no-install       link a not-installable executable\n  -no-undefined     declare that a library does not refer to external symbols\n  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects\n  -objectlist FILE  Use a list of object files found in FILE to specify objects\n  -precious-files-regex REGEX\n                    don't remove output files matching REGEX\n  -release RELEASE  specify package release information\n  -rpath LIBDIR     the created library will eventually be installed in LIBDIR\n  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries\n  -static           do not do any dynamic linking of libtool libraries\n  -version-info CURRENT[:REVISION[:AGE]]\n\t\t    specify library version info [each variable defaults to 0]\n\nAll other options (arguments beginning with \\`-') are ignored.\n\nEvery other argument is treated as a filename.  Files ending in \\`.la' are\ntreated as uninstalled libtool libraries, other files are standard or library\nobject files.\n\nIf the OUTPUT-FILE ends in \\`.la', then a libtool library is created,\nonly library objects (\\`.lo' files) may be specified, and \\`-rpath' is\nrequired, except when creating a convenience library.\n\nIf OUTPUT-FILE ends in \\`.a' or \\`.lib', then a standard library is created\nusing \\`ar' and \\`ranlib', or on Windows using \\`lib'.\n\nIf OUTPUT-FILE ends in \\`.lo' or \\`.${objext}', then a reloadable object file\nis created, otherwise an executable program is created.\"\n  ;;\n\nuninstall)\n  $echo \\\n\"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...\n\nRemove libraries from an installation directory.\n\nRM is the name of the program to use to delete files associated with each FILE\n(typically \\`/bin/rm').  RM-OPTIONS are options (such as \\`-f') to be passed\nto RM.\n\nIf FILE is a libtool library, all the files associated with it are deleted.\nOtherwise, only FILE itself is deleted using RM.\"\n  ;;\n\n*)\n  $echo \"$modename: invalid operation mode \\`$mode'\" 1>&2\n  $echo \"$help\" 1>&2\n  exit $EXIT_FAILURE\n  ;;\nesac\n\n$echo\n$echo \"Try \\`$modename --help' for more information about other modes.\"\n\nexit $EXIT_SUCCESS\n\n# The TAGs below are defined such that we never get into a situation\n# in which we disable both kinds of libraries.  Given conflicting\n# choices, we go for a static library, that is the most portable,\n# since we can't tell whether shared libraries were disabled because\n# the user asked for that or because the platform doesn't support\n# them.  This is particularly important on AIX, because we don't\n# support having both static and shared libraries enabled at the same\n# time on that platform, so we default to a shared-only configuration.\n# If a disable-shared tag is given, we'll fallback to a static-only\n# configuration.  But we'll never go from static-only to shared-only.\n\n# ### BEGIN LIBTOOL TAG CONFIG: disable-shared\nbuild_libtool_libs=no\nbuild_old_libs=yes\n# ### END LIBTOOL TAG CONFIG: disable-shared\n\n# ### BEGIN LIBTOOL TAG CONFIG: disable-static\nbuild_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`\n# ### END LIBTOOL TAG CONFIG: disable-static\n\n# Local Variables:\n# mode:shell-script\n# sh-indentation:2\n# End:\n"
  },
  {
    "path": "ext/libjpeg-turbo/missing",
    "content": "#! /bin/sh\n# Common stub for a few missing GNU programs while installing.\n\nscriptversion=2004-09-07.08\n\n# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004\n#   Free Software Foundation, Inc.\n# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.\n\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 2, or (at your option)\n# any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n# 02111-1307, USA.\n\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that program.\n\nif test $# -eq 0; then\n  echo 1>&2 \"Try \\`$0 --help' for more information\"\n  exit 1\nfi\n\nrun=:\n\n# In the cases where this matters, `missing' is being run in the\n# srcdir already.\nif test -f configure.ac; then\n  configure_ac=configure.ac\nelse\n  configure_ac=configure.in\nfi\n\nmsg=\"missing on your system\"\n\ncase \"$1\" in\n--run)\n  # Try to run requested program, and just exit if it succeeds.\n  run=\n  shift\n  \"$@\" && exit 0\n  # Exit code 63 means version mismatch.  This often happens\n  # when the user try to use an ancient version of a tool on\n  # a file that requires a minimum version.  In this case we\n  # we should proceed has if the program had been absent, or\n  # if --run hadn't been passed.\n  if test $? = 63; then\n    run=:\n    msg=\"probably too old\"\n  fi\n  ;;\n\n  -h|--h|--he|--hel|--help)\n    echo \"\\\n$0 [OPTION]... PROGRAM [ARGUMENT]...\n\nHandle \\`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an\nerror status if there is no known handling for PROGRAM.\n\nOptions:\n  -h, --help      display this help and exit\n  -v, --version   output version information and exit\n  --run           try to run the given command, and emulate it if it fails\n\nSupported PROGRAM values:\n  aclocal      touch file \\`aclocal.m4'\n  autoconf     touch file \\`configure'\n  autoheader   touch file \\`config.h.in'\n  automake     touch all \\`Makefile.in' files\n  bison        create \\`y.tab.[ch]', if possible, from existing .[ch]\n  flex         create \\`lex.yy.c', if possible, from existing .c\n  help2man     touch the output file\n  lex          create \\`lex.yy.c', if possible, from existing .c\n  makeinfo     touch the output file\n  tar          try tar, gnutar, gtar, then tar without non-portable flags\n  yacc         create \\`y.tab.[ch]', if possible, from existing .[ch]\n\nSend bug reports to <bug-automake@gnu.org>.\"\n    exit 0\n    ;;\n\n  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)\n    echo \"missing $scriptversion (GNU Automake)\"\n    exit 0\n    ;;\n\n  -*)\n    echo 1>&2 \"$0: Unknown \\`$1' option\"\n    echo 1>&2 \"Try \\`$0 --help' for more information\"\n    exit 1\n    ;;\n\nesac\n\n# Now exit if we have it, but it failed.  Also exit now if we\n# don't have it and --version was passed (most likely to detect\n# the program).\ncase \"$1\" in\n  lex|yacc)\n    # Not GNU programs, they don't have --version.\n    ;;\n\n  tar)\n    if test -n \"$run\"; then\n       echo 1>&2 \"ERROR: \\`tar' requires --run\"\n       exit 1\n    elif test \"x$2\" = \"x--version\" || test \"x$2\" = \"x--help\"; then\n       exit 1\n    fi\n    ;;\n\n  *)\n    if test -z \"$run\" && ($1 --version) > /dev/null 2>&1; then\n       # We have it, but it failed.\n       exit 1\n    elif test \"x$2\" = \"x--version\" || test \"x$2\" = \"x--help\"; then\n       # Could not run --version or --help.  This is probably someone\n       # running `$TOOL --version' or `$TOOL --help' to check whether\n       # $TOOL exists and not knowing $TOOL uses missing.\n       exit 1\n    fi\n    ;;\nesac\n\n# If it does not exist, or fails to run (possibly an outdated version),\n# try to emulate it.\ncase \"$1\" in\n  aclocal*)\n    echo 1>&2 \"\\\nWARNING: \\`$1' is $msg.  You should only need it if\n         you modified \\`acinclude.m4' or \\`${configure_ac}'.  You might want\n         to install the \\`Automake' and \\`Perl' packages.  Grab them from\n         any GNU archive site.\"\n    touch aclocal.m4\n    ;;\n\n  autoconf)\n    echo 1>&2 \"\\\nWARNING: \\`$1' is $msg.  You should only need it if\n         you modified \\`${configure_ac}'.  You might want to install the\n         \\`Autoconf' and \\`GNU m4' packages.  Grab them from any GNU\n         archive site.\"\n    touch configure\n    ;;\n\n  autoheader)\n    echo 1>&2 \"\\\nWARNING: \\`$1' is $msg.  You should only need it if\n         you modified \\`acconfig.h' or \\`${configure_ac}'.  You might want\n         to install the \\`Autoconf' and \\`GNU m4' packages.  Grab them\n         from any GNU archive site.\"\n    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\\([^)]*\\)).*/\\1/p' ${configure_ac}`\n    test -z \"$files\" && files=\"config.h\"\n    touch_files=\n    for f in $files; do\n      case \"$f\" in\n      *:*) touch_files=\"$touch_files \"`echo \"$f\" |\n\t\t\t\t       sed -e 's/^[^:]*://' -e 's/:.*//'`;;\n      *) touch_files=\"$touch_files $f.in\";;\n      esac\n    done\n    touch $touch_files\n    ;;\n\n  automake*)\n    echo 1>&2 \"\\\nWARNING: \\`$1' is $msg.  You should only need it if\n         you modified \\`Makefile.am', \\`acinclude.m4' or \\`${configure_ac}'.\n         You might want to install the \\`Automake' and \\`Perl' packages.\n         Grab them from any GNU archive site.\"\n    find . -type f -name Makefile.am -print |\n\t   sed 's/\\.am$/.in/' |\n\t   while read f; do touch \"$f\"; done\n    ;;\n\n  autom4te)\n    echo 1>&2 \"\\\nWARNING: \\`$1' is needed, but is $msg.\n         You might have modified some files without having the\n         proper tools for further handling them.\n         You can get \\`$1' as part of \\`Autoconf' from any GNU\n         archive site.\"\n\n    file=`echo \"$*\" | sed -n 's/.*--output[ =]*\\([^ ]*\\).*/\\1/p'`\n    test -z \"$file\" && file=`echo \"$*\" | sed -n 's/.*-o[ ]*\\([^ ]*\\).*/\\1/p'`\n    if test -f \"$file\"; then\n\ttouch $file\n    else\n\ttest -z \"$file\" || exec >$file\n\techo \"#! /bin/sh\"\n\techo \"# Created by GNU Automake missing as a replacement of\"\n\techo \"#  $ $@\"\n\techo \"exit 0\"\n\tchmod +x $file\n\texit 1\n    fi\n    ;;\n\n  bison|yacc)\n    echo 1>&2 \"\\\nWARNING: \\`$1' $msg.  You should only need it if\n         you modified a \\`.y' file.  You may need the \\`Bison' package\n         in order for those modifications to take effect.  You can get\n         \\`Bison' from any GNU archive site.\"\n    rm -f y.tab.c y.tab.h\n    if [ $# -ne 1 ]; then\n        eval LASTARG=\"\\${$#}\"\n\tcase \"$LASTARG\" in\n\t*.y)\n\t    SRCFILE=`echo \"$LASTARG\" | sed 's/y$/c/'`\n\t    if [ -f \"$SRCFILE\" ]; then\n\t         cp \"$SRCFILE\" y.tab.c\n\t    fi\n\t    SRCFILE=`echo \"$LASTARG\" | sed 's/y$/h/'`\n\t    if [ -f \"$SRCFILE\" ]; then\n\t         cp \"$SRCFILE\" y.tab.h\n\t    fi\n\t  ;;\n\tesac\n    fi\n    if [ ! -f y.tab.h ]; then\n\techo >y.tab.h\n    fi\n    if [ ! -f y.tab.c ]; then\n\techo 'main() { return 0; }' >y.tab.c\n    fi\n    ;;\n\n  lex|flex)\n    echo 1>&2 \"\\\nWARNING: \\`$1' is $msg.  You should only need it if\n         you modified a \\`.l' file.  You may need the \\`Flex' package\n         in order for those modifications to take effect.  You can get\n         \\`Flex' from any GNU archive site.\"\n    rm -f lex.yy.c\n    if [ $# -ne 1 ]; then\n        eval LASTARG=\"\\${$#}\"\n\tcase \"$LASTARG\" in\n\t*.l)\n\t    SRCFILE=`echo \"$LASTARG\" | sed 's/l$/c/'`\n\t    if [ -f \"$SRCFILE\" ]; then\n\t         cp \"$SRCFILE\" lex.yy.c\n\t    fi\n\t  ;;\n\tesac\n    fi\n    if [ ! -f lex.yy.c ]; then\n\techo 'main() { return 0; }' >lex.yy.c\n    fi\n    ;;\n\n  help2man)\n    echo 1>&2 \"\\\nWARNING: \\`$1' is $msg.  You should only need it if\n\t you modified a dependency of a manual page.  You may need the\n\t \\`Help2man' package in order for those modifications to take\n\t effect.  You can get \\`Help2man' from any GNU archive site.\"\n\n    file=`echo \"$*\" | sed -n 's/.*-o \\([^ ]*\\).*/\\1/p'`\n    if test -z \"$file\"; then\n\tfile=`echo \"$*\" | sed -n 's/.*--output=\\([^ ]*\\).*/\\1/p'`\n    fi\n    if [ -f \"$file\" ]; then\n\ttouch $file\n    else\n\ttest -z \"$file\" || exec >$file\n\techo \".ab help2man is required to generate this page\"\n\texit 1\n    fi\n    ;;\n\n  makeinfo)\n    echo 1>&2 \"\\\nWARNING: \\`$1' is $msg.  You should only need it if\n         you modified a \\`.texi' or \\`.texinfo' file, or any other file\n         indirectly affecting the aspect of the manual.  The spurious\n         call might also be the consequence of using a buggy \\`make' (AIX,\n         DU, IRIX).  You might want to install the \\`Texinfo' package or\n         the \\`GNU make' package.  Grab either from any GNU archive site.\"\n    file=`echo \"$*\" | sed -n 's/.*-o \\([^ ]*\\).*/\\1/p'`\n    if test -z \"$file\"; then\n      file=`echo \"$*\" | sed 's/.* \\([^ ]*\\) *$/\\1/'`\n      file=`sed -n '/^@setfilename/ { s/.* \\([^ ]*\\) *$/\\1/; p; q; }' $file`\n    fi\n    touch $file\n    ;;\n\n  tar)\n    shift\n\n    # We have already tried tar in the generic part.\n    # Look for gnutar/gtar before invocation to avoid ugly error\n    # messages.\n    if (gnutar --version > /dev/null 2>&1); then\n       gnutar \"$@\" && exit 0\n    fi\n    if (gtar --version > /dev/null 2>&1); then\n       gtar \"$@\" && exit 0\n    fi\n    firstarg=\"$1\"\n    if shift; then\n\tcase \"$firstarg\" in\n\t*o*)\n\t    firstarg=`echo \"$firstarg\" | sed s/o//`\n\t    tar \"$firstarg\" \"$@\" && exit 0\n\t    ;;\n\tesac\n\tcase \"$firstarg\" in\n\t*h*)\n\t    firstarg=`echo \"$firstarg\" | sed s/h//`\n\t    tar \"$firstarg\" \"$@\" && exit 0\n\t    ;;\n\tesac\n    fi\n\n    echo 1>&2 \"\\\nWARNING: I can't seem to be able to run \\`tar' with the given arguments.\n         You may want to install GNU tar or Free paxutils, or check the\n         command line arguments.\"\n    exit 1\n    ;;\n\n  *)\n    echo 1>&2 \"\\\nWARNING: \\`$1' is needed, and is $msg.\n         You might have modified some files without having the\n         proper tools for further handling them.  Check the \\`README' file,\n         it often tells you about the needed prerequisites for installing\n         this package.  You may also peek at any GNU archive site, in case\n         some other package would contain this missing \\`$1' program.\"\n    exit 1\n    ;;\nesac\n\nexit 0\n\n# Local variables:\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"scriptversion=\"\n# time-stamp-format: \"%:y-%02m-%02d.%02H\"\n# time-stamp-end: \"$\"\n# End:\n"
  },
  {
    "path": "ext/libjpeg-turbo/rdbmp.c",
    "content": "/*\n * rdbmp.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * Modified 2009-2010 by Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Modified 2011 by Siarhei Siamashka.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to read input images in Microsoft \"BMP\"\n * format (MS Windows 3.x, OS/2 1.x, and OS/2 2.x flavors).\n * Currently, only 8-bit and 24-bit images are supported, not 1-bit or\n * 4-bit (feeding such low-depth images into JPEG would be silly anyway).\n * Also, we don't support RLE-compressed files.\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume input from\n * an ordinary stdio stream.  They further assume that reading begins\n * at the start of the file; start_input may need work if the\n * user interface has already read some data (e.g., to determine that\n * the file is indeed BMP format).\n *\n * This code contributed by James Arthur Boucher.\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n\n#ifdef BMP_SUPPORTED\n\n\n/* Macros to deal with unsigned chars as efficiently as compiler allows */\n\n#ifdef HAVE_UNSIGNED_CHAR\ntypedef unsigned char U_CHAR;\n#define UCH(x)\t((int) (x))\n#else /* !HAVE_UNSIGNED_CHAR */\n#ifdef CHAR_IS_UNSIGNED\ntypedef char U_CHAR;\n#define UCH(x)\t((int) (x))\n#else\ntypedef char U_CHAR;\n#define UCH(x)\t((int) (x) & 0xFF)\n#endif\n#endif /* HAVE_UNSIGNED_CHAR */\n\n\n#define\tReadOK(file,buffer,len)\t(JFREAD(file,buffer,len) == ((size_t) (len)))\n\n\n/* Private version of data source object */\n\ntypedef struct _bmp_source_struct * bmp_source_ptr;\n\ntypedef struct _bmp_source_struct {\n  struct cjpeg_source_struct pub; /* public fields */\n\n  j_compress_ptr cinfo;\t\t/* back link saves passing separate parm */\n\n  JSAMPARRAY colormap;\t\t/* BMP colormap (converted to my format) */\n\n  jvirt_sarray_ptr whole_image;\t/* Needed to reverse row order */\n  JDIMENSION source_row;\t/* Current source row number */\n  JDIMENSION row_width;\t\t/* Physical width of scanlines in file */\n\n  int bits_per_pixel;\t\t/* remembers 8- or 24-bit format */\n} bmp_source_struct;\n\n\nLOCAL(int)\nread_byte (bmp_source_ptr sinfo)\n/* Read next byte from BMP file */\n{\n  register FILE *infile = sinfo->pub.input_file;\n  register int c;\n\n  if ((c = getc(infile)) == EOF)\n    ERREXIT(sinfo->cinfo, JERR_INPUT_EOF);\n  return c;\n}\n\n\nLOCAL(void)\nread_colormap (bmp_source_ptr sinfo, int cmaplen, int mapentrysize)\n/* Read the colormap from a BMP file */\n{\n  int i;\n\n  switch (mapentrysize) {\n  case 3:\n    /* BGR format (occurs in OS/2 files) */\n    for (i = 0; i < cmaplen; i++) {\n      sinfo->colormap[2][i] = (JSAMPLE) read_byte(sinfo);\n      sinfo->colormap[1][i] = (JSAMPLE) read_byte(sinfo);\n      sinfo->colormap[0][i] = (JSAMPLE) read_byte(sinfo);\n    }\n    break;\n  case 4:\n    /* BGR0 format (occurs in MS Windows files) */\n    for (i = 0; i < cmaplen; i++) {\n      sinfo->colormap[2][i] = (JSAMPLE) read_byte(sinfo);\n      sinfo->colormap[1][i] = (JSAMPLE) read_byte(sinfo);\n      sinfo->colormap[0][i] = (JSAMPLE) read_byte(sinfo);\n      (void) read_byte(sinfo);\n    }\n    break;\n  default:\n    ERREXIT(sinfo->cinfo, JERR_BMP_BADCMAP);\n    break;\n  }\n}\n\n\n/*\n * Read one row of pixels.\n * The image has been read into the whole_image array, but is otherwise\n * unprocessed.  We must read it out in top-to-bottom row order, and if\n * it is an 8-bit image, we must expand colormapped pixels to 24bit format.\n */\n\nMETHODDEF(JDIMENSION)\nget_8bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading 8-bit colormap indexes */\n{\n  bmp_source_ptr source = (bmp_source_ptr) sinfo;\n  register JSAMPARRAY colormap = source->colormap;\n  JSAMPARRAY image_ptr;\n  register int t;\n  register JSAMPROW inptr, outptr;\n  register JDIMENSION col;\n\n  /* Fetch next row from virtual array */\n  source->source_row--;\n  image_ptr = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, source->whole_image,\n     source->source_row, (JDIMENSION) 1, FALSE);\n\n  /* Expand the colormap indexes to real data */\n  inptr = image_ptr[0];\n  outptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    t = GETJSAMPLE(*inptr++);\n    *outptr++ = colormap[0][t];\t/* can omit GETJSAMPLE() safely */\n    *outptr++ = colormap[1][t];\n    *outptr++ = colormap[2][t];\n  }\n\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_24bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading 24-bit pixels */\n{\n  bmp_source_ptr source = (bmp_source_ptr) sinfo;\n  JSAMPARRAY image_ptr;\n  register JSAMPROW inptr, outptr;\n  register JDIMENSION col;\n\n  /* Fetch next row from virtual array */\n  source->source_row--;\n  image_ptr = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, source->whole_image,\n     source->source_row, (JDIMENSION) 1, FALSE);\n\n  /* Transfer data.  Note source values are in BGR order\n   * (even though Microsoft's own documents say the opposite).\n   */\n  inptr = image_ptr[0];\n  outptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    outptr[2] = *inptr++;\t/* can omit GETJSAMPLE() safely */\n    outptr[1] = *inptr++;\n    outptr[0] = *inptr++;\n    outptr += 3;\n  }\n\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_32bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading 32-bit pixels */\n{\n  bmp_source_ptr source = (bmp_source_ptr) sinfo;\n  JSAMPARRAY image_ptr;\n  register JSAMPROW inptr, outptr;\n  register JDIMENSION col;\n\n  /* Fetch next row from virtual array */\n  source->source_row--;\n  image_ptr = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, source->whole_image,\n     source->source_row, (JDIMENSION) 1, FALSE);\n  /* Transfer data.  Note source values are in BGR order\n   * (even though Microsoft's own documents say the opposite).\n   */\n  inptr = image_ptr[0];\n  outptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    outptr[2] = *inptr++;\t/* can omit GETJSAMPLE() safely */\n    outptr[1] = *inptr++;\n    outptr[0] = *inptr++;\n    inptr++;\t\t\t/* skip the 4th byte (Alpha channel) */\n    outptr += 3;\n  }\n\n  return 1;\n}\n\n\n/*\n * This method loads the image into whole_image during the first call on\n * get_pixel_rows.  The get_pixel_rows pointer is then adjusted to call\n * get_8bit_row, get_24bit_row, or get_32bit_row on subsequent calls.\n */\n\nMETHODDEF(JDIMENSION)\npreload_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  bmp_source_ptr source = (bmp_source_ptr) sinfo;\n  register FILE *infile = source->pub.input_file;\n  register JSAMPROW out_ptr;\n  JSAMPARRAY image_ptr;\n  JDIMENSION row;\n  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n\n  /* Read the data into a virtual array in input-file row order. */\n  for (row = 0; row < cinfo->image_height; row++) {\n    if (progress != NULL) {\n      progress->pub.pass_counter = (long) row;\n      progress->pub.pass_limit = (long) cinfo->image_height;\n      (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n    }\n    image_ptr = (*cinfo->mem->access_virt_sarray)\n      ((j_common_ptr) cinfo, source->whole_image,\n       row, (JDIMENSION) 1, TRUE);\n    out_ptr = image_ptr[0];\n    if (fread(out_ptr, 1, source->row_width, infile) != source->row_width) {\n      if (feof(infile))\n        ERREXIT(cinfo, JERR_INPUT_EOF);\n      else\n        ERREXIT(cinfo, JERR_FILE_READ);\n    }\n  }\n  if (progress != NULL)\n    progress->completed_extra_passes++;\n\n  /* Set up to read from the virtual array in top-to-bottom order */\n  switch (source->bits_per_pixel) {\n  case 8:\n    source->pub.get_pixel_rows = get_8bit_row;\n    break;\n  case 24:\n    source->pub.get_pixel_rows = get_24bit_row;\n    break;\n  case 32:\n    source->pub.get_pixel_rows = get_32bit_row;\n    break;\n  default:\n    ERREXIT(cinfo, JERR_BMP_BADDEPTH);\n  }\n  source->source_row = cinfo->image_height;\n\n  /* And read the first row */\n  return (*source->pub.get_pixel_rows) (cinfo, sinfo);\n}\n\n\n/*\n * Read the file header; return image size and component count.\n */\n\nMETHODDEF(void)\nstart_input_bmp (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  bmp_source_ptr source = (bmp_source_ptr) sinfo;\n  U_CHAR bmpfileheader[14];\n  U_CHAR bmpinfoheader[64];\n#define GET_2B(array,offset)  ((unsigned int) UCH(array[offset]) + \\\n\t\t\t       (((unsigned int) UCH(array[offset+1])) << 8))\n#define GET_4B(array,offset)  ((INT32) UCH(array[offset]) + \\\n\t\t\t       (((INT32) UCH(array[offset+1])) << 8) + \\\n\t\t\t       (((INT32) UCH(array[offset+2])) << 16) + \\\n\t\t\t       (((INT32) UCH(array[offset+3])) << 24))\n  INT32 bfOffBits;\n  INT32 headerSize;\n  INT32 biWidth;\n  INT32 biHeight;\n  unsigned int biPlanes;\n  INT32 biCompression;\n  INT32 biXPelsPerMeter,biYPelsPerMeter;\n  INT32 biClrUsed = 0;\n  int mapentrysize = 0;\t\t/* 0 indicates no colormap */\n  INT32 bPad;\n  JDIMENSION row_width;\n\n  /* Read and verify the bitmap file header */\n  if (! ReadOK(source->pub.input_file, bmpfileheader, 14))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n  if (GET_2B(bmpfileheader,0) != 0x4D42) /* 'BM' */\n    ERREXIT(cinfo, JERR_BMP_NOT);\n  bfOffBits = (INT32) GET_4B(bmpfileheader,10);\n  /* We ignore the remaining fileheader fields */\n\n  /* The infoheader might be 12 bytes (OS/2 1.x), 40 bytes (Windows),\n   * or 64 bytes (OS/2 2.x).  Check the first 4 bytes to find out which.\n   */\n  if (! ReadOK(source->pub.input_file, bmpinfoheader, 4))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n  headerSize = (INT32) GET_4B(bmpinfoheader,0);\n  if (headerSize < 12 || headerSize > 64)\n    ERREXIT(cinfo, JERR_BMP_BADHEADER);\n  if (! ReadOK(source->pub.input_file, bmpinfoheader+4, headerSize-4))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n\n  switch ((int) headerSize) {\n  case 12:\n    /* Decode OS/2 1.x header (Microsoft calls this a BITMAPCOREHEADER) */\n    biWidth = (INT32) GET_2B(bmpinfoheader,4);\n    biHeight = (INT32) GET_2B(bmpinfoheader,6);\n    biPlanes = GET_2B(bmpinfoheader,8);\n    source->bits_per_pixel = (int) GET_2B(bmpinfoheader,10);\n\n    switch (source->bits_per_pixel) {\n    case 8:\t\t\t/* colormapped image */\n      mapentrysize = 3;\t\t/* OS/2 uses RGBTRIPLE colormap */\n      TRACEMS2(cinfo, 1, JTRC_BMP_OS2_MAPPED, (int) biWidth, (int) biHeight);\n      break;\n    case 24:\t\t\t/* RGB image */\n      TRACEMS2(cinfo, 1, JTRC_BMP_OS2, (int) biWidth, (int) biHeight);\n      break;\n    default:\n      ERREXIT(cinfo, JERR_BMP_BADDEPTH);\n      break;\n    }\n    break;\n  case 40:\n  case 64:\n    /* Decode Windows 3.x header (Microsoft calls this a BITMAPINFOHEADER) */\n    /* or OS/2 2.x header, which has additional fields that we ignore */\n    biWidth = GET_4B(bmpinfoheader,4);\n    biHeight = GET_4B(bmpinfoheader,8);\n    biPlanes = GET_2B(bmpinfoheader,12);\n    source->bits_per_pixel = (int) GET_2B(bmpinfoheader,14);\n    biCompression = GET_4B(bmpinfoheader,16);\n    biXPelsPerMeter = GET_4B(bmpinfoheader,24);\n    biYPelsPerMeter = GET_4B(bmpinfoheader,28);\n    biClrUsed = GET_4B(bmpinfoheader,32);\n    /* biSizeImage, biClrImportant fields are ignored */\n\n    switch (source->bits_per_pixel) {\n    case 8:\t\t\t/* colormapped image */\n      mapentrysize = 4;\t\t/* Windows uses RGBQUAD colormap */\n      TRACEMS2(cinfo, 1, JTRC_BMP_MAPPED, (int) biWidth, (int) biHeight);\n      break;\n    case 24:\t\t\t/* RGB image */\n      TRACEMS2(cinfo, 1, JTRC_BMP, (int) biWidth, (int) biHeight);\n      break;\n    case 32:\t\t\t/* RGB image + Alpha channel */\n      TRACEMS2(cinfo, 1, JTRC_BMP, (int) biWidth, (int) biHeight);\n      break;\n    default:\n      ERREXIT(cinfo, JERR_BMP_BADDEPTH);\n      break;\n    }\n    if (biCompression != 0)\n      ERREXIT(cinfo, JERR_BMP_COMPRESSED);\n\n    if (biXPelsPerMeter > 0 && biYPelsPerMeter > 0) {\n      /* Set JFIF density parameters from the BMP data */\n      cinfo->X_density = (UINT16) (biXPelsPerMeter/100); /* 100 cm per meter */\n      cinfo->Y_density = (UINT16) (biYPelsPerMeter/100);\n      cinfo->density_unit = 2;\t/* dots/cm */\n    }\n    break;\n  default:\n    ERREXIT(cinfo, JERR_BMP_BADHEADER);\n    return;\n  }\n\n  if (biWidth <= 0 || biHeight <= 0)\n    ERREXIT(cinfo, JERR_BMP_EMPTY);\n  if (biPlanes != 1)\n    ERREXIT(cinfo, JERR_BMP_BADPLANES);\n\n  /* Compute distance to bitmap data --- will adjust for colormap below */\n  bPad = bfOffBits - (headerSize + 14);\n\n  /* Read the colormap, if any */\n  if (mapentrysize > 0) {\n    if (biClrUsed <= 0)\n      biClrUsed = 256;\t\t/* assume it's 256 */\n    else if (biClrUsed > 256)\n      ERREXIT(cinfo, JERR_BMP_BADCMAP);\n    /* Allocate space to store the colormap */\n    source->colormap = (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       (JDIMENSION) biClrUsed, (JDIMENSION) 3);\n    /* and read it from the file */\n    read_colormap(source, (int) biClrUsed, mapentrysize);\n    /* account for size of colormap */\n    bPad -= biClrUsed * mapentrysize;\n  }\n\n  /* Skip any remaining pad bytes */\n  if (bPad < 0)\t\t\t/* incorrect bfOffBits value? */\n    ERREXIT(cinfo, JERR_BMP_BADHEADER);\n  while (--bPad >= 0) {\n    (void) read_byte(source);\n  }\n\n  /* Compute row width in file, including padding to 4-byte boundary */\n  if (source->bits_per_pixel == 24)\n    row_width = (JDIMENSION) (biWidth * 3);\n  else if (source->bits_per_pixel == 32)\n    row_width = (JDIMENSION) (biWidth * 4);\n  else\n    row_width = (JDIMENSION) biWidth;\n  while ((row_width & 3) != 0) row_width++;\n  source->row_width = row_width;\n\n  /* Allocate space for inversion array, prepare for preload pass */\n  source->whole_image = (*cinfo->mem->request_virt_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n     row_width, (JDIMENSION) biHeight, (JDIMENSION) 1);\n  source->pub.get_pixel_rows = preload_image;\n  if (cinfo->progress != NULL) {\n    cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n    progress->total_extra_passes++; /* count file input as separate pass */\n  }\n\n  /* Allocate one-row buffer for returned data */\n  source->pub.buffer = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE,\n     (JDIMENSION) (biWidth * 3), (JDIMENSION) 1);\n  source->pub.buffer_height = 1;\n\n  cinfo->in_color_space = JCS_RGB;\n  cinfo->input_components = 3;\n  cinfo->data_precision = 8;\n  cinfo->image_width = (JDIMENSION) biWidth;\n  cinfo->image_height = (JDIMENSION) biHeight;\n}\n\n\n/*\n * Finish up at the end of the file.\n */\n\nMETHODDEF(void)\nfinish_input_bmp (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  /* no work */\n}\n\n\n/*\n * The module selection routine for BMP format input.\n */\n\nGLOBAL(cjpeg_source_ptr)\njinit_read_bmp (j_compress_ptr cinfo)\n{\n  bmp_source_ptr source;\n\n  /* Create module interface object */\n  source = (bmp_source_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(bmp_source_struct));\n  source->cinfo = cinfo;\t/* make back link for subroutines */\n  /* Fill in method ptrs, except get_pixel_rows which start_input sets */\n  source->pub.start_input = start_input_bmp;\n  source->pub.finish_input = finish_input_bmp;\n\n  return (cjpeg_source_ptr) source;\n}\n\n#endif /* BMP_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/rdcolmap.c",
    "content": "/*\n * rdcolmap.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file implements djpeg's \"-map file\" switch.  It reads a source image\n * and constructs a colormap to be supplied to the JPEG decompressor.\n *\n * Currently, these file formats are supported for the map file:\n *   GIF: the contents of the GIF's global colormap are used.\n *   PPM (either text or raw flavor): the entire file is read and\n *      each unique pixel value is entered in the map.\n * Note that reading a large PPM file will be horrendously slow.\n * Typically, a PPM-format map file should contain just one pixel\n * of each desired color.  Such a file can be extracted from an\n * ordinary image PPM file with ppmtomap(1).\n *\n * Rescaling a PPM that has a maxval unequal to MAXJSAMPLE is not\n * currently implemented.\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n\n#ifdef QUANT_2PASS_SUPPORTED\t/* otherwise can't quantize to supplied map */\n\n/* Portions of this code are based on the PBMPLUS library, which is:\n**\n** Copyright (C) 1988 by Jef Poskanzer.\n**\n** Permission to use, copy, modify, and distribute this software and its\n** documentation for any purpose and without fee is hereby granted, provided\n** that the above copyright notice appear in all copies and that both that\n** copyright notice and this permission notice appear in supporting\n** documentation.  This software is provided \"as is\" without express or\n** implied warranty.\n*/\n\n\n/*\n * Add a (potentially) new color to the color map.\n */\n\nLOCAL(void)\nadd_map_entry (j_decompress_ptr cinfo, int R, int G, int B)\n{\n  JSAMPROW colormap0 = cinfo->colormap[0];\n  JSAMPROW colormap1 = cinfo->colormap[1];\n  JSAMPROW colormap2 = cinfo->colormap[2];\n  int ncolors = cinfo->actual_number_of_colors;\n  int index;\n\n  /* Check for duplicate color. */\n  for (index = 0; index < ncolors; index++) {\n    if (GETJSAMPLE(colormap0[index]) == R &&\n\tGETJSAMPLE(colormap1[index]) == G &&\n\tGETJSAMPLE(colormap2[index]) == B)\n      return;\t\t\t/* color is already in map */\n  }\n\n  /* Check for map overflow. */\n  if (ncolors >= (MAXJSAMPLE+1))\n    ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, (MAXJSAMPLE+1));\n\n  /* OK, add color to map. */\n  colormap0[ncolors] = (JSAMPLE) R;\n  colormap1[ncolors] = (JSAMPLE) G;\n  colormap2[ncolors] = (JSAMPLE) B;\n  cinfo->actual_number_of_colors++;\n}\n\n\n/*\n * Extract color map from a GIF file.\n */\n\nLOCAL(void)\nread_gif_map (j_decompress_ptr cinfo, FILE * infile)\n{\n  int header[13];\n  int i, colormaplen;\n  int R, G, B;\n\n  /* Initial 'G' has already been read by read_color_map */\n  /* Read the rest of the GIF header and logical screen descriptor */\n  for (i = 1; i < 13; i++) {\n    if ((header[i] = getc(infile)) == EOF)\n      ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n  }\n\n  /* Verify GIF Header */\n  if (header[1] != 'I' || header[2] != 'F')\n    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n\n  /* There must be a global color map. */\n  if ((header[10] & 0x80) == 0)\n    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n\n  /* OK, fetch it. */\n  colormaplen = 2 << (header[10] & 0x07);\n\n  for (i = 0; i < colormaplen; i++) {\n    R = getc(infile);\n    G = getc(infile);\n    B = getc(infile);\n    if (R == EOF || G == EOF || B == EOF)\n      ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n    add_map_entry(cinfo,\n\t\t  R << (BITS_IN_JSAMPLE-8),\n\t\t  G << (BITS_IN_JSAMPLE-8),\n\t\t  B << (BITS_IN_JSAMPLE-8));\n  }\n}\n\n\n/* Support routines for reading PPM */\n\n\nLOCAL(int)\npbm_getc (FILE * infile)\n/* Read next char, skipping over any comments */\n/* A comment/newline sequence is returned as a newline */\n{\n  register int ch;\n  \n  ch = getc(infile);\n  if (ch == '#') {\n    do {\n      ch = getc(infile);\n    } while (ch != '\\n' && ch != EOF);\n  }\n  return ch;\n}\n\n\nLOCAL(unsigned int)\nread_pbm_integer (j_decompress_ptr cinfo, FILE * infile)\n/* Read an unsigned decimal integer from the PPM file */\n/* Swallows one trailing character after the integer */\n/* Note that on a 16-bit-int machine, only values up to 64k can be read. */\n/* This should not be a problem in practice. */\n{\n  register int ch;\n  register unsigned int val;\n  \n  /* Skip any leading whitespace */\n  do {\n    ch = pbm_getc(infile);\n    if (ch == EOF)\n      ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n  } while (ch == ' ' || ch == '\\t' || ch == '\\n' || ch == '\\r');\n  \n  if (ch < '0' || ch > '9')\n    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n  \n  val = ch - '0';\n  while ((ch = pbm_getc(infile)) >= '0' && ch <= '9') {\n    val *= 10;\n    val += ch - '0';\n  }\n  return val;\n}\n\n\n/*\n * Extract color map from a PPM file.\n */\n\nLOCAL(void)\nread_ppm_map (j_decompress_ptr cinfo, FILE * infile)\n{\n  int c;\n  unsigned int w, h, maxval, row, col;\n  int R, G, B;\n\n  /* Initial 'P' has already been read by read_color_map */\n  c = getc(infile);\t\t/* save format discriminator for a sec */\n\n  /* while we fetch the remaining header info */\n  w = read_pbm_integer(cinfo, infile);\n  h = read_pbm_integer(cinfo, infile);\n  maxval = read_pbm_integer(cinfo, infile);\n\n  if (w <= 0 || h <= 0 || maxval <= 0) /* error check */\n    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n\n  /* For now, we don't support rescaling from an unusual maxval. */\n  if (maxval != (unsigned int) MAXJSAMPLE)\n    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n\n  switch (c) {\n  case '3':\t\t\t/* it's a text-format PPM file */\n    for (row = 0; row < h; row++) {\n      for (col = 0; col < w; col++) {\n\tR = read_pbm_integer(cinfo, infile);\n\tG = read_pbm_integer(cinfo, infile);\n\tB = read_pbm_integer(cinfo, infile);\n\tadd_map_entry(cinfo, R, G, B);\n      }\n    }\n    break;\n\n  case '6':\t\t\t/* it's a raw-format PPM file */\n    for (row = 0; row < h; row++) {\n      for (col = 0; col < w; col++) {\n\tR = getc(infile);\n\tG = getc(infile);\n\tB = getc(infile);\n\tif (R == EOF || G == EOF || B == EOF)\n\t  ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n\tadd_map_entry(cinfo, R, G, B);\n      }\n    }\n    break;\n\n  default:\n    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n    break;\n  }\n}\n\n\n/*\n * Main entry point from djpeg.c.\n *  Input: opened input file (from file name argument on command line).\n *  Output: colormap and actual_number_of_colors fields are set in cinfo.\n */\n\nGLOBAL(void)\nread_color_map (j_decompress_ptr cinfo, FILE * infile)\n{\n  /* Allocate space for a color map of maximum supported size. */\n  cinfo->colormap = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE,\n     (JDIMENSION) (MAXJSAMPLE+1), (JDIMENSION) 3);\n  cinfo->actual_number_of_colors = 0; /* initialize map to empty */\n\n  /* Read first byte to determine file format */\n  switch (getc(infile)) {\n  case 'G':\n    read_gif_map(cinfo, infile);\n    break;\n  case 'P':\n    read_ppm_map(cinfo, infile);\n    break;\n  default:\n    ERREXIT(cinfo, JERR_BAD_CMAP_FILE);\n    break;\n  }\n}\n\n#endif /* QUANT_2PASS_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/rdgif.c",
    "content": "/*\n * rdgif.c\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to read input images in GIF format.\n *\n *****************************************************************************\n * NOTE: to avoid entanglements with Unisys' patent on LZW compression,      *\n * the ability to read GIF files has been removed from the IJG distribution. *\n * Sorry about that.                                                         *\n *****************************************************************************\n *\n * We are required to state that\n *    \"The Graphics Interchange Format(c) is the Copyright property of\n *    CompuServe Incorporated. GIF(sm) is a Service Mark property of\n *    CompuServe Incorporated.\"\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n\n#ifdef GIF_SUPPORTED\n\n/*\n * The module selection routine for GIF format input.\n */\n\nGLOBAL(cjpeg_source_ptr)\njinit_read_gif (j_compress_ptr cinfo)\n{\n  fprintf(stderr, \"GIF input is unsupported for legal reasons.  Sorry.\\n\");\n  exit(EXIT_FAILURE);\n  return NULL;\t\t\t/* keep compiler happy */\n}\n\n#endif /* GIF_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/rdjpgcom.1",
    "content": ".TH RDJPGCOM 1 \"02 April 2009\"\n.SH NAME\nrdjpgcom \\- display text comments from a JPEG file\n.SH SYNOPSIS\n.B rdjpgcom\n[\n.B \\-raw\n]\n[\n.B \\-verbose\n]\n[\n.I filename\n]\n.LP\n.SH DESCRIPTION\n.LP\n.B rdjpgcom\nreads the named JPEG/JFIF file, or the standard input if no file is named,\nand prints any text comments found in the file on the standard output.\n.PP\nThe JPEG standard allows \"comment\" (COM) blocks to occur within a JPEG file.\nAlthough the standard doesn't actually define what COM blocks are for, they\nare widely used to hold user-supplied text strings.  This lets you add\nannotations, titles, index terms, etc to your JPEG files, and later retrieve\nthem as text.  COM blocks do not interfere with the image stored in the JPEG\nfile.  The maximum size of a COM block is 64K, but you can have as many of\nthem as you like in one JPEG file.\n.SH OPTIONS\n.TP\n.B \\-raw\nNormally\n.B rdjpgcom\nescapes non-printable characters in comments, for security reasons.\nThis option avoids that.\n.PP\n.B \\-verbose\nCauses\n.B rdjpgcom\nto also display the JPEG image dimensions.\n.PP\nSwitch names may be abbreviated, and are not case sensitive.\n.SH HINTS\n.B rdjpgcom\ndoes not depend on the IJG JPEG library.  Its source code is intended as an\nillustration of the minimum amount of code required to parse a JPEG file\nheader correctly.\n.PP\nIn\n.B \\-verbose\nmode,\n.B rdjpgcom\nwill also attempt to print the contents of any \"APP12\" markers as text.\nSome digital cameras produce APP12 markers containing useful textual\ninformation.  If you like, you can modify the source code to print\nother APPn marker types as well.\n.SH SEE ALSO\n.BR cjpeg (1),\n.BR djpeg (1),\n.BR jpegtran (1),\n.BR wrjpgcom (1)\n.SH AUTHOR\nIndependent JPEG Group\n"
  },
  {
    "path": "ext/libjpeg-turbo/rdjpgcom.c",
    "content": "/*\n * rdjpgcom.c\n *\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * Modified 2009 by Bill Allombert, Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains a very simple stand-alone application that displays\n * the text in COM (comment) markers in a JFIF file.\n * This may be useful as an example of the minimum logic needed to parse\n * JPEG markers.\n */\n\n#define JPEG_CJPEG_DJPEG\t/* to get the command-line config symbols */\n#include \"jinclude.h\"\t\t/* get auto-config symbols, <stdio.h> */\n\n#ifdef HAVE_LOCALE_H\n#include <locale.h>\t\t/* Bill Allombert: use locale for isprint */\n#endif\n#include <ctype.h>\t\t/* to declare isupper(), tolower() */\n#ifdef USE_SETMODE\n#include <fcntl.h>\t\t/* to declare setmode()'s parameter macros */\n/* If you have setmode() but not <io.h>, just delete this line: */\n#include <io.h>\t\t\t/* to declare setmode() */\n#endif\n\n#ifdef USE_CCOMMAND\t\t/* command-line reader for Macintosh */\n#ifdef __MWERKS__\n#include <SIOUX.h>              /* Metrowerks needs this */\n#include <console.h>\t\t/* ... and this */\n#endif\n#ifdef THINK_C\n#include <console.h>\t\t/* Think declares it here */\n#endif\n#endif\n\n#ifdef DONT_USE_B_MODE\t\t/* define mode parameters for fopen() */\n#define READ_BINARY\t\"r\"\n#else\n#ifdef VMS\t\t\t/* VMS is very nonstandard */\n#define READ_BINARY\t\"rb\", \"ctx=stm\"\n#else\t\t\t\t/* standard ANSI-compliant case */\n#define READ_BINARY\t\"rb\"\n#endif\n#endif\n\n#ifndef EXIT_FAILURE\t\t/* define exit() codes if not provided */\n#define EXIT_FAILURE  1\n#endif\n#ifndef EXIT_SUCCESS\n#ifdef VMS\n#define EXIT_SUCCESS  1\t\t/* VMS is very nonstandard */\n#else\n#define EXIT_SUCCESS  0\n#endif\n#endif\n\n\n/*\n * These macros are used to read the input file.\n * To reuse this code in another application, you might need to change these.\n */\n\nstatic FILE * infile;\t\t/* input JPEG file */\n\n/* Return next input byte, or EOF if no more */\n#define NEXTBYTE()  getc(infile)\n\n\n/* Error exit handler */\n#define ERREXIT(msg)  (fprintf(stderr, \"%s\\n\", msg), exit(EXIT_FAILURE))\n\n\n/* Read one byte, testing for EOF */\nstatic int\nread_1_byte (void)\n{\n  int c;\n\n  c = NEXTBYTE();\n  if (c == EOF)\n    ERREXIT(\"Premature EOF in JPEG file\");\n  return c;\n}\n\n/* Read 2 bytes, convert to unsigned int */\n/* All 2-byte quantities in JPEG markers are MSB first */\nstatic unsigned int\nread_2_bytes (void)\n{\n  int c1, c2;\n\n  c1 = NEXTBYTE();\n  if (c1 == EOF)\n    ERREXIT(\"Premature EOF in JPEG file\");\n  c2 = NEXTBYTE();\n  if (c2 == EOF)\n    ERREXIT(\"Premature EOF in JPEG file\");\n  return (((unsigned int) c1) << 8) + ((unsigned int) c2);\n}\n\n\n/*\n * JPEG markers consist of one or more 0xFF bytes, followed by a marker\n * code byte (which is not an FF).  Here are the marker codes of interest\n * in this program.  (See jdmarker.c for a more complete list.)\n */\n\n#define M_SOF0  0xC0\t\t/* Start Of Frame N */\n#define M_SOF1  0xC1\t\t/* N indicates which compression process */\n#define M_SOF2  0xC2\t\t/* Only SOF0-SOF2 are now in common use */\n#define M_SOF3  0xC3\n#define M_SOF5  0xC5\t\t/* NB: codes C4 and CC are NOT SOF markers */\n#define M_SOF6  0xC6\n#define M_SOF7  0xC7\n#define M_SOF9  0xC9\n#define M_SOF10 0xCA\n#define M_SOF11 0xCB\n#define M_SOF13 0xCD\n#define M_SOF14 0xCE\n#define M_SOF15 0xCF\n#define M_SOI   0xD8\t\t/* Start Of Image (beginning of datastream) */\n#define M_EOI   0xD9\t\t/* End Of Image (end of datastream) */\n#define M_SOS   0xDA\t\t/* Start Of Scan (begins compressed data) */\n#define M_APP0\t0xE0\t\t/* Application-specific marker, type N */\n#define M_APP12\t0xEC\t\t/* (we don't bother to list all 16 APPn's) */\n#define M_COM   0xFE\t\t/* COMment */\n\n\n/*\n * Find the next JPEG marker and return its marker code.\n * We expect at least one FF byte, possibly more if the compressor used FFs\n * to pad the file.\n * There could also be non-FF garbage between markers.  The treatment of such\n * garbage is unspecified; we choose to skip over it but emit a warning msg.\n * NB: this routine must not be used after seeing SOS marker, since it will\n * not deal correctly with FF/00 sequences in the compressed image data...\n */\n\nstatic int\nnext_marker (void)\n{\n  int c;\n  int discarded_bytes = 0;\n\n  /* Find 0xFF byte; count and skip any non-FFs. */\n  c = read_1_byte();\n  while (c != 0xFF) {\n    discarded_bytes++;\n    c = read_1_byte();\n  }\n  /* Get marker code byte, swallowing any duplicate FF bytes.  Extra FFs\n   * are legal as pad bytes, so don't count them in discarded_bytes.\n   */\n  do {\n    c = read_1_byte();\n  } while (c == 0xFF);\n\n  if (discarded_bytes != 0) {\n    fprintf(stderr, \"Warning: garbage data found in JPEG file\\n\");\n  }\n\n  return c;\n}\n\n\n/*\n * Read the initial marker, which should be SOI.\n * For a JFIF file, the first two bytes of the file should be literally\n * 0xFF M_SOI.  To be more general, we could use next_marker, but if the\n * input file weren't actually JPEG at all, next_marker might read the whole\n * file and then return a misleading error message...\n */\n\nstatic int\nfirst_marker (void)\n{\n  int c1, c2;\n\n  c1 = NEXTBYTE();\n  c2 = NEXTBYTE();\n  if (c1 != 0xFF || c2 != M_SOI)\n    ERREXIT(\"Not a JPEG file\");\n  return c2;\n}\n\n\n/*\n * Most types of marker are followed by a variable-length parameter segment.\n * This routine skips over the parameters for any marker we don't otherwise\n * want to process.\n * Note that we MUST skip the parameter segment explicitly in order not to\n * be fooled by 0xFF bytes that might appear within the parameter segment;\n * such bytes do NOT introduce new markers.\n */\n\nstatic void\nskip_variable (void)\n/* Skip over an unknown or uninteresting variable-length marker */\n{\n  unsigned int length;\n\n  /* Get the marker parameter length count */\n  length = read_2_bytes();\n  /* Length includes itself, so must be at least 2 */\n  if (length < 2)\n    ERREXIT(\"Erroneous JPEG marker length\");\n  length -= 2;\n  /* Skip over the remaining bytes */\n  while (length > 0) {\n    (void) read_1_byte();\n    length--;\n  }\n}\n\n\n/*\n * Process a COM marker.\n * We want to print out the marker contents as legible text;\n * we must guard against non-text junk and varying newline representations.\n */\n\nstatic void\nprocess_COM (int raw)\n{\n  unsigned int length;\n  int ch;\n  int lastch = 0;\n\n  /* Bill Allombert: set locale properly for isprint */\n#ifdef HAVE_LOCALE_H\n  setlocale(LC_CTYPE, \"\");\n#endif\n\n  /* Get the marker parameter length count */\n  length = read_2_bytes();\n  /* Length includes itself, so must be at least 2 */\n  if (length < 2)\n    ERREXIT(\"Erroneous JPEG marker length\");\n  length -= 2;\n\n  while (length > 0) {\n    ch = read_1_byte();\n    if (raw) {\n      putc(ch, stdout);\n    /* Emit the character in a readable form.\n     * Nonprintables are converted to \\nnn form,\n     * while \\ is converted to \\\\.\n     * Newlines in CR, CR/LF, or LF form will be printed as one newline.\n     */\n    } else if (ch == '\\r') {\n      printf(\"\\n\");\n    } else if (ch == '\\n') {\n      if (lastch != '\\r')\n\tprintf(\"\\n\");\n    } else if (ch == '\\\\') {\n      printf(\"\\\\\\\\\");\n    } else if (isprint(ch)) {\n      putc(ch, stdout);\n    } else {\n      printf(\"\\\\%03o\", ch);\n    }\n    lastch = ch;\n    length--;\n  }\n  printf(\"\\n\");\n\n  /* Bill Allombert: revert to C locale */\n#ifdef HAVE_LOCALE_H\n  setlocale(LC_CTYPE, \"C\");\n#endif\n}\n\n\n/*\n * Process a SOFn marker.\n * This code is only needed if you want to know the image dimensions...\n */\n\nstatic void\nprocess_SOFn (int marker)\n{\n  unsigned int length;\n  unsigned int image_height, image_width;\n  int data_precision, num_components;\n  const char * process;\n  int ci;\n\n  length = read_2_bytes();\t/* usual parameter length count */\n\n  data_precision = read_1_byte();\n  image_height = read_2_bytes();\n  image_width = read_2_bytes();\n  num_components = read_1_byte();\n\n  switch (marker) {\n  case M_SOF0:\tprocess = \"Baseline\";  break;\n  case M_SOF1:\tprocess = \"Extended sequential\";  break;\n  case M_SOF2:\tprocess = \"Progressive\";  break;\n  case M_SOF3:\tprocess = \"Lossless\";  break;\n  case M_SOF5:\tprocess = \"Differential sequential\";  break;\n  case M_SOF6:\tprocess = \"Differential progressive\";  break;\n  case M_SOF7:\tprocess = \"Differential lossless\";  break;\n  case M_SOF9:\tprocess = \"Extended sequential, arithmetic coding\";  break;\n  case M_SOF10:\tprocess = \"Progressive, arithmetic coding\";  break;\n  case M_SOF11:\tprocess = \"Lossless, arithmetic coding\";  break;\n  case M_SOF13:\tprocess = \"Differential sequential, arithmetic coding\";  break;\n  case M_SOF14:\tprocess = \"Differential progressive, arithmetic coding\"; break;\n  case M_SOF15:\tprocess = \"Differential lossless, arithmetic coding\";  break;\n  default:\tprocess = \"Unknown\";  break;\n  }\n\n  printf(\"JPEG image is %uw * %uh, %d color components, %d bits per sample\\n\",\n\t image_width, image_height, num_components, data_precision);\n  printf(\"JPEG process: %s\\n\", process);\n\n  if (length != (unsigned int) (8 + num_components * 3))\n    ERREXIT(\"Bogus SOF marker length\");\n\n  for (ci = 0; ci < num_components; ci++) {\n    (void) read_1_byte();\t/* Component ID code */\n    (void) read_1_byte();\t/* H, V sampling factors */\n    (void) read_1_byte();\t/* Quantization table number */\n  }\n}\n\n\n/*\n * Parse the marker stream until SOS or EOI is seen;\n * display any COM markers.\n * While the companion program wrjpgcom will always insert COM markers before\n * SOFn, other implementations might not, so we scan to SOS before stopping.\n * If we were only interested in the image dimensions, we would stop at SOFn.\n * (Conversely, if we only cared about COM markers, there would be no need\n * for special code to handle SOFn; we could treat it like other markers.)\n */\n\nstatic int\nscan_JPEG_header (int verbose, int raw)\n{\n  int marker;\n\n  /* Expect SOI at start of file */\n  if (first_marker() != M_SOI)\n    ERREXIT(\"Expected SOI marker first\");\n\n  /* Scan miscellaneous markers until we reach SOS. */\n  for (;;) {\n    marker = next_marker();\n    switch (marker) {\n      /* Note that marker codes 0xC4, 0xC8, 0xCC are not, and must not be,\n       * treated as SOFn.  C4 in particular is actually DHT.\n       */\n    case M_SOF0:\t\t/* Baseline */\n    case M_SOF1:\t\t/* Extended sequential, Huffman */\n    case M_SOF2:\t\t/* Progressive, Huffman */\n    case M_SOF3:\t\t/* Lossless, Huffman */\n    case M_SOF5:\t\t/* Differential sequential, Huffman */\n    case M_SOF6:\t\t/* Differential progressive, Huffman */\n    case M_SOF7:\t\t/* Differential lossless, Huffman */\n    case M_SOF9:\t\t/* Extended sequential, arithmetic */\n    case M_SOF10:\t\t/* Progressive, arithmetic */\n    case M_SOF11:\t\t/* Lossless, arithmetic */\n    case M_SOF13:\t\t/* Differential sequential, arithmetic */\n    case M_SOF14:\t\t/* Differential progressive, arithmetic */\n    case M_SOF15:\t\t/* Differential lossless, arithmetic */\n      if (verbose)\n\tprocess_SOFn(marker);\n      else\n\tskip_variable();\n      break;\n\n    case M_SOS:\t\t\t/* stop before hitting compressed data */\n      return marker;\n\n    case M_EOI:\t\t\t/* in case it's a tables-only JPEG stream */\n      return marker;\n\n    case M_COM:\n      process_COM(raw);\n      break;\n\n    case M_APP12:\n      /* Some digital camera makers put useful textual information into\n       * APP12 markers, so we print those out too when in -verbose mode.\n       */\n      if (verbose) {\n\tprintf(\"APP12 contains:\\n\");\n\tprocess_COM(raw);\n      } else\n\tskip_variable();\n      break;\n\n    default:\t\t\t/* Anything else just gets skipped */\n      skip_variable();\t\t/* we assume it has a parameter count... */\n      break;\n    }\n  } /* end loop */\n}\n\n\n/* Command line parsing code */\n\nstatic const char * progname;\t/* program name for error messages */\n\n\nstatic void\nusage (void)\n/* complain about bad command line */\n{\n  fprintf(stderr, \"rdjpgcom displays any textual comments in a JPEG file.\\n\");\n\n  fprintf(stderr, \"Usage: %s [switches] [inputfile]\\n\", progname);\n\n  fprintf(stderr, \"Switches (names may be abbreviated):\\n\");\n  fprintf(stderr, \"  -raw        Display non-printable characters in comments (unsafe)\\n\");\n  fprintf(stderr, \"  -verbose    Also display dimensions of JPEG image\\n\");\n\n  exit(EXIT_FAILURE);\n}\n\n\nstatic int\nkeymatch (char * arg, const char * keyword, int minchars)\n/* Case-insensitive matching of (possibly abbreviated) keyword switches. */\n/* keyword is the constant keyword (must be lower case already), */\n/* minchars is length of minimum legal abbreviation. */\n{\n  register int ca, ck;\n  register int nmatched = 0;\n\n  while ((ca = *arg++) != '\\0') {\n    if ((ck = *keyword++) == '\\0')\n      return 0;\t\t\t/* arg longer than keyword, no good */\n    if (isupper(ca))\t\t/* force arg to lcase (assume ck is already) */\n      ca = tolower(ca);\n    if (ca != ck)\n      return 0;\t\t\t/* no good */\n    nmatched++;\t\t\t/* count matched characters */\n  }\n  /* reached end of argument; fail if it's too short for unique abbrev */\n  if (nmatched < minchars)\n    return 0;\n  return 1;\t\t\t/* A-OK */\n}\n\n\n/*\n * The main program.\n */\n\nint\nmain (int argc, char **argv)\n{\n  int argn;\n  char * arg;\n  int verbose = 0, raw = 0;\n\n  /* On Mac, fetch a command line. */\n#ifdef USE_CCOMMAND\n  argc = ccommand(&argv);\n#endif\n\n  progname = argv[0];\n  if (progname == NULL || progname[0] == 0)\n    progname = \"rdjpgcom\";\t/* in case C library doesn't provide it */\n\n  /* Parse switches, if any */\n  for (argn = 1; argn < argc; argn++) {\n    arg = argv[argn];\n    if (arg[0] != '-')\n      break;\t\t\t/* not switch, must be file name */\n    arg++;\t\t\t/* advance over '-' */\n    if (keymatch(arg, \"verbose\", 1)) {\n      verbose++;\n    } else if (keymatch(arg, \"raw\", 1)) {\n      raw = 1;\n    } else\n      usage();\n  }\n\n  /* Open the input file. */\n  /* Unix style: expect zero or one file name */\n  if (argn < argc-1) {\n    fprintf(stderr, \"%s: only one input file\\n\", progname);\n    usage();\n  }\n  if (argn < argc) {\n    if ((infile = fopen(argv[argn], READ_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s\\n\", progname, argv[argn]);\n      exit(EXIT_FAILURE);\n    }\n  } else {\n    /* default input file is stdin */\n#ifdef USE_SETMODE\t\t/* need to hack file mode? */\n    setmode(fileno(stdin), O_BINARY);\n#endif\n#ifdef USE_FDOPEN\t\t/* need to re-open in binary mode? */\n    if ((infile = fdopen(fileno(stdin), READ_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open stdin\\n\", progname);\n      exit(EXIT_FAILURE);\n    }\n#else\n    infile = stdin;\n#endif\n  }\n\n  /* Scan the JPEG headers. */\n  (void) scan_JPEG_header(verbose, raw);\n\n  /* All done. */\n  exit(EXIT_SUCCESS);\n  return 0;\t\t\t/* suppress no-return-value warnings */\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/rdppm.c",
    "content": "/*\n * rdppm.c\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * Modified 2009 by Bill Allombert, Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to read input images in PPM/PGM format.\n * The extended 2-byte-per-sample raw PPM/PGM formats are supported.\n * The PBMPLUS library is NOT required to compile this software\n * (but it is highly useful as a set of PPM image manipulation programs).\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume input from\n * an ordinary stdio stream.  They further assume that reading begins\n * at the start of the file; start_input may need work if the\n * user interface has already read some data (e.g., to determine that\n * the file is indeed PPM format).\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n\n#ifdef PPM_SUPPORTED\n\n\n/* Portions of this code are based on the PBMPLUS library, which is:\n**\n** Copyright (C) 1988 by Jef Poskanzer.\n**\n** Permission to use, copy, modify, and distribute this software and its\n** documentation for any purpose and without fee is hereby granted, provided\n** that the above copyright notice appear in all copies and that both that\n** copyright notice and this permission notice appear in supporting\n** documentation.  This software is provided \"as is\" without express or\n** implied warranty.\n*/\n\n\n/* Macros to deal with unsigned chars as efficiently as compiler allows */\n\n#ifdef HAVE_UNSIGNED_CHAR\ntypedef unsigned char U_CHAR;\n#define UCH(x)\t((int) (x))\n#else /* !HAVE_UNSIGNED_CHAR */\n#ifdef CHAR_IS_UNSIGNED\ntypedef char U_CHAR;\n#define UCH(x)\t((int) (x))\n#else\ntypedef char U_CHAR;\n#define UCH(x)\t((int) (x) & 0xFF)\n#endif\n#endif /* HAVE_UNSIGNED_CHAR */\n\n\n#define\tReadOK(file,buffer,len)\t(JFREAD(file,buffer,len) == ((size_t) (len)))\n\n\n/*\n * On most systems, reading individual bytes with getc() is drastically less\n * efficient than buffering a row at a time with fread().  On PCs, we must\n * allocate the buffer in near data space, because we are assuming small-data\n * memory model, wherein fread() can't reach far memory.  If you need to\n * process very wide images on a PC, you might have to compile in large-memory\n * model, or else replace fread() with a getc() loop --- which will be much\n * slower.\n */\n\n\n/* Private version of data source object */\n\ntypedef struct {\n  struct cjpeg_source_struct pub; /* public fields */\n\n  U_CHAR *iobuffer;\t\t/* non-FAR pointer to I/O buffer */\n  JSAMPROW pixrow;\t\t/* FAR pointer to same */\n  size_t buffer_width;\t\t/* width of I/O buffer */\n  JSAMPLE *rescale;\t\t/* => maxval-remapping array, or NULL */\n} ppm_source_struct;\n\ntypedef ppm_source_struct * ppm_source_ptr;\n\n\nLOCAL(int)\npbm_getc (FILE * infile)\n/* Read next char, skipping over any comments */\n/* A comment/newline sequence is returned as a newline */\n{\n  register int ch;\n\n  ch = getc(infile);\n  if (ch == '#') {\n    do {\n      ch = getc(infile);\n    } while (ch != '\\n' && ch != EOF);\n  }\n  return ch;\n}\n\n\nLOCAL(unsigned int)\nread_pbm_integer (j_compress_ptr cinfo, FILE * infile)\n/* Read an unsigned decimal integer from the PPM file */\n/* Swallows one trailing character after the integer */\n/* Note that on a 16-bit-int machine, only values up to 64k can be read. */\n/* This should not be a problem in practice. */\n{\n  register int ch;\n  register unsigned int val;\n\n  /* Skip any leading whitespace */\n  do {\n    ch = pbm_getc(infile);\n    if (ch == EOF)\n      ERREXIT(cinfo, JERR_INPUT_EOF);\n  } while (ch == ' ' || ch == '\\t' || ch == '\\n' || ch == '\\r');\n\n  if (ch < '0' || ch > '9')\n    ERREXIT(cinfo, JERR_PPM_NONNUMERIC);\n\n  val = ch - '0';\n  while ((ch = pbm_getc(infile)) >= '0' && ch <= '9') {\n    val *= 10;\n    val += ch - '0';\n  }\n  return val;\n}\n\n\n/*\n * Read one row of pixels.\n *\n * We provide several different versions depending on input file format.\n * In all cases, input is scaled to the size of JSAMPLE.\n *\n * A really fast path is provided for reading byte/sample raw files with\n * maxval = MAXJSAMPLE, which is the normal case for 8-bit data.\n */\n\n\nMETHODDEF(JDIMENSION)\nget_text_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading text-format PGM files with any maxval */\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n  FILE * infile = source->pub.input_file;\n  register JSAMPROW ptr;\n  register JSAMPLE *rescale = source->rescale;\n  JDIMENSION col;\n\n  ptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    *ptr++ = rescale[read_pbm_integer(cinfo, infile)];\n  }\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_text_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading text-format PPM files with any maxval */\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n  FILE * infile = source->pub.input_file;\n  register JSAMPROW ptr;\n  register JSAMPLE *rescale = source->rescale;\n  JDIMENSION col;\n\n  ptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    *ptr++ = rescale[read_pbm_integer(cinfo, infile)];\n    *ptr++ = rescale[read_pbm_integer(cinfo, infile)];\n    *ptr++ = rescale[read_pbm_integer(cinfo, infile)];\n  }\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_scaled_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading raw-byte-format PGM files with any maxval */\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n  register JSAMPROW ptr;\n  register U_CHAR * bufferptr;\n  register JSAMPLE *rescale = source->rescale;\n  JDIMENSION col;\n\n  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n  ptr = source->pub.buffer[0];\n  bufferptr = source->iobuffer;\n  for (col = cinfo->image_width; col > 0; col--) {\n    *ptr++ = rescale[UCH(*bufferptr++)];\n  }\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_scaled_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading raw-byte-format PPM files with any maxval */\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n  register JSAMPROW ptr;\n  register U_CHAR * bufferptr;\n  register JSAMPLE *rescale = source->rescale;\n  JDIMENSION col;\n\n  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n  ptr = source->pub.buffer[0];\n  bufferptr = source->iobuffer;\n  for (col = cinfo->image_width; col > 0; col--) {\n    *ptr++ = rescale[UCH(*bufferptr++)];\n    *ptr++ = rescale[UCH(*bufferptr++)];\n    *ptr++ = rescale[UCH(*bufferptr++)];\n  }\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_raw_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading raw-byte-format files with maxval = MAXJSAMPLE.\n * In this case we just read right into the JSAMPLE buffer!\n * Note that same code works for PPM and PGM files.\n */\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n\n  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_word_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading raw-word-format PGM files with any maxval */\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n  register JSAMPROW ptr;\n  register U_CHAR * bufferptr;\n  register JSAMPLE *rescale = source->rescale;\n  JDIMENSION col;\n\n  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n  ptr = source->pub.buffer[0];\n  bufferptr = source->iobuffer;\n  for (col = cinfo->image_width; col > 0; col--) {\n    register int temp;\n    temp  = UCH(*bufferptr++) << 8;\n    temp |= UCH(*bufferptr++);\n    *ptr++ = rescale[temp];\n  }\n  return 1;\n}\n\n\nMETHODDEF(JDIMENSION)\nget_word_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading raw-word-format PPM files with any maxval */\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n  register JSAMPROW ptr;\n  register U_CHAR * bufferptr;\n  register JSAMPLE *rescale = source->rescale;\n  JDIMENSION col;\n\n  if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n  ptr = source->pub.buffer[0];\n  bufferptr = source->iobuffer;\n  for (col = cinfo->image_width; col > 0; col--) {\n    register int temp;\n    temp  = UCH(*bufferptr++) << 8;\n    temp |= UCH(*bufferptr++);\n    *ptr++ = rescale[temp];\n    temp  = UCH(*bufferptr++) << 8;\n    temp |= UCH(*bufferptr++);\n    *ptr++ = rescale[temp];\n    temp  = UCH(*bufferptr++) << 8;\n    temp |= UCH(*bufferptr++);\n    *ptr++ = rescale[temp];\n  }\n  return 1;\n}\n\n\n/*\n * Read the file header; return image size and component count.\n */\n\nMETHODDEF(void)\nstart_input_ppm (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  ppm_source_ptr source = (ppm_source_ptr) sinfo;\n  int c;\n  unsigned int w, h, maxval;\n  boolean need_iobuffer, use_raw_buffer, need_rescale;\n\n  if (getc(source->pub.input_file) != 'P')\n    ERREXIT(cinfo, JERR_PPM_NOT);\n\n  c = getc(source->pub.input_file); /* subformat discriminator character */\n\n  /* detect unsupported variants (ie, PBM) before trying to read header */\n  switch (c) {\n  case '2':\t\t\t/* it's a text-format PGM file */\n  case '3':\t\t\t/* it's a text-format PPM file */\n  case '5':\t\t\t/* it's a raw-format PGM file */\n  case '6':\t\t\t/* it's a raw-format PPM file */\n    break;\n  default:\n    ERREXIT(cinfo, JERR_PPM_NOT);\n    break;\n  }\n\n  /* fetch the remaining header info */\n  w = read_pbm_integer(cinfo, source->pub.input_file);\n  h = read_pbm_integer(cinfo, source->pub.input_file);\n  maxval = read_pbm_integer(cinfo, source->pub.input_file);\n\n  if (w <= 0 || h <= 0 || maxval <= 0) /* error check */\n    ERREXIT(cinfo, JERR_PPM_NOT);\n\n  cinfo->data_precision = BITS_IN_JSAMPLE; /* we always rescale data to this */\n  cinfo->image_width = (JDIMENSION) w;\n  cinfo->image_height = (JDIMENSION) h;\n\n  /* initialize flags to most common settings */\n  need_iobuffer = TRUE;\t\t/* do we need an I/O buffer? */\n  use_raw_buffer = FALSE;\t/* do we map input buffer onto I/O buffer? */\n  need_rescale = TRUE;\t\t/* do we need a rescale array? */\n\n  switch (c) {\n  case '2':\t\t\t/* it's a text-format PGM file */\n    cinfo->input_components = 1;\n    cinfo->in_color_space = JCS_GRAYSCALE;\n    TRACEMS2(cinfo, 1, JTRC_PGM_TEXT, w, h);\n    source->pub.get_pixel_rows = get_text_gray_row;\n    need_iobuffer = FALSE;\n    break;\n\n  case '3':\t\t\t/* it's a text-format PPM file */\n    cinfo->input_components = 3;\n    cinfo->in_color_space = JCS_RGB;\n    TRACEMS2(cinfo, 1, JTRC_PPM_TEXT, w, h);\n    source->pub.get_pixel_rows = get_text_rgb_row;\n    need_iobuffer = FALSE;\n    break;\n\n  case '5':\t\t\t/* it's a raw-format PGM file */\n    cinfo->input_components = 1;\n    cinfo->in_color_space = JCS_GRAYSCALE;\n    TRACEMS2(cinfo, 1, JTRC_PGM, w, h);\n    if (maxval > 255) {\n      source->pub.get_pixel_rows = get_word_gray_row;\n    } else if (maxval == MAXJSAMPLE && SIZEOF(JSAMPLE) == SIZEOF(U_CHAR)) {\n      source->pub.get_pixel_rows = get_raw_row;\n      use_raw_buffer = TRUE;\n      need_rescale = FALSE;\n    } else {\n      source->pub.get_pixel_rows = get_scaled_gray_row;\n    }\n    break;\n\n  case '6':\t\t\t/* it's a raw-format PPM file */\n    cinfo->input_components = 3;\n    cinfo->in_color_space = JCS_RGB;\n    TRACEMS2(cinfo, 1, JTRC_PPM, w, h);\n    if (maxval > 255) {\n      source->pub.get_pixel_rows = get_word_rgb_row;\n    } else if (maxval == MAXJSAMPLE && SIZEOF(JSAMPLE) == SIZEOF(U_CHAR)) {\n      source->pub.get_pixel_rows = get_raw_row;\n      use_raw_buffer = TRUE;\n      need_rescale = FALSE;\n    } else {\n      source->pub.get_pixel_rows = get_scaled_rgb_row;\n    }\n    break;\n  }\n\n  /* Allocate space for I/O buffer: 1 or 3 bytes or words/pixel. */\n  if (need_iobuffer) {\n    source->buffer_width = (size_t) w * cinfo->input_components *\n      ((maxval<=255) ? SIZEOF(U_CHAR) : (2*SIZEOF(U_CHAR)));\n    source->iobuffer = (U_CHAR *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  source->buffer_width);\n  }\n\n  /* Create compressor input buffer. */\n  if (use_raw_buffer) {\n    /* For unscaled raw-input case, we can just map it onto the I/O buffer. */\n    /* Synthesize a JSAMPARRAY pointer structure */\n    /* Cast here implies near->far pointer conversion on PCs */\n    source->pixrow = (JSAMPROW) source->iobuffer;\n    source->pub.buffer = & source->pixrow;\n    source->pub.buffer_height = 1;\n  } else {\n    /* Need to translate anyway, so make a separate sample buffer. */\n    source->pub.buffer = (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       (JDIMENSION) w * cinfo->input_components, (JDIMENSION) 1);\n    source->pub.buffer_height = 1;\n  }\n\n  /* Compute the rescaling array if required. */\n  if (need_rescale) {\n    INT32 val, half_maxval;\n\n    /* On 16-bit-int machines we have to be careful of maxval = 65535 */\n    source->rescale = (JSAMPLE *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  (size_t) (((long) maxval + 1L) * SIZEOF(JSAMPLE)));\n    half_maxval = maxval / 2;\n    for (val = 0; val <= (INT32) maxval; val++) {\n      /* The multiplication here must be done in 32 bits to avoid overflow */\n      source->rescale[val] = (JSAMPLE) ((val*MAXJSAMPLE + half_maxval)/maxval);\n    }\n  }\n}\n\n\n/*\n * Finish up at the end of the file.\n */\n\nMETHODDEF(void)\nfinish_input_ppm (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  /* no work */\n}\n\n\n/*\n * The module selection routine for PPM format input.\n */\n\nGLOBAL(cjpeg_source_ptr)\njinit_read_ppm (j_compress_ptr cinfo)\n{\n  ppm_source_ptr source;\n\n  /* Create module interface object */\n  source = (ppm_source_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(ppm_source_struct));\n  /* Fill in method ptrs, except get_pixel_rows which start_input sets */\n  source->pub.start_input = start_input_ppm;\n  source->pub.finish_input = finish_input_ppm;\n\n  return (cjpeg_source_ptr) source;\n}\n\n#endif /* PPM_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/rdrle.c",
    "content": "/*\n * rdrle.c\n *\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to read input images in Utah RLE format.\n * The Utah Raster Toolkit library is required (version 3.1 or later).\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume input from\n * an ordinary stdio stream.  They further assume that reading begins\n * at the start of the file; start_input may need work if the\n * user interface has already read some data (e.g., to determine that\n * the file is indeed RLE format).\n *\n * Based on code contributed by Mike Lijewski,\n * with updates from Robert Hutchinson.\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n\n#ifdef RLE_SUPPORTED\n\n/* rle.h is provided by the Utah Raster Toolkit. */\n\n#include <rle.h>\n\n/*\n * We assume that JSAMPLE has the same representation as rle_pixel,\n * to wit, \"unsigned char\".  Hence we can't cope with 12- or 16-bit samples.\n */\n\n#if BITS_IN_JSAMPLE != 8\n  Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */\n#endif\n\n/*\n * We support the following types of RLE files:\n *   \n *   GRAYSCALE   - 8 bits, no colormap\n *   MAPPEDGRAY  - 8 bits, 1 channel colomap\n *   PSEUDOCOLOR - 8 bits, 3 channel colormap\n *   TRUECOLOR   - 24 bits, 3 channel colormap\n *   DIRECTCOLOR - 24 bits, no colormap\n *\n * For now, we ignore any alpha channel in the image.\n */\n\ntypedef enum\n  { GRAYSCALE, MAPPEDGRAY, PSEUDOCOLOR, TRUECOLOR, DIRECTCOLOR } rle_kind;\n\n\n/*\n * Since RLE stores scanlines bottom-to-top, we have to invert the image\n * to conform to JPEG's top-to-bottom order.  To do this, we read the\n * incoming image into a virtual array on the first get_pixel_rows call,\n * then fetch the required row from the virtual array on subsequent calls.\n */\n\ntypedef struct _rle_source_struct * rle_source_ptr;\n\ntypedef struct _rle_source_struct {\n  struct cjpeg_source_struct pub; /* public fields */\n\n  rle_kind visual;              /* actual type of input file */\n  jvirt_sarray_ptr image;       /* virtual array to hold the image */\n  JDIMENSION row;\t\t/* current row # in the virtual array */\n  rle_hdr header;               /* Input file information */\n  rle_pixel** rle_row;          /* holds a row returned by rle_getrow() */\n\n} rle_source_struct;\n\n\n/*\n * Read the file header; return image size and component count.\n */\n\nMETHODDEF(void)\nstart_input_rle (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  rle_source_ptr source = (rle_source_ptr) sinfo;\n  JDIMENSION width, height;\n#ifdef PROGRESS_REPORT\n  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n#endif\n\n  /* Use RLE library routine to get the header info */\n  source->header = *rle_hdr_init(NULL);\n  source->header.rle_file = source->pub.input_file;\n  switch (rle_get_setup(&(source->header))) {\n  case RLE_SUCCESS:\n    /* A-OK */\n    break;\n  case RLE_NOT_RLE:\n    ERREXIT(cinfo, JERR_RLE_NOT);\n    break;\n  case RLE_NO_SPACE:\n    ERREXIT(cinfo, JERR_RLE_MEM);\n    break;\n  case RLE_EMPTY:\n    ERREXIT(cinfo, JERR_RLE_EMPTY);\n    break;\n  case RLE_EOF:\n    ERREXIT(cinfo, JERR_RLE_EOF);\n    break;\n  default:\n    ERREXIT(cinfo, JERR_RLE_BADERROR);\n    break;\n  }\n\n  /* Figure out what we have, set private vars and return values accordingly */\n  \n  width  = source->header.xmax - source->header.xmin + 1;\n  height = source->header.ymax - source->header.ymin + 1;\n  source->header.xmin = 0;\t\t/* realign horizontally */\n  source->header.xmax = width-1;\n\n  cinfo->image_width      = width;\n  cinfo->image_height     = height;\n  cinfo->data_precision   = 8;  /* we can only handle 8 bit data */\n\n  if (source->header.ncolors == 1 && source->header.ncmap == 0) {\n    source->visual     = GRAYSCALE;\n    TRACEMS2(cinfo, 1, JTRC_RLE_GRAY, width, height);\n  } else if (source->header.ncolors == 1 && source->header.ncmap == 1) {\n    source->visual     = MAPPEDGRAY;\n    TRACEMS3(cinfo, 1, JTRC_RLE_MAPGRAY, width, height,\n             1 << source->header.cmaplen);\n  } else if (source->header.ncolors == 1 && source->header.ncmap == 3) {\n    source->visual     = PSEUDOCOLOR;\n    TRACEMS3(cinfo, 1, JTRC_RLE_MAPPED, width, height,\n\t     1 << source->header.cmaplen);\n  } else if (source->header.ncolors == 3 && source->header.ncmap == 3) {\n    source->visual     = TRUECOLOR;\n    TRACEMS3(cinfo, 1, JTRC_RLE_FULLMAP, width, height,\n\t     1 << source->header.cmaplen);\n  } else if (source->header.ncolors == 3 && source->header.ncmap == 0) {\n    source->visual     = DIRECTCOLOR;\n    TRACEMS2(cinfo, 1, JTRC_RLE, width, height);\n  } else\n    ERREXIT(cinfo, JERR_RLE_UNSUPPORTED);\n  \n  if (source->visual == GRAYSCALE || source->visual == MAPPEDGRAY) {\n    cinfo->in_color_space   = JCS_GRAYSCALE;\n    cinfo->input_components = 1;\n  } else {\n    cinfo->in_color_space   = JCS_RGB;\n    cinfo->input_components = 3;\n  }\n\n  /*\n   * A place to hold each scanline while it's converted.\n   * (GRAYSCALE scanlines don't need converting)\n   */\n  if (source->visual != GRAYSCALE) {\n    source->rle_row = (rle_pixel**) (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       (JDIMENSION) width, (JDIMENSION) cinfo->input_components);\n  }\n\n  /* request a virtual array to hold the image */\n  source->image = (*cinfo->mem->request_virt_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n     (JDIMENSION) (width * source->header.ncolors),\n     (JDIMENSION) height, (JDIMENSION) 1);\n\n#ifdef PROGRESS_REPORT\n  if (progress != NULL) {\n    /* count file input as separate pass */\n    progress->total_extra_passes++;\n  }\n#endif\n\n  source->pub.buffer_height = 1;\n}\n\n\n/*\n * Read one row of pixels.\n * Called only after load_image has read the image into the virtual array.\n * Used for GRAYSCALE, MAPPEDGRAY, TRUECOLOR, and DIRECTCOLOR images.\n */\n\nMETHODDEF(JDIMENSION)\nget_rle_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  rle_source_ptr source = (rle_source_ptr) sinfo;\n\n  source->row--;\n  source->pub.buffer = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, source->image, source->row, (JDIMENSION) 1, FALSE);\n\n  return 1;\n}\n\n/*\n * Read one row of pixels.\n * Called only after load_image has read the image into the virtual array.\n * Used for PSEUDOCOLOR images.\n */\n\nMETHODDEF(JDIMENSION)\nget_pseudocolor_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  rle_source_ptr source = (rle_source_ptr) sinfo;\n  JSAMPROW src_row, dest_row;\n  JDIMENSION col;\n  rle_map *colormap;\n  int val;\n\n  colormap = source->header.cmap;\n  dest_row = source->pub.buffer[0];\n  source->row--;\n  src_row = * (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, source->image, source->row, (JDIMENSION) 1, FALSE);\n\n  for (col = cinfo->image_width; col > 0; col--) {\n    val = GETJSAMPLE(*src_row++);\n    *dest_row++ = (JSAMPLE) (colormap[val      ] >> 8);\n    *dest_row++ = (JSAMPLE) (colormap[val + 256] >> 8);\n    *dest_row++ = (JSAMPLE) (colormap[val + 512] >> 8);\n  }\n\n  return 1;\n}\n\n\n/*\n * Load the image into a virtual array.  We have to do this because RLE\n * files start at the lower left while the JPEG standard has them starting\n * in the upper left.  This is called the first time we want to get a row\n * of input.  What we do is load the RLE data into the array and then call\n * the appropriate routine to read one row from the array.  Before returning,\n * we set source->pub.get_pixel_rows so that subsequent calls go straight to\n * the appropriate row-reading routine.\n */\n\nMETHODDEF(JDIMENSION)\nload_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  rle_source_ptr source = (rle_source_ptr) sinfo;\n  JDIMENSION row, col;\n  JSAMPROW  scanline, red_ptr, green_ptr, blue_ptr;\n  rle_pixel **rle_row;\n  rle_map *colormap;\n  char channel;\n#ifdef PROGRESS_REPORT\n  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n#endif\n\n  colormap = source->header.cmap;\n  rle_row = source->rle_row;\n\n  /* Read the RLE data into our virtual array.\n   * We assume here that (a) rle_pixel is represented the same as JSAMPLE,\n   * and (b) we are not on a machine where FAR pointers differ from regular.\n   */\n  RLE_CLR_BIT(source->header, RLE_ALPHA); /* don't read the alpha channel */\n\n#ifdef PROGRESS_REPORT\n  if (progress != NULL) {\n    progress->pub.pass_limit = cinfo->image_height;\n    progress->pub.pass_counter = 0;\n    (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n  }\n#endif\n\n  switch (source->visual) {\n\n  case GRAYSCALE:\n  case PSEUDOCOLOR:\n    for (row = 0; row < cinfo->image_height; row++) {\n      rle_row = (rle_pixel **) (*cinfo->mem->access_virt_sarray)\n         ((j_common_ptr) cinfo, source->image, row, (JDIMENSION) 1, TRUE);\n      rle_getrow(&source->header, rle_row);\n#ifdef PROGRESS_REPORT\n      if (progress != NULL) {\n        progress->pub.pass_counter++;\n        (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n      }\n#endif\n    }\n    break;\n\n  case MAPPEDGRAY:\n  case TRUECOLOR:\n    for (row = 0; row < cinfo->image_height; row++) {\n      scanline = * (*cinfo->mem->access_virt_sarray)\n        ((j_common_ptr) cinfo, source->image, row, (JDIMENSION) 1, TRUE);\n      rle_row = source->rle_row;\n      rle_getrow(&source->header, rle_row);\n\n      for (col = 0; col < cinfo->image_width; col++) {\n        for (channel = 0; channel < source->header.ncolors; channel++) {\n          *scanline++ = (JSAMPLE)\n            (colormap[GETJSAMPLE(rle_row[channel][col]) + 256 * channel] >> 8);\n        }\n      }\n\n#ifdef PROGRESS_REPORT\n      if (progress != NULL) {\n        progress->pub.pass_counter++;\n        (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n      }\n#endif\n    }\n    break;\n\n  case DIRECTCOLOR:\n    for (row = 0; row < cinfo->image_height; row++) {\n      scanline = * (*cinfo->mem->access_virt_sarray)\n        ((j_common_ptr) cinfo, source->image, row, (JDIMENSION) 1, TRUE);\n      rle_getrow(&source->header, rle_row);\n\n      red_ptr   = rle_row[0];\n      green_ptr = rle_row[1];\n      blue_ptr  = rle_row[2];\n\n      for (col = cinfo->image_width; col > 0; col--) {\n        *scanline++ = *red_ptr++;\n        *scanline++ = *green_ptr++;\n        *scanline++ = *blue_ptr++;\n      }\n\n#ifdef PROGRESS_REPORT\n      if (progress != NULL) {\n        progress->pub.pass_counter++;\n        (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n      }\n#endif\n    }\n  }\n\n#ifdef PROGRESS_REPORT\n  if (progress != NULL)\n    progress->completed_extra_passes++;\n#endif\n\n  /* Set up to call proper row-extraction routine in future */\n  if (source->visual == PSEUDOCOLOR) {\n    source->pub.buffer = source->rle_row;\n    source->pub.get_pixel_rows = get_pseudocolor_row;\n  } else {\n    source->pub.get_pixel_rows = get_rle_row;\n  }\n  source->row = cinfo->image_height;\n\n  /* And fetch the topmost (bottommost) row */\n  return (*source->pub.get_pixel_rows) (cinfo, sinfo);   \n}\n\n\n/*\n * Finish up at the end of the file.\n */\n\nMETHODDEF(void)\nfinish_input_rle (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  /* no work */\n}\n\n\n/*\n * The module selection routine for RLE format input.\n */\n\nGLOBAL(cjpeg_source_ptr)\njinit_read_rle (j_compress_ptr cinfo)\n{\n  rle_source_ptr source;\n\n  /* Create module interface object */\n  source = (rle_source_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  SIZEOF(rle_source_struct));\n  /* Fill in method ptrs */\n  source->pub.start_input = start_input_rle;\n  source->pub.finish_input = finish_input_rle;\n  source->pub.get_pixel_rows = load_image;\n\n  return (cjpeg_source_ptr) source;\n}\n\n#endif /* RLE_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/rdswitch.c",
    "content": "/*\n * rdswitch.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to process some of cjpeg's more complicated\n * command-line switches.  Switches processed here are:\n *\t-qtables file\t\tRead quantization tables from text file\n *\t-scans file\t\tRead scan script from text file\n *\t-quality N[,N,...]\tSet quality ratings\n *\t-qslots N[,N,...]\tSet component quantization table selectors\n *\t-sample HxV[,HxV,...]\tSet component sampling factors\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n#include <ctype.h>\t\t/* to declare isdigit(), isspace() */\n\n\nLOCAL(int)\ntext_getc (FILE * file)\n/* Read next char, skipping over any comments (# to end of line) */\n/* A comment/newline sequence is returned as a newline */\n{\n  register int ch;\n  \n  ch = getc(file);\n  if (ch == '#') {\n    do {\n      ch = getc(file);\n    } while (ch != '\\n' && ch != EOF);\n  }\n  return ch;\n}\n\n\nLOCAL(boolean)\nread_text_integer (FILE * file, long * result, int * termchar)\n/* Read an unsigned decimal integer from a file, store it in result */\n/* Reads one trailing character after the integer; returns it in termchar */\n{\n  register int ch;\n  register long val;\n  \n  /* Skip any leading whitespace, detect EOF */\n  do {\n    ch = text_getc(file);\n    if (ch == EOF) {\n      *termchar = ch;\n      return FALSE;\n    }\n  } while (isspace(ch));\n  \n  if (! isdigit(ch)) {\n    *termchar = ch;\n    return FALSE;\n  }\n\n  val = ch - '0';\n  while ((ch = text_getc(file)) != EOF) {\n    if (! isdigit(ch))\n      break;\n    val *= 10;\n    val += ch - '0';\n  }\n  *result = val;\n  *termchar = ch;\n  return TRUE;\n}\n\n\n#if JPEG_LIB_VERSION < 70\nstatic int q_scale_factor[NUM_QUANT_TBLS] = {100, 100, 100, 100};\n#endif\n\nGLOBAL(boolean)\nread_quant_tables (j_compress_ptr cinfo, char * filename, boolean force_baseline)\n/* Read a set of quantization tables from the specified file.\n * The file is plain ASCII text: decimal numbers with whitespace between.\n * Comments preceded by '#' may be included in the file.\n * There may be one to NUM_QUANT_TBLS tables in the file, each of 64 values.\n * The tables are implicitly numbered 0,1,etc.\n * NOTE: does not affect the qslots mapping, which will default to selecting\n * table 0 for luminance (or primary) components, 1 for chrominance components.\n * You must use -qslots if you want a different component->table mapping.\n */\n{\n  FILE * fp;\n  int tblno, i, termchar;\n  long val;\n  unsigned int table[DCTSIZE2];\n\n  if ((fp = fopen(filename, \"r\")) == NULL) {\n    fprintf(stderr, \"Can't open table file %s\\n\", filename);\n    return FALSE;\n  }\n  tblno = 0;\n\n  while (read_text_integer(fp, &val, &termchar)) { /* read 1st element of table */\n    if (tblno >= NUM_QUANT_TBLS) {\n      fprintf(stderr, \"Too many tables in file %s\\n\", filename);\n      fclose(fp);\n      return FALSE;\n    }\n    table[0] = (unsigned int) val;\n    for (i = 1; i < DCTSIZE2; i++) {\n      if (! read_text_integer(fp, &val, &termchar)) {\n\tfprintf(stderr, \"Invalid table data in file %s\\n\", filename);\n\tfclose(fp);\n\treturn FALSE;\n      }\n      table[i] = (unsigned int) val;\n    }\n#if JPEG_LIB_VERSION >= 70\n    jpeg_add_quant_table(cinfo, tblno, table, cinfo->q_scale_factor[tblno],\n\t\t\t force_baseline);\n#else\n    jpeg_add_quant_table(cinfo, tblno, table, q_scale_factor[tblno],\n                         force_baseline);\n#endif\n    tblno++;\n  }\n\n  if (termchar != EOF) {\n    fprintf(stderr, \"Non-numeric data in file %s\\n\", filename);\n    fclose(fp);\n    return FALSE;\n  }\n\n  fclose(fp);\n  return TRUE;\n}\n\n\n#ifdef C_MULTISCAN_FILES_SUPPORTED\n\nLOCAL(boolean)\nread_scan_integer (FILE * file, long * result, int * termchar)\n/* Variant of read_text_integer that always looks for a non-space termchar;\n * this simplifies parsing of punctuation in scan scripts.\n */\n{\n  register int ch;\n\n  if (! read_text_integer(file, result, termchar))\n    return FALSE;\n  ch = *termchar;\n  while (ch != EOF && isspace(ch))\n    ch = text_getc(file);\n  if (isdigit(ch)) {\t\t/* oops, put it back */\n    if (ungetc(ch, file) == EOF)\n      return FALSE;\n    ch = ' ';\n  } else {\n    /* Any separators other than ';' and ':' are ignored;\n     * this allows user to insert commas, etc, if desired.\n     */\n    if (ch != EOF && ch != ';' && ch != ':')\n      ch = ' ';\n  }\n  *termchar = ch;\n  return TRUE;\n}\n\n\nGLOBAL(boolean)\nread_scan_script (j_compress_ptr cinfo, char * filename)\n/* Read a scan script from the specified text file.\n * Each entry in the file defines one scan to be emitted.\n * Entries are separated by semicolons ';'.\n * An entry contains one to four component indexes,\n * optionally followed by a colon ':' and four progressive-JPEG parameters.\n * The component indexes denote which component(s) are to be transmitted\n * in the current scan.  The first component has index 0.\n * Sequential JPEG is used if the progressive-JPEG parameters are omitted.\n * The file is free format text: any whitespace may appear between numbers\n * and the ':' and ';' punctuation marks.  Also, other punctuation (such\n * as commas or dashes) can be placed between numbers if desired.\n * Comments preceded by '#' may be included in the file.\n * Note: we do very little validity checking here;\n * jcmaster.c will validate the script parameters.\n */\n{\n  FILE * fp;\n  int scanno, ncomps, termchar;\n  long val;\n  jpeg_scan_info * scanptr;\n#define MAX_SCANS  100\t\t/* quite arbitrary limit */\n  jpeg_scan_info scans[MAX_SCANS];\n\n  if ((fp = fopen(filename, \"r\")) == NULL) {\n    fprintf(stderr, \"Can't open scan definition file %s\\n\", filename);\n    return FALSE;\n  }\n  scanptr = scans;\n  scanno = 0;\n\n  while (read_scan_integer(fp, &val, &termchar)) {\n    if (scanno >= MAX_SCANS) {\n      fprintf(stderr, \"Too many scans defined in file %s\\n\", filename);\n      fclose(fp);\n      return FALSE;\n    }\n    scanptr->component_index[0] = (int) val;\n    ncomps = 1;\n    while (termchar == ' ') {\n      if (ncomps >= MAX_COMPS_IN_SCAN) {\n\tfprintf(stderr, \"Too many components in one scan in file %s\\n\",\n\t\tfilename);\n\tfclose(fp);\n\treturn FALSE;\n      }\n      if (! read_scan_integer(fp, &val, &termchar))\n\tgoto bogus;\n      scanptr->component_index[ncomps] = (int) val;\n      ncomps++;\n    }\n    scanptr->comps_in_scan = ncomps;\n    if (termchar == ':') {\n      if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ')\n\tgoto bogus;\n      scanptr->Ss = (int) val;\n      if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ')\n\tgoto bogus;\n      scanptr->Se = (int) val;\n      if (! read_scan_integer(fp, &val, &termchar) || termchar != ' ')\n\tgoto bogus;\n      scanptr->Ah = (int) val;\n      if (! read_scan_integer(fp, &val, &termchar))\n\tgoto bogus;\n      scanptr->Al = (int) val;\n    } else {\n      /* set non-progressive parameters */\n      scanptr->Ss = 0;\n      scanptr->Se = DCTSIZE2-1;\n      scanptr->Ah = 0;\n      scanptr->Al = 0;\n    }\n    if (termchar != ';' && termchar != EOF) {\nbogus:\n      fprintf(stderr, \"Invalid scan entry format in file %s\\n\", filename);\n      fclose(fp);\n      return FALSE;\n    }\n    scanptr++, scanno++;\n  }\n\n  if (termchar != EOF) {\n    fprintf(stderr, \"Non-numeric data in file %s\\n\", filename);\n    fclose(fp);\n    return FALSE;\n  }\n\n  if (scanno > 0) {\n    /* Stash completed scan list in cinfo structure.\n     * NOTE: for cjpeg's use, JPOOL_IMAGE is the right lifetime for this data,\n     * but if you want to compress multiple images you'd want JPOOL_PERMANENT.\n     */\n    scanptr = (jpeg_scan_info *)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  scanno * SIZEOF(jpeg_scan_info));\n    MEMCOPY(scanptr, scans, scanno * SIZEOF(jpeg_scan_info));\n    cinfo->scan_info = scanptr;\n    cinfo->num_scans = scanno;\n  }\n\n  fclose(fp);\n  return TRUE;\n}\n\n#endif /* C_MULTISCAN_FILES_SUPPORTED */\n\n\n#if JPEG_LIB_VERSION < 70\n/* These are the sample quantization tables given in JPEG spec section K.1.\n * The spec says that the values given produce \"good\" quality, and\n * when divided by 2, \"very good\" quality.\n */\nstatic const unsigned int std_luminance_quant_tbl[DCTSIZE2] = {\n  16,  11,  10,  16,  24,  40,  51,  61,\n  12,  12,  14,  19,  26,  58,  60,  55,\n  14,  13,  16,  24,  40,  57,  69,  56,\n  14,  17,  22,  29,  51,  87,  80,  62,\n  18,  22,  37,  56,  68, 109, 103,  77,\n  24,  35,  55,  64,  81, 104, 113,  92,\n  49,  64,  78,  87, 103, 121, 120, 101,\n  72,  92,  95,  98, 112, 100, 103,  99\n};\nstatic const unsigned int std_chrominance_quant_tbl[DCTSIZE2] = {\n  17,  18,  24,  47,  99,  99,  99,  99,\n  18,  21,  26,  66,  99,  99,  99,  99,\n  24,  26,  56,  99,  99,  99,  99,  99,\n  47,  66,  99,  99,  99,  99,  99,  99,\n  99,  99,  99,  99,  99,  99,  99,  99,\n  99,  99,  99,  99,  99,  99,  99,  99,\n  99,  99,  99,  99,  99,  99,  99,  99,\n  99,  99,  99,  99,  99,  99,  99,  99\n};\n\n\nLOCAL(void)\njpeg_default_qtables (j_compress_ptr cinfo, boolean force_baseline)\n{\n  jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,\n\t\t       q_scale_factor[0], force_baseline);\n  jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,\n\t\t       q_scale_factor[1], force_baseline);\n}\n#endif\n\n\nGLOBAL(boolean)\nset_quality_ratings (j_compress_ptr cinfo, char *arg, boolean force_baseline)\n/* Process a quality-ratings parameter string, of the form\n *     N[,N,...]\n * If there are more q-table slots than parameters, the last value is replicated.\n */\n{\n  int val = 75;\t\t\t/* default value */\n  int tblno;\n  char ch;\n\n  for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {\n    if (*arg) {\n      ch = ',';\t\t\t/* if not set by sscanf, will be ',' */\n      if (sscanf(arg, \"%d%c\", &val, &ch) < 1)\n\treturn FALSE;\n      if (ch != ',')\t\t/* syntax check */\n\treturn FALSE;\n      /* Convert user 0-100 rating to percentage scaling */\n#if JPEG_LIB_VERSION >= 70\n      cinfo->q_scale_factor[tblno] = jpeg_quality_scaling(val);\n#else\n      q_scale_factor[tblno] = jpeg_quality_scaling(val);\n#endif\n      while (*arg && *arg++ != ',') /* advance to next segment of arg string */\n\t;\n    } else {\n      /* reached end of parameter, set remaining factors to last value */\n#if JPEG_LIB_VERSION >= 70\n      cinfo->q_scale_factor[tblno] = jpeg_quality_scaling(val);\n#else\n      q_scale_factor[tblno] = jpeg_quality_scaling(val);\n#endif\n    }\n  }\n  jpeg_default_qtables(cinfo, force_baseline);\n  return TRUE;\n}\n\n\nGLOBAL(boolean)\nset_quant_slots (j_compress_ptr cinfo, char *arg)\n/* Process a quantization-table-selectors parameter string, of the form\n *     N[,N,...]\n * If there are more components than parameters, the last value is replicated.\n */\n{\n  int val = 0;\t\t\t/* default table # */\n  int ci;\n  char ch;\n\n  for (ci = 0; ci < MAX_COMPONENTS; ci++) {\n    if (*arg) {\n      ch = ',';\t\t\t/* if not set by sscanf, will be ',' */\n      if (sscanf(arg, \"%d%c\", &val, &ch) < 1)\n\treturn FALSE;\n      if (ch != ',')\t\t/* syntax check */\n\treturn FALSE;\n      if (val < 0 || val >= NUM_QUANT_TBLS) {\n\tfprintf(stderr, \"JPEG quantization tables are numbered 0..%d\\n\",\n\t\tNUM_QUANT_TBLS-1);\n\treturn FALSE;\n      }\n      cinfo->comp_info[ci].quant_tbl_no = val;\n      while (*arg && *arg++ != ',') /* advance to next segment of arg string */\n\t;\n    } else {\n      /* reached end of parameter, set remaining components to last table */\n      cinfo->comp_info[ci].quant_tbl_no = val;\n    }\n  }\n  return TRUE;\n}\n\n\nGLOBAL(boolean)\nset_sample_factors (j_compress_ptr cinfo, char *arg)\n/* Process a sample-factors parameter string, of the form\n *     HxV[,HxV,...]\n * If there are more components than parameters, \"1x1\" is assumed for the rest.\n */\n{\n  int ci, val1, val2;\n  char ch1, ch2;\n\n  for (ci = 0; ci < MAX_COMPONENTS; ci++) {\n    if (*arg) {\n      ch2 = ',';\t\t/* if not set by sscanf, will be ',' */\n      if (sscanf(arg, \"%d%c%d%c\", &val1, &ch1, &val2, &ch2) < 3)\n\treturn FALSE;\n      if ((ch1 != 'x' && ch1 != 'X') || ch2 != ',') /* syntax check */\n\treturn FALSE;\n      if (val1 <= 0 || val1 > 4 || val2 <= 0 || val2 > 4) {\n\tfprintf(stderr, \"JPEG sampling factors must be 1..4\\n\");\n\treturn FALSE;\n      }\n      cinfo->comp_info[ci].h_samp_factor = val1;\n      cinfo->comp_info[ci].v_samp_factor = val2;\n      while (*arg && *arg++ != ',') /* advance to next segment of arg string */\n\t;\n    } else {\n      /* reached end of parameter, set remaining components to 1x1 sampling */\n      cinfo->comp_info[ci].h_samp_factor = 1;\n      cinfo->comp_info[ci].v_samp_factor = 1;\n    }\n  }\n  return TRUE;\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/rdtarga.c",
    "content": "/*\n * rdtarga.c\n *\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to read input images in Targa format.\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume input from\n * an ordinary stdio stream.  They further assume that reading begins\n * at the start of the file; start_input may need work if the\n * user interface has already read some data (e.g., to determine that\n * the file is indeed Targa format).\n *\n * Based on code contributed by Lee Daniel Crocker.\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n\n#ifdef TARGA_SUPPORTED\n\n\n/* Macros to deal with unsigned chars as efficiently as compiler allows */\n\n#ifdef HAVE_UNSIGNED_CHAR\ntypedef unsigned char U_CHAR;\n#define UCH(x)\t((int) (x))\n#else /* !HAVE_UNSIGNED_CHAR */\n#ifdef CHAR_IS_UNSIGNED\ntypedef char U_CHAR;\n#define UCH(x)\t((int) (x))\n#else\ntypedef char U_CHAR;\n#define UCH(x)\t((int) (x) & 0xFF)\n#endif\n#endif /* HAVE_UNSIGNED_CHAR */\n\n\n#define\tReadOK(file,buffer,len)\t(JFREAD(file,buffer,len) == ((size_t) (len)))\n\n\n/* Private version of data source object */\n\ntypedef struct _tga_source_struct * tga_source_ptr;\n\ntypedef struct _tga_source_struct {\n  struct cjpeg_source_struct pub; /* public fields */\n\n  j_compress_ptr cinfo;\t\t/* back link saves passing separate parm */\n\n  JSAMPARRAY colormap;\t\t/* Targa colormap (converted to my format) */\n\n  jvirt_sarray_ptr whole_image;\t/* Needed if funny input row order */\n  JDIMENSION current_row;\t/* Current logical row number to read */\n\n  /* Pointer to routine to extract next Targa pixel from input file */\n  JMETHOD(void, read_pixel, (tga_source_ptr sinfo));\n\n  /* Result of read_pixel is delivered here: */\n  U_CHAR tga_pixel[4];\n\n  int pixel_size;\t\t/* Bytes per Targa pixel (1 to 4) */\n\n  /* State info for reading RLE-coded pixels; both counts must be init to 0 */\n  int block_count;\t\t/* # of pixels remaining in RLE block */\n  int dup_pixel_count;\t\t/* # of times to duplicate previous pixel */\n\n  /* This saves the correct pixel-row-expansion method for preload_image */\n  JMETHOD(JDIMENSION, get_pixel_rows, (j_compress_ptr cinfo,\n\t\t\t\t       cjpeg_source_ptr sinfo));\n} tga_source_struct;\n\n\n/* For expanding 5-bit pixel values to 8-bit with best rounding */\n\nstatic const UINT8 c5to8bits[32] = {\n    0,   8,  16,  25,  33,  41,  49,  58,\n   66,  74,  82,  90,  99, 107, 115, 123,\n  132, 140, 148, 156, 165, 173, 181, 189,\n  197, 206, 214, 222, 230, 239, 247, 255\n};\n\n\n\nLOCAL(int)\nread_byte (tga_source_ptr sinfo)\n/* Read next byte from Targa file */\n{\n  register FILE *infile = sinfo->pub.input_file;\n  register int c;\n\n  if ((c = getc(infile)) == EOF)\n    ERREXIT(sinfo->cinfo, JERR_INPUT_EOF);\n  return c;\n}\n\n\nLOCAL(void)\nread_colormap (tga_source_ptr sinfo, int cmaplen, int mapentrysize)\n/* Read the colormap from a Targa file */\n{\n  int i;\n\n  /* Presently only handles 24-bit BGR format */\n  if (mapentrysize != 24)\n    ERREXIT(sinfo->cinfo, JERR_TGA_BADCMAP);\n\n  for (i = 0; i < cmaplen; i++) {\n    sinfo->colormap[2][i] = (JSAMPLE) read_byte(sinfo);\n    sinfo->colormap[1][i] = (JSAMPLE) read_byte(sinfo);\n    sinfo->colormap[0][i] = (JSAMPLE) read_byte(sinfo);\n  }\n}\n\n\n/*\n * read_pixel methods: get a single pixel from Targa file into tga_pixel[]\n */\n\nMETHODDEF(void)\nread_non_rle_pixel (tga_source_ptr sinfo)\n/* Read one Targa pixel from the input file; no RLE expansion */\n{\n  register FILE *infile = sinfo->pub.input_file;\n  register int i;\n\n  for (i = 0; i < sinfo->pixel_size; i++) {\n    sinfo->tga_pixel[i] = (U_CHAR) getc(infile);\n  }\n}\n\n\nMETHODDEF(void)\nread_rle_pixel (tga_source_ptr sinfo)\n/* Read one Targa pixel from the input file, expanding RLE data as needed */\n{\n  register FILE *infile = sinfo->pub.input_file;\n  register int i;\n\n  /* Duplicate previously read pixel? */\n  if (sinfo->dup_pixel_count > 0) {\n    sinfo->dup_pixel_count--;\n    return;\n  }\n\n  /* Time to read RLE block header? */\n  if (--sinfo->block_count < 0) { /* decrement pixels remaining in block */\n    i = read_byte(sinfo);\n    if (i & 0x80) {\t\t/* Start of duplicate-pixel block? */\n      sinfo->dup_pixel_count = i & 0x7F; /* number of dups after this one */\n      sinfo->block_count = 0;\t/* then read new block header */\n    } else {\n      sinfo->block_count = i & 0x7F; /* number of pixels after this one */\n    }\n  }\n\n  /* Read next pixel */\n  for (i = 0; i < sinfo->pixel_size; i++) {\n    sinfo->tga_pixel[i] = (U_CHAR) getc(infile);\n  }\n}\n\n\n/*\n * Read one row of pixels.\n *\n * We provide several different versions depending on input file format.\n */\n\n\nMETHODDEF(JDIMENSION)\nget_8bit_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading 8-bit grayscale pixels */\n{\n  tga_source_ptr source = (tga_source_ptr) sinfo;\n  register JSAMPROW ptr;\n  register JDIMENSION col;\n  \n  ptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    (*source->read_pixel) (source); /* Load next pixel into tga_pixel */\n    *ptr++ = (JSAMPLE) UCH(source->tga_pixel[0]);\n  }\n  return 1;\n}\n\nMETHODDEF(JDIMENSION)\nget_8bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading 8-bit colormap indexes */\n{\n  tga_source_ptr source = (tga_source_ptr) sinfo;\n  register int t;\n  register JSAMPROW ptr;\n  register JDIMENSION col;\n  register JSAMPARRAY colormap = source->colormap;\n\n  ptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    (*source->read_pixel) (source); /* Load next pixel into tga_pixel */\n    t = UCH(source->tga_pixel[0]);\n    *ptr++ = colormap[0][t];\n    *ptr++ = colormap[1][t];\n    *ptr++ = colormap[2][t];\n  }\n  return 1;\n}\n\nMETHODDEF(JDIMENSION)\nget_16bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading 16-bit pixels */\n{\n  tga_source_ptr source = (tga_source_ptr) sinfo;\n  register int t;\n  register JSAMPROW ptr;\n  register JDIMENSION col;\n  \n  ptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    (*source->read_pixel) (source); /* Load next pixel into tga_pixel */\n    t = UCH(source->tga_pixel[0]);\n    t += UCH(source->tga_pixel[1]) << 8;\n    /* We expand 5 bit data to 8 bit sample width.\n     * The format of the 16-bit (LSB first) input word is\n     *     xRRRRRGGGGGBBBBB\n     */\n    ptr[2] = (JSAMPLE) c5to8bits[t & 0x1F];\n    t >>= 5;\n    ptr[1] = (JSAMPLE) c5to8bits[t & 0x1F];\n    t >>= 5;\n    ptr[0] = (JSAMPLE) c5to8bits[t & 0x1F];\n    ptr += 3;\n  }\n  return 1;\n}\n\nMETHODDEF(JDIMENSION)\nget_24bit_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n/* This version is for reading 24-bit pixels */\n{\n  tga_source_ptr source = (tga_source_ptr) sinfo;\n  register JSAMPROW ptr;\n  register JDIMENSION col;\n  \n  ptr = source->pub.buffer[0];\n  for (col = cinfo->image_width; col > 0; col--) {\n    (*source->read_pixel) (source); /* Load next pixel into tga_pixel */\n    *ptr++ = (JSAMPLE) UCH(source->tga_pixel[2]); /* change BGR to RGB order */\n    *ptr++ = (JSAMPLE) UCH(source->tga_pixel[1]);\n    *ptr++ = (JSAMPLE) UCH(source->tga_pixel[0]);\n  }\n  return 1;\n}\n\n/*\n * Targa also defines a 32-bit pixel format with order B,G,R,A.\n * We presently ignore the attribute byte, so the code for reading\n * these pixels is identical to the 24-bit routine above.\n * This works because the actual pixel length is only known to read_pixel.\n */\n\n#define get_32bit_row  get_24bit_row\n\n\n/*\n * This method is for re-reading the input data in standard top-down\n * row order.  The entire image has already been read into whole_image\n * with proper conversion of pixel format, but it's in a funny row order.\n */\n\nMETHODDEF(JDIMENSION)\nget_memory_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  tga_source_ptr source = (tga_source_ptr) sinfo;\n  JDIMENSION source_row;\n\n  /* Compute row of source that maps to current_row of normal order */\n  /* For now, assume image is bottom-up and not interlaced. */\n  /* NEEDS WORK to support interlaced images! */\n  source_row = cinfo->image_height - source->current_row - 1;\n\n  /* Fetch that row from virtual array */\n  source->pub.buffer = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, source->whole_image,\n     source_row, (JDIMENSION) 1, FALSE);\n\n  source->current_row++;\n  return 1;\n}\n\n\n/*\n * This method loads the image into whole_image during the first call on\n * get_pixel_rows.  The get_pixel_rows pointer is then adjusted to call\n * get_memory_row on subsequent calls.\n */\n\nMETHODDEF(JDIMENSION)\npreload_image (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  tga_source_ptr source = (tga_source_ptr) sinfo;\n  JDIMENSION row;\n  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n\n  /* Read the data into a virtual array in input-file row order. */\n  for (row = 0; row < cinfo->image_height; row++) {\n    if (progress != NULL) {\n      progress->pub.pass_counter = (long) row;\n      progress->pub.pass_limit = (long) cinfo->image_height;\n      (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n    }\n    source->pub.buffer = (*cinfo->mem->access_virt_sarray)\n      ((j_common_ptr) cinfo, source->whole_image, row, (JDIMENSION) 1, TRUE);\n    (*source->get_pixel_rows) (cinfo, sinfo);\n  }\n  if (progress != NULL)\n    progress->completed_extra_passes++;\n\n  /* Set up to read from the virtual array in unscrambled order */\n  source->pub.get_pixel_rows = get_memory_row;\n  source->current_row = 0;\n  /* And read the first row */\n  return get_memory_row(cinfo, sinfo);\n}\n\n\n/*\n * Read the file header; return image size and component count.\n */\n\nMETHODDEF(void)\nstart_input_tga (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  tga_source_ptr source = (tga_source_ptr) sinfo;\n  U_CHAR targaheader[18];\n  int idlen, cmaptype, subtype, flags, interlace_type, components;\n  unsigned int width, height, maplen;\n  boolean is_bottom_up;\n\n#define GET_2B(offset)\t((unsigned int) UCH(targaheader[offset]) + \\\n\t\t\t (((unsigned int) UCH(targaheader[offset+1])) << 8))\n\n  if (! ReadOK(source->pub.input_file, targaheader, 18))\n    ERREXIT(cinfo, JERR_INPUT_EOF);\n\n  /* Pretend \"15-bit\" pixels are 16-bit --- we ignore attribute bit anyway */\n  if (targaheader[16] == 15)\n    targaheader[16] = 16;\n\n  idlen = UCH(targaheader[0]);\n  cmaptype = UCH(targaheader[1]);\n  subtype = UCH(targaheader[2]);\n  maplen = GET_2B(5);\n  width = GET_2B(12);\n  height = GET_2B(14);\n  source->pixel_size = UCH(targaheader[16]) >> 3;\n  flags = UCH(targaheader[17]);\t/* Image Descriptor byte */\n\n  is_bottom_up = ((flags & 0x20) == 0);\t/* bit 5 set => top-down */\n  interlace_type = flags >> 6;\t/* bits 6/7 are interlace code */\n\n  if (cmaptype > 1 ||\t\t/* cmaptype must be 0 or 1 */\n      source->pixel_size < 1 || source->pixel_size > 4 ||\n      (UCH(targaheader[16]) & 7) != 0 || /* bits/pixel must be multiple of 8 */\n      interlace_type != 0)\t/* currently don't allow interlaced image */\n    ERREXIT(cinfo, JERR_TGA_BADPARMS);\n  \n  if (subtype > 8) {\n    /* It's an RLE-coded file */\n    source->read_pixel = read_rle_pixel;\n    source->block_count = source->dup_pixel_count = 0;\n    subtype -= 8;\n  } else {\n    /* Non-RLE file */\n    source->read_pixel = read_non_rle_pixel;\n  }\n\n  /* Now should have subtype 1, 2, or 3 */\n  components = 3;\t\t/* until proven different */\n  cinfo->in_color_space = JCS_RGB;\n\n  switch (subtype) {\n  case 1:\t\t\t/* Colormapped image */\n    if (source->pixel_size == 1 && cmaptype == 1)\n      source->get_pixel_rows = get_8bit_row;\n    else\n      ERREXIT(cinfo, JERR_TGA_BADPARMS);\n    TRACEMS2(cinfo, 1, JTRC_TGA_MAPPED, width, height);\n    break;\n  case 2:\t\t\t/* RGB image */\n    switch (source->pixel_size) {\n    case 2:\n      source->get_pixel_rows = get_16bit_row;\n      break;\n    case 3:\n      source->get_pixel_rows = get_24bit_row;\n      break;\n    case 4:\n      source->get_pixel_rows = get_32bit_row;\n      break;\n    default:\n      ERREXIT(cinfo, JERR_TGA_BADPARMS);\n      break;\n    }\n    TRACEMS2(cinfo, 1, JTRC_TGA, width, height);\n    break;\n  case 3:\t\t\t/* Grayscale image */\n    components = 1;\n    cinfo->in_color_space = JCS_GRAYSCALE;\n    if (source->pixel_size == 1)\n      source->get_pixel_rows = get_8bit_gray_row;\n    else\n      ERREXIT(cinfo, JERR_TGA_BADPARMS);\n    TRACEMS2(cinfo, 1, JTRC_TGA_GRAY, width, height);\n    break;\n  default:\n    ERREXIT(cinfo, JERR_TGA_BADPARMS);\n    break;\n  }\n\n  if (is_bottom_up) {\n    /* Create a virtual array to buffer the upside-down image. */\n    source->whole_image = (*cinfo->mem->request_virt_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n       (JDIMENSION) width * components, (JDIMENSION) height, (JDIMENSION) 1);\n    if (cinfo->progress != NULL) {\n      cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n      progress->total_extra_passes++; /* count file input as separate pass */\n    }\n    /* source->pub.buffer will point to the virtual array. */\n    source->pub.buffer_height = 1; /* in case anyone looks at it */\n    source->pub.get_pixel_rows = preload_image;\n  } else {\n    /* Don't need a virtual array, but do need a one-row input buffer. */\n    source->whole_image = NULL;\n    source->pub.buffer = (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       (JDIMENSION) width * components, (JDIMENSION) 1);\n    source->pub.buffer_height = 1;\n    source->pub.get_pixel_rows = source->get_pixel_rows;\n  }\n  \n  while (idlen--)\t\t/* Throw away ID field */\n    (void) read_byte(source);\n\n  if (maplen > 0) {\n    if (maplen > 256 || GET_2B(3) != 0)\n      ERREXIT(cinfo, JERR_TGA_BADCMAP);\n    /* Allocate space to store the colormap */\n    source->colormap = (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE, (JDIMENSION) maplen, (JDIMENSION) 3);\n    /* and read it from the file */\n    read_colormap(source, (int) maplen, UCH(targaheader[7]));\n  } else {\n    if (cmaptype)\t\t/* but you promised a cmap! */\n      ERREXIT(cinfo, JERR_TGA_BADPARMS);\n    source->colormap = NULL;\n  }\n\n  cinfo->input_components = components;\n  cinfo->data_precision = 8;\n  cinfo->image_width = width;\n  cinfo->image_height = height;\n}\n\n\n/*\n * Finish up at the end of the file.\n */\n\nMETHODDEF(void)\nfinish_input_tga (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)\n{\n  /* no work */\n}\n\n\n/*\n * The module selection routine for Targa format input.\n */\n\nGLOBAL(cjpeg_source_ptr)\njinit_read_targa (j_compress_ptr cinfo)\n{\n  tga_source_ptr source;\n\n  /* Create module interface object */\n  source = (tga_source_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(tga_source_struct));\n  source->cinfo = cinfo;\t/* make back link for subroutines */\n  /* Fill in method ptrs, except get_pixel_rows which start_input sets */\n  source->pub.start_input = start_input_tga;\n  source->pub.finish_input = finish_input_tga;\n\n  return (cjpeg_source_ptr) source;\n}\n\n#endif /* TARGA_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/CMakeLists.txt",
    "content": "if(NOT DEFINED NASM)\n  set(NASM nasm CACHE PATH \"Path to NASM/YASM executable\")\nendif()\n\nif(SIMD_X86_64)\n  set(NAFLAGS -fwin64 -DWIN64 -D__x86_64__ -I${CMAKE_SOURCE_DIR}/win/\n    -I${CMAKE_CURRENT_SOURCE_DIR}/)\nelse()\n  set(NAFLAGS -fwin32 -DWIN32 -I${CMAKE_SOURCE_DIR}/win/\n    -I${CMAKE_CURRENT_SOURCE_DIR}/)\nendif()\n\n# This only works if building from the command line.  There is currently no way\n# to set a variable's value based on the build type when using the MSVC IDE.\nif(CMAKE_BUILD_TYPE STREQUAL \"Debug\"\n  OR CMAKE_BUILD_TYPE STREQUAL \"RelWithDebInfo\")\n  set(NAFLAGS ${NAFLAGS} -g)\nendif()\n\nif(SIMD_X86_64)\n  set(SIMD_BASENAMES jfsseflt-64 jccolss2-64 jdcolss2-64 jcgrass2-64\n    jcsamss2-64 jdsamss2-64 jdmerss2-64 jcqnts2i-64 jfss2fst-64 jfss2int-64\n    jiss2red-64 jiss2int-64 jiss2fst-64 jcqnts2f-64 jiss2flt-64)\n  message(STATUS \"Building x86_64 SIMD extensions\")\nelse()\n  set(SIMD_BASENAMES jsimdcpu jccolmmx jcgrammx jdcolmmx jcsammmx jdsammmx\n    jdmermmx jcqntmmx jfmmxfst jfmmxint jimmxred jimmxint jimmxfst jcqnt3dn\n    jf3dnflt ji3dnflt jcqntsse jfsseflt jisseflt jccolss2 jcgrass2 jdcolss2\n    jcsamss2 jdsamss2 jdmerss2 jcqnts2i jfss2fst jfss2int jiss2red jiss2int\n    jiss2fst jcqnts2f jiss2flt)\n  message(STATUS \"Building i386 SIMD extensions\")\nendif()\n\nif(MSVC_IDE)\n  set(OBJDIR \"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}\")\nelse()\n  set(OBJDIR ${CMAKE_CURRENT_BINARY_DIR})\nendif()\n\nfile(GLOB INC_FILES *.inc)\n\nforeach(file ${SIMD_BASENAMES})\n  set(DEPFILE \"\")\n  set(SIMD_SRC ${CMAKE_CURRENT_SOURCE_DIR}/${file}.asm)\n  if(${file} MATCHES col)\n    set(DEPFILE ${file})\n    string(REGEX REPLACE \"col\" \"clr\" DEPFILE ${DEPFILE})\n    set(DEPFILE ${CMAKE_CURRENT_SOURCE_DIR}/${DEPFILE}.asm)\n  endif()\n  if(${file} MATCHES mer)\n    set(DEPFILE ${file})\n    string(REGEX REPLACE \"mer\" \"mrg\" DEPFILE ${DEPFILE})\n    set(DEPFILE ${CMAKE_CURRENT_SOURCE_DIR}/${DEPFILE}.asm)\n  endif()\n  if(${file} MATCHES gra)\n    set(DEPFILE ${file})\n    string(REGEX REPLACE \"gra\" \"gry\" DEPFILE ${DEPFILE})\n    set(DEPFILE ${CMAKE_CURRENT_SOURCE_DIR}/${DEPFILE}.asm)\n  endif()\n  set(SIMD_OBJ ${OBJDIR}/${file}.obj)\n  add_custom_command(OUTPUT ${SIMD_OBJ}\n    DEPENDS ${SIMD_SRC} ${DEPFILE} ${INC_FILES}\n    COMMAND ${NASM} ${NAFLAGS} ${SIMD_SRC} -o${SIMD_OBJ})\n  set(SIMD_OBJS ${SIMD_OBJS} ${SIMD_OBJ})\nendforeach()\n\nset(SIMD_OBJS ${SIMD_OBJS} PARENT_SCOPE)\nadd_custom_target(simd DEPENDS ${SIMD_OBJS})\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/Makefile.am",
    "content": "noinst_LTLIBRARIES = libsimd.la\n\nBUILT_SOURCES = jsimdcfg.inc\n\nEXTRA_DIST = nasm_lt.sh jcclrmmx.asm jcclrss2.asm jdclrmmx.asm jdclrss2.asm \\\n\tjdmrgmmx.asm jdmrgss2.asm jcclrss2-64.asm jdclrss2-64.asm \\\n\tjdmrgss2-64.asm jcgryss2-64.asm jcgrymmx.asm jcgryss2.asm CMakeLists.txt\n\nif SIMD_X86_64\n\nlibsimd_la_SOURCES = jsimd_x86_64.c \\\n\tjsimd.h jsimdcfg.inc.h \\\n\tjsimdext.inc jcolsamp.inc jdct.inc \\\n\tjfsseflt-64.asm jcgrass2-64.asm \\\n\tjccolss2-64.asm jdcolss2-64.asm \\\n\tjcsamss2-64.asm jdsamss2-64.asm jdmerss2-64.asm \\\n\tjcqnts2i-64.asm jfss2fst-64.asm jfss2int-64.asm \\\n\tjiss2red-64.asm jiss2int-64.asm jiss2fst-64.asm \\\n\tjcqnts2f-64.asm jiss2flt-64.asm\n\njccolss2-64.lo: jcclrss2-64.asm\njdcolss2-64.lo: jdclrss2-64.asm\njcgrass2-64.lo: jcgryss2-64.asm\njdmerss2-64.lo: jdmrgss2-64.asm\nendif\n\nif SIMD_I386\n\nlibsimd_la_SOURCES = jsimd_i386.c \\\n\tjsimd.h jsimdcfg.inc.h \\\n\tjsimdext.inc jcolsamp.inc jdct.inc \\\n\tjsimdcpu.asm \\\n\tjccolmmx.asm jdcolmmx.asm jcgrammx.asm \\\n\tjcsammmx.asm jdsammmx.asm jdmermmx.asm \\\n\tjcqntmmx.asm jfmmxfst.asm jfmmxint.asm \\\n\tjimmxred.asm jimmxint.asm jimmxfst.asm \\\n\tjcqnt3dn.asm jf3dnflt.asm ji3dnflt.asm \\\n\tjcqntsse.asm jfsseflt.asm jisseflt.asm \\\n\tjccolss2.asm jdcolss2.asm jcgrass2.asm \\\n\tjcsamss2.asm jdsamss2.asm jdmerss2.asm \\\n\tjcqnts2i.asm jfss2fst.asm jfss2int.asm \\\n\tjiss2red.asm jiss2int.asm jiss2fst.asm \\\n\tjcqnts2f.asm jiss2flt.asm\n\njccolmmx.lo: jcclrmmx.asm\njcgrammx.lo: jcgrymmx.asm\njccolss2.lo: jcclrss2.asm\njcgrass2.lo: jcgryss2.asm\njdcolmmx.lo: jdclrmmx.asm\njdcolss2.lo: jdclrss2.asm\njdmermmx.lo: jdmrgmmx.asm\njdmerss2.lo: jdmrgss2.asm\nendif\n\nif SIMD_ARM\n\nlibsimd_la_SOURCES = jsimd_arm.c jsimd_arm_neon.S\n\nendif\n\nAM_CPPFLAGS = -I$(top_srcdir) \n\n.asm.lo:\n\t$(LIBTOOL) --mode=compile --tag NASM $(srcdir)/nasm_lt.sh $(NASM) $(NAFLAGS) -I$(srcdir) -I. $< -o $@\n\njsimdcfg.inc: $(srcdir)/jsimdcfg.inc.h ../jpeglib.h ../jconfig.h ../jmorecfg.h\n\t$(CPP) -I$(top_builddir) -I$(top_builddir)/simd $(srcdir)/jsimdcfg.inc.h | $(EGREP) \"^[\\;%]|^\\ %\" | sed 's%_cpp_protection_%%' | sed 's@% define@%define@g' > $@\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/Makefile.in",
    "content": "# Makefile.in generated by automake 1.9.2 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,\n# 2003, 2004  Free Software Foundation, Inc.\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\n\nSOURCES = $(libsimd_la_SOURCES)\n\nsrcdir = @srcdir@\ntop_srcdir = @top_srcdir@\nVPATH = @srcdir@\npkgdatadir = $(datadir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\ntop_builddir = ..\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\nINSTALL = @INSTALL@\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nbuild_triplet = @build@\nhost_triplet = @host@\nsubdir = simd\nDIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \\\n\t$(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nmkinstalldirs = $(install_sh) -d\nCONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/jconfig.h\nCONFIG_CLEAN_FILES =\nLTLIBRARIES = $(noinst_LTLIBRARIES)\nlibsimd_la_LIBADD =\nam__libsimd_la_SOURCES_DIST = jsimd_arm.c jsimd_arm_neon.S \\\n\tjsimd_i386.c jsimd.h jsimdcfg.inc.h jsimdext.inc jcolsamp.inc \\\n\tjdct.inc jsimdcpu.asm jccolmmx.asm jdcolmmx.asm jcgrammx.asm \\\n\tjcsammmx.asm jdsammmx.asm jdmermmx.asm jcqntmmx.asm \\\n\tjfmmxfst.asm jfmmxint.asm jimmxred.asm jimmxint.asm \\\n\tjimmxfst.asm jcqnt3dn.asm jf3dnflt.asm ji3dnflt.asm \\\n\tjcqntsse.asm jfsseflt.asm jisseflt.asm jccolss2.asm \\\n\tjdcolss2.asm jcgrass2.asm jcsamss2.asm jdsamss2.asm \\\n\tjdmerss2.asm jcqnts2i.asm jfss2fst.asm jfss2int.asm \\\n\tjiss2red.asm jiss2int.asm jiss2fst.asm jcqnts2f.asm \\\n\tjiss2flt.asm jsimd_x86_64.c jfsseflt-64.asm jcgrass2-64.asm \\\n\tjccolss2-64.asm jdcolss2-64.asm jcsamss2-64.asm \\\n\tjdsamss2-64.asm jdmerss2-64.asm jcqnts2i-64.asm \\\n\tjfss2fst-64.asm jfss2int-64.asm jiss2red-64.asm \\\n\tjiss2int-64.asm jiss2fst-64.asm jcqnts2f-64.asm \\\n\tjiss2flt-64.asm\n@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_X86_64_TRUE@am_libsimd_la_OBJECTS = jsimd_x86_64.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_X86_64_TRUE@\tjfsseflt-64.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_X86_64_TRUE@\tjcgrass2-64.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_X86_64_TRUE@\tjccolss2-64.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_X86_64_TRUE@\tjdcolss2-64.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_X86_64_TRUE@\tjcsamss2-64.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_X86_64_TRUE@\tjdsamss2-64.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_X86_64_TRUE@\tjdmerss2-64.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_X86_64_TRUE@\tjcqnts2i-64.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_X86_64_TRUE@\tjfss2fst-64.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_X86_64_TRUE@\tjfss2int-64.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_X86_64_TRUE@\tjiss2red-64.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_X86_64_TRUE@\tjiss2int-64.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_X86_64_TRUE@\tjiss2fst-64.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_X86_64_TRUE@\tjcqnts2f-64.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_FALSE@@SIMD_X86_64_TRUE@\tjiss2flt-64.lo\n@SIMD_ARM_FALSE@@SIMD_I386_TRUE@am_libsimd_la_OBJECTS = jsimd_i386.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjsimdcpu.lo jccolmmx.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjdcolmmx.lo jcgrammx.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjcsammmx.lo jdsammmx.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjdmermmx.lo jcqntmmx.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjfmmxfst.lo jfmmxint.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjimmxred.lo jimmxint.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjimmxfst.lo jcqnt3dn.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjf3dnflt.lo ji3dnflt.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjcqntsse.lo jfsseflt.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjisseflt.lo jccolss2.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjdcolss2.lo jcgrass2.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjcsamss2.lo jdsamss2.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjdmerss2.lo jcqnts2i.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjfss2fst.lo jfss2int.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjiss2red.lo jiss2int.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjiss2fst.lo jcqnts2f.lo \\\n@SIMD_ARM_FALSE@@SIMD_I386_TRUE@\tjiss2flt.lo\n@SIMD_ARM_TRUE@am_libsimd_la_OBJECTS = jsimd_arm.lo jsimd_arm_neon.lo\nlibsimd_la_OBJECTS = $(am_libsimd_la_OBJECTS)\nDEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)\ndepcomp = $(SHELL) $(top_srcdir)/depcomp\nam__depfiles_maybe = depfiles\nCCASCOMPILE = $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS)\nLTCCASCOMPILE = $(LIBTOOL) --mode=compile $(CCAS) $(AM_CCASFLAGS) \\\n\t$(CCASFLAGS)\nCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\nLTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) \\\n\t$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \\\n\t$(AM_CFLAGS) $(CFLAGS)\nCCLD = $(CC)\nLINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(AM_CFLAGS) $(CFLAGS) \\\n\t$(AM_LDFLAGS) $(LDFLAGS) -o $@\nSOURCES = $(libsimd_la_SOURCES)\nDIST_SOURCES = $(am__libsimd_la_SOURCES_DIST)\nETAGS = etags\nCTAGS = ctags\nDISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)\nACLOCAL = @ACLOCAL@\nAMDEP_FALSE = @AMDEP_FALSE@\nAMDEP_TRUE = @AMDEP_TRUE@\nAMTAR = @AMTAR@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAWK = @AWK@\nBUILD = @BUILD@\nCC = @CC@\nCCAS = @CCAS@\nCCASFLAGS = @CCASFLAGS@\nCCDEPMODE = @CCDEPMODE@\nCFLAGS = @CFLAGS@\nCPP = @CPP@\nCPPFLAGS = @CPPFLAGS@\nCXX = @CXX@\nCXXCPP = @CXXCPP@\nCXXDEPMODE = @CXXDEPMODE@\nCXXFLAGS = @CXXFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEBARCH = @DEBARCH@\nDEFS = @DEFS@\nDEPDIR = @DEPDIR@\nECHO = @ECHO@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEGREP = @EGREP@\nEXEEXT = @EXEEXT@\nF77 = @F77@\nFFLAGS = @FFLAGS@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nJAR = @JAR@\nJAVA = @JAVA@\nJAVAC = @JAVAC@\nJAVACFLAGS = @JAVACFLAGS@\nJAVA_RPM_CONTENTS_1 = @JAVA_RPM_CONTENTS_1@\nJAVA_RPM_CONTENTS_2 = @JAVA_RPM_CONTENTS_2@\nJNI_CFLAGS = @JNI_CFLAGS@\nJPEG_LIB_VERSION = @JPEG_LIB_VERSION@\nJPEG_LIB_VERSION_DECIMAL = @JPEG_LIB_VERSION_DECIMAL@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBS = @LIBS@\nLIBTOOL = @LIBTOOL@\nLIBTOOL_CURRENT = @LIBTOOL_CURRENT@\nLN_S = @LN_S@\nLTLIBOBJS = @LTLIBOBJS@\nMAKEINFO = @MAKEINFO@\nMEM_SRCDST_FUNCTIONS = @MEM_SRCDST_FUNCTIONS@\nNAFLAGS = @NAFLAGS@\nNASM = @NASM@\nOBJEXT = @OBJEXT@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nPKGNAME = @PKGNAME@\nRANLIB = @RANLIB@\nRPMARCH = @RPMARCH@\nRPM_CONFIG_ARGS = @RPM_CONFIG_ARGS@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSIMD_ARM_FALSE = @SIMD_ARM_FALSE@\nSIMD_ARM_TRUE = @SIMD_ARM_TRUE@\nSIMD_I386_FALSE = @SIMD_I386_FALSE@\nSIMD_I386_TRUE = @SIMD_I386_TRUE@\nSIMD_X86_64_FALSE = @SIMD_X86_64_FALSE@\nSIMD_X86_64_TRUE = @SIMD_X86_64_TRUE@\nSO_AGE = @SO_AGE@\nSO_MAJOR_VERSION = @SO_MAJOR_VERSION@\nSO_MINOR_VERSION = @SO_MINOR_VERSION@\nSTRIP = @STRIP@\nVERSION = @VERSION@\nVERSION_SCRIPT_FALSE = @VERSION_SCRIPT_FALSE@\nVERSION_SCRIPT_FLAG = @VERSION_SCRIPT_FLAG@\nVERSION_SCRIPT_TRUE = @VERSION_SCRIPT_TRUE@\nWITH_ARITH_DEC_FALSE = @WITH_ARITH_DEC_FALSE@\nWITH_ARITH_DEC_TRUE = @WITH_ARITH_DEC_TRUE@\nWITH_ARITH_ENC_FALSE = @WITH_ARITH_ENC_FALSE@\nWITH_ARITH_ENC_TRUE = @WITH_ARITH_ENC_TRUE@\nWITH_ARITH_FALSE = @WITH_ARITH_FALSE@\nWITH_ARITH_TRUE = @WITH_ARITH_TRUE@\nWITH_JAVA = @WITH_JAVA@\nWITH_JAVA_FALSE = @WITH_JAVA_FALSE@\nWITH_JAVA_TRUE = @WITH_JAVA_TRUE@\nWITH_SIMD_FALSE = @WITH_SIMD_FALSE@\nWITH_SIMD_TRUE = @WITH_SIMD_TRUE@\nWITH_SSE_FLOAT_DCT_FALSE = @WITH_SSE_FLOAT_DCT_FALSE@\nWITH_SSE_FLOAT_DCT_TRUE = @WITH_SSE_FLOAT_DCT_TRUE@\nWITH_TURBOJPEG_FALSE = @WITH_TURBOJPEG_FALSE@\nWITH_TURBOJPEG_TRUE = @WITH_TURBOJPEG_TRUE@\nX86_64_FALSE = @X86_64_FALSE@\nX86_64_TRUE = @X86_64_TRUE@\nac_ct_AR = @ac_ct_AR@\nac_ct_CC = @ac_ct_CC@\nac_ct_CXX = @ac_ct_CXX@\nac_ct_F77 = @ac_ct_F77@\nac_ct_RANLIB = @ac_ct_RANLIB@\nac_ct_STRIP = @ac_ct_STRIP@\nam__fastdepCC_FALSE = @am__fastdepCC_FALSE@\nam__fastdepCC_TRUE = @am__fastdepCC_TRUE@\nam__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@\nam__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@\nam__include = @am__include@\nam__leading_dot = @am__leading_dot@\nam__quote = @am__quote@\nam__tar = @am__tar@\nam__untar = @am__untar@\nbindir = @bindir@\nbuild = @build@\nbuild_alias = @build_alias@\nbuild_cpu = @build_cpu@\nbuild_os = @build_os@\nbuild_vendor = @build_vendor@\ndatadir = @datadir@\nexec_prefix = @exec_prefix@\nhost = @host@\nhost_alias = @host_alias@\nhost_cpu = @host_cpu@\nhost_os = @host_os@\nhost_vendor = @host_vendor@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\nnoinst_LTLIBRARIES = libsimd.la\nBUILT_SOURCES = jsimdcfg.inc\nEXTRA_DIST = nasm_lt.sh jcclrmmx.asm jcclrss2.asm jdclrmmx.asm jdclrss2.asm \\\n\tjdmrgmmx.asm jdmrgss2.asm jcclrss2-64.asm jdclrss2-64.asm \\\n\tjdmrgss2-64.asm jcgryss2-64.asm jcgrymmx.asm jcgryss2.asm CMakeLists.txt\n\n@SIMD_ARM_TRUE@libsimd_la_SOURCES = jsimd_arm.c jsimd_arm_neon.S\n@SIMD_I386_TRUE@libsimd_la_SOURCES = jsimd_i386.c \\\n@SIMD_I386_TRUE@\tjsimd.h jsimdcfg.inc.h \\\n@SIMD_I386_TRUE@\tjsimdext.inc jcolsamp.inc jdct.inc \\\n@SIMD_I386_TRUE@\tjsimdcpu.asm \\\n@SIMD_I386_TRUE@\tjccolmmx.asm jdcolmmx.asm jcgrammx.asm \\\n@SIMD_I386_TRUE@\tjcsammmx.asm jdsammmx.asm jdmermmx.asm \\\n@SIMD_I386_TRUE@\tjcqntmmx.asm jfmmxfst.asm jfmmxint.asm \\\n@SIMD_I386_TRUE@\tjimmxred.asm jimmxint.asm jimmxfst.asm \\\n@SIMD_I386_TRUE@\tjcqnt3dn.asm jf3dnflt.asm ji3dnflt.asm \\\n@SIMD_I386_TRUE@\tjcqntsse.asm jfsseflt.asm jisseflt.asm \\\n@SIMD_I386_TRUE@\tjccolss2.asm jdcolss2.asm jcgrass2.asm \\\n@SIMD_I386_TRUE@\tjcsamss2.asm jdsamss2.asm jdmerss2.asm \\\n@SIMD_I386_TRUE@\tjcqnts2i.asm jfss2fst.asm jfss2int.asm \\\n@SIMD_I386_TRUE@\tjiss2red.asm jiss2int.asm jiss2fst.asm \\\n@SIMD_I386_TRUE@\tjcqnts2f.asm jiss2flt.asm\n\n@SIMD_X86_64_TRUE@libsimd_la_SOURCES = jsimd_x86_64.c \\\n@SIMD_X86_64_TRUE@\tjsimd.h jsimdcfg.inc.h \\\n@SIMD_X86_64_TRUE@\tjsimdext.inc jcolsamp.inc jdct.inc \\\n@SIMD_X86_64_TRUE@\tjfsseflt-64.asm jcgrass2-64.asm \\\n@SIMD_X86_64_TRUE@\tjccolss2-64.asm jdcolss2-64.asm \\\n@SIMD_X86_64_TRUE@\tjcsamss2-64.asm jdsamss2-64.asm jdmerss2-64.asm \\\n@SIMD_X86_64_TRUE@\tjcqnts2i-64.asm jfss2fst-64.asm jfss2int-64.asm \\\n@SIMD_X86_64_TRUE@\tjiss2red-64.asm jiss2int-64.asm jiss2fst-64.asm \\\n@SIMD_X86_64_TRUE@\tjcqnts2f-64.asm jiss2flt-64.asm\n\nAM_CPPFLAGS = -I$(top_srcdir) \nall: $(BUILT_SOURCES)\n\t$(MAKE) $(AM_MAKEFLAGS) all-am\n\n.SUFFIXES:\n.SUFFIXES: .S .asm .c .lo .o .obj\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \\\n\t\t&& exit 0; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  simd/Makefile'; \\\n\tcd $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign  simd/Makefile\n.PRECIOUS: Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n\nclean-noinstLTLIBRARIES:\n\t-test -z \"$(noinst_LTLIBRARIES)\" || rm -f $(noinst_LTLIBRARIES)\n\t@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \\\n\t  dir=\"`echo $$p | sed -e 's|/[^/]*$$||'`\"; \\\n\t  test \"$$dir\" != \"$$p\" || dir=.; \\\n\t  echo \"rm -f \\\"$${dir}/so_locations\\\"\"; \\\n\t  rm -f \"$${dir}/so_locations\"; \\\n\tdone\nlibsimd.la: $(libsimd_la_OBJECTS) $(libsimd_la_DEPENDENCIES) \n\t$(LINK)  $(libsimd_la_LDFLAGS) $(libsimd_la_OBJECTS) $(libsimd_la_LIBADD) $(LIBS)\n\nmostlyclean-compile:\n\t-rm -f *.$(OBJEXT)\n\ndistclean-compile:\n\t-rm -f *.tab.c\n\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsimd_arm.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsimd_i386.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jsimd_x86_64.Plo@am__quote@\n\n.S.o:\n\t$(CCASCOMPILE) -c $<\n\n.S.obj:\n\t$(CCASCOMPILE) -c `$(CYGPATH_W) '$<'`\n\n.S.lo:\n\t$(LTCCASCOMPILE) -c -o $@ $<\n\n.c.o:\n@am__fastdepCC_TRUE@\tif $(COMPILE) -MT $@ -MD -MP -MF \"$(DEPDIR)/$*.Tpo\" -c -o $@ $<; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/$*.Tpo\" \"$(DEPDIR)/$*.Po\"; else rm -f \"$(DEPDIR)/$*.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='$<' object='$@' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(COMPILE) -c $<\n\n.c.obj:\n@am__fastdepCC_TRUE@\tif $(COMPILE) -MT $@ -MD -MP -MF \"$(DEPDIR)/$*.Tpo\" -c -o $@ `$(CYGPATH_W) '$<'`; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/$*.Tpo\" \"$(DEPDIR)/$*.Po\"; else rm -f \"$(DEPDIR)/$*.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='$<' object='$@' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(COMPILE) -c `$(CYGPATH_W) '$<'`\n\n.c.lo:\n@am__fastdepCC_TRUE@\tif $(LTCOMPILE) -MT $@ -MD -MP -MF \"$(DEPDIR)/$*.Tpo\" -c -o $@ $<; \\\n@am__fastdepCC_TRUE@\tthen mv -f \"$(DEPDIR)/$*.Tpo\" \"$(DEPDIR)/$*.Plo\"; else rm -f \"$(DEPDIR)/$*.Tpo\"; exit 1; fi\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tsource='$<' object='$@' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(LTCOMPILE) -c -o $@ $<\n\nmostlyclean-libtool:\n\t-rm -f *.lo\n\nclean-libtool:\n\t-rm -rf .libs _libs\n\ndistclean-libtool:\n\t-rm -f libtool\nuninstall-info-am:\n\nID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)\n\tlist='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \\\n\tunique=`for i in $$list; do \\\n\t    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n\t  done | \\\n\t  $(AWK) '    { files[$$0] = 1; } \\\n\t       END { for (i in files) print i; }'`; \\\n\tmkid -fID $$unique\ntags: TAGS\n\nTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \\\n\t\t$(TAGS_FILES) $(LISP)\n\ttags=; \\\n\there=`pwd`; \\\n\tlist='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \\\n\tunique=`for i in $$list; do \\\n\t    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n\t  done | \\\n\t  $(AWK) '    { files[$$0] = 1; } \\\n\t       END { for (i in files) print i; }'`; \\\n\tif test -z \"$(ETAGS_ARGS)$$tags$$unique\"; then :; else \\\n\t  test -n \"$$unique\" || unique=$$empty_fix; \\\n\t  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t    $$tags $$unique; \\\n\tfi\nctags: CTAGS\nCTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \\\n\t\t$(TAGS_FILES) $(LISP)\n\ttags=; \\\n\there=`pwd`; \\\n\tlist='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \\\n\tunique=`for i in $$list; do \\\n\t    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n\t  done | \\\n\t  $(AWK) '    { files[$$0] = 1; } \\\n\t       END { for (i in files) print i; }'`; \\\n\ttest -z \"$(CTAGS_ARGS)$$tags$$unique\" \\\n\t  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \\\n\t     $$tags $$unique\n\nGTAGS:\n\there=`$(am__cd) $(top_builddir) && pwd` \\\n\t  && cd $(top_srcdir) \\\n\t  && gtags -i $(GTAGS_ARGS) $$here\n\ndistclean-tags:\n\t-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags\n\ndistdir: $(DISTFILES)\n\t@srcdirstrip=`echo \"$(srcdir)\" | sed 's|.|.|g'`; \\\n\ttopsrcdirstrip=`echo \"$(top_srcdir)\" | sed 's|.|.|g'`; \\\n\tlist='$(DISTFILES)'; for file in $$list; do \\\n\t  case $$file in \\\n\t    $(srcdir)/*) file=`echo \"$$file\" | sed \"s|^$$srcdirstrip/||\"`;; \\\n\t    $(top_srcdir)/*) file=`echo \"$$file\" | sed \"s|^$$topsrcdirstrip/|$(top_builddir)/|\"`;; \\\n\t  esac; \\\n\t  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \\\n\t  dir=`echo \"$$file\" | sed -e 's,/[^/]*$$,,'`; \\\n\t  if test \"$$dir\" != \"$$file\" && test \"$$dir\" != \".\"; then \\\n\t    dir=\"/$$dir\"; \\\n\t    $(mkdir_p) \"$(distdir)$$dir\"; \\\n\t  else \\\n\t    dir=''; \\\n\t  fi; \\\n\t  if test -d $$d/$$file; then \\\n\t    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \\\n\t      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \\\n\t    fi; \\\n\t    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \\\n\t  else \\\n\t    test -f $(distdir)/$$file \\\n\t    || cp -p $$d/$$file $(distdir)/$$file \\\n\t    || exit 1; \\\n\t  fi; \\\n\tdone\ncheck-am: all-am\ncheck: $(BUILT_SOURCES)\n\t$(MAKE) $(AM_MAKEFLAGS) check-am\nall-am: Makefile $(LTLIBRARIES)\ninstalldirs:\ninstall: $(BUILT_SOURCES)\n\t$(MAKE) $(AM_MAKEFLAGS) install-am\ninstall-exec: install-exec-am\ninstall-data: install-data-am\nuninstall: uninstall-am\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-am\ninstall-strip:\n\t$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t  install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t  `test -z '$(STRIP)' || \\\n\t    echo \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\"` install\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\n\t-test -z \"$(BUILT_SOURCES)\" || rm -f $(BUILT_SOURCES)\nclean: clean-am\n\nclean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \\\n\tmostlyclean-am\n\ndistclean: distclean-am\n\t-rm -rf ./$(DEPDIR)\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-compile distclean-generic \\\n\tdistclean-libtool distclean-tags\n\ndvi: dvi-am\n\ndvi-am:\n\nhtml: html-am\n\ninfo: info-am\n\ninfo-am:\n\ninstall-data-am:\n\ninstall-exec-am:\n\ninstall-info: install-info-am\n\ninstall-man:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-am\n\t-rm -rf ./$(DEPDIR)\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-am\n\nmostlyclean-am: mostlyclean-compile mostlyclean-generic \\\n\tmostlyclean-libtool\n\npdf: pdf-am\n\npdf-am:\n\nps: ps-am\n\nps-am:\n\nuninstall-am: uninstall-info-am\n\n.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \\\n\tclean-libtool clean-noinstLTLIBRARIES ctags distclean \\\n\tdistclean-compile distclean-generic distclean-libtool \\\n\tdistclean-tags distdir dvi dvi-am html html-am info info-am \\\n\tinstall install-am install-data install-data-am install-exec \\\n\tinstall-exec-am install-info install-info-am install-man \\\n\tinstall-strip installcheck installcheck-am installdirs \\\n\tmaintainer-clean maintainer-clean-generic mostlyclean \\\n\tmostlyclean-compile mostlyclean-generic mostlyclean-libtool \\\n\tpdf pdf-am ps ps-am tags uninstall uninstall-am \\\n\tuninstall-info-am\n\n\n@SIMD_X86_64_TRUE@jccolss2-64.lo: jcclrss2-64.asm\n@SIMD_X86_64_TRUE@jdcolss2-64.lo: jdclrss2-64.asm\n@SIMD_X86_64_TRUE@jcgrass2-64.lo: jcgryss2-64.asm\n@SIMD_X86_64_TRUE@jdmerss2-64.lo: jdmrgss2-64.asm\n\n@SIMD_I386_TRUE@jccolmmx.lo: jcclrmmx.asm\n@SIMD_I386_TRUE@jcgrammx.lo: jcgrymmx.asm\n@SIMD_I386_TRUE@jccolss2.lo: jcclrss2.asm\n@SIMD_I386_TRUE@jcgrass2.lo: jcgryss2.asm\n@SIMD_I386_TRUE@jdcolmmx.lo: jdclrmmx.asm\n@SIMD_I386_TRUE@jdcolss2.lo: jdclrss2.asm\n@SIMD_I386_TRUE@jdmermmx.lo: jdmrgmmx.asm\n@SIMD_I386_TRUE@jdmerss2.lo: jdmrgss2.asm\n\n.asm.lo:\n\t$(LIBTOOL) --mode=compile --tag NASM $(srcdir)/nasm_lt.sh $(NASM) $(NAFLAGS) -I$(srcdir) -I. $< -o $@\n\njsimdcfg.inc: $(srcdir)/jsimdcfg.inc.h ../jpeglib.h ../jconfig.h ../jmorecfg.h\n\t$(CPP) -I$(top_builddir) -I$(top_builddir)/simd $(srcdir)/jsimdcfg.inc.h | $(EGREP) \"^[\\;%]|^\\ %\" | sed 's%_cpp_protection_%%' | sed 's@% define@%define@g' > $@\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jcclrmmx.asm",
    "content": ";\n; jcclrmmx.asm - colorspace conversion (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\n; --------------------------------------------------------------------------\n;\n; Convert some rows of samples to the output colorspace.\n;\n; GLOBAL(void)\n; jsimd_rgb_ycc_convert_mmx (JDIMENSION img_width,\n;                           JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n;                           JDIMENSION output_row, int num_rows);\n;\n\n%define img_width(b)\t(b)+8\t\t\t; JDIMENSION img_width\n%define input_buf(b)\t(b)+12\t\t; JSAMPARRAY input_buf\n%define output_buf(b)\t(b)+16\t\t; JSAMPIMAGE output_buf\n%define output_row(b)\t(b)+20\t\t; JDIMENSION output_row\n%define num_rows(b)\t(b)+24\t\t; int num_rows\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_MMWORD\t; mmword wk[WK_NUM]\n%define WK_NUM\t\t8\n%define gotptr\t\twk(0)-SIZEOF_POINTER\t; void * gotptr\n\n\talign\t16\n\tglobal\tEXTN(jsimd_rgb_ycc_convert_mmx)\n\nEXTN(jsimd_rgb_ycc_convert_mmx):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_MMWORD)\t; align to 64 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [wk(0)]\n\tpushpic\teax\t\t; make a room for GOT address\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t\t; get GOT address\n\tmovpic\tPOINTER [gotptr], ebx\t; save GOT address\n\n\tmov\tecx, JDIMENSION [img_width(eax)]\t; num_cols\n\ttest\tecx,ecx\n\tjz\tnear .return\n\n\tpush\tecx\n\n\tmov\tesi, JSAMPIMAGE [output_buf(eax)]\n\tmov\tecx, JDIMENSION [output_row(eax)]\n\tmov\tedi, JSAMPARRAY [esi+0*SIZEOF_JSAMPARRAY]\n\tmov\tebx, JSAMPARRAY [esi+1*SIZEOF_JSAMPARRAY]\n\tmov\tedx, JSAMPARRAY [esi+2*SIZEOF_JSAMPARRAY]\n\tlea\tedi, [edi+ecx*SIZEOF_JSAMPROW]\n\tlea\tebx, [ebx+ecx*SIZEOF_JSAMPROW]\n\tlea\tedx, [edx+ecx*SIZEOF_JSAMPROW]\n\n\tpop\tecx\n\n\tmov\tesi, JSAMPARRAY [input_buf(eax)]\n\tmov\teax, INT [num_rows(eax)]\n\ttest\teax,eax\n\tjle\tnear .return\n\talignx\t16,7\n.rowloop:\n\tpushpic\teax\n\tpush\tedx\n\tpush\tebx\n\tpush\tedi\n\tpush\tesi\n\tpush\tecx\t\t\t; col\n\n\tmov\tesi, JSAMPROW [esi]\t; inptr\n\tmov\tedi, JSAMPROW [edi]\t; outptr0\n\tmov\tebx, JSAMPROW [ebx]\t; outptr1\n\tmov\tedx, JSAMPROW [edx]\t; outptr2\n\tmovpic\teax, POINTER [gotptr]\t; load GOT address (eax)\n\n\tcmp\tecx, byte SIZEOF_MMWORD\n\tjae\tshort .columnloop\n\talignx\t16,7\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n.column_ld1:\n\tpush\teax\n\tpush\tedx\n\tlea\tecx,[ecx+ecx*2]\t\t; imul ecx,RGB_PIXELSIZE\n\ttest\tcl, SIZEOF_BYTE\n\tjz\tshort .column_ld2\n\tsub\tecx, byte SIZEOF_BYTE\n\txor\teax,eax\n\tmov\tal, BYTE [esi+ecx]\n.column_ld2:\n\ttest\tcl, SIZEOF_WORD\n\tjz\tshort .column_ld4\n\tsub\tecx, byte SIZEOF_WORD\n\txor\tedx,edx\n\tmov\tdx, WORD [esi+ecx]\n\tshl\teax, WORD_BIT\n\tor\teax,edx\n.column_ld4:\n\tmovd\tmmA,eax\n\tpop\tedx\n\tpop\teax\n\ttest\tcl, SIZEOF_DWORD\n\tjz\tshort .column_ld8\n\tsub\tecx, byte SIZEOF_DWORD\n\tmovd\tmmG, DWORD [esi+ecx]\n\tpsllq\tmmA, DWORD_BIT\n\tpor\tmmA,mmG\n.column_ld8:\n\ttest\tcl, SIZEOF_MMWORD\n\tjz\tshort .column_ld16\n\tmovq\tmmG,mmA\n\tmovq\tmmA, MMWORD [esi+0*SIZEOF_MMWORD]\n\tmov\tecx, SIZEOF_MMWORD\n\tjmp\tshort .rgb_ycc_cnv\n.column_ld16:\n\ttest\tcl, 2*SIZEOF_MMWORD\n\tmov\tecx, SIZEOF_MMWORD\n\tjz\tshort .rgb_ycc_cnv\n\tmovq\tmmF,mmA\n\tmovq\tmmA, MMWORD [esi+0*SIZEOF_MMWORD]\n\tmovq\tmmG, MMWORD [esi+1*SIZEOF_MMWORD]\n\tjmp\tshort .rgb_ycc_cnv\n\talignx\t16,7\n\n.columnloop:\n\tmovq\tmmA, MMWORD [esi+0*SIZEOF_MMWORD]\n\tmovq\tmmG, MMWORD [esi+1*SIZEOF_MMWORD]\n\tmovq\tmmF, MMWORD [esi+2*SIZEOF_MMWORD]\n\n.rgb_ycc_cnv:\n\t; mmA=(00 10 20 01 11 21 02 12)\n\t; mmG=(22 03 13 23 04 14 24 05)\n\t; mmF=(15 25 06 16 26 07 17 27)\n\n\tmovq      mmD,mmA\n\tpsllq     mmA,4*BYTE_BIT\t; mmA=(-- -- -- -- 00 10 20 01)\n\tpsrlq     mmD,4*BYTE_BIT\t; mmD=(11 21 02 12 -- -- -- --)\n\n\tpunpckhbw mmA,mmG\t\t; mmA=(00 04 10 14 20 24 01 05)\n\tpsllq     mmG,4*BYTE_BIT\t; mmG=(-- -- -- -- 22 03 13 23)\n\n\tpunpcklbw mmD,mmF\t\t; mmD=(11 15 21 25 02 06 12 16)\n\tpunpckhbw mmG,mmF\t\t; mmG=(22 26 03 07 13 17 23 27)\n\n\tmovq      mmE,mmA\n\tpsllq     mmA,4*BYTE_BIT\t; mmA=(-- -- -- -- 00 04 10 14)\n\tpsrlq     mmE,4*BYTE_BIT\t; mmE=(20 24 01 05 -- -- -- --)\n\n\tpunpckhbw mmA,mmD\t\t; mmA=(00 02 04 06 10 12 14 16)\n\tpsllq     mmD,4*BYTE_BIT\t; mmD=(-- -- -- -- 11 15 21 25)\n\n\tpunpcklbw mmE,mmG\t\t; mmE=(20 22 24 26 01 03 05 07)\n\tpunpckhbw mmD,mmG\t\t; mmD=(11 13 15 17 21 23 25 27)\n\n\tpxor      mmH,mmH\n\n\tmovq      mmC,mmA\n\tpunpcklbw mmA,mmH\t\t; mmA=(00 02 04 06)\n\tpunpckhbw mmC,mmH\t\t; mmC=(10 12 14 16)\n\n\tmovq      mmB,mmE\n\tpunpcklbw mmE,mmH\t\t; mmE=(20 22 24 26)\n\tpunpckhbw mmB,mmH\t\t; mmB=(01 03 05 07)\n\n\tmovq      mmF,mmD\n\tpunpcklbw mmD,mmH\t\t; mmD=(11 13 15 17)\n\tpunpckhbw mmF,mmH\t\t; mmF=(21 23 25 27)\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n.column_ld1:\n\ttest\tcl, SIZEOF_MMWORD/8\n\tjz\tshort .column_ld2\n\tsub\tecx, byte SIZEOF_MMWORD/8\n\tmovd\tmmA, DWORD [esi+ecx*RGB_PIXELSIZE]\n.column_ld2:\n\ttest\tcl, SIZEOF_MMWORD/4\n\tjz\tshort .column_ld4\n\tsub\tecx, byte SIZEOF_MMWORD/4\n\tmovq\tmmF,mmA\n\tmovq\tmmA, MMWORD [esi+ecx*RGB_PIXELSIZE]\n.column_ld4:\n\ttest\tcl, SIZEOF_MMWORD/2\n\tmov\tecx, SIZEOF_MMWORD\n\tjz\tshort .rgb_ycc_cnv\n\tmovq\tmmD,mmA\n\tmovq\tmmC,mmF\n\tmovq\tmmA, MMWORD [esi+0*SIZEOF_MMWORD]\n\tmovq\tmmF, MMWORD [esi+1*SIZEOF_MMWORD]\n\tjmp\tshort .rgb_ycc_cnv\n\talignx\t16,7\n\n.columnloop:\n\tmovq\tmmA, MMWORD [esi+0*SIZEOF_MMWORD]\n\tmovq\tmmF, MMWORD [esi+1*SIZEOF_MMWORD]\n\tmovq\tmmD, MMWORD [esi+2*SIZEOF_MMWORD]\n\tmovq\tmmC, MMWORD [esi+3*SIZEOF_MMWORD]\n\n.rgb_ycc_cnv:\n\t; mmA=(00 10 20 30 01 11 21 31)\n\t; mmF=(02 12 22 32 03 13 23 33)\n\t; mmD=(04 14 24 34 05 15 25 35)\n\t; mmC=(06 16 26 36 07 17 27 37)\n\n\tmovq      mmB,mmA\n\tpunpcklbw mmA,mmF\t\t; mmA=(00 02 10 12 20 22 30 32)\n\tpunpckhbw mmB,mmF\t\t; mmB=(01 03 11 13 21 23 31 33)\n\n\tmovq      mmG,mmD\n\tpunpcklbw mmD,mmC\t\t; mmD=(04 06 14 16 24 26 34 36)\n\tpunpckhbw mmG,mmC\t\t; mmG=(05 07 15 17 25 27 35 37)\n\n\tmovq      mmE,mmA\n\tpunpcklwd mmA,mmD\t\t; mmA=(00 02 04 06 10 12 14 16)\n\tpunpckhwd mmE,mmD\t\t; mmE=(20 22 24 26 30 32 34 36)\n\n\tmovq      mmH,mmB\n\tpunpcklwd mmB,mmG\t\t; mmB=(01 03 05 07 11 13 15 17)\n\tpunpckhwd mmH,mmG\t\t; mmH=(21 23 25 27 31 33 35 37)\n\n\tpxor      mmF,mmF\n\n\tmovq      mmC,mmA\n\tpunpcklbw mmA,mmF\t\t; mmA=(00 02 04 06)\n\tpunpckhbw mmC,mmF\t\t; mmC=(10 12 14 16)\n\n\tmovq      mmD,mmB\n\tpunpcklbw mmB,mmF\t\t; mmB=(01 03 05 07)\n\tpunpckhbw mmD,mmF\t\t; mmD=(11 13 15 17)\n\n\tmovq      mmG,mmE\n\tpunpcklbw mmE,mmF\t\t; mmE=(20 22 24 26)\n\tpunpckhbw mmG,mmF\t\t; mmG=(30 32 34 36)\n\n\tpunpcklbw mmF,mmH\n\tpunpckhbw mmH,mmH\n\tpsrlw     mmF,BYTE_BIT\t\t; mmF=(21 23 25 27)\n\tpsrlw     mmH,BYTE_BIT\t\t; mmH=(31 33 35 37)\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n\t; mm0=(R0 R2 R4 R6)=RE, mm2=(G0 G2 G4 G6)=GE, mm4=(B0 B2 B4 B6)=BE\n\t; mm1=(R1 R3 R5 R7)=RO, mm3=(G1 G3 G5 G7)=GO, mm5=(B1 B3 B5 B7)=BO\n\n\t; (Original)\n\t; Y  =  0.29900 * R + 0.58700 * G + 0.11400 * B\n\t; Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE\n\t; Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE\n\t;\n\t; (This implementation)\n\t; Y  =  0.29900 * R + 0.33700 * G + 0.11400 * B + 0.25000 * G\n\t; Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE\n\t; Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE\n\n\tmovq      MMWORD [wk(0)], mm0\t; wk(0)=RE\n\tmovq      MMWORD [wk(1)], mm1\t; wk(1)=RO\n\tmovq      MMWORD [wk(2)], mm4\t; wk(2)=BE\n\tmovq      MMWORD [wk(3)], mm5\t; wk(3)=BO\n\n\tmovq      mm6,mm1\n\tpunpcklwd mm1,mm3\n\tpunpckhwd mm6,mm3\n\tmovq      mm7,mm1\n\tmovq      mm4,mm6\n\tpmaddwd   mm1,[GOTOFF(eax,PW_F0299_F0337)] ; mm1=ROL*FIX(0.299)+GOL*FIX(0.337)\n\tpmaddwd   mm6,[GOTOFF(eax,PW_F0299_F0337)] ; mm6=ROH*FIX(0.299)+GOH*FIX(0.337)\n\tpmaddwd   mm7,[GOTOFF(eax,PW_MF016_MF033)] ; mm7=ROL*-FIX(0.168)+GOL*-FIX(0.331)\n\tpmaddwd   mm4,[GOTOFF(eax,PW_MF016_MF033)] ; mm4=ROH*-FIX(0.168)+GOH*-FIX(0.331)\n\n\tmovq      MMWORD [wk(4)], mm1\t; wk(4)=ROL*FIX(0.299)+GOL*FIX(0.337)\n\tmovq      MMWORD [wk(5)], mm6\t; wk(5)=ROH*FIX(0.299)+GOH*FIX(0.337)\n\n\tpxor      mm1,mm1\n\tpxor      mm6,mm6\n\tpunpcklwd mm1,mm5\t\t; mm1=BOL\n\tpunpckhwd mm6,mm5\t\t; mm6=BOH\n\tpsrld     mm1,1\t\t\t; mm1=BOL*FIX(0.500)\n\tpsrld     mm6,1\t\t\t; mm6=BOH*FIX(0.500)\n\n\tmovq      mm5,[GOTOFF(eax,PD_ONEHALFM1_CJ)] ; mm5=[PD_ONEHALFM1_CJ]\n\n\tpaddd     mm7,mm1\n\tpaddd     mm4,mm6\n\tpaddd     mm7,mm5\n\tpaddd     mm4,mm5\n\tpsrld     mm7,SCALEBITS\t\t; mm7=CbOL\n\tpsrld     mm4,SCALEBITS\t\t; mm4=CbOH\n\tpackssdw  mm7,mm4\t\t; mm7=CbO\n\n\tmovq      mm1, MMWORD [wk(2)]\t; mm1=BE\n\n\tmovq      mm6,mm0\n\tpunpcklwd mm0,mm2\n\tpunpckhwd mm6,mm2\n\tmovq      mm5,mm0\n\tmovq      mm4,mm6\n\tpmaddwd   mm0,[GOTOFF(eax,PW_F0299_F0337)] ; mm0=REL*FIX(0.299)+GEL*FIX(0.337)\n\tpmaddwd   mm6,[GOTOFF(eax,PW_F0299_F0337)] ; mm6=REH*FIX(0.299)+GEH*FIX(0.337)\n\tpmaddwd   mm5,[GOTOFF(eax,PW_MF016_MF033)] ; mm5=REL*-FIX(0.168)+GEL*-FIX(0.331)\n\tpmaddwd   mm4,[GOTOFF(eax,PW_MF016_MF033)] ; mm4=REH*-FIX(0.168)+GEH*-FIX(0.331)\n\n\tmovq      MMWORD [wk(6)], mm0\t; wk(6)=REL*FIX(0.299)+GEL*FIX(0.337)\n\tmovq      MMWORD [wk(7)], mm6\t; wk(7)=REH*FIX(0.299)+GEH*FIX(0.337)\n\n\tpxor      mm0,mm0\n\tpxor      mm6,mm6\n\tpunpcklwd mm0,mm1\t\t; mm0=BEL\n\tpunpckhwd mm6,mm1\t\t; mm6=BEH\n\tpsrld     mm0,1\t\t\t; mm0=BEL*FIX(0.500)\n\tpsrld     mm6,1\t\t\t; mm6=BEH*FIX(0.500)\n\n\tmovq      mm1,[GOTOFF(eax,PD_ONEHALFM1_CJ)] ; mm1=[PD_ONEHALFM1_CJ]\n\n\tpaddd     mm5,mm0\n\tpaddd     mm4,mm6\n\tpaddd     mm5,mm1\n\tpaddd     mm4,mm1\n\tpsrld     mm5,SCALEBITS\t\t; mm5=CbEL\n\tpsrld     mm4,SCALEBITS\t\t; mm4=CbEH\n\tpackssdw  mm5,mm4\t\t; mm5=CbE\n\n\tpsllw     mm7,BYTE_BIT\n\tpor       mm5,mm7\t\t; mm5=Cb\n\tmovq      MMWORD [ebx], mm5\t; Save Cb\n\n\tmovq      mm0, MMWORD [wk(3)]\t; mm0=BO\n\tmovq      mm6, MMWORD [wk(2)]\t; mm6=BE\n\tmovq      mm1, MMWORD [wk(1)]\t; mm1=RO\n\n\tmovq      mm4,mm0\n\tpunpcklwd mm0,mm3\n\tpunpckhwd mm4,mm3\n\tmovq      mm7,mm0\n\tmovq      mm5,mm4\n\tpmaddwd   mm0,[GOTOFF(eax,PW_F0114_F0250)] ; mm0=BOL*FIX(0.114)+GOL*FIX(0.250)\n\tpmaddwd   mm4,[GOTOFF(eax,PW_F0114_F0250)] ; mm4=BOH*FIX(0.114)+GOH*FIX(0.250)\n\tpmaddwd   mm7,[GOTOFF(eax,PW_MF008_MF041)] ; mm7=BOL*-FIX(0.081)+GOL*-FIX(0.418)\n\tpmaddwd   mm5,[GOTOFF(eax,PW_MF008_MF041)] ; mm5=BOH*-FIX(0.081)+GOH*-FIX(0.418)\n\n\tmovq      mm3,[GOTOFF(eax,PD_ONEHALF)]\t; mm3=[PD_ONEHALF]\n\n\tpaddd     mm0, MMWORD [wk(4)]\n\tpaddd     mm4, MMWORD [wk(5)]\n\tpaddd     mm0,mm3\n\tpaddd     mm4,mm3\n\tpsrld     mm0,SCALEBITS\t\t; mm0=YOL\n\tpsrld     mm4,SCALEBITS\t\t; mm4=YOH\n\tpackssdw  mm0,mm4\t\t; mm0=YO\n\n\tpxor      mm3,mm3\n\tpxor      mm4,mm4\n\tpunpcklwd mm3,mm1\t\t; mm3=ROL\n\tpunpckhwd mm4,mm1\t\t; mm4=ROH\n\tpsrld     mm3,1\t\t\t; mm3=ROL*FIX(0.500)\n\tpsrld     mm4,1\t\t\t; mm4=ROH*FIX(0.500)\n\n\tmovq      mm1,[GOTOFF(eax,PD_ONEHALFM1_CJ)] ; mm1=[PD_ONEHALFM1_CJ]\n\n\tpaddd     mm7,mm3\n\tpaddd     mm5,mm4\n\tpaddd     mm7,mm1\n\tpaddd     mm5,mm1\n\tpsrld     mm7,SCALEBITS\t\t; mm7=CrOL\n\tpsrld     mm5,SCALEBITS\t\t; mm5=CrOH\n\tpackssdw  mm7,mm5\t\t; mm7=CrO\n\n\tmovq      mm3, MMWORD [wk(0)]\t; mm3=RE\n\n\tmovq      mm4,mm6\n\tpunpcklwd mm6,mm2\n\tpunpckhwd mm4,mm2\n\tmovq      mm1,mm6\n\tmovq      mm5,mm4\n\tpmaddwd   mm6,[GOTOFF(eax,PW_F0114_F0250)] ; mm6=BEL*FIX(0.114)+GEL*FIX(0.250)\n\tpmaddwd   mm4,[GOTOFF(eax,PW_F0114_F0250)] ; mm4=BEH*FIX(0.114)+GEH*FIX(0.250)\n\tpmaddwd   mm1,[GOTOFF(eax,PW_MF008_MF041)] ; mm1=BEL*-FIX(0.081)+GEL*-FIX(0.418)\n\tpmaddwd   mm5,[GOTOFF(eax,PW_MF008_MF041)] ; mm5=BEH*-FIX(0.081)+GEH*-FIX(0.418)\n\n\tmovq      mm2,[GOTOFF(eax,PD_ONEHALF)]\t; mm2=[PD_ONEHALF]\n\n\tpaddd     mm6, MMWORD [wk(6)]\n\tpaddd     mm4, MMWORD [wk(7)]\n\tpaddd     mm6,mm2\n\tpaddd     mm4,mm2\n\tpsrld     mm6,SCALEBITS\t\t; mm6=YEL\n\tpsrld     mm4,SCALEBITS\t\t; mm4=YEH\n\tpackssdw  mm6,mm4\t\t; mm6=YE\n\n\tpsllw     mm0,BYTE_BIT\n\tpor       mm6,mm0\t\t; mm6=Y\n\tmovq      MMWORD [edi], mm6\t; Save Y\n\n\tpxor      mm2,mm2\n\tpxor      mm4,mm4\n\tpunpcklwd mm2,mm3\t\t; mm2=REL\n\tpunpckhwd mm4,mm3\t\t; mm4=REH\n\tpsrld     mm2,1\t\t\t; mm2=REL*FIX(0.500)\n\tpsrld     mm4,1\t\t\t; mm4=REH*FIX(0.500)\n\n\tmovq      mm0,[GOTOFF(eax,PD_ONEHALFM1_CJ)] ; mm0=[PD_ONEHALFM1_CJ]\n\n\tpaddd     mm1,mm2\n\tpaddd     mm5,mm4\n\tpaddd     mm1,mm0\n\tpaddd     mm5,mm0\n\tpsrld     mm1,SCALEBITS\t\t; mm1=CrEL\n\tpsrld     mm5,SCALEBITS\t\t; mm5=CrEH\n\tpackssdw  mm1,mm5\t\t; mm1=CrE\n\n\tpsllw     mm7,BYTE_BIT\n\tpor       mm1,mm7\t\t; mm1=Cr\n\tmovq      MMWORD [edx], mm1\t; Save Cr\n\n\tsub\tecx, byte SIZEOF_MMWORD\n\tadd\tesi, byte RGB_PIXELSIZE*SIZEOF_MMWORD\t; inptr\n\tadd\tedi, byte SIZEOF_MMWORD\t\t\t; outptr0\n\tadd\tebx, byte SIZEOF_MMWORD\t\t\t; outptr1\n\tadd\tedx, byte SIZEOF_MMWORD\t\t\t; outptr2\n\tcmp\tecx, byte SIZEOF_MMWORD\n\tjae\tnear .columnloop\n\ttest\tecx,ecx\n\tjnz\tnear .column_ld1\n\n\tpop\tecx\t\t\t; col\n\tpop\tesi\n\tpop\tedi\n\tpop\tebx\n\tpop\tedx\n\tpoppic\teax\n\n\tadd\tesi, byte SIZEOF_JSAMPROW\t; input_buf\n\tadd\tedi, byte SIZEOF_JSAMPROW\n\tadd\tebx, byte SIZEOF_JSAMPROW\n\tadd\tedx, byte SIZEOF_JSAMPROW\n\tdec\teax\t\t\t\t; num_rows\n\tjg\tnear .rowloop\n\n\temms\t\t; empty MMX state\n\n.return:\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jcclrss2-64.asm",
    "content": ";\n; jcclrss2-64.asm - colorspace conversion (64-bit SSE2)\n;\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; Copyright (C) 2009, D. R. Commander.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\n; --------------------------------------------------------------------------\n;\n; Convert some rows of samples to the output colorspace.\n;\n; GLOBAL(void)\n; jsimd_rgb_ycc_convert_sse2 (JDIMENSION img_width,\n;                             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n;                             JDIMENSION output_row, int num_rows);\n;\n\n; r10 = JDIMENSION img_width\n; r11 = JSAMPARRAY input_buf\n; r12 = JSAMPIMAGE output_buf\n; r13 = JDIMENSION output_row\n; r14 = int num_rows\n\n%define wk(i)\t\trbp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t8\n\n\talign\t16\n\n\tglobal\tEXTN(jsimd_rgb_ycc_convert_sse2)\n\nEXTN(jsimd_rgb_ycc_convert_sse2):\n\tpush\trbp\n\tmov\trax,rsp\t\t\t\t; rax = original rbp\n\tsub\trsp, byte 4\n\tand\trsp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[rsp],rax\n\tmov\trbp,rsp\t\t\t\t; rbp = aligned rbp\n\tlea\trsp, [wk(0)]\n\tcollect_args\n\tpush\trbx\n\n\tmov\trcx, r10\n\ttest\trcx,rcx\n\tjz\tnear .return\n\n\tpush\trcx\n\n\tmov rsi, r12\n\tmov rcx, r13\n\tmov\trdi, JSAMPARRAY [rsi+0*SIZEOF_JSAMPARRAY]\n\tmov\trbx, JSAMPARRAY [rsi+1*SIZEOF_JSAMPARRAY]\n\tmov\trdx, JSAMPARRAY [rsi+2*SIZEOF_JSAMPARRAY]\n\tlea\trdi, [rdi+rcx*SIZEOF_JSAMPROW]\n\tlea\trbx, [rbx+rcx*SIZEOF_JSAMPROW]\n\tlea\trdx, [rdx+rcx*SIZEOF_JSAMPROW]\n\n\tpop\trcx\n\n\tmov rsi, r11\n\tmov\teax, r14d\n\ttest\trax,rax\n\tjle\tnear .return\n.rowloop:\n\tpush\trdx\n\tpush\trbx\n\tpush\trdi\n\tpush\trsi\n\tpush\trcx\t\t\t; col\n\n\tmov\trsi, JSAMPROW [rsi]\t; inptr\n\tmov\trdi, JSAMPROW [rdi]\t; outptr0\n\tmov\trbx, JSAMPROW [rbx]\t; outptr1\n\tmov\trdx, JSAMPROW [rdx]\t; outptr2\n\n\tcmp\trcx, byte SIZEOF_XMMWORD\n\tjae\tnear .columnloop\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n.column_ld1:\n\tpush\trax\n\tpush\trdx\n\tlea\trcx,[rcx+rcx*2]\t\t; imul ecx,RGB_PIXELSIZE\n\ttest\tcl, SIZEOF_BYTE\n\tjz\tshort .column_ld2\n\tsub\trcx, byte SIZEOF_BYTE\n\tmovzx\trax, BYTE [rsi+rcx]\n.column_ld2:\n\ttest\tcl, SIZEOF_WORD\n\tjz\tshort .column_ld4\n\tsub\trcx, byte SIZEOF_WORD\n\tmovzx\trdx, WORD [rsi+rcx]\n\tshl\trax, WORD_BIT\n\tor\trax,rdx\n.column_ld4:\n\tmovd\txmmA,eax\n\tpop\trdx\n\tpop\trax\n\ttest\tcl, SIZEOF_DWORD\n\tjz\tshort .column_ld8\n\tsub\trcx, byte SIZEOF_DWORD\n\tmovd\txmmF, XMM_DWORD [rsi+rcx]\n\tpslldq\txmmA, SIZEOF_DWORD\n\tpor\txmmA,xmmF\n.column_ld8:\n\ttest\tcl, SIZEOF_MMWORD\n\tjz\tshort .column_ld16\n\tsub\trcx, byte SIZEOF_MMWORD\n\tmovq\txmmB, XMM_MMWORD [rsi+rcx]\n\tpslldq\txmmA, SIZEOF_MMWORD\n\tpor\txmmA,xmmB\n.column_ld16:\n\ttest\tcl, SIZEOF_XMMWORD\n\tjz\tshort .column_ld32\n\tmovdqa\txmmF,xmmA\n\tmovdqu\txmmA, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n\tmov\trcx, SIZEOF_XMMWORD\n\tjmp\tshort .rgb_ycc_cnv\n.column_ld32:\n\ttest\tcl, 2*SIZEOF_XMMWORD\n\tmov\trcx, SIZEOF_XMMWORD\n\tjz\tshort .rgb_ycc_cnv\n\tmovdqa\txmmB,xmmA\n\tmovdqu\txmmA, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n\tmovdqu\txmmF, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n\tjmp\tshort .rgb_ycc_cnv\n\n.columnloop:\n\tmovdqu\txmmA, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n\tmovdqu\txmmF, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n\tmovdqu\txmmB, XMMWORD [rsi+2*SIZEOF_XMMWORD]\n\n.rgb_ycc_cnv:\n\t; xmmA=(00 10 20 01 11 21 02 12 22 03 13 23 04 14 24 05)\n\t; xmmF=(15 25 06 16 26 07 17 27 08 18 28 09 19 29 0A 1A)\n\t; xmmB=(2A 0B 1B 2B 0C 1C 2C 0D 1D 2D 0E 1E 2E 0F 1F 2F)\n\n\tmovdqa    xmmG,xmmA\n\tpslldq    xmmA,8\t; xmmA=(-- -- -- -- -- -- -- -- 00 10 20 01 11 21 02 12)\n\tpsrldq    xmmG,8\t; xmmG=(22 03 13 23 04 14 24 05 -- -- -- -- -- -- -- --)\n\n\tpunpckhbw xmmA,xmmF\t; xmmA=(00 08 10 18 20 28 01 09 11 19 21 29 02 0A 12 1A)\n\tpslldq    xmmF,8\t; xmmF=(-- -- -- -- -- -- -- -- 15 25 06 16 26 07 17 27)\n\n\tpunpcklbw xmmG,xmmB\t; xmmG=(22 2A 03 0B 13 1B 23 2B 04 0C 14 1C 24 2C 05 0D)\n\tpunpckhbw xmmF,xmmB\t; xmmF=(15 1D 25 2D 06 0E 16 1E 26 2E 07 0F 17 1F 27 2F)\n\n\tmovdqa    xmmD,xmmA\n\tpslldq    xmmA,8\t; xmmA=(-- -- -- -- -- -- -- -- 00 08 10 18 20 28 01 09)\n\tpsrldq    xmmD,8\t; xmmD=(11 19 21 29 02 0A 12 1A -- -- -- -- -- -- -- --)\n\n\tpunpckhbw xmmA,xmmG\t; xmmA=(00 04 08 0C 10 14 18 1C 20 24 28 2C 01 05 09 0D)\n\tpslldq    xmmG,8\t; xmmG=(-- -- -- -- -- -- -- -- 22 2A 03 0B 13 1B 23 2B)\n\n\tpunpcklbw xmmD,xmmF\t; xmmD=(11 15 19 1D 21 25 29 2D 02 06 0A 0E 12 16 1A 1E)\n\tpunpckhbw xmmG,xmmF\t; xmmG=(22 26 2A 2E 03 07 0B 0F 13 17 1B 1F 23 27 2B 2F)\n\n\tmovdqa    xmmE,xmmA\n\tpslldq    xmmA,8\t; xmmA=(-- -- -- -- -- -- -- -- 00 04 08 0C 10 14 18 1C)\n\tpsrldq    xmmE,8\t; xmmE=(20 24 28 2C 01 05 09 0D -- -- -- -- -- -- -- --)\n\n\tpunpckhbw xmmA,xmmD\t; xmmA=(00 02 04 06 08 0A 0C 0E 10 12 14 16 18 1A 1C 1E)\n\tpslldq    xmmD,8\t; xmmD=(-- -- -- -- -- -- -- -- 11 15 19 1D 21 25 29 2D)\n\n\tpunpcklbw xmmE,xmmG\t; xmmE=(20 22 24 26 28 2A 2C 2E 01 03 05 07 09 0B 0D 0F)\n\tpunpckhbw xmmD,xmmG\t; xmmD=(11 13 15 17 19 1B 1D 1F 21 23 25 27 29 2B 2D 2F)\n\n\tpxor      xmmH,xmmH\n\n\tmovdqa    xmmC,xmmA\n\tpunpcklbw xmmA,xmmH\t; xmmA=(00 02 04 06 08 0A 0C 0E)\n\tpunpckhbw xmmC,xmmH\t; xmmC=(10 12 14 16 18 1A 1C 1E)\n\n\tmovdqa    xmmB,xmmE\n\tpunpcklbw xmmE,xmmH\t; xmmE=(20 22 24 26 28 2A 2C 2E)\n\tpunpckhbw xmmB,xmmH\t; xmmB=(01 03 05 07 09 0B 0D 0F)\n\n\tmovdqa    xmmF,xmmD\n\tpunpcklbw xmmD,xmmH\t; xmmD=(11 13 15 17 19 1B 1D 1F)\n\tpunpckhbw xmmF,xmmH\t; xmmF=(21 23 25 27 29 2B 2D 2F)\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n.column_ld1:\n\ttest\tcl, SIZEOF_XMMWORD/16\n\tjz\tshort .column_ld2\n\tsub\trcx, byte SIZEOF_XMMWORD/16\n\tmovd\txmmA, XMM_DWORD [rsi+rcx*RGB_PIXELSIZE]\n.column_ld2:\n\ttest\tcl, SIZEOF_XMMWORD/8\n\tjz\tshort .column_ld4\n\tsub\trcx, byte SIZEOF_XMMWORD/8\n\tmovq\txmmE, XMM_MMWORD [rsi+rcx*RGB_PIXELSIZE]\n\tpslldq\txmmA, SIZEOF_MMWORD\n\tpor\txmmA,xmmE\n.column_ld4:\n\ttest\tcl, SIZEOF_XMMWORD/4\n\tjz\tshort .column_ld8\n\tsub\trcx, byte SIZEOF_XMMWORD/4\n\tmovdqa\txmmE,xmmA\n\tmovdqu\txmmA, XMMWORD [rsi+rcx*RGB_PIXELSIZE]\n.column_ld8:\n\ttest\tcl, SIZEOF_XMMWORD/2\n\tmov\trcx, SIZEOF_XMMWORD\n\tjz\tshort .rgb_ycc_cnv\n\tmovdqa\txmmF,xmmA\n\tmovdqa\txmmH,xmmE\n\tmovdqu\txmmA, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n\tmovdqu\txmmE, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n\tjmp\tshort .rgb_ycc_cnv\n\n.columnloop:\n\tmovdqu\txmmA, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n\tmovdqu\txmmE, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n\tmovdqu\txmmF, XMMWORD [rsi+2*SIZEOF_XMMWORD]\n\tmovdqu\txmmH, XMMWORD [rsi+3*SIZEOF_XMMWORD]\n\n.rgb_ycc_cnv:\n\t; xmmA=(00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33)\n\t; xmmE=(04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37)\n\t; xmmF=(08 18 28 38 09 19 29 39 0A 1A 2A 3A 0B 1B 2B 3B)\n\t; xmmH=(0C 1C 2C 3C 0D 1D 2D 3D 0E 1E 2E 3E 0F 1F 2F 3F)\n\n\tmovdqa    xmmD,xmmA\n\tpunpcklbw xmmA,xmmE\t; xmmA=(00 04 10 14 20 24 30 34 01 05 11 15 21 25 31 35)\n\tpunpckhbw xmmD,xmmE\t; xmmD=(02 06 12 16 22 26 32 36 03 07 13 17 23 27 33 37)\n\n\tmovdqa    xmmC,xmmF\n\tpunpcklbw xmmF,xmmH\t; xmmF=(08 0C 18 1C 28 2C 38 3C 09 0D 19 1D 29 2D 39 3D)\n\tpunpckhbw xmmC,xmmH\t; xmmC=(0A 0E 1A 1E 2A 2E 3A 3E 0B 0F 1B 1F 2B 2F 3B 3F)\n\n\tmovdqa    xmmB,xmmA\n\tpunpcklwd xmmA,xmmF\t; xmmA=(00 04 08 0C 10 14 18 1C 20 24 28 2C 30 34 38 3C)\n\tpunpckhwd xmmB,xmmF\t; xmmB=(01 05 09 0D 11 15 19 1D 21 25 29 2D 31 35 39 3D)\n\n\tmovdqa    xmmG,xmmD\n\tpunpcklwd xmmD,xmmC\t; xmmD=(02 06 0A 0E 12 16 1A 1E 22 26 2A 2E 32 36 3A 3E)\n\tpunpckhwd xmmG,xmmC\t; xmmG=(03 07 0B 0F 13 17 1B 1F 23 27 2B 2F 33 37 3B 3F)\n\n\tmovdqa    xmmE,xmmA\n\tpunpcklbw xmmA,xmmD\t; xmmA=(00 02 04 06 08 0A 0C 0E 10 12 14 16 18 1A 1C 1E)\n\tpunpckhbw xmmE,xmmD\t; xmmE=(20 22 24 26 28 2A 2C 2E 30 32 34 36 38 3A 3C 3E)\n\n\tmovdqa    xmmH,xmmB\n\tpunpcklbw xmmB,xmmG\t; xmmB=(01 03 05 07 09 0B 0D 0F 11 13 15 17 19 1B 1D 1F)\n\tpunpckhbw xmmH,xmmG\t; xmmH=(21 23 25 27 29 2B 2D 2F 31 33 35 37 39 3B 3D 3F)\n\n\tpxor      xmmF,xmmF\n\n\tmovdqa    xmmC,xmmA\n\tpunpcklbw xmmA,xmmF\t; xmmA=(00 02 04 06 08 0A 0C 0E)\n\tpunpckhbw xmmC,xmmF\t; xmmC=(10 12 14 16 18 1A 1C 1E)\n\n\tmovdqa    xmmD,xmmB\n\tpunpcklbw xmmB,xmmF\t; xmmB=(01 03 05 07 09 0B 0D 0F)\n\tpunpckhbw xmmD,xmmF\t; xmmD=(11 13 15 17 19 1B 1D 1F)\n\n\tmovdqa    xmmG,xmmE\n\tpunpcklbw xmmE,xmmF\t; xmmE=(20 22 24 26 28 2A 2C 2E)\n\tpunpckhbw xmmG,xmmF\t; xmmG=(30 32 34 36 38 3A 3C 3E)\n\n\tpunpcklbw xmmF,xmmH\n\tpunpckhbw xmmH,xmmH\n\tpsrlw     xmmF,BYTE_BIT\t; xmmF=(21 23 25 27 29 2B 2D 2F)\n\tpsrlw     xmmH,BYTE_BIT\t; xmmH=(31 33 35 37 39 3B 3D 3F)\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n\t; xmm0=R(02468ACE)=RE, xmm2=G(02468ACE)=GE, xmm4=B(02468ACE)=BE\n\t; xmm1=R(13579BDF)=RO, xmm3=G(13579BDF)=GO, xmm5=B(13579BDF)=BO\n\n\t; (Original)\n\t; Y  =  0.29900 * R + 0.58700 * G + 0.11400 * B\n\t; Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE\n\t; Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE\n\t;\n\t; (This implementation)\n\t; Y  =  0.29900 * R + 0.33700 * G + 0.11400 * B + 0.25000 * G\n\t; Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE\n\t; Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE\n\n\tmovdqa    XMMWORD [wk(0)], xmm0\t; wk(0)=RE\n\tmovdqa    XMMWORD [wk(1)], xmm1\t; wk(1)=RO\n\tmovdqa    XMMWORD [wk(2)], xmm4\t; wk(2)=BE\n\tmovdqa    XMMWORD [wk(3)], xmm5\t; wk(3)=BO\n\n\tmovdqa    xmm6,xmm1\n\tpunpcklwd xmm1,xmm3\n\tpunpckhwd xmm6,xmm3\n\tmovdqa    xmm7,xmm1\n\tmovdqa    xmm4,xmm6\n\tpmaddwd   xmm1,[rel PW_F0299_F0337] ; xmm1=ROL*FIX(0.299)+GOL*FIX(0.337)\n\tpmaddwd   xmm6,[rel PW_F0299_F0337] ; xmm6=ROH*FIX(0.299)+GOH*FIX(0.337)\n\tpmaddwd   xmm7,[rel PW_MF016_MF033] ; xmm7=ROL*-FIX(0.168)+GOL*-FIX(0.331)\n\tpmaddwd   xmm4,[rel PW_MF016_MF033] ; xmm4=ROH*-FIX(0.168)+GOH*-FIX(0.331)\n\n\tmovdqa    XMMWORD [wk(4)], xmm1\t; wk(4)=ROL*FIX(0.299)+GOL*FIX(0.337)\n\tmovdqa    XMMWORD [wk(5)], xmm6\t; wk(5)=ROH*FIX(0.299)+GOH*FIX(0.337)\n\n\tpxor      xmm1,xmm1\n\tpxor      xmm6,xmm6\n\tpunpcklwd xmm1,xmm5\t\t; xmm1=BOL\n\tpunpckhwd xmm6,xmm5\t\t; xmm6=BOH\n\tpsrld     xmm1,1\t\t; xmm1=BOL*FIX(0.500)\n\tpsrld     xmm6,1\t\t; xmm6=BOH*FIX(0.500)\n\n\tmovdqa    xmm5,[rel PD_ONEHALFM1_CJ] ; xmm5=[PD_ONEHALFM1_CJ]\n\n\tpaddd     xmm7,xmm1\n\tpaddd     xmm4,xmm6\n\tpaddd     xmm7,xmm5\n\tpaddd     xmm4,xmm5\n\tpsrld     xmm7,SCALEBITS\t; xmm7=CbOL\n\tpsrld     xmm4,SCALEBITS\t; xmm4=CbOH\n\tpackssdw  xmm7,xmm4\t\t; xmm7=CbO\n\n\tmovdqa    xmm1, XMMWORD [wk(2)]\t; xmm1=BE\n\n\tmovdqa    xmm6,xmm0\n\tpunpcklwd xmm0,xmm2\n\tpunpckhwd xmm6,xmm2\n\tmovdqa    xmm5,xmm0\n\tmovdqa    xmm4,xmm6\n\tpmaddwd   xmm0,[rel PW_F0299_F0337] ; xmm0=REL*FIX(0.299)+GEL*FIX(0.337)\n\tpmaddwd   xmm6,[rel PW_F0299_F0337] ; xmm6=REH*FIX(0.299)+GEH*FIX(0.337)\n\tpmaddwd   xmm5,[rel PW_MF016_MF033] ; xmm5=REL*-FIX(0.168)+GEL*-FIX(0.331)\n\tpmaddwd   xmm4,[rel PW_MF016_MF033] ; xmm4=REH*-FIX(0.168)+GEH*-FIX(0.331)\n\n\tmovdqa    XMMWORD [wk(6)], xmm0\t; wk(6)=REL*FIX(0.299)+GEL*FIX(0.337)\n\tmovdqa    XMMWORD [wk(7)], xmm6\t; wk(7)=REH*FIX(0.299)+GEH*FIX(0.337)\n\n\tpxor      xmm0,xmm0\n\tpxor      xmm6,xmm6\n\tpunpcklwd xmm0,xmm1\t\t; xmm0=BEL\n\tpunpckhwd xmm6,xmm1\t\t; xmm6=BEH\n\tpsrld     xmm0,1\t\t; xmm0=BEL*FIX(0.500)\n\tpsrld     xmm6,1\t\t; xmm6=BEH*FIX(0.500)\n\n\tmovdqa    xmm1,[rel PD_ONEHALFM1_CJ] ; xmm1=[PD_ONEHALFM1_CJ]\n\n\tpaddd     xmm5,xmm0\n\tpaddd     xmm4,xmm6\n\tpaddd     xmm5,xmm1\n\tpaddd     xmm4,xmm1\n\tpsrld     xmm5,SCALEBITS\t; xmm5=CbEL\n\tpsrld     xmm4,SCALEBITS\t; xmm4=CbEH\n\tpackssdw  xmm5,xmm4\t\t; xmm5=CbE\n\n\tpsllw     xmm7,BYTE_BIT\n\tpor       xmm5,xmm7\t\t; xmm5=Cb\n\tmovdqa    XMMWORD [rbx], xmm5\t; Save Cb\n\n\tmovdqa    xmm0, XMMWORD [wk(3)]\t; xmm0=BO\n\tmovdqa    xmm6, XMMWORD [wk(2)]\t; xmm6=BE\n\tmovdqa    xmm1, XMMWORD [wk(1)]\t; xmm1=RO\n\n\tmovdqa    xmm4,xmm0\n\tpunpcklwd xmm0,xmm3\n\tpunpckhwd xmm4,xmm3\n\tmovdqa    xmm7,xmm0\n\tmovdqa    xmm5,xmm4\n\tpmaddwd   xmm0,[rel PW_F0114_F0250] ; xmm0=BOL*FIX(0.114)+GOL*FIX(0.250)\n\tpmaddwd   xmm4,[rel PW_F0114_F0250] ; xmm4=BOH*FIX(0.114)+GOH*FIX(0.250)\n\tpmaddwd   xmm7,[rel PW_MF008_MF041] ; xmm7=BOL*-FIX(0.081)+GOL*-FIX(0.418)\n\tpmaddwd   xmm5,[rel PW_MF008_MF041] ; xmm5=BOH*-FIX(0.081)+GOH*-FIX(0.418)\n\n\tmovdqa    xmm3,[rel PD_ONEHALF]\t; xmm3=[PD_ONEHALF]\n\n\tpaddd     xmm0, XMMWORD [wk(4)]\n\tpaddd     xmm4, XMMWORD [wk(5)]\n\tpaddd     xmm0,xmm3\n\tpaddd     xmm4,xmm3\n\tpsrld     xmm0,SCALEBITS\t; xmm0=YOL\n\tpsrld     xmm4,SCALEBITS\t; xmm4=YOH\n\tpackssdw  xmm0,xmm4\t\t; xmm0=YO\n\n\tpxor      xmm3,xmm3\n\tpxor      xmm4,xmm4\n\tpunpcklwd xmm3,xmm1\t\t; xmm3=ROL\n\tpunpckhwd xmm4,xmm1\t\t; xmm4=ROH\n\tpsrld     xmm3,1\t\t; xmm3=ROL*FIX(0.500)\n\tpsrld     xmm4,1\t\t; xmm4=ROH*FIX(0.500)\n\n\tmovdqa    xmm1,[rel PD_ONEHALFM1_CJ] ; xmm1=[PD_ONEHALFM1_CJ]\n\n\tpaddd     xmm7,xmm3\n\tpaddd     xmm5,xmm4\n\tpaddd     xmm7,xmm1\n\tpaddd     xmm5,xmm1\n\tpsrld     xmm7,SCALEBITS\t; xmm7=CrOL\n\tpsrld     xmm5,SCALEBITS\t; xmm5=CrOH\n\tpackssdw  xmm7,xmm5\t\t; xmm7=CrO\n\n\tmovdqa    xmm3, XMMWORD [wk(0)]\t; xmm3=RE\n\n\tmovdqa    xmm4,xmm6\n\tpunpcklwd xmm6,xmm2\n\tpunpckhwd xmm4,xmm2\n\tmovdqa    xmm1,xmm6\n\tmovdqa    xmm5,xmm4\n\tpmaddwd   xmm6,[rel PW_F0114_F0250] ; xmm6=BEL*FIX(0.114)+GEL*FIX(0.250)\n\tpmaddwd   xmm4,[rel PW_F0114_F0250] ; xmm4=BEH*FIX(0.114)+GEH*FIX(0.250)\n\tpmaddwd   xmm1,[rel PW_MF008_MF041] ; xmm1=BEL*-FIX(0.081)+GEL*-FIX(0.418)\n\tpmaddwd   xmm5,[rel PW_MF008_MF041] ; xmm5=BEH*-FIX(0.081)+GEH*-FIX(0.418)\n\n\tmovdqa    xmm2,[rel PD_ONEHALF]\t; xmm2=[PD_ONEHALF]\n\n\tpaddd     xmm6, XMMWORD [wk(6)]\n\tpaddd     xmm4, XMMWORD [wk(7)]\n\tpaddd     xmm6,xmm2\n\tpaddd     xmm4,xmm2\n\tpsrld     xmm6,SCALEBITS\t; xmm6=YEL\n\tpsrld     xmm4,SCALEBITS\t; xmm4=YEH\n\tpackssdw  xmm6,xmm4\t\t; xmm6=YE\n\n\tpsllw     xmm0,BYTE_BIT\n\tpor       xmm6,xmm0\t\t; xmm6=Y\n\tmovdqa    XMMWORD [rdi], xmm6\t; Save Y\n\n\tpxor      xmm2,xmm2\n\tpxor      xmm4,xmm4\n\tpunpcklwd xmm2,xmm3\t\t; xmm2=REL\n\tpunpckhwd xmm4,xmm3\t\t; xmm4=REH\n\tpsrld     xmm2,1\t\t; xmm2=REL*FIX(0.500)\n\tpsrld     xmm4,1\t\t; xmm4=REH*FIX(0.500)\n\n\tmovdqa    xmm0,[rel PD_ONEHALFM1_CJ] ; xmm0=[PD_ONEHALFM1_CJ]\n\n\tpaddd     xmm1,xmm2\n\tpaddd     xmm5,xmm4\n\tpaddd     xmm1,xmm0\n\tpaddd     xmm5,xmm0\n\tpsrld     xmm1,SCALEBITS\t; xmm1=CrEL\n\tpsrld     xmm5,SCALEBITS\t; xmm5=CrEH\n\tpackssdw  xmm1,xmm5\t\t; xmm1=CrE\n\n\tpsllw     xmm7,BYTE_BIT\n\tpor       xmm1,xmm7\t\t; xmm1=Cr\n\tmovdqa    XMMWORD [rdx], xmm1\t; Save Cr\n\n\tsub\trcx, byte SIZEOF_XMMWORD\n\tadd\trsi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD\t; inptr\n\tadd\trdi, byte SIZEOF_XMMWORD\t\t; outptr0\n\tadd\trbx, byte SIZEOF_XMMWORD\t\t; outptr1\n\tadd\trdx, byte SIZEOF_XMMWORD\t\t; outptr2\n\tcmp\trcx, byte SIZEOF_XMMWORD\n\tjae\tnear .columnloop\n\ttest\trcx,rcx\n\tjnz\tnear .column_ld1\n\n\tpop\trcx\t\t\t; col\n\tpop\trsi\n\tpop\trdi\n\tpop\trbx\n\tpop\trdx\n\n\tadd\trsi, byte SIZEOF_JSAMPROW\t; input_buf\n\tadd\trdi, byte SIZEOF_JSAMPROW\n\tadd\trbx, byte SIZEOF_JSAMPROW\n\tadd\trdx, byte SIZEOF_JSAMPROW\n\tdec\trax\t\t\t\t; num_rows\n\tjg\tnear .rowloop\n\n.return:\n\tpop\trbx\n\tuncollect_args\n\tmov\trsp,rbp\t\t; rsp <- aligned rbp\n\tpop\trsp\t\t; rsp <- original rbp\n\tpop\trbp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jcclrss2.asm",
    "content": ";\n; jcclrss2.asm - colorspace conversion (SSE2)\n;\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\n; --------------------------------------------------------------------------\n;\n; Convert some rows of samples to the output colorspace.\n;\n; GLOBAL(void)\n; jsimd_rgb_ycc_convert_sse2 (JDIMENSION img_width,\n;                             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n;                             JDIMENSION output_row, int num_rows);\n;\n\n%define img_width(b)\t(b)+8\t\t\t; JDIMENSION img_width\n%define input_buf(b)\t(b)+12\t\t; JSAMPARRAY input_buf\n%define output_buf(b)\t(b)+16\t\t; JSAMPIMAGE output_buf\n%define output_row(b)\t(b)+20\t\t; JDIMENSION output_row\n%define num_rows(b)\t(b)+24\t\t; int num_rows\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t8\n%define gotptr\t\twk(0)-SIZEOF_POINTER\t; void * gotptr\n\n\talign\t16\n\n\tglobal\tEXTN(jsimd_rgb_ycc_convert_sse2)\n\nEXTN(jsimd_rgb_ycc_convert_sse2):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [wk(0)]\n\tpushpic\teax\t\t; make a room for GOT address\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t\t; get GOT address\n\tmovpic\tPOINTER [gotptr], ebx\t; save GOT address\n\n\tmov\tecx, JDIMENSION [img_width(eax)]\n\ttest\tecx,ecx\n\tjz\tnear .return\n\n\tpush\tecx\n\n\tmov\tesi, JSAMPIMAGE [output_buf(eax)]\n\tmov\tecx, JDIMENSION [output_row(eax)]\n\tmov\tedi, JSAMPARRAY [esi+0*SIZEOF_JSAMPARRAY]\n\tmov\tebx, JSAMPARRAY [esi+1*SIZEOF_JSAMPARRAY]\n\tmov\tedx, JSAMPARRAY [esi+2*SIZEOF_JSAMPARRAY]\n\tlea\tedi, [edi+ecx*SIZEOF_JSAMPROW]\n\tlea\tebx, [ebx+ecx*SIZEOF_JSAMPROW]\n\tlea\tedx, [edx+ecx*SIZEOF_JSAMPROW]\n\n\tpop\tecx\n\n\tmov\tesi, JSAMPARRAY [input_buf(eax)]\n\tmov\teax, INT [num_rows(eax)]\n\ttest\teax,eax\n\tjle\tnear .return\n\talignx\t16,7\n.rowloop:\n\tpushpic\teax\n\tpush\tedx\n\tpush\tebx\n\tpush\tedi\n\tpush\tesi\n\tpush\tecx\t\t\t; col\n\n\tmov\tesi, JSAMPROW [esi]\t; inptr\n\tmov\tedi, JSAMPROW [edi]\t; outptr0\n\tmov\tebx, JSAMPROW [ebx]\t; outptr1\n\tmov\tedx, JSAMPROW [edx]\t; outptr2\n\tmovpic\teax, POINTER [gotptr]\t; load GOT address (eax)\n\n\tcmp\tecx, byte SIZEOF_XMMWORD\n\tjae\tnear .columnloop\n\talignx\t16,7\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n.column_ld1:\n\tpush\teax\n\tpush\tedx\n\tlea\tecx,[ecx+ecx*2]\t\t; imul ecx,RGB_PIXELSIZE\n\ttest\tcl, SIZEOF_BYTE\n\tjz\tshort .column_ld2\n\tsub\tecx, byte SIZEOF_BYTE\n\tmovzx\teax, BYTE [esi+ecx]\n.column_ld2:\n\ttest\tcl, SIZEOF_WORD\n\tjz\tshort .column_ld4\n\tsub\tecx, byte SIZEOF_WORD\n\tmovzx\tedx, WORD [esi+ecx]\n\tshl\teax, WORD_BIT\n\tor\teax,edx\n.column_ld4:\n\tmovd\txmmA,eax\n\tpop\tedx\n\tpop\teax\n\ttest\tcl, SIZEOF_DWORD\n\tjz\tshort .column_ld8\n\tsub\tecx, byte SIZEOF_DWORD\n\tmovd\txmmF, XMM_DWORD [esi+ecx]\n\tpslldq\txmmA, SIZEOF_DWORD\n\tpor\txmmA,xmmF\n.column_ld8:\n\ttest\tcl, SIZEOF_MMWORD\n\tjz\tshort .column_ld16\n\tsub\tecx, byte SIZEOF_MMWORD\n\tmovq\txmmB, XMM_MMWORD [esi+ecx]\n\tpslldq\txmmA, SIZEOF_MMWORD\n\tpor\txmmA,xmmB\n.column_ld16:\n\ttest\tcl, SIZEOF_XMMWORD\n\tjz\tshort .column_ld32\n\tmovdqa\txmmF,xmmA\n\tmovdqu\txmmA, XMMWORD [esi+0*SIZEOF_XMMWORD]\n\tmov\tecx, SIZEOF_XMMWORD\n\tjmp\tshort .rgb_ycc_cnv\n.column_ld32:\n\ttest\tcl, 2*SIZEOF_XMMWORD\n\tmov\tecx, SIZEOF_XMMWORD\n\tjz\tshort .rgb_ycc_cnv\n\tmovdqa\txmmB,xmmA\n\tmovdqu\txmmA, XMMWORD [esi+0*SIZEOF_XMMWORD]\n\tmovdqu\txmmF, XMMWORD [esi+1*SIZEOF_XMMWORD]\n\tjmp\tshort .rgb_ycc_cnv\n\talignx\t16,7\n\n.columnloop:\n\tmovdqu\txmmA, XMMWORD [esi+0*SIZEOF_XMMWORD]\n\tmovdqu\txmmF, XMMWORD [esi+1*SIZEOF_XMMWORD]\n\tmovdqu\txmmB, XMMWORD [esi+2*SIZEOF_XMMWORD]\n\n.rgb_ycc_cnv:\n\t; xmmA=(00 10 20 01 11 21 02 12 22 03 13 23 04 14 24 05)\n\t; xmmF=(15 25 06 16 26 07 17 27 08 18 28 09 19 29 0A 1A)\n\t; xmmB=(2A 0B 1B 2B 0C 1C 2C 0D 1D 2D 0E 1E 2E 0F 1F 2F)\n\n\tmovdqa    xmmG,xmmA\n\tpslldq    xmmA,8\t; xmmA=(-- -- -- -- -- -- -- -- 00 10 20 01 11 21 02 12)\n\tpsrldq    xmmG,8\t; xmmG=(22 03 13 23 04 14 24 05 -- -- -- -- -- -- -- --)\n\n\tpunpckhbw xmmA,xmmF\t; xmmA=(00 08 10 18 20 28 01 09 11 19 21 29 02 0A 12 1A)\n\tpslldq    xmmF,8\t; xmmF=(-- -- -- -- -- -- -- -- 15 25 06 16 26 07 17 27)\n\n\tpunpcklbw xmmG,xmmB\t; xmmG=(22 2A 03 0B 13 1B 23 2B 04 0C 14 1C 24 2C 05 0D)\n\tpunpckhbw xmmF,xmmB\t; xmmF=(15 1D 25 2D 06 0E 16 1E 26 2E 07 0F 17 1F 27 2F)\n\n\tmovdqa    xmmD,xmmA\n\tpslldq    xmmA,8\t; xmmA=(-- -- -- -- -- -- -- -- 00 08 10 18 20 28 01 09)\n\tpsrldq    xmmD,8\t; xmmD=(11 19 21 29 02 0A 12 1A -- -- -- -- -- -- -- --)\n\n\tpunpckhbw xmmA,xmmG\t; xmmA=(00 04 08 0C 10 14 18 1C 20 24 28 2C 01 05 09 0D)\n\tpslldq    xmmG,8\t; xmmG=(-- -- -- -- -- -- -- -- 22 2A 03 0B 13 1B 23 2B)\n\n\tpunpcklbw xmmD,xmmF\t; xmmD=(11 15 19 1D 21 25 29 2D 02 06 0A 0E 12 16 1A 1E)\n\tpunpckhbw xmmG,xmmF\t; xmmG=(22 26 2A 2E 03 07 0B 0F 13 17 1B 1F 23 27 2B 2F)\n\n\tmovdqa    xmmE,xmmA\n\tpslldq    xmmA,8\t; xmmA=(-- -- -- -- -- -- -- -- 00 04 08 0C 10 14 18 1C)\n\tpsrldq    xmmE,8\t; xmmE=(20 24 28 2C 01 05 09 0D -- -- -- -- -- -- -- --)\n\n\tpunpckhbw xmmA,xmmD\t; xmmA=(00 02 04 06 08 0A 0C 0E 10 12 14 16 18 1A 1C 1E)\n\tpslldq    xmmD,8\t; xmmD=(-- -- -- -- -- -- -- -- 11 15 19 1D 21 25 29 2D)\n\n\tpunpcklbw xmmE,xmmG\t; xmmE=(20 22 24 26 28 2A 2C 2E 01 03 05 07 09 0B 0D 0F)\n\tpunpckhbw xmmD,xmmG\t; xmmD=(11 13 15 17 19 1B 1D 1F 21 23 25 27 29 2B 2D 2F)\n\n\tpxor      xmmH,xmmH\n\n\tmovdqa    xmmC,xmmA\n\tpunpcklbw xmmA,xmmH\t; xmmA=(00 02 04 06 08 0A 0C 0E)\n\tpunpckhbw xmmC,xmmH\t; xmmC=(10 12 14 16 18 1A 1C 1E)\n\n\tmovdqa    xmmB,xmmE\n\tpunpcklbw xmmE,xmmH\t; xmmE=(20 22 24 26 28 2A 2C 2E)\n\tpunpckhbw xmmB,xmmH\t; xmmB=(01 03 05 07 09 0B 0D 0F)\n\n\tmovdqa    xmmF,xmmD\n\tpunpcklbw xmmD,xmmH\t; xmmD=(11 13 15 17 19 1B 1D 1F)\n\tpunpckhbw xmmF,xmmH\t; xmmF=(21 23 25 27 29 2B 2D 2F)\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n.column_ld1:\n\ttest\tcl, SIZEOF_XMMWORD/16\n\tjz\tshort .column_ld2\n\tsub\tecx, byte SIZEOF_XMMWORD/16\n\tmovd\txmmA, XMM_DWORD [esi+ecx*RGB_PIXELSIZE]\n.column_ld2:\n\ttest\tcl, SIZEOF_XMMWORD/8\n\tjz\tshort .column_ld4\n\tsub\tecx, byte SIZEOF_XMMWORD/8\n\tmovq\txmmE, XMM_MMWORD [esi+ecx*RGB_PIXELSIZE]\n\tpslldq\txmmA, SIZEOF_MMWORD\n\tpor\txmmA,xmmE\n.column_ld4:\n\ttest\tcl, SIZEOF_XMMWORD/4\n\tjz\tshort .column_ld8\n\tsub\tecx, byte SIZEOF_XMMWORD/4\n\tmovdqa\txmmE,xmmA\n\tmovdqu\txmmA, XMMWORD [esi+ecx*RGB_PIXELSIZE]\n.column_ld8:\n\ttest\tcl, SIZEOF_XMMWORD/2\n\tmov\tecx, SIZEOF_XMMWORD\n\tjz\tshort .rgb_ycc_cnv\n\tmovdqa\txmmF,xmmA\n\tmovdqa\txmmH,xmmE\n\tmovdqu\txmmA, XMMWORD [esi+0*SIZEOF_XMMWORD]\n\tmovdqu\txmmE, XMMWORD [esi+1*SIZEOF_XMMWORD]\n\tjmp\tshort .rgb_ycc_cnv\n\talignx\t16,7\n\n.columnloop:\n\tmovdqu\txmmA, XMMWORD [esi+0*SIZEOF_XMMWORD]\n\tmovdqu\txmmE, XMMWORD [esi+1*SIZEOF_XMMWORD]\n\tmovdqu\txmmF, XMMWORD [esi+2*SIZEOF_XMMWORD]\n\tmovdqu\txmmH, XMMWORD [esi+3*SIZEOF_XMMWORD]\n\n.rgb_ycc_cnv:\n\t; xmmA=(00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33)\n\t; xmmE=(04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37)\n\t; xmmF=(08 18 28 38 09 19 29 39 0A 1A 2A 3A 0B 1B 2B 3B)\n\t; xmmH=(0C 1C 2C 3C 0D 1D 2D 3D 0E 1E 2E 3E 0F 1F 2F 3F)\n\n\tmovdqa    xmmD,xmmA\n\tpunpcklbw xmmA,xmmE\t; xmmA=(00 04 10 14 20 24 30 34 01 05 11 15 21 25 31 35)\n\tpunpckhbw xmmD,xmmE\t; xmmD=(02 06 12 16 22 26 32 36 03 07 13 17 23 27 33 37)\n\n\tmovdqa    xmmC,xmmF\n\tpunpcklbw xmmF,xmmH\t; xmmF=(08 0C 18 1C 28 2C 38 3C 09 0D 19 1D 29 2D 39 3D)\n\tpunpckhbw xmmC,xmmH\t; xmmC=(0A 0E 1A 1E 2A 2E 3A 3E 0B 0F 1B 1F 2B 2F 3B 3F)\n\n\tmovdqa    xmmB,xmmA\n\tpunpcklwd xmmA,xmmF\t; xmmA=(00 04 08 0C 10 14 18 1C 20 24 28 2C 30 34 38 3C)\n\tpunpckhwd xmmB,xmmF\t; xmmB=(01 05 09 0D 11 15 19 1D 21 25 29 2D 31 35 39 3D)\n\n\tmovdqa    xmmG,xmmD\n\tpunpcklwd xmmD,xmmC\t; xmmD=(02 06 0A 0E 12 16 1A 1E 22 26 2A 2E 32 36 3A 3E)\n\tpunpckhwd xmmG,xmmC\t; xmmG=(03 07 0B 0F 13 17 1B 1F 23 27 2B 2F 33 37 3B 3F)\n\n\tmovdqa    xmmE,xmmA\n\tpunpcklbw xmmA,xmmD\t; xmmA=(00 02 04 06 08 0A 0C 0E 10 12 14 16 18 1A 1C 1E)\n\tpunpckhbw xmmE,xmmD\t; xmmE=(20 22 24 26 28 2A 2C 2E 30 32 34 36 38 3A 3C 3E)\n\n\tmovdqa    xmmH,xmmB\n\tpunpcklbw xmmB,xmmG\t; xmmB=(01 03 05 07 09 0B 0D 0F 11 13 15 17 19 1B 1D 1F)\n\tpunpckhbw xmmH,xmmG\t; xmmH=(21 23 25 27 29 2B 2D 2F 31 33 35 37 39 3B 3D 3F)\n\n\tpxor      xmmF,xmmF\n\n\tmovdqa    xmmC,xmmA\n\tpunpcklbw xmmA,xmmF\t; xmmA=(00 02 04 06 08 0A 0C 0E)\n\tpunpckhbw xmmC,xmmF\t; xmmC=(10 12 14 16 18 1A 1C 1E)\n\n\tmovdqa    xmmD,xmmB\n\tpunpcklbw xmmB,xmmF\t; xmmB=(01 03 05 07 09 0B 0D 0F)\n\tpunpckhbw xmmD,xmmF\t; xmmD=(11 13 15 17 19 1B 1D 1F)\n\n\tmovdqa    xmmG,xmmE\n\tpunpcklbw xmmE,xmmF\t; xmmE=(20 22 24 26 28 2A 2C 2E)\n\tpunpckhbw xmmG,xmmF\t; xmmG=(30 32 34 36 38 3A 3C 3E)\n\n\tpunpcklbw xmmF,xmmH\n\tpunpckhbw xmmH,xmmH\n\tpsrlw     xmmF,BYTE_BIT\t; xmmF=(21 23 25 27 29 2B 2D 2F)\n\tpsrlw     xmmH,BYTE_BIT\t; xmmH=(31 33 35 37 39 3B 3D 3F)\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n\t; xmm0=R(02468ACE)=RE, xmm2=G(02468ACE)=GE, xmm4=B(02468ACE)=BE\n\t; xmm1=R(13579BDF)=RO, xmm3=G(13579BDF)=GO, xmm5=B(13579BDF)=BO\n\n\t; (Original)\n\t; Y  =  0.29900 * R + 0.58700 * G + 0.11400 * B\n\t; Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE\n\t; Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE\n\t;\n\t; (This implementation)\n\t; Y  =  0.29900 * R + 0.33700 * G + 0.11400 * B + 0.25000 * G\n\t; Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE\n\t; Cr =  0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE\n\n\tmovdqa    XMMWORD [wk(0)], xmm0\t; wk(0)=RE\n\tmovdqa    XMMWORD [wk(1)], xmm1\t; wk(1)=RO\n\tmovdqa    XMMWORD [wk(2)], xmm4\t; wk(2)=BE\n\tmovdqa    XMMWORD [wk(3)], xmm5\t; wk(3)=BO\n\n\tmovdqa    xmm6,xmm1\n\tpunpcklwd xmm1,xmm3\n\tpunpckhwd xmm6,xmm3\n\tmovdqa    xmm7,xmm1\n\tmovdqa    xmm4,xmm6\n\tpmaddwd   xmm1,[GOTOFF(eax,PW_F0299_F0337)] ; xmm1=ROL*FIX(0.299)+GOL*FIX(0.337)\n\tpmaddwd   xmm6,[GOTOFF(eax,PW_F0299_F0337)] ; xmm6=ROH*FIX(0.299)+GOH*FIX(0.337)\n\tpmaddwd   xmm7,[GOTOFF(eax,PW_MF016_MF033)] ; xmm7=ROL*-FIX(0.168)+GOL*-FIX(0.331)\n\tpmaddwd   xmm4,[GOTOFF(eax,PW_MF016_MF033)] ; xmm4=ROH*-FIX(0.168)+GOH*-FIX(0.331)\n\n\tmovdqa    XMMWORD [wk(4)], xmm1\t; wk(4)=ROL*FIX(0.299)+GOL*FIX(0.337)\n\tmovdqa    XMMWORD [wk(5)], xmm6\t; wk(5)=ROH*FIX(0.299)+GOH*FIX(0.337)\n\n\tpxor      xmm1,xmm1\n\tpxor      xmm6,xmm6\n\tpunpcklwd xmm1,xmm5\t\t; xmm1=BOL\n\tpunpckhwd xmm6,xmm5\t\t; xmm6=BOH\n\tpsrld     xmm1,1\t\t; xmm1=BOL*FIX(0.500)\n\tpsrld     xmm6,1\t\t; xmm6=BOH*FIX(0.500)\n\n\tmovdqa    xmm5,[GOTOFF(eax,PD_ONEHALFM1_CJ)] ; xmm5=[PD_ONEHALFM1_CJ]\n\n\tpaddd     xmm7,xmm1\n\tpaddd     xmm4,xmm6\n\tpaddd     xmm7,xmm5\n\tpaddd     xmm4,xmm5\n\tpsrld     xmm7,SCALEBITS\t; xmm7=CbOL\n\tpsrld     xmm4,SCALEBITS\t; xmm4=CbOH\n\tpackssdw  xmm7,xmm4\t\t; xmm7=CbO\n\n\tmovdqa    xmm1, XMMWORD [wk(2)]\t; xmm1=BE\n\n\tmovdqa    xmm6,xmm0\n\tpunpcklwd xmm0,xmm2\n\tpunpckhwd xmm6,xmm2\n\tmovdqa    xmm5,xmm0\n\tmovdqa    xmm4,xmm6\n\tpmaddwd   xmm0,[GOTOFF(eax,PW_F0299_F0337)] ; xmm0=REL*FIX(0.299)+GEL*FIX(0.337)\n\tpmaddwd   xmm6,[GOTOFF(eax,PW_F0299_F0337)] ; xmm6=REH*FIX(0.299)+GEH*FIX(0.337)\n\tpmaddwd   xmm5,[GOTOFF(eax,PW_MF016_MF033)] ; xmm5=REL*-FIX(0.168)+GEL*-FIX(0.331)\n\tpmaddwd   xmm4,[GOTOFF(eax,PW_MF016_MF033)] ; xmm4=REH*-FIX(0.168)+GEH*-FIX(0.331)\n\n\tmovdqa    XMMWORD [wk(6)], xmm0\t; wk(6)=REL*FIX(0.299)+GEL*FIX(0.337)\n\tmovdqa    XMMWORD [wk(7)], xmm6\t; wk(7)=REH*FIX(0.299)+GEH*FIX(0.337)\n\n\tpxor      xmm0,xmm0\n\tpxor      xmm6,xmm6\n\tpunpcklwd xmm0,xmm1\t\t; xmm0=BEL\n\tpunpckhwd xmm6,xmm1\t\t; xmm6=BEH\n\tpsrld     xmm0,1\t\t; xmm0=BEL*FIX(0.500)\n\tpsrld     xmm6,1\t\t; xmm6=BEH*FIX(0.500)\n\n\tmovdqa    xmm1,[GOTOFF(eax,PD_ONEHALFM1_CJ)] ; xmm1=[PD_ONEHALFM1_CJ]\n\n\tpaddd     xmm5,xmm0\n\tpaddd     xmm4,xmm6\n\tpaddd     xmm5,xmm1\n\tpaddd     xmm4,xmm1\n\tpsrld     xmm5,SCALEBITS\t; xmm5=CbEL\n\tpsrld     xmm4,SCALEBITS\t; xmm4=CbEH\n\tpackssdw  xmm5,xmm4\t\t; xmm5=CbE\n\n\tpsllw     xmm7,BYTE_BIT\n\tpor       xmm5,xmm7\t\t; xmm5=Cb\n\tmovdqa    XMMWORD [ebx], xmm5\t; Save Cb\n\n\tmovdqa    xmm0, XMMWORD [wk(3)]\t; xmm0=BO\n\tmovdqa    xmm6, XMMWORD [wk(2)]\t; xmm6=BE\n\tmovdqa    xmm1, XMMWORD [wk(1)]\t; xmm1=RO\n\n\tmovdqa    xmm4,xmm0\n\tpunpcklwd xmm0,xmm3\n\tpunpckhwd xmm4,xmm3\n\tmovdqa    xmm7,xmm0\n\tmovdqa    xmm5,xmm4\n\tpmaddwd   xmm0,[GOTOFF(eax,PW_F0114_F0250)] ; xmm0=BOL*FIX(0.114)+GOL*FIX(0.250)\n\tpmaddwd   xmm4,[GOTOFF(eax,PW_F0114_F0250)] ; xmm4=BOH*FIX(0.114)+GOH*FIX(0.250)\n\tpmaddwd   xmm7,[GOTOFF(eax,PW_MF008_MF041)] ; xmm7=BOL*-FIX(0.081)+GOL*-FIX(0.418)\n\tpmaddwd   xmm5,[GOTOFF(eax,PW_MF008_MF041)] ; xmm5=BOH*-FIX(0.081)+GOH*-FIX(0.418)\n\n\tmovdqa    xmm3,[GOTOFF(eax,PD_ONEHALF)]\t; xmm3=[PD_ONEHALF]\n\n\tpaddd     xmm0, XMMWORD [wk(4)]\n\tpaddd     xmm4, XMMWORD [wk(5)]\n\tpaddd     xmm0,xmm3\n\tpaddd     xmm4,xmm3\n\tpsrld     xmm0,SCALEBITS\t; xmm0=YOL\n\tpsrld     xmm4,SCALEBITS\t; xmm4=YOH\n\tpackssdw  xmm0,xmm4\t\t; xmm0=YO\n\n\tpxor      xmm3,xmm3\n\tpxor      xmm4,xmm4\n\tpunpcklwd xmm3,xmm1\t\t; xmm3=ROL\n\tpunpckhwd xmm4,xmm1\t\t; xmm4=ROH\n\tpsrld     xmm3,1\t\t; xmm3=ROL*FIX(0.500)\n\tpsrld     xmm4,1\t\t; xmm4=ROH*FIX(0.500)\n\n\tmovdqa    xmm1,[GOTOFF(eax,PD_ONEHALFM1_CJ)] ; xmm1=[PD_ONEHALFM1_CJ]\n\n\tpaddd     xmm7,xmm3\n\tpaddd     xmm5,xmm4\n\tpaddd     xmm7,xmm1\n\tpaddd     xmm5,xmm1\n\tpsrld     xmm7,SCALEBITS\t; xmm7=CrOL\n\tpsrld     xmm5,SCALEBITS\t; xmm5=CrOH\n\tpackssdw  xmm7,xmm5\t\t; xmm7=CrO\n\n\tmovdqa    xmm3, XMMWORD [wk(0)]\t; xmm3=RE\n\n\tmovdqa    xmm4,xmm6\n\tpunpcklwd xmm6,xmm2\n\tpunpckhwd xmm4,xmm2\n\tmovdqa    xmm1,xmm6\n\tmovdqa    xmm5,xmm4\n\tpmaddwd   xmm6,[GOTOFF(eax,PW_F0114_F0250)] ; xmm6=BEL*FIX(0.114)+GEL*FIX(0.250)\n\tpmaddwd   xmm4,[GOTOFF(eax,PW_F0114_F0250)] ; xmm4=BEH*FIX(0.114)+GEH*FIX(0.250)\n\tpmaddwd   xmm1,[GOTOFF(eax,PW_MF008_MF041)] ; xmm1=BEL*-FIX(0.081)+GEL*-FIX(0.418)\n\tpmaddwd   xmm5,[GOTOFF(eax,PW_MF008_MF041)] ; xmm5=BEH*-FIX(0.081)+GEH*-FIX(0.418)\n\n\tmovdqa    xmm2,[GOTOFF(eax,PD_ONEHALF)]\t; xmm2=[PD_ONEHALF]\n\n\tpaddd     xmm6, XMMWORD [wk(6)]\n\tpaddd     xmm4, XMMWORD [wk(7)]\n\tpaddd     xmm6,xmm2\n\tpaddd     xmm4,xmm2\n\tpsrld     xmm6,SCALEBITS\t; xmm6=YEL\n\tpsrld     xmm4,SCALEBITS\t; xmm4=YEH\n\tpackssdw  xmm6,xmm4\t\t; xmm6=YE\n\n\tpsllw     xmm0,BYTE_BIT\n\tpor       xmm6,xmm0\t\t; xmm6=Y\n\tmovdqa    XMMWORD [edi], xmm6\t; Save Y\n\n\tpxor      xmm2,xmm2\n\tpxor      xmm4,xmm4\n\tpunpcklwd xmm2,xmm3\t\t; xmm2=REL\n\tpunpckhwd xmm4,xmm3\t\t; xmm4=REH\n\tpsrld     xmm2,1\t\t; xmm2=REL*FIX(0.500)\n\tpsrld     xmm4,1\t\t; xmm4=REH*FIX(0.500)\n\n\tmovdqa    xmm0,[GOTOFF(eax,PD_ONEHALFM1_CJ)] ; xmm0=[PD_ONEHALFM1_CJ]\n\n\tpaddd     xmm1,xmm2\n\tpaddd     xmm5,xmm4\n\tpaddd     xmm1,xmm0\n\tpaddd     xmm5,xmm0\n\tpsrld     xmm1,SCALEBITS\t; xmm1=CrEL\n\tpsrld     xmm5,SCALEBITS\t; xmm5=CrEH\n\tpackssdw  xmm1,xmm5\t\t; xmm1=CrE\n\n\tpsllw     xmm7,BYTE_BIT\n\tpor       xmm1,xmm7\t\t; xmm1=Cr\n\tmovdqa    XMMWORD [edx], xmm1\t; Save Cr\n\n\tsub\tecx, byte SIZEOF_XMMWORD\n\tadd\tesi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD\t; inptr\n\tadd\tedi, byte SIZEOF_XMMWORD\t\t; outptr0\n\tadd\tebx, byte SIZEOF_XMMWORD\t\t; outptr1\n\tadd\tedx, byte SIZEOF_XMMWORD\t\t; outptr2\n\tcmp\tecx, byte SIZEOF_XMMWORD\n\tjae\tnear .columnloop\n\ttest\tecx,ecx\n\tjnz\tnear .column_ld1\n\n\tpop\tecx\t\t\t; col\n\tpop\tesi\n\tpop\tedi\n\tpop\tebx\n\tpop\tedx\n\tpoppic\teax\n\n\tadd\tesi, byte SIZEOF_JSAMPROW\t; input_buf\n\tadd\tedi, byte SIZEOF_JSAMPROW\n\tadd\tebx, byte SIZEOF_JSAMPROW\n\tadd\tedx, byte SIZEOF_JSAMPROW\n\tdec\teax\t\t\t\t; num_rows\n\tjg\tnear .rowloop\n\n.return:\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jccolmmx.asm",
    "content": ";\n; jccolmmx.asm - colorspace conversion (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2009 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS\t16\n\nF_0_081\tequ\t 5329\t\t\t; FIX(0.08131)\nF_0_114\tequ\t 7471\t\t\t; FIX(0.11400)\nF_0_168\tequ\t11059\t\t\t; FIX(0.16874)\nF_0_250\tequ\t16384\t\t\t; FIX(0.25000)\nF_0_299\tequ\t19595\t\t\t; FIX(0.29900)\nF_0_331\tequ\t21709\t\t\t; FIX(0.33126)\nF_0_418\tequ\t27439\t\t\t; FIX(0.41869)\nF_0_587\tequ\t38470\t\t\t; FIX(0.58700)\nF_0_337\tequ\t(F_0_587 - F_0_250)\t; FIX(0.58700) - FIX(0.25000)\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_rgb_ycc_convert_mmx)\n\nEXTN(jconst_rgb_ycc_convert_mmx):\n\nPW_F0299_F0337\ttimes 2 dw  F_0_299, F_0_337\nPW_F0114_F0250\ttimes 2 dw  F_0_114, F_0_250\nPW_MF016_MF033\ttimes 2 dw -F_0_168,-F_0_331\nPW_MF008_MF041\ttimes 2 dw -F_0_081,-F_0_418\nPD_ONEHALFM1_CJ\ttimes 2 dd  (1 << (SCALEBITS-1)) - 1 + (CENTERJSAMPLE << SCALEBITS)\nPD_ONEHALF\ttimes 2 dd  (1 << (SCALEBITS-1))\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n\n%include \"jcclrmmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_rgb_ycc_convert_mmx jsimd_extrgb_ycc_convert_mmx\n%include \"jcclrmmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_rgb_ycc_convert_mmx jsimd_extrgbx_ycc_convert_mmx\n%include \"jcclrmmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_rgb_ycc_convert_mmx jsimd_extbgr_ycc_convert_mmx\n%include \"jcclrmmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_rgb_ycc_convert_mmx jsimd_extbgrx_ycc_convert_mmx\n%include \"jcclrmmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_rgb_ycc_convert_mmx jsimd_extxbgr_ycc_convert_mmx\n%include \"jcclrmmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_rgb_ycc_convert_mmx jsimd_extxrgb_ycc_convert_mmx\n%include \"jcclrmmx.asm\"\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jccolss2-64.asm",
    "content": ";\n; jccolss2-64.asm - colorspace conversion (64-bit SSE2)\n;\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; Copyright (C) 2009, D. R. Commander.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS\t16\n\nF_0_081\tequ\t 5329\t\t\t; FIX(0.08131)\nF_0_114\tequ\t 7471\t\t\t; FIX(0.11400)\nF_0_168\tequ\t11059\t\t\t; FIX(0.16874)\nF_0_250\tequ\t16384\t\t\t; FIX(0.25000)\nF_0_299\tequ\t19595\t\t\t; FIX(0.29900)\nF_0_331\tequ\t21709\t\t\t; FIX(0.33126)\nF_0_418\tequ\t27439\t\t\t; FIX(0.41869)\nF_0_587\tequ\t38470\t\t\t; FIX(0.58700)\nF_0_337\tequ\t(F_0_587 - F_0_250)\t; FIX(0.58700) - FIX(0.25000)\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_rgb_ycc_convert_sse2)\n\nEXTN(jconst_rgb_ycc_convert_sse2):\n\nPW_F0299_F0337\ttimes 4 dw  F_0_299, F_0_337\nPW_F0114_F0250\ttimes 4 dw  F_0_114, F_0_250\nPW_MF016_MF033\ttimes 4 dw -F_0_168,-F_0_331\nPW_MF008_MF041\ttimes 4 dw -F_0_081,-F_0_418\nPD_ONEHALFM1_CJ\ttimes 4 dd  (1 << (SCALEBITS-1)) - 1 + (CENTERJSAMPLE << SCALEBITS)\nPD_ONEHALF\ttimes 4 dd  (1 << (SCALEBITS-1))\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t64\n\n%include \"jcclrss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extrgb_ycc_convert_sse2\n%include \"jcclrss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extrgbx_ycc_convert_sse2\n%include \"jcclrss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extbgr_ycc_convert_sse2\n%include \"jcclrss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extbgrx_ycc_convert_sse2\n%include \"jcclrss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extxbgr_ycc_convert_sse2\n%include \"jcclrss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extxrgb_ycc_convert_sse2\n%include \"jcclrss2-64.asm\"\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jccolss2.asm",
    "content": ";\n; jccolss2.asm - colorspace conversion (SSE2)\n;\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; Copyright (C) 2009, D. R. Commander.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS\t16\n\nF_0_081\tequ\t 5329\t\t\t; FIX(0.08131)\nF_0_114\tequ\t 7471\t\t\t; FIX(0.11400)\nF_0_168\tequ\t11059\t\t\t; FIX(0.16874)\nF_0_250\tequ\t16384\t\t\t; FIX(0.25000)\nF_0_299\tequ\t19595\t\t\t; FIX(0.29900)\nF_0_331\tequ\t21709\t\t\t; FIX(0.33126)\nF_0_418\tequ\t27439\t\t\t; FIX(0.41869)\nF_0_587\tequ\t38470\t\t\t; FIX(0.58700)\nF_0_337\tequ\t(F_0_587 - F_0_250)\t; FIX(0.58700) - FIX(0.25000)\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_rgb_ycc_convert_sse2)\n\nEXTN(jconst_rgb_ycc_convert_sse2):\n\nPW_F0299_F0337\ttimes 4 dw  F_0_299, F_0_337\nPW_F0114_F0250\ttimes 4 dw  F_0_114, F_0_250\nPW_MF016_MF033\ttimes 4 dw -F_0_168,-F_0_331\nPW_MF008_MF041\ttimes 4 dw -F_0_081,-F_0_418\nPD_ONEHALFM1_CJ\ttimes 4 dd  (1 << (SCALEBITS-1)) - 1 + (CENTERJSAMPLE << SCALEBITS)\nPD_ONEHALF\ttimes 4 dd  (1 << (SCALEBITS-1))\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n\n%include \"jcclrss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extrgb_ycc_convert_sse2\n%include \"jcclrss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extrgbx_ycc_convert_sse2\n%include \"jcclrss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extbgr_ycc_convert_sse2\n%include \"jcclrss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extbgrx_ycc_convert_sse2\n%include \"jcclrss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extxbgr_ycc_convert_sse2\n%include \"jcclrss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_rgb_ycc_convert_sse2 jsimd_extxrgb_ycc_convert_sse2\n%include \"jcclrss2.asm\"\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jcgrammx.asm",
    "content": ";\n; jcgrammx.asm - grayscale colorspace conversion (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2011 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS\t16\n\nF_0_114\tequ\t 7471\t\t\t; FIX(0.11400)\nF_0_250\tequ\t16384\t\t\t; FIX(0.25000)\nF_0_299\tequ\t19595\t\t\t; FIX(0.29900)\nF_0_587\tequ\t38470\t\t\t; FIX(0.58700)\nF_0_337\tequ\t(F_0_587 - F_0_250)\t; FIX(0.58700) - FIX(0.25000)\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_rgb_gray_convert_mmx)\n\nEXTN(jconst_rgb_gray_convert_mmx):\n\nPW_F0299_F0337\ttimes 2 dw  F_0_299, F_0_337\nPW_F0114_F0250\ttimes 2 dw  F_0_114, F_0_250\nPD_ONEHALF\ttimes 2 dd  (1 << (SCALEBITS-1))\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n\n%include \"jcgrymmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_rgb_gray_convert_mmx jsimd_extrgb_gray_convert_mmx\n%include \"jcgrymmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_rgb_gray_convert_mmx jsimd_extrgbx_gray_convert_mmx\n%include \"jcgrymmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_rgb_gray_convert_mmx jsimd_extbgr_gray_convert_mmx\n%include \"jcgrymmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_rgb_gray_convert_mmx jsimd_extbgrx_gray_convert_mmx\n%include \"jcgrymmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_rgb_gray_convert_mmx jsimd_extxbgr_gray_convert_mmx\n%include \"jcgrymmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_rgb_gray_convert_mmx jsimd_extxrgb_gray_convert_mmx\n%include \"jcgrymmx.asm\"\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jcgrass2-64.asm",
    "content": ";\n; jcgrass2-64.asm - grayscale colorspace conversion (64-bit SSE2)\n;\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; Copyright (C) 2011, D. R. Commander.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS\t16\n\nF_0_114\tequ\t 7471\t\t\t; FIX(0.11400)\nF_0_250\tequ\t16384\t\t\t; FIX(0.25000)\nF_0_299\tequ\t19595\t\t\t; FIX(0.29900)\nF_0_587\tequ\t38470\t\t\t; FIX(0.58700)\nF_0_337\tequ\t(F_0_587 - F_0_250)\t; FIX(0.58700) - FIX(0.25000)\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_rgb_gray_convert_sse2)\n\nEXTN(jconst_rgb_gray_convert_sse2):\n\nPW_F0299_F0337\ttimes 4 dw  F_0_299, F_0_337\nPW_F0114_F0250\ttimes 4 dw  F_0_114, F_0_250\nPD_ONEHALF\ttimes 4 dd  (1 << (SCALEBITS-1))\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t64\n\n%include \"jcgryss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extrgb_gray_convert_sse2\n%include \"jcgryss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extrgbx_gray_convert_sse2\n%include \"jcgryss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extbgr_gray_convert_sse2\n%include \"jcgryss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extbgrx_gray_convert_sse2\n%include \"jcgryss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extxbgr_gray_convert_sse2\n%include \"jcgryss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extxrgb_gray_convert_sse2\n%include \"jcgryss2-64.asm\"\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jcgrass2.asm",
    "content": ";\n; jcgrass2.asm - grayscale colorspace conversion (SSE2)\n;\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; Copyright (C) 2011, D. R. Commander.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS\t16\n\nF_0_114\tequ\t 7471\t\t\t; FIX(0.11400)\nF_0_250\tequ\t16384\t\t\t; FIX(0.25000)\nF_0_299\tequ\t19595\t\t\t; FIX(0.29900)\nF_0_587\tequ\t38470\t\t\t; FIX(0.58700)\nF_0_337\tequ\t(F_0_587 - F_0_250)\t; FIX(0.58700) - FIX(0.25000)\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_rgb_gray_convert_sse2)\n\nEXTN(jconst_rgb_gray_convert_sse2):\n\nPW_F0299_F0337\ttimes 4 dw  F_0_299, F_0_337\nPW_F0114_F0250\ttimes 4 dw  F_0_114, F_0_250\nPD_ONEHALF\ttimes 4 dd  (1 << (SCALEBITS-1))\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n\n%include \"jcgryss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extrgb_gray_convert_sse2\n%include \"jcgryss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extrgbx_gray_convert_sse2\n%include \"jcgryss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extbgr_gray_convert_sse2\n%include \"jcgryss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extbgrx_gray_convert_sse2\n%include \"jcgryss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extxbgr_gray_convert_sse2\n%include \"jcgryss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_rgb_gray_convert_sse2 jsimd_extxrgb_gray_convert_sse2\n%include \"jcgryss2.asm\"\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jcgrymmx.asm",
    "content": ";\n; jcgrymmx.asm - grayscale colorspace conversion (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2011 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\n; --------------------------------------------------------------------------\n;\n; Convert some rows of samples to the output colorspace.\n;\n; GLOBAL(void)\n; jsimd_rgb_gray_convert_mmx (JDIMENSION img_width,\n;                             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n;                             JDIMENSION output_row, int num_rows);\n;\n\n%define img_width(b)\t(b)+8\t\t\t; JDIMENSION img_width\n%define input_buf(b)\t(b)+12\t\t; JSAMPARRAY input_buf\n%define output_buf(b)\t(b)+16\t\t; JSAMPIMAGE output_buf\n%define output_row(b)\t(b)+20\t\t; JDIMENSION output_row\n%define num_rows(b)\t(b)+24\t\t; int num_rows\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_MMWORD\t; mmword wk[WK_NUM]\n%define WK_NUM\t\t2\n%define gotptr\t\twk(0)-SIZEOF_POINTER\t; void * gotptr\n\n\talign\t16\n\tglobal\tEXTN(jsimd_rgb_gray_convert_mmx)\n\nEXTN(jsimd_rgb_gray_convert_mmx):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_MMWORD)\t; align to 64 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [wk(0)]\n\tpushpic\teax\t\t; make a room for GOT address\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t\t; get GOT address\n\tmovpic\tPOINTER [gotptr], ebx\t; save GOT address\n\n\tmov\tecx, JDIMENSION [img_width(eax)]\t; num_cols\n\ttest\tecx,ecx\n\tjz\tnear .return\n\n\tpush\tecx\n\n\tmov\tesi, JSAMPIMAGE [output_buf(eax)]\n\tmov\tecx, JDIMENSION [output_row(eax)]\n\tmov\tedi, JSAMPARRAY [esi+0*SIZEOF_JSAMPARRAY]\n\tlea\tedi, [edi+ecx*SIZEOF_JSAMPROW]\n\n\tpop\tecx\n\n\tmov\tesi, JSAMPARRAY [input_buf(eax)]\n\tmov\teax, INT [num_rows(eax)]\n\ttest\teax,eax\n\tjle\tnear .return\n\talignx\t16,7\n.rowloop:\n\tpushpic\teax\n\tpush\tedi\n\tpush\tesi\n\tpush\tecx\t\t\t; col\n\n\tmov\tesi, JSAMPROW [esi]\t; inptr\n\tmov\tedi, JSAMPROW [edi]\t; outptr0\n\tmovpic\teax, POINTER [gotptr]\t; load GOT address (eax)\n\n\tcmp\tecx, byte SIZEOF_MMWORD\n\tjae\tshort .columnloop\n\talignx\t16,7\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n.column_ld1:\n\tpush\teax\n\tpush\tedx\n\tlea\tecx,[ecx+ecx*2]\t\t; imul ecx,RGB_PIXELSIZE\n\ttest\tcl, SIZEOF_BYTE\n\tjz\tshort .column_ld2\n\tsub\tecx, byte SIZEOF_BYTE\n\txor\teax,eax\n\tmov\tal, BYTE [esi+ecx]\n.column_ld2:\n\ttest\tcl, SIZEOF_WORD\n\tjz\tshort .column_ld4\n\tsub\tecx, byte SIZEOF_WORD\n\txor\tedx,edx\n\tmov\tdx, WORD [esi+ecx]\n\tshl\teax, WORD_BIT\n\tor\teax,edx\n.column_ld4:\n\tmovd\tmmA,eax\n\tpop\tedx\n\tpop\teax\n\ttest\tcl, SIZEOF_DWORD\n\tjz\tshort .column_ld8\n\tsub\tecx, byte SIZEOF_DWORD\n\tmovd\tmmG, DWORD [esi+ecx]\n\tpsllq\tmmA, DWORD_BIT\n\tpor\tmmA,mmG\n.column_ld8:\n\ttest\tcl, SIZEOF_MMWORD\n\tjz\tshort .column_ld16\n\tmovq\tmmG,mmA\n\tmovq\tmmA, MMWORD [esi+0*SIZEOF_MMWORD]\n\tmov\tecx, SIZEOF_MMWORD\n\tjmp\tshort .rgb_gray_cnv\n.column_ld16:\n\ttest\tcl, 2*SIZEOF_MMWORD\n\tmov\tecx, SIZEOF_MMWORD\n\tjz\tshort .rgb_gray_cnv\n\tmovq\tmmF,mmA\n\tmovq\tmmA, MMWORD [esi+0*SIZEOF_MMWORD]\n\tmovq\tmmG, MMWORD [esi+1*SIZEOF_MMWORD]\n\tjmp\tshort .rgb_gray_cnv\n\talignx\t16,7\n\n.columnloop:\n\tmovq\tmmA, MMWORD [esi+0*SIZEOF_MMWORD]\n\tmovq\tmmG, MMWORD [esi+1*SIZEOF_MMWORD]\n\tmovq\tmmF, MMWORD [esi+2*SIZEOF_MMWORD]\n\n.rgb_gray_cnv:\n\t; mmA=(00 10 20 01 11 21 02 12)\n\t; mmG=(22 03 13 23 04 14 24 05)\n\t; mmF=(15 25 06 16 26 07 17 27)\n\n\tmovq      mmD,mmA\n\tpsllq     mmA,4*BYTE_BIT\t; mmA=(-- -- -- -- 00 10 20 01)\n\tpsrlq     mmD,4*BYTE_BIT\t; mmD=(11 21 02 12 -- -- -- --)\n\n\tpunpckhbw mmA,mmG\t\t; mmA=(00 04 10 14 20 24 01 05)\n\tpsllq     mmG,4*BYTE_BIT\t; mmG=(-- -- -- -- 22 03 13 23)\n\n\tpunpcklbw mmD,mmF\t\t; mmD=(11 15 21 25 02 06 12 16)\n\tpunpckhbw mmG,mmF\t\t; mmG=(22 26 03 07 13 17 23 27)\n\n\tmovq      mmE,mmA\n\tpsllq     mmA,4*BYTE_BIT\t; mmA=(-- -- -- -- 00 04 10 14)\n\tpsrlq     mmE,4*BYTE_BIT\t; mmE=(20 24 01 05 -- -- -- --)\n\n\tpunpckhbw mmA,mmD\t\t; mmA=(00 02 04 06 10 12 14 16)\n\tpsllq     mmD,4*BYTE_BIT\t; mmD=(-- -- -- -- 11 15 21 25)\n\n\tpunpcklbw mmE,mmG\t\t; mmE=(20 22 24 26 01 03 05 07)\n\tpunpckhbw mmD,mmG\t\t; mmD=(11 13 15 17 21 23 25 27)\n\n\tpxor      mmH,mmH\n\n\tmovq      mmC,mmA\n\tpunpcklbw mmA,mmH\t\t; mmA=(00 02 04 06)\n\tpunpckhbw mmC,mmH\t\t; mmC=(10 12 14 16)\n\n\tmovq      mmB,mmE\n\tpunpcklbw mmE,mmH\t\t; mmE=(20 22 24 26)\n\tpunpckhbw mmB,mmH\t\t; mmB=(01 03 05 07)\n\n\tmovq      mmF,mmD\n\tpunpcklbw mmD,mmH\t\t; mmD=(11 13 15 17)\n\tpunpckhbw mmF,mmH\t\t; mmF=(21 23 25 27)\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n.column_ld1:\n\ttest\tcl, SIZEOF_MMWORD/8\n\tjz\tshort .column_ld2\n\tsub\tecx, byte SIZEOF_MMWORD/8\n\tmovd\tmmA, DWORD [esi+ecx*RGB_PIXELSIZE]\n.column_ld2:\n\ttest\tcl, SIZEOF_MMWORD/4\n\tjz\tshort .column_ld4\n\tsub\tecx, byte SIZEOF_MMWORD/4\n\tmovq\tmmF,mmA\n\tmovq\tmmA, MMWORD [esi+ecx*RGB_PIXELSIZE]\n.column_ld4:\n\ttest\tcl, SIZEOF_MMWORD/2\n\tmov\tecx, SIZEOF_MMWORD\n\tjz\tshort .rgb_gray_cnv\n\tmovq\tmmD,mmA\n\tmovq\tmmC,mmF\n\tmovq\tmmA, MMWORD [esi+0*SIZEOF_MMWORD]\n\tmovq\tmmF, MMWORD [esi+1*SIZEOF_MMWORD]\n\tjmp\tshort .rgb_gray_cnv\n\talignx\t16,7\n\n.columnloop:\n\tmovq\tmmA, MMWORD [esi+0*SIZEOF_MMWORD]\n\tmovq\tmmF, MMWORD [esi+1*SIZEOF_MMWORD]\n\tmovq\tmmD, MMWORD [esi+2*SIZEOF_MMWORD]\n\tmovq\tmmC, MMWORD [esi+3*SIZEOF_MMWORD]\n\n.rgb_gray_cnv:\n\t; mmA=(00 10 20 30 01 11 21 31)\n\t; mmF=(02 12 22 32 03 13 23 33)\n\t; mmD=(04 14 24 34 05 15 25 35)\n\t; mmC=(06 16 26 36 07 17 27 37)\n\n\tmovq      mmB,mmA\n\tpunpcklbw mmA,mmF\t\t; mmA=(00 02 10 12 20 22 30 32)\n\tpunpckhbw mmB,mmF\t\t; mmB=(01 03 11 13 21 23 31 33)\n\n\tmovq      mmG,mmD\n\tpunpcklbw mmD,mmC\t\t; mmD=(04 06 14 16 24 26 34 36)\n\tpunpckhbw mmG,mmC\t\t; mmG=(05 07 15 17 25 27 35 37)\n\n\tmovq      mmE,mmA\n\tpunpcklwd mmA,mmD\t\t; mmA=(00 02 04 06 10 12 14 16)\n\tpunpckhwd mmE,mmD\t\t; mmE=(20 22 24 26 30 32 34 36)\n\n\tmovq      mmH,mmB\n\tpunpcklwd mmB,mmG\t\t; mmB=(01 03 05 07 11 13 15 17)\n\tpunpckhwd mmH,mmG\t\t; mmH=(21 23 25 27 31 33 35 37)\n\n\tpxor      mmF,mmF\n\n\tmovq      mmC,mmA\n\tpunpcklbw mmA,mmF\t\t; mmA=(00 02 04 06)\n\tpunpckhbw mmC,mmF\t\t; mmC=(10 12 14 16)\n\n\tmovq      mmD,mmB\n\tpunpcklbw mmB,mmF\t\t; mmB=(01 03 05 07)\n\tpunpckhbw mmD,mmF\t\t; mmD=(11 13 15 17)\n\n\tmovq      mmG,mmE\n\tpunpcklbw mmE,mmF\t\t; mmE=(20 22 24 26)\n\tpunpckhbw mmG,mmF\t\t; mmG=(30 32 34 36)\n\n\tpunpcklbw mmF,mmH\n\tpunpckhbw mmH,mmH\n\tpsrlw     mmF,BYTE_BIT\t\t; mmF=(21 23 25 27)\n\tpsrlw     mmH,BYTE_BIT\t\t; mmH=(31 33 35 37)\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n\t; mm0=(R0 R2 R4 R6)=RE, mm2=(G0 G2 G4 G6)=GE, mm4=(B0 B2 B4 B6)=BE\n\t; mm1=(R1 R3 R5 R7)=RO, mm3=(G1 G3 G5 G7)=GO, mm5=(B1 B3 B5 B7)=BO\n\n\t; (Original)\n\t; Y  =  0.29900 * R + 0.58700 * G + 0.11400 * B\n\t;\n\t; (This implementation)\n\t; Y  =  0.29900 * R + 0.33700 * G + 0.11400 * B + 0.25000 * G\n\n\tmovq      mm6,mm1\n\tpunpcklwd mm1,mm3\n\tpunpckhwd mm6,mm3\n\tpmaddwd   mm1,[GOTOFF(eax,PW_F0299_F0337)] ; mm1=ROL*FIX(0.299)+GOL*FIX(0.337)\n\tpmaddwd   mm6,[GOTOFF(eax,PW_F0299_F0337)] ; mm6=ROH*FIX(0.299)+GOH*FIX(0.337)\n\n\tmovq      mm7, mm6\t; mm7=ROH*FIX(0.299)+GOH*FIX(0.337)\n\n\tmovq      mm6,mm0\n\tpunpcklwd mm0,mm2\n\tpunpckhwd mm6,mm2\n\tpmaddwd   mm0,[GOTOFF(eax,PW_F0299_F0337)] ; mm0=REL*FIX(0.299)+GEL*FIX(0.337)\n\tpmaddwd   mm6,[GOTOFF(eax,PW_F0299_F0337)] ; mm6=REH*FIX(0.299)+GEH*FIX(0.337)\n\n\tmovq      MMWORD [wk(0)], mm0\t; wk(0)=REL*FIX(0.299)+GEL*FIX(0.337)\n\tmovq      MMWORD [wk(1)], mm6\t; wk(1)=REH*FIX(0.299)+GEH*FIX(0.337)\n\n\tmovq      mm0, mm5\t; mm0=BO\n\tmovq      mm6, mm4\t; mm6=BE\n\n\tmovq      mm4,mm0\n\tpunpcklwd mm0,mm3\n\tpunpckhwd mm4,mm3\n\tpmaddwd   mm0,[GOTOFF(eax,PW_F0114_F0250)] ; mm0=BOL*FIX(0.114)+GOL*FIX(0.250)\n\tpmaddwd   mm4,[GOTOFF(eax,PW_F0114_F0250)] ; mm4=BOH*FIX(0.114)+GOH*FIX(0.250)\n\n\tmovq      mm3,[GOTOFF(eax,PD_ONEHALF)]\t; mm3=[PD_ONEHALF]\n\n\tpaddd     mm0, mm1\n\tpaddd     mm4, mm7\n\tpaddd     mm0,mm3\n\tpaddd     mm4,mm3\n\tpsrld     mm0,SCALEBITS\t\t; mm0=YOL\n\tpsrld     mm4,SCALEBITS\t\t; mm4=YOH\n\tpackssdw  mm0,mm4\t\t; mm0=YO\n\n\tmovq      mm4,mm6\n\tpunpcklwd mm6,mm2\n\tpunpckhwd mm4,mm2\n\tpmaddwd   mm6,[GOTOFF(eax,PW_F0114_F0250)] ; mm6=BEL*FIX(0.114)+GEL*FIX(0.250)\n\tpmaddwd   mm4,[GOTOFF(eax,PW_F0114_F0250)] ; mm4=BEH*FIX(0.114)+GEH*FIX(0.250)\n\n\tmovq      mm2,[GOTOFF(eax,PD_ONEHALF)]\t; mm2=[PD_ONEHALF]\n\n\tpaddd     mm6, MMWORD [wk(0)]\n\tpaddd     mm4, MMWORD [wk(1)]\n\tpaddd     mm6,mm2\n\tpaddd     mm4,mm2\n\tpsrld     mm6,SCALEBITS\t\t; mm6=YEL\n\tpsrld     mm4,SCALEBITS\t\t; mm4=YEH\n\tpackssdw  mm6,mm4\t\t; mm6=YE\n\n\tpsllw     mm0,BYTE_BIT\n\tpor       mm6,mm0\t\t; mm6=Y\n\tmovq      MMWORD [edi], mm6\t; Save Y\n\n\tsub\tecx, byte SIZEOF_MMWORD\n\tadd\tesi, byte RGB_PIXELSIZE*SIZEOF_MMWORD\t; inptr\n\tadd\tedi, byte SIZEOF_MMWORD\t\t\t; outptr0\n\tcmp\tecx, byte SIZEOF_MMWORD\n\tjae\tnear .columnloop\n\ttest\tecx,ecx\n\tjnz\tnear .column_ld1\n\n\tpop\tecx\t\t\t; col\n\tpop\tesi\n\tpop\tedi\n\tpoppic\teax\n\n\tadd\tesi, byte SIZEOF_JSAMPROW\t; input_buf\n\tadd\tedi, byte SIZEOF_JSAMPROW\n\tdec\teax\t\t\t\t; num_rows\n\tjg\tnear .rowloop\n\n\temms\t\t; empty MMX state\n\n.return:\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jcgryss2-64.asm",
    "content": ";\n; jcgryss2-64.asm - grayscale colorspace conversion (64-bit SSE2)\n;\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; Copyright (C) 2011, D. R. Commander.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\n; --------------------------------------------------------------------------\n;\n; Convert some rows of samples to the output colorspace.\n;\n; GLOBAL(void)\n; jsimd_rgb_gray_convert_sse2 (JDIMENSION img_width,\n;                              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n;                              JDIMENSION output_row, int num_rows);\n;\n\n; r10 = JDIMENSION img_width\n; r11 = JSAMPARRAY input_buf\n; r12 = JSAMPIMAGE output_buf\n; r13 = JDIMENSION output_row\n; r14 = int num_rows\n\n%define wk(i)\t\trbp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t2\n\n\talign\t16\n\n\tglobal\tEXTN(jsimd_rgb_gray_convert_sse2)\n\nEXTN(jsimd_rgb_gray_convert_sse2):\n\tpush\trbp\n\tmov\trax,rsp\t\t\t\t; rax = original rbp\n\tsub\trsp, byte 4\n\tand\trsp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[rsp],rax\n\tmov\trbp,rsp\t\t\t\t; rbp = aligned rbp\n\tlea\trsp, [wk(0)]\n\tcollect_args\n\tpush\trbx\n\n\tmov\trcx, r10\n\ttest\trcx,rcx\n\tjz\tnear .return\n\n\tpush\trcx\n\n\tmov rsi, r12\n\tmov rcx, r13\n\tmov\trdi, JSAMPARRAY [rsi+0*SIZEOF_JSAMPARRAY]\n\tlea\trdi, [rdi+rcx*SIZEOF_JSAMPROW]\n\n\tpop\trcx\n\n\tmov rsi, r11\n\tmov\teax, r14d\n\ttest\trax,rax\n\tjle\tnear .return\n.rowloop:\n\tpush\trdi\n\tpush\trsi\n\tpush\trcx\t\t\t; col\n\n\tmov\trsi, JSAMPROW [rsi]\t; inptr\n\tmov\trdi, JSAMPROW [rdi]\t; outptr0\n\n\tcmp\trcx, byte SIZEOF_XMMWORD\n\tjae\tnear .columnloop\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n.column_ld1:\n\tpush\trax\n\tpush\trdx\n\tlea\trcx,[rcx+rcx*2]\t\t; imul ecx,RGB_PIXELSIZE\n\ttest\tcl, SIZEOF_BYTE\n\tjz\tshort .column_ld2\n\tsub\trcx, byte SIZEOF_BYTE\n\tmovzx\trax, BYTE [rsi+rcx]\n.column_ld2:\n\ttest\tcl, SIZEOF_WORD\n\tjz\tshort .column_ld4\n\tsub\trcx, byte SIZEOF_WORD\n\tmovzx\trdx, WORD [rsi+rcx]\n\tshl\trax, WORD_BIT\n\tor\trax,rdx\n.column_ld4:\n\tmovd\txmmA,eax\n\tpop\trdx\n\tpop\trax\n\ttest\tcl, SIZEOF_DWORD\n\tjz\tshort .column_ld8\n\tsub\trcx, byte SIZEOF_DWORD\n\tmovd\txmmF, XMM_DWORD [rsi+rcx]\n\tpslldq\txmmA, SIZEOF_DWORD\n\tpor\txmmA,xmmF\n.column_ld8:\n\ttest\tcl, SIZEOF_MMWORD\n\tjz\tshort .column_ld16\n\tsub\trcx, byte SIZEOF_MMWORD\n\tmovq\txmmB, XMM_MMWORD [rsi+rcx]\n\tpslldq\txmmA, SIZEOF_MMWORD\n\tpor\txmmA,xmmB\n.column_ld16:\n\ttest\tcl, SIZEOF_XMMWORD\n\tjz\tshort .column_ld32\n\tmovdqa\txmmF,xmmA\n\tmovdqu\txmmA, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n\tmov\trcx, SIZEOF_XMMWORD\n\tjmp\tshort .rgb_gray_cnv\n.column_ld32:\n\ttest\tcl, 2*SIZEOF_XMMWORD\n\tmov\trcx, SIZEOF_XMMWORD\n\tjz\tshort .rgb_gray_cnv\n\tmovdqa\txmmB,xmmA\n\tmovdqu\txmmA, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n\tmovdqu\txmmF, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n\tjmp\tshort .rgb_gray_cnv\n\n.columnloop:\n\tmovdqu\txmmA, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n\tmovdqu\txmmF, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n\tmovdqu\txmmB, XMMWORD [rsi+2*SIZEOF_XMMWORD]\n\n.rgb_gray_cnv:\n\t; xmmA=(00 10 20 01 11 21 02 12 22 03 13 23 04 14 24 05)\n\t; xmmF=(15 25 06 16 26 07 17 27 08 18 28 09 19 29 0A 1A)\n\t; xmmB=(2A 0B 1B 2B 0C 1C 2C 0D 1D 2D 0E 1E 2E 0F 1F 2F)\n\n\tmovdqa    xmmG,xmmA\n\tpslldq    xmmA,8\t; xmmA=(-- -- -- -- -- -- -- -- 00 10 20 01 11 21 02 12)\n\tpsrldq    xmmG,8\t; xmmG=(22 03 13 23 04 14 24 05 -- -- -- -- -- -- -- --)\n\n\tpunpckhbw xmmA,xmmF\t; xmmA=(00 08 10 18 20 28 01 09 11 19 21 29 02 0A 12 1A)\n\tpslldq    xmmF,8\t; xmmF=(-- -- -- -- -- -- -- -- 15 25 06 16 26 07 17 27)\n\n\tpunpcklbw xmmG,xmmB\t; xmmG=(22 2A 03 0B 13 1B 23 2B 04 0C 14 1C 24 2C 05 0D)\n\tpunpckhbw xmmF,xmmB\t; xmmF=(15 1D 25 2D 06 0E 16 1E 26 2E 07 0F 17 1F 27 2F)\n\n\tmovdqa    xmmD,xmmA\n\tpslldq    xmmA,8\t; xmmA=(-- -- -- -- -- -- -- -- 00 08 10 18 20 28 01 09)\n\tpsrldq    xmmD,8\t; xmmD=(11 19 21 29 02 0A 12 1A -- -- -- -- -- -- -- --)\n\n\tpunpckhbw xmmA,xmmG\t; xmmA=(00 04 08 0C 10 14 18 1C 20 24 28 2C 01 05 09 0D)\n\tpslldq    xmmG,8\t; xmmG=(-- -- -- -- -- -- -- -- 22 2A 03 0B 13 1B 23 2B)\n\n\tpunpcklbw xmmD,xmmF\t; xmmD=(11 15 19 1D 21 25 29 2D 02 06 0A 0E 12 16 1A 1E)\n\tpunpckhbw xmmG,xmmF\t; xmmG=(22 26 2A 2E 03 07 0B 0F 13 17 1B 1F 23 27 2B 2F)\n\n\tmovdqa    xmmE,xmmA\n\tpslldq    xmmA,8\t; xmmA=(-- -- -- -- -- -- -- -- 00 04 08 0C 10 14 18 1C)\n\tpsrldq    xmmE,8\t; xmmE=(20 24 28 2C 01 05 09 0D -- -- -- -- -- -- -- --)\n\n\tpunpckhbw xmmA,xmmD\t; xmmA=(00 02 04 06 08 0A 0C 0E 10 12 14 16 18 1A 1C 1E)\n\tpslldq    xmmD,8\t; xmmD=(-- -- -- -- -- -- -- -- 11 15 19 1D 21 25 29 2D)\n\n\tpunpcklbw xmmE,xmmG\t; xmmE=(20 22 24 26 28 2A 2C 2E 01 03 05 07 09 0B 0D 0F)\n\tpunpckhbw xmmD,xmmG\t; xmmD=(11 13 15 17 19 1B 1D 1F 21 23 25 27 29 2B 2D 2F)\n\n\tpxor      xmmH,xmmH\n\n\tmovdqa    xmmC,xmmA\n\tpunpcklbw xmmA,xmmH\t; xmmA=(00 02 04 06 08 0A 0C 0E)\n\tpunpckhbw xmmC,xmmH\t; xmmC=(10 12 14 16 18 1A 1C 1E)\n\n\tmovdqa    xmmB,xmmE\n\tpunpcklbw xmmE,xmmH\t; xmmE=(20 22 24 26 28 2A 2C 2E)\n\tpunpckhbw xmmB,xmmH\t; xmmB=(01 03 05 07 09 0B 0D 0F)\n\n\tmovdqa    xmmF,xmmD\n\tpunpcklbw xmmD,xmmH\t; xmmD=(11 13 15 17 19 1B 1D 1F)\n\tpunpckhbw xmmF,xmmH\t; xmmF=(21 23 25 27 29 2B 2D 2F)\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n.column_ld1:\n\ttest\tcl, SIZEOF_XMMWORD/16\n\tjz\tshort .column_ld2\n\tsub\trcx, byte SIZEOF_XMMWORD/16\n\tmovd\txmmA, XMM_DWORD [rsi+rcx*RGB_PIXELSIZE]\n.column_ld2:\n\ttest\tcl, SIZEOF_XMMWORD/8\n\tjz\tshort .column_ld4\n\tsub\trcx, byte SIZEOF_XMMWORD/8\n\tmovq\txmmE, XMM_MMWORD [rsi+rcx*RGB_PIXELSIZE]\n\tpslldq\txmmA, SIZEOF_MMWORD\n\tpor\txmmA,xmmE\n.column_ld4:\n\ttest\tcl, SIZEOF_XMMWORD/4\n\tjz\tshort .column_ld8\n\tsub\trcx, byte SIZEOF_XMMWORD/4\n\tmovdqa\txmmE,xmmA\n\tmovdqu\txmmA, XMMWORD [rsi+rcx*RGB_PIXELSIZE]\n.column_ld8:\n\ttest\tcl, SIZEOF_XMMWORD/2\n\tmov\trcx, SIZEOF_XMMWORD\n\tjz\tshort .rgb_gray_cnv\n\tmovdqa\txmmF,xmmA\n\tmovdqa\txmmH,xmmE\n\tmovdqu\txmmA, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n\tmovdqu\txmmE, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n\tjmp\tshort .rgb_gray_cnv\n\n.columnloop:\n\tmovdqu\txmmA, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n\tmovdqu\txmmE, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n\tmovdqu\txmmF, XMMWORD [rsi+2*SIZEOF_XMMWORD]\n\tmovdqu\txmmH, XMMWORD [rsi+3*SIZEOF_XMMWORD]\n\n.rgb_gray_cnv:\n\t; xmmA=(00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33)\n\t; xmmE=(04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37)\n\t; xmmF=(08 18 28 38 09 19 29 39 0A 1A 2A 3A 0B 1B 2B 3B)\n\t; xmmH=(0C 1C 2C 3C 0D 1D 2D 3D 0E 1E 2E 3E 0F 1F 2F 3F)\n\n\tmovdqa    xmmD,xmmA\n\tpunpcklbw xmmA,xmmE\t; xmmA=(00 04 10 14 20 24 30 34 01 05 11 15 21 25 31 35)\n\tpunpckhbw xmmD,xmmE\t; xmmD=(02 06 12 16 22 26 32 36 03 07 13 17 23 27 33 37)\n\n\tmovdqa    xmmC,xmmF\n\tpunpcklbw xmmF,xmmH\t; xmmF=(08 0C 18 1C 28 2C 38 3C 09 0D 19 1D 29 2D 39 3D)\n\tpunpckhbw xmmC,xmmH\t; xmmC=(0A 0E 1A 1E 2A 2E 3A 3E 0B 0F 1B 1F 2B 2F 3B 3F)\n\n\tmovdqa    xmmB,xmmA\n\tpunpcklwd xmmA,xmmF\t; xmmA=(00 04 08 0C 10 14 18 1C 20 24 28 2C 30 34 38 3C)\n\tpunpckhwd xmmB,xmmF\t; xmmB=(01 05 09 0D 11 15 19 1D 21 25 29 2D 31 35 39 3D)\n\n\tmovdqa    xmmG,xmmD\n\tpunpcklwd xmmD,xmmC\t; xmmD=(02 06 0A 0E 12 16 1A 1E 22 26 2A 2E 32 36 3A 3E)\n\tpunpckhwd xmmG,xmmC\t; xmmG=(03 07 0B 0F 13 17 1B 1F 23 27 2B 2F 33 37 3B 3F)\n\n\tmovdqa    xmmE,xmmA\n\tpunpcklbw xmmA,xmmD\t; xmmA=(00 02 04 06 08 0A 0C 0E 10 12 14 16 18 1A 1C 1E)\n\tpunpckhbw xmmE,xmmD\t; xmmE=(20 22 24 26 28 2A 2C 2E 30 32 34 36 38 3A 3C 3E)\n\n\tmovdqa    xmmH,xmmB\n\tpunpcklbw xmmB,xmmG\t; xmmB=(01 03 05 07 09 0B 0D 0F 11 13 15 17 19 1B 1D 1F)\n\tpunpckhbw xmmH,xmmG\t; xmmH=(21 23 25 27 29 2B 2D 2F 31 33 35 37 39 3B 3D 3F)\n\n\tpxor      xmmF,xmmF\n\n\tmovdqa    xmmC,xmmA\n\tpunpcklbw xmmA,xmmF\t; xmmA=(00 02 04 06 08 0A 0C 0E)\n\tpunpckhbw xmmC,xmmF\t; xmmC=(10 12 14 16 18 1A 1C 1E)\n\n\tmovdqa    xmmD,xmmB\n\tpunpcklbw xmmB,xmmF\t; xmmB=(01 03 05 07 09 0B 0D 0F)\n\tpunpckhbw xmmD,xmmF\t; xmmD=(11 13 15 17 19 1B 1D 1F)\n\n\tmovdqa    xmmG,xmmE\n\tpunpcklbw xmmE,xmmF\t; xmmE=(20 22 24 26 28 2A 2C 2E)\n\tpunpckhbw xmmG,xmmF\t; xmmG=(30 32 34 36 38 3A 3C 3E)\n\n\tpunpcklbw xmmF,xmmH\n\tpunpckhbw xmmH,xmmH\n\tpsrlw     xmmF,BYTE_BIT\t; xmmF=(21 23 25 27 29 2B 2D 2F)\n\tpsrlw     xmmH,BYTE_BIT\t; xmmH=(31 33 35 37 39 3B 3D 3F)\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n\t; xmm0=R(02468ACE)=RE, xmm2=G(02468ACE)=GE, xmm4=B(02468ACE)=BE\n\t; xmm1=R(13579BDF)=RO, xmm3=G(13579BDF)=GO, xmm5=B(13579BDF)=BO\n\n\t; (Original)\n\t; Y  =  0.29900 * R + 0.58700 * G + 0.11400 * B\n\t;\n\t; (This implementation)\n\t; Y  =  0.29900 * R + 0.33700 * G + 0.11400 * B + 0.25000 * G\n\n\tmovdqa    xmm6,xmm1\n\tpunpcklwd xmm1,xmm3\n\tpunpckhwd xmm6,xmm3\n\tpmaddwd   xmm1,[rel PW_F0299_F0337] ; xmm1=ROL*FIX(0.299)+GOL*FIX(0.337)\n\tpmaddwd   xmm6,[rel PW_F0299_F0337] ; xmm6=ROH*FIX(0.299)+GOH*FIX(0.337)\n\n\tmovdqa    xmm7, xmm6\t; xmm7=ROH*FIX(0.299)+GOH*FIX(0.337)\n\n\tmovdqa    xmm6,xmm0\n\tpunpcklwd xmm0,xmm2\n\tpunpckhwd xmm6,xmm2\n\tpmaddwd   xmm0,[rel PW_F0299_F0337] ; xmm0=REL*FIX(0.299)+GEL*FIX(0.337)\n\tpmaddwd   xmm6,[rel PW_F0299_F0337] ; xmm6=REH*FIX(0.299)+GEH*FIX(0.337)\n\n\tmovdqa    XMMWORD [wk(0)], xmm0\t; wk(0)=REL*FIX(0.299)+GEL*FIX(0.337)\n\tmovdqa    XMMWORD [wk(1)], xmm6\t; wk(1)=REH*FIX(0.299)+GEH*FIX(0.337)\n\n\tmovdqa    xmm0, xmm5\t; xmm0=BO\n\tmovdqa    xmm6, xmm4\t; xmm6=BE\n\n\tmovdqa    xmm4,xmm0\n\tpunpcklwd xmm0,xmm3\n\tpunpckhwd xmm4,xmm3\n\tpmaddwd   xmm0,[rel PW_F0114_F0250] ; xmm0=BOL*FIX(0.114)+GOL*FIX(0.250)\n\tpmaddwd   xmm4,[rel PW_F0114_F0250] ; xmm4=BOH*FIX(0.114)+GOH*FIX(0.250)\n\n\tmovdqa    xmm3,[rel PD_ONEHALF]\t; xmm3=[PD_ONEHALF]\n\n\tpaddd     xmm0, xmm1\n\tpaddd     xmm4, xmm7\n\tpaddd     xmm0,xmm3\n\tpaddd     xmm4,xmm3\n\tpsrld     xmm0,SCALEBITS\t; xmm0=YOL\n\tpsrld     xmm4,SCALEBITS\t; xmm4=YOH\n\tpackssdw  xmm0,xmm4\t\t; xmm0=YO\n\n\tmovdqa    xmm4,xmm6\n\tpunpcklwd xmm6,xmm2\n\tpunpckhwd xmm4,xmm2\n\tpmaddwd   xmm6,[rel PW_F0114_F0250] ; xmm6=BEL*FIX(0.114)+GEL*FIX(0.250)\n\tpmaddwd   xmm4,[rel PW_F0114_F0250] ; xmm4=BEH*FIX(0.114)+GEH*FIX(0.250)\n\n\tmovdqa    xmm2,[rel PD_ONEHALF]\t; xmm2=[PD_ONEHALF]\n\n\tpaddd     xmm6, XMMWORD [wk(0)]\n\tpaddd     xmm4, XMMWORD [wk(1)]\n\tpaddd     xmm6,xmm2\n\tpaddd     xmm4,xmm2\n\tpsrld     xmm6,SCALEBITS\t; xmm6=YEL\n\tpsrld     xmm4,SCALEBITS\t; xmm4=YEH\n\tpackssdw  xmm6,xmm4\t\t; xmm6=YE\n\n\tpsllw     xmm0,BYTE_BIT\n\tpor       xmm6,xmm0\t\t; xmm6=Y\n\tmovdqa    XMMWORD [rdi], xmm6\t; Save Y\n\n\tsub\trcx, byte SIZEOF_XMMWORD\n\tadd\trsi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD\t; inptr\n\tadd\trdi, byte SIZEOF_XMMWORD\t\t; outptr0\n\tcmp\trcx, byte SIZEOF_XMMWORD\n\tjae\tnear .columnloop\n\ttest\trcx,rcx\n\tjnz\tnear .column_ld1\n\n\tpop\trcx\t\t\t; col\n\tpop\trsi\n\tpop\trdi\n\n\tadd\trsi, byte SIZEOF_JSAMPROW\t; input_buf\n\tadd\trdi, byte SIZEOF_JSAMPROW\n\tdec\trax\t\t\t\t; num_rows\n\tjg\tnear .rowloop\n\n.return:\n\tpop\trbx\n\tuncollect_args\n\tmov\trsp,rbp\t\t; rsp <- aligned rbp\n\tpop\trsp\t\t; rsp <- original rbp\n\tpop\trbp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jcgryss2.asm",
    "content": ";\n; jcgryss2.asm - grayscale colorspace conversion (SSE2)\n;\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; Copyright (C) 2011, D. R. Commander.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\n; --------------------------------------------------------------------------\n;\n; Convert some rows of samples to the output colorspace.\n;\n; GLOBAL(void)\n; jsimd_rgb_gray_convert_sse2 (JDIMENSION img_width,\n;                              JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n;                              JDIMENSION output_row, int num_rows);\n;\n\n%define img_width(b)\t(b)+8\t\t\t; JDIMENSION img_width\n%define input_buf(b)\t(b)+12\t\t; JSAMPARRAY input_buf\n%define output_buf(b)\t(b)+16\t\t; JSAMPIMAGE output_buf\n%define output_row(b)\t(b)+20\t\t; JDIMENSION output_row\n%define num_rows(b)\t(b)+24\t\t; int num_rows\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t2\n%define gotptr\t\twk(0)-SIZEOF_POINTER\t; void * gotptr\n\n\talign\t16\n\n\tglobal\tEXTN(jsimd_rgb_gray_convert_sse2)\n\nEXTN(jsimd_rgb_gray_convert_sse2):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [wk(0)]\n\tpushpic\teax\t\t; make a room for GOT address\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t\t; get GOT address\n\tmovpic\tPOINTER [gotptr], ebx\t; save GOT address\n\n\tmov\tecx, JDIMENSION [img_width(eax)]\n\ttest\tecx,ecx\n\tjz\tnear .return\n\n\tpush\tecx\n\n\tmov\tesi, JSAMPIMAGE [output_buf(eax)]\n\tmov\tecx, JDIMENSION [output_row(eax)]\n\tmov\tedi, JSAMPARRAY [esi+0*SIZEOF_JSAMPARRAY]\n\tlea\tedi, [edi+ecx*SIZEOF_JSAMPROW]\n\n\tpop\tecx\n\n\tmov\tesi, JSAMPARRAY [input_buf(eax)]\n\tmov\teax, INT [num_rows(eax)]\n\ttest\teax,eax\n\tjle\tnear .return\n\talignx\t16,7\n.rowloop:\n\tpushpic\teax\n\tpush\tedi\n\tpush\tesi\n\tpush\tecx\t\t\t; col\n\n\tmov\tesi, JSAMPROW [esi]\t; inptr\n\tmov\tedi, JSAMPROW [edi]\t; outptr0\n\tmovpic\teax, POINTER [gotptr]\t; load GOT address (eax)\n\n\tcmp\tecx, byte SIZEOF_XMMWORD\n\tjae\tnear .columnloop\n\talignx\t16,7\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n.column_ld1:\n\tpush\teax\n\tpush\tedx\n\tlea\tecx,[ecx+ecx*2]\t\t; imul ecx,RGB_PIXELSIZE\n\ttest\tcl, SIZEOF_BYTE\n\tjz\tshort .column_ld2\n\tsub\tecx, byte SIZEOF_BYTE\n\tmovzx\teax, BYTE [esi+ecx]\n.column_ld2:\n\ttest\tcl, SIZEOF_WORD\n\tjz\tshort .column_ld4\n\tsub\tecx, byte SIZEOF_WORD\n\tmovzx\tedx, WORD [esi+ecx]\n\tshl\teax, WORD_BIT\n\tor\teax,edx\n.column_ld4:\n\tmovd\txmmA,eax\n\tpop\tedx\n\tpop\teax\n\ttest\tcl, SIZEOF_DWORD\n\tjz\tshort .column_ld8\n\tsub\tecx, byte SIZEOF_DWORD\n\tmovd\txmmF, XMM_DWORD [esi+ecx]\n\tpslldq\txmmA, SIZEOF_DWORD\n\tpor\txmmA,xmmF\n.column_ld8:\n\ttest\tcl, SIZEOF_MMWORD\n\tjz\tshort .column_ld16\n\tsub\tecx, byte SIZEOF_MMWORD\n\tmovq\txmmB, XMM_MMWORD [esi+ecx]\n\tpslldq\txmmA, SIZEOF_MMWORD\n\tpor\txmmA,xmmB\n.column_ld16:\n\ttest\tcl, SIZEOF_XMMWORD\n\tjz\tshort .column_ld32\n\tmovdqa\txmmF,xmmA\n\tmovdqu\txmmA, XMMWORD [esi+0*SIZEOF_XMMWORD]\n\tmov\tecx, SIZEOF_XMMWORD\n\tjmp\tshort .rgb_gray_cnv\n.column_ld32:\n\ttest\tcl, 2*SIZEOF_XMMWORD\n\tmov\tecx, SIZEOF_XMMWORD\n\tjz\tshort .rgb_gray_cnv\n\tmovdqa\txmmB,xmmA\n\tmovdqu\txmmA, XMMWORD [esi+0*SIZEOF_XMMWORD]\n\tmovdqu\txmmF, XMMWORD [esi+1*SIZEOF_XMMWORD]\n\tjmp\tshort .rgb_gray_cnv\n\talignx\t16,7\n\n.columnloop:\n\tmovdqu\txmmA, XMMWORD [esi+0*SIZEOF_XMMWORD]\n\tmovdqu\txmmF, XMMWORD [esi+1*SIZEOF_XMMWORD]\n\tmovdqu\txmmB, XMMWORD [esi+2*SIZEOF_XMMWORD]\n\n.rgb_gray_cnv:\n\t; xmmA=(00 10 20 01 11 21 02 12 22 03 13 23 04 14 24 05)\n\t; xmmF=(15 25 06 16 26 07 17 27 08 18 28 09 19 29 0A 1A)\n\t; xmmB=(2A 0B 1B 2B 0C 1C 2C 0D 1D 2D 0E 1E 2E 0F 1F 2F)\n\n\tmovdqa    xmmG,xmmA\n\tpslldq    xmmA,8\t; xmmA=(-- -- -- -- -- -- -- -- 00 10 20 01 11 21 02 12)\n\tpsrldq    xmmG,8\t; xmmG=(22 03 13 23 04 14 24 05 -- -- -- -- -- -- -- --)\n\n\tpunpckhbw xmmA,xmmF\t; xmmA=(00 08 10 18 20 28 01 09 11 19 21 29 02 0A 12 1A)\n\tpslldq    xmmF,8\t; xmmF=(-- -- -- -- -- -- -- -- 15 25 06 16 26 07 17 27)\n\n\tpunpcklbw xmmG,xmmB\t; xmmG=(22 2A 03 0B 13 1B 23 2B 04 0C 14 1C 24 2C 05 0D)\n\tpunpckhbw xmmF,xmmB\t; xmmF=(15 1D 25 2D 06 0E 16 1E 26 2E 07 0F 17 1F 27 2F)\n\n\tmovdqa    xmmD,xmmA\n\tpslldq    xmmA,8\t; xmmA=(-- -- -- -- -- -- -- -- 00 08 10 18 20 28 01 09)\n\tpsrldq    xmmD,8\t; xmmD=(11 19 21 29 02 0A 12 1A -- -- -- -- -- -- -- --)\n\n\tpunpckhbw xmmA,xmmG\t; xmmA=(00 04 08 0C 10 14 18 1C 20 24 28 2C 01 05 09 0D)\n\tpslldq    xmmG,8\t; xmmG=(-- -- -- -- -- -- -- -- 22 2A 03 0B 13 1B 23 2B)\n\n\tpunpcklbw xmmD,xmmF\t; xmmD=(11 15 19 1D 21 25 29 2D 02 06 0A 0E 12 16 1A 1E)\n\tpunpckhbw xmmG,xmmF\t; xmmG=(22 26 2A 2E 03 07 0B 0F 13 17 1B 1F 23 27 2B 2F)\n\n\tmovdqa    xmmE,xmmA\n\tpslldq    xmmA,8\t; xmmA=(-- -- -- -- -- -- -- -- 00 04 08 0C 10 14 18 1C)\n\tpsrldq    xmmE,8\t; xmmE=(20 24 28 2C 01 05 09 0D -- -- -- -- -- -- -- --)\n\n\tpunpckhbw xmmA,xmmD\t; xmmA=(00 02 04 06 08 0A 0C 0E 10 12 14 16 18 1A 1C 1E)\n\tpslldq    xmmD,8\t; xmmD=(-- -- -- -- -- -- -- -- 11 15 19 1D 21 25 29 2D)\n\n\tpunpcklbw xmmE,xmmG\t; xmmE=(20 22 24 26 28 2A 2C 2E 01 03 05 07 09 0B 0D 0F)\n\tpunpckhbw xmmD,xmmG\t; xmmD=(11 13 15 17 19 1B 1D 1F 21 23 25 27 29 2B 2D 2F)\n\n\tpxor      xmmH,xmmH\n\n\tmovdqa    xmmC,xmmA\n\tpunpcklbw xmmA,xmmH\t; xmmA=(00 02 04 06 08 0A 0C 0E)\n\tpunpckhbw xmmC,xmmH\t; xmmC=(10 12 14 16 18 1A 1C 1E)\n\n\tmovdqa    xmmB,xmmE\n\tpunpcklbw xmmE,xmmH\t; xmmE=(20 22 24 26 28 2A 2C 2E)\n\tpunpckhbw xmmB,xmmH\t; xmmB=(01 03 05 07 09 0B 0D 0F)\n\n\tmovdqa    xmmF,xmmD\n\tpunpcklbw xmmD,xmmH\t; xmmD=(11 13 15 17 19 1B 1D 1F)\n\tpunpckhbw xmmF,xmmH\t; xmmF=(21 23 25 27 29 2B 2D 2F)\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n.column_ld1:\n\ttest\tcl, SIZEOF_XMMWORD/16\n\tjz\tshort .column_ld2\n\tsub\tecx, byte SIZEOF_XMMWORD/16\n\tmovd\txmmA, XMM_DWORD [esi+ecx*RGB_PIXELSIZE]\n.column_ld2:\n\ttest\tcl, SIZEOF_XMMWORD/8\n\tjz\tshort .column_ld4\n\tsub\tecx, byte SIZEOF_XMMWORD/8\n\tmovq\txmmE, XMM_MMWORD [esi+ecx*RGB_PIXELSIZE]\n\tpslldq\txmmA, SIZEOF_MMWORD\n\tpor\txmmA,xmmE\n.column_ld4:\n\ttest\tcl, SIZEOF_XMMWORD/4\n\tjz\tshort .column_ld8\n\tsub\tecx, byte SIZEOF_XMMWORD/4\n\tmovdqa\txmmE,xmmA\n\tmovdqu\txmmA, XMMWORD [esi+ecx*RGB_PIXELSIZE]\n.column_ld8:\n\ttest\tcl, SIZEOF_XMMWORD/2\n\tmov\tecx, SIZEOF_XMMWORD\n\tjz\tshort .rgb_gray_cnv\n\tmovdqa\txmmF,xmmA\n\tmovdqa\txmmH,xmmE\n\tmovdqu\txmmA, XMMWORD [esi+0*SIZEOF_XMMWORD]\n\tmovdqu\txmmE, XMMWORD [esi+1*SIZEOF_XMMWORD]\n\tjmp\tshort .rgb_gray_cnv\n\talignx\t16,7\n\n.columnloop:\n\tmovdqu\txmmA, XMMWORD [esi+0*SIZEOF_XMMWORD]\n\tmovdqu\txmmE, XMMWORD [esi+1*SIZEOF_XMMWORD]\n\tmovdqu\txmmF, XMMWORD [esi+2*SIZEOF_XMMWORD]\n\tmovdqu\txmmH, XMMWORD [esi+3*SIZEOF_XMMWORD]\n\n.rgb_gray_cnv:\n\t; xmmA=(00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33)\n\t; xmmE=(04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37)\n\t; xmmF=(08 18 28 38 09 19 29 39 0A 1A 2A 3A 0B 1B 2B 3B)\n\t; xmmH=(0C 1C 2C 3C 0D 1D 2D 3D 0E 1E 2E 3E 0F 1F 2F 3F)\n\n\tmovdqa    xmmD,xmmA\n\tpunpcklbw xmmA,xmmE\t; xmmA=(00 04 10 14 20 24 30 34 01 05 11 15 21 25 31 35)\n\tpunpckhbw xmmD,xmmE\t; xmmD=(02 06 12 16 22 26 32 36 03 07 13 17 23 27 33 37)\n\n\tmovdqa    xmmC,xmmF\n\tpunpcklbw xmmF,xmmH\t; xmmF=(08 0C 18 1C 28 2C 38 3C 09 0D 19 1D 29 2D 39 3D)\n\tpunpckhbw xmmC,xmmH\t; xmmC=(0A 0E 1A 1E 2A 2E 3A 3E 0B 0F 1B 1F 2B 2F 3B 3F)\n\n\tmovdqa    xmmB,xmmA\n\tpunpcklwd xmmA,xmmF\t; xmmA=(00 04 08 0C 10 14 18 1C 20 24 28 2C 30 34 38 3C)\n\tpunpckhwd xmmB,xmmF\t; xmmB=(01 05 09 0D 11 15 19 1D 21 25 29 2D 31 35 39 3D)\n\n\tmovdqa    xmmG,xmmD\n\tpunpcklwd xmmD,xmmC\t; xmmD=(02 06 0A 0E 12 16 1A 1E 22 26 2A 2E 32 36 3A 3E)\n\tpunpckhwd xmmG,xmmC\t; xmmG=(03 07 0B 0F 13 17 1B 1F 23 27 2B 2F 33 37 3B 3F)\n\n\tmovdqa    xmmE,xmmA\n\tpunpcklbw xmmA,xmmD\t; xmmA=(00 02 04 06 08 0A 0C 0E 10 12 14 16 18 1A 1C 1E)\n\tpunpckhbw xmmE,xmmD\t; xmmE=(20 22 24 26 28 2A 2C 2E 30 32 34 36 38 3A 3C 3E)\n\n\tmovdqa    xmmH,xmmB\n\tpunpcklbw xmmB,xmmG\t; xmmB=(01 03 05 07 09 0B 0D 0F 11 13 15 17 19 1B 1D 1F)\n\tpunpckhbw xmmH,xmmG\t; xmmH=(21 23 25 27 29 2B 2D 2F 31 33 35 37 39 3B 3D 3F)\n\n\tpxor      xmmF,xmmF\n\n\tmovdqa    xmmC,xmmA\n\tpunpcklbw xmmA,xmmF\t; xmmA=(00 02 04 06 08 0A 0C 0E)\n\tpunpckhbw xmmC,xmmF\t; xmmC=(10 12 14 16 18 1A 1C 1E)\n\n\tmovdqa    xmmD,xmmB\n\tpunpcklbw xmmB,xmmF\t; xmmB=(01 03 05 07 09 0B 0D 0F)\n\tpunpckhbw xmmD,xmmF\t; xmmD=(11 13 15 17 19 1B 1D 1F)\n\n\tmovdqa    xmmG,xmmE\n\tpunpcklbw xmmE,xmmF\t; xmmE=(20 22 24 26 28 2A 2C 2E)\n\tpunpckhbw xmmG,xmmF\t; xmmG=(30 32 34 36 38 3A 3C 3E)\n\n\tpunpcklbw xmmF,xmmH\n\tpunpckhbw xmmH,xmmH\n\tpsrlw     xmmF,BYTE_BIT\t; xmmF=(21 23 25 27 29 2B 2D 2F)\n\tpsrlw     xmmH,BYTE_BIT\t; xmmH=(31 33 35 37 39 3B 3D 3F)\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n\t; xmm0=R(02468ACE)=RE, xmm2=G(02468ACE)=GE, xmm4=B(02468ACE)=BE\n\t; xmm1=R(13579BDF)=RO, xmm3=G(13579BDF)=GO, xmm5=B(13579BDF)=BO\n\n\t; (Original)\n\t; Y  =  0.29900 * R + 0.58700 * G + 0.11400 * B\n\t;\n\t; (This implementation)\n\t; Y  =  0.29900 * R + 0.33700 * G + 0.11400 * B + 0.25000 * G\n\n\tmovdqa    xmm6,xmm1\n\tpunpcklwd xmm1,xmm3\n\tpunpckhwd xmm6,xmm3\n\tpmaddwd   xmm1,[GOTOFF(eax,PW_F0299_F0337)] ; xmm1=ROL*FIX(0.299)+GOL*FIX(0.337)\n\tpmaddwd   xmm6,[GOTOFF(eax,PW_F0299_F0337)] ; xmm6=ROH*FIX(0.299)+GOH*FIX(0.337)\n\n\tmovdqa    xmm7, xmm6\t; xmm7=ROH*FIX(0.299)+GOH*FIX(0.337)\n\n\tmovdqa    xmm6,xmm0\n\tpunpcklwd xmm0,xmm2\n\tpunpckhwd xmm6,xmm2\n\tpmaddwd   xmm0,[GOTOFF(eax,PW_F0299_F0337)] ; xmm0=REL*FIX(0.299)+GEL*FIX(0.337)\n\tpmaddwd   xmm6,[GOTOFF(eax,PW_F0299_F0337)] ; xmm6=REH*FIX(0.299)+GEH*FIX(0.337)\n\n\tmovdqa    XMMWORD [wk(0)], xmm0\t; wk(0)=REL*FIX(0.299)+GEL*FIX(0.337)\n\tmovdqa    XMMWORD [wk(1)], xmm6\t; wk(1)=REH*FIX(0.299)+GEH*FIX(0.337)\n\n\tmovdqa    xmm0, xmm5\t; xmm0=BO\n\tmovdqa    xmm6, xmm4\t; xmm6=BE\n\n\tmovdqa    xmm4,xmm0\n\tpunpcklwd xmm0,xmm3\n\tpunpckhwd xmm4,xmm3\n\tpmaddwd   xmm0,[GOTOFF(eax,PW_F0114_F0250)] ; xmm0=BOL*FIX(0.114)+GOL*FIX(0.250)\n\tpmaddwd   xmm4,[GOTOFF(eax,PW_F0114_F0250)] ; xmm4=BOH*FIX(0.114)+GOH*FIX(0.250)\n\n\tmovdqa    xmm3,[GOTOFF(eax,PD_ONEHALF)]\t; xmm3=[PD_ONEHALF]\n\n\tpaddd     xmm0, xmm1\n\tpaddd     xmm4, xmm7\n\tpaddd     xmm0,xmm3\n\tpaddd     xmm4,xmm3\n\tpsrld     xmm0,SCALEBITS\t; xmm0=YOL\n\tpsrld     xmm4,SCALEBITS\t; xmm4=YOH\n\tpackssdw  xmm0,xmm4\t\t; xmm0=YO\n\n\tmovdqa    xmm4,xmm6\n\tpunpcklwd xmm6,xmm2\n\tpunpckhwd xmm4,xmm2\n\tpmaddwd   xmm6,[GOTOFF(eax,PW_F0114_F0250)] ; xmm6=BEL*FIX(0.114)+GEL*FIX(0.250)\n\tpmaddwd   xmm4,[GOTOFF(eax,PW_F0114_F0250)] ; xmm4=BEH*FIX(0.114)+GEH*FIX(0.250)\n\n\tmovdqa    xmm2,[GOTOFF(eax,PD_ONEHALF)]\t; xmm2=[PD_ONEHALF]\n\n\tpaddd     xmm6, XMMWORD [wk(0)]\n\tpaddd     xmm4, XMMWORD [wk(1)]\n\tpaddd     xmm6,xmm2\n\tpaddd     xmm4,xmm2\n\tpsrld     xmm6,SCALEBITS\t; xmm6=YEL\n\tpsrld     xmm4,SCALEBITS\t; xmm4=YEH\n\tpackssdw  xmm6,xmm4\t\t; xmm6=YE\n\n\tpsllw     xmm0,BYTE_BIT\n\tpor       xmm6,xmm0\t\t; xmm6=Y\n\tmovdqa    XMMWORD [edi], xmm6\t; Save Y\n\n\tsub\tecx, byte SIZEOF_XMMWORD\n\tadd\tesi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD\t; inptr\n\tadd\tedi, byte SIZEOF_XMMWORD\t\t; outptr0\n\tcmp\tecx, byte SIZEOF_XMMWORD\n\tjae\tnear .columnloop\n\ttest\tecx,ecx\n\tjnz\tnear .column_ld1\n\n\tpop\tecx\t\t\t; col\n\tpop\tesi\n\tpop\tedi\n\tpoppic\teax\n\n\tadd\tesi, byte SIZEOF_JSAMPROW\t; input_buf\n\tadd\tedi, byte SIZEOF_JSAMPROW\n\tdec\teax\t\t\t\t; num_rows\n\tjg\tnear .rowloop\n\n.return:\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jcolsamp.inc",
    "content": ";\n; jcolsamp.inc - private declarations for color conversion & up/downsampling\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; [TAB8]\n\n; --------------------------------------------------------------------------\n\n; pseudo-resisters to make ordering of RGB configurable\n;\n%if RGB_RED == 0\n%define  mmA  mm0\n%define  mmB  mm1\n%define xmmA xmm0\n%define xmmB xmm1\n%elif RGB_GREEN == 0\n%define  mmA  mm2\n%define  mmB  mm3\n%define xmmA xmm2\n%define xmmB xmm3\n%elif RGB_BLUE == 0\n%define  mmA  mm4\n%define  mmB  mm5\n%define xmmA xmm4\n%define xmmB xmm5\n%else\n%define  mmA  mm6\n%define  mmB  mm7\n%define xmmA xmm6\n%define xmmB xmm7\n%endif\n\n%if RGB_RED == 1\n%define  mmC  mm0\n%define  mmD  mm1\n%define xmmC xmm0\n%define xmmD xmm1\n%elif RGB_GREEN == 1\n%define  mmC  mm2\n%define  mmD  mm3\n%define xmmC xmm2\n%define xmmD xmm3\n%elif RGB_BLUE == 1\n%define  mmC  mm4\n%define  mmD  mm5\n%define xmmC xmm4\n%define xmmD xmm5\n%else\n%define  mmC  mm6\n%define  mmD  mm7\n%define xmmC xmm6\n%define xmmD xmm7\n%endif\n\n%if RGB_RED == 2\n%define  mmE  mm0\n%define  mmF  mm1\n%define xmmE xmm0\n%define xmmF xmm1\n%elif RGB_GREEN == 2\n%define  mmE  mm2\n%define  mmF  mm3\n%define xmmE xmm2\n%define xmmF xmm3\n%elif RGB_BLUE == 2\n%define  mmE  mm4\n%define  mmF  mm5\n%define xmmE xmm4\n%define xmmF xmm5\n%else\n%define  mmE  mm6\n%define  mmF  mm7\n%define xmmE xmm6\n%define xmmF xmm7\n%endif\n\n%if RGB_RED == 3\n%define  mmG  mm0\n%define  mmH  mm1\n%define xmmG xmm0\n%define xmmH xmm1\n%elif RGB_GREEN == 3\n%define  mmG  mm2\n%define  mmH  mm3\n%define xmmG xmm2\n%define xmmH xmm3\n%elif RGB_BLUE == 3\n%define  mmG  mm4\n%define  mmH  mm5\n%define xmmG xmm4\n%define xmmH xmm5\n%else\n%define  mmG  mm6\n%define  mmH  mm7\n%define xmmG xmm6\n%define xmmH xmm7\n%endif\n\n; --------------------------------------------------------------------------\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jcqnt3dn.asm",
    "content": ";\n; jcqnt3dn.asm - sample data conversion and quantization (3DNow! & MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Load data into workspace, applying unsigned->signed conversion\n;\n; GLOBAL(void)\n; jsimd_convsamp_float_3dnow (JSAMPARRAY sample_data, JDIMENSION start_col,\n;                             FAST_FLOAT * workspace);\n;\n\n%define sample_data\tebp+8\t\t; JSAMPARRAY sample_data\n%define start_col\tebp+12\t\t; JDIMENSION start_col\n%define workspace\tebp+16\t\t; FAST_FLOAT * workspace\n\n\talign\t16\n\tglobal\tEXTN(jsimd_convsamp_float_3dnow)\n\nEXTN(jsimd_convsamp_float_3dnow):\n\tpush\tebp\n\tmov\tebp,esp\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tpcmpeqw  mm7,mm7\n\tpsllw    mm7,7\n\tpacksswb mm7,mm7\t\t; mm7 = PB_CENTERJSAMPLE (0x808080..)\n\n\tmov\tesi, JSAMPARRAY [sample_data]\t; (JSAMPROW *)\n\tmov\teax, JDIMENSION [start_col]\n\tmov\tedi, POINTER [workspace]\t; (DCTELEM *)\n\tmov\tecx, DCTSIZE/2\n\talignx\t16,7\n.convloop:\n\tmov\tebx, JSAMPROW [esi+0*SIZEOF_JSAMPROW]\t; (JSAMPLE *)\n\tmov\tedx, JSAMPROW [esi+1*SIZEOF_JSAMPROW]\t; (JSAMPLE *)\n\n\tmovq\tmm0, MMWORD [ebx+eax*SIZEOF_JSAMPLE]\n\tmovq\tmm1, MMWORD [edx+eax*SIZEOF_JSAMPLE]\n\n\tpsubb\tmm0,mm7\t\t\t\t; mm0=(01234567)\n\tpsubb\tmm1,mm7\t\t\t\t; mm1=(89ABCDEF)\n\n\tpunpcklbw mm2,mm0\t\t\t; mm2=(*0*1*2*3)\n\tpunpckhbw mm0,mm0\t\t\t; mm0=(*4*5*6*7)\n\tpunpcklbw mm3,mm1\t\t\t; mm3=(*8*9*A*B)\n\tpunpckhbw mm1,mm1\t\t\t; mm1=(*C*D*E*F)\n\n\tpunpcklwd mm4,mm2\t\t\t; mm4=(***0***1)\n\tpunpckhwd mm2,mm2\t\t\t; mm2=(***2***3)\n\tpunpcklwd mm5,mm0\t\t\t; mm5=(***4***5)\n\tpunpckhwd mm0,mm0\t\t\t; mm0=(***6***7)\n\n\tpsrad\tmm4,(DWORD_BIT-BYTE_BIT)\t; mm4=(01)\n\tpsrad\tmm2,(DWORD_BIT-BYTE_BIT)\t; mm2=(23)\n\tpi2fd\tmm4,mm4\n\tpi2fd\tmm2,mm2\n\tpsrad\tmm5,(DWORD_BIT-BYTE_BIT)\t; mm5=(45)\n\tpsrad\tmm0,(DWORD_BIT-BYTE_BIT)\t; mm0=(67)\n\tpi2fd\tmm5,mm5\n\tpi2fd\tmm0,mm0\n\n\tmovq\tMMWORD [MMBLOCK(0,0,edi,SIZEOF_FAST_FLOAT)], mm4\n\tmovq\tMMWORD [MMBLOCK(0,1,edi,SIZEOF_FAST_FLOAT)], mm2\n\tmovq\tMMWORD [MMBLOCK(0,2,edi,SIZEOF_FAST_FLOAT)], mm5\n\tmovq\tMMWORD [MMBLOCK(0,3,edi,SIZEOF_FAST_FLOAT)], mm0\n\n\tpunpcklwd mm6,mm3\t\t\t; mm6=(***8***9)\n\tpunpckhwd mm3,mm3\t\t\t; mm3=(***A***B)\n\tpunpcklwd mm4,mm1\t\t\t; mm4=(***C***D)\n\tpunpckhwd mm1,mm1\t\t\t; mm1=(***E***F)\n\n\tpsrad\tmm6,(DWORD_BIT-BYTE_BIT)\t; mm6=(89)\n\tpsrad\tmm3,(DWORD_BIT-BYTE_BIT)\t; mm3=(AB)\n\tpi2fd\tmm6,mm6\n\tpi2fd\tmm3,mm3\n\tpsrad\tmm4,(DWORD_BIT-BYTE_BIT)\t; mm4=(CD)\n\tpsrad\tmm1,(DWORD_BIT-BYTE_BIT)\t; mm1=(EF)\n\tpi2fd\tmm4,mm4\n\tpi2fd\tmm1,mm1\n\n\tmovq\tMMWORD [MMBLOCK(1,0,edi,SIZEOF_FAST_FLOAT)], mm6\n\tmovq\tMMWORD [MMBLOCK(1,1,edi,SIZEOF_FAST_FLOAT)], mm3\n\tmovq\tMMWORD [MMBLOCK(1,2,edi,SIZEOF_FAST_FLOAT)], mm4\n\tmovq\tMMWORD [MMBLOCK(1,3,edi,SIZEOF_FAST_FLOAT)], mm1\n\n\tadd\tesi, byte 2*SIZEOF_JSAMPROW\n\tadd\tedi, byte 2*DCTSIZE*SIZEOF_FAST_FLOAT\n\tdec\tecx\n\tjnz\tnear .convloop\n\n\tfemms\t\t; empty MMX/3DNow! state\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tpop\tebp\n\tret\n\n\n; --------------------------------------------------------------------------\n;\n; Quantize/descale the coefficients, and store into coef_block\n;\n; GLOBAL(void)\n; jsimd_quantize_float_3dnow (JCOEFPTR coef_block, FAST_FLOAT * divisors,\n;                             FAST_FLOAT * workspace);\n;\n\n%define coef_block\tebp+8\t\t; JCOEFPTR coef_block\n%define divisors\tebp+12\t\t; FAST_FLOAT * divisors\n%define workspace\tebp+16\t\t; FAST_FLOAT * workspace\n\n\talign\t16\n\tglobal\tEXTN(jsimd_quantize_float_3dnow)\n\nEXTN(jsimd_quantize_float_3dnow):\n\tpush\tebp\n\tmov\tebp,esp\n;\tpush\tebx\t\t; unused\n;\tpush\tecx\t\t; unused\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tmov       eax, 0x4B400000\t; (float)0x00C00000 (rndint_magic)\n\tmovd      mm7,eax\n\tpunpckldq mm7,mm7\t\t; mm7={12582912.0F 12582912.0F}\n\n\tmov\tesi, POINTER [workspace]\n\tmov\tedx, POINTER [divisors]\n\tmov\tedi, JCOEFPTR [coef_block]\n\tmov\teax, DCTSIZE2/16\n\talignx\t16,7\n.quantloop:\n\tmovq\tmm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm1, MMWORD [MMBLOCK(0,1,esi,SIZEOF_FAST_FLOAT)]\n\tpfmul\tmm0, MMWORD [MMBLOCK(0,0,edx,SIZEOF_FAST_FLOAT)]\n\tpfmul\tmm1, MMWORD [MMBLOCK(0,1,edx,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm2, MMWORD [MMBLOCK(0,2,esi,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm3, MMWORD [MMBLOCK(0,3,esi,SIZEOF_FAST_FLOAT)]\n\tpfmul\tmm2, MMWORD [MMBLOCK(0,2,edx,SIZEOF_FAST_FLOAT)]\n\tpfmul\tmm3, MMWORD [MMBLOCK(0,3,edx,SIZEOF_FAST_FLOAT)]\n\n\tpfadd\tmm0,mm7\t\t\t; mm0=(00 ** 01 **)\n\tpfadd\tmm1,mm7\t\t\t; mm1=(02 ** 03 **)\n\tpfadd\tmm2,mm7\t\t\t; mm0=(04 ** 05 **)\n\tpfadd\tmm3,mm7\t\t\t; mm1=(06 ** 07 **)\n\n\tmovq      mm4,mm0\n\tpunpcklwd mm0,mm1\t\t; mm0=(00 02 ** **)\n\tpunpckhwd mm4,mm1\t\t; mm4=(01 03 ** **)\n\tmovq      mm5,mm2\n\tpunpcklwd mm2,mm3\t\t; mm2=(04 06 ** **)\n\tpunpckhwd mm5,mm3\t\t; mm5=(05 07 ** **)\n\n\tpunpcklwd mm0,mm4\t\t; mm0=(00 01 02 03)\n\tpunpcklwd mm2,mm5\t\t; mm2=(04 05 06 07)\n\n\tmovq\tmm6, MMWORD [MMBLOCK(1,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm1, MMWORD [MMBLOCK(1,1,esi,SIZEOF_FAST_FLOAT)]\n\tpfmul\tmm6, MMWORD [MMBLOCK(1,0,edx,SIZEOF_FAST_FLOAT)]\n\tpfmul\tmm1, MMWORD [MMBLOCK(1,1,edx,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm3, MMWORD [MMBLOCK(1,2,esi,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm4, MMWORD [MMBLOCK(1,3,esi,SIZEOF_FAST_FLOAT)]\n\tpfmul\tmm3, MMWORD [MMBLOCK(1,2,edx,SIZEOF_FAST_FLOAT)]\n\tpfmul\tmm4, MMWORD [MMBLOCK(1,3,edx,SIZEOF_FAST_FLOAT)]\n\n\tpfadd\tmm6,mm7\t\t\t; mm0=(10 ** 11 **)\n\tpfadd\tmm1,mm7\t\t\t; mm4=(12 ** 13 **)\n\tpfadd\tmm3,mm7\t\t\t; mm0=(14 ** 15 **)\n\tpfadd\tmm4,mm7\t\t\t; mm4=(16 ** 17 **)\n\n\tmovq      mm5,mm6\n\tpunpcklwd mm6,mm1\t\t; mm6=(10 12 ** **)\n\tpunpckhwd mm5,mm1\t\t; mm5=(11 13 ** **)\n\tmovq      mm1,mm3\n\tpunpcklwd mm3,mm4\t\t; mm3=(14 16 ** **)\n\tpunpckhwd mm1,mm4\t\t; mm1=(15 17 ** **)\n\n\tpunpcklwd mm6,mm5\t\t; mm6=(10 11 12 13)\n\tpunpcklwd mm3,mm1\t\t; mm3=(14 15 16 17)\n\n\tmovq\tMMWORD [MMBLOCK(0,0,edi,SIZEOF_JCOEF)], mm0\n\tmovq\tMMWORD [MMBLOCK(0,1,edi,SIZEOF_JCOEF)], mm2\n\tmovq\tMMWORD [MMBLOCK(1,0,edi,SIZEOF_JCOEF)], mm6\n\tmovq\tMMWORD [MMBLOCK(1,1,edi,SIZEOF_JCOEF)], mm3\n\n\tadd\tesi, byte 16*SIZEOF_FAST_FLOAT\n\tadd\tedx, byte 16*SIZEOF_FAST_FLOAT\n\tadd\tedi, byte 16*SIZEOF_JCOEF\n\tdec\teax\n\tjnz\tnear .quantloop\n\n\tfemms\t\t; empty MMX/3DNow! state\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; unused\n;\tpop\tebx\t\t; unused\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jcqntmmx.asm",
    "content": ";\n; jcqntmmx.asm - sample data conversion and quantization (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Load data into workspace, applying unsigned->signed conversion\n;\n; GLOBAL(void)\n; jsimd_convsamp_mmx (JSAMPARRAY sample_data, JDIMENSION start_col,\n;                     DCTELEM * workspace);\n;\n\n%define sample_data\tebp+8\t\t; JSAMPARRAY sample_data\n%define start_col\tebp+12\t\t; JDIMENSION start_col\n%define workspace\tebp+16\t\t; DCTELEM * workspace\n\n\talign\t16\n\tglobal\tEXTN(jsimd_convsamp_mmx)\n\nEXTN(jsimd_convsamp_mmx):\n\tpush\tebp\n\tmov\tebp,esp\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tpxor\tmm6,mm6\t\t\t; mm6=(all 0's)\n\tpcmpeqw\tmm7,mm7\n\tpsllw\tmm7,7\t\t\t; mm7={0xFF80 0xFF80 0xFF80 0xFF80}\n\n\tmov\tesi, JSAMPARRAY [sample_data]\t; (JSAMPROW *)\n\tmov\teax, JDIMENSION [start_col]\n\tmov\tedi, POINTER [workspace]\t; (DCTELEM *)\n\tmov\tecx, DCTSIZE/4\n\talignx\t16,7\n.convloop:\n\tmov\tebx, JSAMPROW [esi+0*SIZEOF_JSAMPROW]\t; (JSAMPLE *)\n\tmov\tedx, JSAMPROW [esi+1*SIZEOF_JSAMPROW]\t; (JSAMPLE *)\n\n\tmovq\tmm0, MMWORD [ebx+eax*SIZEOF_JSAMPLE]\t; mm0=(01234567)\n\tmovq\tmm1, MMWORD [edx+eax*SIZEOF_JSAMPLE]\t; mm1=(89ABCDEF)\n\n\tmov\tebx, JSAMPROW [esi+2*SIZEOF_JSAMPROW]\t; (JSAMPLE *)\n\tmov\tedx, JSAMPROW [esi+3*SIZEOF_JSAMPROW]\t; (JSAMPLE *)\n\n\tmovq\tmm2, MMWORD [ebx+eax*SIZEOF_JSAMPLE]\t; mm2=(GHIJKLMN)\n\tmovq\tmm3, MMWORD [edx+eax*SIZEOF_JSAMPLE]\t; mm3=(OPQRSTUV)\n\n\tmovq      mm4,mm0\n\tpunpcklbw mm0,mm6\t\t; mm0=(0123)\n\tpunpckhbw mm4,mm6\t\t; mm4=(4567)\n\tmovq      mm5,mm1\n\tpunpcklbw mm1,mm6\t\t; mm1=(89AB)\n\tpunpckhbw mm5,mm6\t\t; mm5=(CDEF)\n\n\tpaddw\tmm0,mm7\n\tpaddw\tmm4,mm7\n\tpaddw\tmm1,mm7\n\tpaddw\tmm5,mm7\n\n\tmovq\tMMWORD [MMBLOCK(0,0,edi,SIZEOF_DCTELEM)], mm0\n\tmovq\tMMWORD [MMBLOCK(0,1,edi,SIZEOF_DCTELEM)], mm4\n\tmovq\tMMWORD [MMBLOCK(1,0,edi,SIZEOF_DCTELEM)], mm1\n\tmovq\tMMWORD [MMBLOCK(1,1,edi,SIZEOF_DCTELEM)], mm5\n\n\tmovq      mm0,mm2\n\tpunpcklbw mm2,mm6\t\t; mm2=(GHIJ)\n\tpunpckhbw mm0,mm6\t\t; mm0=(KLMN)\n\tmovq      mm4,mm3\n\tpunpcklbw mm3,mm6\t\t; mm3=(OPQR)\n\tpunpckhbw mm4,mm6\t\t; mm4=(STUV)\n\n\tpaddw\tmm2,mm7\n\tpaddw\tmm0,mm7\n\tpaddw\tmm3,mm7\n\tpaddw\tmm4,mm7\n\n\tmovq\tMMWORD [MMBLOCK(2,0,edi,SIZEOF_DCTELEM)], mm2\n\tmovq\tMMWORD [MMBLOCK(2,1,edi,SIZEOF_DCTELEM)], mm0\n\tmovq\tMMWORD [MMBLOCK(3,0,edi,SIZEOF_DCTELEM)], mm3\n\tmovq\tMMWORD [MMBLOCK(3,1,edi,SIZEOF_DCTELEM)], mm4\n\n\tadd\tesi, byte 4*SIZEOF_JSAMPROW\n\tadd\tedi, byte 4*DCTSIZE*SIZEOF_DCTELEM\n\tdec\tecx\n\tjnz\tshort .convloop\n\n\temms\t\t; empty MMX state\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tpop\tebp\n\tret\n\n; --------------------------------------------------------------------------\n;\n; Quantize/descale the coefficients, and store into coef_block\n;\n; This implementation is based on an algorithm described in\n;   \"How to optimize for the Pentium family of microprocessors\"\n;   (http://www.agner.org/assem/).\n;\n; GLOBAL(void)\n; jsimd_quantize_mmx (JCOEFPTR coef_block, DCTELEM * divisors,\n;                     DCTELEM * workspace);\n;\n\n%define RECIPROCAL(m,n,b) MMBLOCK(DCTSIZE*0+(m),(n),(b),SIZEOF_DCTELEM)\n%define CORRECTION(m,n,b) MMBLOCK(DCTSIZE*1+(m),(n),(b),SIZEOF_DCTELEM)\n%define SCALE(m,n,b)      MMBLOCK(DCTSIZE*2+(m),(n),(b),SIZEOF_DCTELEM)\n%define SHIFT(m,n,b)      MMBLOCK(DCTSIZE*3+(m),(n),(b),SIZEOF_DCTELEM)\n\n%define coef_block\tebp+8\t\t; JCOEFPTR coef_block\n%define divisors\tebp+12\t\t; DCTELEM * divisors\n%define workspace\tebp+16\t\t; DCTELEM * workspace\n\n\talign\t16\n\tglobal\tEXTN(jsimd_quantize_mmx)\n\nEXTN(jsimd_quantize_mmx):\n\tpush\tebp\n\tmov\tebp,esp\n;\tpush\tebx\t\t; unused\n;\tpush\tecx\t\t; unused\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tmov\tesi, POINTER [workspace]\n\tmov\tedx, POINTER [divisors]\n\tmov\tedi, JCOEFPTR [coef_block]\n\tmov\tah, 2\n\talignx\t16,7\n.quantloop1:\n\tmov\tal, DCTSIZE2/8/2\n\talignx\t16,7\n.quantloop2:\n\tmovq\tmm2, MMWORD [MMBLOCK(0,0,esi,SIZEOF_DCTELEM)]\n\tmovq\tmm3, MMWORD [MMBLOCK(0,1,esi,SIZEOF_DCTELEM)]\n\n\tmovq\tmm0,mm2\n\tmovq\tmm1,mm3\n\n\tpsraw\tmm2,(WORD_BIT-1)  ; -1 if value < 0, 0 otherwise\n\tpsraw\tmm3,(WORD_BIT-1)\n\n\tpxor\tmm0,mm2   ; val = -val\n\tpxor\tmm1,mm3\n\tpsubw\tmm0,mm2\n\tpsubw\tmm1,mm3\n\n\t;\n\t; MMX is an annoyingly crappy instruction set. It has two\n\t; misfeatures that are causing problems here:\n\t;\n\t; - All multiplications are signed.\n\t;\n\t; - The second operand for the shifts is not treated as packed.\n\t;\n\t;\n\t; We work around the first problem by implementing this algorithm:\n\t;\n\t; unsigned long unsigned_multiply(unsigned short x, unsigned short y)\n\t; {\n\t;   enum { SHORT_BIT = 16 };\n\t;   signed short sx = (signed short) x;\n\t;   signed short sy = (signed short) y;\n\t;   signed long sz;\n\t; \n\t;   sz = (long) sx * (long) sy;     /* signed multiply */\n\t; \n\t;   if (sx < 0) sz += (long) sy << SHORT_BIT;\n\t;   if (sy < 0) sz += (long) sx << SHORT_BIT;\n\t; \n\t;   return (unsigned long) sz;\n\t; }\n\t;\n\t; (note that a negative sx adds _sy_ and vice versa)\n\t;\n\t; For the second problem, we replace the shift by a multiplication.\n\t; Unfortunately that means we have to deal with the signed issue again.\n\t;\n\n\tpaddw\tmm0, MMWORD [CORRECTION(0,0,edx)]   ; correction + roundfactor\n\tpaddw\tmm1, MMWORD [CORRECTION(0,1,edx)]\n\n\tmovq\tmm4,mm0   ; store current value for later\n\tmovq\tmm5,mm1\n\tpmulhw\tmm0, MMWORD [RECIPROCAL(0,0,edx)]   ; reciprocal\n\tpmulhw\tmm1, MMWORD [RECIPROCAL(0,1,edx)]\n\tpaddw\tmm0,mm4\t\t; reciprocal is always negative (MSB=1),\n\tpaddw\tmm1,mm5   ; so we always need to add the initial value\n\t                ; (input value is never negative as we\n\t                ; inverted it at the start of this routine)\n\n\t; here it gets a bit tricky as both scale\n\t; and mm0/mm1 can be negative\n\tmovq\tmm6, MMWORD [SCALE(0,0,edx)]\t; scale\n\tmovq\tmm7, MMWORD [SCALE(0,1,edx)]\n\tmovq\tmm4,mm0\n\tmovq\tmm5,mm1\n\tpmulhw\tmm0,mm6\n\tpmulhw\tmm1,mm7\n\n\tpsraw\tmm6,(WORD_BIT-1)    ; determine if scale is negative\n\tpsraw\tmm7,(WORD_BIT-1)\n\n\tpand\tmm6,mm4             ; and add input if it is\n\tpand\tmm7,mm5\n\tpaddw\tmm0,mm6\n\tpaddw\tmm1,mm7\n\n\tpsraw\tmm4,(WORD_BIT-1)    ; then check if negative input \n\tpsraw\tmm5,(WORD_BIT-1)\n\n\tpand\tmm4, MMWORD [SCALE(0,0,edx)]\t; and add scale if it is\n\tpand\tmm5, MMWORD [SCALE(0,1,edx)]\n\tpaddw\tmm0,mm4\n\tpaddw\tmm1,mm5\n\n\tpxor\tmm0,mm2   ; val = -val\n\tpxor\tmm1,mm3\n\tpsubw\tmm0,mm2\n\tpsubw\tmm1,mm3\n\n\tmovq\tMMWORD [MMBLOCK(0,0,edi,SIZEOF_DCTELEM)], mm0\n\tmovq\tMMWORD [MMBLOCK(0,1,edi,SIZEOF_DCTELEM)], mm1\n\n\tadd\tesi, byte 8*SIZEOF_DCTELEM\n\tadd\tedx, byte 8*SIZEOF_DCTELEM\n\tadd\tedi, byte 8*SIZEOF_JCOEF\n\tdec\tal\n\tjnz\tnear .quantloop2\n\tdec\tah\n\tjnz\tnear .quantloop1\t; to avoid branch misprediction\n\n\temms\t\t; empty MMX state\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; unused\n;\tpop\tebx\t\t; unused\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jcqnts2f-64.asm",
    "content": ";\n; jcqnts2f-64.asm - sample data conversion and quantization (64-bit SSE & SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2009 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t64\n;\n; Load data into workspace, applying unsigned->signed conversion\n;\n; GLOBAL(void)\n; jsimd_convsamp_float_sse2 (JSAMPARRAY sample_data, JDIMENSION start_col,\n;                            FAST_FLOAT * workspace);\n;\n\n; r10 = JSAMPARRAY sample_data\n; r11 = JDIMENSION start_col\n; r12 = FAST_FLOAT * workspace\n\n\talign\t16\n\tglobal\tEXTN(jsimd_convsamp_float_sse2)\n\nEXTN(jsimd_convsamp_float_sse2):\n\tpush\trbp\n\tmov\trax,rsp\n\tmov\trbp,rsp\n\tcollect_args\n\tpush\trbx\n\n\tpcmpeqw  xmm7,xmm7\n\tpsllw    xmm7,7\n\tpacksswb xmm7,xmm7\t\t; xmm7 = PB_CENTERJSAMPLE (0x808080..)\n\n\tmov rsi, r10\n\tmov\trax, r11\n\tmov rdi, r12\n\tmov\trcx, DCTSIZE/2\n.convloop:\n\tmov\trbx, JSAMPROW [rsi+0*SIZEOF_JSAMPROW]\t; (JSAMPLE *)\n\tmov rdx, JSAMPROW [rsi+1*SIZEOF_JSAMPROW]\t; (JSAMPLE *)\n\n\tmovq\txmm0, XMM_MMWORD [rbx+rax*SIZEOF_JSAMPLE]\n\tmovq\txmm1, XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE]\n\n\tpsubb\txmm0,xmm7\t\t\t; xmm0=(01234567)\n\tpsubb\txmm1,xmm7\t\t\t; xmm1=(89ABCDEF)\n\n\tpunpcklbw xmm0,xmm0\t\t\t; xmm0=(*0*1*2*3*4*5*6*7)\n\tpunpcklbw xmm1,xmm1\t\t\t; xmm1=(*8*9*A*B*C*D*E*F)\n\n\tpunpcklwd xmm2,xmm0\t\t\t; xmm2=(***0***1***2***3)\n\tpunpckhwd xmm0,xmm0\t\t\t; xmm0=(***4***5***6***7)\n\tpunpcklwd xmm3,xmm1\t\t\t; xmm3=(***8***9***A***B)\n\tpunpckhwd xmm1,xmm1\t\t\t; xmm1=(***C***D***E***F)\n\n\tpsrad     xmm2,(DWORD_BIT-BYTE_BIT)\t; xmm2=(0123)\n\tpsrad     xmm0,(DWORD_BIT-BYTE_BIT)\t; xmm0=(4567)\n\tcvtdq2ps  xmm2,xmm2\t\t\t; xmm2=(0123)\n\tcvtdq2ps  xmm0,xmm0\t\t\t; xmm0=(4567)\n\tpsrad     xmm3,(DWORD_BIT-BYTE_BIT)\t; xmm3=(89AB)\n\tpsrad     xmm1,(DWORD_BIT-BYTE_BIT)\t; xmm1=(CDEF)\n\tcvtdq2ps  xmm3,xmm3\t\t\t; xmm3=(89AB)\n\tcvtdq2ps  xmm1,xmm1\t\t\t; xmm1=(CDEF)\n\n\tmovaps\tXMMWORD [XMMBLOCK(0,0,rdi,SIZEOF_FAST_FLOAT)], xmm2\n\tmovaps\tXMMWORD [XMMBLOCK(0,1,rdi,SIZEOF_FAST_FLOAT)], xmm0\n\tmovaps\tXMMWORD [XMMBLOCK(1,0,rdi,SIZEOF_FAST_FLOAT)], xmm3\n\tmovaps\tXMMWORD [XMMBLOCK(1,1,rdi,SIZEOF_FAST_FLOAT)], xmm1\n\n\tadd\trsi, byte 2*SIZEOF_JSAMPROW\n\tadd\trdi, byte 2*DCTSIZE*SIZEOF_FAST_FLOAT\n\tdec\trcx\n\tjnz\tshort .convloop\n\n\tpop\trbx\n\tuncollect_args\n\tpop\trbp\n\tret\n\n\n; --------------------------------------------------------------------------\n;\n; Quantize/descale the coefficients, and store into coef_block\n;\n; GLOBAL(void)\n; jsimd_quantize_float_sse2 (JCOEFPTR coef_block, FAST_FLOAT * divisors,\n;                         FAST_FLOAT * workspace);\n;\n\n; r10 = JCOEFPTR coef_block\n; r11 = FAST_FLOAT * divisors\n; r12 = FAST_FLOAT * workspace\n\n\talign\t16\n\tglobal\tEXTN(jsimd_quantize_float_sse2)\n\nEXTN(jsimd_quantize_float_sse2):\n\tpush\trbp\n\tmov\trax,rsp\n\tmov\trbp,rsp\n\tcollect_args\n\n\tmov rsi, r12\n\tmov rdx, r11\n\tmov rdi, r10\n\tmov\trax, DCTSIZE2/16\n.quantloop:\n\tmovaps\txmm0, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm1, XMMWORD [XMMBLOCK(0,1,rsi,SIZEOF_FAST_FLOAT)]\n\tmulps\txmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_FAST_FLOAT)]\n\tmulps\txmm1, XMMWORD [XMMBLOCK(0,1,rdx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm2, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm3, XMMWORD [XMMBLOCK(1,1,rsi,SIZEOF_FAST_FLOAT)]\n\tmulps\txmm2, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_FAST_FLOAT)]\n\tmulps\txmm3, XMMWORD [XMMBLOCK(1,1,rdx,SIZEOF_FAST_FLOAT)]\n\n\tcvtps2dq xmm0,xmm0\n\tcvtps2dq xmm1,xmm1\n\tcvtps2dq xmm2,xmm2\n\tcvtps2dq xmm3,xmm3\n\n\tpackssdw xmm0,xmm1\n\tpackssdw xmm2,xmm3\n\n\tmovdqa\tXMMWORD [XMMBLOCK(0,0,rdi,SIZEOF_JCOEF)], xmm0\n\tmovdqa\tXMMWORD [XMMBLOCK(1,0,rdi,SIZEOF_JCOEF)], xmm2\n\n\tadd\trsi, byte 16*SIZEOF_FAST_FLOAT\n\tadd\trdx, byte 16*SIZEOF_FAST_FLOAT\n\tadd\trdi, byte 16*SIZEOF_JCOEF\n\tdec\trax\n\tjnz\tshort .quantloop\n\n\tuncollect_args\n\tpop\trbp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jcqnts2f.asm",
    "content": ";\n; jcqnts2f.asm - sample data conversion and quantization (SSE & SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Load data into workspace, applying unsigned->signed conversion\n;\n; GLOBAL(void)\n; jsimd_convsamp_float_sse2 (JSAMPARRAY sample_data, JDIMENSION start_col,\n;                            FAST_FLOAT * workspace);\n;\n\n%define sample_data\tebp+8\t\t; JSAMPARRAY sample_data\n%define start_col\tebp+12\t\t; JDIMENSION start_col\n%define workspace\tebp+16\t\t; FAST_FLOAT * workspace\n\n\talign\t16\n\tglobal\tEXTN(jsimd_convsamp_float_sse2)\n\nEXTN(jsimd_convsamp_float_sse2):\n\tpush\tebp\n\tmov\tebp,esp\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tpcmpeqw  xmm7,xmm7\n\tpsllw    xmm7,7\n\tpacksswb xmm7,xmm7\t\t; xmm7 = PB_CENTERJSAMPLE (0x808080..)\n\n\tmov\tesi, JSAMPARRAY [sample_data]\t; (JSAMPROW *)\n\tmov\teax, JDIMENSION [start_col]\n\tmov\tedi, POINTER [workspace]\t; (DCTELEM *)\n\tmov\tecx, DCTSIZE/2\n\talignx\t16,7\n.convloop:\n\tmov\tebx, JSAMPROW [esi+0*SIZEOF_JSAMPROW]\t; (JSAMPLE *)\n\tmov\tedx, JSAMPROW [esi+1*SIZEOF_JSAMPROW]\t; (JSAMPLE *)\n\n\tmovq\txmm0, XMM_MMWORD [ebx+eax*SIZEOF_JSAMPLE]\n\tmovq\txmm1, XMM_MMWORD [edx+eax*SIZEOF_JSAMPLE]\n\n\tpsubb\txmm0,xmm7\t\t\t; xmm0=(01234567)\n\tpsubb\txmm1,xmm7\t\t\t; xmm1=(89ABCDEF)\n\n\tpunpcklbw xmm0,xmm0\t\t\t; xmm0=(*0*1*2*3*4*5*6*7)\n\tpunpcklbw xmm1,xmm1\t\t\t; xmm1=(*8*9*A*B*C*D*E*F)\n\n\tpunpcklwd xmm2,xmm0\t\t\t; xmm2=(***0***1***2***3)\n\tpunpckhwd xmm0,xmm0\t\t\t; xmm0=(***4***5***6***7)\n\tpunpcklwd xmm3,xmm1\t\t\t; xmm3=(***8***9***A***B)\n\tpunpckhwd xmm1,xmm1\t\t\t; xmm1=(***C***D***E***F)\n\n\tpsrad     xmm2,(DWORD_BIT-BYTE_BIT)\t; xmm2=(0123)\n\tpsrad     xmm0,(DWORD_BIT-BYTE_BIT)\t; xmm0=(4567)\n\tcvtdq2ps  xmm2,xmm2\t\t\t; xmm2=(0123)\n\tcvtdq2ps  xmm0,xmm0\t\t\t; xmm0=(4567)\n\tpsrad     xmm3,(DWORD_BIT-BYTE_BIT)\t; xmm3=(89AB)\n\tpsrad     xmm1,(DWORD_BIT-BYTE_BIT)\t; xmm1=(CDEF)\n\tcvtdq2ps  xmm3,xmm3\t\t\t; xmm3=(89AB)\n\tcvtdq2ps  xmm1,xmm1\t\t\t; xmm1=(CDEF)\n\n\tmovaps\tXMMWORD [XMMBLOCK(0,0,edi,SIZEOF_FAST_FLOAT)], xmm2\n\tmovaps\tXMMWORD [XMMBLOCK(0,1,edi,SIZEOF_FAST_FLOAT)], xmm0\n\tmovaps\tXMMWORD [XMMBLOCK(1,0,edi,SIZEOF_FAST_FLOAT)], xmm3\n\tmovaps\tXMMWORD [XMMBLOCK(1,1,edi,SIZEOF_FAST_FLOAT)], xmm1\n\n\tadd\tesi, byte 2*SIZEOF_JSAMPROW\n\tadd\tedi, byte 2*DCTSIZE*SIZEOF_FAST_FLOAT\n\tdec\tecx\n\tjnz\tshort .convloop\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tpop\tebp\n\tret\n\n\n; --------------------------------------------------------------------------\n;\n; Quantize/descale the coefficients, and store into coef_block\n;\n; GLOBAL(void)\n; jsimd_quantize_float_sse2 (JCOEFPTR coef_block, FAST_FLOAT * divisors,\n;                         FAST_FLOAT * workspace);\n;\n\n%define coef_block\tebp+8\t\t; JCOEFPTR coef_block\n%define divisors\tebp+12\t\t; FAST_FLOAT * divisors\n%define workspace\tebp+16\t\t; FAST_FLOAT * workspace\n\n\talign\t16\n\tglobal\tEXTN(jsimd_quantize_float_sse2)\n\nEXTN(jsimd_quantize_float_sse2):\n\tpush\tebp\n\tmov\tebp,esp\n;\tpush\tebx\t\t; unused\n;\tpush\tecx\t\t; unused\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tmov\tesi, POINTER [workspace]\n\tmov\tedx, POINTER [divisors]\n\tmov\tedi, JCOEFPTR [coef_block]\n\tmov\teax, DCTSIZE2/16\n\talignx\t16,7\n.quantloop:\n\tmovaps\txmm0, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm1, XMMWORD [XMMBLOCK(0,1,esi,SIZEOF_FAST_FLOAT)]\n\tmulps\txmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_FAST_FLOAT)]\n\tmulps\txmm1, XMMWORD [XMMBLOCK(0,1,edx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm2, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm3, XMMWORD [XMMBLOCK(1,1,esi,SIZEOF_FAST_FLOAT)]\n\tmulps\txmm2, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_FAST_FLOAT)]\n\tmulps\txmm3, XMMWORD [XMMBLOCK(1,1,edx,SIZEOF_FAST_FLOAT)]\n\n\tcvtps2dq xmm0,xmm0\n\tcvtps2dq xmm1,xmm1\n\tcvtps2dq xmm2,xmm2\n\tcvtps2dq xmm3,xmm3\n\n\tpackssdw xmm0,xmm1\n\tpackssdw xmm2,xmm3\n\n\tmovdqa\tXMMWORD [XMMBLOCK(0,0,edi,SIZEOF_JCOEF)], xmm0\n\tmovdqa\tXMMWORD [XMMBLOCK(1,0,edi,SIZEOF_JCOEF)], xmm2\n\n\tadd\tesi, byte 16*SIZEOF_FAST_FLOAT\n\tadd\tedx, byte 16*SIZEOF_FAST_FLOAT\n\tadd\tedi, byte 16*SIZEOF_JCOEF\n\tdec\teax\n\tjnz\tshort .quantloop\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; unused\n;\tpop\tebx\t\t; unused\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jcqnts2i-64.asm",
    "content": ";\n; jcqnts2i-64.asm - sample data conversion and quantization (64-bit SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2009 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t64\n;\n; Load data into workspace, applying unsigned->signed conversion\n;\n; GLOBAL(void)\n; jsimd_convsamp_sse2 (JSAMPARRAY sample_data, JDIMENSION start_col,\n;                      DCTELEM * workspace);\n;\n\n; r10 = JSAMPARRAY sample_data\n; r11 = JDIMENSION start_col\n; r12 = DCTELEM * workspace\n\n\talign\t16\n\tglobal\tEXTN(jsimd_convsamp_sse2)\n\nEXTN(jsimd_convsamp_sse2):\n\tpush\trbp\n\tmov\trax,rsp\n\tmov\trbp,rsp\n\tcollect_args\n\tpush\trbx\n\n\tpxor\txmm6,xmm6\t\t; xmm6=(all 0's)\n\tpcmpeqw\txmm7,xmm7\n\tpsllw\txmm7,7\t\t\t; xmm7={0xFF80 0xFF80 0xFF80 0xFF80 ..}\n\n\tmov rsi, r10\n\tmov rax, r11\n\tmov rdi, r12\n\tmov\trcx, DCTSIZE/4\n.convloop:\n\tmov\trbx, JSAMPROW [rsi+0*SIZEOF_JSAMPROW]\t; (JSAMPLE *)\n\tmov rdx, JSAMPROW [rsi+1*SIZEOF_JSAMPROW]\t; (JSAMPLE *)\n\n\tmovq\txmm0, XMM_MMWORD [rbx+rax*SIZEOF_JSAMPLE]\t; xmm0=(01234567)\n\tmovq\txmm1, XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE]\t; xmm1=(89ABCDEF)\n\n\tmov\trbx, JSAMPROW [rsi+2*SIZEOF_JSAMPROW]\t; (JSAMPLE *)\n\tmov\trdx, JSAMPROW [rsi+3*SIZEOF_JSAMPROW]\t; (JSAMPLE *)\n\n\tmovq\txmm2, XMM_MMWORD [rbx+rax*SIZEOF_JSAMPLE]\t; xmm2=(GHIJKLMN)\n\tmovq\txmm3, XMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE]\t; xmm3=(OPQRSTUV)\n\n\tpunpcklbw xmm0,xmm6\t\t; xmm0=(01234567)\n\tpunpcklbw xmm1,xmm6\t\t; xmm1=(89ABCDEF)\n\tpaddw     xmm0,xmm7\n\tpaddw     xmm1,xmm7\n\tpunpcklbw xmm2,xmm6\t\t; xmm2=(GHIJKLMN)\n\tpunpcklbw xmm3,xmm6\t\t; xmm3=(OPQRSTUV)\n\tpaddw     xmm2,xmm7\n\tpaddw     xmm3,xmm7\n\n\tmovdqa\tXMMWORD [XMMBLOCK(0,0,rdi,SIZEOF_DCTELEM)], xmm0\n\tmovdqa\tXMMWORD [XMMBLOCK(1,0,rdi,SIZEOF_DCTELEM)], xmm1\n\tmovdqa\tXMMWORD [XMMBLOCK(2,0,rdi,SIZEOF_DCTELEM)], xmm2\n\tmovdqa\tXMMWORD [XMMBLOCK(3,0,rdi,SIZEOF_DCTELEM)], xmm3\n\n\tadd\trsi, byte 4*SIZEOF_JSAMPROW\n\tadd\trdi, byte 4*DCTSIZE*SIZEOF_DCTELEM\n\tdec\trcx\n\tjnz\tshort .convloop\n\n\tpop\trbx\n\tuncollect_args\n\tpop\trbp\n\tret\n\n; --------------------------------------------------------------------------\n;\n; Quantize/descale the coefficients, and store into coef_block\n;\n; This implementation is based on an algorithm described in\n;   \"How to optimize for the Pentium family of microprocessors\"\n;   (http://www.agner.org/assem/).\n;\n; GLOBAL(void)\n; jsimd_quantize_sse2 (JCOEFPTR coef_block, DCTELEM * divisors,\n;                      DCTELEM * workspace);\n;\n\n%define RECIPROCAL(m,n,b) XMMBLOCK(DCTSIZE*0+(m),(n),(b),SIZEOF_DCTELEM)\n%define CORRECTION(m,n,b) XMMBLOCK(DCTSIZE*1+(m),(n),(b),SIZEOF_DCTELEM)\n%define SCALE(m,n,b)      XMMBLOCK(DCTSIZE*2+(m),(n),(b),SIZEOF_DCTELEM)\n\n; r10 = JCOEFPTR coef_block\n; r11 = DCTELEM * divisors\n; r12 = DCTELEM * workspace\n\n\talign\t16\n\tglobal\tEXTN(jsimd_quantize_sse2)\n\nEXTN(jsimd_quantize_sse2):\n\tpush\trbp\n\tmov\trax,rsp\n\tmov\trbp,rsp\n\tcollect_args\n\n\tmov rsi, r12\n\tmov rdx, r11\n\tmov rdi, r10\n\tmov\trax, DCTSIZE2/32\n.quantloop:\n\tmovdqa\txmm4, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_DCTELEM)]\n\tmovdqa\txmm5, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_DCTELEM)]\n\tmovdqa\txmm6, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_DCTELEM)]\n\tmovdqa\txmm7, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_DCTELEM)]\n\tmovdqa\txmm0,xmm4\n\tmovdqa\txmm1,xmm5\n\tmovdqa\txmm2,xmm6\n\tmovdqa\txmm3,xmm7\n\tpsraw\txmm4,(WORD_BIT-1)\n\tpsraw\txmm5,(WORD_BIT-1)\n\tpsraw\txmm6,(WORD_BIT-1)\n\tpsraw\txmm7,(WORD_BIT-1)\n\tpxor\txmm0,xmm4\n\tpxor\txmm1,xmm5\n\tpxor\txmm2,xmm6\n\tpxor\txmm3,xmm7\n\tpsubw\txmm0,xmm4\t\t; if (xmm0 < 0) xmm0 = -xmm0;\n\tpsubw\txmm1,xmm5\t\t; if (xmm1 < 0) xmm1 = -xmm1;\n\tpsubw\txmm2,xmm6\t\t; if (xmm2 < 0) xmm2 = -xmm2;\n\tpsubw\txmm3,xmm7\t\t; if (xmm3 < 0) xmm3 = -xmm3;\n\n\tpaddw\txmm0, XMMWORD [CORRECTION(0,0,rdx)]  ; correction + roundfactor\n\tpaddw\txmm1, XMMWORD [CORRECTION(1,0,rdx)]\n\tpaddw\txmm2, XMMWORD [CORRECTION(2,0,rdx)]\n\tpaddw\txmm3, XMMWORD [CORRECTION(3,0,rdx)]\n\tpmulhuw\txmm0, XMMWORD [RECIPROCAL(0,0,rdx)]  ; reciprocal\n\tpmulhuw\txmm1, XMMWORD [RECIPROCAL(1,0,rdx)]\n\tpmulhuw\txmm2, XMMWORD [RECIPROCAL(2,0,rdx)]\n\tpmulhuw\txmm3, XMMWORD [RECIPROCAL(3,0,rdx)]\n\tpmulhuw\txmm0, XMMWORD [SCALE(0,0,rdx)]\t; scale\n\tpmulhuw\txmm1, XMMWORD [SCALE(1,0,rdx)]\n\tpmulhuw\txmm2, XMMWORD [SCALE(2,0,rdx)]\n\tpmulhuw\txmm3, XMMWORD [SCALE(3,0,rdx)]\n\n\tpxor\txmm0,xmm4\n\tpxor\txmm1,xmm5\n\tpxor\txmm2,xmm6\n\tpxor\txmm3,xmm7\n\tpsubw\txmm0,xmm4\n\tpsubw\txmm1,xmm5\n\tpsubw\txmm2,xmm6\n\tpsubw\txmm3,xmm7\n\tmovdqa\tXMMWORD [XMMBLOCK(0,0,rdi,SIZEOF_DCTELEM)], xmm0\n\tmovdqa\tXMMWORD [XMMBLOCK(1,0,rdi,SIZEOF_DCTELEM)], xmm1\n\tmovdqa\tXMMWORD [XMMBLOCK(2,0,rdi,SIZEOF_DCTELEM)], xmm2\n\tmovdqa\tXMMWORD [XMMBLOCK(3,0,rdi,SIZEOF_DCTELEM)], xmm3\n\n\tadd\trsi, byte 32*SIZEOF_DCTELEM\n\tadd\trdx, byte 32*SIZEOF_DCTELEM\n\tadd\trdi, byte 32*SIZEOF_JCOEF\n\tdec\trax\n\tjnz\tnear .quantloop\n\n\tuncollect_args\n\tpop\trbp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jcqnts2i.asm",
    "content": ";\n; jcqnts2i.asm - sample data conversion and quantization (SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Load data into workspace, applying unsigned->signed conversion\n;\n; GLOBAL(void)\n; jsimd_convsamp_sse2 (JSAMPARRAY sample_data, JDIMENSION start_col,\n;                      DCTELEM * workspace);\n;\n\n%define sample_data\tebp+8\t\t; JSAMPARRAY sample_data\n%define start_col\tebp+12\t\t; JDIMENSION start_col\n%define workspace\tebp+16\t\t; DCTELEM * workspace\n\n\talign\t16\n\tglobal\tEXTN(jsimd_convsamp_sse2)\n\nEXTN(jsimd_convsamp_sse2):\n\tpush\tebp\n\tmov\tebp,esp\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tpxor\txmm6,xmm6\t\t; xmm6=(all 0's)\n\tpcmpeqw\txmm7,xmm7\n\tpsllw\txmm7,7\t\t\t; xmm7={0xFF80 0xFF80 0xFF80 0xFF80 ..}\n\n\tmov\tesi, JSAMPARRAY [sample_data]\t; (JSAMPROW *)\n\tmov\teax, JDIMENSION [start_col]\n\tmov\tedi, POINTER [workspace]\t; (DCTELEM *)\n\tmov\tecx, DCTSIZE/4\n\talignx\t16,7\n.convloop:\n\tmov\tebx, JSAMPROW [esi+0*SIZEOF_JSAMPROW]\t; (JSAMPLE *)\n\tmov\tedx, JSAMPROW [esi+1*SIZEOF_JSAMPROW]\t; (JSAMPLE *)\n\n\tmovq\txmm0, XMM_MMWORD [ebx+eax*SIZEOF_JSAMPLE]\t; xmm0=(01234567)\n\tmovq\txmm1, XMM_MMWORD [edx+eax*SIZEOF_JSAMPLE]\t; xmm1=(89ABCDEF)\n\n\tmov\tebx, JSAMPROW [esi+2*SIZEOF_JSAMPROW]\t; (JSAMPLE *)\n\tmov\tedx, JSAMPROW [esi+3*SIZEOF_JSAMPROW]\t; (JSAMPLE *)\n\n\tmovq\txmm2, XMM_MMWORD [ebx+eax*SIZEOF_JSAMPLE]\t; xmm2=(GHIJKLMN)\n\tmovq\txmm3, XMM_MMWORD [edx+eax*SIZEOF_JSAMPLE]\t; xmm3=(OPQRSTUV)\n\n\tpunpcklbw xmm0,xmm6\t\t; xmm0=(01234567)\n\tpunpcklbw xmm1,xmm6\t\t; xmm1=(89ABCDEF)\n\tpaddw     xmm0,xmm7\n\tpaddw     xmm1,xmm7\n\tpunpcklbw xmm2,xmm6\t\t; xmm2=(GHIJKLMN)\n\tpunpcklbw xmm3,xmm6\t\t; xmm3=(OPQRSTUV)\n\tpaddw     xmm2,xmm7\n\tpaddw     xmm3,xmm7\n\n\tmovdqa\tXMMWORD [XMMBLOCK(0,0,edi,SIZEOF_DCTELEM)], xmm0\n\tmovdqa\tXMMWORD [XMMBLOCK(1,0,edi,SIZEOF_DCTELEM)], xmm1\n\tmovdqa\tXMMWORD [XMMBLOCK(2,0,edi,SIZEOF_DCTELEM)], xmm2\n\tmovdqa\tXMMWORD [XMMBLOCK(3,0,edi,SIZEOF_DCTELEM)], xmm3\n\n\tadd\tesi, byte 4*SIZEOF_JSAMPROW\n\tadd\tedi, byte 4*DCTSIZE*SIZEOF_DCTELEM\n\tdec\tecx\n\tjnz\tshort .convloop\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tpop\tebp\n\tret\n\n; --------------------------------------------------------------------------\n;\n; Quantize/descale the coefficients, and store into coef_block\n;\n; This implementation is based on an algorithm described in\n;   \"How to optimize for the Pentium family of microprocessors\"\n;   (http://www.agner.org/assem/).\n;\n; GLOBAL(void)\n; jsimd_quantize_sse2 (JCOEFPTR coef_block, DCTELEM * divisors,\n;                      DCTELEM * workspace);\n;\n\n%define RECIPROCAL(m,n,b) XMMBLOCK(DCTSIZE*0+(m),(n),(b),SIZEOF_DCTELEM)\n%define CORRECTION(m,n,b) XMMBLOCK(DCTSIZE*1+(m),(n),(b),SIZEOF_DCTELEM)\n%define SCALE(m,n,b)      XMMBLOCK(DCTSIZE*2+(m),(n),(b),SIZEOF_DCTELEM)\n\n%define coef_block\tebp+8\t\t; JCOEFPTR coef_block\n%define divisors\tebp+12\t\t; DCTELEM * divisors\n%define workspace\tebp+16\t\t; DCTELEM * workspace\n\n\talign\t16\n\tglobal\tEXTN(jsimd_quantize_sse2)\n\nEXTN(jsimd_quantize_sse2):\n\tpush\tebp\n\tmov\tebp,esp\n;\tpush\tebx\t\t; unused\n;\tpush\tecx\t\t; unused\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tmov\tesi, POINTER [workspace]\n\tmov\tedx, POINTER [divisors]\n\tmov\tedi, JCOEFPTR [coef_block]\n\tmov\teax, DCTSIZE2/32\n\talignx\t16,7\n.quantloop:\n\tmovdqa\txmm4, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_DCTELEM)]\n\tmovdqa\txmm5, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_DCTELEM)]\n\tmovdqa\txmm6, XMMWORD [XMMBLOCK(2,0,esi,SIZEOF_DCTELEM)]\n\tmovdqa\txmm7, XMMWORD [XMMBLOCK(3,0,esi,SIZEOF_DCTELEM)]\n\tmovdqa\txmm0,xmm4\n\tmovdqa\txmm1,xmm5\n\tmovdqa\txmm2,xmm6\n\tmovdqa\txmm3,xmm7\n\tpsraw\txmm4,(WORD_BIT-1)\n\tpsraw\txmm5,(WORD_BIT-1)\n\tpsraw\txmm6,(WORD_BIT-1)\n\tpsraw\txmm7,(WORD_BIT-1)\n\tpxor\txmm0,xmm4\n\tpxor\txmm1,xmm5\n\tpxor\txmm2,xmm6\n\tpxor\txmm3,xmm7\n\tpsubw\txmm0,xmm4\t\t; if (xmm0 < 0) xmm0 = -xmm0;\n\tpsubw\txmm1,xmm5\t\t; if (xmm1 < 0) xmm1 = -xmm1;\n\tpsubw\txmm2,xmm6\t\t; if (xmm2 < 0) xmm2 = -xmm2;\n\tpsubw\txmm3,xmm7\t\t; if (xmm3 < 0) xmm3 = -xmm3;\n\n\tpaddw\txmm0, XMMWORD [CORRECTION(0,0,edx)]  ; correction + roundfactor\n\tpaddw\txmm1, XMMWORD [CORRECTION(1,0,edx)]\n\tpaddw\txmm2, XMMWORD [CORRECTION(2,0,edx)]\n\tpaddw\txmm3, XMMWORD [CORRECTION(3,0,edx)]\n\tpmulhuw\txmm0, XMMWORD [RECIPROCAL(0,0,edx)]  ; reciprocal\n\tpmulhuw\txmm1, XMMWORD [RECIPROCAL(1,0,edx)]\n\tpmulhuw\txmm2, XMMWORD [RECIPROCAL(2,0,edx)]\n\tpmulhuw\txmm3, XMMWORD [RECIPROCAL(3,0,edx)]\n\tpmulhuw\txmm0, XMMWORD [SCALE(0,0,edx)]\t; scale\n\tpmulhuw\txmm1, XMMWORD [SCALE(1,0,edx)]\n\tpmulhuw\txmm2, XMMWORD [SCALE(2,0,edx)]\n\tpmulhuw\txmm3, XMMWORD [SCALE(3,0,edx)]\n\n\tpxor\txmm0,xmm4\n\tpxor\txmm1,xmm5\n\tpxor\txmm2,xmm6\n\tpxor\txmm3,xmm7\n\tpsubw\txmm0,xmm4\n\tpsubw\txmm1,xmm5\n\tpsubw\txmm2,xmm6\n\tpsubw\txmm3,xmm7\n\tmovdqa\tXMMWORD [XMMBLOCK(0,0,edi,SIZEOF_DCTELEM)], xmm0\n\tmovdqa\tXMMWORD [XMMBLOCK(1,0,edi,SIZEOF_DCTELEM)], xmm1\n\tmovdqa\tXMMWORD [XMMBLOCK(2,0,edi,SIZEOF_DCTELEM)], xmm2\n\tmovdqa\tXMMWORD [XMMBLOCK(3,0,edi,SIZEOF_DCTELEM)], xmm3\n\n\tadd\tesi, byte 32*SIZEOF_DCTELEM\n\tadd\tedx, byte 32*SIZEOF_DCTELEM\n\tadd\tedi, byte 32*SIZEOF_JCOEF\n\tdec\teax\n\tjnz\tnear .quantloop\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; unused\n;\tpop\tebx\t\t; unused\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jcqntsse.asm",
    "content": ";\n; jcqntsse.asm - sample data conversion and quantization (SSE & MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Load data into workspace, applying unsigned->signed conversion\n;\n; GLOBAL(void)\n; jsimd_convsamp_float_sse (JSAMPARRAY sample_data, JDIMENSION start_col,\n;                           FAST_FLOAT * workspace);\n;\n\n%define sample_data\tebp+8\t\t; JSAMPARRAY sample_data\n%define start_col\tebp+12\t\t; JDIMENSION start_col\n%define workspace\tebp+16\t\t; FAST_FLOAT * workspace\n\n\talign\t16\n\tglobal\tEXTN(jsimd_convsamp_float_sse)\n\nEXTN(jsimd_convsamp_float_sse):\n\tpush\tebp\n\tmov\tebp,esp\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tpcmpeqw  mm7,mm7\n\tpsllw    mm7,7\n\tpacksswb mm7,mm7\t\t; mm7 = PB_CENTERJSAMPLE (0x808080..)\n\n\tmov\tesi, JSAMPARRAY [sample_data]\t; (JSAMPROW *)\n\tmov\teax, JDIMENSION [start_col]\n\tmov\tedi, POINTER [workspace]\t; (DCTELEM *)\n\tmov\tecx, DCTSIZE/2\n\talignx\t16,7\n.convloop:\n\tmov\tebx, JSAMPROW [esi+0*SIZEOF_JSAMPROW]\t; (JSAMPLE *)\n\tmov\tedx, JSAMPROW [esi+1*SIZEOF_JSAMPROW]\t; (JSAMPLE *)\n\n\tmovq\tmm0, MMWORD [ebx+eax*SIZEOF_JSAMPLE]\n\tmovq\tmm1, MMWORD [edx+eax*SIZEOF_JSAMPLE]\n\n\tpsubb\tmm0,mm7\t\t\t\t; mm0=(01234567)\n\tpsubb\tmm1,mm7\t\t\t\t; mm1=(89ABCDEF)\n\n\tpunpcklbw mm2,mm0\t\t\t; mm2=(*0*1*2*3)\n\tpunpckhbw mm0,mm0\t\t\t; mm0=(*4*5*6*7)\n\tpunpcklbw mm3,mm1\t\t\t; mm3=(*8*9*A*B)\n\tpunpckhbw mm1,mm1\t\t\t; mm1=(*C*D*E*F)\n\n\tpunpcklwd mm4,mm2\t\t\t; mm4=(***0***1)\n\tpunpckhwd mm2,mm2\t\t\t; mm2=(***2***3)\n\tpunpcklwd mm5,mm0\t\t\t; mm5=(***4***5)\n\tpunpckhwd mm0,mm0\t\t\t; mm0=(***6***7)\n\n\tpsrad     mm4,(DWORD_BIT-BYTE_BIT)\t; mm4=(01)\n\tpsrad     mm2,(DWORD_BIT-BYTE_BIT)\t; mm2=(23)\n\tcvtpi2ps  xmm0,mm4\t\t\t; xmm0=(01**)\n\tcvtpi2ps  xmm1,mm2\t\t\t; xmm1=(23**)\n\tpsrad     mm5,(DWORD_BIT-BYTE_BIT)\t; mm5=(45)\n\tpsrad     mm0,(DWORD_BIT-BYTE_BIT)\t; mm0=(67)\n\tcvtpi2ps  xmm2,mm5\t\t\t; xmm2=(45**)\n\tcvtpi2ps  xmm3,mm0\t\t\t; xmm3=(67**)\n\n\tpunpcklwd mm6,mm3\t\t\t; mm6=(***8***9)\n\tpunpckhwd mm3,mm3\t\t\t; mm3=(***A***B)\n\tpunpcklwd mm4,mm1\t\t\t; mm4=(***C***D)\n\tpunpckhwd mm1,mm1\t\t\t; mm1=(***E***F)\n\n\tpsrad     mm6,(DWORD_BIT-BYTE_BIT)\t; mm6=(89)\n\tpsrad     mm3,(DWORD_BIT-BYTE_BIT)\t; mm3=(AB)\n\tcvtpi2ps  xmm4,mm6\t\t\t; xmm4=(89**)\n\tcvtpi2ps  xmm5,mm3\t\t\t; xmm5=(AB**)\n\tpsrad     mm4,(DWORD_BIT-BYTE_BIT)\t; mm4=(CD)\n\tpsrad     mm1,(DWORD_BIT-BYTE_BIT)\t; mm1=(EF)\n\tcvtpi2ps  xmm6,mm4\t\t\t; xmm6=(CD**)\n\tcvtpi2ps  xmm7,mm1\t\t\t; xmm7=(EF**)\n\n\tmovlhps   xmm0,xmm1\t\t\t; xmm0=(0123)\n\tmovlhps   xmm2,xmm3\t\t\t; xmm2=(4567)\n\tmovlhps   xmm4,xmm5\t\t\t; xmm4=(89AB)\n\tmovlhps   xmm6,xmm7\t\t\t; xmm6=(CDEF)\n\n\tmovaps\tXMMWORD [XMMBLOCK(0,0,edi,SIZEOF_FAST_FLOAT)], xmm0\n\tmovaps\tXMMWORD [XMMBLOCK(0,1,edi,SIZEOF_FAST_FLOAT)], xmm2\n\tmovaps\tXMMWORD [XMMBLOCK(1,0,edi,SIZEOF_FAST_FLOAT)], xmm4\n\tmovaps\tXMMWORD [XMMBLOCK(1,1,edi,SIZEOF_FAST_FLOAT)], xmm6\n\n\tadd\tesi, byte 2*SIZEOF_JSAMPROW\n\tadd\tedi, byte 2*DCTSIZE*SIZEOF_FAST_FLOAT\n\tdec\tecx\n\tjnz\tnear .convloop\n\n\temms\t\t; empty MMX state\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tpop\tebp\n\tret\n\n\n; --------------------------------------------------------------------------\n;\n; Quantize/descale the coefficients, and store into coef_block\n;\n; GLOBAL(void)\n; jsimd_quantize_float_sse (JCOEFPTR coef_block, FAST_FLOAT * divisors,\n;                           FAST_FLOAT * workspace);\n;\n\n%define coef_block\tebp+8\t\t; JCOEFPTR coef_block\n%define divisors\tebp+12\t\t; FAST_FLOAT * divisors\n%define workspace\tebp+16\t\t; FAST_FLOAT * workspace\n\n\talign\t16\n\tglobal\tEXTN(jsimd_quantize_float_sse)\n\nEXTN(jsimd_quantize_float_sse):\n\tpush\tebp\n\tmov\tebp,esp\n;\tpush\tebx\t\t; unused\n;\tpush\tecx\t\t; unused\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tmov\tesi, POINTER [workspace]\n\tmov\tedx, POINTER [divisors]\n\tmov\tedi, JCOEFPTR [coef_block]\n\tmov\teax, DCTSIZE2/16\n\talignx\t16,7\n.quantloop:\n\tmovaps\txmm0, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm1, XMMWORD [XMMBLOCK(0,1,esi,SIZEOF_FAST_FLOAT)]\n\tmulps\txmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_FAST_FLOAT)]\n\tmulps\txmm1, XMMWORD [XMMBLOCK(0,1,edx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm2, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm3, XMMWORD [XMMBLOCK(1,1,esi,SIZEOF_FAST_FLOAT)]\n\tmulps\txmm2, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_FAST_FLOAT)]\n\tmulps\txmm3, XMMWORD [XMMBLOCK(1,1,edx,SIZEOF_FAST_FLOAT)]\n\n\tmovhlps  xmm4,xmm0\n\tmovhlps  xmm5,xmm1\n\n\tcvtps2pi mm0,xmm0\n\tcvtps2pi mm1,xmm1\n\tcvtps2pi mm4,xmm4\n\tcvtps2pi mm5,xmm5\n\n\tmovhlps  xmm6,xmm2\n\tmovhlps  xmm7,xmm3\n\n\tcvtps2pi mm2,xmm2\n\tcvtps2pi mm3,xmm3\n\tcvtps2pi mm6,xmm6\n\tcvtps2pi mm7,xmm7\n\n\tpackssdw mm0,mm4\n\tpackssdw mm1,mm5\n\tpackssdw mm2,mm6\n\tpackssdw mm3,mm7\n\n\tmovq\tMMWORD [MMBLOCK(0,0,edi,SIZEOF_JCOEF)], mm0\n\tmovq\tMMWORD [MMBLOCK(0,1,edi,SIZEOF_JCOEF)], mm1\n\tmovq\tMMWORD [MMBLOCK(1,0,edi,SIZEOF_JCOEF)], mm2\n\tmovq\tMMWORD [MMBLOCK(1,1,edi,SIZEOF_JCOEF)], mm3\n\n\tadd\tesi, byte 16*SIZEOF_FAST_FLOAT\n\tadd\tedx, byte 16*SIZEOF_FAST_FLOAT\n\tadd\tedi, byte 16*SIZEOF_JCOEF\n\tdec\teax\n\tjnz\tshort .quantloop\n\n\temms\t\t; empty MMX state\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; unused\n;\tpop\tebx\t\t; unused\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jcsammmx.asm",
    "content": ";\n; jcsammmx.asm - downsampling (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Downsample pixel values of a single component.\n; This version handles the common case of 2:1 horizontal and 1:1 vertical,\n; without smoothing.\n;\n; GLOBAL(void)\n; jsimd_h2v1_downsample_mmx (JDIMENSION image_width, int max_v_samp_factor,\n;                            JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n;                            JSAMPARRAY input_data, JSAMPARRAY output_data);\n;\n\n%define img_width(b)\t(b)+8\t\t\t; JDIMENSION image_width\n%define max_v_samp(b)\t(b)+12\t\t; int max_v_samp_factor\n%define v_samp(b)\t\t\t(b)+16\t\t; JDIMENSION v_samp_factor\n%define width_blks(b)\t(b)+20\t\t; JDIMENSION width_blocks\n%define input_data(b)\t(b)+24\t\t; JSAMPARRAY input_data\n%define output_data(b)\t(b)+28\t; JSAMPARRAY output_data\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v1_downsample_mmx)\n\nEXTN(jsimd_h2v1_downsample_mmx):\n\tpush\tebp\n\tmov\tebp,esp\n;\tpush\tebx\t\t; unused\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tmov\tecx, JDIMENSION [width_blks(ebp)]\n\tshl\tecx,3\t\t\t; imul ecx,DCTSIZE (ecx = output_cols)\n\tjz\tnear .return\n\n\tmov\tedx, JDIMENSION [img_width(ebp)]\n\n\t; -- expand_right_edge\n\n\tpush\tecx\n\tshl\tecx,1\t\t\t\t; output_cols * 2\n\tsub\tecx,edx\n\tjle\tshort .expand_end\n\n\tmov\teax, INT [max_v_samp(ebp)]\n\ttest\teax,eax\n\tjle\tshort .expand_end\n\n\tcld\n\tmov\tesi, JSAMPARRAY [input_data(ebp)]\t; input_data\n\talignx\t16,7\n.expandloop:\n\tpush\teax\n\tpush\tecx\n\n\tmov\tedi, JSAMPROW [esi]\n\tadd\tedi,edx\n\tmov\tal, JSAMPLE [edi-1]\n\n\trep stosb\n\n\tpop\tecx\n\tpop\teax\n\n\tadd\tesi, byte SIZEOF_JSAMPROW\n\tdec\teax\n\tjg\tshort .expandloop\n\n.expand_end:\n\tpop\tecx\t\t\t\t; output_cols\n\n\t; -- h2v1_downsample\n\n\tmov\teax, JDIMENSION [v_samp(ebp)]\t; rowctr\n\ttest\teax,eax\n\tjle\tnear .return\n\n\tmov       edx, 0x00010000\t; bias pattern\n\tmovd      mm7,edx\n\tpcmpeqw   mm6,mm6\n\tpunpckldq mm7,mm7\t\t; mm7={0, 1, 0, 1}\n\tpsrlw     mm6,BYTE_BIT\t\t; mm6={0xFF 0x00 0xFF 0x00 ..}\n\n\tmov\tesi, JSAMPARRAY [input_data(ebp)]\t; input_data\n\tmov\tedi, JSAMPARRAY [output_data(ebp)]\t; output_data\n\talignx\t16,7\n.rowloop:\n\tpush\tecx\n\tpush\tedi\n\tpush\tesi\n\n\tmov\tesi, JSAMPROW [esi]\t\t; inptr\n\tmov\tedi, JSAMPROW [edi]\t\t; outptr\n\talignx\t16,7\n.columnloop:\n\n\tmovq\tmm0, MMWORD [esi+0*SIZEOF_MMWORD]\n\tmovq\tmm1, MMWORD [esi+1*SIZEOF_MMWORD]\n\tmovq\tmm2,mm0\n\tmovq\tmm3,mm1\n\n\tpand\tmm0,mm6\n\tpsrlw\tmm2,BYTE_BIT\n\tpand\tmm1,mm6\n\tpsrlw\tmm3,BYTE_BIT\n\n\tpaddw\tmm0,mm2\n\tpaddw\tmm1,mm3\n\tpaddw\tmm0,mm7\n\tpaddw\tmm1,mm7\n\tpsrlw\tmm0,1\n\tpsrlw\tmm1,1\n\n\tpackuswb mm0,mm1\n\n\tmovq\tMMWORD [edi+0*SIZEOF_MMWORD], mm0\n\n\tadd\tesi, byte 2*SIZEOF_MMWORD\t; inptr\n\tadd\tedi, byte 1*SIZEOF_MMWORD\t; outptr\n\tsub\tecx, byte SIZEOF_MMWORD\t\t; outcol\n\tjnz\tshort .columnloop\n\n\tpop\tesi\n\tpop\tedi\n\tpop\tecx\n\n\tadd\tesi, byte SIZEOF_JSAMPROW\t; input_data\n\tadd\tedi, byte SIZEOF_JSAMPROW\t; output_data\n\tdec\teax\t\t\t\t; rowctr\n\tjg\tshort .rowloop\n\n\temms\t\t; empty MMX state\n\n.return:\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n;\tpop\tebx\t\t; unused\n\tpop\tebp\n\tret\n\n; --------------------------------------------------------------------------\n;\n; Downsample pixel values of a single component.\n; This version handles the standard case of 2:1 horizontal and 2:1 vertical,\n; without smoothing.\n;\n; GLOBAL(void)\n; jsimd_h2v2_downsample_mmx (JDIMENSION image_width, int max_v_samp_factor,\n;                            JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n;                            JSAMPARRAY input_data, JSAMPARRAY output_data);\n;\n\n%define img_width(b)\t(b)+8\t\t\t; JDIMENSION image_width\n%define max_v_samp(b)\t(b)+12\t\t; int max_v_samp_factor\n%define v_samp(b)\t\t\t(b)+16\t\t; JDIMENSION v_samp_factor\n%define width_blks(b)\t(b)+20\t\t; JDIMENSION width_blocks\n%define input_data(b)\t(b)+24\t\t; JSAMPARRAY input_data\n%define output_data(b)\t(b)+28\t; JSAMPARRAY output_data\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v2_downsample_mmx)\n\nEXTN(jsimd_h2v2_downsample_mmx):\n\tpush\tebp\n\tmov\tebp,esp\n;\tpush\tebx\t\t; unused\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tmov\tecx, JDIMENSION [width_blks(ebp)]\n\tshl\tecx,3\t\t\t; imul ecx,DCTSIZE (ecx = output_cols)\n\tjz\tnear .return\n\n\tmov\tedx, JDIMENSION [img_width(ebp)]\n\n\t; -- expand_right_edge\n\n\tpush\tecx\n\tshl\tecx,1\t\t\t\t; output_cols * 2\n\tsub\tecx,edx\n\tjle\tshort .expand_end\n\n\tmov\teax, INT [max_v_samp(ebp)]\n\ttest\teax,eax\n\tjle\tshort .expand_end\n\n\tcld\n\tmov\tesi, JSAMPARRAY [input_data(ebp)]\t; input_data\n\talignx\t16,7\n.expandloop:\n\tpush\teax\n\tpush\tecx\n\n\tmov\tedi, JSAMPROW [esi]\n\tadd\tedi,edx\n\tmov\tal, JSAMPLE [edi-1]\n\n\trep stosb\n\n\tpop\tecx\n\tpop\teax\n\n\tadd\tesi, byte SIZEOF_JSAMPROW\n\tdec\teax\n\tjg\tshort .expandloop\n\n.expand_end:\n\tpop\tecx\t\t\t\t; output_cols\n\n\t; -- h2v2_downsample\n\n\tmov\teax, JDIMENSION [v_samp(ebp)]\t; rowctr\n\ttest\teax,eax\n\tjle\tnear .return\n\n\tmov       edx, 0x00020001\t; bias pattern\n\tmovd      mm7,edx\n\tpcmpeqw   mm6,mm6\n\tpunpckldq mm7,mm7\t\t; mm7={1, 2, 1, 2}\n\tpsrlw     mm6,BYTE_BIT\t\t; mm6={0xFF 0x00 0xFF 0x00 ..}\n\n\tmov\tesi, JSAMPARRAY [input_data(ebp)]\t; input_data\n\tmov\tedi, JSAMPARRAY [output_data(ebp)]\t; output_data\n\talignx\t16,7\n.rowloop:\n\tpush\tecx\n\tpush\tedi\n\tpush\tesi\n\n\tmov\tedx, JSAMPROW [esi+0*SIZEOF_JSAMPROW]\t; inptr0\n\tmov\tesi, JSAMPROW [esi+1*SIZEOF_JSAMPROW]\t; inptr1\n\tmov\tedi, JSAMPROW [edi]\t\t\t; outptr\n\talignx\t16,7\n.columnloop:\n\n\tmovq\tmm0, MMWORD [edx+0*SIZEOF_MMWORD]\n\tmovq\tmm1, MMWORD [esi+0*SIZEOF_MMWORD]\n\tmovq\tmm2, MMWORD [edx+1*SIZEOF_MMWORD]\n\tmovq\tmm3, MMWORD [esi+1*SIZEOF_MMWORD]\n\n\tmovq\tmm4,mm0\n\tmovq\tmm5,mm1\n\tpand\tmm0,mm6\n\tpsrlw\tmm4,BYTE_BIT\n\tpand\tmm1,mm6\n\tpsrlw\tmm5,BYTE_BIT\n\tpaddw\tmm0,mm4\n\tpaddw\tmm1,mm5\n\n\tmovq\tmm4,mm2\n\tmovq\tmm5,mm3\n\tpand\tmm2,mm6\n\tpsrlw\tmm4,BYTE_BIT\n\tpand\tmm3,mm6\n\tpsrlw\tmm5,BYTE_BIT\n\tpaddw\tmm2,mm4\n\tpaddw\tmm3,mm5\n\n\tpaddw\tmm0,mm1\n\tpaddw\tmm2,mm3\n\tpaddw\tmm0,mm7\n\tpaddw\tmm2,mm7\n\tpsrlw\tmm0,2\n\tpsrlw\tmm2,2\n\n\tpackuswb mm0,mm2\n\n\tmovq\tMMWORD [edi+0*SIZEOF_MMWORD], mm0\n\n\tadd\tedx, byte 2*SIZEOF_MMWORD\t; inptr0\n\tadd\tesi, byte 2*SIZEOF_MMWORD\t; inptr1\n\tadd\tedi, byte 1*SIZEOF_MMWORD\t; outptr\n\tsub\tecx, byte SIZEOF_MMWORD\t\t; outcol\n\tjnz\tnear .columnloop\n\n\tpop\tesi\n\tpop\tedi\n\tpop\tecx\n\n\tadd\tesi, byte 2*SIZEOF_JSAMPROW\t; input_data\n\tadd\tedi, byte 1*SIZEOF_JSAMPROW\t; output_data\n\tdec\teax\t\t\t\t; rowctr\n\tjg\tnear .rowloop\n\n\temms\t\t; empty MMX state\n\n.return:\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n;\tpop\tebx\t\t; unused\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jcsamss2-64.asm",
    "content": ";\n; jcsamss2-64.asm - downsampling (64-bit SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2009 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t64\n;\n; Downsample pixel values of a single component.\n; This version handles the common case of 2:1 horizontal and 1:1 vertical,\n; without smoothing.\n;\n; GLOBAL(void)\n; jsimd_h2v1_downsample_sse2 (JDIMENSION image_width, int max_v_samp_factor,\n;                             JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n;                             JSAMPARRAY input_data, JSAMPARRAY output_data);\n;\n\n; r10 = JDIMENSION image_width\n; r11 = int max_v_samp_factor\n; r12 = JDIMENSION v_samp_factor\n; r13 = JDIMENSION width_blocks\n; r14 = JSAMPARRAY input_data\n; r15 = JSAMPARRAY output_data\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v1_downsample_sse2)\n\nEXTN(jsimd_h2v1_downsample_sse2):\n\tpush\trbp\n\tmov\trax,rsp\n\tmov\trbp,rsp\n\tcollect_args\n\n\tmov rcx, r13\n\tshl\trcx,3\t\t\t; imul rcx,DCTSIZE (rcx = output_cols)\n\tjz\tnear .return\n\n\tmov rdx, r10\n\n\t; -- expand_right_edge\n\n\tpush\trcx\n\tshl\trcx,1\t\t\t\t; output_cols * 2\n\tsub\trcx,rdx\n\tjle\tshort .expand_end\n\n\tmov\trax, r11\n\ttest\trax,rax\n\tjle\tshort .expand_end\n\n\tcld\n\tmov\trsi, r14\t; input_data\n.expandloop:\n\tpush\trax\n\tpush\trcx\n\n\tmov\trdi, JSAMPROW [rsi]\n\tadd\trdi,rdx\n\tmov\tal, JSAMPLE [rdi-1]\n\n\trep stosb\n\n\tpop\trcx\n\tpop\trax\n\n\tadd\trsi, byte SIZEOF_JSAMPROW\n\tdec\trax\n\tjg\tshort .expandloop\n\n.expand_end:\n\tpop\trcx\t\t\t\t; output_cols\n\n\t; -- h2v1_downsample\n\n\tmov\trax, r12\t; rowctr\n\ttest\teax,eax\n\tjle\tnear .return\n\n\tmov\trdx, 0x00010000\t\t; bias pattern\n\tmovd\txmm7,edx\n\tpcmpeqw\txmm6,xmm6\n\tpshufd\txmm7,xmm7,0x00\t\t; xmm7={0, 1, 0, 1, 0, 1, 0, 1}\n\tpsrlw\txmm6,BYTE_BIT\t\t; xmm6={0xFF 0x00 0xFF 0x00 ..}\n\n\tmov\trsi, r14\t; input_data\n\tmov\trdi, r15\t; output_data\n.rowloop:\n\tpush\trcx\n\tpush\trdi\n\tpush\trsi\n\n\tmov\trsi, JSAMPROW [rsi]\t\t; inptr\n\tmov rdi, JSAMPROW [rdi]\t\t; outptr\n\n\tcmp\trcx, byte SIZEOF_XMMWORD\n\tjae\tshort .columnloop\n\n.columnloop_r8:\n\tmovdqa\txmm0, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n\tpxor\txmm1,xmm1\n\tmov\trcx, SIZEOF_XMMWORD\n\tjmp\tshort .downsample\n\n.columnloop:\n\tmovdqa\txmm0, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n\tmovdqa\txmm1, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n\n.downsample:\n\tmovdqa\txmm2,xmm0\n\tmovdqa\txmm3,xmm1\n\n\tpand\txmm0,xmm6\n\tpsrlw\txmm2,BYTE_BIT\n\tpand\txmm1,xmm6\n\tpsrlw\txmm3,BYTE_BIT\n\n\tpaddw\txmm0,xmm2\n\tpaddw\txmm1,xmm3\n\tpaddw\txmm0,xmm7\n\tpaddw\txmm1,xmm7\n\tpsrlw\txmm0,1\n\tpsrlw\txmm1,1\n\n\tpackuswb xmm0,xmm1\n\n\tmovdqa\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmm0\n\n\tsub\trcx, byte SIZEOF_XMMWORD\t; outcol\n\tadd\trsi, byte 2*SIZEOF_XMMWORD\t; inptr\n\tadd\trdi, byte 1*SIZEOF_XMMWORD\t; outptr\n\tcmp\trcx, byte SIZEOF_XMMWORD\n\tjae\tshort .columnloop\n\ttest\trcx,rcx\n\tjnz\tshort .columnloop_r8\n\n\tpop\trsi\n\tpop\trdi\n\tpop\trcx\n\n\tadd\trsi, byte SIZEOF_JSAMPROW\t; input_data\n\tadd\trdi, byte SIZEOF_JSAMPROW\t; output_data\n\tdec\trax\t\t\t\t; rowctr\n\tjg\tnear .rowloop\n\n.return:\n\tuncollect_args\n\tpop\trbp\n\tret\n\n; --------------------------------------------------------------------------\n;\n; Downsample pixel values of a single component.\n; This version handles the standard case of 2:1 horizontal and 2:1 vertical,\n; without smoothing.\n;\n; GLOBAL(void)\n; jsimd_h2v2_downsample_sse2 (JDIMENSION image_width, int max_v_samp_factor,\n;                             JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n;                             JSAMPARRAY input_data, JSAMPARRAY output_data);\n;\n\n; r10 = JDIMENSION image_width\n; r11 = int max_v_samp_factor\n; r12 = JDIMENSION v_samp_factor\n; r13 = JDIMENSION width_blocks\n; r14 = JSAMPARRAY input_data\n; r15 = JSAMPARRAY output_data\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v2_downsample_sse2)\n\nEXTN(jsimd_h2v2_downsample_sse2):\n\tpush\trbp\n\tmov\trax,rsp\n\tmov\trbp,rsp\n\tcollect_args\n\n\tmov\trcx, r13\n\tshl\trcx,3\t\t\t; imul rcx,DCTSIZE (rcx = output_cols)\n\tjz\tnear .return\n\n\tmov\trdx, r10\n\n\t; -- expand_right_edge\n\n\tpush\trcx\n\tshl\trcx,1\t\t\t\t; output_cols * 2\n\tsub\trcx,rdx\n\tjle\tshort .expand_end\n\n\tmov\trax, r11\n\ttest\trax,rax\n\tjle\tshort .expand_end\n\n\tcld\n\tmov\trsi, r14\t; input_data\n.expandloop:\n\tpush\trax\n\tpush\trcx\n\n\tmov\trdi, JSAMPROW [rsi]\n\tadd\trdi,rdx\n\tmov\tal, JSAMPLE [rdi-1]\n\n\trep stosb\n\n\tpop\trcx\n\tpop\trax\n\n\tadd\trsi, byte SIZEOF_JSAMPROW\n\tdec\trax\n\tjg\tshort .expandloop\n\n.expand_end:\n\tpop\trcx\t\t\t\t; output_cols\n\n\t; -- h2v2_downsample\n\n\tmov\trax, r12\t; rowctr\n\ttest\trax,rax\n\tjle\tnear .return\n\n\tmov\trdx, 0x00020001\t\t; bias pattern\n\tmovd\txmm7,edx\n\tpcmpeqw\txmm6,xmm6\n\tpshufd\txmm7,xmm7,0x00\t\t; xmm7={1, 2, 1, 2, 1, 2, 1, 2}\n\tpsrlw\txmm6,BYTE_BIT\t\t; xmm6={0xFF 0x00 0xFF 0x00 ..}\n\n\tmov\trsi, r14\t; input_data\n\tmov\trdi, r15\t; output_data\n.rowloop:\n\tpush\trcx\n\tpush\trdi\n\tpush\trsi\n\n\tmov\trdx, JSAMPROW [rsi+0*SIZEOF_JSAMPROW]\t; inptr0\n\tmov\trsi, JSAMPROW [rsi+1*SIZEOF_JSAMPROW]\t; inptr1\n\tmov\trdi, JSAMPROW [rdi]\t\t\t; outptr\n\n\tcmp\trcx, byte SIZEOF_XMMWORD\n\tjae\tshort .columnloop\n\n.columnloop_r8:\n\tmovdqa\txmm0, XMMWORD [rdx+0*SIZEOF_XMMWORD]\n\tmovdqa\txmm1, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n\tpxor\txmm2,xmm2\n\tpxor\txmm3,xmm3\n\tmov\trcx, SIZEOF_XMMWORD\n\tjmp\tshort .downsample\n\n.columnloop:\n\tmovdqa\txmm0, XMMWORD [rdx+0*SIZEOF_XMMWORD]\n\tmovdqa\txmm1, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n\tmovdqa\txmm2, XMMWORD [rdx+1*SIZEOF_XMMWORD]\n\tmovdqa\txmm3, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n\n.downsample:\n\tmovdqa\txmm4,xmm0\n\tmovdqa\txmm5,xmm1\n\tpand\txmm0,xmm6\n\tpsrlw\txmm4,BYTE_BIT\n\tpand\txmm1,xmm6\n\tpsrlw\txmm5,BYTE_BIT\n\tpaddw\txmm0,xmm4\n\tpaddw\txmm1,xmm5\n\n\tmovdqa\txmm4,xmm2\n\tmovdqa\txmm5,xmm3\n\tpand\txmm2,xmm6\n\tpsrlw\txmm4,BYTE_BIT\n\tpand\txmm3,xmm6\n\tpsrlw\txmm5,BYTE_BIT\n\tpaddw\txmm2,xmm4\n\tpaddw\txmm3,xmm5\n\n\tpaddw\txmm0,xmm1\n\tpaddw\txmm2,xmm3\n\tpaddw\txmm0,xmm7\n\tpaddw\txmm2,xmm7\n\tpsrlw\txmm0,2\n\tpsrlw\txmm2,2\n\n\tpackuswb xmm0,xmm2\n\n\tmovdqa\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmm0\n\n\tsub\trcx, byte SIZEOF_XMMWORD\t; outcol\n\tadd\trdx, byte 2*SIZEOF_XMMWORD\t; inptr0\n\tadd\trsi, byte 2*SIZEOF_XMMWORD\t; inptr1\n\tadd\trdi, byte 1*SIZEOF_XMMWORD\t; outptr\n\tcmp\trcx, byte SIZEOF_XMMWORD\n\tjae\tnear .columnloop\n\ttest\trcx,rcx\n\tjnz\tnear .columnloop_r8\n\n\tpop\trsi\n\tpop\trdi\n\tpop\trcx\n\n\tadd\trsi, byte 2*SIZEOF_JSAMPROW\t; input_data\n\tadd\trdi, byte 1*SIZEOF_JSAMPROW\t; output_data\n\tdec\trax\t\t\t\t; rowctr\n\tjg\tnear .rowloop\n\n.return:\n\tuncollect_args\n\tpop\trbp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jcsamss2.asm",
    "content": ";\n; jcsamss2.asm - downsampling (SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Downsample pixel values of a single component.\n; This version handles the common case of 2:1 horizontal and 1:1 vertical,\n; without smoothing.\n;\n; GLOBAL(void)\n; jsimd_h2v1_downsample_sse2 (JDIMENSION image_width, int max_v_samp_factor,\n;                             JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n;                             JSAMPARRAY input_data, JSAMPARRAY output_data);\n;\n\n%define img_width(b)\t(b)+8\t\t\t; JDIMENSION image_width\n%define max_v_samp(b)\t(b)+12\t\t; int max_v_samp_factor\n%define v_samp(b)\t\t\t(b)+16\t\t; JDIMENSION v_samp_factor\n%define width_blks(b)\t(b)+20\t\t; JDIMENSION width_blocks\n%define input_data(b)\t(b)+24\t\t; JSAMPARRAY input_data\n%define output_data(b)\t(b)+28\t\t; JSAMPARRAY output_data\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v1_downsample_sse2)\n\nEXTN(jsimd_h2v1_downsample_sse2):\n\tpush\tebp\n\tmov\tebp,esp\n;\tpush\tebx\t\t; unused\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tmov\tecx, JDIMENSION [width_blks(ebp)]\n\tshl\tecx,3\t\t\t; imul ecx,DCTSIZE (ecx = output_cols)\n\tjz\tnear .return\n\n\tmov\tedx, JDIMENSION [img_width(ebp)]\n\n\t; -- expand_right_edge\n\n\tpush\tecx\n\tshl\tecx,1\t\t\t\t; output_cols * 2\n\tsub\tecx,edx\n\tjle\tshort .expand_end\n\n\tmov\teax, INT [max_v_samp(ebp)]\n\ttest\teax,eax\n\tjle\tshort .expand_end\n\n\tcld\n\tmov\tesi, JSAMPARRAY [input_data(ebp)]\t; input_data\n\talignx\t16,7\n.expandloop:\n\tpush\teax\n\tpush\tecx\n\n\tmov\tedi, JSAMPROW [esi]\n\tadd\tedi,edx\n\tmov\tal, JSAMPLE [edi-1]\n\n\trep stosb\n\n\tpop\tecx\n\tpop\teax\n\n\tadd\tesi, byte SIZEOF_JSAMPROW\n\tdec\teax\n\tjg\tshort .expandloop\n\n.expand_end:\n\tpop\tecx\t\t\t\t; output_cols\n\n\t; -- h2v1_downsample\n\n\tmov\teax, JDIMENSION [v_samp(ebp)]\t; rowctr\n\ttest\teax,eax\n\tjle\tnear .return\n\n\tmov\tedx, 0x00010000\t\t; bias pattern\n\tmovd\txmm7,edx\n\tpcmpeqw\txmm6,xmm6\n\tpshufd\txmm7,xmm7,0x00\t\t; xmm7={0, 1, 0, 1, 0, 1, 0, 1}\n\tpsrlw\txmm6,BYTE_BIT\t\t; xmm6={0xFF 0x00 0xFF 0x00 ..}\n\n\tmov\tesi, JSAMPARRAY [input_data(ebp)]\t; input_data\n\tmov\tedi, JSAMPARRAY [output_data(ebp)]\t; output_data\n\talignx\t16,7\n.rowloop:\n\tpush\tecx\n\tpush\tedi\n\tpush\tesi\n\n\tmov\tesi, JSAMPROW [esi]\t\t; inptr\n\tmov\tedi, JSAMPROW [edi]\t\t; outptr\n\n\tcmp\tecx, byte SIZEOF_XMMWORD\n\tjae\tshort .columnloop\n\talignx\t16,7\n\n.columnloop_r8:\n\tmovdqa\txmm0, XMMWORD [esi+0*SIZEOF_XMMWORD]\n\tpxor\txmm1,xmm1\n\tmov\tecx, SIZEOF_XMMWORD\n\tjmp\tshort .downsample\n\talignx\t16,7\n\n.columnloop:\n\tmovdqa\txmm0, XMMWORD [esi+0*SIZEOF_XMMWORD]\n\tmovdqa\txmm1, XMMWORD [esi+1*SIZEOF_XMMWORD]\n\n.downsample:\n\tmovdqa\txmm2,xmm0\n\tmovdqa\txmm3,xmm1\n\n\tpand\txmm0,xmm6\n\tpsrlw\txmm2,BYTE_BIT\n\tpand\txmm1,xmm6\n\tpsrlw\txmm3,BYTE_BIT\n\n\tpaddw\txmm0,xmm2\n\tpaddw\txmm1,xmm3\n\tpaddw\txmm0,xmm7\n\tpaddw\txmm1,xmm7\n\tpsrlw\txmm0,1\n\tpsrlw\txmm1,1\n\n\tpackuswb xmm0,xmm1\n\n\tmovdqa\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmm0\n\n\tsub\tecx, byte SIZEOF_XMMWORD\t; outcol\n\tadd\tesi, byte 2*SIZEOF_XMMWORD\t; inptr\n\tadd\tedi, byte 1*SIZEOF_XMMWORD\t; outptr\n\tcmp\tecx, byte SIZEOF_XMMWORD\n\tjae\tshort .columnloop\n\ttest\tecx,ecx\n\tjnz\tshort .columnloop_r8\n\n\tpop\tesi\n\tpop\tedi\n\tpop\tecx\n\n\tadd\tesi, byte SIZEOF_JSAMPROW\t; input_data\n\tadd\tedi, byte SIZEOF_JSAMPROW\t; output_data\n\tdec\teax\t\t\t\t; rowctr\n\tjg\tnear .rowloop\n\n.return:\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n;\tpop\tebx\t\t; unused\n\tpop\tebp\n\tret\n\n; --------------------------------------------------------------------------\n;\n; Downsample pixel values of a single component.\n; This version handles the standard case of 2:1 horizontal and 2:1 vertical,\n; without smoothing.\n;\n; GLOBAL(void)\n; jsimd_h2v2_downsample_sse2 (JDIMENSION image_width, int max_v_samp_factor,\n;                             JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n;                             JSAMPARRAY input_data, JSAMPARRAY output_data);\n;\n\n%define img_width(b)\t(b)+8\t\t\t; JDIMENSION image_width\n%define max_v_samp(b)\t(b)+12\t\t; int max_v_samp_factor\n%define v_samp(b)\t\t\t(b)+16\t\t; JDIMENSION v_samp_factor\n%define width_blks(b)\t(b)+20\t\t; JDIMENSION width_blocks\n%define input_data(b)\t(b)+24\t\t; JSAMPARRAY input_data\n%define output_data(b)\t(b)+28\t; JSAMPARRAY output_data\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v2_downsample_sse2)\n\nEXTN(jsimd_h2v2_downsample_sse2):\n\tpush\tebp\n\tmov\tebp,esp\n;\tpush\tebx\t\t; unused\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tmov\tecx, JDIMENSION [width_blks(ebp)]\n\tshl\tecx,3\t\t\t; imul ecx,DCTSIZE (ecx = output_cols)\n\tjz\tnear .return\n\n\tmov\tedx, JDIMENSION [img_width(ebp)]\n\n\t; -- expand_right_edge\n\n\tpush\tecx\n\tshl\tecx,1\t\t\t\t; output_cols * 2\n\tsub\tecx,edx\n\tjle\tshort .expand_end\n\n\tmov\teax, INT [max_v_samp(ebp)]\n\ttest\teax,eax\n\tjle\tshort .expand_end\n\n\tcld\n\tmov\tesi, JSAMPARRAY [input_data(ebp)]\t; input_data\n\talignx\t16,7\n.expandloop:\n\tpush\teax\n\tpush\tecx\n\n\tmov\tedi, JSAMPROW [esi]\n\tadd\tedi,edx\n\tmov\tal, JSAMPLE [edi-1]\n\n\trep stosb\n\n\tpop\tecx\n\tpop\teax\n\n\tadd\tesi, byte SIZEOF_JSAMPROW\n\tdec\teax\n\tjg\tshort .expandloop\n\n.expand_end:\n\tpop\tecx\t\t\t\t; output_cols\n\n\t; -- h2v2_downsample\n\n\tmov\teax, JDIMENSION [v_samp(ebp)]\t; rowctr\n\ttest\teax,eax\n\tjle\tnear .return\n\n\tmov\tedx, 0x00020001\t\t; bias pattern\n\tmovd\txmm7,edx\n\tpcmpeqw\txmm6,xmm6\n\tpshufd\txmm7,xmm7,0x00\t\t; xmm7={1, 2, 1, 2, 1, 2, 1, 2}\n\tpsrlw\txmm6,BYTE_BIT\t\t; xmm6={0xFF 0x00 0xFF 0x00 ..}\n\n\tmov\tesi, JSAMPARRAY [input_data(ebp)]\t; input_data\n\tmov\tedi, JSAMPARRAY [output_data(ebp)]\t; output_data\n\talignx\t16,7\n.rowloop:\n\tpush\tecx\n\tpush\tedi\n\tpush\tesi\n\n\tmov\tedx, JSAMPROW [esi+0*SIZEOF_JSAMPROW]\t; inptr0\n\tmov\tesi, JSAMPROW [esi+1*SIZEOF_JSAMPROW]\t; inptr1\n\tmov\tedi, JSAMPROW [edi]\t\t\t; outptr\n\n\tcmp\tecx, byte SIZEOF_XMMWORD\n\tjae\tshort .columnloop\n\talignx\t16,7\n\n.columnloop_r8:\n\tmovdqa\txmm0, XMMWORD [edx+0*SIZEOF_XMMWORD]\n\tmovdqa\txmm1, XMMWORD [esi+0*SIZEOF_XMMWORD]\n\tpxor\txmm2,xmm2\n\tpxor\txmm3,xmm3\n\tmov\tecx, SIZEOF_XMMWORD\n\tjmp\tshort .downsample\n\talignx\t16,7\n\n.columnloop:\n\tmovdqa\txmm0, XMMWORD [edx+0*SIZEOF_XMMWORD]\n\tmovdqa\txmm1, XMMWORD [esi+0*SIZEOF_XMMWORD]\n\tmovdqa\txmm2, XMMWORD [edx+1*SIZEOF_XMMWORD]\n\tmovdqa\txmm3, XMMWORD [esi+1*SIZEOF_XMMWORD]\n\n.downsample:\n\tmovdqa\txmm4,xmm0\n\tmovdqa\txmm5,xmm1\n\tpand\txmm0,xmm6\n\tpsrlw\txmm4,BYTE_BIT\n\tpand\txmm1,xmm6\n\tpsrlw\txmm5,BYTE_BIT\n\tpaddw\txmm0,xmm4\n\tpaddw\txmm1,xmm5\n\n\tmovdqa\txmm4,xmm2\n\tmovdqa\txmm5,xmm3\n\tpand\txmm2,xmm6\n\tpsrlw\txmm4,BYTE_BIT\n\tpand\txmm3,xmm6\n\tpsrlw\txmm5,BYTE_BIT\n\tpaddw\txmm2,xmm4\n\tpaddw\txmm3,xmm5\n\n\tpaddw\txmm0,xmm1\n\tpaddw\txmm2,xmm3\n\tpaddw\txmm0,xmm7\n\tpaddw\txmm2,xmm7\n\tpsrlw\txmm0,2\n\tpsrlw\txmm2,2\n\n\tpackuswb xmm0,xmm2\n\n\tmovdqa\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmm0\n\n\tsub\tecx, byte SIZEOF_XMMWORD\t; outcol\n\tadd\tedx, byte 2*SIZEOF_XMMWORD\t; inptr0\n\tadd\tesi, byte 2*SIZEOF_XMMWORD\t; inptr1\n\tadd\tedi, byte 1*SIZEOF_XMMWORD\t; outptr\n\tcmp\tecx, byte SIZEOF_XMMWORD\n\tjae\tnear .columnloop\n\ttest\tecx,ecx\n\tjnz\tnear .columnloop_r8\n\n\tpop\tesi\n\tpop\tedi\n\tpop\tecx\n\n\tadd\tesi, byte 2*SIZEOF_JSAMPROW\t; input_data\n\tadd\tedi, byte 1*SIZEOF_JSAMPROW\t; output_data\n\tdec\teax\t\t\t\t; rowctr\n\tjg\tnear .rowloop\n\n.return:\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n;\tpop\tebx\t\t; unused\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jdclrmmx.asm",
    "content": ";\n; jdclrmmx.asm - colorspace conversion (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\n; --------------------------------------------------------------------------\n;\n; Convert some rows of samples to the output colorspace.\n;\n; GLOBAL(void)\n; jsimd_ycc_rgb_convert_mmx (JDIMENSION out_width,\n;                            JSAMPIMAGE input_buf, JDIMENSION input_row,\n;                            JSAMPARRAY output_buf, int num_rows)\n;\n\n%define out_width(b)\t(b)+8\t\t\t; JDIMENSION out_width\n%define input_buf(b)\t(b)+12\t\t; JSAMPIMAGE input_buf\n%define input_row(b)\t(b)+16\t\t; JDIMENSION input_row\n%define output_buf(b)\t(b)+20\t\t; JSAMPARRAY output_buf\n%define num_rows(b)\t(b)+24\t\t; int num_rows\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_MMWORD\t; mmword wk[WK_NUM]\n%define WK_NUM\t\t2\n%define gotptr\t\twk(0)-SIZEOF_POINTER\t; void * gotptr\n\n\talign\t16\n\tglobal\tEXTN(jsimd_ycc_rgb_convert_mmx)\n\nEXTN(jsimd_ycc_rgb_convert_mmx):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_MMWORD)\t; align to 64 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [wk(0)]\n\tpushpic\teax\t\t; make a room for GOT address\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t\t; get GOT address\n\tmovpic\tPOINTER [gotptr], ebx\t; save GOT address\n\n\tmov\tecx, JDIMENSION [out_width(eax)]\t; num_cols\n\ttest\tecx,ecx\n\tjz\tnear .return\n\n\tpush\tecx\n\n\tmov\tedi, JSAMPIMAGE [input_buf(eax)]\n\tmov\tecx, JDIMENSION [input_row(eax)]\n\tmov\tesi, JSAMPARRAY [edi+0*SIZEOF_JSAMPARRAY]\n\tmov\tebx, JSAMPARRAY [edi+1*SIZEOF_JSAMPARRAY]\n\tmov\tedx, JSAMPARRAY [edi+2*SIZEOF_JSAMPARRAY]\n\tlea\tesi, [esi+ecx*SIZEOF_JSAMPROW]\n\tlea\tebx, [ebx+ecx*SIZEOF_JSAMPROW]\n\tlea\tedx, [edx+ecx*SIZEOF_JSAMPROW]\n\n\tpop\tecx\n\n\tmov\tedi, JSAMPARRAY [output_buf(eax)]\n\tmov\teax, INT [num_rows(eax)]\n\ttest\teax,eax\n\tjle\tnear .return\n\talignx\t16,7\n.rowloop:\n\tpush\teax\n\tpush\tedi\n\tpush\tedx\n\tpush\tebx\n\tpush\tesi\n\tpush\tecx\t\t\t; col\n\n\tmov\tesi, JSAMPROW [esi]\t; inptr0\n\tmov\tebx, JSAMPROW [ebx]\t; inptr1\n\tmov\tedx, JSAMPROW [edx]\t; inptr2\n\tmov\tedi, JSAMPROW [edi]\t; outptr\n\tmovpic\teax, POINTER [gotptr]\t; load GOT address (eax)\n\talignx\t16,7\n.columnloop:\n\n\tmovq\tmm5, MMWORD [ebx]\t; mm5=Cb(01234567)\n\tmovq\tmm1, MMWORD [edx]\t; mm1=Cr(01234567)\n\n\tpcmpeqw\tmm4,mm4\n\tpcmpeqw\tmm7,mm7\n\tpsrlw\tmm4,BYTE_BIT\n\tpsllw\tmm7,7\t\t\t; mm7={0xFF80 0xFF80 0xFF80 0xFF80}\n\tmovq\tmm0,mm4\t\t\t; mm0=mm4={0xFF 0x00 0xFF 0x00 ..}\n\n\tpand\tmm4,mm5\t\t\t; mm4=Cb(0246)=CbE\n\tpsrlw\tmm5,BYTE_BIT\t\t; mm5=Cb(1357)=CbO\n\tpand\tmm0,mm1\t\t\t; mm0=Cr(0246)=CrE\n\tpsrlw\tmm1,BYTE_BIT\t\t; mm1=Cr(1357)=CrO\n\n\tpaddw\tmm4,mm7\n\tpaddw\tmm5,mm7\n\tpaddw\tmm0,mm7\n\tpaddw\tmm1,mm7\n\n\t; (Original)\n\t; R = Y                + 1.40200 * Cr\n\t; G = Y - 0.34414 * Cb - 0.71414 * Cr\n\t; B = Y + 1.77200 * Cb\n\t;\n\t; (This implementation)\n\t; R = Y                + 0.40200 * Cr + Cr\n\t; G = Y - 0.34414 * Cb + 0.28586 * Cr - Cr\n\t; B = Y - 0.22800 * Cb + Cb + Cb\n\n\tmovq\tmm2,mm4\t\t\t; mm2=CbE\n\tmovq\tmm3,mm5\t\t\t; mm3=CbO\n\tpaddw\tmm4,mm4\t\t\t; mm4=2*CbE\n\tpaddw\tmm5,mm5\t\t\t; mm5=2*CbO\n\tmovq\tmm6,mm0\t\t\t; mm6=CrE\n\tmovq\tmm7,mm1\t\t\t; mm7=CrO\n\tpaddw\tmm0,mm0\t\t\t; mm0=2*CrE\n\tpaddw\tmm1,mm1\t\t\t; mm1=2*CrO\n\n\tpmulhw\tmm4,[GOTOFF(eax,PW_MF0228)]\t; mm4=(2*CbE * -FIX(0.22800))\n\tpmulhw\tmm5,[GOTOFF(eax,PW_MF0228)]\t; mm5=(2*CbO * -FIX(0.22800))\n\tpmulhw\tmm0,[GOTOFF(eax,PW_F0402)]\t; mm0=(2*CrE * FIX(0.40200))\n\tpmulhw\tmm1,[GOTOFF(eax,PW_F0402)]\t; mm1=(2*CrO * FIX(0.40200))\n\n\tpaddw\tmm4,[GOTOFF(eax,PW_ONE)]\n\tpaddw\tmm5,[GOTOFF(eax,PW_ONE)]\n\tpsraw\tmm4,1\t\t\t; mm4=(CbE * -FIX(0.22800))\n\tpsraw\tmm5,1\t\t\t; mm5=(CbO * -FIX(0.22800))\n\tpaddw\tmm0,[GOTOFF(eax,PW_ONE)]\n\tpaddw\tmm1,[GOTOFF(eax,PW_ONE)]\n\tpsraw\tmm0,1\t\t\t; mm0=(CrE * FIX(0.40200))\n\tpsraw\tmm1,1\t\t\t; mm1=(CrO * FIX(0.40200))\n\n\tpaddw\tmm4,mm2\n\tpaddw\tmm5,mm3\n\tpaddw\tmm4,mm2\t\t\t; mm4=(CbE * FIX(1.77200))=(B-Y)E\n\tpaddw\tmm5,mm3\t\t\t; mm5=(CbO * FIX(1.77200))=(B-Y)O\n\tpaddw\tmm0,mm6\t\t\t; mm0=(CrE * FIX(1.40200))=(R-Y)E\n\tpaddw\tmm1,mm7\t\t\t; mm1=(CrO * FIX(1.40200))=(R-Y)O\n\n\tmovq\tMMWORD [wk(0)], mm4\t; wk(0)=(B-Y)E\n\tmovq\tMMWORD [wk(1)], mm5\t; wk(1)=(B-Y)O\n\n\tmovq      mm4,mm2\n\tmovq      mm5,mm3\n\tpunpcklwd mm2,mm6\n\tpunpckhwd mm4,mm6\n\tpmaddwd   mm2,[GOTOFF(eax,PW_MF0344_F0285)]\n\tpmaddwd   mm4,[GOTOFF(eax,PW_MF0344_F0285)]\n\tpunpcklwd mm3,mm7\n\tpunpckhwd mm5,mm7\n\tpmaddwd   mm3,[GOTOFF(eax,PW_MF0344_F0285)]\n\tpmaddwd   mm5,[GOTOFF(eax,PW_MF0344_F0285)]\n\n\tpaddd     mm2,[GOTOFF(eax,PD_ONEHALF)]\n\tpaddd     mm4,[GOTOFF(eax,PD_ONEHALF)]\n\tpsrad     mm2,SCALEBITS\n\tpsrad     mm4,SCALEBITS\n\tpaddd     mm3,[GOTOFF(eax,PD_ONEHALF)]\n\tpaddd     mm5,[GOTOFF(eax,PD_ONEHALF)]\n\tpsrad     mm3,SCALEBITS\n\tpsrad     mm5,SCALEBITS\n\n\tpackssdw  mm2,mm4\t; mm2=CbE*-FIX(0.344)+CrE*FIX(0.285)\n\tpackssdw  mm3,mm5\t; mm3=CbO*-FIX(0.344)+CrO*FIX(0.285)\n\tpsubw     mm2,mm6\t; mm2=CbE*-FIX(0.344)+CrE*-FIX(0.714)=(G-Y)E\n\tpsubw     mm3,mm7\t; mm3=CbO*-FIX(0.344)+CrO*-FIX(0.714)=(G-Y)O\n\n\tmovq      mm5, MMWORD [esi]\t; mm5=Y(01234567)\n\n\tpcmpeqw   mm4,mm4\n\tpsrlw     mm4,BYTE_BIT\t\t; mm4={0xFF 0x00 0xFF 0x00 ..}\n\tpand      mm4,mm5\t\t; mm4=Y(0246)=YE\n\tpsrlw     mm5,BYTE_BIT\t\t; mm5=Y(1357)=YO\n\n\tpaddw     mm0,mm4\t\t; mm0=((R-Y)E+YE)=RE=(R0 R2 R4 R6)\n\tpaddw     mm1,mm5\t\t; mm1=((R-Y)O+YO)=RO=(R1 R3 R5 R7)\n\tpackuswb  mm0,mm0\t\t; mm0=(R0 R2 R4 R6 ** ** ** **)\n\tpackuswb  mm1,mm1\t\t; mm1=(R1 R3 R5 R7 ** ** ** **)\n\n\tpaddw     mm2,mm4\t\t; mm2=((G-Y)E+YE)=GE=(G0 G2 G4 G6)\n\tpaddw     mm3,mm5\t\t; mm3=((G-Y)O+YO)=GO=(G1 G3 G5 G7)\n\tpackuswb  mm2,mm2\t\t; mm2=(G0 G2 G4 G6 ** ** ** **)\n\tpackuswb  mm3,mm3\t\t; mm3=(G1 G3 G5 G7 ** ** ** **)\n\n\tpaddw     mm4, MMWORD [wk(0)]\t; mm4=(YE+(B-Y)E)=BE=(B0 B2 B4 B6)\n\tpaddw     mm5, MMWORD [wk(1)]\t; mm5=(YO+(B-Y)O)=BO=(B1 B3 B5 B7)\n\tpackuswb  mm4,mm4\t\t; mm4=(B0 B2 B4 B6 ** ** ** **)\n\tpackuswb  mm5,mm5\t\t; mm5=(B1 B3 B5 B7 ** ** ** **)\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n\t; mmA=(00 02 04 06 ** ** ** **), mmB=(01 03 05 07 ** ** ** **)\n\t; mmC=(10 12 14 16 ** ** ** **), mmD=(11 13 15 17 ** ** ** **)\n\t; mmE=(20 22 24 26 ** ** ** **), mmF=(21 23 25 27 ** ** ** **)\n\t; mmG=(** ** ** ** ** ** ** **), mmH=(** ** ** ** ** ** ** **)\n\n\tpunpcklbw mmA,mmC\t\t; mmA=(00 10 02 12 04 14 06 16)\n\tpunpcklbw mmE,mmB\t\t; mmE=(20 01 22 03 24 05 26 07)\n\tpunpcklbw mmD,mmF\t\t; mmD=(11 21 13 23 15 25 17 27)\n\n\tmovq      mmG,mmA\n\tmovq      mmH,mmA\n\tpunpcklwd mmA,mmE\t\t; mmA=(00 10 20 01 02 12 22 03)\n\tpunpckhwd mmG,mmE\t\t; mmG=(04 14 24 05 06 16 26 07)\n\n\tpsrlq     mmH,2*BYTE_BIT\t; mmH=(02 12 04 14 06 16 -- --)\n\tpsrlq     mmE,2*BYTE_BIT\t; mmE=(22 03 24 05 26 07 -- --)\n\n\tmovq      mmC,mmD\n\tmovq      mmB,mmD\n\tpunpcklwd mmD,mmH\t\t; mmD=(11 21 02 12 13 23 04 14)\n\tpunpckhwd mmC,mmH\t\t; mmC=(15 25 06 16 17 27 -- --)\n\n\tpsrlq     mmB,2*BYTE_BIT\t; mmB=(13 23 15 25 17 27 -- --)\n\n\tmovq      mmF,mmE\n\tpunpcklwd mmE,mmB\t\t; mmE=(22 03 13 23 24 05 15 25)\n\tpunpckhwd mmF,mmB\t\t; mmF=(26 07 17 27 -- -- -- --)\n\n\tpunpckldq mmA,mmD\t\t; mmA=(00 10 20 01 11 21 02 12)\n\tpunpckldq mmE,mmG\t\t; mmE=(22 03 13 23 04 14 24 05)\n\tpunpckldq mmC,mmF\t\t; mmC=(15 25 06 16 26 07 17 27)\n\n\tcmp\tecx, byte SIZEOF_MMWORD\n\tjb\tshort .column_st16\n\n\tmovq\tMMWORD [edi+0*SIZEOF_MMWORD], mmA\n\tmovq\tMMWORD [edi+1*SIZEOF_MMWORD], mmE\n\tmovq\tMMWORD [edi+2*SIZEOF_MMWORD], mmC\n\n\tsub\tecx, byte SIZEOF_MMWORD\n\tjz\tshort .nextrow\n\n\tadd\tesi, byte SIZEOF_MMWORD\t\t\t; inptr0\n\tadd\tebx, byte SIZEOF_MMWORD\t\t\t; inptr1\n\tadd\tedx, byte SIZEOF_MMWORD\t\t\t; inptr2\n\tadd\tedi, byte RGB_PIXELSIZE*SIZEOF_MMWORD\t; outptr\n\tjmp\tnear .columnloop\n\talignx\t16,7\n\n.column_st16:\n\tlea\tecx, [ecx+ecx*2]\t; imul ecx, RGB_PIXELSIZE\n\tcmp\tecx, byte 2*SIZEOF_MMWORD\n\tjb\tshort .column_st8\n\tmovq\tMMWORD [edi+0*SIZEOF_MMWORD], mmA\n\tmovq\tMMWORD [edi+1*SIZEOF_MMWORD], mmE\n\tmovq\tmmA,mmC\n\tsub\tecx, byte 2*SIZEOF_MMWORD\n\tadd\tedi, byte 2*SIZEOF_MMWORD\n\tjmp\tshort .column_st4\n.column_st8:\n\tcmp\tecx, byte SIZEOF_MMWORD\n\tjb\tshort .column_st4\n\tmovq\tMMWORD [edi+0*SIZEOF_MMWORD], mmA\n\tmovq\tmmA,mmE\n\tsub\tecx, byte SIZEOF_MMWORD\n\tadd\tedi, byte SIZEOF_MMWORD\n.column_st4:\n\tmovd\teax,mmA\n\tcmp\tecx, byte SIZEOF_DWORD\n\tjb\tshort .column_st2\n\tmov\tDWORD [edi+0*SIZEOF_DWORD], eax\n\tpsrlq\tmmA,DWORD_BIT\n\tmovd\teax,mmA\n\tsub\tecx, byte SIZEOF_DWORD\n\tadd\tedi, byte SIZEOF_DWORD\n.column_st2:\n\tcmp\tecx, byte SIZEOF_WORD\n\tjb\tshort .column_st1\n\tmov\tWORD [edi+0*SIZEOF_WORD], ax\n\tshr\teax,WORD_BIT\n\tsub\tecx, byte SIZEOF_WORD\n\tadd\tedi, byte SIZEOF_WORD\n.column_st1:\n\tcmp\tecx, byte SIZEOF_BYTE\n\tjb\tshort .nextrow\n\tmov\tBYTE [edi+0*SIZEOF_BYTE], al\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n%ifdef RGBX_FILLER_0XFF\n\tpcmpeqb   mm6,mm6\t\t; mm6=(X0 X2 X4 X6 ** ** ** **)\n\tpcmpeqb   mm7,mm7\t\t; mm7=(X1 X3 X5 X7 ** ** ** **)\n%else\n\tpxor      mm6,mm6\t\t; mm6=(X0 X2 X4 X6 ** ** ** **)\n\tpxor      mm7,mm7\t\t; mm7=(X1 X3 X5 X7 ** ** ** **)\n%endif\n\t; mmA=(00 02 04 06 ** ** ** **), mmB=(01 03 05 07 ** ** ** **)\n\t; mmC=(10 12 14 16 ** ** ** **), mmD=(11 13 15 17 ** ** ** **)\n\t; mmE=(20 22 24 26 ** ** ** **), mmF=(21 23 25 27 ** ** ** **)\n\t; mmG=(30 32 34 36 ** ** ** **), mmH=(31 33 35 37 ** ** ** **)\n\n\tpunpcklbw mmA,mmC\t\t; mmA=(00 10 02 12 04 14 06 16)\n\tpunpcklbw mmE,mmG\t\t; mmE=(20 30 22 32 24 34 26 36)\n\tpunpcklbw mmB,mmD\t\t; mmB=(01 11 03 13 05 15 07 17)\n\tpunpcklbw mmF,mmH\t\t; mmF=(21 31 23 33 25 35 27 37)\n\n\tmovq      mmC,mmA\n\tpunpcklwd mmA,mmE\t\t; mmA=(00 10 20 30 02 12 22 32)\n\tpunpckhwd mmC,mmE\t\t; mmC=(04 14 24 34 06 16 26 36)\n\tmovq      mmG,mmB\n\tpunpcklwd mmB,mmF\t\t; mmB=(01 11 21 31 03 13 23 33)\n\tpunpckhwd mmG,mmF\t\t; mmG=(05 15 25 35 07 17 27 37)\n\n\tmovq      mmD,mmA\n\tpunpckldq mmA,mmB\t\t; mmA=(00 10 20 30 01 11 21 31)\n\tpunpckhdq mmD,mmB\t\t; mmD=(02 12 22 32 03 13 23 33)\n\tmovq      mmH,mmC\n\tpunpckldq mmC,mmG\t\t; mmC=(04 14 24 34 05 15 25 35)\n\tpunpckhdq mmH,mmG\t\t; mmH=(06 16 26 36 07 17 27 37)\n\n\tcmp\tecx, byte SIZEOF_MMWORD\n\tjb\tshort .column_st16\n\n\tmovq\tMMWORD [edi+0*SIZEOF_MMWORD], mmA\n\tmovq\tMMWORD [edi+1*SIZEOF_MMWORD], mmD\n\tmovq\tMMWORD [edi+2*SIZEOF_MMWORD], mmC\n\tmovq\tMMWORD [edi+3*SIZEOF_MMWORD], mmH\n\n\tsub\tecx, byte SIZEOF_MMWORD\n\tjz\tshort .nextrow\n\n\tadd\tesi, byte SIZEOF_MMWORD\t\t\t; inptr0\n\tadd\tebx, byte SIZEOF_MMWORD\t\t\t; inptr1\n\tadd\tedx, byte SIZEOF_MMWORD\t\t\t; inptr2\n\tadd\tedi, byte RGB_PIXELSIZE*SIZEOF_MMWORD\t; outptr\n\tjmp\tnear .columnloop\n\talignx\t16,7\n\n.column_st16:\n\tcmp\tecx, byte SIZEOF_MMWORD/2\n\tjb\tshort .column_st8\n\tmovq\tMMWORD [edi+0*SIZEOF_MMWORD], mmA\n\tmovq\tMMWORD [edi+1*SIZEOF_MMWORD], mmD\n\tmovq\tmmA,mmC\n\tmovq\tmmD,mmH\n\tsub\tecx, byte SIZEOF_MMWORD/2\n\tadd\tedi, byte 2*SIZEOF_MMWORD\n.column_st8:\n\tcmp\tecx, byte SIZEOF_MMWORD/4\n\tjb\tshort .column_st4\n\tmovq\tMMWORD [edi+0*SIZEOF_MMWORD], mmA\n\tmovq\tmmA,mmD\n\tsub\tecx, byte SIZEOF_MMWORD/4\n\tadd\tedi, byte 1*SIZEOF_MMWORD\n.column_st4:\n\tcmp\tecx, byte SIZEOF_MMWORD/8\n\tjb\tshort .nextrow\n\tmovd\tDWORD [edi+0*SIZEOF_DWORD], mmA\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n\talignx\t16,7\n\n.nextrow:\n\tpop\tecx\n\tpop\tesi\n\tpop\tebx\n\tpop\tedx\n\tpop\tedi\n\tpop\teax\n\n\tadd\tesi, byte SIZEOF_JSAMPROW\n\tadd\tebx, byte SIZEOF_JSAMPROW\n\tadd\tedx, byte SIZEOF_JSAMPROW\n\tadd\tedi, byte SIZEOF_JSAMPROW\t; output_buf\n\tdec\teax\t\t\t\t; num_rows\n\tjg\tnear .rowloop\n\n\temms\t\t; empty MMX state\n\n.return:\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jdclrss2-64.asm",
    "content": ";\n; jdclrss2-64.asm - colorspace conversion (64-bit SSE2)\n;\n; Copyright 2009, 2012 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2009, 2012 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\t\t\t\t\n; --------------------------------------------------------------------------\n;\n; Convert some rows of samples to the output colorspace.\n;\n; GLOBAL(void)\n; jsimd_ycc_rgb_convert_sse2 (JDIMENSION out_width,\n;                             JSAMPIMAGE input_buf, JDIMENSION input_row,\n;                             JSAMPARRAY output_buf, int num_rows)\n;\n\n; r10 = JDIMENSION out_width\n; r11 = JSAMPIMAGE input_buf\n; r12 = JDIMENSION input_row\n; r13 = JSAMPARRAY output_buf\n; r14 = int num_rows\n\n%define wk(i)\t\trbp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t2\n\n\talign\t16\n\tglobal\tEXTN(jsimd_ycc_rgb_convert_sse2)\n\nEXTN(jsimd_ycc_rgb_convert_sse2):\n\tpush\trbp\n\tmov\trax,rsp\t\t\t\t; rax = original rbp\n\tsub\trsp, byte 4\n\tand\trsp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[rsp],rax\n\tmov\trbp,rsp\t\t\t\t; rbp = aligned rbp\n\tlea\trsp, [wk(0)]\n\tcollect_args\n\tpush\trbx\n\n\tmov\trcx, r10\t; num_cols\n\ttest\trcx,rcx\n\tjz\tnear .return\n\n\tpush\trcx\n\n\tmov\trdi, r11\n\tmov\trcx, r12\n\tmov\trsi, JSAMPARRAY [rdi+0*SIZEOF_JSAMPARRAY]\n\tmov\trbx, JSAMPARRAY [rdi+1*SIZEOF_JSAMPARRAY]\n\tmov\trdx, JSAMPARRAY [rdi+2*SIZEOF_JSAMPARRAY]\n\tlea\trsi, [rsi+rcx*SIZEOF_JSAMPROW]\n\tlea\trbx, [rbx+rcx*SIZEOF_JSAMPROW]\n\tlea\trdx, [rdx+rcx*SIZEOF_JSAMPROW]\n\n\tpop\trcx\n\n\tmov\trdi, r13\n\tmov\teax, r14d\n\ttest\trax,rax\n\tjle\tnear .return\n.rowloop:\n\tpush\trax\n\tpush\trdi\n\tpush\trdx\n\tpush\trbx\n\tpush\trsi\n\tpush\trcx\t\t\t; col\n\n\tmov\trsi, JSAMPROW [rsi]\t; inptr0\n\tmov\trbx, JSAMPROW [rbx]\t; inptr1\n\tmov\trdx, JSAMPROW [rdx]\t; inptr2\n\tmov\trdi, JSAMPROW [rdi]\t; outptr\n.columnloop:\n\n\tmovdqa\txmm5, XMMWORD [rbx]\t; xmm5=Cb(0123456789ABCDEF)\n\tmovdqa\txmm1, XMMWORD [rdx]\t; xmm1=Cr(0123456789ABCDEF)\n\n\tpcmpeqw\txmm4,xmm4\n\tpcmpeqw\txmm7,xmm7\n\tpsrlw\txmm4,BYTE_BIT\n\tpsllw\txmm7,7\t\t\t; xmm7={0xFF80 0xFF80 0xFF80 0xFF80 ..}\n\tmovdqa\txmm0,xmm4\t\t; xmm0=xmm4={0xFF 0x00 0xFF 0x00 ..}\n\n\tpand\txmm4,xmm5\t\t; xmm4=Cb(02468ACE)=CbE\n\tpsrlw\txmm5,BYTE_BIT\t\t; xmm5=Cb(13579BDF)=CbO\n\tpand\txmm0,xmm1\t\t; xmm0=Cr(02468ACE)=CrE\n\tpsrlw\txmm1,BYTE_BIT\t\t; xmm1=Cr(13579BDF)=CrO\n\n\tpaddw\txmm4,xmm7\n\tpaddw\txmm5,xmm7\n\tpaddw\txmm0,xmm7\n\tpaddw\txmm1,xmm7\n\n\t; (Original)\n\t; R = Y                + 1.40200 * Cr\n\t; G = Y - 0.34414 * Cb - 0.71414 * Cr\n\t; B = Y + 1.77200 * Cb\n\t;\n\t; (This implementation)\n\t; R = Y                + 0.40200 * Cr + Cr\n\t; G = Y - 0.34414 * Cb + 0.28586 * Cr - Cr\n\t; B = Y - 0.22800 * Cb + Cb + Cb\n\n\tmovdqa\txmm2,xmm4\t\t; xmm2=CbE\n\tmovdqa\txmm3,xmm5\t\t; xmm3=CbO\n\tpaddw\txmm4,xmm4\t\t; xmm4=2*CbE\n\tpaddw\txmm5,xmm5\t\t; xmm5=2*CbO\n\tmovdqa\txmm6,xmm0\t\t; xmm6=CrE\n\tmovdqa\txmm7,xmm1\t\t; xmm7=CrO\n\tpaddw\txmm0,xmm0\t\t; xmm0=2*CrE\n\tpaddw\txmm1,xmm1\t\t; xmm1=2*CrO\n\n\tpmulhw\txmm4,[rel PW_MF0228]\t; xmm4=(2*CbE * -FIX(0.22800))\n\tpmulhw\txmm5,[rel PW_MF0228]\t; xmm5=(2*CbO * -FIX(0.22800))\n\tpmulhw\txmm0,[rel PW_F0402]\t; xmm0=(2*CrE * FIX(0.40200))\n\tpmulhw\txmm1,[rel PW_F0402]\t; xmm1=(2*CrO * FIX(0.40200))\n\n\tpaddw\txmm4,[rel PW_ONE]\n\tpaddw\txmm5,[rel PW_ONE]\n\tpsraw\txmm4,1\t\t\t; xmm4=(CbE * -FIX(0.22800))\n\tpsraw\txmm5,1\t\t\t; xmm5=(CbO * -FIX(0.22800))\n\tpaddw\txmm0,[rel PW_ONE]\n\tpaddw\txmm1,[rel PW_ONE]\n\tpsraw\txmm0,1\t\t\t; xmm0=(CrE * FIX(0.40200))\n\tpsraw\txmm1,1\t\t\t; xmm1=(CrO * FIX(0.40200))\n\n\tpaddw\txmm4,xmm2\n\tpaddw\txmm5,xmm3\n\tpaddw\txmm4,xmm2\t\t; xmm4=(CbE * FIX(1.77200))=(B-Y)E\n\tpaddw\txmm5,xmm3\t\t; xmm5=(CbO * FIX(1.77200))=(B-Y)O\n\tpaddw\txmm0,xmm6\t\t; xmm0=(CrE * FIX(1.40200))=(R-Y)E\n\tpaddw\txmm1,xmm7\t\t; xmm1=(CrO * FIX(1.40200))=(R-Y)O\n\n\tmovdqa\tXMMWORD [wk(0)], xmm4\t; wk(0)=(B-Y)E\n\tmovdqa\tXMMWORD [wk(1)], xmm5\t; wk(1)=(B-Y)O\n\n\tmovdqa    xmm4,xmm2\n\tmovdqa    xmm5,xmm3\n\tpunpcklwd xmm2,xmm6\n\tpunpckhwd xmm4,xmm6\n\tpmaddwd   xmm2,[rel PW_MF0344_F0285]\n\tpmaddwd   xmm4,[rel PW_MF0344_F0285]\n\tpunpcklwd xmm3,xmm7\n\tpunpckhwd xmm5,xmm7\n\tpmaddwd   xmm3,[rel PW_MF0344_F0285]\n\tpmaddwd   xmm5,[rel PW_MF0344_F0285]\n\n\tpaddd     xmm2,[rel PD_ONEHALF]\n\tpaddd     xmm4,[rel PD_ONEHALF]\n\tpsrad     xmm2,SCALEBITS\n\tpsrad     xmm4,SCALEBITS\n\tpaddd     xmm3,[rel PD_ONEHALF]\n\tpaddd     xmm5,[rel PD_ONEHALF]\n\tpsrad     xmm3,SCALEBITS\n\tpsrad     xmm5,SCALEBITS\n\n\tpackssdw  xmm2,xmm4\t; xmm2=CbE*-FIX(0.344)+CrE*FIX(0.285)\n\tpackssdw  xmm3,xmm5\t; xmm3=CbO*-FIX(0.344)+CrO*FIX(0.285)\n\tpsubw     xmm2,xmm6\t; xmm2=CbE*-FIX(0.344)+CrE*-FIX(0.714)=(G-Y)E\n\tpsubw     xmm3,xmm7\t; xmm3=CbO*-FIX(0.344)+CrO*-FIX(0.714)=(G-Y)O\n\n\tmovdqa    xmm5, XMMWORD [rsi]\t; xmm5=Y(0123456789ABCDEF)\n\n\tpcmpeqw   xmm4,xmm4\n\tpsrlw     xmm4,BYTE_BIT\t\t; xmm4={0xFF 0x00 0xFF 0x00 ..}\n\tpand      xmm4,xmm5\t\t; xmm4=Y(02468ACE)=YE\n\tpsrlw     xmm5,BYTE_BIT\t\t; xmm5=Y(13579BDF)=YO\n\n\tpaddw     xmm0,xmm4\t\t; xmm0=((R-Y)E+YE)=RE=R(02468ACE)\n\tpaddw     xmm1,xmm5\t\t; xmm1=((R-Y)O+YO)=RO=R(13579BDF)\n\tpackuswb  xmm0,xmm0\t\t; xmm0=R(02468ACE********)\n\tpackuswb  xmm1,xmm1\t\t; xmm1=R(13579BDF********)\n\n\tpaddw     xmm2,xmm4\t\t; xmm2=((G-Y)E+YE)=GE=G(02468ACE)\n\tpaddw     xmm3,xmm5\t\t; xmm3=((G-Y)O+YO)=GO=G(13579BDF)\n\tpackuswb  xmm2,xmm2\t\t; xmm2=G(02468ACE********)\n\tpackuswb  xmm3,xmm3\t\t; xmm3=G(13579BDF********)\n\n\tpaddw     xmm4, XMMWORD [wk(0)]\t; xmm4=(YE+(B-Y)E)=BE=B(02468ACE)\n\tpaddw     xmm5, XMMWORD [wk(1)]\t; xmm5=(YO+(B-Y)O)=BO=B(13579BDF)\n\tpackuswb  xmm4,xmm4\t\t; xmm4=B(02468ACE********)\n\tpackuswb  xmm5,xmm5\t\t; xmm5=B(13579BDF********)\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n\t; xmmA=(00 02 04 06 08 0A 0C 0E **), xmmB=(01 03 05 07 09 0B 0D 0F **)\n\t; xmmC=(10 12 14 16 18 1A 1C 1E **), xmmD=(11 13 15 17 19 1B 1D 1F **)\n\t; xmmE=(20 22 24 26 28 2A 2C 2E **), xmmF=(21 23 25 27 29 2B 2D 2F **)\n\t; xmmG=(** ** ** ** ** ** ** ** **), xmmH=(** ** ** ** ** ** ** ** **)\n\n\tpunpcklbw xmmA,xmmC\t; xmmA=(00 10 02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E)\n\tpunpcklbw xmmE,xmmB\t; xmmE=(20 01 22 03 24 05 26 07 28 09 2A 0B 2C 0D 2E 0F)\n\tpunpcklbw xmmD,xmmF\t; xmmD=(11 21 13 23 15 25 17 27 19 29 1B 2B 1D 2D 1F 2F)\n\n\tmovdqa    xmmG,xmmA\n\tmovdqa    xmmH,xmmA\n\tpunpcklwd xmmA,xmmE\t; xmmA=(00 10 20 01 02 12 22 03 04 14 24 05 06 16 26 07)\n\tpunpckhwd xmmG,xmmE\t; xmmG=(08 18 28 09 0A 1A 2A 0B 0C 1C 2C 0D 0E 1E 2E 0F)\n\n\tpsrldq    xmmH,2\t; xmmH=(02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E -- --)\n\tpsrldq    xmmE,2\t; xmmE=(22 03 24 05 26 07 28 09 2A 0B 2C 0D 2E 0F -- --)\n\n\tmovdqa    xmmC,xmmD\n\tmovdqa    xmmB,xmmD\n\tpunpcklwd xmmD,xmmH\t; xmmD=(11 21 02 12 13 23 04 14 15 25 06 16 17 27 08 18)\n\tpunpckhwd xmmC,xmmH\t; xmmC=(19 29 0A 1A 1B 2B 0C 1C 1D 2D 0E 1E 1F 2F -- --)\n\n\tpsrldq    xmmB,2\t; xmmB=(13 23 15 25 17 27 19 29 1B 2B 1D 2D 1F 2F -- --)\n\n\tmovdqa    xmmF,xmmE\n\tpunpcklwd xmmE,xmmB\t; xmmE=(22 03 13 23 24 05 15 25 26 07 17 27 28 09 19 29)\n\tpunpckhwd xmmF,xmmB\t; xmmF=(2A 0B 1B 2B 2C 0D 1D 2D 2E 0F 1F 2F -- -- -- --)\n\n\tpshufd    xmmH,xmmA,0x4E; xmmH=(04 14 24 05 06 16 26 07 00 10 20 01 02 12 22 03)\n\tmovdqa    xmmB,xmmE\n\tpunpckldq xmmA,xmmD\t; xmmA=(00 10 20 01 11 21 02 12 02 12 22 03 13 23 04 14)\n\tpunpckldq xmmE,xmmH\t; xmmE=(22 03 13 23 04 14 24 05 24 05 15 25 06 16 26 07)\n\tpunpckhdq xmmD,xmmB\t; xmmD=(15 25 06 16 26 07 17 27 17 27 08 18 28 09 19 29)\n\n\tpshufd    xmmH,xmmG,0x4E; xmmH=(0C 1C 2C 0D 0E 1E 2E 0F 08 18 28 09 0A 1A 2A 0B)\n\tmovdqa    xmmB,xmmF\n\tpunpckldq xmmG,xmmC\t; xmmG=(08 18 28 09 19 29 0A 1A 0A 1A 2A 0B 1B 2B 0C 1C)\n\tpunpckldq xmmF,xmmH\t; xmmF=(2A 0B 1B 2B 0C 1C 2C 0D 2C 0D 1D 2D 0E 1E 2E 0F)\n\tpunpckhdq xmmC,xmmB\t; xmmC=(1D 2D 0E 1E 2E 0F 1F 2F 1F 2F -- -- -- -- -- --)\n\n\tpunpcklqdq xmmA,xmmE\t; xmmA=(00 10 20 01 11 21 02 12 22 03 13 23 04 14 24 05)\n\tpunpcklqdq xmmD,xmmG\t; xmmD=(15 25 06 16 26 07 17 27 08 18 28 09 19 29 0A 1A)\n\tpunpcklqdq xmmF,xmmC\t; xmmF=(2A 0B 1B 2B 0C 1C 2C 0D 1D 2D 0E 1E 2E 0F 1F 2F)\n\n\tcmp\trcx, byte SIZEOF_XMMWORD\n\tjb\tshort .column_st32\n\n\ttest\trdi, SIZEOF_XMMWORD-1\n\tjnz\tshort .out1\n\t; --(aligned)-------------------\n\tmovntdq\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n\tmovntdq\tXMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n\tmovntdq\tXMMWORD [rdi+2*SIZEOF_XMMWORD], xmmF\n\tjmp\tshort .out0\n.out1:\t; --(unaligned)-----------------\n\tmovdqu\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n\tmovdqu\tXMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n\tmovdqu\tXMMWORD [rdi+2*SIZEOF_XMMWORD], xmmF\n.out0:\n\tadd\trdi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD\t; outptr\n\tsub\trcx, byte SIZEOF_XMMWORD\n\tjz\tnear .nextrow\n\n\tadd\trsi, byte SIZEOF_XMMWORD\t; inptr0\n\tadd\trbx, byte SIZEOF_XMMWORD\t; inptr1\n\tadd\trdx, byte SIZEOF_XMMWORD\t; inptr2\n\tjmp\tnear .columnloop\n\n.column_st32:\n\tlea\trcx, [rcx+rcx*2]\t\t; imul ecx, RGB_PIXELSIZE\n\tcmp\trcx, byte 2*SIZEOF_XMMWORD\n\tjb\tshort .column_st16\n\tmovdqu\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n\tmovdqu\tXMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n\tadd\trdi, byte 2*SIZEOF_XMMWORD\t; outptr\n\tmovdqa\txmmA,xmmF\n\tsub\trcx, byte 2*SIZEOF_XMMWORD\n\tjmp\tshort .column_st15\n.column_st16:\n\tcmp\trcx, byte SIZEOF_XMMWORD\n\tjb\tshort .column_st15\n\tmovdqu\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n\tadd\trdi, byte SIZEOF_XMMWORD\t; outptr\n\tmovdqa\txmmA,xmmD\n\tsub\trcx, byte SIZEOF_XMMWORD\n.column_st15:\n\t; Store the lower 8 bytes of xmmA to the output when it has enough\n\t; space.\n\tcmp\trcx, byte SIZEOF_MMWORD\n\tjb\tshort .column_st7\n\tmovq\tXMM_MMWORD [rdi], xmmA\n\tadd\trdi, byte SIZEOF_MMWORD\n\tsub\trcx, byte SIZEOF_MMWORD\n\tpsrldq\txmmA, SIZEOF_MMWORD\n.column_st7:\n\t; Store the lower 4 bytes of xmmA to the output when it has enough\n\t; space.\n\tcmp\trcx, byte SIZEOF_DWORD\n\tjb\tshort .column_st3\n\tmovd\tXMM_DWORD [rdi], xmmA\n\tadd\trdi, byte SIZEOF_DWORD\n\tsub\trcx, byte SIZEOF_DWORD\n\tpsrldq\txmmA, SIZEOF_DWORD\n.column_st3:\n\t; Store the lower 2 bytes of rax to the output when it has enough\n\t; space.\n\tmovd\teax, xmmA\n\tcmp\trcx, byte SIZEOF_WORD\n\tjb\tshort .column_st1\n\tmov\tWORD [rdi], ax\n\tadd\trdi, byte SIZEOF_WORD\n\tsub\trcx, byte SIZEOF_WORD\n\tshr\trax, 16\n.column_st1:\n\t; Store the lower 1 byte of rax to the output when it has enough\n\t; space.\n\ttest\trcx, rcx\n\tjz\tshort .nextrow\n\tmov\tBYTE [rdi], al\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n%ifdef RGBX_FILLER_0XFF\n\tpcmpeqb   xmm6,xmm6\t\t; xmm6=XE=X(02468ACE********)\n\tpcmpeqb   xmm7,xmm7\t\t; xmm7=XO=X(13579BDF********)\n%else\n\tpxor      xmm6,xmm6\t\t; xmm6=XE=X(02468ACE********)\n\tpxor      xmm7,xmm7\t\t; xmm7=XO=X(13579BDF********)\n%endif\n\t; xmmA=(00 02 04 06 08 0A 0C 0E **), xmmB=(01 03 05 07 09 0B 0D 0F **)\n\t; xmmC=(10 12 14 16 18 1A 1C 1E **), xmmD=(11 13 15 17 19 1B 1D 1F **)\n\t; xmmE=(20 22 24 26 28 2A 2C 2E **), xmmF=(21 23 25 27 29 2B 2D 2F **)\n\t; xmmG=(30 32 34 36 38 3A 3C 3E **), xmmH=(31 33 35 37 39 3B 3D 3F **)\n\n\tpunpcklbw xmmA,xmmC\t; xmmA=(00 10 02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E)\n\tpunpcklbw xmmE,xmmG\t; xmmE=(20 30 22 32 24 34 26 36 28 38 2A 3A 2C 3C 2E 3E)\n\tpunpcklbw xmmB,xmmD\t; xmmB=(01 11 03 13 05 15 07 17 09 19 0B 1B 0D 1D 0F 1F)\n\tpunpcklbw xmmF,xmmH\t; xmmF=(21 31 23 33 25 35 27 37 29 39 2B 3B 2D 3D 2F 3F)\n\n\tmovdqa    xmmC,xmmA\n\tpunpcklwd xmmA,xmmE\t; xmmA=(00 10 20 30 02 12 22 32 04 14 24 34 06 16 26 36)\n\tpunpckhwd xmmC,xmmE\t; xmmC=(08 18 28 38 0A 1A 2A 3A 0C 1C 2C 3C 0E 1E 2E 3E)\n\tmovdqa    xmmG,xmmB\n\tpunpcklwd xmmB,xmmF\t; xmmB=(01 11 21 31 03 13 23 33 05 15 25 35 07 17 27 37)\n\tpunpckhwd xmmG,xmmF\t; xmmG=(09 19 29 39 0B 1B 2B 3B 0D 1D 2D 3D 0F 1F 2F 3F)\n\n\tmovdqa    xmmD,xmmA\n\tpunpckldq xmmA,xmmB\t; xmmA=(00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33)\n\tpunpckhdq xmmD,xmmB\t; xmmD=(04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37)\n\tmovdqa    xmmH,xmmC\n\tpunpckldq xmmC,xmmG\t; xmmC=(08 18 28 38 09 19 29 39 0A 1A 2A 3A 0B 1B 2B 3B)\n\tpunpckhdq xmmH,xmmG\t; xmmH=(0C 1C 2C 3C 0D 1D 2D 3D 0E 1E 2E 3E 0F 1F 2F 3F)\n\n\tcmp\trcx, byte SIZEOF_XMMWORD\n\tjb\tshort .column_st32\n\n\ttest\trdi, SIZEOF_XMMWORD-1\n\tjnz\tshort .out1\n\t; --(aligned)-------------------\n\tmovntdq\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n\tmovntdq\tXMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n\tmovntdq\tXMMWORD [rdi+2*SIZEOF_XMMWORD], xmmC\n\tmovntdq\tXMMWORD [rdi+3*SIZEOF_XMMWORD], xmmH\n\tjmp\tshort .out0\n.out1:\t; --(unaligned)-----------------\n\tmovdqu\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n\tmovdqu\tXMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n\tmovdqu\tXMMWORD [rdi+2*SIZEOF_XMMWORD], xmmC\n\tmovdqu\tXMMWORD [rdi+3*SIZEOF_XMMWORD], xmmH\n.out0:\n\tadd\trdi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD\t; outptr\n\tsub\trcx, byte SIZEOF_XMMWORD\n\tjz\tnear .nextrow\n\n\tadd\trsi, byte SIZEOF_XMMWORD\t; inptr0\n\tadd\trbx, byte SIZEOF_XMMWORD\t; inptr1\n\tadd\trdx, byte SIZEOF_XMMWORD\t; inptr2\n\tjmp\tnear .columnloop\n\n.column_st32:\n\tcmp\trcx, byte SIZEOF_XMMWORD/2\n\tjb\tshort .column_st16\n\tmovdqu\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n\tmovdqu\tXMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n\tadd\trdi, byte 2*SIZEOF_XMMWORD\t; outptr\n\tmovdqa\txmmA,xmmC\n\tmovdqa\txmmD,xmmH\n\tsub\trcx, byte SIZEOF_XMMWORD/2\n.column_st16:\n\tcmp\trcx, byte SIZEOF_XMMWORD/4\n\tjb\tshort .column_st15\n\tmovdqu\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n\tadd\trdi, byte SIZEOF_XMMWORD\t; outptr\n\tmovdqa\txmmA,xmmD\n\tsub\trcx, byte SIZEOF_XMMWORD/4\n.column_st15:\n\t; Store two pixels (8 bytes) of xmmA to the output when it has enough\n\t; space.\n\tcmp\trcx, byte SIZEOF_XMMWORD/8\n\tjb\tshort .column_st7\n\tmovq\tMMWORD [rdi], xmmA\n\tadd\trdi, byte SIZEOF_XMMWORD/8*4\n\tsub\trcx, byte SIZEOF_XMMWORD/8\n\tpsrldq\txmmA, SIZEOF_XMMWORD/8*4\n.column_st7:\n\t; Store one pixel (4 bytes) of xmmA to the output when it has enough\n\t; space.\n\ttest\trcx, rcx\n\tjz\tshort .nextrow\n\tmovd\tXMM_DWORD [rdi], xmmA\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n.nextrow:\n\tpop\trcx\n\tpop\trsi\n\tpop\trbx\n\tpop\trdx\n\tpop\trdi\n\tpop\trax\n\n\tadd\trsi, byte SIZEOF_JSAMPROW\n\tadd\trbx, byte SIZEOF_JSAMPROW\n\tadd\trdx, byte SIZEOF_JSAMPROW\n\tadd\trdi, byte SIZEOF_JSAMPROW\t; output_buf\n\tdec\trax\t\t\t\t; num_rows\n\tjg\tnear .rowloop\n\n\tsfence\t\t; flush the write buffer\n\n.return:\n\tpop\trbx\n\tuncollect_args\n\tmov\trsp,rbp\t\t; rsp <- aligned rbp\n\tpop\trsp\t\t; rsp <- original rbp\n\tpop\trbp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jdclrss2.asm",
    "content": ";\n; jdclrss2.asm - colorspace conversion (SSE2)\n;\n; Copyright 2009, 2012 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2012 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\t\t\t\t\n; --------------------------------------------------------------------------\n;\n; Convert some rows of samples to the output colorspace.\n;\n; GLOBAL(void)\n; jsimd_ycc_rgb_convert_sse2 (JDIMENSION out_width,\n;                             JSAMPIMAGE input_buf, JDIMENSION input_row,\n;                             JSAMPARRAY output_buf, int num_rows)\n;\n\n%define out_width(b)\t(b)+8\t\t\t; JDIMENSION out_width\n%define input_buf(b)\t(b)+12\t\t; JSAMPIMAGE input_buf\n%define input_row(b)\t(b)+16\t\t; JDIMENSION input_row\n%define output_buf(b)\t(b)+20\t\t; JSAMPARRAY output_buf\n%define num_rows(b)\t(b)+24\t\t; int num_rows\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t2\n%define gotptr\t\twk(0)-SIZEOF_POINTER\t; void * gotptr\n\n\talign\t16\n\tglobal\tEXTN(jsimd_ycc_rgb_convert_sse2)\n\nEXTN(jsimd_ycc_rgb_convert_sse2):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [wk(0)]\n\tpushpic\teax\t\t; make a room for GOT address\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t\t; get GOT address\n\tmovpic\tPOINTER [gotptr], ebx\t; save GOT address\n\n\tmov\tecx, JDIMENSION [out_width(eax)]\t; num_cols\n\ttest\tecx,ecx\n\tjz\tnear .return\n\n\tpush\tecx\n\n\tmov\tedi, JSAMPIMAGE [input_buf(eax)]\n\tmov\tecx, JDIMENSION [input_row(eax)]\n\tmov\tesi, JSAMPARRAY [edi+0*SIZEOF_JSAMPARRAY]\n\tmov\tebx, JSAMPARRAY [edi+1*SIZEOF_JSAMPARRAY]\n\tmov\tedx, JSAMPARRAY [edi+2*SIZEOF_JSAMPARRAY]\n\tlea\tesi, [esi+ecx*SIZEOF_JSAMPROW]\n\tlea\tebx, [ebx+ecx*SIZEOF_JSAMPROW]\n\tlea\tedx, [edx+ecx*SIZEOF_JSAMPROW]\n\n\tpop\tecx\n\n\tmov\tedi, JSAMPARRAY [output_buf(eax)]\n\tmov\teax, INT [num_rows(eax)]\n\ttest\teax,eax\n\tjle\tnear .return\n\talignx\t16,7\n.rowloop:\n\tpush\teax\n\tpush\tedi\n\tpush\tedx\n\tpush\tebx\n\tpush\tesi\n\tpush\tecx\t\t\t; col\n\n\tmov\tesi, JSAMPROW [esi]\t; inptr0\n\tmov\tebx, JSAMPROW [ebx]\t; inptr1\n\tmov\tedx, JSAMPROW [edx]\t; inptr2\n\tmov\tedi, JSAMPROW [edi]\t; outptr\n\tmovpic\teax, POINTER [gotptr]\t; load GOT address (eax)\n\talignx\t16,7\n.columnloop:\n\n\tmovdqa\txmm5, XMMWORD [ebx]\t; xmm5=Cb(0123456789ABCDEF)\n\tmovdqa\txmm1, XMMWORD [edx]\t; xmm1=Cr(0123456789ABCDEF)\n\n\tpcmpeqw\txmm4,xmm4\n\tpcmpeqw\txmm7,xmm7\n\tpsrlw\txmm4,BYTE_BIT\n\tpsllw\txmm7,7\t\t\t; xmm7={0xFF80 0xFF80 0xFF80 0xFF80 ..}\n\tmovdqa\txmm0,xmm4\t\t; xmm0=xmm4={0xFF 0x00 0xFF 0x00 ..}\n\n\tpand\txmm4,xmm5\t\t; xmm4=Cb(02468ACE)=CbE\n\tpsrlw\txmm5,BYTE_BIT\t\t; xmm5=Cb(13579BDF)=CbO\n\tpand\txmm0,xmm1\t\t; xmm0=Cr(02468ACE)=CrE\n\tpsrlw\txmm1,BYTE_BIT\t\t; xmm1=Cr(13579BDF)=CrO\n\n\tpaddw\txmm4,xmm7\n\tpaddw\txmm5,xmm7\n\tpaddw\txmm0,xmm7\n\tpaddw\txmm1,xmm7\n\n\t; (Original)\n\t; R = Y                + 1.40200 * Cr\n\t; G = Y - 0.34414 * Cb - 0.71414 * Cr\n\t; B = Y + 1.77200 * Cb\n\t;\n\t; (This implementation)\n\t; R = Y                + 0.40200 * Cr + Cr\n\t; G = Y - 0.34414 * Cb + 0.28586 * Cr - Cr\n\t; B = Y - 0.22800 * Cb + Cb + Cb\n\n\tmovdqa\txmm2,xmm4\t\t; xmm2=CbE\n\tmovdqa\txmm3,xmm5\t\t; xmm3=CbO\n\tpaddw\txmm4,xmm4\t\t; xmm4=2*CbE\n\tpaddw\txmm5,xmm5\t\t; xmm5=2*CbO\n\tmovdqa\txmm6,xmm0\t\t; xmm6=CrE\n\tmovdqa\txmm7,xmm1\t\t; xmm7=CrO\n\tpaddw\txmm0,xmm0\t\t; xmm0=2*CrE\n\tpaddw\txmm1,xmm1\t\t; xmm1=2*CrO\n\n\tpmulhw\txmm4,[GOTOFF(eax,PW_MF0228)]\t; xmm4=(2*CbE * -FIX(0.22800))\n\tpmulhw\txmm5,[GOTOFF(eax,PW_MF0228)]\t; xmm5=(2*CbO * -FIX(0.22800))\n\tpmulhw\txmm0,[GOTOFF(eax,PW_F0402)]\t; xmm0=(2*CrE * FIX(0.40200))\n\tpmulhw\txmm1,[GOTOFF(eax,PW_F0402)]\t; xmm1=(2*CrO * FIX(0.40200))\n\n\tpaddw\txmm4,[GOTOFF(eax,PW_ONE)]\n\tpaddw\txmm5,[GOTOFF(eax,PW_ONE)]\n\tpsraw\txmm4,1\t\t\t; xmm4=(CbE * -FIX(0.22800))\n\tpsraw\txmm5,1\t\t\t; xmm5=(CbO * -FIX(0.22800))\n\tpaddw\txmm0,[GOTOFF(eax,PW_ONE)]\n\tpaddw\txmm1,[GOTOFF(eax,PW_ONE)]\n\tpsraw\txmm0,1\t\t\t; xmm0=(CrE * FIX(0.40200))\n\tpsraw\txmm1,1\t\t\t; xmm1=(CrO * FIX(0.40200))\n\n\tpaddw\txmm4,xmm2\n\tpaddw\txmm5,xmm3\n\tpaddw\txmm4,xmm2\t\t; xmm4=(CbE * FIX(1.77200))=(B-Y)E\n\tpaddw\txmm5,xmm3\t\t; xmm5=(CbO * FIX(1.77200))=(B-Y)O\n\tpaddw\txmm0,xmm6\t\t; xmm0=(CrE * FIX(1.40200))=(R-Y)E\n\tpaddw\txmm1,xmm7\t\t; xmm1=(CrO * FIX(1.40200))=(R-Y)O\n\n\tmovdqa\tXMMWORD [wk(0)], xmm4\t; wk(0)=(B-Y)E\n\tmovdqa\tXMMWORD [wk(1)], xmm5\t; wk(1)=(B-Y)O\n\n\tmovdqa    xmm4,xmm2\n\tmovdqa    xmm5,xmm3\n\tpunpcklwd xmm2,xmm6\n\tpunpckhwd xmm4,xmm6\n\tpmaddwd   xmm2,[GOTOFF(eax,PW_MF0344_F0285)]\n\tpmaddwd   xmm4,[GOTOFF(eax,PW_MF0344_F0285)]\n\tpunpcklwd xmm3,xmm7\n\tpunpckhwd xmm5,xmm7\n\tpmaddwd   xmm3,[GOTOFF(eax,PW_MF0344_F0285)]\n\tpmaddwd   xmm5,[GOTOFF(eax,PW_MF0344_F0285)]\n\n\tpaddd     xmm2,[GOTOFF(eax,PD_ONEHALF)]\n\tpaddd     xmm4,[GOTOFF(eax,PD_ONEHALF)]\n\tpsrad     xmm2,SCALEBITS\n\tpsrad     xmm4,SCALEBITS\n\tpaddd     xmm3,[GOTOFF(eax,PD_ONEHALF)]\n\tpaddd     xmm5,[GOTOFF(eax,PD_ONEHALF)]\n\tpsrad     xmm3,SCALEBITS\n\tpsrad     xmm5,SCALEBITS\n\n\tpackssdw  xmm2,xmm4\t; xmm2=CbE*-FIX(0.344)+CrE*FIX(0.285)\n\tpackssdw  xmm3,xmm5\t; xmm3=CbO*-FIX(0.344)+CrO*FIX(0.285)\n\tpsubw     xmm2,xmm6\t; xmm2=CbE*-FIX(0.344)+CrE*-FIX(0.714)=(G-Y)E\n\tpsubw     xmm3,xmm7\t; xmm3=CbO*-FIX(0.344)+CrO*-FIX(0.714)=(G-Y)O\n\n\tmovdqa    xmm5, XMMWORD [esi]\t; xmm5=Y(0123456789ABCDEF)\n\n\tpcmpeqw   xmm4,xmm4\n\tpsrlw     xmm4,BYTE_BIT\t\t; xmm4={0xFF 0x00 0xFF 0x00 ..}\n\tpand      xmm4,xmm5\t\t; xmm4=Y(02468ACE)=YE\n\tpsrlw     xmm5,BYTE_BIT\t\t; xmm5=Y(13579BDF)=YO\n\n\tpaddw     xmm0,xmm4\t\t; xmm0=((R-Y)E+YE)=RE=R(02468ACE)\n\tpaddw     xmm1,xmm5\t\t; xmm1=((R-Y)O+YO)=RO=R(13579BDF)\n\tpackuswb  xmm0,xmm0\t\t; xmm0=R(02468ACE********)\n\tpackuswb  xmm1,xmm1\t\t; xmm1=R(13579BDF********)\n\n\tpaddw     xmm2,xmm4\t\t; xmm2=((G-Y)E+YE)=GE=G(02468ACE)\n\tpaddw     xmm3,xmm5\t\t; xmm3=((G-Y)O+YO)=GO=G(13579BDF)\n\tpackuswb  xmm2,xmm2\t\t; xmm2=G(02468ACE********)\n\tpackuswb  xmm3,xmm3\t\t; xmm3=G(13579BDF********)\n\n\tpaddw     xmm4, XMMWORD [wk(0)]\t; xmm4=(YE+(B-Y)E)=BE=B(02468ACE)\n\tpaddw     xmm5, XMMWORD [wk(1)]\t; xmm5=(YO+(B-Y)O)=BO=B(13579BDF)\n\tpackuswb  xmm4,xmm4\t\t; xmm4=B(02468ACE********)\n\tpackuswb  xmm5,xmm5\t\t; xmm5=B(13579BDF********)\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n\t; xmmA=(00 02 04 06 08 0A 0C 0E **), xmmB=(01 03 05 07 09 0B 0D 0F **)\n\t; xmmC=(10 12 14 16 18 1A 1C 1E **), xmmD=(11 13 15 17 19 1B 1D 1F **)\n\t; xmmE=(20 22 24 26 28 2A 2C 2E **), xmmF=(21 23 25 27 29 2B 2D 2F **)\n\t; xmmG=(** ** ** ** ** ** ** ** **), xmmH=(** ** ** ** ** ** ** ** **)\n\n\tpunpcklbw xmmA,xmmC\t; xmmA=(00 10 02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E)\n\tpunpcklbw xmmE,xmmB\t; xmmE=(20 01 22 03 24 05 26 07 28 09 2A 0B 2C 0D 2E 0F)\n\tpunpcklbw xmmD,xmmF\t; xmmD=(11 21 13 23 15 25 17 27 19 29 1B 2B 1D 2D 1F 2F)\n\n\tmovdqa    xmmG,xmmA\n\tmovdqa    xmmH,xmmA\n\tpunpcklwd xmmA,xmmE\t; xmmA=(00 10 20 01 02 12 22 03 04 14 24 05 06 16 26 07)\n\tpunpckhwd xmmG,xmmE\t; xmmG=(08 18 28 09 0A 1A 2A 0B 0C 1C 2C 0D 0E 1E 2E 0F)\n\n\tpsrldq    xmmH,2\t; xmmH=(02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E -- --)\n\tpsrldq    xmmE,2\t; xmmE=(22 03 24 05 26 07 28 09 2A 0B 2C 0D 2E 0F -- --)\n\n\tmovdqa    xmmC,xmmD\n\tmovdqa    xmmB,xmmD\n\tpunpcklwd xmmD,xmmH\t; xmmD=(11 21 02 12 13 23 04 14 15 25 06 16 17 27 08 18)\n\tpunpckhwd xmmC,xmmH\t; xmmC=(19 29 0A 1A 1B 2B 0C 1C 1D 2D 0E 1E 1F 2F -- --)\n\n\tpsrldq    xmmB,2\t; xmmB=(13 23 15 25 17 27 19 29 1B 2B 1D 2D 1F 2F -- --)\n\n\tmovdqa    xmmF,xmmE\n\tpunpcklwd xmmE,xmmB\t; xmmE=(22 03 13 23 24 05 15 25 26 07 17 27 28 09 19 29)\n\tpunpckhwd xmmF,xmmB\t; xmmF=(2A 0B 1B 2B 2C 0D 1D 2D 2E 0F 1F 2F -- -- -- --)\n\n\tpshufd    xmmH,xmmA,0x4E; xmmH=(04 14 24 05 06 16 26 07 00 10 20 01 02 12 22 03)\n\tmovdqa    xmmB,xmmE\n\tpunpckldq xmmA,xmmD\t; xmmA=(00 10 20 01 11 21 02 12 02 12 22 03 13 23 04 14)\n\tpunpckldq xmmE,xmmH\t; xmmE=(22 03 13 23 04 14 24 05 24 05 15 25 06 16 26 07)\n\tpunpckhdq xmmD,xmmB\t; xmmD=(15 25 06 16 26 07 17 27 17 27 08 18 28 09 19 29)\n\n\tpshufd    xmmH,xmmG,0x4E; xmmH=(0C 1C 2C 0D 0E 1E 2E 0F 08 18 28 09 0A 1A 2A 0B)\n\tmovdqa    xmmB,xmmF\n\tpunpckldq xmmG,xmmC\t; xmmG=(08 18 28 09 19 29 0A 1A 0A 1A 2A 0B 1B 2B 0C 1C)\n\tpunpckldq xmmF,xmmH\t; xmmF=(2A 0B 1B 2B 0C 1C 2C 0D 2C 0D 1D 2D 0E 1E 2E 0F)\n\tpunpckhdq xmmC,xmmB\t; xmmC=(1D 2D 0E 1E 2E 0F 1F 2F 1F 2F -- -- -- -- -- --)\n\n\tpunpcklqdq xmmA,xmmE\t; xmmA=(00 10 20 01 11 21 02 12 22 03 13 23 04 14 24 05)\n\tpunpcklqdq xmmD,xmmG\t; xmmD=(15 25 06 16 26 07 17 27 08 18 28 09 19 29 0A 1A)\n\tpunpcklqdq xmmF,xmmC\t; xmmF=(2A 0B 1B 2B 0C 1C 2C 0D 1D 2D 0E 1E 2E 0F 1F 2F)\n\n\tcmp\tecx, byte SIZEOF_XMMWORD\n\tjb\tshort .column_st32\n\n\ttest\tedi, SIZEOF_XMMWORD-1\n\tjnz\tshort .out1\n\t; --(aligned)-------------------\n\tmovntdq\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n\tmovntdq\tXMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n\tmovntdq\tXMMWORD [edi+2*SIZEOF_XMMWORD], xmmF\n\tjmp\tshort .out0\n.out1:\t; --(unaligned)-----------------\n\tmovdqu\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n\tmovdqu\tXMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n\tmovdqu\tXMMWORD [edi+2*SIZEOF_XMMWORD], xmmF\n.out0:\n\tadd\tedi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD\t; outptr\n\tsub\tecx, byte SIZEOF_XMMWORD\n\tjz\tnear .nextrow\n\n\tadd\tesi, byte SIZEOF_XMMWORD\t; inptr0\n\tadd\tebx, byte SIZEOF_XMMWORD\t; inptr1\n\tadd\tedx, byte SIZEOF_XMMWORD\t; inptr2\n\tjmp\tnear .columnloop\n\talignx\t16,7\n\n.column_st32:\n\tlea\tecx, [ecx+ecx*2]\t\t; imul ecx, RGB_PIXELSIZE\n\tcmp\tecx, byte 2*SIZEOF_XMMWORD\n\tjb\tshort .column_st16\n\tmovdqu\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n\tmovdqu\tXMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n\tadd\tedi, byte 2*SIZEOF_XMMWORD\t; outptr\n\tmovdqa\txmmA,xmmF\n\tsub\tecx, byte 2*SIZEOF_XMMWORD\n\tjmp\tshort .column_st15\n.column_st16:\n\tcmp\tecx, byte SIZEOF_XMMWORD\n\tjb\tshort .column_st15\n\tmovdqu\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n\tadd\tedi, byte SIZEOF_XMMWORD\t; outptr\n\tmovdqa\txmmA,xmmD\n\tsub\tecx, byte SIZEOF_XMMWORD\n.column_st15:\n\t; Store the lower 8 bytes of xmmA to the output when it has enough\n\t; space.\n\tcmp\tecx, byte SIZEOF_MMWORD\n\tjb\tshort .column_st7\n\tmovq\tXMM_MMWORD [edi], xmmA\n\tadd\tedi, byte SIZEOF_MMWORD\n\tsub\tecx, byte SIZEOF_MMWORD\n\tpsrldq\txmmA, SIZEOF_MMWORD\n.column_st7:\n\t; Store the lower 4 bytes of xmmA to the output when it has enough\n\t; space.\n\tcmp\tecx, byte SIZEOF_DWORD\n\tjb\tshort .column_st3\n\tmovd\tXMM_DWORD [edi], xmmA\n\tadd\tedi, byte SIZEOF_DWORD\n\tsub\tecx, byte SIZEOF_DWORD\n\tpsrldq\txmmA, SIZEOF_DWORD\n.column_st3:\n\t; Store the lower 2 bytes of eax to the output when it has enough\n\t; space.\n\tmovd\teax, xmmA\n\tcmp\tecx, byte SIZEOF_WORD\n\tjb\tshort .column_st1\n\tmov\tWORD [edi], ax\n\tadd\tedi, byte SIZEOF_WORD\n\tsub\tecx, byte SIZEOF_WORD\n\tshr\teax, 16\n.column_st1:\n\t; Store the lower 1 byte of eax to the output when it has enough\n\t; space.\n\ttest\tecx, ecx\n\tjz\tshort .nextrow\n\tmov\tBYTE [edi], al\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n%ifdef RGBX_FILLER_0XFF\n\tpcmpeqb   xmm6,xmm6\t\t; xmm6=XE=X(02468ACE********)\n\tpcmpeqb   xmm7,xmm7\t\t; xmm7=XO=X(13579BDF********)\n%else\n\tpxor      xmm6,xmm6\t\t; xmm6=XE=X(02468ACE********)\n\tpxor      xmm7,xmm7\t\t; xmm7=XO=X(13579BDF********)\n%endif\n\t; xmmA=(00 02 04 06 08 0A 0C 0E **), xmmB=(01 03 05 07 09 0B 0D 0F **)\n\t; xmmC=(10 12 14 16 18 1A 1C 1E **), xmmD=(11 13 15 17 19 1B 1D 1F **)\n\t; xmmE=(20 22 24 26 28 2A 2C 2E **), xmmF=(21 23 25 27 29 2B 2D 2F **)\n\t; xmmG=(30 32 34 36 38 3A 3C 3E **), xmmH=(31 33 35 37 39 3B 3D 3F **)\n\n\tpunpcklbw xmmA,xmmC\t; xmmA=(00 10 02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E)\n\tpunpcklbw xmmE,xmmG\t; xmmE=(20 30 22 32 24 34 26 36 28 38 2A 3A 2C 3C 2E 3E)\n\tpunpcklbw xmmB,xmmD\t; xmmB=(01 11 03 13 05 15 07 17 09 19 0B 1B 0D 1D 0F 1F)\n\tpunpcklbw xmmF,xmmH\t; xmmF=(21 31 23 33 25 35 27 37 29 39 2B 3B 2D 3D 2F 3F)\n\n\tmovdqa    xmmC,xmmA\n\tpunpcklwd xmmA,xmmE\t; xmmA=(00 10 20 30 02 12 22 32 04 14 24 34 06 16 26 36)\n\tpunpckhwd xmmC,xmmE\t; xmmC=(08 18 28 38 0A 1A 2A 3A 0C 1C 2C 3C 0E 1E 2E 3E)\n\tmovdqa    xmmG,xmmB\n\tpunpcklwd xmmB,xmmF\t; xmmB=(01 11 21 31 03 13 23 33 05 15 25 35 07 17 27 37)\n\tpunpckhwd xmmG,xmmF\t; xmmG=(09 19 29 39 0B 1B 2B 3B 0D 1D 2D 3D 0F 1F 2F 3F)\n\n\tmovdqa    xmmD,xmmA\n\tpunpckldq xmmA,xmmB\t; xmmA=(00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33)\n\tpunpckhdq xmmD,xmmB\t; xmmD=(04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37)\n\tmovdqa    xmmH,xmmC\n\tpunpckldq xmmC,xmmG\t; xmmC=(08 18 28 38 09 19 29 39 0A 1A 2A 3A 0B 1B 2B 3B)\n\tpunpckhdq xmmH,xmmG\t; xmmH=(0C 1C 2C 3C 0D 1D 2D 3D 0E 1E 2E 3E 0F 1F 2F 3F)\n\n\tcmp\tecx, byte SIZEOF_XMMWORD\n\tjb\tshort .column_st32\n\n\ttest\tedi, SIZEOF_XMMWORD-1\n\tjnz\tshort .out1\n\t; --(aligned)-------------------\n\tmovntdq\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n\tmovntdq\tXMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n\tmovntdq\tXMMWORD [edi+2*SIZEOF_XMMWORD], xmmC\n\tmovntdq\tXMMWORD [edi+3*SIZEOF_XMMWORD], xmmH\n\tjmp\tshort .out0\n.out1:\t; --(unaligned)-----------------\n\tmovdqu\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n\tmovdqu\tXMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n\tmovdqu\tXMMWORD [edi+2*SIZEOF_XMMWORD], xmmC\n\tmovdqu\tXMMWORD [edi+3*SIZEOF_XMMWORD], xmmH\n.out0:\n\tadd\tedi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD\t; outptr\n\tsub\tecx, byte SIZEOF_XMMWORD\n\tjz\tnear .nextrow\n\n\tadd\tesi, byte SIZEOF_XMMWORD\t; inptr0\n\tadd\tebx, byte SIZEOF_XMMWORD\t; inptr1\n\tadd\tedx, byte SIZEOF_XMMWORD\t; inptr2\n\tjmp\tnear .columnloop\n\talignx\t16,7\n\n.column_st32:\n\tcmp\tecx, byte SIZEOF_XMMWORD/2\n\tjb\tshort .column_st16\n\tmovdqu\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n\tmovdqu\tXMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n\tadd\tedi, byte 2*SIZEOF_XMMWORD\t; outptr\n\tmovdqa\txmmA,xmmC\n\tmovdqa\txmmD,xmmH\n\tsub\tecx, byte SIZEOF_XMMWORD/2\n.column_st16:\n\tcmp\tecx, byte SIZEOF_XMMWORD/4\n\tjb\tshort .column_st15\n\tmovdqu\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n\tadd\tedi, byte SIZEOF_XMMWORD\t; outptr\n\tmovdqa\txmmA,xmmD\n\tsub\tecx, byte SIZEOF_XMMWORD/4\n.column_st15:\n\t; Store two pixels (8 bytes) of xmmA to the output when it has enough\n\t; space.\n\tcmp\tecx, byte SIZEOF_XMMWORD/8\n\tjb\tshort .column_st7\n\tmovq\tXMM_MMWORD [edi], xmmA\n\tadd\tedi, byte SIZEOF_XMMWORD/8*4\n\tsub\tecx, byte SIZEOF_XMMWORD/8\n\tpsrldq\txmmA, SIZEOF_XMMWORD/8*4\n.column_st7:\n\t; Store one pixel (4 bytes) of xmmA to the output when it has enough\n\t; space.\n\ttest\tecx, ecx\n\tjz\tshort .nextrow\n\tmovd\tXMM_DWORD [edi], xmmA\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n\talignx\t16,7\n\n.nextrow:\n\tpop\tecx\n\tpop\tesi\n\tpop\tebx\n\tpop\tedx\n\tpop\tedi\n\tpop\teax\n\n\tadd\tesi, byte SIZEOF_JSAMPROW\n\tadd\tebx, byte SIZEOF_JSAMPROW\n\tadd\tedx, byte SIZEOF_JSAMPROW\n\tadd\tedi, byte SIZEOF_JSAMPROW\t; output_buf\n\tdec\teax\t\t\t\t; num_rows\n\tjg\tnear .rowloop\n\n\tsfence\t\t; flush the write buffer\n\n.return:\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jdcolmmx.asm",
    "content": ";\n; jdcolmmx.asm - colorspace conversion (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2009 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS\t16\n\nF_0_344\tequ\t 22554\t\t\t; FIX(0.34414)\nF_0_714\tequ\t 46802\t\t\t; FIX(0.71414)\nF_1_402\tequ\t 91881\t\t\t; FIX(1.40200)\nF_1_772\tequ\t116130\t\t\t; FIX(1.77200)\nF_0_402\tequ\t(F_1_402 - 65536)\t; FIX(1.40200) - FIX(1)\nF_0_285\tequ\t( 65536 - F_0_714)\t; FIX(1) - FIX(0.71414)\nF_0_228\tequ\t(131072 - F_1_772)\t; FIX(2) - FIX(1.77200)\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_ycc_rgb_convert_mmx)\n\nEXTN(jconst_ycc_rgb_convert_mmx):\n\nPW_F0402\ttimes 4 dw  F_0_402\nPW_MF0228\ttimes 4 dw -F_0_228\nPW_MF0344_F0285\ttimes 2 dw -F_0_344, F_0_285\nPW_ONE\t\ttimes 4 dw  1\nPD_ONEHALF\ttimes 2 dd  1 << (SCALEBITS-1)\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n\n%include \"jdclrmmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_ycc_rgb_convert_mmx jsimd_ycc_extrgb_convert_mmx\n%include \"jdclrmmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_ycc_rgb_convert_mmx jsimd_ycc_extrgbx_convert_mmx\n%include \"jdclrmmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_ycc_rgb_convert_mmx jsimd_ycc_extbgr_convert_mmx\n%include \"jdclrmmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_ycc_rgb_convert_mmx jsimd_ycc_extbgrx_convert_mmx\n%include \"jdclrmmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_ycc_rgb_convert_mmx jsimd_ycc_extxbgr_convert_mmx\n%include \"jdclrmmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_ycc_rgb_convert_mmx jsimd_ycc_extxrgb_convert_mmx\n%include \"jdclrmmx.asm\"\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jdcolss2-64.asm",
    "content": ";\n; jdcolss2-64.asm - colorspace conversion (64-bit SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2009 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS\t16\n\nF_0_344\tequ\t 22554\t\t\t; FIX(0.34414)\nF_0_714\tequ\t 46802\t\t\t; FIX(0.71414)\nF_1_402\tequ\t 91881\t\t\t; FIX(1.40200)\nF_1_772\tequ\t116130\t\t\t; FIX(1.77200)\nF_0_402\tequ\t(F_1_402 - 65536)\t; FIX(1.40200) - FIX(1)\nF_0_285\tequ\t( 65536 - F_0_714)\t; FIX(1) - FIX(0.71414)\nF_0_228\tequ\t(131072 - F_1_772)\t; FIX(2) - FIX(1.77200)\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_ycc_rgb_convert_sse2)\n\nEXTN(jconst_ycc_rgb_convert_sse2):\n\nPW_F0402\ttimes 8 dw  F_0_402\nPW_MF0228\ttimes 8 dw -F_0_228\nPW_MF0344_F0285\ttimes 4 dw -F_0_344, F_0_285\nPW_ONE\t\ttimes 8 dw  1\nPD_ONEHALF\ttimes 4 dd  1 << (SCALEBITS-1)\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t64\n\n%include \"jdclrss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extrgb_convert_sse2\n%include \"jdclrss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extrgbx_convert_sse2\n%include \"jdclrss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extbgr_convert_sse2\n%include \"jdclrss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extbgrx_convert_sse2\n%include \"jdclrss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extxbgr_convert_sse2\n%include \"jdclrss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extxrgb_convert_sse2\n%include \"jdclrss2-64.asm\"\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jdcolss2.asm",
    "content": ";\n; jdcolss2.asm - colorspace conversion (SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2009 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS\t16\n\nF_0_344\tequ\t 22554\t\t\t; FIX(0.34414)\nF_0_714\tequ\t 46802\t\t\t; FIX(0.71414)\nF_1_402\tequ\t 91881\t\t\t; FIX(1.40200)\nF_1_772\tequ\t116130\t\t\t; FIX(1.77200)\nF_0_402\tequ\t(F_1_402 - 65536)\t; FIX(1.40200) - FIX(1)\nF_0_285\tequ\t( 65536 - F_0_714)\t; FIX(1) - FIX(0.71414)\nF_0_228\tequ\t(131072 - F_1_772)\t; FIX(2) - FIX(1.77200)\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_ycc_rgb_convert_sse2)\n\nEXTN(jconst_ycc_rgb_convert_sse2):\n\nPW_F0402\ttimes 8 dw  F_0_402\nPW_MF0228\ttimes 8 dw -F_0_228\nPW_MF0344_F0285\ttimes 4 dw -F_0_344, F_0_285\nPW_ONE\t\ttimes 8 dw  1\nPD_ONEHALF\ttimes 4 dd  1 << (SCALEBITS-1)\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n\n%include \"jdclrss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extrgb_convert_sse2\n%include \"jdclrss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extrgbx_convert_sse2\n%include \"jdclrss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extbgr_convert_sse2\n%include \"jdclrss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extbgrx_convert_sse2\n%include \"jdclrss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extxbgr_convert_sse2\n%include \"jdclrss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_ycc_rgb_convert_sse2 jsimd_ycc_extxrgb_convert_sse2\n%include \"jdclrss2.asm\"\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jdct.inc",
    "content": ";\n; jdct.inc - private declarations for forward & reverse DCT subsystems\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; [TAB8]\n\n; Each IDCT routine is responsible for range-limiting its results and\n; converting them to unsigned form (0..MAXJSAMPLE).  The raw outputs could\n; be quite far out of range if the input data is corrupt, so a bulletproof\n; range-limiting step is required.  We use a mask-and-table-lookup method\n; to do the combined operations quickly.\n;\n%define RANGE_MASK  (MAXJSAMPLE * 4 + 3)  ; 2 bits wider than legal samples\n\n%define ROW(n,b,s)\t\t((b)+(n)*(s))\n%define COL(n,b,s)\t\t((b)+(n)*(s)*DCTSIZE)\n\n%define DWBLOCK(m,n,b,s)\t((b)+(m)*DCTSIZE*(s)+(n)*SIZEOF_DWORD)\n%define MMBLOCK(m,n,b,s)\t((b)+(m)*DCTSIZE*(s)+(n)*SIZEOF_MMWORD)\n%define XMMBLOCK(m,n,b,s)\t((b)+(m)*DCTSIZE*(s)+(n)*SIZEOF_XMMWORD)\n\n; --------------------------------------------------------------------------\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jdmermmx.asm",
    "content": ";\n; jdmermmx.asm - merged upsampling/color conversion (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2009 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS\t16\n\nF_0_344\tequ\t 22554\t\t\t; FIX(0.34414)\nF_0_714\tequ\t 46802\t\t\t; FIX(0.71414)\nF_1_402\tequ\t 91881\t\t\t; FIX(1.40200)\nF_1_772\tequ\t116130\t\t\t; FIX(1.77200)\nF_0_402\tequ\t(F_1_402 - 65536)\t; FIX(1.40200) - FIX(1)\nF_0_285\tequ\t( 65536 - F_0_714)\t; FIX(1) - FIX(0.71414)\nF_0_228\tequ\t(131072 - F_1_772)\t; FIX(2) - FIX(1.77200)\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_merged_upsample_mmx)\n\nEXTN(jconst_merged_upsample_mmx):\n\nPW_F0402\ttimes 4 dw  F_0_402\nPW_MF0228\ttimes 4 dw -F_0_228\nPW_MF0344_F0285\ttimes 2 dw -F_0_344, F_0_285\nPW_ONE\t\ttimes 4 dw  1\nPD_ONEHALF\ttimes 2 dd  1 << (SCALEBITS-1)\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n\n%include \"jdmrgmmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_mmx jsimd_h2v1_extrgb_merged_upsample_mmx\n%define jsimd_h2v2_merged_upsample_mmx jsimd_h2v2_extrgb_merged_upsample_mmx\n%include \"jdmrgmmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_mmx jsimd_h2v1_extrgbx_merged_upsample_mmx\n%define jsimd_h2v2_merged_upsample_mmx jsimd_h2v2_extrgbx_merged_upsample_mmx\n%include \"jdmrgmmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_mmx jsimd_h2v1_extbgr_merged_upsample_mmx\n%define jsimd_h2v2_merged_upsample_mmx jsimd_h2v2_extbgr_merged_upsample_mmx\n%include \"jdmrgmmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_mmx jsimd_h2v1_extbgrx_merged_upsample_mmx\n%define jsimd_h2v2_merged_upsample_mmx jsimd_h2v2_extbgrx_merged_upsample_mmx\n%include \"jdmrgmmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_mmx jsimd_h2v1_extxbgr_merged_upsample_mmx\n%define jsimd_h2v2_merged_upsample_mmx jsimd_h2v2_extxbgr_merged_upsample_mmx\n%include \"jdmrgmmx.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_mmx jsimd_h2v1_extxrgb_merged_upsample_mmx\n%define jsimd_h2v2_merged_upsample_mmx jsimd_h2v2_extxrgb_merged_upsample_mmx\n%include \"jdmrgmmx.asm\"\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jdmerss2-64.asm",
    "content": ";\n; jdmerss2-64.asm - merged upsampling/color conversion (64-bit SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2009 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS\t16\n\nF_0_344\tequ\t 22554\t\t\t; FIX(0.34414)\nF_0_714\tequ\t 46802\t\t\t; FIX(0.71414)\nF_1_402\tequ\t 91881\t\t\t; FIX(1.40200)\nF_1_772\tequ\t116130\t\t\t; FIX(1.77200)\nF_0_402\tequ\t(F_1_402 - 65536)\t; FIX(1.40200) - FIX(1)\nF_0_285\tequ\t( 65536 - F_0_714)\t; FIX(1) - FIX(0.71414)\nF_0_228\tequ\t(131072 - F_1_772)\t; FIX(2) - FIX(1.77200)\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_merged_upsample_sse2)\n\nEXTN(jconst_merged_upsample_sse2):\n\nPW_F0402\ttimes 8 dw  F_0_402\nPW_MF0228\ttimes 8 dw -F_0_228\nPW_MF0344_F0285\ttimes 4 dw -F_0_344, F_0_285\nPW_ONE\t\ttimes 8 dw  1\nPD_ONEHALF\ttimes 4 dd  1 << (SCALEBITS-1)\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t64\n\n%include \"jdmrgss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extrgb_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extrgb_merged_upsample_sse2\n%include \"jdmrgss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extrgbx_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extrgbx_merged_upsample_sse2\n%include \"jdmrgss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extbgr_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extbgr_merged_upsample_sse2\n%include \"jdmrgss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extbgrx_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extbgrx_merged_upsample_sse2\n%include \"jdmrgss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extxbgr_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extxbgr_merged_upsample_sse2\n%include \"jdmrgss2-64.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extxrgb_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extxrgb_merged_upsample_sse2\n%include \"jdmrgss2-64.asm\"\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jdmerss2.asm",
    "content": ";\n; jdmerss2.asm - merged upsampling/color conversion (SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2009 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\n%define SCALEBITS\t16\n\nF_0_344\tequ\t 22554\t\t\t; FIX(0.34414)\nF_0_714\tequ\t 46802\t\t\t; FIX(0.71414)\nF_1_402\tequ\t 91881\t\t\t; FIX(1.40200)\nF_1_772\tequ\t116130\t\t\t; FIX(1.77200)\nF_0_402\tequ\t(F_1_402 - 65536)\t; FIX(1.40200) - FIX(1)\nF_0_285\tequ\t( 65536 - F_0_714)\t; FIX(1) - FIX(0.71414)\nF_0_228\tequ\t(131072 - F_1_772)\t; FIX(2) - FIX(1.77200)\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_merged_upsample_sse2)\n\nEXTN(jconst_merged_upsample_sse2):\n\nPW_F0402\ttimes 8 dw  F_0_402\nPW_MF0228\ttimes 8 dw -F_0_228\nPW_MF0344_F0285\ttimes 4 dw -F_0_344, F_0_285\nPW_ONE\t\ttimes 8 dw  1\nPD_ONEHALF\ttimes 4 dd  1 << (SCALEBITS-1)\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n\n%include \"jdmrgss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGB_RED\n%define RGB_GREEN EXT_RGB_GREEN\n%define RGB_BLUE EXT_RGB_BLUE\n%define RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extrgb_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extrgb_merged_upsample_sse2\n%include \"jdmrgss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_RGBX_RED\n%define RGB_GREEN EXT_RGBX_GREEN\n%define RGB_BLUE EXT_RGBX_BLUE\n%define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extrgbx_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extrgbx_merged_upsample_sse2\n%include \"jdmrgss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGR_RED\n%define RGB_GREEN EXT_BGR_GREEN\n%define RGB_BLUE EXT_BGR_BLUE\n%define RGB_PIXELSIZE EXT_BGR_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extbgr_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extbgr_merged_upsample_sse2\n%include \"jdmrgss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_BGRX_RED\n%define RGB_GREEN EXT_BGRX_GREEN\n%define RGB_BLUE EXT_BGRX_BLUE\n%define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extbgrx_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extbgrx_merged_upsample_sse2\n%include \"jdmrgss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XBGR_RED\n%define RGB_GREEN EXT_XBGR_GREEN\n%define RGB_BLUE EXT_XBGR_BLUE\n%define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extxbgr_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extxbgr_merged_upsample_sse2\n%include \"jdmrgss2.asm\"\n\n%undef RGB_RED\n%undef RGB_GREEN\n%undef RGB_BLUE\n%undef RGB_PIXELSIZE\n%define RGB_RED EXT_XRGB_RED\n%define RGB_GREEN EXT_XRGB_GREEN\n%define RGB_BLUE EXT_XRGB_BLUE\n%define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n%define jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_extxrgb_merged_upsample_sse2\n%define jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_extxrgb_merged_upsample_sse2\n%include \"jdmrgss2.asm\"\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jdmrgmmx.asm",
    "content": ";\n; jdmrgmmx.asm - merged upsampling/color conversion (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\n; --------------------------------------------------------------------------\n;\n; Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical.\n;\n; GLOBAL(void)\n; jsimd_h2v1_merged_upsample_mmx (JDIMENSION output_width,\n;                                 JSAMPIMAGE input_buf,\n;                                 JDIMENSION in_row_group_ctr,\n;                                 JSAMPARRAY output_buf);\n;\n\n%define output_width(b)\t(b)+8\t\t\t; JDIMENSION output_width\n%define input_buf(b)\t\t(b)+12\t\t; JSAMPIMAGE input_buf\n%define in_row_group_ctr(b)\t(b)+16\t\t; JDIMENSION in_row_group_ctr\n%define output_buf(b)\t\t(b)+20\t\t; JSAMPARRAY output_buf\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_MMWORD\t; mmword wk[WK_NUM]\n%define WK_NUM\t\t3\n%define gotptr\t\twk(0)-SIZEOF_POINTER\t; void * gotptr\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v1_merged_upsample_mmx)\n\nEXTN(jsimd_h2v1_merged_upsample_mmx):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_MMWORD)\t; align to 64 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [wk(0)]\n\tpushpic\teax\t\t; make a room for GOT address\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t\t; get GOT address\n\tmovpic\tPOINTER [gotptr], ebx\t; save GOT address\n\n\tmov\tecx, JDIMENSION [output_width(eax)]\t; col\n\ttest\tecx,ecx\n\tjz\tnear .return\n\n\tpush\tecx\n\n\tmov\tedi, JSAMPIMAGE [input_buf(eax)]\n\tmov\tecx, JDIMENSION [in_row_group_ctr(eax)]\n\tmov\tesi, JSAMPARRAY [edi+0*SIZEOF_JSAMPARRAY]\n\tmov\tebx, JSAMPARRAY [edi+1*SIZEOF_JSAMPARRAY]\n\tmov\tedx, JSAMPARRAY [edi+2*SIZEOF_JSAMPARRAY]\n\tmov\tedi, JSAMPARRAY [output_buf(eax)]\n\tmov\tesi, JSAMPROW [esi+ecx*SIZEOF_JSAMPROW]\t\t; inptr0\n\tmov\tebx, JSAMPROW [ebx+ecx*SIZEOF_JSAMPROW]\t\t; inptr1\n\tmov\tedx, JSAMPROW [edx+ecx*SIZEOF_JSAMPROW]\t\t; inptr2\n\tmov\tedi, JSAMPROW [edi]\t\t\t\t; outptr\n\n\tpop\tecx\t\t\t; col\n\n\talignx\t16,7\n.columnloop:\n\tmovpic\teax, POINTER [gotptr]\t; load GOT address (eax)\n\n\tmovq      mm6, MMWORD [ebx]\t; mm6=Cb(01234567)\n\tmovq      mm7, MMWORD [edx]\t; mm7=Cr(01234567)\n\n\tpxor      mm1,mm1\t\t; mm1=(all 0's)\n\tpcmpeqw   mm3,mm3\n\tpsllw     mm3,7\t\t\t; mm3={0xFF80 0xFF80 0xFF80 0xFF80}\n\n\tmovq      mm4,mm6\n\tpunpckhbw mm6,mm1\t\t; mm6=Cb(4567)=CbH\n\tpunpcklbw mm4,mm1\t\t; mm4=Cb(0123)=CbL\n\tmovq      mm0,mm7\n\tpunpckhbw mm7,mm1\t\t; mm7=Cr(4567)=CrH\n\tpunpcklbw mm0,mm1\t\t; mm0=Cr(0123)=CrL\n\n\tpaddw     mm6,mm3\n\tpaddw     mm4,mm3\n\tpaddw     mm7,mm3\n\tpaddw     mm0,mm3\n\n\t; (Original)\n\t; R = Y                + 1.40200 * Cr\n\t; G = Y - 0.34414 * Cb - 0.71414 * Cr\n\t; B = Y + 1.77200 * Cb\n\t;\n\t; (This implementation)\n\t; R = Y                + 0.40200 * Cr + Cr\n\t; G = Y - 0.34414 * Cb + 0.28586 * Cr - Cr\n\t; B = Y - 0.22800 * Cb + Cb + Cb\n\n\tmovq\tmm5,mm6\t\t\t; mm5=CbH\n\tmovq\tmm2,mm4\t\t\t; mm2=CbL\n\tpaddw\tmm6,mm6\t\t\t; mm6=2*CbH\n\tpaddw\tmm4,mm4\t\t\t; mm4=2*CbL\n\tmovq\tmm1,mm7\t\t\t; mm1=CrH\n\tmovq\tmm3,mm0\t\t\t; mm3=CrL\n\tpaddw\tmm7,mm7\t\t\t; mm7=2*CrH\n\tpaddw\tmm0,mm0\t\t\t; mm0=2*CrL\n\n\tpmulhw\tmm6,[GOTOFF(eax,PW_MF0228)]\t; mm6=(2*CbH * -FIX(0.22800))\n\tpmulhw\tmm4,[GOTOFF(eax,PW_MF0228)]\t; mm4=(2*CbL * -FIX(0.22800))\n\tpmulhw\tmm7,[GOTOFF(eax,PW_F0402)]\t; mm7=(2*CrH * FIX(0.40200))\n\tpmulhw\tmm0,[GOTOFF(eax,PW_F0402)]\t; mm0=(2*CrL * FIX(0.40200))\n\n\tpaddw\tmm6,[GOTOFF(eax,PW_ONE)]\n\tpaddw\tmm4,[GOTOFF(eax,PW_ONE)]\n\tpsraw\tmm6,1\t\t\t; mm6=(CbH * -FIX(0.22800))\n\tpsraw\tmm4,1\t\t\t; mm4=(CbL * -FIX(0.22800))\n\tpaddw\tmm7,[GOTOFF(eax,PW_ONE)]\n\tpaddw\tmm0,[GOTOFF(eax,PW_ONE)]\n\tpsraw\tmm7,1\t\t\t; mm7=(CrH * FIX(0.40200))\n\tpsraw\tmm0,1\t\t\t; mm0=(CrL * FIX(0.40200))\n\n\tpaddw\tmm6,mm5\n\tpaddw\tmm4,mm2\n\tpaddw\tmm6,mm5\t\t\t; mm6=(CbH * FIX(1.77200))=(B-Y)H\n\tpaddw\tmm4,mm2\t\t\t; mm4=(CbL * FIX(1.77200))=(B-Y)L\n\tpaddw\tmm7,mm1\t\t\t; mm7=(CrH * FIX(1.40200))=(R-Y)H\n\tpaddw\tmm0,mm3\t\t\t; mm0=(CrL * FIX(1.40200))=(R-Y)L\n\n\tmovq\tMMWORD [wk(0)], mm6\t; wk(0)=(B-Y)H\n\tmovq\tMMWORD [wk(1)], mm7\t; wk(1)=(R-Y)H\n\n\tmovq      mm6,mm5\n\tmovq      mm7,mm2\n\tpunpcklwd mm5,mm1\n\tpunpckhwd mm6,mm1\n\tpmaddwd   mm5,[GOTOFF(eax,PW_MF0344_F0285)]\n\tpmaddwd   mm6,[GOTOFF(eax,PW_MF0344_F0285)]\n\tpunpcklwd mm2,mm3\n\tpunpckhwd mm7,mm3\n\tpmaddwd   mm2,[GOTOFF(eax,PW_MF0344_F0285)]\n\tpmaddwd   mm7,[GOTOFF(eax,PW_MF0344_F0285)]\n\n\tpaddd     mm5,[GOTOFF(eax,PD_ONEHALF)]\n\tpaddd     mm6,[GOTOFF(eax,PD_ONEHALF)]\n\tpsrad     mm5,SCALEBITS\n\tpsrad     mm6,SCALEBITS\n\tpaddd     mm2,[GOTOFF(eax,PD_ONEHALF)]\n\tpaddd     mm7,[GOTOFF(eax,PD_ONEHALF)]\n\tpsrad     mm2,SCALEBITS\n\tpsrad     mm7,SCALEBITS\n\n\tpackssdw  mm5,mm6\t; mm5=CbH*-FIX(0.344)+CrH*FIX(0.285)\n\tpackssdw  mm2,mm7\t; mm2=CbL*-FIX(0.344)+CrL*FIX(0.285)\n\tpsubw     mm5,mm1\t; mm5=CbH*-FIX(0.344)+CrH*-FIX(0.714)=(G-Y)H\n\tpsubw     mm2,mm3\t; mm2=CbL*-FIX(0.344)+CrL*-FIX(0.714)=(G-Y)L\n\n\tmovq\tMMWORD [wk(2)], mm5\t; wk(2)=(G-Y)H\n\n\tmov\tal,2\t\t\t; Yctr\n\tjmp\tshort .Yloop_1st\n\talignx\t16,7\n\n.Yloop_2nd:\n\tmovq\tmm0, MMWORD [wk(1)]\t; mm0=(R-Y)H\n\tmovq\tmm2, MMWORD [wk(2)]\t; mm2=(G-Y)H\n\tmovq\tmm4, MMWORD [wk(0)]\t; mm4=(B-Y)H\n\talignx\t16,7\n\n.Yloop_1st:\n\tmovq\tmm7, MMWORD [esi]\t; mm7=Y(01234567)\n\n\tpcmpeqw\tmm6,mm6\n\tpsrlw\tmm6,BYTE_BIT\t\t; mm6={0xFF 0x00 0xFF 0x00 ..}\n\tpand\tmm6,mm7\t\t\t; mm6=Y(0246)=YE\n\tpsrlw\tmm7,BYTE_BIT\t\t; mm7=Y(1357)=YO\n\n\tmovq\tmm1,mm0\t\t\t; mm1=mm0=(R-Y)(L/H)\n\tmovq\tmm3,mm2\t\t\t; mm3=mm2=(G-Y)(L/H)\n\tmovq\tmm5,mm4\t\t\t; mm5=mm4=(B-Y)(L/H)\n\n\tpaddw     mm0,mm6\t\t; mm0=((R-Y)+YE)=RE=(R0 R2 R4 R6)\n\tpaddw     mm1,mm7\t\t; mm1=((R-Y)+YO)=RO=(R1 R3 R5 R7)\n\tpackuswb  mm0,mm0\t\t; mm0=(R0 R2 R4 R6 ** ** ** **)\n\tpackuswb  mm1,mm1\t\t; mm1=(R1 R3 R5 R7 ** ** ** **)\n\n\tpaddw     mm2,mm6\t\t; mm2=((G-Y)+YE)=GE=(G0 G2 G4 G6)\n\tpaddw     mm3,mm7\t\t; mm3=((G-Y)+YO)=GO=(G1 G3 G5 G7)\n\tpackuswb  mm2,mm2\t\t; mm2=(G0 G2 G4 G6 ** ** ** **)\n\tpackuswb  mm3,mm3\t\t; mm3=(G1 G3 G5 G7 ** ** ** **)\n\n\tpaddw     mm4,mm6\t\t; mm4=((B-Y)+YE)=BE=(B0 B2 B4 B6)\n\tpaddw     mm5,mm7\t\t; mm5=((B-Y)+YO)=BO=(B1 B3 B5 B7)\n\tpackuswb  mm4,mm4\t\t; mm4=(B0 B2 B4 B6 ** ** ** **)\n\tpackuswb  mm5,mm5\t\t; mm5=(B1 B3 B5 B7 ** ** ** **)\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n\t; mmA=(00 02 04 06 ** ** ** **), mmB=(01 03 05 07 ** ** ** **)\n\t; mmC=(10 12 14 16 ** ** ** **), mmD=(11 13 15 17 ** ** ** **)\n\t; mmE=(20 22 24 26 ** ** ** **), mmF=(21 23 25 27 ** ** ** **)\n\t; mmG=(** ** ** ** ** ** ** **), mmH=(** ** ** ** ** ** ** **)\n\n\tpunpcklbw mmA,mmC\t\t; mmA=(00 10 02 12 04 14 06 16)\n\tpunpcklbw mmE,mmB\t\t; mmE=(20 01 22 03 24 05 26 07)\n\tpunpcklbw mmD,mmF\t\t; mmD=(11 21 13 23 15 25 17 27)\n\n\tmovq      mmG,mmA\n\tmovq      mmH,mmA\n\tpunpcklwd mmA,mmE\t\t; mmA=(00 10 20 01 02 12 22 03)\n\tpunpckhwd mmG,mmE\t\t; mmG=(04 14 24 05 06 16 26 07)\n\n\tpsrlq     mmH,2*BYTE_BIT\t; mmH=(02 12 04 14 06 16 -- --)\n\tpsrlq     mmE,2*BYTE_BIT\t; mmE=(22 03 24 05 26 07 -- --)\n\n\tmovq      mmC,mmD\n\tmovq      mmB,mmD\n\tpunpcklwd mmD,mmH\t\t; mmD=(11 21 02 12 13 23 04 14)\n\tpunpckhwd mmC,mmH\t\t; mmC=(15 25 06 16 17 27 -- --)\n\n\tpsrlq     mmB,2*BYTE_BIT\t; mmB=(13 23 15 25 17 27 -- --)\n\n\tmovq      mmF,mmE\n\tpunpcklwd mmE,mmB\t\t; mmE=(22 03 13 23 24 05 15 25)\n\tpunpckhwd mmF,mmB\t\t; mmF=(26 07 17 27 -- -- -- --)\n\n\tpunpckldq mmA,mmD\t\t; mmA=(00 10 20 01 11 21 02 12)\n\tpunpckldq mmE,mmG\t\t; mmE=(22 03 13 23 04 14 24 05)\n\tpunpckldq mmC,mmF\t\t; mmC=(15 25 06 16 26 07 17 27)\n\n\tcmp\tecx, byte SIZEOF_MMWORD\n\tjb\tshort .column_st16\n\n\tmovq\tMMWORD [edi+0*SIZEOF_MMWORD], mmA\n\tmovq\tMMWORD [edi+1*SIZEOF_MMWORD], mmE\n\tmovq\tMMWORD [edi+2*SIZEOF_MMWORD], mmC\n\n\tsub\tecx, byte SIZEOF_MMWORD\n\tjz\tnear .endcolumn\n\n\tadd\tedi, byte RGB_PIXELSIZE*SIZEOF_MMWORD\t; outptr\n\tadd\tesi, byte SIZEOF_MMWORD\t\t\t; inptr0\n\tdec\tal\t\t\t; Yctr\n\tjnz\tnear .Yloop_2nd\n\n\tadd\tebx, byte SIZEOF_MMWORD\t\t\t; inptr1\n\tadd\tedx, byte SIZEOF_MMWORD\t\t\t; inptr2\n\tjmp\tnear .columnloop\n\talignx\t16,7\n\n.column_st16:\n\tlea\tecx, [ecx+ecx*2]\t; imul ecx, RGB_PIXELSIZE\n\tcmp\tecx, byte 2*SIZEOF_MMWORD\n\tjb\tshort .column_st8\n\tmovq\tMMWORD [edi+0*SIZEOF_MMWORD], mmA\n\tmovq\tMMWORD [edi+1*SIZEOF_MMWORD], mmE\n\tmovq\tmmA,mmC\n\tsub\tecx, byte 2*SIZEOF_MMWORD\n\tadd\tedi, byte 2*SIZEOF_MMWORD\n\tjmp\tshort .column_st4\n.column_st8:\n\tcmp\tecx, byte SIZEOF_MMWORD\n\tjb\tshort .column_st4\n\tmovq\tMMWORD [edi+0*SIZEOF_MMWORD], mmA\n\tmovq\tmmA,mmE\n\tsub\tecx, byte SIZEOF_MMWORD\n\tadd\tedi, byte SIZEOF_MMWORD\n.column_st4:\n\tmovd\teax,mmA\n\tcmp\tecx, byte SIZEOF_DWORD\n\tjb\tshort .column_st2\n\tmov\tDWORD [edi+0*SIZEOF_DWORD], eax\n\tpsrlq\tmmA,DWORD_BIT\n\tmovd\teax,mmA\n\tsub\tecx, byte SIZEOF_DWORD\n\tadd\tedi, byte SIZEOF_DWORD\n.column_st2:\n\tcmp\tecx, byte SIZEOF_WORD\n\tjb\tshort .column_st1\n\tmov\tWORD [edi+0*SIZEOF_WORD], ax\n\tshr\teax,WORD_BIT\n\tsub\tecx, byte SIZEOF_WORD\n\tadd\tedi, byte SIZEOF_WORD\n.column_st1:\n\tcmp\tecx, byte SIZEOF_BYTE\n\tjb\tshort .endcolumn\n\tmov\tBYTE [edi+0*SIZEOF_BYTE], al\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n%ifdef RGBX_FILLER_0XFF\n\tpcmpeqb   mm6,mm6\t\t; mm6=(X0 X2 X4 X6 ** ** ** **)\n\tpcmpeqb   mm7,mm7\t\t; mm7=(X1 X3 X5 X7 ** ** ** **)\n%else\n\tpxor      mm6,mm6\t\t; mm6=(X0 X2 X4 X6 ** ** ** **)\n\tpxor      mm7,mm7\t\t; mm7=(X1 X3 X5 X7 ** ** ** **)\n%endif\n\t; mmA=(00 02 04 06 ** ** ** **), mmB=(01 03 05 07 ** ** ** **)\n\t; mmC=(10 12 14 16 ** ** ** **), mmD=(11 13 15 17 ** ** ** **)\n\t; mmE=(20 22 24 26 ** ** ** **), mmF=(21 23 25 27 ** ** ** **)\n\t; mmG=(30 32 34 36 ** ** ** **), mmH=(31 33 35 37 ** ** ** **)\n\n\tpunpcklbw mmA,mmC\t\t; mmA=(00 10 02 12 04 14 06 16)\n\tpunpcklbw mmE,mmG\t\t; mmE=(20 30 22 32 24 34 26 36)\n\tpunpcklbw mmB,mmD\t\t; mmB=(01 11 03 13 05 15 07 17)\n\tpunpcklbw mmF,mmH\t\t; mmF=(21 31 23 33 25 35 27 37)\n\n\tmovq      mmC,mmA\n\tpunpcklwd mmA,mmE\t\t; mmA=(00 10 20 30 02 12 22 32)\n\tpunpckhwd mmC,mmE\t\t; mmC=(04 14 24 34 06 16 26 36)\n\tmovq      mmG,mmB\n\tpunpcklwd mmB,mmF\t\t; mmB=(01 11 21 31 03 13 23 33)\n\tpunpckhwd mmG,mmF\t\t; mmG=(05 15 25 35 07 17 27 37)\n\n\tmovq      mmD,mmA\n\tpunpckldq mmA,mmB\t\t; mmA=(00 10 20 30 01 11 21 31)\n\tpunpckhdq mmD,mmB\t\t; mmD=(02 12 22 32 03 13 23 33)\n\tmovq      mmH,mmC\n\tpunpckldq mmC,mmG\t\t; mmC=(04 14 24 34 05 15 25 35)\n\tpunpckhdq mmH,mmG\t\t; mmH=(06 16 26 36 07 17 27 37)\n\n\tcmp\tecx, byte SIZEOF_MMWORD\n\tjb\tshort .column_st16\n\n\tmovq\tMMWORD [edi+0*SIZEOF_MMWORD], mmA\n\tmovq\tMMWORD [edi+1*SIZEOF_MMWORD], mmD\n\tmovq\tMMWORD [edi+2*SIZEOF_MMWORD], mmC\n\tmovq\tMMWORD [edi+3*SIZEOF_MMWORD], mmH\n\n\tsub\tecx, byte SIZEOF_MMWORD\n\tjz\tshort .endcolumn\n\n\tadd\tedi, byte RGB_PIXELSIZE*SIZEOF_MMWORD\t; outptr\n\tadd\tesi, byte SIZEOF_MMWORD\t\t\t; inptr0\n\tdec\tal\t\t\t; Yctr\n\tjnz\tnear .Yloop_2nd\n\n\tadd\tebx, byte SIZEOF_MMWORD\t\t\t; inptr1\n\tadd\tedx, byte SIZEOF_MMWORD\t\t\t; inptr2\n\tjmp\tnear .columnloop\n\talignx\t16,7\n\n.column_st16:\n\tcmp\tecx, byte SIZEOF_MMWORD/2\n\tjb\tshort .column_st8\n\tmovq\tMMWORD [edi+0*SIZEOF_MMWORD], mmA\n\tmovq\tMMWORD [edi+1*SIZEOF_MMWORD], mmD\n\tmovq\tmmA,mmC\n\tmovq\tmmD,mmH\n\tsub\tecx, byte SIZEOF_MMWORD/2\n\tadd\tedi, byte 2*SIZEOF_MMWORD\n.column_st8:\n\tcmp\tecx, byte SIZEOF_MMWORD/4\n\tjb\tshort .column_st4\n\tmovq\tMMWORD [edi+0*SIZEOF_MMWORD], mmA\n\tmovq\tmmA,mmD\n\tsub\tecx, byte SIZEOF_MMWORD/4\n\tadd\tedi, byte 1*SIZEOF_MMWORD\n.column_st4:\n\tcmp\tecx, byte SIZEOF_MMWORD/8\n\tjb\tshort .endcolumn\n\tmovd\tDWORD [edi+0*SIZEOF_DWORD], mmA\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n.endcolumn:\n\temms\t\t; empty MMX state\n\n.return:\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; --------------------------------------------------------------------------\n;\n; Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical.\n;\n; GLOBAL(void)\n; jsimd_h2v2_merged_upsample_mmx (JDIMENSION output_width,\n;                                 JSAMPIMAGE input_buf,\n;                                 JDIMENSION in_row_group_ctr,\n;                                 JSAMPARRAY output_buf);\n;\n\n%define output_width(b)\t(b)+8\t\t\t; JDIMENSION output_width\n%define input_buf(b)\t\t(b)+12\t\t; JSAMPIMAGE input_buf\n%define in_row_group_ctr(b)\t(b)+16\t\t; JDIMENSION in_row_group_ctr\n%define output_buf(b)\t\t(b)+20\t\t; JSAMPARRAY output_buf\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v2_merged_upsample_mmx)\n\nEXTN(jsimd_h2v2_merged_upsample_mmx):\n\tpush\tebp\n\tmov\tebp,esp\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tmov\teax, JDIMENSION [output_width(ebp)]\n\n\tmov\tedi, JSAMPIMAGE [input_buf(ebp)]\n\tmov\tecx, JDIMENSION [in_row_group_ctr(ebp)]\n\tmov\tesi, JSAMPARRAY [edi+0*SIZEOF_JSAMPARRAY]\n\tmov\tebx, JSAMPARRAY [edi+1*SIZEOF_JSAMPARRAY]\n\tmov\tedx, JSAMPARRAY [edi+2*SIZEOF_JSAMPARRAY]\n\tmov\tedi, JSAMPARRAY [output_buf(ebp)]\n\tlea\tesi, [esi+ecx*SIZEOF_JSAMPROW]\n\n\tpush\tedx\t\t\t; inptr2\n\tpush\tebx\t\t\t; inptr1\n\tpush\tesi\t\t\t; inptr00\n\tmov\tebx,esp\n\n\tpush\tedi\t\t\t; output_buf (outptr0)\n\tpush\tecx\t\t\t; in_row_group_ctr\n\tpush\tebx\t\t\t; input_buf\n\tpush\teax\t\t\t; output_width\n\n\tcall\tnear EXTN(jsimd_h2v1_merged_upsample_mmx)\n\n\tadd\tesi, byte SIZEOF_JSAMPROW\t; inptr01\n\tadd\tedi, byte SIZEOF_JSAMPROW\t; outptr1\n\tmov\tPOINTER [ebx+0*SIZEOF_POINTER], esi\n\tmov\tPOINTER [ebx-1*SIZEOF_POINTER], edi\n\n\tcall\tnear EXTN(jsimd_h2v1_merged_upsample_mmx)\n\n\tadd\tesp, byte 7*SIZEOF_DWORD\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jdmrgss2-64.asm",
    "content": ";\n; jdmrgss2-64.asm - merged upsampling/color conversion (64-bit SSE2)\n;\n; Copyright 2009, 2012 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2009, 2012 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\t\t\t\t\n; --------------------------------------------------------------------------\n;\n; Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical.\n;\n; GLOBAL(void)\n; jsimd_h2v1_merged_upsample_sse2 (JDIMENSION output_width,\n;                                  JSAMPIMAGE input_buf,\n;                                  JDIMENSION in_row_group_ctr,\n;                                  JSAMPARRAY output_buf);\n;\n\n; r10 = JDIMENSION output_width\n; r11 = JSAMPIMAGE input_buf\n; r12 = JDIMENSION in_row_group_ctr\n; r13 = JSAMPARRAY output_buf\n\n%define wk(i)\t\trbp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t3\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v1_merged_upsample_sse2)\n\nEXTN(jsimd_h2v1_merged_upsample_sse2):\n\tpush\trbp\n\tmov\trax,rsp\t\t\t\t; rax = original rbp\n\tsub\trsp, byte 4\n\tand\trsp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[rsp],rax\n\tmov\trbp,rsp\t\t\t\t; rbp = aligned rbp\n\tlea\trsp, [wk(0)]\n\tcollect_args\n\tpush\trbx\n\n\tmov\trcx, r10\t; col\n\ttest\trcx,rcx\n\tjz\tnear .return\n\n\tpush\trcx\n\n\tmov\trdi, r11\n\tmov\trcx, r12\n\tmov\trsi, JSAMPARRAY [rdi+0*SIZEOF_JSAMPARRAY]\n\tmov\trbx, JSAMPARRAY [rdi+1*SIZEOF_JSAMPARRAY]\n\tmov\trdx, JSAMPARRAY [rdi+2*SIZEOF_JSAMPARRAY]\n\tmov\trdi, r13\n\tmov\trsi, JSAMPROW [rsi+rcx*SIZEOF_JSAMPROW]\t\t; inptr0\n\tmov\trbx, JSAMPROW [rbx+rcx*SIZEOF_JSAMPROW]\t\t; inptr1\n\tmov\trdx, JSAMPROW [rdx+rcx*SIZEOF_JSAMPROW]\t\t; inptr2\n\tmov\trdi, JSAMPROW [rdi]\t\t\t\t; outptr\n\n\tpop\trcx\t\t\t; col\n\n.columnloop:\n\n\tmovdqa    xmm6, XMMWORD [rbx]\t; xmm6=Cb(0123456789ABCDEF)\n\tmovdqa    xmm7, XMMWORD [rdx]\t; xmm7=Cr(0123456789ABCDEF)\n\n\tpxor      xmm1,xmm1\t\t; xmm1=(all 0's)\n\tpcmpeqw   xmm3,xmm3\n\tpsllw     xmm3,7\t\t; xmm3={0xFF80 0xFF80 0xFF80 0xFF80 ..}\n\n\tmovdqa    xmm4,xmm6\n\tpunpckhbw xmm6,xmm1\t\t; xmm6=Cb(89ABCDEF)=CbH\n\tpunpcklbw xmm4,xmm1\t\t; xmm4=Cb(01234567)=CbL\n\tmovdqa    xmm0,xmm7\n\tpunpckhbw xmm7,xmm1\t\t; xmm7=Cr(89ABCDEF)=CrH\n\tpunpcklbw xmm0,xmm1\t\t; xmm0=Cr(01234567)=CrL\n\n\tpaddw     xmm6,xmm3\n\tpaddw     xmm4,xmm3\n\tpaddw     xmm7,xmm3\n\tpaddw     xmm0,xmm3\n\n\t; (Original)\n\t; R = Y                + 1.40200 * Cr\n\t; G = Y - 0.34414 * Cb - 0.71414 * Cr\n\t; B = Y + 1.77200 * Cb\n\t;\n\t; (This implementation)\n\t; R = Y                + 0.40200 * Cr + Cr\n\t; G = Y - 0.34414 * Cb + 0.28586 * Cr - Cr\n\t; B = Y - 0.22800 * Cb + Cb + Cb\n\n\tmovdqa\txmm5,xmm6\t\t; xmm5=CbH\n\tmovdqa\txmm2,xmm4\t\t; xmm2=CbL\n\tpaddw\txmm6,xmm6\t\t; xmm6=2*CbH\n\tpaddw\txmm4,xmm4\t\t; xmm4=2*CbL\n\tmovdqa\txmm1,xmm7\t\t; xmm1=CrH\n\tmovdqa\txmm3,xmm0\t\t; xmm3=CrL\n\tpaddw\txmm7,xmm7\t\t; xmm7=2*CrH\n\tpaddw\txmm0,xmm0\t\t; xmm0=2*CrL\n\n\tpmulhw\txmm6,[rel PW_MF0228]\t; xmm6=(2*CbH * -FIX(0.22800))\n\tpmulhw\txmm4,[rel PW_MF0228]\t; xmm4=(2*CbL * -FIX(0.22800))\n\tpmulhw\txmm7,[rel PW_F0402]\t; xmm7=(2*CrH * FIX(0.40200))\n\tpmulhw\txmm0,[rel PW_F0402]\t; xmm0=(2*CrL * FIX(0.40200))\n\n\tpaddw\txmm6,[rel PW_ONE]\n\tpaddw\txmm4,[rel PW_ONE]\n\tpsraw\txmm6,1\t\t\t; xmm6=(CbH * -FIX(0.22800))\n\tpsraw\txmm4,1\t\t\t; xmm4=(CbL * -FIX(0.22800))\n\tpaddw\txmm7,[rel PW_ONE]\n\tpaddw\txmm0,[rel PW_ONE]\n\tpsraw\txmm7,1\t\t\t; xmm7=(CrH * FIX(0.40200))\n\tpsraw\txmm0,1\t\t\t; xmm0=(CrL * FIX(0.40200))\n\n\tpaddw\txmm6,xmm5\n\tpaddw\txmm4,xmm2\n\tpaddw\txmm6,xmm5\t\t; xmm6=(CbH * FIX(1.77200))=(B-Y)H\n\tpaddw\txmm4,xmm2\t\t; xmm4=(CbL * FIX(1.77200))=(B-Y)L\n\tpaddw\txmm7,xmm1\t\t; xmm7=(CrH * FIX(1.40200))=(R-Y)H\n\tpaddw\txmm0,xmm3\t\t; xmm0=(CrL * FIX(1.40200))=(R-Y)L\n\n\tmovdqa\tXMMWORD [wk(0)], xmm6\t; wk(0)=(B-Y)H\n\tmovdqa\tXMMWORD [wk(1)], xmm7\t; wk(1)=(R-Y)H\n\n\tmovdqa    xmm6,xmm5\n\tmovdqa    xmm7,xmm2\n\tpunpcklwd xmm5,xmm1\n\tpunpckhwd xmm6,xmm1\n\tpmaddwd   xmm5,[rel PW_MF0344_F0285]\n\tpmaddwd   xmm6,[rel PW_MF0344_F0285]\n\tpunpcklwd xmm2,xmm3\n\tpunpckhwd xmm7,xmm3\n\tpmaddwd   xmm2,[rel PW_MF0344_F0285]\n\tpmaddwd   xmm7,[rel PW_MF0344_F0285]\n\n\tpaddd     xmm5,[rel PD_ONEHALF]\n\tpaddd     xmm6,[rel PD_ONEHALF]\n\tpsrad     xmm5,SCALEBITS\n\tpsrad     xmm6,SCALEBITS\n\tpaddd     xmm2,[rel PD_ONEHALF]\n\tpaddd     xmm7,[rel PD_ONEHALF]\n\tpsrad     xmm2,SCALEBITS\n\tpsrad     xmm7,SCALEBITS\n\n\tpackssdw  xmm5,xmm6\t; xmm5=CbH*-FIX(0.344)+CrH*FIX(0.285)\n\tpackssdw  xmm2,xmm7\t; xmm2=CbL*-FIX(0.344)+CrL*FIX(0.285)\n\tpsubw     xmm5,xmm1\t; xmm5=CbH*-FIX(0.344)+CrH*-FIX(0.714)=(G-Y)H\n\tpsubw     xmm2,xmm3\t; xmm2=CbL*-FIX(0.344)+CrL*-FIX(0.714)=(G-Y)L\n\n\tmovdqa\tXMMWORD [wk(2)], xmm5\t; wk(2)=(G-Y)H\n\n\tmov\tal,2\t\t\t; Yctr\n\tjmp\tshort .Yloop_1st\n\n.Yloop_2nd:\n\tmovdqa\txmm0, XMMWORD [wk(1)]\t; xmm0=(R-Y)H\n\tmovdqa\txmm2, XMMWORD [wk(2)]\t; xmm2=(G-Y)H\n\tmovdqa\txmm4, XMMWORD [wk(0)]\t; xmm4=(B-Y)H\n\n.Yloop_1st:\n\tmovdqa\txmm7, XMMWORD [rsi]\t; xmm7=Y(0123456789ABCDEF)\n\n\tpcmpeqw\txmm6,xmm6\n\tpsrlw\txmm6,BYTE_BIT\t\t; xmm6={0xFF 0x00 0xFF 0x00 ..}\n\tpand\txmm6,xmm7\t\t; xmm6=Y(02468ACE)=YE\n\tpsrlw\txmm7,BYTE_BIT\t\t; xmm7=Y(13579BDF)=YO\n\n\tmovdqa\txmm1,xmm0\t\t; xmm1=xmm0=(R-Y)(L/H)\n\tmovdqa\txmm3,xmm2\t\t; xmm3=xmm2=(G-Y)(L/H)\n\tmovdqa\txmm5,xmm4\t\t; xmm5=xmm4=(B-Y)(L/H)\n\n\tpaddw     xmm0,xmm6\t\t; xmm0=((R-Y)+YE)=RE=R(02468ACE)\n\tpaddw     xmm1,xmm7\t\t; xmm1=((R-Y)+YO)=RO=R(13579BDF)\n\tpackuswb  xmm0,xmm0\t\t; xmm0=R(02468ACE********)\n\tpackuswb  xmm1,xmm1\t\t; xmm1=R(13579BDF********)\n\n\tpaddw     xmm2,xmm6\t\t; xmm2=((G-Y)+YE)=GE=G(02468ACE)\n\tpaddw     xmm3,xmm7\t\t; xmm3=((G-Y)+YO)=GO=G(13579BDF)\n\tpackuswb  xmm2,xmm2\t\t; xmm2=G(02468ACE********)\n\tpackuswb  xmm3,xmm3\t\t; xmm3=G(13579BDF********)\n\n\tpaddw     xmm4,xmm6\t\t; xmm4=((B-Y)+YE)=BE=B(02468ACE)\n\tpaddw     xmm5,xmm7\t\t; xmm5=((B-Y)+YO)=BO=B(13579BDF)\n\tpackuswb  xmm4,xmm4\t\t; xmm4=B(02468ACE********)\n\tpackuswb  xmm5,xmm5\t\t; xmm5=B(13579BDF********)\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n\t; xmmA=(00 02 04 06 08 0A 0C 0E **), xmmB=(01 03 05 07 09 0B 0D 0F **)\n\t; xmmC=(10 12 14 16 18 1A 1C 1E **), xmmD=(11 13 15 17 19 1B 1D 1F **)\n\t; xmmE=(20 22 24 26 28 2A 2C 2E **), xmmF=(21 23 25 27 29 2B 2D 2F **)\n\t; xmmG=(** ** ** ** ** ** ** ** **), xmmH=(** ** ** ** ** ** ** ** **)\n\n\tpunpcklbw xmmA,xmmC\t; xmmA=(00 10 02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E)\n\tpunpcklbw xmmE,xmmB\t; xmmE=(20 01 22 03 24 05 26 07 28 09 2A 0B 2C 0D 2E 0F)\n\tpunpcklbw xmmD,xmmF\t; xmmD=(11 21 13 23 15 25 17 27 19 29 1B 2B 1D 2D 1F 2F)\n\n\tmovdqa    xmmG,xmmA\n\tmovdqa    xmmH,xmmA\n\tpunpcklwd xmmA,xmmE\t; xmmA=(00 10 20 01 02 12 22 03 04 14 24 05 06 16 26 07)\n\tpunpckhwd xmmG,xmmE\t; xmmG=(08 18 28 09 0A 1A 2A 0B 0C 1C 2C 0D 0E 1E 2E 0F)\n\n\tpsrldq    xmmH,2\t; xmmH=(02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E -- --)\n\tpsrldq    xmmE,2\t; xmmE=(22 03 24 05 26 07 28 09 2A 0B 2C 0D 2E 0F -- --)\n\n\tmovdqa    xmmC,xmmD\n\tmovdqa    xmmB,xmmD\n\tpunpcklwd xmmD,xmmH\t; xmmD=(11 21 02 12 13 23 04 14 15 25 06 16 17 27 08 18)\n\tpunpckhwd xmmC,xmmH\t; xmmC=(19 29 0A 1A 1B 2B 0C 1C 1D 2D 0E 1E 1F 2F -- --)\n\n\tpsrldq    xmmB,2\t; xmmB=(13 23 15 25 17 27 19 29 1B 2B 1D 2D 1F 2F -- --)\n\n\tmovdqa    xmmF,xmmE\n\tpunpcklwd xmmE,xmmB\t; xmmE=(22 03 13 23 24 05 15 25 26 07 17 27 28 09 19 29)\n\tpunpckhwd xmmF,xmmB\t; xmmF=(2A 0B 1B 2B 2C 0D 1D 2D 2E 0F 1F 2F -- -- -- --)\n\n\tpshufd    xmmH,xmmA,0x4E; xmmH=(04 14 24 05 06 16 26 07 00 10 20 01 02 12 22 03)\n\tmovdqa    xmmB,xmmE\n\tpunpckldq xmmA,xmmD\t; xmmA=(00 10 20 01 11 21 02 12 02 12 22 03 13 23 04 14)\n\tpunpckldq xmmE,xmmH\t; xmmE=(22 03 13 23 04 14 24 05 24 05 15 25 06 16 26 07)\n\tpunpckhdq xmmD,xmmB\t; xmmD=(15 25 06 16 26 07 17 27 17 27 08 18 28 09 19 29)\n\n\tpshufd    xmmH,xmmG,0x4E; xmmH=(0C 1C 2C 0D 0E 1E 2E 0F 08 18 28 09 0A 1A 2A 0B)\n\tmovdqa    xmmB,xmmF\n\tpunpckldq xmmG,xmmC\t; xmmG=(08 18 28 09 19 29 0A 1A 0A 1A 2A 0B 1B 2B 0C 1C)\n\tpunpckldq xmmF,xmmH\t; xmmF=(2A 0B 1B 2B 0C 1C 2C 0D 2C 0D 1D 2D 0E 1E 2E 0F)\n\tpunpckhdq xmmC,xmmB\t; xmmC=(1D 2D 0E 1E 2E 0F 1F 2F 1F 2F -- -- -- -- -- --)\n\n\tpunpcklqdq xmmA,xmmE\t; xmmA=(00 10 20 01 11 21 02 12 22 03 13 23 04 14 24 05)\n\tpunpcklqdq xmmD,xmmG\t; xmmD=(15 25 06 16 26 07 17 27 08 18 28 09 19 29 0A 1A)\n\tpunpcklqdq xmmF,xmmC\t; xmmF=(2A 0B 1B 2B 0C 1C 2C 0D 1D 2D 0E 1E 2E 0F 1F 2F)\n\n\tcmp\trcx, byte SIZEOF_XMMWORD\n\tjb\tshort .column_st32\n\n\ttest\trdi, SIZEOF_XMMWORD-1\n\tjnz\tshort .out1\n\t; --(aligned)-------------------\n\tmovntdq\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n\tmovntdq\tXMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n\tmovntdq\tXMMWORD [rdi+2*SIZEOF_XMMWORD], xmmF\n\tjmp\tshort .out0\n.out1:\t; --(unaligned)-----------------\n\tmovdqu\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n\tmovdqu\tXMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n\tmovdqu\tXMMWORD [rdi+2*SIZEOF_XMMWORD], xmmF\n.out0:\n\tadd\trdi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD\t; outptr\n\tsub\trcx, byte SIZEOF_XMMWORD\n\tjz\tnear .endcolumn\n\n\tadd\trsi, byte SIZEOF_XMMWORD\t; inptr0\n\tdec\tal\t\t\t; Yctr\n\tjnz\tnear .Yloop_2nd\n\n\tadd\trbx, byte SIZEOF_XMMWORD\t; inptr1\n\tadd\trdx, byte SIZEOF_XMMWORD\t; inptr2\n\tjmp\tnear .columnloop\n\n.column_st32:\n\tlea\trcx, [rcx+rcx*2]\t\t; imul ecx, RGB_PIXELSIZE\n\tcmp\trcx, byte 2*SIZEOF_XMMWORD\n\tjb\tshort .column_st16\n\tmovdqu\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n\tmovdqu\tXMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n\tadd\trdi, byte 2*SIZEOF_XMMWORD\t; outptr\n\tmovdqa\txmmA,xmmF\n\tsub\trcx, byte 2*SIZEOF_XMMWORD\n\tjmp\tshort .column_st15\n.column_st16:\n\tcmp\trcx, byte SIZEOF_XMMWORD\n\tjb\tshort .column_st15\n\tmovdqu\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n\tadd\trdi, byte SIZEOF_XMMWORD\t; outptr\n\tmovdqa\txmmA,xmmD\n\tsub\trcx, byte SIZEOF_XMMWORD\n.column_st15:\n\t; Store the lower 8 bytes of xmmA to the output when it has enough\n\t; space.\n\tcmp\trcx, byte SIZEOF_MMWORD\n\tjb\tshort .column_st7\n\tmovq\tXMM_MMWORD [rdi], xmmA\n\tadd\trdi, byte SIZEOF_MMWORD\n\tsub\trcx, byte SIZEOF_MMWORD\n\tpsrldq\txmmA, SIZEOF_MMWORD\n.column_st7:\n\t; Store the lower 4 bytes of xmmA to the output when it has enough\n\t; space.\n\tcmp\trcx, byte SIZEOF_DWORD\n\tjb\tshort .column_st3\n\tmovd\tXMM_DWORD [rdi], xmmA\n\tadd\trdi, byte SIZEOF_DWORD\n\tsub\trcx, byte SIZEOF_DWORD\n\tpsrldq\txmmA, SIZEOF_DWORD\n.column_st3:\n\t; Store the lower 2 bytes of rax to the output when it has enough\n\t; space.\n\tmovd\teax, xmmA\n\tcmp\trcx, byte SIZEOF_WORD\n\tjb\tshort .column_st1\n\tmov\tWORD [rdi], ax\n\tadd\trdi, byte SIZEOF_WORD\n\tsub\trcx, byte SIZEOF_WORD\n\tshr\trax, 16\n.column_st1:\n\t; Store the lower 1 byte of rax to the output when it has enough\n\t; space.\n\ttest\trcx, rcx\n\tjz\tshort .endcolumn\n\tmov\tBYTE [rdi], al\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n%ifdef RGBX_FILLER_0XFF\n\tpcmpeqb   xmm6,xmm6\t\t; xmm6=XE=X(02468ACE********)\n\tpcmpeqb   xmm7,xmm7\t\t; xmm7=XO=X(13579BDF********)\n%else\n\tpxor      xmm6,xmm6\t\t; xmm6=XE=X(02468ACE********)\n\tpxor      xmm7,xmm7\t\t; xmm7=XO=X(13579BDF********)\n%endif\n\t; xmmA=(00 02 04 06 08 0A 0C 0E **), xmmB=(01 03 05 07 09 0B 0D 0F **)\n\t; xmmC=(10 12 14 16 18 1A 1C 1E **), xmmD=(11 13 15 17 19 1B 1D 1F **)\n\t; xmmE=(20 22 24 26 28 2A 2C 2E **), xmmF=(21 23 25 27 29 2B 2D 2F **)\n\t; xmmG=(30 32 34 36 38 3A 3C 3E **), xmmH=(31 33 35 37 39 3B 3D 3F **)\n\n\tpunpcklbw xmmA,xmmC\t; xmmA=(00 10 02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E)\n\tpunpcklbw xmmE,xmmG\t; xmmE=(20 30 22 32 24 34 26 36 28 38 2A 3A 2C 3C 2E 3E)\n\tpunpcklbw xmmB,xmmD\t; xmmB=(01 11 03 13 05 15 07 17 09 19 0B 1B 0D 1D 0F 1F)\n\tpunpcklbw xmmF,xmmH\t; xmmF=(21 31 23 33 25 35 27 37 29 39 2B 3B 2D 3D 2F 3F)\n\n\tmovdqa    xmmC,xmmA\n\tpunpcklwd xmmA,xmmE\t; xmmA=(00 10 20 30 02 12 22 32 04 14 24 34 06 16 26 36)\n\tpunpckhwd xmmC,xmmE\t; xmmC=(08 18 28 38 0A 1A 2A 3A 0C 1C 2C 3C 0E 1E 2E 3E)\n\tmovdqa    xmmG,xmmB\n\tpunpcklwd xmmB,xmmF\t; xmmB=(01 11 21 31 03 13 23 33 05 15 25 35 07 17 27 37)\n\tpunpckhwd xmmG,xmmF\t; xmmG=(09 19 29 39 0B 1B 2B 3B 0D 1D 2D 3D 0F 1F 2F 3F)\n\n\tmovdqa    xmmD,xmmA\n\tpunpckldq xmmA,xmmB\t; xmmA=(00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33)\n\tpunpckhdq xmmD,xmmB\t; xmmD=(04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37)\n\tmovdqa    xmmH,xmmC\n\tpunpckldq xmmC,xmmG\t; xmmC=(08 18 28 38 09 19 29 39 0A 1A 2A 3A 0B 1B 2B 3B)\n\tpunpckhdq xmmH,xmmG\t; xmmH=(0C 1C 2C 3C 0D 1D 2D 3D 0E 1E 2E 3E 0F 1F 2F 3F)\n\n\tcmp\trcx, byte SIZEOF_XMMWORD\n\tjb\tshort .column_st32\n\n\ttest\trdi, SIZEOF_XMMWORD-1\n\tjnz\tshort .out1\n\t; --(aligned)-------------------\n\tmovntdq\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n\tmovntdq\tXMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n\tmovntdq\tXMMWORD [rdi+2*SIZEOF_XMMWORD], xmmC\n\tmovntdq\tXMMWORD [rdi+3*SIZEOF_XMMWORD], xmmH\n\tjmp\tshort .out0\n.out1:\t; --(unaligned)-----------------\n\tmovdqu\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n\tmovdqu\tXMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n\tmovdqu\tXMMWORD [rdi+2*SIZEOF_XMMWORD], xmmC\n\tmovdqu\tXMMWORD [rdi+3*SIZEOF_XMMWORD], xmmH\n.out0:\n\tadd\trdi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD\t; outptr\n\tsub\trcx, byte SIZEOF_XMMWORD\n\tjz\tnear .endcolumn\n\n\tadd\trsi, byte SIZEOF_XMMWORD\t; inptr0\n\tdec\tal\t\t\t; Yctr\n\tjnz\tnear .Yloop_2nd\n\n\tadd\trbx, byte SIZEOF_XMMWORD\t; inptr1\n\tadd\trdx, byte SIZEOF_XMMWORD\t; inptr2\n\tjmp\tnear .columnloop\n\n.column_st32:\n\tcmp\trcx, byte SIZEOF_XMMWORD/2\n\tjb\tshort .column_st16\n\tmovdqu\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n\tmovdqu\tXMMWORD [rdi+1*SIZEOF_XMMWORD], xmmD\n\tadd\trdi, byte 2*SIZEOF_XMMWORD\t; outptr\n\tmovdqa\txmmA,xmmC\n\tmovdqa\txmmD,xmmH\n\tsub\trcx, byte SIZEOF_XMMWORD/2\n.column_st16:\n\tcmp\trcx, byte SIZEOF_XMMWORD/4\n\tjb\tshort .column_st15\n\tmovdqu\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmmA\n\tadd\trdi, byte SIZEOF_XMMWORD\t; outptr\n\tmovdqa\txmmA,xmmD\n\tsub\trcx, byte SIZEOF_XMMWORD/4\n.column_st15:\n\t; Store two pixels (8 bytes) of xmmA to the output when it has enough\n\t; space.\n\tcmp\trcx, byte SIZEOF_XMMWORD/8\n\tjb\tshort .column_st7\n\tmovq\tXMM_MMWORD [rdi], xmmA\n\tadd\trdi, byte SIZEOF_XMMWORD/8*4\n\tsub\trcx, byte SIZEOF_XMMWORD/8\n\tpsrldq\txmmA, SIZEOF_XMMWORD/8*4\n.column_st7:\n\t; Store one pixel (4 bytes) of xmmA to the output when it has enough\n\t; space.\n\ttest\trcx, rcx\n\tjz\tshort .endcolumn\n\tmovd\tXMM_DWORD [rdi], xmmA\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n.endcolumn:\n\tsfence\t\t; flush the write buffer\n\n.return:\n\tpop\trbx\n\tuncollect_args\n\tmov\trsp,rbp\t\t; rsp <- aligned rbp\n\tpop\trsp\t\t; rsp <- original rbp\n\tpop\trbp\n\tret\n\n; --------------------------------------------------------------------------\n;\n; Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical.\n;\n; GLOBAL(void)\n; jsimd_h2v2_merged_upsample_sse2 (JDIMENSION output_width,\n;                                  JSAMPIMAGE input_buf,\n;                                  JDIMENSION in_row_group_ctr,\n;                                  JSAMPARRAY output_buf);\n;\n\n; r10 = JDIMENSION output_width\n; r11 = JSAMPIMAGE input_buf\n; r12 = JDIMENSION in_row_group_ctr\n; r13 = JSAMPARRAY output_buf\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v2_merged_upsample_sse2)\n\nEXTN(jsimd_h2v2_merged_upsample_sse2):\n\tpush\trbp\n\tmov\trax,rsp\n\tmov\trbp,rsp\n\tcollect_args\n\tpush\trbx\n\n\tmov\trax, r10\n\n\tmov\trdi, r11\n\tmov\trcx, r12\n\tmov\trsi, JSAMPARRAY [rdi+0*SIZEOF_JSAMPARRAY]\n\tmov\trbx, JSAMPARRAY [rdi+1*SIZEOF_JSAMPARRAY]\n\tmov\trdx, JSAMPARRAY [rdi+2*SIZEOF_JSAMPARRAY]\n\tmov\trdi, r13\n\tlea\trsi, [rsi+rcx*SIZEOF_JSAMPROW]\n\n\tpush\trdx\t\t\t; inptr2\n\tpush\trbx\t\t\t; inptr1\n\tpush\trsi\t\t\t; inptr00\n\tmov\trbx,rsp\n\n\tpush\trdi\n\tpush\trcx\n\tpush\trax\n\n\t%ifdef WIN64\n\tmov r8, rcx\n\tmov r9, rdi\n\tmov rcx, rax\n\tmov rdx, rbx\n\t%else\n\tmov rdx, rcx\n\tmov rcx, rdi\n\tmov\trdi, rax\n\tmov rsi, rbx\n\t%endif\n\n\tcall\tEXTN(jsimd_h2v1_merged_upsample_sse2)\n\n\tpop rax\n\tpop rcx\n\tpop rdi\n\tpop rsi\n\tpop rbx\n\tpop rdx\n\n\tadd\trdi, byte SIZEOF_JSAMPROW\t; outptr1\n\tadd\trsi, byte SIZEOF_JSAMPROW\t; inptr01\n\n\tpush\trdx\t\t\t; inptr2\n\tpush\trbx\t\t\t; inptr1\n\tpush\trsi\t\t\t; inptr00\n\tmov\trbx,rsp\n\n\tpush\trdi\n\tpush\trcx\n\tpush\trax\n\n\t%ifdef WIN64\n\tmov r8, rcx\n\tmov r9, rdi\n\tmov rcx, rax\n\tmov rdx, rbx\n\t%else\n\tmov rdx, rcx\n\tmov rcx, rdi\n\tmov\trdi, rax\n\tmov rsi, rbx\n\t%endif\n\n\tcall\tEXTN(jsimd_h2v1_merged_upsample_sse2)\n\n\tpop rax\n\tpop rcx\n\tpop rdi\n\tpop rsi\n\tpop rbx\n\tpop rdx\n\n\tpop\trbx\n\tuncollect_args\n\tpop\trbp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jdmrgss2.asm",
    "content": ";\n; jdmrgss2.asm - merged upsampling/color conversion (SSE2)\n;\n; Copyright 2009, 2012 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2012 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jcolsamp.inc\"\n\t\t\t\t\n; --------------------------------------------------------------------------\n;\n; Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical.\n;\n; GLOBAL(void)\n; jsimd_h2v1_merged_upsample_sse2 (JDIMENSION output_width,\n;                                  JSAMPIMAGE input_buf,\n;                                  JDIMENSION in_row_group_ctr,\n;                                  JSAMPARRAY output_buf);\n;\n\n%define output_width(b)\t(b)+8\t\t\t; JDIMENSION output_width\n%define input_buf(b)\t\t(b)+12\t\t; JSAMPIMAGE input_buf\n%define in_row_group_ctr(b)\t(b)+16\t\t; JDIMENSION in_row_group_ctr\n%define output_buf(b)\t\t(b)+20\t\t; JSAMPARRAY output_buf\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t3\n%define gotptr\t\twk(0)-SIZEOF_POINTER\t; void * gotptr\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v1_merged_upsample_sse2)\n\nEXTN(jsimd_h2v1_merged_upsample_sse2):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [wk(0)]\n\tpushpic\teax\t\t; make a room for GOT address\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t\t; get GOT address\n\tmovpic\tPOINTER [gotptr], ebx\t; save GOT address\n\n\tmov\tecx, JDIMENSION [output_width(eax)]\t; col\n\ttest\tecx,ecx\n\tjz\tnear .return\n\n\tpush\tecx\n\n\tmov\tedi, JSAMPIMAGE [input_buf(eax)]\n\tmov\tecx, JDIMENSION [in_row_group_ctr(eax)]\n\tmov\tesi, JSAMPARRAY [edi+0*SIZEOF_JSAMPARRAY]\n\tmov\tebx, JSAMPARRAY [edi+1*SIZEOF_JSAMPARRAY]\n\tmov\tedx, JSAMPARRAY [edi+2*SIZEOF_JSAMPARRAY]\n\tmov\tedi, JSAMPARRAY [output_buf(eax)]\n\tmov\tesi, JSAMPROW [esi+ecx*SIZEOF_JSAMPROW]\t\t; inptr0\n\tmov\tebx, JSAMPROW [ebx+ecx*SIZEOF_JSAMPROW]\t\t; inptr1\n\tmov\tedx, JSAMPROW [edx+ecx*SIZEOF_JSAMPROW]\t\t; inptr2\n\tmov\tedi, JSAMPROW [edi]\t\t\t\t; outptr\n\n\tpop\tecx\t\t\t; col\n\n\talignx\t16,7\n.columnloop:\n\tmovpic\teax, POINTER [gotptr]\t; load GOT address (eax)\n\n\tmovdqa    xmm6, XMMWORD [ebx]\t; xmm6=Cb(0123456789ABCDEF)\n\tmovdqa    xmm7, XMMWORD [edx]\t; xmm7=Cr(0123456789ABCDEF)\n\n\tpxor      xmm1,xmm1\t\t; xmm1=(all 0's)\n\tpcmpeqw   xmm3,xmm3\n\tpsllw     xmm3,7\t\t; xmm3={0xFF80 0xFF80 0xFF80 0xFF80 ..}\n\n\tmovdqa    xmm4,xmm6\n\tpunpckhbw xmm6,xmm1\t\t; xmm6=Cb(89ABCDEF)=CbH\n\tpunpcklbw xmm4,xmm1\t\t; xmm4=Cb(01234567)=CbL\n\tmovdqa    xmm0,xmm7\n\tpunpckhbw xmm7,xmm1\t\t; xmm7=Cr(89ABCDEF)=CrH\n\tpunpcklbw xmm0,xmm1\t\t; xmm0=Cr(01234567)=CrL\n\n\tpaddw     xmm6,xmm3\n\tpaddw     xmm4,xmm3\n\tpaddw     xmm7,xmm3\n\tpaddw     xmm0,xmm3\n\n\t; (Original)\n\t; R = Y                + 1.40200 * Cr\n\t; G = Y - 0.34414 * Cb - 0.71414 * Cr\n\t; B = Y + 1.77200 * Cb\n\t;\n\t; (This implementation)\n\t; R = Y                + 0.40200 * Cr + Cr\n\t; G = Y - 0.34414 * Cb + 0.28586 * Cr - Cr\n\t; B = Y - 0.22800 * Cb + Cb + Cb\n\n\tmovdqa\txmm5,xmm6\t\t; xmm5=CbH\n\tmovdqa\txmm2,xmm4\t\t; xmm2=CbL\n\tpaddw\txmm6,xmm6\t\t; xmm6=2*CbH\n\tpaddw\txmm4,xmm4\t\t; xmm4=2*CbL\n\tmovdqa\txmm1,xmm7\t\t; xmm1=CrH\n\tmovdqa\txmm3,xmm0\t\t; xmm3=CrL\n\tpaddw\txmm7,xmm7\t\t; xmm7=2*CrH\n\tpaddw\txmm0,xmm0\t\t; xmm0=2*CrL\n\n\tpmulhw\txmm6,[GOTOFF(eax,PW_MF0228)]\t; xmm6=(2*CbH * -FIX(0.22800))\n\tpmulhw\txmm4,[GOTOFF(eax,PW_MF0228)]\t; xmm4=(2*CbL * -FIX(0.22800))\n\tpmulhw\txmm7,[GOTOFF(eax,PW_F0402)]\t; xmm7=(2*CrH * FIX(0.40200))\n\tpmulhw\txmm0,[GOTOFF(eax,PW_F0402)]\t; xmm0=(2*CrL * FIX(0.40200))\n\n\tpaddw\txmm6,[GOTOFF(eax,PW_ONE)]\n\tpaddw\txmm4,[GOTOFF(eax,PW_ONE)]\n\tpsraw\txmm6,1\t\t\t; xmm6=(CbH * -FIX(0.22800))\n\tpsraw\txmm4,1\t\t\t; xmm4=(CbL * -FIX(0.22800))\n\tpaddw\txmm7,[GOTOFF(eax,PW_ONE)]\n\tpaddw\txmm0,[GOTOFF(eax,PW_ONE)]\n\tpsraw\txmm7,1\t\t\t; xmm7=(CrH * FIX(0.40200))\n\tpsraw\txmm0,1\t\t\t; xmm0=(CrL * FIX(0.40200))\n\n\tpaddw\txmm6,xmm5\n\tpaddw\txmm4,xmm2\n\tpaddw\txmm6,xmm5\t\t; xmm6=(CbH * FIX(1.77200))=(B-Y)H\n\tpaddw\txmm4,xmm2\t\t; xmm4=(CbL * FIX(1.77200))=(B-Y)L\n\tpaddw\txmm7,xmm1\t\t; xmm7=(CrH * FIX(1.40200))=(R-Y)H\n\tpaddw\txmm0,xmm3\t\t; xmm0=(CrL * FIX(1.40200))=(R-Y)L\n\n\tmovdqa\tXMMWORD [wk(0)], xmm6\t; wk(0)=(B-Y)H\n\tmovdqa\tXMMWORD [wk(1)], xmm7\t; wk(1)=(R-Y)H\n\n\tmovdqa    xmm6,xmm5\n\tmovdqa    xmm7,xmm2\n\tpunpcklwd xmm5,xmm1\n\tpunpckhwd xmm6,xmm1\n\tpmaddwd   xmm5,[GOTOFF(eax,PW_MF0344_F0285)]\n\tpmaddwd   xmm6,[GOTOFF(eax,PW_MF0344_F0285)]\n\tpunpcklwd xmm2,xmm3\n\tpunpckhwd xmm7,xmm3\n\tpmaddwd   xmm2,[GOTOFF(eax,PW_MF0344_F0285)]\n\tpmaddwd   xmm7,[GOTOFF(eax,PW_MF0344_F0285)]\n\n\tpaddd     xmm5,[GOTOFF(eax,PD_ONEHALF)]\n\tpaddd     xmm6,[GOTOFF(eax,PD_ONEHALF)]\n\tpsrad     xmm5,SCALEBITS\n\tpsrad     xmm6,SCALEBITS\n\tpaddd     xmm2,[GOTOFF(eax,PD_ONEHALF)]\n\tpaddd     xmm7,[GOTOFF(eax,PD_ONEHALF)]\n\tpsrad     xmm2,SCALEBITS\n\tpsrad     xmm7,SCALEBITS\n\n\tpackssdw  xmm5,xmm6\t; xmm5=CbH*-FIX(0.344)+CrH*FIX(0.285)\n\tpackssdw  xmm2,xmm7\t; xmm2=CbL*-FIX(0.344)+CrL*FIX(0.285)\n\tpsubw     xmm5,xmm1\t; xmm5=CbH*-FIX(0.344)+CrH*-FIX(0.714)=(G-Y)H\n\tpsubw     xmm2,xmm3\t; xmm2=CbL*-FIX(0.344)+CrL*-FIX(0.714)=(G-Y)L\n\n\tmovdqa\tXMMWORD [wk(2)], xmm5\t; wk(2)=(G-Y)H\n\n\tmov\tal,2\t\t\t; Yctr\n\tjmp\tshort .Yloop_1st\n\talignx\t16,7\n\n.Yloop_2nd:\n\tmovdqa\txmm0, XMMWORD [wk(1)]\t; xmm0=(R-Y)H\n\tmovdqa\txmm2, XMMWORD [wk(2)]\t; xmm2=(G-Y)H\n\tmovdqa\txmm4, XMMWORD [wk(0)]\t; xmm4=(B-Y)H\n\talignx\t16,7\n\n.Yloop_1st:\n\tmovdqa\txmm7, XMMWORD [esi]\t; xmm7=Y(0123456789ABCDEF)\n\n\tpcmpeqw\txmm6,xmm6\n\tpsrlw\txmm6,BYTE_BIT\t\t; xmm6={0xFF 0x00 0xFF 0x00 ..}\n\tpand\txmm6,xmm7\t\t; xmm6=Y(02468ACE)=YE\n\tpsrlw\txmm7,BYTE_BIT\t\t; xmm7=Y(13579BDF)=YO\n\n\tmovdqa\txmm1,xmm0\t\t; xmm1=xmm0=(R-Y)(L/H)\n\tmovdqa\txmm3,xmm2\t\t; xmm3=xmm2=(G-Y)(L/H)\n\tmovdqa\txmm5,xmm4\t\t; xmm5=xmm4=(B-Y)(L/H)\n\n\tpaddw     xmm0,xmm6\t\t; xmm0=((R-Y)+YE)=RE=R(02468ACE)\n\tpaddw     xmm1,xmm7\t\t; xmm1=((R-Y)+YO)=RO=R(13579BDF)\n\tpackuswb  xmm0,xmm0\t\t; xmm0=R(02468ACE********)\n\tpackuswb  xmm1,xmm1\t\t; xmm1=R(13579BDF********)\n\n\tpaddw     xmm2,xmm6\t\t; xmm2=((G-Y)+YE)=GE=G(02468ACE)\n\tpaddw     xmm3,xmm7\t\t; xmm3=((G-Y)+YO)=GO=G(13579BDF)\n\tpackuswb  xmm2,xmm2\t\t; xmm2=G(02468ACE********)\n\tpackuswb  xmm3,xmm3\t\t; xmm3=G(13579BDF********)\n\n\tpaddw     xmm4,xmm6\t\t; xmm4=((B-Y)+YE)=BE=B(02468ACE)\n\tpaddw     xmm5,xmm7\t\t; xmm5=((B-Y)+YO)=BO=B(13579BDF)\n\tpackuswb  xmm4,xmm4\t\t; xmm4=B(02468ACE********)\n\tpackuswb  xmm5,xmm5\t\t; xmm5=B(13579BDF********)\n\n%if RGB_PIXELSIZE == 3 ; ---------------\n\n\t; xmmA=(00 02 04 06 08 0A 0C 0E **), xmmB=(01 03 05 07 09 0B 0D 0F **)\n\t; xmmC=(10 12 14 16 18 1A 1C 1E **), xmmD=(11 13 15 17 19 1B 1D 1F **)\n\t; xmmE=(20 22 24 26 28 2A 2C 2E **), xmmF=(21 23 25 27 29 2B 2D 2F **)\n\t; xmmG=(** ** ** ** ** ** ** ** **), xmmH=(** ** ** ** ** ** ** ** **)\n\n\tpunpcklbw xmmA,xmmC\t; xmmA=(00 10 02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E)\n\tpunpcklbw xmmE,xmmB\t; xmmE=(20 01 22 03 24 05 26 07 28 09 2A 0B 2C 0D 2E 0F)\n\tpunpcklbw xmmD,xmmF\t; xmmD=(11 21 13 23 15 25 17 27 19 29 1B 2B 1D 2D 1F 2F)\n\n\tmovdqa    xmmG,xmmA\n\tmovdqa    xmmH,xmmA\n\tpunpcklwd xmmA,xmmE\t; xmmA=(00 10 20 01 02 12 22 03 04 14 24 05 06 16 26 07)\n\tpunpckhwd xmmG,xmmE\t; xmmG=(08 18 28 09 0A 1A 2A 0B 0C 1C 2C 0D 0E 1E 2E 0F)\n\n\tpsrldq    xmmH,2\t; xmmH=(02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E -- --)\n\tpsrldq    xmmE,2\t; xmmE=(22 03 24 05 26 07 28 09 2A 0B 2C 0D 2E 0F -- --)\n\n\tmovdqa    xmmC,xmmD\n\tmovdqa    xmmB,xmmD\n\tpunpcklwd xmmD,xmmH\t; xmmD=(11 21 02 12 13 23 04 14 15 25 06 16 17 27 08 18)\n\tpunpckhwd xmmC,xmmH\t; xmmC=(19 29 0A 1A 1B 2B 0C 1C 1D 2D 0E 1E 1F 2F -- --)\n\n\tpsrldq    xmmB,2\t; xmmB=(13 23 15 25 17 27 19 29 1B 2B 1D 2D 1F 2F -- --)\n\n\tmovdqa    xmmF,xmmE\n\tpunpcklwd xmmE,xmmB\t; xmmE=(22 03 13 23 24 05 15 25 26 07 17 27 28 09 19 29)\n\tpunpckhwd xmmF,xmmB\t; xmmF=(2A 0B 1B 2B 2C 0D 1D 2D 2E 0F 1F 2F -- -- -- --)\n\n\tpshufd    xmmH,xmmA,0x4E; xmmH=(04 14 24 05 06 16 26 07 00 10 20 01 02 12 22 03)\n\tmovdqa    xmmB,xmmE\n\tpunpckldq xmmA,xmmD\t; xmmA=(00 10 20 01 11 21 02 12 02 12 22 03 13 23 04 14)\n\tpunpckldq xmmE,xmmH\t; xmmE=(22 03 13 23 04 14 24 05 24 05 15 25 06 16 26 07)\n\tpunpckhdq xmmD,xmmB\t; xmmD=(15 25 06 16 26 07 17 27 17 27 08 18 28 09 19 29)\n\n\tpshufd    xmmH,xmmG,0x4E; xmmH=(0C 1C 2C 0D 0E 1E 2E 0F 08 18 28 09 0A 1A 2A 0B)\n\tmovdqa    xmmB,xmmF\n\tpunpckldq xmmG,xmmC\t; xmmG=(08 18 28 09 19 29 0A 1A 0A 1A 2A 0B 1B 2B 0C 1C)\n\tpunpckldq xmmF,xmmH\t; xmmF=(2A 0B 1B 2B 0C 1C 2C 0D 2C 0D 1D 2D 0E 1E 2E 0F)\n\tpunpckhdq xmmC,xmmB\t; xmmC=(1D 2D 0E 1E 2E 0F 1F 2F 1F 2F -- -- -- -- -- --)\n\n\tpunpcklqdq xmmA,xmmE\t; xmmA=(00 10 20 01 11 21 02 12 22 03 13 23 04 14 24 05)\n\tpunpcklqdq xmmD,xmmG\t; xmmD=(15 25 06 16 26 07 17 27 08 18 28 09 19 29 0A 1A)\n\tpunpcklqdq xmmF,xmmC\t; xmmF=(2A 0B 1B 2B 0C 1C 2C 0D 1D 2D 0E 1E 2E 0F 1F 2F)\n\n\tcmp\tecx, byte SIZEOF_XMMWORD\n\tjb\tshort .column_st32\n\n\ttest\tedi, SIZEOF_XMMWORD-1\n\tjnz\tshort .out1\n\t; --(aligned)-------------------\n\tmovntdq\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n\tmovntdq\tXMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n\tmovntdq\tXMMWORD [edi+2*SIZEOF_XMMWORD], xmmF\n\tjmp\tshort .out0\n.out1:\t; --(unaligned)-----------------\n\tmovdqu\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n\tmovdqu\tXMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n\tmovdqu\tXMMWORD [edi+2*SIZEOF_XMMWORD], xmmF\n.out0:\n\tadd\tedi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD\t; outptr\n\tsub\tecx, byte SIZEOF_XMMWORD\n\tjz\tnear .endcolumn\n\n\tadd\tesi, byte SIZEOF_XMMWORD\t; inptr0\n\tdec\tal\t\t\t; Yctr\n\tjnz\tnear .Yloop_2nd\n\n\tadd\tebx, byte SIZEOF_XMMWORD\t; inptr1\n\tadd\tedx, byte SIZEOF_XMMWORD\t; inptr2\n\tjmp\tnear .columnloop\n\talignx\t16,7\n\n.column_st32:\n\tlea\tecx, [ecx+ecx*2]\t\t; imul ecx, RGB_PIXELSIZE\n\tcmp\tecx, byte 2*SIZEOF_XMMWORD\n\tjb\tshort .column_st16\n\tmovdqu\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n\tmovdqu\tXMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n\tadd\tedi, byte 2*SIZEOF_XMMWORD\t; outptr\n\tmovdqa\txmmA,xmmF\n\tsub\tecx, byte 2*SIZEOF_XMMWORD\n\tjmp\tshort .column_st15\n.column_st16:\n\tcmp\tecx, byte SIZEOF_XMMWORD\n\tjb\tshort .column_st15\n\tmovdqu\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n\tadd\tedi, byte SIZEOF_XMMWORD\t; outptr\n\tmovdqa\txmmA,xmmD\n\tsub\tecx, byte SIZEOF_XMMWORD\n.column_st15:\n\t; Store the lower 8 bytes of xmmA to the output when it has enough\n\t; space.\n\tcmp\tecx, byte SIZEOF_MMWORD\n\tjb\tshort .column_st7\n\tmovq\tXMM_MMWORD [edi], xmmA\n\tadd\tedi, byte SIZEOF_MMWORD\n\tsub\tecx, byte SIZEOF_MMWORD\n\tpsrldq\txmmA, SIZEOF_MMWORD\n.column_st7:\n\t; Store the lower 4 bytes of xmmA to the output when it has enough\n\t; space.\n\tcmp\tecx, byte SIZEOF_DWORD\n\tjb\tshort .column_st3\n\tmovd\tXMM_DWORD [edi], xmmA\n\tadd\tedi, byte SIZEOF_DWORD\n\tsub\tecx, byte SIZEOF_DWORD\n\tpsrldq\txmmA, SIZEOF_DWORD\n.column_st3:\n\t; Store the lower 2 bytes of eax to the output when it has enough\n\t; space.\n\tmovd\teax, xmmA\n\tcmp\tecx, byte SIZEOF_WORD\n\tjb\tshort .column_st1\n\tmov\tWORD [edi], ax\n\tadd\tedi, byte SIZEOF_WORD\n\tsub\tecx, byte SIZEOF_WORD\n\tshr\teax, 16\n.column_st1:\n\t; Store the lower 1 byte of eax to the output when it has enough\n\t; space.\n\ttest\tecx, ecx\n\tjz\tshort .endcolumn\n\tmov\tBYTE [edi], al\n\n%else ; RGB_PIXELSIZE == 4 ; -----------\n\n%ifdef RGBX_FILLER_0XFF\n\tpcmpeqb   xmm6,xmm6\t\t; xmm6=XE=X(02468ACE********)\n\tpcmpeqb   xmm7,xmm7\t\t; xmm7=XO=X(13579BDF********)\n%else\n\tpxor      xmm6,xmm6\t\t; xmm6=XE=X(02468ACE********)\n\tpxor      xmm7,xmm7\t\t; xmm7=XO=X(13579BDF********)\n%endif\n\t; xmmA=(00 02 04 06 08 0A 0C 0E **), xmmB=(01 03 05 07 09 0B 0D 0F **)\n\t; xmmC=(10 12 14 16 18 1A 1C 1E **), xmmD=(11 13 15 17 19 1B 1D 1F **)\n\t; xmmE=(20 22 24 26 28 2A 2C 2E **), xmmF=(21 23 25 27 29 2B 2D 2F **)\n\t; xmmG=(30 32 34 36 38 3A 3C 3E **), xmmH=(31 33 35 37 39 3B 3D 3F **)\n\n\tpunpcklbw xmmA,xmmC\t; xmmA=(00 10 02 12 04 14 06 16 08 18 0A 1A 0C 1C 0E 1E)\n\tpunpcklbw xmmE,xmmG\t; xmmE=(20 30 22 32 24 34 26 36 28 38 2A 3A 2C 3C 2E 3E)\n\tpunpcklbw xmmB,xmmD\t; xmmB=(01 11 03 13 05 15 07 17 09 19 0B 1B 0D 1D 0F 1F)\n\tpunpcklbw xmmF,xmmH\t; xmmF=(21 31 23 33 25 35 27 37 29 39 2B 3B 2D 3D 2F 3F)\n\n\tmovdqa    xmmC,xmmA\n\tpunpcklwd xmmA,xmmE\t; xmmA=(00 10 20 30 02 12 22 32 04 14 24 34 06 16 26 36)\n\tpunpckhwd xmmC,xmmE\t; xmmC=(08 18 28 38 0A 1A 2A 3A 0C 1C 2C 3C 0E 1E 2E 3E)\n\tmovdqa    xmmG,xmmB\n\tpunpcklwd xmmB,xmmF\t; xmmB=(01 11 21 31 03 13 23 33 05 15 25 35 07 17 27 37)\n\tpunpckhwd xmmG,xmmF\t; xmmG=(09 19 29 39 0B 1B 2B 3B 0D 1D 2D 3D 0F 1F 2F 3F)\n\n\tmovdqa    xmmD,xmmA\n\tpunpckldq xmmA,xmmB\t; xmmA=(00 10 20 30 01 11 21 31 02 12 22 32 03 13 23 33)\n\tpunpckhdq xmmD,xmmB\t; xmmD=(04 14 24 34 05 15 25 35 06 16 26 36 07 17 27 37)\n\tmovdqa    xmmH,xmmC\n\tpunpckldq xmmC,xmmG\t; xmmC=(08 18 28 38 09 19 29 39 0A 1A 2A 3A 0B 1B 2B 3B)\n\tpunpckhdq xmmH,xmmG\t; xmmH=(0C 1C 2C 3C 0D 1D 2D 3D 0E 1E 2E 3E 0F 1F 2F 3F)\n\n\tcmp\tecx, byte SIZEOF_XMMWORD\n\tjb\tshort .column_st32\n\n\ttest\tedi, SIZEOF_XMMWORD-1\n\tjnz\tshort .out1\n\t; --(aligned)-------------------\n\tmovntdq\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n\tmovntdq\tXMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n\tmovntdq\tXMMWORD [edi+2*SIZEOF_XMMWORD], xmmC\n\tmovntdq\tXMMWORD [edi+3*SIZEOF_XMMWORD], xmmH\n\tjmp\tshort .out0\n.out1:\t; --(unaligned)-----------------\n\tmovdqu\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n\tmovdqu\tXMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n\tmovdqu\tXMMWORD [edi+2*SIZEOF_XMMWORD], xmmC\n\tmovdqu\tXMMWORD [edi+3*SIZEOF_XMMWORD], xmmH\n.out0:\n\tadd\tedi, byte RGB_PIXELSIZE*SIZEOF_XMMWORD\t; outptr\n\tsub\tecx, byte SIZEOF_XMMWORD\n\tjz\tnear .endcolumn\n\n\tadd\tesi, byte SIZEOF_XMMWORD\t; inptr0\n\tdec\tal\t\t\t; Yctr\n\tjnz\tnear .Yloop_2nd\n\n\tadd\tebx, byte SIZEOF_XMMWORD\t; inptr1\n\tadd\tedx, byte SIZEOF_XMMWORD\t; inptr2\n\tjmp\tnear .columnloop\n\talignx\t16,7\n\n.column_st32:\n\tcmp\tecx, byte SIZEOF_XMMWORD/2\n\tjb\tshort .column_st16\n\tmovdqu\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n\tmovdqu\tXMMWORD [edi+1*SIZEOF_XMMWORD], xmmD\n\tadd\tedi, byte 2*SIZEOF_XMMWORD\t; outptr\n\tmovdqa\txmmA,xmmC\n\tmovdqa\txmmD,xmmH\n\tsub\tecx, byte SIZEOF_XMMWORD/2\n.column_st16:\n\tcmp\tecx, byte SIZEOF_XMMWORD/4\n\tjb\tshort .column_st15\n\tmovdqu\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmmA\n\tadd\tedi, byte SIZEOF_XMMWORD\t; outptr\n\tmovdqa\txmmA,xmmD\n\tsub\tecx, byte SIZEOF_XMMWORD/4\n.column_st15:\n\t; Store two pixels (8 bytes) of xmmA to the output when it has enough\n\t; space.\n\tcmp\tecx, byte SIZEOF_XMMWORD/8\n\tjb\tshort .column_st7\n\tmovq\tXMM_MMWORD [edi], xmmA\n\tadd\tedi, byte SIZEOF_XMMWORD/8*4\n\tsub\tecx, byte SIZEOF_XMMWORD/8\n\tpsrldq\txmmA, SIZEOF_XMMWORD/8*4\n.column_st7:\n\t; Store one pixel (4 bytes) of xmmA to the output when it has enough\n\t; space.\n\ttest\tecx, ecx\n\tjz\tshort .endcolumn\n\tmovd\tXMM_DWORD [edi], xmmA\n\n%endif ; RGB_PIXELSIZE ; ---------------\n\n.endcolumn:\n\tsfence\t\t; flush the write buffer\n\n.return:\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; --------------------------------------------------------------------------\n;\n; Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical.\n;\n; GLOBAL(void)\n; jsimd_h2v2_merged_upsample_sse2 (JDIMENSION output_width,\n;                                  JSAMPIMAGE input_buf,\n;                                  JDIMENSION in_row_group_ctr,\n;                                  JSAMPARRAY output_buf);\n;\n\n%define output_width(b)\t(b)+8\t\t\t; JDIMENSION output_width\n%define input_buf(b)\t\t(b)+12\t\t; JSAMPIMAGE input_buf\n%define in_row_group_ctr(b)\t(b)+16\t\t; JDIMENSION in_row_group_ctr\n%define output_buf(b)\t\t(b)+20\t\t; JSAMPARRAY output_buf\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v2_merged_upsample_sse2)\n\nEXTN(jsimd_h2v2_merged_upsample_sse2):\n\tpush\tebp\n\tmov\tebp,esp\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tmov\teax, POINTER [output_width(ebp)]\n\n\tmov\tedi, JSAMPIMAGE [input_buf(ebp)]\n\tmov\tecx, JDIMENSION [in_row_group_ctr(ebp)]\n\tmov\tesi, JSAMPARRAY [edi+0*SIZEOF_JSAMPARRAY]\n\tmov\tebx, JSAMPARRAY [edi+1*SIZEOF_JSAMPARRAY]\n\tmov\tedx, JSAMPARRAY [edi+2*SIZEOF_JSAMPARRAY]\n\tmov\tedi, JSAMPARRAY [output_buf(ebp)]\n\tlea\tesi, [esi+ecx*SIZEOF_JSAMPROW]\n\n\tpush\tedx\t\t\t; inptr2\n\tpush\tebx\t\t\t; inptr1\n\tpush\tesi\t\t\t; inptr00\n\tmov\tebx,esp\n\n\tpush\tedi\t\t\t; output_buf (outptr0)\n\tpush\tecx\t\t\t; in_row_group_ctr\n\tpush\tebx\t\t\t; input_buf\n\tpush\teax\t\t\t; output_width\n\n\tcall\tnear EXTN(jsimd_h2v1_merged_upsample_sse2)\n\n\tadd\tesi, byte SIZEOF_JSAMPROW\t; inptr01\n\tadd\tedi, byte SIZEOF_JSAMPROW\t; outptr1\n\tmov\tPOINTER [ebx+0*SIZEOF_POINTER], esi\n\tmov\tPOINTER [ebx-1*SIZEOF_POINTER], edi\n\n\tcall\tnear EXTN(jsimd_h2v1_merged_upsample_sse2)\n\n\tadd\tesp, byte 7*SIZEOF_DWORD\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jdsammmx.asm",
    "content": ";\n; jdsammmx.asm - upsampling (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_fancy_upsample_mmx)\n\nEXTN(jconst_fancy_upsample_mmx):\n\nPW_ONE\t\ttimes 4 dw  1\nPW_TWO\t\ttimes 4 dw  2\nPW_THREE\ttimes 4 dw  3\nPW_SEVEN\ttimes 4 dw  7\nPW_EIGHT\ttimes 4 dw  8\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Fancy processing for the common case of 2:1 horizontal and 1:1 vertical.\n;\n; The upsampling algorithm is linear interpolation between pixel centers,\n; also known as a \"triangle filter\".  This is a good compromise between\n; speed and visual quality.  The centers of the output pixels are 1/4 and 3/4\n; of the way between input pixel centers.\n;\n; GLOBAL(void)\n; jsimd_h2v1_fancy_upsample_mmx (int max_v_samp_factor,\n;                                JDIMENSION downsampled_width,\n;                                JSAMPARRAY input_data,\n;                                JSAMPARRAY * output_data_ptr);\n;\n\n%define max_v_samp(b)\t\t(b)+8\t\t\t; int max_v_samp_factor\n%define downsamp_width(b)\t(b)+12\t; JDIMENSION downsampled_width\n%define input_data(b)\t\t(b)+16\t\t; JSAMPARRAY input_data\n%define output_data_ptr(b)\t(b)+20\t\t; JSAMPARRAY * output_data_ptr\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v1_fancy_upsample_mmx)\n\nEXTN(jsimd_h2v1_fancy_upsample_mmx):\n\tpush\tebp\n\tmov\tebp,esp\n\tpushpic\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t; get GOT address\n\n\tmov\teax, JDIMENSION [downsamp_width(ebp)]  ; colctr\n\ttest\teax,eax\n\tjz\tnear .return\n\n\tmov\tecx, INT [max_v_samp(ebp)]\t; rowctr\n\ttest\tecx,ecx\n\tjz\tnear .return\n\n\tmov\tesi, JSAMPARRAY [input_data(ebp)]\t; input_data\n\tmov\tedi, POINTER [output_data_ptr(ebp)]\n\tmov\tedi, JSAMPARRAY [edi]\t\t\t; output_data\n\talignx\t16,7\n.rowloop:\n\tpush\teax\t\t\t; colctr\n\tpush\tedi\n\tpush\tesi\n\n\tmov\tesi, JSAMPROW [esi]\t; inptr\n\tmov\tedi, JSAMPROW [edi]\t; outptr\n\n\ttest\teax, SIZEOF_MMWORD-1\n\tjz\tshort .skip\n\tmov\tdl, JSAMPLE [esi+(eax-1)*SIZEOF_JSAMPLE]\n\tmov\tJSAMPLE [esi+eax*SIZEOF_JSAMPLE], dl\t; insert a dummy sample\n.skip:\n\tpxor\tmm0,mm0\t\t\t; mm0=(all 0's)\n\tpcmpeqb\tmm7,mm7\n\tpsrlq\tmm7,(SIZEOF_MMWORD-1)*BYTE_BIT\n\tpand\tmm7, MMWORD [esi+0*SIZEOF_MMWORD]\n\n\tadd\teax, byte SIZEOF_MMWORD-1\n\tand\teax, byte -SIZEOF_MMWORD\n\tcmp\teax, byte SIZEOF_MMWORD\n\tja\tshort .columnloop\n\talignx\t16,7\n\n.columnloop_last:\n\tpcmpeqb\tmm6,mm6\n\tpsllq\tmm6,(SIZEOF_MMWORD-1)*BYTE_BIT\n\tpand\tmm6, MMWORD [esi+0*SIZEOF_MMWORD]\n\tjmp\tshort .upsample\n\talignx\t16,7\n\n.columnloop:\n\tmovq\tmm6, MMWORD [esi+1*SIZEOF_MMWORD]\n\tpsllq\tmm6,(SIZEOF_MMWORD-1)*BYTE_BIT\n\n.upsample:\n\tmovq\tmm1, MMWORD [esi+0*SIZEOF_MMWORD]\n\tmovq\tmm2,mm1\n\tmovq\tmm3,mm1\t\t\t; mm1=( 0 1 2 3 4 5 6 7)\n\tpsllq\tmm2,BYTE_BIT\t\t; mm2=( - 0 1 2 3 4 5 6)\n\tpsrlq\tmm3,BYTE_BIT\t\t; mm3=( 1 2 3 4 5 6 7 -)\n\n\tpor\tmm2,mm7\t\t\t; mm2=(-1 0 1 2 3 4 5 6)\n\tpor\tmm3,mm6\t\t\t; mm3=( 1 2 3 4 5 6 7 8)\n\n\tmovq\tmm7,mm1\n\tpsrlq\tmm7,(SIZEOF_MMWORD-1)*BYTE_BIT\t; mm7=( 7 - - - - - - -)\n\n\tmovq      mm4,mm1\n\tpunpcklbw mm1,mm0\t\t; mm1=( 0 1 2 3)\n\tpunpckhbw mm4,mm0\t\t; mm4=( 4 5 6 7)\n\tmovq      mm5,mm2\n\tpunpcklbw mm2,mm0\t\t; mm2=(-1 0 1 2)\n\tpunpckhbw mm5,mm0\t\t; mm5=( 3 4 5 6)\n\tmovq      mm6,mm3\n\tpunpcklbw mm3,mm0\t\t; mm3=( 1 2 3 4)\n\tpunpckhbw mm6,mm0\t\t; mm6=( 5 6 7 8)\n\n\tpmullw\tmm1,[GOTOFF(ebx,PW_THREE)]\n\tpmullw\tmm4,[GOTOFF(ebx,PW_THREE)]\n\tpaddw\tmm2,[GOTOFF(ebx,PW_ONE)]\n\tpaddw\tmm5,[GOTOFF(ebx,PW_ONE)]\n\tpaddw\tmm3,[GOTOFF(ebx,PW_TWO)]\n\tpaddw\tmm6,[GOTOFF(ebx,PW_TWO)]\n\n\tpaddw\tmm2,mm1\n\tpaddw\tmm5,mm4\n\tpsrlw\tmm2,2\t\t\t; mm2=OutLE=( 0  2  4  6)\n\tpsrlw\tmm5,2\t\t\t; mm5=OutHE=( 8 10 12 14)\n\tpaddw\tmm3,mm1\n\tpaddw\tmm6,mm4\n\tpsrlw\tmm3,2\t\t\t; mm3=OutLO=( 1  3  5  7)\n\tpsrlw\tmm6,2\t\t\t; mm6=OutHO=( 9 11 13 15)\n\n\tpsllw\tmm3,BYTE_BIT\n\tpsllw\tmm6,BYTE_BIT\n\tpor\tmm2,mm3\t\t\t; mm2=OutL=( 0  1  2  3  4  5  6  7)\n\tpor\tmm5,mm6\t\t\t; mm5=OutH=( 8  9 10 11 12 13 14 15)\n\n\tmovq\tMMWORD [edi+0*SIZEOF_MMWORD], mm2\n\tmovq\tMMWORD [edi+1*SIZEOF_MMWORD], mm5\n\n\tsub\teax, byte SIZEOF_MMWORD\n\tadd\tesi, byte 1*SIZEOF_MMWORD\t; inptr\n\tadd\tedi, byte 2*SIZEOF_MMWORD\t; outptr\n\tcmp\teax, byte SIZEOF_MMWORD\n\tja\tnear .columnloop\n\ttest\teax,eax\n\tjnz\tnear .columnloop_last\n\n\tpop\tesi\n\tpop\tedi\n\tpop\teax\n\n\tadd\tesi, byte SIZEOF_JSAMPROW\t; input_data\n\tadd\tedi, byte SIZEOF_JSAMPROW\t; output_data\n\tdec\tecx\t\t\t\t; rowctr\n\tjg\tnear .rowloop\n\n\temms\t\t; empty MMX state\n\n.return:\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpoppic\tebx\n\tpop\tebp\n\tret\n\n; --------------------------------------------------------------------------\n;\n; Fancy processing for the common case of 2:1 horizontal and 2:1 vertical.\n; Again a triangle filter; see comments for h2v1 case, above.\n;\n; GLOBAL(void)\n; jsimd_h2v2_fancy_upsample_mmx (int max_v_samp_factor,\n;                                JDIMENSION downsampled_width,\n;                                JSAMPARRAY input_data,\n;                                JSAMPARRAY * output_data_ptr);\n;\n\n%define max_v_samp(b)\t\t(b)+8\t\t\t; int max_v_samp_factor\n%define downsamp_width(b)\t(b)+12\t; JDIMENSION downsampled_width\n%define input_data(b)\t\t(b)+16\t\t; JSAMPARRAY input_data\n%define output_data_ptr(b)\t(b)+20\t\t; JSAMPARRAY * output_data_ptr\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_MMWORD\t; mmword wk[WK_NUM]\n%define WK_NUM\t\t4\n%define gotptr\t\twk(0)-SIZEOF_POINTER\t; void * gotptr\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v2_fancy_upsample_mmx)\n\nEXTN(jsimd_h2v2_fancy_upsample_mmx):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_MMWORD)\t; align to 64 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [wk(0)]\n\tpushpic\teax\t\t; make a room for GOT address\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t\t; get GOT address\n\tmovpic\tPOINTER [gotptr], ebx\t; save GOT address\n\n\tmov\tedx,eax\t\t\t\t; edx = original ebp\n\tmov\teax, JDIMENSION [downsamp_width(edx)]  ; colctr\n\ttest\teax,eax\n\tjz\tnear .return\n\n\tmov\tecx, INT [max_v_samp(edx)]\t; rowctr\n\ttest\tecx,ecx\n\tjz\tnear .return\n\n\tmov\tesi, JSAMPARRAY [input_data(edx)]\t; input_data\n\tmov\tedi, POINTER [output_data_ptr(edx)]\n\tmov\tedi, JSAMPARRAY [edi]\t\t\t; output_data\n\talignx\t16,7\n.rowloop:\n\tpush\teax\t\t\t\t\t; colctr\n\tpush\tecx\n\tpush\tedi\n\tpush\tesi\n\n\tmov\tecx, JSAMPROW [esi-1*SIZEOF_JSAMPROW]\t; inptr1(above)\n\tmov\tebx, JSAMPROW [esi+0*SIZEOF_JSAMPROW]\t; inptr0\n\tmov\tesi, JSAMPROW [esi+1*SIZEOF_JSAMPROW]\t; inptr1(below)\n\tmov\tedx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\t; outptr0\n\tmov\tedi, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\t; outptr1\n\n\ttest\teax, SIZEOF_MMWORD-1\n\tjz\tshort .skip\n\tpush\tedx\n\tmov\tdl, JSAMPLE [ecx+(eax-1)*SIZEOF_JSAMPLE]\n\tmov\tJSAMPLE [ecx+eax*SIZEOF_JSAMPLE], dl\n\tmov\tdl, JSAMPLE [ebx+(eax-1)*SIZEOF_JSAMPLE]\n\tmov\tJSAMPLE [ebx+eax*SIZEOF_JSAMPLE], dl\n\tmov\tdl, JSAMPLE [esi+(eax-1)*SIZEOF_JSAMPLE]\n\tmov\tJSAMPLE [esi+eax*SIZEOF_JSAMPLE], dl\t; insert a dummy sample\n\tpop\tedx\n.skip:\n\t; -- process the first column block\n\n\tmovq\tmm0, MMWORD [ebx+0*SIZEOF_MMWORD]\t; mm0=row[ 0][0]\n\tmovq\tmm1, MMWORD [ecx+0*SIZEOF_MMWORD]\t; mm1=row[-1][0]\n\tmovq\tmm2, MMWORD [esi+0*SIZEOF_MMWORD]\t; mm2=row[+1][0]\n\n\tpushpic\tebx\n\tmovpic\tebx, POINTER [gotptr]\t; load GOT address\n\n\tpxor      mm3,mm3\t\t; mm3=(all 0's)\n\tmovq      mm4,mm0\n\tpunpcklbw mm0,mm3\t\t; mm0=row[ 0][0]( 0 1 2 3)\n\tpunpckhbw mm4,mm3\t\t; mm4=row[ 0][0]( 4 5 6 7)\n\tmovq      mm5,mm1\n\tpunpcklbw mm1,mm3\t\t; mm1=row[-1][0]( 0 1 2 3)\n\tpunpckhbw mm5,mm3\t\t; mm5=row[-1][0]( 4 5 6 7)\n\tmovq      mm6,mm2\n\tpunpcklbw mm2,mm3\t\t; mm2=row[+1][0]( 0 1 2 3)\n\tpunpckhbw mm6,mm3\t\t; mm6=row[+1][0]( 4 5 6 7)\n\n\tpmullw\tmm0,[GOTOFF(ebx,PW_THREE)]\n\tpmullw\tmm4,[GOTOFF(ebx,PW_THREE)]\n\n\tpcmpeqb\tmm7,mm7\n\tpsrlq\tmm7,(SIZEOF_MMWORD-2)*BYTE_BIT\n\n\tpaddw\tmm1,mm0\t\t\t; mm1=Int0L=( 0 1 2 3)\n\tpaddw\tmm5,mm4\t\t\t; mm5=Int0H=( 4 5 6 7)\n\tpaddw\tmm2,mm0\t\t\t; mm2=Int1L=( 0 1 2 3)\n\tpaddw\tmm6,mm4\t\t\t; mm6=Int1H=( 4 5 6 7)\n\n\tmovq\tMMWORD [edx+0*SIZEOF_MMWORD], mm1\t; temporarily save\n\tmovq\tMMWORD [edx+1*SIZEOF_MMWORD], mm5\t; the intermediate data\n\tmovq\tMMWORD [edi+0*SIZEOF_MMWORD], mm2\n\tmovq\tMMWORD [edi+1*SIZEOF_MMWORD], mm6\n\n\tpand\tmm1,mm7\t\t\t; mm1=( 0 - - -)\n\tpand\tmm2,mm7\t\t\t; mm2=( 0 - - -)\n\n\tmovq\tMMWORD [wk(0)], mm1\n\tmovq\tMMWORD [wk(1)], mm2\n\n\tpoppic\tebx\n\n\tadd\teax, byte SIZEOF_MMWORD-1\n\tand\teax, byte -SIZEOF_MMWORD\n\tcmp\teax, byte SIZEOF_MMWORD\n\tja\tshort .columnloop\n\talignx\t16,7\n\n.columnloop_last:\n\t; -- process the last column block\n\n\tpushpic\tebx\n\tmovpic\tebx, POINTER [gotptr]\t; load GOT address\n\n\tpcmpeqb\tmm1,mm1\n\tpsllq\tmm1,(SIZEOF_MMWORD-2)*BYTE_BIT\n\tmovq\tmm2,mm1\n\n\tpand\tmm1, MMWORD [edx+1*SIZEOF_MMWORD]\t; mm1=( - - - 7)\n\tpand\tmm2, MMWORD [edi+1*SIZEOF_MMWORD]\t; mm2=( - - - 7)\n\n\tmovq\tMMWORD [wk(2)], mm1\n\tmovq\tMMWORD [wk(3)], mm2\n\n\tjmp\tshort .upsample\n\talignx\t16,7\n\n.columnloop:\n\t; -- process the next column block\n\n\tmovq\tmm0, MMWORD [ebx+1*SIZEOF_MMWORD]\t; mm0=row[ 0][1]\n\tmovq\tmm1, MMWORD [ecx+1*SIZEOF_MMWORD]\t; mm1=row[-1][1]\n\tmovq\tmm2, MMWORD [esi+1*SIZEOF_MMWORD]\t; mm2=row[+1][1]\n\n\tpushpic\tebx\n\tmovpic\tebx, POINTER [gotptr]\t; load GOT address\n\n\tpxor      mm3,mm3\t\t; mm3=(all 0's)\n\tmovq      mm4,mm0\n\tpunpcklbw mm0,mm3\t\t; mm0=row[ 0][1]( 0 1 2 3)\n\tpunpckhbw mm4,mm3\t\t; mm4=row[ 0][1]( 4 5 6 7)\n\tmovq      mm5,mm1\n\tpunpcklbw mm1,mm3\t\t; mm1=row[-1][1]( 0 1 2 3)\n\tpunpckhbw mm5,mm3\t\t; mm5=row[-1][1]( 4 5 6 7)\n\tmovq      mm6,mm2\n\tpunpcklbw mm2,mm3\t\t; mm2=row[+1][1]( 0 1 2 3)\n\tpunpckhbw mm6,mm3\t\t; mm6=row[+1][1]( 4 5 6 7)\n\n\tpmullw\tmm0,[GOTOFF(ebx,PW_THREE)]\n\tpmullw\tmm4,[GOTOFF(ebx,PW_THREE)]\n\n\tpaddw\tmm1,mm0\t\t\t; mm1=Int0L=( 0 1 2 3)\n\tpaddw\tmm5,mm4\t\t\t; mm5=Int0H=( 4 5 6 7)\n\tpaddw\tmm2,mm0\t\t\t; mm2=Int1L=( 0 1 2 3)\n\tpaddw\tmm6,mm4\t\t\t; mm6=Int1H=( 4 5 6 7)\n\n\tmovq\tMMWORD [edx+2*SIZEOF_MMWORD], mm1\t; temporarily save\n\tmovq\tMMWORD [edx+3*SIZEOF_MMWORD], mm5\t; the intermediate data\n\tmovq\tMMWORD [edi+2*SIZEOF_MMWORD], mm2\n\tmovq\tMMWORD [edi+3*SIZEOF_MMWORD], mm6\n\n\tpsllq\tmm1,(SIZEOF_MMWORD-2)*BYTE_BIT\t; mm1=( - - - 0)\n\tpsllq\tmm2,(SIZEOF_MMWORD-2)*BYTE_BIT\t; mm2=( - - - 0)\n\n\tmovq\tMMWORD [wk(2)], mm1\n\tmovq\tMMWORD [wk(3)], mm2\n\n.upsample:\n\t; -- process the upper row\n\n\tmovq\tmm7, MMWORD [edx+0*SIZEOF_MMWORD]\t; mm7=Int0L=( 0 1 2 3)\n\tmovq\tmm3, MMWORD [edx+1*SIZEOF_MMWORD]\t; mm3=Int0H=( 4 5 6 7)\n\n\tmovq\tmm0,mm7\n\tmovq\tmm4,mm3\n\tpsrlq\tmm0,2*BYTE_BIT\t\t\t; mm0=( 1 2 3 -)\n\tpsllq\tmm4,(SIZEOF_MMWORD-2)*BYTE_BIT\t; mm4=( - - - 4)\n\tmovq\tmm5,mm7\n\tmovq\tmm6,mm3\n\tpsrlq\tmm5,(SIZEOF_MMWORD-2)*BYTE_BIT\t; mm5=( 3 - - -)\n\tpsllq\tmm6,2*BYTE_BIT\t\t\t; mm6=( - 4 5 6)\n\n\tpor\tmm0,mm4\t\t\t\t; mm0=( 1 2 3 4)\n\tpor\tmm5,mm6\t\t\t\t; mm5=( 3 4 5 6)\n\n\tmovq\tmm1,mm7\n\tmovq\tmm2,mm3\n\tpsllq\tmm1,2*BYTE_BIT\t\t\t; mm1=( - 0 1 2)\n\tpsrlq\tmm2,2*BYTE_BIT\t\t\t; mm2=( 5 6 7 -)\n\tmovq\tmm4,mm3\n\tpsrlq\tmm4,(SIZEOF_MMWORD-2)*BYTE_BIT\t; mm4=( 7 - - -)\n\n\tpor\tmm1, MMWORD [wk(0)]\t\t; mm1=(-1 0 1 2)\n\tpor\tmm2, MMWORD [wk(2)]\t\t; mm2=( 5 6 7 8)\n\n\tmovq\tMMWORD [wk(0)], mm4\n\n\tpmullw\tmm7,[GOTOFF(ebx,PW_THREE)]\n\tpmullw\tmm3,[GOTOFF(ebx,PW_THREE)]\n\tpaddw\tmm1,[GOTOFF(ebx,PW_EIGHT)]\n\tpaddw\tmm5,[GOTOFF(ebx,PW_EIGHT)]\n\tpaddw\tmm0,[GOTOFF(ebx,PW_SEVEN)]\n\tpaddw\tmm2,[GOTOFF(ebx,PW_SEVEN)]\n\n\tpaddw\tmm1,mm7\n\tpaddw\tmm5,mm3\n\tpsrlw\tmm1,4\t\t\t; mm1=Out0LE=( 0  2  4  6)\n\tpsrlw\tmm5,4\t\t\t; mm5=Out0HE=( 8 10 12 14)\n\tpaddw\tmm0,mm7\n\tpaddw\tmm2,mm3\n\tpsrlw\tmm0,4\t\t\t; mm0=Out0LO=( 1  3  5  7)\n\tpsrlw\tmm2,4\t\t\t; mm2=Out0HO=( 9 11 13 15)\n\n\tpsllw\tmm0,BYTE_BIT\n\tpsllw\tmm2,BYTE_BIT\n\tpor\tmm1,mm0\t\t\t; mm1=Out0L=( 0  1  2  3  4  5  6  7)\n\tpor\tmm5,mm2\t\t\t; mm5=Out0H=( 8  9 10 11 12 13 14 15)\n\n\tmovq\tMMWORD [edx+0*SIZEOF_MMWORD], mm1\n\tmovq\tMMWORD [edx+1*SIZEOF_MMWORD], mm5\n\n\t; -- process the lower row\n\n\tmovq\tmm6, MMWORD [edi+0*SIZEOF_MMWORD]\t; mm6=Int1L=( 0 1 2 3)\n\tmovq\tmm4, MMWORD [edi+1*SIZEOF_MMWORD]\t; mm4=Int1H=( 4 5 6 7)\n\n\tmovq\tmm7,mm6\n\tmovq\tmm3,mm4\n\tpsrlq\tmm7,2*BYTE_BIT\t\t\t; mm7=( 1 2 3 -)\n\tpsllq\tmm3,(SIZEOF_MMWORD-2)*BYTE_BIT\t; mm3=( - - - 4)\n\tmovq\tmm0,mm6\n\tmovq\tmm2,mm4\n\tpsrlq\tmm0,(SIZEOF_MMWORD-2)*BYTE_BIT\t; mm0=( 3 - - -)\n\tpsllq\tmm2,2*BYTE_BIT\t\t\t; mm2=( - 4 5 6)\n\n\tpor\tmm7,mm3\t\t\t\t; mm7=( 1 2 3 4)\n\tpor\tmm0,mm2\t\t\t\t; mm0=( 3 4 5 6)\n\n\tmovq\tmm1,mm6\n\tmovq\tmm5,mm4\n\tpsllq\tmm1,2*BYTE_BIT\t\t\t; mm1=( - 0 1 2)\n\tpsrlq\tmm5,2*BYTE_BIT\t\t\t; mm5=( 5 6 7 -)\n\tmovq\tmm3,mm4\n\tpsrlq\tmm3,(SIZEOF_MMWORD-2)*BYTE_BIT\t; mm3=( 7 - - -)\n\n\tpor\tmm1, MMWORD [wk(1)]\t\t; mm1=(-1 0 1 2)\n\tpor\tmm5, MMWORD [wk(3)]\t\t; mm5=( 5 6 7 8)\n\n\tmovq\tMMWORD [wk(1)], mm3\n\n\tpmullw\tmm6,[GOTOFF(ebx,PW_THREE)]\n\tpmullw\tmm4,[GOTOFF(ebx,PW_THREE)]\n\tpaddw\tmm1,[GOTOFF(ebx,PW_EIGHT)]\n\tpaddw\tmm0,[GOTOFF(ebx,PW_EIGHT)]\n\tpaddw\tmm7,[GOTOFF(ebx,PW_SEVEN)]\n\tpaddw\tmm5,[GOTOFF(ebx,PW_SEVEN)]\n\n\tpaddw\tmm1,mm6\n\tpaddw\tmm0,mm4\n\tpsrlw\tmm1,4\t\t\t; mm1=Out1LE=( 0  2  4  6)\n\tpsrlw\tmm0,4\t\t\t; mm0=Out1HE=( 8 10 12 14)\n\tpaddw\tmm7,mm6\n\tpaddw\tmm5,mm4\n\tpsrlw\tmm7,4\t\t\t; mm7=Out1LO=( 1  3  5  7)\n\tpsrlw\tmm5,4\t\t\t; mm5=Out1HO=( 9 11 13 15)\n\n\tpsllw\tmm7,BYTE_BIT\n\tpsllw\tmm5,BYTE_BIT\n\tpor\tmm1,mm7\t\t\t; mm1=Out1L=( 0  1  2  3  4  5  6  7)\n\tpor\tmm0,mm5\t\t\t; mm0=Out1H=( 8  9 10 11 12 13 14 15)\n\n\tmovq\tMMWORD [edi+0*SIZEOF_MMWORD], mm1\n\tmovq\tMMWORD [edi+1*SIZEOF_MMWORD], mm0\n\n\tpoppic\tebx\n\n\tsub\teax, byte SIZEOF_MMWORD\n\tadd\tecx, byte 1*SIZEOF_MMWORD\t; inptr1(above)\n\tadd\tebx, byte 1*SIZEOF_MMWORD\t; inptr0\n\tadd\tesi, byte 1*SIZEOF_MMWORD\t; inptr1(below)\n\tadd\tedx, byte 2*SIZEOF_MMWORD\t; outptr0\n\tadd\tedi, byte 2*SIZEOF_MMWORD\t; outptr1\n\tcmp\teax, byte SIZEOF_MMWORD\n\tja\tnear .columnloop\n\ttest\teax,eax\n\tjnz\tnear .columnloop_last\n\n\tpop\tesi\n\tpop\tedi\n\tpop\tecx\n\tpop\teax\n\n\tadd\tesi, byte 1*SIZEOF_JSAMPROW\t; input_data\n\tadd\tedi, byte 2*SIZEOF_JSAMPROW\t; output_data\n\tsub\tecx, byte 2\t\t\t; rowctr\n\tjg\tnear .rowloop\n\n\temms\t\t; empty MMX state\n\n.return:\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; --------------------------------------------------------------------------\n;\n; Fast processing for the common case of 2:1 horizontal and 1:1 vertical.\n; It's still a box filter.\n;\n; GLOBAL(void)\n; jsimd_h2v1_upsample_mmx (int max_v_samp_factor,\n;                          JDIMENSION output_width,\n;                          JSAMPARRAY input_data,\n;                          JSAMPARRAY * output_data_ptr);\n;\n\n%define max_v_samp(b)\t\t(b)+8\t\t\t; int max_v_samp_factor\n%define output_width(b)\t(b)+12\t\t; JDIMENSION output_width\n%define input_data(b)\t\t(b)+16\t\t; JSAMPARRAY input_data\n%define output_data_ptr(b)\t(b)+20\t\t; JSAMPARRAY * output_data_ptr\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v1_upsample_mmx)\n\nEXTN(jsimd_h2v1_upsample_mmx):\n\tpush\tebp\n\tmov\tebp,esp\n;\tpush\tebx\t\t; unused\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tmov\tedx, JDIMENSION [output_width(ebp)]\n\tadd\tedx, byte (2*SIZEOF_MMWORD)-1\n\tand\tedx, byte -(2*SIZEOF_MMWORD)\n\tjz\tshort .return\n\n\tmov\tecx, INT [max_v_samp(ebp)]\t; rowctr\n\ttest\tecx,ecx\n\tjz\tshort .return\n\n\tmov\tesi, JSAMPARRAY [input_data(ebp)]\t; input_data\n\tmov\tedi, POINTER [output_data_ptr(ebp)]\n\tmov\tedi, JSAMPARRAY [edi]\t\t\t; output_data\n\talignx\t16,7\n.rowloop:\n\tpush\tedi\n\tpush\tesi\n\n\tmov\tesi, JSAMPROW [esi]\t\t; inptr\n\tmov\tedi, JSAMPROW [edi]\t\t; outptr\n\tmov\teax,edx\t\t\t\t; colctr\n\talignx\t16,7\n.columnloop:\n\n\tmovq\tmm0, MMWORD [esi+0*SIZEOF_MMWORD]\n\n\tmovq      mm1,mm0\n\tpunpcklbw mm0,mm0\n\tpunpckhbw mm1,mm1\n\n\tmovq\tMMWORD [edi+0*SIZEOF_MMWORD], mm0\n\tmovq\tMMWORD [edi+1*SIZEOF_MMWORD], mm1\n\n\tsub\teax, byte 2*SIZEOF_MMWORD\n\tjz\tshort .nextrow\n\n\tmovq\tmm2, MMWORD [esi+1*SIZEOF_MMWORD]\n\n\tmovq      mm3,mm2\n\tpunpcklbw mm2,mm2\n\tpunpckhbw mm3,mm3\n\n\tmovq\tMMWORD [edi+2*SIZEOF_MMWORD], mm2\n\tmovq\tMMWORD [edi+3*SIZEOF_MMWORD], mm3\n\n\tsub\teax, byte 2*SIZEOF_MMWORD\n\tjz\tshort .nextrow\n\n\tadd\tesi, byte 2*SIZEOF_MMWORD\t; inptr\n\tadd\tedi, byte 4*SIZEOF_MMWORD\t; outptr\n\tjmp\tshort .columnloop\n\talignx\t16,7\n\n.nextrow:\n\tpop\tesi\n\tpop\tedi\n\n\tadd\tesi, byte SIZEOF_JSAMPROW\t; input_data\n\tadd\tedi, byte SIZEOF_JSAMPROW\t; output_data\n\tdec\tecx\t\t\t\t; rowctr\n\tjg\tshort .rowloop\n\n\temms\t\t; empty MMX state\n\n.return:\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n;\tpop\tebx\t\t; unused\n\tpop\tebp\n\tret\n\n; --------------------------------------------------------------------------\n;\n; Fast processing for the common case of 2:1 horizontal and 2:1 vertical.\n; It's still a box filter.\n;\n; GLOBAL(void)\n; jsimd_h2v2_upsample_mmx (int max_v_samp_factor,\n;                          JDIMENSION output_width,\n;                          JSAMPARRAY input_data,\n;                          JSAMPARRAY * output_data_ptr);\n;\n\n%define max_v_samp(b)\t\t(b)+8\t\t\t; int max_v_samp_factor\n%define output_width(b)\t(b)+12\t\t; JDIMENSION output_width\n%define input_data(b)\t\t(b)+16\t\t; JSAMPARRAY input_data\n%define output_data_ptr(b)\t(b)+20\t\t; JSAMPARRAY * output_data_ptr\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v2_upsample_mmx)\n\nEXTN(jsimd_h2v2_upsample_mmx):\n\tpush\tebp\n\tmov\tebp,esp\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tmov\tedx, JDIMENSION [output_width(ebp)]\n\tadd\tedx, byte (2*SIZEOF_MMWORD)-1\n\tand\tedx, byte -(2*SIZEOF_MMWORD)\n\tjz\tnear .return\n\n\tmov\tecx, INT [max_v_samp(ebp)]\t; rowctr\n\ttest\tecx,ecx\n\tjz\tshort .return\n\n\tmov\tesi, JSAMPARRAY [input_data(ebp)]\t; input_data\n\tmov\tedi, POINTER [output_data_ptr(ebp)]\n\tmov\tedi, JSAMPARRAY [edi]\t\t\t; output_data\n\talignx\t16,7\n.rowloop:\n\tpush\tedi\n\tpush\tesi\n\n\tmov\tesi, JSAMPROW [esi]\t\t\t; inptr\n\tmov\tebx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\t; outptr0\n\tmov\tedi, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\t; outptr1\n\tmov\teax,edx\t\t\t\t\t; colctr\n\talignx\t16,7\n.columnloop:\n\n\tmovq\tmm0, MMWORD [esi+0*SIZEOF_MMWORD]\n\n\tmovq      mm1,mm0\n\tpunpcklbw mm0,mm0\n\tpunpckhbw mm1,mm1\n\n\tmovq\tMMWORD [ebx+0*SIZEOF_MMWORD], mm0\n\tmovq\tMMWORD [ebx+1*SIZEOF_MMWORD], mm1\n\tmovq\tMMWORD [edi+0*SIZEOF_MMWORD], mm0\n\tmovq\tMMWORD [edi+1*SIZEOF_MMWORD], mm1\n\n\tsub\teax, byte 2*SIZEOF_MMWORD\n\tjz\tshort .nextrow\n\n\tmovq\tmm2, MMWORD [esi+1*SIZEOF_MMWORD]\n\n\tmovq      mm3,mm2\n\tpunpcklbw mm2,mm2\n\tpunpckhbw mm3,mm3\n\n\tmovq\tMMWORD [ebx+2*SIZEOF_MMWORD], mm2\n\tmovq\tMMWORD [ebx+3*SIZEOF_MMWORD], mm3\n\tmovq\tMMWORD [edi+2*SIZEOF_MMWORD], mm2\n\tmovq\tMMWORD [edi+3*SIZEOF_MMWORD], mm3\n\n\tsub\teax, byte 2*SIZEOF_MMWORD\n\tjz\tshort .nextrow\n\n\tadd\tesi, byte 2*SIZEOF_MMWORD\t; inptr\n\tadd\tebx, byte 4*SIZEOF_MMWORD\t; outptr0\n\tadd\tedi, byte 4*SIZEOF_MMWORD\t; outptr1\n\tjmp\tshort .columnloop\n\talignx\t16,7\n\n.nextrow:\n\tpop\tesi\n\tpop\tedi\n\n\tadd\tesi, byte 1*SIZEOF_JSAMPROW\t; input_data\n\tadd\tedi, byte 2*SIZEOF_JSAMPROW\t; output_data\n\tsub\tecx, byte 2\t\t\t; rowctr\n\tjg\tshort .rowloop\n\n\temms\t\t; empty MMX state\n\n.return:\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jdsamss2-64.asm",
    "content": ";\n; jdsamss2-64.asm - upsampling (64-bit SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2009 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_fancy_upsample_sse2)\n\nEXTN(jconst_fancy_upsample_sse2):\n\nPW_ONE\t\ttimes 8 dw  1\nPW_TWO\t\ttimes 8 dw  2\nPW_THREE\ttimes 8 dw  3\nPW_SEVEN\ttimes 8 dw  7\nPW_EIGHT\ttimes 8 dw  8\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t64\n;\n; Fancy processing for the common case of 2:1 horizontal and 1:1 vertical.\n;\n; The upsampling algorithm is linear interpolation between pixel centers,\n; also known as a \"triangle filter\".  This is a good compromise between\n; speed and visual quality.  The centers of the output pixels are 1/4 and 3/4\n; of the way between input pixel centers.\n;\n; GLOBAL(void)\n; jsimd_h2v1_fancy_upsample_sse2 (int max_v_samp_factor,\n;                                 JDIMENSION downsampled_width,\n;                                 JSAMPARRAY input_data,\n;                                 JSAMPARRAY * output_data_ptr);\n;\n\n; r10 = int max_v_samp_factor\n; r11 = JDIMENSION downsampled_width\n; r12 = JSAMPARRAY input_data\n; r13 = JSAMPARRAY * output_data_ptr\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v1_fancy_upsample_sse2)\n\nEXTN(jsimd_h2v1_fancy_upsample_sse2):\n\tpush\trbp\n\tmov\trax,rsp\n\tmov\trbp,rsp\n\tcollect_args\n\n\tmov\trax, r11  ; colctr\n\ttest\trax,rax\n\tjz\tnear .return\n\n\tmov\trcx, r10\t; rowctr\n\ttest\trcx,rcx\n\tjz\tnear .return\n\n\tmov\trsi, r12\t; input_data\n\tmov\trdi, r13\n\tmov\trdi, JSAMPARRAY [rdi]\t\t\t; output_data\n.rowloop:\n\tpush\trax\t\t\t; colctr\n\tpush\trdi\n\tpush\trsi\n\n\tmov\trsi, JSAMPROW [rsi]\t; inptr\n\tmov\trdi, JSAMPROW [rdi]\t; outptr\n\n\ttest\trax, SIZEOF_XMMWORD-1\n\tjz\tshort .skip\n\tmov\tdl, JSAMPLE [rsi+(rax-1)*SIZEOF_JSAMPLE]\n\tmov\tJSAMPLE [rsi+rax*SIZEOF_JSAMPLE], dl\t; insert a dummy sample\n.skip:\n\tpxor\txmm0,xmm0\t\t; xmm0=(all 0's)\n\tpcmpeqb\txmm7,xmm7\n\tpsrldq\txmm7,(SIZEOF_XMMWORD-1)\n\tpand\txmm7, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n\n\tadd\trax, byte SIZEOF_XMMWORD-1\n\tand\trax, byte -SIZEOF_XMMWORD\n\tcmp\trax, byte SIZEOF_XMMWORD\n\tja\tshort .columnloop\n\n.columnloop_last:\n\tpcmpeqb\txmm6,xmm6\n\tpslldq\txmm6,(SIZEOF_XMMWORD-1)\n\tpand\txmm6, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n\tjmp\tshort .upsample\n\n.columnloop:\n\tmovdqa\txmm6, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n\tpslldq\txmm6,(SIZEOF_XMMWORD-1)\n\n.upsample:\n\tmovdqa\txmm1, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n\tmovdqa\txmm2,xmm1\n\tmovdqa\txmm3,xmm1\t\t; xmm1=( 0  1  2 ... 13 14 15)\n\tpslldq\txmm2,1\t\t\t; xmm2=(--  0  1 ... 12 13 14)\n\tpsrldq\txmm3,1\t\t\t; xmm3=( 1  2  3 ... 14 15 --)\n\n\tpor\txmm2,xmm7\t\t; xmm2=(-1  0  1 ... 12 13 14)\n\tpor\txmm3,xmm6\t\t; xmm3=( 1  2  3 ... 14 15 16)\n\n\tmovdqa\txmm7,xmm1\n\tpsrldq\txmm7,(SIZEOF_XMMWORD-1)\t; xmm7=(15 -- -- ... -- -- --)\n\n\tmovdqa    xmm4,xmm1\n\tpunpcklbw xmm1,xmm0\t\t; xmm1=( 0  1  2  3  4  5  6  7)\n\tpunpckhbw xmm4,xmm0\t\t; xmm4=( 8  9 10 11 12 13 14 15)\n\tmovdqa    xmm5,xmm2\n\tpunpcklbw xmm2,xmm0\t\t; xmm2=(-1  0  1  2  3  4  5  6)\n\tpunpckhbw xmm5,xmm0\t\t; xmm5=( 7  8  9 10 11 12 13 14)\n\tmovdqa    xmm6,xmm3\n\tpunpcklbw xmm3,xmm0\t\t; xmm3=( 1  2  3  4  5  6  7  8)\n\tpunpckhbw xmm6,xmm0\t\t; xmm6=( 9 10 11 12 13 14 15 16)\n\n\tpmullw\txmm1,[rel PW_THREE]\n\tpmullw\txmm4,[rel PW_THREE]\n\tpaddw\txmm2,[rel PW_ONE]\n\tpaddw\txmm5,[rel PW_ONE]\n\tpaddw\txmm3,[rel PW_TWO]\n\tpaddw\txmm6,[rel PW_TWO]\n\n\tpaddw\txmm2,xmm1\n\tpaddw\txmm5,xmm4\n\tpsrlw\txmm2,2\t\t\t; xmm2=OutLE=( 0  2  4  6  8 10 12 14)\n\tpsrlw\txmm5,2\t\t\t; xmm5=OutHE=(16 18 20 22 24 26 28 30)\n\tpaddw\txmm3,xmm1\n\tpaddw\txmm6,xmm4\n\tpsrlw\txmm3,2\t\t\t; xmm3=OutLO=( 1  3  5  7  9 11 13 15)\n\tpsrlw\txmm6,2\t\t\t; xmm6=OutHO=(17 19 21 23 25 27 29 31)\n\n\tpsllw\txmm3,BYTE_BIT\n\tpsllw\txmm6,BYTE_BIT\n\tpor\txmm2,xmm3\t\t; xmm2=OutL=( 0  1  2 ... 13 14 15)\n\tpor\txmm5,xmm6\t\t; xmm5=OutH=(16 17 18 ... 29 30 31)\n\n\tmovdqa\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmm2\n\tmovdqa\tXMMWORD [rdi+1*SIZEOF_XMMWORD], xmm5\n\n\tsub\trax, byte SIZEOF_XMMWORD\n\tadd\trsi, byte 1*SIZEOF_XMMWORD\t; inptr\n\tadd\trdi, byte 2*SIZEOF_XMMWORD\t; outptr\n\tcmp\trax, byte SIZEOF_XMMWORD\n\tja\tnear .columnloop\n\ttest\teax,eax\n\tjnz\tnear .columnloop_last\n\n\tpop\trsi\n\tpop\trdi\n\tpop\trax\n\n\tadd\trsi, byte SIZEOF_JSAMPROW\t; input_data\n\tadd\trdi, byte SIZEOF_JSAMPROW\t; output_data\n\tdec\trcx\t\t\t\t; rowctr\n\tjg\tnear .rowloop\n\n.return:\n\tuncollect_args\n\tpop\trbp\n\tret\n\n; --------------------------------------------------------------------------\n;\n; Fancy processing for the common case of 2:1 horizontal and 2:1 vertical.\n; Again a triangle filter; see comments for h2v1 case, above.\n;\n; GLOBAL(void)\n; jsimd_h2v2_fancy_upsample_sse2 (int max_v_samp_factor,\n;                                 JDIMENSION downsampled_width,\n;                                 JSAMPARRAY input_data,\n;                                 JSAMPARRAY * output_data_ptr);\n;\n\n; r10 = int max_v_samp_factor\n; r11 = JDIMENSION downsampled_width\n; r12 = JSAMPARRAY input_data\n; r13 = JSAMPARRAY * output_data_ptr\n\n%define wk(i)\t\trbp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t4\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v2_fancy_upsample_sse2)\n\nEXTN(jsimd_h2v2_fancy_upsample_sse2):\n\tpush\trbp\n\tmov\trax,rsp\t\t\t\t; rax = original rbp\n\tsub\trsp, byte 4\n\tand\trsp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[rsp],rax\n\tmov\trbp,rsp\t\t\t\t; rbp = aligned rbp\n\tlea\trsp, [wk(0)]\n\tcollect_args\n\tpush\trbx\n\n\tmov\trax, r11  ; colctr\n\ttest\trax,rax\n\tjz\tnear .return\n\n\tmov\trcx, r10\t; rowctr\n\ttest\trcx,rcx\n\tjz\tnear .return\n\n\tmov\trsi, r12\t; input_data\n\tmov\trdi, r13\n\tmov\trdi, JSAMPARRAY [rdi]\t\t\t; output_data\n.rowloop:\n\tpush\trax\t\t\t\t\t; colctr\n\tpush\trcx\n\tpush\trdi\n\tpush\trsi\n\n\tmov\trcx, JSAMPROW [rsi-1*SIZEOF_JSAMPROW]\t; inptr1(above)\n\tmov\trbx, JSAMPROW [rsi+0*SIZEOF_JSAMPROW]\t; inptr0\n\tmov\trsi, JSAMPROW [rsi+1*SIZEOF_JSAMPROW]\t; inptr1(below)\n\tmov\trdx, JSAMPROW [rdi+0*SIZEOF_JSAMPROW]\t; outptr0\n\tmov\trdi, JSAMPROW [rdi+1*SIZEOF_JSAMPROW]\t; outptr1\n\n\ttest\trax, SIZEOF_XMMWORD-1\n\tjz\tshort .skip\n\tpush\trdx\n\tmov\tdl, JSAMPLE [rcx+(rax-1)*SIZEOF_JSAMPLE]\n\tmov\tJSAMPLE [rcx+rax*SIZEOF_JSAMPLE], dl\n\tmov\tdl, JSAMPLE [rbx+(rax-1)*SIZEOF_JSAMPLE]\n\tmov\tJSAMPLE [rbx+rax*SIZEOF_JSAMPLE], dl\n\tmov\tdl, JSAMPLE [rsi+(rax-1)*SIZEOF_JSAMPLE]\n\tmov\tJSAMPLE [rsi+rax*SIZEOF_JSAMPLE], dl\t; insert a dummy sample\n\tpop\trdx\n.skip:\n\t; -- process the first column block\n\n\tmovdqa\txmm0, XMMWORD [rbx+0*SIZEOF_XMMWORD]\t; xmm0=row[ 0][0]\n\tmovdqa\txmm1, XMMWORD [rcx+0*SIZEOF_XMMWORD]\t; xmm1=row[-1][0]\n\tmovdqa\txmm2, XMMWORD [rsi+0*SIZEOF_XMMWORD]\t; xmm2=row[+1][0]\n\n\tpxor      xmm3,xmm3\t\t; xmm3=(all 0's)\n\tmovdqa    xmm4,xmm0\n\tpunpcklbw xmm0,xmm3\t\t; xmm0=row[ 0]( 0  1  2  3  4  5  6  7)\n\tpunpckhbw xmm4,xmm3\t\t; xmm4=row[ 0]( 8  9 10 11 12 13 14 15)\n\tmovdqa    xmm5,xmm1\n\tpunpcklbw xmm1,xmm3\t\t; xmm1=row[-1]( 0  1  2  3  4  5  6  7)\n\tpunpckhbw xmm5,xmm3\t\t; xmm5=row[-1]( 8  9 10 11 12 13 14 15)\n\tmovdqa    xmm6,xmm2\n\tpunpcklbw xmm2,xmm3\t\t; xmm2=row[+1]( 0  1  2  3  4  5  6  7)\n\tpunpckhbw xmm6,xmm3\t\t; xmm6=row[+1]( 8  9 10 11 12 13 14 15)\n\n\tpmullw\txmm0,[rel PW_THREE]\n\tpmullw\txmm4,[rel PW_THREE]\n\n\tpcmpeqb\txmm7,xmm7\n\tpsrldq\txmm7,(SIZEOF_XMMWORD-2)\n\n\tpaddw\txmm1,xmm0\t\t; xmm1=Int0L=( 0  1  2  3  4  5  6  7)\n\tpaddw\txmm5,xmm4\t\t; xmm5=Int0H=( 8  9 10 11 12 13 14 15)\n\tpaddw\txmm2,xmm0\t\t; xmm2=Int1L=( 0  1  2  3  4  5  6  7)\n\tpaddw\txmm6,xmm4\t\t; xmm6=Int1H=( 8  9 10 11 12 13 14 15)\n\n\tmovdqa\tXMMWORD [rdx+0*SIZEOF_XMMWORD], xmm1\t; temporarily save\n\tmovdqa\tXMMWORD [rdx+1*SIZEOF_XMMWORD], xmm5\t; the intermediate data\n\tmovdqa\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmm2\n\tmovdqa\tXMMWORD [rdi+1*SIZEOF_XMMWORD], xmm6\n\n\tpand\txmm1,xmm7\t\t; xmm1=( 0 -- -- -- -- -- -- --)\n\tpand\txmm2,xmm7\t\t; xmm2=( 0 -- -- -- -- -- -- --)\n\n\tmovdqa\tXMMWORD [wk(0)], xmm1\n\tmovdqa\tXMMWORD [wk(1)], xmm2\n\n\tadd\trax, byte SIZEOF_XMMWORD-1\n\tand\trax, byte -SIZEOF_XMMWORD\n\tcmp\trax, byte SIZEOF_XMMWORD\n\tja\tshort .columnloop\n\n.columnloop_last:\n\t; -- process the last column block\n\n\tpcmpeqb\txmm1,xmm1\n\tpslldq\txmm1,(SIZEOF_XMMWORD-2)\n\tmovdqa\txmm2,xmm1\n\n\tpand\txmm1, XMMWORD [rdx+1*SIZEOF_XMMWORD]\n\tpand\txmm2, XMMWORD [rdi+1*SIZEOF_XMMWORD]\n\n\tmovdqa\tXMMWORD [wk(2)], xmm1\t; xmm1=(-- -- -- -- -- -- -- 15)\n\tmovdqa\tXMMWORD [wk(3)], xmm2\t; xmm2=(-- -- -- -- -- -- -- 15)\n\n\tjmp\tnear .upsample\n\n.columnloop:\n\t; -- process the next column block\n\n\tmovdqa\txmm0, XMMWORD [rbx+1*SIZEOF_XMMWORD]\t; xmm0=row[ 0][1]\n\tmovdqa\txmm1, XMMWORD [rcx+1*SIZEOF_XMMWORD]\t; xmm1=row[-1][1]\n\tmovdqa\txmm2, XMMWORD [rsi+1*SIZEOF_XMMWORD]\t; xmm2=row[+1][1]\n\n\tpxor      xmm3,xmm3\t\t; xmm3=(all 0's)\n\tmovdqa    xmm4,xmm0\n\tpunpcklbw xmm0,xmm3\t\t; xmm0=row[ 0]( 0  1  2  3  4  5  6  7)\n\tpunpckhbw xmm4,xmm3\t\t; xmm4=row[ 0]( 8  9 10 11 12 13 14 15)\n\tmovdqa    xmm5,xmm1\n\tpunpcklbw xmm1,xmm3\t\t; xmm1=row[-1]( 0  1  2  3  4  5  6  7)\n\tpunpckhbw xmm5,xmm3\t\t; xmm5=row[-1]( 8  9 10 11 12 13 14 15)\n\tmovdqa    xmm6,xmm2\n\tpunpcklbw xmm2,xmm3\t\t; xmm2=row[+1]( 0  1  2  3  4  5  6  7)\n\tpunpckhbw xmm6,xmm3\t\t; xmm6=row[+1]( 8  9 10 11 12 13 14 15)\n\n\tpmullw\txmm0,[rel PW_THREE]\n\tpmullw\txmm4,[rel PW_THREE]\n\n\tpaddw\txmm1,xmm0\t\t; xmm1=Int0L=( 0  1  2  3  4  5  6  7)\n\tpaddw\txmm5,xmm4\t\t; xmm5=Int0H=( 8  9 10 11 12 13 14 15)\n\tpaddw\txmm2,xmm0\t\t; xmm2=Int1L=( 0  1  2  3  4  5  6  7)\n\tpaddw\txmm6,xmm4\t\t; xmm6=Int1H=( 8  9 10 11 12 13 14 15)\n\n\tmovdqa\tXMMWORD [rdx+2*SIZEOF_XMMWORD], xmm1\t; temporarily save\n\tmovdqa\tXMMWORD [rdx+3*SIZEOF_XMMWORD], xmm5\t; the intermediate data\n\tmovdqa\tXMMWORD [rdi+2*SIZEOF_XMMWORD], xmm2\n\tmovdqa\tXMMWORD [rdi+3*SIZEOF_XMMWORD], xmm6\n\n\tpslldq\txmm1,(SIZEOF_XMMWORD-2)\t; xmm1=(-- -- -- -- -- -- --  0)\n\tpslldq\txmm2,(SIZEOF_XMMWORD-2)\t; xmm2=(-- -- -- -- -- -- --  0)\n\n\tmovdqa\tXMMWORD [wk(2)], xmm1\n\tmovdqa\tXMMWORD [wk(3)], xmm2\n\n.upsample:\n\t; -- process the upper row\n\n\tmovdqa\txmm7, XMMWORD [rdx+0*SIZEOF_XMMWORD]\n\tmovdqa\txmm3, XMMWORD [rdx+1*SIZEOF_XMMWORD]\n\n\tmovdqa\txmm0,xmm7\t\t; xmm7=Int0L=( 0  1  2  3  4  5  6  7)\n\tmovdqa\txmm4,xmm3\t\t; xmm3=Int0H=( 8  9 10 11 12 13 14 15)\n\tpsrldq\txmm0,2\t\t\t; xmm0=( 1  2  3  4  5  6  7 --)\n\tpslldq\txmm4,(SIZEOF_XMMWORD-2)\t; xmm4=(-- -- -- -- -- -- --  8)\n\tmovdqa\txmm5,xmm7\n\tmovdqa\txmm6,xmm3\n\tpsrldq\txmm5,(SIZEOF_XMMWORD-2)\t; xmm5=( 7 -- -- -- -- -- -- --)\n\tpslldq\txmm6,2\t\t\t; xmm6=(--  8  9 10 11 12 13 14)\n\n\tpor\txmm0,xmm4\t\t; xmm0=( 1  2  3  4  5  6  7  8)\n\tpor\txmm5,xmm6\t\t; xmm5=( 7  8  9 10 11 12 13 14)\n\n\tmovdqa\txmm1,xmm7\n\tmovdqa\txmm2,xmm3\n\tpslldq\txmm1,2\t\t\t; xmm1=(--  0  1  2  3  4  5  6)\n\tpsrldq\txmm2,2\t\t\t; xmm2=( 9 10 11 12 13 14 15 --)\n\tmovdqa\txmm4,xmm3\n\tpsrldq\txmm4,(SIZEOF_XMMWORD-2)\t; xmm4=(15 -- -- -- -- -- -- --)\n\n\tpor\txmm1, XMMWORD [wk(0)]\t; xmm1=(-1  0  1  2  3  4  5  6)\n\tpor\txmm2, XMMWORD [wk(2)]\t; xmm2=( 9 10 11 12 13 14 15 16)\n\n\tmovdqa\tXMMWORD [wk(0)], xmm4\n\n\tpmullw\txmm7,[rel PW_THREE]\n\tpmullw\txmm3,[rel PW_THREE]\n\tpaddw\txmm1,[rel PW_EIGHT]\n\tpaddw\txmm5,[rel PW_EIGHT]\n\tpaddw\txmm0,[rel PW_SEVEN]\n\tpaddw\txmm2,[rel PW_SEVEN]\n\n\tpaddw\txmm1,xmm7\n\tpaddw\txmm5,xmm3\n\tpsrlw\txmm1,4\t\t\t; xmm1=Out0LE=( 0  2  4  6  8 10 12 14)\n\tpsrlw\txmm5,4\t\t\t; xmm5=Out0HE=(16 18 20 22 24 26 28 30)\n\tpaddw\txmm0,xmm7\n\tpaddw\txmm2,xmm3\n\tpsrlw\txmm0,4\t\t\t; xmm0=Out0LO=( 1  3  5  7  9 11 13 15)\n\tpsrlw\txmm2,4\t\t\t; xmm2=Out0HO=(17 19 21 23 25 27 29 31)\n\n\tpsllw\txmm0,BYTE_BIT\n\tpsllw\txmm2,BYTE_BIT\n\tpor\txmm1,xmm0\t\t; xmm1=Out0L=( 0  1  2 ... 13 14 15)\n\tpor\txmm5,xmm2\t\t; xmm5=Out0H=(16 17 18 ... 29 30 31)\n\n\tmovdqa\tXMMWORD [rdx+0*SIZEOF_XMMWORD], xmm1\n\tmovdqa\tXMMWORD [rdx+1*SIZEOF_XMMWORD], xmm5\n\n\t; -- process the lower row\n\n\tmovdqa\txmm6, XMMWORD [rdi+0*SIZEOF_XMMWORD]\n\tmovdqa\txmm4, XMMWORD [rdi+1*SIZEOF_XMMWORD]\n\n\tmovdqa\txmm7,xmm6\t\t; xmm6=Int1L=( 0  1  2  3  4  5  6  7)\n\tmovdqa\txmm3,xmm4\t\t; xmm4=Int1H=( 8  9 10 11 12 13 14 15)\n\tpsrldq\txmm7,2\t\t\t; xmm7=( 1  2  3  4  5  6  7 --)\n\tpslldq\txmm3,(SIZEOF_XMMWORD-2)\t; xmm3=(-- -- -- -- -- -- --  8)\n\tmovdqa\txmm0,xmm6\n\tmovdqa\txmm2,xmm4\n\tpsrldq\txmm0,(SIZEOF_XMMWORD-2)\t; xmm0=( 7 -- -- -- -- -- -- --)\n\tpslldq\txmm2,2\t\t\t; xmm2=(--  8  9 10 11 12 13 14)\n\n\tpor\txmm7,xmm3\t\t; xmm7=( 1  2  3  4  5  6  7  8)\n\tpor\txmm0,xmm2\t\t; xmm0=( 7  8  9 10 11 12 13 14)\n\n\tmovdqa\txmm1,xmm6\n\tmovdqa\txmm5,xmm4\n\tpslldq\txmm1,2\t\t\t; xmm1=(--  0  1  2  3  4  5  6)\n\tpsrldq\txmm5,2\t\t\t; xmm5=( 9 10 11 12 13 14 15 --)\n\tmovdqa\txmm3,xmm4\n\tpsrldq\txmm3,(SIZEOF_XMMWORD-2)\t; xmm3=(15 -- -- -- -- -- -- --)\n\n\tpor\txmm1, XMMWORD [wk(1)]\t; xmm1=(-1  0  1  2  3  4  5  6)\n\tpor\txmm5, XMMWORD [wk(3)]\t; xmm5=( 9 10 11 12 13 14 15 16)\n\n\tmovdqa\tXMMWORD [wk(1)], xmm3\n\n\tpmullw\txmm6,[rel PW_THREE]\n\tpmullw\txmm4,[rel PW_THREE]\n\tpaddw\txmm1,[rel PW_EIGHT]\n\tpaddw\txmm0,[rel PW_EIGHT]\n\tpaddw\txmm7,[rel PW_SEVEN]\n\tpaddw\txmm5,[rel PW_SEVEN]\n\n\tpaddw\txmm1,xmm6\n\tpaddw\txmm0,xmm4\n\tpsrlw\txmm1,4\t\t\t; xmm1=Out1LE=( 0  2  4  6  8 10 12 14)\n\tpsrlw\txmm0,4\t\t\t; xmm0=Out1HE=(16 18 20 22 24 26 28 30)\n\tpaddw\txmm7,xmm6\n\tpaddw\txmm5,xmm4\n\tpsrlw\txmm7,4\t\t\t; xmm7=Out1LO=( 1  3  5  7  9 11 13 15)\n\tpsrlw\txmm5,4\t\t\t; xmm5=Out1HO=(17 19 21 23 25 27 29 31)\n\n\tpsllw\txmm7,BYTE_BIT\n\tpsllw\txmm5,BYTE_BIT\n\tpor\txmm1,xmm7\t\t; xmm1=Out1L=( 0  1  2 ... 13 14 15)\n\tpor\txmm0,xmm5\t\t; xmm0=Out1H=(16 17 18 ... 29 30 31)\n\n\tmovdqa\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmm1\n\tmovdqa\tXMMWORD [rdi+1*SIZEOF_XMMWORD], xmm0\n\n\tsub\trax, byte SIZEOF_XMMWORD\n\tadd\trcx, byte 1*SIZEOF_XMMWORD\t; inptr1(above)\n\tadd\trbx, byte 1*SIZEOF_XMMWORD\t; inptr0\n\tadd\trsi, byte 1*SIZEOF_XMMWORD\t; inptr1(below)\n\tadd\trdx, byte 2*SIZEOF_XMMWORD\t; outptr0\n\tadd\trdi, byte 2*SIZEOF_XMMWORD\t; outptr1\n\tcmp\trax, byte SIZEOF_XMMWORD\n\tja\tnear .columnloop\n\ttest\trax,rax\n\tjnz\tnear .columnloop_last\n\n\tpop\trsi\n\tpop\trdi\n\tpop\trcx\n\tpop\trax\n\n\tadd\trsi, byte 1*SIZEOF_JSAMPROW\t; input_data\n\tadd\trdi, byte 2*SIZEOF_JSAMPROW\t; output_data\n\tsub\trcx, byte 2\t\t\t; rowctr\n\tjg\tnear .rowloop\n\n.return:\n\tpop\trbx\n\tuncollect_args\n\tmov\trsp,rbp\t\t; rsp <- aligned rbp\n\tpop\trsp\t\t; rsp <- original rbp\n\tpop\trbp\n\tret\n\n; --------------------------------------------------------------------------\n;\n; Fast processing for the common case of 2:1 horizontal and 1:1 vertical.\n; It's still a box filter.\n;\n; GLOBAL(void)\n; jsimd_h2v1_upsample_sse2 (int max_v_samp_factor,\n;                           JDIMENSION output_width,\n;                           JSAMPARRAY input_data,\n;                           JSAMPARRAY * output_data_ptr);\n;\n\n; r10 = int max_v_samp_factor\n; r11 = JDIMENSION output_width\n; r12 = JSAMPARRAY input_data\n; r13 = JSAMPARRAY * output_data_ptr\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v1_upsample_sse2)\n\nEXTN(jsimd_h2v1_upsample_sse2):\n\tpush\trbp\n\tmov\trax,rsp\n\tmov\trbp,rsp\n\tcollect_args\n\n\tmov\trdx, r11\n\tadd\trdx, byte (2*SIZEOF_XMMWORD)-1\n\tand\trdx, byte -(2*SIZEOF_XMMWORD)\n\tjz\tnear .return\n\n\tmov\trcx, r10\t; rowctr\n\ttest\trcx,rcx\n\tjz\tshort .return\n\n\tmov\trsi, r12 ; input_data\n\tmov\trdi, r13\n\tmov\trdi, JSAMPARRAY [rdi]\t\t\t; output_data\n.rowloop:\n\tpush\trdi\n\tpush\trsi\n\n\tmov\trsi, JSAMPROW [rsi]\t\t; inptr\n\tmov\trdi, JSAMPROW [rdi]\t\t; outptr\n\tmov\trax,rdx\t\t\t\t; colctr\n.columnloop:\n\n\tmovdqa\txmm0, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n\n\tmovdqa    xmm1,xmm0\n\tpunpcklbw xmm0,xmm0\n\tpunpckhbw xmm1,xmm1\n\n\tmovdqa\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmm0\n\tmovdqa\tXMMWORD [rdi+1*SIZEOF_XMMWORD], xmm1\n\n\tsub\trax, byte 2*SIZEOF_XMMWORD\n\tjz\tshort .nextrow\n\n\tmovdqa\txmm2, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n\n\tmovdqa    xmm3,xmm2\n\tpunpcklbw xmm2,xmm2\n\tpunpckhbw xmm3,xmm3\n\n\tmovdqa\tXMMWORD [rdi+2*SIZEOF_XMMWORD], xmm2\n\tmovdqa\tXMMWORD [rdi+3*SIZEOF_XMMWORD], xmm3\n\n\tsub\trax, byte 2*SIZEOF_XMMWORD\n\tjz\tshort .nextrow\n\n\tadd\trsi, byte 2*SIZEOF_XMMWORD\t; inptr\n\tadd\trdi, byte 4*SIZEOF_XMMWORD\t; outptr\n\tjmp\tshort .columnloop\n\n.nextrow:\n\tpop\trsi\n\tpop\trdi\n\n\tadd\trsi, byte SIZEOF_JSAMPROW\t; input_data\n\tadd\trdi, byte SIZEOF_JSAMPROW\t; output_data\n\tdec\trcx\t\t\t\t; rowctr\n\tjg\tshort .rowloop\n\n.return:\n\tuncollect_args\n\tpop\trbp\n\tret\n\n; --------------------------------------------------------------------------\n;\n; Fast processing for the common case of 2:1 horizontal and 2:1 vertical.\n; It's still a box filter.\n;\n; GLOBAL(void)\n; jsimd_h2v2_upsample_sse2 (nt max_v_samp_factor,\n;                           JDIMENSION output_width,\n;                           JSAMPARRAY input_data,\n;                           JSAMPARRAY * output_data_ptr);\n;\n\n; r10 = int max_v_samp_factor\n; r11 = JDIMENSION output_width\n; r12 = JSAMPARRAY input_data\n; r13 = JSAMPARRAY * output_data_ptr\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v2_upsample_sse2)\n\nEXTN(jsimd_h2v2_upsample_sse2):\n\tpush\trbp\n\tmov\trax,rsp\n\tmov\trbp,rsp\n\tcollect_args\n\tpush\trbx\n\n\tmov\trdx, r11\n\tadd\trdx, byte (2*SIZEOF_XMMWORD)-1\n\tand\trdx, byte -(2*SIZEOF_XMMWORD)\n\tjz\tnear .return\n\n\tmov\trcx, r10\t; rowctr\n\ttest\trcx,rcx\n\tjz\tnear .return\n\n\tmov\trsi, r12\t; input_data\n\tmov\trdi, r13\n\tmov\trdi, JSAMPARRAY [rdi]\t\t\t; output_data\n.rowloop:\n\tpush\trdi\n\tpush\trsi\n\n\tmov\trsi, JSAMPROW [rsi]\t\t\t; inptr\n\tmov\trbx, JSAMPROW [rdi+0*SIZEOF_JSAMPROW]\t; outptr0\n\tmov\trdi, JSAMPROW [rdi+1*SIZEOF_JSAMPROW]\t; outptr1\n\tmov\trax,rdx\t\t\t\t\t; colctr\n.columnloop:\n\n\tmovdqa\txmm0, XMMWORD [rsi+0*SIZEOF_XMMWORD]\n\n\tmovdqa    xmm1,xmm0\n\tpunpcklbw xmm0,xmm0\n\tpunpckhbw xmm1,xmm1\n\n\tmovdqa\tXMMWORD [rbx+0*SIZEOF_XMMWORD], xmm0\n\tmovdqa\tXMMWORD [rbx+1*SIZEOF_XMMWORD], xmm1\n\tmovdqa\tXMMWORD [rdi+0*SIZEOF_XMMWORD], xmm0\n\tmovdqa\tXMMWORD [rdi+1*SIZEOF_XMMWORD], xmm1\n\n\tsub\trax, byte 2*SIZEOF_XMMWORD\n\tjz\tshort .nextrow\n\n\tmovdqa\txmm2, XMMWORD [rsi+1*SIZEOF_XMMWORD]\n\n\tmovdqa    xmm3,xmm2\n\tpunpcklbw xmm2,xmm2\n\tpunpckhbw xmm3,xmm3\n\n\tmovdqa\tXMMWORD [rbx+2*SIZEOF_XMMWORD], xmm2\n\tmovdqa\tXMMWORD [rbx+3*SIZEOF_XMMWORD], xmm3\n\tmovdqa\tXMMWORD [rdi+2*SIZEOF_XMMWORD], xmm2\n\tmovdqa\tXMMWORD [rdi+3*SIZEOF_XMMWORD], xmm3\n\n\tsub\trax, byte 2*SIZEOF_XMMWORD\n\tjz\tshort .nextrow\n\n\tadd\trsi, byte 2*SIZEOF_XMMWORD\t; inptr\n\tadd\trbx, byte 4*SIZEOF_XMMWORD\t; outptr0\n\tadd\trdi, byte 4*SIZEOF_XMMWORD\t; outptr1\n\tjmp\tshort .columnloop\n\n.nextrow:\n\tpop\trsi\n\tpop\trdi\n\n\tadd\trsi, byte 1*SIZEOF_JSAMPROW\t; input_data\n\tadd\trdi, byte 2*SIZEOF_JSAMPROW\t; output_data\n\tsub\trcx, byte 2\t\t\t; rowctr\n\tjg\tnear .rowloop\n\n.return:\n\tpop\trbx\n\tuncollect_args\n\tpop\trbp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jdsamss2.asm",
    "content": ";\n; jdsamss2.asm - upsampling (SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_fancy_upsample_sse2)\n\nEXTN(jconst_fancy_upsample_sse2):\n\nPW_ONE\t\ttimes 8 dw  1\nPW_TWO\t\ttimes 8 dw  2\nPW_THREE\ttimes 8 dw  3\nPW_SEVEN\ttimes 8 dw  7\nPW_EIGHT\ttimes 8 dw  8\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Fancy processing for the common case of 2:1 horizontal and 1:1 vertical.\n;\n; The upsampling algorithm is linear interpolation between pixel centers,\n; also known as a \"triangle filter\".  This is a good compromise between\n; speed and visual quality.  The centers of the output pixels are 1/4 and 3/4\n; of the way between input pixel centers.\n;\n; GLOBAL(void)\n; jsimd_h2v1_fancy_upsample_sse2 (int max_v_samp_factor,\n;                                 JDIMENSION downsampled_width,\n;                                 JSAMPARRAY input_data,\n;                                 JSAMPARRAY * output_data_ptr);\n;\n\n%define max_v_samp(b)\t\t(b)+8\t\t\t; int max_v_samp_factor\n%define downsamp_width(b)\t(b)+12\t; JDIMENSION downsampled_width\n%define input_data(b)\t\t(b)+16\t\t; JSAMPARRAY input_data\n%define output_data_ptr(b)\t(b)+20\t\t; JSAMPARRAY * output_data_ptr\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v1_fancy_upsample_sse2)\n\nEXTN(jsimd_h2v1_fancy_upsample_sse2):\n\tpush\tebp\n\tmov\tebp,esp\n\tpushpic\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t; get GOT address\n\n\tmov\teax, JDIMENSION [downsamp_width(ebp)]  ; colctr\n\ttest\teax,eax\n\tjz\tnear .return\n\n\tmov\tecx, INT [max_v_samp(ebp)]\t; rowctr\n\ttest\tecx,ecx\n\tjz\tnear .return\n\n\tmov\tesi, JSAMPARRAY [input_data(ebp)]\t; input_data\n\tmov\tedi, POINTER [output_data_ptr(ebp)]\n\tmov\tedi, JSAMPARRAY [edi]\t\t\t; output_data\n\talignx\t16,7\n.rowloop:\n\tpush\teax\t\t\t; colctr\n\tpush\tedi\n\tpush\tesi\n\n\tmov\tesi, JSAMPROW [esi]\t; inptr\n\tmov\tedi, JSAMPROW [edi]\t; outptr\n\n\ttest\teax, SIZEOF_XMMWORD-1\n\tjz\tshort .skip\n\tmov\tdl, JSAMPLE [esi+(eax-1)*SIZEOF_JSAMPLE]\n\tmov\tJSAMPLE [esi+eax*SIZEOF_JSAMPLE], dl\t; insert a dummy sample\n.skip:\n\tpxor\txmm0,xmm0\t\t; xmm0=(all 0's)\n\tpcmpeqb\txmm7,xmm7\n\tpsrldq\txmm7,(SIZEOF_XMMWORD-1)\n\tpand\txmm7, XMMWORD [esi+0*SIZEOF_XMMWORD]\n\n\tadd\teax, byte SIZEOF_XMMWORD-1\n\tand\teax, byte -SIZEOF_XMMWORD\n\tcmp\teax, byte SIZEOF_XMMWORD\n\tja\tshort .columnloop\n\talignx\t16,7\n\n.columnloop_last:\n\tpcmpeqb\txmm6,xmm6\n\tpslldq\txmm6,(SIZEOF_XMMWORD-1)\n\tpand\txmm6, XMMWORD [esi+0*SIZEOF_XMMWORD]\n\tjmp\tshort .upsample\n\talignx\t16,7\n\n.columnloop:\n\tmovdqa\txmm6, XMMWORD [esi+1*SIZEOF_XMMWORD]\n\tpslldq\txmm6,(SIZEOF_XMMWORD-1)\n\n.upsample:\n\tmovdqa\txmm1, XMMWORD [esi+0*SIZEOF_XMMWORD]\n\tmovdqa\txmm2,xmm1\n\tmovdqa\txmm3,xmm1\t\t; xmm1=( 0  1  2 ... 13 14 15)\n\tpslldq\txmm2,1\t\t\t; xmm2=(--  0  1 ... 12 13 14)\n\tpsrldq\txmm3,1\t\t\t; xmm3=( 1  2  3 ... 14 15 --)\n\n\tpor\txmm2,xmm7\t\t; xmm2=(-1  0  1 ... 12 13 14)\n\tpor\txmm3,xmm6\t\t; xmm3=( 1  2  3 ... 14 15 16)\n\n\tmovdqa\txmm7,xmm1\n\tpsrldq\txmm7,(SIZEOF_XMMWORD-1)\t; xmm7=(15 -- -- ... -- -- --)\n\n\tmovdqa    xmm4,xmm1\n\tpunpcklbw xmm1,xmm0\t\t; xmm1=( 0  1  2  3  4  5  6  7)\n\tpunpckhbw xmm4,xmm0\t\t; xmm4=( 8  9 10 11 12 13 14 15)\n\tmovdqa    xmm5,xmm2\n\tpunpcklbw xmm2,xmm0\t\t; xmm2=(-1  0  1  2  3  4  5  6)\n\tpunpckhbw xmm5,xmm0\t\t; xmm5=( 7  8  9 10 11 12 13 14)\n\tmovdqa    xmm6,xmm3\n\tpunpcklbw xmm3,xmm0\t\t; xmm3=( 1  2  3  4  5  6  7  8)\n\tpunpckhbw xmm6,xmm0\t\t; xmm6=( 9 10 11 12 13 14 15 16)\n\n\tpmullw\txmm1,[GOTOFF(ebx,PW_THREE)]\n\tpmullw\txmm4,[GOTOFF(ebx,PW_THREE)]\n\tpaddw\txmm2,[GOTOFF(ebx,PW_ONE)]\n\tpaddw\txmm5,[GOTOFF(ebx,PW_ONE)]\n\tpaddw\txmm3,[GOTOFF(ebx,PW_TWO)]\n\tpaddw\txmm6,[GOTOFF(ebx,PW_TWO)]\n\n\tpaddw\txmm2,xmm1\n\tpaddw\txmm5,xmm4\n\tpsrlw\txmm2,2\t\t\t; xmm2=OutLE=( 0  2  4  6  8 10 12 14)\n\tpsrlw\txmm5,2\t\t\t; xmm5=OutHE=(16 18 20 22 24 26 28 30)\n\tpaddw\txmm3,xmm1\n\tpaddw\txmm6,xmm4\n\tpsrlw\txmm3,2\t\t\t; xmm3=OutLO=( 1  3  5  7  9 11 13 15)\n\tpsrlw\txmm6,2\t\t\t; xmm6=OutHO=(17 19 21 23 25 27 29 31)\n\n\tpsllw\txmm3,BYTE_BIT\n\tpsllw\txmm6,BYTE_BIT\n\tpor\txmm2,xmm3\t\t; xmm2=OutL=( 0  1  2 ... 13 14 15)\n\tpor\txmm5,xmm6\t\t; xmm5=OutH=(16 17 18 ... 29 30 31)\n\n\tmovdqa\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmm2\n\tmovdqa\tXMMWORD [edi+1*SIZEOF_XMMWORD], xmm5\n\n\tsub\teax, byte SIZEOF_XMMWORD\n\tadd\tesi, byte 1*SIZEOF_XMMWORD\t; inptr\n\tadd\tedi, byte 2*SIZEOF_XMMWORD\t; outptr\n\tcmp\teax, byte SIZEOF_XMMWORD\n\tja\tnear .columnloop\n\ttest\teax,eax\n\tjnz\tnear .columnloop_last\n\n\tpop\tesi\n\tpop\tedi\n\tpop\teax\n\n\tadd\tesi, byte SIZEOF_JSAMPROW\t; input_data\n\tadd\tedi, byte SIZEOF_JSAMPROW\t; output_data\n\tdec\tecx\t\t\t\t; rowctr\n\tjg\tnear .rowloop\n\n.return:\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpoppic\tebx\n\tpop\tebp\n\tret\n\n; --------------------------------------------------------------------------\n;\n; Fancy processing for the common case of 2:1 horizontal and 2:1 vertical.\n; Again a triangle filter; see comments for h2v1 case, above.\n;\n; GLOBAL(void)\n; jsimd_h2v2_fancy_upsample_sse2 (int max_v_samp_factor,\n;                                 JDIMENSION downsampled_width,\n;                                 JSAMPARRAY input_data,\n;                                 JSAMPARRAY * output_data_ptr);\n;\n\n%define max_v_samp(b)\t\t(b)+8\t\t\t; int max_v_samp_factor\n%define downsamp_width(b)\t(b)+12\t; JDIMENSION downsampled_width\n%define input_data(b)\t\t(b)+16\t\t; JSAMPARRAY input_data\n%define output_data_ptr(b)\t(b)+20\t\t; JSAMPARRAY * output_data_ptr\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t4\n%define gotptr\t\twk(0)-SIZEOF_POINTER\t; void * gotptr\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v2_fancy_upsample_sse2)\n\nEXTN(jsimd_h2v2_fancy_upsample_sse2):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [wk(0)]\n\tpushpic\teax\t\t; make a room for GOT address\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t\t; get GOT address\n\tmovpic\tPOINTER [gotptr], ebx\t; save GOT address\n\n\tmov\tedx,eax\t\t\t\t; edx = original ebp\n\tmov\teax, JDIMENSION [downsamp_width(edx)]  ; colctr\n\ttest\teax,eax\n\tjz\tnear .return\n\n\tmov\tecx, INT [max_v_samp(edx)]\t; rowctr\n\ttest\tecx,ecx\n\tjz\tnear .return\n\n\tmov\tesi, JSAMPARRAY [input_data(edx)]\t; input_data\n\tmov\tedi, POINTER [output_data_ptr(edx)]\n\tmov\tedi, JSAMPARRAY [edi]\t\t\t; output_data\n\talignx\t16,7\n.rowloop:\n\tpush\teax\t\t\t\t\t; colctr\n\tpush\tecx\n\tpush\tedi\n\tpush\tesi\n\n\tmov\tecx, JSAMPROW [esi-1*SIZEOF_JSAMPROW]\t; inptr1(above)\n\tmov\tebx, JSAMPROW [esi+0*SIZEOF_JSAMPROW]\t; inptr0\n\tmov\tesi, JSAMPROW [esi+1*SIZEOF_JSAMPROW]\t; inptr1(below)\n\tmov\tedx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\t; outptr0\n\tmov\tedi, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\t; outptr1\n\n\ttest\teax, SIZEOF_XMMWORD-1\n\tjz\tshort .skip\n\tpush\tedx\n\tmov\tdl, JSAMPLE [ecx+(eax-1)*SIZEOF_JSAMPLE]\n\tmov\tJSAMPLE [ecx+eax*SIZEOF_JSAMPLE], dl\n\tmov\tdl, JSAMPLE [ebx+(eax-1)*SIZEOF_JSAMPLE]\n\tmov\tJSAMPLE [ebx+eax*SIZEOF_JSAMPLE], dl\n\tmov\tdl, JSAMPLE [esi+(eax-1)*SIZEOF_JSAMPLE]\n\tmov\tJSAMPLE [esi+eax*SIZEOF_JSAMPLE], dl\t; insert a dummy sample\n\tpop\tedx\n.skip:\n\t; -- process the first column block\n\n\tmovdqa\txmm0, XMMWORD [ebx+0*SIZEOF_XMMWORD]\t; xmm0=row[ 0][0]\n\tmovdqa\txmm1, XMMWORD [ecx+0*SIZEOF_XMMWORD]\t; xmm1=row[-1][0]\n\tmovdqa\txmm2, XMMWORD [esi+0*SIZEOF_XMMWORD]\t; xmm2=row[+1][0]\n\n\tpushpic\tebx\n\tmovpic\tebx, POINTER [gotptr]\t; load GOT address\n\n\tpxor      xmm3,xmm3\t\t; xmm3=(all 0's)\n\tmovdqa    xmm4,xmm0\n\tpunpcklbw xmm0,xmm3\t\t; xmm0=row[ 0]( 0  1  2  3  4  5  6  7)\n\tpunpckhbw xmm4,xmm3\t\t; xmm4=row[ 0]( 8  9 10 11 12 13 14 15)\n\tmovdqa    xmm5,xmm1\n\tpunpcklbw xmm1,xmm3\t\t; xmm1=row[-1]( 0  1  2  3  4  5  6  7)\n\tpunpckhbw xmm5,xmm3\t\t; xmm5=row[-1]( 8  9 10 11 12 13 14 15)\n\tmovdqa    xmm6,xmm2\n\tpunpcklbw xmm2,xmm3\t\t; xmm2=row[+1]( 0  1  2  3  4  5  6  7)\n\tpunpckhbw xmm6,xmm3\t\t; xmm6=row[+1]( 8  9 10 11 12 13 14 15)\n\n\tpmullw\txmm0,[GOTOFF(ebx,PW_THREE)]\n\tpmullw\txmm4,[GOTOFF(ebx,PW_THREE)]\n\n\tpcmpeqb\txmm7,xmm7\n\tpsrldq\txmm7,(SIZEOF_XMMWORD-2)\n\n\tpaddw\txmm1,xmm0\t\t; xmm1=Int0L=( 0  1  2  3  4  5  6  7)\n\tpaddw\txmm5,xmm4\t\t; xmm5=Int0H=( 8  9 10 11 12 13 14 15)\n\tpaddw\txmm2,xmm0\t\t; xmm2=Int1L=( 0  1  2  3  4  5  6  7)\n\tpaddw\txmm6,xmm4\t\t; xmm6=Int1H=( 8  9 10 11 12 13 14 15)\n\n\tmovdqa\tXMMWORD [edx+0*SIZEOF_XMMWORD], xmm1\t; temporarily save\n\tmovdqa\tXMMWORD [edx+1*SIZEOF_XMMWORD], xmm5\t; the intermediate data\n\tmovdqa\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmm2\n\tmovdqa\tXMMWORD [edi+1*SIZEOF_XMMWORD], xmm6\n\n\tpand\txmm1,xmm7\t\t; xmm1=( 0 -- -- -- -- -- -- --)\n\tpand\txmm2,xmm7\t\t; xmm2=( 0 -- -- -- -- -- -- --)\n\n\tmovdqa\tXMMWORD [wk(0)], xmm1\n\tmovdqa\tXMMWORD [wk(1)], xmm2\n\n\tpoppic\tebx\n\n\tadd\teax, byte SIZEOF_XMMWORD-1\n\tand\teax, byte -SIZEOF_XMMWORD\n\tcmp\teax, byte SIZEOF_XMMWORD\n\tja\tshort .columnloop\n\talignx\t16,7\n\n.columnloop_last:\n\t; -- process the last column block\n\n\tpushpic\tebx\n\tmovpic\tebx, POINTER [gotptr]\t; load GOT address\n\n\tpcmpeqb\txmm1,xmm1\n\tpslldq\txmm1,(SIZEOF_XMMWORD-2)\n\tmovdqa\txmm2,xmm1\n\n\tpand\txmm1, XMMWORD [edx+1*SIZEOF_XMMWORD]\n\tpand\txmm2, XMMWORD [edi+1*SIZEOF_XMMWORD]\n\n\tmovdqa\tXMMWORD [wk(2)], xmm1\t; xmm1=(-- -- -- -- -- -- -- 15)\n\tmovdqa\tXMMWORD [wk(3)], xmm2\t; xmm2=(-- -- -- -- -- -- -- 15)\n\n\tjmp\tnear .upsample\n\talignx\t16,7\n\n.columnloop:\n\t; -- process the next column block\n\n\tmovdqa\txmm0, XMMWORD [ebx+1*SIZEOF_XMMWORD]\t; xmm0=row[ 0][1]\n\tmovdqa\txmm1, XMMWORD [ecx+1*SIZEOF_XMMWORD]\t; xmm1=row[-1][1]\n\tmovdqa\txmm2, XMMWORD [esi+1*SIZEOF_XMMWORD]\t; xmm2=row[+1][1]\n\n\tpushpic\tebx\n\tmovpic\tebx, POINTER [gotptr]\t; load GOT address\n\n\tpxor      xmm3,xmm3\t\t; xmm3=(all 0's)\n\tmovdqa    xmm4,xmm0\n\tpunpcklbw xmm0,xmm3\t\t; xmm0=row[ 0]( 0  1  2  3  4  5  6  7)\n\tpunpckhbw xmm4,xmm3\t\t; xmm4=row[ 0]( 8  9 10 11 12 13 14 15)\n\tmovdqa    xmm5,xmm1\n\tpunpcklbw xmm1,xmm3\t\t; xmm1=row[-1]( 0  1  2  3  4  5  6  7)\n\tpunpckhbw xmm5,xmm3\t\t; xmm5=row[-1]( 8  9 10 11 12 13 14 15)\n\tmovdqa    xmm6,xmm2\n\tpunpcklbw xmm2,xmm3\t\t; xmm2=row[+1]( 0  1  2  3  4  5  6  7)\n\tpunpckhbw xmm6,xmm3\t\t; xmm6=row[+1]( 8  9 10 11 12 13 14 15)\n\n\tpmullw\txmm0,[GOTOFF(ebx,PW_THREE)]\n\tpmullw\txmm4,[GOTOFF(ebx,PW_THREE)]\n\n\tpaddw\txmm1,xmm0\t\t; xmm1=Int0L=( 0  1  2  3  4  5  6  7)\n\tpaddw\txmm5,xmm4\t\t; xmm5=Int0H=( 8  9 10 11 12 13 14 15)\n\tpaddw\txmm2,xmm0\t\t; xmm2=Int1L=( 0  1  2  3  4  5  6  7)\n\tpaddw\txmm6,xmm4\t\t; xmm6=Int1H=( 8  9 10 11 12 13 14 15)\n\n\tmovdqa\tXMMWORD [edx+2*SIZEOF_XMMWORD], xmm1\t; temporarily save\n\tmovdqa\tXMMWORD [edx+3*SIZEOF_XMMWORD], xmm5\t; the intermediate data\n\tmovdqa\tXMMWORD [edi+2*SIZEOF_XMMWORD], xmm2\n\tmovdqa\tXMMWORD [edi+3*SIZEOF_XMMWORD], xmm6\n\n\tpslldq\txmm1,(SIZEOF_XMMWORD-2)\t; xmm1=(-- -- -- -- -- -- --  0)\n\tpslldq\txmm2,(SIZEOF_XMMWORD-2)\t; xmm2=(-- -- -- -- -- -- --  0)\n\n\tmovdqa\tXMMWORD [wk(2)], xmm1\n\tmovdqa\tXMMWORD [wk(3)], xmm2\n\n.upsample:\n\t; -- process the upper row\n\n\tmovdqa\txmm7, XMMWORD [edx+0*SIZEOF_XMMWORD]\n\tmovdqa\txmm3, XMMWORD [edx+1*SIZEOF_XMMWORD]\n\n\tmovdqa\txmm0,xmm7\t\t; xmm7=Int0L=( 0  1  2  3  4  5  6  7)\n\tmovdqa\txmm4,xmm3\t\t; xmm3=Int0H=( 8  9 10 11 12 13 14 15)\n\tpsrldq\txmm0,2\t\t\t; xmm0=( 1  2  3  4  5  6  7 --)\n\tpslldq\txmm4,(SIZEOF_XMMWORD-2)\t; xmm4=(-- -- -- -- -- -- --  8)\n\tmovdqa\txmm5,xmm7\n\tmovdqa\txmm6,xmm3\n\tpsrldq\txmm5,(SIZEOF_XMMWORD-2)\t; xmm5=( 7 -- -- -- -- -- -- --)\n\tpslldq\txmm6,2\t\t\t; xmm6=(--  8  9 10 11 12 13 14)\n\n\tpor\txmm0,xmm4\t\t; xmm0=( 1  2  3  4  5  6  7  8)\n\tpor\txmm5,xmm6\t\t; xmm5=( 7  8  9 10 11 12 13 14)\n\n\tmovdqa\txmm1,xmm7\n\tmovdqa\txmm2,xmm3\n\tpslldq\txmm1,2\t\t\t; xmm1=(--  0  1  2  3  4  5  6)\n\tpsrldq\txmm2,2\t\t\t; xmm2=( 9 10 11 12 13 14 15 --)\n\tmovdqa\txmm4,xmm3\n\tpsrldq\txmm4,(SIZEOF_XMMWORD-2)\t; xmm4=(15 -- -- -- -- -- -- --)\n\n\tpor\txmm1, XMMWORD [wk(0)]\t; xmm1=(-1  0  1  2  3  4  5  6)\n\tpor\txmm2, XMMWORD [wk(2)]\t; xmm2=( 9 10 11 12 13 14 15 16)\n\n\tmovdqa\tXMMWORD [wk(0)], xmm4\n\n\tpmullw\txmm7,[GOTOFF(ebx,PW_THREE)]\n\tpmullw\txmm3,[GOTOFF(ebx,PW_THREE)]\n\tpaddw\txmm1,[GOTOFF(ebx,PW_EIGHT)]\n\tpaddw\txmm5,[GOTOFF(ebx,PW_EIGHT)]\n\tpaddw\txmm0,[GOTOFF(ebx,PW_SEVEN)]\n\tpaddw\txmm2,[GOTOFF(ebx,PW_SEVEN)]\n\n\tpaddw\txmm1,xmm7\n\tpaddw\txmm5,xmm3\n\tpsrlw\txmm1,4\t\t\t; xmm1=Out0LE=( 0  2  4  6  8 10 12 14)\n\tpsrlw\txmm5,4\t\t\t; xmm5=Out0HE=(16 18 20 22 24 26 28 30)\n\tpaddw\txmm0,xmm7\n\tpaddw\txmm2,xmm3\n\tpsrlw\txmm0,4\t\t\t; xmm0=Out0LO=( 1  3  5  7  9 11 13 15)\n\tpsrlw\txmm2,4\t\t\t; xmm2=Out0HO=(17 19 21 23 25 27 29 31)\n\n\tpsllw\txmm0,BYTE_BIT\n\tpsllw\txmm2,BYTE_BIT\n\tpor\txmm1,xmm0\t\t; xmm1=Out0L=( 0  1  2 ... 13 14 15)\n\tpor\txmm5,xmm2\t\t; xmm5=Out0H=(16 17 18 ... 29 30 31)\n\n\tmovdqa\tXMMWORD [edx+0*SIZEOF_XMMWORD], xmm1\n\tmovdqa\tXMMWORD [edx+1*SIZEOF_XMMWORD], xmm5\n\n\t; -- process the lower row\n\n\tmovdqa\txmm6, XMMWORD [edi+0*SIZEOF_XMMWORD]\n\tmovdqa\txmm4, XMMWORD [edi+1*SIZEOF_XMMWORD]\n\n\tmovdqa\txmm7,xmm6\t\t; xmm6=Int1L=( 0  1  2  3  4  5  6  7)\n\tmovdqa\txmm3,xmm4\t\t; xmm4=Int1H=( 8  9 10 11 12 13 14 15)\n\tpsrldq\txmm7,2\t\t\t; xmm7=( 1  2  3  4  5  6  7 --)\n\tpslldq\txmm3,(SIZEOF_XMMWORD-2)\t; xmm3=(-- -- -- -- -- -- --  8)\n\tmovdqa\txmm0,xmm6\n\tmovdqa\txmm2,xmm4\n\tpsrldq\txmm0,(SIZEOF_XMMWORD-2)\t; xmm0=( 7 -- -- -- -- -- -- --)\n\tpslldq\txmm2,2\t\t\t; xmm2=(--  8  9 10 11 12 13 14)\n\n\tpor\txmm7,xmm3\t\t; xmm7=( 1  2  3  4  5  6  7  8)\n\tpor\txmm0,xmm2\t\t; xmm0=( 7  8  9 10 11 12 13 14)\n\n\tmovdqa\txmm1,xmm6\n\tmovdqa\txmm5,xmm4\n\tpslldq\txmm1,2\t\t\t; xmm1=(--  0  1  2  3  4  5  6)\n\tpsrldq\txmm5,2\t\t\t; xmm5=( 9 10 11 12 13 14 15 --)\n\tmovdqa\txmm3,xmm4\n\tpsrldq\txmm3,(SIZEOF_XMMWORD-2)\t; xmm3=(15 -- -- -- -- -- -- --)\n\n\tpor\txmm1, XMMWORD [wk(1)]\t; xmm1=(-1  0  1  2  3  4  5  6)\n\tpor\txmm5, XMMWORD [wk(3)]\t; xmm5=( 9 10 11 12 13 14 15 16)\n\n\tmovdqa\tXMMWORD [wk(1)], xmm3\n\n\tpmullw\txmm6,[GOTOFF(ebx,PW_THREE)]\n\tpmullw\txmm4,[GOTOFF(ebx,PW_THREE)]\n\tpaddw\txmm1,[GOTOFF(ebx,PW_EIGHT)]\n\tpaddw\txmm0,[GOTOFF(ebx,PW_EIGHT)]\n\tpaddw\txmm7,[GOTOFF(ebx,PW_SEVEN)]\n\tpaddw\txmm5,[GOTOFF(ebx,PW_SEVEN)]\n\n\tpaddw\txmm1,xmm6\n\tpaddw\txmm0,xmm4\n\tpsrlw\txmm1,4\t\t\t; xmm1=Out1LE=( 0  2  4  6  8 10 12 14)\n\tpsrlw\txmm0,4\t\t\t; xmm0=Out1HE=(16 18 20 22 24 26 28 30)\n\tpaddw\txmm7,xmm6\n\tpaddw\txmm5,xmm4\n\tpsrlw\txmm7,4\t\t\t; xmm7=Out1LO=( 1  3  5  7  9 11 13 15)\n\tpsrlw\txmm5,4\t\t\t; xmm5=Out1HO=(17 19 21 23 25 27 29 31)\n\n\tpsllw\txmm7,BYTE_BIT\n\tpsllw\txmm5,BYTE_BIT\n\tpor\txmm1,xmm7\t\t; xmm1=Out1L=( 0  1  2 ... 13 14 15)\n\tpor\txmm0,xmm5\t\t; xmm0=Out1H=(16 17 18 ... 29 30 31)\n\n\tmovdqa\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmm1\n\tmovdqa\tXMMWORD [edi+1*SIZEOF_XMMWORD], xmm0\n\n\tpoppic\tebx\n\n\tsub\teax, byte SIZEOF_XMMWORD\n\tadd\tecx, byte 1*SIZEOF_XMMWORD\t; inptr1(above)\n\tadd\tebx, byte 1*SIZEOF_XMMWORD\t; inptr0\n\tadd\tesi, byte 1*SIZEOF_XMMWORD\t; inptr1(below)\n\tadd\tedx, byte 2*SIZEOF_XMMWORD\t; outptr0\n\tadd\tedi, byte 2*SIZEOF_XMMWORD\t; outptr1\n\tcmp\teax, byte SIZEOF_XMMWORD\n\tja\tnear .columnloop\n\ttest\teax,eax\n\tjnz\tnear .columnloop_last\n\n\tpop\tesi\n\tpop\tedi\n\tpop\tecx\n\tpop\teax\n\n\tadd\tesi, byte 1*SIZEOF_JSAMPROW\t; input_data\n\tadd\tedi, byte 2*SIZEOF_JSAMPROW\t; output_data\n\tsub\tecx, byte 2\t\t\t; rowctr\n\tjg\tnear .rowloop\n\n.return:\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; --------------------------------------------------------------------------\n;\n; Fast processing for the common case of 2:1 horizontal and 1:1 vertical.\n; It's still a box filter.\n;\n; GLOBAL(void)\n; jsimd_h2v1_upsample_sse2 (int max_v_samp_factor,\n;                           JDIMENSION output_width,\n;                           JSAMPARRAY input_data,\n;                           JSAMPARRAY * output_data_ptr);\n;\n\n%define max_v_samp(b)\t\t(b)+8\t\t\t; int max_v_samp_factor\n%define output_width(b)\t(b)+12\t\t; JDIMENSION output_width\n%define input_data(b)\t\t(b)+16\t\t; JSAMPARRAY input_data\n%define output_data_ptr(b)\t(b)+20\t\t; JSAMPARRAY * output_data_ptr\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v1_upsample_sse2)\n\nEXTN(jsimd_h2v1_upsample_sse2):\n\tpush\tebp\n\tmov\tebp,esp\n;\tpush\tebx\t\t; unused\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tmov\tedx, JDIMENSION [output_width(ebp)]\n\tadd\tedx, byte (2*SIZEOF_XMMWORD)-1\n\tand\tedx, byte -(2*SIZEOF_XMMWORD)\n\tjz\tshort .return\n\n\tmov\tecx, INT [max_v_samp(ebp)]\t; rowctr\n\ttest\tecx,ecx\n\tjz\tshort .return\n\n\tmov\tesi, JSAMPARRAY [input_data(ebp)]\t; input_data\n\tmov\tedi, POINTER [output_data_ptr(ebp)]\n\tmov\tedi, JSAMPARRAY [edi]\t\t\t; output_data\n\talignx\t16,7\n.rowloop:\n\tpush\tedi\n\tpush\tesi\n\n\tmov\tesi, JSAMPROW [esi]\t\t; inptr\n\tmov\tedi, JSAMPROW [edi]\t\t; outptr\n\tmov\teax,edx\t\t\t\t; colctr\n\talignx\t16,7\n.columnloop:\n\n\tmovdqa\txmm0, XMMWORD [esi+0*SIZEOF_XMMWORD]\n\n\tmovdqa    xmm1,xmm0\n\tpunpcklbw xmm0,xmm0\n\tpunpckhbw xmm1,xmm1\n\n\tmovdqa\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmm0\n\tmovdqa\tXMMWORD [edi+1*SIZEOF_XMMWORD], xmm1\n\n\tsub\teax, byte 2*SIZEOF_XMMWORD\n\tjz\tshort .nextrow\n\n\tmovdqa\txmm2, XMMWORD [esi+1*SIZEOF_XMMWORD]\n\n\tmovdqa    xmm3,xmm2\n\tpunpcklbw xmm2,xmm2\n\tpunpckhbw xmm3,xmm3\n\n\tmovdqa\tXMMWORD [edi+2*SIZEOF_XMMWORD], xmm2\n\tmovdqa\tXMMWORD [edi+3*SIZEOF_XMMWORD], xmm3\n\n\tsub\teax, byte 2*SIZEOF_XMMWORD\n\tjz\tshort .nextrow\n\n\tadd\tesi, byte 2*SIZEOF_XMMWORD\t; inptr\n\tadd\tedi, byte 4*SIZEOF_XMMWORD\t; outptr\n\tjmp\tshort .columnloop\n\talignx\t16,7\n\n.nextrow:\n\tpop\tesi\n\tpop\tedi\n\n\tadd\tesi, byte SIZEOF_JSAMPROW\t; input_data\n\tadd\tedi, byte SIZEOF_JSAMPROW\t; output_data\n\tdec\tecx\t\t\t\t; rowctr\n\tjg\tshort .rowloop\n\n.return:\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n;\tpop\tebx\t\t; unused\n\tpop\tebp\n\tret\n\n; --------------------------------------------------------------------------\n;\n; Fast processing for the common case of 2:1 horizontal and 2:1 vertical.\n; It's still a box filter.\n;\n; GLOBAL(void)\n; jsimd_h2v2_upsample_sse2 (nt max_v_samp_factor,\n;                           JDIMENSION output_width,\n;                           JSAMPARRAY input_data,\n;                           JSAMPARRAY * output_data_ptr);\n;\n\n%define max_v_samp(b)\t\t(b)+8\t\t\t; int max_v_samp_factor\n%define output_width(b)\t(b)+12\t\t; JDIMENSION output_width\n%define input_data(b)\t\t(b)+16\t\t; JSAMPARRAY input_data\n%define output_data_ptr(b)\t(b)+20\t\t; JSAMPARRAY * output_data_ptr\n\n\talign\t16\n\tglobal\tEXTN(jsimd_h2v2_upsample_sse2)\n\nEXTN(jsimd_h2v2_upsample_sse2):\n\tpush\tebp\n\tmov\tebp,esp\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tmov\tedx, JDIMENSION [output_width(ebp)]\n\tadd\tedx, byte (2*SIZEOF_XMMWORD)-1\n\tand\tedx, byte -(2*SIZEOF_XMMWORD)\n\tjz\tnear .return\n\n\tmov\tecx, INT [max_v_samp(ebp)]\t; rowctr\n\ttest\tecx,ecx\n\tjz\tnear .return\n\n\tmov\tesi, JSAMPARRAY [input_data(ebp)]\t; input_data\n\tmov\tedi, POINTER [output_data_ptr(ebp)]\n\tmov\tedi, JSAMPARRAY [edi]\t\t\t; output_data\n\talignx\t16,7\n.rowloop:\n\tpush\tedi\n\tpush\tesi\n\n\tmov\tesi, JSAMPROW [esi]\t\t\t; inptr\n\tmov\tebx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\t; outptr0\n\tmov\tedi, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\t; outptr1\n\tmov\teax,edx\t\t\t\t\t; colctr\n\talignx\t16,7\n.columnloop:\n\n\tmovdqa\txmm0, XMMWORD [esi+0*SIZEOF_XMMWORD]\n\n\tmovdqa    xmm1,xmm0\n\tpunpcklbw xmm0,xmm0\n\tpunpckhbw xmm1,xmm1\n\n\tmovdqa\tXMMWORD [ebx+0*SIZEOF_XMMWORD], xmm0\n\tmovdqa\tXMMWORD [ebx+1*SIZEOF_XMMWORD], xmm1\n\tmovdqa\tXMMWORD [edi+0*SIZEOF_XMMWORD], xmm0\n\tmovdqa\tXMMWORD [edi+1*SIZEOF_XMMWORD], xmm1\n\n\tsub\teax, byte 2*SIZEOF_XMMWORD\n\tjz\tshort .nextrow\n\n\tmovdqa\txmm2, XMMWORD [esi+1*SIZEOF_XMMWORD]\n\n\tmovdqa    xmm3,xmm2\n\tpunpcklbw xmm2,xmm2\n\tpunpckhbw xmm3,xmm3\n\n\tmovdqa\tXMMWORD [ebx+2*SIZEOF_XMMWORD], xmm2\n\tmovdqa\tXMMWORD [ebx+3*SIZEOF_XMMWORD], xmm3\n\tmovdqa\tXMMWORD [edi+2*SIZEOF_XMMWORD], xmm2\n\tmovdqa\tXMMWORD [edi+3*SIZEOF_XMMWORD], xmm3\n\n\tsub\teax, byte 2*SIZEOF_XMMWORD\n\tjz\tshort .nextrow\n\n\tadd\tesi, byte 2*SIZEOF_XMMWORD\t; inptr\n\tadd\tebx, byte 4*SIZEOF_XMMWORD\t; outptr0\n\tadd\tedi, byte 4*SIZEOF_XMMWORD\t; outptr1\n\tjmp\tshort .columnloop\n\talignx\t16,7\n\n.nextrow:\n\tpop\tesi\n\tpop\tedi\n\n\tadd\tesi, byte 1*SIZEOF_JSAMPROW\t; input_data\n\tadd\tedi, byte 2*SIZEOF_JSAMPROW\t; output_data\n\tsub\tecx, byte 2\t\t\t; rowctr\n\tjg\tshort .rowloop\n\n.return:\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jf3dnflt.asm",
    "content": ";\n; jf3dnflt.asm - floating-point FDCT (3DNow!)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a floating-point implementation of the forward DCT\n; (Discrete Cosine Transform). The following code is based directly on\n; the IJG's original jfdctflt.c; see the jfdctflt.c for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_fdct_float_3dnow)\n\nEXTN(jconst_fdct_float_3dnow):\n\nPD_0_382\ttimes 2 dd  0.382683432365089771728460\nPD_0_707\ttimes 2 dd  0.707106781186547524400844\nPD_0_541\ttimes 2 dd  0.541196100146196984399723\nPD_1_306\ttimes 2 dd  1.306562964876376527856643\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Perform the forward DCT on one block of samples.\n;\n; GLOBAL(void)\n; jsimd_fdct_float_3dnow (FAST_FLOAT * data)\n;\n\n%define data(b)\t\t(b)+8\t\t; FAST_FLOAT * data\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_MMWORD\t; mmword wk[WK_NUM]\n%define WK_NUM\t\t2\n\n\talign\t16\n\tglobal\tEXTN(jsimd_fdct_float_3dnow)\n\nEXTN(jsimd_fdct_float_3dnow):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_MMWORD)\t; align to 64 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [wk(0)]\n\tpushpic\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n;\tpush\tesi\t\t; unused\n;\tpush\tedi\t\t; unused\n\n\tget_GOT\tebx\t\t; get GOT address\n\n\t; ---- Pass 1: process rows.\n\n\tmov\tedx, POINTER [data(eax)]\t; (FAST_FLOAT *)\n\tmov\tecx, DCTSIZE/2\n\talignx\t16,7\n.rowloop:\n\n\tmovq\tmm0, MMWORD [MMBLOCK(0,0,edx,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm1, MMWORD [MMBLOCK(1,0,edx,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm2, MMWORD [MMBLOCK(0,3,edx,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm3, MMWORD [MMBLOCK(1,3,edx,SIZEOF_FAST_FLOAT)]\n\n\t; mm0=(00 01), mm1=(10 11), mm2=(06 07), mm3=(16 17)\n\n\tmovq      mm4,mm0\t\t; transpose coefficients\n\tpunpckldq mm0,mm1\t\t; mm0=(00 10)=data0\n\tpunpckhdq mm4,mm1\t\t; mm4=(01 11)=data1\n\tmovq      mm5,mm2\t\t; transpose coefficients\n\tpunpckldq mm2,mm3\t\t; mm2=(06 16)=data6\n\tpunpckhdq mm5,mm3\t\t; mm5=(07 17)=data7\n\n\tmovq\tmm6,mm4\n\tmovq\tmm7,mm0\n\tpfsub\tmm4,mm2\t\t\t; mm4=data1-data6=tmp6\n\tpfsub\tmm0,mm5\t\t\t; mm0=data0-data7=tmp7\n\tpfadd\tmm6,mm2\t\t\t; mm6=data1+data6=tmp1\n\tpfadd\tmm7,mm5\t\t\t; mm7=data0+data7=tmp0\n\n\tmovq\tmm1, MMWORD [MMBLOCK(0,1,edx,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm3, MMWORD [MMBLOCK(1,1,edx,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm2, MMWORD [MMBLOCK(0,2,edx,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm5, MMWORD [MMBLOCK(1,2,edx,SIZEOF_FAST_FLOAT)]\n\n\t; mm1=(02 03), mm3=(12 13), mm2=(04 05), mm5=(14 15)\n\n\tmovq\tMMWORD [wk(0)], mm4\t; wk(0)=tmp6\n\tmovq\tMMWORD [wk(1)], mm0\t; wk(1)=tmp7\n\n\tmovq      mm4,mm1\t\t; transpose coefficients\n\tpunpckldq mm1,mm3\t\t; mm1=(02 12)=data2\n\tpunpckhdq mm4,mm3\t\t; mm4=(03 13)=data3\n\tmovq      mm0,mm2\t\t; transpose coefficients\n\tpunpckldq mm2,mm5\t\t; mm2=(04 14)=data4\n\tpunpckhdq mm0,mm5\t\t; mm0=(05 15)=data5\n\n\tmovq\tmm3,mm4\n\tmovq\tmm5,mm1\n\tpfadd\tmm4,mm2\t\t\t; mm4=data3+data4=tmp3\n\tpfadd\tmm1,mm0\t\t\t; mm1=data2+data5=tmp2\n\tpfsub\tmm3,mm2\t\t\t; mm3=data3-data4=tmp4\n\tpfsub\tmm5,mm0\t\t\t; mm5=data2-data5=tmp5\n\n\t; -- Even part\n\n\tmovq\tmm2,mm7\n\tmovq\tmm0,mm6\n\tpfsub\tmm7,mm4\t\t\t; mm7=tmp13\n\tpfsub\tmm6,mm1\t\t\t; mm6=tmp12\n\tpfadd\tmm2,mm4\t\t\t; mm2=tmp10\n\tpfadd\tmm0,mm1\t\t\t; mm0=tmp11\n\n\tpfadd\tmm6,mm7\n\tpfmul\tmm6,[GOTOFF(ebx,PD_0_707)] ; mm6=z1\n\n\tmovq\tmm4,mm2\n\tmovq\tmm1,mm7\n\tpfsub\tmm2,mm0\t\t\t; mm2=data4\n\tpfsub\tmm7,mm6\t\t\t; mm7=data6\n\tpfadd\tmm4,mm0\t\t\t; mm4=data0\n\tpfadd\tmm1,mm6\t\t\t; mm1=data2\n\n\tmovq\tMMWORD [MMBLOCK(0,2,edx,SIZEOF_FAST_FLOAT)], mm2\n\tmovq\tMMWORD [MMBLOCK(0,3,edx,SIZEOF_FAST_FLOAT)], mm7\n\tmovq\tMMWORD [MMBLOCK(0,0,edx,SIZEOF_FAST_FLOAT)], mm4\n\tmovq\tMMWORD [MMBLOCK(0,1,edx,SIZEOF_FAST_FLOAT)], mm1\n\n\t; -- Odd part\n\n\tmovq\tmm0, MMWORD [wk(0)]\t; mm0=tmp6\n\tmovq\tmm6, MMWORD [wk(1)]\t; mm6=tmp7\n\n\tpfadd\tmm3,mm5\t\t\t; mm3=tmp10\n\tpfadd\tmm5,mm0\t\t\t; mm5=tmp11\n\tpfadd\tmm0,mm6\t\t\t; mm0=tmp12, mm6=tmp7\n\n\tpfmul\tmm5,[GOTOFF(ebx,PD_0_707)] ; mm5=z3\n\n\tmovq\tmm2,mm3\t\t\t; mm2=tmp10\n\tpfsub\tmm3,mm0\n\tpfmul\tmm3,[GOTOFF(ebx,PD_0_382)] ; mm3=z5\n\tpfmul\tmm2,[GOTOFF(ebx,PD_0_541)] ; mm2=MULTIPLY(tmp10,FIX_0_54119610)\n\tpfmul\tmm0,[GOTOFF(ebx,PD_1_306)] ; mm0=MULTIPLY(tmp12,FIX_1_30656296)\n\tpfadd\tmm2,mm3\t\t\t; mm2=z2\n\tpfadd\tmm0,mm3\t\t\t; mm0=z4\n\n\tmovq\tmm7,mm6\n\tpfsub\tmm6,mm5\t\t\t; mm6=z13\n\tpfadd\tmm7,mm5\t\t\t; mm7=z11\n\n\tmovq\tmm4,mm6\n\tmovq\tmm1,mm7\n\tpfsub\tmm6,mm2\t\t\t; mm6=data3\n\tpfsub\tmm7,mm0\t\t\t; mm7=data7\n\tpfadd\tmm4,mm2\t\t\t; mm4=data5\n\tpfadd\tmm1,mm0\t\t\t; mm1=data1\n\n\tmovq\tMMWORD [MMBLOCK(1,1,edx,SIZEOF_FAST_FLOAT)], mm6\n\tmovq\tMMWORD [MMBLOCK(1,3,edx,SIZEOF_FAST_FLOAT)], mm7\n\tmovq\tMMWORD [MMBLOCK(1,2,edx,SIZEOF_FAST_FLOAT)], mm4\n\tmovq\tMMWORD [MMBLOCK(1,0,edx,SIZEOF_FAST_FLOAT)], mm1\n\n\tadd\tedx, byte 2*DCTSIZE*SIZEOF_FAST_FLOAT\n\tdec\tecx\n\tjnz\tnear .rowloop\n\n\t; ---- Pass 2: process columns.\n\n\tmov\tedx, POINTER [data(eax)]\t; (FAST_FLOAT *)\n\tmov\tecx, DCTSIZE/2\n\talignx\t16,7\n.columnloop:\n\n\tmovq\tmm0, MMWORD [MMBLOCK(0,0,edx,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm1, MMWORD [MMBLOCK(1,0,edx,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm2, MMWORD [MMBLOCK(6,0,edx,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm3, MMWORD [MMBLOCK(7,0,edx,SIZEOF_FAST_FLOAT)]\n\n\t; mm0=(00 10), mm1=(01 11), mm2=(60 70), mm3=(61 71)\n\n\tmovq      mm4,mm0\t\t; transpose coefficients\n\tpunpckldq mm0,mm1\t\t; mm0=(00 01)=data0\n\tpunpckhdq mm4,mm1\t\t; mm4=(10 11)=data1\n\tmovq      mm5,mm2\t\t; transpose coefficients\n\tpunpckldq mm2,mm3\t\t; mm2=(60 61)=data6\n\tpunpckhdq mm5,mm3\t\t; mm5=(70 71)=data7\n\n\tmovq\tmm6,mm4\n\tmovq\tmm7,mm0\n\tpfsub\tmm4,mm2\t\t\t; mm4=data1-data6=tmp6\n\tpfsub\tmm0,mm5\t\t\t; mm0=data0-data7=tmp7\n\tpfadd\tmm6,mm2\t\t\t; mm6=data1+data6=tmp1\n\tpfadd\tmm7,mm5\t\t\t; mm7=data0+data7=tmp0\n\n\tmovq\tmm1, MMWORD [MMBLOCK(2,0,edx,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm3, MMWORD [MMBLOCK(3,0,edx,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm2, MMWORD [MMBLOCK(4,0,edx,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm5, MMWORD [MMBLOCK(5,0,edx,SIZEOF_FAST_FLOAT)]\n\n\t; mm1=(20 30), mm3=(21 31), mm2=(40 50), mm5=(41 51)\n\n\tmovq\tMMWORD [wk(0)], mm4\t; wk(0)=tmp6\n\tmovq\tMMWORD [wk(1)], mm0\t; wk(1)=tmp7\n\n\tmovq      mm4,mm1\t\t; transpose coefficients\n\tpunpckldq mm1,mm3\t\t; mm1=(20 21)=data2\n\tpunpckhdq mm4,mm3\t\t; mm4=(30 31)=data3\n\tmovq      mm0,mm2\t\t; transpose coefficients\n\tpunpckldq mm2,mm5\t\t; mm2=(40 41)=data4\n\tpunpckhdq mm0,mm5\t\t; mm0=(50 51)=data5\n\n\tmovq\tmm3,mm4\n\tmovq\tmm5,mm1\n\tpfadd\tmm4,mm2\t\t\t; mm4=data3+data4=tmp3\n\tpfadd\tmm1,mm0\t\t\t; mm1=data2+data5=tmp2\n\tpfsub\tmm3,mm2\t\t\t; mm3=data3-data4=tmp4\n\tpfsub\tmm5,mm0\t\t\t; mm5=data2-data5=tmp5\n\n\t; -- Even part\n\n\tmovq\tmm2,mm7\n\tmovq\tmm0,mm6\n\tpfsub\tmm7,mm4\t\t\t; mm7=tmp13\n\tpfsub\tmm6,mm1\t\t\t; mm6=tmp12\n\tpfadd\tmm2,mm4\t\t\t; mm2=tmp10\n\tpfadd\tmm0,mm1\t\t\t; mm0=tmp11\n\n\tpfadd\tmm6,mm7\n\tpfmul\tmm6,[GOTOFF(ebx,PD_0_707)] ; mm6=z1\n\n\tmovq\tmm4,mm2\n\tmovq\tmm1,mm7\n\tpfsub\tmm2,mm0\t\t\t; mm2=data4\n\tpfsub\tmm7,mm6\t\t\t; mm7=data6\n\tpfadd\tmm4,mm0\t\t\t; mm4=data0\n\tpfadd\tmm1,mm6\t\t\t; mm1=data2\n\n\tmovq\tMMWORD [MMBLOCK(4,0,edx,SIZEOF_FAST_FLOAT)], mm2\n\tmovq\tMMWORD [MMBLOCK(6,0,edx,SIZEOF_FAST_FLOAT)], mm7\n\tmovq\tMMWORD [MMBLOCK(0,0,edx,SIZEOF_FAST_FLOAT)], mm4\n\tmovq\tMMWORD [MMBLOCK(2,0,edx,SIZEOF_FAST_FLOAT)], mm1\n\n\t; -- Odd part\n\n\tmovq\tmm0, MMWORD [wk(0)]\t; mm0=tmp6\n\tmovq\tmm6, MMWORD [wk(1)]\t; mm6=tmp7\n\n\tpfadd\tmm3,mm5\t\t\t; mm3=tmp10\n\tpfadd\tmm5,mm0\t\t\t; mm5=tmp11\n\tpfadd\tmm0,mm6\t\t\t; mm0=tmp12, mm6=tmp7\n\n\tpfmul\tmm5,[GOTOFF(ebx,PD_0_707)] ; mm5=z3\n\n\tmovq\tmm2,mm3\t\t\t; mm2=tmp10\n\tpfsub\tmm3,mm0\n\tpfmul\tmm3,[GOTOFF(ebx,PD_0_382)] ; mm3=z5\n\tpfmul\tmm2,[GOTOFF(ebx,PD_0_541)] ; mm2=MULTIPLY(tmp10,FIX_0_54119610)\n\tpfmul\tmm0,[GOTOFF(ebx,PD_1_306)] ; mm0=MULTIPLY(tmp12,FIX_1_30656296)\n\tpfadd\tmm2,mm3\t\t\t; mm2=z2\n\tpfadd\tmm0,mm3\t\t\t; mm0=z4\n\n\tmovq\tmm7,mm6\n\tpfsub\tmm6,mm5\t\t\t; mm6=z13\n\tpfadd\tmm7,mm5\t\t\t; mm7=z11\n\n\tmovq\tmm4,mm6\n\tmovq\tmm1,mm7\n\tpfsub\tmm6,mm2\t\t\t; mm6=data3\n\tpfsub\tmm7,mm0\t\t\t; mm7=data7\n\tpfadd\tmm4,mm2\t\t\t; mm4=data5\n\tpfadd\tmm1,mm0\t\t\t; mm1=data1\n\n\tmovq\tMMWORD [MMBLOCK(3,0,edx,SIZEOF_FAST_FLOAT)], mm6\n\tmovq\tMMWORD [MMBLOCK(7,0,edx,SIZEOF_FAST_FLOAT)], mm7\n\tmovq\tMMWORD [MMBLOCK(5,0,edx,SIZEOF_FAST_FLOAT)], mm4\n\tmovq\tMMWORD [MMBLOCK(1,0,edx,SIZEOF_FAST_FLOAT)], mm1\n\n\tadd\tedx, byte 2*SIZEOF_FAST_FLOAT\n\tdec\tecx\n\tjnz\tnear .columnloop\n\n\tfemms\t\t; empty MMX/3DNow! state\n\n;\tpop\tedi\t\t; unused\n;\tpop\tesi\t\t; unused\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpoppic\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jfmmxfst.asm",
    "content": ";\n; jfmmxfst.asm - fast integer FDCT (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a fast, not so accurate integer implementation of\n; the forward DCT (Discrete Cosine Transform). The following code is\n; based directly on the IJG's original jfdctfst.c; see the jfdctfst.c\n; for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS\t8\t; 14 is also OK.\n\n%if CONST_BITS == 8\nF_0_382\tequ\t 98\t\t; FIX(0.382683433)\nF_0_541\tequ\t139\t\t; FIX(0.541196100)\nF_0_707\tequ\t181\t\t; FIX(0.707106781)\nF_1_306\tequ\t334\t\t; FIX(1.306562965)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_382\tequ\tDESCALE( 410903207,30-CONST_BITS)\t; FIX(0.382683433)\nF_0_541\tequ\tDESCALE( 581104887,30-CONST_BITS)\t; FIX(0.541196100)\nF_0_707\tequ\tDESCALE( 759250124,30-CONST_BITS)\t; FIX(0.707106781)\nF_1_306\tequ\tDESCALE(1402911301,30-CONST_BITS)\t; FIX(1.306562965)\n%endif\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n; PRE_MULTIPLY_SCALE_BITS <= 2 (to avoid overflow)\n; CONST_BITS + CONST_SHIFT + PRE_MULTIPLY_SCALE_BITS == 16 (for pmulhw)\n\n%define PRE_MULTIPLY_SCALE_BITS   2\n%define CONST_SHIFT     (16 - PRE_MULTIPLY_SCALE_BITS - CONST_BITS)\n\n\talignz\t16\n\tglobal\tEXTN(jconst_fdct_ifast_mmx)\n\nEXTN(jconst_fdct_ifast_mmx):\n\nPW_F0707\ttimes 4 dw  F_0_707 << CONST_SHIFT\nPW_F0382\ttimes 4 dw  F_0_382 << CONST_SHIFT\nPW_F0541\ttimes 4 dw  F_0_541 << CONST_SHIFT\nPW_F1306\ttimes 4 dw  F_1_306 << CONST_SHIFT\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Perform the forward DCT on one block of samples.\n;\n; GLOBAL(void)\n; jsimd_fdct_ifast_mmx (DCTELEM * data)\n;\n\n%define data(b)\t\t(b)+8\t\t; DCTELEM * data\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_MMWORD\t; mmword wk[WK_NUM]\n%define WK_NUM\t\t2\n\n\talign\t16\n\tglobal\tEXTN(jsimd_fdct_ifast_mmx)\n\nEXTN(jsimd_fdct_ifast_mmx):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_MMWORD)\t; align to 64 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [wk(0)]\n\tpushpic\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n;\tpush\tesi\t\t; unused\n;\tpush\tedi\t\t; unused\n\n\tget_GOT\tebx\t\t; get GOT address\n\n\t; ---- Pass 1: process rows.\n\n\tmov\tedx, POINTER [data(eax)]\t; (DCTELEM *)\n\tmov\tecx, DCTSIZE/4\n\talignx\t16,7\n.rowloop:\n\n\tmovq\tmm0, MMWORD [MMBLOCK(2,0,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm1, MMWORD [MMBLOCK(3,0,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm2, MMWORD [MMBLOCK(2,1,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm3, MMWORD [MMBLOCK(3,1,edx,SIZEOF_DCTELEM)]\n\n\t; mm0=(20 21 22 23), mm2=(24 25 26 27)\n\t; mm1=(30 31 32 33), mm3=(34 35 36 37)\n\n\tmovq      mm4,mm0\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm0,mm1\t\t; mm0=(20 30 21 31)\n\tpunpckhwd mm4,mm1\t\t; mm4=(22 32 23 33)\n\tmovq      mm5,mm2\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm2,mm3\t\t; mm2=(24 34 25 35)\n\tpunpckhwd mm5,mm3\t\t; mm5=(26 36 27 37)\n\n\tmovq\tmm6, MMWORD [MMBLOCK(0,0,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm7, MMWORD [MMBLOCK(1,0,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm1, MMWORD [MMBLOCK(0,1,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm3, MMWORD [MMBLOCK(1,1,edx,SIZEOF_DCTELEM)]\n\n\t; mm6=(00 01 02 03), mm1=(04 05 06 07)\n\t; mm7=(10 11 12 13), mm3=(14 15 16 17)\n\n\tmovq\tMMWORD [wk(0)], mm4\t; wk(0)=(22 32 23 33)\n\tmovq\tMMWORD [wk(1)], mm2\t; wk(1)=(24 34 25 35)\n\n\tmovq      mm4,mm6\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm6,mm7\t\t; mm6=(00 10 01 11)\n\tpunpckhwd mm4,mm7\t\t; mm4=(02 12 03 13)\n\tmovq      mm2,mm1\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm1,mm3\t\t; mm1=(04 14 05 15)\n\tpunpckhwd mm2,mm3\t\t; mm2=(06 16 07 17)\n\n\tmovq      mm7,mm6\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm6,mm0\t\t; mm6=(00 10 20 30)=data0\n\tpunpckhdq mm7,mm0\t\t; mm7=(01 11 21 31)=data1\n\tmovq      mm3,mm2\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm2,mm5\t\t; mm2=(06 16 26 36)=data6\n\tpunpckhdq mm3,mm5\t\t; mm3=(07 17 27 37)=data7\n\n\tmovq\tmm0,mm7\n\tmovq\tmm5,mm6\n\tpsubw\tmm7,mm2\t\t\t; mm7=data1-data6=tmp6\n\tpsubw\tmm6,mm3\t\t\t; mm6=data0-data7=tmp7\n\tpaddw\tmm0,mm2\t\t\t; mm0=data1+data6=tmp1\n\tpaddw\tmm5,mm3\t\t\t; mm5=data0+data7=tmp0\n\n\tmovq\tmm2, MMWORD [wk(0)]\t; mm2=(22 32 23 33)\n\tmovq\tmm3, MMWORD [wk(1)]\t; mm3=(24 34 25 35)\n\tmovq\tMMWORD [wk(0)], mm7\t; wk(0)=tmp6\n\tmovq\tMMWORD [wk(1)], mm6\t; wk(1)=tmp7\n\n\tmovq      mm7,mm4\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm4,mm2\t\t; mm4=(02 12 22 32)=data2\n\tpunpckhdq mm7,mm2\t\t; mm7=(03 13 23 33)=data3\n\tmovq      mm6,mm1\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm1,mm3\t\t; mm1=(04 14 24 34)=data4\n\tpunpckhdq mm6,mm3\t\t; mm6=(05 15 25 35)=data5\n\n\tmovq\tmm2,mm7\n\tmovq\tmm3,mm4\n\tpaddw\tmm7,mm1\t\t\t; mm7=data3+data4=tmp3\n\tpaddw\tmm4,mm6\t\t\t; mm4=data2+data5=tmp2\n\tpsubw\tmm2,mm1\t\t\t; mm2=data3-data4=tmp4\n\tpsubw\tmm3,mm6\t\t\t; mm3=data2-data5=tmp5\n\n\t; -- Even part\n\n\tmovq\tmm1,mm5\n\tmovq\tmm6,mm0\n\tpsubw\tmm5,mm7\t\t\t; mm5=tmp13\n\tpsubw\tmm0,mm4\t\t\t; mm0=tmp12\n\tpaddw\tmm1,mm7\t\t\t; mm1=tmp10\n\tpaddw\tmm6,mm4\t\t\t; mm6=tmp11\n\n\tpaddw\tmm0,mm5\n\tpsllw\tmm0,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\tmm0,[GOTOFF(ebx,PW_F0707)] ; mm0=z1\n\n\tmovq\tmm7,mm1\n\tmovq\tmm4,mm5\n\tpsubw\tmm1,mm6\t\t\t; mm1=data4\n\tpsubw\tmm5,mm0\t\t\t; mm5=data6\n\tpaddw\tmm7,mm6\t\t\t; mm7=data0\n\tpaddw\tmm4,mm0\t\t\t; mm4=data2\n\n\tmovq\tMMWORD [MMBLOCK(0,1,edx,SIZEOF_DCTELEM)], mm1\n\tmovq\tMMWORD [MMBLOCK(2,1,edx,SIZEOF_DCTELEM)], mm5\n\tmovq\tMMWORD [MMBLOCK(0,0,edx,SIZEOF_DCTELEM)], mm7\n\tmovq\tMMWORD [MMBLOCK(2,0,edx,SIZEOF_DCTELEM)], mm4\n\n\t; -- Odd part\n\n\tmovq\tmm6, MMWORD [wk(0)]\t; mm6=tmp6\n\tmovq\tmm0, MMWORD [wk(1)]\t; mm0=tmp7\n\n\tpaddw\tmm2,mm3\t\t\t; mm2=tmp10\n\tpaddw\tmm3,mm6\t\t\t; mm3=tmp11\n\tpaddw\tmm6,mm0\t\t\t; mm6=tmp12, mm0=tmp7\n\n\tpsllw\tmm2,PRE_MULTIPLY_SCALE_BITS\n\tpsllw\tmm6,PRE_MULTIPLY_SCALE_BITS\n\n\tpsllw\tmm3,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\tmm3,[GOTOFF(ebx,PW_F0707)] ; mm3=z3\n\n\tmovq\tmm1,mm2\t\t\t; mm1=tmp10\n\tpsubw\tmm2,mm6\n\tpmulhw\tmm2,[GOTOFF(ebx,PW_F0382)] ; mm2=z5\n\tpmulhw\tmm1,[GOTOFF(ebx,PW_F0541)] ; mm1=MULTIPLY(tmp10,FIX_0_54119610)\n\tpmulhw\tmm6,[GOTOFF(ebx,PW_F1306)] ; mm6=MULTIPLY(tmp12,FIX_1_30656296)\n\tpaddw\tmm1,mm2\t\t\t; mm1=z2\n\tpaddw\tmm6,mm2\t\t\t; mm6=z4\n\n\tmovq\tmm5,mm0\n\tpsubw\tmm0,mm3\t\t\t; mm0=z13\n\tpaddw\tmm5,mm3\t\t\t; mm5=z11\n\n\tmovq\tmm7,mm0\n\tmovq\tmm4,mm5\n\tpsubw\tmm0,mm1\t\t\t; mm0=data3\n\tpsubw\tmm5,mm6\t\t\t; mm5=data7\n\tpaddw\tmm7,mm1\t\t\t; mm7=data5\n\tpaddw\tmm4,mm6\t\t\t; mm4=data1\n\n\tmovq\tMMWORD [MMBLOCK(3,0,edx,SIZEOF_DCTELEM)], mm0\n\tmovq\tMMWORD [MMBLOCK(3,1,edx,SIZEOF_DCTELEM)], mm5\n\tmovq\tMMWORD [MMBLOCK(1,1,edx,SIZEOF_DCTELEM)], mm7\n\tmovq\tMMWORD [MMBLOCK(1,0,edx,SIZEOF_DCTELEM)], mm4\n\n\tadd\tedx, byte 4*DCTSIZE*SIZEOF_DCTELEM\n\tdec\tecx\n\tjnz\tnear .rowloop\n\n\t; ---- Pass 2: process columns.\n\n\tmov\tedx, POINTER [data(eax)]\t; (DCTELEM *)\n\tmov\tecx, DCTSIZE/4\n\talignx\t16,7\n.columnloop:\n\n\tmovq\tmm0, MMWORD [MMBLOCK(2,0,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm1, MMWORD [MMBLOCK(3,0,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm2, MMWORD [MMBLOCK(6,0,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm3, MMWORD [MMBLOCK(7,0,edx,SIZEOF_DCTELEM)]\n\n\t; mm0=(02 12 22 32), mm2=(42 52 62 72)\n\t; mm1=(03 13 23 33), mm3=(43 53 63 73)\n\n\tmovq      mm4,mm0\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm0,mm1\t\t; mm0=(02 03 12 13)\n\tpunpckhwd mm4,mm1\t\t; mm4=(22 23 32 33)\n\tmovq      mm5,mm2\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm2,mm3\t\t; mm2=(42 43 52 53)\n\tpunpckhwd mm5,mm3\t\t; mm5=(62 63 72 73)\n\n\tmovq\tmm6, MMWORD [MMBLOCK(0,0,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm7, MMWORD [MMBLOCK(1,0,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm1, MMWORD [MMBLOCK(4,0,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm3, MMWORD [MMBLOCK(5,0,edx,SIZEOF_DCTELEM)]\n\n\t; mm6=(00 10 20 30), mm1=(40 50 60 70)\n\t; mm7=(01 11 21 31), mm3=(41 51 61 71)\n\n\tmovq\tMMWORD [wk(0)], mm4\t; wk(0)=(22 23 32 33)\n\tmovq\tMMWORD [wk(1)], mm2\t; wk(1)=(42 43 52 53)\n\n\tmovq      mm4,mm6\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm6,mm7\t\t; mm6=(00 01 10 11)\n\tpunpckhwd mm4,mm7\t\t; mm4=(20 21 30 31)\n\tmovq      mm2,mm1\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm1,mm3\t\t; mm1=(40 41 50 51)\n\tpunpckhwd mm2,mm3\t\t; mm2=(60 61 70 71)\n\n\tmovq      mm7,mm6\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm6,mm0\t\t; mm6=(00 01 02 03)=data0\n\tpunpckhdq mm7,mm0\t\t; mm7=(10 11 12 13)=data1\n\tmovq      mm3,mm2\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm2,mm5\t\t; mm2=(60 61 62 63)=data6\n\tpunpckhdq mm3,mm5\t\t; mm3=(70 71 72 73)=data7\n\n\tmovq\tmm0,mm7\n\tmovq\tmm5,mm6\n\tpsubw\tmm7,mm2\t\t\t; mm7=data1-data6=tmp6\n\tpsubw\tmm6,mm3\t\t\t; mm6=data0-data7=tmp7\n\tpaddw\tmm0,mm2\t\t\t; mm0=data1+data6=tmp1\n\tpaddw\tmm5,mm3\t\t\t; mm5=data0+data7=tmp0\n\n\tmovq\tmm2, MMWORD [wk(0)]\t; mm2=(22 23 32 33)\n\tmovq\tmm3, MMWORD [wk(1)]\t; mm3=(42 43 52 53)\n\tmovq\tMMWORD [wk(0)], mm7\t; wk(0)=tmp6\n\tmovq\tMMWORD [wk(1)], mm6\t; wk(1)=tmp7\n\n\tmovq      mm7,mm4\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm4,mm2\t\t; mm4=(20 21 22 23)=data2\n\tpunpckhdq mm7,mm2\t\t; mm7=(30 31 32 33)=data3\n\tmovq      mm6,mm1\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm1,mm3\t\t; mm1=(40 41 42 43)=data4\n\tpunpckhdq mm6,mm3\t\t; mm6=(50 51 52 53)=data5\n\n\tmovq\tmm2,mm7\n\tmovq\tmm3,mm4\n\tpaddw\tmm7,mm1\t\t\t; mm7=data3+data4=tmp3\n\tpaddw\tmm4,mm6\t\t\t; mm4=data2+data5=tmp2\n\tpsubw\tmm2,mm1\t\t\t; mm2=data3-data4=tmp4\n\tpsubw\tmm3,mm6\t\t\t; mm3=data2-data5=tmp5\n\n\t; -- Even part\n\n\tmovq\tmm1,mm5\n\tmovq\tmm6,mm0\n\tpsubw\tmm5,mm7\t\t\t; mm5=tmp13\n\tpsubw\tmm0,mm4\t\t\t; mm0=tmp12\n\tpaddw\tmm1,mm7\t\t\t; mm1=tmp10\n\tpaddw\tmm6,mm4\t\t\t; mm6=tmp11\n\n\tpaddw\tmm0,mm5\n\tpsllw\tmm0,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\tmm0,[GOTOFF(ebx,PW_F0707)] ; mm0=z1\n\n\tmovq\tmm7,mm1\n\tmovq\tmm4,mm5\n\tpsubw\tmm1,mm6\t\t\t; mm1=data4\n\tpsubw\tmm5,mm0\t\t\t; mm5=data6\n\tpaddw\tmm7,mm6\t\t\t; mm7=data0\n\tpaddw\tmm4,mm0\t\t\t; mm4=data2\n\n\tmovq\tMMWORD [MMBLOCK(4,0,edx,SIZEOF_DCTELEM)], mm1\n\tmovq\tMMWORD [MMBLOCK(6,0,edx,SIZEOF_DCTELEM)], mm5\n\tmovq\tMMWORD [MMBLOCK(0,0,edx,SIZEOF_DCTELEM)], mm7\n\tmovq\tMMWORD [MMBLOCK(2,0,edx,SIZEOF_DCTELEM)], mm4\n\n\t; -- Odd part\n\n\tmovq\tmm6, MMWORD [wk(0)]\t; mm6=tmp6\n\tmovq\tmm0, MMWORD [wk(1)]\t; mm0=tmp7\n\n\tpaddw\tmm2,mm3\t\t\t; mm2=tmp10\n\tpaddw\tmm3,mm6\t\t\t; mm3=tmp11\n\tpaddw\tmm6,mm0\t\t\t; mm6=tmp12, mm0=tmp7\n\n\tpsllw\tmm2,PRE_MULTIPLY_SCALE_BITS\n\tpsllw\tmm6,PRE_MULTIPLY_SCALE_BITS\n\n\tpsllw\tmm3,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\tmm3,[GOTOFF(ebx,PW_F0707)] ; mm3=z3\n\n\tmovq\tmm1,mm2\t\t\t; mm1=tmp10\n\tpsubw\tmm2,mm6\n\tpmulhw\tmm2,[GOTOFF(ebx,PW_F0382)] ; mm2=z5\n\tpmulhw\tmm1,[GOTOFF(ebx,PW_F0541)] ; mm1=MULTIPLY(tmp10,FIX_0_54119610)\n\tpmulhw\tmm6,[GOTOFF(ebx,PW_F1306)] ; mm6=MULTIPLY(tmp12,FIX_1_30656296)\n\tpaddw\tmm1,mm2\t\t\t; mm1=z2\n\tpaddw\tmm6,mm2\t\t\t; mm6=z4\n\n\tmovq\tmm5,mm0\n\tpsubw\tmm0,mm3\t\t\t; mm0=z13\n\tpaddw\tmm5,mm3\t\t\t; mm5=z11\n\n\tmovq\tmm7,mm0\n\tmovq\tmm4,mm5\n\tpsubw\tmm0,mm1\t\t\t; mm0=data3\n\tpsubw\tmm5,mm6\t\t\t; mm5=data7\n\tpaddw\tmm7,mm1\t\t\t; mm7=data5\n\tpaddw\tmm4,mm6\t\t\t; mm4=data1\n\n\tmovq\tMMWORD [MMBLOCK(3,0,edx,SIZEOF_DCTELEM)], mm0\n\tmovq\tMMWORD [MMBLOCK(7,0,edx,SIZEOF_DCTELEM)], mm5\n\tmovq\tMMWORD [MMBLOCK(5,0,edx,SIZEOF_DCTELEM)], mm7\n\tmovq\tMMWORD [MMBLOCK(1,0,edx,SIZEOF_DCTELEM)], mm4\n\n\tadd\tedx, byte 4*SIZEOF_DCTELEM\n\tdec\tecx\n\tjnz\tnear .columnloop\n\n\temms\t\t; empty MMX state\n\n;\tpop\tedi\t\t; unused\n;\tpop\tesi\t\t; unused\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpoppic\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jfmmxint.asm",
    "content": ";\n; jfmmxint.asm - accurate integer FDCT (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a slow-but-accurate integer implementation of the\n; forward DCT (Discrete Cosine Transform). The following code is based\n; directly on the IJG's original jfdctint.c; see the jfdctint.c for\n; more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS\t13\n%define PASS1_BITS\t2\n\n%define DESCALE_P1\t(CONST_BITS-PASS1_BITS)\n%define DESCALE_P2\t(CONST_BITS+PASS1_BITS)\n\n%if CONST_BITS == 13\nF_0_298\tequ\t 2446\t\t; FIX(0.298631336)\nF_0_390\tequ\t 3196\t\t; FIX(0.390180644)\nF_0_541\tequ\t 4433\t\t; FIX(0.541196100)\nF_0_765\tequ\t 6270\t\t; FIX(0.765366865)\nF_0_899\tequ\t 7373\t\t; FIX(0.899976223)\nF_1_175\tequ\t 9633\t\t; FIX(1.175875602)\nF_1_501\tequ\t12299\t\t; FIX(1.501321110)\nF_1_847\tequ\t15137\t\t; FIX(1.847759065)\nF_1_961\tequ\t16069\t\t; FIX(1.961570560)\nF_2_053\tequ\t16819\t\t; FIX(2.053119869)\nF_2_562\tequ\t20995\t\t; FIX(2.562915447)\nF_3_072\tequ\t25172\t\t; FIX(3.072711026)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_298\tequ\tDESCALE( 320652955,30-CONST_BITS)\t; FIX(0.298631336)\nF_0_390\tequ\tDESCALE( 418953276,30-CONST_BITS)\t; FIX(0.390180644)\nF_0_541\tequ\tDESCALE( 581104887,30-CONST_BITS)\t; FIX(0.541196100)\nF_0_765\tequ\tDESCALE( 821806413,30-CONST_BITS)\t; FIX(0.765366865)\nF_0_899\tequ\tDESCALE( 966342111,30-CONST_BITS)\t; FIX(0.899976223)\nF_1_175\tequ\tDESCALE(1262586813,30-CONST_BITS)\t; FIX(1.175875602)\nF_1_501\tequ\tDESCALE(1612031267,30-CONST_BITS)\t; FIX(1.501321110)\nF_1_847\tequ\tDESCALE(1984016188,30-CONST_BITS)\t; FIX(1.847759065)\nF_1_961\tequ\tDESCALE(2106220350,30-CONST_BITS)\t; FIX(1.961570560)\nF_2_053\tequ\tDESCALE(2204520673,30-CONST_BITS)\t; FIX(2.053119869)\nF_2_562\tequ\tDESCALE(2751909506,30-CONST_BITS)\t; FIX(2.562915447)\nF_3_072\tequ\tDESCALE(3299298341,30-CONST_BITS)\t; FIX(3.072711026)\n%endif\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_fdct_islow_mmx)\n\nEXTN(jconst_fdct_islow_mmx):\n\nPW_F130_F054\ttimes 2 dw  (F_0_541+F_0_765), F_0_541\nPW_F054_MF130\ttimes 2 dw  F_0_541, (F_0_541-F_1_847)\nPW_MF078_F117\ttimes 2 dw  (F_1_175-F_1_961), F_1_175\nPW_F117_F078\ttimes 2 dw  F_1_175, (F_1_175-F_0_390)\nPW_MF060_MF089\ttimes 2 dw  (F_0_298-F_0_899),-F_0_899\nPW_MF089_F060\ttimes 2 dw -F_0_899, (F_1_501-F_0_899)\nPW_MF050_MF256\ttimes 2 dw  (F_2_053-F_2_562),-F_2_562\nPW_MF256_F050\ttimes 2 dw -F_2_562, (F_3_072-F_2_562)\nPD_DESCALE_P1\ttimes 2 dd  1 << (DESCALE_P1-1)\nPD_DESCALE_P2\ttimes 2 dd  1 << (DESCALE_P2-1)\nPW_DESCALE_P2X\ttimes 4 dw  1 << (PASS1_BITS-1)\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Perform the forward DCT on one block of samples.\n;\n; GLOBAL(void)\n; jsimd_fdct_islow_mmx (DCTELEM * data)\n;\n\n%define data(b)\t\t(b)+8\t\t; DCTELEM * data\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_MMWORD\t; mmword wk[WK_NUM]\n%define WK_NUM\t\t2\n\n\talign\t16\n\tglobal\tEXTN(jsimd_fdct_islow_mmx)\n\nEXTN(jsimd_fdct_islow_mmx):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_MMWORD)\t; align to 64 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [wk(0)]\n\tpushpic\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n;\tpush\tesi\t\t; unused\n;\tpush\tedi\t\t; unused\n\n\tget_GOT\tebx\t\t; get GOT address\n\n\t; ---- Pass 1: process rows.\n\n\tmov\tedx, POINTER [data(eax)]\t; (DCTELEM *)\n\tmov\tecx, DCTSIZE/4\n\talignx\t16,7\n.rowloop:\n\n\tmovq\tmm0, MMWORD [MMBLOCK(2,0,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm1, MMWORD [MMBLOCK(3,0,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm2, MMWORD [MMBLOCK(2,1,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm3, MMWORD [MMBLOCK(3,1,edx,SIZEOF_DCTELEM)]\n\n\t; mm0=(20 21 22 23), mm2=(24 25 26 27)\n\t; mm1=(30 31 32 33), mm3=(34 35 36 37)\n\n\tmovq      mm4,mm0\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm0,mm1\t\t; mm0=(20 30 21 31)\n\tpunpckhwd mm4,mm1\t\t; mm4=(22 32 23 33)\n\tmovq      mm5,mm2\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm2,mm3\t\t; mm2=(24 34 25 35)\n\tpunpckhwd mm5,mm3\t\t; mm5=(26 36 27 37)\n\n\tmovq\tmm6, MMWORD [MMBLOCK(0,0,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm7, MMWORD [MMBLOCK(1,0,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm1, MMWORD [MMBLOCK(0,1,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm3, MMWORD [MMBLOCK(1,1,edx,SIZEOF_DCTELEM)]\n\n\t; mm6=(00 01 02 03), mm1=(04 05 06 07)\n\t; mm7=(10 11 12 13), mm3=(14 15 16 17)\n\n\tmovq\tMMWORD [wk(0)], mm4\t; wk(0)=(22 32 23 33)\n\tmovq\tMMWORD [wk(1)], mm2\t; wk(1)=(24 34 25 35)\n\n\tmovq      mm4,mm6\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm6,mm7\t\t; mm6=(00 10 01 11)\n\tpunpckhwd mm4,mm7\t\t; mm4=(02 12 03 13)\n\tmovq      mm2,mm1\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm1,mm3\t\t; mm1=(04 14 05 15)\n\tpunpckhwd mm2,mm3\t\t; mm2=(06 16 07 17)\n\n\tmovq      mm7,mm6\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm6,mm0\t\t; mm6=(00 10 20 30)=data0\n\tpunpckhdq mm7,mm0\t\t; mm7=(01 11 21 31)=data1\n\tmovq      mm3,mm2\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm2,mm5\t\t; mm2=(06 16 26 36)=data6\n\tpunpckhdq mm3,mm5\t\t; mm3=(07 17 27 37)=data7\n\n\tmovq\tmm0,mm7\n\tmovq\tmm5,mm6\n\tpsubw\tmm7,mm2\t\t\t; mm7=data1-data6=tmp6\n\tpsubw\tmm6,mm3\t\t\t; mm6=data0-data7=tmp7\n\tpaddw\tmm0,mm2\t\t\t; mm0=data1+data6=tmp1\n\tpaddw\tmm5,mm3\t\t\t; mm5=data0+data7=tmp0\n\n\tmovq\tmm2, MMWORD [wk(0)]\t; mm2=(22 32 23 33)\n\tmovq\tmm3, MMWORD [wk(1)]\t; mm3=(24 34 25 35)\n\tmovq\tMMWORD [wk(0)], mm7\t; wk(0)=tmp6\n\tmovq\tMMWORD [wk(1)], mm6\t; wk(1)=tmp7\n\n\tmovq      mm7,mm4\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm4,mm2\t\t; mm4=(02 12 22 32)=data2\n\tpunpckhdq mm7,mm2\t\t; mm7=(03 13 23 33)=data3\n\tmovq      mm6,mm1\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm1,mm3\t\t; mm1=(04 14 24 34)=data4\n\tpunpckhdq mm6,mm3\t\t; mm6=(05 15 25 35)=data5\n\n\tmovq\tmm2,mm7\n\tmovq\tmm3,mm4\n\tpaddw\tmm7,mm1\t\t\t; mm7=data3+data4=tmp3\n\tpaddw\tmm4,mm6\t\t\t; mm4=data2+data5=tmp2\n\tpsubw\tmm2,mm1\t\t\t; mm2=data3-data4=tmp4\n\tpsubw\tmm3,mm6\t\t\t; mm3=data2-data5=tmp5\n\n\t; -- Even part\n\n\tmovq\tmm1,mm5\n\tmovq\tmm6,mm0\n\tpaddw\tmm5,mm7\t\t\t; mm5=tmp10\n\tpaddw\tmm0,mm4\t\t\t; mm0=tmp11\n\tpsubw\tmm1,mm7\t\t\t; mm1=tmp13\n\tpsubw\tmm6,mm4\t\t\t; mm6=tmp12\n\n\tmovq\tmm7,mm5\n\tpaddw\tmm5,mm0\t\t\t; mm5=tmp10+tmp11\n\tpsubw\tmm7,mm0\t\t\t; mm7=tmp10-tmp11\n\n\tpsllw\tmm5,PASS1_BITS\t\t; mm5=data0\n\tpsllw\tmm7,PASS1_BITS\t\t; mm7=data4\n\n\tmovq\tMMWORD [MMBLOCK(0,0,edx,SIZEOF_DCTELEM)], mm5\n\tmovq\tMMWORD [MMBLOCK(0,1,edx,SIZEOF_DCTELEM)], mm7\n\n\t; (Original)\n\t; z1 = (tmp12 + tmp13) * 0.541196100;\n\t; data2 = z1 + tmp13 * 0.765366865;\n\t; data6 = z1 + tmp12 * -1.847759065;\n\t;\n\t; (This implementation)\n\t; data2 = tmp13 * (0.541196100 + 0.765366865) + tmp12 * 0.541196100;\n\t; data6 = tmp13 * 0.541196100 + tmp12 * (0.541196100 - 1.847759065);\n\n\tmovq      mm4,mm1\t\t; mm1=tmp13\n\tmovq      mm0,mm1\n\tpunpcklwd mm4,mm6\t\t; mm6=tmp12\n\tpunpckhwd mm0,mm6\n\tmovq      mm1,mm4\n\tmovq      mm6,mm0\n\tpmaddwd   mm4,[GOTOFF(ebx,PW_F130_F054)]\t; mm4=data2L\n\tpmaddwd   mm0,[GOTOFF(ebx,PW_F130_F054)]\t; mm0=data2H\n\tpmaddwd   mm1,[GOTOFF(ebx,PW_F054_MF130)]\t; mm1=data6L\n\tpmaddwd   mm6,[GOTOFF(ebx,PW_F054_MF130)]\t; mm6=data6H\n\n\tpaddd\tmm4,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpaddd\tmm0,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpsrad\tmm4,DESCALE_P1\n\tpsrad\tmm0,DESCALE_P1\n\tpaddd\tmm1,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpaddd\tmm6,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpsrad\tmm1,DESCALE_P1\n\tpsrad\tmm6,DESCALE_P1\n\n\tpackssdw  mm4,mm0\t\t; mm4=data2\n\tpackssdw  mm1,mm6\t\t; mm1=data6\n\n\tmovq\tMMWORD [MMBLOCK(2,0,edx,SIZEOF_DCTELEM)], mm4\n\tmovq\tMMWORD [MMBLOCK(2,1,edx,SIZEOF_DCTELEM)], mm1\n\n\t; -- Odd part\n\n\tmovq\tmm5, MMWORD [wk(0)]\t; mm5=tmp6\n\tmovq\tmm7, MMWORD [wk(1)]\t; mm7=tmp7\n\n\tmovq\tmm0,mm2\t\t\t; mm2=tmp4\n\tmovq\tmm6,mm3\t\t\t; mm3=tmp5\n\tpaddw\tmm0,mm5\t\t\t; mm0=z3\n\tpaddw\tmm6,mm7\t\t\t; mm6=z4\n\n\t; (Original)\n\t; z5 = (z3 + z4) * 1.175875602;\n\t; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n\t; z3 += z5;  z4 += z5;\n\t;\n\t; (This implementation)\n\t; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n\t; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n\tmovq      mm4,mm0\n\tmovq      mm1,mm0\n\tpunpcklwd mm4,mm6\n\tpunpckhwd mm1,mm6\n\tmovq      mm0,mm4\n\tmovq      mm6,mm1\n\tpmaddwd   mm4,[GOTOFF(ebx,PW_MF078_F117)]\t; mm4=z3L\n\tpmaddwd   mm1,[GOTOFF(ebx,PW_MF078_F117)]\t; mm1=z3H\n\tpmaddwd   mm0,[GOTOFF(ebx,PW_F117_F078)]\t; mm0=z4L\n\tpmaddwd   mm6,[GOTOFF(ebx,PW_F117_F078)]\t; mm6=z4H\n\n\tmovq\tMMWORD [wk(0)], mm4\t; wk(0)=z3L\n\tmovq\tMMWORD [wk(1)], mm1\t; wk(1)=z3H\n\n\t; (Original)\n\t; z1 = tmp4 + tmp7;  z2 = tmp5 + tmp6;\n\t; tmp4 = tmp4 * 0.298631336;  tmp5 = tmp5 * 2.053119869;\n\t; tmp6 = tmp6 * 3.072711026;  tmp7 = tmp7 * 1.501321110;\n\t; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n\t; data7 = tmp4 + z1 + z3;  data5 = tmp5 + z2 + z4;\n\t; data3 = tmp6 + z2 + z3;  data1 = tmp7 + z1 + z4;\n\t;\n\t; (This implementation)\n\t; tmp4 = tmp4 * (0.298631336 - 0.899976223) + tmp7 * -0.899976223;\n\t; tmp5 = tmp5 * (2.053119869 - 2.562915447) + tmp6 * -2.562915447;\n\t; tmp6 = tmp5 * -2.562915447 + tmp6 * (3.072711026 - 2.562915447);\n\t; tmp7 = tmp4 * -0.899976223 + tmp7 * (1.501321110 - 0.899976223);\n\t; data7 = tmp4 + z3;  data5 = tmp5 + z4;\n\t; data3 = tmp6 + z3;  data1 = tmp7 + z4;\n\n\tmovq      mm4,mm2\n\tmovq      mm1,mm2\n\tpunpcklwd mm4,mm7\n\tpunpckhwd mm1,mm7\n\tmovq      mm2,mm4\n\tmovq      mm7,mm1\n\tpmaddwd   mm4,[GOTOFF(ebx,PW_MF060_MF089)]\t; mm4=tmp4L\n\tpmaddwd   mm1,[GOTOFF(ebx,PW_MF060_MF089)]\t; mm1=tmp4H\n\tpmaddwd   mm2,[GOTOFF(ebx,PW_MF089_F060)]\t; mm2=tmp7L\n\tpmaddwd   mm7,[GOTOFF(ebx,PW_MF089_F060)]\t; mm7=tmp7H\n\n\tpaddd\tmm4, MMWORD [wk(0)]\t; mm4=data7L\n\tpaddd\tmm1, MMWORD [wk(1)]\t; mm1=data7H\n\tpaddd\tmm2,mm0\t\t\t; mm2=data1L\n\tpaddd\tmm7,mm6\t\t\t; mm7=data1H\n\n\tpaddd\tmm4,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpaddd\tmm1,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpsrad\tmm4,DESCALE_P1\n\tpsrad\tmm1,DESCALE_P1\n\tpaddd\tmm2,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpaddd\tmm7,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpsrad\tmm2,DESCALE_P1\n\tpsrad\tmm7,DESCALE_P1\n\n\tpackssdw  mm4,mm1\t\t; mm4=data7\n\tpackssdw  mm2,mm7\t\t; mm2=data1\n\n\tmovq\tMMWORD [MMBLOCK(3,1,edx,SIZEOF_DCTELEM)], mm4\n\tmovq\tMMWORD [MMBLOCK(1,0,edx,SIZEOF_DCTELEM)], mm2\n\n\tmovq      mm1,mm3\n\tmovq      mm7,mm3\n\tpunpcklwd mm1,mm5\n\tpunpckhwd mm7,mm5\n\tmovq      mm3,mm1\n\tmovq      mm5,mm7\n\tpmaddwd   mm1,[GOTOFF(ebx,PW_MF050_MF256)]\t; mm1=tmp5L\n\tpmaddwd   mm7,[GOTOFF(ebx,PW_MF050_MF256)]\t; mm7=tmp5H\n\tpmaddwd   mm3,[GOTOFF(ebx,PW_MF256_F050)]\t; mm3=tmp6L\n\tpmaddwd   mm5,[GOTOFF(ebx,PW_MF256_F050)]\t; mm5=tmp6H\n\n\tpaddd\tmm1,mm0\t\t\t; mm1=data5L\n\tpaddd\tmm7,mm6\t\t\t; mm7=data5H\n\tpaddd\tmm3, MMWORD [wk(0)]\t; mm3=data3L\n\tpaddd\tmm5, MMWORD [wk(1)]\t; mm5=data3H\n\n\tpaddd\tmm1,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpaddd\tmm7,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpsrad\tmm1,DESCALE_P1\n\tpsrad\tmm7,DESCALE_P1\n\tpaddd\tmm3,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpaddd\tmm5,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpsrad\tmm3,DESCALE_P1\n\tpsrad\tmm5,DESCALE_P1\n\n\tpackssdw  mm1,mm7\t\t; mm1=data5\n\tpackssdw  mm3,mm5\t\t; mm3=data3\n\n\tmovq\tMMWORD [MMBLOCK(1,1,edx,SIZEOF_DCTELEM)], mm1\n\tmovq\tMMWORD [MMBLOCK(3,0,edx,SIZEOF_DCTELEM)], mm3\n\n\tadd\tedx, byte 4*DCTSIZE*SIZEOF_DCTELEM\n\tdec\tecx\n\tjnz\tnear .rowloop\n\n\t; ---- Pass 2: process columns.\n\n\tmov\tedx, POINTER [data(eax)]\t; (DCTELEM *)\n\tmov\tecx, DCTSIZE/4\n\talignx\t16,7\n.columnloop:\n\n\tmovq\tmm0, MMWORD [MMBLOCK(2,0,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm1, MMWORD [MMBLOCK(3,0,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm2, MMWORD [MMBLOCK(6,0,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm3, MMWORD [MMBLOCK(7,0,edx,SIZEOF_DCTELEM)]\n\n\t; mm0=(02 12 22 32), mm2=(42 52 62 72)\n\t; mm1=(03 13 23 33), mm3=(43 53 63 73)\n\n\tmovq      mm4,mm0\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm0,mm1\t\t; mm0=(02 03 12 13)\n\tpunpckhwd mm4,mm1\t\t; mm4=(22 23 32 33)\n\tmovq      mm5,mm2\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm2,mm3\t\t; mm2=(42 43 52 53)\n\tpunpckhwd mm5,mm3\t\t; mm5=(62 63 72 73)\n\n\tmovq\tmm6, MMWORD [MMBLOCK(0,0,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm7, MMWORD [MMBLOCK(1,0,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm1, MMWORD [MMBLOCK(4,0,edx,SIZEOF_DCTELEM)]\n\tmovq\tmm3, MMWORD [MMBLOCK(5,0,edx,SIZEOF_DCTELEM)]\n\n\t; mm6=(00 10 20 30), mm1=(40 50 60 70)\n\t; mm7=(01 11 21 31), mm3=(41 51 61 71)\n\n\tmovq\tMMWORD [wk(0)], mm4\t; wk(0)=(22 23 32 33)\n\tmovq\tMMWORD [wk(1)], mm2\t; wk(1)=(42 43 52 53)\n\n\tmovq      mm4,mm6\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm6,mm7\t\t; mm6=(00 01 10 11)\n\tpunpckhwd mm4,mm7\t\t; mm4=(20 21 30 31)\n\tmovq      mm2,mm1\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm1,mm3\t\t; mm1=(40 41 50 51)\n\tpunpckhwd mm2,mm3\t\t; mm2=(60 61 70 71)\n\n\tmovq      mm7,mm6\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm6,mm0\t\t; mm6=(00 01 02 03)=data0\n\tpunpckhdq mm7,mm0\t\t; mm7=(10 11 12 13)=data1\n\tmovq      mm3,mm2\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm2,mm5\t\t; mm2=(60 61 62 63)=data6\n\tpunpckhdq mm3,mm5\t\t; mm3=(70 71 72 73)=data7\n\n\tmovq\tmm0,mm7\n\tmovq\tmm5,mm6\n\tpsubw\tmm7,mm2\t\t\t; mm7=data1-data6=tmp6\n\tpsubw\tmm6,mm3\t\t\t; mm6=data0-data7=tmp7\n\tpaddw\tmm0,mm2\t\t\t; mm0=data1+data6=tmp1\n\tpaddw\tmm5,mm3\t\t\t; mm5=data0+data7=tmp0\n\n\tmovq\tmm2, MMWORD [wk(0)]\t; mm2=(22 23 32 33)\n\tmovq\tmm3, MMWORD [wk(1)]\t; mm3=(42 43 52 53)\n\tmovq\tMMWORD [wk(0)], mm7\t; wk(0)=tmp6\n\tmovq\tMMWORD [wk(1)], mm6\t; wk(1)=tmp7\n\n\tmovq      mm7,mm4\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm4,mm2\t\t; mm4=(20 21 22 23)=data2\n\tpunpckhdq mm7,mm2\t\t; mm7=(30 31 32 33)=data3\n\tmovq      mm6,mm1\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm1,mm3\t\t; mm1=(40 41 42 43)=data4\n\tpunpckhdq mm6,mm3\t\t; mm6=(50 51 52 53)=data5\n\n\tmovq\tmm2,mm7\n\tmovq\tmm3,mm4\n\tpaddw\tmm7,mm1\t\t\t; mm7=data3+data4=tmp3\n\tpaddw\tmm4,mm6\t\t\t; mm4=data2+data5=tmp2\n\tpsubw\tmm2,mm1\t\t\t; mm2=data3-data4=tmp4\n\tpsubw\tmm3,mm6\t\t\t; mm3=data2-data5=tmp5\n\n\t; -- Even part\n\n\tmovq\tmm1,mm5\n\tmovq\tmm6,mm0\n\tpaddw\tmm5,mm7\t\t\t; mm5=tmp10\n\tpaddw\tmm0,mm4\t\t\t; mm0=tmp11\n\tpsubw\tmm1,mm7\t\t\t; mm1=tmp13\n\tpsubw\tmm6,mm4\t\t\t; mm6=tmp12\n\n\tmovq\tmm7,mm5\n\tpaddw\tmm5,mm0\t\t\t; mm5=tmp10+tmp11\n\tpsubw\tmm7,mm0\t\t\t; mm7=tmp10-tmp11\n\n\tpaddw\tmm5,[GOTOFF(ebx,PW_DESCALE_P2X)]\n\tpaddw\tmm7,[GOTOFF(ebx,PW_DESCALE_P2X)]\n\tpsraw\tmm5,PASS1_BITS\t\t; mm5=data0\n\tpsraw\tmm7,PASS1_BITS\t\t; mm7=data4\n\n\tmovq\tMMWORD [MMBLOCK(0,0,edx,SIZEOF_DCTELEM)], mm5\n\tmovq\tMMWORD [MMBLOCK(4,0,edx,SIZEOF_DCTELEM)], mm7\n\n\t; (Original)\n\t; z1 = (tmp12 + tmp13) * 0.541196100;\n\t; data2 = z1 + tmp13 * 0.765366865;\n\t; data6 = z1 + tmp12 * -1.847759065;\n\t;\n\t; (This implementation)\n\t; data2 = tmp13 * (0.541196100 + 0.765366865) + tmp12 * 0.541196100;\n\t; data6 = tmp13 * 0.541196100 + tmp12 * (0.541196100 - 1.847759065);\n\n\tmovq      mm4,mm1\t\t; mm1=tmp13\n\tmovq      mm0,mm1\n\tpunpcklwd mm4,mm6\t\t; mm6=tmp12\n\tpunpckhwd mm0,mm6\n\tmovq      mm1,mm4\n\tmovq      mm6,mm0\n\tpmaddwd   mm4,[GOTOFF(ebx,PW_F130_F054)]\t; mm4=data2L\n\tpmaddwd   mm0,[GOTOFF(ebx,PW_F130_F054)]\t; mm0=data2H\n\tpmaddwd   mm1,[GOTOFF(ebx,PW_F054_MF130)]\t; mm1=data6L\n\tpmaddwd   mm6,[GOTOFF(ebx,PW_F054_MF130)]\t; mm6=data6H\n\n\tpaddd\tmm4,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpaddd\tmm0,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpsrad\tmm4,DESCALE_P2\n\tpsrad\tmm0,DESCALE_P2\n\tpaddd\tmm1,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpaddd\tmm6,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpsrad\tmm1,DESCALE_P2\n\tpsrad\tmm6,DESCALE_P2\n\n\tpackssdw  mm4,mm0\t\t; mm4=data2\n\tpackssdw  mm1,mm6\t\t; mm1=data6\n\n\tmovq\tMMWORD [MMBLOCK(2,0,edx,SIZEOF_DCTELEM)], mm4\n\tmovq\tMMWORD [MMBLOCK(6,0,edx,SIZEOF_DCTELEM)], mm1\n\n\t; -- Odd part\n\n\tmovq\tmm5, MMWORD [wk(0)]\t; mm5=tmp6\n\tmovq\tmm7, MMWORD [wk(1)]\t; mm7=tmp7\n\n\tmovq\tmm0,mm2\t\t\t; mm2=tmp4\n\tmovq\tmm6,mm3\t\t\t; mm3=tmp5\n\tpaddw\tmm0,mm5\t\t\t; mm0=z3\n\tpaddw\tmm6,mm7\t\t\t; mm6=z4\n\n\t; (Original)\n\t; z5 = (z3 + z4) * 1.175875602;\n\t; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n\t; z3 += z5;  z4 += z5;\n\t;\n\t; (This implementation)\n\t; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n\t; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n\tmovq      mm4,mm0\n\tmovq      mm1,mm0\n\tpunpcklwd mm4,mm6\n\tpunpckhwd mm1,mm6\n\tmovq      mm0,mm4\n\tmovq      mm6,mm1\n\tpmaddwd   mm4,[GOTOFF(ebx,PW_MF078_F117)]\t; mm4=z3L\n\tpmaddwd   mm1,[GOTOFF(ebx,PW_MF078_F117)]\t; mm1=z3H\n\tpmaddwd   mm0,[GOTOFF(ebx,PW_F117_F078)]\t; mm0=z4L\n\tpmaddwd   mm6,[GOTOFF(ebx,PW_F117_F078)]\t; mm6=z4H\n\n\tmovq\tMMWORD [wk(0)], mm4\t; wk(0)=z3L\n\tmovq\tMMWORD [wk(1)], mm1\t; wk(1)=z3H\n\n\t; (Original)\n\t; z1 = tmp4 + tmp7;  z2 = tmp5 + tmp6;\n\t; tmp4 = tmp4 * 0.298631336;  tmp5 = tmp5 * 2.053119869;\n\t; tmp6 = tmp6 * 3.072711026;  tmp7 = tmp7 * 1.501321110;\n\t; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n\t; data7 = tmp4 + z1 + z3;  data5 = tmp5 + z2 + z4;\n\t; data3 = tmp6 + z2 + z3;  data1 = tmp7 + z1 + z4;\n\t;\n\t; (This implementation)\n\t; tmp4 = tmp4 * (0.298631336 - 0.899976223) + tmp7 * -0.899976223;\n\t; tmp5 = tmp5 * (2.053119869 - 2.562915447) + tmp6 * -2.562915447;\n\t; tmp6 = tmp5 * -2.562915447 + tmp6 * (3.072711026 - 2.562915447);\n\t; tmp7 = tmp4 * -0.899976223 + tmp7 * (1.501321110 - 0.899976223);\n\t; data7 = tmp4 + z3;  data5 = tmp5 + z4;\n\t; data3 = tmp6 + z3;  data1 = tmp7 + z4;\n\n\tmovq      mm4,mm2\n\tmovq      mm1,mm2\n\tpunpcklwd mm4,mm7\n\tpunpckhwd mm1,mm7\n\tmovq      mm2,mm4\n\tmovq      mm7,mm1\n\tpmaddwd   mm4,[GOTOFF(ebx,PW_MF060_MF089)]\t; mm4=tmp4L\n\tpmaddwd   mm1,[GOTOFF(ebx,PW_MF060_MF089)]\t; mm1=tmp4H\n\tpmaddwd   mm2,[GOTOFF(ebx,PW_MF089_F060)]\t; mm2=tmp7L\n\tpmaddwd   mm7,[GOTOFF(ebx,PW_MF089_F060)]\t; mm7=tmp7H\n\n\tpaddd\tmm4, MMWORD [wk(0)]\t; mm4=data7L\n\tpaddd\tmm1, MMWORD [wk(1)]\t; mm1=data7H\n\tpaddd\tmm2,mm0\t\t\t; mm2=data1L\n\tpaddd\tmm7,mm6\t\t\t; mm7=data1H\n\n\tpaddd\tmm4,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpaddd\tmm1,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpsrad\tmm4,DESCALE_P2\n\tpsrad\tmm1,DESCALE_P2\n\tpaddd\tmm2,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpaddd\tmm7,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpsrad\tmm2,DESCALE_P2\n\tpsrad\tmm7,DESCALE_P2\n\n\tpackssdw  mm4,mm1\t\t; mm4=data7\n\tpackssdw  mm2,mm7\t\t; mm2=data1\n\n\tmovq\tMMWORD [MMBLOCK(7,0,edx,SIZEOF_DCTELEM)], mm4\n\tmovq\tMMWORD [MMBLOCK(1,0,edx,SIZEOF_DCTELEM)], mm2\n\n\tmovq      mm1,mm3\n\tmovq      mm7,mm3\n\tpunpcklwd mm1,mm5\n\tpunpckhwd mm7,mm5\n\tmovq      mm3,mm1\n\tmovq      mm5,mm7\n\tpmaddwd   mm1,[GOTOFF(ebx,PW_MF050_MF256)]\t; mm1=tmp5L\n\tpmaddwd   mm7,[GOTOFF(ebx,PW_MF050_MF256)]\t; mm7=tmp5H\n\tpmaddwd   mm3,[GOTOFF(ebx,PW_MF256_F050)]\t; mm3=tmp6L\n\tpmaddwd   mm5,[GOTOFF(ebx,PW_MF256_F050)]\t; mm5=tmp6H\n\n\tpaddd\tmm1,mm0\t\t\t; mm1=data5L\n\tpaddd\tmm7,mm6\t\t\t; mm7=data5H\n\tpaddd\tmm3, MMWORD [wk(0)]\t; mm3=data3L\n\tpaddd\tmm5, MMWORD [wk(1)]\t; mm5=data3H\n\n\tpaddd\tmm1,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpaddd\tmm7,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpsrad\tmm1,DESCALE_P2\n\tpsrad\tmm7,DESCALE_P2\n\tpaddd\tmm3,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpaddd\tmm5,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpsrad\tmm3,DESCALE_P2\n\tpsrad\tmm5,DESCALE_P2\n\n\tpackssdw  mm1,mm7\t\t; mm1=data5\n\tpackssdw  mm3,mm5\t\t; mm3=data3\n\n\tmovq\tMMWORD [MMBLOCK(5,0,edx,SIZEOF_DCTELEM)], mm1\n\tmovq\tMMWORD [MMBLOCK(3,0,edx,SIZEOF_DCTELEM)], mm3\n\n\tadd\tedx, byte 4*SIZEOF_DCTELEM\n\tdec\tecx\n\tjnz\tnear .columnloop\n\n\temms\t\t; empty MMX state\n\n;\tpop\tedi\t\t; unused\n;\tpop\tesi\t\t; unused\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpoppic\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jfss2fst-64.asm",
    "content": ";\n; jfss2fst-64.asm - fast integer FDCT (64-bit SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2009 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a fast, not so accurate integer implementation of\n; the forward DCT (Discrete Cosine Transform). The following code is\n; based directly on the IJG's original jfdctfst.c; see the jfdctfst.c\n; for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS\t8\t; 14 is also OK.\n\n%if CONST_BITS == 8\nF_0_382\tequ\t 98\t\t; FIX(0.382683433)\nF_0_541\tequ\t139\t\t; FIX(0.541196100)\nF_0_707\tequ\t181\t\t; FIX(0.707106781)\nF_1_306\tequ\t334\t\t; FIX(1.306562965)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_382\tequ\tDESCALE( 410903207,30-CONST_BITS)\t; FIX(0.382683433)\nF_0_541\tequ\tDESCALE( 581104887,30-CONST_BITS)\t; FIX(0.541196100)\nF_0_707\tequ\tDESCALE( 759250124,30-CONST_BITS)\t; FIX(0.707106781)\nF_1_306\tequ\tDESCALE(1402911301,30-CONST_BITS)\t; FIX(1.306562965)\n%endif\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n; PRE_MULTIPLY_SCALE_BITS <= 2 (to avoid overflow)\n; CONST_BITS + CONST_SHIFT + PRE_MULTIPLY_SCALE_BITS == 16 (for pmulhw)\n\n%define PRE_MULTIPLY_SCALE_BITS   2\n%define CONST_SHIFT     (16 - PRE_MULTIPLY_SCALE_BITS - CONST_BITS)\n\n\talignz\t16\n\tglobal\tEXTN(jconst_fdct_ifast_sse2)\n\nEXTN(jconst_fdct_ifast_sse2):\n\nPW_F0707\ttimes 8 dw  F_0_707 << CONST_SHIFT\nPW_F0382\ttimes 8 dw  F_0_382 << CONST_SHIFT\nPW_F0541\ttimes 8 dw  F_0_541 << CONST_SHIFT\nPW_F1306\ttimes 8 dw  F_1_306 << CONST_SHIFT\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t64\n;\n; Perform the forward DCT on one block of samples.\n;\n; GLOBAL(void)\n; jsimd_fdct_ifast_sse2 (DCTELEM * data)\n;\n\n; r10 = DCTELEM * data\n\n%define wk(i)\t\trbp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t2\n\n\talign\t16\n\tglobal\tEXTN(jsimd_fdct_ifast_sse2)\n\nEXTN(jsimd_fdct_ifast_sse2):\n\tpush\trbp\n\tmov\trax,rsp\t\t\t\t; rax = original rbp\n\tsub\trsp, byte 4\n\tand\trsp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[rsp],rax\n\tmov\trbp,rsp\t\t\t\t; rbp = aligned rbp\n\tlea\trsp, [wk(0)]\n\tcollect_args\n\n\t; ---- Pass 1: process rows.\n\n\tmov\trdx, r10\t; (DCTELEM *)\n\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm2, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm3, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_DCTELEM)]\n\n\t; xmm0=(00 01 02 03 04 05 06 07), xmm2=(20 21 22 23 24 25 26 27)\n\t; xmm1=(10 11 12 13 14 15 16 17), xmm3=(30 31 32 33 34 35 36 37)\n\n\tmovdqa    xmm4,xmm0\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm0,xmm1\t\t; xmm0=(00 10 01 11 02 12 03 13)\n\tpunpckhwd xmm4,xmm1\t\t; xmm4=(04 14 05 15 06 16 07 17)\n\tmovdqa    xmm5,xmm2\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm2,xmm3\t\t; xmm2=(20 30 21 31 22 32 23 33)\n\tpunpckhwd xmm5,xmm3\t\t; xmm5=(24 34 25 35 26 36 27 37)\n\n\tmovdqa\txmm6, XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm7, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm3, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_DCTELEM)]\n\n\t; xmm6=( 4 12 20 28 36 44 52 60), xmm1=( 6 14 22 30 38 46 54 62)\n\t; xmm7=( 5 13 21 29 37 45 53 61), xmm3=( 7 15 23 31 39 47 55 63)\n\n\tmovdqa\tXMMWORD [wk(0)], xmm2\t; wk(0)=(20 30 21 31 22 32 23 33)\n\tmovdqa\tXMMWORD [wk(1)], xmm5\t; wk(1)=(24 34 25 35 26 36 27 37)\n\n\tmovdqa    xmm2,xmm6\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm6,xmm7\t\t; xmm6=(40 50 41 51 42 52 43 53)\n\tpunpckhwd xmm2,xmm7\t\t; xmm2=(44 54 45 55 46 56 47 57)\n\tmovdqa    xmm5,xmm1\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm1,xmm3\t\t; xmm1=(60 70 61 71 62 72 63 73)\n\tpunpckhwd xmm5,xmm3\t\t; xmm5=(64 74 65 75 66 76 67 77)\n\n\tmovdqa    xmm7,xmm6\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm6,xmm1\t\t; xmm6=(40 50 60 70 41 51 61 71)\n\tpunpckhdq xmm7,xmm1\t\t; xmm7=(42 52 62 72 43 53 63 73)\n\tmovdqa    xmm3,xmm2\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm2,xmm5\t\t; xmm2=(44 54 64 74 45 55 65 75)\n\tpunpckhdq xmm3,xmm5\t\t; xmm3=(46 56 66 76 47 57 67 77)\n\n\tmovdqa\txmm1, XMMWORD [wk(0)]\t; xmm1=(20 30 21 31 22 32 23 33)\n\tmovdqa\txmm5, XMMWORD [wk(1)]\t; xmm5=(24 34 25 35 26 36 27 37)\n\tmovdqa\tXMMWORD [wk(0)], xmm7\t; wk(0)=(42 52 62 72 43 53 63 73)\n\tmovdqa\tXMMWORD [wk(1)], xmm2\t; wk(1)=(44 54 64 74 45 55 65 75)\n\n\tmovdqa    xmm7,xmm0\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm0,xmm1\t\t; xmm0=(00 10 20 30 01 11 21 31)\n\tpunpckhdq xmm7,xmm1\t\t; xmm7=(02 12 22 32 03 13 23 33)\n\tmovdqa    xmm2,xmm4\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm4,xmm5\t\t; xmm4=(04 14 24 34 05 15 25 35)\n\tpunpckhdq xmm2,xmm5\t\t; xmm2=(06 16 26 36 07 17 27 37)\n\n\tmovdqa     xmm1,xmm0\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm0,xmm6\t\t; xmm0=(00 10 20 30 40 50 60 70)=data0\n\tpunpckhqdq xmm1,xmm6\t\t; xmm1=(01 11 21 31 41 51 61 71)=data1\n\tmovdqa     xmm5,xmm2\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm2,xmm3\t\t; xmm2=(06 16 26 36 46 56 66 76)=data6\n\tpunpckhqdq xmm5,xmm3\t\t; xmm5=(07 17 27 37 47 57 67 77)=data7\n\n\tmovdqa\txmm6,xmm1\n\tmovdqa\txmm3,xmm0\n\tpsubw\txmm1,xmm2\t\t; xmm1=data1-data6=tmp6\n\tpsubw\txmm0,xmm5\t\t; xmm0=data0-data7=tmp7\n\tpaddw\txmm6,xmm2\t\t; xmm6=data1+data6=tmp1\n\tpaddw\txmm3,xmm5\t\t; xmm3=data0+data7=tmp0\n\n\tmovdqa\txmm2, XMMWORD [wk(0)]\t; xmm2=(42 52 62 72 43 53 63 73)\n\tmovdqa\txmm5, XMMWORD [wk(1)]\t; xmm5=(44 54 64 74 45 55 65 75)\n\tmovdqa\tXMMWORD [wk(0)], xmm1\t; wk(0)=tmp6\n\tmovdqa\tXMMWORD [wk(1)], xmm0\t; wk(1)=tmp7\n\n\tmovdqa     xmm1,xmm7\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm7,xmm2\t\t; xmm7=(02 12 22 32 42 52 62 72)=data2\n\tpunpckhqdq xmm1,xmm2\t\t; xmm1=(03 13 23 33 43 53 63 73)=data3\n\tmovdqa     xmm0,xmm4\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm4,xmm5\t\t; xmm4=(04 14 24 34 44 54 64 74)=data4\n\tpunpckhqdq xmm0,xmm5\t\t; xmm0=(05 15 25 35 45 55 65 75)=data5\n\n\tmovdqa\txmm2,xmm1\n\tmovdqa\txmm5,xmm7\n\tpaddw\txmm1,xmm4\t\t; xmm1=data3+data4=tmp3\n\tpaddw\txmm7,xmm0\t\t; xmm7=data2+data5=tmp2\n\tpsubw\txmm2,xmm4\t\t; xmm2=data3-data4=tmp4\n\tpsubw\txmm5,xmm0\t\t; xmm5=data2-data5=tmp5\n\n\t; -- Even part\n\n\tmovdqa\txmm4,xmm3\n\tmovdqa\txmm0,xmm6\n\tpsubw\txmm3,xmm1\t\t; xmm3=tmp13\n\tpsubw\txmm6,xmm7\t\t; xmm6=tmp12\n\tpaddw\txmm4,xmm1\t\t; xmm4=tmp10\n\tpaddw\txmm0,xmm7\t\t; xmm0=tmp11\n\n\tpaddw\txmm6,xmm3\n\tpsllw\txmm6,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\txmm6,[rel PW_F0707] ; xmm6=z1\n\n\tmovdqa\txmm1,xmm4\n\tmovdqa\txmm7,xmm3\n\tpsubw\txmm4,xmm0\t\t; xmm4=data4\n\tpsubw\txmm3,xmm6\t\t; xmm3=data6\n\tpaddw\txmm1,xmm0\t\t; xmm1=data0\n\tpaddw\txmm7,xmm6\t\t; xmm7=data2\n\n\tmovdqa\txmm0, XMMWORD [wk(0)]\t; xmm0=tmp6\n\tmovdqa\txmm6, XMMWORD [wk(1)]\t; xmm6=tmp7\n\tmovdqa\tXMMWORD [wk(0)], xmm4\t; wk(0)=data4\n\tmovdqa\tXMMWORD [wk(1)], xmm3\t; wk(1)=data6\n\n\t; -- Odd part\n\n\tpaddw\txmm2,xmm5\t\t; xmm2=tmp10\n\tpaddw\txmm5,xmm0\t\t; xmm5=tmp11\n\tpaddw\txmm0,xmm6\t\t; xmm0=tmp12, xmm6=tmp7\n\n\tpsllw\txmm2,PRE_MULTIPLY_SCALE_BITS\n\tpsllw\txmm0,PRE_MULTIPLY_SCALE_BITS\n\n\tpsllw\txmm5,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\txmm5,[rel PW_F0707] ; xmm5=z3\n\n\tmovdqa\txmm4,xmm2\t\t; xmm4=tmp10\n\tpsubw\txmm2,xmm0\n\tpmulhw\txmm2,[rel PW_F0382] ; xmm2=z5\n\tpmulhw\txmm4,[rel PW_F0541] ; xmm4=MULTIPLY(tmp10,FIX_0_541196)\n\tpmulhw\txmm0,[rel PW_F1306] ; xmm0=MULTIPLY(tmp12,FIX_1_306562)\n\tpaddw\txmm4,xmm2\t\t; xmm4=z2\n\tpaddw\txmm0,xmm2\t\t; xmm0=z4\n\n\tmovdqa\txmm3,xmm6\n\tpsubw\txmm6,xmm5\t\t; xmm6=z13\n\tpaddw\txmm3,xmm5\t\t; xmm3=z11\n\n\tmovdqa\txmm2,xmm6\n\tmovdqa\txmm5,xmm3\n\tpsubw\txmm6,xmm4\t\t; xmm6=data3\n\tpsubw\txmm3,xmm0\t\t; xmm3=data7\n\tpaddw\txmm2,xmm4\t\t; xmm2=data5\n\tpaddw\txmm5,xmm0\t\t; xmm5=data1\n\n\t; ---- Pass 2: process columns.\n\n\t; xmm1=(00 10 20 30 40 50 60 70), xmm7=(02 12 22 32 42 52 62 72)\n\t; xmm5=(01 11 21 31 41 51 61 71), xmm6=(03 13 23 33 43 53 63 73)\n\n\tmovdqa    xmm4,xmm1\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm1,xmm5\t\t; xmm1=(00 01 10 11 20 21 30 31)\n\tpunpckhwd xmm4,xmm5\t\t; xmm4=(40 41 50 51 60 61 70 71)\n\tmovdqa    xmm0,xmm7\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm7,xmm6\t\t; xmm7=(02 03 12 13 22 23 32 33)\n\tpunpckhwd xmm0,xmm6\t\t; xmm0=(42 43 52 53 62 63 72 73)\n\n\tmovdqa\txmm5, XMMWORD [wk(0)]\t; xmm5=col4\n\tmovdqa\txmm6, XMMWORD [wk(1)]\t; xmm6=col6\n\n\t; xmm5=(04 14 24 34 44 54 64 74), xmm6=(06 16 26 36 46 56 66 76)\n\t; xmm2=(05 15 25 35 45 55 65 75), xmm3=(07 17 27 37 47 57 67 77)\n\n\tmovdqa\tXMMWORD [wk(0)], xmm7\t; wk(0)=(02 03 12 13 22 23 32 33)\n\tmovdqa\tXMMWORD [wk(1)], xmm0\t; wk(1)=(42 43 52 53 62 63 72 73)\n\n\tmovdqa    xmm7,xmm5\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm5,xmm2\t\t; xmm5=(04 05 14 15 24 25 34 35)\n\tpunpckhwd xmm7,xmm2\t\t; xmm7=(44 45 54 55 64 65 74 75)\n\tmovdqa    xmm0,xmm6\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm6,xmm3\t\t; xmm6=(06 07 16 17 26 27 36 37)\n\tpunpckhwd xmm0,xmm3\t\t; xmm0=(46 47 56 57 66 67 76 77)\n\n\tmovdqa    xmm2,xmm5\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm5,xmm6\t\t; xmm5=(04 05 06 07 14 15 16 17)\n\tpunpckhdq xmm2,xmm6\t\t; xmm2=(24 25 26 27 34 35 36 37)\n\tmovdqa    xmm3,xmm7\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm7,xmm0\t\t; xmm7=(44 45 46 47 54 55 56 57)\n\tpunpckhdq xmm3,xmm0\t\t; xmm3=(64 65 66 67 74 75 76 77)\n\n\tmovdqa\txmm6, XMMWORD [wk(0)]\t; xmm6=(02 03 12 13 22 23 32 33)\n\tmovdqa\txmm0, XMMWORD [wk(1)]\t; xmm0=(42 43 52 53 62 63 72 73)\n\tmovdqa\tXMMWORD [wk(0)], xmm2\t; wk(0)=(24 25 26 27 34 35 36 37)\n\tmovdqa\tXMMWORD [wk(1)], xmm7\t; wk(1)=(44 45 46 47 54 55 56 57)\n\n\tmovdqa    xmm2,xmm1\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm1,xmm6\t\t; xmm1=(00 01 02 03 10 11 12 13)\n\tpunpckhdq xmm2,xmm6\t\t; xmm2=(20 21 22 23 30 31 32 33)\n\tmovdqa    xmm7,xmm4\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm4,xmm0\t\t; xmm4=(40 41 42 43 50 51 52 53)\n\tpunpckhdq xmm7,xmm0\t\t; xmm7=(60 61 62 63 70 71 72 73)\n\n\tmovdqa     xmm6,xmm1\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm1,xmm5\t\t; xmm1=(00 01 02 03 04 05 06 07)=data0\n\tpunpckhqdq xmm6,xmm5\t\t; xmm6=(10 11 12 13 14 15 16 17)=data1\n\tmovdqa     xmm0,xmm7\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm7,xmm3\t\t; xmm7=(60 61 62 63 64 65 66 67)=data6\n\tpunpckhqdq xmm0,xmm3\t\t; xmm0=(70 71 72 73 74 75 76 77)=data7\n\n\tmovdqa\txmm5,xmm6\n\tmovdqa\txmm3,xmm1\n\tpsubw\txmm6,xmm7\t\t; xmm6=data1-data6=tmp6\n\tpsubw\txmm1,xmm0\t\t; xmm1=data0-data7=tmp7\n\tpaddw\txmm5,xmm7\t\t; xmm5=data1+data6=tmp1\n\tpaddw\txmm3,xmm0\t\t; xmm3=data0+data7=tmp0\n\n\tmovdqa\txmm7, XMMWORD [wk(0)]\t; xmm7=(24 25 26 27 34 35 36 37)\n\tmovdqa\txmm0, XMMWORD [wk(1)]\t; xmm0=(44 45 46 47 54 55 56 57)\n\tmovdqa\tXMMWORD [wk(0)], xmm6\t; wk(0)=tmp6\n\tmovdqa\tXMMWORD [wk(1)], xmm1\t; wk(1)=tmp7\n\n\tmovdqa     xmm6,xmm2\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm2,xmm7\t\t; xmm2=(20 21 22 23 24 25 26 27)=data2\n\tpunpckhqdq xmm6,xmm7\t\t; xmm6=(30 31 32 33 34 35 36 37)=data3\n\tmovdqa     xmm1,xmm4\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm4,xmm0\t\t; xmm4=(40 41 42 43 44 45 46 47)=data4\n\tpunpckhqdq xmm1,xmm0\t\t; xmm1=(50 51 52 53 54 55 56 57)=data5\n\n\tmovdqa\txmm7,xmm6\n\tmovdqa\txmm0,xmm2\n\tpaddw\txmm6,xmm4\t\t; xmm6=data3+data4=tmp3\n\tpaddw\txmm2,xmm1\t\t; xmm2=data2+data5=tmp2\n\tpsubw\txmm7,xmm4\t\t; xmm7=data3-data4=tmp4\n\tpsubw\txmm0,xmm1\t\t; xmm0=data2-data5=tmp5\n\n\t; -- Even part\n\n\tmovdqa\txmm4,xmm3\n\tmovdqa\txmm1,xmm5\n\tpsubw\txmm3,xmm6\t\t; xmm3=tmp13\n\tpsubw\txmm5,xmm2\t\t; xmm5=tmp12\n\tpaddw\txmm4,xmm6\t\t; xmm4=tmp10\n\tpaddw\txmm1,xmm2\t\t; xmm1=tmp11\n\n\tpaddw\txmm5,xmm3\n\tpsllw\txmm5,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\txmm5,[rel PW_F0707] ; xmm5=z1\n\n\tmovdqa\txmm6,xmm4\n\tmovdqa\txmm2,xmm3\n\tpsubw\txmm4,xmm1\t\t; xmm4=data4\n\tpsubw\txmm3,xmm5\t\t; xmm3=data6\n\tpaddw\txmm6,xmm1\t\t; xmm6=data0\n\tpaddw\txmm2,xmm5\t\t; xmm2=data2\n\n\tmovdqa\tXMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_DCTELEM)], xmm4\n\tmovdqa\tXMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_DCTELEM)], xmm3\n\tmovdqa\tXMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_DCTELEM)], xmm6\n\tmovdqa\tXMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_DCTELEM)], xmm2\n\n\t; -- Odd part\n\n\tmovdqa\txmm1, XMMWORD [wk(0)]\t; xmm1=tmp6\n\tmovdqa\txmm5, XMMWORD [wk(1)]\t; xmm5=tmp7\n\n\tpaddw\txmm7,xmm0\t\t; xmm7=tmp10\n\tpaddw\txmm0,xmm1\t\t; xmm0=tmp11\n\tpaddw\txmm1,xmm5\t\t; xmm1=tmp12, xmm5=tmp7\n\n\tpsllw\txmm7,PRE_MULTIPLY_SCALE_BITS\n\tpsllw\txmm1,PRE_MULTIPLY_SCALE_BITS\n\n\tpsllw\txmm0,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\txmm0,[rel PW_F0707] ; xmm0=z3\n\n\tmovdqa\txmm4,xmm7\t\t; xmm4=tmp10\n\tpsubw\txmm7,xmm1\n\tpmulhw\txmm7,[rel PW_F0382] ; xmm7=z5\n\tpmulhw\txmm4,[rel PW_F0541] ; xmm4=MULTIPLY(tmp10,FIX_0_541196)\n\tpmulhw\txmm1,[rel PW_F1306] ; xmm1=MULTIPLY(tmp12,FIX_1_306562)\n\tpaddw\txmm4,xmm7\t\t; xmm4=z2\n\tpaddw\txmm1,xmm7\t\t; xmm1=z4\n\n\tmovdqa\txmm3,xmm5\n\tpsubw\txmm5,xmm0\t\t; xmm5=z13\n\tpaddw\txmm3,xmm0\t\t; xmm3=z11\n\n\tmovdqa\txmm6,xmm5\n\tmovdqa\txmm2,xmm3\n\tpsubw\txmm5,xmm4\t\t; xmm5=data3\n\tpsubw\txmm3,xmm1\t\t; xmm3=data7\n\tpaddw\txmm6,xmm4\t\t; xmm6=data5\n\tpaddw\txmm2,xmm1\t\t; xmm2=data1\n\n\tmovdqa\tXMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_DCTELEM)], xmm5\n\tmovdqa\tXMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_DCTELEM)], xmm3\n\tmovdqa\tXMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_DCTELEM)], xmm6\n\tmovdqa\tXMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_DCTELEM)], xmm2\n\n\tuncollect_args\n\tmov\trsp,rbp\t\t; rsp <- aligned rbp\n\tpop\trsp\t\t; rsp <- original rbp\n\tpop\trbp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jfss2fst.asm",
    "content": ";\n; jfss2fst.asm - fast integer FDCT (SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a fast, not so accurate integer implementation of\n; the forward DCT (Discrete Cosine Transform). The following code is\n; based directly on the IJG's original jfdctfst.c; see the jfdctfst.c\n; for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS\t8\t; 14 is also OK.\n\n%if CONST_BITS == 8\nF_0_382\tequ\t 98\t\t; FIX(0.382683433)\nF_0_541\tequ\t139\t\t; FIX(0.541196100)\nF_0_707\tequ\t181\t\t; FIX(0.707106781)\nF_1_306\tequ\t334\t\t; FIX(1.306562965)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_382\tequ\tDESCALE( 410903207,30-CONST_BITS)\t; FIX(0.382683433)\nF_0_541\tequ\tDESCALE( 581104887,30-CONST_BITS)\t; FIX(0.541196100)\nF_0_707\tequ\tDESCALE( 759250124,30-CONST_BITS)\t; FIX(0.707106781)\nF_1_306\tequ\tDESCALE(1402911301,30-CONST_BITS)\t; FIX(1.306562965)\n%endif\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n; PRE_MULTIPLY_SCALE_BITS <= 2 (to avoid overflow)\n; CONST_BITS + CONST_SHIFT + PRE_MULTIPLY_SCALE_BITS == 16 (for pmulhw)\n\n%define PRE_MULTIPLY_SCALE_BITS   2\n%define CONST_SHIFT     (16 - PRE_MULTIPLY_SCALE_BITS - CONST_BITS)\n\n\talignz\t16\n\tglobal\tEXTN(jconst_fdct_ifast_sse2)\n\nEXTN(jconst_fdct_ifast_sse2):\n\nPW_F0707\ttimes 8 dw  F_0_707 << CONST_SHIFT\nPW_F0382\ttimes 8 dw  F_0_382 << CONST_SHIFT\nPW_F0541\ttimes 8 dw  F_0_541 << CONST_SHIFT\nPW_F1306\ttimes 8 dw  F_1_306 << CONST_SHIFT\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Perform the forward DCT on one block of samples.\n;\n; GLOBAL(void)\n; jsimd_fdct_ifast_sse2 (DCTELEM * data)\n;\n\n%define data(b)\t\t(b)+8\t\t; DCTELEM * data\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t2\n\n\talign\t16\n\tglobal\tEXTN(jsimd_fdct_ifast_sse2)\n\nEXTN(jsimd_fdct_ifast_sse2):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [wk(0)]\n\tpushpic\tebx\n;\tpush\tecx\t\t; unused\n;\tpush\tedx\t\t; need not be preserved\n;\tpush\tesi\t\t; unused\n;\tpush\tedi\t\t; unused\n\n\tget_GOT\tebx\t\t; get GOT address\n\n\t; ---- Pass 1: process rows.\n\n\tmov\tedx, POINTER [data(eax)]\t; (DCTELEM *)\n\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm2, XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm3, XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_DCTELEM)]\n\n\t; xmm0=(00 01 02 03 04 05 06 07), xmm2=(20 21 22 23 24 25 26 27)\n\t; xmm1=(10 11 12 13 14 15 16 17), xmm3=(30 31 32 33 34 35 36 37)\n\n\tmovdqa    xmm4,xmm0\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm0,xmm1\t\t; xmm0=(00 10 01 11 02 12 03 13)\n\tpunpckhwd xmm4,xmm1\t\t; xmm4=(04 14 05 15 06 16 07 17)\n\tmovdqa    xmm5,xmm2\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm2,xmm3\t\t; xmm2=(20 30 21 31 22 32 23 33)\n\tpunpckhwd xmm5,xmm3\t\t; xmm5=(24 34 25 35 26 36 27 37)\n\n\tmovdqa\txmm6, XMMWORD [XMMBLOCK(4,0,edx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm7, XMMWORD [XMMBLOCK(5,0,edx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(6,0,edx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm3, XMMWORD [XMMBLOCK(7,0,edx,SIZEOF_DCTELEM)]\n\n\t; xmm6=( 4 12 20 28 36 44 52 60), xmm1=( 6 14 22 30 38 46 54 62)\n\t; xmm7=( 5 13 21 29 37 45 53 61), xmm3=( 7 15 23 31 39 47 55 63)\n\n\tmovdqa\tXMMWORD [wk(0)], xmm2\t; wk(0)=(20 30 21 31 22 32 23 33)\n\tmovdqa\tXMMWORD [wk(1)], xmm5\t; wk(1)=(24 34 25 35 26 36 27 37)\n\n\tmovdqa    xmm2,xmm6\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm6,xmm7\t\t; xmm6=(40 50 41 51 42 52 43 53)\n\tpunpckhwd xmm2,xmm7\t\t; xmm2=(44 54 45 55 46 56 47 57)\n\tmovdqa    xmm5,xmm1\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm1,xmm3\t\t; xmm1=(60 70 61 71 62 72 63 73)\n\tpunpckhwd xmm5,xmm3\t\t; xmm5=(64 74 65 75 66 76 67 77)\n\n\tmovdqa    xmm7,xmm6\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm6,xmm1\t\t; xmm6=(40 50 60 70 41 51 61 71)\n\tpunpckhdq xmm7,xmm1\t\t; xmm7=(42 52 62 72 43 53 63 73)\n\tmovdqa    xmm3,xmm2\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm2,xmm5\t\t; xmm2=(44 54 64 74 45 55 65 75)\n\tpunpckhdq xmm3,xmm5\t\t; xmm3=(46 56 66 76 47 57 67 77)\n\n\tmovdqa\txmm1, XMMWORD [wk(0)]\t; xmm1=(20 30 21 31 22 32 23 33)\n\tmovdqa\txmm5, XMMWORD [wk(1)]\t; xmm5=(24 34 25 35 26 36 27 37)\n\tmovdqa\tXMMWORD [wk(0)], xmm7\t; wk(0)=(42 52 62 72 43 53 63 73)\n\tmovdqa\tXMMWORD [wk(1)], xmm2\t; wk(1)=(44 54 64 74 45 55 65 75)\n\n\tmovdqa    xmm7,xmm0\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm0,xmm1\t\t; xmm0=(00 10 20 30 01 11 21 31)\n\tpunpckhdq xmm7,xmm1\t\t; xmm7=(02 12 22 32 03 13 23 33)\n\tmovdqa    xmm2,xmm4\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm4,xmm5\t\t; xmm4=(04 14 24 34 05 15 25 35)\n\tpunpckhdq xmm2,xmm5\t\t; xmm2=(06 16 26 36 07 17 27 37)\n\n\tmovdqa     xmm1,xmm0\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm0,xmm6\t\t; xmm0=(00 10 20 30 40 50 60 70)=data0\n\tpunpckhqdq xmm1,xmm6\t\t; xmm1=(01 11 21 31 41 51 61 71)=data1\n\tmovdqa     xmm5,xmm2\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm2,xmm3\t\t; xmm2=(06 16 26 36 46 56 66 76)=data6\n\tpunpckhqdq xmm5,xmm3\t\t; xmm5=(07 17 27 37 47 57 67 77)=data7\n\n\tmovdqa\txmm6,xmm1\n\tmovdqa\txmm3,xmm0\n\tpsubw\txmm1,xmm2\t\t; xmm1=data1-data6=tmp6\n\tpsubw\txmm0,xmm5\t\t; xmm0=data0-data7=tmp7\n\tpaddw\txmm6,xmm2\t\t; xmm6=data1+data6=tmp1\n\tpaddw\txmm3,xmm5\t\t; xmm3=data0+data7=tmp0\n\n\tmovdqa\txmm2, XMMWORD [wk(0)]\t; xmm2=(42 52 62 72 43 53 63 73)\n\tmovdqa\txmm5, XMMWORD [wk(1)]\t; xmm5=(44 54 64 74 45 55 65 75)\n\tmovdqa\tXMMWORD [wk(0)], xmm1\t; wk(0)=tmp6\n\tmovdqa\tXMMWORD [wk(1)], xmm0\t; wk(1)=tmp7\n\n\tmovdqa     xmm1,xmm7\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm7,xmm2\t\t; xmm7=(02 12 22 32 42 52 62 72)=data2\n\tpunpckhqdq xmm1,xmm2\t\t; xmm1=(03 13 23 33 43 53 63 73)=data3\n\tmovdqa     xmm0,xmm4\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm4,xmm5\t\t; xmm4=(04 14 24 34 44 54 64 74)=data4\n\tpunpckhqdq xmm0,xmm5\t\t; xmm0=(05 15 25 35 45 55 65 75)=data5\n\n\tmovdqa\txmm2,xmm1\n\tmovdqa\txmm5,xmm7\n\tpaddw\txmm1,xmm4\t\t; xmm1=data3+data4=tmp3\n\tpaddw\txmm7,xmm0\t\t; xmm7=data2+data5=tmp2\n\tpsubw\txmm2,xmm4\t\t; xmm2=data3-data4=tmp4\n\tpsubw\txmm5,xmm0\t\t; xmm5=data2-data5=tmp5\n\n\t; -- Even part\n\n\tmovdqa\txmm4,xmm3\n\tmovdqa\txmm0,xmm6\n\tpsubw\txmm3,xmm1\t\t; xmm3=tmp13\n\tpsubw\txmm6,xmm7\t\t; xmm6=tmp12\n\tpaddw\txmm4,xmm1\t\t; xmm4=tmp10\n\tpaddw\txmm0,xmm7\t\t; xmm0=tmp11\n\n\tpaddw\txmm6,xmm3\n\tpsllw\txmm6,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\txmm6,[GOTOFF(ebx,PW_F0707)] ; xmm6=z1\n\n\tmovdqa\txmm1,xmm4\n\tmovdqa\txmm7,xmm3\n\tpsubw\txmm4,xmm0\t\t; xmm4=data4\n\tpsubw\txmm3,xmm6\t\t; xmm3=data6\n\tpaddw\txmm1,xmm0\t\t; xmm1=data0\n\tpaddw\txmm7,xmm6\t\t; xmm7=data2\n\n\tmovdqa\txmm0, XMMWORD [wk(0)]\t; xmm0=tmp6\n\tmovdqa\txmm6, XMMWORD [wk(1)]\t; xmm6=tmp7\n\tmovdqa\tXMMWORD [wk(0)], xmm4\t; wk(0)=data4\n\tmovdqa\tXMMWORD [wk(1)], xmm3\t; wk(1)=data6\n\n\t; -- Odd part\n\n\tpaddw\txmm2,xmm5\t\t; xmm2=tmp10\n\tpaddw\txmm5,xmm0\t\t; xmm5=tmp11\n\tpaddw\txmm0,xmm6\t\t; xmm0=tmp12, xmm6=tmp7\n\n\tpsllw\txmm2,PRE_MULTIPLY_SCALE_BITS\n\tpsllw\txmm0,PRE_MULTIPLY_SCALE_BITS\n\n\tpsllw\txmm5,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\txmm5,[GOTOFF(ebx,PW_F0707)] ; xmm5=z3\n\n\tmovdqa\txmm4,xmm2\t\t; xmm4=tmp10\n\tpsubw\txmm2,xmm0\n\tpmulhw\txmm2,[GOTOFF(ebx,PW_F0382)] ; xmm2=z5\n\tpmulhw\txmm4,[GOTOFF(ebx,PW_F0541)] ; xmm4=MULTIPLY(tmp10,FIX_0_541196)\n\tpmulhw\txmm0,[GOTOFF(ebx,PW_F1306)] ; xmm0=MULTIPLY(tmp12,FIX_1_306562)\n\tpaddw\txmm4,xmm2\t\t; xmm4=z2\n\tpaddw\txmm0,xmm2\t\t; xmm0=z4\n\n\tmovdqa\txmm3,xmm6\n\tpsubw\txmm6,xmm5\t\t; xmm6=z13\n\tpaddw\txmm3,xmm5\t\t; xmm3=z11\n\n\tmovdqa\txmm2,xmm6\n\tmovdqa\txmm5,xmm3\n\tpsubw\txmm6,xmm4\t\t; xmm6=data3\n\tpsubw\txmm3,xmm0\t\t; xmm3=data7\n\tpaddw\txmm2,xmm4\t\t; xmm2=data5\n\tpaddw\txmm5,xmm0\t\t; xmm5=data1\n\n\t; ---- Pass 2: process columns.\n\n;\tmov\tedx, POINTER [data(eax)]\t; (DCTELEM *)\n\n\t; xmm1=(00 10 20 30 40 50 60 70), xmm7=(02 12 22 32 42 52 62 72)\n\t; xmm5=(01 11 21 31 41 51 61 71), xmm6=(03 13 23 33 43 53 63 73)\n\n\tmovdqa    xmm4,xmm1\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm1,xmm5\t\t; xmm1=(00 01 10 11 20 21 30 31)\n\tpunpckhwd xmm4,xmm5\t\t; xmm4=(40 41 50 51 60 61 70 71)\n\tmovdqa    xmm0,xmm7\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm7,xmm6\t\t; xmm7=(02 03 12 13 22 23 32 33)\n\tpunpckhwd xmm0,xmm6\t\t; xmm0=(42 43 52 53 62 63 72 73)\n\n\tmovdqa\txmm5, XMMWORD [wk(0)]\t; xmm5=col4\n\tmovdqa\txmm6, XMMWORD [wk(1)]\t; xmm6=col6\n\n\t; xmm5=(04 14 24 34 44 54 64 74), xmm6=(06 16 26 36 46 56 66 76)\n\t; xmm2=(05 15 25 35 45 55 65 75), xmm3=(07 17 27 37 47 57 67 77)\n\n\tmovdqa\tXMMWORD [wk(0)], xmm7\t; wk(0)=(02 03 12 13 22 23 32 33)\n\tmovdqa\tXMMWORD [wk(1)], xmm0\t; wk(1)=(42 43 52 53 62 63 72 73)\n\n\tmovdqa    xmm7,xmm5\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm5,xmm2\t\t; xmm5=(04 05 14 15 24 25 34 35)\n\tpunpckhwd xmm7,xmm2\t\t; xmm7=(44 45 54 55 64 65 74 75)\n\tmovdqa    xmm0,xmm6\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm6,xmm3\t\t; xmm6=(06 07 16 17 26 27 36 37)\n\tpunpckhwd xmm0,xmm3\t\t; xmm0=(46 47 56 57 66 67 76 77)\n\n\tmovdqa    xmm2,xmm5\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm5,xmm6\t\t; xmm5=(04 05 06 07 14 15 16 17)\n\tpunpckhdq xmm2,xmm6\t\t; xmm2=(24 25 26 27 34 35 36 37)\n\tmovdqa    xmm3,xmm7\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm7,xmm0\t\t; xmm7=(44 45 46 47 54 55 56 57)\n\tpunpckhdq xmm3,xmm0\t\t; xmm3=(64 65 66 67 74 75 76 77)\n\n\tmovdqa\txmm6, XMMWORD [wk(0)]\t; xmm6=(02 03 12 13 22 23 32 33)\n\tmovdqa\txmm0, XMMWORD [wk(1)]\t; xmm0=(42 43 52 53 62 63 72 73)\n\tmovdqa\tXMMWORD [wk(0)], xmm2\t; wk(0)=(24 25 26 27 34 35 36 37)\n\tmovdqa\tXMMWORD [wk(1)], xmm7\t; wk(1)=(44 45 46 47 54 55 56 57)\n\n\tmovdqa    xmm2,xmm1\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm1,xmm6\t\t; xmm1=(00 01 02 03 10 11 12 13)\n\tpunpckhdq xmm2,xmm6\t\t; xmm2=(20 21 22 23 30 31 32 33)\n\tmovdqa    xmm7,xmm4\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm4,xmm0\t\t; xmm4=(40 41 42 43 50 51 52 53)\n\tpunpckhdq xmm7,xmm0\t\t; xmm7=(60 61 62 63 70 71 72 73)\n\n\tmovdqa     xmm6,xmm1\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm1,xmm5\t\t; xmm1=(00 01 02 03 04 05 06 07)=data0\n\tpunpckhqdq xmm6,xmm5\t\t; xmm6=(10 11 12 13 14 15 16 17)=data1\n\tmovdqa     xmm0,xmm7\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm7,xmm3\t\t; xmm7=(60 61 62 63 64 65 66 67)=data6\n\tpunpckhqdq xmm0,xmm3\t\t; xmm0=(70 71 72 73 74 75 76 77)=data7\n\n\tmovdqa\txmm5,xmm6\n\tmovdqa\txmm3,xmm1\n\tpsubw\txmm6,xmm7\t\t; xmm6=data1-data6=tmp6\n\tpsubw\txmm1,xmm0\t\t; xmm1=data0-data7=tmp7\n\tpaddw\txmm5,xmm7\t\t; xmm5=data1+data6=tmp1\n\tpaddw\txmm3,xmm0\t\t; xmm3=data0+data7=tmp0\n\n\tmovdqa\txmm7, XMMWORD [wk(0)]\t; xmm7=(24 25 26 27 34 35 36 37)\n\tmovdqa\txmm0, XMMWORD [wk(1)]\t; xmm0=(44 45 46 47 54 55 56 57)\n\tmovdqa\tXMMWORD [wk(0)], xmm6\t; wk(0)=tmp6\n\tmovdqa\tXMMWORD [wk(1)], xmm1\t; wk(1)=tmp7\n\n\tmovdqa     xmm6,xmm2\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm2,xmm7\t\t; xmm2=(20 21 22 23 24 25 26 27)=data2\n\tpunpckhqdq xmm6,xmm7\t\t; xmm6=(30 31 32 33 34 35 36 37)=data3\n\tmovdqa     xmm1,xmm4\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm4,xmm0\t\t; xmm4=(40 41 42 43 44 45 46 47)=data4\n\tpunpckhqdq xmm1,xmm0\t\t; xmm1=(50 51 52 53 54 55 56 57)=data5\n\n\tmovdqa\txmm7,xmm6\n\tmovdqa\txmm0,xmm2\n\tpaddw\txmm6,xmm4\t\t; xmm6=data3+data4=tmp3\n\tpaddw\txmm2,xmm1\t\t; xmm2=data2+data5=tmp2\n\tpsubw\txmm7,xmm4\t\t; xmm7=data3-data4=tmp4\n\tpsubw\txmm0,xmm1\t\t; xmm0=data2-data5=tmp5\n\n\t; -- Even part\n\n\tmovdqa\txmm4,xmm3\n\tmovdqa\txmm1,xmm5\n\tpsubw\txmm3,xmm6\t\t; xmm3=tmp13\n\tpsubw\txmm5,xmm2\t\t; xmm5=tmp12\n\tpaddw\txmm4,xmm6\t\t; xmm4=tmp10\n\tpaddw\txmm1,xmm2\t\t; xmm1=tmp11\n\n\tpaddw\txmm5,xmm3\n\tpsllw\txmm5,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\txmm5,[GOTOFF(ebx,PW_F0707)] ; xmm5=z1\n\n\tmovdqa\txmm6,xmm4\n\tmovdqa\txmm2,xmm3\n\tpsubw\txmm4,xmm1\t\t; xmm4=data4\n\tpsubw\txmm3,xmm5\t\t; xmm3=data6\n\tpaddw\txmm6,xmm1\t\t; xmm6=data0\n\tpaddw\txmm2,xmm5\t\t; xmm2=data2\n\n\tmovdqa\tXMMWORD [XMMBLOCK(4,0,edx,SIZEOF_DCTELEM)], xmm4\n\tmovdqa\tXMMWORD [XMMBLOCK(6,0,edx,SIZEOF_DCTELEM)], xmm3\n\tmovdqa\tXMMWORD [XMMBLOCK(0,0,edx,SIZEOF_DCTELEM)], xmm6\n\tmovdqa\tXMMWORD [XMMBLOCK(2,0,edx,SIZEOF_DCTELEM)], xmm2\n\n\t; -- Odd part\n\n\tmovdqa\txmm1, XMMWORD [wk(0)]\t; xmm1=tmp6\n\tmovdqa\txmm5, XMMWORD [wk(1)]\t; xmm5=tmp7\n\n\tpaddw\txmm7,xmm0\t\t; xmm7=tmp10\n\tpaddw\txmm0,xmm1\t\t; xmm0=tmp11\n\tpaddw\txmm1,xmm5\t\t; xmm1=tmp12, xmm5=tmp7\n\n\tpsllw\txmm7,PRE_MULTIPLY_SCALE_BITS\n\tpsllw\txmm1,PRE_MULTIPLY_SCALE_BITS\n\n\tpsllw\txmm0,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\txmm0,[GOTOFF(ebx,PW_F0707)] ; xmm0=z3\n\n\tmovdqa\txmm4,xmm7\t\t; xmm4=tmp10\n\tpsubw\txmm7,xmm1\n\tpmulhw\txmm7,[GOTOFF(ebx,PW_F0382)] ; xmm7=z5\n\tpmulhw\txmm4,[GOTOFF(ebx,PW_F0541)] ; xmm4=MULTIPLY(tmp10,FIX_0_541196)\n\tpmulhw\txmm1,[GOTOFF(ebx,PW_F1306)] ; xmm1=MULTIPLY(tmp12,FIX_1_306562)\n\tpaddw\txmm4,xmm7\t\t; xmm4=z2\n\tpaddw\txmm1,xmm7\t\t; xmm1=z4\n\n\tmovdqa\txmm3,xmm5\n\tpsubw\txmm5,xmm0\t\t; xmm5=z13\n\tpaddw\txmm3,xmm0\t\t; xmm3=z11\n\n\tmovdqa\txmm6,xmm5\n\tmovdqa\txmm2,xmm3\n\tpsubw\txmm5,xmm4\t\t; xmm5=data3\n\tpsubw\txmm3,xmm1\t\t; xmm3=data7\n\tpaddw\txmm6,xmm4\t\t; xmm6=data5\n\tpaddw\txmm2,xmm1\t\t; xmm2=data1\n\n\tmovdqa\tXMMWORD [XMMBLOCK(3,0,edx,SIZEOF_DCTELEM)], xmm5\n\tmovdqa\tXMMWORD [XMMBLOCK(7,0,edx,SIZEOF_DCTELEM)], xmm3\n\tmovdqa\tXMMWORD [XMMBLOCK(5,0,edx,SIZEOF_DCTELEM)], xmm6\n\tmovdqa\tXMMWORD [XMMBLOCK(1,0,edx,SIZEOF_DCTELEM)], xmm2\n\n;\tpop\tedi\t\t; unused\n;\tpop\tesi\t\t; unused\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; unused\n\tpoppic\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jfss2int-64.asm",
    "content": ";\n; jfss2int-64.asm - accurate integer FDCT (64-bit SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2009 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a slow-but-accurate integer implementation of the\n; forward DCT (Discrete Cosine Transform). The following code is based\n; directly on the IJG's original jfdctint.c; see the jfdctint.c for\n; more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS\t13\n%define PASS1_BITS\t2\n\n%define DESCALE_P1\t(CONST_BITS-PASS1_BITS)\n%define DESCALE_P2\t(CONST_BITS+PASS1_BITS)\n\n%if CONST_BITS == 13\nF_0_298\tequ\t 2446\t\t; FIX(0.298631336)\nF_0_390\tequ\t 3196\t\t; FIX(0.390180644)\nF_0_541\tequ\t 4433\t\t; FIX(0.541196100)\nF_0_765\tequ\t 6270\t\t; FIX(0.765366865)\nF_0_899\tequ\t 7373\t\t; FIX(0.899976223)\nF_1_175\tequ\t 9633\t\t; FIX(1.175875602)\nF_1_501\tequ\t12299\t\t; FIX(1.501321110)\nF_1_847\tequ\t15137\t\t; FIX(1.847759065)\nF_1_961\tequ\t16069\t\t; FIX(1.961570560)\nF_2_053\tequ\t16819\t\t; FIX(2.053119869)\nF_2_562\tequ\t20995\t\t; FIX(2.562915447)\nF_3_072\tequ\t25172\t\t; FIX(3.072711026)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_298\tequ\tDESCALE( 320652955,30-CONST_BITS)\t; FIX(0.298631336)\nF_0_390\tequ\tDESCALE( 418953276,30-CONST_BITS)\t; FIX(0.390180644)\nF_0_541\tequ\tDESCALE( 581104887,30-CONST_BITS)\t; FIX(0.541196100)\nF_0_765\tequ\tDESCALE( 821806413,30-CONST_BITS)\t; FIX(0.765366865)\nF_0_899\tequ\tDESCALE( 966342111,30-CONST_BITS)\t; FIX(0.899976223)\nF_1_175\tequ\tDESCALE(1262586813,30-CONST_BITS)\t; FIX(1.175875602)\nF_1_501\tequ\tDESCALE(1612031267,30-CONST_BITS)\t; FIX(1.501321110)\nF_1_847\tequ\tDESCALE(1984016188,30-CONST_BITS)\t; FIX(1.847759065)\nF_1_961\tequ\tDESCALE(2106220350,30-CONST_BITS)\t; FIX(1.961570560)\nF_2_053\tequ\tDESCALE(2204520673,30-CONST_BITS)\t; FIX(2.053119869)\nF_2_562\tequ\tDESCALE(2751909506,30-CONST_BITS)\t; FIX(2.562915447)\nF_3_072\tequ\tDESCALE(3299298341,30-CONST_BITS)\t; FIX(3.072711026)\n%endif\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_fdct_islow_sse2)\n\nEXTN(jconst_fdct_islow_sse2):\n\nPW_F130_F054\ttimes 4 dw  (F_0_541+F_0_765), F_0_541\nPW_F054_MF130\ttimes 4 dw  F_0_541, (F_0_541-F_1_847)\nPW_MF078_F117\ttimes 4 dw  (F_1_175-F_1_961), F_1_175\nPW_F117_F078\ttimes 4 dw  F_1_175, (F_1_175-F_0_390)\nPW_MF060_MF089\ttimes 4 dw  (F_0_298-F_0_899),-F_0_899\nPW_MF089_F060\ttimes 4 dw -F_0_899, (F_1_501-F_0_899)\nPW_MF050_MF256\ttimes 4 dw  (F_2_053-F_2_562),-F_2_562\nPW_MF256_F050\ttimes 4 dw -F_2_562, (F_3_072-F_2_562)\nPD_DESCALE_P1\ttimes 4 dd  1 << (DESCALE_P1-1)\nPD_DESCALE_P2\ttimes 4 dd  1 << (DESCALE_P2-1)\nPW_DESCALE_P2X\ttimes 8 dw  1 << (PASS1_BITS-1)\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t64\n;\n; Perform the forward DCT on one block of samples.\n;\n; GLOBAL(void)\n; jsimd_fdct_islow_sse2 (DCTELEM * data)\n;\n\n; r10 = DCTELEM * data\n\n%define wk(i)\t\trbp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t6\n\n\talign\t16\n\tglobal\tEXTN(jsimd_fdct_islow_sse2)\n\nEXTN(jsimd_fdct_islow_sse2):\n\tpush\trbp\n\tmov\trax,rsp\t\t\t\t; rax = original rbp\n\tsub\trsp, byte 4\n\tand\trsp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[rsp],rax\n\tmov\trbp,rsp\t\t\t\t; rbp = aligned rbp\n\tlea\trsp, [wk(0)]\n\tcollect_args\n\n\t; ---- Pass 1: process rows.\n\n\tmov\trdx, r10\t; (DCTELEM *)\n\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm2, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm3, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_DCTELEM)]\n\n\t; xmm0=(00 01 02 03 04 05 06 07), xmm2=(20 21 22 23 24 25 26 27)\n\t; xmm1=(10 11 12 13 14 15 16 17), xmm3=(30 31 32 33 34 35 36 37)\n\n\tmovdqa    xmm4,xmm0\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm0,xmm1\t\t; xmm0=(00 10 01 11 02 12 03 13)\n\tpunpckhwd xmm4,xmm1\t\t; xmm4=(04 14 05 15 06 16 07 17)\n\tmovdqa    xmm5,xmm2\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm2,xmm3\t\t; xmm2=(20 30 21 31 22 32 23 33)\n\tpunpckhwd xmm5,xmm3\t\t; xmm5=(24 34 25 35 26 36 27 37)\n\n\tmovdqa\txmm6, XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm7, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm3, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_DCTELEM)]\n\n\t; xmm6=( 4 12 20 28 36 44 52 60), xmm1=( 6 14 22 30 38 46 54 62)\n\t; xmm7=( 5 13 21 29 37 45 53 61), xmm3=( 7 15 23 31 39 47 55 63)\n\n\tmovdqa\tXMMWORD [wk(0)], xmm2\t; wk(0)=(20 30 21 31 22 32 23 33)\n\tmovdqa\tXMMWORD [wk(1)], xmm5\t; wk(1)=(24 34 25 35 26 36 27 37)\n\n\tmovdqa    xmm2,xmm6\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm6,xmm7\t\t; xmm6=(40 50 41 51 42 52 43 53)\n\tpunpckhwd xmm2,xmm7\t\t; xmm2=(44 54 45 55 46 56 47 57)\n\tmovdqa    xmm5,xmm1\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm1,xmm3\t\t; xmm1=(60 70 61 71 62 72 63 73)\n\tpunpckhwd xmm5,xmm3\t\t; xmm5=(64 74 65 75 66 76 67 77)\n\n\tmovdqa    xmm7,xmm6\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm6,xmm1\t\t; xmm6=(40 50 60 70 41 51 61 71)\n\tpunpckhdq xmm7,xmm1\t\t; xmm7=(42 52 62 72 43 53 63 73)\n\tmovdqa    xmm3,xmm2\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm2,xmm5\t\t; xmm2=(44 54 64 74 45 55 65 75)\n\tpunpckhdq xmm3,xmm5\t\t; xmm3=(46 56 66 76 47 57 67 77)\n\n\tmovdqa\txmm1, XMMWORD [wk(0)]\t; xmm1=(20 30 21 31 22 32 23 33)\n\tmovdqa\txmm5, XMMWORD [wk(1)]\t; xmm5=(24 34 25 35 26 36 27 37)\n\tmovdqa\tXMMWORD [wk(2)], xmm7\t; wk(2)=(42 52 62 72 43 53 63 73)\n\tmovdqa\tXMMWORD [wk(3)], xmm2\t; wk(3)=(44 54 64 74 45 55 65 75)\n\n\tmovdqa    xmm7,xmm0\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm0,xmm1\t\t; xmm0=(00 10 20 30 01 11 21 31)\n\tpunpckhdq xmm7,xmm1\t\t; xmm7=(02 12 22 32 03 13 23 33)\n\tmovdqa    xmm2,xmm4\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm4,xmm5\t\t; xmm4=(04 14 24 34 05 15 25 35)\n\tpunpckhdq xmm2,xmm5\t\t; xmm2=(06 16 26 36 07 17 27 37)\n\n\tmovdqa     xmm1,xmm0\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm0,xmm6\t\t; xmm0=(00 10 20 30 40 50 60 70)=data0\n\tpunpckhqdq xmm1,xmm6\t\t; xmm1=(01 11 21 31 41 51 61 71)=data1\n\tmovdqa     xmm5,xmm2\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm2,xmm3\t\t; xmm2=(06 16 26 36 46 56 66 76)=data6\n\tpunpckhqdq xmm5,xmm3\t\t; xmm5=(07 17 27 37 47 57 67 77)=data7\n\n\tmovdqa\txmm6,xmm1\n\tmovdqa\txmm3,xmm0\n\tpsubw\txmm1,xmm2\t\t; xmm1=data1-data6=tmp6\n\tpsubw\txmm0,xmm5\t\t; xmm0=data0-data7=tmp7\n\tpaddw\txmm6,xmm2\t\t; xmm6=data1+data6=tmp1\n\tpaddw\txmm3,xmm5\t\t; xmm3=data0+data7=tmp0\n\n\tmovdqa\txmm2, XMMWORD [wk(2)]\t; xmm2=(42 52 62 72 43 53 63 73)\n\tmovdqa\txmm5, XMMWORD [wk(3)]\t; xmm5=(44 54 64 74 45 55 65 75)\n\tmovdqa\tXMMWORD [wk(0)], xmm1\t; wk(0)=tmp6\n\tmovdqa\tXMMWORD [wk(1)], xmm0\t; wk(1)=tmp7\n\n\tmovdqa     xmm1,xmm7\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm7,xmm2\t\t; xmm7=(02 12 22 32 42 52 62 72)=data2\n\tpunpckhqdq xmm1,xmm2\t\t; xmm1=(03 13 23 33 43 53 63 73)=data3\n\tmovdqa     xmm0,xmm4\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm4,xmm5\t\t; xmm4=(04 14 24 34 44 54 64 74)=data4\n\tpunpckhqdq xmm0,xmm5\t\t; xmm0=(05 15 25 35 45 55 65 75)=data5\n\n\tmovdqa\txmm2,xmm1\n\tmovdqa\txmm5,xmm7\n\tpaddw\txmm1,xmm4\t\t; xmm1=data3+data4=tmp3\n\tpaddw\txmm7,xmm0\t\t; xmm7=data2+data5=tmp2\n\tpsubw\txmm2,xmm4\t\t; xmm2=data3-data4=tmp4\n\tpsubw\txmm5,xmm0\t\t; xmm5=data2-data5=tmp5\n\n\t; -- Even part\n\n\tmovdqa\txmm4,xmm3\n\tmovdqa\txmm0,xmm6\n\tpaddw\txmm3,xmm1\t\t; xmm3=tmp10\n\tpaddw\txmm6,xmm7\t\t; xmm6=tmp11\n\tpsubw\txmm4,xmm1\t\t; xmm4=tmp13\n\tpsubw\txmm0,xmm7\t\t; xmm0=tmp12\n\n\tmovdqa\txmm1,xmm3\n\tpaddw\txmm3,xmm6\t\t; xmm3=tmp10+tmp11\n\tpsubw\txmm1,xmm6\t\t; xmm1=tmp10-tmp11\n\n\tpsllw\txmm3,PASS1_BITS\t\t; xmm3=data0\n\tpsllw\txmm1,PASS1_BITS\t\t; xmm1=data4\n\n\tmovdqa\tXMMWORD [wk(2)], xmm3\t; wk(2)=data0\n\tmovdqa\tXMMWORD [wk(3)], xmm1\t; wk(3)=data4\n\n\t; (Original)\n\t; z1 = (tmp12 + tmp13) * 0.541196100;\n\t; data2 = z1 + tmp13 * 0.765366865;\n\t; data6 = z1 + tmp12 * -1.847759065;\n\t;\n\t; (This implementation)\n\t; data2 = tmp13 * (0.541196100 + 0.765366865) + tmp12 * 0.541196100;\n\t; data6 = tmp13 * 0.541196100 + tmp12 * (0.541196100 - 1.847759065);\n\n\tmovdqa    xmm7,xmm4\t\t; xmm4=tmp13\n\tmovdqa    xmm6,xmm4\n\tpunpcklwd xmm7,xmm0\t\t; xmm0=tmp12\n\tpunpckhwd xmm6,xmm0\n\tmovdqa    xmm4,xmm7\n\tmovdqa    xmm0,xmm6\n\tpmaddwd   xmm7,[rel PW_F130_F054]\t; xmm7=data2L\n\tpmaddwd   xmm6,[rel PW_F130_F054]\t; xmm6=data2H\n\tpmaddwd   xmm4,[rel PW_F054_MF130]\t; xmm4=data6L\n\tpmaddwd   xmm0,[rel PW_F054_MF130]\t; xmm0=data6H\n\n\tpaddd\txmm7,[rel PD_DESCALE_P1]\n\tpaddd\txmm6,[rel PD_DESCALE_P1]\n\tpsrad\txmm7,DESCALE_P1\n\tpsrad\txmm6,DESCALE_P1\n\tpaddd\txmm4,[rel PD_DESCALE_P1]\n\tpaddd\txmm0,[rel PD_DESCALE_P1]\n\tpsrad\txmm4,DESCALE_P1\n\tpsrad\txmm0,DESCALE_P1\n\n\tpackssdw  xmm7,xmm6\t\t; xmm7=data2\n\tpackssdw  xmm4,xmm0\t\t; xmm4=data6\n\n\tmovdqa\tXMMWORD [wk(4)], xmm7\t; wk(4)=data2\n\tmovdqa\tXMMWORD [wk(5)], xmm4\t; wk(5)=data6\n\n\t; -- Odd part\n\n\tmovdqa\txmm3, XMMWORD [wk(0)]\t; xmm3=tmp6\n\tmovdqa\txmm1, XMMWORD [wk(1)]\t; xmm1=tmp7\n\n\tmovdqa\txmm6,xmm2\t\t; xmm2=tmp4\n\tmovdqa\txmm0,xmm5\t\t; xmm5=tmp5\n\tpaddw\txmm6,xmm3\t\t; xmm6=z3\n\tpaddw\txmm0,xmm1\t\t; xmm0=z4\n\n\t; (Original)\n\t; z5 = (z3 + z4) * 1.175875602;\n\t; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n\t; z3 += z5;  z4 += z5;\n\t;\n\t; (This implementation)\n\t; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n\t; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n\tmovdqa    xmm7,xmm6\n\tmovdqa    xmm4,xmm6\n\tpunpcklwd xmm7,xmm0\n\tpunpckhwd xmm4,xmm0\n\tmovdqa    xmm6,xmm7\n\tmovdqa    xmm0,xmm4\n\tpmaddwd   xmm7,[rel PW_MF078_F117]\t; xmm7=z3L\n\tpmaddwd   xmm4,[rel PW_MF078_F117]\t; xmm4=z3H\n\tpmaddwd   xmm6,[rel PW_F117_F078]\t; xmm6=z4L\n\tpmaddwd   xmm0,[rel PW_F117_F078]\t; xmm0=z4H\n\n\tmovdqa\tXMMWORD [wk(0)], xmm7\t; wk(0)=z3L\n\tmovdqa\tXMMWORD [wk(1)], xmm4\t; wk(1)=z3H\n\n\t; (Original)\n\t; z1 = tmp4 + tmp7;  z2 = tmp5 + tmp6;\n\t; tmp4 = tmp4 * 0.298631336;  tmp5 = tmp5 * 2.053119869;\n\t; tmp6 = tmp6 * 3.072711026;  tmp7 = tmp7 * 1.501321110;\n\t; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n\t; data7 = tmp4 + z1 + z3;  data5 = tmp5 + z2 + z4;\n\t; data3 = tmp6 + z2 + z3;  data1 = tmp7 + z1 + z4;\n\t;\n\t; (This implementation)\n\t; tmp4 = tmp4 * (0.298631336 - 0.899976223) + tmp7 * -0.899976223;\n\t; tmp5 = tmp5 * (2.053119869 - 2.562915447) + tmp6 * -2.562915447;\n\t; tmp6 = tmp5 * -2.562915447 + tmp6 * (3.072711026 - 2.562915447);\n\t; tmp7 = tmp4 * -0.899976223 + tmp7 * (1.501321110 - 0.899976223);\n\t; data7 = tmp4 + z3;  data5 = tmp5 + z4;\n\t; data3 = tmp6 + z3;  data1 = tmp7 + z4;\n\n\tmovdqa    xmm7,xmm2\n\tmovdqa    xmm4,xmm2\n\tpunpcklwd xmm7,xmm1\n\tpunpckhwd xmm4,xmm1\n\tmovdqa    xmm2,xmm7\n\tmovdqa    xmm1,xmm4\n\tpmaddwd   xmm7,[rel PW_MF060_MF089]\t; xmm7=tmp4L\n\tpmaddwd   xmm4,[rel PW_MF060_MF089]\t; xmm4=tmp4H\n\tpmaddwd   xmm2,[rel PW_MF089_F060]\t; xmm2=tmp7L\n\tpmaddwd   xmm1,[rel PW_MF089_F060]\t; xmm1=tmp7H\n\n\tpaddd\txmm7, XMMWORD [wk(0)]\t; xmm7=data7L\n\tpaddd\txmm4, XMMWORD [wk(1)]\t; xmm4=data7H\n\tpaddd\txmm2,xmm6\t\t; xmm2=data1L\n\tpaddd\txmm1,xmm0\t\t; xmm1=data1H\n\n\tpaddd\txmm7,[rel PD_DESCALE_P1]\n\tpaddd\txmm4,[rel PD_DESCALE_P1]\n\tpsrad\txmm7,DESCALE_P1\n\tpsrad\txmm4,DESCALE_P1\n\tpaddd\txmm2,[rel PD_DESCALE_P1]\n\tpaddd\txmm1,[rel PD_DESCALE_P1]\n\tpsrad\txmm2,DESCALE_P1\n\tpsrad\txmm1,DESCALE_P1\n\n\tpackssdw  xmm7,xmm4\t\t; xmm7=data7\n\tpackssdw  xmm2,xmm1\t\t; xmm2=data1\n\n\tmovdqa    xmm4,xmm5\n\tmovdqa    xmm1,xmm5\n\tpunpcklwd xmm4,xmm3\n\tpunpckhwd xmm1,xmm3\n\tmovdqa    xmm5,xmm4\n\tmovdqa    xmm3,xmm1\n\tpmaddwd   xmm4,[rel PW_MF050_MF256]\t; xmm4=tmp5L\n\tpmaddwd   xmm1,[rel PW_MF050_MF256]\t; xmm1=tmp5H\n\tpmaddwd   xmm5,[rel PW_MF256_F050]\t; xmm5=tmp6L\n\tpmaddwd   xmm3,[rel PW_MF256_F050]\t; xmm3=tmp6H\n\n\tpaddd\txmm4,xmm6\t\t; xmm4=data5L\n\tpaddd\txmm1,xmm0\t\t; xmm1=data5H\n\tpaddd\txmm5, XMMWORD [wk(0)]\t; xmm5=data3L\n\tpaddd\txmm3, XMMWORD [wk(1)]\t; xmm3=data3H\n\n\tpaddd\txmm4,[rel PD_DESCALE_P1]\n\tpaddd\txmm1,[rel PD_DESCALE_P1]\n\tpsrad\txmm4,DESCALE_P1\n\tpsrad\txmm1,DESCALE_P1\n\tpaddd\txmm5,[rel PD_DESCALE_P1]\n\tpaddd\txmm3,[rel PD_DESCALE_P1]\n\tpsrad\txmm5,DESCALE_P1\n\tpsrad\txmm3,DESCALE_P1\n\n\tpackssdw  xmm4,xmm1\t\t; xmm4=data5\n\tpackssdw  xmm5,xmm3\t\t; xmm5=data3\n\n\t; ---- Pass 2: process columns.\n\n\tmovdqa\txmm6, XMMWORD [wk(2)]\t; xmm6=col0\n\tmovdqa\txmm0, XMMWORD [wk(4)]\t; xmm0=col2\n\n\t; xmm6=(00 10 20 30 40 50 60 70), xmm0=(02 12 22 32 42 52 62 72)\n\t; xmm2=(01 11 21 31 41 51 61 71), xmm5=(03 13 23 33 43 53 63 73)\n\n\tmovdqa    xmm1,xmm6\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm6,xmm2\t\t; xmm6=(00 01 10 11 20 21 30 31)\n\tpunpckhwd xmm1,xmm2\t\t; xmm1=(40 41 50 51 60 61 70 71)\n\tmovdqa    xmm3,xmm0\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm0,xmm5\t\t; xmm0=(02 03 12 13 22 23 32 33)\n\tpunpckhwd xmm3,xmm5\t\t; xmm3=(42 43 52 53 62 63 72 73)\n\n\tmovdqa\txmm2, XMMWORD [wk(3)]\t; xmm2=col4\n\tmovdqa\txmm5, XMMWORD [wk(5)]\t; xmm5=col6\n\n\t; xmm2=(04 14 24 34 44 54 64 74), xmm5=(06 16 26 36 46 56 66 76)\n\t; xmm4=(05 15 25 35 45 55 65 75), xmm7=(07 17 27 37 47 57 67 77)\n\n\tmovdqa\tXMMWORD [wk(0)], xmm0\t; wk(0)=(02 03 12 13 22 23 32 33)\n\tmovdqa\tXMMWORD [wk(1)], xmm3\t; wk(1)=(42 43 52 53 62 63 72 73)\n\n\tmovdqa    xmm0,xmm2\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm2,xmm4\t\t; xmm2=(04 05 14 15 24 25 34 35)\n\tpunpckhwd xmm0,xmm4\t\t; xmm0=(44 45 54 55 64 65 74 75)\n\tmovdqa    xmm3,xmm5\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm5,xmm7\t\t; xmm5=(06 07 16 17 26 27 36 37)\n\tpunpckhwd xmm3,xmm7\t\t; xmm3=(46 47 56 57 66 67 76 77)\n\n\tmovdqa    xmm4,xmm2\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm2,xmm5\t\t; xmm2=(04 05 06 07 14 15 16 17)\n\tpunpckhdq xmm4,xmm5\t\t; xmm4=(24 25 26 27 34 35 36 37)\n\tmovdqa    xmm7,xmm0\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm0,xmm3\t\t; xmm0=(44 45 46 47 54 55 56 57)\n\tpunpckhdq xmm7,xmm3\t\t; xmm7=(64 65 66 67 74 75 76 77)\n\n\tmovdqa\txmm5, XMMWORD [wk(0)]\t; xmm5=(02 03 12 13 22 23 32 33)\n\tmovdqa\txmm3, XMMWORD [wk(1)]\t; xmm3=(42 43 52 53 62 63 72 73)\n\tmovdqa\tXMMWORD [wk(2)], xmm4\t; wk(2)=(24 25 26 27 34 35 36 37)\n\tmovdqa\tXMMWORD [wk(3)], xmm0\t; wk(3)=(44 45 46 47 54 55 56 57)\n\n\tmovdqa    xmm4,xmm6\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm6,xmm5\t\t; xmm6=(00 01 02 03 10 11 12 13)\n\tpunpckhdq xmm4,xmm5\t\t; xmm4=(20 21 22 23 30 31 32 33)\n\tmovdqa    xmm0,xmm1\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm1,xmm3\t\t; xmm1=(40 41 42 43 50 51 52 53)\n\tpunpckhdq xmm0,xmm3\t\t; xmm0=(60 61 62 63 70 71 72 73)\n\n\tmovdqa     xmm5,xmm6\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm6,xmm2\t\t; xmm6=(00 01 02 03 04 05 06 07)=data0\n\tpunpckhqdq xmm5,xmm2\t\t; xmm5=(10 11 12 13 14 15 16 17)=data1\n\tmovdqa     xmm3,xmm0\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm0,xmm7\t\t; xmm0=(60 61 62 63 64 65 66 67)=data6\n\tpunpckhqdq xmm3,xmm7\t\t; xmm3=(70 71 72 73 74 75 76 77)=data7\n\n\tmovdqa\txmm2,xmm5\n\tmovdqa\txmm7,xmm6\n\tpsubw\txmm5,xmm0\t\t; xmm5=data1-data6=tmp6\n\tpsubw\txmm6,xmm3\t\t; xmm6=data0-data7=tmp7\n\tpaddw\txmm2,xmm0\t\t; xmm2=data1+data6=tmp1\n\tpaddw\txmm7,xmm3\t\t; xmm7=data0+data7=tmp0\n\n\tmovdqa\txmm0, XMMWORD [wk(2)]\t; xmm0=(24 25 26 27 34 35 36 37)\n\tmovdqa\txmm3, XMMWORD [wk(3)]\t; xmm3=(44 45 46 47 54 55 56 57)\n\tmovdqa\tXMMWORD [wk(0)], xmm5\t; wk(0)=tmp6\n\tmovdqa\tXMMWORD [wk(1)], xmm6\t; wk(1)=tmp7\n\n\tmovdqa     xmm5,xmm4\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm4,xmm0\t\t; xmm4=(20 21 22 23 24 25 26 27)=data2\n\tpunpckhqdq xmm5,xmm0\t\t; xmm5=(30 31 32 33 34 35 36 37)=data3\n\tmovdqa     xmm6,xmm1\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm1,xmm3\t\t; xmm1=(40 41 42 43 44 45 46 47)=data4\n\tpunpckhqdq xmm6,xmm3\t\t; xmm6=(50 51 52 53 54 55 56 57)=data5\n\n\tmovdqa\txmm0,xmm5\n\tmovdqa\txmm3,xmm4\n\tpaddw\txmm5,xmm1\t\t; xmm5=data3+data4=tmp3\n\tpaddw\txmm4,xmm6\t\t; xmm4=data2+data5=tmp2\n\tpsubw\txmm0,xmm1\t\t; xmm0=data3-data4=tmp4\n\tpsubw\txmm3,xmm6\t\t; xmm3=data2-data5=tmp5\n\n\t; -- Even part\n\n\tmovdqa\txmm1,xmm7\n\tmovdqa\txmm6,xmm2\n\tpaddw\txmm7,xmm5\t\t; xmm7=tmp10\n\tpaddw\txmm2,xmm4\t\t; xmm2=tmp11\n\tpsubw\txmm1,xmm5\t\t; xmm1=tmp13\n\tpsubw\txmm6,xmm4\t\t; xmm6=tmp12\n\n\tmovdqa\txmm5,xmm7\n\tpaddw\txmm7,xmm2\t\t; xmm7=tmp10+tmp11\n\tpsubw\txmm5,xmm2\t\t; xmm5=tmp10-tmp11\n\n\tpaddw\txmm7,[rel PW_DESCALE_P2X]\n\tpaddw\txmm5,[rel PW_DESCALE_P2X]\n\tpsraw\txmm7,PASS1_BITS\t\t; xmm7=data0\n\tpsraw\txmm5,PASS1_BITS\t\t; xmm5=data4\n\n\tmovdqa\tXMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_DCTELEM)], xmm7\n\tmovdqa\tXMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_DCTELEM)], xmm5\n\n\t; (Original)\n\t; z1 = (tmp12 + tmp13) * 0.541196100;\n\t; data2 = z1 + tmp13 * 0.765366865;\n\t; data6 = z1 + tmp12 * -1.847759065;\n\t;\n\t; (This implementation)\n\t; data2 = tmp13 * (0.541196100 + 0.765366865) + tmp12 * 0.541196100;\n\t; data6 = tmp13 * 0.541196100 + tmp12 * (0.541196100 - 1.847759065);\n\n\tmovdqa    xmm4,xmm1\t\t; xmm1=tmp13\n\tmovdqa    xmm2,xmm1\n\tpunpcklwd xmm4,xmm6\t\t; xmm6=tmp12\n\tpunpckhwd xmm2,xmm6\n\tmovdqa    xmm1,xmm4\n\tmovdqa    xmm6,xmm2\n\tpmaddwd   xmm4,[rel PW_F130_F054]\t; xmm4=data2L\n\tpmaddwd   xmm2,[rel PW_F130_F054]\t; xmm2=data2H\n\tpmaddwd   xmm1,[rel PW_F054_MF130]\t; xmm1=data6L\n\tpmaddwd   xmm6,[rel PW_F054_MF130]\t; xmm6=data6H\n\n\tpaddd\txmm4,[rel PD_DESCALE_P2]\n\tpaddd\txmm2,[rel PD_DESCALE_P2]\n\tpsrad\txmm4,DESCALE_P2\n\tpsrad\txmm2,DESCALE_P2\n\tpaddd\txmm1,[rel PD_DESCALE_P2]\n\tpaddd\txmm6,[rel PD_DESCALE_P2]\n\tpsrad\txmm1,DESCALE_P2\n\tpsrad\txmm6,DESCALE_P2\n\n\tpackssdw  xmm4,xmm2\t\t; xmm4=data2\n\tpackssdw  xmm1,xmm6\t\t; xmm1=data6\n\n\tmovdqa\tXMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_DCTELEM)], xmm4\n\tmovdqa\tXMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_DCTELEM)], xmm1\n\n\t; -- Odd part\n\n\tmovdqa\txmm7, XMMWORD [wk(0)]\t; xmm7=tmp6\n\tmovdqa\txmm5, XMMWORD [wk(1)]\t; xmm5=tmp7\n\n\tmovdqa\txmm2,xmm0\t\t; xmm0=tmp4\n\tmovdqa\txmm6,xmm3\t\t; xmm3=tmp5\n\tpaddw\txmm2,xmm7\t\t; xmm2=z3\n\tpaddw\txmm6,xmm5\t\t; xmm6=z4\n\n\t; (Original)\n\t; z5 = (z3 + z4) * 1.175875602;\n\t; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n\t; z3 += z5;  z4 += z5;\n\t;\n\t; (This implementation)\n\t; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n\t; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n\tmovdqa    xmm4,xmm2\n\tmovdqa    xmm1,xmm2\n\tpunpcklwd xmm4,xmm6\n\tpunpckhwd xmm1,xmm6\n\tmovdqa    xmm2,xmm4\n\tmovdqa    xmm6,xmm1\n\tpmaddwd   xmm4,[rel PW_MF078_F117]\t; xmm4=z3L\n\tpmaddwd   xmm1,[rel PW_MF078_F117]\t; xmm1=z3H\n\tpmaddwd   xmm2,[rel PW_F117_F078]\t; xmm2=z4L\n\tpmaddwd   xmm6,[rel PW_F117_F078]\t; xmm6=z4H\n\n\tmovdqa\tXMMWORD [wk(0)], xmm4\t; wk(0)=z3L\n\tmovdqa\tXMMWORD [wk(1)], xmm1\t; wk(1)=z3H\n\n\t; (Original)\n\t; z1 = tmp4 + tmp7;  z2 = tmp5 + tmp6;\n\t; tmp4 = tmp4 * 0.298631336;  tmp5 = tmp5 * 2.053119869;\n\t; tmp6 = tmp6 * 3.072711026;  tmp7 = tmp7 * 1.501321110;\n\t; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n\t; data7 = tmp4 + z1 + z3;  data5 = tmp5 + z2 + z4;\n\t; data3 = tmp6 + z2 + z3;  data1 = tmp7 + z1 + z4;\n\t;\n\t; (This implementation)\n\t; tmp4 = tmp4 * (0.298631336 - 0.899976223) + tmp7 * -0.899976223;\n\t; tmp5 = tmp5 * (2.053119869 - 2.562915447) + tmp6 * -2.562915447;\n\t; tmp6 = tmp5 * -2.562915447 + tmp6 * (3.072711026 - 2.562915447);\n\t; tmp7 = tmp4 * -0.899976223 + tmp7 * (1.501321110 - 0.899976223);\n\t; data7 = tmp4 + z3;  data5 = tmp5 + z4;\n\t; data3 = tmp6 + z3;  data1 = tmp7 + z4;\n\n\tmovdqa    xmm4,xmm0\n\tmovdqa    xmm1,xmm0\n\tpunpcklwd xmm4,xmm5\n\tpunpckhwd xmm1,xmm5\n\tmovdqa    xmm0,xmm4\n\tmovdqa    xmm5,xmm1\n\tpmaddwd   xmm4,[rel PW_MF060_MF089]\t; xmm4=tmp4L\n\tpmaddwd   xmm1,[rel PW_MF060_MF089]\t; xmm1=tmp4H\n\tpmaddwd   xmm0,[rel PW_MF089_F060]\t; xmm0=tmp7L\n\tpmaddwd   xmm5,[rel PW_MF089_F060]\t; xmm5=tmp7H\n\n\tpaddd\txmm4, XMMWORD [wk(0)]\t; xmm4=data7L\n\tpaddd\txmm1, XMMWORD [wk(1)]\t; xmm1=data7H\n\tpaddd\txmm0,xmm2\t\t; xmm0=data1L\n\tpaddd\txmm5,xmm6\t\t; xmm5=data1H\n\n\tpaddd\txmm4,[rel PD_DESCALE_P2]\n\tpaddd\txmm1,[rel PD_DESCALE_P2]\n\tpsrad\txmm4,DESCALE_P2\n\tpsrad\txmm1,DESCALE_P2\n\tpaddd\txmm0,[rel PD_DESCALE_P2]\n\tpaddd\txmm5,[rel PD_DESCALE_P2]\n\tpsrad\txmm0,DESCALE_P2\n\tpsrad\txmm5,DESCALE_P2\n\n\tpackssdw  xmm4,xmm1\t\t; xmm4=data7\n\tpackssdw  xmm0,xmm5\t\t; xmm0=data1\n\n\tmovdqa\tXMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_DCTELEM)], xmm4\n\tmovdqa\tXMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_DCTELEM)], xmm0\n\n\tmovdqa    xmm1,xmm3\n\tmovdqa    xmm5,xmm3\n\tpunpcklwd xmm1,xmm7\n\tpunpckhwd xmm5,xmm7\n\tmovdqa    xmm3,xmm1\n\tmovdqa    xmm7,xmm5\n\tpmaddwd   xmm1,[rel PW_MF050_MF256]\t; xmm1=tmp5L\n\tpmaddwd   xmm5,[rel PW_MF050_MF256]\t; xmm5=tmp5H\n\tpmaddwd   xmm3,[rel PW_MF256_F050]\t; xmm3=tmp6L\n\tpmaddwd   xmm7,[rel PW_MF256_F050]\t; xmm7=tmp6H\n\n\tpaddd\txmm1,xmm2\t\t; xmm1=data5L\n\tpaddd\txmm5,xmm6\t\t; xmm5=data5H\n\tpaddd\txmm3, XMMWORD [wk(0)]\t; xmm3=data3L\n\tpaddd\txmm7, XMMWORD [wk(1)]\t; xmm7=data3H\n\n\tpaddd\txmm1,[rel PD_DESCALE_P2]\n\tpaddd\txmm5,[rel PD_DESCALE_P2]\n\tpsrad\txmm1,DESCALE_P2\n\tpsrad\txmm5,DESCALE_P2\n\tpaddd\txmm3,[rel PD_DESCALE_P2]\n\tpaddd\txmm7,[rel PD_DESCALE_P2]\n\tpsrad\txmm3,DESCALE_P2\n\tpsrad\txmm7,DESCALE_P2\n\n\tpackssdw  xmm1,xmm5\t\t; xmm1=data5\n\tpackssdw  xmm3,xmm7\t\t; xmm3=data3\n\n\tmovdqa\tXMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_DCTELEM)], xmm1\n\tmovdqa\tXMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_DCTELEM)], xmm3\n\n\tuncollect_args\n\tmov\trsp,rbp\t\t; rsp <- aligned rbp\n\tpop\trsp\t\t; rsp <- original rbp\n\tpop\trbp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jfss2int.asm",
    "content": ";\n; jfss2int.asm - accurate integer FDCT (SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a slow-but-accurate integer implementation of the\n; forward DCT (Discrete Cosine Transform). The following code is based\n; directly on the IJG's original jfdctint.c; see the jfdctint.c for\n; more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS\t13\n%define PASS1_BITS\t2\n\n%define DESCALE_P1\t(CONST_BITS-PASS1_BITS)\n%define DESCALE_P2\t(CONST_BITS+PASS1_BITS)\n\n%if CONST_BITS == 13\nF_0_298\tequ\t 2446\t\t; FIX(0.298631336)\nF_0_390\tequ\t 3196\t\t; FIX(0.390180644)\nF_0_541\tequ\t 4433\t\t; FIX(0.541196100)\nF_0_765\tequ\t 6270\t\t; FIX(0.765366865)\nF_0_899\tequ\t 7373\t\t; FIX(0.899976223)\nF_1_175\tequ\t 9633\t\t; FIX(1.175875602)\nF_1_501\tequ\t12299\t\t; FIX(1.501321110)\nF_1_847\tequ\t15137\t\t; FIX(1.847759065)\nF_1_961\tequ\t16069\t\t; FIX(1.961570560)\nF_2_053\tequ\t16819\t\t; FIX(2.053119869)\nF_2_562\tequ\t20995\t\t; FIX(2.562915447)\nF_3_072\tequ\t25172\t\t; FIX(3.072711026)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_298\tequ\tDESCALE( 320652955,30-CONST_BITS)\t; FIX(0.298631336)\nF_0_390\tequ\tDESCALE( 418953276,30-CONST_BITS)\t; FIX(0.390180644)\nF_0_541\tequ\tDESCALE( 581104887,30-CONST_BITS)\t; FIX(0.541196100)\nF_0_765\tequ\tDESCALE( 821806413,30-CONST_BITS)\t; FIX(0.765366865)\nF_0_899\tequ\tDESCALE( 966342111,30-CONST_BITS)\t; FIX(0.899976223)\nF_1_175\tequ\tDESCALE(1262586813,30-CONST_BITS)\t; FIX(1.175875602)\nF_1_501\tequ\tDESCALE(1612031267,30-CONST_BITS)\t; FIX(1.501321110)\nF_1_847\tequ\tDESCALE(1984016188,30-CONST_BITS)\t; FIX(1.847759065)\nF_1_961\tequ\tDESCALE(2106220350,30-CONST_BITS)\t; FIX(1.961570560)\nF_2_053\tequ\tDESCALE(2204520673,30-CONST_BITS)\t; FIX(2.053119869)\nF_2_562\tequ\tDESCALE(2751909506,30-CONST_BITS)\t; FIX(2.562915447)\nF_3_072\tequ\tDESCALE(3299298341,30-CONST_BITS)\t; FIX(3.072711026)\n%endif\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_fdct_islow_sse2)\n\nEXTN(jconst_fdct_islow_sse2):\n\nPW_F130_F054\ttimes 4 dw  (F_0_541+F_0_765), F_0_541\nPW_F054_MF130\ttimes 4 dw  F_0_541, (F_0_541-F_1_847)\nPW_MF078_F117\ttimes 4 dw  (F_1_175-F_1_961), F_1_175\nPW_F117_F078\ttimes 4 dw  F_1_175, (F_1_175-F_0_390)\nPW_MF060_MF089\ttimes 4 dw  (F_0_298-F_0_899),-F_0_899\nPW_MF089_F060\ttimes 4 dw -F_0_899, (F_1_501-F_0_899)\nPW_MF050_MF256\ttimes 4 dw  (F_2_053-F_2_562),-F_2_562\nPW_MF256_F050\ttimes 4 dw -F_2_562, (F_3_072-F_2_562)\nPD_DESCALE_P1\ttimes 4 dd  1 << (DESCALE_P1-1)\nPD_DESCALE_P2\ttimes 4 dd  1 << (DESCALE_P2-1)\nPW_DESCALE_P2X\ttimes 8 dw  1 << (PASS1_BITS-1)\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Perform the forward DCT on one block of samples.\n;\n; GLOBAL(void)\n; jsimd_fdct_islow_sse2 (DCTELEM * data)\n;\n\n%define data(b)\t\t(b)+8\t\t; DCTELEM * data\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t6\n\n\talign\t16\n\tglobal\tEXTN(jsimd_fdct_islow_sse2)\n\nEXTN(jsimd_fdct_islow_sse2):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [wk(0)]\n\tpushpic\tebx\n;\tpush\tecx\t\t; unused\n;\tpush\tedx\t\t; need not be preserved\n;\tpush\tesi\t\t; unused\n;\tpush\tedi\t\t; unused\n\n\tget_GOT\tebx\t\t; get GOT address\n\n\t; ---- Pass 1: process rows.\n\n\tmov\tedx, POINTER [data(eax)]\t; (DCTELEM *)\n\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm2, XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm3, XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_DCTELEM)]\n\n\t; xmm0=(00 01 02 03 04 05 06 07), xmm2=(20 21 22 23 24 25 26 27)\n\t; xmm1=(10 11 12 13 14 15 16 17), xmm3=(30 31 32 33 34 35 36 37)\n\n\tmovdqa    xmm4,xmm0\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm0,xmm1\t\t; xmm0=(00 10 01 11 02 12 03 13)\n\tpunpckhwd xmm4,xmm1\t\t; xmm4=(04 14 05 15 06 16 07 17)\n\tmovdqa    xmm5,xmm2\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm2,xmm3\t\t; xmm2=(20 30 21 31 22 32 23 33)\n\tpunpckhwd xmm5,xmm3\t\t; xmm5=(24 34 25 35 26 36 27 37)\n\n\tmovdqa\txmm6, XMMWORD [XMMBLOCK(4,0,edx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm7, XMMWORD [XMMBLOCK(5,0,edx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(6,0,edx,SIZEOF_DCTELEM)]\n\tmovdqa\txmm3, XMMWORD [XMMBLOCK(7,0,edx,SIZEOF_DCTELEM)]\n\n\t; xmm6=( 4 12 20 28 36 44 52 60), xmm1=( 6 14 22 30 38 46 54 62)\n\t; xmm7=( 5 13 21 29 37 45 53 61), xmm3=( 7 15 23 31 39 47 55 63)\n\n\tmovdqa\tXMMWORD [wk(0)], xmm2\t; wk(0)=(20 30 21 31 22 32 23 33)\n\tmovdqa\tXMMWORD [wk(1)], xmm5\t; wk(1)=(24 34 25 35 26 36 27 37)\n\n\tmovdqa    xmm2,xmm6\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm6,xmm7\t\t; xmm6=(40 50 41 51 42 52 43 53)\n\tpunpckhwd xmm2,xmm7\t\t; xmm2=(44 54 45 55 46 56 47 57)\n\tmovdqa    xmm5,xmm1\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm1,xmm3\t\t; xmm1=(60 70 61 71 62 72 63 73)\n\tpunpckhwd xmm5,xmm3\t\t; xmm5=(64 74 65 75 66 76 67 77)\n\n\tmovdqa    xmm7,xmm6\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm6,xmm1\t\t; xmm6=(40 50 60 70 41 51 61 71)\n\tpunpckhdq xmm7,xmm1\t\t; xmm7=(42 52 62 72 43 53 63 73)\n\tmovdqa    xmm3,xmm2\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm2,xmm5\t\t; xmm2=(44 54 64 74 45 55 65 75)\n\tpunpckhdq xmm3,xmm5\t\t; xmm3=(46 56 66 76 47 57 67 77)\n\n\tmovdqa\txmm1, XMMWORD [wk(0)]\t; xmm1=(20 30 21 31 22 32 23 33)\n\tmovdqa\txmm5, XMMWORD [wk(1)]\t; xmm5=(24 34 25 35 26 36 27 37)\n\tmovdqa\tXMMWORD [wk(2)], xmm7\t; wk(2)=(42 52 62 72 43 53 63 73)\n\tmovdqa\tXMMWORD [wk(3)], xmm2\t; wk(3)=(44 54 64 74 45 55 65 75)\n\n\tmovdqa    xmm7,xmm0\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm0,xmm1\t\t; xmm0=(00 10 20 30 01 11 21 31)\n\tpunpckhdq xmm7,xmm1\t\t; xmm7=(02 12 22 32 03 13 23 33)\n\tmovdqa    xmm2,xmm4\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm4,xmm5\t\t; xmm4=(04 14 24 34 05 15 25 35)\n\tpunpckhdq xmm2,xmm5\t\t; xmm2=(06 16 26 36 07 17 27 37)\n\n\tmovdqa     xmm1,xmm0\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm0,xmm6\t\t; xmm0=(00 10 20 30 40 50 60 70)=data0\n\tpunpckhqdq xmm1,xmm6\t\t; xmm1=(01 11 21 31 41 51 61 71)=data1\n\tmovdqa     xmm5,xmm2\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm2,xmm3\t\t; xmm2=(06 16 26 36 46 56 66 76)=data6\n\tpunpckhqdq xmm5,xmm3\t\t; xmm5=(07 17 27 37 47 57 67 77)=data7\n\n\tmovdqa\txmm6,xmm1\n\tmovdqa\txmm3,xmm0\n\tpsubw\txmm1,xmm2\t\t; xmm1=data1-data6=tmp6\n\tpsubw\txmm0,xmm5\t\t; xmm0=data0-data7=tmp7\n\tpaddw\txmm6,xmm2\t\t; xmm6=data1+data6=tmp1\n\tpaddw\txmm3,xmm5\t\t; xmm3=data0+data7=tmp0\n\n\tmovdqa\txmm2, XMMWORD [wk(2)]\t; xmm2=(42 52 62 72 43 53 63 73)\n\tmovdqa\txmm5, XMMWORD [wk(3)]\t; xmm5=(44 54 64 74 45 55 65 75)\n\tmovdqa\tXMMWORD [wk(0)], xmm1\t; wk(0)=tmp6\n\tmovdqa\tXMMWORD [wk(1)], xmm0\t; wk(1)=tmp7\n\n\tmovdqa     xmm1,xmm7\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm7,xmm2\t\t; xmm7=(02 12 22 32 42 52 62 72)=data2\n\tpunpckhqdq xmm1,xmm2\t\t; xmm1=(03 13 23 33 43 53 63 73)=data3\n\tmovdqa     xmm0,xmm4\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm4,xmm5\t\t; xmm4=(04 14 24 34 44 54 64 74)=data4\n\tpunpckhqdq xmm0,xmm5\t\t; xmm0=(05 15 25 35 45 55 65 75)=data5\n\n\tmovdqa\txmm2,xmm1\n\tmovdqa\txmm5,xmm7\n\tpaddw\txmm1,xmm4\t\t; xmm1=data3+data4=tmp3\n\tpaddw\txmm7,xmm0\t\t; xmm7=data2+data5=tmp2\n\tpsubw\txmm2,xmm4\t\t; xmm2=data3-data4=tmp4\n\tpsubw\txmm5,xmm0\t\t; xmm5=data2-data5=tmp5\n\n\t; -- Even part\n\n\tmovdqa\txmm4,xmm3\n\tmovdqa\txmm0,xmm6\n\tpaddw\txmm3,xmm1\t\t; xmm3=tmp10\n\tpaddw\txmm6,xmm7\t\t; xmm6=tmp11\n\tpsubw\txmm4,xmm1\t\t; xmm4=tmp13\n\tpsubw\txmm0,xmm7\t\t; xmm0=tmp12\n\n\tmovdqa\txmm1,xmm3\n\tpaddw\txmm3,xmm6\t\t; xmm3=tmp10+tmp11\n\tpsubw\txmm1,xmm6\t\t; xmm1=tmp10-tmp11\n\n\tpsllw\txmm3,PASS1_BITS\t\t; xmm3=data0\n\tpsllw\txmm1,PASS1_BITS\t\t; xmm1=data4\n\n\tmovdqa\tXMMWORD [wk(2)], xmm3\t; wk(2)=data0\n\tmovdqa\tXMMWORD [wk(3)], xmm1\t; wk(3)=data4\n\n\t; (Original)\n\t; z1 = (tmp12 + tmp13) * 0.541196100;\n\t; data2 = z1 + tmp13 * 0.765366865;\n\t; data6 = z1 + tmp12 * -1.847759065;\n\t;\n\t; (This implementation)\n\t; data2 = tmp13 * (0.541196100 + 0.765366865) + tmp12 * 0.541196100;\n\t; data6 = tmp13 * 0.541196100 + tmp12 * (0.541196100 - 1.847759065);\n\n\tmovdqa    xmm7,xmm4\t\t; xmm4=tmp13\n\tmovdqa    xmm6,xmm4\n\tpunpcklwd xmm7,xmm0\t\t; xmm0=tmp12\n\tpunpckhwd xmm6,xmm0\n\tmovdqa    xmm4,xmm7\n\tmovdqa    xmm0,xmm6\n\tpmaddwd   xmm7,[GOTOFF(ebx,PW_F130_F054)]\t; xmm7=data2L\n\tpmaddwd   xmm6,[GOTOFF(ebx,PW_F130_F054)]\t; xmm6=data2H\n\tpmaddwd   xmm4,[GOTOFF(ebx,PW_F054_MF130)]\t; xmm4=data6L\n\tpmaddwd   xmm0,[GOTOFF(ebx,PW_F054_MF130)]\t; xmm0=data6H\n\n\tpaddd\txmm7,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpaddd\txmm6,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpsrad\txmm7,DESCALE_P1\n\tpsrad\txmm6,DESCALE_P1\n\tpaddd\txmm4,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpaddd\txmm0,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpsrad\txmm4,DESCALE_P1\n\tpsrad\txmm0,DESCALE_P1\n\n\tpackssdw  xmm7,xmm6\t\t; xmm7=data2\n\tpackssdw  xmm4,xmm0\t\t; xmm4=data6\n\n\tmovdqa\tXMMWORD [wk(4)], xmm7\t; wk(4)=data2\n\tmovdqa\tXMMWORD [wk(5)], xmm4\t; wk(5)=data6\n\n\t; -- Odd part\n\n\tmovdqa\txmm3, XMMWORD [wk(0)]\t; xmm3=tmp6\n\tmovdqa\txmm1, XMMWORD [wk(1)]\t; xmm1=tmp7\n\n\tmovdqa\txmm6,xmm2\t\t; xmm2=tmp4\n\tmovdqa\txmm0,xmm5\t\t; xmm5=tmp5\n\tpaddw\txmm6,xmm3\t\t; xmm6=z3\n\tpaddw\txmm0,xmm1\t\t; xmm0=z4\n\n\t; (Original)\n\t; z5 = (z3 + z4) * 1.175875602;\n\t; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n\t; z3 += z5;  z4 += z5;\n\t;\n\t; (This implementation)\n\t; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n\t; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n\tmovdqa    xmm7,xmm6\n\tmovdqa    xmm4,xmm6\n\tpunpcklwd xmm7,xmm0\n\tpunpckhwd xmm4,xmm0\n\tmovdqa    xmm6,xmm7\n\tmovdqa    xmm0,xmm4\n\tpmaddwd   xmm7,[GOTOFF(ebx,PW_MF078_F117)]\t; xmm7=z3L\n\tpmaddwd   xmm4,[GOTOFF(ebx,PW_MF078_F117)]\t; xmm4=z3H\n\tpmaddwd   xmm6,[GOTOFF(ebx,PW_F117_F078)]\t; xmm6=z4L\n\tpmaddwd   xmm0,[GOTOFF(ebx,PW_F117_F078)]\t; xmm0=z4H\n\n\tmovdqa\tXMMWORD [wk(0)], xmm7\t; wk(0)=z3L\n\tmovdqa\tXMMWORD [wk(1)], xmm4\t; wk(1)=z3H\n\n\t; (Original)\n\t; z1 = tmp4 + tmp7;  z2 = tmp5 + tmp6;\n\t; tmp4 = tmp4 * 0.298631336;  tmp5 = tmp5 * 2.053119869;\n\t; tmp6 = tmp6 * 3.072711026;  tmp7 = tmp7 * 1.501321110;\n\t; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n\t; data7 = tmp4 + z1 + z3;  data5 = tmp5 + z2 + z4;\n\t; data3 = tmp6 + z2 + z3;  data1 = tmp7 + z1 + z4;\n\t;\n\t; (This implementation)\n\t; tmp4 = tmp4 * (0.298631336 - 0.899976223) + tmp7 * -0.899976223;\n\t; tmp5 = tmp5 * (2.053119869 - 2.562915447) + tmp6 * -2.562915447;\n\t; tmp6 = tmp5 * -2.562915447 + tmp6 * (3.072711026 - 2.562915447);\n\t; tmp7 = tmp4 * -0.899976223 + tmp7 * (1.501321110 - 0.899976223);\n\t; data7 = tmp4 + z3;  data5 = tmp5 + z4;\n\t; data3 = tmp6 + z3;  data1 = tmp7 + z4;\n\n\tmovdqa    xmm7,xmm2\n\tmovdqa    xmm4,xmm2\n\tpunpcklwd xmm7,xmm1\n\tpunpckhwd xmm4,xmm1\n\tmovdqa    xmm2,xmm7\n\tmovdqa    xmm1,xmm4\n\tpmaddwd   xmm7,[GOTOFF(ebx,PW_MF060_MF089)]\t; xmm7=tmp4L\n\tpmaddwd   xmm4,[GOTOFF(ebx,PW_MF060_MF089)]\t; xmm4=tmp4H\n\tpmaddwd   xmm2,[GOTOFF(ebx,PW_MF089_F060)]\t; xmm2=tmp7L\n\tpmaddwd   xmm1,[GOTOFF(ebx,PW_MF089_F060)]\t; xmm1=tmp7H\n\n\tpaddd\txmm7, XMMWORD [wk(0)]\t; xmm7=data7L\n\tpaddd\txmm4, XMMWORD [wk(1)]\t; xmm4=data7H\n\tpaddd\txmm2,xmm6\t\t; xmm2=data1L\n\tpaddd\txmm1,xmm0\t\t; xmm1=data1H\n\n\tpaddd\txmm7,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpaddd\txmm4,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpsrad\txmm7,DESCALE_P1\n\tpsrad\txmm4,DESCALE_P1\n\tpaddd\txmm2,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpaddd\txmm1,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpsrad\txmm2,DESCALE_P1\n\tpsrad\txmm1,DESCALE_P1\n\n\tpackssdw  xmm7,xmm4\t\t; xmm7=data7\n\tpackssdw  xmm2,xmm1\t\t; xmm2=data1\n\n\tmovdqa    xmm4,xmm5\n\tmovdqa    xmm1,xmm5\n\tpunpcklwd xmm4,xmm3\n\tpunpckhwd xmm1,xmm3\n\tmovdqa    xmm5,xmm4\n\tmovdqa    xmm3,xmm1\n\tpmaddwd   xmm4,[GOTOFF(ebx,PW_MF050_MF256)]\t; xmm4=tmp5L\n\tpmaddwd   xmm1,[GOTOFF(ebx,PW_MF050_MF256)]\t; xmm1=tmp5H\n\tpmaddwd   xmm5,[GOTOFF(ebx,PW_MF256_F050)]\t; xmm5=tmp6L\n\tpmaddwd   xmm3,[GOTOFF(ebx,PW_MF256_F050)]\t; xmm3=tmp6H\n\n\tpaddd\txmm4,xmm6\t\t; xmm4=data5L\n\tpaddd\txmm1,xmm0\t\t; xmm1=data5H\n\tpaddd\txmm5, XMMWORD [wk(0)]\t; xmm5=data3L\n\tpaddd\txmm3, XMMWORD [wk(1)]\t; xmm3=data3H\n\n\tpaddd\txmm4,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpaddd\txmm1,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpsrad\txmm4,DESCALE_P1\n\tpsrad\txmm1,DESCALE_P1\n\tpaddd\txmm5,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpaddd\txmm3,[GOTOFF(ebx,PD_DESCALE_P1)]\n\tpsrad\txmm5,DESCALE_P1\n\tpsrad\txmm3,DESCALE_P1\n\n\tpackssdw  xmm4,xmm1\t\t; xmm4=data5\n\tpackssdw  xmm5,xmm3\t\t; xmm5=data3\n\n\t; ---- Pass 2: process columns.\n\n;\tmov\tedx, POINTER [data(eax)]\t; (DCTELEM *)\n\n\tmovdqa\txmm6, XMMWORD [wk(2)]\t; xmm6=col0\n\tmovdqa\txmm0, XMMWORD [wk(4)]\t; xmm0=col2\n\n\t; xmm6=(00 10 20 30 40 50 60 70), xmm0=(02 12 22 32 42 52 62 72)\n\t; xmm2=(01 11 21 31 41 51 61 71), xmm5=(03 13 23 33 43 53 63 73)\n\n\tmovdqa    xmm1,xmm6\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm6,xmm2\t\t; xmm6=(00 01 10 11 20 21 30 31)\n\tpunpckhwd xmm1,xmm2\t\t; xmm1=(40 41 50 51 60 61 70 71)\n\tmovdqa    xmm3,xmm0\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm0,xmm5\t\t; xmm0=(02 03 12 13 22 23 32 33)\n\tpunpckhwd xmm3,xmm5\t\t; xmm3=(42 43 52 53 62 63 72 73)\n\n\tmovdqa\txmm2, XMMWORD [wk(3)]\t; xmm2=col4\n\tmovdqa\txmm5, XMMWORD [wk(5)]\t; xmm5=col6\n\n\t; xmm2=(04 14 24 34 44 54 64 74), xmm5=(06 16 26 36 46 56 66 76)\n\t; xmm4=(05 15 25 35 45 55 65 75), xmm7=(07 17 27 37 47 57 67 77)\n\n\tmovdqa\tXMMWORD [wk(0)], xmm0\t; wk(0)=(02 03 12 13 22 23 32 33)\n\tmovdqa\tXMMWORD [wk(1)], xmm3\t; wk(1)=(42 43 52 53 62 63 72 73)\n\n\tmovdqa    xmm0,xmm2\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm2,xmm4\t\t; xmm2=(04 05 14 15 24 25 34 35)\n\tpunpckhwd xmm0,xmm4\t\t; xmm0=(44 45 54 55 64 65 74 75)\n\tmovdqa    xmm3,xmm5\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm5,xmm7\t\t; xmm5=(06 07 16 17 26 27 36 37)\n\tpunpckhwd xmm3,xmm7\t\t; xmm3=(46 47 56 57 66 67 76 77)\n\n\tmovdqa    xmm4,xmm2\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm2,xmm5\t\t; xmm2=(04 05 06 07 14 15 16 17)\n\tpunpckhdq xmm4,xmm5\t\t; xmm4=(24 25 26 27 34 35 36 37)\n\tmovdqa    xmm7,xmm0\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm0,xmm3\t\t; xmm0=(44 45 46 47 54 55 56 57)\n\tpunpckhdq xmm7,xmm3\t\t; xmm7=(64 65 66 67 74 75 76 77)\n\n\tmovdqa\txmm5, XMMWORD [wk(0)]\t; xmm5=(02 03 12 13 22 23 32 33)\n\tmovdqa\txmm3, XMMWORD [wk(1)]\t; xmm3=(42 43 52 53 62 63 72 73)\n\tmovdqa\tXMMWORD [wk(2)], xmm4\t; wk(2)=(24 25 26 27 34 35 36 37)\n\tmovdqa\tXMMWORD [wk(3)], xmm0\t; wk(3)=(44 45 46 47 54 55 56 57)\n\n\tmovdqa    xmm4,xmm6\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm6,xmm5\t\t; xmm6=(00 01 02 03 10 11 12 13)\n\tpunpckhdq xmm4,xmm5\t\t; xmm4=(20 21 22 23 30 31 32 33)\n\tmovdqa    xmm0,xmm1\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm1,xmm3\t\t; xmm1=(40 41 42 43 50 51 52 53)\n\tpunpckhdq xmm0,xmm3\t\t; xmm0=(60 61 62 63 70 71 72 73)\n\n\tmovdqa     xmm5,xmm6\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm6,xmm2\t\t; xmm6=(00 01 02 03 04 05 06 07)=data0\n\tpunpckhqdq xmm5,xmm2\t\t; xmm5=(10 11 12 13 14 15 16 17)=data1\n\tmovdqa     xmm3,xmm0\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm0,xmm7\t\t; xmm0=(60 61 62 63 64 65 66 67)=data6\n\tpunpckhqdq xmm3,xmm7\t\t; xmm3=(70 71 72 73 74 75 76 77)=data7\n\n\tmovdqa\txmm2,xmm5\n\tmovdqa\txmm7,xmm6\n\tpsubw\txmm5,xmm0\t\t; xmm5=data1-data6=tmp6\n\tpsubw\txmm6,xmm3\t\t; xmm6=data0-data7=tmp7\n\tpaddw\txmm2,xmm0\t\t; xmm2=data1+data6=tmp1\n\tpaddw\txmm7,xmm3\t\t; xmm7=data0+data7=tmp0\n\n\tmovdqa\txmm0, XMMWORD [wk(2)]\t; xmm0=(24 25 26 27 34 35 36 37)\n\tmovdqa\txmm3, XMMWORD [wk(3)]\t; xmm3=(44 45 46 47 54 55 56 57)\n\tmovdqa\tXMMWORD [wk(0)], xmm5\t; wk(0)=tmp6\n\tmovdqa\tXMMWORD [wk(1)], xmm6\t; wk(1)=tmp7\n\n\tmovdqa     xmm5,xmm4\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm4,xmm0\t\t; xmm4=(20 21 22 23 24 25 26 27)=data2\n\tpunpckhqdq xmm5,xmm0\t\t; xmm5=(30 31 32 33 34 35 36 37)=data3\n\tmovdqa     xmm6,xmm1\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm1,xmm3\t\t; xmm1=(40 41 42 43 44 45 46 47)=data4\n\tpunpckhqdq xmm6,xmm3\t\t; xmm6=(50 51 52 53 54 55 56 57)=data5\n\n\tmovdqa\txmm0,xmm5\n\tmovdqa\txmm3,xmm4\n\tpaddw\txmm5,xmm1\t\t; xmm5=data3+data4=tmp3\n\tpaddw\txmm4,xmm6\t\t; xmm4=data2+data5=tmp2\n\tpsubw\txmm0,xmm1\t\t; xmm0=data3-data4=tmp4\n\tpsubw\txmm3,xmm6\t\t; xmm3=data2-data5=tmp5\n\n\t; -- Even part\n\n\tmovdqa\txmm1,xmm7\n\tmovdqa\txmm6,xmm2\n\tpaddw\txmm7,xmm5\t\t; xmm7=tmp10\n\tpaddw\txmm2,xmm4\t\t; xmm2=tmp11\n\tpsubw\txmm1,xmm5\t\t; xmm1=tmp13\n\tpsubw\txmm6,xmm4\t\t; xmm6=tmp12\n\n\tmovdqa\txmm5,xmm7\n\tpaddw\txmm7,xmm2\t\t; xmm7=tmp10+tmp11\n\tpsubw\txmm5,xmm2\t\t; xmm5=tmp10-tmp11\n\n\tpaddw\txmm7,[GOTOFF(ebx,PW_DESCALE_P2X)]\n\tpaddw\txmm5,[GOTOFF(ebx,PW_DESCALE_P2X)]\n\tpsraw\txmm7,PASS1_BITS\t\t; xmm7=data0\n\tpsraw\txmm5,PASS1_BITS\t\t; xmm5=data4\n\n\tmovdqa\tXMMWORD [XMMBLOCK(0,0,edx,SIZEOF_DCTELEM)], xmm7\n\tmovdqa\tXMMWORD [XMMBLOCK(4,0,edx,SIZEOF_DCTELEM)], xmm5\n\n\t; (Original)\n\t; z1 = (tmp12 + tmp13) * 0.541196100;\n\t; data2 = z1 + tmp13 * 0.765366865;\n\t; data6 = z1 + tmp12 * -1.847759065;\n\t;\n\t; (This implementation)\n\t; data2 = tmp13 * (0.541196100 + 0.765366865) + tmp12 * 0.541196100;\n\t; data6 = tmp13 * 0.541196100 + tmp12 * (0.541196100 - 1.847759065);\n\n\tmovdqa    xmm4,xmm1\t\t; xmm1=tmp13\n\tmovdqa    xmm2,xmm1\n\tpunpcklwd xmm4,xmm6\t\t; xmm6=tmp12\n\tpunpckhwd xmm2,xmm6\n\tmovdqa    xmm1,xmm4\n\tmovdqa    xmm6,xmm2\n\tpmaddwd   xmm4,[GOTOFF(ebx,PW_F130_F054)]\t; xmm4=data2L\n\tpmaddwd   xmm2,[GOTOFF(ebx,PW_F130_F054)]\t; xmm2=data2H\n\tpmaddwd   xmm1,[GOTOFF(ebx,PW_F054_MF130)]\t; xmm1=data6L\n\tpmaddwd   xmm6,[GOTOFF(ebx,PW_F054_MF130)]\t; xmm6=data6H\n\n\tpaddd\txmm4,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpaddd\txmm2,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpsrad\txmm4,DESCALE_P2\n\tpsrad\txmm2,DESCALE_P2\n\tpaddd\txmm1,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpaddd\txmm6,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpsrad\txmm1,DESCALE_P2\n\tpsrad\txmm6,DESCALE_P2\n\n\tpackssdw  xmm4,xmm2\t\t; xmm4=data2\n\tpackssdw  xmm1,xmm6\t\t; xmm1=data6\n\n\tmovdqa\tXMMWORD [XMMBLOCK(2,0,edx,SIZEOF_DCTELEM)], xmm4\n\tmovdqa\tXMMWORD [XMMBLOCK(6,0,edx,SIZEOF_DCTELEM)], xmm1\n\n\t; -- Odd part\n\n\tmovdqa\txmm7, XMMWORD [wk(0)]\t; xmm7=tmp6\n\tmovdqa\txmm5, XMMWORD [wk(1)]\t; xmm5=tmp7\n\n\tmovdqa\txmm2,xmm0\t\t; xmm0=tmp4\n\tmovdqa\txmm6,xmm3\t\t; xmm3=tmp5\n\tpaddw\txmm2,xmm7\t\t; xmm2=z3\n\tpaddw\txmm6,xmm5\t\t; xmm6=z4\n\n\t; (Original)\n\t; z5 = (z3 + z4) * 1.175875602;\n\t; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n\t; z3 += z5;  z4 += z5;\n\t;\n\t; (This implementation)\n\t; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n\t; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n\tmovdqa    xmm4,xmm2\n\tmovdqa    xmm1,xmm2\n\tpunpcklwd xmm4,xmm6\n\tpunpckhwd xmm1,xmm6\n\tmovdqa    xmm2,xmm4\n\tmovdqa    xmm6,xmm1\n\tpmaddwd   xmm4,[GOTOFF(ebx,PW_MF078_F117)]\t; xmm4=z3L\n\tpmaddwd   xmm1,[GOTOFF(ebx,PW_MF078_F117)]\t; xmm1=z3H\n\tpmaddwd   xmm2,[GOTOFF(ebx,PW_F117_F078)]\t; xmm2=z4L\n\tpmaddwd   xmm6,[GOTOFF(ebx,PW_F117_F078)]\t; xmm6=z4H\n\n\tmovdqa\tXMMWORD [wk(0)], xmm4\t; wk(0)=z3L\n\tmovdqa\tXMMWORD [wk(1)], xmm1\t; wk(1)=z3H\n\n\t; (Original)\n\t; z1 = tmp4 + tmp7;  z2 = tmp5 + tmp6;\n\t; tmp4 = tmp4 * 0.298631336;  tmp5 = tmp5 * 2.053119869;\n\t; tmp6 = tmp6 * 3.072711026;  tmp7 = tmp7 * 1.501321110;\n\t; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n\t; data7 = tmp4 + z1 + z3;  data5 = tmp5 + z2 + z4;\n\t; data3 = tmp6 + z2 + z3;  data1 = tmp7 + z1 + z4;\n\t;\n\t; (This implementation)\n\t; tmp4 = tmp4 * (0.298631336 - 0.899976223) + tmp7 * -0.899976223;\n\t; tmp5 = tmp5 * (2.053119869 - 2.562915447) + tmp6 * -2.562915447;\n\t; tmp6 = tmp5 * -2.562915447 + tmp6 * (3.072711026 - 2.562915447);\n\t; tmp7 = tmp4 * -0.899976223 + tmp7 * (1.501321110 - 0.899976223);\n\t; data7 = tmp4 + z3;  data5 = tmp5 + z4;\n\t; data3 = tmp6 + z3;  data1 = tmp7 + z4;\n\n\tmovdqa    xmm4,xmm0\n\tmovdqa    xmm1,xmm0\n\tpunpcklwd xmm4,xmm5\n\tpunpckhwd xmm1,xmm5\n\tmovdqa    xmm0,xmm4\n\tmovdqa    xmm5,xmm1\n\tpmaddwd   xmm4,[GOTOFF(ebx,PW_MF060_MF089)]\t; xmm4=tmp4L\n\tpmaddwd   xmm1,[GOTOFF(ebx,PW_MF060_MF089)]\t; xmm1=tmp4H\n\tpmaddwd   xmm0,[GOTOFF(ebx,PW_MF089_F060)]\t; xmm0=tmp7L\n\tpmaddwd   xmm5,[GOTOFF(ebx,PW_MF089_F060)]\t; xmm5=tmp7H\n\n\tpaddd\txmm4, XMMWORD [wk(0)]\t; xmm4=data7L\n\tpaddd\txmm1, XMMWORD [wk(1)]\t; xmm1=data7H\n\tpaddd\txmm0,xmm2\t\t; xmm0=data1L\n\tpaddd\txmm5,xmm6\t\t; xmm5=data1H\n\n\tpaddd\txmm4,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpaddd\txmm1,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpsrad\txmm4,DESCALE_P2\n\tpsrad\txmm1,DESCALE_P2\n\tpaddd\txmm0,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpaddd\txmm5,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpsrad\txmm0,DESCALE_P2\n\tpsrad\txmm5,DESCALE_P2\n\n\tpackssdw  xmm4,xmm1\t\t; xmm4=data7\n\tpackssdw  xmm0,xmm5\t\t; xmm0=data1\n\n\tmovdqa\tXMMWORD [XMMBLOCK(7,0,edx,SIZEOF_DCTELEM)], xmm4\n\tmovdqa\tXMMWORD [XMMBLOCK(1,0,edx,SIZEOF_DCTELEM)], xmm0\n\n\tmovdqa    xmm1,xmm3\n\tmovdqa    xmm5,xmm3\n\tpunpcklwd xmm1,xmm7\n\tpunpckhwd xmm5,xmm7\n\tmovdqa    xmm3,xmm1\n\tmovdqa    xmm7,xmm5\n\tpmaddwd   xmm1,[GOTOFF(ebx,PW_MF050_MF256)]\t; xmm1=tmp5L\n\tpmaddwd   xmm5,[GOTOFF(ebx,PW_MF050_MF256)]\t; xmm5=tmp5H\n\tpmaddwd   xmm3,[GOTOFF(ebx,PW_MF256_F050)]\t; xmm3=tmp6L\n\tpmaddwd   xmm7,[GOTOFF(ebx,PW_MF256_F050)]\t; xmm7=tmp6H\n\n\tpaddd\txmm1,xmm2\t\t; xmm1=data5L\n\tpaddd\txmm5,xmm6\t\t; xmm5=data5H\n\tpaddd\txmm3, XMMWORD [wk(0)]\t; xmm3=data3L\n\tpaddd\txmm7, XMMWORD [wk(1)]\t; xmm7=data3H\n\n\tpaddd\txmm1,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpaddd\txmm5,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpsrad\txmm1,DESCALE_P2\n\tpsrad\txmm5,DESCALE_P2\n\tpaddd\txmm3,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpaddd\txmm7,[GOTOFF(ebx,PD_DESCALE_P2)]\n\tpsrad\txmm3,DESCALE_P2\n\tpsrad\txmm7,DESCALE_P2\n\n\tpackssdw  xmm1,xmm5\t\t; xmm1=data5\n\tpackssdw  xmm3,xmm7\t\t; xmm3=data3\n\n\tmovdqa\tXMMWORD [XMMBLOCK(5,0,edx,SIZEOF_DCTELEM)], xmm1\n\tmovdqa\tXMMWORD [XMMBLOCK(3,0,edx,SIZEOF_DCTELEM)], xmm3\n\n;\tpop\tedi\t\t; unused\n;\tpop\tesi\t\t; unused\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; unused\n\tpoppic\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jfsseflt-64.asm",
    "content": ";\n; jfsseflt-64.asm - floating-point FDCT (64-bit SSE)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2009 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a floating-point implementation of the forward DCT\n; (Discrete Cosine Transform). The following code is based directly on\n; the IJG's original jfdctflt.c; see the jfdctflt.c for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%macro\tunpcklps2 2\t; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(0 1 4 5)\n\tshufps\t%1,%2,0x44\n%endmacro\n\n%macro\tunpckhps2 2\t; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(2 3 6 7)\n\tshufps\t%1,%2,0xEE\n%endmacro\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_fdct_float_sse)\n\nEXTN(jconst_fdct_float_sse):\n\nPD_0_382\ttimes 4 dd  0.382683432365089771728460\nPD_0_707\ttimes 4 dd  0.707106781186547524400844\nPD_0_541\ttimes 4 dd  0.541196100146196984399723\nPD_1_306\ttimes 4 dd  1.306562964876376527856643\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t64\n;\n; Perform the forward DCT on one block of samples.\n;\n; GLOBAL(void)\n; jsimd_fdct_float_sse (FAST_FLOAT * data)\n;\n\n; r10 = FAST_FLOAT * data\n\n%define wk(i)\t\trbp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t2\n\n\talign\t16\n\tglobal\tEXTN(jsimd_fdct_float_sse)\n\nEXTN(jsimd_fdct_float_sse):\n\tpush\trbp\n\tmov\trax,rsp\t\t\t\t; rax = original rbp\n\tsub\trsp, byte 4\n\tand\trsp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[rsp],rax\n\tmov\trbp,rsp\t\t\t\t; rbp = aligned rbp\n\tlea\trsp, [wk(0)]\n\tcollect_args\n\n\t; ---- Pass 1: process rows.\n\n\tmov\trdx, r10\t; (FAST_FLOAT *)\n\tmov\trcx, DCTSIZE/4\n.rowloop:\n\n\tmovaps\txmm0, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm1, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm2, XMMWORD [XMMBLOCK(2,1,rdx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm3, XMMWORD [XMMBLOCK(3,1,rdx,SIZEOF_FAST_FLOAT)]\n\n\t; xmm0=(20 21 22 23), xmm2=(24 25 26 27)\n\t; xmm1=(30 31 32 33), xmm3=(34 35 36 37)\n\n\tmovaps   xmm4,xmm0\t\t; transpose coefficients(phase 1)\n\tunpcklps xmm0,xmm1\t\t; xmm0=(20 30 21 31)\n\tunpckhps xmm4,xmm1\t\t; xmm4=(22 32 23 33)\n\tmovaps   xmm5,xmm2\t\t; transpose coefficients(phase 1)\n\tunpcklps xmm2,xmm3\t\t; xmm2=(24 34 25 35)\n\tunpckhps xmm5,xmm3\t\t; xmm5=(26 36 27 37)\n\n\tmovaps\txmm6, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm7, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm1, XMMWORD [XMMBLOCK(0,1,rdx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm3, XMMWORD [XMMBLOCK(1,1,rdx,SIZEOF_FAST_FLOAT)]\n\n\t; xmm6=(00 01 02 03), xmm1=(04 05 06 07)\n\t; xmm7=(10 11 12 13), xmm3=(14 15 16 17)\n\n\tmovaps\tXMMWORD [wk(0)], xmm4\t; wk(0)=(22 32 23 33)\n\tmovaps\tXMMWORD [wk(1)], xmm2\t; wk(1)=(24 34 25 35)\n\n\tmovaps   xmm4,xmm6\t\t; transpose coefficients(phase 1)\n\tunpcklps xmm6,xmm7\t\t; xmm6=(00 10 01 11)\n\tunpckhps xmm4,xmm7\t\t; xmm4=(02 12 03 13)\n\tmovaps   xmm2,xmm1\t\t; transpose coefficients(phase 1)\n\tunpcklps xmm1,xmm3\t\t; xmm1=(04 14 05 15)\n\tunpckhps xmm2,xmm3\t\t; xmm2=(06 16 07 17)\n\n\tmovaps    xmm7,xmm6\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm6,xmm0\t\t; xmm6=(00 10 20 30)=data0\n\tunpckhps2 xmm7,xmm0\t\t; xmm7=(01 11 21 31)=data1\n\tmovaps    xmm3,xmm2\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm2,xmm5\t\t; xmm2=(06 16 26 36)=data6\n\tunpckhps2 xmm3,xmm5\t\t; xmm3=(07 17 27 37)=data7\n\n\tmovaps\txmm0,xmm7\n\tmovaps\txmm5,xmm6\n\tsubps\txmm7,xmm2\t\t; xmm7=data1-data6=tmp6\n\tsubps\txmm6,xmm3\t\t; xmm6=data0-data7=tmp7\n\taddps\txmm0,xmm2\t\t; xmm0=data1+data6=tmp1\n\taddps\txmm5,xmm3\t\t; xmm5=data0+data7=tmp0\n\n\tmovaps\txmm2, XMMWORD [wk(0)]\t; xmm2=(22 32 23 33)\n\tmovaps\txmm3, XMMWORD [wk(1)]\t; xmm3=(24 34 25 35)\n\tmovaps\tXMMWORD [wk(0)], xmm7\t; wk(0)=tmp6\n\tmovaps\tXMMWORD [wk(1)], xmm6\t; wk(1)=tmp7\n\n\tmovaps    xmm7,xmm4\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm4,xmm2\t\t; xmm4=(02 12 22 32)=data2\n\tunpckhps2 xmm7,xmm2\t\t; xmm7=(03 13 23 33)=data3\n\tmovaps    xmm6,xmm1\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm1,xmm3\t\t; xmm1=(04 14 24 34)=data4\n\tunpckhps2 xmm6,xmm3\t\t; xmm6=(05 15 25 35)=data5\n\n\tmovaps\txmm2,xmm7\n\tmovaps\txmm3,xmm4\n\taddps\txmm7,xmm1\t\t; xmm7=data3+data4=tmp3\n\taddps\txmm4,xmm6\t\t; xmm4=data2+data5=tmp2\n\tsubps\txmm2,xmm1\t\t; xmm2=data3-data4=tmp4\n\tsubps\txmm3,xmm6\t\t; xmm3=data2-data5=tmp5\n\n\t; -- Even part\n\n\tmovaps\txmm1,xmm5\n\tmovaps\txmm6,xmm0\n\tsubps\txmm5,xmm7\t\t; xmm5=tmp13\n\tsubps\txmm0,xmm4\t\t; xmm0=tmp12\n\taddps\txmm1,xmm7\t\t; xmm1=tmp10\n\taddps\txmm6,xmm4\t\t; xmm6=tmp11\n\n\taddps\txmm0,xmm5\n\tmulps\txmm0,[rel PD_0_707] ; xmm0=z1\n\n\tmovaps\txmm7,xmm1\n\tmovaps\txmm4,xmm5\n\tsubps\txmm1,xmm6\t\t; xmm1=data4\n\tsubps\txmm5,xmm0\t\t; xmm5=data6\n\taddps\txmm7,xmm6\t\t; xmm7=data0\n\taddps\txmm4,xmm0\t\t; xmm4=data2\n\n\tmovaps\tXMMWORD [XMMBLOCK(0,1,rdx,SIZEOF_FAST_FLOAT)], xmm1\n\tmovaps\tXMMWORD [XMMBLOCK(2,1,rdx,SIZEOF_FAST_FLOAT)], xmm5\n\tmovaps\tXMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_FAST_FLOAT)], xmm7\n\tmovaps\tXMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_FAST_FLOAT)], xmm4\n\n\t; -- Odd part\n\n\tmovaps\txmm6, XMMWORD [wk(0)]\t; xmm6=tmp6\n\tmovaps\txmm0, XMMWORD [wk(1)]\t; xmm0=tmp7\n\n\taddps\txmm2,xmm3\t\t; xmm2=tmp10\n\taddps\txmm3,xmm6\t\t; xmm3=tmp11\n\taddps\txmm6,xmm0\t\t; xmm6=tmp12, xmm0=tmp7\n\n\tmulps\txmm3,[rel PD_0_707] ; xmm3=z3\n\n\tmovaps\txmm1,xmm2\t\t; xmm1=tmp10\n\tsubps\txmm2,xmm6\n\tmulps\txmm2,[rel PD_0_382] ; xmm2=z5\n\tmulps\txmm1,[rel PD_0_541] ; xmm1=MULTIPLY(tmp10,FIX_0_541196)\n\tmulps\txmm6,[rel PD_1_306] ; xmm6=MULTIPLY(tmp12,FIX_1_306562)\n\taddps\txmm1,xmm2\t\t; xmm1=z2\n\taddps\txmm6,xmm2\t\t; xmm6=z4\n\n\tmovaps\txmm5,xmm0\n\tsubps\txmm0,xmm3\t\t; xmm0=z13\n\taddps\txmm5,xmm3\t\t; xmm5=z11\n\n\tmovaps\txmm7,xmm0\n\tmovaps\txmm4,xmm5\n\tsubps\txmm0,xmm1\t\t; xmm0=data3\n\tsubps\txmm5,xmm6\t\t; xmm5=data7\n\taddps\txmm7,xmm1\t\t; xmm7=data5\n\taddps\txmm4,xmm6\t\t; xmm4=data1\n\n\tmovaps\tXMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_FAST_FLOAT)], xmm0\n\tmovaps\tXMMWORD [XMMBLOCK(3,1,rdx,SIZEOF_FAST_FLOAT)], xmm5\n\tmovaps\tXMMWORD [XMMBLOCK(1,1,rdx,SIZEOF_FAST_FLOAT)], xmm7\n\tmovaps\tXMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_FAST_FLOAT)], xmm4\n\n\tadd\trdx, 4*DCTSIZE*SIZEOF_FAST_FLOAT\n\tdec\trcx\n\tjnz\tnear .rowloop\n\n\t; ---- Pass 2: process columns.\n\n\tmov\trdx, r10\t; (FAST_FLOAT *)\n\tmov\trcx, DCTSIZE/4\n.columnloop:\n\n\tmovaps\txmm0, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm1, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm2, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm3, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_FAST_FLOAT)]\n\n\t; xmm0=(02 12 22 32), xmm2=(42 52 62 72)\n\t; xmm1=(03 13 23 33), xmm3=(43 53 63 73)\n\n\tmovaps   xmm4,xmm0\t\t; transpose coefficients(phase 1)\n\tunpcklps xmm0,xmm1\t\t; xmm0=(02 03 12 13)\n\tunpckhps xmm4,xmm1\t\t; xmm4=(22 23 32 33)\n\tmovaps   xmm5,xmm2\t\t; transpose coefficients(phase 1)\n\tunpcklps xmm2,xmm3\t\t; xmm2=(42 43 52 53)\n\tunpckhps xmm5,xmm3\t\t; xmm5=(62 63 72 73)\n\n\tmovaps\txmm6, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm7, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm1, XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm3, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_FAST_FLOAT)]\n\n\t; xmm6=(00 10 20 30), xmm1=(40 50 60 70)\n\t; xmm7=(01 11 21 31), xmm3=(41 51 61 71)\n\n\tmovaps\tXMMWORD [wk(0)], xmm4\t; wk(0)=(22 23 32 33)\n\tmovaps\tXMMWORD [wk(1)], xmm2\t; wk(1)=(42 43 52 53)\n\n\tmovaps   xmm4,xmm6\t\t; transpose coefficients(phase 1)\n\tunpcklps xmm6,xmm7\t\t; xmm6=(00 01 10 11)\n\tunpckhps xmm4,xmm7\t\t; xmm4=(20 21 30 31)\n\tmovaps   xmm2,xmm1\t\t; transpose coefficients(phase 1)\n\tunpcklps xmm1,xmm3\t\t; xmm1=(40 41 50 51)\n\tunpckhps xmm2,xmm3\t\t; xmm2=(60 61 70 71)\n\n\tmovaps    xmm7,xmm6\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm6,xmm0\t\t; xmm6=(00 01 02 03)=data0\n\tunpckhps2 xmm7,xmm0\t\t; xmm7=(10 11 12 13)=data1\n\tmovaps    xmm3,xmm2\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm2,xmm5\t\t; xmm2=(60 61 62 63)=data6\n\tunpckhps2 xmm3,xmm5\t\t; xmm3=(70 71 72 73)=data7\n\n\tmovaps\txmm0,xmm7\n\tmovaps\txmm5,xmm6\n\tsubps\txmm7,xmm2\t\t; xmm7=data1-data6=tmp6\n\tsubps\txmm6,xmm3\t\t; xmm6=data0-data7=tmp7\n\taddps\txmm0,xmm2\t\t; xmm0=data1+data6=tmp1\n\taddps\txmm5,xmm3\t\t; xmm5=data0+data7=tmp0\n\n\tmovaps\txmm2, XMMWORD [wk(0)]\t; xmm2=(22 23 32 33)\n\tmovaps\txmm3, XMMWORD [wk(1)]\t; xmm3=(42 43 52 53)\n\tmovaps\tXMMWORD [wk(0)], xmm7\t; wk(0)=tmp6\n\tmovaps\tXMMWORD [wk(1)], xmm6\t; wk(1)=tmp7\n\n\tmovaps    xmm7,xmm4\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm4,xmm2\t\t; xmm4=(20 21 22 23)=data2\n\tunpckhps2 xmm7,xmm2\t\t; xmm7=(30 31 32 33)=data3\n\tmovaps    xmm6,xmm1\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm1,xmm3\t\t; xmm1=(40 41 42 43)=data4\n\tunpckhps2 xmm6,xmm3\t\t; xmm6=(50 51 52 53)=data5\n\n\tmovaps\txmm2,xmm7\n\tmovaps\txmm3,xmm4\n\taddps\txmm7,xmm1\t\t; xmm7=data3+data4=tmp3\n\taddps\txmm4,xmm6\t\t; xmm4=data2+data5=tmp2\n\tsubps\txmm2,xmm1\t\t; xmm2=data3-data4=tmp4\n\tsubps\txmm3,xmm6\t\t; xmm3=data2-data5=tmp5\n\n\t; -- Even part\n\n\tmovaps\txmm1,xmm5\n\tmovaps\txmm6,xmm0\n\tsubps\txmm5,xmm7\t\t; xmm5=tmp13\n\tsubps\txmm0,xmm4\t\t; xmm0=tmp12\n\taddps\txmm1,xmm7\t\t; xmm1=tmp10\n\taddps\txmm6,xmm4\t\t; xmm6=tmp11\n\n\taddps\txmm0,xmm5\n\tmulps\txmm0,[rel PD_0_707] ; xmm0=z1\n\n\tmovaps\txmm7,xmm1\n\tmovaps\txmm4,xmm5\n\tsubps\txmm1,xmm6\t\t; xmm1=data4\n\tsubps\txmm5,xmm0\t\t; xmm5=data6\n\taddps\txmm7,xmm6\t\t; xmm7=data0\n\taddps\txmm4,xmm0\t\t; xmm4=data2\n\n\tmovaps\tXMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_FAST_FLOAT)], xmm1\n\tmovaps\tXMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_FAST_FLOAT)], xmm5\n\tmovaps\tXMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_FAST_FLOAT)], xmm7\n\tmovaps\tXMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_FAST_FLOAT)], xmm4\n\n\t; -- Odd part\n\n\tmovaps\txmm6, XMMWORD [wk(0)]\t; xmm6=tmp6\n\tmovaps\txmm0, XMMWORD [wk(1)]\t; xmm0=tmp7\n\n\taddps\txmm2,xmm3\t\t; xmm2=tmp10\n\taddps\txmm3,xmm6\t\t; xmm3=tmp11\n\taddps\txmm6,xmm0\t\t; xmm6=tmp12, xmm0=tmp7\n\n\tmulps\txmm3,[rel PD_0_707] ; xmm3=z3\n\n\tmovaps\txmm1,xmm2\t\t; xmm1=tmp10\n\tsubps\txmm2,xmm6\n\tmulps\txmm2,[rel PD_0_382] ; xmm2=z5\n\tmulps\txmm1,[rel PD_0_541] ; xmm1=MULTIPLY(tmp10,FIX_0_541196)\n\tmulps\txmm6,[rel PD_1_306] ; xmm6=MULTIPLY(tmp12,FIX_1_306562)\n\taddps\txmm1,xmm2\t\t; xmm1=z2\n\taddps\txmm6,xmm2\t\t; xmm6=z4\n\n\tmovaps\txmm5,xmm0\n\tsubps\txmm0,xmm3\t\t; xmm0=z13\n\taddps\txmm5,xmm3\t\t; xmm5=z11\n\n\tmovaps\txmm7,xmm0\n\tmovaps\txmm4,xmm5\n\tsubps\txmm0,xmm1\t\t; xmm0=data3\n\tsubps\txmm5,xmm6\t\t; xmm5=data7\n\taddps\txmm7,xmm1\t\t; xmm7=data5\n\taddps\txmm4,xmm6\t\t; xmm4=data1\n\n\tmovaps\tXMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_FAST_FLOAT)], xmm0\n\tmovaps\tXMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_FAST_FLOAT)], xmm5\n\tmovaps\tXMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_FAST_FLOAT)], xmm7\n\tmovaps\tXMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_FAST_FLOAT)], xmm4\n\n\tadd\trdx, byte 4*SIZEOF_FAST_FLOAT\n\tdec\trcx\n\tjnz\tnear .columnloop\n\n\tuncollect_args\n\tmov\trsp,rbp\t\t; rsp <- aligned rbp\n\tpop\trsp\t\t; rsp <- original rbp\n\tpop\trbp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jfsseflt.asm",
    "content": ";\n; jfsseflt.asm - floating-point FDCT (SSE)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a floating-point implementation of the forward DCT\n; (Discrete Cosine Transform). The following code is based directly on\n; the IJG's original jfdctflt.c; see the jfdctflt.c for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%macro\tunpcklps2 2\t; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(0 1 4 5)\n\tshufps\t%1,%2,0x44\n%endmacro\n\n%macro\tunpckhps2 2\t; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(2 3 6 7)\n\tshufps\t%1,%2,0xEE\n%endmacro\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_fdct_float_sse)\n\nEXTN(jconst_fdct_float_sse):\n\nPD_0_382\ttimes 4 dd  0.382683432365089771728460\nPD_0_707\ttimes 4 dd  0.707106781186547524400844\nPD_0_541\ttimes 4 dd  0.541196100146196984399723\nPD_1_306\ttimes 4 dd  1.306562964876376527856643\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Perform the forward DCT on one block of samples.\n;\n; GLOBAL(void)\n; jsimd_fdct_float_sse (FAST_FLOAT * data)\n;\n\n%define data(b)\t\t(b)+8\t\t; FAST_FLOAT * data\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t2\n\n\talign\t16\n\tglobal\tEXTN(jsimd_fdct_float_sse)\n\nEXTN(jsimd_fdct_float_sse):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [wk(0)]\n\tpushpic\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n;\tpush\tesi\t\t; unused\n;\tpush\tedi\t\t; unused\n\n\tget_GOT\tebx\t\t; get GOT address\n\n\t; ---- Pass 1: process rows.\n\n\tmov\tedx, POINTER [data(eax)]\t; (FAST_FLOAT *)\n\tmov\tecx, DCTSIZE/4\n\talignx\t16,7\n.rowloop:\n\n\tmovaps\txmm0, XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm1, XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm2, XMMWORD [XMMBLOCK(2,1,edx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm3, XMMWORD [XMMBLOCK(3,1,edx,SIZEOF_FAST_FLOAT)]\n\n\t; xmm0=(20 21 22 23), xmm2=(24 25 26 27)\n\t; xmm1=(30 31 32 33), xmm3=(34 35 36 37)\n\n\tmovaps   xmm4,xmm0\t\t; transpose coefficients(phase 1)\n\tunpcklps xmm0,xmm1\t\t; xmm0=(20 30 21 31)\n\tunpckhps xmm4,xmm1\t\t; xmm4=(22 32 23 33)\n\tmovaps   xmm5,xmm2\t\t; transpose coefficients(phase 1)\n\tunpcklps xmm2,xmm3\t\t; xmm2=(24 34 25 35)\n\tunpckhps xmm5,xmm3\t\t; xmm5=(26 36 27 37)\n\n\tmovaps\txmm6, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm7, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm1, XMMWORD [XMMBLOCK(0,1,edx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm3, XMMWORD [XMMBLOCK(1,1,edx,SIZEOF_FAST_FLOAT)]\n\n\t; xmm6=(00 01 02 03), xmm1=(04 05 06 07)\n\t; xmm7=(10 11 12 13), xmm3=(14 15 16 17)\n\n\tmovaps\tXMMWORD [wk(0)], xmm4\t; wk(0)=(22 32 23 33)\n\tmovaps\tXMMWORD [wk(1)], xmm2\t; wk(1)=(24 34 25 35)\n\n\tmovaps   xmm4,xmm6\t\t; transpose coefficients(phase 1)\n\tunpcklps xmm6,xmm7\t\t; xmm6=(00 10 01 11)\n\tunpckhps xmm4,xmm7\t\t; xmm4=(02 12 03 13)\n\tmovaps   xmm2,xmm1\t\t; transpose coefficients(phase 1)\n\tunpcklps xmm1,xmm3\t\t; xmm1=(04 14 05 15)\n\tunpckhps xmm2,xmm3\t\t; xmm2=(06 16 07 17)\n\n\tmovaps    xmm7,xmm6\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm6,xmm0\t\t; xmm6=(00 10 20 30)=data0\n\tunpckhps2 xmm7,xmm0\t\t; xmm7=(01 11 21 31)=data1\n\tmovaps    xmm3,xmm2\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm2,xmm5\t\t; xmm2=(06 16 26 36)=data6\n\tunpckhps2 xmm3,xmm5\t\t; xmm3=(07 17 27 37)=data7\n\n\tmovaps\txmm0,xmm7\n\tmovaps\txmm5,xmm6\n\tsubps\txmm7,xmm2\t\t; xmm7=data1-data6=tmp6\n\tsubps\txmm6,xmm3\t\t; xmm6=data0-data7=tmp7\n\taddps\txmm0,xmm2\t\t; xmm0=data1+data6=tmp1\n\taddps\txmm5,xmm3\t\t; xmm5=data0+data7=tmp0\n\n\tmovaps\txmm2, XMMWORD [wk(0)]\t; xmm2=(22 32 23 33)\n\tmovaps\txmm3, XMMWORD [wk(1)]\t; xmm3=(24 34 25 35)\n\tmovaps\tXMMWORD [wk(0)], xmm7\t; wk(0)=tmp6\n\tmovaps\tXMMWORD [wk(1)], xmm6\t; wk(1)=tmp7\n\n\tmovaps    xmm7,xmm4\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm4,xmm2\t\t; xmm4=(02 12 22 32)=data2\n\tunpckhps2 xmm7,xmm2\t\t; xmm7=(03 13 23 33)=data3\n\tmovaps    xmm6,xmm1\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm1,xmm3\t\t; xmm1=(04 14 24 34)=data4\n\tunpckhps2 xmm6,xmm3\t\t; xmm6=(05 15 25 35)=data5\n\n\tmovaps\txmm2,xmm7\n\tmovaps\txmm3,xmm4\n\taddps\txmm7,xmm1\t\t; xmm7=data3+data4=tmp3\n\taddps\txmm4,xmm6\t\t; xmm4=data2+data5=tmp2\n\tsubps\txmm2,xmm1\t\t; xmm2=data3-data4=tmp4\n\tsubps\txmm3,xmm6\t\t; xmm3=data2-data5=tmp5\n\n\t; -- Even part\n\n\tmovaps\txmm1,xmm5\n\tmovaps\txmm6,xmm0\n\tsubps\txmm5,xmm7\t\t; xmm5=tmp13\n\tsubps\txmm0,xmm4\t\t; xmm0=tmp12\n\taddps\txmm1,xmm7\t\t; xmm1=tmp10\n\taddps\txmm6,xmm4\t\t; xmm6=tmp11\n\n\taddps\txmm0,xmm5\n\tmulps\txmm0,[GOTOFF(ebx,PD_0_707)] ; xmm0=z1\n\n\tmovaps\txmm7,xmm1\n\tmovaps\txmm4,xmm5\n\tsubps\txmm1,xmm6\t\t; xmm1=data4\n\tsubps\txmm5,xmm0\t\t; xmm5=data6\n\taddps\txmm7,xmm6\t\t; xmm7=data0\n\taddps\txmm4,xmm0\t\t; xmm4=data2\n\n\tmovaps\tXMMWORD [XMMBLOCK(0,1,edx,SIZEOF_FAST_FLOAT)], xmm1\n\tmovaps\tXMMWORD [XMMBLOCK(2,1,edx,SIZEOF_FAST_FLOAT)], xmm5\n\tmovaps\tXMMWORD [XMMBLOCK(0,0,edx,SIZEOF_FAST_FLOAT)], xmm7\n\tmovaps\tXMMWORD [XMMBLOCK(2,0,edx,SIZEOF_FAST_FLOAT)], xmm4\n\n\t; -- Odd part\n\n\tmovaps\txmm6, XMMWORD [wk(0)]\t; xmm6=tmp6\n\tmovaps\txmm0, XMMWORD [wk(1)]\t; xmm0=tmp7\n\n\taddps\txmm2,xmm3\t\t; xmm2=tmp10\n\taddps\txmm3,xmm6\t\t; xmm3=tmp11\n\taddps\txmm6,xmm0\t\t; xmm6=tmp12, xmm0=tmp7\n\n\tmulps\txmm3,[GOTOFF(ebx,PD_0_707)] ; xmm3=z3\n\n\tmovaps\txmm1,xmm2\t\t; xmm1=tmp10\n\tsubps\txmm2,xmm6\n\tmulps\txmm2,[GOTOFF(ebx,PD_0_382)] ; xmm2=z5\n\tmulps\txmm1,[GOTOFF(ebx,PD_0_541)] ; xmm1=MULTIPLY(tmp10,FIX_0_541196)\n\tmulps\txmm6,[GOTOFF(ebx,PD_1_306)] ; xmm6=MULTIPLY(tmp12,FIX_1_306562)\n\taddps\txmm1,xmm2\t\t; xmm1=z2\n\taddps\txmm6,xmm2\t\t; xmm6=z4\n\n\tmovaps\txmm5,xmm0\n\tsubps\txmm0,xmm3\t\t; xmm0=z13\n\taddps\txmm5,xmm3\t\t; xmm5=z11\n\n\tmovaps\txmm7,xmm0\n\tmovaps\txmm4,xmm5\n\tsubps\txmm0,xmm1\t\t; xmm0=data3\n\tsubps\txmm5,xmm6\t\t; xmm5=data7\n\taddps\txmm7,xmm1\t\t; xmm7=data5\n\taddps\txmm4,xmm6\t\t; xmm4=data1\n\n\tmovaps\tXMMWORD [XMMBLOCK(3,0,edx,SIZEOF_FAST_FLOAT)], xmm0\n\tmovaps\tXMMWORD [XMMBLOCK(3,1,edx,SIZEOF_FAST_FLOAT)], xmm5\n\tmovaps\tXMMWORD [XMMBLOCK(1,1,edx,SIZEOF_FAST_FLOAT)], xmm7\n\tmovaps\tXMMWORD [XMMBLOCK(1,0,edx,SIZEOF_FAST_FLOAT)], xmm4\n\n\tadd\tedx, 4*DCTSIZE*SIZEOF_FAST_FLOAT\n\tdec\tecx\n\tjnz\tnear .rowloop\n\n\t; ---- Pass 2: process columns.\n\n\tmov\tedx, POINTER [data(eax)]\t; (FAST_FLOAT *)\n\tmov\tecx, DCTSIZE/4\n\talignx\t16,7\n.columnloop:\n\n\tmovaps\txmm0, XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm1, XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm2, XMMWORD [XMMBLOCK(6,0,edx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm3, XMMWORD [XMMBLOCK(7,0,edx,SIZEOF_FAST_FLOAT)]\n\n\t; xmm0=(02 12 22 32), xmm2=(42 52 62 72)\n\t; xmm1=(03 13 23 33), xmm3=(43 53 63 73)\n\n\tmovaps   xmm4,xmm0\t\t; transpose coefficients(phase 1)\n\tunpcklps xmm0,xmm1\t\t; xmm0=(02 03 12 13)\n\tunpckhps xmm4,xmm1\t\t; xmm4=(22 23 32 33)\n\tmovaps   xmm5,xmm2\t\t; transpose coefficients(phase 1)\n\tunpcklps xmm2,xmm3\t\t; xmm2=(42 43 52 53)\n\tunpckhps xmm5,xmm3\t\t; xmm5=(62 63 72 73)\n\n\tmovaps\txmm6, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm7, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm1, XMMWORD [XMMBLOCK(4,0,edx,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm3, XMMWORD [XMMBLOCK(5,0,edx,SIZEOF_FAST_FLOAT)]\n\n\t; xmm6=(00 10 20 30), xmm1=(40 50 60 70)\n\t; xmm7=(01 11 21 31), xmm3=(41 51 61 71)\n\n\tmovaps\tXMMWORD [wk(0)], xmm4\t; wk(0)=(22 23 32 33)\n\tmovaps\tXMMWORD [wk(1)], xmm2\t; wk(1)=(42 43 52 53)\n\n\tmovaps   xmm4,xmm6\t\t; transpose coefficients(phase 1)\n\tunpcklps xmm6,xmm7\t\t; xmm6=(00 01 10 11)\n\tunpckhps xmm4,xmm7\t\t; xmm4=(20 21 30 31)\n\tmovaps   xmm2,xmm1\t\t; transpose coefficients(phase 1)\n\tunpcklps xmm1,xmm3\t\t; xmm1=(40 41 50 51)\n\tunpckhps xmm2,xmm3\t\t; xmm2=(60 61 70 71)\n\n\tmovaps    xmm7,xmm6\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm6,xmm0\t\t; xmm6=(00 01 02 03)=data0\n\tunpckhps2 xmm7,xmm0\t\t; xmm7=(10 11 12 13)=data1\n\tmovaps    xmm3,xmm2\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm2,xmm5\t\t; xmm2=(60 61 62 63)=data6\n\tunpckhps2 xmm3,xmm5\t\t; xmm3=(70 71 72 73)=data7\n\n\tmovaps\txmm0,xmm7\n\tmovaps\txmm5,xmm6\n\tsubps\txmm7,xmm2\t\t; xmm7=data1-data6=tmp6\n\tsubps\txmm6,xmm3\t\t; xmm6=data0-data7=tmp7\n\taddps\txmm0,xmm2\t\t; xmm0=data1+data6=tmp1\n\taddps\txmm5,xmm3\t\t; xmm5=data0+data7=tmp0\n\n\tmovaps\txmm2, XMMWORD [wk(0)]\t; xmm2=(22 23 32 33)\n\tmovaps\txmm3, XMMWORD [wk(1)]\t; xmm3=(42 43 52 53)\n\tmovaps\tXMMWORD [wk(0)], xmm7\t; wk(0)=tmp6\n\tmovaps\tXMMWORD [wk(1)], xmm6\t; wk(1)=tmp7\n\n\tmovaps    xmm7,xmm4\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm4,xmm2\t\t; xmm4=(20 21 22 23)=data2\n\tunpckhps2 xmm7,xmm2\t\t; xmm7=(30 31 32 33)=data3\n\tmovaps    xmm6,xmm1\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm1,xmm3\t\t; xmm1=(40 41 42 43)=data4\n\tunpckhps2 xmm6,xmm3\t\t; xmm6=(50 51 52 53)=data5\n\n\tmovaps\txmm2,xmm7\n\tmovaps\txmm3,xmm4\n\taddps\txmm7,xmm1\t\t; xmm7=data3+data4=tmp3\n\taddps\txmm4,xmm6\t\t; xmm4=data2+data5=tmp2\n\tsubps\txmm2,xmm1\t\t; xmm2=data3-data4=tmp4\n\tsubps\txmm3,xmm6\t\t; xmm3=data2-data5=tmp5\n\n\t; -- Even part\n\n\tmovaps\txmm1,xmm5\n\tmovaps\txmm6,xmm0\n\tsubps\txmm5,xmm7\t\t; xmm5=tmp13\n\tsubps\txmm0,xmm4\t\t; xmm0=tmp12\n\taddps\txmm1,xmm7\t\t; xmm1=tmp10\n\taddps\txmm6,xmm4\t\t; xmm6=tmp11\n\n\taddps\txmm0,xmm5\n\tmulps\txmm0,[GOTOFF(ebx,PD_0_707)] ; xmm0=z1\n\n\tmovaps\txmm7,xmm1\n\tmovaps\txmm4,xmm5\n\tsubps\txmm1,xmm6\t\t; xmm1=data4\n\tsubps\txmm5,xmm0\t\t; xmm5=data6\n\taddps\txmm7,xmm6\t\t; xmm7=data0\n\taddps\txmm4,xmm0\t\t; xmm4=data2\n\n\tmovaps\tXMMWORD [XMMBLOCK(4,0,edx,SIZEOF_FAST_FLOAT)], xmm1\n\tmovaps\tXMMWORD [XMMBLOCK(6,0,edx,SIZEOF_FAST_FLOAT)], xmm5\n\tmovaps\tXMMWORD [XMMBLOCK(0,0,edx,SIZEOF_FAST_FLOAT)], xmm7\n\tmovaps\tXMMWORD [XMMBLOCK(2,0,edx,SIZEOF_FAST_FLOAT)], xmm4\n\n\t; -- Odd part\n\n\tmovaps\txmm6, XMMWORD [wk(0)]\t; xmm6=tmp6\n\tmovaps\txmm0, XMMWORD [wk(1)]\t; xmm0=tmp7\n\n\taddps\txmm2,xmm3\t\t; xmm2=tmp10\n\taddps\txmm3,xmm6\t\t; xmm3=tmp11\n\taddps\txmm6,xmm0\t\t; xmm6=tmp12, xmm0=tmp7\n\n\tmulps\txmm3,[GOTOFF(ebx,PD_0_707)] ; xmm3=z3\n\n\tmovaps\txmm1,xmm2\t\t; xmm1=tmp10\n\tsubps\txmm2,xmm6\n\tmulps\txmm2,[GOTOFF(ebx,PD_0_382)] ; xmm2=z5\n\tmulps\txmm1,[GOTOFF(ebx,PD_0_541)] ; xmm1=MULTIPLY(tmp10,FIX_0_541196)\n\tmulps\txmm6,[GOTOFF(ebx,PD_1_306)] ; xmm6=MULTIPLY(tmp12,FIX_1_306562)\n\taddps\txmm1,xmm2\t\t; xmm1=z2\n\taddps\txmm6,xmm2\t\t; xmm6=z4\n\n\tmovaps\txmm5,xmm0\n\tsubps\txmm0,xmm3\t\t; xmm0=z13\n\taddps\txmm5,xmm3\t\t; xmm5=z11\n\n\tmovaps\txmm7,xmm0\n\tmovaps\txmm4,xmm5\n\tsubps\txmm0,xmm1\t\t; xmm0=data3\n\tsubps\txmm5,xmm6\t\t; xmm5=data7\n\taddps\txmm7,xmm1\t\t; xmm7=data5\n\taddps\txmm4,xmm6\t\t; xmm4=data1\n\n\tmovaps\tXMMWORD [XMMBLOCK(3,0,edx,SIZEOF_FAST_FLOAT)], xmm0\n\tmovaps\tXMMWORD [XMMBLOCK(7,0,edx,SIZEOF_FAST_FLOAT)], xmm5\n\tmovaps\tXMMWORD [XMMBLOCK(5,0,edx,SIZEOF_FAST_FLOAT)], xmm7\n\tmovaps\tXMMWORD [XMMBLOCK(1,0,edx,SIZEOF_FAST_FLOAT)], xmm4\n\n\tadd\tedx, byte 4*SIZEOF_FAST_FLOAT\n\tdec\tecx\n\tjnz\tnear .columnloop\n\n;\tpop\tedi\t\t; unused\n;\tpop\tesi\t\t; unused\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpoppic\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/ji3dnflt.asm",
    "content": ";\n; ji3dnflt.asm - floating-point IDCT (3DNow! & MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a floating-point implementation of the inverse DCT\n; (Discrete Cosine Transform). The following code is based directly on\n; the IJG's original jidctflt.c; see the jidctflt.c for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_idct_float_3dnow)\n\nEXTN(jconst_idct_float_3dnow):\n\nPD_1_414\ttimes 2 dd  1.414213562373095048801689\nPD_1_847\ttimes 2 dd  1.847759065022573512256366\nPD_1_082\ttimes 2 dd  1.082392200292393968799446\nPD_2_613\ttimes 2 dd  2.613125929752753055713286\nPD_RNDINT_MAGIC\ttimes 2 dd  100663296.0\t; (float)(0x00C00000 << 3)\nPB_CENTERJSAMP\ttimes 8 db  CENTERJSAMPLE\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Perform dequantization and inverse DCT on one block of coefficients.\n;\n; GLOBAL(void)\n; jsimd_idct_float_3dnow (void * dct_table, JCOEFPTR coef_block,\n;                         JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n%define dct_table(b)\t(b)+8\t\t\t; void * dct_table\n%define coef_block(b)\t(b)+12\t\t; JCOEFPTR coef_block\n%define output_buf(b)\t(b)+16\t\t; JSAMPARRAY output_buf\n%define output_col(b)\t(b)+20\t\t; JDIMENSION output_col\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_MMWORD\t; mmword wk[WK_NUM]\n%define WK_NUM\t\t2\n%define workspace\twk(0)-DCTSIZE2*SIZEOF_FAST_FLOAT\n\t\t\t\t\t; FAST_FLOAT workspace[DCTSIZE2]\n\n\talign\t16\n\tglobal\tEXTN(jsimd_idct_float_3dnow)\n\nEXTN(jsimd_idct_float_3dnow):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_MMWORD)\t; align to 64 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [workspace]\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t; get GOT address\n\n\t; ---- Pass 1: process columns from input, store into work array.\n\n;\tmov\teax, [original_ebp]\n\tmov\tedx, POINTER [dct_table(eax)]\t; quantptr\n\tmov\tesi, JCOEFPTR [coef_block(eax)]\t\t; inptr\n\tlea\tedi, [workspace]\t\t\t; FAST_FLOAT * wsptr\n\tmov\tecx, DCTSIZE/2\t\t\t\t; ctr\n\talignx\t16,7\n.columnloop:\n%ifndef NO_ZERO_COLUMN_TEST_FLOAT_3DNOW\n\tmov\teax, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tor\teax, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tjnz\tshort .columnDCT\n\n\tpushpic\tebx\t\t; save GOT address\n\tmov\tebx, DWORD [DWBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tmov\teax, DWORD [DWBLOCK(4,0,esi,SIZEOF_JCOEF)]\n\tor\tebx, DWORD [DWBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tor\teax, DWORD [DWBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\tor\tebx, DWORD [DWBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\tor\teax,ebx\n\tpoppic\tebx\t\t; restore GOT address\n\tjnz\tshort .columnDCT\n\n\t; -- AC terms all zero\n\n\tmovd      mm0, DWORD [DWBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\n\tpunpcklwd mm0,mm0\n\tpsrad     mm0,(DWORD_BIT-WORD_BIT)\n\tpi2fd     mm0,mm0\n\n\tpfmul     mm0, MMWORD [MMBLOCK(0,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n\tmovq      mm1,mm0\n\tpunpckldq mm0,mm0\n\tpunpckhdq mm1,mm1\n\n\tmovq\tMMWORD [MMBLOCK(0,0,edi,SIZEOF_FAST_FLOAT)], mm0\n\tmovq\tMMWORD [MMBLOCK(0,1,edi,SIZEOF_FAST_FLOAT)], mm0\n\tmovq\tMMWORD [MMBLOCK(0,2,edi,SIZEOF_FAST_FLOAT)], mm0\n\tmovq\tMMWORD [MMBLOCK(0,3,edi,SIZEOF_FAST_FLOAT)], mm0\n\tmovq\tMMWORD [MMBLOCK(1,0,edi,SIZEOF_FAST_FLOAT)], mm1\n\tmovq\tMMWORD [MMBLOCK(1,1,edi,SIZEOF_FAST_FLOAT)], mm1\n\tmovq\tMMWORD [MMBLOCK(1,2,edi,SIZEOF_FAST_FLOAT)], mm1\n\tmovq\tMMWORD [MMBLOCK(1,3,edi,SIZEOF_FAST_FLOAT)], mm1\n\tjmp\tnear .nextcolumn\n\talignx\t16,7\n%endif\n.columnDCT:\n\n\t; -- Even part\n\n\tmovd      mm0, DWORD [DWBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\tmovd      mm1, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tmovd      mm2, DWORD [DWBLOCK(4,0,esi,SIZEOF_JCOEF)]\n\tmovd      mm3, DWORD [DWBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\n\tpunpcklwd mm0,mm0\n\tpunpcklwd mm1,mm1\n\tpsrad     mm0,(DWORD_BIT-WORD_BIT)\n\tpsrad     mm1,(DWORD_BIT-WORD_BIT)\n\tpi2fd     mm0,mm0\n\tpi2fd     mm1,mm1\n\n\tpfmul     mm0, MMWORD [MMBLOCK(0,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\tpfmul     mm1, MMWORD [MMBLOCK(2,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n\tpunpcklwd mm2,mm2\n\tpunpcklwd mm3,mm3\n\tpsrad     mm2,(DWORD_BIT-WORD_BIT)\n\tpsrad     mm3,(DWORD_BIT-WORD_BIT)\n\tpi2fd     mm2,mm2\n\tpi2fd     mm3,mm3\n\n\tpfmul     mm2, MMWORD [MMBLOCK(4,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\tpfmul     mm3, MMWORD [MMBLOCK(6,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n\tmovq\tmm4,mm0\n\tmovq\tmm5,mm1\n\tpfsub\tmm0,mm2\t\t\t; mm0=tmp11\n\tpfsub\tmm1,mm3\n\tpfadd\tmm4,mm2\t\t\t; mm4=tmp10\n\tpfadd\tmm5,mm3\t\t\t; mm5=tmp13\n\n\tpfmul\tmm1,[GOTOFF(ebx,PD_1_414)]\n\tpfsub\tmm1,mm5\t\t\t; mm1=tmp12\n\n\tmovq\tmm6,mm4\n\tmovq\tmm7,mm0\n\tpfsub\tmm4,mm5\t\t\t; mm4=tmp3\n\tpfsub\tmm0,mm1\t\t\t; mm0=tmp2\n\tpfadd\tmm6,mm5\t\t\t; mm6=tmp0\n\tpfadd\tmm7,mm1\t\t\t; mm7=tmp1\n\n\tmovq\tMMWORD [wk(1)], mm4\t; tmp3\n\tmovq\tMMWORD [wk(0)], mm0\t; tmp2\n\n\t; -- Odd part\n\n\tmovd      mm2, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tmovd      mm3, DWORD [DWBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tmovd      mm5, DWORD [DWBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tmovd      mm1, DWORD [DWBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\n\tpunpcklwd mm2,mm2\n\tpunpcklwd mm3,mm3\n\tpsrad     mm2,(DWORD_BIT-WORD_BIT)\n\tpsrad     mm3,(DWORD_BIT-WORD_BIT)\n\tpi2fd     mm2,mm2\n\tpi2fd     mm3,mm3\n\n\tpfmul     mm2, MMWORD [MMBLOCK(1,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\tpfmul     mm3, MMWORD [MMBLOCK(3,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n\tpunpcklwd mm5,mm5\n\tpunpcklwd mm1,mm1\n\tpsrad     mm5,(DWORD_BIT-WORD_BIT)\n\tpsrad     mm1,(DWORD_BIT-WORD_BIT)\n\tpi2fd     mm5,mm5\n\tpi2fd     mm1,mm1\n\n\tpfmul     mm5, MMWORD [MMBLOCK(5,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\tpfmul     mm1, MMWORD [MMBLOCK(7,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n\tmovq\tmm4,mm2\n\tmovq\tmm0,mm5\n\tpfadd\tmm2,mm1\t\t\t; mm2=z11\n\tpfadd\tmm5,mm3\t\t\t; mm5=z13\n\tpfsub\tmm4,mm1\t\t\t; mm4=z12\n\tpfsub\tmm0,mm3\t\t\t; mm0=z10\n\n\tmovq\tmm1,mm2\n\tpfsub\tmm2,mm5\n\tpfadd\tmm1,mm5\t\t\t; mm1=tmp7\n\n\tpfmul\tmm2,[GOTOFF(ebx,PD_1_414)]\t; mm2=tmp11\n\n\tmovq\tmm3,mm0\n\tpfadd\tmm0,mm4\n\tpfmul\tmm0,[GOTOFF(ebx,PD_1_847)]\t; mm0=z5\n\tpfmul\tmm3,[GOTOFF(ebx,PD_2_613)]\t; mm3=(z10 * 2.613125930)\n\tpfmul\tmm4,[GOTOFF(ebx,PD_1_082)]\t; mm4=(z12 * 1.082392200)\n\tpfsubr\tmm3,mm0\t\t\t; mm3=tmp12\n\tpfsub\tmm4,mm0\t\t\t; mm4=tmp10\n\n\t; -- Final output stage\n\n\tpfsub\tmm3,mm1\t\t\t; mm3=tmp6\n\tmovq\tmm5,mm6\n\tmovq\tmm0,mm7\n\tpfadd\tmm6,mm1\t\t\t; mm6=data0=(00 01)\n\tpfadd\tmm7,mm3\t\t\t; mm7=data1=(10 11)\n\tpfsub\tmm5,mm1\t\t\t; mm5=data7=(70 71)\n\tpfsub\tmm0,mm3\t\t\t; mm0=data6=(60 61)\n\tpfsub\tmm2,mm3\t\t\t; mm2=tmp5\n\n\tmovq      mm1,mm6\t\t; transpose coefficients\n\tpunpckldq mm6,mm7\t\t; mm6=(00 10)\n\tpunpckhdq mm1,mm7\t\t; mm1=(01 11)\n\tmovq      mm3,mm0\t\t; transpose coefficients\n\tpunpckldq mm0,mm5\t\t; mm0=(60 70)\n\tpunpckhdq mm3,mm5\t\t; mm3=(61 71)\n\n\tmovq\tMMWORD [MMBLOCK(0,0,edi,SIZEOF_FAST_FLOAT)], mm6\n\tmovq\tMMWORD [MMBLOCK(1,0,edi,SIZEOF_FAST_FLOAT)], mm1\n\tmovq\tMMWORD [MMBLOCK(0,3,edi,SIZEOF_FAST_FLOAT)], mm0\n\tmovq\tMMWORD [MMBLOCK(1,3,edi,SIZEOF_FAST_FLOAT)], mm3\n\n\tmovq\tmm7, MMWORD [wk(0)]\t; mm7=tmp2\n\tmovq\tmm5, MMWORD [wk(1)]\t; mm5=tmp3\n\n\tpfadd\tmm4,mm2\t\t\t; mm4=tmp4\n\tmovq\tmm6,mm7\n\tmovq\tmm1,mm5\n\tpfadd\tmm7,mm2\t\t\t; mm7=data2=(20 21)\n\tpfadd\tmm5,mm4\t\t\t; mm5=data4=(40 41)\n\tpfsub\tmm6,mm2\t\t\t; mm6=data5=(50 51)\n\tpfsub\tmm1,mm4\t\t\t; mm1=data3=(30 31)\n\n\tmovq      mm0,mm7\t\t; transpose coefficients\n\tpunpckldq mm7,mm1\t\t; mm7=(20 30)\n\tpunpckhdq mm0,mm1\t\t; mm0=(21 31)\n\tmovq      mm3,mm5\t\t; transpose coefficients\n\tpunpckldq mm5,mm6\t\t; mm5=(40 50)\n\tpunpckhdq mm3,mm6\t\t; mm3=(41 51)\n\n\tmovq\tMMWORD [MMBLOCK(0,1,edi,SIZEOF_FAST_FLOAT)], mm7\n\tmovq\tMMWORD [MMBLOCK(1,1,edi,SIZEOF_FAST_FLOAT)], mm0\n\tmovq\tMMWORD [MMBLOCK(0,2,edi,SIZEOF_FAST_FLOAT)], mm5\n\tmovq\tMMWORD [MMBLOCK(1,2,edi,SIZEOF_FAST_FLOAT)], mm3\n\n.nextcolumn:\n\tadd\tesi, byte 2*SIZEOF_JCOEF\t\t; coef_block\n\tadd\tedx, byte 2*SIZEOF_FLOAT_MULT_TYPE\t; quantptr\n\tadd\tedi, byte 2*DCTSIZE*SIZEOF_FAST_FLOAT\t; wsptr\n\tdec\tecx\t\t\t\t\t; ctr\n\tjnz\tnear .columnloop\n\n\t; -- Prefetch the next coefficient block\n\n\tprefetch [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 0*32]\n\tprefetch [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 1*32]\n\tprefetch [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 2*32]\n\tprefetch [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 3*32]\n\n\t; ---- Pass 2: process rows from work array, store into output array.\n\n\tmov\teax, [original_ebp]\n\tlea\tesi, [workspace]\t\t\t; FAST_FLOAT * wsptr\n\tmov\tedi, JSAMPARRAY [output_buf(eax)]\t; (JSAMPROW *)\n\tmov\teax, JDIMENSION [output_col(eax)]\n\tmov\tecx, DCTSIZE/2\t\t\t\t; ctr\n\talignx\t16,7\n.rowloop:\n\n\t; -- Even part\n\n\tmovq\tmm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm1, MMWORD [MMBLOCK(2,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm2, MMWORD [MMBLOCK(4,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm3, MMWORD [MMBLOCK(6,0,esi,SIZEOF_FAST_FLOAT)]\n\n\tmovq\tmm4,mm0\n\tmovq\tmm5,mm1\n\tpfsub\tmm0,mm2\t\t\t; mm0=tmp11\n\tpfsub\tmm1,mm3\n\tpfadd\tmm4,mm2\t\t\t; mm4=tmp10\n\tpfadd\tmm5,mm3\t\t\t; mm5=tmp13\n\n\tpfmul\tmm1,[GOTOFF(ebx,PD_1_414)]\n\tpfsub\tmm1,mm5\t\t\t; mm1=tmp12\n\n\tmovq\tmm6,mm4\n\tmovq\tmm7,mm0\n\tpfsub\tmm4,mm5\t\t\t; mm4=tmp3\n\tpfsub\tmm0,mm1\t\t\t; mm0=tmp2\n\tpfadd\tmm6,mm5\t\t\t; mm6=tmp0\n\tpfadd\tmm7,mm1\t\t\t; mm7=tmp1\n\n\tmovq\tMMWORD [wk(1)], mm4\t; tmp3\n\tmovq\tMMWORD [wk(0)], mm0\t; tmp2\n\n\t; -- Odd part\n\n\tmovq\tmm2, MMWORD [MMBLOCK(1,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm3, MMWORD [MMBLOCK(3,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm5, MMWORD [MMBLOCK(5,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovq\tmm1, MMWORD [MMBLOCK(7,0,esi,SIZEOF_FAST_FLOAT)]\n\n\tmovq\tmm4,mm2\n\tmovq\tmm0,mm5\n\tpfadd\tmm2,mm1\t\t\t; mm2=z11\n\tpfadd\tmm5,mm3\t\t\t; mm5=z13\n\tpfsub\tmm4,mm1\t\t\t; mm4=z12\n\tpfsub\tmm0,mm3\t\t\t; mm0=z10\n\n\tmovq\tmm1,mm2\n\tpfsub\tmm2,mm5\n\tpfadd\tmm1,mm5\t\t\t; mm1=tmp7\n\n\tpfmul\tmm2,[GOTOFF(ebx,PD_1_414)]\t; mm2=tmp11\n\n\tmovq\tmm3,mm0\n\tpfadd\tmm0,mm4\n\tpfmul\tmm0,[GOTOFF(ebx,PD_1_847)]\t; mm0=z5\n\tpfmul\tmm3,[GOTOFF(ebx,PD_2_613)]\t; mm3=(z10 * 2.613125930)\n\tpfmul\tmm4,[GOTOFF(ebx,PD_1_082)]\t; mm4=(z12 * 1.082392200)\n\tpfsubr\tmm3,mm0\t\t\t; mm3=tmp12\n\tpfsub\tmm4,mm0\t\t\t; mm4=tmp10\n\n\t; -- Final output stage\n\n\tpfsub\tmm3,mm1\t\t\t; mm3=tmp6\n\tmovq\tmm5,mm6\n\tmovq\tmm0,mm7\n\tpfadd\tmm6,mm1\t\t\t; mm6=data0=(00 10)\n\tpfadd\tmm7,mm3\t\t\t; mm7=data1=(01 11)\n\tpfsub\tmm5,mm1\t\t\t; mm5=data7=(07 17)\n\tpfsub\tmm0,mm3\t\t\t; mm0=data6=(06 16)\n\tpfsub\tmm2,mm3\t\t\t; mm2=tmp5\n\n\tmovq\tmm1,[GOTOFF(ebx,PD_RNDINT_MAGIC)]\t; mm1=[PD_RNDINT_MAGIC]\n\tpcmpeqd\tmm3,mm3\n\tpsrld\tmm3,WORD_BIT\t\t; mm3={0xFFFF 0x0000 0xFFFF 0x0000}\n\n\tpfadd\tmm6,mm1\t\t\t; mm6=roundint(data0/8)=(00 ** 10 **)\n\tpfadd\tmm7,mm1\t\t\t; mm7=roundint(data1/8)=(01 ** 11 **)\n\tpfadd\tmm0,mm1\t\t\t; mm0=roundint(data6/8)=(06 ** 16 **)\n\tpfadd\tmm5,mm1\t\t\t; mm5=roundint(data7/8)=(07 ** 17 **)\n\n\tpand\tmm6,mm3\t\t\t; mm6=(00 -- 10 --)\n\tpslld\tmm7,WORD_BIT\t\t; mm7=(-- 01 -- 11)\n\tpand\tmm0,mm3\t\t\t; mm0=(06 -- 16 --)\n\tpslld\tmm5,WORD_BIT\t\t; mm5=(-- 07 -- 17)\n\tpor\tmm6,mm7\t\t\t; mm6=(00 01 10 11)\n\tpor\tmm0,mm5\t\t\t; mm0=(06 07 16 17)\n\n\tmovq\tmm1, MMWORD [wk(0)]\t; mm1=tmp2\n\tmovq\tmm3, MMWORD [wk(1)]\t; mm3=tmp3\n\n\tpfadd\tmm4,mm2\t\t\t; mm4=tmp4\n\tmovq\tmm7,mm1\n\tmovq\tmm5,mm3\n\tpfadd\tmm1,mm2\t\t\t; mm1=data2=(02 12)\n\tpfadd\tmm3,mm4\t\t\t; mm3=data4=(04 14)\n\tpfsub\tmm7,mm2\t\t\t; mm7=data5=(05 15)\n\tpfsub\tmm5,mm4\t\t\t; mm5=data3=(03 13)\n\n\tmovq\tmm2,[GOTOFF(ebx,PD_RNDINT_MAGIC)]\t; mm2=[PD_RNDINT_MAGIC]\n\tpcmpeqd\tmm4,mm4\n\tpsrld\tmm4,WORD_BIT\t\t; mm4={0xFFFF 0x0000 0xFFFF 0x0000}\n\n\tpfadd\tmm3,mm2\t\t\t; mm3=roundint(data4/8)=(04 ** 14 **)\n\tpfadd\tmm7,mm2\t\t\t; mm7=roundint(data5/8)=(05 ** 15 **)\n\tpfadd\tmm1,mm2\t\t\t; mm1=roundint(data2/8)=(02 ** 12 **)\n\tpfadd\tmm5,mm2\t\t\t; mm5=roundint(data3/8)=(03 ** 13 **)\n\n\tpand\tmm3,mm4\t\t\t; mm3=(04 -- 14 --)\n\tpslld\tmm7,WORD_BIT\t\t; mm7=(-- 05 -- 15)\n\tpand\tmm1,mm4\t\t\t; mm1=(02 -- 12 --)\n\tpslld\tmm5,WORD_BIT\t\t; mm5=(-- 03 -- 13)\n\tpor\tmm3,mm7\t\t\t; mm3=(04 05 14 15)\n\tpor\tmm1,mm5\t\t\t; mm1=(02 03 12 13)\n\n\tmovq      mm2,[GOTOFF(ebx,PB_CENTERJSAMP)]\t; mm2=[PB_CENTERJSAMP]\n\n\tpacksswb  mm6,mm3\t\t; mm6=(00 01 10 11 04 05 14 15)\n\tpacksswb  mm1,mm0\t\t; mm1=(02 03 12 13 06 07 16 17)\n\tpaddb     mm6,mm2\n\tpaddb     mm1,mm2\n\n\tmovq      mm4,mm6\t\t; transpose coefficients(phase 2)\n\tpunpcklwd mm6,mm1\t\t; mm6=(00 01 02 03 10 11 12 13)\n\tpunpckhwd mm4,mm1\t\t; mm4=(04 05 06 07 14 15 16 17)\n\n\tmovq      mm7,mm6\t\t; transpose coefficients(phase 3)\n\tpunpckldq mm6,mm4\t\t; mm6=(00 01 02 03 04 05 06 07)\n\tpunpckhdq mm7,mm4\t\t; mm7=(10 11 12 13 14 15 16 17)\n\n\tpushpic\tebx\t\t\t; save GOT address\n\n\tmov\tedx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\n\tmov\tebx, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\n\tmovq\tMMWORD [edx+eax*SIZEOF_JSAMPLE], mm6\n\tmovq\tMMWORD [ebx+eax*SIZEOF_JSAMPLE], mm7\n\n\tpoppic\tebx\t\t\t; restore GOT address\n\n\tadd\tesi, byte 2*SIZEOF_FAST_FLOAT\t; wsptr\n\tadd\tedi, byte 2*SIZEOF_JSAMPROW\n\tdec\tecx\t\t\t\t; ctr\n\tjnz\tnear .rowloop\n\n\tfemms\t\t; empty MMX/3DNow! state\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jimmxfst.asm",
    "content": ";\n; jimmxfst.asm - fast integer IDCT (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a fast, not so accurate integer implementation of\n; the inverse DCT (Discrete Cosine Transform). The following code is\n; based directly on the IJG's original jidctfst.c; see the jidctfst.c\n; for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS\t8\t; 14 is also OK.\n%define PASS1_BITS\t2\n\n%if IFAST_SCALE_BITS != PASS1_BITS\n%error \"'IFAST_SCALE_BITS' must be equal to 'PASS1_BITS'.\"\n%endif\n\n%if CONST_BITS == 8\nF_1_082\tequ\t277\t\t; FIX(1.082392200)\nF_1_414\tequ\t362\t\t; FIX(1.414213562)\nF_1_847\tequ\t473\t\t; FIX(1.847759065)\nF_2_613\tequ\t669\t\t; FIX(2.613125930)\nF_1_613\tequ\t(F_2_613 - 256)\t; FIX(2.613125930) - FIX(1)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define\tDESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_1_082\tequ\tDESCALE(1162209775,30-CONST_BITS)\t; FIX(1.082392200)\nF_1_414\tequ\tDESCALE(1518500249,30-CONST_BITS)\t; FIX(1.414213562)\nF_1_847\tequ\tDESCALE(1984016188,30-CONST_BITS)\t; FIX(1.847759065)\nF_2_613\tequ\tDESCALE(2805822602,30-CONST_BITS)\t; FIX(2.613125930)\nF_1_613\tequ\t(F_2_613 - (1 << CONST_BITS))\t; FIX(2.613125930) - FIX(1)\n%endif\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n; PRE_MULTIPLY_SCALE_BITS <= 2 (to avoid overflow)\n; CONST_BITS + CONST_SHIFT + PRE_MULTIPLY_SCALE_BITS == 16 (for pmulhw)\n\n%define PRE_MULTIPLY_SCALE_BITS   2\n%define CONST_SHIFT     (16 - PRE_MULTIPLY_SCALE_BITS - CONST_BITS)\n\n\talignz\t16\n\tglobal\tEXTN(jconst_idct_ifast_mmx)\n\nEXTN(jconst_idct_ifast_mmx):\n\nPW_F1414\ttimes 4 dw  F_1_414 << CONST_SHIFT\nPW_F1847\ttimes 4 dw  F_1_847 << CONST_SHIFT\nPW_MF1613\ttimes 4 dw -F_1_613 << CONST_SHIFT\nPW_F1082\ttimes 4 dw  F_1_082 << CONST_SHIFT\nPB_CENTERJSAMP\ttimes 8 db  CENTERJSAMPLE\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Perform dequantization and inverse DCT on one block of coefficients.\n;\n; GLOBAL(void)\n; jsimd_idct_ifast_mmx (void * dct_table, JCOEFPTR coef_block,\n;                       JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n%define dct_table(b)\t(b)+8\t\t\t; jpeg_component_info * compptr\n%define coef_block(b)\t(b)+12\t\t; JCOEFPTR coef_block\n%define output_buf(b)\t(b)+16\t\t; JSAMPARRAY output_buf\n%define output_col(b)\t(b)+20\t\t; JDIMENSION output_col\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_MMWORD\t; mmword wk[WK_NUM]\n%define WK_NUM\t\t2\n%define workspace\twk(0)-DCTSIZE2*SIZEOF_JCOEF\n\t\t\t\t\t; JCOEF workspace[DCTSIZE2]\n\n\talign\t16\n\tglobal\tEXTN(jsimd_idct_ifast_mmx)\n\nEXTN(jsimd_idct_ifast_mmx):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_MMWORD)\t; align to 64 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [workspace]\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t; get GOT address\n\n\t; ---- Pass 1: process columns from input, store into work array.\n\n;\tmov\teax, [original_ebp]\n\tmov\tedx, POINTER [dct_table(eax)]\t; quantptr\n\tmov\tesi, JCOEFPTR [coef_block(eax)]\t\t; inptr\n\tlea\tedi, [workspace]\t\t\t; JCOEF * wsptr\n\tmov\tecx, DCTSIZE/4\t\t\t\t; ctr\n\talignx\t16,7\n.columnloop:\n%ifndef NO_ZERO_COLUMN_TEST_IFAST_MMX\n\tmov\teax, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tor\teax, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tjnz\tshort .columnDCT\n\n\tmovq\tmm0, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm1, MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm0, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm1, MMWORD [MMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm0, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm1, MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm0, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm1,mm0\n\tpacksswb mm1,mm1\n\tmovd\teax,mm1\n\ttest\teax,eax\n\tjnz\tshort .columnDCT\n\n\t; -- AC terms all zero\n\n\tmovq\tmm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\tpmullw\tmm0, MMWORD [MMBLOCK(0,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n\n\tmovq      mm2,mm0\t\t; mm0=in0=(00 01 02 03)\n\tpunpcklwd mm0,mm0\t\t; mm0=(00 00 01 01)\n\tpunpckhwd mm2,mm2\t\t; mm2=(02 02 03 03)\n\n\tmovq      mm1,mm0\n\tpunpckldq mm0,mm0\t\t; mm0=(00 00 00 00)\n\tpunpckhdq mm1,mm1\t\t; mm1=(01 01 01 01)\n\tmovq      mm3,mm2\n\tpunpckldq mm2,mm2\t\t; mm2=(02 02 02 02)\n\tpunpckhdq mm3,mm3\t\t; mm3=(03 03 03 03)\n\n\tmovq\tMMWORD [MMBLOCK(0,0,edi,SIZEOF_JCOEF)], mm0\n\tmovq\tMMWORD [MMBLOCK(0,1,edi,SIZEOF_JCOEF)], mm0\n\tmovq\tMMWORD [MMBLOCK(1,0,edi,SIZEOF_JCOEF)], mm1\n\tmovq\tMMWORD [MMBLOCK(1,1,edi,SIZEOF_JCOEF)], mm1\n\tmovq\tMMWORD [MMBLOCK(2,0,edi,SIZEOF_JCOEF)], mm2\n\tmovq\tMMWORD [MMBLOCK(2,1,edi,SIZEOF_JCOEF)], mm2\n\tmovq\tMMWORD [MMBLOCK(3,0,edi,SIZEOF_JCOEF)], mm3\n\tmovq\tMMWORD [MMBLOCK(3,1,edi,SIZEOF_JCOEF)], mm3\n\tjmp\tnear .nextcolumn\n\talignx\t16,7\n%endif\n.columnDCT:\n\n\t; -- Even part\n\n\tmovq\tmm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm1, MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tpmullw\tmm0, MMWORD [MMBLOCK(0,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n\tpmullw\tmm1, MMWORD [MMBLOCK(2,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n\tmovq\tmm2, MMWORD [MMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm3, MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\tpmullw\tmm2, MMWORD [MMBLOCK(4,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n\tpmullw\tmm3, MMWORD [MMBLOCK(6,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n\n\tmovq\tmm4,mm0\n\tmovq\tmm5,mm1\n\tpsubw\tmm0,mm2\t\t\t; mm0=tmp11\n\tpsubw\tmm1,mm3\n\tpaddw\tmm4,mm2\t\t\t; mm4=tmp10\n\tpaddw\tmm5,mm3\t\t\t; mm5=tmp13\n\n\tpsllw\tmm1,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\tmm1,[GOTOFF(ebx,PW_F1414)]\n\tpsubw\tmm1,mm5\t\t\t; mm1=tmp12\n\n\tmovq\tmm6,mm4\n\tmovq\tmm7,mm0\n\tpsubw\tmm4,mm5\t\t\t; mm4=tmp3\n\tpsubw\tmm0,mm1\t\t\t; mm0=tmp2\n\tpaddw\tmm6,mm5\t\t\t; mm6=tmp0\n\tpaddw\tmm7,mm1\t\t\t; mm7=tmp1\n\n\tmovq\tMMWORD [wk(1)], mm4\t; wk(1)=tmp3\n\tmovq\tMMWORD [wk(0)], mm0\t; wk(0)=tmp2\n\n\t; -- Odd part\n\n\tmovq\tmm2, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm3, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tpmullw\tmm2, MMWORD [MMBLOCK(1,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n\tpmullw\tmm3, MMWORD [MMBLOCK(3,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n\tmovq\tmm5, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm1, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\tpmullw\tmm5, MMWORD [MMBLOCK(5,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n\tpmullw\tmm1, MMWORD [MMBLOCK(7,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n\n\tmovq\tmm4,mm2\n\tmovq\tmm0,mm5\n\tpsubw\tmm2,mm1\t\t\t; mm2=z12\n\tpsubw\tmm5,mm3\t\t\t; mm5=z10\n\tpaddw\tmm4,mm1\t\t\t; mm4=z11\n\tpaddw\tmm0,mm3\t\t\t; mm0=z13\n\n\tmovq\tmm1,mm5\t\t\t; mm1=z10(unscaled)\n\tpsllw\tmm2,PRE_MULTIPLY_SCALE_BITS\n\tpsllw\tmm5,PRE_MULTIPLY_SCALE_BITS\n\n\tmovq\tmm3,mm4\n\tpsubw\tmm4,mm0\n\tpaddw\tmm3,mm0\t\t\t; mm3=tmp7\n\n\tpsllw\tmm4,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\tmm4,[GOTOFF(ebx,PW_F1414)]\t; mm4=tmp11\n\n\t; To avoid overflow...\n\t;\n\t; (Original)\n\t; tmp12 = -2.613125930 * z10 + z5;\n\t;\n\t; (This implementation)\n\t; tmp12 = (-1.613125930 - 1) * z10 + z5;\n\t;       = -1.613125930 * z10 - z10 + z5;\n\n\tmovq\tmm0,mm5\n\tpaddw\tmm5,mm2\n\tpmulhw\tmm5,[GOTOFF(ebx,PW_F1847)]\t; mm5=z5\n\tpmulhw\tmm0,[GOTOFF(ebx,PW_MF1613)]\n\tpmulhw\tmm2,[GOTOFF(ebx,PW_F1082)]\n\tpsubw\tmm0,mm1\n\tpsubw\tmm2,mm5\t\t\t; mm2=tmp10\n\tpaddw\tmm0,mm5\t\t\t; mm0=tmp12\n\n\t; -- Final output stage\n\n\tpsubw\tmm0,mm3\t\t\t; mm0=tmp6\n\tmovq\tmm1,mm6\n\tmovq\tmm5,mm7\n\tpaddw\tmm6,mm3\t\t\t; mm6=data0=(00 01 02 03)\n\tpaddw\tmm7,mm0\t\t\t; mm7=data1=(10 11 12 13)\n\tpsubw\tmm1,mm3\t\t\t; mm1=data7=(70 71 72 73)\n\tpsubw\tmm5,mm0\t\t\t; mm5=data6=(60 61 62 63)\n\tpsubw\tmm4,mm0\t\t\t; mm4=tmp5\n\n\tmovq      mm3,mm6\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm6,mm7\t\t; mm6=(00 10 01 11)\n\tpunpckhwd mm3,mm7\t\t; mm3=(02 12 03 13)\n\tmovq      mm0,mm5\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm5,mm1\t\t; mm5=(60 70 61 71)\n\tpunpckhwd mm0,mm1\t\t; mm0=(62 72 63 73)\n\n\tmovq\tmm7, MMWORD [wk(0)]\t; mm7=tmp2\n\tmovq\tmm1, MMWORD [wk(1)]\t; mm1=tmp3\n\n\tmovq\tMMWORD [wk(0)], mm5\t; wk(0)=(60 70 61 71)\n\tmovq\tMMWORD [wk(1)], mm0\t; wk(1)=(62 72 63 73)\n\n\tpaddw\tmm2,mm4\t\t\t; mm2=tmp4\n\tmovq\tmm5,mm7\n\tmovq\tmm0,mm1\n\tpaddw\tmm7,mm4\t\t\t; mm7=data2=(20 21 22 23)\n\tpaddw\tmm1,mm2\t\t\t; mm1=data4=(40 41 42 43)\n\tpsubw\tmm5,mm4\t\t\t; mm5=data5=(50 51 52 53)\n\tpsubw\tmm0,mm2\t\t\t; mm0=data3=(30 31 32 33)\n\n\tmovq      mm4,mm7\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm7,mm0\t\t; mm7=(20 30 21 31)\n\tpunpckhwd mm4,mm0\t\t; mm4=(22 32 23 33)\n\tmovq      mm2,mm1\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm1,mm5\t\t; mm1=(40 50 41 51)\n\tpunpckhwd mm2,mm5\t\t; mm2=(42 52 43 53)\n\n\tmovq      mm0,mm6\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm6,mm7\t\t; mm6=(00 10 20 30)\n\tpunpckhdq mm0,mm7\t\t; mm0=(01 11 21 31)\n\tmovq      mm5,mm3\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm3,mm4\t\t; mm3=(02 12 22 32)\n\tpunpckhdq mm5,mm4\t\t; mm5=(03 13 23 33)\n\n\tmovq\tmm7, MMWORD [wk(0)]\t; mm7=(60 70 61 71)\n\tmovq\tmm4, MMWORD [wk(1)]\t; mm4=(62 72 63 73)\n\n\tmovq\tMMWORD [MMBLOCK(0,0,edi,SIZEOF_JCOEF)], mm6\n\tmovq\tMMWORD [MMBLOCK(1,0,edi,SIZEOF_JCOEF)], mm0\n\tmovq\tMMWORD [MMBLOCK(2,0,edi,SIZEOF_JCOEF)], mm3\n\tmovq\tMMWORD [MMBLOCK(3,0,edi,SIZEOF_JCOEF)], mm5\n\n\tmovq      mm6,mm1\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm1,mm7\t\t; mm1=(40 50 60 70)\n\tpunpckhdq mm6,mm7\t\t; mm6=(41 51 61 71)\n\tmovq      mm0,mm2\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm2,mm4\t\t; mm2=(42 52 62 72)\n\tpunpckhdq mm0,mm4\t\t; mm0=(43 53 63 73)\n\n\tmovq\tMMWORD [MMBLOCK(0,1,edi,SIZEOF_JCOEF)], mm1\n\tmovq\tMMWORD [MMBLOCK(1,1,edi,SIZEOF_JCOEF)], mm6\n\tmovq\tMMWORD [MMBLOCK(2,1,edi,SIZEOF_JCOEF)], mm2\n\tmovq\tMMWORD [MMBLOCK(3,1,edi,SIZEOF_JCOEF)], mm0\n\n.nextcolumn:\n\tadd\tesi, byte 4*SIZEOF_JCOEF\t\t; coef_block\n\tadd\tedx, byte 4*SIZEOF_IFAST_MULT_TYPE\t; quantptr\n\tadd\tedi, byte 4*DCTSIZE*SIZEOF_JCOEF\t; wsptr\n\tdec\tecx\t\t\t\t\t; ctr\n\tjnz\tnear .columnloop\n\n\t; ---- Pass 2: process rows from work array, store into output array.\n\n\tmov\teax, [original_ebp]\n\tlea\tesi, [workspace]\t\t\t; JCOEF * wsptr\n\tmov\tedi, JSAMPARRAY [output_buf(eax)]\t; (JSAMPROW *)\n\tmov\teax, JDIMENSION [output_col(eax)]\n\tmov\tecx, DCTSIZE/4\t\t\t\t; ctr\n\talignx\t16,7\n.rowloop:\n\n\t; -- Even part\n\n\tmovq\tmm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm1, MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm2, MMWORD [MMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm3, MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\n\tmovq\tmm4,mm0\n\tmovq\tmm5,mm1\n\tpsubw\tmm0,mm2\t\t\t; mm0=tmp11\n\tpsubw\tmm1,mm3\n\tpaddw\tmm4,mm2\t\t\t; mm4=tmp10\n\tpaddw\tmm5,mm3\t\t\t; mm5=tmp13\n\n\tpsllw\tmm1,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\tmm1,[GOTOFF(ebx,PW_F1414)]\n\tpsubw\tmm1,mm5\t\t\t; mm1=tmp12\n\n\tmovq\tmm6,mm4\n\tmovq\tmm7,mm0\n\tpsubw\tmm4,mm5\t\t\t; mm4=tmp3\n\tpsubw\tmm0,mm1\t\t\t; mm0=tmp2\n\tpaddw\tmm6,mm5\t\t\t; mm6=tmp0\n\tpaddw\tmm7,mm1\t\t\t; mm7=tmp1\n\n\tmovq\tMMWORD [wk(1)], mm4\t; wk(1)=tmp3\n\tmovq\tMMWORD [wk(0)], mm0\t; wk(0)=tmp2\n\n\t; -- Odd part\n\n\tmovq\tmm2, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm3, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm5, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm1, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\n\tmovq\tmm4,mm2\n\tmovq\tmm0,mm5\n\tpsubw\tmm2,mm1\t\t\t; mm2=z12\n\tpsubw\tmm5,mm3\t\t\t; mm5=z10\n\tpaddw\tmm4,mm1\t\t\t; mm4=z11\n\tpaddw\tmm0,mm3\t\t\t; mm0=z13\n\n\tmovq\tmm1,mm5\t\t\t; mm1=z10(unscaled)\n\tpsllw\tmm2,PRE_MULTIPLY_SCALE_BITS\n\tpsllw\tmm5,PRE_MULTIPLY_SCALE_BITS\n\n\tmovq\tmm3,mm4\n\tpsubw\tmm4,mm0\n\tpaddw\tmm3,mm0\t\t\t; mm3=tmp7\n\n\tpsllw\tmm4,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\tmm4,[GOTOFF(ebx,PW_F1414)]\t; mm4=tmp11\n\n\t; To avoid overflow...\n\t;\n\t; (Original)\n\t; tmp12 = -2.613125930 * z10 + z5;\n\t;\n\t; (This implementation)\n\t; tmp12 = (-1.613125930 - 1) * z10 + z5;\n\t;       = -1.613125930 * z10 - z10 + z5;\n\n\tmovq\tmm0,mm5\n\tpaddw\tmm5,mm2\n\tpmulhw\tmm5,[GOTOFF(ebx,PW_F1847)]\t; mm5=z5\n\tpmulhw\tmm0,[GOTOFF(ebx,PW_MF1613)]\n\tpmulhw\tmm2,[GOTOFF(ebx,PW_F1082)]\n\tpsubw\tmm0,mm1\n\tpsubw\tmm2,mm5\t\t\t; mm2=tmp10\n\tpaddw\tmm0,mm5\t\t\t; mm0=tmp12\n\n\t; -- Final output stage\n\n\tpsubw\tmm0,mm3\t\t\t; mm0=tmp6\n\tmovq\tmm1,mm6\n\tmovq\tmm5,mm7\n\tpaddw\tmm6,mm3\t\t\t; mm6=data0=(00 10 20 30)\n\tpaddw\tmm7,mm0\t\t\t; mm7=data1=(01 11 21 31)\n\tpsraw\tmm6,(PASS1_BITS+3)\t; descale\n\tpsraw\tmm7,(PASS1_BITS+3)\t; descale\n\tpsubw\tmm1,mm3\t\t\t; mm1=data7=(07 17 27 37)\n\tpsubw\tmm5,mm0\t\t\t; mm5=data6=(06 16 26 36)\n\tpsraw\tmm1,(PASS1_BITS+3)\t; descale\n\tpsraw\tmm5,(PASS1_BITS+3)\t; descale\n\tpsubw\tmm4,mm0\t\t\t; mm4=tmp5\n\n\tpacksswb  mm6,mm5\t\t; mm6=(00 10 20 30 06 16 26 36)\n\tpacksswb  mm7,mm1\t\t; mm7=(01 11 21 31 07 17 27 37)\n\n\tmovq\tmm3, MMWORD [wk(0)]\t; mm3=tmp2\n\tmovq\tmm0, MMWORD [wk(1)]\t; mm0=tmp3\n\n\tpaddw\tmm2,mm4\t\t\t; mm2=tmp4\n\tmovq\tmm5,mm3\n\tmovq\tmm1,mm0\n\tpaddw\tmm3,mm4\t\t\t; mm3=data2=(02 12 22 32)\n\tpaddw\tmm0,mm2\t\t\t; mm0=data4=(04 14 24 34)\n\tpsraw\tmm3,(PASS1_BITS+3)\t; descale\n\tpsraw\tmm0,(PASS1_BITS+3)\t; descale\n\tpsubw\tmm5,mm4\t\t\t; mm5=data5=(05 15 25 35)\n\tpsubw\tmm1,mm2\t\t\t; mm1=data3=(03 13 23 33)\n\tpsraw\tmm5,(PASS1_BITS+3)\t; descale\n\tpsraw\tmm1,(PASS1_BITS+3)\t; descale\n\n\tmovq      mm4,[GOTOFF(ebx,PB_CENTERJSAMP)]\t; mm4=[PB_CENTERJSAMP]\n\n\tpacksswb  mm3,mm0\t\t; mm3=(02 12 22 32 04 14 24 34)\n\tpacksswb  mm1,mm5\t\t; mm1=(03 13 23 33 05 15 25 35)\n\n\tpaddb     mm6,mm4\n\tpaddb     mm7,mm4\n\tpaddb     mm3,mm4\n\tpaddb     mm1,mm4\n\n\tmovq      mm2,mm6\t\t; transpose coefficients(phase 1)\n\tpunpcklbw mm6,mm7\t\t; mm6=(00 01 10 11 20 21 30 31)\n\tpunpckhbw mm2,mm7\t\t; mm2=(06 07 16 17 26 27 36 37)\n\tmovq      mm0,mm3\t\t; transpose coefficients(phase 1)\n\tpunpcklbw mm3,mm1\t\t; mm3=(02 03 12 13 22 23 32 33)\n\tpunpckhbw mm0,mm1\t\t; mm0=(04 05 14 15 24 25 34 35)\n\n\tmovq      mm5,mm6\t\t; transpose coefficients(phase 2)\n\tpunpcklwd mm6,mm3\t\t; mm6=(00 01 02 03 10 11 12 13)\n\tpunpckhwd mm5,mm3\t\t; mm5=(20 21 22 23 30 31 32 33)\n\tmovq      mm4,mm0\t\t; transpose coefficients(phase 2)\n\tpunpcklwd mm0,mm2\t\t; mm0=(04 05 06 07 14 15 16 17)\n\tpunpckhwd mm4,mm2\t\t; mm4=(24 25 26 27 34 35 36 37)\n\n\tmovq      mm7,mm6\t\t; transpose coefficients(phase 3)\n\tpunpckldq mm6,mm0\t\t; mm6=(00 01 02 03 04 05 06 07)\n\tpunpckhdq mm7,mm0\t\t; mm7=(10 11 12 13 14 15 16 17)\n\tmovq      mm1,mm5\t\t; transpose coefficients(phase 3)\n\tpunpckldq mm5,mm4\t\t; mm5=(20 21 22 23 24 25 26 27)\n\tpunpckhdq mm1,mm4\t\t; mm1=(30 31 32 33 34 35 36 37)\n\n\tpushpic\tebx\t\t\t; save GOT address\n\n\tmov\tedx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\n\tmov\tebx, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\n\tmovq\tMMWORD [edx+eax*SIZEOF_JSAMPLE], mm6\n\tmovq\tMMWORD [ebx+eax*SIZEOF_JSAMPLE], mm7\n\tmov\tedx, JSAMPROW [edi+2*SIZEOF_JSAMPROW]\n\tmov\tebx, JSAMPROW [edi+3*SIZEOF_JSAMPROW]\n\tmovq\tMMWORD [edx+eax*SIZEOF_JSAMPLE], mm5\n\tmovq\tMMWORD [ebx+eax*SIZEOF_JSAMPLE], mm1\n\n\tpoppic\tebx\t\t\t; restore GOT address\n\n\tadd\tesi, byte 4*SIZEOF_JCOEF\t; wsptr\n\tadd\tedi, byte 4*SIZEOF_JSAMPROW\n\tdec\tecx\t\t\t\t; ctr\n\tjnz\tnear .rowloop\n\n\temms\t\t; empty MMX state\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jimmxint.asm",
    "content": ";\n; jimmxint.asm - accurate integer IDCT (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a slow-but-accurate integer implementation of the\n; inverse DCT (Discrete Cosine Transform). The following code is based\n; directly on the IJG's original jidctint.c; see the jidctint.c for\n; more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS\t13\n%define PASS1_BITS\t2\n\n%define DESCALE_P1\t(CONST_BITS-PASS1_BITS)\n%define DESCALE_P2\t(CONST_BITS+PASS1_BITS+3)\n\n%if CONST_BITS == 13\nF_0_298\tequ\t 2446\t\t; FIX(0.298631336)\nF_0_390\tequ\t 3196\t\t; FIX(0.390180644)\nF_0_541\tequ\t 4433\t\t; FIX(0.541196100)\nF_0_765\tequ\t 6270\t\t; FIX(0.765366865)\nF_0_899\tequ\t 7373\t\t; FIX(0.899976223)\nF_1_175\tequ\t 9633\t\t; FIX(1.175875602)\nF_1_501\tequ\t12299\t\t; FIX(1.501321110)\nF_1_847\tequ\t15137\t\t; FIX(1.847759065)\nF_1_961\tequ\t16069\t\t; FIX(1.961570560)\nF_2_053\tequ\t16819\t\t; FIX(2.053119869)\nF_2_562\tequ\t20995\t\t; FIX(2.562915447)\nF_3_072\tequ\t25172\t\t; FIX(3.072711026)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_298\tequ\tDESCALE( 320652955,30-CONST_BITS)\t; FIX(0.298631336)\nF_0_390\tequ\tDESCALE( 418953276,30-CONST_BITS)\t; FIX(0.390180644)\nF_0_541\tequ\tDESCALE( 581104887,30-CONST_BITS)\t; FIX(0.541196100)\nF_0_765\tequ\tDESCALE( 821806413,30-CONST_BITS)\t; FIX(0.765366865)\nF_0_899\tequ\tDESCALE( 966342111,30-CONST_BITS)\t; FIX(0.899976223)\nF_1_175\tequ\tDESCALE(1262586813,30-CONST_BITS)\t; FIX(1.175875602)\nF_1_501\tequ\tDESCALE(1612031267,30-CONST_BITS)\t; FIX(1.501321110)\nF_1_847\tequ\tDESCALE(1984016188,30-CONST_BITS)\t; FIX(1.847759065)\nF_1_961\tequ\tDESCALE(2106220350,30-CONST_BITS)\t; FIX(1.961570560)\nF_2_053\tequ\tDESCALE(2204520673,30-CONST_BITS)\t; FIX(2.053119869)\nF_2_562\tequ\tDESCALE(2751909506,30-CONST_BITS)\t; FIX(2.562915447)\nF_3_072\tequ\tDESCALE(3299298341,30-CONST_BITS)\t; FIX(3.072711026)\n%endif\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_idct_islow_mmx)\n\nEXTN(jconst_idct_islow_mmx):\n\nPW_F130_F054\ttimes 2 dw  (F_0_541+F_0_765), F_0_541\nPW_F054_MF130\ttimes 2 dw  F_0_541, (F_0_541-F_1_847)\nPW_MF078_F117\ttimes 2 dw  (F_1_175-F_1_961), F_1_175\nPW_F117_F078\ttimes 2 dw  F_1_175, (F_1_175-F_0_390)\nPW_MF060_MF089\ttimes 2 dw  (F_0_298-F_0_899),-F_0_899\nPW_MF089_F060\ttimes 2 dw -F_0_899, (F_1_501-F_0_899)\nPW_MF050_MF256\ttimes 2 dw  (F_2_053-F_2_562),-F_2_562\nPW_MF256_F050\ttimes 2 dw -F_2_562, (F_3_072-F_2_562)\nPD_DESCALE_P1\ttimes 2 dd  1 << (DESCALE_P1-1)\nPD_DESCALE_P2\ttimes 2 dd  1 << (DESCALE_P2-1)\nPB_CENTERJSAMP\ttimes 8 db  CENTERJSAMPLE\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Perform dequantization and inverse DCT on one block of coefficients.\n;\n; GLOBAL(void)\n; jsimd_idct_islow_mmx (void * dct_table, JCOEFPTR coef_block,\n;                       JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n%define dct_table(b)\t(b)+8\t\t\t; jpeg_component_info * compptr\n%define coef_block(b)\t(b)+12\t\t; JCOEFPTR coef_block\n%define output_buf(b)\t(b)+16\t\t; JSAMPARRAY output_buf\n%define output_col(b)\t(b)+20\t\t; JDIMENSION output_col\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_MMWORD\t; mmword wk[WK_NUM]\n%define WK_NUM\t\t12\n%define workspace\twk(0)-DCTSIZE2*SIZEOF_JCOEF\n\t\t\t\t\t; JCOEF workspace[DCTSIZE2]\n\n\talign\t16\n\tglobal\tEXTN(jsimd_idct_islow_mmx)\n\nEXTN(jsimd_idct_islow_mmx):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_MMWORD)\t; align to 64 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [workspace]\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t; get GOT address\n\n\t; ---- Pass 1: process columns from input, store into work array.\n\n;\tmov\teax, [original_ebp]\n\tmov\tedx, POINTER [dct_table(eax)]\t; quantptr\n\tmov\tesi, JCOEFPTR [coef_block(eax)]\t\t; inptr\n\tlea\tedi, [workspace]\t\t\t; JCOEF * wsptr\n\tmov\tecx, DCTSIZE/4\t\t\t\t; ctr\n\talignx\t16,7\n.columnloop:\n%ifndef NO_ZERO_COLUMN_TEST_ISLOW_MMX\n\tmov\teax, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tor\teax, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tjnz\tshort .columnDCT\n\n\tmovq\tmm0, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm1, MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm0, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm1, MMWORD [MMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm0, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm1, MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm0, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm1,mm0\n\tpacksswb mm1,mm1\n\tmovd\teax,mm1\n\ttest\teax,eax\n\tjnz\tshort .columnDCT\n\n\t; -- AC terms all zero\n\n\tmovq\tmm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\tpmullw\tmm0, MMWORD [MMBLOCK(0,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\tpsllw\tmm0,PASS1_BITS\n\n\tmovq      mm2,mm0\t\t; mm0=in0=(00 01 02 03)\n\tpunpcklwd mm0,mm0\t\t; mm0=(00 00 01 01)\n\tpunpckhwd mm2,mm2\t\t; mm2=(02 02 03 03)\n\n\tmovq      mm1,mm0\n\tpunpckldq mm0,mm0\t\t; mm0=(00 00 00 00)\n\tpunpckhdq mm1,mm1\t\t; mm1=(01 01 01 01)\n\tmovq      mm3,mm2\n\tpunpckldq mm2,mm2\t\t; mm2=(02 02 02 02)\n\tpunpckhdq mm3,mm3\t\t; mm3=(03 03 03 03)\n\n\tmovq\tMMWORD [MMBLOCK(0,0,edi,SIZEOF_JCOEF)], mm0\n\tmovq\tMMWORD [MMBLOCK(0,1,edi,SIZEOF_JCOEF)], mm0\n\tmovq\tMMWORD [MMBLOCK(1,0,edi,SIZEOF_JCOEF)], mm1\n\tmovq\tMMWORD [MMBLOCK(1,1,edi,SIZEOF_JCOEF)], mm1\n\tmovq\tMMWORD [MMBLOCK(2,0,edi,SIZEOF_JCOEF)], mm2\n\tmovq\tMMWORD [MMBLOCK(2,1,edi,SIZEOF_JCOEF)], mm2\n\tmovq\tMMWORD [MMBLOCK(3,0,edi,SIZEOF_JCOEF)], mm3\n\tmovq\tMMWORD [MMBLOCK(3,1,edi,SIZEOF_JCOEF)], mm3\n\tjmp\tnear .nextcolumn\n\talignx\t16,7\n%endif\n.columnDCT:\n\n\t; -- Even part\n\n\tmovq\tmm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm1, MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tpmullw\tmm0, MMWORD [MMBLOCK(0,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\tmm1, MMWORD [MMBLOCK(2,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tmovq\tmm2, MMWORD [MMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm3, MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\tpmullw\tmm2, MMWORD [MMBLOCK(4,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\tmm3, MMWORD [MMBLOCK(6,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\t; (Original)\n\t; z1 = (z2 + z3) * 0.541196100;\n\t; tmp2 = z1 + z3 * -1.847759065;\n\t; tmp3 = z1 + z2 * 0.765366865;\n\t;\n\t; (This implementation)\n\t; tmp2 = z2 * 0.541196100 + z3 * (0.541196100 - 1.847759065);\n\t; tmp3 = z2 * (0.541196100 + 0.765366865) + z3 * 0.541196100;\n\n\tmovq      mm4,mm1\t\t; mm1=in2=z2\n\tmovq      mm5,mm1\n\tpunpcklwd mm4,mm3\t\t; mm3=in6=z3\n\tpunpckhwd mm5,mm3\n\tmovq      mm1,mm4\n\tmovq      mm3,mm5\n\tpmaddwd   mm4,[GOTOFF(ebx,PW_F130_F054)]\t; mm4=tmp3L\n\tpmaddwd   mm5,[GOTOFF(ebx,PW_F130_F054)]\t; mm5=tmp3H\n\tpmaddwd   mm1,[GOTOFF(ebx,PW_F054_MF130)]\t; mm1=tmp2L\n\tpmaddwd   mm3,[GOTOFF(ebx,PW_F054_MF130)]\t; mm3=tmp2H\n\n\tmovq      mm6,mm0\n\tpaddw     mm0,mm2\t\t; mm0=in0+in4\n\tpsubw     mm6,mm2\t\t; mm6=in0-in4\n\n\tpxor      mm7,mm7\n\tpxor      mm2,mm2\n\tpunpcklwd mm7,mm0\t\t; mm7=tmp0L\n\tpunpckhwd mm2,mm0\t\t; mm2=tmp0H\n\tpsrad     mm7,(16-CONST_BITS)\t; psrad mm7,16 & pslld mm7,CONST_BITS\n\tpsrad     mm2,(16-CONST_BITS)\t; psrad mm2,16 & pslld mm2,CONST_BITS\n\n\tmovq\tmm0,mm7\n\tpaddd\tmm7,mm4\t\t\t; mm7=tmp10L\n\tpsubd\tmm0,mm4\t\t\t; mm0=tmp13L\n\tmovq\tmm4,mm2\n\tpaddd\tmm2,mm5\t\t\t; mm2=tmp10H\n\tpsubd\tmm4,mm5\t\t\t; mm4=tmp13H\n\n\tmovq\tMMWORD [wk(0)], mm7\t; wk(0)=tmp10L\n\tmovq\tMMWORD [wk(1)], mm2\t; wk(1)=tmp10H\n\tmovq\tMMWORD [wk(2)], mm0\t; wk(2)=tmp13L\n\tmovq\tMMWORD [wk(3)], mm4\t; wk(3)=tmp13H\n\n\tpxor      mm5,mm5\n\tpxor      mm7,mm7\n\tpunpcklwd mm5,mm6\t\t; mm5=tmp1L\n\tpunpckhwd mm7,mm6\t\t; mm7=tmp1H\n\tpsrad     mm5,(16-CONST_BITS)\t; psrad mm5,16 & pslld mm5,CONST_BITS\n\tpsrad     mm7,(16-CONST_BITS)\t; psrad mm7,16 & pslld mm7,CONST_BITS\n\n\tmovq\tmm2,mm5\n\tpaddd\tmm5,mm1\t\t\t; mm5=tmp11L\n\tpsubd\tmm2,mm1\t\t\t; mm2=tmp12L\n\tmovq\tmm0,mm7\n\tpaddd\tmm7,mm3\t\t\t; mm7=tmp11H\n\tpsubd\tmm0,mm3\t\t\t; mm0=tmp12H\n\n\tmovq\tMMWORD [wk(4)], mm5\t; wk(4)=tmp11L\n\tmovq\tMMWORD [wk(5)], mm7\t; wk(5)=tmp11H\n\tmovq\tMMWORD [wk(6)], mm2\t; wk(6)=tmp12L\n\tmovq\tMMWORD [wk(7)], mm0\t; wk(7)=tmp12H\n\n\t; -- Odd part\n\n\tmovq\tmm4, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm6, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tpmullw\tmm4, MMWORD [MMBLOCK(1,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\tmm6, MMWORD [MMBLOCK(3,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tmovq\tmm1, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm3, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\tpmullw\tmm1, MMWORD [MMBLOCK(5,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\tmm3, MMWORD [MMBLOCK(7,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\tmovq\tmm5,mm6\n\tmovq\tmm7,mm4\n\tpaddw\tmm5,mm3\t\t\t; mm5=z3\n\tpaddw\tmm7,mm1\t\t\t; mm7=z4\n\n\t; (Original)\n\t; z5 = (z3 + z4) * 1.175875602;\n\t; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n\t; z3 += z5;  z4 += z5;\n\t;\n\t; (This implementation)\n\t; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n\t; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n\tmovq      mm2,mm5\n\tmovq      mm0,mm5\n\tpunpcklwd mm2,mm7\n\tpunpckhwd mm0,mm7\n\tmovq      mm5,mm2\n\tmovq      mm7,mm0\n\tpmaddwd   mm2,[GOTOFF(ebx,PW_MF078_F117)]\t; mm2=z3L\n\tpmaddwd   mm0,[GOTOFF(ebx,PW_MF078_F117)]\t; mm0=z3H\n\tpmaddwd   mm5,[GOTOFF(ebx,PW_F117_F078)]\t; mm5=z4L\n\tpmaddwd   mm7,[GOTOFF(ebx,PW_F117_F078)]\t; mm7=z4H\n\n\tmovq\tMMWORD [wk(10)], mm2\t; wk(10)=z3L\n\tmovq\tMMWORD [wk(11)], mm0\t; wk(11)=z3H\n\n\t; (Original)\n\t; z1 = tmp0 + tmp3;  z2 = tmp1 + tmp2;\n\t; tmp0 = tmp0 * 0.298631336;  tmp1 = tmp1 * 2.053119869;\n\t; tmp2 = tmp2 * 3.072711026;  tmp3 = tmp3 * 1.501321110;\n\t; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n\t; tmp0 += z1 + z3;  tmp1 += z2 + z4;\n\t; tmp2 += z2 + z3;  tmp3 += z1 + z4;\n\t;\n\t; (This implementation)\n\t; tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223;\n\t; tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447;\n\t; tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447);\n\t; tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223);\n\t; tmp0 += z3;  tmp1 += z4;\n\t; tmp2 += z3;  tmp3 += z4;\n\n\tmovq      mm2,mm3\n\tmovq      mm0,mm3\n\tpunpcklwd mm2,mm4\n\tpunpckhwd mm0,mm4\n\tmovq      mm3,mm2\n\tmovq      mm4,mm0\n\tpmaddwd   mm2,[GOTOFF(ebx,PW_MF060_MF089)]\t; mm2=tmp0L\n\tpmaddwd   mm0,[GOTOFF(ebx,PW_MF060_MF089)]\t; mm0=tmp0H\n\tpmaddwd   mm3,[GOTOFF(ebx,PW_MF089_F060)]\t; mm3=tmp3L\n\tpmaddwd   mm4,[GOTOFF(ebx,PW_MF089_F060)]\t; mm4=tmp3H\n\n\tpaddd\tmm2, MMWORD [wk(10)]\t; mm2=tmp0L\n\tpaddd\tmm0, MMWORD [wk(11)]\t; mm0=tmp0H\n\tpaddd\tmm3,mm5\t\t\t; mm3=tmp3L\n\tpaddd\tmm4,mm7\t\t\t; mm4=tmp3H\n\n\tmovq\tMMWORD [wk(8)], mm2\t; wk(8)=tmp0L\n\tmovq\tMMWORD [wk(9)], mm0\t; wk(9)=tmp0H\n\n\tmovq      mm2,mm1\n\tmovq      mm0,mm1\n\tpunpcklwd mm2,mm6\n\tpunpckhwd mm0,mm6\n\tmovq      mm1,mm2\n\tmovq      mm6,mm0\n\tpmaddwd   mm2,[GOTOFF(ebx,PW_MF050_MF256)]\t; mm2=tmp1L\n\tpmaddwd   mm0,[GOTOFF(ebx,PW_MF050_MF256)]\t; mm0=tmp1H\n\tpmaddwd   mm1,[GOTOFF(ebx,PW_MF256_F050)]\t; mm1=tmp2L\n\tpmaddwd   mm6,[GOTOFF(ebx,PW_MF256_F050)]\t; mm6=tmp2H\n\n\tpaddd\tmm2,mm5\t\t\t; mm2=tmp1L\n\tpaddd\tmm0,mm7\t\t\t; mm0=tmp1H\n\tpaddd\tmm1, MMWORD [wk(10)]\t; mm1=tmp2L\n\tpaddd\tmm6, MMWORD [wk(11)]\t; mm6=tmp2H\n\n\tmovq\tMMWORD [wk(10)], mm2\t; wk(10)=tmp1L\n\tmovq\tMMWORD [wk(11)], mm0\t; wk(11)=tmp1H\n\n\t; -- Final output stage\n\n\tmovq\tmm5, MMWORD [wk(0)]\t; mm5=tmp10L\n\tmovq\tmm7, MMWORD [wk(1)]\t; mm7=tmp10H\n\n\tmovq\tmm2,mm5\n\tmovq\tmm0,mm7\n\tpaddd\tmm5,mm3\t\t\t; mm5=data0L\n\tpaddd\tmm7,mm4\t\t\t; mm7=data0H\n\tpsubd\tmm2,mm3\t\t\t; mm2=data7L\n\tpsubd\tmm0,mm4\t\t\t; mm0=data7H\n\n\tmovq\tmm3,[GOTOFF(ebx,PD_DESCALE_P1)]\t; mm3=[PD_DESCALE_P1]\n\n\tpaddd\tmm5,mm3\n\tpaddd\tmm7,mm3\n\tpsrad\tmm5,DESCALE_P1\n\tpsrad\tmm7,DESCALE_P1\n\tpaddd\tmm2,mm3\n\tpaddd\tmm0,mm3\n\tpsrad\tmm2,DESCALE_P1\n\tpsrad\tmm0,DESCALE_P1\n\n\tpackssdw  mm5,mm7\t\t; mm5=data0=(00 01 02 03)\n\tpackssdw  mm2,mm0\t\t; mm2=data7=(70 71 72 73)\n\n\tmovq\tmm4, MMWORD [wk(4)]\t; mm4=tmp11L\n\tmovq\tmm3, MMWORD [wk(5)]\t; mm3=tmp11H\n\n\tmovq\tmm7,mm4\n\tmovq\tmm0,mm3\n\tpaddd\tmm4,mm1\t\t\t; mm4=data1L\n\tpaddd\tmm3,mm6\t\t\t; mm3=data1H\n\tpsubd\tmm7,mm1\t\t\t; mm7=data6L\n\tpsubd\tmm0,mm6\t\t\t; mm0=data6H\n\n\tmovq\tmm1,[GOTOFF(ebx,PD_DESCALE_P1)]\t; mm1=[PD_DESCALE_P1]\n\n\tpaddd\tmm4,mm1\n\tpaddd\tmm3,mm1\n\tpsrad\tmm4,DESCALE_P1\n\tpsrad\tmm3,DESCALE_P1\n\tpaddd\tmm7,mm1\n\tpaddd\tmm0,mm1\n\tpsrad\tmm7,DESCALE_P1\n\tpsrad\tmm0,DESCALE_P1\n\n\tpackssdw  mm4,mm3\t\t; mm4=data1=(10 11 12 13)\n\tpackssdw  mm7,mm0\t\t; mm7=data6=(60 61 62 63)\n\n\tmovq      mm6,mm5\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm5,mm4\t\t; mm5=(00 10 01 11)\n\tpunpckhwd mm6,mm4\t\t; mm6=(02 12 03 13)\n\tmovq      mm1,mm7\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm7,mm2\t\t; mm7=(60 70 61 71)\n\tpunpckhwd mm1,mm2\t\t; mm1=(62 72 63 73)\n\n\tmovq\tmm3, MMWORD [wk(6)]\t; mm3=tmp12L\n\tmovq\tmm0, MMWORD [wk(7)]\t; mm0=tmp12H\n\tmovq\tmm4, MMWORD [wk(10)]\t; mm4=tmp1L\n\tmovq\tmm2, MMWORD [wk(11)]\t; mm2=tmp1H\n\n\tmovq\tMMWORD [wk(0)], mm5\t; wk(0)=(00 10 01 11)\n\tmovq\tMMWORD [wk(1)], mm6\t; wk(1)=(02 12 03 13)\n\tmovq\tMMWORD [wk(4)], mm7\t; wk(4)=(60 70 61 71)\n\tmovq\tMMWORD [wk(5)], mm1\t; wk(5)=(62 72 63 73)\n\n\tmovq\tmm5,mm3\n\tmovq\tmm6,mm0\n\tpaddd\tmm3,mm4\t\t\t; mm3=data2L\n\tpaddd\tmm0,mm2\t\t\t; mm0=data2H\n\tpsubd\tmm5,mm4\t\t\t; mm5=data5L\n\tpsubd\tmm6,mm2\t\t\t; mm6=data5H\n\n\tmovq\tmm7,[GOTOFF(ebx,PD_DESCALE_P1)]\t; mm7=[PD_DESCALE_P1]\n\n\tpaddd\tmm3,mm7\n\tpaddd\tmm0,mm7\n\tpsrad\tmm3,DESCALE_P1\n\tpsrad\tmm0,DESCALE_P1\n\tpaddd\tmm5,mm7\n\tpaddd\tmm6,mm7\n\tpsrad\tmm5,DESCALE_P1\n\tpsrad\tmm6,DESCALE_P1\n\n\tpackssdw  mm3,mm0\t\t; mm3=data2=(20 21 22 23)\n\tpackssdw  mm5,mm6\t\t; mm5=data5=(50 51 52 53)\n\n\tmovq\tmm1, MMWORD [wk(2)]\t; mm1=tmp13L\n\tmovq\tmm4, MMWORD [wk(3)]\t; mm4=tmp13H\n\tmovq\tmm2, MMWORD [wk(8)]\t; mm2=tmp0L\n\tmovq\tmm7, MMWORD [wk(9)]\t; mm7=tmp0H\n\n\tmovq\tmm0,mm1\n\tmovq\tmm6,mm4\n\tpaddd\tmm1,mm2\t\t\t; mm1=data3L\n\tpaddd\tmm4,mm7\t\t\t; mm4=data3H\n\tpsubd\tmm0,mm2\t\t\t; mm0=data4L\n\tpsubd\tmm6,mm7\t\t\t; mm6=data4H\n\n\tmovq\tmm2,[GOTOFF(ebx,PD_DESCALE_P1)]\t; mm2=[PD_DESCALE_P1]\n\n\tpaddd\tmm1,mm2\n\tpaddd\tmm4,mm2\n\tpsrad\tmm1,DESCALE_P1\n\tpsrad\tmm4,DESCALE_P1\n\tpaddd\tmm0,mm2\n\tpaddd\tmm6,mm2\n\tpsrad\tmm0,DESCALE_P1\n\tpsrad\tmm6,DESCALE_P1\n\n\tpackssdw  mm1,mm4\t\t; mm1=data3=(30 31 32 33)\n\tpackssdw  mm0,mm6\t\t; mm0=data4=(40 41 42 43)\n\n\tmovq\tmm7, MMWORD [wk(0)]\t; mm7=(00 10 01 11)\n\tmovq\tmm2, MMWORD [wk(1)]\t; mm2=(02 12 03 13)\n\n\tmovq      mm4,mm3\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm3,mm1\t\t; mm3=(20 30 21 31)\n\tpunpckhwd mm4,mm1\t\t; mm4=(22 32 23 33)\n\tmovq      mm6,mm0\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm0,mm5\t\t; mm0=(40 50 41 51)\n\tpunpckhwd mm6,mm5\t\t; mm6=(42 52 43 53)\n\n\tmovq      mm1,mm7\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm7,mm3\t\t; mm7=(00 10 20 30)\n\tpunpckhdq mm1,mm3\t\t; mm1=(01 11 21 31)\n\tmovq      mm5,mm2\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm2,mm4\t\t; mm2=(02 12 22 32)\n\tpunpckhdq mm5,mm4\t\t; mm5=(03 13 23 33)\n\n\tmovq\tmm3, MMWORD [wk(4)]\t; mm3=(60 70 61 71)\n\tmovq\tmm4, MMWORD [wk(5)]\t; mm4=(62 72 63 73)\n\n\tmovq\tMMWORD [MMBLOCK(0,0,edi,SIZEOF_JCOEF)], mm7\n\tmovq\tMMWORD [MMBLOCK(1,0,edi,SIZEOF_JCOEF)], mm1\n\tmovq\tMMWORD [MMBLOCK(2,0,edi,SIZEOF_JCOEF)], mm2\n\tmovq\tMMWORD [MMBLOCK(3,0,edi,SIZEOF_JCOEF)], mm5\n\n\tmovq      mm7,mm0\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm0,mm3\t\t; mm0=(40 50 60 70)\n\tpunpckhdq mm7,mm3\t\t; mm7=(41 51 61 71)\n\tmovq      mm1,mm6\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm6,mm4\t\t; mm6=(42 52 62 72)\n\tpunpckhdq mm1,mm4\t\t; mm1=(43 53 63 73)\n\n\tmovq\tMMWORD [MMBLOCK(0,1,edi,SIZEOF_JCOEF)], mm0\n\tmovq\tMMWORD [MMBLOCK(1,1,edi,SIZEOF_JCOEF)], mm7\n\tmovq\tMMWORD [MMBLOCK(2,1,edi,SIZEOF_JCOEF)], mm6\n\tmovq\tMMWORD [MMBLOCK(3,1,edi,SIZEOF_JCOEF)], mm1\n\n.nextcolumn:\n\tadd\tesi, byte 4*SIZEOF_JCOEF\t\t; coef_block\n\tadd\tedx, byte 4*SIZEOF_ISLOW_MULT_TYPE\t; quantptr\n\tadd\tedi, byte 4*DCTSIZE*SIZEOF_JCOEF\t; wsptr\n\tdec\tecx\t\t\t\t\t; ctr\n\tjnz\tnear .columnloop\n\n\t; ---- Pass 2: process rows from work array, store into output array.\n\n\tmov\teax, [original_ebp]\n\tlea\tesi, [workspace]\t\t\t; JCOEF * wsptr\n\tmov\tedi, JSAMPARRAY [output_buf(eax)]\t; (JSAMPROW *)\n\tmov\teax, JDIMENSION [output_col(eax)]\n\tmov\tecx, DCTSIZE/4\t\t\t\t; ctr\n\talignx\t16,7\n.rowloop:\n\n\t; -- Even part\n\n\tmovq\tmm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm1, MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm2, MMWORD [MMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm3, MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\n\t; (Original)\n\t; z1 = (z2 + z3) * 0.541196100;\n\t; tmp2 = z1 + z3 * -1.847759065;\n\t; tmp3 = z1 + z2 * 0.765366865;\n\t;\n\t; (This implementation)\n\t; tmp2 = z2 * 0.541196100 + z3 * (0.541196100 - 1.847759065);\n\t; tmp3 = z2 * (0.541196100 + 0.765366865) + z3 * 0.541196100;\n\n\tmovq      mm4,mm1\t\t; mm1=in2=z2\n\tmovq      mm5,mm1\n\tpunpcklwd mm4,mm3\t\t; mm3=in6=z3\n\tpunpckhwd mm5,mm3\n\tmovq      mm1,mm4\n\tmovq      mm3,mm5\n\tpmaddwd   mm4,[GOTOFF(ebx,PW_F130_F054)]\t; mm4=tmp3L\n\tpmaddwd   mm5,[GOTOFF(ebx,PW_F130_F054)]\t; mm5=tmp3H\n\tpmaddwd   mm1,[GOTOFF(ebx,PW_F054_MF130)]\t; mm1=tmp2L\n\tpmaddwd   mm3,[GOTOFF(ebx,PW_F054_MF130)]\t; mm3=tmp2H\n\n\tmovq      mm6,mm0\n\tpaddw     mm0,mm2\t\t; mm0=in0+in4\n\tpsubw     mm6,mm2\t\t; mm6=in0-in4\n\n\tpxor      mm7,mm7\n\tpxor      mm2,mm2\n\tpunpcklwd mm7,mm0\t\t; mm7=tmp0L\n\tpunpckhwd mm2,mm0\t\t; mm2=tmp0H\n\tpsrad     mm7,(16-CONST_BITS)\t; psrad mm7,16 & pslld mm7,CONST_BITS\n\tpsrad     mm2,(16-CONST_BITS)\t; psrad mm2,16 & pslld mm2,CONST_BITS\n\n\tmovq\tmm0,mm7\n\tpaddd\tmm7,mm4\t\t\t; mm7=tmp10L\n\tpsubd\tmm0,mm4\t\t\t; mm0=tmp13L\n\tmovq\tmm4,mm2\n\tpaddd\tmm2,mm5\t\t\t; mm2=tmp10H\n\tpsubd\tmm4,mm5\t\t\t; mm4=tmp13H\n\n\tmovq\tMMWORD [wk(0)], mm7\t; wk(0)=tmp10L\n\tmovq\tMMWORD [wk(1)], mm2\t; wk(1)=tmp10H\n\tmovq\tMMWORD [wk(2)], mm0\t; wk(2)=tmp13L\n\tmovq\tMMWORD [wk(3)], mm4\t; wk(3)=tmp13H\n\n\tpxor      mm5,mm5\n\tpxor      mm7,mm7\n\tpunpcklwd mm5,mm6\t\t; mm5=tmp1L\n\tpunpckhwd mm7,mm6\t\t; mm7=tmp1H\n\tpsrad     mm5,(16-CONST_BITS)\t; psrad mm5,16 & pslld mm5,CONST_BITS\n\tpsrad     mm7,(16-CONST_BITS)\t; psrad mm7,16 & pslld mm7,CONST_BITS\n\n\tmovq\tmm2,mm5\n\tpaddd\tmm5,mm1\t\t\t; mm5=tmp11L\n\tpsubd\tmm2,mm1\t\t\t; mm2=tmp12L\n\tmovq\tmm0,mm7\n\tpaddd\tmm7,mm3\t\t\t; mm7=tmp11H\n\tpsubd\tmm0,mm3\t\t\t; mm0=tmp12H\n\n\tmovq\tMMWORD [wk(4)], mm5\t; wk(4)=tmp11L\n\tmovq\tMMWORD [wk(5)], mm7\t; wk(5)=tmp11H\n\tmovq\tMMWORD [wk(6)], mm2\t; wk(6)=tmp12L\n\tmovq\tMMWORD [wk(7)], mm0\t; wk(7)=tmp12H\n\n\t; -- Odd part\n\n\tmovq\tmm4, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm6, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm1, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm3, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\n\tmovq\tmm5,mm6\n\tmovq\tmm7,mm4\n\tpaddw\tmm5,mm3\t\t\t; mm5=z3\n\tpaddw\tmm7,mm1\t\t\t; mm7=z4\n\n\t; (Original)\n\t; z5 = (z3 + z4) * 1.175875602;\n\t; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n\t; z3 += z5;  z4 += z5;\n\t;\n\t; (This implementation)\n\t; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n\t; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n\tmovq      mm2,mm5\n\tmovq      mm0,mm5\n\tpunpcklwd mm2,mm7\n\tpunpckhwd mm0,mm7\n\tmovq      mm5,mm2\n\tmovq      mm7,mm0\n\tpmaddwd   mm2,[GOTOFF(ebx,PW_MF078_F117)]\t; mm2=z3L\n\tpmaddwd   mm0,[GOTOFF(ebx,PW_MF078_F117)]\t; mm0=z3H\n\tpmaddwd   mm5,[GOTOFF(ebx,PW_F117_F078)]\t; mm5=z4L\n\tpmaddwd   mm7,[GOTOFF(ebx,PW_F117_F078)]\t; mm7=z4H\n\n\tmovq\tMMWORD [wk(10)], mm2\t; wk(10)=z3L\n\tmovq\tMMWORD [wk(11)], mm0\t; wk(11)=z3H\n\n\t; (Original)\n\t; z1 = tmp0 + tmp3;  z2 = tmp1 + tmp2;\n\t; tmp0 = tmp0 * 0.298631336;  tmp1 = tmp1 * 2.053119869;\n\t; tmp2 = tmp2 * 3.072711026;  tmp3 = tmp3 * 1.501321110;\n\t; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n\t; tmp0 += z1 + z3;  tmp1 += z2 + z4;\n\t; tmp2 += z2 + z3;  tmp3 += z1 + z4;\n\t;\n\t; (This implementation)\n\t; tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223;\n\t; tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447;\n\t; tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447);\n\t; tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223);\n\t; tmp0 += z3;  tmp1 += z4;\n\t; tmp2 += z3;  tmp3 += z4;\n\n\tmovq      mm2,mm3\n\tmovq      mm0,mm3\n\tpunpcklwd mm2,mm4\n\tpunpckhwd mm0,mm4\n\tmovq      mm3,mm2\n\tmovq      mm4,mm0\n\tpmaddwd   mm2,[GOTOFF(ebx,PW_MF060_MF089)]\t; mm2=tmp0L\n\tpmaddwd   mm0,[GOTOFF(ebx,PW_MF060_MF089)]\t; mm0=tmp0H\n\tpmaddwd   mm3,[GOTOFF(ebx,PW_MF089_F060)]\t; mm3=tmp3L\n\tpmaddwd   mm4,[GOTOFF(ebx,PW_MF089_F060)]\t; mm4=tmp3H\n\n\tpaddd\tmm2, MMWORD [wk(10)]\t; mm2=tmp0L\n\tpaddd\tmm0, MMWORD [wk(11)]\t; mm0=tmp0H\n\tpaddd\tmm3,mm5\t\t\t; mm3=tmp3L\n\tpaddd\tmm4,mm7\t\t\t; mm4=tmp3H\n\n\tmovq\tMMWORD [wk(8)], mm2\t; wk(8)=tmp0L\n\tmovq\tMMWORD [wk(9)], mm0\t; wk(9)=tmp0H\n\n\tmovq      mm2,mm1\n\tmovq      mm0,mm1\n\tpunpcklwd mm2,mm6\n\tpunpckhwd mm0,mm6\n\tmovq      mm1,mm2\n\tmovq      mm6,mm0\n\tpmaddwd   mm2,[GOTOFF(ebx,PW_MF050_MF256)]\t; mm2=tmp1L\n\tpmaddwd   mm0,[GOTOFF(ebx,PW_MF050_MF256)]\t; mm0=tmp1H\n\tpmaddwd   mm1,[GOTOFF(ebx,PW_MF256_F050)]\t; mm1=tmp2L\n\tpmaddwd   mm6,[GOTOFF(ebx,PW_MF256_F050)]\t; mm6=tmp2H\n\n\tpaddd\tmm2,mm5\t\t\t; mm2=tmp1L\n\tpaddd\tmm0,mm7\t\t\t; mm0=tmp1H\n\tpaddd\tmm1, MMWORD [wk(10)]\t; mm1=tmp2L\n\tpaddd\tmm6, MMWORD [wk(11)]\t; mm6=tmp2H\n\n\tmovq\tMMWORD [wk(10)], mm2\t; wk(10)=tmp1L\n\tmovq\tMMWORD [wk(11)], mm0\t; wk(11)=tmp1H\n\n\t; -- Final output stage\n\n\tmovq\tmm5, MMWORD [wk(0)]\t; mm5=tmp10L\n\tmovq\tmm7, MMWORD [wk(1)]\t; mm7=tmp10H\n\n\tmovq\tmm2,mm5\n\tmovq\tmm0,mm7\n\tpaddd\tmm5,mm3\t\t\t; mm5=data0L\n\tpaddd\tmm7,mm4\t\t\t; mm7=data0H\n\tpsubd\tmm2,mm3\t\t\t; mm2=data7L\n\tpsubd\tmm0,mm4\t\t\t; mm0=data7H\n\n\tmovq\tmm3,[GOTOFF(ebx,PD_DESCALE_P2)]\t; mm3=[PD_DESCALE_P2]\n\n\tpaddd\tmm5,mm3\n\tpaddd\tmm7,mm3\n\tpsrad\tmm5,DESCALE_P2\n\tpsrad\tmm7,DESCALE_P2\n\tpaddd\tmm2,mm3\n\tpaddd\tmm0,mm3\n\tpsrad\tmm2,DESCALE_P2\n\tpsrad\tmm0,DESCALE_P2\n\n\tpackssdw  mm5,mm7\t\t; mm5=data0=(00 10 20 30)\n\tpackssdw  mm2,mm0\t\t; mm2=data7=(07 17 27 37)\n\n\tmovq\tmm4, MMWORD [wk(4)]\t; mm4=tmp11L\n\tmovq\tmm3, MMWORD [wk(5)]\t; mm3=tmp11H\n\n\tmovq\tmm7,mm4\n\tmovq\tmm0,mm3\n\tpaddd\tmm4,mm1\t\t\t; mm4=data1L\n\tpaddd\tmm3,mm6\t\t\t; mm3=data1H\n\tpsubd\tmm7,mm1\t\t\t; mm7=data6L\n\tpsubd\tmm0,mm6\t\t\t; mm0=data6H\n\n\tmovq\tmm1,[GOTOFF(ebx,PD_DESCALE_P2)]\t; mm1=[PD_DESCALE_P2]\n\n\tpaddd\tmm4,mm1\n\tpaddd\tmm3,mm1\n\tpsrad\tmm4,DESCALE_P2\n\tpsrad\tmm3,DESCALE_P2\n\tpaddd\tmm7,mm1\n\tpaddd\tmm0,mm1\n\tpsrad\tmm7,DESCALE_P2\n\tpsrad\tmm0,DESCALE_P2\n\n\tpackssdw  mm4,mm3\t\t; mm4=data1=(01 11 21 31)\n\tpackssdw  mm7,mm0\t\t; mm7=data6=(06 16 26 36)\n\n\tpacksswb  mm5,mm7\t\t; mm5=(00 10 20 30 06 16 26 36)\n\tpacksswb  mm4,mm2\t\t; mm4=(01 11 21 31 07 17 27 37)\n\n\tmovq\tmm6, MMWORD [wk(6)]\t; mm6=tmp12L\n\tmovq\tmm1, MMWORD [wk(7)]\t; mm1=tmp12H\n\tmovq\tmm3, MMWORD [wk(10)]\t; mm3=tmp1L\n\tmovq\tmm0, MMWORD [wk(11)]\t; mm0=tmp1H\n\n\tmovq\tMMWORD [wk(0)], mm5\t; wk(0)=(00 10 20 30 06 16 26 36)\n\tmovq\tMMWORD [wk(1)], mm4\t; wk(1)=(01 11 21 31 07 17 27 37)\n\n\tmovq\tmm7,mm6\n\tmovq\tmm2,mm1\n\tpaddd\tmm6,mm3\t\t\t; mm6=data2L\n\tpaddd\tmm1,mm0\t\t\t; mm1=data2H\n\tpsubd\tmm7,mm3\t\t\t; mm7=data5L\n\tpsubd\tmm2,mm0\t\t\t; mm2=data5H\n\n\tmovq\tmm5,[GOTOFF(ebx,PD_DESCALE_P2)]\t; mm5=[PD_DESCALE_P2]\n\n\tpaddd\tmm6,mm5\n\tpaddd\tmm1,mm5\n\tpsrad\tmm6,DESCALE_P2\n\tpsrad\tmm1,DESCALE_P2\n\tpaddd\tmm7,mm5\n\tpaddd\tmm2,mm5\n\tpsrad\tmm7,DESCALE_P2\n\tpsrad\tmm2,DESCALE_P2\n\n\tpackssdw  mm6,mm1\t\t; mm6=data2=(02 12 22 32)\n\tpackssdw  mm7,mm2\t\t; mm7=data5=(05 15 25 35)\n\n\tmovq\tmm4, MMWORD [wk(2)]\t; mm4=tmp13L\n\tmovq\tmm3, MMWORD [wk(3)]\t; mm3=tmp13H\n\tmovq\tmm0, MMWORD [wk(8)]\t; mm0=tmp0L\n\tmovq\tmm5, MMWORD [wk(9)]\t; mm5=tmp0H\n\n\tmovq\tmm1,mm4\n\tmovq\tmm2,mm3\n\tpaddd\tmm4,mm0\t\t\t; mm4=data3L\n\tpaddd\tmm3,mm5\t\t\t; mm3=data3H\n\tpsubd\tmm1,mm0\t\t\t; mm1=data4L\n\tpsubd\tmm2,mm5\t\t\t; mm2=data4H\n\n\tmovq\tmm0,[GOTOFF(ebx,PD_DESCALE_P2)]\t; mm0=[PD_DESCALE_P2]\n\n\tpaddd\tmm4,mm0\n\tpaddd\tmm3,mm0\n\tpsrad\tmm4,DESCALE_P2\n\tpsrad\tmm3,DESCALE_P2\n\tpaddd\tmm1,mm0\n\tpaddd\tmm2,mm0\n\tpsrad\tmm1,DESCALE_P2\n\tpsrad\tmm2,DESCALE_P2\n\n\tmovq      mm5,[GOTOFF(ebx,PB_CENTERJSAMP)]\t; mm5=[PB_CENTERJSAMP]\n\n\tpackssdw  mm4,mm3\t\t; mm4=data3=(03 13 23 33)\n\tpackssdw  mm1,mm2\t\t; mm1=data4=(04 14 24 34)\n\n\tmovq      mm0, MMWORD [wk(0)]\t; mm0=(00 10 20 30 06 16 26 36)\n\tmovq      mm3, MMWORD [wk(1)]\t; mm3=(01 11 21 31 07 17 27 37)\n\n\tpacksswb  mm6,mm1\t\t; mm6=(02 12 22 32 04 14 24 34)\n\tpacksswb  mm4,mm7\t\t; mm4=(03 13 23 33 05 15 25 35)\n\n\tpaddb     mm0,mm5\n\tpaddb     mm3,mm5\n\tpaddb     mm6,mm5\n\tpaddb     mm4,mm5\n\n\tmovq      mm2,mm0\t\t; transpose coefficients(phase 1)\n\tpunpcklbw mm0,mm3\t\t; mm0=(00 01 10 11 20 21 30 31)\n\tpunpckhbw mm2,mm3\t\t; mm2=(06 07 16 17 26 27 36 37)\n\tmovq      mm1,mm6\t\t; transpose coefficients(phase 1)\n\tpunpcklbw mm6,mm4\t\t; mm6=(02 03 12 13 22 23 32 33)\n\tpunpckhbw mm1,mm4\t\t; mm1=(04 05 14 15 24 25 34 35)\n\n\tmovq      mm7,mm0\t\t; transpose coefficients(phase 2)\n\tpunpcklwd mm0,mm6\t\t; mm0=(00 01 02 03 10 11 12 13)\n\tpunpckhwd mm7,mm6\t\t; mm7=(20 21 22 23 30 31 32 33)\n\tmovq      mm5,mm1\t\t; transpose coefficients(phase 2)\n\tpunpcklwd mm1,mm2\t\t; mm1=(04 05 06 07 14 15 16 17)\n\tpunpckhwd mm5,mm2\t\t; mm5=(24 25 26 27 34 35 36 37)\n\n\tmovq      mm3,mm0\t\t; transpose coefficients(phase 3)\n\tpunpckldq mm0,mm1\t\t; mm0=(00 01 02 03 04 05 06 07)\n\tpunpckhdq mm3,mm1\t\t; mm3=(10 11 12 13 14 15 16 17)\n\tmovq      mm4,mm7\t\t; transpose coefficients(phase 3)\n\tpunpckldq mm7,mm5\t\t; mm7=(20 21 22 23 24 25 26 27)\n\tpunpckhdq mm4,mm5\t\t; mm4=(30 31 32 33 34 35 36 37)\n\n\tpushpic\tebx\t\t\t; save GOT address\n\n\tmov\tedx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\n\tmov\tebx, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\n\tmovq\tMMWORD [edx+eax*SIZEOF_JSAMPLE], mm0\n\tmovq\tMMWORD [ebx+eax*SIZEOF_JSAMPLE], mm3\n\tmov\tedx, JSAMPROW [edi+2*SIZEOF_JSAMPROW]\n\tmov\tebx, JSAMPROW [edi+3*SIZEOF_JSAMPROW]\n\tmovq\tMMWORD [edx+eax*SIZEOF_JSAMPLE], mm7\n\tmovq\tMMWORD [ebx+eax*SIZEOF_JSAMPLE], mm4\n\n\tpoppic\tebx\t\t\t; restore GOT address\n\n\tadd\tesi, byte 4*SIZEOF_JCOEF\t; wsptr\n\tadd\tedi, byte 4*SIZEOF_JSAMPROW\n\tdec\tecx\t\t\t\t; ctr\n\tjnz\tnear .rowloop\n\n\temms\t\t; empty MMX state\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jimmxred.asm",
    "content": ";\n; jimmxred.asm - reduced-size IDCT (MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains inverse-DCT routines that produce reduced-size\n; output: either 4x4 or 2x2 pixels from an 8x8 DCT block.\n; The following code is based directly on the IJG's original jidctred.c;\n; see the jidctred.c for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS\t13\n%define PASS1_BITS\t2\n\n%define DESCALE_P1_4\t(CONST_BITS-PASS1_BITS+1)\n%define DESCALE_P2_4\t(CONST_BITS+PASS1_BITS+3+1)\n%define DESCALE_P1_2\t(CONST_BITS-PASS1_BITS+2)\n%define DESCALE_P2_2\t(CONST_BITS+PASS1_BITS+3+2)\n\n%if CONST_BITS == 13\nF_0_211\tequ\t 1730\t\t; FIX(0.211164243)\nF_0_509\tequ\t 4176\t\t; FIX(0.509795579)\nF_0_601\tequ\t 4926\t\t; FIX(0.601344887)\nF_0_720\tequ\t 5906\t\t; FIX(0.720959822)\nF_0_765\tequ\t 6270\t\t; FIX(0.765366865)\nF_0_850\tequ\t 6967\t\t; FIX(0.850430095)\nF_0_899\tequ\t 7373\t\t; FIX(0.899976223)\nF_1_061\tequ\t 8697\t\t; FIX(1.061594337)\nF_1_272\tequ\t10426\t\t; FIX(1.272758580)\nF_1_451\tequ\t11893\t\t; FIX(1.451774981)\nF_1_847\tequ\t15137\t\t; FIX(1.847759065)\nF_2_172\tequ\t17799\t\t; FIX(2.172734803)\nF_2_562\tequ\t20995\t\t; FIX(2.562915447)\nF_3_624\tequ\t29692\t\t; FIX(3.624509785)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_211\tequ\tDESCALE( 226735879,30-CONST_BITS)\t; FIX(0.211164243)\nF_0_509\tequ\tDESCALE( 547388834,30-CONST_BITS)\t; FIX(0.509795579)\nF_0_601\tequ\tDESCALE( 645689155,30-CONST_BITS)\t; FIX(0.601344887)\nF_0_720\tequ\tDESCALE( 774124714,30-CONST_BITS)\t; FIX(0.720959822)\nF_0_765\tequ\tDESCALE( 821806413,30-CONST_BITS)\t; FIX(0.765366865)\nF_0_850\tequ\tDESCALE( 913142361,30-CONST_BITS)\t; FIX(0.850430095)\nF_0_899\tequ\tDESCALE( 966342111,30-CONST_BITS)\t; FIX(0.899976223)\nF_1_061\tequ\tDESCALE(1139878239,30-CONST_BITS)\t; FIX(1.061594337)\nF_1_272\tequ\tDESCALE(1366614119,30-CONST_BITS)\t; FIX(1.272758580)\nF_1_451\tequ\tDESCALE(1558831516,30-CONST_BITS)\t; FIX(1.451774981)\nF_1_847\tequ\tDESCALE(1984016188,30-CONST_BITS)\t; FIX(1.847759065)\nF_2_172\tequ\tDESCALE(2332956230,30-CONST_BITS)\t; FIX(2.172734803)\nF_2_562\tequ\tDESCALE(2751909506,30-CONST_BITS)\t; FIX(2.562915447)\nF_3_624\tequ\tDESCALE(3891787747,30-CONST_BITS)\t; FIX(3.624509785)\n%endif\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_idct_red_mmx)\n\nEXTN(jconst_idct_red_mmx):\n\nPW_F184_MF076\ttimes 2 dw  F_1_847,-F_0_765\nPW_F256_F089\ttimes 2 dw  F_2_562, F_0_899\nPW_F106_MF217\ttimes 2 dw  F_1_061,-F_2_172\nPW_MF060_MF050\ttimes 2 dw -F_0_601,-F_0_509\nPW_F145_MF021\ttimes 2 dw  F_1_451,-F_0_211\nPW_F362_MF127\ttimes 2 dw  F_3_624,-F_1_272\nPW_F085_MF072\ttimes 2 dw  F_0_850,-F_0_720\nPD_DESCALE_P1_4\ttimes 2 dd  1 << (DESCALE_P1_4-1)\nPD_DESCALE_P2_4\ttimes 2 dd  1 << (DESCALE_P2_4-1)\nPD_DESCALE_P1_2\ttimes 2 dd  1 << (DESCALE_P1_2-1)\nPD_DESCALE_P2_2\ttimes 2 dd  1 << (DESCALE_P2_2-1)\nPB_CENTERJSAMP\ttimes 8 db  CENTERJSAMPLE\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Perform dequantization and inverse DCT on one block of coefficients,\n; producing a reduced-size 4x4 output block.\n;\n; GLOBAL(void)\n; jsimd_idct_4x4_mmx (void * dct_table, JCOEFPTR coef_block,\n;                     JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n%define dct_table(b)\t(b)+8\t\t\t; void * dct_table\n%define coef_block(b)\t(b)+12\t\t; JCOEFPTR coef_block\n%define output_buf(b)\t(b)+16\t\t; JSAMPARRAY output_buf\n%define output_col(b)\t(b)+20\t\t; JDIMENSION output_col\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_MMWORD\t; mmword wk[WK_NUM]\n%define WK_NUM\t\t2\n%define workspace\twk(0)-DCTSIZE2*SIZEOF_JCOEF\n\t\t\t\t\t; JCOEF workspace[DCTSIZE2]\n\n\talign\t16\n\tglobal\tEXTN(jsimd_idct_4x4_mmx)\n\nEXTN(jsimd_idct_4x4_mmx):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_MMWORD)\t; align to 64 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [workspace]\n\tpushpic\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t; get GOT address\n\n\t; ---- Pass 1: process columns from input, store into work array.\n\n;\tmov\teax, [original_ebp]\n\tmov\tedx, POINTER [dct_table(eax)]\t; quantptr\n\tmov\tesi, JCOEFPTR [coef_block(eax)]\t\t; inptr\n\tlea\tedi, [workspace]\t\t\t; JCOEF * wsptr\n\tmov\tecx, DCTSIZE/4\t\t\t\t; ctr\n\talignx\t16,7\n.columnloop:\n%ifndef NO_ZERO_COLUMN_TEST_4X4_MMX\n\tmov\teax, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tor\teax, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tjnz\tshort .columnDCT\n\n\tmovq\tmm0, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm1, MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm0, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm1, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm0, MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm1, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm0,mm1\n\tpacksswb mm0,mm0\n\tmovd\teax,mm0\n\ttest\teax,eax\n\tjnz\tshort .columnDCT\n\n\t; -- AC terms all zero\n\n\tmovq\tmm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\tpmullw\tmm0, MMWORD [MMBLOCK(0,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\tpsllw\tmm0,PASS1_BITS\n\n\tmovq      mm2,mm0\t\t; mm0=in0=(00 01 02 03)\n\tpunpcklwd mm0,mm0\t\t; mm0=(00 00 01 01)\n\tpunpckhwd mm2,mm2\t\t; mm2=(02 02 03 03)\n\n\tmovq      mm1,mm0\n\tpunpckldq mm0,mm0\t\t; mm0=(00 00 00 00)\n\tpunpckhdq mm1,mm1\t\t; mm1=(01 01 01 01)\n\tmovq      mm3,mm2\n\tpunpckldq mm2,mm2\t\t; mm2=(02 02 02 02)\n\tpunpckhdq mm3,mm3\t\t; mm3=(03 03 03 03)\n\n\tmovq\tMMWORD [MMBLOCK(0,0,edi,SIZEOF_JCOEF)], mm0\n\tmovq\tMMWORD [MMBLOCK(1,0,edi,SIZEOF_JCOEF)], mm1\n\tmovq\tMMWORD [MMBLOCK(2,0,edi,SIZEOF_JCOEF)], mm2\n\tmovq\tMMWORD [MMBLOCK(3,0,edi,SIZEOF_JCOEF)], mm3\n\tjmp\tnear .nextcolumn\n\talignx\t16,7\n%endif\n.columnDCT:\n\n\t; -- Odd part\n\n\tmovq\tmm0, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm1, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tpmullw\tmm0, MMWORD [MMBLOCK(1,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\tmm1, MMWORD [MMBLOCK(3,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tmovq\tmm2, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm3, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\tpmullw\tmm2, MMWORD [MMBLOCK(5,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\tmm3, MMWORD [MMBLOCK(7,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\tmovq      mm4,mm0\n\tmovq      mm5,mm0\n\tpunpcklwd mm4,mm1\n\tpunpckhwd mm5,mm1\n\tmovq      mm0,mm4\n\tmovq      mm1,mm5\n\tpmaddwd   mm4,[GOTOFF(ebx,PW_F256_F089)]\t; mm4=(tmp2L)\n\tpmaddwd   mm5,[GOTOFF(ebx,PW_F256_F089)]\t; mm5=(tmp2H)\n\tpmaddwd   mm0,[GOTOFF(ebx,PW_F106_MF217)]\t; mm0=(tmp0L)\n\tpmaddwd   mm1,[GOTOFF(ebx,PW_F106_MF217)]\t; mm1=(tmp0H)\n\n\tmovq      mm6,mm2\n\tmovq      mm7,mm2\n\tpunpcklwd mm6,mm3\n\tpunpckhwd mm7,mm3\n\tmovq      mm2,mm6\n\tmovq      mm3,mm7\n\tpmaddwd   mm6,[GOTOFF(ebx,PW_MF060_MF050)]\t; mm6=(tmp2L)\n\tpmaddwd   mm7,[GOTOFF(ebx,PW_MF060_MF050)]\t; mm7=(tmp2H)\n\tpmaddwd   mm2,[GOTOFF(ebx,PW_F145_MF021)]\t; mm2=(tmp0L)\n\tpmaddwd   mm3,[GOTOFF(ebx,PW_F145_MF021)]\t; mm3=(tmp0H)\n\n\tpaddd\tmm6,mm4\t\t\t; mm6=tmp2L\n\tpaddd\tmm7,mm5\t\t\t; mm7=tmp2H\n\tpaddd\tmm2,mm0\t\t\t; mm2=tmp0L\n\tpaddd\tmm3,mm1\t\t\t; mm3=tmp0H\n\n\tmovq\tMMWORD [wk(0)], mm2\t; wk(0)=tmp0L\n\tmovq\tMMWORD [wk(1)], mm3\t; wk(1)=tmp0H\n\n\t; -- Even part\n\n\tmovq\tmm4, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm5, MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm0, MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\tpmullw\tmm4, MMWORD [MMBLOCK(0,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\tmm5, MMWORD [MMBLOCK(2,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\tmm0, MMWORD [MMBLOCK(6,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\tpxor      mm1,mm1\n\tpxor      mm2,mm2\n\tpunpcklwd mm1,mm4\t\t; mm1=tmp0L\n\tpunpckhwd mm2,mm4\t\t; mm2=tmp0H\n\tpsrad     mm1,(16-CONST_BITS-1)\t; psrad mm1,16 & pslld mm1,CONST_BITS+1\n\tpsrad     mm2,(16-CONST_BITS-1)\t; psrad mm2,16 & pslld mm2,CONST_BITS+1\n\n\tmovq      mm3,mm5\t\t; mm5=in2=z2\n\tpunpcklwd mm5,mm0\t\t; mm0=in6=z3\n\tpunpckhwd mm3,mm0\n\tpmaddwd   mm5,[GOTOFF(ebx,PW_F184_MF076)]\t; mm5=tmp2L\n\tpmaddwd   mm3,[GOTOFF(ebx,PW_F184_MF076)]\t; mm3=tmp2H\n\n\tmovq\tmm4,mm1\n\tmovq\tmm0,mm2\n\tpaddd\tmm1,mm5\t\t\t; mm1=tmp10L\n\tpaddd\tmm2,mm3\t\t\t; mm2=tmp10H\n\tpsubd\tmm4,mm5\t\t\t; mm4=tmp12L\n\tpsubd\tmm0,mm3\t\t\t; mm0=tmp12H\n\n\t; -- Final output stage\n\n\tmovq\tmm5,mm1\n\tmovq\tmm3,mm2\n\tpaddd\tmm1,mm6\t\t\t; mm1=data0L\n\tpaddd\tmm2,mm7\t\t\t; mm2=data0H\n\tpsubd\tmm5,mm6\t\t\t; mm5=data3L\n\tpsubd\tmm3,mm7\t\t\t; mm3=data3H\n\n\tmovq\tmm6,[GOTOFF(ebx,PD_DESCALE_P1_4)]\t; mm6=[PD_DESCALE_P1_4]\n\n\tpaddd\tmm1,mm6\n\tpaddd\tmm2,mm6\n\tpsrad\tmm1,DESCALE_P1_4\n\tpsrad\tmm2,DESCALE_P1_4\n\tpaddd\tmm5,mm6\n\tpaddd\tmm3,mm6\n\tpsrad\tmm5,DESCALE_P1_4\n\tpsrad\tmm3,DESCALE_P1_4\n\n\tpackssdw  mm1,mm2\t\t; mm1=data0=(00 01 02 03)\n\tpackssdw  mm5,mm3\t\t; mm5=data3=(30 31 32 33)\n\n\tmovq\tmm7, MMWORD [wk(0)]\t; mm7=tmp0L\n\tmovq\tmm6, MMWORD [wk(1)]\t; mm6=tmp0H\n\n\tmovq\tmm2,mm4\n\tmovq\tmm3,mm0\n\tpaddd\tmm4,mm7\t\t\t; mm4=data1L\n\tpaddd\tmm0,mm6\t\t\t; mm0=data1H\n\tpsubd\tmm2,mm7\t\t\t; mm2=data2L\n\tpsubd\tmm3,mm6\t\t\t; mm3=data2H\n\n\tmovq\tmm7,[GOTOFF(ebx,PD_DESCALE_P1_4)]\t; mm7=[PD_DESCALE_P1_4]\n\n\tpaddd\tmm4,mm7\n\tpaddd\tmm0,mm7\n\tpsrad\tmm4,DESCALE_P1_4\n\tpsrad\tmm0,DESCALE_P1_4\n\tpaddd\tmm2,mm7\n\tpaddd\tmm3,mm7\n\tpsrad\tmm2,DESCALE_P1_4\n\tpsrad\tmm3,DESCALE_P1_4\n\n\tpackssdw  mm4,mm0\t\t; mm4=data1=(10 11 12 13)\n\tpackssdw  mm2,mm3\t\t; mm2=data2=(20 21 22 23)\n\n\tmovq      mm6,mm1\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm1,mm4\t\t; mm1=(00 10 01 11)\n\tpunpckhwd mm6,mm4\t\t; mm6=(02 12 03 13)\n\tmovq      mm7,mm2\t\t; transpose coefficients(phase 1)\n\tpunpcklwd mm2,mm5\t\t; mm2=(20 30 21 31)\n\tpunpckhwd mm7,mm5\t\t; mm7=(22 32 23 33)\n\n\tmovq      mm0,mm1\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm1,mm2\t\t; mm1=(00 10 20 30)\n\tpunpckhdq mm0,mm2\t\t; mm0=(01 11 21 31)\n\tmovq      mm3,mm6\t\t; transpose coefficients(phase 2)\n\tpunpckldq mm6,mm7\t\t; mm6=(02 12 22 32)\n\tpunpckhdq mm3,mm7\t\t; mm3=(03 13 23 33)\n\n\tmovq\tMMWORD [MMBLOCK(0,0,edi,SIZEOF_JCOEF)], mm1\n\tmovq\tMMWORD [MMBLOCK(1,0,edi,SIZEOF_JCOEF)], mm0\n\tmovq\tMMWORD [MMBLOCK(2,0,edi,SIZEOF_JCOEF)], mm6\n\tmovq\tMMWORD [MMBLOCK(3,0,edi,SIZEOF_JCOEF)], mm3\n\n.nextcolumn:\n\tadd\tesi, byte 4*SIZEOF_JCOEF\t\t; coef_block\n\tadd\tedx, byte 4*SIZEOF_ISLOW_MULT_TYPE\t; quantptr\n\tadd\tedi, byte 4*DCTSIZE*SIZEOF_JCOEF\t; wsptr\n\tdec\tecx\t\t\t\t\t; ctr\n\tjnz\tnear .columnloop\n\n\t; ---- Pass 2: process rows from work array, store into output array.\n\n\tmov\teax, [original_ebp]\n\tlea\tesi, [workspace]\t\t\t; JCOEF * wsptr\n\tmov\tedi, JSAMPARRAY [output_buf(eax)]\t; (JSAMPROW *)\n\tmov\teax, JDIMENSION [output_col(eax)]\n\n\t; -- Odd part\n\n\tmovq\tmm0, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm1, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm2, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm3, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\n\tmovq      mm4,mm0\n\tmovq      mm5,mm0\n\tpunpcklwd mm4,mm1\n\tpunpckhwd mm5,mm1\n\tmovq      mm0,mm4\n\tmovq      mm1,mm5\n\tpmaddwd   mm4,[GOTOFF(ebx,PW_F256_F089)]\t; mm4=(tmp2L)\n\tpmaddwd   mm5,[GOTOFF(ebx,PW_F256_F089)]\t; mm5=(tmp2H)\n\tpmaddwd   mm0,[GOTOFF(ebx,PW_F106_MF217)]\t; mm0=(tmp0L)\n\tpmaddwd   mm1,[GOTOFF(ebx,PW_F106_MF217)]\t; mm1=(tmp0H)\n\n\tmovq      mm6,mm2\n\tmovq      mm7,mm2\n\tpunpcklwd mm6,mm3\n\tpunpckhwd mm7,mm3\n\tmovq      mm2,mm6\n\tmovq      mm3,mm7\n\tpmaddwd   mm6,[GOTOFF(ebx,PW_MF060_MF050)]\t; mm6=(tmp2L)\n\tpmaddwd   mm7,[GOTOFF(ebx,PW_MF060_MF050)]\t; mm7=(tmp2H)\n\tpmaddwd   mm2,[GOTOFF(ebx,PW_F145_MF021)]\t; mm2=(tmp0L)\n\tpmaddwd   mm3,[GOTOFF(ebx,PW_F145_MF021)]\t; mm3=(tmp0H)\n\n\tpaddd\tmm6,mm4\t\t\t; mm6=tmp2L\n\tpaddd\tmm7,mm5\t\t\t; mm7=tmp2H\n\tpaddd\tmm2,mm0\t\t\t; mm2=tmp0L\n\tpaddd\tmm3,mm1\t\t\t; mm3=tmp0H\n\n\tmovq\tMMWORD [wk(0)], mm2\t; wk(0)=tmp0L\n\tmovq\tMMWORD [wk(1)], mm3\t; wk(1)=tmp0H\n\n\t; -- Even part\n\n\tmovq\tmm4, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm5, MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm0, MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\n\tpxor      mm1,mm1\n\tpxor      mm2,mm2\n\tpunpcklwd mm1,mm4\t\t; mm1=tmp0L\n\tpunpckhwd mm2,mm4\t\t; mm2=tmp0H\n\tpsrad     mm1,(16-CONST_BITS-1)\t; psrad mm1,16 & pslld mm1,CONST_BITS+1\n\tpsrad     mm2,(16-CONST_BITS-1)\t; psrad mm2,16 & pslld mm2,CONST_BITS+1\n\n\tmovq      mm3,mm5\t\t; mm5=in2=z2\n\tpunpcklwd mm5,mm0\t\t; mm0=in6=z3\n\tpunpckhwd mm3,mm0\n\tpmaddwd   mm5,[GOTOFF(ebx,PW_F184_MF076)]\t; mm5=tmp2L\n\tpmaddwd   mm3,[GOTOFF(ebx,PW_F184_MF076)]\t; mm3=tmp2H\n\n\tmovq\tmm4,mm1\n\tmovq\tmm0,mm2\n\tpaddd\tmm1,mm5\t\t\t; mm1=tmp10L\n\tpaddd\tmm2,mm3\t\t\t; mm2=tmp10H\n\tpsubd\tmm4,mm5\t\t\t; mm4=tmp12L\n\tpsubd\tmm0,mm3\t\t\t; mm0=tmp12H\n\n\t; -- Final output stage\n\n\tmovq\tmm5,mm1\n\tmovq\tmm3,mm2\n\tpaddd\tmm1,mm6\t\t\t; mm1=data0L\n\tpaddd\tmm2,mm7\t\t\t; mm2=data0H\n\tpsubd\tmm5,mm6\t\t\t; mm5=data3L\n\tpsubd\tmm3,mm7\t\t\t; mm3=data3H\n\n\tmovq\tmm6,[GOTOFF(ebx,PD_DESCALE_P2_4)]\t; mm6=[PD_DESCALE_P2_4]\n\n\tpaddd\tmm1,mm6\n\tpaddd\tmm2,mm6\n\tpsrad\tmm1,DESCALE_P2_4\n\tpsrad\tmm2,DESCALE_P2_4\n\tpaddd\tmm5,mm6\n\tpaddd\tmm3,mm6\n\tpsrad\tmm5,DESCALE_P2_4\n\tpsrad\tmm3,DESCALE_P2_4\n\n\tpackssdw  mm1,mm2\t\t; mm1=data0=(00 10 20 30)\n\tpackssdw  mm5,mm3\t\t; mm5=data3=(03 13 23 33)\n\n\tmovq\tmm7, MMWORD [wk(0)]\t; mm7=tmp0L\n\tmovq\tmm6, MMWORD [wk(1)]\t; mm6=tmp0H\n\n\tmovq\tmm2,mm4\n\tmovq\tmm3,mm0\n\tpaddd\tmm4,mm7\t\t\t; mm4=data1L\n\tpaddd\tmm0,mm6\t\t\t; mm0=data1H\n\tpsubd\tmm2,mm7\t\t\t; mm2=data2L\n\tpsubd\tmm3,mm6\t\t\t; mm3=data2H\n\n\tmovq\tmm7,[GOTOFF(ebx,PD_DESCALE_P2_4)]\t; mm7=[PD_DESCALE_P2_4]\n\n\tpaddd\tmm4,mm7\n\tpaddd\tmm0,mm7\n\tpsrad\tmm4,DESCALE_P2_4\n\tpsrad\tmm0,DESCALE_P2_4\n\tpaddd\tmm2,mm7\n\tpaddd\tmm3,mm7\n\tpsrad\tmm2,DESCALE_P2_4\n\tpsrad\tmm3,DESCALE_P2_4\n\n\tpackssdw  mm4,mm0\t\t; mm4=data1=(01 11 21 31)\n\tpackssdw  mm2,mm3\t\t; mm2=data2=(02 12 22 32)\n\n\tmovq      mm6,[GOTOFF(ebx,PB_CENTERJSAMP)]\t; mm6=[PB_CENTERJSAMP]\n\n\tpacksswb  mm1,mm2\t\t; mm1=(00 10 20 30 02 12 22 32)\n\tpacksswb  mm4,mm5\t\t; mm4=(01 11 21 31 03 13 23 33)\n\tpaddb     mm1,mm6\n\tpaddb     mm4,mm6\n\n\tmovq      mm7,mm1\t\t; transpose coefficients(phase 1)\n\tpunpcklbw mm1,mm4\t\t; mm1=(00 01 10 11 20 21 30 31)\n\tpunpckhbw mm7,mm4\t\t; mm7=(02 03 12 13 22 23 32 33)\n\n\tmovq      mm0,mm1\t\t; transpose coefficients(phase 2)\n\tpunpcklwd mm1,mm7\t\t; mm1=(00 01 02 03 10 11 12 13)\n\tpunpckhwd mm0,mm7\t\t; mm0=(20 21 22 23 30 31 32 33)\n\n\tmov\tedx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\n\tmov\tesi, JSAMPROW [edi+2*SIZEOF_JSAMPROW]\n\tmovd\tDWORD [edx+eax*SIZEOF_JSAMPLE], mm1\n\tmovd\tDWORD [esi+eax*SIZEOF_JSAMPLE], mm0\n\n\tpsrlq\tmm1,4*BYTE_BIT\n\tpsrlq\tmm0,4*BYTE_BIT\n\n\tmov\tedx, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\n\tmov\tesi, JSAMPROW [edi+3*SIZEOF_JSAMPROW]\n\tmovd\tDWORD [edx+eax*SIZEOF_JSAMPLE], mm1\n\tmovd\tDWORD [esi+eax*SIZEOF_JSAMPLE], mm0\n\n\temms\t\t; empty MMX state\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpoppic\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n\n; --------------------------------------------------------------------------\n;\n; Perform dequantization and inverse DCT on one block of coefficients,\n; producing a reduced-size 2x2 output block.\n;\n; GLOBAL(void)\n; jsimd_idct_2x2_mmx (void * dct_table, JCOEFPTR coef_block,\n;                     JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n%define dct_table(b)\t(b)+8\t\t\t; void * dct_table\n%define coef_block(b)\t(b)+12\t\t; JCOEFPTR coef_block\n%define output_buf(b)\t(b)+16\t\t; JSAMPARRAY output_buf\n%define output_col(b)\t(b)+20\t\t; JDIMENSION output_col\n\n\talign\t16\n\tglobal\tEXTN(jsimd_idct_2x2_mmx)\n\nEXTN(jsimd_idct_2x2_mmx):\n\tpush\tebp\n\tmov\tebp,esp\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t; get GOT address\n\n\t; ---- Pass 1: process columns from input.\n\n\tmov\tedx, POINTER [dct_table(ebp)]\t; quantptr\n\tmov\tesi, JCOEFPTR [coef_block(ebp)]\t\t; inptr\n\n\t; | input:                  | result:        |\n\t; | 00 01 ** 03 ** 05 ** 07 |                |\n\t; | 10 11 ** 13 ** 15 ** 17 |                |\n\t; | ** ** ** ** ** ** ** ** |                |\n\t; | 30 31 ** 33 ** 35 ** 37 | A0 A1 A3 A5 A7 |\n\t; | ** ** ** ** ** ** ** ** | B0 B1 B3 B5 B7 |\n\t; | 50 51 ** 53 ** 55 ** 57 |                |\n\t; | ** ** ** ** ** ** ** ** |                |\n\t; | 70 71 ** 73 ** 75 ** 77 |                |\n\n\t; -- Odd part\n\n\tmovq\tmm0, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm1, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tpmullw\tmm0, MMWORD [MMBLOCK(1,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\tmm1, MMWORD [MMBLOCK(3,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tmovq\tmm2, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm3, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\tpmullw\tmm2, MMWORD [MMBLOCK(5,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\tmm3, MMWORD [MMBLOCK(7,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\t; mm0=(10 11 ** 13), mm1=(30 31 ** 33)\n\t; mm2=(50 51 ** 53), mm3=(70 71 ** 73)\n\n\tpcmpeqd   mm7,mm7\n\tpslld     mm7,WORD_BIT\t\t; mm7={0x0000 0xFFFF 0x0000 0xFFFF}\n\n\tmovq      mm4,mm0\t\t; mm4=(10 11 ** 13)\n\tmovq      mm5,mm2\t\t; mm5=(50 51 ** 53)\n\tpunpcklwd mm4,mm1\t\t; mm4=(10 30 11 31)\n\tpunpcklwd mm5,mm3\t\t; mm5=(50 70 51 71)\n\tpmaddwd   mm4,[GOTOFF(ebx,PW_F362_MF127)]\n\tpmaddwd   mm5,[GOTOFF(ebx,PW_F085_MF072)]\n\n\tpsrld\tmm0,WORD_BIT\t\t; mm0=(11 -- 13 --)\n\tpand\tmm1,mm7\t\t\t; mm1=(-- 31 -- 33)\n\tpsrld\tmm2,WORD_BIT\t\t; mm2=(51 -- 53 --)\n\tpand\tmm3,mm7\t\t\t; mm3=(-- 71 -- 73)\n\tpor\tmm0,mm1\t\t\t; mm0=(11 31 13 33)\n\tpor\tmm2,mm3\t\t\t; mm2=(51 71 53 73)\n\tpmaddwd\tmm0,[GOTOFF(ebx,PW_F362_MF127)]\n\tpmaddwd\tmm2,[GOTOFF(ebx,PW_F085_MF072)]\n\n\tpaddd\tmm4,mm5\t\t\t; mm4=tmp0[col0 col1]\n\n\tmovq\tmm6, MMWORD [MMBLOCK(1,1,esi,SIZEOF_JCOEF)]\n\tmovq\tmm1, MMWORD [MMBLOCK(3,1,esi,SIZEOF_JCOEF)]\n\tpmullw\tmm6, MMWORD [MMBLOCK(1,1,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\tmm1, MMWORD [MMBLOCK(3,1,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tmovq\tmm3, MMWORD [MMBLOCK(5,1,esi,SIZEOF_JCOEF)]\n\tmovq\tmm5, MMWORD [MMBLOCK(7,1,esi,SIZEOF_JCOEF)]\n\tpmullw\tmm3, MMWORD [MMBLOCK(5,1,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\tmm5, MMWORD [MMBLOCK(7,1,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\t; mm6=(** 15 ** 17), mm1=(** 35 ** 37)\n\t; mm3=(** 55 ** 57), mm5=(** 75 ** 77)\n\n\tpsrld\tmm6,WORD_BIT\t\t; mm6=(15 -- 17 --)\n\tpand\tmm1,mm7\t\t\t; mm1=(-- 35 -- 37)\n\tpsrld\tmm3,WORD_BIT\t\t; mm3=(55 -- 57 --)\n\tpand\tmm5,mm7\t\t\t; mm5=(-- 75 -- 77)\n\tpor\tmm6,mm1\t\t\t; mm6=(15 35 17 37)\n\tpor\tmm3,mm5\t\t\t; mm3=(55 75 57 77)\n\tpmaddwd\tmm6,[GOTOFF(ebx,PW_F362_MF127)]\n\tpmaddwd\tmm3,[GOTOFF(ebx,PW_F085_MF072)]\n\n\tpaddd\tmm0,mm2\t\t\t; mm0=tmp0[col1 col3]\n\tpaddd\tmm6,mm3\t\t\t; mm6=tmp0[col5 col7]\n\n\t; -- Even part\n\n\tmovq\tmm1, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm5, MMWORD [MMBLOCK(0,1,esi,SIZEOF_JCOEF)]\n\tpmullw\tmm1, MMWORD [MMBLOCK(0,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\tmm5, MMWORD [MMBLOCK(0,1,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\t; mm1=(00 01 ** 03), mm5=(** 05 ** 07)\n\n\tmovq\tmm2,mm1\t\t\t\t; mm2=(00 01 ** 03)\n\tpslld\tmm1,WORD_BIT\t\t\t; mm1=(-- 00 -- **)\n\tpsrad\tmm1,(WORD_BIT-CONST_BITS-2)\t; mm1=tmp10[col0 ****]\n\n\tpand\tmm2,mm7\t\t\t\t; mm2=(-- 01 -- 03)\n\tpand\tmm5,mm7\t\t\t\t; mm5=(-- 05 -- 07)\n\tpsrad\tmm2,(WORD_BIT-CONST_BITS-2)\t; mm2=tmp10[col1 col3]\n\tpsrad\tmm5,(WORD_BIT-CONST_BITS-2)\t; mm5=tmp10[col5 col7]\n\n\t; -- Final output stage\n\n\tmovq      mm3,mm1\n\tpaddd     mm1,mm4\t\t; mm1=data0[col0 ****]=(A0 **)\n\tpsubd     mm3,mm4\t\t; mm3=data1[col0 ****]=(B0 **)\n\tpunpckldq mm1,mm3\t\t; mm1=(A0 B0)\n\n\tmovq\tmm7,[GOTOFF(ebx,PD_DESCALE_P1_2)]\t; mm7=[PD_DESCALE_P1_2]\n\n\tmovq\tmm4,mm2\n\tmovq\tmm3,mm5\n\tpaddd\tmm2,mm0\t\t\t; mm2=data0[col1 col3]=(A1 A3)\n\tpaddd\tmm5,mm6\t\t\t; mm5=data0[col5 col7]=(A5 A7)\n\tpsubd\tmm4,mm0\t\t\t; mm4=data1[col1 col3]=(B1 B3)\n\tpsubd\tmm3,mm6\t\t\t; mm3=data1[col5 col7]=(B5 B7)\n\n\tpaddd\tmm1,mm7\n\tpsrad\tmm1,DESCALE_P1_2\n\n\tpaddd\tmm2,mm7\n\tpaddd\tmm5,mm7\n\tpsrad\tmm2,DESCALE_P1_2\n\tpsrad\tmm5,DESCALE_P1_2\n\tpaddd\tmm4,mm7\n\tpaddd\tmm3,mm7\n\tpsrad\tmm4,DESCALE_P1_2\n\tpsrad\tmm3,DESCALE_P1_2\n\n\t; ---- Pass 2: process rows, store into output array.\n\n\tmov\tedi, JSAMPARRAY [output_buf(ebp)]\t; (JSAMPROW *)\n\tmov\teax, JDIMENSION [output_col(ebp)]\n\n\t; | input:| result:|\n\t; | A0 B0 |        |\n\t; | A1 B1 | C0 C1  |\n\t; | A3 B3 | D0 D1  |\n\t; | A5 B5 |        |\n\t; | A7 B7 |        |\n\n\t; -- Odd part\n\n\tpackssdw  mm2,mm4\t\t; mm2=(A1 A3 B1 B3)\n\tpackssdw  mm5,mm3\t\t; mm5=(A5 A7 B5 B7)\n\tpmaddwd   mm2,[GOTOFF(ebx,PW_F362_MF127)]\n\tpmaddwd   mm5,[GOTOFF(ebx,PW_F085_MF072)]\n\n\tpaddd     mm2,mm5\t\t; mm2=tmp0[row0 row1]\n\n\t; -- Even part\n\n\tpslld     mm1,(CONST_BITS+2)\t; mm1=tmp10[row0 row1]\n\n\t; -- Final output stage\n\n\tmovq      mm0,[GOTOFF(ebx,PD_DESCALE_P2_2)]\t; mm0=[PD_DESCALE_P2_2]\n\n\tmovq      mm6,mm1\n\tpaddd     mm1,mm2\t\t; mm1=data0[row0 row1]=(C0 C1)\n\tpsubd     mm6,mm2\t\t; mm6=data1[row0 row1]=(D0 D1)\n\n\tpaddd     mm1,mm0\n\tpaddd     mm6,mm0\n\tpsrad     mm1,DESCALE_P2_2\n\tpsrad     mm6,DESCALE_P2_2\n\n\tmovq      mm7,mm1\t\t; transpose coefficients\n\tpunpckldq mm1,mm6\t\t; mm1=(C0 D0)\n\tpunpckhdq mm7,mm6\t\t; mm7=(C1 D1)\n\n\tpackssdw  mm1,mm7\t\t; mm1=(C0 D0 C1 D1)\n\tpacksswb  mm1,mm1\t\t; mm1=(C0 D0 C1 D1 C0 D0 C1 D1)\n\tpaddb     mm1,[GOTOFF(ebx,PB_CENTERJSAMP)]\n\n\tmovd\tecx,mm1\n\tmovd\tebx,mm1\t\t\t; ebx=(C0 D0 C1 D1)\n\tshr\tecx,2*BYTE_BIT\t\t; ecx=(C1 D1 -- --)\n\n\tmov\tedx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\n\tmov\tesi, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\n\tmov\tWORD [edx+eax*SIZEOF_JSAMPLE], bx\n\tmov\tWORD [esi+eax*SIZEOF_JSAMPLE], cx\n\n\temms\t\t; empty MMX state\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jiss2flt-64.asm",
    "content": ";\n; jiss2flt-64.asm - floating-point IDCT (64-bit SSE & SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2009 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a floating-point implementation of the inverse DCT\n; (Discrete Cosine Transform). The following code is based directly on\n; the IJG's original jidctflt.c; see the jidctflt.c for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%macro\tunpcklps2 2\t; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(0 1 4 5)\n\tshufps\t%1,%2,0x44\n%endmacro\n\n%macro\tunpckhps2 2\t; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(2 3 6 7)\n\tshufps\t%1,%2,0xEE\n%endmacro\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_idct_float_sse2)\n\nEXTN(jconst_idct_float_sse2):\n\nPD_1_414\ttimes 4 dd  1.414213562373095048801689\nPD_1_847\ttimes 4 dd  1.847759065022573512256366\nPD_1_082\ttimes 4 dd  1.082392200292393968799446\nPD_M2_613\ttimes 4 dd -2.613125929752753055713286\nPD_RNDINT_MAGIC\ttimes 4 dd  100663296.0\t; (float)(0x00C00000 << 3)\nPB_CENTERJSAMP\ttimes 16 db CENTERJSAMPLE\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t64\n;\n; Perform dequantization and inverse DCT on one block of coefficients.\n;\n; GLOBAL(void)\n; jsimd_idct_float_sse2 (void * dct_table, JCOEFPTR coef_block,\n;                        JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n; r10 = void * dct_table\n; r11 = JCOEFPTR coef_block\n; r12 = JSAMPARRAY output_buf\n; r13 = JDIMENSION output_col\n\n%define original_rbp\trbp+0\n%define wk(i)\t\trbp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t2\n%define workspace\twk(0)-DCTSIZE2*SIZEOF_FAST_FLOAT\n\t\t\t\t\t; FAST_FLOAT workspace[DCTSIZE2]\n\n\talign\t16\n\tglobal\tEXTN(jsimd_idct_float_sse2)\n\nEXTN(jsimd_idct_float_sse2):\n\tpush\trbp\n\tmov\trax,rsp\t\t\t\t; rax = original rbp\n\tsub\trsp, byte 4\n\tand\trsp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[rsp],rax\n\tmov\trbp,rsp\t\t\t\t; rbp = aligned rbp\n\tlea\trsp, [workspace]\n\tcollect_args\n\tpush\trbx\n\n\t; ---- Pass 1: process columns from input, store into work array.\n\n\tmov\trdx, r10\t; quantptr\n\tmov\trsi, r11\t\t; inptr\n\tlea\trdi, [workspace]\t\t\t; FAST_FLOAT * wsptr\n\tmov\trcx, DCTSIZE/4\t\t\t\t; ctr\n.columnloop:\n%ifndef NO_ZERO_COLUMN_TEST_FLOAT_SSE\n\tmov\teax, DWORD [DWBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n\tor\teax, DWORD [DWBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n\tjnz\tnear .columnDCT\n\n\tmovq\txmm1, XMM_MMWORD [MMBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n\tmovq\txmm2, XMM_MMWORD [MMBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n\tmovq\txmm3, XMM_MMWORD [MMBLOCK(3,0,rsi,SIZEOF_JCOEF)]\n\tmovq\txmm4, XMM_MMWORD [MMBLOCK(4,0,rsi,SIZEOF_JCOEF)]\n\tmovq\txmm5, XMM_MMWORD [MMBLOCK(5,0,rsi,SIZEOF_JCOEF)]\n\tmovq\txmm6, XMM_MMWORD [MMBLOCK(6,0,rsi,SIZEOF_JCOEF)]\n\tmovq\txmm7, XMM_MMWORD [MMBLOCK(7,0,rsi,SIZEOF_JCOEF)]\n\tpor\txmm1,xmm2\n\tpor\txmm3,xmm4\n\tpor\txmm5,xmm6\n\tpor\txmm1,xmm3\n\tpor\txmm5,xmm7\n\tpor\txmm1,xmm5\n\tpacksswb xmm1,xmm1\n\tmovd\teax,xmm1\n\ttest\trax,rax\n\tjnz\tshort .columnDCT\n\n\t; -- AC terms all zero\n\n\tmovq      xmm0, XMM_MMWORD [MMBLOCK(0,0,rsi,SIZEOF_JCOEF)]\n\n\tpunpcklwd xmm0,xmm0\t\t; xmm0=(00 00 01 01 02 02 03 03)\n\tpsrad     xmm0,(DWORD_BIT-WORD_BIT)\t; xmm0=in0=(00 01 02 03)\n\tcvtdq2ps  xmm0,xmm0\t\t\t; xmm0=in0=(00 01 02 03)\n\n\tmulps\txmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_FLOAT_MULT_TYPE)]\n\n\tmovaps\txmm1,xmm0\n\tmovaps\txmm2,xmm0\n\tmovaps\txmm3,xmm0\n\n\tshufps\txmm0,xmm0,0x00\t\t\t; xmm0=(00 00 00 00)\n\tshufps\txmm1,xmm1,0x55\t\t\t; xmm1=(01 01 01 01)\n\tshufps\txmm2,xmm2,0xAA\t\t\t; xmm2=(02 02 02 02)\n\tshufps\txmm3,xmm3,0xFF\t\t\t; xmm3=(03 03 03 03)\n\n\tmovaps\tXMMWORD [XMMBLOCK(0,0,rdi,SIZEOF_FAST_FLOAT)], xmm0\n\tmovaps\tXMMWORD [XMMBLOCK(0,1,rdi,SIZEOF_FAST_FLOAT)], xmm0\n\tmovaps\tXMMWORD [XMMBLOCK(1,0,rdi,SIZEOF_FAST_FLOAT)], xmm1\n\tmovaps\tXMMWORD [XMMBLOCK(1,1,rdi,SIZEOF_FAST_FLOAT)], xmm1\n\tmovaps\tXMMWORD [XMMBLOCK(2,0,rdi,SIZEOF_FAST_FLOAT)], xmm2\n\tmovaps\tXMMWORD [XMMBLOCK(2,1,rdi,SIZEOF_FAST_FLOAT)], xmm2\n\tmovaps\tXMMWORD [XMMBLOCK(3,0,rdi,SIZEOF_FAST_FLOAT)], xmm3\n\tmovaps\tXMMWORD [XMMBLOCK(3,1,rdi,SIZEOF_FAST_FLOAT)], xmm3\n\tjmp\tnear .nextcolumn\n%endif\n.columnDCT:\n\n\t; -- Even part\n\n\tmovq      xmm0, XMM_MMWORD [MMBLOCK(0,0,rsi,SIZEOF_JCOEF)]\n\tmovq      xmm1, XMM_MMWORD [MMBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n\tmovq      xmm2, XMM_MMWORD [MMBLOCK(4,0,rsi,SIZEOF_JCOEF)]\n\tmovq      xmm3, XMM_MMWORD [MMBLOCK(6,0,rsi,SIZEOF_JCOEF)]\n\n\tpunpcklwd xmm0,xmm0\t\t; xmm0=(00 00 01 01 02 02 03 03)\n\tpunpcklwd xmm1,xmm1\t\t; xmm1=(20 20 21 21 22 22 23 23)\n\tpsrad     xmm0,(DWORD_BIT-WORD_BIT)\t; xmm0=in0=(00 01 02 03)\n\tpsrad     xmm1,(DWORD_BIT-WORD_BIT)\t; xmm1=in2=(20 21 22 23)\n\tcvtdq2ps  xmm0,xmm0\t\t\t; xmm0=in0=(00 01 02 03)\n\tcvtdq2ps  xmm1,xmm1\t\t\t; xmm1=in2=(20 21 22 23)\n\n\tpunpcklwd xmm2,xmm2\t\t; xmm2=(40 40 41 41 42 42 43 43)\n\tpunpcklwd xmm3,xmm3\t\t; xmm3=(60 60 61 61 62 62 63 63)\n\tpsrad     xmm2,(DWORD_BIT-WORD_BIT)\t; xmm2=in4=(40 41 42 43)\n\tpsrad     xmm3,(DWORD_BIT-WORD_BIT)\t; xmm3=in6=(60 61 62 63)\n\tcvtdq2ps  xmm2,xmm2\t\t\t; xmm2=in4=(40 41 42 43)\n\tcvtdq2ps  xmm3,xmm3\t\t\t; xmm3=in6=(60 61 62 63)\n\n\tmulps     xmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_FLOAT_MULT_TYPE)]\n\tmulps     xmm1, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_FLOAT_MULT_TYPE)]\n\tmulps     xmm2, XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_FLOAT_MULT_TYPE)]\n\tmulps     xmm3, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_FLOAT_MULT_TYPE)]\n\n\tmovaps\txmm4,xmm0\n\tmovaps\txmm5,xmm1\n\tsubps\txmm0,xmm2\t\t; xmm0=tmp11\n\tsubps\txmm1,xmm3\n\taddps\txmm4,xmm2\t\t; xmm4=tmp10\n\taddps\txmm5,xmm3\t\t; xmm5=tmp13\n\n\tmulps\txmm1,[rel PD_1_414]\n\tsubps\txmm1,xmm5\t\t; xmm1=tmp12\n\n\tmovaps\txmm6,xmm4\n\tmovaps\txmm7,xmm0\n\tsubps\txmm4,xmm5\t\t; xmm4=tmp3\n\tsubps\txmm0,xmm1\t\t; xmm0=tmp2\n\taddps\txmm6,xmm5\t\t; xmm6=tmp0\n\taddps\txmm7,xmm1\t\t; xmm7=tmp1\n\n\tmovaps\tXMMWORD [wk(1)], xmm4\t; tmp3\n\tmovaps\tXMMWORD [wk(0)], xmm0\t; tmp2\n\n\t; -- Odd part\n\n\tmovq      xmm2, XMM_MMWORD [MMBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n\tmovq      xmm3, XMM_MMWORD [MMBLOCK(3,0,rsi,SIZEOF_JCOEF)]\n\tmovq      xmm5, XMM_MMWORD [MMBLOCK(5,0,rsi,SIZEOF_JCOEF)]\n\tmovq      xmm1, XMM_MMWORD [MMBLOCK(7,0,rsi,SIZEOF_JCOEF)]\n\n\tpunpcklwd xmm2,xmm2\t\t; xmm2=(10 10 11 11 12 12 13 13)\n\tpunpcklwd xmm3,xmm3\t\t; xmm3=(30 30 31 31 32 32 33 33)\n\tpsrad     xmm2,(DWORD_BIT-WORD_BIT)\t; xmm2=in1=(10 11 12 13)\n\tpsrad     xmm3,(DWORD_BIT-WORD_BIT)\t; xmm3=in3=(30 31 32 33)\n\tcvtdq2ps  xmm2,xmm2\t\t\t; xmm2=in1=(10 11 12 13)\n\tcvtdq2ps  xmm3,xmm3\t\t\t; xmm3=in3=(30 31 32 33)\n\n\tpunpcklwd xmm5,xmm5\t\t; xmm5=(50 50 51 51 52 52 53 53)\n\tpunpcklwd xmm1,xmm1\t\t; xmm1=(70 70 71 71 72 72 73 73)\n\tpsrad     xmm5,(DWORD_BIT-WORD_BIT)\t; xmm5=in5=(50 51 52 53)\n\tpsrad     xmm1,(DWORD_BIT-WORD_BIT)\t; xmm1=in7=(70 71 72 73)\n\tcvtdq2ps  xmm5,xmm5\t\t\t; xmm5=in5=(50 51 52 53)\n\tcvtdq2ps  xmm1,xmm1\t\t\t; xmm1=in7=(70 71 72 73)\n\n\tmulps     xmm2, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_FLOAT_MULT_TYPE)]\n\tmulps     xmm3, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_FLOAT_MULT_TYPE)]\n\tmulps     xmm5, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_FLOAT_MULT_TYPE)]\n\tmulps     xmm1, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_FLOAT_MULT_TYPE)]\n\n\tmovaps\txmm4,xmm2\n\tmovaps\txmm0,xmm5\n\taddps\txmm2,xmm1\t\t; xmm2=z11\n\taddps\txmm5,xmm3\t\t; xmm5=z13\n\tsubps\txmm4,xmm1\t\t; xmm4=z12\n\tsubps\txmm0,xmm3\t\t; xmm0=z10\n\n\tmovaps\txmm1,xmm2\n\tsubps\txmm2,xmm5\n\taddps\txmm1,xmm5\t\t; xmm1=tmp7\n\n\tmulps\txmm2,[rel PD_1_414]\t; xmm2=tmp11\n\n\tmovaps\txmm3,xmm0\n\taddps\txmm0,xmm4\n\tmulps\txmm0,[rel PD_1_847]\t; xmm0=z5\n\tmulps\txmm3,[rel PD_M2_613]\t; xmm3=(z10 * -2.613125930)\n\tmulps\txmm4,[rel PD_1_082]\t; xmm4=(z12 * 1.082392200)\n\taddps\txmm3,xmm0\t\t; xmm3=tmp12\n\tsubps\txmm4,xmm0\t\t; xmm4=tmp10\n\n\t; -- Final output stage\n\n\tsubps\txmm3,xmm1\t\t; xmm3=tmp6\n\tmovaps\txmm5,xmm6\n\tmovaps\txmm0,xmm7\n\taddps\txmm6,xmm1\t\t; xmm6=data0=(00 01 02 03)\n\taddps\txmm7,xmm3\t\t; xmm7=data1=(10 11 12 13)\n\tsubps\txmm5,xmm1\t\t; xmm5=data7=(70 71 72 73)\n\tsubps\txmm0,xmm3\t\t; xmm0=data6=(60 61 62 63)\n\tsubps\txmm2,xmm3\t\t; xmm2=tmp5\n\n\tmovaps    xmm1,xmm6\t\t; transpose coefficients(phase 1)\n\tunpcklps  xmm6,xmm7\t\t; xmm6=(00 10 01 11)\n\tunpckhps  xmm1,xmm7\t\t; xmm1=(02 12 03 13)\n\tmovaps    xmm3,xmm0\t\t; transpose coefficients(phase 1)\n\tunpcklps  xmm0,xmm5\t\t; xmm0=(60 70 61 71)\n\tunpckhps  xmm3,xmm5\t\t; xmm3=(62 72 63 73)\n\n\tmovaps\txmm7, XMMWORD [wk(0)]\t; xmm7=tmp2\n\tmovaps\txmm5, XMMWORD [wk(1)]\t; xmm5=tmp3\n\n\tmovaps\tXMMWORD [wk(0)], xmm0\t; wk(0)=(60 70 61 71)\n\tmovaps\tXMMWORD [wk(1)], xmm3\t; wk(1)=(62 72 63 73)\n\n\taddps\txmm4,xmm2\t\t; xmm4=tmp4\n\tmovaps\txmm0,xmm7\n\tmovaps\txmm3,xmm5\n\taddps\txmm7,xmm2\t\t; xmm7=data2=(20 21 22 23)\n\taddps\txmm5,xmm4\t\t; xmm5=data4=(40 41 42 43)\n\tsubps\txmm0,xmm2\t\t; xmm0=data5=(50 51 52 53)\n\tsubps\txmm3,xmm4\t\t; xmm3=data3=(30 31 32 33)\n\n\tmovaps    xmm2,xmm7\t\t; transpose coefficients(phase 1)\n\tunpcklps  xmm7,xmm3\t\t; xmm7=(20 30 21 31)\n\tunpckhps  xmm2,xmm3\t\t; xmm2=(22 32 23 33)\n\tmovaps    xmm4,xmm5\t\t; transpose coefficients(phase 1)\n\tunpcklps  xmm5,xmm0\t\t; xmm5=(40 50 41 51)\n\tunpckhps  xmm4,xmm0\t\t; xmm4=(42 52 43 53)\n\n\tmovaps    xmm3,xmm6\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm6,xmm7\t\t; xmm6=(00 10 20 30)\n\tunpckhps2 xmm3,xmm7\t\t; xmm3=(01 11 21 31)\n\tmovaps    xmm0,xmm1\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm1,xmm2\t\t; xmm1=(02 12 22 32)\n\tunpckhps2 xmm0,xmm2\t\t; xmm0=(03 13 23 33)\n\n\tmovaps\txmm7, XMMWORD [wk(0)]\t; xmm7=(60 70 61 71)\n\tmovaps\txmm2, XMMWORD [wk(1)]\t; xmm2=(62 72 63 73)\n\n\tmovaps\tXMMWORD [XMMBLOCK(0,0,rdi,SIZEOF_FAST_FLOAT)], xmm6\n\tmovaps\tXMMWORD [XMMBLOCK(1,0,rdi,SIZEOF_FAST_FLOAT)], xmm3\n\tmovaps\tXMMWORD [XMMBLOCK(2,0,rdi,SIZEOF_FAST_FLOAT)], xmm1\n\tmovaps\tXMMWORD [XMMBLOCK(3,0,rdi,SIZEOF_FAST_FLOAT)], xmm0\n\n\tmovaps    xmm6,xmm5\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm5,xmm7\t\t; xmm5=(40 50 60 70)\n\tunpckhps2 xmm6,xmm7\t\t; xmm6=(41 51 61 71)\n\tmovaps    xmm3,xmm4\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm4,xmm2\t\t; xmm4=(42 52 62 72)\n\tunpckhps2 xmm3,xmm2\t\t; xmm3=(43 53 63 73)\n\n\tmovaps\tXMMWORD [XMMBLOCK(0,1,rdi,SIZEOF_FAST_FLOAT)], xmm5\n\tmovaps\tXMMWORD [XMMBLOCK(1,1,rdi,SIZEOF_FAST_FLOAT)], xmm6\n\tmovaps\tXMMWORD [XMMBLOCK(2,1,rdi,SIZEOF_FAST_FLOAT)], xmm4\n\tmovaps\tXMMWORD [XMMBLOCK(3,1,rdi,SIZEOF_FAST_FLOAT)], xmm3\n\n.nextcolumn:\n\tadd\trsi, byte 4*SIZEOF_JCOEF\t\t; coef_block\n\tadd\trdx, byte 4*SIZEOF_FLOAT_MULT_TYPE\t; quantptr\n\tadd\trdi,      4*DCTSIZE*SIZEOF_FAST_FLOAT\t; wsptr\n\tdec\trcx\t\t\t\t\t; ctr\n\tjnz\tnear .columnloop\n\n\t; -- Prefetch the next coefficient block\n\n\tprefetchnta [rsi + (DCTSIZE2-8)*SIZEOF_JCOEF + 0*32]\n\tprefetchnta [rsi + (DCTSIZE2-8)*SIZEOF_JCOEF + 1*32]\n\tprefetchnta [rsi + (DCTSIZE2-8)*SIZEOF_JCOEF + 2*32]\n\tprefetchnta [rsi + (DCTSIZE2-8)*SIZEOF_JCOEF + 3*32]\n\n\t; ---- Pass 2: process rows from work array, store into output array.\n\n\tmov\trax, [original_rbp]\n\tlea\trsi, [workspace]\t\t\t; FAST_FLOAT * wsptr\n\tmov\trdi, r12\t; (JSAMPROW *)\n\tmov\trax, r13\n\tmov\trcx, DCTSIZE/4\t\t\t\t; ctr\n.rowloop:\n\n\t; -- Even part\n\n\tmovaps\txmm0, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm2, XMMWORD [XMMBLOCK(4,0,rsi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm3, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_FAST_FLOAT)]\n\n\tmovaps\txmm4,xmm0\n\tmovaps\txmm5,xmm1\n\tsubps\txmm0,xmm2\t\t; xmm0=tmp11\n\tsubps\txmm1,xmm3\n\taddps\txmm4,xmm2\t\t; xmm4=tmp10\n\taddps\txmm5,xmm3\t\t; xmm5=tmp13\n\n\tmulps\txmm1,[rel PD_1_414]\n\tsubps\txmm1,xmm5\t\t; xmm1=tmp12\n\n\tmovaps\txmm6,xmm4\n\tmovaps\txmm7,xmm0\n\tsubps\txmm4,xmm5\t\t; xmm4=tmp3\n\tsubps\txmm0,xmm1\t\t; xmm0=tmp2\n\taddps\txmm6,xmm5\t\t; xmm6=tmp0\n\taddps\txmm7,xmm1\t\t; xmm7=tmp1\n\n\tmovaps\tXMMWORD [wk(1)], xmm4\t; tmp3\n\tmovaps\tXMMWORD [wk(0)], xmm0\t; tmp2\n\n\t; -- Odd part\n\n\tmovaps\txmm2, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm3, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm5, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm1, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_FAST_FLOAT)]\n\n\tmovaps\txmm4,xmm2\n\tmovaps\txmm0,xmm5\n\taddps\txmm2,xmm1\t\t; xmm2=z11\n\taddps\txmm5,xmm3\t\t; xmm5=z13\n\tsubps\txmm4,xmm1\t\t; xmm4=z12\n\tsubps\txmm0,xmm3\t\t; xmm0=z10\n\n\tmovaps\txmm1,xmm2\n\tsubps\txmm2,xmm5\n\taddps\txmm1,xmm5\t\t; xmm1=tmp7\n\n\tmulps\txmm2,[rel PD_1_414]\t; xmm2=tmp11\n\n\tmovaps\txmm3,xmm0\n\taddps\txmm0,xmm4\n\tmulps\txmm0,[rel PD_1_847]\t; xmm0=z5\n\tmulps\txmm3,[rel PD_M2_613]\t; xmm3=(z10 * -2.613125930)\n\tmulps\txmm4,[rel PD_1_082]\t; xmm4=(z12 * 1.082392200)\n\taddps\txmm3,xmm0\t\t; xmm3=tmp12\n\tsubps\txmm4,xmm0\t\t; xmm4=tmp10\n\n\t; -- Final output stage\n\n\tsubps\txmm3,xmm1\t\t; xmm3=tmp6\n\tmovaps\txmm5,xmm6\n\tmovaps\txmm0,xmm7\n\taddps\txmm6,xmm1\t\t; xmm6=data0=(00 10 20 30)\n\taddps\txmm7,xmm3\t\t; xmm7=data1=(01 11 21 31)\n\tsubps\txmm5,xmm1\t\t; xmm5=data7=(07 17 27 37)\n\tsubps\txmm0,xmm3\t\t; xmm0=data6=(06 16 26 36)\n\tsubps\txmm2,xmm3\t\t; xmm2=tmp5\n\n\tmovaps\txmm1,[rel PD_RNDINT_MAGIC]\t; xmm1=[rel PD_RNDINT_MAGIC]\n\tpcmpeqd\txmm3,xmm3\n\tpsrld\txmm3,WORD_BIT\t\t; xmm3={0xFFFF 0x0000 0xFFFF 0x0000 ..}\n\n\taddps\txmm6,xmm1\t; xmm6=roundint(data0/8)=(00 ** 10 ** 20 ** 30 **)\n\taddps\txmm7,xmm1\t; xmm7=roundint(data1/8)=(01 ** 11 ** 21 ** 31 **)\n\taddps\txmm0,xmm1\t; xmm0=roundint(data6/8)=(06 ** 16 ** 26 ** 36 **)\n\taddps\txmm5,xmm1\t; xmm5=roundint(data7/8)=(07 ** 17 ** 27 ** 37 **)\n\n\tpand\txmm6,xmm3\t\t; xmm6=(00 -- 10 -- 20 -- 30 --)\n\tpslld\txmm7,WORD_BIT\t\t; xmm7=(-- 01 -- 11 -- 21 -- 31)\n\tpand\txmm0,xmm3\t\t; xmm0=(06 -- 16 -- 26 -- 36 --)\n\tpslld\txmm5,WORD_BIT\t\t; xmm5=(-- 07 -- 17 -- 27 -- 37)\n\tpor\txmm6,xmm7\t\t; xmm6=(00 01 10 11 20 21 30 31)\n\tpor\txmm0,xmm5\t\t; xmm0=(06 07 16 17 26 27 36 37)\n\n\tmovaps\txmm1, XMMWORD [wk(0)]\t; xmm1=tmp2\n\tmovaps\txmm3, XMMWORD [wk(1)]\t; xmm3=tmp3\n\n\taddps\txmm4,xmm2\t\t; xmm4=tmp4\n\tmovaps\txmm7,xmm1\n\tmovaps\txmm5,xmm3\n\taddps\txmm1,xmm2\t\t; xmm1=data2=(02 12 22 32)\n\taddps\txmm3,xmm4\t\t; xmm3=data4=(04 14 24 34)\n\tsubps\txmm7,xmm2\t\t; xmm7=data5=(05 15 25 35)\n\tsubps\txmm5,xmm4\t\t; xmm5=data3=(03 13 23 33)\n\n\tmovaps\txmm2,[rel PD_RNDINT_MAGIC]\t; xmm2=[rel PD_RNDINT_MAGIC]\n\tpcmpeqd\txmm4,xmm4\n\tpsrld\txmm4,WORD_BIT\t\t; xmm4={0xFFFF 0x0000 0xFFFF 0x0000 ..}\n\n\taddps\txmm3,xmm2\t; xmm3=roundint(data4/8)=(04 ** 14 ** 24 ** 34 **)\n\taddps\txmm7,xmm2\t; xmm7=roundint(data5/8)=(05 ** 15 ** 25 ** 35 **)\n\taddps\txmm1,xmm2\t; xmm1=roundint(data2/8)=(02 ** 12 ** 22 ** 32 **)\n\taddps\txmm5,xmm2\t; xmm5=roundint(data3/8)=(03 ** 13 ** 23 ** 33 **)\n\n\tpand\txmm3,xmm4\t\t; xmm3=(04 -- 14 -- 24 -- 34 --)\n\tpslld\txmm7,WORD_BIT\t\t; xmm7=(-- 05 -- 15 -- 25 -- 35)\n\tpand\txmm1,xmm4\t\t; xmm1=(02 -- 12 -- 22 -- 32 --)\n\tpslld\txmm5,WORD_BIT\t\t; xmm5=(-- 03 -- 13 -- 23 -- 33)\n\tpor\txmm3,xmm7\t\t; xmm3=(04 05 14 15 24 25 34 35)\n\tpor\txmm1,xmm5\t\t; xmm1=(02 03 12 13 22 23 32 33)\n\n\tmovdqa    xmm2,[rel PB_CENTERJSAMP]\t; xmm2=[rel PB_CENTERJSAMP]\n\n\tpacksswb  xmm6,xmm3\t; xmm6=(00 01 10 11 20 21 30 31 04 05 14 15 24 25 34 35)\n\tpacksswb  xmm1,xmm0\t; xmm1=(02 03 12 13 22 23 32 33 06 07 16 17 26 27 36 37)\n\tpaddb     xmm6,xmm2\n\tpaddb     xmm1,xmm2\n\n\tmovdqa    xmm4,xmm6\t; transpose coefficients(phase 2)\n\tpunpcklwd xmm6,xmm1\t; xmm6=(00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33)\n\tpunpckhwd xmm4,xmm1\t; xmm4=(04 05 06 07 14 15 16 17 24 25 26 27 34 35 36 37)\n\n\tmovdqa    xmm7,xmm6\t; transpose coefficients(phase 3)\n\tpunpckldq xmm6,xmm4\t; xmm6=(00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17)\n\tpunpckhdq xmm7,xmm4\t; xmm7=(20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37)\n\n\tpshufd\txmm5,xmm6,0x4E\t; xmm5=(10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07)\n\tpshufd\txmm3,xmm7,0x4E\t; xmm3=(30 31 32 33 34 35 36 37 20 21 22 23 24 25 26 27)\n\n\tmov\trdx, JSAMPROW [rdi+0*SIZEOF_JSAMPROW]\n\tmov\trbx, JSAMPROW [rdi+2*SIZEOF_JSAMPROW]\n\tmovq\tXMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm6\n\tmovq\tXMM_MMWORD [rbx+rax*SIZEOF_JSAMPLE], xmm7\n\tmov\trdx, JSAMPROW [rdi+1*SIZEOF_JSAMPROW]\n\tmov\trbx, JSAMPROW [rdi+3*SIZEOF_JSAMPROW]\n\tmovq\tXMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm5\n\tmovq\tXMM_MMWORD [rbx+rax*SIZEOF_JSAMPLE], xmm3\n\n\tadd\trsi, byte 4*SIZEOF_FAST_FLOAT\t; wsptr\n\tadd\trdi, byte 4*SIZEOF_JSAMPROW\n\tdec\trcx\t\t\t\t; ctr\n\tjnz\tnear .rowloop\n\n\tpop\trbx\n\tuncollect_args\n\tmov\trsp,rbp\t\t; rsp <- aligned rbp\n\tpop\trsp\t\t; rsp <- original rbp\n\tpop\trbp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jiss2flt.asm",
    "content": ";\n; jiss2flt.asm - floating-point IDCT (SSE & SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a floating-point implementation of the inverse DCT\n; (Discrete Cosine Transform). The following code is based directly on\n; the IJG's original jidctflt.c; see the jidctflt.c for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%macro\tunpcklps2 2\t; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(0 1 4 5)\n\tshufps\t%1,%2,0x44\n%endmacro\n\n%macro\tunpckhps2 2\t; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(2 3 6 7)\n\tshufps\t%1,%2,0xEE\n%endmacro\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_idct_float_sse2)\n\nEXTN(jconst_idct_float_sse2):\n\nPD_1_414\ttimes 4 dd  1.414213562373095048801689\nPD_1_847\ttimes 4 dd  1.847759065022573512256366\nPD_1_082\ttimes 4 dd  1.082392200292393968799446\nPD_M2_613\ttimes 4 dd -2.613125929752753055713286\nPD_RNDINT_MAGIC\ttimes 4 dd  100663296.0\t; (float)(0x00C00000 << 3)\nPB_CENTERJSAMP\ttimes 16 db CENTERJSAMPLE\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Perform dequantization and inverse DCT on one block of coefficients.\n;\n; GLOBAL(void)\n; jsimd_idct_float_sse2 (void * dct_table, JCOEFPTR coef_block,\n;                        JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n%define dct_table(b)\t(b)+8\t\t\t; void * dct_table\n%define coef_block(b)\t(b)+12\t\t; JCOEFPTR coef_block\n%define output_buf(b)\t(b)+16\t\t; JSAMPARRAY output_buf\n%define output_col(b)\t(b)+20\t\t; JDIMENSION output_col\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t2\n%define workspace\twk(0)-DCTSIZE2*SIZEOF_FAST_FLOAT\n\t\t\t\t\t; FAST_FLOAT workspace[DCTSIZE2]\n\n\talign\t16\n\tglobal\tEXTN(jsimd_idct_float_sse2)\n\nEXTN(jsimd_idct_float_sse2):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [workspace]\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t; get GOT address\n\n\t; ---- Pass 1: process columns from input, store into work array.\n\n;\tmov\teax, [original_ebp]\n\tmov\tedx, POINTER [dct_table(eax)]\t; quantptr\n\tmov\tesi, JCOEFPTR [coef_block(eax)]\t\t; inptr\n\tlea\tedi, [workspace]\t\t\t; FAST_FLOAT * wsptr\n\tmov\tecx, DCTSIZE/4\t\t\t\t; ctr\n\talignx\t16,7\n.columnloop:\n%ifndef NO_ZERO_COLUMN_TEST_FLOAT_SSE\n\tmov\teax, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tor\teax, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tjnz\tnear .columnDCT\n\n\tmovq\txmm1, XMM_MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tmovq\txmm2, XMM_MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tmovq\txmm3, XMM_MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tmovq\txmm4, XMM_MMWORD [MMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n\tmovq\txmm5, XMM_MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tmovq\txmm6, XMM_MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\tmovq\txmm7, XMM_MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\tpor\txmm1,xmm2\n\tpor\txmm3,xmm4\n\tpor\txmm5,xmm6\n\tpor\txmm1,xmm3\n\tpor\txmm5,xmm7\n\tpor\txmm1,xmm5\n\tpacksswb xmm1,xmm1\n\tmovd\teax,xmm1\n\ttest\teax,eax\n\tjnz\tshort .columnDCT\n\n\t; -- AC terms all zero\n\n\tmovq      xmm0, XMM_MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\n\tpunpcklwd xmm0,xmm0\t\t; xmm0=(00 00 01 01 02 02 03 03)\n\tpsrad     xmm0,(DWORD_BIT-WORD_BIT)\t; xmm0=in0=(00 01 02 03)\n\tcvtdq2ps  xmm0,xmm0\t\t\t; xmm0=in0=(00 01 02 03)\n\n\tmulps\txmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n\tmovaps\txmm1,xmm0\n\tmovaps\txmm2,xmm0\n\tmovaps\txmm3,xmm0\n\n\tshufps\txmm0,xmm0,0x00\t\t\t; xmm0=(00 00 00 00)\n\tshufps\txmm1,xmm1,0x55\t\t\t; xmm1=(01 01 01 01)\n\tshufps\txmm2,xmm2,0xAA\t\t\t; xmm2=(02 02 02 02)\n\tshufps\txmm3,xmm3,0xFF\t\t\t; xmm3=(03 03 03 03)\n\n\tmovaps\tXMMWORD [XMMBLOCK(0,0,edi,SIZEOF_FAST_FLOAT)], xmm0\n\tmovaps\tXMMWORD [XMMBLOCK(0,1,edi,SIZEOF_FAST_FLOAT)], xmm0\n\tmovaps\tXMMWORD [XMMBLOCK(1,0,edi,SIZEOF_FAST_FLOAT)], xmm1\n\tmovaps\tXMMWORD [XMMBLOCK(1,1,edi,SIZEOF_FAST_FLOAT)], xmm1\n\tmovaps\tXMMWORD [XMMBLOCK(2,0,edi,SIZEOF_FAST_FLOAT)], xmm2\n\tmovaps\tXMMWORD [XMMBLOCK(2,1,edi,SIZEOF_FAST_FLOAT)], xmm2\n\tmovaps\tXMMWORD [XMMBLOCK(3,0,edi,SIZEOF_FAST_FLOAT)], xmm3\n\tmovaps\tXMMWORD [XMMBLOCK(3,1,edi,SIZEOF_FAST_FLOAT)], xmm3\n\tjmp\tnear .nextcolumn\n\talignx\t16,7\n%endif\n.columnDCT:\n\n\t; -- Even part\n\n\tmovq      xmm0, XMM_MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\tmovq      xmm1, XMM_MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tmovq      xmm2, XMM_MMWORD [MMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n\tmovq      xmm3, XMM_MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\n\tpunpcklwd xmm0,xmm0\t\t; xmm0=(00 00 01 01 02 02 03 03)\n\tpunpcklwd xmm1,xmm1\t\t; xmm1=(20 20 21 21 22 22 23 23)\n\tpsrad     xmm0,(DWORD_BIT-WORD_BIT)\t; xmm0=in0=(00 01 02 03)\n\tpsrad     xmm1,(DWORD_BIT-WORD_BIT)\t; xmm1=in2=(20 21 22 23)\n\tcvtdq2ps  xmm0,xmm0\t\t\t; xmm0=in0=(00 01 02 03)\n\tcvtdq2ps  xmm1,xmm1\t\t\t; xmm1=in2=(20 21 22 23)\n\n\tpunpcklwd xmm2,xmm2\t\t; xmm2=(40 40 41 41 42 42 43 43)\n\tpunpcklwd xmm3,xmm3\t\t; xmm3=(60 60 61 61 62 62 63 63)\n\tpsrad     xmm2,(DWORD_BIT-WORD_BIT)\t; xmm2=in4=(40 41 42 43)\n\tpsrad     xmm3,(DWORD_BIT-WORD_BIT)\t; xmm3=in6=(60 61 62 63)\n\tcvtdq2ps  xmm2,xmm2\t\t\t; xmm2=in4=(40 41 42 43)\n\tcvtdq2ps  xmm3,xmm3\t\t\t; xmm3=in6=(60 61 62 63)\n\n\tmulps     xmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\tmulps     xmm1, XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\tmulps     xmm2, XMMWORD [XMMBLOCK(4,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\tmulps     xmm3, XMMWORD [XMMBLOCK(6,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n\tmovaps\txmm4,xmm0\n\tmovaps\txmm5,xmm1\n\tsubps\txmm0,xmm2\t\t; xmm0=tmp11\n\tsubps\txmm1,xmm3\n\taddps\txmm4,xmm2\t\t; xmm4=tmp10\n\taddps\txmm5,xmm3\t\t; xmm5=tmp13\n\n\tmulps\txmm1,[GOTOFF(ebx,PD_1_414)]\n\tsubps\txmm1,xmm5\t\t; xmm1=tmp12\n\n\tmovaps\txmm6,xmm4\n\tmovaps\txmm7,xmm0\n\tsubps\txmm4,xmm5\t\t; xmm4=tmp3\n\tsubps\txmm0,xmm1\t\t; xmm0=tmp2\n\taddps\txmm6,xmm5\t\t; xmm6=tmp0\n\taddps\txmm7,xmm1\t\t; xmm7=tmp1\n\n\tmovaps\tXMMWORD [wk(1)], xmm4\t; tmp3\n\tmovaps\tXMMWORD [wk(0)], xmm0\t; tmp2\n\n\t; -- Odd part\n\n\tmovq      xmm2, XMM_MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tmovq      xmm3, XMM_MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tmovq      xmm5, XMM_MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tmovq      xmm1, XMM_MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\n\tpunpcklwd xmm2,xmm2\t\t; xmm2=(10 10 11 11 12 12 13 13)\n\tpunpcklwd xmm3,xmm3\t\t; xmm3=(30 30 31 31 32 32 33 33)\n\tpsrad     xmm2,(DWORD_BIT-WORD_BIT)\t; xmm2=in1=(10 11 12 13)\n\tpsrad     xmm3,(DWORD_BIT-WORD_BIT)\t; xmm3=in3=(30 31 32 33)\n\tcvtdq2ps  xmm2,xmm2\t\t\t; xmm2=in1=(10 11 12 13)\n\tcvtdq2ps  xmm3,xmm3\t\t\t; xmm3=in3=(30 31 32 33)\n\n\tpunpcklwd xmm5,xmm5\t\t; xmm5=(50 50 51 51 52 52 53 53)\n\tpunpcklwd xmm1,xmm1\t\t; xmm1=(70 70 71 71 72 72 73 73)\n\tpsrad     xmm5,(DWORD_BIT-WORD_BIT)\t; xmm5=in5=(50 51 52 53)\n\tpsrad     xmm1,(DWORD_BIT-WORD_BIT)\t; xmm1=in7=(70 71 72 73)\n\tcvtdq2ps  xmm5,xmm5\t\t\t; xmm5=in5=(50 51 52 53)\n\tcvtdq2ps  xmm1,xmm1\t\t\t; xmm1=in7=(70 71 72 73)\n\n\tmulps     xmm2, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\tmulps     xmm3, XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\tmulps     xmm5, XMMWORD [XMMBLOCK(5,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\tmulps     xmm1, XMMWORD [XMMBLOCK(7,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n\tmovaps\txmm4,xmm2\n\tmovaps\txmm0,xmm5\n\taddps\txmm2,xmm1\t\t; xmm2=z11\n\taddps\txmm5,xmm3\t\t; xmm5=z13\n\tsubps\txmm4,xmm1\t\t; xmm4=z12\n\tsubps\txmm0,xmm3\t\t; xmm0=z10\n\n\tmovaps\txmm1,xmm2\n\tsubps\txmm2,xmm5\n\taddps\txmm1,xmm5\t\t; xmm1=tmp7\n\n\tmulps\txmm2,[GOTOFF(ebx,PD_1_414)]\t; xmm2=tmp11\n\n\tmovaps\txmm3,xmm0\n\taddps\txmm0,xmm4\n\tmulps\txmm0,[GOTOFF(ebx,PD_1_847)]\t; xmm0=z5\n\tmulps\txmm3,[GOTOFF(ebx,PD_M2_613)]\t; xmm3=(z10 * -2.613125930)\n\tmulps\txmm4,[GOTOFF(ebx,PD_1_082)]\t; xmm4=(z12 * 1.082392200)\n\taddps\txmm3,xmm0\t\t; xmm3=tmp12\n\tsubps\txmm4,xmm0\t\t; xmm4=tmp10\n\n\t; -- Final output stage\n\n\tsubps\txmm3,xmm1\t\t; xmm3=tmp6\n\tmovaps\txmm5,xmm6\n\tmovaps\txmm0,xmm7\n\taddps\txmm6,xmm1\t\t; xmm6=data0=(00 01 02 03)\n\taddps\txmm7,xmm3\t\t; xmm7=data1=(10 11 12 13)\n\tsubps\txmm5,xmm1\t\t; xmm5=data7=(70 71 72 73)\n\tsubps\txmm0,xmm3\t\t; xmm0=data6=(60 61 62 63)\n\tsubps\txmm2,xmm3\t\t; xmm2=tmp5\n\n\tmovaps    xmm1,xmm6\t\t; transpose coefficients(phase 1)\n\tunpcklps  xmm6,xmm7\t\t; xmm6=(00 10 01 11)\n\tunpckhps  xmm1,xmm7\t\t; xmm1=(02 12 03 13)\n\tmovaps    xmm3,xmm0\t\t; transpose coefficients(phase 1)\n\tunpcklps  xmm0,xmm5\t\t; xmm0=(60 70 61 71)\n\tunpckhps  xmm3,xmm5\t\t; xmm3=(62 72 63 73)\n\n\tmovaps\txmm7, XMMWORD [wk(0)]\t; xmm7=tmp2\n\tmovaps\txmm5, XMMWORD [wk(1)]\t; xmm5=tmp3\n\n\tmovaps\tXMMWORD [wk(0)], xmm0\t; wk(0)=(60 70 61 71)\n\tmovaps\tXMMWORD [wk(1)], xmm3\t; wk(1)=(62 72 63 73)\n\n\taddps\txmm4,xmm2\t\t; xmm4=tmp4\n\tmovaps\txmm0,xmm7\n\tmovaps\txmm3,xmm5\n\taddps\txmm7,xmm2\t\t; xmm7=data2=(20 21 22 23)\n\taddps\txmm5,xmm4\t\t; xmm5=data4=(40 41 42 43)\n\tsubps\txmm0,xmm2\t\t; xmm0=data5=(50 51 52 53)\n\tsubps\txmm3,xmm4\t\t; xmm3=data3=(30 31 32 33)\n\n\tmovaps    xmm2,xmm7\t\t; transpose coefficients(phase 1)\n\tunpcklps  xmm7,xmm3\t\t; xmm7=(20 30 21 31)\n\tunpckhps  xmm2,xmm3\t\t; xmm2=(22 32 23 33)\n\tmovaps    xmm4,xmm5\t\t; transpose coefficients(phase 1)\n\tunpcklps  xmm5,xmm0\t\t; xmm5=(40 50 41 51)\n\tunpckhps  xmm4,xmm0\t\t; xmm4=(42 52 43 53)\n\n\tmovaps    xmm3,xmm6\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm6,xmm7\t\t; xmm6=(00 10 20 30)\n\tunpckhps2 xmm3,xmm7\t\t; xmm3=(01 11 21 31)\n\tmovaps    xmm0,xmm1\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm1,xmm2\t\t; xmm1=(02 12 22 32)\n\tunpckhps2 xmm0,xmm2\t\t; xmm0=(03 13 23 33)\n\n\tmovaps\txmm7, XMMWORD [wk(0)]\t; xmm7=(60 70 61 71)\n\tmovaps\txmm2, XMMWORD [wk(1)]\t; xmm2=(62 72 63 73)\n\n\tmovaps\tXMMWORD [XMMBLOCK(0,0,edi,SIZEOF_FAST_FLOAT)], xmm6\n\tmovaps\tXMMWORD [XMMBLOCK(1,0,edi,SIZEOF_FAST_FLOAT)], xmm3\n\tmovaps\tXMMWORD [XMMBLOCK(2,0,edi,SIZEOF_FAST_FLOAT)], xmm1\n\tmovaps\tXMMWORD [XMMBLOCK(3,0,edi,SIZEOF_FAST_FLOAT)], xmm0\n\n\tmovaps    xmm6,xmm5\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm5,xmm7\t\t; xmm5=(40 50 60 70)\n\tunpckhps2 xmm6,xmm7\t\t; xmm6=(41 51 61 71)\n\tmovaps    xmm3,xmm4\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm4,xmm2\t\t; xmm4=(42 52 62 72)\n\tunpckhps2 xmm3,xmm2\t\t; xmm3=(43 53 63 73)\n\n\tmovaps\tXMMWORD [XMMBLOCK(0,1,edi,SIZEOF_FAST_FLOAT)], xmm5\n\tmovaps\tXMMWORD [XMMBLOCK(1,1,edi,SIZEOF_FAST_FLOAT)], xmm6\n\tmovaps\tXMMWORD [XMMBLOCK(2,1,edi,SIZEOF_FAST_FLOAT)], xmm4\n\tmovaps\tXMMWORD [XMMBLOCK(3,1,edi,SIZEOF_FAST_FLOAT)], xmm3\n\n.nextcolumn:\n\tadd\tesi, byte 4*SIZEOF_JCOEF\t\t; coef_block\n\tadd\tedx, byte 4*SIZEOF_FLOAT_MULT_TYPE\t; quantptr\n\tadd\tedi,      4*DCTSIZE*SIZEOF_FAST_FLOAT\t; wsptr\n\tdec\tecx\t\t\t\t\t; ctr\n\tjnz\tnear .columnloop\n\n\t; -- Prefetch the next coefficient block\n\n\tprefetchnta [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 0*32]\n\tprefetchnta [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 1*32]\n\tprefetchnta [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 2*32]\n\tprefetchnta [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 3*32]\n\n\t; ---- Pass 2: process rows from work array, store into output array.\n\n\tmov\teax, [original_ebp]\n\tlea\tesi, [workspace]\t\t\t; FAST_FLOAT * wsptr\n\tmov\tedi, JSAMPARRAY [output_buf(eax)]\t; (JSAMPROW *)\n\tmov\teax, JDIMENSION [output_col(eax)]\n\tmov\tecx, DCTSIZE/4\t\t\t\t; ctr\n\talignx\t16,7\n.rowloop:\n\n\t; -- Even part\n\n\tmovaps\txmm0, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm1, XMMWORD [XMMBLOCK(2,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm2, XMMWORD [XMMBLOCK(4,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm3, XMMWORD [XMMBLOCK(6,0,esi,SIZEOF_FAST_FLOAT)]\n\n\tmovaps\txmm4,xmm0\n\tmovaps\txmm5,xmm1\n\tsubps\txmm0,xmm2\t\t; xmm0=tmp11\n\tsubps\txmm1,xmm3\n\taddps\txmm4,xmm2\t\t; xmm4=tmp10\n\taddps\txmm5,xmm3\t\t; xmm5=tmp13\n\n\tmulps\txmm1,[GOTOFF(ebx,PD_1_414)]\n\tsubps\txmm1,xmm5\t\t; xmm1=tmp12\n\n\tmovaps\txmm6,xmm4\n\tmovaps\txmm7,xmm0\n\tsubps\txmm4,xmm5\t\t; xmm4=tmp3\n\tsubps\txmm0,xmm1\t\t; xmm0=tmp2\n\taddps\txmm6,xmm5\t\t; xmm6=tmp0\n\taddps\txmm7,xmm1\t\t; xmm7=tmp1\n\n\tmovaps\tXMMWORD [wk(1)], xmm4\t; tmp3\n\tmovaps\tXMMWORD [wk(0)], xmm0\t; tmp2\n\n\t; -- Odd part\n\n\tmovaps\txmm2, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm3, XMMWORD [XMMBLOCK(3,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm5, XMMWORD [XMMBLOCK(5,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm1, XMMWORD [XMMBLOCK(7,0,esi,SIZEOF_FAST_FLOAT)]\n\n\tmovaps\txmm4,xmm2\n\tmovaps\txmm0,xmm5\n\taddps\txmm2,xmm1\t\t; xmm2=z11\n\taddps\txmm5,xmm3\t\t; xmm5=z13\n\tsubps\txmm4,xmm1\t\t; xmm4=z12\n\tsubps\txmm0,xmm3\t\t; xmm0=z10\n\n\tmovaps\txmm1,xmm2\n\tsubps\txmm2,xmm5\n\taddps\txmm1,xmm5\t\t; xmm1=tmp7\n\n\tmulps\txmm2,[GOTOFF(ebx,PD_1_414)]\t; xmm2=tmp11\n\n\tmovaps\txmm3,xmm0\n\taddps\txmm0,xmm4\n\tmulps\txmm0,[GOTOFF(ebx,PD_1_847)]\t; xmm0=z5\n\tmulps\txmm3,[GOTOFF(ebx,PD_M2_613)]\t; xmm3=(z10 * -2.613125930)\n\tmulps\txmm4,[GOTOFF(ebx,PD_1_082)]\t; xmm4=(z12 * 1.082392200)\n\taddps\txmm3,xmm0\t\t; xmm3=tmp12\n\tsubps\txmm4,xmm0\t\t; xmm4=tmp10\n\n\t; -- Final output stage\n\n\tsubps\txmm3,xmm1\t\t; xmm3=tmp6\n\tmovaps\txmm5,xmm6\n\tmovaps\txmm0,xmm7\n\taddps\txmm6,xmm1\t\t; xmm6=data0=(00 10 20 30)\n\taddps\txmm7,xmm3\t\t; xmm7=data1=(01 11 21 31)\n\tsubps\txmm5,xmm1\t\t; xmm5=data7=(07 17 27 37)\n\tsubps\txmm0,xmm3\t\t; xmm0=data6=(06 16 26 36)\n\tsubps\txmm2,xmm3\t\t; xmm2=tmp5\n\n\tmovaps\txmm1,[GOTOFF(ebx,PD_RNDINT_MAGIC)]\t; xmm1=[PD_RNDINT_MAGIC]\n\tpcmpeqd\txmm3,xmm3\n\tpsrld\txmm3,WORD_BIT\t\t; xmm3={0xFFFF 0x0000 0xFFFF 0x0000 ..}\n\n\taddps\txmm6,xmm1\t; xmm6=roundint(data0/8)=(00 ** 10 ** 20 ** 30 **)\n\taddps\txmm7,xmm1\t; xmm7=roundint(data1/8)=(01 ** 11 ** 21 ** 31 **)\n\taddps\txmm0,xmm1\t; xmm0=roundint(data6/8)=(06 ** 16 ** 26 ** 36 **)\n\taddps\txmm5,xmm1\t; xmm5=roundint(data7/8)=(07 ** 17 ** 27 ** 37 **)\n\n\tpand\txmm6,xmm3\t\t; xmm6=(00 -- 10 -- 20 -- 30 --)\n\tpslld\txmm7,WORD_BIT\t\t; xmm7=(-- 01 -- 11 -- 21 -- 31)\n\tpand\txmm0,xmm3\t\t; xmm0=(06 -- 16 -- 26 -- 36 --)\n\tpslld\txmm5,WORD_BIT\t\t; xmm5=(-- 07 -- 17 -- 27 -- 37)\n\tpor\txmm6,xmm7\t\t; xmm6=(00 01 10 11 20 21 30 31)\n\tpor\txmm0,xmm5\t\t; xmm0=(06 07 16 17 26 27 36 37)\n\n\tmovaps\txmm1, XMMWORD [wk(0)]\t; xmm1=tmp2\n\tmovaps\txmm3, XMMWORD [wk(1)]\t; xmm3=tmp3\n\n\taddps\txmm4,xmm2\t\t; xmm4=tmp4\n\tmovaps\txmm7,xmm1\n\tmovaps\txmm5,xmm3\n\taddps\txmm1,xmm2\t\t; xmm1=data2=(02 12 22 32)\n\taddps\txmm3,xmm4\t\t; xmm3=data4=(04 14 24 34)\n\tsubps\txmm7,xmm2\t\t; xmm7=data5=(05 15 25 35)\n\tsubps\txmm5,xmm4\t\t; xmm5=data3=(03 13 23 33)\n\n\tmovaps\txmm2,[GOTOFF(ebx,PD_RNDINT_MAGIC)]\t; xmm2=[PD_RNDINT_MAGIC]\n\tpcmpeqd\txmm4,xmm4\n\tpsrld\txmm4,WORD_BIT\t\t; xmm4={0xFFFF 0x0000 0xFFFF 0x0000 ..}\n\n\taddps\txmm3,xmm2\t; xmm3=roundint(data4/8)=(04 ** 14 ** 24 ** 34 **)\n\taddps\txmm7,xmm2\t; xmm7=roundint(data5/8)=(05 ** 15 ** 25 ** 35 **)\n\taddps\txmm1,xmm2\t; xmm1=roundint(data2/8)=(02 ** 12 ** 22 ** 32 **)\n\taddps\txmm5,xmm2\t; xmm5=roundint(data3/8)=(03 ** 13 ** 23 ** 33 **)\n\n\tpand\txmm3,xmm4\t\t; xmm3=(04 -- 14 -- 24 -- 34 --)\n\tpslld\txmm7,WORD_BIT\t\t; xmm7=(-- 05 -- 15 -- 25 -- 35)\n\tpand\txmm1,xmm4\t\t; xmm1=(02 -- 12 -- 22 -- 32 --)\n\tpslld\txmm5,WORD_BIT\t\t; xmm5=(-- 03 -- 13 -- 23 -- 33)\n\tpor\txmm3,xmm7\t\t; xmm3=(04 05 14 15 24 25 34 35)\n\tpor\txmm1,xmm5\t\t; xmm1=(02 03 12 13 22 23 32 33)\n\n\tmovdqa    xmm2,[GOTOFF(ebx,PB_CENTERJSAMP)]\t; xmm2=[PB_CENTERJSAMP]\n\n\tpacksswb  xmm6,xmm3\t; xmm6=(00 01 10 11 20 21 30 31 04 05 14 15 24 25 34 35)\n\tpacksswb  xmm1,xmm0\t; xmm1=(02 03 12 13 22 23 32 33 06 07 16 17 26 27 36 37)\n\tpaddb     xmm6,xmm2\n\tpaddb     xmm1,xmm2\n\n\tmovdqa    xmm4,xmm6\t; transpose coefficients(phase 2)\n\tpunpcklwd xmm6,xmm1\t; xmm6=(00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33)\n\tpunpckhwd xmm4,xmm1\t; xmm4=(04 05 06 07 14 15 16 17 24 25 26 27 34 35 36 37)\n\n\tmovdqa    xmm7,xmm6\t; transpose coefficients(phase 3)\n\tpunpckldq xmm6,xmm4\t; xmm6=(00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17)\n\tpunpckhdq xmm7,xmm4\t; xmm7=(20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37)\n\n\tpshufd\txmm5,xmm6,0x4E\t; xmm5=(10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07)\n\tpshufd\txmm3,xmm7,0x4E\t; xmm3=(30 31 32 33 34 35 36 37 20 21 22 23 24 25 26 27)\n\n\tpushpic\tebx\t\t\t; save GOT address\n\n\tmov\tedx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\n\tmov\tebx, JSAMPROW [edi+2*SIZEOF_JSAMPROW]\n\tmovq\tXMM_MMWORD [edx+eax*SIZEOF_JSAMPLE], xmm6\n\tmovq\tXMM_MMWORD [ebx+eax*SIZEOF_JSAMPLE], xmm7\n\tmov\tedx, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\n\tmov\tebx, JSAMPROW [edi+3*SIZEOF_JSAMPROW]\n\tmovq\tXMM_MMWORD [edx+eax*SIZEOF_JSAMPLE], xmm5\n\tmovq\tXMM_MMWORD [ebx+eax*SIZEOF_JSAMPLE], xmm3\n\n\tpoppic\tebx\t\t\t; restore GOT address\n\n\tadd\tesi, byte 4*SIZEOF_FAST_FLOAT\t; wsptr\n\tadd\tedi, byte 4*SIZEOF_JSAMPROW\n\tdec\tecx\t\t\t\t; ctr\n\tjnz\tnear .rowloop\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jiss2fst-64.asm",
    "content": ";\n; jiss2fst-64.asm - fast integer IDCT (64-bit SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2009 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/projecpt/showfiles.php?group_id=6208\n;\n; This file contains a fast, not so accurate integer implementation of\n; the inverse DCT (Discrete Cosine Transform). The following code is\n; based directly on the IJG's original jidctfst.c; see the jidctfst.c\n; for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS\t8\t; 14 is also OK.\n%define PASS1_BITS\t2\n\n%if IFAST_SCALE_BITS != PASS1_BITS\n%error \"'IFAST_SCALE_BITS' must be equal to 'PASS1_BITS'.\"\n%endif\n\n%if CONST_BITS == 8\nF_1_082\tequ\t277\t\t; FIX(1.082392200)\nF_1_414\tequ\t362\t\t; FIX(1.414213562)\nF_1_847\tequ\t473\t\t; FIX(1.847759065)\nF_2_613\tequ\t669\t\t; FIX(2.613125930)\nF_1_613\tequ\t(F_2_613 - 256)\t; FIX(2.613125930) - FIX(1)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define\tDESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_1_082\tequ\tDESCALE(1162209775,30-CONST_BITS)\t; FIX(1.082392200)\nF_1_414\tequ\tDESCALE(1518500249,30-CONST_BITS)\t; FIX(1.414213562)\nF_1_847\tequ\tDESCALE(1984016188,30-CONST_BITS)\t; FIX(1.847759065)\nF_2_613\tequ\tDESCALE(2805822602,30-CONST_BITS)\t; FIX(2.613125930)\nF_1_613\tequ\t(F_2_613 - (1 << CONST_BITS))\t; FIX(2.613125930) - FIX(1)\n%endif\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n; PRE_MULTIPLY_SCALE_BITS <= 2 (to avoid overflow)\n; CONST_BITS + CONST_SHIFT + PRE_MULTIPLY_SCALE_BITS == 16 (for pmulhw)\n\n%define PRE_MULTIPLY_SCALE_BITS   2\n%define CONST_SHIFT     (16 - PRE_MULTIPLY_SCALE_BITS - CONST_BITS)\n\n\talignz\t16\n\tglobal\tEXTN(jconst_idct_ifast_sse2)\n\nEXTN(jconst_idct_ifast_sse2):\n\nPW_F1414\ttimes 8 dw  F_1_414 << CONST_SHIFT\nPW_F1847\ttimes 8 dw  F_1_847 << CONST_SHIFT\nPW_MF1613\ttimes 8 dw -F_1_613 << CONST_SHIFT\nPW_F1082\ttimes 8 dw  F_1_082 << CONST_SHIFT\nPB_CENTERJSAMP\ttimes 16 db CENTERJSAMPLE\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t64\n;\n; Perform dequantization and inverse DCT on one block of coefficients.\n;\n; GLOBAL(void)\n; jsimd_idct_ifast_sse2 (void * dct_table, JCOEFPTR coef_block,\n;                       JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n; r10 = jpeg_component_info * compptr\n; r11 = JCOEFPTR coef_block\n; r12 = JSAMPARRAY output_buf\n; r13 = JDIMENSION output_col\n\n%define original_rbp\trbp+0\n%define wk(i)\t\trbp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t2\n\n\talign\t16\n\tglobal\tEXTN(jsimd_idct_ifast_sse2)\n\nEXTN(jsimd_idct_ifast_sse2):\n\tpush\trbp\n\tmov\trax,rsp\t\t\t\t; rax = original rbp\n\tsub\trsp, byte 4\n\tand\trsp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[rsp],rax\n\tmov\trbp,rsp\t\t\t\t; rbp = aligned rbp\n\tlea\trsp, [wk(0)]\n\tcollect_args\n\n\t; ---- Pass 1: process columns from input.\n\n\tmov\trdx, r10\t; quantptr\n\tmov\trsi, r11\t\t; inptr\n\n%ifndef NO_ZERO_COLUMN_TEST_IFAST_SSE2\n\tmov\teax, DWORD [DWBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n\tor\teax, DWORD [DWBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n\tjnz\tnear .columnDCT\n\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n\tpor\txmm0, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)]\n\tpor\txmm1, XMMWORD [XMMBLOCK(4,0,rsi,SIZEOF_JCOEF)]\n\tpor\txmm0, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)]\n\tpor\txmm1, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)]\n\tpor\txmm0, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)]\n\tpor\txmm1,xmm0\n\tpacksswb xmm1,xmm1\n\tpacksswb xmm1,xmm1\n\tmovd\teax,xmm1\n\ttest\trax,rax\n\tjnz\tshort .columnDCT\n\n\t; -- AC terms all zero\n\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)]\n\tpmullw\txmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\tmovdqa    xmm7,xmm0\t\t; xmm0=in0=(00 01 02 03 04 05 06 07)\n\tpunpcklwd xmm0,xmm0\t\t; xmm0=(00 00 01 01 02 02 03 03)\n\tpunpckhwd xmm7,xmm7\t\t; xmm7=(04 04 05 05 06 06 07 07)\n\n\tpshufd\txmm6,xmm0,0x00\t\t; xmm6=col0=(00 00 00 00 00 00 00 00)\n\tpshufd\txmm2,xmm0,0x55\t\t; xmm2=col1=(01 01 01 01 01 01 01 01)\n\tpshufd\txmm5,xmm0,0xAA\t\t; xmm5=col2=(02 02 02 02 02 02 02 02)\n\tpshufd\txmm0,xmm0,0xFF\t\t; xmm0=col3=(03 03 03 03 03 03 03 03)\n\tpshufd\txmm1,xmm7,0x00\t\t; xmm1=col4=(04 04 04 04 04 04 04 04)\n\tpshufd\txmm4,xmm7,0x55\t\t; xmm4=col5=(05 05 05 05 05 05 05 05)\n\tpshufd\txmm3,xmm7,0xAA\t\t; xmm3=col6=(06 06 06 06 06 06 06 06)\n\tpshufd\txmm7,xmm7,0xFF\t\t; xmm7=col7=(07 07 07 07 07 07 07 07)\n\n\tmovdqa\tXMMWORD [wk(0)], xmm2\t; wk(0)=col1\n\tmovdqa\tXMMWORD [wk(1)], xmm0\t; wk(1)=col3\n\tjmp\tnear .column_end\n%endif\n.columnDCT:\n\n\t; -- Even part\n\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n\tpmullw\txmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n\tpmullw\txmm1, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n\tmovdqa\txmm2, XMMWORD [XMMBLOCK(4,0,rsi,SIZEOF_JCOEF)]\n\tmovdqa\txmm3, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)]\n\tpmullw\txmm2, XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n\tpmullw\txmm3, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n\n\tmovdqa\txmm4,xmm0\n\tmovdqa\txmm5,xmm1\n\tpsubw\txmm0,xmm2\t\t; xmm0=tmp11\n\tpsubw\txmm1,xmm3\n\tpaddw\txmm4,xmm2\t\t; xmm4=tmp10\n\tpaddw\txmm5,xmm3\t\t; xmm5=tmp13\n\n\tpsllw\txmm1,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\txmm1,[rel PW_F1414]\n\tpsubw\txmm1,xmm5\t\t; xmm1=tmp12\n\n\tmovdqa\txmm6,xmm4\n\tmovdqa\txmm7,xmm0\n\tpsubw\txmm4,xmm5\t\t; xmm4=tmp3\n\tpsubw\txmm0,xmm1\t\t; xmm0=tmp2\n\tpaddw\txmm6,xmm5\t\t; xmm6=tmp0\n\tpaddw\txmm7,xmm1\t\t; xmm7=tmp1\n\n\tmovdqa\tXMMWORD [wk(1)], xmm4\t; wk(1)=tmp3\n\tmovdqa\tXMMWORD [wk(0)], xmm0\t; wk(0)=tmp2\n\n\t; -- Odd part\n\n\tmovdqa\txmm2, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n\tmovdqa\txmm3, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)]\n\tpmullw\txmm2, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n\tpmullw\txmm3, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n\tmovdqa\txmm5, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)]\n\tpmullw\txmm5, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n\tpmullw\txmm1, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_IFAST_MULT_TYPE)]\n\n\tmovdqa\txmm4,xmm2\n\tmovdqa\txmm0,xmm5\n\tpsubw\txmm2,xmm1\t\t; xmm2=z12\n\tpsubw\txmm5,xmm3\t\t; xmm5=z10\n\tpaddw\txmm4,xmm1\t\t; xmm4=z11\n\tpaddw\txmm0,xmm3\t\t; xmm0=z13\n\n\tmovdqa\txmm1,xmm5\t\t; xmm1=z10(unscaled)\n\tpsllw\txmm2,PRE_MULTIPLY_SCALE_BITS\n\tpsllw\txmm5,PRE_MULTIPLY_SCALE_BITS\n\n\tmovdqa\txmm3,xmm4\n\tpsubw\txmm4,xmm0\n\tpaddw\txmm3,xmm0\t\t; xmm3=tmp7\n\n\tpsllw\txmm4,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\txmm4,[rel PW_F1414]\t; xmm4=tmp11\n\n\t; To avoid overflow...\n\t;\n\t; (Original)\n\t; tmp12 = -2.613125930 * z10 + z5;\n\t;\n\t; (This implementation)\n\t; tmp12 = (-1.613125930 - 1) * z10 + z5;\n\t;       = -1.613125930 * z10 - z10 + z5;\n\n\tmovdqa\txmm0,xmm5\n\tpaddw\txmm5,xmm2\n\tpmulhw\txmm5,[rel PW_F1847]\t; xmm5=z5\n\tpmulhw\txmm0,[rel PW_MF1613]\n\tpmulhw\txmm2,[rel PW_F1082]\n\tpsubw\txmm0,xmm1\n\tpsubw\txmm2,xmm5\t\t; xmm2=tmp10\n\tpaddw\txmm0,xmm5\t\t; xmm0=tmp12\n\n\t; -- Final output stage\n\n\tpsubw\txmm0,xmm3\t\t; xmm0=tmp6\n\tmovdqa\txmm1,xmm6\n\tmovdqa\txmm5,xmm7\n\tpaddw\txmm6,xmm3\t\t; xmm6=data0=(00 01 02 03 04 05 06 07)\n\tpaddw\txmm7,xmm0\t\t; xmm7=data1=(10 11 12 13 14 15 16 17)\n\tpsubw\txmm1,xmm3\t\t; xmm1=data7=(70 71 72 73 74 75 76 77)\n\tpsubw\txmm5,xmm0\t\t; xmm5=data6=(60 61 62 63 64 65 66 67)\n\tpsubw\txmm4,xmm0\t\t; xmm4=tmp5\n\n\tmovdqa    xmm3,xmm6\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm6,xmm7\t\t; xmm6=(00 10 01 11 02 12 03 13)\n\tpunpckhwd xmm3,xmm7\t\t; xmm3=(04 14 05 15 06 16 07 17)\n\tmovdqa    xmm0,xmm5\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm5,xmm1\t\t; xmm5=(60 70 61 71 62 72 63 73)\n\tpunpckhwd xmm0,xmm1\t\t; xmm0=(64 74 65 75 66 76 67 77)\n\n\tmovdqa\txmm7, XMMWORD [wk(0)]\t; xmm7=tmp2\n\tmovdqa\txmm1, XMMWORD [wk(1)]\t; xmm1=tmp3\n\n\tmovdqa\tXMMWORD [wk(0)], xmm5\t; wk(0)=(60 70 61 71 62 72 63 73)\n\tmovdqa\tXMMWORD [wk(1)], xmm0\t; wk(1)=(64 74 65 75 66 76 67 77)\n\n\tpaddw\txmm2,xmm4\t\t; xmm2=tmp4\n\tmovdqa\txmm5,xmm7\n\tmovdqa\txmm0,xmm1\n\tpaddw\txmm7,xmm4\t\t; xmm7=data2=(20 21 22 23 24 25 26 27)\n\tpaddw\txmm1,xmm2\t\t; xmm1=data4=(40 41 42 43 44 45 46 47)\n\tpsubw\txmm5,xmm4\t\t; xmm5=data5=(50 51 52 53 54 55 56 57)\n\tpsubw\txmm0,xmm2\t\t; xmm0=data3=(30 31 32 33 34 35 36 37)\n\n\tmovdqa    xmm4,xmm7\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm7,xmm0\t\t; xmm7=(20 30 21 31 22 32 23 33)\n\tpunpckhwd xmm4,xmm0\t\t; xmm4=(24 34 25 35 26 36 27 37)\n\tmovdqa    xmm2,xmm1\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm1,xmm5\t\t; xmm1=(40 50 41 51 42 52 43 53)\n\tpunpckhwd xmm2,xmm5\t\t; xmm2=(44 54 45 55 46 56 47 57)\n\n\tmovdqa    xmm0,xmm3\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm3,xmm4\t\t; xmm3=(04 14 24 34 05 15 25 35)\n\tpunpckhdq xmm0,xmm4\t\t; xmm0=(06 16 26 36 07 17 27 37)\n\tmovdqa    xmm5,xmm6\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm6,xmm7\t\t; xmm6=(00 10 20 30 01 11 21 31)\n\tpunpckhdq xmm5,xmm7\t\t; xmm5=(02 12 22 32 03 13 23 33)\n\n\tmovdqa\txmm4, XMMWORD [wk(0)]\t; xmm4=(60 70 61 71 62 72 63 73)\n\tmovdqa\txmm7, XMMWORD [wk(1)]\t; xmm7=(64 74 65 75 66 76 67 77)\n\n\tmovdqa\tXMMWORD [wk(0)], xmm3\t; wk(0)=(04 14 24 34 05 15 25 35)\n\tmovdqa\tXMMWORD [wk(1)], xmm0\t; wk(1)=(06 16 26 36 07 17 27 37)\n\n\tmovdqa    xmm3,xmm1\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm1,xmm4\t\t; xmm1=(40 50 60 70 41 51 61 71)\n\tpunpckhdq xmm3,xmm4\t\t; xmm3=(42 52 62 72 43 53 63 73)\n\tmovdqa    xmm0,xmm2\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm2,xmm7\t\t; xmm2=(44 54 64 74 45 55 65 75)\n\tpunpckhdq xmm0,xmm7\t\t; xmm0=(46 56 66 76 47 57 67 77)\n\n\tmovdqa     xmm4,xmm6\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm6,xmm1\t\t; xmm6=col0=(00 10 20 30 40 50 60 70)\n\tpunpckhqdq xmm4,xmm1\t\t; xmm4=col1=(01 11 21 31 41 51 61 71)\n\tmovdqa     xmm7,xmm5\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm5,xmm3\t\t; xmm5=col2=(02 12 22 32 42 52 62 72)\n\tpunpckhqdq xmm7,xmm3\t\t; xmm7=col3=(03 13 23 33 43 53 63 73)\n\n\tmovdqa\txmm1, XMMWORD [wk(0)]\t; xmm1=(04 14 24 34 05 15 25 35)\n\tmovdqa\txmm3, XMMWORD [wk(1)]\t; xmm3=(06 16 26 36 07 17 27 37)\n\n\tmovdqa\tXMMWORD [wk(0)], xmm4\t; wk(0)=col1\n\tmovdqa\tXMMWORD [wk(1)], xmm7\t; wk(1)=col3\n\n\tmovdqa     xmm4,xmm1\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm1,xmm2\t\t; xmm1=col4=(04 14 24 34 44 54 64 74)\n\tpunpckhqdq xmm4,xmm2\t\t; xmm4=col5=(05 15 25 35 45 55 65 75)\n\tmovdqa     xmm7,xmm3\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm3,xmm0\t\t; xmm3=col6=(06 16 26 36 46 56 66 76)\n\tpunpckhqdq xmm7,xmm0\t\t; xmm7=col7=(07 17 27 37 47 57 67 77)\n.column_end:\n\n\t; -- Prefetch the next coefficient block\n\n\tprefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 0*32]\n\tprefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 1*32]\n\tprefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 2*32]\n\tprefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 3*32]\n\n\t; ---- Pass 2: process rows from work array, store into output array.\n\n\tmov\trax, [original_rbp]\n\tmov\trdi, r12\t; (JSAMPROW *)\n\tmov\trax, r13\n\n\t; -- Even part\n\n\t; xmm6=col0, xmm5=col2, xmm1=col4, xmm3=col6\n\n\tmovdqa\txmm2,xmm6\n\tmovdqa\txmm0,xmm5\n\tpsubw\txmm6,xmm1\t\t; xmm6=tmp11\n\tpsubw\txmm5,xmm3\n\tpaddw\txmm2,xmm1\t\t; xmm2=tmp10\n\tpaddw\txmm0,xmm3\t\t; xmm0=tmp13\n\n\tpsllw\txmm5,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\txmm5,[rel PW_F1414]\n\tpsubw\txmm5,xmm0\t\t; xmm5=tmp12\n\n\tmovdqa\txmm1,xmm2\n\tmovdqa\txmm3,xmm6\n\tpsubw\txmm2,xmm0\t\t; xmm2=tmp3\n\tpsubw\txmm6,xmm5\t\t; xmm6=tmp2\n\tpaddw\txmm1,xmm0\t\t; xmm1=tmp0\n\tpaddw\txmm3,xmm5\t\t; xmm3=tmp1\n\n\tmovdqa\txmm0, XMMWORD [wk(0)]\t; xmm0=col1\n\tmovdqa\txmm5, XMMWORD [wk(1)]\t; xmm5=col3\n\n\tmovdqa\tXMMWORD [wk(0)], xmm2\t; wk(0)=tmp3\n\tmovdqa\tXMMWORD [wk(1)], xmm6\t; wk(1)=tmp2\n\n\t; -- Odd part\n\n\t; xmm0=col1, xmm5=col3, xmm4=col5, xmm7=col7\n\n\tmovdqa\txmm2,xmm0\n\tmovdqa\txmm6,xmm4\n\tpsubw\txmm0,xmm7\t\t; xmm0=z12\n\tpsubw\txmm4,xmm5\t\t; xmm4=z10\n\tpaddw\txmm2,xmm7\t\t; xmm2=z11\n\tpaddw\txmm6,xmm5\t\t; xmm6=z13\n\n\tmovdqa\txmm7,xmm4\t\t; xmm7=z10(unscaled)\n\tpsllw\txmm0,PRE_MULTIPLY_SCALE_BITS\n\tpsllw\txmm4,PRE_MULTIPLY_SCALE_BITS\n\n\tmovdqa\txmm5,xmm2\n\tpsubw\txmm2,xmm6\n\tpaddw\txmm5,xmm6\t\t; xmm5=tmp7\n\n\tpsllw\txmm2,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\txmm2,[rel PW_F1414]\t; xmm2=tmp11\n\n\t; To avoid overflow...\n\t;\n\t; (Original)\n\t; tmp12 = -2.613125930 * z10 + z5;\n\t;\n\t; (This implementation)\n\t; tmp12 = (-1.613125930 - 1) * z10 + z5;\n\t;       = -1.613125930 * z10 - z10 + z5;\n\n\tmovdqa\txmm6,xmm4\n\tpaddw\txmm4,xmm0\n\tpmulhw\txmm4,[rel PW_F1847]\t; xmm4=z5\n\tpmulhw\txmm6,[rel PW_MF1613]\n\tpmulhw\txmm0,[rel PW_F1082]\n\tpsubw\txmm6,xmm7\n\tpsubw\txmm0,xmm4\t\t; xmm0=tmp10\n\tpaddw\txmm6,xmm4\t\t; xmm6=tmp12\n\n\t; -- Final output stage\n\n\tpsubw\txmm6,xmm5\t\t; xmm6=tmp6\n\tmovdqa\txmm7,xmm1\n\tmovdqa\txmm4,xmm3\n\tpaddw\txmm1,xmm5\t\t; xmm1=data0=(00 10 20 30 40 50 60 70)\n\tpaddw\txmm3,xmm6\t\t; xmm3=data1=(01 11 21 31 41 51 61 71)\n\tpsraw\txmm1,(PASS1_BITS+3)\t; descale\n\tpsraw\txmm3,(PASS1_BITS+3)\t; descale\n\tpsubw\txmm7,xmm5\t\t; xmm7=data7=(07 17 27 37 47 57 67 77)\n\tpsubw\txmm4,xmm6\t\t; xmm4=data6=(06 16 26 36 46 56 66 76)\n\tpsraw\txmm7,(PASS1_BITS+3)\t; descale\n\tpsraw\txmm4,(PASS1_BITS+3)\t; descale\n\tpsubw\txmm2,xmm6\t\t; xmm2=tmp5\n\n\tpacksswb  xmm1,xmm4\t; xmm1=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76)\n\tpacksswb  xmm3,xmm7\t; xmm3=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77)\n\n\tmovdqa\txmm5, XMMWORD [wk(1)]\t; xmm5=tmp2\n\tmovdqa\txmm6, XMMWORD [wk(0)]\t; xmm6=tmp3\n\n\tpaddw\txmm0,xmm2\t\t; xmm0=tmp4\n\tmovdqa\txmm4,xmm5\n\tmovdqa\txmm7,xmm6\n\tpaddw\txmm5,xmm2\t\t; xmm5=data2=(02 12 22 32 42 52 62 72)\n\tpaddw\txmm6,xmm0\t\t; xmm6=data4=(04 14 24 34 44 54 64 74)\n\tpsraw\txmm5,(PASS1_BITS+3)\t; descale\n\tpsraw\txmm6,(PASS1_BITS+3)\t; descale\n\tpsubw\txmm4,xmm2\t\t; xmm4=data5=(05 15 25 35 45 55 65 75)\n\tpsubw\txmm7,xmm0\t\t; xmm7=data3=(03 13 23 33 43 53 63 73)\n\tpsraw\txmm4,(PASS1_BITS+3)\t; descale\n\tpsraw\txmm7,(PASS1_BITS+3)\t; descale\n\n\tmovdqa    xmm2,[rel PB_CENTERJSAMP]\t; xmm2=[rel PB_CENTERJSAMP]\n\n\tpacksswb  xmm5,xmm6\t; xmm5=(02 12 22 32 42 52 62 72 04 14 24 34 44 54 64 74)\n\tpacksswb  xmm7,xmm4\t; xmm7=(03 13 23 33 43 53 63 73 05 15 25 35 45 55 65 75)\n\n\tpaddb     xmm1,xmm2\n\tpaddb     xmm3,xmm2\n\tpaddb     xmm5,xmm2\n\tpaddb     xmm7,xmm2\n\n\tmovdqa    xmm0,xmm1\t; transpose coefficients(phase 1)\n\tpunpcklbw xmm1,xmm3\t; xmm1=(00 01 10 11 20 21 30 31 40 41 50 51 60 61 70 71)\n\tpunpckhbw xmm0,xmm3\t; xmm0=(06 07 16 17 26 27 36 37 46 47 56 57 66 67 76 77)\n\tmovdqa    xmm6,xmm5\t; transpose coefficients(phase 1)\n\tpunpcklbw xmm5,xmm7\t; xmm5=(02 03 12 13 22 23 32 33 42 43 52 53 62 63 72 73)\n\tpunpckhbw xmm6,xmm7\t; xmm6=(04 05 14 15 24 25 34 35 44 45 54 55 64 65 74 75)\n\n\tmovdqa    xmm4,xmm1\t; transpose coefficients(phase 2)\n\tpunpcklwd xmm1,xmm5\t; xmm1=(00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33)\n\tpunpckhwd xmm4,xmm5\t; xmm4=(40 41 42 43 50 51 52 53 60 61 62 63 70 71 72 73)\n\tmovdqa    xmm2,xmm6\t; transpose coefficients(phase 2)\n\tpunpcklwd xmm6,xmm0\t; xmm6=(04 05 06 07 14 15 16 17 24 25 26 27 34 35 36 37)\n\tpunpckhwd xmm2,xmm0\t; xmm2=(44 45 46 47 54 55 56 57 64 65 66 67 74 75 76 77)\n\n\tmovdqa    xmm3,xmm1\t; transpose coefficients(phase 3)\n\tpunpckldq xmm1,xmm6\t; xmm1=(00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17)\n\tpunpckhdq xmm3,xmm6\t; xmm3=(20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37)\n\tmovdqa    xmm7,xmm4\t; transpose coefficients(phase 3)\n\tpunpckldq xmm4,xmm2\t; xmm4=(40 41 42 43 44 45 46 47 50 51 52 53 54 55 56 57)\n\tpunpckhdq xmm7,xmm2\t; xmm7=(60 61 62 63 64 65 66 67 70 71 72 73 74 75 76 77)\n\n\tpshufd\txmm5,xmm1,0x4E\t; xmm5=(10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07)\n\tpshufd\txmm0,xmm3,0x4E\t; xmm0=(30 31 32 33 34 35 36 37 20 21 22 23 24 25 26 27)\n\tpshufd\txmm6,xmm4,0x4E\t; xmm6=(50 51 52 53 54 55 56 57 40 41 42 43 44 45 46 47)\n\tpshufd\txmm2,xmm7,0x4E\t; xmm2=(70 71 72 73 74 75 76 77 60 61 62 63 64 65 66 67)\n\n\tmov\trdx, JSAMPROW [rdi+0*SIZEOF_JSAMPROW]\n\tmov\trsi, JSAMPROW [rdi+2*SIZEOF_JSAMPROW]\n\tmovq\tXMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm1\n\tmovq\tXMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm3\n\tmov\trdx, JSAMPROW [rdi+4*SIZEOF_JSAMPROW]\n\tmov\trsi, JSAMPROW [rdi+6*SIZEOF_JSAMPROW]\n\tmovq\tXMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm4\n\tmovq\tXMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm7\n\n\tmov\trdx, JSAMPROW [rdi+1*SIZEOF_JSAMPROW]\n\tmov\trsi, JSAMPROW [rdi+3*SIZEOF_JSAMPROW]\n\tmovq\tXMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm5\n\tmovq\tXMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm0\n\tmov\trdx, JSAMPROW [rdi+5*SIZEOF_JSAMPROW]\n\tmov\trsi, JSAMPROW [rdi+7*SIZEOF_JSAMPROW]\n\tmovq\tXMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm6\n\tmovq\tXMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm2\n\n\tuncollect_args\n\tmov\trsp,rbp\t\t; rsp <- aligned rbp\n\tpop\trsp\t\t; rsp <- original rbp\n\tpop\trbp\n\tret\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jiss2fst.asm",
    "content": ";\n; jiss2fst.asm - fast integer IDCT (SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a fast, not so accurate integer implementation of\n; the inverse DCT (Discrete Cosine Transform). The following code is\n; based directly on the IJG's original jidctfst.c; see the jidctfst.c\n; for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS\t8\t; 14 is also OK.\n%define PASS1_BITS\t2\n\n%if IFAST_SCALE_BITS != PASS1_BITS\n%error \"'IFAST_SCALE_BITS' must be equal to 'PASS1_BITS'.\"\n%endif\n\n%if CONST_BITS == 8\nF_1_082\tequ\t277\t\t; FIX(1.082392200)\nF_1_414\tequ\t362\t\t; FIX(1.414213562)\nF_1_847\tequ\t473\t\t; FIX(1.847759065)\nF_2_613\tequ\t669\t\t; FIX(2.613125930)\nF_1_613\tequ\t(F_2_613 - 256)\t; FIX(2.613125930) - FIX(1)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define\tDESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_1_082\tequ\tDESCALE(1162209775,30-CONST_BITS)\t; FIX(1.082392200)\nF_1_414\tequ\tDESCALE(1518500249,30-CONST_BITS)\t; FIX(1.414213562)\nF_1_847\tequ\tDESCALE(1984016188,30-CONST_BITS)\t; FIX(1.847759065)\nF_2_613\tequ\tDESCALE(2805822602,30-CONST_BITS)\t; FIX(2.613125930)\nF_1_613\tequ\t(F_2_613 - (1 << CONST_BITS))\t; FIX(2.613125930) - FIX(1)\n%endif\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n; PRE_MULTIPLY_SCALE_BITS <= 2 (to avoid overflow)\n; CONST_BITS + CONST_SHIFT + PRE_MULTIPLY_SCALE_BITS == 16 (for pmulhw)\n\n%define PRE_MULTIPLY_SCALE_BITS   2\n%define CONST_SHIFT     (16 - PRE_MULTIPLY_SCALE_BITS - CONST_BITS)\n\n\talignz\t16\n\tglobal\tEXTN(jconst_idct_ifast_sse2)\n\nEXTN(jconst_idct_ifast_sse2):\n\nPW_F1414\ttimes 8 dw  F_1_414 << CONST_SHIFT\nPW_F1847\ttimes 8 dw  F_1_847 << CONST_SHIFT\nPW_MF1613\ttimes 8 dw -F_1_613 << CONST_SHIFT\nPW_F1082\ttimes 8 dw  F_1_082 << CONST_SHIFT\nPB_CENTERJSAMP\ttimes 16 db CENTERJSAMPLE\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Perform dequantization and inverse DCT on one block of coefficients.\n;\n; GLOBAL(void)\n; jsimd_idct_ifast_sse2 (void * dct_table, JCOEFPTR coef_block,\n;                       JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n%define dct_table(b)\t(b)+8\t\t\t; jpeg_component_info * compptr\n%define coef_block(b)\t(b)+12\t\t; JCOEFPTR coef_block\n%define output_buf(b)\t(b)+16\t\t; JSAMPARRAY output_buf\n%define output_col(b)\t(b)+20\t\t; JDIMENSION output_col\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t2\n\n\talign\t16\n\tglobal\tEXTN(jsimd_idct_ifast_sse2)\n\nEXTN(jsimd_idct_ifast_sse2):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [wk(0)]\n\tpushpic\tebx\n;\tpush\tecx\t\t; unused\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t; get GOT address\n\n\t; ---- Pass 1: process columns from input.\n\n;\tmov\teax, [original_ebp]\n\tmov\tedx, POINTER [dct_table(eax)]\t; quantptr\n\tmov\tesi, JCOEFPTR [coef_block(eax)]\t\t; inptr\n\n%ifndef NO_ZERO_COLUMN_TEST_IFAST_SSE2\n\tmov\teax, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tor\teax, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tjnz\tnear .columnDCT\n\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tpor\txmm0, XMMWORD [XMMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tpor\txmm1, XMMWORD [XMMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n\tpor\txmm0, XMMWORD [XMMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tpor\txmm1, XMMWORD [XMMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\tpor\txmm0, XMMWORD [XMMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\tpor\txmm1,xmm0\n\tpacksswb xmm1,xmm1\n\tpacksswb xmm1,xmm1\n\tmovd\teax,xmm1\n\ttest\teax,eax\n\tjnz\tshort .columnDCT\n\n\t; -- AC terms all zero\n\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\tpmullw\txmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\tmovdqa    xmm7,xmm0\t\t; xmm0=in0=(00 01 02 03 04 05 06 07)\n\tpunpcklwd xmm0,xmm0\t\t; xmm0=(00 00 01 01 02 02 03 03)\n\tpunpckhwd xmm7,xmm7\t\t; xmm7=(04 04 05 05 06 06 07 07)\n\n\tpshufd\txmm6,xmm0,0x00\t\t; xmm6=col0=(00 00 00 00 00 00 00 00)\n\tpshufd\txmm2,xmm0,0x55\t\t; xmm2=col1=(01 01 01 01 01 01 01 01)\n\tpshufd\txmm5,xmm0,0xAA\t\t; xmm5=col2=(02 02 02 02 02 02 02 02)\n\tpshufd\txmm0,xmm0,0xFF\t\t; xmm0=col3=(03 03 03 03 03 03 03 03)\n\tpshufd\txmm1,xmm7,0x00\t\t; xmm1=col4=(04 04 04 04 04 04 04 04)\n\tpshufd\txmm4,xmm7,0x55\t\t; xmm4=col5=(05 05 05 05 05 05 05 05)\n\tpshufd\txmm3,xmm7,0xAA\t\t; xmm3=col6=(06 06 06 06 06 06 06 06)\n\tpshufd\txmm7,xmm7,0xFF\t\t; xmm7=col7=(07 07 07 07 07 07 07 07)\n\n\tmovdqa\tXMMWORD [wk(0)], xmm2\t; wk(0)=col1\n\tmovdqa\tXMMWORD [wk(1)], xmm0\t; wk(1)=col3\n\tjmp\tnear .column_end\n\talignx\t16,7\n%endif\n.columnDCT:\n\n\t; -- Even part\n\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tpmullw\txmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n\tpmullw\txmm1, XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n\tmovdqa\txmm2, XMMWORD [XMMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n\tmovdqa\txmm3, XMMWORD [XMMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\tpmullw\txmm2, XMMWORD [XMMBLOCK(4,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n\tpmullw\txmm3, XMMWORD [XMMBLOCK(6,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n\n\tmovdqa\txmm4,xmm0\n\tmovdqa\txmm5,xmm1\n\tpsubw\txmm0,xmm2\t\t; xmm0=tmp11\n\tpsubw\txmm1,xmm3\n\tpaddw\txmm4,xmm2\t\t; xmm4=tmp10\n\tpaddw\txmm5,xmm3\t\t; xmm5=tmp13\n\n\tpsllw\txmm1,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\txmm1,[GOTOFF(ebx,PW_F1414)]\n\tpsubw\txmm1,xmm5\t\t; xmm1=tmp12\n\n\tmovdqa\txmm6,xmm4\n\tmovdqa\txmm7,xmm0\n\tpsubw\txmm4,xmm5\t\t; xmm4=tmp3\n\tpsubw\txmm0,xmm1\t\t; xmm0=tmp2\n\tpaddw\txmm6,xmm5\t\t; xmm6=tmp0\n\tpaddw\txmm7,xmm1\t\t; xmm7=tmp1\n\n\tmovdqa\tXMMWORD [wk(1)], xmm4\t; wk(1)=tmp3\n\tmovdqa\tXMMWORD [wk(0)], xmm0\t; wk(0)=tmp2\n\n\t; -- Odd part\n\n\tmovdqa\txmm2, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tmovdqa\txmm3, XMMWORD [XMMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tpmullw\txmm2, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n\tpmullw\txmm3, XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n\tmovdqa\txmm5, XMMWORD [XMMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\tpmullw\txmm5, XMMWORD [XMMBLOCK(5,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n\tpmullw\txmm1, XMMWORD [XMMBLOCK(7,0,edx,SIZEOF_IFAST_MULT_TYPE)]\n\n\tmovdqa\txmm4,xmm2\n\tmovdqa\txmm0,xmm5\n\tpsubw\txmm2,xmm1\t\t; xmm2=z12\n\tpsubw\txmm5,xmm3\t\t; xmm5=z10\n\tpaddw\txmm4,xmm1\t\t; xmm4=z11\n\tpaddw\txmm0,xmm3\t\t; xmm0=z13\n\n\tmovdqa\txmm1,xmm5\t\t; xmm1=z10(unscaled)\n\tpsllw\txmm2,PRE_MULTIPLY_SCALE_BITS\n\tpsllw\txmm5,PRE_MULTIPLY_SCALE_BITS\n\n\tmovdqa\txmm3,xmm4\n\tpsubw\txmm4,xmm0\n\tpaddw\txmm3,xmm0\t\t; xmm3=tmp7\n\n\tpsllw\txmm4,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\txmm4,[GOTOFF(ebx,PW_F1414)]\t; xmm4=tmp11\n\n\t; To avoid overflow...\n\t;\n\t; (Original)\n\t; tmp12 = -2.613125930 * z10 + z5;\n\t;\n\t; (This implementation)\n\t; tmp12 = (-1.613125930 - 1) * z10 + z5;\n\t;       = -1.613125930 * z10 - z10 + z5;\n\n\tmovdqa\txmm0,xmm5\n\tpaddw\txmm5,xmm2\n\tpmulhw\txmm5,[GOTOFF(ebx,PW_F1847)]\t; xmm5=z5\n\tpmulhw\txmm0,[GOTOFF(ebx,PW_MF1613)]\n\tpmulhw\txmm2,[GOTOFF(ebx,PW_F1082)]\n\tpsubw\txmm0,xmm1\n\tpsubw\txmm2,xmm5\t\t; xmm2=tmp10\n\tpaddw\txmm0,xmm5\t\t; xmm0=tmp12\n\n\t; -- Final output stage\n\n\tpsubw\txmm0,xmm3\t\t; xmm0=tmp6\n\tmovdqa\txmm1,xmm6\n\tmovdqa\txmm5,xmm7\n\tpaddw\txmm6,xmm3\t\t; xmm6=data0=(00 01 02 03 04 05 06 07)\n\tpaddw\txmm7,xmm0\t\t; xmm7=data1=(10 11 12 13 14 15 16 17)\n\tpsubw\txmm1,xmm3\t\t; xmm1=data7=(70 71 72 73 74 75 76 77)\n\tpsubw\txmm5,xmm0\t\t; xmm5=data6=(60 61 62 63 64 65 66 67)\n\tpsubw\txmm4,xmm0\t\t; xmm4=tmp5\n\n\tmovdqa    xmm3,xmm6\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm6,xmm7\t\t; xmm6=(00 10 01 11 02 12 03 13)\n\tpunpckhwd xmm3,xmm7\t\t; xmm3=(04 14 05 15 06 16 07 17)\n\tmovdqa    xmm0,xmm5\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm5,xmm1\t\t; xmm5=(60 70 61 71 62 72 63 73)\n\tpunpckhwd xmm0,xmm1\t\t; xmm0=(64 74 65 75 66 76 67 77)\n\n\tmovdqa\txmm7, XMMWORD [wk(0)]\t; xmm7=tmp2\n\tmovdqa\txmm1, XMMWORD [wk(1)]\t; xmm1=tmp3\n\n\tmovdqa\tXMMWORD [wk(0)], xmm5\t; wk(0)=(60 70 61 71 62 72 63 73)\n\tmovdqa\tXMMWORD [wk(1)], xmm0\t; wk(1)=(64 74 65 75 66 76 67 77)\n\n\tpaddw\txmm2,xmm4\t\t; xmm2=tmp4\n\tmovdqa\txmm5,xmm7\n\tmovdqa\txmm0,xmm1\n\tpaddw\txmm7,xmm4\t\t; xmm7=data2=(20 21 22 23 24 25 26 27)\n\tpaddw\txmm1,xmm2\t\t; xmm1=data4=(40 41 42 43 44 45 46 47)\n\tpsubw\txmm5,xmm4\t\t; xmm5=data5=(50 51 52 53 54 55 56 57)\n\tpsubw\txmm0,xmm2\t\t; xmm0=data3=(30 31 32 33 34 35 36 37)\n\n\tmovdqa    xmm4,xmm7\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm7,xmm0\t\t; xmm7=(20 30 21 31 22 32 23 33)\n\tpunpckhwd xmm4,xmm0\t\t; xmm4=(24 34 25 35 26 36 27 37)\n\tmovdqa    xmm2,xmm1\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm1,xmm5\t\t; xmm1=(40 50 41 51 42 52 43 53)\n\tpunpckhwd xmm2,xmm5\t\t; xmm2=(44 54 45 55 46 56 47 57)\n\n\tmovdqa    xmm0,xmm3\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm3,xmm4\t\t; xmm3=(04 14 24 34 05 15 25 35)\n\tpunpckhdq xmm0,xmm4\t\t; xmm0=(06 16 26 36 07 17 27 37)\n\tmovdqa    xmm5,xmm6\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm6,xmm7\t\t; xmm6=(00 10 20 30 01 11 21 31)\n\tpunpckhdq xmm5,xmm7\t\t; xmm5=(02 12 22 32 03 13 23 33)\n\n\tmovdqa\txmm4, XMMWORD [wk(0)]\t; xmm4=(60 70 61 71 62 72 63 73)\n\tmovdqa\txmm7, XMMWORD [wk(1)]\t; xmm7=(64 74 65 75 66 76 67 77)\n\n\tmovdqa\tXMMWORD [wk(0)], xmm3\t; wk(0)=(04 14 24 34 05 15 25 35)\n\tmovdqa\tXMMWORD [wk(1)], xmm0\t; wk(1)=(06 16 26 36 07 17 27 37)\n\n\tmovdqa    xmm3,xmm1\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm1,xmm4\t\t; xmm1=(40 50 60 70 41 51 61 71)\n\tpunpckhdq xmm3,xmm4\t\t; xmm3=(42 52 62 72 43 53 63 73)\n\tmovdqa    xmm0,xmm2\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm2,xmm7\t\t; xmm2=(44 54 64 74 45 55 65 75)\n\tpunpckhdq xmm0,xmm7\t\t; xmm0=(46 56 66 76 47 57 67 77)\n\n\tmovdqa     xmm4,xmm6\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm6,xmm1\t\t; xmm6=col0=(00 10 20 30 40 50 60 70)\n\tpunpckhqdq xmm4,xmm1\t\t; xmm4=col1=(01 11 21 31 41 51 61 71)\n\tmovdqa     xmm7,xmm5\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm5,xmm3\t\t; xmm5=col2=(02 12 22 32 42 52 62 72)\n\tpunpckhqdq xmm7,xmm3\t\t; xmm7=col3=(03 13 23 33 43 53 63 73)\n\n\tmovdqa\txmm1, XMMWORD [wk(0)]\t; xmm1=(04 14 24 34 05 15 25 35)\n\tmovdqa\txmm3, XMMWORD [wk(1)]\t; xmm3=(06 16 26 36 07 17 27 37)\n\n\tmovdqa\tXMMWORD [wk(0)], xmm4\t; wk(0)=col1\n\tmovdqa\tXMMWORD [wk(1)], xmm7\t; wk(1)=col3\n\n\tmovdqa     xmm4,xmm1\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm1,xmm2\t\t; xmm1=col4=(04 14 24 34 44 54 64 74)\n\tpunpckhqdq xmm4,xmm2\t\t; xmm4=col5=(05 15 25 35 45 55 65 75)\n\tmovdqa     xmm7,xmm3\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm3,xmm0\t\t; xmm3=col6=(06 16 26 36 46 56 66 76)\n\tpunpckhqdq xmm7,xmm0\t\t; xmm7=col7=(07 17 27 37 47 57 67 77)\n.column_end:\n\n\t; -- Prefetch the next coefficient block\n\n\tprefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 0*32]\n\tprefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 1*32]\n\tprefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 2*32]\n\tprefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 3*32]\n\n\t; ---- Pass 2: process rows from work array, store into output array.\n\n\tmov\teax, [original_ebp]\n\tmov\tedi, JSAMPARRAY [output_buf(eax)]\t; (JSAMPROW *)\n\tmov\teax, JDIMENSION [output_col(eax)]\n\n\t; -- Even part\n\n\t; xmm6=col0, xmm5=col2, xmm1=col4, xmm3=col6\n\n\tmovdqa\txmm2,xmm6\n\tmovdqa\txmm0,xmm5\n\tpsubw\txmm6,xmm1\t\t; xmm6=tmp11\n\tpsubw\txmm5,xmm3\n\tpaddw\txmm2,xmm1\t\t; xmm2=tmp10\n\tpaddw\txmm0,xmm3\t\t; xmm0=tmp13\n\n\tpsllw\txmm5,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\txmm5,[GOTOFF(ebx,PW_F1414)]\n\tpsubw\txmm5,xmm0\t\t; xmm5=tmp12\n\n\tmovdqa\txmm1,xmm2\n\tmovdqa\txmm3,xmm6\n\tpsubw\txmm2,xmm0\t\t; xmm2=tmp3\n\tpsubw\txmm6,xmm5\t\t; xmm6=tmp2\n\tpaddw\txmm1,xmm0\t\t; xmm1=tmp0\n\tpaddw\txmm3,xmm5\t\t; xmm3=tmp1\n\n\tmovdqa\txmm0, XMMWORD [wk(0)]\t; xmm0=col1\n\tmovdqa\txmm5, XMMWORD [wk(1)]\t; xmm5=col3\n\n\tmovdqa\tXMMWORD [wk(0)], xmm2\t; wk(0)=tmp3\n\tmovdqa\tXMMWORD [wk(1)], xmm6\t; wk(1)=tmp2\n\n\t; -- Odd part\n\n\t; xmm0=col1, xmm5=col3, xmm4=col5, xmm7=col7\n\n\tmovdqa\txmm2,xmm0\n\tmovdqa\txmm6,xmm4\n\tpsubw\txmm0,xmm7\t\t; xmm0=z12\n\tpsubw\txmm4,xmm5\t\t; xmm4=z10\n\tpaddw\txmm2,xmm7\t\t; xmm2=z11\n\tpaddw\txmm6,xmm5\t\t; xmm6=z13\n\n\tmovdqa\txmm7,xmm4\t\t; xmm7=z10(unscaled)\n\tpsllw\txmm0,PRE_MULTIPLY_SCALE_BITS\n\tpsllw\txmm4,PRE_MULTIPLY_SCALE_BITS\n\n\tmovdqa\txmm5,xmm2\n\tpsubw\txmm2,xmm6\n\tpaddw\txmm5,xmm6\t\t; xmm5=tmp7\n\n\tpsllw\txmm2,PRE_MULTIPLY_SCALE_BITS\n\tpmulhw\txmm2,[GOTOFF(ebx,PW_F1414)]\t; xmm2=tmp11\n\n\t; To avoid overflow...\n\t;\n\t; (Original)\n\t; tmp12 = -2.613125930 * z10 + z5;\n\t;\n\t; (This implementation)\n\t; tmp12 = (-1.613125930 - 1) * z10 + z5;\n\t;       = -1.613125930 * z10 - z10 + z5;\n\n\tmovdqa\txmm6,xmm4\n\tpaddw\txmm4,xmm0\n\tpmulhw\txmm4,[GOTOFF(ebx,PW_F1847)]\t; xmm4=z5\n\tpmulhw\txmm6,[GOTOFF(ebx,PW_MF1613)]\n\tpmulhw\txmm0,[GOTOFF(ebx,PW_F1082)]\n\tpsubw\txmm6,xmm7\n\tpsubw\txmm0,xmm4\t\t; xmm0=tmp10\n\tpaddw\txmm6,xmm4\t\t; xmm6=tmp12\n\n\t; -- Final output stage\n\n\tpsubw\txmm6,xmm5\t\t; xmm6=tmp6\n\tmovdqa\txmm7,xmm1\n\tmovdqa\txmm4,xmm3\n\tpaddw\txmm1,xmm5\t\t; xmm1=data0=(00 10 20 30 40 50 60 70)\n\tpaddw\txmm3,xmm6\t\t; xmm3=data1=(01 11 21 31 41 51 61 71)\n\tpsraw\txmm1,(PASS1_BITS+3)\t; descale\n\tpsraw\txmm3,(PASS1_BITS+3)\t; descale\n\tpsubw\txmm7,xmm5\t\t; xmm7=data7=(07 17 27 37 47 57 67 77)\n\tpsubw\txmm4,xmm6\t\t; xmm4=data6=(06 16 26 36 46 56 66 76)\n\tpsraw\txmm7,(PASS1_BITS+3)\t; descale\n\tpsraw\txmm4,(PASS1_BITS+3)\t; descale\n\tpsubw\txmm2,xmm6\t\t; xmm2=tmp5\n\n\tpacksswb  xmm1,xmm4\t; xmm1=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76)\n\tpacksswb  xmm3,xmm7\t; xmm3=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77)\n\n\tmovdqa\txmm5, XMMWORD [wk(1)]\t; xmm5=tmp2\n\tmovdqa\txmm6, XMMWORD [wk(0)]\t; xmm6=tmp3\n\n\tpaddw\txmm0,xmm2\t\t; xmm0=tmp4\n\tmovdqa\txmm4,xmm5\n\tmovdqa\txmm7,xmm6\n\tpaddw\txmm5,xmm2\t\t; xmm5=data2=(02 12 22 32 42 52 62 72)\n\tpaddw\txmm6,xmm0\t\t; xmm6=data4=(04 14 24 34 44 54 64 74)\n\tpsraw\txmm5,(PASS1_BITS+3)\t; descale\n\tpsraw\txmm6,(PASS1_BITS+3)\t; descale\n\tpsubw\txmm4,xmm2\t\t; xmm4=data5=(05 15 25 35 45 55 65 75)\n\tpsubw\txmm7,xmm0\t\t; xmm7=data3=(03 13 23 33 43 53 63 73)\n\tpsraw\txmm4,(PASS1_BITS+3)\t; descale\n\tpsraw\txmm7,(PASS1_BITS+3)\t; descale\n\n\tmovdqa    xmm2,[GOTOFF(ebx,PB_CENTERJSAMP)]\t; xmm2=[PB_CENTERJSAMP]\n\n\tpacksswb  xmm5,xmm6\t; xmm5=(02 12 22 32 42 52 62 72 04 14 24 34 44 54 64 74)\n\tpacksswb  xmm7,xmm4\t; xmm7=(03 13 23 33 43 53 63 73 05 15 25 35 45 55 65 75)\n\n\tpaddb     xmm1,xmm2\n\tpaddb     xmm3,xmm2\n\tpaddb     xmm5,xmm2\n\tpaddb     xmm7,xmm2\n\n\tmovdqa    xmm0,xmm1\t; transpose coefficients(phase 1)\n\tpunpcklbw xmm1,xmm3\t; xmm1=(00 01 10 11 20 21 30 31 40 41 50 51 60 61 70 71)\n\tpunpckhbw xmm0,xmm3\t; xmm0=(06 07 16 17 26 27 36 37 46 47 56 57 66 67 76 77)\n\tmovdqa    xmm6,xmm5\t; transpose coefficients(phase 1)\n\tpunpcklbw xmm5,xmm7\t; xmm5=(02 03 12 13 22 23 32 33 42 43 52 53 62 63 72 73)\n\tpunpckhbw xmm6,xmm7\t; xmm6=(04 05 14 15 24 25 34 35 44 45 54 55 64 65 74 75)\n\n\tmovdqa    xmm4,xmm1\t; transpose coefficients(phase 2)\n\tpunpcklwd xmm1,xmm5\t; xmm1=(00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33)\n\tpunpckhwd xmm4,xmm5\t; xmm4=(40 41 42 43 50 51 52 53 60 61 62 63 70 71 72 73)\n\tmovdqa    xmm2,xmm6\t; transpose coefficients(phase 2)\n\tpunpcklwd xmm6,xmm0\t; xmm6=(04 05 06 07 14 15 16 17 24 25 26 27 34 35 36 37)\n\tpunpckhwd xmm2,xmm0\t; xmm2=(44 45 46 47 54 55 56 57 64 65 66 67 74 75 76 77)\n\n\tmovdqa    xmm3,xmm1\t; transpose coefficients(phase 3)\n\tpunpckldq xmm1,xmm6\t; xmm1=(00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17)\n\tpunpckhdq xmm3,xmm6\t; xmm3=(20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37)\n\tmovdqa    xmm7,xmm4\t; transpose coefficients(phase 3)\n\tpunpckldq xmm4,xmm2\t; xmm4=(40 41 42 43 44 45 46 47 50 51 52 53 54 55 56 57)\n\tpunpckhdq xmm7,xmm2\t; xmm7=(60 61 62 63 64 65 66 67 70 71 72 73 74 75 76 77)\n\n\tpshufd\txmm5,xmm1,0x4E\t; xmm5=(10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07)\n\tpshufd\txmm0,xmm3,0x4E\t; xmm0=(30 31 32 33 34 35 36 37 20 21 22 23 24 25 26 27)\n\tpshufd\txmm6,xmm4,0x4E\t; xmm6=(50 51 52 53 54 55 56 57 40 41 42 43 44 45 46 47)\n\tpshufd\txmm2,xmm7,0x4E\t; xmm2=(70 71 72 73 74 75 76 77 60 61 62 63 64 65 66 67)\n\n\tmov\tedx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\n\tmov\tesi, JSAMPROW [edi+2*SIZEOF_JSAMPROW]\n\tmovq\tXMM_MMWORD [edx+eax*SIZEOF_JSAMPLE], xmm1\n\tmovq\tXMM_MMWORD [esi+eax*SIZEOF_JSAMPLE], xmm3\n\tmov\tedx, JSAMPROW [edi+4*SIZEOF_JSAMPROW]\n\tmov\tesi, JSAMPROW [edi+6*SIZEOF_JSAMPROW]\n\tmovq\tXMM_MMWORD [edx+eax*SIZEOF_JSAMPLE], xmm4\n\tmovq\tXMM_MMWORD [esi+eax*SIZEOF_JSAMPLE], xmm7\n\n\tmov\tedx, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\n\tmov\tesi, JSAMPROW [edi+3*SIZEOF_JSAMPROW]\n\tmovq\tXMM_MMWORD [edx+eax*SIZEOF_JSAMPLE], xmm5\n\tmovq\tXMM_MMWORD [esi+eax*SIZEOF_JSAMPLE], xmm0\n\tmov\tedx, JSAMPROW [edi+5*SIZEOF_JSAMPROW]\n\tmov\tesi, JSAMPROW [edi+7*SIZEOF_JSAMPROW]\n\tmovq\tXMM_MMWORD [edx+eax*SIZEOF_JSAMPLE], xmm6\n\tmovq\tXMM_MMWORD [esi+eax*SIZEOF_JSAMPLE], xmm2\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; unused\n\tpoppic\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jiss2int-64.asm",
    "content": ";\n; jiss2int-64.asm - accurate integer IDCT (64-bit SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2009 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a slow-but-accurate integer implementation of the\n; inverse DCT (Discrete Cosine Transform). The following code is based\n; directly on the IJG's original jidctint.c; see the jidctint.c for\n; more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS\t13\n%define PASS1_BITS\t2\n\n%define DESCALE_P1\t(CONST_BITS-PASS1_BITS)\n%define DESCALE_P2\t(CONST_BITS+PASS1_BITS+3)\n\n%if CONST_BITS == 13\nF_0_298\tequ\t 2446\t\t; FIX(0.298631336)\nF_0_390\tequ\t 3196\t\t; FIX(0.390180644)\nF_0_541\tequ\t 4433\t\t; FIX(0.541196100)\nF_0_765\tequ\t 6270\t\t; FIX(0.765366865)\nF_0_899\tequ\t 7373\t\t; FIX(0.899976223)\nF_1_175\tequ\t 9633\t\t; FIX(1.175875602)\nF_1_501\tequ\t12299\t\t; FIX(1.501321110)\nF_1_847\tequ\t15137\t\t; FIX(1.847759065)\nF_1_961\tequ\t16069\t\t; FIX(1.961570560)\nF_2_053\tequ\t16819\t\t; FIX(2.053119869)\nF_2_562\tequ\t20995\t\t; FIX(2.562915447)\nF_3_072\tequ\t25172\t\t; FIX(3.072711026)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_298\tequ\tDESCALE( 320652955,30-CONST_BITS)\t; FIX(0.298631336)\nF_0_390\tequ\tDESCALE( 418953276,30-CONST_BITS)\t; FIX(0.390180644)\nF_0_541\tequ\tDESCALE( 581104887,30-CONST_BITS)\t; FIX(0.541196100)\nF_0_765\tequ\tDESCALE( 821806413,30-CONST_BITS)\t; FIX(0.765366865)\nF_0_899\tequ\tDESCALE( 966342111,30-CONST_BITS)\t; FIX(0.899976223)\nF_1_175\tequ\tDESCALE(1262586813,30-CONST_BITS)\t; FIX(1.175875602)\nF_1_501\tequ\tDESCALE(1612031267,30-CONST_BITS)\t; FIX(1.501321110)\nF_1_847\tequ\tDESCALE(1984016188,30-CONST_BITS)\t; FIX(1.847759065)\nF_1_961\tequ\tDESCALE(2106220350,30-CONST_BITS)\t; FIX(1.961570560)\nF_2_053\tequ\tDESCALE(2204520673,30-CONST_BITS)\t; FIX(2.053119869)\nF_2_562\tequ\tDESCALE(2751909506,30-CONST_BITS)\t; FIX(2.562915447)\nF_3_072\tequ\tDESCALE(3299298341,30-CONST_BITS)\t; FIX(3.072711026)\n%endif\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_idct_islow_sse2)\n\nEXTN(jconst_idct_islow_sse2):\n\nPW_F130_F054\ttimes 4 dw  (F_0_541+F_0_765), F_0_541\nPW_F054_MF130\ttimes 4 dw  F_0_541, (F_0_541-F_1_847)\nPW_MF078_F117\ttimes 4 dw  (F_1_175-F_1_961), F_1_175\nPW_F117_F078\ttimes 4 dw  F_1_175, (F_1_175-F_0_390)\nPW_MF060_MF089\ttimes 4 dw  (F_0_298-F_0_899),-F_0_899\nPW_MF089_F060\ttimes 4 dw -F_0_899, (F_1_501-F_0_899)\nPW_MF050_MF256\ttimes 4 dw  (F_2_053-F_2_562),-F_2_562\nPW_MF256_F050\ttimes 4 dw -F_2_562, (F_3_072-F_2_562)\nPD_DESCALE_P1\ttimes 4 dd  1 << (DESCALE_P1-1)\nPD_DESCALE_P2\ttimes 4 dd  1 << (DESCALE_P2-1)\nPB_CENTERJSAMP\ttimes 16 db CENTERJSAMPLE\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t64\n;\n; Perform dequantization and inverse DCT on one block of coefficients.\n;\n; GLOBAL(void)\n; jsimd_idct_islow_sse2 (void * dct_table, JCOEFPTR coef_block,\n;                        JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n; r10 = jpeg_component_info * compptr\n; r11 = JCOEFPTR coef_block\n; r12 = JSAMPARRAY output_buf\n; r13 = JDIMENSION output_col\n\n%define original_rbp\trbp+0\n%define wk(i)\t\trbp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t12\n\n\talign\t16\n\tglobal\tEXTN(jsimd_idct_islow_sse2)\n\nEXTN(jsimd_idct_islow_sse2):\n\tpush\trbp\n\tmov\trax,rsp\t\t\t\t; rax = original rbp\n\tsub\trsp, byte 4\n\tand\trsp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[rsp],rax\n\tmov\trbp,rsp\t\t\t\t; rbp = aligned rbp\n\tlea\trsp, [wk(0)]\n\tcollect_args\n\n\t; ---- Pass 1: process columns from input.\n\n\tmov\trdx, r10\t; quantptr\n\tmov\trsi, r11\t\t; inptr\n\n%ifndef NO_ZERO_COLUMN_TEST_ISLOW_SSE2\n\tmov\teax, DWORD [DWBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n\tor\teax, DWORD [DWBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n\tjnz\tnear .columnDCT\n\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n\tpor\txmm0, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)]\n\tpor\txmm1, XMMWORD [XMMBLOCK(4,0,rsi,SIZEOF_JCOEF)]\n\tpor\txmm0, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)]\n\tpor\txmm1, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)]\n\tpor\txmm0, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)]\n\tpor\txmm1,xmm0\n\tpacksswb xmm1,xmm1\n\tpacksswb xmm1,xmm1\n\tmovd\teax,xmm1\n\ttest\trax,rax\n\tjnz\tshort .columnDCT\n\n\t; -- AC terms all zero\n\n\tmovdqa\txmm5, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)]\n\tpmullw\txmm5, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\tpsllw\txmm5,PASS1_BITS\n\n\tmovdqa    xmm4,xmm5\t\t; xmm5=in0=(00 01 02 03 04 05 06 07)\n\tpunpcklwd xmm5,xmm5\t\t; xmm5=(00 00 01 01 02 02 03 03)\n\tpunpckhwd xmm4,xmm4\t\t; xmm4=(04 04 05 05 06 06 07 07)\n\n\tpshufd\txmm7,xmm5,0x00\t\t; xmm7=col0=(00 00 00 00 00 00 00 00)\n\tpshufd\txmm6,xmm5,0x55\t\t; xmm6=col1=(01 01 01 01 01 01 01 01)\n\tpshufd\txmm1,xmm5,0xAA\t\t; xmm1=col2=(02 02 02 02 02 02 02 02)\n\tpshufd\txmm5,xmm5,0xFF\t\t; xmm5=col3=(03 03 03 03 03 03 03 03)\n\tpshufd\txmm0,xmm4,0x00\t\t; xmm0=col4=(04 04 04 04 04 04 04 04)\n\tpshufd\txmm3,xmm4,0x55\t\t; xmm3=col5=(05 05 05 05 05 05 05 05)\n\tpshufd\txmm2,xmm4,0xAA\t\t; xmm2=col6=(06 06 06 06 06 06 06 06)\n\tpshufd\txmm4,xmm4,0xFF\t\t; xmm4=col7=(07 07 07 07 07 07 07 07)\n\n\tmovdqa\tXMMWORD [wk(8)], xmm6\t; wk(8)=col1\n\tmovdqa\tXMMWORD [wk(9)], xmm5\t; wk(9)=col3\n\tmovdqa\tXMMWORD [wk(10)], xmm3\t; wk(10)=col5\n\tmovdqa\tXMMWORD [wk(11)], xmm4\t; wk(11)=col7\n\tjmp\tnear .column_end\n%endif\n.columnDCT:\n\n\t; -- Even part\n\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n\tpmullw\txmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\txmm1, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\tmovdqa\txmm2, XMMWORD [XMMBLOCK(4,0,rsi,SIZEOF_JCOEF)]\n\tmovdqa\txmm3, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)]\n\tpmullw\txmm2, XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\txmm3, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\t; (Original)\n\t; z1 = (z2 + z3) * 0.541196100;\n\t; tmp2 = z1 + z3 * -1.847759065;\n\t; tmp3 = z1 + z2 * 0.765366865;\n\t;\n\t; (This implementation)\n\t; tmp2 = z2 * 0.541196100 + z3 * (0.541196100 - 1.847759065);\n\t; tmp3 = z2 * (0.541196100 + 0.765366865) + z3 * 0.541196100;\n\n\tmovdqa    xmm4,xmm1\t\t; xmm1=in2=z2\n\tmovdqa    xmm5,xmm1\n\tpunpcklwd xmm4,xmm3\t\t; xmm3=in6=z3\n\tpunpckhwd xmm5,xmm3\n\tmovdqa    xmm1,xmm4\n\tmovdqa    xmm3,xmm5\n\tpmaddwd   xmm4,[rel PW_F130_F054]\t; xmm4=tmp3L\n\tpmaddwd   xmm5,[rel PW_F130_F054]\t; xmm5=tmp3H\n\tpmaddwd   xmm1,[rel PW_F054_MF130]\t; xmm1=tmp2L\n\tpmaddwd   xmm3,[rel PW_F054_MF130]\t; xmm3=tmp2H\n\n\tmovdqa    xmm6,xmm0\n\tpaddw     xmm0,xmm2\t\t; xmm0=in0+in4\n\tpsubw     xmm6,xmm2\t\t; xmm6=in0-in4\n\n\tpxor      xmm7,xmm7\n\tpxor      xmm2,xmm2\n\tpunpcklwd xmm7,xmm0\t\t; xmm7=tmp0L\n\tpunpckhwd xmm2,xmm0\t\t; xmm2=tmp0H\n\tpsrad     xmm7,(16-CONST_BITS)\t; psrad xmm7,16 & pslld xmm7,CONST_BITS\n\tpsrad     xmm2,(16-CONST_BITS)\t; psrad xmm2,16 & pslld xmm2,CONST_BITS\n\n\tmovdqa\txmm0,xmm7\n\tpaddd\txmm7,xmm4\t\t; xmm7=tmp10L\n\tpsubd\txmm0,xmm4\t\t; xmm0=tmp13L\n\tmovdqa\txmm4,xmm2\n\tpaddd\txmm2,xmm5\t\t; xmm2=tmp10H\n\tpsubd\txmm4,xmm5\t\t; xmm4=tmp13H\n\n\tmovdqa\tXMMWORD [wk(0)], xmm7\t; wk(0)=tmp10L\n\tmovdqa\tXMMWORD [wk(1)], xmm2\t; wk(1)=tmp10H\n\tmovdqa\tXMMWORD [wk(2)], xmm0\t; wk(2)=tmp13L\n\tmovdqa\tXMMWORD [wk(3)], xmm4\t; wk(3)=tmp13H\n\n\tpxor      xmm5,xmm5\n\tpxor      xmm7,xmm7\n\tpunpcklwd xmm5,xmm6\t\t; xmm5=tmp1L\n\tpunpckhwd xmm7,xmm6\t\t; xmm7=tmp1H\n\tpsrad     xmm5,(16-CONST_BITS)\t; psrad xmm5,16 & pslld xmm5,CONST_BITS\n\tpsrad     xmm7,(16-CONST_BITS)\t; psrad xmm7,16 & pslld xmm7,CONST_BITS\n\n\tmovdqa\txmm2,xmm5\n\tpaddd\txmm5,xmm1\t\t; xmm5=tmp11L\n\tpsubd\txmm2,xmm1\t\t; xmm2=tmp12L\n\tmovdqa\txmm0,xmm7\n\tpaddd\txmm7,xmm3\t\t; xmm7=tmp11H\n\tpsubd\txmm0,xmm3\t\t; xmm0=tmp12H\n\n\tmovdqa\tXMMWORD [wk(4)], xmm5\t; wk(4)=tmp11L\n\tmovdqa\tXMMWORD [wk(5)], xmm7\t; wk(5)=tmp11H\n\tmovdqa\tXMMWORD [wk(6)], xmm2\t; wk(6)=tmp12L\n\tmovdqa\tXMMWORD [wk(7)], xmm0\t; wk(7)=tmp12H\n\n\t; -- Odd part\n\n\tmovdqa\txmm4, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n\tmovdqa\txmm6, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)]\n\tpmullw\txmm4, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\txmm6, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)]\n\tmovdqa\txmm3, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)]\n\tpmullw\txmm1, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\txmm3, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\tmovdqa\txmm5,xmm6\n\tmovdqa\txmm7,xmm4\n\tpaddw\txmm5,xmm3\t\t; xmm5=z3\n\tpaddw\txmm7,xmm1\t\t; xmm7=z4\n\n\t; (Original)\n\t; z5 = (z3 + z4) * 1.175875602;\n\t; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n\t; z3 += z5;  z4 += z5;\n\t;\n\t; (This implementation)\n\t; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n\t; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n\tmovdqa    xmm2,xmm5\n\tmovdqa    xmm0,xmm5\n\tpunpcklwd xmm2,xmm7\n\tpunpckhwd xmm0,xmm7\n\tmovdqa    xmm5,xmm2\n\tmovdqa    xmm7,xmm0\n\tpmaddwd   xmm2,[rel PW_MF078_F117]\t; xmm2=z3L\n\tpmaddwd   xmm0,[rel PW_MF078_F117]\t; xmm0=z3H\n\tpmaddwd   xmm5,[rel PW_F117_F078]\t; xmm5=z4L\n\tpmaddwd   xmm7,[rel PW_F117_F078]\t; xmm7=z4H\n\n\tmovdqa\tXMMWORD [wk(10)], xmm2\t; wk(10)=z3L\n\tmovdqa\tXMMWORD [wk(11)], xmm0\t; wk(11)=z3H\n\n\t; (Original)\n\t; z1 = tmp0 + tmp3;  z2 = tmp1 + tmp2;\n\t; tmp0 = tmp0 * 0.298631336;  tmp1 = tmp1 * 2.053119869;\n\t; tmp2 = tmp2 * 3.072711026;  tmp3 = tmp3 * 1.501321110;\n\t; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n\t; tmp0 += z1 + z3;  tmp1 += z2 + z4;\n\t; tmp2 += z2 + z3;  tmp3 += z1 + z4;\n\t;\n\t; (This implementation)\n\t; tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223;\n\t; tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447;\n\t; tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447);\n\t; tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223);\n\t; tmp0 += z3;  tmp1 += z4;\n\t; tmp2 += z3;  tmp3 += z4;\n\n\tmovdqa    xmm2,xmm3\n\tmovdqa    xmm0,xmm3\n\tpunpcklwd xmm2,xmm4\n\tpunpckhwd xmm0,xmm4\n\tmovdqa    xmm3,xmm2\n\tmovdqa    xmm4,xmm0\n\tpmaddwd   xmm2,[rel PW_MF060_MF089]\t; xmm2=tmp0L\n\tpmaddwd   xmm0,[rel PW_MF060_MF089]\t; xmm0=tmp0H\n\tpmaddwd   xmm3,[rel PW_MF089_F060]\t; xmm3=tmp3L\n\tpmaddwd   xmm4,[rel PW_MF089_F060]\t; xmm4=tmp3H\n\n\tpaddd\txmm2, XMMWORD [wk(10)]\t; xmm2=tmp0L\n\tpaddd\txmm0, XMMWORD [wk(11)]\t; xmm0=tmp0H\n\tpaddd\txmm3,xmm5\t\t; xmm3=tmp3L\n\tpaddd\txmm4,xmm7\t\t; xmm4=tmp3H\n\n\tmovdqa\tXMMWORD [wk(8)], xmm2\t; wk(8)=tmp0L\n\tmovdqa\tXMMWORD [wk(9)], xmm0\t; wk(9)=tmp0H\n\n\tmovdqa    xmm2,xmm1\n\tmovdqa    xmm0,xmm1\n\tpunpcklwd xmm2,xmm6\n\tpunpckhwd xmm0,xmm6\n\tmovdqa    xmm1,xmm2\n\tmovdqa    xmm6,xmm0\n\tpmaddwd   xmm2,[rel PW_MF050_MF256]\t; xmm2=tmp1L\n\tpmaddwd   xmm0,[rel PW_MF050_MF256]\t; xmm0=tmp1H\n\tpmaddwd   xmm1,[rel PW_MF256_F050]\t; xmm1=tmp2L\n\tpmaddwd   xmm6,[rel PW_MF256_F050]\t; xmm6=tmp2H\n\n\tpaddd\txmm2,xmm5\t\t; xmm2=tmp1L\n\tpaddd\txmm0,xmm7\t\t; xmm0=tmp1H\n\tpaddd\txmm1, XMMWORD [wk(10)]\t; xmm1=tmp2L\n\tpaddd\txmm6, XMMWORD [wk(11)]\t; xmm6=tmp2H\n\n\tmovdqa\tXMMWORD [wk(10)], xmm2\t; wk(10)=tmp1L\n\tmovdqa\tXMMWORD [wk(11)], xmm0\t; wk(11)=tmp1H\n\n\t; -- Final output stage\n\n\tmovdqa\txmm5, XMMWORD [wk(0)]\t; xmm5=tmp10L\n\tmovdqa\txmm7, XMMWORD [wk(1)]\t; xmm7=tmp10H\n\n\tmovdqa\txmm2,xmm5\n\tmovdqa\txmm0,xmm7\n\tpaddd\txmm5,xmm3\t\t; xmm5=data0L\n\tpaddd\txmm7,xmm4\t\t; xmm7=data0H\n\tpsubd\txmm2,xmm3\t\t; xmm2=data7L\n\tpsubd\txmm0,xmm4\t\t; xmm0=data7H\n\n\tmovdqa\txmm3,[rel PD_DESCALE_P1]\t; xmm3=[rel PD_DESCALE_P1]\n\n\tpaddd\txmm5,xmm3\n\tpaddd\txmm7,xmm3\n\tpsrad\txmm5,DESCALE_P1\n\tpsrad\txmm7,DESCALE_P1\n\tpaddd\txmm2,xmm3\n\tpaddd\txmm0,xmm3\n\tpsrad\txmm2,DESCALE_P1\n\tpsrad\txmm0,DESCALE_P1\n\n\tpackssdw  xmm5,xmm7\t\t; xmm5=data0=(00 01 02 03 04 05 06 07)\n\tpackssdw  xmm2,xmm0\t\t; xmm2=data7=(70 71 72 73 74 75 76 77)\n\n\tmovdqa\txmm4, XMMWORD [wk(4)]\t; xmm4=tmp11L\n\tmovdqa\txmm3, XMMWORD [wk(5)]\t; xmm3=tmp11H\n\n\tmovdqa\txmm7,xmm4\n\tmovdqa\txmm0,xmm3\n\tpaddd\txmm4,xmm1\t\t; xmm4=data1L\n\tpaddd\txmm3,xmm6\t\t; xmm3=data1H\n\tpsubd\txmm7,xmm1\t\t; xmm7=data6L\n\tpsubd\txmm0,xmm6\t\t; xmm0=data6H\n\n\tmovdqa\txmm1,[rel PD_DESCALE_P1]\t; xmm1=[rel PD_DESCALE_P1]\n\n\tpaddd\txmm4,xmm1\n\tpaddd\txmm3,xmm1\n\tpsrad\txmm4,DESCALE_P1\n\tpsrad\txmm3,DESCALE_P1\n\tpaddd\txmm7,xmm1\n\tpaddd\txmm0,xmm1\n\tpsrad\txmm7,DESCALE_P1\n\tpsrad\txmm0,DESCALE_P1\n\n\tpackssdw  xmm4,xmm3\t\t; xmm4=data1=(10 11 12 13 14 15 16 17)\n\tpackssdw  xmm7,xmm0\t\t; xmm7=data6=(60 61 62 63 64 65 66 67)\n\n\tmovdqa    xmm6,xmm5\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm5,xmm4\t\t; xmm5=(00 10 01 11 02 12 03 13)\n\tpunpckhwd xmm6,xmm4\t\t; xmm6=(04 14 05 15 06 16 07 17)\n\tmovdqa    xmm1,xmm7\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm7,xmm2\t\t; xmm7=(60 70 61 71 62 72 63 73)\n\tpunpckhwd xmm1,xmm2\t\t; xmm1=(64 74 65 75 66 76 67 77)\n\n\tmovdqa\txmm3, XMMWORD [wk(6)]\t; xmm3=tmp12L\n\tmovdqa\txmm0, XMMWORD [wk(7)]\t; xmm0=tmp12H\n\tmovdqa\txmm4, XMMWORD [wk(10)]\t; xmm4=tmp1L\n\tmovdqa\txmm2, XMMWORD [wk(11)]\t; xmm2=tmp1H\n\n\tmovdqa\tXMMWORD [wk(0)], xmm5\t; wk(0)=(00 10 01 11 02 12 03 13)\n\tmovdqa\tXMMWORD [wk(1)], xmm6\t; wk(1)=(04 14 05 15 06 16 07 17)\n\tmovdqa\tXMMWORD [wk(4)], xmm7\t; wk(4)=(60 70 61 71 62 72 63 73)\n\tmovdqa\tXMMWORD [wk(5)], xmm1\t; wk(5)=(64 74 65 75 66 76 67 77)\n\n\tmovdqa\txmm5,xmm3\n\tmovdqa\txmm6,xmm0\n\tpaddd\txmm3,xmm4\t\t; xmm3=data2L\n\tpaddd\txmm0,xmm2\t\t; xmm0=data2H\n\tpsubd\txmm5,xmm4\t\t; xmm5=data5L\n\tpsubd\txmm6,xmm2\t\t; xmm6=data5H\n\n\tmovdqa\txmm7,[rel PD_DESCALE_P1]\t; xmm7=[rel PD_DESCALE_P1]\n\n\tpaddd\txmm3,xmm7\n\tpaddd\txmm0,xmm7\n\tpsrad\txmm3,DESCALE_P1\n\tpsrad\txmm0,DESCALE_P1\n\tpaddd\txmm5,xmm7\n\tpaddd\txmm6,xmm7\n\tpsrad\txmm5,DESCALE_P1\n\tpsrad\txmm6,DESCALE_P1\n\n\tpackssdw  xmm3,xmm0\t\t; xmm3=data2=(20 21 22 23 24 25 26 27)\n\tpackssdw  xmm5,xmm6\t\t; xmm5=data5=(50 51 52 53 54 55 56 57)\n\n\tmovdqa\txmm1, XMMWORD [wk(2)]\t; xmm1=tmp13L\n\tmovdqa\txmm4, XMMWORD [wk(3)]\t; xmm4=tmp13H\n\tmovdqa\txmm2, XMMWORD [wk(8)]\t; xmm2=tmp0L\n\tmovdqa\txmm7, XMMWORD [wk(9)]\t; xmm7=tmp0H\n\n\tmovdqa\txmm0,xmm1\n\tmovdqa\txmm6,xmm4\n\tpaddd\txmm1,xmm2\t\t; xmm1=data3L\n\tpaddd\txmm4,xmm7\t\t; xmm4=data3H\n\tpsubd\txmm0,xmm2\t\t; xmm0=data4L\n\tpsubd\txmm6,xmm7\t\t; xmm6=data4H\n\n\tmovdqa\txmm2,[rel PD_DESCALE_P1]\t; xmm2=[rel PD_DESCALE_P1]\n\n\tpaddd\txmm1,xmm2\n\tpaddd\txmm4,xmm2\n\tpsrad\txmm1,DESCALE_P1\n\tpsrad\txmm4,DESCALE_P1\n\tpaddd\txmm0,xmm2\n\tpaddd\txmm6,xmm2\n\tpsrad\txmm0,DESCALE_P1\n\tpsrad\txmm6,DESCALE_P1\n\n\tpackssdw  xmm1,xmm4\t\t; xmm1=data3=(30 31 32 33 34 35 36 37)\n\tpackssdw  xmm0,xmm6\t\t; xmm0=data4=(40 41 42 43 44 45 46 47)\n\n\tmovdqa\txmm7, XMMWORD [wk(0)]\t; xmm7=(00 10 01 11 02 12 03 13)\n\tmovdqa\txmm2, XMMWORD [wk(1)]\t; xmm2=(04 14 05 15 06 16 07 17)\n\n\tmovdqa    xmm4,xmm3\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm3,xmm1\t\t; xmm3=(20 30 21 31 22 32 23 33)\n\tpunpckhwd xmm4,xmm1\t\t; xmm4=(24 34 25 35 26 36 27 37)\n\tmovdqa    xmm6,xmm0\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm0,xmm5\t\t; xmm0=(40 50 41 51 42 52 43 53)\n\tpunpckhwd xmm6,xmm5\t\t; xmm6=(44 54 45 55 46 56 47 57)\n\n\tmovdqa    xmm1,xmm7\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm7,xmm3\t\t; xmm7=(00 10 20 30 01 11 21 31)\n\tpunpckhdq xmm1,xmm3\t\t; xmm1=(02 12 22 32 03 13 23 33)\n\tmovdqa    xmm5,xmm2\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm2,xmm4\t\t; xmm2=(04 14 24 34 05 15 25 35)\n\tpunpckhdq xmm5,xmm4\t\t; xmm5=(06 16 26 36 07 17 27 37)\n\n\tmovdqa\txmm3, XMMWORD [wk(4)]\t; xmm3=(60 70 61 71 62 72 63 73)\n\tmovdqa\txmm4, XMMWORD [wk(5)]\t; xmm4=(64 74 65 75 66 76 67 77)\n\n\tmovdqa\tXMMWORD [wk(6)], xmm2\t; wk(6)=(04 14 24 34 05 15 25 35)\n\tmovdqa\tXMMWORD [wk(7)], xmm5\t; wk(7)=(06 16 26 36 07 17 27 37)\n\n\tmovdqa    xmm2,xmm0\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm0,xmm3\t\t; xmm0=(40 50 60 70 41 51 61 71)\n\tpunpckhdq xmm2,xmm3\t\t; xmm2=(42 52 62 72 43 53 63 73)\n\tmovdqa    xmm5,xmm6\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm6,xmm4\t\t; xmm6=(44 54 64 74 45 55 65 75)\n\tpunpckhdq xmm5,xmm4\t\t; xmm5=(46 56 66 76 47 57 67 77)\n\n\tmovdqa     xmm3,xmm7\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm7,xmm0\t\t; xmm7=col0=(00 10 20 30 40 50 60 70)\n\tpunpckhqdq xmm3,xmm0\t\t; xmm3=col1=(01 11 21 31 41 51 61 71)\n\tmovdqa     xmm4,xmm1\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm1,xmm2\t\t; xmm1=col2=(02 12 22 32 42 52 62 72)\n\tpunpckhqdq xmm4,xmm2\t\t; xmm4=col3=(03 13 23 33 43 53 63 73)\n\n\tmovdqa\txmm0, XMMWORD [wk(6)]\t; xmm0=(04 14 24 34 05 15 25 35)\n\tmovdqa\txmm2, XMMWORD [wk(7)]\t; xmm2=(06 16 26 36 07 17 27 37)\n\n\tmovdqa\tXMMWORD [wk(8)], xmm3\t; wk(8)=col1\n\tmovdqa\tXMMWORD [wk(9)], xmm4\t; wk(9)=col3\n\n\tmovdqa     xmm3,xmm0\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm0,xmm6\t\t; xmm0=col4=(04 14 24 34 44 54 64 74)\n\tpunpckhqdq xmm3,xmm6\t\t; xmm3=col5=(05 15 25 35 45 55 65 75)\n\tmovdqa     xmm4,xmm2\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm2,xmm5\t\t; xmm2=col6=(06 16 26 36 46 56 66 76)\n\tpunpckhqdq xmm4,xmm5\t\t; xmm4=col7=(07 17 27 37 47 57 67 77)\n\n\tmovdqa\tXMMWORD [wk(10)], xmm3\t; wk(10)=col5\n\tmovdqa\tXMMWORD [wk(11)], xmm4\t; wk(11)=col7\n.column_end:\n\n\t; -- Prefetch the next coefficient block\n\n\tprefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 0*32]\n\tprefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 1*32]\n\tprefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 2*32]\n\tprefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 3*32]\n\n\t; ---- Pass 2: process rows from work array, store into output array.\n\n\tmov\trax, [original_rbp]\n\tmov\trdi, r12\t; (JSAMPROW *)\n\tmov\trax, r13\n\n\t; -- Even part\n\n\t; xmm7=col0, xmm1=col2, xmm0=col4, xmm2=col6\n\n\t; (Original)\n\t; z1 = (z2 + z3) * 0.541196100;\n\t; tmp2 = z1 + z3 * -1.847759065;\n\t; tmp3 = z1 + z2 * 0.765366865;\n\t;\n\t; (This implementation)\n\t; tmp2 = z2 * 0.541196100 + z3 * (0.541196100 - 1.847759065);\n\t; tmp3 = z2 * (0.541196100 + 0.765366865) + z3 * 0.541196100;\n\n\tmovdqa    xmm6,xmm1\t\t; xmm1=in2=z2\n\tmovdqa    xmm5,xmm1\n\tpunpcklwd xmm6,xmm2\t\t; xmm2=in6=z3\n\tpunpckhwd xmm5,xmm2\n\tmovdqa    xmm1,xmm6\n\tmovdqa    xmm2,xmm5\n\tpmaddwd   xmm6,[rel PW_F130_F054]\t; xmm6=tmp3L\n\tpmaddwd   xmm5,[rel PW_F130_F054]\t; xmm5=tmp3H\n\tpmaddwd   xmm1,[rel PW_F054_MF130]\t; xmm1=tmp2L\n\tpmaddwd   xmm2,[rel PW_F054_MF130]\t; xmm2=tmp2H\n\n\tmovdqa    xmm3,xmm7\n\tpaddw     xmm7,xmm0\t\t; xmm7=in0+in4\n\tpsubw     xmm3,xmm0\t\t; xmm3=in0-in4\n\n\tpxor      xmm4,xmm4\n\tpxor      xmm0,xmm0\n\tpunpcklwd xmm4,xmm7\t\t; xmm4=tmp0L\n\tpunpckhwd xmm0,xmm7\t\t; xmm0=tmp0H\n\tpsrad     xmm4,(16-CONST_BITS)\t; psrad xmm4,16 & pslld xmm4,CONST_BITS\n\tpsrad     xmm0,(16-CONST_BITS)\t; psrad xmm0,16 & pslld xmm0,CONST_BITS\n\n\tmovdqa\txmm7,xmm4\n\tpaddd\txmm4,xmm6\t\t; xmm4=tmp10L\n\tpsubd\txmm7,xmm6\t\t; xmm7=tmp13L\n\tmovdqa\txmm6,xmm0\n\tpaddd\txmm0,xmm5\t\t; xmm0=tmp10H\n\tpsubd\txmm6,xmm5\t\t; xmm6=tmp13H\n\n\tmovdqa\tXMMWORD [wk(0)], xmm4\t; wk(0)=tmp10L\n\tmovdqa\tXMMWORD [wk(1)], xmm0\t; wk(1)=tmp10H\n\tmovdqa\tXMMWORD [wk(2)], xmm7\t; wk(2)=tmp13L\n\tmovdqa\tXMMWORD [wk(3)], xmm6\t; wk(3)=tmp13H\n\n\tpxor      xmm5,xmm5\n\tpxor      xmm4,xmm4\n\tpunpcklwd xmm5,xmm3\t\t; xmm5=tmp1L\n\tpunpckhwd xmm4,xmm3\t\t; xmm4=tmp1H\n\tpsrad     xmm5,(16-CONST_BITS)\t; psrad xmm5,16 & pslld xmm5,CONST_BITS\n\tpsrad     xmm4,(16-CONST_BITS)\t; psrad xmm4,16 & pslld xmm4,CONST_BITS\n\n\tmovdqa\txmm0,xmm5\n\tpaddd\txmm5,xmm1\t\t; xmm5=tmp11L\n\tpsubd\txmm0,xmm1\t\t; xmm0=tmp12L\n\tmovdqa\txmm7,xmm4\n\tpaddd\txmm4,xmm2\t\t; xmm4=tmp11H\n\tpsubd\txmm7,xmm2\t\t; xmm7=tmp12H\n\n\tmovdqa\tXMMWORD [wk(4)], xmm5\t; wk(4)=tmp11L\n\tmovdqa\tXMMWORD [wk(5)], xmm4\t; wk(5)=tmp11H\n\tmovdqa\tXMMWORD [wk(6)], xmm0\t; wk(6)=tmp12L\n\tmovdqa\tXMMWORD [wk(7)], xmm7\t; wk(7)=tmp12H\n\n\t; -- Odd part\n\n\tmovdqa\txmm6, XMMWORD [wk(9)]\t; xmm6=col3\n\tmovdqa\txmm3, XMMWORD [wk(8)]\t; xmm3=col1\n\tmovdqa\txmm1, XMMWORD [wk(11)]\t; xmm1=col7\n\tmovdqa\txmm2, XMMWORD [wk(10)]\t; xmm2=col5\n\n\tmovdqa\txmm5,xmm6\n\tmovdqa\txmm4,xmm3\n\tpaddw\txmm5,xmm1\t\t; xmm5=z3\n\tpaddw\txmm4,xmm2\t\t; xmm4=z4\n\n\t; (Original)\n\t; z5 = (z3 + z4) * 1.175875602;\n\t; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n\t; z3 += z5;  z4 += z5;\n\t;\n\t; (This implementation)\n\t; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n\t; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n\tmovdqa    xmm0,xmm5\n\tmovdqa    xmm7,xmm5\n\tpunpcklwd xmm0,xmm4\n\tpunpckhwd xmm7,xmm4\n\tmovdqa    xmm5,xmm0\n\tmovdqa    xmm4,xmm7\n\tpmaddwd   xmm0,[rel PW_MF078_F117]\t; xmm0=z3L\n\tpmaddwd   xmm7,[rel PW_MF078_F117]\t; xmm7=z3H\n\tpmaddwd   xmm5,[rel PW_F117_F078]\t; xmm5=z4L\n\tpmaddwd   xmm4,[rel PW_F117_F078]\t; xmm4=z4H\n\n\tmovdqa\tXMMWORD [wk(10)], xmm0\t; wk(10)=z3L\n\tmovdqa\tXMMWORD [wk(11)], xmm7\t; wk(11)=z3H\n\n\t; (Original)\n\t; z1 = tmp0 + tmp3;  z2 = tmp1 + tmp2;\n\t; tmp0 = tmp0 * 0.298631336;  tmp1 = tmp1 * 2.053119869;\n\t; tmp2 = tmp2 * 3.072711026;  tmp3 = tmp3 * 1.501321110;\n\t; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n\t; tmp0 += z1 + z3;  tmp1 += z2 + z4;\n\t; tmp2 += z2 + z3;  tmp3 += z1 + z4;\n\t;\n\t; (This implementation)\n\t; tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223;\n\t; tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447;\n\t; tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447);\n\t; tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223);\n\t; tmp0 += z3;  tmp1 += z4;\n\t; tmp2 += z3;  tmp3 += z4;\n\n\tmovdqa    xmm0,xmm1\n\tmovdqa    xmm7,xmm1\n\tpunpcklwd xmm0,xmm3\n\tpunpckhwd xmm7,xmm3\n\tmovdqa    xmm1,xmm0\n\tmovdqa    xmm3,xmm7\n\tpmaddwd   xmm0,[rel PW_MF060_MF089]\t; xmm0=tmp0L\n\tpmaddwd   xmm7,[rel PW_MF060_MF089]\t; xmm7=tmp0H\n\tpmaddwd   xmm1,[rel PW_MF089_F060]\t; xmm1=tmp3L\n\tpmaddwd   xmm3,[rel PW_MF089_F060]\t; xmm3=tmp3H\n\n\tpaddd\txmm0, XMMWORD [wk(10)]\t; xmm0=tmp0L\n\tpaddd\txmm7, XMMWORD [wk(11)]\t; xmm7=tmp0H\n\tpaddd\txmm1,xmm5\t\t; xmm1=tmp3L\n\tpaddd\txmm3,xmm4\t\t; xmm3=tmp3H\n\n\tmovdqa\tXMMWORD [wk(8)], xmm0\t; wk(8)=tmp0L\n\tmovdqa\tXMMWORD [wk(9)], xmm7\t; wk(9)=tmp0H\n\n\tmovdqa    xmm0,xmm2\n\tmovdqa    xmm7,xmm2\n\tpunpcklwd xmm0,xmm6\n\tpunpckhwd xmm7,xmm6\n\tmovdqa    xmm2,xmm0\n\tmovdqa    xmm6,xmm7\n\tpmaddwd   xmm0,[rel PW_MF050_MF256]\t; xmm0=tmp1L\n\tpmaddwd   xmm7,[rel PW_MF050_MF256]\t; xmm7=tmp1H\n\tpmaddwd   xmm2,[rel PW_MF256_F050]\t; xmm2=tmp2L\n\tpmaddwd   xmm6,[rel PW_MF256_F050]\t; xmm6=tmp2H\n\n\tpaddd\txmm0,xmm5\t\t; xmm0=tmp1L\n\tpaddd\txmm7,xmm4\t\t; xmm7=tmp1H\n\tpaddd\txmm2, XMMWORD [wk(10)]\t; xmm2=tmp2L\n\tpaddd\txmm6, XMMWORD [wk(11)]\t; xmm6=tmp2H\n\n\tmovdqa\tXMMWORD [wk(10)], xmm0\t; wk(10)=tmp1L\n\tmovdqa\tXMMWORD [wk(11)], xmm7\t; wk(11)=tmp1H\n\n\t; -- Final output stage\n\n\tmovdqa\txmm5, XMMWORD [wk(0)]\t; xmm5=tmp10L\n\tmovdqa\txmm4, XMMWORD [wk(1)]\t; xmm4=tmp10H\n\n\tmovdqa\txmm0,xmm5\n\tmovdqa\txmm7,xmm4\n\tpaddd\txmm5,xmm1\t\t; xmm5=data0L\n\tpaddd\txmm4,xmm3\t\t; xmm4=data0H\n\tpsubd\txmm0,xmm1\t\t; xmm0=data7L\n\tpsubd\txmm7,xmm3\t\t; xmm7=data7H\n\n\tmovdqa\txmm1,[rel PD_DESCALE_P2]\t; xmm1=[rel PD_DESCALE_P2]\n\n\tpaddd\txmm5,xmm1\n\tpaddd\txmm4,xmm1\n\tpsrad\txmm5,DESCALE_P2\n\tpsrad\txmm4,DESCALE_P2\n\tpaddd\txmm0,xmm1\n\tpaddd\txmm7,xmm1\n\tpsrad\txmm0,DESCALE_P2\n\tpsrad\txmm7,DESCALE_P2\n\n\tpackssdw  xmm5,xmm4\t\t; xmm5=data0=(00 10 20 30 40 50 60 70)\n\tpackssdw  xmm0,xmm7\t\t; xmm0=data7=(07 17 27 37 47 57 67 77)\n\n\tmovdqa\txmm3, XMMWORD [wk(4)]\t; xmm3=tmp11L\n\tmovdqa\txmm1, XMMWORD [wk(5)]\t; xmm1=tmp11H\n\n\tmovdqa\txmm4,xmm3\n\tmovdqa\txmm7,xmm1\n\tpaddd\txmm3,xmm2\t\t; xmm3=data1L\n\tpaddd\txmm1,xmm6\t\t; xmm1=data1H\n\tpsubd\txmm4,xmm2\t\t; xmm4=data6L\n\tpsubd\txmm7,xmm6\t\t; xmm7=data6H\n\n\tmovdqa\txmm2,[rel PD_DESCALE_P2]\t; xmm2=[rel PD_DESCALE_P2]\n\n\tpaddd\txmm3,xmm2\n\tpaddd\txmm1,xmm2\n\tpsrad\txmm3,DESCALE_P2\n\tpsrad\txmm1,DESCALE_P2\n\tpaddd\txmm4,xmm2\n\tpaddd\txmm7,xmm2\n\tpsrad\txmm4,DESCALE_P2\n\tpsrad\txmm7,DESCALE_P2\n\n\tpackssdw  xmm3,xmm1\t\t; xmm3=data1=(01 11 21 31 41 51 61 71)\n\tpackssdw  xmm4,xmm7\t\t; xmm4=data6=(06 16 26 36 46 56 66 76)\n\n\tpacksswb  xmm5,xmm4\t\t; xmm5=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76)\n\tpacksswb  xmm3,xmm0\t\t; xmm3=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77)\n\n\tmovdqa\txmm6, XMMWORD [wk(6)]\t; xmm6=tmp12L\n\tmovdqa\txmm2, XMMWORD [wk(7)]\t; xmm2=tmp12H\n\tmovdqa\txmm1, XMMWORD [wk(10)]\t; xmm1=tmp1L\n\tmovdqa\txmm7, XMMWORD [wk(11)]\t; xmm7=tmp1H\n\n\tmovdqa\tXMMWORD [wk(0)], xmm5\t; wk(0)=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76)\n\tmovdqa\tXMMWORD [wk(1)], xmm3\t; wk(1)=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77)\n\n\tmovdqa\txmm4,xmm6\n\tmovdqa\txmm0,xmm2\n\tpaddd\txmm6,xmm1\t\t; xmm6=data2L\n\tpaddd\txmm2,xmm7\t\t; xmm2=data2H\n\tpsubd\txmm4,xmm1\t\t; xmm4=data5L\n\tpsubd\txmm0,xmm7\t\t; xmm0=data5H\n\n\tmovdqa\txmm5,[rel PD_DESCALE_P2]\t; xmm5=[rel PD_DESCALE_P2]\n\n\tpaddd\txmm6,xmm5\n\tpaddd\txmm2,xmm5\n\tpsrad\txmm6,DESCALE_P2\n\tpsrad\txmm2,DESCALE_P2\n\tpaddd\txmm4,xmm5\n\tpaddd\txmm0,xmm5\n\tpsrad\txmm4,DESCALE_P2\n\tpsrad\txmm0,DESCALE_P2\n\n\tpackssdw  xmm6,xmm2\t\t; xmm6=data2=(02 12 22 32 42 52 62 72)\n\tpackssdw  xmm4,xmm0\t\t; xmm4=data5=(05 15 25 35 45 55 65 75)\n\n\tmovdqa\txmm3, XMMWORD [wk(2)]\t; xmm3=tmp13L\n\tmovdqa\txmm1, XMMWORD [wk(3)]\t; xmm1=tmp13H\n\tmovdqa\txmm7, XMMWORD [wk(8)]\t; xmm7=tmp0L\n\tmovdqa\txmm5, XMMWORD [wk(9)]\t; xmm5=tmp0H\n\n\tmovdqa\txmm2,xmm3\n\tmovdqa\txmm0,xmm1\n\tpaddd\txmm3,xmm7\t\t; xmm3=data3L\n\tpaddd\txmm1,xmm5\t\t; xmm1=data3H\n\tpsubd\txmm2,xmm7\t\t; xmm2=data4L\n\tpsubd\txmm0,xmm5\t\t; xmm0=data4H\n\n\tmovdqa\txmm7,[rel PD_DESCALE_P2]\t; xmm7=[rel PD_DESCALE_P2]\n\n\tpaddd\txmm3,xmm7\n\tpaddd\txmm1,xmm7\n\tpsrad\txmm3,DESCALE_P2\n\tpsrad\txmm1,DESCALE_P2\n\tpaddd\txmm2,xmm7\n\tpaddd\txmm0,xmm7\n\tpsrad\txmm2,DESCALE_P2\n\tpsrad\txmm0,DESCALE_P2\n\n\tmovdqa    xmm5,[rel PB_CENTERJSAMP]\t; xmm5=[rel PB_CENTERJSAMP]\n\n\tpackssdw  xmm3,xmm1\t\t; xmm3=data3=(03 13 23 33 43 53 63 73)\n\tpackssdw  xmm2,xmm0\t\t; xmm2=data4=(04 14 24 34 44 54 64 74)\n\n\tmovdqa    xmm7, XMMWORD [wk(0)]\t; xmm7=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76)\n\tmovdqa    xmm1, XMMWORD [wk(1)]\t; xmm1=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77)\n\n\tpacksswb  xmm6,xmm2\t\t; xmm6=(02 12 22 32 42 52 62 72 04 14 24 34 44 54 64 74)\n\tpacksswb  xmm3,xmm4\t\t; xmm3=(03 13 23 33 43 53 63 73 05 15 25 35 45 55 65 75)\n\n\tpaddb     xmm7,xmm5\n\tpaddb     xmm1,xmm5\n\tpaddb     xmm6,xmm5\n\tpaddb     xmm3,xmm5\n\n\tmovdqa    xmm0,xmm7\t; transpose coefficients(phase 1)\n\tpunpcklbw xmm7,xmm1\t; xmm7=(00 01 10 11 20 21 30 31 40 41 50 51 60 61 70 71)\n\tpunpckhbw xmm0,xmm1\t; xmm0=(06 07 16 17 26 27 36 37 46 47 56 57 66 67 76 77)\n\tmovdqa    xmm2,xmm6\t; transpose coefficients(phase 1)\n\tpunpcklbw xmm6,xmm3\t; xmm6=(02 03 12 13 22 23 32 33 42 43 52 53 62 63 72 73)\n\tpunpckhbw xmm2,xmm3\t; xmm2=(04 05 14 15 24 25 34 35 44 45 54 55 64 65 74 75)\n\n\tmovdqa    xmm4,xmm7\t; transpose coefficients(phase 2)\n\tpunpcklwd xmm7,xmm6\t; xmm7=(00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33)\n\tpunpckhwd xmm4,xmm6\t; xmm4=(40 41 42 43 50 51 52 53 60 61 62 63 70 71 72 73)\n\tmovdqa    xmm5,xmm2\t; transpose coefficients(phase 2)\n\tpunpcklwd xmm2,xmm0\t; xmm2=(04 05 06 07 14 15 16 17 24 25 26 27 34 35 36 37)\n\tpunpckhwd xmm5,xmm0\t; xmm5=(44 45 46 47 54 55 56 57 64 65 66 67 74 75 76 77)\n\n\tmovdqa    xmm1,xmm7\t; transpose coefficients(phase 3)\n\tpunpckldq xmm7,xmm2\t; xmm7=(00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17)\n\tpunpckhdq xmm1,xmm2\t; xmm1=(20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37)\n\tmovdqa    xmm3,xmm4\t; transpose coefficients(phase 3)\n\tpunpckldq xmm4,xmm5\t; xmm4=(40 41 42 43 44 45 46 47 50 51 52 53 54 55 56 57)\n\tpunpckhdq xmm3,xmm5\t; xmm3=(60 61 62 63 64 65 66 67 70 71 72 73 74 75 76 77)\n\n\tpshufd\txmm6,xmm7,0x4E\t; xmm6=(10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07)\n\tpshufd\txmm0,xmm1,0x4E\t; xmm0=(30 31 32 33 34 35 36 37 20 21 22 23 24 25 26 27)\n\tpshufd\txmm2,xmm4,0x4E\t; xmm2=(50 51 52 53 54 55 56 57 40 41 42 43 44 45 46 47)\n\tpshufd\txmm5,xmm3,0x4E\t; xmm5=(70 71 72 73 74 75 76 77 60 61 62 63 64 65 66 67)\n\n\tmov\trdx, JSAMPROW [rdi+0*SIZEOF_JSAMPROW]\n\tmov\trsi, JSAMPROW [rdi+2*SIZEOF_JSAMPROW]\n\tmovq\tXMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm7\n\tmovq\tXMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm1\n\tmov\trdx, JSAMPROW [rdi+4*SIZEOF_JSAMPROW]\n\tmov\trsi, JSAMPROW [rdi+6*SIZEOF_JSAMPROW]\n\tmovq\tXMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm4\n\tmovq\tXMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm3\n\n\tmov\trdx, JSAMPROW [rdi+1*SIZEOF_JSAMPROW]\n\tmov\trsi, JSAMPROW [rdi+3*SIZEOF_JSAMPROW]\n\tmovq\tXMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm6\n\tmovq\tXMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm0\n\tmov\trdx, JSAMPROW [rdi+5*SIZEOF_JSAMPROW]\n\tmov\trsi, JSAMPROW [rdi+7*SIZEOF_JSAMPROW]\n\tmovq\tXMM_MMWORD [rdx+rax*SIZEOF_JSAMPLE], xmm2\n\tmovq\tXMM_MMWORD [rsi+rax*SIZEOF_JSAMPLE], xmm5\n\n\tuncollect_args\n\tmov\trsp,rbp\t\t; rsp <- aligned rbp\n\tpop\trsp\t\t; rsp <- original rbp\n\tpop\trbp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jiss2int.asm",
    "content": ";\n; jiss2int.asm - accurate integer IDCT (SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a slow-but-accurate integer implementation of the\n; inverse DCT (Discrete Cosine Transform). The following code is based\n; directly on the IJG's original jidctint.c; see the jidctint.c for\n; more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS\t13\n%define PASS1_BITS\t2\n\n%define DESCALE_P1\t(CONST_BITS-PASS1_BITS)\n%define DESCALE_P2\t(CONST_BITS+PASS1_BITS+3)\n\n%if CONST_BITS == 13\nF_0_298\tequ\t 2446\t\t; FIX(0.298631336)\nF_0_390\tequ\t 3196\t\t; FIX(0.390180644)\nF_0_541\tequ\t 4433\t\t; FIX(0.541196100)\nF_0_765\tequ\t 6270\t\t; FIX(0.765366865)\nF_0_899\tequ\t 7373\t\t; FIX(0.899976223)\nF_1_175\tequ\t 9633\t\t; FIX(1.175875602)\nF_1_501\tequ\t12299\t\t; FIX(1.501321110)\nF_1_847\tequ\t15137\t\t; FIX(1.847759065)\nF_1_961\tequ\t16069\t\t; FIX(1.961570560)\nF_2_053\tequ\t16819\t\t; FIX(2.053119869)\nF_2_562\tequ\t20995\t\t; FIX(2.562915447)\nF_3_072\tequ\t25172\t\t; FIX(3.072711026)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_298\tequ\tDESCALE( 320652955,30-CONST_BITS)\t; FIX(0.298631336)\nF_0_390\tequ\tDESCALE( 418953276,30-CONST_BITS)\t; FIX(0.390180644)\nF_0_541\tequ\tDESCALE( 581104887,30-CONST_BITS)\t; FIX(0.541196100)\nF_0_765\tequ\tDESCALE( 821806413,30-CONST_BITS)\t; FIX(0.765366865)\nF_0_899\tequ\tDESCALE( 966342111,30-CONST_BITS)\t; FIX(0.899976223)\nF_1_175\tequ\tDESCALE(1262586813,30-CONST_BITS)\t; FIX(1.175875602)\nF_1_501\tequ\tDESCALE(1612031267,30-CONST_BITS)\t; FIX(1.501321110)\nF_1_847\tequ\tDESCALE(1984016188,30-CONST_BITS)\t; FIX(1.847759065)\nF_1_961\tequ\tDESCALE(2106220350,30-CONST_BITS)\t; FIX(1.961570560)\nF_2_053\tequ\tDESCALE(2204520673,30-CONST_BITS)\t; FIX(2.053119869)\nF_2_562\tequ\tDESCALE(2751909506,30-CONST_BITS)\t; FIX(2.562915447)\nF_3_072\tequ\tDESCALE(3299298341,30-CONST_BITS)\t; FIX(3.072711026)\n%endif\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_idct_islow_sse2)\n\nEXTN(jconst_idct_islow_sse2):\n\nPW_F130_F054\ttimes 4 dw  (F_0_541+F_0_765), F_0_541\nPW_F054_MF130\ttimes 4 dw  F_0_541, (F_0_541-F_1_847)\nPW_MF078_F117\ttimes 4 dw  (F_1_175-F_1_961), F_1_175\nPW_F117_F078\ttimes 4 dw  F_1_175, (F_1_175-F_0_390)\nPW_MF060_MF089\ttimes 4 dw  (F_0_298-F_0_899),-F_0_899\nPW_MF089_F060\ttimes 4 dw -F_0_899, (F_1_501-F_0_899)\nPW_MF050_MF256\ttimes 4 dw  (F_2_053-F_2_562),-F_2_562\nPW_MF256_F050\ttimes 4 dw -F_2_562, (F_3_072-F_2_562)\nPD_DESCALE_P1\ttimes 4 dd  1 << (DESCALE_P1-1)\nPD_DESCALE_P2\ttimes 4 dd  1 << (DESCALE_P2-1)\nPB_CENTERJSAMP\ttimes 16 db CENTERJSAMPLE\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Perform dequantization and inverse DCT on one block of coefficients.\n;\n; GLOBAL(void)\n; jsimd_idct_islow_sse2 (void * dct_table, JCOEFPTR coef_block,\n;                        JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n%define dct_table(b)\t(b)+8\t\t\t; jpeg_component_info * compptr\n%define coef_block(b)\t(b)+12\t\t; JCOEFPTR coef_block\n%define output_buf(b)\t(b)+16\t\t; JSAMPARRAY output_buf\n%define output_col(b)\t(b)+20\t\t; JDIMENSION output_col\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t12\n\n\talign\t16\n\tglobal\tEXTN(jsimd_idct_islow_sse2)\n\nEXTN(jsimd_idct_islow_sse2):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [wk(0)]\n\tpushpic\tebx\n;\tpush\tecx\t\t; unused\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t; get GOT address\n\n\t; ---- Pass 1: process columns from input.\n\n;\tmov\teax, [original_ebp]\n\tmov\tedx, POINTER [dct_table(eax)]\t; quantptr\n\tmov\tesi, JCOEFPTR [coef_block(eax)]\t\t; inptr\n\n%ifndef NO_ZERO_COLUMN_TEST_ISLOW_SSE2\n\tmov\teax, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tor\teax, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tjnz\tnear .columnDCT\n\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tpor\txmm0, XMMWORD [XMMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tpor\txmm1, XMMWORD [XMMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n\tpor\txmm0, XMMWORD [XMMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tpor\txmm1, XMMWORD [XMMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\tpor\txmm0, XMMWORD [XMMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\tpor\txmm1,xmm0\n\tpacksswb xmm1,xmm1\n\tpacksswb xmm1,xmm1\n\tmovd\teax,xmm1\n\ttest\teax,eax\n\tjnz\tshort .columnDCT\n\n\t; -- AC terms all zero\n\n\tmovdqa\txmm5, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\tpmullw\txmm5, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\tpsllw\txmm5,PASS1_BITS\n\n\tmovdqa    xmm4,xmm5\t\t; xmm5=in0=(00 01 02 03 04 05 06 07)\n\tpunpcklwd xmm5,xmm5\t\t; xmm5=(00 00 01 01 02 02 03 03)\n\tpunpckhwd xmm4,xmm4\t\t; xmm4=(04 04 05 05 06 06 07 07)\n\n\tpshufd\txmm7,xmm5,0x00\t\t; xmm7=col0=(00 00 00 00 00 00 00 00)\n\tpshufd\txmm6,xmm5,0x55\t\t; xmm6=col1=(01 01 01 01 01 01 01 01)\n\tpshufd\txmm1,xmm5,0xAA\t\t; xmm1=col2=(02 02 02 02 02 02 02 02)\n\tpshufd\txmm5,xmm5,0xFF\t\t; xmm5=col3=(03 03 03 03 03 03 03 03)\n\tpshufd\txmm0,xmm4,0x00\t\t; xmm0=col4=(04 04 04 04 04 04 04 04)\n\tpshufd\txmm3,xmm4,0x55\t\t; xmm3=col5=(05 05 05 05 05 05 05 05)\n\tpshufd\txmm2,xmm4,0xAA\t\t; xmm2=col6=(06 06 06 06 06 06 06 06)\n\tpshufd\txmm4,xmm4,0xFF\t\t; xmm4=col7=(07 07 07 07 07 07 07 07)\n\n\tmovdqa\tXMMWORD [wk(8)], xmm6\t; wk(8)=col1\n\tmovdqa\tXMMWORD [wk(9)], xmm5\t; wk(9)=col3\n\tmovdqa\tXMMWORD [wk(10)], xmm3\t; wk(10)=col5\n\tmovdqa\tXMMWORD [wk(11)], xmm4\t; wk(11)=col7\n\tjmp\tnear .column_end\n\talignx\t16,7\n%endif\n.columnDCT:\n\n\t; -- Even part\n\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tpmullw\txmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\txmm1, XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tmovdqa\txmm2, XMMWORD [XMMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n\tmovdqa\txmm3, XMMWORD [XMMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\tpmullw\txmm2, XMMWORD [XMMBLOCK(4,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\txmm3, XMMWORD [XMMBLOCK(6,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\t; (Original)\n\t; z1 = (z2 + z3) * 0.541196100;\n\t; tmp2 = z1 + z3 * -1.847759065;\n\t; tmp3 = z1 + z2 * 0.765366865;\n\t;\n\t; (This implementation)\n\t; tmp2 = z2 * 0.541196100 + z3 * (0.541196100 - 1.847759065);\n\t; tmp3 = z2 * (0.541196100 + 0.765366865) + z3 * 0.541196100;\n\n\tmovdqa    xmm4,xmm1\t\t; xmm1=in2=z2\n\tmovdqa    xmm5,xmm1\n\tpunpcklwd xmm4,xmm3\t\t; xmm3=in6=z3\n\tpunpckhwd xmm5,xmm3\n\tmovdqa    xmm1,xmm4\n\tmovdqa    xmm3,xmm5\n\tpmaddwd   xmm4,[GOTOFF(ebx,PW_F130_F054)]\t; xmm4=tmp3L\n\tpmaddwd   xmm5,[GOTOFF(ebx,PW_F130_F054)]\t; xmm5=tmp3H\n\tpmaddwd   xmm1,[GOTOFF(ebx,PW_F054_MF130)]\t; xmm1=tmp2L\n\tpmaddwd   xmm3,[GOTOFF(ebx,PW_F054_MF130)]\t; xmm3=tmp2H\n\n\tmovdqa    xmm6,xmm0\n\tpaddw     xmm0,xmm2\t\t; xmm0=in0+in4\n\tpsubw     xmm6,xmm2\t\t; xmm6=in0-in4\n\n\tpxor      xmm7,xmm7\n\tpxor      xmm2,xmm2\n\tpunpcklwd xmm7,xmm0\t\t; xmm7=tmp0L\n\tpunpckhwd xmm2,xmm0\t\t; xmm2=tmp0H\n\tpsrad     xmm7,(16-CONST_BITS)\t; psrad xmm7,16 & pslld xmm7,CONST_BITS\n\tpsrad     xmm2,(16-CONST_BITS)\t; psrad xmm2,16 & pslld xmm2,CONST_BITS\n\n\tmovdqa\txmm0,xmm7\n\tpaddd\txmm7,xmm4\t\t; xmm7=tmp10L\n\tpsubd\txmm0,xmm4\t\t; xmm0=tmp13L\n\tmovdqa\txmm4,xmm2\n\tpaddd\txmm2,xmm5\t\t; xmm2=tmp10H\n\tpsubd\txmm4,xmm5\t\t; xmm4=tmp13H\n\n\tmovdqa\tXMMWORD [wk(0)], xmm7\t; wk(0)=tmp10L\n\tmovdqa\tXMMWORD [wk(1)], xmm2\t; wk(1)=tmp10H\n\tmovdqa\tXMMWORD [wk(2)], xmm0\t; wk(2)=tmp13L\n\tmovdqa\tXMMWORD [wk(3)], xmm4\t; wk(3)=tmp13H\n\n\tpxor      xmm5,xmm5\n\tpxor      xmm7,xmm7\n\tpunpcklwd xmm5,xmm6\t\t; xmm5=tmp1L\n\tpunpckhwd xmm7,xmm6\t\t; xmm7=tmp1H\n\tpsrad     xmm5,(16-CONST_BITS)\t; psrad xmm5,16 & pslld xmm5,CONST_BITS\n\tpsrad     xmm7,(16-CONST_BITS)\t; psrad xmm7,16 & pslld xmm7,CONST_BITS\n\n\tmovdqa\txmm2,xmm5\n\tpaddd\txmm5,xmm1\t\t; xmm5=tmp11L\n\tpsubd\txmm2,xmm1\t\t; xmm2=tmp12L\n\tmovdqa\txmm0,xmm7\n\tpaddd\txmm7,xmm3\t\t; xmm7=tmp11H\n\tpsubd\txmm0,xmm3\t\t; xmm0=tmp12H\n\n\tmovdqa\tXMMWORD [wk(4)], xmm5\t; wk(4)=tmp11L\n\tmovdqa\tXMMWORD [wk(5)], xmm7\t; wk(5)=tmp11H\n\tmovdqa\tXMMWORD [wk(6)], xmm2\t; wk(6)=tmp12L\n\tmovdqa\tXMMWORD [wk(7)], xmm0\t; wk(7)=tmp12H\n\n\t; -- Odd part\n\n\tmovdqa\txmm4, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tmovdqa\txmm6, XMMWORD [XMMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tpmullw\txmm4, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\txmm6, XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tmovdqa\txmm3, XMMWORD [XMMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\tpmullw\txmm1, XMMWORD [XMMBLOCK(5,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\txmm3, XMMWORD [XMMBLOCK(7,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\tmovdqa\txmm5,xmm6\n\tmovdqa\txmm7,xmm4\n\tpaddw\txmm5,xmm3\t\t; xmm5=z3\n\tpaddw\txmm7,xmm1\t\t; xmm7=z4\n\n\t; (Original)\n\t; z5 = (z3 + z4) * 1.175875602;\n\t; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n\t; z3 += z5;  z4 += z5;\n\t;\n\t; (This implementation)\n\t; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n\t; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n\tmovdqa    xmm2,xmm5\n\tmovdqa    xmm0,xmm5\n\tpunpcklwd xmm2,xmm7\n\tpunpckhwd xmm0,xmm7\n\tmovdqa    xmm5,xmm2\n\tmovdqa    xmm7,xmm0\n\tpmaddwd   xmm2,[GOTOFF(ebx,PW_MF078_F117)]\t; xmm2=z3L\n\tpmaddwd   xmm0,[GOTOFF(ebx,PW_MF078_F117)]\t; xmm0=z3H\n\tpmaddwd   xmm5,[GOTOFF(ebx,PW_F117_F078)]\t; xmm5=z4L\n\tpmaddwd   xmm7,[GOTOFF(ebx,PW_F117_F078)]\t; xmm7=z4H\n\n\tmovdqa\tXMMWORD [wk(10)], xmm2\t; wk(10)=z3L\n\tmovdqa\tXMMWORD [wk(11)], xmm0\t; wk(11)=z3H\n\n\t; (Original)\n\t; z1 = tmp0 + tmp3;  z2 = tmp1 + tmp2;\n\t; tmp0 = tmp0 * 0.298631336;  tmp1 = tmp1 * 2.053119869;\n\t; tmp2 = tmp2 * 3.072711026;  tmp3 = tmp3 * 1.501321110;\n\t; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n\t; tmp0 += z1 + z3;  tmp1 += z2 + z4;\n\t; tmp2 += z2 + z3;  tmp3 += z1 + z4;\n\t;\n\t; (This implementation)\n\t; tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223;\n\t; tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447;\n\t; tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447);\n\t; tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223);\n\t; tmp0 += z3;  tmp1 += z4;\n\t; tmp2 += z3;  tmp3 += z4;\n\n\tmovdqa    xmm2,xmm3\n\tmovdqa    xmm0,xmm3\n\tpunpcklwd xmm2,xmm4\n\tpunpckhwd xmm0,xmm4\n\tmovdqa    xmm3,xmm2\n\tmovdqa    xmm4,xmm0\n\tpmaddwd   xmm2,[GOTOFF(ebx,PW_MF060_MF089)]\t; xmm2=tmp0L\n\tpmaddwd   xmm0,[GOTOFF(ebx,PW_MF060_MF089)]\t; xmm0=tmp0H\n\tpmaddwd   xmm3,[GOTOFF(ebx,PW_MF089_F060)]\t; xmm3=tmp3L\n\tpmaddwd   xmm4,[GOTOFF(ebx,PW_MF089_F060)]\t; xmm4=tmp3H\n\n\tpaddd\txmm2, XMMWORD [wk(10)]\t; xmm2=tmp0L\n\tpaddd\txmm0, XMMWORD [wk(11)]\t; xmm0=tmp0H\n\tpaddd\txmm3,xmm5\t\t; xmm3=tmp3L\n\tpaddd\txmm4,xmm7\t\t; xmm4=tmp3H\n\n\tmovdqa\tXMMWORD [wk(8)], xmm2\t; wk(8)=tmp0L\n\tmovdqa\tXMMWORD [wk(9)], xmm0\t; wk(9)=tmp0H\n\n\tmovdqa    xmm2,xmm1\n\tmovdqa    xmm0,xmm1\n\tpunpcklwd xmm2,xmm6\n\tpunpckhwd xmm0,xmm6\n\tmovdqa    xmm1,xmm2\n\tmovdqa    xmm6,xmm0\n\tpmaddwd   xmm2,[GOTOFF(ebx,PW_MF050_MF256)]\t; xmm2=tmp1L\n\tpmaddwd   xmm0,[GOTOFF(ebx,PW_MF050_MF256)]\t; xmm0=tmp1H\n\tpmaddwd   xmm1,[GOTOFF(ebx,PW_MF256_F050)]\t; xmm1=tmp2L\n\tpmaddwd   xmm6,[GOTOFF(ebx,PW_MF256_F050)]\t; xmm6=tmp2H\n\n\tpaddd\txmm2,xmm5\t\t; xmm2=tmp1L\n\tpaddd\txmm0,xmm7\t\t; xmm0=tmp1H\n\tpaddd\txmm1, XMMWORD [wk(10)]\t; xmm1=tmp2L\n\tpaddd\txmm6, XMMWORD [wk(11)]\t; xmm6=tmp2H\n\n\tmovdqa\tXMMWORD [wk(10)], xmm2\t; wk(10)=tmp1L\n\tmovdqa\tXMMWORD [wk(11)], xmm0\t; wk(11)=tmp1H\n\n\t; -- Final output stage\n\n\tmovdqa\txmm5, XMMWORD [wk(0)]\t; xmm5=tmp10L\n\tmovdqa\txmm7, XMMWORD [wk(1)]\t; xmm7=tmp10H\n\n\tmovdqa\txmm2,xmm5\n\tmovdqa\txmm0,xmm7\n\tpaddd\txmm5,xmm3\t\t; xmm5=data0L\n\tpaddd\txmm7,xmm4\t\t; xmm7=data0H\n\tpsubd\txmm2,xmm3\t\t; xmm2=data7L\n\tpsubd\txmm0,xmm4\t\t; xmm0=data7H\n\n\tmovdqa\txmm3,[GOTOFF(ebx,PD_DESCALE_P1)]\t; xmm3=[PD_DESCALE_P1]\n\n\tpaddd\txmm5,xmm3\n\tpaddd\txmm7,xmm3\n\tpsrad\txmm5,DESCALE_P1\n\tpsrad\txmm7,DESCALE_P1\n\tpaddd\txmm2,xmm3\n\tpaddd\txmm0,xmm3\n\tpsrad\txmm2,DESCALE_P1\n\tpsrad\txmm0,DESCALE_P1\n\n\tpackssdw  xmm5,xmm7\t\t; xmm5=data0=(00 01 02 03 04 05 06 07)\n\tpackssdw  xmm2,xmm0\t\t; xmm2=data7=(70 71 72 73 74 75 76 77)\n\n\tmovdqa\txmm4, XMMWORD [wk(4)]\t; xmm4=tmp11L\n\tmovdqa\txmm3, XMMWORD [wk(5)]\t; xmm3=tmp11H\n\n\tmovdqa\txmm7,xmm4\n\tmovdqa\txmm0,xmm3\n\tpaddd\txmm4,xmm1\t\t; xmm4=data1L\n\tpaddd\txmm3,xmm6\t\t; xmm3=data1H\n\tpsubd\txmm7,xmm1\t\t; xmm7=data6L\n\tpsubd\txmm0,xmm6\t\t; xmm0=data6H\n\n\tmovdqa\txmm1,[GOTOFF(ebx,PD_DESCALE_P1)]\t; xmm1=[PD_DESCALE_P1]\n\n\tpaddd\txmm4,xmm1\n\tpaddd\txmm3,xmm1\n\tpsrad\txmm4,DESCALE_P1\n\tpsrad\txmm3,DESCALE_P1\n\tpaddd\txmm7,xmm1\n\tpaddd\txmm0,xmm1\n\tpsrad\txmm7,DESCALE_P1\n\tpsrad\txmm0,DESCALE_P1\n\n\tpackssdw  xmm4,xmm3\t\t; xmm4=data1=(10 11 12 13 14 15 16 17)\n\tpackssdw  xmm7,xmm0\t\t; xmm7=data6=(60 61 62 63 64 65 66 67)\n\n\tmovdqa    xmm6,xmm5\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm5,xmm4\t\t; xmm5=(00 10 01 11 02 12 03 13)\n\tpunpckhwd xmm6,xmm4\t\t; xmm6=(04 14 05 15 06 16 07 17)\n\tmovdqa    xmm1,xmm7\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm7,xmm2\t\t; xmm7=(60 70 61 71 62 72 63 73)\n\tpunpckhwd xmm1,xmm2\t\t; xmm1=(64 74 65 75 66 76 67 77)\n\n\tmovdqa\txmm3, XMMWORD [wk(6)]\t; xmm3=tmp12L\n\tmovdqa\txmm0, XMMWORD [wk(7)]\t; xmm0=tmp12H\n\tmovdqa\txmm4, XMMWORD [wk(10)]\t; xmm4=tmp1L\n\tmovdqa\txmm2, XMMWORD [wk(11)]\t; xmm2=tmp1H\n\n\tmovdqa\tXMMWORD [wk(0)], xmm5\t; wk(0)=(00 10 01 11 02 12 03 13)\n\tmovdqa\tXMMWORD [wk(1)], xmm6\t; wk(1)=(04 14 05 15 06 16 07 17)\n\tmovdqa\tXMMWORD [wk(4)], xmm7\t; wk(4)=(60 70 61 71 62 72 63 73)\n\tmovdqa\tXMMWORD [wk(5)], xmm1\t; wk(5)=(64 74 65 75 66 76 67 77)\n\n\tmovdqa\txmm5,xmm3\n\tmovdqa\txmm6,xmm0\n\tpaddd\txmm3,xmm4\t\t; xmm3=data2L\n\tpaddd\txmm0,xmm2\t\t; xmm0=data2H\n\tpsubd\txmm5,xmm4\t\t; xmm5=data5L\n\tpsubd\txmm6,xmm2\t\t; xmm6=data5H\n\n\tmovdqa\txmm7,[GOTOFF(ebx,PD_DESCALE_P1)]\t; xmm7=[PD_DESCALE_P1]\n\n\tpaddd\txmm3,xmm7\n\tpaddd\txmm0,xmm7\n\tpsrad\txmm3,DESCALE_P1\n\tpsrad\txmm0,DESCALE_P1\n\tpaddd\txmm5,xmm7\n\tpaddd\txmm6,xmm7\n\tpsrad\txmm5,DESCALE_P1\n\tpsrad\txmm6,DESCALE_P1\n\n\tpackssdw  xmm3,xmm0\t\t; xmm3=data2=(20 21 22 23 24 25 26 27)\n\tpackssdw  xmm5,xmm6\t\t; xmm5=data5=(50 51 52 53 54 55 56 57)\n\n\tmovdqa\txmm1, XMMWORD [wk(2)]\t; xmm1=tmp13L\n\tmovdqa\txmm4, XMMWORD [wk(3)]\t; xmm4=tmp13H\n\tmovdqa\txmm2, XMMWORD [wk(8)]\t; xmm2=tmp0L\n\tmovdqa\txmm7, XMMWORD [wk(9)]\t; xmm7=tmp0H\n\n\tmovdqa\txmm0,xmm1\n\tmovdqa\txmm6,xmm4\n\tpaddd\txmm1,xmm2\t\t; xmm1=data3L\n\tpaddd\txmm4,xmm7\t\t; xmm4=data3H\n\tpsubd\txmm0,xmm2\t\t; xmm0=data4L\n\tpsubd\txmm6,xmm7\t\t; xmm6=data4H\n\n\tmovdqa\txmm2,[GOTOFF(ebx,PD_DESCALE_P1)]\t; xmm2=[PD_DESCALE_P1]\n\n\tpaddd\txmm1,xmm2\n\tpaddd\txmm4,xmm2\n\tpsrad\txmm1,DESCALE_P1\n\tpsrad\txmm4,DESCALE_P1\n\tpaddd\txmm0,xmm2\n\tpaddd\txmm6,xmm2\n\tpsrad\txmm0,DESCALE_P1\n\tpsrad\txmm6,DESCALE_P1\n\n\tpackssdw  xmm1,xmm4\t\t; xmm1=data3=(30 31 32 33 34 35 36 37)\n\tpackssdw  xmm0,xmm6\t\t; xmm0=data4=(40 41 42 43 44 45 46 47)\n\n\tmovdqa\txmm7, XMMWORD [wk(0)]\t; xmm7=(00 10 01 11 02 12 03 13)\n\tmovdqa\txmm2, XMMWORD [wk(1)]\t; xmm2=(04 14 05 15 06 16 07 17)\n\n\tmovdqa    xmm4,xmm3\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm3,xmm1\t\t; xmm3=(20 30 21 31 22 32 23 33)\n\tpunpckhwd xmm4,xmm1\t\t; xmm4=(24 34 25 35 26 36 27 37)\n\tmovdqa    xmm6,xmm0\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm0,xmm5\t\t; xmm0=(40 50 41 51 42 52 43 53)\n\tpunpckhwd xmm6,xmm5\t\t; xmm6=(44 54 45 55 46 56 47 57)\n\n\tmovdqa    xmm1,xmm7\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm7,xmm3\t\t; xmm7=(00 10 20 30 01 11 21 31)\n\tpunpckhdq xmm1,xmm3\t\t; xmm1=(02 12 22 32 03 13 23 33)\n\tmovdqa    xmm5,xmm2\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm2,xmm4\t\t; xmm2=(04 14 24 34 05 15 25 35)\n\tpunpckhdq xmm5,xmm4\t\t; xmm5=(06 16 26 36 07 17 27 37)\n\n\tmovdqa\txmm3, XMMWORD [wk(4)]\t; xmm3=(60 70 61 71 62 72 63 73)\n\tmovdqa\txmm4, XMMWORD [wk(5)]\t; xmm4=(64 74 65 75 66 76 67 77)\n\n\tmovdqa\tXMMWORD [wk(6)], xmm2\t; wk(6)=(04 14 24 34 05 15 25 35)\n\tmovdqa\tXMMWORD [wk(7)], xmm5\t; wk(7)=(06 16 26 36 07 17 27 37)\n\n\tmovdqa    xmm2,xmm0\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm0,xmm3\t\t; xmm0=(40 50 60 70 41 51 61 71)\n\tpunpckhdq xmm2,xmm3\t\t; xmm2=(42 52 62 72 43 53 63 73)\n\tmovdqa    xmm5,xmm6\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm6,xmm4\t\t; xmm6=(44 54 64 74 45 55 65 75)\n\tpunpckhdq xmm5,xmm4\t\t; xmm5=(46 56 66 76 47 57 67 77)\n\n\tmovdqa     xmm3,xmm7\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm7,xmm0\t\t; xmm7=col0=(00 10 20 30 40 50 60 70)\n\tpunpckhqdq xmm3,xmm0\t\t; xmm3=col1=(01 11 21 31 41 51 61 71)\n\tmovdqa     xmm4,xmm1\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm1,xmm2\t\t; xmm1=col2=(02 12 22 32 42 52 62 72)\n\tpunpckhqdq xmm4,xmm2\t\t; xmm4=col3=(03 13 23 33 43 53 63 73)\n\n\tmovdqa\txmm0, XMMWORD [wk(6)]\t; xmm0=(04 14 24 34 05 15 25 35)\n\tmovdqa\txmm2, XMMWORD [wk(7)]\t; xmm2=(06 16 26 36 07 17 27 37)\n\n\tmovdqa\tXMMWORD [wk(8)], xmm3\t; wk(8)=col1\n\tmovdqa\tXMMWORD [wk(9)], xmm4\t; wk(9)=col3\n\n\tmovdqa     xmm3,xmm0\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm0,xmm6\t\t; xmm0=col4=(04 14 24 34 44 54 64 74)\n\tpunpckhqdq xmm3,xmm6\t\t; xmm3=col5=(05 15 25 35 45 55 65 75)\n\tmovdqa     xmm4,xmm2\t\t; transpose coefficients(phase 3)\n\tpunpcklqdq xmm2,xmm5\t\t; xmm2=col6=(06 16 26 36 46 56 66 76)\n\tpunpckhqdq xmm4,xmm5\t\t; xmm4=col7=(07 17 27 37 47 57 67 77)\n\n\tmovdqa\tXMMWORD [wk(10)], xmm3\t; wk(10)=col5\n\tmovdqa\tXMMWORD [wk(11)], xmm4\t; wk(11)=col7\n.column_end:\n\n\t; -- Prefetch the next coefficient block\n\n\tprefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 0*32]\n\tprefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 1*32]\n\tprefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 2*32]\n\tprefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 3*32]\n\n\t; ---- Pass 2: process rows from work array, store into output array.\n\n\tmov\teax, [original_ebp]\n\tmov\tedi, JSAMPARRAY [output_buf(eax)]\t; (JSAMPROW *)\n\tmov\teax, JDIMENSION [output_col(eax)]\n\n\t; -- Even part\n\n\t; xmm7=col0, xmm1=col2, xmm0=col4, xmm2=col6\n\n\t; (Original)\n\t; z1 = (z2 + z3) * 0.541196100;\n\t; tmp2 = z1 + z3 * -1.847759065;\n\t; tmp3 = z1 + z2 * 0.765366865;\n\t;\n\t; (This implementation)\n\t; tmp2 = z2 * 0.541196100 + z3 * (0.541196100 - 1.847759065);\n\t; tmp3 = z2 * (0.541196100 + 0.765366865) + z3 * 0.541196100;\n\n\tmovdqa    xmm6,xmm1\t\t; xmm1=in2=z2\n\tmovdqa    xmm5,xmm1\n\tpunpcklwd xmm6,xmm2\t\t; xmm2=in6=z3\n\tpunpckhwd xmm5,xmm2\n\tmovdqa    xmm1,xmm6\n\tmovdqa    xmm2,xmm5\n\tpmaddwd   xmm6,[GOTOFF(ebx,PW_F130_F054)]\t; xmm6=tmp3L\n\tpmaddwd   xmm5,[GOTOFF(ebx,PW_F130_F054)]\t; xmm5=tmp3H\n\tpmaddwd   xmm1,[GOTOFF(ebx,PW_F054_MF130)]\t; xmm1=tmp2L\n\tpmaddwd   xmm2,[GOTOFF(ebx,PW_F054_MF130)]\t; xmm2=tmp2H\n\n\tmovdqa    xmm3,xmm7\n\tpaddw     xmm7,xmm0\t\t; xmm7=in0+in4\n\tpsubw     xmm3,xmm0\t\t; xmm3=in0-in4\n\n\tpxor      xmm4,xmm4\n\tpxor      xmm0,xmm0\n\tpunpcklwd xmm4,xmm7\t\t; xmm4=tmp0L\n\tpunpckhwd xmm0,xmm7\t\t; xmm0=tmp0H\n\tpsrad     xmm4,(16-CONST_BITS)\t; psrad xmm4,16 & pslld xmm4,CONST_BITS\n\tpsrad     xmm0,(16-CONST_BITS)\t; psrad xmm0,16 & pslld xmm0,CONST_BITS\n\n\tmovdqa\txmm7,xmm4\n\tpaddd\txmm4,xmm6\t\t; xmm4=tmp10L\n\tpsubd\txmm7,xmm6\t\t; xmm7=tmp13L\n\tmovdqa\txmm6,xmm0\n\tpaddd\txmm0,xmm5\t\t; xmm0=tmp10H\n\tpsubd\txmm6,xmm5\t\t; xmm6=tmp13H\n\n\tmovdqa\tXMMWORD [wk(0)], xmm4\t; wk(0)=tmp10L\n\tmovdqa\tXMMWORD [wk(1)], xmm0\t; wk(1)=tmp10H\n\tmovdqa\tXMMWORD [wk(2)], xmm7\t; wk(2)=tmp13L\n\tmovdqa\tXMMWORD [wk(3)], xmm6\t; wk(3)=tmp13H\n\n\tpxor      xmm5,xmm5\n\tpxor      xmm4,xmm4\n\tpunpcklwd xmm5,xmm3\t\t; xmm5=tmp1L\n\tpunpckhwd xmm4,xmm3\t\t; xmm4=tmp1H\n\tpsrad     xmm5,(16-CONST_BITS)\t; psrad xmm5,16 & pslld xmm5,CONST_BITS\n\tpsrad     xmm4,(16-CONST_BITS)\t; psrad xmm4,16 & pslld xmm4,CONST_BITS\n\n\tmovdqa\txmm0,xmm5\n\tpaddd\txmm5,xmm1\t\t; xmm5=tmp11L\n\tpsubd\txmm0,xmm1\t\t; xmm0=tmp12L\n\tmovdqa\txmm7,xmm4\n\tpaddd\txmm4,xmm2\t\t; xmm4=tmp11H\n\tpsubd\txmm7,xmm2\t\t; xmm7=tmp12H\n\n\tmovdqa\tXMMWORD [wk(4)], xmm5\t; wk(4)=tmp11L\n\tmovdqa\tXMMWORD [wk(5)], xmm4\t; wk(5)=tmp11H\n\tmovdqa\tXMMWORD [wk(6)], xmm0\t; wk(6)=tmp12L\n\tmovdqa\tXMMWORD [wk(7)], xmm7\t; wk(7)=tmp12H\n\n\t; -- Odd part\n\n\tmovdqa\txmm6, XMMWORD [wk(9)]\t; xmm6=col3\n\tmovdqa\txmm3, XMMWORD [wk(8)]\t; xmm3=col1\n\tmovdqa\txmm1, XMMWORD [wk(11)]\t; xmm1=col7\n\tmovdqa\txmm2, XMMWORD [wk(10)]\t; xmm2=col5\n\n\tmovdqa\txmm5,xmm6\n\tmovdqa\txmm4,xmm3\n\tpaddw\txmm5,xmm1\t\t; xmm5=z3\n\tpaddw\txmm4,xmm2\t\t; xmm4=z4\n\n\t; (Original)\n\t; z5 = (z3 + z4) * 1.175875602;\n\t; z3 = z3 * -1.961570560;  z4 = z4 * -0.390180644;\n\t; z3 += z5;  z4 += z5;\n\t;\n\t; (This implementation)\n\t; z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;\n\t; z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);\n\n\tmovdqa    xmm0,xmm5\n\tmovdqa    xmm7,xmm5\n\tpunpcklwd xmm0,xmm4\n\tpunpckhwd xmm7,xmm4\n\tmovdqa    xmm5,xmm0\n\tmovdqa    xmm4,xmm7\n\tpmaddwd   xmm0,[GOTOFF(ebx,PW_MF078_F117)]\t; xmm0=z3L\n\tpmaddwd   xmm7,[GOTOFF(ebx,PW_MF078_F117)]\t; xmm7=z3H\n\tpmaddwd   xmm5,[GOTOFF(ebx,PW_F117_F078)]\t; xmm5=z4L\n\tpmaddwd   xmm4,[GOTOFF(ebx,PW_F117_F078)]\t; xmm4=z4H\n\n\tmovdqa\tXMMWORD [wk(10)], xmm0\t; wk(10)=z3L\n\tmovdqa\tXMMWORD [wk(11)], xmm7\t; wk(11)=z3H\n\n\t; (Original)\n\t; z1 = tmp0 + tmp3;  z2 = tmp1 + tmp2;\n\t; tmp0 = tmp0 * 0.298631336;  tmp1 = tmp1 * 2.053119869;\n\t; tmp2 = tmp2 * 3.072711026;  tmp3 = tmp3 * 1.501321110;\n\t; z1 = z1 * -0.899976223;  z2 = z2 * -2.562915447;\n\t; tmp0 += z1 + z3;  tmp1 += z2 + z4;\n\t; tmp2 += z2 + z3;  tmp3 += z1 + z4;\n\t;\n\t; (This implementation)\n\t; tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223;\n\t; tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447;\n\t; tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447);\n\t; tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223);\n\t; tmp0 += z3;  tmp1 += z4;\n\t; tmp2 += z3;  tmp3 += z4;\n\n\tmovdqa    xmm0,xmm1\n\tmovdqa    xmm7,xmm1\n\tpunpcklwd xmm0,xmm3\n\tpunpckhwd xmm7,xmm3\n\tmovdqa    xmm1,xmm0\n\tmovdqa    xmm3,xmm7\n\tpmaddwd   xmm0,[GOTOFF(ebx,PW_MF060_MF089)]\t; xmm0=tmp0L\n\tpmaddwd   xmm7,[GOTOFF(ebx,PW_MF060_MF089)]\t; xmm7=tmp0H\n\tpmaddwd   xmm1,[GOTOFF(ebx,PW_MF089_F060)]\t; xmm1=tmp3L\n\tpmaddwd   xmm3,[GOTOFF(ebx,PW_MF089_F060)]\t; xmm3=tmp3H\n\n\tpaddd\txmm0, XMMWORD [wk(10)]\t; xmm0=tmp0L\n\tpaddd\txmm7, XMMWORD [wk(11)]\t; xmm7=tmp0H\n\tpaddd\txmm1,xmm5\t\t; xmm1=tmp3L\n\tpaddd\txmm3,xmm4\t\t; xmm3=tmp3H\n\n\tmovdqa\tXMMWORD [wk(8)], xmm0\t; wk(8)=tmp0L\n\tmovdqa\tXMMWORD [wk(9)], xmm7\t; wk(9)=tmp0H\n\n\tmovdqa    xmm0,xmm2\n\tmovdqa    xmm7,xmm2\n\tpunpcklwd xmm0,xmm6\n\tpunpckhwd xmm7,xmm6\n\tmovdqa    xmm2,xmm0\n\tmovdqa    xmm6,xmm7\n\tpmaddwd   xmm0,[GOTOFF(ebx,PW_MF050_MF256)]\t; xmm0=tmp1L\n\tpmaddwd   xmm7,[GOTOFF(ebx,PW_MF050_MF256)]\t; xmm7=tmp1H\n\tpmaddwd   xmm2,[GOTOFF(ebx,PW_MF256_F050)]\t; xmm2=tmp2L\n\tpmaddwd   xmm6,[GOTOFF(ebx,PW_MF256_F050)]\t; xmm6=tmp2H\n\n\tpaddd\txmm0,xmm5\t\t; xmm0=tmp1L\n\tpaddd\txmm7,xmm4\t\t; xmm7=tmp1H\n\tpaddd\txmm2, XMMWORD [wk(10)]\t; xmm2=tmp2L\n\tpaddd\txmm6, XMMWORD [wk(11)]\t; xmm6=tmp2H\n\n\tmovdqa\tXMMWORD [wk(10)], xmm0\t; wk(10)=tmp1L\n\tmovdqa\tXMMWORD [wk(11)], xmm7\t; wk(11)=tmp1H\n\n\t; -- Final output stage\n\n\tmovdqa\txmm5, XMMWORD [wk(0)]\t; xmm5=tmp10L\n\tmovdqa\txmm4, XMMWORD [wk(1)]\t; xmm4=tmp10H\n\n\tmovdqa\txmm0,xmm5\n\tmovdqa\txmm7,xmm4\n\tpaddd\txmm5,xmm1\t\t; xmm5=data0L\n\tpaddd\txmm4,xmm3\t\t; xmm4=data0H\n\tpsubd\txmm0,xmm1\t\t; xmm0=data7L\n\tpsubd\txmm7,xmm3\t\t; xmm7=data7H\n\n\tmovdqa\txmm1,[GOTOFF(ebx,PD_DESCALE_P2)]\t; xmm1=[PD_DESCALE_P2]\n\n\tpaddd\txmm5,xmm1\n\tpaddd\txmm4,xmm1\n\tpsrad\txmm5,DESCALE_P2\n\tpsrad\txmm4,DESCALE_P2\n\tpaddd\txmm0,xmm1\n\tpaddd\txmm7,xmm1\n\tpsrad\txmm0,DESCALE_P2\n\tpsrad\txmm7,DESCALE_P2\n\n\tpackssdw  xmm5,xmm4\t\t; xmm5=data0=(00 10 20 30 40 50 60 70)\n\tpackssdw  xmm0,xmm7\t\t; xmm0=data7=(07 17 27 37 47 57 67 77)\n\n\tmovdqa\txmm3, XMMWORD [wk(4)]\t; xmm3=tmp11L\n\tmovdqa\txmm1, XMMWORD [wk(5)]\t; xmm1=tmp11H\n\n\tmovdqa\txmm4,xmm3\n\tmovdqa\txmm7,xmm1\n\tpaddd\txmm3,xmm2\t\t; xmm3=data1L\n\tpaddd\txmm1,xmm6\t\t; xmm1=data1H\n\tpsubd\txmm4,xmm2\t\t; xmm4=data6L\n\tpsubd\txmm7,xmm6\t\t; xmm7=data6H\n\n\tmovdqa\txmm2,[GOTOFF(ebx,PD_DESCALE_P2)]\t; xmm2=[PD_DESCALE_P2]\n\n\tpaddd\txmm3,xmm2\n\tpaddd\txmm1,xmm2\n\tpsrad\txmm3,DESCALE_P2\n\tpsrad\txmm1,DESCALE_P2\n\tpaddd\txmm4,xmm2\n\tpaddd\txmm7,xmm2\n\tpsrad\txmm4,DESCALE_P2\n\tpsrad\txmm7,DESCALE_P2\n\n\tpackssdw  xmm3,xmm1\t\t; xmm3=data1=(01 11 21 31 41 51 61 71)\n\tpackssdw  xmm4,xmm7\t\t; xmm4=data6=(06 16 26 36 46 56 66 76)\n\n\tpacksswb  xmm5,xmm4\t\t; xmm5=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76)\n\tpacksswb  xmm3,xmm0\t\t; xmm3=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77)\n\n\tmovdqa\txmm6, XMMWORD [wk(6)]\t; xmm6=tmp12L\n\tmovdqa\txmm2, XMMWORD [wk(7)]\t; xmm2=tmp12H\n\tmovdqa\txmm1, XMMWORD [wk(10)]\t; xmm1=tmp1L\n\tmovdqa\txmm7, XMMWORD [wk(11)]\t; xmm7=tmp1H\n\n\tmovdqa\tXMMWORD [wk(0)], xmm5\t; wk(0)=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76)\n\tmovdqa\tXMMWORD [wk(1)], xmm3\t; wk(1)=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77)\n\n\tmovdqa\txmm4,xmm6\n\tmovdqa\txmm0,xmm2\n\tpaddd\txmm6,xmm1\t\t; xmm6=data2L\n\tpaddd\txmm2,xmm7\t\t; xmm2=data2H\n\tpsubd\txmm4,xmm1\t\t; xmm4=data5L\n\tpsubd\txmm0,xmm7\t\t; xmm0=data5H\n\n\tmovdqa\txmm5,[GOTOFF(ebx,PD_DESCALE_P2)]\t; xmm5=[PD_DESCALE_P2]\n\n\tpaddd\txmm6,xmm5\n\tpaddd\txmm2,xmm5\n\tpsrad\txmm6,DESCALE_P2\n\tpsrad\txmm2,DESCALE_P2\n\tpaddd\txmm4,xmm5\n\tpaddd\txmm0,xmm5\n\tpsrad\txmm4,DESCALE_P2\n\tpsrad\txmm0,DESCALE_P2\n\n\tpackssdw  xmm6,xmm2\t\t; xmm6=data2=(02 12 22 32 42 52 62 72)\n\tpackssdw  xmm4,xmm0\t\t; xmm4=data5=(05 15 25 35 45 55 65 75)\n\n\tmovdqa\txmm3, XMMWORD [wk(2)]\t; xmm3=tmp13L\n\tmovdqa\txmm1, XMMWORD [wk(3)]\t; xmm1=tmp13H\n\tmovdqa\txmm7, XMMWORD [wk(8)]\t; xmm7=tmp0L\n\tmovdqa\txmm5, XMMWORD [wk(9)]\t; xmm5=tmp0H\n\n\tmovdqa\txmm2,xmm3\n\tmovdqa\txmm0,xmm1\n\tpaddd\txmm3,xmm7\t\t; xmm3=data3L\n\tpaddd\txmm1,xmm5\t\t; xmm1=data3H\n\tpsubd\txmm2,xmm7\t\t; xmm2=data4L\n\tpsubd\txmm0,xmm5\t\t; xmm0=data4H\n\n\tmovdqa\txmm7,[GOTOFF(ebx,PD_DESCALE_P2)]\t; xmm7=[PD_DESCALE_P2]\n\n\tpaddd\txmm3,xmm7\n\tpaddd\txmm1,xmm7\n\tpsrad\txmm3,DESCALE_P2\n\tpsrad\txmm1,DESCALE_P2\n\tpaddd\txmm2,xmm7\n\tpaddd\txmm0,xmm7\n\tpsrad\txmm2,DESCALE_P2\n\tpsrad\txmm0,DESCALE_P2\n\n\tmovdqa    xmm5,[GOTOFF(ebx,PB_CENTERJSAMP)]\t; xmm5=[PB_CENTERJSAMP]\n\n\tpackssdw  xmm3,xmm1\t\t; xmm3=data3=(03 13 23 33 43 53 63 73)\n\tpackssdw  xmm2,xmm0\t\t; xmm2=data4=(04 14 24 34 44 54 64 74)\n\n\tmovdqa    xmm7, XMMWORD [wk(0)]\t; xmm7=(00 10 20 30 40 50 60 70 06 16 26 36 46 56 66 76)\n\tmovdqa    xmm1, XMMWORD [wk(1)]\t; xmm1=(01 11 21 31 41 51 61 71 07 17 27 37 47 57 67 77)\n\n\tpacksswb  xmm6,xmm2\t\t; xmm6=(02 12 22 32 42 52 62 72 04 14 24 34 44 54 64 74)\n\tpacksswb  xmm3,xmm4\t\t; xmm3=(03 13 23 33 43 53 63 73 05 15 25 35 45 55 65 75)\n\n\tpaddb     xmm7,xmm5\n\tpaddb     xmm1,xmm5\n\tpaddb     xmm6,xmm5\n\tpaddb     xmm3,xmm5\n\n\tmovdqa    xmm0,xmm7\t; transpose coefficients(phase 1)\n\tpunpcklbw xmm7,xmm1\t; xmm7=(00 01 10 11 20 21 30 31 40 41 50 51 60 61 70 71)\n\tpunpckhbw xmm0,xmm1\t; xmm0=(06 07 16 17 26 27 36 37 46 47 56 57 66 67 76 77)\n\tmovdqa    xmm2,xmm6\t; transpose coefficients(phase 1)\n\tpunpcklbw xmm6,xmm3\t; xmm6=(02 03 12 13 22 23 32 33 42 43 52 53 62 63 72 73)\n\tpunpckhbw xmm2,xmm3\t; xmm2=(04 05 14 15 24 25 34 35 44 45 54 55 64 65 74 75)\n\n\tmovdqa    xmm4,xmm7\t; transpose coefficients(phase 2)\n\tpunpcklwd xmm7,xmm6\t; xmm7=(00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33)\n\tpunpckhwd xmm4,xmm6\t; xmm4=(40 41 42 43 50 51 52 53 60 61 62 63 70 71 72 73)\n\tmovdqa    xmm5,xmm2\t; transpose coefficients(phase 2)\n\tpunpcklwd xmm2,xmm0\t; xmm2=(04 05 06 07 14 15 16 17 24 25 26 27 34 35 36 37)\n\tpunpckhwd xmm5,xmm0\t; xmm5=(44 45 46 47 54 55 56 57 64 65 66 67 74 75 76 77)\n\n\tmovdqa    xmm1,xmm7\t; transpose coefficients(phase 3)\n\tpunpckldq xmm7,xmm2\t; xmm7=(00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17)\n\tpunpckhdq xmm1,xmm2\t; xmm1=(20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37)\n\tmovdqa    xmm3,xmm4\t; transpose coefficients(phase 3)\n\tpunpckldq xmm4,xmm5\t; xmm4=(40 41 42 43 44 45 46 47 50 51 52 53 54 55 56 57)\n\tpunpckhdq xmm3,xmm5\t; xmm3=(60 61 62 63 64 65 66 67 70 71 72 73 74 75 76 77)\n\n\tpshufd\txmm6,xmm7,0x4E\t; xmm6=(10 11 12 13 14 15 16 17 00 01 02 03 04 05 06 07)\n\tpshufd\txmm0,xmm1,0x4E\t; xmm0=(30 31 32 33 34 35 36 37 20 21 22 23 24 25 26 27)\n\tpshufd\txmm2,xmm4,0x4E\t; xmm2=(50 51 52 53 54 55 56 57 40 41 42 43 44 45 46 47)\n\tpshufd\txmm5,xmm3,0x4E\t; xmm5=(70 71 72 73 74 75 76 77 60 61 62 63 64 65 66 67)\n\n\tmov\tedx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\n\tmov\tesi, JSAMPROW [edi+2*SIZEOF_JSAMPROW]\n\tmovq\tXMM_MMWORD [edx+eax*SIZEOF_JSAMPLE], xmm7\n\tmovq\tXMM_MMWORD [esi+eax*SIZEOF_JSAMPLE], xmm1\n\tmov\tedx, JSAMPROW [edi+4*SIZEOF_JSAMPROW]\n\tmov\tesi, JSAMPROW [edi+6*SIZEOF_JSAMPROW]\n\tmovq\tXMM_MMWORD [edx+eax*SIZEOF_JSAMPLE], xmm4\n\tmovq\tXMM_MMWORD [esi+eax*SIZEOF_JSAMPLE], xmm3\n\n\tmov\tedx, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\n\tmov\tesi, JSAMPROW [edi+3*SIZEOF_JSAMPROW]\n\tmovq\tXMM_MMWORD [edx+eax*SIZEOF_JSAMPLE], xmm6\n\tmovq\tXMM_MMWORD [esi+eax*SIZEOF_JSAMPLE], xmm0\n\tmov\tedx, JSAMPROW [edi+5*SIZEOF_JSAMPROW]\n\tmov\tesi, JSAMPROW [edi+7*SIZEOF_JSAMPROW]\n\tmovq\tXMM_MMWORD [edx+eax*SIZEOF_JSAMPLE], xmm2\n\tmovq\tXMM_MMWORD [esi+eax*SIZEOF_JSAMPLE], xmm5\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; unused\n\tpoppic\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jiss2red-64.asm",
    "content": ";\n; jiss2red-64.asm - reduced-size IDCT (64-bit SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2009 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains inverse-DCT routines that produce reduced-size\n; output: either 4x4 or 2x2 pixels from an 8x8 DCT block.\n; The following code is based directly on the IJG's original jidctred.c;\n; see the jidctred.c for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS\t13\n%define PASS1_BITS\t2\n\n%define DESCALE_P1_4\t(CONST_BITS-PASS1_BITS+1)\n%define DESCALE_P2_4\t(CONST_BITS+PASS1_BITS+3+1)\n%define DESCALE_P1_2\t(CONST_BITS-PASS1_BITS+2)\n%define DESCALE_P2_2\t(CONST_BITS+PASS1_BITS+3+2)\n\n%if CONST_BITS == 13\nF_0_211\tequ\t 1730\t\t; FIX(0.211164243)\nF_0_509\tequ\t 4176\t\t; FIX(0.509795579)\nF_0_601\tequ\t 4926\t\t; FIX(0.601344887)\nF_0_720\tequ\t 5906\t\t; FIX(0.720959822)\nF_0_765\tequ\t 6270\t\t; FIX(0.765366865)\nF_0_850\tequ\t 6967\t\t; FIX(0.850430095)\nF_0_899\tequ\t 7373\t\t; FIX(0.899976223)\nF_1_061\tequ\t 8697\t\t; FIX(1.061594337)\nF_1_272\tequ\t10426\t\t; FIX(1.272758580)\nF_1_451\tequ\t11893\t\t; FIX(1.451774981)\nF_1_847\tequ\t15137\t\t; FIX(1.847759065)\nF_2_172\tequ\t17799\t\t; FIX(2.172734803)\nF_2_562\tequ\t20995\t\t; FIX(2.562915447)\nF_3_624\tequ\t29692\t\t; FIX(3.624509785)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_211\tequ\tDESCALE( 226735879,30-CONST_BITS)\t; FIX(0.211164243)\nF_0_509\tequ\tDESCALE( 547388834,30-CONST_BITS)\t; FIX(0.509795579)\nF_0_601\tequ\tDESCALE( 645689155,30-CONST_BITS)\t; FIX(0.601344887)\nF_0_720\tequ\tDESCALE( 774124714,30-CONST_BITS)\t; FIX(0.720959822)\nF_0_765\tequ\tDESCALE( 821806413,30-CONST_BITS)\t; FIX(0.765366865)\nF_0_850\tequ\tDESCALE( 913142361,30-CONST_BITS)\t; FIX(0.850430095)\nF_0_899\tequ\tDESCALE( 966342111,30-CONST_BITS)\t; FIX(0.899976223)\nF_1_061\tequ\tDESCALE(1139878239,30-CONST_BITS)\t; FIX(1.061594337)\nF_1_272\tequ\tDESCALE(1366614119,30-CONST_BITS)\t; FIX(1.272758580)\nF_1_451\tequ\tDESCALE(1558831516,30-CONST_BITS)\t; FIX(1.451774981)\nF_1_847\tequ\tDESCALE(1984016188,30-CONST_BITS)\t; FIX(1.847759065)\nF_2_172\tequ\tDESCALE(2332956230,30-CONST_BITS)\t; FIX(2.172734803)\nF_2_562\tequ\tDESCALE(2751909506,30-CONST_BITS)\t; FIX(2.562915447)\nF_3_624\tequ\tDESCALE(3891787747,30-CONST_BITS)\t; FIX(3.624509785)\n%endif\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_idct_red_sse2)\n\nEXTN(jconst_idct_red_sse2):\n\nPW_F184_MF076\ttimes 4 dw  F_1_847,-F_0_765\nPW_F256_F089\ttimes 4 dw  F_2_562, F_0_899\nPW_F106_MF217\ttimes 4 dw  F_1_061,-F_2_172\nPW_MF060_MF050\ttimes 4 dw -F_0_601,-F_0_509\nPW_F145_MF021\ttimes 4 dw  F_1_451,-F_0_211\nPW_F362_MF127\ttimes 4 dw  F_3_624,-F_1_272\nPW_F085_MF072\ttimes 4 dw  F_0_850,-F_0_720\nPD_DESCALE_P1_4\ttimes 4 dd  1 << (DESCALE_P1_4-1)\nPD_DESCALE_P2_4\ttimes 4 dd  1 << (DESCALE_P2_4-1)\nPD_DESCALE_P1_2\ttimes 4 dd  1 << (DESCALE_P1_2-1)\nPD_DESCALE_P2_2\ttimes 4 dd  1 << (DESCALE_P2_2-1)\nPB_CENTERJSAMP\ttimes 16 db CENTERJSAMPLE\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t64\n;\n; Perform dequantization and inverse DCT on one block of coefficients,\n; producing a reduced-size 4x4 output block.\n;\n; GLOBAL(void)\n; jsimd_idct_4x4_sse2 (void * dct_table, JCOEFPTR coef_block,\n;                      JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n; r10 = void * dct_table\n; r11 = JCOEFPTR coef_block\n; r12 = JSAMPARRAY output_buf\n; r13 = JDIMENSION output_col\n\n%define original_rbp\trbp+0\n%define wk(i)\t\trbp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t2\n\n\talign\t16\n\tglobal\tEXTN(jsimd_idct_4x4_sse2)\n\nEXTN(jsimd_idct_4x4_sse2):\n\tpush\trbp\n\tmov\trax,rsp\t\t\t\t; rax = original rbp\n\tsub\trsp, byte 4\n\tand\trsp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[rsp],rax\n\tmov\trbp,rsp\t\t\t\t; rbp = aligned rbp\n\tlea\trsp, [wk(0)]\n\tcollect_args\n\n\t; ---- Pass 1: process columns from input.\n\n\tmov\trdx, r10\t; quantptr\n\tmov\trsi, r11\t\t; inptr\n\n%ifndef NO_ZERO_COLUMN_TEST_4X4_SSE2\n\tmov\teax, DWORD [DWBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n\tor\teax, DWORD [DWBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n\tjnz\tshort .columnDCT\n\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n\tpor\txmm0, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)]\n\tpor\txmm1, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)]\n\tpor\txmm0, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)]\n\tpor\txmm1, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)]\n\tpor\txmm0,xmm1\n\tpacksswb xmm0,xmm0\n\tpacksswb xmm0,xmm0\n\tmovd\teax,xmm0\n\ttest\trax,rax\n\tjnz\tshort .columnDCT\n\n\t; -- AC terms all zero\n\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)]\n\tpmullw\txmm0, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\tpsllw\txmm0,PASS1_BITS\n\n\tmovdqa    xmm3,xmm0\t; xmm0=in0=(00 01 02 03 04 05 06 07)\n\tpunpcklwd xmm0,xmm0\t; xmm0=(00 00 01 01 02 02 03 03)\n\tpunpckhwd xmm3,xmm3\t; xmm3=(04 04 05 05 06 06 07 07)\n\n\tpshufd\txmm1,xmm0,0x50\t; xmm1=[col0 col1]=(00 00 00 00 01 01 01 01)\n\tpshufd\txmm0,xmm0,0xFA\t; xmm0=[col2 col3]=(02 02 02 02 03 03 03 03)\n\tpshufd\txmm6,xmm3,0x50\t; xmm6=[col4 col5]=(04 04 04 04 05 05 05 05)\n\tpshufd\txmm3,xmm3,0xFA\t; xmm3=[col6 col7]=(06 06 06 06 07 07 07 07)\n\n\tjmp\tnear .column_end\n%endif\n.columnDCT:\n\n\t; -- Odd part\n\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)]\n\tpmullw\txmm0, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\txmm1, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\tmovdqa\txmm2, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)]\n\tmovdqa\txmm3, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)]\n\tpmullw\txmm2, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\txmm3, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\tmovdqa    xmm4,xmm0\n\tmovdqa    xmm5,xmm0\n\tpunpcklwd xmm4,xmm1\n\tpunpckhwd xmm5,xmm1\n\tmovdqa    xmm0,xmm4\n\tmovdqa    xmm1,xmm5\n\tpmaddwd   xmm4,[rel PW_F256_F089]\t; xmm4=(tmp2L)\n\tpmaddwd   xmm5,[rel PW_F256_F089]\t; xmm5=(tmp2H)\n\tpmaddwd   xmm0,[rel PW_F106_MF217]\t; xmm0=(tmp0L)\n\tpmaddwd   xmm1,[rel PW_F106_MF217]\t; xmm1=(tmp0H)\n\n\tmovdqa    xmm6,xmm2\n\tmovdqa    xmm7,xmm2\n\tpunpcklwd xmm6,xmm3\n\tpunpckhwd xmm7,xmm3\n\tmovdqa    xmm2,xmm6\n\tmovdqa    xmm3,xmm7\n\tpmaddwd   xmm6,[rel PW_MF060_MF050]\t; xmm6=(tmp2L)\n\tpmaddwd   xmm7,[rel PW_MF060_MF050]\t; xmm7=(tmp2H)\n\tpmaddwd   xmm2,[rel PW_F145_MF021]\t; xmm2=(tmp0L)\n\tpmaddwd   xmm3,[rel PW_F145_MF021]\t; xmm3=(tmp0H)\n\n\tpaddd\txmm6,xmm4\t\t; xmm6=tmp2L\n\tpaddd\txmm7,xmm5\t\t; xmm7=tmp2H\n\tpaddd\txmm2,xmm0\t\t; xmm2=tmp0L\n\tpaddd\txmm3,xmm1\t\t; xmm3=tmp0H\n\n\tmovdqa\tXMMWORD [wk(0)], xmm2\t; wk(0)=tmp0L\n\tmovdqa\tXMMWORD [wk(1)], xmm3\t; wk(1)=tmp0H\n\n\t; -- Even part\n\n\tmovdqa\txmm4, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)]\n\tmovdqa\txmm5, XMMWORD [XMMBLOCK(2,0,rsi,SIZEOF_JCOEF)]\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(6,0,rsi,SIZEOF_JCOEF)]\n\tpmullw\txmm4, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\txmm5, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\txmm0, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\tpxor      xmm1,xmm1\n\tpxor      xmm2,xmm2\n\tpunpcklwd xmm1,xmm4\t\t; xmm1=tmp0L\n\tpunpckhwd xmm2,xmm4\t\t; xmm2=tmp0H\n\tpsrad     xmm1,(16-CONST_BITS-1) ; psrad xmm1,16 & pslld xmm1,CONST_BITS+1\n\tpsrad     xmm2,(16-CONST_BITS-1) ; psrad xmm2,16 & pslld xmm2,CONST_BITS+1\n\n\tmovdqa    xmm3,xmm5\t\t; xmm5=in2=z2\n\tpunpcklwd xmm5,xmm0\t\t; xmm0=in6=z3\n\tpunpckhwd xmm3,xmm0\n\tpmaddwd   xmm5,[rel PW_F184_MF076]\t; xmm5=tmp2L\n\tpmaddwd   xmm3,[rel PW_F184_MF076]\t; xmm3=tmp2H\n\n\tmovdqa\txmm4,xmm1\n\tmovdqa\txmm0,xmm2\n\tpaddd\txmm1,xmm5\t\t; xmm1=tmp10L\n\tpaddd\txmm2,xmm3\t\t; xmm2=tmp10H\n\tpsubd\txmm4,xmm5\t\t; xmm4=tmp12L\n\tpsubd\txmm0,xmm3\t\t; xmm0=tmp12H\n\n\t; -- Final output stage\n\n\tmovdqa\txmm5,xmm1\n\tmovdqa\txmm3,xmm2\n\tpaddd\txmm1,xmm6\t\t; xmm1=data0L\n\tpaddd\txmm2,xmm7\t\t; xmm2=data0H\n\tpsubd\txmm5,xmm6\t\t; xmm5=data3L\n\tpsubd\txmm3,xmm7\t\t; xmm3=data3H\n\n\tmovdqa\txmm6,[rel PD_DESCALE_P1_4]\t; xmm6=[rel PD_DESCALE_P1_4]\n\n\tpaddd\txmm1,xmm6\n\tpaddd\txmm2,xmm6\n\tpsrad\txmm1,DESCALE_P1_4\n\tpsrad\txmm2,DESCALE_P1_4\n\tpaddd\txmm5,xmm6\n\tpaddd\txmm3,xmm6\n\tpsrad\txmm5,DESCALE_P1_4\n\tpsrad\txmm3,DESCALE_P1_4\n\n\tpackssdw  xmm1,xmm2\t\t; xmm1=data0=(00 01 02 03 04 05 06 07)\n\tpackssdw  xmm5,xmm3\t\t; xmm5=data3=(30 31 32 33 34 35 36 37)\n\n\tmovdqa\txmm7, XMMWORD [wk(0)]\t; xmm7=tmp0L\n\tmovdqa\txmm6, XMMWORD [wk(1)]\t; xmm6=tmp0H\n\n\tmovdqa\txmm2,xmm4\n\tmovdqa\txmm3,xmm0\n\tpaddd\txmm4,xmm7\t\t; xmm4=data1L\n\tpaddd\txmm0,xmm6\t\t; xmm0=data1H\n\tpsubd\txmm2,xmm7\t\t; xmm2=data2L\n\tpsubd\txmm3,xmm6\t\t; xmm3=data2H\n\n\tmovdqa\txmm7,[rel PD_DESCALE_P1_4]\t; xmm7=[rel PD_DESCALE_P1_4]\n\n\tpaddd\txmm4,xmm7\n\tpaddd\txmm0,xmm7\n\tpsrad\txmm4,DESCALE_P1_4\n\tpsrad\txmm0,DESCALE_P1_4\n\tpaddd\txmm2,xmm7\n\tpaddd\txmm3,xmm7\n\tpsrad\txmm2,DESCALE_P1_4\n\tpsrad\txmm3,DESCALE_P1_4\n\n\tpackssdw  xmm4,xmm0\t\t; xmm4=data1=(10 11 12 13 14 15 16 17)\n\tpackssdw  xmm2,xmm3\t\t; xmm2=data2=(20 21 22 23 24 25 26 27)\n\n\tmovdqa    xmm6,xmm1\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm1,xmm4\t; xmm1=(00 10 01 11 02 12 03 13)\n\tpunpckhwd xmm6,xmm4\t; xmm6=(04 14 05 15 06 16 07 17)\n\tmovdqa    xmm7,xmm2\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm2,xmm5\t; xmm2=(20 30 21 31 22 32 23 33)\n\tpunpckhwd xmm7,xmm5\t; xmm7=(24 34 25 35 26 36 27 37)\n\n\tmovdqa    xmm0,xmm1\t; transpose coefficients(phase 2)\n\tpunpckldq xmm1,xmm2\t; xmm1=[col0 col1]=(00 10 20 30 01 11 21 31)\n\tpunpckhdq xmm0,xmm2\t; xmm0=[col2 col3]=(02 12 22 32 03 13 23 33)\n\tmovdqa    xmm3,xmm6\t; transpose coefficients(phase 2)\n\tpunpckldq xmm6,xmm7\t; xmm6=[col4 col5]=(04 14 24 34 05 15 25 35)\n\tpunpckhdq xmm3,xmm7\t; xmm3=[col6 col7]=(06 16 26 36 07 17 27 37)\n.column_end:\n\n\t; -- Prefetch the next coefficient block\n\n\tprefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 0*32]\n\tprefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 1*32]\n\tprefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 2*32]\n\tprefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 3*32]\n\n\t; ---- Pass 2: process rows, store into output array.\n\n\tmov\trax, [original_rbp]\n\tmov\trdi, r12\t; (JSAMPROW *)\n\tmov\trax, r13\n\n\t; -- Even part\n\n\tpxor      xmm4,xmm4\n\tpunpcklwd xmm4,xmm1\t\t; xmm4=tmp0\n\tpsrad     xmm4,(16-CONST_BITS-1) ; psrad xmm4,16 & pslld xmm4,CONST_BITS+1\n\n\t; -- Odd part\n\n\tpunpckhwd xmm1,xmm0\n\tpunpckhwd xmm6,xmm3\n\tmovdqa    xmm5,xmm1\n\tmovdqa    xmm2,xmm6\n\tpmaddwd   xmm1,[rel PW_F256_F089]\t; xmm1=(tmp2)\n\tpmaddwd   xmm6,[rel PW_MF060_MF050]\t; xmm6=(tmp2)\n\tpmaddwd   xmm5,[rel PW_F106_MF217]\t; xmm5=(tmp0)\n\tpmaddwd   xmm2,[rel PW_F145_MF021]\t; xmm2=(tmp0)\n\n\tpaddd     xmm6,xmm1\t\t; xmm6=tmp2\n\tpaddd     xmm2,xmm5\t\t; xmm2=tmp0\n\n\t; -- Even part\n\n\tpunpcklwd xmm0,xmm3\n\tpmaddwd   xmm0,[rel PW_F184_MF076]\t; xmm0=tmp2\n\n\tmovdqa    xmm7,xmm4\n\tpaddd     xmm4,xmm0\t\t; xmm4=tmp10\n\tpsubd     xmm7,xmm0\t\t; xmm7=tmp12\n\n\t; -- Final output stage\n\n\tmovdqa\txmm1,[rel PD_DESCALE_P2_4]\t; xmm1=[rel PD_DESCALE_P2_4]\n\n\tmovdqa\txmm5,xmm4\n\tmovdqa\txmm3,xmm7\n\tpaddd\txmm4,xmm6\t\t; xmm4=data0=(00 10 20 30)\n\tpaddd\txmm7,xmm2\t\t; xmm7=data1=(01 11 21 31)\n\tpsubd\txmm5,xmm6\t\t; xmm5=data3=(03 13 23 33)\n\tpsubd\txmm3,xmm2\t\t; xmm3=data2=(02 12 22 32)\n\n\tpaddd\txmm4,xmm1\n\tpaddd\txmm7,xmm1\n\tpsrad\txmm4,DESCALE_P2_4\n\tpsrad\txmm7,DESCALE_P2_4\n\tpaddd\txmm5,xmm1\n\tpaddd\txmm3,xmm1\n\tpsrad\txmm5,DESCALE_P2_4\n\tpsrad\txmm3,DESCALE_P2_4\n\n\tpackssdw  xmm4,xmm3\t\t; xmm4=(00 10 20 30 02 12 22 32)\n\tpackssdw  xmm7,xmm5\t\t; xmm7=(01 11 21 31 03 13 23 33)\n\n\tmovdqa    xmm0,xmm4\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm4,xmm7\t\t; xmm4=(00 01 10 11 20 21 30 31)\n\tpunpckhwd xmm0,xmm7\t\t; xmm0=(02 03 12 13 22 23 32 33)\n\n\tmovdqa    xmm6,xmm4\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm4,xmm0\t\t; xmm4=(00 01 02 03 10 11 12 13)\n\tpunpckhdq xmm6,xmm0\t\t; xmm6=(20 21 22 23 30 31 32 33)\n\n\tpacksswb  xmm4,xmm6\t\t; xmm4=(00 01 02 03 10 11 12 13 20 ..)\n\tpaddb     xmm4,[rel PB_CENTERJSAMP]\n\n\tpshufd    xmm2,xmm4,0x39\t; xmm2=(10 11 12 13 20 21 22 23 30 ..)\n\tpshufd    xmm1,xmm4,0x4E\t; xmm1=(20 21 22 23 30 31 32 33 00 ..)\n\tpshufd    xmm3,xmm4,0x93\t; xmm3=(30 31 32 33 00 01 02 03 10 ..)\n\n\tmov\trdx, JSAMPROW [rdi+0*SIZEOF_JSAMPROW]\n\tmov\trsi, JSAMPROW [rdi+1*SIZEOF_JSAMPROW]\n\tmovd\tXMM_DWORD [rdx+rax*SIZEOF_JSAMPLE], xmm4\n\tmovd\tXMM_DWORD [rsi+rax*SIZEOF_JSAMPLE], xmm2\n\tmov\trdx, JSAMPROW [rdi+2*SIZEOF_JSAMPROW]\n\tmov\trsi, JSAMPROW [rdi+3*SIZEOF_JSAMPROW]\n\tmovd\tXMM_DWORD [rdx+rax*SIZEOF_JSAMPLE], xmm1\n\tmovd\tXMM_DWORD [rsi+rax*SIZEOF_JSAMPLE], xmm3\n\n\tuncollect_args\n\tmov\trsp,rbp\t\t; rsp <- aligned rbp\n\tpop\trsp\t\t; rsp <- original rbp\n\tpop\trbp\n\tret\n\n\n; --------------------------------------------------------------------------\n;\n; Perform dequantization and inverse DCT on one block of coefficients,\n; producing a reduced-size 2x2 output block.\n;\n; GLOBAL(void)\n; jsimd_idct_2x2_sse2 (void * dct_table, JCOEFPTR coef_block,\n;                      JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n; r10 = void * dct_table\n; r11 = JCOEFPTR coef_block\n; r12 = JSAMPARRAY output_buf\n; r13 = JDIMENSION output_col\n\n\talign\t16\n\tglobal\tEXTN(jsimd_idct_2x2_sse2)\n\nEXTN(jsimd_idct_2x2_sse2):\n\tpush\trbp\n\tmov\trax,rsp\n\tmov\trbp,rsp\n\tcollect_args\n\tpush\trbx\n\n\t; ---- Pass 1: process columns from input.\n\n\tmov\trdx, r10\t; quantptr\n\tmov\trsi, r11\t\t; inptr\n\n\t; | input:                  | result:        |\n\t; | 00 01 ** 03 ** 05 ** 07 |                |\n\t; | 10 11 ** 13 ** 15 ** 17 |                |\n\t; | ** ** ** ** ** ** ** ** |                |\n\t; | 30 31 ** 33 ** 35 ** 37 | A0 A1 A3 A5 A7 |\n\t; | ** ** ** ** ** ** ** ** | B0 B1 B3 B5 B7 |\n\t; | 50 51 ** 53 ** 55 ** 57 |                |\n\t; | ** ** ** ** ** ** ** ** |                |\n\t; | 70 71 ** 73 ** 75 ** 77 |                |\n\n\t; -- Odd part\n\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(1,0,rsi,SIZEOF_JCOEF)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(3,0,rsi,SIZEOF_JCOEF)]\n\tpmullw\txmm0, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\txmm1, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\tmovdqa\txmm2, XMMWORD [XMMBLOCK(5,0,rsi,SIZEOF_JCOEF)]\n\tmovdqa\txmm3, XMMWORD [XMMBLOCK(7,0,rsi,SIZEOF_JCOEF)]\n\tpmullw\txmm2, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\txmm3, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\t; xmm0=(10 11 ** 13 ** 15 ** 17), xmm1=(30 31 ** 33 ** 35 ** 37)\n\t; xmm2=(50 51 ** 53 ** 55 ** 57), xmm3=(70 71 ** 73 ** 75 ** 77)\n\n\tpcmpeqd   xmm7,xmm7\n\tpslld     xmm7,WORD_BIT\t\t; xmm7={0x0000 0xFFFF 0x0000 0xFFFF ..}\n\n\tmovdqa    xmm4,xmm0\t\t; xmm4=(10 11 ** 13 ** 15 ** 17)\n\tmovdqa    xmm5,xmm2\t\t; xmm5=(50 51 ** 53 ** 55 ** 57)\n\tpunpcklwd xmm4,xmm1\t\t; xmm4=(10 30 11 31 ** ** 13 33)\n\tpunpcklwd xmm5,xmm3\t\t; xmm5=(50 70 51 71 ** ** 53 73)\n\tpmaddwd   xmm4,[rel PW_F362_MF127]\n\tpmaddwd   xmm5,[rel PW_F085_MF072]\n\n\tpsrld\txmm0,WORD_BIT\t\t; xmm0=(11 -- 13 -- 15 -- 17 --)\n\tpand\txmm1,xmm7\t\t; xmm1=(-- 31 -- 33 -- 35 -- 37)\n\tpsrld\txmm2,WORD_BIT\t\t; xmm2=(51 -- 53 -- 55 -- 57 --)\n\tpand\txmm3,xmm7\t\t; xmm3=(-- 71 -- 73 -- 75 -- 77)\n\tpor\txmm0,xmm1\t\t; xmm0=(11 31 13 33 15 35 17 37)\n\tpor\txmm2,xmm3\t\t; xmm2=(51 71 53 73 55 75 57 77)\n\tpmaddwd\txmm0,[rel PW_F362_MF127]\n\tpmaddwd\txmm2,[rel PW_F085_MF072]\n\n\tpaddd\txmm4,xmm5\t\t; xmm4=tmp0[col0 col1 **** col3]\n\tpaddd\txmm0,xmm2\t\t; xmm0=tmp0[col1 col3 col5 col7]\n\n\t; -- Even part\n\n\tmovdqa\txmm6, XMMWORD [XMMBLOCK(0,0,rsi,SIZEOF_JCOEF)]\n\tpmullw\txmm6, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\t; xmm6=(00 01 ** 03 ** 05 ** 07)\n\n\tmovdqa\txmm1,xmm6\t\t; xmm1=(00 01 ** 03 ** 05 ** 07)\n\tpslld\txmm6,WORD_BIT\t\t; xmm6=(-- 00 -- ** -- ** -- **)\n\tpand\txmm1,xmm7\t\t; xmm1=(-- 01 -- 03 -- 05 -- 07)\n\tpsrad\txmm6,(WORD_BIT-CONST_BITS-2) ; xmm6=tmp10[col0 **** **** ****]\n\tpsrad\txmm1,(WORD_BIT-CONST_BITS-2) ; xmm1=tmp10[col1 col3 col5 col7]\n\n\t; -- Final output stage\n\n\tmovdqa\txmm3,xmm6\n\tmovdqa\txmm5,xmm1\n\tpaddd\txmm6,xmm4\t; xmm6=data0[col0 **** **** ****]=(A0 ** ** **)\n\tpaddd\txmm1,xmm0\t; xmm1=data0[col1 col3 col5 col7]=(A1 A3 A5 A7)\n\tpsubd\txmm3,xmm4\t; xmm3=data1[col0 **** **** ****]=(B0 ** ** **)\n\tpsubd\txmm5,xmm0\t; xmm5=data1[col1 col3 col5 col7]=(B1 B3 B5 B7)\n\n\tmovdqa\txmm2,[rel PD_DESCALE_P1_2]\t; xmm2=[rel PD_DESCALE_P1_2]\n\n\tpunpckldq  xmm6,xmm3\t\t; xmm6=(A0 B0 ** **)\n\n\tmovdqa     xmm7,xmm1\n\tpunpcklqdq xmm1,xmm5\t\t; xmm1=(A1 A3 B1 B3)\n\tpunpckhqdq xmm7,xmm5\t\t; xmm7=(A5 A7 B5 B7)\n\n\tpaddd\txmm6,xmm2\n\tpsrad\txmm6,DESCALE_P1_2\n\n\tpaddd\txmm1,xmm2\n\tpaddd\txmm7,xmm2\n\tpsrad\txmm1,DESCALE_P1_2\n\tpsrad\txmm7,DESCALE_P1_2\n\n\t; -- Prefetch the next coefficient block\n\n\tprefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 0*32]\n\tprefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 1*32]\n\tprefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 2*32]\n\tprefetchnta [rsi + DCTSIZE2*SIZEOF_JCOEF + 3*32]\n\n\t; ---- Pass 2: process rows, store into output array.\n\n\tmov\trdi, r12\t; (JSAMPROW *)\n\tmov\trax, r13\n\n\t; | input:| result:|\n\t; | A0 B0 |        |\n\t; | A1 B1 | C0 C1  |\n\t; | A3 B3 | D0 D1  |\n\t; | A5 B5 |        |\n\t; | A7 B7 |        |\n\n\t; -- Odd part\n\n\tpackssdw  xmm1,xmm1\t\t; xmm1=(A1 A3 B1 B3 A1 A3 B1 B3)\n\tpackssdw  xmm7,xmm7\t\t; xmm7=(A5 A7 B5 B7 A5 A7 B5 B7)\n\tpmaddwd   xmm1,[rel PW_F362_MF127]\n\tpmaddwd   xmm7,[rel PW_F085_MF072]\n\n\tpaddd     xmm1,xmm7\t\t; xmm1=tmp0[row0 row1 row0 row1]\n\n\t; -- Even part\n\n\tpslld     xmm6,(CONST_BITS+2)\t; xmm6=tmp10[row0 row1 **** ****]\n\n\t; -- Final output stage\n\n\tmovdqa    xmm4,xmm6\n\tpaddd     xmm6,xmm1\t; xmm6=data0[row0 row1 **** ****]=(C0 C1 ** **)\n\tpsubd     xmm4,xmm1\t; xmm4=data1[row0 row1 **** ****]=(D0 D1 ** **)\n\n\tpunpckldq xmm6,xmm4\t; xmm6=(C0 D0 C1 D1)\n\n\tpaddd     xmm6,[rel PD_DESCALE_P2_2]\n\tpsrad     xmm6,DESCALE_P2_2\n\n\tpackssdw  xmm6,xmm6\t\t; xmm6=(C0 D0 C1 D1 C0 D0 C1 D1)\n\tpacksswb  xmm6,xmm6\t\t; xmm6=(C0 D0 C1 D1 C0 D0 C1 D1 ..)\n\tpaddb     xmm6,[rel PB_CENTERJSAMP]\n\n\tpextrw\tebx,xmm6,0x00\t\t; ebx=(C0 D0 -- --)\n\tpextrw\tecx,xmm6,0x01\t\t; ecx=(C1 D1 -- --)\n\n\tmov\trdx, JSAMPROW [rdi+0*SIZEOF_JSAMPROW]\n\tmov\trsi, JSAMPROW [rdi+1*SIZEOF_JSAMPROW]\n\tmov\tWORD [rdx+rax*SIZEOF_JSAMPLE], bx\n\tmov\tWORD [rsi+rax*SIZEOF_JSAMPLE], cx\n\n\tpop\trbx\n\tuncollect_args\n\tpop\trbp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jiss2red.asm",
    "content": ";\n; jiss2red.asm - reduced-size IDCT (SSE2)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains inverse-DCT routines that produce reduced-size\n; output: either 4x4 or 2x2 pixels from an 8x8 DCT block.\n; The following code is based directly on the IJG's original jidctred.c;\n; see the jidctred.c for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%define CONST_BITS\t13\n%define PASS1_BITS\t2\n\n%define DESCALE_P1_4\t(CONST_BITS-PASS1_BITS+1)\n%define DESCALE_P2_4\t(CONST_BITS+PASS1_BITS+3+1)\n%define DESCALE_P1_2\t(CONST_BITS-PASS1_BITS+2)\n%define DESCALE_P2_2\t(CONST_BITS+PASS1_BITS+3+2)\n\n%if CONST_BITS == 13\nF_0_211\tequ\t 1730\t\t; FIX(0.211164243)\nF_0_509\tequ\t 4176\t\t; FIX(0.509795579)\nF_0_601\tequ\t 4926\t\t; FIX(0.601344887)\nF_0_720\tequ\t 5906\t\t; FIX(0.720959822)\nF_0_765\tequ\t 6270\t\t; FIX(0.765366865)\nF_0_850\tequ\t 6967\t\t; FIX(0.850430095)\nF_0_899\tequ\t 7373\t\t; FIX(0.899976223)\nF_1_061\tequ\t 8697\t\t; FIX(1.061594337)\nF_1_272\tequ\t10426\t\t; FIX(1.272758580)\nF_1_451\tequ\t11893\t\t; FIX(1.451774981)\nF_1_847\tequ\t15137\t\t; FIX(1.847759065)\nF_2_172\tequ\t17799\t\t; FIX(2.172734803)\nF_2_562\tequ\t20995\t\t; FIX(2.562915447)\nF_3_624\tequ\t29692\t\t; FIX(3.624509785)\n%else\n; NASM cannot do compile-time arithmetic on floating-point constants.\n%define DESCALE(x,n)  (((x)+(1<<((n)-1)))>>(n))\nF_0_211\tequ\tDESCALE( 226735879,30-CONST_BITS)\t; FIX(0.211164243)\nF_0_509\tequ\tDESCALE( 547388834,30-CONST_BITS)\t; FIX(0.509795579)\nF_0_601\tequ\tDESCALE( 645689155,30-CONST_BITS)\t; FIX(0.601344887)\nF_0_720\tequ\tDESCALE( 774124714,30-CONST_BITS)\t; FIX(0.720959822)\nF_0_765\tequ\tDESCALE( 821806413,30-CONST_BITS)\t; FIX(0.765366865)\nF_0_850\tequ\tDESCALE( 913142361,30-CONST_BITS)\t; FIX(0.850430095)\nF_0_899\tequ\tDESCALE( 966342111,30-CONST_BITS)\t; FIX(0.899976223)\nF_1_061\tequ\tDESCALE(1139878239,30-CONST_BITS)\t; FIX(1.061594337)\nF_1_272\tequ\tDESCALE(1366614119,30-CONST_BITS)\t; FIX(1.272758580)\nF_1_451\tequ\tDESCALE(1558831516,30-CONST_BITS)\t; FIX(1.451774981)\nF_1_847\tequ\tDESCALE(1984016188,30-CONST_BITS)\t; FIX(1.847759065)\nF_2_172\tequ\tDESCALE(2332956230,30-CONST_BITS)\t; FIX(2.172734803)\nF_2_562\tequ\tDESCALE(2751909506,30-CONST_BITS)\t; FIX(2.562915447)\nF_3_624\tequ\tDESCALE(3891787747,30-CONST_BITS)\t; FIX(3.624509785)\n%endif\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_idct_red_sse2)\n\nEXTN(jconst_idct_red_sse2):\n\nPW_F184_MF076\ttimes 4 dw  F_1_847,-F_0_765\nPW_F256_F089\ttimes 4 dw  F_2_562, F_0_899\nPW_F106_MF217\ttimes 4 dw  F_1_061,-F_2_172\nPW_MF060_MF050\ttimes 4 dw -F_0_601,-F_0_509\nPW_F145_MF021\ttimes 4 dw  F_1_451,-F_0_211\nPW_F362_MF127\ttimes 4 dw  F_3_624,-F_1_272\nPW_F085_MF072\ttimes 4 dw  F_0_850,-F_0_720\nPD_DESCALE_P1_4\ttimes 4 dd  1 << (DESCALE_P1_4-1)\nPD_DESCALE_P2_4\ttimes 4 dd  1 << (DESCALE_P2_4-1)\nPD_DESCALE_P1_2\ttimes 4 dd  1 << (DESCALE_P1_2-1)\nPD_DESCALE_P2_2\ttimes 4 dd  1 << (DESCALE_P2_2-1)\nPB_CENTERJSAMP\ttimes 16 db CENTERJSAMPLE\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Perform dequantization and inverse DCT on one block of coefficients,\n; producing a reduced-size 4x4 output block.\n;\n; GLOBAL(void)\n; jsimd_idct_4x4_sse2 (void * dct_table, JCOEFPTR coef_block,\n;                      JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n%define dct_table(b)\t(b)+8\t\t\t; void * dct_table\n%define coef_block(b)\t(b)+12\t\t; JCOEFPTR coef_block\n%define output_buf(b)\t(b)+16\t\t; JSAMPARRAY output_buf\n%define output_col(b)\t(b)+20\t\t; JDIMENSION output_col\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t2\n\n\talign\t16\n\tglobal\tEXTN(jsimd_idct_4x4_sse2)\n\nEXTN(jsimd_idct_4x4_sse2):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [wk(0)]\n\tpushpic\tebx\n;\tpush\tecx\t\t; unused\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t; get GOT address\n\n\t; ---- Pass 1: process columns from input.\n\n;\tmov\teax, [original_ebp]\n\tmov\tedx, POINTER [dct_table(eax)]\t; quantptr\n\tmov\tesi, JCOEFPTR [coef_block(eax)]\t\t; inptr\n\n%ifndef NO_ZERO_COLUMN_TEST_4X4_SSE2\n\tmov\teax, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tor\teax, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tjnz\tshort .columnDCT\n\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tpor\txmm0, XMMWORD [XMMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tpor\txmm1, XMMWORD [XMMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tpor\txmm0, XMMWORD [XMMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\tpor\txmm1, XMMWORD [XMMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\tpor\txmm0,xmm1\n\tpacksswb xmm0,xmm0\n\tpacksswb xmm0,xmm0\n\tmovd\teax,xmm0\n\ttest\teax,eax\n\tjnz\tshort .columnDCT\n\n\t; -- AC terms all zero\n\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\tpmullw\txmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\tpsllw\txmm0,PASS1_BITS\n\n\tmovdqa    xmm3,xmm0\t; xmm0=in0=(00 01 02 03 04 05 06 07)\n\tpunpcklwd xmm0,xmm0\t; xmm0=(00 00 01 01 02 02 03 03)\n\tpunpckhwd xmm3,xmm3\t; xmm3=(04 04 05 05 06 06 07 07)\n\n\tpshufd\txmm1,xmm0,0x50\t; xmm1=[col0 col1]=(00 00 00 00 01 01 01 01)\n\tpshufd\txmm0,xmm0,0xFA\t; xmm0=[col2 col3]=(02 02 02 02 03 03 03 03)\n\tpshufd\txmm6,xmm3,0x50\t; xmm6=[col4 col5]=(04 04 04 04 05 05 05 05)\n\tpshufd\txmm3,xmm3,0xFA\t; xmm3=[col6 col7]=(06 06 06 06 07 07 07 07)\n\n\tjmp\tnear .column_end\n\talignx\t16,7\n%endif\n.columnDCT:\n\n\t; -- Odd part\n\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tpmullw\txmm0, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\txmm1, XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tmovdqa\txmm2, XMMWORD [XMMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tmovdqa\txmm3, XMMWORD [XMMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\tpmullw\txmm2, XMMWORD [XMMBLOCK(5,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\txmm3, XMMWORD [XMMBLOCK(7,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\tmovdqa    xmm4,xmm0\n\tmovdqa    xmm5,xmm0\n\tpunpcklwd xmm4,xmm1\n\tpunpckhwd xmm5,xmm1\n\tmovdqa    xmm0,xmm4\n\tmovdqa    xmm1,xmm5\n\tpmaddwd   xmm4,[GOTOFF(ebx,PW_F256_F089)]\t; xmm4=(tmp2L)\n\tpmaddwd   xmm5,[GOTOFF(ebx,PW_F256_F089)]\t; xmm5=(tmp2H)\n\tpmaddwd   xmm0,[GOTOFF(ebx,PW_F106_MF217)]\t; xmm0=(tmp0L)\n\tpmaddwd   xmm1,[GOTOFF(ebx,PW_F106_MF217)]\t; xmm1=(tmp0H)\n\n\tmovdqa    xmm6,xmm2\n\tmovdqa    xmm7,xmm2\n\tpunpcklwd xmm6,xmm3\n\tpunpckhwd xmm7,xmm3\n\tmovdqa    xmm2,xmm6\n\tmovdqa    xmm3,xmm7\n\tpmaddwd   xmm6,[GOTOFF(ebx,PW_MF060_MF050)]\t; xmm6=(tmp2L)\n\tpmaddwd   xmm7,[GOTOFF(ebx,PW_MF060_MF050)]\t; xmm7=(tmp2H)\n\tpmaddwd   xmm2,[GOTOFF(ebx,PW_F145_MF021)]\t; xmm2=(tmp0L)\n\tpmaddwd   xmm3,[GOTOFF(ebx,PW_F145_MF021)]\t; xmm3=(tmp0H)\n\n\tpaddd\txmm6,xmm4\t\t; xmm6=tmp2L\n\tpaddd\txmm7,xmm5\t\t; xmm7=tmp2H\n\tpaddd\txmm2,xmm0\t\t; xmm2=tmp0L\n\tpaddd\txmm3,xmm1\t\t; xmm3=tmp0H\n\n\tmovdqa\tXMMWORD [wk(0)], xmm2\t; wk(0)=tmp0L\n\tmovdqa\tXMMWORD [wk(1)], xmm3\t; wk(1)=tmp0H\n\n\t; -- Even part\n\n\tmovdqa\txmm4, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\tmovdqa\txmm5, XMMWORD [XMMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\tpmullw\txmm4, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\txmm5, XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\txmm0, XMMWORD [XMMBLOCK(6,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\tpxor      xmm1,xmm1\n\tpxor      xmm2,xmm2\n\tpunpcklwd xmm1,xmm4\t\t; xmm1=tmp0L\n\tpunpckhwd xmm2,xmm4\t\t; xmm2=tmp0H\n\tpsrad     xmm1,(16-CONST_BITS-1) ; psrad xmm1,16 & pslld xmm1,CONST_BITS+1\n\tpsrad     xmm2,(16-CONST_BITS-1) ; psrad xmm2,16 & pslld xmm2,CONST_BITS+1\n\n\tmovdqa    xmm3,xmm5\t\t; xmm5=in2=z2\n\tpunpcklwd xmm5,xmm0\t\t; xmm0=in6=z3\n\tpunpckhwd xmm3,xmm0\n\tpmaddwd   xmm5,[GOTOFF(ebx,PW_F184_MF076)]\t; xmm5=tmp2L\n\tpmaddwd   xmm3,[GOTOFF(ebx,PW_F184_MF076)]\t; xmm3=tmp2H\n\n\tmovdqa\txmm4,xmm1\n\tmovdqa\txmm0,xmm2\n\tpaddd\txmm1,xmm5\t\t; xmm1=tmp10L\n\tpaddd\txmm2,xmm3\t\t; xmm2=tmp10H\n\tpsubd\txmm4,xmm5\t\t; xmm4=tmp12L\n\tpsubd\txmm0,xmm3\t\t; xmm0=tmp12H\n\n\t; -- Final output stage\n\n\tmovdqa\txmm5,xmm1\n\tmovdqa\txmm3,xmm2\n\tpaddd\txmm1,xmm6\t\t; xmm1=data0L\n\tpaddd\txmm2,xmm7\t\t; xmm2=data0H\n\tpsubd\txmm5,xmm6\t\t; xmm5=data3L\n\tpsubd\txmm3,xmm7\t\t; xmm3=data3H\n\n\tmovdqa\txmm6,[GOTOFF(ebx,PD_DESCALE_P1_4)]\t; xmm6=[PD_DESCALE_P1_4]\n\n\tpaddd\txmm1,xmm6\n\tpaddd\txmm2,xmm6\n\tpsrad\txmm1,DESCALE_P1_4\n\tpsrad\txmm2,DESCALE_P1_4\n\tpaddd\txmm5,xmm6\n\tpaddd\txmm3,xmm6\n\tpsrad\txmm5,DESCALE_P1_4\n\tpsrad\txmm3,DESCALE_P1_4\n\n\tpackssdw  xmm1,xmm2\t\t; xmm1=data0=(00 01 02 03 04 05 06 07)\n\tpackssdw  xmm5,xmm3\t\t; xmm5=data3=(30 31 32 33 34 35 36 37)\n\n\tmovdqa\txmm7, XMMWORD [wk(0)]\t; xmm7=tmp0L\n\tmovdqa\txmm6, XMMWORD [wk(1)]\t; xmm6=tmp0H\n\n\tmovdqa\txmm2,xmm4\n\tmovdqa\txmm3,xmm0\n\tpaddd\txmm4,xmm7\t\t; xmm4=data1L\n\tpaddd\txmm0,xmm6\t\t; xmm0=data1H\n\tpsubd\txmm2,xmm7\t\t; xmm2=data2L\n\tpsubd\txmm3,xmm6\t\t; xmm3=data2H\n\n\tmovdqa\txmm7,[GOTOFF(ebx,PD_DESCALE_P1_4)]\t; xmm7=[PD_DESCALE_P1_4]\n\n\tpaddd\txmm4,xmm7\n\tpaddd\txmm0,xmm7\n\tpsrad\txmm4,DESCALE_P1_4\n\tpsrad\txmm0,DESCALE_P1_4\n\tpaddd\txmm2,xmm7\n\tpaddd\txmm3,xmm7\n\tpsrad\txmm2,DESCALE_P1_4\n\tpsrad\txmm3,DESCALE_P1_4\n\n\tpackssdw  xmm4,xmm0\t\t; xmm4=data1=(10 11 12 13 14 15 16 17)\n\tpackssdw  xmm2,xmm3\t\t; xmm2=data2=(20 21 22 23 24 25 26 27)\n\n\tmovdqa    xmm6,xmm1\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm1,xmm4\t; xmm1=(00 10 01 11 02 12 03 13)\n\tpunpckhwd xmm6,xmm4\t; xmm6=(04 14 05 15 06 16 07 17)\n\tmovdqa    xmm7,xmm2\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm2,xmm5\t; xmm2=(20 30 21 31 22 32 23 33)\n\tpunpckhwd xmm7,xmm5\t; xmm7=(24 34 25 35 26 36 27 37)\n\n\tmovdqa    xmm0,xmm1\t; transpose coefficients(phase 2)\n\tpunpckldq xmm1,xmm2\t; xmm1=[col0 col1]=(00 10 20 30 01 11 21 31)\n\tpunpckhdq xmm0,xmm2\t; xmm0=[col2 col3]=(02 12 22 32 03 13 23 33)\n\tmovdqa    xmm3,xmm6\t; transpose coefficients(phase 2)\n\tpunpckldq xmm6,xmm7\t; xmm6=[col4 col5]=(04 14 24 34 05 15 25 35)\n\tpunpckhdq xmm3,xmm7\t; xmm3=[col6 col7]=(06 16 26 36 07 17 27 37)\n.column_end:\n\n\t; -- Prefetch the next coefficient block\n\n\tprefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 0*32]\n\tprefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 1*32]\n\tprefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 2*32]\n\tprefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 3*32]\n\n\t; ---- Pass 2: process rows, store into output array.\n\n\tmov\teax, [original_ebp]\n\tmov\tedi, JSAMPARRAY [output_buf(eax)]\t; (JSAMPROW *)\n\tmov\teax, JDIMENSION [output_col(eax)]\n\n\t; -- Even part\n\n\tpxor      xmm4,xmm4\n\tpunpcklwd xmm4,xmm1\t\t; xmm4=tmp0\n\tpsrad     xmm4,(16-CONST_BITS-1) ; psrad xmm4,16 & pslld xmm4,CONST_BITS+1\n\n\t; -- Odd part\n\n\tpunpckhwd xmm1,xmm0\n\tpunpckhwd xmm6,xmm3\n\tmovdqa    xmm5,xmm1\n\tmovdqa    xmm2,xmm6\n\tpmaddwd   xmm1,[GOTOFF(ebx,PW_F256_F089)]\t; xmm1=(tmp2)\n\tpmaddwd   xmm6,[GOTOFF(ebx,PW_MF060_MF050)]\t; xmm6=(tmp2)\n\tpmaddwd   xmm5,[GOTOFF(ebx,PW_F106_MF217)]\t; xmm5=(tmp0)\n\tpmaddwd   xmm2,[GOTOFF(ebx,PW_F145_MF021)]\t; xmm2=(tmp0)\n\n\tpaddd     xmm6,xmm1\t\t; xmm6=tmp2\n\tpaddd     xmm2,xmm5\t\t; xmm2=tmp0\n\n\t; -- Even part\n\n\tpunpcklwd xmm0,xmm3\n\tpmaddwd   xmm0,[GOTOFF(ebx,PW_F184_MF076)]\t; xmm0=tmp2\n\n\tmovdqa    xmm7,xmm4\n\tpaddd     xmm4,xmm0\t\t; xmm4=tmp10\n\tpsubd     xmm7,xmm0\t\t; xmm7=tmp12\n\n\t; -- Final output stage\n\n\tmovdqa\txmm1,[GOTOFF(ebx,PD_DESCALE_P2_4)]\t; xmm1=[PD_DESCALE_P2_4]\n\n\tmovdqa\txmm5,xmm4\n\tmovdqa\txmm3,xmm7\n\tpaddd\txmm4,xmm6\t\t; xmm4=data0=(00 10 20 30)\n\tpaddd\txmm7,xmm2\t\t; xmm7=data1=(01 11 21 31)\n\tpsubd\txmm5,xmm6\t\t; xmm5=data3=(03 13 23 33)\n\tpsubd\txmm3,xmm2\t\t; xmm3=data2=(02 12 22 32)\n\n\tpaddd\txmm4,xmm1\n\tpaddd\txmm7,xmm1\n\tpsrad\txmm4,DESCALE_P2_4\n\tpsrad\txmm7,DESCALE_P2_4\n\tpaddd\txmm5,xmm1\n\tpaddd\txmm3,xmm1\n\tpsrad\txmm5,DESCALE_P2_4\n\tpsrad\txmm3,DESCALE_P2_4\n\n\tpackssdw  xmm4,xmm3\t\t; xmm4=(00 10 20 30 02 12 22 32)\n\tpackssdw  xmm7,xmm5\t\t; xmm7=(01 11 21 31 03 13 23 33)\n\n\tmovdqa    xmm0,xmm4\t\t; transpose coefficients(phase 1)\n\tpunpcklwd xmm4,xmm7\t\t; xmm4=(00 01 10 11 20 21 30 31)\n\tpunpckhwd xmm0,xmm7\t\t; xmm0=(02 03 12 13 22 23 32 33)\n\n\tmovdqa    xmm6,xmm4\t\t; transpose coefficients(phase 2)\n\tpunpckldq xmm4,xmm0\t\t; xmm4=(00 01 02 03 10 11 12 13)\n\tpunpckhdq xmm6,xmm0\t\t; xmm6=(20 21 22 23 30 31 32 33)\n\n\tpacksswb  xmm4,xmm6\t\t; xmm4=(00 01 02 03 10 11 12 13 20 ..)\n\tpaddb     xmm4,[GOTOFF(ebx,PB_CENTERJSAMP)]\n\n\tpshufd    xmm2,xmm4,0x39\t; xmm2=(10 11 12 13 20 21 22 23 30 ..)\n\tpshufd    xmm1,xmm4,0x4E\t; xmm1=(20 21 22 23 30 31 32 33 00 ..)\n\tpshufd    xmm3,xmm4,0x93\t; xmm3=(30 31 32 33 00 01 02 03 10 ..)\n\n\tmov\tedx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\n\tmov\tesi, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\n\tmovd\tXMM_DWORD [edx+eax*SIZEOF_JSAMPLE], xmm4\n\tmovd\tXMM_DWORD [esi+eax*SIZEOF_JSAMPLE], xmm2\n\tmov\tedx, JSAMPROW [edi+2*SIZEOF_JSAMPROW]\n\tmov\tesi, JSAMPROW [edi+3*SIZEOF_JSAMPROW]\n\tmovd\tXMM_DWORD [edx+eax*SIZEOF_JSAMPLE], xmm1\n\tmovd\tXMM_DWORD [esi+eax*SIZEOF_JSAMPLE], xmm3\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; unused\n\tpoppic\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n\n; --------------------------------------------------------------------------\n;\n; Perform dequantization and inverse DCT on one block of coefficients,\n; producing a reduced-size 2x2 output block.\n;\n; GLOBAL(void)\n; jsimd_idct_2x2_sse2 (void * dct_table, JCOEFPTR coef_block,\n;                      JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n%define dct_table(b)\t(b)+8\t\t\t; void * dct_table\n%define coef_block(b)\t(b)+12\t\t; JCOEFPTR coef_block\n%define output_buf(b)\t(b)+16\t\t; JSAMPARRAY output_buf\n%define output_col(b)\t(b)+20\t\t; JDIMENSION output_col\n\n\talign\t16\n\tglobal\tEXTN(jsimd_idct_2x2_sse2)\n\nEXTN(jsimd_idct_2x2_sse2):\n\tpush\tebp\n\tmov\tebp,esp\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t; get GOT address\n\n\t; ---- Pass 1: process columns from input.\n\n\tmov\tedx, POINTER [dct_table(ebp)]\t; quantptr\n\tmov\tesi, JCOEFPTR [coef_block(ebp)]\t\t; inptr\n\n\t; | input:                  | result:        |\n\t; | 00 01 ** 03 ** 05 ** 07 |                |\n\t; | 10 11 ** 13 ** 15 ** 17 |                |\n\t; | ** ** ** ** ** ** ** ** |                |\n\t; | 30 31 ** 33 ** 35 ** 37 | A0 A1 A3 A5 A7 |\n\t; | ** ** ** ** ** ** ** ** | B0 B1 B3 B5 B7 |\n\t; | 50 51 ** 53 ** 55 ** 57 |                |\n\t; | ** ** ** ** ** ** ** ** |                |\n\t; | 70 71 ** 73 ** 75 ** 77 |                |\n\n\t; -- Odd part\n\n\tmovdqa\txmm0, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tmovdqa\txmm1, XMMWORD [XMMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tpmullw\txmm0, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\txmm1, XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tmovdqa\txmm2, XMMWORD [XMMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tmovdqa\txmm3, XMMWORD [XMMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\tpmullw\txmm2, XMMWORD [XMMBLOCK(5,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\tpmullw\txmm3, XMMWORD [XMMBLOCK(7,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\t; xmm0=(10 11 ** 13 ** 15 ** 17), xmm1=(30 31 ** 33 ** 35 ** 37)\n\t; xmm2=(50 51 ** 53 ** 55 ** 57), xmm3=(70 71 ** 73 ** 75 ** 77)\n\n\tpcmpeqd   xmm7,xmm7\n\tpslld     xmm7,WORD_BIT\t\t; xmm7={0x0000 0xFFFF 0x0000 0xFFFF ..}\n\n\tmovdqa    xmm4,xmm0\t\t; xmm4=(10 11 ** 13 ** 15 ** 17)\n\tmovdqa    xmm5,xmm2\t\t; xmm5=(50 51 ** 53 ** 55 ** 57)\n\tpunpcklwd xmm4,xmm1\t\t; xmm4=(10 30 11 31 ** ** 13 33)\n\tpunpcklwd xmm5,xmm3\t\t; xmm5=(50 70 51 71 ** ** 53 73)\n\tpmaddwd   xmm4,[GOTOFF(ebx,PW_F362_MF127)]\n\tpmaddwd   xmm5,[GOTOFF(ebx,PW_F085_MF072)]\n\n\tpsrld\txmm0,WORD_BIT\t\t; xmm0=(11 -- 13 -- 15 -- 17 --)\n\tpand\txmm1,xmm7\t\t; xmm1=(-- 31 -- 33 -- 35 -- 37)\n\tpsrld\txmm2,WORD_BIT\t\t; xmm2=(51 -- 53 -- 55 -- 57 --)\n\tpand\txmm3,xmm7\t\t; xmm3=(-- 71 -- 73 -- 75 -- 77)\n\tpor\txmm0,xmm1\t\t; xmm0=(11 31 13 33 15 35 17 37)\n\tpor\txmm2,xmm3\t\t; xmm2=(51 71 53 73 55 75 57 77)\n\tpmaddwd\txmm0,[GOTOFF(ebx,PW_F362_MF127)]\n\tpmaddwd\txmm2,[GOTOFF(ebx,PW_F085_MF072)]\n\n\tpaddd\txmm4,xmm5\t\t; xmm4=tmp0[col0 col1 **** col3]\n\tpaddd\txmm0,xmm2\t\t; xmm0=tmp0[col1 col3 col5 col7]\n\n\t; -- Even part\n\n\tmovdqa\txmm6, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\tpmullw\txmm6, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_ISLOW_MULT_TYPE)]\n\n\t; xmm6=(00 01 ** 03 ** 05 ** 07)\n\n\tmovdqa\txmm1,xmm6\t\t; xmm1=(00 01 ** 03 ** 05 ** 07)\n\tpslld\txmm6,WORD_BIT\t\t; xmm6=(-- 00 -- ** -- ** -- **)\n\tpand\txmm1,xmm7\t\t; xmm1=(-- 01 -- 03 -- 05 -- 07)\n\tpsrad\txmm6,(WORD_BIT-CONST_BITS-2) ; xmm6=tmp10[col0 **** **** ****]\n\tpsrad\txmm1,(WORD_BIT-CONST_BITS-2) ; xmm1=tmp10[col1 col3 col5 col7]\n\n\t; -- Final output stage\n\n\tmovdqa\txmm3,xmm6\n\tmovdqa\txmm5,xmm1\n\tpaddd\txmm6,xmm4\t; xmm6=data0[col0 **** **** ****]=(A0 ** ** **)\n\tpaddd\txmm1,xmm0\t; xmm1=data0[col1 col3 col5 col7]=(A1 A3 A5 A7)\n\tpsubd\txmm3,xmm4\t; xmm3=data1[col0 **** **** ****]=(B0 ** ** **)\n\tpsubd\txmm5,xmm0\t; xmm5=data1[col1 col3 col5 col7]=(B1 B3 B5 B7)\n\n\tmovdqa\txmm2,[GOTOFF(ebx,PD_DESCALE_P1_2)]\t; xmm2=[PD_DESCALE_P1_2]\n\n\tpunpckldq  xmm6,xmm3\t\t; xmm6=(A0 B0 ** **)\n\n\tmovdqa     xmm7,xmm1\n\tpunpcklqdq xmm1,xmm5\t\t; xmm1=(A1 A3 B1 B3)\n\tpunpckhqdq xmm7,xmm5\t\t; xmm7=(A5 A7 B5 B7)\n\n\tpaddd\txmm6,xmm2\n\tpsrad\txmm6,DESCALE_P1_2\n\n\tpaddd\txmm1,xmm2\n\tpaddd\txmm7,xmm2\n\tpsrad\txmm1,DESCALE_P1_2\n\tpsrad\txmm7,DESCALE_P1_2\n\n\t; -- Prefetch the next coefficient block\n\n\tprefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 0*32]\n\tprefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 1*32]\n\tprefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 2*32]\n\tprefetchnta [esi + DCTSIZE2*SIZEOF_JCOEF + 3*32]\n\n\t; ---- Pass 2: process rows, store into output array.\n\n\tmov\tedi, JSAMPARRAY [output_buf(ebp)]\t; (JSAMPROW *)\n\tmov\teax, JDIMENSION [output_col(ebp)]\n\n\t; | input:| result:|\n\t; | A0 B0 |        |\n\t; | A1 B1 | C0 C1  |\n\t; | A3 B3 | D0 D1  |\n\t; | A5 B5 |        |\n\t; | A7 B7 |        |\n\n\t; -- Odd part\n\n\tpackssdw  xmm1,xmm1\t\t; xmm1=(A1 A3 B1 B3 A1 A3 B1 B3)\n\tpackssdw  xmm7,xmm7\t\t; xmm7=(A5 A7 B5 B7 A5 A7 B5 B7)\n\tpmaddwd   xmm1,[GOTOFF(ebx,PW_F362_MF127)]\n\tpmaddwd   xmm7,[GOTOFF(ebx,PW_F085_MF072)]\n\n\tpaddd     xmm1,xmm7\t\t; xmm1=tmp0[row0 row1 row0 row1]\n\n\t; -- Even part\n\n\tpslld     xmm6,(CONST_BITS+2)\t; xmm6=tmp10[row0 row1 **** ****]\n\n\t; -- Final output stage\n\n\tmovdqa    xmm4,xmm6\n\tpaddd     xmm6,xmm1\t; xmm6=data0[row0 row1 **** ****]=(C0 C1 ** **)\n\tpsubd     xmm4,xmm1\t; xmm4=data1[row0 row1 **** ****]=(D0 D1 ** **)\n\n\tpunpckldq xmm6,xmm4\t; xmm6=(C0 D0 C1 D1)\n\n\tpaddd     xmm6,[GOTOFF(ebx,PD_DESCALE_P2_2)]\n\tpsrad     xmm6,DESCALE_P2_2\n\n\tpackssdw  xmm6,xmm6\t\t; xmm6=(C0 D0 C1 D1 C0 D0 C1 D1)\n\tpacksswb  xmm6,xmm6\t\t; xmm6=(C0 D0 C1 D1 C0 D0 C1 D1 ..)\n\tpaddb     xmm6,[GOTOFF(ebx,PB_CENTERJSAMP)]\n\n\tpextrw\tebx,xmm6,0x00\t\t; ebx=(C0 D0 -- --)\n\tpextrw\tecx,xmm6,0x01\t\t; ecx=(C1 D1 -- --)\n\n\tmov\tedx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\n\tmov\tesi, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\n\tmov\tWORD [edx+eax*SIZEOF_JSAMPLE], bx\n\tmov\tWORD [esi+eax*SIZEOF_JSAMPLE], cx\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jisseflt.asm",
    "content": ";\n; jisseflt.asm - floating-point IDCT (SSE & MMX)\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; This file contains a floating-point implementation of the inverse DCT\n; (Discrete Cosine Transform). The following code is based directly on\n; the IJG's original jidctflt.c; see the jidctflt.c for more details.\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n%include \"jdct.inc\"\n\n; --------------------------------------------------------------------------\n\n%macro\tunpcklps2 2\t; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(0 1 4 5)\n\tshufps\t%1,%2,0x44\n%endmacro\n\n%macro\tunpckhps2 2\t; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(2 3 6 7)\n\tshufps\t%1,%2,0xEE\n%endmacro\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_CONST\n\n\talignz\t16\n\tglobal\tEXTN(jconst_idct_float_sse)\n\nEXTN(jconst_idct_float_sse):\n\nPD_1_414\ttimes 4 dd  1.414213562373095048801689\nPD_1_847\ttimes 4 dd  1.847759065022573512256366\nPD_1_082\ttimes 4 dd  1.082392200292393968799446\nPD_M2_613\ttimes 4 dd -2.613125929752753055713286\nPD_0_125\ttimes 4 dd  0.125\t; 1/8\nPB_CENTERJSAMP\ttimes 8 db  CENTERJSAMPLE\n\n\talignz\t16\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Perform dequantization and inverse DCT on one block of coefficients.\n;\n; GLOBAL(void)\n; jsimd_idct_float_sse (void * dct_table, JCOEFPTR coef_block,\n;                       JSAMPARRAY output_buf, JDIMENSION output_col)\n;\n\n%define dct_table(b)\t(b)+8\t\t\t; void * dct_table\n%define coef_block(b)\t(b)+12\t\t; JCOEFPTR coef_block\n%define output_buf(b)\t(b)+16\t\t; JSAMPARRAY output_buf\n%define output_col(b)\t(b)+20\t\t; JDIMENSION output_col\n\n%define original_ebp\tebp+0\n%define wk(i)\t\tebp-(WK_NUM-(i))*SIZEOF_XMMWORD\t; xmmword wk[WK_NUM]\n%define WK_NUM\t\t2\n%define workspace\twk(0)-DCTSIZE2*SIZEOF_FAST_FLOAT\n\t\t\t\t\t; FAST_FLOAT workspace[DCTSIZE2]\n\n\talign\t16\n\tglobal\tEXTN(jsimd_idct_float_sse)\n\nEXTN(jsimd_idct_float_sse):\n\tpush\tebp\n\tmov\teax,esp\t\t\t\t; eax = original ebp\n\tsub\tesp, byte 4\n\tand\tesp, byte (-SIZEOF_XMMWORD)\t; align to 128 bits\n\tmov\t[esp],eax\n\tmov\tebp,esp\t\t\t\t; ebp = aligned ebp\n\tlea\tesp, [workspace]\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n\tpush\tesi\n\tpush\tedi\n\n\tget_GOT\tebx\t\t; get GOT address\n\n\t; ---- Pass 1: process columns from input, store into work array.\n\n;\tmov\teax, [original_ebp]\n\tmov\tedx, POINTER [dct_table(eax)]\t; quantptr\n\tmov\tesi, JCOEFPTR [coef_block(eax)]\t\t; inptr\n\tlea\tedi, [workspace]\t\t\t; FAST_FLOAT * wsptr\n\tmov\tecx, DCTSIZE/4\t\t\t\t; ctr\n\talignx\t16,7\n.columnloop:\n%ifndef NO_ZERO_COLUMN_TEST_FLOAT_SSE\n\tmov\teax, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tor\teax, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tjnz\tnear .columnDCT\n\n\tmovq\tmm0, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tmovq\tmm1, MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm0, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm1, MMWORD [MMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm0, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm1, MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm0, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\tpor\tmm1,mm0\n\tpacksswb mm1,mm1\n\tmovd\teax,mm1\n\ttest\teax,eax\n\tjnz\tshort .columnDCT\n\n\t; -- AC terms all zero\n\n\tmovq      mm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\n\tpunpckhwd mm1,mm0\t\t\t; mm1=(** 02 ** 03)\n\tpunpcklwd mm0,mm0\t\t\t; mm0=(00 00 01 01)\n\tpsrad     mm1,(DWORD_BIT-WORD_BIT)\t; mm1=in0H=(02 03)\n\tpsrad     mm0,(DWORD_BIT-WORD_BIT)\t; mm0=in0L=(00 01)\n\tcvtpi2ps  xmm3,mm1\t\t\t; xmm3=(02 03 ** **)\n\tcvtpi2ps  xmm0,mm0\t\t\t; xmm0=(00 01 ** **)\n\tmovlhps   xmm0,xmm3\t\t\t; xmm0=in0=(00 01 02 03)\n\n\tmulps\txmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n\tmovaps\txmm1,xmm0\n\tmovaps\txmm2,xmm0\n\tmovaps\txmm3,xmm0\n\n\tshufps\txmm0,xmm0,0x00\t\t\t; xmm0=(00 00 00 00)\n\tshufps\txmm1,xmm1,0x55\t\t\t; xmm1=(01 01 01 01)\n\tshufps\txmm2,xmm2,0xAA\t\t\t; xmm2=(02 02 02 02)\n\tshufps\txmm3,xmm3,0xFF\t\t\t; xmm3=(03 03 03 03)\n\n\tmovaps\tXMMWORD [XMMBLOCK(0,0,edi,SIZEOF_FAST_FLOAT)], xmm0\n\tmovaps\tXMMWORD [XMMBLOCK(0,1,edi,SIZEOF_FAST_FLOAT)], xmm0\n\tmovaps\tXMMWORD [XMMBLOCK(1,0,edi,SIZEOF_FAST_FLOAT)], xmm1\n\tmovaps\tXMMWORD [XMMBLOCK(1,1,edi,SIZEOF_FAST_FLOAT)], xmm1\n\tmovaps\tXMMWORD [XMMBLOCK(2,0,edi,SIZEOF_FAST_FLOAT)], xmm2\n\tmovaps\tXMMWORD [XMMBLOCK(2,1,edi,SIZEOF_FAST_FLOAT)], xmm2\n\tmovaps\tXMMWORD [XMMBLOCK(3,0,edi,SIZEOF_FAST_FLOAT)], xmm3\n\tmovaps\tXMMWORD [XMMBLOCK(3,1,edi,SIZEOF_FAST_FLOAT)], xmm3\n\tjmp\tnear .nextcolumn\n\talignx\t16,7\n%endif\n.columnDCT:\n\n\t; -- Even part\n\n\tmovq      mm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_JCOEF)]\n\tmovq      mm1, MMWORD [MMBLOCK(2,0,esi,SIZEOF_JCOEF)]\n\tmovq      mm2, MMWORD [MMBLOCK(4,0,esi,SIZEOF_JCOEF)]\n\tmovq      mm3, MMWORD [MMBLOCK(6,0,esi,SIZEOF_JCOEF)]\n\n\tpunpckhwd mm4,mm0\t\t\t; mm4=(** 02 ** 03)\n\tpunpcklwd mm0,mm0\t\t\t; mm0=(00 00 01 01)\n\tpunpckhwd mm5,mm1\t\t\t; mm5=(** 22 ** 23)\n\tpunpcklwd mm1,mm1\t\t\t; mm1=(20 20 21 21)\n\n\tpsrad     mm4,(DWORD_BIT-WORD_BIT)\t; mm4=in0H=(02 03)\n\tpsrad     mm0,(DWORD_BIT-WORD_BIT)\t; mm0=in0L=(00 01)\n\tcvtpi2ps  xmm4,mm4\t\t\t; xmm4=(02 03 ** **)\n\tcvtpi2ps  xmm0,mm0\t\t\t; xmm0=(00 01 ** **)\n\tpsrad     mm5,(DWORD_BIT-WORD_BIT)\t; mm5=in2H=(22 23)\n\tpsrad     mm1,(DWORD_BIT-WORD_BIT)\t; mm1=in2L=(20 21)\n\tcvtpi2ps  xmm5,mm5\t\t\t; xmm5=(22 23 ** **)\n\tcvtpi2ps  xmm1,mm1\t\t\t; xmm1=(20 21 ** **)\n\n\tpunpckhwd mm6,mm2\t\t\t; mm6=(** 42 ** 43)\n\tpunpcklwd mm2,mm2\t\t\t; mm2=(40 40 41 41)\n\tpunpckhwd mm7,mm3\t\t\t; mm7=(** 62 ** 63)\n\tpunpcklwd mm3,mm3\t\t\t; mm3=(60 60 61 61)\n\n\tpsrad     mm6,(DWORD_BIT-WORD_BIT)\t; mm6=in4H=(42 43)\n\tpsrad     mm2,(DWORD_BIT-WORD_BIT)\t; mm2=in4L=(40 41)\n\tcvtpi2ps  xmm6,mm6\t\t\t; xmm6=(42 43 ** **)\n\tcvtpi2ps  xmm2,mm2\t\t\t; xmm2=(40 41 ** **)\n\tpsrad     mm7,(DWORD_BIT-WORD_BIT)\t; mm7=in6H=(62 63)\n\tpsrad     mm3,(DWORD_BIT-WORD_BIT)\t; mm3=in6L=(60 61)\n\tcvtpi2ps  xmm7,mm7\t\t\t; xmm7=(62 63 ** **)\n\tcvtpi2ps  xmm3,mm3\t\t\t; xmm3=(60 61 ** **)\n\n\tmovlhps   xmm0,xmm4\t\t\t; xmm0=in0=(00 01 02 03)\n\tmovlhps   xmm1,xmm5\t\t\t; xmm1=in2=(20 21 22 23)\n\tmulps     xmm0, XMMWORD [XMMBLOCK(0,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\tmulps     xmm1, XMMWORD [XMMBLOCK(2,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n\tmovlhps   xmm2,xmm6\t\t\t; xmm2=in4=(40 41 42 43)\n\tmovlhps   xmm3,xmm7\t\t\t; xmm3=in6=(60 61 62 63)\n\tmulps     xmm2, XMMWORD [XMMBLOCK(4,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\tmulps     xmm3, XMMWORD [XMMBLOCK(6,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n\tmovaps\txmm4,xmm0\n\tmovaps\txmm5,xmm1\n\tsubps\txmm0,xmm2\t\t; xmm0=tmp11\n\tsubps\txmm1,xmm3\n\taddps\txmm4,xmm2\t\t; xmm4=tmp10\n\taddps\txmm5,xmm3\t\t; xmm5=tmp13\n\n\tmulps\txmm1,[GOTOFF(ebx,PD_1_414)]\n\tsubps\txmm1,xmm5\t\t; xmm1=tmp12\n\n\tmovaps\txmm6,xmm4\n\tmovaps\txmm7,xmm0\n\tsubps\txmm4,xmm5\t\t; xmm4=tmp3\n\tsubps\txmm0,xmm1\t\t; xmm0=tmp2\n\taddps\txmm6,xmm5\t\t; xmm6=tmp0\n\taddps\txmm7,xmm1\t\t; xmm7=tmp1\n\n\tmovaps\tXMMWORD [wk(1)], xmm4\t; tmp3\n\tmovaps\tXMMWORD [wk(0)], xmm0\t; tmp2\n\n\t; -- Odd part\n\n\tmovq      mm4, MMWORD [MMBLOCK(1,0,esi,SIZEOF_JCOEF)]\n\tmovq      mm0, MMWORD [MMBLOCK(3,0,esi,SIZEOF_JCOEF)]\n\tmovq      mm5, MMWORD [MMBLOCK(5,0,esi,SIZEOF_JCOEF)]\n\tmovq      mm1, MMWORD [MMBLOCK(7,0,esi,SIZEOF_JCOEF)]\n\n\tpunpckhwd mm6,mm4\t\t\t; mm6=(** 12 ** 13)\n\tpunpcklwd mm4,mm4\t\t\t; mm4=(10 10 11 11)\n\tpunpckhwd mm2,mm0\t\t\t; mm2=(** 32 ** 33)\n\tpunpcklwd mm0,mm0\t\t\t; mm0=(30 30 31 31)\n\n\tpsrad     mm6,(DWORD_BIT-WORD_BIT)\t; mm6=in1H=(12 13)\n\tpsrad     mm4,(DWORD_BIT-WORD_BIT)\t; mm4=in1L=(10 11)\n\tcvtpi2ps  xmm4,mm6\t\t\t; xmm4=(12 13 ** **)\n\tcvtpi2ps  xmm2,mm4\t\t\t; xmm2=(10 11 ** **)\n\tpsrad     mm2,(DWORD_BIT-WORD_BIT)\t; mm2=in3H=(32 33)\n\tpsrad     mm0,(DWORD_BIT-WORD_BIT)\t; mm0=in3L=(30 31)\n\tcvtpi2ps  xmm0,mm2\t\t\t; xmm0=(32 33 ** **)\n\tcvtpi2ps  xmm3,mm0\t\t\t; xmm3=(30 31 ** **)\n\n\tpunpckhwd mm7,mm5\t\t\t; mm7=(** 52 ** 53)\n\tpunpcklwd mm5,mm5\t\t\t; mm5=(50 50 51 51)\n\tpunpckhwd mm3,mm1\t\t\t; mm3=(** 72 ** 73)\n\tpunpcklwd mm1,mm1\t\t\t; mm1=(70 70 71 71)\n\n\tmovlhps   xmm2,xmm4\t\t\t; xmm2=in1=(10 11 12 13)\n\tmovlhps   xmm3,xmm0\t\t\t; xmm3=in3=(30 31 32 33)\n\n\tpsrad     mm7,(DWORD_BIT-WORD_BIT)\t; mm7=in5H=(52 53)\n\tpsrad     mm5,(DWORD_BIT-WORD_BIT)\t; mm5=in5L=(50 51)\n\tcvtpi2ps  xmm4,mm7\t\t\t; xmm4=(52 53 ** **)\n\tcvtpi2ps  xmm5,mm5\t\t\t; xmm5=(50 51 ** **)\n\tpsrad     mm3,(DWORD_BIT-WORD_BIT)\t; mm3=in7H=(72 73)\n\tpsrad     mm1,(DWORD_BIT-WORD_BIT)\t; mm1=in7L=(70 71)\n\tcvtpi2ps  xmm0,mm3\t\t\t; xmm0=(72 73 ** **)\n\tcvtpi2ps  xmm1,mm1\t\t\t; xmm1=(70 71 ** **)\n\n\tmulps     xmm2, XMMWORD [XMMBLOCK(1,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\tmulps     xmm3, XMMWORD [XMMBLOCK(3,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n\tmovlhps   xmm5,xmm4\t\t\t; xmm5=in5=(50 51 52 53)\n\tmovlhps   xmm1,xmm0\t\t\t; xmm1=in7=(70 71 72 73)\n\tmulps     xmm5, XMMWORD [XMMBLOCK(5,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\tmulps     xmm1, XMMWORD [XMMBLOCK(7,0,edx,SIZEOF_FLOAT_MULT_TYPE)]\n\n\tmovaps\txmm4,xmm2\n\tmovaps\txmm0,xmm5\n\taddps\txmm2,xmm1\t\t; xmm2=z11\n\taddps\txmm5,xmm3\t\t; xmm5=z13\n\tsubps\txmm4,xmm1\t\t; xmm4=z12\n\tsubps\txmm0,xmm3\t\t; xmm0=z10\n\n\tmovaps\txmm1,xmm2\n\tsubps\txmm2,xmm5\n\taddps\txmm1,xmm5\t\t; xmm1=tmp7\n\n\tmulps\txmm2,[GOTOFF(ebx,PD_1_414)]\t; xmm2=tmp11\n\n\tmovaps\txmm3,xmm0\n\taddps\txmm0,xmm4\n\tmulps\txmm0,[GOTOFF(ebx,PD_1_847)]\t; xmm0=z5\n\tmulps\txmm3,[GOTOFF(ebx,PD_M2_613)]\t; xmm3=(z10 * -2.613125930)\n\tmulps\txmm4,[GOTOFF(ebx,PD_1_082)]\t; xmm4=(z12 * 1.082392200)\n\taddps\txmm3,xmm0\t\t; xmm3=tmp12\n\tsubps\txmm4,xmm0\t\t; xmm4=tmp10\n\n\t; -- Final output stage\n\n\tsubps\txmm3,xmm1\t\t; xmm3=tmp6\n\tmovaps\txmm5,xmm6\n\tmovaps\txmm0,xmm7\n\taddps\txmm6,xmm1\t\t; xmm6=data0=(00 01 02 03)\n\taddps\txmm7,xmm3\t\t; xmm7=data1=(10 11 12 13)\n\tsubps\txmm5,xmm1\t\t; xmm5=data7=(70 71 72 73)\n\tsubps\txmm0,xmm3\t\t; xmm0=data6=(60 61 62 63)\n\tsubps\txmm2,xmm3\t\t; xmm2=tmp5\n\n\tmovaps    xmm1,xmm6\t\t; transpose coefficients(phase 1)\n\tunpcklps  xmm6,xmm7\t\t; xmm6=(00 10 01 11)\n\tunpckhps  xmm1,xmm7\t\t; xmm1=(02 12 03 13)\n\tmovaps    xmm3,xmm0\t\t; transpose coefficients(phase 1)\n\tunpcklps  xmm0,xmm5\t\t; xmm0=(60 70 61 71)\n\tunpckhps  xmm3,xmm5\t\t; xmm3=(62 72 63 73)\n\n\tmovaps\txmm7, XMMWORD [wk(0)]\t; xmm7=tmp2\n\tmovaps\txmm5, XMMWORD [wk(1)]\t; xmm5=tmp3\n\n\tmovaps\tXMMWORD [wk(0)], xmm0\t; wk(0)=(60 70 61 71)\n\tmovaps\tXMMWORD [wk(1)], xmm3\t; wk(1)=(62 72 63 73)\n\n\taddps\txmm4,xmm2\t\t; xmm4=tmp4\n\tmovaps\txmm0,xmm7\n\tmovaps\txmm3,xmm5\n\taddps\txmm7,xmm2\t\t; xmm7=data2=(20 21 22 23)\n\taddps\txmm5,xmm4\t\t; xmm5=data4=(40 41 42 43)\n\tsubps\txmm0,xmm2\t\t; xmm0=data5=(50 51 52 53)\n\tsubps\txmm3,xmm4\t\t; xmm3=data3=(30 31 32 33)\n\n\tmovaps    xmm2,xmm7\t\t; transpose coefficients(phase 1)\n\tunpcklps  xmm7,xmm3\t\t; xmm7=(20 30 21 31)\n\tunpckhps  xmm2,xmm3\t\t; xmm2=(22 32 23 33)\n\tmovaps    xmm4,xmm5\t\t; transpose coefficients(phase 1)\n\tunpcklps  xmm5,xmm0\t\t; xmm5=(40 50 41 51)\n\tunpckhps  xmm4,xmm0\t\t; xmm4=(42 52 43 53)\n\n\tmovaps    xmm3,xmm6\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm6,xmm7\t\t; xmm6=(00 10 20 30)\n\tunpckhps2 xmm3,xmm7\t\t; xmm3=(01 11 21 31)\n\tmovaps    xmm0,xmm1\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm1,xmm2\t\t; xmm1=(02 12 22 32)\n\tunpckhps2 xmm0,xmm2\t\t; xmm0=(03 13 23 33)\n\n\tmovaps\txmm7, XMMWORD [wk(0)]\t; xmm7=(60 70 61 71)\n\tmovaps\txmm2, XMMWORD [wk(1)]\t; xmm2=(62 72 63 73)\n\n\tmovaps\tXMMWORD [XMMBLOCK(0,0,edi,SIZEOF_FAST_FLOAT)], xmm6\n\tmovaps\tXMMWORD [XMMBLOCK(1,0,edi,SIZEOF_FAST_FLOAT)], xmm3\n\tmovaps\tXMMWORD [XMMBLOCK(2,0,edi,SIZEOF_FAST_FLOAT)], xmm1\n\tmovaps\tXMMWORD [XMMBLOCK(3,0,edi,SIZEOF_FAST_FLOAT)], xmm0\n\n\tmovaps    xmm6,xmm5\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm5,xmm7\t\t; xmm5=(40 50 60 70)\n\tunpckhps2 xmm6,xmm7\t\t; xmm6=(41 51 61 71)\n\tmovaps    xmm3,xmm4\t\t; transpose coefficients(phase 2)\n\tunpcklps2 xmm4,xmm2\t\t; xmm4=(42 52 62 72)\n\tunpckhps2 xmm3,xmm2\t\t; xmm3=(43 53 63 73)\n\n\tmovaps\tXMMWORD [XMMBLOCK(0,1,edi,SIZEOF_FAST_FLOAT)], xmm5\n\tmovaps\tXMMWORD [XMMBLOCK(1,1,edi,SIZEOF_FAST_FLOAT)], xmm6\n\tmovaps\tXMMWORD [XMMBLOCK(2,1,edi,SIZEOF_FAST_FLOAT)], xmm4\n\tmovaps\tXMMWORD [XMMBLOCK(3,1,edi,SIZEOF_FAST_FLOAT)], xmm3\n\n.nextcolumn:\n\tadd\tesi, byte 4*SIZEOF_JCOEF\t\t; coef_block\n\tadd\tedx, byte 4*SIZEOF_FLOAT_MULT_TYPE\t; quantptr\n\tadd\tedi,      4*DCTSIZE*SIZEOF_FAST_FLOAT\t; wsptr\n\tdec\tecx\t\t\t\t\t; ctr\n\tjnz\tnear .columnloop\n\n\t; -- Prefetch the next coefficient block\n\n\tprefetchnta [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 0*32]\n\tprefetchnta [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 1*32]\n\tprefetchnta [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 2*32]\n\tprefetchnta [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 3*32]\n\n\t; ---- Pass 2: process rows from work array, store into output array.\n\n\tmov\teax, [original_ebp]\n\tlea\tesi, [workspace]\t\t\t; FAST_FLOAT * wsptr\n\tmov\tedi, JSAMPARRAY [output_buf(eax)]\t; (JSAMPROW *)\n\tmov\teax, JDIMENSION [output_col(eax)]\n\tmov\tecx, DCTSIZE/4\t\t\t\t; ctr\n\talignx\t16,7\n.rowloop:\n\n\t; -- Even part\n\n\tmovaps\txmm0, XMMWORD [XMMBLOCK(0,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm1, XMMWORD [XMMBLOCK(2,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm2, XMMWORD [XMMBLOCK(4,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm3, XMMWORD [XMMBLOCK(6,0,esi,SIZEOF_FAST_FLOAT)]\n\n\tmovaps\txmm4,xmm0\n\tmovaps\txmm5,xmm1\n\tsubps\txmm0,xmm2\t\t; xmm0=tmp11\n\tsubps\txmm1,xmm3\n\taddps\txmm4,xmm2\t\t; xmm4=tmp10\n\taddps\txmm5,xmm3\t\t; xmm5=tmp13\n\n\tmulps\txmm1,[GOTOFF(ebx,PD_1_414)]\n\tsubps\txmm1,xmm5\t\t; xmm1=tmp12\n\n\tmovaps\txmm6,xmm4\n\tmovaps\txmm7,xmm0\n\tsubps\txmm4,xmm5\t\t; xmm4=tmp3\n\tsubps\txmm0,xmm1\t\t; xmm0=tmp2\n\taddps\txmm6,xmm5\t\t; xmm6=tmp0\n\taddps\txmm7,xmm1\t\t; xmm7=tmp1\n\n\tmovaps\tXMMWORD [wk(1)], xmm4\t; tmp3\n\tmovaps\tXMMWORD [wk(0)], xmm0\t; tmp2\n\n\t; -- Odd part\n\n\tmovaps\txmm2, XMMWORD [XMMBLOCK(1,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm3, XMMWORD [XMMBLOCK(3,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm5, XMMWORD [XMMBLOCK(5,0,esi,SIZEOF_FAST_FLOAT)]\n\tmovaps\txmm1, XMMWORD [XMMBLOCK(7,0,esi,SIZEOF_FAST_FLOAT)]\n\n\tmovaps\txmm4,xmm2\n\tmovaps\txmm0,xmm5\n\taddps\txmm2,xmm1\t\t; xmm2=z11\n\taddps\txmm5,xmm3\t\t; xmm5=z13\n\tsubps\txmm4,xmm1\t\t; xmm4=z12\n\tsubps\txmm0,xmm3\t\t; xmm0=z10\n\n\tmovaps\txmm1,xmm2\n\tsubps\txmm2,xmm5\n\taddps\txmm1,xmm5\t\t; xmm1=tmp7\n\n\tmulps\txmm2,[GOTOFF(ebx,PD_1_414)]\t; xmm2=tmp11\n\n\tmovaps\txmm3,xmm0\n\taddps\txmm0,xmm4\n\tmulps\txmm0,[GOTOFF(ebx,PD_1_847)]\t; xmm0=z5\n\tmulps\txmm3,[GOTOFF(ebx,PD_M2_613)]\t; xmm3=(z10 * -2.613125930)\n\tmulps\txmm4,[GOTOFF(ebx,PD_1_082)]\t; xmm4=(z12 * 1.082392200)\n\taddps\txmm3,xmm0\t\t; xmm3=tmp12\n\tsubps\txmm4,xmm0\t\t; xmm4=tmp10\n\n\t; -- Final output stage\n\n\tsubps\txmm3,xmm1\t\t; xmm3=tmp6\n\tmovaps\txmm5,xmm6\n\tmovaps\txmm0,xmm7\n\taddps\txmm6,xmm1\t\t; xmm6=data0=(00 10 20 30)\n\taddps\txmm7,xmm3\t\t; xmm7=data1=(01 11 21 31)\n\tsubps\txmm5,xmm1\t\t; xmm5=data7=(07 17 27 37)\n\tsubps\txmm0,xmm3\t\t; xmm0=data6=(06 16 26 36)\n\tsubps\txmm2,xmm3\t\t; xmm2=tmp5\n\n\tmovaps\txmm1,[GOTOFF(ebx,PD_0_125)]\t; xmm1=[PD_0_125]\n\n\tmulps\txmm6,xmm1\t\t; descale(1/8)\n\tmulps\txmm7,xmm1\t\t; descale(1/8)\n\tmulps\txmm5,xmm1\t\t; descale(1/8)\n\tmulps\txmm0,xmm1\t\t; descale(1/8)\n\n\tmovhlps   xmm3,xmm6\n\tmovhlps   xmm1,xmm7\n\tcvtps2pi  mm0,xmm6\t\t; round to int32, mm0=data0L=(00 10)\n\tcvtps2pi  mm1,xmm7\t\t; round to int32, mm1=data1L=(01 11)\n\tcvtps2pi  mm2,xmm3\t\t; round to int32, mm2=data0H=(20 30)\n\tcvtps2pi  mm3,xmm1\t\t; round to int32, mm3=data1H=(21 31)\n\tpackssdw  mm0,mm2\t\t; mm0=data0=(00 10 20 30)\n\tpackssdw  mm1,mm3\t\t; mm1=data1=(01 11 21 31)\n\n\tmovhlps   xmm6,xmm5\n\tmovhlps   xmm7,xmm0\n\tcvtps2pi  mm4,xmm5\t\t; round to int32, mm4=data7L=(07 17)\n\tcvtps2pi  mm5,xmm0\t\t; round to int32, mm5=data6L=(06 16)\n\tcvtps2pi  mm6,xmm6\t\t; round to int32, mm6=data7H=(27 37)\n\tcvtps2pi  mm7,xmm7\t\t; round to int32, mm7=data6H=(26 36)\n\tpackssdw  mm4,mm6\t\t; mm4=data7=(07 17 27 37)\n\tpackssdw  mm5,mm7\t\t; mm5=data6=(06 16 26 36)\n\n\tpacksswb  mm0,mm5\t\t; mm0=(00 10 20 30 06 16 26 36)\n\tpacksswb  mm1,mm4\t\t; mm1=(01 11 21 31 07 17 27 37)\n\n\tmovaps\txmm3, XMMWORD [wk(0)]\t; xmm3=tmp2\n\tmovaps\txmm1, XMMWORD [wk(1)]\t; xmm1=tmp3\n\n\tmovaps\txmm6,[GOTOFF(ebx,PD_0_125)]\t; xmm6=[PD_0_125]\n\n\taddps\txmm4,xmm2\t\t; xmm4=tmp4\n\tmovaps\txmm5,xmm3\n\tmovaps\txmm0,xmm1\n\taddps\txmm3,xmm2\t\t; xmm3=data2=(02 12 22 32)\n\taddps\txmm1,xmm4\t\t; xmm1=data4=(04 14 24 34)\n\tsubps\txmm5,xmm2\t\t; xmm5=data5=(05 15 25 35)\n\tsubps\txmm0,xmm4\t\t; xmm0=data3=(03 13 23 33)\n\n\tmulps\txmm3,xmm6\t\t; descale(1/8)\n\tmulps\txmm1,xmm6\t\t; descale(1/8)\n\tmulps\txmm5,xmm6\t\t; descale(1/8)\n\tmulps\txmm0,xmm6\t\t; descale(1/8)\n\n\tmovhlps   xmm7,xmm3\n\tmovhlps   xmm2,xmm1\n\tcvtps2pi  mm2,xmm3\t\t; round to int32, mm2=data2L=(02 12)\n\tcvtps2pi  mm3,xmm1\t\t; round to int32, mm3=data4L=(04 14)\n\tcvtps2pi  mm6,xmm7\t\t; round to int32, mm6=data2H=(22 32)\n\tcvtps2pi  mm7,xmm2\t\t; round to int32, mm7=data4H=(24 34)\n\tpackssdw  mm2,mm6\t\t; mm2=data2=(02 12 22 32)\n\tpackssdw  mm3,mm7\t\t; mm3=data4=(04 14 24 34)\n\n\tmovhlps   xmm4,xmm5\n\tmovhlps   xmm6,xmm0\n\tcvtps2pi  mm5,xmm5\t\t; round to int32, mm5=data5L=(05 15)\n\tcvtps2pi  mm4,xmm0\t\t; round to int32, mm4=data3L=(03 13)\n\tcvtps2pi  mm6,xmm4\t\t; round to int32, mm6=data5H=(25 35)\n\tcvtps2pi  mm7,xmm6\t\t; round to int32, mm7=data3H=(23 33)\n\tpackssdw  mm5,mm6\t\t; mm5=data5=(05 15 25 35)\n\tpackssdw  mm4,mm7\t\t; mm4=data3=(03 13 23 33)\n\n\tmovq      mm6,[GOTOFF(ebx,PB_CENTERJSAMP)]\t; mm6=[PB_CENTERJSAMP]\n\n\tpacksswb  mm2,mm3\t\t; mm2=(02 12 22 32 04 14 24 34)\n\tpacksswb  mm4,mm5\t\t; mm4=(03 13 23 33 05 15 25 35)\n\n\tpaddb     mm0,mm6\n\tpaddb     mm1,mm6\n\tpaddb     mm2,mm6\n\tpaddb     mm4,mm6\n\n\tmovq      mm7,mm0\t\t; transpose coefficients(phase 1)\n\tpunpcklbw mm0,mm1\t\t; mm0=(00 01 10 11 20 21 30 31)\n\tpunpckhbw mm7,mm1\t\t; mm7=(06 07 16 17 26 27 36 37)\n\tmovq      mm3,mm2\t\t; transpose coefficients(phase 1)\n\tpunpcklbw mm2,mm4\t\t; mm2=(02 03 12 13 22 23 32 33)\n\tpunpckhbw mm3,mm4\t\t; mm3=(04 05 14 15 24 25 34 35)\n\n\tmovq      mm5,mm0\t\t; transpose coefficients(phase 2)\n\tpunpcklwd mm0,mm2\t\t; mm0=(00 01 02 03 10 11 12 13)\n\tpunpckhwd mm5,mm2\t\t; mm5=(20 21 22 23 30 31 32 33)\n\tmovq      mm6,mm3\t\t; transpose coefficients(phase 2)\n\tpunpcklwd mm3,mm7\t\t; mm3=(04 05 06 07 14 15 16 17)\n\tpunpckhwd mm6,mm7\t\t; mm6=(24 25 26 27 34 35 36 37)\n\n\tmovq      mm1,mm0\t\t; transpose coefficients(phase 3)\n\tpunpckldq mm0,mm3\t\t; mm0=(00 01 02 03 04 05 06 07)\n\tpunpckhdq mm1,mm3\t\t; mm1=(10 11 12 13 14 15 16 17)\n\tmovq      mm4,mm5\t\t; transpose coefficients(phase 3)\n\tpunpckldq mm5,mm6\t\t; mm5=(20 21 22 23 24 25 26 27)\n\tpunpckhdq mm4,mm6\t\t; mm4=(30 31 32 33 34 35 36 37)\n\n\tpushpic\tebx\t\t\t; save GOT address\n\n\tmov\tedx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]\n\tmov\tebx, JSAMPROW [edi+1*SIZEOF_JSAMPROW]\n\tmovq\tMMWORD [edx+eax*SIZEOF_JSAMPLE], mm0\n\tmovq\tMMWORD [ebx+eax*SIZEOF_JSAMPLE], mm1\n\tmov\tedx, JSAMPROW [edi+2*SIZEOF_JSAMPROW]\n\tmov\tebx, JSAMPROW [edi+3*SIZEOF_JSAMPROW]\n\tmovq\tMMWORD [edx+eax*SIZEOF_JSAMPLE], mm5\n\tmovq\tMMWORD [ebx+eax*SIZEOF_JSAMPLE], mm4\n\n\tpoppic\tebx\t\t\t; restore GOT address\n\n\tadd\tesi, byte 4*SIZEOF_FAST_FLOAT\t; wsptr\n\tadd\tedi, byte 4*SIZEOF_JSAMPROW\n\tdec\tecx\t\t\t\t; ctr\n\tjnz\tnear .rowloop\n\n\temms\t\t; empty MMX state\n\n\tpop\tedi\n\tpop\tesi\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tmov\tesp,ebp\t\t; esp <- aligned ebp\n\tpop\tesp\t\t; esp <- original ebp\n\tpop\tebp\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jsimd.h",
    "content": "/*\n * simd/jsimd.h\n *\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright 2011 D. R. Commander\n * \n * Based on the x86 SIMD extension for IJG JPEG library,\n * Copyright (C) 1999-2006, MIYASAKA Masaru.\n * For conditions of distribution and use, see copyright notice in jsimdext.inc\n *\n */\n\n/* Bitmask for supported acceleration methods */\n\n#define JSIMD_NONE       0x00\n#define JSIMD_MMX        0x01\n#define JSIMD_3DNOW      0x02\n#define JSIMD_SSE        0x04\n#define JSIMD_SSE2       0x08\n#define JSIMD_ARM_NEON   0x10\n\n/* Short forms of external names for systems with brain-damaged linkers. */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jpeg_simd_cpu_support                 jSiCpuSupport\n#define jsimd_rgb_ycc_convert_mmx             jSRGBYCCM\n#define jsimd_extrgb_ycc_convert_mmx          jSEXTRGBYCCM\n#define jsimd_extrgbx_ycc_convert_mmx         jSEXTRGBXYCCM\n#define jsimd_extbgr_ycc_convert_mmx          jSEXTBGRYCCM\n#define jsimd_extbgrx_ycc_convert_mmx         jSEXTBGRXYCCM\n#define jsimd_extxbgr_ycc_convert_mmx         jSEXTXBGRYCCM\n#define jsimd_extxrgb_ycc_convert_mmx         jSEXTXRGBYCCM\n#define jsimd_rgb_gray_convert_mmx            jSRGBGRYM\n#define jsimd_extrgb_gray_convert_mmx         jSEXTRGBGRYM\n#define jsimd_extrgbx_gray_convert_mmx        jSEXTRGBXGRYM\n#define jsimd_extbgr_gray_convert_mmx         jSEXTBGRGRYM\n#define jsimd_extbgrx_gray_convert_mmx        jSEXTBGRXGRYM\n#define jsimd_extxbgr_gray_convert_mmx        jSEXTXBGRGRYM\n#define jsimd_extxrgb_gray_convert_mmx        jSEXTXRGBGRYM\n#define jsimd_ycc_rgb_convert_mmx             jSYCCRGBM\n#define jsimd_ycc_extrgb_convert_mmx          jSYCCEXTRGBM\n#define jsimd_ycc_extrgbx_convert_mmx         jSYCCEXTRGBXM\n#define jsimd_ycc_extbgr_convert_mmx          jSYCCEXTBGRM\n#define jsimd_ycc_extbgrx_convert_mmx         jSYCCEXTBGRXM\n#define jsimd_ycc_extxbgr_convert_mmx         jSYCCEXTXBGRM\n#define jsimd_ycc_extxrgb_convert_mmx         jSYCCEXTXRGBM\n#define jconst_rgb_ycc_convert_sse2           jSCRGBYCCS2\n#define jsimd_rgb_ycc_convert_sse2            jSRGBYCCS2\n#define jsimd_extrgb_ycc_convert_sse2         jSEXTRGBYCCS2\n#define jsimd_extrgbx_ycc_convert_sse2        jSEXTRGBXYCCS2\n#define jsimd_extbgr_ycc_convert_sse2         jSEXTBGRYCCS2\n#define jsimd_extbgrx_ycc_convert_sse2        jSEXTBGRXYCCS2\n#define jsimd_extxbgr_ycc_convert_sse2        jSEXTXBGRYCCS2\n#define jsimd_extxrgb_ycc_convert_sse2        jSEXTXRGBYCCS2\n#define jconst_rgb_gray_convert_sse2          jSCRGBGRYS2\n#define jsimd_rgb_gray_convert_sse2           jSRGBGRYS2\n#define jsimd_extrgb_gray_convert_sse2        jSEXTRGBGRYS2\n#define jsimd_extrgbx_gray_convert_sse2       jSEXTRGBXGRYS2\n#define jsimd_extbgr_gray_convert_sse2        jSEXTBGRGRYS2\n#define jsimd_extbgrx_gray_convert_sse2       jSEXTBGRXGRYS2\n#define jsimd_extxbgr_gray_convert_sse2       jSEXTXBGRGRYS2\n#define jsimd_extxrgb_gray_convert_sse2       jSEXTXRGBGRYS2\n#define jconst_ycc_rgb_convert_sse2           jSCYCCRGBS2\n#define jsimd_ycc_rgb_convert_sse2            jSYCCRGBS2\n#define jsimd_ycc_extrgb_convert_sse2         jSYCCEXTRGBS2\n#define jsimd_ycc_extrgbx_convert_sse2        jSYCCEXTRGBXS2\n#define jsimd_ycc_extbgr_convert_sse2         jSYCCEXTBGRS2\n#define jsimd_ycc_extbgrx_convert_sse2        jSYCCEXTBGRXS2\n#define jsimd_ycc_extxbgr_convert_sse2        jSYCCEXTXBGRS2\n#define jsimd_ycc_extxrgb_convert_sse2        jSYCCEXTXRGBS2\n#define jsimd_h2v2_downsample_mmx             jSDnH2V2M\n#define jsimd_h2v1_downsample_mmx             jSDnH2V1M\n#define jsimd_h2v2_downsample_sse2            jSDnH2V2S2\n#define jsimd_h2v1_downsample_sse2            jSDnH2V1S2\n#define jsimd_h2v2_upsample_mmx               jSUpH2V2M\n#define jsimd_h2v1_upsample_mmx               jSUpH2V1M\n#define jsimd_h2v2_fancy_upsample_mmx         jSFUpH2V2M\n#define jsimd_h2v1_fancy_upsample_mmx         jSFUpH2V1M\n#define jsimd_h2v2_merged_upsample_mmx        jSMUpH2V2M\n#define jsimd_h2v2_extrgb_merged_upsample_mmx jSMUpH2V2EXTRGBM\n#define jsimd_h2v2_extrgbx_merged_upsample_mmx jSMUpH2V2EXTRGBXM\n#define jsimd_h2v2_extbgr_merged_upsample_mmx jSMUpH2V2EXTBGRM\n#define jsimd_h2v2_extbgrx_merged_upsample_mmx jSMUpH2V2EXTBGRXM\n#define jsimd_h2v2_extxbgr_merged_upsample_mmx jSMUpH2V2EXTXBGRM\n#define jsimd_h2v2_extxrgb_merged_upsample_mmx jSMUpH2V2EXTXRGBM\n#define jsimd_h2v1_merged_upsample_mmx        jSMUpH2V1M\n#define jsimd_h2v1_extrgb_merged_upsample_mmx jSMUpH2V1EXTRGBM\n#define jsimd_h2v1_extrgbx_merged_upsample_mmx jSMUpH2V1EXTRGBXM\n#define jsimd_h2v1_extbgr_merged_upsample_mmx jSMUpH2V1EXTBGRM\n#define jsimd_h2v1_extbgrx_merged_upsample_mmx jSMUpH2V1EXTBGRXM\n#define jsimd_h2v1_extxbgr_merged_upsample_mmx jSMUpH2V1EXTXBGRM\n#define jsimd_h2v1_extxrgb_merged_upsample_mmx jSMUpH2V1EXTXRGBM\n#define jsimd_h2v2_upsample_sse2              jSUpH2V2S2\n#define jsimd_h2v1_upsample_sse2              jSUpH2V1S2\n#define jconst_fancy_upsample_sse2            jSCFUpS2\n#define jsimd_h2v2_fancy_upsample_sse2        jSFUpH2V2S2\n#define jsimd_h2v1_fancy_upsample_sse2        jSFUpH2V1S2\n#define jconst_merged_upsample_sse2           jSCMUpS2\n#define jsimd_h2v2_merged_upsample_sse2       jSMUpH2V2S2\n#define jsimd_h2v2_extrgb_merged_upsample_sse2 jSMUpH2V2EXTRGBS2\n#define jsimd_h2v2_extrgbx_merged_upsample_sse2 jSMUpH2V2EXTRGBXS2\n#define jsimd_h2v2_extbgr_merged_upsample_sse2 jSMUpH2V2EXTBGRS2\n#define jsimd_h2v2_extbgrx_merged_upsample_sse2 jSMUpH2V2EXTBGRXS2\n#define jsimd_h2v2_extxbgr_merged_upsample_sse2 jSMUpH2V2EXTXBGRS2\n#define jsimd_h2v2_extxrgb_merged_upsample_sse2 jSMUpH2V2EXTXRGBS2\n#define jsimd_h2v1_merged_upsample_sse2       jSMUpH2V1S2\n#define jsimd_h2v1_extrgb_merged_upsample_sse2 jSMUpH2V1EXTRGBS2\n#define jsimd_h2v1_extrgbx_merged_upsample_sse2 jSMUpH2V1EXTRGBXS2\n#define jsimd_h2v1_extbgr_merged_upsample_sse2 jSMUpH2V1EXTBGRS2\n#define jsimd_h2v1_extbgrx_merged_upsample_sse2 jSMUpH2V1EXTBGRXS2\n#define jsimd_h2v1_extxbgr_merged_upsample_sse2 jSMUpH2V1EXTXBGRS2\n#define jsimd_h2v1_extxrgb_merged_upsample_sse2 jSMUpH2V1EXTXRGBS2\n#define jsimd_convsamp_mmx                    jSConvM\n#define jsimd_convsamp_sse2                   jSConvS2\n#define jsimd_convsamp_float_3dnow            jSConvF3D\n#define jsimd_convsamp_float_sse              jSConvFS\n#define jsimd_convsamp_float_sse2             jSConvFS2\n#define jsimd_fdct_islow_mmx                  jSFDMIS\n#define jsimd_fdct_ifast_mmx                  jSFDMIF\n#define jconst_fdct_islow_sse2                jSCFDS2IS\n#define jsimd_fdct_islow_sse2                 jSFDS2IS\n#define jconst_fdct_ifast_sse2                jSCFDS2IF\n#define jsimd_fdct_ifast_sse2                 jSFDS2IF\n#define jsimd_fdct_float_3dnow                jSFD3DF\n#define jconst_fdct_float_sse                 jSCFDSF\n#define jsimd_fdct_float_sse                  jSFDSF\n#define jsimd_quantize_mmx                    jSQuantM\n#define jsimd_quantize_sse2                   jSQuantS2\n#define jsimd_quantize_float_3dnow            jSQuantF3D\n#define jsimd_quantize_float_sse              jSQuantFS\n#define jsimd_quantize_float_sse2             jSQuantFS2\n#define jsimd_idct_2x2_mmx                    jSIDM22\n#define jsimd_idct_4x4_mmx                    jSIDM44\n#define jconst_idct_red_sse2                  jSCIDS2R\n#define jsimd_idct_2x2_sse2                   jSIDS222\n#define jsimd_idct_4x4_sse2                   jSIDS244\n#define jsimd_idct_islow_mmx                  jSIDMIS\n#define jsimd_idct_ifast_mmx                  jSIDMIF\n#define jconst_idct_islow_sse2                jSCIDS2IS\n#define jsimd_idct_islow_sse2                 jSIDS2IS\n#define jconst_idct_ifast_sse2                jSCIDS2IF\n#define jsimd_idct_ifast_sse2                 jSIDS2IF\n#define jsimd_idct_float_3dnow                jSID3DF\n#define jconst_fdct_float_sse                 jSCIDSF\n#define jsimd_idct_float_sse                  jSIDSF\n#define jconst_fdct_float_sse2                jSCIDS2F\n#define jsimd_idct_float_sse2                 jSIDS2F\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\n/* SIMD Ext: retrieve SIMD/CPU information */\nEXTERN(unsigned int) jpeg_simd_cpu_support JPP((void));\n\n/* SIMD Color Space Conversion */\nEXTERN(void) jsimd_rgb_ycc_convert_mmx\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extrgb_ycc_convert_mmx\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extrgbx_ycc_convert_mmx\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extbgr_ycc_convert_mmx\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extbgrx_ycc_convert_mmx\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extxbgr_ycc_convert_mmx\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extxrgb_ycc_convert_mmx\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\n\nEXTERN(void) jsimd_rgb_gray_convert_mmx\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extrgb_gray_convert_mmx\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extrgbx_gray_convert_mmx\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extbgr_gray_convert_mmx\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extbgrx_gray_convert_mmx\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extxbgr_gray_convert_mmx\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extxrgb_gray_convert_mmx\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\n\nEXTERN(void) jsimd_ycc_rgb_convert_mmx\n        JPP((JDIMENSION out_width,\n             JSAMPIMAGE input_buf, JDIMENSION input_row,\n             JSAMPARRAY output_buf, int num_rows));\nEXTERN(void) jsimd_ycc_extrgb_convert_mmx\n        JPP((JDIMENSION out_width,\n             JSAMPIMAGE input_buf, JDIMENSION input_row,\n             JSAMPARRAY output_buf, int num_rows));\nEXTERN(void) jsimd_ycc_extrgbx_convert_mmx\n        JPP((JDIMENSION out_width,\n             JSAMPIMAGE input_buf, JDIMENSION input_row,\n             JSAMPARRAY output_buf, int num_rows));\nEXTERN(void) jsimd_ycc_extbgr_convert_mmx\n        JPP((JDIMENSION out_width,\n             JSAMPIMAGE input_buf, JDIMENSION input_row,\n             JSAMPARRAY output_buf, int num_rows));\nEXTERN(void) jsimd_ycc_extbgrx_convert_mmx\n        JPP((JDIMENSION out_width,\n             JSAMPIMAGE input_buf, JDIMENSION input_row,\n             JSAMPARRAY output_buf, int num_rows));\nEXTERN(void) jsimd_ycc_extxbgr_convert_mmx\n        JPP((JDIMENSION out_width,\n             JSAMPIMAGE input_buf, JDIMENSION input_row,\n             JSAMPARRAY output_buf, int num_rows));\nEXTERN(void) jsimd_ycc_extxrgb_convert_mmx\n        JPP((JDIMENSION out_width,\n             JSAMPIMAGE input_buf, JDIMENSION input_row,\n             JSAMPARRAY output_buf, int num_rows));\n\nextern const int jconst_rgb_ycc_convert_sse2[];\nEXTERN(void) jsimd_rgb_ycc_convert_sse2\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extrgb_ycc_convert_sse2\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extrgbx_ycc_convert_sse2\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extbgr_ycc_convert_sse2\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extbgrx_ycc_convert_sse2\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extxbgr_ycc_convert_sse2\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extxrgb_ycc_convert_sse2\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\n\nextern const int jconst_rgb_gray_convert_sse2[];\nEXTERN(void) jsimd_rgb_gray_convert_sse2\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extrgb_gray_convert_sse2\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extrgbx_gray_convert_sse2\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extbgr_gray_convert_sse2\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extbgrx_gray_convert_sse2\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extxbgr_gray_convert_sse2\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extxrgb_gray_convert_sse2\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\n\nextern const int jconst_ycc_rgb_convert_sse2[];\nEXTERN(void) jsimd_ycc_rgb_convert_sse2\n        JPP((JDIMENSION out_width,\n             JSAMPIMAGE input_buf, JDIMENSION input_row,\n             JSAMPARRAY output_buf, int num_rows));\nEXTERN(void) jsimd_ycc_extrgb_convert_sse2\n        JPP((JDIMENSION out_width,\n             JSAMPIMAGE input_buf, JDIMENSION input_row,\n             JSAMPARRAY output_buf, int num_rows));\nEXTERN(void) jsimd_ycc_extrgbx_convert_sse2\n        JPP((JDIMENSION out_width,\n             JSAMPIMAGE input_buf, JDIMENSION input_row,\n             JSAMPARRAY output_buf, int num_rows));\nEXTERN(void) jsimd_ycc_extbgr_convert_sse2\n        JPP((JDIMENSION out_width,\n             JSAMPIMAGE input_buf, JDIMENSION input_row,\n             JSAMPARRAY output_buf, int num_rows));\nEXTERN(void) jsimd_ycc_extbgrx_convert_sse2\n        JPP((JDIMENSION out_width,\n             JSAMPIMAGE input_buf, JDIMENSION input_row,\n             JSAMPARRAY output_buf, int num_rows));\nEXTERN(void) jsimd_ycc_extxbgr_convert_sse2\n        JPP((JDIMENSION out_width,\n             JSAMPIMAGE input_buf, JDIMENSION input_row,\n             JSAMPARRAY output_buf, int num_rows));\nEXTERN(void) jsimd_ycc_extxrgb_convert_sse2\n        JPP((JDIMENSION out_width,\n             JSAMPIMAGE input_buf, JDIMENSION input_row,\n             JSAMPARRAY output_buf, int num_rows));\n\nEXTERN(void) jsimd_rgb_ycc_convert_neon\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extrgb_ycc_convert_neon\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extrgbx_ycc_convert_neon\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extbgr_ycc_convert_neon\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extbgrx_ycc_convert_neon\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extxbgr_ycc_convert_neon\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\nEXTERN(void) jsimd_extxrgb_ycc_convert_neon\n        JPP((JDIMENSION img_width,\n             JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n             JDIMENSION output_row, int num_rows));\n\nEXTERN(void) jsimd_ycc_rgb_convert_neon\n        JPP((JDIMENSION out_width,\n             JSAMPIMAGE input_buf, JDIMENSION input_row,\n             JSAMPARRAY output_buf, int num_rows));\nEXTERN(void) jsimd_ycc_extrgb_convert_neon\n        JPP((JDIMENSION out_width,\n             JSAMPIMAGE input_buf, JDIMENSION input_row,\n             JSAMPARRAY output_buf, int num_rows));\nEXTERN(void) jsimd_ycc_extrgbx_convert_neon\n        JPP((JDIMENSION out_width,\n             JSAMPIMAGE input_buf, JDIMENSION input_row,\n             JSAMPARRAY output_buf, int num_rows));\nEXTERN(void) jsimd_ycc_extbgr_convert_neon\n        JPP((JDIMENSION out_width,\n             JSAMPIMAGE input_buf, JDIMENSION input_row,\n             JSAMPARRAY output_buf, int num_rows));\nEXTERN(void) jsimd_ycc_extbgrx_convert_neon\n        JPP((JDIMENSION out_width,\n             JSAMPIMAGE input_buf, JDIMENSION input_row,\n             JSAMPARRAY output_buf, int num_rows));\nEXTERN(void) jsimd_ycc_extxbgr_convert_neon\n        JPP((JDIMENSION out_width,\n             JSAMPIMAGE input_buf, JDIMENSION input_row,\n             JSAMPARRAY output_buf, int num_rows));\nEXTERN(void) jsimd_ycc_extxrgb_convert_neon\n        JPP((JDIMENSION out_width,\n             JSAMPIMAGE input_buf, JDIMENSION input_row,\n             JSAMPARRAY output_buf, int num_rows));\n\n/* SIMD Downsample */\nEXTERN(void) jsimd_h2v2_downsample_mmx\n        JPP((JDIMENSION image_width, int max_v_samp_factor,\n             JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n             JSAMPARRAY input_data, JSAMPARRAY output_data));\nEXTERN(void) jsimd_h2v1_downsample_mmx\n        JPP((JDIMENSION image_width, int max_v_samp_factor,\n             JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n             JSAMPARRAY input_data, JSAMPARRAY output_data));\n\nEXTERN(void) jsimd_h2v2_downsample_sse2\n        JPP((JDIMENSION image_width, int max_v_samp_factor,\n             JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n             JSAMPARRAY input_data, JSAMPARRAY output_data));\nEXTERN(void) jsimd_h2v1_downsample_sse2\n        JPP((JDIMENSION image_width, int max_v_samp_factor,\n             JDIMENSION v_samp_factor, JDIMENSION width_blocks,\n             JSAMPARRAY input_data, JSAMPARRAY output_data));\n\n/* SIMD Upsample */\nEXTERN(void) jsimd_h2v2_upsample_mmx\n        JPP((int max_v_samp_factor, JDIMENSION output_width,\n             JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));\nEXTERN(void) jsimd_h2v1_upsample_mmx\n        JPP((int max_v_samp_factor, JDIMENSION output_width,\n             JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));\n\nEXTERN(void) jsimd_h2v2_fancy_upsample_mmx\n        JPP((int max_v_samp_factor, JDIMENSION downsampled_width,\n             JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));\nEXTERN(void) jsimd_h2v1_fancy_upsample_mmx\n        JPP((int max_v_samp_factor, JDIMENSION downsampled_width,\n             JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));\n\nEXTERN(void) jsimd_h2v2_merged_upsample_mmx\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v2_extrgb_merged_upsample_mmx\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v2_extrgbx_merged_upsample_mmx\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v2_extbgr_merged_upsample_mmx\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v2_extbgrx_merged_upsample_mmx\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v2_extxbgr_merged_upsample_mmx\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_mmx\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v1_merged_upsample_mmx\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v1_extrgb_merged_upsample_mmx\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v1_extrgbx_merged_upsample_mmx\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v1_extbgr_merged_upsample_mmx\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v1_extbgrx_merged_upsample_mmx\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v1_extxbgr_merged_upsample_mmx\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v1_extxrgb_merged_upsample_mmx\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\n\nEXTERN(void) jsimd_h2v2_upsample_sse2\n        JPP((int max_v_samp_factor, JDIMENSION output_width,\n             JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));\nEXTERN(void) jsimd_h2v1_upsample_sse2\n        JPP((int max_v_samp_factor, JDIMENSION output_width,\n             JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));\n\nextern const int jconst_fancy_upsample_sse2[];\nEXTERN(void) jsimd_h2v2_fancy_upsample_sse2\n        JPP((int max_v_samp_factor, JDIMENSION downsampled_width,\n             JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));\nEXTERN(void) jsimd_h2v1_fancy_upsample_sse2\n        JPP((int max_v_samp_factor, JDIMENSION downsampled_width,\n             JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));\n\nextern const int jconst_merged_upsample_sse2[];\nEXTERN(void) jsimd_h2v2_merged_upsample_sse2\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v2_extrgb_merged_upsample_sse2\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v2_extrgbx_merged_upsample_sse2\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v2_extbgr_merged_upsample_sse2\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v2_extbgrx_merged_upsample_sse2\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v2_extxbgr_merged_upsample_sse2\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v2_extxrgb_merged_upsample_sse2\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v1_merged_upsample_sse2\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v1_extrgb_merged_upsample_sse2\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v1_extrgbx_merged_upsample_sse2\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v1_extbgr_merged_upsample_sse2\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v1_extbgrx_merged_upsample_sse2\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v1_extxbgr_merged_upsample_sse2\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\nEXTERN(void) jsimd_h2v1_extxrgb_merged_upsample_sse2\n        JPP((JDIMENSION output_width, JSAMPIMAGE input_buf,\n             JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf));\n\nEXTERN(void) jsimd_h2v1_fancy_upsample_neon\n        JPP((int max_v_samp_factor, JDIMENSION downsampled_width,\n             JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));\n\n/* SIMD Sample Conversion */\nEXTERN(void) jsimd_convsamp_mmx JPP((JSAMPARRAY sample_data,\n                                     JDIMENSION start_col,\n                                     DCTELEM * workspace));\n\nEXTERN(void) jsimd_convsamp_sse2 JPP((JSAMPARRAY sample_data,\n                                      JDIMENSION start_col,\n                                      DCTELEM * workspace));\n\nEXTERN(void) jsimd_convsamp_neon JPP((JSAMPARRAY sample_data,\n                                      JDIMENSION start_col,\n                                      DCTELEM * workspace));\n\nEXTERN(void) jsimd_convsamp_float_3dnow JPP((JSAMPARRAY sample_data,\n                                             JDIMENSION start_col,\n                                             FAST_FLOAT * workspace));\n\nEXTERN(void) jsimd_convsamp_float_sse JPP((JSAMPARRAY sample_data,\n                                           JDIMENSION start_col,\n                                           FAST_FLOAT * workspace));\n\nEXTERN(void) jsimd_convsamp_float_sse2 JPP((JSAMPARRAY sample_data,\n                                            JDIMENSION start_col,\n                                            FAST_FLOAT * workspace));\n\n/* SIMD Forward DCT */\nEXTERN(void) jsimd_fdct_islow_mmx JPP((DCTELEM * data));\nEXTERN(void) jsimd_fdct_ifast_mmx JPP((DCTELEM * data));\n\nextern const int jconst_fdct_ifast_sse2[];\nEXTERN(void) jsimd_fdct_islow_sse2 JPP((DCTELEM * data));\nextern const int jconst_fdct_islow_sse2[];\nEXTERN(void) jsimd_fdct_ifast_sse2 JPP((DCTELEM * data));\n\nEXTERN(void) jsimd_fdct_ifast_neon JPP((DCTELEM * data));\n\nEXTERN(void) jsimd_fdct_float_3dnow JPP((FAST_FLOAT * data));\n\nextern const int jconst_fdct_float_sse[];\nEXTERN(void) jsimd_fdct_float_sse JPP((FAST_FLOAT * data));\n\n/* SIMD Quantization */\nEXTERN(void) jsimd_quantize_mmx JPP((JCOEFPTR coef_block,\n                                     DCTELEM * divisors,\n                                     DCTELEM * workspace));\n\nEXTERN(void) jsimd_quantize_sse2 JPP((JCOEFPTR coef_block,\n                                      DCTELEM * divisors,\n                                      DCTELEM * workspace));\n\nEXTERN(void) jsimd_quantize_neon JPP((JCOEFPTR coef_block,\n                                      DCTELEM * divisors,\n                                      DCTELEM * workspace));\n\nEXTERN(void) jsimd_quantize_float_3dnow JPP((JCOEFPTR coef_block,\n                                             FAST_FLOAT * divisors,\n                                             FAST_FLOAT * workspace));\n\nEXTERN(void) jsimd_quantize_float_sse JPP((JCOEFPTR coef_block,\n                                           FAST_FLOAT * divisors,\n                                           FAST_FLOAT * workspace));\n\nEXTERN(void) jsimd_quantize_float_sse2 JPP((JCOEFPTR coef_block,\n                                            FAST_FLOAT * divisors,\n                                            FAST_FLOAT * workspace));\n\n/* SIMD Reduced Inverse DCT */\nEXTERN(void) jsimd_idct_2x2_mmx JPP((void * dct_table,\n                                     JCOEFPTR coef_block,\n                                     JSAMPARRAY output_buf,\n                                     JDIMENSION output_col));\nEXTERN(void) jsimd_idct_4x4_mmx JPP((void * dct_table,\n                                     JCOEFPTR coef_block,\n                                     JSAMPARRAY output_buf,\n                                     JDIMENSION output_col));\n\nextern const int jconst_idct_red_sse2[];\nEXTERN(void) jsimd_idct_2x2_sse2 JPP((void * dct_table,\n                                      JCOEFPTR coef_block,\n                                      JSAMPARRAY output_buf,\n                                      JDIMENSION output_col));\nEXTERN(void) jsimd_idct_4x4_sse2 JPP((void * dct_table,\n                                      JCOEFPTR coef_block,\n                                      JSAMPARRAY output_buf,\n                                      JDIMENSION output_col));\n\nEXTERN(void) jsimd_idct_2x2_neon JPP((void * dct_table,\n                                      JCOEFPTR coef_block,\n                                      JSAMPARRAY output_buf,\n                                      JDIMENSION output_col));\nEXTERN(void) jsimd_idct_4x4_neon JPP((void * dct_table,\n                                      JCOEFPTR coef_block,\n                                      JSAMPARRAY output_buf,\n                                      JDIMENSION output_col));\n\n/* SIMD Inverse DCT */\nEXTERN(void) jsimd_idct_islow_mmx JPP((void * dct_table,\n                                       JCOEFPTR coef_block,\n                                       JSAMPARRAY output_buf,\n                                       JDIMENSION output_col));\nEXTERN(void) jsimd_idct_ifast_mmx JPP((void * dct_table,\n                                       JCOEFPTR coef_block,\n                                       JSAMPARRAY output_buf,\n                                       JDIMENSION output_col));\n\nextern const int jconst_idct_islow_sse2[];\nEXTERN(void) jsimd_idct_islow_sse2 JPP((void * dct_table,\n                                        JCOEFPTR coef_block,\n                                        JSAMPARRAY output_buf,\n                                        JDIMENSION output_col));\nextern const int jconst_idct_ifast_sse2[];\nEXTERN(void) jsimd_idct_ifast_sse2 JPP((void * dct_table,\n                                        JCOEFPTR coef_block,\n                                        JSAMPARRAY output_buf,\n                                        JDIMENSION output_col));\n\nEXTERN(void) jsimd_idct_islow_neon JPP((void * dct_table,\n                                        JCOEFPTR coef_block,\n                                        JSAMPARRAY output_buf,\n                                        JDIMENSION output_col));\nEXTERN(void) jsimd_idct_ifast_neon JPP((void * dct_table,\n                                        JCOEFPTR coef_block,\n                                        JSAMPARRAY output_buf,\n                                        JDIMENSION output_col));\n\nEXTERN(void) jsimd_idct_float_3dnow JPP((void * dct_table,\n                                         JCOEFPTR coef_block,\n                                         JSAMPARRAY output_buf,\n                                         JDIMENSION output_col));\n\nextern const int jconst_idct_float_sse[];\nEXTERN(void) jsimd_idct_float_sse JPP((void * dct_table,\n                                       JCOEFPTR coef_block,\n                                       JSAMPARRAY output_buf,\n                                       JDIMENSION output_col));\n\nextern const int jconst_idct_float_sse2[];\nEXTERN(void) jsimd_idct_float_sse2 JPP((void * dct_table,\n                                        JCOEFPTR coef_block,\n                                        JSAMPARRAY output_buf,\n                                        JDIMENSION output_col));\n\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jsimd_arm.c",
    "content": "/*\n * jsimd_arm.c\n *\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright 2009-2011 D. R. Commander\n *\n * Based on the x86 SIMD extension for IJG JPEG library,\n * Copyright (C) 1999-2006, MIYASAKA Masaru.\n * For conditions of distribution and use, see copyright notice in jsimdext.inc\n *\n * This file contains the interface between the \"normal\" portions\n * of the library and the SIMD implementations when running on\n * ARM architecture.\n *\n * Based on the stubs from 'jsimd_none.c'\n */\n\n#define JPEG_INTERNALS\n#include \"../jinclude.h\"\n#include \"../jpeglib.h\"\n#include \"../jsimd.h\"\n#include \"../jdct.h\"\n#include \"../jsimddct.h\"\n#include \"jsimd.h\"\n\n#include <stdio.h>\n#include <string.h>\n#include <ctype.h>\n\nstatic unsigned int simd_support = ~0;\n\n#if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)\n\n#define SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT (1024 * 1024)\n\nLOCAL(int)\ncheck_feature (char *buffer, char *feature)\n{\n  char *p;\n  if (*feature == 0)\n    return 0;\n  if (strncmp(buffer, \"Features\", 8) != 0)\n    return 0;\n  buffer += 8;\n  while (isspace(*buffer))\n    buffer++;\n\n  /* Check if 'feature' is present in the buffer as a separate word */\n  while ((p = strstr(buffer, feature))) {\n    if (p > buffer && !isspace(*(p - 1))) {\n      buffer++;\n      continue;\n    }\n    p += strlen(feature);\n    if (*p != 0 && !isspace(*p)) {\n      buffer++;\n      continue;\n    }\n    return 1;\n  }\n  return 0;\n}\n\nLOCAL(int)\nparse_proc_cpuinfo (int bufsize)\n{\n  char *buffer = (char *)malloc(bufsize);\n  FILE *fd;\n  simd_support = 0;\n\n  if (!buffer)\n    return 0;\n\n  fd = fopen(\"/proc/cpuinfo\", \"r\");\n  if (fd) {\n    while (fgets(buffer, bufsize, fd)) {\n      if (!strchr(buffer, '\\n') && !feof(fd)) {\n        /* \"impossible\" happened - insufficient size of the buffer! */\n        fclose(fd);\n        free(buffer);\n        return 0;\n      }\n      if (check_feature(buffer, \"neon\"))\n        simd_support |= JSIMD_ARM_NEON;\n    }\n    fclose(fd);\n  }\n  free(buffer);\n  return 1;\n}\n\n#endif\n\n/*\n * Check what SIMD accelerations are supported.\n *\n * FIXME: This code is racy under a multi-threaded environment.\n */\nLOCAL(void)\ninit_simd (void)\n{\n  char *env = NULL;\n#if !defined(__ARM_NEON__) && defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)\n  int bufsize = 1024; /* an initial guess for the line buffer size limit */\n#endif\n\n  if (simd_support != ~0U)\n    return;\n\n  simd_support = 0;\n\n#if defined(__ARM_NEON__)\n  simd_support |= JSIMD_ARM_NEON;\n#elif defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)\n  /* We still have a chance to use NEON regardless of globally used\n   * -mcpu/-mfpu options passed to gcc by performing runtime detection via\n   * /proc/cpuinfo parsing on linux/android */\n  while (!parse_proc_cpuinfo(bufsize)) {\n    bufsize *= 2;\n    if (bufsize > SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT)\n      break;\n  }\n#endif\n\n  /* Force different settings through environment variables */\n  env = getenv(\"JSIMD_FORCE_ARM_NEON\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_support &= JSIMD_ARM_NEON;\n  env = getenv(\"JSIMD_FORCE_NO_SIMD\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_support = 0;\n}\n\nGLOBAL(int)\njsimd_can_rgb_ycc (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_rgb_gray (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_ycc_rgb (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_rgb_ycc_convert (j_compress_ptr cinfo,\n                       JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                       JDIMENSION output_row, int num_rows)\n{\n  void (*neonfct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);\n\n  switch(cinfo->in_color_space)\n  {\n    case JCS_EXT_RGB:\n      neonfct=jsimd_extrgb_ycc_convert_neon;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      neonfct=jsimd_extrgbx_ycc_convert_neon;\n      break;\n    case JCS_EXT_BGR:\n      neonfct=jsimd_extbgr_ycc_convert_neon;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      neonfct=jsimd_extbgrx_ycc_convert_neon;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      neonfct=jsimd_extxbgr_ycc_convert_neon;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      neonfct=jsimd_extxrgb_ycc_convert_neon;\n      break;\n    default:\n      neonfct=jsimd_extrgb_ycc_convert_neon;\n      break;\n  }\n\n  if (simd_support & JSIMD_ARM_NEON)\n    neonfct(cinfo->image_width, input_buf,\n        output_buf, output_row, num_rows);\n}\n\nGLOBAL(void)\njsimd_rgb_gray_convert (j_compress_ptr cinfo,\n                        JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                        JDIMENSION output_row, int num_rows)\n{\n}\n\nGLOBAL(void)\njsimd_ycc_rgb_convert (j_decompress_ptr cinfo,\n                       JSAMPIMAGE input_buf, JDIMENSION input_row,\n                       JSAMPARRAY output_buf, int num_rows)\n{\n  void (*neonfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);\n\n  switch(cinfo->out_color_space)\n  {\n    case JCS_EXT_RGB:\n      neonfct=jsimd_ycc_extrgb_convert_neon;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      neonfct=jsimd_ycc_extrgbx_convert_neon;\n      break;\n    case JCS_EXT_BGR:\n      neonfct=jsimd_ycc_extbgr_convert_neon;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      neonfct=jsimd_ycc_extbgrx_convert_neon;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      neonfct=jsimd_ycc_extxbgr_convert_neon;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      neonfct=jsimd_ycc_extxrgb_convert_neon;\n      break;\n  default:\n      neonfct=jsimd_ycc_extrgb_convert_neon;\n      break;\n  }\n\n  if (simd_support & JSIMD_ARM_NEON)\n    neonfct(cinfo->output_width, input_buf,\n        input_row, output_buf, num_rows);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_downsample (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_downsample (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,\n                       JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n}\n\nGLOBAL(void)\njsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,\n                       JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n}\n\nGLOBAL(int)\njsimd_can_h2v2_upsample (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_upsample (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_upsample (j_decompress_ptr cinfo,\n                     jpeg_component_info * compptr, \n                     JSAMPARRAY input_data,\n                     JSAMPARRAY * output_data_ptr)\n{\n}\n\nGLOBAL(void)\njsimd_h2v1_upsample (j_decompress_ptr cinfo,\n                     jpeg_component_info * compptr, \n                     JSAMPARRAY input_data,\n                     JSAMPARRAY * output_data_ptr)\n{\n}\n\nGLOBAL(int)\njsimd_can_h2v2_fancy_upsample (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_fancy_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo,\n                           jpeg_component_info * compptr, \n                           JSAMPARRAY input_data,\n                           JSAMPARRAY * output_data_ptr)\n{\n}\n\nGLOBAL(void)\njsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo,\n                           jpeg_component_info * compptr, \n                           JSAMPARRAY input_data,\n                           JSAMPARRAY * output_data_ptr)\n{\n  if (simd_support & JSIMD_ARM_NEON)\n    jsimd_h2v1_fancy_upsample_neon(cinfo->max_v_samp_factor,\n        compptr->downsampled_width, input_data, output_data_ptr);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_merged_upsample (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_merged_upsample (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,\n                            JSAMPIMAGE input_buf,\n                            JDIMENSION in_row_group_ctr,\n                            JSAMPARRAY output_buf)\n{\n}\n\nGLOBAL(void)\njsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,\n                            JSAMPIMAGE input_buf,\n                            JDIMENSION in_row_group_ctr,\n                            JSAMPARRAY output_buf)\n{\n}\n\nGLOBAL(int)\njsimd_can_convsamp (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_convsamp_float (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col,\n                DCTELEM * workspace)\n{\n  if (simd_support & JSIMD_ARM_NEON)\n    jsimd_convsamp_neon(sample_data, start_col, workspace);\n}\n\nGLOBAL(void)\njsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col,\n                      FAST_FLOAT * workspace)\n{\n}\n\nGLOBAL(int)\njsimd_can_fdct_islow (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_fdct_ifast (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_fdct_float (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_fdct_islow (DCTELEM * data)\n{\n}\n\nGLOBAL(void)\njsimd_fdct_ifast (DCTELEM * data)\n{\n  if (simd_support & JSIMD_ARM_NEON)\n    jsimd_fdct_ifast_neon(data);\n}\n\nGLOBAL(void)\njsimd_fdct_float (FAST_FLOAT * data)\n{\n}\n\nGLOBAL(int)\njsimd_can_quantize (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_quantize_float (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors,\n                DCTELEM * workspace)\n{\n  if (simd_support & JSIMD_ARM_NEON)\n    jsimd_quantize_neon(coef_block, divisors, workspace);\n}\n\nGLOBAL(void)\njsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors,\n                      FAST_FLOAT * workspace)\n{\n}\n\nGLOBAL(int)\njsimd_can_idct_2x2 (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_ARM_NEON))\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_4x4 (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_ARM_NEON))\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  if ((simd_support & JSIMD_ARM_NEON))\n    jsimd_idct_2x2_neon(compptr->dct_table, coef_block, output_buf, output_col);\n}\n\nGLOBAL(void)\njsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  if ((simd_support & JSIMD_ARM_NEON))\n    jsimd_idct_4x4_neon(compptr->dct_table, coef_block, output_buf, output_col);\n}\n\nGLOBAL(int)\njsimd_can_idct_islow (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_ARM_NEON)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_ifast (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(IFAST_MULT_TYPE) != 2)\n    return 0;\n  if (IFAST_SCALE_BITS != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_ARM_NEON))\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_float (void)\n{\n  init_simd();\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  if ((simd_support & JSIMD_ARM_NEON))\n    jsimd_idct_islow_neon(compptr->dct_table, coef_block, output_buf, output_col);\n}\n\nGLOBAL(void)\njsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  if ((simd_support & JSIMD_ARM_NEON))\n    jsimd_idct_ifast_neon(compptr->dct_table, coef_block, output_buf, output_col);\n}\n\nGLOBAL(void)\njsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n}\n\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jsimd_arm_neon.S",
    "content": "/*\n * ARMv7 NEON optimizations for libjpeg-turbo\n *\n * Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies).\n * All rights reserved.\n * Author: Siarhei Siamashka <siarhei.siamashka@nokia.com>\n *\n * This software is provided 'as-is', without any express or implied\n * warranty.  In no event will the authors be held liable for any damages\n * arising from the use of this software.\n *\n * Permission is granted to anyone to use this software for any purpose,\n * including commercial applications, and to alter it and redistribute it\n * freely, subject to the following restrictions:\n *\n * 1. The origin of this software must not be misrepresented; you must not\n *    claim that you wrote the original software. If you use this software\n *    in a product, an acknowledgment in the product documentation would be\n *    appreciated but is not required.\n * 2. Altered source versions must be plainly marked as such, and must not be\n *    misrepresented as being the original software.\n * 3. This notice may not be removed or altered from any source distribution.\n */\n\n#if defined(__linux__) && defined(__ELF__)\n.section .note.GNU-stack,\"\",%progbits /* mark stack as non-executable */\n#endif\n\n.text\n.fpu neon\n.arch armv7a\n.object_arch armv4\n.arm\n\n\n#define RESPECT_STRICT_ALIGNMENT 1\n\n\n/*****************************************************************************/\n\n/* Supplementary macro for setting function attributes */\n.macro asm_function fname\n#ifdef __APPLE__\n    .func _\\fname\n    .globl _\\fname\n_\\fname:\n#else\n    .func \\fname\n    .global \\fname\n#ifdef __ELF__\n    .hidden \\fname\n    .type \\fname, %function\n#endif\n\\fname:\n#endif\n.endm\n\n/* Transpose a block of 4x4 coefficients in four 64-bit registers */\n.macro transpose_4x4 x0, x1, x2, x3\n    vtrn.16 \\x0, \\x1\n    vtrn.16 \\x2, \\x3\n    vtrn.32 \\x0, \\x2\n    vtrn.32 \\x1, \\x3\n.endm\n\n\n#define CENTERJSAMPLE 128\n\n/*****************************************************************************/\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients.\n *\n * GLOBAL(void)\n * jsimd_idct_islow_neon (void * dct_table, JCOEFPTR coef_block,\n *                        JSAMPARRAY output_buf, JDIMENSION output_col)\n */\n\n#define FIX_0_298631336  (2446)\n#define FIX_0_390180644  (3196)\n#define FIX_0_541196100  (4433)\n#define FIX_0_765366865  (6270)\n#define FIX_0_899976223  (7373)\n#define FIX_1_175875602  (9633)\n#define FIX_1_501321110  (12299)\n#define FIX_1_847759065  (15137)\n#define FIX_1_961570560  (16069)\n#define FIX_2_053119869  (16819)\n#define FIX_2_562915447  (20995)\n#define FIX_3_072711026  (25172)\n\n#define FIX_1_175875602_MINUS_1_961570560 (FIX_1_175875602 - FIX_1_961570560)\n#define FIX_1_175875602_MINUS_0_390180644 (FIX_1_175875602 - FIX_0_390180644)\n#define FIX_0_541196100_MINUS_1_847759065 (FIX_0_541196100 - FIX_1_847759065)\n#define FIX_3_072711026_MINUS_2_562915447 (FIX_3_072711026 - FIX_2_562915447)\n#define FIX_0_298631336_MINUS_0_899976223 (FIX_0_298631336 - FIX_0_899976223)\n#define FIX_1_501321110_MINUS_0_899976223 (FIX_1_501321110 - FIX_0_899976223)\n#define FIX_2_053119869_MINUS_2_562915447 (FIX_2_053119869 - FIX_2_562915447)\n#define FIX_0_541196100_PLUS_0_765366865  (FIX_0_541196100 + FIX_0_765366865)\n\n/*\n * Reference SIMD-friendly 1-D ISLOW iDCT C implementation.\n * Uses some ideas from the comments in 'simd/jiss2int-64.asm'\n */\n#define REF_1D_IDCT(xrow0, xrow1, xrow2, xrow3, xrow4, xrow5, xrow6, xrow7)   \\\n{                                                                             \\\n    DCTELEM row0, row1, row2, row3, row4, row5, row6, row7;                   \\\n    INT32   q1, q2, q3, q4, q5, q6, q7;                                       \\\n    INT32   tmp11_plus_tmp2, tmp11_minus_tmp2;                                \\\n                                                                              \\\n    /* 1-D iDCT input data */                                                 \\\n    row0 = xrow0;                                                             \\\n    row1 = xrow1;                                                             \\\n    row2 = xrow2;                                                             \\\n    row3 = xrow3;                                                             \\\n    row4 = xrow4;                                                             \\\n    row5 = xrow5;                                                             \\\n    row6 = xrow6;                                                             \\\n    row7 = xrow7;                                                             \\\n                                                                              \\\n    q5 = row7 + row3;                                                         \\\n    q4 = row5 + row1;                                                         \\\n    q6 = MULTIPLY(q5, FIX_1_175875602_MINUS_1_961570560) +                    \\\n         MULTIPLY(q4, FIX_1_175875602);                                       \\\n    q7 = MULTIPLY(q5, FIX_1_175875602) +                                      \\\n         MULTIPLY(q4, FIX_1_175875602_MINUS_0_390180644);                     \\\n    q2 = MULTIPLY(row2, FIX_0_541196100) +                                    \\\n         MULTIPLY(row6, FIX_0_541196100_MINUS_1_847759065);                   \\\n    q4 = q6;                                                                  \\\n    q3 = ((INT32) row0 - (INT32) row4) << 13;                                 \\\n    q6 += MULTIPLY(row5, -FIX_2_562915447) +                                  \\\n          MULTIPLY(row3, FIX_3_072711026_MINUS_2_562915447);                  \\\n    /* now we can use q1 (reloadable constants have been used up) */          \\\n    q1 = q3 + q2;                                                             \\\n    q4 += MULTIPLY(row7, FIX_0_298631336_MINUS_0_899976223) +                 \\\n          MULTIPLY(row1, -FIX_0_899976223);                                   \\\n    q5 = q7;                                                                  \\\n    q1 = q1 + q6;                                                             \\\n    q7 += MULTIPLY(row7, -FIX_0_899976223) +                                  \\\n          MULTIPLY(row1, FIX_1_501321110_MINUS_0_899976223);                  \\\n                                                                              \\\n    /* (tmp11 + tmp2) has been calculated (out_row1 before descale) */        \\\n    tmp11_plus_tmp2 = q1;                                                     \\\n    row1 = 0;                                                                 \\\n                                                                              \\\n    q1 = q1 - q6;                                                             \\\n    q5 += MULTIPLY(row5, FIX_2_053119869_MINUS_2_562915447) +                 \\\n          MULTIPLY(row3, -FIX_2_562915447);                                   \\\n    q1 = q1 - q6;                                                             \\\n    q6 = MULTIPLY(row2, FIX_0_541196100_PLUS_0_765366865) +                   \\\n         MULTIPLY(row6, FIX_0_541196100);                                     \\\n    q3 = q3 - q2;                                                             \\\n                                                                              \\\n    /* (tmp11 - tmp2) has been calculated (out_row6 before descale) */        \\\n    tmp11_minus_tmp2 = q1;                                                    \\\n                                                                              \\\n    q1 = ((INT32) row0 + (INT32) row4) << 13;                                 \\\n    q2 = q1 + q6;                                                             \\\n    q1 = q1 - q6;                                                             \\\n                                                                              \\\n    /* pick up the results */                                                 \\\n    tmp0  = q4;                                                               \\\n    tmp1  = q5;                                                               \\\n    tmp2  = (tmp11_plus_tmp2 - tmp11_minus_tmp2) / 2;                         \\\n    tmp3  = q7;                                                               \\\n    tmp10 = q2;                                                               \\\n    tmp11 = (tmp11_plus_tmp2 + tmp11_minus_tmp2) / 2;                         \\\n    tmp12 = q3;                                                               \\\n    tmp13 = q1;                                                               \\\n}\n\n#define XFIX_0_899976223                    d0[0]\n#define XFIX_0_541196100                    d0[1]\n#define XFIX_2_562915447                    d0[2]\n#define XFIX_0_298631336_MINUS_0_899976223  d0[3]\n#define XFIX_1_501321110_MINUS_0_899976223  d1[0]\n#define XFIX_2_053119869_MINUS_2_562915447  d1[1]\n#define XFIX_0_541196100_PLUS_0_765366865   d1[2]\n#define XFIX_1_175875602                    d1[3]\n#define XFIX_1_175875602_MINUS_0_390180644  d2[0]\n#define XFIX_0_541196100_MINUS_1_847759065  d2[1]\n#define XFIX_3_072711026_MINUS_2_562915447  d2[2]\n#define XFIX_1_175875602_MINUS_1_961570560  d2[3]\n\n.balign 16\njsimd_idct_islow_neon_consts:\n    .short FIX_0_899976223                    /* d0[0] */\n    .short FIX_0_541196100                    /* d0[1] */\n    .short FIX_2_562915447                    /* d0[2] */\n    .short FIX_0_298631336_MINUS_0_899976223  /* d0[3] */\n    .short FIX_1_501321110_MINUS_0_899976223  /* d1[0] */\n    .short FIX_2_053119869_MINUS_2_562915447  /* d1[1] */\n    .short FIX_0_541196100_PLUS_0_765366865   /* d1[2] */\n    .short FIX_1_175875602                    /* d1[3] */\n    /* reloadable constants */\n    .short FIX_1_175875602_MINUS_0_390180644  /* d2[0] */\n    .short FIX_0_541196100_MINUS_1_847759065  /* d2[1] */\n    .short FIX_3_072711026_MINUS_2_562915447  /* d2[2] */\n    .short FIX_1_175875602_MINUS_1_961570560  /* d2[3] */\n\nasm_function jsimd_idct_islow_neon\n\n    DCT_TABLE       .req r0\n    COEF_BLOCK      .req r1\n    OUTPUT_BUF      .req r2\n    OUTPUT_COL      .req r3\n    TMP1            .req r0\n    TMP2            .req r1\n    TMP3            .req r2\n    TMP4            .req ip\n\n    ROW0L           .req d16\n    ROW0R           .req d17\n    ROW1L           .req d18\n    ROW1R           .req d19\n    ROW2L           .req d20\n    ROW2R           .req d21\n    ROW3L           .req d22\n    ROW3R           .req d23\n    ROW4L           .req d24\n    ROW4R           .req d25\n    ROW5L           .req d26\n    ROW5R           .req d27\n    ROW6L           .req d28\n    ROW6R           .req d29\n    ROW7L           .req d30\n    ROW7R           .req d31\n\n    /* Load and dequantize coefficients into NEON registers\n     * with the following allocation:\n     *       0 1 2 3 | 4 5 6 7\n     *      ---------+--------\n     *   0 | d16     | d17     ( q8  )\n     *   1 | d18     | d19     ( q9  )\n     *   2 | d20     | d21     ( q10 )\n     *   3 | d22     | d23     ( q11 )\n     *   4 | d24     | d25     ( q12 )\n     *   5 | d26     | d27     ( q13 )\n     *   6 | d28     | d29     ( q14 )\n     *   7 | d30     | d31     ( q15 )\n     */\n    adr             ip, jsimd_idct_islow_neon_consts\n    vld1.16         {d16, d17, d18, d19}, [COEF_BLOCK, :128]!\n    vld1.16         {d0, d1, d2, d3}, [DCT_TABLE, :128]!\n    vld1.16         {d20, d21, d22, d23}, [COEF_BLOCK, :128]!\n    vmul.s16        q8, q8, q0\n    vld1.16         {d4, d5, d6, d7}, [DCT_TABLE, :128]!\n    vmul.s16        q9, q9, q1\n    vld1.16         {d24, d25, d26, d27}, [COEF_BLOCK, :128]!\n    vmul.s16        q10, q10, q2\n    vld1.16         {d0, d1, d2, d3}, [DCT_TABLE, :128]!\n    vmul.s16        q11, q11, q3\n    vld1.16         {d28, d29, d30, d31}, [COEF_BLOCK, :128]\n    vmul.s16        q12, q12, q0\n    vld1.16         {d4, d5, d6, d7}, [DCT_TABLE, :128]!\n    vmul.s16        q14, q14, q2\n    vmul.s16        q13, q13, q1\n    vld1.16         {d0, d1, d2, d3}, [ip, :128] /* load constants */\n    add             ip, ip, #16\n    vmul.s16        q15, q15, q3\n    vpush           {d8-d15} /* save NEON registers */\n    /* 1-D IDCT, pass 1, left 4x8 half */\n    vadd.s16        d4,    ROW7L, ROW3L\n    vadd.s16        d5,    ROW5L, ROW1L\n    vmull.s16       q6,    d4,    XFIX_1_175875602_MINUS_1_961570560\n    vmlal.s16       q6,    d5,    XFIX_1_175875602\n    vmull.s16       q7,    d4,    XFIX_1_175875602\n      /* Check for the zero coefficients in the right 4x8 half */\n      push            {r4, r5}\n    vmlal.s16       q7,    d5,    XFIX_1_175875602_MINUS_0_390180644\n    vsubl.s16       q3,    ROW0L, ROW4L\n      ldrd            r4,    [COEF_BLOCK, #(-96 + 2 * (4 + 1 * 8))]\n    vmull.s16       q2,    ROW2L, XFIX_0_541196100\n    vmlal.s16       q2,    ROW6L, XFIX_0_541196100_MINUS_1_847759065\n      orr             r0,    r4,    r5\n    vmov            q4,    q6\n    vmlsl.s16       q6,    ROW5L, XFIX_2_562915447\n      ldrd            r4,    [COEF_BLOCK, #(-96 + 2 * (4 + 2 * 8))]\n    vmlal.s16       q6,    ROW3L, XFIX_3_072711026_MINUS_2_562915447\n    vshl.s32        q3,    q3,    #13\n      orr             r0,    r0,    r4\n    vmlsl.s16       q4,    ROW1L, XFIX_0_899976223\n      orr             r0,    r0,    r5\n    vadd.s32        q1,    q3,    q2\n      ldrd            r4,    [COEF_BLOCK, #(-96 + 2 * (4 + 3 * 8))]\n    vmov            q5,    q7\n    vadd.s32        q1,    q1,    q6\n      orr             r0,    r0,    r4\n    vmlsl.s16       q7,    ROW7L, XFIX_0_899976223\n      orr             r0,    r0,    r5\n    vmlal.s16       q7,    ROW1L, XFIX_1_501321110_MINUS_0_899976223\n    vrshrn.s32      ROW1L, q1,    #11\n      ldrd            r4,    [COEF_BLOCK, #(-96 + 2 * (4 + 4 * 8))]\n    vsub.s32        q1,    q1,    q6\n    vmlal.s16       q5,    ROW5L, XFIX_2_053119869_MINUS_2_562915447\n      orr             r0,    r0,    r4\n    vmlsl.s16       q5,    ROW3L, XFIX_2_562915447\n      orr             r0,    r0,    r5\n    vsub.s32        q1,    q1,    q6\n    vmull.s16       q6,    ROW2L, XFIX_0_541196100_PLUS_0_765366865\n      ldrd            r4,    [COEF_BLOCK, #(-96 + 2 * (4 + 5 * 8))]\n    vmlal.s16       q6,    ROW6L, XFIX_0_541196100\n    vsub.s32        q3,    q3,    q2\n      orr             r0,    r0,    r4\n    vrshrn.s32      ROW6L, q1,    #11\n      orr             r0,    r0,    r5\n    vadd.s32        q1,    q3,    q5\n      ldrd            r4,    [COEF_BLOCK, #(-96 + 2 * (4 + 6 * 8))]\n    vsub.s32        q3,    q3,    q5\n    vaddl.s16       q5,    ROW0L, ROW4L\n      orr             r0,    r0,    r4\n    vrshrn.s32      ROW2L, q1,    #11\n      orr             r0,    r0,    r5\n    vrshrn.s32      ROW5L, q3,    #11\n      ldrd            r4,    [COEF_BLOCK, #(-96 + 2 * (4 + 7 * 8))]\n    vshl.s32        q5,    q5,    #13\n    vmlal.s16       q4,    ROW7L, XFIX_0_298631336_MINUS_0_899976223\n      orr             r0,    r0,    r4\n    vadd.s32        q2,    q5,    q6\n      orrs            r0,    r0,    r5\n    vsub.s32        q1,    q5,    q6\n    vadd.s32        q6,    q2,    q7\n      ldrd            r4,    [COEF_BLOCK, #(-96 + 2 * (4 + 0 * 8))]\n    vsub.s32        q2,    q2,    q7\n    vadd.s32        q5,    q1,    q4\n      orr             r0,    r4,    r5\n    vsub.s32        q3,    q1,    q4\n      pop             {r4, r5}\n    vrshrn.s32      ROW7L, q2,    #11\n    vrshrn.s32      ROW3L, q5,    #11\n    vrshrn.s32      ROW0L, q6,    #11\n    vrshrn.s32      ROW4L, q3,    #11\n\n      beq             3f /* Go to do some special handling for the sparse right 4x8 half */\n\n    /* 1-D IDCT, pass 1, right 4x8 half */\n    vld1.s16        {d2},  [ip, :64]    /* reload constants */\n    vadd.s16        d10,   ROW7R, ROW3R\n    vadd.s16        d8,    ROW5R, ROW1R\n      /* Transpose left 4x8 half */\n      vtrn.16         ROW6L, ROW7L\n    vmull.s16       q6,    d10,   XFIX_1_175875602_MINUS_1_961570560\n    vmlal.s16       q6,    d8,    XFIX_1_175875602\n      vtrn.16         ROW2L, ROW3L\n    vmull.s16       q7,    d10,   XFIX_1_175875602\n    vmlal.s16       q7,    d8,    XFIX_1_175875602_MINUS_0_390180644\n      vtrn.16         ROW0L, ROW1L\n    vsubl.s16       q3,    ROW0R, ROW4R\n    vmull.s16       q2,    ROW2R, XFIX_0_541196100\n    vmlal.s16       q2,    ROW6R, XFIX_0_541196100_MINUS_1_847759065\n      vtrn.16         ROW4L, ROW5L\n    vmov            q4,    q6\n    vmlsl.s16       q6,    ROW5R, XFIX_2_562915447\n    vmlal.s16       q6,    ROW3R, XFIX_3_072711026_MINUS_2_562915447\n      vtrn.32         ROW1L, ROW3L\n    vshl.s32        q3,    q3,    #13\n    vmlsl.s16       q4,    ROW1R, XFIX_0_899976223\n      vtrn.32         ROW4L, ROW6L\n    vadd.s32        q1,    q3,    q2\n    vmov            q5,    q7\n    vadd.s32        q1,    q1,    q6\n      vtrn.32         ROW0L, ROW2L\n    vmlsl.s16       q7,    ROW7R, XFIX_0_899976223\n    vmlal.s16       q7,    ROW1R, XFIX_1_501321110_MINUS_0_899976223\n    vrshrn.s32      ROW1R, q1,    #11\n      vtrn.32         ROW5L, ROW7L\n    vsub.s32        q1,    q1,    q6\n    vmlal.s16       q5,    ROW5R, XFIX_2_053119869_MINUS_2_562915447\n    vmlsl.s16       q5,    ROW3R, XFIX_2_562915447\n    vsub.s32        q1,    q1,    q6\n    vmull.s16       q6,    ROW2R, XFIX_0_541196100_PLUS_0_765366865\n    vmlal.s16       q6,    ROW6R, XFIX_0_541196100\n    vsub.s32        q3,    q3,    q2\n    vrshrn.s32      ROW6R, q1,    #11\n    vadd.s32        q1,    q3,    q5\n    vsub.s32        q3,    q3,    q5\n    vaddl.s16       q5,    ROW0R, ROW4R\n    vrshrn.s32      ROW2R, q1,    #11\n    vrshrn.s32      ROW5R, q3,    #11\n    vshl.s32        q5,    q5,    #13\n    vmlal.s16       q4,    ROW7R, XFIX_0_298631336_MINUS_0_899976223\n    vadd.s32        q2,    q5,    q6\n    vsub.s32        q1,    q5,    q6\n    vadd.s32        q6,    q2,    q7\n    vsub.s32        q2,    q2,    q7\n    vadd.s32        q5,    q1,    q4\n    vsub.s32        q3,    q1,    q4\n    vrshrn.s32      ROW7R, q2,    #11\n    vrshrn.s32      ROW3R, q5,    #11\n    vrshrn.s32      ROW0R, q6,    #11\n    vrshrn.s32      ROW4R, q3,    #11\n    /* Transpose right 4x8 half */\n    vtrn.16         ROW6R, ROW7R\n    vtrn.16         ROW2R, ROW3R\n    vtrn.16         ROW0R, ROW1R\n    vtrn.16         ROW4R, ROW5R\n    vtrn.32         ROW1R, ROW3R\n    vtrn.32         ROW4R, ROW6R\n    vtrn.32         ROW0R, ROW2R\n    vtrn.32         ROW5R, ROW7R\n\n1:  /* 1-D IDCT, pass 2 (normal variant), left 4x8 half */\n    vld1.s16        {d2},  [ip, :64]    /* reload constants */\n    vmull.s16       q6,    ROW1R, XFIX_1_175875602 /* ROW5L <-> ROW1R */\n    vmlal.s16       q6,    ROW1L, XFIX_1_175875602\n    vmlal.s16       q6,    ROW3R, XFIX_1_175875602_MINUS_1_961570560 /* ROW7L <-> ROW3R */\n    vmlal.s16       q6,    ROW3L, XFIX_1_175875602_MINUS_1_961570560\n    vmull.s16       q7,    ROW3R, XFIX_1_175875602 /* ROW7L <-> ROW3R */\n    vmlal.s16       q7,    ROW3L, XFIX_1_175875602\n    vmlal.s16       q7,    ROW1R, XFIX_1_175875602_MINUS_0_390180644 /* ROW5L <-> ROW1R */\n    vmlal.s16       q7,    ROW1L, XFIX_1_175875602_MINUS_0_390180644\n    vsubl.s16       q3,    ROW0L, ROW0R /* ROW4L <-> ROW0R */\n    vmull.s16       q2,    ROW2L, XFIX_0_541196100\n    vmlal.s16       q2,    ROW2R, XFIX_0_541196100_MINUS_1_847759065 /* ROW6L <-> ROW2R */\n    vmov            q4,    q6\n    vmlsl.s16       q6,    ROW1R, XFIX_2_562915447 /* ROW5L <-> ROW1R */\n    vmlal.s16       q6,    ROW3L, XFIX_3_072711026_MINUS_2_562915447\n    vshl.s32        q3,    q3,    #13\n    vmlsl.s16       q4,    ROW1L, XFIX_0_899976223\n    vadd.s32        q1,    q3,    q2\n    vmov            q5,    q7\n    vadd.s32        q1,    q1,    q6\n    vmlsl.s16       q7,    ROW3R, XFIX_0_899976223 /* ROW7L <-> ROW3R */\n    vmlal.s16       q7,    ROW1L, XFIX_1_501321110_MINUS_0_899976223\n    vshrn.s32       ROW1L, q1,    #16\n    vsub.s32        q1,    q1,    q6\n    vmlal.s16       q5,    ROW1R, XFIX_2_053119869_MINUS_2_562915447 /* ROW5L <-> ROW1R */\n    vmlsl.s16       q5,    ROW3L, XFIX_2_562915447\n    vsub.s32        q1,    q1,    q6\n    vmull.s16       q6,    ROW2L, XFIX_0_541196100_PLUS_0_765366865\n    vmlal.s16       q6,    ROW2R, XFIX_0_541196100 /* ROW6L <-> ROW2R */\n    vsub.s32        q3,    q3,    q2\n    vshrn.s32       ROW2R, q1,    #16 /* ROW6L <-> ROW2R */\n    vadd.s32        q1,    q3,    q5\n    vsub.s32        q3,    q3,    q5\n    vaddl.s16       q5,    ROW0L, ROW0R /* ROW4L <-> ROW0R */\n    vshrn.s32       ROW2L, q1,    #16\n    vshrn.s32       ROW1R, q3,    #16 /* ROW5L <-> ROW1R */\n    vshl.s32        q5,    q5,    #13\n    vmlal.s16       q4,    ROW3R, XFIX_0_298631336_MINUS_0_899976223 /* ROW7L <-> ROW3R */\n    vadd.s32        q2,    q5,    q6\n    vsub.s32        q1,    q5,    q6\n    vadd.s32        q6,    q2,    q7\n    vsub.s32        q2,    q2,    q7\n    vadd.s32        q5,    q1,    q4\n    vsub.s32        q3,    q1,    q4\n    vshrn.s32       ROW3R, q2,    #16 /* ROW7L <-> ROW3R */\n    vshrn.s32       ROW3L, q5,    #16\n    vshrn.s32       ROW0L, q6,    #16\n    vshrn.s32       ROW0R, q3,    #16 /* ROW4L <-> ROW0R */\n    /* 1-D IDCT, pass 2, right 4x8 half */\n    vld1.s16        {d2},  [ip, :64]    /* reload constants */\n    vmull.s16       q6,    ROW5R, XFIX_1_175875602\n    vmlal.s16       q6,    ROW5L, XFIX_1_175875602 /* ROW5L <-> ROW1R */\n    vmlal.s16       q6,    ROW7R, XFIX_1_175875602_MINUS_1_961570560\n    vmlal.s16       q6,    ROW7L, XFIX_1_175875602_MINUS_1_961570560 /* ROW7L <-> ROW3R */\n    vmull.s16       q7,    ROW7R, XFIX_1_175875602\n    vmlal.s16       q7,    ROW7L, XFIX_1_175875602 /* ROW7L <-> ROW3R */\n    vmlal.s16       q7,    ROW5R, XFIX_1_175875602_MINUS_0_390180644\n    vmlal.s16       q7,    ROW5L, XFIX_1_175875602_MINUS_0_390180644 /* ROW5L <-> ROW1R */\n    vsubl.s16       q3,    ROW4L, ROW4R /* ROW4L <-> ROW0R */\n    vmull.s16       q2,    ROW6L, XFIX_0_541196100 /* ROW6L <-> ROW2R */\n    vmlal.s16       q2,    ROW6R, XFIX_0_541196100_MINUS_1_847759065\n    vmov            q4,    q6\n    vmlsl.s16       q6,    ROW5R, XFIX_2_562915447\n    vmlal.s16       q6,    ROW7L, XFIX_3_072711026_MINUS_2_562915447 /* ROW7L <-> ROW3R */\n    vshl.s32        q3,    q3,    #13\n    vmlsl.s16       q4,    ROW5L, XFIX_0_899976223 /* ROW5L <-> ROW1R */\n    vadd.s32        q1,    q3,    q2\n    vmov            q5,    q7\n    vadd.s32        q1,    q1,    q6\n    vmlsl.s16       q7,    ROW7R, XFIX_0_899976223\n    vmlal.s16       q7,    ROW5L, XFIX_1_501321110_MINUS_0_899976223 /* ROW5L <-> ROW1R */\n    vshrn.s32       ROW5L, q1,    #16 /* ROW5L <-> ROW1R */\n    vsub.s32        q1,    q1,    q6\n    vmlal.s16       q5,    ROW5R, XFIX_2_053119869_MINUS_2_562915447\n    vmlsl.s16       q5,    ROW7L, XFIX_2_562915447 /* ROW7L <-> ROW3R */\n    vsub.s32        q1,    q1,    q6\n    vmull.s16       q6,    ROW6L, XFIX_0_541196100_PLUS_0_765366865 /* ROW6L <-> ROW2R */\n    vmlal.s16       q6,    ROW6R, XFIX_0_541196100\n    vsub.s32        q3,    q3,    q2\n    vshrn.s32       ROW6R, q1,    #16\n    vadd.s32        q1,    q3,    q5\n    vsub.s32        q3,    q3,    q5\n    vaddl.s16       q5,    ROW4L, ROW4R /* ROW4L <-> ROW0R */\n    vshrn.s32       ROW6L, q1,    #16 /* ROW6L <-> ROW2R */\n    vshrn.s32       ROW5R, q3,    #16\n    vshl.s32        q5,    q5,    #13\n    vmlal.s16       q4,    ROW7R, XFIX_0_298631336_MINUS_0_899976223\n    vadd.s32        q2,    q5,    q6\n    vsub.s32        q1,    q5,    q6\n    vadd.s32        q6,    q2,    q7\n    vsub.s32        q2,    q2,    q7\n    vadd.s32        q5,    q1,    q4\n    vsub.s32        q3,    q1,    q4\n    vshrn.s32       ROW7R, q2,    #16\n    vshrn.s32       ROW7L, q5,    #16 /* ROW7L <-> ROW3R */\n    vshrn.s32       ROW4L, q6,    #16 /* ROW4L <-> ROW0R */\n    vshrn.s32       ROW4R, q3,    #16\n\n2:  /* Descale to 8-bit and range limit */\n    vqrshrn.s16     d16,   q8,    #2\n    vqrshrn.s16     d17,   q9,    #2\n    vqrshrn.s16     d18,   q10,   #2\n    vqrshrn.s16     d19,   q11,   #2\n    vpop            {d8-d15} /* restore NEON registers */\n    vqrshrn.s16     d20,   q12,   #2\n      /* Transpose the final 8-bit samples and do signed->unsigned conversion */\n      vtrn.16         q8,    q9\n    vqrshrn.s16     d21,   q13,   #2\n    vqrshrn.s16     d22,   q14,   #2\n      vmov.u8         q0,    #(CENTERJSAMPLE)\n    vqrshrn.s16     d23,   q15,   #2\n      vtrn.8          d16,   d17\n      vtrn.8          d18,   d19\n      vadd.u8         q8,    q8,    q0\n      vadd.u8         q9,    q9,    q0\n      vtrn.16         q10,   q11\n        /* Store results to the output buffer */\n        ldmia           OUTPUT_BUF!, {TMP1, TMP2}\n        add             TMP1, TMP1, OUTPUT_COL\n        add             TMP2, TMP2, OUTPUT_COL\n        vst1.8          {d16}, [TMP1]\n      vtrn.8          d20, d21\n        vst1.8          {d17}, [TMP2]\n        ldmia           OUTPUT_BUF!, {TMP1, TMP2}\n        add             TMP1, TMP1, OUTPUT_COL\n        add             TMP2, TMP2, OUTPUT_COL\n        vst1.8          {d18}, [TMP1]\n      vadd.u8         q10,   q10,   q0\n        vst1.8          {d19}, [TMP2]\n        ldmia           OUTPUT_BUF, {TMP1, TMP2, TMP3, TMP4}\n        add             TMP1, TMP1, OUTPUT_COL\n        add             TMP2, TMP2, OUTPUT_COL\n        add             TMP3, TMP3, OUTPUT_COL\n        add             TMP4, TMP4, OUTPUT_COL\n      vtrn.8          d22, d23\n        vst1.8          {d20}, [TMP1]\n      vadd.u8         q11,   q11,   q0\n        vst1.8          {d21}, [TMP2]\n        vst1.8          {d22}, [TMP3]\n        vst1.8          {d23}, [TMP4]\n    bx              lr\n\n3:  /* Left 4x8 half is done, right 4x8 half contains mostly zeros */\n\n    /* Transpose left 4x8 half */\n    vtrn.16         ROW6L, ROW7L\n    vtrn.16         ROW2L, ROW3L\n    vtrn.16         ROW0L, ROW1L\n    vtrn.16         ROW4L, ROW5L\n    vshl.s16        ROW0R, ROW0R, #2 /* PASS1_BITS */\n    vtrn.32         ROW1L, ROW3L\n    vtrn.32         ROW4L, ROW6L\n    vtrn.32         ROW0L, ROW2L\n    vtrn.32         ROW5L, ROW7L\n\n    cmp             r0, #0\n    beq             4f /* Right 4x8 half has all zeros, go to 'sparse' second pass */\n\n    /* Only row 0 is non-zero for the right 4x8 half  */\n    vdup.s16        ROW1R, ROW0R[1]\n    vdup.s16        ROW2R, ROW0R[2]\n    vdup.s16        ROW3R, ROW0R[3]\n    vdup.s16        ROW4R, ROW0R[0]\n    vdup.s16        ROW5R, ROW0R[1]\n    vdup.s16        ROW6R, ROW0R[2]\n    vdup.s16        ROW7R, ROW0R[3]\n    vdup.s16        ROW0R, ROW0R[0]\n    b               1b /* Go to 'normal' second pass */\n\n4:  /* 1-D IDCT, pass 2 (sparse variant with zero rows 4-7), left 4x8 half */\n    vld1.s16        {d2},  [ip, :64]    /* reload constants */\n    vmull.s16       q6,    ROW1L, XFIX_1_175875602\n    vmlal.s16       q6,    ROW3L, XFIX_1_175875602_MINUS_1_961570560\n    vmull.s16       q7,    ROW3L, XFIX_1_175875602\n    vmlal.s16       q7,    ROW1L, XFIX_1_175875602_MINUS_0_390180644\n    vmull.s16       q2,    ROW2L, XFIX_0_541196100\n    vshll.s16       q3,    ROW0L, #13\n    vmov            q4,    q6\n    vmlal.s16       q6,    ROW3L, XFIX_3_072711026_MINUS_2_562915447\n    vmlsl.s16       q4,    ROW1L, XFIX_0_899976223\n    vadd.s32        q1,    q3,    q2\n    vmov            q5,    q7\n    vmlal.s16       q7,    ROW1L, XFIX_1_501321110_MINUS_0_899976223\n    vadd.s32        q1,    q1,    q6\n    vadd.s32        q6,    q6,    q6\n    vmlsl.s16       q5,    ROW3L, XFIX_2_562915447\n    vshrn.s32       ROW1L, q1,    #16\n    vsub.s32        q1,    q1,    q6\n    vmull.s16       q6,    ROW2L, XFIX_0_541196100_PLUS_0_765366865\n    vsub.s32        q3,    q3,    q2\n    vshrn.s32       ROW2R, q1,    #16 /* ROW6L <-> ROW2R */\n    vadd.s32        q1,    q3,    q5\n    vsub.s32        q3,    q3,    q5\n    vshll.s16       q5,    ROW0L, #13\n    vshrn.s32       ROW2L, q1,    #16\n    vshrn.s32       ROW1R, q3,    #16 /* ROW5L <-> ROW1R */\n    vadd.s32        q2,    q5,    q6\n    vsub.s32        q1,    q5,    q6\n    vadd.s32        q6,    q2,    q7\n    vsub.s32        q2,    q2,    q7\n    vadd.s32        q5,    q1,    q4\n    vsub.s32        q3,    q1,    q4\n    vshrn.s32       ROW3R, q2,    #16 /* ROW7L <-> ROW3R */\n    vshrn.s32       ROW3L, q5,    #16\n    vshrn.s32       ROW0L, q6,    #16\n    vshrn.s32       ROW0R, q3,    #16 /* ROW4L <-> ROW0R */\n    /* 1-D IDCT, pass 2 (sparse variant with zero rows 4-7), right 4x8 half */\n    vld1.s16        {d2},  [ip, :64]    /* reload constants */\n    vmull.s16       q6,    ROW5L, XFIX_1_175875602\n    vmlal.s16       q6,    ROW7L, XFIX_1_175875602_MINUS_1_961570560\n    vmull.s16       q7,    ROW7L, XFIX_1_175875602\n    vmlal.s16       q7,    ROW5L, XFIX_1_175875602_MINUS_0_390180644\n    vmull.s16       q2,    ROW6L, XFIX_0_541196100\n    vshll.s16       q3,    ROW4L, #13\n    vmov            q4,    q6\n    vmlal.s16       q6,    ROW7L, XFIX_3_072711026_MINUS_2_562915447\n    vmlsl.s16       q4,    ROW5L, XFIX_0_899976223\n    vadd.s32        q1,    q3,    q2\n    vmov            q5,    q7\n    vmlal.s16       q7,    ROW5L, XFIX_1_501321110_MINUS_0_899976223\n    vadd.s32        q1,    q1,    q6\n    vadd.s32        q6,    q6,    q6\n    vmlsl.s16       q5,    ROW7L, XFIX_2_562915447\n    vshrn.s32       ROW5L, q1,    #16 /* ROW5L <-> ROW1R */\n    vsub.s32        q1,    q1,    q6\n    vmull.s16       q6,    ROW6L, XFIX_0_541196100_PLUS_0_765366865\n    vsub.s32        q3,    q3,    q2\n    vshrn.s32       ROW6R, q1,    #16\n    vadd.s32        q1,    q3,    q5\n    vsub.s32        q3,    q3,    q5\n    vshll.s16       q5,    ROW4L, #13\n    vshrn.s32       ROW6L, q1,    #16 /* ROW6L <-> ROW2R */\n    vshrn.s32       ROW5R, q3,    #16\n    vadd.s32        q2,    q5,    q6\n    vsub.s32        q1,    q5,    q6\n    vadd.s32        q6,    q2,    q7\n    vsub.s32        q2,    q2,    q7\n    vadd.s32        q5,    q1,    q4\n    vsub.s32        q3,    q1,    q4\n    vshrn.s32       ROW7R, q2,    #16\n    vshrn.s32       ROW7L, q5,    #16 /* ROW7L <-> ROW3R */\n    vshrn.s32       ROW4L, q6,    #16 /* ROW4L <-> ROW0R */\n    vshrn.s32       ROW4R, q3,    #16\n    b               2b /* Go to epilogue */\n\n    .unreq          DCT_TABLE\n    .unreq          COEF_BLOCK\n    .unreq          OUTPUT_BUF\n    .unreq          OUTPUT_COL\n    .unreq          TMP1\n    .unreq          TMP2\n    .unreq          TMP3\n    .unreq          TMP4\n\n    .unreq          ROW0L\n    .unreq          ROW0R\n    .unreq          ROW1L\n    .unreq          ROW1R\n    .unreq          ROW2L\n    .unreq          ROW2R\n    .unreq          ROW3L\n    .unreq          ROW3R\n    .unreq          ROW4L\n    .unreq          ROW4R\n    .unreq          ROW5L\n    .unreq          ROW5R\n    .unreq          ROW6L\n    .unreq          ROW6R\n    .unreq          ROW7L\n    .unreq          ROW7R\n.endfunc\n\n\n/*****************************************************************************/\n\n/*\n * jsimd_idct_ifast_neon\n *\n * This function contains a fast, not so accurate integer implementation of\n * the inverse DCT (Discrete Cosine Transform). It uses the same calculations\n * and produces exactly the same output as IJG's original 'jpeg_idct_ifast'\n * function from jidctfst.c\n *\n * Normally 1-D AAN DCT needs 5 multiplications and 29 additions.\n * But in ARM NEON case some extra additions are required because VQDMULH\n * instruction can't handle the constants larger than 1. So the expressions\n * like \"x * 1.082392200\" have to be converted to \"x * 0.082392200 + x\",\n * which introduces an extra addition. Overall, there are 6 extra additions\n * per 1-D IDCT pass, totalling to 5 VQDMULH and 35 VADD/VSUB instructions.\n */\n\n#define XFIX_1_082392200 d0[0]\n#define XFIX_1_414213562 d0[1]\n#define XFIX_1_847759065 d0[2]\n#define XFIX_2_613125930 d0[3]\n\n.balign 16\njsimd_idct_ifast_neon_consts:\n    .short (277 * 128 - 256 * 128) /* XFIX_1_082392200 */\n    .short (362 * 128 - 256 * 128) /* XFIX_1_414213562 */\n    .short (473 * 128 - 256 * 128) /* XFIX_1_847759065 */\n    .short (669 * 128 - 512 * 128) /* XFIX_2_613125930 */\n\nasm_function jsimd_idct_ifast_neon\n\n    DCT_TABLE       .req r0\n    COEF_BLOCK      .req r1\n    OUTPUT_BUF      .req r2\n    OUTPUT_COL      .req r3\n    TMP1            .req r0\n    TMP2            .req r1\n    TMP3            .req r2\n    TMP4            .req ip\n\n    /* Load and dequantize coefficients into NEON registers\n     * with the following allocation:\n     *       0 1 2 3 | 4 5 6 7\n     *      ---------+--------\n     *   0 | d16     | d17     ( q8  )\n     *   1 | d18     | d19     ( q9  )\n     *   2 | d20     | d21     ( q10 )\n     *   3 | d22     | d23     ( q11 )\n     *   4 | d24     | d25     ( q12 )\n     *   5 | d26     | d27     ( q13 )\n     *   6 | d28     | d29     ( q14 )\n     *   7 | d30     | d31     ( q15 )\n     */\n    adr             ip, jsimd_idct_ifast_neon_consts\n    vld1.16         {d16, d17, d18, d19}, [COEF_BLOCK, :128]!\n    vld1.16         {d0, d1, d2, d3}, [DCT_TABLE, :128]!\n    vld1.16         {d20, d21, d22, d23}, [COEF_BLOCK, :128]!\n    vmul.s16        q8,  q8,  q0\n    vld1.16         {d4, d5, d6, d7}, [DCT_TABLE, :128]!\n    vmul.s16        q9,  q9,  q1\n    vld1.16         {d24, d25, d26, d27}, [COEF_BLOCK, :128]!\n    vmul.s16        q10, q10, q2\n    vld1.16         {d0, d1, d2, d3}, [DCT_TABLE, :128]!\n    vmul.s16        q11, q11, q3\n    vld1.16         {d28, d29, d30, d31}, [COEF_BLOCK, :128]\n    vmul.s16        q12, q12, q0\n    vld1.16         {d4, d5, d6, d7}, [DCT_TABLE, :128]!\n    vmul.s16        q14, q14, q2\n    vmul.s16        q13, q13, q1\n    vld1.16         {d0}, [ip, :64] /* load constants */\n    vmul.s16        q15, q15, q3\n    vpush           {d8-d13}        /* save NEON registers */\n    /* 1-D IDCT, pass 1 */\n    vsub.s16        q2,  q10, q14\n    vadd.s16        q14, q10, q14\n    vsub.s16        q1,  q11, q13\n    vadd.s16        q13, q11, q13\n    vsub.s16        q5,  q9,  q15\n    vadd.s16        q15, q9,  q15\n    vqdmulh.s16     q4,  q2,  XFIX_1_414213562\n    vqdmulh.s16     q6,  q1,  XFIX_2_613125930\n    vadd.s16        q3,  q1,  q1\n    vsub.s16        q1,  q5,  q1\n    vadd.s16        q10, q2,  q4\n    vqdmulh.s16     q4,  q1,  XFIX_1_847759065\n    vsub.s16        q2,  q15, q13\n    vadd.s16        q3,  q3,  q6\n    vqdmulh.s16     q6,  q2,  XFIX_1_414213562\n    vadd.s16        q1,  q1,  q4\n    vqdmulh.s16     q4,  q5,  XFIX_1_082392200\n    vsub.s16        q10, q10, q14\n    vadd.s16        q2,  q2,  q6\n    vsub.s16        q6,  q8,  q12\n    vadd.s16        q12, q8,  q12\n    vadd.s16        q9,  q5,  q4\n    vadd.s16        q5,  q6,  q10\n    vsub.s16        q10, q6,  q10\n    vadd.s16        q6,  q15, q13\n    vadd.s16        q8,  q12, q14\n    vsub.s16        q3,  q6,  q3\n    vsub.s16        q12, q12, q14\n    vsub.s16        q3,  q3,  q1\n    vsub.s16        q1,  q9,  q1\n    vadd.s16        q2,  q3,  q2\n    vsub.s16        q15, q8,  q6\n    vadd.s16        q1,  q1,  q2\n    vadd.s16        q8,  q8,  q6\n    vadd.s16        q14, q5,  q3\n    vsub.s16        q9,  q5,  q3\n    vsub.s16        q13, q10, q2\n    vadd.s16        q10, q10, q2\n      /* Transpose */\n      vtrn.16         q8,  q9\n    vsub.s16        q11, q12, q1\n      vtrn.16         q14, q15\n    vadd.s16        q12, q12, q1\n      vtrn.16         q10, q11\n      vtrn.16         q12, q13\n      vtrn.32         q9,  q11\n      vtrn.32         q12, q14\n      vtrn.32         q8,  q10\n      vtrn.32         q13, q15\n      vswp            d28, d21\n      vswp            d26, d19\n    /* 1-D IDCT, pass 2 */\n    vsub.s16        q2,  q10, q14\n      vswp            d30, d23\n    vadd.s16        q14, q10, q14\n      vswp            d24, d17\n    vsub.s16        q1,  q11, q13\n    vadd.s16        q13, q11, q13\n    vsub.s16        q5,  q9,  q15\n    vadd.s16        q15, q9,  q15\n    vqdmulh.s16     q4,  q2,  XFIX_1_414213562\n    vqdmulh.s16     q6,  q1,  XFIX_2_613125930\n    vadd.s16        q3,  q1,  q1\n    vsub.s16        q1,  q5,  q1\n    vadd.s16        q10, q2,  q4\n    vqdmulh.s16     q4,  q1,  XFIX_1_847759065\n    vsub.s16        q2,  q15, q13\n    vadd.s16        q3,  q3,  q6\n    vqdmulh.s16     q6,  q2,  XFIX_1_414213562\n    vadd.s16        q1,  q1,  q4\n    vqdmulh.s16     q4,  q5,  XFIX_1_082392200\n    vsub.s16        q10, q10, q14\n    vadd.s16        q2,  q2,  q6\n    vsub.s16        q6,  q8,  q12\n    vadd.s16        q12, q8,  q12\n    vadd.s16        q9,  q5,  q4\n    vadd.s16        q5,  q6,  q10\n    vsub.s16        q10, q6,  q10\n    vadd.s16        q6,  q15, q13\n    vadd.s16        q8,  q12, q14\n    vsub.s16        q3,  q6,  q3\n    vsub.s16        q12, q12, q14\n    vsub.s16        q3,  q3,  q1\n    vsub.s16        q1,  q9,  q1\n    vadd.s16        q2,  q3,  q2\n    vsub.s16        q15, q8,  q6\n    vadd.s16        q1,  q1,  q2\n    vadd.s16        q8,  q8,  q6\n    vadd.s16        q14, q5,  q3\n    vsub.s16        q9,  q5,  q3\n    vsub.s16        q13, q10, q2\n    vpop            {d8-d13}        /* restore NEON registers */\n    vadd.s16        q10, q10, q2\n    vsub.s16        q11, q12, q1\n    vadd.s16        q12, q12, q1\n    /* Descale to 8-bit and range limit */\n    vmov.u8         q0,  #0x80\n    vqshrn.s16      d16, q8,  #5\n    vqshrn.s16      d17, q9,  #5\n    vqshrn.s16      d18, q10, #5\n    vqshrn.s16      d19, q11, #5\n    vqshrn.s16      d20, q12, #5\n    vqshrn.s16      d21, q13, #5\n    vqshrn.s16      d22, q14, #5\n    vqshrn.s16      d23, q15, #5\n    vadd.u8         q8,  q8,  q0\n    vadd.u8         q9,  q9,  q0\n    vadd.u8         q10, q10, q0\n    vadd.u8         q11, q11, q0\n    /* Transpose the final 8-bit samples */\n    vtrn.16         q8,  q9\n    vtrn.16         q10, q11\n    vtrn.32         q8,  q10\n    vtrn.32         q9,  q11\n    vtrn.8          d16, d17\n    vtrn.8          d18, d19\n      /* Store results to the output buffer */\n      ldmia           OUTPUT_BUF!, {TMP1, TMP2}\n      add             TMP1, TMP1, OUTPUT_COL\n      add             TMP2, TMP2, OUTPUT_COL\n      vst1.8          {d16}, [TMP1]\n      vst1.8          {d17}, [TMP2]\n      ldmia           OUTPUT_BUF!, {TMP1, TMP2}\n      add             TMP1, TMP1, OUTPUT_COL\n      add             TMP2, TMP2, OUTPUT_COL\n      vst1.8          {d18}, [TMP1]\n    vtrn.8          d20, d21\n      vst1.8          {d19}, [TMP2]\n      ldmia           OUTPUT_BUF, {TMP1, TMP2, TMP3, TMP4}\n      add             TMP1, TMP1, OUTPUT_COL\n      add             TMP2, TMP2, OUTPUT_COL\n      add             TMP3, TMP3, OUTPUT_COL\n      add             TMP4, TMP4, OUTPUT_COL\n      vst1.8          {d20}, [TMP1]\n    vtrn.8          d22, d23\n      vst1.8          {d21}, [TMP2]\n      vst1.8          {d22}, [TMP3]\n      vst1.8          {d23}, [TMP4]\n    bx              lr\n\n    .unreq          DCT_TABLE\n    .unreq          COEF_BLOCK\n    .unreq          OUTPUT_BUF\n    .unreq          OUTPUT_COL\n    .unreq          TMP1\n    .unreq          TMP2\n    .unreq          TMP3\n    .unreq          TMP4\n.endfunc\n\n\n/*****************************************************************************/\n\n/*\n * jsimd_idct_4x4_neon\n *\n * This function contains inverse-DCT code for getting reduced-size\n * 4x4 pixels output from an 8x8 DCT block. It uses the same  calculations\n * and produces exactly the same output as IJG's original 'jpeg_idct_4x4'\n * function from jpeg-6b (jidctred.c).\n *\n * NOTE: jpeg-8 has an improved implementation of 4x4 inverse-DCT, which\n *       requires much less arithmetic operations and hence should be faster.\n *       The primary purpose of this particular NEON optimized function is\n *       bit exact compatibility with jpeg-6b.\n *\n * TODO: a bit better instructions scheduling can be achieved by expanding\n *       idct_helper/transpose_4x4 macros and reordering instructions,\n *       but readability will suffer somewhat.\n */\n\n#define CONST_BITS  13\n\n#define FIX_0_211164243  (1730)  /* FIX(0.211164243) */\n#define FIX_0_509795579  (4176)  /* FIX(0.509795579) */\n#define FIX_0_601344887  (4926)  /* FIX(0.601344887) */\n#define FIX_0_720959822  (5906)  /* FIX(0.720959822) */\n#define FIX_0_765366865  (6270)  /* FIX(0.765366865) */\n#define FIX_0_850430095  (6967)  /* FIX(0.850430095) */\n#define FIX_0_899976223  (7373)  /* FIX(0.899976223) */\n#define FIX_1_061594337  (8697)  /* FIX(1.061594337) */\n#define FIX_1_272758580  (10426) /* FIX(1.272758580) */\n#define FIX_1_451774981  (11893) /* FIX(1.451774981) */\n#define FIX_1_847759065  (15137) /* FIX(1.847759065) */\n#define FIX_2_172734803  (17799) /* FIX(2.172734803) */\n#define FIX_2_562915447  (20995) /* FIX(2.562915447) */\n#define FIX_3_624509785  (29692) /* FIX(3.624509785) */\n\n.balign 16\njsimd_idct_4x4_neon_consts:\n    .short     FIX_1_847759065     /* d0[0] */\n    .short     -FIX_0_765366865    /* d0[1] */\n    .short     -FIX_0_211164243    /* d0[2] */\n    .short     FIX_1_451774981     /* d0[3] */\n    .short     -FIX_2_172734803    /* d1[0] */\n    .short     FIX_1_061594337     /* d1[1] */\n    .short     -FIX_0_509795579    /* d1[2] */\n    .short     -FIX_0_601344887    /* d1[3] */\n    .short     FIX_0_899976223     /* d2[0] */\n    .short     FIX_2_562915447     /* d2[1] */\n    .short     1 << (CONST_BITS+1) /* d2[2] */\n    .short     0                   /* d2[3] */\n\n.macro idct_helper x4, x6, x8, x10, x12, x14, x16, shift, y26, y27, y28, y29\n    vmull.s16       q14, \\x4,  d2[2]\n    vmlal.s16       q14, \\x8,  d0[0]\n    vmlal.s16       q14, \\x14, d0[1]\n\n    vmull.s16       q13, \\x16, d1[2]\n    vmlal.s16       q13, \\x12, d1[3]\n    vmlal.s16       q13, \\x10, d2[0]\n    vmlal.s16       q13, \\x6,  d2[1]\n\n    vmull.s16       q15, \\x4,  d2[2]\n    vmlsl.s16       q15, \\x8,  d0[0]\n    vmlsl.s16       q15, \\x14, d0[1]\n\n    vmull.s16       q12, \\x16, d0[2]\n    vmlal.s16       q12, \\x12, d0[3]\n    vmlal.s16       q12, \\x10, d1[0]\n    vmlal.s16       q12, \\x6,  d1[1]\n\n    vadd.s32        q10, q14, q13\n    vsub.s32        q14, q14, q13\n\n.if \\shift > 16\n    vrshr.s32       q10,  q10, #\\shift\n    vrshr.s32       q14,  q14, #\\shift\n    vmovn.s32       \\y26, q10\n    vmovn.s32       \\y29, q14\n.else\n    vrshrn.s32      \\y26, q10, #\\shift\n    vrshrn.s32      \\y29, q14, #\\shift\n.endif\n\n    vadd.s32        q10, q15, q12\n    vsub.s32        q15, q15, q12\n\n.if \\shift > 16\n    vrshr.s32       q10,  q10, #\\shift\n    vrshr.s32       q15,  q15, #\\shift\n    vmovn.s32       \\y27, q10\n    vmovn.s32       \\y28, q15\n.else\n    vrshrn.s32      \\y27, q10, #\\shift\n    vrshrn.s32      \\y28, q15, #\\shift\n.endif\n\n.endm\n\nasm_function jsimd_idct_4x4_neon\n\n    DCT_TABLE       .req r0\n    COEF_BLOCK      .req r1\n    OUTPUT_BUF      .req r2\n    OUTPUT_COL      .req r3\n    TMP1            .req r0\n    TMP2            .req r1\n    TMP3            .req r2\n    TMP4            .req ip\n\n    vpush           {d8-d15}\n\n    /* Load constants (d3 is just used for padding) */\n    adr             TMP4, jsimd_idct_4x4_neon_consts\n    vld1.16         {d0, d1, d2, d3}, [TMP4, :128]\n\n    /* Load all COEF_BLOCK into NEON registers with the following allocation:\n     *       0 1 2 3 | 4 5 6 7\n     *      ---------+--------\n     *   0 | d4      | d5\n     *   1 | d6      | d7\n     *   2 | d8      | d9\n     *   3 | d10     | d11\n     *   4 | -       | -\n     *   5 | d12     | d13\n     *   6 | d14     | d15\n     *   7 | d16     | d17\n     */\n    vld1.16         {d4, d5, d6, d7}, [COEF_BLOCK, :128]!\n    vld1.16         {d8, d9, d10, d11}, [COEF_BLOCK, :128]!\n    add COEF_BLOCK, COEF_BLOCK, #16\n    vld1.16         {d12, d13, d14, d15}, [COEF_BLOCK, :128]!\n    vld1.16         {d16, d17}, [COEF_BLOCK, :128]!\n    /* dequantize */\n    vld1.16         {d18, d19, d20, d21}, [DCT_TABLE, :128]!\n    vmul.s16        q2, q2, q9\n    vld1.16         {d22, d23, d24, d25}, [DCT_TABLE, :128]!\n    vmul.s16        q3, q3, q10\n    vmul.s16        q4, q4, q11\n    add             DCT_TABLE, DCT_TABLE, #16\n    vld1.16         {d26, d27, d28, d29}, [DCT_TABLE, :128]!\n    vmul.s16        q5, q5, q12\n    vmul.s16        q6, q6, q13\n    vld1.16         {d30, d31}, [DCT_TABLE, :128]!\n    vmul.s16        q7, q7, q14\n    vmul.s16        q8, q8, q15\n\n    /* Pass 1 */\n    idct_helper     d4, d6, d8, d10, d12, d14, d16, 12, d4, d6, d8, d10\n    transpose_4x4   d4, d6, d8, d10\n    idct_helper     d5, d7, d9, d11, d13, d15, d17, 12, d5, d7, d9, d11\n    transpose_4x4   d5, d7, d9, d11\n\n    /* Pass 2 */\n    idct_helper     d4, d6, d8, d10, d7, d9, d11, 19, d26, d27, d28, d29\n    transpose_4x4   d26, d27, d28, d29\n\n    /* Range limit */\n    vmov.u16        q15, #0x80\n    vadd.s16        q13, q13, q15\n    vadd.s16        q14, q14, q15\n    vqmovun.s16     d26, q13\n    vqmovun.s16     d27, q14\n\n    /* Store results to the output buffer */\n    ldmia           OUTPUT_BUF, {TMP1, TMP2, TMP3, TMP4}\n    add             TMP1, TMP1, OUTPUT_COL\n    add             TMP2, TMP2, OUTPUT_COL\n    add             TMP3, TMP3, OUTPUT_COL\n    add             TMP4, TMP4, OUTPUT_COL\n\n#if defined(__ARMEL__) && !RESPECT_STRICT_ALIGNMENT\n    /* We can use much less instructions on little endian systems if the\n     * OS kernel is not configured to trap unaligned memory accesses\n     */\n    vst1.32         {d26[0]}, [TMP1]!\n    vst1.32         {d27[0]}, [TMP3]!\n    vst1.32         {d26[1]}, [TMP2]!\n    vst1.32         {d27[1]}, [TMP4]!\n#else\n    vst1.8          {d26[0]}, [TMP1]!\n    vst1.8          {d27[0]}, [TMP3]!\n    vst1.8          {d26[1]}, [TMP1]!\n    vst1.8          {d27[1]}, [TMP3]!\n    vst1.8          {d26[2]}, [TMP1]!\n    vst1.8          {d27[2]}, [TMP3]!\n    vst1.8          {d26[3]}, [TMP1]!\n    vst1.8          {d27[3]}, [TMP3]!\n\n    vst1.8          {d26[4]}, [TMP2]!\n    vst1.8          {d27[4]}, [TMP4]!\n    vst1.8          {d26[5]}, [TMP2]!\n    vst1.8          {d27[5]}, [TMP4]!\n    vst1.8          {d26[6]}, [TMP2]!\n    vst1.8          {d27[6]}, [TMP4]!\n    vst1.8          {d26[7]}, [TMP2]!\n    vst1.8          {d27[7]}, [TMP4]!\n#endif\n\n    vpop            {d8-d15}\n    bx              lr\n\n    .unreq          DCT_TABLE\n    .unreq          COEF_BLOCK\n    .unreq          OUTPUT_BUF\n    .unreq          OUTPUT_COL\n    .unreq          TMP1\n    .unreq          TMP2\n    .unreq          TMP3\n    .unreq          TMP4\n.endfunc\n\n.purgem idct_helper\n\n\n/*****************************************************************************/\n\n/*\n * jsimd_idct_2x2_neon\n *\n * This function contains inverse-DCT code for getting reduced-size\n * 2x2 pixels output from an 8x8 DCT block. It uses the same  calculations\n * and produces exactly the same output as IJG's original 'jpeg_idct_2x2'\n * function from jpeg-6b (jidctred.c).\n *\n * NOTE: jpeg-8 has an improved implementation of 2x2 inverse-DCT, which\n *       requires much less arithmetic operations and hence should be faster.\n *       The primary purpose of this particular NEON optimized function is\n *       bit exact compatibility with jpeg-6b.\n */\n\n.balign 8\njsimd_idct_2x2_neon_consts:\n    .short     -FIX_0_720959822    /* d0[0] */\n    .short     FIX_0_850430095     /* d0[1] */\n    .short     -FIX_1_272758580    /* d0[2] */\n    .short     FIX_3_624509785     /* d0[3] */\n\n.macro idct_helper x4, x6, x10, x12, x16, shift, y26, y27\n    vshll.s16  q14,  \\x4,  #15\n    vmull.s16  q13,  \\x6,  d0[3]\n    vmlal.s16  q13,  \\x10, d0[2]\n    vmlal.s16  q13,  \\x12, d0[1]\n    vmlal.s16  q13,  \\x16, d0[0]\n\n    vadd.s32   q10,  q14,  q13\n    vsub.s32   q14,  q14,  q13\n\n.if \\shift > 16\n    vrshr.s32  q10,  q10,  #\\shift\n    vrshr.s32  q14,  q14,  #\\shift\n    vmovn.s32  \\y26, q10\n    vmovn.s32  \\y27, q14\n.else\n    vrshrn.s32 \\y26, q10,  #\\shift\n    vrshrn.s32 \\y27, q14,  #\\shift\n.endif\n\n.endm\n\nasm_function jsimd_idct_2x2_neon\n\n    DCT_TABLE       .req r0\n    COEF_BLOCK      .req r1\n    OUTPUT_BUF      .req r2\n    OUTPUT_COL      .req r3\n    TMP1            .req r0\n    TMP2            .req ip\n\n    vpush           {d8-d15}\n\n    /* Load constants */\n    adr             TMP2, jsimd_idct_2x2_neon_consts\n    vld1.16         {d0}, [TMP2, :64]\n\n    /* Load all COEF_BLOCK into NEON registers with the following allocation:\n     *       0 1 2 3 | 4 5 6 7\n     *      ---------+--------\n     *   0 | d4      | d5\n     *   1 | d6      | d7\n     *   2 | -       | -\n     *   3 | d10     | d11\n     *   4 | -       | -\n     *   5 | d12     | d13\n     *   6 | -       | -\n     *   7 | d16     | d17\n     */\n    vld1.16         {d4, d5, d6, d7}, [COEF_BLOCK, :128]!\n    add             COEF_BLOCK, COEF_BLOCK, #16\n    vld1.16         {d10, d11}, [COEF_BLOCK, :128]!\n    add             COEF_BLOCK, COEF_BLOCK, #16\n    vld1.16         {d12, d13}, [COEF_BLOCK, :128]!\n    add             COEF_BLOCK, COEF_BLOCK, #16\n    vld1.16         {d16, d17}, [COEF_BLOCK, :128]!\n    /* Dequantize */\n    vld1.16         {d18, d19, d20, d21}, [DCT_TABLE, :128]!\n    vmul.s16        q2, q2, q9\n    vmul.s16        q3, q3, q10\n    add             DCT_TABLE, DCT_TABLE, #16\n    vld1.16         {d24, d25}, [DCT_TABLE, :128]!\n    vmul.s16        q5, q5, q12\n    add             DCT_TABLE, DCT_TABLE, #16\n    vld1.16         {d26, d27}, [DCT_TABLE, :128]!\n    vmul.s16        q6, q6, q13\n    add             DCT_TABLE, DCT_TABLE, #16\n    vld1.16         {d30, d31}, [DCT_TABLE, :128]!\n    vmul.s16        q8, q8, q15\n\n    /* Pass 1 */\n#if 0\n    idct_helper     d4, d6, d10, d12, d16, 13, d4, d6\n    transpose_4x4   d4, d6, d8,  d10\n    idct_helper     d5, d7, d11, d13, d17, 13, d5, d7\n    transpose_4x4   d5, d7, d9,  d11\n#else\n    vmull.s16       q13, d6,  d0[3]\n    vmlal.s16       q13, d10, d0[2]\n    vmlal.s16       q13, d12, d0[1]\n    vmlal.s16       q13, d16, d0[0]\n    vmull.s16       q12, d7,  d0[3]\n    vmlal.s16       q12, d11, d0[2]\n    vmlal.s16       q12, d13, d0[1]\n    vmlal.s16       q12, d17, d0[0]\n    vshll.s16       q14, d4,  #15\n    vshll.s16       q15, d5,  #15\n    vadd.s32        q10, q14, q13\n    vsub.s32        q14, q14, q13\n    vrshrn.s32      d4,  q10, #13\n    vrshrn.s32      d6,  q14, #13\n    vadd.s32        q10, q15, q12\n    vsub.s32        q14, q15, q12\n    vrshrn.s32      d5,  q10, #13\n    vrshrn.s32      d7,  q14, #13\n    vtrn.16         q2,  q3\n    vtrn.32         q3,  q5\n#endif\n\n    /* Pass 2 */\n    idct_helper     d4, d6, d10, d7, d11, 20, d26, d27\n\n    /* Range limit */\n    vmov.u16        q15, #0x80\n    vadd.s16        q13, q13, q15\n    vqmovun.s16     d26, q13\n    vqmovun.s16     d27, q13\n\n    /* Store results to the output buffer */\n    ldmia           OUTPUT_BUF, {TMP1, TMP2}\n    add             TMP1, TMP1, OUTPUT_COL\n    add             TMP2, TMP2, OUTPUT_COL\n\n    vst1.8          {d26[0]}, [TMP1]!\n    vst1.8          {d27[4]}, [TMP1]!\n    vst1.8          {d26[1]}, [TMP2]!\n    vst1.8          {d27[5]}, [TMP2]!\n\n    vpop            {d8-d15}\n    bx              lr\n\n    .unreq          DCT_TABLE\n    .unreq          COEF_BLOCK\n    .unreq          OUTPUT_BUF\n    .unreq          OUTPUT_COL\n    .unreq          TMP1\n    .unreq          TMP2\n.endfunc\n\n.purgem idct_helper\n\n\n/*****************************************************************************/\n\n/*\n * jsimd_ycc_extrgb_convert_neon\n * jsimd_ycc_extbgr_convert_neon\n * jsimd_ycc_extrgbx_convert_neon\n * jsimd_ycc_extbgrx_convert_neon\n * jsimd_ycc_extxbgr_convert_neon\n * jsimd_ycc_extxrgb_convert_neon\n *\n * Colorspace conversion YCbCr -> RGB\n */\n\n\n.macro do_load size\n    .if \\size == 8\n        vld1.8  {d4}, [U, :64]!\n        vld1.8  {d5}, [V, :64]!\n        vld1.8  {d0}, [Y, :64]!\n        pld     [U, #64]\n        pld     [V, #64]\n        pld     [Y, #64]\n    .elseif \\size == 4\n        vld1.8  {d4[0]}, [U]!\n        vld1.8  {d4[1]}, [U]!\n        vld1.8  {d4[2]}, [U]!\n        vld1.8  {d4[3]}, [U]!\n        vld1.8  {d5[0]}, [V]!\n        vld1.8  {d5[1]}, [V]!\n        vld1.8  {d5[2]}, [V]!\n        vld1.8  {d5[3]}, [V]!\n        vld1.8  {d0[0]}, [Y]!\n        vld1.8  {d0[1]}, [Y]!\n        vld1.8  {d0[2]}, [Y]!\n        vld1.8  {d0[3]}, [Y]!\n    .elseif \\size == 2\n        vld1.8  {d4[4]}, [U]!\n        vld1.8  {d4[5]}, [U]!\n        vld1.8  {d5[4]}, [V]!\n        vld1.8  {d5[5]}, [V]!\n        vld1.8  {d0[4]}, [Y]!\n        vld1.8  {d0[5]}, [Y]!\n    .elseif \\size == 1\n        vld1.8  {d4[6]}, [U]!\n        vld1.8  {d5[6]}, [V]!\n        vld1.8  {d0[6]}, [Y]!\n    .else\n        .error unsupported macroblock size\n    .endif\n.endm\n\n.macro do_store bpp, size\n    .if \\bpp == 24\n        .if \\size == 8\n            vst3.8  {d10, d11, d12}, [RGB]!\n        .elseif \\size == 4\n            vst3.8  {d10[0], d11[0], d12[0]}, [RGB]!\n            vst3.8  {d10[1], d11[1], d12[1]}, [RGB]!\n            vst3.8  {d10[2], d11[2], d12[2]}, [RGB]!\n            vst3.8  {d10[3], d11[3], d12[3]}, [RGB]!\n        .elseif \\size == 2\n            vst3.8  {d10[4], d11[4], d12[4]}, [RGB]!\n            vst3.8  {d10[5], d11[5], d12[5]}, [RGB]!\n        .elseif \\size == 1\n            vst3.8  {d10[6], d11[6], d12[6]}, [RGB]!\n        .else\n            .error unsupported macroblock size\n        .endif\n    .elseif \\bpp == 32\n        .if \\size == 8\n            vst4.8  {d10, d11, d12, d13}, [RGB]!\n        .elseif \\size == 4\n            vst4.8  {d10[0], d11[0], d12[0], d13[0]}, [RGB]!\n            vst4.8  {d10[1], d11[1], d12[1], d13[1]}, [RGB]!\n            vst4.8  {d10[2], d11[2], d12[2], d13[2]}, [RGB]!\n            vst4.8  {d10[3], d11[3], d12[3], d13[3]}, [RGB]!\n        .elseif \\size == 2\n            vst4.8  {d10[4], d11[4], d12[4], d13[4]}, [RGB]!\n            vst4.8  {d10[5], d11[5], d12[5], d13[5]}, [RGB]!\n        .elseif \\size == 1\n            vst4.8  {d10[6], d11[6], d12[6], d13[6]}, [RGB]!\n        .else\n            .error unsupported macroblock size\n        .endif\n    .else\n        .error unsupported bpp\n    .endif\n.endm\n\n.macro generate_jsimd_ycc_rgb_convert_neon colorid, bpp, r_offs, g_offs, b_offs\n\n/*\n * 2 stage pipelined YCbCr->RGB conversion\n */\n\n.macro do_yuv_to_rgb_stage1\n    vaddw.u8        q3, q1, d4     /* q3 = u - 128 */\n    vaddw.u8        q4, q1, d5     /* q2 = v - 128 */\n    vmull.s16       q10, d6, d1[1] /* multiply by -11277 */\n    vmlal.s16       q10, d8, d1[2] /* multiply by -23401 */\n    vmull.s16       q11, d7, d1[1] /* multiply by -11277 */\n    vmlal.s16       q11, d9, d1[2] /* multiply by -23401 */\n    vmull.s16       q12, d8, d1[0] /* multiply by 22971 */\n    vmull.s16       q13, d9, d1[0] /* multiply by 22971 */\n    vmull.s16       q14, d6, d1[3] /* multiply by 29033 */\n    vmull.s16       q15, d7, d1[3] /* multiply by 29033 */\n.endm\n\n.macro do_yuv_to_rgb_stage2\n    vrshrn.s32      d20, q10, #15\n    vrshrn.s32      d21, q11, #15\n    vrshrn.s32      d24, q12, #14\n    vrshrn.s32      d25, q13, #14\n    vrshrn.s32      d28, q14, #14\n    vrshrn.s32      d29, q15, #14\n    vaddw.u8        q10, q10, d0\n    vaddw.u8        q12, q12, d0\n    vaddw.u8        q14, q14, d0\n    vqmovun.s16     d1\\g_offs, q10\n    vqmovun.s16     d1\\r_offs, q12\n    vqmovun.s16     d1\\b_offs, q14\n.endm\n\n.macro do_yuv_to_rgb_stage2_store_load_stage1\n    vld1.8          {d4}, [U, :64]!\n      vrshrn.s32      d20, q10, #15\n      vrshrn.s32      d21, q11, #15\n      vrshrn.s32      d24, q12, #14\n      vrshrn.s32      d25, q13, #14\n      vrshrn.s32      d28, q14, #14\n    vld1.8          {d5}, [V, :64]!\n      vrshrn.s32      d29, q15, #14\n      vaddw.u8        q10, q10, d0\n      vaddw.u8        q12, q12, d0\n      vaddw.u8        q14, q14, d0\n      vqmovun.s16     d1\\g_offs, q10\n    vld1.8          {d0}, [Y, :64]!\n      vqmovun.s16     d1\\r_offs, q12\n    pld             [U, #64]\n    pld             [V, #64]\n    pld             [Y, #64]\n      vqmovun.s16     d1\\b_offs, q14\n    vaddw.u8        q3, q1, d4     /* q3 = u - 128 */\n    vaddw.u8        q4, q1, d5     /* q2 = v - 128 */\n      do_store        \\bpp, 8\n    vmull.s16       q10, d6, d1[1] /* multiply by -11277 */\n    vmlal.s16       q10, d8, d1[2] /* multiply by -23401 */\n    vmull.s16       q11, d7, d1[1] /* multiply by -11277 */\n    vmlal.s16       q11, d9, d1[2] /* multiply by -23401 */\n    vmull.s16       q12, d8, d1[0] /* multiply by 22971 */\n    vmull.s16       q13, d9, d1[0] /* multiply by 22971 */\n    vmull.s16       q14, d6, d1[3] /* multiply by 29033 */\n    vmull.s16       q15, d7, d1[3] /* multiply by 29033 */\n.endm\n\n.macro do_yuv_to_rgb\n    do_yuv_to_rgb_stage1\n    do_yuv_to_rgb_stage2\n.endm\n\n/* Apple gas crashes on adrl, work around that by using adr.\n * But this requires a copy of these constants for each function.\n */\n\n.balign 16\njsimd_ycc_\\colorid\\()_neon_consts:\n    .short          0,      0,     0,      0\n    .short          22971, -11277, -23401, 29033\n    .short          -128,  -128,   -128,   -128\n    .short          -128,  -128,   -128,   -128\n\nasm_function jsimd_ycc_\\colorid\\()_convert_neon\n    OUTPUT_WIDTH    .req r0\n    INPUT_BUF       .req r1\n    INPUT_ROW       .req r2\n    OUTPUT_BUF      .req r3\n    NUM_ROWS        .req r4\n\n    INPUT_BUF0      .req r5\n    INPUT_BUF1      .req r6\n    INPUT_BUF2      .req INPUT_BUF\n\n    RGB             .req r7\n    Y               .req r8\n    U               .req r9\n    V               .req r10\n    N               .req ip\n\n    /* Load constants to d1, d2, d3 (d0 is just used for padding) */\n    adr             ip, jsimd_ycc_\\colorid\\()_neon_consts\n    vld1.16         {d0, d1, d2, d3}, [ip, :128]\n\n    /* Save ARM registers and handle input arguments */\n    push            {r4, r5, r6, r7, r8, r9, r10, lr}\n    ldr             NUM_ROWS, [sp, #(4 * 8)]\n    ldr             INPUT_BUF0, [INPUT_BUF]\n    ldr             INPUT_BUF1, [INPUT_BUF, #4]\n    ldr             INPUT_BUF2, [INPUT_BUF, #8]\n    .unreq          INPUT_BUF\n\n    /* Save NEON registers */\n    vpush           {d8-d15}\n\n    /* Initially set d10, d11, d12, d13 to 0xFF */\n    vmov.u8         q5, #255\n    vmov.u8         q6, #255\n\n    /* Outer loop over scanlines */\n    cmp             NUM_ROWS, #1\n    blt             9f\n0:\n    ldr             Y, [INPUT_BUF0, INPUT_ROW, lsl #2]\n    ldr             U, [INPUT_BUF1, INPUT_ROW, lsl #2]\n    mov             N, OUTPUT_WIDTH\n    ldr             V, [INPUT_BUF2, INPUT_ROW, lsl #2]\n    add             INPUT_ROW, INPUT_ROW, #1\n    ldr             RGB, [OUTPUT_BUF], #4\n\n    /* Inner loop over pixels */\n    subs            N, N, #8\n    blt             3f\n    do_load         8\n    do_yuv_to_rgb_stage1\n    subs            N, N, #8\n    blt             2f\n1:\n    do_yuv_to_rgb_stage2_store_load_stage1\n    subs            N, N, #8\n    bge             1b\n2:\n    do_yuv_to_rgb_stage2\n    do_store        \\bpp, 8\n    tst             N, #7\n    beq             8f\n3:\n    tst             N, #4\n    beq             3f\n    do_load         4\n3:\n    tst             N, #2\n    beq             4f\n    do_load         2\n4:\n    tst             N, #1\n    beq             5f\n    do_load         1\n5:\n    do_yuv_to_rgb\n    tst             N, #4\n    beq             6f\n    do_store        \\bpp, 4\n6:\n    tst             N, #2\n    beq             7f\n    do_store        \\bpp, 2\n7:\n    tst             N, #1\n    beq             8f\n    do_store        \\bpp, 1\n8:\n    subs            NUM_ROWS, NUM_ROWS, #1\n    bgt             0b\n9:\n    /* Restore all registers and return */\n    vpop            {d8-d15}\n    pop             {r4, r5, r6, r7, r8, r9, r10, pc}\n\n    .unreq          OUTPUT_WIDTH\n    .unreq          INPUT_ROW\n    .unreq          OUTPUT_BUF\n    .unreq          NUM_ROWS\n    .unreq          INPUT_BUF0\n    .unreq          INPUT_BUF1\n    .unreq          INPUT_BUF2\n    .unreq          RGB\n    .unreq          Y\n    .unreq          U\n    .unreq          V\n    .unreq          N\n.endfunc\n\n.purgem do_yuv_to_rgb\n.purgem do_yuv_to_rgb_stage1\n.purgem do_yuv_to_rgb_stage2\n.purgem do_yuv_to_rgb_stage2_store_load_stage1\n\n.endm\n\n/*--------------------------------- id ----- bpp R  G  B */\ngenerate_jsimd_ycc_rgb_convert_neon extrgb,  24, 0, 1, 2\ngenerate_jsimd_ycc_rgb_convert_neon extbgr,  24, 2, 1, 0\ngenerate_jsimd_ycc_rgb_convert_neon extrgbx, 32, 0, 1, 2\ngenerate_jsimd_ycc_rgb_convert_neon extbgrx, 32, 2, 1, 0\ngenerate_jsimd_ycc_rgb_convert_neon extxbgr, 32, 3, 2, 1\ngenerate_jsimd_ycc_rgb_convert_neon extxrgb, 32, 1, 2, 3\n\n.purgem do_load\n.purgem do_store\n\n\n/*****************************************************************************/\n\n/*\n * jsimd_extrgb_ycc_convert_neon\n * jsimd_extbgr_ycc_convert_neon\n * jsimd_extrgbx_ycc_convert_neon\n * jsimd_extbgrx_ycc_convert_neon\n * jsimd_extxbgr_ycc_convert_neon\n * jsimd_extxrgb_ycc_convert_neon\n *\n * Colorspace conversion RGB -> YCbCr\n */\n\n.macro do_store size\n    .if \\size == 8\n        vst1.8  {d20}, [Y]!\n        vst1.8  {d21}, [U]!\n        vst1.8  {d22}, [V]!\n    .elseif \\size == 4\n        vst1.8  {d20[0]}, [Y]!\n        vst1.8  {d20[1]}, [Y]!\n        vst1.8  {d20[2]}, [Y]!\n        vst1.8  {d20[3]}, [Y]!\n        vst1.8  {d21[0]}, [U]!\n        vst1.8  {d21[1]}, [U]!\n        vst1.8  {d21[2]}, [U]!\n        vst1.8  {d21[3]}, [U]!\n        vst1.8  {d22[0]}, [V]!\n        vst1.8  {d22[1]}, [V]!\n        vst1.8  {d22[2]}, [V]!\n        vst1.8  {d22[3]}, [V]!\n    .elseif \\size == 2\n        vst1.8  {d20[4]}, [Y]!\n        vst1.8  {d20[5]}, [Y]!\n        vst1.8  {d21[4]}, [U]!\n        vst1.8  {d21[5]}, [U]!\n        vst1.8  {d22[4]}, [V]!\n        vst1.8  {d22[5]}, [V]!\n    .elseif \\size == 1\n        vst1.8  {d20[6]}, [Y]!\n        vst1.8  {d21[6]}, [U]!\n        vst1.8  {d22[6]}, [V]!\n    .else\n        .error unsupported macroblock size\n    .endif\n.endm\n\n.macro do_load bpp, size\n    .if \\bpp == 24\n        .if \\size == 8\n            vld3.8  {d10, d11, d12}, [RGB]!\n            pld     [RGB, #128]\n        .elseif \\size == 4\n            vld3.8  {d10[0], d11[0], d12[0]}, [RGB]!\n            vld3.8  {d10[1], d11[1], d12[1]}, [RGB]!\n            vld3.8  {d10[2], d11[2], d12[2]}, [RGB]!\n            vld3.8  {d10[3], d11[3], d12[3]}, [RGB]!\n        .elseif \\size == 2\n            vld3.8  {d10[4], d11[4], d12[4]}, [RGB]!\n            vld3.8  {d10[5], d11[5], d12[5]}, [RGB]!\n        .elseif \\size == 1\n            vld3.8  {d10[6], d11[6], d12[6]}, [RGB]!\n        .else\n            .error unsupported macroblock size\n        .endif\n    .elseif \\bpp == 32\n        .if \\size == 8\n            vld4.8  {d10, d11, d12, d13}, [RGB]!\n            pld     [RGB, #128]\n        .elseif \\size == 4\n            vld4.8  {d10[0], d11[0], d12[0], d13[0]}, [RGB]!\n            vld4.8  {d10[1], d11[1], d12[1], d13[1]}, [RGB]!\n            vld4.8  {d10[2], d11[2], d12[2], d13[2]}, [RGB]!\n            vld4.8  {d10[3], d11[3], d12[3], d13[3]}, [RGB]!\n        .elseif \\size == 2\n            vld4.8  {d10[4], d11[4], d12[4], d13[4]}, [RGB]!\n            vld4.8  {d10[5], d11[5], d12[5], d13[5]}, [RGB]!\n        .elseif \\size == 1\n            vld4.8  {d10[6], d11[6], d12[6], d13[6]}, [RGB]!\n        .else\n            .error unsupported macroblock size\n        .endif\n    .else\n        .error unsupported bpp\n    .endif\n.endm\n\n.macro generate_jsimd_rgb_ycc_convert_neon colorid, bpp, r_offs, g_offs, b_offs\n\n/*\n * 2 stage pipelined RGB->YCbCr conversion\n */\n\n.macro do_rgb_to_yuv_stage1\n    vmovl.u8    q2, d1\\r_offs /* r = { d4, d5 } */\n    vmovl.u8    q3, d1\\g_offs /* g = { d6, d7 } */\n    vmovl.u8    q4, d1\\b_offs /* b = { d8, d9 } */\n    vmull.u16   q7, d4, d0[0]\n    vmlal.u16   q7, d6, d0[1]\n    vmlal.u16   q7, d8, d0[2]\n    vmull.u16   q8, d5, d0[0]\n    vmlal.u16   q8, d7, d0[1]\n    vmlal.u16   q8, d9, d0[2]\n    vrev64.32   q9,  q1\n    vrev64.32   q13, q1\n    vmlsl.u16   q9,  d4, d0[3]\n    vmlsl.u16   q9,  d6, d1[0]\n    vmlal.u16   q9,  d8, d1[1]\n    vmlsl.u16   q13, d5, d0[3]\n    vmlsl.u16   q13, d7, d1[0]\n    vmlal.u16   q13, d9, d1[1]\n    vrev64.32   q14, q1\n    vrev64.32   q15, q1\n    vmlal.u16   q14, d4, d1[1]\n    vmlsl.u16   q14, d6, d1[2]\n    vmlsl.u16   q14, d8, d1[3]\n    vmlal.u16   q15, d5, d1[1]\n    vmlsl.u16   q15, d7, d1[2]\n    vmlsl.u16   q15, d9, d1[3]\n.endm\n\n.macro do_rgb_to_yuv_stage2\n    vrshrn.u32  d20, q7,  #16\n    vrshrn.u32  d21, q8,  #16\n    vshrn.u32   d22, q9,  #16\n    vshrn.u32   d23, q13, #16\n    vshrn.u32   d24, q14, #16\n    vshrn.u32   d25, q15, #16\n    vmovn.u16   d20, q10      /* d20 = y */\n    vmovn.u16   d21, q11      /* d21 = u */\n    vmovn.u16   d22, q12      /* d22 = v */\n.endm\n\n.macro do_rgb_to_yuv\n    do_rgb_to_yuv_stage1\n    do_rgb_to_yuv_stage2\n.endm\n\n.macro do_rgb_to_yuv_stage2_store_load_stage1\n      vrshrn.u32  d20, q7,  #16\n      vrshrn.u32  d21, q8,  #16\n      vshrn.u32   d22, q9,  #16\n    vrev64.32   q9,  q1\n      vshrn.u32   d23, q13, #16\n    vrev64.32   q13, q1\n      vshrn.u32   d24, q14, #16\n      vshrn.u32   d25, q15, #16\n    do_load     \\bpp, 8\n      vmovn.u16   d20, q10      /* d20 = y */\n    vmovl.u8    q2, d1\\r_offs   /* r = { d4, d5 } */\n      vmovn.u16   d21, q11      /* d21 = u */\n    vmovl.u8    q3, d1\\g_offs   /* g = { d6, d7 } */\n      vmovn.u16   d22, q12      /* d22 = v */\n    vmovl.u8    q4, d1\\b_offs   /* b = { d8, d9 } */\n    vmull.u16   q7, d4, d0[0]\n    vmlal.u16   q7, d6, d0[1]\n    vmlal.u16   q7, d8, d0[2]\n      vst1.8      {d20}, [Y]!\n    vmull.u16   q8, d5, d0[0]\n    vmlal.u16   q8, d7, d0[1]\n    vmlal.u16   q8, d9, d0[2]\n    vmlsl.u16   q9,  d4, d0[3]\n    vmlsl.u16   q9,  d6, d1[0]\n    vmlal.u16   q9,  d8, d1[1]\n      vst1.8      {d21}, [U]!\n    vmlsl.u16   q13, d5, d0[3]\n    vmlsl.u16   q13, d7, d1[0]\n    vmlal.u16   q13, d9, d1[1]\n    vrev64.32   q14, q1\n    vrev64.32   q15, q1\n    vmlal.u16   q14, d4, d1[1]\n    vmlsl.u16   q14, d6, d1[2]\n    vmlsl.u16   q14, d8, d1[3]\n      vst1.8      {d22}, [V]!\n    vmlal.u16   q15, d5, d1[1]\n    vmlsl.u16   q15, d7, d1[2]\n    vmlsl.u16   q15, d9, d1[3]\n.endm\n\n.balign 16\njsimd_\\colorid\\()_ycc_neon_consts:\n    .short          19595, 38470, 7471,  11059\n    .short          21709, 32768, 27439, 5329\n    .short          32767, 128,   32767, 128\n    .short          32767, 128,   32767, 128\n\nasm_function jsimd_\\colorid\\()_ycc_convert_neon\n    OUTPUT_WIDTH    .req r0\n    INPUT_BUF       .req r1\n    OUTPUT_BUF      .req r2\n    OUTPUT_ROW      .req r3\n    NUM_ROWS        .req r4\n\n    OUTPUT_BUF0     .req r5\n    OUTPUT_BUF1     .req r6\n    OUTPUT_BUF2     .req OUTPUT_BUF\n\n    RGB             .req r7\n    Y               .req r8\n    U               .req r9\n    V               .req r10\n    N               .req ip\n\n    /* Load constants to d0, d1, d2, d3 */\n    adr             ip, jsimd_\\colorid\\()_ycc_neon_consts\n    vld1.16         {d0, d1, d2, d3}, [ip, :128]\n\n    /* Save ARM registers and handle input arguments */\n    push            {r4, r5, r6, r7, r8, r9, r10, lr}\n    ldr             NUM_ROWS, [sp, #(4 * 8)]\n    ldr             OUTPUT_BUF0, [OUTPUT_BUF]\n    ldr             OUTPUT_BUF1, [OUTPUT_BUF, #4]\n    ldr             OUTPUT_BUF2, [OUTPUT_BUF, #8]\n    .unreq          OUTPUT_BUF\n\n    /* Save NEON registers */\n    vpush           {d8-d15}\n\n    /* Outer loop over scanlines */\n    cmp             NUM_ROWS, #1\n    blt             9f\n0:\n    ldr             Y, [OUTPUT_BUF0, OUTPUT_ROW, lsl #2]\n    ldr             U, [OUTPUT_BUF1, OUTPUT_ROW, lsl #2]\n    mov             N, OUTPUT_WIDTH\n    ldr             V, [OUTPUT_BUF2, OUTPUT_ROW, lsl #2]\n    add             OUTPUT_ROW, OUTPUT_ROW, #1\n    ldr             RGB, [INPUT_BUF], #4\n\n    /* Inner loop over pixels */\n    subs            N, N, #8\n    blt             3f\n    do_load         \\bpp, 8\n    do_rgb_to_yuv_stage1\n    subs            N, N, #8\n    blt             2f\n1:\n    do_rgb_to_yuv_stage2_store_load_stage1\n    subs            N, N, #8\n    bge             1b\n2:\n    do_rgb_to_yuv_stage2\n    do_store        8\n    tst             N, #7\n    beq             8f\n3:\n    tst             N, #4\n    beq             3f\n    do_load         \\bpp, 4\n3:\n    tst             N, #2\n    beq             4f\n    do_load         \\bpp, 2\n4:\n    tst             N, #1\n    beq             5f\n    do_load         \\bpp, 1\n5:\n    do_rgb_to_yuv\n    tst             N, #4\n    beq             6f\n    do_store        4\n6:\n    tst             N, #2\n    beq             7f\n    do_store        2\n7:\n    tst             N, #1\n    beq             8f\n    do_store        1\n8:\n    subs            NUM_ROWS, NUM_ROWS, #1\n    bgt             0b\n9:\n    /* Restore all registers and return */\n    vpop            {d8-d15}\n    pop             {r4, r5, r6, r7, r8, r9, r10, pc}\n\n    .unreq          OUTPUT_WIDTH\n    .unreq          OUTPUT_ROW\n    .unreq          INPUT_BUF\n    .unreq          NUM_ROWS\n    .unreq          OUTPUT_BUF0\n    .unreq          OUTPUT_BUF1\n    .unreq          OUTPUT_BUF2\n    .unreq          RGB\n    .unreq          Y\n    .unreq          U\n    .unreq          V\n    .unreq          N\n.endfunc\n\n.purgem do_rgb_to_yuv\n.purgem do_rgb_to_yuv_stage1\n.purgem do_rgb_to_yuv_stage2\n.purgem do_rgb_to_yuv_stage2_store_load_stage1\n\n.endm\n\n/*--------------------------------- id ----- bpp R  G  B */\ngenerate_jsimd_rgb_ycc_convert_neon extrgb,  24, 0, 1, 2\ngenerate_jsimd_rgb_ycc_convert_neon extbgr,  24, 2, 1, 0\ngenerate_jsimd_rgb_ycc_convert_neon extrgbx, 32, 0, 1, 2\ngenerate_jsimd_rgb_ycc_convert_neon extbgrx, 32, 2, 1, 0\ngenerate_jsimd_rgb_ycc_convert_neon extxbgr, 32, 3, 2, 1\ngenerate_jsimd_rgb_ycc_convert_neon extxrgb, 32, 1, 2, 3\n\n.purgem do_load\n.purgem do_store\n\n\n/*****************************************************************************/\n\n/*\n * Load data into workspace, applying unsigned->signed conversion\n *\n * TODO: can be combined with 'jsimd_fdct_ifast_neon' to get\n *       rid of VST1.16 instructions\n */\n\nasm_function jsimd_convsamp_neon\n    SAMPLE_DATA     .req r0\n    START_COL       .req r1\n    WORKSPACE       .req r2\n    TMP1            .req r3\n    TMP2            .req r4\n    TMP3            .req r5\n    TMP4            .req ip\n\n    push            {r4, r5}\n    vmov.u8         d0, #128\n\n    ldmia           SAMPLE_DATA!, {TMP1, TMP2, TMP3, TMP4}\n    add             TMP1, TMP1, START_COL\n    add             TMP2, TMP2, START_COL\n    add             TMP3, TMP3, START_COL\n    add             TMP4, TMP4, START_COL\n    vld1.8          {d16}, [TMP1]\n    vsubl.u8        q8, d16, d0\n    vld1.8          {d18}, [TMP2]\n    vsubl.u8        q9, d18, d0\n    vld1.8          {d20}, [TMP3]\n    vsubl.u8        q10, d20, d0\n    vld1.8          {d22}, [TMP4]\n    ldmia           SAMPLE_DATA!, {TMP1, TMP2, TMP3, TMP4}\n    vsubl.u8        q11, d22, d0\n    vst1.16         {d16, d17, d18, d19}, [WORKSPACE, :128]!\n    add             TMP1, TMP1, START_COL\n    add             TMP2, TMP2, START_COL\n    vst1.16         {d20, d21, d22, d23}, [WORKSPACE, :128]!\n    add             TMP3, TMP3, START_COL\n    add             TMP4, TMP4, START_COL\n    vld1.8          {d24}, [TMP1]\n    vsubl.u8        q12, d24, d0\n    vld1.8          {d26}, [TMP2]\n    vsubl.u8        q13, d26, d0\n    vld1.8          {d28}, [TMP3]\n    vsubl.u8        q14, d28, d0\n    vld1.8          {d30}, [TMP4]\n    vsubl.u8        q15, d30, d0\n    vst1.16         {d24, d25, d26, d27}, [WORKSPACE, :128]!\n    vst1.16         {d28, d29, d30, d31}, [WORKSPACE, :128]!\n    pop             {r4, r5}\n    bx              lr\n\n    .unreq          SAMPLE_DATA\n    .unreq          START_COL\n    .unreq          WORKSPACE\n    .unreq          TMP1\n    .unreq          TMP2\n    .unreq          TMP3\n    .unreq          TMP4\n.endfunc\n\n\n/*****************************************************************************/\n\n/*\n * jsimd_fdct_ifast_neon\n *\n * This function contains a fast, not so accurate integer implementation of\n * the forward DCT (Discrete Cosine Transform). It uses the same calculations\n * and produces exactly the same output as IJG's original 'jpeg_fdct_ifast'\n * function from jfdctfst.c\n *\n * TODO: can be combined with 'jsimd_convsamp_neon' to get\n *       rid of a bunch of VLD1.16 instructions\n */\n\n#define XFIX_0_382683433 d0[0]\n#define XFIX_0_541196100 d0[1]\n#define XFIX_0_707106781 d0[2]\n#define XFIX_1_306562965 d0[3]\n\n.balign 16\njsimd_fdct_ifast_neon_consts:\n    .short (98 * 128)              /* XFIX_0_382683433 */\n    .short (139 * 128)             /* XFIX_0_541196100 */\n    .short (181 * 128)             /* XFIX_0_707106781 */\n    .short (334 * 128 - 256 * 128) /* XFIX_1_306562965 */\n\nasm_function jsimd_fdct_ifast_neon\n\n    DATA            .req r0\n    TMP             .req ip\n\n    vpush           {d8-d15}\n\n    /* Load constants */\n    adr             TMP, jsimd_fdct_ifast_neon_consts\n    vld1.16         {d0}, [TMP, :64]\n\n    /* Load all DATA into NEON registers with the following allocation:\n     *       0 1 2 3 | 4 5 6 7\n     *      ---------+--------\n     *   0 | d16     | d17    | q8\n     *   1 | d18     | d19    | q9\n     *   2 | d20     | d21    | q10\n     *   3 | d22     | d23    | q11\n     *   4 | d24     | d25    | q12\n     *   5 | d26     | d27    | q13\n     *   6 | d28     | d29    | q14\n     *   7 | d30     | d31    | q15\n     */\n\n    vld1.16         {d16, d17, d18, d19}, [DATA, :128]!\n    vld1.16         {d20, d21, d22, d23}, [DATA, :128]!\n    vld1.16         {d24, d25, d26, d27}, [DATA, :128]!\n    vld1.16         {d28, d29, d30, d31}, [DATA, :128]\n    sub             DATA, DATA, #(128 - 32)\n\n    mov             TMP, #2\n1:\n    /* Transpose */\n    vtrn.16         q12, q13\n    vtrn.16         q10, q11\n    vtrn.16         q8,  q9\n    vtrn.16         q14, q15\n    vtrn.32         q9,  q11\n    vtrn.32         q13, q15\n    vtrn.32         q8,  q10\n    vtrn.32         q12, q14\n    vswp            d30, d23\n    vswp            d24, d17\n    vswp            d26, d19\n      /* 1-D FDCT */\n      vadd.s16        q2,  q11, q12\n    vswp            d28, d21\n      vsub.s16        q12, q11, q12\n      vsub.s16        q6,  q10, q13\n      vadd.s16        q10, q10, q13\n      vsub.s16        q7,  q9,  q14\n      vadd.s16        q9,  q9,  q14\n      vsub.s16        q1,  q8,  q15\n      vadd.s16        q8,  q8,  q15\n      vsub.s16        q4,  q9,  q10\n      vsub.s16        q5,  q8,  q2\n      vadd.s16        q3,  q9,  q10\n      vadd.s16        q4,  q4,  q5\n      vadd.s16        q2,  q8,  q2\n      vqdmulh.s16     q4,  q4,  XFIX_0_707106781\n      vadd.s16        q11, q12, q6\n      vadd.s16        q8,  q2,  q3\n      vsub.s16        q12, q2,  q3\n      vadd.s16        q3,  q6,  q7\n      vadd.s16        q7,  q7,  q1\n      vqdmulh.s16     q3,  q3,  XFIX_0_707106781\n      vsub.s16        q6,  q11, q7\n      vadd.s16        q10, q5,  q4\n      vqdmulh.s16     q6,  q6,  XFIX_0_382683433\n      vsub.s16        q14, q5,  q4\n      vqdmulh.s16     q11, q11, XFIX_0_541196100\n      vqdmulh.s16     q5,  q7,  XFIX_1_306562965\n      vadd.s16        q4,  q1,  q3\n      vsub.s16        q3,  q1,  q3\n      vadd.s16        q7,  q7,  q6\n      vadd.s16        q11, q11, q6\n      vadd.s16        q7,  q7,  q5\n      vadd.s16        q13, q3,  q11\n      vsub.s16        q11, q3,  q11\n      vadd.s16        q9,  q4,  q7\n      vsub.s16        q15, q4,  q7\n    subs            TMP, TMP, #1\n    bne             1b\n\n    /* store results */\n    vst1.16         {d16, d17, d18, d19}, [DATA, :128]!\n    vst1.16         {d20, d21, d22, d23}, [DATA, :128]!\n    vst1.16         {d24, d25, d26, d27}, [DATA, :128]!\n    vst1.16         {d28, d29, d30, d31}, [DATA, :128]\n\n    vpop            {d8-d15}\n    bx              lr\n\n    .unreq          DATA\n    .unreq          TMP\n.endfunc\n\n\n/*****************************************************************************/\n\n/*\n * GLOBAL(void)\n * jsimd_quantize_neon (JCOEFPTR coef_block, DCTELEM * divisors,\n *                      DCTELEM * workspace);\n *\n * Note: the code uses 2 stage pipelining in order to improve instructions\n *       scheduling and eliminate stalls (this provides ~15% better\n *       performance for this function on both ARM Cortex-A8 and\n *       ARM Cortex-A9 when compared to the non-pipelined variant).\n *       The instructions which belong to the second stage use different\n *       indentation for better readiability.\n */\nasm_function jsimd_quantize_neon\n\n    COEF_BLOCK      .req r0\n    DIVISORS        .req r1\n    WORKSPACE       .req r2\n\n    RECIPROCAL      .req DIVISORS\n    CORRECTION      .req r3\n    SHIFT           .req ip\n    LOOP_COUNT      .req r4\n\n    vld1.16         {d0, d1, d2, d3}, [WORKSPACE, :128]!\n    vabs.s16        q12, q0\n    add             CORRECTION, DIVISORS, #(64 * 2)\n    add             SHIFT, DIVISORS, #(64 * 6)\n    vld1.16         {d20, d21, d22, d23}, [CORRECTION, :128]!\n    vabs.s16        q13, q1\n    vld1.16         {d16, d17, d18, d19}, [RECIPROCAL, :128]!\n    vadd.u16        q12, q12, q10 /* add correction */\n    vadd.u16        q13, q13, q11\n    vmull.u16       q10, d24, d16 /* multiply by reciprocal */\n    vmull.u16       q11, d25, d17\n    vmull.u16       q8,  d26, d18\n    vmull.u16       q9,  d27, d19\n    vld1.16         {d24, d25, d26, d27}, [SHIFT, :128]!\n    vshrn.u32       d20, q10, #16\n    vshrn.u32       d21, q11, #16\n    vshrn.u32       d22, q8,  #16\n    vshrn.u32       d23, q9,  #16\n    vneg.s16        q12, q12\n    vneg.s16        q13, q13\n    vshr.s16        q2,  q0,  #15 /* extract sign */\n    vshr.s16        q3,  q1,  #15\n    vshl.u16        q14, q10, q12 /* shift */\n    vshl.u16        q15, q11, q13\n\n    push            {r4, r5}\n    mov             LOOP_COUNT, #3\n1:\n    vld1.16         {d0, d1, d2, d3}, [WORKSPACE, :128]!\n      veor.u16        q14, q14, q2  /* restore sign */\n    vabs.s16        q12, q0\n    vld1.16         {d20, d21, d22, d23}, [CORRECTION, :128]!\n    vabs.s16        q13, q1\n      veor.u16        q15, q15, q3\n    vld1.16         {d16, d17, d18, d19}, [RECIPROCAL, :128]!\n    vadd.u16        q12, q12, q10 /* add correction */\n    vadd.u16        q13, q13, q11\n    vmull.u16       q10, d24, d16 /* multiply by reciprocal */\n    vmull.u16       q11, d25, d17\n    vmull.u16       q8,  d26, d18\n    vmull.u16       q9,  d27, d19\n      vsub.u16        q14, q14, q2\n    vld1.16         {d24, d25, d26, d27}, [SHIFT, :128]!\n      vsub.u16        q15, q15, q3\n    vshrn.u32       d20, q10, #16\n    vshrn.u32       d21, q11, #16\n      vst1.16         {d28, d29, d30, d31}, [COEF_BLOCK, :128]!\n    vshrn.u32       d22, q8,  #16\n    vshrn.u32       d23, q9,  #16\n    vneg.s16        q12, q12\n    vneg.s16        q13, q13\n    vshr.s16        q2,  q0,  #15 /* extract sign */\n    vshr.s16        q3,  q1,  #15\n    vshl.u16        q14, q10, q12 /* shift */\n    vshl.u16        q15, q11, q13\n    subs            LOOP_COUNT, LOOP_COUNT, #1\n    bne             1b\n    pop             {r4, r5}\n\n      veor.u16        q14, q14, q2  /* restore sign */\n      veor.u16        q15, q15, q3\n      vsub.u16        q14, q14, q2\n      vsub.u16        q15, q15, q3\n      vst1.16         {d28, d29, d30, d31}, [COEF_BLOCK, :128]!\n\n    bx              lr /* return */\n\n    .unreq          COEF_BLOCK\n    .unreq          DIVISORS\n    .unreq          WORKSPACE\n    .unreq          RECIPROCAL\n    .unreq          CORRECTION\n    .unreq          SHIFT\n    .unreq          LOOP_COUNT\n.endfunc\n\n\n/*****************************************************************************/\n\n/*\n * GLOBAL(void)\n * jsimd_h2v1_fancy_upsample_neon (int          max_v_samp_factor,\n *                                 JDIMENSION   downsampled_width,\n *                                 JSAMPARRAY   input_data,\n *                                 JSAMPARRAY * output_data_ptr);\n *\n * Note: the use of unaligned writes is the main remaining bottleneck in\n *       this code, which can be potentially solved to get up to tens\n *       of percents performance improvement on Cortex-A8/Cortex-A9.\n */\n\n/*\n * Upsample 16 source pixels to 32 destination pixels. The new 16 source\n * pixels are loaded to q0. The previous 16 source pixels are in q1. The\n * shifted-by-one source pixels are constructed in q2 by using q0 and q1.\n * Register d28 is used for multiplication by 3. Register q15 is used\n * for adding +1 bias.\n */\n.macro upsample16   OUTPTR, INPTR\n    vld1.8          {q0}, [\\INPTR]!\n    vmovl.u8        q8,  d0\n    vext.8          q2,  q1,  q0, #15\n    vmovl.u8        q9,  d1\n    vaddw.u8        q10, q15, d4\n    vaddw.u8        q11, q15, d5\n    vmlal.u8        q8,  d4,  d28\n    vmlal.u8        q9,  d5,  d28\n    vmlal.u8        q10, d0,  d28\n    vmlal.u8        q11, d1,  d28\n    vmov            q1,  q0       /* backup source pixels to q1 */\n    vrshrn.u16      d6,  q8,  #2\n    vrshrn.u16      d7,  q9,  #2\n    vshrn.u16       d8,  q10, #2\n    vshrn.u16       d9,  q11, #2\n    vst2.8          {d6, d7, d8, d9}, [\\OUTPTR]!\n.endm\n\n/*\n * Upsample 32 source pixels to 64 destination pixels. Compared to 'usample16'\n * macro, the roles of q0 and q1 registers are reversed for even and odd\n * groups of 16 pixels, that's why \"vmov q1, q0\" instructions are not needed.\n * Also this unrolling allows to reorder loads and stores to compensate\n * multiplication latency and reduce stalls.\n */\n.macro upsample32   OUTPTR, INPTR\n    /* even 16 pixels group */\n    vld1.8          {q0}, [\\INPTR]!\n    vmovl.u8        q8,  d0\n    vext.8          q2,  q1,  q0, #15\n    vmovl.u8        q9,  d1\n    vaddw.u8        q10, q15, d4\n    vaddw.u8        q11, q15, d5\n    vmlal.u8        q8,  d4,  d28\n    vmlal.u8        q9,  d5,  d28\n    vmlal.u8        q10, d0,  d28\n    vmlal.u8        q11, d1,  d28\n        /* odd 16 pixels group */\n        vld1.8          {q1}, [\\INPTR]!\n    vrshrn.u16      d6,  q8,  #2\n    vrshrn.u16      d7,  q9,  #2\n    vshrn.u16       d8,  q10, #2\n    vshrn.u16       d9,  q11, #2\n        vmovl.u8        q8,  d2\n        vext.8          q2,  q0,  q1, #15\n        vmovl.u8        q9,  d3\n        vaddw.u8        q10, q15, d4\n        vaddw.u8        q11, q15, d5\n        vmlal.u8        q8,  d4,  d28\n        vmlal.u8        q9,  d5,  d28\n        vmlal.u8        q10, d2,  d28\n        vmlal.u8        q11, d3,  d28\n    vst2.8          {d6, d7, d8, d9}, [\\OUTPTR]!\n        vrshrn.u16      d6,  q8,  #2\n        vrshrn.u16      d7,  q9,  #2\n        vshrn.u16       d8,  q10, #2\n        vshrn.u16       d9,  q11, #2\n        vst2.8          {d6, d7, d8, d9}, [\\OUTPTR]!\n.endm\n\n/*\n * Upsample a row of WIDTH pixels from INPTR to OUTPTR.\n */\n.macro upsample_row OUTPTR, INPTR, WIDTH, TMP1\n    /* special case for the first and last pixels */\n    sub             \\WIDTH, \\WIDTH, #1\n    add             \\OUTPTR, \\OUTPTR, #1\n    ldrb            \\TMP1, [\\INPTR, \\WIDTH]\n    strb            \\TMP1, [\\OUTPTR, \\WIDTH, asl #1]\n    ldrb            \\TMP1, [\\INPTR], #1\n    strb            \\TMP1, [\\OUTPTR, #-1]\n    vmov.8          d3[7], \\TMP1\n\n    subs            \\WIDTH, \\WIDTH, #32\n    blt             5f\n0:  /* process 32 pixels per iteration */\n    upsample32      \\OUTPTR, \\INPTR\n    subs            \\WIDTH, \\WIDTH, #32\n    bge             0b\n5:\n    adds            \\WIDTH, \\WIDTH, #16\n    blt             1f\n0:  /* process 16 pixels if needed */\n    upsample16      \\OUTPTR, \\INPTR\n    subs            \\WIDTH, \\WIDTH, #16\n1:\n    adds            \\WIDTH, \\WIDTH, #16\n    beq             9f\n\n    /* load the remaining 1-15 pixels */\n    add             \\INPTR, \\INPTR, \\WIDTH\n    tst             \\WIDTH, #1\n    beq             2f\n    sub             \\INPTR, \\INPTR, #1\n    vld1.8          {d0[0]}, [\\INPTR]\n2:\n    tst             \\WIDTH, #2\n    beq             2f\n    vext.8          d0, d0, d0, #6\n    sub             \\INPTR, \\INPTR, #1\n    vld1.8          {d0[1]}, [\\INPTR]\n    sub             \\INPTR, \\INPTR, #1\n    vld1.8          {d0[0]}, [\\INPTR]\n2:\n    tst             \\WIDTH, #4\n    beq             2f\n    vrev64.32       d0, d0\n    sub             \\INPTR, \\INPTR, #1\n    vld1.8          {d0[3]}, [\\INPTR]\n    sub             \\INPTR, \\INPTR, #1\n    vld1.8          {d0[2]}, [\\INPTR]\n    sub             \\INPTR, \\INPTR, #1\n    vld1.8          {d0[1]}, [\\INPTR]\n    sub             \\INPTR, \\INPTR, #1\n    vld1.8          {d0[0]}, [\\INPTR]\n2:\n    tst             \\WIDTH, #8\n    beq             2f\n    vmov            d1,  d0\n    sub             \\INPTR, \\INPTR, #8\n    vld1.8          {d0}, [\\INPTR]\n2:  /* upsample the remaining pixels */\n    vmovl.u8        q8,  d0\n    vext.8          q2,  q1,  q0, #15\n    vmovl.u8        q9,  d1\n    vaddw.u8        q10, q15, d4\n    vaddw.u8        q11, q15, d5\n    vmlal.u8        q8,  d4,  d28\n    vmlal.u8        q9,  d5,  d28\n    vmlal.u8        q10, d0,  d28\n    vmlal.u8        q11, d1,  d28\n    vrshrn.u16      d10, q8,  #2\n    vrshrn.u16      d12, q9,  #2\n    vshrn.u16       d11, q10, #2\n    vshrn.u16       d13, q11, #2\n    vzip.8          d10, d11\n    vzip.8          d12, d13\n    /* store the remaining pixels */\n    tst             \\WIDTH, #8\n    beq             2f\n    vst1.8          {d10, d11}, [\\OUTPTR]!\n    vmov            q5,  q6\n2:\n    tst             \\WIDTH, #4\n    beq             2f\n    vst1.8          {d10}, [\\OUTPTR]!\n    vmov            d10,  d11\n2:\n    tst             \\WIDTH, #2\n    beq             2f\n    vst1.8          {d10[0]}, [\\OUTPTR]!\n    vst1.8          {d10[1]}, [\\OUTPTR]!\n    vst1.8          {d10[2]}, [\\OUTPTR]!\n    vst1.8          {d10[3]}, [\\OUTPTR]!\n    vext.8          d10, d10, d10, #4\n2:\n    tst             \\WIDTH, #1\n    beq             2f\n    vst1.8          {d10[0]}, [\\OUTPTR]!\n    vst1.8          {d10[1]}, [\\OUTPTR]!\n2:\n9:\n.endm\n\nasm_function jsimd_h2v1_fancy_upsample_neon\n\n    MAX_V_SAMP_FACTOR .req r0\n    DOWNSAMPLED_WIDTH .req r1\n    INPUT_DATA        .req r2\n    OUTPUT_DATA_PTR   .req r3\n    OUTPUT_DATA       .req OUTPUT_DATA_PTR\n\n    OUTPTR            .req r4\n    INPTR             .req r5\n    WIDTH             .req ip\n    TMP               .req lr\n\n    push            {r4, r5, r6, lr}\n    vpush           {d8-d15}\n\n    ldr             OUTPUT_DATA, [OUTPUT_DATA_PTR]\n    cmp             MAX_V_SAMP_FACTOR, #0\n    ble             99f\n\n    /* initialize constants */\n    vmov.u8         d28, #3\n    vmov.u16        q15, #1\n11:\n    ldr             INPTR, [INPUT_DATA], #4\n    ldr             OUTPTR, [OUTPUT_DATA], #4\n    mov             WIDTH, DOWNSAMPLED_WIDTH\n    upsample_row    OUTPTR, INPTR, WIDTH, TMP\n    subs            MAX_V_SAMP_FACTOR, MAX_V_SAMP_FACTOR, #1\n    bgt             11b\n\n99:\n    vpop            {d8-d15}\n    pop             {r4, r5, r6, pc}\n\n    .unreq          MAX_V_SAMP_FACTOR\n    .unreq          DOWNSAMPLED_WIDTH\n    .unreq          INPUT_DATA\n    .unreq          OUTPUT_DATA_PTR\n    .unreq          OUTPUT_DATA\n\n    .unreq          OUTPTR\n    .unreq          INPTR\n    .unreq          WIDTH\n    .unreq          TMP\n\n.endfunc\n\n.purgem upsample16\n.purgem upsample32\n.purgem upsample_row\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jsimd_i386.c",
    "content": "/*\n * jsimd_i386.c\n *\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright 2009-2011 D. R. Commander\n * \n * Based on the x86 SIMD extension for IJG JPEG library,\n * Copyright (C) 1999-2006, MIYASAKA Masaru.\n * For conditions of distribution and use, see copyright notice in jsimdext.inc\n *\n * This file contains the interface between the \"normal\" portions\n * of the library and the SIMD implementations when running on a\n * 32-bit x86 architecture.\n */\n\n#define JPEG_INTERNALS\n#include \"../jinclude.h\"\n#include \"../jpeglib.h\"\n#include \"../jsimd.h\"\n#include \"../jdct.h\"\n#include \"../jsimddct.h\"\n#include \"jsimd.h\"\n\n/*\n * In the PIC cases, we have no guarantee that constants will keep\n * their alignment. This macro allows us to verify it at runtime.\n */\n#define IS_ALIGNED(ptr, order) (((unsigned)ptr & ((1 << order) - 1)) == 0)\n\n#define IS_ALIGNED_SSE(ptr) (IS_ALIGNED(ptr, 4)) /* 16 byte alignment */\n\nstatic unsigned int simd_support = ~0;\n\n/*\n * Check what SIMD accelerations are supported.\n *\n * FIXME: This code is racy under a multi-threaded environment.\n */\nLOCAL(void)\ninit_simd (void)\n{\n  char *env = NULL;\n\n  if (simd_support != ~0U)\n    return;\n\n  simd_support = jpeg_simd_cpu_support();\n\n  /* Force different settings through environment variables */\n  env = getenv(\"JSIMD_FORCEMMX\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_support &= JSIMD_MMX;\n  env = getenv(\"JSIMD_FORCE3DNOW\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_support &= JSIMD_3DNOW|JSIMD_MMX;\n  env = getenv(\"JSIMD_FORCESSE\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_support &= JSIMD_SSE|JSIMD_MMX;\n  env = getenv(\"JSIMD_FORCESSE2\");\n  if ((env != NULL) && (strcmp(env, \"1\") == 0))\n    simd_support &= JSIMD_SSE2;\n}\n\nGLOBAL(int)\njsimd_can_rgb_ycc (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_rgb_ycc_convert_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_rgb_gray (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_rgb_gray_convert_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_ycc_rgb (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_ycc_rgb_convert_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_rgb_ycc_convert (j_compress_ptr cinfo,\n                       JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                       JDIMENSION output_row, int num_rows)\n{\n  void (*sse2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);\n  void (*mmxfct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);\n\n  switch(cinfo->in_color_space)\n  {\n    case JCS_EXT_RGB:\n      sse2fct=jsimd_extrgb_ycc_convert_sse2;\n      mmxfct=jsimd_extrgb_ycc_convert_mmx;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      sse2fct=jsimd_extrgbx_ycc_convert_sse2;\n      mmxfct=jsimd_extrgbx_ycc_convert_mmx;\n      break;\n    case JCS_EXT_BGR:\n      sse2fct=jsimd_extbgr_ycc_convert_sse2;\n      mmxfct=jsimd_extbgr_ycc_convert_mmx;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      sse2fct=jsimd_extbgrx_ycc_convert_sse2;\n      mmxfct=jsimd_extbgrx_ycc_convert_mmx;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      sse2fct=jsimd_extxbgr_ycc_convert_sse2;\n      mmxfct=jsimd_extxbgr_ycc_convert_mmx;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      sse2fct=jsimd_extxrgb_ycc_convert_sse2;\n      mmxfct=jsimd_extxrgb_ycc_convert_mmx;\n      break;\n    default:\n      sse2fct=jsimd_rgb_ycc_convert_sse2;\n      mmxfct=jsimd_rgb_ycc_convert_mmx;\n      break;\n  }\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_rgb_ycc_convert_sse2))\n    sse2fct(cinfo->image_width, input_buf,\n        output_buf, output_row, num_rows);\n  else if (simd_support & JSIMD_MMX)\n    mmxfct(cinfo->image_width, input_buf,\n        output_buf, output_row, num_rows);\n}\n\nGLOBAL(void)\njsimd_rgb_gray_convert (j_compress_ptr cinfo,\n                        JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                        JDIMENSION output_row, int num_rows)\n{\n  void (*sse2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);\n  void (*mmxfct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);\n\n  switch(cinfo->in_color_space)\n  {\n    case JCS_EXT_RGB:\n      sse2fct=jsimd_extrgb_gray_convert_sse2;\n      mmxfct=jsimd_extrgb_gray_convert_mmx;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      sse2fct=jsimd_extrgbx_gray_convert_sse2;\n      mmxfct=jsimd_extrgbx_gray_convert_mmx;\n      break;\n    case JCS_EXT_BGR:\n      sse2fct=jsimd_extbgr_gray_convert_sse2;\n      mmxfct=jsimd_extbgr_gray_convert_mmx;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      sse2fct=jsimd_extbgrx_gray_convert_sse2;\n      mmxfct=jsimd_extbgrx_gray_convert_mmx;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      sse2fct=jsimd_extxbgr_gray_convert_sse2;\n      mmxfct=jsimd_extxbgr_gray_convert_mmx;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      sse2fct=jsimd_extxrgb_gray_convert_sse2;\n      mmxfct=jsimd_extxrgb_gray_convert_mmx;\n      break;\n    default:\n      sse2fct=jsimd_rgb_gray_convert_sse2;\n      mmxfct=jsimd_rgb_gray_convert_mmx;\n      break;\n  }\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_rgb_gray_convert_sse2))\n    sse2fct(cinfo->image_width, input_buf,\n        output_buf, output_row, num_rows);\n  else if (simd_support & JSIMD_MMX)\n    mmxfct(cinfo->image_width, input_buf,\n        output_buf, output_row, num_rows);\n}\n\nGLOBAL(void)\njsimd_ycc_rgb_convert (j_decompress_ptr cinfo,\n                       JSAMPIMAGE input_buf, JDIMENSION input_row,\n                       JSAMPARRAY output_buf, int num_rows)\n{\n  void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);\n  void (*mmxfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);\n\n  switch(cinfo->out_color_space)\n  {\n    case JCS_EXT_RGB:\n      sse2fct=jsimd_ycc_extrgb_convert_sse2;\n      mmxfct=jsimd_ycc_extrgb_convert_mmx;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      sse2fct=jsimd_ycc_extrgbx_convert_sse2;\n      mmxfct=jsimd_ycc_extrgbx_convert_mmx;\n      break;\n    case JCS_EXT_BGR:\n      sse2fct=jsimd_ycc_extbgr_convert_sse2;\n      mmxfct=jsimd_ycc_extbgr_convert_mmx;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      sse2fct=jsimd_ycc_extbgrx_convert_sse2;\n      mmxfct=jsimd_ycc_extbgrx_convert_mmx;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      sse2fct=jsimd_ycc_extxbgr_convert_sse2;\n      mmxfct=jsimd_ycc_extxbgr_convert_mmx;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      sse2fct=jsimd_ycc_extxrgb_convert_sse2;\n      mmxfct=jsimd_ycc_extxrgb_convert_mmx;\n      break;\n    default:\n      sse2fct=jsimd_ycc_rgb_convert_sse2;\n      mmxfct=jsimd_ycc_rgb_convert_mmx;\n      break;\n  }\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_ycc_rgb_convert_sse2))\n    sse2fct(cinfo->output_width, input_buf,\n        input_row, output_buf, num_rows);\n  else if (simd_support & JSIMD_MMX)\n    mmxfct(cinfo->output_width, input_buf,\n        input_row, output_buf, num_rows);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_downsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_downsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,\n                       JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  if (simd_support & JSIMD_SSE2)\n    jsimd_h2v2_downsample_sse2(cinfo->image_width, cinfo->max_v_samp_factor,\n        compptr->v_samp_factor, compptr->width_in_blocks,\n        input_data, output_data);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_h2v2_downsample_mmx(cinfo->image_width, cinfo->max_v_samp_factor,\n        compptr->v_samp_factor, compptr->width_in_blocks,\n        input_data, output_data);\n}\n\nGLOBAL(void)\njsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,\n                       JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  if (simd_support & JSIMD_SSE2)\n    jsimd_h2v1_downsample_sse2(cinfo->image_width, cinfo->max_v_samp_factor,\n        compptr->v_samp_factor, compptr->width_in_blocks,\n        input_data, output_data);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_h2v1_downsample_mmx(cinfo->image_width, cinfo->max_v_samp_factor,\n        compptr->v_samp_factor, compptr->width_in_blocks,\n        input_data, output_data);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_upsample (j_decompress_ptr cinfo,\n                     jpeg_component_info * compptr, \n                     JSAMPARRAY input_data,\n                     JSAMPARRAY * output_data_ptr)\n{\n  if (simd_support & JSIMD_SSE2)\n    jsimd_h2v2_upsample_sse2(cinfo->max_v_samp_factor,\n        cinfo->output_width, input_data, output_data_ptr);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_h2v2_upsample_mmx(cinfo->max_v_samp_factor,\n        cinfo->output_width, input_data, output_data_ptr);\n}\n\nGLOBAL(void)\njsimd_h2v1_upsample (j_decompress_ptr cinfo,\n                     jpeg_component_info * compptr, \n                     JSAMPARRAY input_data,\n                     JSAMPARRAY * output_data_ptr)\n{\n  if (simd_support & JSIMD_SSE2)\n    jsimd_h2v1_upsample_sse2(cinfo->max_v_samp_factor,\n        cinfo->output_width, input_data, output_data_ptr);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_h2v1_upsample_mmx(cinfo->max_v_samp_factor,\n        cinfo->output_width, input_data, output_data_ptr);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_fancy_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_fancy_upsample_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_fancy_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_fancy_upsample_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo,\n                           jpeg_component_info * compptr, \n                           JSAMPARRAY input_data,\n                           JSAMPARRAY * output_data_ptr)\n{\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_fancy_upsample_sse2))\n    jsimd_h2v2_fancy_upsample_sse2(cinfo->max_v_samp_factor,\n        compptr->downsampled_width, input_data, output_data_ptr);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_h2v2_fancy_upsample_mmx(cinfo->max_v_samp_factor,\n        compptr->downsampled_width, input_data, output_data_ptr);\n}\n\nGLOBAL(void)\njsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo,\n                           jpeg_component_info * compptr, \n                           JSAMPARRAY input_data,\n                           JSAMPARRAY * output_data_ptr)\n{\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_fancy_upsample_sse2))\n    jsimd_h2v1_fancy_upsample_sse2(cinfo->max_v_samp_factor,\n        compptr->downsampled_width, input_data, output_data_ptr);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_h2v1_fancy_upsample_mmx(cinfo->max_v_samp_factor,\n        compptr->downsampled_width, input_data, output_data_ptr);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_merged_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_merged_upsample_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_merged_upsample (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_merged_upsample_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,\n                            JSAMPIMAGE input_buf,\n                            JDIMENSION in_row_group_ctr,\n                            JSAMPARRAY output_buf)\n{\n  void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);\n  void (*mmxfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);\n\n  switch(cinfo->out_color_space)\n  {\n    case JCS_EXT_RGB:\n      sse2fct=jsimd_h2v2_extrgb_merged_upsample_sse2;\n      mmxfct=jsimd_h2v2_extrgb_merged_upsample_mmx;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      sse2fct=jsimd_h2v2_extrgbx_merged_upsample_sse2;\n      mmxfct=jsimd_h2v2_extrgbx_merged_upsample_mmx;\n      break;\n    case JCS_EXT_BGR:\n      sse2fct=jsimd_h2v2_extbgr_merged_upsample_sse2;\n      mmxfct=jsimd_h2v2_extbgr_merged_upsample_mmx;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      sse2fct=jsimd_h2v2_extbgrx_merged_upsample_sse2;\n      mmxfct=jsimd_h2v2_extbgrx_merged_upsample_mmx;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      sse2fct=jsimd_h2v2_extxbgr_merged_upsample_sse2;\n      mmxfct=jsimd_h2v2_extxbgr_merged_upsample_mmx;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      sse2fct=jsimd_h2v2_extxrgb_merged_upsample_sse2;\n      mmxfct=jsimd_h2v2_extxrgb_merged_upsample_mmx;\n      break;\n    default:\n      sse2fct=jsimd_h2v2_merged_upsample_sse2;\n      mmxfct=jsimd_h2v2_merged_upsample_mmx;\n      break;\n  }\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_merged_upsample_sse2))\n    sse2fct(cinfo->output_width, input_buf,\n        in_row_group_ctr, output_buf);\n  else if (simd_support & JSIMD_MMX)\n    mmxfct(cinfo->output_width, input_buf,\n        in_row_group_ctr, output_buf);\n}\n\nGLOBAL(void)\njsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,\n                            JSAMPIMAGE input_buf,\n                            JDIMENSION in_row_group_ctr,\n                            JSAMPARRAY output_buf)\n{\n  void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);\n  void (*mmxfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);\n\n  switch(cinfo->out_color_space)\n  {\n    case JCS_EXT_RGB:\n      sse2fct=jsimd_h2v1_extrgb_merged_upsample_sse2;\n      mmxfct=jsimd_h2v1_extrgb_merged_upsample_mmx;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      sse2fct=jsimd_h2v1_extrgbx_merged_upsample_sse2;\n      mmxfct=jsimd_h2v1_extrgbx_merged_upsample_mmx;\n      break;\n    case JCS_EXT_BGR:\n      sse2fct=jsimd_h2v1_extbgr_merged_upsample_sse2;\n      mmxfct=jsimd_h2v1_extbgr_merged_upsample_mmx;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      sse2fct=jsimd_h2v1_extbgrx_merged_upsample_sse2;\n      mmxfct=jsimd_h2v1_extbgrx_merged_upsample_mmx;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      sse2fct=jsimd_h2v1_extxbgr_merged_upsample_sse2;\n      mmxfct=jsimd_h2v1_extxbgr_merged_upsample_mmx;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      sse2fct=jsimd_h2v1_extxrgb_merged_upsample_sse2;\n      mmxfct=jsimd_h2v1_extxrgb_merged_upsample_mmx;\n      break;\n    default:\n      sse2fct=jsimd_h2v1_merged_upsample_sse2;\n      mmxfct=jsimd_h2v1_merged_upsample_mmx;\n      break;\n  }\n\n  if ((simd_support & JSIMD_SSE2) &&\n      IS_ALIGNED_SSE(jconst_merged_upsample_sse2))\n    sse2fct(cinfo->output_width, input_buf,\n        in_row_group_ctr, output_buf);\n  else if (simd_support & JSIMD_MMX)\n    mmxfct(cinfo->output_width, input_buf,\n        in_row_group_ctr, output_buf);\n}\n\nGLOBAL(int)\njsimd_can_convsamp (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_convsamp_float (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(FAST_FLOAT) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n  if (simd_support & JSIMD_SSE)\n    return 1;\n  if (simd_support & JSIMD_3DNOW)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col,\n                DCTELEM * workspace)\n{\n  if (simd_support & JSIMD_SSE2)\n    jsimd_convsamp_sse2(sample_data, start_col, workspace);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_convsamp_mmx(sample_data, start_col, workspace);\n}\n\nGLOBAL(void)\njsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col,\n                      FAST_FLOAT * workspace)\n{\n  if (simd_support & JSIMD_SSE2)\n    jsimd_convsamp_float_sse2(sample_data, start_col, workspace);\n  else if (simd_support & JSIMD_SSE)\n    jsimd_convsamp_float_sse(sample_data, start_col, workspace);\n  else if (simd_support & JSIMD_3DNOW)\n    jsimd_convsamp_float_3dnow(sample_data, start_col, workspace);\n}\n\nGLOBAL(int)\njsimd_can_fdct_islow (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fdct_islow_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_fdct_ifast (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fdct_ifast_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_fdct_float (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(FAST_FLOAT) != 4)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE) && IS_ALIGNED_SSE(jconst_fdct_float_sse))\n    return 1;\n  if (simd_support & JSIMD_3DNOW)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_fdct_islow (DCTELEM * data)\n{\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fdct_islow_sse2))\n    jsimd_fdct_islow_sse2(data);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_fdct_islow_mmx(data);\n}\n\nGLOBAL(void)\njsimd_fdct_ifast (DCTELEM * data)\n{\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_fdct_islow_sse2))\n    jsimd_fdct_ifast_sse2(data);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_fdct_ifast_mmx(data);\n}\n\nGLOBAL(void)\njsimd_fdct_float (FAST_FLOAT * data)\n{\n  if ((simd_support & JSIMD_SSE) && IS_ALIGNED_SSE(jconst_fdct_float_sse))\n    jsimd_fdct_float_sse(data);\n  else if (simd_support & JSIMD_3DNOW)\n    jsimd_fdct_float_3dnow(data);\n}\n\nGLOBAL(int)\njsimd_can_quantize (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_quantize_float (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (sizeof(FAST_FLOAT) != 4)\n    return 0;\n\n  if (simd_support & JSIMD_SSE2)\n    return 1;\n  if (simd_support & JSIMD_SSE)\n    return 1;\n  if (simd_support & JSIMD_3DNOW)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors,\n                DCTELEM * workspace)\n{\n  if (simd_support & JSIMD_SSE2)\n    jsimd_quantize_sse2(coef_block, divisors, workspace);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_quantize_mmx(coef_block, divisors, workspace);\n}\n\nGLOBAL(void)\njsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors,\n                      FAST_FLOAT * workspace)\n{\n  if (simd_support & JSIMD_SSE2)\n    jsimd_quantize_float_sse2(coef_block, divisors, workspace);\n  else if (simd_support & JSIMD_SSE)\n    jsimd_quantize_float_sse(coef_block, divisors, workspace);\n  else if (simd_support & JSIMD_3DNOW)\n    jsimd_quantize_float_3dnow(coef_block, divisors, workspace);\n}\n\nGLOBAL(int)\njsimd_can_idct_2x2 (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_4x4 (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2))\n    jsimd_idct_2x2_sse2(compptr->dct_table, coef_block, output_buf, output_col);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_idct_2x2_mmx(compptr->dct_table, coef_block, output_buf, output_col);\n}\n\nGLOBAL(void)\njsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2))\n    jsimd_idct_4x4_sse2(compptr->dct_table, coef_block, output_buf, output_col);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_idct_4x4_mmx(compptr->dct_table, coef_block, output_buf, output_col);\n}\n\nGLOBAL(int)\njsimd_can_idct_islow (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_islow_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_ifast (void)\n{\n  init_simd();\n\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(IFAST_MULT_TYPE) != 2)\n    return 0;\n  if (IFAST_SCALE_BITS != 2)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_ifast_sse2))\n    return 1;\n  if (simd_support & JSIMD_MMX)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(int)\njsimd_can_idct_float (void)\n{\n  init_simd();\n\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(FAST_FLOAT) != 4)\n    return 0;\n  if (sizeof(FLOAT_MULT_TYPE) != 4)\n    return 0;\n\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_float_sse2))\n    return 1;\n  if ((simd_support & JSIMD_SSE) && IS_ALIGNED_SSE(jconst_idct_float_sse))\n    return 1;\n  if (simd_support & JSIMD_3DNOW)\n    return 1;\n\n  return 0;\n}\n\nGLOBAL(void)\njsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_islow_sse2))\n    jsimd_idct_islow_sse2(compptr->dct_table, coef_block, output_buf, output_col);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_idct_islow_mmx(compptr->dct_table, coef_block, output_buf, output_col);\n}\n\nGLOBAL(void)\njsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_ifast_sse2))\n    jsimd_idct_ifast_sse2(compptr->dct_table, coef_block, output_buf, output_col);\n  else if (simd_support & JSIMD_MMX)\n    jsimd_idct_ifast_mmx(compptr->dct_table, coef_block, output_buf, output_col);\n}\n\nGLOBAL(void)\njsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_float_sse2))\n    jsimd_idct_float_sse2(compptr->dct_table, coef_block,\n        output_buf, output_col);\n  else if ((simd_support & JSIMD_SSE) && IS_ALIGNED_SSE(jconst_idct_float_sse))\n    jsimd_idct_float_sse(compptr->dct_table, coef_block,\n        output_buf, output_col);\n  else if (simd_support & JSIMD_3DNOW)\n    jsimd_idct_float_3dnow(compptr->dct_table, coef_block,\n        output_buf, output_col);\n}\n\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jsimd_x86_64.c",
    "content": "/*\n * jsimd_x86_64.c\n *\n * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n * Copyright 2009-2011 D. R. Commander\n * \n * Based on the x86 SIMD extension for IJG JPEG library,\n * Copyright (C) 1999-2006, MIYASAKA Masaru.\n * For conditions of distribution and use, see copyright notice in jsimdext.inc\n *\n * This file contains the interface between the \"normal\" portions\n * of the library and the SIMD implementations when running on a\n * x86_64 architecture.\n */\n\n#define JPEG_INTERNALS\n#include \"../jinclude.h\"\n#include \"../jpeglib.h\"\n#include \"../jsimd.h\"\n#include \"../jdct.h\"\n#include \"../jsimddct.h\"\n#include \"jsimd.h\"\n\n/*\n * In the PIC cases, we have no guarantee that constants will keep\n * their alignment. This macro allows us to verify it at runtime.\n */\n#define IS_ALIGNED(ptr, order) (((size_t)ptr & ((1 << order) - 1)) == 0)\n\n#define IS_ALIGNED_SSE(ptr) (IS_ALIGNED(ptr, 4)) /* 16 byte alignment */\n\nGLOBAL(int)\njsimd_can_rgb_ycc (void)\n{\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if (!IS_ALIGNED_SSE(jconst_rgb_ycc_convert_sse2))\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(int)\njsimd_can_rgb_gray (void)\n{\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if (!IS_ALIGNED_SSE(jconst_rgb_gray_convert_sse2))\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(int)\njsimd_can_ycc_rgb (void)\n{\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))\n    return 0;\n\n  if (!IS_ALIGNED_SSE(jconst_ycc_rgb_convert_sse2))\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(void)\njsimd_rgb_ycc_convert (j_compress_ptr cinfo,\n                       JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                       JDIMENSION output_row, int num_rows)\n{\n  void (*sse2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);\n\n  switch(cinfo->in_color_space)\n  {\n    case JCS_EXT_RGB:\n      sse2fct=jsimd_extrgb_ycc_convert_sse2;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      sse2fct=jsimd_extrgbx_ycc_convert_sse2;\n      break;\n    case JCS_EXT_BGR:\n      sse2fct=jsimd_extbgr_ycc_convert_sse2;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      sse2fct=jsimd_extbgrx_ycc_convert_sse2;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      sse2fct=jsimd_extxbgr_ycc_convert_sse2;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      sse2fct=jsimd_extxrgb_ycc_convert_sse2;\n      break;\n    default:\n      sse2fct=jsimd_rgb_ycc_convert_sse2;\n      break;\n  }\n\n  sse2fct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);\n}\n\nGLOBAL(void)\njsimd_rgb_gray_convert (j_compress_ptr cinfo,\n                        JSAMPARRAY input_buf, JSAMPIMAGE output_buf,\n                        JDIMENSION output_row, int num_rows)\n{\n  void (*sse2fct)(JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);\n\n  switch(cinfo->in_color_space)\n  {\n    case JCS_EXT_RGB:\n      sse2fct=jsimd_extrgb_gray_convert_sse2;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      sse2fct=jsimd_extrgbx_gray_convert_sse2;\n      break;\n    case JCS_EXT_BGR:\n      sse2fct=jsimd_extbgr_gray_convert_sse2;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      sse2fct=jsimd_extbgrx_gray_convert_sse2;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      sse2fct=jsimd_extxbgr_gray_convert_sse2;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      sse2fct=jsimd_extxrgb_gray_convert_sse2;\n      break;\n    default:\n      sse2fct=jsimd_rgb_gray_convert_sse2;\n      break;\n  }\n\n  sse2fct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);\n}\n\nGLOBAL(void)\njsimd_ycc_rgb_convert (j_decompress_ptr cinfo,\n                       JSAMPIMAGE input_buf, JDIMENSION input_row,\n                       JSAMPARRAY output_buf, int num_rows)\n{\n  void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);\n\n  switch(cinfo->out_color_space)\n  {\n    case JCS_EXT_RGB:\n      sse2fct=jsimd_ycc_extrgb_convert_sse2;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      sse2fct=jsimd_ycc_extrgbx_convert_sse2;\n      break;\n    case JCS_EXT_BGR:\n      sse2fct=jsimd_ycc_extbgr_convert_sse2;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      sse2fct=jsimd_ycc_extbgrx_convert_sse2;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      sse2fct=jsimd_ycc_extxbgr_convert_sse2;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      sse2fct=jsimd_ycc_extxrgb_convert_sse2;\n      break;\n    default:\n      sse2fct=jsimd_ycc_rgb_convert_sse2;\n      break;\n  }\n\n  sse2fct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_downsample (void)\n{\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_downsample (void)\n{\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(void)\njsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,\n                       JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  jsimd_h2v2_downsample_sse2(cinfo->image_width,\n                             cinfo->max_v_samp_factor,\n                             compptr->v_samp_factor,\n                             compptr->width_in_blocks,\n                             input_data, output_data);\n}\n\nGLOBAL(void)\njsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,\n                       JSAMPARRAY input_data, JSAMPARRAY output_data)\n{\n  jsimd_h2v1_downsample_sse2(cinfo->image_width,\n                             cinfo->max_v_samp_factor,\n                             compptr->v_samp_factor,\n                             compptr->width_in_blocks,\n                             input_data, output_data);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_upsample (void)\n{\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_upsample (void)\n{\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(void)\njsimd_h2v2_upsample (j_decompress_ptr cinfo,\n                     jpeg_component_info * compptr, \n                     JSAMPARRAY input_data,\n                     JSAMPARRAY * output_data_ptr)\n{\n  jsimd_h2v2_upsample_sse2(cinfo->max_v_samp_factor,\n                           cinfo->output_width,\n                           input_data, output_data_ptr);\n}\n\nGLOBAL(void)\njsimd_h2v1_upsample (j_decompress_ptr cinfo,\n                     jpeg_component_info * compptr, \n                     JSAMPARRAY input_data,\n                     JSAMPARRAY * output_data_ptr)\n{\n  jsimd_h2v1_upsample_sse2(cinfo->max_v_samp_factor,\n                           cinfo->output_width,\n                           input_data, output_data_ptr);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_fancy_upsample (void)\n{\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (!IS_ALIGNED_SSE(jconst_fancy_upsample_sse2))\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_fancy_upsample (void)\n{\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (!IS_ALIGNED_SSE(jconst_fancy_upsample_sse2))\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(void)\njsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo,\n                           jpeg_component_info * compptr, \n                           JSAMPARRAY input_data,\n                           JSAMPARRAY * output_data_ptr)\n{\n  jsimd_h2v2_fancy_upsample_sse2(cinfo->max_v_samp_factor,\n                                 compptr->downsampled_width,\n                                 input_data, output_data_ptr);\n}\n\nGLOBAL(void)\njsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo,\n                           jpeg_component_info * compptr, \n                           JSAMPARRAY input_data,\n                           JSAMPARRAY * output_data_ptr)\n{\n  jsimd_h2v1_fancy_upsample_sse2(cinfo->max_v_samp_factor,\n                                 compptr->downsampled_width,\n                                 input_data, output_data_ptr);\n}\n\nGLOBAL(int)\njsimd_can_h2v2_merged_upsample (void)\n{\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (!IS_ALIGNED_SSE(jconst_merged_upsample_sse2))\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(int)\njsimd_can_h2v1_merged_upsample (void)\n{\n  /* The code is optimised for these values only */\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n\n  if (!IS_ALIGNED_SSE(jconst_merged_upsample_sse2))\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(void)\njsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,\n                            JSAMPIMAGE input_buf,\n                            JDIMENSION in_row_group_ctr,\n                            JSAMPARRAY output_buf)\n{\n  void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);\n\n  switch(cinfo->out_color_space)\n  {\n    case JCS_EXT_RGB:\n      sse2fct=jsimd_h2v2_extrgb_merged_upsample_sse2;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      sse2fct=jsimd_h2v2_extrgbx_merged_upsample_sse2;\n      break;\n    case JCS_EXT_BGR:\n      sse2fct=jsimd_h2v2_extbgr_merged_upsample_sse2;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      sse2fct=jsimd_h2v2_extbgrx_merged_upsample_sse2;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      sse2fct=jsimd_h2v2_extxbgr_merged_upsample_sse2;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      sse2fct=jsimd_h2v2_extxrgb_merged_upsample_sse2;\n      break;\n    default:\n      sse2fct=jsimd_h2v2_merged_upsample_sse2;\n      break;\n  }\n\n  sse2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);\n}\n\nGLOBAL(void)\njsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,\n                            JSAMPIMAGE input_buf,\n                            JDIMENSION in_row_group_ctr,\n                            JSAMPARRAY output_buf)\n{\n  void (*sse2fct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);\n\n  switch(cinfo->out_color_space)\n  {\n    case JCS_EXT_RGB:\n      sse2fct=jsimd_h2v1_extrgb_merged_upsample_sse2;\n      break;\n    case JCS_EXT_RGBX:\n    case JCS_EXT_RGBA:\n      sse2fct=jsimd_h2v1_extrgbx_merged_upsample_sse2;\n      break;\n    case JCS_EXT_BGR:\n      sse2fct=jsimd_h2v1_extbgr_merged_upsample_sse2;\n      break;\n    case JCS_EXT_BGRX:\n    case JCS_EXT_BGRA:\n      sse2fct=jsimd_h2v1_extbgrx_merged_upsample_sse2;\n      break;\n    case JCS_EXT_XBGR:\n    case JCS_EXT_ABGR:\n      sse2fct=jsimd_h2v1_extxbgr_merged_upsample_sse2;\n      break;\n    case JCS_EXT_XRGB:\n    case JCS_EXT_ARGB:\n      sse2fct=jsimd_h2v1_extxrgb_merged_upsample_sse2;\n      break;\n    default:\n      sse2fct=jsimd_h2v1_merged_upsample_sse2;\n      break;\n  }\n\n  sse2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);\n}\n\nGLOBAL(int)\njsimd_can_convsamp (void)\n{\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(int)\njsimd_can_convsamp_float (void)\n{\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(FAST_FLOAT) != 4)\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(void)\njsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col,\n                DCTELEM * workspace)\n{\n  jsimd_convsamp_sse2(sample_data, start_col, workspace);\n}\n\nGLOBAL(void)\njsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col,\n                      FAST_FLOAT * workspace)\n{\n  jsimd_convsamp_float_sse2(sample_data, start_col, workspace);\n}\n\nGLOBAL(int)\njsimd_can_fdct_islow (void)\n{\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (!IS_ALIGNED_SSE(jconst_fdct_islow_sse2))\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(int)\njsimd_can_fdct_ifast (void)\n{\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  if (!IS_ALIGNED_SSE(jconst_fdct_ifast_sse2))\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(int)\njsimd_can_fdct_float (void)\n{\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(FAST_FLOAT) != 4)\n    return 0;\n\n  if (!IS_ALIGNED_SSE(jconst_fdct_float_sse))\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(void)\njsimd_fdct_islow (DCTELEM * data)\n{\n  jsimd_fdct_islow_sse2(data);\n}\n\nGLOBAL(void)\njsimd_fdct_ifast (DCTELEM * data)\n{\n  jsimd_fdct_ifast_sse2(data);\n}\n\nGLOBAL(void)\njsimd_fdct_float (FAST_FLOAT * data)\n{\n  jsimd_fdct_float_sse(data);\n}\n\nGLOBAL(int)\njsimd_can_quantize (void)\n{\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (sizeof(DCTELEM) != 2)\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(int)\njsimd_can_quantize_float (void)\n{\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (sizeof(FAST_FLOAT) != 4)\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(void)\njsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors,\n                DCTELEM * workspace)\n{\n  jsimd_quantize_sse2(coef_block, divisors, workspace);\n}\n\nGLOBAL(void)\njsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors,\n                      FAST_FLOAT * workspace)\n{\n  jsimd_quantize_float_sse2(coef_block, divisors, workspace);\n}\n\nGLOBAL(int)\njsimd_can_idct_2x2 (void)\n{\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if (!IS_ALIGNED_SSE(jconst_idct_red_sse2))\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(int)\njsimd_can_idct_4x4 (void)\n{\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if (!IS_ALIGNED_SSE(jconst_idct_red_sse2))\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(void)\njsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  jsimd_idct_2x2_sse2(compptr->dct_table, coef_block, output_buf, output_col);\n}\n\nGLOBAL(void)\njsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  jsimd_idct_4x4_sse2(compptr->dct_table, coef_block, output_buf, output_col);\n}\n\nGLOBAL(int)\njsimd_can_idct_islow (void)\n{\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(ISLOW_MULT_TYPE) != 2)\n    return 0;\n\n  if (!IS_ALIGNED_SSE(jconst_idct_islow_sse2))\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(int)\njsimd_can_idct_ifast (void)\n{\n  /* The code is optimised for these values only */\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(IFAST_MULT_TYPE) != 2)\n    return 0;\n  if (IFAST_SCALE_BITS != 2)\n    return 0;\n\n  if (!IS_ALIGNED_SSE(jconst_idct_ifast_sse2))\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(int)\njsimd_can_idct_float (void)\n{\n  if (DCTSIZE != 8)\n    return 0;\n  if (sizeof(JCOEF) != 2)\n    return 0;\n  if (BITS_IN_JSAMPLE != 8)\n    return 0;\n  if (sizeof(JDIMENSION) != 4)\n    return 0;\n  if (sizeof(FAST_FLOAT) != 4)\n    return 0;\n  if (sizeof(FLOAT_MULT_TYPE) != 4)\n    return 0;\n\n  if (!IS_ALIGNED_SSE(jconst_idct_float_sse2))\n    return 0;\n\n  return 1;\n}\n\nGLOBAL(void)\njsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  jsimd_idct_islow_sse2(compptr->dct_table, coef_block, output_buf, output_col);\n}\n\nGLOBAL(void)\njsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  jsimd_idct_ifast_sse2(compptr->dct_table, coef_block, output_buf, output_col);\n}\n\nGLOBAL(void)\njsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,\n                JCOEFPTR coef_block, JSAMPARRAY output_buf,\n                JDIMENSION output_col)\n{\n  jsimd_idct_float_sse2(compptr->dct_table, coef_block,\n                        output_buf, output_col);\n}\n\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jsimdcfg.inc.h",
    "content": "// This file generates the include file for the assembly\n// implementations by abusing the C preprocessor.\n//\n// Note: Some things are manually defined as they need to\n// be mapped to NASM types.\n\n;\n; Automatically generated include file from jsimdcfg.inc.h\n;\n\n#define JPEG_INTERNALS\n\n#include \"../jpeglib.h\"\n#include \"../jconfig.h\"\n#include \"../jmorecfg.h\"\n#include \"jsimd.h\"\n\n;\n; -- jpeglib.h\n;\n\n%define _cpp_protection_DCTSIZE DCTSIZE\n%define _cpp_protection_DCTSIZE2 DCTSIZE2\n\n;\n; -- jmorecfg.h\n;\n\n%define _cpp_protection_RGB_RED RGB_RED\n%define _cpp_protection_RGB_GREEN RGB_GREEN\n%define _cpp_protection_RGB_BLUE RGB_BLUE\n%define _cpp_protection_RGB_PIXELSIZE RGB_PIXELSIZE\n\n%define _cpp_protection_EXT_RGB_RED EXT_RGB_RED\n%define _cpp_protection_EXT_RGB_GREEN EXT_RGB_GREEN\n%define _cpp_protection_EXT_RGB_BLUE EXT_RGB_BLUE\n%define _cpp_protection_EXT_RGB_PIXELSIZE EXT_RGB_PIXELSIZE\n\n%define _cpp_protection_EXT_RGBX_RED EXT_RGBX_RED\n%define _cpp_protection_EXT_RGBX_GREEN EXT_RGBX_GREEN\n%define _cpp_protection_EXT_RGBX_BLUE EXT_RGBX_BLUE\n%define _cpp_protection_EXT_RGBX_PIXELSIZE EXT_RGBX_PIXELSIZE\n\n%define _cpp_protection_EXT_BGR_RED EXT_BGR_RED\n%define _cpp_protection_EXT_BGR_GREEN EXT_BGR_GREEN\n%define _cpp_protection_EXT_BGR_BLUE EXT_BGR_BLUE\n%define _cpp_protection_EXT_BGR_PIXELSIZE EXT_BGR_PIXELSIZE\n\n%define _cpp_protection_EXT_BGRX_RED EXT_BGRX_RED\n%define _cpp_protection_EXT_BGRX_GREEN EXT_BGRX_GREEN\n%define _cpp_protection_EXT_BGRX_BLUE EXT_BGRX_BLUE\n%define _cpp_protection_EXT_BGRX_PIXELSIZE EXT_BGRX_PIXELSIZE\n\n%define _cpp_protection_EXT_XBGR_RED EXT_XBGR_RED\n%define _cpp_protection_EXT_XBGR_GREEN EXT_XBGR_GREEN\n%define _cpp_protection_EXT_XBGR_BLUE EXT_XBGR_BLUE\n%define _cpp_protection_EXT_XBGR_PIXELSIZE EXT_XBGR_PIXELSIZE\n\n%define _cpp_protection_EXT_XRGB_RED EXT_XRGB_RED\n%define _cpp_protection_EXT_XRGB_GREEN EXT_XRGB_GREEN\n%define _cpp_protection_EXT_XRGB_BLUE EXT_XRGB_BLUE\n%define _cpp_protection_EXT_XRGB_PIXELSIZE EXT_XRGB_PIXELSIZE\n\n%define RGBX_FILLER_0XFF        1\n\n; Representation of a single sample (pixel element value).\n; On this SIMD implementation, this must be 'unsigned char'.\n;\n\n%define JSAMPLE                 byte          ; unsigned char\n%define SIZEOF_JSAMPLE          SIZEOF_BYTE   ; sizeof(JSAMPLE)\n\n%define _cpp_protection_CENTERJSAMPLE CENTERJSAMPLE\n\n; Representation of a DCT frequency coefficient.\n; On this SIMD implementation, this must be 'short'.\n;\n%define JCOEF                   word          ; short\n%define SIZEOF_JCOEF            SIZEOF_WORD   ; sizeof(JCOEF)\n\n; Datatype used for image dimensions.\n; On this SIMD implementation, this must be 'unsigned int'.\n;\n%define JDIMENSION              dword         ; unsigned int\n%define SIZEOF_JDIMENSION       SIZEOF_DWORD  ; sizeof(JDIMENSION)\n\n%define JSAMPROW                POINTER       ; JSAMPLE FAR * (jpeglib.h)\n%define JSAMPARRAY              POINTER       ; JSAMPROW *    (jpeglib.h)\n%define JSAMPIMAGE              POINTER       ; JSAMPARRAY *  (jpeglib.h)\n%define JCOEFPTR                POINTER       ; JCOEF FAR *   (jpeglib.h)\n%define SIZEOF_JSAMPROW         SIZEOF_POINTER  ; sizeof(JSAMPROW)\n%define SIZEOF_JSAMPARRAY       SIZEOF_POINTER  ; sizeof(JSAMPARRAY)\n%define SIZEOF_JSAMPIMAGE       SIZEOF_POINTER  ; sizeof(JSAMPIMAGE)\n%define SIZEOF_JCOEFPTR         SIZEOF_POINTER  ; sizeof(JCOEFPTR)\n\n;\n; -- jdct.h\n;\n\n; A forward DCT routine is given a pointer to a work area of type DCTELEM[];\n; the DCT is to be performed in-place in that buffer.\n; To maximize parallelism, Type DCTELEM is changed to short (originally, int).\n;\n%define DCTELEM                 word          ; short\n%define SIZEOF_DCTELEM          SIZEOF_WORD   ; sizeof(DCTELEM)\n\n%define FAST_FLOAT              FP32            ; float\n%define SIZEOF_FAST_FLOAT       SIZEOF_FP32     ; sizeof(FAST_FLOAT)\n\n; To maximize parallelism, Type MULTIPLIER is changed to short.\n;\n%define ISLOW_MULT_TYPE         word          ; must be short\n%define SIZEOF_ISLOW_MULT_TYPE  SIZEOF_WORD   ; sizeof(ISLOW_MULT_TYPE)\n\n%define IFAST_MULT_TYPE         word          ; must be short\n%define SIZEOF_IFAST_MULT_TYPE  SIZEOF_WORD   ; sizeof(IFAST_MULT_TYPE)\n%define IFAST_SCALE_BITS        2             ; fractional bits in scale factors\n\n%define FLOAT_MULT_TYPE         FP32          ; must be float\n%define SIZEOF_FLOAT_MULT_TYPE  SIZEOF_FP32   ; sizeof(FLOAT_MULT_TYPE)\n\n;\n; -- jsimd.h\n;\n\n%define _cpp_protection_JSIMD_NONE JSIMD_NONE\n%define _cpp_protection_JSIMD_MMX JSIMD_MMX\n%define _cpp_protection_JSIMD_3DNOW JSIMD_3DNOW\n%define _cpp_protection_JSIMD_SSE JSIMD_SSE\n%define _cpp_protection_JSIMD_SSE2 JSIMD_SSE2\n\n; Short forms of external names for systems with brain-damaged linkers.\n;\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n%define _cpp_protection_jpeg_simd_cpu_support jpeg_simd_cpu_support\n%define _cpp_protection_jsimd_rgb_ycc_convert_mmx jsimd_rgb_ycc_convert_mmx\n%define _cpp_protection_jsimd_ycc_rgb_convert_mmx jsimd_ycc_rgb_convert_mmx\n%define _cpp_protection_jconst_rgb_ycc_convert_sse2 jconst_rgb_ycc_convert_sse2\n%define _cpp_protection_jsimd_rgb_ycc_convert_sse2 jsimd_rgb_ycc_convert_sse2\n%define _cpp_protection_jconst_ycc_rgb_convert_sse2 jconst_ycc_rgb_convert_sse2\n%define _cpp_protection_jsimd_ycc_rgb_convert_sse2 jsimd_ycc_rgb_convert_sse2\n%define _cpp_protection_jsimd_h2v2_downsample_mmx jsimd_h2v2_downsample_mmx\n%define _cpp_protection_jsimd_h2v1_downsample_mmx jsimd_h2v1_downsample_mmx\n%define _cpp_protection_jsimd_h2v2_downsample_sse2 jsimd_h2v2_downsample_sse2\n%define _cpp_protection_jsimd_h2v1_downsample_sse2 jsimd_h2v1_downsample_sse2\n%define _cpp_protection_jsimd_h2v2_upsample_mmx jsimd_h2v2_upsample_mmx\n%define _cpp_protection_jsimd_h2v1_upsample_mmx jsimd_h2v1_upsample_mmx\n%define _cpp_protection_jsimd_h2v1_fancy_upsample_mmx jsimd_h2v1_fancy_upsample_mmx\n%define _cpp_protection_jsimd_h2v2_fancy_upsample_mmx jsimd_h2v2_fancy_upsample_mmx\n%define _cpp_protection_jsimd_h2v1_merged_upsample_mmx jsimd_h2v1_merged_upsample_mmx\n%define _cpp_protection_jsimd_h2v2_merged_upsample_mmx jsimd_h2v2_merged_upsample_mmx\n%define _cpp_protection_jsimd_h2v2_upsample_sse2 jsimd_h2v2_upsample_sse2\n%define _cpp_protection_jsimd_h2v1_upsample_sse2 jsimd_h2v1_upsample_sse2\n%define _cpp_protection_jconst_fancy_upsample_sse2 jconst_fancy_upsample_sse2\n%define _cpp_protection_jsimd_h2v1_fancy_upsample_sse2 jsimd_h2v1_fancy_upsample_sse2\n%define _cpp_protection_jsimd_h2v2_fancy_upsample_sse2 jsimd_h2v2_fancy_upsample_sse2\n%define _cpp_protection_jconst_merged_upsample_sse2 jconst_merged_upsample_sse2\n%define _cpp_protection_jsimd_h2v1_merged_upsample_sse2 jsimd_h2v1_merged_upsample_sse2\n%define _cpp_protection_jsimd_h2v2_merged_upsample_sse2 jsimd_h2v2_merged_upsample_sse2\n%define _cpp_protection_jsimd_convsamp_mmx jsimd_convsamp_mmx\n%define _cpp_protection_jsimd_convsamp_sse2 jsimd_convsamp_sse2\n%define _cpp_protection_jsimd_convsamp_float_3dnow jsimd_convsamp_float_3dnow\n%define _cpp_protection_jsimd_convsamp_float_sse jsimd_convsamp_float_sse\n%define _cpp_protection_jsimd_convsamp_float_sse2 jsimd_convsamp_float_sse2\n%define _cpp_protection_jsimd_fdct_islow_mmx jsimd_fdct_islow_mmx\n%define _cpp_protection_jsimd_fdct_ifast_mmx jsimd_fdct_ifast_mmx\n%define _cpp_protection_jconst_fdct_islow_sse2 jconst_fdct_islow_sse2\n%define _cpp_protection_jsimd_fdct_islow_sse2 jsimd_fdct_islow_sse2\n%define _cpp_protection_jconst_fdct_ifast_sse2 jconst_fdct_ifast_sse2\n%define _cpp_protection_jsimd_fdct_ifast_sse2 jsimd_fdct_ifast_sse2\n%define _cpp_protection_jsimd_fdct_float_3dnow jsimd_fdct_float_3dnow\n%define _cpp_protection_jconst_fdct_float_sse jconst_fdct_float_sse\n%define _cpp_protection_jsimd_fdct_float_sse jsimd_fdct_float_sse\n%define _cpp_protection_jsimd_quantize_mmx jsimd_quantize_mmx\n%define _cpp_protection_jsimd_quantize_sse2 jsimd_quantize_sse2\n%define _cpp_protection_jsimd_quantize_float_3dnow jsimd_quantize_float_3dnow\n%define _cpp_protection_jsimd_quantize_float_sse jsimd_quantize_float_sse\n%define _cpp_protection_jsimd_quantize_float_sse2 jsimd_quantize_float_sse2\n%define _cpp_protection_jsimd_idct_2x2_mmx jsimd_idct_2x2_mmx\n%define _cpp_protection_jsimd_idct_4x4_mmx jsimd_idct_4x4_mmx\n%define _cpp_protection_jconst_idct_red_sse2 jconst_idct_red_sse2\n%define _cpp_protection_jsimd_idct_2x2_sse2 jsimd_idct_2x2_sse2\n%define _cpp_protection_jsimd_idct_4x4_sse2 jsimd_idct_4x4_sse2\n%define _cpp_protection_jsimd_idct_islow_mmx jsimd_idct_islow_mmx\n%define _cpp_protection_jsimd_idct_ifast_mmx jsimd_idct_ifast_mmx\n%define _cpp_protection_jconst_idct_islow_sse2 jconst_idct_islow_sse2\n%define _cpp_protection_jsimd_idct_islow_sse2 jsimd_idct_islow_sse2\n%define _cpp_protection_jconst_idct_ifast_sse2 jconst_idct_ifast_sse2\n%define _cpp_protection_jsimd_idct_ifast_sse2 jsimd_idct_ifast_sse2\n%define _cpp_protection_jsimd_idct_float_3dnow jsimd_idct_float_3dnow\n%define _cpp_protection_jconst_idct_float_sse jconst_idct_float_sse\n%define _cpp_protection_jsimd_idct_float_sse jsimd_idct_float_sse\n%define _cpp_protection_jconst_idct_float_sse2 jconst_idct_float_sse2\n%define _cpp_protection_jsimd_idct_float_sse2 jsimd_idct_float_sse2\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jsimdcpu.asm",
    "content": ";\n; jsimdcpu.asm - SIMD instruction support check\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n; For conditions of distribution and use, see copyright notice in jsimdext.inc\n;\n; This file should be assembled with NASM (Netwide Assembler),\n; can *not* be assembled with Microsoft's MASM or any compatible\n; assembler (including Borland's Turbo Assembler).\n; NASM is available from http://nasm.sourceforge.net/ or\n; http://sourceforge.net/project/showfiles.php?group_id=6208\n;\n; [TAB8]\n\n%include \"jsimdext.inc\"\n\n; --------------------------------------------------------------------------\n\tSECTION\tSEG_TEXT\n\tBITS\t32\n;\n; Check if the CPU supports SIMD instructions\n;\n; GLOBAL(unsigned int)\n; jpeg_simd_cpu_support (void)\n;\n\n\talign\t16\n\tglobal\tEXTN(jpeg_simd_cpu_support)\n\nEXTN(jpeg_simd_cpu_support):\n\tpush\tebx\n;\tpush\tecx\t\t; need not be preserved\n;\tpush\tedx\t\t; need not be preserved\n;\tpush\tesi\t\t; unused\n\tpush\tedi\n\n\txor\tedi,edi\t\t\t; simd support flag\n\n\tpushfd\n\tpop\teax\n\tmov\tedx,eax\n\txor\teax, 1<<21\t\t; flip ID bit in EFLAGS\n\tpush\teax\n\tpopfd\n\tpushfd\n\tpop\teax\n\txor\teax,edx\n\tjz\tshort .return\t\t; CPUID is not supported\n\n\t; Check for MMX instruction support\n\txor\teax,eax\n\tcpuid\n\ttest\teax,eax\n\tjz\tshort .return\n\n\txor\teax,eax\n\tinc\teax\n\tcpuid\n\tmov\teax,edx\t\t\t; eax = Standard feature flags\n\n\ttest\teax, 1<<23\t\t; bit23:MMX\n\tjz\tshort .no_mmx\n\tor\tedi, byte JSIMD_MMX\n.no_mmx:\n\ttest\teax, 1<<25\t\t; bit25:SSE\n\tjz\tshort .no_sse\n\tor\tedi, byte JSIMD_SSE\n.no_sse:\n\ttest\teax, 1<<26\t\t; bit26:SSE2\n\tjz\tshort .no_sse2\n\tor\tedi, byte JSIMD_SSE2\n.no_sse2:\n\n\t; Check for 3DNow! instruction support\n\tmov\teax, 0x80000000\n\tcpuid\n\tcmp\teax, 0x80000000\n\tjbe\tshort .return\n\n\tmov\teax, 0x80000001\n\tcpuid\n\tmov\teax,edx\t\t\t; eax = Extended feature flags\n\n\ttest\teax, 1<<31\t\t; bit31:3DNow!(vendor independent)\n\tjz\tshort .no_3dnow\n\tor\tedi, byte JSIMD_3DNOW\n.no_3dnow:\n\n.return:\n\tmov\teax,edi\n\n\tpop\tedi\n;\tpop\tesi\t\t; unused\n;\tpop\tedx\t\t; need not be preserved\n;\tpop\tecx\t\t; need not be preserved\n\tpop\tebx\n\tret\n\n; For some reason, the OS X linker does not honor the request to align the\n; segment unless we do this.\n\talign\t16\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/jsimdext.inc",
    "content": ";\n; jsimdext.inc - common declarations\n;\n; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB\n; Copyright 2010 D. R. Commander\n;\n; Based on\n; x86 SIMD extension for IJG JPEG library - version 1.02\n;\n; Copyright (C) 1999-2006, MIYASAKA Masaru.\n;\n; This software is provided 'as-is', without any express or implied\n; warranty.  In no event will the authors be held liable for any damages\n; arising from the use of this software.\n;\n; Permission is granted to anyone to use this software for any purpose,\n; including commercial applications, and to alter it and redistribute it\n; freely, subject to the following restrictions:\n;\n; 1. The origin of this software must not be misrepresented; you must not\n;    claim that you wrote the original software. If you use this software\n;    in a product, an acknowledgment in the product documentation would be\n;    appreciated but is not required.\n; 2. Altered source versions must be plainly marked as such, and must not be\n;    misrepresented as being the original software.\n; 3. This notice may not be removed or altered from any source distribution.\n;\n; [TAB8]\n\n; ==========================================================================\n;  System-dependent configurations\n\n%ifdef WIN32\t; ----(nasm -fwin32 -DWIN32 ...)--------\n; * Microsoft Visual C++\n; * MinGW (Minimalist GNU for Windows)\n; * CygWin\n; * LCC-Win32\n\n; -- segment definition --\n;\n%ifdef __YASM_VER__\n%define SEG_TEXT    .text  align=16\n%define SEG_CONST   .rdata align=16\n%else\n%define SEG_TEXT    .text  align=16 public use32 class=CODE\n%define SEG_CONST   .rdata align=16 public use32 class=CONST\n%endif\n\n%elifdef WIN64\t; ----(nasm -fwin64 -DWIN64 ...)--------\n; * Microsoft Visual C++\n\n; -- segment definition --\n;\n%ifdef __YASM_VER__\n%define SEG_TEXT    .text  align=16\n%define SEG_CONST   .rdata align=16\n%else\n%define SEG_TEXT    .text  align=16 public use64 class=CODE\n%define SEG_CONST   .rdata align=16 public use64 class=CONST\n%endif\n%define EXTN(name)  name\t\t\t; foo() -> foo\n\n%elifdef OBJ32\t; ----(nasm -fobj -DOBJ32 ...)----------\n; * Borland C++ (Win32)\n\n; -- segment definition --\n;\n%define SEG_TEXT    .text  align=16 public use32 class=CODE\n%define SEG_CONST   .data  align=16 public use32 class=DATA\n\n%elifdef ELF\t; ----(nasm -felf[64] -DELF ...)------------\n; * Linux\n; * *BSD family Unix using elf format\n; * Unix System V, including Solaris x86, UnixWare and SCO Unix\n\n; mark stack as non-executable\nsection .note.GNU-stack noalloc noexec nowrite progbits\n\n; -- segment definition --\n;\n%ifdef __x86_64__\n%define SEG_TEXT    .text   progbits align=16\n%define SEG_CONST   .rodata progbits align=16\n%else\n%define SEG_TEXT    .text   progbits alloc exec   nowrite align=16\n%define SEG_CONST   .rodata progbits alloc noexec nowrite align=16\n%endif\n\n; To make the code position-independent, append -DPIC to the commandline\n;\n%define GOT_SYMBOL  _GLOBAL_OFFSET_TABLE_\t; ELF supports PIC\n%define EXTN(name)  name\t\t\t; foo() -> foo\n\n%elifdef AOUT\t; ----(nasm -faoutb/aout -DAOUT ...)----\n; * Older Linux using a.out format  (nasm -f aout -DAOUT ...)\n; * *BSD family Unix using a.out format  (nasm -f aoutb -DAOUT ...)\n\n; -- segment definition --\n;\n%define SEG_TEXT    .text\n%define SEG_CONST   .data\n\n; To make the code position-independent, append -DPIC to the commandline\n;\n%define GOT_SYMBOL  __GLOBAL_OFFSET_TABLE_\t; BSD-style a.out supports PIC\n\n%elifdef MACHO\t; ----(nasm -fmacho -DMACHO ...)--------\n; * NeXTstep/OpenStep/Rhapsody/Darwin/MacOS X (Mach-O format)\n\n; -- segment definition --\n;\n%define SEG_TEXT    .text  ;align=16\t; nasm doesn't accept align=16. why?\n%define SEG_CONST   .rodata align=16\n\n; The generation of position-independent code (PIC) is the default on Darwin.\n;\n%define PIC\n%define GOT_SYMBOL  _MACHO_PIC_\t\t; Mach-O style code-relative addressing\n\n%else\t\t; ----(Other case)----------------------\n\n; -- segment definition --\n;\n%define SEG_TEXT    .text\n%define SEG_CONST   .data\n\n%endif\t; ----------------------------------------------\n\n; ==========================================================================\n\n; --------------------------------------------------------------------------\n;  Common types\n;\n%ifdef __x86_64__\n%define POINTER                 qword           ; general pointer type\n%define SIZEOF_POINTER          SIZEOF_QWORD    ; sizeof(POINTER)\n%define POINTER_BIT             QWORD_BIT       ; sizeof(POINTER)*BYTE_BIT\n%else\n%define POINTER                 dword           ; general pointer type\n%define SIZEOF_POINTER          SIZEOF_DWORD    ; sizeof(POINTER)\n%define POINTER_BIT             DWORD_BIT       ; sizeof(POINTER)*BYTE_BIT\n%endif\n\n%define INT                     dword           ; signed integer type\n%define SIZEOF_INT              SIZEOF_DWORD    ; sizeof(INT)\n%define INT_BIT                 DWORD_BIT       ; sizeof(INT)*BYTE_BIT\n\n%define FP32                    dword           ; IEEE754 single\n%define SIZEOF_FP32             SIZEOF_DWORD    ; sizeof(FP32)\n%define FP32_BIT                DWORD_BIT       ; sizeof(FP32)*BYTE_BIT\n\n%define MMWORD                  qword           ; int64  (MMX register)\n%define SIZEOF_MMWORD           SIZEOF_QWORD    ; sizeof(MMWORD)\n%define MMWORD_BIT              QWORD_BIT       ; sizeof(MMWORD)*BYTE_BIT\n\n; NASM is buggy and doesn't properly handle operand sizes for SSE\n; instructions, so for now we have to define XMMWORD as blank.\n%define XMMWORD                                 ; int128 (SSE register)\n%define SIZEOF_XMMWORD          SIZEOF_OWORD    ; sizeof(XMMWORD)\n%define XMMWORD_BIT             OWORD_BIT       ; sizeof(XMMWORD)*BYTE_BIT\n\n; Similar hacks for when we load a dword or MMWORD into an xmm# register\n%define XMM_DWORD\n%define XMM_MMWORD\n\n%define SIZEOF_BYTE             1               ; sizeof(BYTE)\n%define SIZEOF_WORD             2               ; sizeof(WORD)\n%define SIZEOF_DWORD            4               ; sizeof(DWORD)\n%define SIZEOF_QWORD            8               ; sizeof(QWORD)\n%define SIZEOF_OWORD            16              ; sizeof(OWORD)\n\n%define BYTE_BIT                8               ; CHAR_BIT in C\n%define WORD_BIT                16              ; sizeof(WORD)*BYTE_BIT\n%define DWORD_BIT               32              ; sizeof(DWORD)*BYTE_BIT\n%define QWORD_BIT               64              ; sizeof(QWORD)*BYTE_BIT\n%define OWORD_BIT               128             ; sizeof(OWORD)*BYTE_BIT\n\n; --------------------------------------------------------------------------\n;  External Symbol Name\n;\n%ifndef EXTN\n%define EXTN(name)   _ %+ name\t\t; foo() -> _foo\n%endif\n\n; --------------------------------------------------------------------------\n;  Macros for position-independent code (PIC) support\n;\n%ifndef GOT_SYMBOL\n%undef PIC\n%endif\n\n%ifdef PIC ; -------------------------------------------\n\n%ifidn GOT_SYMBOL,_MACHO_PIC_ ; --------------------\n\n; At present, nasm doesn't seem to support PIC generation for Mach-O.\n; The PIC support code below is a little tricky.\n\n\tSECTION\tSEG_CONST\nconst_base:\n\n%define GOTOFF(got,sym) (got) + (sym) - const_base\n\n%imacro get_GOT\t1\n\t; NOTE: this macro destroys ecx resister.\n\tcall\t%%geteip\n\tadd\tecx, byte (%%ref - $)\n\tjmp\tshort %%adjust\n%%geteip:\n\tmov\tecx, POINTER [esp]\n\tret\n%%adjust:\n\tpush\tebp\n\txor\tebp,ebp\t\t; ebp = 0\n%ifidni %1,ebx\t; (%1 == ebx)\n\t; db 0x8D,0x9C + jmp near const_base =\n\t;   lea ebx, [ecx+ebp*8+(const_base-%%ref)] ; 8D,9C,E9,(offset32)\n\tdb\t0x8D,0x9C\t\t; 8D,9C\n\tjmp\tnear const_base\t\t; E9,(const_base-%%ref)\n%%ref:\n%else  ; (%1 != ebx)\n\t; db 0x8D,0x8C + jmp near const_base =\n\t;   lea ecx, [ecx+ebp*8+(const_base-%%ref)] ; 8D,8C,E9,(offset32)\n\tdb\t0x8D,0x8C\t\t; 8D,8C\n\tjmp\tnear const_base\t\t; E9,(const_base-%%ref)\n%%ref:\tmov\t%1, ecx\n%endif ; (%1 == ebx)\n\tpop\tebp\n%endmacro\n\n%else\t; GOT_SYMBOL != _MACHO_PIC_ ----------------\n\n%define GOTOFF(got,sym) (got) + (sym) wrt ..gotoff\n\n%imacro get_GOT\t1\n\textern\tGOT_SYMBOL\n\tcall\t%%geteip\n\tadd\t%1, GOT_SYMBOL + $$ - $ wrt ..gotpc\n\tjmp\tshort %%done\n%%geteip:\n\tmov\t%1, POINTER [esp]\n\tret\n%%done:\n%endmacro\n\n%endif\t; GOT_SYMBOL == _MACHO_PIC_ ----------------\n\n%imacro pushpic\t1.nolist\n\tpush\t%1\n%endmacro\n%imacro poppic\t1.nolist\n\tpop\t%1\n%endmacro\n%imacro movpic\t2.nolist\n\tmov\t%1,%2\n%endmacro\n\n%else\t; !PIC -----------------------------------------\n\n%define GOTOFF(got,sym) (sym)\n\n%imacro get_GOT\t1.nolist\n%endmacro\n%imacro pushpic\t1.nolist\n%endmacro\n%imacro poppic\t1.nolist\n%endmacro\n%imacro movpic\t2.nolist\n%endmacro\n\n%endif\t;  PIC -----------------------------------------\n\n; --------------------------------------------------------------------------\n;  Align the next instruction on {2,4,8,16,..}-byte boundary.\n;  \".balign n,,m\" in GNU as\n;\n%define MSKLE(x,y)  (~(((y) & 0xFFFF) - ((x) & 0xFFFF)) >> 16)\n%define FILLB(b,n)  (($$-(b)) & ((n)-1))\n\n%imacro alignx 1-2.nolist 0xFFFF\n%%bs:\ttimes MSKLE(FILLB(%%bs,%1),%2) & MSKLE(16,FILLB($,%1)) & FILLB($,%1) \\\n\t       db 0x90                               ; nop\n\ttimes MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/9 \\\n\t       db 0x8D,0x9C,0x23,0x00,0x00,0x00,0x00 ; lea ebx,[ebx+0x00000000]\n\ttimes MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/7 \\\n\t       db 0x8D,0xAC,0x25,0x00,0x00,0x00,0x00 ; lea ebp,[ebp+0x00000000]\n\ttimes MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/6 \\\n\t       db 0x8D,0xAD,0x00,0x00,0x00,0x00      ; lea ebp,[ebp+0x00000000]\n\ttimes MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/4 \\\n\t       db 0x8D,0x6C,0x25,0x00                ; lea ebp,[ebp+0x00]\n\ttimes MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/3 \\\n\t       db 0x8D,0x6D,0x00                     ; lea ebp,[ebp+0x00]\n\ttimes MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/2 \\\n\t       db 0x8B,0xED                          ; mov ebp,ebp\n\ttimes MSKLE(FILLB(%%bs,%1),%2) & FILLB($,%1)/1 \\\n\t       db 0x90                               ; nop\n%endmacro\n\n; Align the next data on {2,4,8,16,..}-byte boundary.\n;\n%imacro alignz 1.nolist\n\talign %1, db 0\t\t; filling zeros\n%endmacro\n\n%ifdef __x86_64__\n\n%ifdef WIN64\n\n%imacro collect_args 0\n\tpush r12\n\tpush r13\n\tpush r14\n\tpush r15\n\tmov r10, rcx\n\tmov r11, rdx\n\tmov r12, r8\n\tmov r13, r9\n\tmov r14, [rax+48]\n\tmov r15, [rax+56]\n\tpush rsi\n\tpush rdi\n\tsub     rsp, SIZEOF_XMMWORD\n\tmovaps  XMMWORD [rsp], xmm6\n\tsub     rsp, SIZEOF_XMMWORD\n\tmovaps  XMMWORD [rsp], xmm7\n%endmacro\n\n%imacro uncollect_args 0\n\tmovaps  xmm7, XMMWORD [rsp]\n\tadd     rsp, SIZEOF_XMMWORD\n\tmovaps  xmm6, XMMWORD [rsp]\n\tadd     rsp, SIZEOF_XMMWORD\n\tpop rdi\n\tpop rsi\n\tpop r15\n\tpop r14\n\tpop r13\n\tpop r12\n%endmacro\n\n%else\n\n%imacro collect_args 0\n\tpush r10\n\tpush r11\n\tpush r12\n\tpush r13\n\tpush r14\n\tpush r15\n\tmov r10, rdi\n\tmov r11, rsi\n\tmov r12, rdx\n\tmov r13, rcx\n\tmov r14, r8\n\tmov r15, r9\n%endmacro\n\n%imacro uncollect_args 0\n\tpop r15\n\tpop r14\n\tpop r13\n\tpop r12\n\tpop r11\n\tpop r10\n%endmacro\n\n%endif\n\n%endif\n\n; --------------------------------------------------------------------------\n;  Defines picked up from the C headers\n;\n%include \"jsimdcfg.inc\"\n\n; --------------------------------------------------------------------------\n"
  },
  {
    "path": "ext/libjpeg-turbo/simd/nasm_lt.sh",
    "content": "#! /bin/sh\ncommand=\"\"\ninfile=\"\"\no_opt=no\npic=no\nwhile [ $# -gt 0 ]; do\n    case \"$1\" in\n        -DPIC|-fPIC|-fpic|-Kpic|-KPIC)\n            if [ \"$pic\" != \"yes\" ] ; then\n                command=\"$command -DPIC\"\n                pic=yes\n            fi\n            ;;\n        -f|-fbin|-faout|-faoutb|-fcoff|-felf|-felf64|-fas86| \\\n        -fobj|-fwin32|-fwin64|-frdf|-fieee|-fmacho|-fmacho64)\n            # it's a file format specifier for nasm.\n            command=\"$command $1\"\n            ;;\n        -f*)\n            # maybe a code-generation flag for gcc.\n            ;;\n        -[Ii]*)\n            incdir=`echo \"$1\" | sed 's/^-[Ii]//'`\n            if [ \"x$incdir\" = x -a \"x$2\" != x ] ; then\n                case \"$2\" in\n                    -*) ;;\n                    *) incdir=\"$2\"; shift;;\n                esac\n            fi\n            if [ \"x$incdir\" != x ] ; then\n                # In the case of NASM, the trailing slash is necessary.\n                incdir=`echo \"$incdir\" | sed 's%/*$%/%'`\n                command=\"$command -I$incdir\"\n            fi\n            ;;\n        -o*)\n            o_opt=yes\n            command=\"$command $1\"\n            ;;\n        *.asm)\n            infile=$1\n            command=\"$command $1\"\n            ;;\n        *)\n            command=\"$command $1\"\n            ;;\n    esac\n    shift\ndone\nif [ \"$o_opt\" != yes ] ; then\n    # By default, NASM creates an output file\n    # in the same directory as the input file.\n    outfile=\"-o `echo $infile | sed -e 's%^.*/%%' -e 's%\\.[^.]*$%%'`.o\"\n    command=\"$command $outfile\"\nfi\necho $command\nexec $command\n"
  },
  {
    "path": "ext/libjpeg-turbo/structure.txt",
    "content": "IJG JPEG LIBRARY:  SYSTEM ARCHITECTURE\n\nCopyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding.\nThis file was part of the Independent JPEG Group's software.\nIt was modified by The libjpeg-turbo Project to include only information\nrelevant to libjpeg-turbo.\nFor conditions of distribution and use, see the accompanying README file.\n\n\nThis file provides an overview of the architecture of the IJG JPEG software;\nthat is, the functions of the various modules in the system and the interfaces\nbetween modules.  For more precise details about any data structure or calling\nconvention, see the include files and comments in the source code.\n\nWe assume that the reader is already somewhat familiar with the JPEG standard.\nThe README file includes references for learning about JPEG.  The file\nlibjpeg.txt describes the library from the viewpoint of an application\nprogrammer using the library; it's best to read that file before this one.\nAlso, the file coderules.txt describes the coding style conventions we use.\n\nIn this document, JPEG-specific terminology follows the JPEG standard:\n  A \"component\" means a color channel, e.g., Red or Luminance.\n  A \"sample\" is a single component value (i.e., one number in the image data).\n  A \"coefficient\" is a frequency coefficient (a DCT transform output number).\n  A \"block\" is an 8x8 group of samples or coefficients.\n  An \"MCU\" (minimum coded unit) is an interleaved set of blocks of size\n\tdetermined by the sampling factors, or a single block in a\n\tnoninterleaved scan.\nWe do not use the terms \"pixel\" and \"sample\" interchangeably.  When we say\npixel, we mean an element of the full-size image, while a sample is an element\nof the downsampled image.  Thus the number of samples may vary across\ncomponents while the number of pixels does not.  (This terminology is not used\nrigorously throughout the code, but it is used in places where confusion would\notherwise result.)\n\n\n*** System features ***\n\nThe IJG distribution contains two parts:\n  * A subroutine library for JPEG compression and decompression.\n  * cjpeg/djpeg, two sample applications that use the library to transform\n    JFIF JPEG files to and from several other image formats.\ncjpeg/djpeg are of no great intellectual complexity: they merely add a simple\ncommand-line user interface and I/O routines for several uncompressed image\nformats.  This document concentrates on the library itself.\n\nWe desire the library to be capable of supporting all JPEG baseline, extended\nsequential, and progressive DCT processes.  Hierarchical processes are not\nsupported.\n\nThe library does not support the lossless (spatial) JPEG process.  Lossless\nJPEG shares little or no code with lossy JPEG, and would normally be used\nwithout the extensive pre- and post-processing provided by this library.\nWe feel that lossless JPEG is better handled by a separate library.\n\nWithin these limits, any set of compression parameters allowed by the JPEG\nspec should be readable for decompression.  (We can be more restrictive about\nwhat formats we can generate.)  Although the system design allows for all\nparameter values, some uncommon settings are not yet implemented and may\nnever be; nonintegral sampling ratios are the prime example.  Furthermore,\nwe treat 8-bit vs. 12-bit data precision as a compile-time switch, not a\nrun-time option, because most machines can store 8-bit pixels much more\ncompactly than 12-bit.\n\nBy itself, the library handles only interchange JPEG datastreams --- in\nparticular the widely used JFIF file format.  The library can be used by\nsurrounding code to process interchange or abbreviated JPEG datastreams that\nare embedded in more complex file formats.  (For example, libtiff uses this\nlibrary to implement JPEG compression within the TIFF file format.)\n\nThe library includes a substantial amount of code that is not covered by the\nJPEG standard but is necessary for typical applications of JPEG.  These\nfunctions preprocess the image before JPEG compression or postprocess it after\ndecompression.  They include colorspace conversion, downsampling/upsampling,\nand color quantization.  This code can be omitted if not needed.\n\nA wide range of quality vs. speed tradeoffs are possible in JPEG processing,\nand even more so in decompression postprocessing.  The decompression library\nprovides multiple implementations that cover most of the useful tradeoffs,\nranging from very-high-quality down to fast-preview operation.  On the\ncompression side we have generally not provided low-quality choices, since\ncompression is normally less time-critical.  It should be understood that the\nlow-quality modes may not meet the JPEG standard's accuracy requirements;\nnonetheless, they are useful for viewers.\n\n\n*** Portability issues ***\n\nPortability is an essential requirement for the library.  The key portability\nissues that show up at the level of system architecture are:\n\n1.  Memory usage.  We want the code to be able to run on PC-class machines\nwith limited memory.  Images should therefore be processed sequentially (in\nstrips), to avoid holding the whole image in memory at once.  Where a\nfull-image buffer is necessary, we should be able to use either virtual memory\nor temporary files.\n\n2.  Near/far pointer distinction.  To run efficiently on 80x86 machines, the\ncode should distinguish \"small\" objects (kept in near data space) from\n\"large\" ones (kept in far data space).  This is an annoying restriction, but\nfortunately it does not impact code quality for less brain-damaged machines,\nand the source code clutter turns out to be minimal with sufficient use of\npointer typedefs.\n\n3. Data precision.  We assume that \"char\" is at least 8 bits, \"short\" and\n\"int\" at least 16, \"long\" at least 32.  The code will work fine with larger\ndata sizes, although memory may be used inefficiently in some cases.  However,\nthe JPEG compressed datastream must ultimately appear on external storage as a\nsequence of 8-bit bytes if it is to conform to the standard.  This may pose a\nproblem on machines where char is wider than 8 bits.  The library represents\ncompressed data as an array of values of typedef JOCTET.  If no data type\nexactly 8 bits wide is available, custom data source and data destination\nmodules must be written to unpack and pack the chosen JOCTET datatype into\n8-bit external representation.\n\n\n*** System overview ***\n\nThe compressor and decompressor are each divided into two main sections:\nthe JPEG compressor or decompressor proper, and the preprocessing or\npostprocessing functions.  The interface between these two sections is the\nimage data that the official JPEG spec regards as its input or output: this\ndata is in the colorspace to be used for compression, and it is downsampled\nto the sampling factors to be used.  The preprocessing and postprocessing\nsteps are responsible for converting a normal image representation to or from\nthis form.  (Those few applications that want to deal with YCbCr downsampled\ndata can skip the preprocessing or postprocessing step.)\n\nLooking more closely, the compressor library contains the following main\nelements:\n\n  Preprocessing:\n    * Color space conversion (e.g., RGB to YCbCr).\n    * Edge expansion and downsampling.  Optionally, this step can do simple\n      smoothing --- this is often helpful for low-quality source data.\n  JPEG proper:\n    * MCU assembly, DCT, quantization.\n    * Entropy coding (sequential or progressive, Huffman or arithmetic).\n\nIn addition to these modules we need overall control, marker generation,\nand support code (memory management & error handling).  There is also a\nmodule responsible for physically writing the output data --- typically\nthis is just an interface to fwrite(), but some applications may need to\ndo something else with the data.\n\nThe decompressor library contains the following main elements:\n\n  JPEG proper:\n    * Entropy decoding (sequential or progressive, Huffman or arithmetic).\n    * Dequantization, inverse DCT, MCU disassembly.\n  Postprocessing:\n    * Upsampling.  Optionally, this step may be able to do more general\n      rescaling of the image.\n    * Color space conversion (e.g., YCbCr to RGB).  This step may also\n      provide gamma adjustment [ currently it does not ].\n    * Optional color quantization (e.g., reduction to 256 colors).\n    * Optional color precision reduction (e.g., 24-bit to 15-bit color).\n      [This feature is not currently implemented.]\n\nWe also need overall control, marker parsing, and a data source module.\nThe support code (memory management & error handling) can be shared with\nthe compression half of the library.\n\nThere may be several implementations of each of these elements, particularly\nin the decompressor, where a wide range of speed/quality tradeoffs is very\nuseful.  It must be understood that some of the best speedups involve\nmerging adjacent steps in the pipeline.  For example, upsampling, color space\nconversion, and color quantization might all be done at once when using a\nlow-quality ordered-dither technique.  The system architecture is designed to\nallow such merging where appropriate.\n\n\nNote: it is convenient to regard edge expansion (padding to block boundaries)\nas a preprocessing/postprocessing function, even though the JPEG spec includes\nit in compression/decompression.  We do this because downsampling/upsampling\ncan be simplified a little if they work on padded data: it's not necessary to\nhave special cases at the right and bottom edges.  Therefore the interface\nbuffer is always an integral number of blocks wide and high, and we expect\ncompression preprocessing to pad the source data properly.  Padding will occur\nonly to the next block (8-sample) boundary.  In an interleaved-scan situation,\nadditional dummy blocks may be used to fill out MCUs, but the MCU assembly and\ndisassembly logic will create or discard these blocks internally.  (This is\nadvantageous for speed reasons, since we avoid DCTing the dummy blocks.\nIt also permits a small reduction in file size, because the compressor can\nchoose dummy block contents so as to minimize their size in compressed form.\nFinally, it makes the interface buffer specification independent of whether\nthe file is actually interleaved or not.)  Applications that wish to deal\ndirectly with the downsampled data must provide similar buffering and padding\nfor odd-sized images.\n\n\n*** Poor man's object-oriented programming ***\n\nIt should be clear by now that we have a lot of quasi-independent processing\nsteps, many of which have several possible behaviors.  To avoid cluttering the\ncode with lots of switch statements, we use a simple form of object-style\nprogramming to separate out the different possibilities.\n\nFor example, two different color quantization algorithms could be implemented\nas two separate modules that present the same external interface; at runtime,\nthe calling code will access the proper module indirectly through an \"object\".\n\nWe can get the limited features we need while staying within portable C.\nThe basic tool is a function pointer.  An \"object\" is just a struct\ncontaining one or more function pointer fields, each of which corresponds to\na method name in real object-oriented languages.  During initialization we\nfill in the function pointers with references to whichever module we have\ndetermined we need to use in this run.  Then invocation of the module is done\nby indirecting through a function pointer; on most machines this is no more\nexpensive than a switch statement, which would be the only other way of\nmaking the required run-time choice.  The really significant benefit, of\ncourse, is keeping the source code clean and well structured.\n\nWe can also arrange to have private storage that varies between different\nimplementations of the same kind of object.  We do this by making all the\nmodule-specific object structs be separately allocated entities, which will\nbe accessed via pointers in the master compression or decompression struct.\nThe \"public\" fields or methods for a given kind of object are specified by\na commonly known struct.  But a module's initialization code can allocate\na larger struct that contains the common struct as its first member, plus\nadditional private fields.  With appropriate pointer casting, the module's\ninternal functions can access these private fields.  (For a simple example,\nsee jdatadst.c, which implements the external interface specified by struct\njpeg_destination_mgr, but adds extra fields.)\n\n(Of course this would all be a lot easier if we were using C++, but we are\nnot yet prepared to assume that everyone has a C++ compiler.)\n\nAn important benefit of this scheme is that it is easy to provide multiple\nversions of any method, each tuned to a particular case.  While a lot of\nprecalculation might be done to select an optimal implementation of a method,\nthe cost per invocation is constant.  For example, the upsampling step might\nhave a \"generic\" method, plus one or more \"hardwired\" methods for the most\npopular sampling factors; the hardwired methods would be faster because they'd\nuse straight-line code instead of for-loops.  The cost to determine which\nmethod to use is paid only once, at startup, and the selection criteria are\nhidden from the callers of the method.\n\nThis plan differs a little bit from usual object-oriented structures, in that\nonly one instance of each object class will exist during execution.  The\nreason for having the class structure is that on different runs we may create\ndifferent instances (choose to execute different modules).  You can think of\nthe term \"method\" as denoting the common interface presented by a particular\nset of interchangeable functions, and \"object\" as denoting a group of related\nmethods, or the total shared interface behavior of a group of modules.\n\n\n*** Overall control structure ***\n\nWe previously mentioned the need for overall control logic in the compression\nand decompression libraries.  In IJG implementations prior to v5, overall\ncontrol was mostly provided by \"pipeline control\" modules, which proved to be\nlarge, unwieldy, and hard to understand.  To improve the situation, the\ncontrol logic has been subdivided into multiple modules.  The control modules\nconsist of:\n\n1. Master control for module selection and initialization.  This has two\nresponsibilities:\n\n   1A.  Startup initialization at the beginning of image processing.\n        The individual processing modules to be used in this run are selected\n        and given initialization calls.\n\n   1B.  Per-pass control.  This determines how many passes will be performed\n        and calls each active processing module to configure itself\n        appropriately at the beginning of each pass.  End-of-pass processing,\n\twhere necessary, is also invoked from the master control module.\n\n   Method selection is partially distributed, in that a particular processing\n   module may contain several possible implementations of a particular method,\n   which it will select among when given its initialization call.  The master\n   control code need only be concerned with decisions that affect more than\n   one module.\n \n2. Data buffering control.  A separate control module exists for each\n   inter-processing-step data buffer.  This module is responsible for\n   invoking the processing steps that write or read that data buffer.\n\nEach buffer controller sees the world as follows:\n\ninput data => processing step A => buffer => processing step B => output data\n                      |              |               |\n              ------------------ controller ------------------\n\nThe controller knows the dataflow requirements of steps A and B: how much data\nthey want to accept in one chunk and how much they output in one chunk.  Its\nfunction is to manage its buffer and call A and B at the proper times.\n\nA data buffer control module may itself be viewed as a processing step by a\nhigher-level control module; thus the control modules form a binary tree with\nelementary processing steps at the leaves of the tree.\n\nThe control modules are objects.  A considerable amount of flexibility can\nbe had by replacing implementations of a control module.  For example:\n* Merging of adjacent steps in the pipeline is done by replacing a control\n  module and its pair of processing-step modules with a single processing-\n  step module.  (Hence the possible merges are determined by the tree of\n  control modules.)\n* In some processing modes, a given interstep buffer need only be a \"strip\"\n  buffer large enough to accommodate the desired data chunk sizes.  In other\n  modes, a full-image buffer is needed and several passes are required.\n  The control module determines which kind of buffer is used and manipulates\n  virtual array buffers as needed.  One or both processing steps may be\n  unaware of the multi-pass behavior.\n\nIn theory, we might be able to make all of the data buffer controllers\ninterchangeable and provide just one set of implementations for all.  In\npractice, each one contains considerable special-case processing for its\nparticular job.  The buffer controller concept should be regarded as an\noverall system structuring principle, not as a complete description of the\ntask performed by any one controller.\n\n\n*** Compression object structure ***\n\nHere is a sketch of the logical structure of the JPEG compression library:\n\n                                                 |-- Colorspace conversion\n                  |-- Preprocessing controller --|\n                  |                              |-- Downsampling\nMain controller --|\n                  |                            |-- Forward DCT, quantize\n                  |-- Coefficient controller --|\n                                               |-- Entropy encoding\n\nThis sketch also describes the flow of control (subroutine calls) during\ntypical image data processing.  Each of the components shown in the diagram is\nan \"object\" which may have several different implementations available.  One\nor more source code files contain the actual implementation(s) of each object.\n\nThe objects shown above are:\n\n* Main controller: buffer controller for the subsampled-data buffer, which\n  holds the preprocessed input data.  This controller invokes preprocessing to\n  fill the subsampled-data buffer, and JPEG compression to empty it.  There is\n  usually no need for a full-image buffer here; a strip buffer is adequate.\n\n* Preprocessing controller: buffer controller for the downsampling input data\n  buffer, which lies between colorspace conversion and downsampling.  Note\n  that a unified conversion/downsampling module would probably replace this\n  controller entirely.\n\n* Colorspace conversion: converts application image data into the desired\n  JPEG color space; also changes the data from pixel-interleaved layout to\n  separate component planes.  Processes one pixel row at a time.\n\n* Downsampling: performs reduction of chroma components as required.\n  Optionally may perform pixel-level smoothing as well.  Processes a \"row\n  group\" at a time, where a row group is defined as Vmax pixel rows of each\n  component before downsampling, and Vk sample rows afterwards (remember Vk\n  differs across components).  Some downsampling or smoothing algorithms may\n  require context rows above and below the current row group; the\n  preprocessing controller is responsible for supplying these rows via proper\n  buffering.  The downsampler is responsible for edge expansion at the right\n  edge (i.e., extending each sample row to a multiple of 8 samples); but the\n  preprocessing controller is responsible for vertical edge expansion (i.e.,\n  duplicating the bottom sample row as needed to make a multiple of 8 rows).\n\n* Coefficient controller: buffer controller for the DCT-coefficient data.\n  This controller handles MCU assembly, including insertion of dummy DCT\n  blocks when needed at the right or bottom edge.  When performing\n  Huffman-code optimization or emitting a multiscan JPEG file, this\n  controller is responsible for buffering the full image.  The equivalent of\n  one fully interleaved MCU row of subsampled data is processed per call,\n  even when the JPEG file is noninterleaved.\n\n* Forward DCT and quantization: Perform DCT, quantize, and emit coefficients.\n  Works on one or more DCT blocks at a time.  (Note: the coefficients are now\n  emitted in normal array order, which the entropy encoder is expected to\n  convert to zigzag order as necessary.  Prior versions of the IJG code did\n  the conversion to zigzag order within the quantization step.)\n\n* Entropy encoding: Perform Huffman or arithmetic entropy coding and emit the\n  coded data to the data destination module.  Works on one MCU per call.\n  For progressive JPEG, the same DCT blocks are fed to the entropy coder\n  during each pass, and the coder must emit the appropriate subset of\n  coefficients.\n\nIn addition to the above objects, the compression library includes these\nobjects:\n\n* Master control: determines the number of passes required, controls overall\n  and per-pass initialization of the other modules.\n\n* Marker writing: generates JPEG markers (except for RSTn, which is emitted\n  by the entropy encoder when needed).\n\n* Data destination manager: writes the output JPEG datastream to its final\n  destination (e.g., a file).  The destination manager supplied with the\n  library knows how to write to a stdio stream or to a memory buffer;\n  for other behaviors, the surrounding application may provide its own\n  destination manager.\n\n* Memory manager: allocates and releases memory, controls virtual arrays\n  (with backing store management, where required).\n\n* Error handler: performs formatting and output of error and trace messages;\n  determines handling of nonfatal errors.  The surrounding application may\n  override some or all of this object's methods to change error handling.\n\n* Progress monitor: supports output of \"percent-done\" progress reports.\n  This object represents an optional callback to the surrounding application:\n  if wanted, it must be supplied by the application.\n\nThe error handler, destination manager, and progress monitor objects are\ndefined as separate objects in order to simplify application-specific\ncustomization of the JPEG library.  A surrounding application may override\nindividual methods or supply its own all-new implementation of one of these\nobjects.  The object interfaces for these objects are therefore treated as\npart of the application interface of the library, whereas the other objects\nare internal to the library.\n\nThe error handler and memory manager are shared by JPEG compression and\ndecompression; the progress monitor, if used, may be shared as well.\n\n\n*** Decompression object structure ***\n\nHere is a sketch of the logical structure of the JPEG decompression library:\n\n                                               |-- Entropy decoding\n                  |-- Coefficient controller --|\n                  |                            |-- Dequantize, Inverse DCT\nMain controller --|\n                  |                               |-- Upsampling\n                  |-- Postprocessing controller --|   |-- Colorspace conversion\n                                                  |-- Color quantization\n                                                  |-- Color precision reduction\n\nAs before, this diagram also represents typical control flow.  The objects\nshown are:\n\n* Main controller: buffer controller for the subsampled-data buffer, which\n  holds the output of JPEG decompression proper.  This controller's primary\n  task is to feed the postprocessing procedure.  Some upsampling algorithms\n  may require context rows above and below the current row group; when this\n  is true, the main controller is responsible for managing its buffer so as\n  to make context rows available.  In the current design, the main buffer is\n  always a strip buffer; a full-image buffer is never required.\n\n* Coefficient controller: buffer controller for the DCT-coefficient data.\n  This controller handles MCU disassembly, including deletion of any dummy\n  DCT blocks at the right or bottom edge.  When reading a multiscan JPEG\n  file, this controller is responsible for buffering the full image.\n  (Buffering DCT coefficients, rather than samples, is necessary to support\n  progressive JPEG.)  The equivalent of one fully interleaved MCU row of\n  subsampled data is processed per call, even when the source JPEG file is\n  noninterleaved.\n\n* Entropy decoding: Read coded data from the data source module and perform\n  Huffman or arithmetic entropy decoding.  Works on one MCU per call.\n  For progressive JPEG decoding, the coefficient controller supplies the prior\n  coefficients of each MCU (initially all zeroes), which the entropy decoder\n  modifies in each scan.\n\n* Dequantization and inverse DCT: like it says.  Note that the coefficients\n  buffered by the coefficient controller have NOT been dequantized; we\n  merge dequantization and inverse DCT into a single step for speed reasons.\n  When scaled-down output is asked for, simplified DCT algorithms may be used\n  that emit fewer samples per DCT block, not the full 8x8.  Works on one DCT\n  block at a time.\n\n* Postprocessing controller: buffer controller for the color quantization\n  input buffer, when quantization is in use.  (Without quantization, this\n  controller just calls the upsampler.)  For two-pass quantization, this\n  controller is responsible for buffering the full-image data.\n\n* Upsampling: restores chroma components to full size.  (May support more\n  general output rescaling, too.  Note that if undersized DCT outputs have\n  been emitted by the DCT module, this module must adjust so that properly\n  sized outputs are created.)  Works on one row group at a time.  This module\n  also calls the color conversion module, so its top level is effectively a\n  buffer controller for the upsampling->color conversion buffer.  However, in\n  all but the highest-quality operating modes, upsampling and color\n  conversion are likely to be merged into a single step.\n\n* Colorspace conversion: convert from JPEG color space to output color space,\n  and change data layout from separate component planes to pixel-interleaved.\n  Works on one pixel row at a time.\n\n* Color quantization: reduce the data to colormapped form, using either an\n  externally specified colormap or an internally generated one.  This module\n  is not used for full-color output.  Works on one pixel row at a time; may\n  require two passes to generate a color map.  Note that the output will\n  always be a single component representing colormap indexes.  In the current\n  design, the output values are JSAMPLEs, so an 8-bit compilation cannot\n  quantize to more than 256 colors.  This is unlikely to be a problem in\n  practice.\n\n* Color reduction: this module handles color precision reduction, e.g.,\n  generating 15-bit color (5 bits/primary) from JPEG's 24-bit output.\n  Not quite clear yet how this should be handled... should we merge it with\n  colorspace conversion???\n\nNote that some high-speed operating modes might condense the entire\npostprocessing sequence to a single module (upsample, color convert, and\nquantize in one step).\n\nIn addition to the above objects, the decompression library includes these\nobjects:\n\n* Master control: determines the number of passes required, controls overall\n  and per-pass initialization of the other modules.  This is subdivided into\n  input and output control: jdinput.c controls only input-side processing,\n  while jdmaster.c handles overall initialization and output-side control.\n\n* Marker reading: decodes JPEG markers (except for RSTn).\n\n* Data source manager: supplies the input JPEG datastream.  The source\n  manager supplied with the library knows how to read from a stdio stream\n  or from a memory buffer;  for other behaviors, the surrounding application\n  may provide its own source manager.\n\n* Memory manager: same as for compression library.\n\n* Error handler: same as for compression library.\n\n* Progress monitor: same as for compression library.\n\nAs with compression, the data source manager, error handler, and progress\nmonitor are candidates for replacement by a surrounding application.\n\n\n*** Decompression input and output separation ***\n\nTo support efficient incremental display of progressive JPEG files, the\ndecompressor is divided into two sections that can run independently:\n\n1. Data input includes marker parsing, entropy decoding, and input into the\n   coefficient controller's DCT coefficient buffer.  Note that this\n   processing is relatively cheap and fast.\n\n2. Data output reads from the DCT coefficient buffer and performs the IDCT\n   and all postprocessing steps.\n\nFor a progressive JPEG file, the data input processing is allowed to get\narbitrarily far ahead of the data output processing.  (This occurs only\nif the application calls jpeg_consume_input(); otherwise input and output\nrun in lockstep, since the input section is called only when the output\nsection needs more data.)  In this way the application can avoid making\nextra display passes when data is arriving faster than the display pass\ncan run.  Furthermore, it is possible to abort an output pass without\nlosing anything, since the coefficient buffer is read-only as far as the\noutput section is concerned.  See libjpeg.txt for more detail.\n\nA full-image coefficient array is only created if the JPEG file has multiple\nscans (or if the application specifies buffered-image mode anyway).  When\nreading a single-scan file, the coefficient controller normally creates only\na one-MCU buffer, so input and output processing must run in lockstep in this\ncase.  jpeg_consume_input() is effectively a no-op in this situation.\n\nThe main impact of dividing the decompressor in this fashion is that we must\nbe very careful with shared variables in the cinfo data structure.  Each\nvariable that can change during the course of decompression must be\nclassified as belonging to data input or data output, and each section must\nlook only at its own variables.  For example, the data output section may not\ndepend on any of the variables that describe the current scan in the JPEG\nfile, because these may change as the data input section advances into a new\nscan.\n\nThe progress monitor is (somewhat arbitrarily) defined to treat input of the\nfile as one pass when buffered-image mode is not used, and to ignore data\ninput work completely when buffered-image mode is used.  Note that the\nlibrary has no reliable way to predict the number of passes when dealing\nwith a progressive JPEG file, nor can it predict the number of output passes\nin buffered-image mode.  So the work estimate is inherently bogus anyway.\n\nNo comparable division is currently made in the compression library, because\nthere isn't any real need for it.\n\n\n*** Data formats ***\n\nArrays of pixel sample values use the following data structure:\n\n    typedef something JSAMPLE;\t\ta pixel component value, 0..MAXJSAMPLE\n    typedef JSAMPLE *JSAMPROW;\t\tptr to a row of samples\n    typedef JSAMPROW *JSAMPARRAY;\tptr to a list of rows\n    typedef JSAMPARRAY *JSAMPIMAGE;\tptr to a list of color-component arrays\n\nThe basic element type JSAMPLE will typically be one of unsigned char,\n(signed) char, or short.  Short will be used if samples wider than 8 bits are\nto be supported (this is a compile-time option).  Otherwise, unsigned char is\nused if possible.  If the compiler only supports signed chars, then it is\nnecessary to mask off the value when reading.  Thus, all reads of JSAMPLE\nvalues must be coded as \"GETJSAMPLE(value)\", where the macro will be defined\nas \"((value) & 0xFF)\" on signed-char machines and \"((int) (value))\" elsewhere.\n\nWith these conventions, JSAMPLE values can be assumed to be >= 0.  This helps\nsimplify correct rounding during downsampling, etc.  The JPEG standard's\nspecification that sample values run from -128..127 is accommodated by\nsubtracting 128 from the sample value in the DCT step.  Similarly, during\ndecompression the output of the IDCT step will be immediately shifted back to\n0..255.  (NB: different values are required when 12-bit samples are in use.\nThe code is written in terms of MAXJSAMPLE and CENTERJSAMPLE, which will be\ndefined as 255 and 128 respectively in an 8-bit implementation, and as 4095\nand 2048 in a 12-bit implementation.)\n\nWe use a pointer per row, rather than a two-dimensional JSAMPLE array.  This\nchoice costs only a small amount of memory and has several benefits:\n* Code using the data structure doesn't need to know the allocated width of\n  the rows.  This simplifies edge expansion/compression, since we can work\n  in an array that's wider than the logical picture width.\n* Indexing doesn't require multiplication; this is a performance win on many\n  machines.\n* Arrays with more than 64K total elements can be supported even on machines\n  where malloc() cannot allocate chunks larger than 64K.\n* The rows forming a component array may be allocated at different times\n  without extra copying.  This trick allows some speedups in smoothing steps\n  that need access to the previous and next rows.\n\nNote that each color component is stored in a separate array; we don't use the\ntraditional layout in which the components of a pixel are stored together.\nThis simplifies coding of modules that work on each component independently,\nbecause they don't need to know how many components there are.  Furthermore,\nwe can read or write each component to a temporary file independently, which\nis helpful when dealing with noninterleaved JPEG files.\n\nIn general, a specific sample value is accessed by code such as\n\tGETJSAMPLE(image[colorcomponent][row][col])\nwhere col is measured from the image left edge, but row is measured from the\nfirst sample row currently in memory.  Either of the first two indexings can\nbe precomputed by copying the relevant pointer.\n\n\nSince most image-processing applications prefer to work on images in which\nthe components of a pixel are stored together, the data passed to or from the\nsurrounding application uses the traditional convention: a single pixel is\nrepresented by N consecutive JSAMPLE values, and an image row is an array of\n(# of color components)*(image width) JSAMPLEs.  One or more rows of data can\nbe represented by a pointer of type JSAMPARRAY in this scheme.  This scheme is\nconverted to component-wise storage inside the JPEG library.  (Applications\nthat want to skip JPEG preprocessing or postprocessing will have to contend\nwith component-wise storage.)\n\n\nArrays of DCT-coefficient values use the following data structure:\n\n    typedef short JCOEF;\t\ta 16-bit signed integer\n    typedef JCOEF JBLOCK[DCTSIZE2];\tan 8x8 block of coefficients\n    typedef JBLOCK *JBLOCKROW;\t\tptr to one horizontal row of 8x8 blocks\n    typedef JBLOCKROW *JBLOCKARRAY;\tptr to a list of such rows\n    typedef JBLOCKARRAY *JBLOCKIMAGE;\tptr to a list of color component arrays\n\nThe underlying type is at least a 16-bit signed integer; while \"short\" is big\nenough on all machines of interest, on some machines it is preferable to use\n\"int\" for speed reasons, despite the storage cost.  Coefficients are grouped\ninto 8x8 blocks (but we always use #defines DCTSIZE and DCTSIZE2 rather than\n\"8\" and \"64\").\n\nThe contents of a coefficient block may be in either \"natural\" or zigzagged\norder, and may be true values or divided by the quantization coefficients,\ndepending on where the block is in the processing pipeline.  In the current\nlibrary, coefficient blocks are kept in natural order everywhere; the entropy\ncodecs zigzag or dezigzag the data as it is written or read.  The blocks\ncontain quantized coefficients everywhere outside the DCT/IDCT subsystems.\n(This latter decision may need to be revisited to support variable\nquantization a la JPEG Part 3.)\n\nNotice that the allocation unit is now a row of 8x8 blocks, corresponding to\neight rows of samples.  Otherwise the structure is much the same as for\nsamples, and for the same reasons.\n\nOn machines where malloc() can't handle a request bigger than 64Kb, this data\nstructure limits us to rows of less than 512 JBLOCKs, or a picture width of\n4000+ pixels.  This seems an acceptable restriction.\n\n\nOn 80x86 machines, the bottom-level pointer types (JSAMPROW and JBLOCKROW)\nmust be declared as \"far\" pointers, but the upper levels can be \"near\"\n(implying that the pointer lists are allocated in the DS segment).\nWe use a #define symbol FAR, which expands to the \"far\" keyword when\ncompiling on 80x86 machines and to nothing elsewhere.\n\n\n*** Suspendable processing ***\n\nIn some applications it is desirable to use the JPEG library as an\nincremental, memory-to-memory filter.  In this situation the data source or\ndestination may be a limited-size buffer, and we can't rely on being able to\nempty or refill the buffer at arbitrary times.  Instead the application would\nlike to have control return from the library at buffer overflow/underrun, and\nthen resume compression or decompression at a later time.\n\nThis scenario is supported for simple cases.  (For anything more complex, we\nrecommend that the application \"bite the bullet\" and develop real multitasking\ncapability.)  The libjpeg.txt file goes into more detail about the usage and\nlimitations of this capability; here we address the implications for library\nstructure.\n\nThe essence of the problem is that the entropy codec (coder or decoder) must\nbe prepared to stop at arbitrary times.  In turn, the controllers that call\nthe entropy codec must be able to stop before having produced or consumed all\nthe data that they normally would handle in one call.  That part is reasonably\nstraightforward: we make the controller call interfaces include \"progress\ncounters\" which indicate the number of data chunks successfully processed, and\nwe require callers to test the counter rather than just assume all of the data\nwas processed.\n\nRather than trying to restart at an arbitrary point, the current Huffman\ncodecs are designed to restart at the beginning of the current MCU after a\nsuspension due to buffer overflow/underrun.  At the start of each call, the\ncodec's internal state is loaded from permanent storage (in the JPEG object\nstructures) into local variables.  On successful completion of the MCU, the\npermanent state is updated.  (This copying is not very expensive, and may even\nlead to *improved* performance if the local variables can be registerized.)\nIf a suspension occurs, the codec simply returns without updating the state,\nthus effectively reverting to the start of the MCU.  Note that this implies\nleaving some data unprocessed in the source/destination buffer (ie, the\ncompressed partial MCU).  The data source/destination module interfaces are\nspecified so as to make this possible.  This also implies that the data buffer\nmust be large enough to hold a worst-case compressed MCU; a couple thousand\nbytes should be enough.\n\nIn a successive-approximation AC refinement scan, the progressive Huffman\ndecoder has to be able to undo assignments of newly nonzero coefficients if it\nsuspends before the MCU is complete, since decoding requires distinguishing\npreviously-zero and previously-nonzero coefficients.  This is a bit tedious\nbut probably won't have much effect on performance.  Other variants of Huffman\ndecoding need not worry about this, since they will just store the same values\nagain if forced to repeat the MCU.\n\nThis approach would probably not work for an arithmetic codec, since its\nmodifiable state is quite large and couldn't be copied cheaply.  Instead it\nwould have to suspend and resume exactly at the point of the buffer end.\n\nThe JPEG marker reader is designed to cope with suspension at an arbitrary\npoint.  It does so by backing up to the start of the marker parameter segment,\nso the data buffer must be big enough to hold the largest marker of interest.\nAgain, a couple KB should be adequate.  (A special \"skip\" convention is used\nto bypass COM and APPn markers, so these can be larger than the buffer size\nwithout causing problems; otherwise a 64K buffer would be needed in the worst\ncase.)\n\nThe JPEG marker writer currently does *not* cope with suspension.\nWe feel that this is not necessary; it is much easier simply to require\nthe application to ensure there is enough buffer space before starting.  (An\nempty 2K buffer is more than sufficient for the header markers; and ensuring\nthere are a dozen or two bytes available before calling jpeg_finish_compress()\nwill suffice for the trailer.)  This would not work for writing multi-scan\nJPEG files, but we simply do not intend to support that capability with\nsuspension.\n\n\n*** Memory manager services ***\n\nThe JPEG library's memory manager controls allocation and deallocation of\nmemory, and it manages large \"virtual\" data arrays on machines where the\noperating system does not provide virtual memory.  Note that the same\nmemory manager serves both compression and decompression operations.\n\nIn all cases, allocated objects are tied to a particular compression or\ndecompression master record, and they will be released when that master\nrecord is destroyed.\n\nThe memory manager does not provide explicit deallocation of objects.\nInstead, objects are created in \"pools\" of free storage, and a whole pool\ncan be freed at once.  This approach helps prevent storage-leak bugs, and\nit speeds up operations whenever malloc/free are slow (as they often are).\nThe pools can be regarded as lifetime identifiers for objects.  Two\npools/lifetimes are defined:\n  * JPOOL_PERMANENT\tlasts until master record is destroyed\n  * JPOOL_IMAGE\t\tlasts until done with image (JPEG datastream)\nPermanent lifetime is used for parameters and tables that should be carried\nacross from one datastream to another; this includes all application-visible\nparameters.  Image lifetime is used for everything else.  (A third lifetime,\nJPOOL_PASS = one processing pass, was originally planned.  However it was\ndropped as not being worthwhile.  The actual usage patterns are such that the\npeak memory usage would be about the same anyway; and having per-pass storage\nsubstantially complicates the virtual memory allocation rules --- see below.)\n\nThe memory manager deals with three kinds of object:\n1. \"Small\" objects.  Typically these require no more than 10K-20K total.\n2. \"Large\" objects.  These may require tens to hundreds of K depending on\n   image size.  Semantically they behave the same as small objects, but we\n   distinguish them for two reasons:\n     * On MS-DOS machines, large objects are referenced by FAR pointers,\n       small objects by NEAR pointers.\n     * Pool allocation heuristics may differ for large and small objects.\n   Note that individual \"large\" objects cannot exceed the size allowed by\n   type size_t, which may be 64K or less on some machines.\n3. \"Virtual\" objects.  These are large 2-D arrays of JSAMPLEs or JBLOCKs\n   (typically large enough for the entire image being processed).  The\n   memory manager provides stripwise access to these arrays.  On machines\n   without virtual memory, the rest of the array may be swapped out to a\n   temporary file.\n\n(Note: JSAMPARRAY and JBLOCKARRAY data structures are a combination of large\nobjects for the data proper and small objects for the row pointers.  For\nconvenience and speed, the memory manager provides single routines to create\nthese structures.  Similarly, virtual arrays include a small control block\nand a JSAMPARRAY or JBLOCKARRAY working buffer, all created with one call.)\n\nIn the present implementation, virtual arrays are only permitted to have image\nlifespan.  (Permanent lifespan would not be reasonable, and pass lifespan is\nnot very useful since a virtual array's raison d'etre is to store data for\nmultiple passes through the image.)  We also expect that only \"small\" objects\nwill be given permanent lifespan, though this restriction is not required by\nthe memory manager.\n\nIn a non-virtual-memory machine, some performance benefit can be gained by\nmaking the in-memory buffers for virtual arrays be as large as possible.\n(For small images, the buffers might fit entirely in memory, so blind\nswapping would be very wasteful.)  The memory manager will adjust the height\nof the buffers to fit within a prespecified maximum memory usage.  In order\nto do this in a reasonably optimal fashion, the manager needs to allocate all\nof the virtual arrays at once.  Therefore, there isn't a one-step allocation\nroutine for virtual arrays; instead, there is a \"request\" routine that simply\nallocates the control block, and a \"realize\" routine (called just once) that\ndetermines space allocation and creates all of the actual buffers.  The\nrealize routine must allow for space occupied by non-virtual large objects.\n(We don't bother to factor in the space needed for small objects, on the\ngrounds that it isn't worth the trouble.)\n\nTo support all this, we establish the following protocol for doing business\nwith the memory manager:\n  1. Modules must request virtual arrays (which may have only image lifespan)\n     during the initial setup phase, i.e., in their jinit_xxx routines.\n  2. All \"large\" objects (including JSAMPARRAYs and JBLOCKARRAYs) must also be\n     allocated during initial setup.\n  3. realize_virt_arrays will be called at the completion of initial setup.\n     The above conventions ensure that sufficient information is available\n     for it to choose a good size for virtual array buffers.\nSmall objects of any lifespan may be allocated at any time.  We expect that\nthe total space used for small objects will be small enough to be negligible\nin the realize_virt_arrays computation.\n\nIn a virtual-memory machine, we simply pretend that the available space is\ninfinite, thus causing realize_virt_arrays to decide that it can allocate all\nthe virtual arrays as full-size in-memory buffers.  The overhead of the\nvirtual-array access protocol is very small when no swapping occurs.\n\nA virtual array can be specified to be \"pre-zeroed\"; when this flag is set,\nnever-yet-written sections of the array are set to zero before being made\navailable to the caller.  If this flag is not set, never-written sections\nof the array contain garbage.  (This feature exists primarily because the\nequivalent logic would otherwise be needed in jdcoefct.c for progressive\nJPEG mode; we may as well make it available for possible other uses.)\n\nThe first write pass on a virtual array is required to occur in top-to-bottom\norder; read passes, as well as any write passes after the first one, may\naccess the array in any order.  This restriction exists partly to simplify\nthe virtual array control logic, and partly because some file systems may not\nsupport seeking beyond the current end-of-file in a temporary file.  The main\nimplication of this restriction is that rearrangement of rows (such as\nconverting top-to-bottom data order to bottom-to-top) must be handled while\nreading data out of the virtual array, not while putting it in.\n\n\n*** Memory manager internal structure ***\n\nTo isolate system dependencies as much as possible, we have broken the\nmemory manager into two parts.  There is a reasonably system-independent\n\"front end\" (jmemmgr.c) and a \"back end\" that contains only the code\nlikely to change across systems.  All of the memory management methods\noutlined above are implemented by the front end.  The back end provides\nthe following routines for use by the front end (none of these routines\nare known to the rest of the JPEG code):\n\njpeg_mem_init, jpeg_mem_term\tsystem-dependent initialization/shutdown\n\njpeg_get_small, jpeg_free_small\tinterface to malloc and free library routines\n\t\t\t\t(or their equivalents)\n\njpeg_get_large, jpeg_free_large\tinterface to FAR malloc/free in MSDOS machines;\n\t\t\t\telse usually the same as\n\t\t\t\tjpeg_get_small/jpeg_free_small\n\njpeg_mem_available\t\testimate available memory\n\njpeg_open_backing_store\t\tcreate a backing-store object\n\nread_backing_store,\t\tmanipulate a backing-store object\nwrite_backing_store,\nclose_backing_store\n\nOn some systems there will be more than one type of backing-store object\n(specifically, in MS-DOS a backing store file might be an area of extended\nmemory as well as a disk file).  jpeg_open_backing_store is responsible for\nchoosing how to implement a given object.  The read/write/close routines\nare method pointers in the structure that describes a given object; this\nlets them be different for different object types.\n\nIt may be necessary to ensure that backing store objects are explicitly\nreleased upon abnormal program termination.  For example, MS-DOS won't free\nextended memory by itself.  To support this, we will expect the main program\nor surrounding application to arrange to call self_destruct (typically via\njpeg_destroy) upon abnormal termination.  This may require a SIGINT signal\nhandler or equivalent.  We don't want to have the back end module install its\nown signal handler, because that would pre-empt the surrounding application's\nability to control signal handling.\n\nThe IJG distribution includes several memory manager back end implementations.\nUsually the same back end should be suitable for all applications on a given\nsystem, but it is possible for an application to supply its own back end at\nneed.\n\n\n*** Implications of DNL marker ***\n\nSome JPEG files may use a DNL marker to postpone definition of the image\nheight (this would be useful for a fax-like scanner's output, for instance).\nIn these files the SOF marker claims the image height is 0, and you only\nfind out the true image height at the end of the first scan.\n\nWe could read these files as follows:\n1. Upon seeing zero image height, replace it by 65535 (the maximum allowed).\n2. When the DNL is found, update the image height in the global image\n   descriptor.\nThis implies that control modules must avoid making copies of the image\nheight, and must re-test for termination after each MCU row.  This would\nbe easy enough to do.\n\nIn cases where image-size data structures are allocated, this approach will\nresult in very inefficient use of virtual memory or much-larger-than-necessary\ntemporary files.  This seems acceptable for something that probably won't be a\nmainstream usage.  People might have to forgo use of memory-hogging options\n(such as two-pass color quantization or noninterleaved JPEG files) if they\nwant efficient conversion of such files.  (One could improve efficiency by\ndemanding a user-supplied upper bound for the height, less than 65536; in most\ncases it could be much less.)\n\nThe standard also permits the SOF marker to overestimate the image height,\nwith a DNL to give the true, smaller height at the end of the first scan.\nThis would solve the space problems if the overestimate wasn't too great.\nHowever, it implies that you don't even know whether DNL will be used.\n\nThis leads to a couple of very serious objections:\n1. Testing for a DNL marker must occur in the inner loop of the decompressor's\n   Huffman decoder; this implies a speed penalty whether the feature is used\n   or not.\n2. There is no way to hide the last-minute change in image height from an\n   application using the decoder.  Thus *every* application using the IJG\n   library would suffer a complexity penalty whether it cared about DNL or\n   not.\nWe currently do not support DNL because of these problems.\n\nA different approach is to insist that DNL-using files be preprocessed by a\nseparate program that reads ahead to the DNL, then goes back and fixes the SOF\nmarker.  This is a much simpler solution and is probably far more efficient.\nEven if one wants piped input, buffering the first scan of the JPEG file needs\na lot smaller temp file than is implied by the maximum-height method.  For\nthis approach we'd simply treat DNL as a no-op in the decompressor (at most,\ncheck that it matches the SOF image height).\n\nWe will not worry about making the compressor capable of outputting DNL.\nSomething similar to the first scheme above could be applied if anyone ever\nwants to make that work.\n"
  },
  {
    "path": "ext/libjpeg-turbo/tjbench.c",
    "content": "/*\n * Copyright (C)2009-2014 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <ctype.h>\n#include <math.h>\n#include <errno.h>\n#include <cdjpeg.h>\n#include \"./bmp.h\"\n#include \"./tjutil.h\"\n#include \"./turbojpeg.h\"\n\n\n#define _throw(op, err) {  \\\n\tprintf(\"ERROR in line %d while %s:\\n%s\\n\", __LINE__, op, err);  \\\n  retval=-1;  goto bailout;}\n#define _throwunix(m) _throw(m, strerror(errno))\n#define _throwtj(m) _throw(m, tjGetErrorStr())\n#define _throwbmp(m) _throw(m, bmpgeterr())\n\nenum {YUVENCODE=1, YUVDECODE};\nint flags=TJFLAG_NOREALLOC, decomponly=0, yuv=0, quiet=0, dotile=0,\n\tpf=TJPF_BGR;\nchar *ext=\"ppm\";\nconst char *pixFormatStr[TJ_NUMPF]=\n{\n\t\"RGB\", \"BGR\", \"RGBX\", \"BGRX\", \"XBGR\", \"XRGB\", \"GRAY\"\n};\nconst char *subNameLong[TJ_NUMSAMP]=\n{\n\t\"4:4:4\", \"4:2:2\", \"4:2:0\", \"GRAY\", \"4:4:0\"\n};\nconst char *subName[NUMSUBOPT]={\"444\", \"422\", \"420\", \"GRAY\", \"440\"};\ntjscalingfactor *scalingfactors=NULL, sf={1, 1};  int nsf=0;\nint xformop=TJXOP_NONE, xformopt=0;\nint (*customFilter)(short *, tjregion, tjregion, int, int, tjtransform *);\ndouble benchtime=5.0;\n\n\nchar *sigfig(double val, int figs, char *buf, int len)\n{\n\tchar format[80];\n\tint digitsafterdecimal=figs-(int)ceil(log10(fabs(val)));\n\tif(digitsafterdecimal<1) snprintf(format, 80, \"%%.0f\");\n\telse snprintf(format, 80, \"%%.%df\", digitsafterdecimal);\n\tsnprintf(buf, len, format, val);\n\treturn buf;\n}\n\n\n/* Custom DCT filter which produces a negative of the image */\nint dummyDCTFilter(short *coeffs, tjregion arrayRegion, tjregion planeRegion,\n\tint componentIndex, int transformIndex, tjtransform *transform)\n{\n\tint i;\n\tfor(i=0; i<arrayRegion.w*arrayRegion.h; i++) coeffs[i]=-coeffs[i];\n\treturn 0;\n}\n\n\n/* Decompression test */\nint decomptest(unsigned char *srcbuf, unsigned char **jpegbuf,\n\tunsigned long *jpegsize, unsigned char *dstbuf, int w, int h,\n\tint subsamp, int jpegqual, char *filename, int tilew, int tileh)\n{\n\tchar tempstr[1024], sizestr[20]=\"\\0\", qualstr[6]=\"\\0\", *ptr;\n\tFILE *file=NULL;  tjhandle handle=NULL;\n\tint row, col, i, dstbufalloc=0, retval=0;\n\tdouble start, elapsed;\n\tint ps=tjPixelSize[pf];\n\tint yuvsize=tjBufSizeYUV(w, h, subsamp), bufsize;\n\tint scaledw=(yuv==YUVDECODE)? w : TJSCALED(w, sf);\n\tint scaledh=(yuv==YUVDECODE)? h : TJSCALED(h, sf);\n\tint pitch=scaledw*ps;\n\tint ntilesw=(w+tilew-1)/tilew, ntilesh=(h+tileh-1)/tileh;\n\tunsigned char *dstptr, *dstptr2;\n\n\tif(jpegqual>0)\n\t{\n\t\tsnprintf(qualstr, 6, \"_Q%d\", jpegqual);\n\t\tqualstr[5]=0;\n\t}\n\n\tif((handle=tjInitDecompress())==NULL)\n\t\t_throwtj(\"executing tjInitDecompress()\");\n\n\tbufsize=(yuv==YUVDECODE? yuvsize:pitch*scaledh);\n\tif(dstbuf==NULL)\n\t{\n\t\tif((dstbuf=(unsigned char *)malloc(bufsize)) == NULL)\n\t\t\t_throwunix(\"allocating image buffer\");\n\t\tdstbufalloc=1;\n\t}\n\t/* Set the destination buffer to gray so we know whether the decompressor\n\t   attempted to write to it */\n\tmemset(dstbuf, 127, bufsize);\n\n\t/* Execute once to preload cache */\n\tif(yuv==YUVDECODE)\n\t{\n\t\tif(tjDecompressToYUV(handle, jpegbuf[0], jpegsize[0], dstbuf, flags)==-1)\n\t\t\t_throwtj(\"executing tjDecompressToYUV()\");\n\t}\n\telse if(tjDecompress2(handle, jpegbuf[0], jpegsize[0], dstbuf, scaledw,\n\t\tpitch, scaledh, pf, flags)==-1)\n\t\t_throwtj(\"executing tjDecompress2()\");\n\n\t/* Benchmark */\n\tfor(i=0, start=gettime(); (elapsed=gettime()-start)<benchtime; i++)\n\t{\n\t\tint tile=0;\n\t\tif(yuv==YUVDECODE)\n\t\t{\n\t\t\tif(tjDecompressToYUV(handle, jpegbuf[0], jpegsize[0], dstbuf, flags)==-1)\n\t\t\t\t_throwtj(\"executing tjDecompressToYUV()\");\n\t\t}\n\t\telse for(row=0, dstptr=dstbuf; row<ntilesh; row++, dstptr+=pitch*tileh)\n\t\t{\n\t\t\tfor(col=0, dstptr2=dstptr; col<ntilesw; col++, tile++, dstptr2+=ps*tilew)\n\t\t\t{\n\t\t\t\tint width=dotile? min(tilew, w-col*tilew):scaledw;\n\t\t\t\tint height=dotile? min(tileh, h-row*tileh):scaledh;\n\t\t\t\tif(tjDecompress2(handle, jpegbuf[tile], jpegsize[tile], dstptr2, width,\n\t\t\t\t\tpitch, height, pf, flags)==-1)\n\t\t\t\t\t_throwtj(\"executing tjDecompress2()\");\n\t\t\t}\n\t\t}\n\t}\n\n\tif(tjDestroy(handle)==-1) _throwtj(\"executing tjDestroy()\");\n\thandle=NULL;\n\n\tif(quiet)\n\t{\n\t\tprintf(\"%s\\n\",\n\t\t\tsigfig((double)(w*h)/1000000.*(double)i/elapsed, 4, tempstr, 1024));\n\t}\n\telse\n\t{\n\t\tprintf(\"D--> Frame rate:           %f fps\\n\", (double)i/elapsed);\n\t\tprintf(\"     Dest. throughput:     %f Megapixels/sec\\n\",\n\t\t\t(double)(w*h)/1000000.*(double)i/elapsed);\n\t}\n\tif(yuv==YUVDECODE)\n\t{\n\t\tsnprintf(tempstr, 1024, \"%s_%s%s.yuv\", filename, subName[subsamp],\n\t\t\tqualstr);\n\t\tif((file=fopen(tempstr, \"wb\"))==NULL)\n\t\t\t_throwunix(\"opening YUV image for output\");\n\t\tif(fwrite(dstbuf, yuvsize, 1, file)!=1)\n\t\t\t_throwunix(\"writing YUV image\");\n\t\tfclose(file);  file=NULL;\n\t}\n\telse\n\t{\n\t\tif(sf.num!=1 || sf.denom!=1)\n\t\t\tsnprintf(sizestr, 20, \"%d_%d\", sf.num, sf.denom);\n\t\telse if(tilew!=w || tileh!=h)\n\t\t\tsnprintf(sizestr, 20, \"%dx%d\", tilew, tileh);\n\t\telse snprintf(sizestr, 20, \"full\");\n\t\tif(decomponly)\n\t\t\tsnprintf(tempstr, 1024, \"%s_%s.%s\", filename, sizestr, ext);\n\t\telse\n\t\t\tsnprintf(tempstr, 1024, \"%s_%s%s_%s.%s\", filename, subName[subsamp],\n\t\t\t\tqualstr, sizestr, ext);\n\t\tif(savebmp(tempstr, dstbuf, scaledw, scaledh, pf,\n\t\t\t(flags&TJFLAG_BOTTOMUP)!=0)==-1)\n\t\t\t_throwbmp(\"saving bitmap\");\n\t\tptr=strrchr(tempstr, '.');\n\t\tsnprintf(ptr, 1024-(ptr-tempstr), \"-err.%s\", ext);\n\t\tif(srcbuf && sf.num==1 && sf.denom==1)\n\t\t{\n\t\t\tif(!quiet) printf(\"Compression error written to %s.\\n\", tempstr);\n\t\t\tif(subsamp==TJ_GRAYSCALE)\n\t\t\t{\n\t\t\t\tint index, index2;\n\t\t\t\tfor(row=0, index=0; row<h; row++, index+=pitch)\n\t\t\t\t{\n\t\t\t\t\tfor(col=0, index2=index; col<w; col++, index2+=ps)\n\t\t\t\t\t{\n\t\t\t\t\t\tint rindex=index2+tjRedOffset[pf];\n\t\t\t\t\t\tint gindex=index2+tjGreenOffset[pf];\n\t\t\t\t\t\tint bindex=index2+tjBlueOffset[pf];\n\t\t\t\t\t\tint y=(int)((double)srcbuf[rindex]*0.299\n\t\t\t\t\t\t\t+ (double)srcbuf[gindex]*0.587\n\t\t\t\t\t\t\t+ (double)srcbuf[bindex]*0.114 + 0.5);\n\t\t\t\t\t\tif(y>255) y=255;  if(y<0) y=0;\n\t\t\t\t\t\tdstbuf[rindex]=abs(dstbuf[rindex]-y);\n\t\t\t\t\t\tdstbuf[gindex]=abs(dstbuf[gindex]-y);\n\t\t\t\t\t\tdstbuf[bindex]=abs(dstbuf[bindex]-y);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\tfor(row=0; row<h; row++)\n\t\t\t\t\tfor(col=0; col<w*ps; col++)\n\t\t\t\t\t\tdstbuf[pitch*row+col]\n\t\t\t\t\t\t\t=abs(dstbuf[pitch*row+col]-srcbuf[pitch*row+col]);\n\t\t\t}\n\t\t\tif(savebmp(tempstr, dstbuf, w, h, pf,\n\t\t\t\t(flags&TJFLAG_BOTTOMUP)!=0)==-1)\n\t\t\t\t_throwbmp(\"saving bitmap\");\n\t\t}\n\t}\n\n\tbailout:\n\tif(file) {fclose(file);  file=NULL;}\n\tif(handle) {tjDestroy(handle);  handle=NULL;}\n\tif(dstbuf && dstbufalloc) {free(dstbuf);  dstbuf=NULL;}\n\treturn retval;\n}\n\n\nvoid dotestyuv(unsigned char *srcbuf, int w, int h, int subsamp,\n\tchar *filename)\n{\n\tchar tempstr[1024], tempstr2[80];\n\tFILE *file=NULL;  tjhandle handle=NULL;\n\tunsigned char *dstbuf=NULL;\n\tdouble start, elapsed;\n\tint i, retval=0, ps=tjPixelSize[pf];\n\tint yuvsize=0;\n\n\tyuvsize=tjBufSizeYUV(w, h, subsamp);\n\tif((dstbuf=(unsigned char *)malloc(yuvsize)) == NULL)\n\t\t_throwunix(\"allocating image buffer\");\n\n\tif(!quiet)\n\t\tprintf(\">>>>>  %s (%s) <--> YUV %s  <<<<<\\n\", pixFormatStr[pf],\n\t\t\t(flags&TJFLAG_BOTTOMUP)? \"Bottom-up\":\"Top-down\", subNameLong[subsamp]);\n\n\tif(quiet==1)\n\t\tprintf(\"%s\\t%s\\t%s\\tN/A\\t\", pixFormatStr[pf],\n\t\t\t(flags&TJFLAG_BOTTOMUP)? \"BU\":\"TD\", subNameLong[subsamp]);\n\n\tif((handle=tjInitCompress())==NULL)\n\t\t_throwtj(\"executing tjInitCompress()\");\n\n\t/* Execute once to preload cache */\n\tif(tjEncodeYUV2(handle, srcbuf, w, 0, h, pf, dstbuf, subsamp, flags)==-1)\n\t\t_throwtj(\"executing tjEncodeYUV2()\");\n\n\t/* Benchmark */\n\tfor(i=0, start=gettime(); (elapsed=gettime()-start)<benchtime; i++)\n\t{\n\t\tif(tjEncodeYUV2(handle, srcbuf, w, 0, h, pf, dstbuf, subsamp, flags)==-1)\n\t\t\t_throwtj(\"executing tjEncodeYUV2()\");\n\t}\n\n\tif(tjDestroy(handle)==-1) _throwtj(\"executing tjDestroy()\");\n\thandle=NULL;\n\n\tif(quiet==1) printf(\"%-4d  %-4d\\t\", w, h);\n\tif(quiet)\n\t{\n\t\tprintf(\"%s%c%s%c\",\n\t\t\tsigfig((double)(w*h)/1000000.*(double)i/elapsed, 4, tempstr, 1024),\n\t\t\tquiet==2? '\\n':'\\t',\n\t\t\tsigfig((double)(w*h*ps)/(double)yuvsize, 4, tempstr2, 80),\n\t\t\tquiet==2? '\\n':'\\t');\n\t}\n\telse\n\t{\n\t\tprintf(\"\\n%s size: %d x %d\\n\", \"Image\", w, h);\n\t\tprintf(\"C--> Frame rate:           %f fps\\n\", (double)i/elapsed);\n\t\tprintf(\"     Output image size:    %d bytes\\n\", yuvsize);\n\t\tprintf(\"     Compression ratio:    %f:1\\n\",\n\t\t\t(double)(w*h*ps)/(double)yuvsize);\n\t\tprintf(\"     Source throughput:    %f Megapixels/sec\\n\",\n\t\t\t(double)(w*h)/1000000.*(double)i/elapsed);\n\t\tprintf(\"     Output bit stream:    %f Megabits/sec\\n\",\n\t\t\t(double)yuvsize*8./1000000.*(double)i/elapsed);\n\t}\n\tsnprintf(tempstr, 1024, \"%s_%s.yuv\", filename, subName[subsamp]);\n\tif((file=fopen(tempstr, \"wb\"))==NULL)\n\t\t_throwunix(\"opening reference image\");\n\tif(fwrite(dstbuf, yuvsize, 1, file)!=1)\n\t\t_throwunix(\"writing reference image\");\n\tfclose(file);  file=NULL;\n\tif(!quiet) printf(\"Reference image written to %s\\n\", tempstr);\n\n\tbailout:\n\tif(file) {fclose(file);  file=NULL;}\n\tif(dstbuf) {free(dstbuf);  dstbuf=NULL;}\n\tif(handle) {tjDestroy(handle);  handle=NULL;}\n\treturn;\n}\n\n\nvoid dotest(unsigned char *srcbuf, int w, int h, int subsamp, int jpegqual,\n\tchar *filename)\n{\n\tchar tempstr[1024], tempstr2[80];\n\tFILE *file=NULL;  tjhandle handle=NULL;\n\tunsigned char **jpegbuf=NULL, *tmpbuf=NULL, *srcptr, *srcptr2;\n\tdouble start, elapsed;\n\tint totaljpegsize=0, row, col, i, tilew=w, tileh=h, retval=0;\n\tunsigned long *jpegsize=NULL;\n\tint ps=tjPixelSize[pf], ntilesw=1, ntilesh=1, pitch=w*ps;\n\n\tif(yuv==YUVENCODE) {dotestyuv(srcbuf, w, h, subsamp, filename);  return;}\n\n\tif((tmpbuf=(unsigned char *)malloc(pitch*h)) == NULL)\n\t\t_throwunix(\"allocating temporary image buffer\");\n\n\tif(!quiet)\n\t\tprintf(\">>>>>  %s (%s) <--> JPEG %s Q%d  <<<<<\\n\", pixFormatStr[pf],\n\t\t\t(flags&TJFLAG_BOTTOMUP)? \"Bottom-up\":\"Top-down\", subNameLong[subsamp],\n\t\t\tjpegqual);\n\n\tfor(tilew=dotile? 8:w, tileh=dotile? 8:h; ; tilew*=2, tileh*=2)\n\t{\n\t\tif(tilew>w) tilew=w;  if(tileh>h) tileh=h;\n\t\tntilesw=(w+tilew-1)/tilew;  ntilesh=(h+tileh-1)/tileh;\n\n\t\tif((jpegbuf=(unsigned char **)malloc(sizeof(unsigned char *)\n\t\t\t*ntilesw*ntilesh))==NULL)\n\t\t\t_throwunix(\"allocating JPEG tile array\");\n\t\tmemset(jpegbuf, 0, sizeof(unsigned char *)*ntilesw*ntilesh);\n\t\tif((jpegsize=(unsigned long *)malloc(sizeof(unsigned long)\n\t\t\t*ntilesw*ntilesh))==NULL)\n\t\t\t_throwunix(\"allocating JPEG size array\");\n\t\tmemset(jpegsize, 0, sizeof(unsigned long)*ntilesw*ntilesh);\n\n\t\tif((flags&TJFLAG_NOREALLOC)!=0)\n\t\t\tfor(i=0; i<ntilesw*ntilesh; i++)\n\t\t\t{\n\t\t\t\tif((jpegbuf[i]=(unsigned char *)malloc(tjBufSize(tilew, tileh,\n\t\t\t\t\tsubsamp)))==NULL)\n\t\t\t\t\t_throwunix(\"allocating JPEG tiles\");\n\t\t\t}\n\n\t\t/* Compression test */\n\t\tif(quiet==1)\n\t\t\tprintf(\"%s\\t%s\\t%s\\t%d\\t\", pixFormatStr[pf],\n\t\t\t\t(flags&TJFLAG_BOTTOMUP)? \"BU\":\"TD\", subNameLong[subsamp], jpegqual);\n\t\tfor(i=0; i<h; i++)\n\t\t\tmemcpy(&tmpbuf[pitch*i], &srcbuf[w*ps*i], w*ps);\n\t\tif((handle=tjInitCompress())==NULL)\n\t\t\t_throwtj(\"executing tjInitCompress()\");\n\n\t\t/* Execute once to preload cache */\n\t\tif(tjCompress2(handle, srcbuf, tilew, pitch, tileh, pf, &jpegbuf[0],\n\t\t\t&jpegsize[0], subsamp, jpegqual, flags)==-1)\n\t\t\t_throwtj(\"executing tjCompress2()\");\n\n\t\t/* Benchmark */\n\t\tfor(i=0, start=gettime(); (elapsed=gettime()-start)<benchtime; i++)\n\t\t{\n\t\t\tint tile=0;\n\t\t\ttotaljpegsize=0;\n\t\t\tfor(row=0, srcptr=srcbuf; row<ntilesh; row++, srcptr+=pitch*tileh)\n\t\t\t{\n\t\t\t\tfor(col=0, srcptr2=srcptr; col<ntilesw; col++, tile++,\n\t\t\t\t\tsrcptr2+=ps*tilew)\n\t\t\t\t{\n\t\t\t\t\tint width=min(tilew, w-col*tilew);\n\t\t\t\t\tint height=min(tileh, h-row*tileh);\n\t\t\t\t\tif(tjCompress2(handle, srcptr2, width, pitch, height, pf,\n\t\t\t\t\t\t&jpegbuf[tile], &jpegsize[tile], subsamp, jpegqual, flags)==-1)\n\t\t\t\t\t\t_throwtj(\"executing tjCompress()2\");\n\t\t\t\t\ttotaljpegsize+=jpegsize[tile];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(tjDestroy(handle)==-1) _throwtj(\"executing tjDestroy()\");\n\t\thandle=NULL;\n\n\t\tif(quiet==1) printf(\"%-4d  %-4d\\t\", tilew, tileh);\n\t\tif(quiet)\n\t\t{\n\t\t\tprintf(\"%s%c%s%c\",\n\t\t\t\tsigfig((double)(w*h)/1000000.*(double)i/elapsed, 4, tempstr, 1024),\n\t\t\t\tquiet==2? '\\n':'\\t',\n\t\t\t\tsigfig((double)(w*h*ps)/(double)totaljpegsize, 4, tempstr2, 80),\n\t\t\t\tquiet==2? '\\n':'\\t');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprintf(\"\\n%s size: %d x %d\\n\", dotile? \"Tile\":\"Image\", tilew,\n\t\t\t\ttileh);\n\t\t\tprintf(\"C--> Frame rate:           %f fps\\n\", (double)i/elapsed);\n\t\t\tprintf(\"     Output image size:    %d bytes\\n\", totaljpegsize);\n\t\t\tprintf(\"     Compression ratio:    %f:1\\n\",\n\t\t\t\t(double)(w*h*ps)/(double)totaljpegsize);\n\t\t\tprintf(\"     Source throughput:    %f Megapixels/sec\\n\",\n\t\t\t\t(double)(w*h)/1000000.*(double)i/elapsed);\n\t\t\tprintf(\"     Output bit stream:    %f Megabits/sec\\n\",\n\t\t\t\t(double)totaljpegsize*8./1000000.*(double)i/elapsed);\n\t\t}\n\t\tif(tilew==w && tileh==h)\n\t\t{\n\t\t\tsnprintf(tempstr, 1024, \"%s_%s_Q%d.jpg\", filename, subName[subsamp],\n\t\t\t\tjpegqual);\n\t\t\tif((file=fopen(tempstr, \"wb\"))==NULL)\n\t\t\t\t_throwunix(\"opening reference image\");\n\t\t\tif(fwrite(jpegbuf[0], jpegsize[0], 1, file)!=1)\n\t\t\t\t_throwunix(\"writing reference image\");\n\t\t\tfclose(file);  file=NULL;\n\t\t\tif(!quiet) printf(\"Reference image written to %s\\n\", tempstr);\n\t\t}\n\n\t\t/* Decompression test */\n\t\tif(decomptest(srcbuf, jpegbuf, jpegsize, tmpbuf, w, h, subsamp, jpegqual,\n\t\t\tfilename, tilew, tileh)==-1)\n\t\t\tgoto bailout;\n\n\t\tfor(i=0; i<ntilesw*ntilesh; i++)\n\t\t{\n\t\t\tif(jpegbuf[i]) free(jpegbuf[i]);  jpegbuf[i]=NULL;\n\t\t}\n\t\tfree(jpegbuf);  jpegbuf=NULL;\n\t\tfree(jpegsize);  jpegsize=NULL;\n\n\t\tif(tilew==w && tileh==h) break;\n\t}\n\n\tbailout:\n\tif(file) {fclose(file);  file=NULL;}\n\tif(jpegbuf)\n\t{\n\t\tfor(i=0; i<ntilesw*ntilesh; i++)\n\t\t{\n\t\t\tif(jpegbuf[i]) free(jpegbuf[i]);  jpegbuf[i]=NULL;\n\t\t}\n\t\tfree(jpegbuf);  jpegbuf=NULL;\n\t}\n\tif(jpegsize) {free(jpegsize);  jpegsize=NULL;}\n\tif(tmpbuf) {free(tmpbuf);  tmpbuf=NULL;}\n\tif(handle) {tjDestroy(handle);  handle=NULL;}\n\treturn;\n}\n\n\nvoid dodecomptest(char *filename)\n{\n\tFILE *file=NULL;  tjhandle handle=NULL;\n\tunsigned char **jpegbuf=NULL, *srcbuf=NULL;\n\tunsigned long *jpegsize=NULL, srcsize, totaljpegsize;\n\ttjtransform *t=NULL;\n\tint w=0, h=0, subsamp=-1, _w, _h, _tilew, _tileh,\n\t\t_ntilesw, _ntilesh, _subsamp;\n\tchar *temp=NULL, tempstr[80], tempstr2[80];\n\tint row, col, i, tilew, tileh, ntilesw=1, ntilesh=1, retval=0;\n\tdouble start, elapsed;\n\tint ps=tjPixelSize[pf], tile;\n\n\tif((file=fopen(filename, \"rb\"))==NULL)\n\t\t_throwunix(\"opening file\");\n\tif(fseek(file, 0, SEEK_END)<0 || (srcsize=ftell(file))==(unsigned long)-1)\n\t\t_throwunix(\"determining file size\");\n\tif((srcbuf=(unsigned char *)malloc(srcsize))==NULL)\n\t\t_throwunix(\"allocating memory\");\n\tif(fseek(file, 0, SEEK_SET)<0)\n\t\t_throwunix(\"setting file position\");\n\tif(fread(srcbuf, srcsize, 1, file)<1)\n\t\t_throwunix(\"reading JPEG data\");\n\tfclose(file);  file=NULL;\n\n\ttemp=strrchr(filename, '.');\n\tif(temp!=NULL) *temp='\\0';\n\n\tif((handle=tjInitTransform())==NULL)\n\t\t_throwtj(\"executing tjInitTransform()\");\n\tif(tjDecompressHeader2(handle, srcbuf, srcsize, &w, &h, &subsamp)==-1)\n\t\t_throwtj(\"executing tjDecompressHeader2()\");\n\n\tif(quiet==1)\n\t{\n\t\tprintf(\"All performance values in Mpixels/sec\\n\\n\");\n\t\tprintf(\"Bitmap\\tBitmap\\tJPEG\\t%s %s \\tXform\\tComp\\tDecomp\\n\",\n\t\t\tdotile? \"Tile \":\"Image\", dotile? \"Tile \":\"Image\");\n\t\tprintf(\"Format\\tOrder\\tSubsamp\\tWidth Height\\tPerf \\tRatio\\tPerf\\n\\n\");\n\t}\n\telse if(!quiet)\n\t{\n\t\tprintf(\">>>>>  JPEG %s --> %s (%s)  <<<<<\\n\", subNameLong[subsamp],\n\t\t\tpixFormatStr[pf], (flags&TJFLAG_BOTTOMUP)? \"Bottom-up\":\"Top-down\");\n\t}\n\n\tfor(tilew=dotile? 16:w, tileh=dotile? 16:h; ; tilew*=2, tileh*=2)\n\t{\n\t\tif(tilew>w) tilew=w;  if(tileh>h) tileh=h;\n\t\tntilesw=(w+tilew-1)/tilew;  ntilesh=(h+tileh-1)/tileh;\n\n\t\tif((jpegbuf=(unsigned char **)malloc(sizeof(unsigned char *)\n\t\t\t*ntilesw*ntilesh))==NULL)\n\t\t\t_throwunix(\"allocating JPEG tile array\");\n\t\tmemset(jpegbuf, 0, sizeof(unsigned char *)*ntilesw*ntilesh);\n\t\tif((jpegsize=(unsigned long *)malloc(sizeof(unsigned long)\n\t\t\t*ntilesw*ntilesh))==NULL)\n\t\t\t_throwunix(\"allocating JPEG size array\");\n\t\tmemset(jpegsize, 0, sizeof(unsigned long)*ntilesw*ntilesh);\n\n\t\tif((flags&TJFLAG_NOREALLOC)!=0 || !dotile)\n\t\t\tfor(i=0; i<ntilesw*ntilesh; i++)\n\t\t\t{\n\t\t\t\tif((jpegbuf[i]=(unsigned char *)malloc(tjBufSize(tilew, tileh,\n\t\t\t\t\tsubsamp)))==NULL)\n\t\t\t\t\t_throwunix(\"allocating JPEG tiles\");\n\t\t\t}\n\n\t\t_w=w;  _h=h;  _tilew=tilew;  _tileh=tileh;\n\t\tif(!quiet)\n\t\t{\n\t\t\tprintf(\"\\n%s size: %d x %d\", dotile? \"Tile\":\"Image\", _tilew,\n\t\t\t\t_tileh);\n\t\t\tif(sf.num!=1 || sf.denom!=1)\n\t\t\t\tprintf(\" --> %d x %d\", TJSCALED(_w, sf), TJSCALED(_h, sf));\n\t\t\tprintf(\"\\n\");\n\t\t}\n\t\telse if(quiet==1)\n\t\t{\n\t\t\tprintf(\"%s\\t%s\\t%s\\t\", pixFormatStr[pf],\n\t\t\t\t(flags&TJFLAG_BOTTOMUP)? \"BU\":\"TD\", subNameLong[subsamp]);\n\t\t\tprintf(\"%-4d  %-4d\\t\", tilew, tileh);\n\t\t}\n\n\t\t_subsamp=subsamp;\n\t\tif(dotile || xformop!=TJXOP_NONE || xformopt!=0 || customFilter)\n\t\t{\n\t\t\tif((t=(tjtransform *)malloc(sizeof(tjtransform)*ntilesw*ntilesh))\n\t\t\t\t==NULL)\n\t\t\t\t_throwunix(\"allocating image transform array\");\n\n\t\t\tif(xformop==TJXOP_TRANSPOSE || xformop==TJXOP_TRANSVERSE\n\t\t\t\t|| xformop==TJXOP_ROT90 || xformop==TJXOP_ROT270)\n\t\t\t{\n\t\t\t\t_w=h;  _h=w;  _tilew=tileh;  _tileh=tilew;\n\t\t\t}\n\n\t\t\tif(xformopt&TJXOPT_GRAY) _subsamp=TJ_GRAYSCALE;\n\t\t\tif(xformop==TJXOP_HFLIP || xformop==TJXOP_ROT180)\n\t\t\t\t_w=_w-(_w%tjMCUWidth[_subsamp]);\n\t\t\tif(xformop==TJXOP_VFLIP || xformop==TJXOP_ROT180)\n\t\t\t\t_h=_h-(_h%tjMCUHeight[_subsamp]);\n\t\t\tif(xformop==TJXOP_TRANSVERSE || xformop==TJXOP_ROT90)\n\t\t\t\t_w=_w-(_w%tjMCUHeight[_subsamp]);\n\t\t\tif(xformop==TJXOP_TRANSVERSE || xformop==TJXOP_ROT270)\n\t\t\t\t_h=_h-(_h%tjMCUWidth[_subsamp]);\n\t\t\t_ntilesw=(_w+_tilew-1)/_tilew;\n\t\t\t_ntilesh=(_h+_tileh-1)/_tileh;\n\n\t\t\tfor(row=0, tile=0; row<_ntilesh; row++)\n\t\t\t{\n\t\t\t\tfor(col=0; col<_ntilesw; col++, tile++)\n\t\t\t\t{\n\t\t\t\t\tt[tile].r.w=min(_tilew, _w-col*_tilew);\n\t\t\t\t\tt[tile].r.h=min(_tileh, _h-row*_tileh);\n\t\t\t\t\tt[tile].r.x=col*_tilew;\n\t\t\t\t\tt[tile].r.y=row*_tileh;\n\t\t\t\t\tt[tile].op=xformop;\n\t\t\t\t\tt[tile].options=xformopt|TJXOPT_TRIM;\n\t\t\t\t\tt[tile].customFilter=customFilter;\n\t\t\t\t\tif(t[tile].options&TJXOPT_NOOUTPUT && jpegbuf[tile])\n\t\t\t\t\t{\n\t\t\t\t\t\tfree(jpegbuf[tile]);  jpegbuf[tile]=NULL;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstart=gettime();\n\t\t\tif(tjTransform(handle, srcbuf, srcsize, _ntilesw*_ntilesh, jpegbuf,\n\t\t\t\tjpegsize, t, flags)==-1)\n\t\t\t\t_throwtj(\"executing tjTransform()\");\n\t\t\telapsed=gettime()-start;\n\n\t\t\tfree(t);  t=NULL;\n\n\t\t\tfor(tile=0, totaljpegsize=0; tile<_ntilesw*_ntilesh; tile++)\n\t\t\t\ttotaljpegsize+=jpegsize[tile];\n\n\t\t\tif(quiet)\n\t\t\t{\n\t\t\t\tprintf(\"%s%c%s%c\",\n\t\t\t\t\tsigfig((double)(w*h)/1000000./elapsed, 4, tempstr, 80),\n\t\t\t\t\tquiet==2? '\\n':'\\t',\n\t\t\t\t\tsigfig((double)(w*h*ps)/(double)totaljpegsize, 4, tempstr2, 80),\n\t\t\t\t\tquiet==2? '\\n':'\\t');\n\t\t\t}\n\t\t\telse if(!quiet)\n\t\t\t{\n\t\t\t\tprintf(\"X--> Frame rate:           %f fps\\n\", 1.0/elapsed);\n\t\t\t\tprintf(\"     Output image size:    %lu bytes\\n\", totaljpegsize);\n\t\t\t\tprintf(\"     Compression ratio:    %f:1\\n\",\n\t\t\t\t\t(double)(w*h*ps)/(double)totaljpegsize);\n\t\t\t\tprintf(\"     Source throughput:    %f Megapixels/sec\\n\",\n\t\t\t\t\t(double)(w*h)/1000000./elapsed);\n\t\t\t\tprintf(\"     Output bit stream:    %f Megabits/sec\\n\",\n\t\t\t\t\t(double)totaljpegsize*8./1000000./elapsed);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(quiet==1) printf(\"N/A\\tN/A\\t\");\n\t\t\tjpegsize[0]=srcsize;\n\t\t\tmemcpy(jpegbuf[0], srcbuf, srcsize);\n\t\t}\n\n\t\tif(w==tilew) _tilew=_w;\n\t\tif(h==tileh) _tileh=_h;\n\t\tif(!(xformopt&TJXOPT_NOOUTPUT))\n\t\t{\n\t\t\tif(decomptest(NULL, jpegbuf, jpegsize, NULL, _w, _h, _subsamp, 0,\n\t\t\t\tfilename, _tilew, _tileh)==-1)\n\t\t\t\tgoto bailout;\n\t\t}\n\t\telse if(quiet==1) printf(\"N/A\\n\");\n\n\t\tfor(i=0; i<ntilesw*ntilesh; i++)\n\t\t{\n\t\t\tfree(jpegbuf[i]);  jpegbuf[i]=NULL;\n\t\t}\n\t\tfree(jpegbuf);  jpegbuf=NULL;\n\t\tif(jpegsize) {free(jpegsize);  jpegsize=NULL;}\n\n\t\tif(tilew==w && tileh==h) break;\n\t}\n\n\tbailout:\n\tif(file) {fclose(file);  file=NULL;}\n\tif(jpegbuf)\n\t{\n\t\tfor(i=0; i<ntilesw*ntilesh; i++)\n\t\t{\n\t\t\tif(jpegbuf[i]) free(jpegbuf[i]);  jpegbuf[i]=NULL;\n\t\t}\n\t\tfree(jpegbuf);  jpegbuf=NULL;\n\t}\n\tif(jpegsize) {free(jpegsize);  jpegsize=NULL;}\n\tif(srcbuf) {free(srcbuf);  srcbuf=NULL;}\n\tif(t) {free(t);  t=NULL;}\n\tif(handle) {tjDestroy(handle);  handle=NULL;}\n\treturn;\n}\n\n\nvoid usage(char *progname)\n{\n\tint i;\n\tprintf(\"USAGE: %s\\n\", progname);\n\tprintf(\"       <Inputfile (BMP|PPM)> <Quality> [options]\\n\\n\");\n\tprintf(\"       %s\\n\", progname);\n\tprintf(\"       <Inputfile (JPG)> [options]\\n\\n\");\n\tprintf(\"Options:\\n\\n\");\n\tprintf(\"-alloc = Dynamically allocate JPEG image buffers\\n\");\n\tprintf(\"-bmp = Generate output images in Windows Bitmap format (default=PPM)\\n\");\n\tprintf(\"-bottomup = Test bottom-up compression/decompression\\n\");\n\tprintf(\"-tile = Test performance of the codec when the image is encoded as separate\\n\");\n\tprintf(\"     tiles of varying sizes.\\n\");\n\tprintf(\"-forcemmx, -forcesse, -forcesse2, -forcesse3 =\\n\");\n\tprintf(\"     Force MMX, SSE, SSE2, or SSE3 code paths in the underlying codec\\n\");\n\tprintf(\"-rgb, -bgr, -rgbx, -bgrx, -xbgr, -xrgb =\\n\");\n\tprintf(\"     Test the specified color conversion path in the codec (default: BGR)\\n\");\n\tprintf(\"-fastupsample = Use the fastest chrominance upsampling algorithm available in\\n\");\n\tprintf(\"     the underlying codec\\n\");\n\tprintf(\"-fastdct = Use the fastest DCT/IDCT algorithms available in the underlying\\n\");\n\tprintf(\"     codec\\n\");\n\tprintf(\"-accuratedct = Use the most accurate DCT/IDCT algorithms available in the\\n\");\n\tprintf(\"     underlying codec\\n\");\n\tprintf(\"-subsamp <s> = When testing JPEG compression, this option specifies the level\\n\");\n\tprintf(\"     of chrominance subsampling to use (<s> = 444, 422, 440, 420, or GRAY).\\n\");\n\tprintf(\"     The default is to test Grayscale, 4:2:0, 4:2:2, and 4:4:4 in sequence.\\n\");\n\tprintf(\"-quiet = Output results in tabular rather than verbose format\\n\");\n\tprintf(\"-yuvencode = Encode RGB input as planar YUV rather than compressing as JPEG\\n\");\n\tprintf(\"-yuvdecode = Decode JPEG image to planar YUV rather than RGB\\n\");\n\tprintf(\"-scale M/N = scale down the width/height of the decompressed JPEG image by a\\n\");\n\tprintf(\"     factor of M/N (M/N = \");\n\tfor(i=0; i<nsf; i++)\n\t{\n\t\tprintf(\"%d/%d\", scalingfactors[i].num, scalingfactors[i].denom);\n\t\tif(nsf==2 && i!=nsf-1) printf(\" or \");\n\t\telse if(nsf>2)\n\t\t{\n\t\t\tif(i!=nsf-1) printf(\", \");\n\t\t\tif(i==nsf-2) printf(\"or \");\n\t\t}\n\t\tif(i%8==0 && i!=0) printf(\"\\n     \");\n\t}\n\tprintf(\")\\n\");\n\tprintf(\"-hflip, -vflip, -transpose, -transverse, -rot90, -rot180, -rot270 =\\n\");\n\tprintf(\"     Perform the corresponding lossless transform prior to\\n\");\n\tprintf(\"     decompression (these options are mutually exclusive)\\n\");\n\tprintf(\"-grayscale = Perform lossless grayscale conversion prior to decompression\\n\");\n\tprintf(\"     test (can be combined with the other transforms above)\\n\");\n\tprintf(\"-benchtime <t> = Run each benchmark for at least <t> seconds (default = 5.0)\\n\\n\");\n\tprintf(\"NOTE:  If the quality is specified as a range (e.g. 90-100), a separate\\n\");\n\tprintf(\"test will be performed for all quality values in the range.\\n\\n\");\n\texit(1);\n}\n\n\nint main(int argc, char *argv[])\n{\n\tunsigned char *srcbuf=NULL;  int w, h, i, j;\n\tint minqual=-1, maxqual=-1;  char *temp;\n\tint minarg=2, retval=0, subsamp=-1;\n\n\tif((scalingfactors=tjGetScalingFactors(&nsf))==NULL || nsf==0)\n\t\t_throwtj(\"executing tjGetScalingFactors()\");\n\n\tif(argc<minarg) usage(argv[0]);\n\n\ttemp=strrchr(argv[1], '.');\n\tif(temp!=NULL)\n\t{\n\t\tif(!strcasecmp(temp, \".bmp\")) ext=\"bmp\";\n\t\tif(!strcasecmp(temp, \".jpg\") || !strcasecmp(temp, \".jpeg\")) decomponly=1;\n\t}\n\n\tprintf(\"\\n\");\n\n\tif(argc>minarg)\n\t{\n\t\tfor(i=minarg; i<argc; i++)\n\t\t{\n\t\t\tif(!strcasecmp(argv[i], \"-yuvencode\"))\n\t\t\t{\n\t\t\t\tprintf(\"Testing YUV planar encoding\\n\\n\");\n\t\t\t\tyuv=YUVENCODE;  maxqual=minqual=100;\n\t\t\t}\n\t\t\tif(!strcasecmp(argv[i], \"-yuvdecode\"))\n\t\t\t{\n\t\t\t\tprintf(\"Testing YUV planar decoding\\n\\n\");\n\t\t\t\tyuv=YUVDECODE;\n\t\t\t}\n\t\t}\n\t}\n\n\tif(!decomponly && yuv!=YUVENCODE)\n\t{\n\t\tminarg=3;\n\t\tif(argc<minarg) usage(argv[0]);\n\t\tif((minqual=atoi(argv[2]))<1 || minqual>100)\n\t\t{\n\t\t\tputs(\"ERROR: Quality must be between 1 and 100.\");\n\t\t\texit(1);\n\t\t}\n\t\tif((temp=strchr(argv[2], '-'))!=NULL && strlen(temp)>1\n\t\t\t&& sscanf(&temp[1], \"%d\", &maxqual)==1 && maxqual>minqual && maxqual>=1\n\t\t\t&& maxqual<=100) {}\n\t\telse maxqual=minqual;\n\t}\n\n\tif(argc>minarg)\n\t{\n\t\tfor(i=minarg; i<argc; i++)\n\t\t{\n\t\t\tif(!strcasecmp(argv[i], \"-tile\"))\n\t\t\t{\n\t\t\t\tdotile=1;  xformopt|=TJXOPT_CROP;\n\t\t\t}\n\t\t\tif(!strcasecmp(argv[i], \"-forcesse3\"))\n\t\t\t{\n\t\t\t\tprintf(\"Forcing SSE3 code\\n\\n\");\n\t\t\t\tflags|=TJFLAG_FORCESSE3;\n\t\t\t}\n\t\t\tif(!strcasecmp(argv[i], \"-forcesse2\"))\n\t\t\t{\n\t\t\t\tprintf(\"Forcing SSE2 code\\n\\n\");\n\t\t\t\tflags|=TJFLAG_FORCESSE2;\n\t\t\t}\n\t\t\tif(!strcasecmp(argv[i], \"-forcesse\"))\n\t\t\t{\n\t\t\t\tprintf(\"Forcing SSE code\\n\\n\");\n\t\t\t\tflags|=TJFLAG_FORCESSE;\n\t\t\t}\n\t\t\tif(!strcasecmp(argv[i], \"-forcemmx\"))\n\t\t\t{\n\t\t\t\tprintf(\"Forcing MMX code\\n\\n\");\n\t\t\t\tflags|=TJFLAG_FORCEMMX;\n\t\t\t}\n\t\t\tif(!strcasecmp(argv[i], \"-fastupsample\"))\n\t\t\t{\n\t\t\t\tprintf(\"Using fast upsampling code\\n\\n\");\n\t\t\t\tflags|=TJFLAG_FASTUPSAMPLE;\n\t\t\t}\n\t\t\tif(!strcasecmp(argv[i], \"-fastdct\"))\n\t\t\t{\n\t\t\t\tprintf(\"Using fastest DCT/IDCT algorithm\\n\\n\");\n\t\t\t\tflags|=TJFLAG_FASTDCT;\n\t\t\t}\n\t\t\tif(!strcasecmp(argv[i], \"-accuratedct\"))\n\t\t\t{\n\t\t\t\tprintf(\"Using most accurate DCT/IDCT algorithm\\n\\n\");\n\t\t\t\tflags|=TJFLAG_ACCURATEDCT;\n\t\t\t}\n\t\t\tif(!strcasecmp(argv[i], \"-rgb\")) pf=TJPF_RGB;\n\t\t\tif(!strcasecmp(argv[i], \"-rgbx\")) pf=TJPF_RGBX;\n\t\t\tif(!strcasecmp(argv[i], \"-bgr\")) pf=TJPF_BGR;\n\t\t\tif(!strcasecmp(argv[i], \"-bgrx\")) pf=TJPF_BGRX;\n\t\t\tif(!strcasecmp(argv[i], \"-xbgr\")) pf=TJPF_XBGR;\n\t\t\tif(!strcasecmp(argv[i], \"-xrgb\")) pf=TJPF_XRGB;\n\t\t\tif(!strcasecmp(argv[i], \"-bottomup\")) flags|=TJFLAG_BOTTOMUP;\n\t\t\tif(!strcasecmp(argv[i], \"-quiet\")) quiet=1;\n\t\t\tif(!strcasecmp(argv[i], \"-qq\")) quiet=2;\n\t\t\tif(!strcasecmp(argv[i], \"-scale\") && i<argc-1)\n\t\t\t{\n\t\t\t\tint temp1=0, temp2=0, match=0;\n\t\t\t\tif(sscanf(argv[++i], \"%d/%d\", &temp1, &temp2)==2)\n\t\t\t\t{\n\t\t\t\t\tfor(j=0; j<nsf; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif((double)temp1/(double)temp2\n\t\t\t\t\t\t\t== (double)scalingfactors[j].num/(double)scalingfactors[j].denom)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsf=scalingfactors[j];\n\t\t\t\t\t\t\tmatch=1;  break;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(!match) usage(argv[0]);\n\t\t\t\t}\n\t\t\t\telse usage(argv[0]);\n\t\t\t}\n\t\t\tif(!strcasecmp(argv[i], \"-hflip\")) xformop=TJXOP_HFLIP;\n\t\t\tif(!strcasecmp(argv[i], \"-vflip\")) xformop=TJXOP_VFLIP;\n\t\t\tif(!strcasecmp(argv[i], \"-transpose\")) xformop=TJXOP_TRANSPOSE;\n\t\t\tif(!strcasecmp(argv[i], \"-transverse\")) xformop=TJXOP_TRANSVERSE;\n\t\t\tif(!strcasecmp(argv[i], \"-rot90\")) xformop=TJXOP_ROT90;\n\t\t\tif(!strcasecmp(argv[i], \"-rot180\")) xformop=TJXOP_ROT180;\n\t\t\tif(!strcasecmp(argv[i], \"-rot270\")) xformop=TJXOP_ROT270;\n\t\t\tif(!strcasecmp(argv[i], \"-grayscale\")) xformopt|=TJXOPT_GRAY;\n\t\t\tif(!strcasecmp(argv[i], \"-custom\")) customFilter=dummyDCTFilter;\n\t\t\tif(!strcasecmp(argv[i], \"-nooutput\")) xformopt|=TJXOPT_NOOUTPUT;\n\t\t\tif(!strcasecmp(argv[i], \"-benchtime\") && i<argc-1)\n\t\t\t{\n\t\t\t\tdouble temp=atof(argv[++i]);\n\t\t\t\tif(temp>0.0) benchtime=temp;\n\t\t\t\telse usage(argv[0]);\n\t\t\t}\n\t\t\tif(!strcmp(argv[i], \"-?\")) usage(argv[0]);\n\t\t\tif(!strcasecmp(argv[i], \"-alloc\")) flags&=(~TJFLAG_NOREALLOC);\n\t\t\tif(!strcasecmp(argv[i], \"-bmp\")) ext=\"bmp\";\n\t\t\tif(!strcasecmp(argv[i], \"-subsamp\") && i<argc-1)\n\t\t\t{\n\t\t\t\ti++;\n\t\t\t\tif(toupper(argv[i][0])=='G') subsamp=TJSAMP_GRAY;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tint temp=atoi(argv[i]);\n\t\t\t\t\tswitch(temp)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 444:  subsamp=TJSAMP_444;  break;\n\t\t\t\t\t\tcase 422:  subsamp=TJSAMP_422;  break;\n\t\t\t\t\t\tcase 440:  subsamp=TJSAMP_440;  break;\n\t\t\t\t\t\tcase 420:  subsamp=TJSAMP_420;  break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif((sf.num!=1 || sf.denom!=1) && dotile)\n\t{\n\t\tprintf(\"Disabling tiled compression/decompression tests, because those tests do not\\n\");\n\t\tprintf(\"work when scaled decompression is enabled.\\n\");\n\t\tdotile=0;\n\t}\n\n\tif(yuv && dotile)\n\t{\n\t\tprintf(\"Disabling tiled compression/decompression tests, because those tests do not\\n\");\n\t\tprintf(\"work when YUV encoding or decoding is enabled.\\n\\n\");\n\t\tdotile=0;\n\t}\n\n\tif(!decomponly)\n\t{\n\t\tif(loadbmp(argv[1], &srcbuf, &w, &h, pf, (flags&TJFLAG_BOTTOMUP)!=0)==-1)\n\t\t\t_throwbmp(\"loading bitmap\");\n\t\ttemp=strrchr(argv[1], '.');\n\t\tif(temp!=NULL) *temp='\\0';\n\t}\n\n\tif(quiet==1 && !decomponly)\n\t{\n\t\tprintf(\"All performance values in Mpixels/sec\\n\\n\");\n\t\tprintf(\"Bitmap\\tBitmap\\tJPEG\\tJPEG\\t%s %s \\tComp\\tComp\\tDecomp\\n\",\n\t\t\tdotile? \"Tile \":\"Image\", dotile? \"Tile \":\"Image\");\n\t\tprintf(\"Format\\tOrder\\tSubsamp\\tQual\\tWidth Height\\tPerf \\tRatio\\tPerf\\n\\n\");\n\t}\n\n\tif(decomponly)\n\t{\n\t\tdodecomptest(argv[1]);\n\t\tprintf(\"\\n\");\n\t\tgoto bailout;\n\t}\n\tif(subsamp>=0 && subsamp<TJ_NUMSAMP)\n\t{\n\t\tfor(i=maxqual; i>=minqual; i--)\n\t\t\tdotest(srcbuf, w, h, subsamp, i, argv[1]);\n\t\tprintf(\"\\n\");\n\t}\n\telse\n\t{\n\t\tfor(i=maxqual; i>=minqual; i--)\n\t\t\tdotest(srcbuf, w, h, TJSAMP_GRAY, i, argv[1]);\n\t\tprintf(\"\\n\");\n\t\tfor(i=maxqual; i>=minqual; i--)\n\t\t\tdotest(srcbuf, w, h, TJSAMP_420, i, argv[1]);\n\t\tprintf(\"\\n\");\n\t\tfor(i=maxqual; i>=minqual; i--)\n\t\t\tdotest(srcbuf, w, h, TJSAMP_422, i, argv[1]);\n\t\tprintf(\"\\n\");\n\t\tfor(i=maxqual; i>=minqual; i--)\n\t\t\tdotest(srcbuf, w, h, TJSAMP_444, i, argv[1]);\n\t\tprintf(\"\\n\");\n\t}\n\n\tbailout:\n\tif(srcbuf) free(srcbuf);\n\treturn retval;\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/tjbenchtest.in",
    "content": "#!/bin/bash\n\nset -u\nset -e\ntrap onexit INT\ntrap onexit TERM\ntrap onexit EXIT\n\nonexit()\n{\n\tif [ -d $OUTDIR ]; then\n\t\trm -rf $OUTDIR\n\tfi\n}\n\nrunme()\n{\n\techo \\*\\*\\* $*\n\t$*\n}\n\nEXT=bmp\nIMAGES=\"vgl_5674_0098.${EXT} vgl_6434_0018a.${EXT} vgl_6548_0026a.${EXT} nightshot_iso_100.${EXT}\"\nIMGDIR=@srcdir@/testimages\nOUTDIR=__tjbenchtest_output\nEXEDIR=.\nBMPARG=\nif [ \"$EXT\" = \"bmp\" ]; then BMPARG=-bmp; fi\n\nif [ -d $OUTDIR ]; then\n\trm -rf $OUTDIR\nfi\nmkdir -p $OUTDIR\n\nexec >$EXEDIR/tjbenchtest.log\n\n# Standard tests\nfor image in $IMAGES; do\n\n\tcp $IMGDIR/$image $OUTDIR\n\tbasename=`basename $image .${EXT}`\n\t$EXEDIR/cjpeg -quality 95 -dct fast -grayscale $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_GRAY_fast_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct fast -sample 2x2 $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_420_fast_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct fast -sample 2x1 $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_422_fast_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct fast -sample 1x1 $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_444_fast_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct int -grayscale $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_GRAY_accurate_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct int -sample 2x2 $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_420_accurate_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct int -sample 2x1 $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_422_accurate_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct int -sample 1x1 $IMGDIR/${basename}.${EXT} >$OUTDIR/${basename}_444_accurate_cjpeg.jpg\n\tfor samp in GRAY 420 422 444; do\n\t\t$EXEDIR/djpeg -rgb $BMPARG $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_default_djpeg.${EXT}\n\t\t$EXEDIR/djpeg -dct fast -rgb $BMPARG $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_fast_djpeg.${EXT}\n\t\t$EXEDIR/djpeg -dct int -rgb $BMPARG $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg >$OUTDIR/${basename}_${samp}_accurate_djpeg.${EXT}\n\tdone\n\tfor samp in 420 422; do\n\t\t$EXEDIR/djpeg -nosmooth $BMPARG $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_default_nosmooth_djpeg.${EXT}\n\t\t$EXEDIR/djpeg -dct fast -nosmooth $BMPARG $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_fast_nosmooth_djpeg.${EXT}\n\t\t$EXEDIR/djpeg -dct int -nosmooth $BMPARG $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg >$OUTDIR/${basename}_${samp}_accurate_nosmooth_djpeg.${EXT}\n\tdone\n\n\t# Compression\n\tfor dct in accurate fast; do\n\t\trunme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -quiet -benchtime 0.01 -${dct}dct\n\t\tfor samp in GRAY 420 422 444; do\n\t\t\trunme cmp $OUTDIR/${basename}_${samp}_Q95.jpg $OUTDIR/${basename}_${samp}_${dct}_cjpeg.jpg\n\t\tdone\n\tdone\n\n\tfor dct in fast accurate default; do\n\t\tdctarg=-${dct}dct\n\t\tif [ \"${dct}\" = \"default\" ]; then\n\t\t\tdctarg=\n\t\tfi\n\n\t\t# Tiled compression & decompression\n\t\trunme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 ${dctarg}\n\t\tfor samp in GRAY 444; do\n\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \\\n\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do\n\t\t\t\trunme cmp $i $OUTDIR/${basename}_${samp}_${dct}_djpeg.${EXT}\n\t\t\t\trm $i\n\t\t\tdone\n\t\tdone\n\t\trunme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 -fastupsample ${dctarg}\n\t\tfor samp in 420 422; do\n\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \\\n\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do\n\t\t\t\trunme cmp $i $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.${EXT}\n\t\t\t\trm $i\n\t\t\tdone\n\t\tdone\n\n\t\t# Tiled decompression\n\t\tfor samp in GRAY 444; do\n\t\t\trunme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -tile -quiet -benchtime 0.01 ${dctarg}\n\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \\\n\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do\n\t\t\t\trunme cmp $i $OUTDIR/${basename}_${samp}_${dct}_djpeg.${EXT}\n\t\t\t\trm $i\n\t\t\tdone\n\t\tdone\n\t\tfor samp in 420 422; do\n\t\t\trunme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -tile -quiet -benchtime 0.01 -fastupsample ${dctarg}\n\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \\\n\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do\n\t\t\t\trunme cmp $i $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.${EXT}\n\t\t\t\trm $i\n\t\t\tdone\n\t\tdone\n\tdone\n\n\t# Scaled decompression\n\tfor scale in 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8; do\n\t\tscalearg=`echo $scale | sed s@_@/@g`\n\t\tfor samp in GRAY 420 422 444; do\n\t\t\t$EXEDIR/djpeg -rgb -scale ${scalearg} $BMPARG $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_${scale}_djpeg.${EXT}\n\t\t\trunme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -scale ${scalearg} -quiet -benchtime 0.01\n\t\t\trunme cmp $OUTDIR/${basename}_${samp}_Q95_${scale}.${EXT} $OUTDIR/${basename}_${samp}_${scale}_djpeg.${EXT}\n\t\t\trm $OUTDIR/${basename}_${samp}_Q95_${scale}.${EXT}\n\t\tdone\n\tdone\n\n\t# Transforms\n\tfor samp in GRAY 420 422 444; do\n\t\t$EXEDIR/jpegtran -flip horizontal -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_hflip_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -flip vertical -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_vflip_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -transpose -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_transpose_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -transverse -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_transverse_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -rotate 90 -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_rot90_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -rotate 180 -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_rot180_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -rotate 270 -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_rot270_jpegtran.jpg\n\tdone\n\tfor xform in hflip vflip transpose transverse rot90 rot180 rot270; do\n\t\tfor samp in GRAY 444; do\n\t\t\t$EXEDIR/djpeg -rgb $BMPARG $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg >$OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT}\n\t\t\trunme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -tile -quiet -benchtime 0.01\n\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \\\n\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do\n\t\t\t\trunme cmp $i $OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT}\n\t\t\t\trm $i\n\t\t\tdone\n\t\tdone\n\t\tfor samp in 420 422; do\n\t\t\t$EXEDIR/djpeg -nosmooth -rgb $BMPARG $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg >$OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT}\n\t\t\trunme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -tile -quiet -benchtime 0.01 -fastupsample\n\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \\\n\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do\n\t\t\t\trunme cmp $i $OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT}\n\t\t\t\trm $i\n\t\t\tdone\n\t\tdone\n\tdone\n\n\t# Grayscale transform\n\tfor xform in hflip vflip transpose transverse rot90 rot180 rot270; do\n\t\tfor samp in GRAY 444 422 420; do\n\t\t\trunme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -tile -quiet -benchtime 0.01 -grayscale\n\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \\\n\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do\n\t\t\t\trunme cmp $i $OUTDIR/${basename}_GRAY_${xform}_jpegtran.${EXT}\n\t\t\t\trm $i\n\t\t\tdone\n\t\tdone\n\tdone\n\n\t# Transforms with scaling\n\tfor xform in hflip vflip transpose transverse rot90 rot180 rot270; do\n\t\tfor samp in GRAY 444 422 420; do\n\t\t\tfor scale in 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8; do\n\t\t\t\tscalearg=`echo $scale | sed s@_@/@g`\n\t\t\t\t$EXEDIR/djpeg -rgb -scale ${scalearg} $BMPARG $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg >$OUTDIR/${basename}_${samp}_${xform}_${scale}_jpegtran.${EXT}\n\t\t\t\trunme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -scale ${scalearg} -quiet -benchtime 0.01\n\t\t\t\trunme cmp $OUTDIR/${basename}_${samp}_Q95_${scale}.${EXT} $OUTDIR/${basename}_${samp}_${xform}_${scale}_jpegtran.${EXT}\n\t\t\t\trm $OUTDIR/${basename}_${samp}_Q95_${scale}.${EXT}\n\t\t\tdone\n\t\tdone\n\tdone\n\ndone\n\necho SUCCESS!\n"
  },
  {
    "path": "ext/libjpeg-turbo/tjbenchtest.java.in",
    "content": "#!/bin/bash\n\nset -u\nset -e\ntrap onexit INT\ntrap onexit TERM\ntrap onexit EXIT\n\nonexit()\n{\n\tif [ -d $OUTDIR ]; then\n\t\trm -rf $OUTDIR\n\tfi\n}\n\nrunme()\n{\n\techo \\*\\*\\* $*\n\t$*\n}\n\nIMAGES=\"vgl_5674_0098.bmp vgl_6434_0018a.bmp vgl_6548_0026a.bmp nightshot_iso_100.bmp\"\nIMGDIR=@srcdir@/testimages\nOUTDIR=__tjbenchtest_java_output\nEXEDIR=.\nJAVA=\"@JAVA@ -cp java/turbojpeg.jar -Djava.library.path=.libs\"\n\nif [ -d $OUTDIR ]; then\n\trm -rf $OUTDIR\nfi\nmkdir -p $OUTDIR\n\nexec >$EXEDIR/tjbenchtest-java.log\n\n# Standard tests\nfor image in $IMAGES; do\n\n\tcp $IMGDIR/$image $OUTDIR\n\tbasename=`basename $image .bmp`\n\t$EXEDIR/cjpeg -quality 95 -dct fast -grayscale $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_GRAY_fast_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct fast -sample 2x2 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_420_fast_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct fast -sample 2x1 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_422_fast_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct fast -sample 1x1 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_444_fast_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct int -grayscale $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_GRAY_accurate_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct int -sample 2x2 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_420_accurate_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct int -sample 2x1 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_422_accurate_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct int -sample 1x1 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_444_accurate_cjpeg.jpg\n\tfor samp in GRAY 420 422 444; do\n\t\t$EXEDIR/djpeg -rgb -bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_default_djpeg.bmp\n\t\t$EXEDIR/djpeg -dct fast -rgb -bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_fast_djpeg.bmp\n\t\t$EXEDIR/djpeg -dct int -rgb -bmp $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg >$OUTDIR/${basename}_${samp}_accurate_djpeg.bmp\n\tdone\n\tfor samp in 420 422; do\n\t\t$EXEDIR/djpeg -nosmooth -bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_default_nosmooth_djpeg.bmp\n\t\t$EXEDIR/djpeg -dct fast -nosmooth -bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_fast_nosmooth_djpeg.bmp\n\t\t$EXEDIR/djpeg -dct int -nosmooth -bmp $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg >$OUTDIR/${basename}_${samp}_accurate_nosmooth_djpeg.bmp\n\tdone\n\n\t# Compression\n\tfor dct in accurate fast; do\n\t\trunme $JAVA TJBench $OUTDIR/$image 95 -rgb -quiet -benchtime 0.01 -${dct}dct\n\t\tfor samp in GRAY 420 422 444; do\n\t\t\trunme cmp $OUTDIR/${basename}_${samp}_Q95.jpg $OUTDIR/${basename}_${samp}_${dct}_cjpeg.jpg\n\t\tdone\n\tdone\n\n\tfor dct in fast accurate default; do\n\t\tdctarg=-${dct}dct\n\t\tif [ \"${dct}\" = \"default\" ]; then\n\t\t\tdctarg=\n\t\tfi\n\n\t\t# Tiled compression & decompression\n\t\trunme $JAVA TJBench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 ${dctarg}\n\t\tfor samp in GRAY 444; do\n\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \\\n\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.bmp; do\n\t\t\t\trunme cmp -i 54:54 $i $OUTDIR/${basename}_${samp}_${dct}_djpeg.bmp\n\t\t\t\trm $i\n\t\t\tdone\n\t\tdone\n\t\trunme $JAVA TJBench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 -fastupsample ${dctarg}\n\t\tfor samp in 420 422; do\n\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \\\n\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.bmp; do\n\t\t\t\trunme cmp -i 54:54 $i $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.bmp\n\t\t\t\trm $i\n\t\t\tdone\n\t\tdone\n\n\t\t# Tiled decompression\n\t\tfor samp in GRAY 444; do\n\t\t\trunme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -tile -quiet -benchtime 0.01 ${dctarg}\n\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \\\n\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.bmp; do\n\t\t\t\trunme cmp -i 54:54 $i $OUTDIR/${basename}_${samp}_${dct}_djpeg.bmp\n\t\t\t\trm $i\n\t\t\tdone\n\t\tdone\n\t\tfor samp in 420 422; do\n\t\t\trunme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -tile -quiet -benchtime 0.01 -fastupsample ${dctarg}\n\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \\\n\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.bmp; do\n\t\t\t\trunme cmp $i -i 54:54 $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.bmp\n\t\t\t\trm $i\n\t\t\tdone\n\t\tdone\n\tdone\n\n\t# Scaled decompression\n\tfor scale in 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8; do\n\t\tscalearg=`echo $scale | sed s@_@/@g`\n\t\tfor samp in GRAY 420 422 444; do\n\t\t\t$EXEDIR/djpeg -rgb -scale ${scalearg} -bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_${scale}_djpeg.bmp\n\t\t\trunme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -scale ${scalearg} -quiet -benchtime 0.01\n\t\t\trunme cmp -i 54:54 $OUTDIR/${basename}_${samp}_Q95_${scale}.bmp $OUTDIR/${basename}_${samp}_${scale}_djpeg.bmp\n\t\t\trm $OUTDIR/${basename}_${samp}_Q95_${scale}.bmp\n\t\tdone\n\tdone\n\n\t# Transforms\n\tfor samp in GRAY 420 422 444; do\n\t\t$EXEDIR/jpegtran -flip horizontal -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_hflip_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -flip vertical -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_vflip_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -transpose -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_transpose_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -transverse -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_transverse_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -rotate 90 -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_rot90_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -rotate 180 -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_rot180_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -rotate 270 -trim $OUTDIR/${basename}_${samp}_Q95.jpg >$OUTDIR/${basename}_${samp}_rot270_jpegtran.jpg\n\tdone\n\tfor xform in hflip vflip transpose transverse rot90 rot180 rot270; do\n\t\tfor samp in GRAY 444; do\n\t\t\t$EXEDIR/djpeg -rgb -bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg >$OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp\n\t\t\trunme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -$xform -tile -quiet -benchtime 0.01\n\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \\\n\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.bmp; do\n\t\t\t\trunme cmp -i 54:54 $i $OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp\n\t\t\t\trm $i\n\t\t\tdone\n\t\tdone\n\t\tfor samp in 420 422; do\n\t\t\t$EXEDIR/djpeg -nosmooth -rgb -bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg >$OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp\n\t\t\trunme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -$xform -tile -quiet -benchtime 0.01 -fastupsample\n\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \\\n\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.bmp; do\n\t\t\t\trunme cmp -i 54:54 $i $OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp\n\t\t\t\trm $i\n\t\t\tdone\n\t\tdone\n\tdone\n\n\t# Grayscale transform\n\tfor xform in hflip vflip transpose transverse rot90 rot180 rot270; do\n\t\tfor samp in GRAY 444 422 420; do\n\t\t\trunme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -$xform -tile -quiet -benchtime 0.01 -grayscale\n\t\t\tfor i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].bmp \\\n\t\t\t\t$OUTDIR/${basename}_${samp}_Q95_full.bmp; do\n\t\t\t\trunme cmp -i 54:54 $i $OUTDIR/${basename}_GRAY_${xform}_jpegtran.bmp\n\t\t\t\trm $i\n\t\t\tdone\n\t\tdone\n\tdone\n\n\t# Transforms with scaling\n\tfor xform in hflip vflip transpose transverse rot90 rot180 rot270; do\n\t\tfor samp in GRAY 444 422 420; do\n\t\t\tfor scale in 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8; do\n\t\t\t\tscalearg=`echo $scale | sed s@_@/@g`\n\t\t\t\t$EXEDIR/djpeg -rgb -scale ${scalearg} -bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg >$OUTDIR/${basename}_${samp}_${xform}_${scale}_jpegtran.bmp\n\t\t\t\trunme $JAVA TJBench $OUTDIR/${basename}_${samp}_Q95.jpg -$xform -scale ${scalearg} -quiet -benchtime 0.01\n\t\t\t\trunme cmp -i 54:54 $OUTDIR/${basename}_${samp}_Q95_${scale}.bmp $OUTDIR/${basename}_${samp}_${xform}_${scale}_jpegtran.bmp\n\t\t\t\trm $OUTDIR/${basename}_${samp}_Q95_${scale}.bmp\n\t\t\tdone\n\t\tdone\n\tdone\n\ndone\n\necho SUCCESS!\n"
  },
  {
    "path": "ext/libjpeg-turbo/tjexampletest.in",
    "content": "#!/bin/bash\n\nset -u\nset -e\ntrap onexit INT\ntrap onexit TERM\ntrap onexit EXIT\n\nonexit()\n{\n\tif [ -d $OUTDIR ]; then\n\t\trm -rf $OUTDIR\n\tfi\n}\n\nrunme()\n{\n\techo \\*\\*\\* $*\n\t$*\n}\n\nIMAGES=\"vgl_5674_0098.bmp vgl_6434_0018a.bmp vgl_6548_0026a.bmp nightshot_iso_100.bmp\"\nIMGDIR=@srcdir@/testimages\nOUTDIR=__tjexampletest_output\nEXEDIR=.\nJAVA=\"@JAVA@ -cp java/turbojpeg.jar -Djava.library.path=.libs\"\n\nif [ -d $OUTDIR ]; then\n\trm -rf $OUTDIR\nfi\nmkdir -p $OUTDIR\n\nexec >$EXEDIR/tjexampletest.log\n\nfor image in $IMAGES; do\n\n\tcp $IMGDIR/$image $OUTDIR\n\tbasename=`basename $image .bmp`\n\t$EXEDIR/cjpeg -quality 95 -dct fast -grayscale $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_GRAY_fast_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct fast -sample 2x2 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_420_fast_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct fast -sample 2x1 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_422_fast_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct fast -sample 1x1 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_444_fast_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct int -grayscale $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_GRAY_accurate_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct int -sample 2x2 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_420_accurate_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct int -sample 2x1 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_422_accurate_cjpeg.jpg\n\t$EXEDIR/cjpeg -quality 95 -dct int -sample 1x1 $IMGDIR/${basename}.bmp >$OUTDIR/${basename}_444_accurate_cjpeg.jpg\n\tfor samp in GRAY 420 422 444; do\n\t\t$EXEDIR/djpeg -rgb -bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_default_djpeg.bmp\n\t\t$EXEDIR/djpeg -dct fast -rgb -bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_fast_djpeg.bmp\n\t\t$EXEDIR/djpeg -dct int -rgb -bmp $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg >$OUTDIR/${basename}_${samp}_accurate_djpeg.bmp\n\tdone\n\tfor samp in 420 422; do\n\t\t$EXEDIR/djpeg -nosmooth -bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_default_nosmooth_djpeg.bmp\n\t\t$EXEDIR/djpeg -dct fast -nosmooth -bmp $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_fast_nosmooth_djpeg.bmp\n\t\t$EXEDIR/djpeg -dct int -nosmooth -bmp $OUTDIR/${basename}_${samp}_accurate_cjpeg.jpg >$OUTDIR/${basename}_${samp}_accurate_nosmooth_djpeg.bmp\n\tdone\n\n\t# Compression\n\tfor dct in fast accurate; do\n\t\tfor samp in GRAY 420 422 444; do\n\t\t\trunme $JAVA TJExample $OUTDIR/$image $OUTDIR/${basename}_${samp}_${dct}.jpg -q 95 -samp ${samp} -${dct}dct\n\t\t\trunme cmp $OUTDIR/${basename}_${samp}_${dct}.jpg $OUTDIR/${basename}_${samp}_${dct}_cjpeg.jpg\n\t\tdone\n\tdone\n\n\t# Decompression\n\tfor dct in fast accurate default; do\n\t\tsrcdct=${dct}\n\t\tdctarg=-${dct}dct\n\t\tif [ \"${dct}\" = \"default\" ]; then\n\t\t\tsrcdct=fast\n\t\t\tdctarg=\n\t\tfi\n\t\tfor samp in GRAY 420 422 444; do\n\t\t\trunme $JAVA TJExample $OUTDIR/${basename}_${samp}_${srcdct}.jpg $OUTDIR/${basename}_${samp}_${dct}.bmp ${dctarg}\n\t\t\trunme cmp -i 54:54 $OUTDIR/${basename}_${samp}_${dct}.bmp $OUTDIR/${basename}_${samp}_${dct}_djpeg.bmp\n\t\t\trm $OUTDIR/${basename}_${samp}_${dct}.bmp\n\t\tdone\n\t\tfor samp in 420 422; do\n\t\t\trunme $JAVA TJExample $OUTDIR/${basename}_${samp}_${srcdct}.jpg $OUTDIR/${basename}_${samp}_${dct}_nosmooth.bmp -fastupsample ${dctarg}\n\t\t\trunme cmp -i 54:54 $OUTDIR/${basename}_${samp}_${dct}_nosmooth.bmp $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.bmp\n\t\t\trm $OUTDIR/${basename}_${samp}_${dct}_nosmooth.bmp\n\t\tdone\n\tdone\n\n\t# Scaled decompression\n\tfor scale in 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8; do\n\t\tscalearg=`echo $scale | sed s@_@/@g`\n\t\tfor samp in GRAY 420 422 444; do\n\t\t\t$EXEDIR/djpeg -rgb -bmp -scale ${scalearg} $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg >$OUTDIR/${basename}_${samp}_${scale}_djpeg.bmp\n\t\t\trunme $JAVA TJExample $OUTDIR/${basename}_${samp}_fast.jpg $OUTDIR/${basename}_${samp}_${scale}.bmp -scale ${scalearg}\n\t\t\trunme cmp -i 54:54 $OUTDIR/${basename}_${samp}_${scale}.bmp $OUTDIR/${basename}_${samp}_${scale}_djpeg.bmp\n\t\t\trm $OUTDIR/${basename}_${samp}_${scale}.bmp\n\t\tdone\n\tdone\n\n\t# Transforms\n\tfor samp in GRAY 420 422 444; do\n\t\t$EXEDIR/jpegtran -crop 70x60+16+16 -flip horizontal -trim $OUTDIR/${basename}_${samp}_fast.jpg >$OUTDIR/${basename}_${samp}_hflip_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -crop 70x60+16+16 -flip vertical -trim $OUTDIR/${basename}_${samp}_fast.jpg >$OUTDIR/${basename}_${samp}_vflip_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -crop 70x60+16+16 -transpose -trim $OUTDIR/${basename}_${samp}_fast.jpg >$OUTDIR/${basename}_${samp}_transpose_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -crop 70x60+16+16 -transverse -trim $OUTDIR/${basename}_${samp}_fast.jpg >$OUTDIR/${basename}_${samp}_transverse_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -crop 70x60+16+16 -rotate 90 -trim $OUTDIR/${basename}_${samp}_fast.jpg >$OUTDIR/${basename}_${samp}_rot90_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -crop 70x60+16+16 -rotate 180 -trim $OUTDIR/${basename}_${samp}_fast.jpg >$OUTDIR/${basename}_${samp}_rot180_jpegtran.jpg\n\t\t$EXEDIR/jpegtran -crop 70x60+16+16 -rotate 270 -trim $OUTDIR/${basename}_${samp}_fast.jpg >$OUTDIR/${basename}_${samp}_rot270_jpegtran.jpg\n\tdone\n\tfor xform in hflip vflip transpose transverse rot90 rot180 rot270; do\n\t\tfor samp in GRAY 420 422 444; do\n\t\t\trunme $JAVA TJExample $OUTDIR/${basename}_${samp}_fast.jpg $OUTDIR/${basename}_${samp}_${xform}.jpg -$xform -crop 16,16,70x60\n\t\t\trunme cmp $OUTDIR/${basename}_${samp}_${xform}.jpg $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg\n\t\t\t$EXEDIR/djpeg -rgb -bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg >$OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp\n\t\t\trunme $JAVA TJExample $OUTDIR/${basename}_${samp}_fast.jpg $OUTDIR/${basename}_${samp}_${xform}.bmp -$xform -crop 16,16,70x60\n\t\t\trunme cmp -i 54:54 $OUTDIR/${basename}_${samp}_${xform}.bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp\n\t\t\trm $OUTDIR/${basename}_${samp}_${xform}.bmp\n\t\tdone\n\t\tfor samp in 420 422; do\n\t\t\t$EXEDIR/djpeg -nosmooth -rgb -bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg >$OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp\n\t\t\trunme $JAVA TJExample $OUTDIR/${basename}_${samp}_fast.jpg $OUTDIR/${basename}_${samp}_${xform}.bmp -$xform -crop 16,16,70x60 -fastupsample\n\t\t\trunme cmp -i 54:54 $OUTDIR/${basename}_${samp}_${xform}.bmp $OUTDIR/${basename}_${samp}_${xform}_jpegtran.bmp\n\t\t\trm $OUTDIR/${basename}_${samp}_${xform}.bmp\n\t\tdone\n\tdone\n\n\t# Grayscale transform\n\tfor xform in hflip vflip transpose transverse rot90 rot180 rot270; do\n\t\tfor samp in GRAY 444 422 420; do\n\t\t\trunme $JAVA TJExample $OUTDIR/${basename}_${samp}_fast.jpg $OUTDIR/${basename}_${samp}_${xform}.jpg -$xform -grayscale -crop 16,16,70x60\n\t\t\trunme cmp $OUTDIR/${basename}_${samp}_${xform}.jpg $OUTDIR/${basename}_GRAY_${xform}_jpegtran.jpg\n\t\t\trunme $JAVA TJExample $OUTDIR/${basename}_${samp}_fast.jpg $OUTDIR/${basename}_${samp}_${xform}.bmp -$xform -grayscale -crop 16,16,70x60\n\t\t\trunme cmp -i 54:54 $OUTDIR/${basename}_${samp}_${xform}.bmp $OUTDIR/${basename}_GRAY_${xform}_jpegtran.bmp\n\t\t\trm $OUTDIR/${basename}_${samp}_${xform}.bmp\n\t\tdone\n\tdone\n\n\t# Transforms with scaling\n\tfor xform in hflip vflip transpose transverse rot90 rot180 rot270; do\n\t\tfor samp in GRAY 444 422 420; do\n\t\t\tfor scale in 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8; do\n\t\t\t\tscalearg=`echo $scale | sed s@_@/@g`\n\t\t\t\t$EXEDIR/djpeg -rgb -bmp -scale ${scalearg} $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg >$OUTDIR/${basename}_${samp}_${xform}_${scale}_jpegtran.bmp\n\t\t\t\trunme $JAVA TJExample $OUTDIR/${basename}_${samp}_fast.jpg $OUTDIR/${basename}_${samp}_${xform}_${scale}.bmp -$xform -scale ${scalearg} -crop 16,16,70x60\n\t\t\t\trunme cmp -i 54:54 $OUTDIR/${basename}_${samp}_${xform}_${scale}.bmp $OUTDIR/${basename}_${samp}_${xform}_${scale}_jpegtran.bmp\n\t\t\t\trm $OUTDIR/${basename}_${samp}_${xform}_${scale}.bmp\n\t\t\tdone\n\t\tdone\n\tdone\n\ndone\n\necho SUCCESS!\n"
  },
  {
    "path": "ext/libjpeg-turbo/tjunittest.c",
    "content": "/*\n * Copyright (C)2009-2012, 2014 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*\n * This program tests the various code paths in the TurboJPEG C Wrapper\n */\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <errno.h>\n#include \"./tjutil.h\"\n#include \"./turbojpeg.h\"\n#ifdef _WIN32\n #include <time.h>\n #define random() rand()\n#endif\n\n\nvoid usage(char *progName)\n{\n\tprintf(\"\\nUSAGE: %s [options]\\n\", progName);\n\tprintf(\"Options:\\n\");\n\tprintf(\"-yuv = test YUV encoding/decoding support\\n\");\n\tprintf(\"-alloc = test automatic buffer allocation\\n\");\n\texit(1);\n}\n\n\n#define _throwtj() {printf(\"TurboJPEG ERROR:\\n%s\\n\", tjGetErrorStr());  \\\n\tbailout();}\n#define _tj(f) {if((f)==-1) _throwtj();}\n#define _throw(m) {printf(\"ERROR: %s\\n\", m);  bailout();}\n\nconst char *subNameLong[TJ_NUMSAMP]=\n{\n\t\"4:4:4\", \"4:2:2\", \"4:2:0\", \"GRAY\", \"4:4:0\"\n};\nconst char *subName[TJ_NUMSAMP]={\"444\", \"422\", \"420\", \"GRAY\", \"440\"};\n\nconst char *pixFormatStr[TJ_NUMPF]=\n{\n\t\"RGB\", \"BGR\", \"RGBX\", \"BGRX\", \"XBGR\", \"XRGB\", \"Grayscale\",\n\t\"RGBA\", \"BGRA\", \"ABGR\", \"ARGB\"\n};\n\nconst int alphaOffset[TJ_NUMPF] = {-1, -1, -1, -1, -1, -1, -1, 3, 3, 0, 0};\n\nconst int _3byteFormats[]={TJPF_RGB, TJPF_BGR};\nconst int _4byteFormats[]={TJPF_RGBX, TJPF_BGRX, TJPF_XBGR, TJPF_XRGB};\nconst int _onlyGray[]={TJPF_GRAY};\nconst int _onlyRGB[]={TJPF_RGB};\n\nenum {YUVENCODE=1, YUVDECODE};\nint yuv=0, alloc=0;\n\nint exitStatus=0;\n#define bailout() {exitStatus=-1;  goto bailout;}\n\n\nvoid initBuf(unsigned char *buf, int w, int h, int pf, int flags)\n{\n\tint roffset=tjRedOffset[pf];\n\tint goffset=tjGreenOffset[pf];\n\tint boffset=tjBlueOffset[pf];\n\tint ps=tjPixelSize[pf];\n\tint index, row, col, halfway=16;\n\n\tmemset(buf, 0, w*h*ps);\n\tif(pf==TJPF_GRAY)\n\t{\n\t\tfor(row=0; row<h; row++)\n\t\t{\n\t\t\tfor(col=0; col<w; col++)\n\t\t\t{\n\t\t\t\tif(flags&TJFLAG_BOTTOMUP) index=(h-row-1)*w+col;\n\t\t\t\telse index=row*w+col;\n\t\t\t\tif(((row/8)+(col/8))%2==0) buf[index]=(row<halfway)? 255:0;\n\t\t\t\telse buf[index]=(row<halfway)? 76:226;\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\tfor(row=0; row<h; row++)\n\t\t{\n\t\t\tfor(col=0; col<w; col++)\n\t\t\t{\n\t\t\t\tif(flags&TJFLAG_BOTTOMUP) index=(h-row-1)*w+col;\n\t\t\t\telse index=row*w+col;\n\t\t\t\tif(((row/8)+(col/8))%2==0)\n\t\t\t\t{\n\t\t\t\t\tif(row<halfway)\n\t\t\t\t\t{\n\t\t\t\t\t\tbuf[index*ps+roffset]=255;\n\t\t\t\t\t\tbuf[index*ps+goffset]=255;\n\t\t\t\t\t\tbuf[index*ps+boffset]=255;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbuf[index*ps+roffset]=255;\n\t\t\t\t\tif(row>=halfway) buf[index*ps+goffset]=255;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\n#define checkval(v, cv) { \\\n\tif(v<cv-1 || v>cv+1) { \\\n\t\tprintf(\"\\nComp. %s at %d,%d should be %d, not %d\\n\",  \\\n\t\t\t#v, row, col, cv, v); \\\n\t\tretval=0;  exitStatus=-1;  goto bailout; \\\n\t}}\n\n#define checkval0(v) { \\\n\tif(v>1) { \\\n\t\tprintf(\"\\nComp. %s at %d,%d should be 0, not %d\\n\", #v, row, col, v); \\\n\t\tretval=0;  exitStatus=-1;  goto bailout; \\\n\t}}\n\n#define checkval255(v) { \\\n\tif(v<254) { \\\n\t\tprintf(\"\\nComp. %s at %d,%d should be 255, not %d\\n\", #v, row, col, v); \\\n\t\tretval=0;  exitStatus=-1;  goto bailout; \\\n\t}}\n\n\nint checkBuf(unsigned char *buf, int w, int h, int pf, int subsamp,\n\ttjscalingfactor sf, int flags)\n{\n\tint roffset=tjRedOffset[pf];\n\tint goffset=tjGreenOffset[pf];\n\tint boffset=tjBlueOffset[pf];\n\tint aoffset=alphaOffset[pf];\n\tint ps=tjPixelSize[pf];\n\tint index, row, col, retval=1;\n\tint halfway=16*sf.num/sf.denom;\n\tint blocksize=8*sf.num/sf.denom;\n\n\tfor(row=0; row<h; row++)\n\t{\n\t\tfor(col=0; col<w; col++)\n\t\t{\n\t\t\tunsigned char r, g, b, a;\n\t\t\tif(flags&TJFLAG_BOTTOMUP) index=(h-row-1)*w+col;\n\t\t\telse index=row*w+col;\n\t\t\tr=buf[index*ps+roffset];\n\t\t\tg=buf[index*ps+goffset];\n\t\t\tb=buf[index*ps+boffset];\n\t\t\ta=aoffset>=0? buf[index*ps+aoffset]:0xFF;\n\t\t\tif(((row/blocksize)+(col/blocksize))%2==0)\n\t\t\t{\n\t\t\t\tif(row<halfway)\n\t\t\t\t{\n\t\t\t\t\tcheckval255(r);  checkval255(g);  checkval255(b);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcheckval0(r);  checkval0(g);  checkval0(b);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(subsamp==TJSAMP_GRAY)\n\t\t\t\t{\n\t\t\t\t\tif(row<halfway)\n\t\t\t\t\t{\n\t\t\t\t\t\tcheckval(r, 76);  checkval(g, 76);  checkval(b, 76);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcheckval(r, 226);  checkval(g, 226);  checkval(b, 226);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(row<halfway)\n\t\t\t\t\t{\n\t\t\t\t\t\tcheckval255(r);  checkval0(g);  checkval0(b);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcheckval255(r);  checkval255(g);  checkval0(b);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcheckval255(a);\n\t\t}\n\t}\n\n\tbailout:\n\tif(retval==0)\n\t{\n\t\tfor(row=0; row<h; row++)\n\t\t{\n\t\t\tfor(col=0; col<w; col++)\n\t\t\t{\n\t\t\t\tprintf(\"%.3d/%.3d/%.3d \", buf[(row*w+col)*ps+roffset],\n\t\t\t\t\tbuf[(row*w+col)*ps+goffset], buf[(row*w+col)*ps+boffset]);\n\t\t\t}\n\t\t\tprintf(\"\\n\");\n\t\t}\n\t}\n\treturn retval;\n}\n\n\n#define PAD(v, p) ((v+(p)-1)&(~((p)-1)))\n\nint checkBufYUV(unsigned char *buf, int w, int h, int subsamp)\n{\n\tint row, col;\n\tint hsf=tjMCUWidth[subsamp]/8, vsf=tjMCUHeight[subsamp]/8;\n\tint pw=PAD(w, hsf), ph=PAD(h, vsf);\n\tint cw=pw/hsf, ch=ph/vsf;\n\tint ypitch=PAD(pw, 4), uvpitch=PAD(cw, 4);\n\tint retval=1;\n\tint halfway=16;\n\n\tfor(row=0; row<ph; row++)\n\t{\n\t\tfor(col=0; col<pw; col++)\n\t\t{\n\t\t\tunsigned char y=buf[ypitch*row+col];\n\t\t\tif(((row/8)+(col/8))%2==0)\n\t\t\t{\n\t\t\t\tif(row<halfway) checkval255(y)  else checkval0(y);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(row<halfway) checkval(y, 76)  else checkval(y, 226);\n\t\t\t}\n\t\t}\n\t}\n\tif(subsamp!=TJSAMP_GRAY)\n\t{\n\t\thalfway=16/vsf;\n\t\tfor(row=0; row<ch; row++)\n\t\t{\n\t\t\tfor(col=0; col<cw; col++)\n\t\t\t{\n\t\t\t\tunsigned char u=buf[ypitch*ph + (uvpitch*row+col)],\n\t\t\t\t\tv=buf[ypitch*ph + uvpitch*ch + (uvpitch*row+col)];\n\t\t\t\tif(((row*vsf/8)+(col*hsf/8))%2==0)\n\t\t\t\t{\n\t\t\t\t\tcheckval(u, 128);  checkval(v, 128);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(row<halfway)\n\t\t\t\t\t{\n\t\t\t\t\t\tcheckval(u, 85);  checkval255(v);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcheckval0(u);  checkval(v, 149);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tbailout:\n\tif(retval==0)\n\t{\n\t\tfor(row=0; row<ph; row++)\n\t\t{\n\t\t\tfor(col=0; col<pw; col++)\n\t\t\t\tprintf(\"%.3d \", buf[ypitch*row+col]);\n\t\t\tprintf(\"\\n\");\n\t\t}\n\t\tprintf(\"\\n\");\n\t\tfor(row=0; row<ch; row++)\n\t\t{\n\t\t\tfor(col=0; col<cw; col++)\n\t\t\t\tprintf(\"%.3d \", buf[ypitch*ph + (uvpitch*row+col)]);\n\t\t\tprintf(\"\\n\");\n\t\t}\n\t\tprintf(\"\\n\");\n\t\tfor(row=0; row<ch; row++)\n\t\t{\n\t\t\tfor(col=0; col<cw; col++)\n\t\t\t\tprintf(\"%.3d \", buf[ypitch*ph + uvpitch*ch + (uvpitch*row+col)]);\n\t\t\tprintf(\"\\n\");\n\t\t}\n\t}\n\n\treturn retval;\n}\n\n\nvoid writeJPEG(unsigned char *jpegBuf, unsigned long jpegSize, char *filename)\n{\n\tFILE *file=fopen(filename, \"wb\");\n\tif(!file || fwrite(jpegBuf, jpegSize, 1, file)!=1)\n\t{\n\t\tprintf(\"ERROR: Could not write to %s.\\n%s\\n\", filename, strerror(errno));\n\t\tbailout();\n\t}\n\n\tbailout:\n\tif(file) fclose(file);\n}\n\n\nvoid compTest(tjhandle handle, unsigned char **dstBuf,\n\tunsigned long *dstSize, int w, int h, int pf, char *basename,\n\tint subsamp, int jpegQual, int flags)\n{\n\tchar tempStr[1024];  unsigned char *srcBuf=NULL;\n\tdouble t;\n\n\tif(yuv==YUVENCODE)\n\t\tprintf(\"%s %s -> %s YUV ... \", pixFormatStr[pf],\n\t\t\t(flags&TJFLAG_BOTTOMUP)? \"Bottom-Up\":\"Top-Down \", subNameLong[subsamp]);\n\telse\n\t\tprintf(\"%s %s -> %s Q%d ... \", pixFormatStr[pf],\n\t\t\t(flags&TJFLAG_BOTTOMUP)? \"Bottom-Up\":\"Top-Down \", subNameLong[subsamp],\n\t\t\tjpegQual);\n\n\tif((srcBuf=(unsigned char *)malloc(w*h*tjPixelSize[pf]))==NULL)\n\t\t_throw(\"Memory allocation failure\");\n\tinitBuf(srcBuf, w, h, pf, flags);\n\tif(*dstBuf && *dstSize>0) memset(*dstBuf, 0, *dstSize);\n\n\tt=gettime();\n\tif(yuv==YUVENCODE)\n\t{\n\t\t_tj(tjEncodeYUV2(handle, srcBuf, w, 0, h, pf, *dstBuf, subsamp, flags));\n\t}\n\telse\n\t{\n\t\tif(!alloc)\n\t\t{\n\t\t\tflags|=TJFLAG_NOREALLOC;\n\t\t\t*dstSize=(yuv==YUVENCODE? tjBufSizeYUV(w, h, subsamp)\n\t\t\t\t: tjBufSize(w, h, subsamp));\n\t\t}\n\t\t_tj(tjCompress2(handle, srcBuf, w, 0, h, pf, dstBuf, dstSize, subsamp,\n\t\t\tjpegQual, flags));\n\t}\n\tt=gettime()-t;\n\n\tif(yuv==YUVENCODE)\n\t\tsnprintf(tempStr, 1024, \"%s_enc_%s_%s_%s.yuv\", basename, pixFormatStr[pf],\n\t\t\t(flags&TJFLAG_BOTTOMUP)? \"BU\":\"TD\", subName[subsamp]);\n\telse\n\t\tsnprintf(tempStr, 1024, \"%s_enc_%s_%s_%s_Q%d.jpg\", basename,\n\t\t\tpixFormatStr[pf], (flags&TJFLAG_BOTTOMUP)? \"BU\":\"TD\", subName[subsamp],\n\t\t\tjpegQual);\n\twriteJPEG(*dstBuf, *dstSize, tempStr);\n\tif(yuv==YUVENCODE)\n\t{\n\t\tif(checkBufYUV(*dstBuf, w, h, subsamp)) printf(\"Passed.\");\n\t\telse printf(\"FAILED!\");\n\t}\n\telse printf(\"Done.\");\n\tprintf(\"  %f ms\\n  Result in %s\\n\", t*1000., tempStr);\n\n\tbailout:\n\tif(srcBuf) free(srcBuf);\n}\n\n\nvoid _decompTest(tjhandle handle, unsigned char *jpegBuf,\n\tunsigned long jpegSize, int w, int h, int pf, char *basename, int subsamp,\n\tint flags, tjscalingfactor sf)\n{\n\tunsigned char *dstBuf=NULL;\n\tint _hdrw=0, _hdrh=0, _hdrsubsamp=-1;  double t;\n\tint scaledWidth=TJSCALED(w, sf);\n\tint scaledHeight=TJSCALED(h, sf);\n\tunsigned long dstSize=0;\n\n\tif(yuv==YUVENCODE) return;\n\n\tif(yuv==YUVDECODE)\n\t\tprintf(\"JPEG -> YUV %s ... \", subNameLong[subsamp]);\n\telse\n\t{\n\t\tprintf(\"JPEG -> %s %s \", pixFormatStr[pf],\n\t\t\t(flags&TJFLAG_BOTTOMUP)? \"Bottom-Up\":\"Top-Down \");\n\t\tif(sf.num!=1 || sf.denom!=1)\n\t\t\tprintf(\"%d/%d ... \", sf.num, sf.denom);\n\t\telse printf(\"... \");\n\t}\n\n\t_tj(tjDecompressHeader2(handle, jpegBuf, jpegSize, &_hdrw, &_hdrh,\n\t\t&_hdrsubsamp));\n\tif(_hdrw!=w || _hdrh!=h || _hdrsubsamp!=subsamp)\n\t\t_throw(\"Incorrect JPEG header\");\n\n\tif(yuv==YUVDECODE) dstSize=tjBufSizeYUV(w, h, subsamp);\n\telse dstSize=scaledWidth*scaledHeight*tjPixelSize[pf];\n\tif((dstBuf=(unsigned char *)malloc(dstSize))==NULL)\n\t\t_throw(\"Memory allocation failure\");\n\tmemset(dstBuf, 0, dstSize);\n\n\tt=gettime();\n\tif(yuv==YUVDECODE)\n\t{\n\t\t_tj(tjDecompressToYUV(handle, jpegBuf, jpegSize, dstBuf, flags));\n\t}\n\telse\n\t{\n\t\t_tj(tjDecompress2(handle, jpegBuf, jpegSize, dstBuf, scaledWidth, 0,\n\t\t\tscaledHeight, pf, flags));\n\t}\n\tt=gettime()-t;\n\n\tif(yuv==YUVDECODE)\n\t{\n\t\tif(checkBufYUV(dstBuf, w, h, subsamp)) printf(\"Passed.\");\n\t\telse printf(\"FAILED!\");\n\t}\n\telse\n\t{\n\t\tif(checkBuf(dstBuf, scaledWidth, scaledHeight, pf, subsamp, sf, flags))\n\t\t\tprintf(\"Passed.\");\n\t\telse printf(\"FAILED!\");\n\t}\n\tprintf(\"  %f ms\\n\", t*1000.);\n\n\tbailout:\n\tif(dstBuf) free(dstBuf);\n}\n\n\nvoid decompTest(tjhandle handle, unsigned char *jpegBuf,\n\tunsigned long jpegSize, int w, int h, int pf, char *basename, int subsamp,\n\tint flags)\n{\n\tint i, n=0;\n\ttjscalingfactor *sf=tjGetScalingFactors(&n), sf1={1, 1};\n\tif(!sf || !n) _throwtj();\n\n\tif((subsamp==TJSAMP_444 || subsamp==TJSAMP_GRAY) && !yuv)\n\t{\n\t\tfor(i=0; i<n; i++)\n\t\t\t_decompTest(handle, jpegBuf, jpegSize, w, h, pf, basename, subsamp,\n\t\t\t\tflags, sf[i]);\n\t}\n\telse\n\t\t_decompTest(handle, jpegBuf, jpegSize, w, h, pf, basename, subsamp, flags,\n\t\t\tsf1);\n\n\tbailout:\n\treturn;\n}\n\n\nvoid doTest(int w, int h, const int *formats, int nformats, int subsamp,\n\tchar *basename)\n{\n\ttjhandle chandle=NULL, dhandle=NULL;\n\tunsigned char *dstBuf=NULL;\n\tunsigned long size=0;  int pfi, pf, i;\n\n\tif(!alloc)\n\t{\n\t\tsize=(yuv==YUVENCODE? tjBufSizeYUV(w, h, subsamp)\n\t\t\t: tjBufSize(w, h, subsamp));\n\t\tif((dstBuf=(unsigned char *)tjAlloc(size))==NULL)\n\t\t\t_throw(\"Memory allocation failure.\");\n\t}\n\n\tif((chandle=tjInitCompress())==NULL || (dhandle=tjInitDecompress())==NULL)\n\t\t_throwtj();\n\n\tfor(pfi=0; pfi<nformats; pfi++)\n\t{\n\t\tfor(i=0; i<2; i++)\n\t\t{\n\t\t\tint flags=0;\n\t\t\tif(subsamp==TJSAMP_422 || subsamp==TJSAMP_420 || subsamp==TJSAMP_440)\n\t\t\t\tflags|=TJFLAG_FASTUPSAMPLE;\n\t\t\tif(i==1)\n\t\t\t{\n\t\t\t\tif(yuv==YUVDECODE) goto bailout;\n\t\t\t\telse flags|=TJFLAG_BOTTOMUP;\n\t\t\t}\n\t\t\tpf=formats[pfi];\n\t\t\tcompTest(chandle, &dstBuf, &size, w, h, pf, basename, subsamp, 100,\n\t\t\t\tflags);\n\t\t\tdecompTest(dhandle, dstBuf, size, w, h, pf, basename, subsamp,\n\t\t\t\tflags);\n\t\t\tif(pf>=TJPF_RGBX && pf<=TJPF_XRGB)\n\t\t\t{\n\t\t\t\tprintf(\"\\n\");\n\t\t\t\tdecompTest(dhandle, dstBuf, size, w, h, pf+(TJPF_RGBA-TJPF_RGBX),\n\t\t\t\t\tbasename, subsamp, flags);\n\t\t\t}\n\t\t\tprintf(\"\\n\");\n\t\t}\n\t}\n\tprintf(\"--------------------\\n\\n\");\n\n\tbailout:\n\tif(chandle) tjDestroy(chandle);\n\tif(dhandle) tjDestroy(dhandle);\n\n\tif(dstBuf) tjFree(dstBuf);\n}\n\n\nvoid bufSizeTest(void)\n{\n\tint w, h, i, subsamp;\n\tunsigned char *srcBuf=NULL, *dstBuf=NULL;\n\ttjhandle handle=NULL;\n\tunsigned long dstSize=0;\n\n\tif((handle=tjInitCompress())==NULL) _throwtj();\n\n\tprintf(\"Buffer size regression test\\n\");\n\tfor(subsamp=0; subsamp<TJ_NUMSAMP; subsamp++)\n\t{\n\t\tfor(w=1; w<48; w++)\n\t\t{\n\t\t\tint maxh=(w==1)? 2048:48;\n\t\t\tfor(h=1; h<maxh; h++)\n\t\t\t{\n\t\t\t\tif(h%100==0) printf(\"%.4d x %.4d\\b\\b\\b\\b\\b\\b\\b\\b\\b\\b\\b\", w, h);\n\t\t\t\tif((srcBuf=(unsigned char *)malloc(w*h*4))==NULL)\n\t\t\t\t\t_throw(\"Memory allocation failure\");\n\t\t\t\tif(!alloc || yuv==YUVENCODE)\n\t\t\t\t{\n\t\t\t\t\tif(yuv==YUVENCODE) dstSize=tjBufSizeYUV(w, h, subsamp);\n\t\t\t\t\telse dstSize=tjBufSize(w, h, subsamp);\n\t\t\t\t\tif((dstBuf=(unsigned char *)tjAlloc(dstSize))==NULL)\n\t\t\t\t\t\t_throw(\"Memory allocation failure\");\n\t\t\t\t}\n\n\t\t\t\tfor(i=0; i<w*h*4; i++)\n\t\t\t\t{\n\t\t\t\t\tif(random()<RAND_MAX/2) srcBuf[i]=0;\n\t\t\t\t\telse srcBuf[i]=255;\n\t\t\t\t}\n\n\t\t\t\tif(yuv==YUVENCODE)\n\t\t\t\t{\n\t\t\t\t\t_tj(tjEncodeYUV2(handle, srcBuf, w, 0, h, TJPF_BGRX, dstBuf, subsamp,\n\t\t\t\t\t\t0));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t_tj(tjCompress2(handle, srcBuf, w, 0, h, TJPF_BGRX, &dstBuf,\n\t\t\t\t\t\t&dstSize, subsamp, 100, alloc? 0:TJFLAG_NOREALLOC));\n\t\t\t\t}\n\t\t\t\tfree(srcBuf);  srcBuf=NULL;\n\t\t\t\ttjFree(dstBuf);  dstBuf=NULL;\n\n\t\t\t\tif((srcBuf=(unsigned char *)malloc(h*w*4))==NULL)\n\t\t\t\t\t_throw(\"Memory allocation failure\");\n\t\t\t\tif(!alloc || yuv==YUVENCODE)\n\t\t\t\t{\n\t\t\t\t\tif(yuv==YUVENCODE) dstSize=tjBufSizeYUV(h, w, subsamp);\n\t\t\t\t\telse dstSize=tjBufSize(h, w, subsamp);\n\t\t\t\t\tif((dstBuf=(unsigned char *)tjAlloc(dstSize))==NULL)\n\t\t\t\t\t\t_throw(\"Memory allocation failure\");\n\t\t\t\t}\n\n\t\t\t\tfor(i=0; i<h*w*4; i++)\n\t\t\t\t{\n\t\t\t\t\tif(random()<RAND_MAX/2) srcBuf[i]=0;\n\t\t\t\t\telse srcBuf[i]=255;\n\t\t\t\t}\n\n\t\t\t\tif(yuv==YUVENCODE)\n\t\t\t\t{\n\t\t\t\t\t_tj(tjEncodeYUV2(handle, srcBuf, h, 0, w, TJPF_BGRX, dstBuf, subsamp,\n\t\t\t\t\t\t0));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t_tj(tjCompress2(handle, srcBuf, h, 0, w, TJPF_BGRX, &dstBuf,\n\t\t\t\t\t\t&dstSize, subsamp, 100, alloc? 0:TJFLAG_NOREALLOC));\n\t\t\t\t}\n\t\t\t\tfree(srcBuf);  srcBuf=NULL;\n\t\t\t\ttjFree(dstBuf);  dstBuf=NULL;\n\t\t\t}\n\t\t}\n\t}\n\tprintf(\"Done.      \\n\");\n\n\tbailout:\n\tif(srcBuf) free(srcBuf);\n\tif(dstBuf) free(dstBuf);\n\tif(handle) tjDestroy(handle);\n}\n\n\nint main(int argc, char *argv[])\n{\n\tint doyuv=0, i;\n\t#ifdef _WIN32\n\tsrand((unsigned int)time(NULL));\n\t#endif\n\tif(argc>1)\n\t{\n\t\tfor(i=1; i<argc; i++)\n\t\t{\n\t\t\tif(!strcasecmp(argv[i], \"-yuv\")) doyuv=1;\n\t\t\tif(!strcasecmp(argv[i], \"-alloc\")) alloc=1;\n\t\t\tif(!strncasecmp(argv[i], \"-h\", 2) || !strcasecmp(argv[i], \"-?\"))\n\t\t\t\tusage(argv[0]);\n\t\t}\n\t}\n\tif(alloc) printf(\"Testing automatic buffer allocation\\n\");\n\tif(doyuv) {yuv=YUVENCODE;  alloc=0;}\n\tdoTest(35, 39, _3byteFormats, 2, TJSAMP_444, \"test\");\n\tdoTest(39, 41, _4byteFormats, 4, TJSAMP_444, \"test\");\n\tdoTest(41, 35, _3byteFormats, 2, TJSAMP_422, \"test\");\n\tdoTest(35, 39, _4byteFormats, 4, TJSAMP_422, \"test\");\n\tdoTest(39, 41, _3byteFormats, 2, TJSAMP_420, \"test\");\n\tdoTest(41, 35, _4byteFormats, 4, TJSAMP_420, \"test\");\n\tdoTest(35, 39, _3byteFormats, 2, TJSAMP_440, \"test\");\n\tdoTest(39, 41, _4byteFormats, 4, TJSAMP_440, \"test\");\n\tdoTest(35, 39, _onlyGray, 1, TJSAMP_GRAY, \"test\");\n\tdoTest(39, 41, _3byteFormats, 2, TJSAMP_GRAY, \"test\");\n\tdoTest(41, 35, _4byteFormats, 4, TJSAMP_GRAY, \"test\");\n\tbufSizeTest();\n\tif(doyuv)\n\t{\n\t\tprintf(\"\\n--------------------\\n\\n\");\n\t\tyuv=YUVDECODE;\n\t\tdoTest(48, 48, _onlyRGB, 1, TJSAMP_444, \"test_yuv0\");\n\t\tdoTest(35, 39, _onlyRGB, 1, TJSAMP_444, \"test_yuv1\");\n\t\tdoTest(48, 48, _onlyRGB, 1, TJSAMP_422, \"test_yuv0\");\n\t\tdoTest(39, 41, _onlyRGB, 1, TJSAMP_422, \"test_yuv1\");\n\t\tdoTest(48, 48, _onlyRGB, 1, TJSAMP_420, \"test_yuv0\");\n\t\tdoTest(41, 35, _onlyRGB, 1, TJSAMP_420, \"test_yuv1\");\n\t\tdoTest(48, 48, _onlyRGB, 1, TJSAMP_440, \"test_yuv0\");\n\t\tdoTest(35, 39, _onlyRGB, 1, TJSAMP_440, \"test_yuv1\");\n\t\tdoTest(48, 48, _onlyRGB, 1, TJSAMP_GRAY, \"test_yuv0\");\n\t\tdoTest(35, 39, _onlyRGB, 1, TJSAMP_GRAY, \"test_yuv1\");\n\t\tdoTest(48, 48, _onlyGray, 1, TJSAMP_GRAY, \"test_yuv0\");\n\t\tdoTest(39, 41, _onlyGray, 1, TJSAMP_GRAY, \"test_yuv1\");\n\t}\n\n\treturn exitStatus;\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/tjutil.c",
    "content": "/*\n * Copyright (C)2011 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifdef _WIN32\n\n#include <windows.h>\n\nstatic double getfreq(void)\n{\n\tLARGE_INTEGER freq;\n\tif(!QueryPerformanceFrequency(&freq)) return 0.0;\n\treturn (double)freq.QuadPart;\n}\n\nstatic double f=-1.0;\n\ndouble gettime(void)\n{\n\tLARGE_INTEGER t;\n\tif(f<0.0) f=getfreq();\n\tif(f==0.0) return (double)GetTickCount()/1000.;\n\telse\n\t{\n\t\tQueryPerformanceCounter(&t);\n\t\treturn (double)t.QuadPart/f;\n\t}\n}\n\n#else\n\n#include <stdlib.h>\n#include <sys/time.h>\n\ndouble gettime(void)\n{\n\tstruct timeval tv;\n\tif(gettimeofday(&tv, NULL)<0) return 0.0;\n\telse return (double)tv.tv_sec+((double)tv.tv_usec/1000000.);\n}\n\n#endif\n"
  },
  {
    "path": "ext/libjpeg-turbo/tjutil.h",
    "content": "/*\n * Copyright (C)2011 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifdef _WIN32\n\t#ifndef __MINGW32__\n\t\t#include <stdio.h>\n\t\t#define snprintf(str, n, format, ...)  \\\n\t\t\t_snprintf_s(str, n, _TRUNCATE, format, __VA_ARGS__)\n\t#endif\n\t#define strcasecmp stricmp\n\t#define strncasecmp strnicmp\n#endif\n\n#ifndef min\n #define min(a,b) ((a)<(b)?(a):(b))\n#endif\n\n#ifndef max\n #define max(a,b) ((a)>(b)?(a):(b))\n#endif\n\nextern double gettime(void);\n"
  },
  {
    "path": "ext/libjpeg-turbo/transupp.c",
    "content": "/*\n * transupp.c\n *\n * This file was part of the Independent JPEG Group's software:\n * Copyright (C) 1997-2011, Thomas G. Lane, Guido Vollbeding.\n * libjpeg-turbo Modifications:\n * Copyright (C) 2010, D. R. Commander.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains image transformation routines and other utility code\n * used by the jpegtran sample application.  These are NOT part of the core\n * JPEG library.  But we keep these routines separate from jpegtran.c to\n * ease the task of maintaining jpegtran-like programs that have other user\n * interfaces.\n */\n\n/* Although this file really shouldn't have access to the library internals,\n * it's helpful to let it call jround_up() and jcopy_block_row().\n */\n#define JPEG_INTERNALS\n\n#include \"jinclude.h\"\n#include \"jpeglib.h\"\n#include \"transupp.h\"\t\t/* My own external interface */\n#include \"jpegcomp.h\"\n#include <ctype.h>\t\t/* to declare isdigit() */\n\n\n#if JPEG_LIB_VERSION >= 70\n#define dstinfo_min_DCT_h_scaled_size dstinfo->min_DCT_h_scaled_size\n#define dstinfo_min_DCT_v_scaled_size dstinfo->min_DCT_v_scaled_size\n#else\n#define dstinfo_min_DCT_h_scaled_size DCTSIZE\n#define dstinfo_min_DCT_v_scaled_size DCTSIZE\n#endif\n\n\n#if TRANSFORMS_SUPPORTED\n\n/*\n * Lossless image transformation routines.  These routines work on DCT\n * coefficient arrays and thus do not require any lossy decompression\n * or recompression of the image.\n * Thanks to Guido Vollbeding for the initial design and code of this feature,\n * and to Ben Jackson for introducing the cropping feature.\n *\n * Horizontal flipping is done in-place, using a single top-to-bottom\n * pass through the virtual source array.  It will thus be much the\n * fastest option for images larger than main memory.\n *\n * The other routines require a set of destination virtual arrays, so they\n * need twice as much memory as jpegtran normally does.  The destination\n * arrays are always written in normal scan order (top to bottom) because\n * the virtual array manager expects this.  The source arrays will be scanned\n * in the corresponding order, which means multiple passes through the source\n * arrays for most of the transforms.  That could result in much thrashing\n * if the image is larger than main memory.\n *\n * If cropping or trimming is involved, the destination arrays may be smaller\n * than the source arrays.  Note it is not possible to do horizontal flip\n * in-place when a nonzero Y crop offset is specified, since we'd have to move\n * data from one block row to another but the virtual array manager doesn't\n * guarantee we can touch more than one row at a time.  So in that case,\n * we have to use a separate destination array.\n *\n * Some notes about the operating environment of the individual transform\n * routines:\n * 1. Both the source and destination virtual arrays are allocated from the\n *    source JPEG object, and therefore should be manipulated by calling the\n *    source's memory manager.\n * 2. The destination's component count should be used.  It may be smaller\n *    than the source's when forcing to grayscale.\n * 3. Likewise the destination's sampling factors should be used.  When\n *    forcing to grayscale the destination's sampling factors will be all 1,\n *    and we may as well take that as the effective iMCU size.\n * 4. When \"trim\" is in effect, the destination's dimensions will be the\n *    trimmed values but the source's will be untrimmed.\n * 5. When \"crop\" is in effect, the destination's dimensions will be the\n *    cropped values but the source's will be uncropped.  Each transform\n *    routine is responsible for picking up source data starting at the\n *    correct X and Y offset for the crop region.  (The X and Y offsets\n *    passed to the transform routines are measured in iMCU blocks of the\n *    destination.)\n * 6. All the routines assume that the source and destination buffers are\n *    padded out to a full iMCU boundary.  This is true, although for the\n *    source buffer it is an undocumented property of jdcoefct.c.\n */\n\n\nLOCAL(void)\ndo_crop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n\t jvirt_barray_ptr *src_coef_arrays,\n\t jvirt_barray_ptr *dst_coef_arrays)\n/* Crop.  This is only used when no rotate/flip is requested with the crop. */\n{\n  JDIMENSION dst_blk_y, x_crop_blocks, y_crop_blocks;\n  int ci, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  jpeg_component_info *compptr;\n\n  /* We simply have to copy the right amount of data (the destination's\n   * image size) starting at the given X and Y offsets in the source.\n   */\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n\t dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n\t (JDIMENSION) compptr->v_samp_factor, TRUE);\n      src_buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t dst_blk_y + y_crop_blocks,\n\t (JDIMENSION) compptr->v_samp_factor, FALSE);\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n\tjcopy_block_row(src_buffer[offset_y] + x_crop_blocks,\n\t\t\tdst_buffer[offset_y],\n\t\t\tcompptr->width_in_blocks);\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_flip_h_no_crop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t\t   JDIMENSION x_crop_offset,\n\t\t   jvirt_barray_ptr *src_coef_arrays)\n/* Horizontal flip; done in-place, so no separate dest array is required.\n * NB: this only works when y_crop_offset is zero.\n */\n{\n  JDIMENSION MCU_cols, comp_width, blk_x, blk_y, x_crop_blocks;\n  int ci, k, offset_y;\n  JBLOCKARRAY buffer;\n  JCOEFPTR ptr1, ptr2;\n  JCOEF temp1, temp2;\n  jpeg_component_info *compptr;\n\n  /* Horizontal mirroring of DCT blocks is accomplished by swapping\n   * pairs of blocks in-place.  Within a DCT block, we perform horizontal\n   * mirroring by changing the signs of odd-numbered columns.\n   * Partial iMCUs at the right edge are left untouched.\n   */\n  MCU_cols = srcinfo->output_width /\n    (dstinfo->max_h_samp_factor * dstinfo_min_DCT_h_scaled_size);\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_width = MCU_cols * compptr->h_samp_factor;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    for (blk_y = 0; blk_y < compptr->height_in_blocks;\n\t blk_y += compptr->v_samp_factor) {\n      buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, src_coef_arrays[ci], blk_y,\n\t (JDIMENSION) compptr->v_samp_factor, TRUE);\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n\t/* Do the mirroring */\n\tfor (blk_x = 0; blk_x * 2 < comp_width; blk_x++) {\n\t  ptr1 = buffer[offset_y][blk_x];\n\t  ptr2 = buffer[offset_y][comp_width - blk_x - 1];\n\t  /* this unrolled loop doesn't need to know which row it's on... */\n\t  for (k = 0; k < DCTSIZE2; k += 2) {\n\t    temp1 = *ptr1;\t/* swap even column */\n\t    temp2 = *ptr2;\n\t    *ptr1++ = temp2;\n\t    *ptr2++ = temp1;\n\t    temp1 = *ptr1;\t/* swap odd column with sign change */\n\t    temp2 = *ptr2;\n\t    *ptr1++ = -temp2;\n\t    *ptr2++ = -temp1;\n\t  }\n\t}\n\tif (x_crop_blocks > 0) {\n\t  /* Now left-justify the portion of the data to be kept.\n\t   * We can't use a single jcopy_block_row() call because that routine\n\t   * depends on memcpy(), whose behavior is unspecified for overlapping\n\t   * source and destination areas.  Sigh.\n\t   */\n\t  for (blk_x = 0; blk_x < compptr->width_in_blocks; blk_x++) {\n\t    jcopy_block_row(buffer[offset_y] + blk_x + x_crop_blocks,\n\t\t\t    buffer[offset_y] + blk_x,\n\t\t\t    (JDIMENSION) 1);\n\t  }\n\t}\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_flip_h (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t   JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n\t   jvirt_barray_ptr *src_coef_arrays,\n\t   jvirt_barray_ptr *dst_coef_arrays)\n/* Horizontal flip in general cropping case */\n{\n  JDIMENSION MCU_cols, comp_width, dst_blk_x, dst_blk_y;\n  JDIMENSION x_crop_blocks, y_crop_blocks;\n  int ci, k, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  JBLOCKROW src_row_ptr, dst_row_ptr;\n  JCOEFPTR src_ptr, dst_ptr;\n  jpeg_component_info *compptr;\n\n  /* Here we must output into a separate array because we can't touch\n   * different rows of a single virtual array simultaneously.  Otherwise,\n   * this is essentially the same as the routine above.\n   */\n  MCU_cols = srcinfo->output_width /\n    (dstinfo->max_h_samp_factor * dstinfo_min_DCT_h_scaled_size);\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_width = MCU_cols * compptr->h_samp_factor;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n\t dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n\t (JDIMENSION) compptr->v_samp_factor, TRUE);\n      src_buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t dst_blk_y + y_crop_blocks,\n\t (JDIMENSION) compptr->v_samp_factor, FALSE);\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n\tdst_row_ptr = dst_buffer[offset_y];\n\tsrc_row_ptr = src_buffer[offset_y];\n\tfor (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {\n\t  if (x_crop_blocks + dst_blk_x < comp_width) {\n\t    /* Do the mirrorable blocks */\n\t    dst_ptr = dst_row_ptr[dst_blk_x];\n\t    src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];\n\t    /* this unrolled loop doesn't need to know which row it's on... */\n\t    for (k = 0; k < DCTSIZE2; k += 2) {\n\t      *dst_ptr++ = *src_ptr++;\t /* copy even column */\n\t      *dst_ptr++ = - *src_ptr++; /* copy odd column with sign change */\n\t    }\n\t  } else {\n\t    /* Copy last partial block(s) verbatim */\n\t    jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,\n\t\t\t    dst_row_ptr + dst_blk_x,\n\t\t\t    (JDIMENSION) 1);\n\t  }\n\t}\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_flip_v (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t   JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n\t   jvirt_barray_ptr *src_coef_arrays,\n\t   jvirt_barray_ptr *dst_coef_arrays)\n/* Vertical flip */\n{\n  JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;\n  JDIMENSION x_crop_blocks, y_crop_blocks;\n  int ci, i, j, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  JBLOCKROW src_row_ptr, dst_row_ptr;\n  JCOEFPTR src_ptr, dst_ptr;\n  jpeg_component_info *compptr;\n\n  /* We output into a separate array because we can't touch different\n   * rows of the source virtual array simultaneously.  Otherwise, this\n   * is a pretty straightforward analog of horizontal flip.\n   * Within a DCT block, vertical mirroring is done by changing the signs\n   * of odd-numbered rows.\n   * Partial iMCUs at the bottom edge are copied verbatim.\n   */\n  MCU_rows = srcinfo->output_height /\n    (dstinfo->max_v_samp_factor * dstinfo_min_DCT_v_scaled_size);\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_height = MCU_rows * compptr->v_samp_factor;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n\t dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n\t (JDIMENSION) compptr->v_samp_factor, TRUE);\n      if (y_crop_blocks + dst_blk_y < comp_height) {\n\t/* Row is within the mirrorable area. */\n\tsrc_buffer = (*srcinfo->mem->access_virt_barray)\n\t  ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t   comp_height - y_crop_blocks - dst_blk_y -\n\t   (JDIMENSION) compptr->v_samp_factor,\n\t   (JDIMENSION) compptr->v_samp_factor, FALSE);\n      } else {\n\t/* Bottom-edge blocks will be copied verbatim. */\n\tsrc_buffer = (*srcinfo->mem->access_virt_barray)\n\t  ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t   dst_blk_y + y_crop_blocks,\n\t   (JDIMENSION) compptr->v_samp_factor, FALSE);\n      }\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n\tif (y_crop_blocks + dst_blk_y < comp_height) {\n\t  /* Row is within the mirrorable area. */\n\t  dst_row_ptr = dst_buffer[offset_y];\n\t  src_row_ptr = src_buffer[compptr->v_samp_factor - offset_y - 1];\n\t  src_row_ptr += x_crop_blocks;\n\t  for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;\n\t       dst_blk_x++) {\n\t    dst_ptr = dst_row_ptr[dst_blk_x];\n\t    src_ptr = src_row_ptr[dst_blk_x];\n\t    for (i = 0; i < DCTSIZE; i += 2) {\n\t      /* copy even row */\n\t      for (j = 0; j < DCTSIZE; j++)\n\t\t*dst_ptr++ = *src_ptr++;\n\t      /* copy odd row with sign change */\n\t      for (j = 0; j < DCTSIZE; j++)\n\t\t*dst_ptr++ = - *src_ptr++;\n\t    }\n\t  }\n\t} else {\n\t  /* Just copy row verbatim. */\n\t  jcopy_block_row(src_buffer[offset_y] + x_crop_blocks,\n\t\t\t  dst_buffer[offset_y],\n\t\t\t  compptr->width_in_blocks);\n\t}\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_transpose (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t      JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n\t      jvirt_barray_ptr *src_coef_arrays,\n\t      jvirt_barray_ptr *dst_coef_arrays)\n/* Transpose source into destination */\n{\n  JDIMENSION dst_blk_x, dst_blk_y, x_crop_blocks, y_crop_blocks;\n  int ci, i, j, offset_x, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  JCOEFPTR src_ptr, dst_ptr;\n  jpeg_component_info *compptr;\n\n  /* Transposing pixels within a block just requires transposing the\n   * DCT coefficients.\n   * Partial iMCUs at the edges require no special treatment; we simply\n   * process all the available DCT blocks for every component.\n   */\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n\t dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n\t (JDIMENSION) compptr->v_samp_factor, TRUE);\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n\tfor (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;\n\t     dst_blk_x += compptr->h_samp_factor) {\n\t  src_buffer = (*srcinfo->mem->access_virt_barray)\n\t    ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t     dst_blk_x + x_crop_blocks,\n\t     (JDIMENSION) compptr->h_samp_factor, FALSE);\n\t  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {\n\t    dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];\n\t    src_ptr = src_buffer[offset_x][dst_blk_y + offset_y + y_crop_blocks];\n\t    for (i = 0; i < DCTSIZE; i++)\n\t      for (j = 0; j < DCTSIZE; j++)\n\t\tdst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n\t  }\n\t}\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_rot_90 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t   JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n\t   jvirt_barray_ptr *src_coef_arrays,\n\t   jvirt_barray_ptr *dst_coef_arrays)\n/* 90 degree rotation is equivalent to\n *   1. Transposing the image;\n *   2. Horizontal mirroring.\n * These two steps are merged into a single processing routine.\n */\n{\n  JDIMENSION MCU_cols, comp_width, dst_blk_x, dst_blk_y;\n  JDIMENSION x_crop_blocks, y_crop_blocks;\n  int ci, i, j, offset_x, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  JCOEFPTR src_ptr, dst_ptr;\n  jpeg_component_info *compptr;\n\n  /* Because of the horizontal mirror step, we can't process partial iMCUs\n   * at the (output) right edge properly.  They just get transposed and\n   * not mirrored.\n   */\n  MCU_cols = srcinfo->output_height /\n    (dstinfo->max_h_samp_factor * dstinfo_min_DCT_h_scaled_size);\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_width = MCU_cols * compptr->h_samp_factor;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n\t dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n\t (JDIMENSION) compptr->v_samp_factor, TRUE);\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n\tfor (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;\n\t     dst_blk_x += compptr->h_samp_factor) {\n\t  if (x_crop_blocks + dst_blk_x < comp_width) {\n\t    /* Block is within the mirrorable area. */\n\t    src_buffer = (*srcinfo->mem->access_virt_barray)\n\t      ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t       comp_width - x_crop_blocks - dst_blk_x -\n\t       (JDIMENSION) compptr->h_samp_factor,\n\t       (JDIMENSION) compptr->h_samp_factor, FALSE);\n\t  } else {\n\t    /* Edge blocks are transposed but not mirrored. */\n\t    src_buffer = (*srcinfo->mem->access_virt_barray)\n\t      ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t       dst_blk_x + x_crop_blocks,\n\t       (JDIMENSION) compptr->h_samp_factor, FALSE);\n\t  }\n\t  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {\n\t    dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];\n\t    if (x_crop_blocks + dst_blk_x < comp_width) {\n\t      /* Block is within the mirrorable area. */\n\t      src_ptr = src_buffer[compptr->h_samp_factor - offset_x - 1]\n\t\t[dst_blk_y + offset_y + y_crop_blocks];\n\t      for (i = 0; i < DCTSIZE; i++) {\n\t\tfor (j = 0; j < DCTSIZE; j++)\n\t\t  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n\t\ti++;\n\t\tfor (j = 0; j < DCTSIZE; j++)\n\t\t  dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];\n\t      }\n\t    } else {\n\t      /* Edge blocks are transposed but not mirrored. */\n\t      src_ptr = src_buffer[offset_x]\n\t\t[dst_blk_y + offset_y + y_crop_blocks];\n\t      for (i = 0; i < DCTSIZE; i++)\n\t\tfor (j = 0; j < DCTSIZE; j++)\n\t\t  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n\t    }\n\t  }\n\t}\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_rot_270 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t    JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n\t    jvirt_barray_ptr *src_coef_arrays,\n\t    jvirt_barray_ptr *dst_coef_arrays)\n/* 270 degree rotation is equivalent to\n *   1. Horizontal mirroring;\n *   2. Transposing the image.\n * These two steps are merged into a single processing routine.\n */\n{\n  JDIMENSION MCU_rows, comp_height, dst_blk_x, dst_blk_y;\n  JDIMENSION x_crop_blocks, y_crop_blocks;\n  int ci, i, j, offset_x, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  JCOEFPTR src_ptr, dst_ptr;\n  jpeg_component_info *compptr;\n\n  /* Because of the horizontal mirror step, we can't process partial iMCUs\n   * at the (output) bottom edge properly.  They just get transposed and\n   * not mirrored.\n   */\n  MCU_rows = srcinfo->output_width /\n    (dstinfo->max_v_samp_factor * dstinfo_min_DCT_v_scaled_size);\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_height = MCU_rows * compptr->v_samp_factor;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n\t dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n\t (JDIMENSION) compptr->v_samp_factor, TRUE);\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n\tfor (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;\n\t     dst_blk_x += compptr->h_samp_factor) {\n\t  src_buffer = (*srcinfo->mem->access_virt_barray)\n\t    ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t     dst_blk_x + x_crop_blocks,\n\t     (JDIMENSION) compptr->h_samp_factor, FALSE);\n\t  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {\n\t    dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];\n\t    if (y_crop_blocks + dst_blk_y < comp_height) {\n\t      /* Block is within the mirrorable area. */\n\t      src_ptr = src_buffer[offset_x]\n\t\t[comp_height - y_crop_blocks - dst_blk_y - offset_y - 1];\n\t      for (i = 0; i < DCTSIZE; i++) {\n\t\tfor (j = 0; j < DCTSIZE; j++) {\n\t\t  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n\t\t  j++;\n\t\t  dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];\n\t\t}\n\t      }\n\t    } else {\n\t      /* Edge blocks are transposed but not mirrored. */\n\t      src_ptr = src_buffer[offset_x]\n\t\t[dst_blk_y + offset_y + y_crop_blocks];\n\t      for (i = 0; i < DCTSIZE; i++)\n\t\tfor (j = 0; j < DCTSIZE; j++)\n\t\t  dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n\t    }\n\t  }\n\t}\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_rot_180 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t    JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n\t    jvirt_barray_ptr *src_coef_arrays,\n\t    jvirt_barray_ptr *dst_coef_arrays)\n/* 180 degree rotation is equivalent to\n *   1. Vertical mirroring;\n *   2. Horizontal mirroring.\n * These two steps are merged into a single processing routine.\n */\n{\n  JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;\n  JDIMENSION x_crop_blocks, y_crop_blocks;\n  int ci, i, j, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  JBLOCKROW src_row_ptr, dst_row_ptr;\n  JCOEFPTR src_ptr, dst_ptr;\n  jpeg_component_info *compptr;\n\n  MCU_cols = srcinfo->output_width /\n    (dstinfo->max_h_samp_factor * dstinfo_min_DCT_h_scaled_size);\n  MCU_rows = srcinfo->output_height /\n    (dstinfo->max_v_samp_factor * dstinfo_min_DCT_v_scaled_size);\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_width = MCU_cols * compptr->h_samp_factor;\n    comp_height = MCU_rows * compptr->v_samp_factor;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n\t dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n\t (JDIMENSION) compptr->v_samp_factor, TRUE);\n      if (y_crop_blocks + dst_blk_y < comp_height) {\n\t/* Row is within the vertically mirrorable area. */\n\tsrc_buffer = (*srcinfo->mem->access_virt_barray)\n\t  ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t   comp_height - y_crop_blocks - dst_blk_y -\n\t   (JDIMENSION) compptr->v_samp_factor,\n\t   (JDIMENSION) compptr->v_samp_factor, FALSE);\n      } else {\n\t/* Bottom-edge rows are only mirrored horizontally. */\n\tsrc_buffer = (*srcinfo->mem->access_virt_barray)\n\t  ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t   dst_blk_y + y_crop_blocks,\n\t   (JDIMENSION) compptr->v_samp_factor, FALSE);\n      }\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n\tdst_row_ptr = dst_buffer[offset_y];\n\tif (y_crop_blocks + dst_blk_y < comp_height) {\n\t  /* Row is within the mirrorable area. */\n\t  src_row_ptr = src_buffer[compptr->v_samp_factor - offset_y - 1];\n\t  for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {\n\t    dst_ptr = dst_row_ptr[dst_blk_x];\n\t    if (x_crop_blocks + dst_blk_x < comp_width) {\n\t      /* Process the blocks that can be mirrored both ways. */\n\t      src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];\n\t      for (i = 0; i < DCTSIZE; i += 2) {\n\t\t/* For even row, negate every odd column. */\n\t\tfor (j = 0; j < DCTSIZE; j += 2) {\n\t\t  *dst_ptr++ = *src_ptr++;\n\t\t  *dst_ptr++ = - *src_ptr++;\n\t\t}\n\t\t/* For odd row, negate every even column. */\n\t\tfor (j = 0; j < DCTSIZE; j += 2) {\n\t\t  *dst_ptr++ = - *src_ptr++;\n\t\t  *dst_ptr++ = *src_ptr++;\n\t\t}\n\t      }\n\t    } else {\n\t      /* Any remaining right-edge blocks are only mirrored vertically. */\n\t      src_ptr = src_row_ptr[x_crop_blocks + dst_blk_x];\n\t      for (i = 0; i < DCTSIZE; i += 2) {\n\t\tfor (j = 0; j < DCTSIZE; j++)\n\t\t  *dst_ptr++ = *src_ptr++;\n\t\tfor (j = 0; j < DCTSIZE; j++)\n\t\t  *dst_ptr++ = - *src_ptr++;\n\t      }\n\t    }\n\t  }\n\t} else {\n\t  /* Remaining rows are just mirrored horizontally. */\n\t  src_row_ptr = src_buffer[offset_y];\n\t  for (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks; dst_blk_x++) {\n\t    if (x_crop_blocks + dst_blk_x < comp_width) {\n\t      /* Process the blocks that can be mirrored. */\n\t      dst_ptr = dst_row_ptr[dst_blk_x];\n\t      src_ptr = src_row_ptr[comp_width - x_crop_blocks - dst_blk_x - 1];\n\t      for (i = 0; i < DCTSIZE2; i += 2) {\n\t\t*dst_ptr++ = *src_ptr++;\n\t\t*dst_ptr++ = - *src_ptr++;\n\t      }\n\t    } else {\n\t      /* Any remaining right-edge blocks are only copied. */\n\t      jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,\n\t\t\t      dst_row_ptr + dst_blk_x,\n\t\t\t      (JDIMENSION) 1);\n\t    }\n\t  }\n\t}\n      }\n    }\n  }\n}\n\n\nLOCAL(void)\ndo_transverse (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t       JDIMENSION x_crop_offset, JDIMENSION y_crop_offset,\n\t       jvirt_barray_ptr *src_coef_arrays,\n\t       jvirt_barray_ptr *dst_coef_arrays)\n/* Transverse transpose is equivalent to\n *   1. 180 degree rotation;\n *   2. Transposition;\n * or\n *   1. Horizontal mirroring;\n *   2. Transposition;\n *   3. Horizontal mirroring.\n * These steps are merged into a single processing routine.\n */\n{\n  JDIMENSION MCU_cols, MCU_rows, comp_width, comp_height, dst_blk_x, dst_blk_y;\n  JDIMENSION x_crop_blocks, y_crop_blocks;\n  int ci, i, j, offset_x, offset_y;\n  JBLOCKARRAY src_buffer, dst_buffer;\n  JCOEFPTR src_ptr, dst_ptr;\n  jpeg_component_info *compptr;\n\n  MCU_cols = srcinfo->output_height /\n    (dstinfo->max_h_samp_factor * dstinfo_min_DCT_h_scaled_size);\n  MCU_rows = srcinfo->output_width /\n    (dstinfo->max_v_samp_factor * dstinfo_min_DCT_v_scaled_size);\n\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    comp_width = MCU_cols * compptr->h_samp_factor;\n    comp_height = MCU_rows * compptr->v_samp_factor;\n    x_crop_blocks = x_crop_offset * compptr->h_samp_factor;\n    y_crop_blocks = y_crop_offset * compptr->v_samp_factor;\n    for (dst_blk_y = 0; dst_blk_y < compptr->height_in_blocks;\n\t dst_blk_y += compptr->v_samp_factor) {\n      dst_buffer = (*srcinfo->mem->access_virt_barray)\n\t((j_common_ptr) srcinfo, dst_coef_arrays[ci], dst_blk_y,\n\t (JDIMENSION) compptr->v_samp_factor, TRUE);\n      for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {\n\tfor (dst_blk_x = 0; dst_blk_x < compptr->width_in_blocks;\n\t     dst_blk_x += compptr->h_samp_factor) {\n\t  if (x_crop_blocks + dst_blk_x < comp_width) {\n\t    /* Block is within the mirrorable area. */\n\t    src_buffer = (*srcinfo->mem->access_virt_barray)\n\t      ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t       comp_width - x_crop_blocks - dst_blk_x -\n\t       (JDIMENSION) compptr->h_samp_factor,\n\t       (JDIMENSION) compptr->h_samp_factor, FALSE);\n\t  } else {\n\t    src_buffer = (*srcinfo->mem->access_virt_barray)\n\t      ((j_common_ptr) srcinfo, src_coef_arrays[ci],\n\t       dst_blk_x + x_crop_blocks,\n\t       (JDIMENSION) compptr->h_samp_factor, FALSE);\n\t  }\n\t  for (offset_x = 0; offset_x < compptr->h_samp_factor; offset_x++) {\n\t    dst_ptr = dst_buffer[offset_y][dst_blk_x + offset_x];\n\t    if (y_crop_blocks + dst_blk_y < comp_height) {\n\t      if (x_crop_blocks + dst_blk_x < comp_width) {\n\t\t/* Block is within the mirrorable area. */\n\t\tsrc_ptr = src_buffer[compptr->h_samp_factor - offset_x - 1]\n\t\t  [comp_height - y_crop_blocks - dst_blk_y - offset_y - 1];\n\t\tfor (i = 0; i < DCTSIZE; i++) {\n\t\t  for (j = 0; j < DCTSIZE; j++) {\n\t\t    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n\t\t    j++;\n\t\t    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];\n\t\t  }\n\t\t  i++;\n\t\t  for (j = 0; j < DCTSIZE; j++) {\n\t\t    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];\n\t\t    j++;\n\t\t    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n\t\t  }\n\t\t}\n\t      } else {\n\t\t/* Right-edge blocks are mirrored in y only */\n\t\tsrc_ptr = src_buffer[offset_x]\n\t\t  [comp_height - y_crop_blocks - dst_blk_y - offset_y - 1];\n\t\tfor (i = 0; i < DCTSIZE; i++) {\n\t\t  for (j = 0; j < DCTSIZE; j++) {\n\t\t    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n\t\t    j++;\n\t\t    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];\n\t\t  }\n\t\t}\n\t      }\n\t    } else {\n\t      if (x_crop_blocks + dst_blk_x < comp_width) {\n\t\t/* Bottom-edge blocks are mirrored in x only */\n\t\tsrc_ptr = src_buffer[compptr->h_samp_factor - offset_x - 1]\n\t\t  [dst_blk_y + offset_y + y_crop_blocks];\n\t\tfor (i = 0; i < DCTSIZE; i++) {\n\t\t  for (j = 0; j < DCTSIZE; j++)\n\t\t    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n\t\t  i++;\n\t\t  for (j = 0; j < DCTSIZE; j++)\n\t\t    dst_ptr[j*DCTSIZE+i] = -src_ptr[i*DCTSIZE+j];\n\t\t}\n\t      } else {\n\t\t/* At lower right corner, just transpose, no mirroring */\n\t\tsrc_ptr = src_buffer[offset_x]\n\t\t  [dst_blk_y + offset_y + y_crop_blocks];\n\t\tfor (i = 0; i < DCTSIZE; i++)\n\t\t  for (j = 0; j < DCTSIZE; j++)\n\t\t    dst_ptr[j*DCTSIZE+i] = src_ptr[i*DCTSIZE+j];\n\t      }\n\t    }\n\t  }\n\t}\n      }\n    }\n  }\n}\n\n\n/* Parse an unsigned integer: subroutine for jtransform_parse_crop_spec.\n * Returns TRUE if valid integer found, FALSE if not.\n * *strptr is advanced over the digit string, and *result is set to its value.\n */\n\nLOCAL(boolean)\njt_read_integer (const char ** strptr, JDIMENSION * result)\n{\n  const char * ptr = *strptr;\n  JDIMENSION val = 0;\n\n  for (; isdigit(*ptr); ptr++) {\n    val = val * 10 + (JDIMENSION) (*ptr - '0');\n  }\n  *result = val;\n  if (ptr == *strptr)\n    return FALSE;\t\t/* oops, no digits */\n  *strptr = ptr;\n  return TRUE;\n}\n\n\n/* Parse a crop specification (written in X11 geometry style).\n * The routine returns TRUE if the spec string is valid, FALSE if not.\n *\n * The crop spec string should have the format\n *\t<width>[f]x<height>[f]{+-}<xoffset>{+-}<yoffset>\n * where width, height, xoffset, and yoffset are unsigned integers.\n * Each of the elements can be omitted to indicate a default value.\n * (A weakness of this style is that it is not possible to omit xoffset\n * while specifying yoffset, since they look alike.)\n *\n * This code is loosely based on XParseGeometry from the X11 distribution.\n */\n\nGLOBAL(boolean)\njtransform_parse_crop_spec (jpeg_transform_info *info, const char *spec)\n{\n  info->crop = FALSE;\n  info->crop_width_set = JCROP_UNSET;\n  info->crop_height_set = JCROP_UNSET;\n  info->crop_xoffset_set = JCROP_UNSET;\n  info->crop_yoffset_set = JCROP_UNSET;\n\n  if (isdigit(*spec)) {\n    /* fetch width */\n    if (! jt_read_integer(&spec, &info->crop_width))\n      return FALSE;\n    if (*spec == 'f' || *spec == 'F') {\n      spec++;\n      info->crop_width_set = JCROP_FORCE;\n    } else\n      info->crop_width_set = JCROP_POS;\n  }\n  if (*spec == 'x' || *spec == 'X') {\n    /* fetch height */\n    spec++;\n    if (! jt_read_integer(&spec, &info->crop_height))\n      return FALSE;\n    if (*spec == 'f' || *spec == 'F') {\n      spec++;\n      info->crop_height_set = JCROP_FORCE;\n    } else\n      info->crop_height_set = JCROP_POS;\n  }\n  if (*spec == '+' || *spec == '-') {\n    /* fetch xoffset */\n    info->crop_xoffset_set = (*spec == '-') ? JCROP_NEG : JCROP_POS;\n    spec++;\n    if (! jt_read_integer(&spec, &info->crop_xoffset))\n      return FALSE;\n  }\n  if (*spec == '+' || *spec == '-') {\n    /* fetch yoffset */\n    info->crop_yoffset_set = (*spec == '-') ? JCROP_NEG : JCROP_POS;\n    spec++;\n    if (! jt_read_integer(&spec, &info->crop_yoffset))\n      return FALSE;\n  }\n  /* We had better have gotten to the end of the string. */\n  if (*spec != '\\0')\n    return FALSE;\n  info->crop = TRUE;\n  return TRUE;\n}\n\n\n/* Trim off any partial iMCUs on the indicated destination edge */\n\nLOCAL(void)\ntrim_right_edge (jpeg_transform_info *info, JDIMENSION full_width)\n{\n  JDIMENSION MCU_cols;\n\n  MCU_cols = info->output_width / info->iMCU_sample_width;\n  if (MCU_cols > 0 && info->x_crop_offset + MCU_cols ==\n      full_width / info->iMCU_sample_width)\n    info->output_width = MCU_cols * info->iMCU_sample_width;\n}\n\nLOCAL(void)\ntrim_bottom_edge (jpeg_transform_info *info, JDIMENSION full_height)\n{\n  JDIMENSION MCU_rows;\n\n  MCU_rows = info->output_height / info->iMCU_sample_height;\n  if (MCU_rows > 0 && info->y_crop_offset + MCU_rows ==\n      full_height / info->iMCU_sample_height)\n    info->output_height = MCU_rows * info->iMCU_sample_height;\n}\n\n\n/* Request any required workspace.\n *\n * This routine figures out the size that the output image will be\n * (which implies that all the transform parameters must be set before\n * it is called).\n *\n * We allocate the workspace virtual arrays from the source decompression\n * object, so that all the arrays (both the original data and the workspace)\n * will be taken into account while making memory management decisions.\n * Hence, this routine must be called after jpeg_read_header (which reads\n * the image dimensions) and before jpeg_read_coefficients (which realizes\n * the source's virtual arrays).\n *\n * This function returns FALSE right away if -perfect is given\n * and transformation is not perfect.  Otherwise returns TRUE.\n */\n\nGLOBAL(boolean)\njtransform_request_workspace (j_decompress_ptr srcinfo,\n\t\t\t      jpeg_transform_info *info)\n{\n  jvirt_barray_ptr *coef_arrays;\n  boolean need_workspace, transpose_it;\n  jpeg_component_info *compptr;\n  JDIMENSION xoffset, yoffset;\n  JDIMENSION width_in_iMCUs, height_in_iMCUs;\n  JDIMENSION width_in_blocks, height_in_blocks;\n  int ci, h_samp_factor, v_samp_factor;\n\n  /* Determine number of components in output image */\n  if (info->force_grayscale &&\n      srcinfo->jpeg_color_space == JCS_YCbCr &&\n      srcinfo->num_components == 3)\n    /* We'll only process the first component */\n    info->num_components = 1;\n  else\n    /* Process all the components */\n    info->num_components = srcinfo->num_components;\n\n  /* Compute output image dimensions and related values. */\n#if JPEG_LIB_VERSION >= 80\n  jpeg_core_output_dimensions(srcinfo);\n#else\n  srcinfo->output_width = srcinfo->image_width;\n  srcinfo->output_height = srcinfo->image_height;\n#endif\n\n  /* Return right away if -perfect is given and transformation is not perfect.\n   */\n  if (info->perfect) {\n    if (info->num_components == 1) {\n      if (!jtransform_perfect_transform(srcinfo->output_width,\n\t  srcinfo->output_height,\n\t  srcinfo->_min_DCT_h_scaled_size,\n\t  srcinfo->_min_DCT_v_scaled_size,\n\t  info->transform))\n\treturn FALSE;\n    } else {\n      if (!jtransform_perfect_transform(srcinfo->output_width,\n\t  srcinfo->output_height,\n\t  srcinfo->max_h_samp_factor * srcinfo->_min_DCT_h_scaled_size,\n\t  srcinfo->max_v_samp_factor * srcinfo->_min_DCT_v_scaled_size,\n\t  info->transform))\n\treturn FALSE;\n    }\n  }\n\n  /* If there is only one output component, force the iMCU size to be 1;\n   * else use the source iMCU size.  (This allows us to do the right thing\n   * when reducing color to grayscale, and also provides a handy way of\n   * cleaning up \"funny\" grayscale images whose sampling factors are not 1x1.)\n   */\n  switch (info->transform) {\n  case JXFORM_TRANSPOSE:\n  case JXFORM_TRANSVERSE:\n  case JXFORM_ROT_90:\n  case JXFORM_ROT_270:\n    info->output_width = srcinfo->output_height;\n    info->output_height = srcinfo->output_width;\n    if (info->num_components == 1) {\n      info->iMCU_sample_width = srcinfo->_min_DCT_v_scaled_size;\n      info->iMCU_sample_height = srcinfo->_min_DCT_h_scaled_size;\n    } else {\n      info->iMCU_sample_width =\n\tsrcinfo->max_v_samp_factor * srcinfo->_min_DCT_v_scaled_size;\n      info->iMCU_sample_height =\n\tsrcinfo->max_h_samp_factor * srcinfo->_min_DCT_h_scaled_size;\n    }\n    break;\n  default:\n    info->output_width = srcinfo->output_width;\n    info->output_height = srcinfo->output_height;\n    if (info->num_components == 1) {\n      info->iMCU_sample_width = srcinfo->_min_DCT_h_scaled_size;\n      info->iMCU_sample_height = srcinfo->_min_DCT_v_scaled_size;\n    } else {\n      info->iMCU_sample_width =\n\tsrcinfo->max_h_samp_factor * srcinfo->_min_DCT_h_scaled_size;\n      info->iMCU_sample_height =\n\tsrcinfo->max_v_samp_factor * srcinfo->_min_DCT_v_scaled_size;\n    }\n    break;\n  }\n\n  /* If cropping has been requested, compute the crop area's position and\n   * dimensions, ensuring that its upper left corner falls at an iMCU boundary.\n   */\n  if (info->crop) {\n    /* Insert default values for unset crop parameters */\n    if (info->crop_xoffset_set == JCROP_UNSET)\n      info->crop_xoffset = 0;\t/* default to +0 */\n    if (info->crop_yoffset_set == JCROP_UNSET)\n      info->crop_yoffset = 0;\t/* default to +0 */\n    if (info->crop_xoffset >= info->output_width ||\n\tinfo->crop_yoffset >= info->output_height)\n      ERREXIT(srcinfo, JERR_BAD_CROP_SPEC);\n    if (info->crop_width_set == JCROP_UNSET)\n      info->crop_width = info->output_width - info->crop_xoffset;\n    if (info->crop_height_set == JCROP_UNSET)\n      info->crop_height = info->output_height - info->crop_yoffset;\n    /* Ensure parameters are valid */\n    if (info->crop_width <= 0 || info->crop_width > info->output_width ||\n\tinfo->crop_height <= 0 || info->crop_height > info->output_height ||\n\tinfo->crop_xoffset > info->output_width - info->crop_width ||\n\tinfo->crop_yoffset > info->output_height - info->crop_height)\n      ERREXIT(srcinfo, JERR_BAD_CROP_SPEC);\n    /* Convert negative crop offsets into regular offsets */\n    if (info->crop_xoffset_set == JCROP_NEG)\n      xoffset = info->output_width - info->crop_width - info->crop_xoffset;\n    else\n      xoffset = info->crop_xoffset;\n    if (info->crop_yoffset_set == JCROP_NEG)\n      yoffset = info->output_height - info->crop_height - info->crop_yoffset;\n    else\n      yoffset = info->crop_yoffset;\n    /* Now adjust so that upper left corner falls at an iMCU boundary */\n    if (info->crop_width_set == JCROP_FORCE)\n      info->output_width = info->crop_width;\n    else\n      info->output_width =\n        info->crop_width + (xoffset % info->iMCU_sample_width);\n    if (info->crop_height_set == JCROP_FORCE)\n      info->output_height = info->crop_height;\n    else\n      info->output_height =\n        info->crop_height + (yoffset % info->iMCU_sample_height);\n    /* Save x/y offsets measured in iMCUs */\n    info->x_crop_offset = xoffset / info->iMCU_sample_width;\n    info->y_crop_offset = yoffset / info->iMCU_sample_height;\n  } else {\n    info->x_crop_offset = 0;\n    info->y_crop_offset = 0;\n  }\n\n  /* Figure out whether we need workspace arrays,\n   * and if so whether they are transposed relative to the source.\n   */\n  need_workspace = FALSE;\n  transpose_it = FALSE;\n  switch (info->transform) {\n  case JXFORM_NONE:\n    if (info->x_crop_offset != 0 || info->y_crop_offset != 0)\n      need_workspace = TRUE;\n    /* No workspace needed if neither cropping nor transforming */\n    break;\n  case JXFORM_FLIP_H:\n    if (info->trim)\n      trim_right_edge(info, srcinfo->output_width);\n    if (info->y_crop_offset != 0 || info->slow_hflip)\n      need_workspace = TRUE;\n    /* do_flip_h_no_crop doesn't need a workspace array */\n    break;\n  case JXFORM_FLIP_V:\n    if (info->trim)\n      trim_bottom_edge(info, srcinfo->output_height);\n    /* Need workspace arrays having same dimensions as source image. */\n    need_workspace = TRUE;\n    break;\n  case JXFORM_TRANSPOSE:\n    /* transpose does NOT have to trim anything */\n    /* Need workspace arrays having transposed dimensions. */\n    need_workspace = TRUE;\n    transpose_it = TRUE;\n    break;\n  case JXFORM_TRANSVERSE:\n    if (info->trim) {\n      trim_right_edge(info, srcinfo->output_height);\n      trim_bottom_edge(info, srcinfo->output_width);\n    }\n    /* Need workspace arrays having transposed dimensions. */\n    need_workspace = TRUE;\n    transpose_it = TRUE;\n    break;\n  case JXFORM_ROT_90:\n    if (info->trim)\n      trim_right_edge(info, srcinfo->output_height);\n    /* Need workspace arrays having transposed dimensions. */\n    need_workspace = TRUE;\n    transpose_it = TRUE;\n    break;\n  case JXFORM_ROT_180:\n    if (info->trim) {\n      trim_right_edge(info, srcinfo->output_width);\n      trim_bottom_edge(info, srcinfo->output_height);\n    }\n    /* Need workspace arrays having same dimensions as source image. */\n    need_workspace = TRUE;\n    break;\n  case JXFORM_ROT_270:\n    if (info->trim)\n      trim_bottom_edge(info, srcinfo->output_width);\n    /* Need workspace arrays having transposed dimensions. */\n    need_workspace = TRUE;\n    transpose_it = TRUE;\n    break;\n  }\n\n  /* Allocate workspace if needed.\n   * Note that we allocate arrays padded out to the next iMCU boundary,\n   * so that transform routines need not worry about missing edge blocks.\n   */\n  if (need_workspace) {\n    coef_arrays = (jvirt_barray_ptr *)\n      (*srcinfo->mem->alloc_small) ((j_common_ptr) srcinfo, JPOOL_IMAGE,\n\t\tSIZEOF(jvirt_barray_ptr) * info->num_components);\n    width_in_iMCUs = (JDIMENSION)\n      jdiv_round_up((long) info->output_width,\n\t\t    (long) info->iMCU_sample_width);\n    height_in_iMCUs = (JDIMENSION)\n      jdiv_round_up((long) info->output_height,\n\t\t    (long) info->iMCU_sample_height);\n    for (ci = 0; ci < info->num_components; ci++) {\n      compptr = srcinfo->comp_info + ci;\n      if (info->num_components == 1) {\n\t/* we're going to force samp factors to 1x1 in this case */\n\th_samp_factor = v_samp_factor = 1;\n      } else if (transpose_it) {\n\th_samp_factor = compptr->v_samp_factor;\n\tv_samp_factor = compptr->h_samp_factor;\n      } else {\n\th_samp_factor = compptr->h_samp_factor;\n\tv_samp_factor = compptr->v_samp_factor;\n      }\n      width_in_blocks = width_in_iMCUs * h_samp_factor;\n      height_in_blocks = height_in_iMCUs * v_samp_factor;\n      coef_arrays[ci] = (*srcinfo->mem->request_virt_barray)\n\t((j_common_ptr) srcinfo, JPOOL_IMAGE, FALSE,\n\t width_in_blocks, height_in_blocks, (JDIMENSION) v_samp_factor);\n    }\n    info->workspace_coef_arrays = coef_arrays;\n  } else\n    info->workspace_coef_arrays = NULL;\n\n  return TRUE;\n}\n\n\n/* Transpose destination image parameters */\n\nLOCAL(void)\ntranspose_critical_parameters (j_compress_ptr dstinfo)\n{\n  int tblno, i, j, ci, itemp;\n  jpeg_component_info *compptr;\n  JQUANT_TBL *qtblptr;\n  JDIMENSION jtemp;\n  UINT16 qtemp;\n\n  /* Transpose image dimensions */\n  jtemp = dstinfo->image_width;\n  dstinfo->image_width = dstinfo->image_height;\n  dstinfo->image_height = jtemp;\n#if JPEG_LIB_VERSION >= 70\n  itemp = dstinfo->min_DCT_h_scaled_size;\n  dstinfo->min_DCT_h_scaled_size = dstinfo->min_DCT_v_scaled_size;\n  dstinfo->min_DCT_v_scaled_size = itemp;\n#endif\n\n  /* Transpose sampling factors */\n  for (ci = 0; ci < dstinfo->num_components; ci++) {\n    compptr = dstinfo->comp_info + ci;\n    itemp = compptr->h_samp_factor;\n    compptr->h_samp_factor = compptr->v_samp_factor;\n    compptr->v_samp_factor = itemp;\n  }\n\n  /* Transpose quantization tables */\n  for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {\n    qtblptr = dstinfo->quant_tbl_ptrs[tblno];\n    if (qtblptr != NULL) {\n      for (i = 0; i < DCTSIZE; i++) {\n\tfor (j = 0; j < i; j++) {\n\t  qtemp = qtblptr->quantval[i*DCTSIZE+j];\n\t  qtblptr->quantval[i*DCTSIZE+j] = qtblptr->quantval[j*DCTSIZE+i];\n\t  qtblptr->quantval[j*DCTSIZE+i] = qtemp;\n\t}\n      }\n    }\n  }\n}\n\n\n/* Adjust Exif image parameters.\n *\n * We try to adjust the Tags ExifImageWidth and ExifImageHeight if possible.\n */\n\n#if JPEG_LIB_VERSION >= 70\nLOCAL(void)\nadjust_exif_parameters (JOCTET FAR * data, unsigned int length,\n\t\t\tJDIMENSION new_width, JDIMENSION new_height)\n{\n  boolean is_motorola; /* Flag for byte order */\n  unsigned int number_of_tags, tagnum;\n  unsigned int firstoffset, offset;\n  JDIMENSION new_value;\n\n  if (length < 12) return; /* Length of an IFD entry */\n\n  /* Discover byte order */\n  if (GETJOCTET(data[0]) == 0x49 && GETJOCTET(data[1]) == 0x49)\n    is_motorola = FALSE;\n  else if (GETJOCTET(data[0]) == 0x4D && GETJOCTET(data[1]) == 0x4D)\n    is_motorola = TRUE;\n  else\n    return;\n\n  /* Check Tag Mark */\n  if (is_motorola) {\n    if (GETJOCTET(data[2]) != 0) return;\n    if (GETJOCTET(data[3]) != 0x2A) return;\n  } else {\n    if (GETJOCTET(data[3]) != 0) return;\n    if (GETJOCTET(data[2]) != 0x2A) return;\n  }\n\n  /* Get first IFD offset (offset to IFD0) */\n  if (is_motorola) {\n    if (GETJOCTET(data[4]) != 0) return;\n    if (GETJOCTET(data[5]) != 0) return;\n    firstoffset = GETJOCTET(data[6]);\n    firstoffset <<= 8;\n    firstoffset += GETJOCTET(data[7]);\n  } else {\n    if (GETJOCTET(data[7]) != 0) return;\n    if (GETJOCTET(data[6]) != 0) return;\n    firstoffset = GETJOCTET(data[5]);\n    firstoffset <<= 8;\n    firstoffset += GETJOCTET(data[4]);\n  }\n  if (firstoffset > length - 2) return; /* check end of data segment */\n\n  /* Get the number of directory entries contained in this IFD */\n  if (is_motorola) {\n    number_of_tags = GETJOCTET(data[firstoffset]);\n    number_of_tags <<= 8;\n    number_of_tags += GETJOCTET(data[firstoffset+1]);\n  } else {\n    number_of_tags = GETJOCTET(data[firstoffset+1]);\n    number_of_tags <<= 8;\n    number_of_tags += GETJOCTET(data[firstoffset]);\n  }\n  if (number_of_tags == 0) return;\n  firstoffset += 2;\n\n  /* Search for ExifSubIFD offset Tag in IFD0 */\n  for (;;) {\n    if (firstoffset > length - 12) return; /* check end of data segment */\n    /* Get Tag number */\n    if (is_motorola) {\n      tagnum = GETJOCTET(data[firstoffset]);\n      tagnum <<= 8;\n      tagnum += GETJOCTET(data[firstoffset+1]);\n    } else {\n      tagnum = GETJOCTET(data[firstoffset+1]);\n      tagnum <<= 8;\n      tagnum += GETJOCTET(data[firstoffset]);\n    }\n    if (tagnum == 0x8769) break; /* found ExifSubIFD offset Tag */\n    if (--number_of_tags == 0) return;\n    firstoffset += 12;\n  }\n\n  /* Get the ExifSubIFD offset */\n  if (is_motorola) {\n    if (GETJOCTET(data[firstoffset+8]) != 0) return;\n    if (GETJOCTET(data[firstoffset+9]) != 0) return;\n    offset = GETJOCTET(data[firstoffset+10]);\n    offset <<= 8;\n    offset += GETJOCTET(data[firstoffset+11]);\n  } else {\n    if (GETJOCTET(data[firstoffset+11]) != 0) return;\n    if (GETJOCTET(data[firstoffset+10]) != 0) return;\n    offset = GETJOCTET(data[firstoffset+9]);\n    offset <<= 8;\n    offset += GETJOCTET(data[firstoffset+8]);\n  }\n  if (offset > length - 2) return; /* check end of data segment */\n\n  /* Get the number of directory entries contained in this SubIFD */\n  if (is_motorola) {\n    number_of_tags = GETJOCTET(data[offset]);\n    number_of_tags <<= 8;\n    number_of_tags += GETJOCTET(data[offset+1]);\n  } else {\n    number_of_tags = GETJOCTET(data[offset+1]);\n    number_of_tags <<= 8;\n    number_of_tags += GETJOCTET(data[offset]);\n  }\n  if (number_of_tags < 2) return;\n  offset += 2;\n\n  /* Search for ExifImageWidth and ExifImageHeight Tags in this SubIFD */\n  do {\n    if (offset > length - 12) return; /* check end of data segment */\n    /* Get Tag number */\n    if (is_motorola) {\n      tagnum = GETJOCTET(data[offset]);\n      tagnum <<= 8;\n      tagnum += GETJOCTET(data[offset+1]);\n    } else {\n      tagnum = GETJOCTET(data[offset+1]);\n      tagnum <<= 8;\n      tagnum += GETJOCTET(data[offset]);\n    }\n    if (tagnum == 0xA002 || tagnum == 0xA003) {\n      if (tagnum == 0xA002)\n\tnew_value = new_width; /* ExifImageWidth Tag */\n      else\n\tnew_value = new_height; /* ExifImageHeight Tag */\n      if (is_motorola) {\n\tdata[offset+2] = 0; /* Format = unsigned long (4 octets) */\n\tdata[offset+3] = 4;\n\tdata[offset+4] = 0; /* Number Of Components = 1 */\n\tdata[offset+5] = 0;\n\tdata[offset+6] = 0;\n\tdata[offset+7] = 1;\n\tdata[offset+8] = 0;\n\tdata[offset+9] = 0;\n\tdata[offset+10] = (JOCTET)((new_value >> 8) & 0xFF);\n\tdata[offset+11] = (JOCTET)(new_value & 0xFF);\n      } else {\n\tdata[offset+2] = 4; /* Format = unsigned long (4 octets) */\n\tdata[offset+3] = 0;\n\tdata[offset+4] = 1; /* Number Of Components = 1 */\n\tdata[offset+5] = 0;\n\tdata[offset+6] = 0;\n\tdata[offset+7] = 0;\n\tdata[offset+8] = (JOCTET)(new_value & 0xFF);\n\tdata[offset+9] = (JOCTET)((new_value >> 8) & 0xFF);\n\tdata[offset+10] = 0;\n\tdata[offset+11] = 0;\n      }\n    }\n    offset += 12;\n  } while (--number_of_tags);\n}\n#endif\n\n\n/* Adjust output image parameters as needed.\n *\n * This must be called after jpeg_copy_critical_parameters()\n * and before jpeg_write_coefficients().\n *\n * The return value is the set of virtual coefficient arrays to be written\n * (either the ones allocated by jtransform_request_workspace, or the\n * original source data arrays).  The caller will need to pass this value\n * to jpeg_write_coefficients().\n */\n\nGLOBAL(jvirt_barray_ptr *)\njtransform_adjust_parameters (j_decompress_ptr srcinfo,\n\t\t\t      j_compress_ptr dstinfo,\n\t\t\t      jvirt_barray_ptr *src_coef_arrays,\n\t\t\t      jpeg_transform_info *info)\n{\n  /* If force-to-grayscale is requested, adjust destination parameters */\n  if (info->force_grayscale) {\n    /* First, ensure we have YCbCr or grayscale data, and that the source's\n     * Y channel is full resolution.  (No reasonable person would make Y\n     * be less than full resolution, so actually coping with that case\n     * isn't worth extra code space.  But we check it to avoid crashing.)\n     */\n    if (((dstinfo->jpeg_color_space == JCS_YCbCr &&\n\t  dstinfo->num_components == 3) ||\n\t (dstinfo->jpeg_color_space == JCS_GRAYSCALE &&\n\t  dstinfo->num_components == 1)) &&\n\tsrcinfo->comp_info[0].h_samp_factor == srcinfo->max_h_samp_factor &&\n\tsrcinfo->comp_info[0].v_samp_factor == srcinfo->max_v_samp_factor) {\n      /* We use jpeg_set_colorspace to make sure subsidiary settings get fixed\n       * properly.  Among other things, it sets the target h_samp_factor &\n       * v_samp_factor to 1, which typically won't match the source.\n       * We have to preserve the source's quantization table number, however.\n       */\n      int sv_quant_tbl_no = dstinfo->comp_info[0].quant_tbl_no;\n      jpeg_set_colorspace(dstinfo, JCS_GRAYSCALE);\n      dstinfo->comp_info[0].quant_tbl_no = sv_quant_tbl_no;\n    } else {\n      /* Sorry, can't do it */\n      ERREXIT(dstinfo, JERR_CONVERSION_NOTIMPL);\n    }\n  } else if (info->num_components == 1) {\n    /* For a single-component source, we force the destination sampling factors\n     * to 1x1, with or without force_grayscale.  This is useful because some\n     * decoders choke on grayscale images with other sampling factors.\n     */\n    dstinfo->comp_info[0].h_samp_factor = 1;\n    dstinfo->comp_info[0].v_samp_factor = 1;\n  }\n\n  /* Correct the destination's image dimensions as necessary\n   * for rotate/flip, resize, and crop operations.\n   */\n#if JPEG_LIB_VERSION >= 70\n  dstinfo->jpeg_width = info->output_width;\n  dstinfo->jpeg_height = info->output_height;\n#endif\n\n  /* Transpose destination image parameters */\n  switch (info->transform) {\n  case JXFORM_TRANSPOSE:\n  case JXFORM_TRANSVERSE:\n  case JXFORM_ROT_90:\n  case JXFORM_ROT_270:\n#if JPEG_LIB_VERSION < 70\n    dstinfo->image_width = info->output_height;\n    dstinfo->image_height = info->output_width;\n#endif\n    transpose_critical_parameters(dstinfo);\n    break;\n  default:\n#if JPEG_LIB_VERSION < 70\n    dstinfo->image_width = info->output_width;\n    dstinfo->image_height = info->output_height;\n#endif\n    break;\n  }\n\n  /* Adjust Exif properties */\n  if (srcinfo->marker_list != NULL &&\n      srcinfo->marker_list->marker == JPEG_APP0+1 &&\n      srcinfo->marker_list->data_length >= 6 &&\n      GETJOCTET(srcinfo->marker_list->data[0]) == 0x45 &&\n      GETJOCTET(srcinfo->marker_list->data[1]) == 0x78 &&\n      GETJOCTET(srcinfo->marker_list->data[2]) == 0x69 &&\n      GETJOCTET(srcinfo->marker_list->data[3]) == 0x66 &&\n      GETJOCTET(srcinfo->marker_list->data[4]) == 0 &&\n      GETJOCTET(srcinfo->marker_list->data[5]) == 0) {\n    /* Suppress output of JFIF marker */\n    dstinfo->write_JFIF_header = FALSE;\n#if JPEG_LIB_VERSION >= 70\n    /* Adjust Exif image parameters */\n    if (dstinfo->jpeg_width != srcinfo->image_width ||\n\tdstinfo->jpeg_height != srcinfo->image_height)\n      /* Align data segment to start of TIFF structure for parsing */\n      adjust_exif_parameters(srcinfo->marker_list->data + 6,\n\tsrcinfo->marker_list->data_length - 6,\n\tdstinfo->jpeg_width, dstinfo->jpeg_height);\n#endif\n  }\n\n  /* Return the appropriate output data set */\n  if (info->workspace_coef_arrays != NULL)\n    return info->workspace_coef_arrays;\n  return src_coef_arrays;\n}\n\n\n/* Execute the actual transformation, if any.\n *\n * This must be called *after* jpeg_write_coefficients, because it depends\n * on jpeg_write_coefficients to have computed subsidiary values such as\n * the per-component width and height fields in the destination object.\n *\n * Note that some transformations will modify the source data arrays!\n */\n\nGLOBAL(void)\njtransform_execute_transform (j_decompress_ptr srcinfo,\n\t\t\t      j_compress_ptr dstinfo,\n\t\t\t      jvirt_barray_ptr *src_coef_arrays,\n\t\t\t      jpeg_transform_info *info)\n{\n  jvirt_barray_ptr *dst_coef_arrays = info->workspace_coef_arrays;\n\n  /* Note: conditions tested here should match those in switch statement\n   * in jtransform_request_workspace()\n   */\n  switch (info->transform) {\n  case JXFORM_NONE:\n    if (info->x_crop_offset != 0 || info->y_crop_offset != 0)\n      do_crop(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n\t      src_coef_arrays, dst_coef_arrays);\n    break;\n  case JXFORM_FLIP_H:\n    if (info->y_crop_offset != 0 || info->slow_hflip)\n      do_flip_h(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n\t\tsrc_coef_arrays, dst_coef_arrays);\n    else\n      do_flip_h_no_crop(srcinfo, dstinfo, info->x_crop_offset,\n\t\t\tsrc_coef_arrays);\n    break;\n  case JXFORM_FLIP_V:\n    do_flip_v(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n\t      src_coef_arrays, dst_coef_arrays);\n    break;\n  case JXFORM_TRANSPOSE:\n    do_transpose(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n\t\t src_coef_arrays, dst_coef_arrays);\n    break;\n  case JXFORM_TRANSVERSE:\n    do_transverse(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n\t\t  src_coef_arrays, dst_coef_arrays);\n    break;\n  case JXFORM_ROT_90:\n    do_rot_90(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n\t      src_coef_arrays, dst_coef_arrays);\n    break;\n  case JXFORM_ROT_180:\n    do_rot_180(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n\t       src_coef_arrays, dst_coef_arrays);\n    break;\n  case JXFORM_ROT_270:\n    do_rot_270(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,\n\t       src_coef_arrays, dst_coef_arrays);\n    break;\n  }\n}\n\n/* jtransform_perfect_transform\n *\n * Determine whether lossless transformation is perfectly\n * possible for a specified image and transformation.\n *\n * Inputs:\n *   image_width, image_height: source image dimensions.\n *   MCU_width, MCU_height: pixel dimensions of MCU.\n *   transform: transformation identifier.\n * Parameter sources from initialized jpeg_struct\n * (after reading source header):\n *   image_width = cinfo.image_width\n *   image_height = cinfo.image_height\n *   MCU_width = cinfo.max_h_samp_factor * cinfo.block_size\n *   MCU_height = cinfo.max_v_samp_factor * cinfo.block_size\n * Result:\n *   TRUE = perfect transformation possible\n *   FALSE = perfect transformation not possible\n *           (may use custom action then)\n */\n\nGLOBAL(boolean)\njtransform_perfect_transform(JDIMENSION image_width, JDIMENSION image_height,\n\t\t\t     int MCU_width, int MCU_height,\n\t\t\t     JXFORM_CODE transform)\n{\n  boolean result = TRUE; /* initialize TRUE */\n\n  switch (transform) {\n  case JXFORM_FLIP_H:\n  case JXFORM_ROT_270:\n    if (image_width % (JDIMENSION) MCU_width)\n      result = FALSE;\n    break;\n  case JXFORM_FLIP_V:\n  case JXFORM_ROT_90:\n    if (image_height % (JDIMENSION) MCU_height)\n      result = FALSE;\n    break;\n  case JXFORM_TRANSVERSE:\n  case JXFORM_ROT_180:\n    if (image_width % (JDIMENSION) MCU_width)\n      result = FALSE;\n    if (image_height % (JDIMENSION) MCU_height)\n      result = FALSE;\n    break;\n  default:\n    break;\n  }\n\n  return result;\n}\n\n#endif /* TRANSFORMS_SUPPORTED */\n\n\n/* Setup decompression object to save desired markers in memory.\n * This must be called before jpeg_read_header() to have the desired effect.\n */\n\nGLOBAL(void)\njcopy_markers_setup (j_decompress_ptr srcinfo, JCOPY_OPTION option)\n{\n#ifdef SAVE_MARKERS_SUPPORTED\n  int m;\n\n  /* Save comments except under NONE option */\n  if (option != JCOPYOPT_NONE) {\n    jpeg_save_markers(srcinfo, JPEG_COM, 0xFFFF);\n  }\n  /* Save all types of APPn markers iff ALL option */\n  if (option == JCOPYOPT_ALL) {\n    for (m = 0; m < 16; m++)\n      jpeg_save_markers(srcinfo, JPEG_APP0 + m, 0xFFFF);\n  }\n#endif /* SAVE_MARKERS_SUPPORTED */\n}\n\n/* Copy markers saved in the given source object to the destination object.\n * This should be called just after jpeg_start_compress() or\n * jpeg_write_coefficients().\n * Note that those routines will have written the SOI, and also the\n * JFIF APP0 or Adobe APP14 markers if selected.\n */\n\nGLOBAL(void)\njcopy_markers_execute (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t\t       JCOPY_OPTION option)\n{\n  jpeg_saved_marker_ptr marker;\n\n  /* In the current implementation, we don't actually need to examine the\n   * option flag here; we just copy everything that got saved.\n   * But to avoid confusion, we do not output JFIF and Adobe APP14 markers\n   * if the encoder library already wrote one.\n   */\n  for (marker = srcinfo->marker_list; marker != NULL; marker = marker->next) {\n    if (dstinfo->write_JFIF_header &&\n\tmarker->marker == JPEG_APP0 &&\n\tmarker->data_length >= 5 &&\n\tGETJOCTET(marker->data[0]) == 0x4A &&\n\tGETJOCTET(marker->data[1]) == 0x46 &&\n\tGETJOCTET(marker->data[2]) == 0x49 &&\n\tGETJOCTET(marker->data[3]) == 0x46 &&\n\tGETJOCTET(marker->data[4]) == 0)\n      continue;\t\t\t/* reject duplicate JFIF */\n    if (dstinfo->write_Adobe_marker &&\n\tmarker->marker == JPEG_APP0+14 &&\n\tmarker->data_length >= 5 &&\n\tGETJOCTET(marker->data[0]) == 0x41 &&\n\tGETJOCTET(marker->data[1]) == 0x64 &&\n\tGETJOCTET(marker->data[2]) == 0x6F &&\n\tGETJOCTET(marker->data[3]) == 0x62 &&\n\tGETJOCTET(marker->data[4]) == 0x65)\n      continue;\t\t\t/* reject duplicate Adobe */\n#ifdef NEED_FAR_POINTERS\n    /* We could use jpeg_write_marker if the data weren't FAR... */\n    {\n      unsigned int i;\n      jpeg_write_m_header(dstinfo, marker->marker, marker->data_length);\n      for (i = 0; i < marker->data_length; i++)\n\tjpeg_write_m_byte(dstinfo, marker->data[i]);\n    }\n#else\n    jpeg_write_marker(dstinfo, marker->marker,\n\t\t      marker->data, marker->data_length);\n#endif\n  }\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/transupp.h",
    "content": "/*\n * transupp.h\n *\n * Copyright (C) 1997-2011, Thomas G. Lane, Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains declarations for image transformation routines and\n * other utility code used by the jpegtran sample application.  These are\n * NOT part of the core JPEG library.  But we keep these routines separate\n * from jpegtran.c to ease the task of maintaining jpegtran-like programs\n * that have other user interfaces.\n *\n * NOTE: all the routines declared here have very specific requirements\n * about when they are to be executed during the reading and writing of the\n * source and destination files.  See the comments in transupp.c, or see\n * jpegtran.c for an example of correct usage.\n */\n\n/* If you happen not to want the image transform support, disable it here */\n#ifndef TRANSFORMS_SUPPORTED\n#define TRANSFORMS_SUPPORTED 1\t\t/* 0 disables transform code */\n#endif\n\n/*\n * Although rotating and flipping data expressed as DCT coefficients is not\n * hard, there is an asymmetry in the JPEG format specification for images\n * whose dimensions aren't multiples of the iMCU size.  The right and bottom\n * image edges are padded out to the next iMCU boundary with junk data; but\n * no padding is possible at the top and left edges.  If we were to flip\n * the whole image including the pad data, then pad garbage would become\n * visible at the top and/or left, and real pixels would disappear into the\n * pad margins --- perhaps permanently, since encoders & decoders may not\n * bother to preserve DCT blocks that appear to be completely outside the\n * nominal image area.  So, we have to exclude any partial iMCUs from the\n * basic transformation.\n *\n * Transpose is the only transformation that can handle partial iMCUs at the\n * right and bottom edges completely cleanly.  flip_h can flip partial iMCUs\n * at the bottom, but leaves any partial iMCUs at the right edge untouched.\n * Similarly flip_v leaves any partial iMCUs at the bottom edge untouched.\n * The other transforms are defined as combinations of these basic transforms\n * and process edge blocks in a way that preserves the equivalence.\n *\n * The \"trim\" option causes untransformable partial iMCUs to be dropped;\n * this is not strictly lossless, but it usually gives the best-looking\n * result for odd-size images.  Note that when this option is active,\n * the expected mathematical equivalences between the transforms may not hold.\n * (For example, -rot 270 -trim trims only the bottom edge, but -rot 90 -trim\n * followed by -rot 180 -trim trims both edges.)\n *\n * We also offer a lossless-crop option, which discards data outside a given\n * image region but losslessly preserves what is inside.  Like the rotate and\n * flip transforms, lossless crop is restricted by the JPEG format: the upper\n * left corner of the selected region must fall on an iMCU boundary.  If this\n * does not hold for the given crop parameters, we silently move the upper left\n * corner up and/or left to make it so, simultaneously increasing the region\n * dimensions to keep the lower right crop corner unchanged.  (Thus, the\n * output image covers at least the requested region, but may cover more.)\n * The adjustment of the region dimensions may be optionally disabled.\n *\n * We also provide a lossless-resize option, which is kind of a lossless-crop\n * operation in the DCT coefficient block domain - it discards higher-order\n * coefficients and losslessly preserves lower-order coefficients of a\n * sub-block.\n *\n * Rotate/flip transform, resize, and crop can be requested together in a\n * single invocation.  The crop is applied last --- that is, the crop region\n * is specified in terms of the destination image after transform/resize.\n *\n * We also offer a \"force to grayscale\" option, which simply discards the\n * chrominance channels of a YCbCr image.  This is lossless in the sense that\n * the luminance channel is preserved exactly.  It's not the same kind of\n * thing as the rotate/flip transformations, but it's convenient to handle it\n * as part of this package, mainly because the transformation routines have to\n * be aware of the option to know how many components to work on.\n */\n\n\n/* Short forms of external names for systems with brain-damaged linkers. */\n\n#ifdef NEED_SHORT_EXTERNAL_NAMES\n#define jtransform_parse_crop_spec\tjTrParCrop\n#define jtransform_request_workspace\tjTrRequest\n#define jtransform_adjust_parameters\tjTrAdjust\n#define jtransform_execute_transform\tjTrExec\n#define jtransform_perfect_transform\tjTrPerfect\n#define jcopy_markers_setup\t\tjCMrkSetup\n#define jcopy_markers_execute\t\tjCMrkExec\n#endif /* NEED_SHORT_EXTERNAL_NAMES */\n\n\n/*\n * Codes for supported types of image transformations.\n */\n\ntypedef enum {\n\tJXFORM_NONE,\t\t/* no transformation */\n\tJXFORM_FLIP_H,\t\t/* horizontal flip */\n\tJXFORM_FLIP_V,\t\t/* vertical flip */\n\tJXFORM_TRANSPOSE,\t/* transpose across UL-to-LR axis */\n\tJXFORM_TRANSVERSE,\t/* transpose across UR-to-LL axis */\n\tJXFORM_ROT_90,\t\t/* 90-degree clockwise rotation */\n\tJXFORM_ROT_180,\t\t/* 180-degree rotation */\n\tJXFORM_ROT_270\t\t/* 270-degree clockwise (or 90 ccw) */\n} JXFORM_CODE;\n\n/*\n * Codes for crop parameters, which can individually be unspecified,\n * positive or negative for xoffset or yoffset,\n * positive or forced for width or height.\n */\n\ntypedef enum {\n        JCROP_UNSET,\n        JCROP_POS,\n        JCROP_NEG,\n        JCROP_FORCE\n} JCROP_CODE;\n\n/*\n * Transform parameters struct.\n * NB: application must not change any elements of this struct after\n * calling jtransform_request_workspace.\n */\n\ntypedef struct {\n  /* Options: set by caller */\n  JXFORM_CODE transform;\t/* image transform operator */\n  boolean perfect;\t\t/* if TRUE, fail if partial MCUs are requested */\n  boolean trim;\t\t\t/* if TRUE, trim partial MCUs as needed */\n  boolean force_grayscale;\t/* if TRUE, convert color image to grayscale */\n  boolean crop;\t\t\t/* if TRUE, crop source image */\n  boolean slow_hflip;  /* For best performance, the JXFORM_FLIP_H transform\n                          normally modifies the source coefficients in place.\n                          Setting this to TRUE will instead use a slower,\n                          double-buffered algorithm, which leaves the source\n                          coefficients in tact (necessary if other transformed\n                          images must be generated from the same set of\n                          coefficients. */\n\n  /* Crop parameters: application need not set these unless crop is TRUE.\n   * These can be filled in by jtransform_parse_crop_spec().\n   */\n  JDIMENSION crop_width;\t/* Width of selected region */\n  JCROP_CODE crop_width_set;\t/* (forced disables adjustment) */\n  JDIMENSION crop_height;\t/* Height of selected region */\n  JCROP_CODE crop_height_set;\t/* (forced disables adjustment) */\n  JDIMENSION crop_xoffset;\t/* X offset of selected region */\n  JCROP_CODE crop_xoffset_set;\t/* (negative measures from right edge) */\n  JDIMENSION crop_yoffset;\t/* Y offset of selected region */\n  JCROP_CODE crop_yoffset_set;\t/* (negative measures from bottom edge) */\n\n  /* Internal workspace: caller should not touch these */\n  int num_components;\t\t/* # of components in workspace */\n  jvirt_barray_ptr * workspace_coef_arrays; /* workspace for transformations */\n  JDIMENSION output_width;\t/* cropped destination dimensions */\n  JDIMENSION output_height;\n  JDIMENSION x_crop_offset;\t/* destination crop offsets measured in iMCUs */\n  JDIMENSION y_crop_offset;\n  int iMCU_sample_width;\t/* destination iMCU size */\n  int iMCU_sample_height;\n} jpeg_transform_info;\n\n\n#if TRANSFORMS_SUPPORTED\n\n/* Parse a crop specification (written in X11 geometry style) */\nEXTERN(boolean) jtransform_parse_crop_spec\n\tJPP((jpeg_transform_info *info, const char *spec));\n/* Request any required workspace */\nEXTERN(boolean) jtransform_request_workspace\n\tJPP((j_decompress_ptr srcinfo, jpeg_transform_info *info));\n/* Adjust output image parameters */\nEXTERN(jvirt_barray_ptr *) jtransform_adjust_parameters\n\tJPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t     jvirt_barray_ptr *src_coef_arrays,\n\t     jpeg_transform_info *info));\n/* Execute the actual transformation, if any */\nEXTERN(void) jtransform_execute_transform\n\tJPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t     jvirt_barray_ptr *src_coef_arrays,\n\t     jpeg_transform_info *info));\n/* Determine whether lossless transformation is perfectly\n * possible for a specified image and transformation.\n */\nEXTERN(boolean) jtransform_perfect_transform\n\tJPP((JDIMENSION image_width, JDIMENSION image_height,\n\t     int MCU_width, int MCU_height,\n\t     JXFORM_CODE transform));\n\n/* jtransform_execute_transform used to be called\n * jtransform_execute_transformation, but some compilers complain about\n * routine names that long.  This macro is here to avoid breaking any\n * old source code that uses the original name...\n */\n#define jtransform_execute_transformation\tjtransform_execute_transform\n\n#endif /* TRANSFORMS_SUPPORTED */\n\n\n/*\n * Support for copying optional markers from source to destination file.\n */\n\ntypedef enum {\n\tJCOPYOPT_NONE,\t\t/* copy no optional markers */\n\tJCOPYOPT_COMMENTS,\t/* copy only comment (COM) markers */\n\tJCOPYOPT_ALL\t\t/* copy all optional markers */\n} JCOPY_OPTION;\n\n#define JCOPYOPT_DEFAULT  JCOPYOPT_COMMENTS\t/* recommended default */\n\n/* Setup decompression object to save desired markers in memory */\nEXTERN(void) jcopy_markers_setup\n\tJPP((j_decompress_ptr srcinfo, JCOPY_OPTION option));\n/* Copy markers saved in the given source object to the destination object */\nEXTERN(void) jcopy_markers_execute\n\tJPP((j_decompress_ptr srcinfo, j_compress_ptr dstinfo,\n\t     JCOPY_OPTION option));\n"
  },
  {
    "path": "ext/libjpeg-turbo/turbojpeg-jni.c",
    "content": "/*\n * Copyright (C)2011-2013 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include <stdlib.h>\n#include <string.h>\n#include \"turbojpeg.h\"\n#ifdef WIN32\n#include \"tjutil.h\"\n#endif\n#include <jni.h>\n#include \"java/org_libjpegturbo_turbojpeg_TJCompressor.h\"\n#include \"java/org_libjpegturbo_turbojpeg_TJDecompressor.h\"\n#include \"java/org_libjpegturbo_turbojpeg_TJ.h\"\n\n#define _throw(msg) {  \\\n\tjclass _exccls=(*env)->FindClass(env, \"java/lang/Exception\");  \\\n\tif(!_exccls) goto bailout;  \\\n\t(*env)->ThrowNew(env, _exccls, msg);  \\\n\tgoto bailout;  \\\n}\n\n#define bailif0(f) {if(!(f)) {  \\\n\tchar temps[80];  \\\n\tsnprintf(temps, 80, \"Unexpected NULL condition in line %d\", __LINE__);  \\\n\t_throw(temps);  \\\n}}\n\n#define gethandle()  \\\n\tjclass _cls=(*env)->GetObjectClass(env, obj);  \\\n\tjfieldID _fid;  \\\n\tif(!_cls) goto bailout;  \\\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"handle\", \"J\"));  \\\n\thandle=(tjhandle)(jlong)(*env)->GetLongField(env, obj, _fid);  \\\n\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_bufSize\n\t(JNIEnv *env, jclass cls, jint width, jint height, jint jpegSubsamp)\n{\n\tjint retval=(jint)tjBufSize(width, height, jpegSubsamp);\n\tif(retval==-1) _throw(tjGetErrorStr());\n\n\tbailout:\n\treturn retval;\n}\n\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV\n\t(JNIEnv *env, jclass cls, jint width, jint height, jint subsamp)\n{\n\tjint retval=(jint)tjBufSizeYUV(width, height, subsamp);\n\tif(retval==-1) _throw(tjGetErrorStr());\n\n\tbailout:\n\treturn retval;\n}\n\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_init\n\t(JNIEnv *env, jobject obj)\n{\n\tjclass cls;\n\tjfieldID fid;\n\ttjhandle handle;\n\n\tif((handle=tjInitCompress())==NULL)\n\t\t_throw(tjGetErrorStr());\n\n\tbailif0(cls=(*env)->GetObjectClass(env, obj));\n\tbailif0(fid=(*env)->GetFieldID(env, cls, \"handle\", \"J\"));\n\t(*env)->SetLongField(env, obj, fid, (jlong)handle);\n\n\tbailout:\n\treturn;\n}\n\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3BIIIIII_3BIII\n\t(JNIEnv *env, jobject obj, jbyteArray src, jint x, jint y, jint width,\n\t\tjint pitch, jint height, jint pf, jbyteArray dst, jint jpegSubsamp,\n\t\tjint jpegQual, jint flags)\n{\n\ttjhandle handle=0;\n\tunsigned long jpegSize=0;\n\tjsize arraySize=0, actualPitch;\n\tunsigned char *srcBuf=NULL, *jpegBuf=NULL;\n\n\tgethandle();\n\n\tif(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF || width<1 || height<1\n\t\t|| pitch<0)\n\t\t_throw(\"Invalid argument in compress()\");\n\tif(org_libjpegturbo_turbojpeg_TJ_NUMPF!=TJ_NUMPF)\n\t\t_throw(\"Mismatch between Java and C API\");\n\n\tactualPitch=(pitch==0)? width*tjPixelSize[pf]:pitch;\n\tarraySize=(y+height-1)*actualPitch + x+width;\n\tif((*env)->GetArrayLength(env, src)<arraySize)\n\t\t_throw(\"Source buffer is not large enough\");\n\tjpegSize=tjBufSize(width, height, jpegSubsamp);\n\tif((*env)->GetArrayLength(env, dst)<(jsize)jpegSize)\n\t\t_throw(\"Destination buffer is not large enough\");\n\n\tbailif0(srcBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0));\n\tbailif0(jpegBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0));\n\n\tif(tjCompress2(handle, &srcBuf[y*actualPitch + x*tjPixelSize[pf]], width,\n\t\tpitch, height, pf, &jpegBuf, &jpegSize, jpegSubsamp, jpegQual,\n\t\tflags|TJFLAG_NOREALLOC)==-1)\n\t{\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, dst, jpegBuf, 0);\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0);\n\t\tjpegBuf=srcBuf=NULL;\n\t\t_throw(tjGetErrorStr());\n\t}\n\n\tbailout:\n\tif(jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, jpegBuf, 0);\n\tif(srcBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0);\n\treturn (jint)jpegSize;\n}\n\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3BIIII_3BIII\n\t(JNIEnv *env, jobject obj, jbyteArray src, jint width, jint pitch,\n\t\tjint height, jint pf, jbyteArray dst, jint jpegSubsamp, jint jpegQual,\n\t\tjint flags)\n{\n\treturn Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3BIIIIII_3BIII(\n\t\tenv, obj, src, 0, 0, width, pitch, height, pf, dst, jpegSubsamp, jpegQual,\n\t\tflags);\n}\n\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3IIIIIII_3BIII\n\t(JNIEnv *env, jobject obj, jintArray src, jint x, jint y, jint width,\n\t\tjint stride, jint height, jint pf, jbyteArray dst, jint jpegSubsamp,\n\t\tjint jpegQual, jint flags)\n{\n\ttjhandle handle=0;\n\tunsigned long jpegSize=0;\n\tjsize arraySize=0, actualStride;\n\tunsigned char *srcBuf=NULL, *jpegBuf=NULL;\n\n\tgethandle();\n\n\tif(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF || width<1 || height<1\n\t\t|| stride<0)\n\t\t_throw(\"Invalid argument in compress()\");\n\tif(org_libjpegturbo_turbojpeg_TJ_NUMPF!=TJ_NUMPF)\n\t\t_throw(\"Mismatch between Java and C API\");\n\tif(tjPixelSize[pf]!=sizeof(jint))\n\t\t_throw(\"Pixel format must be 32-bit when compressing from an integer buffer.\");\n\n\tactualStride=(stride==0)? width:stride;\n\tarraySize=(y+height-1)*actualStride + x+width;\n\tif((*env)->GetArrayLength(env, src)<arraySize)\n\t\t_throw(\"Source buffer is not large enough\");\n\tjpegSize=tjBufSize(width, height, jpegSubsamp);\n\tif((*env)->GetArrayLength(env, dst)<(jsize)jpegSize)\n\t\t_throw(\"Destination buffer is not large enough\");\n\n\tbailif0(srcBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0));\n\tbailif0(jpegBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0));\n\n\tif(tjCompress2(handle, &srcBuf[(y*actualStride + x)*sizeof(int)], width,\n\t\tstride*sizeof(jint), height, pf, &jpegBuf, &jpegSize, jpegSubsamp,\n\t\tjpegQual, flags|TJFLAG_NOREALLOC)==-1)\n\t{\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, dst, jpegBuf, 0);\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0);\n\t\tjpegBuf=srcBuf=NULL;\n\t\t_throw(tjGetErrorStr());\n\t}\n\n\tbailout:\n\tif(jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, jpegBuf, 0);\n\tif(srcBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0);\n\treturn (jint)jpegSize;\n}\n\nJNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3IIIII_3BIII\n\t(JNIEnv *env, jobject obj, jintArray src, jint width, jint pitch,\n\t\tjint height, jint pf, jbyteArray dst, jint jpegSubsamp, jint jpegQual,\n\t\tjint flags)\n{\n\treturn Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3IIIIIII_3BIII(\n\t\tenv, obj, src, 0, 0, width, pitch, height, pf, dst, jpegSubsamp, jpegQual,\n\t\tflags);\n}\n\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIII_3BII\n\t(JNIEnv *env, jobject obj, jbyteArray src, jint width, jint pitch,\n\t\tjint height, jint pf, jbyteArray dst, jint subsamp, jint flags)\n{\n\ttjhandle handle=0;\n\tjsize arraySize=0;\n\tunsigned char *srcBuf=NULL, *dstBuf=NULL;\n\n\tgethandle();\n\n\tif(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF || width<1 || height<1\n\t\t|| pitch<0)\n\t\t_throw(\"Invalid argument in encodeYUV()\");\n\tif(org_libjpegturbo_turbojpeg_TJ_NUMPF!=TJ_NUMPF)\n\t\t_throw(\"Mismatch between Java and C API\");\n\n\tarraySize=(pitch==0)? width*tjPixelSize[pf]*height:pitch*height;\n\tif((*env)->GetArrayLength(env, src)<arraySize)\n\t\t_throw(\"Source buffer is not large enough\");\n\tif((*env)->GetArrayLength(env, dst)\n\t\t<(jsize)tjBufSizeYUV(width, height, subsamp))\n\t\t_throw(\"Destination buffer is not large enough\");\n\n\tbailif0(srcBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0));\n\tbailif0(dstBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0));\n\n\tif(tjEncodeYUV2(handle, srcBuf, width, pitch, height, pf, dstBuf, subsamp,\n\t\tflags)==-1)\n\t{\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0);\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0);\n\t\tdstBuf=srcBuf=NULL;\n\t\t_throw(tjGetErrorStr());\n\t}\n\n\tbailout:\n\tif(dstBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0);\n\tif(srcBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0);\n\treturn;\n}\n\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIII_3BII\n\t(JNIEnv *env, jobject obj, jintArray src, jint width, jint stride,\n\t\tjint height, jint pf, jbyteArray dst, jint subsamp, jint flags)\n{\n\ttjhandle handle=0;\n\tjsize arraySize=0;\n\tunsigned char *srcBuf=NULL, *dstBuf=NULL;\n\n\tgethandle();\n\n\tif(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF || width<1 || height<1\n\t\t|| stride<0)\n\t\t_throw(\"Invalid argument in encodeYUV()\");\n\tif(org_libjpegturbo_turbojpeg_TJ_NUMPF!=TJ_NUMPF)\n\t\t_throw(\"Mismatch between Java and C API\");\n\tif(tjPixelSize[pf]!=sizeof(jint))\n\t\t_throw(\"Pixel format must be 32-bit when encoding from an integer buffer.\");\n\n\tarraySize=(stride==0)? width*height:stride*height;\n\tif((*env)->GetArrayLength(env, src)<arraySize)\n\t\t_throw(\"Source buffer is not large enough\");\n\tif((*env)->GetArrayLength(env, dst)\n\t\t<(jsize)tjBufSizeYUV(width, height, subsamp))\n\t\t_throw(\"Destination buffer is not large enough\");\n\n\tbailif0(srcBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0));\n\tbailif0(dstBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0));\n\n\tif(tjEncodeYUV2(handle, srcBuf, width, stride*sizeof(jint), height, pf,\n\t\tdstBuf, subsamp, flags)==-1)\n\t{\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0);\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0);\n\t\tdstBuf=srcBuf=NULL;\n\t\t_throw(tjGetErrorStr());\n\t}\n\n\tbailout:\n\tif(dstBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0);\n\tif(srcBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, srcBuf, 0);\n\treturn;\n}\n\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_destroy\n\t(JNIEnv *env, jobject obj)\n{\n\ttjhandle handle=0;\n\n\tgethandle();\n\n\tif(tjDestroy(handle)==-1) _throw(tjGetErrorStr());\n\t(*env)->SetLongField(env, obj, _fid, 0);\n\n\tbailout:\n\treturn;\n}\n\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_init\n\t(JNIEnv *env, jobject obj)\n{\n\tjclass cls;\n\tjfieldID fid;\n\ttjhandle handle;\n\n\tif((handle=tjInitDecompress())==NULL) _throw(tjGetErrorStr());\n\n\tbailif0(cls=(*env)->GetObjectClass(env, obj));\n\tbailif0(fid=(*env)->GetFieldID(env, cls, \"handle\", \"J\"));\n\t(*env)->SetLongField(env, obj, fid, (jlong)handle);\n\n\tbailout:\n\treturn;\n}\n\nJNIEXPORT jobjectArray JNICALL Java_org_libjpegturbo_turbojpeg_TJ_getScalingFactors\n\t(JNIEnv *env, jclass cls)\n{\n  jclass sfcls=NULL;  jfieldID fid=0;\n\ttjscalingfactor *sf=NULL;  int n=0, i;\n\tjobject sfobj=NULL;\n\tjobjectArray sfjava=NULL;\n\n\tif((sf=tjGetScalingFactors(&n))==NULL || n==0)\n\t\t_throw(tjGetErrorStr());\n\n\tbailif0(sfcls=(*env)->FindClass(env, \"org/libjpegturbo/turbojpeg/TJScalingFactor\"));\n\tbailif0(sfjava=(jobjectArray)(*env)->NewObjectArray(env, n, sfcls, 0));\n\n\tfor(i=0; i<n; i++)\n\t{\n\t\tbailif0(sfobj=(*env)->AllocObject(env, sfcls));\n\t\tbailif0(fid=(*env)->GetFieldID(env, sfcls, \"num\", \"I\"));\n\t\t(*env)->SetIntField(env, sfobj, fid, sf[i].num);\n\t\tbailif0(fid=(*env)->GetFieldID(env, sfcls, \"denom\", \"I\"));\n\t\t(*env)->SetIntField(env, sfobj, fid, sf[i].denom);\n\t\t(*env)->SetObjectArrayElement(env, sfjava, i, sfobj);\n\t}\n\n\tbailout:\n\treturn sfjava;\n}\n\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader\n\t(JNIEnv *env, jobject obj, jbyteArray src, jint jpegSize)\n{\n\ttjhandle handle=0;\n\tunsigned char *jpegBuf=NULL;\n\tint width=0, height=0, jpegSubsamp=-1;\n\n\tgethandle();\n\n\tif((*env)->GetArrayLength(env, src)<jpegSize)\n\t\t_throw(\"Source buffer is not large enough\");\n\n\tbailif0(jpegBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0));\n\n\tif(tjDecompressHeader2(handle, jpegBuf, (unsigned long)jpegSize, \n\t\t&width, &height, &jpegSubsamp)==-1)\n\t{\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, src, jpegBuf, 0);\n\t\t_throw(tjGetErrorStr());\n\t}\n\t(*env)->ReleasePrimitiveArrayCritical(env, src, jpegBuf, 0);  jpegBuf=NULL;\n\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"jpegSubsamp\", \"I\"));\n\t(*env)->SetIntField(env, obj, _fid, jpegSubsamp);\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"jpegWidth\", \"I\"));\n\t(*env)->SetIntField(env, obj, _fid, width);\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"jpegHeight\", \"I\"));\n\t(*env)->SetIntField(env, obj, _fid, height);\n\n\tbailout:\n\treturn;\n}\n\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3BIIIIIII\n\t(JNIEnv *env, jobject obj, jbyteArray src, jint jpegSize, jbyteArray dst,\n\t\tjint x, jint y, jint width, jint pitch, jint height, jint pf, jint flags)\n{\n\ttjhandle handle=0;\n\tjsize arraySize=0, actualPitch;\n\tunsigned char *jpegBuf=NULL, *dstBuf=NULL;\n\n\tgethandle();\n\n\tif(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF)\n\t\t_throw(\"Invalid argument in decompress()\");\n\tif(org_libjpegturbo_turbojpeg_TJ_NUMPF!=TJ_NUMPF)\n\t\t_throw(\"Mismatch between Java and C API\");\n\n\tif((*env)->GetArrayLength(env, src)<jpegSize)\n\t\t_throw(\"Source buffer is not large enough\");\n\tactualPitch=(pitch==0)? width*tjPixelSize[pf]:pitch;\n\tarraySize=(y+height-1)*actualPitch + (x+width)*tjPixelSize[pf];\n\tif((*env)->GetArrayLength(env, dst)<arraySize)\n\t\t_throw(\"Destination buffer is not large enough\");\n\n\tbailif0(jpegBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0));\n\tbailif0(dstBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0));\n\n\tif(tjDecompress2(handle, jpegBuf, (unsigned long)jpegSize,\n\t\t&dstBuf[y*actualPitch + x*tjPixelSize[pf]], width, pitch, height, pf,\n\t\tflags)==-1)\n\t{\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0);\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, src, jpegBuf, 0);\n\t\tdstBuf=jpegBuf=NULL;\n\t\t_throw(tjGetErrorStr());\n\t}\n\n\tbailout:\n\tif(dstBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0);\n\tif(jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, jpegBuf, 0);\n\treturn;\n}\n\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3BIIIII\n\t(JNIEnv *env, jobject obj, jbyteArray src, jint jpegSize, jbyteArray dst,\n\t\tjint width, jint pitch, jint height, jint pf, jint flags)\n{\n\tJava_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3BIIIIIII\n\t\t(env, obj, src, jpegSize, dst, 0, 0, width, pitch, height, pf, flags);\n}\n\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3IIIIIIII\n\t(JNIEnv *env, jobject obj, jbyteArray src, jint jpegSize, jintArray dst,\n\t\tjint x, jint y, jint width, jint stride, jint height, jint pf, jint flags)\n{\n\ttjhandle handle=0;\n\tjsize arraySize=0, actualStride;\n\tunsigned char *jpegBuf=NULL, *dstBuf=NULL;\n\n\tgethandle();\n\n\tif(pf<0 || pf>=org_libjpegturbo_turbojpeg_TJ_NUMPF)\n\t\t_throw(\"Invalid argument in decompress()\");\n\tif(org_libjpegturbo_turbojpeg_TJ_NUMPF!=TJ_NUMPF)\n\t\t_throw(\"Mismatch between Java and C API\");\n\tif(tjPixelSize[pf]!=sizeof(jint))\n\t\t_throw(\"Pixel format must be 32-bit when decompressing to an integer buffer.\");\n\n\tif((*env)->GetArrayLength(env, src)<jpegSize)\n\t\t_throw(\"Source buffer is not large enough\");\n\tactualStride=(stride==0)? width:stride;\n\tarraySize=(y+height-1)*actualStride + x+width;\n\tif((*env)->GetArrayLength(env, dst)<arraySize)\n\t\t_throw(\"Destination buffer is not large enough\");\n\n\tbailif0(jpegBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0));\n\tbailif0(dstBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0));\n\n\tif(tjDecompress2(handle, jpegBuf, (unsigned long)jpegSize,\n\t\t&dstBuf[(y*actualStride + x)*sizeof(int)], width, stride*sizeof(jint),\n\t\theight, pf, flags)==-1)\n\t{\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0);\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, src, jpegBuf, 0);\n\t\tdstBuf=jpegBuf=NULL;\n\t\t_throw(tjGetErrorStr());\n\t}\n\n\tbailout:\n\tif(dstBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0);\n\tif(jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, jpegBuf, 0);\n\treturn;\n}\n\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3IIIIII\n\t(JNIEnv *env, jobject obj, jbyteArray src, jint jpegSize, jintArray dst,\n\t\tjint width, jint stride, jint height, jint pf, jint flags)\n{\n\tJava_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3IIIIIIII\n\t\t(env, obj, src, jpegSize, dst, 0, 0, width, stride, height, pf, flags);\n\t\n}\n\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV\n\t(JNIEnv *env, jobject obj, jbyteArray src, jint jpegSize, jbyteArray dst,\n\t\tjint flags)\n{\n\ttjhandle handle=0;\n\tunsigned char *jpegBuf=NULL, *dstBuf=NULL;\n\tint jpegSubsamp=-1, jpegWidth=0, jpegHeight=0;\n\n\tgethandle();\n\n\tif((*env)->GetArrayLength(env, src)<jpegSize)\n\t\t_throw(\"Source buffer is not large enough\");\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"jpegSubsamp\", \"I\"));\n\tjpegSubsamp=(int)(*env)->GetIntField(env, obj, _fid);\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"jpegWidth\", \"I\"));\n\tjpegWidth=(int)(*env)->GetIntField(env, obj, _fid);\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"jpegHeight\", \"I\"));\n\tjpegHeight=(int)(*env)->GetIntField(env, obj, _fid);\n\tif((*env)->GetArrayLength(env, dst)\n\t\t<(jsize)tjBufSizeYUV(jpegWidth, jpegHeight, jpegSubsamp))\n\t\t_throw(\"Destination buffer is not large enough\");\n\n\tbailif0(jpegBuf=(*env)->GetPrimitiveArrayCritical(env, src, 0));\n\tbailif0(dstBuf=(*env)->GetPrimitiveArrayCritical(env, dst, 0));\n\n\tif(tjDecompressToYUV(handle, jpegBuf, (unsigned long)jpegSize, dstBuf,\n\t\tflags)==-1)\n\t{\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0);\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, src, jpegBuf, 0);\n\t\tdstBuf=jpegBuf=NULL;\n\t\t_throw(tjGetErrorStr());\n\t}\n\n\tbailout:\n\tif(dstBuf) (*env)->ReleasePrimitiveArrayCritical(env, dst, dstBuf, 0);\n\tif(jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, src, jpegBuf, 0);\n\treturn;\n}\n\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJTransformer_init\n\t(JNIEnv *env, jobject obj)\n{\n\tjclass cls;\n\tjfieldID fid;\n\ttjhandle handle;\n\n\tif((handle=tjInitTransform())==NULL) _throw(tjGetErrorStr());\n\n\tbailif0(cls=(*env)->GetObjectClass(env, obj));\n\tbailif0(fid=(*env)->GetFieldID(env, cls, \"handle\", \"J\"));\n\t(*env)->SetLongField(env, obj, fid, (jlong)handle);\n\n\tbailout:\n\treturn;\n}\n\ntypedef struct _JNICustomFilterParams\n{\n\tJNIEnv *env;\n\tjobject tobj;\n\tjobject cfobj;\n} JNICustomFilterParams;\n\nstatic int JNICustomFilter(short *coeffs, tjregion arrayRegion,\n\ttjregion planeRegion, int componentIndex, int transformIndex,\n\ttjtransform *transform)\n{\n\tJNICustomFilterParams *params=(JNICustomFilterParams *)transform->data;\n\tJNIEnv *env=params->env;\n\tjobject tobj=params->tobj, cfobj=params->cfobj;\n  jobject arrayRegionObj, planeRegionObj, bufobj, borobj;\n\tjclass cls;  jmethodID mid;  jfieldID fid;\n\n\tbailif0(bufobj=(*env)->NewDirectByteBuffer(env, coeffs,\n\t\tsizeof(short)*arrayRegion.w*arrayRegion.h));\n\tbailif0(cls=(*env)->FindClass(env, \"java/nio/ByteOrder\"));\n  bailif0(mid=(*env)->GetStaticMethodID(env, cls, \"nativeOrder\",\n\t\t\"()Ljava/nio/ByteOrder;\"));\n\tbailif0(borobj=(*env)->CallStaticObjectMethod(env, cls, mid));\n\tbailif0(cls=(*env)->GetObjectClass(env, bufobj));\n\tbailif0(mid=(*env)->GetMethodID(env, cls, \"order\",\n\t\t\"(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;\"));\n\t(*env)->CallObjectMethod(env, bufobj, mid, borobj);\n  bailif0(mid=(*env)->GetMethodID(env, cls, \"asShortBuffer\",\n\t\t\"()Ljava/nio/ShortBuffer;\"));\n\tbailif0(bufobj=(*env)->CallObjectMethod(env, bufobj, mid));\n\n\tbailif0(cls=(*env)->FindClass(env, \"java/awt/Rectangle\"));\n\tbailif0(arrayRegionObj=(*env)->AllocObject(env, cls));\n\tbailif0(fid=(*env)->GetFieldID(env, cls, \"x\", \"I\"));\n\t(*env)->SetIntField(env, arrayRegionObj, fid, arrayRegion.x);\n\tbailif0(fid=(*env)->GetFieldID(env, cls, \"y\", \"I\"));\n\t(*env)->SetIntField(env, arrayRegionObj, fid, arrayRegion.y);\n\tbailif0(fid=(*env)->GetFieldID(env, cls, \"width\", \"I\"));\n\t(*env)->SetIntField(env, arrayRegionObj, fid, arrayRegion.w);\n\tbailif0(fid=(*env)->GetFieldID(env, cls, \"height\", \"I\"));\n\t(*env)->SetIntField(env, arrayRegionObj, fid, arrayRegion.h);\n\n\tbailif0(planeRegionObj=(*env)->AllocObject(env, cls));\n\tbailif0(fid=(*env)->GetFieldID(env, cls, \"x\", \"I\"));\n\t(*env)->SetIntField(env, planeRegionObj, fid, planeRegion.x);\n\tbailif0(fid=(*env)->GetFieldID(env, cls, \"y\", \"I\"));\n\t(*env)->SetIntField(env, planeRegionObj, fid, planeRegion.y);\n\tbailif0(fid=(*env)->GetFieldID(env, cls, \"width\", \"I\"));\n\t(*env)->SetIntField(env, planeRegionObj, fid, planeRegion.w);\n\tbailif0(fid=(*env)->GetFieldID(env, cls, \"height\", \"I\"));\n\t(*env)->SetIntField(env, planeRegionObj, fid, planeRegion.h);\n\n\tbailif0(cls=(*env)->GetObjectClass(env, cfobj));\n\tbailif0(mid=(*env)->GetMethodID(env, cls, \"customFilter\",\n\t\t\"(Ljava/nio/ShortBuffer;Ljava/awt/Rectangle;Ljava/awt/Rectangle;IILorg/libjpegturbo/turbojpeg/TJTransform;)V\"));\n\t(*env)->CallVoidMethod(env, cfobj, mid, bufobj, arrayRegionObj,\n\t\tplaneRegionObj, componentIndex, transformIndex, tobj);\n\n\treturn 0;\n\n\tbailout:\n\treturn -1;\n}\n\nJNIEXPORT jintArray JNICALL Java_org_libjpegturbo_turbojpeg_TJTransformer_transform\n\t(JNIEnv *env, jobject obj, jbyteArray jsrcBuf, jint jpegSize,\n\t\tjobjectArray dstobjs, jobjectArray tobjs, jint flags)\n{\n\ttjhandle handle=0;  int i;\n\tunsigned char *jpegBuf=NULL, **dstBufs=NULL;  jsize n=0;\n\tunsigned long *dstSizes=NULL;  tjtransform *t=NULL;\n\tjbyteArray *jdstBufs=NULL;\n\tint jpegWidth=0, jpegHeight=0, jpegSubsamp;\n\tjintArray jdstSizes=0;  jint *dstSizesi=NULL;\n\tJNICustomFilterParams *params=NULL;\n\n\tgethandle();\n\n\tif((*env)->GetArrayLength(env, jsrcBuf)<jpegSize)\n\t\t_throw(\"Source buffer is not large enough\");\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"jpegWidth\", \"I\"));\n\tjpegWidth=(int)(*env)->GetIntField(env, obj, _fid);\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"jpegHeight\", \"I\"));\n\tjpegHeight=(int)(*env)->GetIntField(env, obj, _fid);\n\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"jpegSubsamp\", \"I\"));\n\tjpegSubsamp=(int)(*env)->GetIntField(env, obj, _fid);\n\n\tn=(*env)->GetArrayLength(env, dstobjs);\n\tif(n!=(*env)->GetArrayLength(env, tobjs))\n\t\t_throw(\"Mismatch between size of transforms array and destination buffers array\");\n\n\tif((dstBufs=(unsigned char **)malloc(sizeof(unsigned char *)*n))==NULL)\n\t\t_throw(\"Memory allocation failure\");\n\tif((jdstBufs=(jbyteArray *)malloc(sizeof(jbyteArray)*n))==NULL)\n\t\t_throw(\"Memory allocation failure\");\n\tif((dstSizes=(unsigned long *)malloc(sizeof(unsigned long)*n))==NULL)\n\t\t_throw(\"Memory allocation failure\");\n\tif((t=(tjtransform *)malloc(sizeof(tjtransform)*n))==NULL)\n\t\t_throw(\"Memory allocation failure\");\n\tif((params=(JNICustomFilterParams *)malloc(sizeof(JNICustomFilterParams)*n))\n\t\t==NULL)\n\t\t_throw(\"Memory allocation failure\");\n\tfor(i=0; i<n; i++)\n\t{\n\t\tdstBufs[i]=NULL;  jdstBufs[i]=NULL;  dstSizes[i]=0;\n\t\tmemset(&t[i], 0, sizeof(tjtransform));\n\t\tmemset(&params[i], 0, sizeof(JNICustomFilterParams));\n\t}\n\n\tfor(i=0; i<n; i++)\n\t{\n\t\tjobject tobj, cfobj;\n\n\t\tbailif0(tobj=(*env)->GetObjectArrayElement(env, tobjs, i));\n\t\tbailif0(_cls=(*env)->GetObjectClass(env, tobj));\n\t\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"op\", \"I\"));\n\t\tt[i].op=(*env)->GetIntField(env, tobj, _fid);\n\t\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"options\", \"I\"));\n\t\tt[i].options=(*env)->GetIntField(env, tobj, _fid);\n\t\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"x\", \"I\"));\n\t\tt[i].r.x=(*env)->GetIntField(env, tobj, _fid);\n\t\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"y\", \"I\"));\n\t\tt[i].r.y=(*env)->GetIntField(env, tobj, _fid);\n\t\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"width\", \"I\"));\n\t\tt[i].r.w=(*env)->GetIntField(env, tobj, _fid);\n\t\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"height\", \"I\"));\n\t\tt[i].r.h=(*env)->GetIntField(env, tobj, _fid);\n\n\t\tbailif0(_fid=(*env)->GetFieldID(env, _cls, \"cf\",\n\t\t\t\"Lorg/libjpegturbo/turbojpeg/TJCustomFilter;\"));\n\t\tcfobj=(*env)->GetObjectField(env, tobj, _fid);\n\t\tif(cfobj)\n\t\t{\n\t\t\tparams[i].env=env;\n\t\t\tparams[i].tobj=tobj;\n\t\t\tparams[i].cfobj=cfobj;\n\t\t\tt[i].customFilter=JNICustomFilter;\n\t\t\tt[i].data=(void *)&params[i];\n\t\t}\n\t}\n\n\tbailif0(jpegBuf=(*env)->GetPrimitiveArrayCritical(env, jsrcBuf, 0));\n\tfor(i=0; i<n; i++)\n\t{\n\t\tint w=jpegWidth, h=jpegHeight;\n\t\tif(t[i].r.w!=0) w=t[i].r.w;\n\t\tif(t[i].r.h!=0) h=t[i].r.h;\n\t\tbailif0(jdstBufs[i]=(*env)->GetObjectArrayElement(env, dstobjs, i));\n\t\tif((unsigned long)(*env)->GetArrayLength(env, jdstBufs[i])\n\t\t\t<tjBufSize(w, h, jpegSubsamp))\n\t\t\t_throw(\"Destination buffer is not large enough\");\n\t\tbailif0(dstBufs[i]=(*env)->GetPrimitiveArrayCritical(env, jdstBufs[i], 0));\n\t}\n\n\tif(tjTransform(handle, jpegBuf, jpegSize, n, dstBufs, dstSizes, t,\n\t\tflags|TJFLAG_NOREALLOC)==-1)\n\t{\n\t\t(*env)->ReleasePrimitiveArrayCritical(env, jsrcBuf, jpegBuf, 0);\n\t\tjpegBuf=NULL;\n\t\tfor(i=0; i<n; i++)\n\t\t{\n\t\t\t(*env)->ReleasePrimitiveArrayCritical(env, jdstBufs[i], dstBufs[i], 0);\n\t\t\tdstBufs[i]=NULL;\n\t\t}\n\t\t_throw(tjGetErrorStr());\n\t}\n\n\tjdstSizes=(*env)->NewIntArray(env, n);\n\tbailif0(dstSizesi=(*env)->GetIntArrayElements(env, jdstSizes, 0));\n\tfor(i=0; i<n; i++) dstSizesi[i]=(int)dstSizes[i];\n\n\tbailout:\n\tif(jpegBuf) (*env)->ReleasePrimitiveArrayCritical(env, jsrcBuf, jpegBuf, 0);\n\tif(dstBufs)\n\t{\n\t\tfor(i=0; i<n; i++)\n\t\t{\n\t\t\tif(dstBufs[i] && jdstBufs && jdstBufs[i])\n\t\t\t\t(*env)->ReleasePrimitiveArrayCritical(env, jdstBufs[i], dstBufs[i], 0);\n\t\t}\n\t\tfree(dstBufs);\n\t}\n\tif(jdstBufs) free(jdstBufs);\n\tif(dstSizes) free(dstSizes);\n\tif(dstSizesi) (*env)->ReleaseIntArrayElements(env, jdstSizes, dstSizesi, 0);\n\tif(t) free(t);\n\treturn jdstSizes;\n}\n\nJNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_destroy\n\t(JNIEnv *env, jobject obj)\n{\n\tJava_org_libjpegturbo_turbojpeg_TJCompressor_destroy(env, obj);\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/turbojpeg-mapfile",
    "content": "TURBOJPEG_1.0\n{\n\tglobal:\n\t\ttjInitCompress;\n\t\ttjCompress;\n\t\tTJBUFSIZE;\n\t\ttjInitDecompress;\n\t\ttjDecompressHeader;\n\t\ttjDecompress;\n\t\ttjDestroy;\n\t\ttjGetErrorStr;\n\tlocal:\n\t\t*;\n};\n\nTURBOJPEG_1.1\n{\n\tglobal:\n\t\tTJBUFSIZEYUV;\n\t\ttjDecompressHeader2;\n\t\ttjDecompressToYUV;\n\t\ttjEncodeYUV;\n} TURBOJPEG_1.0;\n\nTURBOJPEG_1.2\n{\n\tglobal:\n\t\ttjAlloc;\n\t\ttjBufSize;\n\t\ttjBufSizeYUV;\n\t\ttjCompress2;\n\t\ttjDecompress2;\n\t\ttjEncodeYUV2;\n\t\ttjFree;\n\t\ttjGetScalingFactors;\n\t\ttjInitTransform;\n\t\ttjTransform;\n} TURBOJPEG_1.1;\n"
  },
  {
    "path": "ext/libjpeg-turbo/turbojpeg-mapfile.jni",
    "content": "TURBOJPEG_1.0\n{\n\tglobal:\n\t\ttjInitCompress;\n\t\ttjCompress;\n\t\tTJBUFSIZE;\n\t\ttjInitDecompress;\n\t\ttjDecompressHeader;\n\t\ttjDecompress;\n\t\ttjDestroy;\n\t\ttjGetErrorStr;\n\tlocal:\n\t\t*;\n};\n\nTURBOJPEG_1.1\n{\n\tglobal:\n\t\tTJBUFSIZEYUV;\n\t\ttjDecompressHeader2;\n\t\ttjDecompressToYUV;\n\t\ttjEncodeYUV;\n} TURBOJPEG_1.0;\n\nTURBOJPEG_1.2\n{\n\tglobal:\n\t\ttjAlloc;\n\t\ttjBufSize;\n\t\ttjBufSizeYUV;\n\t\ttjCompress2;\n\t\ttjDecompress2;\n\t\ttjEncodeYUV2;\n\t\ttjFree;\n\t\ttjGetScalingFactors;\n\t\ttjInitTransform;\n\t\ttjTransform;\n\t\tJava_org_libjpegturbo_turbojpeg_TJ_bufSize;\n\t\tJava_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV;\n\t\tJava_org_libjpegturbo_turbojpeg_TJ_getScalingFactors;\n\t\tJava_org_libjpegturbo_turbojpeg_TJCompressor_init;\n\t\tJava_org_libjpegturbo_turbojpeg_TJCompressor_compress___3BIIII_3BIII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJCompressor_compress___3IIIII_3BIII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIII_3BII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIII_3BII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJCompressor_destroy;\n\t\tJava_org_libjpegturbo_turbojpeg_TJDecompressor_init;\n\t\tJava_org_libjpegturbo_turbojpeg_TJDecompressor_decompressHeader;\n\t\tJava_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3BIIIII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3IIIIII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV;\n\t\tJava_org_libjpegturbo_turbojpeg_TJDecompressor_destroy;\t\t\n\t\tJava_org_libjpegturbo_turbojpeg_TJTransformer_init;\n\t\tJava_org_libjpegturbo_turbojpeg_TJTransformer_transform;\n} TURBOJPEG_1.1;\n\nTURBOJPEG_1.3\n{\n\tglobal:\n\t\tJava_org_libjpegturbo_turbojpeg_TJCompressor_compress___3BIIIIII_3BIII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJCompressor_compress___3IIIIIII_3BIII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3BIIIIIII;\n\t\tJava_org_libjpegturbo_turbojpeg_TJDecompressor_decompress___3BI_3IIIIIIII;\n} TURBOJPEG_1.2;\n"
  },
  {
    "path": "ext/libjpeg-turbo/turbojpeg.c",
    "content": "/*\n * Copyright (C)2009-2012, 2014 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* TurboJPEG/LJT:  this implements the TurboJPEG API using libjpeg or\n   libjpeg-turbo */\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <jinclude.h>\n#define JPEG_INTERNALS\n#include <jpeglib.h>\n#include <jerror.h>\n#include <setjmp.h>\n#include \"./turbojpeg.h\"\n#include \"./tjutil.h\"\n#include \"transupp.h\"\n\nextern void jpeg_mem_dest_tj(j_compress_ptr, unsigned char **,\n\tunsigned long *, boolean);\nextern void jpeg_mem_src_tj(j_decompress_ptr, unsigned char *, unsigned long);\n\n#define PAD(v, p) ((v+(p)-1)&(~((p)-1)))\n\n\n/* Error handling (based on example in example.c) */\n\nstatic char errStr[JMSG_LENGTH_MAX]=\"No error\";\n\nstruct my_error_mgr\n{\n\tstruct jpeg_error_mgr pub;\n\tjmp_buf setjmp_buffer;\n};\ntypedef struct my_error_mgr *my_error_ptr;\n\nstatic void my_error_exit(j_common_ptr cinfo)\n{\n\tmy_error_ptr myerr=(my_error_ptr)cinfo->err;\n\t(*cinfo->err->output_message)(cinfo);\n\tlongjmp(myerr->setjmp_buffer, 1);\n}\n\n/* Based on output_message() in jerror.c */\n\nstatic void my_output_message(j_common_ptr cinfo)\n{\n\t(*cinfo->err->format_message)(cinfo, errStr);\n}\n\n\n/* Global structures, macros, etc. */\n\nenum {COMPRESS=1, DECOMPRESS=2};\n\ntypedef struct _tjinstance\n{\n\tstruct jpeg_compress_struct cinfo;\n\tstruct jpeg_decompress_struct dinfo;\n\tstruct my_error_mgr jerr;\n\tint init;\n} tjinstance;\n\nstatic const int pixelsize[TJ_NUMSAMP]={3, 3, 3, 1, 3};\n\nstatic const JXFORM_CODE xformtypes[TJ_NUMXOP]=\n{\n\tJXFORM_NONE, JXFORM_FLIP_H, JXFORM_FLIP_V, JXFORM_TRANSPOSE,\n\tJXFORM_TRANSVERSE, JXFORM_ROT_90, JXFORM_ROT_180, JXFORM_ROT_270\n};\n\n#define NUMSF 16\nstatic const tjscalingfactor sf[NUMSF]={\n\t{2, 1},\n\t{15, 8},\n\t{7, 4},\n\t{13, 8},\n\t{3, 2},\n\t{11, 8},\n\t{5, 4},\n\t{9, 8},\n\t{1, 1},\n\t{7, 8},\n\t{3, 4},\n\t{5, 8},\n\t{1, 2},\n\t{3, 8},\n\t{1, 4},\n\t{1, 8}\n};\n\n#define _throw(m) {snprintf(errStr, JMSG_LENGTH_MAX, \"%s\", m);  \\\n\tretval=-1;  goto bailout;}\n#define getinstance(handle) tjinstance *this=(tjinstance *)handle;  \\\n\tj_compress_ptr cinfo=NULL;  j_decompress_ptr dinfo=NULL;  \\\n\tif(!this) {snprintf(errStr, JMSG_LENGTH_MAX, \"Invalid handle\");  \\\n\t\treturn -1;}  \\\n\tcinfo=&this->cinfo;  dinfo=&this->dinfo;\n\nstatic int getPixelFormat(int pixelSize, int flags)\n{\n\tif(pixelSize==1) return TJPF_GRAY;\n\tif(pixelSize==3)\n\t{\n\t\tif(flags&TJ_BGR) return TJPF_BGR;\n\t\telse return TJPF_RGB;\n\t}\n\tif(pixelSize==4)\n\t{\n\t\tif(flags&TJ_ALPHAFIRST)\n\t\t{\n\t\t\tif(flags&TJ_BGR) return TJPF_XBGR;\n\t\t\telse return TJPF_XRGB;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(flags&TJ_BGR) return TJPF_BGRX;\n\t\t\telse return TJPF_RGBX;\n\t\t}\n\t}\n\treturn -1;\n}\n\nstatic int setCompDefaults(struct jpeg_compress_struct *cinfo,\n\tint pixelFormat, int subsamp, int jpegQual, int flags)\n{\n\tint retval=0;\n\n\tswitch(pixelFormat)\n\t{\n\t\tcase TJPF_GRAY:\n\t\t\tcinfo->in_color_space=JCS_GRAYSCALE;  break;\n\t\t#if JCS_EXTENSIONS==1\n\t\tcase TJPF_RGB:\n\t\t\tcinfo->in_color_space=JCS_EXT_RGB;  break;\n\t\tcase TJPF_BGR:\n\t\t\tcinfo->in_color_space=JCS_EXT_BGR;  break;\n\t\tcase TJPF_RGBX:\n\t\tcase TJPF_RGBA:\n\t\t\tcinfo->in_color_space=JCS_EXT_RGBX;  break;\n\t\tcase TJPF_BGRX:\n\t\tcase TJPF_BGRA:\n\t\t\tcinfo->in_color_space=JCS_EXT_BGRX;  break;\n\t\tcase TJPF_XRGB:\n\t\tcase TJPF_ARGB:\n\t\t\tcinfo->in_color_space=JCS_EXT_XRGB;  break;\n\t\tcase TJPF_XBGR:\n\t\tcase TJPF_ABGR:\n\t\t\tcinfo->in_color_space=JCS_EXT_XBGR;  break;\n\t\t#else\n\t\tcase TJPF_RGB:\n\t\tcase TJPF_BGR:\n\t\tcase TJPF_RGBX:\n\t\tcase TJPF_BGRX:\n\t\tcase TJPF_XRGB:\n\t\tcase TJPF_XBGR:\n\t\tcase TJPF_RGBA:\n\t\tcase TJPF_BGRA:\n\t\tcase TJPF_ARGB:\n\t\tcase TJPF_ABGR:\n\t\t\tcinfo->in_color_space=JCS_RGB;  pixelFormat=TJPF_RGB;\n\t\t\tbreak;\n\t\t#endif\n\t}\n\n\tcinfo->input_components=tjPixelSize[pixelFormat];\n\tjpeg_set_defaults(cinfo);\n\tif(jpegQual>=0)\n\t{\n\t\tjpeg_set_quality(cinfo, jpegQual, TRUE);\n\t\tif(jpegQual>=96 || flags&TJFLAG_ACCURATEDCT) cinfo->dct_method=JDCT_ISLOW;\n\t\telse cinfo->dct_method=JDCT_FASTEST;\n\t}\n\tif(subsamp==TJSAMP_GRAY)\n\t\tjpeg_set_colorspace(cinfo, JCS_GRAYSCALE);\n\telse\n\t\tjpeg_set_colorspace(cinfo, JCS_YCbCr);\n\n\tcinfo->comp_info[0].h_samp_factor=tjMCUWidth[subsamp]/8;\n\tcinfo->comp_info[1].h_samp_factor=1;\n\tcinfo->comp_info[2].h_samp_factor=1;\n\tcinfo->comp_info[0].v_samp_factor=tjMCUHeight[subsamp]/8;\n\tcinfo->comp_info[1].v_samp_factor=1;\n\tcinfo->comp_info[2].v_samp_factor=1;\n\n\treturn retval;\n}\n\nstatic int setDecompDefaults(struct jpeg_decompress_struct *dinfo,\n\tint pixelFormat, int flags)\n{\n\tint retval=0;\n\n\tswitch(pixelFormat)\n\t{\n\t\tcase TJPF_GRAY:\n\t\t\tdinfo->out_color_space=JCS_GRAYSCALE;  break;\n\t\t#if JCS_EXTENSIONS==1\n\t\tcase TJPF_RGB:\n\t\t\tdinfo->out_color_space=JCS_EXT_RGB;  break;\n\t\tcase TJPF_BGR:\n\t\t\tdinfo->out_color_space=JCS_EXT_BGR;  break;\n\t\tcase TJPF_RGBX:\n\t\t\tdinfo->out_color_space=JCS_EXT_RGBX;  break;\n\t\tcase TJPF_BGRX:\n\t\t\tdinfo->out_color_space=JCS_EXT_BGRX;  break;\n\t\tcase TJPF_XRGB:\n\t\t\tdinfo->out_color_space=JCS_EXT_XRGB;  break;\n\t\tcase TJPF_XBGR:\n\t\t\tdinfo->out_color_space=JCS_EXT_XBGR;  break;\n\t\t#if JCS_ALPHA_EXTENSIONS==1\n\t\tcase TJPF_RGBA:\n\t\t\tdinfo->out_color_space=JCS_EXT_RGBA;  break;\n\t\tcase TJPF_BGRA:\n\t\t\tdinfo->out_color_space=JCS_EXT_BGRA;  break;\n\t\tcase TJPF_ARGB:\n\t\t\tdinfo->out_color_space=JCS_EXT_ARGB;  break;\n\t\tcase TJPF_ABGR:\n\t\t\tdinfo->out_color_space=JCS_EXT_ABGR;  break;\n\t\t#endif\n\t\t#else\n\t\tcase TJPF_RGB:\n\t\tcase TJPF_BGR:\n\t\tcase TJPF_RGBX:\n\t\tcase TJPF_BGRX:\n\t\tcase TJPF_XRGB:\n\t\tcase TJPF_XBGR:\n\t\tcase TJPF_RGBA:\n\t\tcase TJPF_BGRA:\n\t\tcase TJPF_ARGB:\n\t\tcase TJPF_ABGR:\n\t\t\tdinfo->out_color_space=JCS_RGB;  break;\n\t\t#endif\n\t\tdefault:\n\t\t\t_throw(\"Unsupported pixel format\");\n\t}\n\n\tif(flags&TJFLAG_FASTDCT) dinfo->dct_method=JDCT_FASTEST;\n\n\tbailout:\n\treturn retval;\n}\n\n\nstatic int getSubsamp(j_decompress_ptr dinfo)\n{\n\tint retval=-1, i, k;\n\tfor(i=0; i<NUMSUBOPT; i++)\n\t{\n\t\tif(dinfo->num_components==pixelsize[i])\n\t\t{\n\t\t\tif(dinfo->comp_info[0].h_samp_factor==tjMCUWidth[i]/8\n\t\t\t\t&& dinfo->comp_info[0].v_samp_factor==tjMCUHeight[i]/8)\n\t\t\t{\n\t\t\t\tint match=0;\n\t\t\t\tfor(k=1; k<dinfo->num_components; k++)\n\t\t\t\t{\n\t\t\t\t\tif(dinfo->comp_info[k].h_samp_factor==1\n\t\t\t\t\t\t&& dinfo->comp_info[k].v_samp_factor==1)\n\t\t\t\t\t\tmatch++;\n\t\t\t\t}\n\t\t\t\tif(match==dinfo->num_components-1)\n\t\t\t\t{\n\t\t\t\t\tretval=i;  break;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn retval;\n}\n\n\n#ifndef JCS_EXTENSIONS\n\n/* Conversion functions to emulate the colorspace extensions.  This allows the\n   TurboJPEG wrapper to be used with libjpeg */\n\n#define TORGB(PS, ROFFSET, GOFFSET, BOFFSET) {  \\\n\tint rowPad=pitch-width*PS;  \\\n\twhile(height--)  \\\n\t{  \\\n\t\tunsigned char *endOfRow=src+width*PS;  \\\n\t\twhile(src<endOfRow)  \\\n\t\t{  \\\n\t\t\tdst[RGB_RED]=src[ROFFSET];  \\\n\t\t\tdst[RGB_GREEN]=src[GOFFSET];  \\\n\t\t\tdst[RGB_BLUE]=src[BOFFSET];  \\\n\t\t\tdst+=RGB_PIXELSIZE;  src+=PS;  \\\n\t\t}  \\\n\t\tsrc+=rowPad;  \\\n\t}  \\\n}\n\nstatic unsigned char *toRGB(unsigned char *src, int width, int pitch,\n\tint height, int pixelFormat, unsigned char *dst)\n{\n\tunsigned char *retval=src;\n\tswitch(pixelFormat)\n\t{\n\t\tcase TJPF_RGB:\n\t\t\t#if RGB_RED!=0 || RGB_GREEN!=1 || RGB_BLUE!=2 || RGB_PIXELSIZE!=3\n\t\t\tretval=dst;  TORGB(3, 0, 1, 2);\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_BGR:\n\t\t\t#if RGB_RED!=2 || RGB_GREEN!=1 || RGB_BLUE!=0 || RGB_PIXELSIZE!=3\n\t\t\tretval=dst;  TORGB(3, 2, 1, 0);\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_RGBX:\n\t\tcase TJPF_RGBA:\n\t\t\t#if RGB_RED!=0 || RGB_GREEN!=1 || RGB_BLUE!=2 || RGB_PIXELSIZE!=4\n\t\t\tretval=dst;  TORGB(4, 0, 1, 2);\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_BGRX:\n\t\tcase TJPF_BGRA:\n\t\t\t#if RGB_RED!=2 || RGB_GREEN!=1 || RGB_BLUE!=0 || RGB_PIXELSIZE!=4\n\t\t\tretval=dst;  TORGB(4, 2, 1, 0);\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_XRGB:\n\t\tcase TJPF_ARGB:\n\t\t\t#if RGB_RED!=1 || RGB_GREEN!=2 || RGB_BLUE!=3 || RGB_PIXELSIZE!=4\n\t\t\tretval=dst;  TORGB(4, 1, 2, 3);\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_XBGR:\n\t\tcase TJPF_ABGR:\n\t\t\t#if RGB_RED!=3 || RGB_GREEN!=2 || RGB_BLUE!=1 || RGB_PIXELSIZE!=4\n\t\t\tretval=dst;  TORGB(4, 3, 2, 1);\n\t\t\t#endif\n\t\t\tbreak;\n\t}\n\treturn retval;\n}\n\n#define FROMRGB(PS, ROFFSET, GOFFSET, BOFFSET, SETALPHA) {  \\\n\tint rowPad=pitch-width*PS;  \\\n\twhile(height--)  \\\n\t{  \\\n\t\tunsigned char *endOfRow=dst+width*PS;  \\\n\t\twhile(dst<endOfRow)  \\\n\t\t{  \\\n\t\t\tdst[ROFFSET]=src[RGB_RED];  \\\n\t\t\tdst[GOFFSET]=src[RGB_GREEN];  \\\n\t\t\tdst[BOFFSET]=src[RGB_BLUE];  \\\n\t\t\tSETALPHA  \\\n\t\t\tdst+=PS;  src+=RGB_PIXELSIZE;  \\\n\t\t}  \\\n\t\tdst+=rowPad;  \\\n\t}  \\\n}\n\nstatic void fromRGB(unsigned char *src, unsigned char *dst, int width,\n\tint pitch, int height, int pixelFormat)\n{\n\tswitch(pixelFormat)\n\t{\n\t\tcase TJPF_RGB:\n\t\t\t#if RGB_RED!=0 || RGB_GREEN!=1 || RGB_BLUE!=2 || RGB_PIXELSIZE!=3\n\t\t\tFROMRGB(3, 0, 1, 2,);\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_BGR:\n\t\t\t#if RGB_RED!=2 || RGB_GREEN!=1 || RGB_BLUE!=0 || RGB_PIXELSIZE!=3\n\t\t\tFROMRGB(3, 2, 1, 0,);\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_RGBX:\n\t\t\t#if RGB_RED!=0 || RGB_GREEN!=1 || RGB_BLUE!=2 || RGB_PIXELSIZE!=4\n\t\t\tFROMRGB(4, 0, 1, 2,);\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_RGBA:\n\t\t\t#if RGB_RED!=0 || RGB_GREEN!=1 || RGB_BLUE!=2 || RGB_PIXELSIZE!=4\n\t\t\tFROMRGB(4, 0, 1, 2, dst[3]=0xFF;);\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_BGRX:\n\t\t\t#if RGB_RED!=2 || RGB_GREEN!=1 || RGB_BLUE!=0 || RGB_PIXELSIZE!=4\n\t\t\tFROMRGB(4, 2, 1, 0,);\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_BGRA:\n\t\t\t#if RGB_RED!=2 || RGB_GREEN!=1 || RGB_BLUE!=0 || RGB_PIXELSIZE!=4\n\t\t\tFROMRGB(4, 2, 1, 0, dst[3]=0xFF;);  return;\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_XRGB:\n\t\t\t#if RGB_RED!=1 || RGB_GREEN!=2 || RGB_BLUE!=3 || RGB_PIXELSIZE!=4\n\t\t\tFROMRGB(4, 1, 2, 3,);  return;\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_ARGB:\n\t\t\t#if RGB_RED!=1 || RGB_GREEN!=2 || RGB_BLUE!=3 || RGB_PIXELSIZE!=4\n\t\t\tFROMRGB(4, 1, 2, 3, dst[0]=0xFF;);  return;\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_XBGR:\n\t\t\t#if RGB_RED!=3 || RGB_GREEN!=2 || RGB_BLUE!=1 || RGB_PIXELSIZE!=4\n\t\t\tFROMRGB(4, 3, 2, 1,);  return;\n\t\t\t#endif\n\t\t\tbreak;\n\t\tcase TJPF_ABGR:\n\t\t\t#if RGB_RED!=3 || RGB_GREEN!=2 || RGB_BLUE!=1 || RGB_PIXELSIZE!=4\n\t\t\tFROMRGB(4, 3, 2, 1, dst[0]=0xFF;);  return;\n\t\t\t#endif\n\t\t\tbreak;\n\t}\n}\n\n#endif\n\n\n/* General API functions */\n\nDLLEXPORT char* DLLCALL tjGetErrorStr(void)\n{\n\treturn errStr;\n}\n\n\nDLLEXPORT int DLLCALL tjDestroy(tjhandle handle)\n{\n\tgetinstance(handle);\n\tif(setjmp(this->jerr.setjmp_buffer)) return -1;\n\tif(this->init&COMPRESS) jpeg_destroy_compress(cinfo);\n\tif(this->init&DECOMPRESS) jpeg_destroy_decompress(dinfo);\n\tfree(this);\n\treturn 0;\n}\n\n\n/* These are exposed mainly because Windows can't malloc() and free() across\n   DLL boundaries except when the CRT DLL is used, and we don't use the CRT DLL\n   with turbojpeg.dll for compatibility reasons.  However, these functions\n   can potentially be used for other purposes by different implementations. */\n\nDLLEXPORT void DLLCALL tjFree(unsigned char *buf)\n{\n\tif(buf) free(buf);\n}\n\n\nDLLEXPORT unsigned char *DLLCALL tjAlloc(int bytes)\n{\n\treturn (unsigned char *)malloc(bytes);\n}\n\n\n/* Compressor  */\n\nstatic tjhandle _tjInitCompress(tjinstance *this)\n{\n\tunsigned char buffer[1], *buf=buffer;  unsigned long size=1;\n\n\t/* This is also straight out of example.c */\n\tthis->cinfo.err=jpeg_std_error(&this->jerr.pub);\n\tthis->jerr.pub.error_exit=my_error_exit;\n\tthis->jerr.pub.output_message=my_output_message;\n\n\tif(setjmp(this->jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\tif(this) free(this);  return NULL;\n\t}\n\n\tjpeg_create_compress(&this->cinfo);\n\t/* Make an initial call so it will create the destination manager */\n\tjpeg_mem_dest_tj(&this->cinfo, &buf, &size, 0);\n\n\tthis->init|=COMPRESS;\n\treturn (tjhandle)this;\n}\n\nDLLEXPORT tjhandle DLLCALL tjInitCompress(void)\n{\n\ttjinstance *this=NULL;\n\tif((this=(tjinstance *)malloc(sizeof(tjinstance)))==NULL)\n\t{\n\t\tsnprintf(errStr, JMSG_LENGTH_MAX,\n\t\t\t\"tjInitCompress(): Memory allocation failure\");\n\t\treturn NULL;\n\t}\n\tMEMZERO(this, sizeof(tjinstance));\n\treturn _tjInitCompress(this);\n}\n\n\nDLLEXPORT unsigned long DLLCALL tjBufSize(int width, int height,\n\tint jpegSubsamp)\n{\n\tunsigned long retval=0;  int mcuw, mcuh, chromasf;\n\tif(width<1 || height<1 || jpegSubsamp<0 || jpegSubsamp>=NUMSUBOPT)\n\t\t_throw(\"tjBufSize(): Invalid argument\");\n\n\t/* This allows for rare corner cases in which a JPEG image can actually be\n\t   larger than the uncompressed input (we wouldn't mention it if it hadn't\n\t   happened before.) */\n\tmcuw=tjMCUWidth[jpegSubsamp];\n\tmcuh=tjMCUHeight[jpegSubsamp];\n\tchromasf=jpegSubsamp==TJSAMP_GRAY? 0: 4*64/(mcuw*mcuh);\n\tretval=PAD(width, mcuw) * PAD(height, mcuh) * (2 + chromasf) + 2048;\n\n\tbailout:\n\treturn retval;\n}\n\nDLLEXPORT unsigned long DLLCALL TJBUFSIZE(int width, int height)\n{\n\tunsigned long retval=0;\n\tif(width<1 || height<1)\n\t\t_throw(\"TJBUFSIZE(): Invalid argument\");\n\n\t/* This allows for rare corner cases in which a JPEG image can actually be\n\t   larger than the uncompressed input (we wouldn't mention it if it hadn't\n\t   happened before.) */\n\tretval=PAD(width, 16) * PAD(height, 16) * 6 + 2048;\n\n\tbailout:\n\treturn retval;\n}\n\n\nDLLEXPORT unsigned long DLLCALL tjBufSizeYUV(int width, int height,\n\tint subsamp)\n{\n\tunsigned long retval=0;\n\tint pw, ph, cw, ch;\n\tif(width<1 || height<1 || subsamp<0 || subsamp>=NUMSUBOPT)\n\t\t_throw(\"tjBufSizeYUV(): Invalid argument\");\n\tpw=PAD(width, tjMCUWidth[subsamp]/8);\n\tph=PAD(height, tjMCUHeight[subsamp]/8);\n\tcw=pw*8/tjMCUWidth[subsamp];  ch=ph*8/tjMCUHeight[subsamp];\n\tretval=PAD(pw, 4)*ph + (subsamp==TJSAMP_GRAY? 0:PAD(cw, 4)*ch*2);\n\n\tbailout:\n\treturn retval;\n}\n\n\nDLLEXPORT unsigned long DLLCALL TJBUFSIZEYUV(int width, int height,\n\tint subsamp)\n{\n\treturn tjBufSizeYUV(width, height, subsamp);\n}\n\n\nDLLEXPORT int DLLCALL tjCompress2(tjhandle handle, unsigned char *srcBuf,\n\tint width, int pitch, int height, int pixelFormat, unsigned char **jpegBuf,\n\tunsigned long *jpegSize, int jpegSubsamp, int jpegQual, int flags)\n{\n\tint i, retval=0, alloc=1;  JSAMPROW *row_pointer=NULL;\n\t#ifndef JCS_EXTENSIONS\n\tunsigned char *rgbBuf=NULL;\n\t#endif\n\n\tgetinstance(handle)\n\tif((this->init&COMPRESS)==0)\n\t\t_throw(\"tjCompress2(): Instance has not been initialized for compression\");\n\n\tif(srcBuf==NULL || width<=0 || pitch<0 || height<=0 || pixelFormat<0\n\t\t|| pixelFormat>=TJ_NUMPF || jpegBuf==NULL || jpegSize==NULL\n\t\t|| jpegSubsamp<0 || jpegSubsamp>=NUMSUBOPT || jpegQual<0 || jpegQual>100)\n\t\t_throw(\"tjCompress2(): Invalid argument\");\n\n\tif(setjmp(this->jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\tretval=-1;\n\t\tgoto bailout;\n\t}\n\n\tif(pitch==0) pitch=width*tjPixelSize[pixelFormat];\n\n\t#ifndef JCS_EXTENSIONS\n\tif(pixelFormat!=TJPF_GRAY)\n\t{\n\t\trgbBuf=(unsigned char *)malloc(width*height*RGB_PIXELSIZE);\n\t\tif(!rgbBuf) _throw(\"tjCompress2(): Memory allocation failure\");\n\t\tsrcBuf=toRGB(srcBuf, width, pitch, height, pixelFormat, rgbBuf);\n\t\tpitch=width*RGB_PIXELSIZE;\n\t}\n\t#endif\n\n\tcinfo->image_width=width;\n\tcinfo->image_height=height;\n\n\tif(flags&TJFLAG_FORCEMMX) putenv(\"JSIMD_FORCEMMX=1\");\n\telse if(flags&TJFLAG_FORCESSE) putenv(\"JSIMD_FORCESSE=1\");\n\telse if(flags&TJFLAG_FORCESSE2) putenv(\"JSIMD_FORCESSE2=1\");\n\n\tif(flags&TJFLAG_NOREALLOC)\n\t{\n\t\talloc=0;  *jpegSize=tjBufSize(width, height, jpegSubsamp);\n\t}\n\tjpeg_mem_dest_tj(cinfo, jpegBuf, jpegSize, alloc);\n\tif(setCompDefaults(cinfo, pixelFormat, jpegSubsamp, jpegQual, flags)==-1)\n\t\treturn -1;\n\n\tjpeg_start_compress(cinfo, TRUE);\n\tif((row_pointer=(JSAMPROW *)malloc(sizeof(JSAMPROW)*height))==NULL)\n\t\t_throw(\"tjCompress2(): Memory allocation failure\");\n\tfor(i=0; i<height; i++)\n\t{\n\t\tif(flags&TJFLAG_BOTTOMUP) row_pointer[i]=&srcBuf[(height-i-1)*pitch];\n\t\telse row_pointer[i]=&srcBuf[i*pitch];\n\t}\n\twhile(cinfo->next_scanline<cinfo->image_height)\n\t{\n\t\tjpeg_write_scanlines(cinfo, &row_pointer[cinfo->next_scanline],\n\t\t\tcinfo->image_height-cinfo->next_scanline);\n\t}\n\tjpeg_finish_compress(cinfo);\n\n\tbailout:\n\tif(cinfo->global_state>CSTATE_START) jpeg_abort_compress(cinfo);\n\t#ifndef JCS_EXTENSIONS\n\tif(rgbBuf) free(rgbBuf);\n\t#endif\n\tif(row_pointer) free(row_pointer);\n\treturn retval;\n}\n\nDLLEXPORT int DLLCALL tjCompress(tjhandle handle, unsigned char *srcBuf,\n\tint width, int pitch, int height, int pixelSize, unsigned char *jpegBuf,\n\tunsigned long *jpegSize, int jpegSubsamp, int jpegQual, int flags)\n{\n\tint retval=0;  unsigned long size;\n\tif(flags&TJ_YUV)\n\t{\n\t\tsize=tjBufSizeYUV(width, height, jpegSubsamp);\n\t\tretval=tjEncodeYUV2(handle, srcBuf, width, pitch, height,\n\t\t\tgetPixelFormat(pixelSize, flags), jpegBuf, jpegSubsamp, flags);\n\t}\n\telse\n\t{\n\t\tretval=tjCompress2(handle, srcBuf, width, pitch, height,\n\t\t\tgetPixelFormat(pixelSize, flags), &jpegBuf, &size, jpegSubsamp, jpegQual,\n\t\t\tflags|TJFLAG_NOREALLOC);\n\t}\n\t*jpegSize=size;\n\treturn retval;\n}\n\n\nDLLEXPORT int DLLCALL tjEncodeYUV2(tjhandle handle, unsigned char *srcBuf,\n\tint width, int pitch, int height, int pixelFormat, unsigned char *dstBuf,\n\tint subsamp, int flags)\n{\n\tint i, retval=0;  JSAMPROW *row_pointer=NULL;\n\tJSAMPLE *_tmpbuf[MAX_COMPONENTS], *_tmpbuf2[MAX_COMPONENTS];\n\tJSAMPROW *tmpbuf[MAX_COMPONENTS], *tmpbuf2[MAX_COMPONENTS];\n\tJSAMPROW *outbuf[MAX_COMPONENTS];\n\tint row, pw, ph, cw[MAX_COMPONENTS], ch[MAX_COMPONENTS];\n\tJSAMPLE *ptr=dstBuf;\n\tunsigned long yuvsize=0;\n\tjpeg_component_info *compptr;\n\t#ifndef JCS_EXTENSIONS\n\tunsigned char *rgbBuf=NULL;\n\t#endif\n\n\tgetinstance(handle);\n\n\tfor(i=0; i<MAX_COMPONENTS; i++)\n\t{\n\t\ttmpbuf[i]=NULL;  _tmpbuf[i]=NULL;\n\t\ttmpbuf2[i]=NULL;  _tmpbuf2[i]=NULL;  outbuf[i]=NULL;\n\t}\n\n\tif((this->init&COMPRESS)==0)\n\t\t_throw(\"tjEncodeYUV2(): Instance has not been initialized for compression\");\n\n\tif(srcBuf==NULL || width<=0 || pitch<0 || height<=0 || pixelFormat<0\n\t\t|| pixelFormat>=TJ_NUMPF || dstBuf==NULL || subsamp<0\n\t\t|| subsamp>=NUMSUBOPT)\n\t\t_throw(\"tjEncodeYUV2(): Invalid argument\");\n\n\tif(setjmp(this->jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\tretval=-1;\n\t\tgoto bailout;\n\t}\n\n\tif(pitch==0) pitch=width*tjPixelSize[pixelFormat];\n\n\t#ifndef JCS_EXTENSIONS\n\tif(pixelFormat!=TJPF_GRAY)\n\t{\n\t\trgbBuf=(unsigned char *)malloc(width*height*RGB_PIXELSIZE);\n\t\tif(!rgbBuf) _throw(\"tjEncodeYUV2(): Memory allocation failure\");\n\t\tsrcBuf=toRGB(srcBuf, width, pitch, height, pixelFormat, rgbBuf);\n\t\tpitch=width*RGB_PIXELSIZE;\n\t}\n\t#endif\n\n\tcinfo->image_width=width;\n\tcinfo->image_height=height;\n\n\tif(flags&TJFLAG_FORCEMMX) putenv(\"JSIMD_FORCEMMX=1\");\n\telse if(flags&TJFLAG_FORCESSE) putenv(\"JSIMD_FORCESSE=1\");\n\telse if(flags&TJFLAG_FORCESSE2) putenv(\"JSIMD_FORCESSE2=1\");\n\n\tyuvsize=tjBufSizeYUV(width, height, subsamp);\n\tif(setCompDefaults(cinfo, pixelFormat, subsamp, -1, flags)==-1) return -1;\n\n\t/* Execute only the parts of jpeg_start_compress() that we need.  If we\n\t   were to call the whole jpeg_start_compress() function, then it would try\n\t   to write the file headers, which could overflow the output buffer if the\n\t   YUV image were very small. */\n\tif(cinfo->global_state!=CSTATE_START)\n\t\t_throw(\"tjEncodeYUV3(): libjpeg API is in the wrong state\");\n\t(*cinfo->err->reset_error_mgr)((j_common_ptr)cinfo);\n\tjinit_c_master_control(cinfo, FALSE);\n\tjinit_color_converter(cinfo);\n\tjinit_downsampler(cinfo);\n\t(*cinfo->cconvert->start_pass)(cinfo);\n\n\tpw=PAD(width, cinfo->max_h_samp_factor);\n\tph=PAD(height, cinfo->max_v_samp_factor);\n\n\tif((row_pointer=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ph))==NULL)\n\t\t_throw(\"tjEncodeYUV2(): Memory allocation failure\");\n\tfor(i=0; i<height; i++)\n\t{\n\t\tif(flags&TJFLAG_BOTTOMUP) row_pointer[i]=&srcBuf[(height-i-1)*pitch];\n\t\telse row_pointer[i]=&srcBuf[i*pitch];\n\t}\n\tif(height<ph)\n\t\tfor(i=height; i<ph; i++) row_pointer[i]=row_pointer[height-1];\n\n\tfor(i=0; i<cinfo->num_components; i++)\n\t{\n\t\tcompptr=&cinfo->comp_info[i];\n\t\t_tmpbuf[i]=(JSAMPLE *)malloc(\n\t\t\tPAD((compptr->width_in_blocks*cinfo->max_h_samp_factor*DCTSIZE)\n\t\t\t\t/compptr->h_samp_factor, 16) * cinfo->max_v_samp_factor + 16);\n\t\tif(!_tmpbuf[i]) _throw(\"tjEncodeYUV2(): Memory allocation failure\");\n\t\ttmpbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*cinfo->max_v_samp_factor);\n\t\tif(!tmpbuf[i]) _throw(\"tjEncodeYUV2(): Memory allocation failure\");\n\t\tfor(row=0; row<cinfo->max_v_samp_factor; row++)\n\t\t{\n\t\t\tunsigned char *_tmpbuf_aligned=\n\t\t\t\t(unsigned char *)PAD((size_t)_tmpbuf[i], 16);\n\t\t\ttmpbuf[i][row]=&_tmpbuf_aligned[\n\t\t\t\tPAD((compptr->width_in_blocks*cinfo->max_h_samp_factor*DCTSIZE)\n\t\t\t\t\t/compptr->h_samp_factor, 16) * row];\n\t\t}\n\t\t_tmpbuf2[i]=(JSAMPLE *)malloc(PAD(compptr->width_in_blocks*DCTSIZE, 16)\n\t\t\t* compptr->v_samp_factor + 16);\n\t\tif(!_tmpbuf2[i]) _throw(\"tjEncodeYUV2(): Memory allocation failure\");\n\t\ttmpbuf2[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*compptr->v_samp_factor);\n\t\tif(!tmpbuf2[i]) _throw(\"tjEncodeYUV2(): Memory allocation failure\");\n\t\tfor(row=0; row<compptr->v_samp_factor; row++)\n\t\t{\n\t\t\tunsigned char *_tmpbuf2_aligned=\n\t\t\t\t(unsigned char *)PAD((size_t)_tmpbuf2[i], 16);\n\t\t\ttmpbuf2[i][row]=&_tmpbuf2_aligned[\n\t\t\t\tPAD(compptr->width_in_blocks*DCTSIZE, 16) * row];\n\t\t}\n\t\tcw[i]=pw*compptr->h_samp_factor/cinfo->max_h_samp_factor;\n\t\tch[i]=ph*compptr->v_samp_factor/cinfo->max_v_samp_factor;\n\t\toutbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ch[i]);\n\t\tif(!outbuf[i]) _throw(\"tjEncodeYUV2(): Memory allocation failure\");\n\t\tfor(row=0; row<ch[i]; row++)\n\t\t{\n\t\t\toutbuf[i][row]=ptr;\n\t\t\tptr+=PAD(cw[i], 4);\n\t\t}\n\t}\n\tif(yuvsize!=(unsigned long)(ptr-dstBuf))\n\t\t_throw(\"tjEncodeYUV2(): Generated image is not the correct size\");\n\n\tfor(row=0; row<ph; row+=cinfo->max_v_samp_factor)\n\t{\n\t\t(*cinfo->cconvert->color_convert)(cinfo, &row_pointer[row], tmpbuf, 0,\n\t\t\tcinfo->max_v_samp_factor);\n\t\t(cinfo->downsample->downsample)(cinfo, tmpbuf, 0, tmpbuf2, 0);\n\t\tfor(i=0, compptr=cinfo->comp_info; i<cinfo->num_components; i++, compptr++)\n\t\t\tjcopy_sample_rows(tmpbuf2[i], 0, outbuf[i],\n\t\t\t\trow*compptr->v_samp_factor/cinfo->max_v_samp_factor,\n\t\t\t\tcompptr->v_samp_factor, cw[i]);\n\t}\n\tcinfo->next_scanline+=height;\n\tjpeg_abort_compress(cinfo);\n\n\tbailout:\n\tif(cinfo->global_state>CSTATE_START) jpeg_abort_compress(cinfo);\n\t#ifndef JCS_EXTENSIONS\n\tif(rgbBuf) free(rgbBuf);\n\t#endif\n\tif(row_pointer) free(row_pointer);\n\tfor(i=0; i<MAX_COMPONENTS; i++)\n\t{\n\t\tif(tmpbuf[i]!=NULL) free(tmpbuf[i]);\n\t\tif(_tmpbuf[i]!=NULL) free(_tmpbuf[i]);\n\t\tif(tmpbuf2[i]!=NULL) free(tmpbuf2[i]);\n\t\tif(_tmpbuf2[i]!=NULL) free(_tmpbuf2[i]);\n\t\tif(outbuf[i]!=NULL) free(outbuf[i]);\n\t}\n\treturn retval;\n}\n\nDLLEXPORT int DLLCALL tjEncodeYUV(tjhandle handle, unsigned char *srcBuf,\n\tint width, int pitch, int height, int pixelSize, unsigned char *dstBuf,\n\tint subsamp, int flags)\n{\n\treturn tjEncodeYUV2(handle, srcBuf, width, pitch, height,\n\t\tgetPixelFormat(pixelSize, flags), dstBuf, subsamp, flags);\n}\n\n\n/* Decompressor */\n\nstatic tjhandle _tjInitDecompress(tjinstance *this)\n{\n\tunsigned char buffer[1];\n\n\t/* This is also straight out of example.c */\n\tthis->dinfo.err=jpeg_std_error(&this->jerr.pub);\n\tthis->jerr.pub.error_exit=my_error_exit;\n\tthis->jerr.pub.output_message=my_output_message;\n\n\tif(setjmp(this->jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\tif(this) free(this);  return NULL;\n\t}\n\n\tjpeg_create_decompress(&this->dinfo);\n\t/* Make an initial call so it will create the source manager */\n\tjpeg_mem_src_tj(&this->dinfo, buffer, 1);\n\n\tthis->init|=DECOMPRESS;\n\treturn (tjhandle)this;\n}\n\nDLLEXPORT tjhandle DLLCALL tjInitDecompress(void)\n{\n\ttjinstance *this;\n\tif((this=(tjinstance *)malloc(sizeof(tjinstance)))==NULL)\n\t{\n\t\tsnprintf(errStr, JMSG_LENGTH_MAX,\n\t\t\t\"tjInitDecompress(): Memory allocation failure\");\n\t\treturn NULL;\n\t}\n\tMEMZERO(this, sizeof(tjinstance));\n\treturn _tjInitDecompress(this);\n}\n\n\nDLLEXPORT int DLLCALL tjDecompressHeader2(tjhandle handle,\n\tunsigned char *jpegBuf, unsigned long jpegSize, int *width, int *height,\n\tint *jpegSubsamp)\n{\n\tint retval=0;\n\n\tgetinstance(handle);\n\tif((this->init&DECOMPRESS)==0)\n\t\t_throw(\"tjDecompressHeader2(): Instance has not been initialized for decompression\");\n\n\tif(jpegBuf==NULL || jpegSize<=0 || width==NULL || height==NULL\n\t\t|| jpegSubsamp==NULL)\n\t\t_throw(\"tjDecompressHeader2(): Invalid argument\");\n\n\tif(setjmp(this->jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\treturn -1;\n\t}\n\n\tjpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);\n\tjpeg_read_header(dinfo, TRUE);\n\n\t*width=dinfo->image_width;\n\t*height=dinfo->image_height;\n\t*jpegSubsamp=getSubsamp(dinfo);\n\n\tjpeg_abort_decompress(dinfo);\n\n\tif(*jpegSubsamp<0)\n\t\t_throw(\"tjDecompressHeader2(): Could not determine subsampling type for JPEG image\");\n\tif(*width<1 || *height<1)\n\t\t_throw(\"tjDecompressHeader2(): Invalid data returned in header\");\n\n\tbailout:\n\treturn retval;\n}\n\nDLLEXPORT int DLLCALL tjDecompressHeader(tjhandle handle,\n\tunsigned char *jpegBuf, unsigned long jpegSize, int *width, int *height)\n{\n\tint jpegSubsamp;\n\treturn tjDecompressHeader2(handle, jpegBuf, jpegSize, width, height,\n\t\t&jpegSubsamp);\n}\n\n\nDLLEXPORT tjscalingfactor* DLLCALL tjGetScalingFactors(int *numscalingfactors)\n{\n\tif(numscalingfactors==NULL)\n\t{\n\t\tsnprintf(errStr, JMSG_LENGTH_MAX,\n\t\t\t\"tjGetScalingFactors(): Invalid argument\");\n\t\treturn NULL;\n\t}\n\n\t*numscalingfactors=NUMSF;\n\treturn (tjscalingfactor *)sf;\n}\n\n\nDLLEXPORT int DLLCALL tjDecompress2(tjhandle handle, unsigned char *jpegBuf,\n\tunsigned long jpegSize, unsigned char *dstBuf, int width, int pitch,\n\tint height, int pixelFormat, int flags)\n{\n\tint i, retval=0;  JSAMPROW *row_pointer=NULL;\n\tint jpegwidth, jpegheight, scaledw, scaledh;\n\t#ifndef JCS_EXTENSIONS\n\tunsigned char *rgbBuf=NULL;\n\tunsigned char *_dstBuf=NULL;  int _pitch=0;\n\t#endif\n\n\tgetinstance(handle);\n\tif((this->init&DECOMPRESS)==0)\n\t\t_throw(\"tjDecompress2(): Instance has not been initialized for decompression\");\n\n\tif(jpegBuf==NULL || jpegSize<=0 || dstBuf==NULL || width<0 || pitch<0\n\t\t|| height<0 || pixelFormat<0 || pixelFormat>=TJ_NUMPF)\n\t\t_throw(\"tjDecompress2(): Invalid argument\");\n\n\tif(flags&TJFLAG_FORCEMMX) putenv(\"JSIMD_FORCEMMX=1\");\n\telse if(flags&TJFLAG_FORCESSE) putenv(\"JSIMD_FORCESSE=1\");\n\telse if(flags&TJFLAG_FORCESSE2) putenv(\"JSIMD_FORCESSE2=1\");\n\n\tif(setjmp(this->jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\tretval=-1;\n\t\tgoto bailout;\n\t}\n\n\tjpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);\n\tjpeg_read_header(dinfo, TRUE);\n\tif(setDecompDefaults(dinfo, pixelFormat, flags)==-1)\n\t{\n\t\tretval=-1;  goto bailout;\n\t}\n\n\tif(flags&TJFLAG_FASTUPSAMPLE) dinfo->do_fancy_upsampling=FALSE;\n\n\tjpegwidth=dinfo->image_width;  jpegheight=dinfo->image_height;\n\tif(width==0) width=jpegwidth;\n\tif(height==0) height=jpegheight;\n\tfor(i=0; i<NUMSF; i++)\n\t{\n\t\tscaledw=TJSCALED(jpegwidth, sf[i]);\n\t\tscaledh=TJSCALED(jpegheight, sf[i]);\n\t\tif(scaledw<=width && scaledh<=height)\n\t\t\tbreak;\n\t}\n\tif(scaledw>width || scaledh>height)\n\t\t_throw(\"tjDecompress2(): Could not scale down to desired image dimensions\");\n\twidth=scaledw;  height=scaledh;\n\tdinfo->scale_num=sf[i].num;\n\tdinfo->scale_denom=sf[i].denom;\n\n\tjpeg_start_decompress(dinfo);\n\tif(pitch==0) pitch=dinfo->output_width*tjPixelSize[pixelFormat];\n\n\t#ifndef JCS_EXTENSIONS\n\tif(pixelFormat!=TJPF_GRAY &&\n\t\t(RGB_RED!=tjRedOffset[pixelFormat] ||\n\t\t\tRGB_GREEN!=tjGreenOffset[pixelFormat] ||\n\t\t\tRGB_BLUE!=tjBlueOffset[pixelFormat] ||\n\t\t\tRGB_PIXELSIZE!=tjPixelSize[pixelFormat]))\n\t{\n\t\trgbBuf=(unsigned char *)malloc(width*height*3);\n\t\tif(!rgbBuf) _throw(\"tjDecompress2(): Memory allocation failure\");\n\t\t_pitch=pitch;  pitch=width*3;\n\t\t_dstBuf=dstBuf;  dstBuf=rgbBuf;\n\t}\n\t#endif\n\n\tif((row_pointer=(JSAMPROW *)malloc(sizeof(JSAMPROW)\n\t\t*dinfo->output_height))==NULL)\n\t\t_throw(\"tjDecompress2(): Memory allocation failure\");\n\tfor(i=0; i<(int)dinfo->output_height; i++)\n\t{\n\t\tif(flags&TJFLAG_BOTTOMUP)\n\t\t\trow_pointer[i]=&dstBuf[(dinfo->output_height-i-1)*pitch];\n\t\telse row_pointer[i]=&dstBuf[i*pitch];\n\t}\n\twhile(dinfo->output_scanline<dinfo->output_height)\n\t{\n\t\tjpeg_read_scanlines(dinfo, &row_pointer[dinfo->output_scanline],\n\t\t\tdinfo->output_height-dinfo->output_scanline);\n\t}\n\tjpeg_finish_decompress(dinfo);\n\n\t#ifndef JCS_EXTENSIONS\n\tfromRGB(rgbBuf, _dstBuf, width, _pitch, height, pixelFormat);\n\t#endif\n\n\tbailout:\n\tif(dinfo->global_state>DSTATE_START) jpeg_abort_decompress(dinfo);\n\t#ifndef JCS_EXTENSIONS\n\tif(rgbBuf) free(rgbBuf);\n\t#endif\n\tif(row_pointer) free(row_pointer);\n\treturn retval;\n}\n\nDLLEXPORT int DLLCALL tjDecompress(tjhandle handle, unsigned char *jpegBuf,\n\tunsigned long jpegSize, unsigned char *dstBuf, int width, int pitch,\n\tint height, int pixelSize, int flags)\n{\n\tif(flags&TJ_YUV)\n\t\treturn tjDecompressToYUV(handle, jpegBuf, jpegSize, dstBuf, flags);\n\telse\n\t\treturn tjDecompress2(handle, jpegBuf, jpegSize, dstBuf, width, pitch,\n\t\t\theight, getPixelFormat(pixelSize, flags), flags);\n}\n\n\nDLLEXPORT int DLLCALL tjDecompressToYUV(tjhandle handle,\n\tunsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf,\n\tint flags)\n{\n\tint i, row, retval=0;  JSAMPROW *outbuf[MAX_COMPONENTS];\n\tint cw[MAX_COMPONENTS], ch[MAX_COMPONENTS], iw[MAX_COMPONENTS],\n\t\ttmpbufsize=0, usetmpbuf=0, th[MAX_COMPONENTS];\n\tJSAMPLE *_tmpbuf=NULL, *ptr=dstBuf;  JSAMPROW *tmpbuf[MAX_COMPONENTS];\n\n\tgetinstance(handle);\n\n\tfor(i=0; i<MAX_COMPONENTS; i++)\n\t{\n\t\ttmpbuf[i]=NULL;  outbuf[i]=NULL;\n\t}\n\n\tif((this->init&DECOMPRESS)==0)\n\t\t_throw(\"tjDecompressToYUV(): Instance has not been initialized for decompression\");\n\n\tif(jpegBuf==NULL || jpegSize<=0 || dstBuf==NULL)\n\t\t_throw(\"tjDecompressToYUV(): Invalid argument\");\n\n\tif(flags&TJFLAG_FORCEMMX) putenv(\"JSIMD_FORCEMMX=1\");\n\telse if(flags&TJFLAG_FORCESSE) putenv(\"JSIMD_FORCESSE=1\");\n\telse if(flags&TJFLAG_FORCESSE2) putenv(\"JSIMD_FORCESSE2=1\");\n\n\tif(setjmp(this->jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\tretval=-1;\n\t\tgoto bailout;\n\t}\n\n\tjpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);\n\tjpeg_read_header(dinfo, TRUE);\n\n\tfor(i=0; i<dinfo->num_components; i++)\n\t{\n\t\tjpeg_component_info *compptr=&dinfo->comp_info[i];\n\t\tint ih;\n\t\tiw[i]=compptr->width_in_blocks*DCTSIZE;\n\t\tih=compptr->height_in_blocks*DCTSIZE;\n\t\tcw[i]=PAD(dinfo->image_width, dinfo->max_h_samp_factor)\n\t\t\t*compptr->h_samp_factor/dinfo->max_h_samp_factor;\n\t\tch[i]=PAD(dinfo->image_height, dinfo->max_v_samp_factor)\n\t\t\t*compptr->v_samp_factor/dinfo->max_v_samp_factor;\n\t\tif(iw[i]!=cw[i] || ih!=ch[i]) usetmpbuf=1;\n\t\tth[i]=compptr->v_samp_factor*DCTSIZE;\n\t\ttmpbufsize+=iw[i]*th[i];\n\t\tif((outbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ch[i]))==NULL)\n\t\t\t_throw(\"tjDecompressToYUV(): Memory allocation failure\");\n\t\tfor(row=0; row<ch[i]; row++)\n\t\t{\n\t\t\toutbuf[i][row]=ptr;\n\t\t\tptr+=PAD(cw[i], 4);\n\t\t}\n\t}\n\tif(usetmpbuf)\n\t{\n\t\tif((_tmpbuf=(JSAMPLE *)malloc(sizeof(JSAMPLE)*tmpbufsize))==NULL)\n\t\t\t_throw(\"tjDecompressToYUV(): Memory allocation failure\");\n\t\tptr=_tmpbuf;\n\t\tfor(i=0; i<dinfo->num_components; i++)\n\t\t{\n\t\t\tif((tmpbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*th[i]))==NULL)\n\t\t\t\t_throw(\"tjDecompressToYUV(): Memory allocation failure\");\n\t\t\tfor(row=0; row<th[i]; row++)\n\t\t\t{\n\t\t\t\ttmpbuf[i][row]=ptr;\n\t\t\t\tptr+=iw[i];\n\t\t\t}\n\t\t}\n\t}\n\n\tif(flags&TJFLAG_FASTUPSAMPLE) dinfo->do_fancy_upsampling=FALSE;\n\tif(flags&TJFLAG_FASTDCT) dinfo->dct_method=JDCT_FASTEST;\n\tdinfo->raw_data_out=TRUE;\n\n\tjpeg_start_decompress(dinfo);\n\tfor(row=0; row<(int)dinfo->output_height;\n\t\trow+=dinfo->max_v_samp_factor*DCTSIZE)\n\t{\n\t\tJSAMPARRAY yuvptr[MAX_COMPONENTS];\n\t\tint crow[MAX_COMPONENTS];\n\t\tfor(i=0; i<dinfo->num_components; i++)\n\t\t{\n\t\t\tjpeg_component_info *compptr=&dinfo->comp_info[i];\n\t\t\tcrow[i]=row*compptr->v_samp_factor/dinfo->max_v_samp_factor;\n\t\t\tif(usetmpbuf) yuvptr[i]=tmpbuf[i];\n\t\t\telse yuvptr[i]=&outbuf[i][crow[i]];\n\t\t}\n\t\tjpeg_read_raw_data(dinfo, yuvptr, dinfo->max_v_samp_factor*DCTSIZE);\n\t\tif(usetmpbuf)\n\t\t{\n\t\t\tint j;\n\t\t\tfor(i=0; i<dinfo->num_components; i++)\n\t\t\t{\n\t\t\t\tfor(j=0; j<min(th[i], ch[i]-crow[i]); j++)\n\t\t\t\t{\n\t\t\t\t\tmemcpy(outbuf[i][crow[i]+j], tmpbuf[i][j], cw[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tjpeg_finish_decompress(dinfo);\n\n\tbailout:\n\tif(dinfo->global_state>DSTATE_START) jpeg_abort_decompress(dinfo);\n\tfor(i=0; i<MAX_COMPONENTS; i++)\n\t{\n\t\tif(tmpbuf[i]) free(tmpbuf[i]);\n\t\tif(outbuf[i]) free(outbuf[i]);\n\t}\n\tif(_tmpbuf) free(_tmpbuf);\n\treturn retval;\n}\n\n\n/* Transformer */\n\nDLLEXPORT tjhandle DLLCALL tjInitTransform(void)\n{\n\ttjinstance *this=NULL;  tjhandle handle=NULL;\n\tif((this=(tjinstance *)malloc(sizeof(tjinstance)))==NULL)\n\t{\n\t\tsnprintf(errStr, JMSG_LENGTH_MAX,\n\t\t\t\"tjInitTransform(): Memory allocation failure\");\n\t\treturn NULL;\n\t}\n\tMEMZERO(this, sizeof(tjinstance));\n\thandle=_tjInitCompress(this);\n\tif(!handle) return NULL;\n\thandle=_tjInitDecompress(this);\n\treturn handle;\n}\n\n\nDLLEXPORT int DLLCALL tjTransform(tjhandle handle, unsigned char *jpegBuf,\n\tunsigned long jpegSize, int n, unsigned char **dstBufs,\n\tunsigned long *dstSizes, tjtransform *t, int flags)\n{\n\tjpeg_transform_info *xinfo=NULL;\n\tjvirt_barray_ptr *srccoefs, *dstcoefs;\n\tint retval=0, i, jpegSubsamp;\n\n\tgetinstance(handle);\n\tif((this->init&COMPRESS)==0 || (this->init&DECOMPRESS)==0)\n\t\t_throw(\"tjTransform(): Instance has not been initialized for transformation\");\n\n\tif(jpegBuf==NULL || jpegSize<=0 || n<1 || dstBufs==NULL || dstSizes==NULL\n\t\t|| t==NULL || flags<0)\n\t\t_throw(\"tjTransform(): Invalid argument\");\n\n\tif(flags&TJFLAG_FORCEMMX) putenv(\"JSIMD_FORCEMMX=1\");\n\telse if(flags&TJFLAG_FORCESSE) putenv(\"JSIMD_FORCESSE=1\");\n\telse if(flags&TJFLAG_FORCESSE2) putenv(\"JSIMD_FORCESSE2=1\");\n\n\tif(setjmp(this->jerr.setjmp_buffer))\n\t{\n\t\t/* If we get here, the JPEG code has signaled an error. */\n\t\tretval=-1;\n\t\tgoto bailout;\n\t}\n\n\tjpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);\n\n\tif((xinfo=(jpeg_transform_info *)malloc(sizeof(jpeg_transform_info)*n))\n\t\t==NULL)\n\t\t_throw(\"tjTransform(): Memory allocation failure\");\n\tMEMZERO(xinfo, sizeof(jpeg_transform_info)*n);\n\n\tfor(i=0; i<n; i++)\n\t{\n\t\txinfo[i].transform=xformtypes[t[i].op];\n\t\txinfo[i].perfect=(t[i].options&TJXOPT_PERFECT)? 1:0;\n\t\txinfo[i].trim=(t[i].options&TJXOPT_TRIM)? 1:0;\n\t\txinfo[i].force_grayscale=(t[i].options&TJXOPT_GRAY)? 1:0;\n\t\txinfo[i].crop=(t[i].options&TJXOPT_CROP)? 1:0;\n\t\tif(n!=1 && t[i].op==TJXOP_HFLIP) xinfo[i].slow_hflip=1;\n\t\telse xinfo[i].slow_hflip=0;\n\n\t\tif(xinfo[i].crop)\n\t\t{\n\t\t\txinfo[i].crop_xoffset=t[i].r.x;  xinfo[i].crop_xoffset_set=JCROP_POS;\n\t\t\txinfo[i].crop_yoffset=t[i].r.y;  xinfo[i].crop_yoffset_set=JCROP_POS;\n\t\t\tif(t[i].r.w!=0)\n\t\t\t{\n\t\t\t\txinfo[i].crop_width=t[i].r.w;  xinfo[i].crop_width_set=JCROP_POS;\n\t\t\t}\n\t\t\telse xinfo[i].crop_width=JCROP_UNSET;\n\t\t\tif(t[i].r.h!=0)\n\t\t\t{\n\t\t\t\txinfo[i].crop_height=t[i].r.h;  xinfo[i].crop_height_set=JCROP_POS;\n\t\t\t}\n\t\t\telse xinfo[i].crop_height=JCROP_UNSET;\n\t\t}\n\t}\n\n\tjcopy_markers_setup(dinfo, JCOPYOPT_ALL);\n\tjpeg_read_header(dinfo, TRUE);\n\tjpegSubsamp=getSubsamp(dinfo);\n\tif(jpegSubsamp<0)\n\t\t_throw(\"tjTransform(): Could not determine subsampling type for JPEG image\");\n\n\tfor(i=0; i<n; i++)\n\t{\n\t\tif(!jtransform_request_workspace(dinfo, &xinfo[i]))\n\t\t\t_throw(\"tjTransform(): Transform is not perfect\");\n\n\t\tif(xinfo[i].crop)\n\t\t{\n\t\t\tif((t[i].r.x%xinfo[i].iMCU_sample_width)!=0\n\t\t\t\t|| (t[i].r.y%xinfo[i].iMCU_sample_height)!=0)\n\t\t\t{\n\t\t\t\tsnprintf(errStr, JMSG_LENGTH_MAX,\n\t\t\t\t\t\"To crop this JPEG image, x must be a multiple of %d\\n\"\n\t\t\t\t\t\"and y must be a multiple of %d.\\n\",\n\t\t\t\t\txinfo[i].iMCU_sample_width, xinfo[i].iMCU_sample_height);\n\t\t\t\tretval=-1;  goto bailout;\n\t\t\t}\n\t\t}\n\t}\n\n\tsrccoefs=jpeg_read_coefficients(dinfo);\n\n\tfor(i=0; i<n; i++)\n\t{\n\t\tint w, h, alloc=1;\n\t\tif(!xinfo[i].crop)\n\t\t{\n\t\t\tw=dinfo->image_width;  h=dinfo->image_height;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tw=xinfo[i].crop_width;  h=xinfo[i].crop_height;\n\t\t}\n\t\tif(flags&TJFLAG_NOREALLOC)\n\t\t{\n\t\t\talloc=0;  dstSizes[i]=tjBufSize(w, h, jpegSubsamp);\n\t\t}\n\t\tif(!(t[i].options&TJXOPT_NOOUTPUT))\n\t\t\tjpeg_mem_dest_tj(cinfo, &dstBufs[i], &dstSizes[i], alloc);\n\t\tjpeg_copy_critical_parameters(dinfo, cinfo);\n\t\tdstcoefs=jtransform_adjust_parameters(dinfo, cinfo, srccoefs,\n\t\t\t&xinfo[i]);\n\t\tif(!(t[i].options&TJXOPT_NOOUTPUT))\n\t\t{\n\t\t\tjpeg_write_coefficients(cinfo, dstcoefs);\n\t\t\tjcopy_markers_execute(dinfo, cinfo, JCOPYOPT_ALL);\n\t\t}\n\t\telse jinit_c_master_control(cinfo, TRUE);\n\t\tjtransform_execute_transformation(dinfo, cinfo, srccoefs,\n\t\t\t&xinfo[i]);\n\t\tif(t[i].customFilter)\n\t\t{\n\t\t\tint ci, y;  JDIMENSION by;\n\t\t\tfor(ci=0; ci<cinfo->num_components; ci++)\n\t\t\t{\n\t\t\t\tjpeg_component_info *compptr=&cinfo->comp_info[ci];\n\t\t\t\ttjregion arrayRegion={0, 0, compptr->width_in_blocks*DCTSIZE,\n\t\t\t\t\tDCTSIZE};\n\t\t\t\ttjregion planeRegion={0, 0, compptr->width_in_blocks*DCTSIZE,\n\t\t\t\t\tcompptr->height_in_blocks*DCTSIZE};\n\t\t\t\tfor(by=0; by<compptr->height_in_blocks; by+=compptr->v_samp_factor)\n\t\t\t\t{\n\t\t\t\t\tJBLOCKARRAY barray=(dinfo->mem->access_virt_barray)\n\t\t\t\t\t\t((j_common_ptr)dinfo, dstcoefs[ci], by, compptr->v_samp_factor,\n\t\t\t\t\t\tTRUE);\n\t\t\t\t\tfor(y=0; y<compptr->v_samp_factor; y++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(t[i].customFilter(barray[y][0], arrayRegion, planeRegion,\n\t\t\t\t\t\t\tci, i, &t[i])==-1)\n\t\t\t\t\t\t\t_throw(\"tjTransform(): Error in custom filter\");\n\t\t\t\t\t\tarrayRegion.y+=DCTSIZE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!(t[i].options&TJXOPT_NOOUTPUT)) jpeg_finish_compress(cinfo);\n\t}\n\n\tjpeg_finish_decompress(dinfo);\n\n\tbailout:\n\tif(cinfo->global_state>CSTATE_START) jpeg_abort_compress(cinfo);\n\tif(dinfo->global_state>DSTATE_START) jpeg_abort_decompress(dinfo);\n\tif(xinfo) free(xinfo);\n\treturn retval;\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/turbojpeg.h",
    "content": "/*\n * Copyright (C)2009-2013 D. R. Commander.  All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice,\n *   this list of conditions and the following disclaimer.\n * - Redistributions in binary form must reproduce the above copyright notice,\n *   this list of conditions and the following disclaimer in the documentation\n *   and/or other materials provided with the distribution.\n * - Neither the name of the libjpeg-turbo Project nor the names of its\n *   contributors may be used to endorse or promote products derived from this\n *   software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef __TURBOJPEG_H__\n#define __TURBOJPEG_H__\n\n#if defined(_WIN32) && defined(DLLDEFINE)\n#define DLLEXPORT __declspec(dllexport)\n#else\n#define DLLEXPORT\n#endif\n#define DLLCALL\n\n\n/**\n * @addtogroup TurboJPEG\n * TurboJPEG API.  This API provides an interface for generating, decoding, and\n * transforming planar YUV and JPEG images in memory.\n *\n * @{\n */\n\n\n/**\n * The number of chrominance subsampling options\n */\n#define TJ_NUMSAMP 5\n\n/**\n * Chrominance subsampling options.\n * When an image is converted from the RGB to the YCbCr colorspace as part of\n * the JPEG compression process, some of the Cb and Cr (chrominance) components\n * can be discarded or averaged together to produce a smaller image with little\n * perceptible loss of image clarity (the human eye is more sensitive to small\n * changes in brightness than small changes in color.)  This is called\n * \"chrominance subsampling\".\n * <p>\n * NOTE: Technically, the JPEG format uses the YCbCr colorspace, but per the\n * convention of the digital video community, the TurboJPEG API uses \"YUV\" to\n * refer to an image format consisting of Y, Cb, and Cr image planes.\n */\nenum TJSAMP\n{\n  /**\n   * 4:4:4 chrominance subsampling (no chrominance subsampling).  The JPEG or\n   * YUV image will contain one chrominance component for every pixel in the\n   * source image.\n   */\n  TJSAMP_444=0,\n  /**\n   * 4:2:2 chrominance subsampling.  The JPEG or YUV image will contain one\n   * chrominance component for every 2x1 block of pixels in the source image.\n   */\n  TJSAMP_422,\n  /**\n   * 4:2:0 chrominance subsampling.  The JPEG or YUV image will contain one\n   * chrominance component for every 2x2 block of pixels in the source image.\n   */\n  TJSAMP_420,\n  /**\n   * Grayscale.  The JPEG or YUV image will contain no chrominance components.\n   */\n  TJSAMP_GRAY,\n  /**\n   * 4:4:0 chrominance subsampling.  The JPEG or YUV image will contain one\n   * chrominance component for every 1x2 block of pixels in the source image.\n   * Note that 4:4:0 subsampling is not fully accelerated in libjpeg-turbo.\n   */\n  TJSAMP_440\n};\n\n/**\n * MCU block width (in pixels) for a given level of chrominance subsampling.\n * MCU block sizes:\n * - 8x8 for no subsampling or grayscale\n * - 16x8 for 4:2:2\n * - 8x16 for 4:4:0\n * - 16x16 for 4:2:0 \n */\nstatic const int tjMCUWidth[TJ_NUMSAMP]  = {8, 16, 16, 8, 8};\n\n/**\n * MCU block height (in pixels) for a given level of chrominance subsampling.\n * MCU block sizes:\n * - 8x8 for no subsampling or grayscale\n * - 16x8 for 4:2:2\n * - 8x16 for 4:4:0\n * - 16x16 for 4:2:0 \n */\nstatic const int tjMCUHeight[TJ_NUMSAMP] = {8, 8, 16, 8, 16};\n\n\n/**\n * The number of pixel formats\n */\n#define TJ_NUMPF 11\n\n/**\n * Pixel formats\n */\nenum TJPF\n{\n  /**\n   * RGB pixel format.  The red, green, and blue components in the image are\n   * stored in 3-byte pixels in the order R, G, B from lowest to highest byte\n   * address within each pixel.\n   */\n  TJPF_RGB=0,\n  /**\n   * BGR pixel format.  The red, green, and blue components in the image are\n   * stored in 3-byte pixels in the order B, G, R from lowest to highest byte\n   * address within each pixel.\n   */\n  TJPF_BGR,\n  /**\n   * RGBX pixel format.  The red, green, and blue components in the image are\n   * stored in 4-byte pixels in the order R, G, B from lowest to highest byte\n   * address within each pixel.  The X component is ignored when compressing\n   * and undefined when decompressing.\n   */\n  TJPF_RGBX,\n  /**\n   * BGRX pixel format.  The red, green, and blue components in the image are\n   * stored in 4-byte pixels in the order B, G, R from lowest to highest byte\n   * address within each pixel.  The X component is ignored when compressing\n   * and undefined when decompressing.\n   */\n  TJPF_BGRX,\n  /**\n   * XBGR pixel format.  The red, green, and blue components in the image are\n   * stored in 4-byte pixels in the order R, G, B from highest to lowest byte\n   * address within each pixel.  The X component is ignored when compressing\n   * and undefined when decompressing.\n   */\n  TJPF_XBGR,\n  /**\n   * XRGB pixel format.  The red, green, and blue components in the image are\n   * stored in 4-byte pixels in the order B, G, R from highest to lowest byte\n   * address within each pixel.  The X component is ignored when compressing\n   * and undefined when decompressing.\n   */\n  TJPF_XRGB,\n  /**\n   * Grayscale pixel format.  Each 1-byte pixel represents a luminance\n   * (brightness) level from 0 to 255.\n   */\n  TJPF_GRAY,\n  /**\n   * RGBA pixel format.  This is the same as @ref TJPF_RGBX, except that when\n   * decompressing, the X component is guaranteed to be 0xFF, which can be\n   * interpreted as an opaque alpha channel.\n   */\n  TJPF_RGBA,\n  /**\n   * BGRA pixel format.  This is the same as @ref TJPF_BGRX, except that when\n   * decompressing, the X component is guaranteed to be 0xFF, which can be\n   * interpreted as an opaque alpha channel.\n   */\n  TJPF_BGRA,\n  /**\n   * ABGR pixel format.  This is the same as @ref TJPF_XBGR, except that when\n   * decompressing, the X component is guaranteed to be 0xFF, which can be\n   * interpreted as an opaque alpha channel.\n   */\n  TJPF_ABGR,\n  /**\n   * ARGB pixel format.  This is the same as @ref TJPF_XRGB, except that when\n   * decompressing, the X component is guaranteed to be 0xFF, which can be\n   * interpreted as an opaque alpha channel.\n   */\n  TJPF_ARGB\n};\n\n/**\n * Red offset (in bytes) for a given pixel format.  This specifies the number\n * of bytes that the red component is offset from the start of the pixel.  For\n * instance, if a pixel of format TJ_BGRX is stored in <tt>char pixel[]</tt>,\n * then the red component will be <tt>pixel[tjRedOffset[TJ_BGRX]]</tt>.\n */\nstatic const int tjRedOffset[TJ_NUMPF] = {0, 2, 0, 2, 3, 1, 0, 0, 2, 3, 1};\n/**\n * Green offset (in bytes) for a given pixel format.  This specifies the number\n * of bytes that the green component is offset from the start of the pixel.\n * For instance, if a pixel of format TJ_BGRX is stored in\n * <tt>char pixel[]</tt>, then the green component will be\n * <tt>pixel[tjGreenOffset[TJ_BGRX]]</tt>.\n */\nstatic const int tjGreenOffset[TJ_NUMPF] = {1, 1, 1, 1, 2, 2, 0, 1, 1, 2, 2};\n/**\n * Blue offset (in bytes) for a given pixel format.  This specifies the number\n * of bytes that the Blue component is offset from the start of the pixel.  For\n * instance, if a pixel of format TJ_BGRX is stored in <tt>char pixel[]</tt>,\n * then the blue component will be <tt>pixel[tjBlueOffset[TJ_BGRX]]</tt>.\n */\nstatic const int tjBlueOffset[TJ_NUMPF] = {2, 0, 2, 0, 1, 3, 0, 2, 0, 1, 3};\n\n/**\n * Pixel size (in bytes) for a given pixel format.\n */\nstatic const int tjPixelSize[TJ_NUMPF] = {3, 3, 4, 4, 4, 4, 1, 4, 4, 4, 4};\n\n\n/**\n * The uncompressed source/destination image is stored in bottom-up (Windows,\n * OpenGL) order, not top-down (X11) order.\n */\n#define TJFLAG_BOTTOMUP        2\n/**\n * Turn off CPU auto-detection and force TurboJPEG to use MMX code (if the\n * underlying codec supports it.)\n */\n#define TJFLAG_FORCEMMX        8\n/**\n * Turn off CPU auto-detection and force TurboJPEG to use SSE code (if the\n * underlying codec supports it.)\n */\n#define TJFLAG_FORCESSE       16\n/**\n * Turn off CPU auto-detection and force TurboJPEG to use SSE2 code (if the\n * underlying codec supports it.)\n */\n#define TJFLAG_FORCESSE2      32\n/**\n * Turn off CPU auto-detection and force TurboJPEG to use SSE3 code (if the\n * underlying codec supports it.)\n */\n#define TJFLAG_FORCESSE3     128\n/**\n * When decompressing an image that was compressed using chrominance\n * subsampling, use the fastest chrominance upsampling algorithm available in\n * the underlying codec.  The default is to use smooth upsampling, which\n * creates a smooth transition between neighboring chrominance components in\n * order to reduce upsampling artifacts in the decompressed image.\n */\n#define TJFLAG_FASTUPSAMPLE  256\n/**\n * Disable buffer (re)allocation.  If passed to #tjCompress2() or\n * #tjTransform(), this flag will cause those functions to generate an error if\n * the JPEG image buffer is invalid or too small rather than attempting to\n * allocate or reallocate that buffer.  This reproduces the behavior of earlier\n * versions of TurboJPEG.\n */\n#define TJFLAG_NOREALLOC     1024\n/**\n * Use the fastest DCT/IDCT algorithm available in the underlying codec.  The\n * default if this flag is not specified is implementation-specific.  For\n * example, the implementation of TurboJPEG for libjpeg[-turbo] uses the fast\n * algorithm by default when compressing, because this has been shown to have\n * only a very slight effect on accuracy, but it uses the accurate algorithm\n * when decompressing, because this has been shown to have a larger effect.\n */\n#define TJFLAG_FASTDCT       2048\n/**\n * Use the most accurate DCT/IDCT algorithm available in the underlying codec.\n * The default if this flag is not specified is implementation-specific.  For\n * example, the implementation of TurboJPEG for libjpeg[-turbo] uses the fast\n * algorithm by default when compressing, because this has been shown to have\n * only a very slight effect on accuracy, but it uses the accurate algorithm\n * when decompressing, because this has been shown to have a larger effect.\n */\n#define TJFLAG_ACCURATEDCT   4096\n\n\n/**\n * The number of transform operations\n */\n#define TJ_NUMXOP 8\n\n/**\n * Transform operations for #tjTransform()\n */\nenum TJXOP\n{\n  /**\n   * Do not transform the position of the image pixels\n   */\n  TJXOP_NONE=0,\n  /**\n   * Flip (mirror) image horizontally.  This transform is imperfect if there\n   * are any partial MCU blocks on the right edge (see #TJXOPT_PERFECT.)\n   */\n  TJXOP_HFLIP,\n  /**\n   * Flip (mirror) image vertically.  This transform is imperfect if there are\n   * any partial MCU blocks on the bottom edge (see #TJXOPT_PERFECT.)\n   */\n  TJXOP_VFLIP,\n  /**\n   * Transpose image (flip/mirror along upper left to lower right axis.)  This\n   * transform is always perfect.\n   */\n  TJXOP_TRANSPOSE,\n  /**\n   * Transverse transpose image (flip/mirror along upper right to lower left\n   * axis.)  This transform is imperfect if there are any partial MCU blocks in\n   * the image (see #TJXOPT_PERFECT.)\n   */\n  TJXOP_TRANSVERSE,\n  /**\n   * Rotate image clockwise by 90 degrees.  This transform is imperfect if\n   * there are any partial MCU blocks on the bottom edge (see\n   * #TJXOPT_PERFECT.)\n   */\n  TJXOP_ROT90,\n  /**\n   * Rotate image 180 degrees.  This transform is imperfect if there are any\n   * partial MCU blocks in the image (see #TJXOPT_PERFECT.)\n   */\n  TJXOP_ROT180,\n  /**\n   * Rotate image counter-clockwise by 90 degrees.  This transform is imperfect\n   * if there are any partial MCU blocks on the right edge (see\n   * #TJXOPT_PERFECT.)\n   */\n  TJXOP_ROT270\n};\n\n\n/**\n * This option will cause #tjTransform() to return an error if the transform is\n * not perfect.  Lossless transforms operate on MCU blocks, whose size depends\n * on the level of chrominance subsampling used (see #tjMCUWidth\n * and #tjMCUHeight.)  If the image's width or height is not evenly divisible\n * by the MCU block size, then there will be partial MCU blocks on the right\n * and/or bottom edges.  It is not possible to move these partial MCU blocks to\n * the top or left of the image, so any transform that would require that is\n * \"imperfect.\"  If this option is not specified, then any partial MCU blocks\n * that cannot be transformed will be left in place, which will create\n * odd-looking strips on the right or bottom edge of the image.\n */\n#define TJXOPT_PERFECT  1\n/**\n * This option will cause #tjTransform() to discard any partial MCU blocks that\n * cannot be transformed.\n */\n#define TJXOPT_TRIM     2\n/**\n * This option will enable lossless cropping.  See #tjTransform() for more\n * information.\n */\n#define TJXOPT_CROP     4\n/**\n * This option will discard the color data in the input image and produce\n * a grayscale output image.\n */\n#define TJXOPT_GRAY     8\n/**\n * This option will prevent #tjTransform() from outputting a JPEG image for\n * this particular transform (this can be used in conjunction with a custom\n * filter to capture the transformed DCT coefficients without transcoding\n * them.)\n */\n#define TJXOPT_NOOUTPUT 16\n\n\n/**\n * Scaling factor\n */\ntypedef struct\n{\n  /**\n   * Numerator\n   */\n  int num;\n  /**\n   * Denominator\n   */\n  int denom;\n} tjscalingfactor;\n\n/**\n * Cropping region\n */\ntypedef struct\n{\n  /**\n   * The left boundary of the cropping region.  This must be evenly divisible\n   * by the MCU block width (see #tjMCUWidth.)\n   */\n  int x;\n  /**\n   * The upper boundary of the cropping region.  This must be evenly divisible\n   * by the MCU block height (see #tjMCUHeight.)\n   */\n  int y;\n  /**\n   * The width of the cropping region. Setting this to 0 is the equivalent of\n   * setting it to the width of the source JPEG image - x.\n   */\n  int w;\n  /**\n   * The height of the cropping region. Setting this to 0 is the equivalent of\n   * setting it to the height of the source JPEG image - y.\n   */\n  int h;\n} tjregion;\n\n/**\n * Lossless transform\n */\ntypedef struct tjtransform\n{\n  /**\n   * Cropping region\n   */\n  tjregion r;\n  /**\n   * One of the @ref TJXOP \"transform operations\"\n   */\n  int op;\n  /**\n   * The bitwise OR of one of more of the @ref TJXOPT_CROP \"transform options\"\n   */\n  int options;\n  /**\n   * Arbitrary data that can be accessed within the body of the callback\n   * function\n   */\n  void *data;\n  /**\n   * A callback function that can be used to modify the DCT coefficients\n   * after they are losslessly transformed but before they are transcoded to a\n   * new JPEG image.  This allows for custom filters or other transformations\n   * to be applied in the frequency domain.\n   *\n   * @param coeffs pointer to an array of transformed DCT coefficients.  (NOTE:\n   *        this pointer is not guaranteed to be valid once the callback\n   *        returns, so applications wishing to hand off the DCT coefficients\n   *        to another function or library should make a copy of them within\n   *        the body of the callback.)\n   * @param arrayRegion #tjregion structure containing the width and height of\n   *        the array pointed to by <tt>coeffs</tt> as well as its offset\n   *        relative to the component plane.  TurboJPEG implementations may\n   *        choose to split each component plane into multiple DCT coefficient\n   *        arrays and call the callback function once for each array.\n   * @param planeRegion #tjregion structure containing the width and height of\n   *        the component plane to which <tt>coeffs</tt> belongs\n   * @param componentID ID number of the component plane to which\n   *        <tt>coeffs</tt> belongs (Y, Cb, and Cr have, respectively, ID's of\n   *        0, 1, and 2 in typical JPEG images.)\n   * @param transformID ID number of the transformed image to which\n   *        <tt>coeffs</tt> belongs.  This is the same as the index of the\n   *        transform in the <tt>transforms</tt> array that was passed to\n   *        #tjTransform().\n   * @param transform a pointer to a #tjtransform structure that specifies the\n   *        parameters and/or cropping region for this transform\n   *\n   * @return 0 if the callback was successful, or -1 if an error occurred.\n   */\n  int (*customFilter)(short *coeffs, tjregion arrayRegion,\n    tjregion planeRegion, int componentIndex, int transformIndex,\n    struct tjtransform *transform);\n} tjtransform;\n\n/**\n * TurboJPEG instance handle\n */\ntypedef void* tjhandle;\n\n\n/**\n * Pad the given width to the nearest 32-bit boundary\n */\n#define TJPAD(width) (((width)+3)&(~3))\n\n/**\n * Compute the scaled value of <tt>dimension</tt> using the given scaling\n * factor.  This macro performs the integer equivalent of <tt>ceil(dimension *\n * scalingFactor)</tt>. \n */\n#define TJSCALED(dimension, scalingFactor) ((dimension * scalingFactor.num \\\n  + scalingFactor.denom - 1) / scalingFactor.denom)\n\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n\n/**\n * Create a TurboJPEG compressor instance.\n *\n * @return a handle to the newly-created instance, or NULL if an error\n * occurred (see #tjGetErrorStr().)\n */\nDLLEXPORT tjhandle DLLCALL tjInitCompress(void);\n\n\n/**\n * Compress an RGB or grayscale image into a JPEG image.\n *\n * @param handle a handle to a TurboJPEG compressor or transformer instance\n * @param srcBuf pointer to an image buffer containing RGB or grayscale pixels\n *        to be compressed\n * @param width width (in pixels) of the source image\n * @param pitch bytes per line of the source image.  Normally, this should be\n *        <tt>width * #tjPixelSize[pixelFormat]</tt> if the image is unpadded,\n *        or <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each line of\n *        the image is padded to the nearest 32-bit boundary, as is the case\n *        for Windows bitmaps.  You can also be clever and use this parameter\n *        to skip lines, etc.  Setting this parameter to 0 is the equivalent of\n *        setting it to <tt>width * #tjPixelSize[pixelFormat]</tt>.\n * @param height height (in pixels) of the source image\n * @param pixelFormat pixel format of the source image (see @ref TJPF\n *        \"Pixel formats\".)\n * @param jpegBuf address of a pointer to an image buffer that will receive the\n *        JPEG image.  TurboJPEG has the ability to reallocate the JPEG buffer\n *        to accommodate the size of the JPEG image.  Thus, you can choose to:\n *        -# pre-allocate the JPEG buffer with an arbitrary size using\n *        #tjAlloc() and let TurboJPEG grow the buffer as needed,\n *        -# set <tt>*jpegBuf</tt> to NULL to tell TurboJPEG to allocate the\n *        buffer for you, or\n *        -# pre-allocate the buffer to a \"worst case\" size determined by\n *        calling #tjBufSize().  This should ensure that the buffer never has\n *        to be re-allocated (setting #TJFLAG_NOREALLOC guarantees this.)\n *        .\n *        If you choose option 1, <tt>*jpegSize</tt> should be set to the\n *        size of your pre-allocated buffer.  In any case, unless you have\n *        set #TJFLAG_NOREALLOC, you should always check <tt>*jpegBuf</tt> upon\n *        return from this function, as it may have changed.\n * @param jpegSize pointer to an unsigned long variable that holds the size of\n *        the JPEG image buffer.  If <tt>*jpegBuf</tt> points to a\n *        pre-allocated buffer, then <tt>*jpegSize</tt> should be set to the\n *        size of the buffer.  Upon return, <tt>*jpegSize</tt> will contain the\n *        size of the JPEG image (in bytes.)\n * @param jpegSubsamp the level of chrominance subsampling to be used when\n *        generating the JPEG image (see @ref TJSAMP\n *        \"Chrominance subsampling options\".)\n * @param jpegQual the image quality of the generated JPEG image (1 = worst,\n          100 = best)\n * @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP\n *        \"flags\".\n *\n * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)\n*/\nDLLEXPORT int DLLCALL tjCompress2(tjhandle handle, unsigned char *srcBuf,\n  int width, int pitch, int height, int pixelFormat, unsigned char **jpegBuf,\n  unsigned long *jpegSize, int jpegSubsamp, int jpegQual, int flags);\n\n\n/**\n * The maximum size of the buffer (in bytes) required to hold a JPEG image with\n * the given parameters.  The number of bytes returned by this function is\n * larger than the size of the uncompressed source image.  The reason for this\n * is that the JPEG format uses 16-bit coefficients, and it is thus possible\n * for a very high-quality JPEG image with very high-frequency content to\n * expand rather than compress when converted to the JPEG format.  Such images\n * represent a very rare corner case, but since there is no way to predict the\n * size of a JPEG image prior to compression, the corner case has to be\n * handled.\n *\n * @param width width of the image (in pixels)\n * @param height height of the image (in pixels)\n * @param jpegSubsamp the level of chrominance subsampling to be used when\n *        generating the JPEG image (see @ref TJSAMP\n *        \"Chrominance subsampling options\".)\n *\n * @return the maximum size of the buffer (in bytes) required to hold the\n * image, or -1 if the arguments are out of bounds.\n */\nDLLEXPORT unsigned long DLLCALL tjBufSize(int width, int height,\n  int jpegSubsamp);\n\n\n/**\n * The size of the buffer (in bytes) required to hold a YUV planar image with\n * the given parameters.\n *\n * @param width width of the image (in pixels)\n * @param height height of the image (in pixels)\n * @param subsamp level of chrominance subsampling in the image (see\n *        @ref TJSAMP \"Chrominance subsampling options\".)\n *\n * @return the size of the buffer (in bytes) required to hold the image, or\n * -1 if the arguments are out of bounds.\n */\nDLLEXPORT unsigned long DLLCALL tjBufSizeYUV(int width, int height,\n  int subsamp);\n\n\n/**\n * Encode an RGB or grayscale image into a YUV planar image.  This function\n * uses the accelerated color conversion routines in TurboJPEG's underlying\n * codec to produce a planar YUV image that is suitable for X Video.\n * Specifically, if the chrominance components are subsampled along the\n * horizontal dimension, then the width of the luminance plane is padded to the\n * nearest multiple of 2 in the output image (same goes for the height of the\n * luminance plane, if the chrominance components are subsampled along the\n * vertical dimension.)  Also, each line of each plane in the output image is\n * padded to 4 bytes.  Although this will work with any subsampling option, it\n * is really only useful in combination with TJ_420, which produces an image\n * compatible with the I420 (AKA \"YUV420P\") format.\n * <p>\n * NOTE: Technically, the JPEG format uses the YCbCr colorspace, but per the\n * convention of the digital video community, the TurboJPEG API uses \"YUV\" to\n * refer to an image format consisting of Y, Cb, and Cr image planes.\n *\n * @param handle a handle to a TurboJPEG compressor or transformer instance\n * @param srcBuf pointer to an image buffer containing RGB or grayscale pixels\n *        to be encoded\n * @param width width (in pixels) of the source image\n * @param pitch bytes per line of the source image.  Normally, this should be\n *        <tt>width * #tjPixelSize[pixelFormat]</tt> if the image is unpadded,\n *        or <tt>#TJPAD(width * #tjPixelSize[pixelFormat])</tt> if each line of\n *        the image is padded to the nearest 32-bit boundary, as is the case\n *        for Windows bitmaps.  You can also be clever and use this parameter\n *        to skip lines, etc.  Setting this parameter to 0 is the equivalent of\n *        setting it to <tt>width * #tjPixelSize[pixelFormat]</tt>.\n * @param height height (in pixels) of the source image\n * @param pixelFormat pixel format of the source image (see @ref TJPF\n *        \"Pixel formats\".)\n * @param dstBuf pointer to an image buffer that will receive the YUV image.\n *        Use #tjBufSizeYUV() to determine the appropriate size for this buffer\n *        based on the image width, height, and level of chrominance\n *        subsampling.\n * @param subsamp the level of chrominance subsampling to be used when\n *        generating the YUV image (see @ref TJSAMP\n *        \"Chrominance subsampling options\".)\n * @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP\n *        \"flags\".\n *\n * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)\n*/\nDLLEXPORT int DLLCALL tjEncodeYUV2(tjhandle handle,\n  unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat,\n  unsigned char *dstBuf, int subsamp, int flags);\n\n\n/**\n * Create a TurboJPEG decompressor instance.\n *\n * @return a handle to the newly-created instance, or NULL if an error\n * occurred (see #tjGetErrorStr().)\n*/\nDLLEXPORT tjhandle DLLCALL tjInitDecompress(void);\n\n\n/**\n * Retrieve information about a JPEG image without decompressing it.\n *\n * @param handle a handle to a TurboJPEG decompressor or transformer instance\n * @param jpegBuf pointer to a buffer containing a JPEG image\n * @param jpegSize size of the JPEG image (in bytes)\n * @param width pointer to an integer variable that will receive the width (in\n *        pixels) of the JPEG image\n * @param height pointer to an integer variable that will receive the height\n *        (in pixels) of the JPEG image\n * @param jpegSubsamp pointer to an integer variable that will receive the\n *        level of chrominance subsampling used when compressing the JPEG image\n *        (see @ref TJSAMP \"Chrominance subsampling options\".)\n *\n * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)\n*/\nDLLEXPORT int DLLCALL tjDecompressHeader2(tjhandle handle,\n  unsigned char *jpegBuf, unsigned long jpegSize, int *width, int *height,\n  int *jpegSubsamp);\n\n\n/**\n * Returns a list of fractional scaling factors that the JPEG decompressor in\n * this implementation of TurboJPEG supports.\n *\n * @param numscalingfactors pointer to an integer variable that will receive\n *        the number of elements in the list\n *\n * @return a pointer to a list of fractional scaling factors, or NULL if an\n * error is encountered (see #tjGetErrorStr().)\n*/\nDLLEXPORT tjscalingfactor* DLLCALL tjGetScalingFactors(int *numscalingfactors);\n\n\n/**\n * Decompress a JPEG image to an RGB or grayscale image.\n *\n * @param handle a handle to a TurboJPEG decompressor or transformer instance\n * @param jpegBuf pointer to a buffer containing the JPEG image to decompress\n * @param jpegSize size of the JPEG image (in bytes)\n * @param dstBuf pointer to an image buffer that will receive the decompressed\n *        image.  This buffer should normally be <tt>pitch * scaledHeight</tt>\n *        bytes in size, where <tt>scaledHeight</tt> can be determined by\n *        calling #TJSCALED() with the JPEG image height and one of the scaling\n *        factors returned by #tjGetScalingFactors().  The <tt>dstBuf</tt>\n *        pointer may also be used to decompress into a specific region of a\n *        larger buffer.\n * @param width desired width (in pixels) of the destination image.  If this is\n *        different than the width of the JPEG image being decompressed, then\n *        TurboJPEG will use scaling in the JPEG decompressor to generate the\n *        largest possible image that will fit within the desired width.  If\n *        <tt>width</tt> is set to 0, then only the height will be considered\n *        when determining the scaled image size.\n * @param pitch bytes per line of the destination image.  Normally, this is\n *        <tt>scaledWidth * #tjPixelSize[pixelFormat]</tt> if the decompressed\n *        image is unpadded, else <tt>#TJPAD(scaledWidth *\n *        #tjPixelSize[pixelFormat])</tt> if each line of the decompressed\n *        image is padded to the nearest 32-bit boundary, as is the case for\n *        Windows bitmaps.  (NOTE: <tt>scaledWidth</tt> can be determined by\n *        calling #TJSCALED() with the JPEG image width and one of the scaling\n *        factors returned by #tjGetScalingFactors().)  You can also be clever\n *        and use the pitch parameter to skip lines, etc.  Setting this\n *        parameter to 0 is the equivalent of setting it to <tt>scaledWidth\n *        * #tjPixelSize[pixelFormat]</tt>.\n * @param height desired height (in pixels) of the destination image.  If this\n *        is different than the height of the JPEG image being decompressed,\n *        then TurboJPEG will use scaling in the JPEG decompressor to generate\n *        the largest possible image that will fit within the desired height.\n *        If <tt>height</tt> is set to 0, then only the width will be\n *        considered when determining the scaled image size.\n * @param pixelFormat pixel format of the destination image (see @ref\n *        TJPF \"Pixel formats\".)\n * @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP\n *        \"flags\".\n *\n * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)\n */\nDLLEXPORT int DLLCALL tjDecompress2(tjhandle handle,\n  unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf,\n  int width, int pitch, int height, int pixelFormat, int flags);\n\n\n/**\n * Decompress a JPEG image to a YUV planar image.  This function performs JPEG\n * decompression but leaves out the color conversion step, so a planar YUV\n * image is generated instead of an RGB image.  The padding of the planes in\n * this image is the same as in the images generated by #tjEncodeYUV2().  Note\n * that, if the width or height of the image is not an even multiple of the MCU\n * block size (see #tjMCUWidth and #tjMCUHeight), then an intermediate buffer\n * copy will be performed within TurboJPEG.\n * <p>\n * NOTE: Technically, the JPEG format uses the YCbCr colorspace, but per the\n * convention of the digital video community, the TurboJPEG API uses \"YUV\" to\n * refer to an image format consisting of Y, Cb, and Cr image planes.\n *\n * @param handle a handle to a TurboJPEG decompressor or transformer instance\n * @param jpegBuf pointer to a buffer containing the JPEG image to decompress\n * @param jpegSize size of the JPEG image (in bytes)\n * @param dstBuf pointer to an image buffer that will receive the YUV image.\n *        Use #tjBufSizeYUV() to determine the appropriate size for this buffer\n *        based on the image width, height, and level of subsampling.\n * @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP\n *        \"flags\".\n *\n * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)\n */\nDLLEXPORT int DLLCALL tjDecompressToYUV(tjhandle handle,\n  unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf,\n  int flags);\n\n\n/**\n * Create a new TurboJPEG transformer instance.\n *\n * @return a handle to the newly-created instance, or NULL if an error\n * occurred (see #tjGetErrorStr().)\n */\nDLLEXPORT tjhandle DLLCALL tjInitTransform(void);\n\n\n/**\n * Losslessly transform a JPEG image into another JPEG image.  Lossless\n * transforms work by moving the raw coefficients from one JPEG image structure\n * to another without altering the values of the coefficients.  While this is\n * typically faster than decompressing the image, transforming it, and\n * re-compressing it, lossless transforms are not free.  Each lossless\n * transform requires reading and performing Huffman decoding on all of the\n * coefficients in the source image, regardless of the size of the destination\n * image.  Thus, this function provides a means of generating multiple\n * transformed images from the same source or  applying multiple\n * transformations simultaneously, in order to eliminate the need to read the\n * source coefficients multiple times.\n *\n * @param handle a handle to a TurboJPEG transformer instance\n * @param jpegBuf pointer to a buffer containing the JPEG image to transform\n * @param jpegSize size of the JPEG image (in bytes)\n * @param n the number of transformed JPEG images to generate\n * @param dstBufs pointer to an array of n image buffers.  <tt>dstBufs[i]</tt>\n *        will receive a JPEG image that has been transformed using the\n *        parameters in <tt>transforms[i]</tt>.  TurboJPEG has the ability to\n *        reallocate the JPEG buffer to accommodate the size of the JPEG image.\n *        Thus, you can choose to:\n *        -# pre-allocate the JPEG buffer with an arbitrary size using\n *        #tjAlloc() and let TurboJPEG grow the buffer as needed,\n *        -# set <tt>dstBufs[i]</tt> to NULL to tell TurboJPEG to allocate the\n *        buffer for you, or\n *        -# pre-allocate the buffer to a \"worst case\" size determined by\n *        calling #tjBufSize() with the transformed or cropped width and\n *        height.  This should ensure that the buffer never has to be\n *        re-allocated (setting #TJFLAG_NOREALLOC guarantees this.)\n *        .\n *        If you choose option 1, <tt>dstSizes[i]</tt> should be set to\n *        the size of your pre-allocated buffer.  In any case, unless you have\n *        set #TJFLAG_NOREALLOC, you should always check <tt>dstBufs[i]</tt>\n *        upon return from this function, as it may have changed.\n * @param dstSizes pointer to an array of n unsigned long variables that will\n *        receive the actual sizes (in bytes) of each transformed JPEG image.\n *        If <tt>dstBufs[i]</tt> points to a pre-allocated buffer, then\n *        <tt>dstSizes[i]</tt> should be set to the size of the buffer.  Upon\n *        return, <tt>dstSizes[i]</tt> will contain the size of the JPEG image\n *        (in bytes.)\n * @param transforms pointer to an array of n #tjtransform structures, each of\n *        which specifies the transform parameters and/or cropping region for\n *        the corresponding transformed output image.\n * @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP\n *        \"flags\".\n *\n * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)\n */\nDLLEXPORT int DLLCALL tjTransform(tjhandle handle, unsigned char *jpegBuf,\n  unsigned long jpegSize, int n, unsigned char **dstBufs,\n  unsigned long *dstSizes, tjtransform *transforms, int flags);\n\n\n/**\n * Destroy a TurboJPEG compressor, decompressor, or transformer instance.\n *\n * @param handle a handle to a TurboJPEG compressor, decompressor or\n *        transformer instance\n *\n * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr().)\n */\nDLLEXPORT int DLLCALL tjDestroy(tjhandle handle);\n\n\n/**\n * Allocate an image buffer for use with TurboJPEG.  You should always use\n * this function to allocate the JPEG destination buffer(s) for #tjCompress2()\n * and #tjTransform() unless you are disabling automatic buffer\n * (re)allocation (by setting #TJFLAG_NOREALLOC.)\n *\n * @param bytes the number of bytes to allocate\n * \n * @return a pointer to a newly-allocated buffer with the specified number of\n *         bytes\n *\n * @sa tjFree()\n */\nDLLEXPORT unsigned char* DLLCALL tjAlloc(int bytes);\n\n\n/**\n * Free an image buffer previously allocated by TurboJPEG.  You should always\n * use this function to free JPEG destination buffer(s) that were automatically\n * (re)allocated by #tjCompress2() or #tjTransform() or that were manually\n * allocated using #tjAlloc().\n *\n * @param buffer address of the buffer to free\n *\n * @sa tjAlloc()\n */\nDLLEXPORT void DLLCALL tjFree(unsigned char *buffer);\n\n\n/**\n * Returns a descriptive error message explaining why the last command failed.\n *\n * @return a descriptive error message explaining why the last command failed.\n */\nDLLEXPORT char* DLLCALL tjGetErrorStr(void);\n\n\n/* Backward compatibility functions and macros (nothing to see here) */\n#define NUMSUBOPT TJ_NUMSAMP\n#define TJ_444 TJSAMP_444\n#define TJ_422 TJSAMP_422\n#define TJ_420 TJSAMP_420\n#define TJ_411 TJSAMP_420\n#define TJ_GRAYSCALE TJSAMP_GRAY\n\n#define TJ_BGR 1\n#define TJ_BOTTOMUP TJFLAG_BOTTOMUP\n#define TJ_FORCEMMX TJFLAG_FORCEMMX\n#define TJ_FORCESSE TJFLAG_FORCESSE\n#define TJ_FORCESSE2 TJFLAG_FORCESSE2\n#define TJ_ALPHAFIRST 64\n#define TJ_FORCESSE3 TJFLAG_FORCESSE3\n#define TJ_FASTUPSAMPLE TJFLAG_FASTUPSAMPLE\n#define TJ_YUV 512\n\nDLLEXPORT unsigned long DLLCALL TJBUFSIZE(int width, int height);\n\nDLLEXPORT unsigned long DLLCALL TJBUFSIZEYUV(int width, int height,\n  int jpegSubsamp);\n\nDLLEXPORT int DLLCALL tjCompress(tjhandle handle, unsigned char *srcBuf,\n  int width, int pitch, int height, int pixelSize, unsigned char *dstBuf,\n  unsigned long *compressedSize, int jpegSubsamp, int jpegQual, int flags);\n\nDLLEXPORT int DLLCALL tjEncodeYUV(tjhandle handle,\n  unsigned char *srcBuf, int width, int pitch, int height, int pixelSize,\n  unsigned char *dstBuf, int subsamp, int flags);\n\nDLLEXPORT int DLLCALL tjDecompressHeader(tjhandle handle,\n  unsigned char *jpegBuf, unsigned long jpegSize, int *width, int *height);\n\nDLLEXPORT int DLLCALL tjDecompress(tjhandle handle,\n  unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf,\n  int width, int pitch, int height, int pixelSize, int flags);\n\n\n/**\n * @}\n */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "ext/libjpeg-turbo/usage.txt",
    "content": "NOTE:  This file was modified by The libjpeg-turbo Project to include only\ninformation relevant to libjpeg-turbo and to wordsmith certain sections.\n\nUSAGE instructions for the Independent JPEG Group's JPEG software\n=================================================================\n\nThis file describes usage of the JPEG conversion programs cjpeg and djpeg,\nas well as the utility programs jpegtran, rdjpgcom and wrjpgcom.  (See\nthe other documentation files if you wish to use the JPEG library within\nyour own programs.)\n\nIf you are on a Unix machine you may prefer to read the Unix-style manual\npages in files cjpeg.1, djpeg.1, jpegtran.1, rdjpgcom.1, wrjpgcom.1.\n\n\nINTRODUCTION\n\nThese programs implement JPEG image encoding, decoding, and transcoding.\nJPEG (pronounced \"jay-peg\") is a standardized compression method for\nfull-color and gray-scale images.\n\n\nGENERAL USAGE\n\nWe provide two programs, cjpeg to compress an image file into JPEG format,\nand djpeg to decompress a JPEG file back into a conventional image format.\n\nOn Unix-like systems, you say:\n\tcjpeg [switches] [imagefile] >jpegfile\nor\n\tdjpeg [switches] [jpegfile]  >imagefile\nThe programs read the specified input file, or standard input if none is\nnamed.  They always write to standard output (with trace/error messages to\nstandard error).  These conventions are handy for piping images between\nprograms.\n\nOn most non-Unix systems, you say:\n\tcjpeg [switches] imagefile jpegfile\nor\n\tdjpeg [switches] jpegfile  imagefile\ni.e., both the input and output files are named on the command line.  This\nstyle is a little more foolproof, and it loses no functionality if you don't\nhave pipes.  (You can get this style on Unix too, if you prefer, by defining\nTWO_FILE_COMMANDLINE when you compile the programs; see install.txt.)\n\nYou can also say:\n\tcjpeg [switches] -outfile jpegfile  imagefile\nor\n\tdjpeg [switches] -outfile imagefile  jpegfile\nThis syntax works on all systems, so it is useful for scripts.\n\nThe currently supported image file formats are: PPM (PBMPLUS color format),\nPGM (PBMPLUS gray-scale format), BMP, Targa, and RLE (Utah Raster Toolkit\nformat).  (RLE is supported only if the URT library is available.)\ncjpeg recognizes the input image format automatically, with the exception\nof some Targa-format files.  You have to tell djpeg which format to generate.\n\nJPEG files are in the defacto standard JFIF file format.  There are other,\nless widely used JPEG-based file formats, but we don't support them.\n\nAll switch names may be abbreviated; for example, -grayscale may be written\n-gray or -gr.  Most of the \"basic\" switches can be abbreviated to as little as\none letter.  Upper and lower case are equivalent (-BMP is the same as -bmp).\nBritish spellings are also accepted (e.g., -greyscale), though for brevity\nthese are not mentioned below.\n\n\nCJPEG DETAILS\n\nThe basic command line switches for cjpeg are:\n\n\t-quality N[,...]  Scale quantization tables to adjust image quality.\n\t\t\tQuality is 0 (worst) to 100 (best); default is 75.\n\t\t\t(See below for more info.)\n\n\t-grayscale\tCreate monochrome JPEG file from color input.\n\t\t\tBe sure to use this switch when compressing a grayscale\n\t\t\tBMP file, because cjpeg isn't bright enough to notice\n\t\t\twhether a BMP file uses only shades of gray.  By\n\t\t\tsaying -grayscale, you'll get a smaller JPEG file that\n\t\t\ttakes less time to process.\n\n\t-rgb\t\tCreate RGB JPEG file.\n\t\t\tUsing this switch suppresses the conversion from RGB\n\t\t\tcolorspace input to the default YCbCr JPEG colorspace.\n\n\t-optimize\tPerform optimization of entropy encoding parameters.\n\t\t\tWithout this, default encoding parameters are used.\n\t\t\t-optimize usually makes the JPEG file a little smaller,\n\t\t\tbut cjpeg runs somewhat slower and needs much more\n\t\t\tmemory.  Image quality and speed of decompression are\n\t\t\tunaffected by -optimize.\n\n\t-progressive\tCreate progressive JPEG file (see below).\n\n\t-targa\t\tInput file is Targa format.  Targa files that contain\n\t\t\tan \"identification\" field will not be automatically\n\t\t\trecognized by cjpeg; for such files you must specify\n\t\t\t-targa to make cjpeg treat the input as Targa format.\n\t\t\tFor most Targa files, you won't need this switch.\n\nThe -quality switch lets you trade off compressed file size against quality of\nthe reconstructed image: the higher the quality setting, the larger the JPEG\nfile, and the closer the output image will be to the original input.  Normally\nyou want to use the lowest quality setting (smallest file) that decompresses\ninto something visually indistinguishable from the original image.  For this\npurpose the quality setting should be between 50 and 95; the default of 75 is\noften about right.  If you see defects at -quality 75, then go up 5 or 10\ncounts at a time until you are happy with the output image.  (The optimal\nsetting will vary from one image to another.)\n\n-quality 100 will generate a quantization table of all 1's, minimizing loss\nin the quantization step (but there is still information loss in subsampling,\nas well as roundoff error).  This setting is mainly of interest for\nexperimental purposes.  Quality values above about 95 are NOT recommended for\nnormal use; the compressed file size goes up dramatically for hardly any gain\nin output image quality.\n\nIn the other direction, quality values below 50 will produce very small files\nof low image quality.  Settings around 5 to 10 might be useful in preparing an\nindex of a large image library, for example.  Try -quality 2 (or so) for some\namusing Cubist effects.  (Note: quality values below about 25 generate 2-byte\nquantization tables, which are considered optional in the JPEG standard.\ncjpeg emits a warning message when you give such a quality value, because some\nother JPEG programs may be unable to decode the resulting file.  Use -baseline\nif you need to ensure compatibility at low quality values.)\n\nThe -quality option has been extended in this version of cjpeg to support\nseparate quality settings for luminance and chrominance (or, in general,\nseparate settings for every quantization table slot.)  The principle is the\nsame as chrominance subsampling:  since the human eye is more sensitive to\nspatial changes in brightness than spatial changes in color, the chrominance\ncomponents can be quantized more than the luminance components without\nincurring any visible image quality loss.  However, unlike subsampling, this\nfeature reduces data in the frequency domain instead of the spatial domain,\nwhich allows for more fine-grained control.  This option is useful in\nquality-sensitive applications, for which the artifacts generated by\nsubsampling may be unacceptable.\n\nThe -quality option accepts a comma-separated list of parameters, which\nrespectively refer to the quality levels that should be assigned to the\nquantization table slots.  If there are more q-table slots than parameters,\nthen the last parameter is replicated.  Thus, if only one quality parameter is\ngiven, this is used for both luminance and chrominance (slots 0 and 1,\nrespectively), preserving the legacy behavior of cjpeg v6b and prior.  More (or\ncustomized) quantization tables can be set with the -qtables option and\nassigned to components with the -qslots option (see the \"wizard\" switches\nbelow.)\n\nJPEG  files  generated  with separate luminance and chrominance quality are\nfully compliant with standard JPEG decoders.\n\nCAUTION: For this setting to be useful, be sure to pass an argument of\n-sample 1x1 to cjpeg to disable chrominance subsampling.  Otherwise, the\ndefault subsampling level (2x2, AKA \"4:2:0\") will be used.\n\nThe -progressive switch creates a \"progressive JPEG\" file.  In this type of\nJPEG file, the data is stored in multiple scans of increasing quality.  If the\nfile is being transmitted over a slow communications link, the decoder can use\nthe first scan to display a low-quality image very quickly, and can then\nimprove the display with each subsequent scan.  The final image is exactly\nequivalent to a standard JPEG file of the same quality setting, and the total\nfile size is about the same --- often a little smaller.\n\nSwitches for advanced users:\n\n\t-arithmetic\tUse arithmetic coding.  CAUTION: arithmetic coded JPEG\n\t\t\tis not yet widely implemented, so many decoders will\n\t\t\tbe unable to view an arithmetic coded JPEG file at\n\t\t\tall.\n\n\t-dct int\tUse integer DCT method (default).\n\t-dct fast\tUse fast integer DCT (less accurate).\n\t-dct float\tUse floating-point DCT method.\n\t\t\tThe float method is very slightly more accurate than\n\t\t\tthe int method, but is much slower unless your machine\n\t\t\thas very fast floating-point hardware.  Also note that\n\t\t\tresults of the floating-point method may vary slightly\n\t\t\tacross machines, while the integer methods should give\n\t\t\tthe same results everywhere.  The fast integer method\n\t\t\tis much less accurate than the other two.\n\n\t-restart N\tEmit a JPEG restart marker every N MCU rows, or every\n\t\t\tN MCU blocks if \"B\" is attached to the number.\n\t\t\t-restart 0 (the default) means no restart markers.\n\n\t-smooth N\tSmooth the input image to eliminate dithering noise.\n\t\t\tN, ranging from 1 to 100, indicates the strength of\n\t\t\tsmoothing.  0 (the default) means no smoothing.\n\n\t-maxmemory N\tSet limit for amount of memory to use in processing\n\t\t\tlarge images.  Value is in thousands of bytes, or\n\t\t\tmillions of bytes if \"M\" is attached to the number.\n\t\t\tFor example, -max 4m selects 4000000 bytes.  If more\n\t\t\tspace is needed, temporary files will be used.\n\n\t-verbose\tEnable debug printout.  More -v's give more printout.\n\tor  -debug\tAlso, version information is printed at startup.\n\nThe -restart option inserts extra markers that allow a JPEG decoder to\nresynchronize after a transmission error.  Without restart markers, any damage\nto a compressed file will usually ruin the image from the point of the error\nto the end of the image; with restart markers, the damage is usually confined\nto the portion of the image up to the next restart marker.  Of course, the\nrestart markers occupy extra space.  We recommend -restart 1 for images that\nwill be transmitted across unreliable networks such as Usenet.\n\nThe -smooth option filters the input to eliminate fine-scale noise.  This is\noften useful when converting dithered images to JPEG: a moderate smoothing\nfactor of 10 to 50 gets rid of dithering patterns in the input file, resulting\nin a smaller JPEG file and a better-looking image.  Too large a smoothing\nfactor will visibly blur the image, however.\n\nSwitches for wizards:\n\n\t-baseline\tForce baseline-compatible quantization tables to be\n\t\t\tgenerated.  This clamps quantization values to 8 bits\n\t\t\teven at low quality settings.  (This switch is poorly\n\t\t\tnamed, since it does not ensure that the output is\n\t\t\tactually baseline JPEG.  For example, you can use\n\t\t\t-baseline and -progressive together.)\n\n\t-qtables file\tUse the quantization tables given in the specified\n\t\t\ttext file.\n\n\t-qslots N[,...] Select which quantization table to use for each color\n\t\t\tcomponent.\n\n\t-sample HxV[,...]  Set JPEG sampling factors for each color component.\n\n\t-scans file\tUse the scan script given in the specified text file.\n\nThe \"wizard\" switches are intended for experimentation with JPEG.  If you\ndon't know what you are doing, DON'T USE THEM.  These switches are documented\nfurther in the file wizard.txt.\n\n\nDJPEG DETAILS\n\nThe basic command line switches for djpeg are:\n\n\t-colors N\tReduce image to at most N colors.  This reduces the\n\tor -quantize N\tnumber of colors used in the output image, so that it\n\t\t\tcan be displayed on a colormapped display or stored in\n\t\t\ta colormapped file format.  For example, if you have\n\t\t\tan 8-bit display, you'd need to reduce to 256 or fewer\n\t\t\tcolors.  (-colors is the recommended name, -quantize\n\t\t\tis provided only for backwards compatibility.)\n\n\t-fast\t\tSelect recommended processing options for fast, low\n\t\t\tquality output.  (The default options are chosen for\n\t\t\thighest quality output.)  Currently, this is equivalent\n\t\t\tto \"-dct fast -nosmooth -onepass -dither ordered\".\n\n\t-grayscale\tForce gray-scale output even if JPEG file is color.\n\t\t\tUseful for viewing on monochrome displays; also,\n\t\t\tdjpeg runs noticeably faster in this mode.\n\n\t-scale M/N\tScale the output image by a factor M/N.  Currently\n\t\t\tthe scale factor must be M/8, where M is an integer\n\t\t\tbetween 1 and 16 inclusive, or any reduced fraction\n\t\t\tthereof (such as 1/2, 3/4, etc.  Scaling is handy if\n\t\t\tthe image is larger than your screen; also, djpeg runs\n\t\t\tmuch faster when scaling down the output.\n\n\t-bmp\t\tSelect BMP output format (Windows flavor).  8-bit\n\t\t\tcolormapped format is emitted if -colors or -grayscale\n\t\t\tis specified, or if the JPEG file is gray-scale;\n\t\t\totherwise, 24-bit full-color format is emitted.\n\n\t-gif\t\tSelect GIF output format.  Since GIF does not support\n\t\t\tmore than 256 colors, -colors 256 is assumed (unless\n\t\t\tyou specify a smaller number of colors).  If you\n\t\t\tspecify -fast, the default number of colors is 216.\n\n\t-os2\t\tSelect BMP output format (OS/2 1.x flavor).  8-bit\n\t\t\tcolormapped format is emitted if -colors or -grayscale\n\t\t\tis specified, or if the JPEG file is gray-scale;\n\t\t\totherwise, 24-bit full-color format is emitted.\n\n\t-pnm\t\tSelect PBMPLUS (PPM/PGM) output format (this is the\n\t\t\tdefault format).  PGM is emitted if the JPEG file is\n\t\t\tgray-scale or if -grayscale is specified; otherwise\n\t\t\tPPM is emitted.\n\n\t-rle\t\tSelect RLE output format.  (Requires URT library.)\n\n\t-targa\t\tSelect Targa output format.  Gray-scale format is\n\t\t\temitted if the JPEG file is gray-scale or if\n\t\t\t-grayscale is specified; otherwise, colormapped format\n\t\t\tis emitted if -colors is specified; otherwise, 24-bit\n\t\t\tfull-color format is emitted.\n\nSwitches for advanced users:\n\n\t-dct int\tUse integer DCT method (default).\n\t-dct fast\tUse fast integer DCT (less accurate).\n\t-dct float\tUse floating-point DCT method.\n\t\t\tThe float method is very slightly more accurate than\n\t\t\tthe int method, but is much slower unless your machine\n\t\t\thas very fast floating-point hardware.  Also note that\n\t\t\tresults of the floating-point method may vary slightly\n\t\t\tacross machines, while the integer methods should give\n\t\t\tthe same results everywhere.  The fast integer method\n\t\t\tis much less accurate than the other two.\n\n\t-dither fs\tUse Floyd-Steinberg dithering in color quantization.\n\t-dither ordered\tUse ordered dithering in color quantization.\n\t-dither none\tDo not use dithering in color quantization.\n\t\t\tBy default, Floyd-Steinberg dithering is applied when\n\t\t\tquantizing colors; this is slow but usually produces\n\t\t\tthe best results.  Ordered dither is a compromise\n\t\t\tbetween speed and quality; no dithering is fast but\n\t\t\tusually looks awful.  Note that these switches have\n\t\t\tno effect unless color quantization is being done.\n\t\t\tOrdered dither is only available in -onepass mode.\n\n\t-map FILE\tQuantize to the colors used in the specified image\n\t\t\tfile.  This is useful for producing multiple files\n\t\t\twith identical color maps, or for forcing a predefined\n\t\t\tset of colors to be used.  The FILE must be a GIF\n\t\t\tor PPM file.  This option overrides -colors and\n\t\t\t-onepass.\n\n\t-nosmooth\tUse a faster, lower-quality upsampling routine.\n\n\t-onepass\tUse one-pass instead of two-pass color quantization.\n\t\t\tThe one-pass method is faster and needs less memory,\n\t\t\tbut it produces a lower-quality image.  -onepass is\n\t\t\tignored unless you also say -colors N.  Also,\n\t\t\tthe one-pass method is always used for gray-scale\n\t\t\toutput (the two-pass method is no improvement then).\n\n\t-maxmemory N\tSet limit for amount of memory to use in processing\n\t\t\tlarge images.  Value is in thousands of bytes, or\n\t\t\tmillions of bytes if \"M\" is attached to the number.\n\t\t\tFor example, -max 4m selects 4000000 bytes.  If more\n\t\t\tspace is needed, temporary files will be used.\n\n\t-verbose\tEnable debug printout.  More -v's give more printout.\n\tor  -debug\tAlso, version information is printed at startup.\n\n\nHINTS FOR CJPEG\n\nColor GIF files are not the ideal input for JPEG; JPEG is really intended for\ncompressing full-color (24-bit) images.  In particular, don't try to convert\ncartoons, line drawings, and other images that have only a few distinct\ncolors.  GIF works great on these, JPEG does not.  If you want to convert a\nGIF to JPEG, you should experiment with cjpeg's -quality and -smooth options\nto get a satisfactory conversion.  -smooth 10 or so is often helpful.\n\nAvoid running an image through a series of JPEG compression/decompression\ncycles.  Image quality loss will accumulate; after ten or so cycles the image\nmay be noticeably worse than it was after one cycle.  It's best to use a\nlossless format while manipulating an image, then convert to JPEG format when\nyou are ready to file the image away.\n\nThe -optimize option to cjpeg is worth using when you are making a \"final\"\nversion for posting or archiving.  It's also a win when you are using low\nquality settings to make very small JPEG files; the percentage improvement\nis often a lot more than it is on larger files.  (At present, -optimize\nmode is always selected when generating progressive JPEG files.)\n\nSupport for GIF input files was removed in cjpeg v6b due to concerns over\nthe Unisys LZW patent.  Although this patent expired in 2006, cjpeg still\nlacks GIF support, for these historical reasons.  (Conversion of GIF files to\nJPEG is usually a bad idea anyway.)\n\n\nHINTS FOR DJPEG\n\nTo get a quick preview of an image, use the -grayscale and/or -scale switches.\n\"-grayscale -scale 1/8\" is the fastest case.\n\nSeveral options are available that trade off image quality to gain speed.\n\"-fast\" turns on the recommended settings.\n\n\"-dct fast\" and/or \"-nosmooth\" gain speed at a small sacrifice in quality.\nWhen producing a color-quantized image, \"-onepass -dither ordered\" is fast but\nmuch lower quality than the default behavior.  \"-dither none\" may give\nacceptable results in two-pass mode, but is seldom tolerable in one-pass mode.\n\nIf you are fortunate enough to have very fast floating point hardware,\n\"-dct float\" may be even faster than \"-dct fast\".  But on most machines\n\"-dct float\" is slower than \"-dct int\"; in this case it is not worth using,\nbecause its theoretical accuracy advantage is too small to be significant\nin practice.\n\nTwo-pass color quantization requires a good deal of memory; on MS-DOS machines\nit may run out of memory even with -maxmemory 0.  In that case you can still\ndecompress, with some loss of image quality, by specifying -onepass for\none-pass quantization.\n\nTo avoid the Unisys LZW patent, djpeg produces uncompressed GIF files.  These\nare larger than they should be, but are readable by standard GIF decoders.\n\n\nHINTS FOR BOTH PROGRAMS\n\nIf more space is needed than will fit in the available main memory (as\ndetermined by -maxmemory), temporary files will be used.  (MS-DOS versions\nwill try to get extended or expanded memory first.)  The temporary files are\noften rather large: in typical cases they occupy three bytes per pixel, for\nexample 3*800*600 = 1.44Mb for an 800x600 image.  If you don't have enough\nfree disk space, leave out -progressive and -optimize (for cjpeg) or specify\n-onepass (for djpeg).\n\nOn MS-DOS, the temporary files are created in the directory named by the TMP\nor TEMP environment variable, or in the current directory if neither of those\nexist.  Amiga implementations put the temp files in the directory named by\nJPEGTMP:, so be sure to assign JPEGTMP: to a disk partition with adequate free\nspace.\n\nThe default memory usage limit (-maxmemory) is set when the software is\ncompiled.  If you get an \"insufficient memory\" error, try specifying a smaller\n-maxmemory value, even -maxmemory 0 to use the absolute minimum space.  You\nmay want to recompile with a smaller default value if this happens often.\n\nOn machines that have \"environment\" variables, you can define the environment\nvariable JPEGMEM to set the default memory limit.  The value is specified as\ndescribed for the -maxmemory switch.  JPEGMEM overrides the default value\nspecified when the program was compiled, and itself is overridden by an\nexplicit -maxmemory switch.\n\nOn MS-DOS machines, -maxmemory is the amount of main (conventional) memory to\nuse.  (Extended or expanded memory is also used if available.)  Most\nDOS-specific versions of this software do their own memory space estimation\nand do not need you to specify -maxmemory.\n\n\nJPEGTRAN\n\njpegtran performs various useful transformations of JPEG files.\nIt can translate the coded representation from one variant of JPEG to another,\nfor example from baseline JPEG to progressive JPEG or vice versa.  It can also\nperform some rearrangements of the image data, for example turning an image\nfrom landscape to portrait format by rotation.\n\njpegtran works by rearranging the compressed data (DCT coefficients), without\never fully decoding the image.  Therefore, its transformations are lossless:\nthere is no image degradation at all, which would not be true if you used\ndjpeg followed by cjpeg to accomplish the same conversion.  But by the same\ntoken, jpegtran cannot perform lossy operations such as changing the image\nquality.\n\njpegtran uses a command line syntax similar to cjpeg or djpeg.\nOn Unix-like systems, you say:\n\tjpegtran [switches] [inputfile] >outputfile\nOn most non-Unix systems, you say:\n\tjpegtran [switches] inputfile outputfile\nwhere both the input and output files are JPEG files.\n\nTo specify the coded JPEG representation used in the output file,\njpegtran accepts a subset of the switches recognized by cjpeg:\n\t-optimize\tPerform optimization of entropy encoding parameters.\n\t-progressive\tCreate progressive JPEG file.\n\t-arithmetic\tUse arithmetic coding.\n\t-restart N\tEmit a JPEG restart marker every N MCU rows, or every\n\t\t\tN MCU blocks if \"B\" is attached to the number.\n\t-scans file\tUse the scan script given in the specified text file.\nSee the previous discussion of cjpeg for more details about these switches.\nIf you specify none of these switches, you get a plain baseline-JPEG output\nfile.  The quality setting and so forth are determined by the input file.\n\nThe image can be losslessly transformed by giving one of these switches:\n\t-flip horizontal\tMirror image horizontally (left-right).\n\t-flip vertical\t\tMirror image vertically (top-bottom).\n\t-rotate 90\t\tRotate image 90 degrees clockwise.\n\t-rotate 180\t\tRotate image 180 degrees.\n\t-rotate 270\t\tRotate image 270 degrees clockwise (or 90 ccw).\n\t-transpose\t\tTranspose image (across UL-to-LR axis).\n\t-transverse\t\tTransverse transpose (across UR-to-LL axis).\n\nThe transpose transformation has no restrictions regarding image dimensions.\nThe other transformations operate rather oddly if the image dimensions are not\na multiple of the iMCU size (usually 8 or 16 pixels), because they can only\ntransform complete blocks of DCT coefficient data in the desired way.\n\njpegtran's default behavior when transforming an odd-size image is designed\nto preserve exact reversibility and mathematical consistency of the\ntransformation set.  As stated, transpose is able to flip the entire image\narea.  Horizontal mirroring leaves any partial iMCU column at the right edge\nuntouched, but is able to flip all rows of the image.  Similarly, vertical\nmirroring leaves any partial iMCU row at the bottom edge untouched, but is\nable to flip all columns.  The other transforms can be built up as sequences\nof transpose and flip operations; for consistency, their actions on edge\npixels are defined to be the same as the end result of the corresponding\ntranspose-and-flip sequence.\n\nFor practical use, you may prefer to discard any untransformable edge pixels\nrather than having a strange-looking strip along the right and/or bottom edges\nof a transformed image.  To do this, add the -trim switch:\n\t-trim\t\tDrop non-transformable edge blocks.\nObviously, a transformation with -trim is not reversible, so strictly speaking\njpegtran with this switch is not lossless.  Also, the expected mathematical\nequivalences between the transformations no longer hold.  For example,\n\"-rot 270 -trim\" trims only the bottom edge, but \"-rot 90 -trim\" followed by\n\"-rot 180 -trim\" trims both edges.\n\nIf you are only interested in perfect transformations, add the -perfect switch:\n\t-perfect\tFail with an error if the transformation is not\n\t\t\tperfect.\nFor example, you may want to do\n  jpegtran -rot 90 -perfect foo.jpg || djpeg foo.jpg | pnmflip -r90 | cjpeg\nto do a perfect rotation, if available, or an approximated one if not.\n\nThis version of jpegtran also offers a lossless crop option, which discards\ndata outside of a given image region but losslessly preserves what is inside.\nLike the rotate and flip transforms, lossless crop is restricted by the current\nJPEG format; the upper left corner of the selected region must fall on an iMCU\nboundary.  If it doesn't, then it is silently moved up and/or left to the\nnearest iMCU boundary (the lower right corner is unchanged.)\n\nThe image can be losslessly cropped by giving the switch:\n\t-crop WxH+X+Y\tCrop to a rectangular region of width W and height H,\n\t\t\tstarting at point X,Y.\n\nOther not-strictly-lossless transformation switches are:\n\n\t-grayscale\tForce grayscale output.\nThis option discards the chrominance channels if the input image is YCbCr\n(ie, a standard color JPEG), resulting in a grayscale JPEG file.  The\nluminance channel is preserved exactly, so this is a better method of reducing\nto grayscale than decompression, conversion, and recompression.  This switch\nis particularly handy for fixing a monochrome picture that was mistakenly\nencoded as a color JPEG.  (In such a case, the space savings from getting rid\nof the near-empty chroma channels won't be large; but the decoding time for\na grayscale JPEG is substantially less than that for a color JPEG.)\n\njpegtran also recognizes these switches that control what to do with \"extra\"\nmarkers, such as comment blocks:\n\t-copy none\tCopy no extra markers from source file.  This setting\n\t\t\tsuppresses all comments and other excess baggage\n\t\t\tpresent in the source file.\n\t-copy comments\tCopy only comment markers.  This setting copies\n\t\t\tcomments from the source file but discards\n\t\t\tany other data that is inessential for image display.\n\t-copy all\tCopy all extra markers.  This setting preserves\n\t\t\tmiscellaneous markers found in the source file, such\n\t\t\tas JFIF thumbnails, Exif data, and Photoshop settings.\n\t\t\tIn some files, these extra markers can be sizable.\nThe default behavior is -copy comments.  (Note: in IJG releases v6 and v6a,\njpegtran always did the equivalent of -copy none.)\n\nAdditional switches recognized by jpegtran are:\n\t-outfile filename\n\t-maxmemory N\n\t-verbose\n\t-debug\nThese work the same as in cjpeg or djpeg.\n\n\nTHE COMMENT UTILITIES\n\nThe JPEG standard allows \"comment\" (COM) blocks to occur within a JPEG file.\nAlthough the standard doesn't actually define what COM blocks are for, they\nare widely used to hold user-supplied text strings.  This lets you add\nannotations, titles, index terms, etc to your JPEG files, and later retrieve\nthem as text.  COM blocks do not interfere with the image stored in the JPEG\nfile.  The maximum size of a COM block is 64K, but you can have as many of\nthem as you like in one JPEG file.\n\nWe provide two utility programs to display COM block contents and add COM\nblocks to a JPEG file.\n\nrdjpgcom searches a JPEG file and prints the contents of any COM blocks on\nstandard output.  The command line syntax is\n\trdjpgcom [-raw] [-verbose] [inputfilename]\nThe switch \"-raw\" (or just \"-r\") causes rdjpgcom to output non-printable\ncharacters in JPEG comments.  These characters are normally escaped for\nsecurity reasons.\nThe switch \"-verbose\" (or just \"-v\") causes rdjpgcom to also display the JPEG\nimage dimensions.  If you omit the input file name from the command line,\nthe JPEG file is read from standard input.  (This may not work on some\noperating systems, if binary data can't be read from stdin.)\n\nwrjpgcom adds a COM block, containing text you provide, to a JPEG file.\nOrdinarily, the COM block is added after any existing COM blocks, but you\ncan delete the old COM blocks if you wish.  wrjpgcom produces a new JPEG\nfile; it does not modify the input file.  DO NOT try to overwrite the input\nfile by directing wrjpgcom's output back into it; on most systems this will\njust destroy your file.\n\nThe command line syntax for wrjpgcom is similar to cjpeg's.  On Unix-like\nsystems, it is\n\twrjpgcom [switches] [inputfilename]\nThe output file is written to standard output.  The input file comes from\nthe named file, or from standard input if no input file is named.\n\nOn most non-Unix systems, the syntax is\n\twrjpgcom [switches] inputfilename outputfilename\nwhere both input and output file names must be given explicitly.\n\nwrjpgcom understands three switches:\n\t-replace\t\t Delete any existing COM blocks from the file.\n\t-comment \"Comment text\"\t Supply new COM text on command line.\n\t-cfile name\t\t Read text for new COM block from named file.\n(Switch names can be abbreviated.)  If you have only one line of comment text\nto add, you can provide it on the command line with -comment.  The comment\ntext must be surrounded with quotes so that it is treated as a single\nargument.  Longer comments can be read from a text file.\n\nIf you give neither -comment nor -cfile, then wrjpgcom will read the comment\ntext from standard input.  (In this case an input image file name MUST be\nsupplied, so that the source JPEG file comes from somewhere else.)  You can\nenter multiple lines, up to 64KB worth.  Type an end-of-file indicator\n(usually control-D or control-Z) to terminate the comment text entry.\n\nwrjpgcom will not add a COM block if the provided comment string is empty.\nTherefore -replace -comment \"\" can be used to delete all COM blocks from a\nfile.\n\nThese utility programs do not depend on the IJG JPEG library.  In\nparticular, the source code for rdjpgcom is intended as an illustration of\nthe minimum amount of code required to parse a JPEG file header correctly.\n"
  },
  {
    "path": "ext/libjpeg-turbo/win/config.h.in",
    "content": "#define VERSION \"@VERSION@\"\r\n#define BUILD \"@BUILD@\"\r\n#define PACKAGE_NAME \"@CMAKE_PROJECT_NAME@\"\r\n\n#ifndef INLINE\n#if defined(__GNUC__)\n#define INLINE __attribute__((always_inline))\n#elif defined(_MSC_VER)\n#define INLINE __forceinline\n#else\n#define INLINE\n#endif\n#endif\n"
  },
  {
    "path": "ext/libjpeg-turbo/win/jconfig.h.in",
    "content": "/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */\n/* see jconfig.txt for explanations */\n\n#define JPEG_LIB_VERSION @JPEG_LIB_VERSION@\n#define LIBJPEG_TURBO_VERSION @VERSION@\n#cmakedefine C_ARITH_CODING_SUPPORTED\n#cmakedefine D_ARITH_CODING_SUPPORTED\n#cmakedefine MEM_SRCDST_SUPPORTED\n\n#define HAVE_PROTOTYPES\n#define HAVE_UNSIGNED_CHAR\n#define HAVE_UNSIGNED_SHORT\n/* #define void char */\n/* #define const */\n#undef CHAR_IS_UNSIGNED\n#define HAVE_STDDEF_H\n#define HAVE_STDLIB_H\n#undef NEED_BSD_STRINGS\n#undef NEED_SYS_TYPES_H\n#undef NEED_FAR_POINTERS\t/* we presume a 32-bit flat memory model */\n#undef NEED_SHORT_EXTERNAL_NAMES\n#undef INCOMPLETE_TYPES_BROKEN\n\n/* Define \"boolean\" as unsigned char, not int, per Windows custom */\n#ifndef __RPCNDR_H__\t\t/* don't conflict if rpcndr.h already read */\ntypedef unsigned char boolean;\n#endif\n#define HAVE_BOOLEAN\t\t/* prevent jmorecfg.h from redefining it */\n\n/* Define \"INT32\" as int, not long, per Windows custom */\n#if !(defined(_BASETSD_H_) || defined(_BASETSD_H))   /* don't conflict if basetsd.h already read */\ntypedef short INT16;\ntypedef signed int INT32;\n#endif\n#define XMD_H                   /* prevent jmorecfg.h from redefining it */\n\n#ifdef JPEG_INTERNALS\n\n#undef RIGHT_SHIFT_IS_UNSIGNED\n\n#endif /* JPEG_INTERNALS */\n"
  },
  {
    "path": "ext/libjpeg-turbo/win/jpeg62-memsrcdst.def",
    "content": "EXPORTS\n\tjcopy_block_row @ 1 ; \n\tjcopy_sample_rows @ 2 ; \n\tjdiv_round_up @ 3 ; \n\tjinit_1pass_quantizer @ 4 ; \n\tjinit_2pass_quantizer @ 5 ; \n\tjinit_c_coef_controller @ 6 ; \n\tjinit_c_main_controller @ 7 ; \n\tjinit_c_master_control @ 8 ; \n\tjinit_c_prep_controller @ 9 ; \n\tjinit_color_converter @ 10 ; \n\tjinit_color_deconverter @ 11 ; \n\tjinit_compress_master @ 12 ; \n\tjinit_d_coef_controller @ 13 ; \n\tjinit_d_main_controller @ 14 ; \n\tjinit_d_post_controller @ 15 ; \n\tjinit_downsampler @ 16 ; \n\tjinit_forward_dct @ 17 ; \n\tjinit_huff_decoder @ 18 ; \n\tjinit_huff_encoder @ 19 ; \n\tjinit_input_controller @ 20 ; \n\tjinit_inverse_dct @ 21 ; \n\tjinit_marker_reader @ 22 ; \n\tjinit_marker_writer @ 23 ; \n\tjinit_master_decompress @ 24 ; \n\tjinit_memory_mgr @ 25 ; \n\tjinit_merged_upsampler @ 26 ; \n\tjinit_phuff_decoder @ 27 ; \n\tjinit_phuff_encoder @ 28 ; \n\tjinit_upsampler @ 29 ; \n\tjpeg_CreateCompress @ 30 ; \n\tjpeg_CreateDecompress @ 31 ; \n\tjpeg_abort @ 32 ; \n\tjpeg_abort_compress @ 33 ; \n\tjpeg_abort_decompress @ 34 ; \n\tjpeg_add_quant_table @ 35 ; \n\tjpeg_alloc_huff_table @ 36 ; \n\tjpeg_alloc_quant_table @ 37 ; \n\tjpeg_calc_output_dimensions @ 38 ; \n\tjpeg_consume_input @ 39 ; \n\tjpeg_copy_critical_parameters @ 40 ; \n\tjpeg_default_colorspace @ 41 ; \n\tjpeg_destroy @ 42 ; \n\tjpeg_destroy_compress @ 43 ; \n\tjpeg_destroy_decompress @ 44 ; \n\tjpeg_fdct_float @ 45 ; \n\tjpeg_fdct_ifast @ 46 ; \n\tjpeg_fdct_islow @ 47 ; \n\tjpeg_fill_bit_buffer @ 48 ; \n\tjpeg_finish_compress @ 49 ; \n\tjpeg_finish_decompress @ 50 ; \n\tjpeg_finish_output @ 51 ; \n\tjpeg_free_large @ 52 ; \n\tjpeg_free_small @ 53 ; \n\tjpeg_gen_optimal_table @ 54 ; \n\tjpeg_get_large @ 55 ; \n\tjpeg_get_small @ 56 ; \n\tjpeg_has_multiple_scans @ 57 ; \n\tjpeg_huff_decode @ 58 ; \n\tjpeg_idct_1x1 @ 59 ; \n\tjpeg_idct_2x2 @ 60 ; \n\tjpeg_idct_4x4 @ 61 ; \n\tjpeg_idct_float @ 62 ; \n\tjpeg_idct_ifast @ 63 ; \n\tjpeg_idct_islow @ 64 ; \n\tjpeg_input_complete @ 65 ; \n\tjpeg_make_c_derived_tbl @ 66 ; \n\tjpeg_make_d_derived_tbl @ 67 ; \n\tjpeg_mem_available @ 68 ; \n\tjpeg_mem_init @ 69 ; \n\tjpeg_mem_term @ 70 ; \n\tjpeg_new_colormap @ 71 ; \n\tjpeg_open_backing_store @ 72 ; \n\tjpeg_quality_scaling @ 73 ; \n\tjpeg_read_coefficients @ 74 ; \n\tjpeg_read_header @ 75 ; \n\tjpeg_read_raw_data @ 76 ; \n\tjpeg_read_scanlines @ 77 ; \n\tjpeg_resync_to_restart @ 78 ; \n\tjpeg_save_markers @ 79 ; \n\tjpeg_set_colorspace @ 80 ; \n\tjpeg_set_defaults @ 81 ; \n\tjpeg_set_linear_quality @ 82 ; \n\tjpeg_set_marker_processor @ 83 ; \n\tjpeg_set_quality @ 84 ; \n\tjpeg_simple_progression @ 85 ; \n\tjpeg_start_compress @ 86 ; \n\tjpeg_start_decompress @ 87 ; \n\tjpeg_start_output @ 88 ; \n\tjpeg_std_error @ 89 ; \n\tjpeg_stdio_dest @ 90 ; \n\tjpeg_stdio_src @ 91 ; \n\tjpeg_suppress_tables @ 92 ; \n\tjpeg_write_coefficients @ 93 ; \n\tjpeg_write_m_byte @ 94 ; \n\tjpeg_write_m_header @ 95 ; \n\tjpeg_write_marker @ 96 ; \n\tjpeg_write_raw_data @ 97 ; \n\tjpeg_write_scanlines @ 98 ; \n\tjpeg_write_tables @ 99 ; \n\tjround_up @ 100 ; \n\tjzero_far @ 101 ; \n\tjpeg_mem_dest @ 102 ; \n\tjpeg_mem_src @ 103 ; \n"
  },
  {
    "path": "ext/libjpeg-turbo/win/jpeg62.def",
    "content": "EXPORTS\n\tjcopy_block_row @ 1 ; \n\tjcopy_sample_rows @ 2 ; \n\tjdiv_round_up @ 3 ; \n\tjinit_1pass_quantizer @ 4 ; \n\tjinit_2pass_quantizer @ 5 ; \n\tjinit_c_coef_controller @ 6 ; \n\tjinit_c_main_controller @ 7 ; \n\tjinit_c_master_control @ 8 ; \n\tjinit_c_prep_controller @ 9 ; \n\tjinit_color_converter @ 10 ; \n\tjinit_color_deconverter @ 11 ; \n\tjinit_compress_master @ 12 ; \n\tjinit_d_coef_controller @ 13 ; \n\tjinit_d_main_controller @ 14 ; \n\tjinit_d_post_controller @ 15 ; \n\tjinit_downsampler @ 16 ; \n\tjinit_forward_dct @ 17 ; \n\tjinit_huff_decoder @ 18 ; \n\tjinit_huff_encoder @ 19 ; \n\tjinit_input_controller @ 20 ; \n\tjinit_inverse_dct @ 21 ; \n\tjinit_marker_reader @ 22 ; \n\tjinit_marker_writer @ 23 ; \n\tjinit_master_decompress @ 24 ; \n\tjinit_memory_mgr @ 25 ; \n\tjinit_merged_upsampler @ 26 ; \n\tjinit_phuff_decoder @ 27 ; \n\tjinit_phuff_encoder @ 28 ; \n\tjinit_upsampler @ 29 ; \n\tjpeg_CreateCompress @ 30 ; \n\tjpeg_CreateDecompress @ 31 ; \n\tjpeg_abort @ 32 ; \n\tjpeg_abort_compress @ 33 ; \n\tjpeg_abort_decompress @ 34 ; \n\tjpeg_add_quant_table @ 35 ; \n\tjpeg_alloc_huff_table @ 36 ; \n\tjpeg_alloc_quant_table @ 37 ; \n\tjpeg_calc_output_dimensions @ 38 ; \n\tjpeg_consume_input @ 39 ; \n\tjpeg_copy_critical_parameters @ 40 ; \n\tjpeg_default_colorspace @ 41 ; \n\tjpeg_destroy @ 42 ; \n\tjpeg_destroy_compress @ 43 ; \n\tjpeg_destroy_decompress @ 44 ; \n\tjpeg_fdct_float @ 45 ; \n\tjpeg_fdct_ifast @ 46 ; \n\tjpeg_fdct_islow @ 47 ; \n\tjpeg_fill_bit_buffer @ 48 ; \n\tjpeg_finish_compress @ 49 ; \n\tjpeg_finish_decompress @ 50 ; \n\tjpeg_finish_output @ 51 ; \n\tjpeg_free_large @ 52 ; \n\tjpeg_free_small @ 53 ; \n\tjpeg_gen_optimal_table @ 54 ; \n\tjpeg_get_large @ 55 ; \n\tjpeg_get_small @ 56 ; \n\tjpeg_has_multiple_scans @ 57 ; \n\tjpeg_huff_decode @ 58 ; \n\tjpeg_idct_1x1 @ 59 ; \n\tjpeg_idct_2x2 @ 60 ; \n\tjpeg_idct_4x4 @ 61 ; \n\tjpeg_idct_float @ 62 ; \n\tjpeg_idct_ifast @ 63 ; \n\tjpeg_idct_islow @ 64 ; \n\tjpeg_input_complete @ 65 ; \n\tjpeg_make_c_derived_tbl @ 66 ; \n\tjpeg_make_d_derived_tbl @ 67 ; \n\tjpeg_mem_available @ 68 ; \n\tjpeg_mem_init @ 69 ; \n\tjpeg_mem_term @ 70 ; \n\tjpeg_new_colormap @ 71 ; \n\tjpeg_open_backing_store @ 72 ; \n\tjpeg_quality_scaling @ 73 ; \n\tjpeg_read_coefficients @ 74 ; \n\tjpeg_read_header @ 75 ; \n\tjpeg_read_raw_data @ 76 ; \n\tjpeg_read_scanlines @ 77 ; \n\tjpeg_resync_to_restart @ 78 ; \n\tjpeg_save_markers @ 79 ; \n\tjpeg_set_colorspace @ 80 ; \n\tjpeg_set_defaults @ 81 ; \n\tjpeg_set_linear_quality @ 82 ; \n\tjpeg_set_marker_processor @ 83 ; \n\tjpeg_set_quality @ 84 ; \n\tjpeg_simple_progression @ 85 ; \n\tjpeg_start_compress @ 86 ; \n\tjpeg_start_decompress @ 87 ; \n\tjpeg_start_output @ 88 ; \n\tjpeg_std_error @ 89 ; \n\tjpeg_stdio_dest @ 90 ; \n\tjpeg_stdio_src @ 91 ; \n\tjpeg_suppress_tables @ 92 ; \n\tjpeg_write_coefficients @ 93 ; \n\tjpeg_write_m_byte @ 94 ; \n\tjpeg_write_m_header @ 95 ; \n\tjpeg_write_marker @ 96 ; \n\tjpeg_write_raw_data @ 97 ; \n\tjpeg_write_scanlines @ 98 ; \n\tjpeg_write_tables @ 99 ; \n\tjround_up @ 100 ; \n\tjzero_far @ 101 ; \n"
  },
  {
    "path": "ext/libjpeg-turbo/win/jpeg7-memsrcdst.def",
    "content": "EXPORTS\n\tjcopy_block_row @ 1 ; \n\tjcopy_sample_rows @ 2 ; \n\tjdiv_round_up @ 3 ; \n\tjinit_1pass_quantizer @ 4 ; \n\tjinit_2pass_quantizer @ 5 ; \n\tjinit_c_coef_controller @ 6 ; \n\tjinit_c_main_controller @ 7 ; \n\tjinit_c_master_control @ 8 ; \n\tjinit_c_prep_controller @ 9 ; \n\tjinit_color_converter @ 10 ; \n\tjinit_color_deconverter @ 11 ; \n\tjinit_compress_master @ 12 ; \n\tjinit_d_coef_controller @ 13 ; \n\tjinit_d_main_controller @ 14 ; \n\tjinit_d_post_controller @ 15 ; \n\tjinit_downsampler @ 16 ; \n\tjinit_forward_dct @ 17 ; \n\tjinit_huff_decoder @ 18 ; \n\tjinit_huff_encoder @ 19 ; \n\tjinit_input_controller @ 20 ; \n\tjinit_inverse_dct @ 21 ; \n\tjinit_marker_reader @ 22 ; \n\tjinit_marker_writer @ 23 ; \n\tjinit_master_decompress @ 24 ; \n\tjinit_memory_mgr @ 25 ; \n\tjinit_merged_upsampler @ 26 ; \n\tjinit_phuff_decoder @ 27 ; \n\tjinit_phuff_encoder @ 28 ; \n\tjinit_upsampler @ 29 ; \n\tjpeg_CreateCompress @ 30 ; \n\tjpeg_CreateDecompress @ 31 ; \n\tjpeg_abort @ 32 ; \n\tjpeg_abort_compress @ 33 ; \n\tjpeg_abort_decompress @ 34 ; \n\tjpeg_add_quant_table @ 35 ; \n\tjpeg_alloc_huff_table @ 36 ; \n\tjpeg_alloc_quant_table @ 37 ; \n\tjpeg_calc_jpeg_dimensions @ 38 ; \n\tjpeg_calc_output_dimensions @ 39 ; \n\tjpeg_consume_input @ 40 ; \n\tjpeg_copy_critical_parameters @ 41 ; \n\tjpeg_default_colorspace @ 42 ; \n\tjpeg_default_qtables @ 43 ;\n\tjpeg_destroy @ 44 ; \n\tjpeg_destroy_compress @ 45 ; \n\tjpeg_destroy_decompress @ 46 ; \n\tjpeg_fdct_float @ 47 ; \n\tjpeg_fdct_ifast @ 48 ; \n\tjpeg_fdct_islow @ 49 ; \n\tjpeg_fill_bit_buffer @ 50 ; \n\tjpeg_finish_compress @ 51 ; \n\tjpeg_finish_decompress @ 52 ; \n\tjpeg_finish_output @ 53 ; \n\tjpeg_free_large @ 54 ; \n\tjpeg_free_small @ 55 ; \n\tjpeg_gen_optimal_table @ 56 ; \n\tjpeg_get_large @ 57 ; \n\tjpeg_get_small @ 58 ; \n\tjpeg_has_multiple_scans @ 59 ; \n\tjpeg_huff_decode @ 60 ; \n\tjpeg_idct_1x1 @ 61 ; \n\tjpeg_idct_2x2 @ 62 ; \n\tjpeg_idct_4x4 @ 63 ; \n\tjpeg_idct_float @ 64 ; \n\tjpeg_idct_ifast @ 65 ; \n\tjpeg_idct_islow @ 66 ; \n\tjpeg_input_complete @ 67 ; \n\tjpeg_make_c_derived_tbl @ 68 ; \n\tjpeg_make_d_derived_tbl @ 69 ; \n\tjpeg_mem_available @ 70 ; \n\tjpeg_mem_init @ 71 ; \n\tjpeg_mem_term @ 72 ; \n\tjpeg_new_colormap @ 73 ; \n\tjpeg_open_backing_store @ 74 ; \n\tjpeg_quality_scaling @ 75 ; \n\tjpeg_read_coefficients @ 76 ; \n\tjpeg_read_header @ 77 ; \n\tjpeg_read_raw_data @ 78 ; \n\tjpeg_read_scanlines @ 79 ; \n\tjpeg_resync_to_restart @ 80 ; \n\tjpeg_save_markers @ 81 ; \n\tjpeg_set_colorspace @ 82 ; \n\tjpeg_set_defaults @ 83 ; \n\tjpeg_set_linear_quality @ 84 ; \n\tjpeg_set_marker_processor @ 85 ; \n\tjpeg_set_quality @ 86 ; \n\tjpeg_simple_progression @ 87 ; \n\tjpeg_start_compress @ 88 ; \n\tjpeg_start_decompress @ 89 ; \n\tjpeg_start_output @ 90 ; \n\tjpeg_std_error @ 91 ; \n\tjpeg_stdio_dest @ 92 ; \n\tjpeg_stdio_src @ 93 ; \n\tjpeg_suppress_tables @ 94 ; \n\tjpeg_write_coefficients @ 95 ; \n\tjpeg_write_m_byte @ 96 ; \n\tjpeg_write_m_header @ 97 ; \n\tjpeg_write_marker @ 98 ; \n\tjpeg_write_raw_data @ 99 ; \n\tjpeg_write_scanlines @ 100 ; \n\tjpeg_write_tables @ 101 ; \n\tjround_up @ 102 ; \n\tjzero_far @ 103 ; \n\tjpeg_mem_dest @ 104 ; \n\tjpeg_mem_src @ 105 ; \n"
  },
  {
    "path": "ext/libjpeg-turbo/win/jpeg7.def",
    "content": "EXPORTS\n\tjcopy_block_row @ 1 ; \n\tjcopy_sample_rows @ 2 ; \n\tjdiv_round_up @ 3 ; \n\tjinit_1pass_quantizer @ 4 ; \n\tjinit_2pass_quantizer @ 5 ; \n\tjinit_c_coef_controller @ 6 ; \n\tjinit_c_main_controller @ 7 ; \n\tjinit_c_master_control @ 8 ; \n\tjinit_c_prep_controller @ 9 ; \n\tjinit_color_converter @ 10 ; \n\tjinit_color_deconverter @ 11 ; \n\tjinit_compress_master @ 12 ; \n\tjinit_d_coef_controller @ 13 ; \n\tjinit_d_main_controller @ 14 ; \n\tjinit_d_post_controller @ 15 ; \n\tjinit_downsampler @ 16 ; \n\tjinit_forward_dct @ 17 ; \n\tjinit_huff_decoder @ 18 ; \n\tjinit_huff_encoder @ 19 ; \n\tjinit_input_controller @ 20 ; \n\tjinit_inverse_dct @ 21 ; \n\tjinit_marker_reader @ 22 ; \n\tjinit_marker_writer @ 23 ; \n\tjinit_master_decompress @ 24 ; \n\tjinit_memory_mgr @ 25 ; \n\tjinit_merged_upsampler @ 26 ; \n\tjinit_phuff_decoder @ 27 ; \n\tjinit_phuff_encoder @ 28 ; \n\tjinit_upsampler @ 29 ; \n\tjpeg_CreateCompress @ 30 ; \n\tjpeg_CreateDecompress @ 31 ; \n\tjpeg_abort @ 32 ; \n\tjpeg_abort_compress @ 33 ; \n\tjpeg_abort_decompress @ 34 ; \n\tjpeg_add_quant_table @ 35 ; \n\tjpeg_alloc_huff_table @ 36 ; \n\tjpeg_alloc_quant_table @ 37 ; \n\tjpeg_calc_jpeg_dimensions @ 38 ; \n\tjpeg_calc_output_dimensions @ 39 ; \n\tjpeg_consume_input @ 40 ; \n\tjpeg_copy_critical_parameters @ 41 ; \n\tjpeg_default_colorspace @ 42 ; \n\tjpeg_default_qtables @ 43 ;\n\tjpeg_destroy @ 44 ; \n\tjpeg_destroy_compress @ 45 ; \n\tjpeg_destroy_decompress @ 46 ; \n\tjpeg_fdct_float @ 47 ; \n\tjpeg_fdct_ifast @ 48 ; \n\tjpeg_fdct_islow @ 49 ; \n\tjpeg_fill_bit_buffer @ 50 ; \n\tjpeg_finish_compress @ 51 ; \n\tjpeg_finish_decompress @ 52 ; \n\tjpeg_finish_output @ 53 ; \n\tjpeg_free_large @ 54 ; \n\tjpeg_free_small @ 55 ; \n\tjpeg_gen_optimal_table @ 56 ; \n\tjpeg_get_large @ 57 ; \n\tjpeg_get_small @ 58 ; \n\tjpeg_has_multiple_scans @ 59 ; \n\tjpeg_huff_decode @ 60 ; \n\tjpeg_idct_1x1 @ 61 ; \n\tjpeg_idct_2x2 @ 62 ; \n\tjpeg_idct_4x4 @ 63 ; \n\tjpeg_idct_float @ 64 ; \n\tjpeg_idct_ifast @ 65 ; \n\tjpeg_idct_islow @ 66 ; \n\tjpeg_input_complete @ 67 ; \n\tjpeg_make_c_derived_tbl @ 68 ; \n\tjpeg_make_d_derived_tbl @ 69 ; \n\tjpeg_mem_available @ 70 ; \n\tjpeg_mem_init @ 71 ; \n\tjpeg_mem_term @ 72 ; \n\tjpeg_new_colormap @ 73 ; \n\tjpeg_open_backing_store @ 74 ; \n\tjpeg_quality_scaling @ 75 ; \n\tjpeg_read_coefficients @ 76 ; \n\tjpeg_read_header @ 77 ; \n\tjpeg_read_raw_data @ 78 ; \n\tjpeg_read_scanlines @ 79 ; \n\tjpeg_resync_to_restart @ 80 ; \n\tjpeg_save_markers @ 81 ; \n\tjpeg_set_colorspace @ 82 ; \n\tjpeg_set_defaults @ 83 ; \n\tjpeg_set_linear_quality @ 84 ; \n\tjpeg_set_marker_processor @ 85 ; \n\tjpeg_set_quality @ 86 ; \n\tjpeg_simple_progression @ 87 ; \n\tjpeg_start_compress @ 88 ; \n\tjpeg_start_decompress @ 89 ; \n\tjpeg_start_output @ 90 ; \n\tjpeg_std_error @ 91 ; \n\tjpeg_stdio_dest @ 92 ; \n\tjpeg_stdio_src @ 93 ; \n\tjpeg_suppress_tables @ 94 ; \n\tjpeg_write_coefficients @ 95 ; \n\tjpeg_write_m_byte @ 96 ; \n\tjpeg_write_m_header @ 97 ; \n\tjpeg_write_marker @ 98 ; \n\tjpeg_write_raw_data @ 99 ; \n\tjpeg_write_scanlines @ 100 ; \n\tjpeg_write_tables @ 101 ; \n\tjround_up @ 102 ; \n\tjzero_far @ 103 ; \n"
  },
  {
    "path": "ext/libjpeg-turbo/win/jpeg8.def",
    "content": "EXPORTS\n\tjcopy_block_row @ 1 ; \n\tjcopy_sample_rows @ 2 ; \n\tjdiv_round_up @ 3 ; \n\tjinit_1pass_quantizer @ 4 ; \n\tjinit_2pass_quantizer @ 5 ; \n\tjinit_c_coef_controller @ 6 ; \n\tjinit_c_main_controller @ 7 ; \n\tjinit_c_master_control @ 8 ; \n\tjinit_c_prep_controller @ 9 ; \n\tjinit_color_converter @ 10 ; \n\tjinit_color_deconverter @ 11 ; \n\tjinit_compress_master @ 12 ; \n\tjinit_d_coef_controller @ 13 ; \n\tjinit_d_main_controller @ 14 ; \n\tjinit_d_post_controller @ 15 ; \n\tjinit_downsampler @ 16 ; \n\tjinit_forward_dct @ 17 ; \n\tjinit_huff_decoder @ 18 ; \n\tjinit_huff_encoder @ 19 ; \n\tjinit_input_controller @ 20 ; \n\tjinit_inverse_dct @ 21 ; \n\tjinit_marker_reader @ 22 ; \n\tjinit_marker_writer @ 23 ; \n\tjinit_master_decompress @ 24 ; \n\tjinit_memory_mgr @ 25 ; \n\tjinit_merged_upsampler @ 26 ; \n\tjinit_phuff_decoder @ 27 ; \n\tjinit_phuff_encoder @ 28 ; \n\tjinit_upsampler @ 29 ; \n\tjpeg_CreateCompress @ 30 ; \n\tjpeg_CreateDecompress @ 31 ; \n\tjpeg_abort @ 32 ; \n\tjpeg_abort_compress @ 33 ; \n\tjpeg_abort_decompress @ 34 ; \n\tjpeg_add_quant_table @ 35 ; \n\tjpeg_alloc_huff_table @ 36 ; \n\tjpeg_alloc_quant_table @ 37 ; \n\tjpeg_calc_jpeg_dimensions @ 38 ; \n\tjpeg_calc_output_dimensions @ 39 ; \n\tjpeg_consume_input @ 40 ; \n\tjpeg_copy_critical_parameters @ 41 ; \n\tjpeg_core_output_dimensions @ 42 ; \n\tjpeg_default_colorspace @ 43 ; \n\tjpeg_default_qtables @ 44 ;\n\tjpeg_destroy @ 45 ; \n\tjpeg_destroy_compress @ 46 ; \n\tjpeg_destroy_decompress @ 47 ; \n\tjpeg_fdct_float @ 48 ; \n\tjpeg_fdct_ifast @ 49 ; \n\tjpeg_fdct_islow @ 50 ; \n\tjpeg_fill_bit_buffer @ 51 ; \n\tjpeg_finish_compress @ 52 ; \n\tjpeg_finish_decompress @ 53 ; \n\tjpeg_finish_output @ 54 ; \n\tjpeg_free_large @ 55 ; \n\tjpeg_free_small @ 56 ; \n\tjpeg_gen_optimal_table @ 57 ; \n\tjpeg_get_large @ 58 ; \n\tjpeg_get_small @ 59 ; \n\tjpeg_has_multiple_scans @ 60 ; \n\tjpeg_huff_decode @ 61 ; \n\tjpeg_idct_1x1 @ 62 ; \n\tjpeg_idct_2x2 @ 63 ; \n\tjpeg_idct_4x4 @ 64 ; \n\tjpeg_idct_float @ 65 ; \n\tjpeg_idct_ifast @ 66 ; \n\tjpeg_idct_islow @ 67 ; \n\tjpeg_input_complete @ 68 ; \n\tjpeg_make_c_derived_tbl @ 69 ; \n\tjpeg_make_d_derived_tbl @ 70 ; \n\tjpeg_mem_available @ 71 ; \n\tjpeg_mem_dest @ 72 ;\n\tjpeg_mem_init @ 73 ; \n\tjpeg_mem_src @ 74 ;\n\tjpeg_mem_term @ 75 ; \n\tjpeg_new_colormap @ 76 ; \n\tjpeg_open_backing_store @ 77 ; \n\tjpeg_quality_scaling @ 78 ; \n\tjpeg_read_coefficients @ 79 ; \n\tjpeg_read_header @ 80 ; \n\tjpeg_read_raw_data @ 81 ; \n\tjpeg_read_scanlines @ 82 ; \n\tjpeg_resync_to_restart @ 83 ; \n\tjpeg_save_markers @ 84 ; \n\tjpeg_set_colorspace @ 85 ; \n\tjpeg_set_defaults @ 86 ; \n\tjpeg_set_linear_quality @ 87 ; \n\tjpeg_set_marker_processor @ 88 ; \n\tjpeg_set_quality @ 89 ; \n\tjpeg_simple_progression @ 90 ; \n\tjpeg_start_compress @ 91 ; \n\tjpeg_start_decompress @ 92 ; \n\tjpeg_start_output @ 93 ; \n\tjpeg_std_error @ 94 ; \n\tjpeg_stdio_dest @ 95 ; \n\tjpeg_stdio_src @ 96 ; \n\tjpeg_suppress_tables @ 97 ; \n\tjpeg_write_coefficients @ 98 ; \n\tjpeg_write_m_byte @ 99 ; \n\tjpeg_write_m_header @ 100 ; \n\tjpeg_write_marker @ 101 ; \n\tjpeg_write_raw_data @ 102 ; \n\tjpeg_write_scanlines @ 103 ; \n\tjpeg_write_tables @ 104 ; \n\tjround_up @ 105 ; \n\tjzero_far @ 106 ; \n"
  },
  {
    "path": "ext/libjpeg-turbo/win/jsimdcfg.inc",
    "content": ";\n; Automatically generated include file from jsimdcfg.inc.h\n;\n;\n; -- jpeglib.h\n;\n%define DCTSIZE 8\n%define DCTSIZE2 64\n;\n; -- jmorecfg.h\n;\n%define RGB_RED 0\n%define RGB_GREEN 1\n%define RGB_BLUE 2\n%define RGB_PIXELSIZE 3\n%define EXT_RGB_RED 0\n%define EXT_RGB_GREEN 1\n%define EXT_RGB_BLUE 2\n%define EXT_RGB_PIXELSIZE 3\n%define EXT_RGBX_RED 0\n%define EXT_RGBX_GREEN 1\n%define EXT_RGBX_BLUE 2\n%define EXT_RGBX_PIXELSIZE 4\n%define EXT_BGR_RED 2\n%define EXT_BGR_GREEN 1\n%define EXT_BGR_BLUE 0\n%define EXT_BGR_PIXELSIZE 3\n%define EXT_BGRX_RED 2\n%define EXT_BGRX_GREEN 1\n%define EXT_BGRX_BLUE 0\n%define EXT_BGRX_PIXELSIZE 4\n%define EXT_XBGR_RED 3\n%define EXT_XBGR_GREEN 2\n%define EXT_XBGR_BLUE 1\n%define EXT_XBGR_PIXELSIZE 4\n%define EXT_XRGB_RED 1\n%define EXT_XRGB_GREEN 2\n%define EXT_XRGB_BLUE 3\n%define EXT_XRGB_PIXELSIZE 4\n%define RGBX_FILLER_0XFF 1\n; Representation of a single sample (pixel element value).\n; On this SIMD implementation, this must be 'unsigned char'.\n;\n%define JSAMPLE byte ; unsigned char\n%define SIZEOF_JSAMPLE SIZEOF_BYTE ; sizeof(JSAMPLE)\n%define CENTERJSAMPLE 128\n; Representation of a DCT frequency coefficient.\n; On this SIMD implementation, this must be 'short'.\n;\n%define JCOEF word ; short\n%define SIZEOF_JCOEF SIZEOF_WORD ; sizeof(JCOEF)\n; Datatype used for image dimensions.\n; On this SIMD implementation, this must be 'unsigned int'.\n;\n%define JDIMENSION dword ; unsigned int\n%define SIZEOF_JDIMENSION SIZEOF_DWORD ; sizeof(JDIMENSION)\n%define JSAMPROW POINTER ; JSAMPLE * (jpeglib.h)\n%define JSAMPARRAY POINTER ; JSAMPROW * (jpeglib.h)\n%define JSAMPIMAGE POINTER ; JSAMPARRAY * (jpeglib.h)\n%define JCOEFPTR POINTER ; JCOEF * (jpeglib.h)\n%define SIZEOF_JSAMPROW SIZEOF_POINTER ; sizeof(JSAMPROW)\n%define SIZEOF_JSAMPARRAY SIZEOF_POINTER ; sizeof(JSAMPARRAY)\n%define SIZEOF_JSAMPIMAGE SIZEOF_POINTER ; sizeof(JSAMPIMAGE)\n%define SIZEOF_JCOEFPTR SIZEOF_POINTER ; sizeof(JCOEFPTR)\n;\n; -- jdct.h\n;\n; A forward DCT routine is given a pointer to a work area of type DCTELEM[];\n; the DCT is to be performed in-place in that buffer.\n; To maximize parallelism, Type DCTELEM is changed to short (originally, int).\n;\n%define DCTELEM word ; short\n%define SIZEOF_DCTELEM SIZEOF_WORD ; sizeof(DCTELEM)\n%define float FP32 ; float\n%define SIZEOF_FAST_FLOAT SIZEOF_FP32 ; sizeof(float)\n; To maximize parallelism, Type short is changed to short.\n;\n%define ISLOW_MULT_TYPE word ; must be short\n%define SIZEOF_ISLOW_MULT_TYPE SIZEOF_WORD ; sizeof(ISLOW_MULT_TYPE)\n%define IFAST_MULT_TYPE word ; must be short\n%define SIZEOF_IFAST_MULT_TYPE SIZEOF_WORD ; sizeof(IFAST_MULT_TYPE)\n%define IFAST_SCALE_BITS 2 ; fractional bits in scale factors\n%define FLOAT_MULT_TYPE FP32 ; must be float\n%define SIZEOF_FLOAT_MULT_TYPE SIZEOF_FP32 ; sizeof(FLOAT_MULT_TYPE)\n;\n; -- jsimd.h\n;\n%define JSIMD_NONE 0x00\n%define JSIMD_MMX 0x01\n%define JSIMD_3DNOW 0x02\n%define JSIMD_SSE 0x04\n%define JSIMD_SSE2 0x08\n; Short forms of external names for systems with brain-damaged linkers.\n;\n"
  },
  {
    "path": "ext/libjpeg-turbo/wizard.txt",
    "content": "Advanced usage instructions for the Independent JPEG Group's JPEG software\n==========================================================================\n\nThis file describes cjpeg's \"switches for wizards\".\n\nThe \"wizard\" switches are intended for experimentation with JPEG by persons\nwho are reasonably knowledgeable about the JPEG standard.  If you don't know\nwhat you are doing, DON'T USE THESE SWITCHES.  You'll likely produce files\nwith worse image quality and/or poorer compression than you'd get from the\ndefault settings.  Furthermore, these switches must be used with caution\nwhen making files intended for general use, because not all JPEG decoders\nwill support unusual JPEG parameter settings.\n\n\nQuantization Table Adjustment\n-----------------------------\n\nOrdinarily, cjpeg starts with a default set of tables (the same ones given\nas examples in the JPEG standard) and scales them up or down according to\nthe -quality setting.  The details of the scaling algorithm can be found in\njcparam.c.  At very low quality settings, some quantization table entries\ncan get scaled up to values exceeding 255.  Although 2-byte quantization\nvalues are supported by the IJG software, this feature is not in baseline\nJPEG and is not supported by all implementations.  If you need to ensure\nwide compatibility of low-quality files, you can constrain the scaled\nquantization values to no more than 255 by giving the -baseline switch.\nNote that use of -baseline will result in poorer quality for the same file\nsize, since more bits than necessary are expended on higher AC coefficients.\n\nYou can substitute a different set of quantization values by using the\n-qtables switch:\n\n\t-qtables file\tUse the quantization tables given in the named file.\n\nThe specified file should be a text file containing decimal quantization\nvalues.  The file should contain one to four tables, each of 64 elements.\nThe tables are implicitly numbered 0,1,etc. in order of appearance.  Table\nentries appear in normal array order (NOT in the zigzag order in which they\nwill be stored in the JPEG file).\n\nQuantization table files are free format, in that arbitrary whitespace can\nappear between numbers.  Also, comments can be included: a comment starts\nwith '#' and extends to the end of the line.  Here is an example file that\nduplicates the default quantization tables:\n\n\t# Quantization tables given in JPEG spec, section K.1\n\n\t# This is table 0 (the luminance table):\n\t  16  11  10  16  24  40  51  61\n\t  12  12  14  19  26  58  60  55\n\t  14  13  16  24  40  57  69  56\n\t  14  17  22  29  51  87  80  62\n\t  18  22  37  56  68 109 103  77\n\t  24  35  55  64  81 104 113  92\n\t  49  64  78  87 103 121 120 101\n\t  72  92  95  98 112 100 103  99\n\n\t# This is table 1 (the chrominance table):\n\t  17  18  24  47  99  99  99  99\n\t  18  21  26  66  99  99  99  99\n\t  24  26  56  99  99  99  99  99\n\t  47  66  99  99  99  99  99  99\n\t  99  99  99  99  99  99  99  99\n\t  99  99  99  99  99  99  99  99\n\t  99  99  99  99  99  99  99  99\n\t  99  99  99  99  99  99  99  99\n\nIf the -qtables switch is used without -quality, then the specified tables\nare used exactly as-is.  If both -qtables and -quality are used, then the\ntables taken from the file are scaled in the same fashion that the default\ntables would be scaled for that quality setting.  If -baseline appears, then\nthe quantization values are constrained to the range 1-255.\n\nBy default, cjpeg will use quantization table 0 for luminance components and\ntable 1 for chrominance components.  To override this choice, use the -qslots\nswitch:\n\n\t-qslots N[,...]\t\tSelect which quantization table to use for\n\t\t\t\teach color component.\n\nThe -qslots switch specifies a quantization table number for each color\ncomponent, in the order in which the components appear in the JPEG SOF marker.\nFor example, to create a separate table for each of Y,Cb,Cr, you could\nprovide a -qtables file that defines three quantization tables and say\n\"-qslots 0,1,2\".  If -qslots gives fewer table numbers than there are color\ncomponents, then the last table number is repeated as necessary.\n\n\nSampling Factor Adjustment\n--------------------------\n\nBy default, cjpeg uses 2:1 horizontal and vertical downsampling when\ncompressing YCbCr data, and no downsampling for all other color spaces.\nYou can override this default with the -sample switch:\n\n\t-sample HxV[,...]\tSet JPEG sampling factors for each color\n\t\t\t\tcomponent.\n\nThe -sample switch specifies the JPEG sampling factors for each color\ncomponent, in the order in which they appear in the JPEG SOF marker.\nIf you specify fewer HxV pairs than there are components, the remaining\ncomponents are set to 1x1 sampling.  For example, the default YCbCr setting\nis equivalent to \"-sample 2x2,1x1,1x1\", which can be abbreviated to\n\"-sample 2x2\".\n\nThere are still some JPEG decoders in existence that support only 2x1\nsampling (also called 4:2:2 sampling).  Compatibility with such decoders can\nbe achieved by specifying \"-sample 2x1\".  This is not recommended unless\nreally necessary, since it increases file size and encoding/decoding time\nwith very little quality gain.\n\n\nMultiple Scan / Progression Control\n-----------------------------------\n\nBy default, cjpeg emits a single-scan sequential JPEG file.  The\n-progressive switch generates a progressive JPEG file using a default series\nof progression parameters.  You can create multiple-scan sequential JPEG\nfiles or progressive JPEG files with custom progression parameters by using\nthe -scans switch:\n\n\t-scans file\tUse the scan sequence given in the named file.\n\nThe specified file should be a text file containing a \"scan script\".\nThe script specifies the contents and ordering of the scans to be emitted.\nEach entry in the script defines one scan.  A scan definition specifies\nthe components to be included in the scan, and for progressive JPEG it also\nspecifies the progression parameters Ss,Se,Ah,Al for the scan.  Scan\ndefinitions are separated by semicolons (';').  A semicolon after the last\nscan definition is optional.\n\nEach scan definition contains one to four component indexes, optionally\nfollowed by a colon (':') and the four progressive-JPEG parameters.  The\ncomponent indexes denote which color component(s) are to be transmitted in\nthe scan.  Components are numbered in the order in which they appear in the\nJPEG SOF marker, with the first component being numbered 0.  (Note that these\nindexes are not the \"component ID\" codes assigned to the components, just\npositional indexes.)\n\nThe progression parameters for each scan are:\n\tSs\tZigzag index of first coefficient included in scan\n\tSe\tZigzag index of last coefficient included in scan\n\tAh\tZero for first scan of a coefficient, else Al of prior scan\n\tAl\tSuccessive approximation low bit position for scan\nIf the progression parameters are omitted, the values 0,63,0,0 are used,\nproducing a sequential JPEG file.  cjpeg automatically determines whether\nthe script represents a progressive or sequential file, by observing whether\nSs and Se values other than 0 and 63 appear.  (The -progressive switch is\nnot needed to specify this; in fact, it is ignored when -scans appears.)\nThe scan script must meet the JPEG restrictions on progression sequences.\n(cjpeg checks that the spec's requirements are obeyed.)\n\nScan script files are free format, in that arbitrary whitespace can appear\nbetween numbers and around punctuation.  Also, comments can be included: a\ncomment starts with '#' and extends to the end of the line.  For additional\nlegibility, commas or dashes can be placed between values.  (Actually, any\nsingle punctuation character other than ':' or ';' can be inserted.)  For\nexample, the following two scan definitions are equivalent:\n\t0 1 2: 0 63 0 0;\n\t0,1,2 : 0-63, 0,0 ;\n\nHere is an example of a scan script that generates a partially interleaved\nsequential JPEG file:\n\n\t0;\t\t\t# Y only in first scan\n\t1 2;\t\t\t# Cb and Cr in second scan\n\nHere is an example of a progressive scan script using only spectral selection\n(no successive approximation):\n\n\t# Interleaved DC scan for Y,Cb,Cr:\n\t0,1,2: 0-0,   0, 0 ;\n\t# AC scans:\n\t0:     1-2,   0, 0 ;\t# First two Y AC coefficients\n\t0:     3-5,   0, 0 ;\t# Three more\n\t1:     1-63,  0, 0 ;\t# All AC coefficients for Cb\n\t2:     1-63,  0, 0 ;\t# All AC coefficients for Cr\n\t0:     6-9,   0, 0 ;\t# More Y coefficients\n\t0:     10-63, 0, 0 ;\t# Remaining Y coefficients\n\nHere is an example of a successive-approximation script.  This is equivalent\nto the default script used by \"cjpeg -progressive\" for YCbCr images:\n\n\t# Initial DC scan for Y,Cb,Cr (lowest bit not sent)\n\t0,1,2: 0-0,   0, 1 ;\n\t# First AC scan: send first 5 Y AC coefficients, minus 2 lowest bits:\n\t0:     1-5,   0, 2 ;\n\t# Send all Cr,Cb AC coefficients, minus lowest bit:\n\t# (chroma data is usually too small to be worth subdividing further;\n\t#  but note we send Cr first since eye is least sensitive to Cb)\n\t2:     1-63,  0, 1 ;\n\t1:     1-63,  0, 1 ;\n\t# Send remaining Y AC coefficients, minus 2 lowest bits:\n\t0:     6-63,  0, 2 ;\n\t# Send next-to-lowest bit of all Y AC coefficients:\n\t0:     1-63,  2, 1 ;\n\t# At this point we've sent all but the lowest bit of all coefficients.\n\t# Send lowest bit of DC coefficients\n\t0,1,2: 0-0,   1, 0 ;\n\t# Send lowest bit of AC coefficients\n\t2:     1-63,  1, 0 ;\n\t1:     1-63,  1, 0 ;\n\t# Y AC lowest bit scan is last; it's usually the largest scan\n\t0:     1-63,  1, 0 ;\n\nIt may be worth pointing out that this script is tuned for quality settings\nof around 50 to 75.  For lower quality settings, you'd probably want to use\na script with fewer stages of successive approximation (otherwise the\ninitial scans will be really bad).  For higher quality settings, you might\nwant to use more stages of successive approximation (so that the initial\nscans are not too large).\n"
  },
  {
    "path": "ext/libjpeg-turbo/wrbmp.c",
    "content": "/*\n * wrbmp.c\n *\n * Copyright (C) 1994-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to write output images in Microsoft \"BMP\"\n * format (MS Windows 3.x and OS/2 1.x flavors).\n * Either 8-bit colormapped or 24-bit full-color format can be written.\n * No compression is supported.\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume output to\n * an ordinary stdio stream.\n *\n * This code contributed by James Arthur Boucher.\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n\n#ifdef BMP_SUPPORTED\n\n\n/*\n * To support 12-bit JPEG data, we'd have to scale output down to 8 bits.\n * This is not yet implemented.\n */\n\n#if BITS_IN_JSAMPLE != 8\n  Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */\n#endif\n\n/*\n * Since BMP stores scanlines bottom-to-top, we have to invert the image\n * from JPEG's top-to-bottom order.  To do this, we save the outgoing data\n * in a virtual array during put_pixel_row calls, then actually emit the\n * BMP file during finish_output.  The virtual array contains one JSAMPLE per\n * pixel if the output is grayscale or colormapped, three if it is full color.\n */\n\n/* Private version of data destination object */\n\ntypedef struct {\n  struct djpeg_dest_struct pub;\t/* public fields */\n\n  boolean is_os2;\t\t/* saves the OS2 format request flag */\n\n  jvirt_sarray_ptr whole_image;\t/* needed to reverse row order */\n  JDIMENSION data_width;\t/* JSAMPLEs per row */\n  JDIMENSION row_width;\t\t/* physical width of one row in the BMP file */\n  int pad_bytes;\t\t/* number of padding bytes needed per row */\n  JDIMENSION cur_output_row;\t/* next row# to write to virtual array */\n} bmp_dest_struct;\n\ntypedef bmp_dest_struct * bmp_dest_ptr;\n\n\n/* Forward declarations */\nLOCAL(void) write_colormap\n\tJPP((j_decompress_ptr cinfo, bmp_dest_ptr dest,\n\t     int map_colors, int map_entry_size));\n\n\n/*\n * Write some pixel data.\n * In this module rows_supplied will always be 1.\n */\n\nMETHODDEF(void)\nput_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t\tJDIMENSION rows_supplied)\n/* This version is for writing 24-bit pixels */\n{\n  bmp_dest_ptr dest = (bmp_dest_ptr) dinfo;\n  JSAMPARRAY image_ptr;\n  register JSAMPROW inptr, outptr;\n  register JDIMENSION col;\n  int pad;\n\n  /* Access next row in virtual array */\n  image_ptr = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, dest->whole_image,\n     dest->cur_output_row, (JDIMENSION) 1, TRUE);\n  dest->cur_output_row++;\n\n  /* Transfer data.  Note destination values must be in BGR order\n   * (even though Microsoft's own documents say the opposite).\n   */\n  inptr = dest->pub.buffer[0];\n  outptr = image_ptr[0];\n  for (col = cinfo->output_width; col > 0; col--) {\n    outptr[2] = *inptr++;\t/* can omit GETJSAMPLE() safely */\n    outptr[1] = *inptr++;\n    outptr[0] = *inptr++;\n    outptr += 3;\n  }\n\n  /* Zero out the pad bytes. */\n  pad = dest->pad_bytes;\n  while (--pad >= 0)\n    *outptr++ = 0;\n}\n\nMETHODDEF(void)\nput_gray_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t       JDIMENSION rows_supplied)\n/* This version is for grayscale OR quantized color output */\n{\n  bmp_dest_ptr dest = (bmp_dest_ptr) dinfo;\n  JSAMPARRAY image_ptr;\n  register JSAMPROW inptr, outptr;\n  register JDIMENSION col;\n  int pad;\n\n  /* Access next row in virtual array */\n  image_ptr = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, dest->whole_image,\n     dest->cur_output_row, (JDIMENSION) 1, TRUE);\n  dest->cur_output_row++;\n\n  /* Transfer data. */\n  inptr = dest->pub.buffer[0];\n  outptr = image_ptr[0];\n  for (col = cinfo->output_width; col > 0; col--) {\n    *outptr++ = *inptr++;\t/* can omit GETJSAMPLE() safely */\n  }\n\n  /* Zero out the pad bytes. */\n  pad = dest->pad_bytes;\n  while (--pad >= 0)\n    *outptr++ = 0;\n}\n\n\n/*\n * Startup: normally writes the file header.\n * In this module we may as well postpone everything until finish_output.\n */\n\nMETHODDEF(void)\nstart_output_bmp (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  /* no work here */\n}\n\n\n/*\n * Finish up at the end of the file.\n *\n * Here is where we really output the BMP file.\n *\n * First, routines to write the Windows and OS/2 variants of the file header.\n */\n\nLOCAL(void)\nwrite_bmp_header (j_decompress_ptr cinfo, bmp_dest_ptr dest)\n/* Write a Windows-style BMP file header, including colormap if needed */\n{\n  char bmpfileheader[14];\n  char bmpinfoheader[40];\n#define PUT_2B(array,offset,value)  \\\n\t(array[offset] = (char) ((value) & 0xFF), \\\n\t array[offset+1] = (char) (((value) >> 8) & 0xFF))\n#define PUT_4B(array,offset,value)  \\\n\t(array[offset] = (char) ((value) & 0xFF), \\\n\t array[offset+1] = (char) (((value) >> 8) & 0xFF), \\\n\t array[offset+2] = (char) (((value) >> 16) & 0xFF), \\\n\t array[offset+3] = (char) (((value) >> 24) & 0xFF))\n  INT32 headersize, bfSize;\n  int bits_per_pixel, cmap_entries;\n\n  /* Compute colormap size and total file size */\n  if (cinfo->out_color_space == JCS_RGB) {\n    if (cinfo->quantize_colors) {\n      /* Colormapped RGB */\n      bits_per_pixel = 8;\n      cmap_entries = 256;\n    } else {\n      /* Unquantized, full color RGB */\n      bits_per_pixel = 24;\n      cmap_entries = 0;\n    }\n  } else {\n    /* Grayscale output.  We need to fake a 256-entry colormap. */\n    bits_per_pixel = 8;\n    cmap_entries = 256;\n  }\n  /* File size */\n  headersize = 14 + 40 + cmap_entries * 4; /* Header and colormap */\n  bfSize = headersize + (INT32) dest->row_width * (INT32) cinfo->output_height;\n  \n  /* Set unused fields of header to 0 */\n  MEMZERO(bmpfileheader, SIZEOF(bmpfileheader));\n  MEMZERO(bmpinfoheader, SIZEOF(bmpinfoheader));\n\n  /* Fill the file header */\n  bmpfileheader[0] = 0x42;\t/* first 2 bytes are ASCII 'B', 'M' */\n  bmpfileheader[1] = 0x4D;\n  PUT_4B(bmpfileheader, 2, bfSize); /* bfSize */\n  /* we leave bfReserved1 & bfReserved2 = 0 */\n  PUT_4B(bmpfileheader, 10, headersize); /* bfOffBits */\n\n  /* Fill the info header (Microsoft calls this a BITMAPINFOHEADER) */\n  PUT_2B(bmpinfoheader, 0, 40);\t/* biSize */\n  PUT_4B(bmpinfoheader, 4, cinfo->output_width); /* biWidth */\n  PUT_4B(bmpinfoheader, 8, cinfo->output_height); /* biHeight */\n  PUT_2B(bmpinfoheader, 12, 1);\t/* biPlanes - must be 1 */\n  PUT_2B(bmpinfoheader, 14, bits_per_pixel); /* biBitCount */\n  /* we leave biCompression = 0, for none */\n  /* we leave biSizeImage = 0; this is correct for uncompressed data */\n  if (cinfo->density_unit == 2) { /* if have density in dots/cm, then */\n    PUT_4B(bmpinfoheader, 24, (INT32) (cinfo->X_density*100)); /* XPels/M */\n    PUT_4B(bmpinfoheader, 28, (INT32) (cinfo->Y_density*100)); /* XPels/M */\n  }\n  PUT_2B(bmpinfoheader, 32, cmap_entries); /* biClrUsed */\n  /* we leave biClrImportant = 0 */\n\n  if (JFWRITE(dest->pub.output_file, bmpfileheader, 14) != (size_t) 14)\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n  if (JFWRITE(dest->pub.output_file, bmpinfoheader, 40) != (size_t) 40)\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n\n  if (cmap_entries > 0)\n    write_colormap(cinfo, dest, cmap_entries, 4);\n}\n\n\nLOCAL(void)\nwrite_os2_header (j_decompress_ptr cinfo, bmp_dest_ptr dest)\n/* Write an OS2-style BMP file header, including colormap if needed */\n{\n  char bmpfileheader[14];\n  char bmpcoreheader[12];\n  INT32 headersize, bfSize;\n  int bits_per_pixel, cmap_entries;\n\n  /* Compute colormap size and total file size */\n  if (cinfo->out_color_space == JCS_RGB) {\n    if (cinfo->quantize_colors) {\n      /* Colormapped RGB */\n      bits_per_pixel = 8;\n      cmap_entries = 256;\n    } else {\n      /* Unquantized, full color RGB */\n      bits_per_pixel = 24;\n      cmap_entries = 0;\n    }\n  } else {\n    /* Grayscale output.  We need to fake a 256-entry colormap. */\n    bits_per_pixel = 8;\n    cmap_entries = 256;\n  }\n  /* File size */\n  headersize = 14 + 12 + cmap_entries * 3; /* Header and colormap */\n  bfSize = headersize + (INT32) dest->row_width * (INT32) cinfo->output_height;\n  \n  /* Set unused fields of header to 0 */\n  MEMZERO(bmpfileheader, SIZEOF(bmpfileheader));\n  MEMZERO(bmpcoreheader, SIZEOF(bmpcoreheader));\n\n  /* Fill the file header */\n  bmpfileheader[0] = 0x42;\t/* first 2 bytes are ASCII 'B', 'M' */\n  bmpfileheader[1] = 0x4D;\n  PUT_4B(bmpfileheader, 2, bfSize); /* bfSize */\n  /* we leave bfReserved1 & bfReserved2 = 0 */\n  PUT_4B(bmpfileheader, 10, headersize); /* bfOffBits */\n\n  /* Fill the info header (Microsoft calls this a BITMAPCOREHEADER) */\n  PUT_2B(bmpcoreheader, 0, 12);\t/* bcSize */\n  PUT_2B(bmpcoreheader, 4, cinfo->output_width); /* bcWidth */\n  PUT_2B(bmpcoreheader, 6, cinfo->output_height); /* bcHeight */\n  PUT_2B(bmpcoreheader, 8, 1);\t/* bcPlanes - must be 1 */\n  PUT_2B(bmpcoreheader, 10, bits_per_pixel); /* bcBitCount */\n\n  if (JFWRITE(dest->pub.output_file, bmpfileheader, 14) != (size_t) 14)\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n  if (JFWRITE(dest->pub.output_file, bmpcoreheader, 12) != (size_t) 12)\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n\n  if (cmap_entries > 0)\n    write_colormap(cinfo, dest, cmap_entries, 3);\n}\n\n\n/*\n * Write the colormap.\n * Windows uses BGR0 map entries; OS/2 uses BGR entries.\n */\n\nLOCAL(void)\nwrite_colormap (j_decompress_ptr cinfo, bmp_dest_ptr dest,\n\t\tint map_colors, int map_entry_size)\n{\n  JSAMPARRAY colormap = cinfo->colormap;\n  int num_colors = cinfo->actual_number_of_colors;\n  FILE * outfile = dest->pub.output_file;\n  int i;\n\n  if (colormap != NULL) {\n    if (cinfo->out_color_components == 3) {\n      /* Normal case with RGB colormap */\n      for (i = 0; i < num_colors; i++) {\n\tputc(GETJSAMPLE(colormap[2][i]), outfile);\n\tputc(GETJSAMPLE(colormap[1][i]), outfile);\n\tputc(GETJSAMPLE(colormap[0][i]), outfile);\n\tif (map_entry_size == 4)\n\t  putc(0, outfile);\n      }\n    } else {\n      /* Grayscale colormap (only happens with grayscale quantization) */\n      for (i = 0; i < num_colors; i++) {\n\tputc(GETJSAMPLE(colormap[0][i]), outfile);\n\tputc(GETJSAMPLE(colormap[0][i]), outfile);\n\tputc(GETJSAMPLE(colormap[0][i]), outfile);\n\tif (map_entry_size == 4)\n\t  putc(0, outfile);\n      }\n    }\n  } else {\n    /* If no colormap, must be grayscale data.  Generate a linear \"map\". */\n    for (i = 0; i < 256; i++) {\n      putc(i, outfile);\n      putc(i, outfile);\n      putc(i, outfile);\n      if (map_entry_size == 4)\n\tputc(0, outfile);\n    }\n  }\n  /* Pad colormap with zeros to ensure specified number of colormap entries */ \n  if (i > map_colors)\n    ERREXIT1(cinfo, JERR_TOO_MANY_COLORS, i);\n  for (; i < map_colors; i++) {\n    putc(0, outfile);\n    putc(0, outfile);\n    putc(0, outfile);\n    if (map_entry_size == 4)\n      putc(0, outfile);\n  }\n}\n\n\nMETHODDEF(void)\nfinish_output_bmp (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  bmp_dest_ptr dest = (bmp_dest_ptr) dinfo;\n  register FILE * outfile = dest->pub.output_file;\n  JSAMPARRAY image_ptr;\n  register JSAMPROW data_ptr;\n  JDIMENSION row;\n  register JDIMENSION col;\n  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n\n  /* Write the header and colormap */\n  if (dest->is_os2)\n    write_os2_header(cinfo, dest);\n  else\n    write_bmp_header(cinfo, dest);\n\n  /* Write the file body from our virtual array */\n  for (row = cinfo->output_height; row > 0; row--) {\n    if (progress != NULL) {\n      progress->pub.pass_counter = (long) (cinfo->output_height - row);\n      progress->pub.pass_limit = (long) cinfo->output_height;\n      (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n    }\n    image_ptr = (*cinfo->mem->access_virt_sarray)\n      ((j_common_ptr) cinfo, dest->whole_image, row-1, (JDIMENSION) 1, FALSE);\n    data_ptr = image_ptr[0];\n    for (col = dest->row_width; col > 0; col--) {\n      putc(GETJSAMPLE(*data_ptr), outfile);\n      data_ptr++;\n    }\n  }\n  if (progress != NULL)\n    progress->completed_extra_passes++;\n\n  /* Make sure we wrote the output file OK */\n  fflush(outfile);\n  if (ferror(outfile))\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n}\n\n\n/*\n * The module selection routine for BMP format output.\n */\n\nGLOBAL(djpeg_dest_ptr)\njinit_write_bmp (j_decompress_ptr cinfo, boolean is_os2)\n{\n  bmp_dest_ptr dest;\n  JDIMENSION row_width;\n\n  /* Create module interface object, fill in method pointers */\n  dest = (bmp_dest_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(bmp_dest_struct));\n  dest->pub.start_output = start_output_bmp;\n  dest->pub.finish_output = finish_output_bmp;\n  dest->is_os2 = is_os2;\n\n  if (cinfo->out_color_space == JCS_GRAYSCALE) {\n    dest->pub.put_pixel_rows = put_gray_rows;\n  } else if (cinfo->out_color_space == JCS_RGB) {\n    if (cinfo->quantize_colors)\n      dest->pub.put_pixel_rows = put_gray_rows;\n    else\n      dest->pub.put_pixel_rows = put_pixel_rows;\n  } else {\n    ERREXIT(cinfo, JERR_BMP_COLORSPACE);\n  }\n\n  /* Calculate output image dimensions so we can allocate space */\n  jpeg_calc_output_dimensions(cinfo);\n\n  /* Determine width of rows in the BMP file (padded to 4-byte boundary). */\n  row_width = cinfo->output_width * cinfo->output_components;\n  dest->data_width = row_width;\n  while ((row_width & 3) != 0) row_width++;\n  dest->row_width = row_width;\n  dest->pad_bytes = (int) (row_width - dest->data_width);\n\n  /* Allocate space for inversion array, prepare for write pass */\n  dest->whole_image = (*cinfo->mem->request_virt_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n     row_width, cinfo->output_height, (JDIMENSION) 1);\n  dest->cur_output_row = 0;\n  if (cinfo->progress != NULL) {\n    cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n    progress->total_extra_passes++; /* count file input as separate pass */\n  }\n\n  /* Create decompressor output buffer. */\n  dest->pub.buffer = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, row_width, (JDIMENSION) 1);\n  dest->pub.buffer_height = 1;\n\n  return (djpeg_dest_ptr) dest;\n}\n\n#endif /* BMP_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/wrgif.c",
    "content": "/*\n * wrgif.c\n *\n * Copyright (C) 1991-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to write output images in GIF format.\n *\n **************************************************************************\n * NOTE: to avoid entanglements with Unisys' patent on LZW compression,   *\n * this code has been modified to output \"uncompressed GIF\" files.        *\n * There is no trace of the LZW algorithm in this file.                   *\n **************************************************************************\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume output to\n * an ordinary stdio stream.\n */\n\n/*\n * This code is loosely based on ppmtogif from the PBMPLUS distribution\n * of Feb. 1991.  That file contains the following copyright notice:\n *    Based on GIFENCODE by David Rowley <mgardi@watdscu.waterloo.edu>.\n *    Lempel-Ziv compression based on \"compress\" by Spencer W. Thomas et al.\n *    Copyright (C) 1989 by Jef Poskanzer.\n *    Permission to use, copy, modify, and distribute this software and its\n *    documentation for any purpose and without fee is hereby granted, provided\n *    that the above copyright notice appear in all copies and that both that\n *    copyright notice and this permission notice appear in supporting\n *    documentation.  This software is provided \"as is\" without express or\n *    implied warranty.\n *\n * We are also required to state that\n *    \"The Graphics Interchange Format(c) is the Copyright property of\n *    CompuServe Incorporated. GIF(sm) is a Service Mark property of\n *    CompuServe Incorporated.\"\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n\n#ifdef GIF_SUPPORTED\n\n\n/* Private version of data destination object */\n\ntypedef struct {\n  struct djpeg_dest_struct pub;\t/* public fields */\n\n  j_decompress_ptr cinfo;\t/* back link saves passing separate parm */\n\n  /* State for packing variable-width codes into a bitstream */\n  int n_bits;\t\t\t/* current number of bits/code */\n  int maxcode;\t\t\t/* maximum code, given n_bits */\n  INT32 cur_accum;\t\t/* holds bits not yet output */\n  int cur_bits;\t\t\t/* # of bits in cur_accum */\n\n  /* State for GIF code assignment */\n  int ClearCode;\t\t/* clear code (doesn't change) */\n  int EOFCode;\t\t\t/* EOF code (ditto) */\n  int code_counter;\t\t/* counts output symbols */\n\n  /* GIF data packet construction buffer */\n  int bytesinpkt;\t\t/* # of bytes in current packet */\n  char packetbuf[256];\t\t/* workspace for accumulating packet */\n\n} gif_dest_struct;\n\ntypedef gif_dest_struct * gif_dest_ptr;\n\n/* Largest value that will fit in N bits */\n#define MAXCODE(n_bits)\t((1 << (n_bits)) - 1)\n\n\n/*\n * Routines to package finished data bytes into GIF data blocks.\n * A data block consists of a count byte (1..255) and that many data bytes.\n */\n\nLOCAL(void)\nflush_packet (gif_dest_ptr dinfo)\n/* flush any accumulated data */\n{\n  if (dinfo->bytesinpkt > 0) {\t/* never write zero-length packet */\n    dinfo->packetbuf[0] = (char) dinfo->bytesinpkt++;\n    if (JFWRITE(dinfo->pub.output_file, dinfo->packetbuf, dinfo->bytesinpkt)\n\t!= (size_t) dinfo->bytesinpkt)\n      ERREXIT(dinfo->cinfo, JERR_FILE_WRITE);\n    dinfo->bytesinpkt = 0;\n  }\n}\n\n\n/* Add a character to current packet; flush to disk if necessary */\n#define CHAR_OUT(dinfo,c)  \\\n\t{ (dinfo)->packetbuf[++(dinfo)->bytesinpkt] = (char) (c);  \\\n\t    if ((dinfo)->bytesinpkt >= 255)  \\\n\t      flush_packet(dinfo);  \\\n\t}\n\n\n/* Routine to convert variable-width codes into a byte stream */\n\nLOCAL(void)\noutput (gif_dest_ptr dinfo, int code)\n/* Emit a code of n_bits bits */\n/* Uses cur_accum and cur_bits to reblock into 8-bit bytes */\n{\n  dinfo->cur_accum |= ((INT32) code) << dinfo->cur_bits;\n  dinfo->cur_bits += dinfo->n_bits;\n\n  while (dinfo->cur_bits >= 8) {\n    CHAR_OUT(dinfo, dinfo->cur_accum & 0xFF);\n    dinfo->cur_accum >>= 8;\n    dinfo->cur_bits -= 8;\n  }\n}\n\n\n/* The pseudo-compression algorithm.\n *\n * In this module we simply output each pixel value as a separate symbol;\n * thus, no compression occurs.  In fact, there is expansion of one bit per\n * pixel, because we use a symbol width one bit wider than the pixel width.\n *\n * GIF ordinarily uses variable-width symbols, and the decoder will expect\n * to ratchet up the symbol width after a fixed number of symbols.\n * To simplify the logic and keep the expansion penalty down, we emit a\n * GIF Clear code to reset the decoder just before the width would ratchet up.\n * Thus, all the symbols in the output file will have the same bit width.\n * Note that emitting the Clear codes at the right times is a mere matter of\n * counting output symbols and is in no way dependent on the LZW patent.\n *\n * With a small basic pixel width (low color count), Clear codes will be\n * needed very frequently, causing the file to expand even more.  So this\n * simplistic approach wouldn't work too well on bilevel images, for example.\n * But for output of JPEG conversions the pixel width will usually be 8 bits\n * (129 to 256 colors), so the overhead added by Clear symbols is only about\n * one symbol in every 256.\n */\n\nLOCAL(void)\ncompress_init (gif_dest_ptr dinfo, int i_bits)\n/* Initialize pseudo-compressor */\n{\n  /* init all the state variables */\n  dinfo->n_bits = i_bits;\n  dinfo->maxcode = MAXCODE(dinfo->n_bits);\n  dinfo->ClearCode = (1 << (i_bits - 1));\n  dinfo->EOFCode = dinfo->ClearCode + 1;\n  dinfo->code_counter = dinfo->ClearCode + 2;\n  /* init output buffering vars */\n  dinfo->bytesinpkt = 0;\n  dinfo->cur_accum = 0;\n  dinfo->cur_bits = 0;\n  /* GIF specifies an initial Clear code */\n  output(dinfo, dinfo->ClearCode);\n}\n\n\nLOCAL(void)\ncompress_pixel (gif_dest_ptr dinfo, int c)\n/* Accept and \"compress\" one pixel value.\n * The given value must be less than n_bits wide.\n */\n{\n  /* Output the given pixel value as a symbol. */\n  output(dinfo, c);\n  /* Issue Clear codes often enough to keep the reader from ratcheting up\n   * its symbol size.\n   */\n  if (dinfo->code_counter < dinfo->maxcode) {\n    dinfo->code_counter++;\n  } else {\n    output(dinfo, dinfo->ClearCode);\n    dinfo->code_counter = dinfo->ClearCode + 2;\t/* reset the counter */\n  }\n}\n\n\nLOCAL(void)\ncompress_term (gif_dest_ptr dinfo)\n/* Clean up at end */\n{\n  /* Send an EOF code */\n  output(dinfo, dinfo->EOFCode);\n  /* Flush the bit-packing buffer */\n  if (dinfo->cur_bits > 0) {\n    CHAR_OUT(dinfo, dinfo->cur_accum & 0xFF);\n  }\n  /* Flush the packet buffer */\n  flush_packet(dinfo);\n}\n\n\n/* GIF header construction */\n\n\nLOCAL(void)\nput_word (gif_dest_ptr dinfo, unsigned int w)\n/* Emit a 16-bit word, LSB first */\n{\n  putc(w & 0xFF, dinfo->pub.output_file);\n  putc((w >> 8) & 0xFF, dinfo->pub.output_file);\n}\n\n\nLOCAL(void)\nput_3bytes (gif_dest_ptr dinfo, int val)\n/* Emit 3 copies of same byte value --- handy subr for colormap construction */\n{\n  putc(val, dinfo->pub.output_file);\n  putc(val, dinfo->pub.output_file);\n  putc(val, dinfo->pub.output_file);\n}\n\n\nLOCAL(void)\nemit_header (gif_dest_ptr dinfo, int num_colors, JSAMPARRAY colormap)\n/* Output the GIF file header, including color map */\n/* If colormap==NULL, synthesize a gray-scale colormap */\n{\n  int BitsPerPixel, ColorMapSize, InitCodeSize, FlagByte;\n  int cshift = dinfo->cinfo->data_precision - 8;\n  int i;\n\n  if (num_colors > 256)\n    ERREXIT1(dinfo->cinfo, JERR_TOO_MANY_COLORS, num_colors);\n  /* Compute bits/pixel and related values */\n  BitsPerPixel = 1;\n  while (num_colors > (1 << BitsPerPixel))\n    BitsPerPixel++;\n  ColorMapSize = 1 << BitsPerPixel;\n  if (BitsPerPixel <= 1)\n    InitCodeSize = 2;\n  else\n    InitCodeSize = BitsPerPixel;\n  /*\n   * Write the GIF header.\n   * Note that we generate a plain GIF87 header for maximum compatibility.\n   */\n  putc('G', dinfo->pub.output_file);\n  putc('I', dinfo->pub.output_file);\n  putc('F', dinfo->pub.output_file);\n  putc('8', dinfo->pub.output_file);\n  putc('7', dinfo->pub.output_file);\n  putc('a', dinfo->pub.output_file);\n  /* Write the Logical Screen Descriptor */\n  put_word(dinfo, (unsigned int) dinfo->cinfo->output_width);\n  put_word(dinfo, (unsigned int) dinfo->cinfo->output_height);\n  FlagByte = 0x80;\t\t/* Yes, there is a global color table */\n  FlagByte |= (BitsPerPixel-1) << 4; /* color resolution */\n  FlagByte |= (BitsPerPixel-1);\t/* size of global color table */\n  putc(FlagByte, dinfo->pub.output_file);\n  putc(0, dinfo->pub.output_file); /* Background color index */\n  putc(0, dinfo->pub.output_file); /* Reserved (aspect ratio in GIF89) */\n  /* Write the Global Color Map */\n  /* If the color map is more than 8 bits precision, */\n  /* we reduce it to 8 bits by shifting */\n  for (i=0; i < ColorMapSize; i++) {\n    if (i < num_colors) {\n      if (colormap != NULL) {\n\tif (dinfo->cinfo->out_color_space == JCS_RGB) {\n\t  /* Normal case: RGB color map */\n\t  putc(GETJSAMPLE(colormap[0][i]) >> cshift, dinfo->pub.output_file);\n\t  putc(GETJSAMPLE(colormap[1][i]) >> cshift, dinfo->pub.output_file);\n\t  putc(GETJSAMPLE(colormap[2][i]) >> cshift, dinfo->pub.output_file);\n\t} else {\n\t  /* Grayscale \"color map\": possible if quantizing grayscale image */\n\t  put_3bytes(dinfo, GETJSAMPLE(colormap[0][i]) >> cshift);\n\t}\n      } else {\n\t/* Create a gray-scale map of num_colors values, range 0..255 */\n\tput_3bytes(dinfo, (i * 255 + (num_colors-1)/2) / (num_colors-1));\n      }\n    } else {\n      /* fill out the map to a power of 2 */\n      put_3bytes(dinfo, 0);\n    }\n  }\n  /* Write image separator and Image Descriptor */\n  putc(',', dinfo->pub.output_file); /* separator */\n  put_word(dinfo, 0);\t\t/* left/top offset */\n  put_word(dinfo, 0);\n  put_word(dinfo, (unsigned int) dinfo->cinfo->output_width); /* image size */\n  put_word(dinfo, (unsigned int) dinfo->cinfo->output_height);\n  /* flag byte: not interlaced, no local color map */\n  putc(0x00, dinfo->pub.output_file);\n  /* Write Initial Code Size byte */\n  putc(InitCodeSize, dinfo->pub.output_file);\n\n  /* Initialize for \"compression\" of image data */\n  compress_init(dinfo, InitCodeSize+1);\n}\n\n\n/*\n * Startup: write the file header.\n */\n\nMETHODDEF(void)\nstart_output_gif (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  gif_dest_ptr dest = (gif_dest_ptr) dinfo;\n\n  if (cinfo->quantize_colors)\n    emit_header(dest, cinfo->actual_number_of_colors, cinfo->colormap);\n  else\n    emit_header(dest, 256, (JSAMPARRAY) NULL);\n}\n\n\n/*\n * Write some pixel data.\n * In this module rows_supplied will always be 1.\n */\n\nMETHODDEF(void)\nput_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t\tJDIMENSION rows_supplied)\n{\n  gif_dest_ptr dest = (gif_dest_ptr) dinfo;\n  register JSAMPROW ptr;\n  register JDIMENSION col;\n\n  ptr = dest->pub.buffer[0];\n  for (col = cinfo->output_width; col > 0; col--) {\n    compress_pixel(dest, GETJSAMPLE(*ptr++));\n  }\n}\n\n\n/*\n * Finish up at the end of the file.\n */\n\nMETHODDEF(void)\nfinish_output_gif (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  gif_dest_ptr dest = (gif_dest_ptr) dinfo;\n\n  /* Flush \"compression\" mechanism */\n  compress_term(dest);\n  /* Write a zero-length data block to end the series */\n  putc(0, dest->pub.output_file);\n  /* Write the GIF terminator mark */\n  putc(';', dest->pub.output_file);\n  /* Make sure we wrote the output file OK */\n  fflush(dest->pub.output_file);\n  if (ferror(dest->pub.output_file))\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n}\n\n\n/*\n * The module selection routine for GIF format output.\n */\n\nGLOBAL(djpeg_dest_ptr)\njinit_write_gif (j_decompress_ptr cinfo)\n{\n  gif_dest_ptr dest;\n\n  /* Create module interface object, fill in method pointers */\n  dest = (gif_dest_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(gif_dest_struct));\n  dest->cinfo = cinfo;\t\t/* make back link for subroutines */\n  dest->pub.start_output = start_output_gif;\n  dest->pub.put_pixel_rows = put_pixel_rows;\n  dest->pub.finish_output = finish_output_gif;\n\n  if (cinfo->out_color_space != JCS_GRAYSCALE &&\n      cinfo->out_color_space != JCS_RGB)\n    ERREXIT(cinfo, JERR_GIF_COLORSPACE);\n\n  /* Force quantization if color or if > 8 bits input */\n  if (cinfo->out_color_space != JCS_GRAYSCALE || cinfo->data_precision > 8) {\n    /* Force quantization to at most 256 colors */\n    cinfo->quantize_colors = TRUE;\n    if (cinfo->desired_number_of_colors > 256)\n      cinfo->desired_number_of_colors = 256;\n  }\n\n  /* Calculate output image dimensions so we can allocate space */\n  jpeg_calc_output_dimensions(cinfo);\n\n  if (cinfo->output_components != 1) /* safety check: just one component? */\n    ERREXIT(cinfo, JERR_GIF_BUG);\n\n  /* Create decompressor output buffer. */\n  dest->pub.buffer = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, cinfo->output_width, (JDIMENSION) 1);\n  dest->pub.buffer_height = 1;\n\n  return (djpeg_dest_ptr) dest;\n}\n\n#endif /* GIF_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/wrjpgcom.1",
    "content": ".TH WRJPGCOM 1 \"15 June 1995\"\n.SH NAME\nwrjpgcom \\- insert text comments into a JPEG file\n.SH SYNOPSIS\n.B wrjpgcom\n[\n.B \\-replace\n]\n[\n.BI \\-comment \" text\"\n]\n[\n.BI \\-cfile \" name\"\n]\n[\n.I filename\n]\n.LP\n.SH DESCRIPTION\n.LP\n.B wrjpgcom\nreads the named JPEG/JFIF file, or the standard input if no file is named,\nand generates a new JPEG/JFIF file on standard output.  A comment block is\nadded to the file.\n.PP\nThe JPEG standard allows \"comment\" (COM) blocks to occur within a JPEG file.\nAlthough the standard doesn't actually define what COM blocks are for, they\nare widely used to hold user-supplied text strings.  This lets you add\nannotations, titles, index terms, etc to your JPEG files, and later retrieve\nthem as text.  COM blocks do not interfere with the image stored in the JPEG\nfile.  The maximum size of a COM block is 64K, but you can have as many of\nthem as you like in one JPEG file.\n.PP\n.B wrjpgcom\nadds a COM block, containing text you provide, to a JPEG file.\nOrdinarily, the COM block is added after any existing COM blocks; but you\ncan delete the old COM blocks if you wish.\n.SH OPTIONS\nSwitch names may be abbreviated, and are not case sensitive.\n.TP\n.B \\-replace\nDelete any existing COM blocks from the file.\n.TP\n.BI \\-comment \" text\"\nSupply text for new COM block on command line.\n.TP\n.BI \\-cfile \" name\"\nRead text for new COM block from named file.\n.PP\nIf you have only one line of comment text to add, you can provide it on the\ncommand line with\n.BR \\-comment .\nThe comment text must be surrounded with quotes so that it is treated as a\nsingle argument.  Longer comments can be read from a text file.\n.PP\nIf you give neither\n.B \\-comment\nnor\n.BR \\-cfile ,\nthen\n.B wrjpgcom\nwill read the comment text from standard input.  (In this case an input image\nfile name MUST be supplied, so that the source JPEG file comes from somewhere\nelse.)  You can enter multiple lines, up to 64KB worth.  Type an end-of-file\nindicator (usually control-D) to terminate the comment text entry.\n.PP\n.B wrjpgcom\nwill not add a COM block if the provided comment string is empty.  Therefore\n\\fB\\-replace \\-comment \"\"\\fR can be used to delete all COM blocks from a file.\n.SH EXAMPLES\n.LP\nAdd a short comment to in.jpg, producing out.jpg:\n.IP\n.B wrjpgcom \\-c\n\\fI\"View of my back yard\" in.jpg\n.B >\n.I out.jpg\n.PP\nAttach a long comment previously stored in comment.txt:\n.IP\n.B wrjpgcom\n.I in.jpg\n.B <\n.I comment.txt\n.B >\n.I out.jpg\n.PP\nor equivalently\n.IP\n.B wrjpgcom\n.B -cfile\n.I comment.txt\n.B <\n.I in.jpg\n.B >\n.I out.jpg\n.SH SEE ALSO\n.BR cjpeg (1),\n.BR djpeg (1),\n.BR jpegtran (1),\n.BR rdjpgcom (1)\n.SH AUTHOR\nIndependent JPEG Group\n"
  },
  {
    "path": "ext/libjpeg-turbo/wrjpgcom.c",
    "content": "/*\n * wrjpgcom.c\n *\n * Copyright (C) 1994-1997, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains a very simple stand-alone application that inserts\n * user-supplied text as a COM (comment) marker in a JFIF file.\n * This may be useful as an example of the minimum logic needed to parse\n * JPEG markers.\n */\n\n#define JPEG_CJPEG_DJPEG\t/* to get the command-line config symbols */\n#include \"jinclude.h\"\t\t/* get auto-config symbols, <stdio.h> */\n\n#ifndef HAVE_STDLIB_H\t\t/* <stdlib.h> should declare malloc() */\nextern void * malloc ();\n#endif\n#include <ctype.h>\t\t/* to declare isupper(), tolower() */\n#ifdef USE_SETMODE\n#include <fcntl.h>\t\t/* to declare setmode()'s parameter macros */\n/* If you have setmode() but not <io.h>, just delete this line: */\n#include <io.h>\t\t\t/* to declare setmode() */\n#endif\n\n#ifdef USE_CCOMMAND\t\t/* command-line reader for Macintosh */\n#ifdef __MWERKS__\n#include <SIOUX.h>              /* Metrowerks needs this */\n#include <console.h>\t\t/* ... and this */\n#endif\n#ifdef THINK_C\n#include <console.h>\t\t/* Think declares it here */\n#endif\n#endif\n\n#ifdef DONT_USE_B_MODE\t\t/* define mode parameters for fopen() */\n#define READ_BINARY\t\"r\"\n#define WRITE_BINARY\t\"w\"\n#else\n#ifdef VMS\t\t\t/* VMS is very nonstandard */\n#define READ_BINARY\t\"rb\", \"ctx=stm\"\n#define WRITE_BINARY\t\"wb\", \"ctx=stm\"\n#else\t\t\t\t/* standard ANSI-compliant case */\n#define READ_BINARY\t\"rb\"\n#define WRITE_BINARY\t\"wb\"\n#endif\n#endif\n\n#ifndef EXIT_FAILURE\t\t/* define exit() codes if not provided */\n#define EXIT_FAILURE  1\n#endif\n#ifndef EXIT_SUCCESS\n#ifdef VMS\n#define EXIT_SUCCESS  1\t\t/* VMS is very nonstandard */\n#else\n#define EXIT_SUCCESS  0\n#endif\n#endif\n\n/* Reduce this value if your malloc() can't allocate blocks up to 64K.\n * On DOS, compiling in large model is usually a better solution.\n */\n\n#ifndef MAX_COM_LENGTH\n#define MAX_COM_LENGTH 65000L\t/* must be <= 65533 in any case */\n#endif\n\n\n/*\n * These macros are used to read the input file and write the output file.\n * To reuse this code in another application, you might need to change these.\n */\n\nstatic FILE * infile;\t\t/* input JPEG file */\n\n/* Return next input byte, or EOF if no more */\n#define NEXTBYTE()  getc(infile)\n\nstatic FILE * outfile;\t\t/* output JPEG file */\n\n/* Emit an output byte */\n#define PUTBYTE(x)  putc((x), outfile)\n\n\n/* Error exit handler */\n#define ERREXIT(msg)  (fprintf(stderr, \"%s\\n\", msg), exit(EXIT_FAILURE))\n\n\n/* Read one byte, testing for EOF */\nstatic int\nread_1_byte (void)\n{\n  int c;\n\n  c = NEXTBYTE();\n  if (c == EOF)\n    ERREXIT(\"Premature EOF in JPEG file\");\n  return c;\n}\n\n/* Read 2 bytes, convert to unsigned int */\n/* All 2-byte quantities in JPEG markers are MSB first */\nstatic unsigned int\nread_2_bytes (void)\n{\n  int c1, c2;\n\n  c1 = NEXTBYTE();\n  if (c1 == EOF)\n    ERREXIT(\"Premature EOF in JPEG file\");\n  c2 = NEXTBYTE();\n  if (c2 == EOF)\n    ERREXIT(\"Premature EOF in JPEG file\");\n  return (((unsigned int) c1) << 8) + ((unsigned int) c2);\n}\n\n\n/* Routines to write data to output file */\n\nstatic void\nwrite_1_byte (int c)\n{\n  PUTBYTE(c);\n}\n\nstatic void\nwrite_2_bytes (unsigned int val)\n{\n  PUTBYTE((val >> 8) & 0xFF);\n  PUTBYTE(val & 0xFF);\n}\n\nstatic void\nwrite_marker (int marker)\n{\n  PUTBYTE(0xFF);\n  PUTBYTE(marker);\n}\n\nstatic void\ncopy_rest_of_file (void)\n{\n  int c;\n\n  while ((c = NEXTBYTE()) != EOF)\n    PUTBYTE(c);\n}\n\n\n/*\n * JPEG markers consist of one or more 0xFF bytes, followed by a marker\n * code byte (which is not an FF).  Here are the marker codes of interest\n * in this program.  (See jdmarker.c for a more complete list.)\n */\n\n#define M_SOF0  0xC0\t\t/* Start Of Frame N */\n#define M_SOF1  0xC1\t\t/* N indicates which compression process */\n#define M_SOF2  0xC2\t\t/* Only SOF0-SOF2 are now in common use */\n#define M_SOF3  0xC3\n#define M_SOF5  0xC5\t\t/* NB: codes C4 and CC are NOT SOF markers */\n#define M_SOF6  0xC6\n#define M_SOF7  0xC7\n#define M_SOF9  0xC9\n#define M_SOF10 0xCA\n#define M_SOF11 0xCB\n#define M_SOF13 0xCD\n#define M_SOF14 0xCE\n#define M_SOF15 0xCF\n#define M_SOI   0xD8\t\t/* Start Of Image (beginning of datastream) */\n#define M_EOI   0xD9\t\t/* End Of Image (end of datastream) */\n#define M_SOS   0xDA\t\t/* Start Of Scan (begins compressed data) */\n#define M_COM   0xFE\t\t/* COMment */\n\n\n/*\n * Find the next JPEG marker and return its marker code.\n * We expect at least one FF byte, possibly more if the compressor used FFs\n * to pad the file.  (Padding FFs will NOT be replicated in the output file.)\n * There could also be non-FF garbage between markers.  The treatment of such\n * garbage is unspecified; we choose to skip over it but emit a warning msg.\n * NB: this routine must not be used after seeing SOS marker, since it will\n * not deal correctly with FF/00 sequences in the compressed image data...\n */\n\nstatic int\nnext_marker (void)\n{\n  int c;\n  int discarded_bytes = 0;\n\n  /* Find 0xFF byte; count and skip any non-FFs. */\n  c = read_1_byte();\n  while (c != 0xFF) {\n    discarded_bytes++;\n    c = read_1_byte();\n  }\n  /* Get marker code byte, swallowing any duplicate FF bytes.  Extra FFs\n   * are legal as pad bytes, so don't count them in discarded_bytes.\n   */\n  do {\n    c = read_1_byte();\n  } while (c == 0xFF);\n\n  if (discarded_bytes != 0) {\n    fprintf(stderr, \"Warning: garbage data found in JPEG file\\n\");\n  }\n\n  return c;\n}\n\n\n/*\n * Read the initial marker, which should be SOI.\n * For a JFIF file, the first two bytes of the file should be literally\n * 0xFF M_SOI.  To be more general, we could use next_marker, but if the\n * input file weren't actually JPEG at all, next_marker might read the whole\n * file and then return a misleading error message...\n */\n\nstatic int\nfirst_marker (void)\n{\n  int c1, c2;\n\n  c1 = NEXTBYTE();\n  c2 = NEXTBYTE();\n  if (c1 != 0xFF || c2 != M_SOI)\n    ERREXIT(\"Not a JPEG file\");\n  return c2;\n}\n\n\n/*\n * Most types of marker are followed by a variable-length parameter segment.\n * This routine skips over the parameters for any marker we don't otherwise\n * want to process.\n * Note that we MUST skip the parameter segment explicitly in order not to\n * be fooled by 0xFF bytes that might appear within the parameter segment;\n * such bytes do NOT introduce new markers.\n */\n\nstatic void\ncopy_variable (void)\n/* Copy an unknown or uninteresting variable-length marker */\n{\n  unsigned int length;\n\n  /* Get the marker parameter length count */\n  length = read_2_bytes();\n  write_2_bytes(length);\n  /* Length includes itself, so must be at least 2 */\n  if (length < 2)\n    ERREXIT(\"Erroneous JPEG marker length\");\n  length -= 2;\n  /* Skip over the remaining bytes */\n  while (length > 0) {\n    write_1_byte(read_1_byte());\n    length--;\n  }\n}\n\nstatic void\nskip_variable (void)\n/* Skip over an unknown or uninteresting variable-length marker */\n{\n  unsigned int length;\n\n  /* Get the marker parameter length count */\n  length = read_2_bytes();\n  /* Length includes itself, so must be at least 2 */\n  if (length < 2)\n    ERREXIT(\"Erroneous JPEG marker length\");\n  length -= 2;\n  /* Skip over the remaining bytes */\n  while (length > 0) {\n    (void) read_1_byte();\n    length--;\n  }\n}\n\n\n/*\n * Parse the marker stream until SOFn or EOI is seen;\n * copy data to output, but discard COM markers unless keep_COM is true.\n */\n\nstatic int\nscan_JPEG_header (int keep_COM)\n{\n  int marker;\n\n  /* Expect SOI at start of file */\n  if (first_marker() != M_SOI)\n    ERREXIT(\"Expected SOI marker first\");\n  write_marker(M_SOI);\n\n  /* Scan miscellaneous markers until we reach SOFn. */\n  for (;;) {\n    marker = next_marker();\n    switch (marker) {\n      /* Note that marker codes 0xC4, 0xC8, 0xCC are not, and must not be,\n       * treated as SOFn.  C4 in particular is actually DHT.\n       */\n    case M_SOF0:\t\t/* Baseline */\n    case M_SOF1:\t\t/* Extended sequential, Huffman */\n    case M_SOF2:\t\t/* Progressive, Huffman */\n    case M_SOF3:\t\t/* Lossless, Huffman */\n    case M_SOF5:\t\t/* Differential sequential, Huffman */\n    case M_SOF6:\t\t/* Differential progressive, Huffman */\n    case M_SOF7:\t\t/* Differential lossless, Huffman */\n    case M_SOF9:\t\t/* Extended sequential, arithmetic */\n    case M_SOF10:\t\t/* Progressive, arithmetic */\n    case M_SOF11:\t\t/* Lossless, arithmetic */\n    case M_SOF13:\t\t/* Differential sequential, arithmetic */\n    case M_SOF14:\t\t/* Differential progressive, arithmetic */\n    case M_SOF15:\t\t/* Differential lossless, arithmetic */\n      return marker;\n\n    case M_SOS:\t\t\t/* should not see compressed data before SOF */\n      ERREXIT(\"SOS without prior SOFn\");\n      break;\n\n    case M_EOI:\t\t\t/* in case it's a tables-only JPEG stream */\n      return marker;\n\n    case M_COM:\t\t\t/* Existing COM: conditionally discard */\n      if (keep_COM) {\n\twrite_marker(marker);\n\tcopy_variable();\n      } else {\n\tskip_variable();\n      }\n      break;\n\n    default:\t\t\t/* Anything else just gets copied */\n      write_marker(marker);\n      copy_variable();\t\t/* we assume it has a parameter count... */\n      break;\n    }\n  } /* end loop */\n}\n\n\n/* Command line parsing code */\n\nstatic const char * progname;\t/* program name for error messages */\n\n\nstatic void\nusage (void)\n/* complain about bad command line */\n{\n  fprintf(stderr, \"wrjpgcom inserts a textual comment in a JPEG file.\\n\");\n  fprintf(stderr, \"You can add to or replace any existing comment(s).\\n\");\n\n  fprintf(stderr, \"Usage: %s [switches] \", progname);\n#ifdef TWO_FILE_COMMANDLINE\n  fprintf(stderr, \"inputfile outputfile\\n\");\n#else\n  fprintf(stderr, \"[inputfile]\\n\");\n#endif\n\n  fprintf(stderr, \"Switches (names may be abbreviated):\\n\");\n  fprintf(stderr, \"  -replace         Delete any existing comments\\n\");\n  fprintf(stderr, \"  -comment \\\"text\\\"  Insert comment with given text\\n\");\n  fprintf(stderr, \"  -cfile name      Read comment from named file\\n\");\n  fprintf(stderr, \"Notice that you must put quotes around the comment text\\n\");\n  fprintf(stderr, \"when you use -comment.\\n\");\n  fprintf(stderr, \"If you do not give either -comment or -cfile on the command line,\\n\");\n  fprintf(stderr, \"then the comment text is read from standard input.\\n\");\n  fprintf(stderr, \"It can be multiple lines, up to %u characters total.\\n\",\n\t  (unsigned int) MAX_COM_LENGTH);\n#ifndef TWO_FILE_COMMANDLINE\n  fprintf(stderr, \"You must specify an input JPEG file name when supplying\\n\");\n  fprintf(stderr, \"comment text from standard input.\\n\");\n#endif\n\n  exit(EXIT_FAILURE);\n}\n\n\nstatic int\nkeymatch (char * arg, const char * keyword, int minchars)\n/* Case-insensitive matching of (possibly abbreviated) keyword switches. */\n/* keyword is the constant keyword (must be lower case already), */\n/* minchars is length of minimum legal abbreviation. */\n{\n  register int ca, ck;\n  register int nmatched = 0;\n\n  while ((ca = *arg++) != '\\0') {\n    if ((ck = *keyword++) == '\\0')\n      return 0;\t\t\t/* arg longer than keyword, no good */\n    if (isupper(ca))\t\t/* force arg to lcase (assume ck is already) */\n      ca = tolower(ca);\n    if (ca != ck)\n      return 0;\t\t\t/* no good */\n    nmatched++;\t\t\t/* count matched characters */\n  }\n  /* reached end of argument; fail if it's too short for unique abbrev */\n  if (nmatched < minchars)\n    return 0;\n  return 1;\t\t\t/* A-OK */\n}\n\n\n/*\n * The main program.\n */\n\nint\nmain (int argc, char **argv)\n{\n  int argn;\n  char * arg;\n  int keep_COM = 1;\n  char * comment_arg = NULL;\n  FILE * comment_file = NULL;\n  unsigned int comment_length = 0;\n  int marker;\n\n  /* On Mac, fetch a command line. */\n#ifdef USE_CCOMMAND\n  argc = ccommand(&argv);\n#endif\n\n  progname = argv[0];\n  if (progname == NULL || progname[0] == 0)\n    progname = \"wrjpgcom\";\t/* in case C library doesn't provide it */\n\n  /* Parse switches, if any */\n  for (argn = 1; argn < argc; argn++) {\n    arg = argv[argn];\n    if (arg[0] != '-')\n      break;\t\t\t/* not switch, must be file name */\n    arg++;\t\t\t/* advance over '-' */\n    if (keymatch(arg, \"replace\", 1)) {\n      keep_COM = 0;\n    } else if (keymatch(arg, \"cfile\", 2)) {\n      if (++argn >= argc) usage();\n      if ((comment_file = fopen(argv[argn], \"r\")) == NULL) {\n\tfprintf(stderr, \"%s: can't open %s\\n\", progname, argv[argn]);\n\texit(EXIT_FAILURE);\n      }\n    } else if (keymatch(arg, \"comment\", 1)) {\n      if (++argn >= argc) usage();\n      comment_arg = argv[argn];\n      /* If the comment text starts with '\"', then we are probably running\n       * under MS-DOG and must parse out the quoted string ourselves.  Sigh.\n       */\n      if (comment_arg[0] == '\"') {\n\tcomment_arg = (char *) malloc((size_t) MAX_COM_LENGTH);\n\tif (comment_arg == NULL)\n\t  ERREXIT(\"Insufficient memory\");\n\tstrcpy(comment_arg, argv[argn]+1);\n\tfor (;;) {\n\t  comment_length = (unsigned int) strlen(comment_arg);\n\t  if (comment_length > 0 && comment_arg[comment_length-1] == '\"') {\n\t    comment_arg[comment_length-1] = '\\0'; /* zap terminating quote */\n\t    break;\n\t  }\n\t  if (++argn >= argc)\n\t    ERREXIT(\"Missing ending quote mark\");\n\t  strcat(comment_arg, \" \");\n\t  strcat(comment_arg, argv[argn]);\n\t}\n      }\n      comment_length = (unsigned int) strlen(comment_arg);\n    } else\n      usage();\n  }\n\n  /* Cannot use both -comment and -cfile. */\n  if (comment_arg != NULL && comment_file != NULL)\n    usage();\n  /* If there is neither -comment nor -cfile, we will read the comment text\n   * from stdin; in this case there MUST be an input JPEG file name.\n   */\n  if (comment_arg == NULL && comment_file == NULL && argn >= argc)\n    usage();\n\n  /* Open the input file. */\n  if (argn < argc) {\n    if ((infile = fopen(argv[argn], READ_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open %s\\n\", progname, argv[argn]);\n      exit(EXIT_FAILURE);\n    }\n  } else {\n    /* default input file is stdin */\n#ifdef USE_SETMODE\t\t/* need to hack file mode? */\n    setmode(fileno(stdin), O_BINARY);\n#endif\n#ifdef USE_FDOPEN\t\t/* need to re-open in binary mode? */\n    if ((infile = fdopen(fileno(stdin), READ_BINARY)) == NULL) {\n      fprintf(stderr, \"%s: can't open stdin\\n\", progname);\n      exit(EXIT_FAILURE);\n    }\n#else\n    infile = stdin;\n#endif\n  }\n\n  /* Open the output file. */\n#ifdef TWO_FILE_COMMANDLINE\n  /* Must have explicit output file name */\n  if (argn != argc-2) {\n    fprintf(stderr, \"%s: must name one input and one output file\\n\",\n\t    progname);\n    usage();\n  }\n  if ((outfile = fopen(argv[argn+1], WRITE_BINARY)) == NULL) {\n    fprintf(stderr, \"%s: can't open %s\\n\", progname, argv[argn+1]);\n    exit(EXIT_FAILURE);\n  }\n#else\n  /* Unix style: expect zero or one file name */\n  if (argn < argc-1) {\n    fprintf(stderr, \"%s: only one input file\\n\", progname);\n    usage();\n  }\n  /* default output file is stdout */\n#ifdef USE_SETMODE\t\t/* need to hack file mode? */\n  setmode(fileno(stdout), O_BINARY);\n#endif\n#ifdef USE_FDOPEN\t\t/* need to re-open in binary mode? */\n  if ((outfile = fdopen(fileno(stdout), WRITE_BINARY)) == NULL) {\n    fprintf(stderr, \"%s: can't open stdout\\n\", progname);\n    exit(EXIT_FAILURE);\n  }\n#else\n  outfile = stdout;\n#endif\n#endif /* TWO_FILE_COMMANDLINE */\n\n  /* Collect comment text from comment_file or stdin, if necessary */\n  if (comment_arg == NULL) {\n    FILE * src_file;\n    int c;\n\n    comment_arg = (char *) malloc((size_t) MAX_COM_LENGTH);\n    if (comment_arg == NULL)\n      ERREXIT(\"Insufficient memory\");\n    comment_length = 0;\n    src_file = (comment_file != NULL ? comment_file : stdin);\n    while ((c = getc(src_file)) != EOF) {\n      if (comment_length >= (unsigned int) MAX_COM_LENGTH) {\n\tfprintf(stderr, \"Comment text may not exceed %u bytes\\n\",\n\t\t(unsigned int) MAX_COM_LENGTH);\n\texit(EXIT_FAILURE);\n      }\n      comment_arg[comment_length++] = (char) c;\n    }\n    if (comment_file != NULL)\n      fclose(comment_file);\n  }\n\n  /* Copy JPEG headers until SOFn marker;\n   * we will insert the new comment marker just before SOFn.\n   * This (a) causes the new comment to appear after, rather than before,\n   * existing comments; and (b) ensures that comments come after any JFIF\n   * or JFXX markers, as required by the JFIF specification.\n   */\n  marker = scan_JPEG_header(keep_COM);\n  /* Insert the new COM marker, but only if nonempty text has been supplied */\n  if (comment_length > 0) {\n    write_marker(M_COM);\n    write_2_bytes(comment_length + 2);\n    while (comment_length > 0) {\n      write_1_byte(*comment_arg++);\n      comment_length--;\n    }\n  }\n  /* Duplicate the remainder of the source file.\n   * Note that any COM markers occuring after SOF will not be touched.\n   */\n  write_marker(marker);\n  copy_rest_of_file();\n\n  /* All done. */\n  exit(EXIT_SUCCESS);\n  return 0;\t\t\t/* suppress no-return-value warnings */\n}\n"
  },
  {
    "path": "ext/libjpeg-turbo/wrppm.c",
    "content": "/*\n * wrppm.c\n *\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * Modified 2009 by Guido Vollbeding.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to write output images in PPM/PGM format.\n * The extended 2-byte-per-sample raw PPM/PGM formats are supported.\n * The PBMPLUS library is NOT required to compile this software\n * (but it is highly useful as a set of PPM image manipulation programs).\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume output to\n * an ordinary stdio stream.\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n\n#ifdef PPM_SUPPORTED\n\n\n/*\n * For 12-bit JPEG data, we either downscale the values to 8 bits\n * (to write standard byte-per-sample PPM/PGM files), or output\n * nonstandard word-per-sample PPM/PGM files.  Downscaling is done\n * if PPM_NORAWWORD is defined (this can be done in the Makefile\n * or in jconfig.h).\n * (When the core library supports data precision reduction, a cleaner\n * implementation will be to ask for that instead.)\n */\n\n#if BITS_IN_JSAMPLE == 8\n#define PUTPPMSAMPLE(ptr,v)  *ptr++ = (char) (v)\n#define BYTESPERSAMPLE 1\n#define PPM_MAXVAL 255\n#else\n#ifdef PPM_NORAWWORD\n#define PUTPPMSAMPLE(ptr,v)  *ptr++ = (char) ((v) >> (BITS_IN_JSAMPLE-8))\n#define BYTESPERSAMPLE 1\n#define PPM_MAXVAL 255\n#else\n/* The word-per-sample format always puts the MSB first. */\n#define PUTPPMSAMPLE(ptr,v)\t\t\t\\\n\t{ register int val_ = v;\t\t\\\n\t  *ptr++ = (char) ((val_ >> 8) & 0xFF);\t\\\n\t  *ptr++ = (char) (val_ & 0xFF);\t\\\n\t}\n#define BYTESPERSAMPLE 2\n#define PPM_MAXVAL ((1<<BITS_IN_JSAMPLE)-1)\n#endif\n#endif\n\n\n/*\n * When JSAMPLE is the same size as char, we can just fwrite() the\n * decompressed data to the PPM or PGM file.  On PCs, in order to make this\n * work the output buffer must be allocated in near data space, because we are\n * assuming small-data memory model wherein fwrite() can't reach far memory.\n * If you need to process very wide images on a PC, you might have to compile\n * in large-memory model, or else replace fwrite() with a putc() loop ---\n * which will be much slower.\n */\n\n\n/* Private version of data destination object */\n\ntypedef struct {\n  struct djpeg_dest_struct pub;\t/* public fields */\n\n  /* Usually these two pointers point to the same place: */\n  char *iobuffer;\t\t/* fwrite's I/O buffer */\n  JSAMPROW pixrow;\t\t/* decompressor output buffer */\n  size_t buffer_width;\t\t/* width of I/O buffer */\n  JDIMENSION samples_per_row;\t/* JSAMPLEs per output row */\n} ppm_dest_struct;\n\ntypedef ppm_dest_struct * ppm_dest_ptr;\n\n\n/*\n * Write some pixel data.\n * In this module rows_supplied will always be 1.\n *\n * put_pixel_rows handles the \"normal\" 8-bit case where the decompressor\n * output buffer is physically the same as the fwrite buffer.\n */\n\nMETHODDEF(void)\nput_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t\tJDIMENSION rows_supplied)\n{\n  ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;\n\n  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);\n}\n\n\n/*\n * This code is used when we have to copy the data and apply a pixel\n * format translation.  Typically this only happens in 12-bit mode.\n */\n\nMETHODDEF(void)\ncopy_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t\t JDIMENSION rows_supplied)\n{\n  ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;\n  register char * bufferptr;\n  register JSAMPROW ptr;\n  register JDIMENSION col;\n\n  ptr = dest->pub.buffer[0];\n  bufferptr = dest->iobuffer;\n  for (col = dest->samples_per_row; col > 0; col--) {\n    PUTPPMSAMPLE(bufferptr, GETJSAMPLE(*ptr++));\n  }\n  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);\n}\n\n\n/*\n * Write some pixel data when color quantization is in effect.\n * We have to demap the color index values to straight data.\n */\n\nMETHODDEF(void)\nput_demapped_rgb (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t\t  JDIMENSION rows_supplied)\n{\n  ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;\n  register char * bufferptr;\n  register int pixval;\n  register JSAMPROW ptr;\n  register JSAMPROW color_map0 = cinfo->colormap[0];\n  register JSAMPROW color_map1 = cinfo->colormap[1];\n  register JSAMPROW color_map2 = cinfo->colormap[2];\n  register JDIMENSION col;\n\n  ptr = dest->pub.buffer[0];\n  bufferptr = dest->iobuffer;\n  for (col = cinfo->output_width; col > 0; col--) {\n    pixval = GETJSAMPLE(*ptr++);\n    PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map0[pixval]));\n    PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map1[pixval]));\n    PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map2[pixval]));\n  }\n  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);\n}\n\n\nMETHODDEF(void)\nput_demapped_gray (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t\t   JDIMENSION rows_supplied)\n{\n  ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;\n  register char * bufferptr;\n  register JSAMPROW ptr;\n  register JSAMPROW color_map = cinfo->colormap[0];\n  register JDIMENSION col;\n\n  ptr = dest->pub.buffer[0];\n  bufferptr = dest->iobuffer;\n  for (col = cinfo->output_width; col > 0; col--) {\n    PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map[GETJSAMPLE(*ptr++)]));\n  }\n  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);\n}\n\n\n/*\n * Startup: write the file header.\n */\n\nMETHODDEF(void)\nstart_output_ppm (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  ppm_dest_ptr dest = (ppm_dest_ptr) dinfo;\n\n  /* Emit file header */\n  switch (cinfo->out_color_space) {\n  case JCS_GRAYSCALE:\n    /* emit header for raw PGM format */\n    fprintf(dest->pub.output_file, \"P5\\n%ld %ld\\n%d\\n\",\n\t    (long) cinfo->output_width, (long) cinfo->output_height,\n\t    PPM_MAXVAL);\n    break;\n  case JCS_RGB:\n    /* emit header for raw PPM format */\n    fprintf(dest->pub.output_file, \"P6\\n%ld %ld\\n%d\\n\",\n\t    (long) cinfo->output_width, (long) cinfo->output_height,\n\t    PPM_MAXVAL);\n    break;\n  default:\n    ERREXIT(cinfo, JERR_PPM_COLORSPACE);\n  }\n}\n\n\n/*\n * Finish up at the end of the file.\n */\n\nMETHODDEF(void)\nfinish_output_ppm (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  /* Make sure we wrote the output file OK */\n  fflush(dinfo->output_file);\n  if (ferror(dinfo->output_file))\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n}\n\n\n/*\n * The module selection routine for PPM format output.\n */\n\nGLOBAL(djpeg_dest_ptr)\njinit_write_ppm (j_decompress_ptr cinfo)\n{\n  ppm_dest_ptr dest;\n\n  /* Create module interface object, fill in method pointers */\n  dest = (ppm_dest_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(ppm_dest_struct));\n  dest->pub.start_output = start_output_ppm;\n  dest->pub.finish_output = finish_output_ppm;\n\n  /* Calculate output image dimensions so we can allocate space */\n  jpeg_calc_output_dimensions(cinfo);\n\n  /* Create physical I/O buffer.  Note we make this near on a PC. */\n  dest->samples_per_row = cinfo->output_width * cinfo->out_color_components;\n  dest->buffer_width = dest->samples_per_row * (BYTESPERSAMPLE * SIZEOF(char));\n  dest->iobuffer = (char *) (*cinfo->mem->alloc_small)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, dest->buffer_width);\n\n  if (cinfo->quantize_colors || BITS_IN_JSAMPLE != 8 ||\n      SIZEOF(JSAMPLE) != SIZEOF(char)) {\n    /* When quantizing, we need an output buffer for colormap indexes\n     * that's separate from the physical I/O buffer.  We also need a\n     * separate buffer if pixel format translation must take place.\n     */\n    dest->pub.buffer = (*cinfo->mem->alloc_sarray)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE,\n       cinfo->output_width * cinfo->output_components, (JDIMENSION) 1);\n    dest->pub.buffer_height = 1;\n    if (! cinfo->quantize_colors)\n      dest->pub.put_pixel_rows = copy_pixel_rows;\n    else if (cinfo->out_color_space == JCS_GRAYSCALE)\n      dest->pub.put_pixel_rows = put_demapped_gray;\n    else\n      dest->pub.put_pixel_rows = put_demapped_rgb;\n  } else {\n    /* We will fwrite() directly from decompressor output buffer. */\n    /* Synthesize a JSAMPARRAY pointer structure */\n    /* Cast here implies near->far pointer conversion on PCs */\n    dest->pixrow = (JSAMPROW) dest->iobuffer;\n    dest->pub.buffer = & dest->pixrow;\n    dest->pub.buffer_height = 1;\n    dest->pub.put_pixel_rows = put_pixel_rows;\n  }\n\n  return (djpeg_dest_ptr) dest;\n}\n\n#endif /* PPM_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/wrrle.c",
    "content": "/*\n * wrrle.c\n *\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to write output images in RLE format.\n * The Utah Raster Toolkit library is required (version 3.1 or later).\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume output to\n * an ordinary stdio stream.\n *\n * Based on code contributed by Mike Lijewski,\n * with updates from Robert Hutchinson.\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n\n#ifdef RLE_SUPPORTED\n\n/* rle.h is provided by the Utah Raster Toolkit. */\n\n#include <rle.h>\n\n/*\n * We assume that JSAMPLE has the same representation as rle_pixel,\n * to wit, \"unsigned char\".  Hence we can't cope with 12- or 16-bit samples.\n */\n\n#if BITS_IN_JSAMPLE != 8\n  Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */\n#endif\n\n\n/*\n * Since RLE stores scanlines bottom-to-top, we have to invert the image\n * from JPEG's top-to-bottom order.  To do this, we save the outgoing data\n * in a virtual array during put_pixel_row calls, then actually emit the\n * RLE file during finish_output.\n */\n\n\n/*\n * For now, if we emit an RLE color map then it is always 256 entries long,\n * though not all of the entries need be used.\n */\n\n#define CMAPBITS\t8\n#define CMAPLENGTH\t(1<<(CMAPBITS))\n\ntypedef struct {\n  struct djpeg_dest_struct pub; /* public fields */\n\n  jvirt_sarray_ptr image;\t/* virtual array to store the output image */\n  rle_map *colormap;\t \t/* RLE-style color map, or NULL if none */\n  rle_pixel **rle_row;\t\t/* To pass rows to rle_putrow() */\n\n} rle_dest_struct;\n\ntypedef rle_dest_struct * rle_dest_ptr;\n\n/* Forward declarations */\nMETHODDEF(void) rle_put_pixel_rows\n    JPP((j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t JDIMENSION rows_supplied));\n\n\n/*\n * Write the file header.\n *\n * In this module it's easier to wait till finish_output to write anything.\n */\n\nMETHODDEF(void)\nstart_output_rle (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  rle_dest_ptr dest = (rle_dest_ptr) dinfo;\n  size_t cmapsize;\n  int i, ci;\n#ifdef PROGRESS_REPORT\n  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n#endif\n\n  /*\n   * Make sure the image can be stored in RLE format.\n   *\n   * - RLE stores image dimensions as *signed* 16 bit integers.  JPEG\n   *   uses unsigned, so we have to check the width.\n   *\n   * - Colorspace is expected to be grayscale or RGB.\n   *\n   * - The number of channels (components) is expected to be 1 (grayscale/\n   *   pseudocolor) or 3 (truecolor/directcolor).\n   *   (could be 2 or 4 if using an alpha channel, but we aren't)\n   */\n\n  if (cinfo->output_width > 32767 || cinfo->output_height > 32767)\n    ERREXIT2(cinfo, JERR_RLE_DIMENSIONS, cinfo->output_width, \n\t     cinfo->output_height);\n\n  if (cinfo->out_color_space != JCS_GRAYSCALE &&\n      cinfo->out_color_space != JCS_RGB)\n    ERREXIT(cinfo, JERR_RLE_COLORSPACE);\n\n  if (cinfo->output_components != 1 && cinfo->output_components != 3)\n    ERREXIT1(cinfo, JERR_RLE_TOOMANYCHANNELS, cinfo->num_components);\n\n  /* Convert colormap, if any, to RLE format. */\n\n  dest->colormap = NULL;\n\n  if (cinfo->quantize_colors) {\n    /* Allocate storage for RLE-style cmap, zero any extra entries */\n    cmapsize = cinfo->out_color_components * CMAPLENGTH * SIZEOF(rle_map);\n    dest->colormap = (rle_map *) (*cinfo->mem->alloc_small)\n      ((j_common_ptr) cinfo, JPOOL_IMAGE, cmapsize);\n    MEMZERO(dest->colormap, cmapsize);\n\n    /* Save away data in RLE format --- note 8-bit left shift! */\n    /* Shifting would need adjustment for JSAMPLEs wider than 8 bits. */\n    for (ci = 0; ci < cinfo->out_color_components; ci++) {\n      for (i = 0; i < cinfo->actual_number_of_colors; i++) {\n        dest->colormap[ci * CMAPLENGTH + i] =\n          GETJSAMPLE(cinfo->colormap[ci][i]) << 8;\n      }\n    }\n  }\n\n  /* Set the output buffer to the first row */\n  dest->pub.buffer = (*cinfo->mem->access_virt_sarray)\n    ((j_common_ptr) cinfo, dest->image, (JDIMENSION) 0, (JDIMENSION) 1, TRUE);\n  dest->pub.buffer_height = 1;\n\n  dest->pub.put_pixel_rows = rle_put_pixel_rows;\n\n#ifdef PROGRESS_REPORT\n  if (progress != NULL) {\n    progress->total_extra_passes++;  /* count file writing as separate pass */\n  }\n#endif\n}\n\n\n/*\n * Write some pixel data.\n *\n * This routine just saves the data away in a virtual array.\n */\n\nMETHODDEF(void)\nrle_put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t\t    JDIMENSION rows_supplied)\n{\n  rle_dest_ptr dest = (rle_dest_ptr) dinfo;\n\n  if (cinfo->output_scanline < cinfo->output_height) {\n    dest->pub.buffer = (*cinfo->mem->access_virt_sarray)\n      ((j_common_ptr) cinfo, dest->image,\n       cinfo->output_scanline, (JDIMENSION) 1, TRUE);\n  }\n}\n\n/*\n * Finish up at the end of the file.\n *\n * Here is where we really output the RLE file.\n */\n\nMETHODDEF(void)\nfinish_output_rle (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  rle_dest_ptr dest = (rle_dest_ptr) dinfo;\n  rle_hdr header;\t\t/* Output file information */\n  rle_pixel **rle_row, *red, *green, *blue;\n  JSAMPROW output_row;\n  char cmapcomment[80];\n  int row, col;\n  int ci;\n#ifdef PROGRESS_REPORT\n  cd_progress_ptr progress = (cd_progress_ptr) cinfo->progress;\n#endif\n\n  /* Initialize the header info */\n  header = *rle_hdr_init(NULL);\n  header.rle_file = dest->pub.output_file;\n  header.xmin     = 0;\n  header.xmax     = cinfo->output_width  - 1;\n  header.ymin     = 0;\n  header.ymax     = cinfo->output_height - 1;\n  header.alpha    = 0;\n  header.ncolors  = cinfo->output_components;\n  for (ci = 0; ci < cinfo->output_components; ci++) {\n    RLE_SET_BIT(header, ci);\n  }\n  if (cinfo->quantize_colors) {\n    header.ncmap   = cinfo->out_color_components;\n    header.cmaplen = CMAPBITS;\n    header.cmap    = dest->colormap;\n    /* Add a comment to the output image with the true colormap length. */\n    sprintf(cmapcomment, \"color_map_length=%d\", cinfo->actual_number_of_colors);\n    rle_putcom(cmapcomment, &header);\n  }\n\n  /* Emit the RLE header and color map (if any) */\n  rle_put_setup(&header);\n\n  /* Now output the RLE data from our virtual array.\n   * We assume here that (a) rle_pixel is represented the same as JSAMPLE,\n   * and (b) we are not on a machine where FAR pointers differ from regular.\n   */\n\n#ifdef PROGRESS_REPORT\n  if (progress != NULL) {\n    progress->pub.pass_limit = cinfo->output_height;\n    progress->pub.pass_counter = 0;\n    (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n  }\n#endif\n\n  if (cinfo->output_components == 1) {\n    for (row = cinfo->output_height-1; row >= 0; row--) {\n      rle_row = (rle_pixel **) (*cinfo->mem->access_virt_sarray)\n        ((j_common_ptr) cinfo, dest->image,\n\t (JDIMENSION) row, (JDIMENSION) 1, FALSE);\n      rle_putrow(rle_row, (int) cinfo->output_width, &header);\n#ifdef PROGRESS_REPORT\n      if (progress != NULL) {\n        progress->pub.pass_counter++;\n        (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n      }\n#endif\n    }\n  } else {\n    for (row = cinfo->output_height-1; row >= 0; row--) {\n      rle_row = (rle_pixel **) dest->rle_row;\n      output_row = * (*cinfo->mem->access_virt_sarray)\n        ((j_common_ptr) cinfo, dest->image,\n\t (JDIMENSION) row, (JDIMENSION) 1, FALSE);\n      red = rle_row[0];\n      green = rle_row[1];\n      blue = rle_row[2];\n      for (col = cinfo->output_width; col > 0; col--) {\n        *red++ = GETJSAMPLE(*output_row++);\n        *green++ = GETJSAMPLE(*output_row++);\n        *blue++ = GETJSAMPLE(*output_row++);\n      }\n      rle_putrow(rle_row, (int) cinfo->output_width, &header);\n#ifdef PROGRESS_REPORT\n      if (progress != NULL) {\n        progress->pub.pass_counter++;\n        (*progress->pub.progress_monitor) ((j_common_ptr) cinfo);\n      }\n#endif\n    }\n  }\n\n#ifdef PROGRESS_REPORT\n  if (progress != NULL)\n    progress->completed_extra_passes++;\n#endif\n\n  /* Emit file trailer */\n  rle_puteof(&header);\n  fflush(dest->pub.output_file);\n  if (ferror(dest->pub.output_file))\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n}\n\n\n/*\n * The module selection routine for RLE format output.\n */\n\nGLOBAL(djpeg_dest_ptr)\njinit_write_rle (j_decompress_ptr cinfo)\n{\n  rle_dest_ptr dest;\n\n  /* Create module interface object, fill in method pointers */\n  dest = (rle_dest_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n                                  SIZEOF(rle_dest_struct));\n  dest->pub.start_output = start_output_rle;\n  dest->pub.finish_output = finish_output_rle;\n\n  /* Calculate output image dimensions so we can allocate space */\n  jpeg_calc_output_dimensions(cinfo);\n\n  /* Allocate a work array for output to the RLE library. */\n  dest->rle_row = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE,\n     cinfo->output_width, (JDIMENSION) cinfo->output_components);\n\n  /* Allocate a virtual array to hold the image. */\n  dest->image = (*cinfo->mem->request_virt_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE,\n     (JDIMENSION) (cinfo->output_width * cinfo->output_components),\n     cinfo->output_height, (JDIMENSION) 1);\n\n  return (djpeg_dest_ptr) dest;\n}\n\n#endif /* RLE_SUPPORTED */\n"
  },
  {
    "path": "ext/libjpeg-turbo/wrtarga.c",
    "content": "/*\n * wrtarga.c\n *\n * Copyright (C) 1991-1996, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n * For conditions of distribution and use, see the accompanying README file.\n *\n * This file contains routines to write output images in Targa format.\n *\n * These routines may need modification for non-Unix environments or\n * specialized applications.  As they stand, they assume output to\n * an ordinary stdio stream.\n *\n * Based on code contributed by Lee Daniel Crocker.\n */\n\n#include \"cdjpeg.h\"\t\t/* Common decls for cjpeg/djpeg applications */\n\n#ifdef TARGA_SUPPORTED\n\n\n/*\n * To support 12-bit JPEG data, we'd have to scale output down to 8 bits.\n * This is not yet implemented.\n */\n\n#if BITS_IN_JSAMPLE != 8\n  Sorry, this code only copes with 8-bit JSAMPLEs. /* deliberate syntax err */\n#endif\n\n/*\n * The output buffer needs to be writable by fwrite().  On PCs, we must\n * allocate the buffer in near data space, because we are assuming small-data\n * memory model, wherein fwrite() can't reach far memory.  If you need to\n * process very wide images on a PC, you might have to compile in large-memory\n * model, or else replace fwrite() with a putc() loop --- which will be much\n * slower.\n */\n\n\n/* Private version of data destination object */\n\ntypedef struct {\n  struct djpeg_dest_struct pub;\t/* public fields */\n\n  char *iobuffer;\t\t/* physical I/O buffer */\n  JDIMENSION buffer_width;\t/* width of one row */\n} tga_dest_struct;\n\ntypedef tga_dest_struct * tga_dest_ptr;\n\n\nLOCAL(void)\nwrite_header (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, int num_colors)\n/* Create and write a Targa header */\n{\n  char targaheader[18];\n\n  /* Set unused fields of header to 0 */\n  MEMZERO(targaheader, SIZEOF(targaheader));\n\n  if (num_colors > 0) {\n    targaheader[1] = 1;\t\t/* color map type 1 */\n    targaheader[5] = (char) (num_colors & 0xFF);\n    targaheader[6] = (char) (num_colors >> 8);\n    targaheader[7] = 24;\t/* 24 bits per cmap entry */\n  }\n\n  targaheader[12] = (char) (cinfo->output_width & 0xFF);\n  targaheader[13] = (char) (cinfo->output_width >> 8);\n  targaheader[14] = (char) (cinfo->output_height & 0xFF);\n  targaheader[15] = (char) (cinfo->output_height >> 8);\n  targaheader[17] = 0x20;\t/* Top-down, non-interlaced */\n\n  if (cinfo->out_color_space == JCS_GRAYSCALE) {\n    targaheader[2] = 3;\t\t/* image type = uncompressed gray-scale */\n    targaheader[16] = 8;\t/* bits per pixel */\n  } else {\t\t\t/* must be RGB */\n    if (num_colors > 0) {\n      targaheader[2] = 1;\t/* image type = colormapped RGB */\n      targaheader[16] = 8;\n    } else {\n      targaheader[2] = 2;\t/* image type = uncompressed RGB */\n      targaheader[16] = 24;\n    }\n  }\n\n  if (JFWRITE(dinfo->output_file, targaheader, 18) != (size_t) 18)\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n}\n\n\n/*\n * Write some pixel data.\n * In this module rows_supplied will always be 1.\n */\n\nMETHODDEF(void)\nput_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t\tJDIMENSION rows_supplied)\n/* used for unquantized full-color output */\n{\n  tga_dest_ptr dest = (tga_dest_ptr) dinfo;\n  register JSAMPROW inptr;\n  register char * outptr;\n  register JDIMENSION col;\n\n  inptr = dest->pub.buffer[0];\n  outptr = dest->iobuffer;\n  for (col = cinfo->output_width; col > 0; col--) {\n    outptr[0] = (char) GETJSAMPLE(inptr[2]); /* RGB to BGR order */\n    outptr[1] = (char) GETJSAMPLE(inptr[1]);\n    outptr[2] = (char) GETJSAMPLE(inptr[0]);\n    inptr += 3, outptr += 3;\n  }\n  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);\n}\n\nMETHODDEF(void)\nput_gray_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t       JDIMENSION rows_supplied)\n/* used for grayscale OR quantized color output */\n{\n  tga_dest_ptr dest = (tga_dest_ptr) dinfo;\n  register JSAMPROW inptr;\n  register char * outptr;\n  register JDIMENSION col;\n\n  inptr = dest->pub.buffer[0];\n  outptr = dest->iobuffer;\n  for (col = cinfo->output_width; col > 0; col--) {\n    *outptr++ = (char) GETJSAMPLE(*inptr++);\n  }\n  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);\n}\n\n\n/*\n * Write some demapped pixel data when color quantization is in effect.\n * For Targa, this is only applied to grayscale data.\n */\n\nMETHODDEF(void)\nput_demapped_gray (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,\n\t\t   JDIMENSION rows_supplied)\n{\n  tga_dest_ptr dest = (tga_dest_ptr) dinfo;\n  register JSAMPROW inptr;\n  register char * outptr;\n  register JSAMPROW color_map0 = cinfo->colormap[0];\n  register JDIMENSION col;\n\n  inptr = dest->pub.buffer[0];\n  outptr = dest->iobuffer;\n  for (col = cinfo->output_width; col > 0; col--) {\n    *outptr++ = (char) GETJSAMPLE(color_map0[GETJSAMPLE(*inptr++)]);\n  }\n  (void) JFWRITE(dest->pub.output_file, dest->iobuffer, dest->buffer_width);\n}\n\n\n/*\n * Startup: write the file header.\n */\n\nMETHODDEF(void)\nstart_output_tga (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  tga_dest_ptr dest = (tga_dest_ptr) dinfo;\n  int num_colors, i;\n  FILE *outfile;\n\n  if (cinfo->out_color_space == JCS_GRAYSCALE) {\n    /* Targa doesn't have a mapped grayscale format, so we will */\n    /* demap quantized gray output.  Never emit a colormap. */\n    write_header(cinfo, dinfo, 0);\n    if (cinfo->quantize_colors)\n      dest->pub.put_pixel_rows = put_demapped_gray;\n    else\n      dest->pub.put_pixel_rows = put_gray_rows;\n  } else if (cinfo->out_color_space == JCS_RGB) {\n    if (cinfo->quantize_colors) {\n      /* We only support 8-bit colormap indexes, so only 256 colors */\n      num_colors = cinfo->actual_number_of_colors;\n      if (num_colors > 256)\n\tERREXIT1(cinfo, JERR_TOO_MANY_COLORS, num_colors);\n      write_header(cinfo, dinfo, num_colors);\n      /* Write the colormap.  Note Targa uses BGR byte order */\n      outfile = dest->pub.output_file;\n      for (i = 0; i < num_colors; i++) {\n\tputc(GETJSAMPLE(cinfo->colormap[2][i]), outfile);\n\tputc(GETJSAMPLE(cinfo->colormap[1][i]), outfile);\n\tputc(GETJSAMPLE(cinfo->colormap[0][i]), outfile);\n      }\n      dest->pub.put_pixel_rows = put_gray_rows;\n    } else {\n      write_header(cinfo, dinfo, 0);\n      dest->pub.put_pixel_rows = put_pixel_rows;\n    }\n  } else {\n    ERREXIT(cinfo, JERR_TGA_COLORSPACE);\n  }\n}\n\n\n/*\n * Finish up at the end of the file.\n */\n\nMETHODDEF(void)\nfinish_output_tga (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)\n{\n  /* Make sure we wrote the output file OK */\n  fflush(dinfo->output_file);\n  if (ferror(dinfo->output_file))\n    ERREXIT(cinfo, JERR_FILE_WRITE);\n}\n\n\n/*\n * The module selection routine for Targa format output.\n */\n\nGLOBAL(djpeg_dest_ptr)\njinit_write_targa (j_decompress_ptr cinfo)\n{\n  tga_dest_ptr dest;\n\n  /* Create module interface object, fill in method pointers */\n  dest = (tga_dest_ptr)\n      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t  SIZEOF(tga_dest_struct));\n  dest->pub.start_output = start_output_tga;\n  dest->pub.finish_output = finish_output_tga;\n\n  /* Calculate output image dimensions so we can allocate space */\n  jpeg_calc_output_dimensions(cinfo);\n\n  /* Create I/O buffer.  Note we make this near on a PC. */\n  dest->buffer_width = cinfo->output_width * cinfo->output_components;\n  dest->iobuffer = (char *)\n    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,\n\t\t\t\t(size_t) (dest->buffer_width * SIZEOF(char)));\n\n  /* Create decompressor output buffer. */\n  dest->pub.buffer = (*cinfo->mem->alloc_sarray)\n    ((j_common_ptr) cinfo, JPOOL_IMAGE, dest->buffer_width, (JDIMENSION) 1);\n  dest->pub.buffer_height = 1;\n\n  return (djpeg_dest_ptr) dest;\n}\n\n#endif /* TARGA_SUPPORTED */\n"
  },
  {
    "path": "ext/libwebp/COPYING",
    "content": "Copyright (c) 2010, Google Inc. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n  * Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n  * Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in\n    the documentation and/or other materials provided with the\n    distribution.\n\n  * Neither the name of Google nor the names of its contributors may\n    be used to endorse or promote products derived from this software\n    without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n"
  },
  {
    "path": "ext/libwebp/dec/Makefile.am",
    "content": "noinst_LTLIBRARIES = libwebpdecode.la\n\nlibwebpdecode_la_SOURCES =\nlibwebpdecode_la_SOURCES += alpha.c\nlibwebpdecode_la_SOURCES += alphai.h\nlibwebpdecode_la_SOURCES += buffer.c\nlibwebpdecode_la_SOURCES += decode_vp8.h\nlibwebpdecode_la_SOURCES += frame.c\nlibwebpdecode_la_SOURCES += idec.c\nlibwebpdecode_la_SOURCES += io.c\nlibwebpdecode_la_SOURCES += quant.c\nlibwebpdecode_la_SOURCES += tree.c\nlibwebpdecode_la_SOURCES += vp8.c\nlibwebpdecode_la_SOURCES += vp8i.h\nlibwebpdecode_la_SOURCES += vp8l.c\nlibwebpdecode_la_SOURCES += vp8li.h\nlibwebpdecode_la_SOURCES += webp.c\nlibwebpdecode_la_SOURCES += webpi.h\n\nlibwebpdecodeinclude_HEADERS =\nlibwebpdecodeinclude_HEADERS += ../webp/decode.h\nlibwebpdecodeinclude_HEADERS += ../webp/types.h\nnoinst_HEADERS =\nnoinst_HEADERS += ../webp/format_constants.h\n\nlibwebpdecode_la_CPPFLAGS = $(USE_EXPERIMENTAL_CODE)\nlibwebpdecodeincludedir = $(includedir)/webp\n"
  },
  {
    "path": "ext/libwebp/dec/Makefile.in",
    "content": "# Makefile.in generated by automake 1.11.3 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,\n# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software\n# Foundation, Inc.\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\n\n\nVPATH = @srcdir@\npkgdatadir = $(datadir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkglibexecdir = $(libexecdir)/@PACKAGE@\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nbuild_triplet = @build@\nhost_triplet = @host@\nsubdir = src/dec\nDIST_COMMON = $(libwebpdecodeinclude_HEADERS) $(noinst_HEADERS) \\\n\t$(srcdir)/Makefile.am $(srcdir)/Makefile.in\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \\\n\t$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \\\n\t$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \\\n\t$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nmkinstalldirs = $(install_sh) -d\nCONFIG_HEADER = $(top_builddir)/src/webp/config.h\nCONFIG_CLEAN_FILES =\nCONFIG_CLEAN_VPATH_FILES =\nLTLIBRARIES = $(noinst_LTLIBRARIES)\nlibwebpdecode_la_LIBADD =\nam_libwebpdecode_la_OBJECTS = libwebpdecode_la-alpha.lo \\\n\tlibwebpdecode_la-buffer.lo libwebpdecode_la-frame.lo \\\n\tlibwebpdecode_la-idec.lo libwebpdecode_la-io.lo \\\n\tlibwebpdecode_la-quant.lo libwebpdecode_la-tree.lo \\\n\tlibwebpdecode_la-vp8.lo libwebpdecode_la-vp8l.lo \\\n\tlibwebpdecode_la-webp.lo\nlibwebpdecode_la_OBJECTS = $(am_libwebpdecode_la_OBJECTS)\nAM_V_lt = $(am__v_lt_@AM_V@)\nam__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)\nam__v_lt_0 = --silent\nDEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/webp\ndepcomp = $(SHELL) $(top_srcdir)/depcomp\nam__depfiles_maybe = depfiles\nam__mv = mv -f\nCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\nLTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \\\n\t$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \\\n\t$(AM_CFLAGS) $(CFLAGS)\nAM_V_CC = $(am__v_CC_@AM_V@)\nam__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)\nam__v_CC_0 = @echo \"  CC    \" $@;\nAM_V_at = $(am__v_at_@AM_V@)\nam__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\nam__v_at_0 = @\nCCLD = $(CC)\nLINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \\\n\t$(AM_LDFLAGS) $(LDFLAGS) -o $@\nAM_V_CCLD = $(am__v_CCLD_@AM_V@)\nam__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)\nam__v_CCLD_0 = @echo \"  CCLD  \" $@;\nAM_V_GEN = $(am__v_GEN_@AM_V@)\nam__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\nam__v_GEN_0 = @echo \"  GEN   \" $@;\nSOURCES = $(libwebpdecode_la_SOURCES)\nDIST_SOURCES = $(libwebpdecode_la_SOURCES)\nam__vpath_adj_setup = srcdirstrip=`echo \"$(srcdir)\" | sed 's|.|.|g'`;\nam__vpath_adj = case $$p in \\\n    $(srcdir)/*) f=`echo \"$$p\" | sed \"s|^$$srcdirstrip/||\"`;; \\\n    *) f=$$p;; \\\n  esac;\nam__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;\nam__install_max = 40\nam__nobase_strip_setup = \\\n  srcdirstrip=`echo \"$(srcdir)\" | sed 's/[].[^$$\\\\*|]/\\\\\\\\&/g'`\nam__nobase_strip = \\\n  for p in $$list; do echo \"$$p\"; done | sed -e \"s|$$srcdirstrip/||\"\nam__nobase_list = $(am__nobase_strip_setup); \\\n  for p in $$list; do echo \"$$p $$p\"; done | \\\n  sed \"s| $$srcdirstrip/| |;\"' / .*\\//!s/ .*/ ./; s,\\( .*\\)/[^/]*$$,\\1,' | \\\n  $(AWK) 'BEGIN { files[\".\"] = \"\" } { files[$$2] = files[$$2] \" \" $$1; \\\n    if (++n[$$2] == $(am__install_max)) \\\n      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = \"\" } } \\\n    END { for (dir in files) print dir, files[dir] }'\nam__base_list = \\\n  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\\n/ /g' | \\\n  sed '$$!N;$$!N;$$!N;$$!N;s/\\n/ /g'\nam__uninstall_files_from_dir = { \\\n  test -z \"$$files\" \\\n    || { test ! -d \"$$dir\" && test ! -f \"$$dir\" && test ! -r \"$$dir\"; } \\\n    || { echo \" ( cd '$$dir' && rm -f\" $$files \")\"; \\\n         $(am__cd) \"$$dir\" && rm -f $$files; }; \\\n  }\nam__installdirs = \"$(DESTDIR)$(libwebpdecodeincludedir)\"\nHEADERS = $(libwebpdecodeinclude_HEADERS) $(noinst_HEADERS)\nETAGS = etags\nCTAGS = ctags\nDISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)\nACLOCAL = @ACLOCAL@\nAMTAR = @AMTAR@\nAM_CFLAGS = @AM_CFLAGS@\nAM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAVX2_FLAGS = @AVX2_FLAGS@\nAWK = @AWK@\nCC = @CC@\nCCDEPMODE = @CCDEPMODE@\nCFLAGS = @CFLAGS@\nCPP = @CPP@\nCPPFLAGS = @CPPFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEFS = @DEFS@\nDEPDIR = @DEPDIR@\nDLLTOOL = @DLLTOOL@\nDSYMUTIL = @DSYMUTIL@\nDUMPBIN = @DUMPBIN@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEGREP = @EGREP@\nEXEEXT = @EXEEXT@\nFGREP = @FGREP@\nGIF_INCLUDES = @GIF_INCLUDES@\nGIF_LIBS = @GIF_LIBS@\nGL_INCLUDES = @GL_INCLUDES@\nGL_LIBS = @GL_LIBS@\nGREP = @GREP@\nINSTALL = @INSTALL@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nJPEG_INCLUDES = @JPEG_INCLUDES@\nJPEG_LIBS = @JPEG_LIBS@\nLD = @LD@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBPNG_CONFIG = @LIBPNG_CONFIG@\nLIBS = @LIBS@\nLIBTOOL = @LIBTOOL@\nLIPO = @LIPO@\nLN_S = @LN_S@\nLTLIBOBJS = @LTLIBOBJS@\nMAKEINFO = @MAKEINFO@\nMANIFEST_TOOL = @MANIFEST_TOOL@\nMKDIR_P = @MKDIR_P@\nNM = @NM@\nNMEDIT = @NMEDIT@\nOBJDUMP = @OBJDUMP@\nOBJEXT = @OBJEXT@\nOTOOL = @OTOOL@\nOTOOL64 = @OTOOL64@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_URL = @PACKAGE_URL@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nPNG_INCLUDES = @PNG_INCLUDES@\nPNG_LIBS = @PNG_LIBS@\nPTHREAD_CC = @PTHREAD_CC@\nPTHREAD_CFLAGS = @PTHREAD_CFLAGS@\nPTHREAD_LIBS = @PTHREAD_LIBS@\nRANLIB = @RANLIB@\nSED = @SED@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSSE2_FLAGS = @SSE2_FLAGS@\nSTRIP = @STRIP@\nTIFF_INCLUDES = @TIFF_INCLUDES@\nTIFF_LIBS = @TIFF_LIBS@\nUSE_EXPERIMENTAL_CODE = @USE_EXPERIMENTAL_CODE@\nUSE_SWAP_16BIT_CSP = @USE_SWAP_16BIT_CSP@\nVERSION = @VERSION@\nabs_builddir = @abs_builddir@\nabs_srcdir = @abs_srcdir@\nabs_top_builddir = @abs_top_builddir@\nabs_top_srcdir = @abs_top_srcdir@\nac_ct_AR = @ac_ct_AR@\nac_ct_CC = @ac_ct_CC@\nac_ct_DUMPBIN = @ac_ct_DUMPBIN@\nam__include = @am__include@\nam__leading_dot = @am__leading_dot@\nam__quote = @am__quote@\nam__tar = @am__tar@\nam__untar = @am__untar@\nax_pthread_config = @ax_pthread_config@\nbindir = @bindir@\nbuild = @build@\nbuild_alias = @build_alias@\nbuild_cpu = @build_cpu@\nbuild_os = @build_os@\nbuild_vendor = @build_vendor@\nbuilddir = @builddir@\ndatadir = @datadir@\ndatarootdir = @datarootdir@\ndocdir = @docdir@\ndvidir = @dvidir@\nexec_prefix = @exec_prefix@\nhost = @host@\nhost_alias = @host_alias@\nhost_cpu = @host_cpu@\nhost_os = @host_os@\nhost_vendor = @host_vendor@\nhtmldir = @htmldir@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocaledir = @localedir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\npdfdir = @pdfdir@\npkgconfigdir = @pkgconfigdir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\npsdir = @psdir@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsrcdir = @srcdir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\ntop_build_prefix = @top_build_prefix@\ntop_builddir = @top_builddir@\ntop_srcdir = @top_srcdir@\nnoinst_LTLIBRARIES = libwebpdecode.la\nlibwebpdecode_la_SOURCES = alpha.c alphai.h buffer.c decode_vp8.h \\\n\tframe.c idec.c io.c quant.c tree.c vp8.c vp8i.h vp8l.c vp8li.h \\\n\twebp.c webpi.h\nlibwebpdecodeinclude_HEADERS = ../webp/decode.h ../webp/types.h\nnoinst_HEADERS = ../webp/format_constants.h\nlibwebpdecode_la_CPPFLAGS = $(USE_EXPERIMENTAL_CODE)\nlibwebpdecodeincludedir = $(includedir)/webp\nall: all-am\n\n.SUFFIXES:\n.SUFFIXES: .c .lo .o .obj\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \\\n\t        && { if test -f $@; then exit 0; else break; fi; }; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/dec/Makefile'; \\\n\t$(am__cd) $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign src/dec/Makefile\n.PRECIOUS: Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(am__aclocal_m4_deps):\n\nclean-noinstLTLIBRARIES:\n\t-test -z \"$(noinst_LTLIBRARIES)\" || rm -f $(noinst_LTLIBRARIES)\n\t@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \\\n\t  dir=\"`echo $$p | sed -e 's|/[^/]*$$||'`\"; \\\n\t  test \"$$dir\" != \"$$p\" || dir=.; \\\n\t  echo \"rm -f \\\"$${dir}/so_locations\\\"\"; \\\n\t  rm -f \"$${dir}/so_locations\"; \\\n\tdone\nlibwebpdecode.la: $(libwebpdecode_la_OBJECTS) $(libwebpdecode_la_DEPENDENCIES) $(EXTRA_libwebpdecode_la_DEPENDENCIES) \n\t$(AM_V_CCLD)$(LINK)  $(libwebpdecode_la_OBJECTS) $(libwebpdecode_la_LIBADD) $(LIBS)\n\nmostlyclean-compile:\n\t-rm -f *.$(OBJEXT)\n\ndistclean-compile:\n\t-rm -f *.tab.c\n\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdecode_la-alpha.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdecode_la-buffer.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdecode_la-frame.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdecode_la-idec.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdecode_la-io.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdecode_la-quant.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdecode_la-tree.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdecode_la-vp8.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdecode_la-vp8l.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdecode_la-webp.Plo@am__quote@\n\n.c.o:\n@am__fastdepCC_TRUE@\t$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\\.o$$||'`;\\\n@am__fastdepCC_TRUE@\t$(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\\\n@am__fastdepCC_TRUE@\t$(am__mv) $$depbase.Tpo $$depbase.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<\n\n.c.obj:\n@am__fastdepCC_TRUE@\t$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\\.obj$$||'`;\\\n@am__fastdepCC_TRUE@\t$(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\\\n@am__fastdepCC_TRUE@\t$(am__mv) $$depbase.Tpo $$depbase.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`\n\n.c.lo:\n@am__fastdepCC_TRUE@\t$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\\.lo$$||'`;\\\n@am__fastdepCC_TRUE@\t$(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\\\n@am__fastdepCC_TRUE@\t$(am__mv) $$depbase.Tpo $$depbase.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<\n\nlibwebpdecode_la-alpha.lo: alpha.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdecode_la-alpha.lo -MD -MP -MF $(DEPDIR)/libwebpdecode_la-alpha.Tpo -c -o libwebpdecode_la-alpha.lo `test -f 'alpha.c' || echo '$(srcdir)/'`alpha.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdecode_la-alpha.Tpo $(DEPDIR)/libwebpdecode_la-alpha.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='alpha.c' object='libwebpdecode_la-alpha.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdecode_la-alpha.lo `test -f 'alpha.c' || echo '$(srcdir)/'`alpha.c\n\nlibwebpdecode_la-buffer.lo: buffer.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdecode_la-buffer.lo -MD -MP -MF $(DEPDIR)/libwebpdecode_la-buffer.Tpo -c -o libwebpdecode_la-buffer.lo `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdecode_la-buffer.Tpo $(DEPDIR)/libwebpdecode_la-buffer.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='buffer.c' object='libwebpdecode_la-buffer.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdecode_la-buffer.lo `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c\n\nlibwebpdecode_la-frame.lo: frame.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdecode_la-frame.lo -MD -MP -MF $(DEPDIR)/libwebpdecode_la-frame.Tpo -c -o libwebpdecode_la-frame.lo `test -f 'frame.c' || echo '$(srcdir)/'`frame.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdecode_la-frame.Tpo $(DEPDIR)/libwebpdecode_la-frame.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='frame.c' object='libwebpdecode_la-frame.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdecode_la-frame.lo `test -f 'frame.c' || echo '$(srcdir)/'`frame.c\n\nlibwebpdecode_la-idec.lo: idec.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdecode_la-idec.lo -MD -MP -MF $(DEPDIR)/libwebpdecode_la-idec.Tpo -c -o libwebpdecode_la-idec.lo `test -f 'idec.c' || echo '$(srcdir)/'`idec.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdecode_la-idec.Tpo $(DEPDIR)/libwebpdecode_la-idec.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='idec.c' object='libwebpdecode_la-idec.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdecode_la-idec.lo `test -f 'idec.c' || echo '$(srcdir)/'`idec.c\n\nlibwebpdecode_la-io.lo: io.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdecode_la-io.lo -MD -MP -MF $(DEPDIR)/libwebpdecode_la-io.Tpo -c -o libwebpdecode_la-io.lo `test -f 'io.c' || echo '$(srcdir)/'`io.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdecode_la-io.Tpo $(DEPDIR)/libwebpdecode_la-io.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='io.c' object='libwebpdecode_la-io.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdecode_la-io.lo `test -f 'io.c' || echo '$(srcdir)/'`io.c\n\nlibwebpdecode_la-quant.lo: quant.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdecode_la-quant.lo -MD -MP -MF $(DEPDIR)/libwebpdecode_la-quant.Tpo -c -o libwebpdecode_la-quant.lo `test -f 'quant.c' || echo '$(srcdir)/'`quant.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdecode_la-quant.Tpo $(DEPDIR)/libwebpdecode_la-quant.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='quant.c' object='libwebpdecode_la-quant.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdecode_la-quant.lo `test -f 'quant.c' || echo '$(srcdir)/'`quant.c\n\nlibwebpdecode_la-tree.lo: tree.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdecode_la-tree.lo -MD -MP -MF $(DEPDIR)/libwebpdecode_la-tree.Tpo -c -o libwebpdecode_la-tree.lo `test -f 'tree.c' || echo '$(srcdir)/'`tree.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdecode_la-tree.Tpo $(DEPDIR)/libwebpdecode_la-tree.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='tree.c' object='libwebpdecode_la-tree.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdecode_la-tree.lo `test -f 'tree.c' || echo '$(srcdir)/'`tree.c\n\nlibwebpdecode_la-vp8.lo: vp8.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdecode_la-vp8.lo -MD -MP -MF $(DEPDIR)/libwebpdecode_la-vp8.Tpo -c -o libwebpdecode_la-vp8.lo `test -f 'vp8.c' || echo '$(srcdir)/'`vp8.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdecode_la-vp8.Tpo $(DEPDIR)/libwebpdecode_la-vp8.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='vp8.c' object='libwebpdecode_la-vp8.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdecode_la-vp8.lo `test -f 'vp8.c' || echo '$(srcdir)/'`vp8.c\n\nlibwebpdecode_la-vp8l.lo: vp8l.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdecode_la-vp8l.lo -MD -MP -MF $(DEPDIR)/libwebpdecode_la-vp8l.Tpo -c -o libwebpdecode_la-vp8l.lo `test -f 'vp8l.c' || echo '$(srcdir)/'`vp8l.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdecode_la-vp8l.Tpo $(DEPDIR)/libwebpdecode_la-vp8l.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='vp8l.c' object='libwebpdecode_la-vp8l.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdecode_la-vp8l.lo `test -f 'vp8l.c' || echo '$(srcdir)/'`vp8l.c\n\nlibwebpdecode_la-webp.lo: webp.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdecode_la-webp.lo -MD -MP -MF $(DEPDIR)/libwebpdecode_la-webp.Tpo -c -o libwebpdecode_la-webp.lo `test -f 'webp.c' || echo '$(srcdir)/'`webp.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdecode_la-webp.Tpo $(DEPDIR)/libwebpdecode_la-webp.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='webp.c' object='libwebpdecode_la-webp.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdecode_la-webp.lo `test -f 'webp.c' || echo '$(srcdir)/'`webp.c\n\nmostlyclean-libtool:\n\t-rm -f *.lo\n\nclean-libtool:\n\t-rm -rf .libs _libs\ninstall-libwebpdecodeincludeHEADERS: $(libwebpdecodeinclude_HEADERS)\n\t@$(NORMAL_INSTALL)\n\ttest -z \"$(libwebpdecodeincludedir)\" || $(MKDIR_P) \"$(DESTDIR)$(libwebpdecodeincludedir)\"\n\t@list='$(libwebpdecodeinclude_HEADERS)'; test -n \"$(libwebpdecodeincludedir)\" || list=; \\\n\tfor p in $$list; do \\\n\t  if test -f \"$$p\"; then d=; else d=\"$(srcdir)/\"; fi; \\\n\t  echo \"$$d$$p\"; \\\n\tdone | $(am__base_list) | \\\n\twhile read files; do \\\n\t  echo \" $(INSTALL_HEADER) $$files '$(DESTDIR)$(libwebpdecodeincludedir)'\"; \\\n\t  $(INSTALL_HEADER) $$files \"$(DESTDIR)$(libwebpdecodeincludedir)\" || exit $$?; \\\n\tdone\n\nuninstall-libwebpdecodeincludeHEADERS:\n\t@$(NORMAL_UNINSTALL)\n\t@list='$(libwebpdecodeinclude_HEADERS)'; test -n \"$(libwebpdecodeincludedir)\" || list=; \\\n\tfiles=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \\\n\tdir='$(DESTDIR)$(libwebpdecodeincludedir)'; $(am__uninstall_files_from_dir)\n\nID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)\n\tlist='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \\\n\tunique=`for i in $$list; do \\\n\t    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n\t  done | \\\n\t  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \\\n\t      END { if (nonempty) { for (i in files) print i; }; }'`; \\\n\tmkid -fID $$unique\ntags: TAGS\n\nTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \\\n\t\t$(TAGS_FILES) $(LISP)\n\tset x; \\\n\there=`pwd`; \\\n\tlist='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \\\n\tunique=`for i in $$list; do \\\n\t    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n\t  done | \\\n\t  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \\\n\t      END { if (nonempty) { for (i in files) print i; }; }'`; \\\n\tshift; \\\n\tif test -z \"$(ETAGS_ARGS)$$*$$unique\"; then :; else \\\n\t  test -n \"$$unique\" || unique=$$empty_fix; \\\n\t  if test $$# -gt 0; then \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      \"$$@\" $$unique; \\\n\t  else \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      $$unique; \\\n\t  fi; \\\n\tfi\nctags: CTAGS\nCTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \\\n\t\t$(TAGS_FILES) $(LISP)\n\tlist='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \\\n\tunique=`for i in $$list; do \\\n\t    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n\t  done | \\\n\t  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \\\n\t      END { if (nonempty) { for (i in files) print i; }; }'`; \\\n\ttest -z \"$(CTAGS_ARGS)$$unique\" \\\n\t  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \\\n\t     $$unique\n\nGTAGS:\n\there=`$(am__cd) $(top_builddir) && pwd` \\\n\t  && $(am__cd) $(top_srcdir) \\\n\t  && gtags -i $(GTAGS_ARGS) \"$$here\"\n\ndistclean-tags:\n\t-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags\n\ndistdir: $(DISTFILES)\n\t@srcdirstrip=`echo \"$(srcdir)\" | sed 's/[].[^$$\\\\*]/\\\\\\\\&/g'`; \\\n\ttopsrcdirstrip=`echo \"$(top_srcdir)\" | sed 's/[].[^$$\\\\*]/\\\\\\\\&/g'`; \\\n\tlist='$(DISTFILES)'; \\\n\t  dist_files=`for file in $$list; do echo $$file; done | \\\n\t  sed -e \"s|^$$srcdirstrip/||;t\" \\\n\t      -e \"s|^$$topsrcdirstrip/|$(top_builddir)/|;t\"`; \\\n\tcase $$dist_files in \\\n\t  */*) $(MKDIR_P) `echo \"$$dist_files\" | \\\n\t\t\t   sed '/\\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \\\n\t\t\t   sort -u` ;; \\\n\tesac; \\\n\tfor file in $$dist_files; do \\\n\t  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \\\n\t  if test -d $$d/$$file; then \\\n\t    dir=`echo \"/$$file\" | sed -e 's,/[^/]*$$,,'`; \\\n\t    if test -d \"$(distdir)/$$file\"; then \\\n\t      find \"$(distdir)/$$file\" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n\t    fi; \\\n\t    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \\\n\t      cp -fpR $(srcdir)/$$file \"$(distdir)$$dir\" || exit 1; \\\n\t      find \"$(distdir)/$$file\" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n\t    fi; \\\n\t    cp -fpR $$d/$$file \"$(distdir)$$dir\" || exit 1; \\\n\t  else \\\n\t    test -f \"$(distdir)/$$file\" \\\n\t    || cp -p $$d/$$file \"$(distdir)/$$file\" \\\n\t    || exit 1; \\\n\t  fi; \\\n\tdone\ncheck-am: all-am\ncheck: check-am\nall-am: Makefile $(LTLIBRARIES) $(HEADERS)\ninstalldirs:\n\tfor dir in \"$(DESTDIR)$(libwebpdecodeincludedir)\"; do \\\n\t  test -z \"$$dir\" || $(MKDIR_P) \"$$dir\"; \\\n\tdone\ninstall: install-am\ninstall-exec: install-exec-am\ninstall-data: install-data-am\nuninstall: uninstall-am\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-am\ninstall-strip:\n\tif test -z '$(STRIP)'; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t      install; \\\n\telse \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t    \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\" install; \\\n\tfi\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\t-test . = \"$(srcdir)\" || test -z \"$(CONFIG_CLEAN_VPATH_FILES)\" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\nclean: clean-am\n\nclean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \\\n\tmostlyclean-am\n\ndistclean: distclean-am\n\t-rm -rf ./$(DEPDIR)\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-compile distclean-generic \\\n\tdistclean-tags\n\ndvi: dvi-am\n\ndvi-am:\n\nhtml: html-am\n\nhtml-am:\n\ninfo: info-am\n\ninfo-am:\n\ninstall-data-am: install-libwebpdecodeincludeHEADERS\n\ninstall-dvi: install-dvi-am\n\ninstall-dvi-am:\n\ninstall-exec-am:\n\ninstall-html: install-html-am\n\ninstall-html-am:\n\ninstall-info: install-info-am\n\ninstall-info-am:\n\ninstall-man:\n\ninstall-pdf: install-pdf-am\n\ninstall-pdf-am:\n\ninstall-ps: install-ps-am\n\ninstall-ps-am:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-am\n\t-rm -rf ./$(DEPDIR)\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-am\n\nmostlyclean-am: mostlyclean-compile mostlyclean-generic \\\n\tmostlyclean-libtool\n\npdf: pdf-am\n\npdf-am:\n\nps: ps-am\n\nps-am:\n\nuninstall-am: uninstall-libwebpdecodeincludeHEADERS\n\n.MAKE: install-am install-strip\n\n.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \\\n\tclean-libtool clean-noinstLTLIBRARIES ctags distclean \\\n\tdistclean-compile distclean-generic distclean-libtool \\\n\tdistclean-tags distdir dvi dvi-am html html-am info info-am \\\n\tinstall install-am install-data install-data-am install-dvi \\\n\tinstall-dvi-am install-exec install-exec-am install-html \\\n\tinstall-html-am install-info install-info-am \\\n\tinstall-libwebpdecodeincludeHEADERS install-man install-pdf \\\n\tinstall-pdf-am install-ps install-ps-am install-strip \\\n\tinstallcheck installcheck-am installdirs maintainer-clean \\\n\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n\tmostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \\\n\ttags uninstall uninstall-am \\\n\tuninstall-libwebpdecodeincludeHEADERS\n\n\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "ext/libwebp/dec/alpha.c",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Alpha-plane decompression.\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include <stdlib.h>\n#include \"./alphai.h\"\n#include \"./vp8i.h\"\n#include \"./vp8li.h\"\n#include \"../utils/quant_levels_dec.h\"\n#include \"../utils/utils.h\"\n#include \"../webp/format_constants.h\"\n\n//------------------------------------------------------------------------------\n// ALPHDecoder object.\n\nALPHDecoder* ALPHNew(void) {\n  ALPHDecoder* const dec = (ALPHDecoder*)WebPSafeCalloc(1ULL, sizeof(*dec));\n  return dec;\n}\n\nvoid ALPHDelete(ALPHDecoder* const dec) {\n  if (dec != NULL) {\n    VP8LDelete(dec->vp8l_dec_);\n    dec->vp8l_dec_ = NULL;\n    WebPSafeFree(dec);\n  }\n}\n\n//------------------------------------------------------------------------------\n// Decoding.\n\n// Initialize alpha decoding by parsing the alpha header and decoding the image\n// header for alpha data stored using lossless compression.\n// Returns false in case of error in alpha header (data too short, invalid\n// compression method or filter, error in lossless header data etc).\nstatic int ALPHInit(ALPHDecoder* const dec, const uint8_t* data,\n                    size_t data_size, int width, int height, uint8_t* output) {\n  int ok = 0;\n  const uint8_t* const alpha_data = data + ALPHA_HEADER_LEN;\n  const size_t alpha_data_size = data_size - ALPHA_HEADER_LEN;\n  int rsrv;\n\n  assert(width > 0 && height > 0);\n  assert(data != NULL && output != NULL);\n\n  dec->width_ = width;\n  dec->height_ = height;\n\n  if (data_size <= ALPHA_HEADER_LEN) {\n    return 0;\n  }\n\n  dec->method_ = (data[0] >> 0) & 0x03;\n  dec->filter_ = (data[0] >> 2) & 0x03;\n  dec->pre_processing_ = (data[0] >> 4) & 0x03;\n  rsrv = (data[0] >> 6) & 0x03;\n  if (dec->method_ < ALPHA_NO_COMPRESSION ||\n      dec->method_ > ALPHA_LOSSLESS_COMPRESSION ||\n      dec->filter_ >= WEBP_FILTER_LAST ||\n      dec->pre_processing_ > ALPHA_PREPROCESSED_LEVELS ||\n      rsrv != 0) {\n    return 0;\n  }\n\n  if (dec->method_ == ALPHA_NO_COMPRESSION) {\n    const size_t alpha_decoded_size = dec->width_ * dec->height_;\n    ok = (alpha_data_size >= alpha_decoded_size);\n  } else {\n    assert(dec->method_ == ALPHA_LOSSLESS_COMPRESSION);\n    ok = VP8LDecodeAlphaHeader(dec, alpha_data, alpha_data_size, output);\n  }\n  return ok;\n}\n\n// Decodes, unfilters and dequantizes *at least* 'num_rows' rows of alpha\n// starting from row number 'row'. It assumes that rows up to (row - 1) have\n// already been decoded.\n// Returns false in case of bitstream error.\nstatic int ALPHDecode(VP8Decoder* const dec, int row, int num_rows) {\n  ALPHDecoder* const alph_dec = dec->alph_dec_;\n  const int width = alph_dec->width_;\n  const int height = alph_dec->height_;\n  WebPUnfilterFunc unfilter_func = WebPUnfilters[alph_dec->filter_];\n  uint8_t* const output = dec->alpha_plane_;\n  if (alph_dec->method_ == ALPHA_NO_COMPRESSION) {\n    const size_t offset = row * width;\n    const size_t num_pixels = num_rows * width;\n    assert(dec->alpha_data_size_ >= ALPHA_HEADER_LEN + offset + num_pixels);\n    memcpy(dec->alpha_plane_ + offset,\n           dec->alpha_data_ + ALPHA_HEADER_LEN + offset, num_pixels);\n  } else {  // alph_dec->method_ == ALPHA_LOSSLESS_COMPRESSION\n    assert(alph_dec->vp8l_dec_ != NULL);\n    if (!VP8LDecodeAlphaImageStream(alph_dec, row + num_rows)) {\n      return 0;\n    }\n  }\n\n  if (unfilter_func != NULL) {\n    unfilter_func(width, height, width, row, num_rows, output);\n  }\n\n  if (row + num_rows == dec->pic_hdr_.height_) {\n    dec->is_alpha_decoded_ = 1;\n  }\n  return 1;\n}\n\n//------------------------------------------------------------------------------\n// Main entry point.\n\nconst uint8_t* VP8DecompressAlphaRows(VP8Decoder* const dec,\n                                      int row, int num_rows) {\n  const int width = dec->pic_hdr_.width_;\n  const int height = dec->pic_hdr_.height_;\n\n  if (row < 0 || num_rows <= 0 || row + num_rows > height) {\n    return NULL;    // sanity check.\n  }\n\n  if (row == 0) {\n    // Initialize decoding.\n    assert(dec->alpha_plane_ != NULL);\n    dec->alph_dec_ = ALPHNew();\n    if (dec->alph_dec_ == NULL) return NULL;\n    if (!ALPHInit(dec->alph_dec_, dec->alpha_data_, dec->alpha_data_size_,\n                  width, height, dec->alpha_plane_)) {\n      ALPHDelete(dec->alph_dec_);\n      dec->alph_dec_ = NULL;\n      return NULL;\n    }\n    // if we allowed use of alpha dithering, check whether it's needed at all\n    if (dec->alph_dec_->pre_processing_ != ALPHA_PREPROCESSED_LEVELS) {\n      dec->alpha_dithering_ = 0;  // disable dithering\n    } else {\n      num_rows = height;          // decode everything in one pass\n    }\n  }\n\n  if (!dec->is_alpha_decoded_) {\n    int ok = 0;\n    assert(dec->alph_dec_ != NULL);\n    ok = ALPHDecode(dec, row, num_rows);\n    if (ok && dec->alpha_dithering_ > 0) {\n      ok = WebPDequantizeLevels(dec->alpha_plane_, width, height,\n                                dec->alpha_dithering_);\n    }\n    if (!ok || dec->is_alpha_decoded_) {\n      ALPHDelete(dec->alph_dec_);\n      dec->alph_dec_ = NULL;\n    }\n    if (!ok) return NULL;  // Error.\n  }\n\n  // Return a pointer to the current decoded row.\n  return dec->alpha_plane_ + row * width;\n}\n"
  },
  {
    "path": "ext/libwebp/dec/alphai.h",
    "content": "// Copyright 2013 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Alpha decoder: internal header.\n//\n// Author: Urvang (urvang@google.com)\n\n#ifndef WEBP_DEC_ALPHAI_H_\n#define WEBP_DEC_ALPHAI_H_\n\n#include \"./webpi.h\"\n#include \"../utils/filters.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nstruct VP8LDecoder;  // Defined in dec/vp8li.h.\n\ntypedef struct ALPHDecoder ALPHDecoder;\nstruct ALPHDecoder {\n  int width_;\n  int height_;\n  int method_;\n  WEBP_FILTER_TYPE filter_;\n  int pre_processing_;\n  struct VP8LDecoder* vp8l_dec_;\n  VP8Io io_;\n  int use_8b_decode;  // Although alpha channel requires only 1 byte per\n                      // pixel, sometimes VP8LDecoder may need to allocate\n                      // 4 bytes per pixel internally during decode.\n};\n\n//------------------------------------------------------------------------------\n// internal functions. Not public.\n\n// Allocates a new alpha decoder instance.\nALPHDecoder* ALPHNew(void);\n\n// Clears and deallocates an alpha decoder instance.\nvoid ALPHDelete(ALPHDecoder* const dec);\n\n//------------------------------------------------------------------------------\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_DEC_ALPHAI_H_ */\n"
  },
  {
    "path": "ext/libwebp/dec/buffer.c",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Everything about WebPDecBuffer\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include <stdlib.h>\n\n#include \"./vp8i.h\"\n#include \"./webpi.h\"\n#include \"../utils/utils.h\"\n\n//------------------------------------------------------------------------------\n// WebPDecBuffer\n\n// Number of bytes per pixel for the different color-spaces.\nstatic const int kModeBpp[MODE_LAST] = {\n  3, 4, 3, 4, 4, 2, 2,\n  4, 4, 4, 2,    // pre-multiplied modes\n  1, 1 };\n\n// Check that webp_csp_mode is within the bounds of WEBP_CSP_MODE.\n// Convert to an integer to handle both the unsigned/signed enum cases\n// without the need for casting to remove type limit warnings.\nstatic int IsValidColorspace(int webp_csp_mode) {\n  return (webp_csp_mode >= MODE_RGB && webp_csp_mode < MODE_LAST);\n}\n\nstatic VP8StatusCode CheckDecBuffer(const WebPDecBuffer* const buffer) {\n  int ok = 1;\n  const WEBP_CSP_MODE mode = buffer->colorspace;\n  const int width = buffer->width;\n  const int height = buffer->height;\n  if (!IsValidColorspace(mode)) {\n    ok = 0;\n  } else if (!WebPIsRGBMode(mode)) {   // YUV checks\n    const WebPYUVABuffer* const buf = &buffer->u.YUVA;\n    const int y_stride = abs(buf->y_stride);\n    const int u_stride = abs(buf->u_stride);\n    const int v_stride = abs(buf->v_stride);\n    const int a_stride = abs(buf->a_stride);\n    const uint64_t y_size = (uint64_t)y_stride * height;\n    const uint64_t u_size = (uint64_t)u_stride * ((height + 1) / 2);\n    const uint64_t v_size = (uint64_t)v_stride * ((height + 1) / 2);\n    const uint64_t a_size = (uint64_t)a_stride * height;\n    ok &= (y_size <= buf->y_size);\n    ok &= (u_size <= buf->u_size);\n    ok &= (v_size <= buf->v_size);\n    ok &= (y_stride >= width);\n    ok &= (u_stride >= (width + 1) / 2);\n    ok &= (v_stride >= (width + 1) / 2);\n    ok &= (buf->y != NULL);\n    ok &= (buf->u != NULL);\n    ok &= (buf->v != NULL);\n    if (mode == MODE_YUVA) {\n      ok &= (a_stride >= width);\n      ok &= (a_size <= buf->a_size);\n      ok &= (buf->a != NULL);\n    }\n  } else {    // RGB checks\n    const WebPRGBABuffer* const buf = &buffer->u.RGBA;\n    const int stride = abs(buf->stride);\n    const uint64_t size = (uint64_t)stride * height;\n    ok &= (size <= buf->size);\n    ok &= (stride >= width * kModeBpp[mode]);\n    ok &= (buf->rgba != NULL);\n  }\n  return ok ? VP8_STATUS_OK : VP8_STATUS_INVALID_PARAM;\n}\n\nstatic VP8StatusCode AllocateBuffer(WebPDecBuffer* const buffer) {\n  const int w = buffer->width;\n  const int h = buffer->height;\n  const WEBP_CSP_MODE mode = buffer->colorspace;\n\n  if (w <= 0 || h <= 0 || !IsValidColorspace(mode)) {\n    return VP8_STATUS_INVALID_PARAM;\n  }\n\n  if (!buffer->is_external_memory && buffer->private_memory == NULL) {\n    uint8_t* output;\n    int uv_stride = 0, a_stride = 0;\n    uint64_t uv_size = 0, a_size = 0, total_size;\n    // We need memory and it hasn't been allocated yet.\n    // => initialize output buffer, now that dimensions are known.\n    const int stride = w * kModeBpp[mode];\n    const uint64_t size = (uint64_t)stride * h;\n\n    if (!WebPIsRGBMode(mode)) {\n      uv_stride = (w + 1) / 2;\n      uv_size = (uint64_t)uv_stride * ((h + 1) / 2);\n      if (mode == MODE_YUVA) {\n        a_stride = w;\n        a_size = (uint64_t)a_stride * h;\n      }\n    }\n    total_size = size + 2 * uv_size + a_size;\n\n    // Security/sanity checks\n    output = (uint8_t*)WebPSafeMalloc(total_size, sizeof(*output));\n    if (output == NULL) {\n      return VP8_STATUS_OUT_OF_MEMORY;\n    }\n    buffer->private_memory = output;\n\n    if (!WebPIsRGBMode(mode)) {   // YUVA initialization\n      WebPYUVABuffer* const buf = &buffer->u.YUVA;\n      buf->y = output;\n      buf->y_stride = stride;\n      buf->y_size = (size_t)size;\n      buf->u = output + size;\n      buf->u_stride = uv_stride;\n      buf->u_size = (size_t)uv_size;\n      buf->v = output + size + uv_size;\n      buf->v_stride = uv_stride;\n      buf->v_size = (size_t)uv_size;\n      if (mode == MODE_YUVA) {\n        buf->a = output + size + 2 * uv_size;\n      }\n      buf->a_size = (size_t)a_size;\n      buf->a_stride = a_stride;\n    } else {  // RGBA initialization\n      WebPRGBABuffer* const buf = &buffer->u.RGBA;\n      buf->rgba = output;\n      buf->stride = stride;\n      buf->size = (size_t)size;\n    }\n  }\n  return CheckDecBuffer(buffer);\n}\n\nVP8StatusCode WebPFlipBuffer(WebPDecBuffer* const buffer) {\n  if (buffer == NULL) {\n    return VP8_STATUS_INVALID_PARAM;\n  }\n  if (WebPIsRGBMode(buffer->colorspace)) {\n    WebPRGBABuffer* const buf = &buffer->u.RGBA;\n    buf->rgba += (buffer->height - 1) * buf->stride;\n    buf->stride = -buf->stride;\n  } else {\n    WebPYUVABuffer* const buf = &buffer->u.YUVA;\n    const int H = buffer->height;\n    buf->y += (H - 1) * buf->y_stride;\n    buf->y_stride = -buf->y_stride;\n    buf->u += ((H - 1) >> 1) * buf->u_stride;\n    buf->u_stride = -buf->u_stride;\n    buf->v += ((H - 1) >> 1) * buf->v_stride;\n    buf->v_stride = -buf->v_stride;\n    if (buf->a != NULL) {\n      buf->a += (H - 1) * buf->a_stride;\n      buf->a_stride = -buf->a_stride;\n    }\n  }\n  return VP8_STATUS_OK;\n}\n\nVP8StatusCode WebPAllocateDecBuffer(int w, int h,\n                                    const WebPDecoderOptions* const options,\n                                    WebPDecBuffer* const out) {\n  VP8StatusCode status;\n  if (out == NULL || w <= 0 || h <= 0) {\n    return VP8_STATUS_INVALID_PARAM;\n  }\n  if (options != NULL) {    // First, apply options if there is any.\n    if (options->use_cropping) {\n      const int cw = options->crop_width;\n      const int ch = options->crop_height;\n      const int x = options->crop_left & ~1;\n      const int y = options->crop_top & ~1;\n      if (x < 0 || y < 0 || cw <= 0 || ch <= 0 || x + cw > w || y + ch > h) {\n        return VP8_STATUS_INVALID_PARAM;   // out of frame boundary.\n      }\n      w = cw;\n      h = ch;\n    }\n    if (options->use_scaling) {\n      if (options->scaled_width <= 0 || options->scaled_height <= 0) {\n        return VP8_STATUS_INVALID_PARAM;\n      }\n      w = options->scaled_width;\n      h = options->scaled_height;\n    }\n  }\n  out->width = w;\n  out->height = h;\n\n  // Then, allocate buffer for real.\n  status = AllocateBuffer(out);\n  if (status != VP8_STATUS_OK) return status;\n\n#if WEBP_DECODER_ABI_VERSION > 0x0203\n  // Use the stride trick if vertical flip is needed.\n  if (options != NULL && options->flip) {\n    status = WebPFlipBuffer(out);\n  }\n#endif\n  return status;\n}\n\n//------------------------------------------------------------------------------\n// constructors / destructors\n\nint WebPInitDecBufferInternal(WebPDecBuffer* buffer, int version) {\n  if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_DECODER_ABI_VERSION)) {\n    return 0;  // version mismatch\n  }\n  if (buffer == NULL) return 0;\n  memset(buffer, 0, sizeof(*buffer));\n  return 1;\n}\n\nvoid WebPFreeDecBuffer(WebPDecBuffer* buffer) {\n  if (buffer != NULL) {\n    if (!buffer->is_external_memory) {\n      WebPSafeFree(buffer->private_memory);\n    }\n    buffer->private_memory = NULL;\n  }\n}\n\nvoid WebPCopyDecBuffer(const WebPDecBuffer* const src,\n                       WebPDecBuffer* const dst) {\n  if (src != NULL && dst != NULL) {\n    *dst = *src;\n    if (src->private_memory != NULL) {\n      dst->is_external_memory = 1;   // dst buffer doesn't own the memory.\n      dst->private_memory = NULL;\n    }\n  }\n}\n\n// Copy and transfer ownership from src to dst (beware of parameter order!)\nvoid WebPGrabDecBuffer(WebPDecBuffer* const src, WebPDecBuffer* const dst) {\n  if (src != NULL && dst != NULL) {\n    *dst = *src;\n    if (src->private_memory != NULL) {\n      src->is_external_memory = 1;   // src relinquishes ownership\n      src->private_memory = NULL;\n    }\n  }\n}\n\n//------------------------------------------------------------------------------\n\n"
  },
  {
    "path": "ext/libwebp/dec/decode_vp8.h",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n//  Low-level API for VP8 decoder\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_WEBP_DECODE_VP8_H_\n#define WEBP_WEBP_DECODE_VP8_H_\n\n#include \"../webp/decode.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n//------------------------------------------------------------------------------\n// Lower-level API\n//\n// These functions provide fine-grained control of the decoding process.\n// The call flow should resemble:\n//\n//   VP8Io io;\n//   VP8InitIo(&io);\n//   io.data = data;\n//   io.data_size = size;\n//   /* customize io's functions (setup()/put()/teardown()) if needed. */\n//\n//   VP8Decoder* dec = VP8New();\n//   bool ok = VP8Decode(dec);\n//   if (!ok) printf(\"Error: %s\\n\", VP8StatusMessage(dec));\n//   VP8Delete(dec);\n//   return ok;\n\n// Input / Output\ntypedef struct VP8Io VP8Io;\ntypedef int (*VP8IoPutHook)(const VP8Io* io);\ntypedef int (*VP8IoSetupHook)(VP8Io* io);\ntypedef void (*VP8IoTeardownHook)(const VP8Io* io);\n\nstruct VP8Io {\n  // set by VP8GetHeaders()\n  int width, height;         // picture dimensions, in pixels (invariable).\n                             // These are the original, uncropped dimensions.\n                             // The actual area passed to put() is stored\n                             // in mb_w / mb_h fields.\n\n  // set before calling put()\n  int mb_y;                  // position of the current rows (in pixels)\n  int mb_w;                  // number of columns in the sample\n  int mb_h;                  // number of rows in the sample\n  const uint8_t* y, *u, *v;  // rows to copy (in yuv420 format)\n  int y_stride;              // row stride for luma\n  int uv_stride;             // row stride for chroma\n\n  void* opaque;              // user data\n\n  // called when fresh samples are available. Currently, samples are in\n  // YUV420 format, and can be up to width x 24 in size (depending on the\n  // in-loop filtering level, e.g.). Should return false in case of error\n  // or abort request. The actual size of the area to update is mb_w x mb_h\n  // in size, taking cropping into account.\n  VP8IoPutHook put;\n\n  // called just before starting to decode the blocks.\n  // Must return false in case of setup error, true otherwise. If false is\n  // returned, teardown() will NOT be called. But if the setup succeeded\n  // and true is returned, then teardown() will always be called afterward.\n  VP8IoSetupHook setup;\n\n  // Called just after block decoding is finished (or when an error occurred\n  // during put()). Is NOT called if setup() failed.\n  VP8IoTeardownHook teardown;\n\n  // this is a recommendation for the user-side yuv->rgb converter. This flag\n  // is set when calling setup() hook and can be overwritten by it. It then\n  // can be taken into consideration during the put() method.\n  int fancy_upsampling;\n\n  // Input buffer.\n  size_t data_size;\n  const uint8_t* data;\n\n  // If true, in-loop filtering will not be performed even if present in the\n  // bitstream. Switching off filtering may speed up decoding at the expense\n  // of more visible blocking. Note that output will also be non-compliant\n  // with the VP8 specifications.\n  int bypass_filtering;\n\n  // Cropping parameters.\n  int use_cropping;\n  int crop_left, crop_right, crop_top, crop_bottom;\n\n  // Scaling parameters.\n  int use_scaling;\n  int scaled_width, scaled_height;\n\n  // If non NULL, pointer to the alpha data (if present) corresponding to the\n  // start of the current row (That is: it is pre-offset by mb_y and takes\n  // cropping into account).\n  const uint8_t* a;\n};\n\n// Internal, version-checked, entry point\nint VP8InitIoInternal(VP8Io* const, int);\n\n// Set the custom IO function pointers and user-data. The setter for IO hooks\n// should be called before initiating incremental decoding. Returns true if\n// WebPIDecoder object is successfully modified, false otherwise.\nint WebPISetIOHooks(WebPIDecoder* const idec,\n                    VP8IoPutHook put,\n                    VP8IoSetupHook setup,\n                    VP8IoTeardownHook teardown,\n                    void* user_data);\n\n// Main decoding object. This is an opaque structure.\ntypedef struct VP8Decoder VP8Decoder;\n\n// Create a new decoder object.\nVP8Decoder* VP8New(void);\n\n// Must be called to make sure 'io' is initialized properly.\n// Returns false in case of version mismatch. Upon such failure, no other\n// decoding function should be called (VP8Decode, VP8GetHeaders, ...)\nstatic WEBP_INLINE int VP8InitIo(VP8Io* const io) {\n  return VP8InitIoInternal(io, WEBP_DECODER_ABI_VERSION);\n}\n\n// Decode the VP8 frame header. Returns true if ok.\n// Note: 'io->data' must be pointing to the start of the VP8 frame header.\nint VP8GetHeaders(VP8Decoder* const dec, VP8Io* const io);\n\n// Decode a picture. Will call VP8GetHeaders() if it wasn't done already.\n// Returns false in case of error.\nint VP8Decode(VP8Decoder* const dec, VP8Io* const io);\n\n// Return current status of the decoder:\nVP8StatusCode VP8Status(VP8Decoder* const dec);\n\n// return readable string corresponding to the last status.\nconst char* VP8StatusMessage(VP8Decoder* const dec);\n\n// Resets the decoder in its initial state, reclaiming memory.\n// Not a mandatory call between calls to VP8Decode().\nvoid VP8Clear(VP8Decoder* const dec);\n\n// Destroy the decoder object.\nvoid VP8Delete(VP8Decoder* const dec);\n\n//------------------------------------------------------------------------------\n// Miscellaneous VP8/VP8L bitstream probing functions.\n\n// Returns true if the next 3 bytes in data contain the VP8 signature.\nWEBP_EXTERN(int) VP8CheckSignature(const uint8_t* const data, size_t data_size);\n\n// Validates the VP8 data-header and retrieves basic header information viz\n// width and height. Returns 0 in case of formatting error. *width/*height\n// can be passed NULL.\nWEBP_EXTERN(int) VP8GetInfo(\n    const uint8_t* data,\n    size_t data_size,    // data available so far\n    size_t chunk_size,   // total data size expected in the chunk\n    int* const width, int* const height);\n\n// Returns true if the next byte(s) in data is a VP8L signature.\nWEBP_EXTERN(int) VP8LCheckSignature(const uint8_t* const data, size_t size);\n\n// Validates the VP8L data-header and retrieves basic header information viz\n// width, height and alpha. Returns 0 in case of formatting error.\n// width/height/has_alpha can be passed NULL.\nWEBP_EXTERN(int) VP8LGetInfo(\n    const uint8_t* data, size_t data_size,  // data available so far\n    int* const width, int* const height, int* const has_alpha);\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_WEBP_DECODE_VP8_H_ */\n"
  },
  {
    "path": "ext/libwebp/dec/frame.c",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Frame-reconstruction function. Memory allocation.\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include <stdlib.h>\n#include \"./vp8i.h\"\n#include \"../utils/utils.h\"\n\n#define ALIGN_MASK (32 - 1)\n\nstatic void ReconstructRow(const VP8Decoder* const dec,\n                           const VP8ThreadContext* ctx);  // TODO(skal): remove\n\n//------------------------------------------------------------------------------\n// Filtering\n\n// kFilterExtraRows[] = How many extra lines are needed on the MB boundary\n// for caching, given a filtering level.\n// Simple filter:  up to 2 luma samples are read and 1 is written.\n// Complex filter: up to 4 luma samples are read and 3 are written. Same for\n//                 U/V, so it's 8 samples total (because of the 2x upsampling).\nstatic const uint8_t kFilterExtraRows[3] = { 0, 2, 8 };\n\nstatic void DoFilter(const VP8Decoder* const dec, int mb_x, int mb_y) {\n  const VP8ThreadContext* const ctx = &dec->thread_ctx_;\n  const int cache_id = ctx->id_;\n  const int y_bps = dec->cache_y_stride_;\n  const VP8FInfo* const f_info = ctx->f_info_ + mb_x;\n  uint8_t* const y_dst = dec->cache_y_ + cache_id * 16 * y_bps + mb_x * 16;\n  const int ilevel = f_info->f_ilevel_;\n  const int limit = f_info->f_limit_;\n  if (limit == 0) {\n    return;\n  }\n  assert(limit >= 3);\n  if (dec->filter_type_ == 1) {   // simple\n    if (mb_x > 0) {\n      VP8SimpleHFilter16(y_dst, y_bps, limit + 4);\n    }\n    if (f_info->f_inner_) {\n      VP8SimpleHFilter16i(y_dst, y_bps, limit);\n    }\n    if (mb_y > 0) {\n      VP8SimpleVFilter16(y_dst, y_bps, limit + 4);\n    }\n    if (f_info->f_inner_) {\n      VP8SimpleVFilter16i(y_dst, y_bps, limit);\n    }\n  } else {    // complex\n    const int uv_bps = dec->cache_uv_stride_;\n    uint8_t* const u_dst = dec->cache_u_ + cache_id * 8 * uv_bps + mb_x * 8;\n    uint8_t* const v_dst = dec->cache_v_ + cache_id * 8 * uv_bps + mb_x * 8;\n    const int hev_thresh = f_info->hev_thresh_;\n    if (mb_x > 0) {\n      VP8HFilter16(y_dst, y_bps, limit + 4, ilevel, hev_thresh);\n      VP8HFilter8(u_dst, v_dst, uv_bps, limit + 4, ilevel, hev_thresh);\n    }\n    if (f_info->f_inner_) {\n      VP8HFilter16i(y_dst, y_bps, limit, ilevel, hev_thresh);\n      VP8HFilter8i(u_dst, v_dst, uv_bps, limit, ilevel, hev_thresh);\n    }\n    if (mb_y > 0) {\n      VP8VFilter16(y_dst, y_bps, limit + 4, ilevel, hev_thresh);\n      VP8VFilter8(u_dst, v_dst, uv_bps, limit + 4, ilevel, hev_thresh);\n    }\n    if (f_info->f_inner_) {\n      VP8VFilter16i(y_dst, y_bps, limit, ilevel, hev_thresh);\n      VP8VFilter8i(u_dst, v_dst, uv_bps, limit, ilevel, hev_thresh);\n    }\n  }\n}\n\n// Filter the decoded macroblock row (if needed)\nstatic void FilterRow(const VP8Decoder* const dec) {\n  int mb_x;\n  const int mb_y = dec->thread_ctx_.mb_y_;\n  assert(dec->thread_ctx_.filter_row_);\n  for (mb_x = dec->tl_mb_x_; mb_x < dec->br_mb_x_; ++mb_x) {\n    DoFilter(dec, mb_x, mb_y);\n  }\n}\n\n//------------------------------------------------------------------------------\n// Precompute the filtering strength for each segment and each i4x4/i16x16 mode.\n\nstatic void PrecomputeFilterStrengths(VP8Decoder* const dec) {\n  if (dec->filter_type_ > 0) {\n    int s;\n    const VP8FilterHeader* const hdr = &dec->filter_hdr_;\n    for (s = 0; s < NUM_MB_SEGMENTS; ++s) {\n      int i4x4;\n      // First, compute the initial level\n      int base_level;\n      if (dec->segment_hdr_.use_segment_) {\n        base_level = dec->segment_hdr_.filter_strength_[s];\n        if (!dec->segment_hdr_.absolute_delta_) {\n          base_level += hdr->level_;\n        }\n      } else {\n        base_level = hdr->level_;\n      }\n      for (i4x4 = 0; i4x4 <= 1; ++i4x4) {\n        VP8FInfo* const info = &dec->fstrengths_[s][i4x4];\n        int level = base_level;\n        if (hdr->use_lf_delta_) {\n          // TODO(skal): only CURRENT is handled for now.\n          level += hdr->ref_lf_delta_[0];\n          if (i4x4) {\n            level += hdr->mode_lf_delta_[0];\n          }\n        }\n        level = (level < 0) ? 0 : (level > 63) ? 63 : level;\n        if (level > 0) {\n          int ilevel = level;\n          if (hdr->sharpness_ > 0) {\n            if (hdr->sharpness_ > 4) {\n              ilevel >>= 2;\n            } else {\n              ilevel >>= 1;\n            }\n            if (ilevel > 9 - hdr->sharpness_) {\n              ilevel = 9 - hdr->sharpness_;\n            }\n          }\n          if (ilevel < 1) ilevel = 1;\n          info->f_ilevel_ = ilevel;\n          info->f_limit_ = 2 * level + ilevel;\n          info->hev_thresh_ = (level >= 40) ? 2 : (level >= 15) ? 1 : 0;\n        } else {\n          info->f_limit_ = 0;  // no filtering\n        }\n        info->f_inner_ = i4x4;\n      }\n    }\n  }\n}\n\n//------------------------------------------------------------------------------\n// Dithering\n\n#define DITHER_AMP_TAB_SIZE 12\nstatic const int kQuantToDitherAmp[DITHER_AMP_TAB_SIZE] = {\n  // roughly, it's dqm->uv_mat_[1]\n  8, 7, 6, 4, 4, 2, 2, 2, 1, 1, 1, 1\n};\n\nvoid VP8InitDithering(const WebPDecoderOptions* const options,\n                      VP8Decoder* const dec) {\n  assert(dec != NULL);\n  if (options != NULL) {\n    const int d = options->dithering_strength;\n    const int max_amp = (1 << VP8_RANDOM_DITHER_FIX) - 1;\n    const int f = (d < 0) ? 0 : (d > 100) ? max_amp : (d * max_amp / 100);\n    if (f > 0) {\n      int s;\n      int all_amp = 0;\n      for (s = 0; s < NUM_MB_SEGMENTS; ++s) {\n        VP8QuantMatrix* const dqm = &dec->dqm_[s];\n        if (dqm->uv_quant_ < DITHER_AMP_TAB_SIZE) {\n          // TODO(skal): should we specially dither more for uv_quant_ < 0?\n          const int idx = (dqm->uv_quant_ < 0) ? 0 : dqm->uv_quant_;\n          dqm->dither_ = (f * kQuantToDitherAmp[idx]) >> 3;\n        }\n        all_amp |= dqm->dither_;\n      }\n      if (all_amp != 0) {\n        VP8InitRandom(&dec->dithering_rg_, 1.0f);\n        dec->dither_ = 1;\n      }\n    }\n#if WEBP_DECODER_ABI_VERSION > 0x0204\n    // potentially allow alpha dithering\n    dec->alpha_dithering_ = options->alpha_dithering_strength;\n    if (dec->alpha_dithering_ > 100) {\n      dec->alpha_dithering_ = 100;\n    } else if (dec->alpha_dithering_ < 0) {\n      dec->alpha_dithering_ = 0;\n    }\n#endif\n  }\n}\n\n// minimal amp that will provide a non-zero dithering effect\n#define MIN_DITHER_AMP 4\n#define DITHER_DESCALE 4\n#define DITHER_DESCALE_ROUNDER (1 << (DITHER_DESCALE - 1))\n#define DITHER_AMP_BITS 8\n#define DITHER_AMP_CENTER (1 << DITHER_AMP_BITS)\n\nstatic void Dither8x8(VP8Random* const rg, uint8_t* dst, int bps, int amp) {\n  int i, j;\n  for (j = 0; j < 8; ++j) {\n    for (i = 0; i < 8; ++i) {\n      // TODO: could be made faster with SSE2\n      const int bits =\n          VP8RandomBits2(rg, DITHER_AMP_BITS + 1, amp) - DITHER_AMP_CENTER;\n      // Convert to range: [-2,2] for dither=50, [-4,4] for dither=100\n      const int delta = (bits + DITHER_DESCALE_ROUNDER) >> DITHER_DESCALE;\n      const int v = (int)dst[i] + delta;\n      dst[i] = (v < 0) ? 0 : (v > 255) ? 255u : (uint8_t)v;\n    }\n    dst += bps;\n  }\n}\n\nstatic void DitherRow(VP8Decoder* const dec) {\n  int mb_x;\n  assert(dec->dither_);\n  for (mb_x = dec->tl_mb_x_; mb_x < dec->br_mb_x_; ++mb_x) {\n    const VP8ThreadContext* const ctx = &dec->thread_ctx_;\n    const VP8MBData* const data = ctx->mb_data_ + mb_x;\n    const int cache_id = ctx->id_;\n    const int uv_bps = dec->cache_uv_stride_;\n    if (data->dither_ >= MIN_DITHER_AMP) {\n      uint8_t* const u_dst = dec->cache_u_ + cache_id * 8 * uv_bps + mb_x * 8;\n      uint8_t* const v_dst = dec->cache_v_ + cache_id * 8 * uv_bps + mb_x * 8;\n      Dither8x8(&dec->dithering_rg_, u_dst, uv_bps, data->dither_);\n      Dither8x8(&dec->dithering_rg_, v_dst, uv_bps, data->dither_);\n    }\n  }\n}\n\n//------------------------------------------------------------------------------\n// This function is called after a row of macroblocks is finished decoding.\n// It also takes into account the following restrictions:\n//  * In case of in-loop filtering, we must hold off sending some of the bottom\n//    pixels as they are yet unfiltered. They will be when the next macroblock\n//    row is decoded. Meanwhile, we must preserve them by rotating them in the\n//    cache area. This doesn't hold for the very bottom row of the uncropped\n//    picture of course.\n//  * we must clip the remaining pixels against the cropping area. The VP8Io\n//    struct must have the following fields set correctly before calling put():\n\n#define MACROBLOCK_VPOS(mb_y)  ((mb_y) * 16)    // vertical position of a MB\n\n// Finalize and transmit a complete row. Return false in case of user-abort.\nstatic int FinishRow(VP8Decoder* const dec, VP8Io* const io) {\n  int ok = 1;\n  const VP8ThreadContext* const ctx = &dec->thread_ctx_;\n  const int cache_id = ctx->id_;\n  const int extra_y_rows = kFilterExtraRows[dec->filter_type_];\n  const int ysize = extra_y_rows * dec->cache_y_stride_;\n  const int uvsize = (extra_y_rows / 2) * dec->cache_uv_stride_;\n  const int y_offset = cache_id * 16 * dec->cache_y_stride_;\n  const int uv_offset = cache_id * 8 * dec->cache_uv_stride_;\n  uint8_t* const ydst = dec->cache_y_ - ysize + y_offset;\n  uint8_t* const udst = dec->cache_u_ - uvsize + uv_offset;\n  uint8_t* const vdst = dec->cache_v_ - uvsize + uv_offset;\n  const int mb_y = ctx->mb_y_;\n  const int is_first_row = (mb_y == 0);\n  const int is_last_row = (mb_y >= dec->br_mb_y_ - 1);\n\n  if (dec->mt_method_ == 2) {\n    ReconstructRow(dec, ctx);\n  }\n\n  if (ctx->filter_row_) {\n    FilterRow(dec);\n  }\n\n  if (dec->dither_) {\n    DitherRow(dec);\n  }\n\n  if (io->put != NULL) {\n    int y_start = MACROBLOCK_VPOS(mb_y);\n    int y_end = MACROBLOCK_VPOS(mb_y + 1);\n    if (!is_first_row) {\n      y_start -= extra_y_rows;\n      io->y = ydst;\n      io->u = udst;\n      io->v = vdst;\n    } else {\n      io->y = dec->cache_y_ + y_offset;\n      io->u = dec->cache_u_ + uv_offset;\n      io->v = dec->cache_v_ + uv_offset;\n    }\n\n    if (!is_last_row) {\n      y_end -= extra_y_rows;\n    }\n    if (y_end > io->crop_bottom) {\n      y_end = io->crop_bottom;    // make sure we don't overflow on last row.\n    }\n    io->a = NULL;\n    if (dec->alpha_data_ != NULL && y_start < y_end) {\n      // TODO(skal): testing presence of alpha with dec->alpha_data_ is not a\n      // good idea.\n      io->a = VP8DecompressAlphaRows(dec, y_start, y_end - y_start);\n      if (io->a == NULL) {\n        return VP8SetError(dec, VP8_STATUS_BITSTREAM_ERROR,\n                           \"Could not decode alpha data.\");\n      }\n    }\n    if (y_start < io->crop_top) {\n      const int delta_y = io->crop_top - y_start;\n      y_start = io->crop_top;\n      assert(!(delta_y & 1));\n      io->y += dec->cache_y_stride_ * delta_y;\n      io->u += dec->cache_uv_stride_ * (delta_y >> 1);\n      io->v += dec->cache_uv_stride_ * (delta_y >> 1);\n      if (io->a != NULL) {\n        io->a += io->width * delta_y;\n      }\n    }\n    if (y_start < y_end) {\n      io->y += io->crop_left;\n      io->u += io->crop_left >> 1;\n      io->v += io->crop_left >> 1;\n      if (io->a != NULL) {\n        io->a += io->crop_left;\n      }\n      io->mb_y = y_start - io->crop_top;\n      io->mb_w = io->crop_right - io->crop_left;\n      io->mb_h = y_end - y_start;\n      ok = io->put(io);\n    }\n  }\n  // rotate top samples if needed\n  if (cache_id + 1 == dec->num_caches_) {\n    if (!is_last_row) {\n      memcpy(dec->cache_y_ - ysize, ydst + 16 * dec->cache_y_stride_, ysize);\n      memcpy(dec->cache_u_ - uvsize, udst + 8 * dec->cache_uv_stride_, uvsize);\n      memcpy(dec->cache_v_ - uvsize, vdst + 8 * dec->cache_uv_stride_, uvsize);\n    }\n  }\n\n  return ok;\n}\n\n#undef MACROBLOCK_VPOS\n\n//------------------------------------------------------------------------------\n\nint VP8ProcessRow(VP8Decoder* const dec, VP8Io* const io) {\n  int ok = 1;\n  VP8ThreadContext* const ctx = &dec->thread_ctx_;\n  const int filter_row =\n      (dec->filter_type_ > 0) &&\n      (dec->mb_y_ >= dec->tl_mb_y_) && (dec->mb_y_ <= dec->br_mb_y_);\n  if (dec->mt_method_ == 0) {\n    // ctx->id_ and ctx->f_info_ are already set\n    ctx->mb_y_ = dec->mb_y_;\n    ctx->filter_row_ = filter_row;\n    ReconstructRow(dec, ctx);\n    ok = FinishRow(dec, io);\n  } else {\n    WebPWorker* const worker = &dec->worker_;\n    // Finish previous job *before* updating context\n    ok &= WebPGetWorkerInterface()->Sync(worker);\n    assert(worker->status_ == OK);\n    if (ok) {   // spawn a new deblocking/output job\n      ctx->io_ = *io;\n      ctx->id_ = dec->cache_id_;\n      ctx->mb_y_ = dec->mb_y_;\n      ctx->filter_row_ = filter_row;\n      if (dec->mt_method_ == 2) {  // swap macroblock data\n        VP8MBData* const tmp = ctx->mb_data_;\n        ctx->mb_data_ = dec->mb_data_;\n        dec->mb_data_ = tmp;\n      } else {\n        // perform reconstruction directly in main thread\n        ReconstructRow(dec, ctx);\n      }\n      if (filter_row) {            // swap filter info\n        VP8FInfo* const tmp = ctx->f_info_;\n        ctx->f_info_ = dec->f_info_;\n        dec->f_info_ = tmp;\n      }\n      // (reconstruct)+filter in parallel\n      WebPGetWorkerInterface()->Launch(worker);\n      if (++dec->cache_id_ == dec->num_caches_) {\n        dec->cache_id_ = 0;\n      }\n    }\n  }\n  return ok;\n}\n\n//------------------------------------------------------------------------------\n// Finish setting up the decoding parameter once user's setup() is called.\n\nVP8StatusCode VP8EnterCritical(VP8Decoder* const dec, VP8Io* const io) {\n  // Call setup() first. This may trigger additional decoding features on 'io'.\n  // Note: Afterward, we must call teardown() no matter what.\n  if (io->setup != NULL && !io->setup(io)) {\n    VP8SetError(dec, VP8_STATUS_USER_ABORT, \"Frame setup failed\");\n    return dec->status_;\n  }\n\n  // Disable filtering per user request\n  if (io->bypass_filtering) {\n    dec->filter_type_ = 0;\n  }\n  // TODO(skal): filter type / strength / sharpness forcing\n\n  // Define the area where we can skip in-loop filtering, in case of cropping.\n  //\n  // 'Simple' filter reads two luma samples outside of the macroblock\n  // and filters one. It doesn't filter the chroma samples. Hence, we can\n  // avoid doing the in-loop filtering before crop_top/crop_left position.\n  // For the 'Complex' filter, 3 samples are read and up to 3 are filtered.\n  // Means: there's a dependency chain that goes all the way up to the\n  // top-left corner of the picture (MB #0). We must filter all the previous\n  // macroblocks.\n  // TODO(skal): add an 'approximate_decoding' option, that won't produce\n  // a 1:1 bit-exactness for complex filtering?\n  {\n    const int extra_pixels = kFilterExtraRows[dec->filter_type_];\n    if (dec->filter_type_ == 2) {\n      // For complex filter, we need to preserve the dependency chain.\n      dec->tl_mb_x_ = 0;\n      dec->tl_mb_y_ = 0;\n    } else {\n      // For simple filter, we can filter only the cropped region.\n      // We include 'extra_pixels' on the other side of the boundary, since\n      // vertical or horizontal filtering of the previous macroblock can\n      // modify some abutting pixels.\n      dec->tl_mb_x_ = (io->crop_left - extra_pixels) >> 4;\n      dec->tl_mb_y_ = (io->crop_top - extra_pixels) >> 4;\n      if (dec->tl_mb_x_ < 0) dec->tl_mb_x_ = 0;\n      if (dec->tl_mb_y_ < 0) dec->tl_mb_y_ = 0;\n    }\n    // We need some 'extra' pixels on the right/bottom.\n    dec->br_mb_y_ = (io->crop_bottom + 15 + extra_pixels) >> 4;\n    dec->br_mb_x_ = (io->crop_right + 15 + extra_pixels) >> 4;\n    if (dec->br_mb_x_ > dec->mb_w_) {\n      dec->br_mb_x_ = dec->mb_w_;\n    }\n    if (dec->br_mb_y_ > dec->mb_h_) {\n      dec->br_mb_y_ = dec->mb_h_;\n    }\n  }\n  PrecomputeFilterStrengths(dec);\n  return VP8_STATUS_OK;\n}\n\nint VP8ExitCritical(VP8Decoder* const dec, VP8Io* const io) {\n  int ok = 1;\n  if (dec->mt_method_ > 0) {\n    ok = WebPGetWorkerInterface()->Sync(&dec->worker_);\n  }\n\n  if (io->teardown != NULL) {\n    io->teardown(io);\n  }\n  return ok;\n}\n\n//------------------------------------------------------------------------------\n// For multi-threaded decoding we need to use 3 rows of 16 pixels as delay line.\n//\n// Reason is: the deblocking filter cannot deblock the bottom horizontal edges\n// immediately, and needs to wait for first few rows of the next macroblock to\n// be decoded. Hence, deblocking is lagging behind by 4 or 8 pixels (depending\n// on strength).\n// With two threads, the vertical positions of the rows being decoded are:\n// Decode:  [ 0..15][16..31][32..47][48..63][64..79][...\n// Deblock:         [ 0..11][12..27][28..43][44..59][...\n// If we use two threads and two caches of 16 pixels, the sequence would be:\n// Decode:  [ 0..15][16..31][ 0..15!!][16..31][ 0..15][...\n// Deblock:         [ 0..11][12..27!!][-4..11][12..27][...\n// The problem occurs during row [12..15!!] that both the decoding and\n// deblocking threads are writing simultaneously.\n// With 3 cache lines, one get a safe write pattern:\n// Decode:  [ 0..15][16..31][32..47][ 0..15][16..31][32..47][0..\n// Deblock:         [ 0..11][12..27][28..43][-4..11][12..27][28...\n// Note that multi-threaded output _without_ deblocking can make use of two\n// cache lines of 16 pixels only, since there's no lagging behind. The decoding\n// and output process have non-concurrent writing:\n// Decode:  [ 0..15][16..31][ 0..15][16..31][...\n// io->put:         [ 0..15][16..31][ 0..15][...\n\n#define MT_CACHE_LINES 3\n#define ST_CACHE_LINES 1   // 1 cache row only for single-threaded case\n\n// Initialize multi/single-thread worker\nstatic int InitThreadContext(VP8Decoder* const dec) {\n  dec->cache_id_ = 0;\n  if (dec->mt_method_ > 0) {\n    WebPWorker* const worker = &dec->worker_;\n    if (!WebPGetWorkerInterface()->Reset(worker)) {\n      return VP8SetError(dec, VP8_STATUS_OUT_OF_MEMORY,\n                         \"thread initialization failed.\");\n    }\n    worker->data1 = dec;\n    worker->data2 = (void*)&dec->thread_ctx_.io_;\n    worker->hook = (WebPWorkerHook)FinishRow;\n    dec->num_caches_ =\n      (dec->filter_type_ > 0) ? MT_CACHE_LINES : MT_CACHE_LINES - 1;\n  } else {\n    dec->num_caches_ = ST_CACHE_LINES;\n  }\n  return 1;\n}\n\nint VP8GetThreadMethod(const WebPDecoderOptions* const options,\n                       const WebPHeaderStructure* const headers,\n                       int width, int height) {\n  if (options == NULL || options->use_threads == 0) {\n    return 0;\n  }\n  (void)headers;\n  (void)width;\n  (void)height;\n  assert(headers == NULL || !headers->is_lossless);\n#if defined(WEBP_USE_THREAD)\n  if (width < MIN_WIDTH_FOR_THREADS) return 0;\n  // TODO(skal): tune the heuristic further\n#if 0\n  if (height < 2 * width) return 2;\n#endif\n  return 2;\n#else   // !WEBP_USE_THREAD\n  return 0;\n#endif\n}\n\n#undef MT_CACHE_LINES\n#undef ST_CACHE_LINES\n\n//------------------------------------------------------------------------------\n// Memory setup\n\nstatic int AllocateMemory(VP8Decoder* const dec) {\n  const int num_caches = dec->num_caches_;\n  const int mb_w = dec->mb_w_;\n  // Note: we use 'size_t' when there's no overflow risk, uint64_t otherwise.\n  const size_t intra_pred_mode_size = 4 * mb_w * sizeof(uint8_t);\n  const size_t top_size = sizeof(VP8TopSamples) * mb_w;\n  const size_t mb_info_size = (mb_w + 1) * sizeof(VP8MB);\n  const size_t f_info_size =\n      (dec->filter_type_ > 0) ?\n          mb_w * (dec->mt_method_ > 0 ? 2 : 1) * sizeof(VP8FInfo)\n        : 0;\n  const size_t yuv_size = YUV_SIZE * sizeof(*dec->yuv_b_);\n  const size_t mb_data_size =\n      (dec->mt_method_ == 2 ? 2 : 1) * mb_w * sizeof(*dec->mb_data_);\n  const size_t cache_height = (16 * num_caches\n                            + kFilterExtraRows[dec->filter_type_]) * 3 / 2;\n  const size_t cache_size = top_size * cache_height;\n  // alpha_size is the only one that scales as width x height.\n  const uint64_t alpha_size = (dec->alpha_data_ != NULL) ?\n      (uint64_t)dec->pic_hdr_.width_ * dec->pic_hdr_.height_ : 0ULL;\n  const uint64_t needed = (uint64_t)intra_pred_mode_size\n                        + top_size + mb_info_size + f_info_size\n                        + yuv_size + mb_data_size\n                        + cache_size + alpha_size + ALIGN_MASK;\n  uint8_t* mem;\n\n  if (needed != (size_t)needed) return 0;  // check for overflow\n  if (needed > dec->mem_size_) {\n    WebPSafeFree(dec->mem_);\n    dec->mem_size_ = 0;\n    dec->mem_ = WebPSafeMalloc(needed, sizeof(uint8_t));\n    if (dec->mem_ == NULL) {\n      return VP8SetError(dec, VP8_STATUS_OUT_OF_MEMORY,\n                         \"no memory during frame initialization.\");\n    }\n    // down-cast is ok, thanks to WebPSafeAlloc() above.\n    dec->mem_size_ = (size_t)needed;\n  }\n\n  mem = (uint8_t*)dec->mem_;\n  dec->intra_t_ = (uint8_t*)mem;\n  mem += intra_pred_mode_size;\n\n  dec->yuv_t_ = (VP8TopSamples*)mem;\n  mem += top_size;\n\n  dec->mb_info_ = ((VP8MB*)mem) + 1;\n  mem += mb_info_size;\n\n  dec->f_info_ = f_info_size ? (VP8FInfo*)mem : NULL;\n  mem += f_info_size;\n  dec->thread_ctx_.id_ = 0;\n  dec->thread_ctx_.f_info_ = dec->f_info_;\n  if (dec->mt_method_ > 0) {\n    // secondary cache line. The deblocking process need to make use of the\n    // filtering strength from previous macroblock row, while the new ones\n    // are being decoded in parallel. We'll just swap the pointers.\n    dec->thread_ctx_.f_info_ += mb_w;\n  }\n\n  mem = (uint8_t*)((uintptr_t)(mem + ALIGN_MASK) & ~ALIGN_MASK);\n  assert((yuv_size & ALIGN_MASK) == 0);\n  dec->yuv_b_ = (uint8_t*)mem;\n  mem += yuv_size;\n\n  dec->mb_data_ = (VP8MBData*)mem;\n  dec->thread_ctx_.mb_data_ = (VP8MBData*)mem;\n  if (dec->mt_method_ == 2) {\n    dec->thread_ctx_.mb_data_ += mb_w;\n  }\n  mem += mb_data_size;\n\n  dec->cache_y_stride_ = 16 * mb_w;\n  dec->cache_uv_stride_ = 8 * mb_w;\n  {\n    const int extra_rows = kFilterExtraRows[dec->filter_type_];\n    const int extra_y = extra_rows * dec->cache_y_stride_;\n    const int extra_uv = (extra_rows / 2) * dec->cache_uv_stride_;\n    dec->cache_y_ = ((uint8_t*)mem) + extra_y;\n    dec->cache_u_ = dec->cache_y_\n                  + 16 * num_caches * dec->cache_y_stride_ + extra_uv;\n    dec->cache_v_ = dec->cache_u_\n                  + 8 * num_caches * dec->cache_uv_stride_ + extra_uv;\n    dec->cache_id_ = 0;\n  }\n  mem += cache_size;\n\n  // alpha plane\n  dec->alpha_plane_ = alpha_size ? (uint8_t*)mem : NULL;\n  mem += alpha_size;\n  assert(mem <= (uint8_t*)dec->mem_ + dec->mem_size_);\n\n  // note: left/top-info is initialized once for all.\n  memset(dec->mb_info_ - 1, 0, mb_info_size);\n  VP8InitScanline(dec);   // initialize left too.\n\n  // initialize top\n  memset(dec->intra_t_, B_DC_PRED, intra_pred_mode_size);\n\n  return 1;\n}\n\nstatic void InitIo(VP8Decoder* const dec, VP8Io* io) {\n  // prepare 'io'\n  io->mb_y = 0;\n  io->y = dec->cache_y_;\n  io->u = dec->cache_u_;\n  io->v = dec->cache_v_;\n  io->y_stride = dec->cache_y_stride_;\n  io->uv_stride = dec->cache_uv_stride_;\n  io->a = NULL;\n}\n\nint VP8InitFrame(VP8Decoder* const dec, VP8Io* io) {\n  if (!InitThreadContext(dec)) return 0;  // call first. Sets dec->num_caches_.\n  if (!AllocateMemory(dec)) return 0;\n  InitIo(dec, io);\n  VP8DspInit();  // Init critical function pointers and look-up tables.\n  return 1;\n}\n\n//------------------------------------------------------------------------------\n// Main reconstruction function.\n\nstatic const int kScan[16] = {\n  0 +  0 * BPS,  4 +  0 * BPS, 8 +  0 * BPS, 12 +  0 * BPS,\n  0 +  4 * BPS,  4 +  4 * BPS, 8 +  4 * BPS, 12 +  4 * BPS,\n  0 +  8 * BPS,  4 +  8 * BPS, 8 +  8 * BPS, 12 +  8 * BPS,\n  0 + 12 * BPS,  4 + 12 * BPS, 8 + 12 * BPS, 12 + 12 * BPS\n};\n\nstatic int CheckMode(int mb_x, int mb_y, int mode) {\n  if (mode == B_DC_PRED) {\n    if (mb_x == 0) {\n      return (mb_y == 0) ? B_DC_PRED_NOTOPLEFT : B_DC_PRED_NOLEFT;\n    } else {\n      return (mb_y == 0) ? B_DC_PRED_NOTOP : B_DC_PRED;\n    }\n  }\n  return mode;\n}\n\nstatic void Copy32b(uint8_t* dst, uint8_t* src) {\n  memcpy(dst, src, 4);\n}\n\nstatic WEBP_INLINE void DoTransform(uint32_t bits, const int16_t* const src,\n                                    uint8_t* const dst) {\n  switch (bits >> 30) {\n    case 3:\n      VP8Transform(src, dst, 0);\n      break;\n    case 2:\n      VP8TransformAC3(src, dst);\n      break;\n    case 1:\n      VP8TransformDC(src, dst);\n      break;\n    default:\n      break;\n  }\n}\n\nstatic void DoUVTransform(uint32_t bits, const int16_t* const src,\n                          uint8_t* const dst) {\n  if (bits & 0xff) {    // any non-zero coeff at all?\n    if (bits & 0xaa) {  // any non-zero AC coefficient?\n      VP8TransformUV(src, dst);   // note we don't use the AC3 variant for U/V\n    } else {\n      VP8TransformDCUV(src, dst);\n    }\n  }\n}\n\nstatic void ReconstructRow(const VP8Decoder* const dec,\n                           const VP8ThreadContext* ctx) {\n  int j;\n  int mb_x;\n  const int mb_y = ctx->mb_y_;\n  const int cache_id = ctx->id_;\n  uint8_t* const y_dst = dec->yuv_b_ + Y_OFF;\n  uint8_t* const u_dst = dec->yuv_b_ + U_OFF;\n  uint8_t* const v_dst = dec->yuv_b_ + V_OFF;\n  for (mb_x = 0; mb_x < dec->mb_w_; ++mb_x) {\n    const VP8MBData* const block = ctx->mb_data_ + mb_x;\n\n    // Rotate in the left samples from previously decoded block. We move four\n    // pixels at a time for alignment reason, and because of in-loop filter.\n    if (mb_x > 0) {\n      for (j = -1; j < 16; ++j) {\n        Copy32b(&y_dst[j * BPS - 4], &y_dst[j * BPS + 12]);\n      }\n      for (j = -1; j < 8; ++j) {\n        Copy32b(&u_dst[j * BPS - 4], &u_dst[j * BPS + 4]);\n        Copy32b(&v_dst[j * BPS - 4], &v_dst[j * BPS + 4]);\n      }\n    } else {\n      for (j = 0; j < 16; ++j) {\n        y_dst[j * BPS - 1] = 129;\n      }\n      for (j = 0; j < 8; ++j) {\n        u_dst[j * BPS - 1] = 129;\n        v_dst[j * BPS - 1] = 129;\n      }\n      // Init top-left sample on left column too\n      if (mb_y > 0) {\n        y_dst[-1 - BPS] = u_dst[-1 - BPS] = v_dst[-1 - BPS] = 129;\n      }\n    }\n    {\n      // bring top samples into the cache\n      VP8TopSamples* const top_yuv = dec->yuv_t_ + mb_x;\n      const int16_t* const coeffs = block->coeffs_;\n      uint32_t bits = block->non_zero_y_;\n      int n;\n\n      if (mb_y > 0) {\n        memcpy(y_dst - BPS, top_yuv[0].y, 16);\n        memcpy(u_dst - BPS, top_yuv[0].u, 8);\n        memcpy(v_dst - BPS, top_yuv[0].v, 8);\n      } else if (mb_x == 0) {\n        // we only need to do this init once at block (0,0).\n        // Afterward, it remains valid for the whole topmost row.\n        memset(y_dst - BPS - 1, 127, 16 + 4 + 1);\n        memset(u_dst - BPS - 1, 127, 8 + 1);\n        memset(v_dst - BPS - 1, 127, 8 + 1);\n      }\n\n      // predict and add residuals\n      if (block->is_i4x4_) {   // 4x4\n        uint32_t* const top_right = (uint32_t*)(y_dst - BPS + 16);\n\n        if (mb_y > 0) {\n          if (mb_x >= dec->mb_w_ - 1) {    // on rightmost border\n            memset(top_right, top_yuv[0].y[15], sizeof(*top_right));\n          } else {\n            memcpy(top_right, top_yuv[1].y, sizeof(*top_right));\n          }\n        }\n        // replicate the top-right pixels below\n        top_right[BPS] = top_right[2 * BPS] = top_right[3 * BPS] = top_right[0];\n\n        // predict and add residuals for all 4x4 blocks in turn.\n        for (n = 0; n < 16; ++n, bits <<= 2) {\n          uint8_t* const dst = y_dst + kScan[n];\n          VP8PredLuma4[block->imodes_[n]](dst);\n          DoTransform(bits, coeffs + n * 16, dst);\n        }\n      } else {    // 16x16\n        const int pred_func = CheckMode(mb_x, mb_y,\n                                        block->imodes_[0]);\n        VP8PredLuma16[pred_func](y_dst);\n        if (bits != 0) {\n          for (n = 0; n < 16; ++n, bits <<= 2) {\n            DoTransform(bits, coeffs + n * 16, y_dst + kScan[n]);\n          }\n        }\n      }\n      {\n        // Chroma\n        const uint32_t bits_uv = block->non_zero_uv_;\n        const int pred_func = CheckMode(mb_x, mb_y, block->uvmode_);\n        VP8PredChroma8[pred_func](u_dst);\n        VP8PredChroma8[pred_func](v_dst);\n        DoUVTransform(bits_uv >> 0, coeffs + 16 * 16, u_dst);\n        DoUVTransform(bits_uv >> 8, coeffs + 20 * 16, v_dst);\n      }\n\n      // stash away top samples for next block\n      if (mb_y < dec->mb_h_ - 1) {\n        memcpy(top_yuv[0].y, y_dst + 15 * BPS, 16);\n        memcpy(top_yuv[0].u, u_dst +  7 * BPS,  8);\n        memcpy(top_yuv[0].v, v_dst +  7 * BPS,  8);\n      }\n    }\n    // Transfer reconstructed samples from yuv_b_ cache to final destination.\n    {\n      const int y_offset = cache_id * 16 * dec->cache_y_stride_;\n      const int uv_offset = cache_id * 8 * dec->cache_uv_stride_;\n      uint8_t* const y_out = dec->cache_y_ + mb_x * 16 + y_offset;\n      uint8_t* const u_out = dec->cache_u_ + mb_x * 8 + uv_offset;\n      uint8_t* const v_out = dec->cache_v_ + mb_x * 8 + uv_offset;\n      for (j = 0; j < 16; ++j) {\n        memcpy(y_out + j * dec->cache_y_stride_, y_dst + j * BPS, 16);\n      }\n      for (j = 0; j < 8; ++j) {\n        memcpy(u_out + j * dec->cache_uv_stride_, u_dst + j * BPS, 8);\n        memcpy(v_out + j * dec->cache_uv_stride_, v_dst + j * BPS, 8);\n      }\n    }\n  }\n}\n\n//------------------------------------------------------------------------------\n\n"
  },
  {
    "path": "ext/libwebp/dec/idec.c",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Incremental decoding\n//\n// Author: somnath@google.com (Somnath Banerjee)\n\n#include <assert.h>\n#include <string.h>\n#include <stdlib.h>\n\n#include \"./alphai.h\"\n#include \"./webpi.h\"\n#include \"./vp8i.h\"\n#include \"../utils/utils.h\"\n\n// In append mode, buffer allocations increase as multiples of this value.\n// Needs to be a power of 2.\n#define CHUNK_SIZE 4096\n#define MAX_MB_SIZE 4096\n\n//------------------------------------------------------------------------------\n// Data structures for memory and states\n\n// Decoding states. State normally flows as:\n// WEBP_HEADER->VP8_HEADER->VP8_PARTS0->VP8_DATA->DONE for a lossy image, and\n// WEBP_HEADER->VP8L_HEADER->VP8L_DATA->DONE for a lossless image.\n// If there is any error the decoder goes into state ERROR.\ntypedef enum {\n  STATE_WEBP_HEADER,  // All the data before that of the VP8/VP8L chunk.\n  STATE_VP8_HEADER,   // The VP8 Frame header (within the VP8 chunk).\n  STATE_VP8_PARTS0,\n  STATE_VP8_DATA,\n  STATE_VP8L_HEADER,\n  STATE_VP8L_DATA,\n  STATE_DONE,\n  STATE_ERROR\n} DecState;\n\n// Operating state for the MemBuffer\ntypedef enum {\n  MEM_MODE_NONE = 0,\n  MEM_MODE_APPEND,\n  MEM_MODE_MAP\n} MemBufferMode;\n\n// storage for partition #0 and partial data (in a rolling fashion)\ntypedef struct {\n  MemBufferMode mode_;  // Operation mode\n  size_t start_;        // start location of the data to be decoded\n  size_t end_;          // end location\n  size_t buf_size_;     // size of the allocated buffer\n  uint8_t* buf_;        // We don't own this buffer in case WebPIUpdate()\n\n  size_t part0_size_;         // size of partition #0\n  const uint8_t* part0_buf_;  // buffer to store partition #0\n} MemBuffer;\n\nstruct WebPIDecoder {\n  DecState state_;         // current decoding state\n  WebPDecParams params_;   // Params to store output info\n  int is_lossless_;        // for down-casting 'dec_'.\n  void* dec_;              // either a VP8Decoder or a VP8LDecoder instance\n  VP8Io io_;\n\n  MemBuffer mem_;          // input memory buffer.\n  WebPDecBuffer output_;   // output buffer (when no external one is supplied)\n  size_t chunk_size_;      // Compressed VP8/VP8L size extracted from Header.\n\n  int last_mb_y_;          // last row reached for intra-mode decoding\n};\n\n// MB context to restore in case VP8DecodeMB() fails\ntypedef struct {\n  VP8MB left_;\n  VP8MB info_;\n  VP8BitReader token_br_;\n} MBContext;\n\n//------------------------------------------------------------------------------\n// MemBuffer: incoming data handling\n\nstatic WEBP_INLINE size_t MemDataSize(const MemBuffer* mem) {\n  return (mem->end_ - mem->start_);\n}\n\n// Check if we need to preserve the compressed alpha data, as it may not have\n// been decoded yet.\nstatic int NeedCompressedAlpha(const WebPIDecoder* const idec) {\n  if (idec->state_ == STATE_WEBP_HEADER) {\n    // We haven't parsed the headers yet, so we don't know whether the image is\n    // lossy or lossless. This also means that we haven't parsed the ALPH chunk.\n    return 0;\n  }\n  if (idec->is_lossless_) {\n    return 0;  // ALPH chunk is not present for lossless images.\n  } else {\n    const VP8Decoder* const dec = (VP8Decoder*)idec->dec_;\n    assert(dec != NULL);  // Must be true as idec->state_ != STATE_WEBP_HEADER.\n    return (dec->alpha_data_ != NULL) && !dec->is_alpha_decoded_;\n  }\n}\n\nstatic void DoRemap(WebPIDecoder* const idec, ptrdiff_t offset) {\n  MemBuffer* const mem = &idec->mem_;\n  const uint8_t* const new_base = mem->buf_ + mem->start_;\n  // note: for VP8, setting up idec->io_ is only really needed at the beginning\n  // of the decoding, till partition #0 is complete.\n  idec->io_.data = new_base;\n  idec->io_.data_size = MemDataSize(mem);\n\n  if (idec->dec_ != NULL) {\n    if (!idec->is_lossless_) {\n      VP8Decoder* const dec = (VP8Decoder*)idec->dec_;\n      const int last_part = dec->num_parts_ - 1;\n      if (offset != 0) {\n        int p;\n        for (p = 0; p <= last_part; ++p) {\n          VP8RemapBitReader(dec->parts_ + p, offset);\n        }\n        // Remap partition #0 data pointer to new offset, but only in MAP\n        // mode (in APPEND mode, partition #0 is copied into a fixed memory).\n        if (mem->mode_ == MEM_MODE_MAP) {\n          VP8RemapBitReader(&dec->br_, offset);\n        }\n      }\n      assert(last_part >= 0);\n      dec->parts_[last_part].buf_end_ = mem->buf_ + mem->end_;\n      if (NeedCompressedAlpha(idec)) {\n        ALPHDecoder* const alph_dec = dec->alph_dec_;\n        dec->alpha_data_ += offset;\n        if (alph_dec != NULL) {\n          if (alph_dec->method_ == ALPHA_LOSSLESS_COMPRESSION) {\n            VP8LDecoder* const alph_vp8l_dec = alph_dec->vp8l_dec_;\n            assert(alph_vp8l_dec != NULL);\n            assert(dec->alpha_data_size_ >= ALPHA_HEADER_LEN);\n            VP8LBitReaderSetBuffer(&alph_vp8l_dec->br_,\n                                   dec->alpha_data_ + ALPHA_HEADER_LEN,\n                                   dec->alpha_data_size_ - ALPHA_HEADER_LEN);\n          } else {  // alph_dec->method_ == ALPHA_NO_COMPRESSION\n            // Nothing special to do in this case.\n          }\n        }\n      }\n    } else {    // Resize lossless bitreader\n      VP8LDecoder* const dec = (VP8LDecoder*)idec->dec_;\n      VP8LBitReaderSetBuffer(&dec->br_, new_base, MemDataSize(mem));\n    }\n  }\n}\n\n// Appends data to the end of MemBuffer->buf_. It expands the allocated memory\n// size if required and also updates VP8BitReader's if new memory is allocated.\nstatic int AppendToMemBuffer(WebPIDecoder* const idec,\n                             const uint8_t* const data, size_t data_size) {\n  VP8Decoder* const dec = (VP8Decoder*)idec->dec_;\n  MemBuffer* const mem = &idec->mem_;\n  const int need_compressed_alpha = NeedCompressedAlpha(idec);\n  const uint8_t* const old_start = mem->buf_ + mem->start_;\n  const uint8_t* const old_base =\n      need_compressed_alpha ? dec->alpha_data_ : old_start;\n  assert(mem->mode_ == MEM_MODE_APPEND);\n  if (data_size > MAX_CHUNK_PAYLOAD) {\n    // security safeguard: trying to allocate more than what the format\n    // allows for a chunk should be considered a smoke smell.\n    return 0;\n  }\n\n  if (mem->end_ + data_size > mem->buf_size_) {  // Need some free memory\n    const size_t new_mem_start = old_start - old_base;\n    const size_t current_size = MemDataSize(mem) + new_mem_start;\n    const uint64_t new_size = (uint64_t)current_size + data_size;\n    const uint64_t extra_size = (new_size + CHUNK_SIZE - 1) & ~(CHUNK_SIZE - 1);\n    uint8_t* const new_buf =\n        (uint8_t*)WebPSafeMalloc(extra_size, sizeof(*new_buf));\n    if (new_buf == NULL) return 0;\n    memcpy(new_buf, old_base, current_size);\n    WebPSafeFree(mem->buf_);\n    mem->buf_ = new_buf;\n    mem->buf_size_ = (size_t)extra_size;\n    mem->start_ = new_mem_start;\n    mem->end_ = current_size;\n  }\n\n  memcpy(mem->buf_ + mem->end_, data, data_size);\n  mem->end_ += data_size;\n  assert(mem->end_ <= mem->buf_size_);\n\n  DoRemap(idec, mem->buf_ + mem->start_ - old_start);\n  return 1;\n}\n\nstatic int RemapMemBuffer(WebPIDecoder* const idec,\n                          const uint8_t* const data, size_t data_size) {\n  MemBuffer* const mem = &idec->mem_;\n  const uint8_t* const old_buf = mem->buf_;\n  const uint8_t* const old_start = old_buf + mem->start_;\n  assert(mem->mode_ == MEM_MODE_MAP);\n\n  if (data_size < mem->buf_size_) return 0;  // can't remap to a shorter buffer!\n\n  mem->buf_ = (uint8_t*)data;\n  mem->end_ = mem->buf_size_ = data_size;\n\n  DoRemap(idec, mem->buf_ + mem->start_ - old_start);\n  return 1;\n}\n\nstatic void InitMemBuffer(MemBuffer* const mem) {\n  mem->mode_       = MEM_MODE_NONE;\n  mem->buf_        = NULL;\n  mem->buf_size_   = 0;\n  mem->part0_buf_  = NULL;\n  mem->part0_size_ = 0;\n}\n\nstatic void ClearMemBuffer(MemBuffer* const mem) {\n  assert(mem);\n  if (mem->mode_ == MEM_MODE_APPEND) {\n    WebPSafeFree(mem->buf_);\n    WebPSafeFree((void*)mem->part0_buf_);\n  }\n}\n\nstatic int CheckMemBufferMode(MemBuffer* const mem, MemBufferMode expected) {\n  if (mem->mode_ == MEM_MODE_NONE) {\n    mem->mode_ = expected;    // switch to the expected mode\n  } else if (mem->mode_ != expected) {\n    return 0;         // we mixed the modes => error\n  }\n  assert(mem->mode_ == expected);   // mode is ok\n  return 1;\n}\n\n// To be called last.\nstatic VP8StatusCode FinishDecoding(WebPIDecoder* const idec) {\n#if WEBP_DECODER_ABI_VERSION > 0x0203\n  const WebPDecoderOptions* const options = idec->params_.options;\n  WebPDecBuffer* const output = idec->params_.output;\n\n  idec->state_ = STATE_DONE;\n  if (options != NULL && options->flip) {\n    return WebPFlipBuffer(output);\n  }\n#endif\n  idec->state_ = STATE_DONE;\n  return VP8_STATUS_OK;\n}\n\n//------------------------------------------------------------------------------\n// Macroblock-decoding contexts\n\nstatic void SaveContext(const VP8Decoder* dec, const VP8BitReader* token_br,\n                        MBContext* const context) {\n  context->left_ = dec->mb_info_[-1];\n  context->info_ = dec->mb_info_[dec->mb_x_];\n  context->token_br_ = *token_br;\n}\n\nstatic void RestoreContext(const MBContext* context, VP8Decoder* const dec,\n                           VP8BitReader* const token_br) {\n  dec->mb_info_[-1] = context->left_;\n  dec->mb_info_[dec->mb_x_] = context->info_;\n  *token_br = context->token_br_;\n}\n\n//------------------------------------------------------------------------------\n\nstatic VP8StatusCode IDecError(WebPIDecoder* const idec, VP8StatusCode error) {\n  if (idec->state_ == STATE_VP8_DATA) {\n    VP8Io* const io = &idec->io_;\n    if (io->teardown != NULL) {\n      io->teardown(io);\n    }\n  }\n  idec->state_ = STATE_ERROR;\n  return error;\n}\n\nstatic void ChangeState(WebPIDecoder* const idec, DecState new_state,\n                        size_t consumed_bytes) {\n  MemBuffer* const mem = &idec->mem_;\n  idec->state_ = new_state;\n  mem->start_ += consumed_bytes;\n  assert(mem->start_ <= mem->end_);\n  idec->io_.data = mem->buf_ + mem->start_;\n  idec->io_.data_size = MemDataSize(mem);\n}\n\n// Headers\nstatic VP8StatusCode DecodeWebPHeaders(WebPIDecoder* const idec) {\n  MemBuffer* const mem = &idec->mem_;\n  const uint8_t* data = mem->buf_ + mem->start_;\n  size_t curr_size = MemDataSize(mem);\n  VP8StatusCode status;\n  WebPHeaderStructure headers;\n\n  headers.data = data;\n  headers.data_size = curr_size;\n  headers.have_all_data = 0;\n  status = WebPParseHeaders(&headers);\n  if (status == VP8_STATUS_NOT_ENOUGH_DATA) {\n    return VP8_STATUS_SUSPENDED;  // We haven't found a VP8 chunk yet.\n  } else if (status != VP8_STATUS_OK) {\n    return IDecError(idec, status);\n  }\n\n  idec->chunk_size_ = headers.compressed_size;\n  idec->is_lossless_ = headers.is_lossless;\n  if (!idec->is_lossless_) {\n    VP8Decoder* const dec = VP8New();\n    if (dec == NULL) {\n      return VP8_STATUS_OUT_OF_MEMORY;\n    }\n    idec->dec_ = dec;\n    dec->alpha_data_ = headers.alpha_data;\n    dec->alpha_data_size_ = headers.alpha_data_size;\n    ChangeState(idec, STATE_VP8_HEADER, headers.offset);\n  } else {\n    VP8LDecoder* const dec = VP8LNew();\n    if (dec == NULL) {\n      return VP8_STATUS_OUT_OF_MEMORY;\n    }\n    idec->dec_ = dec;\n    ChangeState(idec, STATE_VP8L_HEADER, headers.offset);\n  }\n  return VP8_STATUS_OK;\n}\n\nstatic VP8StatusCode DecodeVP8FrameHeader(WebPIDecoder* const idec) {\n  const uint8_t* data = idec->mem_.buf_ + idec->mem_.start_;\n  const size_t curr_size = MemDataSize(&idec->mem_);\n  int width, height;\n  uint32_t bits;\n\n  if (curr_size < VP8_FRAME_HEADER_SIZE) {\n    // Not enough data bytes to extract VP8 Frame Header.\n    return VP8_STATUS_SUSPENDED;\n  }\n  if (!VP8GetInfo(data, curr_size, idec->chunk_size_, &width, &height)) {\n    return IDecError(idec, VP8_STATUS_BITSTREAM_ERROR);\n  }\n\n  bits = data[0] | (data[1] << 8) | (data[2] << 16);\n  idec->mem_.part0_size_ = (bits >> 5) + VP8_FRAME_HEADER_SIZE;\n\n  idec->io_.data = data;\n  idec->io_.data_size = curr_size;\n  idec->state_ = STATE_VP8_PARTS0;\n  return VP8_STATUS_OK;\n}\n\n// Partition #0\nstatic int CopyParts0Data(WebPIDecoder* const idec) {\n  VP8Decoder* const dec = (VP8Decoder*)idec->dec_;\n  VP8BitReader* const br = &dec->br_;\n  const size_t psize = br->buf_end_ - br->buf_;\n  MemBuffer* const mem = &idec->mem_;\n  assert(!idec->is_lossless_);\n  assert(mem->part0_buf_ == NULL);\n  assert(psize > 0);\n  assert(psize <= mem->part0_size_);  // Format limit: no need for runtime check\n  if (mem->mode_ == MEM_MODE_APPEND) {\n    // We copy and grab ownership of the partition #0 data.\n    uint8_t* const part0_buf = (uint8_t*)WebPSafeMalloc(1ULL, psize);\n    if (part0_buf == NULL) {\n      return 0;\n    }\n    memcpy(part0_buf, br->buf_, psize);\n    mem->part0_buf_ = part0_buf;\n    br->buf_ = part0_buf;\n    br->buf_end_ = part0_buf + psize;\n  } else {\n    // Else: just keep pointers to the partition #0's data in dec_->br_.\n  }\n  mem->start_ += psize;\n  return 1;\n}\n\nstatic VP8StatusCode DecodePartition0(WebPIDecoder* const idec) {\n  VP8Decoder* const dec = (VP8Decoder*)idec->dec_;\n  VP8Io* const io = &idec->io_;\n  const WebPDecParams* const params = &idec->params_;\n  WebPDecBuffer* const output = params->output;\n\n  // Wait till we have enough data for the whole partition #0\n  if (MemDataSize(&idec->mem_) < idec->mem_.part0_size_) {\n    return VP8_STATUS_SUSPENDED;\n  }\n\n  if (!VP8GetHeaders(dec, io)) {\n    const VP8StatusCode status = dec->status_;\n    if (status == VP8_STATUS_SUSPENDED ||\n        status == VP8_STATUS_NOT_ENOUGH_DATA) {\n      // treating NOT_ENOUGH_DATA as SUSPENDED state\n      return VP8_STATUS_SUSPENDED;\n    }\n    return IDecError(idec, status);\n  }\n\n  // Allocate/Verify output buffer now\n  dec->status_ = WebPAllocateDecBuffer(io->width, io->height, params->options,\n                                       output);\n  if (dec->status_ != VP8_STATUS_OK) {\n    return IDecError(idec, dec->status_);\n  }\n  // This change must be done before calling VP8InitFrame()\n  dec->mt_method_ = VP8GetThreadMethod(params->options, NULL,\n                                       io->width, io->height);\n  VP8InitDithering(params->options, dec);\n  if (!CopyParts0Data(idec)) {\n    return IDecError(idec, VP8_STATUS_OUT_OF_MEMORY);\n  }\n\n  // Finish setting up the decoding parameters. Will call io->setup().\n  if (VP8EnterCritical(dec, io) != VP8_STATUS_OK) {\n    return IDecError(idec, dec->status_);\n  }\n\n  // Note: past this point, teardown() must always be called\n  // in case of error.\n  idec->state_ = STATE_VP8_DATA;\n  // Allocate memory and prepare everything.\n  if (!VP8InitFrame(dec, io)) {\n    return IDecError(idec, dec->status_);\n  }\n  return VP8_STATUS_OK;\n}\n\n// Remaining partitions\nstatic VP8StatusCode DecodeRemaining(WebPIDecoder* const idec) {\n  VP8Decoder* const dec = (VP8Decoder*)idec->dec_;\n  VP8Io* const io = &idec->io_;\n\n  assert(dec->ready_);\n  for (; dec->mb_y_ < dec->mb_h_; ++dec->mb_y_) {\n    if (idec->last_mb_y_ != dec->mb_y_) {\n      if (!VP8ParseIntraModeRow(&dec->br_, dec)) {\n        // note: normally, error shouldn't occur since we already have the whole\n        // partition0 available here in DecodeRemaining(). Reaching EOF while\n        // reading intra modes really means a BITSTREAM_ERROR.\n        return IDecError(idec, VP8_STATUS_BITSTREAM_ERROR);\n      }\n      idec->last_mb_y_ = dec->mb_y_;\n    }\n    for (; dec->mb_x_ < dec->mb_w_; ++dec->mb_x_) {\n      VP8BitReader* const token_br =\n          &dec->parts_[dec->mb_y_ & (dec->num_parts_ - 1)];\n      MBContext context;\n      SaveContext(dec, token_br, &context);\n      if (!VP8DecodeMB(dec, token_br)) {\n        // We shouldn't fail when MAX_MB data was available\n        if (dec->num_parts_ == 1 && MemDataSize(&idec->mem_) > MAX_MB_SIZE) {\n          return IDecError(idec, VP8_STATUS_BITSTREAM_ERROR);\n        }\n        RestoreContext(&context, dec, token_br);\n        return VP8_STATUS_SUSPENDED;\n      }\n      // Release buffer only if there is only one partition\n      if (dec->num_parts_ == 1) {\n        idec->mem_.start_ = token_br->buf_ - idec->mem_.buf_;\n        assert(idec->mem_.start_ <= idec->mem_.end_);\n      }\n    }\n    VP8InitScanline(dec);   // Prepare for next scanline\n\n    // Reconstruct, filter and emit the row.\n    if (!VP8ProcessRow(dec, io)) {\n      return IDecError(idec, VP8_STATUS_USER_ABORT);\n    }\n  }\n  // Synchronize the thread and check for errors.\n  if (!VP8ExitCritical(dec, io)) {\n    return IDecError(idec, VP8_STATUS_USER_ABORT);\n  }\n  dec->ready_ = 0;\n  return FinishDecoding(idec);\n}\n\nstatic VP8StatusCode ErrorStatusLossless(WebPIDecoder* const idec,\n                                         VP8StatusCode status) {\n  if (status == VP8_STATUS_SUSPENDED || status == VP8_STATUS_NOT_ENOUGH_DATA) {\n    return VP8_STATUS_SUSPENDED;\n  }\n  return IDecError(idec, status);\n}\n\nstatic VP8StatusCode DecodeVP8LHeader(WebPIDecoder* const idec) {\n  VP8Io* const io = &idec->io_;\n  VP8LDecoder* const dec = (VP8LDecoder*)idec->dec_;\n  const WebPDecParams* const params = &idec->params_;\n  WebPDecBuffer* const output = params->output;\n  size_t curr_size = MemDataSize(&idec->mem_);\n  assert(idec->is_lossless_);\n\n  // Wait until there's enough data for decoding header.\n  if (curr_size < (idec->chunk_size_ >> 3)) {\n    return VP8_STATUS_SUSPENDED;\n  }\n  if (!VP8LDecodeHeader(dec, io)) {\n    return ErrorStatusLossless(idec, dec->status_);\n  }\n  // Allocate/verify output buffer now.\n  dec->status_ = WebPAllocateDecBuffer(io->width, io->height, params->options,\n                                       output);\n  if (dec->status_ != VP8_STATUS_OK) {\n    return IDecError(idec, dec->status_);\n  }\n\n  idec->state_ = STATE_VP8L_DATA;\n  return VP8_STATUS_OK;\n}\n\nstatic VP8StatusCode DecodeVP8LData(WebPIDecoder* const idec) {\n  VP8LDecoder* const dec = (VP8LDecoder*)idec->dec_;\n  const size_t curr_size = MemDataSize(&idec->mem_);\n  assert(idec->is_lossless_);\n\n  // At present Lossless decoder can't decode image incrementally. So wait till\n  // all the image data is aggregated before image can be decoded.\n  if (curr_size < idec->chunk_size_) {\n    return VP8_STATUS_SUSPENDED;\n  }\n\n  if (!VP8LDecodeImage(dec)) {\n    // The decoding is called after all the data-bytes are aggregated. Change\n    // the error to VP8_BITSTREAM_ERROR in case lossless decoder fails to decode\n    // all the pixels (VP8_STATUS_SUSPENDED).\n    if (dec->status_ == VP8_STATUS_SUSPENDED) {\n      dec->status_ = VP8_STATUS_BITSTREAM_ERROR;\n    }\n    return ErrorStatusLossless(idec, dec->status_);\n  }\n\n  return FinishDecoding(idec);\n}\n\n  // Main decoding loop\nstatic VP8StatusCode IDecode(WebPIDecoder* idec) {\n  VP8StatusCode status = VP8_STATUS_SUSPENDED;\n\n  if (idec->state_ == STATE_WEBP_HEADER) {\n    status = DecodeWebPHeaders(idec);\n  } else {\n    if (idec->dec_ == NULL) {\n      return VP8_STATUS_SUSPENDED;    // can't continue if we have no decoder.\n    }\n  }\n  if (idec->state_ == STATE_VP8_HEADER) {\n    status = DecodeVP8FrameHeader(idec);\n  }\n  if (idec->state_ == STATE_VP8_PARTS0) {\n    status = DecodePartition0(idec);\n  }\n  if (idec->state_ == STATE_VP8_DATA) {\n    status = DecodeRemaining(idec);\n  }\n  if (idec->state_ == STATE_VP8L_HEADER) {\n    status = DecodeVP8LHeader(idec);\n  }\n  if (idec->state_ == STATE_VP8L_DATA) {\n    status = DecodeVP8LData(idec);\n  }\n  return status;\n}\n\n//------------------------------------------------------------------------------\n// Public functions\n\nWebPIDecoder* WebPINewDecoder(WebPDecBuffer* output_buffer) {\n  WebPIDecoder* idec = (WebPIDecoder*)WebPSafeCalloc(1ULL, sizeof(*idec));\n  if (idec == NULL) {\n    return NULL;\n  }\n\n  idec->state_ = STATE_WEBP_HEADER;\n  idec->chunk_size_ = 0;\n\n  idec->last_mb_y_ = -1;\n\n  InitMemBuffer(&idec->mem_);\n  WebPInitDecBuffer(&idec->output_);\n  VP8InitIo(&idec->io_);\n\n  WebPResetDecParams(&idec->params_);\n  idec->params_.output = (output_buffer != NULL) ? output_buffer\n                                                 : &idec->output_;\n  WebPInitCustomIo(&idec->params_, &idec->io_);  // Plug the I/O functions.\n\n  return idec;\n}\n\nWebPIDecoder* WebPIDecode(const uint8_t* data, size_t data_size,\n                          WebPDecoderConfig* config) {\n  WebPIDecoder* idec;\n\n  // Parse the bitstream's features, if requested:\n  if (data != NULL && data_size > 0 && config != NULL) {\n    if (WebPGetFeatures(data, data_size, &config->input) != VP8_STATUS_OK) {\n      return NULL;\n    }\n  }\n  // Create an instance of the incremental decoder\n  idec = WebPINewDecoder(config ? &config->output : NULL);\n  if (idec == NULL) {\n    return NULL;\n  }\n  // Finish initialization\n  if (config != NULL) {\n    idec->params_.options = &config->options;\n  }\n  return idec;\n}\n\nvoid WebPIDelete(WebPIDecoder* idec) {\n  if (idec == NULL) return;\n  if (idec->dec_ != NULL) {\n    if (!idec->is_lossless_) {\n      if (idec->state_ == STATE_VP8_DATA) {\n        // Synchronize the thread, clean-up and check for errors.\n        VP8ExitCritical((VP8Decoder*)idec->dec_, &idec->io_);\n      }\n      VP8Delete((VP8Decoder*)idec->dec_);\n    } else {\n      VP8LDelete((VP8LDecoder*)idec->dec_);\n    }\n  }\n  ClearMemBuffer(&idec->mem_);\n  WebPFreeDecBuffer(&idec->output_);\n  WebPSafeFree(idec);\n}\n\n//------------------------------------------------------------------------------\n// Wrapper toward WebPINewDecoder\n\nWebPIDecoder* WebPINewRGB(WEBP_CSP_MODE mode, uint8_t* output_buffer,\n                          size_t output_buffer_size, int output_stride) {\n  const int is_external_memory = (output_buffer != NULL);\n  WebPIDecoder* idec;\n\n  if (mode >= MODE_YUV) return NULL;\n  if (!is_external_memory) {    // Overwrite parameters to sane values.\n    output_buffer_size = 0;\n    output_stride = 0;\n  } else {  // A buffer was passed. Validate the other params.\n    if (output_stride == 0 || output_buffer_size == 0) {\n      return NULL;   // invalid parameter.\n    }\n  }\n  idec = WebPINewDecoder(NULL);\n  if (idec == NULL) return NULL;\n  idec->output_.colorspace = mode;\n  idec->output_.is_external_memory = is_external_memory;\n  idec->output_.u.RGBA.rgba = output_buffer;\n  idec->output_.u.RGBA.stride = output_stride;\n  idec->output_.u.RGBA.size = output_buffer_size;\n  return idec;\n}\n\nWebPIDecoder* WebPINewYUVA(uint8_t* luma, size_t luma_size, int luma_stride,\n                           uint8_t* u, size_t u_size, int u_stride,\n                           uint8_t* v, size_t v_size, int v_stride,\n                           uint8_t* a, size_t a_size, int a_stride) {\n  const int is_external_memory = (luma != NULL);\n  WebPIDecoder* idec;\n  WEBP_CSP_MODE colorspace;\n\n  if (!is_external_memory) {    // Overwrite parameters to sane values.\n    luma_size = u_size = v_size = a_size = 0;\n    luma_stride = u_stride = v_stride = a_stride = 0;\n    u = v = a = NULL;\n    colorspace = MODE_YUVA;\n  } else {  // A luma buffer was passed. Validate the other parameters.\n    if (u == NULL || v == NULL) return NULL;\n    if (luma_size == 0 || u_size == 0 || v_size == 0) return NULL;\n    if (luma_stride == 0 || u_stride == 0 || v_stride == 0) return NULL;\n    if (a != NULL) {\n      if (a_size == 0 || a_stride == 0) return NULL;\n    }\n    colorspace = (a == NULL) ? MODE_YUV : MODE_YUVA;\n  }\n\n  idec = WebPINewDecoder(NULL);\n  if (idec == NULL) return NULL;\n\n  idec->output_.colorspace = colorspace;\n  idec->output_.is_external_memory = is_external_memory;\n  idec->output_.u.YUVA.y = luma;\n  idec->output_.u.YUVA.y_stride = luma_stride;\n  idec->output_.u.YUVA.y_size = luma_size;\n  idec->output_.u.YUVA.u = u;\n  idec->output_.u.YUVA.u_stride = u_stride;\n  idec->output_.u.YUVA.u_size = u_size;\n  idec->output_.u.YUVA.v = v;\n  idec->output_.u.YUVA.v_stride = v_stride;\n  idec->output_.u.YUVA.v_size = v_size;\n  idec->output_.u.YUVA.a = a;\n  idec->output_.u.YUVA.a_stride = a_stride;\n  idec->output_.u.YUVA.a_size = a_size;\n  return idec;\n}\n\nWebPIDecoder* WebPINewYUV(uint8_t* luma, size_t luma_size, int luma_stride,\n                          uint8_t* u, size_t u_size, int u_stride,\n                          uint8_t* v, size_t v_size, int v_stride) {\n  return WebPINewYUVA(luma, luma_size, luma_stride,\n                      u, u_size, u_stride,\n                      v, v_size, v_stride,\n                      NULL, 0, 0);\n}\n\n//------------------------------------------------------------------------------\n\nstatic VP8StatusCode IDecCheckStatus(const WebPIDecoder* const idec) {\n  assert(idec);\n  if (idec->state_ == STATE_ERROR) {\n    return VP8_STATUS_BITSTREAM_ERROR;\n  }\n  if (idec->state_ == STATE_DONE) {\n    return VP8_STATUS_OK;\n  }\n  return VP8_STATUS_SUSPENDED;\n}\n\nVP8StatusCode WebPIAppend(WebPIDecoder* idec,\n                          const uint8_t* data, size_t data_size) {\n  VP8StatusCode status;\n  if (idec == NULL || data == NULL) {\n    return VP8_STATUS_INVALID_PARAM;\n  }\n  status = IDecCheckStatus(idec);\n  if (status != VP8_STATUS_SUSPENDED) {\n    return status;\n  }\n  // Check mixed calls between RemapMemBuffer and AppendToMemBuffer.\n  if (!CheckMemBufferMode(&idec->mem_, MEM_MODE_APPEND)) {\n    return VP8_STATUS_INVALID_PARAM;\n  }\n  // Append data to memory buffer\n  if (!AppendToMemBuffer(idec, data, data_size)) {\n    return VP8_STATUS_OUT_OF_MEMORY;\n  }\n  return IDecode(idec);\n}\n\nVP8StatusCode WebPIUpdate(WebPIDecoder* idec,\n                          const uint8_t* data, size_t data_size) {\n  VP8StatusCode status;\n  if (idec == NULL || data == NULL) {\n    return VP8_STATUS_INVALID_PARAM;\n  }\n  status = IDecCheckStatus(idec);\n  if (status != VP8_STATUS_SUSPENDED) {\n    return status;\n  }\n  // Check mixed calls between RemapMemBuffer and AppendToMemBuffer.\n  if (!CheckMemBufferMode(&idec->mem_, MEM_MODE_MAP)) {\n    return VP8_STATUS_INVALID_PARAM;\n  }\n  // Make the memory buffer point to the new buffer\n  if (!RemapMemBuffer(idec, data, data_size)) {\n    return VP8_STATUS_INVALID_PARAM;\n  }\n  return IDecode(idec);\n}\n\n//------------------------------------------------------------------------------\n\nstatic const WebPDecBuffer* GetOutputBuffer(const WebPIDecoder* const idec) {\n  if (idec == NULL || idec->dec_ == NULL) {\n    return NULL;\n  }\n  if (idec->state_ <= STATE_VP8_PARTS0) {\n    return NULL;\n  }\n  return idec->params_.output;\n}\n\nconst WebPDecBuffer* WebPIDecodedArea(const WebPIDecoder* idec,\n                                      int* left, int* top,\n                                      int* width, int* height) {\n  const WebPDecBuffer* const src = GetOutputBuffer(idec);\n  if (left != NULL) *left = 0;\n  if (top != NULL) *top = 0;\n  // TODO(skal): later include handling of rotations.\n  if (src) {\n    if (width != NULL) *width = src->width;\n    if (height != NULL) *height = idec->params_.last_y;\n  } else {\n    if (width != NULL) *width = 0;\n    if (height != NULL) *height = 0;\n  }\n  return src;\n}\n\nuint8_t* WebPIDecGetRGB(const WebPIDecoder* idec, int* last_y,\n                        int* width, int* height, int* stride) {\n  const WebPDecBuffer* const src = GetOutputBuffer(idec);\n  if (src == NULL) return NULL;\n  if (src->colorspace >= MODE_YUV) {\n    return NULL;\n  }\n\n  if (last_y != NULL) *last_y = idec->params_.last_y;\n  if (width != NULL) *width = src->width;\n  if (height != NULL) *height = src->height;\n  if (stride != NULL) *stride = src->u.RGBA.stride;\n\n  return src->u.RGBA.rgba;\n}\n\nuint8_t* WebPIDecGetYUVA(const WebPIDecoder* idec, int* last_y,\n                         uint8_t** u, uint8_t** v, uint8_t** a,\n                         int* width, int* height,\n                         int* stride, int* uv_stride, int* a_stride) {\n  const WebPDecBuffer* const src = GetOutputBuffer(idec);\n  if (src == NULL) return NULL;\n  if (src->colorspace < MODE_YUV) {\n    return NULL;\n  }\n\n  if (last_y != NULL) *last_y = idec->params_.last_y;\n  if (u != NULL) *u = src->u.YUVA.u;\n  if (v != NULL) *v = src->u.YUVA.v;\n  if (a != NULL) *a = src->u.YUVA.a;\n  if (width != NULL) *width = src->width;\n  if (height != NULL) *height = src->height;\n  if (stride != NULL) *stride = src->u.YUVA.y_stride;\n  if (uv_stride != NULL) *uv_stride = src->u.YUVA.u_stride;\n  if (a_stride != NULL) *a_stride = src->u.YUVA.a_stride;\n\n  return src->u.YUVA.y;\n}\n\nint WebPISetIOHooks(WebPIDecoder* const idec,\n                    VP8IoPutHook put,\n                    VP8IoSetupHook setup,\n                    VP8IoTeardownHook teardown,\n                    void* user_data) {\n  if (idec == NULL || idec->state_ > STATE_WEBP_HEADER) {\n    return 0;\n  }\n\n  idec->io_.put = put;\n  idec->io_.setup = setup;\n  idec->io_.teardown = teardown;\n  idec->io_.opaque = user_data;\n\n  return 1;\n}\n\n"
  },
  {
    "path": "ext/libwebp/dec/io.c",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// functions for sample output.\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include <assert.h>\n#include <stdlib.h>\n#include \"../dec/vp8i.h\"\n#include \"./webpi.h\"\n#include \"../dsp/dsp.h\"\n#include \"../dsp/yuv.h\"\n#include \"../utils/utils.h\"\n\n//------------------------------------------------------------------------------\n// Main YUV<->RGB conversion functions\n\nstatic int EmitYUV(const VP8Io* const io, WebPDecParams* const p) {\n  WebPDecBuffer* output = p->output;\n  const WebPYUVABuffer* const buf = &output->u.YUVA;\n  uint8_t* const y_dst = buf->y + io->mb_y * buf->y_stride;\n  uint8_t* const u_dst = buf->u + (io->mb_y >> 1) * buf->u_stride;\n  uint8_t* const v_dst = buf->v + (io->mb_y >> 1) * buf->v_stride;\n  const int mb_w = io->mb_w;\n  const int mb_h = io->mb_h;\n  const int uv_w = (mb_w + 1) / 2;\n  const int uv_h = (mb_h + 1) / 2;\n  int j;\n  for (j = 0; j < mb_h; ++j) {\n    memcpy(y_dst + j * buf->y_stride, io->y + j * io->y_stride, mb_w);\n  }\n  for (j = 0; j < uv_h; ++j) {\n    memcpy(u_dst + j * buf->u_stride, io->u + j * io->uv_stride, uv_w);\n    memcpy(v_dst + j * buf->v_stride, io->v + j * io->uv_stride, uv_w);\n  }\n  return io->mb_h;\n}\n\n// Point-sampling U/V sampler.\nstatic int EmitSampledRGB(const VP8Io* const io, WebPDecParams* const p) {\n  WebPDecBuffer* const output = p->output;\n  WebPRGBABuffer* const buf = &output->u.RGBA;\n  uint8_t* const dst = buf->rgba + io->mb_y * buf->stride;\n  WebPSamplerProcessPlane(io->y, io->y_stride,\n                          io->u, io->v, io->uv_stride,\n                          dst, buf->stride, io->mb_w, io->mb_h,\n                          WebPSamplers[output->colorspace]);\n  return io->mb_h;\n}\n\n//------------------------------------------------------------------------------\n// YUV444 -> RGB conversion\n\n#if 0   // TODO(skal): this is for future rescaling.\nstatic int EmitRGB(const VP8Io* const io, WebPDecParams* const p) {\n  WebPDecBuffer* output = p->output;\n  const WebPRGBABuffer* const buf = &output->u.RGBA;\n  uint8_t* dst = buf->rgba + io->mb_y * buf->stride;\n  const uint8_t* y_src = io->y;\n  const uint8_t* u_src = io->u;\n  const uint8_t* v_src = io->v;\n  const WebPYUV444Converter convert = WebPYUV444Converters[output->colorspace];\n  const int mb_w = io->mb_w;\n  const int last = io->mb_h;\n  int j;\n  for (j = 0; j < last; ++j) {\n    convert(y_src, u_src, v_src, dst, mb_w);\n    y_src += io->y_stride;\n    u_src += io->uv_stride;\n    v_src += io->uv_stride;\n    dst += buf->stride;\n  }\n  return io->mb_h;\n}\n#endif\n\n//------------------------------------------------------------------------------\n// Fancy upsampling\n\n#ifdef FANCY_UPSAMPLING\nstatic int EmitFancyRGB(const VP8Io* const io, WebPDecParams* const p) {\n  int num_lines_out = io->mb_h;   // a priori guess\n  const WebPRGBABuffer* const buf = &p->output->u.RGBA;\n  uint8_t* dst = buf->rgba + io->mb_y * buf->stride;\n  WebPUpsampleLinePairFunc upsample = WebPUpsamplers[p->output->colorspace];\n  const uint8_t* cur_y = io->y;\n  const uint8_t* cur_u = io->u;\n  const uint8_t* cur_v = io->v;\n  const uint8_t* top_u = p->tmp_u;\n  const uint8_t* top_v = p->tmp_v;\n  int y = io->mb_y;\n  const int y_end = io->mb_y + io->mb_h;\n  const int mb_w = io->mb_w;\n  const int uv_w = (mb_w + 1) / 2;\n\n  if (y == 0) {\n    // First line is special cased. We mirror the u/v samples at boundary.\n    upsample(cur_y, NULL, cur_u, cur_v, cur_u, cur_v, dst, NULL, mb_w);\n  } else {\n    // We can finish the left-over line from previous call.\n    upsample(p->tmp_y, cur_y, top_u, top_v, cur_u, cur_v,\n             dst - buf->stride, dst, mb_w);\n    ++num_lines_out;\n  }\n  // Loop over each output pairs of row.\n  for (; y + 2 < y_end; y += 2) {\n    top_u = cur_u;\n    top_v = cur_v;\n    cur_u += io->uv_stride;\n    cur_v += io->uv_stride;\n    dst += 2 * buf->stride;\n    cur_y += 2 * io->y_stride;\n    upsample(cur_y - io->y_stride, cur_y,\n             top_u, top_v, cur_u, cur_v,\n             dst - buf->stride, dst, mb_w);\n  }\n  // move to last row\n  cur_y += io->y_stride;\n  if (io->crop_top + y_end < io->crop_bottom) {\n    // Save the unfinished samples for next call (as we're not done yet).\n    memcpy(p->tmp_y, cur_y, mb_w * sizeof(*p->tmp_y));\n    memcpy(p->tmp_u, cur_u, uv_w * sizeof(*p->tmp_u));\n    memcpy(p->tmp_v, cur_v, uv_w * sizeof(*p->tmp_v));\n    // The fancy upsampler leaves a row unfinished behind\n    // (except for the very last row)\n    num_lines_out--;\n  } else {\n    // Process the very last row of even-sized picture\n    if (!(y_end & 1)) {\n      upsample(cur_y, NULL, cur_u, cur_v, cur_u, cur_v,\n               dst + buf->stride, NULL, mb_w);\n    }\n  }\n  return num_lines_out;\n}\n\n#endif    /* FANCY_UPSAMPLING */\n\n//------------------------------------------------------------------------------\n\nstatic int EmitAlphaYUV(const VP8Io* const io, WebPDecParams* const p) {\n  const uint8_t* alpha = io->a;\n  const WebPYUVABuffer* const buf = &p->output->u.YUVA;\n  const int mb_w = io->mb_w;\n  const int mb_h = io->mb_h;\n  uint8_t* dst = buf->a + io->mb_y * buf->a_stride;\n  int j;\n\n  if (alpha != NULL) {\n    for (j = 0; j < mb_h; ++j) {\n      memcpy(dst, alpha, mb_w * sizeof(*dst));\n      alpha += io->width;\n      dst += buf->a_stride;\n    }\n  } else if (buf->a != NULL) {\n    // the user requested alpha, but there is none, set it to opaque.\n    for (j = 0; j < mb_h; ++j) {\n      memset(dst, 0xff, mb_w * sizeof(*dst));\n      dst += buf->a_stride;\n    }\n  }\n  return 0;\n}\n\nstatic int GetAlphaSourceRow(const VP8Io* const io,\n                             const uint8_t** alpha, int* const num_rows) {\n  int start_y = io->mb_y;\n  *num_rows = io->mb_h;\n\n  // Compensate for the 1-line delay of the fancy upscaler.\n  // This is similar to EmitFancyRGB().\n  if (io->fancy_upsampling) {\n    if (start_y == 0) {\n      // We don't process the last row yet. It'll be done during the next call.\n      --*num_rows;\n    } else {\n      --start_y;\n      // Fortunately, *alpha data is persistent, so we can go back\n      // one row and finish alpha blending, now that the fancy upscaler\n      // completed the YUV->RGB interpolation.\n      *alpha -= io->width;\n    }\n    if (io->crop_top + io->mb_y + io->mb_h == io->crop_bottom) {\n      // If it's the very last call, we process all the remaining rows!\n      *num_rows = io->crop_bottom - io->crop_top - start_y;\n    }\n  }\n  return start_y;\n}\n\nstatic int EmitAlphaRGB(const VP8Io* const io, WebPDecParams* const p) {\n  const uint8_t* alpha = io->a;\n  if (alpha != NULL) {\n    const int mb_w = io->mb_w;\n    const WEBP_CSP_MODE colorspace = p->output->colorspace;\n    const int alpha_first =\n        (colorspace == MODE_ARGB || colorspace == MODE_Argb);\n    const WebPRGBABuffer* const buf = &p->output->u.RGBA;\n    int num_rows;\n    const int start_y = GetAlphaSourceRow(io, &alpha, &num_rows);\n    uint8_t* const base_rgba = buf->rgba + start_y * buf->stride;\n    uint8_t* dst = base_rgba + (alpha_first ? 0 : 3);\n    uint32_t alpha_mask = 0xff;\n    int i, j;\n\n    for (j = 0; j < num_rows; ++j) {\n      for (i = 0; i < mb_w; ++i) {\n        const uint32_t alpha_value = alpha[i];\n        dst[4 * i] = alpha_value;\n        alpha_mask &= alpha_value;\n      }\n      alpha += io->width;\n      dst += buf->stride;\n    }\n    // alpha_mask is < 0xff if there's non-trivial alpha to premultiply with.\n    if (alpha_mask != 0xff && WebPIsPremultipliedMode(colorspace)) {\n      WebPApplyAlphaMultiply(base_rgba, alpha_first,\n                             mb_w, num_rows, buf->stride);\n    }\n  }\n  return 0;\n}\n\nstatic int EmitAlphaRGBA4444(const VP8Io* const io, WebPDecParams* const p) {\n  const uint8_t* alpha = io->a;\n  if (alpha != NULL) {\n    const int mb_w = io->mb_w;\n    const WEBP_CSP_MODE colorspace = p->output->colorspace;\n    const WebPRGBABuffer* const buf = &p->output->u.RGBA;\n    int num_rows;\n    const int start_y = GetAlphaSourceRow(io, &alpha, &num_rows);\n    uint8_t* const base_rgba = buf->rgba + start_y * buf->stride;\n#ifdef WEBP_SWAP_16BIT_CSP\n    uint8_t* alpha_dst = base_rgba;\n#else\n    uint8_t* alpha_dst = base_rgba + 1;\n#endif\n    uint32_t alpha_mask = 0x0f;\n    int i, j;\n\n    for (j = 0; j < num_rows; ++j) {\n      for (i = 0; i < mb_w; ++i) {\n        // Fill in the alpha value (converted to 4 bits).\n        const uint32_t alpha_value = alpha[i] >> 4;\n        alpha_dst[2 * i] = (alpha_dst[2 * i] & 0xf0) | alpha_value;\n        alpha_mask &= alpha_value;\n      }\n      alpha += io->width;\n      alpha_dst += buf->stride;\n    }\n    if (alpha_mask != 0x0f && WebPIsPremultipliedMode(colorspace)) {\n      WebPApplyAlphaMultiply4444(base_rgba, mb_w, num_rows, buf->stride);\n    }\n  }\n  return 0;\n}\n\n//------------------------------------------------------------------------------\n// YUV rescaling (no final RGB conversion needed)\n\nstatic int Rescale(const uint8_t* src, int src_stride,\n                   int new_lines, WebPRescaler* const wrk) {\n  int num_lines_out = 0;\n  while (new_lines > 0) {    // import new contributions of source rows.\n    const int lines_in = WebPRescalerImport(wrk, new_lines, src, src_stride);\n    src += lines_in * src_stride;\n    new_lines -= lines_in;\n    num_lines_out += WebPRescalerExport(wrk);    // emit output row(s)\n  }\n  return num_lines_out;\n}\n\nstatic int EmitRescaledYUV(const VP8Io* const io, WebPDecParams* const p) {\n  const int mb_h = io->mb_h;\n  const int uv_mb_h = (mb_h + 1) >> 1;\n  WebPRescaler* const scaler = &p->scaler_y;\n  int num_lines_out = 0;\n  if (WebPIsAlphaMode(p->output->colorspace) && io->a != NULL) {\n    // Before rescaling, we premultiply the luma directly into the io->y\n    // internal buffer. This is OK since these samples are not used for\n    // intra-prediction (the top samples are saved in cache_y_/u_/v_).\n    // But we need to cast the const away, though.\n    WebPMultRows((uint8_t*)io->y, io->y_stride,\n                 io->a, io->width, io->mb_w, mb_h, 0);\n  }\n  num_lines_out = Rescale(io->y, io->y_stride, mb_h, scaler);\n  Rescale(io->u, io->uv_stride, uv_mb_h, &p->scaler_u);\n  Rescale(io->v, io->uv_stride, uv_mb_h, &p->scaler_v);\n  return num_lines_out;\n}\n\nstatic int EmitRescaledAlphaYUV(const VP8Io* const io, WebPDecParams* const p) {\n  if (io->a != NULL) {\n    const WebPYUVABuffer* const buf = &p->output->u.YUVA;\n    uint8_t* dst_y = buf->y + p->last_y * buf->y_stride;\n    const uint8_t* src_a = buf->a + p->last_y * buf->a_stride;\n    const int num_lines_out = Rescale(io->a, io->width, io->mb_h, &p->scaler_a);\n    if (num_lines_out > 0) {   // unmultiply the Y\n      WebPMultRows(dst_y, buf->y_stride, src_a, buf->a_stride,\n                   p->scaler_a.dst_width, num_lines_out, 1);\n    }\n  }\n  return 0;\n}\n\nstatic int InitYUVRescaler(const VP8Io* const io, WebPDecParams* const p) {\n  const int has_alpha = WebPIsAlphaMode(p->output->colorspace);\n  const WebPYUVABuffer* const buf = &p->output->u.YUVA;\n  const int out_width  = io->scaled_width;\n  const int out_height = io->scaled_height;\n  const int uv_out_width  = (out_width + 1) >> 1;\n  const int uv_out_height = (out_height + 1) >> 1;\n  const int uv_in_width  = (io->mb_w + 1) >> 1;\n  const int uv_in_height = (io->mb_h + 1) >> 1;\n  const size_t work_size = 2 * out_width;   // scratch memory for luma rescaler\n  const size_t uv_work_size = 2 * uv_out_width;  // and for each u/v ones\n  size_t tmp_size;\n  int32_t* work;\n\n  tmp_size = (work_size + 2 * uv_work_size) * sizeof(*work);\n  if (has_alpha) {\n    tmp_size += work_size * sizeof(*work);\n  }\n  p->memory = WebPSafeCalloc(1ULL, tmp_size);\n  if (p->memory == NULL) {\n    return 0;   // memory error\n  }\n  work = (int32_t*)p->memory;\n  WebPRescalerInit(&p->scaler_y, io->mb_w, io->mb_h,\n                   buf->y, out_width, out_height, buf->y_stride, 1,\n                   io->mb_w, out_width, io->mb_h, out_height,\n                   work);\n  WebPRescalerInit(&p->scaler_u, uv_in_width, uv_in_height,\n                   buf->u, uv_out_width, uv_out_height, buf->u_stride, 1,\n                   uv_in_width, uv_out_width,\n                   uv_in_height, uv_out_height,\n                   work + work_size);\n  WebPRescalerInit(&p->scaler_v, uv_in_width, uv_in_height,\n                   buf->v, uv_out_width, uv_out_height, buf->v_stride, 1,\n                   uv_in_width, uv_out_width,\n                   uv_in_height, uv_out_height,\n                   work + work_size + uv_work_size);\n  p->emit = EmitRescaledYUV;\n\n  if (has_alpha) {\n    WebPRescalerInit(&p->scaler_a, io->mb_w, io->mb_h,\n                     buf->a, out_width, out_height, buf->a_stride, 1,\n                     io->mb_w, out_width, io->mb_h, out_height,\n                     work + work_size + 2 * uv_work_size);\n    p->emit_alpha = EmitRescaledAlphaYUV;\n    WebPInitAlphaProcessing();\n  }\n  return 1;\n}\n\n//------------------------------------------------------------------------------\n// RGBA rescaling\n\nstatic int ExportRGB(WebPDecParams* const p, int y_pos) {\n  const WebPYUV444Converter convert =\n      WebPYUV444Converters[p->output->colorspace];\n  const WebPRGBABuffer* const buf = &p->output->u.RGBA;\n  uint8_t* dst = buf->rgba + (p->last_y + y_pos) * buf->stride;\n  int num_lines_out = 0;\n  // For RGB rescaling, because of the YUV420, current scan position\n  // U/V can be +1/-1 line from the Y one.  Hence the double test.\n  while (WebPRescalerHasPendingOutput(&p->scaler_y) &&\n         WebPRescalerHasPendingOutput(&p->scaler_u)) {\n    assert(p->last_y + y_pos + num_lines_out < p->output->height);\n    assert(p->scaler_u.y_accum == p->scaler_v.y_accum);\n    WebPRescalerExportRow(&p->scaler_y, 0);\n    WebPRescalerExportRow(&p->scaler_u, 0);\n    WebPRescalerExportRow(&p->scaler_v, 0);\n    convert(p->scaler_y.dst, p->scaler_u.dst, p->scaler_v.dst,\n            dst, p->scaler_y.dst_width);\n    dst += buf->stride;\n    ++num_lines_out;\n  }\n  return num_lines_out;\n}\n\nstatic int EmitRescaledRGB(const VP8Io* const io, WebPDecParams* const p) {\n  const int mb_h = io->mb_h;\n  const int uv_mb_h = (mb_h + 1) >> 1;\n  int j = 0, uv_j = 0;\n  int num_lines_out = 0;\n  while (j < mb_h) {\n    const int y_lines_in =\n        WebPRescalerImport(&p->scaler_y, mb_h - j,\n                           io->y + j * io->y_stride, io->y_stride);\n    const int u_lines_in =\n        WebPRescalerImport(&p->scaler_u, uv_mb_h - uv_j,\n                           io->u + uv_j * io->uv_stride, io->uv_stride);\n    const int v_lines_in =\n        WebPRescalerImport(&p->scaler_v, uv_mb_h - uv_j,\n                           io->v + uv_j * io->uv_stride, io->uv_stride);\n    (void)v_lines_in;   // remove a gcc warning\n    assert(u_lines_in == v_lines_in);\n    j += y_lines_in;\n    uv_j += u_lines_in;\n    num_lines_out += ExportRGB(p, num_lines_out);\n  }\n  return num_lines_out;\n}\n\nstatic int ExportAlpha(WebPDecParams* const p, int y_pos) {\n  const WebPRGBABuffer* const buf = &p->output->u.RGBA;\n  uint8_t* const base_rgba = buf->rgba + (p->last_y + y_pos) * buf->stride;\n  const WEBP_CSP_MODE colorspace = p->output->colorspace;\n  const int alpha_first =\n      (colorspace == MODE_ARGB || colorspace == MODE_Argb);\n  uint8_t* dst = base_rgba + (alpha_first ? 0 : 3);\n  int num_lines_out = 0;\n  const int is_premult_alpha = WebPIsPremultipliedMode(colorspace);\n  uint32_t alpha_mask = 0xff;\n  const int width = p->scaler_a.dst_width;\n\n  while (WebPRescalerHasPendingOutput(&p->scaler_a)) {\n    int i;\n    assert(p->last_y + y_pos + num_lines_out < p->output->height);\n    WebPRescalerExportRow(&p->scaler_a, 0);\n    for (i = 0; i < width; ++i) {\n      const uint32_t alpha_value = p->scaler_a.dst[i];\n      dst[4 * i] = alpha_value;\n      alpha_mask &= alpha_value;\n    }\n    dst += buf->stride;\n    ++num_lines_out;\n  }\n  if (is_premult_alpha && alpha_mask != 0xff) {\n    WebPApplyAlphaMultiply(base_rgba, alpha_first,\n                           width, num_lines_out, buf->stride);\n  }\n  return num_lines_out;\n}\n\nstatic int ExportAlphaRGBA4444(WebPDecParams* const p, int y_pos) {\n  const WebPRGBABuffer* const buf = &p->output->u.RGBA;\n  uint8_t* const base_rgba = buf->rgba + (p->last_y + y_pos) * buf->stride;\n#ifdef WEBP_SWAP_16BIT_CSP\n  uint8_t* alpha_dst = base_rgba;\n#else\n  uint8_t* alpha_dst = base_rgba + 1;\n#endif\n  int num_lines_out = 0;\n  const WEBP_CSP_MODE colorspace = p->output->colorspace;\n  const int width = p->scaler_a.dst_width;\n  const int is_premult_alpha = WebPIsPremultipliedMode(colorspace);\n  uint32_t alpha_mask = 0x0f;\n\n  while (WebPRescalerHasPendingOutput(&p->scaler_a)) {\n    int i;\n    assert(p->last_y + y_pos + num_lines_out < p->output->height);\n    WebPRescalerExportRow(&p->scaler_a, 0);\n    for (i = 0; i < width; ++i) {\n      // Fill in the alpha value (converted to 4 bits).\n      const uint32_t alpha_value = p->scaler_a.dst[i] >> 4;\n      alpha_dst[2 * i] = (alpha_dst[2 * i] & 0xf0) | alpha_value;\n      alpha_mask &= alpha_value;\n    }\n    alpha_dst += buf->stride;\n    ++num_lines_out;\n  }\n  if (is_premult_alpha && alpha_mask != 0x0f) {\n    WebPApplyAlphaMultiply4444(base_rgba, width, num_lines_out, buf->stride);\n  }\n  return num_lines_out;\n}\n\nstatic int EmitRescaledAlphaRGB(const VP8Io* const io, WebPDecParams* const p) {\n  if (io->a != NULL) {\n    WebPRescaler* const scaler = &p->scaler_a;\n    int j = 0;\n    int pos = 0;\n    while (j < io->mb_h) {\n      j += WebPRescalerImport(scaler, io->mb_h - j,\n                              io->a + j * io->width, io->width);\n      pos += p->emit_alpha_row(p, pos);\n    }\n  }\n  return 0;\n}\n\nstatic int InitRGBRescaler(const VP8Io* const io, WebPDecParams* const p) {\n  const int has_alpha = WebPIsAlphaMode(p->output->colorspace);\n  const int out_width  = io->scaled_width;\n  const int out_height = io->scaled_height;\n  const int uv_in_width  = (io->mb_w + 1) >> 1;\n  const int uv_in_height = (io->mb_h + 1) >> 1;\n  const size_t work_size = 2 * out_width;   // scratch memory for one rescaler\n  int32_t* work;  // rescalers work area\n  uint8_t* tmp;   // tmp storage for scaled YUV444 samples before RGB conversion\n  size_t tmp_size1, tmp_size2, total_size;\n\n  tmp_size1 = 3 * work_size;\n  tmp_size2 = 3 * out_width;\n  if (has_alpha) {\n    tmp_size1 += work_size;\n    tmp_size2 += out_width;\n  }\n  total_size = tmp_size1 * sizeof(*work) + tmp_size2 * sizeof(*tmp);\n  p->memory = WebPSafeCalloc(1ULL, total_size);\n  if (p->memory == NULL) {\n    return 0;   // memory error\n  }\n  work = (int32_t*)p->memory;\n  tmp = (uint8_t*)(work + tmp_size1);\n  WebPRescalerInit(&p->scaler_y, io->mb_w, io->mb_h,\n                   tmp + 0 * out_width, out_width, out_height, 0, 1,\n                   io->mb_w, out_width, io->mb_h, out_height,\n                   work + 0 * work_size);\n  WebPRescalerInit(&p->scaler_u, uv_in_width, uv_in_height,\n                   tmp + 1 * out_width, out_width, out_height, 0, 1,\n                   io->mb_w, 2 * out_width, io->mb_h, 2 * out_height,\n                   work + 1 * work_size);\n  WebPRescalerInit(&p->scaler_v, uv_in_width, uv_in_height,\n                   tmp + 2 * out_width, out_width, out_height, 0, 1,\n                   io->mb_w, 2 * out_width, io->mb_h, 2 * out_height,\n                   work + 2 * work_size);\n  p->emit = EmitRescaledRGB;\n\n  if (has_alpha) {\n    WebPRescalerInit(&p->scaler_a, io->mb_w, io->mb_h,\n                     tmp + 3 * out_width, out_width, out_height, 0, 1,\n                     io->mb_w, out_width, io->mb_h, out_height,\n                     work + 3 * work_size);\n    p->emit_alpha = EmitRescaledAlphaRGB;\n    if (p->output->colorspace == MODE_RGBA_4444 ||\n        p->output->colorspace == MODE_rgbA_4444) {\n      p->emit_alpha_row = ExportAlphaRGBA4444;\n    } else {\n      p->emit_alpha_row = ExportAlpha;\n    }\n    WebPInitAlphaProcessing();\n  }\n  return 1;\n}\n\n//------------------------------------------------------------------------------\n// Default custom functions\n\nstatic int CustomSetup(VP8Io* io) {\n  WebPDecParams* const p = (WebPDecParams*)io->opaque;\n  const WEBP_CSP_MODE colorspace = p->output->colorspace;\n  const int is_rgb = WebPIsRGBMode(colorspace);\n  const int is_alpha = WebPIsAlphaMode(colorspace);\n\n  p->memory = NULL;\n  p->emit = NULL;\n  p->emit_alpha = NULL;\n  p->emit_alpha_row = NULL;\n  if (!WebPIoInitFromOptions(p->options, io, is_alpha ? MODE_YUV : MODE_YUVA)) {\n    return 0;\n  }\n  if (is_alpha && WebPIsPremultipliedMode(colorspace)) {\n    WebPInitUpsamplers();\n  }\n  if (io->use_scaling) {\n    const int ok = is_rgb ? InitRGBRescaler(io, p) : InitYUVRescaler(io, p);\n    if (!ok) {\n      return 0;    // memory error\n    }\n  } else {\n    if (is_rgb) {\n      p->emit = EmitSampledRGB;   // default\n      if (io->fancy_upsampling) {\n#ifdef FANCY_UPSAMPLING\n        const int uv_width = (io->mb_w + 1) >> 1;\n        p->memory = WebPSafeMalloc(1ULL, (size_t)(io->mb_w + 2 * uv_width));\n        if (p->memory == NULL) {\n          return 0;   // memory error.\n        }\n        p->tmp_y = (uint8_t*)p->memory;\n        p->tmp_u = p->tmp_y + io->mb_w;\n        p->tmp_v = p->tmp_u + uv_width;\n        p->emit = EmitFancyRGB;\n        WebPInitUpsamplers();\n#endif\n      } else {\n        WebPInitSamplers();\n      }\n    } else {\n      p->emit = EmitYUV;\n    }\n    if (is_alpha) {  // need transparency output\n      p->emit_alpha =\n          (colorspace == MODE_RGBA_4444 || colorspace == MODE_rgbA_4444) ?\n              EmitAlphaRGBA4444\n          : is_rgb ? EmitAlphaRGB\n          : EmitAlphaYUV;\n      if (is_rgb) {\n        WebPInitAlphaProcessing();\n      }\n    }\n  }\n\n  if (is_rgb) {\n    VP8YUVInit();\n  }\n  return 1;\n}\n\n//------------------------------------------------------------------------------\n\nstatic int CustomPut(const VP8Io* io) {\n  WebPDecParams* const p = (WebPDecParams*)io->opaque;\n  const int mb_w = io->mb_w;\n  const int mb_h = io->mb_h;\n  int num_lines_out;\n  assert(!(io->mb_y & 1));\n\n  if (mb_w <= 0 || mb_h <= 0) {\n    return 0;\n  }\n  num_lines_out = p->emit(io, p);\n  if (p->emit_alpha != NULL) {\n    p->emit_alpha(io, p);\n  }\n  p->last_y += num_lines_out;\n  return 1;\n}\n\n//------------------------------------------------------------------------------\n\nstatic void CustomTeardown(const VP8Io* io) {\n  WebPDecParams* const p = (WebPDecParams*)io->opaque;\n  WebPSafeFree(p->memory);\n  p->memory = NULL;\n}\n\n//------------------------------------------------------------------------------\n// Main entry point\n\nvoid WebPInitCustomIo(WebPDecParams* const params, VP8Io* const io) {\n  io->put      = CustomPut;\n  io->setup    = CustomSetup;\n  io->teardown = CustomTeardown;\n  io->opaque   = params;\n}\n\n//------------------------------------------------------------------------------\n"
  },
  {
    "path": "ext/libwebp/dec/quant.c",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Quantizer initialization\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include \"./vp8i.h\"\n\nstatic WEBP_INLINE int clip(int v, int M) {\n  return v < 0 ? 0 : v > M ? M : v;\n}\n\n// Paragraph 14.1\nstatic const uint8_t kDcTable[128] = {\n  4,     5,   6,   7,   8,   9,  10,  10,\n  11,   12,  13,  14,  15,  16,  17,  17,\n  18,   19,  20,  20,  21,  21,  22,  22,\n  23,   23,  24,  25,  25,  26,  27,  28,\n  29,   30,  31,  32,  33,  34,  35,  36,\n  37,   37,  38,  39,  40,  41,  42,  43,\n  44,   45,  46,  46,  47,  48,  49,  50,\n  51,   52,  53,  54,  55,  56,  57,  58,\n  59,   60,  61,  62,  63,  64,  65,  66,\n  67,   68,  69,  70,  71,  72,  73,  74,\n  75,   76,  76,  77,  78,  79,  80,  81,\n  82,   83,  84,  85,  86,  87,  88,  89,\n  91,   93,  95,  96,  98, 100, 101, 102,\n  104, 106, 108, 110, 112, 114, 116, 118,\n  122, 124, 126, 128, 130, 132, 134, 136,\n  138, 140, 143, 145, 148, 151, 154, 157\n};\n\nstatic const uint16_t kAcTable[128] = {\n  4,     5,   6,   7,   8,   9,  10,  11,\n  12,   13,  14,  15,  16,  17,  18,  19,\n  20,   21,  22,  23,  24,  25,  26,  27,\n  28,   29,  30,  31,  32,  33,  34,  35,\n  36,   37,  38,  39,  40,  41,  42,  43,\n  44,   45,  46,  47,  48,  49,  50,  51,\n  52,   53,  54,  55,  56,  57,  58,  60,\n  62,   64,  66,  68,  70,  72,  74,  76,\n  78,   80,  82,  84,  86,  88,  90,  92,\n  94,   96,  98, 100, 102, 104, 106, 108,\n  110, 112, 114, 116, 119, 122, 125, 128,\n  131, 134, 137, 140, 143, 146, 149, 152,\n  155, 158, 161, 164, 167, 170, 173, 177,\n  181, 185, 189, 193, 197, 201, 205, 209,\n  213, 217, 221, 225, 229, 234, 239, 245,\n  249, 254, 259, 264, 269, 274, 279, 284\n};\n\n//------------------------------------------------------------------------------\n// Paragraph 9.6\n\nvoid VP8ParseQuant(VP8Decoder* const dec) {\n  VP8BitReader* const br = &dec->br_;\n  const int base_q0 = VP8GetValue(br, 7);\n  const int dqy1_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;\n  const int dqy2_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;\n  const int dqy2_ac = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;\n  const int dquv_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;\n  const int dquv_ac = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;\n\n  const VP8SegmentHeader* const hdr = &dec->segment_hdr_;\n  int i;\n\n  for (i = 0; i < NUM_MB_SEGMENTS; ++i) {\n    int q;\n    if (hdr->use_segment_) {\n      q = hdr->quantizer_[i];\n      if (!hdr->absolute_delta_) {\n        q += base_q0;\n      }\n    } else {\n      if (i > 0) {\n        dec->dqm_[i] = dec->dqm_[0];\n        continue;\n      } else {\n        q = base_q0;\n      }\n    }\n    {\n      VP8QuantMatrix* const m = &dec->dqm_[i];\n      m->y1_mat_[0] = kDcTable[clip(q + dqy1_dc, 127)];\n      m->y1_mat_[1] = kAcTable[clip(q + 0,       127)];\n\n      m->y2_mat_[0] = kDcTable[clip(q + dqy2_dc, 127)] * 2;\n      // For all x in [0..284], x*155/100 is bitwise equal to (x*101581) >> 16.\n      // The smallest precision for that is '(x*6349) >> 12' but 16 is a good\n      // word size.\n      m->y2_mat_[1] = (kAcTable[clip(q + dqy2_ac, 127)] * 101581) >> 16;\n      if (m->y2_mat_[1] < 8) m->y2_mat_[1] = 8;\n\n      m->uv_mat_[0] = kDcTable[clip(q + dquv_dc, 117)];\n      m->uv_mat_[1] = kAcTable[clip(q + dquv_ac, 127)];\n\n      m->uv_quant_ = q + dquv_ac;   // for dithering strength evaluation\n    }\n  }\n}\n\n//------------------------------------------------------------------------------\n\n"
  },
  {
    "path": "ext/libwebp/dec/tree.c",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Coding trees and probas\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include \"./vp8i.h\"\n#include \"../utils/bit_reader_inl.h\"\n\n#define USE_GENERIC_TREE\n\n#ifdef USE_GENERIC_TREE\nstatic const int8_t kYModesIntra4[18] = {\n  -B_DC_PRED, 1,\n    -B_TM_PRED, 2,\n      -B_VE_PRED, 3,\n        4, 6,\n          -B_HE_PRED, 5,\n            -B_RD_PRED, -B_VR_PRED,\n        -B_LD_PRED, 7,\n          -B_VL_PRED, 8,\n            -B_HD_PRED, -B_HU_PRED\n};\n#endif\n\n//------------------------------------------------------------------------------\n// Default probabilities\n\n// Paragraph 13.5\nstatic const uint8_t\n  CoeffsProba0[NUM_TYPES][NUM_BANDS][NUM_CTX][NUM_PROBAS] = {\n  { { { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },\n      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },\n      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }\n    },\n    { { 253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128 },\n      { 189, 129, 242, 255, 227, 213, 255, 219, 128, 128, 128 },\n      { 106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128 }\n    },\n    { { 1, 98, 248, 255, 236, 226, 255, 255, 128, 128, 128 },\n      { 181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128 },\n      { 78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128 },\n    },\n    { { 1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128 },\n      { 184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128 },\n      { 77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128 },\n    },\n    { { 1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128 },\n      { 170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128 },\n      { 37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128 }\n    },\n    { { 1, 204, 254, 255, 245, 255, 128, 128, 128, 128, 128 },\n      { 207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128 },\n      { 102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128 }\n    },\n    { { 1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128 },\n      { 177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128 },\n      { 80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128 }\n    },\n    { { 1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 },\n      { 246, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 },\n      { 255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }\n    }\n  },\n  { { { 198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62 },\n      { 131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1 },\n      { 68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128 }\n    },\n    { { 1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128 },\n      { 184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128 },\n      { 81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128 }\n    },\n    { { 1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128 },\n      { 99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128 },\n      { 23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128 }\n    },\n    { { 1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128 },\n      { 109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128 },\n      { 44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128 }\n    },\n    { { 1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128 },\n      { 94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128 },\n      { 22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128 }\n    },\n    { { 1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128 },\n      { 124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128 },\n      { 35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128 }\n    },\n    { { 1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128 },\n      { 121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128 },\n      { 45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128 }\n    },\n    { { 1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128 },\n      { 203, 1, 248, 255, 255, 128, 128, 128, 128, 128, 128 },\n      { 137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128 }\n    }\n  },\n  { { { 253, 9, 248, 251, 207, 208, 255, 192, 128, 128, 128 },\n      { 175, 13, 224, 243, 193, 185, 249, 198, 255, 255, 128 },\n      { 73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128 }\n    },\n    { { 1, 95, 247, 253, 212, 183, 255, 255, 128, 128, 128 },\n      { 239, 90, 244, 250, 211, 209, 255, 255, 128, 128, 128 },\n      { 155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128 }\n    },\n    { { 1, 24, 239, 251, 218, 219, 255, 205, 128, 128, 128 },\n      { 201, 51, 219, 255, 196, 186, 128, 128, 128, 128, 128 },\n      { 69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128 }\n    },\n    { { 1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128 },\n      { 223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128 },\n      { 141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128 }\n    },\n    { { 1, 16, 248, 255, 255, 128, 128, 128, 128, 128, 128 },\n      { 190, 36, 230, 255, 236, 255, 128, 128, 128, 128, 128 },\n      { 149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }\n    },\n    { { 1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128 },\n      { 247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128 },\n      { 240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128 }\n    },\n    { { 1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128 },\n      { 213, 62, 250, 255, 255, 128, 128, 128, 128, 128, 128 },\n      { 55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128 }\n    },\n    { { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },\n      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },\n      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }\n    }\n  },\n  { { { 202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 255 },\n      { 126, 38, 182, 232, 169, 184, 228, 174, 255, 187, 128 },\n      { 61, 46, 138, 219, 151, 178, 240, 170, 255, 216, 128 }\n    },\n    { { 1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128 },\n      { 166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128 },\n      { 39, 77, 162, 232, 172, 180, 245, 178, 255, 255, 128 }\n    },\n    { { 1, 52, 220, 246, 198, 199, 249, 220, 255, 255, 128 },\n      { 124, 74, 191, 243, 183, 193, 250, 221, 255, 255, 128 },\n      { 24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128 }\n    },\n    { { 1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128 },\n      { 149, 150, 226, 252, 216, 205, 255, 171, 128, 128, 128 },\n      { 28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128 }\n    },\n    { { 1, 81, 230, 252, 204, 203, 255, 192, 128, 128, 128 },\n      { 123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128 },\n      { 20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128 }\n    },\n    { { 1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128 },\n      { 168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128 },\n      { 47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128 }\n    },\n    { { 1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128 },\n      { 141, 84, 213, 252, 201, 202, 255, 219, 128, 128, 128 },\n      { 42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128 }\n    },\n    { { 1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 },\n      { 244, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 },\n      { 238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }\n    }\n  }\n};\n\n// Paragraph 11.5\nstatic const uint8_t kBModesProba[NUM_BMODES][NUM_BMODES][NUM_BMODES - 1] = {\n  { { 231, 120, 48, 89, 115, 113, 120, 152, 112 },\n    { 152, 179, 64, 126, 170, 118, 46, 70, 95 },\n    { 175, 69, 143, 80, 85, 82, 72, 155, 103 },\n    { 56, 58, 10, 171, 218, 189, 17, 13, 152 },\n    { 114, 26, 17, 163, 44, 195, 21, 10, 173 },\n    { 121, 24, 80, 195, 26, 62, 44, 64, 85 },\n    { 144, 71, 10, 38, 171, 213, 144, 34, 26 },\n    { 170, 46, 55, 19, 136, 160, 33, 206, 71 },\n    { 63, 20, 8, 114, 114, 208, 12, 9, 226 },\n    { 81, 40, 11, 96, 182, 84, 29, 16, 36 } },\n  { { 134, 183, 89, 137, 98, 101, 106, 165, 148 },\n    { 72, 187, 100, 130, 157, 111, 32, 75, 80 },\n    { 66, 102, 167, 99, 74, 62, 40, 234, 128 },\n    { 41, 53, 9, 178, 241, 141, 26, 8, 107 },\n    { 74, 43, 26, 146, 73, 166, 49, 23, 157 },\n    { 65, 38, 105, 160, 51, 52, 31, 115, 128 },\n    { 104, 79, 12, 27, 217, 255, 87, 17, 7 },\n    { 87, 68, 71, 44, 114, 51, 15, 186, 23 },\n    { 47, 41, 14, 110, 182, 183, 21, 17, 194 },\n    { 66, 45, 25, 102, 197, 189, 23, 18, 22 } },\n  { { 88, 88, 147, 150, 42, 46, 45, 196, 205 },\n    { 43, 97, 183, 117, 85, 38, 35, 179, 61 },\n    { 39, 53, 200, 87, 26, 21, 43, 232, 171 },\n    { 56, 34, 51, 104, 114, 102, 29, 93, 77 },\n    { 39, 28, 85, 171, 58, 165, 90, 98, 64 },\n    { 34, 22, 116, 206, 23, 34, 43, 166, 73 },\n    { 107, 54, 32, 26, 51, 1, 81, 43, 31 },\n    { 68, 25, 106, 22, 64, 171, 36, 225, 114 },\n    { 34, 19, 21, 102, 132, 188, 16, 76, 124 },\n    { 62, 18, 78, 95, 85, 57, 50, 48, 51 } },\n  { { 193, 101, 35, 159, 215, 111, 89, 46, 111 },\n    { 60, 148, 31, 172, 219, 228, 21, 18, 111 },\n    { 112, 113, 77, 85, 179, 255, 38, 120, 114 },\n    { 40, 42, 1, 196, 245, 209, 10, 25, 109 },\n    { 88, 43, 29, 140, 166, 213, 37, 43, 154 },\n    { 61, 63, 30, 155, 67, 45, 68, 1, 209 },\n    { 100, 80, 8, 43, 154, 1, 51, 26, 71 },\n    { 142, 78, 78, 16, 255, 128, 34, 197, 171 },\n    { 41, 40, 5, 102, 211, 183, 4, 1, 221 },\n    { 51, 50, 17, 168, 209, 192, 23, 25, 82 } },\n  { { 138, 31, 36, 171, 27, 166, 38, 44, 229 },\n    { 67, 87, 58, 169, 82, 115, 26, 59, 179 },\n    { 63, 59, 90, 180, 59, 166, 93, 73, 154 },\n    { 40, 40, 21, 116, 143, 209, 34, 39, 175 },\n    { 47, 15, 16, 183, 34, 223, 49, 45, 183 },\n    { 46, 17, 33, 183, 6, 98, 15, 32, 183 },\n    { 57, 46, 22, 24, 128, 1, 54, 17, 37 },\n    { 65, 32, 73, 115, 28, 128, 23, 128, 205 },\n    { 40, 3, 9, 115, 51, 192, 18, 6, 223 },\n    { 87, 37, 9, 115, 59, 77, 64, 21, 47 } },\n  { { 104, 55, 44, 218, 9, 54, 53, 130, 226 },\n    { 64, 90, 70, 205, 40, 41, 23, 26, 57 },\n    { 54, 57, 112, 184, 5, 41, 38, 166, 213 },\n    { 30, 34, 26, 133, 152, 116, 10, 32, 134 },\n    { 39, 19, 53, 221, 26, 114, 32, 73, 255 },\n    { 31, 9, 65, 234, 2, 15, 1, 118, 73 },\n    { 75, 32, 12, 51, 192, 255, 160, 43, 51 },\n    { 88, 31, 35, 67, 102, 85, 55, 186, 85 },\n    { 56, 21, 23, 111, 59, 205, 45, 37, 192 },\n    { 55, 38, 70, 124, 73, 102, 1, 34, 98 } },\n  { { 125, 98, 42, 88, 104, 85, 117, 175, 82 },\n    { 95, 84, 53, 89, 128, 100, 113, 101, 45 },\n    { 75, 79, 123, 47, 51, 128, 81, 171, 1 },\n    { 57, 17, 5, 71, 102, 57, 53, 41, 49 },\n    { 38, 33, 13, 121, 57, 73, 26, 1, 85 },\n    { 41, 10, 67, 138, 77, 110, 90, 47, 114 },\n    { 115, 21, 2, 10, 102, 255, 166, 23, 6 },\n    { 101, 29, 16, 10, 85, 128, 101, 196, 26 },\n    { 57, 18, 10, 102, 102, 213, 34, 20, 43 },\n    { 117, 20, 15, 36, 163, 128, 68, 1, 26 } },\n  { { 102, 61, 71, 37, 34, 53, 31, 243, 192 },\n    { 69, 60, 71, 38, 73, 119, 28, 222, 37 },\n    { 68, 45, 128, 34, 1, 47, 11, 245, 171 },\n    { 62, 17, 19, 70, 146, 85, 55, 62, 70 },\n    { 37, 43, 37, 154, 100, 163, 85, 160, 1 },\n    { 63, 9, 92, 136, 28, 64, 32, 201, 85 },\n    { 75, 15, 9, 9, 64, 255, 184, 119, 16 },\n    { 86, 6, 28, 5, 64, 255, 25, 248, 1 },\n    { 56, 8, 17, 132, 137, 255, 55, 116, 128 },\n    { 58, 15, 20, 82, 135, 57, 26, 121, 40 } },\n  { { 164, 50, 31, 137, 154, 133, 25, 35, 218 },\n    { 51, 103, 44, 131, 131, 123, 31, 6, 158 },\n    { 86, 40, 64, 135, 148, 224, 45, 183, 128 },\n    { 22, 26, 17, 131, 240, 154, 14, 1, 209 },\n    { 45, 16, 21, 91, 64, 222, 7, 1, 197 },\n    { 56, 21, 39, 155, 60, 138, 23, 102, 213 },\n    { 83, 12, 13, 54, 192, 255, 68, 47, 28 },\n    { 85, 26, 85, 85, 128, 128, 32, 146, 171 },\n    { 18, 11, 7, 63, 144, 171, 4, 4, 246 },\n    { 35, 27, 10, 146, 174, 171, 12, 26, 128 } },\n  { { 190, 80, 35, 99, 180, 80, 126, 54, 45 },\n    { 85, 126, 47, 87, 176, 51, 41, 20, 32 },\n    { 101, 75, 128, 139, 118, 146, 116, 128, 85 },\n    { 56, 41, 15, 176, 236, 85, 37, 9, 62 },\n    { 71, 30, 17, 119, 118, 255, 17, 18, 138 },\n    { 101, 38, 60, 138, 55, 70, 43, 26, 142 },\n    { 146, 36, 19, 30, 171, 255, 97, 27, 20 },\n    { 138, 45, 61, 62, 219, 1, 81, 188, 64 },\n    { 32, 41, 20, 117, 151, 142, 20, 21, 163 },\n    { 112, 19, 12, 61, 195, 128, 48, 4, 24 } }\n};\n\nvoid VP8ResetProba(VP8Proba* const proba) {\n  memset(proba->segments_, 255u, sizeof(proba->segments_));\n  // proba->bands_[][] is initialized later\n}\n\nstatic void ParseIntraMode(VP8BitReader* const br,\n                           VP8Decoder* const dec, int mb_x) {\n  uint8_t* const top = dec->intra_t_ + 4 * mb_x;\n  uint8_t* const left = dec->intra_l_;\n  VP8MBData* const block = dec->mb_data_ + mb_x;\n\n  // Note: we don't save segment map (yet), as we don't expect\n  // to decode more than 1 keyframe.\n  if (dec->segment_hdr_.update_map_) {\n    // Hardcoded tree parsing\n    block->segment_ = !VP8GetBit(br, dec->proba_.segments_[0])\n                    ? VP8GetBit(br, dec->proba_.segments_[1])\n                    : 2 + VP8GetBit(br, dec->proba_.segments_[2]);\n  } else {\n    block->segment_ = 0;  // default for intra\n  }\n  if (dec->use_skip_proba_) block->skip_ = VP8GetBit(br, dec->skip_p_);\n\n  block->is_i4x4_ = !VP8GetBit(br, 145);   // decide for B_PRED first\n  if (!block->is_i4x4_) {\n    // Hardcoded 16x16 intra-mode decision tree.\n    const int ymode =\n        VP8GetBit(br, 156) ? (VP8GetBit(br, 128) ? TM_PRED : H_PRED)\n                           : (VP8GetBit(br, 163) ? V_PRED : DC_PRED);\n    block->imodes_[0] = ymode;\n    memset(top, ymode, 4 * sizeof(*top));\n    memset(left, ymode, 4 * sizeof(*left));\n  } else {\n    uint8_t* modes = block->imodes_;\n    int y;\n    for (y = 0; y < 4; ++y) {\n      int ymode = left[y];\n      int x;\n      for (x = 0; x < 4; ++x) {\n        const uint8_t* const prob = kBModesProba[top[x]][ymode];\n#ifdef USE_GENERIC_TREE\n        // Generic tree-parsing\n        int i = kYModesIntra4[VP8GetBit(br, prob[0])];\n        while (i > 0) {\n          i = kYModesIntra4[2 * i + VP8GetBit(br, prob[i])];\n        }\n        ymode = -i;\n#else\n        // Hardcoded tree parsing\n        ymode = !VP8GetBit(br, prob[0]) ? B_DC_PRED :\n                  !VP8GetBit(br, prob[1]) ? B_TM_PRED :\n                    !VP8GetBit(br, prob[2]) ? B_VE_PRED :\n                      !VP8GetBit(br, prob[3]) ?\n                        (!VP8GetBit(br, prob[4]) ? B_HE_PRED :\n                          (!VP8GetBit(br, prob[5]) ? B_RD_PRED : B_VR_PRED)) :\n                        (!VP8GetBit(br, prob[6]) ? B_LD_PRED :\n                          (!VP8GetBit(br, prob[7]) ? B_VL_PRED :\n                            (!VP8GetBit(br, prob[8]) ? B_HD_PRED : B_HU_PRED)));\n#endif    // USE_GENERIC_TREE\n        top[x] = ymode;\n      }\n      memcpy(modes, top, 4 * sizeof(*top));\n      modes += 4;\n      left[y] = ymode;\n    }\n  }\n  // Hardcoded UVMode decision tree\n  block->uvmode_ = !VP8GetBit(br, 142) ? DC_PRED\n                 : !VP8GetBit(br, 114) ? V_PRED\n                 : VP8GetBit(br, 183) ? TM_PRED : H_PRED;\n}\n\nint VP8ParseIntraModeRow(VP8BitReader* const br, VP8Decoder* const dec) {\n  int mb_x;\n  for (mb_x = 0; mb_x < dec->mb_w_; ++mb_x) {\n    ParseIntraMode(br, dec, mb_x);\n  }\n  return !dec->br_.eof_;\n}\n\n//------------------------------------------------------------------------------\n// Paragraph 13\n\nstatic const uint8_t\n    CoeffsUpdateProba[NUM_TYPES][NUM_BANDS][NUM_CTX][NUM_PROBAS] = {\n  { { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 176, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 223, 241, 252, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 249, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 244, 252, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 234, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 246, 254, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 239, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 251, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 251, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 254, 253, 255, 254, 255, 255, 255, 255, 255, 255 },\n      { 250, 255, 254, 255, 254, 255, 255, 255, 255, 255, 255 },\n      { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }\n    }\n  },\n  { { { 217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 225, 252, 241, 253, 255, 255, 254, 255, 255, 255, 255 },\n      { 234, 250, 241, 250, 253, 255, 253, 254, 255, 255, 255 }\n    },\n    { { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 223, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 238, 253, 254, 254, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 249, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 247, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }\n    }\n  },\n  { { { 186, 251, 250, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 234, 251, 244, 254, 255, 255, 255, 255, 255, 255, 255 },\n      { 251, 251, 243, 253, 254, 255, 254, 255, 255, 255, 255 }\n    },\n    { { 255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 236, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 251, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }\n    }\n  },\n  { { { 248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 250, 254, 252, 254, 255, 255, 255, 255, 255, 255, 255 },\n      { 248, 254, 249, 253, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 246, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 252, 254, 251, 254, 254, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 254, 252, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 248, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 253, 255, 254, 254, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 245, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 253, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 252, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 249, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 255, 253, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }\n    },\n    { { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },\n      { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }\n    }\n  }\n};\n\n// Paragraph 9.9\nvoid VP8ParseProba(VP8BitReader* const br, VP8Decoder* const dec) {\n  VP8Proba* const proba = &dec->proba_;\n  int t, b, c, p;\n  for (t = 0; t < NUM_TYPES; ++t) {\n    for (b = 0; b < NUM_BANDS; ++b) {\n      for (c = 0; c < NUM_CTX; ++c) {\n        for (p = 0; p < NUM_PROBAS; ++p) {\n          const int v = VP8GetBit(br, CoeffsUpdateProba[t][b][c][p]) ?\n                        VP8GetValue(br, 8) : CoeffsProba0[t][b][c][p];\n          proba->bands_[t][b].probas_[c][p] = v;\n        }\n      }\n    }\n  }\n  dec->use_skip_proba_ = VP8Get(br);\n  if (dec->use_skip_proba_) {\n    dec->skip_p_ = VP8GetValue(br, 8);\n  }\n}\n\n"
  },
  {
    "path": "ext/libwebp/dec/vp8.c",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// main entry for the decoder\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include <stdlib.h>\n\n#include \"./alphai.h\"\n#include \"./vp8i.h\"\n#include \"./vp8li.h\"\n#include \"./webpi.h\"\n#include \"../utils/bit_reader_inl.h\"\n#include \"../utils/utils.h\"\n\n//------------------------------------------------------------------------------\n\nint WebPGetDecoderVersion(void) {\n  return (DEC_MAJ_VERSION << 16) | (DEC_MIN_VERSION << 8) | DEC_REV_VERSION;\n}\n\n//------------------------------------------------------------------------------\n// VP8Decoder\n\nstatic void SetOk(VP8Decoder* const dec) {\n  dec->status_ = VP8_STATUS_OK;\n  dec->error_msg_ = \"OK\";\n}\n\nint VP8InitIoInternal(VP8Io* const io, int version) {\n  if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_DECODER_ABI_VERSION)) {\n    return 0;  // mismatch error\n  }\n  if (io != NULL) {\n    memset(io, 0, sizeof(*io));\n  }\n  return 1;\n}\n\nVP8Decoder* VP8New(void) {\n  VP8Decoder* const dec = (VP8Decoder*)WebPSafeCalloc(1ULL, sizeof(*dec));\n  if (dec != NULL) {\n    SetOk(dec);\n    WebPGetWorkerInterface()->Init(&dec->worker_);\n    dec->ready_ = 0;\n    dec->num_parts_ = 1;\n  }\n  return dec;\n}\n\nVP8StatusCode VP8Status(VP8Decoder* const dec) {\n  if (!dec) return VP8_STATUS_INVALID_PARAM;\n  return dec->status_;\n}\n\nconst char* VP8StatusMessage(VP8Decoder* const dec) {\n  if (dec == NULL) return \"no object\";\n  if (!dec->error_msg_) return \"OK\";\n  return dec->error_msg_;\n}\n\nvoid VP8Delete(VP8Decoder* const dec) {\n  if (dec != NULL) {\n    VP8Clear(dec);\n    WebPSafeFree(dec);\n  }\n}\n\nint VP8SetError(VP8Decoder* const dec,\n                VP8StatusCode error, const char* const msg) {\n  // TODO This check would be unnecessary if alpha decompression was separated\n  // from VP8ProcessRow/FinishRow. This avoids setting 'dec->status_' to\n  // something other than VP8_STATUS_BITSTREAM_ERROR on alpha decompression\n  // failure.\n  if (dec->status_ == VP8_STATUS_OK) {\n    dec->status_ = error;\n    dec->error_msg_ = msg;\n    dec->ready_ = 0;\n  }\n  return 0;\n}\n\n//------------------------------------------------------------------------------\n\nint VP8CheckSignature(const uint8_t* const data, size_t data_size) {\n  return (data_size >= 3 &&\n          data[0] == 0x9d && data[1] == 0x01 && data[2] == 0x2a);\n}\n\nint VP8GetInfo(const uint8_t* data, size_t data_size, size_t chunk_size,\n               int* const width, int* const height) {\n  if (data == NULL || data_size < VP8_FRAME_HEADER_SIZE) {\n    return 0;         // not enough data\n  }\n  // check signature\n  if (!VP8CheckSignature(data + 3, data_size - 3)) {\n    return 0;         // Wrong signature.\n  } else {\n    const uint32_t bits = data[0] | (data[1] << 8) | (data[2] << 16);\n    const int key_frame = !(bits & 1);\n    const int w = ((data[7] << 8) | data[6]) & 0x3fff;\n    const int h = ((data[9] << 8) | data[8]) & 0x3fff;\n\n    if (!key_frame) {   // Not a keyframe.\n      return 0;\n    }\n\n    if (((bits >> 1) & 7) > 3) {\n      return 0;         // unknown profile\n    }\n    if (!((bits >> 4) & 1)) {\n      return 0;         // first frame is invisible!\n    }\n    if (((bits >> 5)) >= chunk_size) {  // partition_length\n      return 0;         // inconsistent size information.\n    }\n    if (w == 0 || h == 0) {\n      return 0;         // We don't support both width and height to be zero.\n    }\n\n    if (width) {\n      *width = w;\n    }\n    if (height) {\n      *height = h;\n    }\n\n    return 1;\n  }\n}\n\n//------------------------------------------------------------------------------\n// Header parsing\n\nstatic void ResetSegmentHeader(VP8SegmentHeader* const hdr) {\n  assert(hdr != NULL);\n  hdr->use_segment_ = 0;\n  hdr->update_map_ = 0;\n  hdr->absolute_delta_ = 1;\n  memset(hdr->quantizer_, 0, sizeof(hdr->quantizer_));\n  memset(hdr->filter_strength_, 0, sizeof(hdr->filter_strength_));\n}\n\n// Paragraph 9.3\nstatic int ParseSegmentHeader(VP8BitReader* br,\n                              VP8SegmentHeader* hdr, VP8Proba* proba) {\n  assert(br != NULL);\n  assert(hdr != NULL);\n  hdr->use_segment_ = VP8Get(br);\n  if (hdr->use_segment_) {\n    hdr->update_map_ = VP8Get(br);\n    if (VP8Get(br)) {   // update data\n      int s;\n      hdr->absolute_delta_ = VP8Get(br);\n      for (s = 0; s < NUM_MB_SEGMENTS; ++s) {\n        hdr->quantizer_[s] = VP8Get(br) ? VP8GetSignedValue(br, 7) : 0;\n      }\n      for (s = 0; s < NUM_MB_SEGMENTS; ++s) {\n        hdr->filter_strength_[s] = VP8Get(br) ? VP8GetSignedValue(br, 6) : 0;\n      }\n    }\n    if (hdr->update_map_) {\n      int s;\n      for (s = 0; s < MB_FEATURE_TREE_PROBS; ++s) {\n        proba->segments_[s] = VP8Get(br) ? VP8GetValue(br, 8) : 255u;\n      }\n    }\n  } else {\n    hdr->update_map_ = 0;\n  }\n  return !br->eof_;\n}\n\n// Paragraph 9.5\n// This function returns VP8_STATUS_SUSPENDED if we don't have all the\n// necessary data in 'buf'.\n// This case is not necessarily an error (for incremental decoding).\n// Still, no bitreader is ever initialized to make it possible to read\n// unavailable memory.\n// If we don't even have the partitions' sizes, than VP8_STATUS_NOT_ENOUGH_DATA\n// is returned, and this is an unrecoverable error.\n// If the partitions were positioned ok, VP8_STATUS_OK is returned.\nstatic VP8StatusCode ParsePartitions(VP8Decoder* const dec,\n                                     const uint8_t* buf, size_t size) {\n  VP8BitReader* const br = &dec->br_;\n  const uint8_t* sz = buf;\n  const uint8_t* buf_end = buf + size;\n  const uint8_t* part_start;\n  int last_part;\n  int p;\n\n  dec->num_parts_ = 1 << VP8GetValue(br, 2);\n  last_part = dec->num_parts_ - 1;\n  part_start = buf + last_part * 3;\n  if (buf_end < part_start) {\n    // we can't even read the sizes with sz[]! That's a failure.\n    return VP8_STATUS_NOT_ENOUGH_DATA;\n  }\n  for (p = 0; p < last_part; ++p) {\n    const uint32_t psize = sz[0] | (sz[1] << 8) | (sz[2] << 16);\n    const uint8_t* part_end = part_start + psize;\n    if (part_end > buf_end) part_end = buf_end;\n    VP8InitBitReader(dec->parts_ + p, part_start, part_end);\n    part_start = part_end;\n    sz += 3;\n  }\n  VP8InitBitReader(dec->parts_ + last_part, part_start, buf_end);\n  return (part_start < buf_end) ? VP8_STATUS_OK :\n           VP8_STATUS_SUSPENDED;   // Init is ok, but there's not enough data\n}\n\n// Paragraph 9.4\nstatic int ParseFilterHeader(VP8BitReader* br, VP8Decoder* const dec) {\n  VP8FilterHeader* const hdr = &dec->filter_hdr_;\n  hdr->simple_    = VP8Get(br);\n  hdr->level_     = VP8GetValue(br, 6);\n  hdr->sharpness_ = VP8GetValue(br, 3);\n  hdr->use_lf_delta_ = VP8Get(br);\n  if (hdr->use_lf_delta_) {\n    if (VP8Get(br)) {   // update lf-delta?\n      int i;\n      for (i = 0; i < NUM_REF_LF_DELTAS; ++i) {\n        if (VP8Get(br)) {\n          hdr->ref_lf_delta_[i] = VP8GetSignedValue(br, 6);\n        }\n      }\n      for (i = 0; i < NUM_MODE_LF_DELTAS; ++i) {\n        if (VP8Get(br)) {\n          hdr->mode_lf_delta_[i] = VP8GetSignedValue(br, 6);\n        }\n      }\n    }\n  }\n  dec->filter_type_ = (hdr->level_ == 0) ? 0 : hdr->simple_ ? 1 : 2;\n  return !br->eof_;\n}\n\n// Topmost call\nint VP8GetHeaders(VP8Decoder* const dec, VP8Io* const io) {\n  const uint8_t* buf;\n  size_t buf_size;\n  VP8FrameHeader* frm_hdr;\n  VP8PictureHeader* pic_hdr;\n  VP8BitReader* br;\n  VP8StatusCode status;\n\n  if (dec == NULL) {\n    return 0;\n  }\n  SetOk(dec);\n  if (io == NULL) {\n    return VP8SetError(dec, VP8_STATUS_INVALID_PARAM,\n                       \"null VP8Io passed to VP8GetHeaders()\");\n  }\n  buf = io->data;\n  buf_size = io->data_size;\n  if (buf_size < 4) {\n    return VP8SetError(dec, VP8_STATUS_NOT_ENOUGH_DATA,\n                       \"Truncated header.\");\n  }\n\n  // Paragraph 9.1\n  {\n    const uint32_t bits = buf[0] | (buf[1] << 8) | (buf[2] << 16);\n    frm_hdr = &dec->frm_hdr_;\n    frm_hdr->key_frame_ = !(bits & 1);\n    frm_hdr->profile_ = (bits >> 1) & 7;\n    frm_hdr->show_ = (bits >> 4) & 1;\n    frm_hdr->partition_length_ = (bits >> 5);\n    if (frm_hdr->profile_ > 3)\n      return VP8SetError(dec, VP8_STATUS_BITSTREAM_ERROR,\n                         \"Incorrect keyframe parameters.\");\n    if (!frm_hdr->show_)\n      return VP8SetError(dec, VP8_STATUS_UNSUPPORTED_FEATURE,\n                         \"Frame not displayable.\");\n    buf += 3;\n    buf_size -= 3;\n  }\n\n  pic_hdr = &dec->pic_hdr_;\n  if (frm_hdr->key_frame_) {\n    // Paragraph 9.2\n    if (buf_size < 7) {\n      return VP8SetError(dec, VP8_STATUS_NOT_ENOUGH_DATA,\n                         \"cannot parse picture header\");\n    }\n    if (!VP8CheckSignature(buf, buf_size)) {\n      return VP8SetError(dec, VP8_STATUS_BITSTREAM_ERROR,\n                         \"Bad code word\");\n    }\n    pic_hdr->width_ = ((buf[4] << 8) | buf[3]) & 0x3fff;\n    pic_hdr->xscale_ = buf[4] >> 6;   // ratio: 1, 5/4 5/3 or 2\n    pic_hdr->height_ = ((buf[6] << 8) | buf[5]) & 0x3fff;\n    pic_hdr->yscale_ = buf[6] >> 6;\n    buf += 7;\n    buf_size -= 7;\n\n    dec->mb_w_ = (pic_hdr->width_ + 15) >> 4;\n    dec->mb_h_ = (pic_hdr->height_ + 15) >> 4;\n    // Setup default output area (can be later modified during io->setup())\n    io->width = pic_hdr->width_;\n    io->height = pic_hdr->height_;\n    io->use_scaling  = 0;\n    io->use_cropping = 0;\n    io->crop_top  = 0;\n    io->crop_left = 0;\n    io->crop_right  = io->width;\n    io->crop_bottom = io->height;\n    io->mb_w = io->width;   // sanity check\n    io->mb_h = io->height;  // ditto\n\n    VP8ResetProba(&dec->proba_);\n    ResetSegmentHeader(&dec->segment_hdr_);\n  }\n\n  // Check if we have all the partition #0 available, and initialize dec->br_\n  // to read this partition (and this partition only).\n  if (frm_hdr->partition_length_ > buf_size) {\n    return VP8SetError(dec, VP8_STATUS_NOT_ENOUGH_DATA,\n                       \"bad partition length\");\n  }\n\n  br = &dec->br_;\n  VP8InitBitReader(br, buf, buf + frm_hdr->partition_length_);\n  buf += frm_hdr->partition_length_;\n  buf_size -= frm_hdr->partition_length_;\n\n  if (frm_hdr->key_frame_) {\n    pic_hdr->colorspace_ = VP8Get(br);\n    pic_hdr->clamp_type_ = VP8Get(br);\n  }\n  if (!ParseSegmentHeader(br, &dec->segment_hdr_, &dec->proba_)) {\n    return VP8SetError(dec, VP8_STATUS_BITSTREAM_ERROR,\n                       \"cannot parse segment header\");\n  }\n  // Filter specs\n  if (!ParseFilterHeader(br, dec)) {\n    return VP8SetError(dec, VP8_STATUS_BITSTREAM_ERROR,\n                       \"cannot parse filter header\");\n  }\n  status = ParsePartitions(dec, buf, buf_size);\n  if (status != VP8_STATUS_OK) {\n    return VP8SetError(dec, status, \"cannot parse partitions\");\n  }\n\n  // quantizer change\n  VP8ParseQuant(dec);\n\n  // Frame buffer marking\n  if (!frm_hdr->key_frame_) {\n    return VP8SetError(dec, VP8_STATUS_UNSUPPORTED_FEATURE,\n                       \"Not a key frame.\");\n  }\n\n  VP8Get(br);   // ignore the value of update_proba_\n\n  VP8ParseProba(br, dec);\n\n  // sanitized state\n  dec->ready_ = 1;\n  return 1;\n}\n\n//------------------------------------------------------------------------------\n// Residual decoding (Paragraph 13.2 / 13.3)\n\nstatic const int kBands[16 + 1] = {\n  0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7,\n  0  // extra entry as sentinel\n};\n\nstatic const uint8_t kCat3[] = { 173, 148, 140, 0 };\nstatic const uint8_t kCat4[] = { 176, 155, 140, 135, 0 };\nstatic const uint8_t kCat5[] = { 180, 157, 141, 134, 130, 0 };\nstatic const uint8_t kCat6[] =\n  { 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0 };\nstatic const uint8_t* const kCat3456[] = { kCat3, kCat4, kCat5, kCat6 };\nstatic const uint8_t kZigzag[16] = {\n  0, 1, 4, 8,  5, 2, 3, 6,  9, 12, 13, 10,  7, 11, 14, 15\n};\n\n// See section 13-2: http://tools.ietf.org/html/rfc6386#section-13.2\nstatic int GetLargeValue(VP8BitReader* const br, const uint8_t* const p) {\n  int v;\n  if (!VP8GetBit(br, p[3])) {\n    if (!VP8GetBit(br, p[4])) {\n      v = 2;\n    } else {\n      v = 3 + VP8GetBit(br, p[5]);\n    }\n  } else {\n    if (!VP8GetBit(br, p[6])) {\n      if (!VP8GetBit(br, p[7])) {\n        v = 5 + VP8GetBit(br, 159);\n      } else {\n        v = 7 + 2 * VP8GetBit(br, 165);\n        v += VP8GetBit(br, 145);\n      }\n    } else {\n      const uint8_t* tab;\n      const int bit1 = VP8GetBit(br, p[8]);\n      const int bit0 = VP8GetBit(br, p[9 + bit1]);\n      const int cat = 2 * bit1 + bit0;\n      v = 0;\n      for (tab = kCat3456[cat]; *tab; ++tab) {\n        v += v + VP8GetBit(br, *tab);\n      }\n      v += 3 + (8 << cat);\n    }\n  }\n  return v;\n}\n\n// Returns the position of the last non-zero coeff plus one\nstatic int GetCoeffs(VP8BitReader* const br, const VP8BandProbas* const prob,\n                     int ctx, const quant_t dq, int n, int16_t* out) {\n  // n is either 0 or 1 here. kBands[n] is not necessary for extracting '*p'.\n  const uint8_t* p = prob[n].probas_[ctx];\n  for (; n < 16; ++n) {\n    if (!VP8GetBit(br, p[0])) {\n      return n;  // previous coeff was last non-zero coeff\n    }\n    while (!VP8GetBit(br, p[1])) {       // sequence of zero coeffs\n      p = prob[kBands[++n]].probas_[0];\n      if (n == 16) return 16;\n    }\n    {        // non zero coeff\n      const VP8ProbaArray* const p_ctx = &prob[kBands[n + 1]].probas_[0];\n      int v;\n      if (!VP8GetBit(br, p[2])) {\n        v = 1;\n        p = p_ctx[1];\n      } else {\n        v = GetLargeValue(br, p);\n        p = p_ctx[2];\n      }\n      out[kZigzag[n]] = VP8GetSigned(br, v) * dq[n > 0];\n    }\n  }\n  return 16;\n}\n\nstatic WEBP_INLINE uint32_t NzCodeBits(uint32_t nz_coeffs, int nz, int dc_nz) {\n  nz_coeffs <<= 2;\n  nz_coeffs |= (nz > 3) ? 3 : (nz > 1) ? 2 : dc_nz;\n  return nz_coeffs;\n}\n\nstatic int ParseResiduals(VP8Decoder* const dec,\n                          VP8MB* const mb, VP8BitReader* const token_br) {\n  VP8BandProbas (* const bands)[NUM_BANDS] = dec->proba_.bands_;\n  const VP8BandProbas* ac_proba;\n  VP8MBData* const block = dec->mb_data_ + dec->mb_x_;\n  const VP8QuantMatrix* const q = &dec->dqm_[block->segment_];\n  int16_t* dst = block->coeffs_;\n  VP8MB* const left_mb = dec->mb_info_ - 1;\n  uint8_t tnz, lnz;\n  uint32_t non_zero_y = 0;\n  uint32_t non_zero_uv = 0;\n  int x, y, ch;\n  uint32_t out_t_nz, out_l_nz;\n  int first;\n\n  memset(dst, 0, 384 * sizeof(*dst));\n  if (!block->is_i4x4_) {    // parse DC\n    int16_t dc[16] = { 0 };\n    const int ctx = mb->nz_dc_ + left_mb->nz_dc_;\n    const int nz = GetCoeffs(token_br, bands[1], ctx, q->y2_mat_, 0, dc);\n    mb->nz_dc_ = left_mb->nz_dc_ = (nz > 0);\n    if (nz > 1) {   // more than just the DC -> perform the full transform\n      VP8TransformWHT(dc, dst);\n    } else {        // only DC is non-zero -> inlined simplified transform\n      int i;\n      const int dc0 = (dc[0] + 3) >> 3;\n      for (i = 0; i < 16 * 16; i += 16) dst[i] = dc0;\n    }\n    first = 1;\n    ac_proba = bands[0];\n  } else {\n    first = 0;\n    ac_proba = bands[3];\n  }\n\n  tnz = mb->nz_ & 0x0f;\n  lnz = left_mb->nz_ & 0x0f;\n  for (y = 0; y < 4; ++y) {\n    int l = lnz & 1;\n    uint32_t nz_coeffs = 0;\n    for (x = 0; x < 4; ++x) {\n      const int ctx = l + (tnz & 1);\n      const int nz = GetCoeffs(token_br, ac_proba, ctx, q->y1_mat_, first, dst);\n      l = (nz > first);\n      tnz = (tnz >> 1) | (l << 7);\n      nz_coeffs = NzCodeBits(nz_coeffs, nz, dst[0] != 0);\n      dst += 16;\n    }\n    tnz >>= 4;\n    lnz = (lnz >> 1) | (l << 7);\n    non_zero_y = (non_zero_y << 8) | nz_coeffs;\n  }\n  out_t_nz = tnz;\n  out_l_nz = lnz >> 4;\n\n  for (ch = 0; ch < 4; ch += 2) {\n    uint32_t nz_coeffs = 0;\n    tnz = mb->nz_ >> (4 + ch);\n    lnz = left_mb->nz_ >> (4 + ch);\n    for (y = 0; y < 2; ++y) {\n      int l = lnz & 1;\n      for (x = 0; x < 2; ++x) {\n        const int ctx = l + (tnz & 1);\n        const int nz = GetCoeffs(token_br, bands[2], ctx, q->uv_mat_, 0, dst);\n        l = (nz > 0);\n        tnz = (tnz >> 1) | (l << 3);\n        nz_coeffs = NzCodeBits(nz_coeffs, nz, dst[0] != 0);\n        dst += 16;\n      }\n      tnz >>= 2;\n      lnz = (lnz >> 1) | (l << 5);\n    }\n    // Note: we don't really need the per-4x4 details for U/V blocks.\n    non_zero_uv |= nz_coeffs << (4 * ch);\n    out_t_nz |= (tnz << 4) << ch;\n    out_l_nz |= (lnz & 0xf0) << ch;\n  }\n  mb->nz_ = out_t_nz;\n  left_mb->nz_ = out_l_nz;\n\n  block->non_zero_y_ = non_zero_y;\n  block->non_zero_uv_ = non_zero_uv;\n\n  // We look at the mode-code of each block and check if some blocks have less\n  // than three non-zero coeffs (code < 2). This is to avoid dithering flat and\n  // empty blocks.\n  block->dither_ = (non_zero_uv & 0xaaaa) ? 0 : q->dither_;\n\n  return !(non_zero_y | non_zero_uv);  // will be used for further optimization\n}\n\n//------------------------------------------------------------------------------\n// Main loop\n\nint VP8DecodeMB(VP8Decoder* const dec, VP8BitReader* const token_br) {\n  VP8MB* const left = dec->mb_info_ - 1;\n  VP8MB* const mb = dec->mb_info_ + dec->mb_x_;\n  VP8MBData* const block = dec->mb_data_ + dec->mb_x_;\n  int skip = dec->use_skip_proba_ ? block->skip_ : 0;\n\n  if (!skip) {\n    skip = ParseResiduals(dec, mb, token_br);\n  } else {\n    left->nz_ = mb->nz_ = 0;\n    if (!block->is_i4x4_) {\n      left->nz_dc_ = mb->nz_dc_ = 0;\n    }\n    block->non_zero_y_ = 0;\n    block->non_zero_uv_ = 0;\n  }\n\n  if (dec->filter_type_ > 0) {  // store filter info\n    VP8FInfo* const finfo = dec->f_info_ + dec->mb_x_;\n    *finfo = dec->fstrengths_[block->segment_][block->is_i4x4_];\n    finfo->f_inner_ |= !skip;\n  }\n\n  return !token_br->eof_;\n}\n\nvoid VP8InitScanline(VP8Decoder* const dec) {\n  VP8MB* const left = dec->mb_info_ - 1;\n  left->nz_ = 0;\n  left->nz_dc_ = 0;\n  memset(dec->intra_l_, B_DC_PRED, sizeof(dec->intra_l_));\n  dec->mb_x_ = 0;\n}\n\nstatic int ParseFrame(VP8Decoder* const dec, VP8Io* io) {\n  for (dec->mb_y_ = 0; dec->mb_y_ < dec->br_mb_y_; ++dec->mb_y_) {\n    // Parse bitstream for this row.\n    VP8BitReader* const token_br =\n        &dec->parts_[dec->mb_y_ & (dec->num_parts_ - 1)];\n    if (!VP8ParseIntraModeRow(&dec->br_, dec)) {\n      return VP8SetError(dec, VP8_STATUS_NOT_ENOUGH_DATA,\n                         \"Premature end-of-partition0 encountered.\");\n    }\n    for (; dec->mb_x_ < dec->mb_w_; ++dec->mb_x_) {\n      if (!VP8DecodeMB(dec, token_br)) {\n        return VP8SetError(dec, VP8_STATUS_NOT_ENOUGH_DATA,\n                           \"Premature end-of-file encountered.\");\n      }\n    }\n    VP8InitScanline(dec);   // Prepare for next scanline\n\n    // Reconstruct, filter and emit the row.\n    if (!VP8ProcessRow(dec, io)) {\n      return VP8SetError(dec, VP8_STATUS_USER_ABORT, \"Output aborted.\");\n    }\n  }\n  if (dec->mt_method_ > 0) {\n    if (!WebPGetWorkerInterface()->Sync(&dec->worker_)) return 0;\n  }\n\n  return 1;\n}\n\n// Main entry point\nint VP8Decode(VP8Decoder* const dec, VP8Io* const io) {\n  int ok = 0;\n  if (dec == NULL) {\n    return 0;\n  }\n  if (io == NULL) {\n    return VP8SetError(dec, VP8_STATUS_INVALID_PARAM,\n                       \"NULL VP8Io parameter in VP8Decode().\");\n  }\n\n  if (!dec->ready_) {\n    if (!VP8GetHeaders(dec, io)) {\n      return 0;\n    }\n  }\n  assert(dec->ready_);\n\n  // Finish setting up the decoding parameter. Will call io->setup().\n  ok = (VP8EnterCritical(dec, io) == VP8_STATUS_OK);\n  if (ok) {   // good to go.\n    // Will allocate memory and prepare everything.\n    if (ok) ok = VP8InitFrame(dec, io);\n\n    // Main decoding loop\n    if (ok) ok = ParseFrame(dec, io);\n\n    // Exit.\n    ok &= VP8ExitCritical(dec, io);\n  }\n\n  if (!ok) {\n    VP8Clear(dec);\n    return 0;\n  }\n\n  dec->ready_ = 0;\n  return ok;\n}\n\nvoid VP8Clear(VP8Decoder* const dec) {\n  if (dec == NULL) {\n    return;\n  }\n  WebPGetWorkerInterface()->End(&dec->worker_);\n  ALPHDelete(dec->alph_dec_);\n  dec->alph_dec_ = NULL;\n  WebPSafeFree(dec->mem_);\n  dec->mem_ = NULL;\n  dec->mem_size_ = 0;\n  memset(&dec->br_, 0, sizeof(dec->br_));\n  dec->ready_ = 0;\n}\n\n//------------------------------------------------------------------------------\n\n"
  },
  {
    "path": "ext/libwebp/dec/vp8i.h",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// VP8 decoder: internal header.\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_DEC_VP8I_H_\n#define WEBP_DEC_VP8I_H_\n\n#include <string.h>     // for memcpy()\n#include \"./vp8li.h\"\n#include \"../utils/bit_reader.h\"\n#include \"../utils/random.h\"\n#include \"../utils/thread.h\"\n#include \"../dsp/dsp.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n//------------------------------------------------------------------------------\n// Various defines and enums\n\n// version numbers\n#define DEC_MAJ_VERSION 0\n#define DEC_MIN_VERSION 4\n#define DEC_REV_VERSION 2\n\n// intra prediction modes\nenum { B_DC_PRED = 0,   // 4x4 modes\n       B_TM_PRED,\n       B_VE_PRED,\n       B_HE_PRED,\n       B_RD_PRED,\n       B_VR_PRED,\n       B_LD_PRED,\n       B_VL_PRED,\n       B_HD_PRED,\n       B_HU_PRED,\n       NUM_BMODES = B_HU_PRED + 1 - B_DC_PRED,  // = 10\n\n       // Luma16 or UV modes\n       DC_PRED = B_DC_PRED, V_PRED = B_VE_PRED,\n       H_PRED = B_HE_PRED, TM_PRED = B_TM_PRED,\n       B_PRED = NUM_BMODES,   // refined I4x4 mode\n\n       // special modes\n       B_DC_PRED_NOTOP = 4,\n       B_DC_PRED_NOLEFT = 5,\n       B_DC_PRED_NOTOPLEFT = 6,\n       NUM_B_DC_MODES = 7 };\n\nenum { MB_FEATURE_TREE_PROBS = 3,\n       NUM_MB_SEGMENTS = 4,\n       NUM_REF_LF_DELTAS = 4,\n       NUM_MODE_LF_DELTAS = 4,    // I4x4, ZERO, *, SPLIT\n       MAX_NUM_PARTITIONS = 8,\n       // Probabilities\n       NUM_TYPES = 4,\n       NUM_BANDS = 8,\n       NUM_CTX = 3,\n       NUM_PROBAS = 11,\n       NUM_MV_PROBAS = 19 };\n\n// YUV-cache parameters.\n// Constraints are: We need to store one 16x16 block of luma samples (y),\n// and two 8x8 chroma blocks (u/v). These are better be 16-bytes aligned,\n// in order to be SIMD-friendly. We also need to store the top, left and\n// top-left samples (from previously decoded blocks), along with four\n// extra top-right samples for luma (intra4x4 prediction only).\n// One possible layout is, using 32 * (17 + 9) bytes:\n//\n//   .+------   <- only 1 pixel high\n//   .|yyyyt.\n//   .|yyyyt.\n//   .|yyyyt.\n//   .|yyyy..\n//   .+--.+--   <- only 1 pixel high\n//   .|uu.|vv\n//   .|uu.|vv\n//\n// Every character is a 4x4 block, with legend:\n//  '.' = unused\n//  'y' = y-samples   'u' = u-samples     'v' = u-samples\n//  '|' = left sample,   '-' = top sample,    '+' = top-left sample\n//  't' = extra top-right sample for 4x4 modes\n// With this layout, BPS (=Bytes Per Scan-line) is one cacheline size.\n#define BPS       32    // this is the common stride used by yuv[]\n#define YUV_SIZE (BPS * 17 + BPS * 9)\n#define Y_SIZE   (BPS * 17)\n#define Y_OFF    (BPS * 1 + 8)\n#define U_OFF    (Y_OFF + BPS * 16 + BPS)\n#define V_OFF    (U_OFF + 16)\n\n// minimal width under which lossy multi-threading is always disabled\n#define MIN_WIDTH_FOR_THREADS 512\n\n//------------------------------------------------------------------------------\n// Headers\n\ntypedef struct {\n  uint8_t key_frame_;\n  uint8_t profile_;\n  uint8_t show_;\n  uint32_t partition_length_;\n} VP8FrameHeader;\n\ntypedef struct {\n  uint16_t width_;\n  uint16_t height_;\n  uint8_t xscale_;\n  uint8_t yscale_;\n  uint8_t colorspace_;   // 0 = YCbCr\n  uint8_t clamp_type_;\n} VP8PictureHeader;\n\n// segment features\ntypedef struct {\n  int use_segment_;\n  int update_map_;        // whether to update the segment map or not\n  int absolute_delta_;    // absolute or delta values for quantizer and filter\n  int8_t quantizer_[NUM_MB_SEGMENTS];        // quantization changes\n  int8_t filter_strength_[NUM_MB_SEGMENTS];  // filter strength for segments\n} VP8SegmentHeader;\n\n\n// probas associated to one of the contexts\ntypedef uint8_t VP8ProbaArray[NUM_PROBAS];\n\ntypedef struct {   // all the probas associated to one band\n  VP8ProbaArray probas_[NUM_CTX];\n} VP8BandProbas;\n\n// Struct collecting all frame-persistent probabilities.\ntypedef struct {\n  uint8_t segments_[MB_FEATURE_TREE_PROBS];\n  // Type: 0:Intra16-AC  1:Intra16-DC   2:Chroma   3:Intra4\n  VP8BandProbas bands_[NUM_TYPES][NUM_BANDS];\n} VP8Proba;\n\n// Filter parameters\ntypedef struct {\n  int simple_;                  // 0=complex, 1=simple\n  int level_;                   // [0..63]\n  int sharpness_;               // [0..7]\n  int use_lf_delta_;\n  int ref_lf_delta_[NUM_REF_LF_DELTAS];\n  int mode_lf_delta_[NUM_MODE_LF_DELTAS];\n} VP8FilterHeader;\n\n//------------------------------------------------------------------------------\n// Informations about the macroblocks.\n\ntypedef struct {  // filter specs\n  uint8_t f_limit_;      // filter limit in [3..189], or 0 if no filtering\n  uint8_t f_ilevel_;     // inner limit in [1..63]\n  uint8_t f_inner_;      // do inner filtering?\n  uint8_t hev_thresh_;   // high edge variance threshold in [0..2]\n} VP8FInfo;\n\ntypedef struct {  // Top/Left Contexts used for syntax-parsing\n  uint8_t nz_;        // non-zero AC/DC coeffs (4bit for luma + 4bit for chroma)\n  uint8_t nz_dc_;     // non-zero DC coeff (1bit)\n} VP8MB;\n\n// Dequantization matrices\ntypedef int quant_t[2];      // [DC / AC].  Can be 'uint16_t[2]' too (~slower).\ntypedef struct {\n  quant_t y1_mat_, y2_mat_, uv_mat_;\n\n  int uv_quant_;   // U/V quantizer value\n  int dither_;     // dithering amplitude (0 = off, max=255)\n} VP8QuantMatrix;\n\n// Data needed to reconstruct a macroblock\ntypedef struct {\n  int16_t coeffs_[384];   // 384 coeffs = (16+4+4) * 4*4\n  uint8_t is_i4x4_;       // true if intra4x4\n  uint8_t imodes_[16];    // one 16x16 mode (#0) or sixteen 4x4 modes\n  uint8_t uvmode_;        // chroma prediction mode\n  // bit-wise info about the content of each sub-4x4 blocks (in decoding order).\n  // Each of the 4x4 blocks for y/u/v is associated with a 2b code according to:\n  //   code=0 -> no coefficient\n  //   code=1 -> only DC\n  //   code=2 -> first three coefficients are non-zero\n  //   code=3 -> more than three coefficients are non-zero\n  // This allows to call specialized transform functions.\n  uint32_t non_zero_y_;\n  uint32_t non_zero_uv_;\n  uint8_t dither_;      // local dithering strength (deduced from non_zero_*)\n  uint8_t skip_;\n  uint8_t segment_;\n} VP8MBData;\n\n// Persistent information needed by the parallel processing\ntypedef struct {\n  int id_;              // cache row to process (in [0..2])\n  int mb_y_;            // macroblock position of the row\n  int filter_row_;      // true if row-filtering is needed\n  VP8FInfo* f_info_;    // filter strengths (swapped with dec->f_info_)\n  VP8MBData* mb_data_;  // reconstruction data (swapped with dec->mb_data_)\n  VP8Io io_;            // copy of the VP8Io to pass to put()\n} VP8ThreadContext;\n\n// Saved top samples, per macroblock. Fits into a cache-line.\ntypedef struct {\n  uint8_t y[16], u[8], v[8];\n} VP8TopSamples;\n\n//------------------------------------------------------------------------------\n// VP8Decoder: the main opaque structure handed over to user\n\nstruct VP8Decoder {\n  VP8StatusCode status_;\n  int ready_;     // true if ready to decode a picture with VP8Decode()\n  const char* error_msg_;  // set when status_ is not OK.\n\n  // Main data source\n  VP8BitReader br_;\n\n  // headers\n  VP8FrameHeader   frm_hdr_;\n  VP8PictureHeader pic_hdr_;\n  VP8FilterHeader  filter_hdr_;\n  VP8SegmentHeader segment_hdr_;\n\n  // Worker\n  WebPWorker worker_;\n  int mt_method_;      // multi-thread method: 0=off, 1=[parse+recon][filter]\n                       // 2=[parse][recon+filter]\n  int cache_id_;       // current cache row\n  int num_caches_;     // number of cached rows of 16 pixels (1, 2 or 3)\n  VP8ThreadContext thread_ctx_;  // Thread context\n\n  // dimension, in macroblock units.\n  int mb_w_, mb_h_;\n\n  // Macroblock to process/filter, depending on cropping and filter_type.\n  int tl_mb_x_, tl_mb_y_;  // top-left MB that must be in-loop filtered\n  int br_mb_x_, br_mb_y_;  // last bottom-right MB that must be decoded\n\n  // number of partitions.\n  int num_parts_;\n  // per-partition boolean decoders.\n  VP8BitReader parts_[MAX_NUM_PARTITIONS];\n\n  // Dithering strength, deduced from decoding options\n  int dither_;                // whether to use dithering or not\n  VP8Random dithering_rg_;    // random generator for dithering\n\n  // dequantization (one set of DC/AC dequant factor per segment)\n  VP8QuantMatrix dqm_[NUM_MB_SEGMENTS];\n\n  // probabilities\n  VP8Proba proba_;\n  int use_skip_proba_;\n  uint8_t skip_p_;\n\n  // Boundary data cache and persistent buffers.\n  uint8_t* intra_t_;      // top intra modes values: 4 * mb_w_\n  uint8_t  intra_l_[4];   // left intra modes values\n\n  VP8TopSamples* yuv_t_;  // top y/u/v samples\n\n  VP8MB* mb_info_;        // contextual macroblock info (mb_w_ + 1)\n  VP8FInfo* f_info_;      // filter strength info\n  uint8_t* yuv_b_;        // main block for Y/U/V (size = YUV_SIZE)\n\n  uint8_t* cache_y_;      // macroblock row for storing unfiltered samples\n  uint8_t* cache_u_;\n  uint8_t* cache_v_;\n  int cache_y_stride_;\n  int cache_uv_stride_;\n\n  // main memory chunk for the above data. Persistent.\n  void* mem_;\n  size_t mem_size_;\n\n  // Per macroblock non-persistent infos.\n  int mb_x_, mb_y_;       // current position, in macroblock units\n  VP8MBData* mb_data_;    // parsed reconstruction data\n\n  // Filtering side-info\n  int filter_type_;                          // 0=off, 1=simple, 2=complex\n  VP8FInfo fstrengths_[NUM_MB_SEGMENTS][2];  // precalculated per-segment/type\n\n  // Alpha\n  struct ALPHDecoder* alph_dec_;  // alpha-plane decoder object\n  const uint8_t* alpha_data_;     // compressed alpha data (if present)\n  size_t alpha_data_size_;\n  int is_alpha_decoded_;  // true if alpha_data_ is decoded in alpha_plane_\n  uint8_t* alpha_plane_;  // output. Persistent, contains the whole data.\n  int alpha_dithering_;   // derived from decoding options (0=off, 100=full).\n};\n\n//------------------------------------------------------------------------------\n// internal functions. Not public.\n\n// in vp8.c\nint VP8SetError(VP8Decoder* const dec,\n                VP8StatusCode error, const char* const msg);\n\n// in tree.c\nvoid VP8ResetProba(VP8Proba* const proba);\nvoid VP8ParseProba(VP8BitReader* const br, VP8Decoder* const dec);\n// parses one row of intra mode data in partition 0, returns !eof\nint VP8ParseIntraModeRow(VP8BitReader* const br, VP8Decoder* const dec);\n\n// in quant.c\nvoid VP8ParseQuant(VP8Decoder* const dec);\n\n// in frame.c\nint VP8InitFrame(VP8Decoder* const dec, VP8Io* io);\n// Call io->setup() and finish setting up scan parameters.\n// After this call returns, one must always call VP8ExitCritical() with the\n// same parameters. Both functions should be used in pair. Returns VP8_STATUS_OK\n// if ok, otherwise sets and returns the error status on *dec.\nVP8StatusCode VP8EnterCritical(VP8Decoder* const dec, VP8Io* const io);\n// Must always be called in pair with VP8EnterCritical().\n// Returns false in case of error.\nint VP8ExitCritical(VP8Decoder* const dec, VP8Io* const io);\n// Return the multi-threading method to use (0=off), depending\n// on options and bitstream size. Only for lossy decoding.\nint VP8GetThreadMethod(const WebPDecoderOptions* const options,\n                       const WebPHeaderStructure* const headers,\n                       int width, int height);\n// Initialize dithering post-process if needed.\nvoid VP8InitDithering(const WebPDecoderOptions* const options,\n                      VP8Decoder* const dec);\n// Process the last decoded row (filtering + output).\nint VP8ProcessRow(VP8Decoder* const dec, VP8Io* const io);\n// To be called at the start of a new scanline, to initialize predictors.\nvoid VP8InitScanline(VP8Decoder* const dec);\n// Decode one macroblock. Returns false if there is not enough data.\nint VP8DecodeMB(VP8Decoder* const dec, VP8BitReader* const token_br);\n\n// in alpha.c\nconst uint8_t* VP8DecompressAlphaRows(VP8Decoder* const dec,\n                                      int row, int num_rows);\n\n//------------------------------------------------------------------------------\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_DEC_VP8I_H_ */\n"
  },
  {
    "path": "ext/libwebp/dec/vp8l.c",
    "content": "// Copyright 2012 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// main entry for the decoder\n//\n// Authors: Vikas Arora (vikaas.arora@gmail.com)\n//          Jyrki Alakuijala (jyrki@google.com)\n\n#include <stdlib.h>\n\n#include \"./alphai.h\"\n#include \"./vp8li.h\"\n#include \"../dsp/dsp.h\"\n#include \"../dsp/lossless.h\"\n#include \"../dsp/yuv.h\"\n#include \"../utils/huffman.h\"\n#include \"../utils/utils.h\"\n\n#define NUM_ARGB_CACHE_ROWS          16\n\nstatic const int kCodeLengthLiterals = 16;\nstatic const int kCodeLengthRepeatCode = 16;\nstatic const int kCodeLengthExtraBits[3] = { 2, 3, 7 };\nstatic const int kCodeLengthRepeatOffsets[3] = { 3, 3, 11 };\n\n// -----------------------------------------------------------------------------\n//  Five Huffman codes are used at each meta code:\n//  1. green + length prefix codes + color cache codes,\n//  2. alpha,\n//  3. red,\n//  4. blue, and,\n//  5. distance prefix codes.\ntypedef enum {\n  GREEN = 0,\n  RED   = 1,\n  BLUE  = 2,\n  ALPHA = 3,\n  DIST  = 4\n} HuffIndex;\n\nstatic const uint16_t kAlphabetSize[HUFFMAN_CODES_PER_META_CODE] = {\n  NUM_LITERAL_CODES + NUM_LENGTH_CODES,\n  NUM_LITERAL_CODES, NUM_LITERAL_CODES, NUM_LITERAL_CODES,\n  NUM_DISTANCE_CODES\n};\n\n\n#define NUM_CODE_LENGTH_CODES       19\nstatic const uint8_t kCodeLengthCodeOrder[NUM_CODE_LENGTH_CODES] = {\n  17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15\n};\n\n#define CODE_TO_PLANE_CODES        120\nstatic const uint8_t kCodeToPlane[CODE_TO_PLANE_CODES] = {\n  0x18, 0x07, 0x17, 0x19, 0x28, 0x06, 0x27, 0x29, 0x16, 0x1a,\n  0x26, 0x2a, 0x38, 0x05, 0x37, 0x39, 0x15, 0x1b, 0x36, 0x3a,\n  0x25, 0x2b, 0x48, 0x04, 0x47, 0x49, 0x14, 0x1c, 0x35, 0x3b,\n  0x46, 0x4a, 0x24, 0x2c, 0x58, 0x45, 0x4b, 0x34, 0x3c, 0x03,\n  0x57, 0x59, 0x13, 0x1d, 0x56, 0x5a, 0x23, 0x2d, 0x44, 0x4c,\n  0x55, 0x5b, 0x33, 0x3d, 0x68, 0x02, 0x67, 0x69, 0x12, 0x1e,\n  0x66, 0x6a, 0x22, 0x2e, 0x54, 0x5c, 0x43, 0x4d, 0x65, 0x6b,\n  0x32, 0x3e, 0x78, 0x01, 0x77, 0x79, 0x53, 0x5d, 0x11, 0x1f,\n  0x64, 0x6c, 0x42, 0x4e, 0x76, 0x7a, 0x21, 0x2f, 0x75, 0x7b,\n  0x31, 0x3f, 0x63, 0x6d, 0x52, 0x5e, 0x00, 0x74, 0x7c, 0x41,\n  0x4f, 0x10, 0x20, 0x62, 0x6e, 0x30, 0x73, 0x7d, 0x51, 0x5f,\n  0x40, 0x72, 0x7e, 0x61, 0x6f, 0x50, 0x71, 0x7f, 0x60, 0x70\n};\n\nstatic int DecodeImageStream(int xsize, int ysize,\n                             int is_level0,\n                             VP8LDecoder* const dec,\n                             uint32_t** const decoded_data);\n\n//------------------------------------------------------------------------------\n\nint VP8LCheckSignature(const uint8_t* const data, size_t size) {\n  return (size >= VP8L_FRAME_HEADER_SIZE &&\n          data[0] == VP8L_MAGIC_BYTE &&\n          (data[4] >> 5) == 0);  // version\n}\n\nstatic int ReadImageInfo(VP8LBitReader* const br,\n                         int* const width, int* const height,\n                         int* const has_alpha) {\n  if (VP8LReadBits(br, 8) != VP8L_MAGIC_BYTE) return 0;\n  *width = VP8LReadBits(br, VP8L_IMAGE_SIZE_BITS) + 1;\n  *height = VP8LReadBits(br, VP8L_IMAGE_SIZE_BITS) + 1;\n  *has_alpha = VP8LReadBits(br, 1);\n  if (VP8LReadBits(br, VP8L_VERSION_BITS) != 0) return 0;\n  return 1;\n}\n\nint VP8LGetInfo(const uint8_t* data, size_t data_size,\n                int* const width, int* const height, int* const has_alpha) {\n  if (data == NULL || data_size < VP8L_FRAME_HEADER_SIZE) {\n    return 0;         // not enough data\n  } else if (!VP8LCheckSignature(data, data_size)) {\n    return 0;         // bad signature\n  } else {\n    int w, h, a;\n    VP8LBitReader br;\n    VP8LInitBitReader(&br, data, data_size);\n    if (!ReadImageInfo(&br, &w, &h, &a)) {\n      return 0;\n    }\n    if (width != NULL) *width = w;\n    if (height != NULL) *height = h;\n    if (has_alpha != NULL) *has_alpha = a;\n    return 1;\n  }\n}\n\n//------------------------------------------------------------------------------\n\nstatic WEBP_INLINE int GetCopyDistance(int distance_symbol,\n                                       VP8LBitReader* const br) {\n  int extra_bits, offset;\n  if (distance_symbol < 4) {\n    return distance_symbol + 1;\n  }\n  extra_bits = (distance_symbol - 2) >> 1;\n  offset = (2 + (distance_symbol & 1)) << extra_bits;\n  return offset + VP8LReadBits(br, extra_bits) + 1;\n}\n\nstatic WEBP_INLINE int GetCopyLength(int length_symbol,\n                                     VP8LBitReader* const br) {\n  // Length and distance prefixes are encoded the same way.\n  return GetCopyDistance(length_symbol, br);\n}\n\nstatic WEBP_INLINE int PlaneCodeToDistance(int xsize, int plane_code) {\n  if (plane_code > CODE_TO_PLANE_CODES) {\n    return plane_code - CODE_TO_PLANE_CODES;\n  } else {\n    const int dist_code = kCodeToPlane[plane_code - 1];\n    const int yoffset = dist_code >> 4;\n    const int xoffset = 8 - (dist_code & 0xf);\n    const int dist = yoffset * xsize + xoffset;\n    return (dist >= 1) ? dist : 1;  // dist<1 can happen if xsize is very small\n  }\n}\n\n//------------------------------------------------------------------------------\n// Decodes the next Huffman code from bit-stream.\n// FillBitWindow(br) needs to be called at minimum every second call\n// to ReadSymbol, in order to pre-fetch enough bits.\nstatic WEBP_INLINE int ReadSymbol(const HuffmanTree* tree,\n                                  VP8LBitReader* const br) {\n  const HuffmanTreeNode* node = tree->root_;\n  uint32_t bits = VP8LPrefetchBits(br);\n  int bitpos = br->bit_pos_;\n  // Check if we find the bit combination from the Huffman lookup table.\n  const int lut_ix = bits & (HUFF_LUT - 1);\n  const int lut_bits = tree->lut_bits_[lut_ix];\n  if (lut_bits <= HUFF_LUT_BITS) {\n    VP8LSetBitPos(br, bitpos + lut_bits);\n    return tree->lut_symbol_[lut_ix];\n  }\n  node += tree->lut_jump_[lut_ix];\n  bitpos += HUFF_LUT_BITS;\n  bits >>= HUFF_LUT_BITS;\n\n  // Decode the value from a binary tree.\n  assert(node != NULL);\n  do {\n    node = HuffmanTreeNextNode(node, bits & 1);\n    bits >>= 1;\n    ++bitpos;\n  } while (HuffmanTreeNodeIsNotLeaf(node));\n  VP8LSetBitPos(br, bitpos);\n  return node->symbol_;\n}\n\nstatic int ReadHuffmanCodeLengths(\n    VP8LDecoder* const dec, const int* const code_length_code_lengths,\n    int num_symbols, int* const code_lengths) {\n  int ok = 0;\n  VP8LBitReader* const br = &dec->br_;\n  int symbol;\n  int max_symbol;\n  int prev_code_len = DEFAULT_CODE_LENGTH;\n  HuffmanTree tree;\n  int huff_codes[NUM_CODE_LENGTH_CODES] = { 0 };\n\n  if (!VP8LHuffmanTreeBuildImplicit(&tree, code_length_code_lengths,\n                                    huff_codes, NUM_CODE_LENGTH_CODES)) {\n    dec->status_ = VP8_STATUS_BITSTREAM_ERROR;\n    return 0;\n  }\n\n  if (VP8LReadBits(br, 1)) {    // use length\n    const int length_nbits = 2 + 2 * VP8LReadBits(br, 3);\n    max_symbol = 2 + VP8LReadBits(br, length_nbits);\n    if (max_symbol > num_symbols) {\n      dec->status_ = VP8_STATUS_BITSTREAM_ERROR;\n      goto End;\n    }\n  } else {\n    max_symbol = num_symbols;\n  }\n\n  symbol = 0;\n  while (symbol < num_symbols) {\n    int code_len;\n    if (max_symbol-- == 0) break;\n    VP8LFillBitWindow(br);\n    code_len = ReadSymbol(&tree, br);\n    if (code_len < kCodeLengthLiterals) {\n      code_lengths[symbol++] = code_len;\n      if (code_len != 0) prev_code_len = code_len;\n    } else {\n      const int use_prev = (code_len == kCodeLengthRepeatCode);\n      const int slot = code_len - kCodeLengthLiterals;\n      const int extra_bits = kCodeLengthExtraBits[slot];\n      const int repeat_offset = kCodeLengthRepeatOffsets[slot];\n      int repeat = VP8LReadBits(br, extra_bits) + repeat_offset;\n      if (symbol + repeat > num_symbols) {\n        dec->status_ = VP8_STATUS_BITSTREAM_ERROR;\n        goto End;\n      } else {\n        const int length = use_prev ? prev_code_len : 0;\n        while (repeat-- > 0) code_lengths[symbol++] = length;\n      }\n    }\n  }\n  ok = 1;\n\n End:\n  VP8LHuffmanTreeFree(&tree);\n  if (!ok) dec->status_ = VP8_STATUS_BITSTREAM_ERROR;\n  return ok;\n}\n\n// 'code_lengths' is pre-allocated temporary buffer, used for creating Huffman\n// tree.\nstatic int ReadHuffmanCode(int alphabet_size, VP8LDecoder* const dec,\n                           int* const code_lengths, int* const huff_codes,\n                           HuffmanTree* const tree) {\n  int ok = 0;\n  VP8LBitReader* const br = &dec->br_;\n  const int simple_code = VP8LReadBits(br, 1);\n\n  if (simple_code) {  // Read symbols, codes & code lengths directly.\n    int symbols[2];\n    int codes[2];\n    const int num_symbols = VP8LReadBits(br, 1) + 1;\n    const int first_symbol_len_code = VP8LReadBits(br, 1);\n    // The first code is either 1 bit or 8 bit code.\n    symbols[0] = VP8LReadBits(br, (first_symbol_len_code == 0) ? 1 : 8);\n    codes[0] = 0;\n    code_lengths[0] = num_symbols - 1;\n    // The second code (if present), is always 8 bit long.\n    if (num_symbols == 2) {\n      symbols[1] = VP8LReadBits(br, 8);\n      codes[1] = 1;\n      code_lengths[1] = num_symbols - 1;\n    }\n    ok = VP8LHuffmanTreeBuildExplicit(tree, code_lengths, codes, symbols,\n                                      alphabet_size, num_symbols);\n  } else {  // Decode Huffman-coded code lengths.\n    int i;\n    int code_length_code_lengths[NUM_CODE_LENGTH_CODES] = { 0 };\n    const int num_codes = VP8LReadBits(br, 4) + 4;\n    if (num_codes > NUM_CODE_LENGTH_CODES) {\n      dec->status_ = VP8_STATUS_BITSTREAM_ERROR;\n      return 0;\n    }\n\n    memset(code_lengths, 0, alphabet_size * sizeof(*code_lengths));\n\n    for (i = 0; i < num_codes; ++i) {\n      code_length_code_lengths[kCodeLengthCodeOrder[i]] = VP8LReadBits(br, 3);\n    }\n    ok = ReadHuffmanCodeLengths(dec, code_length_code_lengths, alphabet_size,\n                                code_lengths);\n    ok = ok && VP8LHuffmanTreeBuildImplicit(tree, code_lengths, huff_codes,\n                                            alphabet_size);\n  }\n  ok = ok && !br->error_;\n  if (!ok) {\n    dec->status_ = VP8_STATUS_BITSTREAM_ERROR;\n    return 0;\n  }\n  return 1;\n}\n\nstatic int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize,\n                            int color_cache_bits, int allow_recursion) {\n  int i, j;\n  VP8LBitReader* const br = &dec->br_;\n  VP8LMetadata* const hdr = &dec->hdr_;\n  uint32_t* huffman_image = NULL;\n  HTreeGroup* htree_groups = NULL;\n  int num_htree_groups = 1;\n  int max_alphabet_size = 0;\n  int* code_lengths = NULL;\n  int* huff_codes = NULL;\n\n  if (allow_recursion && VP8LReadBits(br, 1)) {\n    // use meta Huffman codes.\n    const int huffman_precision = VP8LReadBits(br, 3) + 2;\n    const int huffman_xsize = VP8LSubSampleSize(xsize, huffman_precision);\n    const int huffman_ysize = VP8LSubSampleSize(ysize, huffman_precision);\n    const int huffman_pixs = huffman_xsize * huffman_ysize;\n    if (!DecodeImageStream(huffman_xsize, huffman_ysize, 0, dec,\n                           &huffman_image)) {\n      dec->status_ = VP8_STATUS_BITSTREAM_ERROR;\n      goto Error;\n    }\n    hdr->huffman_subsample_bits_ = huffman_precision;\n    for (i = 0; i < huffman_pixs; ++i) {\n      // The huffman data is stored in red and green bytes.\n      const int group = (huffman_image[i] >> 8) & 0xffff;\n      huffman_image[i] = group;\n      if (group >= num_htree_groups) {\n        num_htree_groups = group + 1;\n      }\n    }\n  }\n\n  if (br->error_) goto Error;\n\n  // Find maximum alphabet size for the htree group.\n  for (j = 0; j < HUFFMAN_CODES_PER_META_CODE; ++j) {\n    int alphabet_size = kAlphabetSize[j];\n    if (j == 0 && color_cache_bits > 0) {\n      alphabet_size += 1 << color_cache_bits;\n    }\n    if (max_alphabet_size < alphabet_size) {\n      max_alphabet_size = alphabet_size;\n    }\n  }\n\n  htree_groups = VP8LHtreeGroupsNew(num_htree_groups);\n  code_lengths =\n      (int*)WebPSafeCalloc((uint64_t)max_alphabet_size, sizeof(*code_lengths));\n  huff_codes =\n      (int*)WebPSafeMalloc((uint64_t)max_alphabet_size, sizeof(*huff_codes));\n\n  if (htree_groups == NULL || code_lengths == NULL || huff_codes == NULL) {\n    dec->status_ = VP8_STATUS_OUT_OF_MEMORY;\n    goto Error;\n  }\n\n  for (i = 0; i < num_htree_groups; ++i) {\n    HuffmanTree* const htrees = htree_groups[i].htrees_;\n    for (j = 0; j < HUFFMAN_CODES_PER_META_CODE; ++j) {\n      int alphabet_size = kAlphabetSize[j];\n      HuffmanTree* const htree = htrees + j;\n      if (j == 0 && color_cache_bits > 0) {\n        alphabet_size += 1 << color_cache_bits;\n      }\n      if (!ReadHuffmanCode(alphabet_size, dec, code_lengths, huff_codes,\n                           htree)) {\n        goto Error;\n      }\n    }\n  }\n  WebPSafeFree(huff_codes);\n  WebPSafeFree(code_lengths);\n\n  // All OK. Finalize pointers and return.\n  hdr->huffman_image_ = huffman_image;\n  hdr->num_htree_groups_ = num_htree_groups;\n  hdr->htree_groups_ = htree_groups;\n  return 1;\n\n Error:\n  WebPSafeFree(huff_codes);\n  WebPSafeFree(code_lengths);\n  WebPSafeFree(huffman_image);\n  VP8LHtreeGroupsFree(htree_groups, num_htree_groups);\n  return 0;\n}\n\n//------------------------------------------------------------------------------\n// Scaling.\n\nstatic int AllocateAndInitRescaler(VP8LDecoder* const dec, VP8Io* const io) {\n  const int num_channels = 4;\n  const int in_width = io->mb_w;\n  const int out_width = io->scaled_width;\n  const int in_height = io->mb_h;\n  const int out_height = io->scaled_height;\n  const uint64_t work_size = 2 * num_channels * (uint64_t)out_width;\n  int32_t* work;        // Rescaler work area.\n  const uint64_t scaled_data_size = num_channels * (uint64_t)out_width;\n  uint32_t* scaled_data;  // Temporary storage for scaled BGRA data.\n  const uint64_t memory_size = sizeof(*dec->rescaler) +\n                               work_size * sizeof(*work) +\n                               scaled_data_size * sizeof(*scaled_data);\n  uint8_t* memory = (uint8_t*)WebPSafeCalloc(memory_size, sizeof(*memory));\n  if (memory == NULL) {\n    dec->status_ = VP8_STATUS_OUT_OF_MEMORY;\n    return 0;\n  }\n  assert(dec->rescaler_memory == NULL);\n  dec->rescaler_memory = memory;\n\n  dec->rescaler = (WebPRescaler*)memory;\n  memory += sizeof(*dec->rescaler);\n  work = (int32_t*)memory;\n  memory += work_size * sizeof(*work);\n  scaled_data = (uint32_t*)memory;\n\n  WebPRescalerInit(dec->rescaler, in_width, in_height, (uint8_t*)scaled_data,\n                   out_width, out_height, 0, num_channels,\n                   in_width, out_width, in_height, out_height, work);\n  return 1;\n}\n\n//------------------------------------------------------------------------------\n// Export to ARGB\n\n// We have special \"export\" function since we need to convert from BGRA\nstatic int Export(WebPRescaler* const rescaler, WEBP_CSP_MODE colorspace,\n                  int rgba_stride, uint8_t* const rgba) {\n  uint32_t* const src = (uint32_t*)rescaler->dst;\n  const int dst_width = rescaler->dst_width;\n  int num_lines_out = 0;\n  while (WebPRescalerHasPendingOutput(rescaler)) {\n    uint8_t* const dst = rgba + num_lines_out * rgba_stride;\n    WebPRescalerExportRow(rescaler, 0);\n    WebPMultARGBRow(src, dst_width, 1);\n    VP8LConvertFromBGRA(src, dst_width, colorspace, dst);\n    ++num_lines_out;\n  }\n  return num_lines_out;\n}\n\n// Emit scaled rows.\nstatic int EmitRescaledRowsRGBA(const VP8LDecoder* const dec,\n                                uint8_t* in, int in_stride, int mb_h,\n                                uint8_t* const out, int out_stride) {\n  const WEBP_CSP_MODE colorspace = dec->output_->colorspace;\n  int num_lines_in = 0;\n  int num_lines_out = 0;\n  while (num_lines_in < mb_h) {\n    uint8_t* const row_in = in + num_lines_in * in_stride;\n    uint8_t* const row_out = out + num_lines_out * out_stride;\n    const int lines_left = mb_h - num_lines_in;\n    const int needed_lines = WebPRescaleNeededLines(dec->rescaler, lines_left);\n    assert(needed_lines > 0 && needed_lines <= lines_left);\n    WebPMultARGBRows(row_in, in_stride,\n                     dec->rescaler->src_width, needed_lines, 0);\n    WebPRescalerImport(dec->rescaler, lines_left, row_in, in_stride);\n    num_lines_in += needed_lines;\n    num_lines_out += Export(dec->rescaler, colorspace, out_stride, row_out);\n  }\n  return num_lines_out;\n}\n\n// Emit rows without any scaling.\nstatic int EmitRows(WEBP_CSP_MODE colorspace,\n                    const uint8_t* row_in, int in_stride,\n                    int mb_w, int mb_h,\n                    uint8_t* const out, int out_stride) {\n  int lines = mb_h;\n  uint8_t* row_out = out;\n  while (lines-- > 0) {\n    VP8LConvertFromBGRA((const uint32_t*)row_in, mb_w, colorspace, row_out);\n    row_in += in_stride;\n    row_out += out_stride;\n  }\n  return mb_h;  // Num rows out == num rows in.\n}\n\n//------------------------------------------------------------------------------\n// Export to YUVA\n\n// TODO(skal): should be in yuv.c\nstatic void ConvertToYUVA(const uint32_t* const src, int width, int y_pos,\n                          const WebPDecBuffer* const output) {\n  const WebPYUVABuffer* const buf = &output->u.YUVA;\n  // first, the luma plane\n  {\n    int i;\n    uint8_t* const y = buf->y + y_pos * buf->y_stride;\n    for (i = 0; i < width; ++i) {\n      const uint32_t p = src[i];\n      y[i] = VP8RGBToY((p >> 16) & 0xff, (p >> 8) & 0xff, (p >> 0) & 0xff,\n                       YUV_HALF);\n    }\n  }\n\n  // then U/V planes\n  {\n    uint8_t* const u = buf->u + (y_pos >> 1) * buf->u_stride;\n    uint8_t* const v = buf->v + (y_pos >> 1) * buf->v_stride;\n    const int uv_width = width >> 1;\n    int i;\n    for (i = 0; i < uv_width; ++i) {\n      const uint32_t v0 = src[2 * i + 0];\n      const uint32_t v1 = src[2 * i + 1];\n      // VP8RGBToU/V expects four accumulated pixels. Hence we need to\n      // scale r/g/b value by a factor 2. We just shift v0/v1 one bit less.\n      const int r = ((v0 >> 15) & 0x1fe) + ((v1 >> 15) & 0x1fe);\n      const int g = ((v0 >>  7) & 0x1fe) + ((v1 >>  7) & 0x1fe);\n      const int b = ((v0 <<  1) & 0x1fe) + ((v1 <<  1) & 0x1fe);\n      if (!(y_pos & 1)) {  // even lines: store values\n        u[i] = VP8RGBToU(r, g, b, YUV_HALF << 2);\n        v[i] = VP8RGBToV(r, g, b, YUV_HALF << 2);\n      } else {             // odd lines: average with previous values\n        const int tmp_u = VP8RGBToU(r, g, b, YUV_HALF << 2);\n        const int tmp_v = VP8RGBToV(r, g, b, YUV_HALF << 2);\n        // Approximated average-of-four. But it's an acceptable diff.\n        u[i] = (u[i] + tmp_u + 1) >> 1;\n        v[i] = (v[i] + tmp_v + 1) >> 1;\n      }\n    }\n    if (width & 1) {       // last pixel\n      const uint32_t v0 = src[2 * i + 0];\n      const int r = (v0 >> 14) & 0x3fc;\n      const int g = (v0 >>  6) & 0x3fc;\n      const int b = (v0 <<  2) & 0x3fc;\n      if (!(y_pos & 1)) {  // even lines\n        u[i] = VP8RGBToU(r, g, b, YUV_HALF << 2);\n        v[i] = VP8RGBToV(r, g, b, YUV_HALF << 2);\n      } else {             // odd lines (note: we could just skip this)\n        const int tmp_u = VP8RGBToU(r, g, b, YUV_HALF << 2);\n        const int tmp_v = VP8RGBToV(r, g, b, YUV_HALF << 2);\n        u[i] = (u[i] + tmp_u + 1) >> 1;\n        v[i] = (v[i] + tmp_v + 1) >> 1;\n      }\n    }\n  }\n  // Lastly, store alpha if needed.\n  if (buf->a != NULL) {\n    int i;\n    uint8_t* const a = buf->a + y_pos * buf->a_stride;\n    for (i = 0; i < width; ++i) a[i] = (src[i] >> 24);\n  }\n}\n\nstatic int ExportYUVA(const VP8LDecoder* const dec, int y_pos) {\n  WebPRescaler* const rescaler = dec->rescaler;\n  uint32_t* const src = (uint32_t*)rescaler->dst;\n  const int dst_width = rescaler->dst_width;\n  int num_lines_out = 0;\n  while (WebPRescalerHasPendingOutput(rescaler)) {\n    WebPRescalerExportRow(rescaler, 0);\n    WebPMultARGBRow(src, dst_width, 1);\n    ConvertToYUVA(src, dst_width, y_pos, dec->output_);\n    ++y_pos;\n    ++num_lines_out;\n  }\n  return num_lines_out;\n}\n\nstatic int EmitRescaledRowsYUVA(const VP8LDecoder* const dec,\n                                uint8_t* in, int in_stride, int mb_h) {\n  int num_lines_in = 0;\n  int y_pos = dec->last_out_row_;\n  while (num_lines_in < mb_h) {\n    const int lines_left = mb_h - num_lines_in;\n    const int needed_lines = WebPRescaleNeededLines(dec->rescaler, lines_left);\n    WebPMultARGBRows(in, in_stride, dec->rescaler->src_width, needed_lines, 0);\n    WebPRescalerImport(dec->rescaler, lines_left, in, in_stride);\n    num_lines_in += needed_lines;\n    in += needed_lines * in_stride;\n    y_pos += ExportYUVA(dec, y_pos);\n  }\n  return y_pos;\n}\n\nstatic int EmitRowsYUVA(const VP8LDecoder* const dec,\n                        const uint8_t* in, int in_stride,\n                        int mb_w, int num_rows) {\n  int y_pos = dec->last_out_row_;\n  while (num_rows-- > 0) {\n    ConvertToYUVA((const uint32_t*)in, mb_w, y_pos, dec->output_);\n    in += in_stride;\n    ++y_pos;\n  }\n  return y_pos;\n}\n\n//------------------------------------------------------------------------------\n// Cropping.\n\n// Sets io->mb_y, io->mb_h & io->mb_w according to start row, end row and\n// crop options. Also updates the input data pointer, so that it points to the\n// start of the cropped window. Note that pixels are in ARGB format even if\n// 'in_data' is uint8_t*.\n// Returns true if the crop window is not empty.\nstatic int SetCropWindow(VP8Io* const io, int y_start, int y_end,\n                         uint8_t** const in_data, int pixel_stride) {\n  assert(y_start < y_end);\n  assert(io->crop_left < io->crop_right);\n  if (y_end > io->crop_bottom) {\n    y_end = io->crop_bottom;  // make sure we don't overflow on last row.\n  }\n  if (y_start < io->crop_top) {\n    const int delta = io->crop_top - y_start;\n    y_start = io->crop_top;\n    *in_data += delta * pixel_stride;\n  }\n  if (y_start >= y_end) return 0;  // Crop window is empty.\n\n  *in_data += io->crop_left * sizeof(uint32_t);\n\n  io->mb_y = y_start - io->crop_top;\n  io->mb_w = io->crop_right - io->crop_left;\n  io->mb_h = y_end - y_start;\n  return 1;  // Non-empty crop window.\n}\n\n//------------------------------------------------------------------------------\n\nstatic WEBP_INLINE int GetMetaIndex(\n    const uint32_t* const image, int xsize, int bits, int x, int y) {\n  if (bits == 0) return 0;\n  return image[xsize * (y >> bits) + (x >> bits)];\n}\n\nstatic WEBP_INLINE HTreeGroup* GetHtreeGroupForPos(VP8LMetadata* const hdr,\n                                                   int x, int y) {\n  const int meta_index = GetMetaIndex(hdr->huffman_image_, hdr->huffman_xsize_,\n                                      hdr->huffman_subsample_bits_, x, y);\n  assert(meta_index < hdr->num_htree_groups_);\n  return hdr->htree_groups_ + meta_index;\n}\n\n//------------------------------------------------------------------------------\n// Main loop, with custom row-processing function\n\ntypedef void (*ProcessRowsFunc)(VP8LDecoder* const dec, int row);\n\nstatic void ApplyInverseTransforms(VP8LDecoder* const dec, int num_rows,\n                                   const uint32_t* const rows) {\n  int n = dec->next_transform_;\n  const int cache_pixs = dec->width_ * num_rows;\n  const int start_row = dec->last_row_;\n  const int end_row = start_row + num_rows;\n  const uint32_t* rows_in = rows;\n  uint32_t* const rows_out = dec->argb_cache_;\n\n  // Inverse transforms.\n  // TODO: most transforms only need to operate on the cropped region only.\n  memcpy(rows_out, rows_in, cache_pixs * sizeof(*rows_out));\n  while (n-- > 0) {\n    VP8LTransform* const transform = &dec->transforms_[n];\n    VP8LInverseTransform(transform, start_row, end_row, rows_in, rows_out);\n    rows_in = rows_out;\n  }\n}\n\n// Special method for paletted alpha data.\nstatic void ApplyInverseTransformsAlpha(VP8LDecoder* const dec, int num_rows,\n                                        const uint8_t* const rows) {\n  const int start_row = dec->last_row_;\n  const int end_row = start_row + num_rows;\n  const uint8_t* rows_in = rows;\n  uint8_t* rows_out = (uint8_t*)dec->io_->opaque + dec->io_->width * start_row;\n  VP8LTransform* const transform = &dec->transforms_[0];\n  assert(dec->next_transform_ == 1);\n  assert(transform->type_ == COLOR_INDEXING_TRANSFORM);\n  VP8LColorIndexInverseTransformAlpha(transform, start_row, end_row, rows_in,\n                                      rows_out);\n}\n\n// Processes (transforms, scales & color-converts) the rows decoded after the\n// last call.\nstatic void ProcessRows(VP8LDecoder* const dec, int row) {\n  const uint32_t* const rows = dec->pixels_ + dec->width_ * dec->last_row_;\n  const int num_rows = row - dec->last_row_;\n\n  if (num_rows <= 0) return;  // Nothing to be done.\n  ApplyInverseTransforms(dec, num_rows, rows);\n\n  // Emit output.\n  {\n    VP8Io* const io = dec->io_;\n    uint8_t* rows_data = (uint8_t*)dec->argb_cache_;\n    const int in_stride = io->width * sizeof(uint32_t);  // in unit of RGBA\n    if (!SetCropWindow(io, dec->last_row_, row, &rows_data, in_stride)) {\n      // Nothing to output (this time).\n    } else {\n      const WebPDecBuffer* const output = dec->output_;\n      if (output->colorspace < MODE_YUV) {  // convert to RGBA\n        const WebPRGBABuffer* const buf = &output->u.RGBA;\n        uint8_t* const rgba = buf->rgba + dec->last_out_row_ * buf->stride;\n        const int num_rows_out = io->use_scaling ?\n            EmitRescaledRowsRGBA(dec, rows_data, in_stride, io->mb_h,\n                                 rgba, buf->stride) :\n            EmitRows(output->colorspace, rows_data, in_stride,\n                     io->mb_w, io->mb_h, rgba, buf->stride);\n        // Update 'last_out_row_'.\n        dec->last_out_row_ += num_rows_out;\n      } else {                              // convert to YUVA\n        dec->last_out_row_ = io->use_scaling ?\n            EmitRescaledRowsYUVA(dec, rows_data, in_stride, io->mb_h) :\n            EmitRowsYUVA(dec, rows_data, in_stride, io->mb_w, io->mb_h);\n      }\n      assert(dec->last_out_row_ <= output->height);\n    }\n  }\n\n  // Update 'last_row_'.\n  dec->last_row_ = row;\n  assert(dec->last_row_ <= dec->height_);\n}\n\n// Row-processing for the special case when alpha data contains only one\n// transform (color indexing), and trivial non-green literals.\nstatic int Is8bOptimizable(const VP8LMetadata* const hdr) {\n  int i;\n  if (hdr->color_cache_size_ > 0) return 0;\n  // When the Huffman tree contains only one symbol, we can skip the\n  // call to ReadSymbol() for red/blue/alpha channels.\n  for (i = 0; i < hdr->num_htree_groups_; ++i) {\n    const HuffmanTree* const htrees = hdr->htree_groups_[i].htrees_;\n    if (htrees[RED].num_nodes_ > 1) return 0;\n    if (htrees[BLUE].num_nodes_ > 1) return 0;\n    if (htrees[ALPHA].num_nodes_ > 1) return 0;\n  }\n  return 1;\n}\n\nstatic void ExtractPalettedAlphaRows(VP8LDecoder* const dec, int row) {\n  const int num_rows = row - dec->last_row_;\n  const uint8_t* const in =\n      (uint8_t*)dec->pixels_ + dec->width_ * dec->last_row_;\n  if (num_rows > 0) {\n    ApplyInverseTransformsAlpha(dec, num_rows, in);\n  }\n  dec->last_row_ = dec->last_out_row_ = row;\n}\n\nstatic int DecodeAlphaData(VP8LDecoder* const dec, uint8_t* const data,\n                           int width, int height, int last_row) {\n  int ok = 1;\n  int row = dec->last_pixel_ / width;\n  int col = dec->last_pixel_ % width;\n  VP8LBitReader* const br = &dec->br_;\n  VP8LMetadata* const hdr = &dec->hdr_;\n  const HTreeGroup* htree_group = GetHtreeGroupForPos(hdr, col, row);\n  int pos = dec->last_pixel_;         // current position\n  const int end = width * height;     // End of data\n  const int last = width * last_row;  // Last pixel to decode\n  const int len_code_limit = NUM_LITERAL_CODES + NUM_LENGTH_CODES;\n  const int mask = hdr->huffman_mask_;\n  assert(htree_group != NULL);\n  assert(pos < end);\n  assert(last_row <= height);\n  assert(Is8bOptimizable(hdr));\n\n  while (!br->eos_ && pos < last) {\n    int code;\n    // Only update when changing tile.\n    if ((col & mask) == 0) {\n      htree_group = GetHtreeGroupForPos(hdr, col, row);\n    }\n    VP8LFillBitWindow(br);\n    code = ReadSymbol(&htree_group->htrees_[GREEN], br);\n    if (code < NUM_LITERAL_CODES) {  // Literal\n      data[pos] = code;\n      ++pos;\n      ++col;\n      if (col >= width) {\n        col = 0;\n        ++row;\n        if (row % NUM_ARGB_CACHE_ROWS == 0) {\n          ExtractPalettedAlphaRows(dec, row);\n        }\n      }\n    } else if (code < len_code_limit) {  // Backward reference\n      int dist_code, dist;\n      const int length_sym = code - NUM_LITERAL_CODES;\n      const int length = GetCopyLength(length_sym, br);\n      const int dist_symbol = ReadSymbol(&htree_group->htrees_[DIST], br);\n      VP8LFillBitWindow(br);\n      dist_code = GetCopyDistance(dist_symbol, br);\n      dist = PlaneCodeToDistance(width, dist_code);\n      if (pos >= dist && end - pos >= length) {\n        int i;\n        for (i = 0; i < length; ++i) data[pos + i] = data[pos + i - dist];\n      } else {\n        ok = 0;\n        goto End;\n      }\n      pos += length;\n      col += length;\n      while (col >= width) {\n        col -= width;\n        ++row;\n        if (row % NUM_ARGB_CACHE_ROWS == 0) {\n          ExtractPalettedAlphaRows(dec, row);\n        }\n      }\n      if (pos < last && (col & mask)) {\n        htree_group = GetHtreeGroupForPos(hdr, col, row);\n      }\n    } else {  // Not reached\n      ok = 0;\n      goto End;\n    }\n    assert(br->eos_ == VP8LIsEndOfStream(br));\n    ok = !br->error_;\n    if (!ok) goto End;\n  }\n  // Process the remaining rows corresponding to last row-block.\n  ExtractPalettedAlphaRows(dec, row);\n\n End:\n  if (br->error_ || !ok || (br->eos_ && pos < end)) {\n    ok = 0;\n    dec->status_ = br->eos_ ? VP8_STATUS_SUSPENDED\n                            : VP8_STATUS_BITSTREAM_ERROR;\n  } else {\n    dec->last_pixel_ = (int)pos;\n    if (pos == end) dec->state_ = READ_DATA;\n  }\n  return ok;\n}\n\nstatic int DecodeImageData(VP8LDecoder* const dec, uint32_t* const data,\n                           int width, int height, int last_row,\n                           ProcessRowsFunc process_func) {\n  int ok = 1;\n  int row = dec->last_pixel_ / width;\n  int col = dec->last_pixel_ % width;\n  VP8LBitReader* const br = &dec->br_;\n  VP8LMetadata* const hdr = &dec->hdr_;\n  HTreeGroup* htree_group = GetHtreeGroupForPos(hdr, col, row);\n  uint32_t* src = data + dec->last_pixel_;\n  uint32_t* last_cached = src;\n  uint32_t* const src_end = data + width * height;     // End of data\n  uint32_t* const src_last = data + width * last_row;  // Last pixel to decode\n  const int len_code_limit = NUM_LITERAL_CODES + NUM_LENGTH_CODES;\n  const int color_cache_limit = len_code_limit + hdr->color_cache_size_;\n  VP8LColorCache* const color_cache =\n      (hdr->color_cache_size_ > 0) ? &hdr->color_cache_ : NULL;\n  const int mask = hdr->huffman_mask_;\n  assert(htree_group != NULL);\n  assert(src < src_end);\n  assert(src_last <= src_end);\n\n  while (!br->eos_ && src < src_last) {\n    int code;\n    // Only update when changing tile. Note we could use this test:\n    // if \"((((prev_col ^ col) | prev_row ^ row)) > mask)\" -> tile changed\n    // but that's actually slower and needs storing the previous col/row.\n    if ((col & mask) == 0) {\n      htree_group = GetHtreeGroupForPos(hdr, col, row);\n    }\n    VP8LFillBitWindow(br);\n    code = ReadSymbol(&htree_group->htrees_[GREEN], br);\n    if (code < NUM_LITERAL_CODES) {  // Literal\n      int red, green, blue, alpha;\n      red = ReadSymbol(&htree_group->htrees_[RED], br);\n      green = code;\n      VP8LFillBitWindow(br);\n      blue = ReadSymbol(&htree_group->htrees_[BLUE], br);\n      alpha = ReadSymbol(&htree_group->htrees_[ALPHA], br);\n      *src = ((uint32_t)alpha << 24) | (red << 16) | (green << 8) | blue;\n    AdvanceByOne:\n      ++src;\n      ++col;\n      if (col >= width) {\n        col = 0;\n        ++row;\n        if ((row % NUM_ARGB_CACHE_ROWS == 0) && (process_func != NULL)) {\n          process_func(dec, row);\n        }\n        if (color_cache != NULL) {\n          while (last_cached < src) {\n            VP8LColorCacheInsert(color_cache, *last_cached++);\n          }\n        }\n      }\n    } else if (code < len_code_limit) {  // Backward reference\n      int dist_code, dist;\n      const int length_sym = code - NUM_LITERAL_CODES;\n      const int length = GetCopyLength(length_sym, br);\n      const int dist_symbol = ReadSymbol(&htree_group->htrees_[DIST], br);\n      VP8LFillBitWindow(br);\n      dist_code = GetCopyDistance(dist_symbol, br);\n      dist = PlaneCodeToDistance(width, dist_code);\n      if (src - data < (ptrdiff_t)dist || src_end - src < (ptrdiff_t)length) {\n        ok = 0;\n        goto End;\n      } else {\n        int i;\n        for (i = 0; i < length; ++i) src[i] = src[i - dist];\n        src += length;\n      }\n      col += length;\n      while (col >= width) {\n        col -= width;\n        ++row;\n        if ((row % NUM_ARGB_CACHE_ROWS == 0) && (process_func != NULL)) {\n          process_func(dec, row);\n        }\n      }\n      if (src < src_last) {\n        if (col & mask) htree_group = GetHtreeGroupForPos(hdr, col, row);\n        if (color_cache != NULL) {\n          while (last_cached < src) {\n            VP8LColorCacheInsert(color_cache, *last_cached++);\n          }\n        }\n      }\n    } else if (code < color_cache_limit) {  // Color cache\n      const int key = code - len_code_limit;\n      assert(color_cache != NULL);\n      while (last_cached < src) {\n        VP8LColorCacheInsert(color_cache, *last_cached++);\n      }\n      *src = VP8LColorCacheLookup(color_cache, key);\n      goto AdvanceByOne;\n    } else {  // Not reached\n      ok = 0;\n      goto End;\n    }\n    assert(br->eos_ == VP8LIsEndOfStream(br));\n    ok = !br->error_;\n    if (!ok) goto End;\n  }\n  // Process the remaining rows corresponding to last row-block.\n  if (process_func != NULL) process_func(dec, row);\n\n End:\n  if (br->error_ || !ok || (br->eos_ && src < src_end)) {\n    ok = 0;\n    dec->status_ = br->eos_ ? VP8_STATUS_SUSPENDED\n                            : VP8_STATUS_BITSTREAM_ERROR;\n  } else {\n    dec->last_pixel_ = (int)(src - data);\n    if (src == src_end) dec->state_ = READ_DATA;\n  }\n  return ok;\n}\n\n// -----------------------------------------------------------------------------\n// VP8LTransform\n\nstatic void ClearTransform(VP8LTransform* const transform) {\n  WebPSafeFree(transform->data_);\n  transform->data_ = NULL;\n}\n\n// For security reason, we need to remap the color map to span\n// the total possible bundled values, and not just the num_colors.\nstatic int ExpandColorMap(int num_colors, VP8LTransform* const transform) {\n  int i;\n  const int final_num_colors = 1 << (8 >> transform->bits_);\n  uint32_t* const new_color_map =\n      (uint32_t*)WebPSafeMalloc((uint64_t)final_num_colors,\n                                sizeof(*new_color_map));\n  if (new_color_map == NULL) {\n    return 0;\n  } else {\n    uint8_t* const data = (uint8_t*)transform->data_;\n    uint8_t* const new_data = (uint8_t*)new_color_map;\n    new_color_map[0] = transform->data_[0];\n    for (i = 4; i < 4 * num_colors; ++i) {\n      // Equivalent to AddPixelEq(), on a byte-basis.\n      new_data[i] = (data[i] + new_data[i - 4]) & 0xff;\n    }\n    for (; i < 4 * final_num_colors; ++i)\n      new_data[i] = 0;  // black tail.\n    WebPSafeFree(transform->data_);\n    transform->data_ = new_color_map;\n  }\n  return 1;\n}\n\nstatic int ReadTransform(int* const xsize, int const* ysize,\n                         VP8LDecoder* const dec) {\n  int ok = 1;\n  VP8LBitReader* const br = &dec->br_;\n  VP8LTransform* transform = &dec->transforms_[dec->next_transform_];\n  const VP8LImageTransformType type =\n      (VP8LImageTransformType)VP8LReadBits(br, 2);\n\n  // Each transform type can only be present once in the stream.\n  if (dec->transforms_seen_ & (1U << type)) {\n    return 0;  // Already there, let's not accept the second same transform.\n  }\n  dec->transforms_seen_ |= (1U << type);\n\n  transform->type_ = type;\n  transform->xsize_ = *xsize;\n  transform->ysize_ = *ysize;\n  transform->data_ = NULL;\n  ++dec->next_transform_;\n  assert(dec->next_transform_ <= NUM_TRANSFORMS);\n\n  switch (type) {\n    case PREDICTOR_TRANSFORM:\n    case CROSS_COLOR_TRANSFORM:\n      transform->bits_ = VP8LReadBits(br, 3) + 2;\n      ok = DecodeImageStream(VP8LSubSampleSize(transform->xsize_,\n                                               transform->bits_),\n                             VP8LSubSampleSize(transform->ysize_,\n                                               transform->bits_),\n                             0, dec, &transform->data_);\n      break;\n    case COLOR_INDEXING_TRANSFORM: {\n       const int num_colors = VP8LReadBits(br, 8) + 1;\n       const int bits = (num_colors > 16) ? 0\n                      : (num_colors > 4) ? 1\n                      : (num_colors > 2) ? 2\n                      : 3;\n       *xsize = VP8LSubSampleSize(transform->xsize_, bits);\n       transform->bits_ = bits;\n       ok = DecodeImageStream(num_colors, 1, 0, dec, &transform->data_);\n       ok = ok && ExpandColorMap(num_colors, transform);\n      break;\n    }\n    case SUBTRACT_GREEN:\n      break;\n    default:\n      assert(0);    // can't happen\n      break;\n  }\n\n  return ok;\n}\n\n// -----------------------------------------------------------------------------\n// VP8LMetadata\n\nstatic void InitMetadata(VP8LMetadata* const hdr) {\n  assert(hdr);\n  memset(hdr, 0, sizeof(*hdr));\n}\n\nstatic void ClearMetadata(VP8LMetadata* const hdr) {\n  assert(hdr);\n\n  WebPSafeFree(hdr->huffman_image_);\n  VP8LHtreeGroupsFree(hdr->htree_groups_, hdr->num_htree_groups_);\n  VP8LColorCacheClear(&hdr->color_cache_);\n  InitMetadata(hdr);\n}\n\n// -----------------------------------------------------------------------------\n// VP8LDecoder\n\nVP8LDecoder* VP8LNew(void) {\n  VP8LDecoder* const dec = (VP8LDecoder*)WebPSafeCalloc(1ULL, sizeof(*dec));\n  if (dec == NULL) return NULL;\n  dec->status_ = VP8_STATUS_OK;\n  dec->action_ = READ_DIM;\n  dec->state_ = READ_DIM;\n\n  VP8LDspInit();  // Init critical function pointers.\n\n  return dec;\n}\n\nvoid VP8LClear(VP8LDecoder* const dec) {\n  int i;\n  if (dec == NULL) return;\n  ClearMetadata(&dec->hdr_);\n\n  WebPSafeFree(dec->pixels_);\n  dec->pixels_ = NULL;\n  for (i = 0; i < dec->next_transform_; ++i) {\n    ClearTransform(&dec->transforms_[i]);\n  }\n  dec->next_transform_ = 0;\n  dec->transforms_seen_ = 0;\n\n  WebPSafeFree(dec->rescaler_memory);\n  dec->rescaler_memory = NULL;\n\n  dec->output_ = NULL;   // leave no trace behind\n}\n\nvoid VP8LDelete(VP8LDecoder* const dec) {\n  if (dec != NULL) {\n    VP8LClear(dec);\n    WebPSafeFree(dec);\n  }\n}\n\nstatic void UpdateDecoder(VP8LDecoder* const dec, int width, int height) {\n  VP8LMetadata* const hdr = &dec->hdr_;\n  const int num_bits = hdr->huffman_subsample_bits_;\n  dec->width_ = width;\n  dec->height_ = height;\n\n  hdr->huffman_xsize_ = VP8LSubSampleSize(width, num_bits);\n  hdr->huffman_mask_ = (num_bits == 0) ? ~0 : (1 << num_bits) - 1;\n}\n\nstatic int DecodeImageStream(int xsize, int ysize,\n                             int is_level0,\n                             VP8LDecoder* const dec,\n                             uint32_t** const decoded_data) {\n  int ok = 1;\n  int transform_xsize = xsize;\n  int transform_ysize = ysize;\n  VP8LBitReader* const br = &dec->br_;\n  VP8LMetadata* const hdr = &dec->hdr_;\n  uint32_t* data = NULL;\n  int color_cache_bits = 0;\n\n  // Read the transforms (may recurse).\n  if (is_level0) {\n    while (ok && VP8LReadBits(br, 1)) {\n      ok = ReadTransform(&transform_xsize, &transform_ysize, dec);\n    }\n  }\n\n  // Color cache\n  if (ok && VP8LReadBits(br, 1)) {\n    color_cache_bits = VP8LReadBits(br, 4);\n    ok = (color_cache_bits >= 1 && color_cache_bits <= MAX_CACHE_BITS);\n    if (!ok) {\n      dec->status_ = VP8_STATUS_BITSTREAM_ERROR;\n      goto End;\n    }\n  }\n\n  // Read the Huffman codes (may recurse).\n  ok = ok && ReadHuffmanCodes(dec, transform_xsize, transform_ysize,\n                              color_cache_bits, is_level0);\n  if (!ok) {\n    dec->status_ = VP8_STATUS_BITSTREAM_ERROR;\n    goto End;\n  }\n\n  // Finish setting up the color-cache\n  if (color_cache_bits > 0) {\n    hdr->color_cache_size_ = 1 << color_cache_bits;\n    if (!VP8LColorCacheInit(&hdr->color_cache_, color_cache_bits)) {\n      dec->status_ = VP8_STATUS_OUT_OF_MEMORY;\n      ok = 0;\n      goto End;\n    }\n  } else {\n    hdr->color_cache_size_ = 0;\n  }\n  UpdateDecoder(dec, transform_xsize, transform_ysize);\n\n  if (is_level0) {   // level 0 complete\n    dec->state_ = READ_HDR;\n    goto End;\n  }\n\n  {\n    const uint64_t total_size = (uint64_t)transform_xsize * transform_ysize;\n    data = (uint32_t*)WebPSafeMalloc(total_size, sizeof(*data));\n    if (data == NULL) {\n      dec->status_ = VP8_STATUS_OUT_OF_MEMORY;\n      ok = 0;\n      goto End;\n    }\n  }\n\n  // Use the Huffman trees to decode the LZ77 encoded data.\n  ok = DecodeImageData(dec, data, transform_xsize, transform_ysize,\n                       transform_ysize, NULL);\n  ok = ok && !br->error_;\n\n End:\n\n  if (!ok) {\n    WebPSafeFree(data);\n    ClearMetadata(hdr);\n    // If not enough data (br.eos_) resulted in BIT_STREAM_ERROR, update the\n    // status appropriately.\n    if (dec->status_ == VP8_STATUS_BITSTREAM_ERROR && dec->br_.eos_) {\n      dec->status_ = VP8_STATUS_SUSPENDED;\n    }\n  } else {\n    if (decoded_data != NULL) {\n      *decoded_data = data;\n    } else {\n      // We allocate image data in this function only for transforms. At level 0\n      // (that is: not the transforms), we shouldn't have allocated anything.\n      assert(data == NULL);\n      assert(is_level0);\n    }\n    dec->last_pixel_ = 0;  // Reset for future DECODE_DATA_FUNC() calls.\n    if (!is_level0) ClearMetadata(hdr);  // Clean up temporary data behind.\n  }\n  return ok;\n}\n\n//------------------------------------------------------------------------------\n// Allocate internal buffers dec->pixels_ and dec->argb_cache_.\nstatic int AllocateInternalBuffers32b(VP8LDecoder* const dec, int final_width) {\n  const uint64_t num_pixels = (uint64_t)dec->width_ * dec->height_;\n  // Scratch buffer corresponding to top-prediction row for transforming the\n  // first row in the row-blocks. Not needed for paletted alpha.\n  const uint64_t cache_top_pixels = (uint16_t)final_width;\n  // Scratch buffer for temporary BGRA storage. Not needed for paletted alpha.\n  const uint64_t cache_pixels = (uint64_t)final_width * NUM_ARGB_CACHE_ROWS;\n  const uint64_t total_num_pixels =\n      num_pixels + cache_top_pixels + cache_pixels;\n\n  assert(dec->width_ <= final_width);\n  dec->pixels_ = (uint32_t*)WebPSafeMalloc(total_num_pixels, sizeof(uint32_t));\n  if (dec->pixels_ == NULL) {\n    dec->argb_cache_ = NULL;    // for sanity check\n    dec->status_ = VP8_STATUS_OUT_OF_MEMORY;\n    return 0;\n  }\n  dec->argb_cache_ = dec->pixels_ + num_pixels + cache_top_pixels;\n  return 1;\n}\n\nstatic int AllocateInternalBuffers8b(VP8LDecoder* const dec) {\n  const uint64_t total_num_pixels = (uint64_t)dec->width_ * dec->height_;\n  dec->argb_cache_ = NULL;    // for sanity check\n  dec->pixels_ = (uint32_t*)WebPSafeMalloc(total_num_pixels, sizeof(uint8_t));\n  if (dec->pixels_ == NULL) {\n    dec->status_ = VP8_STATUS_OUT_OF_MEMORY;\n    return 0;\n  }\n  return 1;\n}\n\n//------------------------------------------------------------------------------\n\n// Special row-processing that only stores the alpha data.\nstatic void ExtractAlphaRows(VP8LDecoder* const dec, int row) {\n  const int num_rows = row - dec->last_row_;\n  const uint32_t* const in = dec->pixels_ + dec->width_ * dec->last_row_;\n\n  if (num_rows <= 0) return;  // Nothing to be done.\n  ApplyInverseTransforms(dec, num_rows, in);\n\n  // Extract alpha (which is stored in the green plane).\n  {\n    const int width = dec->io_->width;      // the final width (!= dec->width_)\n    const int cache_pixs = width * num_rows;\n    uint8_t* const dst = (uint8_t*)dec->io_->opaque + width * dec->last_row_;\n    const uint32_t* const src = dec->argb_cache_;\n    int i;\n    for (i = 0; i < cache_pixs; ++i) dst[i] = (src[i] >> 8) & 0xff;\n  }\n  dec->last_row_ = dec->last_out_row_ = row;\n}\n\nint VP8LDecodeAlphaHeader(ALPHDecoder* const alph_dec,\n                          const uint8_t* const data, size_t data_size,\n                          uint8_t* const output) {\n  int ok = 0;\n  VP8LDecoder* dec;\n  VP8Io* io;\n  assert(alph_dec != NULL);\n  alph_dec->vp8l_dec_ = VP8LNew();\n  if (alph_dec->vp8l_dec_ == NULL) return 0;\n  dec = alph_dec->vp8l_dec_;\n\n  dec->width_ = alph_dec->width_;\n  dec->height_ = alph_dec->height_;\n  dec->io_ = &alph_dec->io_;\n  io = dec->io_;\n\n  VP8InitIo(io);\n  WebPInitCustomIo(NULL, io);  // Just a sanity Init. io won't be used.\n  io->opaque = output;\n  io->width = alph_dec->width_;\n  io->height = alph_dec->height_;\n\n  dec->status_ = VP8_STATUS_OK;\n  VP8LInitBitReader(&dec->br_, data, data_size);\n\n  dec->action_ = READ_HDR;\n  if (!DecodeImageStream(alph_dec->width_, alph_dec->height_, 1, dec, NULL)) {\n    goto Err;\n  }\n\n  // Special case: if alpha data uses only the color indexing transform and\n  // doesn't use color cache (a frequent case), we will use DecodeAlphaData()\n  // method that only needs allocation of 1 byte per pixel (alpha channel).\n  if (dec->next_transform_ == 1 &&\n      dec->transforms_[0].type_ == COLOR_INDEXING_TRANSFORM &&\n      Is8bOptimizable(&dec->hdr_)) {\n    alph_dec->use_8b_decode = 1;\n    ok = AllocateInternalBuffers8b(dec);\n  } else {\n    // Allocate internal buffers (note that dec->width_ may have changed here).\n    alph_dec->use_8b_decode = 0;\n    ok = AllocateInternalBuffers32b(dec, alph_dec->width_);\n  }\n\n  if (!ok) goto Err;\n\n  dec->action_ = READ_DATA;\n  return 1;\n\n Err:\n  VP8LDelete(alph_dec->vp8l_dec_);\n  alph_dec->vp8l_dec_ = NULL;\n  return 0;\n}\n\nint VP8LDecodeAlphaImageStream(ALPHDecoder* const alph_dec, int last_row) {\n  VP8LDecoder* const dec = alph_dec->vp8l_dec_;\n  assert(dec != NULL);\n  assert(dec->action_ == READ_DATA);\n  assert(last_row <= dec->height_);\n\n  if (dec->last_pixel_ == dec->width_ * dec->height_) {\n    return 1;  // done\n  }\n\n  // Decode (with special row processing).\n  return alph_dec->use_8b_decode ?\n      DecodeAlphaData(dec, (uint8_t*)dec->pixels_, dec->width_, dec->height_,\n                      last_row) :\n      DecodeImageData(dec, dec->pixels_, dec->width_, dec->height_,\n                      last_row, ExtractAlphaRows);\n}\n\n//------------------------------------------------------------------------------\n\nint VP8LDecodeHeader(VP8LDecoder* const dec, VP8Io* const io) {\n  int width, height, has_alpha;\n\n  if (dec == NULL) return 0;\n  if (io == NULL) {\n    dec->status_ = VP8_STATUS_INVALID_PARAM;\n    return 0;\n  }\n\n  dec->io_ = io;\n  dec->status_ = VP8_STATUS_OK;\n  VP8LInitBitReader(&dec->br_, io->data, io->data_size);\n  if (!ReadImageInfo(&dec->br_, &width, &height, &has_alpha)) {\n    dec->status_ = VP8_STATUS_BITSTREAM_ERROR;\n    goto Error;\n  }\n  dec->state_ = READ_DIM;\n  io->width = width;\n  io->height = height;\n\n  dec->action_ = READ_HDR;\n  if (!DecodeImageStream(width, height, 1, dec, NULL)) goto Error;\n  return 1;\n\n Error:\n  VP8LClear(dec);\n  assert(dec->status_ != VP8_STATUS_OK);\n  return 0;\n}\n\nint VP8LDecodeImage(VP8LDecoder* const dec) {\n  VP8Io* io = NULL;\n  WebPDecParams* params = NULL;\n\n  // Sanity checks.\n  if (dec == NULL) return 0;\n\n  dec->status_ = VP8_STATUS_BITSTREAM_ERROR;\n  assert(dec->hdr_.htree_groups_ != NULL);\n  assert(dec->hdr_.num_htree_groups_ > 0);\n\n  io = dec->io_;\n  assert(io != NULL);\n  params = (WebPDecParams*)io->opaque;\n  assert(params != NULL);\n  dec->output_ = params->output;\n  assert(dec->output_ != NULL);\n\n  // Initialization.\n  if (!WebPIoInitFromOptions(params->options, io, MODE_BGRA)) {\n    dec->status_ = VP8_STATUS_INVALID_PARAM;\n    goto Err;\n  }\n\n  if (!AllocateInternalBuffers32b(dec, io->width)) goto Err;\n\n  if (io->use_scaling && !AllocateAndInitRescaler(dec, io)) goto Err;\n\n  if (io->use_scaling || WebPIsPremultipliedMode(dec->output_->colorspace)) {\n    // need the alpha-multiply functions for premultiplied output or rescaling\n    WebPInitAlphaProcessing();\n  }\n\n  // Decode.\n  dec->action_ = READ_DATA;\n  if (!DecodeImageData(dec, dec->pixels_, dec->width_, dec->height_,\n                       dec->height_, ProcessRows)) {\n    goto Err;\n  }\n\n  // Cleanup.\n  params->last_y = dec->last_out_row_;\n  VP8LClear(dec);\n  return 1;\n\n Err:\n  VP8LClear(dec);\n  assert(dec->status_ != VP8_STATUS_OK);\n  return 0;\n}\n\n//------------------------------------------------------------------------------\n"
  },
  {
    "path": "ext/libwebp/dec/vp8li.h",
    "content": "// Copyright 2012 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Lossless decoder: internal header.\n//\n// Author: Skal (pascal.massimino@gmail.com)\n//         Vikas Arora(vikaas.arora@gmail.com)\n\n#ifndef WEBP_DEC_VP8LI_H_\n#define WEBP_DEC_VP8LI_H_\n\n#include <string.h>     // for memcpy()\n#include \"./webpi.h\"\n#include \"../utils/bit_reader.h\"\n#include \"../utils/color_cache.h\"\n#include \"../utils/huffman.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef enum {\n  READ_DATA = 0,\n  READ_HDR = 1,\n  READ_DIM = 2\n} VP8LDecodeState;\n\ntypedef struct VP8LTransform VP8LTransform;\nstruct VP8LTransform {\n  VP8LImageTransformType type_;   // transform type.\n  int                    bits_;   // subsampling bits defining transform window.\n  int                    xsize_;  // transform window X index.\n  int                    ysize_;  // transform window Y index.\n  uint32_t              *data_;   // transform data.\n};\n\ntypedef struct {\n  int             color_cache_size_;\n  VP8LColorCache  color_cache_;\n\n  int             huffman_mask_;\n  int             huffman_subsample_bits_;\n  int             huffman_xsize_;\n  uint32_t       *huffman_image_;\n  int             num_htree_groups_;\n  HTreeGroup     *htree_groups_;\n} VP8LMetadata;\n\ntypedef struct VP8LDecoder VP8LDecoder;\nstruct VP8LDecoder {\n  VP8StatusCode    status_;\n  VP8LDecodeState  action_;\n  VP8LDecodeState  state_;\n  VP8Io           *io_;\n\n  const WebPDecBuffer *output_;    // shortcut to io->opaque->output\n\n  uint32_t        *pixels_;        // Internal data: either uint8_t* for alpha\n                                   // or uint32_t* for BGRA.\n  uint32_t        *argb_cache_;    // Scratch buffer for temporary BGRA storage.\n\n  VP8LBitReader    br_;\n\n  int              width_;\n  int              height_;\n  int              last_row_;      // last input row decoded so far.\n  int              last_pixel_;    // last pixel decoded so far. However, it may\n                                   // not be transformed, scaled and\n                                   // color-converted yet.\n  int              last_out_row_;  // last row output so far.\n\n  VP8LMetadata     hdr_;\n\n  int              next_transform_;\n  VP8LTransform    transforms_[NUM_TRANSFORMS];\n  // or'd bitset storing the transforms types.\n  uint32_t         transforms_seen_;\n\n  uint8_t         *rescaler_memory;  // Working memory for rescaling work.\n  WebPRescaler    *rescaler;         // Common rescaler for all channels.\n};\n\n//------------------------------------------------------------------------------\n// internal functions. Not public.\n\nstruct ALPHDecoder;  // Defined in dec/alphai.h.\n\n// in vp8l.c\n\n// Decodes image header for alpha data stored using lossless compression.\n// Returns false in case of error.\nint VP8LDecodeAlphaHeader(struct ALPHDecoder* const alph_dec,\n                          const uint8_t* const data, size_t data_size,\n                          uint8_t* const output);\n\n// Decodes *at least* 'last_row' rows of alpha. If some of the initial rows are\n// already decoded in previous call(s), it will resume decoding from where it\n// was paused.\n// Returns false in case of bitstream error.\nint VP8LDecodeAlphaImageStream(struct ALPHDecoder* const alph_dec,\n                               int last_row);\n\n// Allocates and initialize a new lossless decoder instance.\nVP8LDecoder* VP8LNew(void);\n\n// Decodes the image header. Returns false in case of error.\nint VP8LDecodeHeader(VP8LDecoder* const dec, VP8Io* const io);\n\n// Decodes an image. It's required to decode the lossless header before calling\n// this function. Returns false in case of error, with updated dec->status_.\nint VP8LDecodeImage(VP8LDecoder* const dec);\n\n// Resets the decoder in its initial state, reclaiming memory.\n// Preserves the dec->status_ value.\nvoid VP8LClear(VP8LDecoder* const dec);\n\n// Clears and deallocate a lossless decoder instance.\nvoid VP8LDelete(VP8LDecoder* const dec);\n\n//------------------------------------------------------------------------------\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_DEC_VP8LI_H_ */\n"
  },
  {
    "path": "ext/libwebp/dec/webp.c",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Main decoding functions for WEBP images.\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include <stdlib.h>\n\n#include \"./vp8i.h\"\n#include \"./vp8li.h\"\n#include \"./webpi.h\"\n#include \"../webp/mux_types.h\"  // ALPHA_FLAG\n\n//------------------------------------------------------------------------------\n// RIFF layout is:\n//   Offset  tag\n//   0...3   \"RIFF\" 4-byte tag\n//   4...7   size of image data (including metadata) starting at offset 8\n//   8...11  \"WEBP\"   our form-type signature\n// The RIFF container (12 bytes) is followed by appropriate chunks:\n//   12..15  \"VP8 \": 4-bytes tags, signaling the use of VP8 video format\n//   16..19  size of the raw VP8 image data, starting at offset 20\n//   20....  the VP8 bytes\n// Or,\n//   12..15  \"VP8L\": 4-bytes tags, signaling the use of VP8L lossless format\n//   16..19  size of the raw VP8L image data, starting at offset 20\n//   20....  the VP8L bytes\n// Or,\n//   12..15  \"VP8X\": 4-bytes tags, describing the extended-VP8 chunk.\n//   16..19  size of the VP8X chunk starting at offset 20.\n//   20..23  VP8X flags bit-map corresponding to the chunk-types present.\n//   24..26  Width of the Canvas Image.\n//   27..29  Height of the Canvas Image.\n// There can be extra chunks after the \"VP8X\" chunk (ICCP, FRGM, ANMF, VP8,\n// VP8L, XMP, EXIF  ...)\n// All sizes are in little-endian order.\n// Note: chunk data size must be padded to multiple of 2 when written.\n\nstatic WEBP_INLINE uint32_t get_le24(const uint8_t* const data) {\n  return data[0] | (data[1] << 8) | (data[2] << 16);\n}\n\nstatic WEBP_INLINE uint32_t get_le32(const uint8_t* const data) {\n  return (uint32_t)get_le24(data) | (data[3] << 24);\n}\n\n// Validates the RIFF container (if detected) and skips over it.\n// If a RIFF container is detected, returns:\n//     VP8_STATUS_BITSTREAM_ERROR for invalid header,\n//     VP8_STATUS_NOT_ENOUGH_DATA for truncated data if have_all_data is true,\n// and VP8_STATUS_OK otherwise.\n// In case there are not enough bytes (partial RIFF container), return 0 for\n// *riff_size. Else return the RIFF size extracted from the header.\nstatic VP8StatusCode ParseRIFF(const uint8_t** const data,\n                               size_t* const data_size, int have_all_data,\n                               size_t* const riff_size) {\n  assert(data != NULL);\n  assert(data_size != NULL);\n  assert(riff_size != NULL);\n\n  *riff_size = 0;  // Default: no RIFF present.\n  if (*data_size >= RIFF_HEADER_SIZE && !memcmp(*data, \"RIFF\", TAG_SIZE)) {\n    if (memcmp(*data + 8, \"WEBP\", TAG_SIZE)) {\n      return VP8_STATUS_BITSTREAM_ERROR;  // Wrong image file signature.\n    } else {\n      const uint32_t size = get_le32(*data + TAG_SIZE);\n      // Check that we have at least one chunk (i.e \"WEBP\" + \"VP8?nnnn\").\n      if (size < TAG_SIZE + CHUNK_HEADER_SIZE) {\n        return VP8_STATUS_BITSTREAM_ERROR;\n      }\n      if (size > MAX_CHUNK_PAYLOAD) {\n        return VP8_STATUS_BITSTREAM_ERROR;\n      }\n      if (have_all_data && (size > *data_size - CHUNK_HEADER_SIZE)) {\n        return VP8_STATUS_NOT_ENOUGH_DATA;  // Truncated bitstream.\n      }\n      // We have a RIFF container. Skip it.\n      *riff_size = size;\n      *data += RIFF_HEADER_SIZE;\n      *data_size -= RIFF_HEADER_SIZE;\n    }\n  }\n  return VP8_STATUS_OK;\n}\n\n// Validates the VP8X header and skips over it.\n// Returns VP8_STATUS_BITSTREAM_ERROR for invalid VP8X header,\n//         VP8_STATUS_NOT_ENOUGH_DATA in case of insufficient data, and\n//         VP8_STATUS_OK otherwise.\n// If a VP8X chunk is found, found_vp8x is set to true and *width_ptr,\n// *height_ptr and *flags_ptr are set to the corresponding values extracted\n// from the VP8X chunk.\nstatic VP8StatusCode ParseVP8X(const uint8_t** const data,\n                               size_t* const data_size,\n                               int* const found_vp8x,\n                               int* const width_ptr, int* const height_ptr,\n                               uint32_t* const flags_ptr) {\n  const uint32_t vp8x_size = CHUNK_HEADER_SIZE + VP8X_CHUNK_SIZE;\n  assert(data != NULL);\n  assert(data_size != NULL);\n  assert(found_vp8x != NULL);\n\n  *found_vp8x = 0;\n\n  if (*data_size < CHUNK_HEADER_SIZE) {\n    return VP8_STATUS_NOT_ENOUGH_DATA;  // Insufficient data.\n  }\n\n  if (!memcmp(*data, \"VP8X\", TAG_SIZE)) {\n    int width, height;\n    uint32_t flags;\n    const uint32_t chunk_size = get_le32(*data + TAG_SIZE);\n    if (chunk_size != VP8X_CHUNK_SIZE) {\n      return VP8_STATUS_BITSTREAM_ERROR;  // Wrong chunk size.\n    }\n\n    // Verify if enough data is available to validate the VP8X chunk.\n    if (*data_size < vp8x_size) {\n      return VP8_STATUS_NOT_ENOUGH_DATA;  // Insufficient data.\n    }\n    flags = get_le32(*data + 8);\n    width = 1 + get_le24(*data + 12);\n    height = 1 + get_le24(*data + 15);\n    if (width * (uint64_t)height >= MAX_IMAGE_AREA) {\n      return VP8_STATUS_BITSTREAM_ERROR;  // image is too large\n    }\n\n    if (flags_ptr != NULL) *flags_ptr = flags;\n    if (width_ptr != NULL) *width_ptr = width;\n    if (height_ptr != NULL) *height_ptr = height;\n    // Skip over VP8X header bytes.\n    *data += vp8x_size;\n    *data_size -= vp8x_size;\n    *found_vp8x = 1;\n  }\n  return VP8_STATUS_OK;\n}\n\n// Skips to the next VP8/VP8L chunk header in the data given the size of the\n// RIFF chunk 'riff_size'.\n// Returns VP8_STATUS_BITSTREAM_ERROR if any invalid chunk size is encountered,\n//         VP8_STATUS_NOT_ENOUGH_DATA in case of insufficient data, and\n//         VP8_STATUS_OK otherwise.\n// If an alpha chunk is found, *alpha_data and *alpha_size are set\n// appropriately.\nstatic VP8StatusCode ParseOptionalChunks(const uint8_t** const data,\n                                         size_t* const data_size,\n                                         size_t const riff_size,\n                                         const uint8_t** const alpha_data,\n                                         size_t* const alpha_size) {\n  const uint8_t* buf;\n  size_t buf_size;\n  uint32_t total_size = TAG_SIZE +           // \"WEBP\".\n                        CHUNK_HEADER_SIZE +  // \"VP8Xnnnn\".\n                        VP8X_CHUNK_SIZE;     // data.\n  assert(data != NULL);\n  assert(data_size != NULL);\n  buf = *data;\n  buf_size = *data_size;\n\n  assert(alpha_data != NULL);\n  assert(alpha_size != NULL);\n  *alpha_data = NULL;\n  *alpha_size = 0;\n\n  while (1) {\n    uint32_t chunk_size;\n    uint32_t disk_chunk_size;   // chunk_size with padding\n\n    *data = buf;\n    *data_size = buf_size;\n\n    if (buf_size < CHUNK_HEADER_SIZE) {  // Insufficient data.\n      return VP8_STATUS_NOT_ENOUGH_DATA;\n    }\n\n    chunk_size = get_le32(buf + TAG_SIZE);\n    if (chunk_size > MAX_CHUNK_PAYLOAD) {\n      return VP8_STATUS_BITSTREAM_ERROR;          // Not a valid chunk size.\n    }\n    // For odd-sized chunk-payload, there's one byte padding at the end.\n    disk_chunk_size = (CHUNK_HEADER_SIZE + chunk_size + 1) & ~1;\n    total_size += disk_chunk_size;\n\n    // Check that total bytes skipped so far does not exceed riff_size.\n    if (riff_size > 0 && (total_size > riff_size)) {\n      return VP8_STATUS_BITSTREAM_ERROR;          // Not a valid chunk size.\n    }\n\n    // Start of a (possibly incomplete) VP8/VP8L chunk implies that we have\n    // parsed all the optional chunks.\n    // Note: This check must occur before the check 'buf_size < disk_chunk_size'\n    // below to allow incomplete VP8/VP8L chunks.\n    if (!memcmp(buf, \"VP8 \", TAG_SIZE) ||\n        !memcmp(buf, \"VP8L\", TAG_SIZE)) {\n      return VP8_STATUS_OK;\n    }\n\n    if (buf_size < disk_chunk_size) {             // Insufficient data.\n      return VP8_STATUS_NOT_ENOUGH_DATA;\n    }\n\n    if (!memcmp(buf, \"ALPH\", TAG_SIZE)) {         // A valid ALPH header.\n      *alpha_data = buf + CHUNK_HEADER_SIZE;\n      *alpha_size = chunk_size;\n    }\n\n    // We have a full and valid chunk; skip it.\n    buf += disk_chunk_size;\n    buf_size -= disk_chunk_size;\n  }\n}\n\n// Validates the VP8/VP8L Header (\"VP8 nnnn\" or \"VP8L nnnn\") and skips over it.\n// Returns VP8_STATUS_BITSTREAM_ERROR for invalid (chunk larger than\n//         riff_size) VP8/VP8L header,\n//         VP8_STATUS_NOT_ENOUGH_DATA in case of insufficient data, and\n//         VP8_STATUS_OK otherwise.\n// If a VP8/VP8L chunk is found, *chunk_size is set to the total number of bytes\n// extracted from the VP8/VP8L chunk header.\n// The flag '*is_lossless' is set to 1 in case of VP8L chunk / raw VP8L data.\nstatic VP8StatusCode ParseVP8Header(const uint8_t** const data_ptr,\n                                    size_t* const data_size, int have_all_data,\n                                    size_t riff_size, size_t* const chunk_size,\n                                    int* const is_lossless) {\n  const uint8_t* const data = *data_ptr;\n  const int is_vp8 = !memcmp(data, \"VP8 \", TAG_SIZE);\n  const int is_vp8l = !memcmp(data, \"VP8L\", TAG_SIZE);\n  const uint32_t minimal_size =\n      TAG_SIZE + CHUNK_HEADER_SIZE;  // \"WEBP\" + \"VP8 nnnn\" OR\n                                     // \"WEBP\" + \"VP8Lnnnn\"\n  assert(data != NULL);\n  assert(data_size != NULL);\n  assert(chunk_size != NULL);\n  assert(is_lossless != NULL);\n\n  if (*data_size < CHUNK_HEADER_SIZE) {\n    return VP8_STATUS_NOT_ENOUGH_DATA;  // Insufficient data.\n  }\n\n  if (is_vp8 || is_vp8l) {\n    // Bitstream contains VP8/VP8L header.\n    const uint32_t size = get_le32(data + TAG_SIZE);\n    if ((riff_size >= minimal_size) && (size > riff_size - minimal_size)) {\n      return VP8_STATUS_BITSTREAM_ERROR;  // Inconsistent size information.\n    }\n    if (have_all_data && (size > *data_size - CHUNK_HEADER_SIZE)) {\n      return VP8_STATUS_NOT_ENOUGH_DATA;  // Truncated bitstream.\n    }\n    // Skip over CHUNK_HEADER_SIZE bytes from VP8/VP8L Header.\n    *chunk_size = size;\n    *data_ptr += CHUNK_HEADER_SIZE;\n    *data_size -= CHUNK_HEADER_SIZE;\n    *is_lossless = is_vp8l;\n  } else {\n    // Raw VP8/VP8L bitstream (no header).\n    *is_lossless = VP8LCheckSignature(data, *data_size);\n    *chunk_size = *data_size;\n  }\n\n  return VP8_STATUS_OK;\n}\n\n//------------------------------------------------------------------------------\n\n// Fetch '*width', '*height', '*has_alpha' and fill out 'headers' based on\n// 'data'. All the output parameters may be NULL. If 'headers' is NULL only the\n// minimal amount will be read to fetch the remaining parameters.\n// If 'headers' is non-NULL this function will attempt to locate both alpha\n// data (with or without a VP8X chunk) and the bitstream chunk (VP8/VP8L).\n// Note: The following chunk sequences (before the raw VP8/VP8L data) are\n// considered valid by this function:\n// RIFF + VP8(L)\n// RIFF + VP8X + (optional chunks) + VP8(L)\n// ALPH + VP8 <-- Not a valid WebP format: only allowed for internal purpose.\n// VP8(L)     <-- Not a valid WebP format: only allowed for internal purpose.\nstatic VP8StatusCode ParseHeadersInternal(const uint8_t* data,\n                                          size_t data_size,\n                                          int* const width,\n                                          int* const height,\n                                          int* const has_alpha,\n                                          int* const has_animation,\n                                          int* const format,\n                                          WebPHeaderStructure* const headers) {\n  int canvas_width = 0;\n  int canvas_height = 0;\n  int image_width = 0;\n  int image_height = 0;\n  int found_riff = 0;\n  int found_vp8x = 0;\n  int animation_present = 0;\n  int fragments_present = 0;\n  const int have_all_data = (headers != NULL) ? headers->have_all_data : 0;\n\n  VP8StatusCode status;\n  WebPHeaderStructure hdrs;\n\n  if (data == NULL || data_size < RIFF_HEADER_SIZE) {\n    return VP8_STATUS_NOT_ENOUGH_DATA;\n  }\n  memset(&hdrs, 0, sizeof(hdrs));\n  hdrs.data = data;\n  hdrs.data_size = data_size;\n\n  // Skip over RIFF header.\n  status = ParseRIFF(&data, &data_size, have_all_data, &hdrs.riff_size);\n  if (status != VP8_STATUS_OK) {\n    return status;   // Wrong RIFF header / insufficient data.\n  }\n  found_riff = (hdrs.riff_size > 0);\n\n  // Skip over VP8X.\n  {\n    uint32_t flags = 0;\n    status = ParseVP8X(&data, &data_size, &found_vp8x,\n                       &canvas_width, &canvas_height, &flags);\n    if (status != VP8_STATUS_OK) {\n      return status;  // Wrong VP8X / insufficient data.\n    }\n    animation_present = !!(flags & ANIMATION_FLAG);\n    fragments_present = !!(flags & FRAGMENTS_FLAG);\n    if (!found_riff && found_vp8x) {\n      // Note: This restriction may be removed in the future, if it becomes\n      // necessary to send VP8X chunk to the decoder.\n      return VP8_STATUS_BITSTREAM_ERROR;\n    }\n    if (has_alpha != NULL) *has_alpha = !!(flags & ALPHA_FLAG);\n    if (has_animation != NULL) *has_animation = animation_present;\n    if (format != NULL) *format = 0;   // default = undefined\n\n    image_width = canvas_width;\n    image_height = canvas_height;\n    if (found_vp8x && (animation_present || fragments_present) &&\n        headers == NULL) {\n      status = VP8_STATUS_OK;\n      goto ReturnWidthHeight;  // Just return features from VP8X header.\n    }\n  }\n\n  if (data_size < TAG_SIZE) {\n    status = VP8_STATUS_NOT_ENOUGH_DATA;\n    goto ReturnWidthHeight;\n  }\n\n  // Skip over optional chunks if data started with \"RIFF + VP8X\" or \"ALPH\".\n  if ((found_riff && found_vp8x) ||\n      (!found_riff && !found_vp8x && !memcmp(data, \"ALPH\", TAG_SIZE))) {\n    status = ParseOptionalChunks(&data, &data_size, hdrs.riff_size,\n                                 &hdrs.alpha_data, &hdrs.alpha_data_size);\n    if (status != VP8_STATUS_OK) {\n      goto ReturnWidthHeight;  // Invalid chunk size / insufficient data.\n    }\n  }\n\n  // Skip over VP8/VP8L header.\n  status = ParseVP8Header(&data, &data_size, have_all_data, hdrs.riff_size,\n                          &hdrs.compressed_size, &hdrs.is_lossless);\n  if (status != VP8_STATUS_OK) {\n    goto ReturnWidthHeight;  // Wrong VP8/VP8L chunk-header / insufficient data.\n  }\n  if (hdrs.compressed_size > MAX_CHUNK_PAYLOAD) {\n    return VP8_STATUS_BITSTREAM_ERROR;\n  }\n\n  if (format != NULL && !(animation_present || fragments_present)) {\n    *format = hdrs.is_lossless ? 2 : 1;\n  }\n\n  if (!hdrs.is_lossless) {\n    if (data_size < VP8_FRAME_HEADER_SIZE) {\n      status = VP8_STATUS_NOT_ENOUGH_DATA;\n      goto ReturnWidthHeight;\n    }\n    // Validates raw VP8 data.\n    if (!VP8GetInfo(data, data_size, (uint32_t)hdrs.compressed_size,\n                    &image_width, &image_height)) {\n      return VP8_STATUS_BITSTREAM_ERROR;\n    }\n  } else {\n    if (data_size < VP8L_FRAME_HEADER_SIZE) {\n      status = VP8_STATUS_NOT_ENOUGH_DATA;\n      goto ReturnWidthHeight;\n    }\n    // Validates raw VP8L data.\n    if (!VP8LGetInfo(data, data_size, &image_width, &image_height, has_alpha)) {\n      return VP8_STATUS_BITSTREAM_ERROR;\n    }\n  }\n  // Validates image size coherency.\n  if (found_vp8x) {\n    if (canvas_width != image_width || canvas_height != image_height) {\n      return VP8_STATUS_BITSTREAM_ERROR;\n    }\n  }\n  if (headers != NULL) {\n    *headers = hdrs;\n    headers->offset = data - headers->data;\n    assert((uint64_t)(data - headers->data) < MAX_CHUNK_PAYLOAD);\n    assert(headers->offset == headers->data_size - data_size);\n  }\n ReturnWidthHeight:\n  if (status == VP8_STATUS_OK ||\n      (status == VP8_STATUS_NOT_ENOUGH_DATA && found_vp8x && headers == NULL)) {\n    if (has_alpha != NULL) {\n      // If the data did not contain a VP8X/VP8L chunk the only definitive way\n      // to set this is by looking for alpha data (from an ALPH chunk).\n      *has_alpha |= (hdrs.alpha_data != NULL);\n    }\n    if (width != NULL) *width = image_width;\n    if (height != NULL) *height = image_height;\n    return VP8_STATUS_OK;\n  } else {\n    return status;\n  }\n}\n\nVP8StatusCode WebPParseHeaders(WebPHeaderStructure* const headers) {\n  VP8StatusCode status;\n  int has_animation = 0;\n  assert(headers != NULL);\n  // fill out headers, ignore width/height/has_alpha.\n  status = ParseHeadersInternal(headers->data, headers->data_size,\n                                NULL, NULL, NULL, &has_animation,\n                                NULL, headers);\n  if (status == VP8_STATUS_OK || status == VP8_STATUS_NOT_ENOUGH_DATA) {\n    // TODO(jzern): full support of animation frames will require API additions.\n    if (has_animation) {\n      status = VP8_STATUS_UNSUPPORTED_FEATURE;\n    }\n  }\n  return status;\n}\n\n//------------------------------------------------------------------------------\n// WebPDecParams\n\nvoid WebPResetDecParams(WebPDecParams* const params) {\n  if (params != NULL) {\n    memset(params, 0, sizeof(*params));\n  }\n}\n\n//------------------------------------------------------------------------------\n// \"Into\" decoding variants\n\n// Main flow\nstatic VP8StatusCode DecodeInto(const uint8_t* const data, size_t data_size,\n                                WebPDecParams* const params) {\n  VP8StatusCode status;\n  VP8Io io;\n  WebPHeaderStructure headers;\n\n  headers.data = data;\n  headers.data_size = data_size;\n  headers.have_all_data = 1;\n  status = WebPParseHeaders(&headers);   // Process Pre-VP8 chunks.\n  if (status != VP8_STATUS_OK) {\n    return status;\n  }\n\n  assert(params != NULL);\n  VP8InitIo(&io);\n  io.data = headers.data + headers.offset;\n  io.data_size = headers.data_size - headers.offset;\n  WebPInitCustomIo(params, &io);  // Plug the I/O functions.\n\n  if (!headers.is_lossless) {\n    VP8Decoder* const dec = VP8New();\n    if (dec == NULL) {\n      return VP8_STATUS_OUT_OF_MEMORY;\n    }\n    dec->alpha_data_ = headers.alpha_data;\n    dec->alpha_data_size_ = headers.alpha_data_size;\n\n    // Decode bitstream header, update io->width/io->height.\n    if (!VP8GetHeaders(dec, &io)) {\n      status = dec->status_;   // An error occurred. Grab error status.\n    } else {\n      // Allocate/check output buffers.\n      status = WebPAllocateDecBuffer(io.width, io.height, params->options,\n                                     params->output);\n      if (status == VP8_STATUS_OK) {  // Decode\n        // This change must be done before calling VP8Decode()\n        dec->mt_method_ = VP8GetThreadMethod(params->options, &headers,\n                                             io.width, io.height);\n        VP8InitDithering(params->options, dec);\n        if (!VP8Decode(dec, &io)) {\n          status = dec->status_;\n        }\n      }\n    }\n    VP8Delete(dec);\n  } else {\n    VP8LDecoder* const dec = VP8LNew();\n    if (dec == NULL) {\n      return VP8_STATUS_OUT_OF_MEMORY;\n    }\n    if (!VP8LDecodeHeader(dec, &io)) {\n      status = dec->status_;   // An error occurred. Grab error status.\n    } else {\n      // Allocate/check output buffers.\n      status = WebPAllocateDecBuffer(io.width, io.height, params->options,\n                                     params->output);\n      if (status == VP8_STATUS_OK) {  // Decode\n        if (!VP8LDecodeImage(dec)) {\n          status = dec->status_;\n        }\n      }\n    }\n    VP8LDelete(dec);\n  }\n\n  if (status != VP8_STATUS_OK) {\n    WebPFreeDecBuffer(params->output);\n  }\n\n#if WEBP_DECODER_ABI_VERSION > 0x0203\n  if (params->options != NULL && params->options->flip) {\n    status = WebPFlipBuffer(params->output);\n  }\n#endif\n  return status;\n}\n\n// Helpers\nstatic uint8_t* DecodeIntoRGBABuffer(WEBP_CSP_MODE colorspace,\n                                     const uint8_t* const data,\n                                     size_t data_size,\n                                     uint8_t* const rgba,\n                                     int stride, size_t size) {\n  WebPDecParams params;\n  WebPDecBuffer buf;\n  if (rgba == NULL) {\n    return NULL;\n  }\n  WebPInitDecBuffer(&buf);\n  WebPResetDecParams(&params);\n  params.output = &buf;\n  buf.colorspace    = colorspace;\n  buf.u.RGBA.rgba   = rgba;\n  buf.u.RGBA.stride = stride;\n  buf.u.RGBA.size   = size;\n  buf.is_external_memory = 1;\n  if (DecodeInto(data, data_size, &params) != VP8_STATUS_OK) {\n    return NULL;\n  }\n  return rgba;\n}\n\nuint8_t* WebPDecodeRGBInto(const uint8_t* data, size_t data_size,\n                           uint8_t* output, size_t size, int stride) {\n  return DecodeIntoRGBABuffer(MODE_RGB, data, data_size, output, stride, size);\n}\n\nuint8_t* WebPDecodeRGBAInto(const uint8_t* data, size_t data_size,\n                            uint8_t* output, size_t size, int stride) {\n  return DecodeIntoRGBABuffer(MODE_RGBA, data, data_size, output, stride, size);\n}\n\nuint8_t* WebPDecodeARGBInto(const uint8_t* data, size_t data_size,\n                            uint8_t* output, size_t size, int stride) {\n  return DecodeIntoRGBABuffer(MODE_ARGB, data, data_size, output, stride, size);\n}\n\nuint8_t* WebPDecodeBGRInto(const uint8_t* data, size_t data_size,\n                           uint8_t* output, size_t size, int stride) {\n  return DecodeIntoRGBABuffer(MODE_BGR, data, data_size, output, stride, size);\n}\n\nuint8_t* WebPDecodeBGRAInto(const uint8_t* data, size_t data_size,\n                            uint8_t* output, size_t size, int stride) {\n  return DecodeIntoRGBABuffer(MODE_BGRA, data, data_size, output, stride, size);\n}\n\nuint8_t* WebPDecodeYUVInto(const uint8_t* data, size_t data_size,\n                           uint8_t* luma, size_t luma_size, int luma_stride,\n                           uint8_t* u, size_t u_size, int u_stride,\n                           uint8_t* v, size_t v_size, int v_stride) {\n  WebPDecParams params;\n  WebPDecBuffer output;\n  if (luma == NULL) return NULL;\n  WebPInitDecBuffer(&output);\n  WebPResetDecParams(&params);\n  params.output = &output;\n  output.colorspace      = MODE_YUV;\n  output.u.YUVA.y        = luma;\n  output.u.YUVA.y_stride = luma_stride;\n  output.u.YUVA.y_size   = luma_size;\n  output.u.YUVA.u        = u;\n  output.u.YUVA.u_stride = u_stride;\n  output.u.YUVA.u_size   = u_size;\n  output.u.YUVA.v        = v;\n  output.u.YUVA.v_stride = v_stride;\n  output.u.YUVA.v_size   = v_size;\n  output.is_external_memory = 1;\n  if (DecodeInto(data, data_size, &params) != VP8_STATUS_OK) {\n    return NULL;\n  }\n  return luma;\n}\n\n//------------------------------------------------------------------------------\n\nstatic uint8_t* Decode(WEBP_CSP_MODE mode, const uint8_t* const data,\n                       size_t data_size, int* const width, int* const height,\n                       WebPDecBuffer* const keep_info) {\n  WebPDecParams params;\n  WebPDecBuffer output;\n\n  WebPInitDecBuffer(&output);\n  WebPResetDecParams(&params);\n  params.output = &output;\n  output.colorspace = mode;\n\n  // Retrieve (and report back) the required dimensions from bitstream.\n  if (!WebPGetInfo(data, data_size, &output.width, &output.height)) {\n    return NULL;\n  }\n  if (width != NULL) *width = output.width;\n  if (height != NULL) *height = output.height;\n\n  // Decode\n  if (DecodeInto(data, data_size, &params) != VP8_STATUS_OK) {\n    return NULL;\n  }\n  if (keep_info != NULL) {    // keep track of the side-info\n    WebPCopyDecBuffer(&output, keep_info);\n  }\n  // return decoded samples (don't clear 'output'!)\n  return WebPIsRGBMode(mode) ? output.u.RGBA.rgba : output.u.YUVA.y;\n}\n\nuint8_t* WebPDecodeRGB(const uint8_t* data, size_t data_size,\n                       int* width, int* height) {\n  return Decode(MODE_RGB, data, data_size, width, height, NULL);\n}\n\nuint8_t* WebPDecodeRGBA(const uint8_t* data, size_t data_size,\n                        int* width, int* height) {\n  return Decode(MODE_RGBA, data, data_size, width, height, NULL);\n}\n\nuint8_t* WebPDecodeARGB(const uint8_t* data, size_t data_size,\n                        int* width, int* height) {\n  return Decode(MODE_ARGB, data, data_size, width, height, NULL);\n}\n\nuint8_t* WebPDecodeBGR(const uint8_t* data, size_t data_size,\n                       int* width, int* height) {\n  return Decode(MODE_BGR, data, data_size, width, height, NULL);\n}\n\nuint8_t* WebPDecodeBGRA(const uint8_t* data, size_t data_size,\n                        int* width, int* height) {\n  return Decode(MODE_BGRA, data, data_size, width, height, NULL);\n}\n\nuint8_t* WebPDecodeYUV(const uint8_t* data, size_t data_size,\n                       int* width, int* height, uint8_t** u, uint8_t** v,\n                       int* stride, int* uv_stride) {\n  WebPDecBuffer output;   // only to preserve the side-infos\n  uint8_t* const out = Decode(MODE_YUV, data, data_size,\n                              width, height, &output);\n\n  if (out != NULL) {\n    const WebPYUVABuffer* const buf = &output.u.YUVA;\n    *u = buf->u;\n    *v = buf->v;\n    *stride = buf->y_stride;\n    *uv_stride = buf->u_stride;\n    assert(buf->u_stride == buf->v_stride);\n  }\n  return out;\n}\n\nstatic void DefaultFeatures(WebPBitstreamFeatures* const features) {\n  assert(features != NULL);\n  memset(features, 0, sizeof(*features));\n}\n\nstatic VP8StatusCode GetFeatures(const uint8_t* const data, size_t data_size,\n                                 WebPBitstreamFeatures* const features) {\n  if (features == NULL || data == NULL) {\n    return VP8_STATUS_INVALID_PARAM;\n  }\n  DefaultFeatures(features);\n\n  // Only parse enough of the data to retrieve the features.\n  return ParseHeadersInternal(data, data_size,\n                              &features->width, &features->height,\n                              &features->has_alpha, &features->has_animation,\n                              &features->format, NULL);\n}\n\n//------------------------------------------------------------------------------\n// WebPGetInfo()\n\nint WebPGetInfo(const uint8_t* data, size_t data_size,\n                int* width, int* height) {\n  WebPBitstreamFeatures features;\n\n  if (GetFeatures(data, data_size, &features) != VP8_STATUS_OK) {\n    return 0;\n  }\n\n  if (width != NULL) {\n    *width  = features.width;\n  }\n  if (height != NULL) {\n    *height = features.height;\n  }\n\n  return 1;\n}\n\n//------------------------------------------------------------------------------\n// Advance decoding API\n\nint WebPInitDecoderConfigInternal(WebPDecoderConfig* config,\n                                  int version) {\n  if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_DECODER_ABI_VERSION)) {\n    return 0;   // version mismatch\n  }\n  if (config == NULL) {\n    return 0;\n  }\n  memset(config, 0, sizeof(*config));\n  DefaultFeatures(&config->input);\n  WebPInitDecBuffer(&config->output);\n  return 1;\n}\n\nVP8StatusCode WebPGetFeaturesInternal(const uint8_t* data, size_t data_size,\n                                      WebPBitstreamFeatures* features,\n                                      int version) {\n  if (WEBP_ABI_IS_INCOMPATIBLE(version, WEBP_DECODER_ABI_VERSION)) {\n    return VP8_STATUS_INVALID_PARAM;   // version mismatch\n  }\n  if (features == NULL) {\n    return VP8_STATUS_INVALID_PARAM;\n  }\n  return GetFeatures(data, data_size, features);\n}\n\nVP8StatusCode WebPDecode(const uint8_t* data, size_t data_size,\n                         WebPDecoderConfig* config) {\n  WebPDecParams params;\n  VP8StatusCode status;\n\n  if (config == NULL) {\n    return VP8_STATUS_INVALID_PARAM;\n  }\n\n  status = GetFeatures(data, data_size, &config->input);\n  if (status != VP8_STATUS_OK) {\n    if (status == VP8_STATUS_NOT_ENOUGH_DATA) {\n      return VP8_STATUS_BITSTREAM_ERROR;  // Not-enough-data treated as error.\n    }\n    return status;\n  }\n\n  WebPResetDecParams(&params);\n  params.output = &config->output;\n  params.options = &config->options;\n  status = DecodeInto(data, data_size, &params);\n\n  return status;\n}\n\n//------------------------------------------------------------------------------\n// Cropping and rescaling.\n\nint WebPIoInitFromOptions(const WebPDecoderOptions* const options,\n                          VP8Io* const io, WEBP_CSP_MODE src_colorspace) {\n  const int W = io->width;\n  const int H = io->height;\n  int x = 0, y = 0, w = W, h = H;\n\n  // Cropping\n  io->use_cropping = (options != NULL) && (options->use_cropping > 0);\n  if (io->use_cropping) {\n    w = options->crop_width;\n    h = options->crop_height;\n    x = options->crop_left;\n    y = options->crop_top;\n    if (!WebPIsRGBMode(src_colorspace)) {   // only snap for YUV420\n      x &= ~1;\n      y &= ~1;\n    }\n    if (x < 0 || y < 0 || w <= 0 || h <= 0 || x + w > W || y + h > H) {\n      return 0;  // out of frame boundary error\n    }\n  }\n  io->crop_left   = x;\n  io->crop_top    = y;\n  io->crop_right  = x + w;\n  io->crop_bottom = y + h;\n  io->mb_w = w;\n  io->mb_h = h;\n\n  // Scaling\n  io->use_scaling = (options != NULL) && (options->use_scaling > 0);\n  if (io->use_scaling) {\n    if (options->scaled_width <= 0 || options->scaled_height <= 0) {\n      return 0;\n    }\n    io->scaled_width = options->scaled_width;\n    io->scaled_height = options->scaled_height;\n  }\n\n  // Filter\n  io->bypass_filtering = options && options->bypass_filtering;\n\n  // Fancy upsampler\n#ifdef FANCY_UPSAMPLING\n  io->fancy_upsampling = (options == NULL) || (!options->no_fancy_upsampling);\n#endif\n\n  if (io->use_scaling) {\n    // disable filter (only for large downscaling ratio).\n    io->bypass_filtering = (io->scaled_width < W * 3 / 4) &&\n                           (io->scaled_height < H * 3 / 4);\n    io->fancy_upsampling = 0;\n  }\n  return 1;\n}\n\n//------------------------------------------------------------------------------\n\n"
  },
  {
    "path": "ext/libwebp/dec/webpi.h",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Internal header: WebP decoding parameters and custom IO on buffer\n//\n// Author: somnath@google.com (Somnath Banerjee)\n\n#ifndef WEBP_DEC_WEBPI_H_\n#define WEBP_DEC_WEBPI_H_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include \"../utils/rescaler.h\"\n#include \"./decode_vp8.h\"\n\n//------------------------------------------------------------------------------\n// WebPDecParams: Decoding output parameters. Transient internal object.\n\ntypedef struct WebPDecParams WebPDecParams;\ntypedef int (*OutputFunc)(const VP8Io* const io, WebPDecParams* const p);\ntypedef int (*OutputRowFunc)(WebPDecParams* const p, int y_pos);\n\nstruct WebPDecParams {\n  WebPDecBuffer* output;             // output buffer.\n  uint8_t* tmp_y, *tmp_u, *tmp_v;    // cache for the fancy upsampler\n                                     // or used for tmp rescaling\n\n  int last_y;                 // coordinate of the line that was last output\n  const WebPDecoderOptions* options;  // if not NULL, use alt decoding features\n  // rescalers\n  WebPRescaler scaler_y, scaler_u, scaler_v, scaler_a;\n  void* memory;                  // overall scratch memory for the output work.\n\n  OutputFunc emit;               // output RGB or YUV samples\n  OutputFunc emit_alpha;         // output alpha channel\n  OutputRowFunc emit_alpha_row;  // output one line of rescaled alpha values\n};\n\n// Should be called first, before any use of the WebPDecParams object.\nvoid WebPResetDecParams(WebPDecParams* const params);\n\n//------------------------------------------------------------------------------\n// Header parsing helpers\n\n// Structure storing a description of the RIFF headers.\ntypedef struct {\n  const uint8_t* data;         // input buffer\n  size_t data_size;            // input buffer size\n  int have_all_data;           // true if all data is known to be available\n  size_t offset;               // offset to main data chunk (VP8 or VP8L)\n  const uint8_t* alpha_data;   // points to alpha chunk (if present)\n  size_t alpha_data_size;      // alpha chunk size\n  size_t compressed_size;      // VP8/VP8L compressed data size\n  size_t riff_size;            // size of the riff payload (or 0 if absent)\n  int is_lossless;             // true if a VP8L chunk is present\n} WebPHeaderStructure;\n\n// Skips over all valid chunks prior to the first VP8/VP8L frame header.\n// Returns: VP8_STATUS_OK, VP8_STATUS_BITSTREAM_ERROR (invalid header/chunk),\n// VP8_STATUS_NOT_ENOUGH_DATA (partial input) or VP8_STATUS_UNSUPPORTED_FEATURE\n// in the case of non-decodable features (animation for instance).\n// In 'headers', compressed_size, offset, alpha_data, alpha_size, and lossless\n// fields are updated appropriately upon success.\nVP8StatusCode WebPParseHeaders(WebPHeaderStructure* const headers);\n\n//------------------------------------------------------------------------------\n// Misc utils\n\n// Initializes VP8Io with custom setup, io and teardown functions. The default\n// hooks will use the supplied 'params' as io->opaque handle.\nvoid WebPInitCustomIo(WebPDecParams* const params, VP8Io* const io);\n\n// Setup crop_xxx fields, mb_w and mb_h in io. 'src_colorspace' refers\n// to the *compressed* format, not the output one.\nint WebPIoInitFromOptions(const WebPDecoderOptions* const options,\n                          VP8Io* const io, WEBP_CSP_MODE src_colorspace);\n\n//------------------------------------------------------------------------------\n// Internal functions regarding WebPDecBuffer memory (in buffer.c).\n// Don't really need to be externally visible for now.\n\n// Prepare 'buffer' with the requested initial dimensions width/height.\n// If no external storage is supplied, initializes buffer by allocating output\n// memory and setting up the stride information. Validate the parameters. Return\n// an error code in case of problem (no memory, or invalid stride / size /\n// dimension / etc.). If *options is not NULL, also verify that the options'\n// parameters are valid and apply them to the width/height dimensions of the\n// output buffer. This takes cropping / scaling / rotation into account.\n// Also incorporates the options->flip flag to flip the buffer parameters if\n// needed.\nVP8StatusCode WebPAllocateDecBuffer(int width, int height,\n                                    const WebPDecoderOptions* const options,\n                                    WebPDecBuffer* const buffer);\n\n// Flip buffer vertically by negating the various strides.\nVP8StatusCode WebPFlipBuffer(WebPDecBuffer* const buffer);\n\n// Copy 'src' into 'dst' buffer, making sure 'dst' is not marked as owner of the\n// memory (still held by 'src').\nvoid WebPCopyDecBuffer(const WebPDecBuffer* const src,\n                       WebPDecBuffer* const dst);\n\n// Copy and transfer ownership from src to dst (beware of parameter order!)\nvoid WebPGrabDecBuffer(WebPDecBuffer* const src, WebPDecBuffer* const dst);\n\n//------------------------------------------------------------------------------\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_DEC_WEBPI_H_ */\n"
  },
  {
    "path": "ext/libwebp/dsp/Makefile.am",
    "content": "noinst_LTLIBRARIES = libwebpdsp.la libwebpdsp_avx2.la\nnoinst_LTLIBRARIES += libwebpdsp_sse2.la libwebpdspdecode_sse2.la\n\nif BUILD_LIBWEBPDECODER\n  noinst_LTLIBRARIES += libwebpdspdecode.la\nendif\n\ncommon_HEADERS = ../webp/types.h\ncommondir = $(includedir)/webp\n\nCOMMON_SOURCES =\nCOMMON_SOURCES += alpha_processing.c\nCOMMON_SOURCES += cpu.c\nCOMMON_SOURCES += dec.c\nCOMMON_SOURCES += dec_clip_tables.c\nCOMMON_SOURCES += dec_mips32.c\nCOMMON_SOURCES += dec_neon.c\nCOMMON_SOURCES += dsp.h\nCOMMON_SOURCES += lossless.c\nCOMMON_SOURCES += lossless.h\nCOMMON_SOURCES += lossless_mips32.c\nCOMMON_SOURCES += lossless_neon.c\nCOMMON_SOURCES += neon.h\nCOMMON_SOURCES += upsampling.c\nCOMMON_SOURCES += upsampling_neon.c\nCOMMON_SOURCES += yuv.c\nCOMMON_SOURCES += yuv.h\nCOMMON_SOURCES += yuv_mips32.c\n\nENC_SOURCES =\nENC_SOURCES += enc.c\nENC_SOURCES += enc_mips32.c\nENC_SOURCES += enc_neon.c\n\nlibwebpdsp_avx2_la_SOURCES =\nlibwebpdsp_avx2_la_SOURCES += enc_avx2.c\nlibwebpdsp_avx2_la_CPPFLAGS = $(libwebpdsp_la_CPPFLAGS)\nlibwebpdsp_avx2_la_CFLAGS = $(AM_CFLAGS) $(AVX2_FLAGS)\n\nlibwebpdspdecode_sse2_la_SOURCES =\nlibwebpdspdecode_sse2_la_SOURCES += alpha_processing_sse2.c\nlibwebpdspdecode_sse2_la_SOURCES += dec_sse2.c\nlibwebpdspdecode_sse2_la_SOURCES += lossless_sse2.c\nlibwebpdspdecode_sse2_la_SOURCES += upsampling_sse2.c\nlibwebpdspdecode_sse2_la_SOURCES += yuv_sse2.c\nlibwebpdspdecode_sse2_la_SOURCES += yuv_tables_sse2.h\nlibwebpdspdecode_sse2_la_CPPFLAGS = $(libwebpdsp_sse2_la_CPPFLAGS)\nlibwebpdspdecode_sse2_la_CFLAGS = $(libwebpdsp_sse2_la_CFLAGS)\n\nlibwebpdsp_sse2_la_SOURCES =\nlibwebpdsp_sse2_la_SOURCES += enc_sse2.c\nlibwebpdsp_sse2_la_CPPFLAGS = $(libwebpdsp_la_CPPFLAGS)\nlibwebpdsp_sse2_la_CFLAGS = $(AM_CFLAGS) $(SSE2_FLAGS)\nlibwebpdsp_sse2_la_LIBADD = libwebpdspdecode_sse2.la\n\nlibwebpdsp_la_SOURCES = $(COMMON_SOURCES) $(ENC_SOURCES)\n\nnoinst_HEADERS =\nnoinst_HEADERS += ../dec/decode_vp8.h\nnoinst_HEADERS += ../webp/decode.h\n\nlibwebpdsp_la_CPPFLAGS = $(USE_EXPERIMENTAL_CODE) $(USE_SWAP_16BIT_CSP)\nlibwebpdsp_la_LDFLAGS = -lm\nlibwebpdsp_la_LIBADD = libwebpdsp_avx2.la libwebpdsp_sse2.la\n\nif BUILD_LIBWEBPDECODER\n  libwebpdspdecode_la_SOURCES = $(COMMON_SOURCES)\n\n  libwebpdspdecode_la_CPPFLAGS = $(libwebpdsp_la_CPPFLAGS)\n  libwebpdspdecode_la_LDFLAGS = $(libwebpdsp_la_LDFLAGS)\n  libwebpdspdecode_la_LIBADD = libwebpdspdecode_sse2.la\nendif\n"
  },
  {
    "path": "ext/libwebp/dsp/Makefile.in",
    "content": "# Makefile.in generated by automake 1.11.3 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,\n# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software\n# Foundation, Inc.\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\n\n\nVPATH = @srcdir@\npkgdatadir = $(datadir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkglibexecdir = $(libexecdir)/@PACKAGE@\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nbuild_triplet = @build@\nhost_triplet = @host@\n@BUILD_LIBWEBPDECODER_TRUE@am__append_1 = libwebpdspdecode.la\nsubdir = src/dsp\nDIST_COMMON = $(common_HEADERS) $(noinst_HEADERS) \\\n\t$(srcdir)/Makefile.am $(srcdir)/Makefile.in\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \\\n\t$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \\\n\t$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \\\n\t$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nmkinstalldirs = $(install_sh) -d\nCONFIG_HEADER = $(top_builddir)/src/webp/config.h\nCONFIG_CLEAN_FILES =\nCONFIG_CLEAN_VPATH_FILES =\nLTLIBRARIES = $(noinst_LTLIBRARIES)\nlibwebpdsp_la_DEPENDENCIES = libwebpdsp_avx2.la libwebpdsp_sse2.la\nam__objects_1 = libwebpdsp_la-alpha_processing.lo libwebpdsp_la-cpu.lo \\\n\tlibwebpdsp_la-dec.lo libwebpdsp_la-dec_clip_tables.lo \\\n\tlibwebpdsp_la-dec_mips32.lo libwebpdsp_la-dec_neon.lo \\\n\tlibwebpdsp_la-lossless.lo libwebpdsp_la-lossless_mips32.lo \\\n\tlibwebpdsp_la-lossless_neon.lo libwebpdsp_la-upsampling.lo \\\n\tlibwebpdsp_la-upsampling_neon.lo libwebpdsp_la-yuv.lo \\\n\tlibwebpdsp_la-yuv_mips32.lo\nam__objects_2 = libwebpdsp_la-enc.lo libwebpdsp_la-enc_mips32.lo \\\n\tlibwebpdsp_la-enc_neon.lo\nam_libwebpdsp_la_OBJECTS = $(am__objects_1) $(am__objects_2)\nlibwebpdsp_la_OBJECTS = $(am_libwebpdsp_la_OBJECTS)\nAM_V_lt = $(am__v_lt_@AM_V@)\nam__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)\nam__v_lt_0 = --silent\nlibwebpdsp_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \\\n\t$(libwebpdsp_la_LDFLAGS) $(LDFLAGS) -o $@\nlibwebpdsp_avx2_la_LIBADD =\nam_libwebpdsp_avx2_la_OBJECTS = libwebpdsp_avx2_la-enc_avx2.lo\nlibwebpdsp_avx2_la_OBJECTS = $(am_libwebpdsp_avx2_la_OBJECTS)\nlibwebpdsp_avx2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \\\n\t$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \\\n\t$(libwebpdsp_avx2_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \\\n\t$(LDFLAGS) -o $@\nlibwebpdsp_sse2_la_DEPENDENCIES = libwebpdspdecode_sse2.la\nam_libwebpdsp_sse2_la_OBJECTS = libwebpdsp_sse2_la-enc_sse2.lo\nlibwebpdsp_sse2_la_OBJECTS = $(am_libwebpdsp_sse2_la_OBJECTS)\nlibwebpdsp_sse2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \\\n\t$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \\\n\t$(libwebpdsp_sse2_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \\\n\t$(LDFLAGS) -o $@\n@BUILD_LIBWEBPDECODER_TRUE@libwebpdspdecode_la_DEPENDENCIES =  \\\n@BUILD_LIBWEBPDECODER_TRUE@\tlibwebpdspdecode_sse2.la\nam__libwebpdspdecode_la_SOURCES_DIST = alpha_processing.c cpu.c dec.c \\\n\tdec_clip_tables.c dec_mips32.c dec_neon.c dsp.h lossless.c \\\n\tlossless.h lossless_mips32.c lossless_neon.c neon.h \\\n\tupsampling.c upsampling_neon.c yuv.c yuv.h yuv_mips32.c\nam__objects_3 = libwebpdspdecode_la-alpha_processing.lo \\\n\tlibwebpdspdecode_la-cpu.lo libwebpdspdecode_la-dec.lo \\\n\tlibwebpdspdecode_la-dec_clip_tables.lo \\\n\tlibwebpdspdecode_la-dec_mips32.lo \\\n\tlibwebpdspdecode_la-dec_neon.lo \\\n\tlibwebpdspdecode_la-lossless.lo \\\n\tlibwebpdspdecode_la-lossless_mips32.lo \\\n\tlibwebpdspdecode_la-lossless_neon.lo \\\n\tlibwebpdspdecode_la-upsampling.lo \\\n\tlibwebpdspdecode_la-upsampling_neon.lo \\\n\tlibwebpdspdecode_la-yuv.lo libwebpdspdecode_la-yuv_mips32.lo\n@BUILD_LIBWEBPDECODER_TRUE@am_libwebpdspdecode_la_OBJECTS =  \\\n@BUILD_LIBWEBPDECODER_TRUE@\t$(am__objects_3)\nlibwebpdspdecode_la_OBJECTS = $(am_libwebpdspdecode_la_OBJECTS)\nlibwebpdspdecode_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \\\n\t$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \\\n\t$(AM_CFLAGS) $(CFLAGS) $(libwebpdspdecode_la_LDFLAGS) \\\n\t$(LDFLAGS) -o $@\n@BUILD_LIBWEBPDECODER_TRUE@am_libwebpdspdecode_la_rpath =\nlibwebpdspdecode_sse2_la_LIBADD =\nam_libwebpdspdecode_sse2_la_OBJECTS =  \\\n\tlibwebpdspdecode_sse2_la-alpha_processing_sse2.lo \\\n\tlibwebpdspdecode_sse2_la-dec_sse2.lo \\\n\tlibwebpdspdecode_sse2_la-lossless_sse2.lo \\\n\tlibwebpdspdecode_sse2_la-upsampling_sse2.lo \\\n\tlibwebpdspdecode_sse2_la-yuv_sse2.lo\nlibwebpdspdecode_sse2_la_OBJECTS =  \\\n\t$(am_libwebpdspdecode_sse2_la_OBJECTS)\nlibwebpdspdecode_sse2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \\\n\t$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \\\n\t$(libwebpdspdecode_sse2_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \\\n\t$(LDFLAGS) -o $@\nDEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/webp\ndepcomp = $(SHELL) $(top_srcdir)/depcomp\nam__depfiles_maybe = depfiles\nam__mv = mv -f\nCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\nLTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \\\n\t$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \\\n\t$(AM_CFLAGS) $(CFLAGS)\nAM_V_CC = $(am__v_CC_@AM_V@)\nam__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)\nam__v_CC_0 = @echo \"  CC    \" $@;\nAM_V_at = $(am__v_at_@AM_V@)\nam__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\nam__v_at_0 = @\nCCLD = $(CC)\nLINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \\\n\t$(AM_LDFLAGS) $(LDFLAGS) -o $@\nAM_V_CCLD = $(am__v_CCLD_@AM_V@)\nam__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)\nam__v_CCLD_0 = @echo \"  CCLD  \" $@;\nAM_V_GEN = $(am__v_GEN_@AM_V@)\nam__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\nam__v_GEN_0 = @echo \"  GEN   \" $@;\nSOURCES = $(libwebpdsp_la_SOURCES) $(libwebpdsp_avx2_la_SOURCES) \\\n\t$(libwebpdsp_sse2_la_SOURCES) $(libwebpdspdecode_la_SOURCES) \\\n\t$(libwebpdspdecode_sse2_la_SOURCES)\nDIST_SOURCES = $(libwebpdsp_la_SOURCES) $(libwebpdsp_avx2_la_SOURCES) \\\n\t$(libwebpdsp_sse2_la_SOURCES) \\\n\t$(am__libwebpdspdecode_la_SOURCES_DIST) \\\n\t$(libwebpdspdecode_sse2_la_SOURCES)\nam__vpath_adj_setup = srcdirstrip=`echo \"$(srcdir)\" | sed 's|.|.|g'`;\nam__vpath_adj = case $$p in \\\n    $(srcdir)/*) f=`echo \"$$p\" | sed \"s|^$$srcdirstrip/||\"`;; \\\n    *) f=$$p;; \\\n  esac;\nam__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;\nam__install_max = 40\nam__nobase_strip_setup = \\\n  srcdirstrip=`echo \"$(srcdir)\" | sed 's/[].[^$$\\\\*|]/\\\\\\\\&/g'`\nam__nobase_strip = \\\n  for p in $$list; do echo \"$$p\"; done | sed -e \"s|$$srcdirstrip/||\"\nam__nobase_list = $(am__nobase_strip_setup); \\\n  for p in $$list; do echo \"$$p $$p\"; done | \\\n  sed \"s| $$srcdirstrip/| |;\"' / .*\\//!s/ .*/ ./; s,\\( .*\\)/[^/]*$$,\\1,' | \\\n  $(AWK) 'BEGIN { files[\".\"] = \"\" } { files[$$2] = files[$$2] \" \" $$1; \\\n    if (++n[$$2] == $(am__install_max)) \\\n      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = \"\" } } \\\n    END { for (dir in files) print dir, files[dir] }'\nam__base_list = \\\n  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\\n/ /g' | \\\n  sed '$$!N;$$!N;$$!N;$$!N;s/\\n/ /g'\nam__uninstall_files_from_dir = { \\\n  test -z \"$$files\" \\\n    || { test ! -d \"$$dir\" && test ! -f \"$$dir\" && test ! -r \"$$dir\"; } \\\n    || { echo \" ( cd '$$dir' && rm -f\" $$files \")\"; \\\n         $(am__cd) \"$$dir\" && rm -f $$files; }; \\\n  }\nam__installdirs = \"$(DESTDIR)$(commondir)\"\nHEADERS = $(common_HEADERS) $(noinst_HEADERS)\nETAGS = etags\nCTAGS = ctags\nDISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)\nACLOCAL = @ACLOCAL@\nAMTAR = @AMTAR@\nAM_CFLAGS = @AM_CFLAGS@\nAM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAVX2_FLAGS = @AVX2_FLAGS@\nAWK = @AWK@\nCC = @CC@\nCCDEPMODE = @CCDEPMODE@\nCFLAGS = @CFLAGS@\nCPP = @CPP@\nCPPFLAGS = @CPPFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEFS = @DEFS@\nDEPDIR = @DEPDIR@\nDLLTOOL = @DLLTOOL@\nDSYMUTIL = @DSYMUTIL@\nDUMPBIN = @DUMPBIN@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEGREP = @EGREP@\nEXEEXT = @EXEEXT@\nFGREP = @FGREP@\nGIF_INCLUDES = @GIF_INCLUDES@\nGIF_LIBS = @GIF_LIBS@\nGL_INCLUDES = @GL_INCLUDES@\nGL_LIBS = @GL_LIBS@\nGREP = @GREP@\nINSTALL = @INSTALL@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nJPEG_INCLUDES = @JPEG_INCLUDES@\nJPEG_LIBS = @JPEG_LIBS@\nLD = @LD@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBPNG_CONFIG = @LIBPNG_CONFIG@\nLIBS = @LIBS@\nLIBTOOL = @LIBTOOL@\nLIPO = @LIPO@\nLN_S = @LN_S@\nLTLIBOBJS = @LTLIBOBJS@\nMAKEINFO = @MAKEINFO@\nMANIFEST_TOOL = @MANIFEST_TOOL@\nMKDIR_P = @MKDIR_P@\nNM = @NM@\nNMEDIT = @NMEDIT@\nOBJDUMP = @OBJDUMP@\nOBJEXT = @OBJEXT@\nOTOOL = @OTOOL@\nOTOOL64 = @OTOOL64@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_URL = @PACKAGE_URL@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nPNG_INCLUDES = @PNG_INCLUDES@\nPNG_LIBS = @PNG_LIBS@\nPTHREAD_CC = @PTHREAD_CC@\nPTHREAD_CFLAGS = @PTHREAD_CFLAGS@\nPTHREAD_LIBS = @PTHREAD_LIBS@\nRANLIB = @RANLIB@\nSED = @SED@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSSE2_FLAGS = @SSE2_FLAGS@\nSTRIP = @STRIP@\nTIFF_INCLUDES = @TIFF_INCLUDES@\nTIFF_LIBS = @TIFF_LIBS@\nUSE_EXPERIMENTAL_CODE = @USE_EXPERIMENTAL_CODE@\nUSE_SWAP_16BIT_CSP = @USE_SWAP_16BIT_CSP@\nVERSION = @VERSION@\nabs_builddir = @abs_builddir@\nabs_srcdir = @abs_srcdir@\nabs_top_builddir = @abs_top_builddir@\nabs_top_srcdir = @abs_top_srcdir@\nac_ct_AR = @ac_ct_AR@\nac_ct_CC = @ac_ct_CC@\nac_ct_DUMPBIN = @ac_ct_DUMPBIN@\nam__include = @am__include@\nam__leading_dot = @am__leading_dot@\nam__quote = @am__quote@\nam__tar = @am__tar@\nam__untar = @am__untar@\nax_pthread_config = @ax_pthread_config@\nbindir = @bindir@\nbuild = @build@\nbuild_alias = @build_alias@\nbuild_cpu = @build_cpu@\nbuild_os = @build_os@\nbuild_vendor = @build_vendor@\nbuilddir = @builddir@\ndatadir = @datadir@\ndatarootdir = @datarootdir@\ndocdir = @docdir@\ndvidir = @dvidir@\nexec_prefix = @exec_prefix@\nhost = @host@\nhost_alias = @host_alias@\nhost_cpu = @host_cpu@\nhost_os = @host_os@\nhost_vendor = @host_vendor@\nhtmldir = @htmldir@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocaledir = @localedir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\npdfdir = @pdfdir@\npkgconfigdir = @pkgconfigdir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\npsdir = @psdir@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsrcdir = @srcdir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\ntop_build_prefix = @top_build_prefix@\ntop_builddir = @top_builddir@\ntop_srcdir = @top_srcdir@\nnoinst_LTLIBRARIES = libwebpdsp.la libwebpdsp_avx2.la \\\n\tlibwebpdsp_sse2.la libwebpdspdecode_sse2.la $(am__append_1)\ncommon_HEADERS = ../webp/types.h\ncommondir = $(includedir)/webp\nCOMMON_SOURCES = alpha_processing.c cpu.c dec.c dec_clip_tables.c \\\n\tdec_mips32.c dec_neon.c dsp.h lossless.c lossless.h \\\n\tlossless_mips32.c lossless_neon.c neon.h upsampling.c \\\n\tupsampling_neon.c yuv.c yuv.h yuv_mips32.c\nENC_SOURCES = enc.c enc_mips32.c enc_neon.c\nlibwebpdsp_avx2_la_SOURCES = enc_avx2.c\nlibwebpdsp_avx2_la_CPPFLAGS = $(libwebpdsp_la_CPPFLAGS)\nlibwebpdsp_avx2_la_CFLAGS = $(AM_CFLAGS) $(AVX2_FLAGS)\nlibwebpdspdecode_sse2_la_SOURCES = alpha_processing_sse2.c dec_sse2.c \\\n\tlossless_sse2.c upsampling_sse2.c yuv_sse2.c yuv_tables_sse2.h\nlibwebpdspdecode_sse2_la_CPPFLAGS = $(libwebpdsp_sse2_la_CPPFLAGS)\nlibwebpdspdecode_sse2_la_CFLAGS = $(libwebpdsp_sse2_la_CFLAGS)\nlibwebpdsp_sse2_la_SOURCES = enc_sse2.c\nlibwebpdsp_sse2_la_CPPFLAGS = $(libwebpdsp_la_CPPFLAGS)\nlibwebpdsp_sse2_la_CFLAGS = $(AM_CFLAGS) $(SSE2_FLAGS)\nlibwebpdsp_sse2_la_LIBADD = libwebpdspdecode_sse2.la\nlibwebpdsp_la_SOURCES = $(COMMON_SOURCES) $(ENC_SOURCES)\nnoinst_HEADERS = ../dec/decode_vp8.h ../webp/decode.h\nlibwebpdsp_la_CPPFLAGS = $(USE_EXPERIMENTAL_CODE) $(USE_SWAP_16BIT_CSP)\nlibwebpdsp_la_LDFLAGS = -lm\nlibwebpdsp_la_LIBADD = libwebpdsp_avx2.la libwebpdsp_sse2.la\n@BUILD_LIBWEBPDECODER_TRUE@libwebpdspdecode_la_SOURCES = $(COMMON_SOURCES)\n@BUILD_LIBWEBPDECODER_TRUE@libwebpdspdecode_la_CPPFLAGS = $(libwebpdsp_la_CPPFLAGS)\n@BUILD_LIBWEBPDECODER_TRUE@libwebpdspdecode_la_LDFLAGS = $(libwebpdsp_la_LDFLAGS)\n@BUILD_LIBWEBPDECODER_TRUE@libwebpdspdecode_la_LIBADD = libwebpdspdecode_sse2.la\nall: all-am\n\n.SUFFIXES:\n.SUFFIXES: .c .lo .o .obj\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \\\n\t        && { if test -f $@; then exit 0; else break; fi; }; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/dsp/Makefile'; \\\n\t$(am__cd) $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign src/dsp/Makefile\n.PRECIOUS: Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(am__aclocal_m4_deps):\n\nclean-noinstLTLIBRARIES:\n\t-test -z \"$(noinst_LTLIBRARIES)\" || rm -f $(noinst_LTLIBRARIES)\n\t@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \\\n\t  dir=\"`echo $$p | sed -e 's|/[^/]*$$||'`\"; \\\n\t  test \"$$dir\" != \"$$p\" || dir=.; \\\n\t  echo \"rm -f \\\"$${dir}/so_locations\\\"\"; \\\n\t  rm -f \"$${dir}/so_locations\"; \\\n\tdone\nlibwebpdsp.la: $(libwebpdsp_la_OBJECTS) $(libwebpdsp_la_DEPENDENCIES) $(EXTRA_libwebpdsp_la_DEPENDENCIES) \n\t$(AM_V_CCLD)$(libwebpdsp_la_LINK)  $(libwebpdsp_la_OBJECTS) $(libwebpdsp_la_LIBADD) $(LIBS)\nlibwebpdsp_avx2.la: $(libwebpdsp_avx2_la_OBJECTS) $(libwebpdsp_avx2_la_DEPENDENCIES) $(EXTRA_libwebpdsp_avx2_la_DEPENDENCIES) \n\t$(AM_V_CCLD)$(libwebpdsp_avx2_la_LINK)  $(libwebpdsp_avx2_la_OBJECTS) $(libwebpdsp_avx2_la_LIBADD) $(LIBS)\nlibwebpdsp_sse2.la: $(libwebpdsp_sse2_la_OBJECTS) $(libwebpdsp_sse2_la_DEPENDENCIES) $(EXTRA_libwebpdsp_sse2_la_DEPENDENCIES) \n\t$(AM_V_CCLD)$(libwebpdsp_sse2_la_LINK)  $(libwebpdsp_sse2_la_OBJECTS) $(libwebpdsp_sse2_la_LIBADD) $(LIBS)\nlibwebpdspdecode.la: $(libwebpdspdecode_la_OBJECTS) $(libwebpdspdecode_la_DEPENDENCIES) $(EXTRA_libwebpdspdecode_la_DEPENDENCIES) \n\t$(AM_V_CCLD)$(libwebpdspdecode_la_LINK) $(am_libwebpdspdecode_la_rpath) $(libwebpdspdecode_la_OBJECTS) $(libwebpdspdecode_la_LIBADD) $(LIBS)\nlibwebpdspdecode_sse2.la: $(libwebpdspdecode_sse2_la_OBJECTS) $(libwebpdspdecode_sse2_la_DEPENDENCIES) $(EXTRA_libwebpdspdecode_sse2_la_DEPENDENCIES) \n\t$(AM_V_CCLD)$(libwebpdspdecode_sse2_la_LINK)  $(libwebpdspdecode_sse2_la_OBJECTS) $(libwebpdspdecode_sse2_la_LIBADD) $(LIBS)\n\nmostlyclean-compile:\n\t-rm -f *.$(OBJEXT)\n\ndistclean-compile:\n\t-rm -f *.tab.c\n\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdsp_avx2_la-enc_avx2.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdsp_la-alpha_processing.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdsp_la-cpu.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdsp_la-dec.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdsp_la-dec_clip_tables.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdsp_la-dec_mips32.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdsp_la-dec_neon.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdsp_la-enc.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdsp_la-enc_mips32.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdsp_la-enc_neon.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdsp_la-lossless.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdsp_la-lossless_mips32.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdsp_la-lossless_neon.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdsp_la-upsampling.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdsp_la-upsampling_neon.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdsp_la-yuv.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdsp_la-yuv_mips32.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdsp_sse2_la-enc_sse2.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdspdecode_la-alpha_processing.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdspdecode_la-cpu.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdspdecode_la-dec.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdspdecode_la-dec_clip_tables.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdspdecode_la-dec_mips32.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdspdecode_la-dec_neon.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdspdecode_la-lossless.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdspdecode_la-lossless_mips32.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdspdecode_la-lossless_neon.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdspdecode_la-upsampling.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdspdecode_la-upsampling_neon.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdspdecode_la-yuv.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdspdecode_la-yuv_mips32.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdspdecode_sse2_la-alpha_processing_sse2.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdspdecode_sse2_la-dec_sse2.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdspdecode_sse2_la-lossless_sse2.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdspdecode_sse2_la-upsampling_sse2.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwebpdspdecode_sse2_la-yuv_sse2.Plo@am__quote@\n\n.c.o:\n@am__fastdepCC_TRUE@\t$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\\.o$$||'`;\\\n@am__fastdepCC_TRUE@\t$(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\\\n@am__fastdepCC_TRUE@\t$(am__mv) $$depbase.Tpo $$depbase.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<\n\n.c.obj:\n@am__fastdepCC_TRUE@\t$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\\.obj$$||'`;\\\n@am__fastdepCC_TRUE@\t$(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\\\n@am__fastdepCC_TRUE@\t$(am__mv) $$depbase.Tpo $$depbase.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`\n\n.c.lo:\n@am__fastdepCC_TRUE@\t$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\\.lo$$||'`;\\\n@am__fastdepCC_TRUE@\t$(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\\\n@am__fastdepCC_TRUE@\t$(am__mv) $$depbase.Tpo $$depbase.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<\n\nlibwebpdsp_la-alpha_processing.lo: alpha_processing.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdsp_la-alpha_processing.lo -MD -MP -MF $(DEPDIR)/libwebpdsp_la-alpha_processing.Tpo -c -o libwebpdsp_la-alpha_processing.lo `test -f 'alpha_processing.c' || echo '$(srcdir)/'`alpha_processing.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdsp_la-alpha_processing.Tpo $(DEPDIR)/libwebpdsp_la-alpha_processing.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='alpha_processing.c' object='libwebpdsp_la-alpha_processing.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdsp_la-alpha_processing.lo `test -f 'alpha_processing.c' || echo '$(srcdir)/'`alpha_processing.c\n\nlibwebpdsp_la-cpu.lo: cpu.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdsp_la-cpu.lo -MD -MP -MF $(DEPDIR)/libwebpdsp_la-cpu.Tpo -c -o libwebpdsp_la-cpu.lo `test -f 'cpu.c' || echo '$(srcdir)/'`cpu.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdsp_la-cpu.Tpo $(DEPDIR)/libwebpdsp_la-cpu.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='cpu.c' object='libwebpdsp_la-cpu.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdsp_la-cpu.lo `test -f 'cpu.c' || echo '$(srcdir)/'`cpu.c\n\nlibwebpdsp_la-dec.lo: dec.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdsp_la-dec.lo -MD -MP -MF $(DEPDIR)/libwebpdsp_la-dec.Tpo -c -o libwebpdsp_la-dec.lo `test -f 'dec.c' || echo '$(srcdir)/'`dec.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdsp_la-dec.Tpo $(DEPDIR)/libwebpdsp_la-dec.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='dec.c' object='libwebpdsp_la-dec.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdsp_la-dec.lo `test -f 'dec.c' || echo '$(srcdir)/'`dec.c\n\nlibwebpdsp_la-dec_clip_tables.lo: dec_clip_tables.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdsp_la-dec_clip_tables.lo -MD -MP -MF $(DEPDIR)/libwebpdsp_la-dec_clip_tables.Tpo -c -o libwebpdsp_la-dec_clip_tables.lo `test -f 'dec_clip_tables.c' || echo '$(srcdir)/'`dec_clip_tables.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdsp_la-dec_clip_tables.Tpo $(DEPDIR)/libwebpdsp_la-dec_clip_tables.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='dec_clip_tables.c' object='libwebpdsp_la-dec_clip_tables.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdsp_la-dec_clip_tables.lo `test -f 'dec_clip_tables.c' || echo '$(srcdir)/'`dec_clip_tables.c\n\nlibwebpdsp_la-dec_mips32.lo: dec_mips32.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdsp_la-dec_mips32.lo -MD -MP -MF $(DEPDIR)/libwebpdsp_la-dec_mips32.Tpo -c -o libwebpdsp_la-dec_mips32.lo `test -f 'dec_mips32.c' || echo '$(srcdir)/'`dec_mips32.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdsp_la-dec_mips32.Tpo $(DEPDIR)/libwebpdsp_la-dec_mips32.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='dec_mips32.c' object='libwebpdsp_la-dec_mips32.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdsp_la-dec_mips32.lo `test -f 'dec_mips32.c' || echo '$(srcdir)/'`dec_mips32.c\n\nlibwebpdsp_la-dec_neon.lo: dec_neon.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdsp_la-dec_neon.lo -MD -MP -MF $(DEPDIR)/libwebpdsp_la-dec_neon.Tpo -c -o libwebpdsp_la-dec_neon.lo `test -f 'dec_neon.c' || echo '$(srcdir)/'`dec_neon.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdsp_la-dec_neon.Tpo $(DEPDIR)/libwebpdsp_la-dec_neon.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='dec_neon.c' object='libwebpdsp_la-dec_neon.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdsp_la-dec_neon.lo `test -f 'dec_neon.c' || echo '$(srcdir)/'`dec_neon.c\n\nlibwebpdsp_la-lossless.lo: lossless.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdsp_la-lossless.lo -MD -MP -MF $(DEPDIR)/libwebpdsp_la-lossless.Tpo -c -o libwebpdsp_la-lossless.lo `test -f 'lossless.c' || echo '$(srcdir)/'`lossless.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdsp_la-lossless.Tpo $(DEPDIR)/libwebpdsp_la-lossless.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='lossless.c' object='libwebpdsp_la-lossless.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdsp_la-lossless.lo `test -f 'lossless.c' || echo '$(srcdir)/'`lossless.c\n\nlibwebpdsp_la-lossless_mips32.lo: lossless_mips32.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdsp_la-lossless_mips32.lo -MD -MP -MF $(DEPDIR)/libwebpdsp_la-lossless_mips32.Tpo -c -o libwebpdsp_la-lossless_mips32.lo `test -f 'lossless_mips32.c' || echo '$(srcdir)/'`lossless_mips32.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdsp_la-lossless_mips32.Tpo $(DEPDIR)/libwebpdsp_la-lossless_mips32.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='lossless_mips32.c' object='libwebpdsp_la-lossless_mips32.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdsp_la-lossless_mips32.lo `test -f 'lossless_mips32.c' || echo '$(srcdir)/'`lossless_mips32.c\n\nlibwebpdsp_la-lossless_neon.lo: lossless_neon.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdsp_la-lossless_neon.lo -MD -MP -MF $(DEPDIR)/libwebpdsp_la-lossless_neon.Tpo -c -o libwebpdsp_la-lossless_neon.lo `test -f 'lossless_neon.c' || echo '$(srcdir)/'`lossless_neon.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdsp_la-lossless_neon.Tpo $(DEPDIR)/libwebpdsp_la-lossless_neon.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='lossless_neon.c' object='libwebpdsp_la-lossless_neon.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdsp_la-lossless_neon.lo `test -f 'lossless_neon.c' || echo '$(srcdir)/'`lossless_neon.c\n\nlibwebpdsp_la-upsampling.lo: upsampling.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdsp_la-upsampling.lo -MD -MP -MF $(DEPDIR)/libwebpdsp_la-upsampling.Tpo -c -o libwebpdsp_la-upsampling.lo `test -f 'upsampling.c' || echo '$(srcdir)/'`upsampling.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdsp_la-upsampling.Tpo $(DEPDIR)/libwebpdsp_la-upsampling.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='upsampling.c' object='libwebpdsp_la-upsampling.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdsp_la-upsampling.lo `test -f 'upsampling.c' || echo '$(srcdir)/'`upsampling.c\n\nlibwebpdsp_la-upsampling_neon.lo: upsampling_neon.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdsp_la-upsampling_neon.lo -MD -MP -MF $(DEPDIR)/libwebpdsp_la-upsampling_neon.Tpo -c -o libwebpdsp_la-upsampling_neon.lo `test -f 'upsampling_neon.c' || echo '$(srcdir)/'`upsampling_neon.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdsp_la-upsampling_neon.Tpo $(DEPDIR)/libwebpdsp_la-upsampling_neon.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='upsampling_neon.c' object='libwebpdsp_la-upsampling_neon.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdsp_la-upsampling_neon.lo `test -f 'upsampling_neon.c' || echo '$(srcdir)/'`upsampling_neon.c\n\nlibwebpdsp_la-yuv.lo: yuv.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdsp_la-yuv.lo -MD -MP -MF $(DEPDIR)/libwebpdsp_la-yuv.Tpo -c -o libwebpdsp_la-yuv.lo `test -f 'yuv.c' || echo '$(srcdir)/'`yuv.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdsp_la-yuv.Tpo $(DEPDIR)/libwebpdsp_la-yuv.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='yuv.c' object='libwebpdsp_la-yuv.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdsp_la-yuv.lo `test -f 'yuv.c' || echo '$(srcdir)/'`yuv.c\n\nlibwebpdsp_la-yuv_mips32.lo: yuv_mips32.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdsp_la-yuv_mips32.lo -MD -MP -MF $(DEPDIR)/libwebpdsp_la-yuv_mips32.Tpo -c -o libwebpdsp_la-yuv_mips32.lo `test -f 'yuv_mips32.c' || echo '$(srcdir)/'`yuv_mips32.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdsp_la-yuv_mips32.Tpo $(DEPDIR)/libwebpdsp_la-yuv_mips32.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='yuv_mips32.c' object='libwebpdsp_la-yuv_mips32.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdsp_la-yuv_mips32.lo `test -f 'yuv_mips32.c' || echo '$(srcdir)/'`yuv_mips32.c\n\nlibwebpdsp_la-enc.lo: enc.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdsp_la-enc.lo -MD -MP -MF $(DEPDIR)/libwebpdsp_la-enc.Tpo -c -o libwebpdsp_la-enc.lo `test -f 'enc.c' || echo '$(srcdir)/'`enc.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdsp_la-enc.Tpo $(DEPDIR)/libwebpdsp_la-enc.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='enc.c' object='libwebpdsp_la-enc.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdsp_la-enc.lo `test -f 'enc.c' || echo '$(srcdir)/'`enc.c\n\nlibwebpdsp_la-enc_mips32.lo: enc_mips32.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdsp_la-enc_mips32.lo -MD -MP -MF $(DEPDIR)/libwebpdsp_la-enc_mips32.Tpo -c -o libwebpdsp_la-enc_mips32.lo `test -f 'enc_mips32.c' || echo '$(srcdir)/'`enc_mips32.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdsp_la-enc_mips32.Tpo $(DEPDIR)/libwebpdsp_la-enc_mips32.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='enc_mips32.c' object='libwebpdsp_la-enc_mips32.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdsp_la-enc_mips32.lo `test -f 'enc_mips32.c' || echo '$(srcdir)/'`enc_mips32.c\n\nlibwebpdsp_la-enc_neon.lo: enc_neon.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdsp_la-enc_neon.lo -MD -MP -MF $(DEPDIR)/libwebpdsp_la-enc_neon.Tpo -c -o libwebpdsp_la-enc_neon.lo `test -f 'enc_neon.c' || echo '$(srcdir)/'`enc_neon.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdsp_la-enc_neon.Tpo $(DEPDIR)/libwebpdsp_la-enc_neon.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='enc_neon.c' object='libwebpdsp_la-enc_neon.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdsp_la-enc_neon.lo `test -f 'enc_neon.c' || echo '$(srcdir)/'`enc_neon.c\n\nlibwebpdsp_avx2_la-enc_avx2.lo: enc_avx2.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_avx2_la_CPPFLAGS) $(CPPFLAGS) $(libwebpdsp_avx2_la_CFLAGS) $(CFLAGS) -MT libwebpdsp_avx2_la-enc_avx2.lo -MD -MP -MF $(DEPDIR)/libwebpdsp_avx2_la-enc_avx2.Tpo -c -o libwebpdsp_avx2_la-enc_avx2.lo `test -f 'enc_avx2.c' || echo '$(srcdir)/'`enc_avx2.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdsp_avx2_la-enc_avx2.Tpo $(DEPDIR)/libwebpdsp_avx2_la-enc_avx2.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='enc_avx2.c' object='libwebpdsp_avx2_la-enc_avx2.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_avx2_la_CPPFLAGS) $(CPPFLAGS) $(libwebpdsp_avx2_la_CFLAGS) $(CFLAGS) -c -o libwebpdsp_avx2_la-enc_avx2.lo `test -f 'enc_avx2.c' || echo '$(srcdir)/'`enc_avx2.c\n\nlibwebpdsp_sse2_la-enc_sse2.lo: enc_sse2.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_sse2_la_CPPFLAGS) $(CPPFLAGS) $(libwebpdsp_sse2_la_CFLAGS) $(CFLAGS) -MT libwebpdsp_sse2_la-enc_sse2.lo -MD -MP -MF $(DEPDIR)/libwebpdsp_sse2_la-enc_sse2.Tpo -c -o libwebpdsp_sse2_la-enc_sse2.lo `test -f 'enc_sse2.c' || echo '$(srcdir)/'`enc_sse2.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdsp_sse2_la-enc_sse2.Tpo $(DEPDIR)/libwebpdsp_sse2_la-enc_sse2.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='enc_sse2.c' object='libwebpdsp_sse2_la-enc_sse2.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdsp_sse2_la_CPPFLAGS) $(CPPFLAGS) $(libwebpdsp_sse2_la_CFLAGS) $(CFLAGS) -c -o libwebpdsp_sse2_la-enc_sse2.lo `test -f 'enc_sse2.c' || echo '$(srcdir)/'`enc_sse2.c\n\nlibwebpdspdecode_la-alpha_processing.lo: alpha_processing.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdspdecode_la-alpha_processing.lo -MD -MP -MF $(DEPDIR)/libwebpdspdecode_la-alpha_processing.Tpo -c -o libwebpdspdecode_la-alpha_processing.lo `test -f 'alpha_processing.c' || echo '$(srcdir)/'`alpha_processing.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdspdecode_la-alpha_processing.Tpo $(DEPDIR)/libwebpdspdecode_la-alpha_processing.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='alpha_processing.c' object='libwebpdspdecode_la-alpha_processing.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdspdecode_la-alpha_processing.lo `test -f 'alpha_processing.c' || echo '$(srcdir)/'`alpha_processing.c\n\nlibwebpdspdecode_la-cpu.lo: cpu.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdspdecode_la-cpu.lo -MD -MP -MF $(DEPDIR)/libwebpdspdecode_la-cpu.Tpo -c -o libwebpdspdecode_la-cpu.lo `test -f 'cpu.c' || echo '$(srcdir)/'`cpu.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdspdecode_la-cpu.Tpo $(DEPDIR)/libwebpdspdecode_la-cpu.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='cpu.c' object='libwebpdspdecode_la-cpu.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdspdecode_la-cpu.lo `test -f 'cpu.c' || echo '$(srcdir)/'`cpu.c\n\nlibwebpdspdecode_la-dec.lo: dec.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdspdecode_la-dec.lo -MD -MP -MF $(DEPDIR)/libwebpdspdecode_la-dec.Tpo -c -o libwebpdspdecode_la-dec.lo `test -f 'dec.c' || echo '$(srcdir)/'`dec.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdspdecode_la-dec.Tpo $(DEPDIR)/libwebpdspdecode_la-dec.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='dec.c' object='libwebpdspdecode_la-dec.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdspdecode_la-dec.lo `test -f 'dec.c' || echo '$(srcdir)/'`dec.c\n\nlibwebpdspdecode_la-dec_clip_tables.lo: dec_clip_tables.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdspdecode_la-dec_clip_tables.lo -MD -MP -MF $(DEPDIR)/libwebpdspdecode_la-dec_clip_tables.Tpo -c -o libwebpdspdecode_la-dec_clip_tables.lo `test -f 'dec_clip_tables.c' || echo '$(srcdir)/'`dec_clip_tables.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdspdecode_la-dec_clip_tables.Tpo $(DEPDIR)/libwebpdspdecode_la-dec_clip_tables.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='dec_clip_tables.c' object='libwebpdspdecode_la-dec_clip_tables.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdspdecode_la-dec_clip_tables.lo `test -f 'dec_clip_tables.c' || echo '$(srcdir)/'`dec_clip_tables.c\n\nlibwebpdspdecode_la-dec_mips32.lo: dec_mips32.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdspdecode_la-dec_mips32.lo -MD -MP -MF $(DEPDIR)/libwebpdspdecode_la-dec_mips32.Tpo -c -o libwebpdspdecode_la-dec_mips32.lo `test -f 'dec_mips32.c' || echo '$(srcdir)/'`dec_mips32.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdspdecode_la-dec_mips32.Tpo $(DEPDIR)/libwebpdspdecode_la-dec_mips32.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='dec_mips32.c' object='libwebpdspdecode_la-dec_mips32.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdspdecode_la-dec_mips32.lo `test -f 'dec_mips32.c' || echo '$(srcdir)/'`dec_mips32.c\n\nlibwebpdspdecode_la-dec_neon.lo: dec_neon.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdspdecode_la-dec_neon.lo -MD -MP -MF $(DEPDIR)/libwebpdspdecode_la-dec_neon.Tpo -c -o libwebpdspdecode_la-dec_neon.lo `test -f 'dec_neon.c' || echo '$(srcdir)/'`dec_neon.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdspdecode_la-dec_neon.Tpo $(DEPDIR)/libwebpdspdecode_la-dec_neon.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='dec_neon.c' object='libwebpdspdecode_la-dec_neon.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdspdecode_la-dec_neon.lo `test -f 'dec_neon.c' || echo '$(srcdir)/'`dec_neon.c\n\nlibwebpdspdecode_la-lossless.lo: lossless.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdspdecode_la-lossless.lo -MD -MP -MF $(DEPDIR)/libwebpdspdecode_la-lossless.Tpo -c -o libwebpdspdecode_la-lossless.lo `test -f 'lossless.c' || echo '$(srcdir)/'`lossless.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdspdecode_la-lossless.Tpo $(DEPDIR)/libwebpdspdecode_la-lossless.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='lossless.c' object='libwebpdspdecode_la-lossless.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdspdecode_la-lossless.lo `test -f 'lossless.c' || echo '$(srcdir)/'`lossless.c\n\nlibwebpdspdecode_la-lossless_mips32.lo: lossless_mips32.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdspdecode_la-lossless_mips32.lo -MD -MP -MF $(DEPDIR)/libwebpdspdecode_la-lossless_mips32.Tpo -c -o libwebpdspdecode_la-lossless_mips32.lo `test -f 'lossless_mips32.c' || echo '$(srcdir)/'`lossless_mips32.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdspdecode_la-lossless_mips32.Tpo $(DEPDIR)/libwebpdspdecode_la-lossless_mips32.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='lossless_mips32.c' object='libwebpdspdecode_la-lossless_mips32.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdspdecode_la-lossless_mips32.lo `test -f 'lossless_mips32.c' || echo '$(srcdir)/'`lossless_mips32.c\n\nlibwebpdspdecode_la-lossless_neon.lo: lossless_neon.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdspdecode_la-lossless_neon.lo -MD -MP -MF $(DEPDIR)/libwebpdspdecode_la-lossless_neon.Tpo -c -o libwebpdspdecode_la-lossless_neon.lo `test -f 'lossless_neon.c' || echo '$(srcdir)/'`lossless_neon.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdspdecode_la-lossless_neon.Tpo $(DEPDIR)/libwebpdspdecode_la-lossless_neon.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='lossless_neon.c' object='libwebpdspdecode_la-lossless_neon.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdspdecode_la-lossless_neon.lo `test -f 'lossless_neon.c' || echo '$(srcdir)/'`lossless_neon.c\n\nlibwebpdspdecode_la-upsampling.lo: upsampling.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdspdecode_la-upsampling.lo -MD -MP -MF $(DEPDIR)/libwebpdspdecode_la-upsampling.Tpo -c -o libwebpdspdecode_la-upsampling.lo `test -f 'upsampling.c' || echo '$(srcdir)/'`upsampling.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdspdecode_la-upsampling.Tpo $(DEPDIR)/libwebpdspdecode_la-upsampling.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='upsampling.c' object='libwebpdspdecode_la-upsampling.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdspdecode_la-upsampling.lo `test -f 'upsampling.c' || echo '$(srcdir)/'`upsampling.c\n\nlibwebpdspdecode_la-upsampling_neon.lo: upsampling_neon.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdspdecode_la-upsampling_neon.lo -MD -MP -MF $(DEPDIR)/libwebpdspdecode_la-upsampling_neon.Tpo -c -o libwebpdspdecode_la-upsampling_neon.lo `test -f 'upsampling_neon.c' || echo '$(srcdir)/'`upsampling_neon.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdspdecode_la-upsampling_neon.Tpo $(DEPDIR)/libwebpdspdecode_la-upsampling_neon.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='upsampling_neon.c' object='libwebpdspdecode_la-upsampling_neon.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdspdecode_la-upsampling_neon.lo `test -f 'upsampling_neon.c' || echo '$(srcdir)/'`upsampling_neon.c\n\nlibwebpdspdecode_la-yuv.lo: yuv.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdspdecode_la-yuv.lo -MD -MP -MF $(DEPDIR)/libwebpdspdecode_la-yuv.Tpo -c -o libwebpdspdecode_la-yuv.lo `test -f 'yuv.c' || echo '$(srcdir)/'`yuv.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdspdecode_la-yuv.Tpo $(DEPDIR)/libwebpdspdecode_la-yuv.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='yuv.c' object='libwebpdspdecode_la-yuv.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdspdecode_la-yuv.lo `test -f 'yuv.c' || echo '$(srcdir)/'`yuv.c\n\nlibwebpdspdecode_la-yuv_mips32.lo: yuv_mips32.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libwebpdspdecode_la-yuv_mips32.lo -MD -MP -MF $(DEPDIR)/libwebpdspdecode_la-yuv_mips32.Tpo -c -o libwebpdspdecode_la-yuv_mips32.lo `test -f 'yuv_mips32.c' || echo '$(srcdir)/'`yuv_mips32.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdspdecode_la-yuv_mips32.Tpo $(DEPDIR)/libwebpdspdecode_la-yuv_mips32.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='yuv_mips32.c' object='libwebpdspdecode_la-yuv_mips32.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libwebpdspdecode_la-yuv_mips32.lo `test -f 'yuv_mips32.c' || echo '$(srcdir)/'`yuv_mips32.c\n\nlibwebpdspdecode_sse2_la-alpha_processing_sse2.lo: alpha_processing_sse2.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_sse2_la_CPPFLAGS) $(CPPFLAGS) $(libwebpdspdecode_sse2_la_CFLAGS) $(CFLAGS) -MT libwebpdspdecode_sse2_la-alpha_processing_sse2.lo -MD -MP -MF $(DEPDIR)/libwebpdspdecode_sse2_la-alpha_processing_sse2.Tpo -c -o libwebpdspdecode_sse2_la-alpha_processing_sse2.lo `test -f 'alpha_processing_sse2.c' || echo '$(srcdir)/'`alpha_processing_sse2.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdspdecode_sse2_la-alpha_processing_sse2.Tpo $(DEPDIR)/libwebpdspdecode_sse2_la-alpha_processing_sse2.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='alpha_processing_sse2.c' object='libwebpdspdecode_sse2_la-alpha_processing_sse2.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_sse2_la_CPPFLAGS) $(CPPFLAGS) $(libwebpdspdecode_sse2_la_CFLAGS) $(CFLAGS) -c -o libwebpdspdecode_sse2_la-alpha_processing_sse2.lo `test -f 'alpha_processing_sse2.c' || echo '$(srcdir)/'`alpha_processing_sse2.c\n\nlibwebpdspdecode_sse2_la-dec_sse2.lo: dec_sse2.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_sse2_la_CPPFLAGS) $(CPPFLAGS) $(libwebpdspdecode_sse2_la_CFLAGS) $(CFLAGS) -MT libwebpdspdecode_sse2_la-dec_sse2.lo -MD -MP -MF $(DEPDIR)/libwebpdspdecode_sse2_la-dec_sse2.Tpo -c -o libwebpdspdecode_sse2_la-dec_sse2.lo `test -f 'dec_sse2.c' || echo '$(srcdir)/'`dec_sse2.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdspdecode_sse2_la-dec_sse2.Tpo $(DEPDIR)/libwebpdspdecode_sse2_la-dec_sse2.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='dec_sse2.c' object='libwebpdspdecode_sse2_la-dec_sse2.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_sse2_la_CPPFLAGS) $(CPPFLAGS) $(libwebpdspdecode_sse2_la_CFLAGS) $(CFLAGS) -c -o libwebpdspdecode_sse2_la-dec_sse2.lo `test -f 'dec_sse2.c' || echo '$(srcdir)/'`dec_sse2.c\n\nlibwebpdspdecode_sse2_la-lossless_sse2.lo: lossless_sse2.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_sse2_la_CPPFLAGS) $(CPPFLAGS) $(libwebpdspdecode_sse2_la_CFLAGS) $(CFLAGS) -MT libwebpdspdecode_sse2_la-lossless_sse2.lo -MD -MP -MF $(DEPDIR)/libwebpdspdecode_sse2_la-lossless_sse2.Tpo -c -o libwebpdspdecode_sse2_la-lossless_sse2.lo `test -f 'lossless_sse2.c' || echo '$(srcdir)/'`lossless_sse2.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdspdecode_sse2_la-lossless_sse2.Tpo $(DEPDIR)/libwebpdspdecode_sse2_la-lossless_sse2.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='lossless_sse2.c' object='libwebpdspdecode_sse2_la-lossless_sse2.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_sse2_la_CPPFLAGS) $(CPPFLAGS) $(libwebpdspdecode_sse2_la_CFLAGS) $(CFLAGS) -c -o libwebpdspdecode_sse2_la-lossless_sse2.lo `test -f 'lossless_sse2.c' || echo '$(srcdir)/'`lossless_sse2.c\n\nlibwebpdspdecode_sse2_la-upsampling_sse2.lo: upsampling_sse2.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_sse2_la_CPPFLAGS) $(CPPFLAGS) $(libwebpdspdecode_sse2_la_CFLAGS) $(CFLAGS) -MT libwebpdspdecode_sse2_la-upsampling_sse2.lo -MD -MP -MF $(DEPDIR)/libwebpdspdecode_sse2_la-upsampling_sse2.Tpo -c -o libwebpdspdecode_sse2_la-upsampling_sse2.lo `test -f 'upsampling_sse2.c' || echo '$(srcdir)/'`upsampling_sse2.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdspdecode_sse2_la-upsampling_sse2.Tpo $(DEPDIR)/libwebpdspdecode_sse2_la-upsampling_sse2.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='upsampling_sse2.c' object='libwebpdspdecode_sse2_la-upsampling_sse2.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_sse2_la_CPPFLAGS) $(CPPFLAGS) $(libwebpdspdecode_sse2_la_CFLAGS) $(CFLAGS) -c -o libwebpdspdecode_sse2_la-upsampling_sse2.lo `test -f 'upsampling_sse2.c' || echo '$(srcdir)/'`upsampling_sse2.c\n\nlibwebpdspdecode_sse2_la-yuv_sse2.lo: yuv_sse2.c\n@am__fastdepCC_TRUE@\t$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_sse2_la_CPPFLAGS) $(CPPFLAGS) $(libwebpdspdecode_sse2_la_CFLAGS) $(CFLAGS) -MT libwebpdspdecode_sse2_la-yuv_sse2.lo -MD -MP -MF $(DEPDIR)/libwebpdspdecode_sse2_la-yuv_sse2.Tpo -c -o libwebpdspdecode_sse2_la-yuv_sse2.lo `test -f 'yuv_sse2.c' || echo '$(srcdir)/'`yuv_sse2.c\n@am__fastdepCC_TRUE@\t$(AM_V_at)$(am__mv) $(DEPDIR)/libwebpdspdecode_sse2_la-yuv_sse2.Tpo $(DEPDIR)/libwebpdspdecode_sse2_la-yuv_sse2.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='yuv_sse2.c' object='libwebpdspdecode_sse2_la-yuv_sse2.lo' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwebpdspdecode_sse2_la_CPPFLAGS) $(CPPFLAGS) $(libwebpdspdecode_sse2_la_CFLAGS) $(CFLAGS) -c -o libwebpdspdecode_sse2_la-yuv_sse2.lo `test -f 'yuv_sse2.c' || echo '$(srcdir)/'`yuv_sse2.c\n\nmostlyclean-libtool:\n\t-rm -f *.lo\n\nclean-libtool:\n\t-rm -rf .libs _libs\ninstall-commonHEADERS: $(common_HEADERS)\n\t@$(NORMAL_INSTALL)\n\ttest -z \"$(commondir)\" || $(MKDIR_P) \"$(DESTDIR)$(commondir)\"\n\t@list='$(common_HEADERS)'; test -n \"$(commondir)\" || list=; \\\n\tfor p in $$list; do \\\n\t  if test -f \"$$p\"; then d=; else d=\"$(srcdir)/\"; fi; \\\n\t  echo \"$$d$$p\"; \\\n\tdone | $(am__base_list) | \\\n\twhile read files; do \\\n\t  echo \" $(INSTALL_HEADER) $$files '$(DESTDIR)$(commondir)'\"; \\\n\t  $(INSTALL_HEADER) $$files \"$(DESTDIR)$(commondir)\" || exit $$?; \\\n\tdone\n\nuninstall-commonHEADERS:\n\t@$(NORMAL_UNINSTALL)\n\t@list='$(common_HEADERS)'; test -n \"$(commondir)\" || list=; \\\n\tfiles=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \\\n\tdir='$(DESTDIR)$(commondir)'; $(am__uninstall_files_from_dir)\n\nID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)\n\tlist='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \\\n\tunique=`for i in $$list; do \\\n\t    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n\t  done | \\\n\t  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \\\n\t      END { if (nonempty) { for (i in files) print i; }; }'`; \\\n\tmkid -fID $$unique\ntags: TAGS\n\nTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \\\n\t\t$(TAGS_FILES) $(LISP)\n\tset x; \\\n\there=`pwd`; \\\n\tlist='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \\\n\tunique=`for i in $$list; do \\\n\t    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n\t  done | \\\n\t  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \\\n\t      END { if (nonempty) { for (i in files) print i; }; }'`; \\\n\tshift; \\\n\tif test -z \"$(ETAGS_ARGS)$$*$$unique\"; then :; else \\\n\t  test -n \"$$unique\" || unique=$$empty_fix; \\\n\t  if test $$# -gt 0; then \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      \"$$@\" $$unique; \\\n\t  else \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      $$unique; \\\n\t  fi; \\\n\tfi\nctags: CTAGS\nCTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \\\n\t\t$(TAGS_FILES) $(LISP)\n\tlist='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \\\n\tunique=`for i in $$list; do \\\n\t    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n\t  done | \\\n\t  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \\\n\t      END { if (nonempty) { for (i in files) print i; }; }'`; \\\n\ttest -z \"$(CTAGS_ARGS)$$unique\" \\\n\t  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \\\n\t     $$unique\n\nGTAGS:\n\there=`$(am__cd) $(top_builddir) && pwd` \\\n\t  && $(am__cd) $(top_srcdir) \\\n\t  && gtags -i $(GTAGS_ARGS) \"$$here\"\n\ndistclean-tags:\n\t-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags\n\ndistdir: $(DISTFILES)\n\t@srcdirstrip=`echo \"$(srcdir)\" | sed 's/[].[^$$\\\\*]/\\\\\\\\&/g'`; \\\n\ttopsrcdirstrip=`echo \"$(top_srcdir)\" | sed 's/[].[^$$\\\\*]/\\\\\\\\&/g'`; \\\n\tlist='$(DISTFILES)'; \\\n\t  dist_files=`for file in $$list; do echo $$file; done | \\\n\t  sed -e \"s|^$$srcdirstrip/||;t\" \\\n\t      -e \"s|^$$topsrcdirstrip/|$(top_builddir)/|;t\"`; \\\n\tcase $$dist_files in \\\n\t  */*) $(MKDIR_P) `echo \"$$dist_files\" | \\\n\t\t\t   sed '/\\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \\\n\t\t\t   sort -u` ;; \\\n\tesac; \\\n\tfor file in $$dist_files; do \\\n\t  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \\\n\t  if test -d $$d/$$file; then \\\n\t    dir=`echo \"/$$file\" | sed -e 's,/[^/]*$$,,'`; \\\n\t    if test -d \"$(distdir)/$$file\"; then \\\n\t      find \"$(distdir)/$$file\" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n\t    fi; \\\n\t    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \\\n\t      cp -fpR $(srcdir)/$$file \"$(distdir)$$dir\" || exit 1; \\\n\t      find \"$(distdir)/$$file\" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n\t    fi; \\\n\t    cp -fpR $$d/$$file \"$(distdir)$$dir\" || exit 1; \\\n\t  else \\\n\t    test -f \"$(distdir)/$$file\" \\\n\t    || cp -p $$d/$$file \"$(distdir)/$$file\" \\\n\t    || exit 1; \\\n\t  fi; \\\n\tdone\ncheck-am: all-am\ncheck: check-am\nall-am: Makefile $(LTLIBRARIES) $(HEADERS)\ninstalldirs:\n\tfor dir in \"$(DESTDIR)$(commondir)\"; do \\\n\t  test -z \"$$dir\" || $(MKDIR_P) \"$$dir\"; \\\n\tdone\ninstall: install-am\ninstall-exec: install-exec-am\ninstall-data: install-data-am\nuninstall: uninstall-am\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-am\ninstall-strip:\n\tif test -z '$(STRIP)'; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t      install; \\\n\telse \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t    \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\" install; \\\n\tfi\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\t-test . = \"$(srcdir)\" || test -z \"$(CONFIG_CLEAN_VPATH_FILES)\" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\nclean: clean-am\n\nclean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \\\n\tmostlyclean-am\n\ndistclean: distclean-am\n\t-rm -rf ./$(DEPDIR)\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-compile distclean-generic \\\n\tdistclean-tags\n\ndvi: dvi-am\n\ndvi-am:\n\nhtml: html-am\n\nhtml-am:\n\ninfo: info-am\n\ninfo-am:\n\ninstall-data-am: install-commonHEADERS\n\ninstall-dvi: install-dvi-am\n\ninstall-dvi-am:\n\ninstall-exec-am:\n\ninstall-html: install-html-am\n\ninstall-html-am:\n\ninstall-info: install-info-am\n\ninstall-info-am:\n\ninstall-man:\n\ninstall-pdf: install-pdf-am\n\ninstall-pdf-am:\n\ninstall-ps: install-ps-am\n\ninstall-ps-am:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-am\n\t-rm -rf ./$(DEPDIR)\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-am\n\nmostlyclean-am: mostlyclean-compile mostlyclean-generic \\\n\tmostlyclean-libtool\n\npdf: pdf-am\n\npdf-am:\n\nps: ps-am\n\nps-am:\n\nuninstall-am: uninstall-commonHEADERS\n\n.MAKE: install-am install-strip\n\n.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \\\n\tclean-libtool clean-noinstLTLIBRARIES ctags distclean \\\n\tdistclean-compile distclean-generic distclean-libtool \\\n\tdistclean-tags distdir dvi dvi-am html html-am info info-am \\\n\tinstall install-am install-commonHEADERS install-data \\\n\tinstall-data-am install-dvi install-dvi-am install-exec \\\n\tinstall-exec-am install-html install-html-am install-info \\\n\tinstall-info-am install-man install-pdf install-pdf-am \\\n\tinstall-ps install-ps-am install-strip installcheck \\\n\tinstallcheck-am installdirs maintainer-clean \\\n\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n\tmostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \\\n\ttags uninstall uninstall-am uninstall-commonHEADERS\n\n\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "ext/libwebp/dsp/alpha_processing.c",
    "content": "// Copyright 2013 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Utilities for processing transparent channel.\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include <assert.h>\n#include \"./dsp.h\"\n\n// Tables can be faster on some platform but incur some extra binary size (~2k).\n// #define USE_TABLES_FOR_ALPHA_MULT\n\n// -----------------------------------------------------------------------------\n\n#define MFIX 24    // 24bit fixed-point arithmetic\n#define HALF ((1u << MFIX) >> 1)\n#define KINV_255 ((1u << MFIX) / 255u)\n\nstatic uint32_t Mult(uint8_t x, uint32_t mult) {\n  const uint32_t v = (x * mult + HALF) >> MFIX;\n  assert(v <= 255);  // <- 24bit precision is enough to ensure that.\n  return v;\n}\n\n#ifdef USE_TABLES_FOR_ALPHA_MULT\n\nstatic const uint32_t kMultTables[2][256] = {\n  {    // (255u << MFIX) / alpha\n    0x00000000, 0xff000000, 0x7f800000, 0x55000000, 0x3fc00000, 0x33000000,\n    0x2a800000, 0x246db6db, 0x1fe00000, 0x1c555555, 0x19800000, 0x172e8ba2,\n    0x15400000, 0x139d89d8, 0x1236db6d, 0x11000000, 0x0ff00000, 0x0f000000,\n    0x0e2aaaaa, 0x0d6bca1a, 0x0cc00000, 0x0c249249, 0x0b9745d1, 0x0b1642c8,\n    0x0aa00000, 0x0a333333, 0x09cec4ec, 0x0971c71c, 0x091b6db6, 0x08cb08d3,\n    0x08800000, 0x0839ce73, 0x07f80000, 0x07ba2e8b, 0x07800000, 0x07492492,\n    0x07155555, 0x06e45306, 0x06b5e50d, 0x0689d89d, 0x06600000, 0x063831f3,\n    0x06124924, 0x05ee23b8, 0x05cba2e8, 0x05aaaaaa, 0x058b2164, 0x056cefa8,\n    0x05500000, 0x05343eb1, 0x05199999, 0x05000000, 0x04e76276, 0x04cfb2b7,\n    0x04b8e38e, 0x04a2e8ba, 0x048db6db, 0x0479435e, 0x04658469, 0x045270d0,\n    0x04400000, 0x042e29f7, 0x041ce739, 0x040c30c3, 0x03fc0000, 0x03ec4ec4,\n    0x03dd1745, 0x03ce540f, 0x03c00000, 0x03b21642, 0x03a49249, 0x03976fc6,\n    0x038aaaaa, 0x037e3f1f, 0x03722983, 0x03666666, 0x035af286, 0x034fcace,\n    0x0344ec4e, 0x033a5440, 0x03300000, 0x0325ed09, 0x031c18f9, 0x0312818a,\n    0x03092492, 0x03000000, 0x02f711dc, 0x02ee5846, 0x02e5d174, 0x02dd7baf,\n    0x02d55555, 0x02cd5cd5, 0x02c590b2, 0x02bdef7b, 0x02b677d4, 0x02af286b,\n    0x02a80000, 0x02a0fd5c, 0x029a1f58, 0x029364d9, 0x028ccccc, 0x0286562d,\n    0x02800000, 0x0279c952, 0x0273b13b, 0x026db6db, 0x0267d95b, 0x026217ec,\n    0x025c71c7, 0x0256e62a, 0x0251745d, 0x024c1bac, 0x0246db6d, 0x0241b2f9,\n    0x023ca1af, 0x0237a6f4, 0x0232c234, 0x022df2df, 0x02293868, 0x02249249,\n    0x02200000, 0x021b810e, 0x021714fb, 0x0212bb51, 0x020e739c, 0x020a3d70,\n    0x02061861, 0x02020408, 0x01fe0000, 0x01fa0be8, 0x01f62762, 0x01f25213,\n    0x01ee8ba2, 0x01ead3ba, 0x01e72a07, 0x01e38e38, 0x01e00000, 0x01dc7f10,\n    0x01d90b21, 0x01d5a3e9, 0x01d24924, 0x01cefa8d, 0x01cbb7e3, 0x01c880e5,\n    0x01c55555, 0x01c234f7, 0x01bf1f8f, 0x01bc14e5, 0x01b914c1, 0x01b61eed,\n    0x01b33333, 0x01b05160, 0x01ad7943, 0x01aaaaaa, 0x01a7e567, 0x01a5294a,\n    0x01a27627, 0x019fcbd2, 0x019d2a20, 0x019a90e7, 0x01980000, 0x01957741,\n    0x0192f684, 0x01907da4, 0x018e0c7c, 0x018ba2e8, 0x018940c5, 0x0186e5f0,\n    0x01849249, 0x018245ae, 0x01800000, 0x017dc11f, 0x017b88ee, 0x0179574e,\n    0x01772c23, 0x01750750, 0x0172e8ba, 0x0170d045, 0x016ebdd7, 0x016cb157,\n    0x016aaaaa, 0x0168a9b9, 0x0166ae6a, 0x0164b8a7, 0x0162c859, 0x0160dd67,\n    0x015ef7bd, 0x015d1745, 0x015b3bea, 0x01596596, 0x01579435, 0x0155c7b4,\n    0x01540000, 0x01523d03, 0x01507eae, 0x014ec4ec, 0x014d0fac, 0x014b5edc,\n    0x0149b26c, 0x01480a4a, 0x01466666, 0x0144c6af, 0x01432b16, 0x0141938b,\n    0x01400000, 0x013e7063, 0x013ce4a9, 0x013b5cc0, 0x0139d89d, 0x01385830,\n    0x0136db6d, 0x01356246, 0x0133ecad, 0x01327a97, 0x01310bf6, 0x012fa0be,\n    0x012e38e3, 0x012cd459, 0x012b7315, 0x012a150a, 0x0128ba2e, 0x01276276,\n    0x01260dd6, 0x0124bc44, 0x01236db6, 0x01222222, 0x0120d97c, 0x011f93bc,\n    0x011e50d7, 0x011d10c4, 0x011bd37a, 0x011a98ef, 0x0119611a, 0x01182bf2,\n    0x0116f96f, 0x0115c988, 0x01149c34, 0x0113716a, 0x01124924, 0x01112358,\n    0x01100000, 0x010edf12, 0x010dc087, 0x010ca458, 0x010b8a7d, 0x010a72f0,\n    0x01095da8, 0x01084a9f, 0x010739ce, 0x01062b2e, 0x01051eb8, 0x01041465,\n    0x01030c30, 0x01020612, 0x01010204, 0x01000000 },\n  {   // alpha * KINV_255\n    0x00000000, 0x00010101, 0x00020202, 0x00030303, 0x00040404, 0x00050505,\n    0x00060606, 0x00070707, 0x00080808, 0x00090909, 0x000a0a0a, 0x000b0b0b,\n    0x000c0c0c, 0x000d0d0d, 0x000e0e0e, 0x000f0f0f, 0x00101010, 0x00111111,\n    0x00121212, 0x00131313, 0x00141414, 0x00151515, 0x00161616, 0x00171717,\n    0x00181818, 0x00191919, 0x001a1a1a, 0x001b1b1b, 0x001c1c1c, 0x001d1d1d,\n    0x001e1e1e, 0x001f1f1f, 0x00202020, 0x00212121, 0x00222222, 0x00232323,\n    0x00242424, 0x00252525, 0x00262626, 0x00272727, 0x00282828, 0x00292929,\n    0x002a2a2a, 0x002b2b2b, 0x002c2c2c, 0x002d2d2d, 0x002e2e2e, 0x002f2f2f,\n    0x00303030, 0x00313131, 0x00323232, 0x00333333, 0x00343434, 0x00353535,\n    0x00363636, 0x00373737, 0x00383838, 0x00393939, 0x003a3a3a, 0x003b3b3b,\n    0x003c3c3c, 0x003d3d3d, 0x003e3e3e, 0x003f3f3f, 0x00404040, 0x00414141,\n    0x00424242, 0x00434343, 0x00444444, 0x00454545, 0x00464646, 0x00474747,\n    0x00484848, 0x00494949, 0x004a4a4a, 0x004b4b4b, 0x004c4c4c, 0x004d4d4d,\n    0x004e4e4e, 0x004f4f4f, 0x00505050, 0x00515151, 0x00525252, 0x00535353,\n    0x00545454, 0x00555555, 0x00565656, 0x00575757, 0x00585858, 0x00595959,\n    0x005a5a5a, 0x005b5b5b, 0x005c5c5c, 0x005d5d5d, 0x005e5e5e, 0x005f5f5f,\n    0x00606060, 0x00616161, 0x00626262, 0x00636363, 0x00646464, 0x00656565,\n    0x00666666, 0x00676767, 0x00686868, 0x00696969, 0x006a6a6a, 0x006b6b6b,\n    0x006c6c6c, 0x006d6d6d, 0x006e6e6e, 0x006f6f6f, 0x00707070, 0x00717171,\n    0x00727272, 0x00737373, 0x00747474, 0x00757575, 0x00767676, 0x00777777,\n    0x00787878, 0x00797979, 0x007a7a7a, 0x007b7b7b, 0x007c7c7c, 0x007d7d7d,\n    0x007e7e7e, 0x007f7f7f, 0x00808080, 0x00818181, 0x00828282, 0x00838383,\n    0x00848484, 0x00858585, 0x00868686, 0x00878787, 0x00888888, 0x00898989,\n    0x008a8a8a, 0x008b8b8b, 0x008c8c8c, 0x008d8d8d, 0x008e8e8e, 0x008f8f8f,\n    0x00909090, 0x00919191, 0x00929292, 0x00939393, 0x00949494, 0x00959595,\n    0x00969696, 0x00979797, 0x00989898, 0x00999999, 0x009a9a9a, 0x009b9b9b,\n    0x009c9c9c, 0x009d9d9d, 0x009e9e9e, 0x009f9f9f, 0x00a0a0a0, 0x00a1a1a1,\n    0x00a2a2a2, 0x00a3a3a3, 0x00a4a4a4, 0x00a5a5a5, 0x00a6a6a6, 0x00a7a7a7,\n    0x00a8a8a8, 0x00a9a9a9, 0x00aaaaaa, 0x00ababab, 0x00acacac, 0x00adadad,\n    0x00aeaeae, 0x00afafaf, 0x00b0b0b0, 0x00b1b1b1, 0x00b2b2b2, 0x00b3b3b3,\n    0x00b4b4b4, 0x00b5b5b5, 0x00b6b6b6, 0x00b7b7b7, 0x00b8b8b8, 0x00b9b9b9,\n    0x00bababa, 0x00bbbbbb, 0x00bcbcbc, 0x00bdbdbd, 0x00bebebe, 0x00bfbfbf,\n    0x00c0c0c0, 0x00c1c1c1, 0x00c2c2c2, 0x00c3c3c3, 0x00c4c4c4, 0x00c5c5c5,\n    0x00c6c6c6, 0x00c7c7c7, 0x00c8c8c8, 0x00c9c9c9, 0x00cacaca, 0x00cbcbcb,\n    0x00cccccc, 0x00cdcdcd, 0x00cecece, 0x00cfcfcf, 0x00d0d0d0, 0x00d1d1d1,\n    0x00d2d2d2, 0x00d3d3d3, 0x00d4d4d4, 0x00d5d5d5, 0x00d6d6d6, 0x00d7d7d7,\n    0x00d8d8d8, 0x00d9d9d9, 0x00dadada, 0x00dbdbdb, 0x00dcdcdc, 0x00dddddd,\n    0x00dedede, 0x00dfdfdf, 0x00e0e0e0, 0x00e1e1e1, 0x00e2e2e2, 0x00e3e3e3,\n    0x00e4e4e4, 0x00e5e5e5, 0x00e6e6e6, 0x00e7e7e7, 0x00e8e8e8, 0x00e9e9e9,\n    0x00eaeaea, 0x00ebebeb, 0x00ececec, 0x00ededed, 0x00eeeeee, 0x00efefef,\n    0x00f0f0f0, 0x00f1f1f1, 0x00f2f2f2, 0x00f3f3f3, 0x00f4f4f4, 0x00f5f5f5,\n    0x00f6f6f6, 0x00f7f7f7, 0x00f8f8f8, 0x00f9f9f9, 0x00fafafa, 0x00fbfbfb,\n    0x00fcfcfc, 0x00fdfdfd, 0x00fefefe, 0x00ffffff }\n};\n\nstatic WEBP_INLINE uint32_t GetScale(uint32_t a, int inverse) {\n  return kMultTables[!inverse][a];\n}\n\n#else\n\nstatic WEBP_INLINE uint32_t GetScale(uint32_t a, int inverse) {\n  return inverse ? (255u << MFIX) / a : a * KINV_255;\n}\n\n#endif    // USE_TABLES_FOR_ALPHA_MULT\n\nstatic void MultARGBRow(uint32_t* const ptr, int width, int inverse) {\n  int x;\n  for (x = 0; x < width; ++x) {\n    const uint32_t argb = ptr[x];\n    if (argb < 0xff000000u) {      // alpha < 255\n      if (argb <= 0x00ffffffu) {   // alpha == 0\n        ptr[x] = 0;\n      } else {\n        const uint32_t alpha = (argb >> 24) & 0xff;\n        const uint32_t scale = GetScale(alpha, inverse);\n        uint32_t out = argb & 0xff000000u;\n        out |= Mult(argb >>  0, scale) <<  0;\n        out |= Mult(argb >>  8, scale) <<  8;\n        out |= Mult(argb >> 16, scale) << 16;\n        ptr[x] = out;\n      }\n    }\n  }\n}\n\nstatic void MultRow(uint8_t* const ptr, const uint8_t* const alpha,\n                    int width, int inverse) {\n  int x;\n  for (x = 0; x < width; ++x) {\n    const uint32_t a = alpha[x];\n    if (a != 255) {\n      if (a == 0) {\n        ptr[x] = 0;\n      } else {\n        const uint32_t scale = GetScale(a, inverse);\n        ptr[x] = Mult(ptr[x], scale);\n      }\n    }\n  }\n}\n\n#undef KINV_255\n#undef HALF\n#undef MFIX\n\nvoid (*WebPMultARGBRow)(uint32_t* const ptr, int width, int inverse);\nvoid (*WebPMultRow)(uint8_t* const ptr, const uint8_t* const alpha,\n                    int width, int inverse);\n\n//------------------------------------------------------------------------------\n// Generic per-plane calls\n\nvoid WebPMultARGBRows(uint8_t* ptr, int stride, int width, int num_rows,\n                      int inverse) {\n  int n;\n  for (n = 0; n < num_rows; ++n) {\n    WebPMultARGBRow((uint32_t*)ptr, width, inverse);\n    ptr += stride;\n  }\n}\n\nvoid WebPMultRows(uint8_t* ptr, int stride,\n                  const uint8_t* alpha, int alpha_stride,\n                  int width, int num_rows, int inverse) {\n  int n;\n  for (n = 0; n < num_rows; ++n) {\n    WebPMultRow(ptr, alpha, width, inverse);\n    ptr += stride;\n    alpha += alpha_stride;\n  }\n}\n\n//------------------------------------------------------------------------------\n// Premultiplied modes\n\n// non dithered-modes\n\n// (x * a * 32897) >> 23 is bit-wise equivalent to (int)(x * a / 255.)\n// for all 8bit x or a. For bit-wise equivalence to (int)(x * a / 255. + .5),\n// one can use instead: (x * a * 65793 + (1 << 23)) >> 24\n#if 1     // (int)(x * a / 255.)\n#define MULTIPLIER(a)   ((a) * 32897U)\n#define PREMULTIPLY(x, m) (((x) * (m)) >> 23)\n#else     // (int)(x * a / 255. + .5)\n#define MULTIPLIER(a) ((a) * 65793U)\n#define PREMULTIPLY(x, m) (((x) * (m) + (1U << 23)) >> 24)\n#endif\n\nstatic void ApplyAlphaMultiply(uint8_t* rgba, int alpha_first,\n                               int w, int h, int stride) {\n  while (h-- > 0) {\n    uint8_t* const rgb = rgba + (alpha_first ? 1 : 0);\n    const uint8_t* const alpha = rgba + (alpha_first ? 0 : 3);\n    int i;\n    for (i = 0; i < w; ++i) {\n      const uint32_t a = alpha[4 * i];\n      if (a != 0xff) {\n        const uint32_t mult = MULTIPLIER(a);\n        rgb[4 * i + 0] = PREMULTIPLY(rgb[4 * i + 0], mult);\n        rgb[4 * i + 1] = PREMULTIPLY(rgb[4 * i + 1], mult);\n        rgb[4 * i + 2] = PREMULTIPLY(rgb[4 * i + 2], mult);\n      }\n    }\n    rgba += stride;\n  }\n}\n#undef MULTIPLIER\n#undef PREMULTIPLY\n\n// rgbA4444\n\n#define MULTIPLIER(a)  ((a) * 0x1111)    // 0x1111 ~= (1 << 16) / 15\n\nstatic WEBP_INLINE uint8_t dither_hi(uint8_t x) {\n  return (x & 0xf0) | (x >> 4);\n}\n\nstatic WEBP_INLINE uint8_t dither_lo(uint8_t x) {\n  return (x & 0x0f) | (x << 4);\n}\n\nstatic WEBP_INLINE uint8_t multiply(uint8_t x, uint32_t m) {\n  return (x * m) >> 16;\n}\n\nstatic WEBP_INLINE void ApplyAlphaMultiply4444(uint8_t* rgba4444,\n                                               int w, int h, int stride,\n                                               int rg_byte_pos /* 0 or 1 */) {\n  while (h-- > 0) {\n    int i;\n    for (i = 0; i < w; ++i) {\n      const uint32_t rg = rgba4444[2 * i + rg_byte_pos];\n      const uint32_t ba = rgba4444[2 * i + (rg_byte_pos ^ 1)];\n      const uint8_t a = ba & 0x0f;\n      const uint32_t mult = MULTIPLIER(a);\n      const uint8_t r = multiply(dither_hi(rg), mult);\n      const uint8_t g = multiply(dither_lo(rg), mult);\n      const uint8_t b = multiply(dither_hi(ba), mult);\n      rgba4444[2 * i + rg_byte_pos] = (r & 0xf0) | ((g >> 4) & 0x0f);\n      rgba4444[2 * i + (rg_byte_pos ^ 1)] = (b & 0xf0) | a;\n    }\n    rgba4444 += stride;\n  }\n}\n#undef MULTIPLIER\n\nstatic void ApplyAlphaMultiply_16b(uint8_t* rgba4444,\n                                   int w, int h, int stride) {\n#ifdef WEBP_SWAP_16BIT_CSP\n  ApplyAlphaMultiply4444(rgba4444, w, h, stride, 1);\n#else\n  ApplyAlphaMultiply4444(rgba4444, w, h, stride, 0);\n#endif\n}\n\nstatic int ExtractAlpha(const uint8_t* argb, int argb_stride,\n                        int width, int height,\n                        uint8_t* alpha, int alpha_stride) {\n  uint8_t alpha_mask = 0xff;\n  int i, j;\n\n  for (j = 0; j < height; ++j) {\n    for (i = 0; i < width; ++i) {\n      const uint8_t alpha_value = argb[4 * i];\n      alpha[i] = alpha_value;\n      alpha_mask &= alpha_value;\n    }\n    argb += argb_stride;\n    alpha += alpha_stride;\n  }\n  return (alpha_mask == 0xff);\n}\n\nvoid (*WebPApplyAlphaMultiply)(uint8_t*, int, int, int, int);\nvoid (*WebPApplyAlphaMultiply4444)(uint8_t*, int, int, int);\nint (*WebPExtractAlpha)(const uint8_t*, int, int, int, uint8_t*, int);\n\n//------------------------------------------------------------------------------\n// Init function\n\nextern void WebPInitAlphaProcessingSSE2(void);\n\nvoid WebPInitAlphaProcessing(void) {\n  WebPMultARGBRow = MultARGBRow;\n  WebPMultRow = MultRow;\n  WebPApplyAlphaMultiply = ApplyAlphaMultiply;\n  WebPApplyAlphaMultiply4444 = ApplyAlphaMultiply_16b;\n  WebPExtractAlpha = ExtractAlpha;\n\n  // If defined, use CPUInfo() to overwrite some pointers with faster versions.\n  if (VP8GetCPUInfo != NULL) {\n#if defined(WEBP_USE_SSE2)\n    if (VP8GetCPUInfo(kSSE2)) {\n      WebPInitAlphaProcessingSSE2();\n    }\n#endif\n  }\n}\n"
  },
  {
    "path": "ext/libwebp/dsp/alpha_processing_sse2.c",
    "content": "// Copyright 2014 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Utilities for processing transparent channel.\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include \"./dsp.h\"\n\n#if defined(WEBP_USE_SSE2)\n#include <emmintrin.h>\n\n//------------------------------------------------------------------------------\n\nstatic int ExtractAlpha(const uint8_t* argb, int argb_stride,\n                        int width, int height,\n                        uint8_t* alpha, int alpha_stride) {\n  // alpha_and stores an 'and' operation of all the alpha[] values. The final\n  // value is not 0xff if any of the alpha[] is not equal to 0xff.\n  uint32_t alpha_and = 0xff;\n  int i, j;\n  const __m128i a_mask = _mm_set1_epi32(0xffu);  // to preserve alpha\n  const __m128i all_0xff = _mm_set_epi32(0, 0, ~0u, ~0u);\n  __m128i all_alphas = all_0xff;\n\n  // We must be able to access 3 extra bytes after the last written byte\n  // 'src[4 * width - 4]', because we don't know if alpha is the first or the\n  // last byte of the quadruplet.\n  const int limit = (width - 1) & ~7;\n\n  for (j = 0; j < height; ++j) {\n    const __m128i* src = (const __m128i*)argb;\n    for (i = 0; i < limit; i += 8) {\n      // load 32 argb bytes\n      const __m128i a0 = _mm_loadu_si128(src + 0);\n      const __m128i a1 = _mm_loadu_si128(src + 1);\n      const __m128i b0 = _mm_and_si128(a0, a_mask);\n      const __m128i b1 = _mm_and_si128(a1, a_mask);\n      const __m128i c0 = _mm_packs_epi32(b0, b1);\n      const __m128i d0 = _mm_packus_epi16(c0, c0);\n      // store\n      _mm_storel_epi64((__m128i*)&alpha[i], d0);\n      // accumulate eight alpha 'and' in parallel\n      all_alphas = _mm_and_si128(all_alphas, d0);\n      src += 2;\n    }\n    for (; i < width; ++i) {\n      const uint32_t alpha_value = argb[4 * i];\n      alpha[i] = alpha_value;\n      alpha_and &= alpha_value;\n    }\n    argb += argb_stride;\n    alpha += alpha_stride;\n  }\n  // Combine the eight alpha 'and' into a 8-bit mask.\n  alpha_and &= _mm_movemask_epi8(_mm_cmpeq_epi8(all_alphas, all_0xff));\n  return (alpha_and == 0xff);\n}\n\n#endif   // WEBP_USE_SSE2\n\n//------------------------------------------------------------------------------\n// Init function\n\nextern void WebPInitAlphaProcessingSSE2(void);\n\nvoid WebPInitAlphaProcessingSSE2(void) {\n#if defined(WEBP_USE_SSE2)\n  WebPExtractAlpha = ExtractAlpha;\n#endif\n}\n"
  },
  {
    "path": "ext/libwebp/dsp/cpu.c",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// CPU detection\n//\n// Author: Christian Duvivier (cduvivier@google.com)\n\n#include \"./dsp.h\"\n\n#if defined(__ANDROID__)\n#include <cpu-features.h>\n#endif\n\n//------------------------------------------------------------------------------\n// SSE2 detection.\n//\n\n// apple/darwin gcc-4.0.1 defines __PIC__, but not __pic__ with -fPIC.\n#if (defined(__pic__) || defined(__PIC__)) && defined(__i386__)\nstatic WEBP_INLINE void GetCPUInfo(int cpu_info[4], int info_type) {\n  __asm__ volatile (\n    \"mov %%ebx, %%edi\\n\"\n    \"cpuid\\n\"\n    \"xchg %%edi, %%ebx\\n\"\n    : \"=a\"(cpu_info[0]), \"=D\"(cpu_info[1]), \"=c\"(cpu_info[2]), \"=d\"(cpu_info[3])\n    : \"a\"(info_type));\n}\n#elif defined(__i386__) || defined(__x86_64__)\nstatic WEBP_INLINE void GetCPUInfo(int cpu_info[4], int info_type) {\n  __asm__ volatile (\n    \"cpuid\\n\"\n    : \"=a\"(cpu_info[0]), \"=b\"(cpu_info[1]), \"=c\"(cpu_info[2]), \"=d\"(cpu_info[3])\n    : \"a\"(info_type));\n}\n#elif defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 150030729  // >= VS2008 SP1\n#define GetCPUInfo(info, type) __cpuidex(info, type, 0)  // set ecx=0\n#elif defined(WEBP_MSC_SSE2)\n#define GetCPUInfo __cpuid\n#endif\n\n// NaCl has no support for xgetbv or the raw opcode.\n#if !defined(__native_client__) && (defined(__i386__) || defined(__x86_64__))\nstatic WEBP_INLINE uint64_t xgetbv(void) {\n  const uint32_t ecx = 0;\n  uint32_t eax, edx;\n  // Use the raw opcode for xgetbv for compatibility with older toolchains.\n  __asm__ volatile (\n    \".byte 0x0f, 0x01, 0xd0\\n\"\n    : \"=a\"(eax), \"=d\"(edx) : \"c\" (ecx));\n  return ((uint64_t)edx << 32) | eax;\n}\n#elif defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 160040219  // >= VS2010 SP1\n#define xgetbv() _xgetbv(0)\n#elif defined(_MSC_VER) && defined(_M_IX86)\nstatic WEBP_INLINE uint64_t xgetbv(void) {\n  uint32_t eax_, edx_;\n  __asm {\n    xor ecx, ecx  // ecx = 0\n    // Use the raw opcode for xgetbv for compatibility with older toolchains.\n    __asm _emit 0x0f __asm _emit 0x01 __asm _emit 0xd0\n    mov eax_, eax\n    mov edx_, edx\n  }\n  return ((uint64_t)edx_ << 32) | eax_;\n}\n#else\n#define xgetbv() 0U  // no AVX for older x64 or unrecognized toolchains.\n#endif\n\n#if defined(__i386__) || defined(__x86_64__) || defined(WEBP_MSC_SSE2)\nstatic int x86CPUInfo(CPUFeature feature) {\n  int cpu_info[4];\n  GetCPUInfo(cpu_info, 1);\n  if (feature == kSSE2) {\n    return 0 != (cpu_info[3] & 0x04000000);\n  }\n  if (feature == kSSE3) {\n    return 0 != (cpu_info[2] & 0x00000001);\n  }\n  if (feature == kAVX) {\n    // bits 27 (OSXSAVE) & 28 (256-bit AVX)\n    if ((cpu_info[2] & 0x18000000) == 0x18000000) {\n      // XMM state and YMM state enabled by the OS.\n      return (xgetbv() & 0x6) == 0x6;\n    }\n  }\n  if (feature == kAVX2) {\n    if (x86CPUInfo(kAVX)) {\n      GetCPUInfo(cpu_info, 7);\n      return ((cpu_info[1] & 0x00000020) == 0x00000020);\n    }\n  }\n  return 0;\n}\nVP8CPUInfo VP8GetCPUInfo = x86CPUInfo;\n#elif defined(WEBP_ANDROID_NEON)  // NB: needs to be before generic NEON test.\nstatic int AndroidCPUInfo(CPUFeature feature) {\n  const AndroidCpuFamily cpu_family = android_getCpuFamily();\n  const uint64_t cpu_features = android_getCpuFeatures();\n  if (feature == kNEON) {\n    return (cpu_family == ANDROID_CPU_FAMILY_ARM &&\n            0 != (cpu_features & ANDROID_CPU_ARM_FEATURE_NEON));\n  }\n  return 0;\n}\nVP8CPUInfo VP8GetCPUInfo = AndroidCPUInfo;\n#elif defined(WEBP_USE_NEON)\n// define a dummy function to enable turning off NEON at runtime by setting\n// VP8DecGetCPUInfo = NULL\nstatic int armCPUInfo(CPUFeature feature) {\n  (void)feature;\n  return 1;\n}\nVP8CPUInfo VP8GetCPUInfo = armCPUInfo;\n#elif defined(WEBP_USE_MIPS32)\nstatic int mipsCPUInfo(CPUFeature feature) {\n  (void)feature;\n  return 1;\n}\nVP8CPUInfo VP8GetCPUInfo = mipsCPUInfo;\n#else\nVP8CPUInfo VP8GetCPUInfo = NULL;\n#endif\n\n"
  },
  {
    "path": "ext/libwebp/dsp/dec.c",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Speed-critical decoding functions.\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include \"./dsp.h\"\n#include \"../dec/vp8i.h\"\n\n//------------------------------------------------------------------------------\n\nstatic WEBP_INLINE uint8_t clip_8b(int v) {\n  return (!(v & ~0xff)) ? v : (v < 0) ? 0 : 255;\n}\n\n//------------------------------------------------------------------------------\n// Transforms (Paragraph 14.4)\n\n#define STORE(x, y, v) \\\n  dst[x + y * BPS] = clip_8b(dst[x + y * BPS] + ((v) >> 3))\n\n#define STORE2(y, dc, d, c) do {    \\\n  const int DC = (dc);              \\\n  STORE(0, y, DC + (d));            \\\n  STORE(1, y, DC + (c));            \\\n  STORE(2, y, DC - (c));            \\\n  STORE(3, y, DC - (d));            \\\n} while (0)\n\nstatic const int kC1 = 20091 + (1 << 16);\nstatic const int kC2 = 35468;\n#define MUL(a, b) (((a) * (b)) >> 16)\n\nstatic void TransformOne(const int16_t* in, uint8_t* dst) {\n  int C[4 * 4], *tmp;\n  int i;\n  tmp = C;\n  for (i = 0; i < 4; ++i) {    // vertical pass\n    const int a = in[0] + in[8];    // [-4096, 4094]\n    const int b = in[0] - in[8];    // [-4095, 4095]\n    const int c = MUL(in[4], kC2) - MUL(in[12], kC1);   // [-3783, 3783]\n    const int d = MUL(in[4], kC1) + MUL(in[12], kC2);   // [-3785, 3781]\n    tmp[0] = a + d;   // [-7881, 7875]\n    tmp[1] = b + c;   // [-7878, 7878]\n    tmp[2] = b - c;   // [-7878, 7878]\n    tmp[3] = a - d;   // [-7877, 7879]\n    tmp += 4;\n    in++;\n  }\n  // Each pass is expanding the dynamic range by ~3.85 (upper bound).\n  // The exact value is (2. + (kC1 + kC2) / 65536).\n  // After the second pass, maximum interval is [-3794, 3794], assuming\n  // an input in [-2048, 2047] interval. We then need to add a dst value\n  // in the [0, 255] range.\n  // In the worst case scenario, the input to clip_8b() can be as large as\n  // [-60713, 60968].\n  tmp = C;\n  for (i = 0; i < 4; ++i) {    // horizontal pass\n    const int dc = tmp[0] + 4;\n    const int a =  dc +  tmp[8];\n    const int b =  dc -  tmp[8];\n    const int c = MUL(tmp[4], kC2) - MUL(tmp[12], kC1);\n    const int d = MUL(tmp[4], kC1) + MUL(tmp[12], kC2);\n    STORE(0, 0, a + d);\n    STORE(1, 0, b + c);\n    STORE(2, 0, b - c);\n    STORE(3, 0, a - d);\n    tmp++;\n    dst += BPS;\n  }\n}\n\n// Simplified transform when only in[0], in[1] and in[4] are non-zero\nstatic void TransformAC3(const int16_t* in, uint8_t* dst) {\n  const int a = in[0] + 4;\n  const int c4 = MUL(in[4], kC2);\n  const int d4 = MUL(in[4], kC1);\n  const int c1 = MUL(in[1], kC2);\n  const int d1 = MUL(in[1], kC1);\n  STORE2(0, a + d4, d1, c1);\n  STORE2(1, a + c4, d1, c1);\n  STORE2(2, a - c4, d1, c1);\n  STORE2(3, a - d4, d1, c1);\n}\n#undef MUL\n#undef STORE2\n\nstatic void TransformTwo(const int16_t* in, uint8_t* dst, int do_two) {\n  TransformOne(in, dst);\n  if (do_two) {\n    TransformOne(in + 16, dst + 4);\n  }\n}\n\nstatic void TransformUV(const int16_t* in, uint8_t* dst) {\n  VP8Transform(in + 0 * 16, dst, 1);\n  VP8Transform(in + 2 * 16, dst + 4 * BPS, 1);\n}\n\nstatic void TransformDC(const int16_t *in, uint8_t* dst) {\n  const int DC = in[0] + 4;\n  int i, j;\n  for (j = 0; j < 4; ++j) {\n    for (i = 0; i < 4; ++i) {\n      STORE(i, j, DC);\n    }\n  }\n}\n\nstatic void TransformDCUV(const int16_t* in, uint8_t* dst) {\n  if (in[0 * 16]) VP8TransformDC(in + 0 * 16, dst);\n  if (in[1 * 16]) VP8TransformDC(in + 1 * 16, dst + 4);\n  if (in[2 * 16]) VP8TransformDC(in + 2 * 16, dst + 4 * BPS);\n  if (in[3 * 16]) VP8TransformDC(in + 3 * 16, dst + 4 * BPS + 4);\n}\n\n#undef STORE\n\n//------------------------------------------------------------------------------\n// Paragraph 14.3\n\nstatic void TransformWHT(const int16_t* in, int16_t* out) {\n  int tmp[16];\n  int i;\n  for (i = 0; i < 4; ++i) {\n    const int a0 = in[0 + i] + in[12 + i];\n    const int a1 = in[4 + i] + in[ 8 + i];\n    const int a2 = in[4 + i] - in[ 8 + i];\n    const int a3 = in[0 + i] - in[12 + i];\n    tmp[0  + i] = a0 + a1;\n    tmp[8  + i] = a0 - a1;\n    tmp[4  + i] = a3 + a2;\n    tmp[12 + i] = a3 - a2;\n  }\n  for (i = 0; i < 4; ++i) {\n    const int dc = tmp[0 + i * 4] + 3;    // w/ rounder\n    const int a0 = dc             + tmp[3 + i * 4];\n    const int a1 = tmp[1 + i * 4] + tmp[2 + i * 4];\n    const int a2 = tmp[1 + i * 4] - tmp[2 + i * 4];\n    const int a3 = dc             - tmp[3 + i * 4];\n    out[ 0] = (a0 + a1) >> 3;\n    out[16] = (a3 + a2) >> 3;\n    out[32] = (a0 - a1) >> 3;\n    out[48] = (a3 - a2) >> 3;\n    out += 64;\n  }\n}\n\nvoid (*VP8TransformWHT)(const int16_t* in, int16_t* out);\n\n//------------------------------------------------------------------------------\n// Intra predictions\n\n#define DST(x, y) dst[(x) + (y) * BPS]\n\nstatic WEBP_INLINE void TrueMotion(uint8_t *dst, int size) {\n  const uint8_t* top = dst - BPS;\n  const uint8_t* const clip0 = VP8kclip1 - top[-1];\n  int y;\n  for (y = 0; y < size; ++y) {\n    const uint8_t* const clip = clip0 + dst[-1];\n    int x;\n    for (x = 0; x < size; ++x) {\n      dst[x] = clip[top[x]];\n    }\n    dst += BPS;\n  }\n}\nstatic void TM4(uint8_t *dst)   { TrueMotion(dst, 4); }\nstatic void TM8uv(uint8_t *dst) { TrueMotion(dst, 8); }\nstatic void TM16(uint8_t *dst)  { TrueMotion(dst, 16); }\n\n//------------------------------------------------------------------------------\n// 16x16\n\nstatic void VE16(uint8_t *dst) {     // vertical\n  int j;\n  for (j = 0; j < 16; ++j) {\n    memcpy(dst + j * BPS, dst - BPS, 16);\n  }\n}\n\nstatic void HE16(uint8_t *dst) {     // horizontal\n  int j;\n  for (j = 16; j > 0; --j) {\n    memset(dst, dst[-1], 16);\n    dst += BPS;\n  }\n}\n\nstatic WEBP_INLINE void Put16(int v, uint8_t* dst) {\n  int j;\n  for (j = 0; j < 16; ++j) {\n    memset(dst + j * BPS, v, 16);\n  }\n}\n\nstatic void DC16(uint8_t *dst) {    // DC\n  int DC = 16;\n  int j;\n  for (j = 0; j < 16; ++j) {\n    DC += dst[-1 + j * BPS] + dst[j - BPS];\n  }\n  Put16(DC >> 5, dst);\n}\n\nstatic void DC16NoTop(uint8_t *dst) {   // DC with top samples not available\n  int DC = 8;\n  int j;\n  for (j = 0; j < 16; ++j) {\n    DC += dst[-1 + j * BPS];\n  }\n  Put16(DC >> 4, dst);\n}\n\nstatic void DC16NoLeft(uint8_t *dst) {  // DC with left samples not available\n  int DC = 8;\n  int i;\n  for (i = 0; i < 16; ++i) {\n    DC += dst[i - BPS];\n  }\n  Put16(DC >> 4, dst);\n}\n\nstatic void DC16NoTopLeft(uint8_t *dst) {  // DC with no top and left samples\n  Put16(0x80, dst);\n}\n\n//------------------------------------------------------------------------------\n// 4x4\n\n#define AVG3(a, b, c) (((a) + 2 * (b) + (c) + 2) >> 2)\n#define AVG2(a, b) (((a) + (b) + 1) >> 1)\n\nstatic void VE4(uint8_t *dst) {    // vertical\n  const uint8_t* top = dst - BPS;\n  const uint8_t vals[4] = {\n    AVG3(top[-1], top[0], top[1]),\n    AVG3(top[ 0], top[1], top[2]),\n    AVG3(top[ 1], top[2], top[3]),\n    AVG3(top[ 2], top[3], top[4])\n  };\n  int i;\n  for (i = 0; i < 4; ++i) {\n    memcpy(dst + i * BPS, vals, sizeof(vals));\n  }\n}\n\nstatic void HE4(uint8_t *dst) {    // horizontal\n  const int A = dst[-1 - BPS];\n  const int B = dst[-1];\n  const int C = dst[-1 + BPS];\n  const int D = dst[-1 + 2 * BPS];\n  const int E = dst[-1 + 3 * BPS];\n  *(uint32_t*)(dst + 0 * BPS) = 0x01010101U * AVG3(A, B, C);\n  *(uint32_t*)(dst + 1 * BPS) = 0x01010101U * AVG3(B, C, D);\n  *(uint32_t*)(dst + 2 * BPS) = 0x01010101U * AVG3(C, D, E);\n  *(uint32_t*)(dst + 3 * BPS) = 0x01010101U * AVG3(D, E, E);\n}\n\nstatic void DC4(uint8_t *dst) {   // DC\n  uint32_t dc = 4;\n  int i;\n  for (i = 0; i < 4; ++i) dc += dst[i - BPS] + dst[-1 + i * BPS];\n  dc >>= 3;\n  for (i = 0; i < 4; ++i) memset(dst + i * BPS, dc, 4);\n}\n\nstatic void RD4(uint8_t *dst) {   // Down-right\n  const int I = dst[-1 + 0 * BPS];\n  const int J = dst[-1 + 1 * BPS];\n  const int K = dst[-1 + 2 * BPS];\n  const int L = dst[-1 + 3 * BPS];\n  const int X = dst[-1 - BPS];\n  const int A = dst[0 - BPS];\n  const int B = dst[1 - BPS];\n  const int C = dst[2 - BPS];\n  const int D = dst[3 - BPS];\n  DST(0, 3)                                     = AVG3(J, K, L);\n  DST(0, 2) = DST(1, 3)                         = AVG3(I, J, K);\n  DST(0, 1) = DST(1, 2) = DST(2, 3)             = AVG3(X, I, J);\n  DST(0, 0) = DST(1, 1) = DST(2, 2) = DST(3, 3) = AVG3(A, X, I);\n  DST(1, 0) = DST(2, 1) = DST(3, 2)             = AVG3(B, A, X);\n  DST(2, 0) = DST(3, 1)                         = AVG3(C, B, A);\n  DST(3, 0)                                     = AVG3(D, C, B);\n}\n\nstatic void LD4(uint8_t *dst) {   // Down-Left\n  const int A = dst[0 - BPS];\n  const int B = dst[1 - BPS];\n  const int C = dst[2 - BPS];\n  const int D = dst[3 - BPS];\n  const int E = dst[4 - BPS];\n  const int F = dst[5 - BPS];\n  const int G = dst[6 - BPS];\n  const int H = dst[7 - BPS];\n  DST(0, 0)                                     = AVG3(A, B, C);\n  DST(1, 0) = DST(0, 1)                         = AVG3(B, C, D);\n  DST(2, 0) = DST(1, 1) = DST(0, 2)             = AVG3(C, D, E);\n  DST(3, 0) = DST(2, 1) = DST(1, 2) = DST(0, 3) = AVG3(D, E, F);\n  DST(3, 1) = DST(2, 2) = DST(1, 3)             = AVG3(E, F, G);\n  DST(3, 2) = DST(2, 3)                         = AVG3(F, G, H);\n  DST(3, 3)                                     = AVG3(G, H, H);\n}\n\nstatic void VR4(uint8_t *dst) {   // Vertical-Right\n  const int I = dst[-1 + 0 * BPS];\n  const int J = dst[-1 + 1 * BPS];\n  const int K = dst[-1 + 2 * BPS];\n  const int X = dst[-1 - BPS];\n  const int A = dst[0 - BPS];\n  const int B = dst[1 - BPS];\n  const int C = dst[2 - BPS];\n  const int D = dst[3 - BPS];\n  DST(0, 0) = DST(1, 2) = AVG2(X, A);\n  DST(1, 0) = DST(2, 2) = AVG2(A, B);\n  DST(2, 0) = DST(3, 2) = AVG2(B, C);\n  DST(3, 0)             = AVG2(C, D);\n\n  DST(0, 3) =             AVG3(K, J, I);\n  DST(0, 2) =             AVG3(J, I, X);\n  DST(0, 1) = DST(1, 3) = AVG3(I, X, A);\n  DST(1, 1) = DST(2, 3) = AVG3(X, A, B);\n  DST(2, 1) = DST(3, 3) = AVG3(A, B, C);\n  DST(3, 1) =             AVG3(B, C, D);\n}\n\nstatic void VL4(uint8_t *dst) {   // Vertical-Left\n  const int A = dst[0 - BPS];\n  const int B = dst[1 - BPS];\n  const int C = dst[2 - BPS];\n  const int D = dst[3 - BPS];\n  const int E = dst[4 - BPS];\n  const int F = dst[5 - BPS];\n  const int G = dst[6 - BPS];\n  const int H = dst[7 - BPS];\n  DST(0, 0) =             AVG2(A, B);\n  DST(1, 0) = DST(0, 2) = AVG2(B, C);\n  DST(2, 0) = DST(1, 2) = AVG2(C, D);\n  DST(3, 0) = DST(2, 2) = AVG2(D, E);\n\n  DST(0, 1) =             AVG3(A, B, C);\n  DST(1, 1) = DST(0, 3) = AVG3(B, C, D);\n  DST(2, 1) = DST(1, 3) = AVG3(C, D, E);\n  DST(3, 1) = DST(2, 3) = AVG3(D, E, F);\n              DST(3, 2) = AVG3(E, F, G);\n              DST(3, 3) = AVG3(F, G, H);\n}\n\nstatic void HU4(uint8_t *dst) {   // Horizontal-Up\n  const int I = dst[-1 + 0 * BPS];\n  const int J = dst[-1 + 1 * BPS];\n  const int K = dst[-1 + 2 * BPS];\n  const int L = dst[-1 + 3 * BPS];\n  DST(0, 0) =             AVG2(I, J);\n  DST(2, 0) = DST(0, 1) = AVG2(J, K);\n  DST(2, 1) = DST(0, 2) = AVG2(K, L);\n  DST(1, 0) =             AVG3(I, J, K);\n  DST(3, 0) = DST(1, 1) = AVG3(J, K, L);\n  DST(3, 1) = DST(1, 2) = AVG3(K, L, L);\n  DST(3, 2) = DST(2, 2) =\n    DST(0, 3) = DST(1, 3) = DST(2, 3) = DST(3, 3) = L;\n}\n\nstatic void HD4(uint8_t *dst) {  // Horizontal-Down\n  const int I = dst[-1 + 0 * BPS];\n  const int J = dst[-1 + 1 * BPS];\n  const int K = dst[-1 + 2 * BPS];\n  const int L = dst[-1 + 3 * BPS];\n  const int X = dst[-1 - BPS];\n  const int A = dst[0 - BPS];\n  const int B = dst[1 - BPS];\n  const int C = dst[2 - BPS];\n\n  DST(0, 0) = DST(2, 1) = AVG2(I, X);\n  DST(0, 1) = DST(2, 2) = AVG2(J, I);\n  DST(0, 2) = DST(2, 3) = AVG2(K, J);\n  DST(0, 3)             = AVG2(L, K);\n\n  DST(3, 0)             = AVG3(A, B, C);\n  DST(2, 0)             = AVG3(X, A, B);\n  DST(1, 0) = DST(3, 1) = AVG3(I, X, A);\n  DST(1, 1) = DST(3, 2) = AVG3(J, I, X);\n  DST(1, 2) = DST(3, 3) = AVG3(K, J, I);\n  DST(1, 3)             = AVG3(L, K, J);\n}\n\n#undef DST\n#undef AVG3\n#undef AVG2\n\n//------------------------------------------------------------------------------\n// Chroma\n\nstatic void VE8uv(uint8_t *dst) {    // vertical\n  int j;\n  for (j = 0; j < 8; ++j) {\n    memcpy(dst + j * BPS, dst - BPS, 8);\n  }\n}\n\nstatic void HE8uv(uint8_t *dst) {    // horizontal\n  int j;\n  for (j = 0; j < 8; ++j) {\n    memset(dst, dst[-1], 8);\n    dst += BPS;\n  }\n}\n\n// helper for chroma-DC predictions\nstatic WEBP_INLINE void Put8x8uv(uint8_t value, uint8_t* dst) {\n  int j;\n  for (j = 0; j < 8; ++j) {\n    memset(dst + j * BPS, value, 8);\n  }\n}\n\nstatic void DC8uv(uint8_t *dst) {     // DC\n  int dc0 = 8;\n  int i;\n  for (i = 0; i < 8; ++i) {\n    dc0 += dst[i - BPS] + dst[-1 + i * BPS];\n  }\n  Put8x8uv(dc0 >> 4, dst);\n}\n\nstatic void DC8uvNoLeft(uint8_t *dst) {   // DC with no left samples\n  int dc0 = 4;\n  int i;\n  for (i = 0; i < 8; ++i) {\n    dc0 += dst[i - BPS];\n  }\n  Put8x8uv(dc0 >> 3, dst);\n}\n\nstatic void DC8uvNoTop(uint8_t *dst) {  // DC with no top samples\n  int dc0 = 4;\n  int i;\n  for (i = 0; i < 8; ++i) {\n    dc0 += dst[-1 + i * BPS];\n  }\n  Put8x8uv(dc0 >> 3, dst);\n}\n\nstatic void DC8uvNoTopLeft(uint8_t *dst) {    // DC with nothing\n  Put8x8uv(0x80, dst);\n}\n\n//------------------------------------------------------------------------------\n// default C implementations\n\nconst VP8PredFunc VP8PredLuma4[NUM_BMODES] = {\n  DC4, TM4, VE4, HE4, RD4, VR4, LD4, VL4, HD4, HU4\n};\n\nconst VP8PredFunc VP8PredLuma16[NUM_B_DC_MODES] = {\n  DC16, TM16, VE16, HE16,\n  DC16NoTop, DC16NoLeft, DC16NoTopLeft\n};\n\nconst VP8PredFunc VP8PredChroma8[NUM_B_DC_MODES] = {\n  DC8uv, TM8uv, VE8uv, HE8uv,\n  DC8uvNoTop, DC8uvNoLeft, DC8uvNoTopLeft\n};\n\n//------------------------------------------------------------------------------\n// Edge filtering functions\n\n// 4 pixels in, 2 pixels out\nstatic WEBP_INLINE void do_filter2(uint8_t* p, int step) {\n  const int p1 = p[-2*step], p0 = p[-step], q0 = p[0], q1 = p[step];\n  const int a = 3 * (q0 - p0) + VP8ksclip1[p1 - q1];  // in [-893,892]\n  const int a1 = VP8ksclip2[(a + 4) >> 3];            // in [-16,15]\n  const int a2 = VP8ksclip2[(a + 3) >> 3];\n  p[-step] = VP8kclip1[p0 + a2];\n  p[    0] = VP8kclip1[q0 - a1];\n}\n\n// 4 pixels in, 4 pixels out\nstatic WEBP_INLINE void do_filter4(uint8_t* p, int step) {\n  const int p1 = p[-2*step], p0 = p[-step], q0 = p[0], q1 = p[step];\n  const int a = 3 * (q0 - p0);\n  const int a1 = VP8ksclip2[(a + 4) >> 3];\n  const int a2 = VP8ksclip2[(a + 3) >> 3];\n  const int a3 = (a1 + 1) >> 1;\n  p[-2*step] = VP8kclip1[p1 + a3];\n  p[-  step] = VP8kclip1[p0 + a2];\n  p[      0] = VP8kclip1[q0 - a1];\n  p[   step] = VP8kclip1[q1 - a3];\n}\n\n// 6 pixels in, 6 pixels out\nstatic WEBP_INLINE void do_filter6(uint8_t* p, int step) {\n  const int p2 = p[-3*step], p1 = p[-2*step], p0 = p[-step];\n  const int q0 = p[0], q1 = p[step], q2 = p[2*step];\n  const int a = VP8ksclip1[3 * (q0 - p0) + VP8ksclip1[p1 - q1]];\n  // a is in [-128,127], a1 in [-27,27], a2 in [-18,18] and a3 in [-9,9]\n  const int a1 = (27 * a + 63) >> 7;  // eq. to ((3 * a + 7) * 9) >> 7\n  const int a2 = (18 * a + 63) >> 7;  // eq. to ((2 * a + 7) * 9) >> 7\n  const int a3 = (9  * a + 63) >> 7;  // eq. to ((1 * a + 7) * 9) >> 7\n  p[-3*step] = VP8kclip1[p2 + a3];\n  p[-2*step] = VP8kclip1[p1 + a2];\n  p[-  step] = VP8kclip1[p0 + a1];\n  p[      0] = VP8kclip1[q0 - a1];\n  p[   step] = VP8kclip1[q1 - a2];\n  p[ 2*step] = VP8kclip1[q2 - a3];\n}\n\nstatic WEBP_INLINE int hev(const uint8_t* p, int step, int thresh) {\n  const int p1 = p[-2*step], p0 = p[-step], q0 = p[0], q1 = p[step];\n  return (VP8kabs0[p1 - p0] > thresh) || (VP8kabs0[q1 - q0] > thresh);\n}\n\nstatic WEBP_INLINE int needs_filter(const uint8_t* p, int step, int t) {\n  const int p1 = p[-2 * step], p0 = p[-step], q0 = p[0], q1 = p[step];\n  return ((4 * VP8kabs0[p0 - q0] + VP8kabs0[p1 - q1]) <= t);\n}\n\nstatic WEBP_INLINE int needs_filter2(const uint8_t* p,\n                                     int step, int t, int it) {\n  const int p3 = p[-4 * step], p2 = p[-3 * step], p1 = p[-2 * step];\n  const int p0 = p[-step], q0 = p[0];\n  const int q1 = p[step], q2 = p[2 * step], q3 = p[3 * step];\n  if ((4 * VP8kabs0[p0 - q0] + VP8kabs0[p1 - q1]) > t) return 0;\n  return VP8kabs0[p3 - p2] <= it && VP8kabs0[p2 - p1] <= it &&\n         VP8kabs0[p1 - p0] <= it && VP8kabs0[q3 - q2] <= it &&\n         VP8kabs0[q2 - q1] <= it && VP8kabs0[q1 - q0] <= it;\n}\n\n//------------------------------------------------------------------------------\n// Simple In-loop filtering (Paragraph 15.2)\n\nstatic void SimpleVFilter16(uint8_t* p, int stride, int thresh) {\n  int i;\n  const int thresh2 = 2 * thresh + 1;\n  for (i = 0; i < 16; ++i) {\n    if (needs_filter(p + i, stride, thresh2)) {\n      do_filter2(p + i, stride);\n    }\n  }\n}\n\nstatic void SimpleHFilter16(uint8_t* p, int stride, int thresh) {\n  int i;\n  const int thresh2 = 2 * thresh + 1;\n  for (i = 0; i < 16; ++i) {\n    if (needs_filter(p + i * stride, 1, thresh2)) {\n      do_filter2(p + i * stride, 1);\n    }\n  }\n}\n\nstatic void SimpleVFilter16i(uint8_t* p, int stride, int thresh) {\n  int k;\n  for (k = 3; k > 0; --k) {\n    p += 4 * stride;\n    SimpleVFilter16(p, stride, thresh);\n  }\n}\n\nstatic void SimpleHFilter16i(uint8_t* p, int stride, int thresh) {\n  int k;\n  for (k = 3; k > 0; --k) {\n    p += 4;\n    SimpleHFilter16(p, stride, thresh);\n  }\n}\n\n//------------------------------------------------------------------------------\n// Complex In-loop filtering (Paragraph 15.3)\n\nstatic WEBP_INLINE void FilterLoop26(uint8_t* p,\n                                     int hstride, int vstride, int size,\n                                     int thresh, int ithresh, int hev_thresh) {\n  const int thresh2 = 2 * thresh + 1;\n  while (size-- > 0) {\n    if (needs_filter2(p, hstride, thresh2, ithresh)) {\n      if (hev(p, hstride, hev_thresh)) {\n        do_filter2(p, hstride);\n      } else {\n        do_filter6(p, hstride);\n      }\n    }\n    p += vstride;\n  }\n}\n\nstatic WEBP_INLINE void FilterLoop24(uint8_t* p,\n                                     int hstride, int vstride, int size,\n                                     int thresh, int ithresh, int hev_thresh) {\n  const int thresh2 = 2 * thresh + 1;\n  while (size-- > 0) {\n    if (needs_filter2(p, hstride, thresh2, ithresh)) {\n      if (hev(p, hstride, hev_thresh)) {\n        do_filter2(p, hstride);\n      } else {\n        do_filter4(p, hstride);\n      }\n    }\n    p += vstride;\n  }\n}\n\n// on macroblock edges\nstatic void VFilter16(uint8_t* p, int stride,\n                      int thresh, int ithresh, int hev_thresh) {\n  FilterLoop26(p, stride, 1, 16, thresh, ithresh, hev_thresh);\n}\n\nstatic void HFilter16(uint8_t* p, int stride,\n                      int thresh, int ithresh, int hev_thresh) {\n  FilterLoop26(p, 1, stride, 16, thresh, ithresh, hev_thresh);\n}\n\n// on three inner edges\nstatic void VFilter16i(uint8_t* p, int stride,\n                       int thresh, int ithresh, int hev_thresh) {\n  int k;\n  for (k = 3; k > 0; --k) {\n    p += 4 * stride;\n    FilterLoop24(p, stride, 1, 16, thresh, ithresh, hev_thresh);\n  }\n}\n\nstatic void HFilter16i(uint8_t* p, int stride,\n                       int thresh, int ithresh, int hev_thresh) {\n  int k;\n  for (k = 3; k > 0; --k) {\n    p += 4;\n    FilterLoop24(p, 1, stride, 16, thresh, ithresh, hev_thresh);\n  }\n}\n\n// 8-pixels wide variant, for chroma filtering\nstatic void VFilter8(uint8_t* u, uint8_t* v, int stride,\n                     int thresh, int ithresh, int hev_thresh) {\n  FilterLoop26(u, stride, 1, 8, thresh, ithresh, hev_thresh);\n  FilterLoop26(v, stride, 1, 8, thresh, ithresh, hev_thresh);\n}\n\nstatic void HFilter8(uint8_t* u, uint8_t* v, int stride,\n                     int thresh, int ithresh, int hev_thresh) {\n  FilterLoop26(u, 1, stride, 8, thresh, ithresh, hev_thresh);\n  FilterLoop26(v, 1, stride, 8, thresh, ithresh, hev_thresh);\n}\n\nstatic void VFilter8i(uint8_t* u, uint8_t* v, int stride,\n                      int thresh, int ithresh, int hev_thresh) {\n  FilterLoop24(u + 4 * stride, stride, 1, 8, thresh, ithresh, hev_thresh);\n  FilterLoop24(v + 4 * stride, stride, 1, 8, thresh, ithresh, hev_thresh);\n}\n\nstatic void HFilter8i(uint8_t* u, uint8_t* v, int stride,\n                      int thresh, int ithresh, int hev_thresh) {\n  FilterLoop24(u + 4, 1, stride, 8, thresh, ithresh, hev_thresh);\n  FilterLoop24(v + 4, 1, stride, 8, thresh, ithresh, hev_thresh);\n}\n\n//------------------------------------------------------------------------------\n\nVP8DecIdct2 VP8Transform;\nVP8DecIdct VP8TransformAC3;\nVP8DecIdct VP8TransformUV;\nVP8DecIdct VP8TransformDC;\nVP8DecIdct VP8TransformDCUV;\n\nVP8LumaFilterFunc VP8VFilter16;\nVP8LumaFilterFunc VP8HFilter16;\nVP8ChromaFilterFunc VP8VFilter8;\nVP8ChromaFilterFunc VP8HFilter8;\nVP8LumaFilterFunc VP8VFilter16i;\nVP8LumaFilterFunc VP8HFilter16i;\nVP8ChromaFilterFunc VP8VFilter8i;\nVP8ChromaFilterFunc VP8HFilter8i;\nVP8SimpleFilterFunc VP8SimpleVFilter16;\nVP8SimpleFilterFunc VP8SimpleHFilter16;\nVP8SimpleFilterFunc VP8SimpleVFilter16i;\nVP8SimpleFilterFunc VP8SimpleHFilter16i;\n\nextern void VP8DspInitSSE2(void);\nextern void VP8DspInitNEON(void);\nextern void VP8DspInitMIPS32(void);\n\nvoid VP8DspInit(void) {\n  VP8InitClipTables();\n\n  VP8TransformWHT = TransformWHT;\n  VP8Transform = TransformTwo;\n  VP8TransformUV = TransformUV;\n  VP8TransformDC = TransformDC;\n  VP8TransformDCUV = TransformDCUV;\n  VP8TransformAC3 = TransformAC3;\n\n  VP8VFilter16 = VFilter16;\n  VP8HFilter16 = HFilter16;\n  VP8VFilter8 = VFilter8;\n  VP8HFilter8 = HFilter8;\n  VP8VFilter16i = VFilter16i;\n  VP8HFilter16i = HFilter16i;\n  VP8VFilter8i = VFilter8i;\n  VP8HFilter8i = HFilter8i;\n  VP8SimpleVFilter16 = SimpleVFilter16;\n  VP8SimpleHFilter16 = SimpleHFilter16;\n  VP8SimpleVFilter16i = SimpleVFilter16i;\n  VP8SimpleHFilter16i = SimpleHFilter16i;\n\n  // If defined, use CPUInfo() to overwrite some pointers with faster versions.\n  if (VP8GetCPUInfo != NULL) {\n#if defined(WEBP_USE_SSE2)\n    if (VP8GetCPUInfo(kSSE2)) {\n      VP8DspInitSSE2();\n    }\n#elif defined(WEBP_USE_NEON)\n    if (VP8GetCPUInfo(kNEON)) {\n      VP8DspInitNEON();\n    }\n#elif defined(WEBP_USE_MIPS32)\n    if (VP8GetCPUInfo(kMIPS32)) {\n      VP8DspInitMIPS32();\n    }\n#endif\n  }\n}\n\n"
  },
  {
    "path": "ext/libwebp/dsp/dec_clip_tables.c",
    "content": "// Copyright 2014 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Clipping tables for filtering\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include \"./dsp.h\"\n\n#define USE_STATIC_TABLES     // undefine to have run-time table initialization\n\n#ifdef USE_STATIC_TABLES\n\nstatic const uint8_t abs0[255 + 255 + 1] = {\n  0xff, 0xfe, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xf8, 0xf7, 0xf6, 0xf5, 0xf4,\n  0xf3, 0xf2, 0xf1, 0xf0, 0xef, 0xee, 0xed, 0xec, 0xeb, 0xea, 0xe9, 0xe8,\n  0xe7, 0xe6, 0xe5, 0xe4, 0xe3, 0xe2, 0xe1, 0xe0, 0xdf, 0xde, 0xdd, 0xdc,\n  0xdb, 0xda, 0xd9, 0xd8, 0xd7, 0xd6, 0xd5, 0xd4, 0xd3, 0xd2, 0xd1, 0xd0,\n  0xcf, 0xce, 0xcd, 0xcc, 0xcb, 0xca, 0xc9, 0xc8, 0xc7, 0xc6, 0xc5, 0xc4,\n  0xc3, 0xc2, 0xc1, 0xc0, 0xbf, 0xbe, 0xbd, 0xbc, 0xbb, 0xba, 0xb9, 0xb8,\n  0xb7, 0xb6, 0xb5, 0xb4, 0xb3, 0xb2, 0xb1, 0xb0, 0xaf, 0xae, 0xad, 0xac,\n  0xab, 0xaa, 0xa9, 0xa8, 0xa7, 0xa6, 0xa5, 0xa4, 0xa3, 0xa2, 0xa1, 0xa0,\n  0x9f, 0x9e, 0x9d, 0x9c, 0x9b, 0x9a, 0x99, 0x98, 0x97, 0x96, 0x95, 0x94,\n  0x93, 0x92, 0x91, 0x90, 0x8f, 0x8e, 0x8d, 0x8c, 0x8b, 0x8a, 0x89, 0x88,\n  0x87, 0x86, 0x85, 0x84, 0x83, 0x82, 0x81, 0x80, 0x7f, 0x7e, 0x7d, 0x7c,\n  0x7b, 0x7a, 0x79, 0x78, 0x77, 0x76, 0x75, 0x74, 0x73, 0x72, 0x71, 0x70,\n  0x6f, 0x6e, 0x6d, 0x6c, 0x6b, 0x6a, 0x69, 0x68, 0x67, 0x66, 0x65, 0x64,\n  0x63, 0x62, 0x61, 0x60, 0x5f, 0x5e, 0x5d, 0x5c, 0x5b, 0x5a, 0x59, 0x58,\n  0x57, 0x56, 0x55, 0x54, 0x53, 0x52, 0x51, 0x50, 0x4f, 0x4e, 0x4d, 0x4c,\n  0x4b, 0x4a, 0x49, 0x48, 0x47, 0x46, 0x45, 0x44, 0x43, 0x42, 0x41, 0x40,\n  0x3f, 0x3e, 0x3d, 0x3c, 0x3b, 0x3a, 0x39, 0x38, 0x37, 0x36, 0x35, 0x34,\n  0x33, 0x32, 0x31, 0x30, 0x2f, 0x2e, 0x2d, 0x2c, 0x2b, 0x2a, 0x29, 0x28,\n  0x27, 0x26, 0x25, 0x24, 0x23, 0x22, 0x21, 0x20, 0x1f, 0x1e, 0x1d, 0x1c,\n  0x1b, 0x1a, 0x19, 0x18, 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10,\n  0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04,\n  0x03, 0x02, 0x01, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,\n  0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14,\n  0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,\n  0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c,\n  0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,\n  0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44,\n  0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50,\n  0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c,\n  0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,\n  0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74,\n  0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80,\n  0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c,\n  0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,\n  0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4,\n  0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0,\n  0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc,\n  0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8,\n  0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4,\n  0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0,\n  0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec,\n  0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,\n  0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff\n};\n\nstatic const int8_t sclip1[1020 + 1020 + 1] = {\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,\n  0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,\n  0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93,\n  0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,\n  0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab,\n  0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,\n  0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3,\n  0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,\n  0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb,\n  0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,\n  0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3,\n  0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,\n  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,\n  0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,\n  0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23,\n  0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,\n  0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,\n  0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,\n  0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53,\n  0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,\n  0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b,\n  0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,\n  0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,\n  0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f\n};\n\nstatic const int8_t sclip2[112 + 112 + 1] = {\n  0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,\n  0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,\n  0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,\n  0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,\n  0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,\n  0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,\n  0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,\n  0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0,\n  0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb,\n  0xfc, 0xfd, 0xfe, 0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,\n  0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,\n  0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,\n  0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,\n  0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,\n  0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,\n  0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,\n  0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,\n  0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,\n  0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f\n};\n\nstatic const uint8_t clip1[255 + 511 + 1] = {\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,\n  0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14,\n  0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,\n  0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c,\n  0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,\n  0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44,\n  0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50,\n  0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c,\n  0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,\n  0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74,\n  0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80,\n  0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c,\n  0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,\n  0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4,\n  0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0,\n  0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc,\n  0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8,\n  0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4,\n  0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0,\n  0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec,\n  0xed, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,\n  0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff\n};\n\n#else\n\n// uninitialized tables\nstatic uint8_t abs0[255 + 255 + 1];\nstatic int8_t sclip1[1020 + 1020 + 1];\nstatic int8_t sclip2[112 + 112 + 1];\nstatic uint8_t clip1[255 + 511 + 1];\n\n// We declare this variable 'volatile' to prevent instruction reordering\n// and make sure it's set to true _last_ (so as to be thread-safe)\nstatic volatile int tables_ok = 0;\n\n#endif\n\nconst int8_t* const VP8ksclip1 = &sclip1[1020];\nconst int8_t* const VP8ksclip2 = &sclip2[112];\nconst uint8_t* const VP8kclip1 = &clip1[255];\nconst uint8_t* const VP8kabs0 = &abs0[255];\n\nvoid VP8InitClipTables(void) {\n#if !defined(USE_STATIC_TABLES)\n  int i;\n  if (!tables_ok) {\n    for (i = -255; i <= 255; ++i) {\n      abs0[255 + i] = (i < 0) ? -i : i;\n    }\n    for (i = -1020; i <= 1020; ++i) {\n      sclip1[1020 + i] = (i < -128) ? -128 : (i > 127) ? 127 : i;\n    }\n    for (i = -112; i <= 112; ++i) {\n      sclip2[112 + i] = (i < -16) ? -16 : (i > 15) ? 15 : i;\n    }\n    for (i = -255; i <= 255 + 255; ++i) {\n      clip1[255 + i] = (i < 0) ? 0 : (i > 255) ? 255 : i;\n    }\n    tables_ok = 1;\n  }\n#endif    // USE_STATIC_TABLES\n}\n"
  },
  {
    "path": "ext/libwebp/dsp/dec_mips32.c",
    "content": "// Copyright 2014 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// MIPS version of dsp functions\n//\n// Author(s):  Djordje Pesut    (djordje.pesut@imgtec.com)\n//             Jovan Zelincevic (jovan.zelincevic@imgtec.com)\n\n#include \"./dsp.h\"\n\n#if defined(WEBP_USE_MIPS32)\n\nstatic const int kC1 = 20091 + (1 << 16);\nstatic const int kC2 = 35468;\n\nstatic WEBP_INLINE int abs_mips32(int x) {\n  const int sign = x >> 31;\n  return (x ^ sign) - sign;\n}\n\n// 4 pixels in, 2 pixels out\nstatic WEBP_INLINE void do_filter2(uint8_t* p, int step) {\n  const int p1 = p[-2 * step], p0 = p[-step], q0 = p[0], q1 = p[step];\n  const int a = 3 * (q0 - p0) + VP8ksclip1[p1 - q1];\n  const int a1 = VP8ksclip2[(a + 4) >> 3];\n  const int a2 = VP8ksclip2[(a + 3) >> 3];\n  p[-step] = VP8kclip1[p0 + a2];\n  p[    0] = VP8kclip1[q0 - a1];\n}\n\n// 4 pixels in, 4 pixels out\nstatic WEBP_INLINE void do_filter4(uint8_t* p, int step) {\n  const int p1 = p[-2 * step], p0 = p[-step], q0 = p[0], q1 = p[step];\n  const int a = 3 * (q0 - p0);\n  const int a1 = VP8ksclip2[(a + 4) >> 3];\n  const int a2 = VP8ksclip2[(a + 3) >> 3];\n  const int a3 = (a1 + 1) >> 1;\n  p[-2 * step] = VP8kclip1[p1 + a3];\n  p[-    step] = VP8kclip1[p0 + a2];\n  p[        0] = VP8kclip1[q0 - a1];\n  p[     step] = VP8kclip1[q1 - a3];\n}\n\n// 6 pixels in, 6 pixels out\nstatic WEBP_INLINE void do_filter6(uint8_t* p, int step) {\n  const int p2 = p[-3 * step], p1 = p[-2 * step], p0 = p[-step];\n  const int q0 = p[0], q1 = p[step], q2 = p[2 * step];\n  const int a = VP8ksclip1[3 * (q0 - p0) + VP8ksclip1[p1 - q1]];\n  const int a1 = (27 * a + 63) >> 7;  // eq. to ((3 * a + 7) * 9) >> 7\n  const int a2 = (18 * a + 63) >> 7;  // eq. to ((2 * a + 7) * 9) >> 7\n  const int a3 = (9  * a + 63) >> 7;  // eq. to ((1 * a + 7) * 9) >> 7\n  p[-3 * step] = VP8kclip1[p2 + a3];\n  p[-2 * step] = VP8kclip1[p1 + a2];\n  p[-    step] = VP8kclip1[p0 + a1];\n  p[        0] = VP8kclip1[q0 - a1];\n  p[     step] = VP8kclip1[q1 - a2];\n  p[ 2 * step] = VP8kclip1[q2 - a3];\n}\n\nstatic WEBP_INLINE int hev(const uint8_t* p, int step, int thresh) {\n  const int p1 = p[-2 * step], p0 = p[-step], q0 = p[0], q1 = p[step];\n  return (abs_mips32(p1 - p0) > thresh) || (abs_mips32(q1 - q0) > thresh);\n}\n\nstatic WEBP_INLINE int needs_filter(const uint8_t* p, int step, int thresh) {\n  const int p1 = p[-2 * step], p0 = p[-step], q0 = p[0], q1 = p[step];\n  return ((2 * abs_mips32(p0 - q0) + (abs_mips32(p1 - q1) >> 1)) <= thresh);\n}\n\nstatic WEBP_INLINE int needs_filter2(const uint8_t* p,\n                                     int step, int t, int it) {\n  const int p3 = p[-4 * step], p2 = p[-3 * step];\n  const int p1 = p[-2 * step], p0 = p[-step];\n  const int q0 = p[0], q1 = p[step], q2 = p[2 * step], q3 = p[3 * step];\n  if ((2 * abs_mips32(p0 - q0) + (abs_mips32(p1 - q1) >> 1)) > t) {\n    return 0;\n  }\n  return abs_mips32(p3 - p2) <= it && abs_mips32(p2 - p1) <= it &&\n         abs_mips32(p1 - p0) <= it && abs_mips32(q3 - q2) <= it &&\n         abs_mips32(q2 - q1) <= it && abs_mips32(q1 - q0) <= it;\n}\n\nstatic WEBP_INLINE void FilterLoop26(uint8_t* p,\n                                     int hstride, int vstride, int size,\n                                     int thresh, int ithresh, int hev_thresh) {\n  while (size-- > 0) {\n    if (needs_filter2(p, hstride, thresh, ithresh)) {\n      if (hev(p, hstride, hev_thresh)) {\n        do_filter2(p, hstride);\n      } else {\n        do_filter6(p, hstride);\n      }\n    }\n    p += vstride;\n  }\n}\n\nstatic WEBP_INLINE void FilterLoop24(uint8_t* p,\n                                     int hstride, int vstride, int size,\n                                     int thresh, int ithresh, int hev_thresh) {\n  while (size-- > 0) {\n    if (needs_filter2(p, hstride, thresh, ithresh)) {\n      if (hev(p, hstride, hev_thresh)) {\n        do_filter2(p, hstride);\n      } else {\n        do_filter4(p, hstride);\n      }\n    }\n    p += vstride;\n  }\n}\n\n// on macroblock edges\nstatic void VFilter16(uint8_t* p, int stride,\n                      int thresh, int ithresh, int hev_thresh) {\n  FilterLoop26(p, stride, 1, 16, thresh, ithresh, hev_thresh);\n}\n\nstatic void HFilter16(uint8_t* p, int stride,\n                      int thresh, int ithresh, int hev_thresh) {\n  FilterLoop26(p, 1, stride, 16, thresh, ithresh, hev_thresh);\n}\n\n// 8-pixels wide variant, for chroma filtering\nstatic void VFilter8(uint8_t* u, uint8_t* v, int stride,\n                     int thresh, int ithresh, int hev_thresh) {\n  FilterLoop26(u, stride, 1, 8, thresh, ithresh, hev_thresh);\n  FilterLoop26(v, stride, 1, 8, thresh, ithresh, hev_thresh);\n}\n\nstatic void HFilter8(uint8_t* u, uint8_t* v, int stride,\n                     int thresh, int ithresh, int hev_thresh) {\n  FilterLoop26(u, 1, stride, 8, thresh, ithresh, hev_thresh);\n  FilterLoop26(v, 1, stride, 8, thresh, ithresh, hev_thresh);\n}\n\nstatic void VFilter8i(uint8_t* u, uint8_t* v, int stride,\n                      int thresh, int ithresh, int hev_thresh) {\n  FilterLoop24(u + 4 * stride, stride, 1, 8, thresh, ithresh, hev_thresh);\n  FilterLoop24(v + 4 * stride, stride, 1, 8, thresh, ithresh, hev_thresh);\n}\n\nstatic void HFilter8i(uint8_t* u, uint8_t* v, int stride,\n                      int thresh, int ithresh, int hev_thresh) {\n  FilterLoop24(u + 4, 1, stride, 8, thresh, ithresh, hev_thresh);\n  FilterLoop24(v + 4, 1, stride, 8, thresh, ithresh, hev_thresh);\n}\n\n// on three inner edges\nstatic void VFilter16i(uint8_t* p, int stride,\n                       int thresh, int ithresh, int hev_thresh) {\n  int k;\n  for (k = 3; k > 0; --k) {\n    p += 4 * stride;\n    FilterLoop24(p, stride, 1, 16, thresh, ithresh, hev_thresh);\n  }\n}\n\nstatic void HFilter16i(uint8_t* p, int stride,\n                       int thresh, int ithresh, int hev_thresh) {\n  int k;\n  for (k = 3; k > 0; --k) {\n    p += 4;\n    FilterLoop24(p, 1, stride, 16, thresh, ithresh, hev_thresh);\n  }\n}\n\n//------------------------------------------------------------------------------\n// Simple In-loop filtering (Paragraph 15.2)\n\nstatic void SimpleVFilter16(uint8_t* p, int stride, int thresh) {\n  int i;\n  for (i = 0; i < 16; ++i) {\n    if (needs_filter(p + i, stride, thresh)) {\n      do_filter2(p + i, stride);\n    }\n  }\n}\n\nstatic void SimpleHFilter16(uint8_t* p, int stride, int thresh) {\n  int i;\n  for (i = 0; i < 16; ++i) {\n    if (needs_filter(p + i * stride, 1, thresh)) {\n      do_filter2(p + i * stride, 1);\n    }\n  }\n}\n\nstatic void SimpleVFilter16i(uint8_t* p, int stride, int thresh) {\n  int k;\n  for (k = 3; k > 0; --k) {\n    p += 4 * stride;\n    SimpleVFilter16(p, stride, thresh);\n  }\n}\n\nstatic void SimpleHFilter16i(uint8_t* p, int stride, int thresh) {\n  int k;\n  for (k = 3; k > 0; --k) {\n    p += 4;\n    SimpleHFilter16(p, stride, thresh);\n  }\n}\n\nstatic void TransformOne(const int16_t* in, uint8_t* dst) {\n  int temp0, temp1, temp2, temp3, temp4;\n  int temp5, temp6, temp7, temp8, temp9;\n  int temp10, temp11, temp12, temp13, temp14;\n  int temp15, temp16, temp17, temp18;\n  int16_t* p_in = (int16_t*)in;\n\n  // loops unrolled and merged to avoid usage of tmp buffer\n  // and to reduce number of stalls. MUL macro is written\n  // in assembler and inlined\n  __asm__ volatile(\n    \"lh       %[temp0],  0(%[in])                      \\n\\t\"\n    \"lh       %[temp8],  16(%[in])                     \\n\\t\"\n    \"lh       %[temp4],  8(%[in])                      \\n\\t\"\n    \"lh       %[temp12], 24(%[in])                     \\n\\t\"\n    \"addu     %[temp16], %[temp0],  %[temp8]           \\n\\t\"\n    \"subu     %[temp0],  %[temp0],  %[temp8]           \\n\\t\"\n    \"mul      %[temp8],  %[temp4],  %[kC2]             \\n\\t\"\n    \"mul      %[temp17], %[temp12], %[kC1]             \\n\\t\"\n    \"mul      %[temp4],  %[temp4],  %[kC1]             \\n\\t\"\n    \"mul      %[temp12], %[temp12], %[kC2]             \\n\\t\"\n    \"lh       %[temp1],  2(%[in])                      \\n\\t\"\n    \"lh       %[temp5],  10(%[in])                     \\n\\t\"\n    \"lh       %[temp9],  18(%[in])                     \\n\\t\"\n    \"lh       %[temp13], 26(%[in])                     \\n\\t\"\n    \"sra      %[temp8],  %[temp8],  16                 \\n\\t\"\n    \"sra      %[temp17], %[temp17], 16                 \\n\\t\"\n    \"sra      %[temp4],  %[temp4],  16                 \\n\\t\"\n    \"sra      %[temp12], %[temp12], 16                 \\n\\t\"\n    \"lh       %[temp2],  4(%[in])                      \\n\\t\"\n    \"lh       %[temp6],  12(%[in])                     \\n\\t\"\n    \"lh       %[temp10], 20(%[in])                     \\n\\t\"\n    \"lh       %[temp14], 28(%[in])                     \\n\\t\"\n    \"subu     %[temp17], %[temp8],  %[temp17]          \\n\\t\"\n    \"addu     %[temp4],  %[temp4],  %[temp12]          \\n\\t\"\n    \"addu     %[temp8],  %[temp16], %[temp4]           \\n\\t\"\n    \"subu     %[temp4],  %[temp16], %[temp4]           \\n\\t\"\n    \"addu     %[temp16], %[temp1],  %[temp9]           \\n\\t\"\n    \"subu     %[temp1],  %[temp1],  %[temp9]           \\n\\t\"\n    \"lh       %[temp3],  6(%[in])                      \\n\\t\"\n    \"lh       %[temp7],  14(%[in])                     \\n\\t\"\n    \"lh       %[temp11], 22(%[in])                     \\n\\t\"\n    \"lh       %[temp15], 30(%[in])                     \\n\\t\"\n    \"addu     %[temp12], %[temp0],  %[temp17]          \\n\\t\"\n    \"subu     %[temp0],  %[temp0],  %[temp17]          \\n\\t\"\n    \"mul      %[temp9],  %[temp5],  %[kC2]             \\n\\t\"\n    \"mul      %[temp17], %[temp13], %[kC1]             \\n\\t\"\n    \"mul      %[temp5],  %[temp5],  %[kC1]             \\n\\t\"\n    \"mul      %[temp13], %[temp13], %[kC2]             \\n\\t\"\n    \"sra      %[temp9],  %[temp9],  16                 \\n\\t\"\n    \"sra      %[temp17], %[temp17], 16                 \\n\\t\"\n    \"subu     %[temp17], %[temp9],  %[temp17]          \\n\\t\"\n    \"sra      %[temp5],  %[temp5],  16                 \\n\\t\"\n    \"sra      %[temp13], %[temp13], 16                 \\n\\t\"\n    \"addu     %[temp5],  %[temp5],  %[temp13]          \\n\\t\"\n    \"addu     %[temp13], %[temp1],  %[temp17]          \\n\\t\"\n    \"subu     %[temp1],  %[temp1],  %[temp17]          \\n\\t\"\n    \"mul      %[temp17], %[temp14], %[kC1]             \\n\\t\"\n    \"mul      %[temp14], %[temp14], %[kC2]             \\n\\t\"\n    \"addu     %[temp9],  %[temp16], %[temp5]           \\n\\t\"\n    \"subu     %[temp5],  %[temp16], %[temp5]           \\n\\t\"\n    \"addu     %[temp16], %[temp2],  %[temp10]          \\n\\t\"\n    \"subu     %[temp2],  %[temp2],  %[temp10]          \\n\\t\"\n    \"mul      %[temp10], %[temp6],  %[kC2]             \\n\\t\"\n    \"mul      %[temp6],  %[temp6],  %[kC1]             \\n\\t\"\n    \"sra      %[temp17], %[temp17], 16                 \\n\\t\"\n    \"sra      %[temp14], %[temp14], 16                 \\n\\t\"\n    \"sra      %[temp10], %[temp10], 16                 \\n\\t\"\n    \"sra      %[temp6],  %[temp6],  16                 \\n\\t\"\n    \"subu     %[temp17], %[temp10], %[temp17]          \\n\\t\"\n    \"addu     %[temp6],  %[temp6],  %[temp14]          \\n\\t\"\n    \"addu     %[temp10], %[temp16], %[temp6]           \\n\\t\"\n    \"subu     %[temp6],  %[temp16], %[temp6]           \\n\\t\"\n    \"addu     %[temp14], %[temp2],  %[temp17]          \\n\\t\"\n    \"subu     %[temp2],  %[temp2],  %[temp17]          \\n\\t\"\n    \"mul      %[temp17], %[temp15], %[kC1]             \\n\\t\"\n    \"mul      %[temp15], %[temp15], %[kC2]             \\n\\t\"\n    \"addu     %[temp16], %[temp3],  %[temp11]          \\n\\t\"\n    \"subu     %[temp3],  %[temp3],  %[temp11]          \\n\\t\"\n    \"mul      %[temp11], %[temp7],  %[kC2]             \\n\\t\"\n    \"mul      %[temp7],  %[temp7],  %[kC1]             \\n\\t\"\n    \"addiu    %[temp8],  %[temp8],  4                  \\n\\t\"\n    \"addiu    %[temp12], %[temp12], 4                  \\n\\t\"\n    \"addiu    %[temp0],  %[temp0],  4                  \\n\\t\"\n    \"addiu    %[temp4],  %[temp4],  4                  \\n\\t\"\n    \"sra      %[temp17], %[temp17], 16                 \\n\\t\"\n    \"sra      %[temp15], %[temp15], 16                 \\n\\t\"\n    \"sra      %[temp11], %[temp11], 16                 \\n\\t\"\n    \"sra      %[temp7],  %[temp7],  16                 \\n\\t\"\n    \"subu     %[temp17], %[temp11], %[temp17]          \\n\\t\"\n    \"addu     %[temp7],  %[temp7],  %[temp15]          \\n\\t\"\n    \"addu     %[temp15], %[temp3],  %[temp17]          \\n\\t\"\n    \"subu     %[temp3],  %[temp3],  %[temp17]          \\n\\t\"\n    \"addu     %[temp11], %[temp16], %[temp7]           \\n\\t\"\n    \"subu     %[temp7],  %[temp16], %[temp7]           \\n\\t\"\n    \"addu     %[temp16], %[temp8],  %[temp10]          \\n\\t\"\n    \"subu     %[temp8],  %[temp8],  %[temp10]          \\n\\t\"\n    \"mul      %[temp10], %[temp9],  %[kC2]             \\n\\t\"\n    \"mul      %[temp17], %[temp11], %[kC1]             \\n\\t\"\n    \"mul      %[temp9],  %[temp9],  %[kC1]             \\n\\t\"\n    \"mul      %[temp11], %[temp11], %[kC2]             \\n\\t\"\n    \"sra      %[temp10], %[temp10], 16                 \\n\\t\"\n    \"sra      %[temp17], %[temp17], 16                 \\n\\t\"\n    \"sra      %[temp9],  %[temp9],  16                 \\n\\t\"\n    \"sra      %[temp11], %[temp11], 16                 \\n\\t\"\n    \"subu     %[temp17], %[temp10], %[temp17]          \\n\\t\"\n    \"addu     %[temp11], %[temp9],  %[temp11]          \\n\\t\"\n    \"addu     %[temp10], %[temp12], %[temp14]          \\n\\t\"\n    \"subu     %[temp12], %[temp12], %[temp14]          \\n\\t\"\n    \"mul      %[temp14], %[temp13], %[kC2]             \\n\\t\"\n    \"mul      %[temp9],  %[temp15], %[kC1]             \\n\\t\"\n    \"mul      %[temp13], %[temp13], %[kC1]             \\n\\t\"\n    \"mul      %[temp15], %[temp15], %[kC2]             \\n\\t\"\n    \"sra      %[temp14], %[temp14], 16                 \\n\\t\"\n    \"sra      %[temp9],  %[temp9],  16                 \\n\\t\"\n    \"sra      %[temp13], %[temp13], 16                 \\n\\t\"\n    \"sra      %[temp15], %[temp15], 16                 \\n\\t\"\n    \"subu     %[temp9],  %[temp14], %[temp9]           \\n\\t\"\n    \"addu     %[temp15], %[temp13], %[temp15]          \\n\\t\"\n    \"addu     %[temp14], %[temp0],  %[temp2]           \\n\\t\"\n    \"subu     %[temp0],  %[temp0],  %[temp2]           \\n\\t\"\n    \"mul      %[temp2],  %[temp1],  %[kC2]             \\n\\t\"\n    \"mul      %[temp13], %[temp3],  %[kC1]             \\n\\t\"\n    \"mul      %[temp1],  %[temp1],  %[kC1]             \\n\\t\"\n    \"mul      %[temp3],  %[temp3],  %[kC2]             \\n\\t\"\n    \"sra      %[temp2],  %[temp2],  16                 \\n\\t\"\n    \"sra      %[temp13], %[temp13], 16                 \\n\\t\"\n    \"sra      %[temp1],  %[temp1],  16                 \\n\\t\"\n    \"sra      %[temp3],  %[temp3],  16                 \\n\\t\"\n    \"subu     %[temp13], %[temp2],  %[temp13]          \\n\\t\"\n    \"addu     %[temp3],  %[temp1],  %[temp3]           \\n\\t\"\n    \"addu     %[temp2],  %[temp4],  %[temp6]           \\n\\t\"\n    \"subu     %[temp4],  %[temp4],  %[temp6]           \\n\\t\"\n    \"mul      %[temp6],  %[temp5],  %[kC2]             \\n\\t\"\n    \"mul      %[temp1],  %[temp7],  %[kC1]             \\n\\t\"\n    \"mul      %[temp5],  %[temp5],  %[kC1]             \\n\\t\"\n    \"mul      %[temp7],  %[temp7],  %[kC2]             \\n\\t\"\n    \"sra      %[temp6],  %[temp6],  16                 \\n\\t\"\n    \"sra      %[temp1],  %[temp1],  16                 \\n\\t\"\n    \"sra      %[temp5],  %[temp5],  16                 \\n\\t\"\n    \"sra      %[temp7],  %[temp7],  16                 \\n\\t\"\n    \"subu     %[temp1],  %[temp6],  %[temp1]           \\n\\t\"\n    \"addu     %[temp7],  %[temp5],  %[temp7]           \\n\\t\"\n    \"addu     %[temp5],  %[temp16], %[temp11]          \\n\\t\"\n    \"subu     %[temp16], %[temp16], %[temp11]          \\n\\t\"\n    \"addu     %[temp11], %[temp8],  %[temp17]          \\n\\t\"\n    \"subu     %[temp8],  %[temp8],  %[temp17]          \\n\\t\"\n    \"sra      %[temp5],  %[temp5],  3                  \\n\\t\"\n    \"sra      %[temp16], %[temp16], 3                  \\n\\t\"\n    \"sra      %[temp11], %[temp11], 3                  \\n\\t\"\n    \"sra      %[temp8],  %[temp8],  3                  \\n\\t\"\n    \"addu     %[temp17], %[temp10], %[temp15]          \\n\\t\"\n    \"subu     %[temp10], %[temp10], %[temp15]          \\n\\t\"\n    \"addu     %[temp15], %[temp12], %[temp9]           \\n\\t\"\n    \"subu     %[temp12], %[temp12], %[temp9]           \\n\\t\"\n    \"sra      %[temp17], %[temp17], 3                  \\n\\t\"\n    \"sra      %[temp10], %[temp10], 3                  \\n\\t\"\n    \"sra      %[temp15], %[temp15], 3                  \\n\\t\"\n    \"sra      %[temp12], %[temp12], 3                  \\n\\t\"\n    \"addu     %[temp9],  %[temp14], %[temp3]           \\n\\t\"\n    \"subu     %[temp14], %[temp14], %[temp3]           \\n\\t\"\n    \"addu     %[temp3],  %[temp0],  %[temp13]          \\n\\t\"\n    \"subu     %[temp0],  %[temp0],  %[temp13]          \\n\\t\"\n    \"sra      %[temp9],  %[temp9],  3                  \\n\\t\"\n    \"sra      %[temp14], %[temp14], 3                  \\n\\t\"\n    \"sra      %[temp3],  %[temp3],  3                  \\n\\t\"\n    \"sra      %[temp0],  %[temp0],  3                  \\n\\t\"\n    \"addu     %[temp13], %[temp2],  %[temp7]           \\n\\t\"\n    \"subu     %[temp2],  %[temp2],  %[temp7]           \\n\\t\"\n    \"addu     %[temp7],  %[temp4],  %[temp1]           \\n\\t\"\n    \"subu     %[temp4],  %[temp4],  %[temp1]           \\n\\t\"\n    \"sra      %[temp13], %[temp13], 3                  \\n\\t\"\n    \"sra      %[temp2],  %[temp2],  3                  \\n\\t\"\n    \"sra      %[temp7],  %[temp7],  3                  \\n\\t\"\n    \"sra      %[temp4],  %[temp4],  3                  \\n\\t\"\n    \"addiu    %[temp6],  $zero,     255                \\n\\t\"\n    \"lbu      %[temp1],  0(%[dst])                     \\n\\t\"\n    \"addu     %[temp1],  %[temp1],  %[temp5]           \\n\\t\"\n    \"sra      %[temp5],  %[temp1],  8                  \\n\\t\"\n    \"sra      %[temp18], %[temp1],  31                 \\n\\t\"\n    \"beqz     %[temp5],  1f                            \\n\\t\"\n    \"xor      %[temp1],  %[temp1],  %[temp1]           \\n\\t\"\n    \"movz     %[temp1],  %[temp6],  %[temp18]          \\n\\t\"\n  \"1:                                                  \\n\\t\"\n    \"lbu      %[temp18], 1(%[dst])                     \\n\\t\"\n    \"sb       %[temp1],  0(%[dst])                     \\n\\t\"\n    \"addu     %[temp18], %[temp18], %[temp11]          \\n\\t\"\n    \"sra      %[temp11], %[temp18], 8                  \\n\\t\"\n    \"sra      %[temp1],  %[temp18], 31                 \\n\\t\"\n    \"beqz     %[temp11], 2f                            \\n\\t\"\n    \"xor      %[temp18], %[temp18], %[temp18]          \\n\\t\"\n    \"movz     %[temp18], %[temp6],  %[temp1]           \\n\\t\"\n  \"2:                                                  \\n\\t\"\n    \"lbu      %[temp1],  2(%[dst])                     \\n\\t\"\n    \"sb       %[temp18], 1(%[dst])                     \\n\\t\"\n    \"addu     %[temp1],  %[temp1],  %[temp8]           \\n\\t\"\n    \"sra      %[temp8],  %[temp1],  8                  \\n\\t\"\n    \"sra      %[temp18], %[temp1],  31                 \\n\\t\"\n    \"beqz     %[temp8],  3f                            \\n\\t\"\n    \"xor      %[temp1],  %[temp1],  %[temp1]           \\n\\t\"\n    \"movz     %[temp1],  %[temp6],  %[temp18]          \\n\\t\"\n  \"3:                                                  \\n\\t\"\n    \"lbu      %[temp18], 3(%[dst])                     \\n\\t\"\n    \"sb       %[temp1],  2(%[dst])                     \\n\\t\"\n    \"addu     %[temp18], %[temp18], %[temp16]          \\n\\t\"\n    \"sra      %[temp16], %[temp18], 8                  \\n\\t\"\n    \"sra      %[temp1],  %[temp18], 31                 \\n\\t\"\n    \"beqz     %[temp16], 4f                            \\n\\t\"\n    \"xor      %[temp18], %[temp18], %[temp18]          \\n\\t\"\n    \"movz     %[temp18], %[temp6],  %[temp1]           \\n\\t\"\n  \"4:                                                  \\n\\t\"\n    \"sb       %[temp18], 3(%[dst])                     \\n\\t\"\n    \"lbu      %[temp5],  32(%[dst])                    \\n\\t\"\n    \"lbu      %[temp8],  33(%[dst])                    \\n\\t\"\n    \"lbu      %[temp11], 34(%[dst])                    \\n\\t\"\n    \"lbu      %[temp16], 35(%[dst])                    \\n\\t\"\n    \"addu     %[temp5],  %[temp5],  %[temp17]          \\n\\t\"\n    \"addu     %[temp8],  %[temp8],  %[temp15]          \\n\\t\"\n    \"addu     %[temp11], %[temp11], %[temp12]          \\n\\t\"\n    \"addu     %[temp16], %[temp16], %[temp10]          \\n\\t\"\n    \"sra      %[temp18], %[temp5],  8                  \\n\\t\"\n    \"sra      %[temp1],  %[temp5],  31                 \\n\\t\"\n    \"beqz     %[temp18], 5f                            \\n\\t\"\n    \"xor      %[temp5],  %[temp5],  %[temp5]           \\n\\t\"\n    \"movz     %[temp5],  %[temp6],  %[temp1]           \\n\\t\"\n  \"5:                                                  \\n\\t\"\n    \"sra      %[temp18], %[temp8],  8                  \\n\\t\"\n    \"sra      %[temp1],  %[temp8],  31                 \\n\\t\"\n    \"beqz     %[temp18], 6f                            \\n\\t\"\n    \"xor      %[temp8],  %[temp8],  %[temp8]           \\n\\t\"\n    \"movz     %[temp8],  %[temp6],  %[temp1]           \\n\\t\"\n  \"6:                                                  \\n\\t\"\n    \"sra      %[temp18], %[temp11], 8                  \\n\\t\"\n    \"sra      %[temp1],  %[temp11], 31                 \\n\\t\"\n    \"sra      %[temp17], %[temp16], 8                  \\n\\t\"\n    \"sra      %[temp15], %[temp16], 31                 \\n\\t\"\n    \"beqz     %[temp18], 7f                            \\n\\t\"\n    \"xor      %[temp11], %[temp11], %[temp11]          \\n\\t\"\n    \"movz     %[temp11], %[temp6],  %[temp1]           \\n\\t\"\n  \"7:                                                  \\n\\t\"\n    \"beqz     %[temp17], 8f                            \\n\\t\"\n    \"xor      %[temp16], %[temp16], %[temp16]          \\n\\t\"\n    \"movz     %[temp16], %[temp6],  %[temp15]          \\n\\t\"\n  \"8:                                                  \\n\\t\"\n    \"sb       %[temp5],  32(%[dst])                    \\n\\t\"\n    \"sb       %[temp8],  33(%[dst])                    \\n\\t\"\n    \"sb       %[temp11], 34(%[dst])                    \\n\\t\"\n    \"sb       %[temp16], 35(%[dst])                    \\n\\t\"\n    \"lbu      %[temp5],  64(%[dst])                    \\n\\t\"\n    \"lbu      %[temp8],  65(%[dst])                    \\n\\t\"\n    \"lbu      %[temp11], 66(%[dst])                    \\n\\t\"\n    \"lbu      %[temp16], 67(%[dst])                    \\n\\t\"\n    \"addu     %[temp5],  %[temp5],  %[temp9]           \\n\\t\"\n    \"addu     %[temp8],  %[temp8],  %[temp3]           \\n\\t\"\n    \"addu     %[temp11], %[temp11], %[temp0]           \\n\\t\"\n    \"addu     %[temp16], %[temp16], %[temp14]          \\n\\t\"\n    \"sra      %[temp18], %[temp5],  8                  \\n\\t\"\n    \"sra      %[temp1],  %[temp5],  31                 \\n\\t\"\n    \"sra      %[temp17], %[temp8],  8                  \\n\\t\"\n    \"sra      %[temp15], %[temp8],  31                 \\n\\t\"\n    \"sra      %[temp12], %[temp11], 8                  \\n\\t\"\n    \"sra      %[temp10], %[temp11], 31                 \\n\\t\"\n    \"sra      %[temp9],  %[temp16], 8                  \\n\\t\"\n    \"sra      %[temp3],  %[temp16], 31                 \\n\\t\"\n    \"beqz     %[temp18], 9f                            \\n\\t\"\n    \"xor      %[temp5],  %[temp5],  %[temp5]           \\n\\t\"\n    \"movz     %[temp5],  %[temp6],  %[temp1]           \\n\\t\"\n  \"9:                                                  \\n\\t\"\n    \"beqz     %[temp17], 10f                           \\n\\t\"\n    \"xor      %[temp8],  %[temp8],  %[temp8]           \\n\\t\"\n    \"movz     %[temp8],  %[temp6],  %[temp15]          \\n\\t\"\n  \"10:                                                 \\n\\t\"\n    \"beqz     %[temp12], 11f                           \\n\\t\"\n    \"xor      %[temp11], %[temp11], %[temp11]          \\n\\t\"\n    \"movz     %[temp11], %[temp6],  %[temp10]          \\n\\t\"\n  \"11:                                                 \\n\\t\"\n    \"beqz     %[temp9],  12f                           \\n\\t\"\n    \"xor      %[temp16], %[temp16], %[temp16]          \\n\\t\"\n    \"movz     %[temp16], %[temp6],  %[temp3]           \\n\\t\"\n  \"12:                                                 \\n\\t\"\n    \"sb       %[temp5],  64(%[dst])                    \\n\\t\"\n    \"sb       %[temp8],  65(%[dst])                    \\n\\t\"\n    \"sb       %[temp11], 66(%[dst])                    \\n\\t\"\n    \"sb       %[temp16], 67(%[dst])                    \\n\\t\"\n    \"lbu      %[temp5],  96(%[dst])                    \\n\\t\"\n    \"lbu      %[temp8],  97(%[dst])                    \\n\\t\"\n    \"lbu      %[temp11], 98(%[dst])                    \\n\\t\"\n    \"lbu      %[temp16], 99(%[dst])                    \\n\\t\"\n    \"addu     %[temp5],  %[temp5],  %[temp13]          \\n\\t\"\n    \"addu     %[temp8],  %[temp8],  %[temp7]           \\n\\t\"\n    \"addu     %[temp11], %[temp11], %[temp4]           \\n\\t\"\n    \"addu     %[temp16], %[temp16], %[temp2]           \\n\\t\"\n    \"sra      %[temp18], %[temp5],  8                  \\n\\t\"\n    \"sra      %[temp1],  %[temp5],  31                 \\n\\t\"\n    \"sra      %[temp17], %[temp8],  8                  \\n\\t\"\n    \"sra      %[temp15], %[temp8],  31                 \\n\\t\"\n    \"sra      %[temp12], %[temp11], 8                  \\n\\t\"\n    \"sra      %[temp10], %[temp11], 31                 \\n\\t\"\n    \"sra      %[temp9],  %[temp16], 8                  \\n\\t\"\n    \"sra      %[temp3],  %[temp16], 31                 \\n\\t\"\n    \"beqz     %[temp18], 13f                           \\n\\t\"\n    \"xor      %[temp5],  %[temp5],  %[temp5]           \\n\\t\"\n    \"movz     %[temp5],  %[temp6],  %[temp1]           \\n\\t\"\n  \"13:                                                 \\n\\t\"\n    \"beqz     %[temp17], 14f                           \\n\\t\"\n    \"xor      %[temp8],  %[temp8],  %[temp8]           \\n\\t\"\n    \"movz     %[temp8],  %[temp6],  %[temp15]          \\n\\t\"\n  \"14:                                                 \\n\\t\"\n    \"beqz     %[temp12], 15f                           \\n\\t\"\n    \"xor      %[temp11], %[temp11], %[temp11]          \\n\\t\"\n    \"movz     %[temp11], %[temp6],  %[temp10]          \\n\\t\"\n  \"15:                                                 \\n\\t\"\n    \"beqz     %[temp9],  16f                           \\n\\t\"\n    \"xor      %[temp16], %[temp16], %[temp16]          \\n\\t\"\n    \"movz     %[temp16], %[temp6],  %[temp3]           \\n\\t\"\n  \"16:                                                 \\n\\t\"\n    \"sb       %[temp5],  96(%[dst])                    \\n\\t\"\n    \"sb       %[temp8],  97(%[dst])                    \\n\\t\"\n    \"sb       %[temp11], 98(%[dst])                    \\n\\t\"\n    \"sb       %[temp16], 99(%[dst])                    \\n\\t\"\n\n    : [temp0]\"=&r\"(temp0), [temp1]\"=&r\"(temp1), [temp2]\"=&r\"(temp2),\n      [temp3]\"=&r\"(temp3), [temp4]\"=&r\"(temp4), [temp5]\"=&r\"(temp5),\n      [temp6]\"=&r\"(temp6), [temp7]\"=&r\"(temp7), [temp8]\"=&r\"(temp8),\n      [temp9]\"=&r\"(temp9), [temp10]\"=&r\"(temp10), [temp11]\"=&r\"(temp11),\n      [temp12]\"=&r\"(temp12), [temp13]\"=&r\"(temp13), [temp14]\"=&r\"(temp14),\n      [temp15]\"=&r\"(temp15), [temp16]\"=&r\"(temp16), [temp17]\"=&r\"(temp17),\n      [temp18]\"=&r\"(temp18)\n    : [in]\"r\"(p_in), [kC1]\"r\"(kC1), [kC2]\"r\"(kC2), [dst]\"r\"(dst)\n    : \"memory\", \"hi\", \"lo\"\n  );\n}\n\nstatic void TransformTwo(const int16_t* in, uint8_t* dst, int do_two) {\n  TransformOne(in, dst);\n  if (do_two) {\n    TransformOne(in + 16, dst + 4);\n  }\n}\n\n#endif  // WEBP_USE_MIPS32\n\n//------------------------------------------------------------------------------\n// Entry point\n\nextern void VP8DspInitMIPS32(void);\n\nvoid VP8DspInitMIPS32(void) {\n#if defined(WEBP_USE_MIPS32)\n  VP8InitClipTables();\n\n  VP8Transform = TransformTwo;\n\n  VP8VFilter16 = VFilter16;\n  VP8HFilter16 = HFilter16;\n  VP8VFilter8 = VFilter8;\n  VP8HFilter8 = HFilter8;\n  VP8VFilter16i = VFilter16i;\n  VP8HFilter16i = HFilter16i;\n  VP8VFilter8i = VFilter8i;\n  VP8HFilter8i = HFilter8i;\n\n  VP8SimpleVFilter16 = SimpleVFilter16;\n  VP8SimpleHFilter16 = SimpleHFilter16;\n  VP8SimpleVFilter16i = SimpleVFilter16i;\n  VP8SimpleHFilter16i = SimpleHFilter16i;\n#endif  // WEBP_USE_MIPS32\n}\n"
  },
  {
    "path": "ext/libwebp/dsp/dec_neon.c",
    "content": "// Copyright 2012 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// ARM NEON version of dsp functions and loop filtering.\n//\n// Authors: Somnath Banerjee (somnath@google.com)\n//          Johann Koenig (johannkoenig@google.com)\n\n#include \"./dsp.h\"\n\n#if defined(WEBP_USE_NEON)\n\n#include \"./neon.h\"\n#include \"../dec/vp8i.h\"\n\n//------------------------------------------------------------------------------\n// NxM Loading functions\n\n// Load/Store vertical edge\n#define LOAD8x4(c1, c2, c3, c4, b1, b2, stride)                                \\\n  \"vld4.8   {\" #c1\"[0], \" #c2\"[0], \" #c3\"[0], \" #c4\"[0]},\" #b1 \",\" #stride\"\\n\" \\\n  \"vld4.8   {\" #c1\"[1], \" #c2\"[1], \" #c3\"[1], \" #c4\"[1]},\" #b2 \",\" #stride\"\\n\" \\\n  \"vld4.8   {\" #c1\"[2], \" #c2\"[2], \" #c3\"[2], \" #c4\"[2]},\" #b1 \",\" #stride\"\\n\" \\\n  \"vld4.8   {\" #c1\"[3], \" #c2\"[3], \" #c3\"[3], \" #c4\"[3]},\" #b2 \",\" #stride\"\\n\" \\\n  \"vld4.8   {\" #c1\"[4], \" #c2\"[4], \" #c3\"[4], \" #c4\"[4]},\" #b1 \",\" #stride\"\\n\" \\\n  \"vld4.8   {\" #c1\"[5], \" #c2\"[5], \" #c3\"[5], \" #c4\"[5]},\" #b2 \",\" #stride\"\\n\" \\\n  \"vld4.8   {\" #c1\"[6], \" #c2\"[6], \" #c3\"[6], \" #c4\"[6]},\" #b1 \",\" #stride\"\\n\" \\\n  \"vld4.8   {\" #c1\"[7], \" #c2\"[7], \" #c3\"[7], \" #c4\"[7]},\" #b2 \",\" #stride\"\\n\"\n\n#define STORE8x2(c1, c2, p, stride)                                            \\\n  \"vst2.8   {\" #c1\"[0], \" #c2\"[0]},\" #p \",\" #stride \" \\n\"                      \\\n  \"vst2.8   {\" #c1\"[1], \" #c2\"[1]},\" #p \",\" #stride \" \\n\"                      \\\n  \"vst2.8   {\" #c1\"[2], \" #c2\"[2]},\" #p \",\" #stride \" \\n\"                      \\\n  \"vst2.8   {\" #c1\"[3], \" #c2\"[3]},\" #p \",\" #stride \" \\n\"                      \\\n  \"vst2.8   {\" #c1\"[4], \" #c2\"[4]},\" #p \",\" #stride \" \\n\"                      \\\n  \"vst2.8   {\" #c1\"[5], \" #c2\"[5]},\" #p \",\" #stride \" \\n\"                      \\\n  \"vst2.8   {\" #c1\"[6], \" #c2\"[6]},\" #p \",\" #stride \" \\n\"                      \\\n  \"vst2.8   {\" #c1\"[7], \" #c2\"[7]},\" #p \",\" #stride \" \\n\"\n\n#if !defined(WORK_AROUND_GCC)\n\n// This intrinsics version makes gcc-4.6.3 crash during Load4x??() compilation\n// (register alloc, probably). The variants somewhat mitigate the problem, but\n// not quite. HFilter16i() remains problematic.\nstatic WEBP_INLINE uint8x8x4_t Load4x8(const uint8_t* const src, int stride) {\n  const uint8x8_t zero = vdup_n_u8(0);\n  uint8x8x4_t out;\n  INIT_VECTOR4(out, zero, zero, zero, zero);\n  out = vld4_lane_u8(src + 0 * stride, out, 0);\n  out = vld4_lane_u8(src + 1 * stride, out, 1);\n  out = vld4_lane_u8(src + 2 * stride, out, 2);\n  out = vld4_lane_u8(src + 3 * stride, out, 3);\n  out = vld4_lane_u8(src + 4 * stride, out, 4);\n  out = vld4_lane_u8(src + 5 * stride, out, 5);\n  out = vld4_lane_u8(src + 6 * stride, out, 6);\n  out = vld4_lane_u8(src + 7 * stride, out, 7);\n  return out;\n}\n\nstatic WEBP_INLINE void Load4x16(const uint8_t* const src, int stride,\n                                 uint8x16_t* const p1, uint8x16_t* const p0,\n                                 uint8x16_t* const q0, uint8x16_t* const q1) {\n  // row0 = p1[0..7]|p0[0..7]|q0[0..7]|q1[0..7]\n  // row8 = p1[8..15]|p0[8..15]|q0[8..15]|q1[8..15]\n  const uint8x8x4_t row0 = Load4x8(src - 2 + 0 * stride, stride);\n  const uint8x8x4_t row8 = Load4x8(src - 2 + 8 * stride, stride);\n  *p1 = vcombine_u8(row0.val[0], row8.val[0]);\n  *p0 = vcombine_u8(row0.val[1], row8.val[1]);\n  *q0 = vcombine_u8(row0.val[2], row8.val[2]);\n  *q1 = vcombine_u8(row0.val[3], row8.val[3]);\n}\n\n#else  // WORK_AROUND_GCC\n\n#define LOADQ_LANE_32b(VALUE, LANE) do {                             \\\n  (VALUE) = vld1q_lane_u32((const uint32_t*)src, (VALUE), (LANE));   \\\n  src += stride;                                                     \\\n} while (0)\n\nstatic WEBP_INLINE void Load4x16(const uint8_t* src, int stride,\n                                 uint8x16_t* const p1, uint8x16_t* const p0,\n                                 uint8x16_t* const q0, uint8x16_t* const q1) {\n  const uint32x4_t zero = vdupq_n_u32(0);\n  uint32x4x4_t in;\n  INIT_VECTOR4(in, zero, zero, zero, zero);\n  src -= 2;\n  LOADQ_LANE_32b(in.val[0], 0);\n  LOADQ_LANE_32b(in.val[1], 0);\n  LOADQ_LANE_32b(in.val[2], 0);\n  LOADQ_LANE_32b(in.val[3], 0);\n  LOADQ_LANE_32b(in.val[0], 1);\n  LOADQ_LANE_32b(in.val[1], 1);\n  LOADQ_LANE_32b(in.val[2], 1);\n  LOADQ_LANE_32b(in.val[3], 1);\n  LOADQ_LANE_32b(in.val[0], 2);\n  LOADQ_LANE_32b(in.val[1], 2);\n  LOADQ_LANE_32b(in.val[2], 2);\n  LOADQ_LANE_32b(in.val[3], 2);\n  LOADQ_LANE_32b(in.val[0], 3);\n  LOADQ_LANE_32b(in.val[1], 3);\n  LOADQ_LANE_32b(in.val[2], 3);\n  LOADQ_LANE_32b(in.val[3], 3);\n  // Transpose four 4x4 parts:\n  {\n    const uint8x16x2_t row01 = vtrnq_u8(vreinterpretq_u8_u32(in.val[0]),\n                                        vreinterpretq_u8_u32(in.val[1]));\n    const uint8x16x2_t row23 = vtrnq_u8(vreinterpretq_u8_u32(in.val[2]),\n                                        vreinterpretq_u8_u32(in.val[3]));\n    const uint16x8x2_t row02 = vtrnq_u16(vreinterpretq_u16_u8(row01.val[0]),\n                                         vreinterpretq_u16_u8(row23.val[0]));\n    const uint16x8x2_t row13 = vtrnq_u16(vreinterpretq_u16_u8(row01.val[1]),\n                                         vreinterpretq_u16_u8(row23.val[1]));\n    *p1 = vreinterpretq_u8_u16(row02.val[0]);\n    *p0 = vreinterpretq_u8_u16(row13.val[0]);\n    *q0 = vreinterpretq_u8_u16(row02.val[1]);\n    *q1 = vreinterpretq_u8_u16(row13.val[1]);\n  }\n}\n#undef LOADQ_LANE_32b\n\n#endif  // !WORK_AROUND_GCC\n\nstatic WEBP_INLINE void Load8x16(const uint8_t* const src, int stride,\n                                 uint8x16_t* const p3, uint8x16_t* const p2,\n                                 uint8x16_t* const p1, uint8x16_t* const p0,\n                                 uint8x16_t* const q0, uint8x16_t* const q1,\n                                 uint8x16_t* const q2, uint8x16_t* const q3) {\n  Load4x16(src - 2, stride, p3, p2, p1, p0);\n  Load4x16(src + 2, stride, q0, q1, q2, q3);\n}\n\nstatic WEBP_INLINE void Load16x4(const uint8_t* const src, int stride,\n                                 uint8x16_t* const p1, uint8x16_t* const p0,\n                                 uint8x16_t* const q0, uint8x16_t* const q1) {\n  *p1 = vld1q_u8(src - 2 * stride);\n  *p0 = vld1q_u8(src - 1 * stride);\n  *q0 = vld1q_u8(src + 0 * stride);\n  *q1 = vld1q_u8(src + 1 * stride);\n}\n\nstatic WEBP_INLINE void Load16x8(const uint8_t* const src, int stride,\n                                 uint8x16_t* const p3, uint8x16_t* const p2,\n                                 uint8x16_t* const p1, uint8x16_t* const p0,\n                                 uint8x16_t* const q0, uint8x16_t* const q1,\n                                 uint8x16_t* const q2, uint8x16_t* const q3) {\n  Load16x4(src - 2  * stride, stride, p3, p2, p1, p0);\n  Load16x4(src + 2  * stride, stride, q0, q1, q2, q3);\n}\n\nstatic WEBP_INLINE void Load8x8x2(const uint8_t* const u,\n                                  const uint8_t* const v,\n                                  int stride,\n                                  uint8x16_t* const p3, uint8x16_t* const p2,\n                                  uint8x16_t* const p1, uint8x16_t* const p0,\n                                  uint8x16_t* const q0, uint8x16_t* const q1,\n                                  uint8x16_t* const q2, uint8x16_t* const q3) {\n  // We pack the 8x8 u-samples in the lower half of the uint8x16_t destination\n  // and the v-samples on the higher half.\n  *p3 = vcombine_u8(vld1_u8(u - 4 * stride), vld1_u8(v - 4 * stride));\n  *p2 = vcombine_u8(vld1_u8(u - 3 * stride), vld1_u8(v - 3 * stride));\n  *p1 = vcombine_u8(vld1_u8(u - 2 * stride), vld1_u8(v - 2 * stride));\n  *p0 = vcombine_u8(vld1_u8(u - 1 * stride), vld1_u8(v - 1 * stride));\n  *q0 = vcombine_u8(vld1_u8(u + 0 * stride), vld1_u8(v + 0 * stride));\n  *q1 = vcombine_u8(vld1_u8(u + 1 * stride), vld1_u8(v + 1 * stride));\n  *q2 = vcombine_u8(vld1_u8(u + 2 * stride), vld1_u8(v + 2 * stride));\n  *q3 = vcombine_u8(vld1_u8(u + 3 * stride), vld1_u8(v + 3 * stride));\n}\n\n#if !defined(WORK_AROUND_GCC)\n\n#define LOAD_UV_8(ROW) \\\n  vcombine_u8(vld1_u8(u - 4 + (ROW) * stride), vld1_u8(v - 4 + (ROW) * stride))\n\nstatic WEBP_INLINE void Load8x8x2T(const uint8_t* const u,\n                                   const uint8_t* const v,\n                                   int stride,\n                                   uint8x16_t* const p3, uint8x16_t* const p2,\n                                   uint8x16_t* const p1, uint8x16_t* const p0,\n                                   uint8x16_t* const q0, uint8x16_t* const q1,\n                                   uint8x16_t* const q2, uint8x16_t* const q3) {\n  // We pack the 8x8 u-samples in the lower half of the uint8x16_t destination\n  // and the v-samples on the higher half.\n  const uint8x16_t row0 = LOAD_UV_8(0);\n  const uint8x16_t row1 = LOAD_UV_8(1);\n  const uint8x16_t row2 = LOAD_UV_8(2);\n  const uint8x16_t row3 = LOAD_UV_8(3);\n  const uint8x16_t row4 = LOAD_UV_8(4);\n  const uint8x16_t row5 = LOAD_UV_8(5);\n  const uint8x16_t row6 = LOAD_UV_8(6);\n  const uint8x16_t row7 = LOAD_UV_8(7);\n  // Perform two side-by-side 8x8 transposes\n  // u00 u01 u02 u03 u04 u05 u06 u07 | v00 v01 v02 v03 v04 v05 v06 v07\n  // u10 u11 u12 u13 u14 u15 u16 u17 | v10 v11 v12 ...\n  // u20 u21 u22 u23 u24 u25 u26 u27 | v20 v21 ...\n  // u30 u31 u32 u33 u34 u35 u36 u37 | ...\n  // u40 u41 u42 u43 u44 u45 u46 u47 | ...\n  // u50 u51 u52 u53 u54 u55 u56 u57 | ...\n  // u60 u61 u62 u63 u64 u65 u66 u67 | v60 ...\n  // u70 u71 u72 u73 u74 u75 u76 u77 | v70 v71 v72 ...\n  const uint8x16x2_t row01 = vtrnq_u8(row0, row1);  // u00 u10 u02 u12 ...\n                                                    // u01 u11 u03 u13 ...\n  const uint8x16x2_t row23 = vtrnq_u8(row2, row3);  // u20 u30 u22 u32 ...\n                                                    // u21 u31 u23 u33 ...\n  const uint8x16x2_t row45 = vtrnq_u8(row4, row5);  // ...\n  const uint8x16x2_t row67 = vtrnq_u8(row6, row7);  // ...\n  const uint16x8x2_t row02 = vtrnq_u16(vreinterpretq_u16_u8(row01.val[0]),\n                                       vreinterpretq_u16_u8(row23.val[0]));\n  const uint16x8x2_t row13 = vtrnq_u16(vreinterpretq_u16_u8(row01.val[1]),\n                                       vreinterpretq_u16_u8(row23.val[1]));\n  const uint16x8x2_t row46 = vtrnq_u16(vreinterpretq_u16_u8(row45.val[0]),\n                                       vreinterpretq_u16_u8(row67.val[0]));\n  const uint16x8x2_t row57 = vtrnq_u16(vreinterpretq_u16_u8(row45.val[1]),\n                                       vreinterpretq_u16_u8(row67.val[1]));\n  const uint32x4x2_t row04 = vtrnq_u32(vreinterpretq_u32_u16(row02.val[0]),\n                                       vreinterpretq_u32_u16(row46.val[0]));\n  const uint32x4x2_t row26 = vtrnq_u32(vreinterpretq_u32_u16(row02.val[1]),\n                                       vreinterpretq_u32_u16(row46.val[1]));\n  const uint32x4x2_t row15 = vtrnq_u32(vreinterpretq_u32_u16(row13.val[0]),\n                                       vreinterpretq_u32_u16(row57.val[0]));\n  const uint32x4x2_t row37 = vtrnq_u32(vreinterpretq_u32_u16(row13.val[1]),\n                                       vreinterpretq_u32_u16(row57.val[1]));\n  *p3 = vreinterpretq_u8_u32(row04.val[0]);\n  *p2 = vreinterpretq_u8_u32(row15.val[0]);\n  *p1 = vreinterpretq_u8_u32(row26.val[0]);\n  *p0 = vreinterpretq_u8_u32(row37.val[0]);\n  *q0 = vreinterpretq_u8_u32(row04.val[1]);\n  *q1 = vreinterpretq_u8_u32(row15.val[1]);\n  *q2 = vreinterpretq_u8_u32(row26.val[1]);\n  *q3 = vreinterpretq_u8_u32(row37.val[1]);\n}\n#undef LOAD_UV_8\n\n#endif  // !WORK_AROUND_GCC\n\nstatic WEBP_INLINE void Store2x8(const uint8x8x2_t v,\n                                 uint8_t* const dst, int stride) {\n  vst2_lane_u8(dst + 0 * stride, v, 0);\n  vst2_lane_u8(dst + 1 * stride, v, 1);\n  vst2_lane_u8(dst + 2 * stride, v, 2);\n  vst2_lane_u8(dst + 3 * stride, v, 3);\n  vst2_lane_u8(dst + 4 * stride, v, 4);\n  vst2_lane_u8(dst + 5 * stride, v, 5);\n  vst2_lane_u8(dst + 6 * stride, v, 6);\n  vst2_lane_u8(dst + 7 * stride, v, 7);\n}\n\nstatic WEBP_INLINE void Store2x16(const uint8x16_t p0, const uint8x16_t q0,\n                                  uint8_t* const dst, int stride) {\n  uint8x8x2_t lo, hi;\n  lo.val[0] = vget_low_u8(p0);\n  lo.val[1] = vget_low_u8(q0);\n  hi.val[0] = vget_high_u8(p0);\n  hi.val[1] = vget_high_u8(q0);\n  Store2x8(lo, dst - 1 + 0 * stride, stride);\n  Store2x8(hi, dst - 1 + 8 * stride, stride);\n}\n\n#if !defined(WORK_AROUND_GCC)\nstatic WEBP_INLINE void Store4x8(const uint8x8x4_t v,\n                                 uint8_t* const dst, int stride) {\n  vst4_lane_u8(dst + 0 * stride, v, 0);\n  vst4_lane_u8(dst + 1 * stride, v, 1);\n  vst4_lane_u8(dst + 2 * stride, v, 2);\n  vst4_lane_u8(dst + 3 * stride, v, 3);\n  vst4_lane_u8(dst + 4 * stride, v, 4);\n  vst4_lane_u8(dst + 5 * stride, v, 5);\n  vst4_lane_u8(dst + 6 * stride, v, 6);\n  vst4_lane_u8(dst + 7 * stride, v, 7);\n}\n\nstatic WEBP_INLINE void Store4x16(const uint8x16_t p1, const uint8x16_t p0,\n                                  const uint8x16_t q0, const uint8x16_t q1,\n                                  uint8_t* const dst, int stride) {\n  uint8x8x4_t lo, hi;\n  INIT_VECTOR4(lo,\n               vget_low_u8(p1), vget_low_u8(p0),\n               vget_low_u8(q0), vget_low_u8(q1));\n  INIT_VECTOR4(hi,\n               vget_high_u8(p1), vget_high_u8(p0),\n               vget_high_u8(q0), vget_high_u8(q1));\n  Store4x8(lo, dst - 2 + 0 * stride, stride);\n  Store4x8(hi, dst - 2 + 8 * stride, stride);\n}\n#endif  // !WORK_AROUND_GCC\n\nstatic WEBP_INLINE void Store16x2(const uint8x16_t p0, const uint8x16_t q0,\n                                  uint8_t* const dst, int stride) {\n  vst1q_u8(dst - stride, p0);\n  vst1q_u8(dst, q0);\n}\n\nstatic WEBP_INLINE void Store16x4(const uint8x16_t p1, const uint8x16_t p0,\n                                  const uint8x16_t q0, const uint8x16_t q1,\n                                  uint8_t* const dst, int stride) {\n  Store16x2(p1, p0, dst - stride, stride);\n  Store16x2(q0, q1, dst + stride, stride);\n}\n\nstatic WEBP_INLINE void Store8x2x2(const uint8x16_t p0, const uint8x16_t q0,\n                                   uint8_t* const u, uint8_t* const v,\n                                   int stride) {\n  // p0 and q0 contain the u+v samples packed in low/high halves.\n  vst1_u8(u - stride, vget_low_u8(p0));\n  vst1_u8(u,          vget_low_u8(q0));\n  vst1_u8(v - stride, vget_high_u8(p0));\n  vst1_u8(v,          vget_high_u8(q0));\n}\n\nstatic WEBP_INLINE void Store8x4x2(const uint8x16_t p1, const uint8x16_t p0,\n                                   const uint8x16_t q0, const uint8x16_t q1,\n                                   uint8_t* const u, uint8_t* const v,\n                                   int stride) {\n  // The p1...q1 registers contain the u+v samples packed in low/high halves.\n  Store8x2x2(p1, p0, u - stride, v - stride, stride);\n  Store8x2x2(q0, q1, u + stride, v + stride, stride);\n}\n\n#if !defined(WORK_AROUND_GCC)\n\n#define STORE6_LANE(DST, VAL0, VAL1, LANE) do {   \\\n  vst3_lane_u8((DST) - 3, (VAL0), (LANE));        \\\n  vst3_lane_u8((DST) + 0, (VAL1), (LANE));        \\\n  (DST) += stride;                                \\\n} while (0)\n\nstatic WEBP_INLINE void Store6x8x2(const uint8x16_t p2, const uint8x16_t p1,\n                                   const uint8x16_t p0, const uint8x16_t q0,\n                                   const uint8x16_t q1, const uint8x16_t q2,\n                                   uint8_t* u, uint8_t* v,\n                                   int stride) {\n  uint8x8x3_t u0, u1, v0, v1;\n  INIT_VECTOR3(u0, vget_low_u8(p2), vget_low_u8(p1), vget_low_u8(p0));\n  INIT_VECTOR3(u1, vget_low_u8(q0), vget_low_u8(q1), vget_low_u8(q2));\n  INIT_VECTOR3(v0, vget_high_u8(p2), vget_high_u8(p1), vget_high_u8(p0));\n  INIT_VECTOR3(v1, vget_high_u8(q0), vget_high_u8(q1), vget_high_u8(q2));\n  STORE6_LANE(u, u0, u1, 0);\n  STORE6_LANE(u, u0, u1, 1);\n  STORE6_LANE(u, u0, u1, 2);\n  STORE6_LANE(u, u0, u1, 3);\n  STORE6_LANE(u, u0, u1, 4);\n  STORE6_LANE(u, u0, u1, 5);\n  STORE6_LANE(u, u0, u1, 6);\n  STORE6_LANE(u, u0, u1, 7);\n  STORE6_LANE(v, v0, v1, 0);\n  STORE6_LANE(v, v0, v1, 1);\n  STORE6_LANE(v, v0, v1, 2);\n  STORE6_LANE(v, v0, v1, 3);\n  STORE6_LANE(v, v0, v1, 4);\n  STORE6_LANE(v, v0, v1, 5);\n  STORE6_LANE(v, v0, v1, 6);\n  STORE6_LANE(v, v0, v1, 7);\n}\n#undef STORE6_LANE\n\nstatic WEBP_INLINE void Store4x8x2(const uint8x16_t p1, const uint8x16_t p0,\n                                   const uint8x16_t q0, const uint8x16_t q1,\n                                   uint8_t* const u, uint8_t* const v,\n                                   int stride) {\n  uint8x8x4_t u0, v0;\n  INIT_VECTOR4(u0,\n               vget_low_u8(p1), vget_low_u8(p0),\n               vget_low_u8(q0), vget_low_u8(q1));\n  INIT_VECTOR4(v0,\n               vget_high_u8(p1), vget_high_u8(p0),\n               vget_high_u8(q0), vget_high_u8(q1));\n  vst4_lane_u8(u - 2 + 0 * stride, u0, 0);\n  vst4_lane_u8(u - 2 + 1 * stride, u0, 1);\n  vst4_lane_u8(u - 2 + 2 * stride, u0, 2);\n  vst4_lane_u8(u - 2 + 3 * stride, u0, 3);\n  vst4_lane_u8(u - 2 + 4 * stride, u0, 4);\n  vst4_lane_u8(u - 2 + 5 * stride, u0, 5);\n  vst4_lane_u8(u - 2 + 6 * stride, u0, 6);\n  vst4_lane_u8(u - 2 + 7 * stride, u0, 7);\n  vst4_lane_u8(v - 2 + 0 * stride, v0, 0);\n  vst4_lane_u8(v - 2 + 1 * stride, v0, 1);\n  vst4_lane_u8(v - 2 + 2 * stride, v0, 2);\n  vst4_lane_u8(v - 2 + 3 * stride, v0, 3);\n  vst4_lane_u8(v - 2 + 4 * stride, v0, 4);\n  vst4_lane_u8(v - 2 + 5 * stride, v0, 5);\n  vst4_lane_u8(v - 2 + 6 * stride, v0, 6);\n  vst4_lane_u8(v - 2 + 7 * stride, v0, 7);\n}\n\n#endif  // !WORK_AROUND_GCC\n\n// Treats 'v' as an uint8x8_t and zero extends to an int16x8_t.\nstatic WEBP_INLINE int16x8_t ConvertU8ToS16(uint32x2_t v) {\n  return vreinterpretq_s16_u16(vmovl_u8(vreinterpret_u8_u32(v)));\n}\n\n// Performs unsigned 8b saturation on 'dst01' and 'dst23' storing the result\n// to the corresponding rows of 'dst'.\nstatic WEBP_INLINE void SaturateAndStore4x4(uint8_t* const dst,\n                                            const int16x8_t dst01,\n                                            const int16x8_t dst23) {\n  // Unsigned saturate to 8b.\n  const uint8x8_t dst01_u8 = vqmovun_s16(dst01);\n  const uint8x8_t dst23_u8 = vqmovun_s16(dst23);\n\n  // Store the results.\n  vst1_lane_u32((uint32_t*)(dst + 0 * BPS), vreinterpret_u32_u8(dst01_u8), 0);\n  vst1_lane_u32((uint32_t*)(dst + 1 * BPS), vreinterpret_u32_u8(dst01_u8), 1);\n  vst1_lane_u32((uint32_t*)(dst + 2 * BPS), vreinterpret_u32_u8(dst23_u8), 0);\n  vst1_lane_u32((uint32_t*)(dst + 3 * BPS), vreinterpret_u32_u8(dst23_u8), 1);\n}\n\nstatic WEBP_INLINE void Add4x4(const int16x8_t row01, const int16x8_t row23,\n                               uint8_t* const dst) {\n  uint32x2_t dst01 = vdup_n_u32(0);\n  uint32x2_t dst23 = vdup_n_u32(0);\n\n  // Load the source pixels.\n  dst01 = vld1_lane_u32((uint32_t*)(dst + 0 * BPS), dst01, 0);\n  dst23 = vld1_lane_u32((uint32_t*)(dst + 2 * BPS), dst23, 0);\n  dst01 = vld1_lane_u32((uint32_t*)(dst + 1 * BPS), dst01, 1);\n  dst23 = vld1_lane_u32((uint32_t*)(dst + 3 * BPS), dst23, 1);\n\n  {\n    // Convert to 16b.\n    const int16x8_t dst01_s16 = ConvertU8ToS16(dst01);\n    const int16x8_t dst23_s16 = ConvertU8ToS16(dst23);\n\n    // Descale with rounding.\n    const int16x8_t out01 = vrsraq_n_s16(dst01_s16, row01, 3);\n    const int16x8_t out23 = vrsraq_n_s16(dst23_s16, row23, 3);\n    // Add the inverse transform.\n    SaturateAndStore4x4(dst, out01, out23);\n  }\n}\n\n//-----------------------------------------------------------------------------\n// Simple In-loop filtering (Paragraph 15.2)\n\nstatic uint8x16_t NeedsFilter(const uint8x16_t p1, const uint8x16_t p0,\n                              const uint8x16_t q0, const uint8x16_t q1,\n                              int thresh) {\n  const uint8x16_t thresh_v = vdupq_n_u8((uint8_t)thresh);\n  const uint8x16_t a_p0_q0 = vabdq_u8(p0, q0);               // abs(p0-q0)\n  const uint8x16_t a_p1_q1 = vabdq_u8(p1, q1);               // abs(p1-q1)\n  const uint8x16_t a_p0_q0_2 = vqaddq_u8(a_p0_q0, a_p0_q0);  // 2 * abs(p0-q0)\n  const uint8x16_t a_p1_q1_2 = vshrq_n_u8(a_p1_q1, 1);       // abs(p1-q1) / 2\n  const uint8x16_t sum = vqaddq_u8(a_p0_q0_2, a_p1_q1_2);\n  const uint8x16_t mask = vcgeq_u8(thresh_v, sum);\n  return mask;\n}\n\nstatic int8x16_t FlipSign(const uint8x16_t v) {\n  const uint8x16_t sign_bit = vdupq_n_u8(0x80);\n  return vreinterpretq_s8_u8(veorq_u8(v, sign_bit));\n}\n\nstatic uint8x16_t FlipSignBack(const int8x16_t v) {\n  const int8x16_t sign_bit = vdupq_n_s8(0x80);\n  return vreinterpretq_u8_s8(veorq_s8(v, sign_bit));\n}\n\nstatic int8x16_t GetBaseDelta(const int8x16_t p1, const int8x16_t p0,\n                              const int8x16_t q0, const int8x16_t q1) {\n  const int8x16_t q0_p0 = vqsubq_s8(q0, p0);      // (q0-p0)\n  const int8x16_t p1_q1 = vqsubq_s8(p1, q1);      // (p1-q1)\n  const int8x16_t s1 = vqaddq_s8(p1_q1, q0_p0);   // (p1-q1) + 1 * (q0 - p0)\n  const int8x16_t s2 = vqaddq_s8(q0_p0, s1);      // (p1-q1) + 2 * (q0 - p0)\n  const int8x16_t s3 = vqaddq_s8(q0_p0, s2);      // (p1-q1) + 3 * (q0 - p0)\n  return s3;\n}\n\nstatic int8x16_t GetBaseDelta0(const int8x16_t p0, const int8x16_t q0) {\n  const int8x16_t q0_p0 = vqsubq_s8(q0, p0);      // (q0-p0)\n  const int8x16_t s1 = vqaddq_s8(q0_p0, q0_p0);   // 2 * (q0 - p0)\n  const int8x16_t s2 = vqaddq_s8(q0_p0, s1);      // 3 * (q0 - p0)\n  return s2;\n}\n\n//------------------------------------------------------------------------------\n\nstatic void ApplyFilter2(const int8x16_t p0s, const int8x16_t q0s,\n                         const int8x16_t delta,\n                         uint8x16_t* const op0, uint8x16_t* const oq0) {\n  const int8x16_t kCst3 = vdupq_n_s8(0x03);\n  const int8x16_t kCst4 = vdupq_n_s8(0x04);\n  const int8x16_t delta_p3 = vqaddq_s8(delta, kCst3);\n  const int8x16_t delta_p4 = vqaddq_s8(delta, kCst4);\n  const int8x16_t delta3 = vshrq_n_s8(delta_p3, 3);\n  const int8x16_t delta4 = vshrq_n_s8(delta_p4, 3);\n  const int8x16_t sp0 = vqaddq_s8(p0s, delta3);\n  const int8x16_t sq0 = vqsubq_s8(q0s, delta4);\n  *op0 = FlipSignBack(sp0);\n  *oq0 = FlipSignBack(sq0);\n}\n\n#if defined(USE_INTRINSICS)\n\nstatic void DoFilter2(const uint8x16_t p1, const uint8x16_t p0,\n                      const uint8x16_t q0, const uint8x16_t q1,\n                      const uint8x16_t mask,\n                      uint8x16_t* const op0, uint8x16_t* const oq0) {\n  const int8x16_t p1s = FlipSign(p1);\n  const int8x16_t p0s = FlipSign(p0);\n  const int8x16_t q0s = FlipSign(q0);\n  const int8x16_t q1s = FlipSign(q1);\n  const int8x16_t delta0 = GetBaseDelta(p1s, p0s, q0s, q1s);\n  const int8x16_t delta1 = vandq_s8(delta0, vreinterpretq_s8_u8(mask));\n  ApplyFilter2(p0s, q0s, delta1, op0, oq0);\n}\n\nstatic void SimpleVFilter16(uint8_t* p, int stride, int thresh) {\n  uint8x16_t p1, p0, q0, q1, op0, oq0;\n  Load16x4(p, stride, &p1, &p0, &q0, &q1);\n  {\n    const uint8x16_t mask = NeedsFilter(p1, p0, q0, q1, thresh);\n    DoFilter2(p1, p0, q0, q1, mask, &op0, &oq0);\n  }\n  Store16x2(op0, oq0, p, stride);\n}\n\nstatic void SimpleHFilter16(uint8_t* p, int stride, int thresh) {\n  uint8x16_t p1, p0, q0, q1, oq0, op0;\n  Load4x16(p, stride, &p1, &p0, &q0, &q1);\n  {\n    const uint8x16_t mask = NeedsFilter(p1, p0, q0, q1, thresh);\n    DoFilter2(p1, p0, q0, q1, mask, &op0, &oq0);\n  }\n  Store2x16(op0, oq0, p, stride);\n}\n\n#else\n\n#define QRegs \"q0\", \"q1\", \"q2\", \"q3\",                                          \\\n              \"q8\", \"q9\", \"q10\", \"q11\", \"q12\", \"q13\", \"q14\", \"q15\"\n\n#define FLIP_SIGN_BIT2(a, b, s)                                                \\\n  \"veor     \" #a \",\" #a \",\" #s \"               \\n\"                             \\\n  \"veor     \" #b \",\" #b \",\" #s \"               \\n\"                             \\\n\n#define FLIP_SIGN_BIT4(a, b, c, d, s)                                          \\\n  FLIP_SIGN_BIT2(a, b, s)                                                      \\\n  FLIP_SIGN_BIT2(c, d, s)                                                      \\\n\n#define NEEDS_FILTER(p1, p0, q0, q1, thresh, mask)                             \\\n  \"vabd.u8    q15,\" #p0 \",\" #q0 \"         \\n\"  /* abs(p0 - q0) */              \\\n  \"vabd.u8    q14,\" #p1 \",\" #q1 \"         \\n\"  /* abs(p1 - q1) */              \\\n  \"vqadd.u8   q15, q15, q15               \\n\"  /* abs(p0 - q0) * 2 */          \\\n  \"vshr.u8    q14, q14, #1                \\n\"  /* abs(p1 - q1) / 2 */          \\\n  \"vqadd.u8   q15, q15, q14     \\n\"  /* abs(p0 - q0) * 2 + abs(p1 - q1) / 2 */ \\\n  \"vdup.8     q14, \" #thresh \"            \\n\"                                  \\\n  \"vcge.u8   \" #mask \", q14, q15          \\n\"  /* mask <= thresh */\n\n#define GET_BASE_DELTA(p1, p0, q0, q1, o)                                      \\\n  \"vqsub.s8   q15,\" #q0 \",\" #p0 \"         \\n\"  /* (q0 - p0) */                 \\\n  \"vqsub.s8  \" #o \",\" #p1 \",\" #q1 \"       \\n\"  /* (p1 - q1) */                 \\\n  \"vqadd.s8  \" #o \",\" #o \", q15           \\n\"  /* (p1 - q1) + 1 * (p0 - q0) */ \\\n  \"vqadd.s8  \" #o \",\" #o \", q15           \\n\"  /* (p1 - q1) + 2 * (p0 - q0) */ \\\n  \"vqadd.s8  \" #o \",\" #o \", q15           \\n\"  /* (p1 - q1) + 3 * (p0 - q0) */\n\n#define DO_SIMPLE_FILTER(p0, q0, fl)                                           \\\n  \"vmov.i8    q15, #0x03                  \\n\"                                  \\\n  \"vqadd.s8   q15, q15, \" #fl \"           \\n\"  /* filter1 = filter + 3 */      \\\n  \"vshr.s8    q15, q15, #3                \\n\"  /* filter1 >> 3 */              \\\n  \"vqadd.s8  \" #p0 \",\" #p0 \", q15         \\n\"  /* p0 += filter1 */             \\\n                                                                               \\\n  \"vmov.i8    q15, #0x04                  \\n\"                                  \\\n  \"vqadd.s8   q15, q15, \" #fl \"           \\n\"  /* filter1 = filter + 4 */      \\\n  \"vshr.s8    q15, q15, #3                \\n\"  /* filter2 >> 3 */              \\\n  \"vqsub.s8  \" #q0 \",\" #q0 \", q15         \\n\"  /* q0 -= filter2 */\n\n// Applies filter on 2 pixels (p0 and q0)\n#define DO_FILTER2(p1, p0, q0, q1, thresh)                                     \\\n  NEEDS_FILTER(p1, p0, q0, q1, thresh, q9)     /* filter mask in q9 */         \\\n  \"vmov.i8    q10, #0x80                  \\n\"  /* sign bit */                  \\\n  FLIP_SIGN_BIT4(p1, p0, q0, q1, q10)          /* convert to signed value */   \\\n  GET_BASE_DELTA(p1, p0, q0, q1, q11)          /* get filter level  */         \\\n  \"vand       q9, q9, q11                 \\n\"  /* apply filter mask */         \\\n  DO_SIMPLE_FILTER(p0, q0, q9)                 /* apply filter */              \\\n  FLIP_SIGN_BIT2(p0, q0, q10)\n\nstatic void SimpleVFilter16(uint8_t* p, int stride, int thresh) {\n  __asm__ volatile (\n    \"sub        %[p], %[p], %[stride], lsl #1  \\n\"  // p -= 2 * stride\n\n    \"vld1.u8    {q1}, [%[p]], %[stride]        \\n\"  // p1\n    \"vld1.u8    {q2}, [%[p]], %[stride]        \\n\"  // p0\n    \"vld1.u8    {q3}, [%[p]], %[stride]        \\n\"  // q0\n    \"vld1.u8    {q12}, [%[p]]                  \\n\"  // q1\n\n    DO_FILTER2(q1, q2, q3, q12, %[thresh])\n\n    \"sub        %[p], %[p], %[stride], lsl #1  \\n\"  // p -= 2 * stride\n\n    \"vst1.u8    {q2}, [%[p]], %[stride]        \\n\"  // store op0\n    \"vst1.u8    {q3}, [%[p]]                   \\n\"  // store oq0\n    : [p] \"+r\"(p)\n    : [stride] \"r\"(stride), [thresh] \"r\"(thresh)\n    : \"memory\", QRegs\n  );\n}\n\nstatic void SimpleHFilter16(uint8_t* p, int stride, int thresh) {\n  __asm__ volatile (\n    \"sub        r4, %[p], #2                   \\n\"  // base1 = p - 2\n    \"lsl        r6, %[stride], #1              \\n\"  // r6 = 2 * stride\n    \"add        r5, r4, %[stride]              \\n\"  // base2 = base1 + stride\n\n    LOAD8x4(d2, d3, d4, d5, [r4], [r5], r6)\n    LOAD8x4(d24, d25, d26, d27, [r4], [r5], r6)\n    \"vswp       d3, d24                        \\n\"  // p1:q1 p0:q3\n    \"vswp       d5, d26                        \\n\"  // q0:q2 q1:q4\n    \"vswp       q2, q12                        \\n\"  // p1:q1 p0:q2 q0:q3 q1:q4\n\n    DO_FILTER2(q1, q2, q12, q13, %[thresh])\n\n    \"sub        %[p], %[p], #1                 \\n\"  // p - 1\n\n    \"vswp        d5, d24                       \\n\"\n    STORE8x2(d4, d5, [%[p]], %[stride])\n    STORE8x2(d24, d25, [%[p]], %[stride])\n\n    : [p] \"+r\"(p)\n    : [stride] \"r\"(stride), [thresh] \"r\"(thresh)\n    : \"memory\", \"r4\", \"r5\", \"r6\", QRegs\n  );\n}\n\n#endif    // USE_INTRINSICS\n\nstatic void SimpleVFilter16i(uint8_t* p, int stride, int thresh) {\n  uint32_t k;\n  for (k = 3; k != 0; --k) {\n    p += 4 * stride;\n    SimpleVFilter16(p, stride, thresh);\n  }\n}\n\nstatic void SimpleHFilter16i(uint8_t* p, int stride, int thresh) {\n  uint32_t k;\n  for (k = 3; k != 0; --k) {\n    p += 4;\n    SimpleHFilter16(p, stride, thresh);\n  }\n}\n\n//------------------------------------------------------------------------------\n// Complex In-loop filtering (Paragraph 15.3)\n\nstatic uint8x16_t NeedsHev(const uint8x16_t p1, const uint8x16_t p0,\n                           const uint8x16_t q0, const uint8x16_t q1,\n                           int hev_thresh) {\n  const uint8x16_t hev_thresh_v = vdupq_n_u8((uint8_t)hev_thresh);\n  const uint8x16_t a_p1_p0 = vabdq_u8(p1, p0);  // abs(p1 - p0)\n  const uint8x16_t a_q1_q0 = vabdq_u8(q1, q0);  // abs(q1 - q0)\n  const uint8x16_t mask1 = vcgtq_u8(a_p1_p0, hev_thresh_v);\n  const uint8x16_t mask2 = vcgtq_u8(a_q1_q0, hev_thresh_v);\n  const uint8x16_t mask = vorrq_u8(mask1, mask2);\n  return mask;\n}\n\nstatic uint8x16_t NeedsFilter2(const uint8x16_t p3, const uint8x16_t p2,\n                               const uint8x16_t p1, const uint8x16_t p0,\n                               const uint8x16_t q0, const uint8x16_t q1,\n                               const uint8x16_t q2, const uint8x16_t q3,\n                               int ithresh, int thresh) {\n  const uint8x16_t ithresh_v = vdupq_n_u8((uint8_t)ithresh);\n  const uint8x16_t a_p3_p2 = vabdq_u8(p3, p2);  // abs(p3 - p2)\n  const uint8x16_t a_p2_p1 = vabdq_u8(p2, p1);  // abs(p2 - p1)\n  const uint8x16_t a_p1_p0 = vabdq_u8(p1, p0);  // abs(p1 - p0)\n  const uint8x16_t a_q3_q2 = vabdq_u8(q3, q2);  // abs(q3 - q2)\n  const uint8x16_t a_q2_q1 = vabdq_u8(q2, q1);  // abs(q2 - q1)\n  const uint8x16_t a_q1_q0 = vabdq_u8(q1, q0);  // abs(q1 - q0)\n  const uint8x16_t max1 = vmaxq_u8(a_p3_p2, a_p2_p1);\n  const uint8x16_t max2 = vmaxq_u8(a_p1_p0, a_q3_q2);\n  const uint8x16_t max3 = vmaxq_u8(a_q2_q1, a_q1_q0);\n  const uint8x16_t max12 = vmaxq_u8(max1, max2);\n  const uint8x16_t max123 = vmaxq_u8(max12, max3);\n  const uint8x16_t mask2 = vcgeq_u8(ithresh_v, max123);\n  const uint8x16_t mask1 = NeedsFilter(p1, p0, q0, q1, thresh);\n  const uint8x16_t mask = vandq_u8(mask1, mask2);\n  return mask;\n}\n\n//  4-points filter\n\nstatic void ApplyFilter4(\n    const int8x16_t p1, const int8x16_t p0,\n    const int8x16_t q0, const int8x16_t q1,\n    const int8x16_t delta0,\n    uint8x16_t* const op1, uint8x16_t* const op0,\n    uint8x16_t* const oq0, uint8x16_t* const oq1) {\n  const int8x16_t kCst3 = vdupq_n_s8(0x03);\n  const int8x16_t kCst4 = vdupq_n_s8(0x04);\n  const int8x16_t delta1 = vqaddq_s8(delta0, kCst4);\n  const int8x16_t delta2 = vqaddq_s8(delta0, kCst3);\n  const int8x16_t a1 = vshrq_n_s8(delta1, 3);\n  const int8x16_t a2 = vshrq_n_s8(delta2, 3);\n  const int8x16_t a3 = vrshrq_n_s8(a1, 1);   // a3 = (a1 + 1) >> 1\n  *op0 = FlipSignBack(vqaddq_s8(p0, a2));  // clip(p0 + a2)\n  *oq0 = FlipSignBack(vqsubq_s8(q0, a1));  // clip(q0 - a1)\n  *op1 = FlipSignBack(vqaddq_s8(p1, a3));  // clip(p1 + a3)\n  *oq1 = FlipSignBack(vqsubq_s8(q1, a3));  // clip(q1 - a3)\n}\n\nstatic void DoFilter4(\n    const uint8x16_t p1, const uint8x16_t p0,\n    const uint8x16_t q0, const uint8x16_t q1,\n    const uint8x16_t mask, const uint8x16_t hev_mask,\n    uint8x16_t* const op1, uint8x16_t* const op0,\n    uint8x16_t* const oq0, uint8x16_t* const oq1) {\n  // This is a fused version of DoFilter2() calling ApplyFilter2 directly\n  const int8x16_t p1s = FlipSign(p1);\n  int8x16_t p0s = FlipSign(p0);\n  int8x16_t q0s = FlipSign(q0);\n  const int8x16_t q1s = FlipSign(q1);\n  const uint8x16_t simple_lf_mask = vandq_u8(mask, hev_mask);\n\n  // do_filter2 part (simple loopfilter on pixels with hev)\n  {\n    const int8x16_t delta = GetBaseDelta(p1s, p0s, q0s, q1s);\n    const int8x16_t simple_lf_delta =\n        vandq_s8(delta, vreinterpretq_s8_u8(simple_lf_mask));\n    uint8x16_t tmp_p0, tmp_q0;\n    ApplyFilter2(p0s, q0s, simple_lf_delta, &tmp_p0, &tmp_q0);\n    // TODO(skal): avoid the double FlipSign() in ApplyFilter2() and here\n    p0s = FlipSign(tmp_p0);\n    q0s = FlipSign(tmp_q0);\n  }\n\n  // do_filter4 part (complex loopfilter on pixels without hev)\n  {\n    const int8x16_t delta0 = GetBaseDelta0(p0s, q0s);\n    // we use: (mask & hev_mask) ^ mask = mask & !hev_mask\n    const uint8x16_t complex_lf_mask = veorq_u8(simple_lf_mask, mask);\n    const int8x16_t complex_lf_delta =\n        vandq_s8(delta0, vreinterpretq_s8_u8(complex_lf_mask));\n    ApplyFilter4(p1s, p0s, q0s, q1s, complex_lf_delta, op1, op0, oq0, oq1);\n  }\n}\n\n//  6-points filter\n\nstatic void ApplyFilter6(\n    const int8x16_t p2, const int8x16_t p1, const int8x16_t p0,\n    const int8x16_t q0, const int8x16_t q1, const int8x16_t q2,\n    const int8x16_t delta,\n    uint8x16_t* const op2, uint8x16_t* const op1, uint8x16_t* const op0,\n    uint8x16_t* const oq0, uint8x16_t* const oq1, uint8x16_t* const oq2) {\n  const int16x8_t kCst63 = vdupq_n_s16(63);\n  const int8x8_t kCst27 = vdup_n_s8(27);\n  const int8x8_t kCst18 = vdup_n_s8(18);\n  const int8x8_t kCst9 = vdup_n_s8(9);\n  const int8x8_t delta_lo = vget_low_s8(delta);\n  const int8x8_t delta_hi = vget_high_s8(delta);\n  const int16x8_t s1_lo = vmlal_s8(kCst63, kCst27, delta_lo);  // 63 + 27 * a\n  const int16x8_t s1_hi = vmlal_s8(kCst63, kCst27, delta_hi);  // 63 + 27 * a\n  const int16x8_t s2_lo = vmlal_s8(kCst63, kCst18, delta_lo);  // 63 + 18 * a\n  const int16x8_t s2_hi = vmlal_s8(kCst63, kCst18, delta_hi);  // 63 + 18 * a\n  const int16x8_t s3_lo = vmlal_s8(kCst63, kCst9, delta_lo);   // 63 + 9 * a\n  const int16x8_t s3_hi = vmlal_s8(kCst63, kCst9, delta_hi);   // 63 + 9 * a\n  const int8x8_t a1_lo = vqshrn_n_s16(s1_lo, 7);\n  const int8x8_t a1_hi = vqshrn_n_s16(s1_hi, 7);\n  const int8x8_t a2_lo = vqshrn_n_s16(s2_lo, 7);\n  const int8x8_t a2_hi = vqshrn_n_s16(s2_hi, 7);\n  const int8x8_t a3_lo = vqshrn_n_s16(s3_lo, 7);\n  const int8x8_t a3_hi = vqshrn_n_s16(s3_hi, 7);\n  const int8x16_t a1 = vcombine_s8(a1_lo, a1_hi);\n  const int8x16_t a2 = vcombine_s8(a2_lo, a2_hi);\n  const int8x16_t a3 = vcombine_s8(a3_lo, a3_hi);\n\n  *op0 = FlipSignBack(vqaddq_s8(p0, a1));  // clip(p0 + a1)\n  *oq0 = FlipSignBack(vqsubq_s8(q0, a1));  // clip(q0 - q1)\n  *oq1 = FlipSignBack(vqsubq_s8(q1, a2));  // clip(q1 - a2)\n  *op1 = FlipSignBack(vqaddq_s8(p1, a2));  // clip(p1 + a2)\n  *oq2 = FlipSignBack(vqsubq_s8(q2, a3));  // clip(q2 - a3)\n  *op2 = FlipSignBack(vqaddq_s8(p2, a3));  // clip(p2 + a3)\n}\n\nstatic void DoFilter6(\n    const uint8x16_t p2, const uint8x16_t p1, const uint8x16_t p0,\n    const uint8x16_t q0, const uint8x16_t q1, const uint8x16_t q2,\n    const uint8x16_t mask, const uint8x16_t hev_mask,\n    uint8x16_t* const op2, uint8x16_t* const op1, uint8x16_t* const op0,\n    uint8x16_t* const oq0, uint8x16_t* const oq1, uint8x16_t* const oq2) {\n  // This is a fused version of DoFilter2() calling ApplyFilter2 directly\n  const int8x16_t p2s = FlipSign(p2);\n  const int8x16_t p1s = FlipSign(p1);\n  int8x16_t p0s = FlipSign(p0);\n  int8x16_t q0s = FlipSign(q0);\n  const int8x16_t q1s = FlipSign(q1);\n  const int8x16_t q2s = FlipSign(q2);\n  const uint8x16_t simple_lf_mask = vandq_u8(mask, hev_mask);\n  const int8x16_t delta0 = GetBaseDelta(p1s, p0s, q0s, q1s);\n\n  // do_filter2 part (simple loopfilter on pixels with hev)\n  {\n    const int8x16_t simple_lf_delta =\n        vandq_s8(delta0, vreinterpretq_s8_u8(simple_lf_mask));\n    uint8x16_t tmp_p0, tmp_q0;\n    ApplyFilter2(p0s, q0s, simple_lf_delta, &tmp_p0, &tmp_q0);\n    // TODO(skal): avoid the double FlipSign() in ApplyFilter2() and here\n    p0s = FlipSign(tmp_p0);\n    q0s = FlipSign(tmp_q0);\n  }\n\n  // do_filter6 part (complex loopfilter on pixels without hev)\n  {\n    // we use: (mask & hev_mask) ^ mask = mask & !hev_mask\n    const uint8x16_t complex_lf_mask = veorq_u8(simple_lf_mask, mask);\n    const int8x16_t complex_lf_delta =\n        vandq_s8(delta0, vreinterpretq_s8_u8(complex_lf_mask));\n    ApplyFilter6(p2s, p1s, p0s, q0s, q1s, q2s, complex_lf_delta,\n                 op2, op1, op0, oq0, oq1, oq2);\n  }\n}\n\n// on macroblock edges\n\nstatic void VFilter16(uint8_t* p, int stride,\n                      int thresh, int ithresh, int hev_thresh) {\n  uint8x16_t p3, p2, p1, p0, q0, q1, q2, q3;\n  Load16x8(p, stride, &p3, &p2, &p1, &p0, &q0, &q1, &q2, &q3);\n  {\n    const uint8x16_t mask = NeedsFilter2(p3, p2, p1, p0, q0, q1, q2, q3,\n                                         ithresh, thresh);\n    const uint8x16_t hev_mask = NeedsHev(p1, p0, q0, q1, hev_thresh);\n    uint8x16_t op2, op1, op0, oq0, oq1, oq2;\n    DoFilter6(p2, p1, p0, q0, q1, q2, mask, hev_mask,\n              &op2, &op1, &op0, &oq0, &oq1, &oq2);\n    Store16x2(op2, op1, p - 2 * stride, stride);\n    Store16x2(op0, oq0, p + 0 * stride, stride);\n    Store16x2(oq1, oq2, p + 2 * stride, stride);\n  }\n}\n\nstatic void HFilter16(uint8_t* p, int stride,\n                      int thresh, int ithresh, int hev_thresh) {\n  uint8x16_t p3, p2, p1, p0, q0, q1, q2, q3;\n  Load8x16(p, stride, &p3, &p2, &p1, &p0, &q0, &q1, &q2, &q3);\n  {\n    const uint8x16_t mask = NeedsFilter2(p3, p2, p1, p0, q0, q1, q2, q3,\n                                         ithresh, thresh);\n    const uint8x16_t hev_mask = NeedsHev(p1, p0, q0, q1, hev_thresh);\n    uint8x16_t op2, op1, op0, oq0, oq1, oq2;\n    DoFilter6(p2, p1, p0, q0, q1, q2, mask, hev_mask,\n              &op2, &op1, &op0, &oq0, &oq1, &oq2);\n    Store2x16(op2, op1, p - 2, stride);\n    Store2x16(op0, oq0, p + 0, stride);\n    Store2x16(oq1, oq2, p + 2, stride);\n  }\n}\n\n// on three inner edges\nstatic void VFilter16i(uint8_t* p, int stride,\n                       int thresh, int ithresh, int hev_thresh) {\n  uint32_t k;\n  uint8x16_t p3, p2, p1, p0;\n  Load16x4(p + 2  * stride, stride, &p3, &p2, &p1, &p0);\n  for (k = 3; k != 0; --k) {\n    uint8x16_t q0, q1, q2, q3;\n    p += 4 * stride;\n    Load16x4(p + 2  * stride, stride, &q0, &q1, &q2, &q3);\n    {\n      const uint8x16_t mask =\n          NeedsFilter2(p3, p2, p1, p0, q0, q1, q2, q3, ithresh, thresh);\n      const uint8x16_t hev_mask = NeedsHev(p1, p0, q0, q1, hev_thresh);\n      // p3 and p2 are not just temporary variables here: they will be\n      // re-used for next span. And q2/q3 will become p1/p0 accordingly.\n      DoFilter4(p1, p0, q0, q1, mask, hev_mask, &p1, &p0, &p3, &p2);\n      Store16x4(p1, p0, p3, p2, p, stride);\n      p1 = q2;\n      p0 = q3;\n    }\n  }\n}\n\n#if !defined(WORK_AROUND_GCC)\nstatic void HFilter16i(uint8_t* p, int stride,\n                       int thresh, int ithresh, int hev_thresh) {\n  uint32_t k;\n  uint8x16_t p3, p2, p1, p0;\n  Load4x16(p + 2, stride, &p3, &p2, &p1, &p0);\n  for (k = 3; k != 0; --k) {\n    uint8x16_t q0, q1, q2, q3;\n    p += 4;\n    Load4x16(p + 2, stride, &q0, &q1, &q2, &q3);\n    {\n      const uint8x16_t mask =\n          NeedsFilter2(p3, p2, p1, p0, q0, q1, q2, q3, ithresh, thresh);\n      const uint8x16_t hev_mask = NeedsHev(p1, p0, q0, q1, hev_thresh);\n      DoFilter4(p1, p0, q0, q1, mask, hev_mask, &p1, &p0, &p3, &p2);\n      Store4x16(p1, p0, p3, p2, p, stride);\n      p1 = q2;\n      p0 = q3;\n    }\n  }\n}\n#endif  // !WORK_AROUND_GCC\n\n// 8-pixels wide variant, for chroma filtering\nstatic void VFilter8(uint8_t* u, uint8_t* v, int stride,\n                     int thresh, int ithresh, int hev_thresh) {\n  uint8x16_t p3, p2, p1, p0, q0, q1, q2, q3;\n  Load8x8x2(u, v, stride, &p3, &p2, &p1, &p0, &q0, &q1, &q2, &q3);\n  {\n    const uint8x16_t mask = NeedsFilter2(p3, p2, p1, p0, q0, q1, q2, q3,\n                                         ithresh, thresh);\n    const uint8x16_t hev_mask = NeedsHev(p1, p0, q0, q1, hev_thresh);\n    uint8x16_t op2, op1, op0, oq0, oq1, oq2;\n    DoFilter6(p2, p1, p0, q0, q1, q2, mask, hev_mask,\n              &op2, &op1, &op0, &oq0, &oq1, &oq2);\n    Store8x2x2(op2, op1, u - 2 * stride, v - 2 * stride, stride);\n    Store8x2x2(op0, oq0, u + 0 * stride, v + 0 * stride, stride);\n    Store8x2x2(oq1, oq2, u + 2 * stride, v + 2 * stride, stride);\n  }\n}\nstatic void VFilter8i(uint8_t* u, uint8_t* v, int stride,\n                      int thresh, int ithresh, int hev_thresh) {\n  uint8x16_t p3, p2, p1, p0, q0, q1, q2, q3;\n  u += 4 * stride;\n  v += 4 * stride;\n  Load8x8x2(u, v, stride, &p3, &p2, &p1, &p0, &q0, &q1, &q2, &q3);\n  {\n    const uint8x16_t mask = NeedsFilter2(p3, p2, p1, p0, q0, q1, q2, q3,\n                                         ithresh, thresh);\n    const uint8x16_t hev_mask = NeedsHev(p1, p0, q0, q1, hev_thresh);\n    uint8x16_t op1, op0, oq0, oq1;\n    DoFilter4(p1, p0, q0, q1, mask, hev_mask, &op1, &op0, &oq0, &oq1);\n    Store8x4x2(op1, op0, oq0, oq1, u, v, stride);\n  }\n}\n\n#if !defined(WORK_AROUND_GCC)\nstatic void HFilter8(uint8_t* u, uint8_t* v, int stride,\n                     int thresh, int ithresh, int hev_thresh) {\n  uint8x16_t p3, p2, p1, p0, q0, q1, q2, q3;\n  Load8x8x2T(u, v, stride, &p3, &p2, &p1, &p0, &q0, &q1, &q2, &q3);\n  {\n    const uint8x16_t mask = NeedsFilter2(p3, p2, p1, p0, q0, q1, q2, q3,\n                                         ithresh, thresh);\n    const uint8x16_t hev_mask = NeedsHev(p1, p0, q0, q1, hev_thresh);\n    uint8x16_t op2, op1, op0, oq0, oq1, oq2;\n    DoFilter6(p2, p1, p0, q0, q1, q2, mask, hev_mask,\n              &op2, &op1, &op0, &oq0, &oq1, &oq2);\n    Store6x8x2(op2, op1, op0, oq0, oq1, oq2, u, v, stride);\n  }\n}\n\nstatic void HFilter8i(uint8_t* u, uint8_t* v, int stride,\n                      int thresh, int ithresh, int hev_thresh) {\n  uint8x16_t p3, p2, p1, p0, q0, q1, q2, q3;\n  u += 4;\n  v += 4;\n  Load8x8x2T(u, v, stride, &p3, &p2, &p1, &p0, &q0, &q1, &q2, &q3);\n  {\n    const uint8x16_t mask = NeedsFilter2(p3, p2, p1, p0, q0, q1, q2, q3,\n                                         ithresh, thresh);\n    const uint8x16_t hev_mask = NeedsHev(p1, p0, q0, q1, hev_thresh);\n    uint8x16_t op1, op0, oq0, oq1;\n    DoFilter4(p1, p0, q0, q1, mask, hev_mask, &op1, &op0, &oq0, &oq1);\n    Store4x8x2(op1, op0, oq0, oq1, u, v, stride);\n  }\n}\n#endif  // !WORK_AROUND_GCC\n\n//-----------------------------------------------------------------------------\n// Inverse transforms (Paragraph 14.4)\n\n// Technically these are unsigned but vqdmulh is only available in signed.\n// vqdmulh returns high half (effectively >> 16) but also doubles the value,\n// changing the >> 16 to >> 15 and requiring an additional >> 1.\n// We use this to our advantage with kC2. The canonical value is 35468.\n// However, the high bit is set so treating it as signed will give incorrect\n// results. We avoid this by down shifting by 1 here to clear the highest bit.\n// Combined with the doubling effect of vqdmulh we get >> 16.\n// This can not be applied to kC1 because the lowest bit is set. Down shifting\n// the constant would reduce precision.\n\n// libwebp uses a trick to avoid some extra addition that libvpx does.\n// Instead of:\n// temp2 = ip[12] + ((ip[12] * cospi8sqrt2minus1) >> 16);\n// libwebp adds 1 << 16 to cospi8sqrt2minus1 (kC1). However, this causes the\n// same issue with kC1 and vqdmulh that we work around by down shifting kC2\n\nstatic const int16_t kC1 = 20091;\nstatic const int16_t kC2 = 17734;  // half of kC2, actually. See comment above.\n\n#if defined(USE_INTRINSICS)\nstatic WEBP_INLINE void Transpose8x2(const int16x8_t in0, const int16x8_t in1,\n                                     int16x8x2_t* const out) {\n  // a0 a1 a2 a3 | b0 b1 b2 b3   => a0 b0 c0 d0 | a1 b1 c1 d1\n  // c0 c1 c2 c3 | d0 d1 d2 d3      a2 b2 c2 d2 | a3 b3 c3 d3\n  const int16x8x2_t tmp0 = vzipq_s16(in0, in1);   // a0 c0 a1 c1 a2 c2 ...\n                                                  // b0 d0 b1 d1 b2 d2 ...\n  *out = vzipq_s16(tmp0.val[0], tmp0.val[1]);\n}\n\nstatic WEBP_INLINE void TransformPass(int16x8x2_t* const rows) {\n  // {rows} = in0 | in4\n  //          in8 | in12\n  // B1 = in4 | in12\n  const int16x8_t B1 =\n      vcombine_s16(vget_high_s16(rows->val[0]), vget_high_s16(rows->val[1]));\n  // C0 = kC1 * in4 | kC1 * in12\n  // C1 = kC2 * in4 | kC2 * in12\n  const int16x8_t C0 = vsraq_n_s16(B1, vqdmulhq_n_s16(B1, kC1), 1);\n  const int16x8_t C1 = vqdmulhq_n_s16(B1, kC2);\n  const int16x4_t a = vqadd_s16(vget_low_s16(rows->val[0]),\n                                vget_low_s16(rows->val[1]));   // in0 + in8\n  const int16x4_t b = vqsub_s16(vget_low_s16(rows->val[0]),\n                                vget_low_s16(rows->val[1]));   // in0 - in8\n  // c = kC2 * in4 - kC1 * in12\n  // d = kC1 * in4 + kC2 * in12\n  const int16x4_t c = vqsub_s16(vget_low_s16(C1), vget_high_s16(C0));\n  const int16x4_t d = vqadd_s16(vget_low_s16(C0), vget_high_s16(C1));\n  const int16x8_t D0 = vcombine_s16(a, b);      // D0 = a | b\n  const int16x8_t D1 = vcombine_s16(d, c);      // D1 = d | c\n  const int16x8_t E0 = vqaddq_s16(D0, D1);      // a+d | b+c\n  const int16x8_t E_tmp = vqsubq_s16(D0, D1);   // a-d | b-c\n  const int16x8_t E1 = vcombine_s16(vget_high_s16(E_tmp), vget_low_s16(E_tmp));\n  Transpose8x2(E0, E1, rows);\n}\n\nstatic void TransformOne(const int16_t* in, uint8_t* dst) {\n  int16x8x2_t rows;\n  INIT_VECTOR2(rows, vld1q_s16(in + 0), vld1q_s16(in + 8));\n  TransformPass(&rows);\n  TransformPass(&rows);\n  Add4x4(rows.val[0], rows.val[1], dst);\n}\n\n#else\n\nstatic void TransformOne(const int16_t* in, uint8_t* dst) {\n  const int kBPS = BPS;\n  // kC1, kC2. Padded because vld1.16 loads 8 bytes\n  const int16_t constants[4] = { kC1, kC2, 0, 0 };\n  /* Adapted from libvpx: vp8/common/arm/neon/shortidct4x4llm_neon.asm */\n  __asm__ volatile (\n    \"vld1.16         {q1, q2}, [%[in]]           \\n\"\n    \"vld1.16         {d0}, [%[constants]]        \\n\"\n\n    /* d2: in[0]\n     * d3: in[8]\n     * d4: in[4]\n     * d5: in[12]\n     */\n    \"vswp            d3, d4                      \\n\"\n\n    /* q8 = {in[4], in[12]} * kC1 * 2 >> 16\n     * q9 = {in[4], in[12]} * kC2 >> 16\n     */\n    \"vqdmulh.s16     q8, q2, d0[0]               \\n\"\n    \"vqdmulh.s16     q9, q2, d0[1]               \\n\"\n\n    /* d22 = a = in[0] + in[8]\n     * d23 = b = in[0] - in[8]\n     */\n    \"vqadd.s16       d22, d2, d3                 \\n\"\n    \"vqsub.s16       d23, d2, d3                 \\n\"\n\n    /* The multiplication should be x * kC1 >> 16\n     * However, with vqdmulh we get x * kC1 * 2 >> 16\n     * (multiply, double, return high half)\n     * We avoided this in kC2 by pre-shifting the constant.\n     * q8 = in[4]/[12] * kC1 >> 16\n     */\n    \"vshr.s16        q8, q8, #1                  \\n\"\n\n    /* Add {in[4], in[12]} back after the multiplication. This is handled by\n     * adding 1 << 16 to kC1 in the libwebp C code.\n     */\n    \"vqadd.s16       q8, q2, q8                  \\n\"\n\n    /* d20 = c = in[4]*kC2 - in[12]*kC1\n     * d21 = d = in[4]*kC1 + in[12]*kC2\n     */\n    \"vqsub.s16       d20, d18, d17               \\n\"\n    \"vqadd.s16       d21, d19, d16               \\n\"\n\n    /* d2 = tmp[0] = a + d\n     * d3 = tmp[1] = b + c\n     * d4 = tmp[2] = b - c\n     * d5 = tmp[3] = a - d\n     */\n    \"vqadd.s16       d2, d22, d21                \\n\"\n    \"vqadd.s16       d3, d23, d20                \\n\"\n    \"vqsub.s16       d4, d23, d20                \\n\"\n    \"vqsub.s16       d5, d22, d21                \\n\"\n\n    \"vzip.16         q1, q2                      \\n\"\n    \"vzip.16         q1, q2                      \\n\"\n\n    \"vswp            d3, d4                      \\n\"\n\n    /* q8 = {tmp[4], tmp[12]} * kC1 * 2 >> 16\n     * q9 = {tmp[4], tmp[12]} * kC2 >> 16\n     */\n    \"vqdmulh.s16     q8, q2, d0[0]               \\n\"\n    \"vqdmulh.s16     q9, q2, d0[1]               \\n\"\n\n    /* d22 = a = tmp[0] + tmp[8]\n     * d23 = b = tmp[0] - tmp[8]\n     */\n    \"vqadd.s16       d22, d2, d3                 \\n\"\n    \"vqsub.s16       d23, d2, d3                 \\n\"\n\n    /* See long winded explanations prior */\n    \"vshr.s16        q8, q8, #1                  \\n\"\n    \"vqadd.s16       q8, q2, q8                  \\n\"\n\n    /* d20 = c = in[4]*kC2 - in[12]*kC1\n     * d21 = d = in[4]*kC1 + in[12]*kC2\n     */\n    \"vqsub.s16       d20, d18, d17               \\n\"\n    \"vqadd.s16       d21, d19, d16               \\n\"\n\n    /* d2 = tmp[0] = a + d\n     * d3 = tmp[1] = b + c\n     * d4 = tmp[2] = b - c\n     * d5 = tmp[3] = a - d\n     */\n    \"vqadd.s16       d2, d22, d21                \\n\"\n    \"vqadd.s16       d3, d23, d20                \\n\"\n    \"vqsub.s16       d4, d23, d20                \\n\"\n    \"vqsub.s16       d5, d22, d21                \\n\"\n\n    \"vld1.32         d6[0], [%[dst]], %[kBPS]    \\n\"\n    \"vld1.32         d6[1], [%[dst]], %[kBPS]    \\n\"\n    \"vld1.32         d7[0], [%[dst]], %[kBPS]    \\n\"\n    \"vld1.32         d7[1], [%[dst]], %[kBPS]    \\n\"\n\n    \"sub         %[dst], %[dst], %[kBPS], lsl #2 \\n\"\n\n    /* (val) + 4 >> 3 */\n    \"vrshr.s16       d2, d2, #3                  \\n\"\n    \"vrshr.s16       d3, d3, #3                  \\n\"\n    \"vrshr.s16       d4, d4, #3                  \\n\"\n    \"vrshr.s16       d5, d5, #3                  \\n\"\n\n    \"vzip.16         q1, q2                      \\n\"\n    \"vzip.16         q1, q2                      \\n\"\n\n    /* Must accumulate before saturating */\n    \"vmovl.u8        q8, d6                      \\n\"\n    \"vmovl.u8        q9, d7                      \\n\"\n\n    \"vqadd.s16       q1, q1, q8                  \\n\"\n    \"vqadd.s16       q2, q2, q9                  \\n\"\n\n    \"vqmovun.s16     d0, q1                      \\n\"\n    \"vqmovun.s16     d1, q2                      \\n\"\n\n    \"vst1.32         d0[0], [%[dst]], %[kBPS]    \\n\"\n    \"vst1.32         d0[1], [%[dst]], %[kBPS]    \\n\"\n    \"vst1.32         d1[0], [%[dst]], %[kBPS]    \\n\"\n    \"vst1.32         d1[1], [%[dst]]             \\n\"\n\n    : [in] \"+r\"(in), [dst] \"+r\"(dst)  /* modified registers */\n    : [kBPS] \"r\"(kBPS), [constants] \"r\"(constants)  /* constants */\n    : \"memory\", \"q0\", \"q1\", \"q2\", \"q8\", \"q9\", \"q10\", \"q11\"  /* clobbered */\n  );\n}\n\n#endif    // USE_INTRINSICS\n\nstatic void TransformTwo(const int16_t* in, uint8_t* dst, int do_two) {\n  TransformOne(in, dst);\n  if (do_two) {\n    TransformOne(in + 16, dst + 4);\n  }\n}\n\nstatic void TransformDC(const int16_t* in, uint8_t* dst) {\n  const int16x8_t DC = vdupq_n_s16(in[0]);\n  Add4x4(DC, DC, dst);\n}\n\n//------------------------------------------------------------------------------\n\n#define STORE_WHT(dst, col, rows) do {                  \\\n  *dst = vgetq_lane_s32(rows.val[0], col); (dst) += 16; \\\n  *dst = vgetq_lane_s32(rows.val[1], col); (dst) += 16; \\\n  *dst = vgetq_lane_s32(rows.val[2], col); (dst) += 16; \\\n  *dst = vgetq_lane_s32(rows.val[3], col); (dst) += 16; \\\n} while (0)\n\nstatic void TransformWHT(const int16_t* in, int16_t* out) {\n  int32x4x4_t tmp;\n\n  {\n    // Load the source.\n    const int16x4_t in00_03 = vld1_s16(in + 0);\n    const int16x4_t in04_07 = vld1_s16(in + 4);\n    const int16x4_t in08_11 = vld1_s16(in + 8);\n    const int16x4_t in12_15 = vld1_s16(in + 12);\n    const int32x4_t a0 = vaddl_s16(in00_03, in12_15);  // in[0..3] + in[12..15]\n    const int32x4_t a1 = vaddl_s16(in04_07, in08_11);  // in[4..7] + in[8..11]\n    const int32x4_t a2 = vsubl_s16(in04_07, in08_11);  // in[4..7] - in[8..11]\n    const int32x4_t a3 = vsubl_s16(in00_03, in12_15);  // in[0..3] - in[12..15]\n    tmp.val[0] = vaddq_s32(a0, a1);\n    tmp.val[1] = vaddq_s32(a3, a2);\n    tmp.val[2] = vsubq_s32(a0, a1);\n    tmp.val[3] = vsubq_s32(a3, a2);\n    // Arrange the temporary results column-wise.\n    tmp = Transpose4x4(tmp);\n  }\n\n  {\n    const int32x4_t kCst3 = vdupq_n_s32(3);\n    const int32x4_t dc = vaddq_s32(tmp.val[0], kCst3);  // add rounder\n    const int32x4_t a0 = vaddq_s32(dc, tmp.val[3]);\n    const int32x4_t a1 = vaddq_s32(tmp.val[1], tmp.val[2]);\n    const int32x4_t a2 = vsubq_s32(tmp.val[1], tmp.val[2]);\n    const int32x4_t a3 = vsubq_s32(dc, tmp.val[3]);\n\n    tmp.val[0] = vaddq_s32(a0, a1);\n    tmp.val[1] = vaddq_s32(a3, a2);\n    tmp.val[2] = vsubq_s32(a0, a1);\n    tmp.val[3] = vsubq_s32(a3, a2);\n\n    // right shift the results by 3.\n    tmp.val[0] = vshrq_n_s32(tmp.val[0], 3);\n    tmp.val[1] = vshrq_n_s32(tmp.val[1], 3);\n    tmp.val[2] = vshrq_n_s32(tmp.val[2], 3);\n    tmp.val[3] = vshrq_n_s32(tmp.val[3], 3);\n\n    STORE_WHT(out, 0, tmp);\n    STORE_WHT(out, 1, tmp);\n    STORE_WHT(out, 2, tmp);\n    STORE_WHT(out, 3, tmp);\n  }\n}\n\n#undef STORE_WHT\n\n//------------------------------------------------------------------------------\n\n#define MUL(a, b) (((a) * (b)) >> 16)\nstatic void TransformAC3(const int16_t* in, uint8_t* dst) {\n  static const int kC1_full = 20091 + (1 << 16);\n  static const int kC2_full = 35468;\n  const int16x4_t A = vdup_n_s16(in[0]);\n  const int16x4_t c4 = vdup_n_s16(MUL(in[4], kC2_full));\n  const int16x4_t d4 = vdup_n_s16(MUL(in[4], kC1_full));\n  const int c1 = MUL(in[1], kC2_full);\n  const int d1 = MUL(in[1], kC1_full);\n  const uint64_t cd = (uint64_t)( d1 & 0xffff) <<  0 |\n                      (uint64_t)( c1 & 0xffff) << 16 |\n                      (uint64_t)(-c1 & 0xffff) << 32 |\n                      (uint64_t)(-d1 & 0xffff) << 48;\n  const int16x4_t CD = vcreate_s16(cd);\n  const int16x4_t B = vqadd_s16(A, CD);\n  const int16x8_t m0_m1 = vcombine_s16(vqadd_s16(B, d4), vqadd_s16(B, c4));\n  const int16x8_t m2_m3 = vcombine_s16(vqsub_s16(B, c4), vqsub_s16(B, d4));\n  Add4x4(m0_m1, m2_m3, dst);\n}\n#undef MUL\n\n#endif   // WEBP_USE_NEON\n\n//------------------------------------------------------------------------------\n// Entry point\n\nextern void VP8DspInitNEON(void);\n\nvoid VP8DspInitNEON(void) {\n#if defined(WEBP_USE_NEON)\n  VP8Transform = TransformTwo;\n  VP8TransformAC3 = TransformAC3;\n  VP8TransformDC = TransformDC;\n  VP8TransformWHT = TransformWHT;\n\n  VP8VFilter16 = VFilter16;\n  VP8VFilter16i = VFilter16i;\n  VP8HFilter16 = HFilter16;\n#if !defined(WORK_AROUND_GCC)\n  VP8HFilter16i = HFilter16i;\n#endif\n  VP8VFilter8 = VFilter8;\n  VP8VFilter8i = VFilter8i;\n#if !defined(WORK_AROUND_GCC)\n  VP8HFilter8 = HFilter8;\n  VP8HFilter8i = HFilter8i;\n#endif\n  VP8SimpleVFilter16 = SimpleVFilter16;\n  VP8SimpleHFilter16 = SimpleHFilter16;\n  VP8SimpleVFilter16i = SimpleVFilter16i;\n  VP8SimpleHFilter16i = SimpleHFilter16i;\n#endif   // WEBP_USE_NEON\n}\n"
  },
  {
    "path": "ext/libwebp/dsp/dec_sse2.c",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// SSE2 version of some decoding functions (idct, loop filtering).\n//\n// Author: somnath@google.com (Somnath Banerjee)\n//         cduvivier@google.com (Christian Duvivier)\n\n#include \"./dsp.h\"\n\n#if defined(WEBP_USE_SSE2)\n\n// The 3-coeff sparse transform in SSE2 is not really faster than the plain-C\n// one it seems => disable it by default. Uncomment the following to enable:\n// #define USE_TRANSFORM_AC3\n\n#include <emmintrin.h>\n#include \"../dec/vp8i.h\"\n\n//------------------------------------------------------------------------------\n// Transforms (Paragraph 14.4)\n\nstatic void Transform(const int16_t* in, uint8_t* dst, int do_two) {\n  // This implementation makes use of 16-bit fixed point versions of two\n  // multiply constants:\n  //    K1 = sqrt(2) * cos (pi/8) ~= 85627 / 2^16\n  //    K2 = sqrt(2) * sin (pi/8) ~= 35468 / 2^16\n  //\n  // To be able to use signed 16-bit integers, we use the following trick to\n  // have constants within range:\n  // - Associated constants are obtained by subtracting the 16-bit fixed point\n  //   version of one:\n  //      k = K - (1 << 16)  =>  K = k + (1 << 16)\n  //      K1 = 85267  =>  k1 =  20091\n  //      K2 = 35468  =>  k2 = -30068\n  // - The multiplication of a variable by a constant become the sum of the\n  //   variable and the multiplication of that variable by the associated\n  //   constant:\n  //      (x * K) >> 16 = (x * (k + (1 << 16))) >> 16 = ((x * k ) >> 16) + x\n  const __m128i k1 = _mm_set1_epi16(20091);\n  const __m128i k2 = _mm_set1_epi16(-30068);\n  __m128i T0, T1, T2, T3;\n\n  // Load and concatenate the transform coefficients (we'll do two transforms\n  // in parallel). In the case of only one transform, the second half of the\n  // vectors will just contain random value we'll never use nor store.\n  __m128i in0, in1, in2, in3;\n  {\n    in0 = _mm_loadl_epi64((__m128i*)&in[0]);\n    in1 = _mm_loadl_epi64((__m128i*)&in[4]);\n    in2 = _mm_loadl_epi64((__m128i*)&in[8]);\n    in3 = _mm_loadl_epi64((__m128i*)&in[12]);\n    // a00 a10 a20 a30   x x x x\n    // a01 a11 a21 a31   x x x x\n    // a02 a12 a22 a32   x x x x\n    // a03 a13 a23 a33   x x x x\n    if (do_two) {\n      const __m128i inB0 = _mm_loadl_epi64((__m128i*)&in[16]);\n      const __m128i inB1 = _mm_loadl_epi64((__m128i*)&in[20]);\n      const __m128i inB2 = _mm_loadl_epi64((__m128i*)&in[24]);\n      const __m128i inB3 = _mm_loadl_epi64((__m128i*)&in[28]);\n      in0 = _mm_unpacklo_epi64(in0, inB0);\n      in1 = _mm_unpacklo_epi64(in1, inB1);\n      in2 = _mm_unpacklo_epi64(in2, inB2);\n      in3 = _mm_unpacklo_epi64(in3, inB3);\n      // a00 a10 a20 a30   b00 b10 b20 b30\n      // a01 a11 a21 a31   b01 b11 b21 b31\n      // a02 a12 a22 a32   b02 b12 b22 b32\n      // a03 a13 a23 a33   b03 b13 b23 b33\n    }\n  }\n\n  // Vertical pass and subsequent transpose.\n  {\n    // First pass, c and d calculations are longer because of the \"trick\"\n    // multiplications.\n    const __m128i a = _mm_add_epi16(in0, in2);\n    const __m128i b = _mm_sub_epi16(in0, in2);\n    // c = MUL(in1, K2) - MUL(in3, K1) = MUL(in1, k2) - MUL(in3, k1) + in1 - in3\n    const __m128i c1 = _mm_mulhi_epi16(in1, k2);\n    const __m128i c2 = _mm_mulhi_epi16(in3, k1);\n    const __m128i c3 = _mm_sub_epi16(in1, in3);\n    const __m128i c4 = _mm_sub_epi16(c1, c2);\n    const __m128i c = _mm_add_epi16(c3, c4);\n    // d = MUL(in1, K1) + MUL(in3, K2) = MUL(in1, k1) + MUL(in3, k2) + in1 + in3\n    const __m128i d1 = _mm_mulhi_epi16(in1, k1);\n    const __m128i d2 = _mm_mulhi_epi16(in3, k2);\n    const __m128i d3 = _mm_add_epi16(in1, in3);\n    const __m128i d4 = _mm_add_epi16(d1, d2);\n    const __m128i d = _mm_add_epi16(d3, d4);\n\n    // Second pass.\n    const __m128i tmp0 = _mm_add_epi16(a, d);\n    const __m128i tmp1 = _mm_add_epi16(b, c);\n    const __m128i tmp2 = _mm_sub_epi16(b, c);\n    const __m128i tmp3 = _mm_sub_epi16(a, d);\n\n    // Transpose the two 4x4.\n    // a00 a01 a02 a03   b00 b01 b02 b03\n    // a10 a11 a12 a13   b10 b11 b12 b13\n    // a20 a21 a22 a23   b20 b21 b22 b23\n    // a30 a31 a32 a33   b30 b31 b32 b33\n    const __m128i transpose0_0 = _mm_unpacklo_epi16(tmp0, tmp1);\n    const __m128i transpose0_1 = _mm_unpacklo_epi16(tmp2, tmp3);\n    const __m128i transpose0_2 = _mm_unpackhi_epi16(tmp0, tmp1);\n    const __m128i transpose0_3 = _mm_unpackhi_epi16(tmp2, tmp3);\n    // a00 a10 a01 a11   a02 a12 a03 a13\n    // a20 a30 a21 a31   a22 a32 a23 a33\n    // b00 b10 b01 b11   b02 b12 b03 b13\n    // b20 b30 b21 b31   b22 b32 b23 b33\n    const __m128i transpose1_0 = _mm_unpacklo_epi32(transpose0_0, transpose0_1);\n    const __m128i transpose1_1 = _mm_unpacklo_epi32(transpose0_2, transpose0_3);\n    const __m128i transpose1_2 = _mm_unpackhi_epi32(transpose0_0, transpose0_1);\n    const __m128i transpose1_3 = _mm_unpackhi_epi32(transpose0_2, transpose0_3);\n    // a00 a10 a20 a30 a01 a11 a21 a31\n    // b00 b10 b20 b30 b01 b11 b21 b31\n    // a02 a12 a22 a32 a03 a13 a23 a33\n    // b02 b12 a22 b32 b03 b13 b23 b33\n    T0 = _mm_unpacklo_epi64(transpose1_0, transpose1_1);\n    T1 = _mm_unpackhi_epi64(transpose1_0, transpose1_1);\n    T2 = _mm_unpacklo_epi64(transpose1_2, transpose1_3);\n    T3 = _mm_unpackhi_epi64(transpose1_2, transpose1_3);\n    // a00 a10 a20 a30   b00 b10 b20 b30\n    // a01 a11 a21 a31   b01 b11 b21 b31\n    // a02 a12 a22 a32   b02 b12 b22 b32\n    // a03 a13 a23 a33   b03 b13 b23 b33\n  }\n\n  // Horizontal pass and subsequent transpose.\n  {\n    // First pass, c and d calculations are longer because of the \"trick\"\n    // multiplications.\n    const __m128i four = _mm_set1_epi16(4);\n    const __m128i dc = _mm_add_epi16(T0, four);\n    const __m128i a =  _mm_add_epi16(dc, T2);\n    const __m128i b =  _mm_sub_epi16(dc, T2);\n    // c = MUL(T1, K2) - MUL(T3, K1) = MUL(T1, k2) - MUL(T3, k1) + T1 - T3\n    const __m128i c1 = _mm_mulhi_epi16(T1, k2);\n    const __m128i c2 = _mm_mulhi_epi16(T3, k1);\n    const __m128i c3 = _mm_sub_epi16(T1, T3);\n    const __m128i c4 = _mm_sub_epi16(c1, c2);\n    const __m128i c = _mm_add_epi16(c3, c4);\n    // d = MUL(T1, K1) + MUL(T3, K2) = MUL(T1, k1) + MUL(T3, k2) + T1 + T3\n    const __m128i d1 = _mm_mulhi_epi16(T1, k1);\n    const __m128i d2 = _mm_mulhi_epi16(T3, k2);\n    const __m128i d3 = _mm_add_epi16(T1, T3);\n    const __m128i d4 = _mm_add_epi16(d1, d2);\n    const __m128i d = _mm_add_epi16(d3, d4);\n\n    // Second pass.\n    const __m128i tmp0 = _mm_add_epi16(a, d);\n    const __m128i tmp1 = _mm_add_epi16(b, c);\n    const __m128i tmp2 = _mm_sub_epi16(b, c);\n    const __m128i tmp3 = _mm_sub_epi16(a, d);\n    const __m128i shifted0 = _mm_srai_epi16(tmp0, 3);\n    const __m128i shifted1 = _mm_srai_epi16(tmp1, 3);\n    const __m128i shifted2 = _mm_srai_epi16(tmp2, 3);\n    const __m128i shifted3 = _mm_srai_epi16(tmp3, 3);\n\n    // Transpose the two 4x4.\n    // a00 a01 a02 a03   b00 b01 b02 b03\n    // a10 a11 a12 a13   b10 b11 b12 b13\n    // a20 a21 a22 a23   b20 b21 b22 b23\n    // a30 a31 a32 a33   b30 b31 b32 b33\n    const __m128i transpose0_0 = _mm_unpacklo_epi16(shifted0, shifted1);\n    const __m128i transpose0_1 = _mm_unpacklo_epi16(shifted2, shifted3);\n    const __m128i transpose0_2 = _mm_unpackhi_epi16(shifted0, shifted1);\n    const __m128i transpose0_3 = _mm_unpackhi_epi16(shifted2, shifted3);\n    // a00 a10 a01 a11   a02 a12 a03 a13\n    // a20 a30 a21 a31   a22 a32 a23 a33\n    // b00 b10 b01 b11   b02 b12 b03 b13\n    // b20 b30 b21 b31   b22 b32 b23 b33\n    const __m128i transpose1_0 = _mm_unpacklo_epi32(transpose0_0, transpose0_1);\n    const __m128i transpose1_1 = _mm_unpacklo_epi32(transpose0_2, transpose0_3);\n    const __m128i transpose1_2 = _mm_unpackhi_epi32(transpose0_0, transpose0_1);\n    const __m128i transpose1_3 = _mm_unpackhi_epi32(transpose0_2, transpose0_3);\n    // a00 a10 a20 a30 a01 a11 a21 a31\n    // b00 b10 b20 b30 b01 b11 b21 b31\n    // a02 a12 a22 a32 a03 a13 a23 a33\n    // b02 b12 a22 b32 b03 b13 b23 b33\n    T0 = _mm_unpacklo_epi64(transpose1_0, transpose1_1);\n    T1 = _mm_unpackhi_epi64(transpose1_0, transpose1_1);\n    T2 = _mm_unpacklo_epi64(transpose1_2, transpose1_3);\n    T3 = _mm_unpackhi_epi64(transpose1_2, transpose1_3);\n    // a00 a10 a20 a30   b00 b10 b20 b30\n    // a01 a11 a21 a31   b01 b11 b21 b31\n    // a02 a12 a22 a32   b02 b12 b22 b32\n    // a03 a13 a23 a33   b03 b13 b23 b33\n  }\n\n  // Add inverse transform to 'dst' and store.\n  {\n    const __m128i zero = _mm_setzero_si128();\n    // Load the reference(s).\n    __m128i dst0, dst1, dst2, dst3;\n    if (do_two) {\n      // Load eight bytes/pixels per line.\n      dst0 = _mm_loadl_epi64((__m128i*)(dst + 0 * BPS));\n      dst1 = _mm_loadl_epi64((__m128i*)(dst + 1 * BPS));\n      dst2 = _mm_loadl_epi64((__m128i*)(dst + 2 * BPS));\n      dst3 = _mm_loadl_epi64((__m128i*)(dst + 3 * BPS));\n    } else {\n      // Load four bytes/pixels per line.\n      dst0 = _mm_cvtsi32_si128(*(int*)(dst + 0 * BPS));\n      dst1 = _mm_cvtsi32_si128(*(int*)(dst + 1 * BPS));\n      dst2 = _mm_cvtsi32_si128(*(int*)(dst + 2 * BPS));\n      dst3 = _mm_cvtsi32_si128(*(int*)(dst + 3 * BPS));\n    }\n    // Convert to 16b.\n    dst0 = _mm_unpacklo_epi8(dst0, zero);\n    dst1 = _mm_unpacklo_epi8(dst1, zero);\n    dst2 = _mm_unpacklo_epi8(dst2, zero);\n    dst3 = _mm_unpacklo_epi8(dst3, zero);\n    // Add the inverse transform(s).\n    dst0 = _mm_add_epi16(dst0, T0);\n    dst1 = _mm_add_epi16(dst1, T1);\n    dst2 = _mm_add_epi16(dst2, T2);\n    dst3 = _mm_add_epi16(dst3, T3);\n    // Unsigned saturate to 8b.\n    dst0 = _mm_packus_epi16(dst0, dst0);\n    dst1 = _mm_packus_epi16(dst1, dst1);\n    dst2 = _mm_packus_epi16(dst2, dst2);\n    dst3 = _mm_packus_epi16(dst3, dst3);\n    // Store the results.\n    if (do_two) {\n      // Store eight bytes/pixels per line.\n      _mm_storel_epi64((__m128i*)(dst + 0 * BPS), dst0);\n      _mm_storel_epi64((__m128i*)(dst + 1 * BPS), dst1);\n      _mm_storel_epi64((__m128i*)(dst + 2 * BPS), dst2);\n      _mm_storel_epi64((__m128i*)(dst + 3 * BPS), dst3);\n    } else {\n      // Store four bytes/pixels per line.\n      *(int*)(dst + 0 * BPS) = _mm_cvtsi128_si32(dst0);\n      *(int*)(dst + 1 * BPS) = _mm_cvtsi128_si32(dst1);\n      *(int*)(dst + 2 * BPS) = _mm_cvtsi128_si32(dst2);\n      *(int*)(dst + 3 * BPS) = _mm_cvtsi128_si32(dst3);\n    }\n  }\n}\n\n#if defined(USE_TRANSFORM_AC3)\n#define MUL(a, b) (((a) * (b)) >> 16)\nstatic void TransformAC3(const int16_t* in, uint8_t* dst) {\n  static const int kC1 = 20091 + (1 << 16);\n  static const int kC2 = 35468;\n  const __m128i A = _mm_set1_epi16(in[0] + 4);\n  const __m128i c4 = _mm_set1_epi16(MUL(in[4], kC2));\n  const __m128i d4 = _mm_set1_epi16(MUL(in[4], kC1));\n  const int c1 = MUL(in[1], kC2);\n  const int d1 = MUL(in[1], kC1);\n  const __m128i CD = _mm_set_epi16(0, 0, 0, 0, -d1, -c1, c1, d1);\n  const __m128i B = _mm_adds_epi16(A, CD);\n  const __m128i m0 = _mm_adds_epi16(B, d4);\n  const __m128i m1 = _mm_adds_epi16(B, c4);\n  const __m128i m2 = _mm_subs_epi16(B, c4);\n  const __m128i m3 = _mm_subs_epi16(B, d4);\n  const __m128i zero = _mm_setzero_si128();\n  // Load the source pixels.\n  __m128i dst0 = _mm_cvtsi32_si128(*(int*)(dst + 0 * BPS));\n  __m128i dst1 = _mm_cvtsi32_si128(*(int*)(dst + 1 * BPS));\n  __m128i dst2 = _mm_cvtsi32_si128(*(int*)(dst + 2 * BPS));\n  __m128i dst3 = _mm_cvtsi32_si128(*(int*)(dst + 3 * BPS));\n  // Convert to 16b.\n  dst0 = _mm_unpacklo_epi8(dst0, zero);\n  dst1 = _mm_unpacklo_epi8(dst1, zero);\n  dst2 = _mm_unpacklo_epi8(dst2, zero);\n  dst3 = _mm_unpacklo_epi8(dst3, zero);\n  // Add the inverse transform.\n  dst0 = _mm_adds_epi16(dst0, _mm_srai_epi16(m0, 3));\n  dst1 = _mm_adds_epi16(dst1, _mm_srai_epi16(m1, 3));\n  dst2 = _mm_adds_epi16(dst2, _mm_srai_epi16(m2, 3));\n  dst3 = _mm_adds_epi16(dst3, _mm_srai_epi16(m3, 3));\n  // Unsigned saturate to 8b.\n  dst0 = _mm_packus_epi16(dst0, dst0);\n  dst1 = _mm_packus_epi16(dst1, dst1);\n  dst2 = _mm_packus_epi16(dst2, dst2);\n  dst3 = _mm_packus_epi16(dst3, dst3);\n  // Store the results.\n  *(int*)(dst + 0 * BPS) = _mm_cvtsi128_si32(dst0);\n  *(int*)(dst + 1 * BPS) = _mm_cvtsi128_si32(dst1);\n  *(int*)(dst + 2 * BPS) = _mm_cvtsi128_si32(dst2);\n  *(int*)(dst + 3 * BPS) = _mm_cvtsi128_si32(dst3);\n}\n#undef MUL\n#endif   // USE_TRANSFORM_AC3\n\n//------------------------------------------------------------------------------\n// Loop Filter (Paragraph 15)\n\n// Compute abs(p - q) = subs(p - q) OR subs(q - p)\n#define MM_ABS(p, q)  _mm_or_si128(                                            \\\n    _mm_subs_epu8((q), (p)),                                                   \\\n    _mm_subs_epu8((p), (q)))\n\n// Shift each byte of \"x\" by 3 bits while preserving by the sign bit.\nstatic WEBP_INLINE void SignedShift8b(__m128i* const x) {\n  const __m128i zero = _mm_setzero_si128();\n  const __m128i signs = _mm_cmpgt_epi8(zero, *x);\n  const __m128i lo_0 = _mm_unpacklo_epi8(*x, signs);  // s8 -> s16 sign extend\n  const __m128i hi_0 = _mm_unpackhi_epi8(*x, signs);\n  const __m128i lo_1 = _mm_srai_epi16(lo_0, 3);\n  const __m128i hi_1 = _mm_srai_epi16(hi_0, 3);\n  *x = _mm_packs_epi16(lo_1, hi_1);\n}\n\n#define FLIP_SIGN_BIT2(a, b) {                                                 \\\n  a = _mm_xor_si128(a, sign_bit);                                              \\\n  b = _mm_xor_si128(b, sign_bit);                                              \\\n}\n\n#define FLIP_SIGN_BIT4(a, b, c, d) {                                           \\\n  FLIP_SIGN_BIT2(a, b);                                                        \\\n  FLIP_SIGN_BIT2(c, d);                                                        \\\n}\n\n// input/output is uint8_t\nstatic WEBP_INLINE void GetNotHEV(const __m128i* const p1,\n                                  const __m128i* const p0,\n                                  const __m128i* const q0,\n                                  const __m128i* const q1,\n                                  int hev_thresh, __m128i* const not_hev) {\n  const __m128i zero = _mm_setzero_si128();\n  const __m128i t_1 = MM_ABS(*p1, *p0);\n  const __m128i t_2 = MM_ABS(*q1, *q0);\n\n  const __m128i h = _mm_set1_epi8(hev_thresh);\n  const __m128i t_3 = _mm_subs_epu8(t_1, h);  // abs(p1 - p0) - hev_tresh\n  const __m128i t_4 = _mm_subs_epu8(t_2, h);  // abs(q1 - q0) - hev_tresh\n\n  *not_hev = _mm_or_si128(t_3, t_4);\n  *not_hev = _mm_cmpeq_epi8(*not_hev, zero);  // not_hev <= t1 && not_hev <= t2\n}\n\n// input pixels are int8_t\nstatic WEBP_INLINE void GetBaseDelta(const __m128i* const p1,\n                                     const __m128i* const p0,\n                                     const __m128i* const q0,\n                                     const __m128i* const q1,\n                                     __m128i* const delta) {\n  // beware of addition order, for saturation!\n  const __m128i p1_q1 = _mm_subs_epi8(*p1, *q1);   // p1 - q1\n  const __m128i q0_p0 = _mm_subs_epi8(*q0, *p0);   // q0 - p0\n  const __m128i s1 = _mm_adds_epi8(p1_q1, q0_p0);  // p1 - q1 + 1 * (q0 - p0)\n  const __m128i s2 = _mm_adds_epi8(q0_p0, s1);     // p1 - q1 + 2 * (q0 - p0)\n  const __m128i s3 = _mm_adds_epi8(q0_p0, s2);     // p1 - q1 + 3 * (q0 - p0)\n  *delta = s3;\n}\n\n// input and output are int8_t\nstatic WEBP_INLINE void DoSimpleFilter(__m128i* const p0, __m128i* const q0,\n                                       const __m128i* const fl) {\n  const __m128i k3 = _mm_set1_epi8(3);\n  const __m128i k4 = _mm_set1_epi8(4);\n  __m128i v3 = _mm_adds_epi8(*fl, k3);\n  __m128i v4 = _mm_adds_epi8(*fl, k4);\n\n  SignedShift8b(&v4);                  // v4 >> 3\n  SignedShift8b(&v3);                  // v3 >> 3\n  *q0 = _mm_subs_epi8(*q0, v4);        // q0 -= v4\n  *p0 = _mm_adds_epi8(*p0, v3);        // p0 += v3\n}\n\n// Updates values of 2 pixels at MB edge during complex filtering.\n// Update operations:\n// q = q - delta and p = p + delta; where delta = [(a_hi >> 7), (a_lo >> 7)]\n// Pixels 'pi' and 'qi' are int8_t on input, uint8_t on output (sign flip).\nstatic WEBP_INLINE void Update2Pixels(__m128i* const pi, __m128i* const qi,\n                                      const __m128i* const a0_lo,\n                                      const __m128i* const a0_hi) {\n  const __m128i a1_lo = _mm_srai_epi16(*a0_lo, 7);\n  const __m128i a1_hi = _mm_srai_epi16(*a0_hi, 7);\n  const __m128i delta = _mm_packs_epi16(a1_lo, a1_hi);\n  const __m128i sign_bit = _mm_set1_epi8(0x80);\n  *pi = _mm_adds_epi8(*pi, delta);\n  *qi = _mm_subs_epi8(*qi, delta);\n  FLIP_SIGN_BIT2(*pi, *qi);\n}\n\n// input pixels are uint8_t\nstatic WEBP_INLINE void NeedsFilter(const __m128i* const p1,\n                                    const __m128i* const p0,\n                                    const __m128i* const q0,\n                                    const __m128i* const q1,\n                                    int thresh, __m128i* const mask) {\n  const __m128i m_thresh = _mm_set1_epi8(thresh);\n  const __m128i t1 = MM_ABS(*p1, *q1);        // abs(p1 - q1)\n  const __m128i kFE = _mm_set1_epi8(0xFE);\n  const __m128i t2 = _mm_and_si128(t1, kFE);  // set lsb of each byte to zero\n  const __m128i t3 = _mm_srli_epi16(t2, 1);   // abs(p1 - q1) / 2\n\n  const __m128i t4 = MM_ABS(*p0, *q0);        // abs(p0 - q0)\n  const __m128i t5 = _mm_adds_epu8(t4, t4);   // abs(p0 - q0) * 2\n  const __m128i t6 = _mm_adds_epu8(t5, t3);   // abs(p0-q0)*2 + abs(p1-q1)/2\n\n  const __m128i t7 = _mm_subs_epu8(t6, m_thresh);  // mask <= m_thresh\n  *mask = _mm_cmpeq_epi8(t7, _mm_setzero_si128());\n}\n\n//------------------------------------------------------------------------------\n// Edge filtering functions\n\n// Applies filter on 2 pixels (p0 and q0)\nstatic WEBP_INLINE void DoFilter2(__m128i* const p1, __m128i* const p0,\n                                  __m128i* const q0, __m128i* const q1,\n                                  int thresh) {\n  __m128i a, mask;\n  const __m128i sign_bit = _mm_set1_epi8(0x80);\n  // convert p1/q1 to int8_t (for GetBaseDelta)\n  const __m128i p1s = _mm_xor_si128(*p1, sign_bit);\n  const __m128i q1s = _mm_xor_si128(*q1, sign_bit);\n\n  NeedsFilter(p1, p0, q0, q1, thresh, &mask);\n\n  FLIP_SIGN_BIT2(*p0, *q0);\n  GetBaseDelta(&p1s, p0, q0, &q1s, &a);\n  a = _mm_and_si128(a, mask);     // mask filter values we don't care about\n  DoSimpleFilter(p0, q0, &a);\n  FLIP_SIGN_BIT2(*p0, *q0);\n}\n\n// Applies filter on 4 pixels (p1, p0, q0 and q1)\nstatic WEBP_INLINE void DoFilter4(__m128i* const p1, __m128i* const p0,\n                                  __m128i* const q0, __m128i* const q1,\n                                  const __m128i* const mask, int hev_thresh) {\n  const __m128i sign_bit = _mm_set1_epi8(0x80);\n  const __m128i k64 = _mm_set1_epi8(0x40);\n  const __m128i zero = _mm_setzero_si128();\n  __m128i not_hev;\n  __m128i t1, t2, t3;\n\n  // compute hev mask\n  GetNotHEV(p1, p0, q0, q1, hev_thresh, &not_hev);\n\n  // convert to signed values\n  FLIP_SIGN_BIT4(*p1, *p0, *q0, *q1);\n\n  t1 = _mm_subs_epi8(*p1, *q1);        // p1 - q1\n  t1 = _mm_andnot_si128(not_hev, t1);  // hev(p1 - q1)\n  t2 = _mm_subs_epi8(*q0, *p0);        // q0 - p0\n  t1 = _mm_adds_epi8(t1, t2);          // hev(p1 - q1) + 1 * (q0 - p0)\n  t1 = _mm_adds_epi8(t1, t2);          // hev(p1 - q1) + 2 * (q0 - p0)\n  t1 = _mm_adds_epi8(t1, t2);          // hev(p1 - q1) + 3 * (q0 - p0)\n  t1 = _mm_and_si128(t1, *mask);       // mask filter values we don't care about\n\n  t2 = _mm_set1_epi8(3);\n  t3 = _mm_set1_epi8(4);\n  t2 = _mm_adds_epi8(t1, t2);        // 3 * (q0 - p0) + (p1 - q1) + 3\n  t3 = _mm_adds_epi8(t1, t3);        // 3 * (q0 - p0) + (p1 - q1) + 4\n  SignedShift8b(&t2);                // (3 * (q0 - p0) + hev(p1 - q1) + 3) >> 3\n  SignedShift8b(&t3);                // (3 * (q0 - p0) + hev(p1 - q1) + 4) >> 3\n  *p0 = _mm_adds_epi8(*p0, t2);      // p0 += t2\n  *q0 = _mm_subs_epi8(*q0, t3);      // q0 -= t3\n  FLIP_SIGN_BIT2(*p0, *q0);\n\n  // this is equivalent to signed (a + 1) >> 1 calculation\n  t2 = _mm_add_epi8(t3, sign_bit);\n  t3 = _mm_avg_epu8(t2, zero);\n  t3 = _mm_sub_epi8(t3, k64);\n\n  t3 = _mm_and_si128(not_hev, t3);   // if !hev\n  *q1 = _mm_subs_epi8(*q1, t3);      // q1 -= t3\n  *p1 = _mm_adds_epi8(*p1, t3);      // p1 += t3\n  FLIP_SIGN_BIT2(*p1, *q1);\n}\n\n// Applies filter on 6 pixels (p2, p1, p0, q0, q1 and q2)\nstatic WEBP_INLINE void DoFilter6(__m128i* const p2, __m128i* const p1,\n                                  __m128i* const p0, __m128i* const q0,\n                                  __m128i* const q1, __m128i* const q2,\n                                  const __m128i* const mask, int hev_thresh) {\n  const __m128i zero = _mm_setzero_si128();\n  const __m128i sign_bit = _mm_set1_epi8(0x80);\n  __m128i a, not_hev;\n\n  // compute hev mask\n  GetNotHEV(p1, p0, q0, q1, hev_thresh, &not_hev);\n\n  FLIP_SIGN_BIT4(*p1, *p0, *q0, *q1);\n  FLIP_SIGN_BIT2(*p2, *q2);\n  GetBaseDelta(p1, p0, q0, q1, &a);\n\n  { // do simple filter on pixels with hev\n    const __m128i m = _mm_andnot_si128(not_hev, *mask);\n    const __m128i f = _mm_and_si128(a, m);\n    DoSimpleFilter(p0, q0, &f);\n  }\n\n  { // do strong filter on pixels with not hev\n    const __m128i k9 = _mm_set1_epi16(0x0900);\n    const __m128i k63 = _mm_set1_epi16(63);\n\n    const __m128i m = _mm_and_si128(not_hev, *mask);\n    const __m128i f = _mm_and_si128(a, m);\n\n    const __m128i f_lo = _mm_unpacklo_epi8(zero, f);\n    const __m128i f_hi = _mm_unpackhi_epi8(zero, f);\n\n    const __m128i f9_lo = _mm_mulhi_epi16(f_lo, k9);    // Filter (lo) * 9\n    const __m128i f9_hi = _mm_mulhi_epi16(f_hi, k9);    // Filter (hi) * 9\n\n    const __m128i a2_lo = _mm_add_epi16(f9_lo, k63);    // Filter * 9 + 63\n    const __m128i a2_hi = _mm_add_epi16(f9_hi, k63);    // Filter * 9 + 63\n\n    const __m128i a1_lo = _mm_add_epi16(a2_lo, f9_lo);  // Filter * 18 + 63\n    const __m128i a1_hi = _mm_add_epi16(a2_hi, f9_hi);  // Filter * 18 + 63\n\n    const __m128i a0_lo = _mm_add_epi16(a1_lo, f9_lo);  // Filter * 27 + 63\n    const __m128i a0_hi = _mm_add_epi16(a1_hi, f9_hi);  // Filter * 27 + 63\n\n    Update2Pixels(p2, q2, &a2_lo, &a2_hi);\n    Update2Pixels(p1, q1, &a1_lo, &a1_hi);\n    Update2Pixels(p0, q0, &a0_lo, &a0_hi);\n  }\n}\n\n// reads 8 rows across a vertical edge.\n//\n// TODO(somnath): Investigate _mm_shuffle* also see if it can be broken into\n// two Load4x4() to avoid code duplication.\nstatic WEBP_INLINE void Load8x4(const uint8_t* const b, int stride,\n                                __m128i* const p, __m128i* const q) {\n  __m128i t1, t2;\n\n  // Load 0th, 1st, 4th and 5th rows\n  __m128i r0 =  _mm_cvtsi32_si128(*((int*)&b[0 * stride]));  // 03 02 01 00\n  __m128i r1 =  _mm_cvtsi32_si128(*((int*)&b[1 * stride]));  // 13 12 11 10\n  __m128i r4 =  _mm_cvtsi32_si128(*((int*)&b[4 * stride]));  // 43 42 41 40\n  __m128i r5 =  _mm_cvtsi32_si128(*((int*)&b[5 * stride]));  // 53 52 51 50\n\n  r0 = _mm_unpacklo_epi32(r0, r4);               // 43 42 41 40 03 02 01 00\n  r1 = _mm_unpacklo_epi32(r1, r5);               // 53 52 51 50 13 12 11 10\n\n  // t1 = 53 43 52 42 51 41 50 40 13 03 12 02 11 01 10 00\n  t1 = _mm_unpacklo_epi8(r0, r1);\n\n  // Load 2nd, 3rd, 6th and 7th rows\n  r0 =  _mm_cvtsi32_si128(*((int*)&b[2 * stride]));          // 23 22 21 22\n  r1 =  _mm_cvtsi32_si128(*((int*)&b[3 * stride]));          // 33 32 31 30\n  r4 =  _mm_cvtsi32_si128(*((int*)&b[6 * stride]));          // 63 62 61 60\n  r5 =  _mm_cvtsi32_si128(*((int*)&b[7 * stride]));          // 73 72 71 70\n\n  r0 = _mm_unpacklo_epi32(r0, r4);               // 63 62 61 60 23 22 21 20\n  r1 = _mm_unpacklo_epi32(r1, r5);               // 73 72 71 70 33 32 31 30\n\n  // t2 = 73 63 72 62 71 61 70 60 33 23 32 22 31 21 30 20\n  t2 = _mm_unpacklo_epi8(r0, r1);\n\n  // t1 = 33 23 13 03 32 22 12 02 31 21 11 01 30 20 10 00\n  // t2 = 73 63 53 43 72 62 52 42 71 61 51 41 70 60 50 40\n  r0 = t1;\n  t1 = _mm_unpacklo_epi16(t1, t2);\n  t2 = _mm_unpackhi_epi16(r0, t2);\n\n  // *p = 71 61 51 41 31 21 11 01 70 60 50 40 30 20 10 00\n  // *q = 73 63 53 43 33 23 13 03 72 62 52 42 32 22 12 02\n  *p = _mm_unpacklo_epi32(t1, t2);\n  *q = _mm_unpackhi_epi32(t1, t2);\n}\n\nstatic WEBP_INLINE void Load16x4(const uint8_t* const r0,\n                                 const uint8_t* const r8,\n                                 int stride,\n                                 __m128i* const p1, __m128i* const p0,\n                                 __m128i* const q0, __m128i* const q1) {\n  __m128i t1, t2;\n  // Assume the pixels around the edge (|) are numbered as follows\n  //                00 01 | 02 03\n  //                10 11 | 12 13\n  //                 ...  |  ...\n  //                e0 e1 | e2 e3\n  //                f0 f1 | f2 f3\n  //\n  // r0 is pointing to the 0th row (00)\n  // r8 is pointing to the 8th row (80)\n\n  // Load\n  // p1 = 71 61 51 41 31 21 11 01 70 60 50 40 30 20 10 00\n  // q0 = 73 63 53 43 33 23 13 03 72 62 52 42 32 22 12 02\n  // p0 = f1 e1 d1 c1 b1 a1 91 81 f0 e0 d0 c0 b0 a0 90 80\n  // q1 = f3 e3 d3 c3 b3 a3 93 83 f2 e2 d2 c2 b2 a2 92 82\n  Load8x4(r0, stride, p1, q0);\n  Load8x4(r8, stride, p0, q1);\n\n  t1 = *p1;\n  t2 = *q0;\n  // p1 = f0 e0 d0 c0 b0 a0 90 80 70 60 50 40 30 20 10 00\n  // p0 = f1 e1 d1 c1 b1 a1 91 81 71 61 51 41 31 21 11 01\n  // q0 = f2 e2 d2 c2 b2 a2 92 82 72 62 52 42 32 22 12 02\n  // q1 = f3 e3 d3 c3 b3 a3 93 83 73 63 53 43 33 23 13 03\n  *p1 = _mm_unpacklo_epi64(t1, *p0);\n  *p0 = _mm_unpackhi_epi64(t1, *p0);\n  *q0 = _mm_unpacklo_epi64(t2, *q1);\n  *q1 = _mm_unpackhi_epi64(t2, *q1);\n}\n\nstatic WEBP_INLINE void Store4x4(__m128i* const x, uint8_t* dst, int stride) {\n  int i;\n  for (i = 0; i < 4; ++i, dst += stride) {\n    *((int32_t*)dst) = _mm_cvtsi128_si32(*x);\n    *x = _mm_srli_si128(*x, 4);\n  }\n}\n\n// Transpose back and store\nstatic WEBP_INLINE void Store16x4(const __m128i* const p1,\n                                  const __m128i* const p0,\n                                  const __m128i* const q0,\n                                  const __m128i* const q1,\n                                  uint8_t* r0, uint8_t* r8,\n                                  int stride) {\n  __m128i t1, p1_s, p0_s, q0_s, q1_s;\n\n  // p0 = 71 70 61 60 51 50 41 40 31 30 21 20 11 10 01 00\n  // p1 = f1 f0 e1 e0 d1 d0 c1 c0 b1 b0 a1 a0 91 90 81 80\n  t1 = *p0;\n  p0_s = _mm_unpacklo_epi8(*p1, t1);\n  p1_s = _mm_unpackhi_epi8(*p1, t1);\n\n  // q0 = 73 72 63 62 53 52 43 42 33 32 23 22 13 12 03 02\n  // q1 = f3 f2 e3 e2 d3 d2 c3 c2 b3 b2 a3 a2 93 92 83 82\n  t1 = *q0;\n  q0_s = _mm_unpacklo_epi8(t1, *q1);\n  q1_s = _mm_unpackhi_epi8(t1, *q1);\n\n  // p0 = 33 32 31 30 23 22 21 20 13 12 11 10 03 02 01 00\n  // q0 = 73 72 71 70 63 62 61 60 53 52 51 50 43 42 41 40\n  t1 = p0_s;\n  p0_s = _mm_unpacklo_epi16(t1, q0_s);\n  q0_s = _mm_unpackhi_epi16(t1, q0_s);\n\n  // p1 = b3 b2 b1 b0 a3 a2 a1 a0 93 92 91 90 83 82 81 80\n  // q1 = f3 f2 f1 f0 e3 e2 e1 e0 d3 d2 d1 d0 c3 c2 c1 c0\n  t1 = p1_s;\n  p1_s = _mm_unpacklo_epi16(t1, q1_s);\n  q1_s = _mm_unpackhi_epi16(t1, q1_s);\n\n  Store4x4(&p0_s, r0, stride);\n  r0 += 4 * stride;\n  Store4x4(&q0_s, r0, stride);\n\n  Store4x4(&p1_s, r8, stride);\n  r8 += 4 * stride;\n  Store4x4(&q1_s, r8, stride);\n}\n\n//------------------------------------------------------------------------------\n// Simple In-loop filtering (Paragraph 15.2)\n\nstatic void SimpleVFilter16(uint8_t* p, int stride, int thresh) {\n  // Load\n  __m128i p1 = _mm_loadu_si128((__m128i*)&p[-2 * stride]);\n  __m128i p0 = _mm_loadu_si128((__m128i*)&p[-stride]);\n  __m128i q0 = _mm_loadu_si128((__m128i*)&p[0]);\n  __m128i q1 = _mm_loadu_si128((__m128i*)&p[stride]);\n\n  DoFilter2(&p1, &p0, &q0, &q1, thresh);\n\n  // Store\n  _mm_storeu_si128((__m128i*)&p[-stride], p0);\n  _mm_storeu_si128((__m128i*)&p[0], q0);\n}\n\nstatic void SimpleHFilter16(uint8_t* p, int stride, int thresh) {\n  __m128i p1, p0, q0, q1;\n\n  p -= 2;  // beginning of p1\n\n  Load16x4(p, p + 8 * stride, stride, &p1, &p0, &q0, &q1);\n  DoFilter2(&p1, &p0, &q0, &q1, thresh);\n  Store16x4(&p1, &p0, &q0, &q1, p, p + 8 * stride, stride);\n}\n\nstatic void SimpleVFilter16i(uint8_t* p, int stride, int thresh) {\n  int k;\n  for (k = 3; k > 0; --k) {\n    p += 4 * stride;\n    SimpleVFilter16(p, stride, thresh);\n  }\n}\n\nstatic void SimpleHFilter16i(uint8_t* p, int stride, int thresh) {\n  int k;\n  for (k = 3; k > 0; --k) {\n    p += 4;\n    SimpleHFilter16(p, stride, thresh);\n  }\n}\n\n//------------------------------------------------------------------------------\n// Complex In-loop filtering (Paragraph 15.3)\n\n#define MAX_DIFF1(p3, p2, p1, p0, m) do {                                      \\\n  m = MM_ABS(p1, p0);                                                          \\\n  m = _mm_max_epu8(m, MM_ABS(p3, p2));                                         \\\n  m = _mm_max_epu8(m, MM_ABS(p2, p1));                                         \\\n} while (0)\n\n#define MAX_DIFF2(p3, p2, p1, p0, m) do {                                      \\\n  m = _mm_max_epu8(m, MM_ABS(p1, p0));                                         \\\n  m = _mm_max_epu8(m, MM_ABS(p3, p2));                                         \\\n  m = _mm_max_epu8(m, MM_ABS(p2, p1));                                         \\\n} while (0)\n\n#define LOAD_H_EDGES4(p, stride, e1, e2, e3, e4) {                             \\\n  e1 = _mm_loadu_si128((__m128i*)&(p)[0 * stride]);                            \\\n  e2 = _mm_loadu_si128((__m128i*)&(p)[1 * stride]);                            \\\n  e3 = _mm_loadu_si128((__m128i*)&(p)[2 * stride]);                            \\\n  e4 = _mm_loadu_si128((__m128i*)&(p)[3 * stride]);                            \\\n}\n\n#define LOADUV_H_EDGE(p, u, v, stride) do {                                    \\\n  const __m128i U = _mm_loadl_epi64((__m128i*)&(u)[(stride)]);                 \\\n  const __m128i V = _mm_loadl_epi64((__m128i*)&(v)[(stride)]);                 \\\n  p = _mm_unpacklo_epi64(U, V);                                                \\\n} while (0)\n\n#define LOADUV_H_EDGES4(u, v, stride, e1, e2, e3, e4) {                        \\\n  LOADUV_H_EDGE(e1, u, v, 0 * stride);                                         \\\n  LOADUV_H_EDGE(e2, u, v, 1 * stride);                                         \\\n  LOADUV_H_EDGE(e3, u, v, 2 * stride);                                         \\\n  LOADUV_H_EDGE(e4, u, v, 3 * stride);                                         \\\n}\n\n#define STOREUV(p, u, v, stride) {                                             \\\n  _mm_storel_epi64((__m128i*)&u[(stride)], p);                                 \\\n  p = _mm_srli_si128(p, 8);                                                    \\\n  _mm_storel_epi64((__m128i*)&v[(stride)], p);                                 \\\n}\n\nstatic WEBP_INLINE void ComplexMask(const __m128i* const p1,\n                                    const __m128i* const p0,\n                                    const __m128i* const q0,\n                                    const __m128i* const q1,\n                                    int thresh, int ithresh,\n                                    __m128i* const mask) {\n  const __m128i it = _mm_set1_epi8(ithresh);\n  const __m128i diff = _mm_subs_epu8(*mask, it);\n  const __m128i thresh_mask = _mm_cmpeq_epi8(diff, _mm_setzero_si128());\n  __m128i filter_mask;\n  NeedsFilter(p1, p0, q0, q1, thresh, &filter_mask);\n  *mask = _mm_and_si128(thresh_mask, filter_mask);\n}\n\n// on macroblock edges\nstatic void VFilter16(uint8_t* p, int stride,\n                      int thresh, int ithresh, int hev_thresh) {\n  __m128i t1;\n  __m128i mask;\n  __m128i p2, p1, p0, q0, q1, q2;\n\n  // Load p3, p2, p1, p0\n  LOAD_H_EDGES4(p - 4 * stride, stride, t1, p2, p1, p0);\n  MAX_DIFF1(t1, p2, p1, p0, mask);\n\n  // Load q0, q1, q2, q3\n  LOAD_H_EDGES4(p, stride, q0, q1, q2, t1);\n  MAX_DIFF2(t1, q2, q1, q0, mask);\n\n  ComplexMask(&p1, &p0, &q0, &q1, thresh, ithresh, &mask);\n  DoFilter6(&p2, &p1, &p0, &q0, &q1, &q2, &mask, hev_thresh);\n\n  // Store\n  _mm_storeu_si128((__m128i*)&p[-3 * stride], p2);\n  _mm_storeu_si128((__m128i*)&p[-2 * stride], p1);\n  _mm_storeu_si128((__m128i*)&p[-1 * stride], p0);\n  _mm_storeu_si128((__m128i*)&p[+0 * stride], q0);\n  _mm_storeu_si128((__m128i*)&p[+1 * stride], q1);\n  _mm_storeu_si128((__m128i*)&p[+2 * stride], q2);\n}\n\nstatic void HFilter16(uint8_t* p, int stride,\n                      int thresh, int ithresh, int hev_thresh) {\n  __m128i mask;\n  __m128i p3, p2, p1, p0, q0, q1, q2, q3;\n\n  uint8_t* const b = p - 4;\n  Load16x4(b, b + 8 * stride, stride, &p3, &p2, &p1, &p0);  // p3, p2, p1, p0\n  MAX_DIFF1(p3, p2, p1, p0, mask);\n\n  Load16x4(p, p + 8 * stride, stride, &q0, &q1, &q2, &q3);  // q0, q1, q2, q3\n  MAX_DIFF2(q3, q2, q1, q0, mask);\n\n  ComplexMask(&p1, &p0, &q0, &q1, thresh, ithresh, &mask);\n  DoFilter6(&p2, &p1, &p0, &q0, &q1, &q2, &mask, hev_thresh);\n\n  Store16x4(&p3, &p2, &p1, &p0, b, b + 8 * stride, stride);\n  Store16x4(&q0, &q1, &q2, &q3, p, p + 8 * stride, stride);\n}\n\n// on three inner edges\nstatic void VFilter16i(uint8_t* p, int stride,\n                       int thresh, int ithresh, int hev_thresh) {\n  int k;\n  __m128i p3, p2, p1, p0;   // loop invariants\n\n  LOAD_H_EDGES4(p, stride, p3, p2, p1, p0);  // prologue\n\n  for (k = 3; k > 0; --k) {\n    __m128i mask, tmp1, tmp2;\n    uint8_t* const b = p + 2 * stride;   // beginning of p1\n    p += 4 * stride;\n\n    MAX_DIFF1(p3, p2, p1, p0, mask);   // compute partial mask\n    LOAD_H_EDGES4(p, stride, p3, p2, tmp1, tmp2);\n    MAX_DIFF2(p3, p2, tmp1, tmp2, mask);\n\n    // p3 and p2 are not just temporary variables here: they will be\n    // re-used for next span. And q2/q3 will become p1/p0 accordingly.\n    ComplexMask(&p1, &p0, &p3, &p2, thresh, ithresh, &mask);\n    DoFilter4(&p1, &p0, &p3, &p2, &mask, hev_thresh);\n\n    // Store\n    _mm_storeu_si128((__m128i*)&b[0 * stride], p1);\n    _mm_storeu_si128((__m128i*)&b[1 * stride], p0);\n    _mm_storeu_si128((__m128i*)&b[2 * stride], p3);\n    _mm_storeu_si128((__m128i*)&b[3 * stride], p2);\n\n    // rotate samples\n    p1 = tmp1;\n    p0 = tmp2;\n  }\n}\n\nstatic void HFilter16i(uint8_t* p, int stride,\n                       int thresh, int ithresh, int hev_thresh) {\n  int k;\n  __m128i p3, p2, p1, p0;   // loop invariants\n\n  Load16x4(p, p + 8 * stride, stride, &p3, &p2, &p1, &p0);  // prologue\n\n  for (k = 3; k > 0; --k) {\n    __m128i mask, tmp1, tmp2;\n    uint8_t* const b = p + 2;   // beginning of p1\n\n    p += 4;  // beginning of q0 (and next span)\n\n    MAX_DIFF1(p3, p2, p1, p0, mask);   // compute partial mask\n    Load16x4(p, p + 8 * stride, stride, &p3, &p2, &tmp1, &tmp2);\n    MAX_DIFF2(p3, p2, tmp1, tmp2, mask);\n\n    ComplexMask(&p1, &p0, &p3, &p2, thresh, ithresh, &mask);\n    DoFilter4(&p1, &p0, &p3, &p2, &mask, hev_thresh);\n\n    Store16x4(&p1, &p0, &p3, &p2, b, b + 8 * stride, stride);\n\n    // rotate samples\n    p1 = tmp1;\n    p0 = tmp2;\n  }\n}\n\n// 8-pixels wide variant, for chroma filtering\nstatic void VFilter8(uint8_t* u, uint8_t* v, int stride,\n                     int thresh, int ithresh, int hev_thresh) {\n  __m128i mask;\n  __m128i t1, p2, p1, p0, q0, q1, q2;\n\n  // Load p3, p2, p1, p0\n  LOADUV_H_EDGES4(u - 4 * stride, v - 4 * stride, stride, t1, p2, p1, p0);\n  MAX_DIFF1(t1, p2, p1, p0, mask);\n\n  // Load q0, q1, q2, q3\n  LOADUV_H_EDGES4(u, v, stride, q0, q1, q2, t1);\n  MAX_DIFF2(t1, q2, q1, q0, mask);\n\n  ComplexMask(&p1, &p0, &q0, &q1, thresh, ithresh, &mask);\n  DoFilter6(&p2, &p1, &p0, &q0, &q1, &q2, &mask, hev_thresh);\n\n  // Store\n  STOREUV(p2, u, v, -3 * stride);\n  STOREUV(p1, u, v, -2 * stride);\n  STOREUV(p0, u, v, -1 * stride);\n  STOREUV(q0, u, v, 0 * stride);\n  STOREUV(q1, u, v, 1 * stride);\n  STOREUV(q2, u, v, 2 * stride);\n}\n\nstatic void HFilter8(uint8_t* u, uint8_t* v, int stride,\n                     int thresh, int ithresh, int hev_thresh) {\n  __m128i mask;\n  __m128i p3, p2, p1, p0, q0, q1, q2, q3;\n\n  uint8_t* const tu = u - 4;\n  uint8_t* const tv = v - 4;\n  Load16x4(tu, tv, stride, &p3, &p2, &p1, &p0);  // p3, p2, p1, p0\n  MAX_DIFF1(p3, p2, p1, p0, mask);\n\n  Load16x4(u, v, stride, &q0, &q1, &q2, &q3);    // q0, q1, q2, q3\n  MAX_DIFF2(q3, q2, q1, q0, mask);\n\n  ComplexMask(&p1, &p0, &q0, &q1, thresh, ithresh, &mask);\n  DoFilter6(&p2, &p1, &p0, &q0, &q1, &q2, &mask, hev_thresh);\n\n  Store16x4(&p3, &p2, &p1, &p0, tu, tv, stride);\n  Store16x4(&q0, &q1, &q2, &q3, u, v, stride);\n}\n\nstatic void VFilter8i(uint8_t* u, uint8_t* v, int stride,\n                      int thresh, int ithresh, int hev_thresh) {\n  __m128i mask;\n  __m128i t1, t2, p1, p0, q0, q1;\n\n  // Load p3, p2, p1, p0\n  LOADUV_H_EDGES4(u, v, stride, t2, t1, p1, p0);\n  MAX_DIFF1(t2, t1, p1, p0, mask);\n\n  u += 4 * stride;\n  v += 4 * stride;\n\n  // Load q0, q1, q2, q3\n  LOADUV_H_EDGES4(u, v, stride, q0, q1, t1, t2);\n  MAX_DIFF2(t2, t1, q1, q0, mask);\n\n  ComplexMask(&p1, &p0, &q0, &q1, thresh, ithresh, &mask);\n  DoFilter4(&p1, &p0, &q0, &q1, &mask, hev_thresh);\n\n  // Store\n  STOREUV(p1, u, v, -2 * stride);\n  STOREUV(p0, u, v, -1 * stride);\n  STOREUV(q0, u, v, 0 * stride);\n  STOREUV(q1, u, v, 1 * stride);\n}\n\nstatic void HFilter8i(uint8_t* u, uint8_t* v, int stride,\n                      int thresh, int ithresh, int hev_thresh) {\n  __m128i mask;\n  __m128i t1, t2, p1, p0, q0, q1;\n  Load16x4(u, v, stride, &t2, &t1, &p1, &p0);   // p3, p2, p1, p0\n  MAX_DIFF1(t2, t1, p1, p0, mask);\n\n  u += 4;  // beginning of q0\n  v += 4;\n  Load16x4(u, v, stride, &q0, &q1, &t1, &t2);  // q0, q1, q2, q3\n  MAX_DIFF2(t2, t1, q1, q0, mask);\n\n  ComplexMask(&p1, &p0, &q0, &q1, thresh, ithresh, &mask);\n  DoFilter4(&p1, &p0, &q0, &q1, &mask, hev_thresh);\n\n  u -= 2;  // beginning of p1\n  v -= 2;\n  Store16x4(&p1, &p0, &q0, &q1, u, v, stride);\n}\n\n#endif   // WEBP_USE_SSE2\n\n//------------------------------------------------------------------------------\n// Entry point\n\nextern void VP8DspInitSSE2(void);\n\nvoid VP8DspInitSSE2(void) {\n#if defined(WEBP_USE_SSE2)\n  VP8Transform = Transform;\n#if defined(USE_TRANSFORM_AC3)\n  VP8TransformAC3 = TransformAC3;\n#endif\n\n  VP8VFilter16 = VFilter16;\n  VP8HFilter16 = HFilter16;\n  VP8VFilter8 = VFilter8;\n  VP8HFilter8 = HFilter8;\n  VP8VFilter16i = VFilter16i;\n  VP8HFilter16i = HFilter16i;\n  VP8VFilter8i = VFilter8i;\n  VP8HFilter8i = HFilter8i;\n\n  VP8SimpleVFilter16 = SimpleVFilter16;\n  VP8SimpleHFilter16 = SimpleHFilter16;\n  VP8SimpleVFilter16i = SimpleVFilter16i;\n  VP8SimpleHFilter16i = SimpleHFilter16i;\n#endif   // WEBP_USE_SSE2\n}\n"
  },
  {
    "path": "ext/libwebp/dsp/dsp.h",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n//   Speed-critical functions.\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_DSP_DSP_H_\n#define WEBP_DSP_DSP_H_\n\n#ifdef HAVE_CONFIG_H\n#include \"../webp/config.h\"\n#endif\n\n#include \"../webp/types.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n//------------------------------------------------------------------------------\n// CPU detection\n\n#if defined(__GNUC__)\n# define LOCAL_GCC_VERSION ((__GNUC__ << 8) | __GNUC_MINOR__)\n# define LOCAL_GCC_PREREQ(maj, min) \\\n    (LOCAL_GCC_VERSION >= (((maj) << 8) | (min)))\n#else\n# define LOCAL_GCC_VERSION 0\n# define LOCAL_GCC_PREREQ(maj, min) 0\n#endif\n\n#ifdef __clang__\n# define LOCAL_CLANG_VERSION ((__clang_major__ << 8) | __clang_minor__)\n# define LOCAL_CLANG_PREREQ(maj, min) \\\n    (LOCAL_CLANG_VERSION >= (((maj) << 8) | (min)))\n#else\n# define LOCAL_CLANG_VERSION 0\n# define LOCAL_CLANG_PREREQ(maj, min) 0\n#endif  // __clang__\n\n#if defined(_MSC_VER) && _MSC_VER > 1310 && \\\n    (defined(_M_X64) || defined(_M_IX86))\n#define WEBP_MSC_SSE2  // Visual C++ SSE2 targets\n#endif\n\n// WEBP_HAVE_* are used to indicate the presence of the instruction set in dsp\n// files without intrinsics, allowing the corresponding Init() to be called.\n// Files containing intrinsics will need to be built targeting the instruction\n// set so should succeed on one of the earlier tests.\n#if defined(__SSE2__) || defined(WEBP_MSC_SSE2) || defined(WEBP_HAVE_SSE2)\n#define WEBP_USE_SSE2\n#endif\n\n#if defined(__AVX2__) || defined(WEBP_HAVE_AVX2)\n#define WEBP_USE_AVX2\n#endif\n\n#if defined(__ANDROID__) && defined(__ARM_ARCH_7A__)\n#define WEBP_ANDROID_NEON  // Android targets that might support NEON\n#endif\n\n#if defined(__ARM_NEON__) || defined(WEBP_ANDROID_NEON) || defined(__aarch64__)\n#define WEBP_USE_NEON\n#endif\n\n#if defined(__mips__) && !defined(__mips64) && (__mips_isa_rev < 6)\n#define WEBP_USE_MIPS32\n#if (__mips_isa_rev >= 2)\n#define WEBP_USE_MIPS32_R2\n#endif\n#endif\n\ntypedef enum {\n  kSSE2,\n  kSSE3,\n  kAVX,\n  kAVX2,\n  kNEON,\n  kMIPS32\n} CPUFeature;\n// returns true if the CPU supports the feature.\ntypedef int (*VP8CPUInfo)(CPUFeature feature);\nextern VP8CPUInfo VP8GetCPUInfo;\n\n//------------------------------------------------------------------------------\n// Encoding\n\n// Transforms\n// VP8Idct: Does one of two inverse transforms. If do_two is set, the transforms\n//          will be done for (ref, in, dst) and (ref + 4, in + 16, dst + 4).\ntypedef void (*VP8Idct)(const uint8_t* ref, const int16_t* in, uint8_t* dst,\n                        int do_two);\ntypedef void (*VP8Fdct)(const uint8_t* src, const uint8_t* ref, int16_t* out);\ntypedef void (*VP8WHT)(const int16_t* in, int16_t* out);\nextern VP8Idct VP8ITransform;\nextern VP8Fdct VP8FTransform;\nextern VP8WHT VP8FTransformWHT;\n// Predictions\n// *dst is the destination block. *top and *left can be NULL.\ntypedef void (*VP8IntraPreds)(uint8_t *dst, const uint8_t* left,\n                              const uint8_t* top);\ntypedef void (*VP8Intra4Preds)(uint8_t *dst, const uint8_t* top);\nextern VP8Intra4Preds VP8EncPredLuma4;\nextern VP8IntraPreds VP8EncPredLuma16;\nextern VP8IntraPreds VP8EncPredChroma8;\n\ntypedef int (*VP8Metric)(const uint8_t* pix, const uint8_t* ref);\nextern VP8Metric VP8SSE16x16, VP8SSE16x8, VP8SSE8x8, VP8SSE4x4;\ntypedef int (*VP8WMetric)(const uint8_t* pix, const uint8_t* ref,\n                          const uint16_t* const weights);\nextern VP8WMetric VP8TDisto4x4, VP8TDisto16x16;\n\ntypedef void (*VP8BlockCopy)(const uint8_t* src, uint8_t* dst);\nextern VP8BlockCopy VP8Copy4x4;\n// Quantization\nstruct VP8Matrix;   // forward declaration\ntypedef int (*VP8QuantizeBlock)(int16_t in[16], int16_t out[16],\n                                const struct VP8Matrix* const mtx);\nextern VP8QuantizeBlock VP8EncQuantizeBlock;\n\n// specific to 2nd transform:\ntypedef int (*VP8QuantizeBlockWHT)(int16_t in[16], int16_t out[16],\n                                   const struct VP8Matrix* const mtx);\nextern VP8QuantizeBlockWHT VP8EncQuantizeBlockWHT;\n\n// Collect histogram for susceptibility calculation and accumulate in histo[].\nstruct VP8Histogram;\ntypedef void (*VP8CHisto)(const uint8_t* ref, const uint8_t* pred,\n                          int start_block, int end_block,\n                          struct VP8Histogram* const histo);\nextern const int VP8DspScan[16 + 4 + 4];\nextern VP8CHisto VP8CollectHistogram;\n\nvoid VP8EncDspInit(void);   // must be called before using any of the above\n\n//------------------------------------------------------------------------------\n// Decoding\n\ntypedef void (*VP8DecIdct)(const int16_t* coeffs, uint8_t* dst);\n// when doing two transforms, coeffs is actually int16_t[2][16].\ntypedef void (*VP8DecIdct2)(const int16_t* coeffs, uint8_t* dst, int do_two);\nextern VP8DecIdct2 VP8Transform;\nextern VP8DecIdct VP8TransformAC3;\nextern VP8DecIdct VP8TransformUV;\nextern VP8DecIdct VP8TransformDC;\nextern VP8DecIdct VP8TransformDCUV;\nextern VP8WHT VP8TransformWHT;\n\n// *dst is the destination block, with stride BPS. Boundary samples are\n// assumed accessible when needed.\ntypedef void (*VP8PredFunc)(uint8_t* dst);\nextern const VP8PredFunc VP8PredLuma16[/* NUM_B_DC_MODES */];\nextern const VP8PredFunc VP8PredChroma8[/* NUM_B_DC_MODES */];\nextern const VP8PredFunc VP8PredLuma4[/* NUM_BMODES */];\n\n// clipping tables (for filtering)\nextern const int8_t* const VP8ksclip1;  // clips [-1020, 1020] to [-128, 127]\nextern const int8_t* const VP8ksclip2;  // clips [-112, 112] to [-16, 15]\nextern const uint8_t* const VP8kclip1;  // clips [-255,511] to [0,255]\nextern const uint8_t* const VP8kabs0;   // abs(x) for x in [-255,255]\nvoid VP8InitClipTables(void);           // must be called first\n\n// simple filter (only for luma)\ntypedef void (*VP8SimpleFilterFunc)(uint8_t* p, int stride, int thresh);\nextern VP8SimpleFilterFunc VP8SimpleVFilter16;\nextern VP8SimpleFilterFunc VP8SimpleHFilter16;\nextern VP8SimpleFilterFunc VP8SimpleVFilter16i;  // filter 3 inner edges\nextern VP8SimpleFilterFunc VP8SimpleHFilter16i;\n\n// regular filter (on both macroblock edges and inner edges)\ntypedef void (*VP8LumaFilterFunc)(uint8_t* luma, int stride,\n                                  int thresh, int ithresh, int hev_t);\ntypedef void (*VP8ChromaFilterFunc)(uint8_t* u, uint8_t* v, int stride,\n                                    int thresh, int ithresh, int hev_t);\n// on outer edge\nextern VP8LumaFilterFunc VP8VFilter16;\nextern VP8LumaFilterFunc VP8HFilter16;\nextern VP8ChromaFilterFunc VP8VFilter8;\nextern VP8ChromaFilterFunc VP8HFilter8;\n\n// on inner edge\nextern VP8LumaFilterFunc VP8VFilter16i;   // filtering 3 inner edges altogether\nextern VP8LumaFilterFunc VP8HFilter16i;\nextern VP8ChromaFilterFunc VP8VFilter8i;  // filtering u and v altogether\nextern VP8ChromaFilterFunc VP8HFilter8i;\n\n// must be called before anything using the above\nvoid VP8DspInit(void);\n\n//------------------------------------------------------------------------------\n// WebP I/O\n\n#define FANCY_UPSAMPLING   // undefined to remove fancy upsampling support\n\n// Convert a pair of y/u/v lines together to the output rgb/a colorspace.\n// bottom_y can be NULL if only one line of output is needed (at top/bottom).\ntypedef void (*WebPUpsampleLinePairFunc)(\n    const uint8_t* top_y, const uint8_t* bottom_y,\n    const uint8_t* top_u, const uint8_t* top_v,\n    const uint8_t* cur_u, const uint8_t* cur_v,\n    uint8_t* top_dst, uint8_t* bottom_dst, int len);\n\n#ifdef FANCY_UPSAMPLING\n\n// Fancy upsampling functions to convert YUV to RGB(A) modes\nextern WebPUpsampleLinePairFunc WebPUpsamplers[/* MODE_LAST */];\n\n#endif    // FANCY_UPSAMPLING\n\n// Per-row point-sampling methods.\ntypedef void (*WebPSamplerRowFunc)(const uint8_t* y,\n                                   const uint8_t* u, const uint8_t* v,\n                                   uint8_t* dst, int len);\n// Generic function to apply 'WebPSamplerRowFunc' to the whole plane:\nvoid WebPSamplerProcessPlane(const uint8_t* y, int y_stride,\n                             const uint8_t* u, const uint8_t* v, int uv_stride,\n                             uint8_t* dst, int dst_stride,\n                             int width, int height, WebPSamplerRowFunc func);\n\n// Sampling functions to convert rows of YUV to RGB(A)\nextern WebPSamplerRowFunc WebPSamplers[/* MODE_LAST */];\n\n// General function for converting two lines of ARGB or RGBA.\n// 'alpha_is_last' should be true if 0xff000000 is stored in memory as\n// as 0x00, 0x00, 0x00, 0xff (little endian).\nWebPUpsampleLinePairFunc WebPGetLinePairConverter(int alpha_is_last);\n\n// YUV444->RGB converters\ntypedef void (*WebPYUV444Converter)(const uint8_t* y,\n                                    const uint8_t* u, const uint8_t* v,\n                                    uint8_t* dst, int len);\n\nextern const WebPYUV444Converter WebPYUV444Converters[/* MODE_LAST */];\n\n// Must be called before using the WebPUpsamplers[] (and for premultiplied\n// colorspaces like rgbA, rgbA4444, etc)\nvoid WebPInitUpsamplers(void);\n// Must be called before using WebPSamplers[]\nvoid WebPInitSamplers(void);\n\n//------------------------------------------------------------------------------\n// Utilities for processing transparent channel.\n\n// Apply alpha pre-multiply on an rgba, bgra or argb plane of size w * h.\n// alpha_first should be 0 for argb, 1 for rgba or bgra (where alpha is last).\nextern void (*WebPApplyAlphaMultiply)(\n    uint8_t* rgba, int alpha_first, int w, int h, int stride);\n\n// Same, buf specifically for RGBA4444 format\nextern void (*WebPApplyAlphaMultiply4444)(\n    uint8_t* rgba4444, int w, int h, int stride);\n\n// Extract the alpha values from 32b values in argb[] and pack them into alpha[]\n// (this is the opposite of WebPDispatchAlpha).\n// Returns true if there's only trivial 0xff alpha values.\nextern int (*WebPExtractAlpha)(const uint8_t* argb, int argb_stride,\n                               int width, int height,\n                               uint8_t* alpha, int alpha_stride);\n\n// Pre-Multiply operation transforms x into x * A / 255  (where x=Y,R,G or B).\n// Un-Multiply operation transforms x into x * 255 / A.\n\n// Pre-Multiply or Un-Multiply (if 'inverse' is true) argb values in a row.\nextern void (*WebPMultARGBRow)(uint32_t* const ptr, int width, int inverse);\n\n// Same a WebPMultARGBRow(), but for several rows.\nvoid WebPMultARGBRows(uint8_t* ptr, int stride, int width, int num_rows,\n                      int inverse);\n\n// Same for a row of single values, with side alpha values.\nextern void (*WebPMultRow)(uint8_t* const ptr, const uint8_t* const alpha,\n                           int width, int inverse);\n\n// Same a WebPMultRow(), but for several 'num_rows' rows.\nvoid WebPMultRows(uint8_t* ptr, int stride,\n                  const uint8_t* alpha, int alpha_stride,\n                  int width, int num_rows, int inverse);\n\n// To be called first before using the above.\nvoid WebPInitAlphaProcessing(void);\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_DSP_DSP_H_ */\n"
  },
  {
    "path": "ext/libwebp/dsp/enc.c",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Speed-critical encoding functions.\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include <assert.h>\n#include <stdlib.h>  // for abs()\n\n#include \"./dsp.h\"\n#include \"../enc/vp8enci.h\"\n\nstatic WEBP_INLINE uint8_t clip_8b(int v) {\n  return (!(v & ~0xff)) ? v : (v < 0) ? 0 : 255;\n}\n\nstatic WEBP_INLINE int clip_max(int v, int max) {\n  return (v > max) ? max : v;\n}\n\n//------------------------------------------------------------------------------\n// Compute susceptibility based on DCT-coeff histograms:\n// the higher, the \"easier\" the macroblock is to compress.\n\nconst int VP8DspScan[16 + 4 + 4] = {\n  // Luma\n  0 +  0 * BPS,  4 +  0 * BPS, 8 +  0 * BPS, 12 +  0 * BPS,\n  0 +  4 * BPS,  4 +  4 * BPS, 8 +  4 * BPS, 12 +  4 * BPS,\n  0 +  8 * BPS,  4 +  8 * BPS, 8 +  8 * BPS, 12 +  8 * BPS,\n  0 + 12 * BPS,  4 + 12 * BPS, 8 + 12 * BPS, 12 + 12 * BPS,\n\n  0 + 0 * BPS,   4 + 0 * BPS, 0 + 4 * BPS,  4 + 4 * BPS,    // U\n  8 + 0 * BPS,  12 + 0 * BPS, 8 + 4 * BPS, 12 + 4 * BPS     // V\n};\n\nstatic void CollectHistogram(const uint8_t* ref, const uint8_t* pred,\n                             int start_block, int end_block,\n                             VP8Histogram* const histo) {\n  int j;\n  for (j = start_block; j < end_block; ++j) {\n    int k;\n    int16_t out[16];\n\n    VP8FTransform(ref + VP8DspScan[j], pred + VP8DspScan[j], out);\n\n    // Convert coefficients to bin.\n    for (k = 0; k < 16; ++k) {\n      const int v = abs(out[k]) >> 3;  // TODO(skal): add rounding?\n      const int clipped_value = clip_max(v, MAX_COEFF_THRESH);\n      histo->distribution[clipped_value]++;\n    }\n  }\n}\n\n//------------------------------------------------------------------------------\n// run-time tables (~4k)\n\nstatic uint8_t clip1[255 + 510 + 1];    // clips [-255,510] to [0,255]\n\n// We declare this variable 'volatile' to prevent instruction reordering\n// and make sure it's set to true _last_ (so as to be thread-safe)\nstatic volatile int tables_ok = 0;\n\nstatic void InitTables(void) {\n  if (!tables_ok) {\n    int i;\n    for (i = -255; i <= 255 + 255; ++i) {\n      clip1[255 + i] = clip_8b(i);\n    }\n    tables_ok = 1;\n  }\n}\n\n\n//------------------------------------------------------------------------------\n// Transforms (Paragraph 14.4)\n\n#define STORE(x, y, v) \\\n  dst[(x) + (y) * BPS] = clip_8b(ref[(x) + (y) * BPS] + ((v) >> 3))\n\nstatic const int kC1 = 20091 + (1 << 16);\nstatic const int kC2 = 35468;\n#define MUL(a, b) (((a) * (b)) >> 16)\n\nstatic WEBP_INLINE void ITransformOne(const uint8_t* ref, const int16_t* in,\n                                      uint8_t* dst) {\n  int C[4 * 4], *tmp;\n  int i;\n  tmp = C;\n  for (i = 0; i < 4; ++i) {    // vertical pass\n    const int a = in[0] + in[8];\n    const int b = in[0] - in[8];\n    const int c = MUL(in[4], kC2) - MUL(in[12], kC1);\n    const int d = MUL(in[4], kC1) + MUL(in[12], kC2);\n    tmp[0] = a + d;\n    tmp[1] = b + c;\n    tmp[2] = b - c;\n    tmp[3] = a - d;\n    tmp += 4;\n    in++;\n  }\n\n  tmp = C;\n  for (i = 0; i < 4; ++i) {    // horizontal pass\n    const int dc = tmp[0] + 4;\n    const int a =  dc +  tmp[8];\n    const int b =  dc -  tmp[8];\n    const int c = MUL(tmp[4], kC2) - MUL(tmp[12], kC1);\n    const int d = MUL(tmp[4], kC1) + MUL(tmp[12], kC2);\n    STORE(0, i, a + d);\n    STORE(1, i, b + c);\n    STORE(2, i, b - c);\n    STORE(3, i, a - d);\n    tmp++;\n  }\n}\n\nstatic void ITransform(const uint8_t* ref, const int16_t* in, uint8_t* dst,\n                       int do_two) {\n  ITransformOne(ref, in, dst);\n  if (do_two) {\n    ITransformOne(ref + 4, in + 16, dst + 4);\n  }\n}\n\nstatic void FTransform(const uint8_t* src, const uint8_t* ref, int16_t* out) {\n  int i;\n  int tmp[16];\n  for (i = 0; i < 4; ++i, src += BPS, ref += BPS) {\n    const int d0 = src[0] - ref[0];   // 9bit dynamic range ([-255,255])\n    const int d1 = src[1] - ref[1];\n    const int d2 = src[2] - ref[2];\n    const int d3 = src[3] - ref[3];\n    const int a0 = (d0 + d3);         // 10b                      [-510,510]\n    const int a1 = (d1 + d2);\n    const int a2 = (d1 - d2);\n    const int a3 = (d0 - d3);\n    tmp[0 + i * 4] = (a0 + a1) * 8;   // 14b                      [-8160,8160]\n    tmp[1 + i * 4] = (a2 * 2217 + a3 * 5352 + 1812) >> 9;      // [-7536,7542]\n    tmp[2 + i * 4] = (a0 - a1) * 8;\n    tmp[3 + i * 4] = (a3 * 2217 - a2 * 5352 +  937) >> 9;\n  }\n  for (i = 0; i < 4; ++i) {\n    const int a0 = (tmp[0 + i] + tmp[12 + i]);  // 15b\n    const int a1 = (tmp[4 + i] + tmp[ 8 + i]);\n    const int a2 = (tmp[4 + i] - tmp[ 8 + i]);\n    const int a3 = (tmp[0 + i] - tmp[12 + i]);\n    out[0 + i] = (a0 + a1 + 7) >> 4;            // 12b\n    out[4 + i] = ((a2 * 2217 + a3 * 5352 + 12000) >> 16) + (a3 != 0);\n    out[8 + i] = (a0 - a1 + 7) >> 4;\n    out[12+ i] = ((a3 * 2217 - a2 * 5352 + 51000) >> 16);\n  }\n}\n\nstatic void FTransformWHT(const int16_t* in, int16_t* out) {\n  // input is 12b signed\n  int32_t tmp[16];\n  int i;\n  for (i = 0; i < 4; ++i, in += 64) {\n    const int a0 = (in[0 * 16] + in[2 * 16]);  // 13b\n    const int a1 = (in[1 * 16] + in[3 * 16]);\n    const int a2 = (in[1 * 16] - in[3 * 16]);\n    const int a3 = (in[0 * 16] - in[2 * 16]);\n    tmp[0 + i * 4] = a0 + a1;   // 14b\n    tmp[1 + i * 4] = a3 + a2;\n    tmp[2 + i * 4] = a3 - a2;\n    tmp[3 + i * 4] = a0 - a1;\n  }\n  for (i = 0; i < 4; ++i) {\n    const int a0 = (tmp[0 + i] + tmp[8 + i]);  // 15b\n    const int a1 = (tmp[4 + i] + tmp[12+ i]);\n    const int a2 = (tmp[4 + i] - tmp[12+ i]);\n    const int a3 = (tmp[0 + i] - tmp[8 + i]);\n    const int b0 = a0 + a1;    // 16b\n    const int b1 = a3 + a2;\n    const int b2 = a3 - a2;\n    const int b3 = a0 - a1;\n    out[ 0 + i] = b0 >> 1;     // 15b\n    out[ 4 + i] = b1 >> 1;\n    out[ 8 + i] = b2 >> 1;\n    out[12 + i] = b3 >> 1;\n  }\n}\n\n#undef MUL\n#undef STORE\n\n//------------------------------------------------------------------------------\n// Intra predictions\n\n#define DST(x, y) dst[(x) + (y) * BPS]\n\nstatic WEBP_INLINE void Fill(uint8_t* dst, int value, int size) {\n  int j;\n  for (j = 0; j < size; ++j) {\n    memset(dst + j * BPS, value, size);\n  }\n}\n\nstatic WEBP_INLINE void VerticalPred(uint8_t* dst,\n                                     const uint8_t* top, int size) {\n  int j;\n  if (top) {\n    for (j = 0; j < size; ++j) memcpy(dst + j * BPS, top, size);\n  } else {\n    Fill(dst, 127, size);\n  }\n}\n\nstatic WEBP_INLINE void HorizontalPred(uint8_t* dst,\n                                       const uint8_t* left, int size) {\n  if (left) {\n    int j;\n    for (j = 0; j < size; ++j) {\n      memset(dst + j * BPS, left[j], size);\n    }\n  } else {\n    Fill(dst, 129, size);\n  }\n}\n\nstatic WEBP_INLINE void TrueMotion(uint8_t* dst, const uint8_t* left,\n                                   const uint8_t* top, int size) {\n  int y;\n  if (left) {\n    if (top) {\n      const uint8_t* const clip = clip1 + 255 - left[-1];\n      for (y = 0; y < size; ++y) {\n        const uint8_t* const clip_table = clip + left[y];\n        int x;\n        for (x = 0; x < size; ++x) {\n          dst[x] = clip_table[top[x]];\n        }\n        dst += BPS;\n      }\n    } else {\n      HorizontalPred(dst, left, size);\n    }\n  } else {\n    // true motion without left samples (hence: with default 129 value)\n    // is equivalent to VE prediction where you just copy the top samples.\n    // Note that if top samples are not available, the default value is\n    // then 129, and not 127 as in the VerticalPred case.\n    if (top) {\n      VerticalPred(dst, top, size);\n    } else {\n      Fill(dst, 129, size);\n    }\n  }\n}\n\nstatic WEBP_INLINE void DCMode(uint8_t* dst, const uint8_t* left,\n                               const uint8_t* top,\n                               int size, int round, int shift) {\n  int DC = 0;\n  int j;\n  if (top) {\n    for (j = 0; j < size; ++j) DC += top[j];\n    if (left) {   // top and left present\n      for (j = 0; j < size; ++j) DC += left[j];\n    } else {      // top, but no left\n      DC += DC;\n    }\n    DC = (DC + round) >> shift;\n  } else if (left) {   // left but no top\n    for (j = 0; j < size; ++j) DC += left[j];\n    DC += DC;\n    DC = (DC + round) >> shift;\n  } else {   // no top, no left, nothing.\n    DC = 0x80;\n  }\n  Fill(dst, DC, size);\n}\n\n//------------------------------------------------------------------------------\n// Chroma 8x8 prediction (paragraph 12.2)\n\nstatic void IntraChromaPreds(uint8_t* dst, const uint8_t* left,\n                             const uint8_t* top) {\n  // U block\n  DCMode(C8DC8 + dst, left, top, 8, 8, 4);\n  VerticalPred(C8VE8 + dst, top, 8);\n  HorizontalPred(C8HE8 + dst, left, 8);\n  TrueMotion(C8TM8 + dst, left, top, 8);\n  // V block\n  dst += 8;\n  if (top) top += 8;\n  if (left) left += 16;\n  DCMode(C8DC8 + dst, left, top, 8, 8, 4);\n  VerticalPred(C8VE8 + dst, top, 8);\n  HorizontalPred(C8HE8 + dst, left, 8);\n  TrueMotion(C8TM8 + dst, left, top, 8);\n}\n\n//------------------------------------------------------------------------------\n// luma 16x16 prediction (paragraph 12.3)\n\nstatic void Intra16Preds(uint8_t* dst,\n                         const uint8_t* left, const uint8_t* top) {\n  DCMode(I16DC16 + dst, left, top, 16, 16, 5);\n  VerticalPred(I16VE16 + dst, top, 16);\n  HorizontalPred(I16HE16 + dst, left, 16);\n  TrueMotion(I16TM16 + dst, left, top, 16);\n}\n\n//------------------------------------------------------------------------------\n// luma 4x4 prediction\n\n#define AVG3(a, b, c) (((a) + 2 * (b) + (c) + 2) >> 2)\n#define AVG2(a, b) (((a) + (b) + 1) >> 1)\n\nstatic void VE4(uint8_t* dst, const uint8_t* top) {    // vertical\n  const uint8_t vals[4] = {\n    AVG3(top[-1], top[0], top[1]),\n    AVG3(top[ 0], top[1], top[2]),\n    AVG3(top[ 1], top[2], top[3]),\n    AVG3(top[ 2], top[3], top[4])\n  };\n  int i;\n  for (i = 0; i < 4; ++i) {\n    memcpy(dst + i * BPS, vals, 4);\n  }\n}\n\nstatic void HE4(uint8_t* dst, const uint8_t* top) {    // horizontal\n  const int X = top[-1];\n  const int I = top[-2];\n  const int J = top[-3];\n  const int K = top[-4];\n  const int L = top[-5];\n  *(uint32_t*)(dst + 0 * BPS) = 0x01010101U * AVG3(X, I, J);\n  *(uint32_t*)(dst + 1 * BPS) = 0x01010101U * AVG3(I, J, K);\n  *(uint32_t*)(dst + 2 * BPS) = 0x01010101U * AVG3(J, K, L);\n  *(uint32_t*)(dst + 3 * BPS) = 0x01010101U * AVG3(K, L, L);\n}\n\nstatic void DC4(uint8_t* dst, const uint8_t* top) {\n  uint32_t dc = 4;\n  int i;\n  for (i = 0; i < 4; ++i) dc += top[i] + top[-5 + i];\n  Fill(dst, dc >> 3, 4);\n}\n\nstatic void RD4(uint8_t* dst, const uint8_t* top) {\n  const int X = top[-1];\n  const int I = top[-2];\n  const int J = top[-3];\n  const int K = top[-4];\n  const int L = top[-5];\n  const int A = top[0];\n  const int B = top[1];\n  const int C = top[2];\n  const int D = top[3];\n  DST(0, 3)                                     = AVG3(J, K, L);\n  DST(0, 2) = DST(1, 3)                         = AVG3(I, J, K);\n  DST(0, 1) = DST(1, 2) = DST(2, 3)             = AVG3(X, I, J);\n  DST(0, 0) = DST(1, 1) = DST(2, 2) = DST(3, 3) = AVG3(A, X, I);\n  DST(1, 0) = DST(2, 1) = DST(3, 2)             = AVG3(B, A, X);\n  DST(2, 0) = DST(3, 1)                         = AVG3(C, B, A);\n  DST(3, 0)                                     = AVG3(D, C, B);\n}\n\nstatic void LD4(uint8_t* dst, const uint8_t* top) {\n  const int A = top[0];\n  const int B = top[1];\n  const int C = top[2];\n  const int D = top[3];\n  const int E = top[4];\n  const int F = top[5];\n  const int G = top[6];\n  const int H = top[7];\n  DST(0, 0)                                     = AVG3(A, B, C);\n  DST(1, 0) = DST(0, 1)                         = AVG3(B, C, D);\n  DST(2, 0) = DST(1, 1) = DST(0, 2)             = AVG3(C, D, E);\n  DST(3, 0) = DST(2, 1) = DST(1, 2) = DST(0, 3) = AVG3(D, E, F);\n  DST(3, 1) = DST(2, 2) = DST(1, 3)             = AVG3(E, F, G);\n  DST(3, 2) = DST(2, 3)                         = AVG3(F, G, H);\n  DST(3, 3)                                     = AVG3(G, H, H);\n}\n\nstatic void VR4(uint8_t* dst, const uint8_t* top) {\n  const int X = top[-1];\n  const int I = top[-2];\n  const int J = top[-3];\n  const int K = top[-4];\n  const int A = top[0];\n  const int B = top[1];\n  const int C = top[2];\n  const int D = top[3];\n  DST(0, 0) = DST(1, 2) = AVG2(X, A);\n  DST(1, 0) = DST(2, 2) = AVG2(A, B);\n  DST(2, 0) = DST(3, 2) = AVG2(B, C);\n  DST(3, 0)             = AVG2(C, D);\n\n  DST(0, 3) =             AVG3(K, J, I);\n  DST(0, 2) =             AVG3(J, I, X);\n  DST(0, 1) = DST(1, 3) = AVG3(I, X, A);\n  DST(1, 1) = DST(2, 3) = AVG3(X, A, B);\n  DST(2, 1) = DST(3, 3) = AVG3(A, B, C);\n  DST(3, 1) =             AVG3(B, C, D);\n}\n\nstatic void VL4(uint8_t* dst, const uint8_t* top) {\n  const int A = top[0];\n  const int B = top[1];\n  const int C = top[2];\n  const int D = top[3];\n  const int E = top[4];\n  const int F = top[5];\n  const int G = top[6];\n  const int H = top[7];\n  DST(0, 0) =             AVG2(A, B);\n  DST(1, 0) = DST(0, 2) = AVG2(B, C);\n  DST(2, 0) = DST(1, 2) = AVG2(C, D);\n  DST(3, 0) = DST(2, 2) = AVG2(D, E);\n\n  DST(0, 1) =             AVG3(A, B, C);\n  DST(1, 1) = DST(0, 3) = AVG3(B, C, D);\n  DST(2, 1) = DST(1, 3) = AVG3(C, D, E);\n  DST(3, 1) = DST(2, 3) = AVG3(D, E, F);\n              DST(3, 2) = AVG3(E, F, G);\n              DST(3, 3) = AVG3(F, G, H);\n}\n\nstatic void HU4(uint8_t* dst, const uint8_t* top) {\n  const int I = top[-2];\n  const int J = top[-3];\n  const int K = top[-4];\n  const int L = top[-5];\n  DST(0, 0) =             AVG2(I, J);\n  DST(2, 0) = DST(0, 1) = AVG2(J, K);\n  DST(2, 1) = DST(0, 2) = AVG2(K, L);\n  DST(1, 0) =             AVG3(I, J, K);\n  DST(3, 0) = DST(1, 1) = AVG3(J, K, L);\n  DST(3, 1) = DST(1, 2) = AVG3(K, L, L);\n  DST(3, 2) = DST(2, 2) =\n  DST(0, 3) = DST(1, 3) = DST(2, 3) = DST(3, 3) = L;\n}\n\nstatic void HD4(uint8_t* dst, const uint8_t* top) {\n  const int X = top[-1];\n  const int I = top[-2];\n  const int J = top[-3];\n  const int K = top[-4];\n  const int L = top[-5];\n  const int A = top[0];\n  const int B = top[1];\n  const int C = top[2];\n\n  DST(0, 0) = DST(2, 1) = AVG2(I, X);\n  DST(0, 1) = DST(2, 2) = AVG2(J, I);\n  DST(0, 2) = DST(2, 3) = AVG2(K, J);\n  DST(0, 3)             = AVG2(L, K);\n\n  DST(3, 0)             = AVG3(A, B, C);\n  DST(2, 0)             = AVG3(X, A, B);\n  DST(1, 0) = DST(3, 1) = AVG3(I, X, A);\n  DST(1, 1) = DST(3, 2) = AVG3(J, I, X);\n  DST(1, 2) = DST(3, 3) = AVG3(K, J, I);\n  DST(1, 3)             = AVG3(L, K, J);\n}\n\nstatic void TM4(uint8_t* dst, const uint8_t* top) {\n  int x, y;\n  const uint8_t* const clip = clip1 + 255 - top[-1];\n  for (y = 0; y < 4; ++y) {\n    const uint8_t* const clip_table = clip + top[-2 - y];\n    for (x = 0; x < 4; ++x) {\n      dst[x] = clip_table[top[x]];\n    }\n    dst += BPS;\n  }\n}\n\n#undef DST\n#undef AVG3\n#undef AVG2\n\n// Left samples are top[-5 .. -2], top_left is top[-1], top are\n// located at top[0..3], and top right is top[4..7]\nstatic void Intra4Preds(uint8_t* dst, const uint8_t* top) {\n  DC4(I4DC4 + dst, top);\n  TM4(I4TM4 + dst, top);\n  VE4(I4VE4 + dst, top);\n  HE4(I4HE4 + dst, top);\n  RD4(I4RD4 + dst, top);\n  VR4(I4VR4 + dst, top);\n  LD4(I4LD4 + dst, top);\n  VL4(I4VL4 + dst, top);\n  HD4(I4HD4 + dst, top);\n  HU4(I4HU4 + dst, top);\n}\n\n//------------------------------------------------------------------------------\n// Metric\n\nstatic WEBP_INLINE int GetSSE(const uint8_t* a, const uint8_t* b,\n                              int w, int h) {\n  int count = 0;\n  int y, x;\n  for (y = 0; y < h; ++y) {\n    for (x = 0; x < w; ++x) {\n      const int diff = (int)a[x] - b[x];\n      count += diff * diff;\n    }\n    a += BPS;\n    b += BPS;\n  }\n  return count;\n}\n\nstatic int SSE16x16(const uint8_t* a, const uint8_t* b) {\n  return GetSSE(a, b, 16, 16);\n}\nstatic int SSE16x8(const uint8_t* a, const uint8_t* b) {\n  return GetSSE(a, b, 16, 8);\n}\nstatic int SSE8x8(const uint8_t* a, const uint8_t* b) {\n  return GetSSE(a, b, 8, 8);\n}\nstatic int SSE4x4(const uint8_t* a, const uint8_t* b) {\n  return GetSSE(a, b, 4, 4);\n}\n\n//------------------------------------------------------------------------------\n// Texture distortion\n//\n// We try to match the spectral content (weighted) between source and\n// reconstructed samples.\n\n// Hadamard transform\n// Returns the weighted sum of the absolute value of transformed coefficients.\nstatic int TTransform(const uint8_t* in, const uint16_t* w) {\n  int sum = 0;\n  int tmp[16];\n  int i;\n  // horizontal pass\n  for (i = 0; i < 4; ++i, in += BPS) {\n    const int a0 = in[0] + in[2];\n    const int a1 = in[1] + in[3];\n    const int a2 = in[1] - in[3];\n    const int a3 = in[0] - in[2];\n    tmp[0 + i * 4] = a0 + a1;\n    tmp[1 + i * 4] = a3 + a2;\n    tmp[2 + i * 4] = a3 - a2;\n    tmp[3 + i * 4] = a0 - a1;\n  }\n  // vertical pass\n  for (i = 0; i < 4; ++i, ++w) {\n    const int a0 = tmp[0 + i] + tmp[8 + i];\n    const int a1 = tmp[4 + i] + tmp[12+ i];\n    const int a2 = tmp[4 + i] - tmp[12+ i];\n    const int a3 = tmp[0 + i] - tmp[8 + i];\n    const int b0 = a0 + a1;\n    const int b1 = a3 + a2;\n    const int b2 = a3 - a2;\n    const int b3 = a0 - a1;\n\n    sum += w[ 0] * abs(b0);\n    sum += w[ 4] * abs(b1);\n    sum += w[ 8] * abs(b2);\n    sum += w[12] * abs(b3);\n  }\n  return sum;\n}\n\nstatic int Disto4x4(const uint8_t* const a, const uint8_t* const b,\n                    const uint16_t* const w) {\n  const int sum1 = TTransform(a, w);\n  const int sum2 = TTransform(b, w);\n  return abs(sum2 - sum1) >> 5;\n}\n\nstatic int Disto16x16(const uint8_t* const a, const uint8_t* const b,\n                      const uint16_t* const w) {\n  int D = 0;\n  int x, y;\n  for (y = 0; y < 16 * BPS; y += 4 * BPS) {\n    for (x = 0; x < 16; x += 4) {\n      D += Disto4x4(a + x + y, b + x + y, w);\n    }\n  }\n  return D;\n}\n\n//------------------------------------------------------------------------------\n// Quantization\n//\n\nstatic const uint8_t kZigzag[16] = {\n  0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15\n};\n\n// Simple quantization\nstatic int QuantizeBlock(int16_t in[16], int16_t out[16],\n                         const VP8Matrix* const mtx) {\n  int last = -1;\n  int n;\n  for (n = 0; n < 16; ++n) {\n    const int j = kZigzag[n];\n    const int sign = (in[j] < 0);\n    const uint32_t coeff = (sign ? -in[j] : in[j]) + mtx->sharpen_[j];\n    if (coeff > mtx->zthresh_[j]) {\n      const uint32_t Q = mtx->q_[j];\n      const uint32_t iQ = mtx->iq_[j];\n      const uint32_t B = mtx->bias_[j];\n      int level = QUANTDIV(coeff, iQ, B);\n      if (level > MAX_LEVEL) level = MAX_LEVEL;\n      if (sign) level = -level;\n      in[j] = level * Q;\n      out[n] = level;\n      if (level) last = n;\n    } else {\n      out[n] = 0;\n      in[j] = 0;\n    }\n  }\n  return (last >= 0);\n}\n\nstatic int QuantizeBlockWHT(int16_t in[16], int16_t out[16],\n                            const VP8Matrix* const mtx) {\n  int n, last = -1;\n  for (n = 0; n < 16; ++n) {\n    const int j = kZigzag[n];\n    const int sign = (in[j] < 0);\n    const uint32_t coeff = sign ? -in[j] : in[j];\n    assert(mtx->sharpen_[j] == 0);\n    if (coeff > mtx->zthresh_[j]) {\n      const uint32_t Q = mtx->q_[j];\n      const uint32_t iQ = mtx->iq_[j];\n      const uint32_t B = mtx->bias_[j];\n      int level = QUANTDIV(coeff, iQ, B);\n      if (level > MAX_LEVEL) level = MAX_LEVEL;\n      if (sign) level = -level;\n      in[j] = level * Q;\n      out[n] = level;\n      if (level) last = n;\n    } else {\n      out[n] = 0;\n      in[j] = 0;\n    }\n  }\n  return (last >= 0);\n}\n\n//------------------------------------------------------------------------------\n// Block copy\n\nstatic WEBP_INLINE void Copy(const uint8_t* src, uint8_t* dst, int size) {\n  int y;\n  for (y = 0; y < size; ++y) {\n    memcpy(dst, src, size);\n    src += BPS;\n    dst += BPS;\n  }\n}\n\nstatic void Copy4x4(const uint8_t* src, uint8_t* dst) { Copy(src, dst, 4); }\n\n//------------------------------------------------------------------------------\n// Initialization\n\n// Speed-critical function pointers. We have to initialize them to the default\n// implementations within VP8EncDspInit().\nVP8CHisto VP8CollectHistogram;\nVP8Idct VP8ITransform;\nVP8Fdct VP8FTransform;\nVP8WHT VP8FTransformWHT;\nVP8Intra4Preds VP8EncPredLuma4;\nVP8IntraPreds VP8EncPredLuma16;\nVP8IntraPreds VP8EncPredChroma8;\nVP8Metric VP8SSE16x16;\nVP8Metric VP8SSE8x8;\nVP8Metric VP8SSE16x8;\nVP8Metric VP8SSE4x4;\nVP8WMetric VP8TDisto4x4;\nVP8WMetric VP8TDisto16x16;\nVP8QuantizeBlock VP8EncQuantizeBlock;\nVP8QuantizeBlockWHT VP8EncQuantizeBlockWHT;\nVP8BlockCopy VP8Copy4x4;\n\nextern void VP8EncDspInitSSE2(void);\nextern void VP8EncDspInitAVX2(void);\nextern void VP8EncDspInitNEON(void);\nextern void VP8EncDspInitMIPS32(void);\n\nvoid VP8EncDspInit(void) {\n  VP8DspInit();  // common inverse transforms\n  InitTables();\n\n  // default C implementations\n  VP8CollectHistogram = CollectHistogram;\n  VP8ITransform = ITransform;\n  VP8FTransform = FTransform;\n  VP8FTransformWHT = FTransformWHT;\n  VP8EncPredLuma4 = Intra4Preds;\n  VP8EncPredLuma16 = Intra16Preds;\n  VP8EncPredChroma8 = IntraChromaPreds;\n  VP8SSE16x16 = SSE16x16;\n  VP8SSE8x8 = SSE8x8;\n  VP8SSE16x8 = SSE16x8;\n  VP8SSE4x4 = SSE4x4;\n  VP8TDisto4x4 = Disto4x4;\n  VP8TDisto16x16 = Disto16x16;\n  VP8EncQuantizeBlock = QuantizeBlock;\n  VP8EncQuantizeBlockWHT = QuantizeBlockWHT;\n  VP8Copy4x4 = Copy4x4;\n\n  // If defined, use CPUInfo() to overwrite some pointers with faster versions.\n  if (VP8GetCPUInfo != NULL) {\n#if defined(WEBP_USE_SSE2)\n    if (VP8GetCPUInfo(kSSE2)) {\n      VP8EncDspInitSSE2();\n    }\n#endif\n#if defined(WEBP_USE_AVX2)\n    if (VP8GetCPUInfo(kAVX2)) {\n      VP8EncDspInitAVX2();\n    }\n#endif\n#if defined(WEBP_USE_NEON)\n    if (VP8GetCPUInfo(kNEON)) {\n      VP8EncDspInitNEON();\n    }\n#endif\n#if defined(WEBP_USE_MIPS32)\n    if (VP8GetCPUInfo(kMIPS32)) {\n      VP8EncDspInitMIPS32();\n    }\n#endif\n  }\n}\n\n"
  },
  {
    "path": "ext/libwebp/dsp/enc_avx2.c",
    "content": "// Copyright 2014 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// AVX2 version of speed-critical encoding functions.\n\n#include \"./dsp.h\"\n\n#if defined(WEBP_USE_AVX2)\n\n#endif  // WEBP_USE_AVX2\n\n//------------------------------------------------------------------------------\n// Entry point\n\nextern void VP8EncDspInitAVX2(void);\n\nvoid VP8EncDspInitAVX2(void) {\n}\n"
  },
  {
    "path": "ext/libwebp/dsp/enc_mips32.c",
    "content": "// Copyright 2014 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// MIPS version of speed-critical encoding functions.\n//\n// Author(s): Djordje Pesut    (djordje.pesut@imgtec.com)\n//            Jovan Zelincevic (jovan.zelincevic@imgtec.com)\n//            Slobodan Prijic  (slobodan.prijic@imgtec.com)\n\n#include \"./dsp.h\"\n\n#if defined(WEBP_USE_MIPS32)\n\n#include \"../enc/vp8enci.h\"\n#include \"../enc/cost.h\"\n\n#if defined(__GNUC__) && defined(__ANDROID__) && LOCAL_GCC_VERSION == 0x409\n#define WORK_AROUND_GCC\n#endif\n\nstatic const int kC1 = 20091 + (1 << 16);\nstatic const int kC2 = 35468;\n\n// macro for one vertical pass in ITransformOne\n// MUL macro inlined\n// temp0..temp15 holds tmp[0]..tmp[15]\n// A..D - offsets in bytes to load from in buffer\n// TEMP0..TEMP3 - registers for corresponding tmp elements\n// TEMP4..TEMP5 - temporary registers\n#define VERTICAL_PASS(A, B, C, D, TEMP4, TEMP0, TEMP1, TEMP2, TEMP3)        \\\n  \"lh      %[temp16],      \"#A\"(%[temp20])                 \\n\\t\"            \\\n  \"lh      %[temp18],      \"#B\"(%[temp20])                 \\n\\t\"            \\\n  \"lh      %[temp17],      \"#C\"(%[temp20])                 \\n\\t\"            \\\n  \"lh      %[temp19],      \"#D\"(%[temp20])                 \\n\\t\"            \\\n  \"addu    %[\"#TEMP4\"],    %[temp16],      %[temp18]       \\n\\t\"            \\\n  \"subu    %[temp16],      %[temp16],      %[temp18]       \\n\\t\"            \\\n  \"mul     %[\"#TEMP0\"],    %[temp17],      %[kC2]          \\n\\t\"            \\\n  \"mul     %[temp18],      %[temp19],      %[kC1]          \\n\\t\"            \\\n  \"mul     %[temp17],      %[temp17],      %[kC1]          \\n\\t\"            \\\n  \"mul     %[temp19],      %[temp19],      %[kC2]          \\n\\t\"            \\\n  \"sra     %[\"#TEMP0\"],    %[\"#TEMP0\"],    16              \\n\\n\"            \\\n  \"sra     %[temp18],      %[temp18],      16              \\n\\n\"            \\\n  \"sra     %[temp17],      %[temp17],      16              \\n\\n\"            \\\n  \"sra     %[temp19],      %[temp19],      16              \\n\\n\"            \\\n  \"subu    %[\"#TEMP2\"],    %[\"#TEMP0\"],    %[temp18]       \\n\\t\"            \\\n  \"addu    %[\"#TEMP3\"],    %[temp17],      %[temp19]       \\n\\t\"            \\\n  \"addu    %[\"#TEMP0\"],    %[\"#TEMP4\"],    %[\"#TEMP3\"]     \\n\\t\"            \\\n  \"addu    %[\"#TEMP1\"],    %[temp16],      %[\"#TEMP2\"]     \\n\\t\"            \\\n  \"subu    %[\"#TEMP2\"],    %[temp16],      %[\"#TEMP2\"]     \\n\\t\"            \\\n  \"subu    %[\"#TEMP3\"],    %[\"#TEMP4\"],    %[\"#TEMP3\"]     \\n\\t\"\n\n// macro for one horizontal pass in ITransformOne\n// MUL and STORE macros inlined\n// a = clip_8b(a) is replaced with: a = max(a, 0); a = min(a, 255)\n// temp0..temp15 holds tmp[0]..tmp[15]\n// A..D - offsets in bytes to load from ref and store to dst buffer\n// TEMP0, TEMP4, TEMP8 and TEMP12 - registers for corresponding tmp elements\n#define HORIZONTAL_PASS(A, B, C, D, TEMP0, TEMP4, TEMP8, TEMP12)            \\\n  \"addiu   %[\"#TEMP0\"],    %[\"#TEMP0\"],    4               \\n\\t\"            \\\n  \"addu    %[temp16],      %[\"#TEMP0\"],    %[\"#TEMP8\"]     \\n\\t\"            \\\n  \"subu    %[temp17],      %[\"#TEMP0\"],    %[\"#TEMP8\"]     \\n\\t\"            \\\n  \"mul     %[\"#TEMP0\"],    %[\"#TEMP4\"],    %[kC2]          \\n\\t\"            \\\n  \"mul     %[\"#TEMP8\"],    %[\"#TEMP12\"],   %[kC1]          \\n\\t\"            \\\n  \"mul     %[\"#TEMP4\"],    %[\"#TEMP4\"],    %[kC1]          \\n\\t\"            \\\n  \"mul     %[\"#TEMP12\"],   %[\"#TEMP12\"],   %[kC2]          \\n\\t\"            \\\n  \"sra     %[\"#TEMP0\"],    %[\"#TEMP0\"],    16              \\n\\t\"            \\\n  \"sra     %[\"#TEMP8\"],    %[\"#TEMP8\"],    16              \\n\\t\"            \\\n  \"sra     %[\"#TEMP4\"],    %[\"#TEMP4\"],    16              \\n\\t\"            \\\n  \"sra     %[\"#TEMP12\"],   %[\"#TEMP12\"],   16              \\n\\t\"            \\\n  \"subu    %[temp18],      %[\"#TEMP0\"],    %[\"#TEMP8\"]     \\n\\t\"            \\\n  \"addu    %[temp19],      %[\"#TEMP4\"],    %[\"#TEMP12\"]    \\n\\t\"            \\\n  \"addu    %[\"#TEMP0\"],    %[temp16],      %[temp19]       \\n\\t\"            \\\n  \"addu    %[\"#TEMP4\"],    %[temp17],      %[temp18]       \\n\\t\"            \\\n  \"subu    %[\"#TEMP8\"],    %[temp17],      %[temp18]       \\n\\t\"            \\\n  \"subu    %[\"#TEMP12\"],   %[temp16],      %[temp19]       \\n\\t\"            \\\n  \"lw      %[temp20],      0(%[args])                      \\n\\t\"            \\\n  \"sra     %[\"#TEMP0\"],    %[\"#TEMP0\"],    3               \\n\\t\"            \\\n  \"sra     %[\"#TEMP4\"],    %[\"#TEMP4\"],    3               \\n\\t\"            \\\n  \"sra     %[\"#TEMP8\"],    %[\"#TEMP8\"],    3               \\n\\t\"            \\\n  \"sra     %[\"#TEMP12\"],   %[\"#TEMP12\"],   3               \\n\\t\"            \\\n  \"lbu     %[temp16],      \"#A\"(%[temp20])                 \\n\\t\"            \\\n  \"lbu     %[temp17],      \"#B\"(%[temp20])                 \\n\\t\"            \\\n  \"lbu     %[temp18],      \"#C\"(%[temp20])                 \\n\\t\"            \\\n  \"lbu     %[temp19],      \"#D\"(%[temp20])                 \\n\\t\"            \\\n  \"addu    %[\"#TEMP0\"],    %[temp16],      %[\"#TEMP0\"]     \\n\\t\"            \\\n  \"addu    %[\"#TEMP4\"],    %[temp17],      %[\"#TEMP4\"]     \\n\\t\"            \\\n  \"addu    %[\"#TEMP8\"],    %[temp18],      %[\"#TEMP8\"]     \\n\\t\"            \\\n  \"addu    %[\"#TEMP12\"],   %[temp19],      %[\"#TEMP12\"]    \\n\\t\"            \\\n  \"slt     %[temp16],      %[\"#TEMP0\"],    $zero           \\n\\t\"            \\\n  \"slt     %[temp17],      %[\"#TEMP4\"],    $zero           \\n\\t\"            \\\n  \"slt     %[temp18],      %[\"#TEMP8\"],    $zero           \\n\\t\"            \\\n  \"slt     %[temp19],      %[\"#TEMP12\"],   $zero           \\n\\t\"            \\\n  \"movn    %[\"#TEMP0\"],    $zero,          %[temp16]       \\n\\t\"            \\\n  \"movn    %[\"#TEMP4\"],    $zero,          %[temp17]       \\n\\t\"            \\\n  \"movn    %[\"#TEMP8\"],    $zero,          %[temp18]       \\n\\t\"            \\\n  \"movn    %[\"#TEMP12\"],   $zero,          %[temp19]       \\n\\t\"            \\\n  \"addiu   %[temp20],      $zero,          255             \\n\\t\"            \\\n  \"slt     %[temp16],      %[\"#TEMP0\"],    %[temp20]       \\n\\t\"            \\\n  \"slt     %[temp17],      %[\"#TEMP4\"],    %[temp20]       \\n\\t\"            \\\n  \"slt     %[temp18],      %[\"#TEMP8\"],    %[temp20]       \\n\\t\"            \\\n  \"slt     %[temp19],      %[\"#TEMP12\"],   %[temp20]       \\n\\t\"            \\\n  \"movz    %[\"#TEMP0\"],    %[temp20],      %[temp16]       \\n\\t\"            \\\n  \"movz    %[\"#TEMP4\"],    %[temp20],      %[temp17]       \\n\\t\"            \\\n  \"lw      %[temp16],      8(%[args])                      \\n\\t\"            \\\n  \"movz    %[\"#TEMP8\"],    %[temp20],      %[temp18]       \\n\\t\"            \\\n  \"movz    %[\"#TEMP12\"],   %[temp20],      %[temp19]       \\n\\t\"            \\\n  \"sb      %[\"#TEMP0\"],    \"#A\"(%[temp16])                 \\n\\t\"            \\\n  \"sb      %[\"#TEMP4\"],    \"#B\"(%[temp16])                 \\n\\t\"            \\\n  \"sb      %[\"#TEMP8\"],    \"#C\"(%[temp16])                 \\n\\t\"            \\\n  \"sb      %[\"#TEMP12\"],   \"#D\"(%[temp16])                 \\n\\t\"\n\n// Does one or two inverse transforms.\nstatic WEBP_INLINE void ITransformOne(const uint8_t* ref, const int16_t* in,\n                                      uint8_t* dst) {\n  int temp0, temp1, temp2, temp3, temp4, temp5, temp6;\n  int temp7, temp8, temp9, temp10, temp11, temp12, temp13;\n  int temp14, temp15, temp16, temp17, temp18, temp19, temp20;\n  const int* args[3] = {(const int*)ref, (const int*)in, (const int*)dst};\n\n  __asm__ volatile(\n    \"lw      %[temp20],      4(%[args])                      \\n\\t\"\n    VERTICAL_PASS(0, 16,  8, 24, temp4,  temp0,  temp1,  temp2,  temp3)\n    VERTICAL_PASS(2, 18, 10, 26, temp8,  temp4,  temp5,  temp6,  temp7)\n    VERTICAL_PASS(4, 20, 12, 28, temp12, temp8,  temp9,  temp10, temp11)\n    VERTICAL_PASS(6, 22, 14, 30, temp20, temp12, temp13, temp14, temp15)\n\n    HORIZONTAL_PASS( 0,  1,  2,  3, temp0, temp4, temp8,  temp12)\n    HORIZONTAL_PASS(16, 17, 18, 19, temp1, temp5, temp9,  temp13)\n    HORIZONTAL_PASS(32, 33, 34, 35, temp2, temp6, temp10, temp14)\n    HORIZONTAL_PASS(48, 49, 50, 51, temp3, temp7, temp11, temp15)\n\n    : [temp0]\"=&r\"(temp0), [temp1]\"=&r\"(temp1), [temp2]\"=&r\"(temp2),\n      [temp3]\"=&r\"(temp3), [temp4]\"=&r\"(temp4), [temp5]\"=&r\"(temp5),\n      [temp6]\"=&r\"(temp6), [temp7]\"=&r\"(temp7), [temp8]\"=&r\"(temp8),\n      [temp9]\"=&r\"(temp9), [temp10]\"=&r\"(temp10), [temp11]\"=&r\"(temp11),\n      [temp12]\"=&r\"(temp12), [temp13]\"=&r\"(temp13), [temp14]\"=&r\"(temp14),\n      [temp15]\"=&r\"(temp15), [temp16]\"=&r\"(temp16), [temp17]\"=&r\"(temp17),\n      [temp18]\"=&r\"(temp18), [temp19]\"=&r\"(temp19), [temp20]\"=&r\"(temp20)\n    : [args]\"r\"(args), [kC1]\"r\"(kC1), [kC2]\"r\"(kC2)\n    : \"memory\", \"hi\", \"lo\"\n  );\n}\n\nstatic void ITransform(const uint8_t* ref, const int16_t* in,\n                       uint8_t* dst, int do_two) {\n  ITransformOne(ref, in, dst);\n  if (do_two) {\n    ITransformOne(ref + 4, in + 16, dst + 4);\n  }\n}\n\n#undef VERTICAL_PASS\n#undef HORIZONTAL_PASS\n\n// macro for one pass through for loop in QuantizeBlock\n// QUANTDIV macro inlined\n// J - offset in bytes (kZigzag[n] * 2)\n// K - offset in bytes (kZigzag[n] * 4)\n// N - offset in bytes (n * 2)\n#define QUANTIZE_ONE(J, K, N)                                               \\\n  \"lh           %[temp0],       \"#J\"(%[ppin])                       \\n\\t\"   \\\n  \"lhu          %[temp1],       \"#J\"(%[ppsharpen])                  \\n\\t\"   \\\n  \"lw           %[temp2],       \"#K\"(%[ppzthresh])                  \\n\\t\"   \\\n  \"sra          %[sign],        %[temp0],           15              \\n\\t\"   \\\n  \"xor          %[coeff],       %[temp0],           %[sign]         \\n\\t\"   \\\n  \"subu         %[coeff],       %[coeff],           %[sign]         \\n\\t\"   \\\n  \"addu         %[coeff],       %[coeff],           %[temp1]        \\n\\t\"   \\\n  \"slt          %[temp4],       %[temp2],           %[coeff]        \\n\\t\"   \\\n  \"addiu        %[temp5],       $zero,              0               \\n\\t\"   \\\n  \"addiu        %[level],       $zero,              0               \\n\\t\"   \\\n  \"beqz         %[temp4],       2f                                  \\n\\t\"   \\\n  \"lhu          %[temp1],       \"#J\"(%[ppiq])                       \\n\\t\"   \\\n  \"lw           %[temp2],       \"#K\"(%[ppbias])                     \\n\\t\"   \\\n  \"lhu          %[temp3],       \"#J\"(%[ppq])                        \\n\\t\"   \\\n  \"mul          %[level],       %[coeff],           %[temp1]        \\n\\t\"   \\\n  \"addu         %[level],       %[level],           %[temp2]        \\n\\t\"   \\\n  \"sra          %[level],       %[level],           17              \\n\\t\"   \\\n  \"slt          %[temp4],       %[max_level],       %[level]        \\n\\t\"   \\\n  \"movn         %[level],       %[max_level],       %[temp4]        \\n\\t\"   \\\n  \"xor          %[level],       %[level],           %[sign]         \\n\\t\"   \\\n  \"subu         %[level],       %[level],           %[sign]         \\n\\t\"   \\\n  \"mul          %[temp5],       %[level],           %[temp3]        \\n\\t\"   \\\n\"2:                                                                 \\n\\t\"   \\\n  \"sh           %[temp5],       \"#J\"(%[ppin])                       \\n\\t\"   \\\n  \"sh           %[level],       \"#N\"(%[pout])                       \\n\\t\"\n\nstatic int QuantizeBlock(int16_t in[16], int16_t out[16],\n                         const VP8Matrix* const mtx) {\n  int temp0, temp1, temp2, temp3, temp4, temp5;\n  int sign, coeff, level, i;\n  int max_level = MAX_LEVEL;\n\n  int16_t* ppin             = &in[0];\n  int16_t* pout             = &out[0];\n  const uint16_t* ppsharpen = &mtx->sharpen_[0];\n  const uint32_t* ppzthresh = &mtx->zthresh_[0];\n  const uint16_t* ppq       = &mtx->q_[0];\n  const uint16_t* ppiq      = &mtx->iq_[0];\n  const uint32_t* ppbias    = &mtx->bias_[0];\n\n  __asm__ volatile(\n    QUANTIZE_ONE( 0,  0,  0)\n    QUANTIZE_ONE( 2,  4,  2)\n    QUANTIZE_ONE( 8, 16,  4)\n    QUANTIZE_ONE(16, 32,  6)\n    QUANTIZE_ONE(10, 20,  8)\n    QUANTIZE_ONE( 4,  8, 10)\n    QUANTIZE_ONE( 6, 12, 12)\n    QUANTIZE_ONE(12, 24, 14)\n    QUANTIZE_ONE(18, 36, 16)\n    QUANTIZE_ONE(24, 48, 18)\n    QUANTIZE_ONE(26, 52, 20)\n    QUANTIZE_ONE(20, 40, 22)\n    QUANTIZE_ONE(14, 28, 24)\n    QUANTIZE_ONE(22, 44, 26)\n    QUANTIZE_ONE(28, 56, 28)\n    QUANTIZE_ONE(30, 60, 30)\n\n    : [temp0]\"=&r\"(temp0), [temp1]\"=&r\"(temp1),\n      [temp2]\"=&r\"(temp2), [temp3]\"=&r\"(temp3),\n      [temp4]\"=&r\"(temp4), [temp5]\"=&r\"(temp5),\n      [sign]\"=&r\"(sign), [coeff]\"=&r\"(coeff),\n      [level]\"=&r\"(level)\n    : [pout]\"r\"(pout), [ppin]\"r\"(ppin),\n      [ppiq]\"r\"(ppiq), [max_level]\"r\"(max_level),\n      [ppbias]\"r\"(ppbias), [ppzthresh]\"r\"(ppzthresh),\n      [ppsharpen]\"r\"(ppsharpen), [ppq]\"r\"(ppq)\n    : \"memory\", \"hi\", \"lo\"\n  );\n\n  // moved out from macro to increase possibility for earlier breaking\n  for (i = 15; i >= 0; i--) {\n    if (out[i]) return 1;\n  }\n  return 0;\n}\n\n#undef QUANTIZE_ONE\n\n// macro for one horizontal pass in Disto4x4 (TTransform)\n// two calls of function TTransform are merged into single one\n// A..D - offsets in bytes to load from a and b buffers\n// E..H - offsets in bytes to store first results to tmp buffer\n// E1..H1 - offsets in bytes to store second results to tmp buffer\n#define HORIZONTAL_PASS(A, B, C, D, E, F, G, H, E1, F1, G1, H1)   \\\n  \"lbu    %[temp0],  \"#A\"(%[a])              \\n\\t\"                \\\n  \"lbu    %[temp1],  \"#B\"(%[a])              \\n\\t\"                \\\n  \"lbu    %[temp2],  \"#C\"(%[a])              \\n\\t\"                \\\n  \"lbu    %[temp3],  \"#D\"(%[a])              \\n\\t\"                \\\n  \"lbu    %[temp4],  \"#A\"(%[b])              \\n\\t\"                \\\n  \"lbu    %[temp5],  \"#B\"(%[b])              \\n\\t\"                \\\n  \"lbu    %[temp6],  \"#C\"(%[b])              \\n\\t\"                \\\n  \"lbu    %[temp7],  \"#D\"(%[b])              \\n\\t\"                \\\n  \"addu   %[temp8],  %[temp0],    %[temp2]   \\n\\t\"                \\\n  \"subu   %[temp0],  %[temp0],    %[temp2]   \\n\\t\"                \\\n  \"addu   %[temp2],  %[temp1],    %[temp3]   \\n\\t\"                \\\n  \"subu   %[temp1],  %[temp1],    %[temp3]   \\n\\t\"                \\\n  \"addu   %[temp3],  %[temp4],    %[temp6]   \\n\\t\"                \\\n  \"subu   %[temp4],  %[temp4],    %[temp6]   \\n\\t\"                \\\n  \"addu   %[temp6],  %[temp5],    %[temp7]   \\n\\t\"                \\\n  \"subu   %[temp5],  %[temp5],    %[temp7]   \\n\\t\"                \\\n  \"addu   %[temp7],  %[temp8],    %[temp2]   \\n\\t\"                \\\n  \"subu   %[temp2],  %[temp8],    %[temp2]   \\n\\t\"                \\\n  \"addu   %[temp8],  %[temp0],    %[temp1]   \\n\\t\"                \\\n  \"subu   %[temp0],  %[temp0],    %[temp1]   \\n\\t\"                \\\n  \"addu   %[temp1],  %[temp3],    %[temp6]   \\n\\t\"                \\\n  \"subu   %[temp3],  %[temp3],    %[temp6]   \\n\\t\"                \\\n  \"addu   %[temp6],  %[temp4],    %[temp5]   \\n\\t\"                \\\n  \"subu   %[temp4],  %[temp4],    %[temp5]   \\n\\t\"                \\\n  \"sw     %[temp7],  \"#E\"(%[tmp])            \\n\\t\"                \\\n  \"sw     %[temp2],  \"#H\"(%[tmp])            \\n\\t\"                \\\n  \"sw     %[temp8],  \"#F\"(%[tmp])            \\n\\t\"                \\\n  \"sw     %[temp0],  \"#G\"(%[tmp])            \\n\\t\"                \\\n  \"sw     %[temp1],  \"#E1\"(%[tmp])           \\n\\t\"                \\\n  \"sw     %[temp3],  \"#H1\"(%[tmp])           \\n\\t\"                \\\n  \"sw     %[temp6],  \"#F1\"(%[tmp])           \\n\\t\"                \\\n  \"sw     %[temp4],  \"#G1\"(%[tmp])           \\n\\t\"\n\n// macro for one vertical pass in Disto4x4 (TTransform)\n// two calls of function TTransform are merged into single one\n// since only one accu is available in mips32r1 instruction set\n//   first is done second call of function TTransform and after\n//   that first one.\n//   const int sum1 = TTransform(a, w);\n//   const int sum2 = TTransform(b, w);\n//   return abs(sum2 - sum1) >> 5;\n//   (sum2 - sum1) is calculated with madds (sub2) and msubs (sub1)\n// A..D - offsets in bytes to load first results from tmp buffer\n// A1..D1 - offsets in bytes to load second results from tmp buffer\n// E..H - offsets in bytes to load from w buffer\n#define VERTICAL_PASS(A, B, C, D, A1, B1, C1, D1, E, F, G, H)     \\\n  \"lw     %[temp0],  \"#A1\"(%[tmp])           \\n\\t\"                \\\n  \"lw     %[temp1],  \"#C1\"(%[tmp])           \\n\\t\"                \\\n  \"lw     %[temp2],  \"#B1\"(%[tmp])           \\n\\t\"                \\\n  \"lw     %[temp3],  \"#D1\"(%[tmp])           \\n\\t\"                \\\n  \"addu   %[temp8],  %[temp0],    %[temp1]   \\n\\t\"                \\\n  \"subu   %[temp0],  %[temp0],    %[temp1]   \\n\\t\"                \\\n  \"addu   %[temp1],  %[temp2],    %[temp3]   \\n\\t\"                \\\n  \"subu   %[temp2],  %[temp2],    %[temp3]   \\n\\t\"                \\\n  \"addu   %[temp3],  %[temp8],    %[temp1]   \\n\\t\"                \\\n  \"subu   %[temp8],  %[temp8],    %[temp1]   \\n\\t\"                \\\n  \"addu   %[temp1],  %[temp0],    %[temp2]   \\n\\t\"                \\\n  \"subu   %[temp0],  %[temp0],    %[temp2]   \\n\\t\"                \\\n  \"sra    %[temp4],  %[temp3],    31         \\n\\t\"                \\\n  \"sra    %[temp5],  %[temp1],    31         \\n\\t\"                \\\n  \"sra    %[temp6],  %[temp0],    31         \\n\\t\"                \\\n  \"sra    %[temp7],  %[temp8],    31         \\n\\t\"                \\\n  \"xor    %[temp3],  %[temp3],    %[temp4]   \\n\\t\"                \\\n  \"xor    %[temp1],  %[temp1],    %[temp5]   \\n\\t\"                \\\n  \"xor    %[temp0],  %[temp0],    %[temp6]   \\n\\t\"                \\\n  \"xor    %[temp8],  %[temp8],    %[temp7]   \\n\\t\"                \\\n  \"subu   %[temp3],  %[temp3],    %[temp4]   \\n\\t\"                \\\n  \"subu   %[temp1],  %[temp1],    %[temp5]   \\n\\t\"                \\\n  \"subu   %[temp0],  %[temp0],    %[temp6]   \\n\\t\"                \\\n  \"subu   %[temp8],  %[temp8],    %[temp7]   \\n\\t\"                \\\n  \"lhu    %[temp4],  \"#E\"(%[w])              \\n\\t\"                \\\n  \"lhu    %[temp5],  \"#F\"(%[w])              \\n\\t\"                \\\n  \"lhu    %[temp6],  \"#G\"(%[w])              \\n\\t\"                \\\n  \"lhu    %[temp7],  \"#H\"(%[w])              \\n\\t\"                \\\n  \"madd   %[temp4],  %[temp3]                \\n\\t\"                \\\n  \"madd   %[temp5],  %[temp1]                \\n\\t\"                \\\n  \"madd   %[temp6],  %[temp0]                \\n\\t\"                \\\n  \"madd   %[temp7],  %[temp8]                \\n\\t\"                \\\n  \"lw     %[temp0],  \"#A\"(%[tmp])            \\n\\t\"                \\\n  \"lw     %[temp1],  \"#C\"(%[tmp])            \\n\\t\"                \\\n  \"lw     %[temp2],  \"#B\"(%[tmp])            \\n\\t\"                \\\n  \"lw     %[temp3],  \"#D\"(%[tmp])            \\n\\t\"                \\\n  \"addu   %[temp8],  %[temp0],    %[temp1]   \\n\\t\"                \\\n  \"subu   %[temp0],  %[temp0],    %[temp1]   \\n\\t\"                \\\n  \"addu   %[temp1],  %[temp2],    %[temp3]   \\n\\t\"                \\\n  \"subu   %[temp2],  %[temp2],    %[temp3]   \\n\\t\"                \\\n  \"addu   %[temp3],  %[temp8],    %[temp1]   \\n\\t\"                \\\n  \"subu   %[temp1],  %[temp8],    %[temp1]   \\n\\t\"                \\\n  \"addu   %[temp8],  %[temp0],    %[temp2]   \\n\\t\"                \\\n  \"subu   %[temp0],  %[temp0],    %[temp2]   \\n\\t\"                \\\n  \"sra    %[temp2],  %[temp3],    31         \\n\\t\"                \\\n  \"xor    %[temp3],  %[temp3],    %[temp2]   \\n\\t\"                \\\n  \"subu   %[temp3],  %[temp3],    %[temp2]   \\n\\t\"                \\\n  \"msub   %[temp4],  %[temp3]                \\n\\t\"                \\\n  \"sra    %[temp2],  %[temp8],    31         \\n\\t\"                \\\n  \"sra    %[temp3],  %[temp0],    31         \\n\\t\"                \\\n  \"sra    %[temp4],  %[temp1],    31         \\n\\t\"                \\\n  \"xor    %[temp8],  %[temp8],    %[temp2]   \\n\\t\"                \\\n  \"xor    %[temp0],  %[temp0],    %[temp3]   \\n\\t\"                \\\n  \"xor    %[temp1],  %[temp1],    %[temp4]   \\n\\t\"                \\\n  \"subu   %[temp8],  %[temp8],    %[temp2]   \\n\\t\"                \\\n  \"subu   %[temp0],  %[temp0],    %[temp3]   \\n\\t\"                \\\n  \"subu   %[temp1],  %[temp1],    %[temp4]   \\n\\t\"                \\\n  \"msub   %[temp5],  %[temp8]                \\n\\t\"                \\\n  \"msub   %[temp6],  %[temp0]                \\n\\t\"                \\\n  \"msub   %[temp7],  %[temp1]                \\n\\t\"\n\nstatic int Disto4x4(const uint8_t* const a, const uint8_t* const b,\n                    const uint16_t* const w) {\n  int tmp[32];\n  int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8;\n\n  __asm__ volatile(\n    HORIZONTAL_PASS( 0,  1,  2,  3,    0,  4,  8, 12,    64,  68,  72,  76)\n    HORIZONTAL_PASS(16, 17, 18, 19,   16, 20, 24, 28,    80,  84,  88,  92)\n    HORIZONTAL_PASS(32, 33, 34, 35,   32, 36, 40, 44,    96, 100, 104, 108)\n    HORIZONTAL_PASS(48, 49, 50, 51,   48, 52, 56, 60,   112, 116, 120, 124)\n    \"mthi   $zero                             \\n\\t\"\n    \"mtlo   $zero                             \\n\\t\"\n    VERTICAL_PASS( 0, 16, 32, 48,     64, 80,  96, 112,   0,  8, 16, 24)\n    VERTICAL_PASS( 4, 20, 36, 52,     68, 84, 100, 116,   2, 10, 18, 26)\n    VERTICAL_PASS( 8, 24, 40, 56,     72, 88, 104, 120,   4, 12, 20, 28)\n    VERTICAL_PASS(12, 28, 44, 60,     76, 92, 108, 124,   6, 14, 22, 30)\n    \"mflo   %[temp0]                          \\n\\t\"\n    \"sra    %[temp1],  %[temp0],  31          \\n\\t\"\n    \"xor    %[temp0],  %[temp0],  %[temp1]    \\n\\t\"\n    \"subu   %[temp0],  %[temp0],  %[temp1]    \\n\\t\"\n    \"sra    %[temp0],  %[temp0],  5           \\n\\t\"\n\n    : [temp0]\"=&r\"(temp0), [temp1]\"=&r\"(temp1), [temp2]\"=&r\"(temp2),\n      [temp3]\"=&r\"(temp3), [temp4]\"=&r\"(temp4), [temp5]\"=&r\"(temp5),\n      [temp6]\"=&r\"(temp6), [temp7]\"=&r\"(temp7), [temp8]\"=&r\"(temp8)\n    : [a]\"r\"(a), [b]\"r\"(b), [w]\"r\"(w), [tmp]\"r\"(tmp)\n    : \"memory\", \"hi\", \"lo\"\n  );\n\n  return temp0;\n}\n\n#undef VERTICAL_PASS\n#undef HORIZONTAL_PASS\n\nstatic int Disto16x16(const uint8_t* const a, const uint8_t* const b,\n                      const uint16_t* const w) {\n  int D = 0;\n  int x, y;\n  for (y = 0; y < 16 * BPS; y += 4 * BPS) {\n    for (x = 0; x < 16; x += 4) {\n      D += Disto4x4(a + x + y, b + x + y, w);\n    }\n  }\n  return D;\n}\n\n// macro for one horizontal pass in FTransform\n// temp0..temp15 holds tmp[0]..tmp[15]\n// A..D - offsets in bytes to load from src and ref buffers\n// TEMP0..TEMP3 - registers for corresponding tmp elements\n#define HORIZONTAL_PASS(A, B, C, D, TEMP0, TEMP1, TEMP2, TEMP3) \\\n  \"lw     %[\"#TEMP1\"],  0(%[args])                     \\n\\t\"    \\\n  \"lw     %[\"#TEMP2\"],  4(%[args])                     \\n\\t\"    \\\n  \"lbu    %[temp16],    \"#A\"(%[\"#TEMP1\"])              \\n\\t\"    \\\n  \"lbu    %[temp17],    \"#A\"(%[\"#TEMP2\"])              \\n\\t\"    \\\n  \"lbu    %[temp18],    \"#B\"(%[\"#TEMP1\"])              \\n\\t\"    \\\n  \"lbu    %[temp19],    \"#B\"(%[\"#TEMP2\"])              \\n\\t\"    \\\n  \"subu   %[temp20],    %[temp16],    %[temp17]        \\n\\t\"    \\\n  \"lbu    %[temp16],    \"#C\"(%[\"#TEMP1\"])              \\n\\t\"    \\\n  \"lbu    %[temp17],    \"#C\"(%[\"#TEMP2\"])              \\n\\t\"    \\\n  \"subu   %[\"#TEMP0\"],  %[temp18],    %[temp19]        \\n\\t\"    \\\n  \"lbu    %[temp18],    \"#D\"(%[\"#TEMP1\"])              \\n\\t\"    \\\n  \"lbu    %[temp19],    \"#D\"(%[\"#TEMP2\"])              \\n\\t\"    \\\n  \"subu   %[\"#TEMP1\"],  %[temp16],    %[temp17]        \\n\\t\"    \\\n  \"subu   %[\"#TEMP2\"],  %[temp18],    %[temp19]        \\n\\t\"    \\\n  \"addu   %[\"#TEMP3\"],  %[temp20],    %[\"#TEMP2\"]      \\n\\t\"    \\\n  \"subu   %[\"#TEMP2\"],  %[temp20],    %[\"#TEMP2\"]      \\n\\t\"    \\\n  \"addu   %[temp20],    %[\"#TEMP0\"],  %[\"#TEMP1\"]      \\n\\t\"    \\\n  \"subu   %[\"#TEMP0\"],  %[\"#TEMP0\"],  %[\"#TEMP1\"]      \\n\\t\"    \\\n  \"mul    %[temp16],    %[\"#TEMP2\"],  %[c5352]         \\n\\t\"    \\\n  \"mul    %[temp17],    %[\"#TEMP2\"],  %[c2217]         \\n\\t\"    \\\n  \"mul    %[temp18],    %[\"#TEMP0\"],  %[c5352]         \\n\\t\"    \\\n  \"mul    %[temp19],    %[\"#TEMP0\"],  %[c2217]         \\n\\t\"    \\\n  \"addu   %[\"#TEMP1\"],  %[\"#TEMP3\"],  %[temp20]        \\n\\t\"    \\\n  \"subu   %[temp20],    %[\"#TEMP3\"],  %[temp20]        \\n\\t\"    \\\n  \"sll    %[\"#TEMP0\"],  %[\"#TEMP1\"],  3                \\n\\t\"    \\\n  \"sll    %[\"#TEMP2\"],  %[temp20],    3                \\n\\t\"    \\\n  \"addiu  %[temp16],    %[temp16],    1812             \\n\\t\"    \\\n  \"addiu  %[temp17],    %[temp17],    937              \\n\\t\"    \\\n  \"addu   %[temp16],    %[temp16],    %[temp19]        \\n\\t\"    \\\n  \"subu   %[temp17],    %[temp17],    %[temp18]        \\n\\t\"    \\\n  \"sra    %[\"#TEMP1\"],  %[temp16],    9                \\n\\t\"    \\\n  \"sra    %[\"#TEMP3\"],  %[temp17],    9                \\n\\t\"\n\n// macro for one vertical pass in FTransform\n// temp0..temp15 holds tmp[0]..tmp[15]\n// A..D - offsets in bytes to store to out buffer\n// TEMP0, TEMP4, TEMP8 and TEMP12 - registers for corresponding tmp elements\n#define VERTICAL_PASS(A, B, C, D, TEMP0, TEMP4, TEMP8, TEMP12)  \\\n  \"addu   %[temp16],    %[\"#TEMP0\"],  %[\"#TEMP12\"]     \\n\\t\"    \\\n  \"subu   %[temp19],    %[\"#TEMP0\"],  %[\"#TEMP12\"]     \\n\\t\"    \\\n  \"addu   %[temp17],    %[\"#TEMP4\"],  %[\"#TEMP8\"]      \\n\\t\"    \\\n  \"subu   %[temp18],    %[\"#TEMP4\"],  %[\"#TEMP8\"]      \\n\\t\"    \\\n  \"mul    %[\"#TEMP8\"],  %[temp19],    %[c2217]         \\n\\t\"    \\\n  \"mul    %[\"#TEMP12\"], %[temp18],    %[c2217]         \\n\\t\"    \\\n  \"mul    %[\"#TEMP4\"],  %[temp19],    %[c5352]         \\n\\t\"    \\\n  \"mul    %[temp18],    %[temp18],    %[c5352]         \\n\\t\"    \\\n  \"addiu  %[temp16],    %[temp16],    7                \\n\\t\"    \\\n  \"addu   %[\"#TEMP0\"],  %[temp16],    %[temp17]        \\n\\t\"    \\\n  \"sra    %[\"#TEMP0\"],  %[\"#TEMP0\"],  4                \\n\\t\"    \\\n  \"addu   %[\"#TEMP12\"], %[\"#TEMP12\"], %[\"#TEMP4\"]      \\n\\t\"    \\\n  \"subu   %[\"#TEMP4\"],  %[temp16],    %[temp17]        \\n\\t\"    \\\n  \"sra    %[\"#TEMP4\"],  %[\"#TEMP4\"],  4                \\n\\t\"    \\\n  \"addiu  %[\"#TEMP8\"],  %[\"#TEMP8\"],  30000            \\n\\t\"    \\\n  \"addiu  %[\"#TEMP12\"], %[\"#TEMP12\"], 12000            \\n\\t\"    \\\n  \"addiu  %[\"#TEMP8\"],  %[\"#TEMP8\"],  21000            \\n\\t\"    \\\n  \"subu   %[\"#TEMP8\"],  %[\"#TEMP8\"],  %[temp18]        \\n\\t\"    \\\n  \"sra    %[\"#TEMP12\"], %[\"#TEMP12\"], 16               \\n\\t\"    \\\n  \"sra    %[\"#TEMP8\"],  %[\"#TEMP8\"],  16               \\n\\t\"    \\\n  \"addiu  %[temp16],    %[\"#TEMP12\"], 1                \\n\\t\"    \\\n  \"movn   %[\"#TEMP12\"], %[temp16],    %[temp19]        \\n\\t\"    \\\n  \"sh     %[\"#TEMP0\"],  \"#A\"(%[temp20])                \\n\\t\"    \\\n  \"sh     %[\"#TEMP4\"],  \"#C\"(%[temp20])                \\n\\t\"    \\\n  \"sh     %[\"#TEMP8\"],  \"#D\"(%[temp20])                \\n\\t\"    \\\n  \"sh     %[\"#TEMP12\"], \"#B\"(%[temp20])                \\n\\t\"\n\nstatic void FTransform(const uint8_t* src, const uint8_t* ref, int16_t* out) {\n  int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8;\n  int temp9, temp10, temp11, temp12, temp13, temp14, temp15, temp16;\n  int temp17, temp18, temp19, temp20;\n  const int c2217 = 2217;\n  const int c5352 = 5352;\n  const int* const args[3] =\n      { (const int*)src, (const int*)ref, (const int*)out };\n\n  __asm__ volatile(\n    HORIZONTAL_PASS( 0,  1,  2,  3, temp0,  temp1,  temp2,  temp3)\n    HORIZONTAL_PASS(16, 17, 18, 19, temp4,  temp5,  temp6,  temp7)\n    HORIZONTAL_PASS(32, 33, 34, 35, temp8,  temp9,  temp10, temp11)\n    HORIZONTAL_PASS(48, 49, 50, 51, temp12, temp13, temp14, temp15)\n    \"lw   %[temp20],    8(%[args])                     \\n\\t\"\n    VERTICAL_PASS(0,  8, 16, 24, temp0, temp4, temp8,  temp12)\n    VERTICAL_PASS(2, 10, 18, 26, temp1, temp5, temp9,  temp13)\n    VERTICAL_PASS(4, 12, 20, 28, temp2, temp6, temp10, temp14)\n    VERTICAL_PASS(6, 14, 22, 30, temp3, temp7, temp11, temp15)\n\n    : [temp0]\"=&r\"(temp0), [temp1]\"=&r\"(temp1), [temp2]\"=&r\"(temp2),\n      [temp3]\"=&r\"(temp3), [temp4]\"=&r\"(temp4), [temp5]\"=&r\"(temp5),\n      [temp6]\"=&r\"(temp6), [temp7]\"=&r\"(temp7), [temp8]\"=&r\"(temp8),\n      [temp9]\"=&r\"(temp9), [temp10]\"=&r\"(temp10), [temp11]\"=&r\"(temp11),\n      [temp12]\"=&r\"(temp12), [temp13]\"=&r\"(temp13), [temp14]\"=&r\"(temp14),\n      [temp15]\"=&r\"(temp15), [temp16]\"=&r\"(temp16), [temp17]\"=&r\"(temp17),\n      [temp18]\"=&r\"(temp18), [temp19]\"=&r\"(temp19), [temp20]\"=&r\"(temp20)\n    : [args]\"r\"(args), [c2217]\"r\"(c2217), [c5352]\"r\"(c5352)\n    : \"memory\", \"hi\", \"lo\"\n  );\n}\n\n#undef VERTICAL_PASS\n#undef HORIZONTAL_PASS\n\n// Forward declaration.\nextern int VP8GetResidualCostMIPS32(int ctx0, const VP8Residual* const res);\n\nint VP8GetResidualCostMIPS32(int ctx0, const VP8Residual* const res) {\n  int n = res->first;\n  // should be prob[VP8EncBands[n]], but it's equivalent for n=0 or 1\n  int p0 = res->prob[n][ctx0][0];\n  const uint16_t* t = res->cost[n][ctx0];\n  int cost;\n  const int const_2 = 2;\n  const int const_255 = 255;\n  const int const_max_level = MAX_VARIABLE_LEVEL;\n  int res_cost;\n  int res_prob;\n  int res_coeffs;\n  int res_last;\n  int v_reg;\n  int b_reg;\n  int ctx_reg;\n  int cost_add, temp_1, temp_2, temp_3;\n\n  if (res->last < 0) {\n    return VP8BitCost(0, p0);\n  }\n\n  cost = (ctx0 == 0) ? VP8BitCost(1, p0) : 0;\n\n  res_cost = (int)res->cost;\n  res_prob = (int)res->prob;\n  res_coeffs = (int)res->coeffs;\n  res_last = (int)res->last;\n\n  __asm__ volatile(\n    \".set   push                                                           \\n\\t\"\n    \".set   noreorder                                                      \\n\\t\"\n\n    \"sll    %[temp_1],     %[n],              1                            \\n\\t\"\n    \"addu   %[res_coeffs], %[res_coeffs],     %[temp_1]                    \\n\\t\"\n    \"slt    %[temp_2],     %[n],              %[res_last]                  \\n\\t\"\n    \"bnez   %[temp_2],     1f                                              \\n\\t\"\n    \" li    %[cost_add],   0                                               \\n\\t\"\n    \"b      2f                                                             \\n\\t\"\n    \" nop                                                                  \\n\\t\"\n  \"1:                                                                      \\n\\t\"\n    \"lh     %[v_reg],      0(%[res_coeffs])                                \\n\\t\"\n    \"addu   %[b_reg],      %[n],              %[VP8EncBands]               \\n\\t\"\n    \"move   %[temp_1],     %[const_max_level]                              \\n\\t\"\n    \"addu   %[cost],       %[cost],           %[cost_add]                  \\n\\t\"\n    \"negu   %[temp_2],     %[v_reg]                                        \\n\\t\"\n    \"slti   %[temp_3],     %[v_reg],          0                            \\n\\t\"\n    \"movn   %[v_reg],      %[temp_2],         %[temp_3]                    \\n\\t\"\n    \"lbu    %[b_reg],      1(%[b_reg])                                     \\n\\t\"\n    \"li     %[cost_add],   0                                               \\n\\t\"\n\n    \"sltiu  %[temp_3],     %[v_reg],          2                            \\n\\t\"\n    \"move   %[ctx_reg],    %[v_reg]                                        \\n\\t\"\n    \"movz   %[ctx_reg],    %[const_2],        %[temp_3]                    \\n\\t\"\n    //  cost += VP8LevelCost(t, v);\n    \"slt    %[temp_3],     %[v_reg],          %[const_max_level]           \\n\\t\"\n    \"movn   %[temp_1],     %[v_reg],          %[temp_3]                    \\n\\t\"\n    \"sll    %[temp_2],     %[v_reg],          1                            \\n\\t\"\n    \"addu   %[temp_2],     %[temp_2],         %[VP8LevelFixedCosts]        \\n\\t\"\n    \"lhu    %[temp_2],     0(%[temp_2])                                    \\n\\t\"\n    \"sll    %[temp_1],     %[temp_1],         1                            \\n\\t\"\n    \"addu   %[temp_1],     %[temp_1],         %[t]                         \\n\\t\"\n    \"lhu    %[temp_3],     0(%[temp_1])                                    \\n\\t\"\n    \"addu   %[cost],       %[cost],           %[temp_2]                    \\n\\t\"\n\n    //  t = res->cost[b][ctx];\n    \"sll    %[temp_1],     %[ctx_reg],        7                            \\n\\t\"\n    \"sll    %[temp_2],     %[ctx_reg],        3                            \\n\\t\"\n    \"addu   %[cost],       %[cost],           %[temp_3]                    \\n\\t\"\n    \"addu   %[temp_1],     %[temp_1],         %[temp_2]                    \\n\\t\"\n    \"sll    %[temp_2],     %[b_reg],          3                            \\n\\t\"\n    \"sll    %[temp_3],     %[b_reg],          5                            \\n\\t\"\n    \"sub    %[temp_2],     %[temp_3],         %[temp_2]                    \\n\\t\"\n    \"sll    %[temp_3],     %[temp_2],         4                            \\n\\t\"\n    \"addu   %[temp_1],     %[temp_1],         %[temp_3]                    \\n\\t\"\n    \"addu   %[temp_2],     %[temp_2],         %[res_cost]                  \\n\\t\"\n    \"addiu  %[n],          %[n],              1                            \\n\\t\"\n    \"addu   %[t],          %[temp_1],         %[temp_2]                    \\n\\t\"\n    \"slt    %[temp_1],     %[n],              %[res_last]                  \\n\\t\"\n    \"bnez   %[temp_1],     1b                                              \\n\\t\"\n    \" addiu %[res_coeffs], %[res_coeffs],     2                            \\n\\t\"\n   \"2:                                                                     \\n\\t\"\n\n    \".set   pop                                                            \\n\\t\"\n    : [cost]\"+r\"(cost), [t]\"+r\"(t), [n]\"+r\"(n), [v_reg]\"=&r\"(v_reg),\n      [ctx_reg]\"=&r\"(ctx_reg), [b_reg]\"=&r\"(b_reg), [cost_add]\"=&r\"(cost_add),\n      [temp_1]\"=&r\"(temp_1), [temp_2]\"=&r\"(temp_2), [temp_3]\"=&r\"(temp_3)\n    : [const_2]\"r\"(const_2), [const_255]\"r\"(const_255), [res_last]\"r\"(res_last),\n      [VP8EntropyCost]\"r\"(VP8EntropyCost), [VP8EncBands]\"r\"(VP8EncBands),\n      [const_max_level]\"r\"(const_max_level), [res_prob]\"r\"(res_prob),\n      [VP8LevelFixedCosts]\"r\"(VP8LevelFixedCosts), [res_coeffs]\"r\"(res_coeffs),\n      [res_cost]\"r\"(res_cost)\n    : \"memory\"\n  );\n\n  // Last coefficient is always non-zero\n  {\n    const int v = abs(res->coeffs[n]);\n    assert(v != 0);\n    cost += VP8LevelCost(t, v);\n    if (n < 15) {\n      const int b = VP8EncBands[n + 1];\n      const int ctx = (v == 1) ? 1 : 2;\n      const int last_p0 = res->prob[b][ctx][0];\n      cost += VP8BitCost(0, last_p0);\n    }\n  }\n  return cost;\n}\n\n#define GET_SSE_INNER(A, B, C, D)                               \\\n  \"lbu     %[temp0],    \"#A\"(%[a])                   \\n\\t\"      \\\n  \"lbu     %[temp1],    \"#A\"(%[b])                   \\n\\t\"      \\\n  \"lbu     %[temp2],    \"#B\"(%[a])                   \\n\\t\"      \\\n  \"lbu     %[temp3],    \"#B\"(%[b])                   \\n\\t\"      \\\n  \"lbu     %[temp4],    \"#C\"(%[a])                   \\n\\t\"      \\\n  \"lbu     %[temp5],    \"#C\"(%[b])                   \\n\\t\"      \\\n  \"lbu     %[temp6],    \"#D\"(%[a])                   \\n\\t\"      \\\n  \"lbu     %[temp7],    \"#D\"(%[b])                   \\n\\t\"      \\\n  \"subu    %[temp0],    %[temp0],     %[temp1]       \\n\\t\"      \\\n  \"subu    %[temp2],    %[temp2],     %[temp3]       \\n\\t\"      \\\n  \"subu    %[temp4],    %[temp4],     %[temp5]       \\n\\t\"      \\\n  \"subu    %[temp6],    %[temp6],     %[temp7]       \\n\\t\"      \\\n  \"madd    %[temp0],    %[temp0]                     \\n\\t\"      \\\n  \"madd    %[temp2],    %[temp2]                     \\n\\t\"      \\\n  \"madd    %[temp4],    %[temp4]                     \\n\\t\"      \\\n  \"madd    %[temp6],    %[temp6]                     \\n\\t\"\n\n#define GET_SSE(A, B, C, D)               \\\n  GET_SSE_INNER(A, A + 1, A + 2, A + 3)   \\\n  GET_SSE_INNER(B, B + 1, B + 2, B + 3)   \\\n  GET_SSE_INNER(C, C + 1, C + 2, C + 3)   \\\n  GET_SSE_INNER(D, D + 1, D + 2, D + 3)\n\n#if !defined(WORK_AROUND_GCC)\nstatic int SSE16x16(const uint8_t* a, const uint8_t* b) {\n  int count;\n  int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;\n\n  __asm__ volatile(\n     \"mult   $zero,    $zero                            \\n\\t\"\n\n     GET_SSE(  0,   4,   8,  12)\n     GET_SSE( 16,  20,  24,  28)\n     GET_SSE( 32,  36,  40,  44)\n     GET_SSE( 48,  52,  56,  60)\n     GET_SSE( 64,  68,  72,  76)\n     GET_SSE( 80,  84,  88,  92)\n     GET_SSE( 96, 100, 104, 108)\n     GET_SSE(112, 116, 120, 124)\n     GET_SSE(128, 132, 136, 140)\n     GET_SSE(144, 148, 152, 156)\n     GET_SSE(160, 164, 168, 172)\n     GET_SSE(176, 180, 184, 188)\n     GET_SSE(192, 196, 200, 204)\n     GET_SSE(208, 212, 216, 220)\n     GET_SSE(224, 228, 232, 236)\n     GET_SSE(240, 244, 248, 252)\n\n    \"mflo    %[count]                                   \\n\\t\"\n    : [temp0]\"=&r\"(temp0), [temp1]\"=&r\"(temp1), [temp2]\"=&r\"(temp2),\n      [temp3]\"=&r\"(temp3), [temp4]\"=&r\"(temp4), [temp5]\"=&r\"(temp5),\n      [temp6]\"=&r\"(temp6), [temp7]\"=&r\"(temp7), [count]\"=&r\"(count)\n    : [a]\"r\"(a), [b]\"r\"(b)\n    : \"memory\", \"hi\" , \"lo\"\n  );\n  return count;\n}\n\nstatic int SSE16x8(const uint8_t* a, const uint8_t* b) {\n  int count;\n  int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;\n\n  __asm__ volatile(\n     \"mult   $zero,    $zero                            \\n\\t\"\n\n     GET_SSE(  0,   4,   8,  12)\n     GET_SSE( 16,  20,  24,  28)\n     GET_SSE( 32,  36,  40,  44)\n     GET_SSE( 48,  52,  56,  60)\n     GET_SSE( 64,  68,  72,  76)\n     GET_SSE( 80,  84,  88,  92)\n     GET_SSE( 96, 100, 104, 108)\n     GET_SSE(112, 116, 120, 124)\n\n    \"mflo    %[count]                                   \\n\\t\"\n    : [temp0]\"=&r\"(temp0), [temp1]\"=&r\"(temp1), [temp2]\"=&r\"(temp2),\n      [temp3]\"=&r\"(temp3), [temp4]\"=&r\"(temp4), [temp5]\"=&r\"(temp5),\n      [temp6]\"=&r\"(temp6), [temp7]\"=&r\"(temp7), [count]\"=&r\"(count)\n    : [a]\"r\"(a), [b]\"r\"(b)\n    : \"memory\", \"hi\" , \"lo\"\n  );\n  return count;\n}\n\nstatic int SSE8x8(const uint8_t* a, const uint8_t* b) {\n  int count;\n  int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;\n\n  __asm__ volatile(\n     \"mult   $zero,    $zero                            \\n\\t\"\n\n     GET_SSE( 0,   4,  16,  20)\n     GET_SSE(32,  36,  48,  52)\n     GET_SSE(64,  68,  80,  84)\n     GET_SSE(96, 100, 112, 116)\n\n    \"mflo    %[count]                                   \\n\\t\"\n    : [temp0]\"=&r\"(temp0), [temp1]\"=&r\"(temp1), [temp2]\"=&r\"(temp2),\n      [temp3]\"=&r\"(temp3), [temp4]\"=&r\"(temp4), [temp5]\"=&r\"(temp5),\n      [temp6]\"=&r\"(temp6), [temp7]\"=&r\"(temp7), [count]\"=&r\"(count)\n    : [a]\"r\"(a), [b]\"r\"(b)\n    : \"memory\", \"hi\" , \"lo\"\n  );\n  return count;\n}\n\nstatic int SSE4x4(const uint8_t* a, const uint8_t* b) {\n  int count;\n  int temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;\n\n  __asm__ volatile(\n     \"mult   $zero,    $zero                            \\n\\t\"\n\n     GET_SSE(0, 16, 32, 48)\n\n    \"mflo    %[count]                                   \\n\\t\"\n    : [temp0]\"=&r\"(temp0), [temp1]\"=&r\"(temp1), [temp2]\"=&r\"(temp2),\n      [temp3]\"=&r\"(temp3), [temp4]\"=&r\"(temp4), [temp5]\"=&r\"(temp5),\n      [temp6]\"=&r\"(temp6), [temp7]\"=&r\"(temp7), [count]\"=&r\"(count)\n    : [a]\"r\"(a), [b]\"r\"(b)\n    : \"memory\", \"hi\" , \"lo\"\n  );\n  return count;\n}\n\n#endif  // WORK_AROUND_GCC\n\n#undef GET_SSE_MIPS32\n#undef GET_SSE_MIPS32_INNER\n\n#endif  // WEBP_USE_MIPS32\n\n//------------------------------------------------------------------------------\n// Entry point\n\nextern void VP8EncDspInitMIPS32(void);\n\nvoid VP8EncDspInitMIPS32(void) {\n#if defined(WEBP_USE_MIPS32)\n  VP8ITransform = ITransform;\n  VP8EncQuantizeBlock = QuantizeBlock;\n  VP8TDisto4x4 = Disto4x4;\n  VP8TDisto16x16 = Disto16x16;\n  VP8FTransform = FTransform;\n#if !defined(WORK_AROUND_GCC)\n  VP8SSE16x16 = SSE16x16;\n  VP8SSE8x8 = SSE8x8;\n  VP8SSE16x8 = SSE16x8;\n  VP8SSE4x4 = SSE4x4;\n#endif\n#endif  // WEBP_USE_MIPS32\n}\n"
  },
  {
    "path": "ext/libwebp/dsp/enc_neon.c",
    "content": "// Copyright 2012 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// ARM NEON version of speed-critical encoding functions.\n//\n// adapted from libvpx (http://www.webmproject.org/code/)\n\n#include \"./dsp.h\"\n\n#if defined(WEBP_USE_NEON)\n\n#include <assert.h>\n\n#include \"./neon.h\"\n#include \"../enc/vp8enci.h\"\n\n//------------------------------------------------------------------------------\n// Transforms (Paragraph 14.4)\n\n// Inverse transform.\n// This code is pretty much the same as TransformOne in the dec_neon.c, except\n// for subtraction to *ref. See the comments there for algorithmic explanations.\n\nstatic const int16_t kC1 = 20091;\nstatic const int16_t kC2 = 17734;  // half of kC2, actually. See comment above.\n\n// This code works but is *slower* than the inlined-asm version below\n// (with gcc-4.6). So we disable it for now. Later, it'll be conditional to\n// USE_INTRINSICS define.\n// With gcc-4.8, it's a little faster speed than inlined-assembly.\n#if defined(USE_INTRINSICS)\n\n// Treats 'v' as an uint8x8_t and zero extends to an int16x8_t.\nstatic WEBP_INLINE int16x8_t ConvertU8ToS16(uint32x2_t v) {\n  return vreinterpretq_s16_u16(vmovl_u8(vreinterpret_u8_u32(v)));\n}\n\n// Performs unsigned 8b saturation on 'dst01' and 'dst23' storing the result\n// to the corresponding rows of 'dst'.\nstatic WEBP_INLINE void SaturateAndStore4x4(uint8_t* const dst,\n                                            const int16x8_t dst01,\n                                            const int16x8_t dst23) {\n  // Unsigned saturate to 8b.\n  const uint8x8_t dst01_u8 = vqmovun_s16(dst01);\n  const uint8x8_t dst23_u8 = vqmovun_s16(dst23);\n\n  // Store the results.\n  vst1_lane_u32((uint32_t*)(dst + 0 * BPS), vreinterpret_u32_u8(dst01_u8), 0);\n  vst1_lane_u32((uint32_t*)(dst + 1 * BPS), vreinterpret_u32_u8(dst01_u8), 1);\n  vst1_lane_u32((uint32_t*)(dst + 2 * BPS), vreinterpret_u32_u8(dst23_u8), 0);\n  vst1_lane_u32((uint32_t*)(dst + 3 * BPS), vreinterpret_u32_u8(dst23_u8), 1);\n}\n\nstatic WEBP_INLINE void Add4x4(const int16x8_t row01, const int16x8_t row23,\n                               const uint8_t* const ref, uint8_t* const dst) {\n  uint32x2_t dst01 = vdup_n_u32(0);\n  uint32x2_t dst23 = vdup_n_u32(0);\n\n  // Load the source pixels.\n  dst01 = vld1_lane_u32((uint32_t*)(ref + 0 * BPS), dst01, 0);\n  dst23 = vld1_lane_u32((uint32_t*)(ref + 2 * BPS), dst23, 0);\n  dst01 = vld1_lane_u32((uint32_t*)(ref + 1 * BPS), dst01, 1);\n  dst23 = vld1_lane_u32((uint32_t*)(ref + 3 * BPS), dst23, 1);\n\n  {\n    // Convert to 16b.\n    const int16x8_t dst01_s16 = ConvertU8ToS16(dst01);\n    const int16x8_t dst23_s16 = ConvertU8ToS16(dst23);\n\n    // Descale with rounding.\n    const int16x8_t out01 = vrsraq_n_s16(dst01_s16, row01, 3);\n    const int16x8_t out23 = vrsraq_n_s16(dst23_s16, row23, 3);\n    // Add the inverse transform.\n    SaturateAndStore4x4(dst, out01, out23);\n  }\n}\n\nstatic WEBP_INLINE void Transpose8x2(const int16x8_t in0, const int16x8_t in1,\n                                     int16x8x2_t* const out) {\n  // a0 a1 a2 a3 | b0 b1 b2 b3   => a0 b0 c0 d0 | a1 b1 c1 d1\n  // c0 c1 c2 c3 | d0 d1 d2 d3      a2 b2 c2 d2 | a3 b3 c3 d3\n  const int16x8x2_t tmp0 = vzipq_s16(in0, in1);   // a0 c0 a1 c1 a2 c2 ...\n                                                  // b0 d0 b1 d1 b2 d2 ...\n  *out = vzipq_s16(tmp0.val[0], tmp0.val[1]);\n}\n\nstatic WEBP_INLINE void TransformPass(int16x8x2_t* const rows) {\n  // {rows} = in0 | in4\n  //          in8 | in12\n  // B1 = in4 | in12\n  const int16x8_t B1 =\n      vcombine_s16(vget_high_s16(rows->val[0]), vget_high_s16(rows->val[1]));\n  // C0 = kC1 * in4 | kC1 * in12\n  // C1 = kC2 * in4 | kC2 * in12\n  const int16x8_t C0 = vsraq_n_s16(B1, vqdmulhq_n_s16(B1, kC1), 1);\n  const int16x8_t C1 = vqdmulhq_n_s16(B1, kC2);\n  const int16x4_t a = vqadd_s16(vget_low_s16(rows->val[0]),\n                                vget_low_s16(rows->val[1]));   // in0 + in8\n  const int16x4_t b = vqsub_s16(vget_low_s16(rows->val[0]),\n                                vget_low_s16(rows->val[1]));   // in0 - in8\n  // c = kC2 * in4 - kC1 * in12\n  // d = kC1 * in4 + kC2 * in12\n  const int16x4_t c = vqsub_s16(vget_low_s16(C1), vget_high_s16(C0));\n  const int16x4_t d = vqadd_s16(vget_low_s16(C0), vget_high_s16(C1));\n  const int16x8_t D0 = vcombine_s16(a, b);      // D0 = a | b\n  const int16x8_t D1 = vcombine_s16(d, c);      // D1 = d | c\n  const int16x8_t E0 = vqaddq_s16(D0, D1);      // a+d | b+c\n  const int16x8_t E_tmp = vqsubq_s16(D0, D1);   // a-d | b-c\n  const int16x8_t E1 = vcombine_s16(vget_high_s16(E_tmp), vget_low_s16(E_tmp));\n  Transpose8x2(E0, E1, rows);\n}\n\nstatic void ITransformOne(const uint8_t* ref,\n                          const int16_t* in, uint8_t* dst) {\n  int16x8x2_t rows;\n  INIT_VECTOR2(rows, vld1q_s16(in + 0), vld1q_s16(in + 8));\n  TransformPass(&rows);\n  TransformPass(&rows);\n  Add4x4(rows.val[0], rows.val[1], ref, dst);\n}\n\n#else\n\nstatic void ITransformOne(const uint8_t* ref,\n                          const int16_t* in, uint8_t* dst) {\n  const int kBPS = BPS;\n  const int16_t kC1C2[] = { kC1, kC2, 0, 0 };\n\n  __asm__ volatile (\n    \"vld1.16         {q1, q2}, [%[in]]           \\n\"\n    \"vld1.16         {d0}, [%[kC1C2]]            \\n\"\n\n    // d2: in[0]\n    // d3: in[8]\n    // d4: in[4]\n    // d5: in[12]\n    \"vswp            d3, d4                      \\n\"\n\n    // q8 = {in[4], in[12]} * kC1 * 2 >> 16\n    // q9 = {in[4], in[12]} * kC2 >> 16\n    \"vqdmulh.s16     q8, q2, d0[0]               \\n\"\n    \"vqdmulh.s16     q9, q2, d0[1]               \\n\"\n\n    // d22 = a = in[0] + in[8]\n    // d23 = b = in[0] - in[8]\n    \"vqadd.s16       d22, d2, d3                 \\n\"\n    \"vqsub.s16       d23, d2, d3                 \\n\"\n\n    //  q8 = in[4]/[12] * kC1 >> 16\n    \"vshr.s16        q8, q8, #1                  \\n\"\n\n    // Add {in[4], in[12]} back after the multiplication.\n    \"vqadd.s16       q8, q2, q8                  \\n\"\n\n    // d20 = c = in[4]*kC2 - in[12]*kC1\n    // d21 = d = in[4]*kC1 + in[12]*kC2\n    \"vqsub.s16       d20, d18, d17               \\n\"\n    \"vqadd.s16       d21, d19, d16               \\n\"\n\n    // d2 = tmp[0] = a + d\n    // d3 = tmp[1] = b + c\n    // d4 = tmp[2] = b - c\n    // d5 = tmp[3] = a - d\n    \"vqadd.s16       d2, d22, d21                \\n\"\n    \"vqadd.s16       d3, d23, d20                \\n\"\n    \"vqsub.s16       d4, d23, d20                \\n\"\n    \"vqsub.s16       d5, d22, d21                \\n\"\n\n    \"vzip.16         q1, q2                      \\n\"\n    \"vzip.16         q1, q2                      \\n\"\n\n    \"vswp            d3, d4                      \\n\"\n\n    // q8 = {tmp[4], tmp[12]} * kC1 * 2 >> 16\n    // q9 = {tmp[4], tmp[12]} * kC2 >> 16\n    \"vqdmulh.s16     q8, q2, d0[0]               \\n\"\n    \"vqdmulh.s16     q9, q2, d0[1]               \\n\"\n\n    // d22 = a = tmp[0] + tmp[8]\n    // d23 = b = tmp[0] - tmp[8]\n    \"vqadd.s16       d22, d2, d3                 \\n\"\n    \"vqsub.s16       d23, d2, d3                 \\n\"\n\n    \"vshr.s16        q8, q8, #1                  \\n\"\n    \"vqadd.s16       q8, q2, q8                  \\n\"\n\n    // d20 = c = in[4]*kC2 - in[12]*kC1\n    // d21 = d = in[4]*kC1 + in[12]*kC2\n    \"vqsub.s16       d20, d18, d17               \\n\"\n    \"vqadd.s16       d21, d19, d16               \\n\"\n\n    // d2 = tmp[0] = a + d\n    // d3 = tmp[1] = b + c\n    // d4 = tmp[2] = b - c\n    // d5 = tmp[3] = a - d\n    \"vqadd.s16       d2, d22, d21                \\n\"\n    \"vqadd.s16       d3, d23, d20                \\n\"\n    \"vqsub.s16       d4, d23, d20                \\n\"\n    \"vqsub.s16       d5, d22, d21                \\n\"\n\n    \"vld1.32         d6[0], [%[ref]], %[kBPS]    \\n\"\n    \"vld1.32         d6[1], [%[ref]], %[kBPS]    \\n\"\n    \"vld1.32         d7[0], [%[ref]], %[kBPS]    \\n\"\n    \"vld1.32         d7[1], [%[ref]], %[kBPS]    \\n\"\n\n    \"sub         %[ref], %[ref], %[kBPS], lsl #2 \\n\"\n\n    // (val) + 4 >> 3\n    \"vrshr.s16       d2, d2, #3                  \\n\"\n    \"vrshr.s16       d3, d3, #3                  \\n\"\n    \"vrshr.s16       d4, d4, #3                  \\n\"\n    \"vrshr.s16       d5, d5, #3                  \\n\"\n\n    \"vzip.16         q1, q2                      \\n\"\n    \"vzip.16         q1, q2                      \\n\"\n\n    // Must accumulate before saturating\n    \"vmovl.u8        q8, d6                      \\n\"\n    \"vmovl.u8        q9, d7                      \\n\"\n\n    \"vqadd.s16       q1, q1, q8                  \\n\"\n    \"vqadd.s16       q2, q2, q9                  \\n\"\n\n    \"vqmovun.s16     d0, q1                      \\n\"\n    \"vqmovun.s16     d1, q2                      \\n\"\n\n    \"vst1.32         d0[0], [%[dst]], %[kBPS]    \\n\"\n    \"vst1.32         d0[1], [%[dst]], %[kBPS]    \\n\"\n    \"vst1.32         d1[0], [%[dst]], %[kBPS]    \\n\"\n    \"vst1.32         d1[1], [%[dst]]             \\n\"\n\n    : [in] \"+r\"(in), [dst] \"+r\"(dst)               // modified registers\n    : [kBPS] \"r\"(kBPS), [kC1C2] \"r\"(kC1C2), [ref] \"r\"(ref)  // constants\n    : \"memory\", \"q0\", \"q1\", \"q2\", \"q8\", \"q9\", \"q10\", \"q11\"  // clobbered\n  );\n}\n\n#endif    // USE_INTRINSICS\n\nstatic void ITransform(const uint8_t* ref,\n                       const int16_t* in, uint8_t* dst, int do_two) {\n  ITransformOne(ref, in, dst);\n  if (do_two) {\n    ITransformOne(ref + 4, in + 16, dst + 4);\n  }\n}\n\n// Load all 4x4 pixels into a single uint8x16_t variable.\nstatic uint8x16_t Load4x4(const uint8_t* src) {\n  uint32x4_t out = vdupq_n_u32(0);\n  out = vld1q_lane_u32((const uint32_t*)(src + 0 * BPS), out, 0);\n  out = vld1q_lane_u32((const uint32_t*)(src + 1 * BPS), out, 1);\n  out = vld1q_lane_u32((const uint32_t*)(src + 2 * BPS), out, 2);\n  out = vld1q_lane_u32((const uint32_t*)(src + 3 * BPS), out, 3);\n  return vreinterpretq_u8_u32(out);\n}\n\n// Forward transform.\n\n#if defined(USE_INTRINSICS)\n\nstatic WEBP_INLINE void Transpose4x4_S16(const int16x4_t A, const int16x4_t B,\n                                         const int16x4_t C, const int16x4_t D,\n                                         int16x8_t* const out01,\n                                         int16x8_t* const out32) {\n  const int16x4x2_t AB = vtrn_s16(A, B);\n  const int16x4x2_t CD = vtrn_s16(C, D);\n  const int32x2x2_t tmp02 = vtrn_s32(vreinterpret_s32_s16(AB.val[0]),\n                                     vreinterpret_s32_s16(CD.val[0]));\n  const int32x2x2_t tmp13 = vtrn_s32(vreinterpret_s32_s16(AB.val[1]),\n                                     vreinterpret_s32_s16(CD.val[1]));\n  *out01 = vreinterpretq_s16_s64(\n      vcombine_s64(vreinterpret_s64_s32(tmp02.val[0]),\n                   vreinterpret_s64_s32(tmp13.val[0])));\n  *out32 = vreinterpretq_s16_s64(\n      vcombine_s64(vreinterpret_s64_s32(tmp13.val[1]),\n                   vreinterpret_s64_s32(tmp02.val[1])));\n}\n\nstatic WEBP_INLINE int16x8_t DiffU8ToS16(const uint8x8_t a,\n                                         const uint8x8_t b) {\n  return vreinterpretq_s16_u16(vsubl_u8(a, b));\n}\n\nstatic void FTransform(const uint8_t* src, const uint8_t* ref,\n                       int16_t* out) {\n  int16x8_t d0d1, d3d2;   // working 4x4 int16 variables\n  {\n    const uint8x16_t S0 = Load4x4(src);\n    const uint8x16_t R0 = Load4x4(ref);\n    const int16x8_t D0D1 = DiffU8ToS16(vget_low_u8(S0), vget_low_u8(R0));\n    const int16x8_t D2D3 = DiffU8ToS16(vget_high_u8(S0), vget_high_u8(R0));\n    const int16x4_t D0 = vget_low_s16(D0D1);\n    const int16x4_t D1 = vget_high_s16(D0D1);\n    const int16x4_t D2 = vget_low_s16(D2D3);\n    const int16x4_t D3 = vget_high_s16(D2D3);\n    Transpose4x4_S16(D0, D1, D2, D3, &d0d1, &d3d2);\n  }\n  {    // 1rst pass\n    const int32x4_t kCst937 = vdupq_n_s32(937);\n    const int32x4_t kCst1812 = vdupq_n_s32(1812);\n    const int16x8_t a0a1 = vaddq_s16(d0d1, d3d2);   // d0+d3 | d1+d2   (=a0|a1)\n    const int16x8_t a3a2 = vsubq_s16(d0d1, d3d2);   // d0-d3 | d1-d2   (=a3|a2)\n    const int16x8_t a0a1_2 = vshlq_n_s16(a0a1, 3);\n    const int16x4_t tmp0 = vadd_s16(vget_low_s16(a0a1_2),\n                                    vget_high_s16(a0a1_2));\n    const int16x4_t tmp2 = vsub_s16(vget_low_s16(a0a1_2),\n                                    vget_high_s16(a0a1_2));\n    const int32x4_t a3_2217 = vmull_n_s16(vget_low_s16(a3a2), 2217);\n    const int32x4_t a2_2217 = vmull_n_s16(vget_high_s16(a3a2), 2217);\n    const int32x4_t a2_p_a3 = vmlal_n_s16(a2_2217, vget_low_s16(a3a2), 5352);\n    const int32x4_t a3_m_a2 = vmlsl_n_s16(a3_2217, vget_high_s16(a3a2), 5352);\n    const int16x4_t tmp1 = vshrn_n_s32(vaddq_s32(a2_p_a3, kCst1812), 9);\n    const int16x4_t tmp3 = vshrn_n_s32(vaddq_s32(a3_m_a2, kCst937), 9);\n    Transpose4x4_S16(tmp0, tmp1, tmp2, tmp3, &d0d1, &d3d2);\n  }\n  {    // 2nd pass\n    // the (1<<16) addition is for the replacement: a3!=0  <-> 1-(a3==0)\n    const int32x4_t kCst12000 = vdupq_n_s32(12000 + (1 << 16));\n    const int32x4_t kCst51000 = vdupq_n_s32(51000);\n    const int16x8_t a0a1 = vaddq_s16(d0d1, d3d2);   // d0+d3 | d1+d2   (=a0|a1)\n    const int16x8_t a3a2 = vsubq_s16(d0d1, d3d2);   // d0-d3 | d1-d2   (=a3|a2)\n    const int16x4_t a0_k7 = vadd_s16(vget_low_s16(a0a1), vdup_n_s16(7));\n    const int16x4_t out0 = vshr_n_s16(vadd_s16(a0_k7, vget_high_s16(a0a1)), 4);\n    const int16x4_t out2 = vshr_n_s16(vsub_s16(a0_k7, vget_high_s16(a0a1)), 4);\n    const int32x4_t a3_2217 = vmull_n_s16(vget_low_s16(a3a2), 2217);\n    const int32x4_t a2_2217 = vmull_n_s16(vget_high_s16(a3a2), 2217);\n    const int32x4_t a2_p_a3 = vmlal_n_s16(a2_2217, vget_low_s16(a3a2), 5352);\n    const int32x4_t a3_m_a2 = vmlsl_n_s16(a3_2217, vget_high_s16(a3a2), 5352);\n    const int16x4_t tmp1 = vaddhn_s32(a2_p_a3, kCst12000);\n    const int16x4_t out3 = vaddhn_s32(a3_m_a2, kCst51000);\n    const int16x4_t a3_eq_0 =\n        vreinterpret_s16_u16(vceq_s16(vget_low_s16(a3a2), vdup_n_s16(0)));\n    const int16x4_t out1 = vadd_s16(tmp1, a3_eq_0);\n    vst1_s16(out +  0, out0);\n    vst1_s16(out +  4, out1);\n    vst1_s16(out +  8, out2);\n    vst1_s16(out + 12, out3);\n  }\n}\n\n#else\n\n// adapted from vp8/encoder/arm/neon/shortfdct_neon.asm\nstatic const int16_t kCoeff16[] = {\n  5352,  5352,  5352, 5352, 2217,  2217,  2217, 2217\n};\nstatic const int32_t kCoeff32[] = {\n   1812,  1812,  1812,  1812,\n    937,   937,   937,   937,\n  12000, 12000, 12000, 12000,\n  51000, 51000, 51000, 51000\n};\n\nstatic void FTransform(const uint8_t* src, const uint8_t* ref,\n                       int16_t* out) {\n  const int kBPS = BPS;\n  const uint8_t* src_ptr = src;\n  const uint8_t* ref_ptr = ref;\n  const int16_t* coeff16 = kCoeff16;\n  const int32_t* coeff32 = kCoeff32;\n\n  __asm__ volatile (\n    // load src into q4, q5 in high half\n    \"vld1.8 {d8},  [%[src_ptr]], %[kBPS]      \\n\"\n    \"vld1.8 {d10}, [%[src_ptr]], %[kBPS]      \\n\"\n    \"vld1.8 {d9},  [%[src_ptr]], %[kBPS]      \\n\"\n    \"vld1.8 {d11}, [%[src_ptr]]               \\n\"\n\n    // load ref into q6, q7 in high half\n    \"vld1.8 {d12}, [%[ref_ptr]], %[kBPS]      \\n\"\n    \"vld1.8 {d14}, [%[ref_ptr]], %[kBPS]      \\n\"\n    \"vld1.8 {d13}, [%[ref_ptr]], %[kBPS]      \\n\"\n    \"vld1.8 {d15}, [%[ref_ptr]]               \\n\"\n\n    // Pack the high values in to q4 and q6\n    \"vtrn.32     q4, q5                       \\n\"\n    \"vtrn.32     q6, q7                       \\n\"\n\n    // d[0-3] = src - ref\n    \"vsubl.u8    q0, d8, d12                  \\n\"\n    \"vsubl.u8    q1, d9, d13                  \\n\"\n\n    // load coeff16 into q8(d16=5352, d17=2217)\n    \"vld1.16     {q8}, [%[coeff16]]           \\n\"\n\n    // load coeff32 high half into q9 = 1812, q10 = 937\n    \"vld1.32     {q9, q10}, [%[coeff32]]!     \\n\"\n\n    // load coeff32 low half into q11=12000, q12=51000\n    \"vld1.32     {q11,q12}, [%[coeff32]]      \\n\"\n\n    // part 1\n    // Transpose. Register dN is the same as dN in C\n    \"vtrn.32         d0, d2                   \\n\"\n    \"vtrn.32         d1, d3                   \\n\"\n    \"vtrn.16         d0, d1                   \\n\"\n    \"vtrn.16         d2, d3                   \\n\"\n\n    \"vadd.s16        d4, d0, d3               \\n\" // a0 = d0 + d3\n    \"vadd.s16        d5, d1, d2               \\n\" // a1 = d1 + d2\n    \"vsub.s16        d6, d1, d2               \\n\" // a2 = d1 - d2\n    \"vsub.s16        d7, d0, d3               \\n\" // a3 = d0 - d3\n\n    \"vadd.s16        d0, d4, d5               \\n\" // a0 + a1\n    \"vshl.s16        d0, d0, #3               \\n\" // temp[0+i*4] = (a0+a1) << 3\n    \"vsub.s16        d2, d4, d5               \\n\" // a0 - a1\n    \"vshl.s16        d2, d2, #3               \\n\" // (temp[2+i*4] = (a0-a1) << 3\n\n    \"vmlal.s16       q9, d7, d16              \\n\" // a3*5352 + 1812\n    \"vmlal.s16       q10, d7, d17             \\n\" // a3*2217 + 937\n    \"vmlal.s16       q9, d6, d17              \\n\" // a2*2217 + a3*5352 + 1812\n    \"vmlsl.s16       q10, d6, d16             \\n\" // a3*2217 + 937 - a2*5352\n\n    // temp[1+i*4] = (d2*2217 + d3*5352 + 1812) >> 9\n    // temp[3+i*4] = (d3*2217 + 937 - d2*5352) >> 9\n    \"vshrn.s32       d1, q9, #9               \\n\"\n    \"vshrn.s32       d3, q10, #9              \\n\"\n\n    // part 2\n    // transpose d0=ip[0], d1=ip[4], d2=ip[8], d3=ip[12]\n    \"vtrn.32         d0, d2                   \\n\"\n    \"vtrn.32         d1, d3                   \\n\"\n    \"vtrn.16         d0, d1                   \\n\"\n    \"vtrn.16         d2, d3                   \\n\"\n\n    \"vmov.s16        d26, #7                  \\n\"\n\n    \"vadd.s16        d4, d0, d3               \\n\" // a1 = ip[0] + ip[12]\n    \"vadd.s16        d5, d1, d2               \\n\" // b1 = ip[4] + ip[8]\n    \"vsub.s16        d6, d1, d2               \\n\" // c1 = ip[4] - ip[8]\n    \"vadd.s16        d4, d4, d26              \\n\" // a1 + 7\n    \"vsub.s16        d7, d0, d3               \\n\" // d1 = ip[0] - ip[12]\n\n    \"vadd.s16        d0, d4, d5               \\n\" // op[0] = a1 + b1 + 7\n    \"vsub.s16        d2, d4, d5               \\n\" // op[8] = a1 - b1 + 7\n\n    \"vmlal.s16       q11, d7, d16             \\n\" // d1*5352 + 12000\n    \"vmlal.s16       q12, d7, d17             \\n\" // d1*2217 + 51000\n\n    \"vceq.s16        d4, d7, #0               \\n\"\n\n    \"vshr.s16        d0, d0, #4               \\n\"\n    \"vshr.s16        d2, d2, #4               \\n\"\n\n    \"vmlal.s16       q11, d6, d17             \\n\" // c1*2217 + d1*5352 + 12000\n    \"vmlsl.s16       q12, d6, d16             \\n\" // d1*2217 - c1*5352 + 51000\n\n    \"vmvn            d4, d4                   \\n\" // !(d1 == 0)\n    // op[4] = (c1*2217 + d1*5352 + 12000)>>16\n    \"vshrn.s32       d1, q11, #16             \\n\"\n    // op[4] += (d1!=0)\n    \"vsub.s16        d1, d1, d4               \\n\"\n    // op[12]= (d1*2217 - c1*5352 + 51000)>>16\n    \"vshrn.s32       d3, q12, #16             \\n\"\n\n    // set result to out array\n    \"vst1.16         {q0, q1}, [%[out]]   \\n\"\n    : [src_ptr] \"+r\"(src_ptr), [ref_ptr] \"+r\"(ref_ptr),\n      [coeff32] \"+r\"(coeff32)          // modified registers\n    : [kBPS] \"r\"(kBPS), [coeff16] \"r\"(coeff16),\n      [out] \"r\"(out)                   // constants\n    : \"memory\", \"q0\", \"q1\", \"q2\", \"q3\", \"q4\", \"q5\", \"q6\", \"q7\", \"q8\", \"q9\",\n      \"q10\", \"q11\", \"q12\", \"q13\"       // clobbered\n  );\n}\n\n#endif\n\n#define LOAD_LANE_16b(VALUE, LANE) do {             \\\n  (VALUE) = vld1_lane_s16(src, (VALUE), (LANE));    \\\n  src += stride;                                    \\\n} while (0)\n\nstatic void FTransformWHT(const int16_t* src, int16_t* out) {\n  const int stride = 16;\n  const int16x4_t zero = vdup_n_s16(0);\n  int32x4x4_t tmp0;\n  int16x4x4_t in;\n  INIT_VECTOR4(in, zero, zero, zero, zero);\n  LOAD_LANE_16b(in.val[0], 0);\n  LOAD_LANE_16b(in.val[1], 0);\n  LOAD_LANE_16b(in.val[2], 0);\n  LOAD_LANE_16b(in.val[3], 0);\n  LOAD_LANE_16b(in.val[0], 1);\n  LOAD_LANE_16b(in.val[1], 1);\n  LOAD_LANE_16b(in.val[2], 1);\n  LOAD_LANE_16b(in.val[3], 1);\n  LOAD_LANE_16b(in.val[0], 2);\n  LOAD_LANE_16b(in.val[1], 2);\n  LOAD_LANE_16b(in.val[2], 2);\n  LOAD_LANE_16b(in.val[3], 2);\n  LOAD_LANE_16b(in.val[0], 3);\n  LOAD_LANE_16b(in.val[1], 3);\n  LOAD_LANE_16b(in.val[2], 3);\n  LOAD_LANE_16b(in.val[3], 3);\n\n  {\n    // a0 = in[0 * 16] + in[2 * 16]\n    // a1 = in[1 * 16] + in[3 * 16]\n    // a2 = in[1 * 16] - in[3 * 16]\n    // a3 = in[0 * 16] - in[2 * 16]\n    const int32x4_t a0 = vaddl_s16(in.val[0], in.val[2]);\n    const int32x4_t a1 = vaddl_s16(in.val[1], in.val[3]);\n    const int32x4_t a2 = vsubl_s16(in.val[1], in.val[3]);\n    const int32x4_t a3 = vsubl_s16(in.val[0], in.val[2]);\n    tmp0.val[0] = vaddq_s32(a0, a1);\n    tmp0.val[1] = vaddq_s32(a3, a2);\n    tmp0.val[2] = vsubq_s32(a3, a2);\n    tmp0.val[3] = vsubq_s32(a0, a1);\n  }\n  {\n    const int32x4x4_t tmp1 = Transpose4x4(tmp0);\n    // a0 = tmp[0 + i] + tmp[ 8 + i]\n    // a1 = tmp[4 + i] + tmp[12 + i]\n    // a2 = tmp[4 + i] - tmp[12 + i]\n    // a3 = tmp[0 + i] - tmp[ 8 + i]\n    const int32x4_t a0 = vaddq_s32(tmp1.val[0], tmp1.val[2]);\n    const int32x4_t a1 = vaddq_s32(tmp1.val[1], tmp1.val[3]);\n    const int32x4_t a2 = vsubq_s32(tmp1.val[1], tmp1.val[3]);\n    const int32x4_t a3 = vsubq_s32(tmp1.val[0], tmp1.val[2]);\n    const int32x4_t b0 = vhaddq_s32(a0, a1);  // (a0 + a1) >> 1\n    const int32x4_t b1 = vhaddq_s32(a3, a2);  // (a3 + a2) >> 1\n    const int32x4_t b2 = vhsubq_s32(a3, a2);  // (a3 - a2) >> 1\n    const int32x4_t b3 = vhsubq_s32(a0, a1);  // (a0 - a1) >> 1\n    const int16x4_t out0 = vmovn_s32(b0);\n    const int16x4_t out1 = vmovn_s32(b1);\n    const int16x4_t out2 = vmovn_s32(b2);\n    const int16x4_t out3 = vmovn_s32(b3);\n\n    vst1_s16(out +  0, out0);\n    vst1_s16(out +  4, out1);\n    vst1_s16(out +  8, out2);\n    vst1_s16(out + 12, out3);\n  }\n}\n#undef LOAD_LANE_16b\n\n//------------------------------------------------------------------------------\n// Texture distortion\n//\n// We try to match the spectral content (weighted) between source and\n// reconstructed samples.\n\n// This code works but is *slower* than the inlined-asm version below\n// (with gcc-4.6). So we disable it for now. Later, it'll be conditional to\n// USE_INTRINSICS define.\n// With gcc-4.8, it's only slightly slower than the inlined.\n#if defined(USE_INTRINSICS)\n\n// Zero extend an uint16x4_t 'v' to an int32x4_t.\nstatic WEBP_INLINE int32x4_t ConvertU16ToS32(uint16x4_t v) {\n  return vreinterpretq_s32_u32(vmovl_u16(v));\n}\n\n// Does a regular 4x4 transpose followed by an adjustment of the upper columns\n// in the inner rows to restore the source order of differences,\n// i.e., a0 - a1 | a3 - a2.\nstatic WEBP_INLINE int32x4x4_t DistoTranspose4x4(const int32x4x4_t rows) {\n  int32x4x4_t out = Transpose4x4(rows);\n  // restore source order in the columns containing differences.\n  const int32x2_t r1h = vget_high_s32(out.val[1]);\n  const int32x2_t r2h = vget_high_s32(out.val[2]);\n  out.val[1] = vcombine_s32(vget_low_s32(out.val[1]), r2h);\n  out.val[2] = vcombine_s32(vget_low_s32(out.val[2]), r1h);\n  return out;\n}\n\nstatic WEBP_INLINE int32x4x4_t DistoHorizontalPass(const uint8x8_t r0r1,\n                                                   const uint8x8_t r2r3) {\n  // a0 = in[0] + in[2] | a1 = in[1] + in[3]\n  const uint16x8_t a0a1 = vaddl_u8(r0r1, r2r3);\n  // a3 = in[0] - in[2] | a2 = in[1] - in[3]\n  const uint16x8_t a3a2 = vsubl_u8(r0r1, r2r3);\n  const int32x4_t tmp0 = vpaddlq_s16(vreinterpretq_s16_u16(a0a1));  // a0 + a1\n  const int32x4_t tmp1 = vpaddlq_s16(vreinterpretq_s16_u16(a3a2));  // a3 + a2\n  // no pairwise subtraction; reorder to perform tmp[2]/tmp[3] calculations.\n  // a0a0 a3a3 a0a0 a3a3 a0a0 a3a3 a0a0 a3a3\n  // a1a1 a2a2 a1a1 a2a2 a1a1 a2a2 a1a1 a2a2\n  const int16x8x2_t transpose =\n      vtrnq_s16(vreinterpretq_s16_u16(a0a1), vreinterpretq_s16_u16(a3a2));\n  // tmp[3] = a0 - a1 | tmp[2] = a3 - a2\n  const int32x4_t tmp32_1 = vsubl_s16(vget_low_s16(transpose.val[0]),\n                                      vget_low_s16(transpose.val[1]));\n  const int32x4_t tmp32_2 = vsubl_s16(vget_high_s16(transpose.val[0]),\n                                      vget_high_s16(transpose.val[1]));\n  // [0]: tmp[3] [1]: tmp[2]\n  const int32x4x2_t split = vtrnq_s32(tmp32_1, tmp32_2);\n  const int32x4x4_t res = { { tmp0, tmp1, split.val[1], split.val[0] } };\n  return res;\n}\n\nstatic WEBP_INLINE int32x4x4_t DistoVerticalPass(const int32x4x4_t rows) {\n  // a0 = tmp[0 + i] + tmp[8 + i];\n  const int32x4_t a0 = vaddq_s32(rows.val[0], rows.val[1]);\n  // a1 = tmp[4 + i] + tmp[12+ i];\n  const int32x4_t a1 = vaddq_s32(rows.val[2], rows.val[3]);\n  // a2 = tmp[4 + i] - tmp[12+ i];\n  const int32x4_t a2 = vsubq_s32(rows.val[2], rows.val[3]);\n  // a3 = tmp[0 + i] - tmp[8 + i];\n  const int32x4_t a3 = vsubq_s32(rows.val[0], rows.val[1]);\n  const int32x4_t b0 = vqabsq_s32(vaddq_s32(a0, a1));  // abs(a0 + a1)\n  const int32x4_t b1 = vqabsq_s32(vaddq_s32(a3, a2));  // abs(a3 + a2)\n  const int32x4_t b2 = vabdq_s32(a3, a2);              // abs(a3 - a2)\n  const int32x4_t b3 = vabdq_s32(a0, a1);              // abs(a0 - a1)\n  const int32x4x4_t res = { { b0, b1, b2, b3 } };\n  return res;\n}\n\n// Calculate the weighted sum of the rows in 'b'.\nstatic WEBP_INLINE int64x1_t DistoSum(const int32x4x4_t b,\n                                      const int32x4_t w0, const int32x4_t w1,\n                                      const int32x4_t w2, const int32x4_t w3) {\n  const int32x4_t s0 = vmulq_s32(w0, b.val[0]);\n  const int32x4_t s1 = vmlaq_s32(s0, w1, b.val[1]);\n  const int32x4_t s2 = vmlaq_s32(s1, w2, b.val[2]);\n  const int32x4_t s3 = vmlaq_s32(s2, w3, b.val[3]);\n  const int64x2_t sum1 = vpaddlq_s32(s3);\n  const int64x1_t sum2 = vadd_s64(vget_low_s64(sum1), vget_high_s64(sum1));\n  return sum2;\n}\n\n#define LOAD_LANE_32b(src, VALUE, LANE) \\\n    (VALUE) = vld1q_lane_u32((const uint32_t*)(src), (VALUE), (LANE))\n\n// Hadamard transform\n// Returns the weighted sum of the absolute value of transformed coefficients.\nstatic int Disto4x4(const uint8_t* const a, const uint8_t* const b,\n                    const uint16_t* const w) {\n  uint32x4_t d0d1 = { 0, 0, 0, 0 };\n  uint32x4_t d2d3 = { 0, 0, 0, 0 };\n  LOAD_LANE_32b(a + 0 * BPS, d0d1, 0);  // a00 a01 a02 a03\n  LOAD_LANE_32b(a + 1 * BPS, d0d1, 1);  // a10 a11 a12 a13\n  LOAD_LANE_32b(b + 0 * BPS, d0d1, 2);  // b00 b01 b02 b03\n  LOAD_LANE_32b(b + 1 * BPS, d0d1, 3);  // b10 b11 b12 b13\n  LOAD_LANE_32b(a + 2 * BPS, d2d3, 0);  // a20 a21 a22 a23\n  LOAD_LANE_32b(a + 3 * BPS, d2d3, 1);  // a30 a31 a32 a33\n  LOAD_LANE_32b(b + 2 * BPS, d2d3, 2);  // b20 b21 b22 b23\n  LOAD_LANE_32b(b + 3 * BPS, d2d3, 3);  // b30 b31 b32 b33\n\n  {\n    // a00 a01 a20 a21 a10 a11 a30 a31 b00 b01 b20 b21 b10 b11 b30 b31\n    // a02 a03 a22 a23 a12 a13 a32 a33 b02 b03 b22 b23 b12 b13 b32 b33\n    const uint16x8x2_t tmp =\n        vtrnq_u16(vreinterpretq_u16_u32(d0d1), vreinterpretq_u16_u32(d2d3));\n    const uint8x16_t d0d1u8 = vreinterpretq_u8_u16(tmp.val[0]);\n    const uint8x16_t d2d3u8 = vreinterpretq_u8_u16(tmp.val[1]);\n    const int32x4x4_t hpass_a = DistoHorizontalPass(vget_low_u8(d0d1u8),\n                                                    vget_low_u8(d2d3u8));\n    const int32x4x4_t hpass_b = DistoHorizontalPass(vget_high_u8(d0d1u8),\n                                                    vget_high_u8(d2d3u8));\n    const int32x4x4_t tmp_a = DistoTranspose4x4(hpass_a);\n    const int32x4x4_t tmp_b = DistoTranspose4x4(hpass_b);\n    const int32x4x4_t vpass_a = DistoVerticalPass(tmp_a);\n    const int32x4x4_t vpass_b = DistoVerticalPass(tmp_b);\n    const int32x4_t w0 = ConvertU16ToS32(vld1_u16(w + 0));\n    const int32x4_t w1 = ConvertU16ToS32(vld1_u16(w + 4));\n    const int32x4_t w2 = ConvertU16ToS32(vld1_u16(w + 8));\n    const int32x4_t w3 = ConvertU16ToS32(vld1_u16(w + 12));\n    const int64x1_t sum1 = DistoSum(vpass_a, w0, w1, w2, w3);\n    const int64x1_t sum2 = DistoSum(vpass_b, w0, w1, w2, w3);\n    const int32x2_t diff = vabd_s32(vreinterpret_s32_s64(sum1),\n                                    vreinterpret_s32_s64(sum2));\n    const int32x2_t res = vshr_n_s32(diff, 5);\n    return vget_lane_s32(res, 0);\n  }\n}\n\n#undef LOAD_LANE_32b\n\n#else\n\n// Hadamard transform\n// Returns the weighted sum of the absolute value of transformed coefficients.\nstatic int Disto4x4(const uint8_t* const a, const uint8_t* const b,\n                    const uint16_t* const w) {\n  const int kBPS = BPS;\n  const uint8_t* A = a;\n  const uint8_t* B = b;\n  const uint16_t* W = w;\n  int sum;\n  __asm__ volatile (\n    \"vld1.32         d0[0], [%[a]], %[kBPS]   \\n\"\n    \"vld1.32         d0[1], [%[a]], %[kBPS]   \\n\"\n    \"vld1.32         d2[0], [%[a]], %[kBPS]   \\n\"\n    \"vld1.32         d2[1], [%[a]]            \\n\"\n\n    \"vld1.32         d1[0], [%[b]], %[kBPS]   \\n\"\n    \"vld1.32         d1[1], [%[b]], %[kBPS]   \\n\"\n    \"vld1.32         d3[0], [%[b]], %[kBPS]   \\n\"\n    \"vld1.32         d3[1], [%[b]]            \\n\"\n\n    // a d0/d2, b d1/d3\n    // d0/d1: 01 01 01 01\n    // d2/d3: 23 23 23 23\n    // But: it goes 01 45 23 67\n    // Notice the middle values are transposed\n    \"vtrn.16         q0, q1                   \\n\"\n\n    // {a0, a1} = {in[0] + in[2], in[1] + in[3]}\n    \"vaddl.u8        q2, d0, d2               \\n\"\n    \"vaddl.u8        q10, d1, d3              \\n\"\n    // {a3, a2} = {in[0] - in[2], in[1] - in[3]}\n    \"vsubl.u8        q3, d0, d2               \\n\"\n    \"vsubl.u8        q11, d1, d3              \\n\"\n\n    // tmp[0] = a0 + a1\n    \"vpaddl.s16      q0, q2                   \\n\"\n    \"vpaddl.s16      q8, q10                  \\n\"\n\n    // tmp[1] = a3 + a2\n    \"vpaddl.s16      q1, q3                   \\n\"\n    \"vpaddl.s16      q9, q11                  \\n\"\n\n    // No pair subtract\n    // q2 = {a0, a3}\n    // q3 = {a1, a2}\n    \"vtrn.16         q2, q3                   \\n\"\n    \"vtrn.16         q10, q11                 \\n\"\n\n    // {tmp[3], tmp[2]} = {a0 - a1, a3 - a2}\n    \"vsubl.s16       q12, d4, d6              \\n\"\n    \"vsubl.s16       q13, d5, d7              \\n\"\n    \"vsubl.s16       q14, d20, d22            \\n\"\n    \"vsubl.s16       q15, d21, d23            \\n\"\n\n    // separate tmp[3] and tmp[2]\n    // q12 = tmp[3]\n    // q13 = tmp[2]\n    \"vtrn.32         q12, q13                 \\n\"\n    \"vtrn.32         q14, q15                 \\n\"\n\n    // Transpose tmp for a\n    \"vswp            d1, d26                  \\n\" // vtrn.64\n    \"vswp            d3, d24                  \\n\" // vtrn.64\n    \"vtrn.32         q0, q1                   \\n\"\n    \"vtrn.32         q13, q12                 \\n\"\n\n    // Transpose tmp for b\n    \"vswp            d17, d30                 \\n\" // vtrn.64\n    \"vswp            d19, d28                 \\n\" // vtrn.64\n    \"vtrn.32         q8, q9                   \\n\"\n    \"vtrn.32         q15, q14                 \\n\"\n\n    // The first Q register is a, the second b.\n    // q0/8 tmp[0-3]\n    // q13/15 tmp[4-7]\n    // q1/9 tmp[8-11]\n    // q12/14 tmp[12-15]\n\n    // These are still in 01 45 23 67 order. We fix it easily in the addition\n    // case but the subtraction propagates them.\n    \"vswp            d3, d27                  \\n\"\n    \"vswp            d19, d31                 \\n\"\n\n    // a0 = tmp[0] + tmp[8]\n    \"vadd.s32        q2, q0, q1               \\n\"\n    \"vadd.s32        q3, q8, q9               \\n\"\n\n    // a1 = tmp[4] + tmp[12]\n    \"vadd.s32        q10, q13, q12            \\n\"\n    \"vadd.s32        q11, q15, q14            \\n\"\n\n    // a2 = tmp[4] - tmp[12]\n    \"vsub.s32        q13, q13, q12            \\n\"\n    \"vsub.s32        q15, q15, q14            \\n\"\n\n    // a3 = tmp[0] - tmp[8]\n    \"vsub.s32        q0, q0, q1               \\n\"\n    \"vsub.s32        q8, q8, q9               \\n\"\n\n    // b0 = a0 + a1\n    \"vadd.s32        q1, q2, q10              \\n\"\n    \"vadd.s32        q9, q3, q11              \\n\"\n\n    // b1 = a3 + a2\n    \"vadd.s32        q12, q0, q13             \\n\"\n    \"vadd.s32        q14, q8, q15             \\n\"\n\n    // b2 = a3 - a2\n    \"vsub.s32        q0, q0, q13              \\n\"\n    \"vsub.s32        q8, q8, q15              \\n\"\n\n    // b3 = a0 - a1\n    \"vsub.s32        q2, q2, q10              \\n\"\n    \"vsub.s32        q3, q3, q11              \\n\"\n\n    \"vld1.64         {q10, q11}, [%[w]]       \\n\"\n\n    // abs(b0)\n    \"vabs.s32        q1, q1                   \\n\"\n    \"vabs.s32        q9, q9                   \\n\"\n    // abs(b1)\n    \"vabs.s32        q12, q12                 \\n\"\n    \"vabs.s32        q14, q14                 \\n\"\n    // abs(b2)\n    \"vabs.s32        q0, q0                   \\n\"\n    \"vabs.s32        q8, q8                   \\n\"\n    // abs(b3)\n    \"vabs.s32        q2, q2                   \\n\"\n    \"vabs.s32        q3, q3                   \\n\"\n\n    // expand w before using.\n    \"vmovl.u16       q13, d20                 \\n\"\n    \"vmovl.u16       q15, d21                 \\n\"\n\n    // w[0] * abs(b0)\n    \"vmul.u32        q1, q1, q13              \\n\"\n    \"vmul.u32        q9, q9, q13              \\n\"\n\n    // w[4] * abs(b1)\n    \"vmla.u32        q1, q12, q15             \\n\"\n    \"vmla.u32        q9, q14, q15             \\n\"\n\n    // expand w before using.\n    \"vmovl.u16       q13, d22                 \\n\"\n    \"vmovl.u16       q15, d23                 \\n\"\n\n    // w[8] * abs(b1)\n    \"vmla.u32        q1, q0, q13              \\n\"\n    \"vmla.u32        q9, q8, q13              \\n\"\n\n    // w[12] * abs(b1)\n    \"vmla.u32        q1, q2, q15              \\n\"\n    \"vmla.u32        q9, q3, q15              \\n\"\n\n    // Sum the arrays\n    \"vpaddl.u32      q1, q1                   \\n\"\n    \"vpaddl.u32      q9, q9                   \\n\"\n    \"vadd.u64        d2, d3                   \\n\"\n    \"vadd.u64        d18, d19                 \\n\"\n\n    // Hadamard transform needs 4 bits of extra precision (2 bits in each\n    // direction) for dynamic raw. Weights w[] are 16bits at max, so the maximum\n    // precision for coeff is 8bit of input + 4bits of Hadamard transform +\n    // 16bits for w[] + 2 bits of abs() summation.\n    //\n    // This uses a maximum of 31 bits (signed). Discarding the top 32 bits is\n    // A-OK.\n\n    // sum2 - sum1\n    \"vsub.u32        d0, d2, d18              \\n\"\n    // abs(sum2 - sum1)\n    \"vabs.s32        d0, d0                   \\n\"\n    // abs(sum2 - sum1) >> 5\n    \"vshr.u32        d0, #5                   \\n\"\n\n    // It would be better to move the value straight into r0 but I'm not\n    // entirely sure how this works with inline assembly.\n    \"vmov.32         %[sum], d0[0]            \\n\"\n\n    : [sum] \"=r\"(sum), [a] \"+r\"(A), [b] \"+r\"(B), [w] \"+r\"(W)\n    : [kBPS] \"r\"(kBPS)\n    : \"memory\", \"q0\", \"q1\", \"q2\", \"q3\", \"q4\", \"q5\", \"q6\", \"q7\", \"q8\", \"q9\",\n      \"q10\", \"q11\", \"q12\", \"q13\", \"q14\", \"q15\"  // clobbered\n  ) ;\n\n  return sum;\n}\n\n#endif  // USE_INTRINSICS\n\nstatic int Disto16x16(const uint8_t* const a, const uint8_t* const b,\n                      const uint16_t* const w) {\n  int D = 0;\n  int x, y;\n  for (y = 0; y < 16 * BPS; y += 4 * BPS) {\n    for (x = 0; x < 16; x += 4) {\n      D += Disto4x4(a + x + y, b + x + y, w);\n    }\n  }\n  return D;\n}\n\n//------------------------------------------------------------------------------\n\nstatic void CollectHistogram(const uint8_t* ref, const uint8_t* pred,\n                             int start_block, int end_block,\n                             VP8Histogram* const histo) {\n  const uint16x8_t max_coeff_thresh = vdupq_n_u16(MAX_COEFF_THRESH);\n  int j;\n  for (j = start_block; j < end_block; ++j) {\n    int16_t out[16];\n    FTransform(ref + VP8DspScan[j], pred + VP8DspScan[j], out);\n    {\n      int k;\n      const int16x8_t a0 = vld1q_s16(out + 0);\n      const int16x8_t b0 = vld1q_s16(out + 8);\n      const uint16x8_t a1 = vreinterpretq_u16_s16(vabsq_s16(a0));\n      const uint16x8_t b1 = vreinterpretq_u16_s16(vabsq_s16(b0));\n      const uint16x8_t a2 = vshrq_n_u16(a1, 3);\n      const uint16x8_t b2 = vshrq_n_u16(b1, 3);\n      const uint16x8_t a3 = vminq_u16(a2, max_coeff_thresh);\n      const uint16x8_t b3 = vminq_u16(b2, max_coeff_thresh);\n      vst1q_s16(out + 0, vreinterpretq_s16_u16(a3));\n      vst1q_s16(out + 8, vreinterpretq_s16_u16(b3));\n      // Convert coefficients to bin.\n      for (k = 0; k < 16; ++k) {\n        histo->distribution[out[k]]++;\n      }\n    }\n  }\n}\n\n//------------------------------------------------------------------------------\n\nstatic WEBP_INLINE void AccumulateSSE16(const uint8_t* const a,\n                                        const uint8_t* const b,\n                                        uint32x4_t* const sum) {\n  const uint8x16_t a0 = vld1q_u8(a);\n  const uint8x16_t b0 = vld1q_u8(b);\n  const uint8x16_t abs_diff = vabdq_u8(a0, b0);\n  uint16x8_t prod = vmull_u8(vget_low_u8(abs_diff), vget_low_u8(abs_diff));\n  prod = vmlal_u8(prod, vget_high_u8(abs_diff), vget_high_u8(abs_diff));\n  *sum = vpadalq_u16(*sum, prod);      // pair-wise add and accumulate\n}\n\n// Horizontal sum of all four uint32_t values in 'sum'.\nstatic int SumToInt(uint32x4_t sum) {\n  const uint64x2_t sum2 = vpaddlq_u32(sum);\n  const uint64_t sum3 = vgetq_lane_u64(sum2, 0) + vgetq_lane_u64(sum2, 1);\n  return (int)sum3;\n}\n\nstatic int SSE16x16(const uint8_t* a, const uint8_t* b) {\n  uint32x4_t sum = vdupq_n_u32(0);\n  int y;\n  for (y = 0; y < 16; ++y) {\n    AccumulateSSE16(a + y * BPS, b + y * BPS, &sum);\n  }\n  return SumToInt(sum);\n}\n\nstatic int SSE16x8(const uint8_t* a, const uint8_t* b) {\n  uint32x4_t sum = vdupq_n_u32(0);\n  int y;\n  for (y = 0; y < 8; ++y) {\n    AccumulateSSE16(a + y * BPS, b + y * BPS, &sum);\n  }\n  return SumToInt(sum);\n}\n\nstatic int SSE8x8(const uint8_t* a, const uint8_t* b) {\n  uint32x4_t sum = vdupq_n_u32(0);\n  int y;\n  for (y = 0; y < 8; ++y) {\n    const uint8x8_t a0 = vld1_u8(a + y * BPS);\n    const uint8x8_t b0 = vld1_u8(b + y * BPS);\n    const uint8x8_t abs_diff = vabd_u8(a0, b0);\n    const uint16x8_t prod = vmull_u8(abs_diff, abs_diff);\n    sum = vpadalq_u16(sum, prod);\n  }\n  return SumToInt(sum);\n}\n\nstatic int SSE4x4(const uint8_t* a, const uint8_t* b) {\n  const uint8x16_t a0 = Load4x4(a);\n  const uint8x16_t b0 = Load4x4(b);\n  const uint8x16_t abs_diff = vabdq_u8(a0, b0);\n  uint16x8_t prod = vmull_u8(vget_low_u8(abs_diff), vget_low_u8(abs_diff));\n  prod = vmlal_u8(prod, vget_high_u8(abs_diff), vget_high_u8(abs_diff));\n  return SumToInt(vpaddlq_u16(prod));\n}\n\n//------------------------------------------------------------------------------\n\n// Compilation with gcc-4.6.x is problematic for now.\n#if !defined(WORK_AROUND_GCC)\n\nstatic int16x8_t Quantize(int16_t* const in,\n                          const VP8Matrix* const mtx, int offset) {\n  const uint16x8_t sharp = vld1q_u16(&mtx->sharpen_[offset]);\n  const uint16x8_t q = vld1q_u16(&mtx->q_[offset]);\n  const uint16x8_t iq = vld1q_u16(&mtx->iq_[offset]);\n  const uint32x4_t bias0 = vld1q_u32(&mtx->bias_[offset + 0]);\n  const uint32x4_t bias1 = vld1q_u32(&mtx->bias_[offset + 4]);\n\n  const int16x8_t a = vld1q_s16(in + offset);                // in\n  const uint16x8_t b = vreinterpretq_u16_s16(vabsq_s16(a));  // coeff = abs(in)\n  const int16x8_t sign = vshrq_n_s16(a, 15);                 // sign\n  const uint16x8_t c = vaddq_u16(b, sharp);                  // + sharpen\n  const uint32x4_t m0 = vmull_u16(vget_low_u16(c), vget_low_u16(iq));\n  const uint32x4_t m1 = vmull_u16(vget_high_u16(c), vget_high_u16(iq));\n  const uint32x4_t m2 = vhaddq_u32(m0, bias0);\n  const uint32x4_t m3 = vhaddq_u32(m1, bias1);     // (coeff * iQ + bias) >> 1\n  const uint16x8_t c0 = vcombine_u16(vshrn_n_u32(m2, 16),\n                                     vshrn_n_u32(m3, 16));   // QFIX=17 = 16+1\n  const uint16x8_t c1 = vminq_u16(c0, vdupq_n_u16(MAX_LEVEL));\n  const int16x8_t c2 = veorq_s16(vreinterpretq_s16_u16(c1), sign);\n  const int16x8_t c3 = vsubq_s16(c2, sign);                  // restore sign\n  const int16x8_t c4 = vmulq_s16(c3, vreinterpretq_s16_u16(q));\n  vst1q_s16(in + offset, c4);\n  assert(QFIX == 17);  // this function can't work as is if QFIX != 16+1\n  return c3;\n}\n\nstatic const uint8_t kShuffles[4][8] = {\n  { 0,   1,  2,  3,  8,  9, 16, 17 },\n  { 10, 11,  4,  5,  6,  7, 12, 13 },\n  { 18, 19, 24, 25, 26, 27, 20, 21 },\n  { 14, 15, 22, 23, 28, 29, 30, 31 }\n};\n\nstatic int QuantizeBlock(int16_t in[16], int16_t out[16],\n                         const VP8Matrix* const mtx) {\n  const int16x8_t out0 = Quantize(in, mtx, 0);\n  const int16x8_t out1 = Quantize(in, mtx, 8);\n  uint8x8x4_t shuffles;\n  // vtbl4_u8 is marked unavailable for iOS arm64, use wider versions there.\n#if defined(__APPLE__) && defined(__aarch64__)\n  uint8x16x2_t all_out;\n  INIT_VECTOR2(all_out, vreinterpretq_u8_s16(out0), vreinterpretq_u8_s16(out1));\n  INIT_VECTOR4(shuffles,\n               vtbl2q_u8(all_out, vld1_u8(kShuffles[0])),\n               vtbl2q_u8(all_out, vld1_u8(kShuffles[1])),\n               vtbl2q_u8(all_out, vld1_u8(kShuffles[2])),\n               vtbl2q_u8(all_out, vld1_u8(kShuffles[3])));\n#else\n  uint8x8x4_t all_out;\n  INIT_VECTOR4(all_out,\n               vreinterpret_u8_s16(vget_low_s16(out0)),\n               vreinterpret_u8_s16(vget_high_s16(out0)),\n               vreinterpret_u8_s16(vget_low_s16(out1)),\n               vreinterpret_u8_s16(vget_high_s16(out1)));\n  INIT_VECTOR4(shuffles,\n               vtbl4_u8(all_out, vld1_u8(kShuffles[0])),\n               vtbl4_u8(all_out, vld1_u8(kShuffles[1])),\n               vtbl4_u8(all_out, vld1_u8(kShuffles[2])),\n               vtbl4_u8(all_out, vld1_u8(kShuffles[3])));\n#endif\n  // Zigzag reordering\n  vst1_u8((uint8_t*)(out +  0), shuffles.val[0]);\n  vst1_u8((uint8_t*)(out +  4), shuffles.val[1]);\n  vst1_u8((uint8_t*)(out +  8), shuffles.val[2]);\n  vst1_u8((uint8_t*)(out + 12), shuffles.val[3]);\n  // test zeros\n  if (*(uint64_t*)(out +  0) != 0) return 1;\n  if (*(uint64_t*)(out +  4) != 0) return 1;\n  if (*(uint64_t*)(out +  8) != 0) return 1;\n  if (*(uint64_t*)(out + 12) != 0) return 1;\n  return 0;\n}\n\n#endif   // !WORK_AROUND_GCC\n\n#endif   // WEBP_USE_NEON\n\n//------------------------------------------------------------------------------\n// Entry point\n\nextern void VP8EncDspInitNEON(void);\n\nvoid VP8EncDspInitNEON(void) {\n#if defined(WEBP_USE_NEON)\n  VP8ITransform = ITransform;\n  VP8FTransform = FTransform;\n\n  VP8FTransformWHT = FTransformWHT;\n\n  VP8TDisto4x4 = Disto4x4;\n  VP8TDisto16x16 = Disto16x16;\n  VP8CollectHistogram = CollectHistogram;\n  VP8SSE16x16 = SSE16x16;\n  VP8SSE16x8 = SSE16x8;\n  VP8SSE8x8 = SSE8x8;\n  VP8SSE4x4 = SSE4x4;\n#if !defined(WORK_AROUND_GCC)\n  VP8EncQuantizeBlock = QuantizeBlock;\n#endif\n#endif   // WEBP_USE_NEON\n}\n"
  },
  {
    "path": "ext/libwebp/dsp/enc_sse2.c",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// SSE2 version of speed-critical encoding functions.\n//\n// Author: Christian Duvivier (cduvivier@google.com)\n\n#include \"./dsp.h\"\n\n#if defined(WEBP_USE_SSE2)\n#include <stdlib.h>  // for abs()\n#include <emmintrin.h>\n\n#include \"../enc/cost.h\"\n#include \"../enc/vp8enci.h\"\n#include \"../utils/utils.h\"\n\n//------------------------------------------------------------------------------\n// Quite useful macro for debugging. Left here for convenience.\n\n#if 0\n#include <stdio.h>\nstatic void PrintReg(const __m128i r, const char* const name, int size) {\n  int n;\n  union {\n    __m128i r;\n    uint8_t i8[16];\n    uint16_t i16[8];\n    uint32_t i32[4];\n    uint64_t i64[2];\n  } tmp;\n  tmp.r = r;\n  printf(\"%s\\t: \", name);\n  if (size == 8) {\n    for (n = 0; n < 16; ++n) printf(\"%.2x \", tmp.i8[n]);\n  } else if (size == 16) {\n    for (n = 0; n < 8; ++n) printf(\"%.4x \", tmp.i16[n]);\n  } else if (size == 32) {\n    for (n = 0; n < 4; ++n) printf(\"%.8x \", tmp.i32[n]);\n  } else {\n    for (n = 0; n < 2; ++n) printf(\"%.16lx \", tmp.i64[n]);\n  }\n  printf(\"\\n\");\n}\n#endif\n\n//------------------------------------------------------------------------------\n// Compute susceptibility based on DCT-coeff histograms:\n// the higher, the \"easier\" the macroblock is to compress.\n\nstatic void CollectHistogram(const uint8_t* ref, const uint8_t* pred,\n                             int start_block, int end_block,\n                             VP8Histogram* const histo) {\n  const __m128i max_coeff_thresh = _mm_set1_epi16(MAX_COEFF_THRESH);\n  int j;\n  for (j = start_block; j < end_block; ++j) {\n    int16_t out[16];\n    int k;\n\n    VP8FTransform(ref + VP8DspScan[j], pred + VP8DspScan[j], out);\n\n    // Convert coefficients to bin (within out[]).\n    {\n      // Load.\n      const __m128i out0 = _mm_loadu_si128((__m128i*)&out[0]);\n      const __m128i out1 = _mm_loadu_si128((__m128i*)&out[8]);\n      // sign(out) = out >> 15  (0x0000 if positive, 0xffff if negative)\n      const __m128i sign0 = _mm_srai_epi16(out0, 15);\n      const __m128i sign1 = _mm_srai_epi16(out1, 15);\n      // abs(out) = (out ^ sign) - sign\n      const __m128i xor0 = _mm_xor_si128(out0, sign0);\n      const __m128i xor1 = _mm_xor_si128(out1, sign1);\n      const __m128i abs0 = _mm_sub_epi16(xor0, sign0);\n      const __m128i abs1 = _mm_sub_epi16(xor1, sign1);\n      // v = abs(out) >> 3\n      const __m128i v0 = _mm_srai_epi16(abs0, 3);\n      const __m128i v1 = _mm_srai_epi16(abs1, 3);\n      // bin = min(v, MAX_COEFF_THRESH)\n      const __m128i bin0 = _mm_min_epi16(v0, max_coeff_thresh);\n      const __m128i bin1 = _mm_min_epi16(v1, max_coeff_thresh);\n      // Store.\n      _mm_storeu_si128((__m128i*)&out[0], bin0);\n      _mm_storeu_si128((__m128i*)&out[8], bin1);\n    }\n\n    // Convert coefficients to bin.\n    for (k = 0; k < 16; ++k) {\n      histo->distribution[out[k]]++;\n    }\n  }\n}\n\n//------------------------------------------------------------------------------\n// Transforms (Paragraph 14.4)\n\n// Does one or two inverse transforms.\nstatic void ITransform(const uint8_t* ref, const int16_t* in, uint8_t* dst,\n                       int do_two) {\n  // This implementation makes use of 16-bit fixed point versions of two\n  // multiply constants:\n  //    K1 = sqrt(2) * cos (pi/8) ~= 85627 / 2^16\n  //    K2 = sqrt(2) * sin (pi/8) ~= 35468 / 2^16\n  //\n  // To be able to use signed 16-bit integers, we use the following trick to\n  // have constants within range:\n  // - Associated constants are obtained by subtracting the 16-bit fixed point\n  //   version of one:\n  //      k = K - (1 << 16)  =>  K = k + (1 << 16)\n  //      K1 = 85267  =>  k1 =  20091\n  //      K2 = 35468  =>  k2 = -30068\n  // - The multiplication of a variable by a constant become the sum of the\n  //   variable and the multiplication of that variable by the associated\n  //   constant:\n  //      (x * K) >> 16 = (x * (k + (1 << 16))) >> 16 = ((x * k ) >> 16) + x\n  const __m128i k1 = _mm_set1_epi16(20091);\n  const __m128i k2 = _mm_set1_epi16(-30068);\n  __m128i T0, T1, T2, T3;\n\n  // Load and concatenate the transform coefficients (we'll do two inverse\n  // transforms in parallel). In the case of only one inverse transform, the\n  // second half of the vectors will just contain random value we'll never\n  // use nor store.\n  __m128i in0, in1, in2, in3;\n  {\n    in0 = _mm_loadl_epi64((__m128i*)&in[0]);\n    in1 = _mm_loadl_epi64((__m128i*)&in[4]);\n    in2 = _mm_loadl_epi64((__m128i*)&in[8]);\n    in3 = _mm_loadl_epi64((__m128i*)&in[12]);\n    // a00 a10 a20 a30   x x x x\n    // a01 a11 a21 a31   x x x x\n    // a02 a12 a22 a32   x x x x\n    // a03 a13 a23 a33   x x x x\n    if (do_two) {\n      const __m128i inB0 = _mm_loadl_epi64((__m128i*)&in[16]);\n      const __m128i inB1 = _mm_loadl_epi64((__m128i*)&in[20]);\n      const __m128i inB2 = _mm_loadl_epi64((__m128i*)&in[24]);\n      const __m128i inB3 = _mm_loadl_epi64((__m128i*)&in[28]);\n      in0 = _mm_unpacklo_epi64(in0, inB0);\n      in1 = _mm_unpacklo_epi64(in1, inB1);\n      in2 = _mm_unpacklo_epi64(in2, inB2);\n      in3 = _mm_unpacklo_epi64(in3, inB3);\n      // a00 a10 a20 a30   b00 b10 b20 b30\n      // a01 a11 a21 a31   b01 b11 b21 b31\n      // a02 a12 a22 a32   b02 b12 b22 b32\n      // a03 a13 a23 a33   b03 b13 b23 b33\n    }\n  }\n\n  // Vertical pass and subsequent transpose.\n  {\n    // First pass, c and d calculations are longer because of the \"trick\"\n    // multiplications.\n    const __m128i a = _mm_add_epi16(in0, in2);\n    const __m128i b = _mm_sub_epi16(in0, in2);\n    // c = MUL(in1, K2) - MUL(in3, K1) = MUL(in1, k2) - MUL(in3, k1) + in1 - in3\n    const __m128i c1 = _mm_mulhi_epi16(in1, k2);\n    const __m128i c2 = _mm_mulhi_epi16(in3, k1);\n    const __m128i c3 = _mm_sub_epi16(in1, in3);\n    const __m128i c4 = _mm_sub_epi16(c1, c2);\n    const __m128i c = _mm_add_epi16(c3, c4);\n    // d = MUL(in1, K1) + MUL(in3, K2) = MUL(in1, k1) + MUL(in3, k2) + in1 + in3\n    const __m128i d1 = _mm_mulhi_epi16(in1, k1);\n    const __m128i d2 = _mm_mulhi_epi16(in3, k2);\n    const __m128i d3 = _mm_add_epi16(in1, in3);\n    const __m128i d4 = _mm_add_epi16(d1, d2);\n    const __m128i d = _mm_add_epi16(d3, d4);\n\n    // Second pass.\n    const __m128i tmp0 = _mm_add_epi16(a, d);\n    const __m128i tmp1 = _mm_add_epi16(b, c);\n    const __m128i tmp2 = _mm_sub_epi16(b, c);\n    const __m128i tmp3 = _mm_sub_epi16(a, d);\n\n    // Transpose the two 4x4.\n    // a00 a01 a02 a03   b00 b01 b02 b03\n    // a10 a11 a12 a13   b10 b11 b12 b13\n    // a20 a21 a22 a23   b20 b21 b22 b23\n    // a30 a31 a32 a33   b30 b31 b32 b33\n    const __m128i transpose0_0 = _mm_unpacklo_epi16(tmp0, tmp1);\n    const __m128i transpose0_1 = _mm_unpacklo_epi16(tmp2, tmp3);\n    const __m128i transpose0_2 = _mm_unpackhi_epi16(tmp0, tmp1);\n    const __m128i transpose0_3 = _mm_unpackhi_epi16(tmp2, tmp3);\n    // a00 a10 a01 a11   a02 a12 a03 a13\n    // a20 a30 a21 a31   a22 a32 a23 a33\n    // b00 b10 b01 b11   b02 b12 b03 b13\n    // b20 b30 b21 b31   b22 b32 b23 b33\n    const __m128i transpose1_0 = _mm_unpacklo_epi32(transpose0_0, transpose0_1);\n    const __m128i transpose1_1 = _mm_unpacklo_epi32(transpose0_2, transpose0_3);\n    const __m128i transpose1_2 = _mm_unpackhi_epi32(transpose0_0, transpose0_1);\n    const __m128i transpose1_3 = _mm_unpackhi_epi32(transpose0_2, transpose0_3);\n    // a00 a10 a20 a30 a01 a11 a21 a31\n    // b00 b10 b20 b30 b01 b11 b21 b31\n    // a02 a12 a22 a32 a03 a13 a23 a33\n    // b02 b12 a22 b32 b03 b13 b23 b33\n    T0 = _mm_unpacklo_epi64(transpose1_0, transpose1_1);\n    T1 = _mm_unpackhi_epi64(transpose1_0, transpose1_1);\n    T2 = _mm_unpacklo_epi64(transpose1_2, transpose1_3);\n    T3 = _mm_unpackhi_epi64(transpose1_2, transpose1_3);\n    // a00 a10 a20 a30   b00 b10 b20 b30\n    // a01 a11 a21 a31   b01 b11 b21 b31\n    // a02 a12 a22 a32   b02 b12 b22 b32\n    // a03 a13 a23 a33   b03 b13 b23 b33\n  }\n\n  // Horizontal pass and subsequent transpose.\n  {\n    // First pass, c and d calculations are longer because of the \"trick\"\n    // multiplications.\n    const __m128i four = _mm_set1_epi16(4);\n    const __m128i dc = _mm_add_epi16(T0, four);\n    const __m128i a =  _mm_add_epi16(dc, T2);\n    const __m128i b =  _mm_sub_epi16(dc, T2);\n    // c = MUL(T1, K2) - MUL(T3, K1) = MUL(T1, k2) - MUL(T3, k1) + T1 - T3\n    const __m128i c1 = _mm_mulhi_epi16(T1, k2);\n    const __m128i c2 = _mm_mulhi_epi16(T3, k1);\n    const __m128i c3 = _mm_sub_epi16(T1, T3);\n    const __m128i c4 = _mm_sub_epi16(c1, c2);\n    const __m128i c = _mm_add_epi16(c3, c4);\n    // d = MUL(T1, K1) + MUL(T3, K2) = MUL(T1, k1) + MUL(T3, k2) + T1 + T3\n    const __m128i d1 = _mm_mulhi_epi16(T1, k1);\n    const __m128i d2 = _mm_mulhi_epi16(T3, k2);\n    const __m128i d3 = _mm_add_epi16(T1, T3);\n    const __m128i d4 = _mm_add_epi16(d1, d2);\n    const __m128i d = _mm_add_epi16(d3, d4);\n\n    // Second pass.\n    const __m128i tmp0 = _mm_add_epi16(a, d);\n    const __m128i tmp1 = _mm_add_epi16(b, c);\n    const __m128i tmp2 = _mm_sub_epi16(b, c);\n    const __m128i tmp3 = _mm_sub_epi16(a, d);\n    const __m128i shifted0 = _mm_srai_epi16(tmp0, 3);\n    const __m128i shifted1 = _mm_srai_epi16(tmp1, 3);\n    const __m128i shifted2 = _mm_srai_epi16(tmp2, 3);\n    const __m128i shifted3 = _mm_srai_epi16(tmp3, 3);\n\n    // Transpose the two 4x4.\n    // a00 a01 a02 a03   b00 b01 b02 b03\n    // a10 a11 a12 a13   b10 b11 b12 b13\n    // a20 a21 a22 a23   b20 b21 b22 b23\n    // a30 a31 a32 a33   b30 b31 b32 b33\n    const __m128i transpose0_0 = _mm_unpacklo_epi16(shifted0, shifted1);\n    const __m128i transpose0_1 = _mm_unpacklo_epi16(shifted2, shifted3);\n    const __m128i transpose0_2 = _mm_unpackhi_epi16(shifted0, shifted1);\n    const __m128i transpose0_3 = _mm_unpackhi_epi16(shifted2, shifted3);\n    // a00 a10 a01 a11   a02 a12 a03 a13\n    // a20 a30 a21 a31   a22 a32 a23 a33\n    // b00 b10 b01 b11   b02 b12 b03 b13\n    // b20 b30 b21 b31   b22 b32 b23 b33\n    const __m128i transpose1_0 = _mm_unpacklo_epi32(transpose0_0, transpose0_1);\n    const __m128i transpose1_1 = _mm_unpacklo_epi32(transpose0_2, transpose0_3);\n    const __m128i transpose1_2 = _mm_unpackhi_epi32(transpose0_0, transpose0_1);\n    const __m128i transpose1_3 = _mm_unpackhi_epi32(transpose0_2, transpose0_3);\n    // a00 a10 a20 a30 a01 a11 a21 a31\n    // b00 b10 b20 b30 b01 b11 b21 b31\n    // a02 a12 a22 a32 a03 a13 a23 a33\n    // b02 b12 a22 b32 b03 b13 b23 b33\n    T0 = _mm_unpacklo_epi64(transpose1_0, transpose1_1);\n    T1 = _mm_unpackhi_epi64(transpose1_0, transpose1_1);\n    T2 = _mm_unpacklo_epi64(transpose1_2, transpose1_3);\n    T3 = _mm_unpackhi_epi64(transpose1_2, transpose1_3);\n    // a00 a10 a20 a30   b00 b10 b20 b30\n    // a01 a11 a21 a31   b01 b11 b21 b31\n    // a02 a12 a22 a32   b02 b12 b22 b32\n    // a03 a13 a23 a33   b03 b13 b23 b33\n  }\n\n  // Add inverse transform to 'ref' and store.\n  {\n    const __m128i zero = _mm_setzero_si128();\n    // Load the reference(s).\n    __m128i ref0, ref1, ref2, ref3;\n    if (do_two) {\n      // Load eight bytes/pixels per line.\n      ref0 = _mm_loadl_epi64((__m128i*)&ref[0 * BPS]);\n      ref1 = _mm_loadl_epi64((__m128i*)&ref[1 * BPS]);\n      ref2 = _mm_loadl_epi64((__m128i*)&ref[2 * BPS]);\n      ref3 = _mm_loadl_epi64((__m128i*)&ref[3 * BPS]);\n    } else {\n      // Load four bytes/pixels per line.\n      ref0 = _mm_cvtsi32_si128(*(int*)&ref[0 * BPS]);\n      ref1 = _mm_cvtsi32_si128(*(int*)&ref[1 * BPS]);\n      ref2 = _mm_cvtsi32_si128(*(int*)&ref[2 * BPS]);\n      ref3 = _mm_cvtsi32_si128(*(int*)&ref[3 * BPS]);\n    }\n    // Convert to 16b.\n    ref0 = _mm_unpacklo_epi8(ref0, zero);\n    ref1 = _mm_unpacklo_epi8(ref1, zero);\n    ref2 = _mm_unpacklo_epi8(ref2, zero);\n    ref3 = _mm_unpacklo_epi8(ref3, zero);\n    // Add the inverse transform(s).\n    ref0 = _mm_add_epi16(ref0, T0);\n    ref1 = _mm_add_epi16(ref1, T1);\n    ref2 = _mm_add_epi16(ref2, T2);\n    ref3 = _mm_add_epi16(ref3, T3);\n    // Unsigned saturate to 8b.\n    ref0 = _mm_packus_epi16(ref0, ref0);\n    ref1 = _mm_packus_epi16(ref1, ref1);\n    ref2 = _mm_packus_epi16(ref2, ref2);\n    ref3 = _mm_packus_epi16(ref3, ref3);\n    // Store the results.\n    if (do_two) {\n      // Store eight bytes/pixels per line.\n      _mm_storel_epi64((__m128i*)&dst[0 * BPS], ref0);\n      _mm_storel_epi64((__m128i*)&dst[1 * BPS], ref1);\n      _mm_storel_epi64((__m128i*)&dst[2 * BPS], ref2);\n      _mm_storel_epi64((__m128i*)&dst[3 * BPS], ref3);\n    } else {\n      // Store four bytes/pixels per line.\n      *((int32_t *)&dst[0 * BPS]) = _mm_cvtsi128_si32(ref0);\n      *((int32_t *)&dst[1 * BPS]) = _mm_cvtsi128_si32(ref1);\n      *((int32_t *)&dst[2 * BPS]) = _mm_cvtsi128_si32(ref2);\n      *((int32_t *)&dst[3 * BPS]) = _mm_cvtsi128_si32(ref3);\n    }\n  }\n}\n\nstatic void FTransform(const uint8_t* src, const uint8_t* ref, int16_t* out) {\n  const __m128i zero = _mm_setzero_si128();\n  const __m128i seven = _mm_set1_epi16(7);\n  const __m128i k937 = _mm_set1_epi32(937);\n  const __m128i k1812 = _mm_set1_epi32(1812);\n  const __m128i k51000 = _mm_set1_epi32(51000);\n  const __m128i k12000_plus_one = _mm_set1_epi32(12000 + (1 << 16));\n  const __m128i k5352_2217 = _mm_set_epi16(5352,  2217, 5352,  2217,\n                                           5352,  2217, 5352,  2217);\n  const __m128i k2217_5352 = _mm_set_epi16(2217, -5352, 2217, -5352,\n                                           2217, -5352, 2217, -5352);\n  const __m128i k88p = _mm_set_epi16(8, 8, 8, 8, 8, 8, 8, 8);\n  const __m128i k88m = _mm_set_epi16(-8, 8, -8, 8, -8, 8, -8, 8);\n  const __m128i k5352_2217p = _mm_set_epi16(2217, 5352, 2217, 5352,\n                                            2217, 5352, 2217, 5352);\n  const __m128i k5352_2217m = _mm_set_epi16(-5352, 2217, -5352, 2217,\n                                            -5352, 2217, -5352, 2217);\n  __m128i v01, v32;\n\n\n  // Difference between src and ref and initial transpose.\n  {\n    // Load src and convert to 16b.\n    const __m128i src0 = _mm_loadl_epi64((__m128i*)&src[0 * BPS]);\n    const __m128i src1 = _mm_loadl_epi64((__m128i*)&src[1 * BPS]);\n    const __m128i src2 = _mm_loadl_epi64((__m128i*)&src[2 * BPS]);\n    const __m128i src3 = _mm_loadl_epi64((__m128i*)&src[3 * BPS]);\n    const __m128i src_0 = _mm_unpacklo_epi8(src0, zero);\n    const __m128i src_1 = _mm_unpacklo_epi8(src1, zero);\n    const __m128i src_2 = _mm_unpacklo_epi8(src2, zero);\n    const __m128i src_3 = _mm_unpacklo_epi8(src3, zero);\n    // Load ref and convert to 16b.\n    const __m128i ref0 = _mm_loadl_epi64((__m128i*)&ref[0 * BPS]);\n    const __m128i ref1 = _mm_loadl_epi64((__m128i*)&ref[1 * BPS]);\n    const __m128i ref2 = _mm_loadl_epi64((__m128i*)&ref[2 * BPS]);\n    const __m128i ref3 = _mm_loadl_epi64((__m128i*)&ref[3 * BPS]);\n    const __m128i ref_0 = _mm_unpacklo_epi8(ref0, zero);\n    const __m128i ref_1 = _mm_unpacklo_epi8(ref1, zero);\n    const __m128i ref_2 = _mm_unpacklo_epi8(ref2, zero);\n    const __m128i ref_3 = _mm_unpacklo_epi8(ref3, zero);\n    // Compute difference. -> 00 01 02 03 00 00 00 00\n    const __m128i diff0 = _mm_sub_epi16(src_0, ref_0);\n    const __m128i diff1 = _mm_sub_epi16(src_1, ref_1);\n    const __m128i diff2 = _mm_sub_epi16(src_2, ref_2);\n    const __m128i diff3 = _mm_sub_epi16(src_3, ref_3);\n\n\n    // Unpack and shuffle\n    // 00 01 02 03   0 0 0 0\n    // 10 11 12 13   0 0 0 0\n    // 20 21 22 23   0 0 0 0\n    // 30 31 32 33   0 0 0 0\n    const __m128i shuf01 = _mm_unpacklo_epi32(diff0, diff1);\n    const __m128i shuf23 = _mm_unpacklo_epi32(diff2, diff3);\n    // 00 01 10 11 02 03 12 13\n    // 20 21 30 31 22 23 32 33\n    const __m128i shuf01_p =\n        _mm_shufflehi_epi16(shuf01, _MM_SHUFFLE(2, 3, 0, 1));\n    const __m128i shuf23_p =\n        _mm_shufflehi_epi16(shuf23, _MM_SHUFFLE(2, 3, 0, 1));\n    // 00 01 10 11 03 02 13 12\n    // 20 21 30 31 23 22 33 32\n    const __m128i s01 = _mm_unpacklo_epi64(shuf01_p, shuf23_p);\n    const __m128i s32 = _mm_unpackhi_epi64(shuf01_p, shuf23_p);\n    // 00 01 10 11 20 21 30 31\n    // 03 02 13 12 23 22 33 32\n    const __m128i a01 = _mm_add_epi16(s01, s32);\n    const __m128i a32 = _mm_sub_epi16(s01, s32);\n    // [d0 + d3 | d1 + d2 | ...] = [a0 a1 | a0' a1' | ... ]\n    // [d0 - d3 | d1 - d2 | ...] = [a3 a2 | a3' a2' | ... ]\n\n    const __m128i tmp0 = _mm_madd_epi16(a01, k88p);  // [ (a0 + a1) << 3, ... ]\n    const __m128i tmp2 = _mm_madd_epi16(a01, k88m);  // [ (a0 - a1) << 3, ... ]\n    const __m128i tmp1_1 = _mm_madd_epi16(a32, k5352_2217p);\n    const __m128i tmp3_1 = _mm_madd_epi16(a32, k5352_2217m);\n    const __m128i tmp1_2 = _mm_add_epi32(tmp1_1, k1812);\n    const __m128i tmp3_2 = _mm_add_epi32(tmp3_1, k937);\n    const __m128i tmp1   = _mm_srai_epi32(tmp1_2, 9);\n    const __m128i tmp3   = _mm_srai_epi32(tmp3_2, 9);\n    const __m128i s03 = _mm_packs_epi32(tmp0, tmp2);\n    const __m128i s12 = _mm_packs_epi32(tmp1, tmp3);\n    const __m128i s_lo = _mm_unpacklo_epi16(s03, s12);   // 0 1 0 1 0 1...\n    const __m128i s_hi = _mm_unpackhi_epi16(s03, s12);   // 2 3 2 3 2 3\n    const __m128i v23 = _mm_unpackhi_epi32(s_lo, s_hi);\n    v01 = _mm_unpacklo_epi32(s_lo, s_hi);\n    v32 = _mm_shuffle_epi32(v23, _MM_SHUFFLE(1, 0, 3, 2));  // 3 2 3 2 3 2..\n  }\n\n  // Second pass\n  {\n    // Same operations are done on the (0,3) and (1,2) pairs.\n    // a0 = v0 + v3\n    // a1 = v1 + v2\n    // a3 = v0 - v3\n    // a2 = v1 - v2\n    const __m128i a01 = _mm_add_epi16(v01, v32);\n    const __m128i a32 = _mm_sub_epi16(v01, v32);\n    const __m128i a11 = _mm_unpackhi_epi64(a01, a01);\n    const __m128i a22 = _mm_unpackhi_epi64(a32, a32);\n    const __m128i a01_plus_7 = _mm_add_epi16(a01, seven);\n\n    // d0 = (a0 + a1 + 7) >> 4;\n    // d2 = (a0 - a1 + 7) >> 4;\n    const __m128i c0 = _mm_add_epi16(a01_plus_7, a11);\n    const __m128i c2 = _mm_sub_epi16(a01_plus_7, a11);\n    const __m128i d0 = _mm_srai_epi16(c0, 4);\n    const __m128i d2 = _mm_srai_epi16(c2, 4);\n\n    // f1 = ((b3 * 5352 + b2 * 2217 + 12000) >> 16)\n    // f3 = ((b3 * 2217 - b2 * 5352 + 51000) >> 16)\n    const __m128i b23 = _mm_unpacklo_epi16(a22, a32);\n    const __m128i c1 = _mm_madd_epi16(b23, k5352_2217);\n    const __m128i c3 = _mm_madd_epi16(b23, k2217_5352);\n    const __m128i d1 = _mm_add_epi32(c1, k12000_plus_one);\n    const __m128i d3 = _mm_add_epi32(c3, k51000);\n    const __m128i e1 = _mm_srai_epi32(d1, 16);\n    const __m128i e3 = _mm_srai_epi32(d3, 16);\n    const __m128i f1 = _mm_packs_epi32(e1, e1);\n    const __m128i f3 = _mm_packs_epi32(e3, e3);\n    // f1 = f1 + (a3 != 0);\n    // The compare will return (0xffff, 0) for (==0, !=0). To turn that into the\n    // desired (0, 1), we add one earlier through k12000_plus_one.\n    // -> f1 = f1 + 1 - (a3 == 0)\n    const __m128i g1 = _mm_add_epi16(f1, _mm_cmpeq_epi16(a32, zero));\n\n    const __m128i d0_g1 = _mm_unpacklo_epi64(d0, g1);\n    const __m128i d2_f3 = _mm_unpacklo_epi64(d2, f3);\n    _mm_storeu_si128((__m128i*)&out[0], d0_g1);\n    _mm_storeu_si128((__m128i*)&out[8], d2_f3);\n  }\n}\n\nstatic void FTransformWHT(const int16_t* in, int16_t* out) {\n  int32_t tmp[16];\n  int i;\n  for (i = 0; i < 4; ++i, in += 64) {\n    const int a0 = (in[0 * 16] + in[2 * 16]);\n    const int a1 = (in[1 * 16] + in[3 * 16]);\n    const int a2 = (in[1 * 16] - in[3 * 16]);\n    const int a3 = (in[0 * 16] - in[2 * 16]);\n    tmp[0 + i * 4] = a0 + a1;\n    tmp[1 + i * 4] = a3 + a2;\n    tmp[2 + i * 4] = a3 - a2;\n    tmp[3 + i * 4] = a0 - a1;\n  }\n  {\n    const __m128i src0 = _mm_loadu_si128((__m128i*)&tmp[0]);\n    const __m128i src1 = _mm_loadu_si128((__m128i*)&tmp[4]);\n    const __m128i src2 = _mm_loadu_si128((__m128i*)&tmp[8]);\n    const __m128i src3 = _mm_loadu_si128((__m128i*)&tmp[12]);\n    const __m128i a0 = _mm_add_epi32(src0, src2);\n    const __m128i a1 = _mm_add_epi32(src1, src3);\n    const __m128i a2 = _mm_sub_epi32(src1, src3);\n    const __m128i a3 = _mm_sub_epi32(src0, src2);\n    const __m128i b0 = _mm_srai_epi32(_mm_add_epi32(a0, a1), 1);\n    const __m128i b1 = _mm_srai_epi32(_mm_add_epi32(a3, a2), 1);\n    const __m128i b2 = _mm_srai_epi32(_mm_sub_epi32(a3, a2), 1);\n    const __m128i b3 = _mm_srai_epi32(_mm_sub_epi32(a0, a1), 1);\n    const __m128i out0 = _mm_packs_epi32(b0, b1);\n    const __m128i out1 = _mm_packs_epi32(b2, b3);\n    _mm_storeu_si128((__m128i*)&out[0], out0);\n    _mm_storeu_si128((__m128i*)&out[8], out1);\n  }\n}\n\n//------------------------------------------------------------------------------\n// Metric\n\nstatic int SSE_Nx4(const uint8_t* a, const uint8_t* b,\n                   int num_quads, int do_16) {\n  const __m128i zero = _mm_setzero_si128();\n  __m128i sum1 = zero;\n  __m128i sum2 = zero;\n\n  while (num_quads-- > 0) {\n    // Note: for the !do_16 case, we read 16 pixels instead of 8 but that's ok,\n    // thanks to buffer over-allocation to that effect.\n    const __m128i a0 = _mm_loadu_si128((__m128i*)&a[BPS * 0]);\n    const __m128i a1 = _mm_loadu_si128((__m128i*)&a[BPS * 1]);\n    const __m128i a2 = _mm_loadu_si128((__m128i*)&a[BPS * 2]);\n    const __m128i a3 = _mm_loadu_si128((__m128i*)&a[BPS * 3]);\n    const __m128i b0 = _mm_loadu_si128((__m128i*)&b[BPS * 0]);\n    const __m128i b1 = _mm_loadu_si128((__m128i*)&b[BPS * 1]);\n    const __m128i b2 = _mm_loadu_si128((__m128i*)&b[BPS * 2]);\n    const __m128i b3 = _mm_loadu_si128((__m128i*)&b[BPS * 3]);\n\n    // compute clip0(a-b) and clip0(b-a)\n    const __m128i a0p = _mm_subs_epu8(a0, b0);\n    const __m128i a0m = _mm_subs_epu8(b0, a0);\n    const __m128i a1p = _mm_subs_epu8(a1, b1);\n    const __m128i a1m = _mm_subs_epu8(b1, a1);\n    const __m128i a2p = _mm_subs_epu8(a2, b2);\n    const __m128i a2m = _mm_subs_epu8(b2, a2);\n    const __m128i a3p = _mm_subs_epu8(a3, b3);\n    const __m128i a3m = _mm_subs_epu8(b3, a3);\n\n    // compute |a-b| with 8b arithmetic as clip0(a-b) | clip0(b-a)\n    const __m128i diff0 = _mm_or_si128(a0p, a0m);\n    const __m128i diff1 = _mm_or_si128(a1p, a1m);\n    const __m128i diff2 = _mm_or_si128(a2p, a2m);\n    const __m128i diff3 = _mm_or_si128(a3p, a3m);\n\n    // unpack (only four operations, instead of eight)\n    const __m128i low0 = _mm_unpacklo_epi8(diff0, zero);\n    const __m128i low1 = _mm_unpacklo_epi8(diff1, zero);\n    const __m128i low2 = _mm_unpacklo_epi8(diff2, zero);\n    const __m128i low3 = _mm_unpacklo_epi8(diff3, zero);\n\n    // multiply with self\n    const __m128i low_madd0 = _mm_madd_epi16(low0, low0);\n    const __m128i low_madd1 = _mm_madd_epi16(low1, low1);\n    const __m128i low_madd2 = _mm_madd_epi16(low2, low2);\n    const __m128i low_madd3 = _mm_madd_epi16(low3, low3);\n\n    // collect in a cascading way\n    const __m128i low_sum0 = _mm_add_epi32(low_madd0, low_madd1);\n    const __m128i low_sum1 = _mm_add_epi32(low_madd2, low_madd3);\n    sum1 = _mm_add_epi32(sum1, low_sum0);\n    sum2 = _mm_add_epi32(sum2, low_sum1);\n\n    if (do_16) {  // if necessary, process the higher 8 bytes similarly\n      const __m128i hi0 = _mm_unpackhi_epi8(diff0, zero);\n      const __m128i hi1 = _mm_unpackhi_epi8(diff1, zero);\n      const __m128i hi2 = _mm_unpackhi_epi8(diff2, zero);\n      const __m128i hi3 = _mm_unpackhi_epi8(diff3, zero);\n\n      const __m128i hi_madd0 = _mm_madd_epi16(hi0, hi0);\n      const __m128i hi_madd1 = _mm_madd_epi16(hi1, hi1);\n      const __m128i hi_madd2 = _mm_madd_epi16(hi2, hi2);\n      const __m128i hi_madd3 = _mm_madd_epi16(hi3, hi3);\n      const __m128i hi_sum0 = _mm_add_epi32(hi_madd0, hi_madd1);\n      const __m128i hi_sum1 = _mm_add_epi32(hi_madd2, hi_madd3);\n      sum1 = _mm_add_epi32(sum1, hi_sum0);\n      sum2 = _mm_add_epi32(sum2, hi_sum1);\n    }\n    a += 4 * BPS;\n    b += 4 * BPS;\n  }\n  {\n    int32_t tmp[4];\n    const __m128i sum = _mm_add_epi32(sum1, sum2);\n    _mm_storeu_si128((__m128i*)tmp, sum);\n    return (tmp[3] + tmp[2] + tmp[1] + tmp[0]);\n  }\n}\n\nstatic int SSE16x16(const uint8_t* a, const uint8_t* b) {\n  return SSE_Nx4(a, b, 4, 1);\n}\n\nstatic int SSE16x8(const uint8_t* a, const uint8_t* b) {\n  return SSE_Nx4(a, b, 2, 1);\n}\n\nstatic int SSE8x8(const uint8_t* a, const uint8_t* b) {\n  return SSE_Nx4(a, b, 2, 0);\n}\n\nstatic int SSE4x4(const uint8_t* a, const uint8_t* b) {\n  const __m128i zero = _mm_setzero_si128();\n\n  // Load values. Note that we read 8 pixels instead of 4,\n  // but the a/b buffers are over-allocated to that effect.\n  const __m128i a0 = _mm_loadl_epi64((__m128i*)&a[BPS * 0]);\n  const __m128i a1 = _mm_loadl_epi64((__m128i*)&a[BPS * 1]);\n  const __m128i a2 = _mm_loadl_epi64((__m128i*)&a[BPS * 2]);\n  const __m128i a3 = _mm_loadl_epi64((__m128i*)&a[BPS * 3]);\n  const __m128i b0 = _mm_loadl_epi64((__m128i*)&b[BPS * 0]);\n  const __m128i b1 = _mm_loadl_epi64((__m128i*)&b[BPS * 1]);\n  const __m128i b2 = _mm_loadl_epi64((__m128i*)&b[BPS * 2]);\n  const __m128i b3 = _mm_loadl_epi64((__m128i*)&b[BPS * 3]);\n\n  // Combine pair of lines and convert to 16b.\n  const __m128i a01 = _mm_unpacklo_epi32(a0, a1);\n  const __m128i a23 = _mm_unpacklo_epi32(a2, a3);\n  const __m128i b01 = _mm_unpacklo_epi32(b0, b1);\n  const __m128i b23 = _mm_unpacklo_epi32(b2, b3);\n  const __m128i a01s = _mm_unpacklo_epi8(a01, zero);\n  const __m128i a23s = _mm_unpacklo_epi8(a23, zero);\n  const __m128i b01s = _mm_unpacklo_epi8(b01, zero);\n  const __m128i b23s = _mm_unpacklo_epi8(b23, zero);\n\n  // Compute differences; (a-b)^2 = (abs(a-b))^2 = (sat8(a-b) + sat8(b-a))^2\n  // TODO(cduvivier): Dissassemble and figure out why this is fastest. We don't\n  //                  need absolute values, there is no need to do calculation\n  //                  in 8bit as we are already in 16bit, ... Yet this is what\n  //                  benchmarks the fastest!\n  const __m128i d0 = _mm_subs_epu8(a01s, b01s);\n  const __m128i d1 = _mm_subs_epu8(b01s, a01s);\n  const __m128i d2 = _mm_subs_epu8(a23s, b23s);\n  const __m128i d3 = _mm_subs_epu8(b23s, a23s);\n\n  // Square and add them all together.\n  const __m128i madd0 = _mm_madd_epi16(d0, d0);\n  const __m128i madd1 = _mm_madd_epi16(d1, d1);\n  const __m128i madd2 = _mm_madd_epi16(d2, d2);\n  const __m128i madd3 = _mm_madd_epi16(d3, d3);\n  const __m128i sum0 = _mm_add_epi32(madd0, madd1);\n  const __m128i sum1 = _mm_add_epi32(madd2, madd3);\n  const __m128i sum2 = _mm_add_epi32(sum0, sum1);\n\n  int32_t tmp[4];\n  _mm_storeu_si128((__m128i*)tmp, sum2);\n  return (tmp[3] + tmp[2] + tmp[1] + tmp[0]);\n}\n\n//------------------------------------------------------------------------------\n// Texture distortion\n//\n// We try to match the spectral content (weighted) between source and\n// reconstructed samples.\n\n// Hadamard transform\n// Returns the difference between the weighted sum of the absolute value of\n// transformed coefficients.\nstatic int TTransform(const uint8_t* inA, const uint8_t* inB,\n                      const uint16_t* const w) {\n  int32_t sum[4];\n  __m128i tmp_0, tmp_1, tmp_2, tmp_3;\n  const __m128i zero = _mm_setzero_si128();\n\n  // Load, combine and transpose inputs.\n  {\n    const __m128i inA_0 = _mm_loadl_epi64((__m128i*)&inA[BPS * 0]);\n    const __m128i inA_1 = _mm_loadl_epi64((__m128i*)&inA[BPS * 1]);\n    const __m128i inA_2 = _mm_loadl_epi64((__m128i*)&inA[BPS * 2]);\n    const __m128i inA_3 = _mm_loadl_epi64((__m128i*)&inA[BPS * 3]);\n    const __m128i inB_0 = _mm_loadl_epi64((__m128i*)&inB[BPS * 0]);\n    const __m128i inB_1 = _mm_loadl_epi64((__m128i*)&inB[BPS * 1]);\n    const __m128i inB_2 = _mm_loadl_epi64((__m128i*)&inB[BPS * 2]);\n    const __m128i inB_3 = _mm_loadl_epi64((__m128i*)&inB[BPS * 3]);\n\n    // Combine inA and inB (we'll do two transforms in parallel).\n    const __m128i inAB_0 = _mm_unpacklo_epi8(inA_0, inB_0);\n    const __m128i inAB_1 = _mm_unpacklo_epi8(inA_1, inB_1);\n    const __m128i inAB_2 = _mm_unpacklo_epi8(inA_2, inB_2);\n    const __m128i inAB_3 = _mm_unpacklo_epi8(inA_3, inB_3);\n    // a00 b00 a01 b01 a02 b03 a03 b03   0 0 0 0 0 0 0 0\n    // a10 b10 a11 b11 a12 b12 a13 b13   0 0 0 0 0 0 0 0\n    // a20 b20 a21 b21 a22 b22 a23 b23   0 0 0 0 0 0 0 0\n    // a30 b30 a31 b31 a32 b32 a33 b33   0 0 0 0 0 0 0 0\n\n    // Transpose the two 4x4, discarding the filling zeroes.\n    const __m128i transpose0_0 = _mm_unpacklo_epi8(inAB_0, inAB_2);\n    const __m128i transpose0_1 = _mm_unpacklo_epi8(inAB_1, inAB_3);\n    // a00 a20  b00 b20  a01 a21  b01 b21  a02 a22  b02 b22  a03 a23  b03 b23\n    // a10 a30  b10 b30  a11 a31  b11 b31  a12 a32  b12 b32  a13 a33  b13 b33\n    const __m128i transpose1_0 = _mm_unpacklo_epi8(transpose0_0, transpose0_1);\n    const __m128i transpose1_1 = _mm_unpackhi_epi8(transpose0_0, transpose0_1);\n    // a00 a10 a20 a30  b00 b10 b20 b30  a01 a11 a21 a31  b01 b11 b21 b31\n    // a02 a12 a22 a32  b02 b12 b22 b32  a03 a13 a23 a33  b03 b13 b23 b33\n\n    // Convert to 16b.\n    tmp_0 = _mm_unpacklo_epi8(transpose1_0, zero);\n    tmp_1 = _mm_unpackhi_epi8(transpose1_0, zero);\n    tmp_2 = _mm_unpacklo_epi8(transpose1_1, zero);\n    tmp_3 = _mm_unpackhi_epi8(transpose1_1, zero);\n    // a00 a10 a20 a30   b00 b10 b20 b30\n    // a01 a11 a21 a31   b01 b11 b21 b31\n    // a02 a12 a22 a32   b02 b12 b22 b32\n    // a03 a13 a23 a33   b03 b13 b23 b33\n  }\n\n  // Horizontal pass and subsequent transpose.\n  {\n    // Calculate a and b (two 4x4 at once).\n    const __m128i a0 = _mm_add_epi16(tmp_0, tmp_2);\n    const __m128i a1 = _mm_add_epi16(tmp_1, tmp_3);\n    const __m128i a2 = _mm_sub_epi16(tmp_1, tmp_3);\n    const __m128i a3 = _mm_sub_epi16(tmp_0, tmp_2);\n    const __m128i b0 = _mm_add_epi16(a0, a1);\n    const __m128i b1 = _mm_add_epi16(a3, a2);\n    const __m128i b2 = _mm_sub_epi16(a3, a2);\n    const __m128i b3 = _mm_sub_epi16(a0, a1);\n    // a00 a01 a02 a03   b00 b01 b02 b03\n    // a10 a11 a12 a13   b10 b11 b12 b13\n    // a20 a21 a22 a23   b20 b21 b22 b23\n    // a30 a31 a32 a33   b30 b31 b32 b33\n\n    // Transpose the two 4x4.\n    const __m128i transpose0_0 = _mm_unpacklo_epi16(b0, b1);\n    const __m128i transpose0_1 = _mm_unpacklo_epi16(b2, b3);\n    const __m128i transpose0_2 = _mm_unpackhi_epi16(b0, b1);\n    const __m128i transpose0_3 = _mm_unpackhi_epi16(b2, b3);\n    // a00 a10 a01 a11   a02 a12 a03 a13\n    // a20 a30 a21 a31   a22 a32 a23 a33\n    // b00 b10 b01 b11   b02 b12 b03 b13\n    // b20 b30 b21 b31   b22 b32 b23 b33\n    const __m128i transpose1_0 = _mm_unpacklo_epi32(transpose0_0, transpose0_1);\n    const __m128i transpose1_1 = _mm_unpacklo_epi32(transpose0_2, transpose0_3);\n    const __m128i transpose1_2 = _mm_unpackhi_epi32(transpose0_0, transpose0_1);\n    const __m128i transpose1_3 = _mm_unpackhi_epi32(transpose0_2, transpose0_3);\n    // a00 a10 a20 a30 a01 a11 a21 a31\n    // b00 b10 b20 b30 b01 b11 b21 b31\n    // a02 a12 a22 a32 a03 a13 a23 a33\n    // b02 b12 a22 b32 b03 b13 b23 b33\n    tmp_0 = _mm_unpacklo_epi64(transpose1_0, transpose1_1);\n    tmp_1 = _mm_unpackhi_epi64(transpose1_0, transpose1_1);\n    tmp_2 = _mm_unpacklo_epi64(transpose1_2, transpose1_3);\n    tmp_3 = _mm_unpackhi_epi64(transpose1_2, transpose1_3);\n    // a00 a10 a20 a30   b00 b10 b20 b30\n    // a01 a11 a21 a31   b01 b11 b21 b31\n    // a02 a12 a22 a32   b02 b12 b22 b32\n    // a03 a13 a23 a33   b03 b13 b23 b33\n  }\n\n  // Vertical pass and difference of weighted sums.\n  {\n    // Load all inputs.\n    // TODO(cduvivier): Make variable declarations and allocations aligned so\n    //                  we can use _mm_load_si128 instead of _mm_loadu_si128.\n    const __m128i w_0 = _mm_loadu_si128((__m128i*)&w[0]);\n    const __m128i w_8 = _mm_loadu_si128((__m128i*)&w[8]);\n\n    // Calculate a and b (two 4x4 at once).\n    const __m128i a0 = _mm_add_epi16(tmp_0, tmp_2);\n    const __m128i a1 = _mm_add_epi16(tmp_1, tmp_3);\n    const __m128i a2 = _mm_sub_epi16(tmp_1, tmp_3);\n    const __m128i a3 = _mm_sub_epi16(tmp_0, tmp_2);\n    const __m128i b0 = _mm_add_epi16(a0, a1);\n    const __m128i b1 = _mm_add_epi16(a3, a2);\n    const __m128i b2 = _mm_sub_epi16(a3, a2);\n    const __m128i b3 = _mm_sub_epi16(a0, a1);\n\n    // Separate the transforms of inA and inB.\n    __m128i A_b0 = _mm_unpacklo_epi64(b0, b1);\n    __m128i A_b2 = _mm_unpacklo_epi64(b2, b3);\n    __m128i B_b0 = _mm_unpackhi_epi64(b0, b1);\n    __m128i B_b2 = _mm_unpackhi_epi64(b2, b3);\n\n    {\n      // sign(b) = b >> 15  (0x0000 if positive, 0xffff if negative)\n      const __m128i sign_A_b0 = _mm_srai_epi16(A_b0, 15);\n      const __m128i sign_A_b2 = _mm_srai_epi16(A_b2, 15);\n      const __m128i sign_B_b0 = _mm_srai_epi16(B_b0, 15);\n      const __m128i sign_B_b2 = _mm_srai_epi16(B_b2, 15);\n\n      // b = abs(b) = (b ^ sign) - sign\n      A_b0 = _mm_xor_si128(A_b0, sign_A_b0);\n      A_b2 = _mm_xor_si128(A_b2, sign_A_b2);\n      B_b0 = _mm_xor_si128(B_b0, sign_B_b0);\n      B_b2 = _mm_xor_si128(B_b2, sign_B_b2);\n      A_b0 = _mm_sub_epi16(A_b0, sign_A_b0);\n      A_b2 = _mm_sub_epi16(A_b2, sign_A_b2);\n      B_b0 = _mm_sub_epi16(B_b0, sign_B_b0);\n      B_b2 = _mm_sub_epi16(B_b2, sign_B_b2);\n    }\n\n    // weighted sums\n    A_b0 = _mm_madd_epi16(A_b0, w_0);\n    A_b2 = _mm_madd_epi16(A_b2, w_8);\n    B_b0 = _mm_madd_epi16(B_b0, w_0);\n    B_b2 = _mm_madd_epi16(B_b2, w_8);\n    A_b0 = _mm_add_epi32(A_b0, A_b2);\n    B_b0 = _mm_add_epi32(B_b0, B_b2);\n\n    // difference of weighted sums\n    A_b0 = _mm_sub_epi32(A_b0, B_b0);\n    _mm_storeu_si128((__m128i*)&sum[0], A_b0);\n  }\n  return sum[0] + sum[1] + sum[2] + sum[3];\n}\n\nstatic int Disto4x4(const uint8_t* const a, const uint8_t* const b,\n                    const uint16_t* const w) {\n  const int diff_sum = TTransform(a, b, w);\n  return abs(diff_sum) >> 5;\n}\n\nstatic int Disto16x16(const uint8_t* const a, const uint8_t* const b,\n                      const uint16_t* const w) {\n  int D = 0;\n  int x, y;\n  for (y = 0; y < 16 * BPS; y += 4 * BPS) {\n    for (x = 0; x < 16; x += 4) {\n      D += Disto4x4(a + x + y, b + x + y, w);\n    }\n  }\n  return D;\n}\n\n//------------------------------------------------------------------------------\n// Quantization\n//\n\nstatic WEBP_INLINE int DoQuantizeBlock(int16_t in[16], int16_t out[16],\n                                       const uint16_t* const sharpen,\n                                       const VP8Matrix* const mtx) {\n  const __m128i max_coeff_2047 = _mm_set1_epi16(MAX_LEVEL);\n  const __m128i zero = _mm_setzero_si128();\n  __m128i coeff0, coeff8;\n  __m128i out0, out8;\n  __m128i packed_out;\n\n  // Load all inputs.\n  // TODO(cduvivier): Make variable declarations and allocations aligned so that\n  //                  we can use _mm_load_si128 instead of _mm_loadu_si128.\n  __m128i in0 = _mm_loadu_si128((__m128i*)&in[0]);\n  __m128i in8 = _mm_loadu_si128((__m128i*)&in[8]);\n  const __m128i iq0 = _mm_loadu_si128((__m128i*)&mtx->iq_[0]);\n  const __m128i iq8 = _mm_loadu_si128((__m128i*)&mtx->iq_[8]);\n  const __m128i q0 = _mm_loadu_si128((__m128i*)&mtx->q_[0]);\n  const __m128i q8 = _mm_loadu_si128((__m128i*)&mtx->q_[8]);\n\n  // extract sign(in)  (0x0000 if positive, 0xffff if negative)\n  const __m128i sign0 = _mm_cmpgt_epi16(zero, in0);\n  const __m128i sign8 = _mm_cmpgt_epi16(zero, in8);\n\n  // coeff = abs(in) = (in ^ sign) - sign\n  coeff0 = _mm_xor_si128(in0, sign0);\n  coeff8 = _mm_xor_si128(in8, sign8);\n  coeff0 = _mm_sub_epi16(coeff0, sign0);\n  coeff8 = _mm_sub_epi16(coeff8, sign8);\n\n  // coeff = abs(in) + sharpen\n  if (sharpen != NULL) {\n    const __m128i sharpen0 = _mm_loadu_si128((__m128i*)&sharpen[0]);\n    const __m128i sharpen8 = _mm_loadu_si128((__m128i*)&sharpen[8]);\n    coeff0 = _mm_add_epi16(coeff0, sharpen0);\n    coeff8 = _mm_add_epi16(coeff8, sharpen8);\n  }\n\n  // out = (coeff * iQ + B) >> QFIX\n  {\n    // doing calculations with 32b precision (QFIX=17)\n    // out = (coeff * iQ)\n    const __m128i coeff_iQ0H = _mm_mulhi_epu16(coeff0, iq0);\n    const __m128i coeff_iQ0L = _mm_mullo_epi16(coeff0, iq0);\n    const __m128i coeff_iQ8H = _mm_mulhi_epu16(coeff8, iq8);\n    const __m128i coeff_iQ8L = _mm_mullo_epi16(coeff8, iq8);\n    __m128i out_00 = _mm_unpacklo_epi16(coeff_iQ0L, coeff_iQ0H);\n    __m128i out_04 = _mm_unpackhi_epi16(coeff_iQ0L, coeff_iQ0H);\n    __m128i out_08 = _mm_unpacklo_epi16(coeff_iQ8L, coeff_iQ8H);\n    __m128i out_12 = _mm_unpackhi_epi16(coeff_iQ8L, coeff_iQ8H);\n    // out = (coeff * iQ + B)\n    const __m128i bias_00 = _mm_loadu_si128((__m128i*)&mtx->bias_[0]);\n    const __m128i bias_04 = _mm_loadu_si128((__m128i*)&mtx->bias_[4]);\n    const __m128i bias_08 = _mm_loadu_si128((__m128i*)&mtx->bias_[8]);\n    const __m128i bias_12 = _mm_loadu_si128((__m128i*)&mtx->bias_[12]);\n    out_00 = _mm_add_epi32(out_00, bias_00);\n    out_04 = _mm_add_epi32(out_04, bias_04);\n    out_08 = _mm_add_epi32(out_08, bias_08);\n    out_12 = _mm_add_epi32(out_12, bias_12);\n    // out = QUANTDIV(coeff, iQ, B, QFIX)\n    out_00 = _mm_srai_epi32(out_00, QFIX);\n    out_04 = _mm_srai_epi32(out_04, QFIX);\n    out_08 = _mm_srai_epi32(out_08, QFIX);\n    out_12 = _mm_srai_epi32(out_12, QFIX);\n\n    // pack result as 16b\n    out0 = _mm_packs_epi32(out_00, out_04);\n    out8 = _mm_packs_epi32(out_08, out_12);\n\n    // if (coeff > 2047) coeff = 2047\n    out0 = _mm_min_epi16(out0, max_coeff_2047);\n    out8 = _mm_min_epi16(out8, max_coeff_2047);\n  }\n\n  // get sign back (if (sign[j]) out_n = -out_n)\n  out0 = _mm_xor_si128(out0, sign0);\n  out8 = _mm_xor_si128(out8, sign8);\n  out0 = _mm_sub_epi16(out0, sign0);\n  out8 = _mm_sub_epi16(out8, sign8);\n\n  // in = out * Q\n  in0 = _mm_mullo_epi16(out0, q0);\n  in8 = _mm_mullo_epi16(out8, q8);\n\n  _mm_storeu_si128((__m128i*)&in[0], in0);\n  _mm_storeu_si128((__m128i*)&in[8], in8);\n\n  // zigzag the output before storing it.\n  //\n  // The zigzag pattern can almost be reproduced with a small sequence of\n  // shuffles. After it, we only need to swap the 7th (ending up in third\n  // position instead of twelfth) and 8th values.\n  {\n    __m128i outZ0, outZ8;\n    outZ0 = _mm_shufflehi_epi16(out0,  _MM_SHUFFLE(2, 1, 3, 0));\n    outZ0 = _mm_shuffle_epi32  (outZ0, _MM_SHUFFLE(3, 1, 2, 0));\n    outZ0 = _mm_shufflehi_epi16(outZ0, _MM_SHUFFLE(3, 1, 0, 2));\n    outZ8 = _mm_shufflelo_epi16(out8,  _MM_SHUFFLE(3, 0, 2, 1));\n    outZ8 = _mm_shuffle_epi32  (outZ8, _MM_SHUFFLE(3, 1, 2, 0));\n    outZ8 = _mm_shufflelo_epi16(outZ8, _MM_SHUFFLE(1, 3, 2, 0));\n    _mm_storeu_si128((__m128i*)&out[0], outZ0);\n    _mm_storeu_si128((__m128i*)&out[8], outZ8);\n    packed_out = _mm_packs_epi16(outZ0, outZ8);\n  }\n  {\n    const int16_t outZ_12 = out[12];\n    const int16_t outZ_3 = out[3];\n    out[3] = outZ_12;\n    out[12] = outZ_3;\n  }\n\n  // detect if all 'out' values are zeroes or not\n  return (_mm_movemask_epi8(_mm_cmpeq_epi8(packed_out, zero)) != 0xffff);\n}\n\nstatic int QuantizeBlock(int16_t in[16], int16_t out[16],\n                         const VP8Matrix* const mtx) {\n  return DoQuantizeBlock(in, out, &mtx->sharpen_[0], mtx);\n}\n\nstatic int QuantizeBlockWHT(int16_t in[16], int16_t out[16],\n                            const VP8Matrix* const mtx) {\n  return DoQuantizeBlock(in, out, NULL, mtx);\n}\n\n// Forward declaration.\nvoid VP8SetResidualCoeffsSSE2(const int16_t* const coeffs,\n                              VP8Residual* const res);\n\nvoid VP8SetResidualCoeffsSSE2(const int16_t* const coeffs,\n                              VP8Residual* const res) {\n  const __m128i c0 = _mm_loadu_si128((const __m128i*)coeffs);\n  const __m128i c1 = _mm_loadu_si128((const __m128i*)(coeffs + 8));\n  // Use SSE to compare 8 values with a single instruction.\n  const __m128i zero = _mm_setzero_si128();\n  const __m128i m0 = _mm_cmpeq_epi16(c0, zero);\n  const __m128i m1 = _mm_cmpeq_epi16(c1, zero);\n  // Get the comparison results as a bitmask, consisting of two times 16 bits:\n  // two identical bits for each result. Concatenate both bitmasks to get a\n  // single 32 bit value. Negate the mask to get the position of entries that\n  // are not equal to zero. We don't need to mask out least significant bits\n  // according to res->first, since coeffs[0] is 0 if res->first > 0\n  const uint32_t mask =\n      ~(((uint32_t)_mm_movemask_epi8(m1) << 16) | _mm_movemask_epi8(m0));\n  // The position of the most significant non-zero bit indicates the position of\n  // the last non-zero value. Divide the result by two because __movemask_epi8\n  // operates on 8 bit values instead of 16 bit values.\n  assert(res->first == 0 || coeffs[0] == 0);\n  res->last = mask ? (BitsLog2Floor(mask) >> 1) : -1;\n  res->coeffs = coeffs;\n}\n\n#endif   // WEBP_USE_SSE2\n\n//------------------------------------------------------------------------------\n// Entry point\n\nextern void VP8EncDspInitSSE2(void);\n\nvoid VP8EncDspInitSSE2(void) {\n#if defined(WEBP_USE_SSE2)\n  VP8CollectHistogram = CollectHistogram;\n  VP8EncQuantizeBlock = QuantizeBlock;\n  VP8EncQuantizeBlockWHT = QuantizeBlockWHT;\n  VP8ITransform = ITransform;\n  VP8FTransform = FTransform;\n  VP8FTransformWHT = FTransformWHT;\n  VP8SSE16x16 = SSE16x16;\n  VP8SSE16x8 = SSE16x8;\n  VP8SSE8x8 = SSE8x8;\n  VP8SSE4x4 = SSE4x4;\n  VP8TDisto4x4 = Disto4x4;\n  VP8TDisto16x16 = Disto16x16;\n#endif   // WEBP_USE_SSE2\n}\n\n"
  },
  {
    "path": "ext/libwebp/dsp/lossless.c",
    "content": "// Copyright 2012 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Image transforms and color space conversion methods for lossless decoder.\n//\n// Authors: Vikas Arora (vikaas.arora@gmail.com)\n//          Jyrki Alakuijala (jyrki@google.com)\n//          Urvang Joshi (urvang@google.com)\n\n#include \"./dsp.h\"\n\n#include <math.h>\n#include <stdlib.h>\n#include \"../dec/vp8li.h\"\n#include \"../utils/endian_inl.h\"\n#include \"./lossless.h\"\n#include \"./yuv.h\"\n\n#define MAX_DIFF_COST (1e30f)\n\n// lookup table for small values of log2(int)\nconst float kLog2Table[LOG_LOOKUP_IDX_MAX] = {\n  0.0000000000000000f, 0.0000000000000000f,\n  1.0000000000000000f, 1.5849625007211560f,\n  2.0000000000000000f, 2.3219280948873621f,\n  2.5849625007211560f, 2.8073549220576041f,\n  3.0000000000000000f, 3.1699250014423121f,\n  3.3219280948873621f, 3.4594316186372973f,\n  3.5849625007211560f, 3.7004397181410921f,\n  3.8073549220576041f, 3.9068905956085187f,\n  4.0000000000000000f, 4.0874628412503390f,\n  4.1699250014423121f, 4.2479275134435852f,\n  4.3219280948873626f, 4.3923174227787606f,\n  4.4594316186372973f, 4.5235619560570130f,\n  4.5849625007211560f, 4.6438561897747243f,\n  4.7004397181410917f, 4.7548875021634682f,\n  4.8073549220576037f, 4.8579809951275718f,\n  4.9068905956085187f, 4.9541963103868749f,\n  5.0000000000000000f, 5.0443941193584533f,\n  5.0874628412503390f, 5.1292830169449663f,\n  5.1699250014423121f, 5.2094533656289501f,\n  5.2479275134435852f, 5.2854022188622487f,\n  5.3219280948873626f, 5.3575520046180837f,\n  5.3923174227787606f, 5.4262647547020979f,\n  5.4594316186372973f, 5.4918530963296747f,\n  5.5235619560570130f, 5.5545888516776376f,\n  5.5849625007211560f, 5.6147098441152083f,\n  5.6438561897747243f, 5.6724253419714951f,\n  5.7004397181410917f, 5.7279204545631987f,\n  5.7548875021634682f, 5.7813597135246599f,\n  5.8073549220576037f, 5.8328900141647412f,\n  5.8579809951275718f, 5.8826430493618415f,\n  5.9068905956085187f, 5.9307373375628866f,\n  5.9541963103868749f, 5.9772799234999167f,\n  6.0000000000000000f, 6.0223678130284543f,\n  6.0443941193584533f, 6.0660891904577720f,\n  6.0874628412503390f, 6.1085244567781691f,\n  6.1292830169449663f, 6.1497471195046822f,\n  6.1699250014423121f, 6.1898245588800175f,\n  6.2094533656289501f, 6.2288186904958804f,\n  6.2479275134435852f, 6.2667865406949010f,\n  6.2854022188622487f, 6.3037807481771030f,\n  6.3219280948873626f, 6.3398500028846243f,\n  6.3575520046180837f, 6.3750394313469245f,\n  6.3923174227787606f, 6.4093909361377017f,\n  6.4262647547020979f, 6.4429434958487279f,\n  6.4594316186372973f, 6.4757334309663976f,\n  6.4918530963296747f, 6.5077946401986963f,\n  6.5235619560570130f, 6.5391588111080309f,\n  6.5545888516776376f, 6.5698556083309478f,\n  6.5849625007211560f, 6.5999128421871278f,\n  6.6147098441152083f, 6.6293566200796094f,\n  6.6438561897747243f, 6.6582114827517946f,\n  6.6724253419714951f, 6.6865005271832185f,\n  6.7004397181410917f, 6.7142455176661224f,\n  6.7279204545631987f, 6.7414669864011464f,\n  6.7548875021634682f, 6.7681843247769259f,\n  6.7813597135246599f, 6.7944158663501061f,\n  6.8073549220576037f, 6.8201789624151878f,\n  6.8328900141647412f, 6.8454900509443747f,\n  6.8579809951275718f, 6.8703647195834047f,\n  6.8826430493618415f, 6.8948177633079437f,\n  6.9068905956085187f, 6.9188632372745946f,\n  6.9307373375628866f, 6.9425145053392398f,\n  6.9541963103868749f, 6.9657842846620869f,\n  6.9772799234999167f, 6.9886846867721654f,\n  7.0000000000000000f, 7.0112272554232539f,\n  7.0223678130284543f, 7.0334230015374501f,\n  7.0443941193584533f, 7.0552824355011898f,\n  7.0660891904577720f, 7.0768155970508308f,\n  7.0874628412503390f, 7.0980320829605263f,\n  7.1085244567781691f, 7.1189410727235076f,\n  7.1292830169449663f, 7.1395513523987936f,\n  7.1497471195046822f, 7.1598713367783890f,\n  7.1699250014423121f, 7.1799090900149344f,\n  7.1898245588800175f, 7.1996723448363644f,\n  7.2094533656289501f, 7.2191685204621611f,\n  7.2288186904958804f, 7.2384047393250785f,\n  7.2479275134435852f, 7.2573878426926521f,\n  7.2667865406949010f, 7.2761244052742375f,\n  7.2854022188622487f, 7.2946207488916270f,\n  7.3037807481771030f, 7.3128829552843557f,\n  7.3219280948873626f, 7.3309168781146167f,\n  7.3398500028846243f, 7.3487281542310771f,\n  7.3575520046180837f, 7.3663222142458160f,\n  7.3750394313469245f, 7.3837042924740519f,\n  7.3923174227787606f, 7.4008794362821843f,\n  7.4093909361377017f, 7.4178525148858982f,\n  7.4262647547020979f, 7.4346282276367245f,\n  7.4429434958487279f, 7.4512111118323289f,\n  7.4594316186372973f, 7.4676055500829976f,\n  7.4757334309663976f, 7.4838157772642563f,\n  7.4918530963296747f, 7.4998458870832056f,\n  7.5077946401986963f, 7.5156998382840427f,\n  7.5235619560570130f, 7.5313814605163118f,\n  7.5391588111080309f, 7.5468944598876364f,\n  7.5545888516776376f, 7.5622424242210728f,\n  7.5698556083309478f, 7.5774288280357486f,\n  7.5849625007211560f, 7.5924570372680806f,\n  7.5999128421871278f, 7.6073303137496104f,\n  7.6147098441152083f, 7.6220518194563764f,\n  7.6293566200796094f, 7.6366246205436487f,\n  7.6438561897747243f, 7.6510516911789281f,\n  7.6582114827517946f, 7.6653359171851764f,\n  7.6724253419714951f, 7.6794800995054464f,\n  7.6865005271832185f, 7.6934869574993252f,\n  7.7004397181410917f, 7.7073591320808825f,\n  7.7142455176661224f, 7.7210991887071855f,\n  7.7279204545631987f, 7.7347096202258383f,\n  7.7414669864011464f, 7.7481928495894605f,\n  7.7548875021634682f, 7.7615512324444795f,\n  7.7681843247769259f, 7.7747870596011736f,\n  7.7813597135246599f, 7.7879025593914317f,\n  7.7944158663501061f, 7.8008998999203047f,\n  7.8073549220576037f, 7.8137811912170374f,\n  7.8201789624151878f, 7.8265484872909150f,\n  7.8328900141647412f, 7.8392037880969436f,\n  7.8454900509443747f, 7.8517490414160571f,\n  7.8579809951275718f, 7.8641861446542797f,\n  7.8703647195834047f, 7.8765169465649993f,\n  7.8826430493618415f, 7.8887432488982591f,\n  7.8948177633079437f, 7.9008668079807486f,\n  7.9068905956085187f, 7.9128893362299619f,\n  7.9188632372745946f, 7.9248125036057812f,\n  7.9307373375628866f, 7.9366379390025709f,\n  7.9425145053392398f, 7.9483672315846778f,\n  7.9541963103868749f, 7.9600019320680805f,\n  7.9657842846620869f, 7.9715435539507719f,\n  7.9772799234999167f, 7.9829935746943103f,\n  7.9886846867721654f, 7.9943534368588577f\n};\n\nconst float kSLog2Table[LOG_LOOKUP_IDX_MAX] = {\n  0.00000000f,    0.00000000f,  2.00000000f,   4.75488750f,\n  8.00000000f,   11.60964047f,  15.50977500f,  19.65148445f,\n  24.00000000f,  28.52932501f,  33.21928095f,  38.05374781f,\n  43.01955001f,  48.10571634f,  53.30296891f,  58.60335893f,\n  64.00000000f,  69.48686830f,  75.05865003f,  80.71062276f,\n  86.43856190f,  92.23866588f,  98.10749561f,  104.04192499f,\n  110.03910002f, 116.09640474f, 122.21143267f, 128.38196256f,\n  134.60593782f, 140.88144886f, 147.20671787f, 153.58008562f,\n  160.00000000f, 166.46500594f, 172.97373660f, 179.52490559f,\n  186.11730005f, 192.74977453f, 199.42124551f, 206.13068654f,\n  212.87712380f, 219.65963219f, 226.47733176f, 233.32938445f,\n  240.21499122f, 247.13338933f, 254.08384998f, 261.06567603f,\n  268.07820003f, 275.12078236f, 282.19280949f, 289.29369244f,\n  296.42286534f, 303.57978409f, 310.76392512f, 317.97478424f,\n  325.21187564f, 332.47473081f, 339.76289772f, 347.07593991f,\n  354.41343574f, 361.77497759f, 369.16017124f, 376.56863518f,\n  384.00000000f, 391.45390785f, 398.93001188f, 406.42797576f,\n  413.94747321f, 421.48818752f, 429.04981119f, 436.63204548f,\n  444.23460010f, 451.85719280f, 459.49954906f, 467.16140179f,\n  474.84249102f, 482.54256363f, 490.26137307f, 497.99867911f,\n  505.75424759f, 513.52785023f, 521.31926438f, 529.12827280f,\n  536.95466351f, 544.79822957f, 552.65876890f, 560.53608414f,\n  568.42998244f, 576.34027536f, 584.26677867f, 592.20931226f,\n  600.16769996f, 608.14176943f, 616.13135206f, 624.13628279f,\n  632.15640007f, 640.19154569f, 648.24156472f, 656.30630539f,\n  664.38561898f, 672.47935976f, 680.58738488f, 688.70955430f,\n  696.84573069f, 704.99577935f, 713.15956818f, 721.33696754f,\n  729.52785023f, 737.73209140f, 745.94956849f, 754.18016116f,\n  762.42375127f, 770.68022275f, 778.94946161f, 787.23135586f,\n  795.52579543f, 803.83267219f, 812.15187982f, 820.48331383f,\n  828.82687147f, 837.18245171f, 845.54995518f, 853.92928416f,\n  862.32034249f, 870.72303558f, 879.13727036f, 887.56295522f,\n  896.00000000f, 904.44831595f, 912.90781569f, 921.37841320f,\n  929.86002376f, 938.35256392f, 946.85595152f, 955.37010560f,\n  963.89494641f, 972.43039537f, 980.97637504f, 989.53280911f,\n  998.09962237f, 1006.67674069f, 1015.26409097f, 1023.86160116f,\n  1032.46920021f, 1041.08681805f, 1049.71438560f, 1058.35183469f,\n  1066.99909811f, 1075.65610955f, 1084.32280357f, 1092.99911564f,\n  1101.68498204f, 1110.38033993f, 1119.08512727f, 1127.79928282f,\n  1136.52274614f, 1145.25545758f, 1153.99735821f, 1162.74838989f,\n  1171.50849518f, 1180.27761738f, 1189.05570047f, 1197.84268914f,\n  1206.63852876f, 1215.44316535f, 1224.25654560f, 1233.07861684f,\n  1241.90932703f, 1250.74862473f, 1259.59645914f, 1268.45278005f,\n  1277.31753781f, 1286.19068338f, 1295.07216828f, 1303.96194457f,\n  1312.85996488f, 1321.76618236f, 1330.68055071f, 1339.60302413f,\n  1348.53355734f, 1357.47210556f, 1366.41862452f, 1375.37307041f,\n  1384.33539991f, 1393.30557020f, 1402.28353887f, 1411.26926400f,\n  1420.26270412f, 1429.26381818f, 1438.27256558f, 1447.28890615f,\n  1456.31280014f, 1465.34420819f, 1474.38309138f, 1483.42941118f,\n  1492.48312945f, 1501.54420843f, 1510.61261078f, 1519.68829949f,\n  1528.77123795f, 1537.86138993f, 1546.95871952f, 1556.06319119f,\n  1565.17476976f, 1574.29342040f, 1583.41910860f, 1592.55180020f,\n  1601.69146137f, 1610.83805860f, 1619.99155871f, 1629.15192882f,\n  1638.31913637f, 1647.49314911f, 1656.67393509f, 1665.86146266f,\n  1675.05570047f, 1684.25661744f, 1693.46418280f, 1702.67836605f,\n  1711.89913698f, 1721.12646563f, 1730.36032233f, 1739.60067768f,\n  1748.84750254f, 1758.10076802f, 1767.36044551f, 1776.62650662f,\n  1785.89892323f, 1795.17766747f, 1804.46271172f, 1813.75402857f,\n  1823.05159087f, 1832.35537170f, 1841.66534438f, 1850.98148244f,\n  1860.30375965f, 1869.63214999f, 1878.96662767f, 1888.30716711f,\n  1897.65374295f, 1907.00633003f, 1916.36490342f, 1925.72943838f,\n  1935.09991037f, 1944.47629506f, 1953.85856831f, 1963.24670620f,\n  1972.64068498f, 1982.04048108f, 1991.44607117f, 2000.85743204f,\n  2010.27454072f, 2019.69737440f, 2029.12591044f, 2038.56012640f\n};\n\nconst VP8LPrefixCode kPrefixEncodeCode[PREFIX_LOOKUP_IDX_MAX] = {\n  { 0, 0}, { 0, 0}, { 1, 0}, { 2, 0}, { 3, 0}, { 4, 1}, { 4, 1}, { 5, 1},\n  { 5, 1}, { 6, 2}, { 6, 2}, { 6, 2}, { 6, 2}, { 7, 2}, { 7, 2}, { 7, 2},\n  { 7, 2}, { 8, 3}, { 8, 3}, { 8, 3}, { 8, 3}, { 8, 3}, { 8, 3}, { 8, 3},\n  { 8, 3}, { 9, 3}, { 9, 3}, { 9, 3}, { 9, 3}, { 9, 3}, { 9, 3}, { 9, 3},\n  { 9, 3}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4},\n  {10, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4},\n  {10, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4},\n  {11, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4}, {11, 4},\n  {11, 4}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5},\n  {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5},\n  {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5},\n  {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5},\n  {12, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5},\n  {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5},\n  {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5},\n  {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5}, {13, 5},\n  {13, 5}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6},\n  {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6},\n  {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6},\n  {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6},\n  {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6},\n  {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6},\n  {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6},\n  {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6}, {14, 6},\n  {14, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6},\n  {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6},\n  {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6},\n  {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6},\n  {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6},\n  {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6},\n  {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6},\n  {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6}, {15, 6},\n  {15, 6}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7},\n  {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7},\n  {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7},\n  {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7},\n  {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7},\n  {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7},\n  {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7},\n  {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7},\n  {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7},\n  {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7},\n  {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7},\n  {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7},\n  {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7},\n  {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7},\n  {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7},\n  {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7}, {16, 7},\n  {16, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7},\n  {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7},\n  {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7},\n  {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7},\n  {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7},\n  {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7},\n  {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7},\n  {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7},\n  {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7},\n  {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7},\n  {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7},\n  {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7},\n  {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7},\n  {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7},\n  {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7},\n  {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7},\n};\n\nconst uint8_t kPrefixEncodeExtraBitsValue[PREFIX_LOOKUP_IDX_MAX] = {\n   0,  0,  0,  0,  0,  0,  1,  0,  1,  0,  1,  2,  3,  0,  1,  2,  3,\n   0,  1,  2,  3,  4,  5,  6,  7,  0,  1,  2,  3,  4,  5,  6,  7,\n   0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,\n   0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,\n   0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,\n  16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,\n   0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,\n  16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,\n   0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,\n  16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,\n  32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,\n  48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,\n   0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,\n  16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,\n  32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,\n  48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,\n   0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,\n  16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,\n  32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,\n  48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,\n  64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,\n  80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,\n  96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,\n  112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126,\n  127,\n   0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,\n  16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,\n  32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,\n  48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,\n  64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,\n  80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,\n  96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,\n  112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126\n};\n\n// The threshold till approximate version of log_2 can be used.\n// Practically, we can get rid of the call to log() as the two values match to\n// very high degree (the ratio of these two is 0.99999x).\n// Keeping a high threshold for now.\n#define APPROX_LOG_WITH_CORRECTION_MAX  65536\n#define APPROX_LOG_MAX                   4096\n#define LOG_2_RECIPROCAL 1.44269504088896338700465094007086\nstatic float FastSLog2Slow(uint32_t v) {\n  assert(v >= LOG_LOOKUP_IDX_MAX);\n  if (v < APPROX_LOG_WITH_CORRECTION_MAX) {\n    int log_cnt = 0;\n    uint32_t y = 1;\n    int correction = 0;\n    const float v_f = (float)v;\n    const uint32_t orig_v = v;\n    do {\n      ++log_cnt;\n      v = v >> 1;\n      y = y << 1;\n    } while (v >= LOG_LOOKUP_IDX_MAX);\n    // vf = (2^log_cnt) * Xf; where y = 2^log_cnt and Xf < 256\n    // Xf = floor(Xf) * (1 + (v % y) / v)\n    // log2(Xf) = log2(floor(Xf)) + log2(1 + (v % y) / v)\n    // The correction factor: log(1 + d) ~ d; for very small d values, so\n    // log2(1 + (v % y) / v) ~ LOG_2_RECIPROCAL * (v % y)/v\n    // LOG_2_RECIPROCAL ~ 23/16\n    correction = (23 * (orig_v & (y - 1))) >> 4;\n    return v_f * (kLog2Table[v] + log_cnt) + correction;\n  } else {\n    return (float)(LOG_2_RECIPROCAL * v * log((double)v));\n  }\n}\n\nstatic float FastLog2Slow(uint32_t v) {\n  assert(v >= LOG_LOOKUP_IDX_MAX);\n  if (v < APPROX_LOG_WITH_CORRECTION_MAX) {\n    int log_cnt = 0;\n    uint32_t y = 1;\n    const uint32_t orig_v = v;\n    double log_2;\n    do {\n      ++log_cnt;\n      v = v >> 1;\n      y = y << 1;\n    } while (v >= LOG_LOOKUP_IDX_MAX);\n    log_2 = kLog2Table[v] + log_cnt;\n    if (orig_v >= APPROX_LOG_MAX) {\n      // Since the division is still expensive, add this correction factor only\n      // for large values of 'v'.\n      const int correction = (23 * (orig_v & (y - 1))) >> 4;\n      log_2 += (double)correction / orig_v;\n    }\n    return (float)log_2;\n  } else {\n    return (float)(LOG_2_RECIPROCAL * log((double)v));\n  }\n}\n\n//------------------------------------------------------------------------------\n// Image transforms.\n\n// Mostly used to reduce code size + readability\nstatic WEBP_INLINE int GetMin(int a, int b) { return (a > b) ? b : a; }\n\n// In-place sum of each component with mod 256.\nstatic WEBP_INLINE void AddPixelsEq(uint32_t* a, uint32_t b) {\n  const uint32_t alpha_and_green = (*a & 0xff00ff00u) + (b & 0xff00ff00u);\n  const uint32_t red_and_blue = (*a & 0x00ff00ffu) + (b & 0x00ff00ffu);\n  *a = (alpha_and_green & 0xff00ff00u) | (red_and_blue & 0x00ff00ffu);\n}\n\nstatic WEBP_INLINE uint32_t Average2(uint32_t a0, uint32_t a1) {\n  return (((a0 ^ a1) & 0xfefefefeL) >> 1) + (a0 & a1);\n}\n\nstatic WEBP_INLINE uint32_t Average3(uint32_t a0, uint32_t a1, uint32_t a2) {\n  return Average2(Average2(a0, a2), a1);\n}\n\nstatic WEBP_INLINE uint32_t Average4(uint32_t a0, uint32_t a1,\n                                     uint32_t a2, uint32_t a3) {\n  return Average2(Average2(a0, a1), Average2(a2, a3));\n}\n\nstatic WEBP_INLINE uint32_t Clip255(uint32_t a) {\n  if (a < 256) {\n    return a;\n  }\n  // return 0, when a is a negative integer.\n  // return 255, when a is positive.\n  return ~a >> 24;\n}\n\nstatic WEBP_INLINE int AddSubtractComponentFull(int a, int b, int c) {\n  return Clip255(a + b - c);\n}\n\nstatic WEBP_INLINE uint32_t ClampedAddSubtractFull(uint32_t c0, uint32_t c1,\n                                                   uint32_t c2) {\n  const int a = AddSubtractComponentFull(c0 >> 24, c1 >> 24, c2 >> 24);\n  const int r = AddSubtractComponentFull((c0 >> 16) & 0xff,\n                                         (c1 >> 16) & 0xff,\n                                         (c2 >> 16) & 0xff);\n  const int g = AddSubtractComponentFull((c0 >> 8) & 0xff,\n                                         (c1 >> 8) & 0xff,\n                                         (c2 >> 8) & 0xff);\n  const int b = AddSubtractComponentFull(c0 & 0xff, c1 & 0xff, c2 & 0xff);\n  return ((uint32_t)a << 24) | (r << 16) | (g << 8) | b;\n}\n\nstatic WEBP_INLINE int AddSubtractComponentHalf(int a, int b) {\n  return Clip255(a + (a - b) / 2);\n}\n\nstatic WEBP_INLINE uint32_t ClampedAddSubtractHalf(uint32_t c0, uint32_t c1,\n                                                   uint32_t c2) {\n  const uint32_t ave = Average2(c0, c1);\n  const int a = AddSubtractComponentHalf(ave >> 24, c2 >> 24);\n  const int r = AddSubtractComponentHalf((ave >> 16) & 0xff, (c2 >> 16) & 0xff);\n  const int g = AddSubtractComponentHalf((ave >> 8) & 0xff, (c2 >> 8) & 0xff);\n  const int b = AddSubtractComponentHalf((ave >> 0) & 0xff, (c2 >> 0) & 0xff);\n  return ((uint32_t)a << 24) | (r << 16) | (g << 8) | b;\n}\n\n// gcc-4.9 on ARM generates incorrect code in Select() when Sub3() is inlined.\n#if defined(__arm__) && LOCAL_GCC_VERSION == 0x409\n# define LOCAL_INLINE __attribute__ ((noinline))\n#else\n# define LOCAL_INLINE WEBP_INLINE\n#endif\n\nstatic LOCAL_INLINE int Sub3(int a, int b, int c) {\n  const int pb = b - c;\n  const int pa = a - c;\n  return abs(pb) - abs(pa);\n}\n\n#undef LOCAL_INLINE\n\nstatic WEBP_INLINE uint32_t Select(uint32_t a, uint32_t b, uint32_t c) {\n  const int pa_minus_pb =\n      Sub3((a >> 24)       , (b >> 24)       , (c >> 24)       ) +\n      Sub3((a >> 16) & 0xff, (b >> 16) & 0xff, (c >> 16) & 0xff) +\n      Sub3((a >>  8) & 0xff, (b >>  8) & 0xff, (c >>  8) & 0xff) +\n      Sub3((a      ) & 0xff, (b      ) & 0xff, (c      ) & 0xff);\n  return (pa_minus_pb <= 0) ? a : b;\n}\n\n//------------------------------------------------------------------------------\n// Predictors\n\nstatic uint32_t Predictor0(uint32_t left, const uint32_t* const top) {\n  (void)top;\n  (void)left;\n  return ARGB_BLACK;\n}\nstatic uint32_t Predictor1(uint32_t left, const uint32_t* const top) {\n  (void)top;\n  return left;\n}\nstatic uint32_t Predictor2(uint32_t left, const uint32_t* const top) {\n  (void)left;\n  return top[0];\n}\nstatic uint32_t Predictor3(uint32_t left, const uint32_t* const top) {\n  (void)left;\n  return top[1];\n}\nstatic uint32_t Predictor4(uint32_t left, const uint32_t* const top) {\n  (void)left;\n  return top[-1];\n}\nstatic uint32_t Predictor5(uint32_t left, const uint32_t* const top) {\n  const uint32_t pred = Average3(left, top[0], top[1]);\n  return pred;\n}\nstatic uint32_t Predictor6(uint32_t left, const uint32_t* const top) {\n  const uint32_t pred = Average2(left, top[-1]);\n  return pred;\n}\nstatic uint32_t Predictor7(uint32_t left, const uint32_t* const top) {\n  const uint32_t pred = Average2(left, top[0]);\n  return pred;\n}\nstatic uint32_t Predictor8(uint32_t left, const uint32_t* const top) {\n  const uint32_t pred = Average2(top[-1], top[0]);\n  (void)left;\n  return pred;\n}\nstatic uint32_t Predictor9(uint32_t left, const uint32_t* const top) {\n  const uint32_t pred = Average2(top[0], top[1]);\n  (void)left;\n  return pred;\n}\nstatic uint32_t Predictor10(uint32_t left, const uint32_t* const top) {\n  const uint32_t pred = Average4(left, top[-1], top[0], top[1]);\n  return pred;\n}\nstatic uint32_t Predictor11(uint32_t left, const uint32_t* const top) {\n  const uint32_t pred = Select(top[0], left, top[-1]);\n  return pred;\n}\nstatic uint32_t Predictor12(uint32_t left, const uint32_t* const top) {\n  const uint32_t pred = ClampedAddSubtractFull(left, top[0], top[-1]);\n  return pred;\n}\nstatic uint32_t Predictor13(uint32_t left, const uint32_t* const top) {\n  const uint32_t pred = ClampedAddSubtractHalf(left, top[0], top[-1]);\n  return pred;\n}\n\nstatic const VP8LPredictorFunc kPredictorsC[16] = {\n  Predictor0, Predictor1, Predictor2, Predictor3,\n  Predictor4, Predictor5, Predictor6, Predictor7,\n  Predictor8, Predictor9, Predictor10, Predictor11,\n  Predictor12, Predictor13,\n  Predictor0, Predictor0    // <- padding security sentinels\n};\n\nstatic float PredictionCostSpatial(const int counts[256], int weight_0,\n                                   double exp_val) {\n  const int significant_symbols = 256 >> 4;\n  const double exp_decay_factor = 0.6;\n  double bits = weight_0 * counts[0];\n  int i;\n  for (i = 1; i < significant_symbols; ++i) {\n    bits += exp_val * (counts[i] + counts[256 - i]);\n    exp_val *= exp_decay_factor;\n  }\n  return (float)(-0.1 * bits);\n}\n\n// Compute the combined Shanon's entropy for distribution {X} and {X+Y}\nstatic float CombinedShannonEntropy(const int X[256], const int Y[256]) {\n  int i;\n  double retval = 0.;\n  int sumX = 0, sumXY = 0;\n  for (i = 0; i < 256; ++i) {\n    const int x = X[i];\n    const int xy = x + Y[i];\n    if (x != 0) {\n      sumX += x;\n      retval -= VP8LFastSLog2(x);\n      sumXY += xy;\n      retval -= VP8LFastSLog2(xy);\n    } else if (xy != 0) {\n      sumXY += xy;\n      retval -= VP8LFastSLog2(xy);\n    }\n  }\n  retval += VP8LFastSLog2(sumX) + VP8LFastSLog2(sumXY);\n  return (float)retval;\n}\n\nstatic float PredictionCostSpatialHistogram(const int accumulated[4][256],\n                                            const int tile[4][256]) {\n  int i;\n  double retval = 0;\n  for (i = 0; i < 4; ++i) {\n    const double kExpValue = 0.94;\n    retval += PredictionCostSpatial(tile[i], 1, kExpValue);\n    retval += CombinedShannonEntropy(tile[i], accumulated[i]);\n  }\n  return (float)retval;\n}\n\nstatic WEBP_INLINE void UpdateHisto(int histo_argb[4][256], uint32_t argb) {\n  ++histo_argb[0][argb >> 24];\n  ++histo_argb[1][(argb >> 16) & 0xff];\n  ++histo_argb[2][(argb >> 8) & 0xff];\n  ++histo_argb[3][argb & 0xff];\n}\n\nstatic int GetBestPredictorForTile(int width, int height,\n                                   int tile_x, int tile_y, int bits,\n                                   const int accumulated[4][256],\n                                   const uint32_t* const argb_scratch) {\n  const int kNumPredModes = 14;\n  const int col_start = tile_x << bits;\n  const int row_start = tile_y << bits;\n  const int tile_size = 1 << bits;\n  const int max_y = GetMin(tile_size, height - row_start);\n  const int max_x = GetMin(tile_size, width - col_start);\n  float best_diff = MAX_DIFF_COST;\n  int best_mode = 0;\n  int mode;\n  for (mode = 0; mode < kNumPredModes; ++mode) {\n    const uint32_t* current_row = argb_scratch;\n    const VP8LPredictorFunc pred_func = VP8LPredictors[mode];\n    float cur_diff;\n    int y;\n    int histo_argb[4][256];\n    memset(histo_argb, 0, sizeof(histo_argb));\n    for (y = 0; y < max_y; ++y) {\n      int x;\n      const int row = row_start + y;\n      const uint32_t* const upper_row = current_row;\n      current_row = upper_row + width;\n      for (x = 0; x < max_x; ++x) {\n        const int col = col_start + x;\n        uint32_t predict;\n        if (row == 0) {\n          predict = (col == 0) ? ARGB_BLACK : current_row[col - 1];  // Left.\n        } else if (col == 0) {\n          predict = upper_row[col];  // Top.\n        } else {\n          predict = pred_func(current_row[col - 1], upper_row + col);\n        }\n        UpdateHisto(histo_argb, VP8LSubPixels(current_row[col], predict));\n      }\n    }\n    cur_diff = PredictionCostSpatialHistogram(\n        accumulated, (const int (*)[256])histo_argb);\n    if (cur_diff < best_diff) {\n      best_diff = cur_diff;\n      best_mode = mode;\n    }\n  }\n\n  return best_mode;\n}\n\nstatic void CopyTileWithPrediction(int width, int height,\n                                   int tile_x, int tile_y, int bits, int mode,\n                                   const uint32_t* const argb_scratch,\n                                   uint32_t* const argb) {\n  const int col_start = tile_x << bits;\n  const int row_start = tile_y << bits;\n  const int tile_size = 1 << bits;\n  const int max_y = GetMin(tile_size, height - row_start);\n  const int max_x = GetMin(tile_size, width - col_start);\n  const VP8LPredictorFunc pred_func = VP8LPredictors[mode];\n  const uint32_t* current_row = argb_scratch;\n\n  int y;\n  for (y = 0; y < max_y; ++y) {\n    int x;\n    const int row = row_start + y;\n    const uint32_t* const upper_row = current_row;\n    current_row = upper_row + width;\n    for (x = 0; x < max_x; ++x) {\n      const int col = col_start + x;\n      const int pix = row * width + col;\n      uint32_t predict;\n      if (row == 0) {\n        predict = (col == 0) ? ARGB_BLACK : current_row[col - 1];  // Left.\n      } else if (col == 0) {\n        predict = upper_row[col];  // Top.\n      } else {\n        predict = pred_func(current_row[col - 1], upper_row + col);\n      }\n      argb[pix] = VP8LSubPixels(current_row[col], predict);\n    }\n  }\n}\n\nvoid VP8LResidualImage(int width, int height, int bits,\n                       uint32_t* const argb, uint32_t* const argb_scratch,\n                       uint32_t* const image) {\n  const int max_tile_size = 1 << bits;\n  const int tiles_per_row = VP8LSubSampleSize(width, bits);\n  const int tiles_per_col = VP8LSubSampleSize(height, bits);\n  uint32_t* const upper_row = argb_scratch;\n  uint32_t* const current_tile_rows = argb_scratch + width;\n  int tile_y;\n  int histo[4][256];\n  memset(histo, 0, sizeof(histo));\n  for (tile_y = 0; tile_y < tiles_per_col; ++tile_y) {\n    const int tile_y_offset = tile_y * max_tile_size;\n    const int this_tile_height =\n        (tile_y < tiles_per_col - 1) ? max_tile_size : height - tile_y_offset;\n    int tile_x;\n    if (tile_y > 0) {\n      memcpy(upper_row, current_tile_rows + (max_tile_size - 1) * width,\n             width * sizeof(*upper_row));\n    }\n    memcpy(current_tile_rows, &argb[tile_y_offset * width],\n           this_tile_height * width * sizeof(*current_tile_rows));\n    for (tile_x = 0; tile_x < tiles_per_row; ++tile_x) {\n      int pred;\n      int y;\n      const int tile_x_offset = tile_x * max_tile_size;\n      int all_x_max = tile_x_offset + max_tile_size;\n      if (all_x_max > width) {\n        all_x_max = width;\n      }\n      pred = GetBestPredictorForTile(width, height, tile_x, tile_y, bits,\n                                     (const int (*)[256])histo,\n                                     argb_scratch);\n      image[tile_y * tiles_per_row + tile_x] = 0xff000000u | (pred << 8);\n      CopyTileWithPrediction(width, height, tile_x, tile_y, bits, pred,\n                             argb_scratch, argb);\n      for (y = 0; y < max_tile_size; ++y) {\n        int ix;\n        int all_x;\n        int all_y = tile_y_offset + y;\n        if (all_y >= height) {\n          break;\n        }\n        ix = all_y * width + tile_x_offset;\n        for (all_x = tile_x_offset; all_x < all_x_max; ++all_x, ++ix) {\n          UpdateHisto(histo, argb[ix]);\n        }\n      }\n    }\n  }\n}\n\n// Inverse prediction.\nstatic void PredictorInverseTransform(const VP8LTransform* const transform,\n                                      int y_start, int y_end, uint32_t* data) {\n  const int width = transform->xsize_;\n  if (y_start == 0) {  // First Row follows the L (mode=1) mode.\n    int x;\n    const uint32_t pred0 = Predictor0(data[-1], NULL);\n    AddPixelsEq(data, pred0);\n    for (x = 1; x < width; ++x) {\n      const uint32_t pred1 = Predictor1(data[x - 1], NULL);\n      AddPixelsEq(data + x, pred1);\n    }\n    data += width;\n    ++y_start;\n  }\n\n  {\n    int y = y_start;\n    const int tile_width = 1 << transform->bits_;\n    const int mask = tile_width - 1;\n    const int safe_width = width & ~mask;\n    const int tiles_per_row = VP8LSubSampleSize(width, transform->bits_);\n    const uint32_t* pred_mode_base =\n        transform->data_ + (y >> transform->bits_) * tiles_per_row;\n\n    while (y < y_end) {\n      const uint32_t pred2 = Predictor2(data[-1], data - width);\n      const uint32_t* pred_mode_src = pred_mode_base;\n      VP8LPredictorFunc pred_func;\n      int x = 1;\n      int t = 1;\n      // First pixel follows the T (mode=2) mode.\n      AddPixelsEq(data, pred2);\n      // .. the rest:\n      while (x < safe_width) {\n        pred_func = VP8LPredictors[((*pred_mode_src++) >> 8) & 0xf];\n        for (; t < tile_width; ++t, ++x) {\n          const uint32_t pred = pred_func(data[x - 1], data + x - width);\n          AddPixelsEq(data + x, pred);\n        }\n        t = 0;\n      }\n      if (x < width) {\n        pred_func = VP8LPredictors[((*pred_mode_src++) >> 8) & 0xf];\n        for (; x < width; ++x) {\n          const uint32_t pred = pred_func(data[x - 1], data + x - width);\n          AddPixelsEq(data + x, pred);\n        }\n      }\n      data += width;\n      ++y;\n      if ((y & mask) == 0) {   // Use the same mask, since tiles are squares.\n        pred_mode_base += tiles_per_row;\n      }\n    }\n  }\n}\n\nvoid VP8LSubtractGreenFromBlueAndRed_C(uint32_t* argb_data, int num_pixels) {\n  int i;\n  for (i = 0; i < num_pixels; ++i) {\n    const uint32_t argb = argb_data[i];\n    const uint32_t green = (argb >> 8) & 0xff;\n    const uint32_t new_r = (((argb >> 16) & 0xff) - green) & 0xff;\n    const uint32_t new_b = ((argb & 0xff) - green) & 0xff;\n    argb_data[i] = (argb & 0xff00ff00) | (new_r << 16) | new_b;\n  }\n}\n\n// Add green to blue and red channels (i.e. perform the inverse transform of\n// 'subtract green').\nvoid VP8LAddGreenToBlueAndRed_C(uint32_t* data, int num_pixels) {\n  int i;\n  for (i = 0; i < num_pixels; ++i) {\n    const uint32_t argb = data[i];\n    const uint32_t green = ((argb >> 8) & 0xff);\n    uint32_t red_blue = (argb & 0x00ff00ffu);\n    red_blue += (green << 16) | green;\n    red_blue &= 0x00ff00ffu;\n    data[i] = (argb & 0xff00ff00u) | red_blue;\n  }\n}\n\nstatic WEBP_INLINE void MultipliersClear(VP8LMultipliers* const m) {\n  m->green_to_red_ = 0;\n  m->green_to_blue_ = 0;\n  m->red_to_blue_ = 0;\n}\n\nstatic WEBP_INLINE uint32_t ColorTransformDelta(int8_t color_pred,\n                                                int8_t color) {\n  return (uint32_t)((int)(color_pred) * color) >> 5;\n}\n\nstatic WEBP_INLINE void ColorCodeToMultipliers(uint32_t color_code,\n                                               VP8LMultipliers* const m) {\n  m->green_to_red_  = (color_code >>  0) & 0xff;\n  m->green_to_blue_ = (color_code >>  8) & 0xff;\n  m->red_to_blue_   = (color_code >> 16) & 0xff;\n}\n\nstatic WEBP_INLINE uint32_t MultipliersToColorCode(\n    const VP8LMultipliers* const m) {\n  return 0xff000000u |\n         ((uint32_t)(m->red_to_blue_) << 16) |\n         ((uint32_t)(m->green_to_blue_) << 8) |\n         m->green_to_red_;\n}\n\nvoid VP8LTransformColor_C(const VP8LMultipliers* const m, uint32_t* data,\n                          int num_pixels) {\n  int i;\n  for (i = 0; i < num_pixels; ++i) {\n    const uint32_t argb = data[i];\n    const uint32_t green = argb >> 8;\n    const uint32_t red = argb >> 16;\n    uint32_t new_red = red;\n    uint32_t new_blue = argb;\n    new_red -= ColorTransformDelta(m->green_to_red_, green);\n    new_red &= 0xff;\n    new_blue -= ColorTransformDelta(m->green_to_blue_, green);\n    new_blue -= ColorTransformDelta(m->red_to_blue_, red);\n    new_blue &= 0xff;\n    data[i] = (argb & 0xff00ff00u) | (new_red << 16) | (new_blue);\n  }\n}\n\nvoid VP8LTransformColorInverse_C(const VP8LMultipliers* const m, uint32_t* data,\n                                 int num_pixels) {\n  int i;\n  for (i = 0; i < num_pixels; ++i) {\n    const uint32_t argb = data[i];\n    const uint32_t green = argb >> 8;\n    const uint32_t red = argb >> 16;\n    uint32_t new_red = red;\n    uint32_t new_blue = argb;\n    new_red += ColorTransformDelta(m->green_to_red_, green);\n    new_red &= 0xff;\n    new_blue += ColorTransformDelta(m->green_to_blue_, green);\n    new_blue += ColorTransformDelta(m->red_to_blue_, new_red);\n    new_blue &= 0xff;\n    data[i] = (argb & 0xff00ff00u) | (new_red << 16) | (new_blue);\n  }\n}\n\nstatic WEBP_INLINE uint8_t TransformColorRed(uint8_t green_to_red,\n                                             uint32_t argb) {\n  const uint32_t green = argb >> 8;\n  uint32_t new_red = argb >> 16;\n  new_red -= ColorTransformDelta(green_to_red, green);\n  return (new_red & 0xff);\n}\n\nstatic WEBP_INLINE uint8_t TransformColorBlue(uint8_t green_to_blue,\n                                              uint8_t red_to_blue,\n                                              uint32_t argb) {\n  const uint32_t green = argb >> 8;\n  const uint32_t red = argb >> 16;\n  uint8_t new_blue = argb;\n  new_blue -= ColorTransformDelta(green_to_blue, green);\n  new_blue -= ColorTransformDelta(red_to_blue, red);\n  return (new_blue & 0xff);\n}\n\nstatic float PredictionCostCrossColor(const int accumulated[256],\n                                      const int counts[256]) {\n  // Favor low entropy, locally and globally.\n  // Favor small absolute values for PredictionCostSpatial\n  static const double kExpValue = 2.4;\n  return CombinedShannonEntropy(counts, accumulated) +\n         PredictionCostSpatial(counts, 3, kExpValue);\n}\n\nstatic float GetPredictionCostCrossColorRed(\n    int tile_x_offset, int tile_y_offset, int all_x_max, int all_y_max,\n    int xsize, VP8LMultipliers prev_x, VP8LMultipliers prev_y, int green_to_red,\n    const int accumulated_red_histo[256], const uint32_t* const argb) {\n  int all_y;\n  int histo[256] = { 0 };\n  float cur_diff;\n  for (all_y = tile_y_offset; all_y < all_y_max; ++all_y) {\n    int ix = all_y * xsize + tile_x_offset;\n    int all_x;\n    for (all_x = tile_x_offset; all_x < all_x_max; ++all_x, ++ix) {\n      ++histo[TransformColorRed(green_to_red, argb[ix])];  // red.\n    }\n  }\n  cur_diff = PredictionCostCrossColor(accumulated_red_histo, histo);\n  if ((uint8_t)green_to_red == prev_x.green_to_red_) {\n    cur_diff -= 3;  // favor keeping the areas locally similar\n  }\n  if ((uint8_t)green_to_red == prev_y.green_to_red_) {\n    cur_diff -= 3;  // favor keeping the areas locally similar\n  }\n  if (green_to_red == 0) {\n    cur_diff -= 3;\n  }\n  return cur_diff;\n}\n\nstatic void GetBestGreenToRed(\n    int tile_x_offset, int tile_y_offset, int all_x_max, int all_y_max,\n    int xsize, VP8LMultipliers prev_x, VP8LMultipliers prev_y,\n    const int accumulated_red_histo[256], const uint32_t* const argb,\n    VP8LMultipliers* const best_tx) {\n  int min_green_to_red = -64;\n  int max_green_to_red = 64;\n  int green_to_red = 0;\n  int eval_min = 1;\n  int eval_max = 1;\n  float cur_diff_min = MAX_DIFF_COST;\n  float cur_diff_max = MAX_DIFF_COST;\n  // Do a binary search to find the optimal green_to_red color transform.\n  while (max_green_to_red - min_green_to_red > 2) {\n    if (eval_min) {\n      cur_diff_min = GetPredictionCostCrossColorRed(\n          tile_x_offset, tile_y_offset, all_x_max, all_y_max, xsize,\n          prev_x, prev_y, min_green_to_red, accumulated_red_histo, argb);\n      eval_min = 0;\n    }\n    if (eval_max) {\n      cur_diff_max = GetPredictionCostCrossColorRed(\n          tile_x_offset, tile_y_offset, all_x_max, all_y_max, xsize,\n          prev_x, prev_y, max_green_to_red, accumulated_red_histo, argb);\n      eval_max = 0;\n    }\n    if (cur_diff_min < cur_diff_max) {\n      green_to_red = min_green_to_red;\n      max_green_to_red = (max_green_to_red + min_green_to_red) / 2;\n      eval_max = 1;\n    } else {\n      green_to_red = max_green_to_red;\n      min_green_to_red = (max_green_to_red + min_green_to_red) / 2;\n      eval_min = 1;\n    }\n  }\n  best_tx->green_to_red_ = green_to_red;\n}\n\nstatic float GetPredictionCostCrossColorBlue(\n    int tile_x_offset, int tile_y_offset, int all_x_max, int all_y_max,\n    int xsize, VP8LMultipliers prev_x, VP8LMultipliers prev_y,\n    int green_to_blue, int red_to_blue, const int accumulated_blue_histo[256],\n    const uint32_t* const argb) {\n  int all_y;\n  int histo[256] = { 0 };\n  float cur_diff;\n  for (all_y = tile_y_offset; all_y < all_y_max; ++all_y) {\n    int all_x;\n    int ix = all_y * xsize + tile_x_offset;\n    for (all_x = tile_x_offset; all_x < all_x_max; ++all_x, ++ix) {\n      ++histo[TransformColorBlue(green_to_blue, red_to_blue, argb[ix])];\n    }\n  }\n  cur_diff = PredictionCostCrossColor(accumulated_blue_histo, histo);\n  if ((uint8_t)green_to_blue == prev_x.green_to_blue_) {\n    cur_diff -= 3;  // favor keeping the areas locally similar\n  }\n  if ((uint8_t)green_to_blue == prev_y.green_to_blue_) {\n    cur_diff -= 3;  // favor keeping the areas locally similar\n  }\n  if ((uint8_t)red_to_blue == prev_x.red_to_blue_) {\n    cur_diff -= 3;  // favor keeping the areas locally similar\n  }\n  if ((uint8_t)red_to_blue == prev_y.red_to_blue_) {\n    cur_diff -= 3;  // favor keeping the areas locally similar\n  }\n  if (green_to_blue == 0) {\n    cur_diff -= 3;\n  }\n  if (red_to_blue == 0) {\n    cur_diff -= 3;\n  }\n  return cur_diff;\n}\n\nstatic void GetBestGreenRedToBlue(\n    int tile_x_offset, int tile_y_offset, int all_x_max, int all_y_max,\n    int xsize, VP8LMultipliers prev_x, VP8LMultipliers prev_y, int quality,\n    const int accumulated_blue_histo[256], const uint32_t* const argb,\n    VP8LMultipliers* const best_tx) {\n  float best_diff = MAX_DIFF_COST;\n  float cur_diff;\n  const int step = (quality < 25) ? 32 : (quality > 50) ? 8 : 16;\n  const int min_green_to_blue = -32;\n  const int max_green_to_blue = 32;\n  const int min_red_to_blue = -32;\n  const int max_red_to_blue = 32;\n  const int num_iters =\n      (1 + (max_green_to_blue - min_green_to_blue) / step) *\n      (1 + (max_red_to_blue - min_red_to_blue) / step);\n  // Number of tries to get optimal green_to_blue & red_to_blue color transforms\n  // after finding a local minima.\n  const int max_tries_after_min = 4 + (num_iters >> 2);\n  int num_tries_after_min = 0;\n  int green_to_blue;\n  for (green_to_blue = min_green_to_blue;\n       green_to_blue <= max_green_to_blue &&\n       num_tries_after_min < max_tries_after_min;\n       green_to_blue += step) {\n    int red_to_blue;\n    for (red_to_blue = min_red_to_blue;\n         red_to_blue <= max_red_to_blue &&\n         num_tries_after_min < max_tries_after_min;\n         red_to_blue += step) {\n      cur_diff = GetPredictionCostCrossColorBlue(\n          tile_x_offset, tile_y_offset, all_x_max, all_y_max, xsize, prev_x,\n          prev_y, green_to_blue, red_to_blue, accumulated_blue_histo, argb);\n      if (cur_diff < best_diff) {\n        best_diff = cur_diff;\n        best_tx->green_to_blue_ = green_to_blue;\n        best_tx->red_to_blue_ = red_to_blue;\n        num_tries_after_min = 0;\n      } else {\n        ++num_tries_after_min;\n      }\n    }\n  }\n}\n\nstatic VP8LMultipliers GetBestColorTransformForTile(\n    int tile_x, int tile_y, int bits,\n    VP8LMultipliers prev_x,\n    VP8LMultipliers prev_y,\n    int quality, int xsize, int ysize,\n    const int accumulated_red_histo[256],\n    const int accumulated_blue_histo[256],\n    const uint32_t* const argb) {\n  const int max_tile_size = 1 << bits;\n  const int tile_y_offset = tile_y * max_tile_size;\n  const int tile_x_offset = tile_x * max_tile_size;\n  const int all_x_max = GetMin(tile_x_offset + max_tile_size, xsize);\n  const int all_y_max = GetMin(tile_y_offset + max_tile_size, ysize);\n  VP8LMultipliers best_tx;\n  MultipliersClear(&best_tx);\n\n  GetBestGreenToRed(tile_x_offset, tile_y_offset, all_x_max, all_y_max, xsize,\n                    prev_x, prev_y, accumulated_red_histo, argb, &best_tx);\n  GetBestGreenRedToBlue(tile_x_offset, tile_y_offset, all_x_max, all_y_max,\n                        xsize, prev_x, prev_y, quality, accumulated_blue_histo,\n                        argb, &best_tx);\n  return best_tx;\n}\n\nstatic void CopyTileWithColorTransform(int xsize, int ysize,\n                                       int tile_x, int tile_y,\n                                       int max_tile_size,\n                                       VP8LMultipliers color_transform,\n                                       uint32_t* argb) {\n  const int xscan = GetMin(max_tile_size, xsize - tile_x);\n  int yscan = GetMin(max_tile_size, ysize - tile_y);\n  argb += tile_y * xsize + tile_x;\n  while (yscan-- > 0) {\n    VP8LTransformColor(&color_transform, argb, xscan);\n    argb += xsize;\n  }\n}\n\nvoid VP8LColorSpaceTransform(int width, int height, int bits, int quality,\n                             uint32_t* const argb, uint32_t* image) {\n  const int max_tile_size = 1 << bits;\n  const int tile_xsize = VP8LSubSampleSize(width, bits);\n  const int tile_ysize = VP8LSubSampleSize(height, bits);\n  int accumulated_red_histo[256] = { 0 };\n  int accumulated_blue_histo[256] = { 0 };\n  int tile_x, tile_y;\n  VP8LMultipliers prev_x, prev_y;\n  MultipliersClear(&prev_y);\n  MultipliersClear(&prev_x);\n  for (tile_y = 0; tile_y < tile_ysize; ++tile_y) {\n    for (tile_x = 0; tile_x < tile_xsize; ++tile_x) {\n      int y;\n      const int tile_x_offset = tile_x * max_tile_size;\n      const int tile_y_offset = tile_y * max_tile_size;\n      const int all_x_max = GetMin(tile_x_offset + max_tile_size, width);\n      const int all_y_max = GetMin(tile_y_offset + max_tile_size, height);\n      const int offset = tile_y * tile_xsize + tile_x;\n      if (tile_y != 0) {\n        ColorCodeToMultipliers(image[offset - tile_xsize], &prev_y);\n      }\n      prev_x = GetBestColorTransformForTile(tile_x, tile_y, bits,\n                                            prev_x, prev_y,\n                                            quality, width, height,\n                                            accumulated_red_histo,\n                                            accumulated_blue_histo,\n                                            argb);\n      image[offset] = MultipliersToColorCode(&prev_x);\n      CopyTileWithColorTransform(width, height, tile_x_offset, tile_y_offset,\n                                 max_tile_size, prev_x, argb);\n\n      // Gather accumulated histogram data.\n      for (y = tile_y_offset; y < all_y_max; ++y) {\n        int ix = y * width + tile_x_offset;\n        const int ix_end = ix + all_x_max - tile_x_offset;\n        for (; ix < ix_end; ++ix) {\n          const uint32_t pix = argb[ix];\n          if (ix >= 2 &&\n              pix == argb[ix - 2] &&\n              pix == argb[ix - 1]) {\n            continue;  // repeated pixels are handled by backward references\n          }\n          if (ix >= width + 2 &&\n              argb[ix - 2] == argb[ix - width - 2] &&\n              argb[ix - 1] == argb[ix - width - 1] &&\n              pix == argb[ix - width]) {\n            continue;  // repeated pixels are handled by backward references\n          }\n          ++accumulated_red_histo[(pix >> 16) & 0xff];\n          ++accumulated_blue_histo[(pix >> 0) & 0xff];\n        }\n      }\n    }\n  }\n}\n\n// Color space inverse transform.\nstatic void ColorSpaceInverseTransform(const VP8LTransform* const transform,\n                                       int y_start, int y_end, uint32_t* data) {\n  const int width = transform->xsize_;\n  const int tile_width = 1 << transform->bits_;\n  const int mask = tile_width - 1;\n  const int safe_width = width & ~mask;\n  const int remaining_width = width - safe_width;\n  const int tiles_per_row = VP8LSubSampleSize(width, transform->bits_);\n  int y = y_start;\n  const uint32_t* pred_row =\n      transform->data_ + (y >> transform->bits_) * tiles_per_row;\n\n  while (y < y_end) {\n    const uint32_t* pred = pred_row;\n    VP8LMultipliers m = { 0, 0, 0 };\n    const uint32_t* const data_safe_end = data + safe_width;\n    const uint32_t* const data_end = data + width;\n    while (data < data_safe_end) {\n      ColorCodeToMultipliers(*pred++, &m);\n      VP8LTransformColorInverse(&m, data, tile_width);\n      data += tile_width;\n    }\n    if (data < data_end) {  // Left-overs using C-version.\n      ColorCodeToMultipliers(*pred++, &m);\n      VP8LTransformColorInverse(&m, data, remaining_width);\n      data += remaining_width;\n    }\n    ++y;\n    if ((y & mask) == 0) pred_row += tiles_per_row;\n  }\n}\n\n// Separate out pixels packed together using pixel-bundling.\n// We define two methods for ARGB data (uint32_t) and alpha-only data (uint8_t).\n#define COLOR_INDEX_INVERSE(FUNC_NAME, TYPE, GET_INDEX, GET_VALUE)             \\\nvoid FUNC_NAME(const VP8LTransform* const transform,                           \\\n               int y_start, int y_end, const TYPE* src, TYPE* dst) {           \\\n  int y;                                                                       \\\n  const int bits_per_pixel = 8 >> transform->bits_;                            \\\n  const int width = transform->xsize_;                                         \\\n  const uint32_t* const color_map = transform->data_;                          \\\n  if (bits_per_pixel < 8) {                                                    \\\n    const int pixels_per_byte = 1 << transform->bits_;                         \\\n    const int count_mask = pixels_per_byte - 1;                                \\\n    const uint32_t bit_mask = (1 << bits_per_pixel) - 1;                       \\\n    for (y = y_start; y < y_end; ++y) {                                        \\\n      uint32_t packed_pixels = 0;                                              \\\n      int x;                                                                   \\\n      for (x = 0; x < width; ++x) {                                            \\\n        /* We need to load fresh 'packed_pixels' once every                */  \\\n        /* 'pixels_per_byte' increments of x. Fortunately, pixels_per_byte */  \\\n        /* is a power of 2, so can just use a mask for that, instead of    */  \\\n        /* decrementing a counter.                                         */  \\\n        if ((x & count_mask) == 0) packed_pixels = GET_INDEX(*src++);          \\\n        *dst++ = GET_VALUE(color_map[packed_pixels & bit_mask]);               \\\n        packed_pixels >>= bits_per_pixel;                                      \\\n      }                                                                        \\\n    }                                                                          \\\n  } else {                                                                     \\\n    for (y = y_start; y < y_end; ++y) {                                        \\\n      int x;                                                                   \\\n      for (x = 0; x < width; ++x) {                                            \\\n        *dst++ = GET_VALUE(color_map[GET_INDEX(*src++)]);                      \\\n      }                                                                        \\\n    }                                                                          \\\n  }                                                                            \\\n}\n\nstatic WEBP_INLINE uint32_t GetARGBIndex(uint32_t idx) {\n  return (idx >> 8) & 0xff;\n}\n\nstatic WEBP_INLINE uint8_t GetAlphaIndex(uint8_t idx) {\n  return idx;\n}\n\nstatic WEBP_INLINE uint32_t GetARGBValue(uint32_t val) {\n  return val;\n}\n\nstatic WEBP_INLINE uint8_t GetAlphaValue(uint32_t val) {\n  return (val >> 8) & 0xff;\n}\n\nstatic COLOR_INDEX_INVERSE(ColorIndexInverseTransform, uint32_t, GetARGBIndex,\n                           GetARGBValue)\nCOLOR_INDEX_INVERSE(VP8LColorIndexInverseTransformAlpha, uint8_t, GetAlphaIndex,\n                    GetAlphaValue)\n\n#undef COLOR_INDEX_INVERSE\n\nvoid VP8LInverseTransform(const VP8LTransform* const transform,\n                          int row_start, int row_end,\n                          const uint32_t* const in, uint32_t* const out) {\n  const int width = transform->xsize_;\n  assert(row_start < row_end);\n  assert(row_end <= transform->ysize_);\n  switch (transform->type_) {\n    case SUBTRACT_GREEN:\n      VP8LAddGreenToBlueAndRed(out, (row_end - row_start) * width);\n      break;\n    case PREDICTOR_TRANSFORM:\n      PredictorInverseTransform(transform, row_start, row_end, out);\n      if (row_end != transform->ysize_) {\n        // The last predicted row in this iteration will be the top-pred row\n        // for the first row in next iteration.\n        memcpy(out - width, out + (row_end - row_start - 1) * width,\n               width * sizeof(*out));\n      }\n      break;\n    case CROSS_COLOR_TRANSFORM:\n      ColorSpaceInverseTransform(transform, row_start, row_end, out);\n      break;\n    case COLOR_INDEXING_TRANSFORM:\n      if (in == out && transform->bits_ > 0) {\n        // Move packed pixels to the end of unpacked region, so that unpacking\n        // can occur seamlessly.\n        // Also, note that this is the only transform that applies on\n        // the effective width of VP8LSubSampleSize(xsize_, bits_). All other\n        // transforms work on effective width of xsize_.\n        const int out_stride = (row_end - row_start) * width;\n        const int in_stride = (row_end - row_start) *\n            VP8LSubSampleSize(transform->xsize_, transform->bits_);\n        uint32_t* const src = out + out_stride - in_stride;\n        memmove(src, out, in_stride * sizeof(*src));\n        ColorIndexInverseTransform(transform, row_start, row_end, src, out);\n      } else {\n        ColorIndexInverseTransform(transform, row_start, row_end, in, out);\n      }\n      break;\n  }\n}\n\n//------------------------------------------------------------------------------\n// Color space conversion.\n\nstatic int is_big_endian(void) {\n  static const union {\n    uint16_t w;\n    uint8_t b[2];\n  } tmp = { 1 };\n  return (tmp.b[0] != 1);\n}\n\nvoid VP8LConvertBGRAToRGB_C(const uint32_t* src,\n                            int num_pixels, uint8_t* dst) {\n  const uint32_t* const src_end = src + num_pixels;\n  while (src < src_end) {\n    const uint32_t argb = *src++;\n    *dst++ = (argb >> 16) & 0xff;\n    *dst++ = (argb >>  8) & 0xff;\n    *dst++ = (argb >>  0) & 0xff;\n  }\n}\n\nvoid VP8LConvertBGRAToRGBA_C(const uint32_t* src,\n                             int num_pixels, uint8_t* dst) {\n  const uint32_t* const src_end = src + num_pixels;\n  while (src < src_end) {\n    const uint32_t argb = *src++;\n    *dst++ = (argb >> 16) & 0xff;\n    *dst++ = (argb >>  8) & 0xff;\n    *dst++ = (argb >>  0) & 0xff;\n    *dst++ = (argb >> 24) & 0xff;\n  }\n}\n\nvoid VP8LConvertBGRAToRGBA4444_C(const uint32_t* src,\n                                 int num_pixels, uint8_t* dst) {\n  const uint32_t* const src_end = src + num_pixels;\n  while (src < src_end) {\n    const uint32_t argb = *src++;\n    const uint8_t rg = ((argb >> 16) & 0xf0) | ((argb >> 12) & 0xf);\n    const uint8_t ba = ((argb >>  0) & 0xf0) | ((argb >> 28) & 0xf);\n#ifdef WEBP_SWAP_16BIT_CSP\n    *dst++ = ba;\n    *dst++ = rg;\n#else\n    *dst++ = rg;\n    *dst++ = ba;\n#endif\n  }\n}\n\nvoid VP8LConvertBGRAToRGB565_C(const uint32_t* src,\n                               int num_pixels, uint8_t* dst) {\n  const uint32_t* const src_end = src + num_pixels;\n  while (src < src_end) {\n    const uint32_t argb = *src++;\n    const uint8_t rg = ((argb >> 16) & 0xf8) | ((argb >> 13) & 0x7);\n    const uint8_t gb = ((argb >>  5) & 0xe0) | ((argb >>  3) & 0x1f);\n#ifdef WEBP_SWAP_16BIT_CSP\n    *dst++ = gb;\n    *dst++ = rg;\n#else\n    *dst++ = rg;\n    *dst++ = gb;\n#endif\n  }\n}\n\nvoid VP8LConvertBGRAToBGR_C(const uint32_t* src,\n                            int num_pixels, uint8_t* dst) {\n  const uint32_t* const src_end = src + num_pixels;\n  while (src < src_end) {\n    const uint32_t argb = *src++;\n    *dst++ = (argb >>  0) & 0xff;\n    *dst++ = (argb >>  8) & 0xff;\n    *dst++ = (argb >> 16) & 0xff;\n  }\n}\n\nstatic void CopyOrSwap(const uint32_t* src, int num_pixels, uint8_t* dst,\n                       int swap_on_big_endian) {\n  if (is_big_endian() == swap_on_big_endian) {\n    const uint32_t* const src_end = src + num_pixels;\n    while (src < src_end) {\n      const uint32_t argb = *src++;\n\n#if !defined(WORDS_BIGENDIAN)\n#if !defined(WEBP_REFERENCE_IMPLEMENTATION)\n      *(uint32_t*)dst = BSwap32(argb);\n#else  // WEBP_REFERENCE_IMPLEMENTATION\n      dst[0] = (argb >> 24) & 0xff;\n      dst[1] = (argb >> 16) & 0xff;\n      dst[2] = (argb >>  8) & 0xff;\n      dst[3] = (argb >>  0) & 0xff;\n#endif\n#else  // WORDS_BIGENDIAN\n      dst[0] = (argb >>  0) & 0xff;\n      dst[1] = (argb >>  8) & 0xff;\n      dst[2] = (argb >> 16) & 0xff;\n      dst[3] = (argb >> 24) & 0xff;\n#endif\n      dst += sizeof(argb);\n    }\n  } else {\n    memcpy(dst, src, num_pixels * sizeof(*src));\n  }\n}\n\nvoid VP8LConvertFromBGRA(const uint32_t* const in_data, int num_pixels,\n                         WEBP_CSP_MODE out_colorspace, uint8_t* const rgba) {\n  switch (out_colorspace) {\n    case MODE_RGB:\n      VP8LConvertBGRAToRGB(in_data, num_pixels, rgba);\n      break;\n    case MODE_RGBA:\n      VP8LConvertBGRAToRGBA(in_data, num_pixels, rgba);\n      break;\n    case MODE_rgbA:\n      VP8LConvertBGRAToRGBA(in_data, num_pixels, rgba);\n      WebPApplyAlphaMultiply(rgba, 0, num_pixels, 1, 0);\n      break;\n    case MODE_BGR:\n      VP8LConvertBGRAToBGR(in_data, num_pixels, rgba);\n      break;\n    case MODE_BGRA:\n      CopyOrSwap(in_data, num_pixels, rgba, 1);\n      break;\n    case MODE_bgrA:\n      CopyOrSwap(in_data, num_pixels, rgba, 1);\n      WebPApplyAlphaMultiply(rgba, 0, num_pixels, 1, 0);\n      break;\n    case MODE_ARGB:\n      CopyOrSwap(in_data, num_pixels, rgba, 0);\n      break;\n    case MODE_Argb:\n      CopyOrSwap(in_data, num_pixels, rgba, 0);\n      WebPApplyAlphaMultiply(rgba, 1, num_pixels, 1, 0);\n      break;\n    case MODE_RGBA_4444:\n      VP8LConvertBGRAToRGBA4444(in_data, num_pixels, rgba);\n      break;\n    case MODE_rgbA_4444:\n      VP8LConvertBGRAToRGBA4444(in_data, num_pixels, rgba);\n      WebPApplyAlphaMultiply4444(rgba, num_pixels, 1, 0);\n      break;\n    case MODE_RGB_565:\n      VP8LConvertBGRAToRGB565(in_data, num_pixels, rgba);\n      break;\n    default:\n      assert(0);          // Code flow should not reach here.\n  }\n}\n\n//------------------------------------------------------------------------------\n// Bundles multiple (1, 2, 4 or 8) pixels into a single pixel.\nvoid VP8LBundleColorMap(const uint8_t* const row, int width,\n                        int xbits, uint32_t* const dst) {\n  int x;\n  if (xbits > 0) {\n    const int bit_depth = 1 << (3 - xbits);\n    const int mask = (1 << xbits) - 1;\n    uint32_t code = 0xff000000;\n    for (x = 0; x < width; ++x) {\n      const int xsub = x & mask;\n      if (xsub == 0) {\n        code = 0xff000000;\n      }\n      code |= row[x] << (8 + bit_depth * xsub);\n      dst[x >> xbits] = code;\n    }\n  } else {\n    for (x = 0; x < width; ++x) dst[x] = 0xff000000 | (row[x] << 8);\n  }\n}\n\n//------------------------------------------------------------------------------\n\nstatic double ExtraCost(const uint32_t* population, int length) {\n  int i;\n  double cost = 0.;\n  for (i = 2; i < length - 2; ++i) cost += (i >> 1) * population[i + 2];\n  return cost;\n}\n\nstatic double ExtraCostCombined(const uint32_t* X, const uint32_t* Y,\n                                int length) {\n  int i;\n  double cost = 0.;\n  for (i = 2; i < length - 2; ++i) {\n    const int xy = X[i + 2] + Y[i + 2];\n    cost += (i >> 1) * xy;\n  }\n  return cost;\n}\n\n// Returns the various RLE counts\nstatic VP8LStreaks HuffmanCostCount(const uint32_t* population, int length) {\n  int i;\n  int streak = 0;\n  VP8LStreaks stats;\n  memset(&stats, 0, sizeof(stats));\n  for (i = 0; i < length - 1; ++i) {\n    ++streak;\n    if (population[i] == population[i + 1]) {\n      continue;\n    }\n    stats.counts[population[i] != 0] += (streak > 3);\n    stats.streaks[population[i] != 0][(streak > 3)] += streak;\n    streak = 0;\n  }\n  ++streak;\n  stats.counts[population[i] != 0] += (streak > 3);\n  stats.streaks[population[i] != 0][(streak > 3)] += streak;\n  return stats;\n}\n\nstatic VP8LStreaks HuffmanCostCombinedCount(const uint32_t* X,\n                                            const uint32_t* Y, int length) {\n  int i;\n  int streak = 0;\n  VP8LStreaks stats;\n  memset(&stats, 0, sizeof(stats));\n  for (i = 0; i < length - 1; ++i) {\n    const int xy = X[i] + Y[i];\n    const int xy_next = X[i + 1] + Y[i + 1];\n    ++streak;\n    if (xy == xy_next) {\n      continue;\n    }\n    stats.counts[xy != 0] += (streak > 3);\n    stats.streaks[xy != 0][(streak > 3)] += streak;\n    streak = 0;\n  }\n  {\n    const int xy = X[i] + Y[i];\n    ++streak;\n    stats.counts[xy != 0] += (streak > 3);\n    stats.streaks[xy != 0][(streak > 3)] += streak;\n  }\n  return stats;\n}\n\n//------------------------------------------------------------------------------\n\nstatic void HistogramAdd(const VP8LHistogram* const a,\n                         const VP8LHistogram* const b,\n                         VP8LHistogram* const out) {\n  int i;\n  const int literal_size = VP8LHistogramNumCodes(a->palette_code_bits_);\n  assert(a->palette_code_bits_ == b->palette_code_bits_);\n  if (b != out) {\n    for (i = 0; i < literal_size; ++i) {\n      out->literal_[i] = a->literal_[i] + b->literal_[i];\n    }\n    for (i = 0; i < NUM_DISTANCE_CODES; ++i) {\n      out->distance_[i] = a->distance_[i] + b->distance_[i];\n    }\n    for (i = 0; i < NUM_LITERAL_CODES; ++i) {\n      out->red_[i] = a->red_[i] + b->red_[i];\n      out->blue_[i] = a->blue_[i] + b->blue_[i];\n      out->alpha_[i] = a->alpha_[i] + b->alpha_[i];\n    }\n  } else {\n    for (i = 0; i < literal_size; ++i) {\n      out->literal_[i] += a->literal_[i];\n    }\n    for (i = 0; i < NUM_DISTANCE_CODES; ++i) {\n      out->distance_[i] += a->distance_[i];\n    }\n    for (i = 0; i < NUM_LITERAL_CODES; ++i) {\n      out->red_[i] += a->red_[i];\n      out->blue_[i] += a->blue_[i];\n      out->alpha_[i] += a->alpha_[i];\n    }\n  }\n}\n\n//------------------------------------------------------------------------------\n\nVP8LProcessBlueAndRedFunc VP8LSubtractGreenFromBlueAndRed;\nVP8LProcessBlueAndRedFunc VP8LAddGreenToBlueAndRed;\nVP8LPredictorFunc VP8LPredictors[16];\n\nVP8LTransformColorFunc VP8LTransformColor;\nVP8LTransformColorFunc VP8LTransformColorInverse;\n\nVP8LConvertFunc VP8LConvertBGRAToRGB;\nVP8LConvertFunc VP8LConvertBGRAToRGBA;\nVP8LConvertFunc VP8LConvertBGRAToRGBA4444;\nVP8LConvertFunc VP8LConvertBGRAToRGB565;\nVP8LConvertFunc VP8LConvertBGRAToBGR;\n\nVP8LFastLog2SlowFunc VP8LFastLog2Slow;\nVP8LFastLog2SlowFunc VP8LFastSLog2Slow;\n\nVP8LCostFunc VP8LExtraCost;\nVP8LCostCombinedFunc VP8LExtraCostCombined;\n\nVP8LCostCountFunc VP8LHuffmanCostCount;\nVP8LCostCombinedCountFunc VP8LHuffmanCostCombinedCount;\n\nVP8LHistogramAddFunc VP8LHistogramAdd;\n\nextern void VP8LDspInitSSE2(void);\nextern void VP8LDspInitNEON(void);\nextern void VP8LDspInitMIPS32(void);\n\nvoid VP8LDspInit(void) {\n  memcpy(VP8LPredictors, kPredictorsC, sizeof(VP8LPredictors));\n\n  VP8LSubtractGreenFromBlueAndRed = VP8LSubtractGreenFromBlueAndRed_C;\n  VP8LAddGreenToBlueAndRed = VP8LAddGreenToBlueAndRed_C;\n\n  VP8LTransformColor = VP8LTransformColor_C;\n  VP8LTransformColorInverse = VP8LTransformColorInverse_C;\n\n  VP8LConvertBGRAToRGB = VP8LConvertBGRAToRGB_C;\n  VP8LConvertBGRAToRGBA = VP8LConvertBGRAToRGBA_C;\n  VP8LConvertBGRAToRGBA4444 = VP8LConvertBGRAToRGBA4444_C;\n  VP8LConvertBGRAToRGB565 = VP8LConvertBGRAToRGB565_C;\n  VP8LConvertBGRAToBGR = VP8LConvertBGRAToBGR_C;\n\n  VP8LFastLog2Slow = FastLog2Slow;\n  VP8LFastSLog2Slow = FastSLog2Slow;\n\n  VP8LExtraCost = ExtraCost;\n  VP8LExtraCostCombined = ExtraCostCombined;\n\n  VP8LHuffmanCostCount = HuffmanCostCount;\n  VP8LHuffmanCostCombinedCount = HuffmanCostCombinedCount;\n\n  VP8LHistogramAdd = HistogramAdd;\n\n  // If defined, use CPUInfo() to overwrite some pointers with faster versions.\n  if (VP8GetCPUInfo != NULL) {\n#if defined(WEBP_USE_SSE2)\n    if (VP8GetCPUInfo(kSSE2)) {\n      VP8LDspInitSSE2();\n    }\n#endif\n#if defined(WEBP_USE_NEON)\n    if (VP8GetCPUInfo(kNEON)) {\n      VP8LDspInitNEON();\n    }\n#endif\n#if defined(WEBP_USE_MIPS32)\n    if (VP8GetCPUInfo(kMIPS32)) {\n      VP8LDspInitMIPS32();\n    }\n#endif\n  }\n}\n\n//------------------------------------------------------------------------------\n"
  },
  {
    "path": "ext/libwebp/dsp/lossless.h",
    "content": "// Copyright 2012 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Image transforms and color space conversion methods for lossless decoder.\n//\n// Authors: Vikas Arora (vikaas.arora@gmail.com)\n//          Jyrki Alakuijala (jyrki@google.com)\n\n#ifndef WEBP_DSP_LOSSLESS_H_\n#define WEBP_DSP_LOSSLESS_H_\n\n#include \"../webp/types.h\"\n#include \"../webp/decode.h\"\n\n#include \"../enc/histogram.h\"\n#include \"../utils/utils.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n//------------------------------------------------------------------------------\n// Signatures and generic function-pointers\n\ntypedef uint32_t (*VP8LPredictorFunc)(uint32_t left, const uint32_t* const top);\nextern VP8LPredictorFunc VP8LPredictors[16];\n\ntypedef void (*VP8LProcessBlueAndRedFunc)(uint32_t* argb_data, int num_pixels);\nextern VP8LProcessBlueAndRedFunc VP8LSubtractGreenFromBlueAndRed;\nextern VP8LProcessBlueAndRedFunc VP8LAddGreenToBlueAndRed;\n\ntypedef struct {\n  // Note: the members are uint8_t, so that any negative values are\n  // automatically converted to \"mod 256\" values.\n  uint8_t green_to_red_;\n  uint8_t green_to_blue_;\n  uint8_t red_to_blue_;\n} VP8LMultipliers;\ntypedef void (*VP8LTransformColorFunc)(const VP8LMultipliers* const m,\n                                       uint32_t* argb_data, int num_pixels);\nextern VP8LTransformColorFunc VP8LTransformColor;\nextern VP8LTransformColorFunc VP8LTransformColorInverse;\n\ntypedef void (*VP8LConvertFunc)(const uint32_t* src, int num_pixels,\n                                uint8_t* dst);\nextern VP8LConvertFunc VP8LConvertBGRAToRGB;\nextern VP8LConvertFunc VP8LConvertBGRAToRGBA;\nextern VP8LConvertFunc VP8LConvertBGRAToRGBA4444;\nextern VP8LConvertFunc VP8LConvertBGRAToRGB565;\nextern VP8LConvertFunc VP8LConvertBGRAToBGR;\n\n// Expose some C-only fallback functions\nvoid VP8LTransformColor_C(const VP8LMultipliers* const m,\n                          uint32_t* data, int num_pixels);\nvoid VP8LTransformColorInverse_C(const VP8LMultipliers* const m,\n                                 uint32_t* data, int num_pixels);\n\nvoid VP8LConvertBGRAToRGB_C(const uint32_t* src, int num_pixels, uint8_t* dst);\nvoid VP8LConvertBGRAToRGBA_C(const uint32_t* src, int num_pixels, uint8_t* dst);\nvoid VP8LConvertBGRAToRGBA4444_C(const uint32_t* src,\n                                 int num_pixels, uint8_t* dst);\nvoid VP8LConvertBGRAToRGB565_C(const uint32_t* src,\n                               int num_pixels, uint8_t* dst);\nvoid VP8LConvertBGRAToBGR_C(const uint32_t* src, int num_pixels, uint8_t* dst);\nvoid VP8LSubtractGreenFromBlueAndRed_C(uint32_t* argb_data, int num_pixels);\nvoid VP8LAddGreenToBlueAndRed_C(uint32_t* data, int num_pixels);\n\n// Must be called before calling any of the above methods.\nvoid VP8LDspInit(void);\n\n//------------------------------------------------------------------------------\n// Image transforms.\n\nstruct VP8LTransform;  // Defined in dec/vp8li.h.\n\n// Performs inverse transform of data given transform information, start and end\n// rows. Transform will be applied to rows [row_start, row_end[.\n// The *in and *out pointers refer to source and destination data respectively\n// corresponding to the intermediate row (row_start).\nvoid VP8LInverseTransform(const struct VP8LTransform* const transform,\n                          int row_start, int row_end,\n                          const uint32_t* const in, uint32_t* const out);\n\n// Similar to the static method ColorIndexInverseTransform() that is part of\n// lossless.c, but used only for alpha decoding. It takes uint8_t (rather than\n// uint32_t) arguments for 'src' and 'dst'.\nvoid VP8LColorIndexInverseTransformAlpha(\n    const struct VP8LTransform* const transform, int y_start, int y_end,\n    const uint8_t* src, uint8_t* dst);\n\nvoid VP8LResidualImage(int width, int height, int bits,\n                       uint32_t* const argb, uint32_t* const argb_scratch,\n                       uint32_t* const image);\n\nvoid VP8LColorSpaceTransform(int width, int height, int bits, int quality,\n                             uint32_t* const argb, uint32_t* image);\n\n//------------------------------------------------------------------------------\n// Color space conversion.\n\n// Converts from BGRA to other color spaces.\nvoid VP8LConvertFromBGRA(const uint32_t* const in_data, int num_pixels,\n                         WEBP_CSP_MODE out_colorspace, uint8_t* const rgba);\n\n//------------------------------------------------------------------------------\n// Misc methods.\n\n// Computes sampled size of 'size' when sampling using 'sampling bits'.\nstatic WEBP_INLINE uint32_t VP8LSubSampleSize(uint32_t size,\n                                              uint32_t sampling_bits) {\n  return (size + (1 << sampling_bits) - 1) >> sampling_bits;\n}\n\n// -----------------------------------------------------------------------------\n// Faster logarithm for integers. Small values use a look-up table.\n#define LOG_LOOKUP_IDX_MAX 256\nextern const float kLog2Table[LOG_LOOKUP_IDX_MAX];\nextern const float kSLog2Table[LOG_LOOKUP_IDX_MAX];\ntypedef float (*VP8LFastLog2SlowFunc)(uint32_t v);\n\nextern VP8LFastLog2SlowFunc VP8LFastLog2Slow;\nextern VP8LFastLog2SlowFunc VP8LFastSLog2Slow;\n\nstatic WEBP_INLINE float VP8LFastLog2(uint32_t v) {\n  return (v < LOG_LOOKUP_IDX_MAX) ? kLog2Table[v] : VP8LFastLog2Slow(v);\n}\n// Fast calculation of v * log2(v) for integer input.\nstatic WEBP_INLINE float VP8LFastSLog2(uint32_t v) {\n  return (v < LOG_LOOKUP_IDX_MAX) ? kSLog2Table[v] : VP8LFastSLog2Slow(v);\n}\n\n// -----------------------------------------------------------------------------\n// Huffman-cost related functions.\n\ntypedef double (*VP8LCostFunc)(const uint32_t* population, int length);\ntypedef double (*VP8LCostCombinedFunc)(const uint32_t* X, const uint32_t* Y,\n                                       int length);\n\nextern VP8LCostFunc VP8LExtraCost;\nextern VP8LCostCombinedFunc VP8LExtraCostCombined;\n\ntypedef struct {        // small struct to hold counters\n  int counts[2];        // index: 0=zero steak, 1=non-zero streak\n  int streaks[2][2];    // [zero/non-zero][streak<3 / streak>=3]\n} VP8LStreaks;\n\ntypedef VP8LStreaks (*VP8LCostCountFunc)(const uint32_t* population,\n                                         int length);\ntypedef VP8LStreaks (*VP8LCostCombinedCountFunc)(const uint32_t* X,\n                                                 const uint32_t* Y, int length);\n\nextern VP8LCostCountFunc VP8LHuffmanCostCount;\nextern VP8LCostCombinedCountFunc VP8LHuffmanCostCombinedCount;\n\ntypedef void (*VP8LHistogramAddFunc)(const VP8LHistogram* const a,\n                                     const VP8LHistogram* const b,\n                                     VP8LHistogram* const out);\nextern VP8LHistogramAddFunc VP8LHistogramAdd;\n\n// -----------------------------------------------------------------------------\n// PrefixEncode()\n\nstatic WEBP_INLINE int VP8LBitsLog2Ceiling(uint32_t n) {\n  const int log_floor = BitsLog2Floor(n);\n  if (n == (n & ~(n - 1)))  // zero or a power of two.\n    return log_floor;\n  else\n    return log_floor + 1;\n}\n\n// Splitting of distance and length codes into prefixes and\n// extra bits. The prefixes are encoded with an entropy code\n// while the extra bits are stored just as normal bits.\nstatic WEBP_INLINE void VP8LPrefixEncodeBitsNoLUT(int distance, int* const code,\n                                                  int* const extra_bits) {\n  const int highest_bit = BitsLog2Floor(--distance);\n  const int second_highest_bit = (distance >> (highest_bit - 1)) & 1;\n  *extra_bits = highest_bit - 1;\n  *code = 2 * highest_bit + second_highest_bit;\n}\n\nstatic WEBP_INLINE void VP8LPrefixEncodeNoLUT(int distance, int* const code,\n                                              int* const extra_bits,\n                                              int* const extra_bits_value) {\n  const int highest_bit = BitsLog2Floor(--distance);\n  const int second_highest_bit = (distance >> (highest_bit - 1)) & 1;\n  *extra_bits = highest_bit - 1;\n  *extra_bits_value = distance & ((1 << *extra_bits) - 1);\n  *code = 2 * highest_bit + second_highest_bit;\n}\n\n#define PREFIX_LOOKUP_IDX_MAX   512\ntypedef struct {\n  int8_t code_;\n  int8_t extra_bits_;\n} VP8LPrefixCode;\n\n// These tables are derived using VP8LPrefixEncodeNoLUT.\nextern const VP8LPrefixCode kPrefixEncodeCode[PREFIX_LOOKUP_IDX_MAX];\nextern const uint8_t kPrefixEncodeExtraBitsValue[PREFIX_LOOKUP_IDX_MAX];\nstatic WEBP_INLINE void VP8LPrefixEncodeBits(int distance, int* const code,\n                                             int* const extra_bits) {\n  if (distance < PREFIX_LOOKUP_IDX_MAX) {\n    const VP8LPrefixCode prefix_code = kPrefixEncodeCode[distance];\n    *code = prefix_code.code_;\n    *extra_bits = prefix_code.extra_bits_;\n  } else {\n    VP8LPrefixEncodeBitsNoLUT(distance, code, extra_bits);\n  }\n}\n\nstatic WEBP_INLINE void VP8LPrefixEncode(int distance, int* const code,\n                                         int* const extra_bits,\n                                         int* const extra_bits_value) {\n  if (distance < PREFIX_LOOKUP_IDX_MAX) {\n    const VP8LPrefixCode prefix_code = kPrefixEncodeCode[distance];\n    *code = prefix_code.code_;\n    *extra_bits = prefix_code.extra_bits_;\n    *extra_bits_value = kPrefixEncodeExtraBitsValue[distance];\n  } else {\n    VP8LPrefixEncodeNoLUT(distance, code, extra_bits, extra_bits_value);\n  }\n}\n\n// In-place difference of each component with mod 256.\nstatic WEBP_INLINE uint32_t VP8LSubPixels(uint32_t a, uint32_t b) {\n  const uint32_t alpha_and_green =\n      0x00ff00ffu + (a & 0xff00ff00u) - (b & 0xff00ff00u);\n  const uint32_t red_and_blue =\n      0xff00ff00u + (a & 0x00ff00ffu) - (b & 0x00ff00ffu);\n  return (alpha_and_green & 0xff00ff00u) | (red_and_blue & 0x00ff00ffu);\n}\n\nvoid VP8LBundleColorMap(const uint8_t* const row, int width,\n                        int xbits, uint32_t* const dst);\n\n//------------------------------------------------------------------------------\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  // WEBP_DSP_LOSSLESS_H_\n"
  },
  {
    "path": "ext/libwebp/dsp/lossless_mips32.c",
    "content": "// Copyright 2014 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// MIPS version of lossless functions\n//\n// Author(s):  Djordje Pesut    (djordje.pesut@imgtec.com)\n//             Jovan Zelincevic (jovan.zelincevic@imgtec.com)\n\n#include \"./dsp.h\"\n#include \"./lossless.h\"\n\n#if defined(WEBP_USE_MIPS32)\n\n#include <assert.h>\n#include <math.h>\n#include <stdlib.h>\n#include <string.h>\n\n#define APPROX_LOG_WITH_CORRECTION_MAX  65536\n#define APPROX_LOG_MAX                   4096\n#define LOG_2_RECIPROCAL 1.44269504088896338700465094007086\n\nstatic float FastSLog2Slow(uint32_t v) {\n  assert(v >= LOG_LOOKUP_IDX_MAX);\n  if (v < APPROX_LOG_WITH_CORRECTION_MAX) {\n    uint32_t log_cnt, y, correction;\n    const int c24 = 24;\n    const float v_f = (float)v;\n    uint32_t temp;\n\n    // Xf = 256 = 2^8\n    // log_cnt is index of leading one in upper 24 bits\n    __asm__ volatile(\n      \"clz      %[log_cnt], %[v]                      \\n\\t\"\n      \"addiu    %[y],       $zero,        1           \\n\\t\"\n      \"subu     %[log_cnt], %[c24],       %[log_cnt]  \\n\\t\"\n      \"sllv     %[y],       %[y],         %[log_cnt]  \\n\\t\"\n      \"srlv     %[temp],    %[v],         %[log_cnt]  \\n\\t\"\n      : [log_cnt]\"=&r\"(log_cnt), [y]\"=&r\"(y),\n        [temp]\"=r\"(temp)\n      : [c24]\"r\"(c24), [v]\"r\"(v)\n    );\n\n    // vf = (2^log_cnt) * Xf; where y = 2^log_cnt and Xf < 256\n    // Xf = floor(Xf) * (1 + (v % y) / v)\n    // log2(Xf) = log2(floor(Xf)) + log2(1 + (v % y) / v)\n    // The correction factor: log(1 + d) ~ d; for very small d values, so\n    // log2(1 + (v % y) / v) ~ LOG_2_RECIPROCAL * (v % y)/v\n    // LOG_2_RECIPROCAL ~ 23/16\n\n    // (v % y) = (v % 2^log_cnt) = v & (2^log_cnt - 1)\n    correction = (23 * (v & (y - 1))) >> 4;\n    return v_f * (kLog2Table[temp] + log_cnt) + correction;\n  } else {\n    return (float)(LOG_2_RECIPROCAL * v * log((double)v));\n  }\n}\n\nstatic float FastLog2Slow(uint32_t v) {\n  assert(v >= LOG_LOOKUP_IDX_MAX);\n  if (v < APPROX_LOG_WITH_CORRECTION_MAX) {\n    uint32_t log_cnt, y;\n    const int c24 = 24;\n    double log_2;\n    uint32_t temp;\n\n    __asm__ volatile(\n      \"clz      %[log_cnt], %[v]                      \\n\\t\"\n      \"addiu    %[y],       $zero,        1           \\n\\t\"\n      \"subu     %[log_cnt], %[c24],       %[log_cnt]  \\n\\t\"\n      \"sllv     %[y],       %[y],         %[log_cnt]  \\n\\t\"\n      \"srlv     %[temp],    %[v],         %[log_cnt]  \\n\\t\"\n      : [log_cnt]\"=&r\"(log_cnt), [y]\"=&r\"(y),\n        [temp]\"=r\"(temp)\n      : [c24]\"r\"(c24), [v]\"r\"(v)\n    );\n\n    log_2 = kLog2Table[temp] + log_cnt;\n    if (v >= APPROX_LOG_MAX) {\n      // Since the division is still expensive, add this correction factor only\n      // for large values of 'v'.\n\n      const uint32_t correction = (23 * (v & (y - 1))) >> 4;\n      log_2 += (double)correction / v;\n    }\n    return (float)log_2;\n  } else {\n    return (float)(LOG_2_RECIPROCAL * log((double)v));\n  }\n}\n\n// C version of this function:\n//   int i = 0;\n//   int64_t cost = 0;\n//   const uint32_t* pop = &population[4];\n//   const uint32_t* LoopEnd = &population[length];\n//   while (pop != LoopEnd) {\n//     ++i;\n//     cost += i * *pop;\n//     cost += i * *(pop + 1);\n//     pop += 2;\n//   }\n//   return (double)cost;\nstatic double ExtraCost(const uint32_t* const population, int length) {\n  int i, temp0, temp1;\n  const uint32_t* pop = &population[4];\n  const uint32_t* const LoopEnd = &population[length];\n\n  __asm__ volatile(\n    \"mult   $zero,    $zero                  \\n\\t\"\n    \"xor    %[i],     %[i],       %[i]       \\n\\t\"\n    \"beq    %[pop],   %[LoopEnd], 2f         \\n\\t\"\n  \"1:                                        \\n\\t\"\n    \"lw     %[temp0], 0(%[pop])              \\n\\t\"\n    \"lw     %[temp1], 4(%[pop])              \\n\\t\"\n    \"addiu  %[i],     %[i],       1          \\n\\t\"\n    \"addiu  %[pop],   %[pop],     8          \\n\\t\"\n    \"madd   %[i],     %[temp0]               \\n\\t\"\n    \"madd   %[i],     %[temp1]               \\n\\t\"\n    \"bne    %[pop],   %[LoopEnd], 1b         \\n\\t\"\n  \"2:                                        \\n\\t\"\n    \"mfhi   %[temp0]                         \\n\\t\"\n    \"mflo   %[temp1]                         \\n\\t\"\n    : [temp0]\"=&r\"(temp0), [temp1]\"=&r\"(temp1),\n      [i]\"=&r\"(i), [pop]\"+r\"(pop)\n    : [LoopEnd]\"r\"(LoopEnd)\n    : \"memory\", \"hi\", \"lo\"\n  );\n\n  return (double)((int64_t)temp0 << 32 | temp1);\n}\n\n// C version of this function:\n//   int i = 0;\n//   int64_t cost = 0;\n//   const uint32_t* pX = &X[4];\n//   const uint32_t* pY = &Y[4];\n//   const uint32_t* LoopEnd = &X[length];\n//   while (pX != LoopEnd) {\n//     const uint32_t xy0 = *pX + *pY;\n//     const uint32_t xy1 = *(pX + 1) + *(pY + 1);\n//     ++i;\n//     cost += i * xy0;\n//     cost += i * xy1;\n//     pX += 2;\n//     pY += 2;\n//   }\n//   return (double)cost;\nstatic double ExtraCostCombined(const uint32_t* const X,\n                                const uint32_t* const Y, int length) {\n  int i, temp0, temp1, temp2, temp3;\n  const uint32_t* pX = &X[4];\n  const uint32_t* pY = &Y[4];\n  const uint32_t* const LoopEnd = &X[length];\n\n  __asm__ volatile(\n    \"mult   $zero,    $zero                  \\n\\t\"\n    \"xor    %[i],     %[i],       %[i]       \\n\\t\"\n    \"beq    %[pX],    %[LoopEnd], 2f         \\n\\t\"\n  \"1:                                        \\n\\t\"\n    \"lw     %[temp0], 0(%[pX])               \\n\\t\"\n    \"lw     %[temp1], 0(%[pY])               \\n\\t\"\n    \"lw     %[temp2], 4(%[pX])               \\n\\t\"\n    \"lw     %[temp3], 4(%[pY])               \\n\\t\"\n    \"addiu  %[i],     %[i],       1          \\n\\t\"\n    \"addu   %[temp0], %[temp0],   %[temp1]   \\n\\t\"\n    \"addu   %[temp2], %[temp2],   %[temp3]   \\n\\t\"\n    \"addiu  %[pX],    %[pX],      8          \\n\\t\"\n    \"addiu  %[pY],    %[pY],      8          \\n\\t\"\n    \"madd   %[i],     %[temp0]               \\n\\t\"\n    \"madd   %[i],     %[temp2]               \\n\\t\"\n    \"bne    %[pX],    %[LoopEnd], 1b         \\n\\t\"\n  \"2:                                        \\n\\t\"\n    \"mfhi   %[temp0]                         \\n\\t\"\n    \"mflo   %[temp1]                         \\n\\t\"\n    : [temp0]\"=&r\"(temp0), [temp1]\"=&r\"(temp1),\n      [temp2]\"=&r\"(temp2), [temp3]\"=&r\"(temp3),\n      [i]\"=&r\"(i), [pX]\"+r\"(pX), [pY]\"+r\"(pY)\n    : [LoopEnd]\"r\"(LoopEnd)\n    : \"memory\", \"hi\", \"lo\"\n  );\n\n  return (double)((int64_t)temp0 << 32 | temp1);\n}\n\n#define HUFFMAN_COST_PASS                                 \\\n  __asm__ volatile(                                       \\\n    \"sll   %[temp1],  %[temp0],    3           \\n\\t\"      \\\n    \"addiu %[temp3],  %[streak],   -3          \\n\\t\"      \\\n    \"addu  %[temp2],  %[pstreaks], %[temp1]    \\n\\t\"      \\\n    \"blez  %[temp3],  1f                       \\n\\t\"      \\\n    \"srl   %[temp1],  %[temp1],    1           \\n\\t\"      \\\n    \"addu  %[temp3],  %[pcnts],    %[temp1]    \\n\\t\"      \\\n    \"lw    %[temp0],  4(%[temp2])              \\n\\t\"      \\\n    \"lw    %[temp1],  0(%[temp3])              \\n\\t\"      \\\n    \"addu  %[temp0],  %[temp0],    %[streak]   \\n\\t\"      \\\n    \"addiu %[temp1],  %[temp1],    1           \\n\\t\"      \\\n    \"sw    %[temp0],  4(%[temp2])              \\n\\t\"      \\\n    \"sw    %[temp1],  0(%[temp3])              \\n\\t\"      \\\n    \"b     2f                                  \\n\\t\"      \\\n  \"1:                                          \\n\\t\"      \\\n    \"lw    %[temp0],  0(%[temp2])              \\n\\t\"      \\\n    \"addu  %[temp0],  %[temp0],    %[streak]   \\n\\t\"      \\\n    \"sw    %[temp0],  0(%[temp2])              \\n\\t\"      \\\n  \"2:                                          \\n\\t\"      \\\n    : [temp1]\"=&r\"(temp1), [temp2]\"=&r\"(temp2),           \\\n      [temp3]\"=&r\"(temp3), [temp0]\"+r\"(temp0)             \\\n    : [pstreaks]\"r\"(pstreaks), [pcnts]\"r\"(pcnts),         \\\n      [streak]\"r\"(streak)                                 \\\n    : \"memory\"                                            \\\n  );\n\n// Returns the various RLE counts\nstatic VP8LStreaks HuffmanCostCount(const uint32_t* population, int length) {\n  int i;\n  int streak = 0;\n  VP8LStreaks stats;\n  int* const pstreaks = &stats.streaks[0][0];\n  int* const pcnts = &stats.counts[0];\n  int temp0, temp1, temp2, temp3;\n  memset(&stats, 0, sizeof(stats));\n  for (i = 0; i < length - 1; ++i) {\n    ++streak;\n    if (population[i] == population[i + 1]) {\n      continue;\n    }\n    temp0 = (population[i] != 0);\n    HUFFMAN_COST_PASS\n    streak = 0;\n  }\n  ++streak;\n  temp0 = (population[i] != 0);\n  HUFFMAN_COST_PASS\n\n  return stats;\n}\n\nstatic VP8LStreaks HuffmanCostCombinedCount(const uint32_t* X,\n                                            const uint32_t* Y, int length) {\n  int i;\n  int streak = 0;\n  VP8LStreaks stats;\n  int* const pstreaks = &stats.streaks[0][0];\n  int* const pcnts = &stats.counts[0];\n  int temp0, temp1, temp2, temp3;\n  memset(&stats, 0, sizeof(stats));\n  for (i = 0; i < length - 1; ++i) {\n    const uint32_t xy = X[i] + Y[i];\n    const uint32_t xy_next = X[i + 1] + Y[i + 1];\n    ++streak;\n    if (xy == xy_next) {\n      continue;\n    }\n    temp0 = (xy != 0);\n    HUFFMAN_COST_PASS\n    streak = 0;\n  }\n  {\n    const uint32_t xy = X[i] + Y[i];\n    ++streak;\n    temp0 = (xy != 0);\n    HUFFMAN_COST_PASS\n  }\n\n  return stats;\n}\n\n#define ASM_START                                       \\\n  __asm__ volatile(                                     \\\n    \".set   push                            \\n\\t\"       \\\n    \".set   at                              \\n\\t\"       \\\n    \".set   macro                           \\n\\t\"       \\\n  \"1:                                       \\n\\t\"\n\n// P2 = P0 + P1\n// A..D - offsets\n// E - temp variable to tell macro\n//     if pointer should be incremented\n// literal_ and successive histograms could be unaligned\n// so we must use ulw and usw\n#define ADD_TO_OUT(A, B, C, D, E, P0, P1, P2)           \\\n    \"ulw    %[temp0], \"#A\"(%[\"#P0\"])        \\n\\t\"       \\\n    \"ulw    %[temp1], \"#B\"(%[\"#P0\"])        \\n\\t\"       \\\n    \"ulw    %[temp2], \"#C\"(%[\"#P0\"])        \\n\\t\"       \\\n    \"ulw    %[temp3], \"#D\"(%[\"#P0\"])        \\n\\t\"       \\\n    \"ulw    %[temp4], \"#A\"(%[\"#P1\"])        \\n\\t\"       \\\n    \"ulw    %[temp5], \"#B\"(%[\"#P1\"])        \\n\\t\"       \\\n    \"ulw    %[temp6], \"#C\"(%[\"#P1\"])        \\n\\t\"       \\\n    \"ulw    %[temp7], \"#D\"(%[\"#P1\"])        \\n\\t\"       \\\n    \"addu   %[temp4], %[temp4],   %[temp0]  \\n\\t\"       \\\n    \"addu   %[temp5], %[temp5],   %[temp1]  \\n\\t\"       \\\n    \"addu   %[temp6], %[temp6],   %[temp2]  \\n\\t\"       \\\n    \"addu   %[temp7], %[temp7],   %[temp3]  \\n\\t\"       \\\n    \"addiu  %[\"#P0\"],  %[\"#P0\"],  16        \\n\\t\"       \\\n  \".if \"#E\" == 1                            \\n\\t\"       \\\n    \"addiu  %[\"#P1\"],  %[\"#P1\"],  16        \\n\\t\"       \\\n  \".endif                                   \\n\\t\"       \\\n    \"usw    %[temp4], \"#A\"(%[\"#P2\"])        \\n\\t\"       \\\n    \"usw    %[temp5], \"#B\"(%[\"#P2\"])        \\n\\t\"       \\\n    \"usw    %[temp6], \"#C\"(%[\"#P2\"])        \\n\\t\"       \\\n    \"usw    %[temp7], \"#D\"(%[\"#P2\"])        \\n\\t\"       \\\n    \"addiu  %[\"#P2\"], %[\"#P2\"],   16        \\n\\t\"       \\\n    \"bne    %[\"#P0\"], %[LoopEnd], 1b        \\n\\t\"       \\\n    \".set   pop                             \\n\\t\"       \\\n\n#define ASM_END_COMMON_0                                \\\n    : [temp0]\"=&r\"(temp0), [temp1]\"=&r\"(temp1),         \\\n      [temp2]\"=&r\"(temp2), [temp3]\"=&r\"(temp3),         \\\n      [temp4]\"=&r\"(temp4), [temp5]\"=&r\"(temp5),         \\\n      [temp6]\"=&r\"(temp6), [temp7]\"=&r\"(temp7),         \\\n      [pa]\"+r\"(pa), [pout]\"+r\"(pout)\n\n#define ASM_END_COMMON_1                                \\\n    : [LoopEnd]\"r\"(LoopEnd)                             \\\n    : \"memory\", \"at\"                                    \\\n  );\n\n#define ASM_END_0                                       \\\n    ASM_END_COMMON_0                                    \\\n      , [pb]\"+r\"(pb)                                    \\\n    ASM_END_COMMON_1\n\n#define ASM_END_1                                       \\\n    ASM_END_COMMON_0                                    \\\n    ASM_END_COMMON_1\n\n#define ADD_VECTOR(A, B, OUT, SIZE, EXTRA_SIZE)  do {   \\\n  const uint32_t* pa = (const uint32_t*)(A);            \\\n  const uint32_t* pb = (const uint32_t*)(B);            \\\n  uint32_t* pout = (uint32_t*)(OUT);                    \\\n  const uint32_t* const LoopEnd = pa + (SIZE);          \\\n  assert((SIZE) % 4 == 0);                              \\\n  ASM_START                                             \\\n  ADD_TO_OUT(0, 4, 8, 12, 1, pa, pb, pout)              \\\n  ASM_END_0                                             \\\n  if ((EXTRA_SIZE) > 0) {                               \\\n    const int last = (EXTRA_SIZE);                      \\\n    int i;                                              \\\n    for (i = 0; i < last; ++i) pout[i] = pa[i] + pb[i]; \\\n  }                                                     \\\n} while (0)\n\n#define ADD_VECTOR_EQ(A, OUT, SIZE, EXTRA_SIZE)  do {   \\\n  const uint32_t* pa = (const uint32_t*)(A);            \\\n  uint32_t* pout = (uint32_t*)(OUT);                    \\\n  const uint32_t* const LoopEnd = pa + (SIZE);          \\\n  assert((SIZE) % 4 == 0);                              \\\n  ASM_START                                             \\\n  ADD_TO_OUT(0, 4, 8, 12, 0, pa, pout, pout)            \\\n  ASM_END_1                                             \\\n  if ((EXTRA_SIZE) > 0) {                               \\\n    const int last = (EXTRA_SIZE);                      \\\n    int i;                                              \\\n    for (i = 0; i < last; ++i) pout[i] += pa[i];        \\\n  }                                                     \\\n} while (0)\n\nstatic void HistogramAdd(const VP8LHistogram* const a,\n                         const VP8LHistogram* const b,\n                         VP8LHistogram* const out) {\n  uint32_t temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;\n  const int extra_cache_size = VP8LHistogramNumCodes(a->palette_code_bits_)\n                             - (NUM_LITERAL_CODES + NUM_LENGTH_CODES);\n  assert(a->palette_code_bits_ == b->palette_code_bits_);\n\n  if (b != out) {\n    ADD_VECTOR(a->literal_, b->literal_, out->literal_,\n               NUM_LITERAL_CODES + NUM_LENGTH_CODES, extra_cache_size);\n    ADD_VECTOR(a->distance_, b->distance_, out->distance_,\n               NUM_DISTANCE_CODES, 0);\n    ADD_VECTOR(a->red_, b->red_, out->red_, NUM_LITERAL_CODES, 0);\n    ADD_VECTOR(a->blue_, b->blue_, out->blue_, NUM_LITERAL_CODES, 0);\n    ADD_VECTOR(a->alpha_, b->alpha_, out->alpha_, NUM_LITERAL_CODES, 0);\n  } else {\n    ADD_VECTOR_EQ(a->literal_, out->literal_,\n                  NUM_LITERAL_CODES + NUM_LENGTH_CODES, extra_cache_size);\n    ADD_VECTOR_EQ(a->distance_, out->distance_, NUM_DISTANCE_CODES, 0);\n    ADD_VECTOR_EQ(a->red_, out->red_, NUM_LITERAL_CODES, 0);\n    ADD_VECTOR_EQ(a->blue_, out->blue_, NUM_LITERAL_CODES, 0);\n    ADD_VECTOR_EQ(a->alpha_, out->alpha_, NUM_LITERAL_CODES, 0);\n  }\n}\n\n#undef ADD_VECTOR_EQ\n#undef ADD_VECTOR\n#undef ASM_END_1\n#undef ASM_END_0\n#undef ASM_END_COMMON_1\n#undef ASM_END_COMMON_0\n#undef ADD_TO_OUT\n#undef ASM_START\n\n#endif  // WEBP_USE_MIPS32\n\n//------------------------------------------------------------------------------\n// Entry point\n\nextern void VP8LDspInitMIPS32(void);\n\nvoid VP8LDspInitMIPS32(void) {\n#if defined(WEBP_USE_MIPS32)\n  VP8LFastSLog2Slow = FastSLog2Slow;\n  VP8LFastLog2Slow = FastLog2Slow;\n  VP8LExtraCost = ExtraCost;\n  VP8LExtraCostCombined = ExtraCostCombined;\n  VP8LHuffmanCostCount = HuffmanCostCount;\n  VP8LHuffmanCostCombinedCount = HuffmanCostCombinedCount;\n  VP8LHistogramAdd = HistogramAdd;\n#endif  // WEBP_USE_MIPS32\n}\n"
  },
  {
    "path": "ext/libwebp/dsp/lossless_neon.c",
    "content": "// Copyright 2014 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// NEON variant of methods for lossless decoder\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include \"./dsp.h\"\n\n#if defined(WEBP_USE_NEON)\n\n#include <arm_neon.h>\n\n#include \"./lossless.h\"\n#include \"./neon.h\"\n\n//------------------------------------------------------------------------------\n// Colorspace conversion functions\n\n#if !defined(WORK_AROUND_GCC)\n// gcc 4.6.0 had some trouble (NDK-r9) with this code. We only use it for\n// gcc-4.8.x at least.\nstatic void ConvertBGRAToRGBA(const uint32_t* src,\n                              int num_pixels, uint8_t* dst) {\n  const uint32_t* const end = src + (num_pixels & ~15);\n  for (; src < end; src += 16) {\n    uint8x16x4_t pixel = vld4q_u8((uint8_t*)src);\n    // swap B and R. (VSWP d0,d2 has no intrinsics equivalent!)\n    const uint8x16_t tmp = pixel.val[0];\n    pixel.val[0] = pixel.val[2];\n    pixel.val[2] = tmp;\n    vst4q_u8(dst, pixel);\n    dst += 64;\n  }\n  VP8LConvertBGRAToRGBA_C(src, num_pixels & 15, dst);  // left-overs\n}\n\nstatic void ConvertBGRAToBGR(const uint32_t* src,\n                             int num_pixels, uint8_t* dst) {\n  const uint32_t* const end = src + (num_pixels & ~15);\n  for (; src < end; src += 16) {\n    const uint8x16x4_t pixel = vld4q_u8((uint8_t*)src);\n    const uint8x16x3_t tmp = { { pixel.val[0], pixel.val[1], pixel.val[2] } };\n    vst3q_u8(dst, tmp);\n    dst += 48;\n  }\n  VP8LConvertBGRAToBGR_C(src, num_pixels & 15, dst);  // left-overs\n}\n\nstatic void ConvertBGRAToRGB(const uint32_t* src,\n                             int num_pixels, uint8_t* dst) {\n  const uint32_t* const end = src + (num_pixels & ~15);\n  for (; src < end; src += 16) {\n    const uint8x16x4_t pixel = vld4q_u8((uint8_t*)src);\n    const uint8x16x3_t tmp = { { pixel.val[2], pixel.val[1], pixel.val[0] } };\n    vst3q_u8(dst, tmp);\n    dst += 48;\n  }\n  VP8LConvertBGRAToRGB_C(src, num_pixels & 15, dst);  // left-overs\n}\n\n#else  // WORK_AROUND_GCC\n\n// gcc-4.6.0 fallback\n\nstatic const uint8_t kRGBAShuffle[8] = { 2, 1, 0, 3, 6, 5, 4, 7 };\n\nstatic void ConvertBGRAToRGBA(const uint32_t* src,\n                              int num_pixels, uint8_t* dst) {\n  const uint32_t* const end = src + (num_pixels & ~1);\n  const uint8x8_t shuffle = vld1_u8(kRGBAShuffle);\n  for (; src < end; src += 2) {\n    const uint8x8_t pixels = vld1_u8((uint8_t*)src);\n    vst1_u8(dst, vtbl1_u8(pixels, shuffle));\n    dst += 8;\n  }\n  VP8LConvertBGRAToRGBA_C(src, num_pixels & 1, dst);  // left-overs\n}\n\nstatic const uint8_t kBGRShuffle[3][8] = {\n  {  0,  1,  2,  4,  5,  6,  8,  9 },\n  { 10, 12, 13, 14, 16, 17, 18, 20 },\n  { 21, 22, 24, 25, 26, 28, 29, 30 }\n};\n\nstatic void ConvertBGRAToBGR(const uint32_t* src,\n                             int num_pixels, uint8_t* dst) {\n  const uint32_t* const end = src + (num_pixels & ~7);\n  const uint8x8_t shuffle0 = vld1_u8(kBGRShuffle[0]);\n  const uint8x8_t shuffle1 = vld1_u8(kBGRShuffle[1]);\n  const uint8x8_t shuffle2 = vld1_u8(kBGRShuffle[2]);\n  for (; src < end; src += 8) {\n    uint8x8x4_t pixels;\n    INIT_VECTOR4(pixels,\n                 vld1_u8((const uint8_t*)(src + 0)),\n                 vld1_u8((const uint8_t*)(src + 2)),\n                 vld1_u8((const uint8_t*)(src + 4)),\n                 vld1_u8((const uint8_t*)(src + 6)));\n    vst1_u8(dst +  0, vtbl4_u8(pixels, shuffle0));\n    vst1_u8(dst +  8, vtbl4_u8(pixels, shuffle1));\n    vst1_u8(dst + 16, vtbl4_u8(pixels, shuffle2));\n    dst += 8 * 3;\n  }\n  VP8LConvertBGRAToBGR_C(src, num_pixels & 7, dst);  // left-overs\n}\n\nstatic const uint8_t kRGBShuffle[3][8] = {\n  {  2,  1,  0,  6,  5,  4, 10,  9 },\n  {  8, 14, 13, 12, 18, 17, 16, 22 },\n  { 21, 20, 26, 25, 24, 30, 29, 28 }\n};\n\nstatic void ConvertBGRAToRGB(const uint32_t* src,\n                             int num_pixels, uint8_t* dst) {\n  const uint32_t* const end = src + (num_pixels & ~7);\n  const uint8x8_t shuffle0 = vld1_u8(kRGBShuffle[0]);\n  const uint8x8_t shuffle1 = vld1_u8(kRGBShuffle[1]);\n  const uint8x8_t shuffle2 = vld1_u8(kRGBShuffle[2]);\n  for (; src < end; src += 8) {\n    uint8x8x4_t pixels;\n    INIT_VECTOR4(pixels,\n                 vld1_u8((const uint8_t*)(src + 0)),\n                 vld1_u8((const uint8_t*)(src + 2)),\n                 vld1_u8((const uint8_t*)(src + 4)),\n                 vld1_u8((const uint8_t*)(src + 6)));\n    vst1_u8(dst +  0, vtbl4_u8(pixels, shuffle0));\n    vst1_u8(dst +  8, vtbl4_u8(pixels, shuffle1));\n    vst1_u8(dst + 16, vtbl4_u8(pixels, shuffle2));\n    dst += 8 * 3;\n  }\n  VP8LConvertBGRAToRGB_C(src, num_pixels & 7, dst);  // left-overs\n}\n\n#endif   // !WORK_AROUND_GCC\n\n//------------------------------------------------------------------------------\n\n#ifdef USE_INTRINSICS\n\nstatic WEBP_INLINE uint32_t Average2(const uint32_t* const a,\n                                     const uint32_t* const b) {\n  const uint8x8_t a0 = vreinterpret_u8_u64(vcreate_u64(*a));\n  const uint8x8_t b0 = vreinterpret_u8_u64(vcreate_u64(*b));\n  const uint8x8_t avg = vhadd_u8(a0, b0);\n  return vget_lane_u32(vreinterpret_u32_u8(avg), 0);\n}\n\nstatic WEBP_INLINE uint32_t Average3(const uint32_t* const a,\n                                     const uint32_t* const b,\n                                     const uint32_t* const c) {\n  const uint8x8_t a0 = vreinterpret_u8_u64(vcreate_u64(*a));\n  const uint8x8_t b0 = vreinterpret_u8_u64(vcreate_u64(*b));\n  const uint8x8_t c0 = vreinterpret_u8_u64(vcreate_u64(*c));\n  const uint8x8_t avg1 = vhadd_u8(a0, c0);\n  const uint8x8_t avg2 = vhadd_u8(avg1, b0);\n  return vget_lane_u32(vreinterpret_u32_u8(avg2), 0);\n}\n\nstatic WEBP_INLINE uint32_t Average4(const uint32_t* const a,\n                                     const uint32_t* const b,\n                                     const uint32_t* const c,\n                                     const uint32_t* const d) {\n  const uint8x8_t a0 = vreinterpret_u8_u64(vcreate_u64(*a));\n  const uint8x8_t b0 = vreinterpret_u8_u64(vcreate_u64(*b));\n  const uint8x8_t c0 = vreinterpret_u8_u64(vcreate_u64(*c));\n  const uint8x8_t d0 = vreinterpret_u8_u64(vcreate_u64(*d));\n  const uint8x8_t avg1 = vhadd_u8(a0, b0);\n  const uint8x8_t avg2 = vhadd_u8(c0, d0);\n  const uint8x8_t avg3 = vhadd_u8(avg1, avg2);\n  return vget_lane_u32(vreinterpret_u32_u8(avg3), 0);\n}\n\nstatic uint32_t Predictor5(uint32_t left, const uint32_t* const top) {\n  return Average3(&left, top + 0, top + 1);\n}\n\nstatic uint32_t Predictor6(uint32_t left, const uint32_t* const top) {\n  return Average2(&left, top - 1);\n}\n\nstatic uint32_t Predictor7(uint32_t left, const uint32_t* const top) {\n  return Average2(&left, top + 0);\n}\n\nstatic uint32_t Predictor8(uint32_t left, const uint32_t* const top) {\n  (void)left;\n  return Average2(top - 1, top + 0);\n}\n\nstatic uint32_t Predictor9(uint32_t left, const uint32_t* const top) {\n  (void)left;\n  return Average2(top + 0, top + 1);\n}\n\nstatic uint32_t Predictor10(uint32_t left, const uint32_t* const top) {\n  return Average4(&left, top - 1, top + 0, top + 1);\n}\n\n//------------------------------------------------------------------------------\n\nstatic WEBP_INLINE uint32_t Select(const uint32_t* const c0,\n                                   const uint32_t* const c1,\n                                   const uint32_t* const c2) {\n  const uint8x8_t p0 = vreinterpret_u8_u64(vcreate_u64(*c0));\n  const uint8x8_t p1 = vreinterpret_u8_u64(vcreate_u64(*c1));\n  const uint8x8_t p2 = vreinterpret_u8_u64(vcreate_u64(*c2));\n  const uint8x8_t bc = vabd_u8(p1, p2);   // |b-c|\n  const uint8x8_t ac = vabd_u8(p0, p2);   // |a-c|\n  const int16x4_t sum_bc = vreinterpret_s16_u16(vpaddl_u8(bc));\n  const int16x4_t sum_ac = vreinterpret_s16_u16(vpaddl_u8(ac));\n  const int32x2_t diff = vpaddl_s16(vsub_s16(sum_bc, sum_ac));\n  const int32_t pa_minus_pb = vget_lane_s32(diff, 0);\n  return (pa_minus_pb <= 0) ? *c0 : *c1;\n}\n\nstatic uint32_t Predictor11(uint32_t left, const uint32_t* const top) {\n  return Select(top + 0, &left, top - 1);\n}\n\nstatic WEBP_INLINE uint32_t ClampedAddSubtractFull(const uint32_t* const c0,\n                                                   const uint32_t* const c1,\n                                                   const uint32_t* const c2) {\n  const uint8x8_t p0 = vreinterpret_u8_u64(vcreate_u64(*c0));\n  const uint8x8_t p1 = vreinterpret_u8_u64(vcreate_u64(*c1));\n  const uint8x8_t p2 = vreinterpret_u8_u64(vcreate_u64(*c2));\n  const uint16x8_t sum0 = vaddl_u8(p0, p1);                // add and widen\n  const uint16x8_t sum1 = vqsubq_u16(sum0, vmovl_u8(p2));  // widen and subtract\n  const uint8x8_t out = vqmovn_u16(sum1);                  // narrow and clamp\n  return vget_lane_u32(vreinterpret_u32_u8(out), 0);\n}\n\nstatic uint32_t Predictor12(uint32_t left, const uint32_t* const top) {\n  return ClampedAddSubtractFull(&left, top + 0, top - 1);\n}\n\nstatic WEBP_INLINE uint32_t ClampedAddSubtractHalf(const uint32_t* const c0,\n                                                   const uint32_t* const c1,\n                                                   const uint32_t* const c2) {\n  const uint8x8_t p0 = vreinterpret_u8_u64(vcreate_u64(*c0));\n  const uint8x8_t p1 = vreinterpret_u8_u64(vcreate_u64(*c1));\n  const uint8x8_t p2 = vreinterpret_u8_u64(vcreate_u64(*c2));\n  const uint8x8_t avg = vhadd_u8(p0, p1);                  // Average(c0,c1)\n  const uint8x8_t ab = vshr_n_u8(vqsub_u8(avg, p2), 1);    // (a-b)>>1 saturated\n  const uint8x8_t ba = vshr_n_u8(vqsub_u8(p2, avg), 1);    // (b-a)>>1 saturated\n  const uint8x8_t out = vqsub_u8(vqadd_u8(avg, ab), ba);\n  return vget_lane_u32(vreinterpret_u32_u8(out), 0);\n}\n\nstatic uint32_t Predictor13(uint32_t left, const uint32_t* const top) {\n  return ClampedAddSubtractHalf(&left, top + 0, top - 1);\n}\n\n//------------------------------------------------------------------------------\n// Subtract-Green Transform\n\n// vtbl? are unavailable in iOS/arm64 builds.\n#if !defined(__aarch64__)\n\n// 255 = byte will be zero'd\nstatic const uint8_t kGreenShuffle[8] = { 1, 255, 1, 255, 5, 255, 5, 255  };\n\nstatic void SubtractGreenFromBlueAndRed(uint32_t* argb_data, int num_pixels) {\n  const uint32_t* const end = argb_data + (num_pixels & ~3);\n  const uint8x8_t shuffle = vld1_u8(kGreenShuffle);\n  for (; argb_data < end; argb_data += 4) {\n    const uint8x16_t argb = vld1q_u8((uint8_t*)argb_data);\n    const uint8x16_t greens =\n        vcombine_u8(vtbl1_u8(vget_low_u8(argb), shuffle),\n                    vtbl1_u8(vget_high_u8(argb), shuffle));\n    vst1q_u8((uint8_t*)argb_data, vsubq_u8(argb, greens));\n  }\n  // fallthrough and finish off with plain-C\n  VP8LSubtractGreenFromBlueAndRed_C(argb_data, num_pixels & 3);\n}\n\nstatic void AddGreenToBlueAndRed(uint32_t* argb_data, int num_pixels) {\n  const uint32_t* const end = argb_data + (num_pixels & ~3);\n  const uint8x8_t shuffle = vld1_u8(kGreenShuffle);\n  for (; argb_data < end; argb_data += 4) {\n    const uint8x16_t argb = vld1q_u8((uint8_t*)argb_data);\n    const uint8x16_t greens =\n        vcombine_u8(vtbl1_u8(vget_low_u8(argb), shuffle),\n                    vtbl1_u8(vget_high_u8(argb), shuffle));\n    vst1q_u8((uint8_t*)argb_data, vaddq_u8(argb, greens));\n  }\n  // fallthrough and finish off with plain-C\n  VP8LAddGreenToBlueAndRed_C(argb_data, num_pixels & 3);\n}\n\n#endif   // !__aarch64__\n\n#endif   // USE_INTRINSICS\n\n#endif   // WEBP_USE_NEON\n\n//------------------------------------------------------------------------------\n\nextern void VP8LDspInitNEON(void);\n\nvoid VP8LDspInitNEON(void) {\n#if defined(WEBP_USE_NEON)\n  VP8LConvertBGRAToRGBA = ConvertBGRAToRGBA;\n  VP8LConvertBGRAToBGR = ConvertBGRAToBGR;\n  VP8LConvertBGRAToRGB = ConvertBGRAToRGB;\n\n#ifdef USE_INTRINSICS\n  VP8LPredictors[5] = Predictor5;\n  VP8LPredictors[6] = Predictor6;\n  VP8LPredictors[7] = Predictor7;\n  VP8LPredictors[8] = Predictor8;\n  VP8LPredictors[9] = Predictor9;\n  VP8LPredictors[10] = Predictor10;\n  VP8LPredictors[11] = Predictor11;\n  VP8LPredictors[12] = Predictor12;\n  VP8LPredictors[13] = Predictor13;\n\n#if !defined(__aarch64__)\n  VP8LSubtractGreenFromBlueAndRed = SubtractGreenFromBlueAndRed;\n  VP8LAddGreenToBlueAndRed = AddGreenToBlueAndRed;\n#endif\n#endif\n\n#endif   // WEBP_USE_NEON\n}\n\n//------------------------------------------------------------------------------\n"
  },
  {
    "path": "ext/libwebp/dsp/lossless_sse2.c",
    "content": "// Copyright 2014 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// SSE2 variant of methods for lossless decoder\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include \"./dsp.h\"\n\n#include <assert.h>\n\n#if defined(WEBP_USE_SSE2)\n#include <emmintrin.h>\n#include \"./lossless.h\"\n\n//------------------------------------------------------------------------------\n// Predictor Transform\n\nstatic WEBP_INLINE uint32_t ClampedAddSubtractFull(uint32_t c0, uint32_t c1,\n                                                   uint32_t c2) {\n  const __m128i zero = _mm_setzero_si128();\n  const __m128i C0 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(c0), zero);\n  const __m128i C1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(c1), zero);\n  const __m128i C2 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(c2), zero);\n  const __m128i V1 = _mm_add_epi16(C0, C1);\n  const __m128i V2 = _mm_sub_epi16(V1, C2);\n  const __m128i b = _mm_packus_epi16(V2, V2);\n  const uint32_t output = _mm_cvtsi128_si32(b);\n  return output;\n}\n\nstatic WEBP_INLINE uint32_t ClampedAddSubtractHalf(uint32_t c0, uint32_t c1,\n                                                   uint32_t c2) {\n  const __m128i zero = _mm_setzero_si128();\n  const __m128i C0 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(c0), zero);\n  const __m128i C1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(c1), zero);\n  const __m128i B0 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(c2), zero);\n  const __m128i avg = _mm_add_epi16(C1, C0);\n  const __m128i A0 = _mm_srli_epi16(avg, 1);\n  const __m128i A1 = _mm_sub_epi16(A0, B0);\n  const __m128i BgtA = _mm_cmpgt_epi16(B0, A0);\n  const __m128i A2 = _mm_sub_epi16(A1, BgtA);\n  const __m128i A3 = _mm_srai_epi16(A2, 1);\n  const __m128i A4 = _mm_add_epi16(A0, A3);\n  const __m128i A5 = _mm_packus_epi16(A4, A4);\n  const uint32_t output = _mm_cvtsi128_si32(A5);\n  return output;\n}\n\nstatic WEBP_INLINE uint32_t Select(uint32_t a, uint32_t b, uint32_t c) {\n  int pa_minus_pb;\n  const __m128i zero = _mm_setzero_si128();\n  const __m128i A0 = _mm_cvtsi32_si128(a);\n  const __m128i B0 = _mm_cvtsi32_si128(b);\n  const __m128i C0 = _mm_cvtsi32_si128(c);\n  const __m128i AC0 = _mm_subs_epu8(A0, C0);\n  const __m128i CA0 = _mm_subs_epu8(C0, A0);\n  const __m128i BC0 = _mm_subs_epu8(B0, C0);\n  const __m128i CB0 = _mm_subs_epu8(C0, B0);\n  const __m128i AC = _mm_or_si128(AC0, CA0);\n  const __m128i BC = _mm_or_si128(BC0, CB0);\n  const __m128i pa = _mm_unpacklo_epi8(AC, zero);  // |a - c|\n  const __m128i pb = _mm_unpacklo_epi8(BC, zero);  // |b - c|\n  const __m128i diff = _mm_sub_epi16(pb, pa);\n  {\n    int16_t out[8];\n    _mm_storeu_si128((__m128i*)out, diff);\n    pa_minus_pb = out[0] + out[1] + out[2] + out[3];\n  }\n  return (pa_minus_pb <= 0) ? a : b;\n}\n\nstatic WEBP_INLINE __m128i Average2_128i(uint32_t a0, uint32_t a1) {\n  const __m128i zero = _mm_setzero_si128();\n  const __m128i A0 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(a0), zero);\n  const __m128i A1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(a1), zero);\n  const __m128i sum = _mm_add_epi16(A1, A0);\n  const __m128i avg = _mm_srli_epi16(sum, 1);\n  return avg;\n}\n\nstatic WEBP_INLINE uint32_t Average2(uint32_t a0, uint32_t a1) {\n  const __m128i avg = Average2_128i(a0, a1);\n  const __m128i A2 = _mm_packus_epi16(avg, avg);\n  const uint32_t output = _mm_cvtsi128_si32(A2);\n  return output;\n}\n\nstatic WEBP_INLINE uint32_t Average3(uint32_t a0, uint32_t a1, uint32_t a2) {\n  const __m128i zero = _mm_setzero_si128();\n  const __m128i avg1 = Average2_128i(a0, a2);\n  const __m128i A1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(a1), zero);\n  const __m128i sum = _mm_add_epi16(avg1, A1);\n  const __m128i avg2 = _mm_srli_epi16(sum, 1);\n  const __m128i A2 = _mm_packus_epi16(avg2, avg2);\n  const uint32_t output = _mm_cvtsi128_si32(A2);\n  return output;\n}\n\nstatic WEBP_INLINE uint32_t Average4(uint32_t a0, uint32_t a1,\n                                     uint32_t a2, uint32_t a3) {\n  const __m128i avg1 = Average2_128i(a0, a1);\n  const __m128i avg2 = Average2_128i(a2, a3);\n  const __m128i sum = _mm_add_epi16(avg2, avg1);\n  const __m128i avg3 = _mm_srli_epi16(sum, 1);\n  const __m128i A0 = _mm_packus_epi16(avg3, avg3);\n  const uint32_t output = _mm_cvtsi128_si32(A0);\n  return output;\n}\n\nstatic uint32_t Predictor5(uint32_t left, const uint32_t* const top) {\n  const uint32_t pred = Average3(left, top[0], top[1]);\n  return pred;\n}\nstatic uint32_t Predictor6(uint32_t left, const uint32_t* const top) {\n  const uint32_t pred = Average2(left, top[-1]);\n  return pred;\n}\nstatic uint32_t Predictor7(uint32_t left, const uint32_t* const top) {\n  const uint32_t pred = Average2(left, top[0]);\n  return pred;\n}\nstatic uint32_t Predictor8(uint32_t left, const uint32_t* const top) {\n  const uint32_t pred = Average2(top[-1], top[0]);\n  (void)left;\n  return pred;\n}\nstatic uint32_t Predictor9(uint32_t left, const uint32_t* const top) {\n  const uint32_t pred = Average2(top[0], top[1]);\n  (void)left;\n  return pred;\n}\nstatic uint32_t Predictor10(uint32_t left, const uint32_t* const top) {\n  const uint32_t pred = Average4(left, top[-1], top[0], top[1]);\n  return pred;\n}\nstatic uint32_t Predictor11(uint32_t left, const uint32_t* const top) {\n  const uint32_t pred = Select(top[0], left, top[-1]);\n  return pred;\n}\nstatic uint32_t Predictor12(uint32_t left, const uint32_t* const top) {\n  const uint32_t pred = ClampedAddSubtractFull(left, top[0], top[-1]);\n  return pred;\n}\nstatic uint32_t Predictor13(uint32_t left, const uint32_t* const top) {\n  const uint32_t pred = ClampedAddSubtractHalf(left, top[0], top[-1]);\n  return pred;\n}\n\n//------------------------------------------------------------------------------\n// Subtract-Green Transform\n\nstatic void SubtractGreenFromBlueAndRed(uint32_t* argb_data, int num_pixels) {\n  const __m128i mask = _mm_set1_epi32(0x0000ff00);\n  int i;\n  for (i = 0; i + 4 <= num_pixels; i += 4) {\n    const __m128i in = _mm_loadu_si128((__m128i*)&argb_data[i]);\n    const __m128i in_00g0 = _mm_and_si128(in, mask);     // 00g0|00g0|...\n    const __m128i in_0g00 = _mm_slli_epi32(in_00g0, 8);  // 0g00|0g00|...\n    const __m128i in_000g = _mm_srli_epi32(in_00g0, 8);  // 000g|000g|...\n    const __m128i in_0g0g = _mm_or_si128(in_0g00, in_000g);\n    const __m128i out = _mm_sub_epi8(in, in_0g0g);\n    _mm_storeu_si128((__m128i*)&argb_data[i], out);\n  }\n  // fallthrough and finish off with plain-C\n  VP8LSubtractGreenFromBlueAndRed_C(argb_data + i, num_pixels - i);\n}\n\nstatic void AddGreenToBlueAndRed(uint32_t* argb_data, int num_pixels) {\n  const __m128i mask = _mm_set1_epi32(0x0000ff00);\n  int i;\n  for (i = 0; i + 4 <= num_pixels; i += 4) {\n    const __m128i in = _mm_loadu_si128((__m128i*)&argb_data[i]);\n    const __m128i in_00g0 = _mm_and_si128(in, mask);     // 00g0|00g0|...\n    const __m128i in_0g00 = _mm_slli_epi32(in_00g0, 8);  // 0g00|0g00|...\n    const __m128i in_000g = _mm_srli_epi32(in_00g0, 8);  // 000g|000g|...\n    const __m128i in_0g0g = _mm_or_si128(in_0g00, in_000g);\n    const __m128i out = _mm_add_epi8(in, in_0g0g);\n    _mm_storeu_si128((__m128i*)&argb_data[i], out);\n  }\n  // fallthrough and finish off with plain-C\n  VP8LAddGreenToBlueAndRed_C(argb_data + i, num_pixels - i);\n}\n\n//------------------------------------------------------------------------------\n// Color Transform\n\nstatic WEBP_INLINE __m128i ColorTransformDelta(__m128i color_pred,\n                                               __m128i color) {\n  // We simulate signed 8-bit multiplication as:\n  // * Left shift the two (8-bit) numbers by 8 bits,\n  // * Perform a 16-bit signed multiplication and retain the higher 16-bits.\n  const __m128i color_pred_shifted = _mm_slli_epi32(color_pred, 8);\n  const __m128i color_shifted = _mm_slli_epi32(color, 8);\n  // Note: This performs multiplication on 8 packed 16-bit numbers, 4 of which\n  // happen to be zeroes.\n  const __m128i signed_mult =\n      _mm_mulhi_epi16(color_pred_shifted, color_shifted);\n  return _mm_srli_epi32(signed_mult, 5);\n}\n\nstatic WEBP_INLINE void TransformColor(const VP8LMultipliers* const m,\n                                       uint32_t* argb_data,\n                                       int num_pixels) {\n  const __m128i g_to_r = _mm_set1_epi32(m->green_to_red_);       // multipliers\n  const __m128i g_to_b = _mm_set1_epi32(m->green_to_blue_);\n  const __m128i r_to_b = _mm_set1_epi32(m->red_to_blue_);\n\n  int i;\n\n  for (i = 0; i + 4 <= num_pixels; i += 4) {\n    const __m128i in = _mm_loadu_si128((__m128i*)&argb_data[i]);\n    const __m128i alpha_green_mask = _mm_set1_epi32(0xff00ff00);  // masks\n    const __m128i red_mask = _mm_set1_epi32(0x00ff0000);\n    const __m128i green_mask = _mm_set1_epi32(0x0000ff00);\n    const __m128i lower_8bit_mask  = _mm_set1_epi32(0x000000ff);\n    const __m128i ag = _mm_and_si128(in, alpha_green_mask);      // alpha, green\n    const __m128i r = _mm_srli_epi32(_mm_and_si128(in, red_mask), 16);\n    const __m128i g = _mm_srli_epi32(_mm_and_si128(in, green_mask), 8);\n    const __m128i b = in;\n\n    const __m128i r_delta = ColorTransformDelta(g_to_r, g);      // red\n    const __m128i r_new =\n        _mm_and_si128(_mm_sub_epi32(r, r_delta), lower_8bit_mask);\n    const __m128i r_new_shifted = _mm_slli_epi32(r_new, 16);\n\n    const __m128i b_delta_1 = ColorTransformDelta(g_to_b, g);    // blue\n    const __m128i b_delta_2 = ColorTransformDelta(r_to_b, r);\n    const __m128i b_delta = _mm_add_epi32(b_delta_1, b_delta_2);\n    const __m128i b_new =\n        _mm_and_si128(_mm_sub_epi32(b, b_delta), lower_8bit_mask);\n\n    const __m128i out = _mm_or_si128(_mm_or_si128(ag, r_new_shifted), b_new);\n    _mm_storeu_si128((__m128i*)&argb_data[i], out);\n  }\n\n  // Fall-back to C-version for left-overs.\n  VP8LTransformColor_C(m, argb_data + i, num_pixels - i);\n}\n\nstatic WEBP_INLINE void TransformColorInverse(const VP8LMultipliers* const m,\n                                              uint32_t* argb_data,\n                                              int num_pixels) {\n  const __m128i g_to_r = _mm_set1_epi32(m->green_to_red_);       // multipliers\n  const __m128i g_to_b = _mm_set1_epi32(m->green_to_blue_);\n  const __m128i r_to_b = _mm_set1_epi32(m->red_to_blue_);\n\n  int i;\n\n  for (i = 0; i + 4 <= num_pixels; i += 4) {\n    const __m128i in = _mm_loadu_si128((__m128i*)&argb_data[i]);\n    const __m128i alpha_green_mask = _mm_set1_epi32(0xff00ff00);  // masks\n    const __m128i red_mask = _mm_set1_epi32(0x00ff0000);\n    const __m128i green_mask = _mm_set1_epi32(0x0000ff00);\n    const __m128i lower_8bit_mask  = _mm_set1_epi32(0x000000ff);\n    const __m128i ag = _mm_and_si128(in, alpha_green_mask);      // alpha, green\n    const __m128i r = _mm_srli_epi32(_mm_and_si128(in, red_mask), 16);\n    const __m128i g = _mm_srli_epi32(_mm_and_si128(in, green_mask), 8);\n    const __m128i b = in;\n\n    const __m128i r_delta = ColorTransformDelta(g_to_r, g);      // red\n    const __m128i r_new =\n        _mm_and_si128(_mm_add_epi32(r, r_delta), lower_8bit_mask);\n    const __m128i r_new_shifted = _mm_slli_epi32(r_new, 16);\n\n    const __m128i b_delta_1 = ColorTransformDelta(g_to_b, g);    // blue\n    const __m128i b_delta_2 = ColorTransformDelta(r_to_b, r_new);\n    const __m128i b_delta = _mm_add_epi32(b_delta_1, b_delta_2);\n    const __m128i b_new =\n        _mm_and_si128(_mm_add_epi32(b, b_delta), lower_8bit_mask);\n\n    const __m128i out = _mm_or_si128(_mm_or_si128(ag, r_new_shifted), b_new);\n    _mm_storeu_si128((__m128i*)&argb_data[i], out);\n  }\n\n  // Fall-back to C-version for left-overs.\n  VP8LTransformColorInverse_C(m, argb_data + i, num_pixels - i);\n}\n\n//------------------------------------------------------------------------------\n// Color-space conversion functions\n\nstatic void ConvertBGRAToRGBA(const uint32_t* src,\n                              int num_pixels, uint8_t* dst) {\n  const __m128i* in = (const __m128i*)src;\n  __m128i* out = (__m128i*)dst;\n  while (num_pixels >= 8) {\n    const __m128i bgra0 = _mm_loadu_si128(in++);     // bgra0|bgra1|bgra2|bgra3\n    const __m128i bgra4 = _mm_loadu_si128(in++);     // bgra4|bgra5|bgra6|bgra7\n    const __m128i v0l = _mm_unpacklo_epi8(bgra0, bgra4);  // b0b4g0g4r0r4a0a4...\n    const __m128i v0h = _mm_unpackhi_epi8(bgra0, bgra4);  // b2b6g2g6r2r6a2a6...\n    const __m128i v1l = _mm_unpacklo_epi8(v0l, v0h);   // b0b2b4b6g0g2g4g6...\n    const __m128i v1h = _mm_unpackhi_epi8(v0l, v0h);   // b1b3b5b7g1g3g5g7...\n    const __m128i v2l = _mm_unpacklo_epi8(v1l, v1h);   // b0...b7 | g0...g7\n    const __m128i v2h = _mm_unpackhi_epi8(v1l, v1h);   // r0...r7 | a0...a7\n    const __m128i ga0 = _mm_unpackhi_epi64(v2l, v2h);  // g0...g7 | a0...a7\n    const __m128i rb0 = _mm_unpacklo_epi64(v2h, v2l);  // r0...r7 | b0...b7\n    const __m128i rg0 = _mm_unpacklo_epi8(rb0, ga0);   // r0g0r1g1 ... r6g6r7g7\n    const __m128i ba0 = _mm_unpackhi_epi8(rb0, ga0);   // b0a0b1a1 ... b6a6b7a7\n    const __m128i rgba0 = _mm_unpacklo_epi16(rg0, ba0);  // rgba0|rgba1...\n    const __m128i rgba4 = _mm_unpackhi_epi16(rg0, ba0);  // rgba4|rgba5...\n    _mm_storeu_si128(out++, rgba0);\n    _mm_storeu_si128(out++, rgba4);\n    num_pixels -= 8;\n  }\n  // left-overs\n  VP8LConvertBGRAToRGBA_C((const uint32_t*)in, num_pixels, (uint8_t*)out);\n}\n\nstatic void ConvertBGRAToRGBA4444(const uint32_t* src,\n                                  int num_pixels, uint8_t* dst) {\n  const __m128i mask_0x0f = _mm_set1_epi8(0x0f);\n  const __m128i mask_0xf0 = _mm_set1_epi8(0xf0);\n  const __m128i* in = (const __m128i*)src;\n  __m128i* out = (__m128i*)dst;\n  while (num_pixels >= 8) {\n    const __m128i bgra0 = _mm_loadu_si128(in++);     // bgra0|bgra1|bgra2|bgra3\n    const __m128i bgra4 = _mm_loadu_si128(in++);     // bgra4|bgra5|bgra6|bgra7\n    const __m128i v0l = _mm_unpacklo_epi8(bgra0, bgra4);  // b0b4g0g4r0r4a0a4...\n    const __m128i v0h = _mm_unpackhi_epi8(bgra0, bgra4);  // b2b6g2g6r2r6a2a6...\n    const __m128i v1l = _mm_unpacklo_epi8(v0l, v0h);    // b0b2b4b6g0g2g4g6...\n    const __m128i v1h = _mm_unpackhi_epi8(v0l, v0h);    // b1b3b5b7g1g3g5g7...\n    const __m128i v2l = _mm_unpacklo_epi8(v1l, v1h);    // b0...b7 | g0...g7\n    const __m128i v2h = _mm_unpackhi_epi8(v1l, v1h);    // r0...r7 | a0...a7\n    const __m128i ga0 = _mm_unpackhi_epi64(v2l, v2h);   // g0...g7 | a0...a7\n    const __m128i rb0 = _mm_unpacklo_epi64(v2h, v2l);   // r0...r7 | b0...b7\n    const __m128i ga1 = _mm_srli_epi16(ga0, 4);         // g0-|g1-|...|a6-|a7-\n    const __m128i rb1 = _mm_and_si128(rb0, mask_0xf0);  // -r0|-r1|...|-b6|-a7\n    const __m128i ga2 = _mm_and_si128(ga1, mask_0x0f);  // g0-|g1-|...|a6-|a7-\n    const __m128i rgba0 = _mm_or_si128(ga2, rb1);       // rg0..rg7 | ba0..ba7\n    const __m128i rgba1 = _mm_srli_si128(rgba0, 8);     // ba0..ba7 | 0\n#ifdef WEBP_SWAP_16BIT_CSP\n    const __m128i rgba = _mm_unpacklo_epi8(rgba1, rgba0);  // barg0...barg7\n#else\n    const __m128i rgba = _mm_unpacklo_epi8(rgba0, rgba1);  // rgba0...rgba7\n#endif\n    _mm_storeu_si128(out++, rgba);\n    num_pixels -= 8;\n  }\n  // left-overs\n  VP8LConvertBGRAToRGBA4444_C((const uint32_t*)in, num_pixels, (uint8_t*)out);\n}\n\nstatic void ConvertBGRAToRGB565(const uint32_t* src,\n                                int num_pixels, uint8_t* dst) {\n  const __m128i mask_0xe0 = _mm_set1_epi8(0xe0);\n  const __m128i mask_0xf8 = _mm_set1_epi8(0xf8);\n  const __m128i mask_0x07 = _mm_set1_epi8(0x07);\n  const __m128i* in = (const __m128i*)src;\n  __m128i* out = (__m128i*)dst;\n  while (num_pixels >= 8) {\n    const __m128i bgra0 = _mm_loadu_si128(in++);     // bgra0|bgra1|bgra2|bgra3\n    const __m128i bgra4 = _mm_loadu_si128(in++);     // bgra4|bgra5|bgra6|bgra7\n    const __m128i v0l = _mm_unpacklo_epi8(bgra0, bgra4);  // b0b4g0g4r0r4a0a4...\n    const __m128i v0h = _mm_unpackhi_epi8(bgra0, bgra4);  // b2b6g2g6r2r6a2a6...\n    const __m128i v1l = _mm_unpacklo_epi8(v0l, v0h);      // b0b2b4b6g0g2g4g6...\n    const __m128i v1h = _mm_unpackhi_epi8(v0l, v0h);      // b1b3b5b7g1g3g5g7...\n    const __m128i v2l = _mm_unpacklo_epi8(v1l, v1h);      // b0...b7 | g0...g7\n    const __m128i v2h = _mm_unpackhi_epi8(v1l, v1h);      // r0...r7 | a0...a7\n    const __m128i ga0 = _mm_unpackhi_epi64(v2l, v2h);     // g0...g7 | a0...a7\n    const __m128i rb0 = _mm_unpacklo_epi64(v2h, v2l);     // r0...r7 | b0...b7\n    const __m128i rb1 = _mm_and_si128(rb0, mask_0xf8);    // -r0..-r7|-b0..-b7\n    const __m128i g_lo1 = _mm_srli_epi16(ga0, 5);\n    const __m128i g_lo2 = _mm_and_si128(g_lo1, mask_0x07);  // g0-...g7-|xx (3b)\n    const __m128i g_hi1 = _mm_slli_epi16(ga0, 3);\n    const __m128i g_hi2 = _mm_and_si128(g_hi1, mask_0xe0);  // -g0...-g7|xx (3b)\n    const __m128i b0 = _mm_srli_si128(rb1, 8);              // -b0...-b7|0\n    const __m128i rg1 = _mm_or_si128(rb1, g_lo2);           // gr0...gr7|xx\n    const __m128i b1 = _mm_srli_epi16(b0, 3);\n    const __m128i gb1 = _mm_or_si128(b1, g_hi2);            // bg0...bg7|xx\n#ifdef WEBP_SWAP_16BIT_CSP\n    const __m128i rgba = _mm_unpacklo_epi8(gb1, rg1);     // rggb0...rggb7\n#else\n    const __m128i rgba = _mm_unpacklo_epi8(rg1, gb1);     // bgrb0...bgrb7\n#endif\n    _mm_storeu_si128(out++, rgba);\n    num_pixels -= 8;\n  }\n  // left-overs\n  VP8LConvertBGRAToRGB565_C((const uint32_t*)in, num_pixels, (uint8_t*)out);\n}\n\nstatic void ConvertBGRAToBGR(const uint32_t* src,\n                             int num_pixels, uint8_t* dst) {\n  const __m128i mask_l = _mm_set_epi32(0, 0x00ffffff, 0, 0x00ffffff);\n  const __m128i mask_h = _mm_set_epi32(0x00ffffff, 0, 0x00ffffff, 0);\n  const __m128i* in = (const __m128i*)src;\n  const uint8_t* const end = dst + num_pixels * 3;\n  // the last storel_epi64 below writes 8 bytes starting at offset 18\n  while (dst + 26 <= end) {\n    const __m128i bgra0 = _mm_loadu_si128(in++);     // bgra0|bgra1|bgra2|bgra3\n    const __m128i bgra4 = _mm_loadu_si128(in++);     // bgra4|bgra5|bgra6|bgra7\n    const __m128i a0l = _mm_and_si128(bgra0, mask_l);   // bgr0|0|bgr0|0\n    const __m128i a4l = _mm_and_si128(bgra4, mask_l);   // bgr0|0|bgr0|0\n    const __m128i a0h = _mm_and_si128(bgra0, mask_h);   // 0|bgr0|0|bgr0\n    const __m128i a4h = _mm_and_si128(bgra4, mask_h);   // 0|bgr0|0|bgr0\n    const __m128i b0h = _mm_srli_epi64(a0h, 8);         // 000b|gr00|000b|gr00\n    const __m128i b4h = _mm_srli_epi64(a4h, 8);         // 000b|gr00|000b|gr00\n    const __m128i c0 = _mm_or_si128(a0l, b0h);          // rgbrgb00|rgbrgb00\n    const __m128i c4 = _mm_or_si128(a4l, b4h);          // rgbrgb00|rgbrgb00\n    const __m128i c2 = _mm_srli_si128(c0, 8);\n    const __m128i c6 = _mm_srli_si128(c4, 8);\n    _mm_storel_epi64((__m128i*)(dst +   0), c0);\n    _mm_storel_epi64((__m128i*)(dst +   6), c2);\n    _mm_storel_epi64((__m128i*)(dst +  12), c4);\n    _mm_storel_epi64((__m128i*)(dst +  18), c6);\n    dst += 24;\n    num_pixels -= 8;\n  }\n  // left-overs\n  VP8LConvertBGRAToBGR_C((const uint32_t*)in, num_pixels, dst);\n}\n\n//------------------------------------------------------------------------------\n\n#define LINE_SIZE 16    // 8 or 16\nstatic void AddVector(const uint32_t* a, const uint32_t* b, uint32_t* out,\n                      int size) {\n  int i;\n  assert(size % LINE_SIZE == 0);\n  for (i = 0; i < size; i += LINE_SIZE) {\n    const __m128i a0 = _mm_loadu_si128((__m128i*)&a[i +  0]);\n    const __m128i a1 = _mm_loadu_si128((__m128i*)&a[i +  4]);\n#if (LINE_SIZE == 16)\n    const __m128i a2 = _mm_loadu_si128((__m128i*)&a[i +  8]);\n    const __m128i a3 = _mm_loadu_si128((__m128i*)&a[i + 12]);\n#endif\n    const __m128i b0 = _mm_loadu_si128((__m128i*)&b[i +  0]);\n    const __m128i b1 = _mm_loadu_si128((__m128i*)&b[i +  4]);\n#if (LINE_SIZE == 16)\n    const __m128i b2 = _mm_loadu_si128((__m128i*)&b[i +  8]);\n    const __m128i b3 = _mm_loadu_si128((__m128i*)&b[i + 12]);\n#endif\n    _mm_storeu_si128((__m128i*)&out[i +  0], _mm_add_epi32(a0, b0));\n    _mm_storeu_si128((__m128i*)&out[i +  4], _mm_add_epi32(a1, b1));\n#if (LINE_SIZE == 16)\n    _mm_storeu_si128((__m128i*)&out[i +  8], _mm_add_epi32(a2, b2));\n    _mm_storeu_si128((__m128i*)&out[i + 12], _mm_add_epi32(a3, b3));\n#endif\n  }\n}\n\nstatic void AddVectorEq(const uint32_t* a, uint32_t* out, int size) {\n  int i;\n  assert(size % LINE_SIZE == 0);\n  for (i = 0; i < size; i += LINE_SIZE) {\n    const __m128i a0 = _mm_loadu_si128((__m128i*)&a[i +  0]);\n    const __m128i a1 = _mm_loadu_si128((__m128i*)&a[i +  4]);\n#if (LINE_SIZE == 16)\n    const __m128i a2 = _mm_loadu_si128((__m128i*)&a[i +  8]);\n    const __m128i a3 = _mm_loadu_si128((__m128i*)&a[i + 12]);\n#endif\n    const __m128i b0 = _mm_loadu_si128((__m128i*)&out[i +  0]);\n    const __m128i b1 = _mm_loadu_si128((__m128i*)&out[i +  4]);\n#if (LINE_SIZE == 16)\n    const __m128i b2 = _mm_loadu_si128((__m128i*)&out[i +  8]);\n    const __m128i b3 = _mm_loadu_si128((__m128i*)&out[i + 12]);\n#endif\n    _mm_storeu_si128((__m128i*)&out[i +  0], _mm_add_epi32(a0, b0));\n    _mm_storeu_si128((__m128i*)&out[i +  4], _mm_add_epi32(a1, b1));\n#if (LINE_SIZE == 16)\n    _mm_storeu_si128((__m128i*)&out[i +  8], _mm_add_epi32(a2, b2));\n    _mm_storeu_si128((__m128i*)&out[i + 12], _mm_add_epi32(a3, b3));\n#endif\n  }\n}\n#undef LINE_SIZE\n\n// Note we are adding uint32_t's as *signed* int32's (using _mm_add_epi32). But\n// that's ok since the histogram values are less than 1<<28 (max picture size).\nstatic void HistogramAdd(const VP8LHistogram* const a,\n                         const VP8LHistogram* const b,\n                         VP8LHistogram* const out) {\n  int i;\n  const int literal_size = VP8LHistogramNumCodes(a->palette_code_bits_);\n  assert(a->palette_code_bits_ == b->palette_code_bits_);\n  if (b != out) {\n    AddVector(a->literal_, b->literal_, out->literal_, NUM_LITERAL_CODES);\n    AddVector(a->red_, b->red_, out->red_, NUM_LITERAL_CODES);\n    AddVector(a->blue_, b->blue_, out->blue_, NUM_LITERAL_CODES);\n    AddVector(a->alpha_, b->alpha_, out->alpha_, NUM_LITERAL_CODES);\n  } else {\n    AddVectorEq(a->literal_, out->literal_, NUM_LITERAL_CODES);\n    AddVectorEq(a->red_, out->red_, NUM_LITERAL_CODES);\n    AddVectorEq(a->blue_, out->blue_, NUM_LITERAL_CODES);\n    AddVectorEq(a->alpha_, out->alpha_, NUM_LITERAL_CODES);\n  }\n  for (i = NUM_LITERAL_CODES; i < literal_size; ++i) {\n    out->literal_[i] = a->literal_[i] + b->literal_[i];\n  }\n  for (i = 0; i < NUM_DISTANCE_CODES; ++i) {\n    out->distance_[i] = a->distance_[i] + b->distance_[i];\n  }\n}\n\n#endif   // WEBP_USE_SSE2\n\n//------------------------------------------------------------------------------\n\nextern void VP8LDspInitSSE2(void);\n\nvoid VP8LDspInitSSE2(void) {\n#if defined(WEBP_USE_SSE2)\n  VP8LPredictors[5] = Predictor5;\n  VP8LPredictors[6] = Predictor6;\n  VP8LPredictors[7] = Predictor7;\n  VP8LPredictors[8] = Predictor8;\n  VP8LPredictors[9] = Predictor9;\n  VP8LPredictors[10] = Predictor10;\n  VP8LPredictors[11] = Predictor11;\n  VP8LPredictors[12] = Predictor12;\n  VP8LPredictors[13] = Predictor13;\n\n  VP8LSubtractGreenFromBlueAndRed = SubtractGreenFromBlueAndRed;\n  VP8LAddGreenToBlueAndRed = AddGreenToBlueAndRed;\n\n  VP8LTransformColor = TransformColor;\n  VP8LTransformColorInverse = TransformColorInverse;\n\n  VP8LConvertBGRAToRGBA = ConvertBGRAToRGBA;\n  VP8LConvertBGRAToRGBA4444 = ConvertBGRAToRGBA4444;\n  VP8LConvertBGRAToRGB565 = ConvertBGRAToRGB565;\n  VP8LConvertBGRAToBGR = ConvertBGRAToBGR;\n\n  VP8LHistogramAdd = HistogramAdd;\n#endif   // WEBP_USE_SSE2\n}\n\n//------------------------------------------------------------------------------\n"
  },
  {
    "path": "ext/libwebp/dsp/neon.h",
    "content": "// Copyright 2014 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n//  NEON common code.\n\n#ifndef WEBP_DSP_NEON_H_\n#define WEBP_DSP_NEON_H_\n\n#include <arm_neon.h>\n\n#include \"./dsp.h\"\n\n// Right now, some intrinsics functions seem slower, so we disable them\n// everywhere except aarch64 where the inline assembly is incompatible.\n#if defined(__aarch64__)\n#define USE_INTRINSICS   // use intrinsics when possible\n#endif\n\n#define INIT_VECTOR2(v, a, b) do {  \\\n  v.val[0] = a;                     \\\n  v.val[1] = b;                     \\\n} while (0)\n\n#define INIT_VECTOR3(v, a, b, c) do {  \\\n  v.val[0] = a;                        \\\n  v.val[1] = b;                        \\\n  v.val[2] = c;                        \\\n} while (0)\n\n#define INIT_VECTOR4(v, a, b, c, d) do {  \\\n  v.val[0] = a;                           \\\n  v.val[1] = b;                           \\\n  v.val[2] = c;                           \\\n  v.val[3] = d;                           \\\n} while (0)\n\n// if using intrinsics, this flag avoids some functions that make gcc-4.6.3\n// crash (\"internal compiler error: in immed_double_const, at emit-rtl.\").\n// (probably similar to gcc.gnu.org/bugzilla/show_bug.cgi?id=48183)\n#if !(LOCAL_GCC_PREREQ(4,8) || defined(__aarch64__))\n#define WORK_AROUND_GCC\n#endif\n\nstatic WEBP_INLINE int32x4x4_t Transpose4x4(const int32x4x4_t rows) {\n  uint64x2x2_t row01, row23;\n\n  row01.val[0] = vreinterpretq_u64_s32(rows.val[0]);\n  row01.val[1] = vreinterpretq_u64_s32(rows.val[1]);\n  row23.val[0] = vreinterpretq_u64_s32(rows.val[2]);\n  row23.val[1] = vreinterpretq_u64_s32(rows.val[3]);\n  // Transpose 64-bit values (there's no vswp equivalent)\n  {\n    const uint64x1_t row0h = vget_high_u64(row01.val[0]);\n    const uint64x1_t row2l = vget_low_u64(row23.val[0]);\n    const uint64x1_t row1h = vget_high_u64(row01.val[1]);\n    const uint64x1_t row3l = vget_low_u64(row23.val[1]);\n    row01.val[0] = vcombine_u64(vget_low_u64(row01.val[0]), row2l);\n    row23.val[0] = vcombine_u64(row0h, vget_high_u64(row23.val[0]));\n    row01.val[1] = vcombine_u64(vget_low_u64(row01.val[1]), row3l);\n    row23.val[1] = vcombine_u64(row1h, vget_high_u64(row23.val[1]));\n  }\n  {\n    const int32x4x2_t out01 = vtrnq_s32(vreinterpretq_s32_u64(row01.val[0]),\n                                        vreinterpretq_s32_u64(row01.val[1]));\n    const int32x4x2_t out23 = vtrnq_s32(vreinterpretq_s32_u64(row23.val[0]),\n                                        vreinterpretq_s32_u64(row23.val[1]));\n    int32x4x4_t out;\n    out.val[0] = out01.val[0];\n    out.val[1] = out01.val[1];\n    out.val[2] = out23.val[0];\n    out.val[3] = out23.val[1];\n    return out;\n  }\n}\n\n#endif  // WEBP_DSP_NEON_H_\n"
  },
  {
    "path": "ext/libwebp/dsp/upsampling.c",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// YUV to RGB upsampling functions.\n//\n// Author: somnath@google.com (Somnath Banerjee)\n\n#include \"./dsp.h\"\n#include \"./yuv.h\"\n\n#include <assert.h>\n\n//------------------------------------------------------------------------------\n// Fancy upsampler\n\n#ifdef FANCY_UPSAMPLING\n\n// Fancy upsampling functions to convert YUV to RGB\nWebPUpsampleLinePairFunc WebPUpsamplers[MODE_LAST];\n\n// Given samples laid out in a square as:\n//  [a b]\n//  [c d]\n// we interpolate u/v as:\n//  ([9*a + 3*b + 3*c +   d    3*a + 9*b + 3*c +   d] + [8 8]) / 16\n//  ([3*a +   b + 9*c + 3*d      a + 3*b + 3*c + 9*d]   [8 8]) / 16\n\n// We process u and v together stashed into 32bit (16bit each).\n#define LOAD_UV(u, v) ((u) | ((v) << 16))\n\n#define UPSAMPLE_FUNC(FUNC_NAME, FUNC, XSTEP)                                  \\\nstatic void FUNC_NAME(const uint8_t* top_y, const uint8_t* bottom_y,           \\\n                      const uint8_t* top_u, const uint8_t* top_v,              \\\n                      const uint8_t* cur_u, const uint8_t* cur_v,              \\\n                      uint8_t* top_dst, uint8_t* bottom_dst, int len) {        \\\n  int x;                                                                       \\\n  const int last_pixel_pair = (len - 1) >> 1;                                  \\\n  uint32_t tl_uv = LOAD_UV(top_u[0], top_v[0]);   /* top-left sample */        \\\n  uint32_t l_uv  = LOAD_UV(cur_u[0], cur_v[0]);   /* left-sample */            \\\n  assert(top_y != NULL);                                                       \\\n  {                                                                            \\\n    const uint32_t uv0 = (3 * tl_uv + l_uv + 0x00020002u) >> 2;                \\\n    FUNC(top_y[0], uv0 & 0xff, (uv0 >> 16), top_dst);                          \\\n  }                                                                            \\\n  if (bottom_y != NULL) {                                                      \\\n    const uint32_t uv0 = (3 * l_uv + tl_uv + 0x00020002u) >> 2;                \\\n    FUNC(bottom_y[0], uv0 & 0xff, (uv0 >> 16), bottom_dst);                    \\\n  }                                                                            \\\n  for (x = 1; x <= last_pixel_pair; ++x) {                                     \\\n    const uint32_t t_uv = LOAD_UV(top_u[x], top_v[x]);  /* top sample */       \\\n    const uint32_t uv   = LOAD_UV(cur_u[x], cur_v[x]);  /* sample */           \\\n    /* precompute invariant values associated with first and second diagonals*/\\\n    const uint32_t avg = tl_uv + t_uv + l_uv + uv + 0x00080008u;               \\\n    const uint32_t diag_12 = (avg + 2 * (t_uv + l_uv)) >> 3;                   \\\n    const uint32_t diag_03 = (avg + 2 * (tl_uv + uv)) >> 3;                    \\\n    {                                                                          \\\n      const uint32_t uv0 = (diag_12 + tl_uv) >> 1;                             \\\n      const uint32_t uv1 = (diag_03 + t_uv) >> 1;                              \\\n      FUNC(top_y[2 * x - 1], uv0 & 0xff, (uv0 >> 16),                          \\\n           top_dst + (2 * x - 1) * XSTEP);                                     \\\n      FUNC(top_y[2 * x - 0], uv1 & 0xff, (uv1 >> 16),                          \\\n           top_dst + (2 * x - 0) * XSTEP);                                     \\\n    }                                                                          \\\n    if (bottom_y != NULL) {                                                    \\\n      const uint32_t uv0 = (diag_03 + l_uv) >> 1;                              \\\n      const uint32_t uv1 = (diag_12 + uv) >> 1;                                \\\n      FUNC(bottom_y[2 * x - 1], uv0 & 0xff, (uv0 >> 16),                       \\\n           bottom_dst + (2 * x - 1) * XSTEP);                                  \\\n      FUNC(bottom_y[2 * x + 0], uv1 & 0xff, (uv1 >> 16),                       \\\n           bottom_dst + (2 * x + 0) * XSTEP);                                  \\\n    }                                                                          \\\n    tl_uv = t_uv;                                                              \\\n    l_uv = uv;                                                                 \\\n  }                                                                            \\\n  if (!(len & 1)) {                                                            \\\n    {                                                                          \\\n      const uint32_t uv0 = (3 * tl_uv + l_uv + 0x00020002u) >> 2;              \\\n      FUNC(top_y[len - 1], uv0 & 0xff, (uv0 >> 16),                            \\\n           top_dst + (len - 1) * XSTEP);                                       \\\n    }                                                                          \\\n    if (bottom_y != NULL) {                                                    \\\n      const uint32_t uv0 = (3 * l_uv + tl_uv + 0x00020002u) >> 2;              \\\n      FUNC(bottom_y[len - 1], uv0 & 0xff, (uv0 >> 16),                         \\\n           bottom_dst + (len - 1) * XSTEP);                                    \\\n    }                                                                          \\\n  }                                                                            \\\n}\n\n// All variants implemented.\nUPSAMPLE_FUNC(UpsampleRgbLinePair,  VP8YuvToRgb,  3)\nUPSAMPLE_FUNC(UpsampleBgrLinePair,  VP8YuvToBgr,  3)\nUPSAMPLE_FUNC(UpsampleRgbaLinePair, VP8YuvToRgba, 4)\nUPSAMPLE_FUNC(UpsampleBgraLinePair, VP8YuvToBgra, 4)\nUPSAMPLE_FUNC(UpsampleArgbLinePair, VP8YuvToArgb, 4)\nUPSAMPLE_FUNC(UpsampleRgba4444LinePair, VP8YuvToRgba4444, 2)\nUPSAMPLE_FUNC(UpsampleRgb565LinePair,  VP8YuvToRgb565,  2)\n\n#undef LOAD_UV\n#undef UPSAMPLE_FUNC\n\n#endif  // FANCY_UPSAMPLING\n\n//------------------------------------------------------------------------------\n\n#if !defined(FANCY_UPSAMPLING)\n#define DUAL_SAMPLE_FUNC(FUNC_NAME, FUNC)                                      \\\nstatic void FUNC_NAME(const uint8_t* top_y, const uint8_t* bot_y,              \\\n                      const uint8_t* top_u, const uint8_t* top_v,              \\\n                      const uint8_t* bot_u, const uint8_t* bot_v,              \\\n                      uint8_t* top_dst, uint8_t* bot_dst, int len) {           \\\n  const int half_len = len >> 1;                                               \\\n  int x;                                                                       \\\n  assert(top_dst != NULL);                                                     \\\n  {                                                                            \\\n    for (x = 0; x < half_len; ++x) {                                           \\\n      FUNC(top_y[2 * x + 0], top_u[x], top_v[x], top_dst + 8 * x + 0);         \\\n      FUNC(top_y[2 * x + 1], top_u[x], top_v[x], top_dst + 8 * x + 4);         \\\n    }                                                                          \\\n    if (len & 1) FUNC(top_y[2 * x + 0], top_u[x], top_v[x], top_dst + 8 * x);  \\\n  }                                                                            \\\n  if (bot_dst != NULL) {                                                       \\\n    for (x = 0; x < half_len; ++x) {                                           \\\n      FUNC(bot_y[2 * x + 0], bot_u[x], bot_v[x], bot_dst + 8 * x + 0);         \\\n      FUNC(bot_y[2 * x + 1], bot_u[x], bot_v[x], bot_dst + 8 * x + 4);         \\\n    }                                                                          \\\n    if (len & 1) FUNC(bot_y[2 * x + 0], bot_u[x], bot_v[x], bot_dst + 8 * x);  \\\n  }                                                                            \\\n}\n\nDUAL_SAMPLE_FUNC(DualLineSamplerBGRA, VP8YuvToBgra)\nDUAL_SAMPLE_FUNC(DualLineSamplerARGB, VP8YuvToArgb)\n#undef DUAL_SAMPLE_FUNC\n\n#endif  // !FANCY_UPSAMPLING\n\nWebPUpsampleLinePairFunc WebPGetLinePairConverter(int alpha_is_last) {\n  WebPInitUpsamplers();\n  VP8YUVInit();\n#ifdef FANCY_UPSAMPLING\n  return WebPUpsamplers[alpha_is_last ? MODE_BGRA : MODE_ARGB];\n#else\n  return (alpha_is_last ? DualLineSamplerBGRA : DualLineSamplerARGB);\n#endif\n}\n\n//------------------------------------------------------------------------------\n// YUV444 converter\n\n#define YUV444_FUNC(FUNC_NAME, FUNC, XSTEP)                                    \\\nstatic void FUNC_NAME(const uint8_t* y, const uint8_t* u, const uint8_t* v,    \\\n                      uint8_t* dst, int len) {                                 \\\n  int i;                                                                       \\\n  for (i = 0; i < len; ++i) FUNC(y[i], u[i], v[i], &dst[i * XSTEP]);           \\\n}\n\nYUV444_FUNC(Yuv444ToRgb,      VP8YuvToRgb,  3)\nYUV444_FUNC(Yuv444ToBgr,      VP8YuvToBgr,  3)\nYUV444_FUNC(Yuv444ToRgba,     VP8YuvToRgba, 4)\nYUV444_FUNC(Yuv444ToBgra,     VP8YuvToBgra, 4)\nYUV444_FUNC(Yuv444ToArgb,     VP8YuvToArgb, 4)\nYUV444_FUNC(Yuv444ToRgba4444, VP8YuvToRgba4444, 2)\nYUV444_FUNC(Yuv444ToRgb565,   VP8YuvToRgb565, 2)\n\n#undef YUV444_FUNC\n\nconst WebPYUV444Converter WebPYUV444Converters[MODE_LAST] = {\n  Yuv444ToRgb,       // MODE_RGB\n  Yuv444ToRgba,      // MODE_RGBA\n  Yuv444ToBgr,       // MODE_BGR\n  Yuv444ToBgra,      // MODE_BGRA\n  Yuv444ToArgb,      // MODE_ARGB\n  Yuv444ToRgba4444,  // MODE_RGBA_4444\n  Yuv444ToRgb565,    // MODE_RGB_565\n  Yuv444ToRgba,      // MODE_rgbA\n  Yuv444ToBgra,      // MODE_bgrA\n  Yuv444ToArgb,      // MODE_Argb\n  Yuv444ToRgba4444   // MODE_rgbA_4444\n};\n\n//------------------------------------------------------------------------------\n// Main calls\n\nextern void WebPInitUpsamplersSSE2(void);\nextern void WebPInitUpsamplersNEON(void);\n\nvoid WebPInitUpsamplers(void) {\n#ifdef FANCY_UPSAMPLING\n  WebPUpsamplers[MODE_RGB]       = UpsampleRgbLinePair;\n  WebPUpsamplers[MODE_RGBA]      = UpsampleRgbaLinePair;\n  WebPUpsamplers[MODE_BGR]       = UpsampleBgrLinePair;\n  WebPUpsamplers[MODE_BGRA]      = UpsampleBgraLinePair;\n  WebPUpsamplers[MODE_ARGB]      = UpsampleArgbLinePair;\n  WebPUpsamplers[MODE_RGBA_4444] = UpsampleRgba4444LinePair;\n  WebPUpsamplers[MODE_RGB_565]   = UpsampleRgb565LinePair;\n  WebPUpsamplers[MODE_rgbA]      = UpsampleRgbaLinePair;\n  WebPUpsamplers[MODE_bgrA]      = UpsampleBgraLinePair;\n  WebPUpsamplers[MODE_Argb]      = UpsampleArgbLinePair;\n  WebPUpsamplers[MODE_rgbA_4444] = UpsampleRgba4444LinePair;\n\n  // If defined, use CPUInfo() to overwrite some pointers with faster versions.\n  if (VP8GetCPUInfo != NULL) {\n#if defined(WEBP_USE_SSE2)\n    if (VP8GetCPUInfo(kSSE2)) {\n      WebPInitUpsamplersSSE2();\n    }\n#endif\n#if defined(WEBP_USE_NEON)\n    if (VP8GetCPUInfo(kNEON)) {\n      WebPInitUpsamplersNEON();\n    }\n#endif\n  }\n#endif  // FANCY_UPSAMPLING\n}\n\n//------------------------------------------------------------------------------\n"
  },
  {
    "path": "ext/libwebp/dsp/upsampling_neon.c",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// NEON version of YUV to RGB upsampling functions.\n//\n// Author: mans@mansr.com (Mans Rullgard)\n// Based on SSE code by: somnath@google.com (Somnath Banerjee)\n\n#include \"./dsp.h\"\n\n#if defined(WEBP_USE_NEON)\n\n#include <assert.h>\n#include <arm_neon.h>\n#include <string.h>\n#include \"./neon.h\"\n#include \"./yuv.h\"\n\n#ifdef FANCY_UPSAMPLING\n\n//-----------------------------------------------------------------------------\n// U/V upsampling\n\n// Loads 9 pixels each from rows r1 and r2 and generates 16 pixels.\n#define UPSAMPLE_16PIXELS(r1, r2, out) {                                \\\n  uint8x8_t a = vld1_u8(r1);                                            \\\n  uint8x8_t b = vld1_u8(r1 + 1);                                        \\\n  uint8x8_t c = vld1_u8(r2);                                            \\\n  uint8x8_t d = vld1_u8(r2 + 1);                                        \\\n                                                                        \\\n  uint16x8_t al = vshll_n_u8(a, 1);                                     \\\n  uint16x8_t bl = vshll_n_u8(b, 1);                                     \\\n  uint16x8_t cl = vshll_n_u8(c, 1);                                     \\\n  uint16x8_t dl = vshll_n_u8(d, 1);                                     \\\n                                                                        \\\n  uint8x8_t diag1, diag2;                                               \\\n  uint16x8_t sl;                                                        \\\n                                                                        \\\n  /* a + b + c + d */                                                   \\\n  sl = vaddl_u8(a,  b);                                                 \\\n  sl = vaddw_u8(sl, c);                                                 \\\n  sl = vaddw_u8(sl, d);                                                 \\\n                                                                        \\\n  al = vaddq_u16(sl, al); /* 3a +  b +  c +  d */                       \\\n  bl = vaddq_u16(sl, bl); /*  a + 3b +  c +  d */                       \\\n                                                                        \\\n  al = vaddq_u16(al, dl); /* 3a +  b +  c + 3d */                       \\\n  bl = vaddq_u16(bl, cl); /*  a + 3b + 3c +  d */                       \\\n                                                                        \\\n  diag2 = vshrn_n_u16(al, 3);                                           \\\n  diag1 = vshrn_n_u16(bl, 3);                                           \\\n                                                                        \\\n  a = vrhadd_u8(a, diag1);                                              \\\n  b = vrhadd_u8(b, diag2);                                              \\\n  c = vrhadd_u8(c, diag2);                                              \\\n  d = vrhadd_u8(d, diag1);                                              \\\n                                                                        \\\n  {                                                                     \\\n    uint8x8x2_t a_b, c_d;                                               \\\n    INIT_VECTOR2(a_b, a, b);                                            \\\n    INIT_VECTOR2(c_d, c, d);                                            \\\n    vst2_u8(out,      a_b);                                             \\\n    vst2_u8(out + 32, c_d);                                             \\\n  }                                                                     \\\n}\n\n// Turn the macro into a function for reducing code-size when non-critical\nstatic void Upsample16Pixels(const uint8_t *r1, const uint8_t *r2,\n                             uint8_t *out) {\n  UPSAMPLE_16PIXELS(r1, r2, out);\n}\n\n#define UPSAMPLE_LAST_BLOCK(tb, bb, num_pixels, out) {                  \\\n  uint8_t r1[9], r2[9];                                                 \\\n  memcpy(r1, (tb), (num_pixels));                                       \\\n  memcpy(r2, (bb), (num_pixels));                                       \\\n  /* replicate last byte */                                             \\\n  memset(r1 + (num_pixels), r1[(num_pixels) - 1], 9 - (num_pixels));    \\\n  memset(r2 + (num_pixels), r2[(num_pixels) - 1], 9 - (num_pixels));    \\\n  Upsample16Pixels(r1, r2, out);                                        \\\n}\n\n//-----------------------------------------------------------------------------\n// YUV->RGB conversion\n\nstatic const int16_t kCoeffs[4] = { kYScale, kVToR, kUToG, kVToG };\n\n#define v255 vdup_n_u8(255)\n\n#define STORE_Rgb(out, r, g, b) do {                                    \\\n  uint8x8x3_t r_g_b;                                                    \\\n  INIT_VECTOR3(r_g_b, r, g, b);                                         \\\n  vst3_u8(out, r_g_b);                                                  \\\n} while (0)\n\n#define STORE_Bgr(out, r, g, b) do {                                    \\\n  uint8x8x3_t b_g_r;                                                    \\\n  INIT_VECTOR3(b_g_r, b, g, r);                                         \\\n  vst3_u8(out, b_g_r);                                                  \\\n} while (0)\n\n#define STORE_Rgba(out, r, g, b) do {                                   \\\n  uint8x8x4_t r_g_b_v255;                                               \\\n  INIT_VECTOR4(r_g_b_v255, r, g, b, v255);                              \\\n  vst4_u8(out, r_g_b_v255);                                             \\\n} while (0)\n\n#define STORE_Bgra(out, r, g, b) do {                                   \\\n  uint8x8x4_t b_g_r_v255;                                               \\\n  INIT_VECTOR4(b_g_r_v255, b, g, r, v255);                              \\\n  vst4_u8(out, b_g_r_v255);                                             \\\n} while (0)\n\n#define CONVERT8(FMT, XSTEP, N, src_y, src_uv, out, cur_x) {            \\\n  int i;                                                                \\\n  for (i = 0; i < N; i += 8) {                                          \\\n    const int off = ((cur_x) + i) * XSTEP;                              \\\n    uint8x8_t y  = vld1_u8((src_y) + (cur_x)  + i);                     \\\n    uint8x8_t u  = vld1_u8((src_uv) + i);                               \\\n    uint8x8_t v  = vld1_u8((src_uv) + i + 16);                          \\\n    const int16x8_t yy = vreinterpretq_s16_u16(vsubl_u8(y, u16));       \\\n    const int16x8_t uu = vreinterpretq_s16_u16(vsubl_u8(u, u128));      \\\n    const int16x8_t vv = vreinterpretq_s16_u16(vsubl_u8(v, u128));      \\\n    int32x4_t yl = vmull_lane_s16(vget_low_s16(yy),  cf16, 0);          \\\n    int32x4_t yh = vmull_lane_s16(vget_high_s16(yy), cf16, 0);          \\\n    const int32x4_t rl = vmlal_lane_s16(yl, vget_low_s16(vv),  cf16, 1);\\\n    const int32x4_t rh = vmlal_lane_s16(yh, vget_high_s16(vv), cf16, 1);\\\n    int32x4_t gl = vmlsl_lane_s16(yl, vget_low_s16(uu),  cf16, 2);      \\\n    int32x4_t gh = vmlsl_lane_s16(yh, vget_high_s16(uu), cf16, 2);      \\\n    const int32x4_t bl = vmovl_s16(vget_low_s16(uu));                   \\\n    const int32x4_t bh = vmovl_s16(vget_high_s16(uu));                  \\\n    gl = vmlsl_lane_s16(gl, vget_low_s16(vv),  cf16, 3);                \\\n    gh = vmlsl_lane_s16(gh, vget_high_s16(vv), cf16, 3);                \\\n    yl = vmlaq_lane_s32(yl, bl, cf32, 0);                               \\\n    yh = vmlaq_lane_s32(yh, bh, cf32, 0);                               \\\n    /* vrshrn_n_s32() already incorporates the rounding constant */     \\\n    y = vqmovun_s16(vcombine_s16(vrshrn_n_s32(rl, YUV_FIX2),            \\\n                                 vrshrn_n_s32(rh, YUV_FIX2)));          \\\n    u = vqmovun_s16(vcombine_s16(vrshrn_n_s32(gl, YUV_FIX2),            \\\n                                 vrshrn_n_s32(gh, YUV_FIX2)));          \\\n    v = vqmovun_s16(vcombine_s16(vrshrn_n_s32(yl, YUV_FIX2),            \\\n                                 vrshrn_n_s32(yh, YUV_FIX2)));          \\\n    STORE_ ## FMT(out + off, y, u, v);                                  \\\n  }                                                                     \\\n}\n\n#define CONVERT1(FUNC, XSTEP, N, src_y, src_uv, rgb, cur_x) {           \\\n  int i;                                                                \\\n  for (i = 0; i < N; i++) {                                             \\\n    const int off = ((cur_x) + i) * XSTEP;                              \\\n    const int y = src_y[(cur_x) + i];                                   \\\n    const int u = (src_uv)[i];                                          \\\n    const int v = (src_uv)[i + 16];                                     \\\n    FUNC(y, u, v, rgb + off);                                           \\\n  }                                                                     \\\n}\n\n#define CONVERT2RGB_8(FMT, XSTEP, top_y, bottom_y, uv,                  \\\n                      top_dst, bottom_dst, cur_x, len) {                \\\n  CONVERT8(FMT, XSTEP, len, top_y, uv, top_dst, cur_x)                  \\\n  if (bottom_y != NULL) {                                               \\\n    CONVERT8(FMT, XSTEP, len, bottom_y, (uv) + 32, bottom_dst, cur_x)   \\\n  }                                                                     \\\n}\n\n#define CONVERT2RGB_1(FUNC, XSTEP, top_y, bottom_y, uv,                 \\\n                      top_dst, bottom_dst, cur_x, len) {                \\\n  CONVERT1(FUNC, XSTEP, len, top_y, uv, top_dst, cur_x);                \\\n  if (bottom_y != NULL) {                                               \\\n    CONVERT1(FUNC, XSTEP, len, bottom_y, (uv) + 32, bottom_dst, cur_x); \\\n  }                                                                     \\\n}\n\n#define NEON_UPSAMPLE_FUNC(FUNC_NAME, FMT, XSTEP)                       \\\nstatic void FUNC_NAME(const uint8_t *top_y, const uint8_t *bottom_y,    \\\n                      const uint8_t *top_u, const uint8_t *top_v,       \\\n                      const uint8_t *cur_u, const uint8_t *cur_v,       \\\n                      uint8_t *top_dst, uint8_t *bottom_dst, int len) { \\\n  int block;                                                            \\\n  /* 16 byte aligned array to cache reconstructed u and v */            \\\n  uint8_t uv_buf[2 * 32 + 15];                                          \\\n  uint8_t *const r_uv = (uint8_t*)((uintptr_t)(uv_buf + 15) & ~15);     \\\n  const int uv_len = (len + 1) >> 1;                                    \\\n  /* 9 pixels must be read-able for each block */                       \\\n  const int num_blocks = (uv_len - 1) >> 3;                             \\\n  const int leftover = uv_len - num_blocks * 8;                         \\\n  const int last_pos = 1 + 16 * num_blocks;                             \\\n                                                                        \\\n  const int u_diag = ((top_u[0] + cur_u[0]) >> 1) + 1;                  \\\n  const int v_diag = ((top_v[0] + cur_v[0]) >> 1) + 1;                  \\\n                                                                        \\\n  const int16x4_t cf16 = vld1_s16(kCoeffs);                             \\\n  const int32x2_t cf32 = vdup_n_s32(kUToB);                             \\\n  const uint8x8_t u16  = vdup_n_u8(16);                                 \\\n  const uint8x8_t u128 = vdup_n_u8(128);                                \\\n                                                                        \\\n  /* Treat the first pixel in regular way */                            \\\n  assert(top_y != NULL);                                                \\\n  {                                                                     \\\n    const int u0 = (top_u[0] + u_diag) >> 1;                            \\\n    const int v0 = (top_v[0] + v_diag) >> 1;                            \\\n    VP8YuvTo ## FMT(top_y[0], u0, v0, top_dst);                         \\\n  }                                                                     \\\n  if (bottom_y != NULL) {                                               \\\n    const int u0 = (cur_u[0] + u_diag) >> 1;                            \\\n    const int v0 = (cur_v[0] + v_diag) >> 1;                            \\\n    VP8YuvTo ## FMT(bottom_y[0], u0, v0, bottom_dst);                   \\\n  }                                                                     \\\n                                                                        \\\n  for (block = 0; block < num_blocks; ++block) {                        \\\n    UPSAMPLE_16PIXELS(top_u, cur_u, r_uv);                              \\\n    UPSAMPLE_16PIXELS(top_v, cur_v, r_uv + 16);                         \\\n    CONVERT2RGB_8(FMT, XSTEP, top_y, bottom_y, r_uv,                    \\\n                  top_dst, bottom_dst, 16 * block + 1, 16);             \\\n    top_u += 8;                                                         \\\n    cur_u += 8;                                                         \\\n    top_v += 8;                                                         \\\n    cur_v += 8;                                                         \\\n  }                                                                     \\\n                                                                        \\\n  UPSAMPLE_LAST_BLOCK(top_u, cur_u, leftover, r_uv);                    \\\n  UPSAMPLE_LAST_BLOCK(top_v, cur_v, leftover, r_uv + 16);               \\\n  CONVERT2RGB_1(VP8YuvTo ## FMT, XSTEP, top_y, bottom_y, r_uv,          \\\n                top_dst, bottom_dst, last_pos, len - last_pos);         \\\n}\n\n// NEON variants of the fancy upsampler.\nNEON_UPSAMPLE_FUNC(UpsampleRgbLinePair,  Rgb,  3)\nNEON_UPSAMPLE_FUNC(UpsampleBgrLinePair,  Bgr,  3)\nNEON_UPSAMPLE_FUNC(UpsampleRgbaLinePair, Rgba, 4)\nNEON_UPSAMPLE_FUNC(UpsampleBgraLinePair, Bgra, 4)\n\n#endif  // FANCY_UPSAMPLING\n\n#endif   // WEBP_USE_NEON\n\n//------------------------------------------------------------------------------\n\nextern void WebPInitUpsamplersNEON(void);\n\n#ifdef FANCY_UPSAMPLING\n\nextern WebPUpsampleLinePairFunc WebPUpsamplers[/* MODE_LAST */];\n\nvoid WebPInitUpsamplersNEON(void) {\n#if defined(WEBP_USE_NEON)\n  WebPUpsamplers[MODE_RGB]  = UpsampleRgbLinePair;\n  WebPUpsamplers[MODE_RGBA] = UpsampleRgbaLinePair;\n  WebPUpsamplers[MODE_BGR]  = UpsampleBgrLinePair;\n  WebPUpsamplers[MODE_BGRA] = UpsampleBgraLinePair;\n  WebPUpsamplers[MODE_rgbA] = UpsampleRgbaLinePair;\n  WebPUpsamplers[MODE_bgrA] = UpsampleBgraLinePair;\n#endif   // WEBP_USE_NEON\n}\n\n#else\n\n// this empty function is to avoid an empty .o\nvoid WebPInitUpsamplersNEON(void) {}\n\n#endif  // FANCY_UPSAMPLING\n"
  },
  {
    "path": "ext/libwebp/dsp/upsampling_sse2.c",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// SSE2 version of YUV to RGB upsampling functions.\n//\n// Author: somnath@google.com (Somnath Banerjee)\n\n#include \"./dsp.h\"\n\n#if defined(WEBP_USE_SSE2)\n\n#include <assert.h>\n#include <emmintrin.h>\n#include <string.h>\n#include \"./yuv.h\"\n\n#ifdef FANCY_UPSAMPLING\n\n// We compute (9*a + 3*b + 3*c + d + 8) / 16 as follows\n// u = (9*a + 3*b + 3*c + d + 8) / 16\n//   = (a + (a + 3*b + 3*c + d) / 8 + 1) / 2\n//   = (a + m + 1) / 2\n// where m = (a + 3*b + 3*c + d) / 8\n//         = ((a + b + c + d) / 2 + b + c) / 4\n//\n// Let's say  k = (a + b + c + d) / 4.\n// We can compute k as\n// k = (s + t + 1) / 2 - ((a^d) | (b^c) | (s^t)) & 1\n// where s = (a + d + 1) / 2 and t = (b + c + 1) / 2\n//\n// Then m can be written as\n// m = (k + t + 1) / 2 - (((b^c) & (s^t)) | (k^t)) & 1\n\n// Computes out = (k + in + 1) / 2 - ((ij & (s^t)) | (k^in)) & 1\n#define GET_M(ij, in, out) do {                                                \\\n  const __m128i tmp0 = _mm_avg_epu8(k, (in));     /* (k + in + 1) / 2 */       \\\n  const __m128i tmp1 = _mm_and_si128((ij), st);   /* (ij) & (s^t) */           \\\n  const __m128i tmp2 = _mm_xor_si128(k, (in));    /* (k^in) */                 \\\n  const __m128i tmp3 = _mm_or_si128(tmp1, tmp2);  /* ((ij) & (s^t)) | (k^in) */\\\n  const __m128i tmp4 = _mm_and_si128(tmp3, one);  /* & 1 -> lsb_correction */  \\\n  (out) = _mm_sub_epi8(tmp0, tmp4);    /* (k + in + 1) / 2 - lsb_correction */ \\\n} while (0)\n\n// pack and store two alternating pixel rows\n#define PACK_AND_STORE(a, b, da, db, out) do {                                 \\\n  const __m128i t_a = _mm_avg_epu8(a, da);  /* (9a + 3b + 3c +  d + 8) / 16 */ \\\n  const __m128i t_b = _mm_avg_epu8(b, db);  /* (3a + 9b +  c + 3d + 8) / 16 */ \\\n  const __m128i t_1 = _mm_unpacklo_epi8(t_a, t_b);                             \\\n  const __m128i t_2 = _mm_unpackhi_epi8(t_a, t_b);                             \\\n  _mm_store_si128(((__m128i*)(out)) + 0, t_1);                                 \\\n  _mm_store_si128(((__m128i*)(out)) + 1, t_2);                                 \\\n} while (0)\n\n// Loads 17 pixels each from rows r1 and r2 and generates 32 pixels.\n#define UPSAMPLE_32PIXELS(r1, r2, out) {                                       \\\n  const __m128i one = _mm_set1_epi8(1);                                        \\\n  const __m128i a = _mm_loadu_si128((__m128i*)&(r1)[0]);                       \\\n  const __m128i b = _mm_loadu_si128((__m128i*)&(r1)[1]);                       \\\n  const __m128i c = _mm_loadu_si128((__m128i*)&(r2)[0]);                       \\\n  const __m128i d = _mm_loadu_si128((__m128i*)&(r2)[1]);                       \\\n                                                                               \\\n  const __m128i s = _mm_avg_epu8(a, d);        /* s = (a + d + 1) / 2 */       \\\n  const __m128i t = _mm_avg_epu8(b, c);        /* t = (b + c + 1) / 2 */       \\\n  const __m128i st = _mm_xor_si128(s, t);      /* st = s^t */                  \\\n                                                                               \\\n  const __m128i ad = _mm_xor_si128(a, d);      /* ad = a^d */                  \\\n  const __m128i bc = _mm_xor_si128(b, c);      /* bc = b^c */                  \\\n                                                                               \\\n  const __m128i t1 = _mm_or_si128(ad, bc);     /* (a^d) | (b^c) */             \\\n  const __m128i t2 = _mm_or_si128(t1, st);     /* (a^d) | (b^c) | (s^t) */     \\\n  const __m128i t3 = _mm_and_si128(t2, one);   /* (a^d) | (b^c) | (s^t) & 1 */ \\\n  const __m128i t4 = _mm_avg_epu8(s, t);                                       \\\n  const __m128i k = _mm_sub_epi8(t4, t3);      /* k = (a + b + c + d) / 4 */   \\\n  __m128i diag1, diag2;                                                        \\\n                                                                               \\\n  GET_M(bc, t, diag1);                  /* diag1 = (a + 3b + 3c + d) / 8 */    \\\n  GET_M(ad, s, diag2);                  /* diag2 = (3a + b + c + 3d) / 8 */    \\\n                                                                               \\\n  /* pack the alternate pixels */                                              \\\n  PACK_AND_STORE(a, b, diag1, diag2, out +      0);  /* store top */           \\\n  PACK_AND_STORE(c, d, diag2, diag1, out + 2 * 32);  /* store bottom */        \\\n}\n\n// Turn the macro into a function for reducing code-size when non-critical\nstatic void Upsample32Pixels(const uint8_t r1[], const uint8_t r2[],\n                             uint8_t* const out) {\n  UPSAMPLE_32PIXELS(r1, r2, out);\n}\n\n#define UPSAMPLE_LAST_BLOCK(tb, bb, num_pixels, out) {                         \\\n  uint8_t r1[17], r2[17];                                                      \\\n  memcpy(r1, (tb), (num_pixels));                                              \\\n  memcpy(r2, (bb), (num_pixels));                                              \\\n  /* replicate last byte */                                                    \\\n  memset(r1 + (num_pixels), r1[(num_pixels) - 1], 17 - (num_pixels));          \\\n  memset(r2 + (num_pixels), r2[(num_pixels) - 1], 17 - (num_pixels));          \\\n  /* using the shared function instead of the macro saves ~3k code size */     \\\n  Upsample32Pixels(r1, r2, out);                                               \\\n}\n\n#define CONVERT2RGB(FUNC, XSTEP, top_y, bottom_y,                              \\\n                    top_dst, bottom_dst, cur_x, num_pixels) {                  \\\n  int n;                                                                       \\\n  for (n = 0; n < (num_pixels); ++n) {                                         \\\n    FUNC(top_y[(cur_x) + n], r_u[n], r_v[n],                                   \\\n         top_dst + ((cur_x) + n) * XSTEP);                                     \\\n  }                                                                            \\\n  if (bottom_y != NULL) {                                                      \\\n    for (n = 0; n < (num_pixels); ++n) {                                       \\\n      FUNC(bottom_y[(cur_x) + n], r_u[64 + n], r_v[64 + n],                    \\\n           bottom_dst + ((cur_x) + n) * XSTEP);                                \\\n    }                                                                          \\\n  }                                                                            \\\n}\n\n#define CONVERT2RGB_32(FUNC, XSTEP, top_y, bottom_y,                           \\\n                       top_dst, bottom_dst, cur_x) do {                        \\\n  FUNC##32(top_y + (cur_x), r_u, r_v, top_dst + (cur_x) * XSTEP);              \\\n  if (bottom_y != NULL) {                                                      \\\n    FUNC##32(bottom_y + (cur_x), r_u + 64, r_v + 64,                           \\\n             bottom_dst + (cur_x) * XSTEP);                                    \\\n  }                                                                            \\\n} while (0)\n\n#define SSE2_UPSAMPLE_FUNC(FUNC_NAME, FUNC, XSTEP)                             \\\nstatic void FUNC_NAME(const uint8_t* top_y, const uint8_t* bottom_y,           \\\n                      const uint8_t* top_u, const uint8_t* top_v,              \\\n                      const uint8_t* cur_u, const uint8_t* cur_v,              \\\n                      uint8_t* top_dst, uint8_t* bottom_dst, int len) {        \\\n  int uv_pos, pos;                                                             \\\n  /* 16byte-aligned array to cache reconstructed u and v */                    \\\n  uint8_t uv_buf[4 * 32 + 15];                                                 \\\n  uint8_t* const r_u = (uint8_t*)((uintptr_t)(uv_buf + 15) & ~15);             \\\n  uint8_t* const r_v = r_u + 32;                                               \\\n                                                                               \\\n  assert(top_y != NULL);                                                       \\\n  {   /* Treat the first pixel in regular way */                               \\\n    const int u_diag = ((top_u[0] + cur_u[0]) >> 1) + 1;                       \\\n    const int v_diag = ((top_v[0] + cur_v[0]) >> 1) + 1;                       \\\n    const int u0_t = (top_u[0] + u_diag) >> 1;                                 \\\n    const int v0_t = (top_v[0] + v_diag) >> 1;                                 \\\n    FUNC(top_y[0], u0_t, v0_t, top_dst);                                       \\\n    if (bottom_y != NULL) {                                                    \\\n      const int u0_b = (cur_u[0] + u_diag) >> 1;                               \\\n      const int v0_b = (cur_v[0] + v_diag) >> 1;                               \\\n      FUNC(bottom_y[0], u0_b, v0_b, bottom_dst);                               \\\n    }                                                                          \\\n  }                                                                            \\\n  /* For UPSAMPLE_32PIXELS, 17 u/v values must be read-able for each block */  \\\n  for (pos = 1, uv_pos = 0; pos + 32 + 1 <= len; pos += 32, uv_pos += 16) {    \\\n    UPSAMPLE_32PIXELS(top_u + uv_pos, cur_u + uv_pos, r_u);                    \\\n    UPSAMPLE_32PIXELS(top_v + uv_pos, cur_v + uv_pos, r_v);                    \\\n    CONVERT2RGB_32(FUNC, XSTEP, top_y, bottom_y, top_dst, bottom_dst, pos);    \\\n  }                                                                            \\\n  if (len > 1) {                                                               \\\n    const int left_over = ((len + 1) >> 1) - (pos >> 1);                       \\\n    assert(left_over > 0);                                                     \\\n    UPSAMPLE_LAST_BLOCK(top_u + uv_pos, cur_u + uv_pos, left_over, r_u);       \\\n    UPSAMPLE_LAST_BLOCK(top_v + uv_pos, cur_v + uv_pos, left_over, r_v);       \\\n    CONVERT2RGB(FUNC, XSTEP, top_y, bottom_y, top_dst, bottom_dst,             \\\n                pos, len - pos);                                               \\\n  }                                                                            \\\n}\n\n// SSE2 variants of the fancy upsampler.\nSSE2_UPSAMPLE_FUNC(UpsampleRgbLinePair,  VP8YuvToRgb,  3)\nSSE2_UPSAMPLE_FUNC(UpsampleBgrLinePair,  VP8YuvToBgr,  3)\nSSE2_UPSAMPLE_FUNC(UpsampleRgbaLinePair, VP8YuvToRgba, 4)\nSSE2_UPSAMPLE_FUNC(UpsampleBgraLinePair, VP8YuvToBgra, 4)\n\n#undef GET_M\n#undef PACK_AND_STORE\n#undef UPSAMPLE_32PIXELS\n#undef UPSAMPLE_LAST_BLOCK\n#undef CONVERT2RGB\n#undef CONVERT2RGB_32\n#undef SSE2_UPSAMPLE_FUNC\n\n#endif  // FANCY_UPSAMPLING\n\n#endif   // WEBP_USE_SSE2\n\n//------------------------------------------------------------------------------\n\nextern void WebPInitUpsamplersSSE2(void);\n\n#ifdef FANCY_UPSAMPLING\n\nextern WebPUpsampleLinePairFunc WebPUpsamplers[/* MODE_LAST */];\n\nvoid WebPInitUpsamplersSSE2(void) {\n#if defined(WEBP_USE_SSE2)\n  VP8YUVInitSSE2();\n  WebPUpsamplers[MODE_RGB]  = UpsampleRgbLinePair;\n  WebPUpsamplers[MODE_RGBA] = UpsampleRgbaLinePair;\n  WebPUpsamplers[MODE_BGR]  = UpsampleBgrLinePair;\n  WebPUpsamplers[MODE_BGRA] = UpsampleBgraLinePair;\n  WebPUpsamplers[MODE_rgbA] = UpsampleRgbaLinePair;\n  WebPUpsamplers[MODE_bgrA] = UpsampleBgraLinePair;\n#endif   // WEBP_USE_SSE2\n}\n\n#else\n\n// this empty function is to avoid an empty .o\nvoid WebPInitUpsamplersSSE2(void) {}\n\n#endif  // FANCY_UPSAMPLING\n"
  },
  {
    "path": "ext/libwebp/dsp/yuv.c",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// YUV->RGB conversion functions\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include \"./yuv.h\"\n\n#if defined(WEBP_YUV_USE_TABLE)\n\nstatic int done = 0;\n\nstatic WEBP_INLINE uint8_t clip(int v, int max_value) {\n  return v < 0 ? 0 : v > max_value ? max_value : v;\n}\n\nint16_t VP8kVToR[256], VP8kUToB[256];\nint32_t VP8kVToG[256], VP8kUToG[256];\nuint8_t VP8kClip[YUV_RANGE_MAX - YUV_RANGE_MIN];\nuint8_t VP8kClip4Bits[YUV_RANGE_MAX - YUV_RANGE_MIN];\n\nvoid VP8YUVInit(void) {\n  int i;\n  if (done) {\n    return;\n  }\n#ifndef USE_YUVj\n  for (i = 0; i < 256; ++i) {\n    VP8kVToR[i] = (89858 * (i - 128) + YUV_HALF) >> YUV_FIX;\n    VP8kUToG[i] = -22014 * (i - 128) + YUV_HALF;\n    VP8kVToG[i] = -45773 * (i - 128);\n    VP8kUToB[i] = (113618 * (i - 128) + YUV_HALF) >> YUV_FIX;\n  }\n  for (i = YUV_RANGE_MIN; i < YUV_RANGE_MAX; ++i) {\n    const int k = ((i - 16) * 76283 + YUV_HALF) >> YUV_FIX;\n    VP8kClip[i - YUV_RANGE_MIN] = clip(k, 255);\n    VP8kClip4Bits[i - YUV_RANGE_MIN] = clip((k + 8) >> 4, 15);\n  }\n#else\n  for (i = 0; i < 256; ++i) {\n    VP8kVToR[i] = (91881 * (i - 128) + YUV_HALF) >> YUV_FIX;\n    VP8kUToG[i] = -22554 * (i - 128) + YUV_HALF;\n    VP8kVToG[i] = -46802 * (i - 128);\n    VP8kUToB[i] = (116130 * (i - 128) + YUV_HALF) >> YUV_FIX;\n  }\n  for (i = YUV_RANGE_MIN; i < YUV_RANGE_MAX; ++i) {\n    const int k = i;\n    VP8kClip[i - YUV_RANGE_MIN] = clip(k, 255);\n    VP8kClip4Bits[i - YUV_RANGE_MIN] = clip((k + 8) >> 4, 15);\n  }\n#endif\n\n  done = 1;\n}\n\n#else\n\nvoid VP8YUVInit(void) {}\n\n#endif  // WEBP_YUV_USE_TABLE\n\n//-----------------------------------------------------------------------------\n// Plain-C version\n\n#define ROW_FUNC(FUNC_NAME, FUNC, XSTEP)                                       \\\nstatic void FUNC_NAME(const uint8_t* y,                                        \\\n                      const uint8_t* u, const uint8_t* v,                      \\\n                      uint8_t* dst, int len) {                                 \\\n  const uint8_t* const end = dst + (len & ~1) * XSTEP;                         \\\n  while (dst != end) {                                                         \\\n    FUNC(y[0], u[0], v[0], dst);                                               \\\n    FUNC(y[1], u[0], v[0], dst + XSTEP);                                       \\\n    y += 2;                                                                    \\\n    ++u;                                                                       \\\n    ++v;                                                                       \\\n    dst += 2 * XSTEP;                                                          \\\n  }                                                                            \\\n  if (len & 1) {                                                               \\\n    FUNC(y[0], u[0], v[0], dst);                                               \\\n  }                                                                            \\\n}                                                                              \\\n\n// All variants implemented.\nROW_FUNC(YuvToRgbRow,      VP8YuvToRgb,  3)\nROW_FUNC(YuvToBgrRow,      VP8YuvToBgr,  3)\nROW_FUNC(YuvToRgbaRow,     VP8YuvToRgba, 4)\nROW_FUNC(YuvToBgraRow,     VP8YuvToBgra, 4)\nROW_FUNC(YuvToArgbRow,     VP8YuvToArgb, 4)\nROW_FUNC(YuvToRgba4444Row, VP8YuvToRgba4444, 2)\nROW_FUNC(YuvToRgb565Row,   VP8YuvToRgb565, 2)\n\n#undef ROW_FUNC\n\n// Main call for processing a plane with a WebPSamplerRowFunc function:\nvoid WebPSamplerProcessPlane(const uint8_t* y, int y_stride,\n                             const uint8_t* u, const uint8_t* v, int uv_stride,\n                             uint8_t* dst, int dst_stride,\n                             int width, int height, WebPSamplerRowFunc func) {\n  int j;\n  for (j = 0; j < height; ++j) {\n    func(y, u, v, dst, width);\n    y += y_stride;\n    if (j & 1) {\n      u += uv_stride;\n      v += uv_stride;\n    }\n    dst += dst_stride;\n  }\n}\n\n//-----------------------------------------------------------------------------\n// Main call\n\nWebPSamplerRowFunc WebPSamplers[MODE_LAST];\n\nextern void WebPInitSamplersSSE2(void);\nextern void WebPInitSamplersMIPS32(void);\n\nvoid WebPInitSamplers(void) {\n  WebPSamplers[MODE_RGB]       = YuvToRgbRow;\n  WebPSamplers[MODE_RGBA]      = YuvToRgbaRow;\n  WebPSamplers[MODE_BGR]       = YuvToBgrRow;\n  WebPSamplers[MODE_BGRA]      = YuvToBgraRow;\n  WebPSamplers[MODE_ARGB]      = YuvToArgbRow;\n  WebPSamplers[MODE_RGBA_4444] = YuvToRgba4444Row;\n  WebPSamplers[MODE_RGB_565]   = YuvToRgb565Row;\n  WebPSamplers[MODE_rgbA]      = YuvToRgbaRow;\n  WebPSamplers[MODE_bgrA]      = YuvToBgraRow;\n  WebPSamplers[MODE_Argb]      = YuvToArgbRow;\n  WebPSamplers[MODE_rgbA_4444] = YuvToRgba4444Row;\n\n  // If defined, use CPUInfo() to overwrite some pointers with faster versions.\n  if (VP8GetCPUInfo != NULL) {\n#if defined(WEBP_USE_SSE2)\n    if (VP8GetCPUInfo(kSSE2)) {\n      WebPInitSamplersSSE2();\n    }\n#endif  // WEBP_USE_SSE2\n#if defined(WEBP_USE_MIPS32)\n    if (VP8GetCPUInfo(kMIPS32)) {\n      WebPInitSamplersMIPS32();\n    }\n#endif  // WEBP_USE_MIPS32\n  }\n}\n\n//-----------------------------------------------------------------------------\n"
  },
  {
    "path": "ext/libwebp/dsp/yuv.h",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// inline YUV<->RGB conversion function\n//\n// The exact naming is Y'CbCr, following the ITU-R BT.601 standard.\n// More information at: http://en.wikipedia.org/wiki/YCbCr\n// Y = 0.2569 * R + 0.5044 * G + 0.0979 * B + 16\n// U = -0.1483 * R - 0.2911 * G + 0.4394 * B + 128\n// V = 0.4394 * R - 0.3679 * G - 0.0715 * B + 128\n// We use 16bit fixed point operations for RGB->YUV conversion (YUV_FIX).\n//\n// For the Y'CbCr to RGB conversion, the BT.601 specification reads:\n//   R = 1.164 * (Y-16) + 1.596 * (V-128)\n//   G = 1.164 * (Y-16) - 0.813 * (V-128) - 0.391 * (U-128)\n//   B = 1.164 * (Y-16)                   + 2.018 * (U-128)\n// where Y is in the [16,235] range, and U/V in the [16,240] range.\n// In the table-lookup version (WEBP_YUV_USE_TABLE), the common factor\n// \"1.164 * (Y-16)\" can be handled as an offset in the VP8kClip[] table.\n// So in this case the formulae should read:\n//   R = 1.164 * [Y + 1.371 * (V-128)                  ] - 18.624\n//   G = 1.164 * [Y - 0.698 * (V-128) - 0.336 * (U-128)] - 18.624\n//   B = 1.164 * [Y                   + 1.733 * (U-128)] - 18.624\n// once factorized.\n// For YUV->RGB conversion, only 14bit fixed precision is used (YUV_FIX2).\n// That's the maximum possible for a convenient ARM implementation.\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_DSP_YUV_H_\n#define WEBP_DSP_YUV_H_\n\n#include \"./dsp.h\"\n#include \"../dec/decode_vp8.h\"\n\n// Define the following to use the LUT-based code:\n// #define WEBP_YUV_USE_TABLE\n\n#if defined(WEBP_EXPERIMENTAL_FEATURES)\n// Do NOT activate this feature for real compression. This is only experimental!\n// This flag is for comparison purpose against JPEG's \"YUVj\" natural colorspace.\n// This colorspace is close to Rec.601's Y'CbCr model with the notable\n// difference of allowing larger range for luma/chroma.\n// See http://en.wikipedia.org/wiki/YCbCr#JPEG_conversion paragraph, and its\n// difference with http://en.wikipedia.org/wiki/YCbCr#ITU-R_BT.601_conversion\n// #define USE_YUVj\n#endif\n\n//------------------------------------------------------------------------------\n// YUV -> RGB conversion\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nenum {\n  YUV_FIX = 16,                    // fixed-point precision for RGB->YUV\n  YUV_HALF = 1 << (YUV_FIX - 1),\n  YUV_MASK = (256 << YUV_FIX) - 1,\n  YUV_RANGE_MIN = -227,            // min value of r/g/b output\n  YUV_RANGE_MAX = 256 + 226,       // max value of r/g/b output\n\n  YUV_FIX2 = 14,                   // fixed-point precision for YUV->RGB\n  YUV_HALF2 = 1 << (YUV_FIX2 - 1),\n  YUV_MASK2 = (256 << YUV_FIX2) - 1\n};\n\n// These constants are 14b fixed-point version of ITU-R BT.601 constants.\n#define kYScale 19077    // 1.164 = 255 / 219\n#define kVToR   26149    // 1.596 = 255 / 112 * 0.701\n#define kUToG   6419     // 0.391 = 255 / 112 * 0.886 * 0.114 / 0.587\n#define kVToG   13320    // 0.813 = 255 / 112 * 0.701 * 0.299 / 0.587\n#define kUToB   33050    // 2.018 = 255 / 112 * 0.886\n#define kRCst (-kYScale * 16 - kVToR * 128 + YUV_HALF2)\n#define kGCst (-kYScale * 16 + kUToG * 128 + kVToG * 128 + YUV_HALF2)\n#define kBCst (-kYScale * 16 - kUToB * 128 + YUV_HALF2)\n\n//------------------------------------------------------------------------------\n\n#if !defined(WEBP_YUV_USE_TABLE)\n\n// slower on x86 by ~7-8%, but bit-exact with the SSE2 version\n\nstatic WEBP_INLINE int VP8Clip8(int v) {\n  return ((v & ~YUV_MASK2) == 0) ? (v >> YUV_FIX2) : (v < 0) ? 0 : 255;\n}\n\nstatic WEBP_INLINE int VP8YUVToR(int y, int v) {\n  return VP8Clip8(kYScale * y + kVToR * v + kRCst);\n}\n\nstatic WEBP_INLINE int VP8YUVToG(int y, int u, int v) {\n  return VP8Clip8(kYScale * y - kUToG * u - kVToG * v + kGCst);\n}\n\nstatic WEBP_INLINE int VP8YUVToB(int y, int u) {\n  return VP8Clip8(kYScale * y + kUToB * u + kBCst);\n}\n\nstatic WEBP_INLINE void VP8YuvToRgb(int y, int u, int v,\n                                    uint8_t* const rgb) {\n  rgb[0] = VP8YUVToR(y, v);\n  rgb[1] = VP8YUVToG(y, u, v);\n  rgb[2] = VP8YUVToB(y, u);\n}\n\nstatic WEBP_INLINE void VP8YuvToBgr(int y, int u, int v,\n                                    uint8_t* const bgr) {\n  bgr[0] = VP8YUVToB(y, u);\n  bgr[1] = VP8YUVToG(y, u, v);\n  bgr[2] = VP8YUVToR(y, v);\n}\n\nstatic WEBP_INLINE void VP8YuvToRgb565(int y, int u, int v,\n                                       uint8_t* const rgb) {\n  const int r = VP8YUVToR(y, v);      // 5 usable bits\n  const int g = VP8YUVToG(y, u, v);   // 6 usable bits\n  const int b = VP8YUVToB(y, u);      // 5 usable bits\n  const int rg = (r & 0xf8) | (g >> 5);\n  const int gb = ((g << 3) & 0xe0) | (b >> 3);\n#ifdef WEBP_SWAP_16BIT_CSP\n  rgb[0] = gb;\n  rgb[1] = rg;\n#else\n  rgb[0] = rg;\n  rgb[1] = gb;\n#endif\n}\n\nstatic WEBP_INLINE void VP8YuvToRgba4444(int y, int u, int v,\n                                         uint8_t* const argb) {\n  const int r = VP8YUVToR(y, v);        // 4 usable bits\n  const int g = VP8YUVToG(y, u, v);     // 4 usable bits\n  const int b = VP8YUVToB(y, u);        // 4 usable bits\n  const int rg = (r & 0xf0) | (g >> 4);\n  const int ba = (b & 0xf0) | 0x0f;     // overwrite the lower 4 bits\n#ifdef WEBP_SWAP_16BIT_CSP\n  argb[0] = ba;\n  argb[1] = rg;\n#else\n  argb[0] = rg;\n  argb[1] = ba;\n#endif\n}\n\n#else\n\n// Table-based version, not totally equivalent to the SSE2 version.\n// Rounding diff is only +/-1 though.\n\nextern int16_t VP8kVToR[256], VP8kUToB[256];\nextern int32_t VP8kVToG[256], VP8kUToG[256];\nextern uint8_t VP8kClip[YUV_RANGE_MAX - YUV_RANGE_MIN];\nextern uint8_t VP8kClip4Bits[YUV_RANGE_MAX - YUV_RANGE_MIN];\n\nstatic WEBP_INLINE void VP8YuvToRgb(int y, int u, int v,\n                                    uint8_t* const rgb) {\n  const int r_off = VP8kVToR[v];\n  const int g_off = (VP8kVToG[v] + VP8kUToG[u]) >> YUV_FIX;\n  const int b_off = VP8kUToB[u];\n  rgb[0] = VP8kClip[y + r_off - YUV_RANGE_MIN];\n  rgb[1] = VP8kClip[y + g_off - YUV_RANGE_MIN];\n  rgb[2] = VP8kClip[y + b_off - YUV_RANGE_MIN];\n}\n\nstatic WEBP_INLINE void VP8YuvToBgr(int y, int u, int v,\n                                    uint8_t* const bgr) {\n  const int r_off = VP8kVToR[v];\n  const int g_off = (VP8kVToG[v] + VP8kUToG[u]) >> YUV_FIX;\n  const int b_off = VP8kUToB[u];\n  bgr[0] = VP8kClip[y + b_off - YUV_RANGE_MIN];\n  bgr[1] = VP8kClip[y + g_off - YUV_RANGE_MIN];\n  bgr[2] = VP8kClip[y + r_off - YUV_RANGE_MIN];\n}\n\nstatic WEBP_INLINE void VP8YuvToRgb565(int y, int u, int v,\n                                       uint8_t* const rgb) {\n  const int r_off = VP8kVToR[v];\n  const int g_off = (VP8kVToG[v] + VP8kUToG[u]) >> YUV_FIX;\n  const int b_off = VP8kUToB[u];\n  const int rg = ((VP8kClip[y + r_off - YUV_RANGE_MIN] & 0xf8) |\n                  (VP8kClip[y + g_off - YUV_RANGE_MIN] >> 5));\n  const int gb = (((VP8kClip[y + g_off - YUV_RANGE_MIN] << 3) & 0xe0) |\n                   (VP8kClip[y + b_off - YUV_RANGE_MIN] >> 3));\n#ifdef WEBP_SWAP_16BIT_CSP\n  rgb[0] = gb;\n  rgb[1] = rg;\n#else\n  rgb[0] = rg;\n  rgb[1] = gb;\n#endif\n}\n\nstatic WEBP_INLINE void VP8YuvToRgba4444(int y, int u, int v,\n                                         uint8_t* const argb) {\n  const int r_off = VP8kVToR[v];\n  const int g_off = (VP8kVToG[v] + VP8kUToG[u]) >> YUV_FIX;\n  const int b_off = VP8kUToB[u];\n  const int rg = ((VP8kClip4Bits[y + r_off - YUV_RANGE_MIN] << 4) |\n                   VP8kClip4Bits[y + g_off - YUV_RANGE_MIN]);\n  const int ba = (VP8kClip4Bits[y + b_off - YUV_RANGE_MIN] << 4) | 0x0f;\n#ifdef WEBP_SWAP_16BIT_CSP\n  argb[0] = ba;\n  argb[1] = rg;\n#else\n  argb[0] = rg;\n  argb[1] = ba;\n#endif\n}\n\n#endif  // WEBP_YUV_USE_TABLE\n\n//-----------------------------------------------------------------------------\n// Alpha handling variants\n\nstatic WEBP_INLINE void VP8YuvToArgb(uint8_t y, uint8_t u, uint8_t v,\n                                     uint8_t* const argb) {\n  argb[0] = 0xff;\n  VP8YuvToRgb(y, u, v, argb + 1);\n}\n\nstatic WEBP_INLINE void VP8YuvToBgra(uint8_t y, uint8_t u, uint8_t v,\n                                     uint8_t* const bgra) {\n  VP8YuvToBgr(y, u, v, bgra);\n  bgra[3] = 0xff;\n}\n\nstatic WEBP_INLINE void VP8YuvToRgba(uint8_t y, uint8_t u, uint8_t v,\n                                     uint8_t* const rgba) {\n  VP8YuvToRgb(y, u, v, rgba);\n  rgba[3] = 0xff;\n}\n\n// Must be called before everything, to initialize the tables.\nvoid VP8YUVInit(void);\n\n//-----------------------------------------------------------------------------\n// SSE2 extra functions (mostly for upsampling_sse2.c)\n\n#if defined(WEBP_USE_SSE2)\n\n// When the following is defined, tables are initialized statically, adding ~12k\n// to the binary size. Otherwise, they are initialized at run-time (small cost).\n#define WEBP_YUV_USE_SSE2_TABLES\n\n#if defined(FANCY_UPSAMPLING)\n// Process 32 pixels and store the result (24b or 32b per pixel) in *dst.\nvoid VP8YuvToRgba32(const uint8_t* y, const uint8_t* u, const uint8_t* v,\n                    uint8_t* dst);\nvoid VP8YuvToRgb32(const uint8_t* y, const uint8_t* u, const uint8_t* v,\n                   uint8_t* dst);\nvoid VP8YuvToBgra32(const uint8_t* y, const uint8_t* u, const uint8_t* v,\n                    uint8_t* dst);\nvoid VP8YuvToBgr32(const uint8_t* y, const uint8_t* u, const uint8_t* v,\n                   uint8_t* dst);\n#endif  // FANCY_UPSAMPLING\n\n// Must be called to initialize tables before using the functions.\nvoid VP8YUVInitSSE2(void);\n\n#endif    // WEBP_USE_SSE2\n\n//------------------------------------------------------------------------------\n// RGB -> YUV conversion\n\n// Stub functions that can be called with various rounding values:\nstatic WEBP_INLINE int VP8ClipUV(int uv, int rounding) {\n  uv = (uv + rounding + (128 << (YUV_FIX + 2))) >> (YUV_FIX + 2);\n  return ((uv & ~0xff) == 0) ? uv : (uv < 0) ? 0 : 255;\n}\n\n#ifndef USE_YUVj\n\nstatic WEBP_INLINE int VP8RGBToY(int r, int g, int b, int rounding) {\n  const int luma = 16839 * r + 33059 * g + 6420 * b;\n  return (luma + rounding + (16 << YUV_FIX)) >> YUV_FIX;  // no need to clip\n}\n\nstatic WEBP_INLINE int VP8RGBToU(int r, int g, int b, int rounding) {\n  const int u = -9719 * r - 19081 * g + 28800 * b;\n  return VP8ClipUV(u, rounding);\n}\n\nstatic WEBP_INLINE int VP8RGBToV(int r, int g, int b, int rounding) {\n  const int v = +28800 * r - 24116 * g - 4684 * b;\n  return VP8ClipUV(v, rounding);\n}\n\n#else\n\n// This JPEG-YUV colorspace, only for comparison!\n// These are also 16bit precision coefficients from Rec.601, but with full\n// [0..255] output range.\nstatic WEBP_INLINE int VP8RGBToY(int r, int g, int b, int rounding) {\n  const int luma = 19595 * r + 38470 * g + 7471 * b;\n  return (luma + rounding) >> YUV_FIX;  // no need to clip\n}\n\nstatic WEBP_INLINE int VP8RGBToU(int r, int g, int b, int rounding) {\n  const int u = -11058 * r - 21710 * g + 32768 * b;\n  return VP8ClipUV(u, rounding);\n}\n\nstatic WEBP_INLINE int VP8RGBToV(int r, int g, int b, int rounding) {\n  const int v = 32768 * r - 27439 * g - 5329 * b;\n  return VP8ClipUV(v, rounding);\n}\n\n#endif    // USE_YUVj\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_DSP_YUV_H_ */\n"
  },
  {
    "path": "ext/libwebp/dsp/yuv_mips32.c",
    "content": "// Copyright 2014 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// MIPS version of YUV to RGB upsampling functions.\n//\n// Author(s):  Djordje Pesut    (djordje.pesut@imgtec.com)\n//             Jovan Zelincevic (jovan.zelincevic@imgtec.com)\n\n#include \"./dsp.h\"\n\n#if defined(WEBP_USE_MIPS32)\n\n#include \"./yuv.h\"\n\n//------------------------------------------------------------------------------\n// simple point-sampling\n\n#define ROW_FUNC(FUNC_NAME, XSTEP, R, G, B, A)                                 \\\nstatic void FUNC_NAME(const uint8_t* y,                                        \\\n                      const uint8_t* u, const uint8_t* v,                      \\\n                      uint8_t* dst, int len) {                                 \\\n  int i, r, g, b;                                                              \\\n  int temp0, temp1, temp2, temp3, temp4;                                       \\\n  for (i = 0; i < (len >> 1); i++) {                                           \\\n    temp1 = kVToR * v[0];                                                      \\\n    temp3 = kVToG * v[0];                                                      \\\n    temp2 = kUToG * u[0];                                                      \\\n    temp4 = kUToB * u[0];                                                      \\\n    temp0 = kYScale * y[0];                                                    \\\n    temp1 += kRCst;                                                            \\\n    temp3 -= kGCst;                                                            \\\n    temp2 += temp3;                                                            \\\n    temp4 += kBCst;                                                            \\\n    r = VP8Clip8(temp0 + temp1);                                               \\\n    g = VP8Clip8(temp0 - temp2);                                               \\\n    b = VP8Clip8(temp0 + temp4);                                               \\\n    temp0 = kYScale * y[1];                                                    \\\n    dst[R] = r;                                                                \\\n    dst[G] = g;                                                                \\\n    dst[B] = b;                                                                \\\n    if (A) dst[A] = 0xff;                                                      \\\n    r = VP8Clip8(temp0 + temp1);                                               \\\n    g = VP8Clip8(temp0 - temp2);                                               \\\n    b = VP8Clip8(temp0 + temp4);                                               \\\n    dst[R + XSTEP] = r;                                                        \\\n    dst[G + XSTEP] = g;                                                        \\\n    dst[B + XSTEP] = b;                                                        \\\n    if (A) dst[A + XSTEP] = 0xff;                                              \\\n    y += 2;                                                                    \\\n    ++u;                                                                       \\\n    ++v;                                                                       \\\n    dst += 2 * XSTEP;                                                          \\\n  }                                                                            \\\n  if (len & 1) {                                                               \\\n    temp1 = kVToR * v[0];                                                      \\\n    temp3 = kVToG * v[0];                                                      \\\n    temp2 = kUToG * u[0];                                                      \\\n    temp4 = kUToB * u[0];                                                      \\\n    temp0 = kYScale * y[0];                                                    \\\n    temp1 += kRCst;                                                            \\\n    temp3 -= kGCst;                                                            \\\n    temp2 += temp3;                                                            \\\n    temp4 += kBCst;                                                            \\\n    r = VP8Clip8(temp0 + temp1);                                               \\\n    g = VP8Clip8(temp0 - temp2);                                               \\\n    b = VP8Clip8(temp0 + temp4);                                               \\\n    dst[R] = r;                                                                \\\n    dst[G] = g;                                                                \\\n    dst[B] = b;                                                                \\\n    if (A) dst[A] = 0xff;                                                      \\\n  }                                                                            \\\n}\n\nROW_FUNC(YuvToRgbRow,      3, 0, 1, 2, 0)\nROW_FUNC(YuvToRgbaRow,     4, 0, 1, 2, 3)\nROW_FUNC(YuvToBgrRow,      3, 2, 1, 0, 0)\nROW_FUNC(YuvToBgraRow,     4, 2, 1, 0, 3)\n\n#undef ROW_FUNC\n\n#endif   // WEBP_USE_MIPS32\n\n//------------------------------------------------------------------------------\n\nextern void WebPInitSamplersMIPS32(void);\n\nvoid WebPInitSamplersMIPS32(void) {\n#if defined(WEBP_USE_MIPS32)\n  WebPSamplers[MODE_RGB]  = YuvToRgbRow;\n  WebPSamplers[MODE_RGBA] = YuvToRgbaRow;\n  WebPSamplers[MODE_BGR]  = YuvToBgrRow;\n  WebPSamplers[MODE_BGRA] = YuvToBgraRow;\n#endif  // WEBP_USE_MIPS32\n}\n"
  },
  {
    "path": "ext/libwebp/dsp/yuv_sse2.c",
    "content": "// Copyright 2014 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// YUV->RGB conversion functions\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include \"./yuv.h\"\n\n#if defined(WEBP_USE_SSE2)\n\n#include <emmintrin.h>\n#include <string.h>   // for memcpy\n\ntypedef union {   // handy struct for converting SSE2 registers\n  int32_t i32[4];\n  uint8_t u8[16];\n  __m128i m;\n} VP8kCstSSE2;\n\n#if defined(WEBP_YUV_USE_SSE2_TABLES)\n\n#include \"./yuv_tables_sse2.h\"\n\nvoid VP8YUVInitSSE2(void) {}\n\n#else\n\nstatic int done_sse2 = 0;\nstatic VP8kCstSSE2 VP8kUtoRGBA[256], VP8kVtoRGBA[256], VP8kYtoRGBA[256];\n\nvoid VP8YUVInitSSE2(void) {\n  if (!done_sse2) {\n    int i;\n    for (i = 0; i < 256; ++i) {\n      VP8kYtoRGBA[i].i32[0] =\n        VP8kYtoRGBA[i].i32[1] =\n        VP8kYtoRGBA[i].i32[2] = (i - 16) * kYScale + YUV_HALF2;\n      VP8kYtoRGBA[i].i32[3] = 0xff << YUV_FIX2;\n\n      VP8kUtoRGBA[i].i32[0] = 0;\n      VP8kUtoRGBA[i].i32[1] = -kUToG * (i - 128);\n      VP8kUtoRGBA[i].i32[2] =  kUToB * (i - 128);\n      VP8kUtoRGBA[i].i32[3] = 0;\n\n      VP8kVtoRGBA[i].i32[0] =  kVToR * (i - 128);\n      VP8kVtoRGBA[i].i32[1] = -kVToG * (i - 128);\n      VP8kVtoRGBA[i].i32[2] = 0;\n      VP8kVtoRGBA[i].i32[3] = 0;\n    }\n    done_sse2 = 1;\n\n#if 0   // code used to generate 'yuv_tables_sse2.h'\n    printf(\"static const VP8kCstSSE2 VP8kYtoRGBA[256] = {\\n\");\n    for (i = 0; i < 256; ++i) {\n      printf(\"  {{0x%.8x, 0x%.8x, 0x%.8x, 0x%.8x}},\\n\",\n             VP8kYtoRGBA[i].i32[0], VP8kYtoRGBA[i].i32[1],\n             VP8kYtoRGBA[i].i32[2], VP8kYtoRGBA[i].i32[3]);\n    }\n    printf(\"};\\n\\n\");\n    printf(\"static const VP8kCstSSE2 VP8kUtoRGBA[256] = {\\n\");\n    for (i = 0; i < 256; ++i) {\n      printf(\"  {{0, 0x%.8x, 0x%.8x, 0}},\\n\",\n             VP8kUtoRGBA[i].i32[1], VP8kUtoRGBA[i].i32[2]);\n    }\n    printf(\"};\\n\\n\");\n    printf(\"static VP8kCstSSE2 VP8kVtoRGBA[256] = {\\n\");\n    for (i = 0; i < 256; ++i) {\n      printf(\"  {{0x%.8x, 0x%.8x, 0, 0}},\\n\",\n             VP8kVtoRGBA[i].i32[0], VP8kVtoRGBA[i].i32[1]);\n    }\n    printf(\"};\\n\\n\");\n#endif\n  }\n}\n\n#endif  // WEBP_YUV_USE_SSE2_TABLES\n\n//-----------------------------------------------------------------------------\n\nstatic WEBP_INLINE __m128i LoadUVPart(int u, int v) {\n  const __m128i u_part = _mm_loadu_si128(&VP8kUtoRGBA[u].m);\n  const __m128i v_part = _mm_loadu_si128(&VP8kVtoRGBA[v].m);\n  const __m128i uv_part = _mm_add_epi32(u_part, v_part);\n  return uv_part;\n}\n\nstatic WEBP_INLINE __m128i GetRGBA32bWithUV(int y, const __m128i uv_part) {\n  const __m128i y_part = _mm_loadu_si128(&VP8kYtoRGBA[y].m);\n  const __m128i rgba1 = _mm_add_epi32(y_part, uv_part);\n  const __m128i rgba2 = _mm_srai_epi32(rgba1, YUV_FIX2);\n  return rgba2;\n}\n\nstatic WEBP_INLINE __m128i GetRGBA32b(int y, int u, int v) {\n  const __m128i uv_part = LoadUVPart(u, v);\n  return GetRGBA32bWithUV(y, uv_part);\n}\n\nstatic WEBP_INLINE void YuvToRgbSSE2(uint8_t y, uint8_t u, uint8_t v,\n                                     uint8_t* const rgb) {\n  const __m128i tmp0 = GetRGBA32b(y, u, v);\n  const __m128i tmp1 = _mm_packs_epi32(tmp0, tmp0);\n  const __m128i tmp2 = _mm_packus_epi16(tmp1, tmp1);\n  // Note: we store 8 bytes at a time, not 3 bytes! -> memory stomp\n  _mm_storel_epi64((__m128i*)rgb, tmp2);\n}\n\nstatic WEBP_INLINE void YuvToBgrSSE2(uint8_t y, uint8_t u, uint8_t v,\n                                     uint8_t* const bgr) {\n  const __m128i tmp0 = GetRGBA32b(y, u, v);\n  const __m128i tmp1 = _mm_shuffle_epi32(tmp0, _MM_SHUFFLE(3, 0, 1, 2));\n  const __m128i tmp2 = _mm_packs_epi32(tmp1, tmp1);\n  const __m128i tmp3 = _mm_packus_epi16(tmp2, tmp2);\n  // Note: we store 8 bytes at a time, not 3 bytes! -> memory stomp\n  _mm_storel_epi64((__m128i*)bgr, tmp3);\n}\n\n//-----------------------------------------------------------------------------\n// Convert spans of 32 pixels to various RGB formats for the fancy upsampler.\n\n#ifdef FANCY_UPSAMPLING\n\nvoid VP8YuvToRgba32(const uint8_t* y, const uint8_t* u, const uint8_t* v,\n                    uint8_t* dst) {\n  int n;\n  for (n = 0; n < 32; n += 4) {\n    const __m128i tmp0_1 = GetRGBA32b(y[n + 0], u[n + 0], v[n + 0]);\n    const __m128i tmp0_2 = GetRGBA32b(y[n + 1], u[n + 1], v[n + 1]);\n    const __m128i tmp0_3 = GetRGBA32b(y[n + 2], u[n + 2], v[n + 2]);\n    const __m128i tmp0_4 = GetRGBA32b(y[n + 3], u[n + 3], v[n + 3]);\n    const __m128i tmp1_1 = _mm_packs_epi32(tmp0_1, tmp0_2);\n    const __m128i tmp1_2 = _mm_packs_epi32(tmp0_3, tmp0_4);\n    const __m128i tmp2 = _mm_packus_epi16(tmp1_1, tmp1_2);\n    _mm_storeu_si128((__m128i*)dst, tmp2);\n    dst += 4 * 4;\n  }\n}\n\nvoid VP8YuvToBgra32(const uint8_t* y, const uint8_t* u, const uint8_t* v,\n                    uint8_t* dst) {\n  int n;\n  for (n = 0; n < 32; n += 2) {\n    const __m128i tmp0_1 = GetRGBA32b(y[n + 0], u[n + 0], v[n + 0]);\n    const __m128i tmp0_2 = GetRGBA32b(y[n + 1], u[n + 1], v[n + 1]);\n    const __m128i tmp1_1 = _mm_shuffle_epi32(tmp0_1, _MM_SHUFFLE(3, 0, 1, 2));\n    const __m128i tmp1_2 = _mm_shuffle_epi32(tmp0_2, _MM_SHUFFLE(3, 0, 1, 2));\n    const __m128i tmp2_1 = _mm_packs_epi32(tmp1_1, tmp1_2);\n    const __m128i tmp3 = _mm_packus_epi16(tmp2_1, tmp2_1);\n    _mm_storel_epi64((__m128i*)dst, tmp3);\n    dst += 4 * 2;\n  }\n}\n\nvoid VP8YuvToRgb32(const uint8_t* y, const uint8_t* u, const uint8_t* v,\n                   uint8_t* dst) {\n  int n;\n  uint8_t tmp0[2 * 3 + 5 + 15];\n  uint8_t* const tmp = (uint8_t*)((uintptr_t)(tmp0 + 15) & ~15);  // align\n  for (n = 0; n < 30; ++n) {   // we directly stomp the *dst memory\n    YuvToRgbSSE2(y[n], u[n], v[n], dst + n * 3);\n  }\n  // Last two pixels are special: we write in a tmp buffer before sending\n  // to dst.\n  YuvToRgbSSE2(y[n + 0], u[n + 0], v[n + 0], tmp + 0);\n  YuvToRgbSSE2(y[n + 1], u[n + 1], v[n + 1], tmp + 3);\n  memcpy(dst + n * 3, tmp, 2 * 3);\n}\n\nvoid VP8YuvToBgr32(const uint8_t* y, const uint8_t* u, const uint8_t* v,\n                   uint8_t* dst) {\n  int n;\n  uint8_t tmp0[2 * 3 + 5 + 15];\n  uint8_t* const tmp = (uint8_t*)((uintptr_t)(tmp0 + 15) & ~15);  // align\n  for (n = 0; n < 30; ++n) {\n    YuvToBgrSSE2(y[n], u[n], v[n], dst + n * 3);\n  }\n  YuvToBgrSSE2(y[n + 0], u[n + 0], v[n + 0], tmp + 0);\n  YuvToBgrSSE2(y[n + 1], u[n + 1], v[n + 1], tmp + 3);\n  memcpy(dst + n * 3, tmp, 2 * 3);\n}\n\n#endif  // FANCY_UPSAMPLING\n\n//-----------------------------------------------------------------------------\n// Arbitrary-length row conversion functions\n\nstatic void YuvToRgbaRowSSE2(const uint8_t* y,\n                             const uint8_t* u, const uint8_t* v,\n                             uint8_t* dst, int len) {\n  int n;\n  for (n = 0; n + 4 <= len; n += 4) {\n    const __m128i uv_0 = LoadUVPart(u[0], v[0]);\n    const __m128i uv_1 = LoadUVPart(u[1], v[1]);\n    const __m128i tmp0_1 = GetRGBA32bWithUV(y[0], uv_0);\n    const __m128i tmp0_2 = GetRGBA32bWithUV(y[1], uv_0);\n    const __m128i tmp0_3 = GetRGBA32bWithUV(y[2], uv_1);\n    const __m128i tmp0_4 = GetRGBA32bWithUV(y[3], uv_1);\n    const __m128i tmp1_1 = _mm_packs_epi32(tmp0_1, tmp0_2);\n    const __m128i tmp1_2 = _mm_packs_epi32(tmp0_3, tmp0_4);\n    const __m128i tmp2 = _mm_packus_epi16(tmp1_1, tmp1_2);\n    _mm_storeu_si128((__m128i*)dst, tmp2);\n    dst += 4 * 4;\n    y += 4;\n    u += 2;\n    v += 2;\n  }\n  // Finish off\n  while (n < len) {\n    VP8YuvToRgba(y[0], u[0], v[0], dst);\n    dst += 4;\n    ++y;\n    u += (n & 1);\n    v += (n & 1);\n    ++n;\n  }\n}\n\nstatic void YuvToBgraRowSSE2(const uint8_t* y,\n                             const uint8_t* u, const uint8_t* v,\n                             uint8_t* dst, int len) {\n  int n;\n  for (n = 0; n + 2 <= len; n += 2) {\n    const __m128i uv_0 = LoadUVPart(u[0], v[0]);\n    const __m128i tmp0_1 = GetRGBA32bWithUV(y[0], uv_0);\n    const __m128i tmp0_2 = GetRGBA32bWithUV(y[1], uv_0);\n    const __m128i tmp1_1 = _mm_shuffle_epi32(tmp0_1, _MM_SHUFFLE(3, 0, 1, 2));\n    const __m128i tmp1_2 = _mm_shuffle_epi32(tmp0_2, _MM_SHUFFLE(3, 0, 1, 2));\n    const __m128i tmp2_1 = _mm_packs_epi32(tmp1_1, tmp1_2);\n    const __m128i tmp3 = _mm_packus_epi16(tmp2_1, tmp2_1);\n    _mm_storel_epi64((__m128i*)dst, tmp3);\n    dst += 4 * 2;\n    y += 2;\n    ++u;\n    ++v;\n  }\n  // Finish off\n  if (len & 1) {\n    VP8YuvToBgra(y[0], u[0], v[0], dst);\n  }\n}\n\nstatic void YuvToArgbRowSSE2(const uint8_t* y,\n                             const uint8_t* u, const uint8_t* v,\n                             uint8_t* dst, int len) {\n  int n;\n  for (n = 0; n + 2 <= len; n += 2) {\n    const __m128i uv_0 = LoadUVPart(u[0], v[0]);\n    const __m128i tmp0_1 = GetRGBA32bWithUV(y[0], uv_0);\n    const __m128i tmp0_2 = GetRGBA32bWithUV(y[1], uv_0);\n    const __m128i tmp1_1 = _mm_shuffle_epi32(tmp0_1, _MM_SHUFFLE(2, 1, 0, 3));\n    const __m128i tmp1_2 = _mm_shuffle_epi32(tmp0_2, _MM_SHUFFLE(2, 1, 0, 3));\n    const __m128i tmp2_1 = _mm_packs_epi32(tmp1_1, tmp1_2);\n    const __m128i tmp3 = _mm_packus_epi16(tmp2_1, tmp2_1);\n    _mm_storel_epi64((__m128i*)dst, tmp3);\n    dst += 4 * 2;\n    y += 2;\n    ++u;\n    ++v;\n  }\n  // Finish off\n  if (len & 1) {\n    VP8YuvToArgb(y[0], u[0], v[0], dst);\n  }\n}\n\nstatic void YuvToRgbRowSSE2(const uint8_t* y,\n                            const uint8_t* u, const uint8_t* v,\n                            uint8_t* dst, int len) {\n  int n;\n  for (n = 0; n + 2 < len; ++n) {   // we directly stomp the *dst memory\n    YuvToRgbSSE2(y[0], u[0], v[0], dst);  // stomps 8 bytes\n    dst += 3;\n    ++y;\n    u += (n & 1);\n    v += (n & 1);\n  }\n  VP8YuvToRgb(y[0], u[0], v[0], dst);\n  if (len > 1) {\n    VP8YuvToRgb(y[1], u[n & 1], v[n & 1], dst + 3);\n  }\n}\n\nstatic void YuvToBgrRowSSE2(const uint8_t* y,\n                            const uint8_t* u, const uint8_t* v,\n                            uint8_t* dst, int len) {\n  int n;\n  for (n = 0; n + 2 < len; ++n) {   // we directly stomp the *dst memory\n    YuvToBgrSSE2(y[0], u[0], v[0], dst);  // stomps 8 bytes\n    dst += 3;\n    ++y;\n    u += (n & 1);\n    v += (n & 1);\n  }\n  VP8YuvToBgr(y[0], u[0], v[0], dst + 0);\n  if (len > 1) {\n    VP8YuvToBgr(y[1], u[n & 1], v[n & 1], dst + 3);\n  }\n}\n\n#endif  // WEBP_USE_SSE2\n\n//------------------------------------------------------------------------------\n// Entry point\n\nextern void WebPInitSamplersSSE2(void);\n\nvoid WebPInitSamplersSSE2(void) {\n#if defined(WEBP_USE_SSE2)\n  WebPSamplers[MODE_RGB]  = YuvToRgbRowSSE2;\n  WebPSamplers[MODE_RGBA] = YuvToRgbaRowSSE2;\n  WebPSamplers[MODE_BGR]  = YuvToBgrRowSSE2;\n  WebPSamplers[MODE_BGRA] = YuvToBgraRowSSE2;\n  WebPSamplers[MODE_ARGB] = YuvToArgbRowSSE2;\n#endif  // WEBP_USE_SSE2\n}\n"
  },
  {
    "path": "ext/libwebp/dsp/yuv_tables_sse2.h",
    "content": "// Copyright 2014 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// SSE2 tables for YUV->RGB conversion (12kB overall)\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n// This file is not compiled, but #include'd directly from yuv.c\n// Only used if WEBP_YUV_USE_SSE2_TABLES is defined.\n\nstatic const VP8kCstSSE2 VP8kYtoRGBA[256] = {\n  {{0xfffb77b0, 0xfffb77b0, 0xfffb77b0, 0x003fc000}},\n  {{0xfffbc235, 0xfffbc235, 0xfffbc235, 0x003fc000}},\n  {{0xfffc0cba, 0xfffc0cba, 0xfffc0cba, 0x003fc000}},\n  {{0xfffc573f, 0xfffc573f, 0xfffc573f, 0x003fc000}},\n  {{0xfffca1c4, 0xfffca1c4, 0xfffca1c4, 0x003fc000}},\n  {{0xfffcec49, 0xfffcec49, 0xfffcec49, 0x003fc000}},\n  {{0xfffd36ce, 0xfffd36ce, 0xfffd36ce, 0x003fc000}},\n  {{0xfffd8153, 0xfffd8153, 0xfffd8153, 0x003fc000}},\n  {{0xfffdcbd8, 0xfffdcbd8, 0xfffdcbd8, 0x003fc000}},\n  {{0xfffe165d, 0xfffe165d, 0xfffe165d, 0x003fc000}},\n  {{0xfffe60e2, 0xfffe60e2, 0xfffe60e2, 0x003fc000}},\n  {{0xfffeab67, 0xfffeab67, 0xfffeab67, 0x003fc000}},\n  {{0xfffef5ec, 0xfffef5ec, 0xfffef5ec, 0x003fc000}},\n  {{0xffff4071, 0xffff4071, 0xffff4071, 0x003fc000}},\n  {{0xffff8af6, 0xffff8af6, 0xffff8af6, 0x003fc000}},\n  {{0xffffd57b, 0xffffd57b, 0xffffd57b, 0x003fc000}},\n  {{0x00002000, 0x00002000, 0x00002000, 0x003fc000}},\n  {{0x00006a85, 0x00006a85, 0x00006a85, 0x003fc000}},\n  {{0x0000b50a, 0x0000b50a, 0x0000b50a, 0x003fc000}},\n  {{0x0000ff8f, 0x0000ff8f, 0x0000ff8f, 0x003fc000}},\n  {{0x00014a14, 0x00014a14, 0x00014a14, 0x003fc000}},\n  {{0x00019499, 0x00019499, 0x00019499, 0x003fc000}},\n  {{0x0001df1e, 0x0001df1e, 0x0001df1e, 0x003fc000}},\n  {{0x000229a3, 0x000229a3, 0x000229a3, 0x003fc000}},\n  {{0x00027428, 0x00027428, 0x00027428, 0x003fc000}},\n  {{0x0002bead, 0x0002bead, 0x0002bead, 0x003fc000}},\n  {{0x00030932, 0x00030932, 0x00030932, 0x003fc000}},\n  {{0x000353b7, 0x000353b7, 0x000353b7, 0x003fc000}},\n  {{0x00039e3c, 0x00039e3c, 0x00039e3c, 0x003fc000}},\n  {{0x0003e8c1, 0x0003e8c1, 0x0003e8c1, 0x003fc000}},\n  {{0x00043346, 0x00043346, 0x00043346, 0x003fc000}},\n  {{0x00047dcb, 0x00047dcb, 0x00047dcb, 0x003fc000}},\n  {{0x0004c850, 0x0004c850, 0x0004c850, 0x003fc000}},\n  {{0x000512d5, 0x000512d5, 0x000512d5, 0x003fc000}},\n  {{0x00055d5a, 0x00055d5a, 0x00055d5a, 0x003fc000}},\n  {{0x0005a7df, 0x0005a7df, 0x0005a7df, 0x003fc000}},\n  {{0x0005f264, 0x0005f264, 0x0005f264, 0x003fc000}},\n  {{0x00063ce9, 0x00063ce9, 0x00063ce9, 0x003fc000}},\n  {{0x0006876e, 0x0006876e, 0x0006876e, 0x003fc000}},\n  {{0x0006d1f3, 0x0006d1f3, 0x0006d1f3, 0x003fc000}},\n  {{0x00071c78, 0x00071c78, 0x00071c78, 0x003fc000}},\n  {{0x000766fd, 0x000766fd, 0x000766fd, 0x003fc000}},\n  {{0x0007b182, 0x0007b182, 0x0007b182, 0x003fc000}},\n  {{0x0007fc07, 0x0007fc07, 0x0007fc07, 0x003fc000}},\n  {{0x0008468c, 0x0008468c, 0x0008468c, 0x003fc000}},\n  {{0x00089111, 0x00089111, 0x00089111, 0x003fc000}},\n  {{0x0008db96, 0x0008db96, 0x0008db96, 0x003fc000}},\n  {{0x0009261b, 0x0009261b, 0x0009261b, 0x003fc000}},\n  {{0x000970a0, 0x000970a0, 0x000970a0, 0x003fc000}},\n  {{0x0009bb25, 0x0009bb25, 0x0009bb25, 0x003fc000}},\n  {{0x000a05aa, 0x000a05aa, 0x000a05aa, 0x003fc000}},\n  {{0x000a502f, 0x000a502f, 0x000a502f, 0x003fc000}},\n  {{0x000a9ab4, 0x000a9ab4, 0x000a9ab4, 0x003fc000}},\n  {{0x000ae539, 0x000ae539, 0x000ae539, 0x003fc000}},\n  {{0x000b2fbe, 0x000b2fbe, 0x000b2fbe, 0x003fc000}},\n  {{0x000b7a43, 0x000b7a43, 0x000b7a43, 0x003fc000}},\n  {{0x000bc4c8, 0x000bc4c8, 0x000bc4c8, 0x003fc000}},\n  {{0x000c0f4d, 0x000c0f4d, 0x000c0f4d, 0x003fc000}},\n  {{0x000c59d2, 0x000c59d2, 0x000c59d2, 0x003fc000}},\n  {{0x000ca457, 0x000ca457, 0x000ca457, 0x003fc000}},\n  {{0x000ceedc, 0x000ceedc, 0x000ceedc, 0x003fc000}},\n  {{0x000d3961, 0x000d3961, 0x000d3961, 0x003fc000}},\n  {{0x000d83e6, 0x000d83e6, 0x000d83e6, 0x003fc000}},\n  {{0x000dce6b, 0x000dce6b, 0x000dce6b, 0x003fc000}},\n  {{0x000e18f0, 0x000e18f0, 0x000e18f0, 0x003fc000}},\n  {{0x000e6375, 0x000e6375, 0x000e6375, 0x003fc000}},\n  {{0x000eadfa, 0x000eadfa, 0x000eadfa, 0x003fc000}},\n  {{0x000ef87f, 0x000ef87f, 0x000ef87f, 0x003fc000}},\n  {{0x000f4304, 0x000f4304, 0x000f4304, 0x003fc000}},\n  {{0x000f8d89, 0x000f8d89, 0x000f8d89, 0x003fc000}},\n  {{0x000fd80e, 0x000fd80e, 0x000fd80e, 0x003fc000}},\n  {{0x00102293, 0x00102293, 0x00102293, 0x003fc000}},\n  {{0x00106d18, 0x00106d18, 0x00106d18, 0x003fc000}},\n  {{0x0010b79d, 0x0010b79d, 0x0010b79d, 0x003fc000}},\n  {{0x00110222, 0x00110222, 0x00110222, 0x003fc000}},\n  {{0x00114ca7, 0x00114ca7, 0x00114ca7, 0x003fc000}},\n  {{0x0011972c, 0x0011972c, 0x0011972c, 0x003fc000}},\n  {{0x0011e1b1, 0x0011e1b1, 0x0011e1b1, 0x003fc000}},\n  {{0x00122c36, 0x00122c36, 0x00122c36, 0x003fc000}},\n  {{0x001276bb, 0x001276bb, 0x001276bb, 0x003fc000}},\n  {{0x0012c140, 0x0012c140, 0x0012c140, 0x003fc000}},\n  {{0x00130bc5, 0x00130bc5, 0x00130bc5, 0x003fc000}},\n  {{0x0013564a, 0x0013564a, 0x0013564a, 0x003fc000}},\n  {{0x0013a0cf, 0x0013a0cf, 0x0013a0cf, 0x003fc000}},\n  {{0x0013eb54, 0x0013eb54, 0x0013eb54, 0x003fc000}},\n  {{0x001435d9, 0x001435d9, 0x001435d9, 0x003fc000}},\n  {{0x0014805e, 0x0014805e, 0x0014805e, 0x003fc000}},\n  {{0x0014cae3, 0x0014cae3, 0x0014cae3, 0x003fc000}},\n  {{0x00151568, 0x00151568, 0x00151568, 0x003fc000}},\n  {{0x00155fed, 0x00155fed, 0x00155fed, 0x003fc000}},\n  {{0x0015aa72, 0x0015aa72, 0x0015aa72, 0x003fc000}},\n  {{0x0015f4f7, 0x0015f4f7, 0x0015f4f7, 0x003fc000}},\n  {{0x00163f7c, 0x00163f7c, 0x00163f7c, 0x003fc000}},\n  {{0x00168a01, 0x00168a01, 0x00168a01, 0x003fc000}},\n  {{0x0016d486, 0x0016d486, 0x0016d486, 0x003fc000}},\n  {{0x00171f0b, 0x00171f0b, 0x00171f0b, 0x003fc000}},\n  {{0x00176990, 0x00176990, 0x00176990, 0x003fc000}},\n  {{0x0017b415, 0x0017b415, 0x0017b415, 0x003fc000}},\n  {{0x0017fe9a, 0x0017fe9a, 0x0017fe9a, 0x003fc000}},\n  {{0x0018491f, 0x0018491f, 0x0018491f, 0x003fc000}},\n  {{0x001893a4, 0x001893a4, 0x001893a4, 0x003fc000}},\n  {{0x0018de29, 0x0018de29, 0x0018de29, 0x003fc000}},\n  {{0x001928ae, 0x001928ae, 0x001928ae, 0x003fc000}},\n  {{0x00197333, 0x00197333, 0x00197333, 0x003fc000}},\n  {{0x0019bdb8, 0x0019bdb8, 0x0019bdb8, 0x003fc000}},\n  {{0x001a083d, 0x001a083d, 0x001a083d, 0x003fc000}},\n  {{0x001a52c2, 0x001a52c2, 0x001a52c2, 0x003fc000}},\n  {{0x001a9d47, 0x001a9d47, 0x001a9d47, 0x003fc000}},\n  {{0x001ae7cc, 0x001ae7cc, 0x001ae7cc, 0x003fc000}},\n  {{0x001b3251, 0x001b3251, 0x001b3251, 0x003fc000}},\n  {{0x001b7cd6, 0x001b7cd6, 0x001b7cd6, 0x003fc000}},\n  {{0x001bc75b, 0x001bc75b, 0x001bc75b, 0x003fc000}},\n  {{0x001c11e0, 0x001c11e0, 0x001c11e0, 0x003fc000}},\n  {{0x001c5c65, 0x001c5c65, 0x001c5c65, 0x003fc000}},\n  {{0x001ca6ea, 0x001ca6ea, 0x001ca6ea, 0x003fc000}},\n  {{0x001cf16f, 0x001cf16f, 0x001cf16f, 0x003fc000}},\n  {{0x001d3bf4, 0x001d3bf4, 0x001d3bf4, 0x003fc000}},\n  {{0x001d8679, 0x001d8679, 0x001d8679, 0x003fc000}},\n  {{0x001dd0fe, 0x001dd0fe, 0x001dd0fe, 0x003fc000}},\n  {{0x001e1b83, 0x001e1b83, 0x001e1b83, 0x003fc000}},\n  {{0x001e6608, 0x001e6608, 0x001e6608, 0x003fc000}},\n  {{0x001eb08d, 0x001eb08d, 0x001eb08d, 0x003fc000}},\n  {{0x001efb12, 0x001efb12, 0x001efb12, 0x003fc000}},\n  {{0x001f4597, 0x001f4597, 0x001f4597, 0x003fc000}},\n  {{0x001f901c, 0x001f901c, 0x001f901c, 0x003fc000}},\n  {{0x001fdaa1, 0x001fdaa1, 0x001fdaa1, 0x003fc000}},\n  {{0x00202526, 0x00202526, 0x00202526, 0x003fc000}},\n  {{0x00206fab, 0x00206fab, 0x00206fab, 0x003fc000}},\n  {{0x0020ba30, 0x0020ba30, 0x0020ba30, 0x003fc000}},\n  {{0x002104b5, 0x002104b5, 0x002104b5, 0x003fc000}},\n  {{0x00214f3a, 0x00214f3a, 0x00214f3a, 0x003fc000}},\n  {{0x002199bf, 0x002199bf, 0x002199bf, 0x003fc000}},\n  {{0x0021e444, 0x0021e444, 0x0021e444, 0x003fc000}},\n  {{0x00222ec9, 0x00222ec9, 0x00222ec9, 0x003fc000}},\n  {{0x0022794e, 0x0022794e, 0x0022794e, 0x003fc000}},\n  {{0x0022c3d3, 0x0022c3d3, 0x0022c3d3, 0x003fc000}},\n  {{0x00230e58, 0x00230e58, 0x00230e58, 0x003fc000}},\n  {{0x002358dd, 0x002358dd, 0x002358dd, 0x003fc000}},\n  {{0x0023a362, 0x0023a362, 0x0023a362, 0x003fc000}},\n  {{0x0023ede7, 0x0023ede7, 0x0023ede7, 0x003fc000}},\n  {{0x0024386c, 0x0024386c, 0x0024386c, 0x003fc000}},\n  {{0x002482f1, 0x002482f1, 0x002482f1, 0x003fc000}},\n  {{0x0024cd76, 0x0024cd76, 0x0024cd76, 0x003fc000}},\n  {{0x002517fb, 0x002517fb, 0x002517fb, 0x003fc000}},\n  {{0x00256280, 0x00256280, 0x00256280, 0x003fc000}},\n  {{0x0025ad05, 0x0025ad05, 0x0025ad05, 0x003fc000}},\n  {{0x0025f78a, 0x0025f78a, 0x0025f78a, 0x003fc000}},\n  {{0x0026420f, 0x0026420f, 0x0026420f, 0x003fc000}},\n  {{0x00268c94, 0x00268c94, 0x00268c94, 0x003fc000}},\n  {{0x0026d719, 0x0026d719, 0x0026d719, 0x003fc000}},\n  {{0x0027219e, 0x0027219e, 0x0027219e, 0x003fc000}},\n  {{0x00276c23, 0x00276c23, 0x00276c23, 0x003fc000}},\n  {{0x0027b6a8, 0x0027b6a8, 0x0027b6a8, 0x003fc000}},\n  {{0x0028012d, 0x0028012d, 0x0028012d, 0x003fc000}},\n  {{0x00284bb2, 0x00284bb2, 0x00284bb2, 0x003fc000}},\n  {{0x00289637, 0x00289637, 0x00289637, 0x003fc000}},\n  {{0x0028e0bc, 0x0028e0bc, 0x0028e0bc, 0x003fc000}},\n  {{0x00292b41, 0x00292b41, 0x00292b41, 0x003fc000}},\n  {{0x002975c6, 0x002975c6, 0x002975c6, 0x003fc000}},\n  {{0x0029c04b, 0x0029c04b, 0x0029c04b, 0x003fc000}},\n  {{0x002a0ad0, 0x002a0ad0, 0x002a0ad0, 0x003fc000}},\n  {{0x002a5555, 0x002a5555, 0x002a5555, 0x003fc000}},\n  {{0x002a9fda, 0x002a9fda, 0x002a9fda, 0x003fc000}},\n  {{0x002aea5f, 0x002aea5f, 0x002aea5f, 0x003fc000}},\n  {{0x002b34e4, 0x002b34e4, 0x002b34e4, 0x003fc000}},\n  {{0x002b7f69, 0x002b7f69, 0x002b7f69, 0x003fc000}},\n  {{0x002bc9ee, 0x002bc9ee, 0x002bc9ee, 0x003fc000}},\n  {{0x002c1473, 0x002c1473, 0x002c1473, 0x003fc000}},\n  {{0x002c5ef8, 0x002c5ef8, 0x002c5ef8, 0x003fc000}},\n  {{0x002ca97d, 0x002ca97d, 0x002ca97d, 0x003fc000}},\n  {{0x002cf402, 0x002cf402, 0x002cf402, 0x003fc000}},\n  {{0x002d3e87, 0x002d3e87, 0x002d3e87, 0x003fc000}},\n  {{0x002d890c, 0x002d890c, 0x002d890c, 0x003fc000}},\n  {{0x002dd391, 0x002dd391, 0x002dd391, 0x003fc000}},\n  {{0x002e1e16, 0x002e1e16, 0x002e1e16, 0x003fc000}},\n  {{0x002e689b, 0x002e689b, 0x002e689b, 0x003fc000}},\n  {{0x002eb320, 0x002eb320, 0x002eb320, 0x003fc000}},\n  {{0x002efda5, 0x002efda5, 0x002efda5, 0x003fc000}},\n  {{0x002f482a, 0x002f482a, 0x002f482a, 0x003fc000}},\n  {{0x002f92af, 0x002f92af, 0x002f92af, 0x003fc000}},\n  {{0x002fdd34, 0x002fdd34, 0x002fdd34, 0x003fc000}},\n  {{0x003027b9, 0x003027b9, 0x003027b9, 0x003fc000}},\n  {{0x0030723e, 0x0030723e, 0x0030723e, 0x003fc000}},\n  {{0x0030bcc3, 0x0030bcc3, 0x0030bcc3, 0x003fc000}},\n  {{0x00310748, 0x00310748, 0x00310748, 0x003fc000}},\n  {{0x003151cd, 0x003151cd, 0x003151cd, 0x003fc000}},\n  {{0x00319c52, 0x00319c52, 0x00319c52, 0x003fc000}},\n  {{0x0031e6d7, 0x0031e6d7, 0x0031e6d7, 0x003fc000}},\n  {{0x0032315c, 0x0032315c, 0x0032315c, 0x003fc000}},\n  {{0x00327be1, 0x00327be1, 0x00327be1, 0x003fc000}},\n  {{0x0032c666, 0x0032c666, 0x0032c666, 0x003fc000}},\n  {{0x003310eb, 0x003310eb, 0x003310eb, 0x003fc000}},\n  {{0x00335b70, 0x00335b70, 0x00335b70, 0x003fc000}},\n  {{0x0033a5f5, 0x0033a5f5, 0x0033a5f5, 0x003fc000}},\n  {{0x0033f07a, 0x0033f07a, 0x0033f07a, 0x003fc000}},\n  {{0x00343aff, 0x00343aff, 0x00343aff, 0x003fc000}},\n  {{0x00348584, 0x00348584, 0x00348584, 0x003fc000}},\n  {{0x0034d009, 0x0034d009, 0x0034d009, 0x003fc000}},\n  {{0x00351a8e, 0x00351a8e, 0x00351a8e, 0x003fc000}},\n  {{0x00356513, 0x00356513, 0x00356513, 0x003fc000}},\n  {{0x0035af98, 0x0035af98, 0x0035af98, 0x003fc000}},\n  {{0x0035fa1d, 0x0035fa1d, 0x0035fa1d, 0x003fc000}},\n  {{0x003644a2, 0x003644a2, 0x003644a2, 0x003fc000}},\n  {{0x00368f27, 0x00368f27, 0x00368f27, 0x003fc000}},\n  {{0x0036d9ac, 0x0036d9ac, 0x0036d9ac, 0x003fc000}},\n  {{0x00372431, 0x00372431, 0x00372431, 0x003fc000}},\n  {{0x00376eb6, 0x00376eb6, 0x00376eb6, 0x003fc000}},\n  {{0x0037b93b, 0x0037b93b, 0x0037b93b, 0x003fc000}},\n  {{0x003803c0, 0x003803c0, 0x003803c0, 0x003fc000}},\n  {{0x00384e45, 0x00384e45, 0x00384e45, 0x003fc000}},\n  {{0x003898ca, 0x003898ca, 0x003898ca, 0x003fc000}},\n  {{0x0038e34f, 0x0038e34f, 0x0038e34f, 0x003fc000}},\n  {{0x00392dd4, 0x00392dd4, 0x00392dd4, 0x003fc000}},\n  {{0x00397859, 0x00397859, 0x00397859, 0x003fc000}},\n  {{0x0039c2de, 0x0039c2de, 0x0039c2de, 0x003fc000}},\n  {{0x003a0d63, 0x003a0d63, 0x003a0d63, 0x003fc000}},\n  {{0x003a57e8, 0x003a57e8, 0x003a57e8, 0x003fc000}},\n  {{0x003aa26d, 0x003aa26d, 0x003aa26d, 0x003fc000}},\n  {{0x003aecf2, 0x003aecf2, 0x003aecf2, 0x003fc000}},\n  {{0x003b3777, 0x003b3777, 0x003b3777, 0x003fc000}},\n  {{0x003b81fc, 0x003b81fc, 0x003b81fc, 0x003fc000}},\n  {{0x003bcc81, 0x003bcc81, 0x003bcc81, 0x003fc000}},\n  {{0x003c1706, 0x003c1706, 0x003c1706, 0x003fc000}},\n  {{0x003c618b, 0x003c618b, 0x003c618b, 0x003fc000}},\n  {{0x003cac10, 0x003cac10, 0x003cac10, 0x003fc000}},\n  {{0x003cf695, 0x003cf695, 0x003cf695, 0x003fc000}},\n  {{0x003d411a, 0x003d411a, 0x003d411a, 0x003fc000}},\n  {{0x003d8b9f, 0x003d8b9f, 0x003d8b9f, 0x003fc000}},\n  {{0x003dd624, 0x003dd624, 0x003dd624, 0x003fc000}},\n  {{0x003e20a9, 0x003e20a9, 0x003e20a9, 0x003fc000}},\n  {{0x003e6b2e, 0x003e6b2e, 0x003e6b2e, 0x003fc000}},\n  {{0x003eb5b3, 0x003eb5b3, 0x003eb5b3, 0x003fc000}},\n  {{0x003f0038, 0x003f0038, 0x003f0038, 0x003fc000}},\n  {{0x003f4abd, 0x003f4abd, 0x003f4abd, 0x003fc000}},\n  {{0x003f9542, 0x003f9542, 0x003f9542, 0x003fc000}},\n  {{0x003fdfc7, 0x003fdfc7, 0x003fdfc7, 0x003fc000}},\n  {{0x00402a4c, 0x00402a4c, 0x00402a4c, 0x003fc000}},\n  {{0x004074d1, 0x004074d1, 0x004074d1, 0x003fc000}},\n  {{0x0040bf56, 0x0040bf56, 0x0040bf56, 0x003fc000}},\n  {{0x004109db, 0x004109db, 0x004109db, 0x003fc000}},\n  {{0x00415460, 0x00415460, 0x00415460, 0x003fc000}},\n  {{0x00419ee5, 0x00419ee5, 0x00419ee5, 0x003fc000}},\n  {{0x0041e96a, 0x0041e96a, 0x0041e96a, 0x003fc000}},\n  {{0x004233ef, 0x004233ef, 0x004233ef, 0x003fc000}},\n  {{0x00427e74, 0x00427e74, 0x00427e74, 0x003fc000}},\n  {{0x0042c8f9, 0x0042c8f9, 0x0042c8f9, 0x003fc000}},\n  {{0x0043137e, 0x0043137e, 0x0043137e, 0x003fc000}},\n  {{0x00435e03, 0x00435e03, 0x00435e03, 0x003fc000}},\n  {{0x0043a888, 0x0043a888, 0x0043a888, 0x003fc000}},\n  {{0x0043f30d, 0x0043f30d, 0x0043f30d, 0x003fc000}},\n  {{0x00443d92, 0x00443d92, 0x00443d92, 0x003fc000}},\n  {{0x00448817, 0x00448817, 0x00448817, 0x003fc000}},\n  {{0x0044d29c, 0x0044d29c, 0x0044d29c, 0x003fc000}},\n  {{0x00451d21, 0x00451d21, 0x00451d21, 0x003fc000}},\n  {{0x004567a6, 0x004567a6, 0x004567a6, 0x003fc000}},\n  {{0x0045b22b, 0x0045b22b, 0x0045b22b, 0x003fc000}}\n};\n\nstatic const VP8kCstSSE2 VP8kUtoRGBA[256] = {\n  {{0, 0x000c8980, 0xffbf7300, 0}}, {{0, 0x000c706d, 0xffbff41a, 0}},\n  {{0, 0x000c575a, 0xffc07534, 0}}, {{0, 0x000c3e47, 0xffc0f64e, 0}},\n  {{0, 0x000c2534, 0xffc17768, 0}}, {{0, 0x000c0c21, 0xffc1f882, 0}},\n  {{0, 0x000bf30e, 0xffc2799c, 0}}, {{0, 0x000bd9fb, 0xffc2fab6, 0}},\n  {{0, 0x000bc0e8, 0xffc37bd0, 0}}, {{0, 0x000ba7d5, 0xffc3fcea, 0}},\n  {{0, 0x000b8ec2, 0xffc47e04, 0}}, {{0, 0x000b75af, 0xffc4ff1e, 0}},\n  {{0, 0x000b5c9c, 0xffc58038, 0}}, {{0, 0x000b4389, 0xffc60152, 0}},\n  {{0, 0x000b2a76, 0xffc6826c, 0}}, {{0, 0x000b1163, 0xffc70386, 0}},\n  {{0, 0x000af850, 0xffc784a0, 0}}, {{0, 0x000adf3d, 0xffc805ba, 0}},\n  {{0, 0x000ac62a, 0xffc886d4, 0}}, {{0, 0x000aad17, 0xffc907ee, 0}},\n  {{0, 0x000a9404, 0xffc98908, 0}}, {{0, 0x000a7af1, 0xffca0a22, 0}},\n  {{0, 0x000a61de, 0xffca8b3c, 0}}, {{0, 0x000a48cb, 0xffcb0c56, 0}},\n  {{0, 0x000a2fb8, 0xffcb8d70, 0}}, {{0, 0x000a16a5, 0xffcc0e8a, 0}},\n  {{0, 0x0009fd92, 0xffcc8fa4, 0}}, {{0, 0x0009e47f, 0xffcd10be, 0}},\n  {{0, 0x0009cb6c, 0xffcd91d8, 0}}, {{0, 0x0009b259, 0xffce12f2, 0}},\n  {{0, 0x00099946, 0xffce940c, 0}}, {{0, 0x00098033, 0xffcf1526, 0}},\n  {{0, 0x00096720, 0xffcf9640, 0}}, {{0, 0x00094e0d, 0xffd0175a, 0}},\n  {{0, 0x000934fa, 0xffd09874, 0}}, {{0, 0x00091be7, 0xffd1198e, 0}},\n  {{0, 0x000902d4, 0xffd19aa8, 0}}, {{0, 0x0008e9c1, 0xffd21bc2, 0}},\n  {{0, 0x0008d0ae, 0xffd29cdc, 0}}, {{0, 0x0008b79b, 0xffd31df6, 0}},\n  {{0, 0x00089e88, 0xffd39f10, 0}}, {{0, 0x00088575, 0xffd4202a, 0}},\n  {{0, 0x00086c62, 0xffd4a144, 0}}, {{0, 0x0008534f, 0xffd5225e, 0}},\n  {{0, 0x00083a3c, 0xffd5a378, 0}}, {{0, 0x00082129, 0xffd62492, 0}},\n  {{0, 0x00080816, 0xffd6a5ac, 0}}, {{0, 0x0007ef03, 0xffd726c6, 0}},\n  {{0, 0x0007d5f0, 0xffd7a7e0, 0}}, {{0, 0x0007bcdd, 0xffd828fa, 0}},\n  {{0, 0x0007a3ca, 0xffd8aa14, 0}}, {{0, 0x00078ab7, 0xffd92b2e, 0}},\n  {{0, 0x000771a4, 0xffd9ac48, 0}}, {{0, 0x00075891, 0xffda2d62, 0}},\n  {{0, 0x00073f7e, 0xffdaae7c, 0}}, {{0, 0x0007266b, 0xffdb2f96, 0}},\n  {{0, 0x00070d58, 0xffdbb0b0, 0}}, {{0, 0x0006f445, 0xffdc31ca, 0}},\n  {{0, 0x0006db32, 0xffdcb2e4, 0}}, {{0, 0x0006c21f, 0xffdd33fe, 0}},\n  {{0, 0x0006a90c, 0xffddb518, 0}}, {{0, 0x00068ff9, 0xffde3632, 0}},\n  {{0, 0x000676e6, 0xffdeb74c, 0}}, {{0, 0x00065dd3, 0xffdf3866, 0}},\n  {{0, 0x000644c0, 0xffdfb980, 0}}, {{0, 0x00062bad, 0xffe03a9a, 0}},\n  {{0, 0x0006129a, 0xffe0bbb4, 0}}, {{0, 0x0005f987, 0xffe13cce, 0}},\n  {{0, 0x0005e074, 0xffe1bde8, 0}}, {{0, 0x0005c761, 0xffe23f02, 0}},\n  {{0, 0x0005ae4e, 0xffe2c01c, 0}}, {{0, 0x0005953b, 0xffe34136, 0}},\n  {{0, 0x00057c28, 0xffe3c250, 0}}, {{0, 0x00056315, 0xffe4436a, 0}},\n  {{0, 0x00054a02, 0xffe4c484, 0}}, {{0, 0x000530ef, 0xffe5459e, 0}},\n  {{0, 0x000517dc, 0xffe5c6b8, 0}}, {{0, 0x0004fec9, 0xffe647d2, 0}},\n  {{0, 0x0004e5b6, 0xffe6c8ec, 0}}, {{0, 0x0004cca3, 0xffe74a06, 0}},\n  {{0, 0x0004b390, 0xffe7cb20, 0}}, {{0, 0x00049a7d, 0xffe84c3a, 0}},\n  {{0, 0x0004816a, 0xffe8cd54, 0}}, {{0, 0x00046857, 0xffe94e6e, 0}},\n  {{0, 0x00044f44, 0xffe9cf88, 0}}, {{0, 0x00043631, 0xffea50a2, 0}},\n  {{0, 0x00041d1e, 0xffead1bc, 0}}, {{0, 0x0004040b, 0xffeb52d6, 0}},\n  {{0, 0x0003eaf8, 0xffebd3f0, 0}}, {{0, 0x0003d1e5, 0xffec550a, 0}},\n  {{0, 0x0003b8d2, 0xffecd624, 0}}, {{0, 0x00039fbf, 0xffed573e, 0}},\n  {{0, 0x000386ac, 0xffedd858, 0}}, {{0, 0x00036d99, 0xffee5972, 0}},\n  {{0, 0x00035486, 0xffeeda8c, 0}}, {{0, 0x00033b73, 0xffef5ba6, 0}},\n  {{0, 0x00032260, 0xffefdcc0, 0}}, {{0, 0x0003094d, 0xfff05dda, 0}},\n  {{0, 0x0002f03a, 0xfff0def4, 0}}, {{0, 0x0002d727, 0xfff1600e, 0}},\n  {{0, 0x0002be14, 0xfff1e128, 0}}, {{0, 0x0002a501, 0xfff26242, 0}},\n  {{0, 0x00028bee, 0xfff2e35c, 0}}, {{0, 0x000272db, 0xfff36476, 0}},\n  {{0, 0x000259c8, 0xfff3e590, 0}}, {{0, 0x000240b5, 0xfff466aa, 0}},\n  {{0, 0x000227a2, 0xfff4e7c4, 0}}, {{0, 0x00020e8f, 0xfff568de, 0}},\n  {{0, 0x0001f57c, 0xfff5e9f8, 0}}, {{0, 0x0001dc69, 0xfff66b12, 0}},\n  {{0, 0x0001c356, 0xfff6ec2c, 0}}, {{0, 0x0001aa43, 0xfff76d46, 0}},\n  {{0, 0x00019130, 0xfff7ee60, 0}}, {{0, 0x0001781d, 0xfff86f7a, 0}},\n  {{0, 0x00015f0a, 0xfff8f094, 0}}, {{0, 0x000145f7, 0xfff971ae, 0}},\n  {{0, 0x00012ce4, 0xfff9f2c8, 0}}, {{0, 0x000113d1, 0xfffa73e2, 0}},\n  {{0, 0x0000fabe, 0xfffaf4fc, 0}}, {{0, 0x0000e1ab, 0xfffb7616, 0}},\n  {{0, 0x0000c898, 0xfffbf730, 0}}, {{0, 0x0000af85, 0xfffc784a, 0}},\n  {{0, 0x00009672, 0xfffcf964, 0}}, {{0, 0x00007d5f, 0xfffd7a7e, 0}},\n  {{0, 0x0000644c, 0xfffdfb98, 0}}, {{0, 0x00004b39, 0xfffe7cb2, 0}},\n  {{0, 0x00003226, 0xfffefdcc, 0}}, {{0, 0x00001913, 0xffff7ee6, 0}},\n  {{0, 0x00000000, 0x00000000, 0}}, {{0, 0xffffe6ed, 0x0000811a, 0}},\n  {{0, 0xffffcdda, 0x00010234, 0}}, {{0, 0xffffb4c7, 0x0001834e, 0}},\n  {{0, 0xffff9bb4, 0x00020468, 0}}, {{0, 0xffff82a1, 0x00028582, 0}},\n  {{0, 0xffff698e, 0x0003069c, 0}}, {{0, 0xffff507b, 0x000387b6, 0}},\n  {{0, 0xffff3768, 0x000408d0, 0}}, {{0, 0xffff1e55, 0x000489ea, 0}},\n  {{0, 0xffff0542, 0x00050b04, 0}}, {{0, 0xfffeec2f, 0x00058c1e, 0}},\n  {{0, 0xfffed31c, 0x00060d38, 0}}, {{0, 0xfffeba09, 0x00068e52, 0}},\n  {{0, 0xfffea0f6, 0x00070f6c, 0}}, {{0, 0xfffe87e3, 0x00079086, 0}},\n  {{0, 0xfffe6ed0, 0x000811a0, 0}}, {{0, 0xfffe55bd, 0x000892ba, 0}},\n  {{0, 0xfffe3caa, 0x000913d4, 0}}, {{0, 0xfffe2397, 0x000994ee, 0}},\n  {{0, 0xfffe0a84, 0x000a1608, 0}}, {{0, 0xfffdf171, 0x000a9722, 0}},\n  {{0, 0xfffdd85e, 0x000b183c, 0}}, {{0, 0xfffdbf4b, 0x000b9956, 0}},\n  {{0, 0xfffda638, 0x000c1a70, 0}}, {{0, 0xfffd8d25, 0x000c9b8a, 0}},\n  {{0, 0xfffd7412, 0x000d1ca4, 0}}, {{0, 0xfffd5aff, 0x000d9dbe, 0}},\n  {{0, 0xfffd41ec, 0x000e1ed8, 0}}, {{0, 0xfffd28d9, 0x000e9ff2, 0}},\n  {{0, 0xfffd0fc6, 0x000f210c, 0}}, {{0, 0xfffcf6b3, 0x000fa226, 0}},\n  {{0, 0xfffcdda0, 0x00102340, 0}}, {{0, 0xfffcc48d, 0x0010a45a, 0}},\n  {{0, 0xfffcab7a, 0x00112574, 0}}, {{0, 0xfffc9267, 0x0011a68e, 0}},\n  {{0, 0xfffc7954, 0x001227a8, 0}}, {{0, 0xfffc6041, 0x0012a8c2, 0}},\n  {{0, 0xfffc472e, 0x001329dc, 0}}, {{0, 0xfffc2e1b, 0x0013aaf6, 0}},\n  {{0, 0xfffc1508, 0x00142c10, 0}}, {{0, 0xfffbfbf5, 0x0014ad2a, 0}},\n  {{0, 0xfffbe2e2, 0x00152e44, 0}}, {{0, 0xfffbc9cf, 0x0015af5e, 0}},\n  {{0, 0xfffbb0bc, 0x00163078, 0}}, {{0, 0xfffb97a9, 0x0016b192, 0}},\n  {{0, 0xfffb7e96, 0x001732ac, 0}}, {{0, 0xfffb6583, 0x0017b3c6, 0}},\n  {{0, 0xfffb4c70, 0x001834e0, 0}}, {{0, 0xfffb335d, 0x0018b5fa, 0}},\n  {{0, 0xfffb1a4a, 0x00193714, 0}}, {{0, 0xfffb0137, 0x0019b82e, 0}},\n  {{0, 0xfffae824, 0x001a3948, 0}}, {{0, 0xfffacf11, 0x001aba62, 0}},\n  {{0, 0xfffab5fe, 0x001b3b7c, 0}}, {{0, 0xfffa9ceb, 0x001bbc96, 0}},\n  {{0, 0xfffa83d8, 0x001c3db0, 0}}, {{0, 0xfffa6ac5, 0x001cbeca, 0}},\n  {{0, 0xfffa51b2, 0x001d3fe4, 0}}, {{0, 0xfffa389f, 0x001dc0fe, 0}},\n  {{0, 0xfffa1f8c, 0x001e4218, 0}}, {{0, 0xfffa0679, 0x001ec332, 0}},\n  {{0, 0xfff9ed66, 0x001f444c, 0}}, {{0, 0xfff9d453, 0x001fc566, 0}},\n  {{0, 0xfff9bb40, 0x00204680, 0}}, {{0, 0xfff9a22d, 0x0020c79a, 0}},\n  {{0, 0xfff9891a, 0x002148b4, 0}}, {{0, 0xfff97007, 0x0021c9ce, 0}},\n  {{0, 0xfff956f4, 0x00224ae8, 0}}, {{0, 0xfff93de1, 0x0022cc02, 0}},\n  {{0, 0xfff924ce, 0x00234d1c, 0}}, {{0, 0xfff90bbb, 0x0023ce36, 0}},\n  {{0, 0xfff8f2a8, 0x00244f50, 0}}, {{0, 0xfff8d995, 0x0024d06a, 0}},\n  {{0, 0xfff8c082, 0x00255184, 0}}, {{0, 0xfff8a76f, 0x0025d29e, 0}},\n  {{0, 0xfff88e5c, 0x002653b8, 0}}, {{0, 0xfff87549, 0x0026d4d2, 0}},\n  {{0, 0xfff85c36, 0x002755ec, 0}}, {{0, 0xfff84323, 0x0027d706, 0}},\n  {{0, 0xfff82a10, 0x00285820, 0}}, {{0, 0xfff810fd, 0x0028d93a, 0}},\n  {{0, 0xfff7f7ea, 0x00295a54, 0}}, {{0, 0xfff7ded7, 0x0029db6e, 0}},\n  {{0, 0xfff7c5c4, 0x002a5c88, 0}}, {{0, 0xfff7acb1, 0x002adda2, 0}},\n  {{0, 0xfff7939e, 0x002b5ebc, 0}}, {{0, 0xfff77a8b, 0x002bdfd6, 0}},\n  {{0, 0xfff76178, 0x002c60f0, 0}}, {{0, 0xfff74865, 0x002ce20a, 0}},\n  {{0, 0xfff72f52, 0x002d6324, 0}}, {{0, 0xfff7163f, 0x002de43e, 0}},\n  {{0, 0xfff6fd2c, 0x002e6558, 0}}, {{0, 0xfff6e419, 0x002ee672, 0}},\n  {{0, 0xfff6cb06, 0x002f678c, 0}}, {{0, 0xfff6b1f3, 0x002fe8a6, 0}},\n  {{0, 0xfff698e0, 0x003069c0, 0}}, {{0, 0xfff67fcd, 0x0030eada, 0}},\n  {{0, 0xfff666ba, 0x00316bf4, 0}}, {{0, 0xfff64da7, 0x0031ed0e, 0}},\n  {{0, 0xfff63494, 0x00326e28, 0}}, {{0, 0xfff61b81, 0x0032ef42, 0}},\n  {{0, 0xfff6026e, 0x0033705c, 0}}, {{0, 0xfff5e95b, 0x0033f176, 0}},\n  {{0, 0xfff5d048, 0x00347290, 0}}, {{0, 0xfff5b735, 0x0034f3aa, 0}},\n  {{0, 0xfff59e22, 0x003574c4, 0}}, {{0, 0xfff5850f, 0x0035f5de, 0}},\n  {{0, 0xfff56bfc, 0x003676f8, 0}}, {{0, 0xfff552e9, 0x0036f812, 0}},\n  {{0, 0xfff539d6, 0x0037792c, 0}}, {{0, 0xfff520c3, 0x0037fa46, 0}},\n  {{0, 0xfff507b0, 0x00387b60, 0}}, {{0, 0xfff4ee9d, 0x0038fc7a, 0}},\n  {{0, 0xfff4d58a, 0x00397d94, 0}}, {{0, 0xfff4bc77, 0x0039feae, 0}},\n  {{0, 0xfff4a364, 0x003a7fc8, 0}}, {{0, 0xfff48a51, 0x003b00e2, 0}},\n  {{0, 0xfff4713e, 0x003b81fc, 0}}, {{0, 0xfff4582b, 0x003c0316, 0}},\n  {{0, 0xfff43f18, 0x003c8430, 0}}, {{0, 0xfff42605, 0x003d054a, 0}},\n  {{0, 0xfff40cf2, 0x003d8664, 0}}, {{0, 0xfff3f3df, 0x003e077e, 0}},\n  {{0, 0xfff3dacc, 0x003e8898, 0}}, {{0, 0xfff3c1b9, 0x003f09b2, 0}},\n  {{0, 0xfff3a8a6, 0x003f8acc, 0}}, {{0, 0xfff38f93, 0x00400be6, 0}}\n};\n\nstatic VP8kCstSSE2 VP8kVtoRGBA[256] = {\n  {{0xffcced80, 0x001a0400, 0, 0}}, {{0xffcd53a5, 0x0019cff8, 0, 0}},\n  {{0xffcdb9ca, 0x00199bf0, 0, 0}}, {{0xffce1fef, 0x001967e8, 0, 0}},\n  {{0xffce8614, 0x001933e0, 0, 0}}, {{0xffceec39, 0x0018ffd8, 0, 0}},\n  {{0xffcf525e, 0x0018cbd0, 0, 0}}, {{0xffcfb883, 0x001897c8, 0, 0}},\n  {{0xffd01ea8, 0x001863c0, 0, 0}}, {{0xffd084cd, 0x00182fb8, 0, 0}},\n  {{0xffd0eaf2, 0x0017fbb0, 0, 0}}, {{0xffd15117, 0x0017c7a8, 0, 0}},\n  {{0xffd1b73c, 0x001793a0, 0, 0}}, {{0xffd21d61, 0x00175f98, 0, 0}},\n  {{0xffd28386, 0x00172b90, 0, 0}}, {{0xffd2e9ab, 0x0016f788, 0, 0}},\n  {{0xffd34fd0, 0x0016c380, 0, 0}}, {{0xffd3b5f5, 0x00168f78, 0, 0}},\n  {{0xffd41c1a, 0x00165b70, 0, 0}}, {{0xffd4823f, 0x00162768, 0, 0}},\n  {{0xffd4e864, 0x0015f360, 0, 0}}, {{0xffd54e89, 0x0015bf58, 0, 0}},\n  {{0xffd5b4ae, 0x00158b50, 0, 0}}, {{0xffd61ad3, 0x00155748, 0, 0}},\n  {{0xffd680f8, 0x00152340, 0, 0}}, {{0xffd6e71d, 0x0014ef38, 0, 0}},\n  {{0xffd74d42, 0x0014bb30, 0, 0}}, {{0xffd7b367, 0x00148728, 0, 0}},\n  {{0xffd8198c, 0x00145320, 0, 0}}, {{0xffd87fb1, 0x00141f18, 0, 0}},\n  {{0xffd8e5d6, 0x0013eb10, 0, 0}}, {{0xffd94bfb, 0x0013b708, 0, 0}},\n  {{0xffd9b220, 0x00138300, 0, 0}}, {{0xffda1845, 0x00134ef8, 0, 0}},\n  {{0xffda7e6a, 0x00131af0, 0, 0}}, {{0xffdae48f, 0x0012e6e8, 0, 0}},\n  {{0xffdb4ab4, 0x0012b2e0, 0, 0}}, {{0xffdbb0d9, 0x00127ed8, 0, 0}},\n  {{0xffdc16fe, 0x00124ad0, 0, 0}}, {{0xffdc7d23, 0x001216c8, 0, 0}},\n  {{0xffdce348, 0x0011e2c0, 0, 0}}, {{0xffdd496d, 0x0011aeb8, 0, 0}},\n  {{0xffddaf92, 0x00117ab0, 0, 0}}, {{0xffde15b7, 0x001146a8, 0, 0}},\n  {{0xffde7bdc, 0x001112a0, 0, 0}}, {{0xffdee201, 0x0010de98, 0, 0}},\n  {{0xffdf4826, 0x0010aa90, 0, 0}}, {{0xffdfae4b, 0x00107688, 0, 0}},\n  {{0xffe01470, 0x00104280, 0, 0}}, {{0xffe07a95, 0x00100e78, 0, 0}},\n  {{0xffe0e0ba, 0x000fda70, 0, 0}}, {{0xffe146df, 0x000fa668, 0, 0}},\n  {{0xffe1ad04, 0x000f7260, 0, 0}}, {{0xffe21329, 0x000f3e58, 0, 0}},\n  {{0xffe2794e, 0x000f0a50, 0, 0}}, {{0xffe2df73, 0x000ed648, 0, 0}},\n  {{0xffe34598, 0x000ea240, 0, 0}}, {{0xffe3abbd, 0x000e6e38, 0, 0}},\n  {{0xffe411e2, 0x000e3a30, 0, 0}}, {{0xffe47807, 0x000e0628, 0, 0}},\n  {{0xffe4de2c, 0x000dd220, 0, 0}}, {{0xffe54451, 0x000d9e18, 0, 0}},\n  {{0xffe5aa76, 0x000d6a10, 0, 0}}, {{0xffe6109b, 0x000d3608, 0, 0}},\n  {{0xffe676c0, 0x000d0200, 0, 0}}, {{0xffe6dce5, 0x000ccdf8, 0, 0}},\n  {{0xffe7430a, 0x000c99f0, 0, 0}}, {{0xffe7a92f, 0x000c65e8, 0, 0}},\n  {{0xffe80f54, 0x000c31e0, 0, 0}}, {{0xffe87579, 0x000bfdd8, 0, 0}},\n  {{0xffe8db9e, 0x000bc9d0, 0, 0}}, {{0xffe941c3, 0x000b95c8, 0, 0}},\n  {{0xffe9a7e8, 0x000b61c0, 0, 0}}, {{0xffea0e0d, 0x000b2db8, 0, 0}},\n  {{0xffea7432, 0x000af9b0, 0, 0}}, {{0xffeada57, 0x000ac5a8, 0, 0}},\n  {{0xffeb407c, 0x000a91a0, 0, 0}}, {{0xffeba6a1, 0x000a5d98, 0, 0}},\n  {{0xffec0cc6, 0x000a2990, 0, 0}}, {{0xffec72eb, 0x0009f588, 0, 0}},\n  {{0xffecd910, 0x0009c180, 0, 0}}, {{0xffed3f35, 0x00098d78, 0, 0}},\n  {{0xffeda55a, 0x00095970, 0, 0}}, {{0xffee0b7f, 0x00092568, 0, 0}},\n  {{0xffee71a4, 0x0008f160, 0, 0}}, {{0xffeed7c9, 0x0008bd58, 0, 0}},\n  {{0xffef3dee, 0x00088950, 0, 0}}, {{0xffefa413, 0x00085548, 0, 0}},\n  {{0xfff00a38, 0x00082140, 0, 0}}, {{0xfff0705d, 0x0007ed38, 0, 0}},\n  {{0xfff0d682, 0x0007b930, 0, 0}}, {{0xfff13ca7, 0x00078528, 0, 0}},\n  {{0xfff1a2cc, 0x00075120, 0, 0}}, {{0xfff208f1, 0x00071d18, 0, 0}},\n  {{0xfff26f16, 0x0006e910, 0, 0}}, {{0xfff2d53b, 0x0006b508, 0, 0}},\n  {{0xfff33b60, 0x00068100, 0, 0}}, {{0xfff3a185, 0x00064cf8, 0, 0}},\n  {{0xfff407aa, 0x000618f0, 0, 0}}, {{0xfff46dcf, 0x0005e4e8, 0, 0}},\n  {{0xfff4d3f4, 0x0005b0e0, 0, 0}}, {{0xfff53a19, 0x00057cd8, 0, 0}},\n  {{0xfff5a03e, 0x000548d0, 0, 0}}, {{0xfff60663, 0x000514c8, 0, 0}},\n  {{0xfff66c88, 0x0004e0c0, 0, 0}}, {{0xfff6d2ad, 0x0004acb8, 0, 0}},\n  {{0xfff738d2, 0x000478b0, 0, 0}}, {{0xfff79ef7, 0x000444a8, 0, 0}},\n  {{0xfff8051c, 0x000410a0, 0, 0}}, {{0xfff86b41, 0x0003dc98, 0, 0}},\n  {{0xfff8d166, 0x0003a890, 0, 0}}, {{0xfff9378b, 0x00037488, 0, 0}},\n  {{0xfff99db0, 0x00034080, 0, 0}}, {{0xfffa03d5, 0x00030c78, 0, 0}},\n  {{0xfffa69fa, 0x0002d870, 0, 0}}, {{0xfffad01f, 0x0002a468, 0, 0}},\n  {{0xfffb3644, 0x00027060, 0, 0}}, {{0xfffb9c69, 0x00023c58, 0, 0}},\n  {{0xfffc028e, 0x00020850, 0, 0}}, {{0xfffc68b3, 0x0001d448, 0, 0}},\n  {{0xfffcced8, 0x0001a040, 0, 0}}, {{0xfffd34fd, 0x00016c38, 0, 0}},\n  {{0xfffd9b22, 0x00013830, 0, 0}}, {{0xfffe0147, 0x00010428, 0, 0}},\n  {{0xfffe676c, 0x0000d020, 0, 0}}, {{0xfffecd91, 0x00009c18, 0, 0}},\n  {{0xffff33b6, 0x00006810, 0, 0}}, {{0xffff99db, 0x00003408, 0, 0}},\n  {{0x00000000, 0x00000000, 0, 0}}, {{0x00006625, 0xffffcbf8, 0, 0}},\n  {{0x0000cc4a, 0xffff97f0, 0, 0}}, {{0x0001326f, 0xffff63e8, 0, 0}},\n  {{0x00019894, 0xffff2fe0, 0, 0}}, {{0x0001feb9, 0xfffefbd8, 0, 0}},\n  {{0x000264de, 0xfffec7d0, 0, 0}}, {{0x0002cb03, 0xfffe93c8, 0, 0}},\n  {{0x00033128, 0xfffe5fc0, 0, 0}}, {{0x0003974d, 0xfffe2bb8, 0, 0}},\n  {{0x0003fd72, 0xfffdf7b0, 0, 0}}, {{0x00046397, 0xfffdc3a8, 0, 0}},\n  {{0x0004c9bc, 0xfffd8fa0, 0, 0}}, {{0x00052fe1, 0xfffd5b98, 0, 0}},\n  {{0x00059606, 0xfffd2790, 0, 0}}, {{0x0005fc2b, 0xfffcf388, 0, 0}},\n  {{0x00066250, 0xfffcbf80, 0, 0}}, {{0x0006c875, 0xfffc8b78, 0, 0}},\n  {{0x00072e9a, 0xfffc5770, 0, 0}}, {{0x000794bf, 0xfffc2368, 0, 0}},\n  {{0x0007fae4, 0xfffbef60, 0, 0}}, {{0x00086109, 0xfffbbb58, 0, 0}},\n  {{0x0008c72e, 0xfffb8750, 0, 0}}, {{0x00092d53, 0xfffb5348, 0, 0}},\n  {{0x00099378, 0xfffb1f40, 0, 0}}, {{0x0009f99d, 0xfffaeb38, 0, 0}},\n  {{0x000a5fc2, 0xfffab730, 0, 0}}, {{0x000ac5e7, 0xfffa8328, 0, 0}},\n  {{0x000b2c0c, 0xfffa4f20, 0, 0}}, {{0x000b9231, 0xfffa1b18, 0, 0}},\n  {{0x000bf856, 0xfff9e710, 0, 0}}, {{0x000c5e7b, 0xfff9b308, 0, 0}},\n  {{0x000cc4a0, 0xfff97f00, 0, 0}}, {{0x000d2ac5, 0xfff94af8, 0, 0}},\n  {{0x000d90ea, 0xfff916f0, 0, 0}}, {{0x000df70f, 0xfff8e2e8, 0, 0}},\n  {{0x000e5d34, 0xfff8aee0, 0, 0}}, {{0x000ec359, 0xfff87ad8, 0, 0}},\n  {{0x000f297e, 0xfff846d0, 0, 0}}, {{0x000f8fa3, 0xfff812c8, 0, 0}},\n  {{0x000ff5c8, 0xfff7dec0, 0, 0}}, {{0x00105bed, 0xfff7aab8, 0, 0}},\n  {{0x0010c212, 0xfff776b0, 0, 0}}, {{0x00112837, 0xfff742a8, 0, 0}},\n  {{0x00118e5c, 0xfff70ea0, 0, 0}}, {{0x0011f481, 0xfff6da98, 0, 0}},\n  {{0x00125aa6, 0xfff6a690, 0, 0}}, {{0x0012c0cb, 0xfff67288, 0, 0}},\n  {{0x001326f0, 0xfff63e80, 0, 0}}, {{0x00138d15, 0xfff60a78, 0, 0}},\n  {{0x0013f33a, 0xfff5d670, 0, 0}}, {{0x0014595f, 0xfff5a268, 0, 0}},\n  {{0x0014bf84, 0xfff56e60, 0, 0}}, {{0x001525a9, 0xfff53a58, 0, 0}},\n  {{0x00158bce, 0xfff50650, 0, 0}}, {{0x0015f1f3, 0xfff4d248, 0, 0}},\n  {{0x00165818, 0xfff49e40, 0, 0}}, {{0x0016be3d, 0xfff46a38, 0, 0}},\n  {{0x00172462, 0xfff43630, 0, 0}}, {{0x00178a87, 0xfff40228, 0, 0}},\n  {{0x0017f0ac, 0xfff3ce20, 0, 0}}, {{0x001856d1, 0xfff39a18, 0, 0}},\n  {{0x0018bcf6, 0xfff36610, 0, 0}}, {{0x0019231b, 0xfff33208, 0, 0}},\n  {{0x00198940, 0xfff2fe00, 0, 0}}, {{0x0019ef65, 0xfff2c9f8, 0, 0}},\n  {{0x001a558a, 0xfff295f0, 0, 0}}, {{0x001abbaf, 0xfff261e8, 0, 0}},\n  {{0x001b21d4, 0xfff22de0, 0, 0}}, {{0x001b87f9, 0xfff1f9d8, 0, 0}},\n  {{0x001bee1e, 0xfff1c5d0, 0, 0}}, {{0x001c5443, 0xfff191c8, 0, 0}},\n  {{0x001cba68, 0xfff15dc0, 0, 0}}, {{0x001d208d, 0xfff129b8, 0, 0}},\n  {{0x001d86b2, 0xfff0f5b0, 0, 0}}, {{0x001decd7, 0xfff0c1a8, 0, 0}},\n  {{0x001e52fc, 0xfff08da0, 0, 0}}, {{0x001eb921, 0xfff05998, 0, 0}},\n  {{0x001f1f46, 0xfff02590, 0, 0}}, {{0x001f856b, 0xffeff188, 0, 0}},\n  {{0x001feb90, 0xffefbd80, 0, 0}}, {{0x002051b5, 0xffef8978, 0, 0}},\n  {{0x0020b7da, 0xffef5570, 0, 0}}, {{0x00211dff, 0xffef2168, 0, 0}},\n  {{0x00218424, 0xffeeed60, 0, 0}}, {{0x0021ea49, 0xffeeb958, 0, 0}},\n  {{0x0022506e, 0xffee8550, 0, 0}}, {{0x0022b693, 0xffee5148, 0, 0}},\n  {{0x00231cb8, 0xffee1d40, 0, 0}}, {{0x002382dd, 0xffede938, 0, 0}},\n  {{0x0023e902, 0xffedb530, 0, 0}}, {{0x00244f27, 0xffed8128, 0, 0}},\n  {{0x0024b54c, 0xffed4d20, 0, 0}}, {{0x00251b71, 0xffed1918, 0, 0}},\n  {{0x00258196, 0xffece510, 0, 0}}, {{0x0025e7bb, 0xffecb108, 0, 0}},\n  {{0x00264de0, 0xffec7d00, 0, 0}}, {{0x0026b405, 0xffec48f8, 0, 0}},\n  {{0x00271a2a, 0xffec14f0, 0, 0}}, {{0x0027804f, 0xffebe0e8, 0, 0}},\n  {{0x0027e674, 0xffebace0, 0, 0}}, {{0x00284c99, 0xffeb78d8, 0, 0}},\n  {{0x0028b2be, 0xffeb44d0, 0, 0}}, {{0x002918e3, 0xffeb10c8, 0, 0}},\n  {{0x00297f08, 0xffeadcc0, 0, 0}}, {{0x0029e52d, 0xffeaa8b8, 0, 0}},\n  {{0x002a4b52, 0xffea74b0, 0, 0}}, {{0x002ab177, 0xffea40a8, 0, 0}},\n  {{0x002b179c, 0xffea0ca0, 0, 0}}, {{0x002b7dc1, 0xffe9d898, 0, 0}},\n  {{0x002be3e6, 0xffe9a490, 0, 0}}, {{0x002c4a0b, 0xffe97088, 0, 0}},\n  {{0x002cb030, 0xffe93c80, 0, 0}}, {{0x002d1655, 0xffe90878, 0, 0}},\n  {{0x002d7c7a, 0xffe8d470, 0, 0}}, {{0x002de29f, 0xffe8a068, 0, 0}},\n  {{0x002e48c4, 0xffe86c60, 0, 0}}, {{0x002eaee9, 0xffe83858, 0, 0}},\n  {{0x002f150e, 0xffe80450, 0, 0}}, {{0x002f7b33, 0xffe7d048, 0, 0}},\n  {{0x002fe158, 0xffe79c40, 0, 0}}, {{0x0030477d, 0xffe76838, 0, 0}},\n  {{0x0030ada2, 0xffe73430, 0, 0}}, {{0x003113c7, 0xffe70028, 0, 0}},\n  {{0x003179ec, 0xffe6cc20, 0, 0}}, {{0x0031e011, 0xffe69818, 0, 0}},\n  {{0x00324636, 0xffe66410, 0, 0}}, {{0x0032ac5b, 0xffe63008, 0, 0}}\n};\n"
  },
  {
    "path": "ext/libwebp/enc/backward_references.h",
    "content": "// Copyright 2012 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Author: Jyrki Alakuijala (jyrki@google.com)\n//\n\n#ifndef WEBP_ENC_BACKWARD_REFERENCES_H_\n#define WEBP_ENC_BACKWARD_REFERENCES_H_\n\n#include <assert.h>\n#include <stdlib.h>\n#include \"../webp/types.h\"\n#include \"../webp/format_constants.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n// The spec allows 11, we use 9 bits to reduce memory consumption in encoding.\n// Having 9 instead of 11 only removes about 0.25 % of compression density.\n#define MAX_COLOR_CACHE_BITS 9\n\n// Max ever number of codes we'll use:\n#define PIX_OR_COPY_CODES_MAX \\\n    (NUM_LITERAL_CODES + NUM_LENGTH_CODES + (1 << MAX_COLOR_CACHE_BITS))\n\n// -----------------------------------------------------------------------------\n// PixOrCopy\n\nenum Mode {\n  kLiteral,\n  kCacheIdx,\n  kCopy,\n  kNone\n};\n\ntypedef struct {\n  // mode as uint8_t to make the memory layout to be exactly 8 bytes.\n  uint8_t mode;\n  uint16_t len;\n  uint32_t argb_or_distance;\n} PixOrCopy;\n\nstatic WEBP_INLINE PixOrCopy PixOrCopyCreateCopy(uint32_t distance,\n                                                 uint16_t len) {\n  PixOrCopy retval;\n  retval.mode = kCopy;\n  retval.argb_or_distance = distance;\n  retval.len = len;\n  return retval;\n}\n\nstatic WEBP_INLINE PixOrCopy PixOrCopyCreateCacheIdx(int idx) {\n  PixOrCopy retval;\n  assert(idx >= 0);\n  assert(idx < (1 << MAX_COLOR_CACHE_BITS));\n  retval.mode = kCacheIdx;\n  retval.argb_or_distance = idx;\n  retval.len = 1;\n  return retval;\n}\n\nstatic WEBP_INLINE PixOrCopy PixOrCopyCreateLiteral(uint32_t argb) {\n  PixOrCopy retval;\n  retval.mode = kLiteral;\n  retval.argb_or_distance = argb;\n  retval.len = 1;\n  return retval;\n}\n\nstatic WEBP_INLINE int PixOrCopyIsLiteral(const PixOrCopy* const p) {\n  return (p->mode == kLiteral);\n}\n\nstatic WEBP_INLINE int PixOrCopyIsCacheIdx(const PixOrCopy* const p) {\n  return (p->mode == kCacheIdx);\n}\n\nstatic WEBP_INLINE int PixOrCopyIsCopy(const PixOrCopy* const p) {\n  return (p->mode == kCopy);\n}\n\nstatic WEBP_INLINE uint32_t PixOrCopyLiteral(const PixOrCopy* const p,\n                                             int component) {\n  assert(p->mode == kLiteral);\n  return (p->argb_or_distance >> (component * 8)) & 0xff;\n}\n\nstatic WEBP_INLINE uint32_t PixOrCopyLength(const PixOrCopy* const p) {\n  return p->len;\n}\n\nstatic WEBP_INLINE uint32_t PixOrCopyArgb(const PixOrCopy* const p) {\n  assert(p->mode == kLiteral);\n  return p->argb_or_distance;\n}\n\nstatic WEBP_INLINE uint32_t PixOrCopyCacheIdx(const PixOrCopy* const p) {\n  assert(p->mode == kCacheIdx);\n  assert(p->argb_or_distance < (1U << MAX_COLOR_CACHE_BITS));\n  return p->argb_or_distance;\n}\n\nstatic WEBP_INLINE uint32_t PixOrCopyDistance(const PixOrCopy* const p) {\n  assert(p->mode == kCopy);\n  return p->argb_or_distance;\n}\n\n// -----------------------------------------------------------------------------\n// VP8LHashChain\n\n#define HASH_BITS 18\n#define HASH_SIZE (1 << HASH_BITS)\n\ntypedef struct VP8LHashChain VP8LHashChain;\nstruct VP8LHashChain {\n  // Stores the most recently added position with the given hash value.\n  int32_t hash_to_first_index_[HASH_SIZE];\n  // chain_[pos] stores the previous position with the same hash value\n  // for every pixel in the image.\n  int32_t* chain_;\n  // This is the maximum size of the hash_chain that can be constructed.\n  // Typically this is the pixel count (width x height) for a given image.\n  int size_;\n};\n\n// Must be called first, to set size.\nint VP8LHashChainInit(VP8LHashChain* const p, int size);\nvoid VP8LHashChainClear(VP8LHashChain* const p);  // release memory\n\n// -----------------------------------------------------------------------------\n// VP8LBackwardRefs (block-based backward-references storage)\n\n// maximum number of reference blocks the image will be segmented into\n#define MAX_REFS_BLOCK_PER_IMAGE 16\n\ntypedef struct PixOrCopyBlock PixOrCopyBlock;   // forward declaration\ntypedef struct VP8LBackwardRefs VP8LBackwardRefs;\n\n// Container for blocks chain\nstruct VP8LBackwardRefs {\n  int block_size_;               // common block-size\n  int error_;                    // set to true if some memory error occurred\n  PixOrCopyBlock* refs_;         // list of currently used blocks\n  PixOrCopyBlock** tail_;        // for list recycling\n  PixOrCopyBlock* free_blocks_;  // free-list\n  PixOrCopyBlock* last_block_;   // used for adding new refs (internal)\n};\n\n// Initialize the object. 'block_size' is the common block size to store\n// references (typically, width * height / MAX_REFS_BLOCK_PER_IMAGE).\nvoid VP8LBackwardRefsInit(VP8LBackwardRefs* const refs, int block_size);\n// Release memory for backward references.\nvoid VP8LBackwardRefsClear(VP8LBackwardRefs* const refs);\n// Copies the 'src' backward refs to the 'dst'. Returns 0 in case of error.\nint VP8LBackwardRefsCopy(const VP8LBackwardRefs* const src,\n                         VP8LBackwardRefs* const dst);\n\n// Cursor for iterating on references content\ntypedef struct {\n  // public:\n  PixOrCopy* cur_pos;           // current position\n  // private:\n  PixOrCopyBlock* cur_block_;   // current block in the refs list\n  const PixOrCopy* last_pos_;   // sentinel for switching to next block\n} VP8LRefsCursor;\n\n// Returns a cursor positioned at the beginning of the references list.\nVP8LRefsCursor VP8LRefsCursorInit(const VP8LBackwardRefs* const refs);\n// Returns true if cursor is pointing at a valid position.\nstatic WEBP_INLINE int VP8LRefsCursorOk(const VP8LRefsCursor* const c) {\n  return (c->cur_pos != NULL);\n}\n// Move to next block of references. Internal, not to be called directly.\nvoid VP8LRefsCursorNextBlock(VP8LRefsCursor* const c);\n// Move to next position, or NULL. Should not be called if !VP8LRefsCursorOk().\nstatic WEBP_INLINE void VP8LRefsCursorNext(VP8LRefsCursor* const c) {\n  assert(c != NULL);\n  assert(VP8LRefsCursorOk(c));\n  if (++c->cur_pos == c->last_pos_) VP8LRefsCursorNextBlock(c);\n}\n\n// -----------------------------------------------------------------------------\n// Main entry points\n\n// Evaluates best possible backward references for specified quality.\n// Further optimize for 2D locality if use_2d_locality flag is set.\n// The return value is the pointer to the best of the two backward refs viz,\n// refs[0] or refs[1].\nVP8LBackwardRefs* VP8LGetBackwardReferences(\n    int width, int height, const uint32_t* const argb, int quality,\n    int cache_bits, int use_2d_locality, VP8LHashChain* const hash_chain,\n    VP8LBackwardRefs refs[2]);\n\n// Produce an estimate for a good color cache size for the image.\nint VP8LCalculateEstimateForCacheSize(const uint32_t* const argb,\n                                      int xsize, int ysize, int quality,\n                                      VP8LHashChain* const hash_chain,\n                                      VP8LBackwardRefs* const ref,\n                                      int* const best_cache_bits);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif  // WEBP_ENC_BACKWARD_REFERENCES_H_\n"
  },
  {
    "path": "ext/libwebp/enc/histogram.h",
    "content": "// Copyright 2012 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Author: Jyrki Alakuijala (jyrki@google.com)\n//\n// Models the histograms of literal and distance codes.\n\n#ifndef WEBP_ENC_HISTOGRAM_H_\n#define WEBP_ENC_HISTOGRAM_H_\n\n#include <assert.h>\n#include <stddef.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n\n#include \"./backward_references.h\"\n#include \"../webp/format_constants.h\"\n#include \"../webp/types.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n// A simple container for histograms of data.\ntypedef struct {\n  // literal_ contains green literal, palette-code and\n  // copy-length-prefix histogram\n  uint32_t* literal_;         // Pointer to the allocated buffer for literal.\n  uint32_t red_[NUM_LITERAL_CODES];\n  uint32_t blue_[NUM_LITERAL_CODES];\n  uint32_t alpha_[NUM_LITERAL_CODES];\n  // Backward reference prefix-code histogram.\n  uint32_t distance_[NUM_DISTANCE_CODES];\n  int palette_code_bits_;\n  double bit_cost_;      // cached value of VP8LHistogramEstimateBits(this)\n  double literal_cost_;  // Cached values of dominant entropy costs:\n  double red_cost_;      //   literal, red & blue.\n  double blue_cost_;\n} VP8LHistogram;\n\n// Collection of histograms with fixed capacity, allocated as one\n// big memory chunk. Can be destroyed by calling WebPSafeFree().\ntypedef struct {\n  int size;         // number of slots currently in use\n  int max_size;     // maximum capacity\n  VP8LHistogram** histograms;\n} VP8LHistogramSet;\n\n// Create the histogram.\n//\n// The input data is the PixOrCopy data, which models the literals, stop\n// codes and backward references (both distances and lengths).  Also: if\n// palette_code_bits is >= 0, initialize the histogram with this value.\nvoid VP8LHistogramCreate(VP8LHistogram* const p,\n                         const VP8LBackwardRefs* const refs,\n                         int palette_code_bits);\n\n// Return the size of the histogram for a given palette_code_bits.\nint VP8LGetHistogramSize(int palette_code_bits);\n\n// Set the palette_code_bits and reset the stats.\nvoid VP8LHistogramInit(VP8LHistogram* const p, int palette_code_bits);\n\n// Collect all the references into a histogram (without reset)\nvoid VP8LHistogramStoreRefs(const VP8LBackwardRefs* const refs,\n                            VP8LHistogram* const histo);\n\n// Free the memory allocated for the histogram.\nvoid VP8LFreeHistogram(VP8LHistogram* const histo);\n\n// Free the memory allocated for the histogram set.\nvoid VP8LFreeHistogramSet(VP8LHistogramSet* const histo);\n\n// Allocate an array of pointer to histograms, allocated and initialized\n// using 'cache_bits'. Return NULL in case of memory error.\nVP8LHistogramSet* VP8LAllocateHistogramSet(int size, int cache_bits);\n\n// Allocate and initialize histogram object with specified 'cache_bits'.\n// Returns NULL in case of memory error.\n// Special case of VP8LAllocateHistogramSet, with size equals 1.\nVP8LHistogram* VP8LAllocateHistogram(int cache_bits);\n\n// Accumulate a token 'v' into a histogram.\nvoid VP8LHistogramAddSinglePixOrCopy(VP8LHistogram* const histo,\n                                     const PixOrCopy* const v);\n\n// Estimate how many bits the combined entropy of literals and distance\n// approximately maps to.\ndouble VP8LHistogramEstimateBits(const VP8LHistogram* const p);\n\n// This function estimates the cost in bits excluding the bits needed to\n// represent the entropy code itself.\ndouble VP8LHistogramEstimateBitsBulk(const VP8LHistogram* const p);\n\nstatic WEBP_INLINE int VP8LHistogramNumCodes(int palette_code_bits) {\n  return NUM_LITERAL_CODES + NUM_LENGTH_CODES +\n      ((palette_code_bits > 0) ? (1 << palette_code_bits) : 0);\n}\n\n// Builds the histogram image.\nint VP8LGetHistoImageSymbols(int xsize, int ysize,\n                             const VP8LBackwardRefs* const refs,\n                             int quality, int histogram_bits, int cache_bits,\n                             VP8LHistogramSet* const image_in,\n                             uint16_t* const histogram_symbols);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif  // WEBP_ENC_HISTOGRAM_H_\n"
  },
  {
    "path": "ext/libwebp/utils/Makefile.am",
    "content": "noinst_LTLIBRARIES = libwebputils.la\n\nif BUILD_LIBWEBPDECODER\n  noinst_LTLIBRARIES += libwebputilsdecode.la\nendif\n\ncommon_HEADERS = ../webp/types.h\ncommondir = $(includedir)/webp\n\nCOMMON_SOURCES =\nCOMMON_SOURCES += bit_reader.c\nCOMMON_SOURCES += bit_reader.h\nCOMMON_SOURCES += bit_reader_inl.h\nCOMMON_SOURCES += color_cache.c\nCOMMON_SOURCES += color_cache.h\nCOMMON_SOURCES += endian_inl.h\nCOMMON_SOURCES += filters.c\nCOMMON_SOURCES += filters.h\nCOMMON_SOURCES += huffman.c\nCOMMON_SOURCES += huffman.h\nCOMMON_SOURCES += quant_levels_dec.c\nCOMMON_SOURCES += quant_levels_dec.h\nCOMMON_SOURCES += rescaler.c\nCOMMON_SOURCES += rescaler.h\nCOMMON_SOURCES += random.c\nCOMMON_SOURCES += random.h\nCOMMON_SOURCES += thread.c\nCOMMON_SOURCES += thread.h\nCOMMON_SOURCES += utils.c\nCOMMON_SOURCES += utils.h\n\nENC_SOURCES =\nENC_SOURCES += bit_writer.c\nENC_SOURCES += bit_writer.h\nENC_SOURCES += huffman_encode.c\nENC_SOURCES += huffman_encode.h\nENC_SOURCES += quant_levels.c\nENC_SOURCES += quant_levels.h\n\nlibwebputils_la_SOURCES = $(COMMON_SOURCES) $(ENC_SOURCES)\n\nif BUILD_LIBWEBPDECODER\n  libwebputilsdecode_la_SOURCES = $(COMMON_SOURCES)\nendif\n"
  },
  {
    "path": "ext/libwebp/utils/Makefile.in",
    "content": "# Makefile.in generated by automake 1.11.3 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,\n# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software\n# Foundation, Inc.\n# This Makefile.in is free software; the Free Software Foundation\n# gives unlimited permission to copy and/or distribute it,\n# with or without modifications, as long as this notice is preserved.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n# PARTICULAR PURPOSE.\n\n@SET_MAKE@\n\n\nVPATH = @srcdir@\npkgdatadir = $(datadir)/@PACKAGE@\npkgincludedir = $(includedir)/@PACKAGE@\npkglibdir = $(libdir)/@PACKAGE@\npkglibexecdir = $(libexecdir)/@PACKAGE@\nam__cd = CDPATH=\"$${ZSH_VERSION+.}$(PATH_SEPARATOR)\" && cd\ninstall_sh_DATA = $(install_sh) -c -m 644\ninstall_sh_PROGRAM = $(install_sh) -c\ninstall_sh_SCRIPT = $(install_sh) -c\nINSTALL_HEADER = $(INSTALL_DATA)\ntransform = $(program_transform_name)\nNORMAL_INSTALL = :\nPRE_INSTALL = :\nPOST_INSTALL = :\nNORMAL_UNINSTALL = :\nPRE_UNINSTALL = :\nPOST_UNINSTALL = :\nbuild_triplet = @build@\nhost_triplet = @host@\n@BUILD_LIBWEBPDECODER_TRUE@am__append_1 = libwebputilsdecode.la\nsubdir = src/utils\nDIST_COMMON = $(common_HEADERS) $(srcdir)/Makefile.am \\\n\t$(srcdir)/Makefile.in\nACLOCAL_M4 = $(top_srcdir)/aclocal.m4\nam__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \\\n\t$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \\\n\t$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \\\n\t$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac\nam__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n\t$(ACLOCAL_M4)\nmkinstalldirs = $(install_sh) -d\nCONFIG_HEADER = $(top_builddir)/src/webp/config.h\nCONFIG_CLEAN_FILES =\nCONFIG_CLEAN_VPATH_FILES =\nLTLIBRARIES = $(noinst_LTLIBRARIES)\nlibwebputils_la_LIBADD =\nam__objects_1 = bit_reader.lo color_cache.lo filters.lo huffman.lo \\\n\tquant_levels_dec.lo rescaler.lo random.lo thread.lo utils.lo\nam__objects_2 = bit_writer.lo huffman_encode.lo quant_levels.lo\nam_libwebputils_la_OBJECTS = $(am__objects_1) $(am__objects_2)\nlibwebputils_la_OBJECTS = $(am_libwebputils_la_OBJECTS)\nAM_V_lt = $(am__v_lt_@AM_V@)\nam__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)\nam__v_lt_0 = --silent\nlibwebputilsdecode_la_LIBADD =\nam__libwebputilsdecode_la_SOURCES_DIST = bit_reader.c bit_reader.h \\\n\tbit_reader_inl.h color_cache.c color_cache.h endian_inl.h \\\n\tfilters.c filters.h huffman.c huffman.h quant_levels_dec.c \\\n\tquant_levels_dec.h rescaler.c rescaler.h random.c random.h \\\n\tthread.c thread.h utils.c utils.h\n@BUILD_LIBWEBPDECODER_TRUE@am_libwebputilsdecode_la_OBJECTS =  \\\n@BUILD_LIBWEBPDECODER_TRUE@\t$(am__objects_1)\nlibwebputilsdecode_la_OBJECTS = $(am_libwebputilsdecode_la_OBJECTS)\n@BUILD_LIBWEBPDECODER_TRUE@am_libwebputilsdecode_la_rpath =\nDEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/webp\ndepcomp = $(SHELL) $(top_srcdir)/depcomp\nam__depfiles_maybe = depfiles\nam__mv = mv -f\nCOMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\nLTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \\\n\t$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \\\n\t$(AM_CFLAGS) $(CFLAGS)\nAM_V_CC = $(am__v_CC_@AM_V@)\nam__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)\nam__v_CC_0 = @echo \"  CC    \" $@;\nAM_V_at = $(am__v_at_@AM_V@)\nam__v_at_ = $(am__v_at_@AM_DEFAULT_V@)\nam__v_at_0 = @\nCCLD = $(CC)\nLINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \\\n\t$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \\\n\t$(AM_LDFLAGS) $(LDFLAGS) -o $@\nAM_V_CCLD = $(am__v_CCLD_@AM_V@)\nam__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)\nam__v_CCLD_0 = @echo \"  CCLD  \" $@;\nAM_V_GEN = $(am__v_GEN_@AM_V@)\nam__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)\nam__v_GEN_0 = @echo \"  GEN   \" $@;\nSOURCES = $(libwebputils_la_SOURCES) $(libwebputilsdecode_la_SOURCES)\nDIST_SOURCES = $(libwebputils_la_SOURCES) \\\n\t$(am__libwebputilsdecode_la_SOURCES_DIST)\nam__vpath_adj_setup = srcdirstrip=`echo \"$(srcdir)\" | sed 's|.|.|g'`;\nam__vpath_adj = case $$p in \\\n    $(srcdir)/*) f=`echo \"$$p\" | sed \"s|^$$srcdirstrip/||\"`;; \\\n    *) f=$$p;; \\\n  esac;\nam__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;\nam__install_max = 40\nam__nobase_strip_setup = \\\n  srcdirstrip=`echo \"$(srcdir)\" | sed 's/[].[^$$\\\\*|]/\\\\\\\\&/g'`\nam__nobase_strip = \\\n  for p in $$list; do echo \"$$p\"; done | sed -e \"s|$$srcdirstrip/||\"\nam__nobase_list = $(am__nobase_strip_setup); \\\n  for p in $$list; do echo \"$$p $$p\"; done | \\\n  sed \"s| $$srcdirstrip/| |;\"' / .*\\//!s/ .*/ ./; s,\\( .*\\)/[^/]*$$,\\1,' | \\\n  $(AWK) 'BEGIN { files[\".\"] = \"\" } { files[$$2] = files[$$2] \" \" $$1; \\\n    if (++n[$$2] == $(am__install_max)) \\\n      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = \"\" } } \\\n    END { for (dir in files) print dir, files[dir] }'\nam__base_list = \\\n  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\\n/ /g' | \\\n  sed '$$!N;$$!N;$$!N;$$!N;s/\\n/ /g'\nam__uninstall_files_from_dir = { \\\n  test -z \"$$files\" \\\n    || { test ! -d \"$$dir\" && test ! -f \"$$dir\" && test ! -r \"$$dir\"; } \\\n    || { echo \" ( cd '$$dir' && rm -f\" $$files \")\"; \\\n         $(am__cd) \"$$dir\" && rm -f $$files; }; \\\n  }\nam__installdirs = \"$(DESTDIR)$(commondir)\"\nHEADERS = $(common_HEADERS)\nETAGS = etags\nCTAGS = ctags\nDISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)\nACLOCAL = @ACLOCAL@\nAMTAR = @AMTAR@\nAM_CFLAGS = @AM_CFLAGS@\nAM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@\nAR = @AR@\nAUTOCONF = @AUTOCONF@\nAUTOHEADER = @AUTOHEADER@\nAUTOMAKE = @AUTOMAKE@\nAVX2_FLAGS = @AVX2_FLAGS@\nAWK = @AWK@\nCC = @CC@\nCCDEPMODE = @CCDEPMODE@\nCFLAGS = @CFLAGS@\nCPP = @CPP@\nCPPFLAGS = @CPPFLAGS@\nCYGPATH_W = @CYGPATH_W@\nDEFS = @DEFS@\nDEPDIR = @DEPDIR@\nDLLTOOL = @DLLTOOL@\nDSYMUTIL = @DSYMUTIL@\nDUMPBIN = @DUMPBIN@\nECHO_C = @ECHO_C@\nECHO_N = @ECHO_N@\nECHO_T = @ECHO_T@\nEGREP = @EGREP@\nEXEEXT = @EXEEXT@\nFGREP = @FGREP@\nGIF_INCLUDES = @GIF_INCLUDES@\nGIF_LIBS = @GIF_LIBS@\nGL_INCLUDES = @GL_INCLUDES@\nGL_LIBS = @GL_LIBS@\nGREP = @GREP@\nINSTALL = @INSTALL@\nINSTALL_DATA = @INSTALL_DATA@\nINSTALL_PROGRAM = @INSTALL_PROGRAM@\nINSTALL_SCRIPT = @INSTALL_SCRIPT@\nINSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\nJPEG_INCLUDES = @JPEG_INCLUDES@\nJPEG_LIBS = @JPEG_LIBS@\nLD = @LD@\nLDFLAGS = @LDFLAGS@\nLIBOBJS = @LIBOBJS@\nLIBPNG_CONFIG = @LIBPNG_CONFIG@\nLIBS = @LIBS@\nLIBTOOL = @LIBTOOL@\nLIPO = @LIPO@\nLN_S = @LN_S@\nLTLIBOBJS = @LTLIBOBJS@\nMAKEINFO = @MAKEINFO@\nMANIFEST_TOOL = @MANIFEST_TOOL@\nMKDIR_P = @MKDIR_P@\nNM = @NM@\nNMEDIT = @NMEDIT@\nOBJDUMP = @OBJDUMP@\nOBJEXT = @OBJEXT@\nOTOOL = @OTOOL@\nOTOOL64 = @OTOOL64@\nPACKAGE = @PACKAGE@\nPACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\nPACKAGE_NAME = @PACKAGE_NAME@\nPACKAGE_STRING = @PACKAGE_STRING@\nPACKAGE_TARNAME = @PACKAGE_TARNAME@\nPACKAGE_URL = @PACKAGE_URL@\nPACKAGE_VERSION = @PACKAGE_VERSION@\nPATH_SEPARATOR = @PATH_SEPARATOR@\nPNG_INCLUDES = @PNG_INCLUDES@\nPNG_LIBS = @PNG_LIBS@\nPTHREAD_CC = @PTHREAD_CC@\nPTHREAD_CFLAGS = @PTHREAD_CFLAGS@\nPTHREAD_LIBS = @PTHREAD_LIBS@\nRANLIB = @RANLIB@\nSED = @SED@\nSET_MAKE = @SET_MAKE@\nSHELL = @SHELL@\nSSE2_FLAGS = @SSE2_FLAGS@\nSTRIP = @STRIP@\nTIFF_INCLUDES = @TIFF_INCLUDES@\nTIFF_LIBS = @TIFF_LIBS@\nUSE_EXPERIMENTAL_CODE = @USE_EXPERIMENTAL_CODE@\nUSE_SWAP_16BIT_CSP = @USE_SWAP_16BIT_CSP@\nVERSION = @VERSION@\nabs_builddir = @abs_builddir@\nabs_srcdir = @abs_srcdir@\nabs_top_builddir = @abs_top_builddir@\nabs_top_srcdir = @abs_top_srcdir@\nac_ct_AR = @ac_ct_AR@\nac_ct_CC = @ac_ct_CC@\nac_ct_DUMPBIN = @ac_ct_DUMPBIN@\nam__include = @am__include@\nam__leading_dot = @am__leading_dot@\nam__quote = @am__quote@\nam__tar = @am__tar@\nam__untar = @am__untar@\nax_pthread_config = @ax_pthread_config@\nbindir = @bindir@\nbuild = @build@\nbuild_alias = @build_alias@\nbuild_cpu = @build_cpu@\nbuild_os = @build_os@\nbuild_vendor = @build_vendor@\nbuilddir = @builddir@\ndatadir = @datadir@\ndatarootdir = @datarootdir@\ndocdir = @docdir@\ndvidir = @dvidir@\nexec_prefix = @exec_prefix@\nhost = @host@\nhost_alias = @host_alias@\nhost_cpu = @host_cpu@\nhost_os = @host_os@\nhost_vendor = @host_vendor@\nhtmldir = @htmldir@\nincludedir = @includedir@\ninfodir = @infodir@\ninstall_sh = @install_sh@\nlibdir = @libdir@\nlibexecdir = @libexecdir@\nlocaledir = @localedir@\nlocalstatedir = @localstatedir@\nmandir = @mandir@\nmkdir_p = @mkdir_p@\noldincludedir = @oldincludedir@\npdfdir = @pdfdir@\npkgconfigdir = @pkgconfigdir@\nprefix = @prefix@\nprogram_transform_name = @program_transform_name@\npsdir = @psdir@\nsbindir = @sbindir@\nsharedstatedir = @sharedstatedir@\nsrcdir = @srcdir@\nsysconfdir = @sysconfdir@\ntarget_alias = @target_alias@\ntop_build_prefix = @top_build_prefix@\ntop_builddir = @top_builddir@\ntop_srcdir = @top_srcdir@\nnoinst_LTLIBRARIES = libwebputils.la $(am__append_1)\ncommon_HEADERS = ../webp/types.h\ncommondir = $(includedir)/webp\nCOMMON_SOURCES = bit_reader.c bit_reader.h bit_reader_inl.h \\\n\tcolor_cache.c color_cache.h endian_inl.h filters.c filters.h \\\n\thuffman.c huffman.h quant_levels_dec.c quant_levels_dec.h \\\n\trescaler.c rescaler.h random.c random.h thread.c thread.h \\\n\tutils.c utils.h\nENC_SOURCES = bit_writer.c bit_writer.h huffman_encode.c \\\n\thuffman_encode.h quant_levels.c quant_levels.h\nlibwebputils_la_SOURCES = $(COMMON_SOURCES) $(ENC_SOURCES)\n@BUILD_LIBWEBPDECODER_TRUE@libwebputilsdecode_la_SOURCES = $(COMMON_SOURCES)\nall: all-am\n\n.SUFFIXES:\n.SUFFIXES: .c .lo .o .obj\n$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)\n\t@for dep in $?; do \\\n\t  case '$(am__configure_deps)' in \\\n\t    *$$dep*) \\\n\t      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \\\n\t        && { if test -f $@; then exit 0; else break; fi; }; \\\n\t      exit 1;; \\\n\t  esac; \\\n\tdone; \\\n\techo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/utils/Makefile'; \\\n\t$(am__cd) $(top_srcdir) && \\\n\t  $(AUTOMAKE) --foreign src/utils/Makefile\n.PRECIOUS: Makefile\nMakefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\n\t@case '$?' in \\\n\t  *config.status*) \\\n\t    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \\\n\t  *) \\\n\t    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \\\n\t    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \\\n\tesac;\n\n$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n\n$(top_srcdir)/configure:  $(am__configure_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(ACLOCAL_M4):  $(am__aclocal_m4_deps)\n\tcd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh\n$(am__aclocal_m4_deps):\n\nclean-noinstLTLIBRARIES:\n\t-test -z \"$(noinst_LTLIBRARIES)\" || rm -f $(noinst_LTLIBRARIES)\n\t@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \\\n\t  dir=\"`echo $$p | sed -e 's|/[^/]*$$||'`\"; \\\n\t  test \"$$dir\" != \"$$p\" || dir=.; \\\n\t  echo \"rm -f \\\"$${dir}/so_locations\\\"\"; \\\n\t  rm -f \"$${dir}/so_locations\"; \\\n\tdone\nlibwebputils.la: $(libwebputils_la_OBJECTS) $(libwebputils_la_DEPENDENCIES) $(EXTRA_libwebputils_la_DEPENDENCIES) \n\t$(AM_V_CCLD)$(LINK)  $(libwebputils_la_OBJECTS) $(libwebputils_la_LIBADD) $(LIBS)\nlibwebputilsdecode.la: $(libwebputilsdecode_la_OBJECTS) $(libwebputilsdecode_la_DEPENDENCIES) $(EXTRA_libwebputilsdecode_la_DEPENDENCIES) \n\t$(AM_V_CCLD)$(LINK) $(am_libwebputilsdecode_la_rpath) $(libwebputilsdecode_la_OBJECTS) $(libwebputilsdecode_la_LIBADD) $(LIBS)\n\nmostlyclean-compile:\n\t-rm -f *.$(OBJEXT)\n\ndistclean-compile:\n\t-rm -f *.tab.c\n\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bit_reader.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bit_writer.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/color_cache.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filters.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/huffman.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/huffman_encode.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quant_levels.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quant_levels_dec.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/random.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rescaler.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread.Plo@am__quote@\n@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Plo@am__quote@\n\n.c.o:\n@am__fastdepCC_TRUE@\t$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\\.o$$||'`;\\\n@am__fastdepCC_TRUE@\t$(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\\\n@am__fastdepCC_TRUE@\t$(am__mv) $$depbase.Tpo $$depbase.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<\n\n.c.obj:\n@am__fastdepCC_TRUE@\t$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\\.obj$$||'`;\\\n@am__fastdepCC_TRUE@\t$(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\\\n@am__fastdepCC_TRUE@\t$(am__mv) $$depbase.Tpo $$depbase.Po\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`\n\n.c.lo:\n@am__fastdepCC_TRUE@\t$(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\\.lo$$||'`;\\\n@am__fastdepCC_TRUE@\t$(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\\\n@am__fastdepCC_TRUE@\t$(am__mv) $$depbase.Tpo $$depbase.Plo\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\t$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@\n@AMDEP_TRUE@@am__fastdepCC_FALSE@\tDEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\n@am__fastdepCC_FALSE@\t$(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<\n\nmostlyclean-libtool:\n\t-rm -f *.lo\n\nclean-libtool:\n\t-rm -rf .libs _libs\ninstall-commonHEADERS: $(common_HEADERS)\n\t@$(NORMAL_INSTALL)\n\ttest -z \"$(commondir)\" || $(MKDIR_P) \"$(DESTDIR)$(commondir)\"\n\t@list='$(common_HEADERS)'; test -n \"$(commondir)\" || list=; \\\n\tfor p in $$list; do \\\n\t  if test -f \"$$p\"; then d=; else d=\"$(srcdir)/\"; fi; \\\n\t  echo \"$$d$$p\"; \\\n\tdone | $(am__base_list) | \\\n\twhile read files; do \\\n\t  echo \" $(INSTALL_HEADER) $$files '$(DESTDIR)$(commondir)'\"; \\\n\t  $(INSTALL_HEADER) $$files \"$(DESTDIR)$(commondir)\" || exit $$?; \\\n\tdone\n\nuninstall-commonHEADERS:\n\t@$(NORMAL_UNINSTALL)\n\t@list='$(common_HEADERS)'; test -n \"$(commondir)\" || list=; \\\n\tfiles=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \\\n\tdir='$(DESTDIR)$(commondir)'; $(am__uninstall_files_from_dir)\n\nID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)\n\tlist='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \\\n\tunique=`for i in $$list; do \\\n\t    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n\t  done | \\\n\t  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \\\n\t      END { if (nonempty) { for (i in files) print i; }; }'`; \\\n\tmkid -fID $$unique\ntags: TAGS\n\nTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \\\n\t\t$(TAGS_FILES) $(LISP)\n\tset x; \\\n\there=`pwd`; \\\n\tlist='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \\\n\tunique=`for i in $$list; do \\\n\t    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n\t  done | \\\n\t  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \\\n\t      END { if (nonempty) { for (i in files) print i; }; }'`; \\\n\tshift; \\\n\tif test -z \"$(ETAGS_ARGS)$$*$$unique\"; then :; else \\\n\t  test -n \"$$unique\" || unique=$$empty_fix; \\\n\t  if test $$# -gt 0; then \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      \"$$@\" $$unique; \\\n\t  else \\\n\t    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\\n\t      $$unique; \\\n\t  fi; \\\n\tfi\nctags: CTAGS\nCTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \\\n\t\t$(TAGS_FILES) $(LISP)\n\tlist='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \\\n\tunique=`for i in $$list; do \\\n\t    if test -f \"$$i\"; then echo $$i; else echo $(srcdir)/$$i; fi; \\\n\t  done | \\\n\t  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \\\n\t      END { if (nonempty) { for (i in files) print i; }; }'`; \\\n\ttest -z \"$(CTAGS_ARGS)$$unique\" \\\n\t  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \\\n\t     $$unique\n\nGTAGS:\n\there=`$(am__cd) $(top_builddir) && pwd` \\\n\t  && $(am__cd) $(top_srcdir) \\\n\t  && gtags -i $(GTAGS_ARGS) \"$$here\"\n\ndistclean-tags:\n\t-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags\n\ndistdir: $(DISTFILES)\n\t@srcdirstrip=`echo \"$(srcdir)\" | sed 's/[].[^$$\\\\*]/\\\\\\\\&/g'`; \\\n\ttopsrcdirstrip=`echo \"$(top_srcdir)\" | sed 's/[].[^$$\\\\*]/\\\\\\\\&/g'`; \\\n\tlist='$(DISTFILES)'; \\\n\t  dist_files=`for file in $$list; do echo $$file; done | \\\n\t  sed -e \"s|^$$srcdirstrip/||;t\" \\\n\t      -e \"s|^$$topsrcdirstrip/|$(top_builddir)/|;t\"`; \\\n\tcase $$dist_files in \\\n\t  */*) $(MKDIR_P) `echo \"$$dist_files\" | \\\n\t\t\t   sed '/\\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \\\n\t\t\t   sort -u` ;; \\\n\tesac; \\\n\tfor file in $$dist_files; do \\\n\t  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \\\n\t  if test -d $$d/$$file; then \\\n\t    dir=`echo \"/$$file\" | sed -e 's,/[^/]*$$,,'`; \\\n\t    if test -d \"$(distdir)/$$file\"; then \\\n\t      find \"$(distdir)/$$file\" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n\t    fi; \\\n\t    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \\\n\t      cp -fpR $(srcdir)/$$file \"$(distdir)$$dir\" || exit 1; \\\n\t      find \"$(distdir)/$$file\" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n\t    fi; \\\n\t    cp -fpR $$d/$$file \"$(distdir)$$dir\" || exit 1; \\\n\t  else \\\n\t    test -f \"$(distdir)/$$file\" \\\n\t    || cp -p $$d/$$file \"$(distdir)/$$file\" \\\n\t    || exit 1; \\\n\t  fi; \\\n\tdone\ncheck-am: all-am\ncheck: check-am\nall-am: Makefile $(LTLIBRARIES) $(HEADERS)\ninstalldirs:\n\tfor dir in \"$(DESTDIR)$(commondir)\"; do \\\n\t  test -z \"$$dir\" || $(MKDIR_P) \"$$dir\"; \\\n\tdone\ninstall: install-am\ninstall-exec: install-exec-am\ninstall-data: install-data-am\nuninstall: uninstall-am\n\ninstall-am: all-am\n\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n\ninstallcheck: installcheck-am\ninstall-strip:\n\tif test -z '$(STRIP)'; then \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t      install; \\\n\telse \\\n\t  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" \\\n\t    install_sh_PROGRAM=\"$(INSTALL_STRIP_PROGRAM)\" INSTALL_STRIP_FLAG=-s \\\n\t    \"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'\" install; \\\n\tfi\nmostlyclean-generic:\n\nclean-generic:\n\ndistclean-generic:\n\t-test -z \"$(CONFIG_CLEAN_FILES)\" || rm -f $(CONFIG_CLEAN_FILES)\n\t-test . = \"$(srcdir)\" || test -z \"$(CONFIG_CLEAN_VPATH_FILES)\" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n\nmaintainer-clean-generic:\n\t@echo \"This command is intended for maintainers to use\"\n\t@echo \"it deletes files that may require special tools to rebuild.\"\nclean: clean-am\n\nclean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \\\n\tmostlyclean-am\n\ndistclean: distclean-am\n\t-rm -rf ./$(DEPDIR)\n\t-rm -f Makefile\ndistclean-am: clean-am distclean-compile distclean-generic \\\n\tdistclean-tags\n\ndvi: dvi-am\n\ndvi-am:\n\nhtml: html-am\n\nhtml-am:\n\ninfo: info-am\n\ninfo-am:\n\ninstall-data-am: install-commonHEADERS\n\ninstall-dvi: install-dvi-am\n\ninstall-dvi-am:\n\ninstall-exec-am:\n\ninstall-html: install-html-am\n\ninstall-html-am:\n\ninstall-info: install-info-am\n\ninstall-info-am:\n\ninstall-man:\n\ninstall-pdf: install-pdf-am\n\ninstall-pdf-am:\n\ninstall-ps: install-ps-am\n\ninstall-ps-am:\n\ninstallcheck-am:\n\nmaintainer-clean: maintainer-clean-am\n\t-rm -rf ./$(DEPDIR)\n\t-rm -f Makefile\nmaintainer-clean-am: distclean-am maintainer-clean-generic\n\nmostlyclean: mostlyclean-am\n\nmostlyclean-am: mostlyclean-compile mostlyclean-generic \\\n\tmostlyclean-libtool\n\npdf: pdf-am\n\npdf-am:\n\nps: ps-am\n\nps-am:\n\nuninstall-am: uninstall-commonHEADERS\n\n.MAKE: install-am install-strip\n\n.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \\\n\tclean-libtool clean-noinstLTLIBRARIES ctags distclean \\\n\tdistclean-compile distclean-generic distclean-libtool \\\n\tdistclean-tags distdir dvi dvi-am html html-am info info-am \\\n\tinstall install-am install-commonHEADERS install-data \\\n\tinstall-data-am install-dvi install-dvi-am install-exec \\\n\tinstall-exec-am install-html install-html-am install-info \\\n\tinstall-info-am install-man install-pdf install-pdf-am \\\n\tinstall-ps install-ps-am install-strip installcheck \\\n\tinstallcheck-am installdirs maintainer-clean \\\n\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n\tmostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \\\n\ttags uninstall uninstall-am uninstall-commonHEADERS\n\n\n# Tell versions [3.59,3.63) of GNU make to not export all variables.\n# Otherwise a system limit (for SysV at least) may be exceeded.\n.NOEXPORT:\n"
  },
  {
    "path": "ext/libwebp/utils/bit_reader.c",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Boolean decoder non-inlined methods\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifdef HAVE_CONFIG_H\n#include \"../webp/config.h\"\n#endif\n\n#include \"./bit_reader_inl.h\"\n\n//------------------------------------------------------------------------------\n// VP8BitReader\n\nvoid VP8InitBitReader(VP8BitReader* const br,\n                      const uint8_t* const start, const uint8_t* const end) {\n  assert(br != NULL);\n  assert(start != NULL);\n  assert(start <= end);\n  br->range_   = 255 - 1;\n  br->buf_     = start;\n  br->buf_end_ = end;\n  br->value_   = 0;\n  br->bits_    = -8;   // to load the very first 8bits\n  br->eof_     = 0;\n  VP8LoadNewBytes(br);\n}\n\nvoid VP8RemapBitReader(VP8BitReader* const br, ptrdiff_t offset) {\n  if (br->buf_ != NULL) {\n    br->buf_ += offset;\n    br->buf_end_ += offset;\n  }\n}\n\nconst uint8_t kVP8Log2Range[128] = {\n     7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,\n  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,\n  2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n  2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n  0\n};\n\n// range = ((range - 1) << kVP8Log2Range[range]) + 1\nconst range_t kVP8NewRange[128] = {\n  127, 127, 191, 127, 159, 191, 223, 127,\n  143, 159, 175, 191, 207, 223, 239, 127,\n  135, 143, 151, 159, 167, 175, 183, 191,\n  199, 207, 215, 223, 231, 239, 247, 127,\n  131, 135, 139, 143, 147, 151, 155, 159,\n  163, 167, 171, 175, 179, 183, 187, 191,\n  195, 199, 203, 207, 211, 215, 219, 223,\n  227, 231, 235, 239, 243, 247, 251, 127,\n  129, 131, 133, 135, 137, 139, 141, 143,\n  145, 147, 149, 151, 153, 155, 157, 159,\n  161, 163, 165, 167, 169, 171, 173, 175,\n  177, 179, 181, 183, 185, 187, 189, 191,\n  193, 195, 197, 199, 201, 203, 205, 207,\n  209, 211, 213, 215, 217, 219, 221, 223,\n  225, 227, 229, 231, 233, 235, 237, 239,\n  241, 243, 245, 247, 249, 251, 253, 127\n};\n\nvoid VP8LoadFinalBytes(VP8BitReader* const br) {\n  assert(br != NULL && br->buf_ != NULL);\n  // Only read 8bits at a time\n  if (br->buf_ < br->buf_end_) {\n    br->bits_ += 8;\n    br->value_ = (bit_t)(*br->buf_++) | (br->value_ << 8);\n  } else if (!br->eof_) {\n    br->value_ <<= 8;\n    br->bits_ += 8;\n    br->eof_ = 1;\n  }\n}\n\n//------------------------------------------------------------------------------\n// Higher-level calls\n\nuint32_t VP8GetValue(VP8BitReader* const br, int bits) {\n  uint32_t v = 0;\n  while (bits-- > 0) {\n    v |= VP8GetBit(br, 0x80) << bits;\n  }\n  return v;\n}\n\nint32_t VP8GetSignedValue(VP8BitReader* const br, int bits) {\n  const int value = VP8GetValue(br, bits);\n  return VP8Get(br) ? -value : value;\n}\n\n//------------------------------------------------------------------------------\n// VP8LBitReader\n\n#define VP8L_LOG8_WBITS 4  // Number of bytes needed to store VP8L_WBITS bits.\n\n#if !defined(WEBP_FORCE_ALIGNED) && \\\n    (defined(__arm__) || defined(_M_ARM) || defined(__aarch64__) || \\\n     defined(__i386__) || defined(_M_IX86) || \\\n     defined(__x86_64__) || defined(_M_X64))\n#define VP8L_USE_UNALIGNED_LOAD\n#endif\n\nstatic const uint32_t kBitMask[VP8L_MAX_NUM_BIT_READ + 1] = {\n  0,\n  0x000001, 0x000003, 0x000007, 0x00000f,\n  0x00001f, 0x00003f, 0x00007f, 0x0000ff,\n  0x0001ff, 0x0003ff, 0x0007ff, 0x000fff,\n  0x001fff, 0x003fff, 0x007fff, 0x00ffff,\n  0x01ffff, 0x03ffff, 0x07ffff, 0x0fffff,\n  0x1fffff, 0x3fffff, 0x7fffff, 0xffffff\n};\n\nvoid VP8LInitBitReader(VP8LBitReader* const br, const uint8_t* const start,\n                       size_t length) {\n  size_t i;\n  vp8l_val_t value = 0;\n  assert(br != NULL);\n  assert(start != NULL);\n  assert(length < 0xfffffff8u);   // can't happen with a RIFF chunk.\n\n  br->len_ = length;\n  br->val_ = 0;\n  br->bit_pos_ = 0;\n  br->eos_ = 0;\n  br->error_ = 0;\n\n  if (length > sizeof(br->val_)) {\n    length = sizeof(br->val_);\n  }\n  for (i = 0; i < length; ++i) {\n    value |= (vp8l_val_t)start[i] << (8 * i);\n  }\n  br->val_ = value;\n  br->pos_ = length;\n  br->buf_ = start;\n}\n\nvoid VP8LBitReaderSetBuffer(VP8LBitReader* const br,\n                            const uint8_t* const buf, size_t len) {\n  assert(br != NULL);\n  assert(buf != NULL);\n  assert(len < 0xfffffff8u);   // can't happen with a RIFF chunk.\n  br->buf_ = buf;\n  br->len_ = len;\n  // pos_ > len_ should be considered a param error.\n  br->error_ = (br->pos_ > br->len_);\n  br->eos_ = br->error_ || VP8LIsEndOfStream(br);\n}\n\n// If not at EOS, reload up to VP8L_LBITS byte-by-byte\nstatic void ShiftBytes(VP8LBitReader* const br) {\n  while (br->bit_pos_ >= 8 && br->pos_ < br->len_) {\n    br->val_ >>= 8;\n    br->val_ |= ((vp8l_val_t)br->buf_[br->pos_]) << (VP8L_LBITS - 8);\n    ++br->pos_;\n    br->bit_pos_ -= 8;\n  }\n  br->eos_ = VP8LIsEndOfStream(br);\n}\n\nvoid VP8LDoFillBitWindow(VP8LBitReader* const br) {\n  assert(br->bit_pos_ >= VP8L_WBITS);\n  // TODO(jzern): given the fixed read size it may be possible to force\n  //              alignment in this block.\n#if defined(VP8L_USE_UNALIGNED_LOAD)\n  if (br->pos_ + sizeof(br->val_) < br->len_) {\n    br->val_ >>= VP8L_WBITS;\n    br->bit_pos_ -= VP8L_WBITS;\n    // The expression below needs a little-endian arch to work correctly.\n    // This gives a large speedup for decoding speed.\n    br->val_ |= (vp8l_val_t)*(const uint32_t*)(br->buf_ + br->pos_) <<\n                (VP8L_LBITS - VP8L_WBITS);\n    br->pos_ += VP8L_LOG8_WBITS;\n    return;\n  }\n#endif\n  ShiftBytes(br);       // Slow path.\n}\n\nuint32_t VP8LReadBits(VP8LBitReader* const br, int n_bits) {\n  assert(n_bits >= 0);\n  // Flag an error if end_of_stream or n_bits is more than allowed limit.\n  if (!br->eos_ && n_bits <= VP8L_MAX_NUM_BIT_READ) {\n    const uint32_t val =\n        (uint32_t)(br->val_ >> br->bit_pos_) & kBitMask[n_bits];\n    const int new_bits = br->bit_pos_ + n_bits;\n    br->bit_pos_ = new_bits;\n    ShiftBytes(br);\n    return val;\n  } else {\n    br->error_ = 1;\n    return 0;\n  }\n}\n\n//------------------------------------------------------------------------------\n"
  },
  {
    "path": "ext/libwebp/utils/bit_reader.h",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Boolean decoder\n//\n// Author: Skal (pascal.massimino@gmail.com)\n//         Vikas Arora (vikaas.arora@gmail.com)\n\n#ifndef WEBP_UTILS_BIT_READER_H_\n#define WEBP_UTILS_BIT_READER_H_\n\n#include <assert.h>\n#ifdef _MSC_VER\n#include <stdlib.h>  // _byteswap_ulong\n#endif\n#include \"../webp/types.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n// The Boolean decoder needs to maintain infinite precision on the value_ field.\n// However, since range_ is only 8bit, we only need an active window of 8 bits\n// for value_. Left bits (MSB) gets zeroed and shifted away when value_ falls\n// below 128, range_ is updated, and fresh bits read from the bitstream are\n// brought in as LSB. To avoid reading the fresh bits one by one (slow), we\n// cache BITS of them ahead. The total of (BITS + 8) bits must fit into a\n// natural register (with type bit_t). To fetch BITS bits from bitstream we\n// use a type lbit_t.\n//\n// BITS can be any multiple of 8 from 8 to 56 (inclusive).\n// Pick values that fit natural register size.\n\n#if defined(__i386__) || defined(_M_IX86)      // x86 32bit\n#define BITS 24\n#elif defined(__x86_64__) || defined(_M_X64)   // x86 64bit\n#define BITS 56\n#elif defined(__arm__) || defined(_M_ARM)      // ARM\n#define BITS 24\n#elif defined(__mips__)                        // MIPS\n#define BITS 24\n#else                                          // reasonable default\n#define BITS 24  // TODO(skal): test aarch64 and find the proper BITS value.\n#endif\n\n//------------------------------------------------------------------------------\n// Derived types and constants:\n//   bit_t = natural register type for storing 'value_' (which is BITS+8 bits)\n//   range_t = register for 'range_' (which is 8bits only)\n\n#if (BITS > 24)\ntypedef uint64_t bit_t;\n#else\ntypedef uint32_t bit_t;\n#endif\n\ntypedef uint32_t range_t;\n\n//------------------------------------------------------------------------------\n// Bitreader\n\ntypedef struct VP8BitReader VP8BitReader;\nstruct VP8BitReader {\n  // boolean decoder  (keep the field ordering as is!)\n  bit_t value_;               // current value\n  range_t range_;             // current range minus 1. In [127, 254] interval.\n  int bits_;                  // number of valid bits left\n  // read buffer\n  const uint8_t* buf_;        // next byte to be read\n  const uint8_t* buf_end_;    // end of read buffer\n  int eof_;                   // true if input is exhausted\n};\n\n// Initialize the bit reader and the boolean decoder.\nvoid VP8InitBitReader(VP8BitReader* const br,\n                      const uint8_t* const start, const uint8_t* const end);\n\n// Update internal pointers to displace the byte buffer by the\n// relative offset 'offset'.\nvoid VP8RemapBitReader(VP8BitReader* const br, ptrdiff_t offset);\n\n// return the next value made of 'num_bits' bits\nuint32_t VP8GetValue(VP8BitReader* const br, int num_bits);\nstatic WEBP_INLINE uint32_t VP8Get(VP8BitReader* const br) {\n  return VP8GetValue(br, 1);\n}\n\n// return the next value with sign-extension.\nint32_t VP8GetSignedValue(VP8BitReader* const br, int num_bits);\n\n// bit_reader_inl.h will implement the following methods:\n//   static WEBP_INLINE int VP8GetBit(VP8BitReader* const br, int prob)\n//   static WEBP_INLINE int VP8GetSigned(VP8BitReader* const br, int v)\n// and should be included by the .c files that actually need them.\n// This is to avoid recompiling the whole library whenever this file is touched,\n// and also allowing platform-specific ad-hoc hacks.\n\n// -----------------------------------------------------------------------------\n// Bitreader for lossless format\n\n// maximum number of bits (inclusive) the bit-reader can handle:\n#define VP8L_MAX_NUM_BIT_READ 24\n\n#define VP8L_LBITS 64  // Number of bits prefetched.\n#define VP8L_WBITS 32  // Minimum number of bytes ready after VP8LFillBitWindow.\n\ntypedef uint64_t vp8l_val_t;  // right now, this bit-reader can only use 64bit.\n\ntypedef struct {\n  vp8l_val_t     val_;        // pre-fetched bits\n  const uint8_t* buf_;        // input byte buffer\n  size_t         len_;        // buffer length\n  size_t         pos_;        // byte position in buf_\n  int            bit_pos_;    // current bit-reading position in val_\n  int            eos_;        // bitstream is finished\n  int            error_;      // an error occurred (buffer overflow attempt...)\n} VP8LBitReader;\n\nvoid VP8LInitBitReader(VP8LBitReader* const br,\n                       const uint8_t* const start,\n                       size_t length);\n\n//  Sets a new data buffer.\nvoid VP8LBitReaderSetBuffer(VP8LBitReader* const br,\n                            const uint8_t* const buffer, size_t length);\n\n// Reads the specified number of bits from read buffer.\n// Flags an error in case end_of_stream or n_bits is more than the allowed limit\n// of VP8L_MAX_NUM_BIT_READ (inclusive).\n// Flags eos_ if this read attempt is going to cross the read buffer.\nuint32_t VP8LReadBits(VP8LBitReader* const br, int n_bits);\n\n// Return the prefetched bits, so they can be looked up.\nstatic WEBP_INLINE uint32_t VP8LPrefetchBits(VP8LBitReader* const br) {\n  return (uint32_t)(br->val_ >> br->bit_pos_);\n}\n\n// Returns true if there was an attempt at reading bit past the end of\n// the buffer. Doesn't set br->eos_ flag.\nstatic WEBP_INLINE int VP8LIsEndOfStream(const VP8LBitReader* const br) {\n  assert(br->pos_ <= br->len_);\n  return (br->pos_ == br->len_) && (br->bit_pos_ > VP8L_LBITS);\n}\n\n// For jumping over a number of bits in the bit stream when accessed with\n// VP8LPrefetchBits and VP8LFillBitWindow.\nstatic WEBP_INLINE void VP8LSetBitPos(VP8LBitReader* const br, int val) {\n  br->bit_pos_ = val;\n  br->eos_ = VP8LIsEndOfStream(br);\n}\n\n// Advances the read buffer by 4 bytes to make room for reading next 32 bits.\n// Speed critical, but infrequent part of the code can be non-inlined.\nextern void VP8LDoFillBitWindow(VP8LBitReader* const br);\nstatic WEBP_INLINE void VP8LFillBitWindow(VP8LBitReader* const br) {\n  if (br->bit_pos_ >= VP8L_WBITS) VP8LDoFillBitWindow(br);\n}\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_UTILS_BIT_READER_H_ */\n"
  },
  {
    "path": "ext/libwebp/utils/bit_reader_inl.h",
    "content": "// Copyright 2014 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Specific inlined methods for boolean decoder [VP8GetBit() ...]\n// This file should be included by the .c sources that actually need to call\n// these methods.\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_UTILS_BIT_READER_INL_H_\n#define WEBP_UTILS_BIT_READER_INL_H_\n\n#ifdef HAVE_CONFIG_H\n#include \"../webp/config.h\"\n#endif\n\n#ifdef WEBP_FORCE_ALIGNED\n#include <string.h>  // memcpy\n#endif\n\n#include \"../dsp/dsp.h\"\n#include \"./bit_reader.h\"\n#include \"./endian_inl.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n//------------------------------------------------------------------------------\n// Derived type lbit_t = natural type for memory I/O\n\n#if   (BITS > 32)\ntypedef uint64_t lbit_t;\n#elif (BITS > 16)\ntypedef uint32_t lbit_t;\n#elif (BITS >  8)\ntypedef uint16_t lbit_t;\n#else\ntypedef uint8_t lbit_t;\n#endif\n\nextern const uint8_t kVP8Log2Range[128];\nextern const range_t kVP8NewRange[128];\n\n// special case for the tail byte-reading\nvoid VP8LoadFinalBytes(VP8BitReader* const br);\n\n//------------------------------------------------------------------------------\n// Inlined critical functions\n\n// makes sure br->value_ has at least BITS bits worth of data\nstatic WEBP_INLINE void VP8LoadNewBytes(VP8BitReader* const br) {\n  assert(br != NULL && br->buf_ != NULL);\n  // Read 'BITS' bits at a time if possible.\n  if (br->buf_ + sizeof(lbit_t) <= br->buf_end_) {\n    // convert memory type to register type (with some zero'ing!)\n    bit_t bits;\n#if defined(WEBP_FORCE_ALIGNED)\n    lbit_t in_bits;\n    memcpy(&in_bits, br->buf_, sizeof(in_bits));\n#elif defined(WEBP_USE_MIPS32)\n    // This is needed because of un-aligned read.\n    lbit_t in_bits;\n    lbit_t* p_buf_ = (lbit_t*)br->buf_;\n    __asm__ volatile(\n      \".set   push                             \\n\\t\"\n      \".set   at                               \\n\\t\"\n      \".set   macro                            \\n\\t\"\n      \"ulw    %[in_bits], 0(%[p_buf_])         \\n\\t\"\n      \".set   pop                              \\n\\t\"\n      : [in_bits]\"=r\"(in_bits)\n      : [p_buf_]\"r\"(p_buf_)\n      : \"memory\", \"at\"\n    );\n#else\n    const lbit_t in_bits = *(const lbit_t*)br->buf_;\n#endif\n    br->buf_ += BITS >> 3;\n#if !defined(WORDS_BIGENDIAN)\n#if (BITS > 32)\n    bits = BSwap64(in_bits);\n    bits >>= 64 - BITS;\n#elif (BITS >= 24)\n    bits = BSwap32(in_bits);\n    bits >>= (32 - BITS);\n#elif (BITS == 16)\n    bits = BSwap16(in_bits);\n#else   // BITS == 8\n    bits = (bit_t)in_bits;\n#endif  // BITS > 32\n#else    // WORDS_BIGENDIAN\n    bits = (bit_t)in_bits;\n    if (BITS != 8 * sizeof(bit_t)) bits >>= (8 * sizeof(bit_t) - BITS);\n#endif\n    br->value_ = bits | (br->value_ << BITS);\n    br->bits_ += BITS;\n  } else {\n    VP8LoadFinalBytes(br);    // no need to be inlined\n  }\n}\n\n// Read a bit with proba 'prob'. Speed-critical function!\nstatic WEBP_INLINE int VP8GetBit(VP8BitReader* const br, int prob) {\n  // Don't move this declaration! It makes a big speed difference to store\n  // 'range' *before* calling VP8LoadNewBytes(), even if this function doesn't\n  // alter br->range_ value.\n  range_t range = br->range_;\n  if (br->bits_ < 0) {\n    VP8LoadNewBytes(br);\n  }\n  {\n    const int pos = br->bits_;\n    const range_t split = (range * prob) >> 8;\n    const range_t value = (range_t)(br->value_ >> pos);\n#if defined(__arm__) || defined(_M_ARM)      // ARM-specific\n    const int bit = ((int)(split - value) >> 31) & 1;\n    if (value > split) {\n      range -= split + 1;\n      br->value_ -= (bit_t)(split + 1) << pos;\n    } else {\n      range = split;\n    }\n#else  // faster version on x86\n    int bit;  // Don't use 'const int bit = (value > split);\", it's slower.\n    if (value > split) {\n      range -= split + 1;\n      br->value_ -= (bit_t)(split + 1) << pos;\n      bit = 1;\n    } else {\n      range = split;\n      bit = 0;\n    }\n#endif\n    if (range <= (range_t)0x7e) {\n      const int shift = kVP8Log2Range[range];\n      range = kVP8NewRange[range];\n      br->bits_ -= shift;\n    }\n    br->range_ = range;\n    return bit;\n  }\n}\n\n// simplified version of VP8GetBit() for prob=0x80 (note shift is always 1 here)\nstatic WEBP_INLINE int VP8GetSigned(VP8BitReader* const br, int v) {\n  if (br->bits_ < 0) {\n    VP8LoadNewBytes(br);\n  }\n  {\n    const int pos = br->bits_;\n    const range_t split = br->range_ >> 1;\n    const range_t value = (range_t)(br->value_ >> pos);\n    const int32_t mask = (int32_t)(split - value) >> 31;  // -1 or 0\n    br->bits_ -= 1;\n    br->range_ += mask;\n    br->range_ |= 1;\n    br->value_ -= (bit_t)((split + 1) & mask) << pos;\n    return (v ^ mask) - mask;\n  }\n}\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif   // WEBP_UTILS_BIT_READER_INL_H_\n"
  },
  {
    "path": "ext/libwebp/utils/bit_writer.c",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Bit writing and boolean coder\n//\n// Author: Skal (pascal.massimino@gmail.com)\n//         Vikas Arora (vikaas.arora@gmail.com)\n\n#include <assert.h>\n#include <string.h>   // for memcpy()\n#include <stdlib.h>\n\n#include \"./bit_writer.h\"\n#include \"./endian_inl.h\"\n#include \"./utils.h\"\n\n//------------------------------------------------------------------------------\n// VP8BitWriter\n\nstatic int BitWriterResize(VP8BitWriter* const bw, size_t extra_size) {\n  uint8_t* new_buf;\n  size_t new_size;\n  const uint64_t needed_size_64b = (uint64_t)bw->pos_ + extra_size;\n  const size_t needed_size = (size_t)needed_size_64b;\n  if (needed_size_64b != needed_size) {\n    bw->error_ = 1;\n    return 0;\n  }\n  if (needed_size <= bw->max_pos_) return 1;\n  // If the following line wraps over 32bit, the test just after will catch it.\n  new_size = 2 * bw->max_pos_;\n  if (new_size < needed_size) new_size = needed_size;\n  if (new_size < 1024) new_size = 1024;\n  new_buf = (uint8_t*)WebPSafeMalloc(1ULL, new_size);\n  if (new_buf == NULL) {\n    bw->error_ = 1;\n    return 0;\n  }\n  if (bw->pos_ > 0) {\n    assert(bw->buf_ != NULL);\n    memcpy(new_buf, bw->buf_, bw->pos_);\n  }\n  WebPSafeFree(bw->buf_);\n  bw->buf_ = new_buf;\n  bw->max_pos_ = new_size;\n  return 1;\n}\n\nstatic void Flush(VP8BitWriter* const bw) {\n  const int s = 8 + bw->nb_bits_;\n  const int32_t bits = bw->value_ >> s;\n  assert(bw->nb_bits_ >= 0);\n  bw->value_ -= bits << s;\n  bw->nb_bits_ -= 8;\n  if ((bits & 0xff) != 0xff) {\n    size_t pos = bw->pos_;\n    if (!BitWriterResize(bw, bw->run_ + 1)) {\n      return;\n    }\n    if (bits & 0x100) {  // overflow -> propagate carry over pending 0xff's\n      if (pos > 0) bw->buf_[pos - 1]++;\n    }\n    if (bw->run_ > 0) {\n      const int value = (bits & 0x100) ? 0x00 : 0xff;\n      for (; bw->run_ > 0; --bw->run_) bw->buf_[pos++] = value;\n    }\n    bw->buf_[pos++] = bits;\n    bw->pos_ = pos;\n  } else {\n    bw->run_++;   // delay writing of bytes 0xff, pending eventual carry.\n  }\n}\n\n//------------------------------------------------------------------------------\n// renormalization\n\nstatic const uint8_t kNorm[128] = {  // renorm_sizes[i] = 8 - log2(i)\n     7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,\n  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,\n  2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n  2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n  0\n};\n\n// range = ((range + 1) << kVP8Log2Range[range]) - 1\nstatic const uint8_t kNewRange[128] = {\n  127, 127, 191, 127, 159, 191, 223, 127, 143, 159, 175, 191, 207, 223, 239,\n  127, 135, 143, 151, 159, 167, 175, 183, 191, 199, 207, 215, 223, 231, 239,\n  247, 127, 131, 135, 139, 143, 147, 151, 155, 159, 163, 167, 171, 175, 179,\n  183, 187, 191, 195, 199, 203, 207, 211, 215, 219, 223, 227, 231, 235, 239,\n  243, 247, 251, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149,\n  151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 177, 179,\n  181, 183, 185, 187, 189, 191, 193, 195, 197, 199, 201, 203, 205, 207, 209,\n  211, 213, 215, 217, 219, 221, 223, 225, 227, 229, 231, 233, 235, 237, 239,\n  241, 243, 245, 247, 249, 251, 253, 127\n};\n\nint VP8PutBit(VP8BitWriter* const bw, int bit, int prob) {\n  const int split = (bw->range_ * prob) >> 8;\n  if (bit) {\n    bw->value_ += split + 1;\n    bw->range_ -= split + 1;\n  } else {\n    bw->range_ = split;\n  }\n  if (bw->range_ < 127) {   // emit 'shift' bits out and renormalize\n    const int shift = kNorm[bw->range_];\n    bw->range_ = kNewRange[bw->range_];\n    bw->value_ <<= shift;\n    bw->nb_bits_ += shift;\n    if (bw->nb_bits_ > 0) Flush(bw);\n  }\n  return bit;\n}\n\nint VP8PutBitUniform(VP8BitWriter* const bw, int bit) {\n  const int split = bw->range_ >> 1;\n  if (bit) {\n    bw->value_ += split + 1;\n    bw->range_ -= split + 1;\n  } else {\n    bw->range_ = split;\n  }\n  if (bw->range_ < 127) {\n    bw->range_ = kNewRange[bw->range_];\n    bw->value_ <<= 1;\n    bw->nb_bits_ += 1;\n    if (bw->nb_bits_ > 0) Flush(bw);\n  }\n  return bit;\n}\n\nvoid VP8PutValue(VP8BitWriter* const bw, int value, int nb_bits) {\n  int mask;\n  for (mask = 1 << (nb_bits - 1); mask; mask >>= 1)\n    VP8PutBitUniform(bw, value & mask);\n}\n\nvoid VP8PutSignedValue(VP8BitWriter* const bw, int value, int nb_bits) {\n  if (!VP8PutBitUniform(bw, value != 0))\n    return;\n  if (value < 0) {\n    VP8PutValue(bw, ((-value) << 1) | 1, nb_bits + 1);\n  } else {\n    VP8PutValue(bw, value << 1, nb_bits + 1);\n  }\n}\n\n//------------------------------------------------------------------------------\n\nint VP8BitWriterInit(VP8BitWriter* const bw, size_t expected_size) {\n  bw->range_   = 255 - 1;\n  bw->value_   = 0;\n  bw->run_     = 0;\n  bw->nb_bits_ = -8;\n  bw->pos_     = 0;\n  bw->max_pos_ = 0;\n  bw->error_   = 0;\n  bw->buf_     = NULL;\n  return (expected_size > 0) ? BitWriterResize(bw, expected_size) : 1;\n}\n\nuint8_t* VP8BitWriterFinish(VP8BitWriter* const bw) {\n  VP8PutValue(bw, 0, 9 - bw->nb_bits_);\n  bw->nb_bits_ = 0;   // pad with zeroes\n  Flush(bw);\n  return bw->buf_;\n}\n\nint VP8BitWriterAppend(VP8BitWriter* const bw,\n                       const uint8_t* data, size_t size) {\n  assert(data != NULL);\n  if (bw->nb_bits_ != -8) return 0;   // Flush() must have been called\n  if (!BitWriterResize(bw, size)) return 0;\n  memcpy(bw->buf_ + bw->pos_, data, size);\n  bw->pos_ += size;\n  return 1;\n}\n\nvoid VP8BitWriterWipeOut(VP8BitWriter* const bw) {\n  if (bw != NULL) {\n    WebPSafeFree(bw->buf_);\n    memset(bw, 0, sizeof(*bw));\n  }\n}\n\n//------------------------------------------------------------------------------\n// VP8LBitWriter\n\n// This is the minimum amount of size the memory buffer is guaranteed to grow\n// when extra space is needed.\n#define MIN_EXTRA_SIZE  (32768ULL)\n\n#define VP8L_WRITER_BYTES ((int)sizeof(vp8l_wtype_t))\n#define VP8L_WRITER_BITS (VP8L_WRITER_BYTES * 8)\n#define VP8L_WRITER_MAX_BITS (8 * (int)sizeof(vp8l_atype_t))\n\n// Returns 1 on success.\nstatic int VP8LBitWriterResize(VP8LBitWriter* const bw, size_t extra_size) {\n  uint8_t* allocated_buf;\n  size_t allocated_size;\n  const size_t max_bytes = bw->end_ - bw->buf_;\n  const size_t current_size = bw->cur_ - bw->buf_;\n  const uint64_t size_required_64b = (uint64_t)current_size + extra_size;\n  const size_t size_required = (size_t)size_required_64b;\n  if (size_required != size_required_64b) {\n    bw->error_ = 1;\n    return 0;\n  }\n  if (max_bytes > 0 && size_required <= max_bytes) return 1;\n  allocated_size = (3 * max_bytes) >> 1;\n  if (allocated_size < size_required) allocated_size = size_required;\n  // make allocated size multiple of 1k\n  allocated_size = (((allocated_size >> 10) + 1) << 10);\n  allocated_buf = (uint8_t*)WebPSafeMalloc(1ULL, allocated_size);\n  if (allocated_buf == NULL) {\n    bw->error_ = 1;\n    return 0;\n  }\n  if (current_size > 0) {\n    memcpy(allocated_buf, bw->buf_, current_size);\n  }\n  WebPSafeFree(bw->buf_);\n  bw->buf_ = allocated_buf;\n  bw->cur_ = bw->buf_ + current_size;\n  bw->end_ = bw->buf_ + allocated_size;\n  return 1;\n}\n\nint VP8LBitWriterInit(VP8LBitWriter* const bw, size_t expected_size) {\n  memset(bw, 0, sizeof(*bw));\n  return VP8LBitWriterResize(bw, expected_size);\n}\n\nvoid VP8LBitWriterDestroy(VP8LBitWriter* const bw) {\n  if (bw != NULL) {\n    WebPSafeFree(bw->buf_);\n    memset(bw, 0, sizeof(*bw));\n  }\n}\n\nvoid VP8LWriteBits(VP8LBitWriter* const bw, int n_bits, uint32_t bits) {\n  assert(n_bits <= 32);\n  // That's the max we can handle:\n  assert(bw->used_ + n_bits <= 2 * VP8L_WRITER_MAX_BITS);\n  if (n_bits > 0) {\n    // Local field copy.\n    vp8l_atype_t lbits = bw->bits_;\n    int used = bw->used_;\n    // Special case of overflow handling for 32bit accumulator (2-steps flush).\n    if (VP8L_WRITER_BITS == 16) {\n      if (used + n_bits >= VP8L_WRITER_MAX_BITS) {\n        // Fill up all the VP8L_WRITER_MAX_BITS so it can be flushed out below.\n        const int shift = VP8L_WRITER_MAX_BITS - used;\n        lbits |= (vp8l_atype_t)bits << used;\n        used = VP8L_WRITER_MAX_BITS;\n        n_bits -= shift;\n        bits >>= shift;\n        assert(n_bits <= VP8L_WRITER_MAX_BITS);\n      }\n    }\n    // If needed, make some room by flushing some bits out.\n    while (used >= VP8L_WRITER_BITS) {\n      if (bw->cur_ + VP8L_WRITER_BYTES > bw->end_) {\n        const uint64_t extra_size = (bw->end_ - bw->buf_) + MIN_EXTRA_SIZE;\n        if (extra_size != (size_t)extra_size ||\n            !VP8LBitWriterResize(bw, (size_t)extra_size)) {\n          bw->cur_ = bw->buf_;\n          bw->error_ = 1;\n          return;\n        }\n      }\n      *(vp8l_wtype_t*)bw->cur_ = (vp8l_wtype_t)WSWAP((vp8l_wtype_t)lbits);\n      bw->cur_ += VP8L_WRITER_BYTES;\n      lbits >>= VP8L_WRITER_BITS;\n      used -= VP8L_WRITER_BITS;\n    }\n    // Eventually, insert new bits.\n    bw->bits_ = lbits | ((vp8l_atype_t)bits << used);\n    bw->used_ = used + n_bits;\n  }\n}\n\nuint8_t* VP8LBitWriterFinish(VP8LBitWriter* const bw) {\n  // flush leftover bits\n  if (VP8LBitWriterResize(bw, (bw->used_ + 7) >> 3)) {\n    while (bw->used_ > 0) {\n      *bw->cur_++ = (uint8_t)bw->bits_;\n      bw->bits_ >>= 8;\n      bw->used_ -= 8;\n    }\n    bw->used_ = 0;\n  }\n  return bw->buf_;\n}\n\n//------------------------------------------------------------------------------\n"
  },
  {
    "path": "ext/libwebp/utils/bit_writer.h",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Bit writing and boolean coder\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_UTILS_BIT_WRITER_H_\n#define WEBP_UTILS_BIT_WRITER_H_\n\n#include \"../webp/types.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n//------------------------------------------------------------------------------\n// Bit-writing\n\ntypedef struct VP8BitWriter VP8BitWriter;\nstruct VP8BitWriter {\n  int32_t  range_;      // range-1\n  int32_t  value_;\n  int      run_;        // number of outstanding bits\n  int      nb_bits_;    // number of pending bits\n  uint8_t* buf_;        // internal buffer. Re-allocated regularly. Not owned.\n  size_t   pos_;\n  size_t   max_pos_;\n  int      error_;      // true in case of error\n};\n\n// Initialize the object. Allocates some initial memory based on expected_size.\nint VP8BitWriterInit(VP8BitWriter* const bw, size_t expected_size);\n// Finalize the bitstream coding. Returns a pointer to the internal buffer.\nuint8_t* VP8BitWriterFinish(VP8BitWriter* const bw);\n// Release any pending memory and zeroes the object. Not a mandatory call.\n// Only useful in case of error, when the internal buffer hasn't been grabbed!\nvoid VP8BitWriterWipeOut(VP8BitWriter* const bw);\n\nint VP8PutBit(VP8BitWriter* const bw, int bit, int prob);\nint VP8PutBitUniform(VP8BitWriter* const bw, int bit);\nvoid VP8PutValue(VP8BitWriter* const bw, int value, int nb_bits);\nvoid VP8PutSignedValue(VP8BitWriter* const bw, int value, int nb_bits);\n\n// Appends some bytes to the internal buffer. Data is copied.\nint VP8BitWriterAppend(VP8BitWriter* const bw,\n                       const uint8_t* data, size_t size);\n\n// return approximate write position (in bits)\nstatic WEBP_INLINE uint64_t VP8BitWriterPos(const VP8BitWriter* const bw) {\n  return (uint64_t)(bw->pos_ + bw->run_) * 8 + 8 + bw->nb_bits_;\n}\n\n// Returns a pointer to the internal buffer.\nstatic WEBP_INLINE uint8_t* VP8BitWriterBuf(const VP8BitWriter* const bw) {\n  return bw->buf_;\n}\n// Returns the size of the internal buffer.\nstatic WEBP_INLINE size_t VP8BitWriterSize(const VP8BitWriter* const bw) {\n  return bw->pos_;\n}\n\n//------------------------------------------------------------------------------\n// VP8LBitWriter\n\n#if defined(__x86_64__) || defined(_M_X64)   // 64bit\ntypedef uint64_t vp8l_atype_t;   // accumulator type\ntypedef uint32_t vp8l_wtype_t;   // writing type\n#define WSWAP HToLE32\n#else\ntypedef uint32_t vp8l_atype_t;\ntypedef uint16_t vp8l_wtype_t;\n#define WSWAP HToLE16\n#endif\n\ntypedef struct {\n  vp8l_atype_t bits_;   // bit accumulator\n  int          used_;   // number of bits used in accumulator\n  uint8_t*     buf_;    // start of buffer\n  uint8_t*     cur_;    // current write position\n  uint8_t*     end_;    // end of buffer\n\n  // After all bits are written (VP8LBitWriterFinish()), the caller must observe\n  // the state of error_. A value of 1 indicates that a memory allocation\n  // failure has happened during bit writing. A value of 0 indicates successful\n  // writing of bits.\n  int error_;\n} VP8LBitWriter;\n\nstatic WEBP_INLINE size_t VP8LBitWriterNumBytes(VP8LBitWriter* const bw) {\n  return (bw->cur_ - bw->buf_) + ((bw->used_ + 7) >> 3);\n}\n\nuint8_t* VP8LBitWriterFinish(VP8LBitWriter* const bw);\n\n// Returns 0 in case of memory allocation error.\nint VP8LBitWriterInit(VP8LBitWriter* const bw, size_t expected_size);\n\nvoid VP8LBitWriterDestroy(VP8LBitWriter* const bw);\n\n// This function writes bits into bytes in increasing addresses (little endian),\n// and within a byte least-significant-bit first.\n// This function can write up to 32 bits in one go, but VP8LBitReader can only\n// read 24 bits max (VP8L_MAX_NUM_BIT_READ).\n// VP8LBitWriter's error_ flag is set in case of  memory allocation error.\nvoid VP8LWriteBits(VP8LBitWriter* const bw, int n_bits, uint32_t bits);\n\n//------------------------------------------------------------------------------\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_UTILS_BIT_WRITER_H_ */\n"
  },
  {
    "path": "ext/libwebp/utils/color_cache.c",
    "content": "// Copyright 2012 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Color Cache for WebP Lossless\n//\n// Author: Jyrki Alakuijala (jyrki@google.com)\n\n#include <assert.h>\n#include <stdlib.h>\n#include \"./color_cache.h\"\n#include \"../utils/utils.h\"\n\n//------------------------------------------------------------------------------\n// VP8LColorCache.\n\nint VP8LColorCacheInit(VP8LColorCache* const cc, int hash_bits) {\n  const int hash_size = 1 << hash_bits;\n  assert(cc != NULL);\n  assert(hash_bits > 0);\n  cc->colors_ = (uint32_t*)WebPSafeCalloc((uint64_t)hash_size,\n                                          sizeof(*cc->colors_));\n  if (cc->colors_ == NULL) return 0;\n  cc->hash_shift_ = 32 - hash_bits;\n  return 1;\n}\n\nvoid VP8LColorCacheClear(VP8LColorCache* const cc) {\n  if (cc != NULL) {\n    WebPSafeFree(cc->colors_);\n    cc->colors_ = NULL;\n  }\n}\n\n"
  },
  {
    "path": "ext/libwebp/utils/color_cache.h",
    "content": "// Copyright 2012 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Color Cache for WebP Lossless\n//\n// Authors: Jyrki Alakuijala (jyrki@google.com)\n//          Urvang Joshi (urvang@google.com)\n\n#ifndef WEBP_UTILS_COLOR_CACHE_H_\n#define WEBP_UTILS_COLOR_CACHE_H_\n\n#include \"../webp/types.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n// Main color cache struct.\ntypedef struct {\n  uint32_t *colors_;  // color entries\n  int hash_shift_;    // Hash shift: 32 - hash_bits.\n} VP8LColorCache;\n\nstatic const uint32_t kHashMul = 0x1e35a7bd;\n\nstatic WEBP_INLINE uint32_t VP8LColorCacheLookup(\n    const VP8LColorCache* const cc, uint32_t key) {\n  assert(key <= (~0U >> cc->hash_shift_));\n  return cc->colors_[key];\n}\n\nstatic WEBP_INLINE void VP8LColorCacheInsert(const VP8LColorCache* const cc,\n                                             uint32_t argb) {\n  const uint32_t key = (kHashMul * argb) >> cc->hash_shift_;\n  cc->colors_[key] = argb;\n}\n\nstatic WEBP_INLINE int VP8LColorCacheGetIndex(const VP8LColorCache* const cc,\n                                              uint32_t argb) {\n  return (kHashMul * argb) >> cc->hash_shift_;\n}\n\nstatic WEBP_INLINE int VP8LColorCacheContains(const VP8LColorCache* const cc,\n                                              uint32_t argb) {\n  const uint32_t key = (kHashMul * argb) >> cc->hash_shift_;\n  return cc->colors_[key] == argb;\n}\n\n//------------------------------------------------------------------------------\n\n// Initializes the color cache with 'hash_bits' bits for the keys.\n// Returns false in case of memory error.\nint VP8LColorCacheInit(VP8LColorCache* const color_cache, int hash_bits);\n\n// Delete the memory associated to color cache.\nvoid VP8LColorCacheClear(VP8LColorCache* const color_cache);\n\n//------------------------------------------------------------------------------\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif  // WEBP_UTILS_COLOR_CACHE_H_\n"
  },
  {
    "path": "ext/libwebp/utils/endian_inl.h",
    "content": "// Copyright 2014 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Endian related functions.\n\n#ifndef WEBP_UTILS_ENDIAN_INL_H_\n#define WEBP_UTILS_ENDIAN_INL_H_\n\n#ifdef HAVE_CONFIG_H\n#include \"../webp/config.h\"\n#endif\n\n#include \"../dsp/dsp.h\"\n#include \"../webp/types.h\"\n\n// some endian fix (e.g.: mips-gcc doesn't define __BIG_ENDIAN__)\n#if !defined(WORDS_BIGENDIAN) && \\\n    (defined(__BIG_ENDIAN__) || defined(_M_PPC) || \\\n     (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)))\n#define WORDS_BIGENDIAN\n#endif\n\n#if defined(WORDS_BIGENDIAN)\n#define HToLE32 BSwap32\n#define HToLE16 BSwap16\n#else\n#define HToLE32(x) (x)\n#define HToLE16(x) (x)\n#endif\n\n#if !defined(HAVE_CONFIG_H)\n// clang-3.3 and gcc-4.3 have builtin functions for swap32/swap64\n#if LOCAL_GCC_PREREQ(4,3) || LOCAL_CLANG_PREREQ(3,3)\n#define HAVE_BUILTIN_BSWAP32\n#define HAVE_BUILTIN_BSWAP64\n#endif\n// clang-3.3 and gcc-4.8 have a builtin function for swap16\n#if LOCAL_GCC_PREREQ(4,8) || LOCAL_CLANG_PREREQ(3,3)\n#define HAVE_BUILTIN_BSWAP16\n#endif\n#endif  // !HAVE_CONFIG_H\n\nstatic WEBP_INLINE uint16_t BSwap16(uint16_t x) {\n#if defined(HAVE_BUILTIN_BSWAP16)\n  return __builtin_bswap16(x);\n#elif defined(_MSC_VER)\n  return _byteswap_ushort(x);\n#else\n  // gcc will recognize a 'rorw $8, ...' here:\n  return (x >> 8) | ((x & 0xff) << 8);\n#endif  // HAVE_BUILTIN_BSWAP16\n}\n\nstatic WEBP_INLINE uint32_t BSwap32(uint32_t x) {\n#if defined(WEBP_USE_MIPS32_R2)\n  uint32_t ret;\n  __asm__ volatile (\n    \"wsbh   %[ret], %[x]          \\n\\t\"\n    \"rotr   %[ret], %[ret],  16   \\n\\t\"\n    : [ret]\"=r\"(ret)\n    : [x]\"r\"(x)\n  );\n  return ret;\n#elif defined(HAVE_BUILTIN_BSWAP32)\n  return __builtin_bswap32(x);\n#elif defined(__i386__) || defined(__x86_64__)\n  uint32_t swapped_bytes;\n  __asm__ volatile(\"bswap %0\" : \"=r\"(swapped_bytes) : \"0\"(x));\n  return swapped_bytes;\n#elif defined(_MSC_VER)\n  return (uint32_t)_byteswap_ulong(x);\n#else\n  return (x >> 24) | ((x >> 8) & 0xff00) | ((x << 8) & 0xff0000) | (x << 24);\n#endif  // HAVE_BUILTIN_BSWAP32\n}\n\nstatic WEBP_INLINE uint64_t BSwap64(uint64_t x) {\n#if defined(HAVE_BUILTIN_BSWAP64)\n  return __builtin_bswap64(x);\n#elif defined(__x86_64__)\n  uint64_t swapped_bytes;\n  __asm__ volatile(\"bswapq %0\" : \"=r\"(swapped_bytes) : \"0\"(x));\n  return swapped_bytes;\n#elif defined(_MSC_VER)\n  return (uint64_t)_byteswap_uint64(x);\n#else  // generic code for swapping 64-bit values (suggested by bdb@)\n  x = ((x & 0xffffffff00000000ull) >> 32) | ((x & 0x00000000ffffffffull) << 32);\n  x = ((x & 0xffff0000ffff0000ull) >> 16) | ((x & 0x0000ffff0000ffffull) << 16);\n  x = ((x & 0xff00ff00ff00ff00ull) >>  8) | ((x & 0x00ff00ff00ff00ffull) <<  8);\n  return x;\n#endif  // HAVE_BUILTIN_BSWAP64\n}\n\n#endif  // WEBP_UTILS_ENDIAN_INL_H_\n"
  },
  {
    "path": "ext/libwebp/utils/filters.c",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Spatial prediction using various filters\n//\n// Author: Urvang (urvang@google.com)\n\n#include \"./filters.h\"\n#include <assert.h>\n#include <stdlib.h>\n#include <string.h>\n\n//------------------------------------------------------------------------------\n// Helpful macro.\n\n# define SANITY_CHECK(in, out)                                                 \\\n  assert(in != NULL);                                                          \\\n  assert(out != NULL);                                                         \\\n  assert(width > 0);                                                           \\\n  assert(height > 0);                                                          \\\n  assert(stride >= width);                                                     \\\n  assert(row >= 0 && num_rows > 0 && row + num_rows <= height);                \\\n  (void)height;  // Silence unused warning.\n\nstatic WEBP_INLINE void PredictLine(const uint8_t* src, const uint8_t* pred,\n                                    uint8_t* dst, int length, int inverse) {\n  int i;\n  if (inverse) {\n    for (i = 0; i < length; ++i) dst[i] = src[i] + pred[i];\n  } else {\n    for (i = 0; i < length; ++i) dst[i] = src[i] - pred[i];\n  }\n}\n\n//------------------------------------------------------------------------------\n// Horizontal filter.\n\nstatic WEBP_INLINE void DoHorizontalFilter(const uint8_t* in,\n                                           int width, int height, int stride,\n                                           int row, int num_rows,\n                                           int inverse, uint8_t* out) {\n  const uint8_t* preds;\n  const size_t start_offset = row * stride;\n  const int last_row = row + num_rows;\n  SANITY_CHECK(in, out);\n  in += start_offset;\n  out += start_offset;\n  preds = inverse ? out : in;\n\n  if (row == 0) {\n    // Leftmost pixel is the same as input for topmost scanline.\n    out[0] = in[0];\n    PredictLine(in + 1, preds, out + 1, width - 1, inverse);\n    row = 1;\n    preds += stride;\n    in += stride;\n    out += stride;\n  }\n\n  // Filter line-by-line.\n  while (row < last_row) {\n    // Leftmost pixel is predicted from above.\n    PredictLine(in, preds - stride, out, 1, inverse);\n    PredictLine(in + 1, preds, out + 1, width - 1, inverse);\n    ++row;\n    preds += stride;\n    in += stride;\n    out += stride;\n  }\n}\n\nstatic void HorizontalFilter(const uint8_t* data, int width, int height,\n                             int stride, uint8_t* filtered_data) {\n  DoHorizontalFilter(data, width, height, stride, 0, height, 0, filtered_data);\n}\n\nstatic void HorizontalUnfilter(int width, int height, int stride, int row,\n                               int num_rows, uint8_t* data) {\n  DoHorizontalFilter(data, width, height, stride, row, num_rows, 1, data);\n}\n\n//------------------------------------------------------------------------------\n// Vertical filter.\n\nstatic WEBP_INLINE void DoVerticalFilter(const uint8_t* in,\n                                         int width, int height, int stride,\n                                         int row, int num_rows,\n                                         int inverse, uint8_t* out) {\n  const uint8_t* preds;\n  const size_t start_offset = row * stride;\n  const int last_row = row + num_rows;\n  SANITY_CHECK(in, out);\n  in += start_offset;\n  out += start_offset;\n  preds = inverse ? out : in;\n\n  if (row == 0) {\n    // Very first top-left pixel is copied.\n    out[0] = in[0];\n    // Rest of top scan-line is left-predicted.\n    PredictLine(in + 1, preds, out + 1, width - 1, inverse);\n    row = 1;\n    in += stride;\n    out += stride;\n  } else {\n    // We are starting from in-between. Make sure 'preds' points to prev row.\n    preds -= stride;\n  }\n\n  // Filter line-by-line.\n  while (row < last_row) {\n    PredictLine(in, preds, out, width, inverse);\n    ++row;\n    preds += stride;\n    in += stride;\n    out += stride;\n  }\n}\n\nstatic void VerticalFilter(const uint8_t* data, int width, int height,\n                           int stride, uint8_t* filtered_data) {\n  DoVerticalFilter(data, width, height, stride, 0, height, 0, filtered_data);\n}\n\nstatic void VerticalUnfilter(int width, int height, int stride, int row,\n                             int num_rows, uint8_t* data) {\n  DoVerticalFilter(data, width, height, stride, row, num_rows, 1, data);\n}\n\n//------------------------------------------------------------------------------\n// Gradient filter.\n\nstatic WEBP_INLINE int GradientPredictor(uint8_t a, uint8_t b, uint8_t c) {\n  const int g = a + b - c;\n  return ((g & ~0xff) == 0) ? g : (g < 0) ? 0 : 255;  // clip to 8bit\n}\n\nstatic WEBP_INLINE void DoGradientFilter(const uint8_t* in,\n                                         int width, int height, int stride,\n                                         int row, int num_rows,\n                                         int inverse, uint8_t* out) {\n  const uint8_t* preds;\n  const size_t start_offset = row * stride;\n  const int last_row = row + num_rows;\n  SANITY_CHECK(in, out);\n  in += start_offset;\n  out += start_offset;\n  preds = inverse ? out : in;\n\n  // left prediction for top scan-line\n  if (row == 0) {\n    out[0] = in[0];\n    PredictLine(in + 1, preds, out + 1, width - 1, inverse);\n    row = 1;\n    preds += stride;\n    in += stride;\n    out += stride;\n  }\n\n  // Filter line-by-line.\n  while (row < last_row) {\n    int w;\n    // leftmost pixel: predict from above.\n    PredictLine(in, preds - stride, out, 1, inverse);\n    for (w = 1; w < width; ++w) {\n      const int pred = GradientPredictor(preds[w - 1],\n                                         preds[w - stride],\n                                         preds[w - stride - 1]);\n      out[w] = in[w] + (inverse ? pred : -pred);\n    }\n    ++row;\n    preds += stride;\n    in += stride;\n    out += stride;\n  }\n}\n\nstatic void GradientFilter(const uint8_t* data, int width, int height,\n                           int stride, uint8_t* filtered_data) {\n  DoGradientFilter(data, width, height, stride, 0, height, 0, filtered_data);\n}\n\nstatic void GradientUnfilter(int width, int height, int stride, int row,\n                             int num_rows, uint8_t* data) {\n  DoGradientFilter(data, width, height, stride, row, num_rows, 1, data);\n}\n\n#undef SANITY_CHECK\n\n// -----------------------------------------------------------------------------\n// Quick estimate of a potentially interesting filter mode to try.\n\n#define SMAX 16\n#define SDIFF(a, b) (abs((a) - (b)) >> 4)   // Scoring diff, in [0..SMAX)\n\nWEBP_FILTER_TYPE EstimateBestFilter(const uint8_t* data,\n                                    int width, int height, int stride) {\n  int i, j;\n  int bins[WEBP_FILTER_LAST][SMAX];\n  memset(bins, 0, sizeof(bins));\n\n  // We only sample every other pixels. That's enough.\n  for (j = 2; j < height - 1; j += 2) {\n    const uint8_t* const p = data + j * stride;\n    int mean = p[0];\n    for (i = 2; i < width - 1; i += 2) {\n      const int diff0 = SDIFF(p[i], mean);\n      const int diff1 = SDIFF(p[i], p[i - 1]);\n      const int diff2 = SDIFF(p[i], p[i - width]);\n      const int grad_pred =\n          GradientPredictor(p[i - 1], p[i - width], p[i - width - 1]);\n      const int diff3 = SDIFF(p[i], grad_pred);\n      bins[WEBP_FILTER_NONE][diff0] = 1;\n      bins[WEBP_FILTER_HORIZONTAL][diff1] = 1;\n      bins[WEBP_FILTER_VERTICAL][diff2] = 1;\n      bins[WEBP_FILTER_GRADIENT][diff3] = 1;\n      mean = (3 * mean + p[i] + 2) >> 2;\n    }\n  }\n  {\n    int filter;\n    WEBP_FILTER_TYPE best_filter = WEBP_FILTER_NONE;\n    int best_score = 0x7fffffff;\n    for (filter = WEBP_FILTER_NONE; filter < WEBP_FILTER_LAST; ++filter) {\n      int score = 0;\n      for (i = 0; i < SMAX; ++i) {\n        if (bins[filter][i] > 0) {\n          score += i;\n        }\n      }\n      if (score < best_score) {\n        best_score = score;\n        best_filter = (WEBP_FILTER_TYPE)filter;\n      }\n    }\n    return best_filter;\n  }\n}\n\n#undef SMAX\n#undef SDIFF\n\n//------------------------------------------------------------------------------\n\nconst WebPFilterFunc WebPFilters[WEBP_FILTER_LAST] = {\n  NULL,              // WEBP_FILTER_NONE\n  HorizontalFilter,  // WEBP_FILTER_HORIZONTAL\n  VerticalFilter,    // WEBP_FILTER_VERTICAL\n  GradientFilter     // WEBP_FILTER_GRADIENT\n};\n\nconst WebPUnfilterFunc WebPUnfilters[WEBP_FILTER_LAST] = {\n  NULL,                // WEBP_FILTER_NONE\n  HorizontalUnfilter,  // WEBP_FILTER_HORIZONTAL\n  VerticalUnfilter,    // WEBP_FILTER_VERTICAL\n  GradientUnfilter     // WEBP_FILTER_GRADIENT\n};\n\n//------------------------------------------------------------------------------\n\n"
  },
  {
    "path": "ext/libwebp/utils/filters.h",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Spatial prediction using various filters\n//\n// Author: Urvang (urvang@google.com)\n\n#ifndef WEBP_UTILS_FILTERS_H_\n#define WEBP_UTILS_FILTERS_H_\n\n#include \"../webp/types.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n// Filters.\ntypedef enum {\n  WEBP_FILTER_NONE = 0,\n  WEBP_FILTER_HORIZONTAL,\n  WEBP_FILTER_VERTICAL,\n  WEBP_FILTER_GRADIENT,\n  WEBP_FILTER_LAST = WEBP_FILTER_GRADIENT + 1,  // end marker\n  WEBP_FILTER_BEST,\n  WEBP_FILTER_FAST\n} WEBP_FILTER_TYPE;\n\ntypedef void (*WebPFilterFunc)(const uint8_t* in, int width, int height,\n                               int stride, uint8_t* out);\ntypedef void (*WebPUnfilterFunc)(int width, int height, int stride,\n                                 int row, int num_rows, uint8_t* data);\n\n// Filter the given data using the given predictor.\n// 'in' corresponds to a 2-dimensional pixel array of size (stride * height)\n// in raster order.\n// 'stride' is number of bytes per scan line (with possible padding).\n// 'out' should be pre-allocated.\nextern const WebPFilterFunc WebPFilters[WEBP_FILTER_LAST];\n\n// In-place reconstruct the original data from the given filtered data.\n// The reconstruction will be done for 'num_rows' rows starting from 'row'\n// (assuming rows upto 'row - 1' are already reconstructed).\nextern const WebPUnfilterFunc WebPUnfilters[WEBP_FILTER_LAST];\n\n// Fast estimate of a potentially good filter.\nWEBP_FILTER_TYPE EstimateBestFilter(const uint8_t* data,\n                                    int width, int height, int stride);\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_UTILS_FILTERS_H_ */\n"
  },
  {
    "path": "ext/libwebp/utils/huffman.c",
    "content": "// Copyright 2012 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Utilities for building and looking up Huffman trees.\n//\n// Author: Urvang Joshi (urvang@google.com)\n\n#include <assert.h>\n#include <stdlib.h>\n#include <string.h>\n#include \"./huffman.h\"\n#include \"../utils/utils.h\"\n#include \"../webp/format_constants.h\"\n\n// Uncomment the following to use look-up table for ReverseBits()\n// (might be faster on some platform)\n// #define USE_LUT_REVERSE_BITS\n\n// Huffman data read via DecodeImageStream is represented in two (red and green)\n// bytes.\n#define MAX_HTREE_GROUPS    0x10000\n#define NON_EXISTENT_SYMBOL (-1)\n\nstatic void TreeNodeInit(HuffmanTreeNode* const node) {\n  node->children_ = -1;   // means: 'unassigned so far'\n}\n\nstatic int NodeIsEmpty(const HuffmanTreeNode* const node) {\n  return (node->children_ < 0);\n}\n\nstatic int IsFull(const HuffmanTree* const tree) {\n  return (tree->num_nodes_ == tree->max_nodes_);\n}\n\nstatic void AssignChildren(HuffmanTree* const tree,\n                           HuffmanTreeNode* const node) {\n  HuffmanTreeNode* const children = tree->root_ + tree->num_nodes_;\n  node->children_ = (int)(children - node);\n  assert(children - node == (int)(children - node));\n  tree->num_nodes_ += 2;\n  TreeNodeInit(children + 0);\n  TreeNodeInit(children + 1);\n}\n\n// A Huffman tree is a full binary tree; and in a full binary tree with L\n// leaves, the total number of nodes N = 2 * L - 1.\nstatic int HuffmanTreeMaxNodes(int num_leaves) {\n  return (2 * num_leaves - 1);\n}\n\nstatic int HuffmanTreeAllocate(HuffmanTree* const tree, int num_nodes) {\n  assert(tree != NULL);\n  tree->root_ =\n      (HuffmanTreeNode*)WebPSafeMalloc(num_nodes, sizeof(*tree->root_));\n  return (tree->root_ != NULL);\n}\n\nstatic int TreeInit(HuffmanTree* const tree, int num_leaves) {\n  assert(tree != NULL);\n  if (num_leaves == 0) return 0;\n  tree->max_nodes_ = HuffmanTreeMaxNodes(num_leaves);\n  assert(tree->max_nodes_ < (1 << 16));   // limit for the lut_jump_ table\n  if (!HuffmanTreeAllocate(tree, tree->max_nodes_)) return 0;\n  TreeNodeInit(tree->root_);  // Initialize root.\n  tree->num_nodes_ = 1;\n  memset(tree->lut_bits_, 255, sizeof(tree->lut_bits_));\n  memset(tree->lut_jump_, 0, sizeof(tree->lut_jump_));\n  return 1;\n}\n\nvoid VP8LHuffmanTreeFree(HuffmanTree* const tree) {\n  if (tree != NULL) {\n    WebPSafeFree(tree->root_);\n    tree->root_ = NULL;\n    tree->max_nodes_ = 0;\n    tree->num_nodes_ = 0;\n  }\n}\n\nHTreeGroup* VP8LHtreeGroupsNew(int num_htree_groups) {\n  HTreeGroup* const htree_groups =\n      (HTreeGroup*)WebPSafeCalloc(num_htree_groups, sizeof(*htree_groups));\n  assert(num_htree_groups <= MAX_HTREE_GROUPS);\n  if (htree_groups == NULL) {\n    return NULL;\n  }\n  return htree_groups;\n}\n\nvoid VP8LHtreeGroupsFree(HTreeGroup* htree_groups, int num_htree_groups) {\n  if (htree_groups != NULL) {\n    int i, j;\n    for (i = 0; i < num_htree_groups; ++i) {\n      HuffmanTree* const htrees = htree_groups[i].htrees_;\n      for (j = 0; j < HUFFMAN_CODES_PER_META_CODE; ++j) {\n        VP8LHuffmanTreeFree(&htrees[j]);\n      }\n    }\n    WebPSafeFree(htree_groups);\n  }\n}\n\nint VP8LHuffmanCodeLengthsToCodes(\n    const int* const code_lengths, int code_lengths_size,\n    int* const huff_codes) {\n  int symbol;\n  int code_len;\n  int code_length_hist[MAX_ALLOWED_CODE_LENGTH + 1] = { 0 };\n  int curr_code;\n  int next_codes[MAX_ALLOWED_CODE_LENGTH + 1] = { 0 };\n  int max_code_length = 0;\n\n  assert(code_lengths != NULL);\n  assert(code_lengths_size > 0);\n  assert(huff_codes != NULL);\n\n  // Calculate max code length.\n  for (symbol = 0; symbol < code_lengths_size; ++symbol) {\n    if (code_lengths[symbol] > max_code_length) {\n      max_code_length = code_lengths[symbol];\n    }\n  }\n  if (max_code_length > MAX_ALLOWED_CODE_LENGTH) return 0;\n\n  // Calculate code length histogram.\n  for (symbol = 0; symbol < code_lengths_size; ++symbol) {\n    ++code_length_hist[code_lengths[symbol]];\n  }\n  code_length_hist[0] = 0;\n\n  // Calculate the initial values of 'next_codes' for each code length.\n  // next_codes[code_len] denotes the code to be assigned to the next symbol\n  // of code length 'code_len'.\n  curr_code = 0;\n  next_codes[0] = -1;  // Unused, as code length = 0 implies code doesn't exist.\n  for (code_len = 1; code_len <= max_code_length; ++code_len) {\n    curr_code = (curr_code + code_length_hist[code_len - 1]) << 1;\n    next_codes[code_len] = curr_code;\n  }\n\n  // Get symbols.\n  for (symbol = 0; symbol < code_lengths_size; ++symbol) {\n    if (code_lengths[symbol] > 0) {\n      huff_codes[symbol] = next_codes[code_lengths[symbol]]++;\n    } else {\n      huff_codes[symbol] = NON_EXISTENT_SYMBOL;\n    }\n  }\n  return 1;\n}\n\n#ifndef USE_LUT_REVERSE_BITS\n\nstatic int ReverseBitsShort(int bits, int num_bits) {\n  int retval = 0;\n  int i;\n  assert(num_bits <= 8);   // Not a hard requirement, just for coherency.\n  for (i = 0; i < num_bits; ++i) {\n    retval <<= 1;\n    retval |= bits & 1;\n    bits >>= 1;\n  }\n  return retval;\n}\n\n#else\n\nstatic const uint8_t kReversedBits[16] = {  // Pre-reversed 4-bit values.\n  0x0, 0x8, 0x4, 0xc, 0x2, 0xa, 0x6, 0xe,\n  0x1, 0x9, 0x5, 0xd, 0x3, 0xb, 0x7, 0xf\n};\n\nstatic int ReverseBitsShort(int bits, int num_bits) {\n  const uint8_t v = (kReversedBits[bits & 0xf] << 4) | kReversedBits[bits >> 4];\n  assert(num_bits <= 8);\n  return v >> (8 - num_bits);\n}\n\n#endif\n\nstatic int TreeAddSymbol(HuffmanTree* const tree,\n                         int symbol, int code, int code_length) {\n  int step = HUFF_LUT_BITS;\n  int base_code;\n  HuffmanTreeNode* node = tree->root_;\n  const HuffmanTreeNode* const max_node = tree->root_ + tree->max_nodes_;\n  assert(symbol == (int16_t)symbol);\n  if (code_length <= HUFF_LUT_BITS) {\n    int i;\n    base_code = ReverseBitsShort(code, code_length);\n    for (i = 0; i < (1 << (HUFF_LUT_BITS - code_length)); ++i) {\n      const int idx = base_code | (i << code_length);\n      tree->lut_symbol_[idx] = (int16_t)symbol;\n      tree->lut_bits_[idx] = code_length;\n    }\n  } else {\n    base_code = ReverseBitsShort((code >> (code_length - HUFF_LUT_BITS)),\n                                 HUFF_LUT_BITS);\n  }\n  while (code_length-- > 0) {\n    if (node >= max_node) {\n      return 0;\n    }\n    if (NodeIsEmpty(node)) {\n      if (IsFull(tree)) return 0;    // error: too many symbols.\n      AssignChildren(tree, node);\n    } else if (!HuffmanTreeNodeIsNotLeaf(node)) {\n      return 0;  // leaf is already occupied.\n    }\n    node += node->children_ + ((code >> code_length) & 1);\n    if (--step == 0) {\n      tree->lut_jump_[base_code] = (int16_t)(node - tree->root_);\n    }\n  }\n  if (NodeIsEmpty(node)) {\n    node->children_ = 0;      // turn newly created node into a leaf.\n  } else if (HuffmanTreeNodeIsNotLeaf(node)) {\n    return 0;   // trying to assign a symbol to already used code.\n  }\n  node->symbol_ = symbol;  // Add symbol in this node.\n  return 1;\n}\n\nint VP8LHuffmanTreeBuildImplicit(HuffmanTree* const tree,\n                                 const int* const code_lengths,\n                                 int* const codes,\n                                 int code_lengths_size) {\n  int symbol;\n  int num_symbols = 0;\n  int root_symbol = 0;\n\n  assert(tree != NULL);\n  assert(code_lengths != NULL);\n\n  // Find out number of symbols and the root symbol.\n  for (symbol = 0; symbol < code_lengths_size; ++symbol) {\n    if (code_lengths[symbol] > 0) {\n      // Note: code length = 0 indicates non-existent symbol.\n      ++num_symbols;\n      root_symbol = symbol;\n    }\n  }\n\n  // Initialize the tree. Will fail for num_symbols = 0\n  if (!TreeInit(tree, num_symbols)) return 0;\n\n  // Build tree.\n  if (num_symbols == 1) {  // Trivial case.\n    const int max_symbol = code_lengths_size;\n    if (root_symbol < 0 || root_symbol >= max_symbol) {\n      VP8LHuffmanTreeFree(tree);\n      return 0;\n    }\n    return TreeAddSymbol(tree, root_symbol, 0, 0);\n  } else {  // Normal case.\n    int ok = 0;\n    memset(codes, 0, code_lengths_size * sizeof(*codes));\n\n    if (!VP8LHuffmanCodeLengthsToCodes(code_lengths, code_lengths_size,\n                                       codes)) {\n      goto End;\n    }\n\n    // Add symbols one-by-one.\n    for (symbol = 0; symbol < code_lengths_size; ++symbol) {\n      if (code_lengths[symbol] > 0) {\n        if (!TreeAddSymbol(tree, symbol, codes[symbol],\n                           code_lengths[symbol])) {\n          goto End;\n        }\n      }\n    }\n    ok = 1;\n End:\n    ok = ok && IsFull(tree);\n    if (!ok) VP8LHuffmanTreeFree(tree);\n    return ok;\n  }\n}\n\nint VP8LHuffmanTreeBuildExplicit(HuffmanTree* const tree,\n                                 const int* const code_lengths,\n                                 const int* const codes,\n                                 const int* const symbols, int max_symbol,\n                                 int num_symbols) {\n  int ok = 0;\n  int i;\n  assert(tree != NULL);\n  assert(code_lengths != NULL);\n  assert(codes != NULL);\n  assert(symbols != NULL);\n\n  // Initialize the tree. Will fail if num_symbols = 0.\n  if (!TreeInit(tree, num_symbols)) return 0;\n\n  // Add symbols one-by-one.\n  for (i = 0; i < num_symbols; ++i) {\n    if (codes[i] != NON_EXISTENT_SYMBOL) {\n      if (symbols[i] < 0 || symbols[i] >= max_symbol) {\n        goto End;\n      }\n      if (!TreeAddSymbol(tree, symbols[i], codes[i], code_lengths[i])) {\n        goto End;\n      }\n    }\n  }\n  ok = 1;\n End:\n  ok = ok && IsFull(tree);\n  if (!ok) VP8LHuffmanTreeFree(tree);\n  return ok;\n}\n"
  },
  {
    "path": "ext/libwebp/utils/huffman.h",
    "content": "// Copyright 2012 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Utilities for building and looking up Huffman trees.\n//\n// Author: Urvang Joshi (urvang@google.com)\n\n#ifndef WEBP_UTILS_HUFFMAN_H_\n#define WEBP_UTILS_HUFFMAN_H_\n\n#include <assert.h>\n#include \"../webp/format_constants.h\"\n#include \"../webp/types.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n// A node of a Huffman tree.\ntypedef struct {\n  int symbol_;\n  int children_;  // delta offset to both children (contiguous) or 0 if leaf.\n} HuffmanTreeNode;\n\n// Huffman Tree.\n#define HUFF_LUT_BITS 7\n#define HUFF_LUT (1U << HUFF_LUT_BITS)\ntypedef struct HuffmanTree HuffmanTree;\nstruct HuffmanTree {\n  // Fast lookup for short bit lengths.\n  uint8_t lut_bits_[HUFF_LUT];\n  int16_t lut_symbol_[HUFF_LUT];\n  int16_t lut_jump_[HUFF_LUT];\n  // Complete tree for lookups.\n  HuffmanTreeNode* root_;   // all the nodes, starting at root.\n  int max_nodes_;           // max number of nodes\n  int num_nodes_;           // number of currently occupied nodes\n};\n\n// Huffman Tree group.\ntypedef struct HTreeGroup HTreeGroup;\nstruct HTreeGroup {\n  HuffmanTree htrees_[HUFFMAN_CODES_PER_META_CODE];\n};\n\n// Returns true if the given node is not a leaf of the Huffman tree.\nstatic WEBP_INLINE int HuffmanTreeNodeIsNotLeaf(\n    const HuffmanTreeNode* const node) {\n  return node->children_;\n}\n\n// Go down one level. Most critical function. 'right_child' must be 0 or 1.\nstatic WEBP_INLINE const HuffmanTreeNode* HuffmanTreeNextNode(\n    const HuffmanTreeNode* node, int right_child) {\n  return node + node->children_ + right_child;\n}\n\n// Releases the nodes of the Huffman tree.\n// Note: It does NOT free 'tree' itself.\nvoid VP8LHuffmanTreeFree(HuffmanTree* const tree);\n\n// Creates the instance of HTreeGroup with specified number of tree-groups.\nHTreeGroup* VP8LHtreeGroupsNew(int num_htree_groups);\n\n// Releases the memory allocated for HTreeGroup.\nvoid VP8LHtreeGroupsFree(HTreeGroup* htree_groups, int num_htree_groups);\n\n// Builds Huffman tree assuming code lengths are implicitly in symbol order.\n// The 'huff_codes' and 'code_lengths' are pre-allocated temporary memory\n// buffers, used for creating the huffman tree.\n// Returns false in case of error (invalid tree or memory error).\nint VP8LHuffmanTreeBuildImplicit(HuffmanTree* const tree,\n                                 const int* const code_lengths,\n                                 int* const huff_codes,\n                                 int code_lengths_size);\n\n// Build a Huffman tree with explicitly given lists of code lengths, codes\n// and symbols. Verifies that all symbols added are smaller than max_symbol.\n// Returns false in case of an invalid symbol, invalid tree or memory error.\nint VP8LHuffmanTreeBuildExplicit(HuffmanTree* const tree,\n                                 const int* const code_lengths,\n                                 const int* const codes,\n                                 const int* const symbols, int max_symbol,\n                                 int num_symbols);\n\n// Utility: converts Huffman code lengths to corresponding Huffman codes.\n// 'huff_codes' should be pre-allocated.\n// Returns false in case of error (memory allocation, invalid codes).\nint VP8LHuffmanCodeLengthsToCodes(const int* const code_lengths,\n                                  int code_lengths_size, int* const huff_codes);\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  // WEBP_UTILS_HUFFMAN_H_\n"
  },
  {
    "path": "ext/libwebp/utils/huffman_encode.c",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Author: Jyrki Alakuijala (jyrki@google.com)\n//\n// Entropy encoding (Huffman) for webp lossless.\n\n#include <assert.h>\n#include <stdlib.h>\n#include <string.h>\n#include \"./huffman_encode.h\"\n#include \"../utils/utils.h\"\n#include \"../webp/format_constants.h\"\n\n// -----------------------------------------------------------------------------\n// Util function to optimize the symbol map for RLE coding\n\n// Heuristics for selecting the stride ranges to collapse.\nstatic int ValuesShouldBeCollapsedToStrideAverage(int a, int b) {\n  return abs(a - b) < 4;\n}\n\n// Change the population counts in a way that the consequent\n// Huffman tree compression, especially its RLE-part, give smaller output.\nstatic void OptimizeHuffmanForRle(int length, uint8_t* const good_for_rle,\n                                  uint32_t* const counts) {\n  // 1) Let's make the Huffman code more compatible with rle encoding.\n  int i;\n  for (; length >= 0; --length) {\n    if (length == 0) {\n      return;  // All zeros.\n    }\n    if (counts[length - 1] != 0) {\n      // Now counts[0..length - 1] does not have trailing zeros.\n      break;\n    }\n  }\n  // 2) Let's mark all population counts that already can be encoded\n  // with an rle code.\n  {\n    // Let's not spoil any of the existing good rle codes.\n    // Mark any seq of 0's that is longer as 5 as a good_for_rle.\n    // Mark any seq of non-0's that is longer as 7 as a good_for_rle.\n    uint32_t symbol = counts[0];\n    int stride = 0;\n    for (i = 0; i < length + 1; ++i) {\n      if (i == length || counts[i] != symbol) {\n        if ((symbol == 0 && stride >= 5) ||\n            (symbol != 0 && stride >= 7)) {\n          int k;\n          for (k = 0; k < stride; ++k) {\n            good_for_rle[i - k - 1] = 1;\n          }\n        }\n        stride = 1;\n        if (i != length) {\n          symbol = counts[i];\n        }\n      } else {\n        ++stride;\n      }\n    }\n  }\n  // 3) Let's replace those population counts that lead to more rle codes.\n  {\n    uint32_t stride = 0;\n    uint32_t limit = counts[0];\n    uint32_t sum = 0;\n    for (i = 0; i < length + 1; ++i) {\n      if (i == length || good_for_rle[i] ||\n          (i != 0 && good_for_rle[i - 1]) ||\n          !ValuesShouldBeCollapsedToStrideAverage(counts[i], limit)) {\n        if (stride >= 4 || (stride >= 3 && sum == 0)) {\n          uint32_t k;\n          // The stride must end, collapse what we have, if we have enough (4).\n          uint32_t count = (sum + stride / 2) / stride;\n          if (count < 1) {\n            count = 1;\n          }\n          if (sum == 0) {\n            // Don't make an all zeros stride to be upgraded to ones.\n            count = 0;\n          }\n          for (k = 0; k < stride; ++k) {\n            // We don't want to change value at counts[i],\n            // that is already belonging to the next stride. Thus - 1.\n            counts[i - k - 1] = count;\n          }\n        }\n        stride = 0;\n        sum = 0;\n        if (i < length - 3) {\n          // All interesting strides have a count of at least 4,\n          // at least when non-zeros.\n          limit = (counts[i] + counts[i + 1] +\n                   counts[i + 2] + counts[i + 3] + 2) / 4;\n        } else if (i < length) {\n          limit = counts[i];\n        } else {\n          limit = 0;\n        }\n      }\n      ++stride;\n      if (i != length) {\n        sum += counts[i];\n        if (stride >= 4) {\n          limit = (sum + stride / 2) / stride;\n        }\n      }\n    }\n  }\n}\n\n// A comparer function for two Huffman trees: sorts first by 'total count'\n// (more comes first), and then by 'value' (more comes first).\nstatic int CompareHuffmanTrees(const void* ptr1, const void* ptr2) {\n  const HuffmanTree* const t1 = (const HuffmanTree*)ptr1;\n  const HuffmanTree* const t2 = (const HuffmanTree*)ptr2;\n  if (t1->total_count_ > t2->total_count_) {\n    return -1;\n  } else if (t1->total_count_ < t2->total_count_) {\n    return 1;\n  } else {\n    assert(t1->value_ != t2->value_);\n    return (t1->value_ < t2->value_) ? -1 : 1;\n  }\n}\n\nstatic void SetBitDepths(const HuffmanTree* const tree,\n                         const HuffmanTree* const pool,\n                         uint8_t* const bit_depths, int level) {\n  if (tree->pool_index_left_ >= 0) {\n    SetBitDepths(&pool[tree->pool_index_left_], pool, bit_depths, level + 1);\n    SetBitDepths(&pool[tree->pool_index_right_], pool, bit_depths, level + 1);\n  } else {\n    bit_depths[tree->value_] = level;\n  }\n}\n\n// Create an optimal Huffman tree.\n//\n// (data,length): population counts.\n// tree_limit: maximum bit depth (inclusive) of the codes.\n// bit_depths[]: how many bits are used for the symbol.\n//\n// Returns 0 when an error has occurred.\n//\n// The catch here is that the tree cannot be arbitrarily deep\n//\n// count_limit is the value that is to be faked as the minimum value\n// and this minimum value is raised until the tree matches the\n// maximum length requirement.\n//\n// This algorithm is not of excellent performance for very long data blocks,\n// especially when population counts are longer than 2**tree_limit, but\n// we are not planning to use this with extremely long blocks.\n//\n// See http://en.wikipedia.org/wiki/Huffman_coding\nstatic void GenerateOptimalTree(const uint32_t* const histogram,\n                                int histogram_size,\n                                HuffmanTree* tree, int tree_depth_limit,\n                                uint8_t* const bit_depths) {\n  uint32_t count_min;\n  HuffmanTree* tree_pool;\n  int tree_size_orig = 0;\n  int i;\n\n  for (i = 0; i < histogram_size; ++i) {\n    if (histogram[i] != 0) {\n      ++tree_size_orig;\n    }\n  }\n\n  if (tree_size_orig == 0) {   // pretty optimal already!\n    return;\n  }\n\n  tree_pool = tree + tree_size_orig;\n\n  // For block sizes with less than 64k symbols we never need to do a\n  // second iteration of this loop.\n  // If we actually start running inside this loop a lot, we would perhaps\n  // be better off with the Katajainen algorithm.\n  assert(tree_size_orig <= (1 << (tree_depth_limit - 1)));\n  for (count_min = 1; ; count_min *= 2) {\n    int tree_size = tree_size_orig;\n    // We need to pack the Huffman tree in tree_depth_limit bits.\n    // So, we try by faking histogram entries to be at least 'count_min'.\n    int idx = 0;\n    int j;\n    for (j = 0; j < histogram_size; ++j) {\n      if (histogram[j] != 0) {\n        const uint32_t count =\n            (histogram[j] < count_min) ? count_min : histogram[j];\n        tree[idx].total_count_ = count;\n        tree[idx].value_ = j;\n        tree[idx].pool_index_left_ = -1;\n        tree[idx].pool_index_right_ = -1;\n        ++idx;\n      }\n    }\n\n    // Build the Huffman tree.\n    qsort(tree, tree_size, sizeof(*tree), CompareHuffmanTrees);\n\n    if (tree_size > 1) {  // Normal case.\n      int tree_pool_size = 0;\n      while (tree_size > 1) {  // Finish when we have only one root.\n        uint32_t count;\n        tree_pool[tree_pool_size++] = tree[tree_size - 1];\n        tree_pool[tree_pool_size++] = tree[tree_size - 2];\n        count = tree_pool[tree_pool_size - 1].total_count_ +\n                tree_pool[tree_pool_size - 2].total_count_;\n        tree_size -= 2;\n        {\n          // Search for the insertion point.\n          int k;\n          for (k = 0; k < tree_size; ++k) {\n            if (tree[k].total_count_ <= count) {\n              break;\n            }\n          }\n          memmove(tree + (k + 1), tree + k, (tree_size - k) * sizeof(*tree));\n          tree[k].total_count_ = count;\n          tree[k].value_ = -1;\n\n          tree[k].pool_index_left_ = tree_pool_size - 1;\n          tree[k].pool_index_right_ = tree_pool_size - 2;\n          tree_size = tree_size + 1;\n        }\n      }\n      SetBitDepths(&tree[0], tree_pool, bit_depths, 0);\n    } else if (tree_size == 1) {  // Trivial case: only one element.\n      bit_depths[tree[0].value_] = 1;\n    }\n\n    {\n      // Test if this Huffman tree satisfies our 'tree_depth_limit' criteria.\n      int max_depth = bit_depths[0];\n      for (j = 1; j < histogram_size; ++j) {\n        if (max_depth < bit_depths[j]) {\n          max_depth = bit_depths[j];\n        }\n      }\n      if (max_depth <= tree_depth_limit) {\n        break;\n      }\n    }\n  }\n}\n\n// -----------------------------------------------------------------------------\n// Coding of the Huffman tree values\n\nstatic HuffmanTreeToken* CodeRepeatedValues(int repetitions,\n                                            HuffmanTreeToken* tokens,\n                                            int value, int prev_value) {\n  assert(value <= MAX_ALLOWED_CODE_LENGTH);\n  if (value != prev_value) {\n    tokens->code = value;\n    tokens->extra_bits = 0;\n    ++tokens;\n    --repetitions;\n  }\n  while (repetitions >= 1) {\n    if (repetitions < 3) {\n      int i;\n      for (i = 0; i < repetitions; ++i) {\n        tokens->code = value;\n        tokens->extra_bits = 0;\n        ++tokens;\n      }\n      break;\n    } else if (repetitions < 7) {\n      tokens->code = 16;\n      tokens->extra_bits = repetitions - 3;\n      ++tokens;\n      break;\n    } else {\n      tokens->code = 16;\n      tokens->extra_bits = 3;\n      ++tokens;\n      repetitions -= 6;\n    }\n  }\n  return tokens;\n}\n\nstatic HuffmanTreeToken* CodeRepeatedZeros(int repetitions,\n                                           HuffmanTreeToken* tokens) {\n  while (repetitions >= 1) {\n    if (repetitions < 3) {\n      int i;\n      for (i = 0; i < repetitions; ++i) {\n        tokens->code = 0;   // 0-value\n        tokens->extra_bits = 0;\n        ++tokens;\n      }\n      break;\n    } else if (repetitions < 11) {\n      tokens->code = 17;\n      tokens->extra_bits = repetitions - 3;\n      ++tokens;\n      break;\n    } else if (repetitions < 139) {\n      tokens->code = 18;\n      tokens->extra_bits = repetitions - 11;\n      ++tokens;\n      break;\n    } else {\n      tokens->code = 18;\n      tokens->extra_bits = 0x7f;  // 138 repeated 0s\n      ++tokens;\n      repetitions -= 138;\n    }\n  }\n  return tokens;\n}\n\nint VP8LCreateCompressedHuffmanTree(const HuffmanTreeCode* const tree,\n                                    HuffmanTreeToken* tokens, int max_tokens) {\n  HuffmanTreeToken* const starting_token = tokens;\n  HuffmanTreeToken* const ending_token = tokens + max_tokens;\n  const int depth_size = tree->num_symbols;\n  int prev_value = 8;  // 8 is the initial value for rle.\n  int i = 0;\n  assert(tokens != NULL);\n  while (i < depth_size) {\n    const int value = tree->code_lengths[i];\n    int k = i + 1;\n    int runs;\n    while (k < depth_size && tree->code_lengths[k] == value) ++k;\n    runs = k - i;\n    if (value == 0) {\n      tokens = CodeRepeatedZeros(runs, tokens);\n    } else {\n      tokens = CodeRepeatedValues(runs, tokens, value, prev_value);\n      prev_value = value;\n    }\n    i += runs;\n    assert(tokens <= ending_token);\n  }\n  (void)ending_token;    // suppress 'unused variable' warning\n  return (int)(tokens - starting_token);\n}\n\n// -----------------------------------------------------------------------------\n\n// Pre-reversed 4-bit values.\nstatic const uint8_t kReversedBits[16] = {\n  0x0, 0x8, 0x4, 0xc, 0x2, 0xa, 0x6, 0xe,\n  0x1, 0x9, 0x5, 0xd, 0x3, 0xb, 0x7, 0xf\n};\n\nstatic uint32_t ReverseBits(int num_bits, uint32_t bits) {\n  uint32_t retval = 0;\n  int i = 0;\n  while (i < num_bits) {\n    i += 4;\n    retval |= kReversedBits[bits & 0xf] << (MAX_ALLOWED_CODE_LENGTH + 1 - i);\n    bits >>= 4;\n  }\n  retval >>= (MAX_ALLOWED_CODE_LENGTH + 1 - num_bits);\n  return retval;\n}\n\n// Get the actual bit values for a tree of bit depths.\nstatic void ConvertBitDepthsToSymbols(HuffmanTreeCode* const tree) {\n  // 0 bit-depth means that the symbol does not exist.\n  int i;\n  int len;\n  uint32_t next_code[MAX_ALLOWED_CODE_LENGTH + 1];\n  int depth_count[MAX_ALLOWED_CODE_LENGTH + 1] = { 0 };\n\n  assert(tree != NULL);\n  len = tree->num_symbols;\n  for (i = 0; i < len; ++i) {\n    const int code_length = tree->code_lengths[i];\n    assert(code_length <= MAX_ALLOWED_CODE_LENGTH);\n    ++depth_count[code_length];\n  }\n  depth_count[0] = 0;  // ignore unused symbol\n  next_code[0] = 0;\n  {\n    uint32_t code = 0;\n    for (i = 1; i <= MAX_ALLOWED_CODE_LENGTH; ++i) {\n      code = (code + depth_count[i - 1]) << 1;\n      next_code[i] = code;\n    }\n  }\n  for (i = 0; i < len; ++i) {\n    const int code_length = tree->code_lengths[i];\n    tree->codes[i] = ReverseBits(code_length, next_code[code_length]++);\n  }\n}\n\n// -----------------------------------------------------------------------------\n// Main entry point\n\nvoid VP8LCreateHuffmanTree(uint32_t* const histogram, int tree_depth_limit,\n                           uint8_t* const buf_rle,\n                           HuffmanTree* const huff_tree,\n                           HuffmanTreeCode* const huff_code) {\n  const int num_symbols = huff_code->num_symbols;\n  memset(buf_rle, 0, num_symbols * sizeof(*buf_rle));\n  OptimizeHuffmanForRle(num_symbols, buf_rle, histogram);\n  GenerateOptimalTree(histogram, num_symbols, huff_tree, tree_depth_limit,\n                      huff_code->code_lengths);\n  // Create the actual bit codes for the bit lengths.\n  ConvertBitDepthsToSymbols(huff_code);\n}\n"
  },
  {
    "path": "ext/libwebp/utils/huffman_encode.h",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Author: Jyrki Alakuijala (jyrki@google.com)\n//\n// Entropy encoding (Huffman) for webp lossless\n\n#ifndef WEBP_UTILS_HUFFMAN_ENCODE_H_\n#define WEBP_UTILS_HUFFMAN_ENCODE_H_\n\n#include \"../webp/types.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n// Struct for holding the tree header in coded form.\ntypedef struct {\n  uint8_t code;         // value (0..15) or escape code (16,17,18)\n  uint8_t extra_bits;   // extra bits for escape codes\n} HuffmanTreeToken;\n\n// Struct to represent the tree codes (depth and bits array).\ntypedef struct {\n  int       num_symbols;   // Number of symbols.\n  uint8_t*  code_lengths;  // Code lengths of the symbols.\n  uint16_t* codes;         // Symbol Codes.\n} HuffmanTreeCode;\n\n// Struct to represent the Huffman tree.\n// TODO(vikasa): Add comment for the fields of the Struct.\ntypedef struct {\n  uint32_t total_count_;\n  int value_;\n  int pool_index_left_;    // Index for the left sub-tree.\n  int pool_index_right_;   // Index for the right sub-tree.\n} HuffmanTree;\n\n// Turn the Huffman tree into a token sequence.\n// Returns the number of tokens used.\nint VP8LCreateCompressedHuffmanTree(const HuffmanTreeCode* const tree,\n                                    HuffmanTreeToken* tokens, int max_tokens);\n\n// Create an optimized tree, and tokenize it.\n// 'buf_rle' and 'huff_tree' are pre-allocated and the 'tree' is the constructed\n// huffman code tree.\nvoid VP8LCreateHuffmanTree(uint32_t* const histogram, int tree_depth_limit,\n                           uint8_t* const buf_rle, HuffmanTree* const huff_tree,\n                           HuffmanTreeCode* const tree);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif  // WEBP_UTILS_HUFFMAN_ENCODE_H_\n"
  },
  {
    "path": "ext/libwebp/utils/quant_levels.c",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Quantize levels for specified number of quantization-levels ([2, 256]).\n// Min and max values are preserved (usual 0 and 255 for alpha plane).\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include <assert.h>\n\n#include \"./quant_levels.h\"\n\n#define NUM_SYMBOLS     256\n\n#define MAX_ITER  6             // Maximum number of convergence steps.\n#define ERROR_THRESHOLD 1e-4    // MSE stopping criterion.\n\n// -----------------------------------------------------------------------------\n// Quantize levels.\n\nint QuantizeLevels(uint8_t* const data, int width, int height,\n                   int num_levels, uint64_t* const sse) {\n  int freq[NUM_SYMBOLS] = { 0 };\n  int q_level[NUM_SYMBOLS] = { 0 };\n  double inv_q_level[NUM_SYMBOLS] = { 0 };\n  int min_s = 255, max_s = 0;\n  const size_t data_size = height * width;\n  int i, num_levels_in, iter;\n  double last_err = 1.e38, err = 0.;\n  const double err_threshold = ERROR_THRESHOLD * data_size;\n\n  if (data == NULL) {\n    return 0;\n  }\n\n  if (width <= 0 || height <= 0) {\n    return 0;\n  }\n\n  if (num_levels < 2 || num_levels > 256) {\n    return 0;\n  }\n\n  {\n    size_t n;\n    num_levels_in = 0;\n    for (n = 0; n < data_size; ++n) {\n      num_levels_in += (freq[data[n]] == 0);\n      if (min_s > data[n]) min_s = data[n];\n      if (max_s < data[n]) max_s = data[n];\n      ++freq[data[n]];\n    }\n  }\n\n  if (num_levels_in <= num_levels) goto End;  // nothing to do!\n\n  // Start with uniformly spread centroids.\n  for (i = 0; i < num_levels; ++i) {\n    inv_q_level[i] = min_s + (double)(max_s - min_s) * i / (num_levels - 1);\n  }\n\n  // Fixed values. Won't be changed.\n  q_level[min_s] = 0;\n  q_level[max_s] = num_levels - 1;\n  assert(inv_q_level[0] == min_s);\n  assert(inv_q_level[num_levels - 1] == max_s);\n\n  // k-Means iterations.\n  for (iter = 0; iter < MAX_ITER; ++iter) {\n    double q_sum[NUM_SYMBOLS] = { 0 };\n    double q_count[NUM_SYMBOLS] = { 0 };\n    int s, slot = 0;\n\n    // Assign classes to representatives.\n    for (s = min_s; s <= max_s; ++s) {\n      // Keep track of the nearest neighbour 'slot'\n      while (slot < num_levels - 1 &&\n             2 * s > inv_q_level[slot] + inv_q_level[slot + 1]) {\n        ++slot;\n      }\n      if (freq[s] > 0) {\n        q_sum[slot] += s * freq[s];\n        q_count[slot] += freq[s];\n      }\n      q_level[s] = slot;\n    }\n\n    // Assign new representatives to classes.\n    if (num_levels > 2) {\n      for (slot = 1; slot < num_levels - 1; ++slot) {\n        const double count = q_count[slot];\n        if (count > 0.) {\n          inv_q_level[slot] = q_sum[slot] / count;\n        }\n      }\n    }\n\n    // Compute convergence error.\n    err = 0.;\n    for (s = min_s; s <= max_s; ++s) {\n      const double error = s - inv_q_level[q_level[s]];\n      err += freq[s] * error * error;\n    }\n\n    // Check for convergence: we stop as soon as the error is no\n    // longer improving.\n    if (last_err - err < err_threshold) break;\n    last_err = err;\n  }\n\n  // Remap the alpha plane to quantized values.\n  {\n    // double->int rounding operation can be costly, so we do it\n    // once for all before remapping. We also perform the data[] -> slot\n    // mapping, while at it (avoid one indirection in the final loop).\n    uint8_t map[NUM_SYMBOLS];\n    int s;\n    size_t n;\n    for (s = min_s; s <= max_s; ++s) {\n      const int slot = q_level[s];\n      map[s] = (uint8_t)(inv_q_level[slot] + .5);\n    }\n    // Final pass.\n    for (n = 0; n < data_size; ++n) {\n      data[n] = map[data[n]];\n    }\n  }\n End:\n  // Store sum of squared error if needed.\n  if (sse != NULL) *sse = (uint64_t)err;\n\n  return 1;\n}\n\n"
  },
  {
    "path": "ext/libwebp/utils/quant_levels.h",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Alpha plane quantization utility\n//\n// Author:  Vikas Arora (vikasa@google.com)\n\n#ifndef WEBP_UTILS_QUANT_LEVELS_H_\n#define WEBP_UTILS_QUANT_LEVELS_H_\n\n#include <stdlib.h>\n\n#include \"../webp/types.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n// Replace the input 'data' of size 'width'x'height' with 'num-levels'\n// quantized values. If not NULL, 'sse' will contain the sum of squared error.\n// Valid range for 'num_levels' is [2, 256].\n// Returns false in case of error (data is NULL, or parameters are invalid).\nint QuantizeLevels(uint8_t* const data, int width, int height, int num_levels,\n                   uint64_t* const sse);\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_UTILS_QUANT_LEVELS_H_ */\n"
  },
  {
    "path": "ext/libwebp/utils/quant_levels_dec.c",
    "content": "// Copyright 2013 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Implement gradient smoothing: we replace a current alpha value by its\n// surrounding average if it's close enough (that is: the change will be less\n// than the minimum distance between two quantized level).\n// We use sliding window for computing the 2d moving average.\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include \"./quant_levels_dec.h\"\n\n#include <string.h>   // for memset\n\n#include \"./utils.h\"\n\n// #define USE_DITHERING   // uncomment to enable ordered dithering (not vital)\n\n#define FIX 16     // fix-point precision for averaging\n#define LFIX 2     // extra precision for look-up table\n#define LUT_SIZE ((1 << (8 + LFIX)) - 1)  // look-up table size\n\n#if defined(USE_DITHERING)\n\n#define DFIX 4           // extra precision for ordered dithering\n#define DSIZE 4          // dithering size (must be a power of two)\n// cf. http://en.wikipedia.org/wiki/Ordered_dithering\nstatic const uint8_t kOrderedDither[DSIZE][DSIZE] = {\n  {  0,  8,  2, 10 },     // coefficients are in DFIX fixed-point precision\n  { 12,  4, 14,  6 },\n  {  3, 11,  1,  9 },\n  { 15,  7, 13,  5 }\n};\n\n#else\n#define DFIX 0\n#endif\n\ntypedef struct {\n  int width_, height_;  // dimension\n  int row_;             // current input row being processed\n  uint8_t* src_;        // input pointer\n  uint8_t* dst_;        // output pointer\n\n  int radius_;          // filter radius (=delay)\n  int scale_;           // normalization factor, in FIX bits precision\n\n  void* mem_;           // all memory\n\n  // various scratch buffers\n  uint16_t* start_;\n  uint16_t* cur_;\n  uint16_t* end_;\n  uint16_t* top_;\n  uint16_t* average_;\n\n  // input levels distribution\n  int num_levels_;       // number of quantized levels\n  int min_, max_;        // min and max level values\n  int min_level_dist_;   // smallest distance between two consecutive levels\n\n  int16_t* correction_;  // size = 1 + 2*LUT_SIZE  -> ~4k memory\n} SmoothParams;\n\n//------------------------------------------------------------------------------\n\n#define CLIP_MASK (int)(~0U << (8 + DFIX))\nstatic WEBP_INLINE uint8_t clip_8b(int v) {\n  return (!(v & CLIP_MASK)) ? (uint8_t)(v >> DFIX) : (v < 0) ? 0u : 255u;\n}\n\n// vertical accumulation\nstatic void VFilter(SmoothParams* const p) {\n  const uint8_t* src = p->src_;\n  const int w = p->width_;\n  uint16_t* const cur = p->cur_;\n  const uint16_t* const top = p->top_;\n  uint16_t* const out = p->end_;\n  uint16_t sum = 0;               // all arithmetic is modulo 16bit\n  int x;\n\n  for (x = 0; x < w; ++x) {\n    uint16_t new_value;\n    sum += src[x];\n    new_value = top[x] + sum;\n    out[x] = new_value - cur[x];  // vertical sum of 'r' pixels.\n    cur[x] = new_value;\n  }\n  // move input pointers one row down\n  p->top_ = p->cur_;\n  p->cur_ += w;\n  if (p->cur_ == p->end_) p->cur_ = p->start_;  // roll-over\n  // We replicate edges, as it's somewhat easier as a boundary condition.\n  // That's why we don't update the 'src' pointer on top/bottom area:\n  if (p->row_ >= 0 && p->row_ < p->height_ - 1) {\n    p->src_ += p->width_;\n  }\n}\n\n// horizontal accumulation. We use mirror replication of missing pixels, as it's\n// a little easier to implement (surprisingly).\nstatic void HFilter(SmoothParams* const p) {\n  const uint16_t* const in = p->end_;\n  uint16_t* const out = p->average_;\n  const uint32_t scale = p->scale_;\n  const int w = p->width_;\n  const int r = p->radius_;\n\n  int x;\n  for (x = 0; x <= r; ++x) {   // left mirroring\n    const uint16_t delta = in[x + r - 1] + in[r - x];\n    out[x] = (delta * scale) >> FIX;\n  }\n  for (; x < w - r; ++x) {     // bulk middle run\n    const uint16_t delta = in[x + r] - in[x - r - 1];\n    out[x] = (delta * scale) >> FIX;\n  }\n  for (; x < w; ++x) {         // right mirroring\n    const uint16_t delta =\n        2 * in[w - 1] - in[2 * w - 2 - r - x] - in[x - r - 1];\n    out[x] = (delta * scale) >> FIX;\n  }\n}\n\n// emit one filtered output row\nstatic void ApplyFilter(SmoothParams* const p) {\n  const uint16_t* const average = p->average_;\n  const int w = p->width_;\n  const int16_t* const correction = p->correction_;\n#if defined(USE_DITHERING)\n  const uint8_t* const dither = kOrderedDither[p->row_ % DSIZE];\n#endif\n  uint8_t* const dst = p->dst_;\n  int x;\n  for (x = 0; x < w; ++x) {\n    const int v = dst[x];\n    if (v < p->max_ && v > p->min_) {\n      const int c = (v << DFIX) + correction[average[x] - (v << LFIX)];\n#if defined(USE_DITHERING)\n      dst[x] = clip_8b(c + dither[x % DSIZE]);\n#else\n      dst[x] = clip_8b(c);\n#endif\n    }\n  }\n  p->dst_ += w;  // advance output pointer\n}\n\n//------------------------------------------------------------------------------\n// Initialize correction table\n\nstatic void InitCorrectionLUT(int16_t* const lut, int min_dist) {\n  // The correction curve is:\n  //   f(x) = x for x <= threshold2\n  //   f(x) = 0 for x >= threshold1\n  // and a linear interpolation for range x=[threshold2, threshold1]\n  // (along with f(-x) = -f(x) symmetry).\n  // Note that: threshold2 = 3/4 * threshold1\n  const int threshold1 = min_dist << LFIX;\n  const int threshold2 = (3 * threshold1) >> 2;\n  const int max_threshold = threshold2 << DFIX;\n  const int delta = threshold1 - threshold2;\n  int i;\n  for (i = 1; i <= LUT_SIZE; ++i) {\n    int c = (i <= threshold2) ? (i << DFIX)\n          : (i < threshold1) ? max_threshold * (threshold1 - i) / delta\n          : 0;\n    c >>= LFIX;\n    lut[+i] = +c;\n    lut[-i] = -c;\n  }\n  lut[0] = 0;\n}\n\nstatic void CountLevels(const uint8_t* const data, int size,\n                        SmoothParams* const p) {\n  int i, last_level;\n  uint8_t used_levels[256] = { 0 };\n  p->min_ = 255;\n  p->max_ = 0;\n  for (i = 0; i < size; ++i) {\n    const int v = data[i];\n    if (v < p->min_) p->min_ = v;\n    if (v > p->max_) p->max_ = v;\n    used_levels[v] = 1;\n  }\n  // Compute the mininum distance between two non-zero levels.\n  p->min_level_dist_ = p->max_ - p->min_;\n  last_level = -1;\n  for (i = 0; i < 256; ++i) {\n    if (used_levels[i]) {\n      ++p->num_levels_;\n      if (last_level >= 0) {\n        const int level_dist = i - last_level;\n        if (level_dist < p->min_level_dist_) {\n          p->min_level_dist_ = level_dist;\n        }\n      }\n      last_level = i;\n    }\n  }\n}\n\n// Initialize all params.\nstatic int InitParams(uint8_t* const data, int width, int height,\n                      int radius, SmoothParams* const p) {\n  const int R = 2 * radius + 1;  // total size of the kernel\n\n  const size_t size_scratch_m = (R + 1) * width * sizeof(*p->start_);\n  const size_t size_m =  width * sizeof(*p->average_);\n  const size_t size_lut = (1 + 2 * LUT_SIZE) * sizeof(*p->correction_);\n  const size_t total_size = size_scratch_m + size_m + size_lut;\n  uint8_t* mem = (uint8_t*)WebPSafeMalloc(1U, total_size);\n\n  if (mem == NULL) return 0;\n  p->mem_ = (void*)mem;\n\n  p->start_ = (uint16_t*)mem;\n  p->cur_ = p->start_;\n  p->end_ = p->start_ + R * width;\n  p->top_ = p->end_ - width;\n  memset(p->top_, 0, width * sizeof(*p->top_));\n  mem += size_scratch_m;\n\n  p->average_ = (uint16_t*)mem;\n  mem += size_m;\n\n  p->width_ = width;\n  p->height_ = height;\n  p->src_ = data;\n  p->dst_ = data;\n  p->radius_ = radius;\n  p->scale_ = (1 << (FIX + LFIX)) / (R * R);  // normalization constant\n  p->row_ = -radius;\n\n  // analyze the input distribution so we can best-fit the threshold\n  CountLevels(data, width * height, p);\n\n  // correction table\n  p->correction_ = ((int16_t*)mem) + LUT_SIZE;\n  InitCorrectionLUT(p->correction_, p->min_level_dist_);\n\n  return 1;\n}\n\nstatic void CleanupParams(SmoothParams* const p) {\n  WebPSafeFree(p->mem_);\n}\n\nint WebPDequantizeLevels(uint8_t* const data, int width, int height,\n                         int strength) {\n  const int radius = 4 * strength / 100;\n  if (strength < 0 || strength > 100) return 0;\n  if (data == NULL || width <= 0 || height <= 0) return 0;  // bad params\n  if (radius > 0) {\n    SmoothParams p;\n    memset(&p, 0, sizeof(p));\n    if (!InitParams(data, width, height, radius, &p)) return 0;\n    if (p.num_levels_ > 2) {\n      for (; p.row_ < p.height_; ++p.row_) {\n        VFilter(&p);  // accumulate average of input\n        // Need to wait few rows in order to prime the filter,\n        // before emitting some output.\n        if (p.row_ >= p.radius_) {\n          HFilter(&p);\n          ApplyFilter(&p);\n        }\n      }\n    }\n    CleanupParams(&p);\n  }\n  return 1;\n}\n"
  },
  {
    "path": "ext/libwebp/utils/quant_levels_dec.h",
    "content": "// Copyright 2013 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Alpha plane de-quantization utility\n//\n// Author:  Vikas Arora (vikasa@google.com)\n\n#ifndef WEBP_UTILS_QUANT_LEVELS_DEC_H_\n#define WEBP_UTILS_QUANT_LEVELS_DEC_H_\n\n#include \"../webp/types.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n// Apply post-processing to input 'data' of size 'width'x'height' assuming that\n// the source was quantized to a reduced number of levels.\n// Strength is in [0..100] and controls the amount of dithering applied.\n// Returns false in case of error (data is NULL, invalid parameters,\n// malloc failure, ...).\nint WebPDequantizeLevels(uint8_t* const data, int width, int height,\n                         int strength);\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_UTILS_QUANT_LEVELS_DEC_H_ */\n"
  },
  {
    "path": "ext/libwebp/utils/random.c",
    "content": "// Copyright 2013 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Pseudo-random utilities\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include <string.h>\n#include \"./random.h\"\n\n//------------------------------------------------------------------------------\n\n// 31b-range values\nstatic const uint32_t kRandomTable[VP8_RANDOM_TABLE_SIZE] = {\n  0x0de15230, 0x03b31886, 0x775faccb, 0x1c88626a, 0x68385c55, 0x14b3b828,\n  0x4a85fef8, 0x49ddb84b, 0x64fcf397, 0x5c550289, 0x4a290000, 0x0d7ec1da,\n  0x5940b7ab, 0x5492577d, 0x4e19ca72, 0x38d38c69, 0x0c01ee65, 0x32a1755f,\n  0x5437f652, 0x5abb2c32, 0x0faa57b1, 0x73f533e7, 0x685feeda, 0x7563cce2,\n  0x6e990e83, 0x4730a7ed, 0x4fc0d9c6, 0x496b153c, 0x4f1403fa, 0x541afb0c,\n  0x73990b32, 0x26d7cb1c, 0x6fcc3706, 0x2cbb77d8, 0x75762f2a, 0x6425ccdd,\n  0x24b35461, 0x0a7d8715, 0x220414a8, 0x141ebf67, 0x56b41583, 0x73e502e3,\n  0x44cab16f, 0x28264d42, 0x73baaefb, 0x0a50ebed, 0x1d6ab6fb, 0x0d3ad40b,\n  0x35db3b68, 0x2b081e83, 0x77ce6b95, 0x5181e5f0, 0x78853bbc, 0x009f9494,\n  0x27e5ed3c\n};\n\nvoid VP8InitRandom(VP8Random* const rg, float dithering) {\n  memcpy(rg->tab_, kRandomTable, sizeof(rg->tab_));\n  rg->index1_ = 0;\n  rg->index2_ = 31;\n  rg->amp_ = (dithering < 0.0) ? 0\n           : (dithering > 1.0) ? (1 << VP8_RANDOM_DITHER_FIX)\n           : (uint32_t)((1 << VP8_RANDOM_DITHER_FIX) * dithering);\n}\n\n//------------------------------------------------------------------------------\n\n"
  },
  {
    "path": "ext/libwebp/utils/random.h",
    "content": "// Copyright 2013 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Pseudo-random utilities\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_UTILS_RANDOM_H_\n#define WEBP_UTILS_RANDOM_H_\n\n#include <assert.h>\n#include \"../webp/types.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#define VP8_RANDOM_DITHER_FIX 8   // fixed-point precision for dithering\n#define VP8_RANDOM_TABLE_SIZE 55\n\ntypedef struct {\n  int index1_, index2_;\n  uint32_t tab_[VP8_RANDOM_TABLE_SIZE];\n  int amp_;\n} VP8Random;\n\n// Initializes random generator with an amplitude 'dithering' in range [0..1].\nvoid VP8InitRandom(VP8Random* const rg, float dithering);\n\n// Returns a centered pseudo-random number with 'num_bits' amplitude.\n// (uses D.Knuth's Difference-based random generator).\n// 'amp' is in VP8_RANDOM_DITHER_FIX fixed-point precision.\nstatic WEBP_INLINE int VP8RandomBits2(VP8Random* const rg, int num_bits,\n                                      int amp) {\n  int diff;\n  assert(num_bits + VP8_RANDOM_DITHER_FIX <= 31);\n  diff = rg->tab_[rg->index1_] - rg->tab_[rg->index2_];\n  if (diff < 0) diff += (1u << 31);\n  rg->tab_[rg->index1_] = diff;\n  if (++rg->index1_ == VP8_RANDOM_TABLE_SIZE) rg->index1_ = 0;\n  if (++rg->index2_ == VP8_RANDOM_TABLE_SIZE) rg->index2_ = 0;\n  // sign-extend, 0-center\n  diff = (int)((uint32_t)diff << 1) >> (32 - num_bits);\n  diff = (diff * amp) >> VP8_RANDOM_DITHER_FIX;  // restrict range\n  diff += 1 << (num_bits - 1);                   // shift back to 0.5-center\n  return diff;\n}\n\nstatic WEBP_INLINE int VP8RandomBits(VP8Random* const rg, int num_bits) {\n  return VP8RandomBits2(rg, num_bits, rg->amp_);\n}\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_UTILS_RANDOM_H_ */\n"
  },
  {
    "path": "ext/libwebp/utils/rescaler.c",
    "content": "// Copyright 2012 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Rescaling functions\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include <assert.h>\n#include <stdlib.h>\n#include \"./rescaler.h\"\n#include \"../dsp/dsp.h\"\n\n//------------------------------------------------------------------------------\n// Implementations of critical functions ImportRow / ExportRow\n\nvoid (*WebPRescalerImportRow)(WebPRescaler* const wrk,\n                              const uint8_t* const src, int channel) = NULL;\nvoid (*WebPRescalerExportRow)(WebPRescaler* const wrk, int x_out) = NULL;\n\n#define RFIX 30\n#define MULT_FIX(x, y) (((int64_t)(x) * (y) + (1 << (RFIX - 1))) >> RFIX)\n\nstatic void ImportRowC(WebPRescaler* const wrk,\n                       const uint8_t* const src, int channel) {\n  const int x_stride = wrk->num_channels;\n  const int x_out_max = wrk->dst_width * wrk->num_channels;\n  int x_in = channel;\n  int x_out;\n  int accum = 0;\n  if (!wrk->x_expand) {\n    int sum = 0;\n    for (x_out = channel; x_out < x_out_max; x_out += x_stride) {\n      accum += wrk->x_add;\n      for (; accum > 0; accum -= wrk->x_sub) {\n        sum += src[x_in];\n        x_in += x_stride;\n      }\n      {        // Emit next horizontal pixel.\n        const int32_t base = src[x_in];\n        const int32_t frac = base * (-accum);\n        x_in += x_stride;\n        wrk->frow[x_out] = (sum + base) * wrk->x_sub - frac;\n        // fresh fractional start for next pixel\n        sum = (int)MULT_FIX(frac, wrk->fx_scale);\n      }\n    }\n  } else {        // simple bilinear interpolation\n    int left = src[channel], right = src[channel];\n    for (x_out = channel; x_out < x_out_max; x_out += x_stride) {\n      if (accum < 0) {\n        left = right;\n        x_in += x_stride;\n        right = src[x_in];\n        accum += wrk->x_add;\n      }\n      wrk->frow[x_out] = right * wrk->x_add + (left - right) * accum;\n      accum -= wrk->x_sub;\n    }\n  }\n  // Accumulate the contribution of the new row.\n  for (x_out = channel; x_out < x_out_max; x_out += x_stride) {\n    wrk->irow[x_out] += wrk->frow[x_out];\n  }\n}\n\nstatic void ExportRowC(WebPRescaler* const wrk, int x_out) {\n  if (wrk->y_accum <= 0) {\n    uint8_t* const dst = wrk->dst;\n    int32_t* const irow = wrk->irow;\n    const int32_t* const frow = wrk->frow;\n    const int yscale = wrk->fy_scale * (-wrk->y_accum);\n    const int x_out_max = wrk->dst_width * wrk->num_channels;\n    for (; x_out < x_out_max; ++x_out) {\n      const int frac = (int)MULT_FIX(frow[x_out], yscale);\n      const int v = (int)MULT_FIX(irow[x_out] - frac, wrk->fxy_scale);\n      dst[x_out] = (!(v & ~0xff)) ? v : (v < 0) ? 0 : 255;\n      irow[x_out] = frac;   // new fractional start\n    }\n    wrk->y_accum += wrk->y_add;\n    wrk->dst += wrk->dst_stride;\n  }\n}\n\n//------------------------------------------------------------------------------\n// MIPS version\n\n#if defined(WEBP_USE_MIPS32)\n\nstatic void ImportRowMIPS(WebPRescaler* const wrk,\n                          const uint8_t* const src, int channel) {\n  const int x_stride = wrk->num_channels;\n  const int x_out_max = wrk->dst_width * wrk->num_channels;\n  const int fx_scale = wrk->fx_scale;\n  const int x_add = wrk->x_add;\n  const int x_sub = wrk->x_sub;\n  int* frow = wrk->frow + channel;\n  int* irow = wrk->irow + channel;\n  const uint8_t* src1 = src + channel;\n  int temp1, temp2, temp3;\n  int base, frac, sum;\n  int accum, accum1;\n  const int x_stride1 = x_stride << 2;\n  int loop_c = x_out_max - channel;\n\n  if (!wrk->x_expand) {\n    __asm__ volatile (\n      \"li     %[temp1],   0x8000                    \\n\\t\"\n      \"li     %[temp2],   0x10000                   \\n\\t\"\n      \"li     %[sum],     0                         \\n\\t\"\n      \"li     %[accum],   0                         \\n\\t\"\n    \"1:                                             \\n\\t\"\n      \"addu   %[accum],   %[accum],   %[x_add]      \\n\\t\"\n      \"blez   %[accum],   3f                        \\n\\t\"\n    \"2:                                             \\n\\t\"\n      \"lbu    %[temp3],   0(%[src1])                \\n\\t\"\n      \"subu   %[accum],   %[accum],   %[x_sub]      \\n\\t\"\n      \"addu   %[src1],    %[src1],    %[x_stride]   \\n\\t\"\n      \"addu   %[sum],     %[sum],     %[temp3]      \\n\\t\"\n      \"bgtz   %[accum],   2b                        \\n\\t\"\n    \"3:                                             \\n\\t\"\n      \"lbu    %[base],    0(%[src1])                \\n\\t\"\n      \"addu   %[src1],    %[src1],    %[x_stride]   \\n\\t\"\n      \"negu   %[accum1],  %[accum]                  \\n\\t\"\n      \"mul    %[frac],    %[base],    %[accum1]     \\n\\t\"\n      \"addu   %[temp3],   %[sum],     %[base]       \\n\\t\"\n      \"mul    %[temp3],   %[temp3],   %[x_sub]      \\n\\t\"\n      \"lw     %[base],    0(%[irow])                \\n\\t\"\n      \"subu   %[loop_c],  %[loop_c],  %[x_stride]   \\n\\t\"\n      \"sll    %[accum1],  %[frac],    2             \\n\\t\"\n      \"mult   %[temp1],   %[temp2]                  \\n\\t\"\n      \"madd   %[accum1],  %[fx_scale]               \\n\\t\"\n      \"mfhi   %[sum]                                \\n\\t\"\n      \"subu   %[temp3],   %[temp3],   %[frac]       \\n\\t\"\n      \"sw     %[temp3],   0(%[frow])                \\n\\t\"\n      \"add    %[base],    %[base],    %[temp3]      \\n\\t\"\n      \"sw     %[base],    0(%[irow])                \\n\\t\"\n      \"addu   %[irow],    %[irow],    %[x_stride1]  \\n\\t\"\n      \"addu   %[frow],    %[frow],    %[x_stride1]  \\n\\t\"\n      \"bgtz   %[loop_c],  1b                        \\n\\t\"\n\n      : [accum] \"=&r\" (accum), [src1] \"+r\" (src1), [temp3] \"=&r\" (temp3),\n        [sum] \"=&r\" (sum), [base] \"=&r\" (base), [frac] \"=&r\" (frac),\n        [frow] \"+r\" (frow), [irow] \"+r\" (irow), [accum1] \"=&r\" (accum1),\n        [temp2] \"=&r\" (temp2), [temp1] \"=&r\" (temp1)\n      : [x_stride] \"r\" (x_stride), [fx_scale] \"r\" (fx_scale),\n        [x_sub] \"r\" (x_sub), [x_add] \"r\" (x_add),\n        [loop_c] \"r\" (loop_c), [x_stride1] \"r\" (x_stride1)\n      : \"memory\", \"hi\", \"lo\"\n    );\n  } else {\n    __asm__ volatile (\n      \"lbu    %[temp1],   0(%[src1])                \\n\\t\"\n      \"move   %[temp2],   %[temp1]                  \\n\\t\"\n      \"li     %[accum],   0                         \\n\\t\"\n    \"1:                                             \\n\\t\"\n      \"bgez   %[accum],   2f                        \\n\\t\"\n      \"move   %[temp2],   %[temp1]                  \\n\\t\"\n      \"addu   %[src1],    %[x_stride]               \\n\\t\"\n      \"lbu    %[temp1],   0(%[src1])                \\n\\t\"\n      \"addu   %[accum],   %[x_add]                  \\n\\t\"\n    \"2:                                             \\n\\t\"\n      \"subu   %[temp3],   %[temp2],   %[temp1]      \\n\\t\"\n      \"mul    %[temp3],   %[temp3],   %[accum]      \\n\\t\"\n      \"mul    %[base],    %[temp1],   %[x_add]      \\n\\t\"\n      \"subu   %[accum],   %[accum],   %[x_sub]      \\n\\t\"\n      \"lw     %[frac],    0(%[irow])                \\n\\t\"\n      \"subu   %[loop_c],  %[loop_c],  %[x_stride]   \\n\\t\"\n      \"addu   %[temp3],   %[base],    %[temp3]      \\n\\t\"\n      \"sw     %[temp3],   0(%[frow])                \\n\\t\"\n      \"addu   %[frow],    %[x_stride1]              \\n\\t\"\n      \"addu   %[frac],    %[temp3]                  \\n\\t\"\n      \"sw     %[frac],    0(%[irow])                \\n\\t\"\n      \"addu   %[irow],    %[x_stride1]              \\n\\t\"\n      \"bgtz   %[loop_c],  1b                        \\n\\t\"\n\n      : [src1] \"+r\" (src1), [accum] \"=&r\" (accum), [temp1] \"=&r\" (temp1),\n        [temp2] \"=&r\" (temp2), [temp3] \"=&r\" (temp3), [base] \"=&r\" (base),\n        [frac] \"=&r\" (frac), [frow] \"+r\" (frow), [irow] \"+r\" (irow)\n      : [x_stride] \"r\" (x_stride), [x_add] \"r\" (x_add), [x_sub] \"r\" (x_sub),\n        [x_stride1] \"r\" (x_stride1), [loop_c] \"r\" (loop_c)\n      : \"memory\", \"hi\", \"lo\"\n    );\n  }\n}\n\nstatic void ExportRowMIPS(WebPRescaler* const wrk, int x_out) {\n  if (wrk->y_accum <= 0) {\n    uint8_t* const dst = wrk->dst;\n    int32_t* const irow = wrk->irow;\n    const int32_t* const frow = wrk->frow;\n    const int yscale = wrk->fy_scale * (-wrk->y_accum);\n    const int x_out_max = wrk->dst_width * wrk->num_channels;\n    // if wrk->fxy_scale can fit into 32 bits use optimized code,\n    // otherwise use C code\n    if ((wrk->fxy_scale >> 32) == 0) {\n      int temp0, temp1, temp3, temp4, temp5, temp6, temp7, loop_end;\n      const int temp2 = (int)(wrk->fxy_scale);\n      const int temp8 = x_out_max << 2;\n      uint8_t* dst_t = (uint8_t*)dst;\n      int32_t* irow_t = (int32_t*)irow;\n      const int32_t* frow_t = (const int32_t*)frow;\n\n      __asm__ volatile(\n        \"addiu    %[temp6],    $zero,       -256          \\n\\t\"\n        \"addiu    %[temp7],    $zero,       255           \\n\\t\"\n        \"li       %[temp3],    0x10000                    \\n\\t\"\n        \"li       %[temp4],    0x8000                     \\n\\t\"\n        \"addu     %[loop_end], %[frow_t],   %[temp8]      \\n\\t\"\n      \"1:                                                 \\n\\t\"\n        \"lw       %[temp0],    0(%[frow_t])               \\n\\t\"\n        \"mult     %[temp3],    %[temp4]                   \\n\\t\"\n        \"addiu    %[frow_t],   %[frow_t],   4             \\n\\t\"\n        \"sll      %[temp0],    %[temp0],    2             \\n\\t\"\n        \"madd     %[temp0],    %[yscale]                  \\n\\t\"\n        \"mfhi     %[temp1]                                \\n\\t\"\n        \"lw       %[temp0],    0(%[irow_t])               \\n\\t\"\n        \"addiu    %[dst_t],    %[dst_t],    1             \\n\\t\"\n        \"addiu    %[irow_t],   %[irow_t],   4             \\n\\t\"\n        \"subu     %[temp0],    %[temp0],    %[temp1]      \\n\\t\"\n        \"mult     %[temp3],    %[temp4]                   \\n\\t\"\n        \"sll      %[temp0],    %[temp0],    2             \\n\\t\"\n        \"madd     %[temp0],    %[temp2]                   \\n\\t\"\n        \"mfhi     %[temp5]                                \\n\\t\"\n        \"sw       %[temp1],    -4(%[irow_t])              \\n\\t\"\n        \"and      %[temp0],    %[temp5],    %[temp6]      \\n\\t\"\n        \"slti     %[temp1],    %[temp5],    0             \\n\\t\"\n        \"beqz     %[temp0],    2f                         \\n\\t\"\n        \"xor      %[temp5],    %[temp5],    %[temp5]      \\n\\t\"\n        \"movz     %[temp5],    %[temp7],    %[temp1]      \\n\\t\"\n      \"2:                                                 \\n\\t\"\n        \"sb       %[temp5],    -1(%[dst_t])               \\n\\t\"\n        \"bne      %[frow_t],   %[loop_end], 1b            \\n\\t\"\n\n        : [temp0]\"=&r\"(temp0), [temp1]\"=&r\"(temp1), [temp3]\"=&r\"(temp3),\n          [temp4]\"=&r\"(temp4), [temp5]\"=&r\"(temp5), [temp6]\"=&r\"(temp6),\n          [temp7]\"=&r\"(temp7), [frow_t]\"+r\"(frow_t), [irow_t]\"+r\"(irow_t),\n          [dst_t]\"+r\"(dst_t), [loop_end]\"=&r\"(loop_end)\n        : [temp2]\"r\"(temp2), [yscale]\"r\"(yscale), [temp8]\"r\"(temp8)\n        : \"memory\", \"hi\", \"lo\"\n      );\n      wrk->y_accum += wrk->y_add;\n      wrk->dst += wrk->dst_stride;\n    } else {\n      ExportRowC(wrk, x_out);\n    }\n  }\n}\n#endif   // WEBP_USE_MIPS32\n\n//------------------------------------------------------------------------------\n\nvoid WebPRescalerInit(WebPRescaler* const wrk, int src_width, int src_height,\n                      uint8_t* const dst, int dst_width, int dst_height,\n                      int dst_stride, int num_channels, int x_add, int x_sub,\n                      int y_add, int y_sub, int32_t* const work) {\n  wrk->x_expand = (src_width < dst_width);\n  wrk->src_width = src_width;\n  wrk->src_height = src_height;\n  wrk->dst_width = dst_width;\n  wrk->dst_height = dst_height;\n  wrk->dst = dst;\n  wrk->dst_stride = dst_stride;\n  wrk->num_channels = num_channels;\n  // for 'x_expand', we use bilinear interpolation\n  wrk->x_add = wrk->x_expand ? (x_sub - 1) : x_add - x_sub;\n  wrk->x_sub = wrk->x_expand ? (x_add - 1) : x_sub;\n  wrk->y_accum = y_add;\n  wrk->y_add = y_add;\n  wrk->y_sub = y_sub;\n  wrk->fx_scale = (1 << RFIX) / x_sub;\n  wrk->fy_scale = (1 << RFIX) / y_sub;\n  wrk->fxy_scale = wrk->x_expand ?\n      ((int64_t)dst_height << RFIX) / (x_sub * src_height) :\n      ((int64_t)dst_height << RFIX) / (x_add * src_height);\n  wrk->irow = work;\n  wrk->frow = work + num_channels * dst_width;\n\n  if (WebPRescalerImportRow == NULL) {\n    WebPRescalerImportRow = ImportRowC;\n    WebPRescalerExportRow = ExportRowC;\n    if (VP8GetCPUInfo != NULL) {\n#if defined(WEBP_USE_MIPS32)\n      if (VP8GetCPUInfo(kMIPS32)) {\n        WebPRescalerImportRow = ImportRowMIPS;\n        WebPRescalerExportRow = ExportRowMIPS;\n      }\n#endif\n    }\n  }\n}\n\n#undef MULT_FIX\n#undef RFIX\n\n//------------------------------------------------------------------------------\n// all-in-one calls\n\nint WebPRescaleNeededLines(const WebPRescaler* const wrk, int max_num_lines) {\n  const int num_lines = (wrk->y_accum + wrk->y_sub - 1) / wrk->y_sub;\n  return (num_lines > max_num_lines) ? max_num_lines : num_lines;\n}\n\nint WebPRescalerImport(WebPRescaler* const wrk, int num_lines,\n                       const uint8_t* src, int src_stride) {\n  int total_imported = 0;\n  while (total_imported < num_lines && wrk->y_accum > 0) {\n    int channel;\n    for (channel = 0; channel < wrk->num_channels; ++channel) {\n      WebPRescalerImportRow(wrk, src, channel);\n    }\n    src += src_stride;\n    ++total_imported;\n    wrk->y_accum -= wrk->y_sub;\n  }\n  return total_imported;\n}\n\nint WebPRescalerExport(WebPRescaler* const rescaler) {\n  int total_exported = 0;\n  while (WebPRescalerHasPendingOutput(rescaler)) {\n    WebPRescalerExportRow(rescaler, 0);\n    ++total_exported;\n  }\n  return total_exported;\n}\n\n//------------------------------------------------------------------------------\n"
  },
  {
    "path": "ext/libwebp/utils/rescaler.h",
    "content": "// Copyright 2012 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Rescaling functions\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_UTILS_RESCALER_H_\n#define WEBP_UTILS_RESCALER_H_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include \"../webp/types.h\"\n\n// Structure used for on-the-fly rescaling\ntypedef struct {\n  int x_expand;               // true if we're expanding in the x direction\n  int num_channels;           // bytes to jump between pixels\n  int fy_scale, fx_scale;     // fixed-point scaling factor\n  int64_t fxy_scale;          // ''\n  // we need hpel-precise add/sub increments, for the downsampled U/V planes.\n  int y_accum;                // vertical accumulator\n  int y_add, y_sub;           // vertical increments (add ~= src, sub ~= dst)\n  int x_add, x_sub;           // horizontal increments (add ~= src, sub ~= dst)\n  int src_width, src_height;  // source dimensions\n  int dst_width, dst_height;  // destination dimensions\n  uint8_t* dst;\n  int dst_stride;\n  int32_t* irow, *frow;       // work buffer\n} WebPRescaler;\n\n// Initialize a rescaler given scratch area 'work' and dimensions of src & dst.\nvoid WebPRescalerInit(WebPRescaler* const rescaler,\n                      int src_width, int src_height,\n                      uint8_t* const dst,\n                      int dst_width, int dst_height, int dst_stride,\n                      int num_channels,\n                      int x_add, int x_sub,\n                      int y_add, int y_sub,\n                      int32_t* const work);\n\n// Returns the number of input lines needed next to produce one output line,\n// considering that the maximum available input lines are 'max_num_lines'.\nint WebPRescaleNeededLines(const WebPRescaler* const rescaler,\n                           int max_num_lines);\n\n// Import multiple rows over all channels, until at least one row is ready to\n// be exported. Returns the actual number of lines that were imported.\nint WebPRescalerImport(WebPRescaler* const rescaler, int num_rows,\n                       const uint8_t* src, int src_stride);\n\n// Import a row of data and save its contribution in the rescaler.\n// 'channel' denotes the channel number to be imported.\nextern void (*WebPRescalerImportRow)(WebPRescaler* const wrk,\n                                     const uint8_t* const src, int channel);\n// Export one row (starting at x_out position) from rescaler.\nextern void (*WebPRescalerExportRow)(WebPRescaler* const wrk, int x_out);\n\n// Return true if there is pending output rows ready.\nstatic WEBP_INLINE\nint WebPRescalerHasPendingOutput(const WebPRescaler* const rescaler) {\n  return (rescaler->y_accum <= 0);\n}\n\n// Export as many rows as possible. Return the numbers of rows written.\nint WebPRescalerExport(WebPRescaler* const rescaler);\n\n//------------------------------------------------------------------------------\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_UTILS_RESCALER_H_ */\n"
  },
  {
    "path": "ext/libwebp/utils/thread.c",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Multi-threaded worker\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include <assert.h>\n#include <string.h>   // for memset()\n#include \"./thread.h\"\n#include \"./utils.h\"\n\n#ifdef WEBP_USE_THREAD\n\n#if defined(_WIN32)\n\n#include <windows.h>\ntypedef HANDLE pthread_t;\ntypedef CRITICAL_SECTION pthread_mutex_t;\ntypedef struct {\n  HANDLE waiting_sem_;\n  HANDLE received_sem_;\n  HANDLE signal_event_;\n} pthread_cond_t;\n\n#else  // !_WIN32\n\n#include <pthread.h>\n\n#endif  // _WIN32\n\nstruct WebPWorkerImpl {\n  pthread_mutex_t mutex_;\n  pthread_cond_t  condition_;\n  pthread_t       thread_;\n};\n\n#if defined(_WIN32)\n\n//------------------------------------------------------------------------------\n// simplistic pthread emulation layer\n\n#include <process.h>\n\n// _beginthreadex requires __stdcall\n#define THREADFN unsigned int __stdcall\n#define THREAD_RETURN(val) (unsigned int)((DWORD_PTR)val)\n\nstatic int pthread_create(pthread_t* const thread, const void* attr,\n                          unsigned int (__stdcall *start)(void*), void* arg) {\n  (void)attr;\n  *thread = (pthread_t)_beginthreadex(NULL,   /* void *security */\n                                      0,      /* unsigned stack_size */\n                                      start,\n                                      arg,\n                                      0,      /* unsigned initflag */\n                                      NULL);  /* unsigned *thrdaddr */\n  if (*thread == NULL) return 1;\n  SetThreadPriority(*thread, THREAD_PRIORITY_ABOVE_NORMAL);\n  return 0;\n}\n\nstatic int pthread_join(pthread_t thread, void** value_ptr) {\n  (void)value_ptr;\n  return (WaitForSingleObject(thread, INFINITE) != WAIT_OBJECT_0 ||\n          CloseHandle(thread) == 0);\n}\n\n// Mutex\nstatic int pthread_mutex_init(pthread_mutex_t* const mutex, void* mutexattr) {\n  (void)mutexattr;\n  InitializeCriticalSection(mutex);\n  return 0;\n}\n\nstatic int pthread_mutex_lock(pthread_mutex_t* const mutex) {\n  EnterCriticalSection(mutex);\n  return 0;\n}\n\nstatic int pthread_mutex_unlock(pthread_mutex_t* const mutex) {\n  LeaveCriticalSection(mutex);\n  return 0;\n}\n\nstatic int pthread_mutex_destroy(pthread_mutex_t* const mutex) {\n  DeleteCriticalSection(mutex);\n  return 0;\n}\n\n// Condition\nstatic int pthread_cond_destroy(pthread_cond_t* const condition) {\n  int ok = 1;\n  ok &= (CloseHandle(condition->waiting_sem_) != 0);\n  ok &= (CloseHandle(condition->received_sem_) != 0);\n  ok &= (CloseHandle(condition->signal_event_) != 0);\n  return !ok;\n}\n\nstatic int pthread_cond_init(pthread_cond_t* const condition, void* cond_attr) {\n  (void)cond_attr;\n  condition->waiting_sem_ = CreateSemaphore(NULL, 0, 1, NULL);\n  condition->received_sem_ = CreateSemaphore(NULL, 0, 1, NULL);\n  condition->signal_event_ = CreateEvent(NULL, FALSE, FALSE, NULL);\n  if (condition->waiting_sem_ == NULL ||\n      condition->received_sem_ == NULL ||\n      condition->signal_event_ == NULL) {\n    pthread_cond_destroy(condition);\n    return 1;\n  }\n  return 0;\n}\n\nstatic int pthread_cond_signal(pthread_cond_t* const condition) {\n  int ok = 1;\n  if (WaitForSingleObject(condition->waiting_sem_, 0) == WAIT_OBJECT_0) {\n    // a thread is waiting in pthread_cond_wait: allow it to be notified\n    ok = SetEvent(condition->signal_event_);\n    // wait until the event is consumed so the signaler cannot consume\n    // the event via its own pthread_cond_wait.\n    ok &= (WaitForSingleObject(condition->received_sem_, INFINITE) !=\n           WAIT_OBJECT_0);\n  }\n  return !ok;\n}\n\nstatic int pthread_cond_wait(pthread_cond_t* const condition,\n                             pthread_mutex_t* const mutex) {\n  int ok;\n  // note that there is a consumer available so the signal isn't dropped in\n  // pthread_cond_signal\n  if (!ReleaseSemaphore(condition->waiting_sem_, 1, NULL))\n    return 1;\n  // now unlock the mutex so pthread_cond_signal may be issued\n  pthread_mutex_unlock(mutex);\n  ok = (WaitForSingleObject(condition->signal_event_, INFINITE) ==\n        WAIT_OBJECT_0);\n  ok &= ReleaseSemaphore(condition->received_sem_, 1, NULL);\n  pthread_mutex_lock(mutex);\n  return !ok;\n}\n\n#else  // !_WIN32\n# define THREADFN void*\n# define THREAD_RETURN(val) val\n#endif  // _WIN32\n\n//------------------------------------------------------------------------------\n\nstatic void Execute(WebPWorker* const worker);  // Forward declaration.\n\nstatic THREADFN ThreadLoop(void* ptr) {\n  WebPWorker* const worker = (WebPWorker*)ptr;\n  int done = 0;\n  while (!done) {\n    pthread_mutex_lock(&worker->impl_->mutex_);\n    while (worker->status_ == OK) {   // wait in idling mode\n      pthread_cond_wait(&worker->impl_->condition_, &worker->impl_->mutex_);\n    }\n    if (worker->status_ == WORK) {\n      Execute(worker);\n      worker->status_ = OK;\n    } else if (worker->status_ == NOT_OK) {   // finish the worker\n      done = 1;\n    }\n    // signal to the main thread that we're done (for Sync())\n    pthread_cond_signal(&worker->impl_->condition_);\n    pthread_mutex_unlock(&worker->impl_->mutex_);\n  }\n  return THREAD_RETURN(NULL);    // Thread is finished\n}\n\n// main thread state control\nstatic void ChangeState(WebPWorker* const worker,\n                        WebPWorkerStatus new_status) {\n  // No-op when attempting to change state on a thread that didn't come up.\n  // Checking status_ without acquiring the lock first would result in a data\n  // race.\n  if (worker->impl_ == NULL) return;\n\n  pthread_mutex_lock(&worker->impl_->mutex_);\n  if (worker->status_ >= OK) {\n    // wait for the worker to finish\n    while (worker->status_ != OK) {\n      pthread_cond_wait(&worker->impl_->condition_, &worker->impl_->mutex_);\n    }\n    // assign new status and release the working thread if needed\n    if (new_status != OK) {\n      worker->status_ = new_status;\n      pthread_cond_signal(&worker->impl_->condition_);\n    }\n  }\n  pthread_mutex_unlock(&worker->impl_->mutex_);\n}\n\n#endif  // WEBP_USE_THREAD\n\n//------------------------------------------------------------------------------\n\nstatic void Init(WebPWorker* const worker) {\n  memset(worker, 0, sizeof(*worker));\n  worker->status_ = NOT_OK;\n}\n\nstatic int Sync(WebPWorker* const worker) {\n#ifdef WEBP_USE_THREAD\n  ChangeState(worker, OK);\n#endif\n  assert(worker->status_ <= OK);\n  return !worker->had_error;\n}\n\nstatic int Reset(WebPWorker* const worker) {\n  int ok = 1;\n  worker->had_error = 0;\n  if (worker->status_ < OK) {\n#ifdef WEBP_USE_THREAD\n    worker->impl_ = (WebPWorkerImpl*)WebPSafeCalloc(1, sizeof(*worker->impl_));\n    if (worker->impl_ == NULL) {\n      return 0;\n    }\n    if (pthread_mutex_init(&worker->impl_->mutex_, NULL)) {\n      goto Error;\n    }\n    if (pthread_cond_init(&worker->impl_->condition_, NULL)) {\n      pthread_mutex_destroy(&worker->impl_->mutex_);\n      goto Error;\n    }\n    pthread_mutex_lock(&worker->impl_->mutex_);\n    ok = !pthread_create(&worker->impl_->thread_, NULL, ThreadLoop, worker);\n    if (ok) worker->status_ = OK;\n    pthread_mutex_unlock(&worker->impl_->mutex_);\n    if (!ok) {\n      pthread_mutex_destroy(&worker->impl_->mutex_);\n      pthread_cond_destroy(&worker->impl_->condition_);\n Error:\n      WebPSafeFree(worker->impl_);\n      worker->impl_ = NULL;\n      return 0;\n    }\n#else\n    worker->status_ = OK;\n#endif\n  } else if (worker->status_ > OK) {\n    ok = Sync(worker);\n  }\n  assert(!ok || (worker->status_ == OK));\n  return ok;\n}\n\nstatic void Execute(WebPWorker* const worker) {\n  if (worker->hook != NULL) {\n    worker->had_error |= !worker->hook(worker->data1, worker->data2);\n  }\n}\n\nstatic void Launch(WebPWorker* const worker) {\n#ifdef WEBP_USE_THREAD\n  ChangeState(worker, WORK);\n#else\n  Execute(worker);\n#endif\n}\n\nstatic void End(WebPWorker* const worker) {\n#ifdef WEBP_USE_THREAD\n  if (worker->impl_ != NULL) {\n    ChangeState(worker, NOT_OK);\n    pthread_join(worker->impl_->thread_, NULL);\n    pthread_mutex_destroy(&worker->impl_->mutex_);\n    pthread_cond_destroy(&worker->impl_->condition_);\n    WebPSafeFree(worker->impl_);\n    worker->impl_ = NULL;\n  }\n#else\n  worker->status_ = NOT_OK;\n  assert(worker->impl_ == NULL);\n#endif\n  assert(worker->status_ == NOT_OK);\n}\n\n//------------------------------------------------------------------------------\n\nstatic WebPWorkerInterface g_worker_interface = {\n  Init, Reset, Sync, Launch, Execute, End\n};\n\nint WebPSetWorkerInterface(const WebPWorkerInterface* const winterface) {\n  if (winterface == NULL ||\n      winterface->Init == NULL || winterface->Reset == NULL ||\n      winterface->Sync == NULL || winterface->Launch == NULL ||\n      winterface->Execute == NULL || winterface->End == NULL) {\n    return 0;\n  }\n  g_worker_interface = *winterface;\n  return 1;\n}\n\nconst WebPWorkerInterface* WebPGetWorkerInterface(void) {\n  return &g_worker_interface;\n}\n\n//------------------------------------------------------------------------------\n"
  },
  {
    "path": "ext/libwebp/utils/thread.h",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Multi-threaded worker\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_UTILS_THREAD_H_\n#define WEBP_UTILS_THREAD_H_\n\n#ifdef HAVE_CONFIG_H\n#include \"../webp/config.h\"\n#endif\n\n#include \"../webp/types.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n// State of the worker thread object\ntypedef enum {\n  NOT_OK = 0,   // object is unusable\n  OK,           // ready to work\n  WORK          // busy finishing the current task\n} WebPWorkerStatus;\n\n// Function to be called by the worker thread. Takes two opaque pointers as\n// arguments (data1 and data2), and should return false in case of error.\ntypedef int (*WebPWorkerHook)(void*, void*);\n\n// Platform-dependent implementation details for the worker.\ntypedef struct WebPWorkerImpl WebPWorkerImpl;\n\n// Synchronization object used to launch job in the worker thread\ntypedef struct {\n  WebPWorkerImpl* impl_;\n  WebPWorkerStatus status_;\n  WebPWorkerHook hook;    // hook to call\n  void* data1;            // first argument passed to 'hook'\n  void* data2;            // second argument passed to 'hook'\n  int had_error;          // return value of the last call to 'hook'\n} WebPWorker;\n\n// The interface for all thread-worker related functions. All these functions\n// must be implemented.\ntypedef struct {\n  // Must be called first, before any other method.\n  void (*Init)(WebPWorker* const worker);\n  // Must be called to initialize the object and spawn the thread. Re-entrant.\n  // Will potentially launch the thread. Returns false in case of error.\n  int (*Reset)(WebPWorker* const worker);\n  // Makes sure the previous work is finished. Returns true if worker->had_error\n  // was not set and no error condition was triggered by the working thread.\n  int (*Sync)(WebPWorker* const worker);\n  // Triggers the thread to call hook() with data1 and data2 arguments. These\n  // hook/data1/data2 values can be changed at any time before calling this\n  // function, but not be changed afterward until the next call to Sync().\n  void (*Launch)(WebPWorker* const worker);\n  // This function is similar to Launch() except that it calls the\n  // hook directly instead of using a thread. Convenient to bypass the thread\n  // mechanism while still using the WebPWorker structs. Sync() must\n  // still be called afterward (for error reporting).\n  void (*Execute)(WebPWorker* const worker);\n  // Kill the thread and terminate the object. To use the object again, one\n  // must call Reset() again.\n  void (*End)(WebPWorker* const worker);\n} WebPWorkerInterface;\n\n// Install a new set of threading functions, overriding the defaults. This\n// should be done before any workers are started, i.e., before any encoding or\n// decoding takes place. The contents of the interface struct are copied, it\n// is safe to free the corresponding memory after this call. This function is\n// not thread-safe. Return false in case of invalid pointer or methods.\nWEBP_EXTERN(int) WebPSetWorkerInterface(\n    const WebPWorkerInterface* const interface);\n\n// Retrieve the currently set thread worker interface.\nWEBP_EXTERN(const WebPWorkerInterface*) WebPGetWorkerInterface(void);\n\n//------------------------------------------------------------------------------\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_UTILS_THREAD_H_ */\n"
  },
  {
    "path": "ext/libwebp/utils/utils.c",
    "content": "// Copyright 2012 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Misc. common utility functions\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#include <stdlib.h>\n#include \"./utils.h\"\n\n// If PRINT_MEM_INFO is defined, extra info (like total memory used, number of\n// alloc/free etc) is printed. For debugging/tuning purpose only (it's slow,\n// and not multi-thread safe!).\n// An interesting alternative is valgrind's 'massif' tool:\n//    http://valgrind.org/docs/manual/ms-manual.html\n// Here is an example command line:\n/*    valgrind --tool=massif --massif-out-file=massif.out \\\n               --stacks=yes --alloc-fn=WebPSafeAlloc --alloc-fn=WebPSafeCalloc\n      ms_print massif.out\n*/\n// In addition:\n// * if PRINT_MEM_TRAFFIC is defined, all the details of the malloc/free cycles\n//   are printed.\n// * if MALLOC_FAIL_AT is defined, the global environment variable\n//   $MALLOC_FAIL_AT is used to simulate a memory error when calloc or malloc\n//   is called for the nth time. Example usage:\n//   export MALLOC_FAIL_AT=50 && ./examples/cwebp input.png\n// * if MALLOC_LIMIT is defined, the global environment variable $MALLOC_LIMIT\n//   sets the maximum amount of memory (in bytes) made available to libwebp.\n//   This can be used to emulate environment with very limited memory.\n//   Example: export MALLOC_LIMIT=64000000 && ./examples/dwebp picture.webp\n\n// #define PRINT_MEM_INFO\n// #define PRINT_MEM_TRAFFIC\n// #define MALLOC_FAIL_AT\n// #define MALLOC_LIMIT\n\n//------------------------------------------------------------------------------\n// Checked memory allocation\n\n#if defined(PRINT_MEM_INFO)\n\n#include <stdio.h>\n#include <stdlib.h>  // for abort()\n\nstatic int num_malloc_calls = 0;\nstatic int num_calloc_calls = 0;\nstatic int num_free_calls = 0;\nstatic int countdown_to_fail = 0;     // 0 = off\n\ntypedef struct MemBlock MemBlock;\nstruct MemBlock {\n  void* ptr_;\n  size_t size_;\n  MemBlock* next_;\n};\n\nstatic MemBlock* all_blocks = NULL;\nstatic size_t total_mem = 0;\nstatic size_t total_mem_allocated = 0;\nstatic size_t high_water_mark = 0;\nstatic size_t mem_limit = 0;\n\nstatic int exit_registered = 0;\n\nstatic void PrintMemInfo(void) {\n  fprintf(stderr, \"\\nMEMORY INFO:\\n\");\n  fprintf(stderr, \"num calls to: malloc = %4d\\n\", num_malloc_calls);\n  fprintf(stderr, \"              calloc = %4d\\n\", num_calloc_calls);\n  fprintf(stderr, \"              free   = %4d\\n\", num_free_calls);\n  fprintf(stderr, \"total_mem: %u\\n\", (uint32_t)total_mem);\n  fprintf(stderr, \"total_mem allocated: %u\\n\", (uint32_t)total_mem_allocated);\n  fprintf(stderr, \"high-water mark: %u\\n\", (uint32_t)high_water_mark);\n  while (all_blocks != NULL) {\n    MemBlock* b = all_blocks;\n    all_blocks = b->next_;\n    free(b);\n  }\n}\n\nstatic void Increment(int* const v) {\n  if (!exit_registered) {\n#if defined(MALLOC_FAIL_AT)\n    {\n      const char* const malloc_fail_at_str = getenv(\"MALLOC_FAIL_AT\");\n      if (malloc_fail_at_str != NULL) {\n        countdown_to_fail = atoi(malloc_fail_at_str);\n      }\n    }\n#endif\n#if defined(MALLOC_LIMIT)\n    {\n      const char* const malloc_limit_str = getenv(\"MALLOC_LIMIT\");\n      if (malloc_limit_str != NULL) {\n        mem_limit = atoi(malloc_limit_str);\n      }\n    }\n#endif\n    (void)countdown_to_fail;\n    (void)mem_limit;\n    atexit(PrintMemInfo);\n    exit_registered = 1;\n  }\n  ++*v;\n}\n\nstatic void AddMem(void* ptr, size_t size) {\n  if (ptr != NULL) {\n    MemBlock* const b = (MemBlock*)malloc(sizeof(*b));\n    if (b == NULL) abort();\n    b->next_ = all_blocks;\n    all_blocks = b;\n    b->ptr_ = ptr;\n    b->size_ = size;\n    total_mem += size;\n    total_mem_allocated += size;\n#if defined(PRINT_MEM_TRAFFIC)\n#if defined(MALLOC_FAIL_AT)\n    fprintf(stderr, \"fail-count: %5d [mem=%u]\\n\",\n            num_malloc_calls + num_calloc_calls, (uint32_t)total_mem);\n#else\n    fprintf(stderr, \"Mem: %u (+%u)\\n\", (uint32_t)total_mem, (uint32_t)size);\n#endif\n#endif\n    if (total_mem > high_water_mark) high_water_mark = total_mem;\n  }\n}\n\nstatic void SubMem(void* ptr) {\n  if (ptr != NULL) {\n    MemBlock** b = &all_blocks;\n    // Inefficient search, but that's just for debugging.\n    while (*b != NULL && (*b)->ptr_ != ptr) b = &(*b)->next_;\n    if (*b == NULL) {\n      fprintf(stderr, \"Invalid pointer free! (%p)\\n\", ptr);\n      abort();\n    }\n    {\n      MemBlock* const block = *b;\n      *b = block->next_;\n      total_mem -= block->size_;\n#if defined(PRINT_MEM_TRAFFIC)\n      fprintf(stderr, \"Mem: %u (-%u)\\n\",\n              (uint32_t)total_mem, (uint32_t)block->size_);\n#endif\n      free(block);\n    }\n  }\n}\n\n#else\n#define Increment(v) do {} while (0)\n#define AddMem(p, s) do {} while (0)\n#define SubMem(p)    do {} while (0)\n#endif\n\n// Returns 0 in case of overflow of nmemb * size.\nstatic int CheckSizeArgumentsOverflow(uint64_t nmemb, size_t size) {\n  const uint64_t total_size = nmemb * size;\n  if (nmemb == 0) return 1;\n  if ((uint64_t)size > WEBP_MAX_ALLOCABLE_MEMORY / nmemb) return 0;\n  if (total_size != (size_t)total_size) return 0;\n#if defined(PRINT_MEM_INFO) && defined(MALLOC_FAIL_AT)\n  if (countdown_to_fail > 0 && --countdown_to_fail == 0) {\n    return 0;    // fake fail!\n  }\n#endif\n#if defined(MALLOC_LIMIT)\n  if (mem_limit > 0 && total_mem + total_size >= mem_limit) {\n    return 0;   // fake fail!\n  }\n#endif\n\n  return 1;\n}\n\nvoid* WebPSafeMalloc(uint64_t nmemb, size_t size) {\n  void* ptr;\n  Increment(&num_malloc_calls);\n  if (!CheckSizeArgumentsOverflow(nmemb, size)) return NULL;\n  assert(nmemb * size > 0);\n  ptr = malloc((size_t)(nmemb * size));\n  AddMem(ptr, (size_t)(nmemb * size));\n  return ptr;\n}\n\nvoid* WebPSafeCalloc(uint64_t nmemb, size_t size) {\n  void* ptr;\n  Increment(&num_calloc_calls);\n  if (!CheckSizeArgumentsOverflow(nmemb, size)) return NULL;\n  assert(nmemb * size > 0);\n  ptr = calloc((size_t)nmemb, size);\n  AddMem(ptr, (size_t)(nmemb * size));\n  return ptr;\n}\n\nvoid WebPSafeFree(void* const ptr) {\n  if (ptr != NULL) {\n    Increment(&num_free_calls);\n    SubMem(ptr);\n  }\n  free(ptr);\n}\n\n//------------------------------------------------------------------------------\n"
  },
  {
    "path": "ext/libwebp/utils/utils.h",
    "content": "// Copyright 2012 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Misc. common utility functions\n//\n// Authors: Skal (pascal.massimino@gmail.com)\n//          Urvang (urvang@google.com)\n\n#ifndef WEBP_UTILS_UTILS_H_\n#define WEBP_UTILS_UTILS_H_\n\n#include <assert.h>\n\n#include \"../webp/types.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n//------------------------------------------------------------------------------\n// Memory allocation\n\n// This is the maximum memory amount that libwebp will ever try to allocate.\n#define WEBP_MAX_ALLOCABLE_MEMORY (1ULL << 40)\n\n// size-checking safe malloc/calloc: verify that the requested size is not too\n// large, or return NULL. You don't need to call these for constructs like\n// malloc(sizeof(foo)), but only if there's picture-dependent size involved\n// somewhere (like: malloc(num_pixels * sizeof(*something))). That's why this\n// safe malloc() borrows the signature from calloc(), pointing at the dangerous\n// underlying multiply involved.\nWEBP_EXTERN(void*) WebPSafeMalloc(uint64_t nmemb, size_t size);\n// Note that WebPSafeCalloc() expects the second argument type to be 'size_t'\n// in order to favor the \"calloc(num_foo, sizeof(foo))\" pattern.\nWEBP_EXTERN(void*) WebPSafeCalloc(uint64_t nmemb, size_t size);\n\n// Companion deallocation function to the above allocations.\nWEBP_EXTERN(void) WebPSafeFree(void* const ptr);\n\n//------------------------------------------------------------------------------\n// Reading/writing data.\n\n// Read 16, 24 or 32 bits stored in little-endian order.\nstatic WEBP_INLINE int GetLE16(const uint8_t* const data) {\n  return (int)(data[0] << 0) | (data[1] << 8);\n}\n\nstatic WEBP_INLINE int GetLE24(const uint8_t* const data) {\n  return GetLE16(data) | (data[2] << 16);\n}\n\nstatic WEBP_INLINE uint32_t GetLE32(const uint8_t* const data) {\n  return (uint32_t)GetLE16(data) | (GetLE16(data + 2) << 16);\n}\n\n// Store 16, 24 or 32 bits in little-endian order.\nstatic WEBP_INLINE void PutLE16(uint8_t* const data, int val) {\n  assert(val < (1 << 16));\n  data[0] = (val >> 0);\n  data[1] = (val >> 8);\n}\n\nstatic WEBP_INLINE void PutLE24(uint8_t* const data, int val) {\n  assert(val < (1 << 24));\n  PutLE16(data, val & 0xffff);\n  data[2] = (val >> 16);\n}\n\nstatic WEBP_INLINE void PutLE32(uint8_t* const data, uint32_t val) {\n  PutLE16(data, (int)(val & 0xffff));\n  PutLE16(data + 2, (int)(val >> 16));\n}\n\n// Returns (int)floor(log2(n)). n must be > 0.\n// use GNU builtins where available.\n#if defined(__GNUC__) && \\\n    ((__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4)\nstatic WEBP_INLINE int BitsLog2Floor(uint32_t n) {\n  return 31 ^ __builtin_clz(n);\n}\n#elif defined(_MSC_VER) && _MSC_VER > 1310 && \\\n      (defined(_M_X64) || defined(_M_IX86))\n#include <intrin.h>\n#pragma intrinsic(_BitScanReverse)\n\nstatic WEBP_INLINE int BitsLog2Floor(uint32_t n) {\n  uint32_t first_set_bit;\n  _BitScanReverse(&first_set_bit, n);\n  return first_set_bit;\n}\n#else\nstatic WEBP_INLINE int BitsLog2Floor(uint32_t n) {\n  int log = 0;\n  uint32_t value = n;\n  int i;\n\n  for (i = 4; i >= 0; --i) {\n    const int shift = (1 << i);\n    const uint32_t x = value >> shift;\n    if (x != 0) {\n      value = x;\n      log += shift;\n    }\n  }\n  return log;\n}\n#endif\n\n//------------------------------------------------------------------------------\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_UTILS_UTILS_H_ */\n"
  },
  {
    "path": "ext/libwebp/webp/config.h.in",
    "content": "/* src/webp/config.h.in.  Generated from configure.ac by autoheader.  */\n\n/* Define if building universal (internal helper macro) */\n#undef AC_APPLE_UNIVERSAL_BUILD\n\n/* Set to 1 if __builtin_bswap16 is available */\n#undef HAVE_BUILTIN_BSWAP16\n\n/* Set to 1 if __builtin_bswap32 is available */\n#undef HAVE_BUILTIN_BSWAP32\n\n/* Set to 1 if __builtin_bswap64 is available */\n#undef HAVE_BUILTIN_BSWAP64\n\n/* Define to 1 if you have the <dlfcn.h> header file. */\n#undef HAVE_DLFCN_H\n\n/* Define to 1 if you have the <GLUT/glut.h> header file. */\n#undef HAVE_GLUT_GLUT_H\n\n/* Define to 1 if you have the <GL/glut.h> header file. */\n#undef HAVE_GL_GLUT_H\n\n/* Define to 1 if you have the <inttypes.h> header file. */\n#undef HAVE_INTTYPES_H\n\n/* Define to 1 if you have the <memory.h> header file. */\n#undef HAVE_MEMORY_H\n\n/* Define to 1 if you have the <OpenGL/glut.h> header file. */\n#undef HAVE_OPENGL_GLUT_H\n\n/* Have PTHREAD_PRIO_INHERIT. */\n#undef HAVE_PTHREAD_PRIO_INHERIT\n\n/* Define to 1 if you have the <shlwapi.h> header file. */\n#undef HAVE_SHLWAPI_H\n\n/* Define to 1 if you have the <stdint.h> header file. */\n#undef HAVE_STDINT_H\n\n/* Define to 1 if you have the <stdlib.h> header file. */\n#undef HAVE_STDLIB_H\n\n/* Define to 1 if you have the <strings.h> header file. */\n#undef HAVE_STRINGS_H\n\n/* Define to 1 if you have the <string.h> header file. */\n#undef HAVE_STRING_H\n\n/* Define to 1 if you have the <sys/stat.h> header file. */\n#undef HAVE_SYS_STAT_H\n\n/* Define to 1 if you have the <sys/types.h> header file. */\n#undef HAVE_SYS_TYPES_H\n\n/* Define to 1 if you have the <unistd.h> header file. */\n#undef HAVE_UNISTD_H\n\n/* Define to 1 if you have the <wincodec.h> header file. */\n#undef HAVE_WINCODEC_H\n\n/* Define to 1 if you have the <windows.h> header file. */\n#undef HAVE_WINDOWS_H\n\n/* Define to the sub-directory in which libtool stores uninstalled libraries.\n   */\n#undef LT_OBJDIR\n\n/* Define to 1 if your C compiler doesn't accept -c and -o together. */\n#undef NO_MINUS_C_MINUS_O\n\n/* Name of package */\n#undef PACKAGE\n\n/* Define to the address where bug reports for this package should be sent. */\n#undef PACKAGE_BUGREPORT\n\n/* Define to the full name of this package. */\n#undef PACKAGE_NAME\n\n/* Define to the full name and version of this package. */\n#undef PACKAGE_STRING\n\n/* Define to the one symbol short name of this package. */\n#undef PACKAGE_TARNAME\n\n/* Define to the home page for this package. */\n#undef PACKAGE_URL\n\n/* Define to the version of this package. */\n#undef PACKAGE_VERSION\n\n/* Define to necessary symbol if this constant uses a non-standard name on\n   your system. */\n#undef PTHREAD_CREATE_JOINABLE\n\n/* Define to 1 if you have the ANSI C header files. */\n#undef STDC_HEADERS\n\n/* Version number of package */\n#undef VERSION\n\n/* Enable experimental code */\n#undef WEBP_EXPERIMENTAL_FEATURES\n\n/* Define to 1 to force aligned memory operations */\n#undef WEBP_FORCE_ALIGNED\n\n/* Set to 1 if AVX2 is supported */\n#undef WEBP_HAVE_AVX2\n\n/* Set to 1 if GIF library is installed */\n#undef WEBP_HAVE_GIF\n\n/* Set to 1 if OpenGL is supported */\n#undef WEBP_HAVE_GL\n\n/* Set to 1 if JPEG library is installed */\n#undef WEBP_HAVE_JPEG\n\n/* Set to 1 if PNG library is installed */\n#undef WEBP_HAVE_PNG\n\n/* Set to 1 if SSE2 is supported */\n#undef WEBP_HAVE_SSE2\n\n/* Set to 1 if TIFF library is installed */\n#undef WEBP_HAVE_TIFF\n\n/* Undefine this to disable thread support. */\n#undef WEBP_USE_THREAD\n\n/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most\n   significant byte first (like Motorola and SPARC, unlike Intel). */\n#if defined AC_APPLE_UNIVERSAL_BUILD\n# if defined __BIG_ENDIAN__\n#  define WORDS_BIGENDIAN 1\n# endif\n#else\n# ifndef WORDS_BIGENDIAN\n#  undef WORDS_BIGENDIAN\n# endif\n#endif\n"
  },
  {
    "path": "ext/libwebp/webp/decode.h",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n//  Main decoding functions for WebP images.\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_WEBP_DECODE_H_\n#define WEBP_WEBP_DECODE_H_\n\n#include \"./types.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#define WEBP_DECODER_ABI_VERSION 0x0203    // MAJOR(8b) + MINOR(8b)\n\n// Note: forward declaring enumerations is not allowed in (strict) C and C++,\n// the types are left here for reference.\n// typedef enum VP8StatusCode VP8StatusCode;\n// typedef enum WEBP_CSP_MODE WEBP_CSP_MODE;\ntypedef struct WebPRGBABuffer WebPRGBABuffer;\ntypedef struct WebPYUVABuffer WebPYUVABuffer;\ntypedef struct WebPDecBuffer WebPDecBuffer;\ntypedef struct WebPIDecoder WebPIDecoder;\ntypedef struct WebPBitstreamFeatures WebPBitstreamFeatures;\ntypedef struct WebPDecoderOptions WebPDecoderOptions;\ntypedef struct WebPDecoderConfig WebPDecoderConfig;\n\n// Return the decoder's version number, packed in hexadecimal using 8bits for\n// each of major/minor/revision. E.g: v2.5.7 is 0x020507.\nWEBP_EXTERN(int) WebPGetDecoderVersion(void);\n\n// Retrieve basic header information: width, height.\n// This function will also validate the header and return 0 in\n// case of formatting error.\n// Pointers 'width' and 'height' can be passed NULL if deemed irrelevant.\nWEBP_EXTERN(int) WebPGetInfo(const uint8_t* data, size_t data_size,\n                             int* width, int* height);\n\n// Decodes WebP images pointed to by 'data' and returns RGBA samples, along\n// with the dimensions in *width and *height. The ordering of samples in\n// memory is R, G, B, A, R, G, B, A... in scan order (endian-independent).\n// The returned pointer should be deleted calling free().\n// Returns NULL in case of error.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGBA(const uint8_t* data, size_t data_size,\n                                     int* width, int* height);\n\n// Same as WebPDecodeRGBA, but returning A, R, G, B, A, R, G, B... ordered data.\nWEBP_EXTERN(uint8_t*) WebPDecodeARGB(const uint8_t* data, size_t data_size,\n                                     int* width, int* height);\n\n// Same as WebPDecodeRGBA, but returning B, G, R, A, B, G, R, A... ordered data.\nWEBP_EXTERN(uint8_t*) WebPDecodeBGRA(const uint8_t* data, size_t data_size,\n                                     int* width, int* height);\n\n// Same as WebPDecodeRGBA, but returning R, G, B, R, G, B... ordered data.\n// If the bitstream contains transparency, it is ignored.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGB(const uint8_t* data, size_t data_size,\n                                    int* width, int* height);\n\n// Same as WebPDecodeRGB, but returning B, G, R, B, G, R... ordered data.\nWEBP_EXTERN(uint8_t*) WebPDecodeBGR(const uint8_t* data, size_t data_size,\n                                    int* width, int* height);\n\n\n// Decode WebP images pointed to by 'data' to Y'UV format(*). The pointer\n// returned is the Y samples buffer. Upon return, *u and *v will point to\n// the U and V chroma data. These U and V buffers need NOT be free()'d,\n// unlike the returned Y luma one. The dimension of the U and V planes\n// are both (*width + 1) / 2 and (*height + 1)/ 2.\n// Upon return, the Y buffer has a stride returned as '*stride', while U and V\n// have a common stride returned as '*uv_stride'.\n// Return NULL in case of error.\n// (*) Also named Y'CbCr. See: http://en.wikipedia.org/wiki/YCbCr\nWEBP_EXTERN(uint8_t*) WebPDecodeYUV(const uint8_t* data, size_t data_size,\n                                    int* width, int* height,\n                                    uint8_t** u, uint8_t** v,\n                                    int* stride, int* uv_stride);\n\n// These five functions are variants of the above ones, that decode the image\n// directly into a pre-allocated buffer 'output_buffer'. The maximum storage\n// available in this buffer is indicated by 'output_buffer_size'. If this\n// storage is not sufficient (or an error occurred), NULL is returned.\n// Otherwise, output_buffer is returned, for convenience.\n// The parameter 'output_stride' specifies the distance (in bytes)\n// between scanlines. Hence, output_buffer_size is expected to be at least\n// output_stride x picture-height.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGBAInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\nWEBP_EXTERN(uint8_t*) WebPDecodeARGBInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\nWEBP_EXTERN(uint8_t*) WebPDecodeBGRAInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\n\n// RGB and BGR variants. Here too the transparency information, if present,\n// will be dropped and ignored.\nWEBP_EXTERN(uint8_t*) WebPDecodeRGBInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\nWEBP_EXTERN(uint8_t*) WebPDecodeBGRInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\n\n// WebPDecodeYUVInto() is a variant of WebPDecodeYUV() that operates directly\n// into pre-allocated luma/chroma plane buffers. This function requires the\n// strides to be passed: one for the luma plane and one for each of the\n// chroma ones. The size of each plane buffer is passed as 'luma_size',\n// 'u_size' and 'v_size' respectively.\n// Pointer to the luma plane ('*luma') is returned or NULL if an error occurred\n// during decoding (or because some buffers were found to be too small).\nWEBP_EXTERN(uint8_t*) WebPDecodeYUVInto(\n    const uint8_t* data, size_t data_size,\n    uint8_t* luma, size_t luma_size, int luma_stride,\n    uint8_t* u, size_t u_size, int u_stride,\n    uint8_t* v, size_t v_size, int v_stride);\n\n//------------------------------------------------------------------------------\n// Output colorspaces and buffer\n\n// Colorspaces\n// Note: the naming describes the byte-ordering of packed samples in memory.\n// For instance, MODE_BGRA relates to samples ordered as B,G,R,A,B,G,R,A,...\n// Non-capital names (e.g.:MODE_Argb) relates to pre-multiplied RGB channels.\n// RGBA-4444 and RGB-565 colorspaces are represented by following byte-order:\n// RGBA-4444: [r3 r2 r1 r0 g3 g2 g1 g0], [b3 b2 b1 b0 a3 a2 a1 a0], ...\n// RGB-565: [r4 r3 r2 r1 r0 g5 g4 g3], [g2 g1 g0 b4 b3 b2 b1 b0], ...\n// In the case WEBP_SWAP_16BITS_CSP is defined, the bytes are swapped for\n// these two modes:\n// RGBA-4444: [b3 b2 b1 b0 a3 a2 a1 a0], [r3 r2 r1 r0 g3 g2 g1 g0], ...\n// RGB-565: [g2 g1 g0 b4 b3 b2 b1 b0], [r4 r3 r2 r1 r0 g5 g4 g3], ...\n\ntypedef enum WEBP_CSP_MODE {\n  MODE_RGB = 0, MODE_RGBA = 1,\n  MODE_BGR = 2, MODE_BGRA = 3,\n  MODE_ARGB = 4, MODE_RGBA_4444 = 5,\n  MODE_RGB_565 = 6,\n  // RGB-premultiplied transparent modes (alpha value is preserved)\n  MODE_rgbA = 7,\n  MODE_bgrA = 8,\n  MODE_Argb = 9,\n  MODE_rgbA_4444 = 10,\n  // YUV modes must come after RGB ones.\n  MODE_YUV = 11, MODE_YUVA = 12,  // yuv 4:2:0\n  MODE_LAST = 13\n} WEBP_CSP_MODE;\n\n// Some useful macros:\nstatic WEBP_INLINE int WebPIsPremultipliedMode(WEBP_CSP_MODE mode) {\n  return (mode == MODE_rgbA || mode == MODE_bgrA || mode == MODE_Argb ||\n          mode == MODE_rgbA_4444);\n}\n\nstatic WEBP_INLINE int WebPIsAlphaMode(WEBP_CSP_MODE mode) {\n  return (mode == MODE_RGBA || mode == MODE_BGRA || mode == MODE_ARGB ||\n          mode == MODE_RGBA_4444 || mode == MODE_YUVA ||\n          WebPIsPremultipliedMode(mode));\n}\n\nstatic WEBP_INLINE int WebPIsRGBMode(WEBP_CSP_MODE mode) {\n  return (mode < MODE_YUV);\n}\n\n//------------------------------------------------------------------------------\n// WebPDecBuffer: Generic structure for describing the output sample buffer.\n\nstruct WebPRGBABuffer {    // view as RGBA\n  uint8_t* rgba;    // pointer to RGBA samples\n  int stride;       // stride in bytes from one scanline to the next.\n  size_t size;      // total size of the *rgba buffer.\n};\n\nstruct WebPYUVABuffer {              // view as YUVA\n  uint8_t* y, *u, *v, *a;     // pointer to luma, chroma U/V, alpha samples\n  int y_stride;               // luma stride\n  int u_stride, v_stride;     // chroma strides\n  int a_stride;               // alpha stride\n  size_t y_size;              // luma plane size\n  size_t u_size, v_size;      // chroma planes size\n  size_t a_size;              // alpha-plane size\n};\n\n// Output buffer\nstruct WebPDecBuffer {\n  WEBP_CSP_MODE colorspace;  // Colorspace.\n  int width, height;         // Dimensions.\n  int is_external_memory;    // If true, 'internal_memory' pointer is not used.\n  union {\n    WebPRGBABuffer RGBA;\n    WebPYUVABuffer YUVA;\n  } u;                       // Nameless union of buffer parameters.\n  uint32_t       pad[4];     // padding for later use\n\n  uint8_t* private_memory;   // Internally allocated memory (only when\n                             // is_external_memory is false). Should not be used\n                             // externally, but accessed via the buffer union.\n};\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPInitDecBufferInternal(WebPDecBuffer*, int);\n\n// Initialize the structure as empty. Must be called before any other use.\n// Returns false in case of version mismatch\nstatic WEBP_INLINE int WebPInitDecBuffer(WebPDecBuffer* buffer) {\n  return WebPInitDecBufferInternal(buffer, WEBP_DECODER_ABI_VERSION);\n}\n\n// Free any memory associated with the buffer. Must always be called last.\n// Note: doesn't free the 'buffer' structure itself.\nWEBP_EXTERN(void) WebPFreeDecBuffer(WebPDecBuffer* buffer);\n\n//------------------------------------------------------------------------------\n// Enumeration of the status codes\n\ntypedef enum VP8StatusCode {\n  VP8_STATUS_OK = 0,\n  VP8_STATUS_OUT_OF_MEMORY,\n  VP8_STATUS_INVALID_PARAM,\n  VP8_STATUS_BITSTREAM_ERROR,\n  VP8_STATUS_UNSUPPORTED_FEATURE,\n  VP8_STATUS_SUSPENDED,\n  VP8_STATUS_USER_ABORT,\n  VP8_STATUS_NOT_ENOUGH_DATA\n} VP8StatusCode;\n\n//------------------------------------------------------------------------------\n// Incremental decoding\n//\n// This API allows streamlined decoding of partial data.\n// Picture can be incrementally decoded as data become available thanks to the\n// WebPIDecoder object. This object can be left in a SUSPENDED state if the\n// picture is only partially decoded, pending additional input.\n// Code example:\n//\n//   WebPInitDecBuffer(&buffer);\n//   buffer.colorspace = mode;\n//   ...\n//   WebPIDecoder* idec = WebPINewDecoder(&buffer);\n//   while (has_more_data) {\n//     // ... (get additional data)\n//     status = WebPIAppend(idec, new_data, new_data_size);\n//     if (status != VP8_STATUS_SUSPENDED ||\n//       break;\n//     }\n//\n//     // The above call decodes the current available buffer.\n//     // Part of the image can now be refreshed by calling to\n//     // WebPIDecGetRGB()/WebPIDecGetYUVA() etc.\n//   }\n//   WebPIDelete(idec);\n\n// Creates a new incremental decoder with the supplied buffer parameter.\n// This output_buffer can be passed NULL, in which case a default output buffer\n// is used (with MODE_RGB). Otherwise, an internal reference to 'output_buffer'\n// is kept, which means that the lifespan of 'output_buffer' must be larger than\n// that of the returned WebPIDecoder object.\n// The supplied 'output_buffer' content MUST NOT be changed between calls to\n// WebPIAppend() or WebPIUpdate() unless 'output_buffer.is_external_memory' is\n// set to 1. In such a case, it is allowed to modify the pointers, size and\n// stride of output_buffer.u.RGBA or output_buffer.u.YUVA, provided they remain\n// within valid bounds.\n// All other fields of WebPDecBuffer MUST remain constant between calls.\n// Returns NULL if the allocation failed.\nWEBP_EXTERN(WebPIDecoder*) WebPINewDecoder(WebPDecBuffer* output_buffer);\n\n// This function allocates and initializes an incremental-decoder object, which\n// will output the RGB/A samples specified by 'csp' into a preallocated\n// buffer 'output_buffer'. The size of this buffer is at least\n// 'output_buffer_size' and the stride (distance in bytes between two scanlines)\n// is specified by 'output_stride'.\n// Additionally, output_buffer can be passed NULL in which case the output\n// buffer will be allocated automatically when the decoding starts. The\n// colorspace 'csp' is taken into account for allocating this buffer. All other\n// parameters are ignored.\n// Returns NULL if the allocation failed, or if some parameters are invalid.\nWEBP_EXTERN(WebPIDecoder*) WebPINewRGB(\n    WEBP_CSP_MODE csp,\n    uint8_t* output_buffer, size_t output_buffer_size, int output_stride);\n\n// This function allocates and initializes an incremental-decoder object, which\n// will output the raw luma/chroma samples into a preallocated planes if\n// supplied. The luma plane is specified by its pointer 'luma', its size\n// 'luma_size' and its stride 'luma_stride'. Similarly, the chroma-u plane\n// is specified by the 'u', 'u_size' and 'u_stride' parameters, and the chroma-v\n// plane by 'v' and 'v_size'. And same for the alpha-plane. The 'a' pointer\n// can be pass NULL in case one is not interested in the transparency plane.\n// Conversely, 'luma' can be passed NULL if no preallocated planes are supplied.\n// In this case, the output buffer will be automatically allocated (using\n// MODE_YUVA) when decoding starts. All parameters are then ignored.\n// Returns NULL if the allocation failed or if a parameter is invalid.\nWEBP_EXTERN(WebPIDecoder*) WebPINewYUVA(\n    uint8_t* luma, size_t luma_size, int luma_stride,\n    uint8_t* u, size_t u_size, int u_stride,\n    uint8_t* v, size_t v_size, int v_stride,\n    uint8_t* a, size_t a_size, int a_stride);\n\n// Deprecated version of the above, without the alpha plane.\n// Kept for backward compatibility.\nWEBP_EXTERN(WebPIDecoder*) WebPINewYUV(\n    uint8_t* luma, size_t luma_size, int luma_stride,\n    uint8_t* u, size_t u_size, int u_stride,\n    uint8_t* v, size_t v_size, int v_stride);\n\n// Deletes the WebPIDecoder object and associated memory. Must always be called\n// if WebPINewDecoder, WebPINewRGB or WebPINewYUV succeeded.\nWEBP_EXTERN(void) WebPIDelete(WebPIDecoder* idec);\n\n// Copies and decodes the next available data. Returns VP8_STATUS_OK when\n// the image is successfully decoded. Returns VP8_STATUS_SUSPENDED when more\n// data is expected. Returns error in other cases.\nWEBP_EXTERN(VP8StatusCode) WebPIAppend(\n    WebPIDecoder* idec, const uint8_t* data, size_t data_size);\n\n// A variant of the above function to be used when data buffer contains\n// partial data from the beginning. In this case data buffer is not copied\n// to the internal memory.\n// Note that the value of the 'data' pointer can change between calls to\n// WebPIUpdate, for instance when the data buffer is resized to fit larger data.\nWEBP_EXTERN(VP8StatusCode) WebPIUpdate(\n    WebPIDecoder* idec, const uint8_t* data, size_t data_size);\n\n// Returns the RGB/A image decoded so far. Returns NULL if output params\n// are not initialized yet. The RGB/A output type corresponds to the colorspace\n// specified during call to WebPINewDecoder() or WebPINewRGB().\n// *last_y is the index of last decoded row in raster scan order. Some pointers\n// (*last_y, *width etc.) can be NULL if corresponding information is not\n// needed.\nWEBP_EXTERN(uint8_t*) WebPIDecGetRGB(\n    const WebPIDecoder* idec, int* last_y,\n    int* width, int* height, int* stride);\n\n// Same as above function to get a YUVA image. Returns pointer to the luma\n// plane or NULL in case of error. If there is no alpha information\n// the alpha pointer '*a' will be returned NULL.\nWEBP_EXTERN(uint8_t*) WebPIDecGetYUVA(\n    const WebPIDecoder* idec, int* last_y,\n    uint8_t** u, uint8_t** v, uint8_t** a,\n    int* width, int* height, int* stride, int* uv_stride, int* a_stride);\n\n// Deprecated alpha-less version of WebPIDecGetYUVA(): it will ignore the\n// alpha information (if present). Kept for backward compatibility.\nstatic WEBP_INLINE uint8_t* WebPIDecGetYUV(\n    const WebPIDecoder* idec, int* last_y, uint8_t** u, uint8_t** v,\n    int* width, int* height, int* stride, int* uv_stride) {\n  return WebPIDecGetYUVA(idec, last_y, u, v, NULL, width, height,\n                         stride, uv_stride, NULL);\n}\n\n// Generic call to retrieve information about the displayable area.\n// If non NULL, the left/right/width/height pointers are filled with the visible\n// rectangular area so far.\n// Returns NULL in case the incremental decoder object is in an invalid state.\n// Otherwise returns the pointer to the internal representation. This structure\n// is read-only, tied to WebPIDecoder's lifespan and should not be modified.\nWEBP_EXTERN(const WebPDecBuffer*) WebPIDecodedArea(\n    const WebPIDecoder* idec, int* left, int* top, int* width, int* height);\n\n//------------------------------------------------------------------------------\n// Advanced decoding parametrization\n//\n//  Code sample for using the advanced decoding API\n/*\n     // A) Init a configuration object\n     WebPDecoderConfig config;\n     CHECK(WebPInitDecoderConfig(&config));\n\n     // B) optional: retrieve the bitstream's features.\n     CHECK(WebPGetFeatures(data, data_size, &config.input) == VP8_STATUS_OK);\n\n     // C) Adjust 'config', if needed\n     config.no_fancy_upsampling = 1;\n     config.output.colorspace = MODE_BGRA;\n     // etc.\n\n     // Note that you can also make config.output point to an externally\n     // supplied memory buffer, provided it's big enough to store the decoded\n     // picture. Otherwise, config.output will just be used to allocate memory\n     // and store the decoded picture.\n\n     // D) Decode!\n     CHECK(WebPDecode(data, data_size, &config) == VP8_STATUS_OK);\n\n     // E) Decoded image is now in config.output (and config.output.u.RGBA)\n\n     // F) Reclaim memory allocated in config's object. It's safe to call\n     // this function even if the memory is external and wasn't allocated\n     // by WebPDecode().\n     WebPFreeDecBuffer(&config.output);\n*/\n\n// Features gathered from the bitstream\nstruct WebPBitstreamFeatures {\n  int width;          // Width in pixels, as read from the bitstream.\n  int height;         // Height in pixels, as read from the bitstream.\n  int has_alpha;      // True if the bitstream contains an alpha channel.\n  int has_animation;  // True if the bitstream is an animation.\n  int format;         // 0 = undefined (/mixed), 1 = lossy, 2 = lossless\n\n  // Unused for now:\n  int no_incremental_decoding;  // if true, using incremental decoding is not\n                                // recommended.\n  int rotate;                   // TODO(later)\n  int uv_sampling;              // should be 0 for now. TODO(later)\n  uint32_t pad[2];              // padding for later use\n};\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(VP8StatusCode) WebPGetFeaturesInternal(\n    const uint8_t*, size_t, WebPBitstreamFeatures*, int);\n\n// Retrieve features from the bitstream. The *features structure is filled\n// with information gathered from the bitstream.\n// Returns VP8_STATUS_OK when the features are successfully retrieved. Returns\n// VP8_STATUS_NOT_ENOUGH_DATA when more data is needed to retrieve the\n// features from headers. Returns error in other cases.\nstatic WEBP_INLINE VP8StatusCode WebPGetFeatures(\n    const uint8_t* data, size_t data_size,\n    WebPBitstreamFeatures* features) {\n  return WebPGetFeaturesInternal(data, data_size, features,\n                                 WEBP_DECODER_ABI_VERSION);\n}\n\n// Decoding options\nstruct WebPDecoderOptions {\n  int bypass_filtering;               // if true, skip the in-loop filtering\n  int no_fancy_upsampling;            // if true, use faster pointwise upsampler\n  int use_cropping;                   // if true, cropping is applied _first_\n  int crop_left, crop_top;            // top-left position for cropping.\n                                      // Will be snapped to even values.\n  int crop_width, crop_height;        // dimension of the cropping area\n  int use_scaling;                    // if true, scaling is applied _afterward_\n  int scaled_width, scaled_height;    // final resolution\n  int use_threads;                    // if true, use multi-threaded decoding\n  int dithering_strength;             // dithering strength (0=Off, 100=full)\n#if WEBP_DECODER_ABI_VERSION > 0x0203\n  int flip;                           // flip output vertically\n#endif\n#if WEBP_DECODER_ABI_VERSION > 0x0204\n  int alpha_dithering_strength;       // alpha dithering strength in [0..100]\n#endif\n\n  // Unused for now:\n  int force_rotation;                 // forced rotation (to be applied _last_)\n  int no_enhancement;                 // if true, discard enhancement layer\n#if WEBP_DECODER_ABI_VERSION < 0x0203\n  uint32_t pad[5];                    // padding for later use\n#elif WEBP_DECODER_ABI_VERSION < 0x0204\n  uint32_t pad[4];                    // padding for later use\n#else\n  uint32_t pad[3];                    // padding for later use\n#endif\n};\n\n// Main object storing the configuration for advanced decoding.\nstruct WebPDecoderConfig {\n  WebPBitstreamFeatures input;  // Immutable bitstream features (optional)\n  WebPDecBuffer output;         // Output buffer (can point to external mem)\n  WebPDecoderOptions options;   // Decoding options\n};\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPInitDecoderConfigInternal(WebPDecoderConfig*, int);\n\n// Initialize the configuration as empty. This function must always be\n// called first, unless WebPGetFeatures() is to be called.\n// Returns false in case of mismatched version.\nstatic WEBP_INLINE int WebPInitDecoderConfig(WebPDecoderConfig* config) {\n  return WebPInitDecoderConfigInternal(config, WEBP_DECODER_ABI_VERSION);\n}\n\n// Instantiate a new incremental decoder object with the requested\n// configuration. The bitstream can be passed using 'data' and 'data_size'\n// parameter, in which case the features will be parsed and stored into\n// config->input. Otherwise, 'data' can be NULL and no parsing will occur.\n// Note that 'config' can be NULL too, in which case a default configuration\n// is used.\n// The return WebPIDecoder object must always be deleted calling WebPIDelete().\n// Returns NULL in case of error (and config->status will then reflect\n// the error condition).\nWEBP_EXTERN(WebPIDecoder*) WebPIDecode(const uint8_t* data, size_t data_size,\n                                       WebPDecoderConfig* config);\n\n// Non-incremental version. This version decodes the full data at once, taking\n// 'config' into account. Returns decoding status (which should be VP8_STATUS_OK\n// if the decoding was successful).\nWEBP_EXTERN(VP8StatusCode) WebPDecode(const uint8_t* data, size_t data_size,\n                                      WebPDecoderConfig* config);\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_WEBP_DECODE_H_ */\n"
  },
  {
    "path": "ext/libwebp/webp/demux.h",
    "content": "// Copyright 2012 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Demux API.\n// Enables extraction of image and extended format data from WebP files.\n\n// Code Example: Demuxing WebP data to extract all the frames, ICC profile\n// and EXIF/XMP metadata.\n/*\n  WebPDemuxer* demux = WebPDemux(&webp_data);\n\n  uint32_t width = WebPDemuxGetI(demux, WEBP_FF_CANVAS_WIDTH);\n  uint32_t height = WebPDemuxGetI(demux, WEBP_FF_CANVAS_HEIGHT);\n  // ... (Get information about the features present in the WebP file).\n  uint32_t flags = WebPDemuxGetI(demux, WEBP_FF_FORMAT_FLAGS);\n\n  // ... (Iterate over all frames).\n  WebPIterator iter;\n  if (WebPDemuxGetFrame(demux, 1, &iter)) {\n    do {\n      // ... (Consume 'iter'; e.g. Decode 'iter.fragment' with WebPDecode(),\n      // ... and get other frame properties like width, height, offsets etc.\n      // ... see 'struct WebPIterator' below for more info).\n    } while (WebPDemuxNextFrame(&iter));\n    WebPDemuxReleaseIterator(&iter);\n  }\n\n  // ... (Extract metadata).\n  WebPChunkIterator chunk_iter;\n  if (flags & ICCP_FLAG) WebPDemuxGetChunk(demux, \"ICCP\", 1, &chunk_iter);\n  // ... (Consume the ICC profile in 'chunk_iter.chunk').\n  WebPDemuxReleaseChunkIterator(&chunk_iter);\n  if (flags & EXIF_FLAG) WebPDemuxGetChunk(demux, \"EXIF\", 1, &chunk_iter);\n  // ... (Consume the EXIF metadata in 'chunk_iter.chunk').\n  WebPDemuxReleaseChunkIterator(&chunk_iter);\n  if (flags & XMP_FLAG) WebPDemuxGetChunk(demux, \"XMP \", 1, &chunk_iter);\n  // ... (Consume the XMP metadata in 'chunk_iter.chunk').\n  WebPDemuxReleaseChunkIterator(&chunk_iter);\n  WebPDemuxDelete(demux);\n*/\n\n#ifndef WEBP_WEBP_DEMUX_H_\n#define WEBP_WEBP_DEMUX_H_\n\n#include \"./mux_types.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#define WEBP_DEMUX_ABI_VERSION 0x0101    // MAJOR(8b) + MINOR(8b)\n\n// Note: forward declaring enumerations is not allowed in (strict) C and C++,\n// the types are left here for reference.\n// typedef enum WebPDemuxState WebPDemuxState;\n// typedef enum WebPFormatFeature WebPFormatFeature;\ntypedef struct WebPDemuxer WebPDemuxer;\ntypedef struct WebPIterator WebPIterator;\ntypedef struct WebPChunkIterator WebPChunkIterator;\n\n//------------------------------------------------------------------------------\n\n// Returns the version number of the demux library, packed in hexadecimal using\n// 8bits for each of major/minor/revision. E.g: v2.5.7 is 0x020507.\nWEBP_EXTERN(int) WebPGetDemuxVersion(void);\n\n//------------------------------------------------------------------------------\n// Life of a Demux object\n\ntypedef enum WebPDemuxState {\n  WEBP_DEMUX_PARSE_ERROR    = -1,  // An error occurred while parsing.\n  WEBP_DEMUX_PARSING_HEADER =  0,  // Not enough data to parse full header.\n  WEBP_DEMUX_PARSED_HEADER  =  1,  // Header parsing complete,\n                                   // data may be available.\n  WEBP_DEMUX_DONE           =  2   // Entire file has been parsed.\n} WebPDemuxState;\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(WebPDemuxer*) WebPDemuxInternal(\n    const WebPData*, int, WebPDemuxState*, int);\n\n// Parses the full WebP file given by 'data'.\n// Returns a WebPDemuxer object on successful parse, NULL otherwise.\nstatic WEBP_INLINE WebPDemuxer* WebPDemux(const WebPData* data) {\n  return WebPDemuxInternal(data, 0, NULL, WEBP_DEMUX_ABI_VERSION);\n}\n\n// Parses the possibly incomplete WebP file given by 'data'.\n// If 'state' is non-NULL it will be set to indicate the status of the demuxer.\n// Returns NULL in case of error or if there isn't enough data to start parsing;\n// and a WebPDemuxer object on successful parse.\n// Note that WebPDemuxer keeps internal pointers to 'data' memory segment.\n// If this data is volatile, the demuxer object should be deleted (by calling\n// WebPDemuxDelete()) and WebPDemuxPartial() called again on the new data.\n// This is usually an inexpensive operation.\nstatic WEBP_INLINE WebPDemuxer* WebPDemuxPartial(\n    const WebPData* data, WebPDemuxState* state) {\n  return WebPDemuxInternal(data, 1, state, WEBP_DEMUX_ABI_VERSION);\n}\n\n// Frees memory associated with 'dmux'.\nWEBP_EXTERN(void) WebPDemuxDelete(WebPDemuxer* dmux);\n\n//------------------------------------------------------------------------------\n// Data/information extraction.\n\ntypedef enum WebPFormatFeature {\n  WEBP_FF_FORMAT_FLAGS,  // Extended format flags present in the 'VP8X' chunk.\n  WEBP_FF_CANVAS_WIDTH,\n  WEBP_FF_CANVAS_HEIGHT,\n  WEBP_FF_LOOP_COUNT,\n  WEBP_FF_BACKGROUND_COLOR,\n  WEBP_FF_FRAME_COUNT    // Number of frames present in the demux object.\n                         // In case of a partial demux, this is the number of\n                         // frames seen so far, with the last frame possibly\n                         // being partial.\n} WebPFormatFeature;\n\n// Get the 'feature' value from the 'dmux'.\n// NOTE: values are only valid if WebPDemux() was used or WebPDemuxPartial()\n// returned a state > WEBP_DEMUX_PARSING_HEADER.\nWEBP_EXTERN(uint32_t) WebPDemuxGetI(\n    const WebPDemuxer* dmux, WebPFormatFeature feature);\n\n//------------------------------------------------------------------------------\n// Frame iteration.\n\nstruct WebPIterator {\n  int frame_num;\n  int num_frames;          // equivalent to WEBP_FF_FRAME_COUNT.\n  int fragment_num;\n  int num_fragments;\n  int x_offset, y_offset;  // offset relative to the canvas.\n  int width, height;       // dimensions of this frame or fragment.\n  int duration;            // display duration in milliseconds.\n  WebPMuxAnimDispose dispose_method;  // dispose method for the frame.\n  int complete;   // true if 'fragment' contains a full frame. partial images\n                  // may still be decoded with the WebP incremental decoder.\n  WebPData fragment;  // The frame or fragment given by 'frame_num' and\n                      // 'fragment_num'.\n  int has_alpha;      // True if the frame or fragment contains transparency.\n  WebPMuxAnimBlend blend_method;  // Blend operation for the frame.\n\n  uint32_t pad[2];         // padding for later use.\n  void* private_;          // for internal use only.\n};\n\n// Retrieves frame 'frame_number' from 'dmux'.\n// 'iter->fragment' points to the first fragment on return from this function.\n// Individual fragments may be extracted using WebPDemuxSelectFragment().\n// Setting 'frame_number' equal to 0 will return the last frame of the image.\n// Returns false if 'dmux' is NULL or frame 'frame_number' is not present.\n// Call WebPDemuxReleaseIterator() when use of the iterator is complete.\n// NOTE: 'dmux' must persist for the lifetime of 'iter'.\nWEBP_EXTERN(int) WebPDemuxGetFrame(\n    const WebPDemuxer* dmux, int frame_number, WebPIterator* iter);\n\n// Sets 'iter->fragment' to point to the next ('iter->frame_num' + 1) or\n// previous ('iter->frame_num' - 1) frame. These functions do not loop.\n// Returns true on success, false otherwise.\nWEBP_EXTERN(int) WebPDemuxNextFrame(WebPIterator* iter);\nWEBP_EXTERN(int) WebPDemuxPrevFrame(WebPIterator* iter);\n\n// Sets 'iter->fragment' to reflect fragment number 'fragment_num'.\n// Returns true if fragment 'fragment_num' is present, false otherwise.\nWEBP_EXTERN(int) WebPDemuxSelectFragment(WebPIterator* iter, int fragment_num);\n\n// Releases any memory associated with 'iter'.\n// Must be called before any subsequent calls to WebPDemuxGetChunk() on the same\n// iter. Also, must be called before destroying the associated WebPDemuxer with\n// WebPDemuxDelete().\nWEBP_EXTERN(void) WebPDemuxReleaseIterator(WebPIterator* iter);\n\n//------------------------------------------------------------------------------\n// Chunk iteration.\n\nstruct WebPChunkIterator {\n  // The current and total number of chunks with the fourcc given to\n  // WebPDemuxGetChunk().\n  int chunk_num;\n  int num_chunks;\n  WebPData chunk;    // The payload of the chunk.\n\n  uint32_t pad[6];   // padding for later use\n  void* private_;\n};\n\n// Retrieves the 'chunk_number' instance of the chunk with id 'fourcc' from\n// 'dmux'.\n// 'fourcc' is a character array containing the fourcc of the chunk to return,\n// e.g., \"ICCP\", \"XMP \", \"EXIF\", etc.\n// Setting 'chunk_number' equal to 0 will return the last chunk in a set.\n// Returns true if the chunk is found, false otherwise. Image related chunk\n// payloads are accessed through WebPDemuxGetFrame() and related functions.\n// Call WebPDemuxReleaseChunkIterator() when use of the iterator is complete.\n// NOTE: 'dmux' must persist for the lifetime of the iterator.\nWEBP_EXTERN(int) WebPDemuxGetChunk(const WebPDemuxer* dmux,\n                                   const char fourcc[4], int chunk_number,\n                                   WebPChunkIterator* iter);\n\n// Sets 'iter->chunk' to point to the next ('iter->chunk_num' + 1) or previous\n// ('iter->chunk_num' - 1) chunk. These functions do not loop.\n// Returns true on success, false otherwise.\nWEBP_EXTERN(int) WebPDemuxNextChunk(WebPChunkIterator* iter);\nWEBP_EXTERN(int) WebPDemuxPrevChunk(WebPChunkIterator* iter);\n\n// Releases any memory associated with 'iter'.\n// Must be called before destroying the associated WebPDemuxer with\n// WebPDemuxDelete().\nWEBP_EXTERN(void) WebPDemuxReleaseChunkIterator(WebPChunkIterator* iter);\n\n//------------------------------------------------------------------------------\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_WEBP_DEMUX_H_ */\n"
  },
  {
    "path": "ext/libwebp/webp/encode.h",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n//   WebP encoder: main interface\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_WEBP_ENCODE_H_\n#define WEBP_WEBP_ENCODE_H_\n\n#include \"./types.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#define WEBP_ENCODER_ABI_VERSION 0x0202    // MAJOR(8b) + MINOR(8b)\n\n// Note: forward declaring enumerations is not allowed in (strict) C and C++,\n// the types are left here for reference.\n// typedef enum WebPImageHint WebPImageHint;\n// typedef enum WebPEncCSP WebPEncCSP;\n// typedef enum WebPPreset WebPPreset;\n// typedef enum WebPEncodingError WebPEncodingError;\ntypedef struct WebPConfig WebPConfig;\ntypedef struct WebPPicture WebPPicture;   // main structure for I/O\ntypedef struct WebPAuxStats WebPAuxStats;\ntypedef struct WebPMemoryWriter WebPMemoryWriter;\n\n// Return the encoder's version number, packed in hexadecimal using 8bits for\n// each of major/minor/revision. E.g: v2.5.7 is 0x020507.\nWEBP_EXTERN(int) WebPGetEncoderVersion(void);\n\n//------------------------------------------------------------------------------\n// One-stop-shop call! No questions asked:\n\n// Returns the size of the compressed data (pointed to by *output), or 0 if\n// an error occurred. The compressed data must be released by the caller\n// using the call 'free(*output)'.\n// These functions compress using the lossy format, and the quality_factor\n// can go from 0 (smaller output, lower quality) to 100 (best quality,\n// larger output).\nWEBP_EXTERN(size_t) WebPEncodeRGB(const uint8_t* rgb,\n                                  int width, int height, int stride,\n                                  float quality_factor, uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeBGR(const uint8_t* bgr,\n                                  int width, int height, int stride,\n                                  float quality_factor, uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeRGBA(const uint8_t* rgba,\n                                   int width, int height, int stride,\n                                   float quality_factor, uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeBGRA(const uint8_t* bgra,\n                                   int width, int height, int stride,\n                                   float quality_factor, uint8_t** output);\n\n// These functions are the equivalent of the above, but compressing in a\n// lossless manner. Files are usually larger than lossy format, but will\n// not suffer any compression loss.\nWEBP_EXTERN(size_t) WebPEncodeLosslessRGB(const uint8_t* rgb,\n                                          int width, int height, int stride,\n                                          uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeLosslessBGR(const uint8_t* bgr,\n                                          int width, int height, int stride,\n                                          uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeLosslessRGBA(const uint8_t* rgba,\n                                           int width, int height, int stride,\n                                           uint8_t** output);\nWEBP_EXTERN(size_t) WebPEncodeLosslessBGRA(const uint8_t* bgra,\n                                           int width, int height, int stride,\n                                           uint8_t** output);\n\n//------------------------------------------------------------------------------\n// Coding parameters\n\n// Image characteristics hint for the underlying encoder.\ntypedef enum WebPImageHint {\n  WEBP_HINT_DEFAULT = 0,  // default preset.\n  WEBP_HINT_PICTURE,      // digital picture, like portrait, inner shot\n  WEBP_HINT_PHOTO,        // outdoor photograph, with natural lighting\n  WEBP_HINT_GRAPH,        // Discrete tone image (graph, map-tile etc).\n  WEBP_HINT_LAST\n} WebPImageHint;\n\n// Compression parameters.\nstruct WebPConfig {\n  int lossless;           // Lossless encoding (0=lossy(default), 1=lossless).\n  float quality;          // between 0 (smallest file) and 100 (biggest)\n  int method;             // quality/speed trade-off (0=fast, 6=slower-better)\n\n  WebPImageHint image_hint;  // Hint for image type (lossless only for now).\n\n  // Parameters related to lossy compression only:\n  int target_size;        // if non-zero, set the desired target size in bytes.\n                          // Takes precedence over the 'compression' parameter.\n  float target_PSNR;      // if non-zero, specifies the minimal distortion to\n                          // try to achieve. Takes precedence over target_size.\n  int segments;           // maximum number of segments to use, in [1..4]\n  int sns_strength;       // Spatial Noise Shaping. 0=off, 100=maximum.\n  int filter_strength;    // range: [0 = off .. 100 = strongest]\n  int filter_sharpness;   // range: [0 = off .. 7 = least sharp]\n  int filter_type;        // filtering type: 0 = simple, 1 = strong (only used\n                          // if filter_strength > 0 or autofilter > 0)\n  int autofilter;         // Auto adjust filter's strength [0 = off, 1 = on]\n  int alpha_compression;  // Algorithm for encoding the alpha plane (0 = none,\n                          // 1 = compressed with WebP lossless). Default is 1.\n  int alpha_filtering;    // Predictive filtering method for alpha plane.\n                          //  0: none, 1: fast, 2: best. Default if 1.\n  int alpha_quality;      // Between 0 (smallest size) and 100 (lossless).\n                          // Default is 100.\n  int pass;               // number of entropy-analysis passes (in [1..10]).\n\n  int show_compressed;    // if true, export the compressed picture back.\n                          // In-loop filtering is not applied.\n  int preprocessing;      // preprocessing filter:\n                          // 0=none, 1=segment-smooth, 2=pseudo-random dithering\n  int partitions;         // log2(number of token partitions) in [0..3]. Default\n                          // is set to 0 for easier progressive decoding.\n  int partition_limit;    // quality degradation allowed to fit the 512k limit\n                          // on prediction modes coding (0: no degradation,\n                          // 100: maximum possible degradation).\n  int emulate_jpeg_size;  // If true, compression parameters will be remapped\n                          // to better match the expected output size from\n                          // JPEG compression. Generally, the output size will\n                          // be similar but the degradation will be lower.\n  int thread_level;       // If non-zero, try and use multi-threaded encoding.\n  int low_memory;         // If set, reduce memory usage (but increase CPU use).\n\n  uint32_t pad[5];        // padding for later use\n};\n\n// Enumerate some predefined settings for WebPConfig, depending on the type\n// of source picture. These presets are used when calling WebPConfigPreset().\ntypedef enum WebPPreset {\n  WEBP_PRESET_DEFAULT = 0,  // default preset.\n  WEBP_PRESET_PICTURE,      // digital picture, like portrait, inner shot\n  WEBP_PRESET_PHOTO,        // outdoor photograph, with natural lighting\n  WEBP_PRESET_DRAWING,      // hand or line drawing, with high-contrast details\n  WEBP_PRESET_ICON,         // small-sized colorful images\n  WEBP_PRESET_TEXT          // text-like\n} WebPPreset;\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPConfigInitInternal(WebPConfig*, WebPPreset, float, int);\n\n// Should always be called, to initialize a fresh WebPConfig structure before\n// modification. Returns false in case of version mismatch. WebPConfigInit()\n// must have succeeded before using the 'config' object.\n// Note that the default values are lossless=0 and quality=75.\nstatic WEBP_INLINE int WebPConfigInit(WebPConfig* config) {\n  return WebPConfigInitInternal(config, WEBP_PRESET_DEFAULT, 75.f,\n                                WEBP_ENCODER_ABI_VERSION);\n}\n\n// This function will initialize the configuration according to a predefined\n// set of parameters (referred to by 'preset') and a given quality factor.\n// This function can be called as a replacement to WebPConfigInit(). Will\n// return false in case of error.\nstatic WEBP_INLINE int WebPConfigPreset(WebPConfig* config,\n                                        WebPPreset preset, float quality) {\n  return WebPConfigInitInternal(config, preset, quality,\n                                WEBP_ENCODER_ABI_VERSION);\n}\n\n#if WEBP_ENCODER_ABI_VERSION > 0x0202\n// Activate the lossless compression mode with the desired efficiency level\n// between 0 (fastest, lowest compression) and 9 (slower, best compression).\n// A good default level is '6', providing a fair tradeoff between compression\n// speed and final compressed size.\n// This function will overwrite several fields from config: 'method', 'quality'\n// and 'lossless'. Returns false in case of parameter error.\nWEBP_EXTERN(int) WebPConfigLosslessPreset(WebPConfig* config, int level);\n#endif\n\n// Returns true if 'config' is non-NULL and all configuration parameters are\n// within their valid ranges.\nWEBP_EXTERN(int) WebPValidateConfig(const WebPConfig* config);\n\n//------------------------------------------------------------------------------\n// Input / Output\n// Structure for storing auxiliary statistics (mostly for lossy encoding).\n\nstruct WebPAuxStats {\n  int coded_size;         // final size\n\n  float PSNR[5];          // peak-signal-to-noise ratio for Y/U/V/All/Alpha\n  int block_count[3];     // number of intra4/intra16/skipped macroblocks\n  int header_bytes[2];    // approximate number of bytes spent for header\n                          // and mode-partition #0\n  int residual_bytes[3][4];  // approximate number of bytes spent for\n                             // DC/AC/uv coefficients for each (0..3) segments.\n  int segment_size[4];    // number of macroblocks in each segments\n  int segment_quant[4];   // quantizer values for each segments\n  int segment_level[4];   // filtering strength for each segments [0..63]\n\n  int alpha_data_size;    // size of the transparency data\n  int layer_data_size;    // size of the enhancement layer data\n\n  // lossless encoder statistics\n  uint32_t lossless_features;  // bit0:predictor bit1:cross-color transform\n                               // bit2:subtract-green bit3:color indexing\n  int histogram_bits;          // number of precision bits of histogram\n  int transform_bits;          // precision bits for transform\n  int cache_bits;              // number of bits for color cache lookup\n  int palette_size;            // number of color in palette, if used\n  int lossless_size;           // final lossless size\n\n  uint32_t pad[4];        // padding for later use\n};\n\n// Signature for output function. Should return true if writing was successful.\n// data/data_size is the segment of data to write, and 'picture' is for\n// reference (and so one can make use of picture->custom_ptr).\ntypedef int (*WebPWriterFunction)(const uint8_t* data, size_t data_size,\n                                  const WebPPicture* picture);\n\n// WebPMemoryWrite: a special WebPWriterFunction that writes to memory using\n// the following WebPMemoryWriter object (to be set as a custom_ptr).\nstruct WebPMemoryWriter {\n  uint8_t* mem;       // final buffer (of size 'max_size', larger than 'size').\n  size_t   size;      // final size\n  size_t   max_size;  // total capacity\n  uint32_t pad[1];    // padding for later use\n};\n\n// The following must be called first before any use.\nWEBP_EXTERN(void) WebPMemoryWriterInit(WebPMemoryWriter* writer);\n\n#if WEBP_ENCODER_ABI_VERSION > 0x0203\n// The following must be called to deallocate writer->mem memory. The 'writer'\n// object itself is not deallocated.\nWEBP_EXTERN(void) WebPMemoryWriterClear(WebPMemoryWriter* writer);\n#endif\n// The custom writer to be used with WebPMemoryWriter as custom_ptr. Upon\n// completion, writer.mem and writer.size will hold the coded data.\n#if WEBP_ENCODER_ABI_VERSION > 0x0203\n// writer.mem must be freed by calling WebPMemoryWriterClear.\n#else\n// writer.mem must be freed by calling 'free(writer.mem)'.\n#endif\nWEBP_EXTERN(int) WebPMemoryWrite(const uint8_t* data, size_t data_size,\n                                 const WebPPicture* picture);\n\n// Progress hook, called from time to time to report progress. It can return\n// false to request an abort of the encoding process, or true otherwise if\n// everything is OK.\ntypedef int (*WebPProgressHook)(int percent, const WebPPicture* picture);\n\n// Color spaces.\ntypedef enum WebPEncCSP {\n  // chroma sampling\n  WEBP_YUV420  = 0,        // 4:2:0\n  WEBP_YUV420A = 4,        // alpha channel variant\n  WEBP_CSP_UV_MASK = 3,    // bit-mask to get the UV sampling factors\n  WEBP_CSP_ALPHA_BIT = 4   // bit that is set if alpha is present\n} WebPEncCSP;\n\n// Encoding error conditions.\ntypedef enum WebPEncodingError {\n  VP8_ENC_OK = 0,\n  VP8_ENC_ERROR_OUT_OF_MEMORY,            // memory error allocating objects\n  VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY,  // memory error while flushing bits\n  VP8_ENC_ERROR_NULL_PARAMETER,           // a pointer parameter is NULL\n  VP8_ENC_ERROR_INVALID_CONFIGURATION,    // configuration is invalid\n  VP8_ENC_ERROR_BAD_DIMENSION,            // picture has invalid width/height\n  VP8_ENC_ERROR_PARTITION0_OVERFLOW,      // partition is bigger than 512k\n  VP8_ENC_ERROR_PARTITION_OVERFLOW,       // partition is bigger than 16M\n  VP8_ENC_ERROR_BAD_WRITE,                // error while flushing bytes\n  VP8_ENC_ERROR_FILE_TOO_BIG,             // file is bigger than 4G\n  VP8_ENC_ERROR_USER_ABORT,               // abort request by user\n  VP8_ENC_ERROR_LAST                      // list terminator. always last.\n} WebPEncodingError;\n\n// maximum width/height allowed (inclusive), in pixels\n#define WEBP_MAX_DIMENSION 16383\n\n// Main exchange structure (input samples, output bytes, statistics)\nstruct WebPPicture {\n  //   INPUT\n  //////////////\n  // Main flag for encoder selecting between ARGB or YUV input.\n  // It is recommended to use ARGB input (*argb, argb_stride) for lossless\n  // compression, and YUV input (*y, *u, *v, etc.) for lossy compression\n  // since these are the respective native colorspace for these formats.\n  int use_argb;\n\n  // YUV input (mostly used for input to lossy compression)\n  WebPEncCSP colorspace;     // colorspace: should be YUV420 for now (=Y'CbCr).\n  int width, height;         // dimensions (less or equal to WEBP_MAX_DIMENSION)\n  uint8_t *y, *u, *v;        // pointers to luma/chroma planes.\n  int y_stride, uv_stride;   // luma/chroma strides.\n  uint8_t* a;                // pointer to the alpha plane\n  int a_stride;              // stride of the alpha plane\n  uint32_t pad1[2];          // padding for later use\n\n  // ARGB input (mostly used for input to lossless compression)\n  uint32_t* argb;            // Pointer to argb (32 bit) plane.\n  int argb_stride;           // This is stride in pixels units, not bytes.\n  uint32_t pad2[3];          // padding for later use\n\n  //   OUTPUT\n  ///////////////\n  // Byte-emission hook, to store compressed bytes as they are ready.\n  WebPWriterFunction writer;  // can be NULL\n  void* custom_ptr;           // can be used by the writer.\n\n  // map for extra information (only for lossy compression mode)\n  int extra_info_type;    // 1: intra type, 2: segment, 3: quant\n                          // 4: intra-16 prediction mode,\n                          // 5: chroma prediction mode,\n                          // 6: bit cost, 7: distortion\n  uint8_t* extra_info;    // if not NULL, points to an array of size\n                          // ((width + 15) / 16) * ((height + 15) / 16) that\n                          // will be filled with a macroblock map, depending\n                          // on extra_info_type.\n\n  //   STATS AND REPORTS\n  ///////////////////////////\n  // Pointer to side statistics (updated only if not NULL)\n  WebPAuxStats* stats;\n\n  // Error code for the latest error encountered during encoding\n  WebPEncodingError error_code;\n\n  // If not NULL, report progress during encoding.\n  WebPProgressHook progress_hook;\n\n  void* user_data;        // this field is free to be set to any value and\n                          // used during callbacks (like progress-report e.g.).\n\n  uint32_t pad3[3];       // padding for later use\n\n  // Unused for now\n  uint8_t *pad4, *pad5;\n  uint32_t pad6[8];       // padding for later use\n\n  // PRIVATE FIELDS\n  ////////////////////\n  void* memory_;          // row chunk of memory for yuva planes\n  void* memory_argb_;     // and for argb too.\n  void* pad7[2];          // padding for later use\n};\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(int) WebPPictureInitInternal(WebPPicture*, int);\n\n// Should always be called, to initialize the structure. Returns false in case\n// of version mismatch. WebPPictureInit() must have succeeded before using the\n// 'picture' object.\n// Note that, by default, use_argb is false and colorspace is WEBP_YUV420.\nstatic WEBP_INLINE int WebPPictureInit(WebPPicture* picture) {\n  return WebPPictureInitInternal(picture, WEBP_ENCODER_ABI_VERSION);\n}\n\n//------------------------------------------------------------------------------\n// WebPPicture utils\n\n// Convenience allocation / deallocation based on picture->width/height:\n// Allocate y/u/v buffers as per colorspace/width/height specification.\n// Note! This function will free the previous buffer if needed.\n// Returns false in case of memory error.\nWEBP_EXTERN(int) WebPPictureAlloc(WebPPicture* picture);\n\n// Release the memory allocated by WebPPictureAlloc() or WebPPictureImport*().\n// Note that this function does _not_ free the memory used by the 'picture'\n// object itself.\n// Besides memory (which is reclaimed) all other fields of 'picture' are\n// preserved.\nWEBP_EXTERN(void) WebPPictureFree(WebPPicture* picture);\n\n// Copy the pixels of *src into *dst, using WebPPictureAlloc. Upon return, *dst\n// will fully own the copied pixels (this is not a view). The 'dst' picture need\n// not be initialized as its content is overwritten.\n// Returns false in case of memory allocation error.\nWEBP_EXTERN(int) WebPPictureCopy(const WebPPicture* src, WebPPicture* dst);\n\n// Compute PSNR, SSIM or LSIM distortion metric between two pictures.\n// Result is in dB, stores in result[] in the Y/U/V/Alpha/All order.\n// Returns false in case of error (src and ref don't have same dimension, ...)\n// Warning: this function is rather CPU-intensive.\nWEBP_EXTERN(int) WebPPictureDistortion(\n    const WebPPicture* src, const WebPPicture* ref,\n    int metric_type,           // 0 = PSNR, 1 = SSIM, 2 = LSIM\n    float result[5]);\n\n// self-crops a picture to the rectangle defined by top/left/width/height.\n// Returns false in case of memory allocation error, or if the rectangle is\n// outside of the source picture.\n// The rectangle for the view is defined by the top-left corner pixel\n// coordinates (left, top) as well as its width and height. This rectangle\n// must be fully be comprised inside the 'src' source picture. If the source\n// picture uses the YUV420 colorspace, the top and left coordinates will be\n// snapped to even values.\nWEBP_EXTERN(int) WebPPictureCrop(WebPPicture* picture,\n                                 int left, int top, int width, int height);\n\n// Extracts a view from 'src' picture into 'dst'. The rectangle for the view\n// is defined by the top-left corner pixel coordinates (left, top) as well\n// as its width and height. This rectangle must be fully be comprised inside\n// the 'src' source picture. If the source picture uses the YUV420 colorspace,\n// the top and left coordinates will be snapped to even values.\n// Picture 'src' must out-live 'dst' picture. Self-extraction of view is allowed\n// ('src' equal to 'dst') as a mean of fast-cropping (but note that doing so,\n// the original dimension will be lost). Picture 'dst' need not be initialized\n// with WebPPictureInit() if it is different from 'src', since its content will\n// be overwritten.\n// Returns false in case of memory allocation error or invalid parameters.\nWEBP_EXTERN(int) WebPPictureView(const WebPPicture* src,\n                                 int left, int top, int width, int height,\n                                 WebPPicture* dst);\n\n// Returns true if the 'picture' is actually a view and therefore does\n// not own the memory for pixels.\nWEBP_EXTERN(int) WebPPictureIsView(const WebPPicture* picture);\n\n// Rescale a picture to new dimension width x height.\n// Now gamma correction is applied.\n// Returns false in case of error (invalid parameter or insufficient memory).\nWEBP_EXTERN(int) WebPPictureRescale(WebPPicture* pic, int width, int height);\n\n// Colorspace conversion function to import RGB samples.\n// Previous buffer will be free'd, if any.\n// *rgb buffer should have a size of at least height * rgb_stride.\n// Returns false in case of memory error.\nWEBP_EXTERN(int) WebPPictureImportRGB(\n    WebPPicture* picture, const uint8_t* rgb, int rgb_stride);\n// Same, but for RGBA buffer.\nWEBP_EXTERN(int) WebPPictureImportRGBA(\n    WebPPicture* picture, const uint8_t* rgba, int rgba_stride);\n// Same, but for RGBA buffer. Imports the RGB direct from the 32-bit format\n// input buffer ignoring the alpha channel. Avoids needing to copy the data\n// to a temporary 24-bit RGB buffer to import the RGB only.\nWEBP_EXTERN(int) WebPPictureImportRGBX(\n    WebPPicture* picture, const uint8_t* rgbx, int rgbx_stride);\n\n// Variants of the above, but taking BGR(A|X) input.\nWEBP_EXTERN(int) WebPPictureImportBGR(\n    WebPPicture* picture, const uint8_t* bgr, int bgr_stride);\nWEBP_EXTERN(int) WebPPictureImportBGRA(\n    WebPPicture* picture, const uint8_t* bgra, int bgra_stride);\nWEBP_EXTERN(int) WebPPictureImportBGRX(\n    WebPPicture* picture, const uint8_t* bgrx, int bgrx_stride);\n\n// Converts picture->argb data to the YUV420A format. The 'colorspace'\n// parameter is deprecated and should be equal to WEBP_YUV420.\n// Upon return, picture->use_argb is set to false. The presence of real\n// non-opaque transparent values is detected, and 'colorspace' will be\n// adjusted accordingly. Note that this method is lossy.\n// Returns false in case of error.\nWEBP_EXTERN(int) WebPPictureARGBToYUVA(WebPPicture* picture,\n                                       WebPEncCSP /*colorspace = WEBP_YUV420*/);\n\n// Same as WebPPictureARGBToYUVA(), but the conversion is done using\n// pseudo-random dithering with a strength 'dithering' between\n// 0.0 (no dithering) and 1.0 (maximum dithering). This is useful\n// for photographic picture.\nWEBP_EXTERN(int) WebPPictureARGBToYUVADithered(\n    WebPPicture* picture, WebPEncCSP colorspace, float dithering);\n\n#if WEBP_ENCODER_ABI_VERSION > 0x0204\n// Performs 'smart' RGBA->YUVA420 downsampling and colorspace conversion.\n// Downsampling is handled with extra care in case of color clipping. This\n// method is roughly 2x slower than WebPPictureARGBToYUVA() but produces better\n// YUV representation.\n// Returns false in case of error.\nWEBP_EXTERN(int) WebPPictureSmartARGBToYUVA(WebPPicture* picture);\n#endif\n\n// Converts picture->yuv to picture->argb and sets picture->use_argb to true.\n// The input format must be YUV_420 or YUV_420A.\n// Note that the use of this method is discouraged if one has access to the\n// raw ARGB samples, since using YUV420 is comparatively lossy. Also, the\n// conversion from YUV420 to ARGB incurs a small loss too.\n// Returns false in case of error.\nWEBP_EXTERN(int) WebPPictureYUVAToARGB(WebPPicture* picture);\n\n// Helper function: given a width x height plane of RGBA or YUV(A) samples\n// clean-up the YUV or RGB samples under fully transparent area, to help\n// compressibility (no guarantee, though).\nWEBP_EXTERN(void) WebPCleanupTransparentArea(WebPPicture* picture);\n\n// Scan the picture 'picture' for the presence of non fully opaque alpha values.\n// Returns true in such case. Otherwise returns false (indicating that the\n// alpha plane can be ignored altogether e.g.).\nWEBP_EXTERN(int) WebPPictureHasTransparency(const WebPPicture* picture);\n\n// Remove the transparency information (if present) by blending the color with\n// the background color 'background_rgb' (specified as 24bit RGB triplet).\n// After this call, all alpha values are reset to 0xff.\nWEBP_EXTERN(void) WebPBlendAlpha(WebPPicture* pic, uint32_t background_rgb);\n\n//------------------------------------------------------------------------------\n// Main call\n\n// Main encoding call, after config and picture have been initialized.\n// 'picture' must be less than 16384x16384 in dimension (cf WEBP_MAX_DIMENSION),\n// and the 'config' object must be a valid one.\n// Returns false in case of error, true otherwise.\n// In case of error, picture->error_code is updated accordingly.\n// 'picture' can hold the source samples in both YUV(A) or ARGB input, depending\n// on the value of 'picture->use_argb'. It is highly recommended to use\n// the former for lossy encoding, and the latter for lossless encoding\n// (when config.lossless is true). Automatic conversion from one format to\n// another is provided but they both incur some loss.\nWEBP_EXTERN(int) WebPEncode(const WebPConfig* config, WebPPicture* picture);\n\n//------------------------------------------------------------------------------\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_WEBP_ENCODE_H_ */\n"
  },
  {
    "path": "ext/libwebp/webp/format_constants.h",
    "content": "// Copyright 2012 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n//  Internal header for constants related to WebP file format.\n//\n// Author: Urvang (urvang@google.com)\n\n#ifndef WEBP_WEBP_FORMAT_CONSTANTS_H_\n#define WEBP_WEBP_FORMAT_CONSTANTS_H_\n\n// Create fourcc of the chunk from the chunk tag characters.\n#define MKFOURCC(a, b, c, d) ((uint32_t)(a) | (b) << 8 | (c) << 16 | (d) << 24)\n\n// VP8 related constants.\n#define VP8_SIGNATURE 0x9d012a              // Signature in VP8 data.\n#define VP8_MAX_PARTITION0_SIZE (1 << 19)   // max size of mode partition\n#define VP8_MAX_PARTITION_SIZE  (1 << 24)   // max size for token partition\n#define VP8_FRAME_HEADER_SIZE 10  // Size of the frame header within VP8 data.\n\n// VP8L related constants.\n#define VP8L_SIGNATURE_SIZE          1      // VP8L signature size.\n#define VP8L_MAGIC_BYTE              0x2f   // VP8L signature byte.\n#define VP8L_IMAGE_SIZE_BITS         14     // Number of bits used to store\n                                            // width and height.\n#define VP8L_VERSION_BITS            3      // 3 bits reserved for version.\n#define VP8L_VERSION                 0      // version 0\n#define VP8L_FRAME_HEADER_SIZE       5      // Size of the VP8L frame header.\n\n#define MAX_PALETTE_SIZE             256\n#define MAX_CACHE_BITS               11\n#define HUFFMAN_CODES_PER_META_CODE  5\n#define ARGB_BLACK                   0xff000000\n\n#define DEFAULT_CODE_LENGTH          8\n#define MAX_ALLOWED_CODE_LENGTH      15\n\n#define NUM_LITERAL_CODES            256\n#define NUM_LENGTH_CODES             24\n#define NUM_DISTANCE_CODES           40\n#define CODE_LENGTH_CODES            19\n\n#define MIN_HUFFMAN_BITS             2  // min number of Huffman bits\n#define MAX_HUFFMAN_BITS             9  // max number of Huffman bits\n\n#define TRANSFORM_PRESENT            1  // The bit to be written when next data\n                                        // to be read is a transform.\n#define NUM_TRANSFORMS               4  // Maximum number of allowed transform\n                                        // in a bitstream.\ntypedef enum {\n  PREDICTOR_TRANSFORM      = 0,\n  CROSS_COLOR_TRANSFORM    = 1,\n  SUBTRACT_GREEN           = 2,\n  COLOR_INDEXING_TRANSFORM = 3\n} VP8LImageTransformType;\n\n// Alpha related constants.\n#define ALPHA_HEADER_LEN            1\n#define ALPHA_NO_COMPRESSION        0\n#define ALPHA_LOSSLESS_COMPRESSION  1\n#define ALPHA_PREPROCESSED_LEVELS   1\n\n// Mux related constants.\n#define TAG_SIZE           4     // Size of a chunk tag (e.g. \"VP8L\").\n#define CHUNK_SIZE_BYTES   4     // Size needed to store chunk's size.\n#define CHUNK_HEADER_SIZE  8     // Size of a chunk header.\n#define RIFF_HEADER_SIZE   12    // Size of the RIFF header (\"RIFFnnnnWEBP\").\n#define ANMF_CHUNK_SIZE    16    // Size of an ANMF chunk.\n#define ANIM_CHUNK_SIZE    6     // Size of an ANIM chunk.\n#define FRGM_CHUNK_SIZE    6     // Size of a FRGM chunk.\n#define VP8X_CHUNK_SIZE    10    // Size of a VP8X chunk.\n\n#define MAX_CANVAS_SIZE     (1 << 24)     // 24-bit max for VP8X width/height.\n#define MAX_IMAGE_AREA      (1ULL << 32)  // 32-bit max for width x height.\n#define MAX_LOOP_COUNT      (1 << 16)     // maximum value for loop-count\n#define MAX_DURATION        (1 << 24)     // maximum duration\n#define MAX_POSITION_OFFSET (1 << 24)     // maximum frame/fragment x/y offset\n\n// Maximum chunk payload is such that adding the header and padding won't\n// overflow a uint32_t.\n#define MAX_CHUNK_PAYLOAD (~0U - CHUNK_HEADER_SIZE - 1)\n\n#endif  /* WEBP_WEBP_FORMAT_CONSTANTS_H_ */\n"
  },
  {
    "path": "ext/libwebp/webp/mux.h",
    "content": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n//  RIFF container manipulation for WebP images.\n//\n// Authors: Urvang (urvang@google.com)\n//          Vikas (vikasa@google.com)\n\n// This API allows manipulation of WebP container images containing features\n// like color profile, metadata, animation and fragmented images.\n//\n// Code Example#1: Create a WebPMux object with image data, color profile and\n// XMP metadata.\n/*\n  int copy_data = 0;\n  WebPMux* mux = WebPMuxNew();\n  // ... (Prepare image data).\n  WebPMuxSetImage(mux, &image, copy_data);\n  // ... (Prepare ICCP color profile data).\n  WebPMuxSetChunk(mux, \"ICCP\", &icc_profile, copy_data);\n  // ... (Prepare XMP metadata).\n  WebPMuxSetChunk(mux, \"XMP \", &xmp, copy_data);\n  // Get data from mux in WebP RIFF format.\n  WebPMuxAssemble(mux, &output_data);\n  WebPMuxDelete(mux);\n  // ... (Consume output_data; e.g. write output_data.bytes to file).\n  WebPDataClear(&output_data);\n*/\n\n// Code Example#2: Get image and color profile data from a WebP file.\n/*\n  int copy_data = 0;\n  // ... (Read data from file).\n  WebPMux* mux = WebPMuxCreate(&data, copy_data);\n  WebPMuxGetFrame(mux, 1, &image);\n  // ... (Consume image; e.g. call WebPDecode() to decode the data).\n  WebPMuxGetChunk(mux, \"ICCP\", &icc_profile);\n  // ... (Consume icc_data).\n  WebPMuxDelete(mux);\n  free(data);\n*/\n\n#ifndef WEBP_WEBP_MUX_H_\n#define WEBP_WEBP_MUX_H_\n\n#include \"./mux_types.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#define WEBP_MUX_ABI_VERSION 0x0101        // MAJOR(8b) + MINOR(8b)\n\n// Note: forward declaring enumerations is not allowed in (strict) C and C++,\n// the types are left here for reference.\n// typedef enum WebPMuxError WebPMuxError;\n// typedef enum WebPChunkId WebPChunkId;\ntypedef struct WebPMux WebPMux;   // main opaque object.\ntypedef struct WebPMuxFrameInfo WebPMuxFrameInfo;\ntypedef struct WebPMuxAnimParams WebPMuxAnimParams;\n\n// Error codes\ntypedef enum WebPMuxError {\n  WEBP_MUX_OK                 =  1,\n  WEBP_MUX_NOT_FOUND          =  0,\n  WEBP_MUX_INVALID_ARGUMENT   = -1,\n  WEBP_MUX_BAD_DATA           = -2,\n  WEBP_MUX_MEMORY_ERROR       = -3,\n  WEBP_MUX_NOT_ENOUGH_DATA    = -4\n} WebPMuxError;\n\n// IDs for different types of chunks.\ntypedef enum WebPChunkId {\n  WEBP_CHUNK_VP8X,     // VP8X\n  WEBP_CHUNK_ICCP,     // ICCP\n  WEBP_CHUNK_ANIM,     // ANIM\n  WEBP_CHUNK_ANMF,     // ANMF\n  WEBP_CHUNK_FRGM,     // FRGM\n  WEBP_CHUNK_ALPHA,    // ALPH\n  WEBP_CHUNK_IMAGE,    // VP8/VP8L\n  WEBP_CHUNK_EXIF,     // EXIF\n  WEBP_CHUNK_XMP,      // XMP\n  WEBP_CHUNK_UNKNOWN,  // Other chunks.\n  WEBP_CHUNK_NIL\n} WebPChunkId;\n\n//------------------------------------------------------------------------------\n\n// Returns the version number of the mux library, packed in hexadecimal using\n// 8bits for each of major/minor/revision. E.g: v2.5.7 is 0x020507.\nWEBP_EXTERN(int) WebPGetMuxVersion(void);\n\n//------------------------------------------------------------------------------\n// Life of a Mux object\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(WebPMux*) WebPNewInternal(int);\n\n// Creates an empty mux object.\n// Returns:\n//   A pointer to the newly created empty mux object.\n//   Or NULL in case of memory error.\nstatic WEBP_INLINE WebPMux* WebPMuxNew(void) {\n  return WebPNewInternal(WEBP_MUX_ABI_VERSION);\n}\n\n// Deletes the mux object.\n// Parameters:\n//   mux - (in/out) object to be deleted\nWEBP_EXTERN(void) WebPMuxDelete(WebPMux* mux);\n\n//------------------------------------------------------------------------------\n// Mux creation.\n\n// Internal, version-checked, entry point\nWEBP_EXTERN(WebPMux*) WebPMuxCreateInternal(const WebPData*, int, int);\n\n// Creates a mux object from raw data given in WebP RIFF format.\n// Parameters:\n//   bitstream - (in) the bitstream data in WebP RIFF format\n//   copy_data - (in) value 1 indicates given data WILL be copied to the mux\n//               object and value 0 indicates data will NOT be copied.\n// Returns:\n//   A pointer to the mux object created from given data - on success.\n//   NULL - In case of invalid data or memory error.\nstatic WEBP_INLINE WebPMux* WebPMuxCreate(const WebPData* bitstream,\n                                          int copy_data) {\n  return WebPMuxCreateInternal(bitstream, copy_data, WEBP_MUX_ABI_VERSION);\n}\n\n//------------------------------------------------------------------------------\n// Non-image chunks.\n\n// Note: Only non-image related chunks should be managed through chunk APIs.\n// (Image related chunks are: \"ANMF\", \"FRGM\", \"VP8 \", \"VP8L\" and \"ALPH\").\n// To add, get and delete images, use WebPMuxSetImage(), WebPMuxPushFrame(),\n// WebPMuxGetFrame() and WebPMuxDeleteFrame().\n\n// Adds a chunk with id 'fourcc' and data 'chunk_data' in the mux object.\n// Any existing chunk(s) with the same id will be removed.\n// Parameters:\n//   mux - (in/out) object to which the chunk is to be added\n//   fourcc - (in) a character array containing the fourcc of the given chunk;\n//                 e.g., \"ICCP\", \"XMP \", \"EXIF\" etc.\n//   chunk_data - (in) the chunk data to be added\n//   copy_data - (in) value 1 indicates given data WILL be copied to the mux\n//               object and value 0 indicates data will NOT be copied.\n// Returns:\n//   WEBP_MUX_INVALID_ARGUMENT - if mux, fourcc or chunk_data is NULL\n//                               or if fourcc corresponds to an image chunk.\n//   WEBP_MUX_MEMORY_ERROR - on memory allocation error.\n//   WEBP_MUX_OK - on success.\nWEBP_EXTERN(WebPMuxError) WebPMuxSetChunk(\n    WebPMux* mux, const char fourcc[4], const WebPData* chunk_data,\n    int copy_data);\n\n// Gets a reference to the data of the chunk with id 'fourcc' in the mux object.\n// The caller should NOT free the returned data.\n// Parameters:\n//   mux - (in) object from which the chunk data is to be fetched\n//   fourcc - (in) a character array containing the fourcc of the chunk;\n//                 e.g., \"ICCP\", \"XMP \", \"EXIF\" etc.\n//   chunk_data - (out) returned chunk data\n// Returns:\n//   WEBP_MUX_INVALID_ARGUMENT - if mux, fourcc or chunk_data is NULL\n//                               or if fourcc corresponds to an image chunk.\n//   WEBP_MUX_NOT_FOUND - If mux does not contain a chunk with the given id.\n//   WEBP_MUX_OK - on success.\nWEBP_EXTERN(WebPMuxError) WebPMuxGetChunk(\n    const WebPMux* mux, const char fourcc[4], WebPData* chunk_data);\n\n// Deletes the chunk with the given 'fourcc' from the mux object.\n// Parameters:\n//   mux - (in/out) object from which the chunk is to be deleted\n//   fourcc - (in) a character array containing the fourcc of the chunk;\n//                 e.g., \"ICCP\", \"XMP \", \"EXIF\" etc.\n// Returns:\n//   WEBP_MUX_INVALID_ARGUMENT - if mux or fourcc is NULL\n//                               or if fourcc corresponds to an image chunk.\n//   WEBP_MUX_NOT_FOUND - If mux does not contain a chunk with the given fourcc.\n//   WEBP_MUX_OK - on success.\nWEBP_EXTERN(WebPMuxError) WebPMuxDeleteChunk(\n    WebPMux* mux, const char fourcc[4]);\n\n//------------------------------------------------------------------------------\n// Images.\n\n// Encapsulates data about a single frame/fragment.\nstruct WebPMuxFrameInfo {\n  WebPData    bitstream;  // image data: can be a raw VP8/VP8L bitstream\n                          // or a single-image WebP file.\n  int         x_offset;   // x-offset of the frame.\n  int         y_offset;   // y-offset of the frame.\n  int         duration;   // duration of the frame (in milliseconds).\n\n  WebPChunkId id;         // frame type: should be one of WEBP_CHUNK_ANMF,\n                          // WEBP_CHUNK_FRGM or WEBP_CHUNK_IMAGE\n  WebPMuxAnimDispose dispose_method;  // Disposal method for the frame.\n  WebPMuxAnimBlend   blend_method;    // Blend operation for the frame.\n  uint32_t    pad[1];     // padding for later use\n};\n\n// Sets the (non-animated and non-fragmented) image in the mux object.\n// Note: Any existing images (including frames/fragments) will be removed.\n// Parameters:\n//   mux - (in/out) object in which the image is to be set\n//   bitstream - (in) can be a raw VP8/VP8L bitstream or a single-image\n//               WebP file (non-animated and non-fragmented)\n//   copy_data - (in) value 1 indicates given data WILL be copied to the mux\n//               object and value 0 indicates data will NOT be copied.\n// Returns:\n//   WEBP_MUX_INVALID_ARGUMENT - if mux is NULL or bitstream is NULL.\n//   WEBP_MUX_MEMORY_ERROR - on memory allocation error.\n//   WEBP_MUX_OK - on success.\nWEBP_EXTERN(WebPMuxError) WebPMuxSetImage(\n    WebPMux* mux, const WebPData* bitstream, int copy_data);\n\n// Adds a frame at the end of the mux object.\n// Notes: (1) frame.id should be one of WEBP_CHUNK_ANMF or WEBP_CHUNK_FRGM\n//        (2) For setting a non-animated non-fragmented image, use\n//            WebPMuxSetImage() instead.\n//        (3) Type of frame being pushed must be same as the frames in mux.\n//        (4) As WebP only supports even offsets, any odd offset will be snapped\n//            to an even location using: offset &= ~1\n// Parameters:\n//   mux - (in/out) object to which the frame is to be added\n//   frame - (in) frame data.\n//   copy_data - (in) value 1 indicates given data WILL be copied to the mux\n//               object and value 0 indicates data will NOT be copied.\n// Returns:\n//   WEBP_MUX_INVALID_ARGUMENT - if mux or frame is NULL\n//                               or if content of 'frame' is invalid.\n//   WEBP_MUX_MEMORY_ERROR - on memory allocation error.\n//   WEBP_MUX_OK - on success.\nWEBP_EXTERN(WebPMuxError) WebPMuxPushFrame(\n    WebPMux* mux, const WebPMuxFrameInfo* frame, int copy_data);\n\n// Gets the nth frame from the mux object.\n// The content of 'frame->bitstream' is allocated using malloc(), and NOT\n// owned by the 'mux' object. It MUST be deallocated by the caller by calling\n// WebPDataClear().\n// nth=0 has a special meaning - last position.\n// Parameters:\n//   mux - (in) object from which the info is to be fetched\n//   nth - (in) index of the frame in the mux object\n//   frame - (out) data of the returned frame\n// Returns:\n//   WEBP_MUX_INVALID_ARGUMENT - if mux or frame is NULL.\n//   WEBP_MUX_NOT_FOUND - if there are less than nth frames in the mux object.\n//   WEBP_MUX_BAD_DATA - if nth frame chunk in mux is invalid.\n//   WEBP_MUX_MEMORY_ERROR - on memory allocation error.\n//   WEBP_MUX_OK - on success.\nWEBP_EXTERN(WebPMuxError) WebPMuxGetFrame(\n    const WebPMux* mux, uint32_t nth, WebPMuxFrameInfo* frame);\n\n// Deletes a frame from the mux object.\n// nth=0 has a special meaning - last position.\n// Parameters:\n//   mux - (in/out) object from which a frame is to be deleted\n//   nth - (in) The position from which the frame is to be deleted\n// Returns:\n//   WEBP_MUX_INVALID_ARGUMENT - if mux is NULL.\n//   WEBP_MUX_NOT_FOUND - If there are less than nth frames in the mux object\n//                        before deletion.\n//   WEBP_MUX_OK - on success.\nWEBP_EXTERN(WebPMuxError) WebPMuxDeleteFrame(WebPMux* mux, uint32_t nth);\n\n//------------------------------------------------------------------------------\n// Animation.\n\n// Animation parameters.\nstruct WebPMuxAnimParams {\n  uint32_t bgcolor;  // Background color of the canvas stored (in MSB order) as:\n                     // Bits 00 to 07: Alpha.\n                     // Bits 08 to 15: Red.\n                     // Bits 16 to 23: Green.\n                     // Bits 24 to 31: Blue.\n  int loop_count;    // Number of times to repeat the animation [0 = infinite].\n};\n\n// Sets the animation parameters in the mux object. Any existing ANIM chunks\n// will be removed.\n// Parameters:\n//   mux - (in/out) object in which ANIM chunk is to be set/added\n//   params - (in) animation parameters.\n// Returns:\n//   WEBP_MUX_INVALID_ARGUMENT - if mux or params is NULL.\n//   WEBP_MUX_MEMORY_ERROR - on memory allocation error.\n//   WEBP_MUX_OK - on success.\nWEBP_EXTERN(WebPMuxError) WebPMuxSetAnimationParams(\n    WebPMux* mux, const WebPMuxAnimParams* params);\n\n// Gets the animation parameters from the mux object.\n// Parameters:\n//   mux - (in) object from which the animation parameters to be fetched\n//   params - (out) animation parameters extracted from the ANIM chunk\n// Returns:\n//   WEBP_MUX_INVALID_ARGUMENT - if mux or params is NULL.\n//   WEBP_MUX_NOT_FOUND - if ANIM chunk is not present in mux object.\n//   WEBP_MUX_OK - on success.\nWEBP_EXTERN(WebPMuxError) WebPMuxGetAnimationParams(\n    const WebPMux* mux, WebPMuxAnimParams* params);\n\n//------------------------------------------------------------------------------\n// Misc Utilities.\n\n#if WEBP_MUX_ABI_VERSION > 0x0101\n// Sets the canvas size for the mux object. The width and height can be\n// specified explicitly or left as zero (0, 0).\n// * When width and height are specified explicitly, then this frame bound is\n//   enforced during subsequent calls to WebPMuxAssemble() and an error is\n//   reported if any animated frame does not completely fit within the canvas.\n// * When unspecified (0, 0), the constructed canvas will get the frame bounds\n//   from the bounding-box over all frames after calling WebPMuxAssemble().\n// Parameters:\n//   mux - (in) object to which the canvas size is to be set\n//   width - (in) canvas width\n//   height - (in) canvas height\n// Returns:\n//   WEBP_MUX_INVALID_ARGUMENT - if mux is NULL; or\n//                               width or height are invalid or out of bounds\n//   WEBP_MUX_OK - on success.\nWEBP_EXTERN(WebPMuxError) WebPMuxSetCanvasSize(WebPMux* mux,\n                                               int width, int height);\n#endif\n\n// Gets the canvas size from the mux object.\n// Note: This method assumes that the VP8X chunk, if present, is up-to-date.\n// That is, the mux object hasn't been modified since the last call to\n// WebPMuxAssemble() or WebPMuxCreate().\n// Parameters:\n//   mux - (in) object from which the canvas size is to be fetched\n//   width - (out) canvas width\n//   height - (out) canvas height\n// Returns:\n//   WEBP_MUX_INVALID_ARGUMENT - if mux, width or height is NULL.\n//   WEBP_MUX_BAD_DATA - if VP8X/VP8/VP8L chunk or canvas size is invalid.\n//   WEBP_MUX_OK - on success.\nWEBP_EXTERN(WebPMuxError) WebPMuxGetCanvasSize(const WebPMux* mux,\n                                               int* width, int* height);\n\n// Gets the feature flags from the mux object.\n// Note: This method assumes that the VP8X chunk, if present, is up-to-date.\n// That is, the mux object hasn't been modified since the last call to\n// WebPMuxAssemble() or WebPMuxCreate().\n// Parameters:\n//   mux - (in) object from which the features are to be fetched\n//   flags - (out) the flags specifying which features are present in the\n//           mux object. This will be an OR of various flag values.\n//           Enum 'WebPFeatureFlags' can be used to test individual flag values.\n// Returns:\n//   WEBP_MUX_INVALID_ARGUMENT - if mux or flags is NULL.\n//   WEBP_MUX_BAD_DATA - if VP8X/VP8/VP8L chunk or canvas size is invalid.\n//   WEBP_MUX_OK - on success.\nWEBP_EXTERN(WebPMuxError) WebPMuxGetFeatures(const WebPMux* mux,\n                                             uint32_t* flags);\n\n// Gets number of chunks with the given 'id' in the mux object.\n// Parameters:\n//   mux - (in) object from which the info is to be fetched\n//   id - (in) chunk id specifying the type of chunk\n//   num_elements - (out) number of chunks with the given chunk id\n// Returns:\n//   WEBP_MUX_INVALID_ARGUMENT - if mux, or num_elements is NULL.\n//   WEBP_MUX_OK - on success.\nWEBP_EXTERN(WebPMuxError) WebPMuxNumChunks(const WebPMux* mux,\n                                           WebPChunkId id, int* num_elements);\n\n// Assembles all chunks in WebP RIFF format and returns in 'assembled_data'.\n// This function also validates the mux object.\n// Note: The content of 'assembled_data' will be ignored and overwritten.\n// Also, the content of 'assembled_data' is allocated using malloc(), and NOT\n// owned by the 'mux' object. It MUST be deallocated by the caller by calling\n// WebPDataClear(). It's always safe to call WebPDataClear() upon return,\n// even in case of error.\n// Parameters:\n//   mux - (in/out) object whose chunks are to be assembled\n//   assembled_data - (out) assembled WebP data\n// Returns:\n//   WEBP_MUX_BAD_DATA - if mux object is invalid.\n//   WEBP_MUX_INVALID_ARGUMENT - if mux or assembled_data is NULL.\n//   WEBP_MUX_MEMORY_ERROR - on memory allocation error.\n//   WEBP_MUX_OK - on success.\nWEBP_EXTERN(WebPMuxError) WebPMuxAssemble(WebPMux* mux,\n                                          WebPData* assembled_data);\n\n//------------------------------------------------------------------------------\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_WEBP_MUX_H_ */\n"
  },
  {
    "path": "ext/libwebp/webp/mux_types.h",
    "content": "// Copyright 2012 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n// Data-types common to the mux and demux libraries.\n//\n// Author: Urvang (urvang@google.com)\n\n#ifndef WEBP_WEBP_MUX_TYPES_H_\n#define WEBP_WEBP_MUX_TYPES_H_\n\n#include <stdlib.h>  // free()\n#include <string.h>  // memset()\n#include \"./types.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n// Note: forward declaring enumerations is not allowed in (strict) C and C++,\n// the types are left here for reference.\n// typedef enum WebPFeatureFlags WebPFeatureFlags;\n// typedef enum WebPMuxAnimDispose WebPMuxAnimDispose;\n// typedef enum WebPMuxAnimBlend WebPMuxAnimBlend;\ntypedef struct WebPData WebPData;\n\n// VP8X Feature Flags.\ntypedef enum WebPFeatureFlags {\n  FRAGMENTS_FLAG  = 0x00000001,\n  ANIMATION_FLAG  = 0x00000002,\n  XMP_FLAG        = 0x00000004,\n  EXIF_FLAG       = 0x00000008,\n  ALPHA_FLAG      = 0x00000010,\n  ICCP_FLAG       = 0x00000020\n} WebPFeatureFlags;\n\n// Dispose method (animation only). Indicates how the area used by the current\n// frame is to be treated before rendering the next frame on the canvas.\ntypedef enum WebPMuxAnimDispose {\n  WEBP_MUX_DISPOSE_NONE,       // Do not dispose.\n  WEBP_MUX_DISPOSE_BACKGROUND  // Dispose to background color.\n} WebPMuxAnimDispose;\n\n// Blend operation (animation only). Indicates how transparent pixels of the\n// current frame are blended with those of the previous canvas.\ntypedef enum WebPMuxAnimBlend {\n  WEBP_MUX_BLEND,              // Blend.\n  WEBP_MUX_NO_BLEND            // Do not blend.\n} WebPMuxAnimBlend;\n\n// Data type used to describe 'raw' data, e.g., chunk data\n// (ICC profile, metadata) and WebP compressed image data.\nstruct WebPData {\n  const uint8_t* bytes;\n  size_t size;\n};\n\n// Initializes the contents of the 'webp_data' object with default values.\nstatic WEBP_INLINE void WebPDataInit(WebPData* webp_data) {\n  if (webp_data != NULL) {\n    memset(webp_data, 0, sizeof(*webp_data));\n  }\n}\n\n// Clears the contents of the 'webp_data' object by calling free(). Does not\n// deallocate the object itself.\nstatic WEBP_INLINE void WebPDataClear(WebPData* webp_data) {\n  if (webp_data != NULL) {\n    free((void*)webp_data->bytes);\n    WebPDataInit(webp_data);\n  }\n}\n\n// Allocates necessary storage for 'dst' and copies the contents of 'src'.\n// Returns true on success.\nstatic WEBP_INLINE int WebPDataCopy(const WebPData* src, WebPData* dst) {\n  if (src == NULL || dst == NULL) return 0;\n  WebPDataInit(dst);\n  if (src->bytes != NULL && src->size != 0) {\n    dst->bytes = (uint8_t*)malloc(src->size);\n    if (dst->bytes == NULL) return 0;\n    memcpy((void*)dst->bytes, src->bytes, src->size);\n    dst->size = src->size;\n  }\n  return 1;\n}\n\n#ifdef __cplusplus\n}    // extern \"C\"\n#endif\n\n#endif  /* WEBP_WEBP_MUX_TYPES_H_ */\n"
  },
  {
    "path": "ext/libwebp/webp/types.h",
    "content": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// that can be found in the COPYING file in the root of the source\n// tree. An additional intellectual property rights grant can be found\n// in the file PATENTS. All contributing project authors may\n// be found in the AUTHORS file in the root of the source tree.\n// -----------------------------------------------------------------------------\n//\n//  Common types\n//\n// Author: Skal (pascal.massimino@gmail.com)\n\n#ifndef WEBP_WEBP_TYPES_H_\n#define WEBP_WEBP_TYPES_H_\n\n#include <stddef.h>  // for size_t\n\n#ifndef _MSC_VER\n#include <inttypes.h>\n#ifdef __STRICT_ANSI__\n#define WEBP_INLINE\n#else  /* __STRICT_ANSI__ */\n#define WEBP_INLINE inline\n#endif\n#else\ntypedef signed   char int8_t;\ntypedef unsigned char uint8_t;\ntypedef signed   short int16_t;\ntypedef unsigned short uint16_t;\ntypedef signed   int int32_t;\ntypedef unsigned int uint32_t;\ntypedef unsigned long long int uint64_t;\ntypedef long long int int64_t;\n#define WEBP_INLINE __forceinline\n#endif  /* _MSC_VER */\n\n#ifndef WEBP_EXTERN\n// This explicitly marks library functions and allows for changing the\n// signature for e.g., Windows DLL builds.\n#define WEBP_EXTERN(type) extern type\n#endif  /* WEBP_EXTERN */\n\n// Macro to check ABI compatibility (same major revision number)\n#define WEBP_ABI_IS_INCOMPATIBLE(a, b) (((a) >> 8) != ((b) >> 8))\n\n#endif  /* WEBP_WEBP_TYPES_H_ */\n"
  },
  {
    "path": "ext/lzma/7zC.txt",
    "content": "7z ANSI-C Decoder 4.62\r\n----------------------\r\n\r\n7z ANSI-C provides 7z/LZMA decoding.\r\n7z ANSI-C version is simplified version ported from C++ code.\r\n\r\nLZMA is default and general compression method of 7z format\r\nin 7-Zip compression program (www.7-zip.org). LZMA provides high \r\ncompression ratio and very fast decompression.\r\n\r\n\r\nLICENSE\r\n-------\r\n\r\n7z ANSI-C Decoder is part of the LZMA SDK.\r\nLZMA SDK is written and placed in the public domain by Igor Pavlov.\r\n\r\nFiles\r\n---------------------\r\n\r\n7zDecode.*   - Low level 7z decoding\r\n7zExtract.*  - High level 7z decoding\r\n7zHeader.*   - .7z format constants\r\n7zIn.*       - .7z archive opening\r\n7zItem.*     - .7z structures\r\n7zMain.c     - Test application\r\n\r\n\r\nHow To Use\r\n----------\r\n\r\nYou must download 7-Zip program from www.7-zip.org.\r\n\r\nYou can create .7z archive with 7z.exe or 7za.exe:\r\n\r\n  7za.exe a archive.7z *.htm -r -mx -m0fb=255\r\n\r\nIf you have big number of files in archive, and you need fast extracting, \r\nyou can use partly-solid archives:\r\n  \r\n  7za.exe a archive.7z *.htm -ms=512K -r -mx -m0fb=255 -m0d=512K\r\n\r\nIn that example 7-Zip will use 512KB solid blocks. So it needs to decompress only \r\n512KB for extracting one file from such archive.\r\n\r\n\r\nLimitations of current version of 7z ANSI-C Decoder\r\n---------------------------------------------------\r\n\r\n - It reads only \"FileName\", \"Size\", \"LastWriteTime\" and \"CRC\" information for each file in archive.\r\n - It supports only LZMA and Copy (no compression) methods with BCJ or BCJ2 filters.\r\n - It converts original UTF-16 Unicode file names to UTF-8 Unicode file names.\r\n \r\nThese limitations will be fixed in future versions.\r\n\r\n\r\nUsing 7z ANSI-C Decoder Test application:\r\n-----------------------------------------\r\n\r\nUsage: 7zDec <command> <archive_name>\r\n\r\n<Command>:\r\n  e: Extract files from archive\r\n  l: List contents of archive\r\n  t: Test integrity of archive\r\n\r\nExample: \r\n\r\n  7zDec l archive.7z\r\n\r\nlists contents of archive.7z\r\n\r\n  7zDec e archive.7z\r\n\r\nextracts files from archive.7z to current folder.\r\n\r\n\r\nHow to use .7z Decoder\r\n----------------------\r\n\r\nMemory allocation\r\n~~~~~~~~~~~~~~~~~\r\n\r\n7z Decoder uses two memory pools:\r\n1) Temporary pool\r\n2) Main pool\r\nSuch scheme can allow you to avoid fragmentation of allocated blocks.\r\n\r\n\r\nSteps for using 7z decoder\r\n--------------------------\r\n\r\nUse code at 7zMain.c as example.\r\n\r\n1) Declare variables:\r\n  inStream                 /* implements ILookInStream interface */\r\n  CSzArEx db;              /* 7z archive database structure */\r\n  ISzAlloc allocImp;       /* memory functions for main pool */\r\n  ISzAlloc allocTempImp;   /* memory functions for temporary pool */\r\n\r\n2) call CrcGenerateTable(); function to initialize CRC structures.\r\n\r\n3) call SzArEx_Init(&db); function to initialize db structures.\r\n\r\n4) call SzArEx_Open(&db, inStream, &allocMain, &allocTemp) to open archive\r\n\r\nThis function opens archive \"inStream\" and reads headers to \"db\".\r\nAll items in \"db\" will be allocated with \"allocMain\" functions.\r\nSzArEx_Open function allocates and frees temporary structures by \"allocTemp\" functions.\r\n\r\n5) List items or Extract items\r\n\r\n  Listing code:\r\n  ~~~~~~~~~~~~~\r\n    {\r\n      UInt32 i;\r\n      for (i = 0; i < db.db.NumFiles; i++)\r\n      {\r\n        CFileItem *f = db.db.Files + i;\r\n        printf(\"%10d  %s\\n\", (int)f->Size, f->Name);\r\n      }\r\n    }\r\n\r\n  Extracting code:\r\n  ~~~~~~~~~~~~~~~~\r\n\r\n  SZ_RESULT SzAr_Extract(\r\n    CArchiveDatabaseEx *db,\r\n    ILookInStream *inStream, \r\n    UInt32 fileIndex,         /* index of file */\r\n    UInt32 *blockIndex,       /* index of solid block */\r\n    Byte **outBuffer,         /* pointer to pointer to output buffer (allocated with allocMain) */\r\n    size_t *outBufferSize,    /* buffer size for output buffer */\r\n    size_t *offset,           /* offset of stream for required file in *outBuffer */\r\n    size_t *outSizeProcessed, /* size of file in *outBuffer */\r\n    ISzAlloc *allocMain,\r\n    ISzAlloc *allocTemp);\r\n\r\n  If you need to decompress more than one file, you can send these values from previous call:\r\n    blockIndex, \r\n    outBuffer, \r\n    outBufferSize,\r\n  You can consider \"outBuffer\" as cache of solid block. If your archive is solid, \r\n  it will increase decompression speed.\r\n\r\n  After decompressing you must free \"outBuffer\":\r\n  allocImp.Free(outBuffer);\r\n\r\n6) call SzArEx_Free(&db, allocImp.Free) to free allocated items in \"db\".\r\n\r\n\r\n\r\n\r\nMemory requirements for .7z decoding \r\n------------------------------------\r\n\r\nMemory usage for Archive opening:\r\n  - Temporary pool:\r\n     - Memory for uncompressed .7z headers\r\n     - some other temporary blocks\r\n  - Main pool:\r\n     - Memory for database: \r\n       Estimated size of one file structures in solid archive:\r\n         - Size (4 or 8 Bytes)\r\n         - CRC32 (4 bytes)\r\n         - LastWriteTime (8 bytes)\r\n         - Some file information (4 bytes)\r\n         - File Name (variable length) + pointer + allocation structures\r\n\r\nMemory usage for archive Decompressing:\r\n  - Temporary pool:\r\n     - Memory for LZMA decompressing structures\r\n  - Main pool:\r\n     - Memory for decompressed solid block\r\n     - Memory for temprorary buffers, if BCJ2 fileter is used. Usually these \r\n       temprorary buffers can be about 15% of solid block size. \r\n  \r\n\r\n7z Decoder doesn't allocate memory for compressed blocks. \r\nInstead of this, you must allocate buffer with desired \r\nsize before calling 7z Decoder. Use 7zMain.c as example.\r\n\r\n\r\nDefines\r\n-------\r\n\r\n_SZ_ALLOC_DEBUG   - define it if you want to debug alloc/free operations to stderr.\r\n\r\n\r\n---\r\n\r\nhttp://www.7-zip.org\r\nhttp://www.7-zip.org/sdk.html\r\nhttp://www.7-zip.org/support.html\r\n"
  },
  {
    "path": "ext/lzma/7zFormat.txt",
    "content": "7z Format description (2.30 Beta 25)\r\n-----------------------------------\r\n\r\nThis file contains description of 7z archive format. \r\n7z archive can contain files compressed with any method.\r\nSee \"Methods.txt\" for description for defined compressing methods.\r\n\r\n\r\nFormat structure Overview\r\n-------------------------\r\n\r\nSome fields can be optional.\r\n\r\nArchive structure\r\n~~~~~~~~~~~~~~~~~  \r\nSignatureHeader\r\n[PackedStreams]\r\n[PackedStreamsForHeaders]\r\n[\r\n  Header \r\n  or \r\n  {\r\n    Packed Header\r\n    HeaderInfo\r\n  }\r\n]\r\n\r\n\r\n\r\nHeader structure\r\n~~~~~~~~~~~~~~~~  \r\n{\r\n  ArchiveProperties\r\n  AdditionalStreams\r\n  {\r\n    PackInfo\r\n    {\r\n      PackPos\r\n      NumPackStreams\r\n      Sizes[NumPackStreams]\r\n      CRCs[NumPackStreams]\r\n    }\r\n    CodersInfo\r\n    {\r\n      NumFolders\r\n      Folders[NumFolders]\r\n      {\r\n        NumCoders\r\n        CodersInfo[NumCoders]\r\n        {\r\n          ID\r\n          NumInStreams;\r\n          NumOutStreams;\r\n          PropertiesSize\r\n          Properties[PropertiesSize]\r\n        }\r\n        NumBindPairs\r\n        BindPairsInfo[NumBindPairs]\r\n        {\r\n          InIndex;\r\n          OutIndex;\r\n        }\r\n        PackedIndices\r\n      }\r\n      UnPackSize[Folders][Folders.NumOutstreams]\r\n      CRCs[NumFolders]\r\n    }\r\n    SubStreamsInfo\r\n    {\r\n      NumUnPackStreamsInFolders[NumFolders];\r\n      UnPackSizes[]\r\n      CRCs[]\r\n    }\r\n  }\r\n  MainStreamsInfo\r\n  {\r\n    (Same as in AdditionalStreams)\r\n  }\r\n  FilesInfo\r\n  {\r\n    NumFiles\r\n    Properties[]\r\n    {\r\n      ID\r\n      Size\r\n      Data\r\n    }\r\n  }\r\n}\r\n\r\nHeaderInfo structure\r\n~~~~~~~~~~~~~~~~~~~~\r\n{\r\n  (Same as in AdditionalStreams)\r\n}\r\n\r\n\r\n\r\nNotes about Notation and encoding\r\n---------------------------------\r\n\r\n7z uses little endian encoding.\r\n\r\n7z archive format has optional headers that are marked as\r\n[]\r\nHeader\r\n[]\r\n\r\nREAL_UINT64 means real UINT64.\r\n\r\nUINT64 means real UINT64 encoded with the following scheme:\r\n\r\n  Size of encoding sequence depends from first byte:\r\n  First_Byte  Extra_Bytes        Value\r\n  (binary)   \r\n  0xxxxxxx               : ( xxxxxxx           )\r\n  10xxxxxx    BYTE y[1]  : (  xxxxxx << (8 * 1)) + y\r\n  110xxxxx    BYTE y[2]  : (   xxxxx << (8 * 2)) + y\r\n  ...\r\n  1111110x    BYTE y[6]  : (       x << (8 * 6)) + y\r\n  11111110    BYTE y[7]  :                         y\r\n  11111111    BYTE y[8]  :                         y\r\n\r\n\r\n\r\nProperty IDs\r\n------------\r\n\r\n0x00 = kEnd,\r\n\r\n0x01 = kHeader,\r\n\r\n0x02 = kArchiveProperties,\r\n    \r\n0x03 = kAdditionalStreamsInfo,\r\n0x04 = kMainStreamsInfo,\r\n0x05 = kFilesInfo,\r\n    \r\n0x06 = kPackInfo,\r\n0x07 = kUnPackInfo,\r\n0x08 = kSubStreamsInfo,\r\n\r\n0x09 = kSize,\r\n0x0A = kCRC,\r\n\r\n0x0B = kFolder,\r\n\r\n0x0C = kCodersUnPackSize,\r\n0x0D = kNumUnPackStream,\r\n\r\n0x0E = kEmptyStream,\r\n0x0F = kEmptyFile,\r\n0x10 = kAnti,\r\n\r\n0x11 = kName,\r\n0x12 = kCreationTime,\r\n0x13 = kLastAccessTime,\r\n0x14 = kLastWriteTime,\r\n0x15 = kWinAttributes,\r\n0x16 = kComment,\r\n\r\n0x17 = kEncodedHeader,\r\n\r\n\r\n7z format headers\r\n-----------------\r\n\r\nSignatureHeader\r\n~~~~~~~~~~~~~~~\r\n  BYTE kSignature[6] = {'7', 'z', 0xBC, 0xAF, 0x27, 0x1C};\r\n\r\n  ArchiveVersion\r\n  {\r\n    BYTE Major;   // now = 0\r\n    BYTE Minor;   // now = 2\r\n  };\r\n\r\n  UINT32 StartHeaderCRC;\r\n\r\n  StartHeader\r\n  {\r\n    REAL_UINT64 NextHeaderOffset\r\n    REAL_UINT64 NextHeaderSize\r\n    UINT32 NextHeaderCRC\r\n  }\r\n\r\n\r\n...........................\r\n\r\n\r\nArchiveProperties\r\n~~~~~~~~~~~~~~~~~\r\nBYTE NID::kArchiveProperties (0x02)\r\nfor (;;)\r\n{\r\n  BYTE PropertyType;\r\n  if (aType == 0)\r\n    break;\r\n  UINT64 PropertySize;\r\n  BYTE PropertyData[PropertySize];\r\n}\r\n\r\n\r\nDigests (NumStreams)\r\n~~~~~~~~~~~~~~~~~~~~~\r\n  BYTE AllAreDefined\r\n  if (AllAreDefined == 0)\r\n  {\r\n    for(NumStreams)\r\n      BIT Defined\r\n  }\r\n  UINT32 CRCs[NumDefined]\r\n\r\n\r\nPackInfo\r\n~~~~~~~~~~~~\r\n  BYTE NID::kPackInfo  (0x06)\r\n  UINT64 PackPos\r\n  UINT64 NumPackStreams\r\n\r\n  []\r\n  BYTE NID::kSize    (0x09)\r\n  UINT64 PackSizes[NumPackStreams]\r\n  []\r\n\r\n  []\r\n  BYTE NID::kCRC      (0x0A)\r\n  PackStreamDigests[NumPackStreams]\r\n  []\r\n\r\n  BYTE NID::kEnd\r\n\r\n\r\nFolder\r\n~~~~~~\r\n  UINT64 NumCoders;\r\n  for (NumCoders)\r\n  {\r\n    BYTE \r\n    {\r\n      0:3 DecompressionMethod.IDSize\r\n      4:\r\n        0 - IsSimple\r\n        1 - Is not simple\r\n      5:\r\n        0 - No Attributes\r\n        1 - There Are Attributes\r\n      7:\r\n        0 - Last Method in Alternative_Method_List\r\n        1 - There are more alternative methods\r\n    } \r\n    BYTE DecompressionMethod.ID[DecompressionMethod.IDSize]\r\n    if (!IsSimple)\r\n    {\r\n      UINT64 NumInStreams;\r\n      UINT64 NumOutStreams;\r\n    }\r\n    if (DecompressionMethod[0] != 0)\r\n    {\r\n      UINT64 PropertiesSize\r\n      BYTE Properties[PropertiesSize]\r\n    }\r\n  }\r\n    \r\n  NumBindPairs = NumOutStreamsTotal - 1;\r\n\r\n  for (NumBindPairs)\r\n  {\r\n    UINT64 InIndex;\r\n    UINT64 OutIndex;\r\n  }\r\n\r\n  NumPackedStreams = NumInStreamsTotal - NumBindPairs;\r\n  if (NumPackedStreams > 1)\r\n    for(NumPackedStreams)\r\n    {\r\n      UINT64 Index;\r\n    };\r\n\r\n\r\n\r\n\r\nCoders Info\r\n~~~~~~~~~~~\r\n\r\n  BYTE NID::kUnPackInfo  (0x07)\r\n\r\n\r\n  BYTE NID::kFolder  (0x0B)\r\n  UINT64 NumFolders\r\n  BYTE External\r\n  switch(External)\r\n  {\r\n    case 0:\r\n      Folders[NumFolders]\r\n    case 1:\r\n      UINT64 DataStreamIndex\r\n  }\r\n\r\n\r\n  BYTE ID::kCodersUnPackSize  (0x0C)\r\n  for(Folders)\r\n    for(Folder.NumOutStreams)\r\n     UINT64 UnPackSize;\r\n\r\n\r\n  []\r\n  BYTE NID::kCRC   (0x0A)\r\n  UnPackDigests[NumFolders]\r\n  []\r\n\r\n  \r\n\r\n  BYTE NID::kEnd\r\n\r\n\r\n\r\nSubStreams Info\r\n~~~~~~~~~~~~~~\r\n  BYTE NID::kSubStreamsInfo; (0x08)\r\n\r\n  []\r\n  BYTE NID::kNumUnPackStream; (0x0D)\r\n  UINT64 NumUnPackStreamsInFolders[NumFolders];\r\n  []\r\n\r\n\r\n  []\r\n  BYTE NID::kSize  (0x09)\r\n  UINT64 UnPackSizes[]\r\n  []\r\n\r\n\r\n  []\r\n  BYTE NID::kCRC  (0x0A)\r\n  Digests[Number of streams with unknown CRC]\r\n  []\r\n\r\n  \r\n  BYTE NID::kEnd\r\n\r\n\r\nStreams Info\r\n~~~~~~~~~~~~\r\n\r\n  []\r\n  PackInfo\r\n  []\r\n\r\n\r\n  []\r\n  CodersInfo\r\n  []\r\n\r\n\r\n  []\r\n  SubStreamsInfo\r\n  []\r\n\r\n  BYTE NID::kEnd\r\n\r\n\r\nFilesInfo\r\n~~~~~~~~~\r\n  BYTE NID::kFilesInfo;  (0x05)\r\n  UINT64 NumFiles\r\n\r\n  for (;;)\r\n  {\r\n    BYTE PropertyType;\r\n    if (aType == 0)\r\n      break;\r\n\r\n    UINT64 Size;\r\n\r\n    switch(PropertyType)\r\n    {\r\n      kEmptyStream:   (0x0E)\r\n        for(NumFiles)\r\n          BIT IsEmptyStream\r\n\r\n      kEmptyFile:     (0x0F)\r\n        for(EmptyStreams)\r\n          BIT IsEmptyFile\r\n\r\n      kAnti:          (0x10)\r\n        for(EmptyStreams)\r\n          BIT IsAntiFile\r\n      \r\n      case kCreationTime:   (0x12)\r\n      case kLastAccessTime: (0x13)\r\n      case kLastWriteTime:  (0x14)\r\n        BYTE AllAreDefined\r\n        if (AllAreDefined == 0)\r\n        {\r\n          for(NumFiles)\r\n            BIT TimeDefined\r\n        }\r\n        BYTE External;\r\n        if(External != 0)\r\n          UINT64 DataIndex\r\n        []\r\n        for(Definded Items)\r\n          UINT32 Time\r\n        []\r\n      \r\n      kNames:     (0x11)\r\n        BYTE External;\r\n        if(External != 0)\r\n          UINT64 DataIndex\r\n        []\r\n        for(Files)\r\n        {\r\n          wchar_t Names[NameSize];\r\n          wchar_t 0;\r\n        }\r\n        []\r\n\r\n      kAttributes:  (0x15)\r\n        BYTE AllAreDefined\r\n        if (AllAreDefined == 0)\r\n        {\r\n          for(NumFiles)\r\n            BIT AttributesAreDefined\r\n        }\r\n        BYTE External;\r\n        if(External != 0)\r\n          UINT64 DataIndex\r\n        []\r\n        for(Definded Attributes)\r\n          UINT32 Attributes\r\n        []\r\n    }\r\n  }\r\n\r\n\r\nHeader\r\n~~~~~~\r\n  BYTE NID::kHeader (0x01)\r\n\r\n  []\r\n  ArchiveProperties\r\n  []\r\n\r\n  []\r\n  BYTE NID::kAdditionalStreamsInfo; (0x03)\r\n  StreamsInfo\r\n  []\r\n\r\n  []\r\n  BYTE NID::kMainStreamsInfo;    (0x04)\r\n  StreamsInfo\r\n  []\r\n\r\n  []\r\n  FilesInfo\r\n  []\r\n\r\n  BYTE NID::kEnd\r\n\r\n\r\nHeaderInfo\r\n~~~~~~~~~~\r\n  []\r\n  BYTE NID::kEncodedHeader; (0x17)\r\n  StreamsInfo for Encoded Header\r\n  []\r\n\r\n\r\n---\r\nEnd of document\r\n"
  },
  {
    "path": "ext/lzma/Asm/arm/7zCrcOpt.asm",
    "content": "\tCODE32\r\n\r\n\tEXPORT\t|CrcUpdateT4@16|\r\n\r\n\tAREA\t|.text|, CODE, ARM\r\n\r\n\tMACRO\r\n\tCRC32_STEP_1\r\n\r\n\tldrb    r4, [r1], #1\r\n\tsubs    r2, r2, #1\r\n\teor     r4, r4, r0\r\n\tand     r4, r4, #0xFF\r\n\tldr     r4, [r3, +r4, lsl #2]\r\n\teor     r0, r4, r0, lsr #8\r\n\r\n\tMEND\r\n\r\n\r\n\tMACRO\r\n\tCRC32_STEP_4 $STREAM_WORD\r\n\t\r\n\teor     r7, r7, r8\r\n\teor     r7, r7, r9\r\n\teor     r0, r0, r7\r\n\teor     r0, r0, $STREAM_WORD\r\n\tldr     $STREAM_WORD, [r1], #4\r\n\t\r\n\tand     r7, r0, #0xFF\r\n\tand     r8, r0, #0xFF00\r\n\tand     r9, r0, #0xFF0000\r\n\tand     r0, r0, #0xFF000000\r\n\r\n\tldr     r7, [r6, +r7, lsl #2]\r\n\tldr     r8, [r5, +r8, lsr #6]\r\n\tldr     r9, [r4, +r9, lsr #14]\r\n\tldr     r0, [r3, +r0, lsr #22]\r\n\t\r\n\tMEND\r\n\r\n\r\n|CrcUpdateT4@16| PROC\r\n\r\n\tstmdb   sp!, {r4-r11, lr}\r\n\tcmp     r2, #0\r\n\tbeq     |$fin|\r\n\r\n|$v1|\r\n\ttst     r1, #7\r\n\tbeq     |$v2|\r\n\tCRC32_STEP_1\r\n\tbne     |$v1|\r\n\r\n|$v2|\r\n\tcmp     r2, #16\r\n\tblo     |$v3|\r\n\r\n\tldr     r10, [r1], #4\r\n\tldr     r11, [r1], #4\r\n\r\n\tadd     r4, r3, #0x400 \r\n\tadd     r5, r3, #0x800\r\n\tadd     r6, r3, #0xC00\r\n\r\n\tmov     r7, #0\r\n\tmov     r8, #0\r\n\tmov     r9, #0\r\n\r\n\tsub     r2, r2, #16\r\n\r\n|$loop|\r\n\t; pld     [r1, #0x40]\r\n\r\n\tCRC32_STEP_4 r10\r\n\tCRC32_STEP_4 r11\r\n\r\n\tsubs    r2, r2, #8\r\n\tbhs     |$loop|\r\n\r\n\tsub     r1, r1, #8\r\n\tadd     r2, r2, #16\r\n\r\n\teor     r7, r7, r8\r\n\teor     r7, r7, r9\r\n\teor     r0, r0, r7\r\n\r\n|$v3|\r\n\tcmp     r2, #0\r\n\tbeq     |$fin|\r\n\r\n|$v4|\r\n\tCRC32_STEP_1\r\n\tbne     |$v4|\r\n\r\n|$fin|\r\n\tldmia   sp!, {r4-r11, pc}\r\n\r\n|CrcUpdateT4@16| ENDP\r\n\r\n\tEND\r\n"
  },
  {
    "path": "ext/lzma/Asm/x86/7zAsm.asm",
    "content": "; 7zAsm.asm -- ASM macros\r\n; 2009-12-12 : Igor Pavlov : Public domain\r\n\r\nMY_ASM_START macro\r\n  ifdef x64\r\n    .code\r\n  else\r\n    .386\r\n    .model flat\r\n    _TEXT$00 SEGMENT PARA PUBLIC 'CODE'\r\n  endif\r\nendm\r\n\r\nMY_PROC macro name:req, numParams:req\r\n  align 16\r\n  proc_numParams equ numParams\r\n  ifdef x64\r\n    proc_name equ name\r\n    name PROC\r\n  else\r\n    proc_fastcall_name equ @CatStr(@,name,@, %numParams * 4)\r\n    public proc_fastcall_name\r\n    proc_fastcall_name:\r\n  endif\r\nendm\r\n\r\nMY_ENDP macro\r\n  ifdef x64\r\n    ret\r\n    proc_name ENDP\r\n  else\r\n    ret (proc_numParams - 2) * 4\r\n  endif\r\nendm\r\n\r\nifdef x64\r\n  REG_SIZE equ 8\r\nelse\r\n  REG_SIZE equ 4\r\nendif\r\n\r\n  x0 equ EAX\r\n  x1 equ ECX\r\n  x2 equ EDX\r\n  x3 equ EBX\r\n  x4 equ ESP\r\n  x5 equ EBP\r\n  x6 equ ESI\r\n  x7 equ EDI\r\n\r\n  x0_L equ AL\r\n  x1_L equ CL\r\n  x2_L equ DL\r\n  x3_L equ BL\r\n\r\n  x0_H equ AH\r\n  x1_H equ CH\r\n  x2_H equ DH\r\n  x3_H equ BH\r\n\r\nifdef x64\r\n  r0 equ RAX\r\n  r1 equ RCX\r\n  r2 equ RDX\r\n  r3 equ RBX\r\n  r4 equ RSP\r\n  r5 equ RBP\r\n  r6 equ RSI\r\n  r7 equ RDI\r\nelse\r\n  r0 equ x0\r\n  r1 equ x1\r\n  r2 equ x2\r\n  r3 equ x3\r\n  r4 equ x4\r\n  r5 equ x5\r\n  r6 equ x6\r\n  r7 equ x7\r\nendif\r\n\r\nMY_PUSH_4_REGS macro\r\n    push    r3\r\n    push    r5\r\n    push    r6\r\n    push    r7\r\nendm\r\n\r\nMY_POP_4_REGS macro\r\n    pop     r7\r\n    pop     r6\r\n    pop     r5\r\n    pop     r3\r\nendm\r\n"
  },
  {
    "path": "ext/lzma/Asm/x86/7zCrcOpt.asm",
    "content": "; 7zCrcOpt.asm -- CRC32 calculation : optimized version\r\n; 2009-12-12 : Igor Pavlov : Public domain\r\n\r\ninclude 7zAsm.asm\r\n\r\nMY_ASM_START\r\n\r\nrD   equ  r2\r\nrN   equ  r7\r\n\r\nifdef x64\r\n    num_VAR     equ r8\r\n    table_VAR   equ r9\r\nelse\r\n    data_size   equ (REG_SIZE * 5)\r\n    crc_table   equ (REG_SIZE + data_size)\r\n    num_VAR     equ [r4 + data_size]\r\n    table_VAR   equ [r4 + crc_table]\r\nendif\r\n\r\nSRCDAT  equ  rN + rD + 4 *\r\n\r\nCRC macro op:req, dest:req, src:req, t:req\r\n    op      dest, DWORD PTR [r5 + src * 4 + 0400h * t]\r\nendm\r\n\r\nCRC_XOR macro dest:req, src:req, t:req\r\n    CRC xor, dest, src, t\r\nendm\r\n\r\nCRC_MOV macro dest:req, src:req, t:req\r\n    CRC mov, dest, src, t\r\nendm\r\n\r\nCRC1b macro\r\n    movzx   x6, BYTE PTR [rD]\r\n    inc     rD\r\n    movzx   x3, x0_L\r\n    xor     x6, x3\r\n    shr     x0, 8\r\n    CRC     xor, x0, r6, 0\r\n    dec     rN\r\nendm\r\n\r\nMY_PROLOG macro crc_end:req\r\n    MY_PUSH_4_REGS\r\n    \r\n    mov     x0, x1\r\n    mov     rN, num_VAR\r\n    mov     r5, table_VAR\r\n    test    rN, rN\r\n    jz      crc_end\r\n  @@:\r\n    test    rD, 7\r\n    jz      @F\r\n    CRC1b\r\n    jnz     @B\r\n  @@:\r\n    cmp     rN, 16\r\n    jb      crc_end\r\n    add     rN, rD\r\n    mov     num_VAR, rN\r\n    sub     rN, 8\r\n    and     rN, NOT 7\r\n    sub     rD, rN\r\n    xor     x0, [SRCDAT 0]\r\nendm\r\n\r\nMY_EPILOG macro crc_end:req\r\n    xor     x0, [SRCDAT 0]\r\n    mov     rD, rN\r\n    mov     rN, num_VAR\r\n    sub     rN, rD\r\n  crc_end:\r\n    test    rN, rN\r\n    jz      @F\r\n    CRC1b\r\n    jmp     crc_end\r\n  @@:\r\n    MY_POP_4_REGS\r\nendm\r\n\r\nMY_PROC CrcUpdateT8, 4\r\n    MY_PROLOG crc_end_8\r\n    mov     x1, [SRCDAT 1]\r\n    align 16\r\n  main_loop_8:\r\n    mov     x6, [SRCDAT 2]\r\n    movzx   x3, x1_L\r\n    CRC_XOR x6, r3, 3\r\n    movzx   x3, x1_H\r\n    CRC_XOR x6, r3, 2\r\n    shr     x1, 16\r\n    movzx   x3, x1_L\r\n    movzx   x1, x1_H\r\n    CRC_XOR x6, r3, 1\r\n    movzx   x3, x0_L\r\n    CRC_XOR x6, r1, 0\r\n\r\n    mov     x1, [SRCDAT 3]\r\n    CRC_XOR x6, r3, 7\r\n    movzx   x3, x0_H\r\n    shr     x0, 16\r\n    CRC_XOR x6, r3, 6\r\n    movzx   x3, x0_L\r\n    CRC_XOR x6, r3, 5\r\n    movzx   x3, x0_H\r\n    CRC_MOV x0, r3, 4\r\n    xor     x0, x6\r\n    add     rD, 8\r\n    jnz     main_loop_8\r\n\r\n    MY_EPILOG crc_end_8\r\nMY_ENDP\r\n\r\nMY_PROC CrcUpdateT4, 4\r\n    MY_PROLOG crc_end_4\r\n    align 16\r\n  main_loop_4:\r\n    movzx   x1, x0_L\r\n    movzx   x3, x0_H\r\n    shr     x0, 16\r\n    movzx   x6, x0_H\r\n    and     x0, 0FFh\r\n    CRC_MOV x1, r1, 3\r\n    xor     x1, [SRCDAT 1]\r\n    CRC_XOR x1, r3, 2\r\n    CRC_XOR x1, r6, 0\r\n    CRC_XOR x1, r0, 1\r\n \r\n    movzx   x0, x1_L\r\n    movzx   x3, x1_H\r\n    shr     x1, 16\r\n    movzx   x6, x1_H\r\n    and     x1, 0FFh\r\n    CRC_MOV x0, r0, 3\r\n    xor     x0, [SRCDAT 2]\r\n    CRC_XOR x0, r3, 2\r\n    CRC_XOR x0, r6, 0\r\n    CRC_XOR x0, r1, 1\r\n    add     rD, 8\r\n    jnz     main_loop_4\r\n\r\n    MY_EPILOG crc_end_4\r\nMY_ENDP\r\n\r\nend\r\n"
  },
  {
    "path": "ext/lzma/Asm/x86/AesOpt.asm",
    "content": "; AesOpt.asm -- Intel's AES.\r\n; 2009-12-12 : Igor Pavlov : Public domain\r\n\r\ninclude 7zAsm.asm\r\n\r\nMY_ASM_START\r\n\r\nifndef x64\r\n    .xmm\r\nendif\r\n\r\nifdef x64\r\n    num     equ r8\r\nelse\r\n    num     equ [r4 + REG_SIZE * 4]\r\nendif\r\n\r\nrD equ r2\r\nrN equ r0\r\n\r\nMY_PROLOG macro reg:req\r\n    ifdef x64\r\n    movdqa  [r4 + 8], xmm6\r\n    movdqa  [r4 + 8 + 16], xmm7\r\n    endif\r\n\r\n    push    r3\r\n    push    r5\r\n    push    r6\r\n\r\n    mov     rN, num\r\n    mov     x6, [r1 + 16]\r\n    shl     x6, 5\r\n\r\n    movdqa  reg, [r1]\r\n    add     r1, 32\r\nendm\r\n\r\nMY_EPILOG macro\r\n    pop     r6\r\n    pop     r5\r\n    pop     r3\r\n\r\n    ifdef x64\r\n    movdqa  xmm6, [r4 + 8]\r\n    movdqa  xmm7, [r4 + 8 + 16]\r\n    endif\r\n\r\n    MY_ENDP\r\nendm\r\n\r\nways equ 4\r\nways16 equ (ways * 16)\r\n\r\nOP_W macro op, op2\r\n    i = 0\r\n    rept ways\r\n    op @CatStr(xmm,%i), op2\r\n    i = i + 1\r\n    endm\r\nendm\r\n\r\nLOAD_OP macro op:req, offs:req\r\n    op      xmm0, [r1 + r3 offs]\r\nendm\r\n  \r\nLOAD_OP_W macro op:req, offs:req\r\n    movdqa  xmm7, [r1 + r3 offs]\r\n    OP_W    op, xmm7\r\nendm\r\n\r\n\r\n; ---------- AES-CBC Decode ----------\r\n\r\nCBC_DEC_UPDATE macro reg, offs\r\n    pxor    reg, xmm6\r\n    movdqa  xmm6, [rD + offs]\r\n    movdqa  [rD + offs], reg\r\nendm\r\n\r\nDECODE macro op:req\r\n    op      aesdec, +16\r\n  @@:\r\n    op      aesdec, +0\r\n    op      aesdec, -16\r\n    sub     x3, 32\r\n    jnz     @B\r\n    op      aesdeclast, +0\r\nendm\r\n\r\nMY_PROC AesCbc_Decode_Intel, 3\r\n    MY_PROLOG xmm6\r\n\r\n    sub     x6, 32\r\n\r\n    jmp     check2\r\n\r\n  align 16\r\n  nextBlocks2:\r\n    mov     x3, x6\r\n    OP_W    movdqa, [rD + i * 16]\r\n    LOAD_OP_W  pxor, +32\r\n    DECODE  LOAD_OP_W\r\n    OP_W    CBC_DEC_UPDATE, i * 16\r\n    add     rD, ways16\r\n  check2:\r\n    sub     rN, ways\r\n    jnc     nextBlocks2\r\n\r\n    add     rN, ways\r\n    jmp     check\r\n\r\n  nextBlock:\r\n    mov     x3, x6\r\n    movdqa  xmm1, [rD]\r\n    LOAD_OP movdqa, +32\r\n    pxor    xmm0, xmm1\r\n    DECODE  LOAD_OP\r\n    pxor    xmm0, xmm6\r\n    movdqa  [rD], xmm0\r\n    movdqa  xmm6, xmm1\r\n    add     rD, 16\r\n  check:\r\n    sub     rN, 1\r\n    jnc     nextBlock\r\n\r\n    movdqa  [r1 - 32], xmm6\r\n    MY_EPILOG\r\n\r\n\r\n; ---------- AES-CBC Encode ----------\r\n\r\nENCODE macro op:req\r\n    op      aesenc, -16\r\n  @@:\r\n    op      aesenc, +0\r\n    op      aesenc, +16\r\n    add     r3, 32\r\n    jnz     @B\r\n    op      aesenclast, +0\r\nendm\r\n\r\nMY_PROC AesCbc_Encode_Intel, 3\r\n    MY_PROLOG xmm0\r\n\r\n    add     r1, r6\r\n    neg     r6\r\n    add     r6, 32\r\n\r\n    jmp     check_e\r\n\r\n  align 16\r\n  nextBlock_e:\r\n    mov     r3, r6\r\n    pxor    xmm0, [rD]\r\n    pxor    xmm0, [r1 + r3 - 32]\r\n    ENCODE  LOAD_OP\r\n    movdqa  [rD], xmm0\r\n    add     rD, 16\r\n  check_e:\r\n    sub     rN, 1\r\n    jnc     nextBlock_e\r\n\r\n    movdqa  [r1 + r6 - 64], xmm0\r\n    MY_EPILOG\r\n\r\n\r\n; ---------- AES-CTR ----------\r\n\r\nXOR_UPD_1 macro reg, offs\r\n    pxor    reg, [rD + offs]\r\nendm\r\n\r\nXOR_UPD_2 macro reg, offs\r\n    movdqa  [rD + offs], reg\r\nendm\r\n\r\nMY_PROC AesCtr_Code_Intel, 3\r\n    MY_PROLOG xmm6\r\n\r\n    mov     r5, r4\r\n    shr     r5, 4\r\n    dec     r5\r\n    shl     r5, 4\r\n\r\n    mov     DWORD PTR [r5], 1\r\n    mov     DWORD PTR [r5 + 4], 0\r\n    mov     DWORD PTR [r5 + 8], 0\r\n    mov     DWORD PTR [r5 + 12], 0\r\n    \r\n    add     r1, r6\r\n    neg     r6\r\n    add     r6, 32\r\n\r\n    jmp     check2_c\r\n\r\n  align 16\r\n  nextBlocks2_c:\r\n    movdqa  xmm7, [r5]\r\n\r\n    i = 0\r\n    rept ways\r\n    paddq   xmm6, xmm7\r\n    movdqa  @CatStr(xmm,%i), xmm6\r\n    i = i + 1\r\n    endm\r\n\r\n    mov     r3, r6\r\n    LOAD_OP_W  pxor, -32\r\n    ENCODE  LOAD_OP_W\r\n    OP_W    XOR_UPD_1, i * 16\r\n    OP_W    XOR_UPD_2, i * 16\r\n    add     rD, ways16\r\n  check2_c:\r\n    sub     rN, ways\r\n    jnc     nextBlocks2_c\r\n\r\n    add     rN, ways\r\n    jmp     check_c\r\n\r\n  nextBlock_c:\r\n    paddq   xmm6, [r5]\r\n    mov     r3, r6\r\n    movdqa  xmm0, [r1 + r3 - 32]\r\n    pxor    xmm0, xmm6\r\n    ENCODE  LOAD_OP\r\n    XOR_UPD_1 xmm0, 0\r\n    XOR_UPD_2 xmm0, 0\r\n    add     rD, 16\r\n  check_c:\r\n    sub     rN, 1\r\n    jnc     nextBlock_c\r\n\r\n    movdqa  [r1 + r6 - 64], xmm6\r\n    MY_EPILOG\r\n\r\nend\r\n"
  },
  {
    "path": "ext/lzma/C/7z.h",
    "content": "/* 7z.h -- 7z interface\r\n2010-03-11 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __7Z_H\r\n#define __7Z_H\r\n\r\n#include \"7zBuf.h\"\r\n\r\nEXTERN_C_BEGIN\r\n\r\n#define k7zStartHeaderSize 0x20\r\n#define k7zSignatureSize 6\r\nextern Byte k7zSignature[k7zSignatureSize];\r\n#define k7zMajorVersion 0\r\n\r\nenum EIdEnum\r\n{\r\n  k7zIdEnd,\r\n  k7zIdHeader,\r\n  k7zIdArchiveProperties,\r\n  k7zIdAdditionalStreamsInfo,\r\n  k7zIdMainStreamsInfo,\r\n  k7zIdFilesInfo,\r\n  k7zIdPackInfo,\r\n  k7zIdUnpackInfo,\r\n  k7zIdSubStreamsInfo,\r\n  k7zIdSize,\r\n  k7zIdCRC,\r\n  k7zIdFolder,\r\n  k7zIdCodersUnpackSize,\r\n  k7zIdNumUnpackStream,\r\n  k7zIdEmptyStream,\r\n  k7zIdEmptyFile,\r\n  k7zIdAnti,\r\n  k7zIdName,\r\n  k7zIdCTime,\r\n  k7zIdATime,\r\n  k7zIdMTime,\r\n  k7zIdWinAttributes,\r\n  k7zIdComment,\r\n  k7zIdEncodedHeader,\r\n  k7zIdStartPos,\r\n  k7zIdDummy\r\n};\r\n\r\ntypedef struct\r\n{\r\n  UInt32 NumInStreams;\r\n  UInt32 NumOutStreams;\r\n  UInt64 MethodID;\r\n  CBuf Props;\r\n} CSzCoderInfo;\r\n\r\nvoid SzCoderInfo_Init(CSzCoderInfo *p);\r\nvoid SzCoderInfo_Free(CSzCoderInfo *p, ISzAlloc *alloc);\r\n\r\ntypedef struct\r\n{\r\n  UInt32 InIndex;\r\n  UInt32 OutIndex;\r\n} CSzBindPair;\r\n\r\ntypedef struct\r\n{\r\n  CSzCoderInfo *Coders;\r\n  CSzBindPair *BindPairs;\r\n  UInt32 *PackStreams;\r\n  UInt64 *UnpackSizes;\r\n  UInt32 NumCoders;\r\n  UInt32 NumBindPairs;\r\n  UInt32 NumPackStreams;\r\n  int UnpackCRCDefined;\r\n  UInt32 UnpackCRC;\r\n\r\n  UInt32 NumUnpackStreams;\r\n} CSzFolder;\r\n\r\nvoid SzFolder_Init(CSzFolder *p);\r\nUInt64 SzFolder_GetUnpackSize(CSzFolder *p);\r\nint SzFolder_FindBindPairForInStream(CSzFolder *p, UInt32 inStreamIndex);\r\nUInt32 SzFolder_GetNumOutStreams(CSzFolder *p);\r\nUInt64 SzFolder_GetUnpackSize(CSzFolder *p);\r\n\r\nSRes SzFolder_Decode(const CSzFolder *folder, const UInt64 *packSizes,\r\n    ILookInStream *stream, UInt64 startPos,\r\n    Byte *outBuffer, size_t outSize, ISzAlloc *allocMain);\r\n\r\ntypedef struct\r\n{\r\n  UInt32 Low;\r\n  UInt32 High;\r\n} CNtfsFileTime;\r\n\r\ntypedef struct\r\n{\r\n  CNtfsFileTime MTime;\r\n  UInt64 Size;\r\n  UInt32 Crc;\r\n  UInt32 Attrib;\r\n  Byte HasStream;\r\n  Byte IsDir;\r\n  Byte IsAnti;\r\n  Byte CrcDefined;\r\n  Byte MTimeDefined;\r\n  Byte AttribDefined;\r\n} CSzFileItem;\r\n\r\nvoid SzFile_Init(CSzFileItem *p);\r\n\r\ntypedef struct\r\n{\r\n  UInt64 *PackSizes;\r\n  Byte *PackCRCsDefined;\r\n  UInt32 *PackCRCs;\r\n  CSzFolder *Folders;\r\n  CSzFileItem *Files;\r\n  UInt32 NumPackStreams;\r\n  UInt32 NumFolders;\r\n  UInt32 NumFiles;\r\n} CSzAr;\r\n\r\nvoid SzAr_Init(CSzAr *p);\r\nvoid SzAr_Free(CSzAr *p, ISzAlloc *alloc);\r\n\r\n\r\n/*\r\n  SzExtract extracts file from archive\r\n\r\n  *outBuffer must be 0 before first call for each new archive.\r\n\r\n  Extracting cache:\r\n    If you need to decompress more than one file, you can send\r\n    these values from previous call:\r\n      *blockIndex,\r\n      *outBuffer,\r\n      *outBufferSize\r\n    You can consider \"*outBuffer\" as cache of solid block. If your archive is solid,\r\n    it will increase decompression speed.\r\n  \r\n    If you use external function, you can declare these 3 cache variables\r\n    (blockIndex, outBuffer, outBufferSize) as static in that external function.\r\n    \r\n    Free *outBuffer and set *outBuffer to 0, if you want to flush cache.\r\n*/\r\n\r\ntypedef struct\r\n{\r\n  CSzAr db;\r\n  \r\n  UInt64 startPosAfterHeader;\r\n  UInt64 dataPos;\r\n\r\n  UInt32 *FolderStartPackStreamIndex;\r\n  UInt64 *PackStreamStartPositions;\r\n  UInt32 *FolderStartFileIndex;\r\n  UInt32 *FileIndexToFolderIndexMap;\r\n\r\n  size_t *FileNameOffsets; /* in 2-byte steps */\r\n  CBuf FileNames;  /* UTF-16-LE */\r\n} CSzArEx;\r\n\r\nvoid SzArEx_Init(CSzArEx *p);\r\nvoid SzArEx_Free(CSzArEx *p, ISzAlloc *alloc);\r\nUInt64 SzArEx_GetFolderStreamPos(const CSzArEx *p, UInt32 folderIndex, UInt32 indexInFolder);\r\nint SzArEx_GetFolderFullPackSize(const CSzArEx *p, UInt32 folderIndex, UInt64 *resSize);\r\n\r\n/*\r\nif dest == NULL, the return value specifies the required size of the buffer,\r\n  in 16-bit characters, including the null-terminating character.\r\nif dest != NULL, the return value specifies the number of 16-bit characters that\r\n  are written to the dest, including the null-terminating character. */\r\n\r\nsize_t SzArEx_GetFileNameUtf16(const CSzArEx *p, size_t fileIndex, UInt16 *dest);\r\n\r\nSRes SzArEx_Extract(\r\n    const CSzArEx *db,\r\n    ILookInStream *inStream,\r\n    UInt32 fileIndex,         /* index of file */\r\n    UInt32 *blockIndex,       /* index of solid block */\r\n    Byte **outBuffer,         /* pointer to pointer to output buffer (allocated with allocMain) */\r\n    size_t *outBufferSize,    /* buffer size for output buffer */\r\n    size_t *offset,           /* offset of stream for required file in *outBuffer */\r\n    size_t *outSizeProcessed, /* size of file in *outBuffer */\r\n    ISzAlloc *allocMain,\r\n    ISzAlloc *allocTemp);\r\n\r\n\r\n/*\r\nSzArEx_Open Errors:\r\nSZ_ERROR_NO_ARCHIVE\r\nSZ_ERROR_ARCHIVE\r\nSZ_ERROR_UNSUPPORTED\r\nSZ_ERROR_MEM\r\nSZ_ERROR_CRC\r\nSZ_ERROR_INPUT_EOF\r\nSZ_ERROR_FAIL\r\n*/\r\n\r\nSRes SzArEx_Open(CSzArEx *p, ILookInStream *inStream, ISzAlloc *allocMain, ISzAlloc *allocTemp);\r\n\r\nEXTERN_C_END\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/7zAlloc.c",
    "content": "/* 7zAlloc.c -- Allocation functions\r\n2010-10-29 : Igor Pavlov : Public domain */\r\n\r\n#include \"7zAlloc.h\"\r\n\r\n/* #define _SZ_ALLOC_DEBUG */\r\n/* use _SZ_ALLOC_DEBUG to debug alloc/free operations */\r\n\r\n#ifdef _SZ_ALLOC_DEBUG\r\n\r\n#ifdef _WIN32\r\n#include <windows.h>\r\n#endif\r\n\r\n#include <stdio.h>\r\nint g_allocCount = 0;\r\nint g_allocCountTemp = 0;\r\n\r\n#endif\r\n\r\nvoid *SzAlloc(void *p, size_t size)\r\n{\r\n  p = p;\r\n  if (size == 0)\r\n    return 0;\r\n  #ifdef _SZ_ALLOC_DEBUG\r\n  fprintf(stderr, \"\\nAlloc %10d bytes; count = %10d\", size, g_allocCount);\r\n  g_allocCount++;\r\n  #endif\r\n  return malloc(size);\r\n}\r\n\r\nvoid SzFree(void *p, void *address)\r\n{\r\n  p = p;\r\n  #ifdef _SZ_ALLOC_DEBUG\r\n  if (address != 0)\r\n  {\r\n    g_allocCount--;\r\n    fprintf(stderr, \"\\nFree; count = %10d\", g_allocCount);\r\n  }\r\n  #endif\r\n  free(address);\r\n}\r\n\r\nvoid *SzAllocTemp(void *p, size_t size)\r\n{\r\n  p = p;\r\n  if (size == 0)\r\n    return 0;\r\n  #ifdef _SZ_ALLOC_DEBUG\r\n  fprintf(stderr, \"\\nAlloc_temp %10d bytes;  count = %10d\", size, g_allocCountTemp);\r\n  g_allocCountTemp++;\r\n  #ifdef _WIN32\r\n  return HeapAlloc(GetProcessHeap(), 0, size);\r\n  #endif\r\n  #endif\r\n  return malloc(size);\r\n}\r\n\r\nvoid SzFreeTemp(void *p, void *address)\r\n{\r\n  p = p;\r\n  #ifdef _SZ_ALLOC_DEBUG\r\n  if (address != 0)\r\n  {\r\n    g_allocCountTemp--;\r\n    fprintf(stderr, \"\\nFree_temp; count = %10d\", g_allocCountTemp);\r\n  }\r\n  #ifdef _WIN32\r\n  HeapFree(GetProcessHeap(), 0, address);\r\n  return;\r\n  #endif\r\n  #endif\r\n  free(address);\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/7zAlloc.h",
    "content": "/* 7zAlloc.h -- Allocation functions\r\n2010-10-29 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __7Z_ALLOC_H\r\n#define __7Z_ALLOC_H\r\n\r\n#include <stdlib.h>\r\n\r\nvoid *SzAlloc(void *p, size_t size);\r\nvoid SzFree(void *p, void *address);\r\n\r\nvoid *SzAllocTemp(void *p, size_t size);\r\nvoid SzFreeTemp(void *p, void *address);\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/7zBuf.c",
    "content": "/* 7zBuf.c -- Byte Buffer\r\n2008-03-28\r\nIgor Pavlov\r\nPublic domain */\r\n\r\n#include \"7zBuf.h\"\r\n\r\nvoid Buf_Init(CBuf *p)\r\n{\r\n  p->data = 0;\r\n  p->size = 0;\r\n}\r\n\r\nint Buf_Create(CBuf *p, size_t size, ISzAlloc *alloc)\r\n{\r\n  p->size = 0;\r\n  if (size == 0)\r\n  {\r\n    p->data = 0;\r\n    return 1;\r\n  }\r\n  p->data = (Byte *)alloc->Alloc(alloc, size);\r\n  if (p->data != 0)\r\n  {\r\n    p->size = size;\r\n    return 1;\r\n  }\r\n  return 0;\r\n}\r\n\r\nvoid Buf_Free(CBuf *p, ISzAlloc *alloc)\r\n{\r\n  alloc->Free(alloc, p->data);\r\n  p->data = 0;\r\n  p->size = 0;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/7zBuf.h",
    "content": "/* 7zBuf.h -- Byte Buffer\r\n2009-02-07 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __7Z_BUF_H\r\n#define __7Z_BUF_H\r\n\r\n#include \"Types.h\"\r\n\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n#endif\r\n\r\ntypedef struct\r\n{\r\n  Byte *data;\r\n  size_t size;\r\n} CBuf;\r\n\r\nvoid Buf_Init(CBuf *p);\r\nint Buf_Create(CBuf *p, size_t size, ISzAlloc *alloc);\r\nvoid Buf_Free(CBuf *p, ISzAlloc *alloc);\r\n\r\ntypedef struct\r\n{\r\n  Byte *data;\r\n  size_t size;\r\n  size_t pos;\r\n} CDynBuf;\r\n\r\nvoid DynBuf_Construct(CDynBuf *p);\r\nvoid DynBuf_SeekToBeg(CDynBuf *p);\r\nint DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAlloc *alloc);\r\nvoid DynBuf_Free(CDynBuf *p, ISzAlloc *alloc);\r\n\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/7zBuf2.c",
    "content": "/* 7zBuf2.c -- Byte Buffer\r\n2008-10-04 : Igor Pavlov : Public domain */\r\n\r\n#include <string.h>\r\n#include \"7zBuf.h\"\r\n\r\nvoid DynBuf_Construct(CDynBuf *p)\r\n{\r\n  p->data = 0;\r\n  p->size = 0;\r\n  p->pos = 0;\r\n}\r\n\r\nvoid DynBuf_SeekToBeg(CDynBuf *p)\r\n{\r\n  p->pos = 0;\r\n}\r\n\r\nint DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAlloc *alloc)\r\n{\r\n  if (size > p->size - p->pos)\r\n  {\r\n    size_t newSize = p->pos + size;\r\n    Byte *data;\r\n    newSize += newSize / 4;\r\n    data = (Byte *)alloc->Alloc(alloc, newSize);\r\n    if (data == 0)\r\n      return 0;\r\n    p->size = newSize;\r\n    memcpy(data, p->data, p->pos);\r\n    alloc->Free(alloc, p->data);\r\n    p->data = data;\r\n  }\r\n  memcpy(p->data + p->pos, buf, size);\r\n  p->pos += size;\r\n  return 1;\r\n}\r\n\r\nvoid DynBuf_Free(CDynBuf *p, ISzAlloc *alloc)\r\n{\r\n  alloc->Free(alloc, p->data);\r\n  p->data = 0;\r\n  p->size = 0;\r\n  p->pos = 0;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/7zCrc.c",
    "content": "/* 7zCrc.c -- CRC32 init\r\n2010-12-01 : Igor Pavlov : Public domain */\r\n\r\n#include \"7zCrc.h\"\r\n#include \"CpuArch.h\"\r\n\r\n#define kCrcPoly 0xEDB88320\r\n\r\n#ifdef MY_CPU_X86_OR_AMD64\r\n  #define CRC_NUM_TABLES 8\r\n  UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table);\r\n#elif defined(MY_CPU_LE)\r\n  #define CRC_NUM_TABLES 4\r\n#else\r\n  #define CRC_NUM_TABLES 5\r\n  #define CRC_UINT32_SWAP(v) ((v >> 24) | ((v >> 8) & 0xFF00) | ((v << 8) & 0xFF0000) | (v << 24))\r\n  UInt32 MY_FAST_CALL CrcUpdateT1_BeT4(UInt32 v, const void *data, size_t size, const UInt32 *table);\r\n#endif\r\n\r\n#ifndef MY_CPU_BE\r\n  UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table);\r\n#endif\r\n\r\ntypedef UInt32 (MY_FAST_CALL *CRC_FUNC)(UInt32 v, const void *data, size_t size, const UInt32 *table);\r\n\r\nstatic CRC_FUNC g_CrcUpdate;\r\nUInt32 g_CrcTable[256 * CRC_NUM_TABLES];\r\n\r\nUInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void *data, size_t size)\r\n{\r\n  return g_CrcUpdate(v, data, size, g_CrcTable);\r\n}\r\n\r\nUInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size)\r\n{\r\n  return g_CrcUpdate(CRC_INIT_VAL, data, size, g_CrcTable) ^ CRC_INIT_VAL;\r\n}\r\n\r\nvoid MY_FAST_CALL CrcGenerateTable()\r\n{\r\n  UInt32 i;\r\n  for (i = 0; i < 256; i++)\r\n  {\r\n    UInt32 r = i;\r\n    unsigned j;\r\n    for (j = 0; j < 8; j++)\r\n      r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1));\r\n    g_CrcTable[i] = r;\r\n  }\r\n  for (; i < 256 * CRC_NUM_TABLES; i++)\r\n  {\r\n    UInt32 r = g_CrcTable[i - 256];\r\n    g_CrcTable[i] = g_CrcTable[r & 0xFF] ^ (r >> 8);\r\n  }\r\n  \r\n  #ifdef MY_CPU_LE\r\n\r\n  g_CrcUpdate = CrcUpdateT4;\r\n  \r\n  #if CRC_NUM_TABLES == 8\r\n  if (!CPU_Is_InOrder())\r\n    g_CrcUpdate = CrcUpdateT8;\r\n  #endif\r\n\r\n  #else\r\n  {\r\n    #ifndef MY_CPU_BE\r\n    UInt32 k = 1;\r\n    if (*(const Byte *)&k == 1)\r\n      g_CrcUpdate = CrcUpdateT4;\r\n    else\r\n    #endif\r\n    {\r\n      for (i = 256 * CRC_NUM_TABLES - 1; i >= 256; i--)\r\n      {\r\n        UInt32 x = g_CrcTable[i - 256];\r\n        g_CrcTable[i] = CRC_UINT32_SWAP(x);\r\n      }\r\n      g_CrcUpdate = CrcUpdateT1_BeT4;\r\n    }\r\n  }\r\n  #endif\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/7zCrc.h",
    "content": "/* 7zCrc.h -- CRC32 calculation\r\n2009-11-21 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __7Z_CRC_H\r\n#define __7Z_CRC_H\r\n\r\n#include \"Types.h\"\r\n\r\nEXTERN_C_BEGIN\r\n\r\nextern UInt32 g_CrcTable[];\r\n\r\n/* Call CrcGenerateTable one time before other CRC functions */\r\nvoid MY_FAST_CALL CrcGenerateTable(void);\r\n\r\n#define CRC_INIT_VAL 0xFFFFFFFF\r\n#define CRC_GET_DIGEST(crc) ((crc) ^ CRC_INIT_VAL)\r\n#define CRC_UPDATE_BYTE(crc, b) (g_CrcTable[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))\r\n\r\nUInt32 MY_FAST_CALL CrcUpdate(UInt32 crc, const void *data, size_t size);\r\nUInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size);\r\n\r\nEXTERN_C_END\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/7zCrcOpt.c",
    "content": "/* 7zCrcOpt.c -- CRC32 calculation\r\n2010-12-01 : Igor Pavlov : Public domain */\r\n\r\n#include \"CpuArch.h\"\r\n\r\n#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))\r\n\r\n#ifndef MY_CPU_BE\r\n\r\nUInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table)\r\n{\r\n  const Byte *p = (const Byte *)data;\r\n  for (; size > 0 && ((unsigned)(ptrdiff_t)p & 3) != 0; size--, p++)\r\n    v = CRC_UPDATE_BYTE_2(v, *p);\r\n  for (; size >= 4; size -= 4, p += 4)\r\n  {\r\n    v ^= *(const UInt32 *)p;\r\n    v =\r\n      table[0x300 + (v & 0xFF)] ^\r\n      table[0x200 + ((v >> 8) & 0xFF)] ^\r\n      table[0x100 + ((v >> 16) & 0xFF)] ^\r\n      table[0x000 + ((v >> 24))];\r\n  }\r\n  for (; size > 0; size--, p++)\r\n    v = CRC_UPDATE_BYTE_2(v, *p);\r\n  return v;\r\n}\r\n\r\nUInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table)\r\n{\r\n  return CrcUpdateT4(v, data, size, table);\r\n}\r\n\r\n#endif\r\n\r\n\r\n#ifndef MY_CPU_LE\r\n\r\n#define CRC_UINT32_SWAP(v) ((v >> 24) | ((v >> 8) & 0xFF00) | ((v << 8) & 0xFF0000) | (v << 24))\r\n\r\nUInt32 MY_FAST_CALL CrcUpdateT1_BeT4(UInt32 v, const void *data, size_t size, const UInt32 *table)\r\n{\r\n  const Byte *p = (const Byte *)data;\r\n  for (; size > 0 && ((unsigned)(ptrdiff_t)p & 3) != 0; size--, p++)\r\n    v = CRC_UPDATE_BYTE_2(v, *p);\r\n  v = CRC_UINT32_SWAP(v);\r\n  table += 0x100;\r\n  for (; size >= 4; size -= 4, p += 4)\r\n  {\r\n    v ^= *(const UInt32 *)p;\r\n    v =\r\n      table[0x000 + (v & 0xFF)] ^\r\n      table[0x100 + ((v >> 8) & 0xFF)] ^\r\n      table[0x200 + ((v >> 16) & 0xFF)] ^\r\n      table[0x300 + ((v >> 24))];\r\n  }\r\n  table -= 0x100;\r\n  v = CRC_UINT32_SWAP(v);\r\n  for (; size > 0; size--, p++)\r\n    v = CRC_UPDATE_BYTE_2(v, *p);\r\n  return v;\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/7zDec.c",
    "content": "/* 7zDec.c -- Decoding from 7z folder\r\n2010-11-02 : Igor Pavlov : Public domain */\r\n\r\n#include <string.h>\r\n\r\n/* #define _7ZIP_PPMD_SUPPPORT */\r\n\r\n#include \"7z.h\"\r\n\r\n#include \"Bcj2.h\"\r\n#include \"Bra.h\"\r\n#include \"CpuArch.h\"\r\n#include \"LzmaDec.h\"\r\n#include \"Lzma2Dec.h\"\r\n#ifdef _7ZIP_PPMD_SUPPPORT\r\n#include \"Ppmd7.h\"\r\n#endif\r\n\r\n#define k_Copy 0\r\n#define k_LZMA2 0x21\r\n#define k_LZMA  0x30101\r\n#define k_BCJ   0x03030103\r\n#define k_PPC   0x03030205\r\n#define k_ARM   0x03030501\r\n#define k_ARMT  0x03030701\r\n#define k_SPARC 0x03030805\r\n#define k_BCJ2  0x0303011B\r\n\r\n#ifdef _7ZIP_PPMD_SUPPPORT\r\n\r\n#define k_PPMD 0x30401\r\n\r\ntypedef struct\r\n{\r\n  IByteIn p;\r\n  const Byte *cur;\r\n  const Byte *end;\r\n  const Byte *begin;\r\n  UInt64 processed;\r\n  Bool extra;\r\n  SRes res;\r\n  ILookInStream *inStream;\r\n} CByteInToLook;\r\n\r\nstatic Byte ReadByte(void *pp)\r\n{\r\n  CByteInToLook *p = (CByteInToLook *)pp;\r\n  if (p->cur != p->end)\r\n    return *p->cur++;\r\n  if (p->res == SZ_OK)\r\n  {\r\n    size_t size = p->cur - p->begin;\r\n    p->processed += size;\r\n    p->res = p->inStream->Skip(p->inStream, size);\r\n    size = (1 << 25);\r\n    p->res = p->inStream->Look(p->inStream, (const void **)&p->begin, &size);\r\n    p->cur = p->begin;\r\n    p->end = p->begin + size;\r\n    if (size != 0)\r\n      return *p->cur++;;\r\n  }\r\n  p->extra = True;\r\n  return 0;\r\n}\r\n\r\nstatic SRes SzDecodePpmd(CSzCoderInfo *coder, UInt64 inSize, ILookInStream *inStream,\r\n    Byte *outBuffer, SizeT outSize, ISzAlloc *allocMain)\r\n{\r\n  CPpmd7 ppmd;\r\n  CByteInToLook s;\r\n  SRes res = SZ_OK;\r\n\r\n  s.p.Read = ReadByte;\r\n  s.inStream = inStream;\r\n  s.begin = s.end = s.cur = NULL;\r\n  s.extra = False;\r\n  s.res = SZ_OK;\r\n  s.processed = 0;\r\n\r\n  if (coder->Props.size != 5)\r\n    return SZ_ERROR_UNSUPPORTED;\r\n\r\n  {\r\n    unsigned order = coder->Props.data[0];\r\n    UInt32 memSize = GetUi32(coder->Props.data + 1);\r\n    if (order < PPMD7_MIN_ORDER ||\r\n        order > PPMD7_MAX_ORDER ||\r\n        memSize < PPMD7_MIN_MEM_SIZE ||\r\n        memSize > PPMD7_MAX_MEM_SIZE)\r\n      return SZ_ERROR_UNSUPPORTED;\r\n    Ppmd7_Construct(&ppmd);\r\n    if (!Ppmd7_Alloc(&ppmd, memSize, allocMain))\r\n      return SZ_ERROR_MEM;\r\n    Ppmd7_Init(&ppmd, order);\r\n  }\r\n  {\r\n    CPpmd7z_RangeDec rc;\r\n    Ppmd7z_RangeDec_CreateVTable(&rc);\r\n    rc.Stream = &s.p;\r\n    if (!Ppmd7z_RangeDec_Init(&rc))\r\n      res = SZ_ERROR_DATA;\r\n    else if (s.extra)\r\n      res = (s.res != SZ_OK ? s.res : SZ_ERROR_DATA);\r\n    else\r\n    {\r\n      SizeT i;\r\n      for (i = 0; i < outSize; i++)\r\n      {\r\n        int sym = Ppmd7_DecodeSymbol(&ppmd, &rc.p);\r\n        if (s.extra || sym < 0)\r\n          break;\r\n        outBuffer[i] = (Byte)sym;\r\n      }\r\n      if (i != outSize)\r\n        res = (s.res != SZ_OK ? s.res : SZ_ERROR_DATA);\r\n      else if (s.processed + (s.cur - s.begin) != inSize || !Ppmd7z_RangeDec_IsFinishedOK(&rc))\r\n        res = SZ_ERROR_DATA;\r\n    }\r\n  }\r\n  Ppmd7_Free(&ppmd, allocMain);\r\n  return res;\r\n}\r\n\r\n#endif\r\n\r\n\r\nstatic SRes SzDecodeLzma(CSzCoderInfo *coder, UInt64 inSize, ILookInStream *inStream,\r\n    Byte *outBuffer, SizeT outSize, ISzAlloc *allocMain)\r\n{\r\n  CLzmaDec state;\r\n  SRes res = SZ_OK;\r\n\r\n  LzmaDec_Construct(&state);\r\n  RINOK(LzmaDec_AllocateProbs(&state, coder->Props.data, (unsigned)coder->Props.size, allocMain));\r\n  state.dic = outBuffer;\r\n  state.dicBufSize = outSize;\r\n  LzmaDec_Init(&state);\r\n\r\n  for (;;)\r\n  {\r\n    Byte *inBuf = NULL;\r\n    size_t lookahead = (1 << 18);\r\n    if (lookahead > inSize)\r\n      lookahead = (size_t)inSize;\r\n    res = inStream->Look((void *)inStream, (const void **)&inBuf, &lookahead);\r\n    if (res != SZ_OK)\r\n      break;\r\n\r\n    {\r\n      SizeT inProcessed = (SizeT)lookahead, dicPos = state.dicPos;\r\n      ELzmaStatus status;\r\n      res = LzmaDec_DecodeToDic(&state, outSize, inBuf, &inProcessed, LZMA_FINISH_END, &status);\r\n      lookahead -= inProcessed;\r\n      inSize -= inProcessed;\r\n      if (res != SZ_OK)\r\n        break;\r\n      if (state.dicPos == state.dicBufSize || (inProcessed == 0 && dicPos == state.dicPos))\r\n      {\r\n        if (state.dicBufSize != outSize || lookahead != 0 ||\r\n            (status != LZMA_STATUS_FINISHED_WITH_MARK &&\r\n             status != LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK))\r\n          res = SZ_ERROR_DATA;\r\n        break;\r\n      }\r\n      res = inStream->Skip((void *)inStream, inProcessed);\r\n      if (res != SZ_OK)\r\n        break;\r\n    }\r\n  }\r\n\r\n  LzmaDec_FreeProbs(&state, allocMain);\r\n  return res;\r\n}\r\n\r\nstatic SRes SzDecodeLzma2(CSzCoderInfo *coder, UInt64 inSize, ILookInStream *inStream,\r\n    Byte *outBuffer, SizeT outSize, ISzAlloc *allocMain)\r\n{\r\n  CLzma2Dec state;\r\n  SRes res = SZ_OK;\r\n\r\n  Lzma2Dec_Construct(&state);\r\n  if (coder->Props.size != 1)\r\n    return SZ_ERROR_DATA;\r\n  RINOK(Lzma2Dec_AllocateProbs(&state, coder->Props.data[0], allocMain));\r\n  state.decoder.dic = outBuffer;\r\n  state.decoder.dicBufSize = outSize;\r\n  Lzma2Dec_Init(&state);\r\n\r\n  for (;;)\r\n  {\r\n    Byte *inBuf = NULL;\r\n    size_t lookahead = (1 << 18);\r\n    if (lookahead > inSize)\r\n      lookahead = (size_t)inSize;\r\n    res = inStream->Look((void *)inStream, (const void **)&inBuf, &lookahead);\r\n    if (res != SZ_OK)\r\n      break;\r\n\r\n    {\r\n      SizeT inProcessed = (SizeT)lookahead, dicPos = state.decoder.dicPos;\r\n      ELzmaStatus status;\r\n      res = Lzma2Dec_DecodeToDic(&state, outSize, inBuf, &inProcessed, LZMA_FINISH_END, &status);\r\n      lookahead -= inProcessed;\r\n      inSize -= inProcessed;\r\n      if (res != SZ_OK)\r\n        break;\r\n      if (state.decoder.dicPos == state.decoder.dicBufSize || (inProcessed == 0 && dicPos == state.decoder.dicPos))\r\n      {\r\n        if (state.decoder.dicBufSize != outSize || lookahead != 0 ||\r\n            (status != LZMA_STATUS_FINISHED_WITH_MARK))\r\n          res = SZ_ERROR_DATA;\r\n        break;\r\n      }\r\n      res = inStream->Skip((void *)inStream, inProcessed);\r\n      if (res != SZ_OK)\r\n        break;\r\n    }\r\n  }\r\n\r\n  Lzma2Dec_FreeProbs(&state, allocMain);\r\n  return res;\r\n}\r\n\r\nstatic SRes SzDecodeCopy(UInt64 inSize, ILookInStream *inStream, Byte *outBuffer)\r\n{\r\n  while (inSize > 0)\r\n  {\r\n    void *inBuf;\r\n    size_t curSize = (1 << 18);\r\n    if (curSize > inSize)\r\n      curSize = (size_t)inSize;\r\n    RINOK(inStream->Look((void *)inStream, (const void **)&inBuf, &curSize));\r\n    if (curSize == 0)\r\n      return SZ_ERROR_INPUT_EOF;\r\n    memcpy(outBuffer, inBuf, curSize);\r\n    outBuffer += curSize;\r\n    inSize -= curSize;\r\n    RINOK(inStream->Skip((void *)inStream, curSize));\r\n  }\r\n  return SZ_OK;\r\n}\r\n\r\nstatic Bool IS_MAIN_METHOD(UInt32 m)\r\n{\r\n  switch(m)\r\n  {\r\n    case k_Copy:\r\n    case k_LZMA:\r\n    case k_LZMA2:\r\n    #ifdef _7ZIP_PPMD_SUPPPORT\r\n    case k_PPMD:\r\n    #endif\r\n      return True;\r\n  }\r\n  return False;\r\n}\r\n\r\nstatic Bool IS_SUPPORTED_CODER(const CSzCoderInfo *c)\r\n{\r\n  return\r\n      c->NumInStreams == 1 &&\r\n      c->NumOutStreams == 1 &&\r\n      c->MethodID <= (UInt32)0xFFFFFFFF &&\r\n      IS_MAIN_METHOD((UInt32)c->MethodID);\r\n}\r\n\r\n#define IS_BCJ2(c) ((c)->MethodID == k_BCJ2 && (c)->NumInStreams == 4 && (c)->NumOutStreams == 1)\r\n\r\nstatic SRes CheckSupportedFolder(const CSzFolder *f)\r\n{\r\n  if (f->NumCoders < 1 || f->NumCoders > 4)\r\n    return SZ_ERROR_UNSUPPORTED;\r\n  if (!IS_SUPPORTED_CODER(&f->Coders[0]))\r\n    return SZ_ERROR_UNSUPPORTED;\r\n  if (f->NumCoders == 1)\r\n  {\r\n    if (f->NumPackStreams != 1 || f->PackStreams[0] != 0 || f->NumBindPairs != 0)\r\n      return SZ_ERROR_UNSUPPORTED;\r\n    return SZ_OK;\r\n  }\r\n  if (f->NumCoders == 2)\r\n  {\r\n    CSzCoderInfo *c = &f->Coders[1];\r\n    if (c->MethodID > (UInt32)0xFFFFFFFF ||\r\n        c->NumInStreams != 1 ||\r\n        c->NumOutStreams != 1 ||\r\n        f->NumPackStreams != 1 ||\r\n        f->PackStreams[0] != 0 ||\r\n        f->NumBindPairs != 1 ||\r\n        f->BindPairs[0].InIndex != 1 ||\r\n        f->BindPairs[0].OutIndex != 0)\r\n      return SZ_ERROR_UNSUPPORTED;\r\n    switch ((UInt32)c->MethodID)\r\n    {\r\n      case k_BCJ:\r\n      case k_ARM:\r\n        break;\r\n      default:\r\n        return SZ_ERROR_UNSUPPORTED;\r\n    }\r\n    return SZ_OK;\r\n  }\r\n  if (f->NumCoders == 4)\r\n  {\r\n    if (!IS_SUPPORTED_CODER(&f->Coders[1]) ||\r\n        !IS_SUPPORTED_CODER(&f->Coders[2]) ||\r\n        !IS_BCJ2(&f->Coders[3]))\r\n      return SZ_ERROR_UNSUPPORTED;\r\n    if (f->NumPackStreams != 4 ||\r\n        f->PackStreams[0] != 2 ||\r\n        f->PackStreams[1] != 6 ||\r\n        f->PackStreams[2] != 1 ||\r\n        f->PackStreams[3] != 0 ||\r\n        f->NumBindPairs != 3 ||\r\n        f->BindPairs[0].InIndex != 5 || f->BindPairs[0].OutIndex != 0 ||\r\n        f->BindPairs[1].InIndex != 4 || f->BindPairs[1].OutIndex != 1 ||\r\n        f->BindPairs[2].InIndex != 3 || f->BindPairs[2].OutIndex != 2)\r\n      return SZ_ERROR_UNSUPPORTED;\r\n    return SZ_OK;\r\n  }\r\n  return SZ_ERROR_UNSUPPORTED;\r\n}\r\n\r\nstatic UInt64 GetSum(const UInt64 *values, UInt32 index)\r\n{\r\n  UInt64 sum = 0;\r\n  UInt32 i;\r\n  for (i = 0; i < index; i++)\r\n    sum += values[i];\r\n  return sum;\r\n}\r\n\r\n#define CASE_BRA_CONV(isa) case k_ ## isa: isa ## _Convert(outBuffer, outSize, 0, 0); break;\r\n\r\nstatic SRes SzFolder_Decode2(const CSzFolder *folder, const UInt64 *packSizes,\r\n    ILookInStream *inStream, UInt64 startPos,\r\n    Byte *outBuffer, SizeT outSize, ISzAlloc *allocMain,\r\n    Byte *tempBuf[])\r\n{\r\n  UInt32 ci;\r\n  SizeT tempSizes[3] = { 0, 0, 0};\r\n  SizeT tempSize3 = 0;\r\n  Byte *tempBuf3 = 0;\r\n\r\n  RINOK(CheckSupportedFolder(folder));\r\n\r\n  for (ci = 0; ci < folder->NumCoders; ci++)\r\n  {\r\n    CSzCoderInfo *coder = &folder->Coders[ci];\r\n\r\n    if (IS_MAIN_METHOD((UInt32)coder->MethodID))\r\n    {\r\n      UInt32 si = 0;\r\n      UInt64 offset;\r\n      UInt64 inSize;\r\n      Byte *outBufCur = outBuffer;\r\n      SizeT outSizeCur = outSize;\r\n      if (folder->NumCoders == 4)\r\n      {\r\n        UInt32 indices[] = { 3, 2, 0 };\r\n        UInt64 unpackSize = folder->UnpackSizes[ci];\r\n        si = indices[ci];\r\n        if (ci < 2)\r\n        {\r\n          Byte *temp;\r\n          outSizeCur = (SizeT)unpackSize;\r\n          if (outSizeCur != unpackSize)\r\n            return SZ_ERROR_MEM;\r\n          temp = (Byte *)IAlloc_Alloc(allocMain, outSizeCur);\r\n          if (temp == 0 && outSizeCur != 0)\r\n            return SZ_ERROR_MEM;\r\n          outBufCur = tempBuf[1 - ci] = temp;\r\n          tempSizes[1 - ci] = outSizeCur;\r\n        }\r\n        else if (ci == 2)\r\n        {\r\n          if (unpackSize > outSize) /* check it */\r\n            return SZ_ERROR_PARAM;\r\n          tempBuf3 = outBufCur = outBuffer + (outSize - (size_t)unpackSize);\r\n          tempSize3 = outSizeCur = (SizeT)unpackSize;\r\n        }\r\n        else\r\n          return SZ_ERROR_UNSUPPORTED;\r\n      }\r\n      offset = GetSum(packSizes, si);\r\n      inSize = packSizes[si];\r\n      RINOK(LookInStream_SeekTo(inStream, startPos + offset));\r\n\r\n      if (coder->MethodID == k_Copy)\r\n      {\r\n        if (inSize != outSizeCur) /* check it */\r\n          return SZ_ERROR_DATA;\r\n        RINOK(SzDecodeCopy(inSize, inStream, outBufCur));\r\n      }\r\n      else if (coder->MethodID == k_LZMA)\r\n      {\r\n        RINOK(SzDecodeLzma(coder, inSize, inStream, outBufCur, outSizeCur, allocMain));\r\n      }\r\n      else if (coder->MethodID == k_LZMA2)\r\n      {\r\n        RINOK(SzDecodeLzma2(coder, inSize, inStream, outBufCur, outSizeCur, allocMain));\r\n      }\r\n      else\r\n      {\r\n        #ifdef _7ZIP_PPMD_SUPPPORT\r\n        RINOK(SzDecodePpmd(coder, inSize, inStream, outBufCur, outSizeCur, allocMain));\r\n        #else\r\n        return SZ_ERROR_UNSUPPORTED;\r\n        #endif\r\n      }\r\n    }\r\n    else if (coder->MethodID == k_BCJ2)\r\n    {\r\n      UInt64 offset = GetSum(packSizes, 1);\r\n      UInt64 s3Size = packSizes[1];\r\n      SRes res;\r\n      if (ci != 3)\r\n        return SZ_ERROR_UNSUPPORTED;\r\n      RINOK(LookInStream_SeekTo(inStream, startPos + offset));\r\n      tempSizes[2] = (SizeT)s3Size;\r\n      if (tempSizes[2] != s3Size)\r\n        return SZ_ERROR_MEM;\r\n      tempBuf[2] = (Byte *)IAlloc_Alloc(allocMain, tempSizes[2]);\r\n      if (tempBuf[2] == 0 && tempSizes[2] != 0)\r\n        return SZ_ERROR_MEM;\r\n      res = SzDecodeCopy(s3Size, inStream, tempBuf[2]);\r\n      RINOK(res)\r\n\r\n      res = Bcj2_Decode(\r\n          tempBuf3, tempSize3,\r\n          tempBuf[0], tempSizes[0],\r\n          tempBuf[1], tempSizes[1],\r\n          tempBuf[2], tempSizes[2],\r\n          outBuffer, outSize);\r\n      RINOK(res)\r\n    }\r\n    else\r\n    {\r\n      if (ci != 1)\r\n        return SZ_ERROR_UNSUPPORTED;\r\n      switch(coder->MethodID)\r\n      {\r\n        case k_BCJ:\r\n        {\r\n          UInt32 state;\r\n          x86_Convert_Init(state);\r\n          x86_Convert(outBuffer, outSize, 0, &state, 0);\r\n          break;\r\n        }\r\n        CASE_BRA_CONV(ARM)\r\n        default:\r\n          return SZ_ERROR_UNSUPPORTED;\r\n      }\r\n    }\r\n  }\r\n  return SZ_OK;\r\n}\r\n\r\nSRes SzFolder_Decode(const CSzFolder *folder, const UInt64 *packSizes,\r\n    ILookInStream *inStream, UInt64 startPos,\r\n    Byte *outBuffer, size_t outSize, ISzAlloc *allocMain)\r\n{\r\n  Byte *tempBuf[3] = { 0, 0, 0};\r\n  int i;\r\n  SRes res = SzFolder_Decode2(folder, packSizes, inStream, startPos,\r\n      outBuffer, (SizeT)outSize, allocMain, tempBuf);\r\n  for (i = 0; i < 3; i++)\r\n    IAlloc_Free(allocMain, tempBuf[i]);\r\n  return res;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/7zFile.c",
    "content": "/* 7zFile.c -- File IO\r\n2009-11-24 : Igor Pavlov : Public domain */\r\n\r\n#include \"7zFile.h\"\r\n\r\n#ifndef USE_WINDOWS_FILE\r\n\r\n#ifndef UNDER_CE\r\n#include <errno.h>\r\n#endif\r\n\r\n#else\r\n\r\n/*\r\n   ReadFile and WriteFile functions in Windows have BUG:\r\n   If you Read or Write 64MB or more (probably min_failure_size = 64MB - 32KB + 1)\r\n   from/to Network file, it returns ERROR_NO_SYSTEM_RESOURCES\r\n   (Insufficient system resources exist to complete the requested service).\r\n   Probably in some version of Windows there are problems with other sizes:\r\n   for 32 MB (maybe also for 16 MB).\r\n   And message can be \"Network connection was lost\"\r\n*/\r\n\r\n#define kChunkSizeMax (1 << 22)\r\n\r\n#endif\r\n\r\nvoid File_Construct(CSzFile *p)\r\n{\r\n  #ifdef USE_WINDOWS_FILE\r\n  p->handle = INVALID_HANDLE_VALUE;\r\n  #else\r\n  p->file = NULL;\r\n  #endif\r\n}\r\n\r\n#if !defined(UNDER_CE) || !defined(USE_WINDOWS_FILE)\r\nstatic WRes File_Open(CSzFile *p, const char *name, int writeMode)\r\n{\r\n  #ifdef USE_WINDOWS_FILE\r\n  p->handle = CreateFileA(name,\r\n      writeMode ? GENERIC_WRITE : GENERIC_READ,\r\n      FILE_SHARE_READ, NULL,\r\n      writeMode ? CREATE_ALWAYS : OPEN_EXISTING,\r\n      FILE_ATTRIBUTE_NORMAL, NULL);\r\n  return (p->handle != INVALID_HANDLE_VALUE) ? 0 : GetLastError();\r\n  #else\r\n  p->file = fopen(name, writeMode ? \"wb+\" : \"rb\");\r\n  return (p->file != 0) ? 0 :\r\n    #ifdef UNDER_CE\r\n    2; /* ENOENT */\r\n    #else\r\n    errno;\r\n    #endif\r\n  #endif\r\n}\r\n\r\nWRes InFile_Open(CSzFile *p, const char *name) { return File_Open(p, name, 0); }\r\nWRes OutFile_Open(CSzFile *p, const char *name) { return File_Open(p, name, 1); }\r\n#endif\r\n\r\n#ifdef USE_WINDOWS_FILE\r\nstatic WRes File_OpenW(CSzFile *p, const WCHAR *name, int writeMode)\r\n{\r\n  p->handle = CreateFileW(name,\r\n      writeMode ? GENERIC_WRITE : GENERIC_READ,\r\n      FILE_SHARE_READ, NULL,\r\n      writeMode ? CREATE_ALWAYS : OPEN_EXISTING,\r\n      FILE_ATTRIBUTE_NORMAL, NULL);\r\n  return (p->handle != INVALID_HANDLE_VALUE) ? 0 : GetLastError();\r\n}\r\nWRes InFile_OpenW(CSzFile *p, const WCHAR *name) { return File_OpenW(p, name, 0); }\r\nWRes OutFile_OpenW(CSzFile *p, const WCHAR *name) { return File_OpenW(p, name, 1); }\r\n#endif\r\n\r\nWRes File_Close(CSzFile *p)\r\n{\r\n  #ifdef USE_WINDOWS_FILE\r\n  if (p->handle != INVALID_HANDLE_VALUE)\r\n  {\r\n    if (!CloseHandle(p->handle))\r\n      return GetLastError();\r\n    p->handle = INVALID_HANDLE_VALUE;\r\n  }\r\n  #else\r\n  if (p->file != NULL)\r\n  {\r\n    int res = fclose(p->file);\r\n    if (res != 0)\r\n      return res;\r\n    p->file = NULL;\r\n  }\r\n  #endif\r\n  return 0;\r\n}\r\n\r\nWRes File_Read(CSzFile *p, void *data, size_t *size)\r\n{\r\n  size_t originalSize = *size;\r\n  if (originalSize == 0)\r\n    return 0;\r\n\r\n  #ifdef USE_WINDOWS_FILE\r\n\r\n  *size = 0;\r\n  do\r\n  {\r\n    DWORD curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : (DWORD)originalSize;\r\n    DWORD processed = 0;\r\n    BOOL res = ReadFile(p->handle, data, curSize, &processed, NULL);\r\n    data = (void *)((Byte *)data + processed);\r\n    originalSize -= processed;\r\n    *size += processed;\r\n    if (!res)\r\n      return GetLastError();\r\n    if (processed == 0)\r\n      break;\r\n  }\r\n  while (originalSize > 0);\r\n  return 0;\r\n\r\n  #else\r\n  \r\n  *size = fread(data, 1, originalSize, p->file);\r\n  if (*size == originalSize)\r\n    return 0;\r\n  return ferror(p->file);\r\n  \r\n  #endif\r\n}\r\n\r\nWRes File_Write(CSzFile *p, const void *data, size_t *size)\r\n{\r\n  size_t originalSize = *size;\r\n  if (originalSize == 0)\r\n    return 0;\r\n  \r\n  #ifdef USE_WINDOWS_FILE\r\n\r\n  *size = 0;\r\n  do\r\n  {\r\n    DWORD curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : (DWORD)originalSize;\r\n    DWORD processed = 0;\r\n    BOOL res = WriteFile(p->handle, data, curSize, &processed, NULL);\r\n    data = (void *)((Byte *)data + processed);\r\n    originalSize -= processed;\r\n    *size += processed;\r\n    if (!res)\r\n      return GetLastError();\r\n    if (processed == 0)\r\n      break;\r\n  }\r\n  while (originalSize > 0);\r\n  return 0;\r\n\r\n  #else\r\n\r\n  *size = fwrite(data, 1, originalSize, p->file);\r\n  if (*size == originalSize)\r\n    return 0;\r\n  return ferror(p->file);\r\n  \r\n  #endif\r\n}\r\n\r\nWRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin)\r\n{\r\n  #ifdef USE_WINDOWS_FILE\r\n\r\n  LARGE_INTEGER value;\r\n  DWORD moveMethod;\r\n  value.LowPart = (DWORD)*pos;\r\n  value.HighPart = (LONG)((UInt64)*pos >> 16 >> 16); /* for case when UInt64 is 32-bit only */\r\n  switch (origin)\r\n  {\r\n    case SZ_SEEK_SET: moveMethod = FILE_BEGIN; break;\r\n    case SZ_SEEK_CUR: moveMethod = FILE_CURRENT; break;\r\n    case SZ_SEEK_END: moveMethod = FILE_END; break;\r\n    default: return ERROR_INVALID_PARAMETER;\r\n  }\r\n  value.LowPart = SetFilePointer(p->handle, value.LowPart, &value.HighPart, moveMethod);\r\n  if (value.LowPart == 0xFFFFFFFF)\r\n  {\r\n    WRes res = GetLastError();\r\n    if (res != NO_ERROR)\r\n      return res;\r\n  }\r\n  *pos = ((Int64)value.HighPart << 32) | value.LowPart;\r\n  return 0;\r\n\r\n  #else\r\n  \r\n  int moveMethod;\r\n  int res;\r\n  switch (origin)\r\n  {\r\n    case SZ_SEEK_SET: moveMethod = SEEK_SET; break;\r\n    case SZ_SEEK_CUR: moveMethod = SEEK_CUR; break;\r\n    case SZ_SEEK_END: moveMethod = SEEK_END; break;\r\n    default: return 1;\r\n  }\r\n  res = fseek(p->file, (long)*pos, moveMethod);\r\n  *pos = ftell(p->file);\r\n  return res;\r\n  \r\n  #endif\r\n}\r\n\r\nWRes File_GetLength(CSzFile *p, UInt64 *length)\r\n{\r\n  #ifdef USE_WINDOWS_FILE\r\n  \r\n  DWORD sizeHigh;\r\n  DWORD sizeLow = GetFileSize(p->handle, &sizeHigh);\r\n  if (sizeLow == 0xFFFFFFFF)\r\n  {\r\n    DWORD res = GetLastError();\r\n    if (res != NO_ERROR)\r\n      return res;\r\n  }\r\n  *length = (((UInt64)sizeHigh) << 32) + sizeLow;\r\n  return 0;\r\n  \r\n  #else\r\n  \r\n  long pos = ftell(p->file);\r\n  int res = fseek(p->file, 0, SEEK_END);\r\n  *length = ftell(p->file);\r\n  fseek(p->file, pos, SEEK_SET);\r\n  return res;\r\n  \r\n  #endif\r\n}\r\n\r\n\r\n/* ---------- FileSeqInStream ---------- */\r\n\r\nstatic SRes FileSeqInStream_Read(void *pp, void *buf, size_t *size)\r\n{\r\n  CFileSeqInStream *p = (CFileSeqInStream *)pp;\r\n  return File_Read(&p->file, buf, size) == 0 ? SZ_OK : SZ_ERROR_READ;\r\n}\r\n\r\nvoid FileSeqInStream_CreateVTable(CFileSeqInStream *p)\r\n{\r\n  p->s.Read = FileSeqInStream_Read;\r\n}\r\n\r\n\r\n/* ---------- FileInStream ---------- */\r\n\r\nstatic SRes FileInStream_Read(void *pp, void *buf, size_t *size)\r\n{\r\n  CFileInStream *p = (CFileInStream *)pp;\r\n  return (File_Read(&p->file, buf, size) == 0) ? SZ_OK : SZ_ERROR_READ;\r\n}\r\n\r\nstatic SRes FileInStream_Seek(void *pp, Int64 *pos, ESzSeek origin)\r\n{\r\n  CFileInStream *p = (CFileInStream *)pp;\r\n  return File_Seek(&p->file, pos, origin);\r\n}\r\n\r\nvoid FileInStream_CreateVTable(CFileInStream *p)\r\n{\r\n  p->s.Read = FileInStream_Read;\r\n  p->s.Seek = FileInStream_Seek;\r\n}\r\n\r\n\r\n/* ---------- FileOutStream ---------- */\r\n\r\nstatic size_t FileOutStream_Write(void *pp, const void *data, size_t size)\r\n{\r\n  CFileOutStream *p = (CFileOutStream *)pp;\r\n  File_Write(&p->file, data, &size);\r\n  return size;\r\n}\r\n\r\nvoid FileOutStream_CreateVTable(CFileOutStream *p)\r\n{\r\n  p->s.Write = FileOutStream_Write;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/7zFile.h",
    "content": "/* 7zFile.h -- File IO\r\n2009-11-24 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __7Z_FILE_H\r\n#define __7Z_FILE_H\r\n\r\n#ifdef _WIN32\r\n#define USE_WINDOWS_FILE\r\n#endif\r\n\r\n#ifdef USE_WINDOWS_FILE\r\n#include <windows.h>\r\n#else\r\n#include <stdio.h>\r\n#endif\r\n\r\n#include \"Types.h\"\r\n\r\nEXTERN_C_BEGIN\r\n\r\n/* ---------- File ---------- */\r\n\r\ntypedef struct\r\n{\r\n  #ifdef USE_WINDOWS_FILE\r\n  HANDLE handle;\r\n  #else\r\n  FILE *file;\r\n  #endif\r\n} CSzFile;\r\n\r\nvoid File_Construct(CSzFile *p);\r\n#if !defined(UNDER_CE) || !defined(USE_WINDOWS_FILE)\r\nWRes InFile_Open(CSzFile *p, const char *name);\r\nWRes OutFile_Open(CSzFile *p, const char *name);\r\n#endif\r\n#ifdef USE_WINDOWS_FILE\r\nWRes InFile_OpenW(CSzFile *p, const WCHAR *name);\r\nWRes OutFile_OpenW(CSzFile *p, const WCHAR *name);\r\n#endif\r\nWRes File_Close(CSzFile *p);\r\n\r\n/* reads max(*size, remain file's size) bytes */\r\nWRes File_Read(CSzFile *p, void *data, size_t *size);\r\n\r\n/* writes *size bytes */\r\nWRes File_Write(CSzFile *p, const void *data, size_t *size);\r\n\r\nWRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin);\r\nWRes File_GetLength(CSzFile *p, UInt64 *length);\r\n\r\n\r\n/* ---------- FileInStream ---------- */\r\n\r\ntypedef struct\r\n{\r\n  ISeqInStream s;\r\n  CSzFile file;\r\n} CFileSeqInStream;\r\n\r\nvoid FileSeqInStream_CreateVTable(CFileSeqInStream *p);\r\n\r\n\r\ntypedef struct\r\n{\r\n  ISeekInStream s;\r\n  CSzFile file;\r\n} CFileInStream;\r\n\r\nvoid FileInStream_CreateVTable(CFileInStream *p);\r\n\r\n\r\ntypedef struct\r\n{\r\n  ISeqOutStream s;\r\n  CSzFile file;\r\n} CFileOutStream;\r\n\r\nvoid FileOutStream_CreateVTable(CFileOutStream *p);\r\n\r\nEXTERN_C_END\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/7zIn.c",
    "content": "/* 7zIn.c -- 7z Input functions\r\n2010-10-29 : Igor Pavlov : Public domain */\r\n\r\n#include <string.h>\r\n\r\n#include \"7z.h\"\r\n#include \"7zCrc.h\"\r\n#include \"CpuArch.h\"\r\n\r\nByte k7zSignature[k7zSignatureSize] = {'7', 'z', 0xBC, 0xAF, 0x27, 0x1C};\r\n\r\n#define RINOM(x) { if ((x) == 0) return SZ_ERROR_MEM; }\r\n\r\n#define NUM_FOLDER_CODERS_MAX 32\r\n#define NUM_CODER_STREAMS_MAX 32\r\n\r\nvoid SzCoderInfo_Init(CSzCoderInfo *p)\r\n{\r\n  Buf_Init(&p->Props);\r\n}\r\n\r\nvoid SzCoderInfo_Free(CSzCoderInfo *p, ISzAlloc *alloc)\r\n{\r\n  Buf_Free(&p->Props, alloc);\r\n  SzCoderInfo_Init(p);\r\n}\r\n\r\nvoid SzFolder_Init(CSzFolder *p)\r\n{\r\n  p->Coders = 0;\r\n  p->BindPairs = 0;\r\n  p->PackStreams = 0;\r\n  p->UnpackSizes = 0;\r\n  p->NumCoders = 0;\r\n  p->NumBindPairs = 0;\r\n  p->NumPackStreams = 0;\r\n  p->UnpackCRCDefined = 0;\r\n  p->UnpackCRC = 0;\r\n  p->NumUnpackStreams = 0;\r\n}\r\n\r\nvoid SzFolder_Free(CSzFolder *p, ISzAlloc *alloc)\r\n{\r\n  UInt32 i;\r\n  if (p->Coders)\r\n    for (i = 0; i < p->NumCoders; i++)\r\n      SzCoderInfo_Free(&p->Coders[i], alloc);\r\n  IAlloc_Free(alloc, p->Coders);\r\n  IAlloc_Free(alloc, p->BindPairs);\r\n  IAlloc_Free(alloc, p->PackStreams);\r\n  IAlloc_Free(alloc, p->UnpackSizes);\r\n  SzFolder_Init(p);\r\n}\r\n\r\nUInt32 SzFolder_GetNumOutStreams(CSzFolder *p)\r\n{\r\n  UInt32 result = 0;\r\n  UInt32 i;\r\n  for (i = 0; i < p->NumCoders; i++)\r\n    result += p->Coders[i].NumOutStreams;\r\n  return result;\r\n}\r\n\r\nint SzFolder_FindBindPairForInStream(CSzFolder *p, UInt32 inStreamIndex)\r\n{\r\n  UInt32 i;\r\n  for (i = 0; i < p->NumBindPairs; i++)\r\n    if (p->BindPairs[i].InIndex == inStreamIndex)\r\n      return i;\r\n  return -1;\r\n}\r\n\r\n\r\nint SzFolder_FindBindPairForOutStream(CSzFolder *p, UInt32 outStreamIndex)\r\n{\r\n  UInt32 i;\r\n  for (i = 0; i < p->NumBindPairs; i++)\r\n    if (p->BindPairs[i].OutIndex == outStreamIndex)\r\n      return i;\r\n  return -1;\r\n}\r\n\r\nUInt64 SzFolder_GetUnpackSize(CSzFolder *p)\r\n{\r\n  int i = (int)SzFolder_GetNumOutStreams(p);\r\n  if (i == 0)\r\n    return 0;\r\n  for (i--; i >= 0; i--)\r\n    if (SzFolder_FindBindPairForOutStream(p, i) < 0)\r\n      return p->UnpackSizes[i];\r\n  /* throw 1; */\r\n  return 0;\r\n}\r\n\r\nvoid SzFile_Init(CSzFileItem *p)\r\n{\r\n  p->HasStream = 1;\r\n  p->IsDir = 0;\r\n  p->IsAnti = 0;\r\n  p->CrcDefined = 0;\r\n  p->MTimeDefined = 0;\r\n}\r\n\r\nvoid SzAr_Init(CSzAr *p)\r\n{\r\n  p->PackSizes = 0;\r\n  p->PackCRCsDefined = 0;\r\n  p->PackCRCs = 0;\r\n  p->Folders = 0;\r\n  p->Files = 0;\r\n  p->NumPackStreams = 0;\r\n  p->NumFolders = 0;\r\n  p->NumFiles = 0;\r\n}\r\n\r\nvoid SzAr_Free(CSzAr *p, ISzAlloc *alloc)\r\n{\r\n  UInt32 i;\r\n  if (p->Folders)\r\n    for (i = 0; i < p->NumFolders; i++)\r\n      SzFolder_Free(&p->Folders[i], alloc);\r\n\r\n  IAlloc_Free(alloc, p->PackSizes);\r\n  IAlloc_Free(alloc, p->PackCRCsDefined);\r\n  IAlloc_Free(alloc, p->PackCRCs);\r\n  IAlloc_Free(alloc, p->Folders);\r\n  IAlloc_Free(alloc, p->Files);\r\n  SzAr_Init(p);\r\n}\r\n\r\n\r\nvoid SzArEx_Init(CSzArEx *p)\r\n{\r\n  SzAr_Init(&p->db);\r\n  p->FolderStartPackStreamIndex = 0;\r\n  p->PackStreamStartPositions = 0;\r\n  p->FolderStartFileIndex = 0;\r\n  p->FileIndexToFolderIndexMap = 0;\r\n  p->FileNameOffsets = 0;\r\n  Buf_Init(&p->FileNames);\r\n}\r\n\r\nvoid SzArEx_Free(CSzArEx *p, ISzAlloc *alloc)\r\n{\r\n  IAlloc_Free(alloc, p->FolderStartPackStreamIndex);\r\n  IAlloc_Free(alloc, p->PackStreamStartPositions);\r\n  IAlloc_Free(alloc, p->FolderStartFileIndex);\r\n  IAlloc_Free(alloc, p->FileIndexToFolderIndexMap);\r\n\r\n  IAlloc_Free(alloc, p->FileNameOffsets);\r\n  Buf_Free(&p->FileNames, alloc);\r\n\r\n  SzAr_Free(&p->db, alloc);\r\n  SzArEx_Init(p);\r\n}\r\n\r\n/*\r\nUInt64 GetFolderPackStreamSize(int folderIndex, int streamIndex) const\r\n{\r\n  return PackSizes[FolderStartPackStreamIndex[folderIndex] + streamIndex];\r\n}\r\n\r\nUInt64 GetFilePackSize(int fileIndex) const\r\n{\r\n  int folderIndex = FileIndexToFolderIndexMap[fileIndex];\r\n  if (folderIndex >= 0)\r\n  {\r\n    const CSzFolder &folderInfo = Folders[folderIndex];\r\n    if (FolderStartFileIndex[folderIndex] == fileIndex)\r\n    return GetFolderFullPackSize(folderIndex);\r\n  }\r\n  return 0;\r\n}\r\n*/\r\n\r\n#define MY_ALLOC(T, p, size, alloc) { if ((size) == 0) p = 0; else \\\r\n  if ((p = (T *)IAlloc_Alloc(alloc, (size) * sizeof(T))) == 0) return SZ_ERROR_MEM; }\r\n\r\nstatic SRes SzArEx_Fill(CSzArEx *p, ISzAlloc *alloc)\r\n{\r\n  UInt32 startPos = 0;\r\n  UInt64 startPosSize = 0;\r\n  UInt32 i;\r\n  UInt32 folderIndex = 0;\r\n  UInt32 indexInFolder = 0;\r\n  MY_ALLOC(UInt32, p->FolderStartPackStreamIndex, p->db.NumFolders, alloc);\r\n  for (i = 0; i < p->db.NumFolders; i++)\r\n  {\r\n    p->FolderStartPackStreamIndex[i] = startPos;\r\n    startPos += p->db.Folders[i].NumPackStreams;\r\n  }\r\n\r\n  MY_ALLOC(UInt64, p->PackStreamStartPositions, p->db.NumPackStreams, alloc);\r\n\r\n  for (i = 0; i < p->db.NumPackStreams; i++)\r\n  {\r\n    p->PackStreamStartPositions[i] = startPosSize;\r\n    startPosSize += p->db.PackSizes[i];\r\n  }\r\n\r\n  MY_ALLOC(UInt32, p->FolderStartFileIndex, p->db.NumFolders, alloc);\r\n  MY_ALLOC(UInt32, p->FileIndexToFolderIndexMap, p->db.NumFiles, alloc);\r\n\r\n  for (i = 0; i < p->db.NumFiles; i++)\r\n  {\r\n    CSzFileItem *file = p->db.Files + i;\r\n    int emptyStream = !file->HasStream;\r\n    if (emptyStream && indexInFolder == 0)\r\n    {\r\n      p->FileIndexToFolderIndexMap[i] = (UInt32)-1;\r\n      continue;\r\n    }\r\n    if (indexInFolder == 0)\r\n    {\r\n      /*\r\n      v3.13 incorrectly worked with empty folders\r\n      v4.07: Loop for skipping empty folders\r\n      */\r\n      for (;;)\r\n      {\r\n        if (folderIndex >= p->db.NumFolders)\r\n          return SZ_ERROR_ARCHIVE;\r\n        p->FolderStartFileIndex[folderIndex] = i;\r\n        if (p->db.Folders[folderIndex].NumUnpackStreams != 0)\r\n          break;\r\n        folderIndex++;\r\n      }\r\n    }\r\n    p->FileIndexToFolderIndexMap[i] = folderIndex;\r\n    if (emptyStream)\r\n      continue;\r\n    indexInFolder++;\r\n    if (indexInFolder >= p->db.Folders[folderIndex].NumUnpackStreams)\r\n    {\r\n      folderIndex++;\r\n      indexInFolder = 0;\r\n    }\r\n  }\r\n  return SZ_OK;\r\n}\r\n\r\n\r\nUInt64 SzArEx_GetFolderStreamPos(const CSzArEx *p, UInt32 folderIndex, UInt32 indexInFolder)\r\n{\r\n  return p->dataPos +\r\n    p->PackStreamStartPositions[p->FolderStartPackStreamIndex[folderIndex] + indexInFolder];\r\n}\r\n\r\nint SzArEx_GetFolderFullPackSize(const CSzArEx *p, UInt32 folderIndex, UInt64 *resSize)\r\n{\r\n  UInt32 packStreamIndex = p->FolderStartPackStreamIndex[folderIndex];\r\n  CSzFolder *folder = p->db.Folders + folderIndex;\r\n  UInt64 size = 0;\r\n  UInt32 i;\r\n  for (i = 0; i < folder->NumPackStreams; i++)\r\n  {\r\n    UInt64 t = size + p->db.PackSizes[packStreamIndex + i];\r\n    if (t < size) /* check it */\r\n      return SZ_ERROR_FAIL;\r\n    size = t;\r\n  }\r\n  *resSize = size;\r\n  return SZ_OK;\r\n}\r\n\r\n\r\n/*\r\nSRes SzReadTime(const CObjectVector<CBuf> &dataVector,\r\n    CObjectVector<CSzFileItem> &files, UInt64 type)\r\n{\r\n  CBoolVector boolVector;\r\n  RINOK(ReadBoolVector2(files.Size(), boolVector))\r\n\r\n  CStreamSwitch streamSwitch;\r\n  RINOK(streamSwitch.Set(this, &dataVector));\r\n\r\n  for (int i = 0; i < files.Size(); i++)\r\n  {\r\n    CSzFileItem &file = files[i];\r\n    CArchiveFileTime fileTime;\r\n    bool defined = boolVector[i];\r\n    if (defined)\r\n    {\r\n      UInt32 low, high;\r\n      RINOK(SzReadUInt32(low));\r\n      RINOK(SzReadUInt32(high));\r\n      fileTime.dwLowDateTime = low;\r\n      fileTime.dwHighDateTime = high;\r\n    }\r\n    switch(type)\r\n    {\r\n      case k7zIdCTime: file.IsCTimeDefined = defined; if (defined) file.CTime = fileTime; break;\r\n      case k7zIdATime: file.IsATimeDefined = defined; if (defined) file.ATime = fileTime; break;\r\n      case k7zIdMTime: file.IsMTimeDefined = defined; if (defined) file.MTime = fileTime; break;\r\n    }\r\n  }\r\n  return SZ_OK;\r\n}\r\n*/\r\n\r\nstatic int TestSignatureCandidate(Byte *testBytes)\r\n{\r\n  size_t i;\r\n  for (i = 0; i < k7zSignatureSize; i++)\r\n    if (testBytes[i] != k7zSignature[i])\r\n      return 0;\r\n  return 1;\r\n}\r\n\r\ntypedef struct _CSzState\r\n{\r\n  Byte *Data;\r\n  size_t Size;\r\n}CSzData;\r\n\r\nstatic SRes SzReadByte(CSzData *sd, Byte *b)\r\n{\r\n  if (sd->Size == 0)\r\n    return SZ_ERROR_ARCHIVE;\r\n  sd->Size--;\r\n  *b = *sd->Data++;\r\n  return SZ_OK;\r\n}\r\n\r\nstatic SRes SzReadBytes(CSzData *sd, Byte *data, size_t size)\r\n{\r\n  size_t i;\r\n  for (i = 0; i < size; i++)\r\n  {\r\n    RINOK(SzReadByte(sd, data + i));\r\n  }\r\n  return SZ_OK;\r\n}\r\n\r\nstatic SRes SzReadUInt32(CSzData *sd, UInt32 *value)\r\n{\r\n  int i;\r\n  *value = 0;\r\n  for (i = 0; i < 4; i++)\r\n  {\r\n    Byte b;\r\n    RINOK(SzReadByte(sd, &b));\r\n    *value |= ((UInt32)(b) << (8 * i));\r\n  }\r\n  return SZ_OK;\r\n}\r\n\r\nstatic SRes SzReadNumber(CSzData *sd, UInt64 *value)\r\n{\r\n  Byte firstByte;\r\n  Byte mask = 0x80;\r\n  int i;\r\n  RINOK(SzReadByte(sd, &firstByte));\r\n  *value = 0;\r\n  for (i = 0; i < 8; i++)\r\n  {\r\n    Byte b;\r\n    if ((firstByte & mask) == 0)\r\n    {\r\n      UInt64 highPart = firstByte & (mask - 1);\r\n      *value += (highPart << (8 * i));\r\n      return SZ_OK;\r\n    }\r\n    RINOK(SzReadByte(sd, &b));\r\n    *value |= ((UInt64)b << (8 * i));\r\n    mask >>= 1;\r\n  }\r\n  return SZ_OK;\r\n}\r\n\r\nstatic SRes SzReadNumber32(CSzData *sd, UInt32 *value)\r\n{\r\n  UInt64 value64;\r\n  RINOK(SzReadNumber(sd, &value64));\r\n  if (value64 >= 0x80000000)\r\n    return SZ_ERROR_UNSUPPORTED;\r\n  if (value64 >= ((UInt64)(1) << ((sizeof(size_t) - 1) * 8 + 2)))\r\n    return SZ_ERROR_UNSUPPORTED;\r\n  *value = (UInt32)value64;\r\n  return SZ_OK;\r\n}\r\n\r\nstatic SRes SzReadID(CSzData *sd, UInt64 *value)\r\n{\r\n  return SzReadNumber(sd, value);\r\n}\r\n\r\nstatic SRes SzSkeepDataSize(CSzData *sd, UInt64 size)\r\n{\r\n  if (size > sd->Size)\r\n    return SZ_ERROR_ARCHIVE;\r\n  sd->Size -= (size_t)size;\r\n  sd->Data += (size_t)size;\r\n  return SZ_OK;\r\n}\r\n\r\nstatic SRes SzSkeepData(CSzData *sd)\r\n{\r\n  UInt64 size;\r\n  RINOK(SzReadNumber(sd, &size));\r\n  return SzSkeepDataSize(sd, size);\r\n}\r\n\r\nstatic SRes SzReadArchiveProperties(CSzData *sd)\r\n{\r\n  for (;;)\r\n  {\r\n    UInt64 type;\r\n    RINOK(SzReadID(sd, &type));\r\n    if (type == k7zIdEnd)\r\n      break;\r\n    SzSkeepData(sd);\r\n  }\r\n  return SZ_OK;\r\n}\r\n\r\nstatic SRes SzWaitAttribute(CSzData *sd, UInt64 attribute)\r\n{\r\n  for (;;)\r\n  {\r\n    UInt64 type;\r\n    RINOK(SzReadID(sd, &type));\r\n    if (type == attribute)\r\n      return SZ_OK;\r\n    if (type == k7zIdEnd)\r\n      return SZ_ERROR_ARCHIVE;\r\n    RINOK(SzSkeepData(sd));\r\n  }\r\n}\r\n\r\nstatic SRes SzReadBoolVector(CSzData *sd, size_t numItems, Byte **v, ISzAlloc *alloc)\r\n{\r\n  Byte b = 0;\r\n  Byte mask = 0;\r\n  size_t i;\r\n  MY_ALLOC(Byte, *v, numItems, alloc);\r\n  for (i = 0; i < numItems; i++)\r\n  {\r\n    if (mask == 0)\r\n    {\r\n      RINOK(SzReadByte(sd, &b));\r\n      mask = 0x80;\r\n    }\r\n    (*v)[i] = (Byte)(((b & mask) != 0) ? 1 : 0);\r\n    mask >>= 1;\r\n  }\r\n  return SZ_OK;\r\n}\r\n\r\nstatic SRes SzReadBoolVector2(CSzData *sd, size_t numItems, Byte **v, ISzAlloc *alloc)\r\n{\r\n  Byte allAreDefined;\r\n  size_t i;\r\n  RINOK(SzReadByte(sd, &allAreDefined));\r\n  if (allAreDefined == 0)\r\n    return SzReadBoolVector(sd, numItems, v, alloc);\r\n  MY_ALLOC(Byte, *v, numItems, alloc);\r\n  for (i = 0; i < numItems; i++)\r\n    (*v)[i] = 1;\r\n  return SZ_OK;\r\n}\r\n\r\nstatic SRes SzReadHashDigests(\r\n    CSzData *sd,\r\n    size_t numItems,\r\n    Byte **digestsDefined,\r\n    UInt32 **digests,\r\n    ISzAlloc *alloc)\r\n{\r\n  size_t i;\r\n  RINOK(SzReadBoolVector2(sd, numItems, digestsDefined, alloc));\r\n  MY_ALLOC(UInt32, *digests, numItems, alloc);\r\n  for (i = 0; i < numItems; i++)\r\n    if ((*digestsDefined)[i])\r\n    {\r\n      RINOK(SzReadUInt32(sd, (*digests) + i));\r\n    }\r\n  return SZ_OK;\r\n}\r\n\r\nstatic SRes SzReadPackInfo(\r\n    CSzData *sd,\r\n    UInt64 *dataOffset,\r\n    UInt32 *numPackStreams,\r\n    UInt64 **packSizes,\r\n    Byte **packCRCsDefined,\r\n    UInt32 **packCRCs,\r\n    ISzAlloc *alloc)\r\n{\r\n  UInt32 i;\r\n  RINOK(SzReadNumber(sd, dataOffset));\r\n  RINOK(SzReadNumber32(sd, numPackStreams));\r\n\r\n  RINOK(SzWaitAttribute(sd, k7zIdSize));\r\n\r\n  MY_ALLOC(UInt64, *packSizes, (size_t)*numPackStreams, alloc);\r\n\r\n  for (i = 0; i < *numPackStreams; i++)\r\n  {\r\n    RINOK(SzReadNumber(sd, (*packSizes) + i));\r\n  }\r\n\r\n  for (;;)\r\n  {\r\n    UInt64 type;\r\n    RINOK(SzReadID(sd, &type));\r\n    if (type == k7zIdEnd)\r\n      break;\r\n    if (type == k7zIdCRC)\r\n    {\r\n      RINOK(SzReadHashDigests(sd, (size_t)*numPackStreams, packCRCsDefined, packCRCs, alloc));\r\n      continue;\r\n    }\r\n    RINOK(SzSkeepData(sd));\r\n  }\r\n  if (*packCRCsDefined == 0)\r\n  {\r\n    MY_ALLOC(Byte, *packCRCsDefined, (size_t)*numPackStreams, alloc);\r\n    MY_ALLOC(UInt32, *packCRCs, (size_t)*numPackStreams, alloc);\r\n    for (i = 0; i < *numPackStreams; i++)\r\n    {\r\n      (*packCRCsDefined)[i] = 0;\r\n      (*packCRCs)[i] = 0;\r\n    }\r\n  }\r\n  return SZ_OK;\r\n}\r\n\r\nstatic SRes SzReadSwitch(CSzData *sd)\r\n{\r\n  Byte external;\r\n  RINOK(SzReadByte(sd, &external));\r\n  return (external == 0) ? SZ_OK: SZ_ERROR_UNSUPPORTED;\r\n}\r\n\r\nstatic SRes SzGetNextFolderItem(CSzData *sd, CSzFolder *folder, ISzAlloc *alloc)\r\n{\r\n  UInt32 numCoders, numBindPairs, numPackStreams, i;\r\n  UInt32 numInStreams = 0, numOutStreams = 0;\r\n  \r\n  RINOK(SzReadNumber32(sd, &numCoders));\r\n  if (numCoders > NUM_FOLDER_CODERS_MAX)\r\n    return SZ_ERROR_UNSUPPORTED;\r\n  folder->NumCoders = numCoders;\r\n  \r\n  MY_ALLOC(CSzCoderInfo, folder->Coders, (size_t)numCoders, alloc);\r\n\r\n  for (i = 0; i < numCoders; i++)\r\n    SzCoderInfo_Init(folder->Coders + i);\r\n\r\n  for (i = 0; i < numCoders; i++)\r\n  {\r\n    Byte mainByte;\r\n    CSzCoderInfo *coder = folder->Coders + i;\r\n    {\r\n      unsigned idSize, j;\r\n      Byte longID[15];\r\n      RINOK(SzReadByte(sd, &mainByte));\r\n      idSize = (unsigned)(mainByte & 0xF);\r\n      RINOK(SzReadBytes(sd, longID, idSize));\r\n      if (idSize > sizeof(coder->MethodID))\r\n        return SZ_ERROR_UNSUPPORTED;\r\n      coder->MethodID = 0;\r\n      for (j = 0; j < idSize; j++)\r\n        coder->MethodID |= (UInt64)longID[idSize - 1 - j] << (8 * j);\r\n\r\n      if ((mainByte & 0x10) != 0)\r\n      {\r\n        RINOK(SzReadNumber32(sd, &coder->NumInStreams));\r\n        RINOK(SzReadNumber32(sd, &coder->NumOutStreams));\r\n        if (coder->NumInStreams > NUM_CODER_STREAMS_MAX ||\r\n            coder->NumOutStreams > NUM_CODER_STREAMS_MAX)\r\n          return SZ_ERROR_UNSUPPORTED;\r\n      }\r\n      else\r\n      {\r\n        coder->NumInStreams = 1;\r\n        coder->NumOutStreams = 1;\r\n      }\r\n      if ((mainByte & 0x20) != 0)\r\n      {\r\n        UInt64 propertiesSize = 0;\r\n        RINOK(SzReadNumber(sd, &propertiesSize));\r\n        if (!Buf_Create(&coder->Props, (size_t)propertiesSize, alloc))\r\n          return SZ_ERROR_MEM;\r\n        RINOK(SzReadBytes(sd, coder->Props.data, (size_t)propertiesSize));\r\n      }\r\n    }\r\n    while ((mainByte & 0x80) != 0)\r\n    {\r\n      RINOK(SzReadByte(sd, &mainByte));\r\n      RINOK(SzSkeepDataSize(sd, (mainByte & 0xF)));\r\n      if ((mainByte & 0x10) != 0)\r\n      {\r\n        UInt32 n;\r\n        RINOK(SzReadNumber32(sd, &n));\r\n        RINOK(SzReadNumber32(sd, &n));\r\n      }\r\n      if ((mainByte & 0x20) != 0)\r\n      {\r\n        UInt64 propertiesSize = 0;\r\n        RINOK(SzReadNumber(sd, &propertiesSize));\r\n        RINOK(SzSkeepDataSize(sd, propertiesSize));\r\n      }\r\n    }\r\n    numInStreams += coder->NumInStreams;\r\n    numOutStreams += coder->NumOutStreams;\r\n  }\r\n\r\n  if (numOutStreams == 0)\r\n    return SZ_ERROR_UNSUPPORTED;\r\n\r\n  folder->NumBindPairs = numBindPairs = numOutStreams - 1;\r\n  MY_ALLOC(CSzBindPair, folder->BindPairs, (size_t)numBindPairs, alloc);\r\n\r\n  for (i = 0; i < numBindPairs; i++)\r\n  {\r\n    CSzBindPair *bp = folder->BindPairs + i;\r\n    RINOK(SzReadNumber32(sd, &bp->InIndex));\r\n    RINOK(SzReadNumber32(sd, &bp->OutIndex));\r\n  }\r\n\r\n  if (numInStreams < numBindPairs)\r\n    return SZ_ERROR_UNSUPPORTED;\r\n\r\n  folder->NumPackStreams = numPackStreams = numInStreams - numBindPairs;\r\n  MY_ALLOC(UInt32, folder->PackStreams, (size_t)numPackStreams, alloc);\r\n\r\n  if (numPackStreams == 1)\r\n  {\r\n    for (i = 0; i < numInStreams ; i++)\r\n      if (SzFolder_FindBindPairForInStream(folder, i) < 0)\r\n        break;\r\n    if (i == numInStreams)\r\n      return SZ_ERROR_UNSUPPORTED;\r\n    folder->PackStreams[0] = i;\r\n  }\r\n  else\r\n    for (i = 0; i < numPackStreams; i++)\r\n    {\r\n      RINOK(SzReadNumber32(sd, folder->PackStreams + i));\r\n    }\r\n  return SZ_OK;\r\n}\r\n\r\nstatic SRes SzReadUnpackInfo(\r\n    CSzData *sd,\r\n    UInt32 *numFolders,\r\n    CSzFolder **folders,  /* for alloc */\r\n    ISzAlloc *alloc,\r\n    ISzAlloc *allocTemp)\r\n{\r\n  UInt32 i;\r\n  RINOK(SzWaitAttribute(sd, k7zIdFolder));\r\n  RINOK(SzReadNumber32(sd, numFolders));\r\n  {\r\n    RINOK(SzReadSwitch(sd));\r\n\r\n    MY_ALLOC(CSzFolder, *folders, (size_t)*numFolders, alloc);\r\n\r\n    for (i = 0; i < *numFolders; i++)\r\n      SzFolder_Init((*folders) + i);\r\n\r\n    for (i = 0; i < *numFolders; i++)\r\n    {\r\n      RINOK(SzGetNextFolderItem(sd, (*folders) + i, alloc));\r\n    }\r\n  }\r\n\r\n  RINOK(SzWaitAttribute(sd, k7zIdCodersUnpackSize));\r\n\r\n  for (i = 0; i < *numFolders; i++)\r\n  {\r\n    UInt32 j;\r\n    CSzFolder *folder = (*folders) + i;\r\n    UInt32 numOutStreams = SzFolder_GetNumOutStreams(folder);\r\n\r\n    MY_ALLOC(UInt64, folder->UnpackSizes, (size_t)numOutStreams, alloc);\r\n\r\n    for (j = 0; j < numOutStreams; j++)\r\n    {\r\n      RINOK(SzReadNumber(sd, folder->UnpackSizes + j));\r\n    }\r\n  }\r\n\r\n  for (;;)\r\n  {\r\n    UInt64 type;\r\n    RINOK(SzReadID(sd, &type));\r\n    if (type == k7zIdEnd)\r\n      return SZ_OK;\r\n    if (type == k7zIdCRC)\r\n    {\r\n      SRes res;\r\n      Byte *crcsDefined = 0;\r\n      UInt32 *crcs = 0;\r\n      res = SzReadHashDigests(sd, *numFolders, &crcsDefined, &crcs, allocTemp);\r\n      if (res == SZ_OK)\r\n      {\r\n        for (i = 0; i < *numFolders; i++)\r\n        {\r\n          CSzFolder *folder = (*folders) + i;\r\n          folder->UnpackCRCDefined = crcsDefined[i];\r\n          folder->UnpackCRC = crcs[i];\r\n        }\r\n      }\r\n      IAlloc_Free(allocTemp, crcs);\r\n      IAlloc_Free(allocTemp, crcsDefined);\r\n      RINOK(res);\r\n      continue;\r\n    }\r\n    RINOK(SzSkeepData(sd));\r\n  }\r\n}\r\n\r\nstatic SRes SzReadSubStreamsInfo(\r\n    CSzData *sd,\r\n    UInt32 numFolders,\r\n    CSzFolder *folders,\r\n    UInt32 *numUnpackStreams,\r\n    UInt64 **unpackSizes,\r\n    Byte **digestsDefined,\r\n    UInt32 **digests,\r\n    ISzAlloc *allocTemp)\r\n{\r\n  UInt64 type = 0;\r\n  UInt32 i;\r\n  UInt32 si = 0;\r\n  UInt32 numDigests = 0;\r\n\r\n  for (i = 0; i < numFolders; i++)\r\n    folders[i].NumUnpackStreams = 1;\r\n  *numUnpackStreams = numFolders;\r\n\r\n  for (;;)\r\n  {\r\n    RINOK(SzReadID(sd, &type));\r\n    if (type == k7zIdNumUnpackStream)\r\n    {\r\n      *numUnpackStreams = 0;\r\n      for (i = 0; i < numFolders; i++)\r\n      {\r\n        UInt32 numStreams;\r\n        RINOK(SzReadNumber32(sd, &numStreams));\r\n        folders[i].NumUnpackStreams = numStreams;\r\n        *numUnpackStreams += numStreams;\r\n      }\r\n      continue;\r\n    }\r\n    if (type == k7zIdCRC || type == k7zIdSize)\r\n      break;\r\n    if (type == k7zIdEnd)\r\n      break;\r\n    RINOK(SzSkeepData(sd));\r\n  }\r\n\r\n  if (*numUnpackStreams == 0)\r\n  {\r\n    *unpackSizes = 0;\r\n    *digestsDefined = 0;\r\n    *digests = 0;\r\n  }\r\n  else\r\n  {\r\n    *unpackSizes = (UInt64 *)IAlloc_Alloc(allocTemp, (size_t)*numUnpackStreams * sizeof(UInt64));\r\n    RINOM(*unpackSizes);\r\n    *digestsDefined = (Byte *)IAlloc_Alloc(allocTemp, (size_t)*numUnpackStreams * sizeof(Byte));\r\n    RINOM(*digestsDefined);\r\n    *digests = (UInt32 *)IAlloc_Alloc(allocTemp, (size_t)*numUnpackStreams * sizeof(UInt32));\r\n    RINOM(*digests);\r\n  }\r\n\r\n  for (i = 0; i < numFolders; i++)\r\n  {\r\n    /*\r\n    v3.13 incorrectly worked with empty folders\r\n    v4.07: we check that folder is empty\r\n    */\r\n    UInt64 sum = 0;\r\n    UInt32 j;\r\n    UInt32 numSubstreams = folders[i].NumUnpackStreams;\r\n    if (numSubstreams == 0)\r\n      continue;\r\n    if (type == k7zIdSize)\r\n    for (j = 1; j < numSubstreams; j++)\r\n    {\r\n      UInt64 size;\r\n      RINOK(SzReadNumber(sd, &size));\r\n      (*unpackSizes)[si++] = size;\r\n      sum += size;\r\n    }\r\n    (*unpackSizes)[si++] = SzFolder_GetUnpackSize(folders + i) - sum;\r\n  }\r\n  if (type == k7zIdSize)\r\n  {\r\n    RINOK(SzReadID(sd, &type));\r\n  }\r\n\r\n  for (i = 0; i < *numUnpackStreams; i++)\r\n  {\r\n    (*digestsDefined)[i] = 0;\r\n    (*digests)[i] = 0;\r\n  }\r\n\r\n\r\n  for (i = 0; i < numFolders; i++)\r\n  {\r\n    UInt32 numSubstreams = folders[i].NumUnpackStreams;\r\n    if (numSubstreams != 1 || !folders[i].UnpackCRCDefined)\r\n      numDigests += numSubstreams;\r\n  }\r\n\r\n \r\n  si = 0;\r\n  for (;;)\r\n  {\r\n    if (type == k7zIdCRC)\r\n    {\r\n      int digestIndex = 0;\r\n      Byte *digestsDefined2 = 0;\r\n      UInt32 *digests2 = 0;\r\n      SRes res = SzReadHashDigests(sd, numDigests, &digestsDefined2, &digests2, allocTemp);\r\n      if (res == SZ_OK)\r\n      {\r\n        for (i = 0; i < numFolders; i++)\r\n        {\r\n          CSzFolder *folder = folders + i;\r\n          UInt32 numSubstreams = folder->NumUnpackStreams;\r\n          if (numSubstreams == 1 && folder->UnpackCRCDefined)\r\n          {\r\n            (*digestsDefined)[si] = 1;\r\n            (*digests)[si] = folder->UnpackCRC;\r\n            si++;\r\n          }\r\n          else\r\n          {\r\n            UInt32 j;\r\n            for (j = 0; j < numSubstreams; j++, digestIndex++)\r\n            {\r\n              (*digestsDefined)[si] = digestsDefined2[digestIndex];\r\n              (*digests)[si] = digests2[digestIndex];\r\n              si++;\r\n            }\r\n          }\r\n        }\r\n      }\r\n      IAlloc_Free(allocTemp, digestsDefined2);\r\n      IAlloc_Free(allocTemp, digests2);\r\n      RINOK(res);\r\n    }\r\n    else if (type == k7zIdEnd)\r\n      return SZ_OK;\r\n    else\r\n    {\r\n      RINOK(SzSkeepData(sd));\r\n    }\r\n    RINOK(SzReadID(sd, &type));\r\n  }\r\n}\r\n\r\n\r\nstatic SRes SzReadStreamsInfo(\r\n    CSzData *sd,\r\n    UInt64 *dataOffset,\r\n    CSzAr *p,\r\n    UInt32 *numUnpackStreams,\r\n    UInt64 **unpackSizes, /* allocTemp */\r\n    Byte **digestsDefined,   /* allocTemp */\r\n    UInt32 **digests,        /* allocTemp */\r\n    ISzAlloc *alloc,\r\n    ISzAlloc *allocTemp)\r\n{\r\n  for (;;)\r\n  {\r\n    UInt64 type;\r\n    RINOK(SzReadID(sd, &type));\r\n    if ((UInt64)(int)type != type)\r\n      return SZ_ERROR_UNSUPPORTED;\r\n    switch((int)type)\r\n    {\r\n      case k7zIdEnd:\r\n        return SZ_OK;\r\n      case k7zIdPackInfo:\r\n      {\r\n        RINOK(SzReadPackInfo(sd, dataOffset, &p->NumPackStreams,\r\n            &p->PackSizes, &p->PackCRCsDefined, &p->PackCRCs, alloc));\r\n        break;\r\n      }\r\n      case k7zIdUnpackInfo:\r\n      {\r\n        RINOK(SzReadUnpackInfo(sd, &p->NumFolders, &p->Folders, alloc, allocTemp));\r\n        break;\r\n      }\r\n      case k7zIdSubStreamsInfo:\r\n      {\r\n        RINOK(SzReadSubStreamsInfo(sd, p->NumFolders, p->Folders,\r\n            numUnpackStreams, unpackSizes, digestsDefined, digests, allocTemp));\r\n        break;\r\n      }\r\n      default:\r\n        return SZ_ERROR_UNSUPPORTED;\r\n    }\r\n  }\r\n}\r\n\r\nsize_t SzArEx_GetFileNameUtf16(const CSzArEx *p, size_t fileIndex, UInt16 *dest)\r\n{\r\n  size_t len = p->FileNameOffsets[fileIndex + 1] - p->FileNameOffsets[fileIndex];\r\n  if (dest != 0)\r\n  {\r\n    size_t i;\r\n    const Byte *src = p->FileNames.data + (p->FileNameOffsets[fileIndex] * 2);\r\n    for (i = 0; i < len; i++)\r\n      dest[i] = GetUi16(src + i * 2);\r\n  }\r\n  return len;\r\n}\r\n\r\nstatic SRes SzReadFileNames(const Byte *p, size_t size, UInt32 numFiles, size_t *sizes)\r\n{\r\n  UInt32 i;\r\n  size_t pos = 0;\r\n  for (i = 0; i < numFiles; i++)\r\n  {\r\n    sizes[i] = pos;\r\n    for (;;)\r\n    {\r\n      if (pos >= size)\r\n        return SZ_ERROR_ARCHIVE;\r\n      if (p[pos * 2] == 0 && p[pos * 2 + 1] == 0)\r\n        break;\r\n      pos++;\r\n    }\r\n    pos++;\r\n  }\r\n  sizes[i] = pos;\r\n  return (pos == size) ? SZ_OK : SZ_ERROR_ARCHIVE;\r\n}\r\n\r\nstatic SRes SzReadHeader2(\r\n    CSzArEx *p,   /* allocMain */\r\n    CSzData *sd,\r\n    UInt64 **unpackSizes,  /* allocTemp */\r\n    Byte **digestsDefined,    /* allocTemp */\r\n    UInt32 **digests,         /* allocTemp */\r\n    Byte **emptyStreamVector, /* allocTemp */\r\n    Byte **emptyFileVector,   /* allocTemp */\r\n    Byte **lwtVector,         /* allocTemp */\r\n    ISzAlloc *allocMain,\r\n    ISzAlloc *allocTemp)\r\n{\r\n  UInt64 type;\r\n  UInt32 numUnpackStreams = 0;\r\n  UInt32 numFiles = 0;\r\n  CSzFileItem *files = 0;\r\n  UInt32 numEmptyStreams = 0;\r\n  UInt32 i;\r\n\r\n  RINOK(SzReadID(sd, &type));\r\n\r\n  if (type == k7zIdArchiveProperties)\r\n  {\r\n    RINOK(SzReadArchiveProperties(sd));\r\n    RINOK(SzReadID(sd, &type));\r\n  }\r\n \r\n \r\n  if (type == k7zIdMainStreamsInfo)\r\n  {\r\n    RINOK(SzReadStreamsInfo(sd,\r\n        &p->dataPos,\r\n        &p->db,\r\n        &numUnpackStreams,\r\n        unpackSizes,\r\n        digestsDefined,\r\n        digests, allocMain, allocTemp));\r\n    p->dataPos += p->startPosAfterHeader;\r\n    RINOK(SzReadID(sd, &type));\r\n  }\r\n\r\n  if (type == k7zIdEnd)\r\n    return SZ_OK;\r\n  if (type != k7zIdFilesInfo)\r\n    return SZ_ERROR_ARCHIVE;\r\n  \r\n  RINOK(SzReadNumber32(sd, &numFiles));\r\n  p->db.NumFiles = numFiles;\r\n\r\n  MY_ALLOC(CSzFileItem, files, (size_t)numFiles, allocMain);\r\n\r\n  p->db.Files = files;\r\n  for (i = 0; i < numFiles; i++)\r\n    SzFile_Init(files + i);\r\n\r\n  for (;;)\r\n  {\r\n    UInt64 type;\r\n    UInt64 size;\r\n    RINOK(SzReadID(sd, &type));\r\n    if (type == k7zIdEnd)\r\n      break;\r\n    RINOK(SzReadNumber(sd, &size));\r\n    if (size > sd->Size)\r\n      return SZ_ERROR_ARCHIVE;\r\n    if ((UInt64)(int)type != type)\r\n    {\r\n      RINOK(SzSkeepDataSize(sd, size));\r\n    }\r\n    else\r\n    switch((int)type)\r\n    {\r\n      case k7zIdName:\r\n      {\r\n        size_t namesSize;\r\n        RINOK(SzReadSwitch(sd));\r\n        namesSize = (size_t)size - 1;\r\n        if ((namesSize & 1) != 0)\r\n          return SZ_ERROR_ARCHIVE;\r\n        if (!Buf_Create(&p->FileNames, namesSize, allocMain))\r\n          return SZ_ERROR_MEM;\r\n        MY_ALLOC(size_t, p->FileNameOffsets, numFiles + 1, allocMain);\r\n        memcpy(p->FileNames.data, sd->Data, namesSize);\r\n        RINOK(SzReadFileNames(sd->Data, namesSize >> 1, numFiles, p->FileNameOffsets))\r\n        RINOK(SzSkeepDataSize(sd, namesSize));\r\n        break;\r\n      }\r\n      case k7zIdEmptyStream:\r\n      {\r\n        RINOK(SzReadBoolVector(sd, numFiles, emptyStreamVector, allocTemp));\r\n        numEmptyStreams = 0;\r\n        for (i = 0; i < numFiles; i++)\r\n          if ((*emptyStreamVector)[i])\r\n            numEmptyStreams++;\r\n        break;\r\n      }\r\n      case k7zIdEmptyFile:\r\n      {\r\n        RINOK(SzReadBoolVector(sd, numEmptyStreams, emptyFileVector, allocTemp));\r\n        break;\r\n      }\r\n      case k7zIdWinAttributes:\r\n      {\r\n        RINOK(SzReadBoolVector2(sd, numFiles, lwtVector, allocTemp));\r\n        RINOK(SzReadSwitch(sd));\r\n        for (i = 0; i < numFiles; i++)\r\n        {\r\n          CSzFileItem *f = &files[i];\r\n          Byte defined = (*lwtVector)[i];\r\n          f->AttribDefined = defined;\r\n          f->Attrib = 0;\r\n          if (defined)\r\n          {\r\n            RINOK(SzReadUInt32(sd, &f->Attrib));\r\n          }\r\n        }\r\n        IAlloc_Free(allocTemp, *lwtVector);\r\n        *lwtVector = NULL;\r\n        break;\r\n      }\r\n      case k7zIdMTime:\r\n      {\r\n        RINOK(SzReadBoolVector2(sd, numFiles, lwtVector, allocTemp));\r\n        RINOK(SzReadSwitch(sd));\r\n        for (i = 0; i < numFiles; i++)\r\n        {\r\n          CSzFileItem *f = &files[i];\r\n          Byte defined = (*lwtVector)[i];\r\n          f->MTimeDefined = defined;\r\n          f->MTime.Low = f->MTime.High = 0;\r\n          if (defined)\r\n          {\r\n            RINOK(SzReadUInt32(sd, &f->MTime.Low));\r\n            RINOK(SzReadUInt32(sd, &f->MTime.High));\r\n          }\r\n        }\r\n        IAlloc_Free(allocTemp, *lwtVector);\r\n        *lwtVector = NULL;\r\n        break;\r\n      }\r\n      default:\r\n      {\r\n        RINOK(SzSkeepDataSize(sd, size));\r\n      }\r\n    }\r\n  }\r\n\r\n  {\r\n    UInt32 emptyFileIndex = 0;\r\n    UInt32 sizeIndex = 0;\r\n    for (i = 0; i < numFiles; i++)\r\n    {\r\n      CSzFileItem *file = files + i;\r\n      file->IsAnti = 0;\r\n      if (*emptyStreamVector == 0)\r\n        file->HasStream = 1;\r\n      else\r\n        file->HasStream = (Byte)((*emptyStreamVector)[i] ? 0 : 1);\r\n      if (file->HasStream)\r\n      {\r\n        file->IsDir = 0;\r\n        file->Size = (*unpackSizes)[sizeIndex];\r\n        file->Crc = (*digests)[sizeIndex];\r\n        file->CrcDefined = (Byte)(*digestsDefined)[sizeIndex];\r\n        sizeIndex++;\r\n      }\r\n      else\r\n      {\r\n        if (*emptyFileVector == 0)\r\n          file->IsDir = 1;\r\n        else\r\n          file->IsDir = (Byte)((*emptyFileVector)[emptyFileIndex] ? 0 : 1);\r\n        emptyFileIndex++;\r\n        file->Size = 0;\r\n        file->Crc = 0;\r\n        file->CrcDefined = 0;\r\n      }\r\n    }\r\n  }\r\n  return SzArEx_Fill(p, allocMain);\r\n}\r\n\r\nstatic SRes SzReadHeader(\r\n    CSzArEx *p,\r\n    CSzData *sd,\r\n    ISzAlloc *allocMain,\r\n    ISzAlloc *allocTemp)\r\n{\r\n  UInt64 *unpackSizes = 0;\r\n  Byte *digestsDefined = 0;\r\n  UInt32 *digests = 0;\r\n  Byte *emptyStreamVector = 0;\r\n  Byte *emptyFileVector = 0;\r\n  Byte *lwtVector = 0;\r\n  SRes res = SzReadHeader2(p, sd,\r\n      &unpackSizes, &digestsDefined, &digests,\r\n      &emptyStreamVector, &emptyFileVector, &lwtVector,\r\n      allocMain, allocTemp);\r\n  IAlloc_Free(allocTemp, unpackSizes);\r\n  IAlloc_Free(allocTemp, digestsDefined);\r\n  IAlloc_Free(allocTemp, digests);\r\n  IAlloc_Free(allocTemp, emptyStreamVector);\r\n  IAlloc_Free(allocTemp, emptyFileVector);\r\n  IAlloc_Free(allocTemp, lwtVector);\r\n  return res;\r\n}\r\n\r\nstatic SRes SzReadAndDecodePackedStreams2(\r\n    ILookInStream *inStream,\r\n    CSzData *sd,\r\n    CBuf *outBuffer,\r\n    UInt64 baseOffset,\r\n    CSzAr *p,\r\n    UInt64 **unpackSizes,\r\n    Byte **digestsDefined,\r\n    UInt32 **digests,\r\n    ISzAlloc *allocTemp)\r\n{\r\n\r\n  UInt32 numUnpackStreams = 0;\r\n  UInt64 dataStartPos;\r\n  CSzFolder *folder;\r\n  UInt64 unpackSize;\r\n  SRes res;\r\n\r\n  RINOK(SzReadStreamsInfo(sd, &dataStartPos, p,\r\n      &numUnpackStreams,  unpackSizes, digestsDefined, digests,\r\n      allocTemp, allocTemp));\r\n  \r\n  dataStartPos += baseOffset;\r\n  if (p->NumFolders != 1)\r\n    return SZ_ERROR_ARCHIVE;\r\n\r\n  folder = p->Folders;\r\n  unpackSize = SzFolder_GetUnpackSize(folder);\r\n  \r\n  RINOK(LookInStream_SeekTo(inStream, dataStartPos));\r\n\r\n  if (!Buf_Create(outBuffer, (size_t)unpackSize, allocTemp))\r\n    return SZ_ERROR_MEM;\r\n  \r\n  res = SzFolder_Decode(folder, p->PackSizes,\r\n          inStream, dataStartPos,\r\n          outBuffer->data, (size_t)unpackSize, allocTemp);\r\n  RINOK(res);\r\n  if (folder->UnpackCRCDefined)\r\n    if (CrcCalc(outBuffer->data, (size_t)unpackSize) != folder->UnpackCRC)\r\n      return SZ_ERROR_CRC;\r\n  return SZ_OK;\r\n}\r\n\r\nstatic SRes SzReadAndDecodePackedStreams(\r\n    ILookInStream *inStream,\r\n    CSzData *sd,\r\n    CBuf *outBuffer,\r\n    UInt64 baseOffset,\r\n    ISzAlloc *allocTemp)\r\n{\r\n  CSzAr p;\r\n  UInt64 *unpackSizes = 0;\r\n  Byte *digestsDefined = 0;\r\n  UInt32 *digests = 0;\r\n  SRes res;\r\n  SzAr_Init(&p);\r\n  res = SzReadAndDecodePackedStreams2(inStream, sd, outBuffer, baseOffset,\r\n    &p, &unpackSizes, &digestsDefined, &digests,\r\n    allocTemp);\r\n  SzAr_Free(&p, allocTemp);\r\n  IAlloc_Free(allocTemp, unpackSizes);\r\n  IAlloc_Free(allocTemp, digestsDefined);\r\n  IAlloc_Free(allocTemp, digests);\r\n  return res;\r\n}\r\n\r\nstatic SRes SzArEx_Open2(\r\n    CSzArEx *p,\r\n    ILookInStream *inStream,\r\n    ISzAlloc *allocMain,\r\n    ISzAlloc *allocTemp)\r\n{\r\n  Byte header[k7zStartHeaderSize];\r\n  Int64 startArcPos;\r\n  UInt64 nextHeaderOffset, nextHeaderSize;\r\n  size_t nextHeaderSizeT;\r\n  UInt32 nextHeaderCRC;\r\n  CBuf buffer;\r\n  SRes res;\r\n\r\n  startArcPos = 0;\r\n  RINOK(inStream->Seek(inStream, &startArcPos, SZ_SEEK_CUR));\r\n\r\n  RINOK(LookInStream_Read2(inStream, header, k7zStartHeaderSize, SZ_ERROR_NO_ARCHIVE));\r\n\r\n  if (!TestSignatureCandidate(header))\r\n    return SZ_ERROR_NO_ARCHIVE;\r\n  if (header[6] != k7zMajorVersion)\r\n    return SZ_ERROR_UNSUPPORTED;\r\n\r\n  nextHeaderOffset = GetUi64(header + 12);\r\n  nextHeaderSize = GetUi64(header + 20);\r\n  nextHeaderCRC = GetUi32(header + 28);\r\n\r\n  p->startPosAfterHeader = startArcPos + k7zStartHeaderSize;\r\n  \r\n  if (CrcCalc(header + 12, 20) != GetUi32(header + 8))\r\n    return SZ_ERROR_CRC;\r\n\r\n  nextHeaderSizeT = (size_t)nextHeaderSize;\r\n  if (nextHeaderSizeT != nextHeaderSize)\r\n    return SZ_ERROR_MEM;\r\n  if (nextHeaderSizeT == 0)\r\n    return SZ_OK;\r\n  if (nextHeaderOffset > nextHeaderOffset + nextHeaderSize ||\r\n      nextHeaderOffset > nextHeaderOffset + nextHeaderSize + k7zStartHeaderSize)\r\n    return SZ_ERROR_NO_ARCHIVE;\r\n\r\n  {\r\n    Int64 pos = 0;\r\n    RINOK(inStream->Seek(inStream, &pos, SZ_SEEK_END));\r\n    if ((UInt64)pos < startArcPos + nextHeaderOffset ||\r\n        (UInt64)pos < startArcPos + k7zStartHeaderSize + nextHeaderOffset ||\r\n        (UInt64)pos < startArcPos + k7zStartHeaderSize + nextHeaderOffset + nextHeaderSize)\r\n      return SZ_ERROR_INPUT_EOF;\r\n  }\r\n\r\n  RINOK(LookInStream_SeekTo(inStream, startArcPos + k7zStartHeaderSize + nextHeaderOffset));\r\n\r\n  if (!Buf_Create(&buffer, nextHeaderSizeT, allocTemp))\r\n    return SZ_ERROR_MEM;\r\n\r\n  res = LookInStream_Read(inStream, buffer.data, nextHeaderSizeT);\r\n  if (res == SZ_OK)\r\n  {\r\n    res = SZ_ERROR_ARCHIVE;\r\n    if (CrcCalc(buffer.data, nextHeaderSizeT) == nextHeaderCRC)\r\n    {\r\n      CSzData sd;\r\n      UInt64 type;\r\n      sd.Data = buffer.data;\r\n      sd.Size = buffer.size;\r\n      res = SzReadID(&sd, &type);\r\n      if (res == SZ_OK)\r\n      {\r\n        if (type == k7zIdEncodedHeader)\r\n        {\r\n          CBuf outBuffer;\r\n          Buf_Init(&outBuffer);\r\n          res = SzReadAndDecodePackedStreams(inStream, &sd, &outBuffer, p->startPosAfterHeader, allocTemp);\r\n          if (res != SZ_OK)\r\n            Buf_Free(&outBuffer, allocTemp);\r\n          else\r\n          {\r\n            Buf_Free(&buffer, allocTemp);\r\n            buffer.data = outBuffer.data;\r\n            buffer.size = outBuffer.size;\r\n            sd.Data = buffer.data;\r\n            sd.Size = buffer.size;\r\n            res = SzReadID(&sd, &type);\r\n          }\r\n        }\r\n      }\r\n      if (res == SZ_OK)\r\n      {\r\n        if (type == k7zIdHeader)\r\n          res = SzReadHeader(p, &sd, allocMain, allocTemp);\r\n        else\r\n          res = SZ_ERROR_UNSUPPORTED;\r\n      }\r\n    }\r\n  }\r\n  Buf_Free(&buffer, allocTemp);\r\n  return res;\r\n}\r\n\r\nSRes SzArEx_Open(CSzArEx *p, ILookInStream *inStream, ISzAlloc *allocMain, ISzAlloc *allocTemp)\r\n{\r\n  SRes res = SzArEx_Open2(p, inStream, allocMain, allocTemp);\r\n  if (res != SZ_OK)\r\n    SzArEx_Free(p, allocMain);\r\n  return res;\r\n}\r\n\r\nSRes SzArEx_Extract(\r\n    const CSzArEx *p,\r\n    ILookInStream *inStream,\r\n    UInt32 fileIndex,\r\n    UInt32 *blockIndex,\r\n    Byte **outBuffer,\r\n    size_t *outBufferSize,\r\n    size_t *offset,\r\n    size_t *outSizeProcessed,\r\n    ISzAlloc *allocMain,\r\n    ISzAlloc *allocTemp)\r\n{\r\n  UInt32 folderIndex = p->FileIndexToFolderIndexMap[fileIndex];\r\n  SRes res = SZ_OK;\r\n  *offset = 0;\r\n  *outSizeProcessed = 0;\r\n  if (folderIndex == (UInt32)-1)\r\n  {\r\n    IAlloc_Free(allocMain, *outBuffer);\r\n    *blockIndex = folderIndex;\r\n    *outBuffer = 0;\r\n    *outBufferSize = 0;\r\n    return SZ_OK;\r\n  }\r\n\r\n  if (*outBuffer == 0 || *blockIndex != folderIndex)\r\n  {\r\n    CSzFolder *folder = p->db.Folders + folderIndex;\r\n    UInt64 unpackSizeSpec = SzFolder_GetUnpackSize(folder);\r\n    size_t unpackSize = (size_t)unpackSizeSpec;\r\n    UInt64 startOffset = SzArEx_GetFolderStreamPos(p, folderIndex, 0);\r\n\r\n    if (unpackSize != unpackSizeSpec)\r\n      return SZ_ERROR_MEM;\r\n    *blockIndex = folderIndex;\r\n    IAlloc_Free(allocMain, *outBuffer);\r\n    *outBuffer = 0;\r\n    \r\n    RINOK(LookInStream_SeekTo(inStream, startOffset));\r\n    \r\n    if (res == SZ_OK)\r\n    {\r\n      *outBufferSize = unpackSize;\r\n      if (unpackSize != 0)\r\n      {\r\n        *outBuffer = (Byte *)IAlloc_Alloc(allocMain, unpackSize);\r\n        if (*outBuffer == 0)\r\n          res = SZ_ERROR_MEM;\r\n      }\r\n      if (res == SZ_OK)\r\n      {\r\n        res = SzFolder_Decode(folder,\r\n          p->db.PackSizes + p->FolderStartPackStreamIndex[folderIndex],\r\n          inStream, startOffset,\r\n          *outBuffer, unpackSize, allocTemp);\r\n        if (res == SZ_OK)\r\n        {\r\n          if (folder->UnpackCRCDefined)\r\n          {\r\n            if (CrcCalc(*outBuffer, unpackSize) != folder->UnpackCRC)\r\n              res = SZ_ERROR_CRC;\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n  if (res == SZ_OK)\r\n  {\r\n    UInt32 i;\r\n    CSzFileItem *fileItem = p->db.Files + fileIndex;\r\n    *offset = 0;\r\n    for (i = p->FolderStartFileIndex[folderIndex]; i < fileIndex; i++)\r\n      *offset += (UInt32)p->db.Files[i].Size;\r\n    *outSizeProcessed = (size_t)fileItem->Size;\r\n    if (*offset + *outSizeProcessed > *outBufferSize)\r\n      return SZ_ERROR_FAIL;\r\n    if (fileItem->CrcDefined && CrcCalc(*outBuffer + *offset, *outSizeProcessed) != fileItem->Crc)\r\n      res = SZ_ERROR_CRC;\r\n  }\r\n  return res;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/7zStream.c",
    "content": "/* 7zStream.c -- 7z Stream functions\r\n2010-03-11 : Igor Pavlov : Public domain */\r\n\r\n#include <string.h>\r\n\r\n#include \"Types.h\"\r\n\r\nSRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType)\r\n{\r\n  while (size != 0)\r\n  {\r\n    size_t processed = size;\r\n    RINOK(stream->Read(stream, buf, &processed));\r\n    if (processed == 0)\r\n      return errorType;\r\n    buf = (void *)((Byte *)buf + processed);\r\n    size -= processed;\r\n  }\r\n  return SZ_OK;\r\n}\r\n\r\nSRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size)\r\n{\r\n  return SeqInStream_Read2(stream, buf, size, SZ_ERROR_INPUT_EOF);\r\n}\r\n\r\nSRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf)\r\n{\r\n  size_t processed = 1;\r\n  RINOK(stream->Read(stream, buf, &processed));\r\n  return (processed == 1) ? SZ_OK : SZ_ERROR_INPUT_EOF;\r\n}\r\n\r\nSRes LookInStream_SeekTo(ILookInStream *stream, UInt64 offset)\r\n{\r\n  Int64 t = offset;\r\n  return stream->Seek(stream, &t, SZ_SEEK_SET);\r\n}\r\n\r\nSRes LookInStream_LookRead(ILookInStream *stream, void *buf, size_t *size)\r\n{\r\n  const void *lookBuf;\r\n  if (*size == 0)\r\n    return SZ_OK;\r\n  RINOK(stream->Look(stream, &lookBuf, size));\r\n  memcpy(buf, lookBuf, *size);\r\n  return stream->Skip(stream, *size);\r\n}\r\n\r\nSRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType)\r\n{\r\n  while (size != 0)\r\n  {\r\n    size_t processed = size;\r\n    RINOK(stream->Read(stream, buf, &processed));\r\n    if (processed == 0)\r\n      return errorType;\r\n    buf = (void *)((Byte *)buf + processed);\r\n    size -= processed;\r\n  }\r\n  return SZ_OK;\r\n}\r\n\r\nSRes LookInStream_Read(ILookInStream *stream, void *buf, size_t size)\r\n{\r\n  return LookInStream_Read2(stream, buf, size, SZ_ERROR_INPUT_EOF);\r\n}\r\n\r\nstatic SRes LookToRead_Look_Lookahead(void *pp, const void **buf, size_t *size)\r\n{\r\n  SRes res = SZ_OK;\r\n  CLookToRead *p = (CLookToRead *)pp;\r\n  size_t size2 = p->size - p->pos;\r\n  if (size2 == 0 && *size > 0)\r\n  {\r\n    p->pos = 0;\r\n    size2 = LookToRead_BUF_SIZE;\r\n    res = p->realStream->Read(p->realStream, p->buf, &size2);\r\n    p->size = size2;\r\n  }\r\n  if (size2 < *size)\r\n    *size = size2;\r\n  *buf = p->buf + p->pos;\r\n  return res;\r\n}\r\n\r\nstatic SRes LookToRead_Look_Exact(void *pp, const void **buf, size_t *size)\r\n{\r\n  SRes res = SZ_OK;\r\n  CLookToRead *p = (CLookToRead *)pp;\r\n  size_t size2 = p->size - p->pos;\r\n  if (size2 == 0 && *size > 0)\r\n  {\r\n    p->pos = 0;\r\n    if (*size > LookToRead_BUF_SIZE)\r\n      *size = LookToRead_BUF_SIZE;\r\n    res = p->realStream->Read(p->realStream, p->buf, size);\r\n    size2 = p->size = *size;\r\n  }\r\n  if (size2 < *size)\r\n    *size = size2;\r\n  *buf = p->buf + p->pos;\r\n  return res;\r\n}\r\n\r\nstatic SRes LookToRead_Skip(void *pp, size_t offset)\r\n{\r\n  CLookToRead *p = (CLookToRead *)pp;\r\n  p->pos += offset;\r\n  return SZ_OK;\r\n}\r\n\r\nstatic SRes LookToRead_Read(void *pp, void *buf, size_t *size)\r\n{\r\n  CLookToRead *p = (CLookToRead *)pp;\r\n  size_t rem = p->size - p->pos;\r\n  if (rem == 0)\r\n    return p->realStream->Read(p->realStream, buf, size);\r\n  if (rem > *size)\r\n    rem = *size;\r\n  memcpy(buf, p->buf + p->pos, rem);\r\n  p->pos += rem;\r\n  *size = rem;\r\n  return SZ_OK;\r\n}\r\n\r\nstatic SRes LookToRead_Seek(void *pp, Int64 *pos, ESzSeek origin)\r\n{\r\n  CLookToRead *p = (CLookToRead *)pp;\r\n  p->pos = p->size = 0;\r\n  return p->realStream->Seek(p->realStream, pos, origin);\r\n}\r\n\r\nvoid LookToRead_CreateVTable(CLookToRead *p, int lookahead)\r\n{\r\n  p->s.Look = lookahead ?\r\n      LookToRead_Look_Lookahead :\r\n      LookToRead_Look_Exact;\r\n  p->s.Skip = LookToRead_Skip;\r\n  p->s.Read = LookToRead_Read;\r\n  p->s.Seek = LookToRead_Seek;\r\n}\r\n\r\nvoid LookToRead_Init(CLookToRead *p)\r\n{\r\n  p->pos = p->size = 0;\r\n}\r\n\r\nstatic SRes SecToLook_Read(void *pp, void *buf, size_t *size)\r\n{\r\n  CSecToLook *p = (CSecToLook *)pp;\r\n  return LookInStream_LookRead(p->realStream, buf, size);\r\n}\r\n\r\nvoid SecToLook_CreateVTable(CSecToLook *p)\r\n{\r\n  p->s.Read = SecToLook_Read;\r\n}\r\n\r\nstatic SRes SecToRead_Read(void *pp, void *buf, size_t *size)\r\n{\r\n  CSecToRead *p = (CSecToRead *)pp;\r\n  return p->realStream->Read(p->realStream, buf, size);\r\n}\r\n\r\nvoid SecToRead_CreateVTable(CSecToRead *p)\r\n{\r\n  p->s.Read = SecToRead_Read;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/7zVersion.h",
    "content": "#define MY_VER_MAJOR 9\r\n#define MY_VER_MINOR 22\r\n#define MY_VER_BUILD 00\r\n#define MY_VERSION \"9.22 beta\"\r\n#define MY_7ZIP_VERSION \"9.22 beta\"\r\n#define MY_DATE \"2011-04-18\"\r\n#define MY_COPYRIGHT \": Igor Pavlov : Public domain\"\r\n#define MY_VERSION_COPYRIGHT_DATE MY_VERSION \" \" MY_COPYRIGHT \" : \" MY_DATE\r\n"
  },
  {
    "path": "ext/lzma/C/7zVersion.rc",
    "content": "#define MY_VS_FFI_FILEFLAGSMASK  0x0000003FL\r\n#define MY_VOS_NT_WINDOWS32  0x00040004L\r\n#define MY_VOS_CE_WINDOWS32  0x00050004L\r\n\r\n#define MY_VFT_APP  0x00000001L\r\n#define MY_VFT_DLL  0x00000002L\r\n\r\n// #include <WinVer.h>\r\n\r\n#ifndef MY_VERSION\r\n#include \"7zVersion.h\"\r\n#endif\r\n\r\n#define MY_VER MY_VER_MAJOR,MY_VER_MINOR,MY_VER_BUILD,0\r\n\r\n#ifdef DEBUG\r\n#define DBG_FL VS_FF_DEBUG\r\n#else\r\n#define DBG_FL 0\r\n#endif\r\n\r\n#define MY_VERSION_INFO(fileType, descr, intName, origName)  \\\r\nLANGUAGE 9, 1 \\\r\n1 VERSIONINFO \\\r\n  FILEVERSION MY_VER \\\r\n  PRODUCTVERSION MY_VER \\\r\n  FILEFLAGSMASK MY_VS_FFI_FILEFLAGSMASK \\\r\n  FILEFLAGS DBG_FL \\\r\n  FILEOS MY_VOS_NT_WINDOWS32 \\\r\n  FILETYPE fileType \\\r\n  FILESUBTYPE 0x0L \\\r\nBEGIN \\\r\n    BLOCK \"StringFileInfo\" \\\r\n    BEGIN  \\\r\n        BLOCK \"040904b0\" \\\r\n        BEGIN \\\r\n            VALUE \"CompanyName\", \"Igor Pavlov\" \\\r\n            VALUE \"FileDescription\", descr \\\r\n            VALUE \"FileVersion\", MY_VERSION  \\\r\n            VALUE \"InternalName\", intName \\\r\n            VALUE \"LegalCopyright\", MY_COPYRIGHT \\\r\n            VALUE \"OriginalFilename\", origName \\\r\n            VALUE \"ProductName\", \"7-Zip\" \\\r\n            VALUE \"ProductVersion\", MY_VERSION \\\r\n        END \\\r\n    END \\\r\n    BLOCK \"VarFileInfo\" \\\r\n    BEGIN \\\r\n        VALUE \"Translation\", 0x409, 1200 \\\r\n    END \\\r\nEND\r\n\r\n#define MY_VERSION_INFO_APP(descr, intName) MY_VERSION_INFO(MY_VFT_APP, descr, intName, intName \".exe\")\r\n\r\n#define MY_VERSION_INFO_DLL(descr, intName) MY_VERSION_INFO(MY_VFT_DLL, descr, intName, intName \".dll\")\r\n"
  },
  {
    "path": "ext/lzma/C/Alloc.c",
    "content": "/* Alloc.c -- Memory allocation functions\r\n2008-09-24\r\nIgor Pavlov\r\nPublic domain */\r\n\r\n#ifdef _WIN32\r\n#include <windows.h>\r\n#endif\r\n#include <stdlib.h>\r\n\r\n#include \"Alloc.h\"\r\n\r\n/* #define _SZ_ALLOC_DEBUG */\r\n\r\n/* use _SZ_ALLOC_DEBUG to debug alloc/free operations */\r\n#ifdef _SZ_ALLOC_DEBUG\r\n#include <stdio.h>\r\nint g_allocCount = 0;\r\nint g_allocCountMid = 0;\r\nint g_allocCountBig = 0;\r\n#endif\r\n\r\nvoid *MyAlloc(size_t size)\r\n{\r\n  if (size == 0)\r\n    return 0;\r\n  #ifdef _SZ_ALLOC_DEBUG\r\n  {\r\n    void *p = malloc(size);\r\n    fprintf(stderr, \"\\nAlloc %10d bytes, count = %10d,  addr = %8X\", size, g_allocCount++, (unsigned)p);\r\n    return p;\r\n  }\r\n  #else\r\n  return malloc(size);\r\n  #endif\r\n}\r\n\r\nvoid MyFree(void *address)\r\n{\r\n  #ifdef _SZ_ALLOC_DEBUG\r\n  if (address != 0)\r\n    fprintf(stderr, \"\\nFree; count = %10d,  addr = %8X\", --g_allocCount, (unsigned)address);\r\n  #endif\r\n  free(address);\r\n}\r\n\r\n#ifdef _WIN32\r\n\r\nvoid *MidAlloc(size_t size)\r\n{\r\n  if (size == 0)\r\n    return 0;\r\n  #ifdef _SZ_ALLOC_DEBUG\r\n  fprintf(stderr, \"\\nAlloc_Mid %10d bytes;  count = %10d\", size, g_allocCountMid++);\r\n  #endif\r\n  return VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE);\r\n}\r\n\r\nvoid MidFree(void *address)\r\n{\r\n  #ifdef _SZ_ALLOC_DEBUG\r\n  if (address != 0)\r\n    fprintf(stderr, \"\\nFree_Mid; count = %10d\", --g_allocCountMid);\r\n  #endif\r\n  if (address == 0)\r\n    return;\r\n  VirtualFree(address, 0, MEM_RELEASE);\r\n}\r\n\r\n#ifndef MEM_LARGE_PAGES\r\n#undef _7ZIP_LARGE_PAGES\r\n#endif\r\n\r\n#ifdef _7ZIP_LARGE_PAGES\r\nSIZE_T g_LargePageSize = 0;\r\ntypedef SIZE_T (WINAPI *GetLargePageMinimumP)();\r\n#endif\r\n\r\nvoid SetLargePageSize()\r\n{\r\n  #ifdef _7ZIP_LARGE_PAGES\r\n  SIZE_T size = 0;\r\n  GetLargePageMinimumP largePageMinimum = (GetLargePageMinimumP)\r\n        GetProcAddress(GetModuleHandle(TEXT(\"kernel32.dll\")), \"GetLargePageMinimum\");\r\n  if (largePageMinimum == 0)\r\n    return;\r\n  size = largePageMinimum();\r\n  if (size == 0 || (size & (size - 1)) != 0)\r\n    return;\r\n  g_LargePageSize = size;\r\n  #endif\r\n}\r\n\r\n\r\nvoid *BigAlloc(size_t size)\r\n{\r\n  if (size == 0)\r\n    return 0;\r\n  #ifdef _SZ_ALLOC_DEBUG\r\n  fprintf(stderr, \"\\nAlloc_Big %10d bytes;  count = %10d\", size, g_allocCountBig++);\r\n  #endif\r\n  \r\n  #ifdef _7ZIP_LARGE_PAGES\r\n  if (g_LargePageSize != 0 && g_LargePageSize <= (1 << 30) && size >= (1 << 18))\r\n  {\r\n    void *res = VirtualAlloc(0, (size + g_LargePageSize - 1) & (~(g_LargePageSize - 1)),\r\n        MEM_COMMIT | MEM_LARGE_PAGES, PAGE_READWRITE);\r\n    if (res != 0)\r\n      return res;\r\n  }\r\n  #endif\r\n  return VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE);\r\n}\r\n\r\nvoid BigFree(void *address)\r\n{\r\n  #ifdef _SZ_ALLOC_DEBUG\r\n  if (address != 0)\r\n    fprintf(stderr, \"\\nFree_Big; count = %10d\", --g_allocCountBig);\r\n  #endif\r\n  \r\n  if (address == 0)\r\n    return;\r\n  VirtualFree(address, 0, MEM_RELEASE);\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/Alloc.h",
    "content": "/* Alloc.h -- Memory allocation functions\r\n2009-02-07 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __COMMON_ALLOC_H\r\n#define __COMMON_ALLOC_H\r\n\r\n#include <stddef.h>\r\n\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n#endif\r\n\r\nvoid *MyAlloc(size_t size);\r\nvoid MyFree(void *address);\r\n\r\n#ifdef _WIN32\r\n\r\nvoid SetLargePageSize();\r\n\r\nvoid *MidAlloc(size_t size);\r\nvoid MidFree(void *address);\r\nvoid *BigAlloc(size_t size);\r\nvoid BigFree(void *address);\r\n\r\n#else\r\n\r\n#define MidAlloc(size) MyAlloc(size)\r\n#define MidFree(address) MyFree(address)\r\n#define BigAlloc(size) MyAlloc(size)\r\n#define BigFree(address) MyFree(address)\r\n\r\n#endif\r\n\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/Bcj2.c",
    "content": "/* Bcj2.c -- Converter for x86 code (BCJ2)\r\n2008-10-04 : Igor Pavlov : Public domain */\r\n\r\n#include \"Bcj2.h\"\r\n\r\n#ifdef _LZMA_PROB32\r\n#define CProb UInt32\r\n#else\r\n#define CProb UInt16\r\n#endif\r\n\r\n#define IsJcc(b0, b1) ((b0) == 0x0F && ((b1) & 0xF0) == 0x80)\r\n#define IsJ(b0, b1) ((b1 & 0xFE) == 0xE8 || IsJcc(b0, b1))\r\n\r\n#define kNumTopBits 24\r\n#define kTopValue ((UInt32)1 << kNumTopBits)\r\n\r\n#define kNumBitModelTotalBits 11\r\n#define kBitModelTotal (1 << kNumBitModelTotalBits)\r\n#define kNumMoveBits 5\r\n\r\n#define RC_READ_BYTE (*buffer++)\r\n#define RC_TEST { if (buffer == bufferLim) return SZ_ERROR_DATA; }\r\n#define RC_INIT2 code = 0; range = 0xFFFFFFFF; \\\r\n  { int i; for (i = 0; i < 5; i++) { RC_TEST; code = (code << 8) | RC_READ_BYTE; }}\r\n\r\n#define NORMALIZE if (range < kTopValue) { RC_TEST; range <<= 8; code = (code << 8) | RC_READ_BYTE; }\r\n\r\n#define IF_BIT_0(p) ttt = *(p); bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)\r\n#define UPDATE_0(p) range = bound; *(p) = (CProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); NORMALIZE;\r\n#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CProb)(ttt - (ttt >> kNumMoveBits)); NORMALIZE;\r\n\r\nint Bcj2_Decode(\r\n    const Byte *buf0, SizeT size0,\r\n    const Byte *buf1, SizeT size1,\r\n    const Byte *buf2, SizeT size2,\r\n    const Byte *buf3, SizeT size3,\r\n    Byte *outBuf, SizeT outSize)\r\n{\r\n  CProb p[256 + 2];\r\n  SizeT inPos = 0, outPos = 0;\r\n\r\n  const Byte *buffer, *bufferLim;\r\n  UInt32 range, code;\r\n  Byte prevByte = 0;\r\n\r\n  unsigned int i;\r\n  for (i = 0; i < sizeof(p) / sizeof(p[0]); i++)\r\n    p[i] = kBitModelTotal >> 1;\r\n\r\n  buffer = buf3;\r\n  bufferLim = buffer + size3;\r\n  RC_INIT2\r\n\r\n  if (outSize == 0)\r\n    return SZ_OK;\r\n\r\n  for (;;)\r\n  {\r\n    Byte b;\r\n    CProb *prob;\r\n    UInt32 bound;\r\n    UInt32 ttt;\r\n\r\n    SizeT limit = size0 - inPos;\r\n    if (outSize - outPos < limit)\r\n      limit = outSize - outPos;\r\n    while (limit != 0)\r\n    {\r\n      Byte b = buf0[inPos];\r\n      outBuf[outPos++] = b;\r\n      if (IsJ(prevByte, b))\r\n        break;\r\n      inPos++;\r\n      prevByte = b;\r\n      limit--;\r\n    }\r\n\r\n    if (limit == 0 || outPos == outSize)\r\n      break;\r\n\r\n    b = buf0[inPos++];\r\n\r\n    if (b == 0xE8)\r\n      prob = p + prevByte;\r\n    else if (b == 0xE9)\r\n      prob = p + 256;\r\n    else\r\n      prob = p + 257;\r\n\r\n    IF_BIT_0(prob)\r\n    {\r\n      UPDATE_0(prob)\r\n      prevByte = b;\r\n    }\r\n    else\r\n    {\r\n      UInt32 dest;\r\n      const Byte *v;\r\n      UPDATE_1(prob)\r\n      if (b == 0xE8)\r\n      {\r\n        v = buf1;\r\n        if (size1 < 4)\r\n          return SZ_ERROR_DATA;\r\n        buf1 += 4;\r\n        size1 -= 4;\r\n      }\r\n      else\r\n      {\r\n        v = buf2;\r\n        if (size2 < 4)\r\n          return SZ_ERROR_DATA;\r\n        buf2 += 4;\r\n        size2 -= 4;\r\n      }\r\n      dest = (((UInt32)v[0] << 24) | ((UInt32)v[1] << 16) |\r\n          ((UInt32)v[2] << 8) | ((UInt32)v[3])) - ((UInt32)outPos + 4);\r\n      outBuf[outPos++] = (Byte)dest;\r\n      if (outPos == outSize)\r\n        break;\r\n      outBuf[outPos++] = (Byte)(dest >> 8);\r\n      if (outPos == outSize)\r\n        break;\r\n      outBuf[outPos++] = (Byte)(dest >> 16);\r\n      if (outPos == outSize)\r\n        break;\r\n      outBuf[outPos++] = prevByte = (Byte)(dest >> 24);\r\n    }\r\n  }\r\n  return (outPos == outSize) ? SZ_OK : SZ_ERROR_DATA;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/Bcj2.h",
    "content": "/* Bcj2.h -- Converter for x86 code (BCJ2)\r\n2009-02-07 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __BCJ2_H\r\n#define __BCJ2_H\r\n\r\n#include \"Types.h\"\r\n\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n#endif\r\n\r\n/*\r\nConditions:\r\n  outSize <= FullOutputSize,\r\n  where FullOutputSize is full size of output stream of x86_2 filter.\r\n\r\nIf buf0 overlaps outBuf, there are two required conditions:\r\n  1) (buf0 >= outBuf)\r\n  2) (buf0 + size0 >= outBuf + FullOutputSize).\r\n\r\nReturns:\r\n  SZ_OK\r\n  SZ_ERROR_DATA - Data error\r\n*/\r\n\r\nint Bcj2_Decode(\r\n    const Byte *buf0, SizeT size0,\r\n    const Byte *buf1, SizeT size1,\r\n    const Byte *buf2, SizeT size2,\r\n    const Byte *buf3, SizeT size3,\r\n    Byte *outBuf, SizeT outSize);\r\n\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/Bra.c",
    "content": "/* Bra.c -- Converters for RISC code\r\n2010-04-16 : Igor Pavlov : Public domain */\r\n\r\n#include \"Bra.h\"\r\n\r\nSizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)\r\n{\r\n  SizeT i;\r\n  if (size < 4)\r\n    return 0;\r\n  size -= 4;\r\n  ip += 8;\r\n  for (i = 0; i <= size; i += 4)\r\n  {\r\n    if (data[i + 3] == 0xEB)\r\n    {\r\n      UInt32 dest;\r\n      UInt32 src = ((UInt32)data[i + 2] << 16) | ((UInt32)data[i + 1] << 8) | (data[i + 0]);\r\n      src <<= 2;\r\n      if (encoding)\r\n        dest = ip + (UInt32)i + src;\r\n      else\r\n        dest = src - (ip + (UInt32)i);\r\n      dest >>= 2;\r\n      data[i + 2] = (Byte)(dest >> 16);\r\n      data[i + 1] = (Byte)(dest >> 8);\r\n      data[i + 0] = (Byte)dest;\r\n    }\r\n  }\r\n  return i;\r\n}\r\n\r\nSizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)\r\n{\r\n  SizeT i;\r\n  if (size < 4)\r\n    return 0;\r\n  size -= 4;\r\n  ip += 4;\r\n  for (i = 0; i <= size; i += 2)\r\n  {\r\n    if ((data[i + 1] & 0xF8) == 0xF0 &&\r\n        (data[i + 3] & 0xF8) == 0xF8)\r\n    {\r\n      UInt32 dest;\r\n      UInt32 src =\r\n        (((UInt32)data[i + 1] & 0x7) << 19) |\r\n        ((UInt32)data[i + 0] << 11) |\r\n        (((UInt32)data[i + 3] & 0x7) << 8) |\r\n        (data[i + 2]);\r\n      \r\n      src <<= 1;\r\n      if (encoding)\r\n        dest = ip + (UInt32)i + src;\r\n      else\r\n        dest = src - (ip + (UInt32)i);\r\n      dest >>= 1;\r\n      \r\n      data[i + 1] = (Byte)(0xF0 | ((dest >> 19) & 0x7));\r\n      data[i + 0] = (Byte)(dest >> 11);\r\n      data[i + 3] = (Byte)(0xF8 | ((dest >> 8) & 0x7));\r\n      data[i + 2] = (Byte)dest;\r\n      i += 2;\r\n    }\r\n  }\r\n  return i;\r\n}\r\n\r\nSizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)\r\n{\r\n  SizeT i;\r\n  if (size < 4)\r\n    return 0;\r\n  size -= 4;\r\n  for (i = 0; i <= size; i += 4)\r\n  {\r\n    if ((data[i] >> 2) == 0x12 && (data[i + 3] & 3) == 1)\r\n    {\r\n      UInt32 src = ((UInt32)(data[i + 0] & 3) << 24) |\r\n        ((UInt32)data[i + 1] << 16) |\r\n        ((UInt32)data[i + 2] << 8) |\r\n        ((UInt32)data[i + 3] & (~3));\r\n      \r\n      UInt32 dest;\r\n      if (encoding)\r\n        dest = ip + (UInt32)i + src;\r\n      else\r\n        dest = src - (ip + (UInt32)i);\r\n      data[i + 0] = (Byte)(0x48 | ((dest >> 24) &  0x3));\r\n      data[i + 1] = (Byte)(dest >> 16);\r\n      data[i + 2] = (Byte)(dest >> 8);\r\n      data[i + 3] &= 0x3;\r\n      data[i + 3] |= dest;\r\n    }\r\n  }\r\n  return i;\r\n}\r\n\r\nSizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)\r\n{\r\n  UInt32 i;\r\n  if (size < 4)\r\n    return 0;\r\n  size -= 4;\r\n  for (i = 0; i <= size; i += 4)\r\n  {\r\n    if ((data[i] == 0x40 && (data[i + 1] & 0xC0) == 0x00) ||\r\n        (data[i] == 0x7F && (data[i + 1] & 0xC0) == 0xC0))\r\n    {\r\n      UInt32 src =\r\n        ((UInt32)data[i + 0] << 24) |\r\n        ((UInt32)data[i + 1] << 16) |\r\n        ((UInt32)data[i + 2] << 8) |\r\n        ((UInt32)data[i + 3]);\r\n      UInt32 dest;\r\n      \r\n      src <<= 2;\r\n      if (encoding)\r\n        dest = ip + i + src;\r\n      else\r\n        dest = src - (ip + i);\r\n      dest >>= 2;\r\n      \r\n      dest = (((0 - ((dest >> 22) & 1)) << 22) & 0x3FFFFFFF) | (dest & 0x3FFFFF) | 0x40000000;\r\n\r\n      data[i + 0] = (Byte)(dest >> 24);\r\n      data[i + 1] = (Byte)(dest >> 16);\r\n      data[i + 2] = (Byte)(dest >> 8);\r\n      data[i + 3] = (Byte)dest;\r\n    }\r\n  }\r\n  return i;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/Bra.h",
    "content": "/* Bra.h -- Branch converters for executables\r\n2009-02-07 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __BRA_H\r\n#define __BRA_H\r\n\r\n#include \"Types.h\"\r\n\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n#endif\r\n\r\n/*\r\nThese functions convert relative addresses to absolute addresses\r\nin CALL instructions to increase the compression ratio.\r\n  \r\n  In:\r\n    data     - data buffer\r\n    size     - size of data\r\n    ip       - current virtual Instruction Pinter (IP) value\r\n    state    - state variable for x86 converter\r\n    encoding - 0 (for decoding), 1 (for encoding)\r\n  \r\n  Out:\r\n    state    - state variable for x86 converter\r\n\r\n  Returns:\r\n    The number of processed bytes. If you call these functions with multiple calls,\r\n    you must start next call with first byte after block of processed bytes.\r\n  \r\n  Type   Endian  Alignment  LookAhead\r\n  \r\n  x86    little      1          4\r\n  ARMT   little      2          2\r\n  ARM    little      4          0\r\n  PPC     big        4          0\r\n  SPARC   big        4          0\r\n  IA64   little     16          0\r\n\r\n  size must be >= Alignment + LookAhead, if it's not last block.\r\n  If (size < Alignment + LookAhead), converter returns 0.\r\n\r\n  Example:\r\n\r\n    UInt32 ip = 0;\r\n    for ()\r\n    {\r\n      ; size must be >= Alignment + LookAhead, if it's not last block\r\n      SizeT processed = Convert(data, size, ip, 1);\r\n      data += processed;\r\n      size -= processed;\r\n      ip += processed;\r\n    }\r\n*/\r\n\r\n#define x86_Convert_Init(state) { state = 0; }\r\nSizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding);\r\nSizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);\r\nSizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);\r\nSizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);\r\nSizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);\r\nSizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);\r\n\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/Bra86.c",
    "content": "/* Bra86.c -- Converter for x86 code (BCJ)\r\n2008-10-04 : Igor Pavlov : Public domain */\r\n\r\n#include \"Bra.h\"\r\n\r\n#define Test86MSByte(b) ((b) == 0 || (b) == 0xFF)\r\n\r\nconst Byte kMaskToAllowedStatus[8] = {1, 1, 1, 0, 1, 0, 0, 0};\r\nconst Byte kMaskToBitNumber[8] = {0, 1, 2, 2, 3, 3, 3, 3};\r\n\r\nSizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding)\r\n{\r\n  SizeT bufferPos = 0, prevPosT;\r\n  UInt32 prevMask = *state & 0x7;\r\n  if (size < 5)\r\n    return 0;\r\n  ip += 5;\r\n  prevPosT = (SizeT)0 - 1;\r\n\r\n  for (;;)\r\n  {\r\n    Byte *p = data + bufferPos;\r\n    Byte *limit = data + size - 4;\r\n    for (; p < limit; p++)\r\n      if ((*p & 0xFE) == 0xE8)\r\n        break;\r\n    bufferPos = (SizeT)(p - data);\r\n    if (p >= limit)\r\n      break;\r\n    prevPosT = bufferPos - prevPosT;\r\n    if (prevPosT > 3)\r\n      prevMask = 0;\r\n    else\r\n    {\r\n      prevMask = (prevMask << ((int)prevPosT - 1)) & 0x7;\r\n      if (prevMask != 0)\r\n      {\r\n        Byte b = p[4 - kMaskToBitNumber[prevMask]];\r\n        if (!kMaskToAllowedStatus[prevMask] || Test86MSByte(b))\r\n        {\r\n          prevPosT = bufferPos;\r\n          prevMask = ((prevMask << 1) & 0x7) | 1;\r\n          bufferPos++;\r\n          continue;\r\n        }\r\n      }\r\n    }\r\n    prevPosT = bufferPos;\r\n\r\n    if (Test86MSByte(p[4]))\r\n    {\r\n      UInt32 src = ((UInt32)p[4] << 24) | ((UInt32)p[3] << 16) | ((UInt32)p[2] << 8) | ((UInt32)p[1]);\r\n      UInt32 dest;\r\n      for (;;)\r\n      {\r\n        Byte b;\r\n        int index;\r\n        if (encoding)\r\n          dest = (ip + (UInt32)bufferPos) + src;\r\n        else\r\n          dest = src - (ip + (UInt32)bufferPos);\r\n        if (prevMask == 0)\r\n          break;\r\n        index = kMaskToBitNumber[prevMask] * 8;\r\n        b = (Byte)(dest >> (24 - index));\r\n        if (!Test86MSByte(b))\r\n          break;\r\n        src = dest ^ ((1 << (32 - index)) - 1);\r\n      }\r\n      p[4] = (Byte)(~(((dest >> 24) & 1) - 1));\r\n      p[3] = (Byte)(dest >> 16);\r\n      p[2] = (Byte)(dest >> 8);\r\n      p[1] = (Byte)dest;\r\n      bufferPos += 5;\r\n    }\r\n    else\r\n    {\r\n      prevMask = ((prevMask << 1) & 0x7) | 1;\r\n      bufferPos++;\r\n    }\r\n  }\r\n  prevPosT = bufferPos - prevPosT;\r\n  *state = ((prevPosT > 3) ? 0 : ((prevMask << ((int)prevPosT - 1)) & 0x7));\r\n  return bufferPos;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/BraIA64.c",
    "content": "/* BraIA64.c -- Converter for IA-64 code\r\n2008-10-04 : Igor Pavlov : Public domain */\r\n\r\n#include \"Bra.h\"\r\n\r\nstatic const Byte kBranchTable[32] =\r\n{\r\n  0, 0, 0, 0, 0, 0, 0, 0,\r\n  0, 0, 0, 0, 0, 0, 0, 0,\r\n  4, 4, 6, 6, 0, 0, 7, 7,\r\n  4, 4, 0, 0, 4, 4, 0, 0\r\n};\r\n\r\nSizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)\r\n{\r\n  SizeT i;\r\n  if (size < 16)\r\n    return 0;\r\n  size -= 16;\r\n  for (i = 0; i <= size; i += 16)\r\n  {\r\n    UInt32 instrTemplate = data[i] & 0x1F;\r\n    UInt32 mask = kBranchTable[instrTemplate];\r\n    UInt32 bitPos = 5;\r\n    int slot;\r\n    for (slot = 0; slot < 3; slot++, bitPos += 41)\r\n    {\r\n      UInt32 bytePos, bitRes;\r\n      UInt64 instruction, instNorm;\r\n      int j;\r\n      if (((mask >> slot) & 1) == 0)\r\n        continue;\r\n      bytePos = (bitPos >> 3);\r\n      bitRes = bitPos & 0x7;\r\n      instruction = 0;\r\n      for (j = 0; j < 6; j++)\r\n        instruction += (UInt64)data[i + j + bytePos] << (8 * j);\r\n\r\n      instNorm = instruction >> bitRes;\r\n      if (((instNorm >> 37) & 0xF) == 0x5 && ((instNorm >> 9) & 0x7) == 0)\r\n      {\r\n        UInt32 src = (UInt32)((instNorm >> 13) & 0xFFFFF);\r\n        UInt32 dest;\r\n        src |= ((UInt32)(instNorm >> 36) & 1) << 20;\r\n        \r\n        src <<= 4;\r\n        \r\n        if (encoding)\r\n          dest = ip + (UInt32)i + src;\r\n        else\r\n          dest = src - (ip + (UInt32)i);\r\n        \r\n        dest >>= 4;\r\n        \r\n        instNorm &= ~((UInt64)(0x8FFFFF) << 13);\r\n        instNorm |= ((UInt64)(dest & 0xFFFFF) << 13);\r\n        instNorm |= ((UInt64)(dest & 0x100000) << (36 - 20));\r\n        \r\n        instruction &= (1 << bitRes) - 1;\r\n        instruction |= (instNorm << bitRes);\r\n        for (j = 0; j < 6; j++)\r\n          data[i + j + bytePos] = (Byte)(instruction >> (8 * j));\r\n      }\r\n    }\r\n  }\r\n  return i;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/CpuArch.c",
    "content": "/* CpuArch.c -- CPU specific code\r\n2010-10-26: Igor Pavlov : Public domain */\r\n\r\n#include \"CpuArch.h\"\r\n\r\n#ifdef MY_CPU_X86_OR_AMD64\r\n\r\n#if (defined(_MSC_VER) && !defined(MY_CPU_AMD64)) || defined(__GNUC__)\r\n#define USE_ASM\r\n#endif\r\n\r\n#if defined(USE_ASM) && !defined(MY_CPU_AMD64)\r\nstatic UInt32 CheckFlag(UInt32 flag)\r\n{\r\n  #ifdef _MSC_VER\r\n  __asm pushfd;\r\n  __asm pop EAX;\r\n  __asm mov EDX, EAX;\r\n  __asm xor EAX, flag;\r\n  __asm push EAX;\r\n  __asm popfd;\r\n  __asm pushfd;\r\n  __asm pop EAX;\r\n  __asm xor EAX, EDX;\r\n  __asm push EDX;\r\n  __asm popfd;\r\n  __asm and flag, EAX;\r\n  #else\r\n  __asm__ __volatile__ (\r\n    \"pushf\\n\\t\"\r\n    \"pop  %%EAX\\n\\t\"\r\n    \"movl %%EAX,%%EDX\\n\\t\"\r\n    \"xorl %0,%%EAX\\n\\t\"\r\n    \"push %%EAX\\n\\t\"\r\n    \"popf\\n\\t\"\r\n    \"pushf\\n\\t\"\r\n    \"pop  %%EAX\\n\\t\"\r\n    \"xorl %%EDX,%%EAX\\n\\t\"\r\n    \"push %%EDX\\n\\t\"\r\n    \"popf\\n\\t\"\r\n    \"andl %%EAX, %0\\n\\t\":\r\n    \"=c\" (flag) : \"c\" (flag));\r\n  #endif\r\n  return flag;\r\n}\r\n#define CHECK_CPUID_IS_SUPPORTED if (CheckFlag(1 << 18) == 0 || CheckFlag(1 << 21) == 0) return False;\r\n#else\r\n#define CHECK_CPUID_IS_SUPPORTED\r\n#endif\r\n\r\nstatic void MyCPUID(UInt32 function, UInt32 *a, UInt32 *b, UInt32 *c, UInt32 *d)\r\n{\r\n  #ifdef USE_ASM\r\n\r\n  #ifdef _MSC_VER\r\n\r\n  UInt32 a2, b2, c2, d2;\r\n  __asm xor EBX, EBX;\r\n  __asm xor ECX, ECX;\r\n  __asm xor EDX, EDX;\r\n  __asm mov EAX, function;\r\n  __asm cpuid;\r\n  __asm mov a2, EAX;\r\n  __asm mov b2, EBX;\r\n  __asm mov c2, ECX;\r\n  __asm mov d2, EDX;\r\n\r\n  *a = a2;\r\n  *b = b2;\r\n  *c = c2;\r\n  *d = d2;\r\n\r\n  #else\r\n\r\n  __asm__ __volatile__ (\r\n    \"cpuid\"\r\n    : \"=a\" (*a) ,\r\n      \"=b\" (*b) ,\r\n      \"=c\" (*c) ,\r\n      \"=d\" (*d)\r\n    : \"0\" (function)) ;\r\n\r\n  #endif\r\n  \r\n  #else\r\n\r\n  int CPUInfo[4];\r\n  __cpuid(CPUInfo, function);\r\n  *a = CPUInfo[0];\r\n  *b = CPUInfo[1];\r\n  *c = CPUInfo[2];\r\n  *d = CPUInfo[3];\r\n\r\n  #endif\r\n}\r\n\r\nBool x86cpuid_CheckAndRead(Cx86cpuid *p)\r\n{\r\n  CHECK_CPUID_IS_SUPPORTED\r\n  MyCPUID(0, &p->maxFunc, &p->vendor[0], &p->vendor[2], &p->vendor[1]);\r\n  MyCPUID(1, &p->ver, &p->b, &p->c, &p->d);\r\n  return True;\r\n}\r\n\r\nstatic UInt32 kVendors[][3] =\r\n{\r\n  { 0x756E6547, 0x49656E69, 0x6C65746E},\r\n  { 0x68747541, 0x69746E65, 0x444D4163},\r\n  { 0x746E6543, 0x48727561, 0x736C7561}\r\n};\r\n\r\nint x86cpuid_GetFirm(const Cx86cpuid *p)\r\n{\r\n  unsigned i;\r\n  for (i = 0; i < sizeof(kVendors) / sizeof(kVendors[i]); i++)\r\n  {\r\n    const UInt32 *v = kVendors[i];\r\n    if (v[0] == p->vendor[0] &&\r\n        v[1] == p->vendor[1] &&\r\n        v[2] == p->vendor[2])\r\n      return (int)i;\r\n  }\r\n  return -1;\r\n}\r\n\r\nBool CPU_Is_InOrder()\r\n{\r\n  Cx86cpuid p;\r\n  int firm;\r\n  UInt32 family, model;\r\n  if (!x86cpuid_CheckAndRead(&p))\r\n    return True;\r\n  family = x86cpuid_GetFamily(&p);\r\n  model = x86cpuid_GetModel(&p);\r\n  firm = x86cpuid_GetFirm(&p);\r\n  switch (firm)\r\n  {\r\n    case CPU_FIRM_INTEL: return (family < 6 || (family == 6 && model == 0x100C));\r\n    case CPU_FIRM_AMD: return (family < 5 || (family == 5 && (model < 6 || model == 0xA)));\r\n    case CPU_FIRM_VIA: return (family < 6 || (family == 6 && model < 0xF));\r\n  }\r\n  return True;\r\n}\r\n\r\n#if !defined(MY_CPU_AMD64) && defined(_WIN32)\r\nstatic Bool CPU_Sys_Is_SSE_Supported()\r\n{\r\n  OSVERSIONINFO vi;\r\n  vi.dwOSVersionInfoSize = sizeof(vi);\r\n  if (!GetVersionEx(&vi))\r\n    return False;\r\n  return (vi.dwMajorVersion >= 5);\r\n}\r\n#define CHECK_SYS_SSE_SUPPORT if (!CPU_Sys_Is_SSE_Supported()) return False;\r\n#else\r\n#define CHECK_SYS_SSE_SUPPORT\r\n#endif\r\n\r\nBool CPU_Is_Aes_Supported()\r\n{\r\n  Cx86cpuid p;\r\n  CHECK_SYS_SSE_SUPPORT\r\n  if (!x86cpuid_CheckAndRead(&p))\r\n    return False;\r\n  return (p.c >> 25) & 1;\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/CpuArch.h",
    "content": "/* CpuArch.h -- CPU specific code\r\n2010-12-01: Igor Pavlov : Public domain */\r\n\r\n#ifndef __CPU_ARCH_H\r\n#define __CPU_ARCH_H\r\n\r\n#include \"Types.h\"\r\n\r\nEXTERN_C_BEGIN\r\n\r\n/*\r\nMY_CPU_LE means that CPU is LITTLE ENDIAN.\r\nIf MY_CPU_LE is not defined, we don't know about that property of platform (it can be LITTLE ENDIAN).\r\n\r\nMY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned memory accesses.\r\nIf MY_CPU_LE_UNALIGN is not defined, we don't know about these properties of platform.\r\n*/\r\n\r\n#if defined(_M_X64) || defined(_M_AMD64) || defined(__x86_64__)\r\n#define MY_CPU_AMD64\r\n#endif\r\n\r\n#if defined(MY_CPU_AMD64) || defined(_M_IA64)\r\n#define MY_CPU_64BIT\r\n#endif\r\n\r\n#if defined(_M_IX86) || defined(__i386__)\r\n#define MY_CPU_X86\r\n#endif\r\n\r\n#if defined(MY_CPU_X86) || defined(MY_CPU_AMD64)\r\n#define MY_CPU_X86_OR_AMD64\r\n#endif\r\n\r\n#if defined(MY_CPU_X86) || defined(_M_ARM)\r\n#define MY_CPU_32BIT\r\n#endif\r\n\r\n#if defined(_WIN32) && defined(_M_ARM)\r\n#define MY_CPU_ARM_LE\r\n#endif\r\n\r\n#if defined(_WIN32) && defined(_M_IA64)\r\n#define MY_CPU_IA64_LE\r\n#endif\r\n\r\n#if defined(MY_CPU_X86_OR_AMD64)\r\n#define MY_CPU_LE_UNALIGN\r\n#endif\r\n\r\n#if defined(MY_CPU_X86_OR_AMD64) || defined(MY_CPU_ARM_LE)  || defined(MY_CPU_IA64_LE) || defined(__ARMEL__) || defined(__MIPSEL__) || defined(__LITTLE_ENDIAN__)\r\n#define MY_CPU_LE\r\n#endif\r\n\r\n#if defined(__BIG_ENDIAN__) || defined(__m68k__) ||  defined(__ARMEB__) || defined(__MIPSEB__)\r\n#define MY_CPU_BE\r\n#endif\r\n\r\n#if defined(MY_CPU_LE) && defined(MY_CPU_BE)\r\nStop_Compiling_Bad_Endian\r\n#endif\r\n\r\n#ifdef MY_CPU_LE_UNALIGN\r\n\r\n#define GetUi16(p) (*(const UInt16 *)(p))\r\n#define GetUi32(p) (*(const UInt32 *)(p))\r\n#define GetUi64(p) (*(const UInt64 *)(p))\r\n#define SetUi16(p, d) *(UInt16 *)(p) = (d);\r\n#define SetUi32(p, d) *(UInt32 *)(p) = (d);\r\n#define SetUi64(p, d) *(UInt64 *)(p) = (d);\r\n\r\n#else\r\n\r\n#define GetUi16(p) (((const Byte *)(p))[0] | ((UInt16)((const Byte *)(p))[1] << 8))\r\n\r\n#define GetUi32(p) ( \\\r\n             ((const Byte *)(p))[0]        | \\\r\n    ((UInt32)((const Byte *)(p))[1] <<  8) | \\\r\n    ((UInt32)((const Byte *)(p))[2] << 16) | \\\r\n    ((UInt32)((const Byte *)(p))[3] << 24))\r\n\r\n#define GetUi64(p) (GetUi32(p) | ((UInt64)GetUi32(((const Byte *)(p)) + 4) << 32))\r\n\r\n#define SetUi16(p, d) { UInt32 _x_ = (d); \\\r\n    ((Byte *)(p))[0] = (Byte)_x_; \\\r\n    ((Byte *)(p))[1] = (Byte)(_x_ >> 8); }\r\n\r\n#define SetUi32(p, d) { UInt32 _x_ = (d); \\\r\n    ((Byte *)(p))[0] = (Byte)_x_; \\\r\n    ((Byte *)(p))[1] = (Byte)(_x_ >> 8); \\\r\n    ((Byte *)(p))[2] = (Byte)(_x_ >> 16); \\\r\n    ((Byte *)(p))[3] = (Byte)(_x_ >> 24); }\r\n\r\n#define SetUi64(p, d) { UInt64 _x64_ = (d); \\\r\n    SetUi32(p, (UInt32)_x64_); \\\r\n    SetUi32(((Byte *)(p)) + 4, (UInt32)(_x64_ >> 32)); }\r\n\r\n#endif\r\n\r\n#if defined(MY_CPU_LE_UNALIGN) && defined(_WIN64) && (_MSC_VER >= 1300)\r\n\r\n#pragma intrinsic(_byteswap_ulong)\r\n#pragma intrinsic(_byteswap_uint64)\r\n#define GetBe32(p) _byteswap_ulong(*(const UInt32 *)(const Byte *)(p))\r\n#define GetBe64(p) _byteswap_uint64(*(const UInt64 *)(const Byte *)(p))\r\n\r\n#else\r\n\r\n#define GetBe32(p) ( \\\r\n    ((UInt32)((const Byte *)(p))[0] << 24) | \\\r\n    ((UInt32)((const Byte *)(p))[1] << 16) | \\\r\n    ((UInt32)((const Byte *)(p))[2] <<  8) | \\\r\n             ((const Byte *)(p))[3] )\r\n\r\n#define GetBe64(p) (((UInt64)GetBe32(p) << 32) | GetBe32(((const Byte *)(p)) + 4))\r\n\r\n#endif\r\n\r\n#define GetBe16(p) (((UInt16)((const Byte *)(p))[0] << 8) | ((const Byte *)(p))[1])\r\n\r\n\r\n#ifdef MY_CPU_X86_OR_AMD64\r\n\r\ntypedef struct\r\n{\r\n  UInt32 maxFunc;\r\n  UInt32 vendor[3];\r\n  UInt32 ver;\r\n  UInt32 b;\r\n  UInt32 c;\r\n  UInt32 d;\r\n} Cx86cpuid;\r\n\r\nenum\r\n{\r\n  CPU_FIRM_INTEL,\r\n  CPU_FIRM_AMD,\r\n  CPU_FIRM_VIA\r\n};\r\n\r\nBool x86cpuid_CheckAndRead(Cx86cpuid *p);\r\nint x86cpuid_GetFirm(const Cx86cpuid *p);\r\n\r\n#define x86cpuid_GetFamily(p) (((p)->ver >> 8) & 0xFF00F)\r\n#define x86cpuid_GetModel(p) (((p)->ver >> 4) & 0xF00F)\r\n#define x86cpuid_GetStepping(p) ((p)->ver & 0xF)\r\n\r\nBool CPU_Is_InOrder();\r\nBool CPU_Is_Aes_Supported();\r\n\r\n#endif\r\n\r\nEXTERN_C_END\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/Delta.c",
    "content": "/* Delta.c -- Delta converter\r\n2009-05-26 : Igor Pavlov : Public domain */\r\n\r\n#include \"Delta.h\"\r\n\r\nvoid Delta_Init(Byte *state)\r\n{\r\n  unsigned i;\r\n  for (i = 0; i < DELTA_STATE_SIZE; i++)\r\n    state[i] = 0;\r\n}\r\n\r\nstatic void MyMemCpy(Byte *dest, const Byte *src, unsigned size)\r\n{\r\n  unsigned i;\r\n  for (i = 0; i < size; i++)\r\n    dest[i] = src[i];\r\n}\r\n\r\nvoid Delta_Encode(Byte *state, unsigned delta, Byte *data, SizeT size)\r\n{\r\n  Byte buf[DELTA_STATE_SIZE];\r\n  unsigned j = 0;\r\n  MyMemCpy(buf, state, delta);\r\n  {\r\n    SizeT i;\r\n    for (i = 0; i < size;)\r\n    {\r\n      for (j = 0; j < delta && i < size; i++, j++)\r\n      {\r\n        Byte b = data[i];\r\n        data[i] = (Byte)(b - buf[j]);\r\n        buf[j] = b;\r\n      }\r\n    }\r\n  }\r\n  if (j == delta)\r\n    j = 0;\r\n  MyMemCpy(state, buf + j, delta - j);\r\n  MyMemCpy(state + delta - j, buf, j);\r\n}\r\n\r\nvoid Delta_Decode(Byte *state, unsigned delta, Byte *data, SizeT size)\r\n{\r\n  Byte buf[DELTA_STATE_SIZE];\r\n  unsigned j = 0;\r\n  MyMemCpy(buf, state, delta);\r\n  {\r\n    SizeT i;\r\n    for (i = 0; i < size;)\r\n    {\r\n      for (j = 0; j < delta && i < size; i++, j++)\r\n      {\r\n        buf[j] = data[i] = (Byte)(buf[j] + data[i]);\r\n      }\r\n    }\r\n  }\r\n  if (j == delta)\r\n    j = 0;\r\n  MyMemCpy(state, buf + j, delta - j);\r\n  MyMemCpy(state + delta - j, buf, j);\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/Delta.h",
    "content": "/* Delta.h -- Delta converter\r\n2009-04-15 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __DELTA_H\r\n#define __DELTA_H\r\n\r\n#include \"Types.h\"\r\n\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n#endif\r\n\r\n#define DELTA_STATE_SIZE 256\r\n\r\nvoid Delta_Init(Byte *state);\r\nvoid Delta_Encode(Byte *state, unsigned delta, Byte *data, SizeT size);\r\nvoid Delta_Decode(Byte *state, unsigned delta, Byte *data, SizeT size);\r\n\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/LzFind.c",
    "content": "/* LzFind.c -- Match finder for LZ algorithms\r\n2009-04-22 : Igor Pavlov : Public domain */\r\n\r\n#include <string.h>\r\n\r\n#include \"LzFind.h\"\r\n#include \"LzHash.h\"\r\n\r\n#define kEmptyHashValue 0\r\n#define kMaxValForNormalize ((UInt32)0xFFFFFFFF)\r\n#define kNormalizeStepMin (1 << 10) /* it must be power of 2 */\r\n#define kNormalizeMask (~(kNormalizeStepMin - 1))\r\n#define kMaxHistorySize ((UInt32)3 << 30)\r\n\r\n#define kStartMaxLen 3\r\n\r\nstatic void LzInWindow_Free(CMatchFinder *p, ISzAlloc *alloc)\r\n{\r\n  if (!p->directInput)\r\n  {\r\n    alloc->Free(alloc, p->bufferBase);\r\n    p->bufferBase = 0;\r\n  }\r\n}\r\n\r\n/* keepSizeBefore + keepSizeAfter + keepSizeReserv must be < 4G) */\r\n\r\nstatic int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAlloc *alloc)\r\n{\r\n  UInt32 blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv;\r\n  if (p->directInput)\r\n  {\r\n    p->blockSize = blockSize;\r\n    return 1;\r\n  }\r\n  if (p->bufferBase == 0 || p->blockSize != blockSize)\r\n  {\r\n    LzInWindow_Free(p, alloc);\r\n    p->blockSize = blockSize;\r\n    p->bufferBase = (Byte *)alloc->Alloc(alloc, (size_t)blockSize);\r\n  }\r\n  return (p->bufferBase != 0);\r\n}\r\n\r\nByte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; }\r\nByte MatchFinder_GetIndexByte(CMatchFinder *p, Int32 index) { return p->buffer[index]; }\r\n\r\nUInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; }\r\n\r\nvoid MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue)\r\n{\r\n  p->posLimit -= subValue;\r\n  p->pos -= subValue;\r\n  p->streamPos -= subValue;\r\n}\r\n\r\nstatic void MatchFinder_ReadBlock(CMatchFinder *p)\r\n{\r\n  if (p->streamEndWasReached || p->result != SZ_OK)\r\n    return;\r\n  if (p->directInput)\r\n  {\r\n    UInt32 curSize = 0xFFFFFFFF - p->streamPos;\r\n    if (curSize > p->directInputRem)\r\n      curSize = (UInt32)p->directInputRem;\r\n    p->directInputRem -= curSize;\r\n    p->streamPos += curSize;\r\n    if (p->directInputRem == 0)\r\n      p->streamEndWasReached = 1;\r\n    return;\r\n  }\r\n  for (;;)\r\n  {\r\n    Byte *dest = p->buffer + (p->streamPos - p->pos);\r\n    size_t size = (p->bufferBase + p->blockSize - dest);\r\n    if (size == 0)\r\n      return;\r\n    p->result = p->stream->Read(p->stream, dest, &size);\r\n    if (p->result != SZ_OK)\r\n      return;\r\n    if (size == 0)\r\n    {\r\n      p->streamEndWasReached = 1;\r\n      return;\r\n    }\r\n    p->streamPos += (UInt32)size;\r\n    if (p->streamPos - p->pos > p->keepSizeAfter)\r\n      return;\r\n  }\r\n}\r\n\r\nvoid MatchFinder_MoveBlock(CMatchFinder *p)\r\n{\r\n  memmove(p->bufferBase,\r\n    p->buffer - p->keepSizeBefore,\r\n    (size_t)(p->streamPos - p->pos + p->keepSizeBefore));\r\n  p->buffer = p->bufferBase + p->keepSizeBefore;\r\n}\r\n\r\nint MatchFinder_NeedMove(CMatchFinder *p)\r\n{\r\n  if (p->directInput)\r\n    return 0;\r\n  /* if (p->streamEndWasReached) return 0; */\r\n  return ((size_t)(p->bufferBase + p->blockSize - p->buffer) <= p->keepSizeAfter);\r\n}\r\n\r\nvoid MatchFinder_ReadIfRequired(CMatchFinder *p)\r\n{\r\n  if (p->streamEndWasReached)\r\n    return;\r\n  if (p->keepSizeAfter >= p->streamPos - p->pos)\r\n    MatchFinder_ReadBlock(p);\r\n}\r\n\r\nstatic void MatchFinder_CheckAndMoveAndRead(CMatchFinder *p)\r\n{\r\n  if (MatchFinder_NeedMove(p))\r\n    MatchFinder_MoveBlock(p);\r\n  MatchFinder_ReadBlock(p);\r\n}\r\n\r\nstatic void MatchFinder_SetDefaultSettings(CMatchFinder *p)\r\n{\r\n  p->cutValue = 32;\r\n  p->btMode = 1;\r\n  p->numHashBytes = 4;\r\n  p->bigHash = 0;\r\n}\r\n\r\n#define kCrcPoly 0xEDB88320\r\n\r\nvoid MatchFinder_Construct(CMatchFinder *p)\r\n{\r\n  UInt32 i;\r\n  p->bufferBase = 0;\r\n  p->directInput = 0;\r\n  p->hash = 0;\r\n  MatchFinder_SetDefaultSettings(p);\r\n\r\n  for (i = 0; i < 256; i++)\r\n  {\r\n    UInt32 r = i;\r\n    int j;\r\n    for (j = 0; j < 8; j++)\r\n      r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1));\r\n    p->crc[i] = r;\r\n  }\r\n}\r\n\r\nstatic void MatchFinder_FreeThisClassMemory(CMatchFinder *p, ISzAlloc *alloc)\r\n{\r\n  alloc->Free(alloc, p->hash);\r\n  p->hash = 0;\r\n}\r\n\r\nvoid MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc)\r\n{\r\n  MatchFinder_FreeThisClassMemory(p, alloc);\r\n  LzInWindow_Free(p, alloc);\r\n}\r\n\r\nstatic CLzRef* AllocRefs(UInt32 num, ISzAlloc *alloc)\r\n{\r\n  size_t sizeInBytes = (size_t)num * sizeof(CLzRef);\r\n  if (sizeInBytes / sizeof(CLzRef) != num)\r\n    return 0;\r\n  return (CLzRef *)alloc->Alloc(alloc, sizeInBytes);\r\n}\r\n\r\nint MatchFinder_Create(CMatchFinder *p, UInt32 historySize,\r\n    UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,\r\n    ISzAlloc *alloc)\r\n{\r\n  UInt32 sizeReserv;\r\n  if (historySize > kMaxHistorySize)\r\n  {\r\n    MatchFinder_Free(p, alloc);\r\n    return 0;\r\n  }\r\n  sizeReserv = historySize >> 1;\r\n  if (historySize > ((UInt32)2 << 30))\r\n    sizeReserv = historySize >> 2;\r\n  sizeReserv += (keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / 2 + (1 << 19);\r\n\r\n  p->keepSizeBefore = historySize + keepAddBufferBefore + 1;\r\n  p->keepSizeAfter = matchMaxLen + keepAddBufferAfter;\r\n  /* we need one additional byte, since we use MoveBlock after pos++ and before dictionary using */\r\n  if (LzInWindow_Create(p, sizeReserv, alloc))\r\n  {\r\n    UInt32 newCyclicBufferSize = historySize + 1;\r\n    UInt32 hs;\r\n    p->matchMaxLen = matchMaxLen;\r\n    {\r\n      p->fixedHashSize = 0;\r\n      if (p->numHashBytes == 2)\r\n        hs = (1 << 16) - 1;\r\n      else\r\n      {\r\n        hs = historySize - 1;\r\n        hs |= (hs >> 1);\r\n        hs |= (hs >> 2);\r\n        hs |= (hs >> 4);\r\n        hs |= (hs >> 8);\r\n        hs >>= 1;\r\n        hs |= 0xFFFF; /* don't change it! It's required for Deflate */\r\n        if (hs > (1 << 24))\r\n        {\r\n          if (p->numHashBytes == 3)\r\n            hs = (1 << 24) - 1;\r\n          else\r\n            hs >>= 1;\r\n        }\r\n      }\r\n      p->hashMask = hs;\r\n      hs++;\r\n      if (p->numHashBytes > 2) p->fixedHashSize += kHash2Size;\r\n      if (p->numHashBytes > 3) p->fixedHashSize += kHash3Size;\r\n      if (p->numHashBytes > 4) p->fixedHashSize += kHash4Size;\r\n      hs += p->fixedHashSize;\r\n    }\r\n\r\n    {\r\n      UInt32 prevSize = p->hashSizeSum + p->numSons;\r\n      UInt32 newSize;\r\n      p->historySize = historySize;\r\n      p->hashSizeSum = hs;\r\n      p->cyclicBufferSize = newCyclicBufferSize;\r\n      p->numSons = (p->btMode ? newCyclicBufferSize * 2 : newCyclicBufferSize);\r\n      newSize = p->hashSizeSum + p->numSons;\r\n      if (p->hash != 0 && prevSize == newSize)\r\n        return 1;\r\n      MatchFinder_FreeThisClassMemory(p, alloc);\r\n      p->hash = AllocRefs(newSize, alloc);\r\n      if (p->hash != 0)\r\n      {\r\n        p->son = p->hash + p->hashSizeSum;\r\n        return 1;\r\n      }\r\n    }\r\n  }\r\n  MatchFinder_Free(p, alloc);\r\n  return 0;\r\n}\r\n\r\nstatic void MatchFinder_SetLimits(CMatchFinder *p)\r\n{\r\n  UInt32 limit = kMaxValForNormalize - p->pos;\r\n  UInt32 limit2 = p->cyclicBufferSize - p->cyclicBufferPos;\r\n  if (limit2 < limit)\r\n    limit = limit2;\r\n  limit2 = p->streamPos - p->pos;\r\n  if (limit2 <= p->keepSizeAfter)\r\n  {\r\n    if (limit2 > 0)\r\n      limit2 = 1;\r\n  }\r\n  else\r\n    limit2 -= p->keepSizeAfter;\r\n  if (limit2 < limit)\r\n    limit = limit2;\r\n  {\r\n    UInt32 lenLimit = p->streamPos - p->pos;\r\n    if (lenLimit > p->matchMaxLen)\r\n      lenLimit = p->matchMaxLen;\r\n    p->lenLimit = lenLimit;\r\n  }\r\n  p->posLimit = p->pos + limit;\r\n}\r\n\r\nvoid MatchFinder_Init(CMatchFinder *p)\r\n{\r\n  UInt32 i;\r\n  for (i = 0; i < p->hashSizeSum; i++)\r\n    p->hash[i] = kEmptyHashValue;\r\n  p->cyclicBufferPos = 0;\r\n  p->buffer = p->bufferBase;\r\n  p->pos = p->streamPos = p->cyclicBufferSize;\r\n  p->result = SZ_OK;\r\n  p->streamEndWasReached = 0;\r\n  MatchFinder_ReadBlock(p);\r\n  MatchFinder_SetLimits(p);\r\n}\r\n\r\nstatic UInt32 MatchFinder_GetSubValue(CMatchFinder *p)\r\n{\r\n  return (p->pos - p->historySize - 1) & kNormalizeMask;\r\n}\r\n\r\nvoid MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems)\r\n{\r\n  UInt32 i;\r\n  for (i = 0; i < numItems; i++)\r\n  {\r\n    UInt32 value = items[i];\r\n    if (value <= subValue)\r\n      value = kEmptyHashValue;\r\n    else\r\n      value -= subValue;\r\n    items[i] = value;\r\n  }\r\n}\r\n\r\nstatic void MatchFinder_Normalize(CMatchFinder *p)\r\n{\r\n  UInt32 subValue = MatchFinder_GetSubValue(p);\r\n  MatchFinder_Normalize3(subValue, p->hash, p->hashSizeSum + p->numSons);\r\n  MatchFinder_ReduceOffsets(p, subValue);\r\n}\r\n\r\nstatic void MatchFinder_CheckLimits(CMatchFinder *p)\r\n{\r\n  if (p->pos == kMaxValForNormalize)\r\n    MatchFinder_Normalize(p);\r\n  if (!p->streamEndWasReached && p->keepSizeAfter == p->streamPos - p->pos)\r\n    MatchFinder_CheckAndMoveAndRead(p);\r\n  if (p->cyclicBufferPos == p->cyclicBufferSize)\r\n    p->cyclicBufferPos = 0;\r\n  MatchFinder_SetLimits(p);\r\n}\r\n\r\nstatic UInt32 * Hc_GetMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,\r\n    UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,\r\n    UInt32 *distances, UInt32 maxLen)\r\n{\r\n  son[_cyclicBufferPos] = curMatch;\r\n  for (;;)\r\n  {\r\n    UInt32 delta = pos - curMatch;\r\n    if (cutValue-- == 0 || delta >= _cyclicBufferSize)\r\n      return distances;\r\n    {\r\n      const Byte *pb = cur - delta;\r\n      curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)];\r\n      if (pb[maxLen] == cur[maxLen] && *pb == *cur)\r\n      {\r\n        UInt32 len = 0;\r\n        while (++len != lenLimit)\r\n          if (pb[len] != cur[len])\r\n            break;\r\n        if (maxLen < len)\r\n        {\r\n          *distances++ = maxLen = len;\r\n          *distances++ = delta - 1;\r\n          if (len == lenLimit)\r\n            return distances;\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\nUInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,\r\n    UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,\r\n    UInt32 *distances, UInt32 maxLen)\r\n{\r\n  CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1;\r\n  CLzRef *ptr1 = son + (_cyclicBufferPos << 1);\r\n  UInt32 len0 = 0, len1 = 0;\r\n  for (;;)\r\n  {\r\n    UInt32 delta = pos - curMatch;\r\n    if (cutValue-- == 0 || delta >= _cyclicBufferSize)\r\n    {\r\n      *ptr0 = *ptr1 = kEmptyHashValue;\r\n      return distances;\r\n    }\r\n    {\r\n      CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);\r\n      const Byte *pb = cur - delta;\r\n      UInt32 len = (len0 < len1 ? len0 : len1);\r\n      if (pb[len] == cur[len])\r\n      {\r\n        if (++len != lenLimit && pb[len] == cur[len])\r\n          while (++len != lenLimit)\r\n            if (pb[len] != cur[len])\r\n              break;\r\n        if (maxLen < len)\r\n        {\r\n          *distances++ = maxLen = len;\r\n          *distances++ = delta - 1;\r\n          if (len == lenLimit)\r\n          {\r\n            *ptr1 = pair[0];\r\n            *ptr0 = pair[1];\r\n            return distances;\r\n          }\r\n        }\r\n      }\r\n      if (pb[len] < cur[len])\r\n      {\r\n        *ptr1 = curMatch;\r\n        ptr1 = pair + 1;\r\n        curMatch = *ptr1;\r\n        len1 = len;\r\n      }\r\n      else\r\n      {\r\n        *ptr0 = curMatch;\r\n        ptr0 = pair;\r\n        curMatch = *ptr0;\r\n        len0 = len;\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\nstatic void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,\r\n    UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue)\r\n{\r\n  CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1;\r\n  CLzRef *ptr1 = son + (_cyclicBufferPos << 1);\r\n  UInt32 len0 = 0, len1 = 0;\r\n  for (;;)\r\n  {\r\n    UInt32 delta = pos - curMatch;\r\n    if (cutValue-- == 0 || delta >= _cyclicBufferSize)\r\n    {\r\n      *ptr0 = *ptr1 = kEmptyHashValue;\r\n      return;\r\n    }\r\n    {\r\n      CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);\r\n      const Byte *pb = cur - delta;\r\n      UInt32 len = (len0 < len1 ? len0 : len1);\r\n      if (pb[len] == cur[len])\r\n      {\r\n        while (++len != lenLimit)\r\n          if (pb[len] != cur[len])\r\n            break;\r\n        {\r\n          if (len == lenLimit)\r\n          {\r\n            *ptr1 = pair[0];\r\n            *ptr0 = pair[1];\r\n            return;\r\n          }\r\n        }\r\n      }\r\n      if (pb[len] < cur[len])\r\n      {\r\n        *ptr1 = curMatch;\r\n        ptr1 = pair + 1;\r\n        curMatch = *ptr1;\r\n        len1 = len;\r\n      }\r\n      else\r\n      {\r\n        *ptr0 = curMatch;\r\n        ptr0 = pair;\r\n        curMatch = *ptr0;\r\n        len0 = len;\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\n#define MOVE_POS \\\r\n  ++p->cyclicBufferPos; \\\r\n  p->buffer++; \\\r\n  if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p);\r\n\r\n#define MOVE_POS_RET MOVE_POS return offset;\r\n\r\nstatic void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; }\r\n\r\n#define GET_MATCHES_HEADER2(minLen, ret_op) \\\r\n  UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; \\\r\n  lenLimit = p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \\\r\n  cur = p->buffer;\r\n\r\n#define GET_MATCHES_HEADER(minLen) GET_MATCHES_HEADER2(minLen, return 0)\r\n#define SKIP_HEADER(minLen)        GET_MATCHES_HEADER2(minLen, continue)\r\n\r\n#define MF_PARAMS(p) p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue\r\n\r\n#define GET_MATCHES_FOOTER(offset, maxLen) \\\r\n  offset = (UInt32)(GetMatchesSpec1(lenLimit, curMatch, MF_PARAMS(p), \\\r\n  distances + offset, maxLen) - distances); MOVE_POS_RET;\r\n\r\n#define SKIP_FOOTER \\\r\n  SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS;\r\n\r\nstatic UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)\r\n{\r\n  UInt32 offset;\r\n  GET_MATCHES_HEADER(2)\r\n  HASH2_CALC;\r\n  curMatch = p->hash[hashValue];\r\n  p->hash[hashValue] = p->pos;\r\n  offset = 0;\r\n  GET_MATCHES_FOOTER(offset, 1)\r\n}\r\n\r\nUInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)\r\n{\r\n  UInt32 offset;\r\n  GET_MATCHES_HEADER(3)\r\n  HASH_ZIP_CALC;\r\n  curMatch = p->hash[hashValue];\r\n  p->hash[hashValue] = p->pos;\r\n  offset = 0;\r\n  GET_MATCHES_FOOTER(offset, 2)\r\n}\r\n\r\nstatic UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)\r\n{\r\n  UInt32 hash2Value, delta2, maxLen, offset;\r\n  GET_MATCHES_HEADER(3)\r\n\r\n  HASH3_CALC;\r\n\r\n  delta2 = p->pos - p->hash[hash2Value];\r\n  curMatch = p->hash[kFix3HashSize + hashValue];\r\n  \r\n  p->hash[hash2Value] =\r\n  p->hash[kFix3HashSize + hashValue] = p->pos;\r\n\r\n\r\n  maxLen = 2;\r\n  offset = 0;\r\n  if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur)\r\n  {\r\n    for (; maxLen != lenLimit; maxLen++)\r\n      if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen])\r\n        break;\r\n    distances[0] = maxLen;\r\n    distances[1] = delta2 - 1;\r\n    offset = 2;\r\n    if (maxLen == lenLimit)\r\n    {\r\n      SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p));\r\n      MOVE_POS_RET;\r\n    }\r\n  }\r\n  GET_MATCHES_FOOTER(offset, maxLen)\r\n}\r\n\r\nstatic UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)\r\n{\r\n  UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset;\r\n  GET_MATCHES_HEADER(4)\r\n\r\n  HASH4_CALC;\r\n\r\n  delta2 = p->pos - p->hash[                hash2Value];\r\n  delta3 = p->pos - p->hash[kFix3HashSize + hash3Value];\r\n  curMatch = p->hash[kFix4HashSize + hashValue];\r\n  \r\n  p->hash[                hash2Value] =\r\n  p->hash[kFix3HashSize + hash3Value] =\r\n  p->hash[kFix4HashSize + hashValue] = p->pos;\r\n\r\n  maxLen = 1;\r\n  offset = 0;\r\n  if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur)\r\n  {\r\n    distances[0] = maxLen = 2;\r\n    distances[1] = delta2 - 1;\r\n    offset = 2;\r\n  }\r\n  if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur)\r\n  {\r\n    maxLen = 3;\r\n    distances[offset + 1] = delta3 - 1;\r\n    offset += 2;\r\n    delta2 = delta3;\r\n  }\r\n  if (offset != 0)\r\n  {\r\n    for (; maxLen != lenLimit; maxLen++)\r\n      if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen])\r\n        break;\r\n    distances[offset - 2] = maxLen;\r\n    if (maxLen == lenLimit)\r\n    {\r\n      SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p));\r\n      MOVE_POS_RET;\r\n    }\r\n  }\r\n  if (maxLen < 3)\r\n    maxLen = 3;\r\n  GET_MATCHES_FOOTER(offset, maxLen)\r\n}\r\n\r\nstatic UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)\r\n{\r\n  UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset;\r\n  GET_MATCHES_HEADER(4)\r\n\r\n  HASH4_CALC;\r\n\r\n  delta2 = p->pos - p->hash[                hash2Value];\r\n  delta3 = p->pos - p->hash[kFix3HashSize + hash3Value];\r\n  curMatch = p->hash[kFix4HashSize + hashValue];\r\n\r\n  p->hash[                hash2Value] =\r\n  p->hash[kFix3HashSize + hash3Value] =\r\n  p->hash[kFix4HashSize + hashValue] = p->pos;\r\n\r\n  maxLen = 1;\r\n  offset = 0;\r\n  if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur)\r\n  {\r\n    distances[0] = maxLen = 2;\r\n    distances[1] = delta2 - 1;\r\n    offset = 2;\r\n  }\r\n  if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur)\r\n  {\r\n    maxLen = 3;\r\n    distances[offset + 1] = delta3 - 1;\r\n    offset += 2;\r\n    delta2 = delta3;\r\n  }\r\n  if (offset != 0)\r\n  {\r\n    for (; maxLen != lenLimit; maxLen++)\r\n      if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen])\r\n        break;\r\n    distances[offset - 2] = maxLen;\r\n    if (maxLen == lenLimit)\r\n    {\r\n      p->son[p->cyclicBufferPos] = curMatch;\r\n      MOVE_POS_RET;\r\n    }\r\n  }\r\n  if (maxLen < 3)\r\n    maxLen = 3;\r\n  offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p),\r\n    distances + offset, maxLen) - (distances));\r\n  MOVE_POS_RET\r\n}\r\n\r\nUInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)\r\n{\r\n  UInt32 offset;\r\n  GET_MATCHES_HEADER(3)\r\n  HASH_ZIP_CALC;\r\n  curMatch = p->hash[hashValue];\r\n  p->hash[hashValue] = p->pos;\r\n  offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p),\r\n    distances, 2) - (distances));\r\n  MOVE_POS_RET\r\n}\r\n\r\nstatic void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num)\r\n{\r\n  do\r\n  {\r\n    SKIP_HEADER(2)\r\n    HASH2_CALC;\r\n    curMatch = p->hash[hashValue];\r\n    p->hash[hashValue] = p->pos;\r\n    SKIP_FOOTER\r\n  }\r\n  while (--num != 0);\r\n}\r\n\r\nvoid Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)\r\n{\r\n  do\r\n  {\r\n    SKIP_HEADER(3)\r\n    HASH_ZIP_CALC;\r\n    curMatch = p->hash[hashValue];\r\n    p->hash[hashValue] = p->pos;\r\n    SKIP_FOOTER\r\n  }\r\n  while (--num != 0);\r\n}\r\n\r\nstatic void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num)\r\n{\r\n  do\r\n  {\r\n    UInt32 hash2Value;\r\n    SKIP_HEADER(3)\r\n    HASH3_CALC;\r\n    curMatch = p->hash[kFix3HashSize + hashValue];\r\n    p->hash[hash2Value] =\r\n    p->hash[kFix3HashSize + hashValue] = p->pos;\r\n    SKIP_FOOTER\r\n  }\r\n  while (--num != 0);\r\n}\r\n\r\nstatic void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)\r\n{\r\n  do\r\n  {\r\n    UInt32 hash2Value, hash3Value;\r\n    SKIP_HEADER(4)\r\n    HASH4_CALC;\r\n    curMatch = p->hash[kFix4HashSize + hashValue];\r\n    p->hash[                hash2Value] =\r\n    p->hash[kFix3HashSize + hash3Value] = p->pos;\r\n    p->hash[kFix4HashSize + hashValue] = p->pos;\r\n    SKIP_FOOTER\r\n  }\r\n  while (--num != 0);\r\n}\r\n\r\nstatic void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)\r\n{\r\n  do\r\n  {\r\n    UInt32 hash2Value, hash3Value;\r\n    SKIP_HEADER(4)\r\n    HASH4_CALC;\r\n    curMatch = p->hash[kFix4HashSize + hashValue];\r\n    p->hash[                hash2Value] =\r\n    p->hash[kFix3HashSize + hash3Value] =\r\n    p->hash[kFix4HashSize + hashValue] = p->pos;\r\n    p->son[p->cyclicBufferPos] = curMatch;\r\n    MOVE_POS\r\n  }\r\n  while (--num != 0);\r\n}\r\n\r\nvoid Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)\r\n{\r\n  do\r\n  {\r\n    SKIP_HEADER(3)\r\n    HASH_ZIP_CALC;\r\n    curMatch = p->hash[hashValue];\r\n    p->hash[hashValue] = p->pos;\r\n    p->son[p->cyclicBufferPos] = curMatch;\r\n    MOVE_POS\r\n  }\r\n  while (--num != 0);\r\n}\r\n\r\nvoid MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable)\r\n{\r\n  vTable->Init = (Mf_Init_Func)MatchFinder_Init;\r\n  vTable->GetIndexByte = (Mf_GetIndexByte_Func)MatchFinder_GetIndexByte;\r\n  vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinder_GetNumAvailableBytes;\r\n  vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinder_GetPointerToCurrentPos;\r\n  if (!p->btMode)\r\n  {\r\n    vTable->GetMatches = (Mf_GetMatches_Func)Hc4_MatchFinder_GetMatches;\r\n    vTable->Skip = (Mf_Skip_Func)Hc4_MatchFinder_Skip;\r\n  }\r\n  else if (p->numHashBytes == 2)\r\n  {\r\n    vTable->GetMatches = (Mf_GetMatches_Func)Bt2_MatchFinder_GetMatches;\r\n    vTable->Skip = (Mf_Skip_Func)Bt2_MatchFinder_Skip;\r\n  }\r\n  else if (p->numHashBytes == 3)\r\n  {\r\n    vTable->GetMatches = (Mf_GetMatches_Func)Bt3_MatchFinder_GetMatches;\r\n    vTable->Skip = (Mf_Skip_Func)Bt3_MatchFinder_Skip;\r\n  }\r\n  else\r\n  {\r\n    vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches;\r\n    vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip;\r\n  }\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/LzFind.h",
    "content": "/* LzFind.h -- Match finder for LZ algorithms\r\n2009-04-22 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __LZ_FIND_H\r\n#define __LZ_FIND_H\r\n\r\n#include \"Types.h\"\r\n\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n#endif\r\n\r\ntypedef UInt32 CLzRef;\r\n\r\ntypedef struct _CMatchFinder\r\n{\r\n  Byte *buffer;\r\n  UInt32 pos;\r\n  UInt32 posLimit;\r\n  UInt32 streamPos;\r\n  UInt32 lenLimit;\r\n\r\n  UInt32 cyclicBufferPos;\r\n  UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */\r\n\r\n  UInt32 matchMaxLen;\r\n  CLzRef *hash;\r\n  CLzRef *son;\r\n  UInt32 hashMask;\r\n  UInt32 cutValue;\r\n\r\n  Byte *bufferBase;\r\n  ISeqInStream *stream;\r\n  int streamEndWasReached;\r\n\r\n  UInt32 blockSize;\r\n  UInt32 keepSizeBefore;\r\n  UInt32 keepSizeAfter;\r\n\r\n  UInt32 numHashBytes;\r\n  int directInput;\r\n  size_t directInputRem;\r\n  int btMode;\r\n  int bigHash;\r\n  UInt32 historySize;\r\n  UInt32 fixedHashSize;\r\n  UInt32 hashSizeSum;\r\n  UInt32 numSons;\r\n  SRes result;\r\n  UInt32 crc[256];\r\n} CMatchFinder;\r\n\r\n#define Inline_MatchFinder_GetPointerToCurrentPos(p) ((p)->buffer)\r\n#define Inline_MatchFinder_GetIndexByte(p, index) ((p)->buffer[(Int32)(index)])\r\n\r\n#define Inline_MatchFinder_GetNumAvailableBytes(p) ((p)->streamPos - (p)->pos)\r\n\r\nint MatchFinder_NeedMove(CMatchFinder *p);\r\nByte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p);\r\nvoid MatchFinder_MoveBlock(CMatchFinder *p);\r\nvoid MatchFinder_ReadIfRequired(CMatchFinder *p);\r\n\r\nvoid MatchFinder_Construct(CMatchFinder *p);\r\n\r\n/* Conditions:\r\n     historySize <= 3 GB\r\n     keepAddBufferBefore + matchMaxLen + keepAddBufferAfter < 511MB\r\n*/\r\nint MatchFinder_Create(CMatchFinder *p, UInt32 historySize,\r\n    UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,\r\n    ISzAlloc *alloc);\r\nvoid MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc);\r\nvoid MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems);\r\nvoid MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue);\r\n\r\nUInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son,\r\n    UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue,\r\n    UInt32 *distances, UInt32 maxLen);\r\n\r\n/*\r\nConditions:\r\n  Mf_GetNumAvailableBytes_Func must be called before each Mf_GetMatchLen_Func.\r\n  Mf_GetPointerToCurrentPos_Func's result must be used only before any other function\r\n*/\r\n\r\ntypedef void (*Mf_Init_Func)(void *object);\r\ntypedef Byte (*Mf_GetIndexByte_Func)(void *object, Int32 index);\r\ntypedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object);\r\ntypedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object);\r\ntypedef UInt32 (*Mf_GetMatches_Func)(void *object, UInt32 *distances);\r\ntypedef void (*Mf_Skip_Func)(void *object, UInt32);\r\n\r\ntypedef struct _IMatchFinder\r\n{\r\n  Mf_Init_Func Init;\r\n  Mf_GetIndexByte_Func GetIndexByte;\r\n  Mf_GetNumAvailableBytes_Func GetNumAvailableBytes;\r\n  Mf_GetPointerToCurrentPos_Func GetPointerToCurrentPos;\r\n  Mf_GetMatches_Func GetMatches;\r\n  Mf_Skip_Func Skip;\r\n} IMatchFinder;\r\n\r\nvoid MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable);\r\n\r\nvoid MatchFinder_Init(CMatchFinder *p);\r\nUInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);\r\nUInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);\r\nvoid Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);\r\nvoid Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);\r\n\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/LzFindMt.c",
    "content": "/* LzFindMt.c -- multithreaded Match finder for LZ algorithms\r\n2009-09-20 : Igor Pavlov : Public domain */\r\n\r\n#include \"LzHash.h\"\r\n\r\n#include \"LzFindMt.h\"\r\n\r\nvoid MtSync_Construct(CMtSync *p)\r\n{\r\n  p->wasCreated = False;\r\n  p->csWasInitialized = False;\r\n  p->csWasEntered = False;\r\n  Thread_Construct(&p->thread);\r\n  Event_Construct(&p->canStart);\r\n  Event_Construct(&p->wasStarted);\r\n  Event_Construct(&p->wasStopped);\r\n  Semaphore_Construct(&p->freeSemaphore);\r\n  Semaphore_Construct(&p->filledSemaphore);\r\n}\r\n\r\nvoid MtSync_GetNextBlock(CMtSync *p)\r\n{\r\n  if (p->needStart)\r\n  {\r\n    p->numProcessedBlocks = 1;\r\n    p->needStart = False;\r\n    p->stopWriting = False;\r\n    p->exit = False;\r\n    Event_Reset(&p->wasStarted);\r\n    Event_Reset(&p->wasStopped);\r\n\r\n    Event_Set(&p->canStart);\r\n    Event_Wait(&p->wasStarted);\r\n  }\r\n  else\r\n  {\r\n    CriticalSection_Leave(&p->cs);\r\n    p->csWasEntered = False;\r\n    p->numProcessedBlocks++;\r\n    Semaphore_Release1(&p->freeSemaphore);\r\n  }\r\n  Semaphore_Wait(&p->filledSemaphore);\r\n  CriticalSection_Enter(&p->cs);\r\n  p->csWasEntered = True;\r\n}\r\n\r\n/* MtSync_StopWriting must be called if Writing was started */\r\n\r\nvoid MtSync_StopWriting(CMtSync *p)\r\n{\r\n  UInt32 myNumBlocks = p->numProcessedBlocks;\r\n  if (!Thread_WasCreated(&p->thread) || p->needStart)\r\n    return;\r\n  p->stopWriting = True;\r\n  if (p->csWasEntered)\r\n  {\r\n    CriticalSection_Leave(&p->cs);\r\n    p->csWasEntered = False;\r\n  }\r\n  Semaphore_Release1(&p->freeSemaphore);\r\n \r\n  Event_Wait(&p->wasStopped);\r\n\r\n  while (myNumBlocks++ != p->numProcessedBlocks)\r\n  {\r\n    Semaphore_Wait(&p->filledSemaphore);\r\n    Semaphore_Release1(&p->freeSemaphore);\r\n  }\r\n  p->needStart = True;\r\n}\r\n\r\nvoid MtSync_Destruct(CMtSync *p)\r\n{\r\n  if (Thread_WasCreated(&p->thread))\r\n  {\r\n    MtSync_StopWriting(p);\r\n    p->exit = True;\r\n    if (p->needStart)\r\n      Event_Set(&p->canStart);\r\n    Thread_Wait(&p->thread);\r\n    Thread_Close(&p->thread);\r\n  }\r\n  if (p->csWasInitialized)\r\n  {\r\n    CriticalSection_Delete(&p->cs);\r\n    p->csWasInitialized = False;\r\n  }\r\n\r\n  Event_Close(&p->canStart);\r\n  Event_Close(&p->wasStarted);\r\n  Event_Close(&p->wasStopped);\r\n  Semaphore_Close(&p->freeSemaphore);\r\n  Semaphore_Close(&p->filledSemaphore);\r\n\r\n  p->wasCreated = False;\r\n}\r\n\r\n#define RINOK_THREAD(x) { if ((x) != 0) return SZ_ERROR_THREAD; }\r\n\r\nstatic SRes MtSync_Create2(CMtSync *p, unsigned (MY_STD_CALL *startAddress)(void *), void *obj, UInt32 numBlocks)\r\n{\r\n  if (p->wasCreated)\r\n    return SZ_OK;\r\n\r\n  RINOK_THREAD(CriticalSection_Init(&p->cs));\r\n  p->csWasInitialized = True;\r\n\r\n  RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->canStart));\r\n  RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->wasStarted));\r\n  RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->wasStopped));\r\n  \r\n  RINOK_THREAD(Semaphore_Create(&p->freeSemaphore, numBlocks, numBlocks));\r\n  RINOK_THREAD(Semaphore_Create(&p->filledSemaphore, 0, numBlocks));\r\n\r\n  p->needStart = True;\r\n  \r\n  RINOK_THREAD(Thread_Create(&p->thread, startAddress, obj));\r\n  p->wasCreated = True;\r\n  return SZ_OK;\r\n}\r\n\r\nstatic SRes MtSync_Create(CMtSync *p, unsigned (MY_STD_CALL *startAddress)(void *), void *obj, UInt32 numBlocks)\r\n{\r\n  SRes res = MtSync_Create2(p, startAddress, obj, numBlocks);\r\n  if (res != SZ_OK)\r\n    MtSync_Destruct(p);\r\n  return res;\r\n}\r\n\r\nvoid MtSync_Init(CMtSync *p) { p->needStart = True; }\r\n\r\n#define kMtMaxValForNormalize 0xFFFFFFFF\r\n\r\n#define DEF_GetHeads2(name, v, action) \\\r\nstatic void GetHeads ## name(const Byte *p, UInt32 pos, \\\r\nUInt32 *hash, UInt32 hashMask, UInt32 *heads, UInt32 numHeads, const UInt32 *crc) \\\r\n{ action; for (; numHeads != 0; numHeads--) { \\\r\nconst UInt32 value = (v); p++; *heads++ = pos - hash[value]; hash[value] = pos++;  } }\r\n\r\n#define DEF_GetHeads(name, v) DEF_GetHeads2(name, v, ;)\r\n\r\nDEF_GetHeads2(2,  (p[0] | ((UInt32)p[1] << 8)), hashMask = hashMask; crc = crc; )\r\nDEF_GetHeads(3,  (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8)) & hashMask)\r\nDEF_GetHeads(4,  (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ (crc[p[3]] << 5)) & hashMask)\r\nDEF_GetHeads(4b, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ ((UInt32)p[3] << 16)) & hashMask)\r\n/* DEF_GetHeads(5,  (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ (crc[p[3]] << 5) ^ (crc[p[4]] << 3)) & hashMask) */\r\n\r\nvoid HashThreadFunc(CMatchFinderMt *mt)\r\n{\r\n  CMtSync *p = &mt->hashSync;\r\n  for (;;)\r\n  {\r\n    UInt32 numProcessedBlocks = 0;\r\n    Event_Wait(&p->canStart);\r\n    Event_Set(&p->wasStarted);\r\n    for (;;)\r\n    {\r\n      if (p->exit)\r\n        return;\r\n      if (p->stopWriting)\r\n      {\r\n        p->numProcessedBlocks = numProcessedBlocks;\r\n        Event_Set(&p->wasStopped);\r\n        break;\r\n      }\r\n\r\n      {\r\n        CMatchFinder *mf = mt->MatchFinder;\r\n        if (MatchFinder_NeedMove(mf))\r\n        {\r\n          CriticalSection_Enter(&mt->btSync.cs);\r\n          CriticalSection_Enter(&mt->hashSync.cs);\r\n          {\r\n            const Byte *beforePtr = MatchFinder_GetPointerToCurrentPos(mf);\r\n            const Byte *afterPtr;\r\n            MatchFinder_MoveBlock(mf);\r\n            afterPtr = MatchFinder_GetPointerToCurrentPos(mf);\r\n            mt->pointerToCurPos -= beforePtr - afterPtr;\r\n            mt->buffer -= beforePtr - afterPtr;\r\n          }\r\n          CriticalSection_Leave(&mt->btSync.cs);\r\n          CriticalSection_Leave(&mt->hashSync.cs);\r\n          continue;\r\n        }\r\n\r\n        Semaphore_Wait(&p->freeSemaphore);\r\n\r\n        MatchFinder_ReadIfRequired(mf);\r\n        if (mf->pos > (kMtMaxValForNormalize - kMtHashBlockSize))\r\n        {\r\n          UInt32 subValue = (mf->pos - mf->historySize - 1);\r\n          MatchFinder_ReduceOffsets(mf, subValue);\r\n          MatchFinder_Normalize3(subValue, mf->hash + mf->fixedHashSize, mf->hashMask + 1);\r\n        }\r\n        {\r\n          UInt32 *heads = mt->hashBuf + ((numProcessedBlocks++) & kMtHashNumBlocksMask) * kMtHashBlockSize;\r\n          UInt32 num = mf->streamPos - mf->pos;\r\n          heads[0] = 2;\r\n          heads[1] = num;\r\n          if (num >= mf->numHashBytes)\r\n          {\r\n            num = num - mf->numHashBytes + 1;\r\n            if (num > kMtHashBlockSize - 2)\r\n              num = kMtHashBlockSize - 2;\r\n            mt->GetHeadsFunc(mf->buffer, mf->pos, mf->hash + mf->fixedHashSize, mf->hashMask, heads + 2, num, mf->crc);\r\n            heads[0] += num;\r\n          }\r\n          mf->pos += num;\r\n          mf->buffer += num;\r\n        }\r\n      }\r\n\r\n      Semaphore_Release1(&p->filledSemaphore);\r\n    }\r\n  }\r\n}\r\n\r\nvoid MatchFinderMt_GetNextBlock_Hash(CMatchFinderMt *p)\r\n{\r\n  MtSync_GetNextBlock(&p->hashSync);\r\n  p->hashBufPosLimit = p->hashBufPos = ((p->hashSync.numProcessedBlocks - 1) & kMtHashNumBlocksMask) * kMtHashBlockSize;\r\n  p->hashBufPosLimit += p->hashBuf[p->hashBufPos++];\r\n  p->hashNumAvail = p->hashBuf[p->hashBufPos++];\r\n}\r\n\r\n#define kEmptyHashValue 0\r\n\r\n/* #define MFMT_GM_INLINE */\r\n\r\n#ifdef MFMT_GM_INLINE\r\n\r\n#define NO_INLINE MY_FAST_CALL\r\n\r\nInt32 NO_INLINE GetMatchesSpecN(UInt32 lenLimit, UInt32 pos, const Byte *cur, CLzRef *son,\r\n    UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue,\r\n    UInt32 *_distances, UInt32 _maxLen, const UInt32 *hash, Int32 limit, UInt32 size, UInt32 *posRes)\r\n{\r\n  do\r\n  {\r\n  UInt32 *distances = _distances + 1;\r\n  UInt32 curMatch = pos - *hash++;\r\n\r\n  CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1;\r\n  CLzRef *ptr1 = son + (_cyclicBufferPos << 1);\r\n  UInt32 len0 = 0, len1 = 0;\r\n  UInt32 cutValue = _cutValue;\r\n  UInt32 maxLen = _maxLen;\r\n  for (;;)\r\n  {\r\n    UInt32 delta = pos - curMatch;\r\n    if (cutValue-- == 0 || delta >= _cyclicBufferSize)\r\n    {\r\n      *ptr0 = *ptr1 = kEmptyHashValue;\r\n      break;\r\n    }\r\n    {\r\n      CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);\r\n      const Byte *pb = cur - delta;\r\n      UInt32 len = (len0 < len1 ? len0 : len1);\r\n      if (pb[len] == cur[len])\r\n      {\r\n        if (++len != lenLimit && pb[len] == cur[len])\r\n          while (++len != lenLimit)\r\n            if (pb[len] != cur[len])\r\n              break;\r\n        if (maxLen < len)\r\n        {\r\n          *distances++ = maxLen = len;\r\n          *distances++ = delta - 1;\r\n          if (len == lenLimit)\r\n          {\r\n            *ptr1 = pair[0];\r\n            *ptr0 = pair[1];\r\n            break;\r\n          }\r\n        }\r\n      }\r\n      if (pb[len] < cur[len])\r\n      {\r\n        *ptr1 = curMatch;\r\n        ptr1 = pair + 1;\r\n        curMatch = *ptr1;\r\n        len1 = len;\r\n      }\r\n      else\r\n      {\r\n        *ptr0 = curMatch;\r\n        ptr0 = pair;\r\n        curMatch = *ptr0;\r\n        len0 = len;\r\n      }\r\n    }\r\n  }\r\n  pos++;\r\n  _cyclicBufferPos++;\r\n  cur++;\r\n  {\r\n    UInt32 num = (UInt32)(distances - _distances);\r\n    *_distances = num - 1;\r\n    _distances += num;\r\n    limit -= num;\r\n  }\r\n  }\r\n  while (limit > 0 && --size != 0);\r\n  *posRes = pos;\r\n  return limit;\r\n}\r\n\r\n#endif\r\n\r\nvoid BtGetMatches(CMatchFinderMt *p, UInt32 *distances)\r\n{\r\n  UInt32 numProcessed = 0;\r\n  UInt32 curPos = 2;\r\n  UInt32 limit = kMtBtBlockSize - (p->matchMaxLen * 2);\r\n  distances[1] = p->hashNumAvail;\r\n  while (curPos < limit)\r\n  {\r\n    if (p->hashBufPos == p->hashBufPosLimit)\r\n    {\r\n      MatchFinderMt_GetNextBlock_Hash(p);\r\n      distances[1] = numProcessed + p->hashNumAvail;\r\n      if (p->hashNumAvail >= p->numHashBytes)\r\n        continue;\r\n      for (; p->hashNumAvail != 0; p->hashNumAvail--)\r\n        distances[curPos++] = 0;\r\n      break;\r\n    }\r\n    {\r\n      UInt32 size = p->hashBufPosLimit - p->hashBufPos;\r\n      UInt32 lenLimit = p->matchMaxLen;\r\n      UInt32 pos = p->pos;\r\n      UInt32 cyclicBufferPos = p->cyclicBufferPos;\r\n      if (lenLimit >= p->hashNumAvail)\r\n        lenLimit = p->hashNumAvail;\r\n      {\r\n        UInt32 size2 = p->hashNumAvail - lenLimit + 1;\r\n        if (size2 < size)\r\n          size = size2;\r\n        size2 = p->cyclicBufferSize - cyclicBufferPos;\r\n        if (size2 < size)\r\n          size = size2;\r\n      }\r\n      #ifndef MFMT_GM_INLINE\r\n      while (curPos < limit && size-- != 0)\r\n      {\r\n        UInt32 *startDistances = distances + curPos;\r\n        UInt32 num = (UInt32)(GetMatchesSpec1(lenLimit, pos - p->hashBuf[p->hashBufPos++],\r\n          pos, p->buffer, p->son, cyclicBufferPos, p->cyclicBufferSize, p->cutValue,\r\n          startDistances + 1, p->numHashBytes - 1) - startDistances);\r\n        *startDistances = num - 1;\r\n        curPos += num;\r\n        cyclicBufferPos++;\r\n        pos++;\r\n        p->buffer++;\r\n      }\r\n      #else\r\n      {\r\n        UInt32 posRes;\r\n        curPos = limit - GetMatchesSpecN(lenLimit, pos, p->buffer, p->son, cyclicBufferPos, p->cyclicBufferSize, p->cutValue,\r\n          distances + curPos, p->numHashBytes - 1, p->hashBuf + p->hashBufPos, (Int32)(limit - curPos) , size, &posRes);\r\n        p->hashBufPos += posRes - pos;\r\n        cyclicBufferPos += posRes - pos;\r\n        p->buffer += posRes - pos;\r\n        pos = posRes;\r\n      }\r\n      #endif\r\n\r\n      numProcessed += pos - p->pos;\r\n      p->hashNumAvail -= pos - p->pos;\r\n      p->pos = pos;\r\n      if (cyclicBufferPos == p->cyclicBufferSize)\r\n        cyclicBufferPos = 0;\r\n      p->cyclicBufferPos = cyclicBufferPos;\r\n    }\r\n  }\r\n  distances[0] = curPos;\r\n}\r\n\r\nvoid BtFillBlock(CMatchFinderMt *p, UInt32 globalBlockIndex)\r\n{\r\n  CMtSync *sync = &p->hashSync;\r\n  if (!sync->needStart)\r\n  {\r\n    CriticalSection_Enter(&sync->cs);\r\n    sync->csWasEntered = True;\r\n  }\r\n  \r\n  BtGetMatches(p, p->btBuf + (globalBlockIndex & kMtBtNumBlocksMask) * kMtBtBlockSize);\r\n\r\n  if (p->pos > kMtMaxValForNormalize - kMtBtBlockSize)\r\n  {\r\n    UInt32 subValue = p->pos - p->cyclicBufferSize;\r\n    MatchFinder_Normalize3(subValue, p->son, p->cyclicBufferSize * 2);\r\n    p->pos -= subValue;\r\n  }\r\n\r\n  if (!sync->needStart)\r\n  {\r\n    CriticalSection_Leave(&sync->cs);\r\n    sync->csWasEntered = False;\r\n  }\r\n}\r\n\r\nvoid BtThreadFunc(CMatchFinderMt *mt)\r\n{\r\n  CMtSync *p = &mt->btSync;\r\n  for (;;)\r\n  {\r\n    UInt32 blockIndex = 0;\r\n    Event_Wait(&p->canStart);\r\n    Event_Set(&p->wasStarted);\r\n    for (;;)\r\n    {\r\n      if (p->exit)\r\n        return;\r\n      if (p->stopWriting)\r\n      {\r\n        p->numProcessedBlocks = blockIndex;\r\n        MtSync_StopWriting(&mt->hashSync);\r\n        Event_Set(&p->wasStopped);\r\n        break;\r\n      }\r\n      Semaphore_Wait(&p->freeSemaphore);\r\n      BtFillBlock(mt, blockIndex++);\r\n      Semaphore_Release1(&p->filledSemaphore);\r\n    }\r\n  }\r\n}\r\n\r\nvoid MatchFinderMt_Construct(CMatchFinderMt *p)\r\n{\r\n  p->hashBuf = 0;\r\n  MtSync_Construct(&p->hashSync);\r\n  MtSync_Construct(&p->btSync);\r\n}\r\n\r\nvoid MatchFinderMt_FreeMem(CMatchFinderMt *p, ISzAlloc *alloc)\r\n{\r\n  alloc->Free(alloc, p->hashBuf);\r\n  p->hashBuf = 0;\r\n}\r\n\r\nvoid MatchFinderMt_Destruct(CMatchFinderMt *p, ISzAlloc *alloc)\r\n{\r\n  MtSync_Destruct(&p->hashSync);\r\n  MtSync_Destruct(&p->btSync);\r\n  MatchFinderMt_FreeMem(p, alloc);\r\n}\r\n\r\n#define kHashBufferSize (kMtHashBlockSize * kMtHashNumBlocks)\r\n#define kBtBufferSize (kMtBtBlockSize * kMtBtNumBlocks)\r\n\r\nstatic unsigned MY_STD_CALL HashThreadFunc2(void *p) { HashThreadFunc((CMatchFinderMt *)p);  return 0; }\r\nstatic unsigned MY_STD_CALL BtThreadFunc2(void *p)\r\n{\r\n  Byte allocaDummy[0x180];\r\n  int i = 0;\r\n  for (i = 0; i < 16; i++)\r\n    allocaDummy[i] = (Byte)i;\r\n  BtThreadFunc((CMatchFinderMt *)p);\r\n  return 0;\r\n}\r\n\r\nSRes MatchFinderMt_Create(CMatchFinderMt *p, UInt32 historySize, UInt32 keepAddBufferBefore,\r\n    UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ISzAlloc *alloc)\r\n{\r\n  CMatchFinder *mf = p->MatchFinder;\r\n  p->historySize = historySize;\r\n  if (kMtBtBlockSize <= matchMaxLen * 4)\r\n    return SZ_ERROR_PARAM;\r\n  if (p->hashBuf == 0)\r\n  {\r\n    p->hashBuf = (UInt32 *)alloc->Alloc(alloc, (kHashBufferSize + kBtBufferSize) * sizeof(UInt32));\r\n    if (p->hashBuf == 0)\r\n      return SZ_ERROR_MEM;\r\n    p->btBuf = p->hashBuf + kHashBufferSize;\r\n  }\r\n  keepAddBufferBefore += (kHashBufferSize + kBtBufferSize);\r\n  keepAddBufferAfter += kMtHashBlockSize;\r\n  if (!MatchFinder_Create(mf, historySize, keepAddBufferBefore, matchMaxLen, keepAddBufferAfter, alloc))\r\n    return SZ_ERROR_MEM;\r\n\r\n  RINOK(MtSync_Create(&p->hashSync, HashThreadFunc2, p, kMtHashNumBlocks));\r\n  RINOK(MtSync_Create(&p->btSync, BtThreadFunc2, p, kMtBtNumBlocks));\r\n  return SZ_OK;\r\n}\r\n\r\n/* Call it after ReleaseStream / SetStream */\r\nvoid MatchFinderMt_Init(CMatchFinderMt *p)\r\n{\r\n  CMatchFinder *mf = p->MatchFinder;\r\n  p->btBufPos = p->btBufPosLimit = 0;\r\n  p->hashBufPos = p->hashBufPosLimit = 0;\r\n  MatchFinder_Init(mf);\r\n  p->pointerToCurPos = MatchFinder_GetPointerToCurrentPos(mf);\r\n  p->btNumAvailBytes = 0;\r\n  p->lzPos = p->historySize + 1;\r\n\r\n  p->hash = mf->hash;\r\n  p->fixedHashSize = mf->fixedHashSize;\r\n  p->crc = mf->crc;\r\n\r\n  p->son = mf->son;\r\n  p->matchMaxLen = mf->matchMaxLen;\r\n  p->numHashBytes = mf->numHashBytes;\r\n  p->pos = mf->pos;\r\n  p->buffer = mf->buffer;\r\n  p->cyclicBufferPos = mf->cyclicBufferPos;\r\n  p->cyclicBufferSize = mf->cyclicBufferSize;\r\n  p->cutValue = mf->cutValue;\r\n}\r\n\r\n/* ReleaseStream is required to finish multithreading */\r\nvoid MatchFinderMt_ReleaseStream(CMatchFinderMt *p)\r\n{\r\n  MtSync_StopWriting(&p->btSync);\r\n  /* p->MatchFinder->ReleaseStream(); */\r\n}\r\n\r\nvoid MatchFinderMt_Normalize(CMatchFinderMt *p)\r\n{\r\n  MatchFinder_Normalize3(p->lzPos - p->historySize - 1, p->hash, p->fixedHashSize);\r\n  p->lzPos = p->historySize + 1;\r\n}\r\n\r\nvoid MatchFinderMt_GetNextBlock_Bt(CMatchFinderMt *p)\r\n{\r\n  UInt32 blockIndex;\r\n  MtSync_GetNextBlock(&p->btSync);\r\n  blockIndex = ((p->btSync.numProcessedBlocks - 1) & kMtBtNumBlocksMask);\r\n  p->btBufPosLimit = p->btBufPos = blockIndex * kMtBtBlockSize;\r\n  p->btBufPosLimit += p->btBuf[p->btBufPos++];\r\n  p->btNumAvailBytes = p->btBuf[p->btBufPos++];\r\n  if (p->lzPos >= kMtMaxValForNormalize - kMtBtBlockSize)\r\n    MatchFinderMt_Normalize(p);\r\n}\r\n\r\nconst Byte * MatchFinderMt_GetPointerToCurrentPos(CMatchFinderMt *p)\r\n{\r\n  return p->pointerToCurPos;\r\n}\r\n\r\n#define GET_NEXT_BLOCK_IF_REQUIRED if (p->btBufPos == p->btBufPosLimit) MatchFinderMt_GetNextBlock_Bt(p);\r\n\r\nUInt32 MatchFinderMt_GetNumAvailableBytes(CMatchFinderMt *p)\r\n{\r\n  GET_NEXT_BLOCK_IF_REQUIRED;\r\n  return p->btNumAvailBytes;\r\n}\r\n\r\nByte MatchFinderMt_GetIndexByte(CMatchFinderMt *p, Int32 index)\r\n{\r\n  return p->pointerToCurPos[index];\r\n}\r\n\r\nUInt32 * MixMatches2(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances)\r\n{\r\n  UInt32 hash2Value, curMatch2;\r\n  UInt32 *hash = p->hash;\r\n  const Byte *cur = p->pointerToCurPos;\r\n  UInt32 lzPos = p->lzPos;\r\n  MT_HASH2_CALC\r\n      \r\n  curMatch2 = hash[hash2Value];\r\n  hash[hash2Value] = lzPos;\r\n\r\n  if (curMatch2 >= matchMinPos)\r\n    if (cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0])\r\n    {\r\n      *distances++ = 2;\r\n      *distances++ = lzPos - curMatch2 - 1;\r\n    }\r\n  return distances;\r\n}\r\n\r\nUInt32 * MixMatches3(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances)\r\n{\r\n  UInt32 hash2Value, hash3Value, curMatch2, curMatch3;\r\n  UInt32 *hash = p->hash;\r\n  const Byte *cur = p->pointerToCurPos;\r\n  UInt32 lzPos = p->lzPos;\r\n  MT_HASH3_CALC\r\n\r\n  curMatch2 = hash[                hash2Value];\r\n  curMatch3 = hash[kFix3HashSize + hash3Value];\r\n  \r\n  hash[                hash2Value] =\r\n  hash[kFix3HashSize + hash3Value] =\r\n    lzPos;\r\n\r\n  if (curMatch2 >= matchMinPos && cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0])\r\n  {\r\n    distances[1] = lzPos - curMatch2 - 1;\r\n    if (cur[(ptrdiff_t)curMatch2 - lzPos + 2] == cur[2])\r\n    {\r\n      distances[0] = 3;\r\n      return distances + 2;\r\n    }\r\n    distances[0] = 2;\r\n    distances += 2;\r\n  }\r\n  if (curMatch3 >= matchMinPos && cur[(ptrdiff_t)curMatch3 - lzPos] == cur[0])\r\n  {\r\n    *distances++ = 3;\r\n    *distances++ = lzPos - curMatch3 - 1;\r\n  }\r\n  return distances;\r\n}\r\n\r\n/*\r\nUInt32 *MixMatches4(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances)\r\n{\r\n  UInt32 hash2Value, hash3Value, hash4Value, curMatch2, curMatch3, curMatch4;\r\n  UInt32 *hash = p->hash;\r\n  const Byte *cur = p->pointerToCurPos;\r\n  UInt32 lzPos = p->lzPos;\r\n  MT_HASH4_CALC\r\n      \r\n  curMatch2 = hash[                hash2Value];\r\n  curMatch3 = hash[kFix3HashSize + hash3Value];\r\n  curMatch4 = hash[kFix4HashSize + hash4Value];\r\n  \r\n  hash[                hash2Value] =\r\n  hash[kFix3HashSize + hash3Value] =\r\n  hash[kFix4HashSize + hash4Value] =\r\n    lzPos;\r\n\r\n  if (curMatch2 >= matchMinPos && cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0])\r\n  {\r\n    distances[1] = lzPos - curMatch2 - 1;\r\n    if (cur[(ptrdiff_t)curMatch2 - lzPos + 2] == cur[2])\r\n    {\r\n      distances[0] =  (cur[(ptrdiff_t)curMatch2 - lzPos + 3] == cur[3]) ? 4 : 3;\r\n      return distances + 2;\r\n    }\r\n    distances[0] = 2;\r\n    distances += 2;\r\n  }\r\n  if (curMatch3 >= matchMinPos && cur[(ptrdiff_t)curMatch3 - lzPos] == cur[0])\r\n  {\r\n    distances[1] = lzPos - curMatch3 - 1;\r\n    if (cur[(ptrdiff_t)curMatch3 - lzPos + 3] == cur[3])\r\n    {\r\n      distances[0] = 4;\r\n      return distances + 2;\r\n    }\r\n    distances[0] = 3;\r\n    distances += 2;\r\n  }\r\n\r\n  if (curMatch4 >= matchMinPos)\r\n    if (\r\n      cur[(ptrdiff_t)curMatch4 - lzPos] == cur[0] &&\r\n      cur[(ptrdiff_t)curMatch4 - lzPos + 3] == cur[3]\r\n      )\r\n    {\r\n      *distances++ = 4;\r\n      *distances++ = lzPos - curMatch4 - 1;\r\n    }\r\n  return distances;\r\n}\r\n*/\r\n\r\n#define INCREASE_LZ_POS p->lzPos++; p->pointerToCurPos++;\r\n\r\nUInt32 MatchFinderMt2_GetMatches(CMatchFinderMt *p, UInt32 *distances)\r\n{\r\n  const UInt32 *btBuf = p->btBuf + p->btBufPos;\r\n  UInt32 len = *btBuf++;\r\n  p->btBufPos += 1 + len;\r\n  p->btNumAvailBytes--;\r\n  {\r\n    UInt32 i;\r\n    for (i = 0; i < len; i += 2)\r\n    {\r\n      *distances++ = *btBuf++;\r\n      *distances++ = *btBuf++;\r\n    }\r\n  }\r\n  INCREASE_LZ_POS\r\n  return len;\r\n}\r\n\r\nUInt32 MatchFinderMt_GetMatches(CMatchFinderMt *p, UInt32 *distances)\r\n{\r\n  const UInt32 *btBuf = p->btBuf + p->btBufPos;\r\n  UInt32 len = *btBuf++;\r\n  p->btBufPos += 1 + len;\r\n\r\n  if (len == 0)\r\n  {\r\n    if (p->btNumAvailBytes-- >= 4)\r\n      len = (UInt32)(p->MixMatchesFunc(p, p->lzPos - p->historySize, distances) - (distances));\r\n  }\r\n  else\r\n  {\r\n    /* Condition: there are matches in btBuf with length < p->numHashBytes */\r\n    UInt32 *distances2;\r\n    p->btNumAvailBytes--;\r\n    distances2 = p->MixMatchesFunc(p, p->lzPos - btBuf[1], distances);\r\n    do\r\n    {\r\n      *distances2++ = *btBuf++;\r\n      *distances2++ = *btBuf++;\r\n    }\r\n    while ((len -= 2) != 0);\r\n    len  = (UInt32)(distances2 - (distances));\r\n  }\r\n  INCREASE_LZ_POS\r\n  return len;\r\n}\r\n\r\n#define SKIP_HEADER2_MT  do { GET_NEXT_BLOCK_IF_REQUIRED\r\n#define SKIP_HEADER_MT(n) SKIP_HEADER2_MT if (p->btNumAvailBytes-- >= (n)) { const Byte *cur = p->pointerToCurPos; UInt32 *hash = p->hash;\r\n#define SKIP_FOOTER_MT } INCREASE_LZ_POS p->btBufPos += p->btBuf[p->btBufPos] + 1; } while (--num != 0);\r\n\r\nvoid MatchFinderMt0_Skip(CMatchFinderMt *p, UInt32 num)\r\n{\r\n  SKIP_HEADER2_MT { p->btNumAvailBytes--;\r\n  SKIP_FOOTER_MT\r\n}\r\n\r\nvoid MatchFinderMt2_Skip(CMatchFinderMt *p, UInt32 num)\r\n{\r\n  SKIP_HEADER_MT(2)\r\n      UInt32 hash2Value;\r\n      MT_HASH2_CALC\r\n      hash[hash2Value] = p->lzPos;\r\n  SKIP_FOOTER_MT\r\n}\r\n\r\nvoid MatchFinderMt3_Skip(CMatchFinderMt *p, UInt32 num)\r\n{\r\n  SKIP_HEADER_MT(3)\r\n      UInt32 hash2Value, hash3Value;\r\n      MT_HASH3_CALC\r\n      hash[kFix3HashSize + hash3Value] =\r\n      hash[                hash2Value] =\r\n        p->lzPos;\r\n  SKIP_FOOTER_MT\r\n}\r\n\r\n/*\r\nvoid MatchFinderMt4_Skip(CMatchFinderMt *p, UInt32 num)\r\n{\r\n  SKIP_HEADER_MT(4)\r\n      UInt32 hash2Value, hash3Value, hash4Value;\r\n      MT_HASH4_CALC\r\n      hash[kFix4HashSize + hash4Value] =\r\n      hash[kFix3HashSize + hash3Value] =\r\n      hash[                hash2Value] =\r\n        p->lzPos;\r\n  SKIP_FOOTER_MT\r\n}\r\n*/\r\n\r\nvoid MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder *vTable)\r\n{\r\n  vTable->Init = (Mf_Init_Func)MatchFinderMt_Init;\r\n  vTable->GetIndexByte = (Mf_GetIndexByte_Func)MatchFinderMt_GetIndexByte;\r\n  vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinderMt_GetNumAvailableBytes;\r\n  vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinderMt_GetPointerToCurrentPos;\r\n  vTable->GetMatches = (Mf_GetMatches_Func)MatchFinderMt_GetMatches;\r\n  switch(p->MatchFinder->numHashBytes)\r\n  {\r\n    case 2:\r\n      p->GetHeadsFunc = GetHeads2;\r\n      p->MixMatchesFunc = (Mf_Mix_Matches)0;\r\n      vTable->Skip = (Mf_Skip_Func)MatchFinderMt0_Skip;\r\n      vTable->GetMatches = (Mf_GetMatches_Func)MatchFinderMt2_GetMatches;\r\n      break;\r\n    case 3:\r\n      p->GetHeadsFunc = GetHeads3;\r\n      p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches2;\r\n      vTable->Skip = (Mf_Skip_Func)MatchFinderMt2_Skip;\r\n      break;\r\n    default:\r\n    /* case 4: */\r\n      p->GetHeadsFunc = p->MatchFinder->bigHash ? GetHeads4b : GetHeads4;\r\n      /* p->GetHeadsFunc = GetHeads4; */\r\n      p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches3;\r\n      vTable->Skip = (Mf_Skip_Func)MatchFinderMt3_Skip;\r\n      break;\r\n    /*\r\n    default:\r\n      p->GetHeadsFunc = GetHeads5;\r\n      p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches4;\r\n      vTable->Skip = (Mf_Skip_Func)MatchFinderMt4_Skip;\r\n      break;\r\n    */\r\n  }\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/LzFindMt.h",
    "content": "/* LzFindMt.h -- multithreaded Match finder for LZ algorithms\r\n2009-02-07 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __LZ_FIND_MT_H\r\n#define __LZ_FIND_MT_H\r\n\r\n#include \"LzFind.h\"\r\n#include \"Threads.h\"\r\n\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n#endif\r\n\r\n#define kMtHashBlockSize (1 << 13)\r\n#define kMtHashNumBlocks (1 << 3)\r\n#define kMtHashNumBlocksMask (kMtHashNumBlocks - 1)\r\n\r\n#define kMtBtBlockSize (1 << 14)\r\n#define kMtBtNumBlocks (1 << 6)\r\n#define kMtBtNumBlocksMask (kMtBtNumBlocks - 1)\r\n\r\ntypedef struct _CMtSync\r\n{\r\n  Bool wasCreated;\r\n  Bool needStart;\r\n  Bool exit;\r\n  Bool stopWriting;\r\n\r\n  CThread thread;\r\n  CAutoResetEvent canStart;\r\n  CAutoResetEvent wasStarted;\r\n  CAutoResetEvent wasStopped;\r\n  CSemaphore freeSemaphore;\r\n  CSemaphore filledSemaphore;\r\n  Bool csWasInitialized;\r\n  Bool csWasEntered;\r\n  CCriticalSection cs;\r\n  UInt32 numProcessedBlocks;\r\n} CMtSync;\r\n\r\ntypedef UInt32 * (*Mf_Mix_Matches)(void *p, UInt32 matchMinPos, UInt32 *distances);\r\n\r\n/* kMtCacheLineDummy must be >= size_of_CPU_cache_line */\r\n#define kMtCacheLineDummy 128\r\n\r\ntypedef void (*Mf_GetHeads)(const Byte *buffer, UInt32 pos,\r\n  UInt32 *hash, UInt32 hashMask, UInt32 *heads, UInt32 numHeads, const UInt32 *crc);\r\n\r\ntypedef struct _CMatchFinderMt\r\n{\r\n  /* LZ */\r\n  const Byte *pointerToCurPos;\r\n  UInt32 *btBuf;\r\n  UInt32 btBufPos;\r\n  UInt32 btBufPosLimit;\r\n  UInt32 lzPos;\r\n  UInt32 btNumAvailBytes;\r\n\r\n  UInt32 *hash;\r\n  UInt32 fixedHashSize;\r\n  UInt32 historySize;\r\n  const UInt32 *crc;\r\n\r\n  Mf_Mix_Matches MixMatchesFunc;\r\n  \r\n  /* LZ + BT */\r\n  CMtSync btSync;\r\n  Byte btDummy[kMtCacheLineDummy];\r\n\r\n  /* BT */\r\n  UInt32 *hashBuf;\r\n  UInt32 hashBufPos;\r\n  UInt32 hashBufPosLimit;\r\n  UInt32 hashNumAvail;\r\n\r\n  CLzRef *son;\r\n  UInt32 matchMaxLen;\r\n  UInt32 numHashBytes;\r\n  UInt32 pos;\r\n  Byte *buffer;\r\n  UInt32 cyclicBufferPos;\r\n  UInt32 cyclicBufferSize; /* it must be historySize + 1 */\r\n  UInt32 cutValue;\r\n\r\n  /* BT + Hash */\r\n  CMtSync hashSync;\r\n  /* Byte hashDummy[kMtCacheLineDummy]; */\r\n  \r\n  /* Hash */\r\n  Mf_GetHeads GetHeadsFunc;\r\n  CMatchFinder *MatchFinder;\r\n} CMatchFinderMt;\r\n\r\nvoid MatchFinderMt_Construct(CMatchFinderMt *p);\r\nvoid MatchFinderMt_Destruct(CMatchFinderMt *p, ISzAlloc *alloc);\r\nSRes MatchFinderMt_Create(CMatchFinderMt *p, UInt32 historySize, UInt32 keepAddBufferBefore,\r\n    UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ISzAlloc *alloc);\r\nvoid MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder *vTable);\r\nvoid MatchFinderMt_ReleaseStream(CMatchFinderMt *p);\r\n\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/LzHash.h",
    "content": "/* LzHash.h -- HASH functions for LZ algorithms\r\n2009-02-07 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __LZ_HASH_H\r\n#define __LZ_HASH_H\r\n\r\n#define kHash2Size (1 << 10)\r\n#define kHash3Size (1 << 16)\r\n#define kHash4Size (1 << 20)\r\n\r\n#define kFix3HashSize (kHash2Size)\r\n#define kFix4HashSize (kHash2Size + kHash3Size)\r\n#define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size)\r\n\r\n#define HASH2_CALC hashValue = cur[0] | ((UInt32)cur[1] << 8);\r\n\r\n#define HASH3_CALC { \\\r\n  UInt32 temp = p->crc[cur[0]] ^ cur[1]; \\\r\n  hash2Value = temp & (kHash2Size - 1); \\\r\n  hashValue = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; }\r\n\r\n#define HASH4_CALC { \\\r\n  UInt32 temp = p->crc[cur[0]] ^ cur[1]; \\\r\n  hash2Value = temp & (kHash2Size - 1); \\\r\n  hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \\\r\n  hashValue = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & p->hashMask; }\r\n\r\n#define HASH5_CALC { \\\r\n  UInt32 temp = p->crc[cur[0]] ^ cur[1]; \\\r\n  hash2Value = temp & (kHash2Size - 1); \\\r\n  hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \\\r\n  hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)); \\\r\n  hashValue = (hash4Value ^ (p->crc[cur[4]] << 3)) & p->hashMask; \\\r\n  hash4Value &= (kHash4Size - 1); }\r\n\r\n/* #define HASH_ZIP_CALC hashValue = ((cur[0] | ((UInt32)cur[1] << 8)) ^ p->crc[cur[2]]) & 0xFFFF; */\r\n#define HASH_ZIP_CALC hashValue = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF;\r\n\r\n\r\n#define MT_HASH2_CALC \\\r\n  hash2Value = (p->crc[cur[0]] ^ cur[1]) & (kHash2Size - 1);\r\n\r\n#define MT_HASH3_CALC { \\\r\n  UInt32 temp = p->crc[cur[0]] ^ cur[1]; \\\r\n  hash2Value = temp & (kHash2Size - 1); \\\r\n  hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); }\r\n\r\n#define MT_HASH4_CALC { \\\r\n  UInt32 temp = p->crc[cur[0]] ^ cur[1]; \\\r\n  hash2Value = temp & (kHash2Size - 1); \\\r\n  hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \\\r\n  hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & (kHash4Size - 1); }\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/Lzma2Dec.c",
    "content": "/* Lzma2Dec.c -- LZMA2 Decoder\r\n2010-12-15 : Igor Pavlov : Public domain */\r\n\r\n/* #define SHOW_DEBUG_INFO */\r\n\r\n#ifdef SHOW_DEBUG_INFO\r\n#include <stdio.h>\r\n#endif\r\n\r\n#include <string.h>\r\n\r\n#include \"Lzma2Dec.h\"\r\n\r\n/*\r\n00000000  -  EOS\r\n00000001 U U  -  Uncompressed Reset Dic\r\n00000010 U U  -  Uncompressed No Reset\r\n100uuuuu U U P P  -  LZMA no reset\r\n101uuuuu U U P P  -  LZMA reset state\r\n110uuuuu U U P P S  -  LZMA reset state + new prop\r\n111uuuuu U U P P S  -  LZMA reset state + new prop + reset dic\r\n\r\n  u, U - Unpack Size\r\n  P - Pack Size\r\n  S - Props\r\n*/\r\n\r\n#define LZMA2_CONTROL_LZMA (1 << 7)\r\n#define LZMA2_CONTROL_COPY_NO_RESET 2\r\n#define LZMA2_CONTROL_COPY_RESET_DIC 1\r\n#define LZMA2_CONTROL_EOF 0\r\n\r\n#define LZMA2_IS_UNCOMPRESSED_STATE(p) (((p)->control & LZMA2_CONTROL_LZMA) == 0)\r\n\r\n#define LZMA2_GET_LZMA_MODE(p) (((p)->control >> 5) & 3)\r\n#define LZMA2_IS_THERE_PROP(mode) ((mode) >= 2)\r\n\r\n#define LZMA2_LCLP_MAX 4\r\n#define LZMA2_DIC_SIZE_FROM_PROP(p) (((UInt32)2 | ((p) & 1)) << ((p) / 2 + 11))\r\n\r\n#ifdef SHOW_DEBUG_INFO\r\n#define PRF(x) x\r\n#else\r\n#define PRF(x)\r\n#endif\r\n\r\ntypedef enum\r\n{\r\n  LZMA2_STATE_CONTROL,\r\n  LZMA2_STATE_UNPACK0,\r\n  LZMA2_STATE_UNPACK1,\r\n  LZMA2_STATE_PACK0,\r\n  LZMA2_STATE_PACK1,\r\n  LZMA2_STATE_PROP,\r\n  LZMA2_STATE_DATA,\r\n  LZMA2_STATE_DATA_CONT,\r\n  LZMA2_STATE_FINISHED,\r\n  LZMA2_STATE_ERROR\r\n} ELzma2State;\r\n\r\nstatic SRes Lzma2Dec_GetOldProps(Byte prop, Byte *props)\r\n{\r\n  UInt32 dicSize;\r\n  if (prop > 40)\r\n    return SZ_ERROR_UNSUPPORTED;\r\n  dicSize = (prop == 40) ? 0xFFFFFFFF : LZMA2_DIC_SIZE_FROM_PROP(prop);\r\n  props[0] = (Byte)LZMA2_LCLP_MAX;\r\n  props[1] = (Byte)(dicSize);\r\n  props[2] = (Byte)(dicSize >> 8);\r\n  props[3] = (Byte)(dicSize >> 16);\r\n  props[4] = (Byte)(dicSize >> 24);\r\n  return SZ_OK;\r\n}\r\n\r\nSRes Lzma2Dec_AllocateProbs(CLzma2Dec *p, Byte prop, ISzAlloc *alloc)\r\n{\r\n  Byte props[LZMA_PROPS_SIZE];\r\n  RINOK(Lzma2Dec_GetOldProps(prop, props));\r\n  return LzmaDec_AllocateProbs(&p->decoder, props, LZMA_PROPS_SIZE, alloc);\r\n}\r\n\r\nSRes Lzma2Dec_Allocate(CLzma2Dec *p, Byte prop, ISzAlloc *alloc)\r\n{\r\n  Byte props[LZMA_PROPS_SIZE];\r\n  RINOK(Lzma2Dec_GetOldProps(prop, props));\r\n  return LzmaDec_Allocate(&p->decoder, props, LZMA_PROPS_SIZE, alloc);\r\n}\r\n\r\nvoid Lzma2Dec_Init(CLzma2Dec *p)\r\n{\r\n  p->state = LZMA2_STATE_CONTROL;\r\n  p->needInitDic = True;\r\n  p->needInitState = True;\r\n  p->needInitProp = True;\r\n  LzmaDec_Init(&p->decoder);\r\n}\r\n\r\nstatic ELzma2State Lzma2Dec_UpdateState(CLzma2Dec *p, Byte b)\r\n{\r\n  switch(p->state)\r\n  {\r\n    case LZMA2_STATE_CONTROL:\r\n      p->control = b;\r\n      PRF(printf(\"\\n %4X \", p->decoder.dicPos));\r\n      PRF(printf(\" %2X\", b));\r\n      if (p->control == 0)\r\n        return LZMA2_STATE_FINISHED;\r\n      if (LZMA2_IS_UNCOMPRESSED_STATE(p))\r\n      {\r\n        if ((p->control & 0x7F) > 2)\r\n          return LZMA2_STATE_ERROR;\r\n        p->unpackSize = 0;\r\n      }\r\n      else\r\n        p->unpackSize = (UInt32)(p->control & 0x1F) << 16;\r\n      return LZMA2_STATE_UNPACK0;\r\n    \r\n    case LZMA2_STATE_UNPACK0:\r\n      p->unpackSize |= (UInt32)b << 8;\r\n      return LZMA2_STATE_UNPACK1;\r\n    \r\n    case LZMA2_STATE_UNPACK1:\r\n      p->unpackSize |= (UInt32)b;\r\n      p->unpackSize++;\r\n      PRF(printf(\" %8d\", p->unpackSize));\r\n      return (LZMA2_IS_UNCOMPRESSED_STATE(p)) ? LZMA2_STATE_DATA : LZMA2_STATE_PACK0;\r\n    \r\n    case LZMA2_STATE_PACK0:\r\n      p->packSize = (UInt32)b << 8;\r\n      return LZMA2_STATE_PACK1;\r\n\r\n    case LZMA2_STATE_PACK1:\r\n      p->packSize |= (UInt32)b;\r\n      p->packSize++;\r\n      PRF(printf(\" %8d\", p->packSize));\r\n      return LZMA2_IS_THERE_PROP(LZMA2_GET_LZMA_MODE(p)) ? LZMA2_STATE_PROP:\r\n        (p->needInitProp ? LZMA2_STATE_ERROR : LZMA2_STATE_DATA);\r\n\r\n    case LZMA2_STATE_PROP:\r\n    {\r\n      int lc, lp;\r\n      if (b >= (9 * 5 * 5))\r\n        return LZMA2_STATE_ERROR;\r\n      lc = b % 9;\r\n      b /= 9;\r\n      p->decoder.prop.pb = b / 5;\r\n      lp = b % 5;\r\n      if (lc + lp > LZMA2_LCLP_MAX)\r\n        return LZMA2_STATE_ERROR;\r\n      p->decoder.prop.lc = lc;\r\n      p->decoder.prop.lp = lp;\r\n      p->needInitProp = False;\r\n      return LZMA2_STATE_DATA;\r\n    }\r\n  }\r\n  return LZMA2_STATE_ERROR;\r\n}\r\n\r\nstatic void LzmaDec_UpdateWithUncompressed(CLzmaDec *p, const Byte *src, SizeT size)\r\n{\r\n  memcpy(p->dic + p->dicPos, src, size);\r\n  p->dicPos += size;\r\n  if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= size)\r\n    p->checkDicSize = p->prop.dicSize;\r\n  p->processedPos += (UInt32)size;\r\n}\r\n\r\nvoid LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState);\r\n\r\nSRes Lzma2Dec_DecodeToDic(CLzma2Dec *p, SizeT dicLimit,\r\n    const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)\r\n{\r\n  SizeT inSize = *srcLen;\r\n  *srcLen = 0;\r\n  *status = LZMA_STATUS_NOT_SPECIFIED;\r\n\r\n  while (p->state != LZMA2_STATE_FINISHED)\r\n  {\r\n    SizeT dicPos = p->decoder.dicPos;\r\n    if (p->state == LZMA2_STATE_ERROR)\r\n      return SZ_ERROR_DATA;\r\n    if (dicPos == dicLimit && finishMode == LZMA_FINISH_ANY)\r\n    {\r\n      *status = LZMA_STATUS_NOT_FINISHED;\r\n      return SZ_OK;\r\n    }\r\n    if (p->state != LZMA2_STATE_DATA && p->state != LZMA2_STATE_DATA_CONT)\r\n    {\r\n      if (*srcLen == inSize)\r\n      {\r\n        *status = LZMA_STATUS_NEEDS_MORE_INPUT;\r\n        return SZ_OK;\r\n      }\r\n      (*srcLen)++;\r\n      p->state = Lzma2Dec_UpdateState(p, *src++);\r\n      continue;\r\n    }\r\n    {\r\n      SizeT destSizeCur = dicLimit - dicPos;\r\n      SizeT srcSizeCur = inSize - *srcLen;\r\n      ELzmaFinishMode curFinishMode = LZMA_FINISH_ANY;\r\n      \r\n      if (p->unpackSize <= destSizeCur)\r\n      {\r\n        destSizeCur = (SizeT)p->unpackSize;\r\n        curFinishMode = LZMA_FINISH_END;\r\n      }\r\n\r\n      if (LZMA2_IS_UNCOMPRESSED_STATE(p))\r\n      {\r\n        if (*srcLen == inSize)\r\n        {\r\n          *status = LZMA_STATUS_NEEDS_MORE_INPUT;\r\n          return SZ_OK;\r\n        }\r\n\r\n        if (p->state == LZMA2_STATE_DATA)\r\n        {\r\n          Bool initDic = (p->control == LZMA2_CONTROL_COPY_RESET_DIC);\r\n          if (initDic)\r\n            p->needInitProp = p->needInitState = True;\r\n          else if (p->needInitDic)\r\n            return SZ_ERROR_DATA;\r\n          p->needInitDic = False;\r\n          LzmaDec_InitDicAndState(&p->decoder, initDic, False);\r\n        }\r\n\r\n        if (srcSizeCur > destSizeCur)\r\n          srcSizeCur = destSizeCur;\r\n\r\n        if (srcSizeCur == 0)\r\n          return SZ_ERROR_DATA;\r\n\r\n        LzmaDec_UpdateWithUncompressed(&p->decoder, src, srcSizeCur);\r\n\r\n        src += srcSizeCur;\r\n        *srcLen += srcSizeCur;\r\n        p->unpackSize -= (UInt32)srcSizeCur;\r\n        p->state = (p->unpackSize == 0) ? LZMA2_STATE_CONTROL : LZMA2_STATE_DATA_CONT;\r\n      }\r\n      else\r\n      {\r\n        SizeT outSizeProcessed;\r\n        SRes res;\r\n\r\n        if (p->state == LZMA2_STATE_DATA)\r\n        {\r\n          int mode = LZMA2_GET_LZMA_MODE(p);\r\n          Bool initDic = (mode == 3);\r\n          Bool initState = (mode > 0);\r\n          if ((!initDic && p->needInitDic) || (!initState && p->needInitState))\r\n            return SZ_ERROR_DATA;\r\n          \r\n          LzmaDec_InitDicAndState(&p->decoder, initDic, initState);\r\n          p->needInitDic = False;\r\n          p->needInitState = False;\r\n          p->state = LZMA2_STATE_DATA_CONT;\r\n        }\r\n        if (srcSizeCur > p->packSize)\r\n          srcSizeCur = (SizeT)p->packSize;\r\n          \r\n        res = LzmaDec_DecodeToDic(&p->decoder, dicPos + destSizeCur, src, &srcSizeCur, curFinishMode, status);\r\n        \r\n        src += srcSizeCur;\r\n        *srcLen += srcSizeCur;\r\n        p->packSize -= (UInt32)srcSizeCur;\r\n\r\n        outSizeProcessed = p->decoder.dicPos - dicPos;\r\n        p->unpackSize -= (UInt32)outSizeProcessed;\r\n\r\n        RINOK(res);\r\n        if (*status == LZMA_STATUS_NEEDS_MORE_INPUT)\r\n          return res;\r\n\r\n        if (srcSizeCur == 0 && outSizeProcessed == 0)\r\n        {\r\n          if (*status != LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK ||\r\n              p->unpackSize != 0 || p->packSize != 0)\r\n            return SZ_ERROR_DATA;\r\n          p->state = LZMA2_STATE_CONTROL;\r\n        }\r\n        if (*status == LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK)\r\n          *status = LZMA_STATUS_NOT_FINISHED;\r\n      }\r\n    }\r\n  }\r\n  *status = LZMA_STATUS_FINISHED_WITH_MARK;\r\n  return SZ_OK;\r\n}\r\n\r\nSRes Lzma2Dec_DecodeToBuf(CLzma2Dec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)\r\n{\r\n  SizeT outSize = *destLen, inSize = *srcLen;\r\n  *srcLen = *destLen = 0;\r\n  for (;;)\r\n  {\r\n    SizeT srcSizeCur = inSize, outSizeCur, dicPos;\r\n    ELzmaFinishMode curFinishMode;\r\n    SRes res;\r\n    if (p->decoder.dicPos == p->decoder.dicBufSize)\r\n      p->decoder.dicPos = 0;\r\n    dicPos = p->decoder.dicPos;\r\n    if (outSize > p->decoder.dicBufSize - dicPos)\r\n    {\r\n      outSizeCur = p->decoder.dicBufSize;\r\n      curFinishMode = LZMA_FINISH_ANY;\r\n    }\r\n    else\r\n    {\r\n      outSizeCur = dicPos + outSize;\r\n      curFinishMode = finishMode;\r\n    }\r\n\r\n    res = Lzma2Dec_DecodeToDic(p, outSizeCur, src, &srcSizeCur, curFinishMode, status);\r\n    src += srcSizeCur;\r\n    inSize -= srcSizeCur;\r\n    *srcLen += srcSizeCur;\r\n    outSizeCur = p->decoder.dicPos - dicPos;\r\n    memcpy(dest, p->decoder.dic + dicPos, outSizeCur);\r\n    dest += outSizeCur;\r\n    outSize -= outSizeCur;\r\n    *destLen += outSizeCur;\r\n    if (res != 0)\r\n      return res;\r\n    if (outSizeCur == 0 || outSize == 0)\r\n      return SZ_OK;\r\n  }\r\n}\r\n\r\nSRes Lzma2Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,\r\n    Byte prop, ELzmaFinishMode finishMode, ELzmaStatus *status, ISzAlloc *alloc)\r\n{\r\n  CLzma2Dec p;\r\n  SRes res;\r\n  SizeT outSize = *destLen, inSize = *srcLen;\r\n  *destLen = *srcLen = 0;\r\n  *status = LZMA_STATUS_NOT_SPECIFIED;\r\n  Lzma2Dec_Construct(&p);\r\n  RINOK(Lzma2Dec_AllocateProbs(&p, prop, alloc));\r\n  p.decoder.dic = dest;\r\n  p.decoder.dicBufSize = outSize;\r\n  Lzma2Dec_Init(&p);\r\n  *srcLen = inSize;\r\n  res = Lzma2Dec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status);\r\n  *destLen = p.decoder.dicPos;\r\n  if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT)\r\n    res = SZ_ERROR_INPUT_EOF;\r\n  Lzma2Dec_FreeProbs(&p, alloc);\r\n  return res;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/Lzma2Dec.h",
    "content": "/* Lzma2Dec.h -- LZMA2 Decoder\r\n2009-05-03 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __LZMA2_DEC_H\r\n#define __LZMA2_DEC_H\r\n\r\n#include \"LzmaDec.h\"\r\n\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n#endif\r\n\r\n/* ---------- State Interface ---------- */\r\n\r\ntypedef struct\r\n{\r\n  CLzmaDec decoder;\r\n  UInt32 packSize;\r\n  UInt32 unpackSize;\r\n  int state;\r\n  Byte control;\r\n  Bool needInitDic;\r\n  Bool needInitState;\r\n  Bool needInitProp;\r\n} CLzma2Dec;\r\n\r\n#define Lzma2Dec_Construct(p) LzmaDec_Construct(&(p)->decoder)\r\n#define Lzma2Dec_FreeProbs(p, alloc) LzmaDec_FreeProbs(&(p)->decoder, alloc);\r\n#define Lzma2Dec_Free(p, alloc) LzmaDec_Free(&(p)->decoder, alloc);\r\n\r\nSRes Lzma2Dec_AllocateProbs(CLzma2Dec *p, Byte prop, ISzAlloc *alloc);\r\nSRes Lzma2Dec_Allocate(CLzma2Dec *p, Byte prop, ISzAlloc *alloc);\r\nvoid Lzma2Dec_Init(CLzma2Dec *p);\r\n\r\n\r\n/*\r\nfinishMode:\r\n  It has meaning only if the decoding reaches output limit (*destLen or dicLimit).\r\n  LZMA_FINISH_ANY - use smallest number of input bytes\r\n  LZMA_FINISH_END - read EndOfStream marker after decoding\r\n\r\nReturns:\r\n  SZ_OK\r\n    status:\r\n      LZMA_STATUS_FINISHED_WITH_MARK\r\n      LZMA_STATUS_NOT_FINISHED\r\n      LZMA_STATUS_NEEDS_MORE_INPUT\r\n  SZ_ERROR_DATA - Data error\r\n*/\r\n\r\nSRes Lzma2Dec_DecodeToDic(CLzma2Dec *p, SizeT dicLimit,\r\n    const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);\r\n\r\nSRes Lzma2Dec_DecodeToBuf(CLzma2Dec *p, Byte *dest, SizeT *destLen,\r\n    const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);\r\n\r\n\r\n/* ---------- One Call Interface ---------- */\r\n\r\n/*\r\nfinishMode:\r\n  It has meaning only if the decoding reaches output limit (*destLen).\r\n  LZMA_FINISH_ANY - use smallest number of input bytes\r\n  LZMA_FINISH_END - read EndOfStream marker after decoding\r\n\r\nReturns:\r\n  SZ_OK\r\n    status:\r\n      LZMA_STATUS_FINISHED_WITH_MARK\r\n      LZMA_STATUS_NOT_FINISHED\r\n  SZ_ERROR_DATA - Data error\r\n  SZ_ERROR_MEM  - Memory allocation error\r\n  SZ_ERROR_UNSUPPORTED - Unsupported properties\r\n  SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).\r\n*/\r\n\r\nSRes Lzma2Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,\r\n    Byte prop, ELzmaFinishMode finishMode, ELzmaStatus *status, ISzAlloc *alloc);\r\n\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/Lzma2Enc.c",
    "content": "/* Lzma2Enc.c -- LZMA2 Encoder\r\n2010-09-24 : Igor Pavlov : Public domain */\r\n\r\n/* #include <stdio.h> */\r\n#include <string.h>\r\n\r\n/* #define _7ZIP_ST */\r\n\r\n#include \"Lzma2Enc.h\"\r\n\r\n#ifndef _7ZIP_ST\r\n#include \"MtCoder.h\"\r\n#else\r\n#define NUM_MT_CODER_THREADS_MAX 1\r\n#endif\r\n\r\n#define LZMA2_CONTROL_LZMA (1 << 7)\r\n#define LZMA2_CONTROL_COPY_NO_RESET 2\r\n#define LZMA2_CONTROL_COPY_RESET_DIC 1\r\n#define LZMA2_CONTROL_EOF 0\r\n\r\n#define LZMA2_LCLP_MAX 4\r\n\r\n#define LZMA2_DIC_SIZE_FROM_PROP(p) (((UInt32)2 | ((p) & 1)) << ((p) / 2 + 11))\r\n\r\n#define LZMA2_PACK_SIZE_MAX (1 << 16)\r\n#define LZMA2_COPY_CHUNK_SIZE LZMA2_PACK_SIZE_MAX\r\n#define LZMA2_UNPACK_SIZE_MAX (1 << 21)\r\n#define LZMA2_KEEP_WINDOW_SIZE LZMA2_UNPACK_SIZE_MAX\r\n\r\n#define LZMA2_CHUNK_SIZE_COMPRESSED_MAX ((1 << 16) + 16)\r\n\r\n\r\n#define PRF(x) /* x */\r\n\r\n/* ---------- CLzma2EncInt ---------- */\r\n\r\ntypedef struct\r\n{\r\n  CLzmaEncHandle enc;\r\n  UInt64 srcPos;\r\n  Byte props;\r\n  Bool needInitState;\r\n  Bool needInitProp;\r\n} CLzma2EncInt;\r\n\r\nstatic SRes Lzma2EncInt_Init(CLzma2EncInt *p, const CLzma2EncProps *props)\r\n{\r\n  Byte propsEncoded[LZMA_PROPS_SIZE];\r\n  SizeT propsSize = LZMA_PROPS_SIZE;\r\n  RINOK(LzmaEnc_SetProps(p->enc, &props->lzmaProps));\r\n  RINOK(LzmaEnc_WriteProperties(p->enc, propsEncoded, &propsSize));\r\n  p->srcPos = 0;\r\n  p->props = propsEncoded[0];\r\n  p->needInitState = True;\r\n  p->needInitProp = True;\r\n  return SZ_OK;\r\n}\r\n\r\nSRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle pp, ISeqInStream *inStream, UInt32 keepWindowSize,\r\n    ISzAlloc *alloc, ISzAlloc *allocBig);\r\nSRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen,\r\n    UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig);\r\nSRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit,\r\n    Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize);\r\nconst Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp);\r\nvoid LzmaEnc_Finish(CLzmaEncHandle pp);\r\nvoid LzmaEnc_SaveState(CLzmaEncHandle pp);\r\nvoid LzmaEnc_RestoreState(CLzmaEncHandle pp);\r\n\r\n\r\nstatic SRes Lzma2EncInt_EncodeSubblock(CLzma2EncInt *p, Byte *outBuf,\r\n    size_t *packSizeRes, ISeqOutStream *outStream)\r\n{\r\n  size_t packSizeLimit = *packSizeRes;\r\n  size_t packSize = packSizeLimit;\r\n  UInt32 unpackSize = LZMA2_UNPACK_SIZE_MAX;\r\n  unsigned lzHeaderSize = 5 + (p->needInitProp ? 1 : 0);\r\n  Bool useCopyBlock;\r\n  SRes res;\r\n\r\n  *packSizeRes = 0;\r\n  if (packSize < lzHeaderSize)\r\n    return SZ_ERROR_OUTPUT_EOF;\r\n  packSize -= lzHeaderSize;\r\n  \r\n  LzmaEnc_SaveState(p->enc);\r\n  res = LzmaEnc_CodeOneMemBlock(p->enc, p->needInitState,\r\n      outBuf + lzHeaderSize, &packSize, LZMA2_PACK_SIZE_MAX, &unpackSize);\r\n  \r\n  PRF(printf(\"\\npackSize = %7d unpackSize = %7d  \", packSize, unpackSize));\r\n\r\n  if (unpackSize == 0)\r\n    return res;\r\n\r\n  if (res == SZ_OK)\r\n    useCopyBlock = (packSize + 2 >= unpackSize || packSize > (1 << 16));\r\n  else\r\n  {\r\n    if (res != SZ_ERROR_OUTPUT_EOF)\r\n      return res;\r\n    res = SZ_OK;\r\n    useCopyBlock = True;\r\n  }\r\n\r\n  if (useCopyBlock)\r\n  {\r\n    size_t destPos = 0;\r\n    PRF(printf(\"################# COPY           \"));\r\n    while (unpackSize > 0)\r\n    {\r\n      UInt32 u = (unpackSize < LZMA2_COPY_CHUNK_SIZE) ? unpackSize : LZMA2_COPY_CHUNK_SIZE;\r\n      if (packSizeLimit - destPos < u + 3)\r\n        return SZ_ERROR_OUTPUT_EOF;\r\n      outBuf[destPos++] = (Byte)(p->srcPos == 0 ? LZMA2_CONTROL_COPY_RESET_DIC : LZMA2_CONTROL_COPY_NO_RESET);\r\n      outBuf[destPos++] = (Byte)((u - 1) >> 8);\r\n      outBuf[destPos++] = (Byte)(u - 1);\r\n      memcpy(outBuf + destPos, LzmaEnc_GetCurBuf(p->enc) - unpackSize, u);\r\n      unpackSize -= u;\r\n      destPos += u;\r\n      p->srcPos += u;\r\n      if (outStream)\r\n      {\r\n        *packSizeRes += destPos;\r\n        if (outStream->Write(outStream, outBuf, destPos) != destPos)\r\n          return SZ_ERROR_WRITE;\r\n        destPos = 0;\r\n      }\r\n      else\r\n        *packSizeRes = destPos;\r\n      /* needInitState = True; */\r\n    }\r\n    LzmaEnc_RestoreState(p->enc);\r\n    return SZ_OK;\r\n  }\r\n  {\r\n    size_t destPos = 0;\r\n    UInt32 u = unpackSize - 1;\r\n    UInt32 pm = (UInt32)(packSize - 1);\r\n    unsigned mode = (p->srcPos == 0) ? 3 : (p->needInitState ? (p->needInitProp ? 2 : 1) : 0);\r\n\r\n    PRF(printf(\"               \"));\r\n\r\n    outBuf[destPos++] = (Byte)(LZMA2_CONTROL_LZMA | (mode << 5) | ((u >> 16) & 0x1F));\r\n    outBuf[destPos++] = (Byte)(u >> 8);\r\n    outBuf[destPos++] = (Byte)u;\r\n    outBuf[destPos++] = (Byte)(pm >> 8);\r\n    outBuf[destPos++] = (Byte)pm;\r\n    \r\n    if (p->needInitProp)\r\n      outBuf[destPos++] = p->props;\r\n    \r\n    p->needInitProp = False;\r\n    p->needInitState = False;\r\n    destPos += packSize;\r\n    p->srcPos += unpackSize;\r\n\r\n    if (outStream)\r\n      if (outStream->Write(outStream, outBuf, destPos) != destPos)\r\n        return SZ_ERROR_WRITE;\r\n    *packSizeRes = destPos;\r\n    return SZ_OK;\r\n  }\r\n}\r\n\r\n/* ---------- Lzma2 Props ---------- */\r\n\r\nvoid Lzma2EncProps_Init(CLzma2EncProps *p)\r\n{\r\n  LzmaEncProps_Init(&p->lzmaProps);\r\n  p->numTotalThreads = -1;\r\n  p->numBlockThreads = -1;\r\n  p->blockSize = 0;\r\n}\r\n\r\nvoid Lzma2EncProps_Normalize(CLzma2EncProps *p)\r\n{\r\n  int t1, t1n, t2, t3;\r\n  {\r\n    CLzmaEncProps lzmaProps = p->lzmaProps;\r\n    LzmaEncProps_Normalize(&lzmaProps);\r\n    t1n = lzmaProps.numThreads;\r\n  }\r\n\r\n  t1 = p->lzmaProps.numThreads;\r\n  t2 = p->numBlockThreads;\r\n  t3 = p->numTotalThreads;\r\n\r\n  if (t2 > NUM_MT_CODER_THREADS_MAX)\r\n    t2 = NUM_MT_CODER_THREADS_MAX;\r\n\r\n  if (t3 <= 0)\r\n  {\r\n    if (t2 <= 0)\r\n      t2 = 1;\r\n    t3 = t1n * t2;\r\n  }\r\n  else if (t2 <= 0)\r\n  {\r\n    t2 = t3 / t1n;\r\n    if (t2 == 0)\r\n    {\r\n      t1 = 1;\r\n      t2 = t3;\r\n    }\r\n    if (t2 > NUM_MT_CODER_THREADS_MAX)\r\n      t2 = NUM_MT_CODER_THREADS_MAX;\r\n  }\r\n  else if (t1 <= 0)\r\n  {\r\n    t1 = t3 / t2;\r\n    if (t1 == 0)\r\n      t1 = 1;\r\n  }\r\n  else\r\n    t3 = t1n * t2;\r\n\r\n  p->lzmaProps.numThreads = t1;\r\n  p->numBlockThreads = t2;\r\n  p->numTotalThreads = t3;\r\n  LzmaEncProps_Normalize(&p->lzmaProps);\r\n\r\n  if (p->blockSize == 0)\r\n  {\r\n    UInt32 dictSize = p->lzmaProps.dictSize;\r\n    UInt64 blockSize = (UInt64)dictSize << 2;\r\n    const UInt32 kMinSize = (UInt32)1 << 20;\r\n    const UInt32 kMaxSize = (UInt32)1 << 28;\r\n    if (blockSize < kMinSize) blockSize = kMinSize;\r\n    if (blockSize > kMaxSize) blockSize = kMaxSize;\r\n    if (blockSize < dictSize) blockSize = dictSize;\r\n    p->blockSize = (size_t)blockSize;\r\n  }\r\n}\r\n\r\nstatic SRes Progress(ICompressProgress *p, UInt64 inSize, UInt64 outSize)\r\n{\r\n  return (p && p->Progress(p, inSize, outSize) != SZ_OK) ? SZ_ERROR_PROGRESS : SZ_OK;\r\n}\r\n\r\n/* ---------- Lzma2 ---------- */\r\n\r\ntypedef struct\r\n{\r\n  Byte propEncoded;\r\n  CLzma2EncProps props;\r\n  \r\n  Byte *outBuf;\r\n\r\n  ISzAlloc *alloc;\r\n  ISzAlloc *allocBig;\r\n\r\n  CLzma2EncInt coders[NUM_MT_CODER_THREADS_MAX];\r\n\r\n  #ifndef _7ZIP_ST\r\n  CMtCoder mtCoder;\r\n  #endif\r\n\r\n} CLzma2Enc;\r\n\r\n\r\n/* ---------- Lzma2EncThread ---------- */\r\n\r\nstatic SRes Lzma2Enc_EncodeMt1(CLzma2EncInt *p, CLzma2Enc *mainEncoder,\r\n  ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress)\r\n{\r\n  UInt64 packTotal = 0;\r\n  SRes res = SZ_OK;\r\n\r\n  if (mainEncoder->outBuf == 0)\r\n  {\r\n    mainEncoder->outBuf = (Byte *)IAlloc_Alloc(mainEncoder->alloc, LZMA2_CHUNK_SIZE_COMPRESSED_MAX);\r\n    if (mainEncoder->outBuf == 0)\r\n      return SZ_ERROR_MEM;\r\n  }\r\n  RINOK(Lzma2EncInt_Init(p, &mainEncoder->props));\r\n  RINOK(LzmaEnc_PrepareForLzma2(p->enc, inStream, LZMA2_KEEP_WINDOW_SIZE,\r\n      mainEncoder->alloc, mainEncoder->allocBig));\r\n  for (;;)\r\n  {\r\n    size_t packSize = LZMA2_CHUNK_SIZE_COMPRESSED_MAX;\r\n    res = Lzma2EncInt_EncodeSubblock(p, mainEncoder->outBuf, &packSize, outStream);\r\n    if (res != SZ_OK)\r\n      break;\r\n    packTotal += packSize;\r\n    res = Progress(progress, p->srcPos, packTotal);\r\n    if (res != SZ_OK)\r\n      break;\r\n    if (packSize == 0)\r\n      break;\r\n  }\r\n  LzmaEnc_Finish(p->enc);\r\n  if (res == SZ_OK)\r\n  {\r\n    Byte b = 0;\r\n    if (outStream->Write(outStream, &b, 1) != 1)\r\n      return SZ_ERROR_WRITE;\r\n  }\r\n  return res;\r\n}\r\n\r\n#ifndef _7ZIP_ST\r\n\r\ntypedef struct\r\n{\r\n  IMtCoderCallback funcTable;\r\n  CLzma2Enc *lzma2Enc;\r\n} CMtCallbackImp;\r\n\r\nstatic SRes MtCallbackImp_Code(void *pp, unsigned index, Byte *dest, size_t *destSize,\r\n      const Byte *src, size_t srcSize, int finished)\r\n{\r\n  CMtCallbackImp *imp = (CMtCallbackImp *)pp;\r\n  CLzma2Enc *mainEncoder = imp->lzma2Enc;\r\n  CLzma2EncInt *p = &mainEncoder->coders[index];\r\n\r\n  SRes res = SZ_OK;\r\n  {\r\n    size_t destLim = *destSize;\r\n    *destSize = 0;\r\n\r\n    if (srcSize != 0)\r\n    {\r\n      RINOK(Lzma2EncInt_Init(p, &mainEncoder->props));\r\n     \r\n      RINOK(LzmaEnc_MemPrepare(p->enc, src, srcSize, LZMA2_KEEP_WINDOW_SIZE,\r\n          mainEncoder->alloc, mainEncoder->allocBig));\r\n     \r\n      while (p->srcPos < srcSize)\r\n      {\r\n        size_t packSize = destLim - *destSize;\r\n        res = Lzma2EncInt_EncodeSubblock(p, dest + *destSize, &packSize, NULL);\r\n        if (res != SZ_OK)\r\n          break;\r\n        *destSize += packSize;\r\n\r\n        if (packSize == 0)\r\n        {\r\n          res = SZ_ERROR_FAIL;\r\n          break;\r\n        }\r\n\r\n        if (MtProgress_Set(&mainEncoder->mtCoder.mtProgress, index, p->srcPos, *destSize) != SZ_OK)\r\n        {\r\n          res = SZ_ERROR_PROGRESS;\r\n          break;\r\n        }\r\n      }\r\n      LzmaEnc_Finish(p->enc);\r\n      if (res != SZ_OK)\r\n        return res;\r\n    }\r\n    if (finished)\r\n    {\r\n      if (*destSize == destLim)\r\n        return SZ_ERROR_OUTPUT_EOF;\r\n      dest[(*destSize)++] = 0;\r\n    }\r\n  }\r\n  return res;\r\n}\r\n\r\n#endif\r\n\r\n/* ---------- Lzma2Enc ---------- */\r\n\r\nCLzma2EncHandle Lzma2Enc_Create(ISzAlloc *alloc, ISzAlloc *allocBig)\r\n{\r\n  CLzma2Enc *p = (CLzma2Enc *)alloc->Alloc(alloc, sizeof(CLzma2Enc));\r\n  if (p == 0)\r\n    return NULL;\r\n  Lzma2EncProps_Init(&p->props);\r\n  Lzma2EncProps_Normalize(&p->props);\r\n  p->outBuf = 0;\r\n  p->alloc = alloc;\r\n  p->allocBig = allocBig;\r\n  {\r\n    unsigned i;\r\n    for (i = 0; i < NUM_MT_CODER_THREADS_MAX; i++)\r\n      p->coders[i].enc = 0;\r\n  }\r\n  #ifndef _7ZIP_ST\r\n  MtCoder_Construct(&p->mtCoder);\r\n  #endif\r\n\r\n  return p;\r\n}\r\n\r\nvoid Lzma2Enc_Destroy(CLzma2EncHandle pp)\r\n{\r\n  CLzma2Enc *p = (CLzma2Enc *)pp;\r\n  unsigned i;\r\n  for (i = 0; i < NUM_MT_CODER_THREADS_MAX; i++)\r\n  {\r\n    CLzma2EncInt *t = &p->coders[i];\r\n    if (t->enc)\r\n    {\r\n      LzmaEnc_Destroy(t->enc, p->alloc, p->allocBig);\r\n      t->enc = 0;\r\n    }\r\n  }\r\n\r\n  #ifndef _7ZIP_ST\r\n  MtCoder_Destruct(&p->mtCoder);\r\n  #endif\r\n\r\n  IAlloc_Free(p->alloc, p->outBuf);\r\n  IAlloc_Free(p->alloc, pp);\r\n}\r\n\r\nSRes Lzma2Enc_SetProps(CLzma2EncHandle pp, const CLzma2EncProps *props)\r\n{\r\n  CLzma2Enc *p = (CLzma2Enc *)pp;\r\n  CLzmaEncProps lzmaProps = props->lzmaProps;\r\n  LzmaEncProps_Normalize(&lzmaProps);\r\n  if (lzmaProps.lc + lzmaProps.lp > LZMA2_LCLP_MAX)\r\n    return SZ_ERROR_PARAM;\r\n  p->props = *props;\r\n  Lzma2EncProps_Normalize(&p->props);\r\n  return SZ_OK;\r\n}\r\n\r\nByte Lzma2Enc_WriteProperties(CLzma2EncHandle pp)\r\n{\r\n  CLzma2Enc *p = (CLzma2Enc *)pp;\r\n  unsigned i;\r\n  UInt32 dicSize = LzmaEncProps_GetDictSize(&p->props.lzmaProps);\r\n  for (i = 0; i < 40; i++)\r\n    if (dicSize <= LZMA2_DIC_SIZE_FROM_PROP(i))\r\n      break;\r\n  return (Byte)i;\r\n}\r\n\r\nSRes Lzma2Enc_Encode(CLzma2EncHandle pp,\r\n    ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress)\r\n{\r\n  CLzma2Enc *p = (CLzma2Enc *)pp;\r\n  int i;\r\n\r\n  for (i = 0; i < p->props.numBlockThreads; i++)\r\n  {\r\n    CLzma2EncInt *t = &p->coders[i];\r\n    if (t->enc == NULL)\r\n    {\r\n      t->enc = LzmaEnc_Create(p->alloc);\r\n      if (t->enc == NULL)\r\n        return SZ_ERROR_MEM;\r\n    }\r\n  }\r\n\r\n  #ifndef _7ZIP_ST\r\n  if (p->props.numBlockThreads <= 1)\r\n  #endif\r\n    return Lzma2Enc_EncodeMt1(&p->coders[0], p, outStream, inStream, progress);\r\n\r\n  #ifndef _7ZIP_ST\r\n\r\n  {\r\n    CMtCallbackImp mtCallback;\r\n\r\n    mtCallback.funcTable.Code = MtCallbackImp_Code;\r\n    mtCallback.lzma2Enc = p;\r\n    \r\n    p->mtCoder.progress = progress;\r\n    p->mtCoder.inStream = inStream;\r\n    p->mtCoder.outStream = outStream;\r\n    p->mtCoder.alloc = p->alloc;\r\n    p->mtCoder.mtCallback = &mtCallback.funcTable;\r\n\r\n    p->mtCoder.blockSize = p->props.blockSize;\r\n    p->mtCoder.destBlockSize = p->props.blockSize + (p->props.blockSize >> 10) + 16;\r\n    p->mtCoder.numThreads = p->props.numBlockThreads;\r\n    \r\n    return MtCoder_Code(&p->mtCoder);\r\n  }\r\n  #endif\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/Lzma2Enc.h",
    "content": "/* Lzma2Enc.h -- LZMA2 Encoder\r\n2009-02-07 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __LZMA2_ENC_H\r\n#define __LZMA2_ENC_H\r\n\r\n#include \"LzmaEnc.h\"\r\n\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n#endif\r\n\r\ntypedef struct\r\n{\r\n  CLzmaEncProps lzmaProps;\r\n  size_t blockSize;\r\n  int numBlockThreads;\r\n  int numTotalThreads;\r\n} CLzma2EncProps;\r\n\r\nvoid Lzma2EncProps_Init(CLzma2EncProps *p);\r\nvoid Lzma2EncProps_Normalize(CLzma2EncProps *p);\r\n\r\n/* ---------- CLzmaEnc2Handle Interface ---------- */\r\n\r\n/* Lzma2Enc_* functions can return the following exit codes:\r\nReturns:\r\n  SZ_OK           - OK\r\n  SZ_ERROR_MEM    - Memory allocation error\r\n  SZ_ERROR_PARAM  - Incorrect paramater in props\r\n  SZ_ERROR_WRITE  - Write callback error\r\n  SZ_ERROR_PROGRESS - some break from progress callback\r\n  SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)\r\n*/\r\n\r\ntypedef void * CLzma2EncHandle;\r\n\r\nCLzma2EncHandle Lzma2Enc_Create(ISzAlloc *alloc, ISzAlloc *allocBig);\r\nvoid Lzma2Enc_Destroy(CLzma2EncHandle p);\r\nSRes Lzma2Enc_SetProps(CLzma2EncHandle p, const CLzma2EncProps *props);\r\nByte Lzma2Enc_WriteProperties(CLzma2EncHandle p);\r\nSRes Lzma2Enc_Encode(CLzma2EncHandle p,\r\n    ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress);\r\n\r\n/* ---------- One Call Interface ---------- */\r\n\r\n/* Lzma2Encode\r\nReturn code:\r\n  SZ_OK               - OK\r\n  SZ_ERROR_MEM        - Memory allocation error\r\n  SZ_ERROR_PARAM      - Incorrect paramater\r\n  SZ_ERROR_OUTPUT_EOF - output buffer overflow\r\n  SZ_ERROR_THREAD     - errors in multithreading functions (only for Mt version)\r\n*/\r\n\r\n/*\r\nSRes Lzma2Encode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,\r\n    const CLzmaEncProps *props, Byte *propsEncoded, int writeEndMark,\r\n    ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);\r\n*/\r\n\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/Lzma86.h",
    "content": "/* Lzma86.h -- LZMA + x86 (BCJ) Filter\r\n2009-08-14 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __LZMA86_H\r\n#define __LZMA86_H\r\n\r\n#include \"Types.h\"\r\n\r\nEXTERN_C_BEGIN\r\n\r\n#define LZMA86_SIZE_OFFSET (1 + 5)\r\n#define LZMA86_HEADER_SIZE (LZMA86_SIZE_OFFSET + 8)\r\n\r\n/*\r\nIt's an example for LZMA + x86 Filter use.\r\nYou can use .lzma86 extension, if you write that stream to file.\r\n.lzma86 header adds one additional byte to standard .lzma header.\r\n.lzma86 header (14 bytes):\r\n  Offset Size  Description\r\n    0     1    = 0 - no filter, pure LZMA\r\n               = 1 - x86 filter + LZMA\r\n    1     1    lc, lp and pb in encoded form\r\n    2     4    dictSize (little endian)\r\n    6     8    uncompressed size (little endian)\r\n\r\n\r\nLzma86_Encode\r\n-------------\r\nlevel - compression level: 0 <= level <= 9, the default value for \"level\" is 5.\r\n\r\ndictSize - The dictionary size in bytes. The maximum value is\r\n        128 MB = (1 << 27) bytes for 32-bit version\r\n          1 GB = (1 << 30) bytes for 64-bit version\r\n     The default value is 16 MB = (1 << 24) bytes, for level = 5.\r\n     It's recommended to use the dictionary that is larger than 4 KB and\r\n     that can be calculated as (1 << N) or (3 << N) sizes.\r\n     For better compression ratio dictSize must be >= inSize.\r\n\r\nfilterMode:\r\n    SZ_FILTER_NO   - no Filter\r\n    SZ_FILTER_YES  - x86 Filter\r\n    SZ_FILTER_AUTO - it tries both alternatives to select best.\r\n              Encoder will use 2 or 3 passes:\r\n              2 passes when FILTER_NO provides better compression.\r\n              3 passes when FILTER_YES provides better compression.\r\n\r\nLzma86Encode allocates Data with MyAlloc functions.\r\nRAM Requirements for compressing:\r\n  RamSize = dictionarySize * 11.5 + 6MB + FilterBlockSize\r\n      filterMode     FilterBlockSize\r\n     SZ_FILTER_NO         0\r\n     SZ_FILTER_YES      inSize\r\n     SZ_FILTER_AUTO     inSize\r\n\r\n\r\nReturn code:\r\n  SZ_OK               - OK\r\n  SZ_ERROR_MEM        - Memory allocation error\r\n  SZ_ERROR_PARAM      - Incorrect paramater\r\n  SZ_ERROR_OUTPUT_EOF - output buffer overflow\r\n  SZ_ERROR_THREAD     - errors in multithreading functions (only for Mt version)\r\n*/\r\n\r\nenum ESzFilterMode\r\n{\r\n  SZ_FILTER_NO,\r\n  SZ_FILTER_YES,\r\n  SZ_FILTER_AUTO\r\n};\r\n\r\nSRes Lzma86_Encode(Byte *dest, size_t *destLen, const Byte *src, size_t srcLen,\r\n    int level, UInt32 dictSize, int filterMode);\r\n\r\n\r\n/*\r\nLzma86_GetUnpackSize:\r\n  In:\r\n    src      - input data\r\n    srcLen   - input data size\r\n  Out:\r\n    unpackSize - size of uncompressed stream\r\n  Return code:\r\n    SZ_OK               - OK\r\n    SZ_ERROR_INPUT_EOF  - Error in headers\r\n*/\r\n\r\nSRes Lzma86_GetUnpackSize(const Byte *src, SizeT srcLen, UInt64 *unpackSize);\r\n\r\n/*\r\nLzma86_Decode:\r\n  In:\r\n    dest     - output data\r\n    destLen  - output data size\r\n    src      - input data\r\n    srcLen   - input data size\r\n  Out:\r\n    destLen  - processed output size\r\n    srcLen   - processed input size\r\n  Return code:\r\n    SZ_OK           - OK\r\n    SZ_ERROR_DATA  - Data error\r\n    SZ_ERROR_MEM   - Memory allocation error\r\n    SZ_ERROR_UNSUPPORTED - unsupported file\r\n    SZ_ERROR_INPUT_EOF - it needs more bytes in input buffer\r\n*/\r\n\r\nSRes Lzma86_Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen);\r\n\r\nEXTERN_C_END\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/Lzma86Dec.c",
    "content": "/* Lzma86Dec.c -- LZMA + x86 (BCJ) Filter Decoder\r\n2009-08-14 : Igor Pavlov : Public domain */\r\n\r\n#include \"Lzma86.h\"\r\n\r\n#include \"Alloc.h\"\r\n#include \"Bra.h\"\r\n#include \"LzmaDec.h\"\r\n\r\nstatic void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); }\r\nstatic void SzFree(void *p, void *address) { p = p; MyFree(address); }\r\n\r\nSRes Lzma86_GetUnpackSize(const Byte *src, SizeT srcLen, UInt64 *unpackSize)\r\n{\r\n  unsigned i;\r\n  if (srcLen < LZMA86_HEADER_SIZE)\r\n    return SZ_ERROR_INPUT_EOF;\r\n  *unpackSize = 0;\r\n  for (i = 0; i < sizeof(UInt64); i++)\r\n    *unpackSize += ((UInt64)src[LZMA86_SIZE_OFFSET + i]) << (8 * i);\r\n  return SZ_OK;\r\n}\r\n\r\nSRes Lzma86_Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen)\r\n{\r\n  ISzAlloc g_Alloc = { SzAlloc, SzFree };\r\n  SRes res;\r\n  int useFilter;\r\n  SizeT inSizePure;\r\n  ELzmaStatus status;\r\n\r\n  if (*srcLen < LZMA86_HEADER_SIZE)\r\n    return SZ_ERROR_INPUT_EOF;\r\n\r\n  useFilter = src[0];\r\n\r\n  if (useFilter > 1)\r\n  {\r\n    *destLen = 0;\r\n    return SZ_ERROR_UNSUPPORTED;\r\n  }\r\n\r\n  inSizePure = *srcLen - LZMA86_HEADER_SIZE;\r\n  res = LzmaDecode(dest, destLen, src + LZMA86_HEADER_SIZE, &inSizePure,\r\n      src + 1, LZMA_PROPS_SIZE, LZMA_FINISH_ANY, &status, &g_Alloc);\r\n  *srcLen = inSizePure + LZMA86_HEADER_SIZE;\r\n  if (res != SZ_OK)\r\n    return res;\r\n  if (useFilter == 1)\r\n  {\r\n    UInt32 x86State;\r\n    x86_Convert_Init(x86State);\r\n    x86_Convert(dest, *destLen, 0, &x86State, 0);\r\n  }\r\n  return SZ_OK;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/Lzma86Enc.c",
    "content": "/* Lzma86Enc.c -- LZMA + x86 (BCJ) Filter Encoder\r\n2009-08-14 : Igor Pavlov : Public domain */\r\n\r\n#include <string.h>\r\n\r\n#include \"Lzma86.h\"\r\n\r\n#include \"Alloc.h\"\r\n#include \"Bra.h\"\r\n#include \"LzmaEnc.h\"\r\n\r\n#define SZE_OUT_OVERFLOW SZE_DATA_ERROR\r\n\r\nstatic void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); }\r\nstatic void SzFree(void *p, void *address) { p = p; MyFree(address); }\r\n\r\nint Lzma86_Encode(Byte *dest, size_t *destLen, const Byte *src, size_t srcLen,\r\n    int level, UInt32 dictSize, int filterMode)\r\n{\r\n  ISzAlloc g_Alloc = { SzAlloc, SzFree };\r\n  size_t outSize2 = *destLen;\r\n  Byte *filteredStream;\r\n  Bool useFilter;\r\n  int mainResult = SZ_ERROR_OUTPUT_EOF;\r\n  CLzmaEncProps props;\r\n  LzmaEncProps_Init(&props);\r\n  props.level = level;\r\n  props.dictSize = dictSize;\r\n  \r\n  *destLen = 0;\r\n  if (outSize2 < LZMA86_HEADER_SIZE)\r\n    return SZ_ERROR_OUTPUT_EOF;\r\n\r\n  {\r\n    int i;\r\n    UInt64 t = srcLen;\r\n    for (i = 0; i < 8; i++, t >>= 8)\r\n      dest[LZMA86_SIZE_OFFSET + i] = (Byte)t;\r\n  }\r\n\r\n  filteredStream = 0;\r\n  useFilter = (filterMode != SZ_FILTER_NO);\r\n  if (useFilter)\r\n  {\r\n    if (srcLen != 0)\r\n    {\r\n      filteredStream = (Byte *)MyAlloc(srcLen);\r\n      if (filteredStream == 0)\r\n        return SZ_ERROR_MEM;\r\n      memcpy(filteredStream, src, srcLen);\r\n    }\r\n    {\r\n      UInt32 x86State;\r\n      x86_Convert_Init(x86State);\r\n      x86_Convert(filteredStream, srcLen, 0, &x86State, 1);\r\n    }\r\n  }\r\n\r\n  {\r\n    size_t minSize = 0;\r\n    Bool bestIsFiltered = False;\r\n\r\n    /* passes for SZ_FILTER_AUTO:\r\n        0 - BCJ + LZMA\r\n        1 - LZMA\r\n        2 - BCJ + LZMA agaian, if pass 0 (BCJ + LZMA) is better.\r\n    */\r\n    int numPasses = (filterMode == SZ_FILTER_AUTO) ? 3 : 1;\r\n\r\n    int i;\r\n    for (i = 0; i < numPasses; i++)\r\n    {\r\n      size_t outSizeProcessed = outSize2 - LZMA86_HEADER_SIZE;\r\n      size_t outPropsSize = 5;\r\n      SRes curRes;\r\n      Bool curModeIsFiltered = (numPasses > 1 && i == numPasses - 1);\r\n      if (curModeIsFiltered && !bestIsFiltered)\r\n        break;\r\n      if (useFilter && i == 0)\r\n        curModeIsFiltered = True;\r\n      \r\n      curRes = LzmaEncode(dest + LZMA86_HEADER_SIZE, &outSizeProcessed,\r\n          curModeIsFiltered ? filteredStream : src, srcLen,\r\n          &props, dest + 1, &outPropsSize, 0,\r\n          NULL, &g_Alloc, &g_Alloc);\r\n      \r\n      if (curRes != SZ_ERROR_OUTPUT_EOF)\r\n      {\r\n        if (curRes != SZ_OK)\r\n        {\r\n          mainResult = curRes;\r\n          break;\r\n        }\r\n        if (outSizeProcessed <= minSize || mainResult != SZ_OK)\r\n        {\r\n          minSize = outSizeProcessed;\r\n          bestIsFiltered = curModeIsFiltered;\r\n          mainResult = SZ_OK;\r\n        }\r\n      }\r\n    }\r\n    dest[0] = (bestIsFiltered ? 1 : 0);\r\n    *destLen = LZMA86_HEADER_SIZE + minSize;\r\n  }\r\n  if (useFilter)\r\n    MyFree(filteredStream);\r\n  return mainResult;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/LzmaDec.c",
    "content": "/* LzmaDec.c -- LZMA Decoder\r\n2010-12-15 : Igor Pavlov : Public domain */\r\n\r\n#include \"LzmaDec.h\"\r\n\r\n#include <string.h>\r\n\r\n#define kNumTopBits 24\r\n#define kTopValue ((UInt32)1 << kNumTopBits)\r\n\r\n#define kNumBitModelTotalBits 11\r\n#define kBitModelTotal (1 << kNumBitModelTotalBits)\r\n#define kNumMoveBits 5\r\n\r\n#define RC_INIT_SIZE 5\r\n\r\n#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); }\r\n\r\n#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)\r\n#define UPDATE_0(p) range = bound; *(p) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits));\r\n#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits));\r\n#define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \\\r\n  { UPDATE_0(p); i = (i + i); A0; } else \\\r\n  { UPDATE_1(p); i = (i + i) + 1; A1; }\r\n#define GET_BIT(p, i) GET_BIT2(p, i, ; , ;)\r\n\r\n#define TREE_GET_BIT(probs, i) { GET_BIT((probs + i), i); }\r\n#define TREE_DECODE(probs, limit, i) \\\r\n  { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; }\r\n\r\n/* #define _LZMA_SIZE_OPT */\r\n\r\n#ifdef _LZMA_SIZE_OPT\r\n#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i)\r\n#else\r\n#define TREE_6_DECODE(probs, i) \\\r\n  { i = 1; \\\r\n  TREE_GET_BIT(probs, i); \\\r\n  TREE_GET_BIT(probs, i); \\\r\n  TREE_GET_BIT(probs, i); \\\r\n  TREE_GET_BIT(probs, i); \\\r\n  TREE_GET_BIT(probs, i); \\\r\n  TREE_GET_BIT(probs, i); \\\r\n  i -= 0x40; }\r\n#endif\r\n\r\n#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); }\r\n\r\n#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)\r\n#define UPDATE_0_CHECK range = bound;\r\n#define UPDATE_1_CHECK range -= bound; code -= bound;\r\n#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \\\r\n  { UPDATE_0_CHECK; i = (i + i); A0; } else \\\r\n  { UPDATE_1_CHECK; i = (i + i) + 1; A1; }\r\n#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;)\r\n#define TREE_DECODE_CHECK(probs, limit, i) \\\r\n  { i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; }\r\n\r\n\r\n#define kNumPosBitsMax 4\r\n#define kNumPosStatesMax (1 << kNumPosBitsMax)\r\n\r\n#define kLenNumLowBits 3\r\n#define kLenNumLowSymbols (1 << kLenNumLowBits)\r\n#define kLenNumMidBits 3\r\n#define kLenNumMidSymbols (1 << kLenNumMidBits)\r\n#define kLenNumHighBits 8\r\n#define kLenNumHighSymbols (1 << kLenNumHighBits)\r\n\r\n#define LenChoice 0\r\n#define LenChoice2 (LenChoice + 1)\r\n#define LenLow (LenChoice2 + 1)\r\n#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))\r\n#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))\r\n#define kNumLenProbs (LenHigh + kLenNumHighSymbols)\r\n\r\n\r\n#define kNumStates 12\r\n#define kNumLitStates 7\r\n\r\n#define kStartPosModelIndex 4\r\n#define kEndPosModelIndex 14\r\n#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))\r\n\r\n#define kNumPosSlotBits 6\r\n#define kNumLenToPosStates 4\r\n\r\n#define kNumAlignBits 4\r\n#define kAlignTableSize (1 << kNumAlignBits)\r\n\r\n#define kMatchMinLen 2\r\n#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols)\r\n\r\n#define IsMatch 0\r\n#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax))\r\n#define IsRepG0 (IsRep + kNumStates)\r\n#define IsRepG1 (IsRepG0 + kNumStates)\r\n#define IsRepG2 (IsRepG1 + kNumStates)\r\n#define IsRep0Long (IsRepG2 + kNumStates)\r\n#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax))\r\n#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits))\r\n#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex)\r\n#define LenCoder (Align + kAlignTableSize)\r\n#define RepLenCoder (LenCoder + kNumLenProbs)\r\n#define Literal (RepLenCoder + kNumLenProbs)\r\n\r\n#define LZMA_BASE_SIZE 1846\r\n#define LZMA_LIT_SIZE 768\r\n\r\n#define LzmaProps_GetNumProbs(p) ((UInt32)LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((p)->lc + (p)->lp)))\r\n\r\n#if Literal != LZMA_BASE_SIZE\r\nStopCompilingDueBUG\r\n#endif\r\n\r\n#define LZMA_DIC_MIN (1 << 12)\r\n\r\n/* First LZMA-symbol is always decoded.\r\nAnd it decodes new LZMA-symbols while (buf < bufLimit), but \"buf\" is without last normalization\r\nOut:\r\n  Result:\r\n    SZ_OK - OK\r\n    SZ_ERROR_DATA - Error\r\n  p->remainLen:\r\n    < kMatchSpecLenStart : normal remain\r\n    = kMatchSpecLenStart : finished\r\n    = kMatchSpecLenStart + 1 : Flush marker\r\n    = kMatchSpecLenStart + 2 : State Init Marker\r\n*/\r\n\r\nstatic int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte *bufLimit)\r\n{\r\n  CLzmaProb *probs = p->probs;\r\n\r\n  unsigned state = p->state;\r\n  UInt32 rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3];\r\n  unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1;\r\n  unsigned lpMask = ((unsigned)1 << (p->prop.lp)) - 1;\r\n  unsigned lc = p->prop.lc;\r\n\r\n  Byte *dic = p->dic;\r\n  SizeT dicBufSize = p->dicBufSize;\r\n  SizeT dicPos = p->dicPos;\r\n  \r\n  UInt32 processedPos = p->processedPos;\r\n  UInt32 checkDicSize = p->checkDicSize;\r\n  unsigned len = 0;\r\n\r\n  const Byte *buf = p->buf;\r\n  UInt32 range = p->range;\r\n  UInt32 code = p->code;\r\n\r\n  do\r\n  {\r\n    CLzmaProb *prob;\r\n    UInt32 bound;\r\n    unsigned ttt;\r\n    unsigned posState = processedPos & pbMask;\r\n\r\n    prob = probs + IsMatch + (state << kNumPosBitsMax) + posState;\r\n    IF_BIT_0(prob)\r\n    {\r\n      unsigned symbol;\r\n      UPDATE_0(prob);\r\n      prob = probs + Literal;\r\n      if (checkDicSize != 0 || processedPos != 0)\r\n        prob += (LZMA_LIT_SIZE * (((processedPos & lpMask) << lc) +\r\n        (dic[(dicPos == 0 ? dicBufSize : dicPos) - 1] >> (8 - lc))));\r\n\r\n      if (state < kNumLitStates)\r\n      {\r\n        state -= (state < 4) ? state : 3;\r\n        symbol = 1;\r\n        do { GET_BIT(prob + symbol, symbol) } while (symbol < 0x100);\r\n      }\r\n      else\r\n      {\r\n        unsigned matchByte = p->dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];\r\n        unsigned offs = 0x100;\r\n        state -= (state < 10) ? 3 : 6;\r\n        symbol = 1;\r\n        do\r\n        {\r\n          unsigned bit;\r\n          CLzmaProb *probLit;\r\n          matchByte <<= 1;\r\n          bit = (matchByte & offs);\r\n          probLit = prob + offs + bit + symbol;\r\n          GET_BIT2(probLit, symbol, offs &= ~bit, offs &= bit)\r\n        }\r\n        while (symbol < 0x100);\r\n      }\r\n      dic[dicPos++] = (Byte)symbol;\r\n      processedPos++;\r\n      continue;\r\n    }\r\n    else\r\n    {\r\n      UPDATE_1(prob);\r\n      prob = probs + IsRep + state;\r\n      IF_BIT_0(prob)\r\n      {\r\n        UPDATE_0(prob);\r\n        state += kNumStates;\r\n        prob = probs + LenCoder;\r\n      }\r\n      else\r\n      {\r\n        UPDATE_1(prob);\r\n        if (checkDicSize == 0 && processedPos == 0)\r\n          return SZ_ERROR_DATA;\r\n        prob = probs + IsRepG0 + state;\r\n        IF_BIT_0(prob)\r\n        {\r\n          UPDATE_0(prob);\r\n          prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState;\r\n          IF_BIT_0(prob)\r\n          {\r\n            UPDATE_0(prob);\r\n            dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];\r\n            dicPos++;\r\n            processedPos++;\r\n            state = state < kNumLitStates ? 9 : 11;\r\n            continue;\r\n          }\r\n          UPDATE_1(prob);\r\n        }\r\n        else\r\n        {\r\n          UInt32 distance;\r\n          UPDATE_1(prob);\r\n          prob = probs + IsRepG1 + state;\r\n          IF_BIT_0(prob)\r\n          {\r\n            UPDATE_0(prob);\r\n            distance = rep1;\r\n          }\r\n          else\r\n          {\r\n            UPDATE_1(prob);\r\n            prob = probs + IsRepG2 + state;\r\n            IF_BIT_0(prob)\r\n            {\r\n              UPDATE_0(prob);\r\n              distance = rep2;\r\n            }\r\n            else\r\n            {\r\n              UPDATE_1(prob);\r\n              distance = rep3;\r\n              rep3 = rep2;\r\n            }\r\n            rep2 = rep1;\r\n          }\r\n          rep1 = rep0;\r\n          rep0 = distance;\r\n        }\r\n        state = state < kNumLitStates ? 8 : 11;\r\n        prob = probs + RepLenCoder;\r\n      }\r\n      {\r\n        unsigned limit, offset;\r\n        CLzmaProb *probLen = prob + LenChoice;\r\n        IF_BIT_0(probLen)\r\n        {\r\n          UPDATE_0(probLen);\r\n          probLen = prob + LenLow + (posState << kLenNumLowBits);\r\n          offset = 0;\r\n          limit = (1 << kLenNumLowBits);\r\n        }\r\n        else\r\n        {\r\n          UPDATE_1(probLen);\r\n          probLen = prob + LenChoice2;\r\n          IF_BIT_0(probLen)\r\n          {\r\n            UPDATE_0(probLen);\r\n            probLen = prob + LenMid + (posState << kLenNumMidBits);\r\n            offset = kLenNumLowSymbols;\r\n            limit = (1 << kLenNumMidBits);\r\n          }\r\n          else\r\n          {\r\n            UPDATE_1(probLen);\r\n            probLen = prob + LenHigh;\r\n            offset = kLenNumLowSymbols + kLenNumMidSymbols;\r\n            limit = (1 << kLenNumHighBits);\r\n          }\r\n        }\r\n        TREE_DECODE(probLen, limit, len);\r\n        len += offset;\r\n      }\r\n\r\n      if (state >= kNumStates)\r\n      {\r\n        UInt32 distance;\r\n        prob = probs + PosSlot +\r\n            ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits);\r\n        TREE_6_DECODE(prob, distance);\r\n        if (distance >= kStartPosModelIndex)\r\n        {\r\n          unsigned posSlot = (unsigned)distance;\r\n          int numDirectBits = (int)(((distance >> 1) - 1));\r\n          distance = (2 | (distance & 1));\r\n          if (posSlot < kEndPosModelIndex)\r\n          {\r\n            distance <<= numDirectBits;\r\n            prob = probs + SpecPos + distance - posSlot - 1;\r\n            {\r\n              UInt32 mask = 1;\r\n              unsigned i = 1;\r\n              do\r\n              {\r\n                GET_BIT2(prob + i, i, ; , distance |= mask);\r\n                mask <<= 1;\r\n              }\r\n              while (--numDirectBits != 0);\r\n            }\r\n          }\r\n          else\r\n          {\r\n            numDirectBits -= kNumAlignBits;\r\n            do\r\n            {\r\n              NORMALIZE\r\n              range >>= 1;\r\n              \r\n              {\r\n                UInt32 t;\r\n                code -= range;\r\n                t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */\r\n                distance = (distance << 1) + (t + 1);\r\n                code += range & t;\r\n              }\r\n              /*\r\n              distance <<= 1;\r\n              if (code >= range)\r\n              {\r\n                code -= range;\r\n                distance |= 1;\r\n              }\r\n              */\r\n            }\r\n            while (--numDirectBits != 0);\r\n            prob = probs + Align;\r\n            distance <<= kNumAlignBits;\r\n            {\r\n              unsigned i = 1;\r\n              GET_BIT2(prob + i, i, ; , distance |= 1);\r\n              GET_BIT2(prob + i, i, ; , distance |= 2);\r\n              GET_BIT2(prob + i, i, ; , distance |= 4);\r\n              GET_BIT2(prob + i, i, ; , distance |= 8);\r\n            }\r\n            if (distance == (UInt32)0xFFFFFFFF)\r\n            {\r\n              len += kMatchSpecLenStart;\r\n              state -= kNumStates;\r\n              break;\r\n            }\r\n          }\r\n        }\r\n        rep3 = rep2;\r\n        rep2 = rep1;\r\n        rep1 = rep0;\r\n        rep0 = distance + 1;\r\n        if (checkDicSize == 0)\r\n        {\r\n          if (distance >= processedPos)\r\n            return SZ_ERROR_DATA;\r\n        }\r\n        else if (distance >= checkDicSize)\r\n          return SZ_ERROR_DATA;\r\n        state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3;\r\n      }\r\n\r\n      len += kMatchMinLen;\r\n\r\n      if (limit == dicPos)\r\n        return SZ_ERROR_DATA;\r\n      {\r\n        SizeT rem = limit - dicPos;\r\n        unsigned curLen = ((rem < len) ? (unsigned)rem : len);\r\n        SizeT pos = (dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0);\r\n\r\n        processedPos += curLen;\r\n\r\n        len -= curLen;\r\n        if (pos + curLen <= dicBufSize)\r\n        {\r\n          Byte *dest = dic + dicPos;\r\n          ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos;\r\n          const Byte *lim = dest + curLen;\r\n          dicPos += curLen;\r\n          do\r\n            *(dest) = (Byte)*(dest + src);\r\n          while (++dest != lim);\r\n        }\r\n        else\r\n        {\r\n          do\r\n          {\r\n            dic[dicPos++] = dic[pos];\r\n            if (++pos == dicBufSize)\r\n              pos = 0;\r\n          }\r\n          while (--curLen != 0);\r\n        }\r\n      }\r\n    }\r\n  }\r\n  while (dicPos < limit && buf < bufLimit);\r\n  NORMALIZE;\r\n  p->buf = buf;\r\n  p->range = range;\r\n  p->code = code;\r\n  p->remainLen = len;\r\n  p->dicPos = dicPos;\r\n  p->processedPos = processedPos;\r\n  p->reps[0] = rep0;\r\n  p->reps[1] = rep1;\r\n  p->reps[2] = rep2;\r\n  p->reps[3] = rep3;\r\n  p->state = state;\r\n\r\n  return SZ_OK;\r\n}\r\n\r\nstatic void MY_FAST_CALL LzmaDec_WriteRem(CLzmaDec *p, SizeT limit)\r\n{\r\n  if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart)\r\n  {\r\n    Byte *dic = p->dic;\r\n    SizeT dicPos = p->dicPos;\r\n    SizeT dicBufSize = p->dicBufSize;\r\n    unsigned len = p->remainLen;\r\n    UInt32 rep0 = p->reps[0];\r\n    if (limit - dicPos < len)\r\n      len = (unsigned)(limit - dicPos);\r\n\r\n    if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len)\r\n      p->checkDicSize = p->prop.dicSize;\r\n\r\n    p->processedPos += len;\r\n    p->remainLen -= len;\r\n    while (len != 0)\r\n    {\r\n      len--;\r\n      dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];\r\n      dicPos++;\r\n    }\r\n    p->dicPos = dicPos;\r\n  }\r\n}\r\n\r\nstatic int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const Byte *bufLimit)\r\n{\r\n  do\r\n  {\r\n    SizeT limit2 = limit;\r\n    if (p->checkDicSize == 0)\r\n    {\r\n      UInt32 rem = p->prop.dicSize - p->processedPos;\r\n      if (limit - p->dicPos > rem)\r\n        limit2 = p->dicPos + rem;\r\n    }\r\n    RINOK(LzmaDec_DecodeReal(p, limit2, bufLimit));\r\n    if (p->processedPos >= p->prop.dicSize)\r\n      p->checkDicSize = p->prop.dicSize;\r\n    LzmaDec_WriteRem(p, limit);\r\n  }\r\n  while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart);\r\n\r\n  if (p->remainLen > kMatchSpecLenStart)\r\n  {\r\n    p->remainLen = kMatchSpecLenStart;\r\n  }\r\n  return 0;\r\n}\r\n\r\ntypedef enum\r\n{\r\n  DUMMY_ERROR, /* unexpected end of input stream */\r\n  DUMMY_LIT,\r\n  DUMMY_MATCH,\r\n  DUMMY_REP\r\n} ELzmaDummy;\r\n\r\nstatic ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inSize)\r\n{\r\n  UInt32 range = p->range;\r\n  UInt32 code = p->code;\r\n  const Byte *bufLimit = buf + inSize;\r\n  CLzmaProb *probs = p->probs;\r\n  unsigned state = p->state;\r\n  ELzmaDummy res;\r\n\r\n  {\r\n    CLzmaProb *prob;\r\n    UInt32 bound;\r\n    unsigned ttt;\r\n    unsigned posState = (p->processedPos) & ((1 << p->prop.pb) - 1);\r\n\r\n    prob = probs + IsMatch + (state << kNumPosBitsMax) + posState;\r\n    IF_BIT_0_CHECK(prob)\r\n    {\r\n      UPDATE_0_CHECK\r\n\r\n      /* if (bufLimit - buf >= 7) return DUMMY_LIT; */\r\n\r\n      prob = probs + Literal;\r\n      if (p->checkDicSize != 0 || p->processedPos != 0)\r\n        prob += (LZMA_LIT_SIZE *\r\n          ((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) +\r\n          (p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc))));\r\n\r\n      if (state < kNumLitStates)\r\n      {\r\n        unsigned symbol = 1;\r\n        do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100);\r\n      }\r\n      else\r\n      {\r\n        unsigned matchByte = p->dic[p->dicPos - p->reps[0] +\r\n            ((p->dicPos < p->reps[0]) ? p->dicBufSize : 0)];\r\n        unsigned offs = 0x100;\r\n        unsigned symbol = 1;\r\n        do\r\n        {\r\n          unsigned bit;\r\n          CLzmaProb *probLit;\r\n          matchByte <<= 1;\r\n          bit = (matchByte & offs);\r\n          probLit = prob + offs + bit + symbol;\r\n          GET_BIT2_CHECK(probLit, symbol, offs &= ~bit, offs &= bit)\r\n        }\r\n        while (symbol < 0x100);\r\n      }\r\n      res = DUMMY_LIT;\r\n    }\r\n    else\r\n    {\r\n      unsigned len;\r\n      UPDATE_1_CHECK;\r\n\r\n      prob = probs + IsRep + state;\r\n      IF_BIT_0_CHECK(prob)\r\n      {\r\n        UPDATE_0_CHECK;\r\n        state = 0;\r\n        prob = probs + LenCoder;\r\n        res = DUMMY_MATCH;\r\n      }\r\n      else\r\n      {\r\n        UPDATE_1_CHECK;\r\n        res = DUMMY_REP;\r\n        prob = probs + IsRepG0 + state;\r\n        IF_BIT_0_CHECK(prob)\r\n        {\r\n          UPDATE_0_CHECK;\r\n          prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState;\r\n          IF_BIT_0_CHECK(prob)\r\n          {\r\n            UPDATE_0_CHECK;\r\n            NORMALIZE_CHECK;\r\n            return DUMMY_REP;\r\n          }\r\n          else\r\n          {\r\n            UPDATE_1_CHECK;\r\n          }\r\n        }\r\n        else\r\n        {\r\n          UPDATE_1_CHECK;\r\n          prob = probs + IsRepG1 + state;\r\n          IF_BIT_0_CHECK(prob)\r\n          {\r\n            UPDATE_0_CHECK;\r\n          }\r\n          else\r\n          {\r\n            UPDATE_1_CHECK;\r\n            prob = probs + IsRepG2 + state;\r\n            IF_BIT_0_CHECK(prob)\r\n            {\r\n              UPDATE_0_CHECK;\r\n            }\r\n            else\r\n            {\r\n              UPDATE_1_CHECK;\r\n            }\r\n          }\r\n        }\r\n        state = kNumStates;\r\n        prob = probs + RepLenCoder;\r\n      }\r\n      {\r\n        unsigned limit, offset;\r\n        CLzmaProb *probLen = prob + LenChoice;\r\n        IF_BIT_0_CHECK(probLen)\r\n        {\r\n          UPDATE_0_CHECK;\r\n          probLen = prob + LenLow + (posState << kLenNumLowBits);\r\n          offset = 0;\r\n          limit = 1 << kLenNumLowBits;\r\n        }\r\n        else\r\n        {\r\n          UPDATE_1_CHECK;\r\n          probLen = prob + LenChoice2;\r\n          IF_BIT_0_CHECK(probLen)\r\n          {\r\n            UPDATE_0_CHECK;\r\n            probLen = prob + LenMid + (posState << kLenNumMidBits);\r\n            offset = kLenNumLowSymbols;\r\n            limit = 1 << kLenNumMidBits;\r\n          }\r\n          else\r\n          {\r\n            UPDATE_1_CHECK;\r\n            probLen = prob + LenHigh;\r\n            offset = kLenNumLowSymbols + kLenNumMidSymbols;\r\n            limit = 1 << kLenNumHighBits;\r\n          }\r\n        }\r\n        TREE_DECODE_CHECK(probLen, limit, len);\r\n        len += offset;\r\n      }\r\n\r\n      if (state < 4)\r\n      {\r\n        unsigned posSlot;\r\n        prob = probs + PosSlot +\r\n            ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<\r\n            kNumPosSlotBits);\r\n        TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot);\r\n        if (posSlot >= kStartPosModelIndex)\r\n        {\r\n          int numDirectBits = ((posSlot >> 1) - 1);\r\n\r\n          /* if (bufLimit - buf >= 8) return DUMMY_MATCH; */\r\n\r\n          if (posSlot < kEndPosModelIndex)\r\n          {\r\n            prob = probs + SpecPos + ((2 | (posSlot & 1)) << numDirectBits) - posSlot - 1;\r\n          }\r\n          else\r\n          {\r\n            numDirectBits -= kNumAlignBits;\r\n            do\r\n            {\r\n              NORMALIZE_CHECK\r\n              range >>= 1;\r\n              code -= range & (((code - range) >> 31) - 1);\r\n              /* if (code >= range) code -= range; */\r\n            }\r\n            while (--numDirectBits != 0);\r\n            prob = probs + Align;\r\n            numDirectBits = kNumAlignBits;\r\n          }\r\n          {\r\n            unsigned i = 1;\r\n            do\r\n            {\r\n              GET_BIT_CHECK(prob + i, i);\r\n            }\r\n            while (--numDirectBits != 0);\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n  NORMALIZE_CHECK;\r\n  return res;\r\n}\r\n\r\n\r\nstatic void LzmaDec_InitRc(CLzmaDec *p, const Byte *data)\r\n{\r\n  p->code = ((UInt32)data[1] << 24) | ((UInt32)data[2] << 16) | ((UInt32)data[3] << 8) | ((UInt32)data[4]);\r\n  p->range = 0xFFFFFFFF;\r\n  p->needFlush = 0;\r\n}\r\n\r\nvoid LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState)\r\n{\r\n  p->needFlush = 1;\r\n  p->remainLen = 0;\r\n  p->tempBufSize = 0;\r\n\r\n  if (initDic)\r\n  {\r\n    p->processedPos = 0;\r\n    p->checkDicSize = 0;\r\n    p->needInitState = 1;\r\n  }\r\n  if (initState)\r\n    p->needInitState = 1;\r\n}\r\n\r\nvoid LzmaDec_Init(CLzmaDec *p)\r\n{\r\n  p->dicPos = 0;\r\n  LzmaDec_InitDicAndState(p, True, True);\r\n}\r\n\r\nstatic void LzmaDec_InitStateReal(CLzmaDec *p)\r\n{\r\n  UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (p->prop.lc + p->prop.lp));\r\n  UInt32 i;\r\n  CLzmaProb *probs = p->probs;\r\n  for (i = 0; i < numProbs; i++)\r\n    probs[i] = kBitModelTotal >> 1;\r\n  p->reps[0] = p->reps[1] = p->reps[2] = p->reps[3] = 1;\r\n  p->state = 0;\r\n  p->needInitState = 0;\r\n}\r\n\r\nSRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen,\r\n    ELzmaFinishMode finishMode, ELzmaStatus *status)\r\n{\r\n  SizeT inSize = *srcLen;\r\n  (*srcLen) = 0;\r\n  LzmaDec_WriteRem(p, dicLimit);\r\n  \r\n  *status = LZMA_STATUS_NOT_SPECIFIED;\r\n\r\n  while (p->remainLen != kMatchSpecLenStart)\r\n  {\r\n      int checkEndMarkNow;\r\n\r\n      if (p->needFlush != 0)\r\n      {\r\n        for (; inSize > 0 && p->tempBufSize < RC_INIT_SIZE; (*srcLen)++, inSize--)\r\n          p->tempBuf[p->tempBufSize++] = *src++;\r\n        if (p->tempBufSize < RC_INIT_SIZE)\r\n        {\r\n          *status = LZMA_STATUS_NEEDS_MORE_INPUT;\r\n          return SZ_OK;\r\n        }\r\n        if (p->tempBuf[0] != 0)\r\n          return SZ_ERROR_DATA;\r\n\r\n        LzmaDec_InitRc(p, p->tempBuf);\r\n        p->tempBufSize = 0;\r\n      }\r\n\r\n      checkEndMarkNow = 0;\r\n      if (p->dicPos >= dicLimit)\r\n      {\r\n        if (p->remainLen == 0 && p->code == 0)\r\n        {\r\n          *status = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK;\r\n          return SZ_OK;\r\n        }\r\n        if (finishMode == LZMA_FINISH_ANY)\r\n        {\r\n          *status = LZMA_STATUS_NOT_FINISHED;\r\n          return SZ_OK;\r\n        }\r\n        if (p->remainLen != 0)\r\n        {\r\n          *status = LZMA_STATUS_NOT_FINISHED;\r\n          return SZ_ERROR_DATA;\r\n        }\r\n        checkEndMarkNow = 1;\r\n      }\r\n\r\n      if (p->needInitState)\r\n        LzmaDec_InitStateReal(p);\r\n  \r\n      if (p->tempBufSize == 0)\r\n      {\r\n        SizeT processed;\r\n        const Byte *bufLimit;\r\n        if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow)\r\n        {\r\n          int dummyRes = LzmaDec_TryDummy(p, src, inSize);\r\n          if (dummyRes == DUMMY_ERROR)\r\n          {\r\n            memcpy(p->tempBuf, src, inSize);\r\n            p->tempBufSize = (unsigned)inSize;\r\n            (*srcLen) += inSize;\r\n            *status = LZMA_STATUS_NEEDS_MORE_INPUT;\r\n            return SZ_OK;\r\n          }\r\n          if (checkEndMarkNow && dummyRes != DUMMY_MATCH)\r\n          {\r\n            *status = LZMA_STATUS_NOT_FINISHED;\r\n            return SZ_ERROR_DATA;\r\n          }\r\n          bufLimit = src;\r\n        }\r\n        else\r\n          bufLimit = src + inSize - LZMA_REQUIRED_INPUT_MAX;\r\n        p->buf = src;\r\n        if (LzmaDec_DecodeReal2(p, dicLimit, bufLimit) != 0)\r\n          return SZ_ERROR_DATA;\r\n        processed = (SizeT)(p->buf - src);\r\n        (*srcLen) += processed;\r\n        src += processed;\r\n        inSize -= processed;\r\n      }\r\n      else\r\n      {\r\n        unsigned rem = p->tempBufSize, lookAhead = 0;\r\n        while (rem < LZMA_REQUIRED_INPUT_MAX && lookAhead < inSize)\r\n          p->tempBuf[rem++] = src[lookAhead++];\r\n        p->tempBufSize = rem;\r\n        if (rem < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow)\r\n        {\r\n          int dummyRes = LzmaDec_TryDummy(p, p->tempBuf, rem);\r\n          if (dummyRes == DUMMY_ERROR)\r\n          {\r\n            (*srcLen) += lookAhead;\r\n            *status = LZMA_STATUS_NEEDS_MORE_INPUT;\r\n            return SZ_OK;\r\n          }\r\n          if (checkEndMarkNow && dummyRes != DUMMY_MATCH)\r\n          {\r\n            *status = LZMA_STATUS_NOT_FINISHED;\r\n            return SZ_ERROR_DATA;\r\n          }\r\n        }\r\n        p->buf = p->tempBuf;\r\n        if (LzmaDec_DecodeReal2(p, dicLimit, p->buf) != 0)\r\n          return SZ_ERROR_DATA;\r\n        lookAhead -= (rem - (unsigned)(p->buf - p->tempBuf));\r\n        (*srcLen) += lookAhead;\r\n        src += lookAhead;\r\n        inSize -= lookAhead;\r\n        p->tempBufSize = 0;\r\n      }\r\n  }\r\n  if (p->code == 0)\r\n    *status = LZMA_STATUS_FINISHED_WITH_MARK;\r\n  return (p->code == 0) ? SZ_OK : SZ_ERROR_DATA;\r\n}\r\n\r\nSRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)\r\n{\r\n  SizeT outSize = *destLen;\r\n  SizeT inSize = *srcLen;\r\n  *srcLen = *destLen = 0;\r\n  for (;;)\r\n  {\r\n    SizeT inSizeCur = inSize, outSizeCur, dicPos;\r\n    ELzmaFinishMode curFinishMode;\r\n    SRes res;\r\n    if (p->dicPos == p->dicBufSize)\r\n      p->dicPos = 0;\r\n    dicPos = p->dicPos;\r\n    if (outSize > p->dicBufSize - dicPos)\r\n    {\r\n      outSizeCur = p->dicBufSize;\r\n      curFinishMode = LZMA_FINISH_ANY;\r\n    }\r\n    else\r\n    {\r\n      outSizeCur = dicPos + outSize;\r\n      curFinishMode = finishMode;\r\n    }\r\n\r\n    res = LzmaDec_DecodeToDic(p, outSizeCur, src, &inSizeCur, curFinishMode, status);\r\n    src += inSizeCur;\r\n    inSize -= inSizeCur;\r\n    *srcLen += inSizeCur;\r\n    outSizeCur = p->dicPos - dicPos;\r\n    memcpy(dest, p->dic + dicPos, outSizeCur);\r\n    dest += outSizeCur;\r\n    outSize -= outSizeCur;\r\n    *destLen += outSizeCur;\r\n    if (res != 0)\r\n      return res;\r\n    if (outSizeCur == 0 || outSize == 0)\r\n      return SZ_OK;\r\n  }\r\n}\r\n\r\nvoid LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc)\r\n{\r\n  alloc->Free(alloc, p->probs);\r\n  p->probs = 0;\r\n}\r\n\r\nstatic void LzmaDec_FreeDict(CLzmaDec *p, ISzAlloc *alloc)\r\n{\r\n  alloc->Free(alloc, p->dic);\r\n  p->dic = 0;\r\n}\r\n\r\nvoid LzmaDec_Free(CLzmaDec *p, ISzAlloc *alloc)\r\n{\r\n  LzmaDec_FreeProbs(p, alloc);\r\n  LzmaDec_FreeDict(p, alloc);\r\n}\r\n\r\nSRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size)\r\n{\r\n  UInt32 dicSize;\r\n  Byte d;\r\n  \r\n  if (size < LZMA_PROPS_SIZE)\r\n    return SZ_ERROR_UNSUPPORTED;\r\n  else\r\n    dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24);\r\n \r\n  if (dicSize < LZMA_DIC_MIN)\r\n    dicSize = LZMA_DIC_MIN;\r\n  p->dicSize = dicSize;\r\n\r\n  d = data[0];\r\n  if (d >= (9 * 5 * 5))\r\n    return SZ_ERROR_UNSUPPORTED;\r\n\r\n  p->lc = d % 9;\r\n  d /= 9;\r\n  p->pb = d / 5;\r\n  p->lp = d % 5;\r\n\r\n  return SZ_OK;\r\n}\r\n\r\nstatic SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc)\r\n{\r\n  UInt32 numProbs = LzmaProps_GetNumProbs(propNew);\r\n  if (p->probs == 0 || numProbs != p->numProbs)\r\n  {\r\n    LzmaDec_FreeProbs(p, alloc);\r\n    p->probs = (CLzmaProb *)alloc->Alloc(alloc, numProbs * sizeof(CLzmaProb));\r\n    p->numProbs = numProbs;\r\n    if (p->probs == 0)\r\n      return SZ_ERROR_MEM;\r\n  }\r\n  return SZ_OK;\r\n}\r\n\r\nSRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc)\r\n{\r\n  CLzmaProps propNew;\r\n  RINOK(LzmaProps_Decode(&propNew, props, propsSize));\r\n  RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc));\r\n  p->prop = propNew;\r\n  return SZ_OK;\r\n}\r\n\r\nSRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc)\r\n{\r\n  CLzmaProps propNew;\r\n  SizeT dicBufSize;\r\n  RINOK(LzmaProps_Decode(&propNew, props, propsSize));\r\n  RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc));\r\n  dicBufSize = propNew.dicSize;\r\n  if (p->dic == 0 || dicBufSize != p->dicBufSize)\r\n  {\r\n    LzmaDec_FreeDict(p, alloc);\r\n    p->dic = (Byte *)alloc->Alloc(alloc, dicBufSize);\r\n    if (p->dic == 0)\r\n    {\r\n      LzmaDec_FreeProbs(p, alloc);\r\n      return SZ_ERROR_MEM;\r\n    }\r\n  }\r\n  p->dicBufSize = dicBufSize;\r\n  p->prop = propNew;\r\n  return SZ_OK;\r\n}\r\n\r\nSRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,\r\n    const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,\r\n    ELzmaStatus *status, ISzAlloc *alloc)\r\n{\r\n  CLzmaDec p;\r\n  SRes res;\r\n  SizeT outSize = *destLen, inSize = *srcLen;\r\n  *destLen = *srcLen = 0;\r\n  *status = LZMA_STATUS_NOT_SPECIFIED;\r\n  if (inSize < RC_INIT_SIZE)\r\n    return SZ_ERROR_INPUT_EOF;\r\n  LzmaDec_Construct(&p);\r\n  RINOK(LzmaDec_AllocateProbs(&p, propData, propSize, alloc));\r\n  p.dic = dest;\r\n  p.dicBufSize = outSize;\r\n  LzmaDec_Init(&p);\r\n  *srcLen = inSize;\r\n  res = LzmaDec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status);\r\n  *destLen = p.dicPos;\r\n  if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT)\r\n    res = SZ_ERROR_INPUT_EOF;\r\n  LzmaDec_FreeProbs(&p, alloc);\r\n  return res;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/LzmaDec.h",
    "content": "/* LzmaDec.h -- LZMA Decoder\r\n2009-02-07 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __LZMA_DEC_H\r\n#define __LZMA_DEC_H\r\n\r\n#include \"Types.h\"\r\n\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n#endif\r\n\r\n/* #define _LZMA_PROB32 */\r\n/* _LZMA_PROB32 can increase the speed on some CPUs,\r\n   but memory usage for CLzmaDec::probs will be doubled in that case */\r\n\r\n#ifdef _LZMA_PROB32\r\n#define CLzmaProb UInt32\r\n#else\r\n#define CLzmaProb UInt16\r\n#endif\r\n\r\n\r\n/* ---------- LZMA Properties ---------- */\r\n\r\n#define LZMA_PROPS_SIZE 5\r\n\r\ntypedef struct _CLzmaProps\r\n{\r\n  unsigned lc, lp, pb;\r\n  UInt32 dicSize;\r\n} CLzmaProps;\r\n\r\n/* LzmaProps_Decode - decodes properties\r\nReturns:\r\n  SZ_OK\r\n  SZ_ERROR_UNSUPPORTED - Unsupported properties\r\n*/\r\n\r\nSRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size);\r\n\r\n\r\n/* ---------- LZMA Decoder state ---------- */\r\n\r\n/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case.\r\n   Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */\r\n\r\n#define LZMA_REQUIRED_INPUT_MAX 20\r\n\r\ntypedef struct\r\n{\r\n  CLzmaProps prop;\r\n  CLzmaProb *probs;\r\n  Byte *dic;\r\n  const Byte *buf;\r\n  UInt32 range, code;\r\n  SizeT dicPos;\r\n  SizeT dicBufSize;\r\n  UInt32 processedPos;\r\n  UInt32 checkDicSize;\r\n  unsigned state;\r\n  UInt32 reps[4];\r\n  unsigned remainLen;\r\n  int needFlush;\r\n  int needInitState;\r\n  UInt32 numProbs;\r\n  unsigned tempBufSize;\r\n  Byte tempBuf[LZMA_REQUIRED_INPUT_MAX];\r\n} CLzmaDec;\r\n\r\n#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; }\r\n\r\nvoid LzmaDec_Init(CLzmaDec *p);\r\n\r\n/* There are two types of LZMA streams:\r\n     0) Stream with end mark. That end mark adds about 6 bytes to compressed size.\r\n     1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */\r\n\r\ntypedef enum\r\n{\r\n  LZMA_FINISH_ANY,   /* finish at any point */\r\n  LZMA_FINISH_END    /* block must be finished at the end */\r\n} ELzmaFinishMode;\r\n\r\n/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!!\r\n\r\n   You must use LZMA_FINISH_END, when you know that current output buffer\r\n   covers last bytes of block. In other cases you must use LZMA_FINISH_ANY.\r\n\r\n   If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK,\r\n   and output value of destLen will be less than output buffer size limit.\r\n   You can check status result also.\r\n\r\n   You can use multiple checks to test data integrity after full decompression:\r\n     1) Check Result and \"status\" variable.\r\n     2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize.\r\n     3) Check that output(srcLen) = compressedSize, if you know real compressedSize.\r\n        You must use correct finish mode in that case. */\r\n\r\ntypedef enum\r\n{\r\n  LZMA_STATUS_NOT_SPECIFIED,               /* use main error code instead */\r\n  LZMA_STATUS_FINISHED_WITH_MARK,          /* stream was finished with end mark. */\r\n  LZMA_STATUS_NOT_FINISHED,                /* stream was not finished */\r\n  LZMA_STATUS_NEEDS_MORE_INPUT,            /* you must provide more input bytes */\r\n  LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK  /* there is probability that stream was finished without end mark */\r\n} ELzmaStatus;\r\n\r\n/* ELzmaStatus is used only as output value for function call */\r\n\r\n\r\n/* ---------- Interfaces ---------- */\r\n\r\n/* There are 3 levels of interfaces:\r\n     1) Dictionary Interface\r\n     2) Buffer Interface\r\n     3) One Call Interface\r\n   You can select any of these interfaces, but don't mix functions from different\r\n   groups for same object. */\r\n\r\n\r\n/* There are two variants to allocate state for Dictionary Interface:\r\n     1) LzmaDec_Allocate / LzmaDec_Free\r\n     2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs\r\n   You can use variant 2, if you set dictionary buffer manually.\r\n   For Buffer Interface you must always use variant 1.\r\n\r\nLzmaDec_Allocate* can return:\r\n  SZ_OK\r\n  SZ_ERROR_MEM         - Memory allocation error\r\n  SZ_ERROR_UNSUPPORTED - Unsupported properties\r\n*/\r\n   \r\nSRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc);\r\nvoid LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc);\r\n\r\nSRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc);\r\nvoid LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc);\r\n\r\n/* ---------- Dictionary Interface ---------- */\r\n\r\n/* You can use it, if you want to eliminate the overhead for data copying from\r\n   dictionary to some other external buffer.\r\n   You must work with CLzmaDec variables directly in this interface.\r\n\r\n   STEPS:\r\n     LzmaDec_Constr()\r\n     LzmaDec_Allocate()\r\n     for (each new stream)\r\n     {\r\n       LzmaDec_Init()\r\n       while (it needs more decompression)\r\n       {\r\n         LzmaDec_DecodeToDic()\r\n         use data from CLzmaDec::dic and update CLzmaDec::dicPos\r\n       }\r\n     }\r\n     LzmaDec_Free()\r\n*/\r\n\r\n/* LzmaDec_DecodeToDic\r\n   \r\n   The decoding to internal dictionary buffer (CLzmaDec::dic).\r\n   You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!!\r\n\r\nfinishMode:\r\n  It has meaning only if the decoding reaches output limit (dicLimit).\r\n  LZMA_FINISH_ANY - Decode just dicLimit bytes.\r\n  LZMA_FINISH_END - Stream must be finished after dicLimit.\r\n\r\nReturns:\r\n  SZ_OK\r\n    status:\r\n      LZMA_STATUS_FINISHED_WITH_MARK\r\n      LZMA_STATUS_NOT_FINISHED\r\n      LZMA_STATUS_NEEDS_MORE_INPUT\r\n      LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK\r\n  SZ_ERROR_DATA - Data error\r\n*/\r\n\r\nSRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit,\r\n    const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);\r\n\r\n\r\n/* ---------- Buffer Interface ---------- */\r\n\r\n/* It's zlib-like interface.\r\n   See LzmaDec_DecodeToDic description for information about STEPS and return results,\r\n   but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need\r\n   to work with CLzmaDec variables manually.\r\n\r\nfinishMode:\r\n  It has meaning only if the decoding reaches output limit (*destLen).\r\n  LZMA_FINISH_ANY - Decode just destLen bytes.\r\n  LZMA_FINISH_END - Stream must be finished after (*destLen).\r\n*/\r\n\r\nSRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,\r\n    const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);\r\n\r\n\r\n/* ---------- One Call Interface ---------- */\r\n\r\n/* LzmaDecode\r\n\r\nfinishMode:\r\n  It has meaning only if the decoding reaches output limit (*destLen).\r\n  LZMA_FINISH_ANY - Decode just destLen bytes.\r\n  LZMA_FINISH_END - Stream must be finished after (*destLen).\r\n\r\nReturns:\r\n  SZ_OK\r\n    status:\r\n      LZMA_STATUS_FINISHED_WITH_MARK\r\n      LZMA_STATUS_NOT_FINISHED\r\n      LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK\r\n  SZ_ERROR_DATA - Data error\r\n  SZ_ERROR_MEM  - Memory allocation error\r\n  SZ_ERROR_UNSUPPORTED - Unsupported properties\r\n  SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).\r\n*/\r\n\r\nSRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,\r\n    const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,\r\n    ELzmaStatus *status, ISzAlloc *alloc);\r\n\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/LzmaEnc.c",
    "content": "/* LzmaEnc.c -- LZMA Encoder\r\n2011-01-27 : Igor Pavlov : Public domain */\r\n\r\n#include <string.h>\r\n\r\n/* #define SHOW_STAT */\r\n/* #define SHOW_STAT2 */\r\n\r\n#if defined(SHOW_STAT) || defined(SHOW_STAT2)\r\n#include <stdio.h>\r\n#endif\r\n\r\n#include \"LzmaEnc.h\"\r\n\r\n#include \"LzFind.h\"\r\n#ifndef _7ZIP_ST\r\n#include \"LzFindMt.h\"\r\n#endif\r\n\r\n#ifdef SHOW_STAT\r\nstatic int ttt = 0;\r\n#endif\r\n\r\n#define kBlockSizeMax ((1 << LZMA_NUM_BLOCK_SIZE_BITS) - 1)\r\n\r\n#define kBlockSize (9 << 10)\r\n#define kUnpackBlockSize (1 << 18)\r\n#define kMatchArraySize (1 << 21)\r\n#define kMatchRecordMaxSize ((LZMA_MATCH_LEN_MAX * 2 + 3) * LZMA_MATCH_LEN_MAX)\r\n\r\n#define kNumMaxDirectBits (31)\r\n\r\n#define kNumTopBits 24\r\n#define kTopValue ((UInt32)1 << kNumTopBits)\r\n\r\n#define kNumBitModelTotalBits 11\r\n#define kBitModelTotal (1 << kNumBitModelTotalBits)\r\n#define kNumMoveBits 5\r\n#define kProbInitValue (kBitModelTotal >> 1)\r\n\r\n#define kNumMoveReducingBits 4\r\n#define kNumBitPriceShiftBits 4\r\n#define kBitPrice (1 << kNumBitPriceShiftBits)\r\n\r\nvoid LzmaEncProps_Init(CLzmaEncProps *p)\r\n{\r\n  p->level = 5;\r\n  p->dictSize = p->mc = 0;\r\n  p->reduceSize = (UInt32)(Int32)-1;\r\n  p->lc = p->lp = p->pb = p->algo = p->fb = p->btMode = p->numHashBytes = p->numThreads = -1;\r\n  p->writeEndMark = 0;\r\n}\r\n\r\nvoid LzmaEncProps_Normalize(CLzmaEncProps *p)\r\n{\r\n  int level = p->level;\r\n  if (level < 0) level = 5;\r\n  p->level = level;\r\n  if (p->dictSize == 0) p->dictSize = (level <= 5 ? (1 << (level * 2 + 14)) : (level == 6 ? (1 << 25) : (1 << 26)));\r\n  if (p->dictSize > p->reduceSize)\r\n  {\r\n    unsigned i;\r\n    for (i = 15; i <= 30; i++)\r\n    {\r\n      if (p->reduceSize <= ((UInt32)2 << i)) { p->dictSize = ((UInt32)2 << i); break; }\r\n      if (p->reduceSize <= ((UInt32)3 << i)) { p->dictSize = ((UInt32)3 << i); break; }\r\n    }\r\n  }\r\n  if (p->lc < 0) p->lc = 3;\r\n  if (p->lp < 0) p->lp = 0;\r\n  if (p->pb < 0) p->pb = 2;\r\n  if (p->algo < 0) p->algo = (level < 5 ? 0 : 1);\r\n  if (p->fb < 0) p->fb = (level < 7 ? 32 : 64);\r\n  if (p->btMode < 0) p->btMode = (p->algo == 0 ? 0 : 1);\r\n  if (p->numHashBytes < 0) p->numHashBytes = 4;\r\n  if (p->mc == 0)  p->mc = (16 + (p->fb >> 1)) >> (p->btMode ? 0 : 1);\r\n  if (p->numThreads < 0)\r\n    p->numThreads =\r\n      #ifndef _7ZIP_ST\r\n      ((p->btMode && p->algo) ? 2 : 1);\r\n      #else\r\n      1;\r\n      #endif\r\n}\r\n\r\nUInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2)\r\n{\r\n  CLzmaEncProps props = *props2;\r\n  LzmaEncProps_Normalize(&props);\r\n  return props.dictSize;\r\n}\r\n\r\n/* #define LZMA_LOG_BSR */\r\n/* Define it for Intel's CPU */\r\n\r\n\r\n#ifdef LZMA_LOG_BSR\r\n\r\n#define kDicLogSizeMaxCompress 30\r\n\r\n#define BSR2_RET(pos, res) { unsigned long i; _BitScanReverse(&i, (pos)); res = (i + i) + ((pos >> (i - 1)) & 1); }\r\n\r\nUInt32 GetPosSlot1(UInt32 pos)\r\n{\r\n  UInt32 res;\r\n  BSR2_RET(pos, res);\r\n  return res;\r\n}\r\n#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); }\r\n#define GetPosSlot(pos, res) { if (pos < 2) res = pos; else BSR2_RET(pos, res); }\r\n\r\n#else\r\n\r\n#define kNumLogBits (9 + (int)sizeof(size_t) / 2)\r\n#define kDicLogSizeMaxCompress ((kNumLogBits - 1) * 2 + 7)\r\n\r\nvoid LzmaEnc_FastPosInit(Byte *g_FastPos)\r\n{\r\n  int c = 2, slotFast;\r\n  g_FastPos[0] = 0;\r\n  g_FastPos[1] = 1;\r\n  \r\n  for (slotFast = 2; slotFast < kNumLogBits * 2; slotFast++)\r\n  {\r\n    UInt32 k = (1 << ((slotFast >> 1) - 1));\r\n    UInt32 j;\r\n    for (j = 0; j < k; j++, c++)\r\n      g_FastPos[c] = (Byte)slotFast;\r\n  }\r\n}\r\n\r\n#define BSR2_RET(pos, res) { UInt32 i = 6 + ((kNumLogBits - 1) & \\\r\n  (0 - (((((UInt32)1 << (kNumLogBits + 6)) - 1) - pos) >> 31))); \\\r\n  res = p->g_FastPos[pos >> i] + (i * 2); }\r\n/*\r\n#define BSR2_RET(pos, res) { res = (pos < (1 << (kNumLogBits + 6))) ? \\\r\n  p->g_FastPos[pos >> 6] + 12 : \\\r\n  p->g_FastPos[pos >> (6 + kNumLogBits - 1)] + (6 + (kNumLogBits - 1)) * 2; }\r\n*/\r\n\r\n#define GetPosSlot1(pos) p->g_FastPos[pos]\r\n#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); }\r\n#define GetPosSlot(pos, res) { if (pos < kNumFullDistances) res = p->g_FastPos[pos]; else BSR2_RET(pos, res); }\r\n\r\n#endif\r\n\r\n\r\n#define LZMA_NUM_REPS 4\r\n\r\ntypedef unsigned CState;\r\n\r\ntypedef struct\r\n{\r\n  UInt32 price;\r\n\r\n  CState state;\r\n  int prev1IsChar;\r\n  int prev2;\r\n\r\n  UInt32 posPrev2;\r\n  UInt32 backPrev2;\r\n\r\n  UInt32 posPrev;\r\n  UInt32 backPrev;\r\n  UInt32 backs[LZMA_NUM_REPS];\r\n} COptimal;\r\n\r\n#define kNumOpts (1 << 12)\r\n\r\n#define kNumLenToPosStates 4\r\n#define kNumPosSlotBits 6\r\n#define kDicLogSizeMin 0\r\n#define kDicLogSizeMax 32\r\n#define kDistTableSizeMax (kDicLogSizeMax * 2)\r\n\r\n\r\n#define kNumAlignBits 4\r\n#define kAlignTableSize (1 << kNumAlignBits)\r\n#define kAlignMask (kAlignTableSize - 1)\r\n\r\n#define kStartPosModelIndex 4\r\n#define kEndPosModelIndex 14\r\n#define kNumPosModels (kEndPosModelIndex - kStartPosModelIndex)\r\n\r\n#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))\r\n\r\n#ifdef _LZMA_PROB32\r\n#define CLzmaProb UInt32\r\n#else\r\n#define CLzmaProb UInt16\r\n#endif\r\n\r\n#define LZMA_PB_MAX 4\r\n#define LZMA_LC_MAX 8\r\n#define LZMA_LP_MAX 4\r\n\r\n#define LZMA_NUM_PB_STATES_MAX (1 << LZMA_PB_MAX)\r\n\r\n\r\n#define kLenNumLowBits 3\r\n#define kLenNumLowSymbols (1 << kLenNumLowBits)\r\n#define kLenNumMidBits 3\r\n#define kLenNumMidSymbols (1 << kLenNumMidBits)\r\n#define kLenNumHighBits 8\r\n#define kLenNumHighSymbols (1 << kLenNumHighBits)\r\n\r\n#define kLenNumSymbolsTotal (kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols)\r\n\r\n#define LZMA_MATCH_LEN_MIN 2\r\n#define LZMA_MATCH_LEN_MAX (LZMA_MATCH_LEN_MIN + kLenNumSymbolsTotal - 1)\r\n\r\n#define kNumStates 12\r\n\r\ntypedef struct\r\n{\r\n  CLzmaProb choice;\r\n  CLzmaProb choice2;\r\n  CLzmaProb low[LZMA_NUM_PB_STATES_MAX << kLenNumLowBits];\r\n  CLzmaProb mid[LZMA_NUM_PB_STATES_MAX << kLenNumMidBits];\r\n  CLzmaProb high[kLenNumHighSymbols];\r\n} CLenEnc;\r\n\r\ntypedef struct\r\n{\r\n  CLenEnc p;\r\n  UInt32 prices[LZMA_NUM_PB_STATES_MAX][kLenNumSymbolsTotal];\r\n  UInt32 tableSize;\r\n  UInt32 counters[LZMA_NUM_PB_STATES_MAX];\r\n} CLenPriceEnc;\r\n\r\ntypedef struct\r\n{\r\n  UInt32 range;\r\n  Byte cache;\r\n  UInt64 low;\r\n  UInt64 cacheSize;\r\n  Byte *buf;\r\n  Byte *bufLim;\r\n  Byte *bufBase;\r\n  ISeqOutStream *outStream;\r\n  UInt64 processed;\r\n  SRes res;\r\n} CRangeEnc;\r\n\r\ntypedef struct\r\n{\r\n  CLzmaProb *litProbs;\r\n\r\n  CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX];\r\n  CLzmaProb isRep[kNumStates];\r\n  CLzmaProb isRepG0[kNumStates];\r\n  CLzmaProb isRepG1[kNumStates];\r\n  CLzmaProb isRepG2[kNumStates];\r\n  CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX];\r\n\r\n  CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits];\r\n  CLzmaProb posEncoders[kNumFullDistances - kEndPosModelIndex];\r\n  CLzmaProb posAlignEncoder[1 << kNumAlignBits];\r\n  \r\n  CLenPriceEnc lenEnc;\r\n  CLenPriceEnc repLenEnc;\r\n\r\n  UInt32 reps[LZMA_NUM_REPS];\r\n  UInt32 state;\r\n} CSaveState;\r\n\r\ntypedef struct\r\n{\r\n  IMatchFinder matchFinder;\r\n  void *matchFinderObj;\r\n\r\n  #ifndef _7ZIP_ST\r\n  Bool mtMode;\r\n  CMatchFinderMt matchFinderMt;\r\n  #endif\r\n\r\n  CMatchFinder matchFinderBase;\r\n\r\n  #ifndef _7ZIP_ST\r\n  Byte pad[128];\r\n  #endif\r\n  \r\n  UInt32 optimumEndIndex;\r\n  UInt32 optimumCurrentIndex;\r\n\r\n  UInt32 longestMatchLength;\r\n  UInt32 numPairs;\r\n  UInt32 numAvail;\r\n  COptimal opt[kNumOpts];\r\n  \r\n  #ifndef LZMA_LOG_BSR\r\n  Byte g_FastPos[1 << kNumLogBits];\r\n  #endif\r\n\r\n  UInt32 ProbPrices[kBitModelTotal >> kNumMoveReducingBits];\r\n  UInt32 matches[LZMA_MATCH_LEN_MAX * 2 + 2 + 1];\r\n  UInt32 numFastBytes;\r\n  UInt32 additionalOffset;\r\n  UInt32 reps[LZMA_NUM_REPS];\r\n  UInt32 state;\r\n\r\n  UInt32 posSlotPrices[kNumLenToPosStates][kDistTableSizeMax];\r\n  UInt32 distancesPrices[kNumLenToPosStates][kNumFullDistances];\r\n  UInt32 alignPrices[kAlignTableSize];\r\n  UInt32 alignPriceCount;\r\n\r\n  UInt32 distTableSize;\r\n\r\n  unsigned lc, lp, pb;\r\n  unsigned lpMask, pbMask;\r\n\r\n  CLzmaProb *litProbs;\r\n\r\n  CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX];\r\n  CLzmaProb isRep[kNumStates];\r\n  CLzmaProb isRepG0[kNumStates];\r\n  CLzmaProb isRepG1[kNumStates];\r\n  CLzmaProb isRepG2[kNumStates];\r\n  CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX];\r\n\r\n  CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits];\r\n  CLzmaProb posEncoders[kNumFullDistances - kEndPosModelIndex];\r\n  CLzmaProb posAlignEncoder[1 << kNumAlignBits];\r\n  \r\n  CLenPriceEnc lenEnc;\r\n  CLenPriceEnc repLenEnc;\r\n\r\n  unsigned lclp;\r\n\r\n  Bool fastMode;\r\n  \r\n  CRangeEnc rc;\r\n\r\n  Bool writeEndMark;\r\n  UInt64 nowPos64;\r\n  UInt32 matchPriceCount;\r\n  Bool finished;\r\n  Bool multiThread;\r\n\r\n  SRes result;\r\n  UInt32 dictSize;\r\n\r\n  int needInit;\r\n\r\n  CSaveState saveState;\r\n} CLzmaEnc;\r\n\r\nvoid LzmaEnc_SaveState(CLzmaEncHandle pp)\r\n{\r\n  CLzmaEnc *p = (CLzmaEnc *)pp;\r\n  CSaveState *dest = &p->saveState;\r\n  int i;\r\n  dest->lenEnc = p->lenEnc;\r\n  dest->repLenEnc = p->repLenEnc;\r\n  dest->state = p->state;\r\n\r\n  for (i = 0; i < kNumStates; i++)\r\n  {\r\n    memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i]));\r\n    memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i]));\r\n  }\r\n  for (i = 0; i < kNumLenToPosStates; i++)\r\n    memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i]));\r\n  memcpy(dest->isRep, p->isRep, sizeof(p->isRep));\r\n  memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0));\r\n  memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1));\r\n  memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2));\r\n  memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders));\r\n  memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder));\r\n  memcpy(dest->reps, p->reps, sizeof(p->reps));\r\n  memcpy(dest->litProbs, p->litProbs, (0x300 << p->lclp) * sizeof(CLzmaProb));\r\n}\r\n\r\nvoid LzmaEnc_RestoreState(CLzmaEncHandle pp)\r\n{\r\n  CLzmaEnc *dest = (CLzmaEnc *)pp;\r\n  const CSaveState *p = &dest->saveState;\r\n  int i;\r\n  dest->lenEnc = p->lenEnc;\r\n  dest->repLenEnc = p->repLenEnc;\r\n  dest->state = p->state;\r\n\r\n  for (i = 0; i < kNumStates; i++)\r\n  {\r\n    memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i]));\r\n    memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i]));\r\n  }\r\n  for (i = 0; i < kNumLenToPosStates; i++)\r\n    memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i]));\r\n  memcpy(dest->isRep, p->isRep, sizeof(p->isRep));\r\n  memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0));\r\n  memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1));\r\n  memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2));\r\n  memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders));\r\n  memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder));\r\n  memcpy(dest->reps, p->reps, sizeof(p->reps));\r\n  memcpy(dest->litProbs, p->litProbs, (0x300 << dest->lclp) * sizeof(CLzmaProb));\r\n}\r\n\r\nSRes LzmaEnc_SetProps(CLzmaEncHandle pp, const CLzmaEncProps *props2)\r\n{\r\n  CLzmaEnc *p = (CLzmaEnc *)pp;\r\n  CLzmaEncProps props = *props2;\r\n  LzmaEncProps_Normalize(&props);\r\n\r\n  if (props.lc > LZMA_LC_MAX || props.lp > LZMA_LP_MAX || props.pb > LZMA_PB_MAX ||\r\n      props.dictSize > ((UInt32)1 << kDicLogSizeMaxCompress) || props.dictSize > ((UInt32)1 << 30))\r\n    return SZ_ERROR_PARAM;\r\n  p->dictSize = props.dictSize;\r\n  {\r\n    unsigned fb = props.fb;\r\n    if (fb < 5)\r\n      fb = 5;\r\n    if (fb > LZMA_MATCH_LEN_MAX)\r\n      fb = LZMA_MATCH_LEN_MAX;\r\n    p->numFastBytes = fb;\r\n  }\r\n  p->lc = props.lc;\r\n  p->lp = props.lp;\r\n  p->pb = props.pb;\r\n  p->fastMode = (props.algo == 0);\r\n  p->matchFinderBase.btMode = props.btMode;\r\n  {\r\n    UInt32 numHashBytes = 4;\r\n    if (props.btMode)\r\n    {\r\n      if (props.numHashBytes < 2)\r\n        numHashBytes = 2;\r\n      else if (props.numHashBytes < 4)\r\n        numHashBytes = props.numHashBytes;\r\n    }\r\n    p->matchFinderBase.numHashBytes = numHashBytes;\r\n  }\r\n\r\n  p->matchFinderBase.cutValue = props.mc;\r\n\r\n  p->writeEndMark = props.writeEndMark;\r\n\r\n  #ifndef _7ZIP_ST\r\n  /*\r\n  if (newMultiThread != _multiThread)\r\n  {\r\n    ReleaseMatchFinder();\r\n    _multiThread = newMultiThread;\r\n  }\r\n  */\r\n  p->multiThread = (props.numThreads > 1);\r\n  #endif\r\n\r\n  return SZ_OK;\r\n}\r\n\r\nstatic const int kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4,  5,  6,   4, 5};\r\nstatic const int kMatchNextStates[kNumStates]   = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10};\r\nstatic const int kRepNextStates[kNumStates]     = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11};\r\nstatic const int kShortRepNextStates[kNumStates]= {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11};\r\n\r\n#define IsCharState(s) ((s) < 7)\r\n\r\n#define GetLenToPosState(len) (((len) < kNumLenToPosStates + 1) ? (len) - 2 : kNumLenToPosStates - 1)\r\n\r\n#define kInfinityPrice (1 << 30)\r\n\r\nstatic void RangeEnc_Construct(CRangeEnc *p)\r\n{\r\n  p->outStream = 0;\r\n  p->bufBase = 0;\r\n}\r\n\r\n#define RangeEnc_GetProcessed(p) ((p)->processed + ((p)->buf - (p)->bufBase) + (p)->cacheSize)\r\n\r\n#define RC_BUF_SIZE (1 << 16)\r\nstatic int RangeEnc_Alloc(CRangeEnc *p, ISzAlloc *alloc)\r\n{\r\n  if (p->bufBase == 0)\r\n  {\r\n    p->bufBase = (Byte *)alloc->Alloc(alloc, RC_BUF_SIZE);\r\n    if (p->bufBase == 0)\r\n      return 0;\r\n    p->bufLim = p->bufBase + RC_BUF_SIZE;\r\n  }\r\n  return 1;\r\n}\r\n\r\nstatic void RangeEnc_Free(CRangeEnc *p, ISzAlloc *alloc)\r\n{\r\n  alloc->Free(alloc, p->bufBase);\r\n  p->bufBase = 0;\r\n}\r\n\r\nstatic void RangeEnc_Init(CRangeEnc *p)\r\n{\r\n  /* Stream.Init(); */\r\n  p->low = 0;\r\n  p->range = 0xFFFFFFFF;\r\n  p->cacheSize = 1;\r\n  p->cache = 0;\r\n\r\n  p->buf = p->bufBase;\r\n\r\n  p->processed = 0;\r\n  p->res = SZ_OK;\r\n}\r\n\r\nstatic void RangeEnc_FlushStream(CRangeEnc *p)\r\n{\r\n  size_t num;\r\n  if (p->res != SZ_OK)\r\n    return;\r\n  num = p->buf - p->bufBase;\r\n  if (num != p->outStream->Write(p->outStream, p->bufBase, num))\r\n    p->res = SZ_ERROR_WRITE;\r\n  p->processed += num;\r\n  p->buf = p->bufBase;\r\n}\r\n\r\nstatic void MY_FAST_CALL RangeEnc_ShiftLow(CRangeEnc *p)\r\n{\r\n  if ((UInt32)p->low < (UInt32)0xFF000000 || (int)(p->low >> 32) != 0)\r\n  {\r\n    Byte temp = p->cache;\r\n    do\r\n    {\r\n      Byte *buf = p->buf;\r\n      *buf++ = (Byte)(temp + (Byte)(p->low >> 32));\r\n      p->buf = buf;\r\n      if (buf == p->bufLim)\r\n        RangeEnc_FlushStream(p);\r\n      temp = 0xFF;\r\n    }\r\n    while (--p->cacheSize != 0);\r\n    p->cache = (Byte)((UInt32)p->low >> 24);\r\n  }\r\n  p->cacheSize++;\r\n  p->low = (UInt32)p->low << 8;\r\n}\r\n\r\nstatic void RangeEnc_FlushData(CRangeEnc *p)\r\n{\r\n  int i;\r\n  for (i = 0; i < 5; i++)\r\n    RangeEnc_ShiftLow(p);\r\n}\r\n\r\nstatic void RangeEnc_EncodeDirectBits(CRangeEnc *p, UInt32 value, int numBits)\r\n{\r\n  do\r\n  {\r\n    p->range >>= 1;\r\n    p->low += p->range & (0 - ((value >> --numBits) & 1));\r\n    if (p->range < kTopValue)\r\n    {\r\n      p->range <<= 8;\r\n      RangeEnc_ShiftLow(p);\r\n    }\r\n  }\r\n  while (numBits != 0);\r\n}\r\n\r\nstatic void RangeEnc_EncodeBit(CRangeEnc *p, CLzmaProb *prob, UInt32 symbol)\r\n{\r\n  UInt32 ttt = *prob;\r\n  UInt32 newBound = (p->range >> kNumBitModelTotalBits) * ttt;\r\n  if (symbol == 0)\r\n  {\r\n    p->range = newBound;\r\n    ttt += (kBitModelTotal - ttt) >> kNumMoveBits;\r\n  }\r\n  else\r\n  {\r\n    p->low += newBound;\r\n    p->range -= newBound;\r\n    ttt -= ttt >> kNumMoveBits;\r\n  }\r\n  *prob = (CLzmaProb)ttt;\r\n  if (p->range < kTopValue)\r\n  {\r\n    p->range <<= 8;\r\n    RangeEnc_ShiftLow(p);\r\n  }\r\n}\r\n\r\nstatic void LitEnc_Encode(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol)\r\n{\r\n  symbol |= 0x100;\r\n  do\r\n  {\r\n    RangeEnc_EncodeBit(p, probs + (symbol >> 8), (symbol >> 7) & 1);\r\n    symbol <<= 1;\r\n  }\r\n  while (symbol < 0x10000);\r\n}\r\n\r\nstatic void LitEnc_EncodeMatched(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol, UInt32 matchByte)\r\n{\r\n  UInt32 offs = 0x100;\r\n  symbol |= 0x100;\r\n  do\r\n  {\r\n    matchByte <<= 1;\r\n    RangeEnc_EncodeBit(p, probs + (offs + (matchByte & offs) + (symbol >> 8)), (symbol >> 7) & 1);\r\n    symbol <<= 1;\r\n    offs &= ~(matchByte ^ symbol);\r\n  }\r\n  while (symbol < 0x10000);\r\n}\r\n\r\nvoid LzmaEnc_InitPriceTables(UInt32 *ProbPrices)\r\n{\r\n  UInt32 i;\r\n  for (i = (1 << kNumMoveReducingBits) / 2; i < kBitModelTotal; i += (1 << kNumMoveReducingBits))\r\n  {\r\n    const int kCyclesBits = kNumBitPriceShiftBits;\r\n    UInt32 w = i;\r\n    UInt32 bitCount = 0;\r\n    int j;\r\n    for (j = 0; j < kCyclesBits; j++)\r\n    {\r\n      w = w * w;\r\n      bitCount <<= 1;\r\n      while (w >= ((UInt32)1 << 16))\r\n      {\r\n        w >>= 1;\r\n        bitCount++;\r\n      }\r\n    }\r\n    ProbPrices[i >> kNumMoveReducingBits] = ((kNumBitModelTotalBits << kCyclesBits) - 15 - bitCount);\r\n  }\r\n}\r\n\r\n\r\n#define GET_PRICE(prob, symbol) \\\r\n  p->ProbPrices[((prob) ^ (((-(int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits];\r\n\r\n#define GET_PRICEa(prob, symbol) \\\r\n  ProbPrices[((prob) ^ ((-((int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits];\r\n\r\n#define GET_PRICE_0(prob) p->ProbPrices[(prob) >> kNumMoveReducingBits]\r\n#define GET_PRICE_1(prob) p->ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits]\r\n\r\n#define GET_PRICE_0a(prob) ProbPrices[(prob) >> kNumMoveReducingBits]\r\n#define GET_PRICE_1a(prob) ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits]\r\n\r\nstatic UInt32 LitEnc_GetPrice(const CLzmaProb *probs, UInt32 symbol, UInt32 *ProbPrices)\r\n{\r\n  UInt32 price = 0;\r\n  symbol |= 0x100;\r\n  do\r\n  {\r\n    price += GET_PRICEa(probs[symbol >> 8], (symbol >> 7) & 1);\r\n    symbol <<= 1;\r\n  }\r\n  while (symbol < 0x10000);\r\n  return price;\r\n}\r\n\r\nstatic UInt32 LitEnc_GetPriceMatched(const CLzmaProb *probs, UInt32 symbol, UInt32 matchByte, UInt32 *ProbPrices)\r\n{\r\n  UInt32 price = 0;\r\n  UInt32 offs = 0x100;\r\n  symbol |= 0x100;\r\n  do\r\n  {\r\n    matchByte <<= 1;\r\n    price += GET_PRICEa(probs[offs + (matchByte & offs) + (symbol >> 8)], (symbol >> 7) & 1);\r\n    symbol <<= 1;\r\n    offs &= ~(matchByte ^ symbol);\r\n  }\r\n  while (symbol < 0x10000);\r\n  return price;\r\n}\r\n\r\n\r\nstatic void RcTree_Encode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol)\r\n{\r\n  UInt32 m = 1;\r\n  int i;\r\n  for (i = numBitLevels; i != 0;)\r\n  {\r\n    UInt32 bit;\r\n    i--;\r\n    bit = (symbol >> i) & 1;\r\n    RangeEnc_EncodeBit(rc, probs + m, bit);\r\n    m = (m << 1) | bit;\r\n  }\r\n}\r\n\r\nstatic void RcTree_ReverseEncode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol)\r\n{\r\n  UInt32 m = 1;\r\n  int i;\r\n  for (i = 0; i < numBitLevels; i++)\r\n  {\r\n    UInt32 bit = symbol & 1;\r\n    RangeEnc_EncodeBit(rc, probs + m, bit);\r\n    m = (m << 1) | bit;\r\n    symbol >>= 1;\r\n  }\r\n}\r\n\r\nstatic UInt32 RcTree_GetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices)\r\n{\r\n  UInt32 price = 0;\r\n  symbol |= (1 << numBitLevels);\r\n  while (symbol != 1)\r\n  {\r\n    price += GET_PRICEa(probs[symbol >> 1], symbol & 1);\r\n    symbol >>= 1;\r\n  }\r\n  return price;\r\n}\r\n\r\nstatic UInt32 RcTree_ReverseGetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices)\r\n{\r\n  UInt32 price = 0;\r\n  UInt32 m = 1;\r\n  int i;\r\n  for (i = numBitLevels; i != 0; i--)\r\n  {\r\n    UInt32 bit = symbol & 1;\r\n    symbol >>= 1;\r\n    price += GET_PRICEa(probs[m], bit);\r\n    m = (m << 1) | bit;\r\n  }\r\n  return price;\r\n}\r\n\r\n\r\nstatic void LenEnc_Init(CLenEnc *p)\r\n{\r\n  unsigned i;\r\n  p->choice = p->choice2 = kProbInitValue;\r\n  for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << kLenNumLowBits); i++)\r\n    p->low[i] = kProbInitValue;\r\n  for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << kLenNumMidBits); i++)\r\n    p->mid[i] = kProbInitValue;\r\n  for (i = 0; i < kLenNumHighSymbols; i++)\r\n    p->high[i] = kProbInitValue;\r\n}\r\n\r\nstatic void LenEnc_Encode(CLenEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState)\r\n{\r\n  if (symbol < kLenNumLowSymbols)\r\n  {\r\n    RangeEnc_EncodeBit(rc, &p->choice, 0);\r\n    RcTree_Encode(rc, p->low + (posState << kLenNumLowBits), kLenNumLowBits, symbol);\r\n  }\r\n  else\r\n  {\r\n    RangeEnc_EncodeBit(rc, &p->choice, 1);\r\n    if (symbol < kLenNumLowSymbols + kLenNumMidSymbols)\r\n    {\r\n      RangeEnc_EncodeBit(rc, &p->choice2, 0);\r\n      RcTree_Encode(rc, p->mid + (posState << kLenNumMidBits), kLenNumMidBits, symbol - kLenNumLowSymbols);\r\n    }\r\n    else\r\n    {\r\n      RangeEnc_EncodeBit(rc, &p->choice2, 1);\r\n      RcTree_Encode(rc, p->high, kLenNumHighBits, symbol - kLenNumLowSymbols - kLenNumMidSymbols);\r\n    }\r\n  }\r\n}\r\n\r\nstatic void LenEnc_SetPrices(CLenEnc *p, UInt32 posState, UInt32 numSymbols, UInt32 *prices, UInt32 *ProbPrices)\r\n{\r\n  UInt32 a0 = GET_PRICE_0a(p->choice);\r\n  UInt32 a1 = GET_PRICE_1a(p->choice);\r\n  UInt32 b0 = a1 + GET_PRICE_0a(p->choice2);\r\n  UInt32 b1 = a1 + GET_PRICE_1a(p->choice2);\r\n  UInt32 i = 0;\r\n  for (i = 0; i < kLenNumLowSymbols; i++)\r\n  {\r\n    if (i >= numSymbols)\r\n      return;\r\n    prices[i] = a0 + RcTree_GetPrice(p->low + (posState << kLenNumLowBits), kLenNumLowBits, i, ProbPrices);\r\n  }\r\n  for (; i < kLenNumLowSymbols + kLenNumMidSymbols; i++)\r\n  {\r\n    if (i >= numSymbols)\r\n      return;\r\n    prices[i] = b0 + RcTree_GetPrice(p->mid + (posState << kLenNumMidBits), kLenNumMidBits, i - kLenNumLowSymbols, ProbPrices);\r\n  }\r\n  for (; i < numSymbols; i++)\r\n    prices[i] = b1 + RcTree_GetPrice(p->high, kLenNumHighBits, i - kLenNumLowSymbols - kLenNumMidSymbols, ProbPrices);\r\n}\r\n\r\nstatic void MY_FAST_CALL LenPriceEnc_UpdateTable(CLenPriceEnc *p, UInt32 posState, UInt32 *ProbPrices)\r\n{\r\n  LenEnc_SetPrices(&p->p, posState, p->tableSize, p->prices[posState], ProbPrices);\r\n  p->counters[posState] = p->tableSize;\r\n}\r\n\r\nstatic void LenPriceEnc_UpdateTables(CLenPriceEnc *p, UInt32 numPosStates, UInt32 *ProbPrices)\r\n{\r\n  UInt32 posState;\r\n  for (posState = 0; posState < numPosStates; posState++)\r\n    LenPriceEnc_UpdateTable(p, posState, ProbPrices);\r\n}\r\n\r\nstatic void LenEnc_Encode2(CLenPriceEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState, Bool updatePrice, UInt32 *ProbPrices)\r\n{\r\n  LenEnc_Encode(&p->p, rc, symbol, posState);\r\n  if (updatePrice)\r\n    if (--p->counters[posState] == 0)\r\n      LenPriceEnc_UpdateTable(p, posState, ProbPrices);\r\n}\r\n\r\n\r\n\r\n\r\nstatic void MovePos(CLzmaEnc *p, UInt32 num)\r\n{\r\n  #ifdef SHOW_STAT\r\n  ttt += num;\r\n  printf(\"\\n MovePos %d\", num);\r\n  #endif\r\n  if (num != 0)\r\n  {\r\n    p->additionalOffset += num;\r\n    p->matchFinder.Skip(p->matchFinderObj, num);\r\n  }\r\n}\r\n\r\nstatic UInt32 ReadMatchDistances(CLzmaEnc *p, UInt32 *numDistancePairsRes)\r\n{\r\n  UInt32 lenRes = 0, numPairs;\r\n  p->numAvail = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj);\r\n  numPairs = p->matchFinder.GetMatches(p->matchFinderObj, p->matches);\r\n  #ifdef SHOW_STAT\r\n  printf(\"\\n i = %d numPairs = %d    \", ttt, numPairs / 2);\r\n  ttt++;\r\n  {\r\n    UInt32 i;\r\n    for (i = 0; i < numPairs; i += 2)\r\n      printf(\"%2d %6d   | \", p->matches[i], p->matches[i + 1]);\r\n  }\r\n  #endif\r\n  if (numPairs > 0)\r\n  {\r\n    lenRes = p->matches[numPairs - 2];\r\n    if (lenRes == p->numFastBytes)\r\n    {\r\n      const Byte *pby = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;\r\n      UInt32 distance = p->matches[numPairs - 1] + 1;\r\n      UInt32 numAvail = p->numAvail;\r\n      if (numAvail > LZMA_MATCH_LEN_MAX)\r\n        numAvail = LZMA_MATCH_LEN_MAX;\r\n      {\r\n        const Byte *pby2 = pby - distance;\r\n        for (; lenRes < numAvail && pby[lenRes] == pby2[lenRes]; lenRes++);\r\n      }\r\n    }\r\n  }\r\n  p->additionalOffset++;\r\n  *numDistancePairsRes = numPairs;\r\n  return lenRes;\r\n}\r\n\r\n\r\n#define MakeAsChar(p) (p)->backPrev = (UInt32)(-1); (p)->prev1IsChar = False;\r\n#define MakeAsShortRep(p) (p)->backPrev = 0; (p)->prev1IsChar = False;\r\n#define IsShortRep(p) ((p)->backPrev == 0)\r\n\r\nstatic UInt32 GetRepLen1Price(CLzmaEnc *p, UInt32 state, UInt32 posState)\r\n{\r\n  return\r\n    GET_PRICE_0(p->isRepG0[state]) +\r\n    GET_PRICE_0(p->isRep0Long[state][posState]);\r\n}\r\n\r\nstatic UInt32 GetPureRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 state, UInt32 posState)\r\n{\r\n  UInt32 price;\r\n  if (repIndex == 0)\r\n  {\r\n    price = GET_PRICE_0(p->isRepG0[state]);\r\n    price += GET_PRICE_1(p->isRep0Long[state][posState]);\r\n  }\r\n  else\r\n  {\r\n    price = GET_PRICE_1(p->isRepG0[state]);\r\n    if (repIndex == 1)\r\n      price += GET_PRICE_0(p->isRepG1[state]);\r\n    else\r\n    {\r\n      price += GET_PRICE_1(p->isRepG1[state]);\r\n      price += GET_PRICE(p->isRepG2[state], repIndex - 2);\r\n    }\r\n  }\r\n  return price;\r\n}\r\n\r\nstatic UInt32 GetRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 len, UInt32 state, UInt32 posState)\r\n{\r\n  return p->repLenEnc.prices[posState][len - LZMA_MATCH_LEN_MIN] +\r\n    GetPureRepPrice(p, repIndex, state, posState);\r\n}\r\n\r\nstatic UInt32 Backward(CLzmaEnc *p, UInt32 *backRes, UInt32 cur)\r\n{\r\n  UInt32 posMem = p->opt[cur].posPrev;\r\n  UInt32 backMem = p->opt[cur].backPrev;\r\n  p->optimumEndIndex = cur;\r\n  do\r\n  {\r\n    if (p->opt[cur].prev1IsChar)\r\n    {\r\n      MakeAsChar(&p->opt[posMem])\r\n      p->opt[posMem].posPrev = posMem - 1;\r\n      if (p->opt[cur].prev2)\r\n      {\r\n        p->opt[posMem - 1].prev1IsChar = False;\r\n        p->opt[posMem - 1].posPrev = p->opt[cur].posPrev2;\r\n        p->opt[posMem - 1].backPrev = p->opt[cur].backPrev2;\r\n      }\r\n    }\r\n    {\r\n      UInt32 posPrev = posMem;\r\n      UInt32 backCur = backMem;\r\n      \r\n      backMem = p->opt[posPrev].backPrev;\r\n      posMem = p->opt[posPrev].posPrev;\r\n      \r\n      p->opt[posPrev].backPrev = backCur;\r\n      p->opt[posPrev].posPrev = cur;\r\n      cur = posPrev;\r\n    }\r\n  }\r\n  while (cur != 0);\r\n  *backRes = p->opt[0].backPrev;\r\n  p->optimumCurrentIndex  = p->opt[0].posPrev;\r\n  return p->optimumCurrentIndex;\r\n}\r\n\r\n#define LIT_PROBS(pos, prevByte) (p->litProbs + ((((pos) & p->lpMask) << p->lc) + ((prevByte) >> (8 - p->lc))) * 0x300)\r\n\r\nstatic UInt32 GetOptimum(CLzmaEnc *p, UInt32 position, UInt32 *backRes)\r\n{\r\n  UInt32 numAvail, mainLen, numPairs, repMaxIndex, i, posState, lenEnd, len, cur;\r\n  UInt32 matchPrice, repMatchPrice, normalMatchPrice;\r\n  UInt32 reps[LZMA_NUM_REPS], repLens[LZMA_NUM_REPS];\r\n  UInt32 *matches;\r\n  const Byte *data;\r\n  Byte curByte, matchByte;\r\n  if (p->optimumEndIndex != p->optimumCurrentIndex)\r\n  {\r\n    const COptimal *opt = &p->opt[p->optimumCurrentIndex];\r\n    UInt32 lenRes = opt->posPrev - p->optimumCurrentIndex;\r\n    *backRes = opt->backPrev;\r\n    p->optimumCurrentIndex = opt->posPrev;\r\n    return lenRes;\r\n  }\r\n  p->optimumCurrentIndex = p->optimumEndIndex = 0;\r\n  \r\n  if (p->additionalOffset == 0)\r\n    mainLen = ReadMatchDistances(p, &numPairs);\r\n  else\r\n  {\r\n    mainLen = p->longestMatchLength;\r\n    numPairs = p->numPairs;\r\n  }\r\n\r\n  numAvail = p->numAvail;\r\n  if (numAvail < 2)\r\n  {\r\n    *backRes = (UInt32)(-1);\r\n    return 1;\r\n  }\r\n  if (numAvail > LZMA_MATCH_LEN_MAX)\r\n    numAvail = LZMA_MATCH_LEN_MAX;\r\n\r\n  data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;\r\n  repMaxIndex = 0;\r\n  for (i = 0; i < LZMA_NUM_REPS; i++)\r\n  {\r\n    UInt32 lenTest;\r\n    const Byte *data2;\r\n    reps[i] = p->reps[i];\r\n    data2 = data - (reps[i] + 1);\r\n    if (data[0] != data2[0] || data[1] != data2[1])\r\n    {\r\n      repLens[i] = 0;\r\n      continue;\r\n    }\r\n    for (lenTest = 2; lenTest < numAvail && data[lenTest] == data2[lenTest]; lenTest++);\r\n    repLens[i] = lenTest;\r\n    if (lenTest > repLens[repMaxIndex])\r\n      repMaxIndex = i;\r\n  }\r\n  if (repLens[repMaxIndex] >= p->numFastBytes)\r\n  {\r\n    UInt32 lenRes;\r\n    *backRes = repMaxIndex;\r\n    lenRes = repLens[repMaxIndex];\r\n    MovePos(p, lenRes - 1);\r\n    return lenRes;\r\n  }\r\n\r\n  matches = p->matches;\r\n  if (mainLen >= p->numFastBytes)\r\n  {\r\n    *backRes = matches[numPairs - 1] + LZMA_NUM_REPS;\r\n    MovePos(p, mainLen - 1);\r\n    return mainLen;\r\n  }\r\n  curByte = *data;\r\n  matchByte = *(data - (reps[0] + 1));\r\n\r\n  if (mainLen < 2 && curByte != matchByte && repLens[repMaxIndex] < 2)\r\n  {\r\n    *backRes = (UInt32)-1;\r\n    return 1;\r\n  }\r\n\r\n  p->opt[0].state = (CState)p->state;\r\n\r\n  posState = (position & p->pbMask);\r\n\r\n  {\r\n    const CLzmaProb *probs = LIT_PROBS(position, *(data - 1));\r\n    p->opt[1].price = GET_PRICE_0(p->isMatch[p->state][posState]) +\r\n        (!IsCharState(p->state) ?\r\n          LitEnc_GetPriceMatched(probs, curByte, matchByte, p->ProbPrices) :\r\n          LitEnc_GetPrice(probs, curByte, p->ProbPrices));\r\n  }\r\n\r\n  MakeAsChar(&p->opt[1]);\r\n\r\n  matchPrice = GET_PRICE_1(p->isMatch[p->state][posState]);\r\n  repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[p->state]);\r\n\r\n  if (matchByte == curByte)\r\n  {\r\n    UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, p->state, posState);\r\n    if (shortRepPrice < p->opt[1].price)\r\n    {\r\n      p->opt[1].price = shortRepPrice;\r\n      MakeAsShortRep(&p->opt[1]);\r\n    }\r\n  }\r\n  lenEnd = ((mainLen >= repLens[repMaxIndex]) ? mainLen : repLens[repMaxIndex]);\r\n\r\n  if (lenEnd < 2)\r\n  {\r\n    *backRes = p->opt[1].backPrev;\r\n    return 1;\r\n  }\r\n\r\n  p->opt[1].posPrev = 0;\r\n  for (i = 0; i < LZMA_NUM_REPS; i++)\r\n    p->opt[0].backs[i] = reps[i];\r\n\r\n  len = lenEnd;\r\n  do\r\n    p->opt[len--].price = kInfinityPrice;\r\n  while (len >= 2);\r\n\r\n  for (i = 0; i < LZMA_NUM_REPS; i++)\r\n  {\r\n    UInt32 repLen = repLens[i];\r\n    UInt32 price;\r\n    if (repLen < 2)\r\n      continue;\r\n    price = repMatchPrice + GetPureRepPrice(p, i, p->state, posState);\r\n    do\r\n    {\r\n      UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][repLen - 2];\r\n      COptimal *opt = &p->opt[repLen];\r\n      if (curAndLenPrice < opt->price)\r\n      {\r\n        opt->price = curAndLenPrice;\r\n        opt->posPrev = 0;\r\n        opt->backPrev = i;\r\n        opt->prev1IsChar = False;\r\n      }\r\n    }\r\n    while (--repLen >= 2);\r\n  }\r\n\r\n  normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[p->state]);\r\n\r\n  len = ((repLens[0] >= 2) ? repLens[0] + 1 : 2);\r\n  if (len <= mainLen)\r\n  {\r\n    UInt32 offs = 0;\r\n    while (len > matches[offs])\r\n      offs += 2;\r\n    for (; ; len++)\r\n    {\r\n      COptimal *opt;\r\n      UInt32 distance = matches[offs + 1];\r\n\r\n      UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][len - LZMA_MATCH_LEN_MIN];\r\n      UInt32 lenToPosState = GetLenToPosState(len);\r\n      if (distance < kNumFullDistances)\r\n        curAndLenPrice += p->distancesPrices[lenToPosState][distance];\r\n      else\r\n      {\r\n        UInt32 slot;\r\n        GetPosSlot2(distance, slot);\r\n        curAndLenPrice += p->alignPrices[distance & kAlignMask] + p->posSlotPrices[lenToPosState][slot];\r\n      }\r\n      opt = &p->opt[len];\r\n      if (curAndLenPrice < opt->price)\r\n      {\r\n        opt->price = curAndLenPrice;\r\n        opt->posPrev = 0;\r\n        opt->backPrev = distance + LZMA_NUM_REPS;\r\n        opt->prev1IsChar = False;\r\n      }\r\n      if (len == matches[offs])\r\n      {\r\n        offs += 2;\r\n        if (offs == numPairs)\r\n          break;\r\n      }\r\n    }\r\n  }\r\n\r\n  cur = 0;\r\n\r\n    #ifdef SHOW_STAT2\r\n    if (position >= 0)\r\n    {\r\n      unsigned i;\r\n      printf(\"\\n pos = %4X\", position);\r\n      for (i = cur; i <= lenEnd; i++)\r\n      printf(\"\\nprice[%4X] = %d\", position - cur + i, p->opt[i].price);\r\n    }\r\n    #endif\r\n\r\n  for (;;)\r\n  {\r\n    UInt32 numAvailFull, newLen, numPairs, posPrev, state, posState, startLen;\r\n    UInt32 curPrice, curAnd1Price, matchPrice, repMatchPrice;\r\n    Bool nextIsChar;\r\n    Byte curByte, matchByte;\r\n    const Byte *data;\r\n    COptimal *curOpt;\r\n    COptimal *nextOpt;\r\n\r\n    cur++;\r\n    if (cur == lenEnd)\r\n      return Backward(p, backRes, cur);\r\n\r\n    newLen = ReadMatchDistances(p, &numPairs);\r\n    if (newLen >= p->numFastBytes)\r\n    {\r\n      p->numPairs = numPairs;\r\n      p->longestMatchLength = newLen;\r\n      return Backward(p, backRes, cur);\r\n    }\r\n    position++;\r\n    curOpt = &p->opt[cur];\r\n    posPrev = curOpt->posPrev;\r\n    if (curOpt->prev1IsChar)\r\n    {\r\n      posPrev--;\r\n      if (curOpt->prev2)\r\n      {\r\n        state = p->opt[curOpt->posPrev2].state;\r\n        if (curOpt->backPrev2 < LZMA_NUM_REPS)\r\n          state = kRepNextStates[state];\r\n        else\r\n          state = kMatchNextStates[state];\r\n      }\r\n      else\r\n        state = p->opt[posPrev].state;\r\n      state = kLiteralNextStates[state];\r\n    }\r\n    else\r\n      state = p->opt[posPrev].state;\r\n    if (posPrev == cur - 1)\r\n    {\r\n      if (IsShortRep(curOpt))\r\n        state = kShortRepNextStates[state];\r\n      else\r\n        state = kLiteralNextStates[state];\r\n    }\r\n    else\r\n    {\r\n      UInt32 pos;\r\n      const COptimal *prevOpt;\r\n      if (curOpt->prev1IsChar && curOpt->prev2)\r\n      {\r\n        posPrev = curOpt->posPrev2;\r\n        pos = curOpt->backPrev2;\r\n        state = kRepNextStates[state];\r\n      }\r\n      else\r\n      {\r\n        pos = curOpt->backPrev;\r\n        if (pos < LZMA_NUM_REPS)\r\n          state = kRepNextStates[state];\r\n        else\r\n          state = kMatchNextStates[state];\r\n      }\r\n      prevOpt = &p->opt[posPrev];\r\n      if (pos < LZMA_NUM_REPS)\r\n      {\r\n        UInt32 i;\r\n        reps[0] = prevOpt->backs[pos];\r\n        for (i = 1; i <= pos; i++)\r\n          reps[i] = prevOpt->backs[i - 1];\r\n        for (; i < LZMA_NUM_REPS; i++)\r\n          reps[i] = prevOpt->backs[i];\r\n      }\r\n      else\r\n      {\r\n        UInt32 i;\r\n        reps[0] = (pos - LZMA_NUM_REPS);\r\n        for (i = 1; i < LZMA_NUM_REPS; i++)\r\n          reps[i] = prevOpt->backs[i - 1];\r\n      }\r\n    }\r\n    curOpt->state = (CState)state;\r\n\r\n    curOpt->backs[0] = reps[0];\r\n    curOpt->backs[1] = reps[1];\r\n    curOpt->backs[2] = reps[2];\r\n    curOpt->backs[3] = reps[3];\r\n\r\n    curPrice = curOpt->price;\r\n    nextIsChar = False;\r\n    data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;\r\n    curByte = *data;\r\n    matchByte = *(data - (reps[0] + 1));\r\n\r\n    posState = (position & p->pbMask);\r\n\r\n    curAnd1Price = curPrice + GET_PRICE_0(p->isMatch[state][posState]);\r\n    {\r\n      const CLzmaProb *probs = LIT_PROBS(position, *(data - 1));\r\n      curAnd1Price +=\r\n        (!IsCharState(state) ?\r\n          LitEnc_GetPriceMatched(probs, curByte, matchByte, p->ProbPrices) :\r\n          LitEnc_GetPrice(probs, curByte, p->ProbPrices));\r\n    }\r\n\r\n    nextOpt = &p->opt[cur + 1];\r\n\r\n    if (curAnd1Price < nextOpt->price)\r\n    {\r\n      nextOpt->price = curAnd1Price;\r\n      nextOpt->posPrev = cur;\r\n      MakeAsChar(nextOpt);\r\n      nextIsChar = True;\r\n    }\r\n\r\n    matchPrice = curPrice + GET_PRICE_1(p->isMatch[state][posState]);\r\n    repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[state]);\r\n    \r\n    if (matchByte == curByte && !(nextOpt->posPrev < cur && nextOpt->backPrev == 0))\r\n    {\r\n      UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, state, posState);\r\n      if (shortRepPrice <= nextOpt->price)\r\n      {\r\n        nextOpt->price = shortRepPrice;\r\n        nextOpt->posPrev = cur;\r\n        MakeAsShortRep(nextOpt);\r\n        nextIsChar = True;\r\n      }\r\n    }\r\n    numAvailFull = p->numAvail;\r\n    {\r\n      UInt32 temp = kNumOpts - 1 - cur;\r\n      if (temp < numAvailFull)\r\n        numAvailFull = temp;\r\n    }\r\n\r\n    if (numAvailFull < 2)\r\n      continue;\r\n    numAvail = (numAvailFull <= p->numFastBytes ? numAvailFull : p->numFastBytes);\r\n\r\n    if (!nextIsChar && matchByte != curByte) /* speed optimization */\r\n    {\r\n      /* try Literal + rep0 */\r\n      UInt32 temp;\r\n      UInt32 lenTest2;\r\n      const Byte *data2 = data - (reps[0] + 1);\r\n      UInt32 limit = p->numFastBytes + 1;\r\n      if (limit > numAvailFull)\r\n        limit = numAvailFull;\r\n\r\n      for (temp = 1; temp < limit && data[temp] == data2[temp]; temp++);\r\n      lenTest2 = temp - 1;\r\n      if (lenTest2 >= 2)\r\n      {\r\n        UInt32 state2 = kLiteralNextStates[state];\r\n        UInt32 posStateNext = (position + 1) & p->pbMask;\r\n        UInt32 nextRepMatchPrice = curAnd1Price +\r\n            GET_PRICE_1(p->isMatch[state2][posStateNext]) +\r\n            GET_PRICE_1(p->isRep[state2]);\r\n        /* for (; lenTest2 >= 2; lenTest2--) */\r\n        {\r\n          UInt32 curAndLenPrice;\r\n          COptimal *opt;\r\n          UInt32 offset = cur + 1 + lenTest2;\r\n          while (lenEnd < offset)\r\n            p->opt[++lenEnd].price = kInfinityPrice;\r\n          curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext);\r\n          opt = &p->opt[offset];\r\n          if (curAndLenPrice < opt->price)\r\n          {\r\n            opt->price = curAndLenPrice;\r\n            opt->posPrev = cur + 1;\r\n            opt->backPrev = 0;\r\n            opt->prev1IsChar = True;\r\n            opt->prev2 = False;\r\n          }\r\n        }\r\n      }\r\n    }\r\n    \r\n    startLen = 2; /* speed optimization */\r\n    {\r\n    UInt32 repIndex;\r\n    for (repIndex = 0; repIndex < LZMA_NUM_REPS; repIndex++)\r\n    {\r\n      UInt32 lenTest;\r\n      UInt32 lenTestTemp;\r\n      UInt32 price;\r\n      const Byte *data2 = data - (reps[repIndex] + 1);\r\n      if (data[0] != data2[0] || data[1] != data2[1])\r\n        continue;\r\n      for (lenTest = 2; lenTest < numAvail && data[lenTest] == data2[lenTest]; lenTest++);\r\n      while (lenEnd < cur + lenTest)\r\n        p->opt[++lenEnd].price = kInfinityPrice;\r\n      lenTestTemp = lenTest;\r\n      price = repMatchPrice + GetPureRepPrice(p, repIndex, state, posState);\r\n      do\r\n      {\r\n        UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][lenTest - 2];\r\n        COptimal *opt = &p->opt[cur + lenTest];\r\n        if (curAndLenPrice < opt->price)\r\n        {\r\n          opt->price = curAndLenPrice;\r\n          opt->posPrev = cur;\r\n          opt->backPrev = repIndex;\r\n          opt->prev1IsChar = False;\r\n        }\r\n      }\r\n      while (--lenTest >= 2);\r\n      lenTest = lenTestTemp;\r\n      \r\n      if (repIndex == 0)\r\n        startLen = lenTest + 1;\r\n        \r\n      /* if (_maxMode) */\r\n        {\r\n          UInt32 lenTest2 = lenTest + 1;\r\n          UInt32 limit = lenTest2 + p->numFastBytes;\r\n          UInt32 nextRepMatchPrice;\r\n          if (limit > numAvailFull)\r\n            limit = numAvailFull;\r\n          for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++);\r\n          lenTest2 -= lenTest + 1;\r\n          if (lenTest2 >= 2)\r\n          {\r\n            UInt32 state2 = kRepNextStates[state];\r\n            UInt32 posStateNext = (position + lenTest) & p->pbMask;\r\n            UInt32 curAndLenCharPrice =\r\n                price + p->repLenEnc.prices[posState][lenTest - 2] +\r\n                GET_PRICE_0(p->isMatch[state2][posStateNext]) +\r\n                LitEnc_GetPriceMatched(LIT_PROBS(position + lenTest, data[lenTest - 1]),\r\n                    data[lenTest], data2[lenTest], p->ProbPrices);\r\n            state2 = kLiteralNextStates[state2];\r\n            posStateNext = (position + lenTest + 1) & p->pbMask;\r\n            nextRepMatchPrice = curAndLenCharPrice +\r\n                GET_PRICE_1(p->isMatch[state2][posStateNext]) +\r\n                GET_PRICE_1(p->isRep[state2]);\r\n            \r\n            /* for (; lenTest2 >= 2; lenTest2--) */\r\n            {\r\n              UInt32 curAndLenPrice;\r\n              COptimal *opt;\r\n              UInt32 offset = cur + lenTest + 1 + lenTest2;\r\n              while (lenEnd < offset)\r\n                p->opt[++lenEnd].price = kInfinityPrice;\r\n              curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext);\r\n              opt = &p->opt[offset];\r\n              if (curAndLenPrice < opt->price)\r\n              {\r\n                opt->price = curAndLenPrice;\r\n                opt->posPrev = cur + lenTest + 1;\r\n                opt->backPrev = 0;\r\n                opt->prev1IsChar = True;\r\n                opt->prev2 = True;\r\n                opt->posPrev2 = cur;\r\n                opt->backPrev2 = repIndex;\r\n              }\r\n            }\r\n          }\r\n        }\r\n    }\r\n    }\r\n    /* for (UInt32 lenTest = 2; lenTest <= newLen; lenTest++) */\r\n    if (newLen > numAvail)\r\n    {\r\n      newLen = numAvail;\r\n      for (numPairs = 0; newLen > matches[numPairs]; numPairs += 2);\r\n      matches[numPairs] = newLen;\r\n      numPairs += 2;\r\n    }\r\n    if (newLen >= startLen)\r\n    {\r\n      UInt32 normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[state]);\r\n      UInt32 offs, curBack, posSlot;\r\n      UInt32 lenTest;\r\n      while (lenEnd < cur + newLen)\r\n        p->opt[++lenEnd].price = kInfinityPrice;\r\n\r\n      offs = 0;\r\n      while (startLen > matches[offs])\r\n        offs += 2;\r\n      curBack = matches[offs + 1];\r\n      GetPosSlot2(curBack, posSlot);\r\n      for (lenTest = /*2*/ startLen; ; lenTest++)\r\n      {\r\n        UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][lenTest - LZMA_MATCH_LEN_MIN];\r\n        UInt32 lenToPosState = GetLenToPosState(lenTest);\r\n        COptimal *opt;\r\n        if (curBack < kNumFullDistances)\r\n          curAndLenPrice += p->distancesPrices[lenToPosState][curBack];\r\n        else\r\n          curAndLenPrice += p->posSlotPrices[lenToPosState][posSlot] + p->alignPrices[curBack & kAlignMask];\r\n        \r\n        opt = &p->opt[cur + lenTest];\r\n        if (curAndLenPrice < opt->price)\r\n        {\r\n          opt->price = curAndLenPrice;\r\n          opt->posPrev = cur;\r\n          opt->backPrev = curBack + LZMA_NUM_REPS;\r\n          opt->prev1IsChar = False;\r\n        }\r\n\r\n        if (/*_maxMode && */lenTest == matches[offs])\r\n        {\r\n          /* Try Match + Literal + Rep0 */\r\n          const Byte *data2 = data - (curBack + 1);\r\n          UInt32 lenTest2 = lenTest + 1;\r\n          UInt32 limit = lenTest2 + p->numFastBytes;\r\n          UInt32 nextRepMatchPrice;\r\n          if (limit > numAvailFull)\r\n            limit = numAvailFull;\r\n          for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++);\r\n          lenTest2 -= lenTest + 1;\r\n          if (lenTest2 >= 2)\r\n          {\r\n            UInt32 state2 = kMatchNextStates[state];\r\n            UInt32 posStateNext = (position + lenTest) & p->pbMask;\r\n            UInt32 curAndLenCharPrice = curAndLenPrice +\r\n                GET_PRICE_0(p->isMatch[state2][posStateNext]) +\r\n                LitEnc_GetPriceMatched(LIT_PROBS(position + lenTest, data[lenTest - 1]),\r\n                    data[lenTest], data2[lenTest], p->ProbPrices);\r\n            state2 = kLiteralNextStates[state2];\r\n            posStateNext = (posStateNext + 1) & p->pbMask;\r\n            nextRepMatchPrice = curAndLenCharPrice +\r\n                GET_PRICE_1(p->isMatch[state2][posStateNext]) +\r\n                GET_PRICE_1(p->isRep[state2]);\r\n            \r\n            /* for (; lenTest2 >= 2; lenTest2--) */\r\n            {\r\n              UInt32 offset = cur + lenTest + 1 + lenTest2;\r\n              UInt32 curAndLenPrice;\r\n              COptimal *opt;\r\n              while (lenEnd < offset)\r\n                p->opt[++lenEnd].price = kInfinityPrice;\r\n              curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext);\r\n              opt = &p->opt[offset];\r\n              if (curAndLenPrice < opt->price)\r\n              {\r\n                opt->price = curAndLenPrice;\r\n                opt->posPrev = cur + lenTest + 1;\r\n                opt->backPrev = 0;\r\n                opt->prev1IsChar = True;\r\n                opt->prev2 = True;\r\n                opt->posPrev2 = cur;\r\n                opt->backPrev2 = curBack + LZMA_NUM_REPS;\r\n              }\r\n            }\r\n          }\r\n          offs += 2;\r\n          if (offs == numPairs)\r\n            break;\r\n          curBack = matches[offs + 1];\r\n          if (curBack >= kNumFullDistances)\r\n            GetPosSlot2(curBack, posSlot);\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\n#define ChangePair(smallDist, bigDist) (((bigDist) >> 7) > (smallDist))\r\n\r\nstatic UInt32 GetOptimumFast(CLzmaEnc *p, UInt32 *backRes)\r\n{\r\n  UInt32 numAvail, mainLen, mainDist, numPairs, repIndex, repLen, i;\r\n  const Byte *data;\r\n  const UInt32 *matches;\r\n\r\n  if (p->additionalOffset == 0)\r\n    mainLen = ReadMatchDistances(p, &numPairs);\r\n  else\r\n  {\r\n    mainLen = p->longestMatchLength;\r\n    numPairs = p->numPairs;\r\n  }\r\n\r\n  numAvail = p->numAvail;\r\n  *backRes = (UInt32)-1;\r\n  if (numAvail < 2)\r\n    return 1;\r\n  if (numAvail > LZMA_MATCH_LEN_MAX)\r\n    numAvail = LZMA_MATCH_LEN_MAX;\r\n  data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;\r\n\r\n  repLen = repIndex = 0;\r\n  for (i = 0; i < LZMA_NUM_REPS; i++)\r\n  {\r\n    UInt32 len;\r\n    const Byte *data2 = data - (p->reps[i] + 1);\r\n    if (data[0] != data2[0] || data[1] != data2[1])\r\n      continue;\r\n    for (len = 2; len < numAvail && data[len] == data2[len]; len++);\r\n    if (len >= p->numFastBytes)\r\n    {\r\n      *backRes = i;\r\n      MovePos(p, len - 1);\r\n      return len;\r\n    }\r\n    if (len > repLen)\r\n    {\r\n      repIndex = i;\r\n      repLen = len;\r\n    }\r\n  }\r\n\r\n  matches = p->matches;\r\n  if (mainLen >= p->numFastBytes)\r\n  {\r\n    *backRes = matches[numPairs - 1] + LZMA_NUM_REPS;\r\n    MovePos(p, mainLen - 1);\r\n    return mainLen;\r\n  }\r\n\r\n  mainDist = 0; /* for GCC */\r\n  if (mainLen >= 2)\r\n  {\r\n    mainDist = matches[numPairs - 1];\r\n    while (numPairs > 2 && mainLen == matches[numPairs - 4] + 1)\r\n    {\r\n      if (!ChangePair(matches[numPairs - 3], mainDist))\r\n        break;\r\n      numPairs -= 2;\r\n      mainLen = matches[numPairs - 2];\r\n      mainDist = matches[numPairs - 1];\r\n    }\r\n    if (mainLen == 2 && mainDist >= 0x80)\r\n      mainLen = 1;\r\n  }\r\n\r\n  if (repLen >= 2 && (\r\n        (repLen + 1 >= mainLen) ||\r\n        (repLen + 2 >= mainLen && mainDist >= (1 << 9)) ||\r\n        (repLen + 3 >= mainLen && mainDist >= (1 << 15))))\r\n  {\r\n    *backRes = repIndex;\r\n    MovePos(p, repLen - 1);\r\n    return repLen;\r\n  }\r\n  \r\n  if (mainLen < 2 || numAvail <= 2)\r\n    return 1;\r\n\r\n  p->longestMatchLength = ReadMatchDistances(p, &p->numPairs);\r\n  if (p->longestMatchLength >= 2)\r\n  {\r\n    UInt32 newDistance = matches[p->numPairs - 1];\r\n    if ((p->longestMatchLength >= mainLen && newDistance < mainDist) ||\r\n        (p->longestMatchLength == mainLen + 1 && !ChangePair(mainDist, newDistance)) ||\r\n        (p->longestMatchLength > mainLen + 1) ||\r\n        (p->longestMatchLength + 1 >= mainLen && mainLen >= 3 && ChangePair(newDistance, mainDist)))\r\n      return 1;\r\n  }\r\n  \r\n  data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;\r\n  for (i = 0; i < LZMA_NUM_REPS; i++)\r\n  {\r\n    UInt32 len, limit;\r\n    const Byte *data2 = data - (p->reps[i] + 1);\r\n    if (data[0] != data2[0] || data[1] != data2[1])\r\n      continue;\r\n    limit = mainLen - 1;\r\n    for (len = 2; len < limit && data[len] == data2[len]; len++);\r\n    if (len >= limit)\r\n      return 1;\r\n  }\r\n  *backRes = mainDist + LZMA_NUM_REPS;\r\n  MovePos(p, mainLen - 2);\r\n  return mainLen;\r\n}\r\n\r\nstatic void WriteEndMarker(CLzmaEnc *p, UInt32 posState)\r\n{\r\n  UInt32 len;\r\n  RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1);\r\n  RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0);\r\n  p->state = kMatchNextStates[p->state];\r\n  len = LZMA_MATCH_LEN_MIN;\r\n  LenEnc_Encode2(&p->lenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices);\r\n  RcTree_Encode(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], kNumPosSlotBits, (1 << kNumPosSlotBits) - 1);\r\n  RangeEnc_EncodeDirectBits(&p->rc, (((UInt32)1 << 30) - 1) >> kNumAlignBits, 30 - kNumAlignBits);\r\n  RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, kAlignMask);\r\n}\r\n\r\nstatic SRes CheckErrors(CLzmaEnc *p)\r\n{\r\n  if (p->result != SZ_OK)\r\n    return p->result;\r\n  if (p->rc.res != SZ_OK)\r\n    p->result = SZ_ERROR_WRITE;\r\n  if (p->matchFinderBase.result != SZ_OK)\r\n    p->result = SZ_ERROR_READ;\r\n  if (p->result != SZ_OK)\r\n    p->finished = True;\r\n  return p->result;\r\n}\r\n\r\nstatic SRes Flush(CLzmaEnc *p, UInt32 nowPos)\r\n{\r\n  /* ReleaseMFStream(); */\r\n  p->finished = True;\r\n  if (p->writeEndMark)\r\n    WriteEndMarker(p, nowPos & p->pbMask);\r\n  RangeEnc_FlushData(&p->rc);\r\n  RangeEnc_FlushStream(&p->rc);\r\n  return CheckErrors(p);\r\n}\r\n\r\nstatic void FillAlignPrices(CLzmaEnc *p)\r\n{\r\n  UInt32 i;\r\n  for (i = 0; i < kAlignTableSize; i++)\r\n    p->alignPrices[i] = RcTree_ReverseGetPrice(p->posAlignEncoder, kNumAlignBits, i, p->ProbPrices);\r\n  p->alignPriceCount = 0;\r\n}\r\n\r\nstatic void FillDistancesPrices(CLzmaEnc *p)\r\n{\r\n  UInt32 tempPrices[kNumFullDistances];\r\n  UInt32 i, lenToPosState;\r\n  for (i = kStartPosModelIndex; i < kNumFullDistances; i++)\r\n  {\r\n    UInt32 posSlot = GetPosSlot1(i);\r\n    UInt32 footerBits = ((posSlot >> 1) - 1);\r\n    UInt32 base = ((2 | (posSlot & 1)) << footerBits);\r\n    tempPrices[i] = RcTree_ReverseGetPrice(p->posEncoders + base - posSlot - 1, footerBits, i - base, p->ProbPrices);\r\n  }\r\n\r\n  for (lenToPosState = 0; lenToPosState < kNumLenToPosStates; lenToPosState++)\r\n  {\r\n    UInt32 posSlot;\r\n    const CLzmaProb *encoder = p->posSlotEncoder[lenToPosState];\r\n    UInt32 *posSlotPrices = p->posSlotPrices[lenToPosState];\r\n    for (posSlot = 0; posSlot < p->distTableSize; posSlot++)\r\n      posSlotPrices[posSlot] = RcTree_GetPrice(encoder, kNumPosSlotBits, posSlot, p->ProbPrices);\r\n    for (posSlot = kEndPosModelIndex; posSlot < p->distTableSize; posSlot++)\r\n      posSlotPrices[posSlot] += ((((posSlot >> 1) - 1) - kNumAlignBits) << kNumBitPriceShiftBits);\r\n\r\n    {\r\n      UInt32 *distancesPrices = p->distancesPrices[lenToPosState];\r\n      UInt32 i;\r\n      for (i = 0; i < kStartPosModelIndex; i++)\r\n        distancesPrices[i] = posSlotPrices[i];\r\n      for (; i < kNumFullDistances; i++)\r\n        distancesPrices[i] = posSlotPrices[GetPosSlot1(i)] + tempPrices[i];\r\n    }\r\n  }\r\n  p->matchPriceCount = 0;\r\n}\r\n\r\nvoid LzmaEnc_Construct(CLzmaEnc *p)\r\n{\r\n  RangeEnc_Construct(&p->rc);\r\n  MatchFinder_Construct(&p->matchFinderBase);\r\n  #ifndef _7ZIP_ST\r\n  MatchFinderMt_Construct(&p->matchFinderMt);\r\n  p->matchFinderMt.MatchFinder = &p->matchFinderBase;\r\n  #endif\r\n\r\n  {\r\n    CLzmaEncProps props;\r\n    LzmaEncProps_Init(&props);\r\n    LzmaEnc_SetProps(p, &props);\r\n  }\r\n\r\n  #ifndef LZMA_LOG_BSR\r\n  LzmaEnc_FastPosInit(p->g_FastPos);\r\n  #endif\r\n\r\n  LzmaEnc_InitPriceTables(p->ProbPrices);\r\n  p->litProbs = 0;\r\n  p->saveState.litProbs = 0;\r\n}\r\n\r\nCLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc)\r\n{\r\n  void *p;\r\n  p = alloc->Alloc(alloc, sizeof(CLzmaEnc));\r\n  if (p != 0)\r\n    LzmaEnc_Construct((CLzmaEnc *)p);\r\n  return p;\r\n}\r\n\r\nvoid LzmaEnc_FreeLits(CLzmaEnc *p, ISzAlloc *alloc)\r\n{\r\n  alloc->Free(alloc, p->litProbs);\r\n  alloc->Free(alloc, p->saveState.litProbs);\r\n  p->litProbs = 0;\r\n  p->saveState.litProbs = 0;\r\n}\r\n\r\nvoid LzmaEnc_Destruct(CLzmaEnc *p, ISzAlloc *alloc, ISzAlloc *allocBig)\r\n{\r\n  #ifndef _7ZIP_ST\r\n  MatchFinderMt_Destruct(&p->matchFinderMt, allocBig);\r\n  #endif\r\n  MatchFinder_Free(&p->matchFinderBase, allocBig);\r\n  LzmaEnc_FreeLits(p, alloc);\r\n  RangeEnc_Free(&p->rc, alloc);\r\n}\r\n\r\nvoid LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig)\r\n{\r\n  LzmaEnc_Destruct((CLzmaEnc *)p, alloc, allocBig);\r\n  alloc->Free(alloc, p);\r\n}\r\n\r\nstatic SRes LzmaEnc_CodeOneBlock(CLzmaEnc *p, Bool useLimits, UInt32 maxPackSize, UInt32 maxUnpackSize)\r\n{\r\n  UInt32 nowPos32, startPos32;\r\n  if (p->needInit)\r\n  {\r\n    p->matchFinder.Init(p->matchFinderObj);\r\n    p->needInit = 0;\r\n  }\r\n\r\n  if (p->finished)\r\n    return p->result;\r\n  RINOK(CheckErrors(p));\r\n\r\n  nowPos32 = (UInt32)p->nowPos64;\r\n  startPos32 = nowPos32;\r\n\r\n  if (p->nowPos64 == 0)\r\n  {\r\n    UInt32 numPairs;\r\n    Byte curByte;\r\n    if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0)\r\n      return Flush(p, nowPos32);\r\n    ReadMatchDistances(p, &numPairs);\r\n    RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][0], 0);\r\n    p->state = kLiteralNextStates[p->state];\r\n    curByte = p->matchFinder.GetIndexByte(p->matchFinderObj, 0 - p->additionalOffset);\r\n    LitEnc_Encode(&p->rc, p->litProbs, curByte);\r\n    p->additionalOffset--;\r\n    nowPos32++;\r\n  }\r\n\r\n  if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) != 0)\r\n  for (;;)\r\n  {\r\n    UInt32 pos, len, posState;\r\n\r\n    if (p->fastMode)\r\n      len = GetOptimumFast(p, &pos);\r\n    else\r\n      len = GetOptimum(p, nowPos32, &pos);\r\n\r\n    #ifdef SHOW_STAT2\r\n    printf(\"\\n pos = %4X,   len = %d   pos = %d\", nowPos32, len, pos);\r\n    #endif\r\n\r\n    posState = nowPos32 & p->pbMask;\r\n    if (len == 1 && pos == (UInt32)-1)\r\n    {\r\n      Byte curByte;\r\n      CLzmaProb *probs;\r\n      const Byte *data;\r\n\r\n      RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 0);\r\n      data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset;\r\n      curByte = *data;\r\n      probs = LIT_PROBS(nowPos32, *(data - 1));\r\n      if (IsCharState(p->state))\r\n        LitEnc_Encode(&p->rc, probs, curByte);\r\n      else\r\n        LitEnc_EncodeMatched(&p->rc, probs, curByte, *(data - p->reps[0] - 1));\r\n      p->state = kLiteralNextStates[p->state];\r\n    }\r\n    else\r\n    {\r\n      RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1);\r\n      if (pos < LZMA_NUM_REPS)\r\n      {\r\n        RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 1);\r\n        if (pos == 0)\r\n        {\r\n          RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 0);\r\n          RangeEnc_EncodeBit(&p->rc, &p->isRep0Long[p->state][posState], ((len == 1) ? 0 : 1));\r\n        }\r\n        else\r\n        {\r\n          UInt32 distance = p->reps[pos];\r\n          RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 1);\r\n          if (pos == 1)\r\n            RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 0);\r\n          else\r\n          {\r\n            RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 1);\r\n            RangeEnc_EncodeBit(&p->rc, &p->isRepG2[p->state], pos - 2);\r\n            if (pos == 3)\r\n              p->reps[3] = p->reps[2];\r\n            p->reps[2] = p->reps[1];\r\n          }\r\n          p->reps[1] = p->reps[0];\r\n          p->reps[0] = distance;\r\n        }\r\n        if (len == 1)\r\n          p->state = kShortRepNextStates[p->state];\r\n        else\r\n        {\r\n          LenEnc_Encode2(&p->repLenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices);\r\n          p->state = kRepNextStates[p->state];\r\n        }\r\n      }\r\n      else\r\n      {\r\n        UInt32 posSlot;\r\n        RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0);\r\n        p->state = kMatchNextStates[p->state];\r\n        LenEnc_Encode2(&p->lenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices);\r\n        pos -= LZMA_NUM_REPS;\r\n        GetPosSlot(pos, posSlot);\r\n        RcTree_Encode(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], kNumPosSlotBits, posSlot);\r\n        \r\n        if (posSlot >= kStartPosModelIndex)\r\n        {\r\n          UInt32 footerBits = ((posSlot >> 1) - 1);\r\n          UInt32 base = ((2 | (posSlot & 1)) << footerBits);\r\n          UInt32 posReduced = pos - base;\r\n\r\n          if (posSlot < kEndPosModelIndex)\r\n            RcTree_ReverseEncode(&p->rc, p->posEncoders + base - posSlot - 1, footerBits, posReduced);\r\n          else\r\n          {\r\n            RangeEnc_EncodeDirectBits(&p->rc, posReduced >> kNumAlignBits, footerBits - kNumAlignBits);\r\n            RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, posReduced & kAlignMask);\r\n            p->alignPriceCount++;\r\n          }\r\n        }\r\n        p->reps[3] = p->reps[2];\r\n        p->reps[2] = p->reps[1];\r\n        p->reps[1] = p->reps[0];\r\n        p->reps[0] = pos;\r\n        p->matchPriceCount++;\r\n      }\r\n    }\r\n    p->additionalOffset -= len;\r\n    nowPos32 += len;\r\n    if (p->additionalOffset == 0)\r\n    {\r\n      UInt32 processed;\r\n      if (!p->fastMode)\r\n      {\r\n        if (p->matchPriceCount >= (1 << 7))\r\n          FillDistancesPrices(p);\r\n        if (p->alignPriceCount >= kAlignTableSize)\r\n          FillAlignPrices(p);\r\n      }\r\n      if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0)\r\n        break;\r\n      processed = nowPos32 - startPos32;\r\n      if (useLimits)\r\n      {\r\n        if (processed + kNumOpts + 300 >= maxUnpackSize ||\r\n            RangeEnc_GetProcessed(&p->rc) + kNumOpts * 2 >= maxPackSize)\r\n          break;\r\n      }\r\n      else if (processed >= (1 << 15))\r\n      {\r\n        p->nowPos64 += nowPos32 - startPos32;\r\n        return CheckErrors(p);\r\n      }\r\n    }\r\n  }\r\n  p->nowPos64 += nowPos32 - startPos32;\r\n  return Flush(p, nowPos32);\r\n}\r\n\r\n#define kBigHashDicLimit ((UInt32)1 << 24)\r\n\r\nstatic SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig)\r\n{\r\n  UInt32 beforeSize = kNumOpts;\r\n  Bool btMode;\r\n  if (!RangeEnc_Alloc(&p->rc, alloc))\r\n    return SZ_ERROR_MEM;\r\n  btMode = (p->matchFinderBase.btMode != 0);\r\n  #ifndef _7ZIP_ST\r\n  p->mtMode = (p->multiThread && !p->fastMode && btMode);\r\n  #endif\r\n\r\n  {\r\n    unsigned lclp = p->lc + p->lp;\r\n    if (p->litProbs == 0 || p->saveState.litProbs == 0 || p->lclp != lclp)\r\n    {\r\n      LzmaEnc_FreeLits(p, alloc);\r\n      p->litProbs = (CLzmaProb *)alloc->Alloc(alloc, (0x300 << lclp) * sizeof(CLzmaProb));\r\n      p->saveState.litProbs = (CLzmaProb *)alloc->Alloc(alloc, (0x300 << lclp) * sizeof(CLzmaProb));\r\n      if (p->litProbs == 0 || p->saveState.litProbs == 0)\r\n      {\r\n        LzmaEnc_FreeLits(p, alloc);\r\n        return SZ_ERROR_MEM;\r\n      }\r\n      p->lclp = lclp;\r\n    }\r\n  }\r\n\r\n  p->matchFinderBase.bigHash = (p->dictSize > kBigHashDicLimit);\r\n\r\n  if (beforeSize + p->dictSize < keepWindowSize)\r\n    beforeSize = keepWindowSize - p->dictSize;\r\n\r\n  #ifndef _7ZIP_ST\r\n  if (p->mtMode)\r\n  {\r\n    RINOK(MatchFinderMt_Create(&p->matchFinderMt, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig));\r\n    p->matchFinderObj = &p->matchFinderMt;\r\n    MatchFinderMt_CreateVTable(&p->matchFinderMt, &p->matchFinder);\r\n  }\r\n  else\r\n  #endif\r\n  {\r\n    if (!MatchFinder_Create(&p->matchFinderBase, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig))\r\n      return SZ_ERROR_MEM;\r\n    p->matchFinderObj = &p->matchFinderBase;\r\n    MatchFinder_CreateVTable(&p->matchFinderBase, &p->matchFinder);\r\n  }\r\n  return SZ_OK;\r\n}\r\n\r\nvoid LzmaEnc_Init(CLzmaEnc *p)\r\n{\r\n  UInt32 i;\r\n  p->state = 0;\r\n  for (i = 0 ; i < LZMA_NUM_REPS; i++)\r\n    p->reps[i] = 0;\r\n\r\n  RangeEnc_Init(&p->rc);\r\n\r\n\r\n  for (i = 0; i < kNumStates; i++)\r\n  {\r\n    UInt32 j;\r\n    for (j = 0; j < LZMA_NUM_PB_STATES_MAX; j++)\r\n    {\r\n      p->isMatch[i][j] = kProbInitValue;\r\n      p->isRep0Long[i][j] = kProbInitValue;\r\n    }\r\n    p->isRep[i] = kProbInitValue;\r\n    p->isRepG0[i] = kProbInitValue;\r\n    p->isRepG1[i] = kProbInitValue;\r\n    p->isRepG2[i] = kProbInitValue;\r\n  }\r\n\r\n  {\r\n    UInt32 num = 0x300 << (p->lp + p->lc);\r\n    for (i = 0; i < num; i++)\r\n      p->litProbs[i] = kProbInitValue;\r\n  }\r\n\r\n  {\r\n    for (i = 0; i < kNumLenToPosStates; i++)\r\n    {\r\n      CLzmaProb *probs = p->posSlotEncoder[i];\r\n      UInt32 j;\r\n      for (j = 0; j < (1 << kNumPosSlotBits); j++)\r\n        probs[j] = kProbInitValue;\r\n    }\r\n  }\r\n  {\r\n    for (i = 0; i < kNumFullDistances - kEndPosModelIndex; i++)\r\n      p->posEncoders[i] = kProbInitValue;\r\n  }\r\n\r\n  LenEnc_Init(&p->lenEnc.p);\r\n  LenEnc_Init(&p->repLenEnc.p);\r\n\r\n  for (i = 0; i < (1 << kNumAlignBits); i++)\r\n    p->posAlignEncoder[i] = kProbInitValue;\r\n\r\n  p->optimumEndIndex = 0;\r\n  p->optimumCurrentIndex = 0;\r\n  p->additionalOffset = 0;\r\n\r\n  p->pbMask = (1 << p->pb) - 1;\r\n  p->lpMask = (1 << p->lp) - 1;\r\n}\r\n\r\nvoid LzmaEnc_InitPrices(CLzmaEnc *p)\r\n{\r\n  if (!p->fastMode)\r\n  {\r\n    FillDistancesPrices(p);\r\n    FillAlignPrices(p);\r\n  }\r\n\r\n  p->lenEnc.tableSize =\r\n  p->repLenEnc.tableSize =\r\n      p->numFastBytes + 1 - LZMA_MATCH_LEN_MIN;\r\n  LenPriceEnc_UpdateTables(&p->lenEnc, 1 << p->pb, p->ProbPrices);\r\n  LenPriceEnc_UpdateTables(&p->repLenEnc, 1 << p->pb, p->ProbPrices);\r\n}\r\n\r\nstatic SRes LzmaEnc_AllocAndInit(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig)\r\n{\r\n  UInt32 i;\r\n  for (i = 0; i < (UInt32)kDicLogSizeMaxCompress; i++)\r\n    if (p->dictSize <= ((UInt32)1 << i))\r\n      break;\r\n  p->distTableSize = i * 2;\r\n\r\n  p->finished = False;\r\n  p->result = SZ_OK;\r\n  RINOK(LzmaEnc_Alloc(p, keepWindowSize, alloc, allocBig));\r\n  LzmaEnc_Init(p);\r\n  LzmaEnc_InitPrices(p);\r\n  p->nowPos64 = 0;\r\n  return SZ_OK;\r\n}\r\n\r\nstatic SRes LzmaEnc_Prepare(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream,\r\n    ISzAlloc *alloc, ISzAlloc *allocBig)\r\n{\r\n  CLzmaEnc *p = (CLzmaEnc *)pp;\r\n  p->matchFinderBase.stream = inStream;\r\n  p->needInit = 1;\r\n  p->rc.outStream = outStream;\r\n  return LzmaEnc_AllocAndInit(p, 0, alloc, allocBig);\r\n}\r\n\r\nSRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle pp,\r\n    ISeqInStream *inStream, UInt32 keepWindowSize,\r\n    ISzAlloc *alloc, ISzAlloc *allocBig)\r\n{\r\n  CLzmaEnc *p = (CLzmaEnc *)pp;\r\n  p->matchFinderBase.stream = inStream;\r\n  p->needInit = 1;\r\n  return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig);\r\n}\r\n\r\nstatic void LzmaEnc_SetInputBuf(CLzmaEnc *p, const Byte *src, SizeT srcLen)\r\n{\r\n  p->matchFinderBase.directInput = 1;\r\n  p->matchFinderBase.bufferBase = (Byte *)src;\r\n  p->matchFinderBase.directInputRem = srcLen;\r\n}\r\n\r\nSRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen,\r\n    UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig)\r\n{\r\n  CLzmaEnc *p = (CLzmaEnc *)pp;\r\n  LzmaEnc_SetInputBuf(p, src, srcLen);\r\n  p->needInit = 1;\r\n\r\n  return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig);\r\n}\r\n\r\nvoid LzmaEnc_Finish(CLzmaEncHandle pp)\r\n{\r\n  #ifndef _7ZIP_ST\r\n  CLzmaEnc *p = (CLzmaEnc *)pp;\r\n  if (p->mtMode)\r\n    MatchFinderMt_ReleaseStream(&p->matchFinderMt);\r\n  #else\r\n  pp = pp;\r\n  #endif\r\n}\r\n\r\ntypedef struct\r\n{\r\n  ISeqOutStream funcTable;\r\n  Byte *data;\r\n  SizeT rem;\r\n  Bool overflow;\r\n} CSeqOutStreamBuf;\r\n\r\nstatic size_t MyWrite(void *pp, const void *data, size_t size)\r\n{\r\n  CSeqOutStreamBuf *p = (CSeqOutStreamBuf *)pp;\r\n  if (p->rem < size)\r\n  {\r\n    size = p->rem;\r\n    p->overflow = True;\r\n  }\r\n  memcpy(p->data, data, size);\r\n  p->rem -= size;\r\n  p->data += size;\r\n  return size;\r\n}\r\n\r\n\r\nUInt32 LzmaEnc_GetNumAvailableBytes(CLzmaEncHandle pp)\r\n{\r\n  const CLzmaEnc *p = (CLzmaEnc *)pp;\r\n  return p->matchFinder.GetNumAvailableBytes(p->matchFinderObj);\r\n}\r\n\r\nconst Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp)\r\n{\r\n  const CLzmaEnc *p = (CLzmaEnc *)pp;\r\n  return p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset;\r\n}\r\n\r\nSRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit,\r\n    Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize)\r\n{\r\n  CLzmaEnc *p = (CLzmaEnc *)pp;\r\n  UInt64 nowPos64;\r\n  SRes res;\r\n  CSeqOutStreamBuf outStream;\r\n\r\n  outStream.funcTable.Write = MyWrite;\r\n  outStream.data = dest;\r\n  outStream.rem = *destLen;\r\n  outStream.overflow = False;\r\n\r\n  p->writeEndMark = False;\r\n  p->finished = False;\r\n  p->result = SZ_OK;\r\n\r\n  if (reInit)\r\n    LzmaEnc_Init(p);\r\n  LzmaEnc_InitPrices(p);\r\n  nowPos64 = p->nowPos64;\r\n  RangeEnc_Init(&p->rc);\r\n  p->rc.outStream = &outStream.funcTable;\r\n\r\n  res = LzmaEnc_CodeOneBlock(p, True, desiredPackSize, *unpackSize);\r\n  \r\n  *unpackSize = (UInt32)(p->nowPos64 - nowPos64);\r\n  *destLen -= outStream.rem;\r\n  if (outStream.overflow)\r\n    return SZ_ERROR_OUTPUT_EOF;\r\n\r\n  return res;\r\n}\r\n\r\nstatic SRes LzmaEnc_Encode2(CLzmaEnc *p, ICompressProgress *progress)\r\n{\r\n  SRes res = SZ_OK;\r\n\r\n  #ifndef _7ZIP_ST\r\n  Byte allocaDummy[0x300];\r\n  int i = 0;\r\n  for (i = 0; i < 16; i++)\r\n    allocaDummy[i] = (Byte)i;\r\n  #endif\r\n\r\n  for (;;)\r\n  {\r\n    res = LzmaEnc_CodeOneBlock(p, False, 0, 0);\r\n    if (res != SZ_OK || p->finished != 0)\r\n      break;\r\n    if (progress != 0)\r\n    {\r\n      res = progress->Progress(progress, p->nowPos64, RangeEnc_GetProcessed(&p->rc));\r\n      if (res != SZ_OK)\r\n      {\r\n        res = SZ_ERROR_PROGRESS;\r\n        break;\r\n      }\r\n    }\r\n  }\r\n  LzmaEnc_Finish(p);\r\n  return res;\r\n}\r\n\r\nSRes LzmaEnc_Encode(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress,\r\n    ISzAlloc *alloc, ISzAlloc *allocBig)\r\n{\r\n  RINOK(LzmaEnc_Prepare(pp, outStream, inStream, alloc, allocBig));\r\n  return LzmaEnc_Encode2((CLzmaEnc *)pp, progress);\r\n}\r\n\r\nSRes LzmaEnc_WriteProperties(CLzmaEncHandle pp, Byte *props, SizeT *size)\r\n{\r\n  CLzmaEnc *p = (CLzmaEnc *)pp;\r\n  int i;\r\n  UInt32 dictSize = p->dictSize;\r\n  if (*size < LZMA_PROPS_SIZE)\r\n    return SZ_ERROR_PARAM;\r\n  *size = LZMA_PROPS_SIZE;\r\n  props[0] = (Byte)((p->pb * 5 + p->lp) * 9 + p->lc);\r\n\r\n  for (i = 11; i <= 30; i++)\r\n  {\r\n    if (dictSize <= ((UInt32)2 << i))\r\n    {\r\n      dictSize = (2 << i);\r\n      break;\r\n    }\r\n    if (dictSize <= ((UInt32)3 << i))\r\n    {\r\n      dictSize = (3 << i);\r\n      break;\r\n    }\r\n  }\r\n\r\n  for (i = 0; i < 4; i++)\r\n    props[1 + i] = (Byte)(dictSize >> (8 * i));\r\n  return SZ_OK;\r\n}\r\n\r\nSRes LzmaEnc_MemEncode(CLzmaEncHandle pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,\r\n    int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig)\r\n{\r\n  SRes res;\r\n  CLzmaEnc *p = (CLzmaEnc *)pp;\r\n\r\n  CSeqOutStreamBuf outStream;\r\n\r\n  LzmaEnc_SetInputBuf(p, src, srcLen);\r\n\r\n  outStream.funcTable.Write = MyWrite;\r\n  outStream.data = dest;\r\n  outStream.rem = *destLen;\r\n  outStream.overflow = False;\r\n\r\n  p->writeEndMark = writeEndMark;\r\n\r\n  p->rc.outStream = &outStream.funcTable;\r\n  res = LzmaEnc_MemPrepare(pp, src, srcLen, 0, alloc, allocBig);\r\n  if (res == SZ_OK)\r\n    res = LzmaEnc_Encode2(p, progress);\r\n\r\n  *destLen -= outStream.rem;\r\n  if (outStream.overflow)\r\n    return SZ_ERROR_OUTPUT_EOF;\r\n  return res;\r\n}\r\n\r\nSRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,\r\n    const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,\r\n    ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig)\r\n{\r\n  CLzmaEnc *p = (CLzmaEnc *)LzmaEnc_Create(alloc);\r\n  SRes res;\r\n  if (p == 0)\r\n    return SZ_ERROR_MEM;\r\n\r\n  res = LzmaEnc_SetProps(p, props);\r\n  if (res == SZ_OK)\r\n  {\r\n    res = LzmaEnc_WriteProperties(p, propsEncoded, propsSize);\r\n    if (res == SZ_OK)\r\n      res = LzmaEnc_MemEncode(p, dest, destLen, src, srcLen,\r\n          writeEndMark, progress, alloc, allocBig);\r\n  }\r\n\r\n  LzmaEnc_Destroy(p, alloc, allocBig);\r\n  return res;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/LzmaEnc.h",
    "content": "/*  LzmaEnc.h -- LZMA Encoder\r\n2011-01-27 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __LZMA_ENC_H\r\n#define __LZMA_ENC_H\r\n\r\n#include \"Types.h\"\r\n\r\nEXTERN_C_BEGIN\r\n\r\n#define LZMA_PROPS_SIZE 5\r\n\r\ntypedef struct _CLzmaEncProps\r\n{\r\n  int level;       /*  0 <= level <= 9 */\r\n  UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version\r\n                      (1 << 12) <= dictSize <= (1 << 30) for 64-bit version\r\n                       default = (1 << 24) */\r\n  UInt32 reduceSize; /* estimated size of data that will be compressed. default = 0xFFFFFFFF.\r\n                        Encoder uses this value to reduce dictionary size */\r\n  int lc;          /* 0 <= lc <= 8, default = 3 */\r\n  int lp;          /* 0 <= lp <= 4, default = 0 */\r\n  int pb;          /* 0 <= pb <= 4, default = 2 */\r\n  int algo;        /* 0 - fast, 1 - normal, default = 1 */\r\n  int fb;          /* 5 <= fb <= 273, default = 32 */\r\n  int btMode;      /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */\r\n  int numHashBytes; /* 2, 3 or 4, default = 4 */\r\n  UInt32 mc;        /* 1 <= mc <= (1 << 30), default = 32 */\r\n  unsigned writeEndMark;  /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */\r\n  int numThreads;  /* 1 or 2, default = 2 */\r\n} CLzmaEncProps;\r\n\r\nvoid LzmaEncProps_Init(CLzmaEncProps *p);\r\nvoid LzmaEncProps_Normalize(CLzmaEncProps *p);\r\nUInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2);\r\n\r\n\r\n/* ---------- CLzmaEncHandle Interface ---------- */\r\n\r\n/* LzmaEnc_* functions can return the following exit codes:\r\nReturns:\r\n  SZ_OK           - OK\r\n  SZ_ERROR_MEM    - Memory allocation error\r\n  SZ_ERROR_PARAM  - Incorrect paramater in props\r\n  SZ_ERROR_WRITE  - Write callback error.\r\n  SZ_ERROR_PROGRESS - some break from progress callback\r\n  SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)\r\n*/\r\n\r\ntypedef void * CLzmaEncHandle;\r\n\r\nCLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc);\r\nvoid LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig);\r\nSRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props);\r\nSRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size);\r\nSRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream,\r\n    ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);\r\nSRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,\r\n    int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);\r\n\r\n/* ---------- One Call Interface ---------- */\r\n\r\n/* LzmaEncode\r\nReturn code:\r\n  SZ_OK               - OK\r\n  SZ_ERROR_MEM        - Memory allocation error\r\n  SZ_ERROR_PARAM      - Incorrect paramater\r\n  SZ_ERROR_OUTPUT_EOF - output buffer overflow\r\n  SZ_ERROR_THREAD     - errors in multithreading functions (only for Mt version)\r\n*/\r\n\r\nSRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,\r\n    const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,\r\n    ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);\r\n\r\nEXTERN_C_END\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/LzmaLib.c",
    "content": "/* LzmaLib.c -- LZMA library wrapper\r\n2008-08-05\r\nIgor Pavlov\r\nPublic domain */\r\n\r\n#include \"LzmaEnc.h\"\r\n#include \"LzmaDec.h\"\r\n#include \"Alloc.h\"\r\n#include \"LzmaLib.h\"\r\n\r\nstatic void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); }\r\nstatic void SzFree(void *p, void *address) { p = p; MyFree(address); }\r\nstatic ISzAlloc g_Alloc = { SzAlloc, SzFree };\r\n\r\nMY_STDAPI LzmaCompress(unsigned char *dest, size_t  *destLen, const unsigned char *src, size_t  srcLen,\r\n  unsigned char *outProps, size_t *outPropsSize,\r\n  int level, /* 0 <= level <= 9, default = 5 */\r\n  unsigned dictSize, /* use (1 << N) or (3 << N). 4 KB < dictSize <= 128 MB */\r\n  int lc, /* 0 <= lc <= 8, default = 3  */\r\n  int lp, /* 0 <= lp <= 4, default = 0  */\r\n  int pb, /* 0 <= pb <= 4, default = 2  */\r\n  int fb,  /* 5 <= fb <= 273, default = 32 */\r\n  int numThreads /* 1 or 2, default = 2 */\r\n)\r\n{\r\n  CLzmaEncProps props;\r\n  LzmaEncProps_Init(&props);\r\n  props.level = level;\r\n  props.dictSize = dictSize;\r\n  props.lc = lc;\r\n  props.lp = lp;\r\n  props.pb = pb;\r\n  props.fb = fb;\r\n  props.numThreads = numThreads;\r\n\r\n  return LzmaEncode(dest, destLen, src, srcLen, &props, outProps, outPropsSize, 0,\r\n      NULL, &g_Alloc, &g_Alloc);\r\n}\r\n\r\n\r\nMY_STDAPI LzmaUncompress(unsigned char *dest, size_t  *destLen, const unsigned char *src, size_t  *srcLen,\r\n  const unsigned char *props, size_t propsSize)\r\n{\r\n  ELzmaStatus status;\r\n  return LzmaDecode(dest, destLen, src, srcLen, props, (unsigned)propsSize, LZMA_FINISH_ANY, &status, &g_Alloc);\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/LzmaLib.h",
    "content": "/* LzmaLib.h -- LZMA library interface\r\n2009-04-07 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __LZMA_LIB_H\r\n#define __LZMA_LIB_H\r\n\r\n#include \"Types.h\"\r\n\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n#endif\r\n\r\n#define MY_STDAPI int MY_STD_CALL\r\n\r\n#define LZMA_PROPS_SIZE 5\r\n\r\n/*\r\nRAM requirements for LZMA:\r\n  for compression:   (dictSize * 11.5 + 6 MB) + state_size\r\n  for decompression: dictSize + state_size\r\n    state_size = (4 + (1.5 << (lc + lp))) KB\r\n    by default (lc=3, lp=0), state_size = 16 KB.\r\n\r\nLZMA properties (5 bytes) format\r\n    Offset Size  Description\r\n      0     1    lc, lp and pb in encoded form.\r\n      1     4    dictSize (little endian).\r\n*/\r\n\r\n/*\r\nLzmaCompress\r\n------------\r\n\r\noutPropsSize -\r\n     In:  the pointer to the size of outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5.\r\n     Out: the pointer to the size of written properties in outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5.\r\n\r\n  LZMA Encoder will use defult values for any parameter, if it is\r\n  -1  for any from: level, loc, lp, pb, fb, numThreads\r\n   0  for dictSize\r\n  \r\nlevel - compression level: 0 <= level <= 9;\r\n\r\n  level dictSize algo  fb\r\n    0:    16 KB   0    32\r\n    1:    64 KB   0    32\r\n    2:   256 KB   0    32\r\n    3:     1 MB   0    32\r\n    4:     4 MB   0    32\r\n    5:    16 MB   1    32\r\n    6:    32 MB   1    32\r\n    7+:   64 MB   1    64\r\n \r\n  The default value for \"level\" is 5.\r\n\r\n  algo = 0 means fast method\r\n  algo = 1 means normal method\r\n\r\ndictSize - The dictionary size in bytes. The maximum value is\r\n        128 MB = (1 << 27) bytes for 32-bit version\r\n          1 GB = (1 << 30) bytes for 64-bit version\r\n     The default value is 16 MB = (1 << 24) bytes.\r\n     It's recommended to use the dictionary that is larger than 4 KB and\r\n     that can be calculated as (1 << N) or (3 << N) sizes.\r\n\r\nlc - The number of literal context bits (high bits of previous literal).\r\n     It can be in the range from 0 to 8. The default value is 3.\r\n     Sometimes lc=4 gives the gain for big files.\r\n\r\nlp - The number of literal pos bits (low bits of current position for literals).\r\n     It can be in the range from 0 to 4. The default value is 0.\r\n     The lp switch is intended for periodical data when the period is equal to 2^lp.\r\n     For example, for 32-bit (4 bytes) periodical data you can use lp=2. Often it's\r\n     better to set lc=0, if you change lp switch.\r\n\r\npb - The number of pos bits (low bits of current position).\r\n     It can be in the range from 0 to 4. The default value is 2.\r\n     The pb switch is intended for periodical data when the period is equal 2^pb.\r\n\r\nfb - Word size (the number of fast bytes).\r\n     It can be in the range from 5 to 273. The default value is 32.\r\n     Usually, a big number gives a little bit better compression ratio and\r\n     slower compression process.\r\n\r\nnumThreads - The number of thereads. 1 or 2. The default value is 2.\r\n     Fast mode (algo = 0) can use only 1 thread.\r\n\r\nOut:\r\n  destLen  - processed output size\r\nReturns:\r\n  SZ_OK               - OK\r\n  SZ_ERROR_MEM        - Memory allocation error\r\n  SZ_ERROR_PARAM      - Incorrect paramater\r\n  SZ_ERROR_OUTPUT_EOF - output buffer overflow\r\n  SZ_ERROR_THREAD     - errors in multithreading functions (only for Mt version)\r\n*/\r\n\r\nMY_STDAPI LzmaCompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen,\r\n  unsigned char *outProps, size_t *outPropsSize, /* *outPropsSize must be = 5 */\r\n  int level,      /* 0 <= level <= 9, default = 5 */\r\n  unsigned dictSize,  /* default = (1 << 24) */\r\n  int lc,        /* 0 <= lc <= 8, default = 3  */\r\n  int lp,        /* 0 <= lp <= 4, default = 0  */\r\n  int pb,        /* 0 <= pb <= 4, default = 2  */\r\n  int fb,        /* 5 <= fb <= 273, default = 32 */\r\n  int numThreads /* 1 or 2, default = 2 */\r\n  );\r\n\r\n/*\r\nLzmaUncompress\r\n--------------\r\nIn:\r\n  dest     - output data\r\n  destLen  - output data size\r\n  src      - input data\r\n  srcLen   - input data size\r\nOut:\r\n  destLen  - processed output size\r\n  srcLen   - processed input size\r\nReturns:\r\n  SZ_OK                - OK\r\n  SZ_ERROR_DATA        - Data error\r\n  SZ_ERROR_MEM         - Memory allocation arror\r\n  SZ_ERROR_UNSUPPORTED - Unsupported properties\r\n  SZ_ERROR_INPUT_EOF   - it needs more bytes in input buffer (src)\r\n*/\r\n\r\nMY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src, SizeT *srcLen,\r\n  const unsigned char *props, size_t propsSize);\r\n\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/MtCoder.c",
    "content": "/* MtCoder.c -- Multi-thread Coder\r\n2010-09-24 : Igor Pavlov : Public domain */\r\n\r\n#include <stdio.h>\r\n\r\n#include \"MtCoder.h\"\r\n\r\nvoid LoopThread_Construct(CLoopThread *p)\r\n{\r\n  Thread_Construct(&p->thread);\r\n  Event_Construct(&p->startEvent);\r\n  Event_Construct(&p->finishedEvent);\r\n}\r\n\r\nvoid LoopThread_Close(CLoopThread *p)\r\n{\r\n  Thread_Close(&p->thread);\r\n  Event_Close(&p->startEvent);\r\n  Event_Close(&p->finishedEvent);\r\n}\r\n\r\nstatic THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE LoopThreadFunc(void *pp)\r\n{\r\n  CLoopThread *p = (CLoopThread *)pp;\r\n  for (;;)\r\n  {\r\n    if (Event_Wait(&p->startEvent) != 0)\r\n      return SZ_ERROR_THREAD;\r\n    if (p->stop)\r\n      return 0;\r\n    p->res = p->func(p->param);\r\n    if (Event_Set(&p->finishedEvent) != 0)\r\n      return SZ_ERROR_THREAD;\r\n  }\r\n}\r\n\r\nWRes LoopThread_Create(CLoopThread *p)\r\n{\r\n  p->stop = 0;\r\n  RINOK(AutoResetEvent_CreateNotSignaled(&p->startEvent));\r\n  RINOK(AutoResetEvent_CreateNotSignaled(&p->finishedEvent));\r\n  return Thread_Create(&p->thread, LoopThreadFunc, p);\r\n}\r\n\r\nWRes LoopThread_StopAndWait(CLoopThread *p)\r\n{\r\n  p->stop = 1;\r\n  if (Event_Set(&p->startEvent) != 0)\r\n    return SZ_ERROR_THREAD;\r\n  return Thread_Wait(&p->thread);\r\n}\r\n\r\nWRes LoopThread_StartSubThread(CLoopThread *p) { return Event_Set(&p->startEvent); }\r\nWRes LoopThread_WaitSubThread(CLoopThread *p) { return Event_Wait(&p->finishedEvent); }\r\n\r\nstatic SRes Progress(ICompressProgress *p, UInt64 inSize, UInt64 outSize)\r\n{\r\n  return (p && p->Progress(p, inSize, outSize) != SZ_OK) ? SZ_ERROR_PROGRESS : SZ_OK;\r\n}\r\n\r\nstatic void MtProgress_Init(CMtProgress *p, ICompressProgress *progress)\r\n{\r\n  unsigned i;\r\n  for (i = 0; i < NUM_MT_CODER_THREADS_MAX; i++)\r\n    p->inSizes[i] = p->outSizes[i] = 0;\r\n  p->totalInSize = p->totalOutSize = 0;\r\n  p->progress = progress;\r\n  p->res = SZ_OK;\r\n}\r\n\r\nstatic void MtProgress_Reinit(CMtProgress *p, unsigned index)\r\n{\r\n  p->inSizes[index] = 0;\r\n  p->outSizes[index] = 0;\r\n}\r\n\r\n#define UPDATE_PROGRESS(size, prev, total) \\\r\n  if (size != (UInt64)(Int64)-1) { total += size - prev; prev = size; }\r\n\r\nSRes MtProgress_Set(CMtProgress *p, unsigned index, UInt64 inSize, UInt64 outSize)\r\n{\r\n  SRes res;\r\n  CriticalSection_Enter(&p->cs);\r\n  UPDATE_PROGRESS(inSize, p->inSizes[index], p->totalInSize)\r\n  UPDATE_PROGRESS(outSize, p->outSizes[index], p->totalOutSize)\r\n  if (p->res == SZ_OK)\r\n    p->res = Progress(p->progress, p->totalInSize, p->totalOutSize);\r\n  res = p->res;\r\n  CriticalSection_Leave(&p->cs);\r\n  return res;\r\n}\r\n\r\nstatic void MtProgress_SetError(CMtProgress *p, SRes res)\r\n{\r\n  CriticalSection_Enter(&p->cs);\r\n  if (p->res == SZ_OK)\r\n    p->res = res;\r\n  CriticalSection_Leave(&p->cs);\r\n}\r\n\r\nstatic void MtCoder_SetError(CMtCoder* p, SRes res)\r\n{\r\n  CriticalSection_Enter(&p->cs);\r\n  if (p->res == SZ_OK)\r\n    p->res = res;\r\n  CriticalSection_Leave(&p->cs);\r\n}\r\n\r\n/* ---------- MtThread ---------- */\r\n\r\nvoid CMtThread_Construct(CMtThread *p, CMtCoder *mtCoder)\r\n{\r\n  p->mtCoder = mtCoder;\r\n  p->outBuf = 0;\r\n  p->inBuf = 0;\r\n  Event_Construct(&p->canRead);\r\n  Event_Construct(&p->canWrite);\r\n  LoopThread_Construct(&p->thread);\r\n}\r\n\r\n#define RINOK_THREAD(x) { if((x) != 0) return SZ_ERROR_THREAD; }\r\n\r\nstatic void CMtThread_CloseEvents(CMtThread *p)\r\n{\r\n  Event_Close(&p->canRead);\r\n  Event_Close(&p->canWrite);\r\n}\r\n\r\nstatic void CMtThread_Destruct(CMtThread *p)\r\n{\r\n  CMtThread_CloseEvents(p);\r\n\r\n  if (Thread_WasCreated(&p->thread.thread))\r\n  {\r\n    LoopThread_StopAndWait(&p->thread);\r\n    LoopThread_Close(&p->thread);\r\n  }\r\n\r\n  if (p->mtCoder->alloc)\r\n    IAlloc_Free(p->mtCoder->alloc, p->outBuf);\r\n  p->outBuf = 0;\r\n\r\n  if (p->mtCoder->alloc)\r\n    IAlloc_Free(p->mtCoder->alloc, p->inBuf);\r\n  p->inBuf = 0;\r\n}\r\n\r\n#define MY_BUF_ALLOC(buf, size, newSize) \\\r\n  if (buf == 0 || size != newSize) \\\r\n  { IAlloc_Free(p->mtCoder->alloc, buf); \\\r\n    size = newSize; buf = (Byte *)IAlloc_Alloc(p->mtCoder->alloc, size); \\\r\n    if (buf == 0) return SZ_ERROR_MEM; }\r\n\r\nstatic SRes CMtThread_Prepare(CMtThread *p)\r\n{\r\n  MY_BUF_ALLOC(p->inBuf, p->inBufSize, p->mtCoder->blockSize)\r\n  MY_BUF_ALLOC(p->outBuf, p->outBufSize, p->mtCoder->destBlockSize)\r\n\r\n  p->stopReading = False;\r\n  p->stopWriting = False;\r\n  RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->canRead));\r\n  RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->canWrite));\r\n\r\n  return SZ_OK;\r\n}\r\n\r\nstatic SRes FullRead(ISeqInStream *stream, Byte *data, size_t *processedSize)\r\n{\r\n  size_t size = *processedSize;\r\n  *processedSize = 0;\r\n  while (size != 0)\r\n  {\r\n    size_t curSize = size;\r\n    SRes res = stream->Read(stream, data, &curSize);\r\n    *processedSize += curSize;\r\n    data += curSize;\r\n    size -= curSize;\r\n    RINOK(res);\r\n    if (curSize == 0)\r\n      return SZ_OK;\r\n  }\r\n  return SZ_OK;\r\n}\r\n\r\n#define GET_NEXT_THREAD(p) &p->mtCoder->threads[p->index == p->mtCoder->numThreads  - 1 ? 0 : p->index + 1]\r\n\r\nstatic SRes MtThread_Process(CMtThread *p, Bool *stop)\r\n{\r\n  CMtThread *next;\r\n  *stop = True;\r\n  if (Event_Wait(&p->canRead) != 0)\r\n    return SZ_ERROR_THREAD;\r\n  \r\n  next = GET_NEXT_THREAD(p);\r\n  \r\n  if (p->stopReading)\r\n  {\r\n    next->stopReading = True;\r\n    return Event_Set(&next->canRead) == 0 ? SZ_OK : SZ_ERROR_THREAD;\r\n  }\r\n\r\n  {\r\n    size_t size = p->mtCoder->blockSize;\r\n    size_t destSize = p->outBufSize;\r\n\r\n    RINOK(FullRead(p->mtCoder->inStream, p->inBuf, &size));\r\n    next->stopReading = *stop = (size != p->mtCoder->blockSize);\r\n    if (Event_Set(&next->canRead) != 0)\r\n      return SZ_ERROR_THREAD;\r\n\r\n    RINOK(p->mtCoder->mtCallback->Code(p->mtCoder->mtCallback, p->index,\r\n        p->outBuf, &destSize, p->inBuf, size, *stop));\r\n\r\n    MtProgress_Reinit(&p->mtCoder->mtProgress, p->index);\r\n\r\n    if (Event_Wait(&p->canWrite) != 0)\r\n      return SZ_ERROR_THREAD;\r\n    if (p->stopWriting)\r\n      return SZ_ERROR_FAIL;\r\n    if (p->mtCoder->outStream->Write(p->mtCoder->outStream, p->outBuf, destSize) != destSize)\r\n      return SZ_ERROR_WRITE;\r\n    return Event_Set(&next->canWrite) == 0 ? SZ_OK : SZ_ERROR_THREAD;\r\n  }\r\n}\r\n\r\nstatic THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE ThreadFunc(void *pp)\r\n{\r\n  CMtThread *p = (CMtThread *)pp;\r\n  for (;;)\r\n  {\r\n    Bool stop;\r\n    CMtThread *next = GET_NEXT_THREAD(p);\r\n    SRes res = MtThread_Process(p, &stop);\r\n    if (res != SZ_OK)\r\n    {\r\n      MtCoder_SetError(p->mtCoder, res);\r\n      MtProgress_SetError(&p->mtCoder->mtProgress, res);\r\n      next->stopReading = True;\r\n      next->stopWriting = True;\r\n      Event_Set(&next->canRead);\r\n      Event_Set(&next->canWrite);\r\n      return res;\r\n    }\r\n    if (stop)\r\n      return 0;\r\n  }\r\n}\r\n\r\nvoid MtCoder_Construct(CMtCoder* p)\r\n{\r\n  unsigned i;\r\n  p->alloc = 0;\r\n  for (i = 0; i < NUM_MT_CODER_THREADS_MAX; i++)\r\n  {\r\n    CMtThread *t = &p->threads[i];\r\n    t->index = i;\r\n    CMtThread_Construct(t, p);\r\n  }\r\n  CriticalSection_Init(&p->cs);\r\n  CriticalSection_Init(&p->mtProgress.cs);\r\n}\r\n\r\nvoid MtCoder_Destruct(CMtCoder* p)\r\n{\r\n  unsigned i;\r\n  for (i = 0; i < NUM_MT_CODER_THREADS_MAX; i++)\r\n    CMtThread_Destruct(&p->threads[i]);\r\n  CriticalSection_Delete(&p->cs);\r\n  CriticalSection_Delete(&p->mtProgress.cs);\r\n}\r\n\r\nSRes MtCoder_Code(CMtCoder *p)\r\n{\r\n  unsigned i, numThreads = p->numThreads;\r\n  SRes res = SZ_OK;\r\n  p->res = SZ_OK;\r\n\r\n  MtProgress_Init(&p->mtProgress, p->progress);\r\n\r\n  for (i = 0; i < numThreads; i++)\r\n  {\r\n    RINOK(CMtThread_Prepare(&p->threads[i]));\r\n  }\r\n\r\n  for (i = 0; i < numThreads; i++)\r\n  {\r\n    CMtThread *t = &p->threads[i];\r\n    CLoopThread *lt = &t->thread;\r\n\r\n    if (!Thread_WasCreated(&lt->thread))\r\n    {\r\n      lt->func = ThreadFunc;\r\n      lt->param = t;\r\n\r\n      if (LoopThread_Create(lt) != SZ_OK)\r\n      {\r\n        res = SZ_ERROR_THREAD;\r\n        break;\r\n      }\r\n    }\r\n  }\r\n\r\n  if (res == SZ_OK)\r\n  {\r\n    unsigned j;\r\n    for (i = 0; i < numThreads; i++)\r\n    {\r\n      CMtThread *t = &p->threads[i];\r\n      if (LoopThread_StartSubThread(&t->thread) != SZ_OK)\r\n      {\r\n        res = SZ_ERROR_THREAD;\r\n        p->threads[0].stopReading = True;\r\n        break;\r\n      }\r\n    }\r\n\r\n    Event_Set(&p->threads[0].canWrite);\r\n    Event_Set(&p->threads[0].canRead);\r\n\r\n    for (j = 0; j < i; j++)\r\n      LoopThread_WaitSubThread(&p->threads[j].thread);\r\n  }\r\n\r\n  for (i = 0; i < numThreads; i++)\r\n    CMtThread_CloseEvents(&p->threads[i]);\r\n  return (res == SZ_OK) ? p->res : res;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/MtCoder.h",
    "content": "/* MtCoder.h -- Multi-thread Coder\r\n2009-11-19 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __MT_CODER_H\r\n#define __MT_CODER_H\r\n\r\n#include \"Threads.h\"\r\n\r\nEXTERN_C_BEGIN\r\n\r\ntypedef struct\r\n{\r\n  CThread thread;\r\n  CAutoResetEvent startEvent;\r\n  CAutoResetEvent finishedEvent;\r\n  int stop;\r\n  \r\n  THREAD_FUNC_TYPE func;\r\n  LPVOID param;\r\n  THREAD_FUNC_RET_TYPE res;\r\n} CLoopThread;\r\n\r\nvoid LoopThread_Construct(CLoopThread *p);\r\nvoid LoopThread_Close(CLoopThread *p);\r\nWRes LoopThread_Create(CLoopThread *p);\r\nWRes LoopThread_StopAndWait(CLoopThread *p);\r\nWRes LoopThread_StartSubThread(CLoopThread *p);\r\nWRes LoopThread_WaitSubThread(CLoopThread *p);\r\n\r\n#ifndef _7ZIP_ST\r\n#define NUM_MT_CODER_THREADS_MAX 32\r\n#else\r\n#define NUM_MT_CODER_THREADS_MAX 1\r\n#endif\r\n\r\ntypedef struct\r\n{\r\n  UInt64 totalInSize;\r\n  UInt64 totalOutSize;\r\n  ICompressProgress *progress;\r\n  SRes res;\r\n  CCriticalSection cs;\r\n  UInt64 inSizes[NUM_MT_CODER_THREADS_MAX];\r\n  UInt64 outSizes[NUM_MT_CODER_THREADS_MAX];\r\n} CMtProgress;\r\n\r\nSRes MtProgress_Set(CMtProgress *p, unsigned index, UInt64 inSize, UInt64 outSize);\r\n\r\nstruct _CMtCoder;\r\n\r\ntypedef struct\r\n{\r\n  struct _CMtCoder *mtCoder;\r\n  Byte *outBuf;\r\n  size_t outBufSize;\r\n  Byte *inBuf;\r\n  size_t inBufSize;\r\n  unsigned index;\r\n  CLoopThread thread;\r\n\r\n  Bool stopReading;\r\n  Bool stopWriting;\r\n  CAutoResetEvent canRead;\r\n  CAutoResetEvent canWrite;\r\n} CMtThread;\r\n\r\ntypedef struct\r\n{\r\n  SRes (*Code)(void *p, unsigned index, Byte *dest, size_t *destSize,\r\n      const Byte *src, size_t srcSize, int finished);\r\n} IMtCoderCallback;\r\n\r\ntypedef struct _CMtCoder\r\n{\r\n  size_t blockSize;\r\n  size_t destBlockSize;\r\n  unsigned numThreads;\r\n  \r\n  ISeqInStream *inStream;\r\n  ISeqOutStream *outStream;\r\n  ICompressProgress *progress;\r\n  ISzAlloc *alloc;\r\n\r\n  IMtCoderCallback *mtCallback;\r\n  CCriticalSection cs;\r\n  SRes res;\r\n\r\n  CMtProgress mtProgress;\r\n  CMtThread threads[NUM_MT_CODER_THREADS_MAX];\r\n} CMtCoder;\r\n\r\nvoid MtCoder_Construct(CMtCoder* p);\r\nvoid MtCoder_Destruct(CMtCoder* p);\r\nSRes MtCoder_Code(CMtCoder *p);\r\n\r\nEXTERN_C_END\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/Ppmd.h",
    "content": "/* Ppmd.h -- PPMD codec common code\r\n2011-01-27 : Igor Pavlov : Public domain\r\nThis code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */\r\n\r\n#ifndef __PPMD_H\r\n#define __PPMD_H\r\n\r\n#include \"Types.h\"\r\n#include \"CpuArch.h\"\r\n\r\nEXTERN_C_BEGIN\r\n\r\n#ifdef MY_CPU_32BIT\r\n  #define PPMD_32BIT\r\n#endif\r\n\r\n#define PPMD_INT_BITS 7\r\n#define PPMD_PERIOD_BITS 7\r\n#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))\r\n\r\n#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))\r\n#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)\r\n#define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))\r\n#define PPMD_UPDATE_PROB_1(prob) ((prob) - PPMD_GET_MEAN(prob))\r\n\r\n#define PPMD_N1 4\r\n#define PPMD_N2 4\r\n#define PPMD_N3 4\r\n#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)\r\n#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)\r\n\r\n#pragma pack(push, 1)\r\n/* Most compilers works OK here even without #pragma pack(push, 1), but some GCC compilers need it. */\r\n\r\n/* SEE-contexts for PPM-contexts with masked symbols */\r\ntypedef struct\r\n{\r\n  UInt16 Summ; /* Freq */\r\n  Byte Shift;  /* Speed of Freq change; low Shift is for fast change */\r\n  Byte Count;  /* Count to next change of Shift */\r\n} CPpmd_See;\r\n\r\n#define Ppmd_See_Update(p)  if ((p)->Shift < PPMD_PERIOD_BITS && --(p)->Count == 0) \\\r\n    { (p)->Summ <<= 1; (p)->Count = (Byte)(3 << (p)->Shift++); }\r\n\r\ntypedef struct\r\n{\r\n  Byte Symbol;\r\n  Byte Freq;\r\n  UInt16 SuccessorLow;\r\n  UInt16 SuccessorHigh;\r\n} CPpmd_State;\r\n\r\n#pragma pack(pop)\r\n\r\ntypedef\r\n  #ifdef PPMD_32BIT\r\n    CPpmd_State *\r\n  #else\r\n    UInt32\r\n  #endif\r\n  CPpmd_State_Ref;\r\n\r\ntypedef\r\n  #ifdef PPMD_32BIT\r\n    void *\r\n  #else\r\n    UInt32\r\n  #endif\r\n  CPpmd_Void_Ref;\r\n\r\ntypedef\r\n  #ifdef PPMD_32BIT\r\n    Byte *\r\n  #else\r\n    UInt32\r\n  #endif\r\n  CPpmd_Byte_Ref;\r\n\r\n#define PPMD_SetAllBitsIn256Bytes(p) \\\r\n  { unsigned i; for (i = 0; i < 256 / sizeof(p[0]); i += 8) { \\\r\n  p[i+7] = p[i+6] = p[i+5] = p[i+4] = p[i+3] = p[i+2] = p[i+1] = p[i+0] = ~(size_t)0; }}\r\n\r\nEXTERN_C_END\r\n \r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/Ppmd7.c",
    "content": "/* Ppmd7.c -- PPMdH codec\r\n2010-03-12 : Igor Pavlov : Public domain\r\nThis code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */\r\n\r\n#include <memory.h>\r\n\r\n#include \"Ppmd7.h\"\r\n\r\nconst Byte PPMD7_kExpEscape[16] = { 25, 14, 9, 7, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2 };\r\nstatic const UInt16 kInitBinEsc[] = { 0x3CDD, 0x1F3F, 0x59BF, 0x48F3, 0x64A1, 0x5ABC, 0x6632, 0x6051};\r\n\r\n#define MAX_FREQ 124\r\n#define UNIT_SIZE 12\r\n\r\n#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)\r\n#define U2I(nu) (p->Units2Indx[(nu) - 1])\r\n#define I2U(indx) (p->Indx2Units[indx])\r\n\r\n#ifdef PPMD_32BIT\r\n  #define REF(ptr) (ptr)\r\n#else\r\n  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))\r\n#endif\r\n\r\n#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))\r\n\r\n#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))\r\n#define STATS(ctx) Ppmd7_GetStats(p, ctx)\r\n#define ONE_STATE(ctx) Ppmd7Context_OneState(ctx)\r\n#define SUFFIX(ctx) CTX((ctx)->Suffix)\r\n\r\ntypedef CPpmd7_Context * CTX_PTR;\r\n\r\nstruct CPpmd7_Node_;\r\n\r\ntypedef\r\n  #ifdef PPMD_32BIT\r\n    struct CPpmd7_Node_ *\r\n  #else\r\n    UInt32\r\n  #endif\r\n  CPpmd7_Node_Ref;\r\n\r\ntypedef struct CPpmd7_Node_\r\n{\r\n  UInt16 Stamp; /* must be at offset 0 as CPpmd7_Context::NumStats. Stamp=0 means free */\r\n  UInt16 NU;\r\n  CPpmd7_Node_Ref Next; /* must be at offset >= 4 */\r\n  CPpmd7_Node_Ref Prev;\r\n} CPpmd7_Node;\r\n\r\n#ifdef PPMD_32BIT\r\n  #define NODE(ptr) (ptr)\r\n#else\r\n  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))\r\n#endif\r\n\r\nvoid Ppmd7_Construct(CPpmd7 *p)\r\n{\r\n  unsigned i, k, m;\r\n\r\n  p->Base = 0;\r\n\r\n  for (i = 0, k = 0; i < PPMD_NUM_INDEXES; i++)\r\n  {\r\n    unsigned step = (i >= 12 ? 4 : (i >> 2) + 1);\r\n    do { p->Units2Indx[k++] = (Byte)i; } while(--step);\r\n    p->Indx2Units[i] = (Byte)k;\r\n  }\r\n\r\n  p->NS2BSIndx[0] = (0 << 1);\r\n  p->NS2BSIndx[1] = (1 << 1);\r\n  memset(p->NS2BSIndx + 2, (2 << 1), 9);\r\n  memset(p->NS2BSIndx + 11, (3 << 1), 256 - 11);\r\n\r\n  for (i = 0; i < 3; i++)\r\n    p->NS2Indx[i] = (Byte)i;\r\n  for (m = i, k = 1; i < 256; i++)\r\n  {\r\n    p->NS2Indx[i] = (Byte)m;\r\n    if (--k == 0)\r\n      k = (++m) - 2;\r\n  }\r\n\r\n  memset(p->HB2Flag, 0, 0x40);\r\n  memset(p->HB2Flag + 0x40, 8, 0x100 - 0x40);\r\n}\r\n\r\nvoid Ppmd7_Free(CPpmd7 *p, ISzAlloc *alloc)\r\n{\r\n  alloc->Free(alloc, p->Base);\r\n  p->Size = 0;\r\n  p->Base = 0;\r\n}\r\n\r\nBool Ppmd7_Alloc(CPpmd7 *p, UInt32 size, ISzAlloc *alloc)\r\n{\r\n  if (p->Base == 0 || p->Size != size)\r\n  {\r\n    Ppmd7_Free(p, alloc);\r\n    p->AlignOffset =\r\n      #ifdef PPMD_32BIT\r\n        (4 - size) & 3;\r\n      #else\r\n        4 - (size & 3);\r\n      #endif\r\n    if ((p->Base = (Byte *)alloc->Alloc(alloc, p->AlignOffset + size\r\n        #ifndef PPMD_32BIT\r\n        + UNIT_SIZE\r\n        #endif\r\n        )) == 0)\r\n      return False;\r\n    p->Size = size;\r\n  }\r\n  return True;\r\n}\r\n\r\nstatic void InsertNode(CPpmd7 *p, void *node, unsigned indx)\r\n{\r\n  *((CPpmd_Void_Ref *)node) = p->FreeList[indx];\r\n  p->FreeList[indx] = REF(node);\r\n}\r\n\r\nstatic void *RemoveNode(CPpmd7 *p, unsigned indx)\r\n{\r\n  CPpmd_Void_Ref *node = (CPpmd_Void_Ref *)Ppmd7_GetPtr(p, p->FreeList[indx]);\r\n  p->FreeList[indx] = *node;\r\n  return node;\r\n}\r\n\r\nstatic void SplitBlock(CPpmd7 *p, void *ptr, unsigned oldIndx, unsigned newIndx)\r\n{\r\n  unsigned i, nu = I2U(oldIndx) - I2U(newIndx);\r\n  ptr = (Byte *)ptr + U2B(I2U(newIndx));\r\n  if (I2U(i = U2I(nu)) != nu)\r\n  {\r\n    unsigned k = I2U(--i);\r\n    InsertNode(p, ((Byte *)ptr) + U2B(k), nu - k - 1);\r\n  }\r\n  InsertNode(p, ptr, i);\r\n}\r\n\r\nstatic void GlueFreeBlocks(CPpmd7 *p)\r\n{\r\n  #ifdef PPMD_32BIT\r\n  CPpmd7_Node headItem;\r\n  CPpmd7_Node_Ref head = &headItem;\r\n  #else\r\n  CPpmd7_Node_Ref head = p->AlignOffset + p->Size;\r\n  #endif\r\n  \r\n  CPpmd7_Node_Ref n = head;\r\n  unsigned i;\r\n\r\n  p->GlueCount = 255;\r\n\r\n  /* create doubly-linked list of free blocks */\r\n  for (i = 0; i < PPMD_NUM_INDEXES; i++)\r\n  {\r\n    UInt16 nu = I2U(i);\r\n    CPpmd7_Node_Ref next = (CPpmd7_Node_Ref)p->FreeList[i];\r\n    p->FreeList[i] = 0;\r\n    while (next != 0)\r\n    {\r\n      CPpmd7_Node *node = NODE(next);\r\n      node->Next = n;\r\n      n = NODE(n)->Prev = next;\r\n      next = *(const CPpmd7_Node_Ref *)node;\r\n      node->Stamp = 0;\r\n      node->NU = (UInt16)nu;\r\n    }\r\n  }\r\n  NODE(head)->Stamp = 1;\r\n  NODE(head)->Next = n;\r\n  NODE(n)->Prev = head;\r\n  if (p->LoUnit != p->HiUnit)\r\n    ((CPpmd7_Node *)p->LoUnit)->Stamp = 1;\r\n  \r\n  /* Glue free blocks */\r\n  while (n != head)\r\n  {\r\n    CPpmd7_Node *node = NODE(n);\r\n    UInt32 nu = (UInt32)node->NU;\r\n    for (;;)\r\n    {\r\n      CPpmd7_Node *node2 = NODE(n) + nu;\r\n      nu += node2->NU;\r\n      if (node2->Stamp != 0 || nu >= 0x10000)\r\n        break;\r\n      NODE(node2->Prev)->Next = node2->Next;\r\n      NODE(node2->Next)->Prev = node2->Prev;\r\n      node->NU = (UInt16)nu;\r\n    }\r\n    n = node->Next;\r\n  }\r\n  \r\n  /* Fill lists of free blocks */\r\n  for (n = NODE(head)->Next; n != head;)\r\n  {\r\n    CPpmd7_Node *node = NODE(n);\r\n    unsigned nu;\r\n    CPpmd7_Node_Ref next = node->Next;\r\n    for (nu = node->NU; nu > 128; nu -= 128, node += 128)\r\n      InsertNode(p, node, PPMD_NUM_INDEXES - 1);\r\n    if (I2U(i = U2I(nu)) != nu)\r\n    {\r\n      unsigned k = I2U(--i);\r\n      InsertNode(p, node + k, nu - k - 1);\r\n    }\r\n    InsertNode(p, node, i);\r\n    n = next;\r\n  }\r\n}\r\n\r\nstatic void *AllocUnitsRare(CPpmd7 *p, unsigned indx)\r\n{\r\n  unsigned i;\r\n  void *retVal;\r\n  if (p->GlueCount == 0)\r\n  {\r\n    GlueFreeBlocks(p);\r\n    if (p->FreeList[indx] != 0)\r\n      return RemoveNode(p, indx);\r\n  }\r\n  i = indx;\r\n  do\r\n  {\r\n    if (++i == PPMD_NUM_INDEXES)\r\n    {\r\n      UInt32 numBytes = U2B(I2U(indx));\r\n      p->GlueCount--;\r\n      return ((UInt32)(p->UnitsStart - p->Text) > numBytes) ? (p->UnitsStart -= numBytes) : (NULL);\r\n    }\r\n  }\r\n  while (p->FreeList[i] == 0);\r\n  retVal = RemoveNode(p, i);\r\n  SplitBlock(p, retVal, i, indx);\r\n  return retVal;\r\n}\r\n\r\nstatic void *AllocUnits(CPpmd7 *p, unsigned indx)\r\n{\r\n  UInt32 numBytes;\r\n  if (p->FreeList[indx] != 0)\r\n    return RemoveNode(p, indx);\r\n  numBytes = U2B(I2U(indx));\r\n  if (numBytes <= (UInt32)(p->HiUnit - p->LoUnit))\r\n  {\r\n    void *retVal = p->LoUnit;\r\n    p->LoUnit += numBytes;\r\n    return retVal;\r\n  }\r\n  return AllocUnitsRare(p, indx);\r\n}\r\n\r\n#define MyMem12Cpy(dest, src, num) \\\r\n  { UInt32 *d = (UInt32 *)dest; const UInt32 *s = (const UInt32 *)src; UInt32 n = num; \\\r\n    do { d[0] = s[0]; d[1] = s[1]; d[2] = s[2]; s += 3; d += 3; } while(--n); }\r\n\r\nstatic void *ShrinkUnits(CPpmd7 *p, void *oldPtr, unsigned oldNU, unsigned newNU)\r\n{\r\n  unsigned i0 = U2I(oldNU);\r\n  unsigned i1 = U2I(newNU);\r\n  if (i0 == i1)\r\n    return oldPtr;\r\n  if (p->FreeList[i1] != 0)\r\n  {\r\n    void *ptr = RemoveNode(p, i1);\r\n    MyMem12Cpy(ptr, oldPtr, newNU);\r\n    InsertNode(p, oldPtr, i0);\r\n    return ptr;\r\n  }\r\n  SplitBlock(p, oldPtr, i0, i1);\r\n  return oldPtr;\r\n}\r\n\r\n#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))\r\n\r\nstatic void SetSuccessor(CPpmd_State *p, CPpmd_Void_Ref v)\r\n{\r\n  (p)->SuccessorLow = (UInt16)((UInt32)(v) & 0xFFFF);\r\n  (p)->SuccessorHigh = (UInt16)(((UInt32)(v) >> 16) & 0xFFFF);\r\n}\r\n\r\nstatic void RestartModel(CPpmd7 *p)\r\n{\r\n  unsigned i, k, m;\r\n\r\n  memset(p->FreeList, 0, sizeof(p->FreeList));\r\n  p->Text = p->Base + p->AlignOffset;\r\n  p->HiUnit = p->Text + p->Size;\r\n  p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;\r\n  p->GlueCount = 0;\r\n\r\n  p->OrderFall = p->MaxOrder;\r\n  p->RunLength = p->InitRL = -(Int32)((p->MaxOrder < 12) ? p->MaxOrder : 12) - 1;\r\n  p->PrevSuccess = 0;\r\n\r\n  p->MinContext = p->MaxContext = (CTX_PTR)(p->HiUnit -= UNIT_SIZE); /* AllocContext(p); */\r\n  p->MinContext->Suffix = 0;\r\n  p->MinContext->NumStats = 256;\r\n  p->MinContext->SummFreq = 256 + 1;\r\n  p->FoundState = (CPpmd_State *)p->LoUnit; /* AllocUnits(p, PPMD_NUM_INDEXES - 1); */\r\n  p->LoUnit += U2B(256 / 2);\r\n  p->MinContext->Stats = REF(p->FoundState);\r\n  for (i = 0; i < 256; i++)\r\n  {\r\n    CPpmd_State *s = &p->FoundState[i];\r\n    s->Symbol = (Byte)i;\r\n    s->Freq = 1;\r\n    SetSuccessor(s, 0);\r\n  }\r\n\r\n  for (i = 0; i < 128; i++)\r\n    for (k = 0; k < 8; k++)\r\n    {\r\n      UInt16 *dest = p->BinSumm[i] + k;\r\n      UInt16 val = (UInt16)(PPMD_BIN_SCALE - kInitBinEsc[k] / (i + 2));\r\n      for (m = 0; m < 64; m += 8)\r\n        dest[m] = val;\r\n    }\r\n  \r\n  for (i = 0; i < 25; i++)\r\n    for (k = 0; k < 16; k++)\r\n    {\r\n      CPpmd_See *s = &p->See[i][k];\r\n      s->Summ = (UInt16)((5 * i + 10) << (s->Shift = PPMD_PERIOD_BITS - 4));\r\n      s->Count = 4;\r\n    }\r\n}\r\n\r\nvoid Ppmd7_Init(CPpmd7 *p, unsigned maxOrder)\r\n{\r\n  p->MaxOrder = maxOrder;\r\n  RestartModel(p);\r\n  p->DummySee.Shift = PPMD_PERIOD_BITS;\r\n  p->DummySee.Summ = 0; /* unused */\r\n  p->DummySee.Count = 64; /* unused */\r\n}\r\n\r\nstatic CTX_PTR CreateSuccessors(CPpmd7 *p, Bool skip)\r\n{\r\n  CPpmd_State upState;\r\n  CTX_PTR c = p->MinContext;\r\n  CPpmd_Byte_Ref upBranch = (CPpmd_Byte_Ref)SUCCESSOR(p->FoundState);\r\n  CPpmd_State *ps[PPMD7_MAX_ORDER];\r\n  unsigned numPs = 0;\r\n  \r\n  if (!skip)\r\n    ps[numPs++] = p->FoundState;\r\n  \r\n  while (c->Suffix)\r\n  {\r\n    CPpmd_Void_Ref successor;\r\n    CPpmd_State *s;\r\n    c = SUFFIX(c);\r\n    if (c->NumStats != 1)\r\n    {\r\n      for (s = STATS(c); s->Symbol != p->FoundState->Symbol; s++);\r\n    }\r\n    else\r\n      s = ONE_STATE(c);\r\n    successor = SUCCESSOR(s);\r\n    if (successor != upBranch)\r\n    {\r\n      c = CTX(successor);\r\n      if (numPs == 0)\r\n        return c;\r\n      break;\r\n    }\r\n    ps[numPs++] = s;\r\n  }\r\n  \r\n  upState.Symbol = *(const Byte *)Ppmd7_GetPtr(p, upBranch);\r\n  SetSuccessor(&upState, upBranch + 1);\r\n  \r\n  if (c->NumStats == 1)\r\n    upState.Freq = ONE_STATE(c)->Freq;\r\n  else\r\n  {\r\n    UInt32 cf, s0;\r\n    CPpmd_State *s;\r\n    for (s = STATS(c); s->Symbol != upState.Symbol; s++);\r\n    cf = s->Freq - 1;\r\n    s0 = c->SummFreq - c->NumStats - cf;\r\n    upState.Freq = (Byte)(1 + ((2 * cf <= s0) ? (5 * cf > s0) : ((2 * cf + 3 * s0 - 1) / (2 * s0))));\r\n  }\r\n\r\n  do\r\n  {\r\n    /* Create Child */\r\n    CTX_PTR c1; /* = AllocContext(p); */\r\n    if (p->HiUnit != p->LoUnit)\r\n      c1 = (CTX_PTR)(p->HiUnit -= UNIT_SIZE);\r\n    else if (p->FreeList[0] != 0)\r\n      c1 = (CTX_PTR)RemoveNode(p, 0);\r\n    else\r\n    {\r\n      c1 = (CTX_PTR)AllocUnitsRare(p, 0);\r\n      if (!c1)\r\n        return NULL;\r\n    }\r\n    c1->NumStats = 1;\r\n    *ONE_STATE(c1) = upState;\r\n    c1->Suffix = REF(c);\r\n    SetSuccessor(ps[--numPs], REF(c1));\r\n    c = c1;\r\n  }\r\n  while (numPs != 0);\r\n  \r\n  return c;\r\n}\r\n\r\nstatic void SwapStates(CPpmd_State *t1, CPpmd_State *t2)\r\n{\r\n  CPpmd_State tmp = *t1;\r\n  *t1 = *t2;\r\n  *t2 = tmp;\r\n}\r\n\r\nstatic void UpdateModel(CPpmd7 *p)\r\n{\r\n  CPpmd_Void_Ref successor, fSuccessor = SUCCESSOR(p->FoundState);\r\n  CTX_PTR c;\r\n  unsigned s0, ns;\r\n  \r\n  if (p->FoundState->Freq < MAX_FREQ / 4 && p->MinContext->Suffix != 0)\r\n  {\r\n    c = SUFFIX(p->MinContext);\r\n    \r\n    if (c->NumStats == 1)\r\n    {\r\n      CPpmd_State *s = ONE_STATE(c);\r\n      if (s->Freq < 32)\r\n        s->Freq++;\r\n    }\r\n    else\r\n    {\r\n      CPpmd_State *s = STATS(c);\r\n      if (s->Symbol != p->FoundState->Symbol)\r\n      {\r\n        do { s++; } while (s->Symbol != p->FoundState->Symbol);\r\n        if (s[0].Freq >= s[-1].Freq)\r\n        {\r\n          SwapStates(&s[0], &s[-1]);\r\n          s--;\r\n        }\r\n      }\r\n      if (s->Freq < MAX_FREQ - 9)\r\n      {\r\n        s->Freq += 2;\r\n        c->SummFreq += 2;\r\n      }\r\n    }\r\n  }\r\n\r\n  if (p->OrderFall == 0)\r\n  {\r\n    p->MinContext = p->MaxContext = CreateSuccessors(p, True);\r\n    if (p->MinContext == 0)\r\n    {\r\n      RestartModel(p);\r\n      return;\r\n    }\r\n    SetSuccessor(p->FoundState, REF(p->MinContext));\r\n    return;\r\n  }\r\n  \r\n  *p->Text++ = p->FoundState->Symbol;\r\n  successor = REF(p->Text);\r\n  if (p->Text >= p->UnitsStart)\r\n  {\r\n    RestartModel(p);\r\n    return;\r\n  }\r\n  \r\n  if (fSuccessor)\r\n  {\r\n    if (fSuccessor <= successor)\r\n    {\r\n      CTX_PTR cs = CreateSuccessors(p, False);\r\n      if (cs == NULL)\r\n      {\r\n        RestartModel(p);\r\n        return;\r\n      }\r\n      fSuccessor = REF(cs);\r\n    }\r\n    if (--p->OrderFall == 0)\r\n    {\r\n      successor = fSuccessor;\r\n      p->Text -= (p->MaxContext != p->MinContext);\r\n    }\r\n  }\r\n  else\r\n  {\r\n    SetSuccessor(p->FoundState, successor);\r\n    fSuccessor = REF(p->MinContext);\r\n  }\r\n  \r\n  s0 = p->MinContext->SummFreq - (ns = p->MinContext->NumStats) - (p->FoundState->Freq - 1);\r\n  \r\n  for (c = p->MaxContext; c != p->MinContext; c = SUFFIX(c))\r\n  {\r\n    unsigned ns1;\r\n    UInt32 cf, sf;\r\n    if ((ns1 = c->NumStats) != 1)\r\n    {\r\n      if ((ns1 & 1) == 0)\r\n      {\r\n        /* Expand for one UNIT */\r\n        unsigned oldNU = ns1 >> 1;\r\n        unsigned i = U2I(oldNU);\r\n        if (i != U2I(oldNU + 1))\r\n        {\r\n          void *ptr = AllocUnits(p, i + 1);\r\n          void *oldPtr;\r\n          if (!ptr)\r\n          {\r\n            RestartModel(p);\r\n            return;\r\n          }\r\n          oldPtr = STATS(c);\r\n          MyMem12Cpy(ptr, oldPtr, oldNU);\r\n          InsertNode(p, oldPtr, i);\r\n          c->Stats = STATS_REF(ptr);\r\n        }\r\n      }\r\n      c->SummFreq = (UInt16)(c->SummFreq + (2 * ns1 < ns) + 2 * ((4 * ns1 <= ns) & (c->SummFreq <= 8 * ns1)));\r\n    }\r\n    else\r\n    {\r\n      CPpmd_State *s = (CPpmd_State*)AllocUnits(p, 0);\r\n      if (!s)\r\n      {\r\n        RestartModel(p);\r\n        return;\r\n      }\r\n      *s = *ONE_STATE(c);\r\n      c->Stats = REF(s);\r\n      if (s->Freq < MAX_FREQ / 4 - 1)\r\n        s->Freq <<= 1;\r\n      else\r\n        s->Freq = MAX_FREQ - 4;\r\n      c->SummFreq = (UInt16)(s->Freq + p->InitEsc + (ns > 3));\r\n    }\r\n    cf = 2 * (UInt32)p->FoundState->Freq * (c->SummFreq + 6);\r\n    sf = (UInt32)s0 + c->SummFreq;\r\n    if (cf < 6 * sf)\r\n    {\r\n      cf = 1 + (cf > sf) + (cf >= 4 * sf);\r\n      c->SummFreq += 3;\r\n    }\r\n    else\r\n    {\r\n      cf = 4 + (cf >= 9 * sf) + (cf >= 12 * sf) + (cf >= 15 * sf);\r\n      c->SummFreq = (UInt16)(c->SummFreq + cf);\r\n    }\r\n    {\r\n      CPpmd_State *s = STATS(c) + ns1;\r\n      SetSuccessor(s, successor);\r\n      s->Symbol = p->FoundState->Symbol;\r\n      s->Freq = (Byte)cf;\r\n      c->NumStats = (UInt16)(ns1 + 1);\r\n    }\r\n  }\r\n  p->MaxContext = p->MinContext = CTX(fSuccessor);\r\n}\r\n  \r\nstatic void Rescale(CPpmd7 *p)\r\n{\r\n  unsigned i, adder, sumFreq, escFreq;\r\n  CPpmd_State *stats = STATS(p->MinContext);\r\n  CPpmd_State *s = p->FoundState;\r\n  {\r\n    CPpmd_State tmp = *s;\r\n    for (; s != stats; s--)\r\n      s[0] = s[-1];\r\n    *s = tmp;\r\n  }\r\n  escFreq = p->MinContext->SummFreq - s->Freq;\r\n  s->Freq += 4;\r\n  adder = (p->OrderFall != 0);\r\n  s->Freq = (Byte)((s->Freq + adder) >> 1);\r\n  sumFreq = s->Freq;\r\n  \r\n  i = p->MinContext->NumStats - 1;\r\n  do\r\n  {\r\n    escFreq -= (++s)->Freq;\r\n    s->Freq = (Byte)((s->Freq + adder) >> 1);\r\n    sumFreq += s->Freq;\r\n    if (s[0].Freq > s[-1].Freq)\r\n    {\r\n      CPpmd_State *s1 = s;\r\n      CPpmd_State tmp = *s1;\r\n      do\r\n        s1[0] = s1[-1];\r\n      while (--s1 != stats && tmp.Freq > s1[-1].Freq);\r\n      *s1 = tmp;\r\n    }\r\n  }\r\n  while (--i);\r\n  \r\n  if (s->Freq == 0)\r\n  {\r\n    unsigned numStats = p->MinContext->NumStats;\r\n    unsigned n0, n1;\r\n    do { i++; } while ((--s)->Freq == 0);\r\n    escFreq += i;\r\n    p->MinContext->NumStats = (UInt16)(p->MinContext->NumStats - i);\r\n    if (p->MinContext->NumStats == 1)\r\n    {\r\n      CPpmd_State tmp = *stats;\r\n      do\r\n      {\r\n        tmp.Freq = (Byte)(tmp.Freq - (tmp.Freq >> 1));\r\n        escFreq >>= 1;\r\n      }\r\n      while (escFreq > 1);\r\n      InsertNode(p, stats, U2I(((numStats + 1) >> 1)));\r\n      *(p->FoundState = ONE_STATE(p->MinContext)) = tmp;\r\n      return;\r\n    }\r\n    n0 = (numStats + 1) >> 1;\r\n    n1 = (p->MinContext->NumStats + 1) >> 1;\r\n    if (n0 != n1)\r\n      p->MinContext->Stats = STATS_REF(ShrinkUnits(p, stats, n0, n1));\r\n  }\r\n  p->MinContext->SummFreq = (UInt16)(sumFreq + escFreq - (escFreq >> 1));\r\n  p->FoundState = STATS(p->MinContext);\r\n}\r\n\r\nCPpmd_See *Ppmd7_MakeEscFreq(CPpmd7 *p, unsigned numMasked, UInt32 *escFreq)\r\n{\r\n  CPpmd_See *see;\r\n  unsigned nonMasked = p->MinContext->NumStats - numMasked;\r\n  if (p->MinContext->NumStats != 256)\r\n  {\r\n    see = p->See[p->NS2Indx[nonMasked - 1]] +\r\n        (nonMasked < (unsigned)SUFFIX(p->MinContext)->NumStats - p->MinContext->NumStats) +\r\n        2 * (p->MinContext->SummFreq < 11 * p->MinContext->NumStats) +\r\n        4 * (numMasked > nonMasked) +\r\n        p->HiBitsFlag;\r\n    {\r\n      unsigned r = (see->Summ >> see->Shift);\r\n      see->Summ = (UInt16)(see->Summ - r);\r\n      *escFreq = r + (r == 0);\r\n    }\r\n  }\r\n  else\r\n  {\r\n    see = &p->DummySee;\r\n    *escFreq = 1;\r\n  }\r\n  return see;\r\n}\r\n\r\nstatic void NextContext(CPpmd7 *p)\r\n{\r\n  CTX_PTR c = CTX(SUCCESSOR(p->FoundState));\r\n  if (p->OrderFall == 0 && (Byte *)c > p->Text)\r\n    p->MinContext = p->MaxContext = c;\r\n  else\r\n    UpdateModel(p);\r\n}\r\n\r\nvoid Ppmd7_Update1(CPpmd7 *p)\r\n{\r\n  CPpmd_State *s = p->FoundState;\r\n  s->Freq += 4;\r\n  p->MinContext->SummFreq += 4;\r\n  if (s[0].Freq > s[-1].Freq)\r\n  {\r\n    SwapStates(&s[0], &s[-1]);\r\n    p->FoundState = --s;\r\n    if (s->Freq > MAX_FREQ)\r\n      Rescale(p);\r\n  }\r\n  NextContext(p);\r\n}\r\n\r\nvoid Ppmd7_Update1_0(CPpmd7 *p)\r\n{\r\n  p->PrevSuccess = (2 * p->FoundState->Freq > p->MinContext->SummFreq);\r\n  p->RunLength += p->PrevSuccess;\r\n  p->MinContext->SummFreq += 4;\r\n  if ((p->FoundState->Freq += 4) > MAX_FREQ)\r\n    Rescale(p);\r\n  NextContext(p);\r\n}\r\n\r\nvoid Ppmd7_UpdateBin(CPpmd7 *p)\r\n{\r\n  p->FoundState->Freq = (Byte)(p->FoundState->Freq + (p->FoundState->Freq < 128 ? 1: 0));\r\n  p->PrevSuccess = 1;\r\n  p->RunLength++;\r\n  NextContext(p);\r\n}\r\n\r\nvoid Ppmd7_Update2(CPpmd7 *p)\r\n{\r\n  p->MinContext->SummFreq += 4;\r\n  if ((p->FoundState->Freq += 4) > MAX_FREQ)\r\n    Rescale(p);\r\n  p->RunLength = p->InitRL;\r\n  UpdateModel(p);\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/Ppmd7.h",
    "content": "/* Ppmd7.h -- PPMdH compression codec\r\n2010-03-12 : Igor Pavlov : Public domain\r\nThis code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */\r\n\r\n/* This code supports virtual RangeDecoder and includes the implementation\r\nof RangeCoder from 7z, instead of RangeCoder from original PPMd var.H.\r\nIf you need the compatibility with original PPMd var.H, you can use external RangeDecoder */\r\n\r\n#ifndef __PPMD7_H\r\n#define __PPMD7_H\r\n\r\n#include \"Ppmd.h\"\r\n\r\nEXTERN_C_BEGIN\r\n\r\n#define PPMD7_MIN_ORDER 2\r\n#define PPMD7_MAX_ORDER 64\r\n\r\n#define PPMD7_MIN_MEM_SIZE (1 << 11)\r\n#define PPMD7_MAX_MEM_SIZE (0xFFFFFFFF - 12 * 3)\r\n\r\nstruct CPpmd7_Context_;\r\n\r\ntypedef\r\n  #ifdef PPMD_32BIT\r\n    struct CPpmd7_Context_ *\r\n  #else\r\n    UInt32\r\n  #endif\r\n  CPpmd7_Context_Ref;\r\n\r\ntypedef struct CPpmd7_Context_\r\n{\r\n  UInt16 NumStats;\r\n  UInt16 SummFreq;\r\n  CPpmd_State_Ref Stats;\r\n  CPpmd7_Context_Ref Suffix;\r\n} CPpmd7_Context;\r\n\r\n#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)\r\n\r\ntypedef struct\r\n{\r\n  CPpmd7_Context *MinContext, *MaxContext;\r\n  CPpmd_State *FoundState;\r\n  unsigned OrderFall, InitEsc, PrevSuccess, MaxOrder, HiBitsFlag;\r\n  Int32 RunLength, InitRL; /* must be 32-bit at least */\r\n\r\n  UInt32 Size;\r\n  UInt32 GlueCount;\r\n  Byte *Base, *LoUnit, *HiUnit, *Text, *UnitsStart;\r\n  UInt32 AlignOffset;\r\n\r\n  Byte Indx2Units[PPMD_NUM_INDEXES];\r\n  Byte Units2Indx[128];\r\n  CPpmd_Void_Ref FreeList[PPMD_NUM_INDEXES];\r\n  Byte NS2Indx[256], NS2BSIndx[256], HB2Flag[256];\r\n  CPpmd_See DummySee, See[25][16];\r\n  UInt16 BinSumm[128][64];\r\n} CPpmd7;\r\n\r\nvoid Ppmd7_Construct(CPpmd7 *p);\r\nBool Ppmd7_Alloc(CPpmd7 *p, UInt32 size, ISzAlloc *alloc);\r\nvoid Ppmd7_Free(CPpmd7 *p, ISzAlloc *alloc);\r\nvoid Ppmd7_Init(CPpmd7 *p, unsigned maxOrder);\r\n#define Ppmd7_WasAllocated(p) ((p)->Base != NULL)\r\n\r\n\r\n/* ---------- Internal Functions ---------- */\r\n\r\nextern const Byte PPMD7_kExpEscape[16];\r\n\r\n#ifdef PPMD_32BIT\r\n  #define Ppmd7_GetPtr(p, ptr) (ptr)\r\n  #define Ppmd7_GetContext(p, ptr) (ptr)\r\n  #define Ppmd7_GetStats(p, ctx) ((ctx)->Stats)\r\n#else\r\n  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))\r\n  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))\r\n  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))\r\n#endif\r\n\r\nvoid Ppmd7_Update1(CPpmd7 *p);\r\nvoid Ppmd7_Update1_0(CPpmd7 *p);\r\nvoid Ppmd7_Update2(CPpmd7 *p);\r\nvoid Ppmd7_UpdateBin(CPpmd7 *p);\r\n\r\n#define Ppmd7_GetBinSumm(p) \\\r\n    &p->BinSumm[Ppmd7Context_OneState(p->MinContext)->Freq - 1][p->PrevSuccess + \\\r\n    p->NS2BSIndx[Ppmd7_GetContext(p, p->MinContext->Suffix)->NumStats - 1] + \\\r\n    (p->HiBitsFlag = p->HB2Flag[p->FoundState->Symbol]) + \\\r\n    2 * p->HB2Flag[Ppmd7Context_OneState(p->MinContext)->Symbol] + \\\r\n    ((p->RunLength >> 26) & 0x20)]\r\n\r\nCPpmd_See *Ppmd7_MakeEscFreq(CPpmd7 *p, unsigned numMasked, UInt32 *scale);\r\n\r\n\r\n/* ---------- Decode ---------- */\r\n\r\ntypedef struct\r\n{\r\n  UInt32 (*GetThreshold)(void *p, UInt32 total);\r\n  void (*Decode)(void *p, UInt32 start, UInt32 size);\r\n  UInt32 (*DecodeBit)(void *p, UInt32 size0);\r\n} IPpmd7_RangeDec;\r\n\r\ntypedef struct\r\n{\r\n  IPpmd7_RangeDec p;\r\n  UInt32 Range;\r\n  UInt32 Code;\r\n  IByteIn *Stream;\r\n} CPpmd7z_RangeDec;\r\n\r\nvoid Ppmd7z_RangeDec_CreateVTable(CPpmd7z_RangeDec *p);\r\nBool Ppmd7z_RangeDec_Init(CPpmd7z_RangeDec *p);\r\n#define Ppmd7z_RangeDec_IsFinishedOK(p) ((p)->Code == 0)\r\n\r\nint Ppmd7_DecodeSymbol(CPpmd7 *p, IPpmd7_RangeDec *rc);\r\n\r\n\r\n/* ---------- Encode ---------- */\r\n\r\ntypedef struct\r\n{\r\n  UInt64 Low;\r\n  UInt32 Range;\r\n  Byte Cache;\r\n  UInt64 CacheSize;\r\n  IByteOut *Stream;\r\n} CPpmd7z_RangeEnc;\r\n\r\nvoid Ppmd7z_RangeEnc_Init(CPpmd7z_RangeEnc *p);\r\nvoid Ppmd7z_RangeEnc_FlushData(CPpmd7z_RangeEnc *p);\r\n\r\nvoid Ppmd7_EncodeSymbol(CPpmd7 *p, CPpmd7z_RangeEnc *rc, int symbol);\r\n\r\nEXTERN_C_END\r\n \r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/Ppmd7Dec.c",
    "content": "/* Ppmd7Dec.c -- PPMdH Decoder\r\n2010-03-12 : Igor Pavlov : Public domain\r\nThis code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */\r\n\r\n#include \"Ppmd7.h\"\r\n\r\n#define kTopValue (1 << 24)\r\n\r\nBool Ppmd7z_RangeDec_Init(CPpmd7z_RangeDec *p)\r\n{\r\n  unsigned i;\r\n  p->Code = 0;\r\n  p->Range = 0xFFFFFFFF;\r\n  if (p->Stream->Read((void *)p->Stream) != 0)\r\n    return False;\r\n  for (i = 0; i < 4; i++)\r\n    p->Code = (p->Code << 8) | p->Stream->Read((void *)p->Stream);\r\n  return (p->Code < 0xFFFFFFFF);\r\n}\r\n\r\nstatic UInt32 Range_GetThreshold(void *pp, UInt32 total)\r\n{\r\n  CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp;\r\n  return (p->Code) / (p->Range /= total);\r\n}\r\n\r\nstatic void Range_Normalize(CPpmd7z_RangeDec *p)\r\n{\r\n  if (p->Range < kTopValue)\r\n  {\r\n    p->Code = (p->Code << 8) | p->Stream->Read((void *)p->Stream);\r\n    p->Range <<= 8;\r\n    if (p->Range < kTopValue)\r\n    {\r\n      p->Code = (p->Code << 8) | p->Stream->Read((void *)p->Stream);\r\n      p->Range <<= 8;\r\n    }\r\n  }\r\n}\r\n\r\nstatic void Range_Decode(void *pp, UInt32 start, UInt32 size)\r\n{\r\n  CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp;\r\n  p->Code -= start * p->Range;\r\n  p->Range *= size;\r\n  Range_Normalize(p);\r\n}\r\n\r\nstatic UInt32 Range_DecodeBit(void *pp, UInt32 size0)\r\n{\r\n  CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp;\r\n  UInt32 newBound = (p->Range >> 14) * size0;\r\n  UInt32 symbol;\r\n  if (p->Code < newBound)\r\n  {\r\n    symbol = 0;\r\n    p->Range = newBound;\r\n  }\r\n  else\r\n  {\r\n    symbol = 1;\r\n    p->Code -= newBound;\r\n    p->Range -= newBound;\r\n  }\r\n  Range_Normalize(p);\r\n  return symbol;\r\n}\r\n\r\nvoid Ppmd7z_RangeDec_CreateVTable(CPpmd7z_RangeDec *p)\r\n{\r\n  p->p.GetThreshold = Range_GetThreshold;\r\n  p->p.Decode = Range_Decode;\r\n  p->p.DecodeBit = Range_DecodeBit;\r\n}\r\n\r\n\r\n#define MASK(sym) ((signed char *)charMask)[sym]\r\n\r\nint Ppmd7_DecodeSymbol(CPpmd7 *p, IPpmd7_RangeDec *rc)\r\n{\r\n  size_t charMask[256 / sizeof(size_t)];\r\n  if (p->MinContext->NumStats != 1)\r\n  {\r\n    CPpmd_State *s = Ppmd7_GetStats(p, p->MinContext);\r\n    unsigned i;\r\n    UInt32 count, hiCnt;\r\n    if ((count = rc->GetThreshold(rc, p->MinContext->SummFreq)) < (hiCnt = s->Freq))\r\n    {\r\n      Byte symbol;\r\n      rc->Decode(rc, 0, s->Freq);\r\n      p->FoundState = s;\r\n      symbol = s->Symbol;\r\n      Ppmd7_Update1_0(p);\r\n      return symbol;\r\n    }\r\n    p->PrevSuccess = 0;\r\n    i = p->MinContext->NumStats - 1;\r\n    do\r\n    {\r\n      if ((hiCnt += (++s)->Freq) > count)\r\n      {\r\n        Byte symbol;\r\n        rc->Decode(rc, hiCnt - s->Freq, s->Freq);\r\n        p->FoundState = s;\r\n        symbol = s->Symbol;\r\n        Ppmd7_Update1(p);\r\n        return symbol;\r\n      }\r\n    }\r\n    while (--i);\r\n    if (count >= p->MinContext->SummFreq)\r\n      return -2;\r\n    p->HiBitsFlag = p->HB2Flag[p->FoundState->Symbol];\r\n    rc->Decode(rc, hiCnt, p->MinContext->SummFreq - hiCnt);\r\n    PPMD_SetAllBitsIn256Bytes(charMask);\r\n    MASK(s->Symbol) = 0;\r\n    i = p->MinContext->NumStats - 1;\r\n    do { MASK((--s)->Symbol) = 0; } while (--i);\r\n  }\r\n  else\r\n  {\r\n    UInt16 *prob = Ppmd7_GetBinSumm(p);\r\n    if (rc->DecodeBit(rc, *prob) == 0)\r\n    {\r\n      Byte symbol;\r\n      *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);\r\n      symbol = (p->FoundState = Ppmd7Context_OneState(p->MinContext))->Symbol;\r\n      Ppmd7_UpdateBin(p);\r\n      return symbol;\r\n    }\r\n    *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob);\r\n    p->InitEsc = PPMD7_kExpEscape[*prob >> 10];\r\n    PPMD_SetAllBitsIn256Bytes(charMask);\r\n    MASK(Ppmd7Context_OneState(p->MinContext)->Symbol) = 0;\r\n    p->PrevSuccess = 0;\r\n  }\r\n  for (;;)\r\n  {\r\n    CPpmd_State *ps[256], *s;\r\n    UInt32 freqSum, count, hiCnt;\r\n    CPpmd_See *see;\r\n    unsigned i, num, numMasked = p->MinContext->NumStats;\r\n    do\r\n    {\r\n      p->OrderFall++;\r\n      if (!p->MinContext->Suffix)\r\n        return -1;\r\n      p->MinContext = Ppmd7_GetContext(p, p->MinContext->Suffix);\r\n    }\r\n    while (p->MinContext->NumStats == numMasked);\r\n    hiCnt = 0;\r\n    s = Ppmd7_GetStats(p, p->MinContext);\r\n    i = 0;\r\n    num = p->MinContext->NumStats - numMasked;\r\n    do\r\n    {\r\n      int k = (int)(MASK(s->Symbol));\r\n      hiCnt += (s->Freq & k);\r\n      ps[i] = s++;\r\n      i -= k;\r\n    }\r\n    while (i != num);\r\n    \r\n    see = Ppmd7_MakeEscFreq(p, numMasked, &freqSum);\r\n    freqSum += hiCnt;\r\n    count = rc->GetThreshold(rc, freqSum);\r\n    \r\n    if (count < hiCnt)\r\n    {\r\n      Byte symbol;\r\n      CPpmd_State **pps = ps;\r\n      for (hiCnt = 0; (hiCnt += (*pps)->Freq) <= count; pps++);\r\n      s = *pps;\r\n      rc->Decode(rc, hiCnt - s->Freq, s->Freq);\r\n      Ppmd_See_Update(see);\r\n      p->FoundState = s;\r\n      symbol = s->Symbol;\r\n      Ppmd7_Update2(p);\r\n      return symbol;\r\n    }\r\n    if (count >= freqSum)\r\n      return -2;\r\n    rc->Decode(rc, hiCnt, freqSum - hiCnt);\r\n    see->Summ = (UInt16)(see->Summ + freqSum);\r\n    do { MASK(ps[--i]->Symbol) = 0; } while (i != 0);\r\n  }\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/Ppmd7Enc.c",
    "content": "/* Ppmd7Enc.c -- PPMdH Encoder\r\n2010-03-12 : Igor Pavlov : Public domain\r\nThis code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */\r\n\r\n#include \"Ppmd7.h\"\r\n\r\n#define kTopValue (1 << 24)\r\n\r\nvoid Ppmd7z_RangeEnc_Init(CPpmd7z_RangeEnc *p)\r\n{\r\n  p->Low = 0;\r\n  p->Range = 0xFFFFFFFF;\r\n  p->Cache = 0;\r\n  p->CacheSize = 1;\r\n}\r\n\r\nstatic void RangeEnc_ShiftLow(CPpmd7z_RangeEnc *p)\r\n{\r\n  if ((UInt32)p->Low < (UInt32)0xFF000000 || (unsigned)(p->Low >> 32) != 0)\r\n  {\r\n    Byte temp = p->Cache;\r\n    do\r\n    {\r\n      p->Stream->Write(p->Stream, (Byte)(temp + (Byte)(p->Low >> 32)));\r\n      temp = 0xFF;\r\n    }\r\n    while(--p->CacheSize != 0);\r\n    p->Cache = (Byte)((UInt32)p->Low >> 24);\r\n  }\r\n  p->CacheSize++;\r\n  p->Low = (UInt32)p->Low << 8;\r\n}\r\n\r\nstatic void RangeEnc_Encode(CPpmd7z_RangeEnc *p, UInt32 start, UInt32 size, UInt32 total)\r\n{\r\n  p->Low += start * (p->Range /= total);\r\n  p->Range *= size;\r\n  while (p->Range < kTopValue)\r\n  {\r\n    p->Range <<= 8;\r\n    RangeEnc_ShiftLow(p);\r\n  }\r\n}\r\n\r\nstatic void RangeEnc_EncodeBit_0(CPpmd7z_RangeEnc *p, UInt32 size0)\r\n{\r\n  p->Range = (p->Range >> 14) * size0;\r\n  while (p->Range < kTopValue)\r\n  {\r\n    p->Range <<= 8;\r\n    RangeEnc_ShiftLow(p);\r\n  }\r\n}\r\n\r\nstatic void RangeEnc_EncodeBit_1(CPpmd7z_RangeEnc *p, UInt32 size0)\r\n{\r\n  UInt32 newBound = (p->Range >> 14) * size0;\r\n  p->Low += newBound;\r\n  p->Range -= newBound;\r\n  while (p->Range < kTopValue)\r\n  {\r\n    p->Range <<= 8;\r\n    RangeEnc_ShiftLow(p);\r\n  }\r\n}\r\n\r\nvoid Ppmd7z_RangeEnc_FlushData(CPpmd7z_RangeEnc *p)\r\n{\r\n  unsigned i;\r\n  for (i = 0; i < 5; i++)\r\n    RangeEnc_ShiftLow(p);\r\n}\r\n\r\n\r\n#define MASK(sym) ((signed char *)charMask)[sym]\r\n\r\nvoid Ppmd7_EncodeSymbol(CPpmd7 *p, CPpmd7z_RangeEnc *rc, int symbol)\r\n{\r\n  size_t charMask[256 / sizeof(size_t)];\r\n  if (p->MinContext->NumStats != 1)\r\n  {\r\n    CPpmd_State *s = Ppmd7_GetStats(p, p->MinContext);\r\n    UInt32 sum;\r\n    unsigned i;\r\n    if (s->Symbol == symbol)\r\n    {\r\n      RangeEnc_Encode(rc, 0, s->Freq, p->MinContext->SummFreq);\r\n      p->FoundState = s;\r\n      Ppmd7_Update1_0(p);\r\n      return;\r\n    }\r\n    p->PrevSuccess = 0;\r\n    sum = s->Freq;\r\n    i = p->MinContext->NumStats - 1;\r\n    do\r\n    {\r\n      if ((++s)->Symbol == symbol)\r\n      {\r\n        RangeEnc_Encode(rc, sum, s->Freq, p->MinContext->SummFreq);\r\n        p->FoundState = s;\r\n        Ppmd7_Update1(p);\r\n        return;\r\n      }\r\n      sum += s->Freq;\r\n    }\r\n    while (--i);\r\n    \r\n    p->HiBitsFlag = p->HB2Flag[p->FoundState->Symbol];\r\n    PPMD_SetAllBitsIn256Bytes(charMask);\r\n    MASK(s->Symbol) = 0;\r\n    i = p->MinContext->NumStats - 1;\r\n    do { MASK((--s)->Symbol) = 0; } while (--i);\r\n    RangeEnc_Encode(rc, sum, p->MinContext->SummFreq - sum, p->MinContext->SummFreq);\r\n  }\r\n  else\r\n  {\r\n    UInt16 *prob = Ppmd7_GetBinSumm(p);\r\n    CPpmd_State *s = Ppmd7Context_OneState(p->MinContext);\r\n    if (s->Symbol == symbol)\r\n    {\r\n      RangeEnc_EncodeBit_0(rc, *prob);\r\n      *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);\r\n      p->FoundState = s;\r\n      Ppmd7_UpdateBin(p);\r\n      return;\r\n    }\r\n    else\r\n    {\r\n      RangeEnc_EncodeBit_1(rc, *prob);\r\n      *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob);\r\n      p->InitEsc = PPMD7_kExpEscape[*prob >> 10];\r\n      PPMD_SetAllBitsIn256Bytes(charMask);\r\n      MASK(s->Symbol) = 0;\r\n      p->PrevSuccess = 0;\r\n    }\r\n  }\r\n  for (;;)\r\n  {\r\n    UInt32 escFreq;\r\n    CPpmd_See *see;\r\n    CPpmd_State *s;\r\n    UInt32 sum;\r\n    unsigned i, numMasked = p->MinContext->NumStats;\r\n    do\r\n    {\r\n      p->OrderFall++;\r\n      if (!p->MinContext->Suffix)\r\n        return; /* EndMarker (symbol = -1) */\r\n      p->MinContext = Ppmd7_GetContext(p, p->MinContext->Suffix);\r\n    }\r\n    while (p->MinContext->NumStats == numMasked);\r\n    \r\n    see = Ppmd7_MakeEscFreq(p, numMasked, &escFreq);\r\n    s = Ppmd7_GetStats(p, p->MinContext);\r\n    sum = 0;\r\n    i = p->MinContext->NumStats;\r\n    do\r\n    {\r\n      int cur = s->Symbol;\r\n      if (cur == symbol)\r\n      {\r\n        UInt32 low = sum;\r\n        CPpmd_State *s1 = s;\r\n        do\r\n        {\r\n          sum += (s->Freq & (int)(MASK(s->Symbol)));\r\n          s++;\r\n        }\r\n        while (--i);\r\n        RangeEnc_Encode(rc, low, s1->Freq, sum + escFreq);\r\n        Ppmd_See_Update(see);\r\n        p->FoundState = s1;\r\n        Ppmd7_Update2(p);\r\n        return;\r\n      }\r\n      sum += (s->Freq & (int)(MASK(cur)));\r\n      MASK(cur) = 0;\r\n      s++;\r\n    }\r\n    while (--i);\r\n    \r\n    RangeEnc_Encode(rc, sum, escFreq, sum + escFreq);\r\n    see->Summ = (UInt16)(see->Summ + sum + escFreq);\r\n  }\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/RotateDefs.h",
    "content": "/* RotateDefs.h -- Rotate functions\r\n2009-02-07 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __ROTATE_DEFS_H\r\n#define __ROTATE_DEFS_H\r\n\r\n#ifdef _MSC_VER\r\n\r\n#include <stdlib.h>\r\n#define rotlFixed(x, n) _rotl((x), (n))\r\n#define rotrFixed(x, n) _rotr((x), (n))\r\n\r\n#else\r\n\r\n#define rotlFixed(x, n) (((x) << (n)) | ((x) >> (32 - (n))))\r\n#define rotrFixed(x, n) (((x) >> (n)) | ((x) << (32 - (n))))\r\n\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/Sha256.c",
    "content": "/* Crypto/Sha256.c -- SHA-256 Hash\r\n2010-06-11 : Igor Pavlov : Public domain\r\nThis code is based on public domain code from Wei Dai's Crypto++ library. */\r\n\r\n#include \"RotateDefs.h\"\r\n#include \"Sha256.h\"\r\n\r\n/* define it for speed optimization */\r\n/* #define _SHA256_UNROLL */\r\n/* #define _SHA256_UNROLL2 */\r\n\r\nvoid Sha256_Init(CSha256 *p)\r\n{\r\n  p->state[0] = 0x6a09e667;\r\n  p->state[1] = 0xbb67ae85;\r\n  p->state[2] = 0x3c6ef372;\r\n  p->state[3] = 0xa54ff53a;\r\n  p->state[4] = 0x510e527f;\r\n  p->state[5] = 0x9b05688c;\r\n  p->state[6] = 0x1f83d9ab;\r\n  p->state[7] = 0x5be0cd19;\r\n  p->count = 0;\r\n}\r\n\r\n#define S0(x) (rotrFixed(x, 2) ^ rotrFixed(x,13) ^ rotrFixed(x, 22))\r\n#define S1(x) (rotrFixed(x, 6) ^ rotrFixed(x,11) ^ rotrFixed(x, 25))\r\n#define s0(x) (rotrFixed(x, 7) ^ rotrFixed(x,18) ^ (x >> 3))\r\n#define s1(x) (rotrFixed(x,17) ^ rotrFixed(x,19) ^ (x >> 10))\r\n\r\n#define blk0(i) (W[i] = data[i])\r\n#define blk2(i) (W[i&15] += s1(W[(i-2)&15]) + W[(i-7)&15] + s0(W[(i-15)&15]))\r\n\r\n#define Ch(x,y,z) (z^(x&(y^z)))\r\n#define Maj(x,y,z) ((x&y)|(z&(x|y)))\r\n\r\n#define a(i) T[(0-(i))&7]\r\n#define b(i) T[(1-(i))&7]\r\n#define c(i) T[(2-(i))&7]\r\n#define d(i) T[(3-(i))&7]\r\n#define e(i) T[(4-(i))&7]\r\n#define f(i) T[(5-(i))&7]\r\n#define g(i) T[(6-(i))&7]\r\n#define h(i) T[(7-(i))&7]\r\n\r\n\r\n#ifdef _SHA256_UNROLL2\r\n\r\n#define R(a,b,c,d,e,f,g,h, i) h += S1(e) + Ch(e,f,g) + K[i+j] + (j?blk2(i):blk0(i));\\\r\n  d += h; h += S0(a) + Maj(a, b, c)\r\n\r\n#define RX_8(i) \\\r\n  R(a,b,c,d,e,f,g,h, i); \\\r\n  R(h,a,b,c,d,e,f,g, i+1); \\\r\n  R(g,h,a,b,c,d,e,f, i+2); \\\r\n  R(f,g,h,a,b,c,d,e, i+3); \\\r\n  R(e,f,g,h,a,b,c,d, i+4); \\\r\n  R(d,e,f,g,h,a,b,c, i+5); \\\r\n  R(c,d,e,f,g,h,a,b, i+6); \\\r\n  R(b,c,d,e,f,g,h,a, i+7)\r\n\r\n#else\r\n\r\n#define R(i) h(i) += S1(e(i)) + Ch(e(i),f(i),g(i)) + K[i+j] + (j?blk2(i):blk0(i));\\\r\n  d(i) += h(i); h(i) += S0(a(i)) + Maj(a(i), b(i), c(i))\r\n\r\n#ifdef _SHA256_UNROLL\r\n\r\n#define RX_8(i) R(i+0); R(i+1); R(i+2); R(i+3); R(i+4); R(i+5); R(i+6); R(i+7);\r\n\r\n#endif\r\n\r\n#endif\r\n\r\nstatic const UInt32 K[64] = {\r\n  0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\r\n  0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\r\n  0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\r\n  0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\r\n  0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\r\n  0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\r\n  0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\r\n  0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\r\n  0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\r\n  0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\r\n  0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\r\n  0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\r\n  0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\r\n  0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\r\n  0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\r\n  0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\r\n};\r\n\r\nstatic void Sha256_Transform(UInt32 *state, const UInt32 *data)\r\n{\r\n  UInt32 W[16];\r\n  unsigned j;\r\n  #ifdef _SHA256_UNROLL2\r\n  UInt32 a,b,c,d,e,f,g,h;\r\n  a = state[0];\r\n  b = state[1];\r\n  c = state[2];\r\n  d = state[3];\r\n  e = state[4];\r\n  f = state[5];\r\n  g = state[6];\r\n  h = state[7];\r\n  #else\r\n  UInt32 T[8];\r\n  for (j = 0; j < 8; j++)\r\n    T[j] = state[j];\r\n  #endif\r\n\r\n  for (j = 0; j < 64; j += 16)\r\n  {\r\n    #if defined(_SHA256_UNROLL) || defined(_SHA256_UNROLL2)\r\n    RX_8(0); RX_8(8);\r\n    #else\r\n    unsigned i;\r\n    for (i = 0; i < 16; i++) { R(i); }\r\n    #endif\r\n  }\r\n\r\n  #ifdef _SHA256_UNROLL2\r\n  state[0] += a;\r\n  state[1] += b;\r\n  state[2] += c;\r\n  state[3] += d;\r\n  state[4] += e;\r\n  state[5] += f;\r\n  state[6] += g;\r\n  state[7] += h;\r\n  #else\r\n  for (j = 0; j < 8; j++)\r\n    state[j] += T[j];\r\n  #endif\r\n  \r\n  /* Wipe variables */\r\n  /* memset(W, 0, sizeof(W)); */\r\n  /* memset(T, 0, sizeof(T)); */\r\n}\r\n\r\n#undef S0\r\n#undef S1\r\n#undef s0\r\n#undef s1\r\n\r\nstatic void Sha256_WriteByteBlock(CSha256 *p)\r\n{\r\n  UInt32 data32[16];\r\n  unsigned i;\r\n  for (i = 0; i < 16; i++)\r\n    data32[i] =\r\n      ((UInt32)(p->buffer[i * 4    ]) << 24) +\r\n      ((UInt32)(p->buffer[i * 4 + 1]) << 16) +\r\n      ((UInt32)(p->buffer[i * 4 + 2]) <<  8) +\r\n      ((UInt32)(p->buffer[i * 4 + 3]));\r\n  Sha256_Transform(p->state, data32);\r\n}\r\n\r\nvoid Sha256_Update(CSha256 *p, const Byte *data, size_t size)\r\n{\r\n  UInt32 curBufferPos = (UInt32)p->count & 0x3F;\r\n  while (size > 0)\r\n  {\r\n    p->buffer[curBufferPos++] = *data++;\r\n    p->count++;\r\n    size--;\r\n    if (curBufferPos == 64)\r\n    {\r\n      curBufferPos = 0;\r\n      Sha256_WriteByteBlock(p);\r\n    }\r\n  }\r\n}\r\n\r\nvoid Sha256_Final(CSha256 *p, Byte *digest)\r\n{\r\n  UInt64 lenInBits = (p->count << 3);\r\n  UInt32 curBufferPos = (UInt32)p->count & 0x3F;\r\n  unsigned i;\r\n  p->buffer[curBufferPos++] = 0x80;\r\n  while (curBufferPos != (64 - 8))\r\n  {\r\n    curBufferPos &= 0x3F;\r\n    if (curBufferPos == 0)\r\n      Sha256_WriteByteBlock(p);\r\n    p->buffer[curBufferPos++] = 0;\r\n  }\r\n  for (i = 0; i < 8; i++)\r\n  {\r\n    p->buffer[curBufferPos++] = (Byte)(lenInBits >> 56);\r\n    lenInBits <<= 8;\r\n  }\r\n  Sha256_WriteByteBlock(p);\r\n\r\n  for (i = 0; i < 8; i++)\r\n  {\r\n    *digest++ = (Byte)(p->state[i] >> 24);\r\n    *digest++ = (Byte)(p->state[i] >> 16);\r\n    *digest++ = (Byte)(p->state[i] >> 8);\r\n    *digest++ = (Byte)(p->state[i]);\r\n  }\r\n  Sha256_Init(p);\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/Sha256.h",
    "content": "/* Sha256.h -- SHA-256 Hash\r\n2010-06-11 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __CRYPTO_SHA256_H\r\n#define __CRYPTO_SHA256_H\r\n\r\n#include \"Types.h\"\r\n\r\nEXTERN_C_BEGIN\r\n\r\n#define SHA256_DIGEST_SIZE 32\r\n\r\ntypedef struct\r\n{\r\n  UInt32 state[8];\r\n  UInt64 count;\r\n  Byte buffer[64];\r\n} CSha256;\r\n\r\nvoid Sha256_Init(CSha256 *p);\r\nvoid Sha256_Update(CSha256 *p, const Byte *data, size_t size);\r\nvoid Sha256_Final(CSha256 *p, Byte *digest);\r\n\r\nEXTERN_C_END\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/Threads.c",
    "content": "/* Threads.c -- multithreading library\r\n2009-09-20 : Igor Pavlov : Public domain */\r\n\r\n#ifndef _WIN32_WCE\r\n#include <process.h>\r\n#endif\r\n\r\n#include \"Threads.h\"\r\n\r\nstatic WRes GetError()\r\n{\r\n  DWORD res = GetLastError();\r\n  return (res) ? (WRes)(res) : 1;\r\n}\r\n\r\nWRes HandleToWRes(HANDLE h) { return (h != 0) ? 0 : GetError(); }\r\nWRes BOOLToWRes(BOOL v) { return v ? 0 : GetError(); }\r\n\r\nWRes HandlePtr_Close(HANDLE *p)\r\n{\r\n  if (*p != NULL)\r\n    if (!CloseHandle(*p))\r\n      return GetError();\r\n  *p = NULL;\r\n  return 0;\r\n}\r\n\r\nWRes Handle_WaitObject(HANDLE h) { return (WRes)WaitForSingleObject(h, INFINITE); }\r\n\r\nWRes Thread_Create(CThread *p, THREAD_FUNC_TYPE func, LPVOID param)\r\n{\r\n  unsigned threadId; /* Windows Me/98/95: threadId parameter may not be NULL in _beginthreadex/CreateThread functions */\r\n  *p =\r\n    #ifdef UNDER_CE\r\n    CreateThread(0, 0, func, param, 0, &threadId);\r\n    #else\r\n    (HANDLE)_beginthreadex(NULL, 0, func, param, 0, &threadId);\r\n    #endif\r\n    /* maybe we must use errno here, but probably GetLastError() is also OK. */\r\n  return HandleToWRes(*p);\r\n}\r\n\r\nWRes Event_Create(CEvent *p, BOOL manualReset, int signaled)\r\n{\r\n  *p = CreateEvent(NULL, manualReset, (signaled ? TRUE : FALSE), NULL);\r\n  return HandleToWRes(*p);\r\n}\r\n\r\nWRes Event_Set(CEvent *p) { return BOOLToWRes(SetEvent(*p)); }\r\nWRes Event_Reset(CEvent *p) { return BOOLToWRes(ResetEvent(*p)); }\r\n\r\nWRes ManualResetEvent_Create(CManualResetEvent *p, int signaled) { return Event_Create(p, TRUE, signaled); }\r\nWRes AutoResetEvent_Create(CAutoResetEvent *p, int signaled) { return Event_Create(p, FALSE, signaled); }\r\nWRes ManualResetEvent_CreateNotSignaled(CManualResetEvent *p) { return ManualResetEvent_Create(p, 0); }\r\nWRes AutoResetEvent_CreateNotSignaled(CAutoResetEvent *p) { return AutoResetEvent_Create(p, 0); }\r\n\r\n\r\nWRes Semaphore_Create(CSemaphore *p, UInt32 initCount, UInt32 maxCount)\r\n{\r\n  *p = CreateSemaphore(NULL, (LONG)initCount, (LONG)maxCount, NULL);\r\n  return HandleToWRes(*p);\r\n}\r\n\r\nstatic WRes Semaphore_Release(CSemaphore *p, LONG releaseCount, LONG *previousCount)\r\n  { return BOOLToWRes(ReleaseSemaphore(*p, releaseCount, previousCount)); }\r\nWRes Semaphore_ReleaseN(CSemaphore *p, UInt32 num)\r\n  { return Semaphore_Release(p, (LONG)num, NULL); }\r\nWRes Semaphore_Release1(CSemaphore *p) { return Semaphore_ReleaseN(p, 1); }\r\n\r\nWRes CriticalSection_Init(CCriticalSection *p)\r\n{\r\n  /* InitializeCriticalSection can raise only STATUS_NO_MEMORY exception */\r\n  #ifdef _MSC_VER\r\n  __try\r\n  #endif\r\n  {\r\n    InitializeCriticalSection(p);\r\n    /* InitializeCriticalSectionAndSpinCount(p, 0); */\r\n  }\r\n  #ifdef _MSC_VER\r\n  __except (EXCEPTION_EXECUTE_HANDLER) { return 1; }\r\n  #endif\r\n  return 0;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/Threads.h",
    "content": "/* Threads.h -- multithreading library\r\n2009-03-27 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __7Z_THREADS_H\r\n#define __7Z_THREADS_H\r\n\r\n#include \"Types.h\"\r\n\r\n#ifdef __cplusplus\r\nextern \"C\" {\r\n#endif\r\n\r\nWRes HandlePtr_Close(HANDLE *h);\r\nWRes Handle_WaitObject(HANDLE h);\r\n\r\ntypedef HANDLE CThread;\r\n#define Thread_Construct(p) *(p) = NULL\r\n#define Thread_WasCreated(p) (*(p) != NULL)\r\n#define Thread_Close(p) HandlePtr_Close(p)\r\n#define Thread_Wait(p) Handle_WaitObject(*(p))\r\ntypedef unsigned THREAD_FUNC_RET_TYPE;\r\n#define THREAD_FUNC_CALL_TYPE MY_STD_CALL\r\n#define THREAD_FUNC_DECL THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE\r\ntypedef THREAD_FUNC_RET_TYPE (THREAD_FUNC_CALL_TYPE * THREAD_FUNC_TYPE)(void *);\r\nWRes Thread_Create(CThread *p, THREAD_FUNC_TYPE func, LPVOID param);\r\n\r\ntypedef HANDLE CEvent;\r\ntypedef CEvent CAutoResetEvent;\r\ntypedef CEvent CManualResetEvent;\r\n#define Event_Construct(p) *(p) = NULL\r\n#define Event_IsCreated(p) (*(p) != NULL)\r\n#define Event_Close(p) HandlePtr_Close(p)\r\n#define Event_Wait(p) Handle_WaitObject(*(p))\r\nWRes Event_Set(CEvent *p);\r\nWRes Event_Reset(CEvent *p);\r\nWRes ManualResetEvent_Create(CManualResetEvent *p, int signaled);\r\nWRes ManualResetEvent_CreateNotSignaled(CManualResetEvent *p);\r\nWRes AutoResetEvent_Create(CAutoResetEvent *p, int signaled);\r\nWRes AutoResetEvent_CreateNotSignaled(CAutoResetEvent *p);\r\n\r\ntypedef HANDLE CSemaphore;\r\n#define Semaphore_Construct(p) (*p) = NULL\r\n#define Semaphore_Close(p) HandlePtr_Close(p)\r\n#define Semaphore_Wait(p) Handle_WaitObject(*(p))\r\nWRes Semaphore_Create(CSemaphore *p, UInt32 initCount, UInt32 maxCount);\r\nWRes Semaphore_ReleaseN(CSemaphore *p, UInt32 num);\r\nWRes Semaphore_Release1(CSemaphore *p);\r\n\r\ntypedef CRITICAL_SECTION CCriticalSection;\r\nWRes CriticalSection_Init(CCriticalSection *p);\r\n#define CriticalSection_Delete(p) DeleteCriticalSection(p)\r\n#define CriticalSection_Enter(p) EnterCriticalSection(p)\r\n#define CriticalSection_Leave(p) LeaveCriticalSection(p)\r\n\r\n#ifdef __cplusplus\r\n}\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/Types.h",
    "content": "/* Types.h -- Basic types\r\n2010-10-09 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __7Z_TYPES_H\r\n#define __7Z_TYPES_H\r\n\r\n#include <stddef.h>\r\n\r\n#ifdef _WIN32\r\n#include <windows.h>\r\n#endif\r\n\r\n#ifndef EXTERN_C_BEGIN\r\n#ifdef __cplusplus\r\n#define EXTERN_C_BEGIN extern \"C\" {\r\n#define EXTERN_C_END }\r\n#else\r\n#define EXTERN_C_BEGIN\r\n#define EXTERN_C_END\r\n#endif\r\n#endif\r\n\r\nEXTERN_C_BEGIN\r\n\r\n#define SZ_OK 0\r\n\r\n#define SZ_ERROR_DATA 1\r\n#define SZ_ERROR_MEM 2\r\n#define SZ_ERROR_CRC 3\r\n#define SZ_ERROR_UNSUPPORTED 4\r\n#define SZ_ERROR_PARAM 5\r\n#define SZ_ERROR_INPUT_EOF 6\r\n#define SZ_ERROR_OUTPUT_EOF 7\r\n#define SZ_ERROR_READ 8\r\n#define SZ_ERROR_WRITE 9\r\n#define SZ_ERROR_PROGRESS 10\r\n#define SZ_ERROR_FAIL 11\r\n#define SZ_ERROR_THREAD 12\r\n\r\n#define SZ_ERROR_ARCHIVE 16\r\n#define SZ_ERROR_NO_ARCHIVE 17\r\n\r\ntypedef int SRes;\r\n\r\n#ifdef _WIN32\r\ntypedef DWORD WRes;\r\n#else\r\ntypedef int WRes;\r\n#endif\r\n\r\n#ifndef RINOK\r\n#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; }\r\n#endif\r\n\r\ntypedef unsigned char Byte;\r\ntypedef short Int16;\r\ntypedef unsigned short UInt16;\r\n\r\n#ifdef _LZMA_UINT32_IS_ULONG\r\ntypedef long Int32;\r\ntypedef unsigned long UInt32;\r\n#else\r\ntypedef int Int32;\r\ntypedef unsigned int UInt32;\r\n#endif\r\n\r\n#ifdef _SZ_NO_INT_64\r\n\r\n/* define _SZ_NO_INT_64, if your compiler doesn't support 64-bit integers.\r\n   NOTES: Some code will work incorrectly in that case! */\r\n\r\ntypedef long Int64;\r\ntypedef unsigned long UInt64;\r\n\r\n#else\r\n\r\n#if defined(_MSC_VER) || defined(__BORLANDC__)\r\ntypedef __int64 Int64;\r\ntypedef unsigned __int64 UInt64;\r\n#define UINT64_CONST(n) n\r\n#else\r\ntypedef long long int Int64;\r\ntypedef unsigned long long int UInt64;\r\n#define UINT64_CONST(n) n ## ULL\r\n#endif\r\n\r\n#endif\r\n\r\n#ifdef _LZMA_NO_SYSTEM_SIZE_T\r\ntypedef UInt32 SizeT;\r\n#else\r\ntypedef size_t SizeT;\r\n#endif\r\n\r\ntypedef int Bool;\r\n#define True 1\r\n#define False 0\r\n\r\n\r\n#ifdef _WIN32\r\n#define MY_STD_CALL __stdcall\r\n#else\r\n#define MY_STD_CALL\r\n#endif\r\n\r\n#ifdef _MSC_VER\r\n\r\n#if _MSC_VER >= 1300\r\n#define MY_NO_INLINE __declspec(noinline)\r\n#else\r\n#define MY_NO_INLINE\r\n#endif\r\n\r\n#define MY_CDECL __cdecl\r\n#define MY_FAST_CALL __fastcall\r\n\r\n#else\r\n\r\n#define MY_CDECL\r\n#define MY_FAST_CALL\r\n\r\n#endif\r\n\r\n\r\n/* The following interfaces use first parameter as pointer to structure */\r\n\r\ntypedef struct\r\n{\r\n  Byte (*Read)(void *p); /* reads one byte, returns 0 in case of EOF or error */\r\n} IByteIn;\r\n\r\ntypedef struct\r\n{\r\n  void (*Write)(void *p, Byte b);\r\n} IByteOut;\r\n\r\ntypedef struct\r\n{\r\n  SRes (*Read)(void *p, void *buf, size_t *size);\r\n    /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.\r\n       (output(*size) < input(*size)) is allowed */\r\n} ISeqInStream;\r\n\r\n/* it can return SZ_ERROR_INPUT_EOF */\r\nSRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size);\r\nSRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType);\r\nSRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf);\r\n\r\ntypedef struct\r\n{\r\n  size_t (*Write)(void *p, const void *buf, size_t size);\r\n    /* Returns: result - the number of actually written bytes.\r\n       (result < size) means error */\r\n} ISeqOutStream;\r\n\r\ntypedef enum\r\n{\r\n  SZ_SEEK_SET = 0,\r\n  SZ_SEEK_CUR = 1,\r\n  SZ_SEEK_END = 2\r\n} ESzSeek;\r\n\r\ntypedef struct\r\n{\r\n  SRes (*Read)(void *p, void *buf, size_t *size);  /* same as ISeqInStream::Read */\r\n  SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin);\r\n} ISeekInStream;\r\n\r\ntypedef struct\r\n{\r\n  SRes (*Look)(void *p, const void **buf, size_t *size);\r\n    /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.\r\n       (output(*size) > input(*size)) is not allowed\r\n       (output(*size) < input(*size)) is allowed */\r\n  SRes (*Skip)(void *p, size_t offset);\r\n    /* offset must be <= output(*size) of Look */\r\n\r\n  SRes (*Read)(void *p, void *buf, size_t *size);\r\n    /* reads directly (without buffer). It's same as ISeqInStream::Read */\r\n  SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin);\r\n} ILookInStream;\r\n\r\nSRes LookInStream_LookRead(ILookInStream *stream, void *buf, size_t *size);\r\nSRes LookInStream_SeekTo(ILookInStream *stream, UInt64 offset);\r\n\r\n/* reads via ILookInStream::Read */\r\nSRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType);\r\nSRes LookInStream_Read(ILookInStream *stream, void *buf, size_t size);\r\n\r\n#define LookToRead_BUF_SIZE (1 << 14)\r\n\r\ntypedef struct\r\n{\r\n  ILookInStream s;\r\n  ISeekInStream *realStream;\r\n  size_t pos;\r\n  size_t size;\r\n  Byte buf[LookToRead_BUF_SIZE];\r\n} CLookToRead;\r\n\r\nvoid LookToRead_CreateVTable(CLookToRead *p, int lookahead);\r\nvoid LookToRead_Init(CLookToRead *p);\r\n\r\ntypedef struct\r\n{\r\n  ISeqInStream s;\r\n  ILookInStream *realStream;\r\n} CSecToLook;\r\n\r\nvoid SecToLook_CreateVTable(CSecToLook *p);\r\n\r\ntypedef struct\r\n{\r\n  ISeqInStream s;\r\n  ILookInStream *realStream;\r\n} CSecToRead;\r\n\r\nvoid SecToRead_CreateVTable(CSecToRead *p);\r\n\r\ntypedef struct\r\n{\r\n  SRes (*Progress)(void *p, UInt64 inSize, UInt64 outSize);\r\n    /* Returns: result. (result != SZ_OK) means break.\r\n       Value (UInt64)(Int64)-1 for size means unknown value. */\r\n} ICompressProgress;\r\n\r\ntypedef struct\r\n{\r\n  void *(*Alloc)(void *p, size_t size);\r\n  void (*Free)(void *p, void *address); /* address can be 0 */\r\n} ISzAlloc;\r\n\r\n#define IAlloc_Alloc(p, size) (p)->Alloc((p), size)\r\n#define IAlloc_Free(p, a) (p)->Free((p), a)\r\n\r\n#ifdef _WIN32\r\n\r\n#define CHAR_PATH_SEPARATOR '\\\\'\r\n#define WCHAR_PATH_SEPARATOR L'\\\\'\r\n#define STRING_PATH_SEPARATOR \"\\\\\"\r\n#define WSTRING_PATH_SEPARATOR L\"\\\\\"\r\n\r\n#else\r\n\r\n#define CHAR_PATH_SEPARATOR '/'\r\n#define WCHAR_PATH_SEPARATOR L'/'\r\n#define STRING_PATH_SEPARATOR \"/\"\r\n#define WSTRING_PATH_SEPARATOR L\"/\"\r\n\r\n#endif\r\n\r\nEXTERN_C_END\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/Util/7z/7z.dsp",
    "content": "# Microsoft Developer Studio Project File - Name=\"7z\" - Package Owner=<4>\r\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\r\n# ** DO NOT EDIT **\r\n\r\n# TARGTYPE \"Win32 (x86) Console Application\" 0x0103\r\n\r\nCFG=7z - Win32 Debug\r\n!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r\n!MESSAGE use the Export Makefile command and run\r\n!MESSAGE \r\n!MESSAGE NMAKE /f \"7z.mak\".\r\n!MESSAGE \r\n!MESSAGE You can specify a configuration when running NMAKE\r\n!MESSAGE by defining the macro CFG on the command line. For example:\r\n!MESSAGE \r\n!MESSAGE NMAKE /f \"7z.mak\" CFG=\"7z - Win32 Debug\"\r\n!MESSAGE \r\n!MESSAGE Possible choices for configuration are:\r\n!MESSAGE \r\n!MESSAGE \"7z - Win32 Release\" (based on \"Win32 (x86) Console Application\")\r\n!MESSAGE \"7z - Win32 Debug\" (based on \"Win32 (x86) Console Application\")\r\n!MESSAGE \r\n\r\n# Begin Project\r\n# PROP AllowPerConfigDependencies 0\r\n# PROP Scc_ProjName \"\"\r\n# PROP Scc_LocalPath \"\"\r\nCPP=cl.exe\r\nRSC=rc.exe\r\n\r\n!IF  \"$(CFG)\" == \"7z - Win32 Release\"\r\n\r\n# PROP BASE Use_MFC 0\r\n# PROP BASE Use_Debug_Libraries 0\r\n# PROP BASE Output_Dir \"Release\"\r\n# PROP BASE Intermediate_Dir \"Release\"\r\n# PROP BASE Target_Dir \"\"\r\n# PROP Use_MFC 0\r\n# PROP Use_Debug_Libraries 0\r\n# PROP Output_Dir \"Release\"\r\n# PROP Intermediate_Dir \"Release\"\r\n# PROP Ignore_Export_Lib 0\r\n# PROP Target_Dir \"\"\r\n# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /c\r\n# ADD CPP /nologo /MD /W3 /GX /O2 /D \"NDEBUG\" /D \"WIN32\" /D \"_CONSOLE\" /D \"_UNICODE\" /D \"UNICODE\" /FAs /YX /FD /c\r\n# ADD BASE RSC /l 0x419 /d \"NDEBUG\"\r\n# ADD RSC /l 0x419 /d \"NDEBUG\"\r\nBSC32=bscmake.exe\r\n# ADD BASE BSC32 /nologo\r\n# ADD BSC32 /nologo\r\nLINK32=link.exe\r\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r\n# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:\"Release/7zDec.exe\" /opt:NOWIN98\r\n# SUBTRACT LINK32 /pdb:none\r\n\r\n!ELSEIF  \"$(CFG)\" == \"7z - Win32 Debug\"\r\n\r\n# PROP BASE Use_MFC 0\r\n# PROP BASE Use_Debug_Libraries 1\r\n# PROP BASE Output_Dir \"Debug\"\r\n# PROP BASE Intermediate_Dir \"Debug\"\r\n# PROP BASE Target_Dir \"\"\r\n# PROP Use_MFC 0\r\n# PROP Use_Debug_Libraries 1\r\n# PROP Output_Dir \"Debug\"\r\n# PROP Intermediate_Dir \"Debug\"\r\n# PROP Ignore_Export_Lib 0\r\n# PROP Target_Dir \"\"\r\n# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /GZ /c\r\n# ADD CPP /nologo /W4 /Gm /GX /ZI /Od /D \"_DEBUG\" /D \"_SZ_ALLOC_DEBUG2\" /D \"_SZ_NO_INT_64_A\" /D \"WIN32\" /D \"_CONSOLE\" /D \"_UNICODE\" /D \"UNICODE\" /YX /FD /GZ /c\r\n# ADD BASE RSC /l 0x419 /d \"_DEBUG\"\r\n# ADD RSC /l 0x419 /d \"_DEBUG\"\r\nBSC32=bscmake.exe\r\n# ADD BASE BSC32 /nologo\r\n# ADD BSC32 /nologo\r\nLINK32=link.exe\r\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r\n# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:\"Debug/7zDec.exe\" /pdbtype:sept\r\n\r\n!ENDIF \r\n\r\n# Begin Target\r\n\r\n# Name \"7z - Win32 Release\"\r\n# Name \"7z - Win32 Debug\"\r\n# Begin Group \"Common\"\r\n\r\n# PROP Default_Filter \"\"\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7z.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zAlloc.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zAlloc.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zBuf.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zBuf.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zCrc.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zCrc.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zCrcOpt.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zDec.c\r\n# ADD CPP /D \"_7ZIP_PPMD_SUPPPORT\"\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zFile.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zFile.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zIn.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zStream.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Bcj2.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Bcj2.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Bra.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Bra.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Bra86.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\CpuArch.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\CpuArch.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Lzma2Dec.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Lzma2Dec.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzmaDec.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzmaDec.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Ppmd.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Ppmd7.c\r\n# SUBTRACT CPP /YX\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Ppmd7.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Ppmd7Dec.c\r\n# SUBTRACT CPP /YX\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Types.h\r\n# End Source File\r\n# End Group\r\n# Begin Source File\r\n\r\nSOURCE=.\\7zMain.c\r\n# End Source File\r\n# End Target\r\n# End Project\r\n"
  },
  {
    "path": "ext/lzma/C/Util/7z/7z.dsw",
    "content": "Microsoft Developer Studio Workspace File, Format Version 6.00\r\n# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\r\n\r\n###############################################################################\r\n\r\nProject: \"7z\"=.\\7z.dsp - Package Owner=<4>\r\n\r\nPackage=<5>\r\n{{{\r\n}}}\r\n\r\nPackage=<4>\r\n{{{\r\n}}}\r\n\r\n###############################################################################\r\n\r\nGlobal:\r\n\r\nPackage=<5>\r\n{{{\r\n}}}\r\n\r\nPackage=<3>\r\n{{{\r\n}}}\r\n\r\n###############################################################################\r\n\r\n"
  },
  {
    "path": "ext/lzma/C/Util/7z/7zMain.c",
    "content": "/* 7zMain.c - Test application for 7z Decoder\r\n2010-10-28 : Igor Pavlov : Public domain */\r\n\r\n#include <stdio.h>\r\n#include <string.h>\r\n\r\n#include \"../../7z.h\"\r\n#include \"../../7zAlloc.h\"\r\n#include \"../../7zCrc.h\"\r\n#include \"../../7zFile.h\"\r\n#include \"../../7zVersion.h\"\r\n\r\n#ifndef USE_WINDOWS_FILE\r\n/* for mkdir */\r\n#ifdef _WIN32\r\n#include <direct.h>\r\n#else\r\n#include <sys/stat.h>\r\n#include <errno.h>\r\n#endif\r\n#endif\r\n\r\nstatic ISzAlloc g_Alloc = { SzAlloc, SzFree };\r\n\r\nstatic int Buf_EnsureSize(CBuf *dest, size_t size)\r\n{\r\n  if (dest->size >= size)\r\n    return 1;\r\n  Buf_Free(dest, &g_Alloc);\r\n  return Buf_Create(dest, size, &g_Alloc);\r\n}\r\n\r\n#ifndef _WIN32\r\n\r\nstatic Byte kUtf8Limits[5] = { 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };\r\n\r\nstatic Bool Utf16_To_Utf8(Byte *dest, size_t *destLen, const UInt16 *src, size_t srcLen)\r\n{\r\n  size_t destPos = 0, srcPos = 0;\r\n  for (;;)\r\n  {\r\n    unsigned numAdds;\r\n    UInt32 value;\r\n    if (srcPos == srcLen)\r\n    {\r\n      *destLen = destPos;\r\n      return True;\r\n    }\r\n    value = src[srcPos++];\r\n    if (value < 0x80)\r\n    {\r\n      if (dest)\r\n        dest[destPos] = (char)value;\r\n      destPos++;\r\n      continue;\r\n    }\r\n    if (value >= 0xD800 && value < 0xE000)\r\n    {\r\n      UInt32 c2;\r\n      if (value >= 0xDC00 || srcPos == srcLen)\r\n        break;\r\n      c2 = src[srcPos++];\r\n      if (c2 < 0xDC00 || c2 >= 0xE000)\r\n        break;\r\n      value = (((value - 0xD800) << 10) | (c2 - 0xDC00)) + 0x10000;\r\n    }\r\n    for (numAdds = 1; numAdds < 5; numAdds++)\r\n      if (value < (((UInt32)1) << (numAdds * 5 + 6)))\r\n        break;\r\n    if (dest)\r\n      dest[destPos] = (char)(kUtf8Limits[numAdds - 1] + (value >> (6 * numAdds)));\r\n    destPos++;\r\n    do\r\n    {\r\n      numAdds--;\r\n      if (dest)\r\n        dest[destPos] = (char)(0x80 + ((value >> (6 * numAdds)) & 0x3F));\r\n      destPos++;\r\n    }\r\n    while (numAdds != 0);\r\n  }\r\n  *destLen = destPos;\r\n  return False;\r\n}\r\n\r\nstatic SRes Utf16_To_Utf8Buf(CBuf *dest, const UInt16 *src, size_t srcLen)\r\n{\r\n  size_t destLen = 0;\r\n  Bool res;\r\n  Utf16_To_Utf8(NULL, &destLen, src, srcLen);\r\n  destLen += 1;\r\n  if (!Buf_EnsureSize(dest, destLen))\r\n    return SZ_ERROR_MEM;\r\n  res = Utf16_To_Utf8(dest->data, &destLen, src, srcLen);\r\n  dest->data[destLen] = 0;\r\n  return res ? SZ_OK : SZ_ERROR_FAIL;\r\n}\r\n#endif\r\n\r\nstatic SRes Utf16_To_Char(CBuf *buf, const UInt16 *s, int fileMode)\r\n{\r\n  int len = 0;\r\n  for (len = 0; s[len] != '\\0'; len++);\r\n\r\n  #ifdef _WIN32\r\n  {\r\n    int size = len * 3 + 100;\r\n    if (!Buf_EnsureSize(buf, size))\r\n      return SZ_ERROR_MEM;\r\n    {\r\n      char defaultChar = '_';\r\n      BOOL defUsed;\r\n      int numChars = WideCharToMultiByte(fileMode ?\r\n          (\r\n          #ifdef UNDER_CE\r\n          CP_ACP\r\n          #else\r\n          AreFileApisANSI() ? CP_ACP : CP_OEMCP\r\n          #endif\r\n          ) : CP_OEMCP,\r\n          0, s, len, (char *)buf->data, size, &defaultChar, &defUsed);\r\n      if (numChars == 0 || numChars >= size)\r\n        return SZ_ERROR_FAIL;\r\n      buf->data[numChars] = 0;\r\n      return SZ_OK;\r\n    }\r\n  }\r\n  #else\r\n  fileMode = fileMode;\r\n  return Utf16_To_Utf8Buf(buf, s, len);\r\n  #endif\r\n}\r\n\r\nstatic WRes MyCreateDir(const UInt16 *name)\r\n{\r\n  #ifdef USE_WINDOWS_FILE\r\n  \r\n  return CreateDirectoryW(name, NULL) ? 0 : GetLastError();\r\n  \r\n  #else\r\n\r\n  CBuf buf;\r\n  WRes res;\r\n  Buf_Init(&buf);\r\n  RINOK(Utf16_To_Char(&buf, name, 1));\r\n\r\n  res =\r\n  #ifdef _WIN32\r\n  _mkdir((const char *)buf.data)\r\n  #else\r\n  mkdir((const char *)buf.data, 0777)\r\n  #endif\r\n  == 0 ? 0 : errno;\r\n  Buf_Free(&buf, &g_Alloc);\r\n  return res;\r\n  \r\n  #endif\r\n}\r\n\r\nstatic WRes OutFile_OpenUtf16(CSzFile *p, const UInt16 *name)\r\n{\r\n  #ifdef USE_WINDOWS_FILE\r\n  return OutFile_OpenW(p, name);\r\n  #else\r\n  CBuf buf;\r\n  WRes res;\r\n  Buf_Init(&buf);\r\n  RINOK(Utf16_To_Char(&buf, name, 1));\r\n  res = OutFile_Open(p, (const char *)buf.data);\r\n  Buf_Free(&buf, &g_Alloc);\r\n  return res;\r\n  #endif\r\n}\r\n\r\nstatic SRes PrintString(const UInt16 *s)\r\n{\r\n  CBuf buf;\r\n  SRes res;\r\n  Buf_Init(&buf);\r\n  res = Utf16_To_Char(&buf, s, 0);\r\n  if (res == SZ_OK)\r\n    fputs((const char *)buf.data, stdout);\r\n  Buf_Free(&buf, &g_Alloc);\r\n  return res;\r\n}\r\n\r\nstatic void UInt64ToStr(UInt64 value, char *s)\r\n{\r\n  char temp[32];\r\n  int pos = 0;\r\n  do\r\n  {\r\n    temp[pos++] = (char)('0' + (unsigned)(value % 10));\r\n    value /= 10;\r\n  }\r\n  while (value != 0);\r\n  do\r\n    *s++ = temp[--pos];\r\n  while (pos);\r\n  *s = '\\0';\r\n}\r\n\r\nstatic char *UIntToStr(char *s, unsigned value, int numDigits)\r\n{\r\n  char temp[16];\r\n  int pos = 0;\r\n  do\r\n    temp[pos++] = (char)('0' + (value % 10));\r\n  while (value /= 10);\r\n  for (numDigits -= pos; numDigits > 0; numDigits--)\r\n    *s++ = '0';\r\n  do\r\n    *s++ = temp[--pos];\r\n  while (pos);\r\n  *s = '\\0';\r\n  return s;\r\n}\r\n\r\n#define PERIOD_4 (4 * 365 + 1)\r\n#define PERIOD_100 (PERIOD_4 * 25 - 1)\r\n#define PERIOD_400 (PERIOD_100 * 4 + 1)\r\n\r\nstatic void ConvertFileTimeToString(const CNtfsFileTime *ft, char *s)\r\n{\r\n  unsigned year, mon, day, hour, min, sec;\r\n  UInt64 v64 = (ft->Low | ((UInt64)ft->High << 32)) / 10000000;\r\n  Byte ms[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };\r\n  unsigned t;\r\n  UInt32 v;\r\n  sec = (unsigned)(v64 % 60); v64 /= 60;\r\n  min = (unsigned)(v64 % 60); v64 /= 60;\r\n  hour = (unsigned)(v64 % 24); v64 /= 24;\r\n\r\n  v = (UInt32)v64;\r\n\r\n  year = (unsigned)(1601 + v / PERIOD_400 * 400);\r\n  v %= PERIOD_400;\r\n\r\n  t = v / PERIOD_100; if (t ==  4) t =  3; year += t * 100; v -= t * PERIOD_100;\r\n  t = v / PERIOD_4;   if (t == 25) t = 24; year += t * 4;   v -= t * PERIOD_4;\r\n  t = v / 365;        if (t ==  4) t =  3; year += t;       v -= t * 365;\r\n\r\n  if (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0))\r\n    ms[1] = 29;\r\n  for (mon = 1; mon <= 12; mon++)\r\n  {\r\n    unsigned s = ms[mon - 1];\r\n    if (v < s)\r\n      break;\r\n    v -= s;\r\n  }\r\n  day = (unsigned)v + 1;\r\n  s = UIntToStr(s, year, 4); *s++ = '-';\r\n  s = UIntToStr(s, mon, 2);  *s++ = '-';\r\n  s = UIntToStr(s, day, 2);  *s++ = ' ';\r\n  s = UIntToStr(s, hour, 2); *s++ = ':';\r\n  s = UIntToStr(s, min, 2);  *s++ = ':';\r\n  s = UIntToStr(s, sec, 2);\r\n}\r\n\r\nvoid PrintError(char *sz)\r\n{\r\n  printf(\"\\nERROR: %s\\n\", sz);\r\n}\r\n\r\n#ifdef USE_WINDOWS_FILE\r\n#define kEmptyAttribChar '.'\r\nstatic void GetAttribString(UInt32 wa, Bool isDir, char *s)\r\n{\r\n  s[0] = (char)(((wa & FILE_ATTRIBUTE_DIRECTORY) != 0 || isDir) ? 'D' : kEmptyAttribChar);\r\n  s[1] = (char)(((wa & FILE_ATTRIBUTE_READONLY) != 0) ? 'R': kEmptyAttribChar);\r\n  s[2] = (char)(((wa & FILE_ATTRIBUTE_HIDDEN) != 0) ? 'H': kEmptyAttribChar);\r\n  s[3] = (char)(((wa & FILE_ATTRIBUTE_SYSTEM) != 0) ? 'S': kEmptyAttribChar);\r\n  s[4] = (char)(((wa & FILE_ATTRIBUTE_ARCHIVE) != 0) ? 'A': kEmptyAttribChar);\r\n  s[5] = '\\0';\r\n}\r\n#else\r\nstatic void GetAttribString(UInt32, Bool, char *s)\r\n{\r\n  s[0] = '\\0';\r\n}\r\n#endif\r\n\r\nint MY_CDECL main(int numargs, char *args[])\r\n{\r\n  CFileInStream archiveStream;\r\n  CLookToRead lookStream;\r\n  CSzArEx db;\r\n  SRes res;\r\n  ISzAlloc allocImp;\r\n  ISzAlloc allocTempImp;\r\n  UInt16 *temp = NULL;\r\n  size_t tempSize = 0;\r\n\r\n  printf(\"\\n7z ANSI-C Decoder \" MY_VERSION_COPYRIGHT_DATE \"\\n\\n\");\r\n  if (numargs == 1)\r\n  {\r\n    printf(\r\n      \"Usage: 7zDec <command> <archive_name>\\n\\n\"\r\n      \"<Commands>\\n\"\r\n      \"  e: Extract files from archive (without using directory names)\\n\"\r\n      \"  l: List contents of archive\\n\"\r\n      \"  t: Test integrity of archive\\n\"\r\n      \"  x: eXtract files with full paths\\n\");\r\n    return 0;\r\n  }\r\n  if (numargs < 3)\r\n  {\r\n    PrintError(\"incorrect command\");\r\n    return 1;\r\n  }\r\n\r\n  allocImp.Alloc = SzAlloc;\r\n  allocImp.Free = SzFree;\r\n\r\n  allocTempImp.Alloc = SzAllocTemp;\r\n  allocTempImp.Free = SzFreeTemp;\r\n\r\n  if (InFile_Open(&archiveStream.file, args[2]))\r\n  {\r\n    PrintError(\"can not open input file\");\r\n    return 1;\r\n  }\r\n\r\n  FileInStream_CreateVTable(&archiveStream);\r\n  LookToRead_CreateVTable(&lookStream, False);\r\n  \r\n  lookStream.realStream = &archiveStream.s;\r\n  LookToRead_Init(&lookStream);\r\n\r\n  CrcGenerateTable();\r\n\r\n  SzArEx_Init(&db);\r\n  res = SzArEx_Open(&db, &lookStream.s, &allocImp, &allocTempImp);\r\n  if (res == SZ_OK)\r\n  {\r\n    char *command = args[1];\r\n    int listCommand = 0, testCommand = 0, extractCommand = 0, fullPaths = 0;\r\n    if (strcmp(command, \"l\") == 0) listCommand = 1;\r\n    else if (strcmp(command, \"t\") == 0) testCommand = 1;\r\n    else if (strcmp(command, \"e\") == 0) extractCommand = 1;\r\n    else if (strcmp(command, \"x\") == 0) { extractCommand = 1; fullPaths = 1; }\r\n    else\r\n    {\r\n      PrintError(\"incorrect command\");\r\n      res = SZ_ERROR_FAIL;\r\n    }\r\n\r\n    if (res == SZ_OK)\r\n    {\r\n      UInt32 i;\r\n\r\n      /*\r\n      if you need cache, use these 3 variables.\r\n      if you use external function, you can make these variable as static.\r\n      */\r\n      UInt32 blockIndex = 0xFFFFFFFF; /* it can have any value before first call (if outBuffer = 0) */\r\n      Byte *outBuffer = 0; /* it must be 0 before first call for each new archive. */\r\n      size_t outBufferSize = 0;  /* it can have any value before first call (if outBuffer = 0) */\r\n\r\n      for (i = 0; i < db.db.NumFiles; i++)\r\n      {\r\n        size_t offset = 0;\r\n        size_t outSizeProcessed = 0;\r\n        const CSzFileItem *f = db.db.Files + i;\r\n        size_t len;\r\n        if (listCommand == 0 && f->IsDir && !fullPaths)\r\n          continue;\r\n        len = SzArEx_GetFileNameUtf16(&db, i, NULL);\r\n\r\n        if (len > tempSize)\r\n        {\r\n          SzFree(NULL, temp);\r\n          tempSize = len;\r\n          temp = (UInt16 *)SzAlloc(NULL, tempSize * sizeof(temp[0]));\r\n          if (temp == 0)\r\n          {\r\n            res = SZ_ERROR_MEM;\r\n            break;\r\n          }\r\n        }\r\n\r\n        SzArEx_GetFileNameUtf16(&db, i, temp);\r\n        if (listCommand)\r\n        {\r\n          char attr[8], s[32], t[32];\r\n\r\n          GetAttribString(f->AttribDefined ? f->Attrib : 0, f->IsDir, attr);\r\n\r\n          UInt64ToStr(f->Size, s);\r\n          if (f->MTimeDefined)\r\n            ConvertFileTimeToString(&f->MTime, t);\r\n          else\r\n          {\r\n            size_t j;\r\n            for (j = 0; j < 19; j++)\r\n              t[j] = ' ';\r\n            t[j] = '\\0';\r\n          }\r\n          \r\n          printf(\"%s %s %10s  \", t, attr, s);\r\n          res = PrintString(temp);\r\n          if (res != SZ_OK)\r\n            break;\r\n          if (f->IsDir)\r\n            printf(\"/\");\r\n          printf(\"\\n\");\r\n          continue;\r\n        }\r\n        fputs(testCommand ?\r\n            \"Testing    \":\r\n            \"Extracting \",\r\n            stdout);\r\n        res = PrintString(temp);\r\n        if (res != SZ_OK)\r\n          break;\r\n        if (f->IsDir)\r\n          printf(\"/\");\r\n        else\r\n        {\r\n          res = SzArEx_Extract(&db, &lookStream.s, i,\r\n              &blockIndex, &outBuffer, &outBufferSize,\r\n              &offset, &outSizeProcessed,\r\n              &allocImp, &allocTempImp);\r\n          if (res != SZ_OK)\r\n            break;\r\n        }\r\n        if (!testCommand)\r\n        {\r\n          CSzFile outFile;\r\n          size_t processedSize;\r\n          size_t j;\r\n          UInt16 *name = (UInt16 *)temp;\r\n          const UInt16 *destPath = (const UInt16 *)name;\r\n          for (j = 0; name[j] != 0; j++)\r\n            if (name[j] == '/')\r\n            {\r\n              if (fullPaths)\r\n              {\r\n                name[j] = 0;\r\n                MyCreateDir(name);\r\n                name[j] = CHAR_PATH_SEPARATOR;\r\n              }\r\n              else\r\n                destPath = name + j + 1;\r\n            }\r\n    \r\n          if (f->IsDir)\r\n          {\r\n            MyCreateDir(destPath);\r\n            printf(\"\\n\");\r\n            continue;\r\n          }\r\n          else if (OutFile_OpenUtf16(&outFile, destPath))\r\n          {\r\n            PrintError(\"can not open output file\");\r\n            res = SZ_ERROR_FAIL;\r\n            break;\r\n          }\r\n          processedSize = outSizeProcessed;\r\n          if (File_Write(&outFile, outBuffer + offset, &processedSize) != 0 || processedSize != outSizeProcessed)\r\n          {\r\n            PrintError(\"can not write output file\");\r\n            res = SZ_ERROR_FAIL;\r\n            break;\r\n          }\r\n          if (File_Close(&outFile))\r\n          {\r\n            PrintError(\"can not close output file\");\r\n            res = SZ_ERROR_FAIL;\r\n            break;\r\n          }\r\n          #ifdef USE_WINDOWS_FILE\r\n          if (f->AttribDefined)\r\n            SetFileAttributesW(destPath, f->Attrib);\r\n          #endif\r\n        }\r\n        printf(\"\\n\");\r\n      }\r\n      IAlloc_Free(&allocImp, outBuffer);\r\n    }\r\n  }\r\n  SzArEx_Free(&db, &allocImp);\r\n  SzFree(NULL, temp);\r\n\r\n  File_Close(&archiveStream.file);\r\n  if (res == SZ_OK)\r\n  {\r\n    printf(\"\\nEverything is Ok\\n\");\r\n    return 0;\r\n  }\r\n  if (res == SZ_ERROR_UNSUPPORTED)\r\n    PrintError(\"decoder doesn't support this archive\");\r\n  else if (res == SZ_ERROR_MEM)\r\n    PrintError(\"can not allocate memory\");\r\n  else if (res == SZ_ERROR_CRC)\r\n    PrintError(\"CRC error\");\r\n  else\r\n    printf(\"\\nERROR #%d\\n\", res);\r\n  return 1;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/Util/7z/makefile",
    "content": "MY_STATIC_LINK=1\r\nCFLAGS = $(CFLAGS) -D_7ZIP_PPMD_SUPPPORT\r\n\r\nPROG = 7zDec.exe\r\n\r\nC_OBJS = \\\r\n  $O\\7zAlloc.obj \\\r\n  $O\\7zBuf.obj \\\r\n  $O\\7zBuf2.obj \\\r\n  $O\\7zCrc.obj \\\r\n  $O\\7zCrcOpt.obj \\\r\n  $O\\7zFile.obj \\\r\n  $O\\7zDec.obj \\\r\n  $O\\7zIn.obj \\\r\n  $O\\7zStream.obj \\\r\n  $O\\Bcj2.obj \\\r\n  $O\\Bra.obj \\\r\n  $O\\Bra86.obj \\\r\n  $O\\CpuArch.obj \\\r\n  $O\\Lzma2Dec.obj \\\r\n  $O\\LzmaDec.obj \\\r\n  $O\\Ppmd7.obj \\\r\n  $O\\Ppmd7Dec.obj \\\r\n\r\n7Z_OBJS = \\\r\n  $O\\7zMain.obj \\\r\n\r\nOBJS = \\\r\n  $(7Z_OBJS) \\\r\n  $(C_OBJS) \\\r\n\r\n!include \"../../../CPP/Build.mak\"\r\n\r\n$(7Z_OBJS): $(*B).c\r\n\t$(COMPL_O1)\r\n$(C_OBJS): ../../$(*B).c\r\n\t$(COMPL_O2)\r\n"
  },
  {
    "path": "ext/lzma/C/Util/7z/makefile.gcc",
    "content": "PROG = 7zDec\r\nCXX = g++\r\nLIB =\r\nRM = rm -f\r\nCFLAGS = -c -O2 -Wall\r\n\r\nOBJS = 7zMain.o 7zAlloc.o 7zBuf.o 7zBuf2.o 7zCrc.o 7zCrcOpt.o 7zDec.o 7zIn.o CpuArch.o LzmaDec.o Lzma2Dec.o Bra.o Bra86.o Bcj2.o Ppmd7.o Ppmd7Dec.o 7zFile.o 7zStream.o\r\n\r\nall: $(PROG)\r\n\r\n$(PROG): $(OBJS)\r\n\t$(CXX) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIB)\r\n\r\n7zMain.o: 7zMain.c\r\n\t$(CXX) $(CFLAGS) 7zMain.c\r\n\r\n7zAlloc.o: 7zAlloc.c\r\n\t$(CXX) $(CFLAGS) ../../7zAlloc.c\r\n\r\n7zBuf.o: ../../7zBuf.c\r\n\t$(CXX) $(CFLAGS) ../../7zBuf.c\r\n\r\n7zBuf2.o: ../../7zBuf2.c\r\n\t$(CXX) $(CFLAGS) ../../7zBuf2.c\r\n\r\n7zCrc.o: ../../7zCrc.c\r\n\t$(CXX) $(CFLAGS) ../../7zCrc.c\r\n\r\n7zCrcOpt.o: ../../7zCrc.c\r\n\t$(CXX) $(CFLAGS) ../../7zCrcOpt.c\r\n\r\n7zDec.o: ../../7zDec.c\r\n\t$(CXX) $(CFLAGS) -D_7ZIP_PPMD_SUPPPORT ../../7zDec.c\r\n\r\n7zIn.o: ../../7zIn.c\r\n\t$(CXX) $(CFLAGS) ../../7zIn.c\r\n\r\nCpuArch.o: ../../CpuArch.c\r\n\t$(CXX) $(CFLAGS) ../../CpuArch.c\r\n\r\nLzmaDec.o: ../../LzmaDec.c\r\n\t$(CXX) $(CFLAGS) ../../LzmaDec.c\r\n\r\nLzma2Dec.o: ../../Lzma2Dec.c\r\n\t$(CXX) $(CFLAGS) ../../Lzma2Dec.c\r\n\r\nBra.o: ../../Bra.c\r\n\t$(CXX) $(CFLAGS) ../../Bra.c\r\n\r\nBra86.o: ../../Bra86.c\r\n\t$(CXX) $(CFLAGS) ../../Bra86.c\r\n\r\nBcj2.o: ../../Bcj2.c\r\n\t$(CXX) $(CFLAGS) ../../Bcj2.c\r\n\r\nPpmd7.o: ../../Ppmd7.c\r\n\t$(CXX) $(CFLAGS) ../../Ppmd7.c\r\n\r\nPpmd7Dec.o: ../../Ppmd7Dec.c\r\n\t$(CXX) $(CFLAGS) ../../Ppmd7Dec.c\r\n\r\n7zFile.o: ../../7zFile.c\r\n\t$(CXX) $(CFLAGS) ../../7zFile.c\r\n\r\n7zStream.o: ../../7zStream.c\r\n\t$(CXX) $(CFLAGS) ../../7zStream.c\r\n\r\nclean:\r\n\t-$(RM) $(PROG) $(OBJS)\r\n\r\n"
  },
  {
    "path": "ext/lzma/C/Util/Lzma/LzmaUtil.c",
    "content": "/* LzmaUtil.c -- Test application for LZMA compression\r\n2010-09-20 : Igor Pavlov : Public domain */\r\n\r\n#define _CRT_SECURE_NO_WARNINGS\r\n\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"../../Alloc.h\"\r\n#include \"../../7zFile.h\"\r\n#include \"../../7zVersion.h\"\r\n#include \"../../LzmaDec.h\"\r\n#include \"../../LzmaEnc.h\"\r\n\r\nconst char *kCantReadMessage = \"Can not read input file\";\r\nconst char *kCantWriteMessage = \"Can not write output file\";\r\nconst char *kCantAllocateMessage = \"Can not allocate memory\";\r\nconst char *kDataErrorMessage = \"Data error\";\r\n\r\nstatic void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); }\r\nstatic void SzFree(void *p, void *address) { p = p; MyFree(address); }\r\nstatic ISzAlloc g_Alloc = { SzAlloc, SzFree };\r\n\r\nvoid PrintHelp(char *buffer)\r\n{\r\n  strcat(buffer, \"\\nLZMA Utility \" MY_VERSION_COPYRIGHT_DATE \"\\n\"\r\n      \"\\nUsage:  lzma <e|d> inputFile outputFile\\n\"\r\n             \"  e: encode file\\n\"\r\n             \"  d: decode file\\n\");\r\n}\r\n\r\nint PrintError(char *buffer, const char *message)\r\n{\r\n  strcat(buffer, \"\\nError: \");\r\n  strcat(buffer, message);\r\n  strcat(buffer, \"\\n\");\r\n  return 1;\r\n}\r\n\r\nint PrintErrorNumber(char *buffer, SRes val)\r\n{\r\n  sprintf(buffer + strlen(buffer), \"\\nError code: %x\\n\", (unsigned)val);\r\n  return 1;\r\n}\r\n\r\nint PrintUserError(char *buffer)\r\n{\r\n  return PrintError(buffer, \"Incorrect command\");\r\n}\r\n\r\n#define IN_BUF_SIZE (1 << 16)\r\n#define OUT_BUF_SIZE (1 << 16)\r\n\r\nstatic SRes Decode2(CLzmaDec *state, ISeqOutStream *outStream, ISeqInStream *inStream,\r\n    UInt64 unpackSize)\r\n{\r\n  int thereIsSize = (unpackSize != (UInt64)(Int64)-1);\r\n  Byte inBuf[IN_BUF_SIZE];\r\n  Byte outBuf[OUT_BUF_SIZE];\r\n  size_t inPos = 0, inSize = 0, outPos = 0;\r\n  LzmaDec_Init(state);\r\n  for (;;)\r\n  {\r\n    if (inPos == inSize)\r\n    {\r\n      inSize = IN_BUF_SIZE;\r\n      RINOK(inStream->Read(inStream, inBuf, &inSize));\r\n      inPos = 0;\r\n    }\r\n    {\r\n      SRes res;\r\n      SizeT inProcessed = inSize - inPos;\r\n      SizeT outProcessed = OUT_BUF_SIZE - outPos;\r\n      ELzmaFinishMode finishMode = LZMA_FINISH_ANY;\r\n      ELzmaStatus status;\r\n      if (thereIsSize && outProcessed > unpackSize)\r\n      {\r\n        outProcessed = (SizeT)unpackSize;\r\n        finishMode = LZMA_FINISH_END;\r\n      }\r\n      \r\n      res = LzmaDec_DecodeToBuf(state, outBuf + outPos, &outProcessed,\r\n        inBuf + inPos, &inProcessed, finishMode, &status);\r\n      inPos += inProcessed;\r\n      outPos += outProcessed;\r\n      unpackSize -= outProcessed;\r\n      \r\n      if (outStream)\r\n        if (outStream->Write(outStream, outBuf, outPos) != outPos)\r\n          return SZ_ERROR_WRITE;\r\n        \r\n      outPos = 0;\r\n      \r\n      if (res != SZ_OK || thereIsSize && unpackSize == 0)\r\n        return res;\r\n      \r\n      if (inProcessed == 0 && outProcessed == 0)\r\n      {\r\n        if (thereIsSize || status != LZMA_STATUS_FINISHED_WITH_MARK)\r\n          return SZ_ERROR_DATA;\r\n        return res;\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\nstatic SRes Decode(ISeqOutStream *outStream, ISeqInStream *inStream)\r\n{\r\n  UInt64 unpackSize;\r\n  int i;\r\n  SRes res = 0;\r\n\r\n  CLzmaDec state;\r\n\r\n  /* header: 5 bytes of LZMA properties and 8 bytes of uncompressed size */\r\n  unsigned char header[LZMA_PROPS_SIZE + 8];\r\n\r\n  /* Read and parse header */\r\n\r\n  RINOK(SeqInStream_Read(inStream, header, sizeof(header)));\r\n\r\n  unpackSize = 0;\r\n  for (i = 0; i < 8; i++)\r\n    unpackSize += (UInt64)header[LZMA_PROPS_SIZE + i] << (i * 8);\r\n\r\n  LzmaDec_Construct(&state);\r\n  RINOK(LzmaDec_Allocate(&state, header, LZMA_PROPS_SIZE, &g_Alloc));\r\n  res = Decode2(&state, outStream, inStream, unpackSize);\r\n  LzmaDec_Free(&state, &g_Alloc);\r\n  return res;\r\n}\r\n\r\nstatic SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 fileSize, char *rs)\r\n{\r\n  CLzmaEncHandle enc;\r\n  SRes res;\r\n  CLzmaEncProps props;\r\n\r\n  rs = rs;\r\n\r\n  enc = LzmaEnc_Create(&g_Alloc);\r\n  if (enc == 0)\r\n    return SZ_ERROR_MEM;\r\n\r\n  LzmaEncProps_Init(&props);\r\n  res = LzmaEnc_SetProps(enc, &props);\r\n\r\n  if (res == SZ_OK)\r\n  {\r\n    Byte header[LZMA_PROPS_SIZE + 8];\r\n    size_t headerSize = LZMA_PROPS_SIZE;\r\n    int i;\r\n\r\n    res = LzmaEnc_WriteProperties(enc, header, &headerSize);\r\n    for (i = 0; i < 8; i++)\r\n      header[headerSize++] = (Byte)(fileSize >> (8 * i));\r\n    if (outStream->Write(outStream, header, headerSize) != headerSize)\r\n      res = SZ_ERROR_WRITE;\r\n    else\r\n    {\r\n      if (res == SZ_OK)\r\n        res = LzmaEnc_Encode(enc, outStream, inStream, NULL, &g_Alloc, &g_Alloc);\r\n    }\r\n  }\r\n  LzmaEnc_Destroy(enc, &g_Alloc, &g_Alloc);\r\n  return res;\r\n}\r\n\r\nint main2(int numArgs, const char *args[], char *rs)\r\n{\r\n  CFileSeqInStream inStream;\r\n  CFileOutStream outStream;\r\n  char c;\r\n  int res;\r\n  int encodeMode;\r\n  Bool useOutFile = False;\r\n\r\n  FileSeqInStream_CreateVTable(&inStream);\r\n  File_Construct(&inStream.file);\r\n\r\n  FileOutStream_CreateVTable(&outStream);\r\n  File_Construct(&outStream.file);\r\n\r\n  if (numArgs == 1)\r\n  {\r\n    PrintHelp(rs);\r\n    return 0;\r\n  }\r\n\r\n  if (numArgs < 3 || numArgs > 4 || strlen(args[1]) != 1)\r\n    return PrintUserError(rs);\r\n\r\n  c = args[1][0];\r\n  encodeMode = (c == 'e' || c == 'E');\r\n  if (!encodeMode && c != 'd' && c != 'D')\r\n    return PrintUserError(rs);\r\n\r\n  {\r\n    size_t t4 = sizeof(UInt32);\r\n    size_t t8 = sizeof(UInt64);\r\n    if (t4 != 4 || t8 != 8)\r\n      return PrintError(rs, \"Incorrect UInt32 or UInt64\");\r\n  }\r\n\r\n  if (InFile_Open(&inStream.file, args[2]) != 0)\r\n    return PrintError(rs, \"Can not open input file\");\r\n\r\n  if (numArgs > 3)\r\n  {\r\n    useOutFile = True;\r\n    if (OutFile_Open(&outStream.file, args[3]) != 0)\r\n      return PrintError(rs, \"Can not open output file\");\r\n  }\r\n  else if (encodeMode)\r\n    PrintUserError(rs);\r\n\r\n  if (encodeMode)\r\n  {\r\n    UInt64 fileSize;\r\n    File_GetLength(&inStream.file, &fileSize);\r\n    res = Encode(&outStream.s, &inStream.s, fileSize, rs);\r\n  }\r\n  else\r\n  {\r\n    res = Decode(&outStream.s, useOutFile ? &inStream.s : NULL);\r\n  }\r\n\r\n  if (useOutFile)\r\n    File_Close(&outStream.file);\r\n  File_Close(&inStream.file);\r\n\r\n  if (res != SZ_OK)\r\n  {\r\n    if (res == SZ_ERROR_MEM)\r\n      return PrintError(rs, kCantAllocateMessage);\r\n    else if (res == SZ_ERROR_DATA)\r\n      return PrintError(rs, kDataErrorMessage);\r\n    else if (res == SZ_ERROR_WRITE)\r\n      return PrintError(rs, kCantWriteMessage);\r\n    else if (res == SZ_ERROR_READ)\r\n      return PrintError(rs, kCantReadMessage);\r\n    return PrintErrorNumber(rs, res);\r\n  }\r\n  return 0;\r\n}\r\n\r\nint MY_CDECL main(int numArgs, const char *args[])\r\n{\r\n  char rs[800] = { 0 };\r\n  int res = main2(numArgs, args, rs);\r\n  fputs(rs, stdout);\r\n  return res;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/Util/Lzma/LzmaUtil.dsp",
    "content": "# Microsoft Developer Studio Project File - Name=\"LzmaUtil\" - Package Owner=<4>\r\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\r\n# ** DO NOT EDIT **\r\n\r\n# TARGTYPE \"Win32 (x86) Console Application\" 0x0103\r\n\r\nCFG=LzmaUtil - Win32 Debug\r\n!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r\n!MESSAGE use the Export Makefile command and run\r\n!MESSAGE \r\n!MESSAGE NMAKE /f \"LzmaUtil.mak\".\r\n!MESSAGE \r\n!MESSAGE You can specify a configuration when running NMAKE\r\n!MESSAGE by defining the macro CFG on the command line. For example:\r\n!MESSAGE \r\n!MESSAGE NMAKE /f \"LzmaUtil.mak\" CFG=\"LzmaUtil - Win32 Debug\"\r\n!MESSAGE \r\n!MESSAGE Possible choices for configuration are:\r\n!MESSAGE \r\n!MESSAGE \"LzmaUtil - Win32 Release\" (based on \"Win32 (x86) Console Application\")\r\n!MESSAGE \"LzmaUtil - Win32 Debug\" (based on \"Win32 (x86) Console Application\")\r\n!MESSAGE \r\n\r\n# Begin Project\r\n# PROP AllowPerConfigDependencies 0\r\n# PROP Scc_ProjName \"\"\r\n# PROP Scc_LocalPath \"\"\r\nCPP=cl.exe\r\nRSC=rc.exe\r\n\r\n!IF  \"$(CFG)\" == \"LzmaUtil - Win32 Release\"\r\n\r\n# PROP BASE Use_MFC 0\r\n# PROP BASE Use_Debug_Libraries 0\r\n# PROP BASE Output_Dir \"Release\"\r\n# PROP BASE Intermediate_Dir \"Release\"\r\n# PROP BASE Target_Dir \"\"\r\n# PROP Use_MFC 0\r\n# PROP Use_Debug_Libraries 0\r\n# PROP Output_Dir \"Release\"\r\n# PROP Intermediate_Dir \"Release\"\r\n# PROP Ignore_Export_Lib 0\r\n# PROP Target_Dir \"\"\r\n# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /c\r\n# ADD CPP /nologo /MT /W3 /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /FD /c\r\n# SUBTRACT CPP /YX\r\n# ADD BASE RSC /l 0x419 /d \"NDEBUG\"\r\n# ADD RSC /l 0x419 /d \"NDEBUG\"\r\nBSC32=bscmake.exe\r\n# ADD BASE BSC32 /nologo\r\n# ADD BSC32 /nologo\r\nLINK32=link.exe\r\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386\r\n# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:\"c:\\util\\7lzma.exe\"\r\n\r\n!ELSEIF  \"$(CFG)\" == \"LzmaUtil - Win32 Debug\"\r\n\r\n# PROP BASE Use_MFC 0\r\n# PROP BASE Use_Debug_Libraries 1\r\n# PROP BASE Output_Dir \"Debug\"\r\n# PROP BASE Intermediate_Dir \"Debug\"\r\n# PROP BASE Target_Dir \"\"\r\n# PROP Use_MFC 0\r\n# PROP Use_Debug_Libraries 1\r\n# PROP Output_Dir \"Debug\"\r\n# PROP Intermediate_Dir \"Debug\"\r\n# PROP Ignore_Export_Lib 0\r\n# PROP Target_Dir \"\"\r\n# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /YX /FD /GZ /c\r\n# ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_CONSOLE\" /D \"_MBCS\" /FD /GZ /c\r\n# SUBTRACT CPP /YX\r\n# ADD BASE RSC /l 0x419 /d \"_DEBUG\"\r\n# ADD RSC /l 0x419 /d \"_DEBUG\"\r\nBSC32=bscmake.exe\r\n# ADD BASE BSC32 /nologo\r\n# ADD BSC32 /nologo\r\nLINK32=link.exe\r\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept\r\n# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:\"c:\\util\\7lzma.exe\" /pdbtype:sept\r\n\r\n!ENDIF \r\n\r\n# Begin Target\r\n\r\n# Name \"LzmaUtil - Win32 Release\"\r\n# Name \"LzmaUtil - Win32 Debug\"\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zFile.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zFile.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zStream.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zVersion.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Alloc.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Alloc.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\CpuArch.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzFind.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzFind.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzFindMt.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzFindMt.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzHash.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzmaDec.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzmaDec.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzmaEnc.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzmaEnc.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=.\\LzmaUtil.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Threads.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Threads.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Types.h\r\n# End Source File\r\n# End Target\r\n# End Project\r\n"
  },
  {
    "path": "ext/lzma/C/Util/Lzma/LzmaUtil.dsw",
    "content": "Microsoft Developer Studio Workspace File, Format Version 6.00\r\n# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\r\n\r\n###############################################################################\r\n\r\nProject: \"LzmaUtil\"=.\\LzmaUtil.dsp - Package Owner=<4>\r\n\r\nPackage=<5>\r\n{{{\r\n}}}\r\n\r\nPackage=<4>\r\n{{{\r\n}}}\r\n\r\n###############################################################################\r\n\r\nGlobal:\r\n\r\nPackage=<5>\r\n{{{\r\n}}}\r\n\r\nPackage=<3>\r\n{{{\r\n}}}\r\n\r\n###############################################################################\r\n\r\n"
  },
  {
    "path": "ext/lzma/C/Util/Lzma/makefile",
    "content": "MY_STATIC_LINK=1\r\nPROG = LZMAc.exe\r\n\r\nCFLAGS = $(CFLAGS) \\\r\n\r\nLIB_OBJS = \\\r\n  $O\\LzmaUtil.obj \\\r\n\r\nC_OBJS = \\\r\n  $O\\Alloc.obj \\\r\n  $O\\LzFind.obj \\\r\n  $O\\LzFindMt.obj \\\r\n  $O\\LzmaDec.obj \\\r\n  $O\\LzmaEnc.obj \\\r\n  $O\\7zFile.obj \\\r\n  $O\\7zStream.obj \\\r\n  $O\\Threads.obj \\\r\n\r\nOBJS = \\\r\n  $(LIB_OBJS) \\\r\n  $(C_OBJS) \\\r\n\r\n!include \"../../../CPP/Build.mak\"\r\n\r\n$(LIB_OBJS): $(*B).c\r\n\t$(COMPL_O2)\r\n$(C_OBJS): ../../$(*B).c\r\n\t$(COMPL_O2)\r\n"
  },
  {
    "path": "ext/lzma/C/Util/Lzma/makefile.gcc",
    "content": "PROG = lzma\r\nCXX = g++\r\nLIB =\r\nRM = rm -f\r\nCFLAGS = -c -O2 -Wall -D_7ZIP_ST\r\n\r\nOBJS = \\\r\n  LzmaUtil.o \\\r\n  Alloc.o \\\r\n  LzFind.o \\\r\n  LzmaDec.o \\\r\n  LzmaEnc.o \\\r\n  7zFile.o \\\r\n  7zStream.o \\\r\n\r\n\r\nall: $(PROG)\r\n\r\n$(PROG): $(OBJS)\r\n\t$(CXX) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIB) $(LIB2)\r\n\r\nLzmaUtil.o: LzmaUtil.c\r\n\t$(CXX) $(CFLAGS) LzmaUtil.c\r\n\r\nAlloc.o: ../../Alloc.c\r\n\t$(CXX) $(CFLAGS) ../../Alloc.c\r\n\r\nLzFind.o: ../../LzFind.c\r\n\t$(CXX) $(CFLAGS) ../../LzFind.c\r\n\r\nLzmaDec.o: ../../LzmaDec.c\r\n\t$(CXX) $(CFLAGS) ../../LzmaDec.c\r\n\r\nLzmaEnc.o: ../../LzmaEnc.c\r\n\t$(CXX) $(CFLAGS) ../../LzmaEnc.c\r\n\r\n7zFile.o: ../../7zFile.c\r\n\t$(CXX) $(CFLAGS) ../../7zFile.c\r\n\r\n7zStream.o: ../../7zStream.c\r\n\t$(CXX) $(CFLAGS) ../../7zStream.c\r\n\r\nclean:\r\n\t-$(RM) $(PROG) $(OBJS)\r\n"
  },
  {
    "path": "ext/lzma/C/Util/LzmaLib/LzmaLib.def",
    "content": "EXPORTS\r\n  LzmaCompress\r\n  LzmaUncompress\r\n\r\n"
  },
  {
    "path": "ext/lzma/C/Util/LzmaLib/LzmaLib.dsp",
    "content": "# Microsoft Developer Studio Project File - Name=\"LzmaLib\" - Package Owner=<4>\r\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\r\n# ** DO NOT EDIT **\r\n\r\n# TARGTYPE \"Win32 (x86) Dynamic-Link Library\" 0x0102\r\n\r\nCFG=LzmaLib - Win32 Debug\r\n!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r\n!MESSAGE use the Export Makefile command and run\r\n!MESSAGE \r\n!MESSAGE NMAKE /f \"LzmaLib.mak\".\r\n!MESSAGE \r\n!MESSAGE You can specify a configuration when running NMAKE\r\n!MESSAGE by defining the macro CFG on the command line. For example:\r\n!MESSAGE \r\n!MESSAGE NMAKE /f \"LzmaLib.mak\" CFG=\"LzmaLib - Win32 Debug\"\r\n!MESSAGE \r\n!MESSAGE Possible choices for configuration are:\r\n!MESSAGE \r\n!MESSAGE \"LzmaLib - Win32 Release\" (based on \"Win32 (x86) Dynamic-Link Library\")\r\n!MESSAGE \"LzmaLib - Win32 Debug\" (based on \"Win32 (x86) Dynamic-Link Library\")\r\n!MESSAGE \r\n\r\n# Begin Project\r\n# PROP AllowPerConfigDependencies 0\r\n# PROP Scc_ProjName \"\"\r\n# PROP Scc_LocalPath \"\"\r\nCPP=cl.exe\r\nMTL=midl.exe\r\nRSC=rc.exe\r\n\r\n!IF  \"$(CFG)\" == \"LzmaLib - Win32 Release\"\r\n\r\n# PROP BASE Use_MFC 0\r\n# PROP BASE Use_Debug_Libraries 0\r\n# PROP BASE Output_Dir \"Release\"\r\n# PROP BASE Intermediate_Dir \"Release\"\r\n# PROP BASE Target_Dir \"\"\r\n# PROP Use_MFC 0\r\n# PROP Use_Debug_Libraries 0\r\n# PROP Output_Dir \"Release\"\r\n# PROP Intermediate_Dir \"Release\"\r\n# PROP Ignore_Export_Lib 0\r\n# PROP Target_Dir \"\"\r\n# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_WINDOWS\" /D \"_MBCS\" /D \"_USRDLL\" /D \"LZMALIB_EXPORTS\" /YX /FD /c\r\n# ADD CPP /nologo /Gr /MT /W3 /O2 /D \"NDEBUG\" /D \"WIN32\" /D \"_WINDOWS\" /D \"_MBCS\" /D \"_USRDLL\" /D \"LZMALIB_EXPORTS\" /FD /c\r\n# SUBTRACT CPP /YX\r\n# ADD BASE MTL /nologo /D \"NDEBUG\" /mktyplib203 /win32\r\n# ADD MTL /nologo /D \"NDEBUG\" /mktyplib203 /win32\r\n# ADD BASE RSC /l 0x419 /d \"NDEBUG\"\r\n# ADD RSC /l 0x419 /d \"NDEBUG\"\r\nBSC32=bscmake.exe\r\n# ADD BASE BSC32 /nologo\r\n# ADD BSC32 /nologo\r\nLINK32=link.exe\r\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386\r\n# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:\"C:\\Util\\LZMA.dll\" /opt:NOWIN98\r\n# SUBTRACT LINK32 /pdb:none\r\n\r\n!ELSEIF  \"$(CFG)\" == \"LzmaLib - Win32 Debug\"\r\n\r\n# PROP BASE Use_MFC 0\r\n# PROP BASE Use_Debug_Libraries 1\r\n# PROP BASE Output_Dir \"Debug\"\r\n# PROP BASE Intermediate_Dir \"Debug\"\r\n# PROP BASE Target_Dir \"\"\r\n# PROP Use_MFC 0\r\n# PROP Use_Debug_Libraries 1\r\n# PROP Output_Dir \"Debug\"\r\n# PROP Intermediate_Dir \"Debug\"\r\n# PROP Ignore_Export_Lib 0\r\n# PROP Target_Dir \"\"\r\n# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\" /D \"_MBCS\" /D \"_USRDLL\" /D \"LZMALIB_EXPORTS\" /YX /FD /GZ /c\r\n# ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /D \"_DEBUG\" /D \"WIN32\" /D \"_WINDOWS\" /D \"_MBCS\" /D \"_USRDLL\" /D \"LZMALIB_EXPORTS\" /D \"COMPRESS_MF_MT\" /FD /GZ /c\r\n# SUBTRACT CPP /YX\r\n# ADD BASE MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32\r\n# ADD MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32\r\n# ADD BASE RSC /l 0x419 /d \"_DEBUG\"\r\n# ADD RSC /l 0x419 /d \"_DEBUG\"\r\nBSC32=bscmake.exe\r\n# ADD BASE BSC32 /nologo\r\n# ADD BSC32 /nologo\r\nLINK32=link.exe\r\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept\r\n# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:\"C:\\Util\\LZMA.dll\" /pdbtype:sept\r\n\r\n!ENDIF \r\n\r\n# Begin Target\r\n\r\n# Name \"LzmaLib - Win32 Release\"\r\n# Name \"LzmaLib - Win32 Debug\"\r\n# Begin Group \"Spec\"\r\n\r\n# PROP Default_Filter \"\"\r\n# Begin Source File\r\n\r\nSOURCE=.\\LzmaLib.def\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=.\\LzmaLibExports.c\r\n# End Source File\r\n# End Group\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Alloc.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Alloc.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\IStream.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzFind.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzFind.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzFindMt.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzFindMt.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzHash.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzmaDec.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzmaDec.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzmaEnc.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzmaEnc.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzmaLib.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzmaLib.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=.\\resource.rc\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Threads.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Threads.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Types.h\r\n# End Source File\r\n# End Target\r\n# End Project\r\n"
  },
  {
    "path": "ext/lzma/C/Util/LzmaLib/LzmaLib.dsw",
    "content": "Microsoft Developer Studio Workspace File, Format Version 6.00\r\n# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\r\n\r\n###############################################################################\r\n\r\nProject: \"LzmaLib\"=.\\LzmaLib.dsp - Package Owner=<4>\r\n\r\nPackage=<5>\r\n{{{\r\n}}}\r\n\r\nPackage=<4>\r\n{{{\r\n}}}\r\n\r\n###############################################################################\r\n\r\nGlobal:\r\n\r\nPackage=<5>\r\n{{{\r\n}}}\r\n\r\nPackage=<3>\r\n{{{\r\n}}}\r\n\r\n###############################################################################\r\n\r\n"
  },
  {
    "path": "ext/lzma/C/Util/LzmaLib/LzmaLibExports.c",
    "content": "/* LzmaLibExports.c -- LZMA library DLL Entry point\r\n2008-10-04 : Igor Pavlov : Public domain */\r\n\r\n#include <windows.h>\r\n\r\nBOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)\r\n{\r\n  hInstance = hInstance;\r\n  dwReason = dwReason;\r\n  lpReserved = lpReserved;\r\n  return TRUE;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/Util/LzmaLib/makefile",
    "content": "MY_STATIC_LINK=1\r\nSLIB = sLZMA.lib\r\nPROG = LZMA.dll\r\nSLIBPATH = $O\\$(SLIB)\r\n\r\nDEF_FILE = LzmaLib.def\r\nCFLAGS = $(CFLAGS) \\\r\n\r\nLIB_OBJS = \\\r\n  $O\\LzmaLibExports.obj \\\r\n\r\nC_OBJS = \\\r\n  $O\\Alloc.obj \\\r\n  $O\\LzFind.obj \\\r\n  $O\\LzFindMt.obj \\\r\n  $O\\LzmaDec.obj \\\r\n  $O\\LzmaEnc.obj \\\r\n  $O\\LzmaLib.obj \\\r\n  $O\\Threads.obj \\\r\n\r\nOBJS = \\\r\n  $(LIB_OBJS) \\\r\n  $(C_OBJS) \\\r\n  $O\\resource.res\r\n\r\n!include \"../../../CPP/Build.mak\"\r\n\r\n$(SLIBPATH): $O $(OBJS)\r\n\tlib -out:$(SLIBPATH) $(OBJS) $(LIBS)\r\n\r\n$(LIB_OBJS): $(*B).c\r\n\t$(COMPL_O2)\r\n$(C_OBJS): ../../$(*B).c\r\n\t$(COMPL_O2)\r\n"
  },
  {
    "path": "ext/lzma/C/Util/LzmaLib/resource.rc",
    "content": "#include \"../../7zVersion.rc\"\r\n\r\nMY_VERSION_INFO_DLL(\"LZMA library\", \"LZMA\")\r\n"
  },
  {
    "path": "ext/lzma/C/Util/SfxSetup/SfxSetup.c",
    "content": "/* SfxSetup.c - 7z SFX Setup\r\n2010-12-13 : Igor Pavlov : Public domain */\r\n\r\n#ifndef UNICODE\r\n#define UNICODE\r\n#endif\r\n\r\n#ifndef _UNICODE\r\n#define _UNICODE\r\n#endif\r\n\r\n#ifdef _CONSOLE\r\n#include <stdio.h>\r\n#endif\r\n\r\n#include \"../../7z.h\"\r\n#include \"../../7zAlloc.h\"\r\n#include \"../../7zCrc.h\"\r\n#include \"../../7zFile.h\"\r\n#include \"../../CpuArch.h\"\r\n\r\n#define k_EXE_ExtIndex 1\r\n\r\nstatic const char *kExts[] =\r\n{\r\n  \"bat\",\r\n  \"cmd\",\r\n  \"exe\",\r\n  \"inf\",\r\n  \"msi\",\r\n  #ifdef UNDER_CE\r\n  \"cab\",\r\n  #endif\r\n  \"html\",\r\n  \"htm\"\r\n};\r\n\r\nstatic const char *kNames[] =\r\n{\r\n  \"setup\",\r\n  \"install\",\r\n  \"run\",\r\n  \"start\"\r\n};\r\n\r\nstatic unsigned FindExt(const wchar_t *s, unsigned *extLen)\r\n{\r\n  unsigned len = (unsigned)wcslen(s);\r\n  unsigned i;\r\n  for (i = len; i > 0; i--)\r\n  {\r\n    if (s[i - 1] == '.')\r\n    {\r\n      *extLen = len - i;\r\n      return i - 1;\r\n    }\r\n  }\r\n  *extLen = 0;\r\n  return len;\r\n}\r\n\r\n#define MAKE_CHAR_UPPER(c) ((((c) >= 'a' && (c) <= 'z') ? (c) -= 0x20 : (c)))\r\n\r\nstatic unsigned FindItem(const char **items, unsigned num, const wchar_t *s, unsigned len)\r\n{\r\n  unsigned i;\r\n  for (i = 0; i < num; i++)\r\n  {\r\n    const char *item = items[i];\r\n    unsigned itemLen = (unsigned)strlen(item);\r\n    unsigned j;\r\n    if (len != itemLen)\r\n      continue;\r\n    for (j = 0; j < len; j++)\r\n    {\r\n      unsigned c = item[j];\r\n      if (c != s[j] && MAKE_CHAR_UPPER(c) != s[j])\r\n        break;\r\n    }\r\n    if (j == len)\r\n      return i;\r\n  }\r\n  return i;\r\n}\r\n\r\n#ifdef _CONSOLE\r\nstatic BOOL WINAPI HandlerRoutine(DWORD ctrlType)\r\n{\r\n  ctrlType = ctrlType;\r\n  return TRUE;\r\n}\r\n#endif\r\n\r\nstatic void PrintErrorMessage(const char *message)\r\n{\r\n  #ifdef _CONSOLE\r\n  printf(\"\\n7-Zip Error: %s\\n\", message);\r\n  #else\r\n  #ifdef UNDER_CE\r\n  WCHAR messageW[256 + 4];\r\n  unsigned i;\r\n  for (i = 0; i < 256 && message[i] != 0; i++)\r\n    messageW[i] = message[i];\r\n  messageW[i] = 0;\r\n  MessageBoxW(0, messageW, L\"7-Zip Error\", MB_ICONERROR);\r\n  #else\r\n  MessageBoxA(0, message, \"7-Zip Error\", MB_ICONERROR);\r\n  #endif\r\n  #endif\r\n}\r\n\r\nstatic WRes MyCreateDir(const WCHAR *name)\r\n{\r\n  return CreateDirectoryW(name, NULL) ? 0 : GetLastError();\r\n}\r\n\r\n#ifdef UNDER_CE\r\n#define kBufferSize (1 << 13)\r\n#else\r\n#define kBufferSize (1 << 15)\r\n#endif\r\n\r\n#define kSignatureSearchLimit (1 << 22)\r\n\r\nstatic Bool FindSignature(CSzFile *stream, UInt64 *resPos)\r\n{\r\n  Byte buf[kBufferSize];\r\n  size_t numPrevBytes = 0;\r\n  *resPos = 0;\r\n  for (;;)\r\n  {\r\n    size_t processed, pos;\r\n    if (*resPos > kSignatureSearchLimit)\r\n      return False;\r\n    processed = kBufferSize - numPrevBytes;\r\n    if (File_Read(stream, buf + numPrevBytes, &processed) != 0)\r\n      return False;\r\n    processed += numPrevBytes;\r\n    if (processed < k7zStartHeaderSize ||\r\n        (processed == k7zStartHeaderSize && numPrevBytes != 0))\r\n      return False;\r\n    processed -= k7zStartHeaderSize;\r\n    for (pos = 0; pos <= processed; pos++)\r\n    {\r\n      for (; buf[pos] != '7' && pos <= processed; pos++);\r\n      if (pos > processed)\r\n        break;\r\n      if (memcmp(buf + pos, k7zSignature, k7zSignatureSize) == 0)\r\n        if (CrcCalc(buf + pos + 12, 20) == GetUi32(buf + pos + 8))\r\n        {\r\n          *resPos += pos;\r\n          return True;\r\n        }\r\n    }\r\n    *resPos += processed;\r\n    numPrevBytes = k7zStartHeaderSize;\r\n    memmove(buf, buf + processed, k7zStartHeaderSize);\r\n  }\r\n}\r\n\r\nstatic Bool DoesFileOrDirExist(const WCHAR *path)\r\n{\r\n  WIN32_FIND_DATAW fd;\r\n  HANDLE handle;\r\n  handle = FindFirstFileW(path, &fd);\r\n  if (handle == INVALID_HANDLE_VALUE)\r\n    return False;\r\n  FindClose(handle);\r\n  return True;\r\n}\r\n\r\nstatic WRes RemoveDirWithSubItems(WCHAR *path)\r\n{\r\n  WIN32_FIND_DATAW fd;\r\n  HANDLE handle;\r\n  WRes res = 0;\r\n  size_t len = wcslen(path);\r\n  wcscpy(path + len, L\"*\");\r\n  handle = FindFirstFileW(path, &fd);\r\n  path[len] = L'\\0';\r\n  if (handle == INVALID_HANDLE_VALUE)\r\n    return GetLastError();\r\n  for (;;)\r\n  {\r\n    if (wcscmp(fd.cFileName, L\".\") != 0 &&\r\n        wcscmp(fd.cFileName, L\"..\") != 0)\r\n    {\r\n      wcscpy(path + len, fd.cFileName);\r\n      if ((fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0)\r\n      {\r\n        wcscat(path, L\"\\\\\");\r\n        res = RemoveDirWithSubItems(path);\r\n      }\r\n      else\r\n      {\r\n        SetFileAttributesW(path, 0);\r\n        if (DeleteFileW(path) == 0)\r\n          res = GetLastError();\r\n      }\r\n      if (res != 0)\r\n        break;\r\n    }\r\n    if (!FindNextFileW(handle, &fd))\r\n    {\r\n      res = GetLastError();\r\n      if (res == ERROR_NO_MORE_FILES)\r\n        res = 0;\r\n      break;\r\n    }\r\n  }\r\n  path[len] = L'\\0';\r\n  FindClose(handle);\r\n  if (res == 0)\r\n  {\r\n    if (!RemoveDirectoryW(path))\r\n      res = GetLastError();\r\n  }\r\n  return res;\r\n}\r\n\r\n#ifdef _CONSOLE\r\nint MY_CDECL main()\r\n#else\r\nint APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,\r\n  #ifdef UNDER_CE\r\n  LPWSTR\r\n  #else\r\n  LPSTR\r\n  #endif\r\n  lpCmdLine, int nCmdShow)\r\n#endif\r\n{\r\n  CFileInStream archiveStream;\r\n  CLookToRead lookStream;\r\n  CSzArEx db;\r\n  SRes res = SZ_OK;\r\n  ISzAlloc allocImp;\r\n  ISzAlloc allocTempImp;\r\n  WCHAR sfxPath[MAX_PATH + 2];\r\n  WCHAR path[MAX_PATH * 3 + 2];\r\n  size_t pathLen;\r\n  DWORD winRes;\r\n  const wchar_t *cmdLineParams;\r\n  const char *errorMessage = NULL;\r\n  Bool useShellExecute = True;\r\n\r\n  #ifdef _CONSOLE\r\n  SetConsoleCtrlHandler(HandlerRoutine, TRUE);\r\n  #else\r\n  hInstance = hInstance;\r\n  hPrevInstance = hPrevInstance;\r\n  lpCmdLine = lpCmdLine;\r\n  nCmdShow = nCmdShow;\r\n  #endif\r\n\r\n  CrcGenerateTable();\r\n\r\n  allocImp.Alloc = SzAlloc;\r\n  allocImp.Free = SzFree;\r\n\r\n  allocTempImp.Alloc = SzAllocTemp;\r\n  allocTempImp.Free = SzFreeTemp;\r\n\r\n  FileInStream_CreateVTable(&archiveStream);\r\n  LookToRead_CreateVTable(&lookStream, False);\r\n \r\n  winRes = GetModuleFileNameW(NULL, sfxPath, MAX_PATH);\r\n  if (winRes == 0 || winRes > MAX_PATH)\r\n    return 1;\r\n  {\r\n    cmdLineParams = GetCommandLineW();\r\n    #ifndef UNDER_CE\r\n    {\r\n      Bool quoteMode = False;\r\n      for (;; cmdLineParams++)\r\n      {\r\n        wchar_t c = *cmdLineParams;\r\n        if (c == L'\\\"')\r\n          quoteMode = !quoteMode;\r\n        else if (c == 0 || (c == L' ' && !quoteMode))\r\n          break;\r\n      }\r\n    }\r\n    #endif\r\n  }\r\n\r\n  {\r\n    unsigned i;\r\n    DWORD d;\r\n    winRes = GetTempPathW(MAX_PATH, path);\r\n    if (winRes == 0 || winRes > MAX_PATH)\r\n      return 1;\r\n    pathLen = wcslen(path);\r\n    d = (GetTickCount() << 12) ^ (GetCurrentThreadId() << 14) ^ GetCurrentProcessId();\r\n    for (i = 0;; i++, d += GetTickCount())\r\n    {\r\n      if (i >= 100)\r\n      {\r\n        res = SZ_ERROR_FAIL;\r\n        break;\r\n      }\r\n      wcscpy(path + pathLen, L\"7z\");\r\n\r\n      {\r\n        wchar_t *s = path + wcslen(path);\r\n        UInt32 value = d;\r\n        unsigned k;\r\n        for (k = 0; k < 8; k++)\r\n        {\r\n          unsigned t = value & 0xF;\r\n          value >>= 4;\r\n          s[7 - k] = (char)((t < 10) ? ('0' + t) : ('A' + (t - 10)));\r\n        }\r\n        s[k] = '\\0';\r\n      }\r\n\r\n      if (DoesFileOrDirExist(path))\r\n        continue;\r\n      if (CreateDirectoryW(path, NULL))\r\n      {\r\n        wcscat(path, L\"\\\\\");\r\n        pathLen = wcslen(path);\r\n        break;\r\n      }\r\n      if (GetLastError() != ERROR_ALREADY_EXISTS)\r\n      {\r\n        res = SZ_ERROR_FAIL;\r\n        break;\r\n      }\r\n    }\r\n    if (res != SZ_OK)\r\n      errorMessage = \"Can't create temp folder\";\r\n  }\r\n\r\n  if (res != SZ_OK)\r\n  {\r\n    if (!errorMessage)\r\n      errorMessage = \"Error\";\r\n    PrintErrorMessage(errorMessage);\r\n    return 1;\r\n  }\r\n\r\n  if (InFile_OpenW(&archiveStream.file, sfxPath) != 0)\r\n  {\r\n    errorMessage = \"can not open input file\";\r\n    res = SZ_ERROR_FAIL;\r\n  }\r\n  else\r\n  {\r\n    UInt64 pos = 0;\r\n    if (!FindSignature(&archiveStream.file, &pos))\r\n      res = SZ_ERROR_FAIL;\r\n    else if (File_Seek(&archiveStream.file, (Int64 *)&pos, SZ_SEEK_SET) != 0)\r\n      res = SZ_ERROR_FAIL;\r\n    if (res != 0)\r\n      errorMessage = \"Can't find 7z archive\";\r\n  }\r\n\r\n  if (res == SZ_OK)\r\n  {\r\n    lookStream.realStream = &archiveStream.s;\r\n    LookToRead_Init(&lookStream);\r\n  }\r\n\r\n  SzArEx_Init(&db);\r\n  if (res == SZ_OK)\r\n  {\r\n    res = SzArEx_Open(&db, &lookStream.s, &allocImp, &allocTempImp);\r\n  }\r\n  if (res == SZ_OK)\r\n  {\r\n    UInt32 executeFileIndex = (UInt32)(Int32)-1;\r\n    UInt32 minPrice = 1 << 30;\r\n    UInt32 i;\r\n    UInt32 blockIndex = 0xFFFFFFFF; /* it can have any value before first call (if outBuffer = 0) */\r\n    Byte *outBuffer = 0; /* it must be 0 before first call for each new archive. */\r\n    size_t outBufferSize = 0;  /* it can have any value before first call (if outBuffer = 0) */\r\n    \r\n    for (i = 0; i < db.db.NumFiles; i++)\r\n    {\r\n      size_t offset = 0;\r\n      size_t outSizeProcessed = 0;\r\n      const CSzFileItem *f = db.db.Files + i;\r\n      size_t len;\r\n      WCHAR *temp;\r\n      len = SzArEx_GetFileNameUtf16(&db, i, NULL);\r\n      \r\n      if (len >= MAX_PATH)\r\n      {\r\n        res = SZ_ERROR_FAIL;\r\n        break;\r\n      }\r\n      \r\n      temp = path + pathLen;\r\n      \r\n      SzArEx_GetFileNameUtf16(&db, i, temp);\r\n      {\r\n        res = SzArEx_Extract(&db, &lookStream.s, i,\r\n          &blockIndex, &outBuffer, &outBufferSize,\r\n          &offset, &outSizeProcessed,\r\n          &allocImp, &allocTempImp);\r\n        if (res != SZ_OK)\r\n          break;\r\n      }\r\n      {\r\n        CSzFile outFile;\r\n        size_t processedSize;\r\n        size_t j;\r\n        size_t nameStartPos = 0;\r\n        for (j = 0; temp[j] != 0; j++)\r\n        {\r\n          if (temp[j] == '/')\r\n          {\r\n            temp[j] = 0;\r\n            MyCreateDir(path);\r\n            temp[j] = CHAR_PATH_SEPARATOR;\r\n            nameStartPos = j + 1;\r\n          }\r\n        }\r\n\r\n        if (f->IsDir)\r\n        {\r\n          MyCreateDir(path);\r\n          continue;\r\n        }\r\n        else\r\n        {\r\n          unsigned extLen;\r\n          const WCHAR *name = temp + nameStartPos;\r\n          unsigned len = (unsigned)wcslen(name);\r\n          unsigned nameLen = FindExt(temp + nameStartPos, &extLen);\r\n          unsigned extPrice = FindItem(kExts, sizeof(kExts) / sizeof(kExts[0]), name + len - extLen, extLen);\r\n          unsigned namePrice = FindItem(kNames, sizeof(kNames) / sizeof(kNames[0]), name, nameLen);\r\n\r\n          unsigned price = namePrice + extPrice * 64 + (nameStartPos == 0 ? 0 : (1 << 12));\r\n          if (minPrice > price)\r\n          {\r\n            minPrice = price;\r\n            executeFileIndex = i;\r\n            useShellExecute = (extPrice != k_EXE_ExtIndex);\r\n          }\r\n         \r\n          if (DoesFileOrDirExist(path))\r\n          {\r\n            errorMessage = \"Duplicate file\";\r\n            res = SZ_ERROR_FAIL;\r\n            break;\r\n          }\r\n          if (OutFile_OpenW(&outFile, path))\r\n          {\r\n            errorMessage = \"Can't open output file\";\r\n            res = SZ_ERROR_FAIL;\r\n            break;\r\n          }\r\n        }\r\n        processedSize = outSizeProcessed;\r\n        if (File_Write(&outFile, outBuffer + offset, &processedSize) != 0 || processedSize != outSizeProcessed)\r\n        {\r\n          errorMessage = \"Can't write output file\";\r\n          res = SZ_ERROR_FAIL;\r\n        }\r\n        \r\n        #ifdef USE_WINDOWS_FILE\r\n        if (f->MTimeDefined)\r\n        {\r\n          FILETIME mTime;\r\n          mTime.dwLowDateTime = f->MTime.Low;\r\n          mTime.dwHighDateTime = f->MTime.High;\r\n          SetFileTime(outFile.handle, NULL, NULL, &mTime);\r\n        }\r\n        #endif\r\n        \r\n        {\r\n          SRes res2 = File_Close(&outFile);\r\n          if (res != SZ_OK)\r\n            break;\r\n          if (res2 != SZ_OK)\r\n          {\r\n            res = res2;\r\n            break;\r\n          }\r\n        }\r\n        #ifdef USE_WINDOWS_FILE\r\n        if (f->AttribDefined)\r\n          SetFileAttributesW(path, f->Attrib);\r\n        #endif\r\n      }\r\n    }\r\n\r\n    if (res == SZ_OK)\r\n    {\r\n      if (executeFileIndex == (UInt32)(Int32)-1)\r\n      {\r\n        errorMessage = \"There is no file to execute\";\r\n        res = SZ_ERROR_FAIL;\r\n      }\r\n      else\r\n      {\r\n        WCHAR *temp = path + pathLen;\r\n        UInt32 j;\r\n        SzArEx_GetFileNameUtf16(&db, executeFileIndex, temp);\r\n        for (j = 0; temp[j] != 0; j++)\r\n          if (temp[j] == '/')\r\n            temp[j] = CHAR_PATH_SEPARATOR;\r\n      }\r\n    }\r\n    IAlloc_Free(&allocImp, outBuffer);\r\n  }\r\n  SzArEx_Free(&db, &allocImp);\r\n\r\n  File_Close(&archiveStream.file);\r\n\r\n  if (res == SZ_OK)\r\n  {\r\n    HANDLE hProcess = 0;\r\n    if (useShellExecute)\r\n    {\r\n      SHELLEXECUTEINFO ei;\r\n      UINT32 executeRes;\r\n      BOOL success;\r\n      \r\n      memset(&ei, 0, sizeof(ei));\r\n      ei.cbSize = sizeof(ei);\r\n      ei.lpFile = path;\r\n      ei.fMask = SEE_MASK_NOCLOSEPROCESS\r\n          #ifndef UNDER_CE\r\n          | SEE_MASK_FLAG_DDEWAIT\r\n          #endif\r\n          /* | SEE_MASK_NO_CONSOLE */\r\n          ;\r\n      if (wcslen(cmdLineParams) != 0)\r\n        ei.lpParameters = cmdLineParams;\r\n      ei.nShow = SW_SHOWNORMAL; /* SW_HIDE; */\r\n      success = ShellExecuteEx(&ei);\r\n      executeRes = (UINT32)(UINT_PTR)ei.hInstApp;\r\n      if (!success || (executeRes <= 32 && executeRes != 0))  /* executeRes = 0 in Windows CE */\r\n        res = SZ_ERROR_FAIL;\r\n      else\r\n        hProcess = ei.hProcess;\r\n    }\r\n    else\r\n    {\r\n      STARTUPINFOW si;\r\n      PROCESS_INFORMATION pi;\r\n      WCHAR cmdLine[MAX_PATH * 3];\r\n\r\n      wcscpy(cmdLine, path);\r\n      wcscat(cmdLine, cmdLineParams);\r\n      memset(&si, 0, sizeof(si));\r\n      si.cb = sizeof(si);\r\n      if (CreateProcessW(NULL, cmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi) == 0)\r\n        res = SZ_ERROR_FAIL;\r\n      else\r\n      {\r\n        CloseHandle(pi.hThread);\r\n        hProcess = pi.hProcess;\r\n      }\r\n    }\r\n    if (hProcess != 0)\r\n    {\r\n      WaitForSingleObject(hProcess, INFINITE);\r\n      CloseHandle(hProcess);\r\n    }\r\n  }\r\n\r\n  path[pathLen] = L'\\0';\r\n  RemoveDirWithSubItems(path);\r\n\r\n  if (res == SZ_OK)\r\n    return 0;\r\n  \r\n  {\r\n    if (res == SZ_ERROR_UNSUPPORTED)\r\n      errorMessage = \"Decoder doesn't support this archive\";\r\n    else if (res == SZ_ERROR_MEM)\r\n      errorMessage = \"Can't allocate required memory\";\r\n    else if (res == SZ_ERROR_CRC)\r\n      errorMessage = \"CRC error\";\r\n    else\r\n    {\r\n      if (!errorMessage)\r\n        errorMessage = \"ERROR\";\r\n    }\r\n    if (errorMessage)\r\n      PrintErrorMessage(errorMessage);\r\n  }\r\n  return 1;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/Util/SfxSetup/SfxSetup.dsp",
    "content": "# Microsoft Developer Studio Project File - Name=\"SfxSetup\" - Package Owner=<4>\r\n# Microsoft Developer Studio Generated Build File, Format Version 6.00\r\n# ** DO NOT EDIT **\r\n\r\n# TARGTYPE \"Win32 (x86) Application\" 0x0101\r\n\r\nCFG=SfxSetup - Win32 Debug\r\n!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r\n!MESSAGE use the Export Makefile command and run\r\n!MESSAGE \r\n!MESSAGE NMAKE /f \"SfxSetup.mak\".\r\n!MESSAGE \r\n!MESSAGE You can specify a configuration when running NMAKE\r\n!MESSAGE by defining the macro CFG on the command line. For example:\r\n!MESSAGE \r\n!MESSAGE NMAKE /f \"SfxSetup.mak\" CFG=\"SfxSetup - Win32 Debug\"\r\n!MESSAGE \r\n!MESSAGE Possible choices for configuration are:\r\n!MESSAGE \r\n!MESSAGE \"SfxSetup - Win32 Release\" (based on \"Win32 (x86) Application\")\r\n!MESSAGE \"SfxSetup - Win32 Debug\" (based on \"Win32 (x86) Application\")\r\n!MESSAGE \r\n\r\n# Begin Project\r\n# PROP AllowPerConfigDependencies 0\r\n# PROP Scc_ProjName \"\"\r\n# PROP Scc_LocalPath \"\"\r\nCPP=cl.exe\r\nMTL=midl.exe\r\nRSC=rc.exe\r\n\r\n!IF  \"$(CFG)\" == \"SfxSetup - Win32 Release\"\r\n\r\n# PROP BASE Use_MFC 0\r\n# PROP BASE Use_Debug_Libraries 0\r\n# PROP BASE Output_Dir \"Release\"\r\n# PROP BASE Intermediate_Dir \"Release\"\r\n# PROP BASE Target_Dir \"\"\r\n# PROP Use_MFC 0\r\n# PROP Use_Debug_Libraries 0\r\n# PROP Output_Dir \"Release\"\r\n# PROP Intermediate_Dir \"Release\"\r\n# PROP Target_Dir \"\"\r\n# ADD BASE CPP /nologo /W3 /GX /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_WINDOWS\" /D \"_MBCS\" /YX /FD /c\r\n# ADD CPP /nologo /W3 /GX /O2 /D \"NDEBUG\" /D \"WIN32\" /D \"_WINDOWS\" /D \"_UNICODE\" /D \"UNICODE\" /YX /FD /c\r\n# ADD BASE MTL /nologo /D \"NDEBUG\" /mktyplib203 /win32\r\n# ADD MTL /nologo /D \"NDEBUG\" /mktyplib203 /win32\r\n# ADD BASE RSC /l 0x419 /d \"NDEBUG\"\r\n# ADD RSC /l 0x419 /d \"NDEBUG\"\r\nBSC32=bscmake.exe\r\n# ADD BASE BSC32 /nologo\r\n# ADD BSC32 /nologo\r\nLINK32=link.exe\r\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386\r\n# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386\r\n\r\n!ELSEIF  \"$(CFG)\" == \"SfxSetup - Win32 Debug\"\r\n\r\n# PROP BASE Use_MFC 0\r\n# PROP BASE Use_Debug_Libraries 1\r\n# PROP BASE Output_Dir \"Debug\"\r\n# PROP BASE Intermediate_Dir \"Debug\"\r\n# PROP BASE Target_Dir \"\"\r\n# PROP Use_MFC 0\r\n# PROP Use_Debug_Libraries 1\r\n# PROP Output_Dir \"Debug\"\r\n# PROP Intermediate_Dir \"Debug\"\r\n# PROP Ignore_Export_Lib 0\r\n# PROP Target_Dir \"\"\r\n# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\" /D \"_MBCS\" /YX /FD /GZ /c\r\n# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D \"_DEBUG\" /D \"WIN32\" /D \"_WINDOWS\" /D \"_UNICODE\" /D \"UNICODE\" /YX /FD /GZ /c\r\n# ADD BASE MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32\r\n# ADD MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32\r\n# ADD BASE RSC /l 0x419 /d \"_DEBUG\"\r\n# ADD RSC /l 0x419 /d \"_DEBUG\"\r\nBSC32=bscmake.exe\r\n# ADD BASE BSC32 /nologo\r\n# ADD BSC32 /nologo\r\nLINK32=link.exe\r\n# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept\r\n# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept\r\n\r\n!ENDIF \r\n\r\n# Begin Target\r\n\r\n# Name \"SfxSetup - Win32 Release\"\r\n# Name \"SfxSetup - Win32 Debug\"\r\n# Begin Group \"Common\"\r\n\r\n# PROP Default_Filter \"\"\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7z.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zAlloc.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zAlloc.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zBuf.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zBuf.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zCrc.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zCrc.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zCrcOpt.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zDec.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zFile.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zFile.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zIn.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\7zStream.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Bcj2.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Bcj2.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Bra.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Bra.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Bra86.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\CpuArch.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\CpuArch.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Lzma2Dec.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Lzma2Dec.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzmaDec.c\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\LzmaDec.h\r\n# End Source File\r\n# Begin Source File\r\n\r\nSOURCE=..\\..\\Types.h\r\n# End Source File\r\n# End Group\r\n# Begin Source File\r\n\r\nSOURCE=.\\SfxSetup.c\r\n# End Source File\r\n# End Target\r\n# End Project\r\n"
  },
  {
    "path": "ext/lzma/C/Util/SfxSetup/SfxSetup.dsw",
    "content": "Microsoft Developer Studio Workspace File, Format Version 6.00\r\n# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\r\n\r\n###############################################################################\r\n\r\nProject: \"SfxSetup\"=.\\SfxSetup.dsp - Package Owner=<4>\r\n\r\nPackage=<5>\r\n{{{\r\n}}}\r\n\r\nPackage=<4>\r\n{{{\r\n}}}\r\n\r\n###############################################################################\r\n\r\nGlobal:\r\n\r\nPackage=<5>\r\n{{{\r\n}}}\r\n\r\nPackage=<3>\r\n{{{\r\n}}}\r\n\r\n###############################################################################\r\n\r\n"
  },
  {
    "path": "ext/lzma/C/Util/SfxSetup/makefile",
    "content": "PROG = 7zS2.sfx\r\nLIBS = $(LIBS) \r\nCFLAGS = $(CFLAGS) -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_WARNINGS\r\n\r\nC_OBJS = \\\r\n  $O\\7zAlloc.obj \\\r\n  $O\\7zBuf.obj \\\r\n  $O\\7zBuf2.obj \\\r\n  $O\\7zCrc.obj \\\r\n  $O\\7zCrcOpt.obj \\\r\n  $O\\7zFile.obj \\\r\n  $O\\7zDec.obj \\\r\n  $O\\7zIn.obj \\\r\n  $O\\7zStream.obj \\\r\n  $O\\Bcj2.obj \\\r\n  $O\\Bra.obj \\\r\n  $O\\Bra86.obj \\\r\n  $O\\CpuArch.obj \\\r\n  $O\\Lzma2Dec.obj \\\r\n  $O\\LzmaDec.obj \\\r\n\r\n7Z_OBJS = \\\r\n  $O\\SfxSetup.obj \\\r\n\r\nOBJS = \\\r\n  $(7Z_OBJS) \\\r\n  $(C_OBJS) \\\r\n  $O\\resource.res\r\n\r\n!include \"../../../CPP/Build.mak\"\r\n\r\n$(7Z_OBJS): $(*B).c\r\n\t$(COMPL_O1)\r\n$(C_OBJS): ../../$(*B).c\r\n\t$(COMPL_O1)\r\n"
  },
  {
    "path": "ext/lzma/C/Util/SfxSetup/makefile_con",
    "content": "PROG = 7zS2con.sfx\r\nLIBS = $(LIBS) \r\nCFLAGS = $(CFLAGS) -DUNICODE -D_UNICODE -D_CONSOLE\r\n\r\nC_OBJS = \\\r\n  $O\\7zAlloc.obj \\\r\n  $O\\7zBuf.obj \\\r\n  $O\\7zBuf2.obj \\\r\n  $O\\7zCrc.obj \\\r\n  $O\\7zCrcOpt.obj \\\r\n  $O\\7zFile.obj \\\r\n  $O\\7zDec.obj \\\r\n  $O\\7zIn.obj \\\r\n  $O\\7zStream.obj \\\r\n  $O\\Bcj2.obj \\\r\n  $O\\Bra.obj \\\r\n  $O\\Bra86.obj \\\r\n  $O\\CpuArch.obj \\\r\n  $O\\Lzma2Dec.obj \\\r\n  $O\\LzmaDec.obj \\\r\n\r\n7Z_OBJS = \\\r\n  $O\\SfxSetup.obj \\\r\n\r\nOBJS = \\\r\n  $(7Z_OBJS) \\\r\n  $(C_OBJS) \\\r\n  $O\\resource.res\r\n\r\n!include \"../../../CPP/Build.mak\"\r\n\r\n$(7Z_OBJS): $(*B).c\r\n\t$(COMPL_O1)\r\n$(C_OBJS): ../../$(*B).c\r\n\t$(COMPL_O1)\r\n"
  },
  {
    "path": "ext/lzma/C/Util/SfxSetup/resource.rc",
    "content": "#include \"../../7zVersion.rc\"\r\n\r\nMY_VERSION_INFO_APP(\"7z Setup SFX small\", \"7zS2.sfx\")\r\n\r\n1  ICON \"setup.ico\"\r\n"
  },
  {
    "path": "ext/lzma/C/Xz.c",
    "content": "/* Xz.c - Xz\r\n2009-04-15 : Igor Pavlov : Public domain */\r\n\r\n#include \"7zCrc.h\"\r\n#include \"CpuArch.h\"\r\n#include \"Xz.h\"\r\n#include \"XzCrc64.h\"\r\n\r\nByte XZ_SIG[XZ_SIG_SIZE] = { 0xFD, '7', 'z', 'X', 'Z', 0 };\r\nByte XZ_FOOTER_SIG[XZ_FOOTER_SIG_SIZE] = { 'Y', 'Z' };\r\n\r\nunsigned Xz_WriteVarInt(Byte *buf, UInt64 v)\r\n{\r\n  unsigned i = 0;\r\n  do\r\n  {\r\n    buf[i++] = (Byte)((v & 0x7F) | 0x80);\r\n    v >>= 7;\r\n  }\r\n  while (v != 0);\r\n  buf[i - 1] &= 0x7F;\r\n  return i;\r\n}\r\n\r\nvoid Xz_Construct(CXzStream *p)\r\n{\r\n  p->numBlocks = p->numBlocksAllocated = 0;\r\n  p->blocks = 0;\r\n  p->flags = 0;\r\n}\r\n\r\nvoid Xz_Free(CXzStream *p, ISzAlloc *alloc)\r\n{\r\n  alloc->Free(alloc, p->blocks);\r\n  p->numBlocks = p->numBlocksAllocated = 0;\r\n  p->blocks = 0;\r\n}\r\n\r\nunsigned XzFlags_GetCheckSize(CXzStreamFlags f)\r\n{\r\n  int t = XzFlags_GetCheckType(f);\r\n  return (t == 0) ? 0 : (4 << ((t - 1) / 3));\r\n}\r\n\r\nvoid XzCheck_Init(CXzCheck *p, int mode)\r\n{\r\n  p->mode = mode;\r\n  switch (mode)\r\n  {\r\n    case XZ_CHECK_CRC32: p->crc = CRC_INIT_VAL; break;\r\n    case XZ_CHECK_CRC64: p->crc64 = CRC64_INIT_VAL; break;\r\n    case XZ_CHECK_SHA256: Sha256_Init(&p->sha); break;\r\n  }\r\n}\r\n\r\nvoid XzCheck_Update(CXzCheck *p, const void *data, size_t size)\r\n{\r\n  switch (p->mode)\r\n  {\r\n    case XZ_CHECK_CRC32: p->crc = CrcUpdate(p->crc, data, size); break;\r\n    case XZ_CHECK_CRC64: p->crc64 = Crc64Update(p->crc64, data, size); break;\r\n    case XZ_CHECK_SHA256: Sha256_Update(&p->sha, (const Byte *)data, size); break;\r\n  }\r\n}\r\n\r\nint XzCheck_Final(CXzCheck *p, Byte *digest)\r\n{\r\n  switch (p->mode)\r\n  {\r\n    case XZ_CHECK_CRC32:\r\n      SetUi32(digest, CRC_GET_DIGEST(p->crc));\r\n      break;\r\n    case XZ_CHECK_CRC64:\r\n    {\r\n      int i;\r\n      UInt64 v = CRC64_GET_DIGEST(p->crc64);\r\n      for (i = 0; i < 8; i++, v >>= 8)\r\n        digest[i] = (Byte)(v & 0xFF);\r\n      break;\r\n    }\r\n    case XZ_CHECK_SHA256:\r\n      Sha256_Final(&p->sha, digest);\r\n      break;\r\n    default:\r\n      return 0;\r\n  }\r\n  return 1;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/Xz.h",
    "content": "/* Xz.h - Xz interface\r\n2011-01-09 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __XZ_H\r\n#define __XZ_H\r\n\r\n#include \"Sha256.h\"\r\n\r\nEXTERN_C_BEGIN\r\n\r\n#define XZ_ID_Subblock 1\r\n#define XZ_ID_Delta 3\r\n#define XZ_ID_X86 4\r\n#define XZ_ID_PPC 5\r\n#define XZ_ID_IA64 6\r\n#define XZ_ID_ARM 7\r\n#define XZ_ID_ARMT 8\r\n#define XZ_ID_SPARC 9\r\n#define XZ_ID_LZMA2 0x21\r\n\r\nunsigned Xz_ReadVarInt(const Byte *p, size_t maxSize, UInt64 *value);\r\nunsigned Xz_WriteVarInt(Byte *buf, UInt64 v);\r\n\r\n/* ---------- xz block ---------- */\r\n\r\n#define XZ_BLOCK_HEADER_SIZE_MAX 1024\r\n\r\n#define XZ_NUM_FILTERS_MAX 4\r\n#define XZ_BF_NUM_FILTERS_MASK 3\r\n#define XZ_BF_PACK_SIZE (1 << 6)\r\n#define XZ_BF_UNPACK_SIZE (1 << 7)\r\n\r\n#define XZ_FILTER_PROPS_SIZE_MAX 20\r\n\r\ntypedef struct\r\n{\r\n  UInt64 id;\r\n  UInt32 propsSize;\r\n  Byte props[XZ_FILTER_PROPS_SIZE_MAX];\r\n} CXzFilter;\r\n\r\ntypedef struct\r\n{\r\n  UInt64 packSize;\r\n  UInt64 unpackSize;\r\n  Byte flags;\r\n  CXzFilter filters[XZ_NUM_FILTERS_MAX];\r\n} CXzBlock;\r\n\r\n#define XzBlock_GetNumFilters(p) (((p)->flags & XZ_BF_NUM_FILTERS_MASK) + 1)\r\n#define XzBlock_HasPackSize(p)   (((p)->flags & XZ_BF_PACK_SIZE) != 0)\r\n#define XzBlock_HasUnpackSize(p) (((p)->flags & XZ_BF_UNPACK_SIZE) != 0)\r\n\r\nSRes XzBlock_Parse(CXzBlock *p, const Byte *header);\r\nSRes XzBlock_ReadHeader(CXzBlock *p, ISeqInStream *inStream, Bool *isIndex, UInt32 *headerSizeRes);\r\n\r\n/* ---------- xz stream ---------- */\r\n\r\n#define XZ_SIG_SIZE 6\r\n#define XZ_FOOTER_SIG_SIZE 2\r\n\r\nextern Byte XZ_SIG[XZ_SIG_SIZE];\r\nextern Byte XZ_FOOTER_SIG[XZ_FOOTER_SIG_SIZE];\r\n\r\n#define XZ_STREAM_FLAGS_SIZE 2\r\n#define XZ_STREAM_CRC_SIZE 4\r\n\r\n#define XZ_STREAM_HEADER_SIZE (XZ_SIG_SIZE + XZ_STREAM_FLAGS_SIZE + XZ_STREAM_CRC_SIZE)\r\n#define XZ_STREAM_FOOTER_SIZE (XZ_FOOTER_SIG_SIZE + XZ_STREAM_FLAGS_SIZE + XZ_STREAM_CRC_SIZE + 4)\r\n\r\n#define XZ_CHECK_MASK 0xF\r\n#define XZ_CHECK_NO 0\r\n#define XZ_CHECK_CRC32 1\r\n#define XZ_CHECK_CRC64 4\r\n#define XZ_CHECK_SHA256 10\r\n\r\ntypedef struct\r\n{\r\n  int mode;\r\n  UInt32 crc;\r\n  UInt64 crc64;\r\n  CSha256 sha;\r\n} CXzCheck;\r\n\r\nvoid XzCheck_Init(CXzCheck *p, int mode);\r\nvoid XzCheck_Update(CXzCheck *p, const void *data, size_t size);\r\nint XzCheck_Final(CXzCheck *p, Byte *digest);\r\n\r\ntypedef UInt16 CXzStreamFlags;\r\n\r\n#define XzFlags_IsSupported(f) ((f) <= XZ_CHECK_MASK)\r\n#define XzFlags_GetCheckType(f) ((f) & XZ_CHECK_MASK)\r\n#define XzFlags_HasDataCrc32(f) (Xz_GetCheckType(f) == XZ_CHECK_CRC32)\r\nunsigned XzFlags_GetCheckSize(CXzStreamFlags f);\r\n\r\nSRes Xz_ParseHeader(CXzStreamFlags *p, const Byte *buf);\r\nSRes Xz_ReadHeader(CXzStreamFlags *p, ISeqInStream *inStream);\r\n\r\ntypedef struct\r\n{\r\n  UInt64 unpackSize;\r\n  UInt64 totalSize;\r\n} CXzBlockSizes;\r\n\r\ntypedef struct\r\n{\r\n  CXzStreamFlags flags;\r\n  size_t numBlocks;\r\n  size_t numBlocksAllocated;\r\n  CXzBlockSizes *blocks;\r\n  UInt64 startOffset;\r\n} CXzStream;\r\n\r\nvoid Xz_Construct(CXzStream *p);\r\nvoid Xz_Free(CXzStream *p, ISzAlloc *alloc);\r\n\r\n#define XZ_SIZE_OVERFLOW ((UInt64)(Int64)-1)\r\n\r\nUInt64 Xz_GetUnpackSize(const CXzStream *p);\r\nUInt64 Xz_GetPackSize(const CXzStream *p);\r\n\r\ntypedef struct\r\n{\r\n  size_t num;\r\n  size_t numAllocated;\r\n  CXzStream *streams;\r\n} CXzs;\r\n\r\nvoid Xzs_Construct(CXzs *p);\r\nvoid Xzs_Free(CXzs *p, ISzAlloc *alloc);\r\nSRes Xzs_ReadBackward(CXzs *p, ILookInStream *inStream, Int64 *startOffset, ICompressProgress *progress, ISzAlloc *alloc);\r\n\r\nUInt64 Xzs_GetNumBlocks(const CXzs *p);\r\nUInt64 Xzs_GetUnpackSize(const CXzs *p);\r\n\r\ntypedef enum\r\n{\r\n  CODER_STATUS_NOT_SPECIFIED,               /* use main error code instead */\r\n  CODER_STATUS_FINISHED_WITH_MARK,          /* stream was finished with end mark. */\r\n  CODER_STATUS_NOT_FINISHED,                /* stream was not finished */\r\n  CODER_STATUS_NEEDS_MORE_INPUT             /* you must provide more input bytes */\r\n} ECoderStatus;\r\n\r\ntypedef enum\r\n{\r\n  CODER_FINISH_ANY,   /* finish at any point */\r\n  CODER_FINISH_END    /* block must be finished at the end */\r\n} ECoderFinishMode;\r\n\r\ntypedef struct _IStateCoder\r\n{\r\n  void *p;\r\n  void (*Free)(void *p, ISzAlloc *alloc);\r\n  SRes (*SetProps)(void *p, const Byte *props, size_t propSize, ISzAlloc *alloc);\r\n  void (*Init)(void *p);\r\n  SRes (*Code)(void *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,\r\n      int srcWasFinished, ECoderFinishMode finishMode, int *wasFinished);\r\n} IStateCoder;\r\n\r\n#define MIXCODER_NUM_FILTERS_MAX 4\r\n\r\ntypedef struct\r\n{\r\n  ISzAlloc *alloc;\r\n  Byte *buf;\r\n  int numCoders;\r\n  int finished[MIXCODER_NUM_FILTERS_MAX - 1];\r\n  size_t pos[MIXCODER_NUM_FILTERS_MAX - 1];\r\n  size_t size[MIXCODER_NUM_FILTERS_MAX - 1];\r\n  UInt64 ids[MIXCODER_NUM_FILTERS_MAX];\r\n  IStateCoder coders[MIXCODER_NUM_FILTERS_MAX];\r\n} CMixCoder;\r\n\r\nvoid MixCoder_Construct(CMixCoder *p, ISzAlloc *alloc);\r\nvoid MixCoder_Free(CMixCoder *p);\r\nvoid MixCoder_Init(CMixCoder *p);\r\nSRes MixCoder_SetFromMethod(CMixCoder *p, int coderIndex, UInt64 methodId);\r\nSRes MixCoder_Code(CMixCoder *p, Byte *dest, SizeT *destLen,\r\n    const Byte *src, SizeT *srcLen, int srcWasFinished,\r\n    ECoderFinishMode finishMode, ECoderStatus *status);\r\n\r\ntypedef enum\r\n{\r\n  XZ_STATE_STREAM_HEADER,\r\n  XZ_STATE_STREAM_INDEX,\r\n  XZ_STATE_STREAM_INDEX_CRC,\r\n  XZ_STATE_STREAM_FOOTER,\r\n  XZ_STATE_STREAM_PADDING,\r\n  XZ_STATE_BLOCK_HEADER,\r\n  XZ_STATE_BLOCK,\r\n  XZ_STATE_BLOCK_FOOTER\r\n} EXzState;\r\n\r\ntypedef struct\r\n{\r\n  EXzState state;\r\n  UInt32 pos;\r\n  unsigned alignPos;\r\n  unsigned indexPreSize;\r\n\r\n  CXzStreamFlags streamFlags;\r\n  \r\n  UInt32 blockHeaderSize;\r\n  UInt64 packSize;\r\n  UInt64 unpackSize;\r\n\r\n  UInt64 numBlocks;\r\n  UInt64 indexSize;\r\n  UInt64 indexPos;\r\n  UInt64 padSize;\r\n\r\n  UInt64 numStreams;\r\n\r\n  UInt32 crc;\r\n  CMixCoder decoder;\r\n  CXzBlock block;\r\n  CXzCheck check;\r\n  CSha256 sha;\r\n  Byte shaDigest[SHA256_DIGEST_SIZE];\r\n  Byte buf[XZ_BLOCK_HEADER_SIZE_MAX];\r\n} CXzUnpacker;\r\n\r\nvoid XzUnpacker_Construct(CXzUnpacker *p, ISzAlloc *alloc);\r\nvoid XzUnpacker_Init(CXzUnpacker *p);\r\nvoid XzUnpacker_Free(CXzUnpacker *p);\r\n\r\n/*\r\nfinishMode:\r\n  It has meaning only if the decoding reaches output limit (*destLen).\r\n  LZMA_FINISH_ANY - use smallest number of input bytes\r\n  LZMA_FINISH_END - read EndOfStream marker after decoding\r\n\r\nReturns:\r\n  SZ_OK\r\n    status:\r\n      CODER_STATUS_NOT_FINISHED,\r\n      CODER_STATUS_NEEDS_MORE_INPUT - maybe there are more xz streams,\r\n                                      call XzUnpacker_IsStreamWasFinished to check that current stream was finished\r\n  SZ_ERROR_DATA - Data error\r\n  SZ_ERROR_MEM  - Memory allocation error\r\n  SZ_ERROR_UNSUPPORTED - Unsupported properties\r\n  SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).\r\n*/\r\n\r\n\r\nSRes XzUnpacker_Code(CXzUnpacker *p, Byte *dest, SizeT *destLen,\r\n    const Byte *src, SizeT *srcLen, /* int srcWasFinished, */ int finishMode,\r\n    ECoderStatus *status);\r\n\r\nBool XzUnpacker_IsStreamWasFinished(CXzUnpacker *p);\r\n\r\nEXTERN_C_END\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/XzCrc64.c",
    "content": "/* XzCrc64.c -- CRC64 calculation\r\n2010-04-16 : Igor Pavlov : Public domain */\r\n\r\n#include \"XzCrc64.h\"\r\n\r\n#define kCrc64Poly UINT64_CONST(0xC96C5795D7870F42)\r\nUInt64 g_Crc64Table[256];\r\n\r\nvoid MY_FAST_CALL Crc64GenerateTable(void)\r\n{\r\n  UInt32 i;\r\n  for (i = 0; i < 256; i++)\r\n  {\r\n    UInt64 r = i;\r\n    int j;\r\n    for (j = 0; j < 8; j++)\r\n      r = (r >> 1) ^ ((UInt64)kCrc64Poly & ~((r & 1) - 1));\r\n    g_Crc64Table[i] = r;\r\n  }\r\n}\r\n\r\nUInt64 MY_FAST_CALL Crc64Update(UInt64 v, const void *data, size_t size)\r\n{\r\n  const Byte *p = (const Byte *)data;\r\n  for (; size > 0 ; size--, p++)\r\n    v = CRC64_UPDATE_BYTE(v, *p);\r\n  return v;\r\n}\r\n\r\nUInt64 MY_FAST_CALL Crc64Calc(const void *data, size_t size)\r\n{\r\n  return CRC64_GET_DIGEST(Crc64Update(CRC64_INIT_VAL, data, size));\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/XzCrc64.h",
    "content": "/* XzCrc64.h -- CRC64 calculation\r\n2010-04-16 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __XZ_CRC64_H\r\n#define __XZ_CRC64_H\r\n\r\n#include <stddef.h>\r\n\r\n#include \"Types.h\"\r\n\r\nEXTERN_C_BEGIN\r\n\r\nextern UInt64 g_Crc64Table[];\r\n\r\nvoid MY_FAST_CALL Crc64GenerateTable(void);\r\n\r\n#define CRC64_INIT_VAL UINT64_CONST(0xFFFFFFFFFFFFFFFF)\r\n#define CRC64_GET_DIGEST(crc) ((crc) ^ CRC64_INIT_VAL)\r\n#define CRC64_UPDATE_BYTE(crc, b) (g_Crc64Table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))\r\n\r\nUInt64 MY_FAST_CALL Crc64Update(UInt64 crc, const void *data, size_t size);\r\nUInt64 MY_FAST_CALL Crc64Calc(const void *data, size_t size);\r\n\r\nEXTERN_C_END\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/XzDec.c",
    "content": "/* XzDec.c -- Xz Decode\r\n2011-02-07 : Igor Pavlov : Public domain */\r\n\r\n/* #define XZ_DUMP */\r\n\r\n#ifdef XZ_DUMP\r\n#include <stdio.h>\r\n#endif\r\n\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"7zCrc.h\"\r\n#include \"Alloc.h\"\r\n#include \"Bra.h\"\r\n#include \"CpuArch.h\"\r\n#include \"Delta.h\"\r\n#include \"Lzma2Dec.h\"\r\n\r\n#ifdef USE_SUBBLOCK\r\n#include \"Bcj3Dec.c\"\r\n#include \"SbDec.c\"\r\n#endif\r\n\r\n#include \"Xz.h\"\r\n\r\n#define XZ_CHECK_SIZE_MAX 64\r\n\r\n#define CODER_BUF_SIZE (1 << 17)\r\n\r\nunsigned Xz_ReadVarInt(const Byte *p, size_t maxSize, UInt64 *value)\r\n{\r\n  int i, limit;\r\n  *value = 0;\r\n  limit = (maxSize > 9) ? 9 : (int)maxSize;\r\n\r\n  for (i = 0; i < limit;)\r\n  {\r\n    Byte b = p[i];\r\n    *value |= (UInt64)(b & 0x7F) << (7 * i++);\r\n    if ((b & 0x80) == 0)\r\n      return (b == 0 && i != 1) ? 0 : i;\r\n  }\r\n  return 0;\r\n}\r\n\r\n/* ---------- BraState ---------- */\r\n\r\n#define BRA_BUF_SIZE (1 << 14)\r\n\r\ntypedef struct\r\n{\r\n  size_t bufPos;\r\n  size_t bufConv;\r\n  size_t bufTotal;\r\n\r\n  UInt32 methodId;\r\n  int encodeMode;\r\n  UInt32 delta;\r\n  UInt32 ip;\r\n  UInt32 x86State;\r\n  Byte deltaState[DELTA_STATE_SIZE];\r\n\r\n  Byte buf[BRA_BUF_SIZE];\r\n} CBraState;\r\n\r\nvoid BraState_Free(void *pp, ISzAlloc *alloc)\r\n{\r\n  alloc->Free(alloc, pp);\r\n}\r\n\r\nSRes BraState_SetProps(void *pp, const Byte *props, size_t propSize, ISzAlloc *alloc)\r\n{\r\n  CBraState *p = ((CBraState *)pp);\r\n  alloc = alloc;\r\n  p->ip = 0;\r\n  if (p->methodId == XZ_ID_Delta)\r\n  {\r\n    if (propSize != 1)\r\n      return SZ_ERROR_UNSUPPORTED;\r\n    p->delta = (unsigned)props[0] + 1;\r\n  }\r\n  else\r\n  {\r\n    if (propSize == 4)\r\n    {\r\n      UInt32 v = GetUi32(props);\r\n      switch(p->methodId)\r\n      {\r\n        case XZ_ID_PPC:\r\n        case XZ_ID_ARM:\r\n        case XZ_ID_SPARC:\r\n          if ((v & 3) != 0)\r\n            return SZ_ERROR_UNSUPPORTED;\r\n          break;\r\n        case XZ_ID_ARMT:\r\n          if ((v & 1) != 0)\r\n            return SZ_ERROR_UNSUPPORTED;\r\n          break;\r\n        case XZ_ID_IA64:\r\n          if ((v & 0xF) != 0)\r\n            return SZ_ERROR_UNSUPPORTED;\r\n          break;\r\n      }\r\n      p->ip = v;\r\n    }\r\n    else if (propSize != 0)\r\n      return SZ_ERROR_UNSUPPORTED;\r\n  }\r\n  return SZ_OK;\r\n}\r\n\r\nvoid BraState_Init(void *pp)\r\n{\r\n  CBraState *p = ((CBraState *)pp);\r\n  p->bufPos = p->bufConv = p->bufTotal = 0;\r\n  x86_Convert_Init(p->x86State);\r\n  if (p->methodId == XZ_ID_Delta)\r\n    Delta_Init(p->deltaState);\r\n}\r\n\r\n#define CASE_BRA_CONV(isa) case XZ_ID_ ## isa: p->bufConv = isa ## _Convert(p->buf, p->bufTotal, p->ip, p->encodeMode); break;\r\n\r\nstatic SRes BraState_Code(void *pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,\r\n    int srcWasFinished, ECoderFinishMode finishMode, int *wasFinished)\r\n{\r\n  CBraState *p = ((CBraState *)pp);\r\n  SizeT destLenOrig = *destLen;\r\n  SizeT srcLenOrig = *srcLen;\r\n  *destLen = 0;\r\n  *srcLen = 0;\r\n  finishMode = finishMode;\r\n  *wasFinished = 0;\r\n  while (destLenOrig > 0)\r\n  {\r\n    if (p->bufPos != p->bufConv)\r\n    {\r\n      size_t curSize = p->bufConv - p->bufPos;\r\n      if (curSize > destLenOrig)\r\n        curSize = destLenOrig;\r\n      memcpy(dest, p->buf + p->bufPos, curSize);\r\n      p->bufPos += curSize;\r\n      *destLen += curSize;\r\n      dest += curSize;\r\n      destLenOrig -= curSize;\r\n      continue;\r\n    }\r\n    p->bufTotal -= p->bufPos;\r\n    memmove(p->buf, p->buf + p->bufPos, p->bufTotal);\r\n    p->bufPos = 0;\r\n    p->bufConv = 0;\r\n    {\r\n      size_t curSize = BRA_BUF_SIZE - p->bufTotal;\r\n      if (curSize > srcLenOrig)\r\n        curSize = srcLenOrig;\r\n      memcpy(p->buf + p->bufTotal, src, curSize);\r\n      *srcLen += curSize;\r\n      src += curSize;\r\n      srcLenOrig -= curSize;\r\n      p->bufTotal += curSize;\r\n    }\r\n    if (p->bufTotal == 0)\r\n      break;\r\n    switch(p->methodId)\r\n    {\r\n      case XZ_ID_Delta:\r\n        if (p->encodeMode)\r\n          Delta_Encode(p->deltaState, p->delta, p->buf, p->bufTotal);\r\n        else\r\n          Delta_Decode(p->deltaState, p->delta, p->buf, p->bufTotal);\r\n        p->bufConv = p->bufTotal;\r\n        break;\r\n      case XZ_ID_X86:\r\n        p->bufConv = x86_Convert(p->buf, p->bufTotal, p->ip, &p->x86State, p->encodeMode);\r\n        break;\r\n      CASE_BRA_CONV(PPC)\r\n      CASE_BRA_CONV(IA64)\r\n      CASE_BRA_CONV(ARM)\r\n      CASE_BRA_CONV(ARMT)\r\n      CASE_BRA_CONV(SPARC)\r\n      default:\r\n        return SZ_ERROR_UNSUPPORTED;\r\n    }\r\n    p->ip += (UInt32)p->bufConv;\r\n\r\n    if (p->bufConv == 0)\r\n    {\r\n      if (!srcWasFinished)\r\n        break;\r\n      p->bufConv = p->bufTotal;\r\n    }\r\n  }\r\n  if (p->bufTotal == p->bufPos && srcLenOrig == 0 && srcWasFinished)\r\n    *wasFinished = 1;\r\n  return SZ_OK;\r\n}\r\n\r\nSRes BraState_SetFromMethod(IStateCoder *p, UInt64 id, int encodeMode, ISzAlloc *alloc)\r\n{\r\n  CBraState *decoder;\r\n  if (id != XZ_ID_Delta &&\r\n      id != XZ_ID_X86 &&\r\n      id != XZ_ID_PPC &&\r\n      id != XZ_ID_IA64 &&\r\n      id != XZ_ID_ARM &&\r\n      id != XZ_ID_ARMT &&\r\n      id != XZ_ID_SPARC)\r\n    return SZ_ERROR_UNSUPPORTED;\r\n  p->p = 0;\r\n  decoder = alloc->Alloc(alloc, sizeof(CBraState));\r\n  if (decoder == 0)\r\n    return SZ_ERROR_MEM;\r\n  decoder->methodId = (UInt32)id;\r\n  decoder->encodeMode = encodeMode;\r\n  p->p = decoder;\r\n  p->Free = BraState_Free;\r\n  p->SetProps = BraState_SetProps;\r\n  p->Init = BraState_Init;\r\n  p->Code = BraState_Code;\r\n  return SZ_OK;\r\n}\r\n\r\n/* ---------- SbState ---------- */\r\n\r\n#ifdef USE_SUBBLOCK\r\n\r\nstatic void SbState_Free(void *pp, ISzAlloc *alloc)\r\n{\r\n  CSbDec *p = (CSbDec *)pp;\r\n  SbDec_Free(p);\r\n  alloc->Free(alloc, pp);\r\n}\r\n\r\nstatic SRes SbState_SetProps(void *pp, const Byte *props, size_t propSize, ISzAlloc *alloc)\r\n{\r\n  pp = pp;\r\n  props = props;\r\n  alloc = alloc;\r\n  return (propSize == 0) ? SZ_OK : SZ_ERROR_UNSUPPORTED;\r\n}\r\n\r\nstatic void SbState_Init(void *pp)\r\n{\r\n  SbDec_Init((CSbDec *)pp);\r\n}\r\n\r\nstatic SRes SbState_Code(void *pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,\r\n    int srcWasFinished, ECoderFinishMode finishMode, int *wasFinished)\r\n{\r\n  CSbDec *p = (CSbDec *)pp;\r\n  SRes res;\r\n  srcWasFinished = srcWasFinished;\r\n  p->dest = dest;\r\n  p->destLen = *destLen;\r\n  p->src = src;\r\n  p->srcLen = *srcLen;\r\n  p->finish = finishMode; /* change it */\r\n  res = SbDec_Decode((CSbDec *)pp);\r\n  *destLen -= p->destLen;\r\n  *srcLen -= p->srcLen;\r\n  *wasFinished = (*destLen == 0 && *srcLen == 0); /* change it */\r\n  return res;\r\n}\r\n\r\nSRes SbState_SetFromMethod(IStateCoder *p, ISzAlloc *alloc)\r\n{\r\n  CSbDec *decoder;\r\n  p->p = 0;\r\n  decoder = alloc->Alloc(alloc, sizeof(CSbDec));\r\n  if (decoder == 0)\r\n    return SZ_ERROR_MEM;\r\n  p->p = decoder;\r\n  p->Free = SbState_Free;\r\n  p->SetProps = SbState_SetProps;\r\n  p->Init = SbState_Init;\r\n  p->Code = SbState_Code;\r\n  SbDec_Construct(decoder);\r\n  SbDec_SetAlloc(decoder, alloc);\r\n  return SZ_OK;\r\n}\r\n#endif\r\n\r\n/* ---------- Lzma2State ---------- */\r\n\r\nstatic void Lzma2State_Free(void *pp, ISzAlloc *alloc)\r\n{\r\n  Lzma2Dec_Free((CLzma2Dec *)pp, alloc);\r\n  alloc->Free(alloc, pp);\r\n}\r\n\r\nstatic SRes Lzma2State_SetProps(void *pp, const Byte *props, size_t propSize, ISzAlloc *alloc)\r\n{\r\n  if (propSize != 1)\r\n    return SZ_ERROR_UNSUPPORTED;\r\n  return Lzma2Dec_Allocate((CLzma2Dec *)pp, props[0], alloc);\r\n}\r\n\r\nstatic void Lzma2State_Init(void *pp)\r\n{\r\n  Lzma2Dec_Init((CLzma2Dec *)pp);\r\n}\r\n\r\nstatic SRes Lzma2State_Code(void *pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,\r\n    int srcWasFinished, ECoderFinishMode finishMode, int *wasFinished)\r\n{\r\n  ELzmaStatus status;\r\n  /* ELzmaFinishMode fm = (finishMode == LZMA_FINISH_ANY) ? LZMA_FINISH_ANY : LZMA_FINISH_END; */\r\n  SRes res = Lzma2Dec_DecodeToBuf((CLzma2Dec *)pp, dest, destLen, src, srcLen, finishMode, &status);\r\n  srcWasFinished = srcWasFinished;\r\n  *wasFinished = (status == LZMA_STATUS_FINISHED_WITH_MARK);\r\n  return res;\r\n}\r\n\r\nstatic SRes Lzma2State_SetFromMethod(IStateCoder *p, ISzAlloc *alloc)\r\n{\r\n  CLzma2Dec *decoder = alloc->Alloc(alloc, sizeof(CLzma2Dec));\r\n  p->p = decoder;\r\n  if (decoder == 0)\r\n    return SZ_ERROR_MEM;\r\n  p->Free = Lzma2State_Free;\r\n  p->SetProps = Lzma2State_SetProps;\r\n  p->Init = Lzma2State_Init;\r\n  p->Code = Lzma2State_Code;\r\n  Lzma2Dec_Construct(decoder);\r\n  return SZ_OK;\r\n}\r\n\r\n\r\nvoid MixCoder_Construct(CMixCoder *p, ISzAlloc *alloc)\r\n{\r\n  int i;\r\n  p->alloc = alloc;\r\n  p->buf = 0;\r\n  p->numCoders = 0;\r\n  for (i = 0; i < MIXCODER_NUM_FILTERS_MAX; i++)\r\n    p->coders[i].p = NULL;\r\n}\r\n\r\nvoid MixCoder_Free(CMixCoder *p)\r\n{\r\n  int i;\r\n  for (i = 0; i < p->numCoders; i++)\r\n  {\r\n    IStateCoder *sc = &p->coders[i];\r\n    if (p->alloc && sc->p)\r\n      sc->Free(sc->p, p->alloc);\r\n  }\r\n  p->numCoders = 0;\r\n  if (p->buf)\r\n    p->alloc->Free(p->alloc, p->buf);\r\n}\r\n\r\nvoid MixCoder_Init(CMixCoder *p)\r\n{\r\n  int i;\r\n  for (i = 0; i < p->numCoders - 1; i++)\r\n  {\r\n    p->size[i] = 0;\r\n    p->pos[i] = 0;\r\n    p->finished[i] = 0;\r\n  }\r\n  for (i = 0; i < p->numCoders; i++)\r\n  {\r\n    IStateCoder *coder = &p->coders[i];\r\n    coder->Init(coder->p);\r\n  }\r\n}\r\n\r\nSRes MixCoder_SetFromMethod(CMixCoder *p, int coderIndex, UInt64 methodId)\r\n{\r\n  IStateCoder *sc = &p->coders[coderIndex];\r\n  p->ids[coderIndex] = methodId;\r\n  switch(methodId)\r\n  {\r\n    case XZ_ID_LZMA2: return Lzma2State_SetFromMethod(sc, p->alloc);\r\n    #ifdef USE_SUBBLOCK\r\n    case XZ_ID_Subblock: return SbState_SetFromMethod(sc, p->alloc);\r\n    #endif\r\n  }\r\n  if (coderIndex == 0)\r\n    return SZ_ERROR_UNSUPPORTED;\r\n  return BraState_SetFromMethod(sc, methodId, 0, p->alloc);\r\n}\r\n\r\nSRes MixCoder_Code(CMixCoder *p, Byte *dest, SizeT *destLen,\r\n    const Byte *src, SizeT *srcLen, int srcWasFinished,\r\n    ECoderFinishMode finishMode, ECoderStatus *status)\r\n{\r\n  SizeT destLenOrig = *destLen;\r\n  SizeT srcLenOrig = *srcLen;\r\n  Bool allFinished = True;\r\n  *destLen = 0;\r\n  *srcLen = 0;\r\n  *status = CODER_STATUS_NOT_FINISHED;\r\n\r\n  if (p->buf == 0)\r\n  {\r\n    p->buf = p->alloc->Alloc(p->alloc, CODER_BUF_SIZE * (MIXCODER_NUM_FILTERS_MAX - 1));\r\n    if (p->buf == 0)\r\n      return SZ_ERROR_MEM;\r\n  }\r\n\r\n  if (p->numCoders != 1)\r\n    finishMode = CODER_FINISH_ANY;\r\n\r\n  for (;;)\r\n  {\r\n    Bool processed = False;\r\n    int i;\r\n    /*\r\n    if (p->numCoders == 1 && *destLen == destLenOrig && finishMode == LZMA_FINISH_ANY)\r\n      break;\r\n    */\r\n\r\n    for (i = 0; i < p->numCoders; i++)\r\n    {\r\n      SRes res;\r\n      IStateCoder *coder = &p->coders[i];\r\n      Byte *destCur;\r\n      SizeT destLenCur, srcLenCur;\r\n      const Byte *srcCur;\r\n      int srcFinishedCur;\r\n      int encodingWasFinished;\r\n      \r\n      if (i == 0)\r\n      {\r\n        srcCur = src;\r\n        srcLenCur = srcLenOrig - *srcLen;\r\n        srcFinishedCur = srcWasFinished;\r\n      }\r\n      else\r\n      {\r\n        srcCur = p->buf + (CODER_BUF_SIZE * (i - 1)) + p->pos[i - 1];\r\n        srcLenCur = p->size[i - 1] - p->pos[i - 1];\r\n        srcFinishedCur = p->finished[i - 1];\r\n      }\r\n      \r\n      if (i == p->numCoders - 1)\r\n      {\r\n        destCur = dest;\r\n        destLenCur = destLenOrig - *destLen;\r\n      }\r\n      else\r\n      {\r\n        if (p->pos[i] != p->size[i])\r\n          continue;\r\n        destCur = p->buf + (CODER_BUF_SIZE * i);\r\n        destLenCur = CODER_BUF_SIZE;\r\n      }\r\n      \r\n      res = coder->Code(coder->p, destCur, &destLenCur, srcCur, &srcLenCur, srcFinishedCur, finishMode, &encodingWasFinished);\r\n\r\n      if (!encodingWasFinished)\r\n        allFinished = False;\r\n\r\n      if (i == 0)\r\n      {\r\n        *srcLen += srcLenCur;\r\n        src += srcLenCur;\r\n      }\r\n      else\r\n      {\r\n        p->pos[i - 1] += srcLenCur;\r\n      }\r\n\r\n      if (i == p->numCoders - 1)\r\n      {\r\n        *destLen += destLenCur;\r\n        dest += destLenCur;\r\n      }\r\n      else\r\n      {\r\n        p->size[i] = destLenCur;\r\n        p->pos[i] = 0;\r\n        p->finished[i] = encodingWasFinished;\r\n      }\r\n      \r\n      if (res != SZ_OK)\r\n        return res;\r\n\r\n      if (destLenCur != 0 || srcLenCur != 0)\r\n        processed = True;\r\n    }\r\n    if (!processed)\r\n      break;\r\n  }\r\n  if (allFinished)\r\n    *status = CODER_STATUS_FINISHED_WITH_MARK;\r\n  return SZ_OK;\r\n}\r\n\r\nSRes Xz_ParseHeader(CXzStreamFlags *p, const Byte *buf)\r\n{\r\n  *p = (CXzStreamFlags)GetBe16(buf + XZ_SIG_SIZE);\r\n  if (CrcCalc(buf + XZ_SIG_SIZE, XZ_STREAM_FLAGS_SIZE) !=\r\n      GetUi32(buf + XZ_SIG_SIZE + XZ_STREAM_FLAGS_SIZE))\r\n    return SZ_ERROR_NO_ARCHIVE;\r\n  return XzFlags_IsSupported(*p) ? SZ_OK : SZ_ERROR_UNSUPPORTED;\r\n}\r\n\r\nstatic Bool Xz_CheckFooter(CXzStreamFlags flags, UInt64 indexSize, const Byte *buf)\r\n{\r\n  return\r\n      indexSize == (((UInt64)GetUi32(buf + 4) + 1) << 2) &&\r\n      (GetUi32(buf) == CrcCalc(buf + 4, 6) &&\r\n      flags == GetBe16(buf + 8) &&\r\n      memcmp(buf + 10, XZ_FOOTER_SIG, XZ_FOOTER_SIG_SIZE) == 0);\r\n}\r\n\r\n#define READ_VARINT_AND_CHECK(buf, pos, size, res) \\\r\n  { unsigned s = Xz_ReadVarInt(buf + pos, size - pos, res); \\\r\n  if (s == 0) return SZ_ERROR_ARCHIVE; pos += s; }\r\n\r\n\r\nSRes XzBlock_Parse(CXzBlock *p, const Byte *header)\r\n{\r\n  unsigned pos;\r\n  int numFilters, i;\r\n  UInt32 headerSize = (UInt32)header[0] << 2;\r\n\r\n  if (CrcCalc(header, headerSize) != GetUi32(header + headerSize))\r\n    return SZ_ERROR_ARCHIVE;\r\n\r\n  pos = 1;\r\n  if (pos == headerSize)\r\n    return SZ_ERROR_ARCHIVE;\r\n  p->flags = header[pos++];\r\n\r\n  if (XzBlock_HasPackSize(p))\r\n  {\r\n    READ_VARINT_AND_CHECK(header, pos, headerSize, &p->packSize);\r\n    if (p->packSize == 0 || p->packSize + headerSize >= (UInt64)1 << 63)\r\n      return SZ_ERROR_ARCHIVE;\r\n  }\r\n\r\n  if (XzBlock_HasUnpackSize(p))\r\n    READ_VARINT_AND_CHECK(header, pos, headerSize, &p->unpackSize);\r\n\r\n  numFilters = XzBlock_GetNumFilters(p);\r\n  for (i = 0; i < numFilters; i++)\r\n  {\r\n    CXzFilter *filter = p->filters + i;\r\n    UInt64 size;\r\n    READ_VARINT_AND_CHECK(header, pos, headerSize, &filter->id);\r\n    READ_VARINT_AND_CHECK(header, pos, headerSize, &size);\r\n    if (size > headerSize - pos || size > XZ_FILTER_PROPS_SIZE_MAX)\r\n      return SZ_ERROR_ARCHIVE;\r\n    filter->propsSize = (UInt32)size;\r\n    memcpy(filter->props, header + pos, (size_t)size);\r\n    pos += (unsigned)size;\r\n\r\n    #ifdef XZ_DUMP\r\n    printf(\"\\nf[%d] = %2X: \", i, filter->id);\r\n    {\r\n      int i;\r\n      for (i = 0; i < size; i++)\r\n        printf(\" %2X\", filter->props[i]);\r\n    }\r\n    #endif\r\n  }\r\n\r\n  while (pos < headerSize)\r\n    if (header[pos++] != 0)\r\n      return SZ_ERROR_ARCHIVE;\r\n  return SZ_OK;\r\n}\r\n\r\nSRes XzDec_Init(CMixCoder *p, const CXzBlock *block)\r\n{\r\n  int i;\r\n  Bool needReInit = True;\r\n  int numFilters = XzBlock_GetNumFilters(block);\r\n  if (numFilters == p->numCoders)\r\n  {\r\n    for (i = 0; i < numFilters; i++)\r\n      if (p->ids[i] != block->filters[numFilters - 1 - i].id)\r\n        break;\r\n    needReInit = (i != numFilters);\r\n  }\r\n  if (needReInit)\r\n  {\r\n    MixCoder_Free(p);\r\n    p->numCoders = numFilters;\r\n    for (i = 0; i < numFilters; i++)\r\n    {\r\n      const CXzFilter *f = &block->filters[numFilters - 1 - i];\r\n      RINOK(MixCoder_SetFromMethod(p, i, f->id));\r\n    }\r\n  }\r\n  for (i = 0; i < numFilters; i++)\r\n  {\r\n    const CXzFilter *f = &block->filters[numFilters - 1 - i];\r\n    IStateCoder *sc = &p->coders[i];\r\n    RINOK(sc->SetProps(sc->p, f->props, f->propsSize, p->alloc));\r\n  }\r\n  MixCoder_Init(p);\r\n  return SZ_OK;\r\n}\r\n\r\nvoid XzUnpacker_Init(CXzUnpacker *p)\r\n{\r\n  p->state = XZ_STATE_STREAM_HEADER;\r\n  p->pos = 0;\r\n  p->numStreams = 0;\r\n}\r\n\r\nvoid XzUnpacker_Construct(CXzUnpacker *p, ISzAlloc *alloc)\r\n{\r\n  MixCoder_Construct(&p->decoder, alloc);\r\n  XzUnpacker_Init(p);\r\n}\r\n\r\nvoid XzUnpacker_Free(CXzUnpacker *p)\r\n{\r\n  MixCoder_Free(&p->decoder);\r\n}\r\n\r\nSRes XzUnpacker_Code(CXzUnpacker *p, Byte *dest, SizeT *destLen,\r\n    const Byte *src, SizeT *srcLen, int finishMode, ECoderStatus *status)\r\n{\r\n  SizeT destLenOrig = *destLen;\r\n  SizeT srcLenOrig = *srcLen;\r\n  *destLen = 0;\r\n  *srcLen = 0;\r\n  *status = CODER_STATUS_NOT_SPECIFIED;\r\n  for (;;)\r\n  {\r\n    SizeT srcRem = srcLenOrig - *srcLen;\r\n\r\n    if (p->state == XZ_STATE_BLOCK)\r\n    {\r\n      SizeT destLen2 = destLenOrig - *destLen;\r\n      SizeT srcLen2 = srcLenOrig - *srcLen;\r\n      SRes res;\r\n      if (srcLen2 == 0 && destLen2 == 0)\r\n      {\r\n        *status = CODER_STATUS_NOT_FINISHED;\r\n        return SZ_OK;\r\n      }\r\n      \r\n      res = MixCoder_Code(&p->decoder, dest, &destLen2, src, &srcLen2, False, finishMode, status);\r\n      XzCheck_Update(&p->check, dest, destLen2);\r\n      \r\n      (*srcLen) += srcLen2;\r\n      src += srcLen2;\r\n      p->packSize += srcLen2;\r\n      \r\n      (*destLen) += destLen2;\r\n      dest += destLen2;\r\n      p->unpackSize += destLen2;\r\n      \r\n      RINOK(res);\r\n      \r\n      if (*status == CODER_STATUS_FINISHED_WITH_MARK)\r\n      {\r\n        Byte temp[32];\r\n        unsigned num = Xz_WriteVarInt(temp, p->packSize + p->blockHeaderSize + XzFlags_GetCheckSize(p->streamFlags));\r\n        num += Xz_WriteVarInt(temp + num, p->unpackSize);\r\n        Sha256_Update(&p->sha, temp, num);\r\n        p->indexSize += num;\r\n        p->numBlocks++;\r\n        \r\n        p->state = XZ_STATE_BLOCK_FOOTER;\r\n        p->pos = 0;\r\n        p->alignPos = 0;\r\n      }\r\n      else if (srcLen2 == 0 && destLen2 == 0)\r\n        return SZ_OK;\r\n      \r\n      continue;\r\n    }\r\n\r\n    if (srcRem == 0)\r\n    {\r\n      *status = CODER_STATUS_NEEDS_MORE_INPUT;\r\n      return SZ_OK;\r\n    }\r\n\r\n    switch(p->state)\r\n    {\r\n      case XZ_STATE_STREAM_HEADER:\r\n      {\r\n        if (p->pos < XZ_STREAM_HEADER_SIZE)\r\n        {\r\n          if (p->pos < XZ_SIG_SIZE && *src != XZ_SIG[p->pos])\r\n            return SZ_ERROR_NO_ARCHIVE;\r\n          p->buf[p->pos++] = *src++;\r\n          (*srcLen)++;\r\n        }\r\n        else\r\n        {\r\n          RINOK(Xz_ParseHeader(&p->streamFlags, p->buf));\r\n          p->state = XZ_STATE_BLOCK_HEADER;\r\n          Sha256_Init(&p->sha);\r\n          p->indexSize = 0;\r\n          p->numBlocks = 0;\r\n          p->pos = 0;\r\n        }\r\n        break;\r\n      }\r\n\r\n      case XZ_STATE_BLOCK_HEADER:\r\n      {\r\n        if (p->pos == 0)\r\n        {\r\n          p->buf[p->pos++] = *src++;\r\n          (*srcLen)++;\r\n          if (p->buf[0] == 0)\r\n          {\r\n            p->indexPreSize = 1 + Xz_WriteVarInt(p->buf + 1, p->numBlocks);\r\n            p->indexPos = p->indexPreSize;\r\n            p->indexSize += p->indexPreSize;\r\n            Sha256_Final(&p->sha, p->shaDigest);\r\n            Sha256_Init(&p->sha);\r\n            p->crc = CrcUpdate(CRC_INIT_VAL, p->buf, p->indexPreSize);\r\n            p->state = XZ_STATE_STREAM_INDEX;\r\n          }\r\n          p->blockHeaderSize = ((UInt32)p->buf[0] << 2) + 4;\r\n        }\r\n        else if (p->pos != p->blockHeaderSize)\r\n        {\r\n          UInt32 cur = p->blockHeaderSize - p->pos;\r\n          if (cur > srcRem)\r\n            cur = (UInt32)srcRem;\r\n          memcpy(p->buf + p->pos, src, cur);\r\n          p->pos += cur;\r\n          (*srcLen) += cur;\r\n          src += cur;\r\n        }\r\n        else\r\n        {\r\n          RINOK(XzBlock_Parse(&p->block, p->buf));\r\n          p->state = XZ_STATE_BLOCK;\r\n          p->packSize = 0;\r\n          p->unpackSize = 0;\r\n          XzCheck_Init(&p->check, XzFlags_GetCheckType(p->streamFlags));\r\n          RINOK(XzDec_Init(&p->decoder, &p->block));\r\n        }\r\n        break;\r\n      }\r\n\r\n      case XZ_STATE_BLOCK_FOOTER:\r\n      {\r\n        if (((p->packSize + p->alignPos) & 3) != 0)\r\n        {\r\n          (*srcLen)++;\r\n          p->alignPos++;\r\n          if (*src++ != 0)\r\n            return SZ_ERROR_CRC;\r\n        }\r\n        else\r\n        {\r\n          UInt32 checkSize = XzFlags_GetCheckSize(p->streamFlags);\r\n          UInt32 cur = checkSize - p->pos;\r\n          if (cur != 0)\r\n          {\r\n            if (cur > srcRem)\r\n              cur = (UInt32)srcRem;\r\n            memcpy(p->buf + p->pos, src, cur);\r\n            p->pos += cur;\r\n            (*srcLen) += cur;\r\n            src += cur;\r\n          }\r\n          else\r\n          {\r\n            Byte digest[XZ_CHECK_SIZE_MAX];\r\n            p->state = XZ_STATE_BLOCK_HEADER;\r\n            p->pos = 0;\r\n            if (XzCheck_Final(&p->check, digest) && memcmp(digest, p->buf, checkSize) != 0)\r\n              return SZ_ERROR_CRC;\r\n          }\r\n        }\r\n        break;\r\n      }\r\n\r\n      case XZ_STATE_STREAM_INDEX:\r\n      {\r\n        if (p->pos < p->indexPreSize)\r\n        {\r\n          (*srcLen)++;\r\n          if (*src++ != p->buf[p->pos++])\r\n            return SZ_ERROR_CRC;\r\n        }\r\n        else\r\n        {\r\n          if (p->indexPos < p->indexSize)\r\n          {\r\n            UInt64 cur = p->indexSize - p->indexPos;\r\n            if (srcRem > cur)\r\n              srcRem = (SizeT)cur;\r\n            p->crc = CrcUpdate(p->crc, src, srcRem);\r\n            Sha256_Update(&p->sha, src, srcRem);\r\n            (*srcLen) += srcRem;\r\n            src += srcRem;\r\n            p->indexPos += srcRem;\r\n          }\r\n          else if ((p->indexPos & 3) != 0)\r\n          {\r\n            Byte b = *src++;\r\n            p->crc = CRC_UPDATE_BYTE(p->crc, b);\r\n            (*srcLen)++;\r\n            p->indexPos++;\r\n            p->indexSize++;\r\n            if (b != 0)\r\n              return SZ_ERROR_CRC;\r\n          }\r\n          else\r\n          {\r\n            Byte digest[SHA256_DIGEST_SIZE];\r\n            p->state = XZ_STATE_STREAM_INDEX_CRC;\r\n            p->indexSize += 4;\r\n            p->pos = 0;\r\n            Sha256_Final(&p->sha, digest);\r\n            if (memcmp(digest, p->shaDigest, SHA256_DIGEST_SIZE) != 0)\r\n              return SZ_ERROR_CRC;\r\n          }\r\n        }\r\n        break;\r\n      }\r\n\r\n      case XZ_STATE_STREAM_INDEX_CRC:\r\n      {\r\n        if (p->pos < 4)\r\n        {\r\n          (*srcLen)++;\r\n          p->buf[p->pos++] = *src++;\r\n        }\r\n        else\r\n        {\r\n          p->state = XZ_STATE_STREAM_FOOTER;\r\n          p->pos = 0;\r\n          if (CRC_GET_DIGEST(p->crc) != GetUi32(p->buf))\r\n            return SZ_ERROR_CRC;\r\n        }\r\n        break;\r\n      }\r\n\r\n      case XZ_STATE_STREAM_FOOTER:\r\n      {\r\n        UInt32 cur = XZ_STREAM_FOOTER_SIZE - p->pos;\r\n        if (cur > srcRem)\r\n          cur = (UInt32)srcRem;\r\n        memcpy(p->buf + p->pos, src, cur);\r\n        p->pos += cur;\r\n        (*srcLen) += cur;\r\n        src += cur;\r\n        if (p->pos == XZ_STREAM_FOOTER_SIZE)\r\n        {\r\n          p->state = XZ_STATE_STREAM_PADDING;\r\n          p->numStreams++;\r\n          p->padSize = 0;\r\n          if (!Xz_CheckFooter(p->streamFlags, p->indexSize, p->buf))\r\n            return SZ_ERROR_CRC;\r\n        }\r\n        break;\r\n      }\r\n\r\n      case XZ_STATE_STREAM_PADDING:\r\n      {\r\n        if (*src != 0)\r\n        {\r\n          if (((UInt32)p->padSize & 3) != 0)\r\n            return SZ_ERROR_NO_ARCHIVE;\r\n          p->pos = 0;\r\n          p->state = XZ_STATE_STREAM_HEADER;\r\n        }\r\n        else\r\n        {\r\n          (*srcLen)++;\r\n          src++;\r\n          p->padSize++;\r\n        }\r\n        break;\r\n      }\r\n      \r\n      case XZ_STATE_BLOCK: break; /* to disable GCC warning */\r\n    }\r\n  }\r\n  /*\r\n  if (p->state == XZ_STATE_FINISHED)\r\n    *status = CODER_STATUS_FINISHED_WITH_MARK;\r\n  return SZ_OK;\r\n  */\r\n}\r\n\r\nBool XzUnpacker_IsStreamWasFinished(CXzUnpacker *p)\r\n{\r\n  return (p->state == XZ_STATE_STREAM_PADDING) && (((UInt32)p->padSize & 3) == 0);\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/XzEnc.c",
    "content": "/* XzEnc.c -- Xz Encode\r\n2011-02-07 : Igor Pavlov : Public domain */\r\n\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\n#include \"7zCrc.h\"\r\n#include \"Alloc.h\"\r\n#include \"Bra.h\"\r\n#include \"CpuArch.h\"\r\n#ifdef USE_SUBBLOCK\r\n#include \"Bcj3Enc.c\"\r\n#include \"SbFind.c\"\r\n#include \"SbEnc.c\"\r\n#endif\r\n\r\n#include \"XzEnc.h\"\r\n\r\nstatic void *SzBigAlloc(void *p, size_t size) { p = p; return BigAlloc(size); }\r\nstatic void SzBigFree(void *p, void *address) { p = p; BigFree(address); }\r\nstatic ISzAlloc g_BigAlloc = { SzBigAlloc, SzBigFree };\r\n\r\nstatic void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); }\r\nstatic void SzFree(void *p, void *address) { p = p; MyFree(address); }\r\nstatic ISzAlloc g_Alloc = { SzAlloc, SzFree };\r\n\r\n#define XzBlock_ClearFlags(p)       (p)->flags = 0;\r\n#define XzBlock_SetNumFilters(p, n) (p)->flags |= ((n) - 1);\r\n#define XzBlock_SetHasPackSize(p)   (p)->flags |= XZ_BF_PACK_SIZE;\r\n#define XzBlock_SetHasUnpackSize(p) (p)->flags |= XZ_BF_UNPACK_SIZE;\r\n\r\nstatic SRes WriteBytes(ISeqOutStream *s, const void *buf, UInt32 size)\r\n{\r\n  return (s->Write(s, buf, size) == size) ? SZ_OK : SZ_ERROR_WRITE;\r\n}\r\n\r\nstatic SRes WriteBytesAndCrc(ISeqOutStream *s, const void *buf, UInt32 size, UInt32 *crc)\r\n{\r\n  *crc = CrcUpdate(*crc, buf, size);\r\n  return WriteBytes(s, buf, size);\r\n}\r\n\r\nSRes Xz_WriteHeader(CXzStreamFlags f, ISeqOutStream *s)\r\n{\r\n  UInt32 crc;\r\n  Byte header[XZ_STREAM_HEADER_SIZE];\r\n  memcpy(header, XZ_SIG, XZ_SIG_SIZE);\r\n  header[XZ_SIG_SIZE] = (Byte)(f >> 8);\r\n  header[XZ_SIG_SIZE + 1] = (Byte)(f & 0xFF);\r\n  crc = CrcCalc(header + XZ_SIG_SIZE, XZ_STREAM_FLAGS_SIZE);\r\n  SetUi32(header + XZ_SIG_SIZE + XZ_STREAM_FLAGS_SIZE, crc);\r\n  return WriteBytes(s, header, XZ_STREAM_HEADER_SIZE);\r\n}\r\n\r\nSRes XzBlock_WriteHeader(const CXzBlock *p, ISeqOutStream *s)\r\n{\r\n  Byte header[XZ_BLOCK_HEADER_SIZE_MAX];\r\n\r\n  unsigned pos = 1;\r\n  int numFilters, i;\r\n  header[pos++] = p->flags;\r\n\r\n  if (XzBlock_HasPackSize(p)) pos += Xz_WriteVarInt(header + pos, p->packSize);\r\n  if (XzBlock_HasUnpackSize(p)) pos += Xz_WriteVarInt(header + pos, p->unpackSize);\r\n  numFilters = XzBlock_GetNumFilters(p);\r\n  for (i = 0; i < numFilters; i++)\r\n  {\r\n    const CXzFilter *f = &p->filters[i];\r\n    pos += Xz_WriteVarInt(header + pos, f->id);\r\n    pos += Xz_WriteVarInt(header + pos, f->propsSize);\r\n    memcpy(header + pos, f->props, f->propsSize);\r\n    pos += f->propsSize;\r\n  }\r\n  while((pos & 3) != 0)\r\n    header[pos++] = 0;\r\n  header[0] = (Byte)(pos >> 2);\r\n  SetUi32(header + pos, CrcCalc(header, pos));\r\n  return WriteBytes(s, header, pos + 4);\r\n}\r\n\r\nSRes Xz_WriteFooter(CXzStream *p, ISeqOutStream *s)\r\n{\r\n  Byte buf[32];\r\n  UInt64 globalPos;\r\n  {\r\n    UInt32 crc = CRC_INIT_VAL;\r\n    unsigned pos = 1 + Xz_WriteVarInt(buf + 1, p->numBlocks);\r\n    size_t i;\r\n\r\n    globalPos = pos;\r\n    buf[0] = 0;\r\n    RINOK(WriteBytesAndCrc(s, buf, pos, &crc));\r\n    for (i = 0; i < p->numBlocks; i++)\r\n    {\r\n      const CXzBlockSizes *block = &p->blocks[i];\r\n      pos = Xz_WriteVarInt(buf, block->totalSize);\r\n      pos += Xz_WriteVarInt(buf + pos, block->unpackSize);\r\n      globalPos += pos;\r\n      RINOK(WriteBytesAndCrc(s, buf, pos, &crc));\r\n    }\r\n    pos = ((unsigned)globalPos & 3);\r\n    if (pos != 0)\r\n    {\r\n      buf[0] = buf[1] = buf[2] = 0;\r\n      RINOK(WriteBytesAndCrc(s, buf, 4 - pos, &crc));\r\n      globalPos += 4 - pos;\r\n    }\r\n    {\r\n      SetUi32(buf, CRC_GET_DIGEST(crc));\r\n      RINOK(WriteBytes(s, buf, 4));\r\n      globalPos += 4;\r\n    }\r\n  }\r\n\r\n  {\r\n    UInt32 indexSize = (UInt32)((globalPos >> 2) - 1);\r\n    SetUi32(buf + 4, indexSize);\r\n    buf[8] = (Byte)(p->flags >> 8);\r\n    buf[9] = (Byte)(p->flags & 0xFF);\r\n    SetUi32(buf, CrcCalc(buf + 4, 6));\r\n    memcpy(buf + 10, XZ_FOOTER_SIG, XZ_FOOTER_SIG_SIZE);\r\n    return WriteBytes(s, buf, 12);\r\n  }\r\n}\r\n\r\nSRes Xz_AddIndexRecord(CXzStream *p, UInt64 unpackSize, UInt64 totalSize, ISzAlloc *alloc)\r\n{\r\n  if (p->blocks == 0 || p->numBlocksAllocated == p->numBlocks)\r\n  {\r\n    size_t num = (p->numBlocks + 1) * 2;\r\n    size_t newSize = sizeof(CXzBlockSizes) * num;\r\n    CXzBlockSizes *blocks;\r\n    if (newSize / sizeof(CXzBlockSizes) != num)\r\n      return SZ_ERROR_MEM;\r\n    blocks = alloc->Alloc(alloc, newSize);\r\n    if (blocks == 0)\r\n      return SZ_ERROR_MEM;\r\n    if (p->numBlocks != 0)\r\n    {\r\n      memcpy(blocks, p->blocks, p->numBlocks * sizeof(CXzBlockSizes));\r\n      Xz_Free(p, alloc);\r\n    }\r\n    p->blocks = blocks;\r\n    p->numBlocksAllocated = num;\r\n  }\r\n  {\r\n    CXzBlockSizes *block = &p->blocks[p->numBlocks++];\r\n    block->totalSize = totalSize;\r\n    block->unpackSize = unpackSize;\r\n  }\r\n  return SZ_OK;\r\n}\r\n\r\n/* ---------- CSeqCheckInStream ---------- */\r\n\r\ntypedef struct\r\n{\r\n  ISeqInStream p;\r\n  ISeqInStream *realStream;\r\n  UInt64 processed;\r\n  CXzCheck check;\r\n} CSeqCheckInStream;\r\n\r\nvoid SeqCheckInStream_Init(CSeqCheckInStream *p, int mode)\r\n{\r\n  p->processed = 0;\r\n  XzCheck_Init(&p->check, mode);\r\n}\r\n\r\nvoid SeqCheckInStream_GetDigest(CSeqCheckInStream *p, Byte *digest)\r\n{\r\n  XzCheck_Final(&p->check, digest);\r\n}\r\n\r\nstatic SRes SeqCheckInStream_Read(void *pp, void *data, size_t *size)\r\n{\r\n  CSeqCheckInStream *p = (CSeqCheckInStream *)pp;\r\n  SRes res = p->realStream->Read(p->realStream, data, size);\r\n  XzCheck_Update(&p->check, data, *size);\r\n  p->processed += *size;\r\n  return res;\r\n}\r\n\r\n/* ---------- CSeqSizeOutStream ---------- */\r\n\r\ntypedef struct\r\n{\r\n  ISeqOutStream p;\r\n  ISeqOutStream *realStream;\r\n  UInt64 processed;\r\n} CSeqSizeOutStream;\r\n\r\nstatic size_t MyWrite(void *pp, const void *data, size_t size)\r\n{\r\n  CSeqSizeOutStream *p = (CSeqSizeOutStream *)pp;\r\n  size = p->realStream->Write(p->realStream, data, size);\r\n  p->processed += size;\r\n  return size;\r\n}\r\n\r\n/* ---------- CSeqInFilter ---------- */\r\n\r\n#define FILTER_BUF_SIZE (1 << 20)\r\n\r\ntypedef struct\r\n{\r\n  ISeqInStream p;\r\n  ISeqInStream *realStream;\r\n  IStateCoder StateCoder;\r\n  Byte *buf;\r\n  size_t curPos;\r\n  size_t endPos;\r\n  int srcWasFinished;\r\n} CSeqInFilter;\r\n\r\nstatic SRes SeqInFilter_Read(void *pp, void *data, size_t *size)\r\n{\r\n  CSeqInFilter *p = (CSeqInFilter *)pp;\r\n  size_t sizeOriginal = *size;\r\n  if (sizeOriginal == 0)\r\n    return S_OK;\r\n  *size = 0;\r\n  for (;;)\r\n  {\r\n    if (!p->srcWasFinished && p->curPos == p->endPos)\r\n    {\r\n      p->curPos = 0;\r\n      p->endPos = FILTER_BUF_SIZE;\r\n      RINOK(p->realStream->Read(p->realStream, p->buf, &p->endPos));\r\n      if (p->endPos == 0)\r\n        p->srcWasFinished = 1;\r\n    }\r\n    {\r\n      SizeT srcLen = p->endPos - p->curPos;\r\n      int wasFinished;\r\n      SRes res;\r\n      *size = sizeOriginal;\r\n      res = p->StateCoder.Code(p->StateCoder.p, data, size, p->buf + p->curPos, &srcLen,\r\n        p->srcWasFinished, CODER_FINISH_ANY, &wasFinished);\r\n      p->curPos += srcLen;\r\n      if (*size != 0 || srcLen == 0 || res != 0)\r\n        return res;\r\n    }\r\n  }\r\n}\r\n\r\nstatic void SeqInFilter_Construct(CSeqInFilter *p)\r\n{\r\n  p->buf = NULL;\r\n  p->p.Read = SeqInFilter_Read;\r\n}\r\n\r\nstatic void SeqInFilter_Free(CSeqInFilter *p)\r\n{\r\n  if (p->buf)\r\n  {\r\n    g_Alloc.Free(&g_Alloc, p->buf);\r\n    p->buf = NULL;\r\n  }\r\n}\r\n\r\nSRes BraState_SetFromMethod(IStateCoder *p, UInt64 id, int encodeMode, ISzAlloc *alloc);\r\n\r\nstatic SRes SeqInFilter_Init(CSeqInFilter *p, const CXzFilter *props)\r\n{\r\n  if (!p->buf)\r\n  {\r\n    p->buf = g_Alloc.Alloc(&g_Alloc, FILTER_BUF_SIZE);\r\n    if (!p->buf)\r\n      return SZ_ERROR_MEM;\r\n  }\r\n  p->curPos = p->endPos = 0;\r\n  p->srcWasFinished = 0;\r\n  RINOK(BraState_SetFromMethod(&p->StateCoder, props->id, 1, &g_Alloc));\r\n  RINOK(p->StateCoder.SetProps(p->StateCoder.p, props->props, props->propsSize, &g_Alloc));\r\n  p->StateCoder.Init(p->StateCoder.p);\r\n  return S_OK;\r\n}\r\n\r\n/* ---------- CSbEncInStream ---------- */\r\n\r\n#ifdef USE_SUBBLOCK\r\n\r\ntypedef struct\r\n{\r\n  ISeqInStream p;\r\n  ISeqInStream *inStream;\r\n  CSbEnc enc;\r\n} CSbEncInStream;\r\n\r\nstatic SRes SbEncInStream_Read(void *pp, void *data, size_t *size)\r\n{\r\n  CSbEncInStream *p = (CSbEncInStream *)pp;\r\n  size_t sizeOriginal = *size;\r\n  if (sizeOriginal == 0)\r\n    return S_OK;\r\n  for (;;)\r\n  {\r\n    if (p->enc.needRead && !p->enc.readWasFinished)\r\n    {\r\n      size_t processed = p->enc.needReadSizeMax;\r\n      RINOK(p->inStream->Read(p->inStream, p->enc.buf + p->enc.readPos, &processed));\r\n      p->enc.readPos += processed;\r\n      if (processed == 0)\r\n      {\r\n        p->enc.readWasFinished = True;\r\n        p->enc.isFinalFinished = True;\r\n      }\r\n      p->enc.needRead = False;\r\n    }\r\n    *size = sizeOriginal;\r\n    RINOK(SbEnc_Read(&p->enc, data, size));\r\n    if (*size != 0 || !p->enc.needRead)\r\n      return S_OK;\r\n  }\r\n}\r\n\r\nvoid SbEncInStream_Construct(CSbEncInStream *p, ISzAlloc *alloc)\r\n{\r\n  SbEnc_Construct(&p->enc, alloc);\r\n  p->p.Read = SbEncInStream_Read;\r\n}\r\n\r\nSRes SbEncInStream_Init(CSbEncInStream *p)\r\n{\r\n  return SbEnc_Init(&p->enc);\r\n}\r\n\r\nvoid SbEncInStream_Free(CSbEncInStream *p)\r\n{\r\n  SbEnc_Free(&p->enc);\r\n}\r\n\r\n#endif\r\n\r\n\r\ntypedef struct\r\n{\r\n  CLzma2EncHandle lzma2;\r\n  #ifdef USE_SUBBLOCK\r\n  CSbEncInStream sb;\r\n  #endif\r\n  CSeqInFilter filter;\r\n  ISzAlloc *alloc;\r\n  ISzAlloc *bigAlloc;\r\n} CLzma2WithFilters;\r\n\r\n\r\nstatic void Lzma2WithFilters_Construct(CLzma2WithFilters *p, ISzAlloc *alloc, ISzAlloc *bigAlloc)\r\n{\r\n  p->alloc = alloc;\r\n  p->bigAlloc = bigAlloc;\r\n  p->lzma2 = NULL;\r\n  #ifdef USE_SUBBLOCK\r\n  SbEncInStream_Construct(&p->sb, alloc);\r\n  #endif\r\n  SeqInFilter_Construct(&p->filter);\r\n}\r\n\r\nstatic SRes Lzma2WithFilters_Create(CLzma2WithFilters *p)\r\n{\r\n  p->lzma2 = Lzma2Enc_Create(p->alloc, p->bigAlloc);\r\n  if (p->lzma2 == 0)\r\n    return SZ_ERROR_MEM;\r\n  return SZ_OK;\r\n}\r\n\r\nstatic void Lzma2WithFilters_Free(CLzma2WithFilters *p)\r\n{\r\n  SeqInFilter_Free(&p->filter);\r\n  #ifdef USE_SUBBLOCK\r\n  SbEncInStream_Free(&p->sb);\r\n  #endif\r\n  if (p->lzma2)\r\n  {\r\n    Lzma2Enc_Destroy(p->lzma2);\r\n    p->lzma2 = NULL;\r\n  }\r\n}\r\n\r\nvoid XzProps_Init(CXzProps *p)\r\n{\r\n  p->lzma2Props = 0;\r\n  p->filterProps = 0;\r\n  p->checkId = XZ_CHECK_CRC32;\r\n}\r\n\r\nvoid XzFilterProps_Init(CXzFilterProps *p)\r\n{\r\n  p->id = 0;\r\n  p->delta = 0;\r\n  p->ip= 0;\r\n  p->ipDefined = False;\r\n}\r\n\r\nstatic SRes Xz_Compress(CXzStream *xz, CLzma2WithFilters *lzmaf,\r\n    ISeqOutStream *outStream, ISeqInStream *inStream,\r\n    const CXzProps *props, ICompressProgress *progress)\r\n{\r\n  xz->flags = (Byte)props->checkId;\r\n\r\n  RINOK(Lzma2Enc_SetProps(lzmaf->lzma2, props->lzma2Props));\r\n  RINOK(Xz_WriteHeader(xz->flags, outStream));\r\n\r\n  {\r\n    CSeqCheckInStream checkInStream;\r\n    CSeqSizeOutStream seqSizeOutStream;\r\n    CXzBlock block;\r\n    int filterIndex = 0;\r\n    CXzFilter *filter = NULL;\r\n    const CXzFilterProps *fp = props->filterProps;\r\n    \r\n    XzBlock_ClearFlags(&block);\r\n    XzBlock_SetNumFilters(&block, 1 + (fp ? 1 : 0));\r\n    \r\n    if (fp)\r\n    {\r\n      filter = &block.filters[filterIndex++];\r\n      filter->id = fp->id;\r\n      filter->propsSize = 0;\r\n      if (fp->id == XZ_ID_Delta)\r\n      {\r\n        filter->props[0] = (Byte)(fp->delta - 1);\r\n        filter->propsSize = 1;\r\n      }\r\n      else if (fp->ipDefined)\r\n      {\r\n        SetUi32(filter->props, fp->ip);\r\n        filter->propsSize = 4;\r\n      }\r\n    }\r\n\r\n    {\r\n      CXzFilter *f = &block.filters[filterIndex++];\r\n      f->id = XZ_ID_LZMA2;\r\n      f->propsSize = 1;\r\n      f->props[0] = Lzma2Enc_WriteProperties(lzmaf->lzma2);\r\n    }\r\n\r\n    seqSizeOutStream.p.Write = MyWrite;\r\n    seqSizeOutStream.realStream = outStream;\r\n    seqSizeOutStream.processed = 0;\r\n    \r\n    RINOK(XzBlock_WriteHeader(&block, &seqSizeOutStream.p));\r\n    \r\n    checkInStream.p.Read = SeqCheckInStream_Read;\r\n    checkInStream.realStream = inStream;\r\n    SeqCheckInStream_Init(&checkInStream, XzFlags_GetCheckType(xz->flags));\r\n    \r\n    if (fp)\r\n    {\r\n      #ifdef USE_SUBBLOCK\r\n      if (fp->id == XZ_ID_Subblock)\r\n      {\r\n        lzmaf->sb.inStream = &checkInStream.p;\r\n        RINOK(SbEncInStream_Init(&lzmaf->sb));\r\n      }\r\n      else\r\n      #endif\r\n      {\r\n        lzmaf->filter.realStream = &checkInStream.p;\r\n        RINOK(SeqInFilter_Init(&lzmaf->filter, filter));\r\n      }\r\n    }\r\n\r\n    {\r\n      UInt64 packPos = seqSizeOutStream.processed;\r\n      SRes res = Lzma2Enc_Encode(lzmaf->lzma2, &seqSizeOutStream.p,\r\n        fp ?\r\n        #ifdef USE_SUBBLOCK\r\n        (fp->id == XZ_ID_Subblock) ? &lzmaf->sb.p:\r\n        #endif\r\n        &lzmaf->filter.p:\r\n        &checkInStream.p,\r\n        progress);\r\n      RINOK(res);\r\n      block.unpackSize = checkInStream.processed;\r\n      block.packSize = seqSizeOutStream.processed - packPos;\r\n    }\r\n\r\n    {\r\n      unsigned padSize = 0;\r\n      Byte buf[128];\r\n      while((((unsigned)block.packSize + padSize) & 3) != 0)\r\n        buf[padSize++] = 0;\r\n      SeqCheckInStream_GetDigest(&checkInStream, buf + padSize);\r\n      RINOK(WriteBytes(&seqSizeOutStream.p, buf, padSize + XzFlags_GetCheckSize(xz->flags)));\r\n      RINOK(Xz_AddIndexRecord(xz, block.unpackSize, seqSizeOutStream.processed - padSize, &g_Alloc));\r\n    }\r\n  }\r\n  return Xz_WriteFooter(xz, outStream);\r\n}\r\n\r\nSRes Xz_Encode(ISeqOutStream *outStream, ISeqInStream *inStream,\r\n    const CXzProps *props, ICompressProgress *progress)\r\n{\r\n  SRes res;\r\n  CXzStream xz;\r\n  CLzma2WithFilters lzmaf;\r\n  Xz_Construct(&xz);\r\n  Lzma2WithFilters_Construct(&lzmaf, &g_Alloc, &g_BigAlloc);\r\n  res = Lzma2WithFilters_Create(&lzmaf);\r\n  if (res == SZ_OK)\r\n    res = Xz_Compress(&xz, &lzmaf, outStream, inStream, props, progress);\r\n  Lzma2WithFilters_Free(&lzmaf);\r\n  Xz_Free(&xz, &g_Alloc);\r\n  return res;\r\n}\r\n\r\nSRes Xz_EncodeEmpty(ISeqOutStream *outStream)\r\n{\r\n  SRes res;\r\n  CXzStream xz;\r\n  Xz_Construct(&xz);\r\n  res = Xz_WriteHeader(xz.flags, outStream);\r\n  if (res == SZ_OK)\r\n    res = Xz_WriteFooter(&xz, outStream);\r\n  Xz_Free(&xz, &g_Alloc);\r\n  return res;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/C/XzEnc.h",
    "content": "/* XzEnc.h -- Xz Encode\r\n2011-02-07 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __XZ_ENC_H\r\n#define __XZ_ENC_H\r\n\r\n#include \"Lzma2Enc.h\"\r\n\r\n#include \"Xz.h\"\r\n\r\nEXTERN_C_BEGIN\r\n\r\ntypedef struct\r\n{\r\n  UInt32 id;\r\n  UInt32 delta;\r\n  UInt32 ip;\r\n  int ipDefined;\r\n} CXzFilterProps;\r\n\r\nvoid XzFilterProps_Init(CXzFilterProps *p);\r\n\r\ntypedef struct\r\n{\r\n  const CLzma2EncProps *lzma2Props;\r\n  const CXzFilterProps *filterProps;\r\n  unsigned checkId;\r\n} CXzProps;\r\n\r\nvoid XzProps_Init(CXzProps *p);\r\n\r\nSRes Xz_Encode(ISeqOutStream *outStream, ISeqInStream *inStream,\r\n    const CXzProps *props, ICompressProgress *progress);\r\n\r\nSRes Xz_EncodeEmpty(ISeqOutStream *outStream);\r\n\r\nEXTERN_C_END\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/lzma/C/XzIn.c",
    "content": "/* XzIn.c - Xz input\r\n2011-02-01 : Igor Pavlov : Public domain */\r\n\r\n#include <string.h>\r\n\r\n#include \"7zCrc.h\"\r\n#include \"CpuArch.h\"\r\n#include \"Xz.h\"\r\n\r\nSRes Xz_ReadHeader(CXzStreamFlags *p, ISeqInStream *inStream)\r\n{\r\n  Byte sig[XZ_STREAM_HEADER_SIZE];\r\n  RINOK(SeqInStream_Read2(inStream, sig, XZ_STREAM_HEADER_SIZE, SZ_ERROR_NO_ARCHIVE));\r\n  if (memcmp(sig, XZ_SIG, XZ_SIG_SIZE) != 0)\r\n    return SZ_ERROR_NO_ARCHIVE;\r\n  return Xz_ParseHeader(p, sig);\r\n}\r\n\r\n#define READ_VARINT_AND_CHECK(buf, pos, size, res) \\\r\n  { unsigned s = Xz_ReadVarInt(buf + pos, size - pos, res); \\\r\n  if (s == 0) return SZ_ERROR_ARCHIVE; pos += s; }\r\n\r\nSRes XzBlock_ReadHeader(CXzBlock *p, ISeqInStream *inStream, Bool *isIndex, UInt32 *headerSizeRes)\r\n{\r\n  Byte header[XZ_BLOCK_HEADER_SIZE_MAX];\r\n  unsigned headerSize;\r\n  *headerSizeRes = 0;\r\n  RINOK(SeqInStream_ReadByte(inStream, &header[0]));\r\n  headerSize = ((unsigned)header[0] << 2) + 4;\r\n  if (headerSize == 0)\r\n  {\r\n    *headerSizeRes = 1;\r\n    *isIndex = True;\r\n    return SZ_OK;\r\n  }\r\n\r\n  *isIndex = False;\r\n  *headerSizeRes = headerSize;\r\n  RINOK(SeqInStream_Read(inStream, header + 1, headerSize - 1));\r\n  return XzBlock_Parse(p, header);\r\n}\r\n\r\n#define ADD_SIZE_CHECH(size, val) \\\r\n  { UInt64 newSize = size + (val); if (newSize < size) return XZ_SIZE_OVERFLOW; size = newSize; }\r\n\r\nUInt64 Xz_GetUnpackSize(const CXzStream *p)\r\n{\r\n  UInt64 size = 0;\r\n  size_t i;\r\n  for (i = 0; i < p->numBlocks; i++)\r\n    ADD_SIZE_CHECH(size, p->blocks[i].unpackSize);\r\n  return size;\r\n}\r\n\r\nUInt64 Xz_GetPackSize(const CXzStream *p)\r\n{\r\n  UInt64 size = 0;\r\n  size_t i;\r\n  for (i = 0; i < p->numBlocks; i++)\r\n    ADD_SIZE_CHECH(size, (p->blocks[i].totalSize + 3) & ~(UInt64)3);\r\n  return size;\r\n}\r\n\r\n/*\r\nSRes XzBlock_ReadFooter(CXzBlock *p, CXzStreamFlags f, ISeqInStream *inStream)\r\n{\r\n  return SeqInStream_Read(inStream, p->check, XzFlags_GetCheckSize(f));\r\n}\r\n*/\r\n\r\nstatic SRes Xz_ReadIndex2(CXzStream *p, const Byte *buf, size_t size, ISzAlloc *alloc)\r\n{\r\n  size_t i, numBlocks, crcStartPos, pos = 1;\r\n  UInt32 crc;\r\n\r\n  if (size < 5 || buf[0] != 0)\r\n    return SZ_ERROR_ARCHIVE;\r\n\r\n  size -= 4;\r\n  crc = CrcCalc(buf, size);\r\n  if (crc != GetUi32(buf + size))\r\n    return SZ_ERROR_ARCHIVE;\r\n\r\n  {\r\n    UInt64 numBlocks64;\r\n    READ_VARINT_AND_CHECK(buf, pos, size, &numBlocks64);\r\n    numBlocks = (size_t)numBlocks64;\r\n    if (numBlocks != numBlocks64 || numBlocks * 2 > size)\r\n      return SZ_ERROR_ARCHIVE;\r\n  }\r\n  \r\n  crcStartPos = pos;\r\n  Xz_Free(p, alloc);\r\n  if (numBlocks != 0)\r\n  {\r\n    p->numBlocks = numBlocks;\r\n    p->numBlocksAllocated = numBlocks;\r\n    p->blocks = alloc->Alloc(alloc, sizeof(CXzBlockSizes) * numBlocks);\r\n    if (p->blocks == 0)\r\n      return SZ_ERROR_MEM;\r\n    for (i = 0; i < numBlocks; i++)\r\n    {\r\n      CXzBlockSizes *block = &p->blocks[i];\r\n      READ_VARINT_AND_CHECK(buf, pos, size, &block->totalSize);\r\n      READ_VARINT_AND_CHECK(buf, pos, size, &block->unpackSize);\r\n      if (block->totalSize == 0)\r\n        return SZ_ERROR_ARCHIVE;\r\n    }\r\n  }\r\n  while ((pos & 3) != 0)\r\n    if (buf[pos++] != 0)\r\n      return SZ_ERROR_ARCHIVE;\r\n  return (pos == size) ? SZ_OK : SZ_ERROR_ARCHIVE;\r\n}\r\n\r\nstatic SRes Xz_ReadIndex(CXzStream *p, ILookInStream *stream, UInt64 indexSize, ISzAlloc *alloc)\r\n{\r\n  SRes res;\r\n  size_t size;\r\n  Byte *buf;\r\n  if (indexSize > ((UInt32)1 << 31))\r\n    return SZ_ERROR_UNSUPPORTED;\r\n  size = (size_t)indexSize;\r\n  if (size != indexSize)\r\n    return SZ_ERROR_UNSUPPORTED;\r\n  buf = alloc->Alloc(alloc, size);\r\n  if (buf == 0)\r\n    return SZ_ERROR_MEM;\r\n  res = LookInStream_Read2(stream, buf, size, SZ_ERROR_UNSUPPORTED);\r\n  if (res == SZ_OK)\r\n    res = Xz_ReadIndex2(p, buf, size, alloc);\r\n  alloc->Free(alloc, buf);\r\n  return res;\r\n}\r\n\r\nstatic SRes SeekFromCur(ILookInStream *inStream, Int64 *res)\r\n{\r\n  return inStream->Seek(inStream, res, SZ_SEEK_CUR);\r\n}\r\n\r\nstatic SRes Xz_ReadBackward(CXzStream *p, ILookInStream *stream, Int64 *startOffset, ISzAlloc *alloc)\r\n{\r\n  UInt64 indexSize;\r\n  Byte buf[XZ_STREAM_FOOTER_SIZE];\r\n\r\n  if ((*startOffset & 3) != 0 || *startOffset < XZ_STREAM_FOOTER_SIZE)\r\n    return SZ_ERROR_NO_ARCHIVE;\r\n  *startOffset = -XZ_STREAM_FOOTER_SIZE;\r\n  RINOK(SeekFromCur(stream, startOffset));\r\n\r\n  RINOK(LookInStream_Read2(stream, buf, XZ_STREAM_FOOTER_SIZE, SZ_ERROR_NO_ARCHIVE));\r\n  \r\n  if (memcmp(buf + 10, XZ_FOOTER_SIG, XZ_FOOTER_SIG_SIZE) != 0)\r\n  {\r\n    UInt32 total = 0;\r\n    *startOffset += XZ_STREAM_FOOTER_SIZE;\r\n    for (;;)\r\n    {\r\n      size_t i;\r\n      #define TEMP_BUF_SIZE (1 << 10)\r\n      Byte tempBuf[TEMP_BUF_SIZE];\r\n      if (*startOffset < XZ_STREAM_FOOTER_SIZE || total > (1 << 16))\r\n        return SZ_ERROR_NO_ARCHIVE;\r\n      i = (*startOffset > TEMP_BUF_SIZE) ? TEMP_BUF_SIZE : (size_t)*startOffset;\r\n      total += (UInt32)i;\r\n      *startOffset = -(Int64)i;\r\n      RINOK(SeekFromCur(stream, startOffset));\r\n      RINOK(LookInStream_Read2(stream, tempBuf, i, SZ_ERROR_NO_ARCHIVE));\r\n      for (; i != 0; i--)\r\n        if (tempBuf[i - 1] != 0)\r\n          break;\r\n      if (i != 0)\r\n      {\r\n        if ((i & 3) != 0)\r\n          return SZ_ERROR_NO_ARCHIVE;\r\n        *startOffset += i;\r\n        break;\r\n      }\r\n    }\r\n    if (*startOffset < XZ_STREAM_FOOTER_SIZE)\r\n      return SZ_ERROR_NO_ARCHIVE;\r\n    *startOffset -= XZ_STREAM_FOOTER_SIZE;\r\n    RINOK(stream->Seek(stream, startOffset, SZ_SEEK_SET));\r\n    RINOK(LookInStream_Read2(stream, buf, XZ_STREAM_FOOTER_SIZE, SZ_ERROR_NO_ARCHIVE));\r\n    if (memcmp(buf + 10, XZ_FOOTER_SIG, XZ_FOOTER_SIG_SIZE) != 0)\r\n      return SZ_ERROR_NO_ARCHIVE;\r\n  }\r\n  \r\n  p->flags = (CXzStreamFlags)GetBe16(buf + 8);\r\n\r\n  if (!XzFlags_IsSupported(p->flags))\r\n    return SZ_ERROR_UNSUPPORTED;\r\n\r\n  if (GetUi32(buf) != CrcCalc(buf + 4, 6))\r\n    return SZ_ERROR_ARCHIVE;\r\n\r\n  indexSize = ((UInt64)GetUi32(buf + 4) + 1) << 2;\r\n\r\n  *startOffset = -(Int64)(indexSize + XZ_STREAM_FOOTER_SIZE);\r\n  RINOK(SeekFromCur(stream, startOffset));\r\n\r\n  RINOK(Xz_ReadIndex(p, stream, indexSize, alloc));\r\n\r\n  {\r\n    UInt64 totalSize = Xz_GetPackSize(p);\r\n    UInt64 sum = XZ_STREAM_HEADER_SIZE + totalSize + indexSize;\r\n    if (totalSize == XZ_SIZE_OVERFLOW ||\r\n      sum >= ((UInt64)1 << 63) ||\r\n      totalSize >= ((UInt64)1 << 63))\r\n      return SZ_ERROR_ARCHIVE;\r\n    *startOffset = -(Int64)sum;\r\n    RINOK(SeekFromCur(stream, startOffset));\r\n  }\r\n  {\r\n    CXzStreamFlags headerFlags;\r\n    CSecToRead secToRead;\r\n    SecToRead_CreateVTable(&secToRead);\r\n    secToRead.realStream = stream;\r\n\r\n    RINOK(Xz_ReadHeader(&headerFlags, &secToRead.s));\r\n    return (p->flags == headerFlags) ? SZ_OK : SZ_ERROR_ARCHIVE;\r\n  }\r\n}\r\n\r\n\r\n/* ---------- Xz Streams ---------- */\r\n\r\nvoid Xzs_Construct(CXzs *p)\r\n{\r\n  p->num = p->numAllocated = 0;\r\n  p->streams = 0;\r\n}\r\n\r\nvoid Xzs_Free(CXzs *p, ISzAlloc *alloc)\r\n{\r\n  size_t i;\r\n  for (i = 0; i < p->num; i++)\r\n    Xz_Free(&p->streams[i], alloc);\r\n  alloc->Free(alloc, p->streams);\r\n  p->num = p->numAllocated = 0;\r\n  p->streams = 0;\r\n}\r\n\r\nUInt64 Xzs_GetNumBlocks(const CXzs *p)\r\n{\r\n  UInt64 num = 0;\r\n  size_t i;\r\n  for (i = 0; i < p->num; i++)\r\n    num += p->streams[i].numBlocks;\r\n  return num;\r\n}\r\n\r\nUInt64 Xzs_GetUnpackSize(const CXzs *p)\r\n{\r\n  UInt64 size = 0;\r\n  size_t i;\r\n  for (i = 0; i < p->num; i++)\r\n    ADD_SIZE_CHECH(size, Xz_GetUnpackSize(&p->streams[i]));\r\n  return size;\r\n}\r\n\r\n/*\r\nUInt64 Xzs_GetPackSize(const CXzs *p)\r\n{\r\n  UInt64 size = 0;\r\n  size_t i;\r\n  for (i = 0; i < p->num; i++)\r\n    ADD_SIZE_CHECH(size, Xz_GetTotalSize(&p->streams[i]));\r\n  return size;\r\n}\r\n*/\r\n\r\nSRes Xzs_ReadBackward(CXzs *p, ILookInStream *stream, Int64 *startOffset, ICompressProgress *progress, ISzAlloc *alloc)\r\n{\r\n  Int64 endOffset = 0;\r\n  RINOK(stream->Seek(stream, &endOffset, SZ_SEEK_END));\r\n  *startOffset = endOffset;\r\n  for (;;)\r\n  {\r\n    CXzStream st;\r\n    SRes res;\r\n    Xz_Construct(&st);\r\n    res = Xz_ReadBackward(&st, stream, startOffset, alloc);\r\n    st.startOffset = *startOffset;\r\n    RINOK(res);\r\n    if (p->num == p->numAllocated)\r\n    {\r\n      size_t newNum = p->num + p->num / 4 + 1;\r\n      Byte *data = (Byte *)alloc->Alloc(alloc, newNum * sizeof(CXzStream));\r\n      if (data == 0)\r\n        return SZ_ERROR_MEM;\r\n      p->numAllocated = newNum;\r\n      memcpy(data, p->streams, p->num * sizeof(CXzStream));\r\n      alloc->Free(alloc, p->streams);\r\n      p->streams = (CXzStream *)data;\r\n    }\r\n    p->streams[p->num++] = st;\r\n    if (*startOffset == 0)\r\n      break;\r\n    RINOK(stream->Seek(stream, startOffset, SZ_SEEK_SET));\r\n    if (progress && progress->Progress(progress, endOffset - *startOffset, (UInt64)(Int64)-1) != SZ_OK)\r\n      return SZ_ERROR_PROGRESS;\r\n  }\r\n  return SZ_OK;\r\n}\r\n"
  },
  {
    "path": "ext/lzma/Methods.txt",
    "content": "7-Zip method IDs (9.18)\r\n-----------------------\r\n\r\nEach compression or crypto method in 7z has unique binary value (ID).\r\nThe length of ID in bytes is arbitrary but it can not exceed 63 bits (8 bytes).\r\n\r\nIf you want to add some new ID, you have two ways:\r\n1) Write request for allocating IDs to 7-zip developers.\r\n2) Generate 8-bytes ID:\r\n\r\n    3F ZZ ZZ ZZ ZZ ZZ MM MM \r\n\r\n    3F              - Prefix for random IDs (1 byte)\r\n    ZZ ZZ ZZ ZZ ZZ  - Developer ID (5 bytes). Use real random bytes. \r\n                      \r\n    MM MM           - Method ID (2 bytes)\r\n\r\n    You can notify 7-Zip developers about your Developer ID / Method ID.\r\n\r\n    Note: Use new ID only if old codec can not decode data encoded with new version.\r\n\r\n\r\nList of defined IDs\r\n-------------------\r\n      \r\n00 - Copy\r\n\r\n03 - Delta\r\n04 - x86 (BCJ)\r\n05 - PPC (Big Endian)\r\n06 - IA64\r\n07 - ARM (little endian)\r\n08 - ARM Thumb (little endian)\r\n09 - SPARC\r\n21 - LZMA2\r\n          \r\n02.. - Common\r\n   03 Swap\r\n      - 2 Swap2\r\n      - 4 Swap4\r\n\r\n03.. - 7z\r\n   01 - LZMA\r\n      01 - Version\r\n  \r\n   03 - Branch\r\n      01 - x86\r\n         03  - BCJ\r\n         1B  - BCJ2\r\n      02 - PPC\r\n         05 - PPC (Big Endian)\r\n      03 - Alpha\r\n         01 - Alpha\r\n      04 - IA64\r\n         01 - IA64\r\n      05 - ARM\r\n         01 - ARM\r\n      06 - M68\r\n         05 - M68 (Big Endian)\r\n      07 - ARM Thumb\r\n         01 - ARMT\r\n      08 - SPARC\r\n         05 - SPARC\r\n\r\n   04 - PPMD\r\n      01 - Version\r\n\r\n   7F -\r\n      01 - experimental methods.\r\n\r\n\r\n04.. - Misc\r\n   00 - Reserved\r\n   01 - Zip\r\n      00 - Copy (not used). Use {00} instead\r\n      01 - Shrink\r\n      06 - Implode\r\n      08 - Deflate\r\n      09 - Deflate64\r\n      10 - Imploding\r\n      12 - BZip2 (not used). Use {04 02 02} instead\r\n      14 - LZMA\r\n      60 - Jpeg\r\n      61 - WavPack\r\n      62 - PPMd\r\n      63 - wzAES\r\n   02 - BZip\r\n      02 - BZip2\r\n   03 - Rar\r\n      01 - Rar15\r\n      02 - Rar20\r\n      03 - Rar29\r\n   04 - Arj\r\n      01 - Arj (1,2,3)\r\n      02 - Arj 4\r\n   05 - Z\r\n   06 - Lzh\r\n   07 - Reserved for 7z\r\n   08 - Cab\r\n   09 - NSIS\r\n      01 - DeflateNSIS\r\n      02 - BZip2NSIS\r\n\r\n\r\n06.. - Crypto \r\n   00 - \r\n   01 - AES\r\n      0x - AES-128\r\n      4x - AES-192\r\n      8x - AES-256\r\n      Cx - AES\r\n\r\n      x0 - ECB\r\n      x1 - CBC\r\n      x2 - CFB\r\n      x3 - OFB\r\n\r\n   07 - Reserved\r\n   0F - Reserved\r\n\r\n   F0 - Misc Ciphers (Real Ciphers without hashing algo)\r\n\r\n   F1 - Misc Ciphers (Combine)\r\n      01 - Zip\r\n         01 - Main Zip crypto algo\r\n      03 - RAR\r\n         02 - \r\n         03 - Rar29 AES-128 + (modified SHA-1)\r\n      07 - 7z\r\n         01 - AES-256 + SHA-256\r\n\r\n07.. - Hash (subject to change)\r\n   00 - \r\n   01 - CRC\r\n   02 - SHA-1\r\n   03 - SHA-256\r\n   04 - SHA-384\r\n   05 - SHA-512\r\n\r\n   F0 - Misc Hash\r\n\r\n   F1 - Misc\r\n      03 - RAR\r\n         03 - Rar29 Password Hashing (modified SHA1)\r\n      07 - 7z \r\n         01 - SHA-256 Password Hashing\r\n    \r\n   \r\n\r\n\r\n---\r\nEnd of document\r\n"
  },
  {
    "path": "ext/lzma/history.txt",
    "content": "HISTORY of the LZMA SDK\r\n-----------------------\r\n\r\n9.21 beta      2011-04-11\r\n-------------------------\t\r\n- New class FString for file names at file systems.\r\n- Speed optimization in CRC code for big-endian CPUs.\r\n- The BUG in Lzma2Dec.c was fixed:\r\n    Lzma2Decode function didn't work.\r\n\r\n\r\n9.18 beta      2010-11-02\r\n-------------------------\t\r\n- New small SFX module for installers (SfxSetup).\r\n\r\n\r\n9.12 beta      2010-03-24\r\n-------------------------\r\n- The BUG in LZMA SDK 9.* was fixed: LZMA2 codec didn't work,\r\n  if more than 10 threads were used (or more than 20 threads in some modes).\r\n\r\n\r\n9.11 beta      2010-03-15\r\n-------------------------\r\n- PPMd compression method support\r\n   \r\n\r\n9.09           2009-12-12\r\n-------------------------\r\n- The bug was fixed:\r\n   Utf16_To_Utf8 funstions in UTFConvert.cpp and 7zMain.c\r\n   incorrectly converted surrogate characters (the code >= 0x10000) to UTF-8.\r\n- Some bugs were fixed\r\n\r\n\r\n9.06           2009-08-17\r\n-------------------------\r\n- Some changes in ANSI-C 7z Decoder interfaces.\r\n\r\n\r\n9.04           2009-05-30\r\n-------------------------\r\n- LZMA2 compression method support\r\n- xz format support\r\n\r\n\r\n4.65           2009-02-03\r\n-------------------------\r\n- Some minor fixes\r\n\r\n\r\n4.63           2008-12-31\r\n-------------------------\r\n- Some minor fixes\r\n\r\n\r\n4.61 beta      2008-11-23\r\n-------------------------\r\n- The bug in ANSI-C LZMA Decoder was fixed:\r\n    If encoded stream was corrupted, decoder could access memory \r\n    outside of allocated range.\r\n- Some changes in ANSI-C 7z Decoder interfaces.\r\n- LZMA SDK is placed in the public domain.\r\n\r\n\r\n4.60 beta      2008-08-19\r\n-------------------------\r\n- Some minor fixes.\r\n\r\n\r\n4.59 beta      2008-08-13\r\n-------------------------\r\n- The bug was fixed:\r\n    LZMA Encoder in fast compression mode could access memory outside of \r\n    allocated range in some rare cases.\r\n\r\n\r\n4.58 beta      2008-05-05\r\n-------------------------\r\n- ANSI-C LZMA Decoder was rewritten for speed optimizations.\r\n- ANSI-C LZMA Encoder was included to LZMA SDK.\r\n- C++ LZMA code now is just wrapper over ANSI-C code.\r\n\r\n\r\n4.57           2007-12-12\r\n-------------------------\r\n- Speed optimizations in ++ LZMA Decoder. \r\n- Small changes for more compatibility with some C/C++ compilers.\r\n\r\n\r\n4.49 beta      2007-07-05\r\n-------------------------\r\n- .7z ANSI-C Decoder:\r\n     - now it supports BCJ and BCJ2 filters\r\n     - now it supports files larger than 4 GB.\r\n     - now it supports \"Last Write Time\" field for files.\r\n- C++ code for .7z archives compressing/decompressing from 7-zip \r\n  was included to LZMA SDK.\r\n  \r\n\r\n4.43           2006-06-04\r\n-------------------------\r\n- Small changes for more compatibility with some C/C++ compilers.\r\n  \r\n\r\n4.42           2006-05-15\r\n-------------------------\r\n- Small changes in .h files in ANSI-C version.\r\n  \r\n\r\n4.39 beta      2006-04-14\r\n-------------------------\r\n- The bug in versions 4.33b:4.38b was fixed:\r\n  C++ version of LZMA encoder could not correctly compress \r\n  files larger than 2 GB with HC4 match finder (-mfhc4).\r\n  \r\n\r\n4.37 beta      2005-04-06\r\n-------------------------\r\n- Fixes in C++ code: code could no be compiled if _NO_EXCEPTIONS was defined. \r\n\r\n\r\n4.35 beta      2005-03-02\r\n-------------------------\r\n- The bug was fixed in C++ version of LZMA Decoder:\r\n    If encoded stream was corrupted, decoder could access memory \r\n    outside of allocated range.\r\n\r\n\r\n4.34 beta      2006-02-27\r\n-------------------------\r\n- Compressing speed and memory requirements for compressing were increased\r\n- LZMA now can use only these match finders: HC4, BT2, BT3, BT4\r\n\r\n\r\n4.32           2005-12-09\r\n-------------------------\r\n- Java version of LZMA SDK was included\r\n\r\n\r\n4.30           2005-11-20\r\n-------------------------\r\n- Compression ratio was improved in -a2 mode\r\n- Speed optimizations for compressing in -a2 mode\r\n- -fb switch now supports values up to 273\r\n- The bug in 7z_C (7zIn.c) was fixed:\r\n  It used Alloc/Free functions from different memory pools.\r\n  So if program used two memory pools, it worked incorrectly.\r\n- 7z_C: .7z format supporting was improved\r\n- LZMA# SDK (C#.NET version) was included\r\n\r\n\r\n4.27 (Updated) 2005-09-21\r\n-------------------------\r\n- Some GUIDs/interfaces in C++ were changed.\r\n IStream.h:\r\n   ISequentialInStream::Read now works as old ReadPart\r\n   ISequentialOutStream::Write now works as old WritePart\r\n\r\n\r\n4.27           2005-08-07\r\n-------------------------\r\n- The bug in LzmaDecodeSize.c was fixed:\r\n   if _LZMA_IN_CB and _LZMA_OUT_READ were defined,\r\n   decompressing worked incorrectly.\r\n\r\n\r\n4.26           2005-08-05\r\n-------------------------\r\n- Fixes in 7z_C code and LzmaTest.c:\r\n  previous versions could work incorrectly,\r\n  if malloc(0) returns 0\r\n\r\n\r\n4.23           2005-06-29\r\n-------------------------\r\n- Small fixes in C++ code\r\n\r\n\r\n4.22           2005-06-10\r\n-------------------------\r\n- Small fixes\r\n\r\n\r\n4.21           2005-06-08\r\n-------------------------\r\n- Interfaces for ANSI-C LZMA Decoder (LzmaDecode.c) were changed\r\n- New additional version of ANSI-C LZMA Decoder with zlib-like interface:\r\n    - LzmaStateDecode.h\r\n    - LzmaStateDecode.c\r\n    - LzmaStateTest.c\r\n- ANSI-C LZMA Decoder now can decompress files larger than 4 GB\r\n\r\n\r\n4.17           2005-04-18\r\n-------------------------\r\n- New example for RAM->RAM compressing/decompressing: \r\n  LZMA + BCJ (filter for x86 code):\r\n    - LzmaRam.h\r\n    - LzmaRam.cpp\r\n    - LzmaRamDecode.h\r\n    - LzmaRamDecode.c\r\n    - -f86 switch for lzma.exe\r\n\r\n\r\n4.16           2005-03-29\r\n-------------------------\r\n- The bug was fixed in LzmaDecode.c (ANSI-C LZMA Decoder): \r\n   If _LZMA_OUT_READ was defined, and if encoded stream was corrupted,\r\n   decoder could access memory outside of allocated range.\r\n- Speed optimization of ANSI-C LZMA Decoder (now it's about 20% faster).\r\n  Old version of LZMA Decoder now is in file LzmaDecodeSize.c. \r\n  LzmaDecodeSize.c can provide slightly smaller code than LzmaDecode.c\r\n- Small speed optimization in LZMA C++ code\r\n- filter for SPARC's code was added\r\n- Simplified version of .7z ANSI-C Decoder was included\r\n\r\n\r\n4.06           2004-09-05\r\n-------------------------\r\n- The bug in v4.05 was fixed:\r\n    LZMA-Encoder didn't release output stream in some cases.\r\n\r\n\r\n4.05           2004-08-25\r\n-------------------------\r\n- Source code of filters for x86, IA-64, ARM, ARM-Thumb \r\n  and PowerPC code was included to SDK\r\n- Some internal minor changes\r\n\r\n\r\n4.04           2004-07-28\r\n-------------------------\r\n- More compatibility with some C++ compilers\r\n\r\n\r\n4.03           2004-06-18\r\n-------------------------\r\n- \"Benchmark\" command was added. It measures compressing \r\n  and decompressing speed and shows rating values. \r\n  Also it checks hardware errors.\r\n\r\n\r\n4.02           2004-06-10\r\n-------------------------\r\n- C++ LZMA Encoder/Decoder code now is more portable\r\n  and it can be compiled by GCC on Linux.\r\n\r\n\r\n4.01           2004-02-15\r\n-------------------------\r\n- Some detection of data corruption was enabled.\r\n    LzmaDecode.c / RangeDecoderReadByte\r\n    .....\r\n    {\r\n      rd->ExtraBytes = 1;\r\n      return 0xFF;\r\n    }\r\n\r\n\r\n4.00           2004-02-13\r\n-------------------------\r\n- Original version of LZMA SDK\r\n\r\n\r\n\r\nHISTORY of the LZMA\r\n-------------------\r\n  2001-2008:  Improvements to LZMA compressing/decompressing code, \r\n              keeping compatibility with original LZMA format\r\n  1996-2001:  Development of LZMA compression format\r\n\r\n  Some milestones:\r\n\r\n  2001-08-30: LZMA compression was added to 7-Zip\r\n  1999-01-02: First version of 7-Zip was released\r\n  \r\n\r\nEnd of document\r\n"
  },
  {
    "path": "ext/lzma/lzma.txt",
    "content": "LZMA SDK 9.22\r\n-------------\r\n\r\nLZMA SDK provides the documentation, samples, header files, libraries, \r\nand tools you need to develop applications that use LZMA compression.\r\n\r\nLZMA is default and general compression method of 7z format\r\nin 7-Zip compression program (www.7-zip.org). LZMA provides high \r\ncompression ratio and very fast decompression.\r\n\r\nLZMA is an improved version of famous LZ77 compression algorithm. \r\nIt was improved in way of maximum increasing of compression ratio,\r\nkeeping high decompression speed and low memory requirements for \r\ndecompressing.\r\n\r\n\r\n\r\nLICENSE\r\n-------\r\n\r\nLZMA SDK is written and placed in the public domain by Igor Pavlov.\r\n\r\nSome code in LZMA SDK is based on public domain code from another developers:\r\n  1) PPMd var.H (2001): Dmitry Shkarin\r\n  2) SHA-256: Wei Dai (Crypto++ library)\r\n\r\nYou can copy, modify, distribute and perform LZMA SDK code, even for commercial purposes,\r\nall without asking permission.\r\n\r\nLZMA SDK code is compatible with open source licenses, for example, you can \r\ninclude it to GNU GPL or GNU LGPL code.\r\n\r\n\r\nLZMA SDK Contents\r\n-----------------\r\n\r\nLZMA SDK includes:\r\n\r\n  - ANSI-C/C++/C#/Java source code for LZMA compressing and decompressing\r\n  - Compiled file->file LZMA compressing/decompressing program for Windows system\r\n\r\n\r\nUNIX/Linux version \r\n------------------\r\nTo compile C++ version of file->file LZMA encoding, go to directory\r\nCPP/7zip/Bundles/LzmaCon\r\nand call make to recompile it:\r\n  make -f makefile.gcc clean all\r\n\r\nIn some UNIX/Linux versions you must compile LZMA with static libraries.\r\nTo compile with static libraries, you can use \r\nLIB = -lm -static\r\n\r\n\r\nFiles\r\n---------------------\r\nlzma.txt     - LZMA SDK description (this file)\r\n7zFormat.txt - 7z Format description\r\n7zC.txt      - 7z ANSI-C Decoder description\r\nmethods.txt  - Compression method IDs for .7z\r\nlzma.exe     - Compiled file->file LZMA encoder/decoder for Windows\r\n7zr.exe      - 7-Zip with 7z/lzma/xz support.\r\nhistory.txt  - history of the LZMA SDK\r\n\r\n\r\nSource code structure\r\n---------------------\r\n\r\nC/  - C files\r\n        7zCrc*.*   - CRC code\r\n        Alloc.*    - Memory allocation functions\r\n        Bra*.*     - Filters for x86, IA-64, ARM, ARM-Thumb, PowerPC and SPARC code\r\n        LzFind.*   - Match finder for LZ (LZMA) encoders \r\n        LzFindMt.* - Match finder for LZ (LZMA) encoders for multithreading encoding\r\n        LzHash.h   - Additional file for LZ match finder\r\n        LzmaDec.*  - LZMA decoding\r\n        LzmaEnc.*  - LZMA encoding\r\n        LzmaLib.*  - LZMA Library for DLL calling\r\n        Types.h    - Basic types for another .c files\r\n        Threads.*  - The code for multithreading.\r\n\r\n    LzmaLib  - LZMA Library (.DLL for Windows)\r\n    \r\n    LzmaUtil - LZMA Utility (file->file LZMA encoder/decoder).\r\n\r\n    Archive - files related to archiving\r\n      7z     - 7z ANSI-C Decoder\r\n\r\nCPP/ -- CPP files\r\n\r\n  Common  - common files for C++ projects\r\n  Windows - common files for Windows related code\r\n\r\n  7zip    - files related to 7-Zip Project\r\n\r\n    Common   - common files for 7-Zip\r\n\r\n    Compress - files related to compression/decompression\r\n\r\n    Archive - files related to archiving\r\n\r\n      Common   - common files for archive handling\r\n      7z       - 7z C++ Encoder/Decoder\r\n\r\n    Bundles    - Modules that are bundles of other modules\r\n  \r\n      Alone7z           - 7zr.exe: Standalone version of 7z.exe that supports only 7z/LZMA/BCJ/BCJ2\r\n      LzmaCon           - lzma.exe: LZMA compression/decompression\r\n      Format7zR         - 7zr.dll: Reduced version of 7za.dll: extracting/compressing to 7z/LZMA/BCJ/BCJ2\r\n      Format7zExtractR  - 7zxr.dll: Reduced version of 7zxa.dll: extracting from 7z/LZMA/BCJ/BCJ2.\r\n\r\n    UI        - User Interface files\r\n         \r\n      Client7z - Test application for 7za.dll,  7zr.dll, 7zxr.dll\r\n      Common   - Common UI files\r\n      Console  - Code for console archiver\r\n\r\n\r\n\r\nCS/ - C# files\r\n  7zip\r\n    Common   - some common files for 7-Zip\r\n    Compress - files related to compression/decompression\r\n      LZ     - files related to LZ (Lempel-Ziv) compression algorithm\r\n      LZMA         - LZMA compression/decompression\r\n      LzmaAlone    - file->file LZMA compression/decompression\r\n      RangeCoder   - Range Coder (special code of compression/decompression)\r\n\r\nJava/  - Java files\r\n  SevenZip\r\n    Compression    - files related to compression/decompression\r\n      LZ           - files related to LZ (Lempel-Ziv) compression algorithm\r\n      LZMA         - LZMA compression/decompression\r\n      RangeCoder   - Range Coder (special code of compression/decompression)\r\n\r\n\r\nC/C++ source code of LZMA SDK is part of 7-Zip project.\r\n7-Zip source code can be downloaded from 7-Zip's SourceForge page:\r\n\r\n  http://sourceforge.net/projects/sevenzip/\r\n\r\n\r\n\r\nLZMA features\r\n-------------\r\n  - Variable dictionary size (up to 1 GB)\r\n  - Estimated compressing speed: about 2 MB/s on 2 GHz CPU\r\n  - Estimated decompressing speed: \r\n      - 20-30 MB/s on 2 GHz Core 2 or AMD Athlon 64\r\n      - 1-2 MB/s on 200 MHz ARM, MIPS, PowerPC or other simple RISC\r\n  - Small memory requirements for decompressing (16 KB + DictionarySize)\r\n  - Small code size for decompressing: 5-8 KB\r\n\r\nLZMA decoder uses only integer operations and can be \r\nimplemented in any modern 32-bit CPU (or on 16-bit CPU with some conditions).\r\n\r\nSome critical operations that affect the speed of LZMA decompression:\r\n  1) 32*16 bit integer multiply\r\n  2) Misspredicted branches (penalty mostly depends from pipeline length)\r\n  3) 32-bit shift and arithmetic operations\r\n\r\nThe speed of LZMA decompressing mostly depends from CPU speed.\r\nMemory speed has no big meaning. But if your CPU has small data cache, \r\noverall weight of memory speed will slightly increase.\r\n\r\n\r\nHow To Use\r\n----------\r\n\r\nUsing LZMA encoder/decoder executable\r\n--------------------------------------\r\n\r\nUsage:  LZMA <e|d> inputFile outputFile [<switches>...]\r\n\r\n  e: encode file\r\n\r\n  d: decode file\r\n\r\n  b: Benchmark. There are two tests: compressing and decompressing \r\n     with LZMA method. Benchmark shows rating in MIPS (million \r\n     instructions per second). Rating value is calculated from \r\n     measured speed and it is normalized with Intel's Core 2 results.\r\n     Also Benchmark checks possible hardware errors (RAM \r\n     errors in most cases). Benchmark uses these settings:\r\n     (-a1, -d21, -fb32, -mfbt4). You can change only -d parameter. \r\n     Also you can change the number of iterations. Example for 30 iterations:\r\n       LZMA b 30\r\n     Default number of iterations is 10.\r\n\r\n<Switches>\r\n  \r\n\r\n  -a{N}:  set compression mode 0 = fast, 1 = normal\r\n          default: 1 (normal)\r\n\r\n  d{N}:   Sets Dictionary size - [0, 30], default: 23 (8MB)\r\n          The maximum value for dictionary size is 1 GB = 2^30 bytes.\r\n          Dictionary size is calculated as DictionarySize = 2^N bytes. \r\n          For decompressing file compressed by LZMA method with dictionary \r\n          size D = 2^N you need about D bytes of memory (RAM).\r\n\r\n  -fb{N}: set number of fast bytes - [5, 273], default: 128\r\n          Usually big number gives a little bit better compression ratio \r\n          and slower compression process.\r\n\r\n  -lc{N}: set number of literal context bits - [0, 8], default: 3\r\n          Sometimes lc=4 gives gain for big files.\r\n\r\n  -lp{N}: set number of literal pos bits - [0, 4], default: 0\r\n          lp switch is intended for periodical data when period is \r\n          equal 2^N. For example, for 32-bit (4 bytes) \r\n          periodical data you can use lp=2. Often it's better to set lc0, \r\n          if you change lp switch.\r\n\r\n  -pb{N}: set number of pos bits - [0, 4], default: 2\r\n          pb switch is intended for periodical data \r\n          when period is equal 2^N.\r\n\r\n  -mf{MF_ID}: set Match Finder. Default: bt4. \r\n              Algorithms from hc* group doesn't provide good compression \r\n              ratio, but they often works pretty fast in combination with \r\n              fast mode (-a0).\r\n\r\n              Memory requirements depend from dictionary size \r\n              (parameter \"d\" in table below). \r\n\r\n               MF_ID     Memory                   Description\r\n\r\n                bt2    d *  9.5 + 4MB  Binary Tree with 2 bytes hashing.\r\n                bt3    d * 11.5 + 4MB  Binary Tree with 3 bytes hashing.\r\n                bt4    d * 11.5 + 4MB  Binary Tree with 4 bytes hashing.\r\n                hc4    d *  7.5 + 4MB  Hash Chain with 4 bytes hashing.\r\n\r\n  -eos:   write End Of Stream marker. By default LZMA doesn't write \r\n          eos marker, since LZMA decoder knows uncompressed size \r\n          stored in .lzma file header.\r\n\r\n  -si:    Read data from stdin (it will write End Of Stream marker).\r\n  -so:    Write data to stdout\r\n\r\n\r\nExamples:\r\n\r\n1) LZMA e file.bin file.lzma -d16 -lc0 \r\n\r\ncompresses file.bin to file.lzma with 64 KB dictionary (2^16=64K)  \r\nand 0 literal context bits. -lc0 allows to reduce memory requirements \r\nfor decompression.\r\n\r\n\r\n2) LZMA e file.bin file.lzma -lc0 -lp2\r\n\r\ncompresses file.bin to file.lzma with settings suitable \r\nfor 32-bit periodical data (for example, ARM or MIPS code).\r\n\r\n3) LZMA d file.lzma file.bin\r\n\r\ndecompresses file.lzma to file.bin.\r\n\r\n\r\nCompression ratio hints\r\n-----------------------\r\n\r\nRecommendations\r\n---------------\r\n\r\nTo increase the compression ratio for LZMA compressing it's desirable \r\nto have aligned data (if it's possible) and also it's desirable to locate\r\ndata in such order, where code is grouped in one place and data is \r\ngrouped in other place (it's better than such mixing: code, data, code,\r\ndata, ...).\r\n\r\n\r\nFilters\r\n-------\r\nYou can increase the compression ratio for some data types, using\r\nspecial filters before compressing. For example, it's possible to \r\nincrease the compression ratio on 5-10% for code for those CPU ISAs: \r\nx86, IA-64, ARM, ARM-Thumb, PowerPC, SPARC.\r\n\r\nYou can find C source code of such filters in C/Bra*.* files\r\n\r\nYou can check the compression ratio gain of these filters with such \r\n7-Zip commands (example for ARM code):\r\nNo filter:\r\n  7z a a1.7z a.bin -m0=lzma\r\n\r\nWith filter for little-endian ARM code:\r\n  7z a a2.7z a.bin -m0=arm -m1=lzma        \r\n\r\nIt works in such manner:\r\nCompressing    = Filter_encoding + LZMA_encoding\r\nDecompressing  = LZMA_decoding + Filter_decoding\r\n\r\nCompressing and decompressing speed of such filters is very high,\r\nso it will not increase decompressing time too much.\r\nMoreover, it reduces decompression time for LZMA_decoding, \r\nsince compression ratio with filtering is higher.\r\n\r\nThese filters convert CALL (calling procedure) instructions \r\nfrom relative offsets to absolute addresses, so such data becomes more \r\ncompressible.\r\n\r\nFor some ISAs (for example, for MIPS) it's impossible to get gain from such filter.\r\n\r\n\r\nLZMA compressed file format\r\n---------------------------\r\nOffset Size Description\r\n  0     1   Special LZMA properties (lc,lp, pb in encoded form)\r\n  1     4   Dictionary size (little endian)\r\n  5     8   Uncompressed size (little endian). -1 means unknown size\r\n 13         Compressed data\r\n\r\n\r\nANSI-C LZMA Decoder\r\n~~~~~~~~~~~~~~~~~~~\r\n\r\nPlease note that interfaces for ANSI-C code were changed in LZMA SDK 4.58.\r\nIf you want to use old interfaces you can download previous version of LZMA SDK\r\nfrom sourceforge.net site.\r\n\r\nTo use ANSI-C LZMA Decoder you need the following files:\r\n1) LzmaDec.h + LzmaDec.c + Types.h\r\nLzmaUtil/LzmaUtil.c is example application that uses these files.\r\n\r\n\r\nMemory requirements for LZMA decoding\r\n-------------------------------------\r\n\r\nStack usage of LZMA decoding function for local variables is not \r\nlarger than 200-400 bytes.\r\n\r\nLZMA Decoder uses dictionary buffer and internal state structure.\r\nInternal state structure consumes\r\n  state_size = (4 + (1.5 << (lc + lp))) KB\r\nby default (lc=3, lp=0), state_size = 16 KB.\r\n\r\n\r\nHow To decompress data\r\n----------------------\r\n\r\nLZMA Decoder (ANSI-C version) now supports 2 interfaces:\r\n1) Single-call Decompressing\r\n2) Multi-call State Decompressing (zlib-like interface)\r\n\r\nYou must use external allocator:\r\nExample:\r\nvoid *SzAlloc(void *p, size_t size) { p = p; return malloc(size); }\r\nvoid SzFree(void *p, void *address) { p = p; free(address); }\r\nISzAlloc alloc = { SzAlloc, SzFree };\r\n\r\nYou can use p = p; operator to disable compiler warnings.\r\n\r\n\r\nSingle-call Decompressing\r\n-------------------------\r\nWhen to use: RAM->RAM decompressing\r\nCompile files: LzmaDec.h + LzmaDec.c + Types.h\r\nCompile defines: no defines\r\nMemory Requirements:\r\n  - Input buffer: compressed size\r\n  - Output buffer: uncompressed size\r\n  - LZMA Internal Structures: state_size (16 KB for default settings) \r\n\r\nInterface:\r\n  int LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,\r\n      const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, \r\n      ELzmaStatus *status, ISzAlloc *alloc);\r\n  In: \r\n    dest     - output data\r\n    destLen  - output data size\r\n    src      - input data\r\n    srcLen   - input data size\r\n    propData - LZMA properties  (5 bytes)\r\n    propSize - size of propData buffer (5 bytes)\r\n    finishMode - It has meaning only if the decoding reaches output limit (*destLen).\r\n         LZMA_FINISH_ANY - Decode just destLen bytes.\r\n         LZMA_FINISH_END - Stream must be finished after (*destLen).\r\n                           You can use LZMA_FINISH_END, when you know that \r\n                           current output buffer covers last bytes of stream. \r\n    alloc    - Memory allocator.\r\n\r\n  Out: \r\n    destLen  - processed output size \r\n    srcLen   - processed input size \r\n\r\n  Output:\r\n    SZ_OK\r\n      status:\r\n        LZMA_STATUS_FINISHED_WITH_MARK\r\n        LZMA_STATUS_NOT_FINISHED \r\n        LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK\r\n    SZ_ERROR_DATA - Data error\r\n    SZ_ERROR_MEM  - Memory allocation error\r\n    SZ_ERROR_UNSUPPORTED - Unsupported properties\r\n    SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).\r\n\r\n  If LZMA decoder sees end_marker before reaching output limit, it returns OK result,\r\n  and output value of destLen will be less than output buffer size limit.\r\n\r\n  You can use multiple checks to test data integrity after full decompression:\r\n    1) Check Result and \"status\" variable.\r\n    2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize.\r\n    3) Check that output(srcLen) = compressedSize, if you know real compressedSize. \r\n       You must use correct finish mode in that case. */ \r\n\r\n\r\nMulti-call State Decompressing (zlib-like interface)\r\n----------------------------------------------------\r\n\r\nWhen to use: file->file decompressing \r\nCompile files: LzmaDec.h + LzmaDec.c + Types.h\r\n\r\nMemory Requirements:\r\n - Buffer for input stream: any size (for example, 16 KB)\r\n - Buffer for output stream: any size (for example, 16 KB)\r\n - LZMA Internal Structures: state_size (16 KB for default settings) \r\n - LZMA dictionary (dictionary size is encoded in LZMA properties header)\r\n\r\n1) read LZMA properties (5 bytes) and uncompressed size (8 bytes, little-endian) to header:\r\n   unsigned char header[LZMA_PROPS_SIZE + 8];\r\n   ReadFile(inFile, header, sizeof(header)\r\n\r\n2) Allocate CLzmaDec structures (state + dictionary) using LZMA properties\r\n\r\n  CLzmaDec state;\r\n  LzmaDec_Constr(&state);\r\n  res = LzmaDec_Allocate(&state, header, LZMA_PROPS_SIZE, &g_Alloc);\r\n  if (res != SZ_OK)\r\n    return res;\r\n\r\n3) Init LzmaDec structure before any new LZMA stream. And call LzmaDec_DecodeToBuf in loop\r\n\r\n  LzmaDec_Init(&state);\r\n  for (;;)\r\n  {\r\n    ... \r\n    int res = LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, \r\n        const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode);\r\n    ...\r\n  }\r\n\r\n\r\n4) Free all allocated structures\r\n  LzmaDec_Free(&state, &g_Alloc);\r\n\r\nFor full code example, look at C/LzmaUtil/LzmaUtil.c code.\r\n\r\n\r\nHow To compress data\r\n--------------------\r\n\r\nCompile files: LzmaEnc.h + LzmaEnc.c + Types.h +\r\nLzFind.c + LzFind.h + LzFindMt.c + LzFindMt.h + LzHash.h\r\n\r\nMemory Requirements:\r\n  - (dictSize * 11.5 + 6 MB) + state_size\r\n\r\nLzma Encoder can use two memory allocators:\r\n1) alloc - for small arrays.\r\n2) allocBig - for big arrays.\r\n\r\nFor example, you can use Large RAM Pages (2 MB) in allocBig allocator for \r\nbetter compression speed. Note that Windows has bad implementation for \r\nLarge RAM Pages. \r\nIt's OK to use same allocator for alloc and allocBig.\r\n\r\n\r\nSingle-call Compression with callbacks\r\n--------------------------------------\r\n\r\nCheck C/LzmaUtil/LzmaUtil.c as example, \r\n\r\nWhen to use: file->file decompressing \r\n\r\n1) you must implement callback structures for interfaces:\r\nISeqInStream\r\nISeqOutStream\r\nICompressProgress\r\nISzAlloc\r\n\r\nstatic void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); }\r\nstatic void SzFree(void *p, void *address) {  p = p; MyFree(address); }\r\nstatic ISzAlloc g_Alloc = { SzAlloc, SzFree };\r\n\r\n  CFileSeqInStream inStream;\r\n  CFileSeqOutStream outStream;\r\n\r\n  inStream.funcTable.Read = MyRead;\r\n  inStream.file = inFile;\r\n  outStream.funcTable.Write = MyWrite;\r\n  outStream.file = outFile;\r\n\r\n\r\n2) Create CLzmaEncHandle object;\r\n\r\n  CLzmaEncHandle enc;\r\n\r\n  enc = LzmaEnc_Create(&g_Alloc);\r\n  if (enc == 0)\r\n    return SZ_ERROR_MEM;\r\n\r\n\r\n3) initialize CLzmaEncProps properties;\r\n\r\n  LzmaEncProps_Init(&props);\r\n\r\n  Then you can change some properties in that structure.\r\n\r\n4) Send LZMA properties to LZMA Encoder\r\n\r\n  res = LzmaEnc_SetProps(enc, &props);\r\n\r\n5) Write encoded properties to header\r\n\r\n    Byte header[LZMA_PROPS_SIZE + 8];\r\n    size_t headerSize = LZMA_PROPS_SIZE;\r\n    UInt64 fileSize;\r\n    int i;\r\n\r\n    res = LzmaEnc_WriteProperties(enc, header, &headerSize);\r\n    fileSize = MyGetFileLength(inFile);\r\n    for (i = 0; i < 8; i++)\r\n      header[headerSize++] = (Byte)(fileSize >> (8 * i));\r\n    MyWriteFileAndCheck(outFile, header, headerSize)\r\n\r\n6) Call encoding function:\r\n      res = LzmaEnc_Encode(enc, &outStream.funcTable, &inStream.funcTable, \r\n        NULL, &g_Alloc, &g_Alloc);\r\n\r\n7) Destroy LZMA Encoder Object\r\n  LzmaEnc_Destroy(enc, &g_Alloc, &g_Alloc);\r\n\r\n\r\nIf callback function return some error code, LzmaEnc_Encode also returns that code\r\nor it can return the code like SZ_ERROR_READ, SZ_ERROR_WRITE or SZ_ERROR_PROGRESS.\r\n\r\n\r\nSingle-call RAM->RAM Compression\r\n--------------------------------\r\n\r\nSingle-call RAM->RAM Compression is similar to Compression with callbacks,\r\nbut you provide pointers to buffers instead of pointers to stream callbacks:\r\n\r\nHRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,\r\n    CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, \r\n    ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);\r\n\r\nReturn code:\r\n  SZ_OK               - OK\r\n  SZ_ERROR_MEM        - Memory allocation error \r\n  SZ_ERROR_PARAM      - Incorrect paramater\r\n  SZ_ERROR_OUTPUT_EOF - output buffer overflow\r\n  SZ_ERROR_THREAD     - errors in multithreading functions (only for Mt version)\r\n\r\n\r\n\r\nDefines\r\n-------\r\n\r\n_LZMA_SIZE_OPT - Enable some optimizations in LZMA Decoder to get smaller executable code.\r\n\r\n_LZMA_PROB32   - It can increase the speed on some 32-bit CPUs, but memory usage for \r\n                 some structures will be doubled in that case.\r\n\r\n_LZMA_UINT32_IS_ULONG  - Define it if int is 16-bit on your compiler and long is 32-bit.\r\n\r\n_LZMA_NO_SYSTEM_SIZE_T  - Define it if you don't want to use size_t type.\r\n\r\n\r\n_7ZIP_PPMD_SUPPPORT - Define it if you don't want to support PPMD method in AMSI-C .7z decoder.\r\n\r\n\r\nC++ LZMA Encoder/Decoder \r\n~~~~~~~~~~~~~~~~~~~~~~~~\r\nC++ LZMA code use COM-like interfaces. So if you want to use it, \r\nyou can study basics of COM/OLE.\r\nC++ LZMA code is just wrapper over ANSI-C code.\r\n\r\n\r\nC++ Notes\r\n~~~~~~~~~~~~~~~~~~~~~~~~\r\nIf you use some C++ code folders in 7-Zip (for example, C++ code for .7z handling),\r\nyou must check that you correctly work with \"new\" operator.\r\n7-Zip can be compiled with MSVC 6.0 that doesn't throw \"exception\" from \"new\" operator.\r\nSo 7-Zip uses \"CPP\\Common\\NewHandler.cpp\" that redefines \"new\" operator:\r\noperator new(size_t size)\r\n{\r\n  void *p = ::malloc(size);\r\n  if (p == 0)\r\n    throw CNewException();\r\n  return p;\r\n}\r\nIf you use MSCV that throws exception for \"new\" operator, you can compile without \r\n\"NewHandler.cpp\". So standard exception will be used. Actually some code of \r\n7-Zip catches any exception in internal code and converts it to HRESULT code.\r\nSo you don't need to catch CNewException, if you call COM interfaces of 7-Zip.\r\n\r\n---\r\n\r\nhttp://www.7-zip.org\r\nhttp://www.7-zip.org/sdk.html\r\nhttp://www.7-zip.org/support.html\r\n"
  },
  {
    "path": "ext/makefile.msvc",
    "content": "# include this after mupdf\\makefile.msvc\r\n\r\n!if \"$(O)\"==\"\"\r\n!error Include mupdf\\makefile.msvc first (or build ..\\makefile.msvc instead)\r\n!endif\r\n\r\nOE = $(O)\\ext\r\nOBZ= $(O)\\bzip2\r\nODV= $(O)\\djvu\r\nOC = $(O)\\chmlib\r\nOLZ= $(O)\\lzma\r\nOWP= $(O)\\webp\r\nOUN= $(O)\\unarr\r\n\r\nSYNCTEX_CFLAGS = $(CFLAGS) /TC /I$(EXTDIR)/synctex /I$(ZLIB_DIR) /wd4100 /wd4127 /wd4244 /wd4702 /wd4706 /wd4819 /wd4996\r\n!if \"$(PLATFORM)\"==\"X64\"\r\nSYNCTEX_CFLAGS = $(SYNCTEX_CFLAGS) /wd4267\r\n!endif\r\n\r\nBZIP2_CFLAGS = $(CFLAGSOPT) /TC /D \"BZ_NO_STDIO\" /D \"BZ_DEBUG=0\" /wd4100 /wd4127 /wd4244 /wd4701\r\n\r\nDJVU_CFLAGS = $(CFLAGSOPT) /D \"NEED_JPEG_DECODER\" /I$(JPEG_TURBO_DIR)\r\nDJVU_CFLAGS = $(DJVU_CFLAGS) /wd4100 /wd4127 /wd4189 /wd4244 /wd4512 /wd4611 /wd4701 /wd4702 /wd4703 /wd4706 /wd4996\r\nDJVU_CFLAGS = $(DJVU_CFLAGS) /D \"THREADMODEL=0\" /D \"DDJVUAPI=/**/\" /D \"MINILISPAPI=/**/\"\r\n# prevent libdjvu from changing the C locale from underneath anybody else\r\nDJVU_CFLAGS = $(DJVU_CFLAGS) /D \"DO_CHANGELOCALE=0\"\r\n# a hack to enable C++ exception handling for libdjvu (without triggering a warning)\r\nDJVU_CFLAGS = $(DJVU_CFLAGS:/EHs-c-=/EHsc)\r\n!if \"$(PLATFORM)\"==\"X64\"\r\nDJVU_CFLAGS = $(DJVU_CFLAGS) /wd4267\r\n!endif\r\n# VS 2015 only\r\n# 4456 : declaration of '*' hides previous local declaration\r\n# 4457 : declaration of '*' hides function parameter\r\n# 4459 : declaration of '*' hides global declaration\r\nDJVU_CFLAGS = $(DJVU_CFLAGS) /wd4456 /wd4457 /wd4459\r\n\r\nCHMLIB_CFLAGS = $(CFLAGS) /TC /wd4018 /wd4057 /wd4127 /wd4189 /wd4244 /wd4295 /wd4701 /wd4706 /wd4996\r\n# ChmLib also needs PPC_BSTR defined for UNICODE builds\r\nCHMLIB_CFLAGS = $(CHMLIB_CFLAGS) /D \"UNICODE\" /D \"_UNICODE\" /D \"PPC_BSTR\"\r\n!if \"$(PLATFORM)\"==\"X64\"\r\nCHMLIB_CFLAGS = $(CHMLIB_CFLAGS) /wd4267\r\n!endif\r\n\r\nLZMA_CFLAGS = $(CFLAGSOPT) /TC /I$(EXTDIR)/lzma/C /D \"_7ZIP_PPMD_SUPPPORT\"\r\n# VS 2015 only\r\n# 4456 : declaration of '*' hides previous local declaration\r\n# 4457 : declaration of '*' hides function parameter\r\nLZMA_CFLAGS = $(LZMA_CFLAGS) /wd4456 /wd4457\r\n\r\nWEBP_CFLAGS = $(CFLAGSOPT) /TC /I$(EXTDIR)/libwebp /wd4057 /wd4127 /wd4204 /wd4244\r\n\r\nUNARR_CFLAGS = $(CFLAGS) /TC /I$(EXTDIR)/unarr /wd4996\r\nUNARR_CFLAGS = $(UNARR_CFLAGS) /D \"HAVE_ZLIB\" /I$(ZLIB_DIR)\r\nUNARR_CFLAGS = $(UNARR_CFLAGS) /D \"HAVE_BZIP2\" /I$(EXTDIR)/bzip2\r\nUNARR_CFLAGS = $(UNARR_CFLAGS) /D \"HAVE_7Z\" /I$(EXTDIR)/lzma/C\r\n\r\n\r\nSYNCTEX_OBJS = \\\r\n\t$(OE)\\synctex_parser.obj $(OE)\\synctex_parser_utils.obj\r\n\r\nBZIP2_OBJS = \\\r\n\t$(OBZ)\\bzip_all.obj\r\n\r\n#\t$(OBZ)\\blocksort.obj $(OBZ)\\bzlib.obj $(OBZ)\\compress.obj $(OBZ)\\crctable.obj \\\r\n#\t$(OBZ)\\decompress.obj $(OBZ)\\huffman.obj $(OBZ)\\randtable.obj $(OBZ)\\bz_internal_error.obj\r\n\r\n# Note: in theory using compiling all djvu files as one should generate smaller\r\n# code, but it does just the opposite. Why?\r\n!if \"$(COMPACT_DJVU)\" == \"yes\"\r\nDJVU_OBJS = \\\r\n\t$(ODV)\\djvu_all.obj $(ODV)\\DjVuDocEditor.obj $(ODV)\\DjVuDocument.obj \\\r\n\t$(ODV)\\DjVuMessageLite.obj $(ODV)\\DjVuToPS.obj $(ODV)\\GMapAreas.obj \\\r\n\t$(ODV)\\GPixmap.obj $(ODV)\\GScaler.obj $(ODV)\\GURL.obj $(ODV)\\IW44EncodeCodec.obj \\\r\n\t$(ODV)\\IW44Image.obj $(ODV)\\JB2Image.obj $(ODV)\\JPEGDecoder.obj \\\r\n\t$(ODV)\\XMLParser.obj $(ODV)\\miniexp.obj\r\n!else\r\nDJVU_OBJS = \\\r\n\t$(ODV)\\Arrays.obj $(ODV)\\atomic.obj $(ODV)\\BSByteStream.obj \\\r\n\t$(ODV)\\BSEncodeByteStream.obj $(ODV)\\ByteStream.obj $(ODV)\\DataPool.obj \\\r\n\t$(ODV)\\DjVmDir0.obj $(ODV)\\DjVmDoc.obj $(ODV)\\DjVmNav.obj \\\r\n\t$(ODV)\\DjVuAnno.obj $(ODV)\\DjVuDocEditor.obj $(ODV)\\DjVuDocument.obj \\\r\n\t$(ODV)\\DjVuDumpHelper.obj $(ODV)\\DjVuErrorList.obj $(ODV)\\DjVuFile.obj \\\r\n\t$(ODV)\\DjVuFileCache.obj $(ODV)\\DjVuGlobal.obj $(ODV)\\DjVuGlobalMemory.obj \\\r\n\t$(ODV)\\DjVuImage.obj $(ODV)\\DjVuInfo.obj $(ODV)\\DjVuMessage.obj \\\r\n\t$(ODV)\\DjVuMessageLite.obj $(ODV)\\DjVuNavDir.obj $(ODV)\\DjVuPalette.obj \\\r\n\t$(ODV)\\DjVuPort.obj $(ODV)\\DjVuText.obj $(ODV)\\DjVuToPS.obj \\\r\n\t$(ODV)\\GBitmap.obj $(ODV)\\GContainer.obj $(ODV)\\GException.obj \\\r\n\t$(ODV)\\GIFFManager.obj $(ODV)\\GMapAreas.obj $(ODV)\\GOS.obj \\\r\n\t$(ODV)\\GPixmap.obj $(ODV)\\GRect.obj $(ODV)\\GScaler.obj \\\r\n\t$(ODV)\\GSmartPointer.obj $(ODV)\\GString.obj $(ODV)\\GThreads.obj \\\r\n\t$(ODV)\\GUnicode.obj $(ODV)\\GURL.obj $(ODV)\\IFFByteStream.obj \\\r\n\t$(ODV)\\IW44EncodeCodec.obj $(ODV)\\IW44Image.obj $(ODV)\\JB2EncodeCodec.obj \\\r\n\t$(ODV)\\DjVmDir.obj $(ODV)\\JB2Image.obj $(ODV)\\JPEGDecoder.obj \\\r\n\t$(ODV)\\MMRDecoder.obj $(ODV)\\MMX.obj $(ODV)\\UnicodeByteStream.obj \\\r\n\t$(ODV)\\XMLParser.obj $(ODV)\\XMLTags.obj $(ODV)\\ZPCodec.obj \\\r\n\t$(ODV)\\ddjvuapi.obj $(ODV)\\debug.obj $(ODV)\\miniexp.obj\r\n!endif\r\n\r\nCHMLIB_OBJS = \\\r\n\t$(OC)\\chm_lib.obj $(OC)\\lzx.obj\r\n\r\nLZMA_OBJS = \\\r\n\t$(OLZ)\\LzmaDec.obj $(OLZ)\\Bra86.obj \\\r\n\t$(OLZ)\\LzmaEnc.obj $(OLZ)\\LzFind.obj $(OLZ)\\LzFindMt.obj $(OLZ)\\Threads.obj\r\n\r\n_7Z_OBJS = \\\r\n\t$(OLZ)\\7zBuf.obj $(OLZ)\\7zDec.obj $(OLZ)\\7zIn.obj $(OLZ)\\7zStream.obj \\\r\n\t$(OLZ)\\Bcj2.obj $(OLZ)\\Bra.obj $(OLZ)\\Lzma2Dec.obj\r\n\r\nWEBP_OBJS = \\\r\n\t$(OWP)\\alpha.obj $(OWP)\\buffer.obj $(OWP)\\frame.obj $(OWP)\\idec.obj \\\r\n\t$(OWP)\\io.obj $(OWP)\\quant.obj $(OWP)\\tree.obj \\\r\n\t$(OWP)\\vp8.obj $(OWP)\\vp8l.obj $(OWP)\\webp.obj \\\r\n\t$(OWP)\\alpha_processing.obj $(OWP)\\cpu.obj $(OWP)\\dec.obj $(OWP)\\dec_sse2.obj \\\r\n\t$(OWP)\\lossless.obj $(OWP)\\lossless_sse2.obj $(OWP)\\upsampling.obj \\\r\n\t$(OWP)\\upsampling_sse2.obj $(OWP)\\yuv.obj $(OWP)\\yuv_sse2.obj \\\r\n\t$(OWP)\\dec_clip_tables.obj $(OWP)\\alpha_processing_sse2.obj \\\r\n\t$(OWP)\\bit_reader.obj $(OWP)\\color_cache.obj $(OWP)\\filters.obj \\\r\n\t$(OWP)\\huffman.obj $(OWP)\\quant_levels_dec.obj $(OWP)\\rescaler.obj \\\r\n\t$(OWP)\\thread.obj $(OWP)\\utils.obj $(OWP)\\random.obj\r\n\t\r\n\r\nUNARR_OBJS = \\\r\n\t$(OUN)\\conv.obj $(OUN)\\crc32.obj $(OUN)\\stream.obj $(OUN)\\unarr.obj \\\r\n\t$(OUN)\\CpuArch.obj $(OUN)\\Ppmd7.obj $(OUN)\\Ppmd7Dec.obj \\\r\n\t$(OUN)\\Ppmd8.obj $(OUN)\\Ppmd8Dec.obj \\\r\n\t$(OUN)\\filter-rar.obj $(OUN)\\parse-rar.obj $(OUN)\\rar.obj \\\r\n\t$(OUN)\\rarvm.obj $(OUN)\\uncompress-rar.obj $(OUN)\\huffman-rar.obj \\\r\n\t$(OUN)\\parse-zip.obj $(OUN)\\uncompress-zip.obj $(OUN)\\zip.obj \\\r\n\t$(OUN)\\_7z.obj $(OUN)\\tar.obj $(OUN)\\parse-tar.obj $(OUN)\\inflate.obj\r\n\r\n$(OE): force\r\n\t@if not exist $(OE) mkdir $(OE)\r\n\t@if not exist $(OBZ) mkdir $(OBZ)\r\n\t@if not exist $(ODV) mkdir $(ODV)\r\n\t@if not exist $(OC) mkdir $(OC)\r\n\t@if not exist $(OLZ) mkdir $(OLZ)\r\n\t@if not exist $(OWP) mkdir $(OWP)\r\n\t@if not exist $(OUN) mkdir $(OUN)\r\n\r\n{$(EXTDIR)\\bzip2}.c{$(OBZ)}.obj::\r\n\t$(CC) $(BZIP2_CFLAGS) /Fo$(OBZ)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(EXTDIR)\\synctex}.c{$(OE)}.obj::\r\n\t$(CC) $(SYNCTEX_CFLAGS) /Fo$(OE)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(EXTDIR)\\libdjvu}.cpp{$(ODV)}.obj::\r\n\t$(CC) $(DJVU_CFLAGS) /Fo$(ODV)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(EXTDIR)\\CHMLib\\src}.c{$(OC)}.obj::\r\n\t$(CC) $(CHMLIB_CFLAGS) /Fo$(OC)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(EXTDIR)\\lzma\\C}.c{$(OLZ)}.obj::\r\n\t$(CC) $(LZMA_CFLAGS) /Fo$(OLZ)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(EXTDIR)\\libwebp\\dec}.c{$(OWP)}.obj::\r\n\t$(CC) $(WEBP_CFLAGS) /Fo$(OWP)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(EXTDIR)\\libwebp\\dsp}.c{$(OWP)}.obj::\r\n\t$(CC) $(WEBP_CFLAGS) /Fo$(OWP)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(EXTDIR)\\libwebp\\utils}.c{$(OWP)}.obj::\r\n\t$(CC) $(WEBP_CFLAGS) /Fo$(OWP)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(EXTDIR)\\unarr\\common}.c{$(OUN)}.obj::\r\n\t$(CC) $(UNARR_CFLAGS) /Fo$(OUN)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(EXTDIR)\\unarr\\lzmasdk}.c{$(OUN)}.obj::\r\n\t$(CC) $(UNARR_CFLAGS) /Fo$(OUN)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(EXTDIR)\\unarr\\rar}.c{$(OUN)}.obj::\r\n\t$(CC) $(UNARR_CFLAGS) /Fo$(OUN)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(EXTDIR)\\unarr\\tar}.c{$(OUN)}.obj::\r\n\t$(CC) $(UNARR_CFLAGS) /Fo$(OUN)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(EXTDIR)\\unarr\\zip}.c{$(OUN)}.obj::\r\n\t$(CC) $(UNARR_CFLAGS) /Fo$(OUN)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(EXTDIR)\\unarr\\_7z}.c{$(OUN)}.obj::\r\n\t$(CC) $(UNARR_CFLAGS) /Fo$(OUN)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n# executable(s) for testing the above libraries\r\n\r\nunarr_test: $(O) $(OE) $(O)\\unarr.exe\r\n\r\n{$(EXTDIR)\\unarr}.c{$(OUN)}.obj::\r\n\t$(CC) $(UNARR_CFLAGS) /Fo$(OUN)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n$(O)\\unarr.exe: $(UNARR_OBJS) $(OUN)\\main.obj $(ZLIB_OBJS) $(BZIP2_OBJS) $(LZMA_OBJS) $(_7Z_OBJS)\r\n\t$(LD) $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@ /SUBSYSTEM:CONSOLE\r\n"
  },
  {
    "path": "ext/openjpeg/CMakeLists.txt",
    "content": "include_regular_expression(\"^.*$\")\n\n#\ninstall( FILES  ${CMAKE_CURRENT_BINARY_DIR}/opj_config.h\n DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR} COMPONENT Headers)\n\ninclude_directories(\n  ${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h and opj_config_private.h\n)\n# Defines the source code for the library\nset(OPENJPEG_SRCS\n  ${CMAKE_CURRENT_SOURCE_DIR}/bio.c\n  ${CMAKE_CURRENT_SOURCE_DIR}/cio.c\n  ${CMAKE_CURRENT_SOURCE_DIR}/dwt.c\n  ${CMAKE_CURRENT_SOURCE_DIR}/event.c\n  ${CMAKE_CURRENT_SOURCE_DIR}/image.c\n  ${CMAKE_CURRENT_SOURCE_DIR}/invert.c\n  ${CMAKE_CURRENT_SOURCE_DIR}/j2k.c\n  ${CMAKE_CURRENT_SOURCE_DIR}/jp2.c\n  ${CMAKE_CURRENT_SOURCE_DIR}/mct.c\n  ${CMAKE_CURRENT_SOURCE_DIR}/mqc.c\n  ${CMAKE_CURRENT_SOURCE_DIR}/openjpeg.c\n  ${CMAKE_CURRENT_SOURCE_DIR}/opj_clock.c\n  ${CMAKE_CURRENT_SOURCE_DIR}/pi.c\n  ${CMAKE_CURRENT_SOURCE_DIR}/raw.c\n  ${CMAKE_CURRENT_SOURCE_DIR}/t1.c\n  ${CMAKE_CURRENT_SOURCE_DIR}/t2.c\n  ${CMAKE_CURRENT_SOURCE_DIR}/tcd.c\n  ${CMAKE_CURRENT_SOURCE_DIR}/tgt.c\n  ${CMAKE_CURRENT_SOURCE_DIR}/function_list.c\n)\nif(BUILD_JPIP)\n  add_definitions(-DUSE_JPIP)\n  set(OPENJPEG_SRCS\n    ${OPENJPEG_SRCS}\n    ${CMAKE_CURRENT_SOURCE_DIR}/cidx_manager.c\n    ${CMAKE_CURRENT_SOURCE_DIR}/phix_manager.c\n    ${CMAKE_CURRENT_SOURCE_DIR}/ppix_manager.c\n    ${CMAKE_CURRENT_SOURCE_DIR}/thix_manager.c\n    ${CMAKE_CURRENT_SOURCE_DIR}/tpix_manager.c\n  )\nendif()\n\n# Build the library\nif(WIN32)\n  if(BUILD_SHARED_LIBS)\n    add_definitions(-DOPJ_EXPORTS)\n  else()\n    add_definitions(-DOPJ_STATIC)\n  endif()\nendif()\nadd_library(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS})\nif(UNIX)\n  target_link_libraries(${OPENJPEG_LIBRARY_NAME} m)\nendif()\nset_target_properties(${OPENJPEG_LIBRARY_NAME} PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})\n\n# Install library\ninstall(TARGETS ${OPENJPEG_LIBRARY_NAME}\n  EXPORT OpenJPEGTargets\n  RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications\n  LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries\n  ARCHIVE DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries\n)\n\n# Install includes files\ninstall(FILES openjpeg.h opj_stdint.h\n  DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR} COMPONENT Headers\n)\n\nif(BUILD_DOC)\n# install man page of the library\ninstall(\n  FILES       ${OPENJPEG_SOURCE_DIR}/doc/man/man3/libopenjp2.3\n  DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man3)\nendif()\n\n# internal utilities to generate t1_luts.h (part of the jp2 lib)\n# no need to install:\nadd_executable(t1_generate_luts t1_generate_luts.c)\nif(UNIX)\n  target_link_libraries(t1_generate_luts m)\nendif()\n\n# Experimental option; let's how cppcheck performs\n# Implementation details:\n# I could not figure out how to easily upload a file to CDash. Instead simply\n# pretend cppcheck is part of the Build step. Technically cppcheck can even\n# output gcc formatted error/warning report\n# Another implementation detail: I could not redirect error to the error\n# catching mechanism something is busted in cmake 2.8.5, I had to use the\n# warning regex to catch them.\nif(OPENJPEG_CPPCHECK)\n  find_package(CPPCHECK REQUIRED)\n  foreach(f ${OPENJPEG_SRCS})\n    # cppcheck complains about too many configuration, pretend to be WIN32:\n    add_custom_command(TARGET ${OPENJPEG_LIBRARY_NAME}\n      COMMAND ${CPPCHECK_EXECUTABLE} -DWIN32 ${f})\n  endforeach()\nendif()\n"
  },
  {
    "path": "ext/openjpeg/LICENSE",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2003-2009, Francois-Olivier Devaux\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France \n * Copyright (c) 2012, CS Systemes d'Information, France\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n"
  },
  {
    "path": "ext/openjpeg/bio.c",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include \"opj_includes.h\"\n\n/** @defgroup BIO BIO - Individual bit input-output stream */\n/*@{*/\n\n/** @name Local static functions */\n/*@{*/\n\n/**\nWrite a bit\n@param bio BIO handle\n@param b Bit to write (0 or 1)\n*/\nstatic void opj_bio_putbit(opj_bio_t *bio, OPJ_UINT32 b);\n/**\nRead a bit\n@param bio BIO handle\n@return Returns the read bit\n*/\nstatic OPJ_UINT32 opj_bio_getbit(opj_bio_t *bio);\n/**\nWrite a byte\n@param bio BIO handle\n@return Returns OPJ_TRUE if successful, returns OPJ_FALSE otherwise\n*/\nstatic OPJ_BOOL opj_bio_byteout(opj_bio_t *bio);\n/**\nRead a byte\n@param bio BIO handle\n@return Returns OPJ_TRUE if successful, returns OPJ_FALSE otherwise\n*/\nstatic OPJ_BOOL opj_bio_bytein(opj_bio_t *bio);\n\n/*@}*/\n\n/*@}*/\n\n/* \n==========================================================\n   local functions\n==========================================================\n*/\n\nOPJ_BOOL opj_bio_byteout(opj_bio_t *bio) {\n\tbio->buf = (bio->buf << 8) & 0xffff;\n\tbio->ct = bio->buf == 0xff00 ? 7 : 8;\n\tif (bio->bp >= bio->end) {\n\t\treturn OPJ_FALSE;\n\t}\n\t*bio->bp++ = (OPJ_BYTE)(bio->buf >> 8);\n\treturn OPJ_TRUE;\n}\n\nOPJ_BOOL opj_bio_bytein(opj_bio_t *bio) {\n\tbio->buf = (bio->buf << 8) & 0xffff;\n\tbio->ct = bio->buf == 0xff00 ? 7 : 8;\n\tif (bio->bp >= bio->end) {\n\t\treturn OPJ_FALSE;\n\t}\n\tbio->buf |= *bio->bp++;\n\treturn OPJ_TRUE;\n}\n\nvoid opj_bio_putbit(opj_bio_t *bio, OPJ_UINT32 b) {\n\tif (bio->ct == 0) {\n\t\topj_bio_byteout(bio); /* MSD: why not check the return value of this function ? */\n\t}\n\tbio->ct--;\n\tbio->buf |= b << bio->ct;\n}\n\nOPJ_UINT32 opj_bio_getbit(opj_bio_t *bio) {\n\tif (bio->ct == 0) {\n\t\topj_bio_bytein(bio); /* MSD: why not check the return value of this function ? */\n\t}\n\tbio->ct--;\n\treturn (bio->buf >> bio->ct) & 1;\n}\n\n/* \n==========================================================\n   Bit Input/Output interface\n==========================================================\n*/\n\nopj_bio_t* opj_bio_create(void) {\n\topj_bio_t *bio = (opj_bio_t*)opj_malloc(sizeof(opj_bio_t));\n\treturn bio;\n}\n\nvoid opj_bio_destroy(opj_bio_t *bio) {\n\tif(bio) {\n\t\topj_free(bio);\n\t}\n}\n\nptrdiff_t opj_bio_numbytes(opj_bio_t *bio) {\n\treturn (bio->bp - bio->start);\n}\n\nvoid opj_bio_init_enc(opj_bio_t *bio, OPJ_BYTE *bp, OPJ_UINT32 len) {\n\tbio->start = bp;\n\tbio->end = bp + len;\n\tbio->bp = bp;\n\tbio->buf = 0;\n\tbio->ct = 8;\n}\n\nvoid opj_bio_init_dec(opj_bio_t *bio, OPJ_BYTE *bp, OPJ_UINT32 len) {\n\tbio->start = bp;\n\tbio->end = bp + len;\n\tbio->bp = bp;\n\tbio->buf = 0;\n\tbio->ct = 0;\n}\n\nvoid opj_bio_write(opj_bio_t *bio, OPJ_UINT32 v, OPJ_UINT32 n) {\n\tOPJ_UINT32 i;\n\tfor (i = n - 1; i < n; i--) {\n\t\topj_bio_putbit(bio, (v >> i) & 1);\n\t}\n}\n\nOPJ_UINT32 opj_bio_read(opj_bio_t *bio, OPJ_UINT32 n) {\n\tOPJ_UINT32 i;\n    OPJ_UINT32 v;\n\tv = 0;\n\tfor (i = n - 1; i < n; i--) {\n\t\tv += opj_bio_getbit(bio) << i;\n\t}\n\treturn v;\n}\n\nOPJ_BOOL opj_bio_flush(opj_bio_t *bio) {\n\tbio->ct = 0;\n\tif (! opj_bio_byteout(bio)) {\n\t\treturn OPJ_FALSE;\n\t}\n\tif (bio->ct == 7) {\n\t\tbio->ct = 0;\n\t\tif (! opj_bio_byteout(bio)) {\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\t}\n\treturn OPJ_TRUE;\n}\n\nOPJ_BOOL opj_bio_inalign(opj_bio_t *bio) {\n\tbio->ct = 0;\n\tif ((bio->buf & 0xff) == 0xff) {\n\t\tif (! opj_bio_bytein(bio)) {\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\t\tbio->ct = 0;\n\t}\n\treturn OPJ_TRUE;\n}\n"
  },
  {
    "path": "ext/openjpeg/bio.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef __BIO_H\n#define __BIO_H\n\n#include <stddef.h> /* ptrdiff_t */\n\n/** \n@file bio.h\n@brief Implementation of an individual bit input-output (BIO)\n\nThe functions in BIO.C have for goal to realize an individual bit input - output.\n*/\n\n/** @defgroup BIO BIO - Individual bit input-output stream */\n/*@{*/\n\n/**\nIndividual bit input-output stream (BIO)\n*/\ntypedef struct opj_bio {\n\t/** pointer to the start of the buffer */\n\tOPJ_BYTE *start;\n\t/** pointer to the end of the buffer */\n\tOPJ_BYTE *end;\n\t/** pointer to the present position in the buffer */\n\tOPJ_BYTE *bp;\n\t/** temporary place where each byte is read or written */\n\tOPJ_UINT32 buf;\n\t/** coder : number of bits free to write. decoder : number of bits read */\n\tOPJ_UINT32 ct;\n} opj_bio_t;\n\n/** @name Exported functions */\n/*@{*/\n/* ----------------------------------------------------------------------- */\n/**\nCreate a new BIO handle \n@return Returns a new BIO handle if successful, returns NULL otherwise\n*/\nopj_bio_t* opj_bio_create(void);\n/**\nDestroy a previously created BIO handle\n@param bio BIO handle to destroy\n*/\nvoid opj_bio_destroy(opj_bio_t *bio);\n/**\nNumber of bytes written.\n@param bio BIO handle\n@return Returns the number of bytes written\n*/\nptrdiff_t opj_bio_numbytes(opj_bio_t *bio);\n/**\nInit encoder\n@param bio BIO handle\n@param bp Output buffer\n@param len Output buffer length \n*/\nvoid opj_bio_init_enc(opj_bio_t *bio, OPJ_BYTE *bp, OPJ_UINT32 len);\n/**\nInit decoder\n@param bio BIO handle\n@param bp Input buffer\n@param len Input buffer length \n*/\nvoid opj_bio_init_dec(opj_bio_t *bio, OPJ_BYTE *bp, OPJ_UINT32 len);\n/**\nWrite bits\n@param bio BIO handle\n@param v Value of bits\n@param n Number of bits to write\n*/\nvoid opj_bio_write(opj_bio_t *bio, OPJ_UINT32 v, OPJ_UINT32 n);\n/**\nRead bits\n@param bio BIO handle\n@param n Number of bits to read \n@return Returns the corresponding read number\n*/\nOPJ_UINT32 opj_bio_read(opj_bio_t *bio, OPJ_UINT32 n);\n/**\nFlush bits\n@param bio BIO handle\n@return Returns OPJ_TRUE if successful, returns OPJ_FALSE otherwise\n*/\nOPJ_BOOL opj_bio_flush(opj_bio_t *bio);\n/**\nPasses the ending bits (coming from flushing)\n@param bio BIO handle\n@return Returns OPJ_TRUE if successful, returns OPJ_FALSE otherwise\n*/\nOPJ_BOOL opj_bio_inalign(opj_bio_t *bio);\n/* ----------------------------------------------------------------------- */\n/*@}*/\n\n/*@}*/\n\n#endif /* __BIO_H */\n\n"
  },
  {
    "path": "ext/openjpeg/cidx_manager.c",
    "content": "/*\n * $Id: cidx_manager.c 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2003-2004, Yannick Verschueren\n * Copyright (c) 2010-2011, Kaori Hagihara\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include \"opj_includes.h\"\n\n\n/* \n * Write CPTR Codestream finder box\n *\n * @param[in] coff offset of j2k codestream\n * @param[in] clen length of j2k codestream\n * @param[in] cio  file output handle\n */\n\nvoid opj_write_cptr(int coff, int clen, opj_stream_private_t *cio,\n              opj_event_mgr_t * p_manager );\n\n\n\n\n\nint opj_write_cidx( int offset, opj_stream_private_t *cio, opj_codestream_info_t cstr_info, int j2klen,\n              opj_event_mgr_t * p_manager )\n{\n  int i;\n  OPJ_OFF_T lenp;\n  OPJ_UINT32 len;\n  opj_jp2_box_t *box;\n  int num_box = 0;\n  OPJ_BOOL  EPHused;\n  OPJ_BYTE l_data_header [4];\n\n  lenp = -1;\n  box = (opj_jp2_box_t *)opj_calloc( 32, sizeof(opj_jp2_box_t));\n\n  for (i=0;i<2;i++){\n  \n    if(i)\n      opj_stream_seek(cio,lenp,p_manager);\n\n\n    lenp = opj_stream_tell (cio);\n\n    opj_stream_skip(cio, 4, p_manager); /* L [at the end] */\n\n    opj_write_bytes(l_data_header,JPIP_CIDX,4); /* CIDX */\n    opj_stream_write_data(cio,l_data_header,4,p_manager);\n\n    opj_write_cptr( offset, cstr_info.codestream_size, cio,p_manager);\n\n    opj_write_manf( i, num_box, box, cio,p_manager);\n    \n    num_box = 0;\n    box[num_box].length = (OPJ_UINT32)opj_write_mainmhix( offset, cstr_info, cio,p_manager);\n    box[num_box].type = JPIP_MHIX;\n    num_box++;\n\n    box[num_box].length = (OPJ_UINT32)opj_write_tpix( offset, cstr_info, j2klen, cio,p_manager);\n    box[num_box].type = JPIP_TPIX;\n    num_box++;\n      \n    box[num_box].length = (OPJ_UINT32)opj_write_thix( offset, cstr_info, cio, p_manager);\n    box[num_box].type = JPIP_THIX;\n    num_box++;\n\n    EPHused = opj_check_EPHuse( offset, cstr_info.marker, cstr_info.marknum, cio,p_manager);\n      \n    box[num_box].length = (OPJ_UINT32)opj_write_ppix( offset, cstr_info, EPHused, j2klen, cio,p_manager);\n    box[num_box].type = JPIP_PPIX;\n    num_box++;\n    \n    box[num_box].length = (OPJ_UINT32)opj_write_phix( offset, cstr_info, EPHused, j2klen, cio,p_manager);\n    box[num_box].type = JPIP_PHIX;\n    num_box++;\n      \n    len = (OPJ_UINT32) (opj_stream_tell(cio)-lenp);\n    opj_stream_seek(cio, lenp,p_manager);\n    opj_write_bytes(l_data_header,len,4);/* L  */\n    opj_stream_write_data(cio,l_data_header,4,p_manager);\n    opj_stream_seek(cio, lenp+len,p_manager);\n  }\n\n  opj_free( box);\n  \n  return (int)len;\n}\n\n\n\nvoid opj_write_cptr(int coff, int clen, opj_stream_private_t *cio,\n              opj_event_mgr_t * p_manager )\n{\n  OPJ_BYTE l_data_header [3*8];\n  OPJ_UINT32 len;\n  OPJ_OFF_T lenp;\n\n\n  lenp = opj_stream_tell(cio);\n  opj_stream_skip( cio, 4, p_manager);               /* L [at the end]     */\n  opj_write_bytes( l_data_header, JPIP_CPTR, 4);   /* T                  */\n  opj_write_bytes( l_data_header+4, 0, 2);           /* DR  A PRECISER !!  */\n  opj_write_bytes( l_data_header+6, 0, 2);           /* CONT               */\n  opj_write_bytes( l_data_header+8, (OPJ_UINT32)coff, 8);    /* COFF A PRECISER !! */\n  opj_write_bytes( l_data_header+16, (OPJ_UINT32)clen, 8);    /* CLEN               */\n  opj_stream_write_data(cio,l_data_header,3*8,p_manager);\n\n  len = (OPJ_UINT32) (opj_stream_tell(cio) - lenp);\n  opj_stream_seek(cio,lenp,p_manager);\n  opj_write_bytes(l_data_header, len, 4);         /* L                  */\n  opj_stream_write_data(cio,l_data_header,4,p_manager);\n  opj_stream_seek(cio, lenp+len,p_manager);\n\n}\n\n\n\nvoid opj_write_manf(int second, \n                    int v, \n                    opj_jp2_box_t *box, \n                    opj_stream_private_t *cio,\n                    opj_event_mgr_t * p_manager )\n{\n  OPJ_BYTE l_data_header [4];\n  int i;\n  OPJ_UINT32 len;\n  OPJ_OFF_T lenp;\n  \n  lenp = opj_stream_tell(cio);\n  opj_stream_skip( cio, 4, p_manager);             /* L [at the end]     */\n  opj_write_bytes( l_data_header, JPIP_MANF, 4);   /* T                  */\n  opj_stream_write_data(cio,l_data_header,4,p_manager);\n\n  if (second){                          /* Write only during the second pass */\n    for( i=0; i<v; i++){\n      opj_write_bytes( l_data_header, box[i].length, 4); /* Box length                     */\n      opj_stream_write_data(cio,l_data_header,4,p_manager);\n      opj_write_bytes( l_data_header, box[i].type, 4); /* Box type                       */\n      opj_stream_write_data(cio,l_data_header,4,p_manager);\n    }\n  }\n\n  len = (OPJ_UINT32) (opj_stream_tell(cio) - lenp);\n  opj_stream_seek(cio,lenp,p_manager);\n  opj_write_bytes(l_data_header, len, 4);/* L                                 */\n  opj_stream_write_data(cio,l_data_header,4,p_manager);\n  opj_stream_seek(cio,lenp+len,p_manager);\n}\n\n\nint opj_write_mainmhix( int coff, opj_codestream_info_t cstr_info, opj_stream_private_t *cio,\n              opj_event_mgr_t * p_manager )\n{\n  OPJ_BYTE l_data_header [8];\n  OPJ_UINT32 i;\n  OPJ_UINT32 len;\n  OPJ_OFF_T lenp;\n  \n  lenp = opj_stream_tell (cio);\n  opj_stream_skip(cio, 4, p_manager);               /* L [at the end]                    */\n  opj_write_bytes(l_data_header,JPIP_MHIX,4);       /* MHIX                              */\n  opj_stream_write_data(cio,l_data_header,4,p_manager);\n\n  opj_write_bytes(l_data_header, (OPJ_UINT32)(cstr_info.main_head_end-cstr_info.main_head_start+1), 8);        /* TLEN                              */\n  opj_stream_write_data(cio,l_data_header,8,p_manager);\n\n  for(i = 1; i < (OPJ_UINT32)cstr_info.marknum; i++){    /* Marker restricted to 1 apparition, skip SOC marker */\n    opj_write_bytes( l_data_header, cstr_info.marker[i].type, 2);\n    opj_write_bytes( l_data_header+2, 0, 2);\n    opj_stream_write_data(cio,l_data_header,4,p_manager);\n    opj_write_bytes( l_data_header,(OPJ_UINT32) (cstr_info.marker[i].pos-coff), 8);\n    opj_stream_write_data(cio,l_data_header,8,p_manager);\n    opj_write_bytes( l_data_header, (OPJ_UINT32)cstr_info.marker[i].len, 2);\n    opj_stream_write_data(cio,l_data_header,2,p_manager);\n  }\n\n  len = (OPJ_UINT32) (opj_stream_tell(cio)-lenp);\n  opj_stream_seek(cio, lenp,p_manager);\n  opj_write_bytes(l_data_header,len,4);/* L  */\n  opj_stream_write_data(cio,l_data_header,4,p_manager);\n  opj_stream_seek(cio, lenp+len,p_manager);\n  \n  return (int)len;\n}\n\nOPJ_BOOL opj_check_EPHuse( int coff, opj_marker_info_t *markers, int marknum, opj_stream_private_t *cio,\n              opj_event_mgr_t * p_manager )\n{\n  OPJ_BYTE l_data_header [4];\n  OPJ_BOOL EPHused = OPJ_FALSE;\n  int i=0;\n  OPJ_OFF_T org_pos;\n  unsigned int Scod;\n\n  for(i = 0; i < marknum; i++)\n    {\n    if( markers[i].type == J2K_MS_COD)\n      {\n      org_pos = opj_stream_tell(cio);\n      opj_stream_seek(cio, coff+markers[i].pos+2,p_manager);\n\n      opj_stream_read_data(cio,l_data_header,1,p_manager);\n      opj_read_bytes(l_data_header,&Scod,1);\n      if( ((Scod >> 2) & 1))\n        EPHused = OPJ_TRUE;\n      opj_stream_seek( cio, org_pos, p_manager);\n\n      break;\n      }\n    }    \n  return EPHused;\n}\n"
  },
  {
    "path": "ext/openjpeg/cidx_manager.h",
    "content": "/*\n * $Id: cidx_manager.h 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2003-2004, Yannick Verschueren\n * Copyright (c) 2010-2011, Kaori Hagihara\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*! \\file\n *  \\brief Modification of jpip.h from 2KAN indexer\n */\n\n\n#ifndef  CIDX_MANAGER_H_\n# define CIDX_MANAGER_H_\n\n#include \"openjpeg.h\"\n\n\n/* \n * Write Codestream index box (superbox)\n *\n * @param[in] offset    offset of j2k codestream\n * @param[in] cio       file output handle\n * @param[in] image     image data\n * @param[in] cstr_info codestream information\n * @param[in] j2klen    length of j2k codestream\n * @return              length of cidx box\n */\nint opj_write_cidx( int offset, opj_stream_private_t *cio, opj_codestream_info_t cstr_info, int j2klen,\n              opj_event_mgr_t * p_manager );\n\n/* \n * Check if EPH option is used\n *\n * @param[in] coff    offset of j2k codestream\n * @param[in] markers marker information\n * @param[in] marknum number of markers\n * @param[in] cio     file output handle\n * @return            true if EPH is used\n */\nOPJ_BOOL opj_check_EPHuse( int coff, opj_marker_info_t *markers, int marknum, opj_stream_private_t *cio,\n              opj_event_mgr_t * p_manager );\n\n#endif      /* !CIDX_MANAGER_H_ */\n"
  },
  {
    "path": "ext/openjpeg/cio.c",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR \n * Copyright (c) 2012, CS Systemes d'Information, France\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include \"opj_includes.h\"\n\n/* ----------------------------------------------------------------------- */\n\n\n/* ----------------------------------------------------------------------- */\n\nvoid opj_write_bytes_BE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes)\n{\n\tconst OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value) + p_nb_bytes;\n\n\tassert(p_nb_bytes > 0 && p_nb_bytes <=  sizeof(OPJ_UINT32));\n\n\tmemcpy(p_buffer,l_data_ptr,p_nb_bytes);\n}\n\nvoid opj_write_bytes_LE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes)\n{\n\tconst OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value) + p_nb_bytes - 1;\n\tOPJ_UINT32 i;\n\n\tassert(p_nb_bytes > 0 && p_nb_bytes <= sizeof(OPJ_UINT32));\n\n\tfor\t(i=0;i<p_nb_bytes;++i) {\n\t\t*(p_buffer++) = *(l_data_ptr--);\n\t}\n}\n\nvoid opj_read_bytes_BE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes)\n{\n\tOPJ_BYTE * l_data_ptr = ((OPJ_BYTE *) p_value);\n\n\tassert(p_nb_bytes > 0 && p_nb_bytes <= sizeof(OPJ_UINT32));\n\n\t*p_value = 0;\n\tmemcpy(l_data_ptr+4-p_nb_bytes,p_buffer,p_nb_bytes);\n}\n\nvoid opj_read_bytes_LE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes)\n{\n\tOPJ_BYTE * l_data_ptr = ((OPJ_BYTE *) p_value) + p_nb_bytes-1;\n\tOPJ_UINT32 i;\n\n\tassert(p_nb_bytes > 0 && p_nb_bytes <= sizeof(OPJ_UINT32));\n\n\t*p_value = 0;\n\tfor (i=0;i<p_nb_bytes;++i) {\n\t\t*(l_data_ptr--) = *(p_buffer++);\n\t}\n}\n\nvoid opj_write_double_BE(OPJ_BYTE * p_buffer, OPJ_FLOAT64 p_value)\n{\n\tconst OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value);\n\tmemcpy(p_buffer,l_data_ptr,sizeof(OPJ_FLOAT64));\n}\n\nvoid opj_write_double_LE(OPJ_BYTE * p_buffer, OPJ_FLOAT64 p_value)\n{\n\tconst OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value) + sizeof(OPJ_FLOAT64) - 1;\n\tOPJ_UINT32 i;\n\tfor\t(i=0;i<sizeof(OPJ_FLOAT64);++i) {\n\t\t*(p_buffer++) = *(l_data_ptr--);\n\t}\n}\n\nvoid opj_read_double_BE(const OPJ_BYTE * p_buffer, OPJ_FLOAT64 * p_value)\n{\n\tOPJ_BYTE * l_data_ptr = ((OPJ_BYTE *) p_value);\n\tmemcpy(l_data_ptr,p_buffer,sizeof(OPJ_FLOAT64));\n}\n\nvoid opj_read_double_LE(const OPJ_BYTE * p_buffer, OPJ_FLOAT64 * p_value)\n{\n\tOPJ_BYTE * l_data_ptr = ((OPJ_BYTE *) p_value) + sizeof(OPJ_FLOAT64)-1;\n\tOPJ_UINT32 i;\n\tfor (i=0;i<sizeof(OPJ_FLOAT64);++i) {\n\t\t*(l_data_ptr--) = *(p_buffer++);\n\t}\n}\n\nvoid opj_write_float_BE(OPJ_BYTE * p_buffer, OPJ_FLOAT32 p_value)\n{\n\tconst OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value);\n\tmemcpy(p_buffer,l_data_ptr,sizeof(OPJ_FLOAT32));\n}\n\nvoid opj_write_float_LE(OPJ_BYTE * p_buffer, OPJ_FLOAT32 p_value)\n{\n\tconst OPJ_BYTE * l_data_ptr = ((const OPJ_BYTE *) &p_value) + sizeof(OPJ_FLOAT32) - 1;\n\tOPJ_UINT32 i;\n\tfor\t(i=0;i<sizeof(OPJ_FLOAT32);++i) {\n\t\t*(p_buffer++) = *(l_data_ptr--);\n\t}\n}\n\nvoid opj_read_float_BE(const OPJ_BYTE * p_buffer, OPJ_FLOAT32 * p_value)\n{\n\tOPJ_BYTE * l_data_ptr = ((OPJ_BYTE *) p_value);\n\tmemcpy(l_data_ptr,p_buffer,sizeof(OPJ_FLOAT32));\n}\n\nvoid opj_read_float_LE(const OPJ_BYTE * p_buffer, OPJ_FLOAT32 * p_value)\n{\n\tOPJ_BYTE * l_data_ptr = ((OPJ_BYTE *) p_value) + sizeof(OPJ_FLOAT32)-1;\n\tOPJ_UINT32 i;\n\tfor\t(i=0;i<sizeof(OPJ_FLOAT32);++i) {\n\t\t*(l_data_ptr--) = *(p_buffer++);\n\t}\n}\n\nopj_stream_t* OPJ_CALLCONV opj_stream_create(OPJ_SIZE_T p_buffer_size,OPJ_BOOL l_is_input)\n{\n\topj_stream_private_t * l_stream = 00;\n\tl_stream = (opj_stream_private_t*) opj_malloc(sizeof(opj_stream_private_t));\n\tif (! l_stream) {\n\t\treturn 00;\n\t}\n\n\tmemset(l_stream,0,sizeof(opj_stream_private_t));\n\tl_stream->m_buffer_size = p_buffer_size;\n\tl_stream->m_stored_data = (OPJ_BYTE *) opj_malloc(p_buffer_size);\n\tif (! l_stream->m_stored_data) {\n\t\topj_free(l_stream);\n\t\treturn 00;\n\t}\n\n\tl_stream->m_current_data = l_stream->m_stored_data;\n\n\tif (l_is_input) {\n\t\tl_stream->m_status |= opj_stream_e_input;\n\t\tl_stream->m_opj_skip = opj_stream_read_skip;\n\t\tl_stream->m_opj_seek = opj_stream_read_seek;\n\t}\n\telse {\n\t\tl_stream->m_status |= opj_stream_e_output;\n\t\tl_stream->m_opj_skip = opj_stream_write_skip;\n\t\tl_stream->m_opj_seek = opj_stream_write_seek;\n\t}\n\n\tl_stream->m_read_fn = opj_stream_default_read;\n\tl_stream->m_write_fn = opj_stream_default_write;\n\tl_stream->m_skip_fn = opj_stream_default_skip;\n\tl_stream->m_seek_fn = opj_stream_default_seek;\n\n\treturn (opj_stream_t *) l_stream;\n}\n\nopj_stream_t* OPJ_CALLCONV opj_stream_default_create(OPJ_BOOL l_is_input)\n{\n\treturn opj_stream_create(OPJ_J2K_STREAM_CHUNK_SIZE,l_is_input);\n}\n\nvoid OPJ_CALLCONV opj_stream_destroy(opj_stream_t* p_stream)\n{\n\topj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;\n\t\n\tif (l_stream) {\n\t\tif (l_stream->m_free_user_data_fn) {\n\t\t\tl_stream->m_free_user_data_fn(l_stream->m_user_data);\n\t\t}\n\t\topj_free(l_stream->m_stored_data);\n\t\tl_stream->m_stored_data = 00;\n\t\topj_free(l_stream);\n\t}\n}\n\nvoid OPJ_CALLCONV opj_stream_set_read_function(opj_stream_t* p_stream, opj_stream_read_fn p_function)\n{\n\topj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;\n\n\tif ((!l_stream) || (! (l_stream->m_status & opj_stream_e_input))) {\n\t\treturn;\n\t}\n\n\tl_stream->m_read_fn = p_function;\n}\n\nvoid OPJ_CALLCONV opj_stream_set_seek_function(opj_stream_t* p_stream, opj_stream_seek_fn p_function)\n{\n\topj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;\n\t\n\tif (!l_stream) {\n\t\treturn;\n\t}\n\tl_stream->m_seek_fn = p_function;\n}\n\nvoid OPJ_CALLCONV opj_stream_set_write_function(opj_stream_t* p_stream, opj_stream_write_fn p_function)\n{\n\topj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;\n\t\n\tif ((!l_stream )|| (! (l_stream->m_status & opj_stream_e_output))) {\n\t\treturn;\n\t}\n\n\tl_stream->m_write_fn = p_function;\n}\n\nvoid OPJ_CALLCONV opj_stream_set_skip_function(opj_stream_t* p_stream, opj_stream_skip_fn p_function)\n{\n\topj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;\n\t\n\tif (! l_stream) {\n\t\treturn;\n\t}\n\n\tl_stream->m_skip_fn = p_function;\n}\n\nvoid OPJ_CALLCONV opj_stream_set_user_data(opj_stream_t* p_stream, void * p_data, opj_stream_free_user_data_fn p_function)\n{\n\topj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;\n\tif (!l_stream)\n\t\treturn;\n\tl_stream->m_user_data = p_data;\n  l_stream->m_free_user_data_fn = p_function;\n}\n\nvoid OPJ_CALLCONV opj_stream_set_user_data_length(opj_stream_t* p_stream, OPJ_UINT64 data_length)\n{\n\topj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;\n\tif (!l_stream)\n\t\treturn;\n\tl_stream->m_user_data_length = data_length;\n}\n\nOPJ_SIZE_T opj_stream_read_data (opj_stream_private_t * p_stream,OPJ_BYTE * p_buffer, OPJ_SIZE_T p_size, opj_event_mgr_t * p_event_mgr)\n{\n\tOPJ_SIZE_T l_read_nb_bytes = 0;\n\tif (p_stream->m_bytes_in_buffer >= p_size) {\n\t\tmemcpy(p_buffer,p_stream->m_current_data,p_size);\n\t\tp_stream->m_current_data += p_size;\n\t\tp_stream->m_bytes_in_buffer -= p_size;\n\t\tl_read_nb_bytes += p_size;\n\t\tp_stream->m_byte_offset += (OPJ_OFF_T)p_size;\n\t\treturn l_read_nb_bytes;\n\t}\n\n\t/* we are now in the case when the remaining data if not sufficient */\n\tif (p_stream->m_status & opj_stream_e_end) {\n\t\tl_read_nb_bytes += p_stream->m_bytes_in_buffer;\n\t\tmemcpy(p_buffer,p_stream->m_current_data,p_stream->m_bytes_in_buffer);\n\t\tp_stream->m_current_data += p_stream->m_bytes_in_buffer;\n\t\tp_stream->m_byte_offset += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;\n\t\tp_stream->m_bytes_in_buffer = 0;\n\t\treturn l_read_nb_bytes ? l_read_nb_bytes : (OPJ_SIZE_T)-1;\n\t}\n\n\t/* the flag is not set, we copy data and then do an actual read on the stream */\n\tif (p_stream->m_bytes_in_buffer) {\n\t\tl_read_nb_bytes += p_stream->m_bytes_in_buffer;\n\t\tmemcpy(p_buffer,p_stream->m_current_data,p_stream->m_bytes_in_buffer);\n\t\tp_stream->m_current_data = p_stream->m_stored_data;\n\t\tp_buffer += p_stream->m_bytes_in_buffer;\n\t\tp_size -= p_stream->m_bytes_in_buffer;\n\t\tp_stream->m_byte_offset += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;\n\t\tp_stream->m_bytes_in_buffer = 0;\n\t}\n\telse {\n    /* case where we are already at the end of the buffer\n       so reset the m_current_data to point to the start of the\n       stored buffer to get ready to read from disk*/\n\t\tp_stream->m_current_data = p_stream->m_stored_data;\n\t}\n\n\twhile(1){\n\t\t/* we should read less than a chunk -> read a chunk */\n\t\tif (p_size < p_stream->m_buffer_size) {\n\t\t\t/* we should do an actual read on the media */\n\t\t\tp_stream->m_bytes_in_buffer = p_stream->m_read_fn(p_stream->m_stored_data,p_stream->m_buffer_size,p_stream->m_user_data);\n\n\t\t\tif (p_stream->m_bytes_in_buffer == (OPJ_SIZE_T)-1) {\n\t\t\t\t/* end of stream */\n\t\t\t\topj_event_msg(p_event_mgr, EVT_INFO, \"Stream reached its end !\\n\");\n\n\t\t\t\tp_stream->m_bytes_in_buffer = 0;\n\t\t\t\tp_stream->m_status |= opj_stream_e_end;\n\t\t\t\t/* end of stream */\n\t\t\t\treturn l_read_nb_bytes ? l_read_nb_bytes : (OPJ_SIZE_T)-1;\n\t\t\t}\n\t\t\telse if\t(p_stream->m_bytes_in_buffer < p_size) {\n\t\t\t\t/* not enough data */\n\t\t\t\tl_read_nb_bytes += p_stream->m_bytes_in_buffer;\n\t\t\t\tmemcpy(p_buffer,p_stream->m_current_data,p_stream->m_bytes_in_buffer);\n\t\t\t\tp_stream->m_current_data = p_stream->m_stored_data;\n\t\t\t\tp_buffer += p_stream->m_bytes_in_buffer;\n\t\t\t\tp_size -= p_stream->m_bytes_in_buffer;\n\t\t\t\tp_stream->m_byte_offset += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;\n\t\t\t\tp_stream->m_bytes_in_buffer = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tl_read_nb_bytes += p_size;\n\t\t\t\tmemcpy(p_buffer,p_stream->m_current_data,p_size);\n\t\t\t\tp_stream->m_current_data += p_size;\n\t\t\t\tp_stream->m_bytes_in_buffer -= p_size;\n\t\t\t\tp_stream->m_byte_offset += (OPJ_OFF_T)p_size;\n\t\t\t\treturn l_read_nb_bytes;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t/* direct read on the dest buffer */\n\t\t\tp_stream->m_bytes_in_buffer = p_stream->m_read_fn(p_buffer,p_size,p_stream->m_user_data);\n\n\t\t\tif (p_stream->m_bytes_in_buffer == (OPJ_SIZE_T)-1) {\n\t\t\t\t/*  end of stream */\n\t\t\t\topj_event_msg(p_event_mgr, EVT_INFO, \"Stream reached its end !\\n\");\n\n\t\t\t\tp_stream->m_bytes_in_buffer = 0;\n\t\t\t\tp_stream->m_status |= opj_stream_e_end;\n\t\t\t\t/* end of stream */\n\t\t\t\treturn l_read_nb_bytes ? l_read_nb_bytes : (OPJ_SIZE_T)-1;\n\t\t\t}\n\t\t\telse if (p_stream->m_bytes_in_buffer < p_size) {\n\t\t\t\t/* not enough data */\n\t\t\t\tl_read_nb_bytes += p_stream->m_bytes_in_buffer;\n\t\t\t\tp_stream->m_current_data = p_stream->m_stored_data;\n\t\t\t\tp_buffer += p_stream->m_bytes_in_buffer;\n\t\t\t\tp_size -= p_stream->m_bytes_in_buffer;\n\t\t\t\tp_stream->m_byte_offset += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;\n\t\t\t\tp_stream->m_bytes_in_buffer = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t/* we have read the exact size */\n\t\t\t\tl_read_nb_bytes += p_stream->m_bytes_in_buffer;\n\t\t\t\tp_stream->m_byte_offset += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;\n\t\t\t\tp_stream->m_current_data = p_stream->m_stored_data;\n\t\t\t\tp_stream->m_bytes_in_buffer = 0;\n\t\t\t\treturn l_read_nb_bytes;\n\t\t\t}\n\t\t}\n\t}\n}\n\nOPJ_SIZE_T opj_stream_write_data (opj_stream_private_t * p_stream,\n\t\t\t\t\t\t\t\t  const OPJ_BYTE * p_buffer,\n\t\t\t\t\t\t\t\t  OPJ_SIZE_T p_size, \n\t\t\t\t\t\t\t\t  opj_event_mgr_t * p_event_mgr)\n{\n\tOPJ_SIZE_T l_remaining_bytes = 0;\n\tOPJ_SIZE_T l_write_nb_bytes = 0;\n\n\tif (p_stream->m_status & opj_stream_e_error) {\n\t\treturn (OPJ_SIZE_T)-1;\n\t}\n\n\twhile(1) {\n\t\tl_remaining_bytes = p_stream->m_buffer_size - p_stream->m_bytes_in_buffer;\n\t\t\n\t\t/* we have more memory than required */\n\t\tif (l_remaining_bytes >= p_size) {\n\t\t\tmemcpy(p_stream->m_current_data, p_buffer, p_size);\n\t\t\t\n\t\t\tp_stream->m_current_data += p_size;\n\t\t\tp_stream->m_bytes_in_buffer += p_size;\n\t\t\tl_write_nb_bytes += p_size;\n\t\t\tp_stream->m_byte_offset += (OPJ_OFF_T)p_size;\n\t\t\t\n\t\t\treturn l_write_nb_bytes;\n\t\t}\n\n\t\t/* we copy data and then do an actual read on the stream */\n\t\tif (l_remaining_bytes) {\n\t\t\tl_write_nb_bytes += l_remaining_bytes;\n\t\t\t\n\t\t\tmemcpy(p_stream->m_current_data,p_buffer,l_remaining_bytes);\n\t\t\t\n\t\t\tp_stream->m_current_data = p_stream->m_stored_data;\n\t\t\t\n\t\t\tp_buffer += l_remaining_bytes;\n\t\t\tp_size -= l_remaining_bytes;\n\t\t\tp_stream->m_bytes_in_buffer += l_remaining_bytes;\n\t\t\tp_stream->m_byte_offset += (OPJ_OFF_T)l_remaining_bytes;\n\t\t}\n\n\t\tif (! opj_stream_flush(p_stream, p_event_mgr)) {\n\t\t\treturn (OPJ_SIZE_T)-1;\n\t\t}\n\t}\n\n}\n\nOPJ_BOOL opj_stream_flush (opj_stream_private_t * p_stream, opj_event_mgr_t * p_event_mgr)\n{\n\t/* the number of bytes written on the media. */\n\tOPJ_SIZE_T l_current_write_nb_bytes = 0;\n\n\tp_stream->m_current_data = p_stream->m_stored_data;\n\n\twhile (p_stream->m_bytes_in_buffer) {\n\t\t/* we should do an actual write on the media */\n\t\tl_current_write_nb_bytes = p_stream->m_write_fn(p_stream->m_current_data,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_stream->m_bytes_in_buffer,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_stream->m_user_data);\n\t\t\n\t\tif (l_current_write_nb_bytes == (OPJ_SIZE_T)-1) {\n\t\t\tp_stream->m_status |= opj_stream_e_error;\n\t\t\topj_event_msg(p_event_mgr, EVT_INFO, \"Error on writing stream!\\n\");\n\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\n\t\tp_stream->m_current_data += l_current_write_nb_bytes;\n\t\tp_stream->m_bytes_in_buffer -= l_current_write_nb_bytes;\n\t}\n\n\tp_stream->m_current_data = p_stream->m_stored_data;\n\t\n\treturn OPJ_TRUE;\n}\n\nOPJ_OFF_T opj_stream_read_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, opj_event_mgr_t * p_event_mgr)\n{\n\tOPJ_OFF_T l_skip_nb_bytes = 0;\n\tOPJ_OFF_T l_current_skip_nb_bytes = 0;\n\t\n\tassert( p_size >= 0 );\n\t\n\tif (p_stream->m_bytes_in_buffer >= (OPJ_SIZE_T)p_size) {\n\t\tp_stream->m_current_data += p_size;\n\t\t/* it is safe to cast p_size to OPJ_SIZE_T since it is <= m_bytes_in_buffer\n\t\twhich is of type OPJ_SIZE_T */\n\t\tp_stream->m_bytes_in_buffer -= (OPJ_SIZE_T)p_size;\n\t\tl_skip_nb_bytes += p_size;\n\t\tp_stream->m_byte_offset += l_skip_nb_bytes;\n\t\treturn l_skip_nb_bytes;\n\t}\n\n\t/* we are now in the case when the remaining data if not sufficient */\n\tif (p_stream->m_status & opj_stream_e_end) {\n\t\tl_skip_nb_bytes += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;\n\t\tp_stream->m_current_data += p_stream->m_bytes_in_buffer;\n\t\tp_stream->m_bytes_in_buffer = 0;\n\t\tp_stream->m_byte_offset += l_skip_nb_bytes;\n\t\treturn l_skip_nb_bytes ? l_skip_nb_bytes : (OPJ_OFF_T) -1;\n\t}\n\n\t/* the flag is not set, we copy data and then do an actual skip on the stream */\n\tif (p_stream->m_bytes_in_buffer) {\n\t\tl_skip_nb_bytes += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;\n\t\tp_stream->m_current_data = p_stream->m_stored_data;\n\t\tp_size -= (OPJ_OFF_T)p_stream->m_bytes_in_buffer;\n\t\tp_stream->m_bytes_in_buffer = 0;\n\t}\n\n\twhile (p_size > 0) {\n\t\t/* we should do an actual skip on the media */\n\t\tl_current_skip_nb_bytes = p_stream->m_skip_fn(p_size, p_stream->m_user_data);\n\t\tif (l_current_skip_nb_bytes == (OPJ_OFF_T) -1) {\n\t\t\topj_event_msg(p_event_mgr, EVT_INFO, \"Stream reached its end !\\n\");\n\n\t\t\tp_stream->m_status |= opj_stream_e_end;\n\t\t\tp_stream->m_byte_offset += l_skip_nb_bytes;\n\t\t\t/* end if stream */\n\t\t\treturn l_skip_nb_bytes ? l_skip_nb_bytes : (OPJ_OFF_T) -1;\n\t\t}\n\t\tp_size -= l_current_skip_nb_bytes;\n\t\tl_skip_nb_bytes += l_current_skip_nb_bytes;\n\t}\n\n\tp_stream->m_byte_offset += l_skip_nb_bytes;\n\t\n\treturn l_skip_nb_bytes;\n}\n\nOPJ_OFF_T opj_stream_write_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, opj_event_mgr_t * p_event_mgr)\n{\n\tOPJ_BOOL l_is_written = 0;\n\tOPJ_OFF_T l_current_skip_nb_bytes = 0;\n\tOPJ_OFF_T l_skip_nb_bytes = 0;\n\n\tif (p_stream->m_status & opj_stream_e_error) {\n\t\treturn (OPJ_OFF_T) -1;\n\t}\n\n\t/* we should flush data */\n\tl_is_written = opj_stream_flush (p_stream, p_event_mgr);\n\tif (! l_is_written) {\n\t\tp_stream->m_status |= opj_stream_e_error;\n\t\tp_stream->m_bytes_in_buffer = 0;\n\t\treturn (OPJ_OFF_T) -1;\n\t}\n\t/* then skip */\n\n\twhile (p_size > 0) {\n\t\t/* we should do an actual skip on the media */\n\t\tl_current_skip_nb_bytes = p_stream->m_skip_fn(p_size, p_stream->m_user_data);\n\t\t\n\t\tif (l_current_skip_nb_bytes == (OPJ_OFF_T)-1) {\n\t\t\topj_event_msg(p_event_mgr, EVT_INFO, \"Stream error!\\n\");\n\n\t\t\tp_stream->m_status |= opj_stream_e_error;\n\t\t\tp_stream->m_byte_offset += l_skip_nb_bytes;\n\t\t\t/* end if stream */\n\t\t\treturn l_skip_nb_bytes ? l_skip_nb_bytes : (OPJ_OFF_T)-1;\n\t\t}\n\t\tp_size -= l_current_skip_nb_bytes;\n\t\tl_skip_nb_bytes += l_current_skip_nb_bytes;\n\t}\n\n\tp_stream->m_byte_offset += l_skip_nb_bytes;\n\t\n\treturn l_skip_nb_bytes;\n}\n\nOPJ_OFF_T opj_stream_tell (const opj_stream_private_t * p_stream)\n{\n\treturn p_stream->m_byte_offset;\n}\n\nOPJ_OFF_T opj_stream_get_number_byte_left (const opj_stream_private_t * p_stream)\n{\n  assert( p_stream->m_byte_offset >= 0 );\n  assert( p_stream->m_user_data_length >= (OPJ_UINT64)p_stream->m_byte_offset);\n  return p_stream->m_user_data_length ?\n\t\t\t\t(OPJ_OFF_T)(p_stream->m_user_data_length) - p_stream->m_byte_offset :\n\t\t\t\t0;\n}\n\nOPJ_OFF_T opj_stream_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, opj_event_mgr_t * p_event_mgr)\n{\n\tassert(p_size >= 0);\n\treturn p_stream->m_opj_skip(p_stream,p_size,p_event_mgr);\n}\n\nOPJ_BOOL opj_stream_read_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, opj_event_mgr_t * p_event_mgr)\n{\n\tOPJ_ARG_NOT_USED(p_event_mgr);\n\tp_stream->m_current_data = p_stream->m_stored_data;\n\tp_stream->m_bytes_in_buffer = 0;\n\n\tif( !(p_stream->m_seek_fn(p_size,p_stream->m_user_data)) ) {\n\t\tp_stream->m_status |= opj_stream_e_end;\n\t\treturn OPJ_FALSE;\n\t}\n\telse {\n\t\t/* reset stream status */\n\t\tp_stream->m_status &= (~opj_stream_e_end);\n\t\tp_stream->m_byte_offset = p_size;\n\n\t}\n\n\treturn OPJ_TRUE;\n}\n\nOPJ_BOOL opj_stream_write_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, opj_event_mgr_t * p_event_mgr)\n{\n\tif (! opj_stream_flush(p_stream,p_event_mgr)) {\n\t\tp_stream->m_status |= opj_stream_e_error;\n\t\treturn OPJ_FALSE;\n\t}\n\n\tp_stream->m_current_data = p_stream->m_stored_data;\n\tp_stream->m_bytes_in_buffer = 0;\n\n\tif (! p_stream->m_seek_fn(p_size,p_stream->m_user_data)) {\n\t\tp_stream->m_status |= opj_stream_e_error;\n\t\treturn OPJ_FALSE;\n\t}\n\telse {\n\t\tp_stream->m_byte_offset = p_size;\n\t}\n\n\treturn OPJ_TRUE;\n}\n\nOPJ_BOOL opj_stream_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr)\n{\n\tassert(p_size >= 0);\n\treturn p_stream->m_opj_seek(p_stream,p_size,p_event_mgr);\n}\n\nOPJ_BOOL opj_stream_has_seek (const opj_stream_private_t * p_stream)\n{\n\treturn p_stream->m_seek_fn != opj_stream_default_seek;\n}\n\nOPJ_SIZE_T opj_stream_default_read (void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data)\n{\n\tOPJ_ARG_NOT_USED(p_buffer);\n\tOPJ_ARG_NOT_USED(p_nb_bytes);\n\tOPJ_ARG_NOT_USED(p_user_data);\n\treturn (OPJ_SIZE_T) -1;\n}\n\nOPJ_SIZE_T opj_stream_default_write (void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data)\n{\n\tOPJ_ARG_NOT_USED(p_buffer);\n\tOPJ_ARG_NOT_USED(p_nb_bytes);\n\tOPJ_ARG_NOT_USED(p_user_data);\n\treturn (OPJ_SIZE_T) -1;\n}\n\nOPJ_OFF_T opj_stream_default_skip (OPJ_OFF_T p_nb_bytes, void * p_user_data)\n{\n\tOPJ_ARG_NOT_USED(p_nb_bytes);\n\tOPJ_ARG_NOT_USED(p_user_data);\n\treturn (OPJ_OFF_T) -1;\n}\n\nOPJ_BOOL opj_stream_default_seek (OPJ_OFF_T p_nb_bytes, void * p_user_data)\n{\n\tOPJ_ARG_NOT_USED(p_nb_bytes);\n\tOPJ_ARG_NOT_USED(p_user_data);\n\treturn OPJ_FALSE;\n}\n"
  },
  {
    "path": "ext/openjpeg/cio.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR \n * Copyright (c) 2012, CS Systemes d'Information, France\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef __CIO_H\n#define __CIO_H\n/**\n@file cio.h\n@brief Implementation of a byte input-output process (CIO)\n\nThe functions in CIO.C have for goal to realize a byte input / output process.\n*/\n\n/** @defgroup CIO CIO - byte input-output stream */\n/*@{*/\n\n#include \"opj_config_private.h\"\n\n/* ----------------------------------------------------------------------- */\n\n#if defined(OPJ_BIG_ENDIAN)\n\t#define opj_write_bytes\t\topj_write_bytes_BE\n\t#define opj_read_bytes\t\topj_read_bytes_BE\n\t#define opj_write_double\topj_write_double_BE\n\t#define opj_read_double\t\topj_read_double_BE\n\t#define opj_write_float\t\topj_write_float_BE\n\t#define opj_read_float\t\topj_read_float_BE\n#else\n\t#define opj_write_bytes\t\topj_write_bytes_LE\n\t#define opj_read_bytes\t\topj_read_bytes_LE\n\t#define opj_write_double\topj_write_double_LE\n\t#define opj_read_double\t\topj_read_double_LE\n\t#define opj_write_float\t\topj_write_float_LE\n\t#define opj_read_float\t\topj_read_float_LE\n#endif\n\n\n\ntypedef enum\n{\n\topj_signed_sentinel\t\t= -1, /* do not use in code */\n\topj_stream_e_output\t\t= 0x1,\n\topj_stream_e_input\t\t= 0x2,\n\topj_stream_e_end\t\t= 0x4,\n\topj_stream_e_error\t\t= 0x8\n}\nopj_stream_flag ;\n\n/**\nByte input-output stream.\n*/\ntypedef struct opj_stream_private\n{\n\t/**\n\t * User data, be it files, ... The actual data depends on the type of the stream.\n\t */\n\tvoid *\t\t\t\t\tm_user_data;\n\n\t/**\n\t * Pointer to function to free m_user_data (NULL at initialization)\n\t * when destroying the stream. If pointer is NULL the function is not\n\t * called and the m_user_data is not freed (even if non-NULL).\n\t */\n\topj_stream_free_user_data_fn\t\tm_free_user_data_fn;\n\n\t/**\n\t * User data length\n\t */\n\tOPJ_UINT64 \t\t\t\tm_user_data_length;\n\n\t/**\n\t * Pointer to actual read function (NULL at the initialization of the cio.\n\t */\n\topj_stream_read_fn\t\tm_read_fn;\n\n\t/**\n\t * Pointer to actual write function (NULL at the initialization of the cio.\n\t */\n\topj_stream_write_fn\t\tm_write_fn;\n\n\t/**\n\t * Pointer to actual skip function (NULL at the initialization of the cio.\n\t * There is no seek function to prevent from back and forth slow procedures.\n\t */\n\topj_stream_skip_fn\t\tm_skip_fn;\n\n\t/**\n\t * Pointer to actual seek function (if available).\n\t */\n\topj_stream_seek_fn\t\tm_seek_fn;\n\n\t/**\n\t * Actual data stored into the stream if readed from. Data is read by chunk of fixed size.\n\t * you should never access this data directly.\n\t */\n\tOPJ_BYTE *\t\t\t\t\tm_stored_data;\n\n\t/**\n\t * Pointer to the current read data.\n\t */\n\tOPJ_BYTE *\t\t\t\t\tm_current_data;\n\n    /**\n    * FIXME DOC.\n    */\n\tOPJ_OFF_T (* m_opj_skip)(struct opj_stream_private * ,OPJ_OFF_T , struct opj_event_mgr *);\n\n    /**\n    * FIXME DOC.\n    */\n\tOPJ_BOOL (* m_opj_seek) (struct opj_stream_private * , OPJ_OFF_T , struct opj_event_mgr *);\n\n\t/**\n\t * number of bytes containing in the buffer.\n\t */\n\tOPJ_SIZE_T\t\t\tm_bytes_in_buffer;\n\n\t/**\n\t * The number of bytes read/written from the beginning of the stream\n\t */\n\tOPJ_OFF_T\t\t\tm_byte_offset;\n\n\t/**\n\t * The size of the buffer.\n\t */\n\tOPJ_SIZE_T\t\t\tm_buffer_size;\n\n\t/**\n\t * Flags to tell the status of the stream.\n\t */\n\topj_stream_flag m_status;\n\n}\nopj_stream_private_t;\n\n/** @name Exported functions (see also openjpeg.h) */\n/*@{*/\n/* ----------------------------------------------------------------------- */\n/**\n * Write some bytes to the given data buffer, this function is used in Big Endian cpus.\n * @param p_buffer\t\tpointer the data buffer to write data to.\n * @param p_value\t\tthe value to write\n * @param p_nb_bytes\tthe number of bytes to write\n*/\nvoid opj_write_bytes_BE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes);\n\n/**\n * Reads some bytes from the given data buffer, this function is used in Big Endian cpus.\n * @param p_buffer\t\tpointer the data buffer to read data from.\n * @param p_value\t\tpointer to the value that will store the data.\n * @param p_nb_bytes\tthe nb bytes to read.\n * @return\t\t\t\tthe number of bytes read or -1 if an error occured.\n */\nvoid opj_read_bytes_BE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes);\n\n/**\n * Write some bytes to the given data buffer, this function is used in Little Endian cpus.\n * @param p_buffer\t\tpointer the data buffer to write data to.\n * @param p_value\t\tthe value to write\n * @param p_nb_bytes\tthe number of bytes to write\n * @return\t\t\t\tthe number of bytes written or -1 if an error occured\n*/\nvoid opj_write_bytes_LE (OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes);\n\n/**\n * Reads some bytes from the given data buffer, this function is used in Little Endian cpus.\n * @param p_buffer\t\tpointer the data buffer to read data from.\n * @param p_value\t\tpointer to the value that will store the data.\n * @param p_nb_bytes\tthe nb bytes to read.\n * @return\t\t\t\tthe number of bytes read or -1 if an error occured.\n */\nvoid opj_read_bytes_LE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes);\n\n\n/**\n * Write some bytes to the given data buffer, this function is used in Little Endian cpus.\n * @param p_buffer\t\tpointer the data buffer to write data to.\n * @param p_value\t\tthe value to write\n */\nvoid opj_write_double_LE(OPJ_BYTE * p_buffer, OPJ_FLOAT64 p_value);\n\n/***\n * Write some bytes to the given data buffer, this function is used in Big Endian cpus.\n * @param p_buffer\t\tpointer the data buffer to write data to.\n * @param p_value\t\tthe value to write\n */\nvoid opj_write_double_BE(OPJ_BYTE * p_buffer, OPJ_FLOAT64 p_value);\n\n/**\n * Reads some bytes from the given data buffer, this function is used in Little Endian cpus.\n * @param p_buffer\t\tpointer the data buffer to read data from.\n * @param p_value\t\tpointer to the value that will store the data.\n */\nvoid opj_read_double_LE(const OPJ_BYTE * p_buffer, OPJ_FLOAT64 * p_value);\n\n/**\n * Reads some bytes from the given data buffer, this function is used in Big Endian cpus.\n * @param p_buffer\t\tpointer the data buffer to read data from.\n * @param p_value\t\tpointer to the value that will store the data.\n */\nvoid opj_read_double_BE(const OPJ_BYTE * p_buffer, OPJ_FLOAT64 * p_value);\n\n/**\n * Reads some bytes from the given data buffer, this function is used in Little Endian cpus.\n * @param p_buffer\t\tpointer the data buffer to read data from.\n * @param p_value\t\tpointer to the value that will store the data.\n */\nvoid opj_read_float_LE(const OPJ_BYTE * p_buffer, OPJ_FLOAT32 * p_value);\n\n/**\n * Reads some bytes from the given data buffer, this function is used in Big Endian cpus.\n * @param p_buffer\t\tpointer the data buffer to read data from.\n * @param p_value\t\tpointer to the value that will store the data.\n */\nvoid opj_read_float_BE(const OPJ_BYTE * p_buffer, OPJ_FLOAT32 * p_value);\n\n/**\n * Write some bytes to the given data buffer, this function is used in Little Endian cpus.\n * @param p_buffer\t\tpointer the data buffer to write data to.\n * @param p_value\t\tthe value to write\n */\nvoid opj_write_float_LE(OPJ_BYTE * p_buffer, OPJ_FLOAT32 p_value);\n\n/***\n * Write some bytes to the given data buffer, this function is used in Big Endian cpus.\n * @param p_buffer\t\tpointer the data buffer to write data to.\n * @param p_value\t\tthe value to write\n */\nvoid opj_write_float_BE(OPJ_BYTE * p_buffer, OPJ_FLOAT32 p_value);\n\n/**\n * Reads some bytes from the stream.\n * @param\t\tp_stream\tthe stream to read data from.\n * @param\t\tp_buffer\tpointer to the data buffer that will receive the data.\n * @param\t\tp_size\t\tnumber of bytes to read.\n * @param\t\tp_event_mgr\tthe user event manager to be notified of special events.\n * @return\t\tthe number of bytes read, or -1 if an error occured or if the stream is at the end.\n */\nOPJ_SIZE_T opj_stream_read_data (opj_stream_private_t * p_stream,OPJ_BYTE * p_buffer, OPJ_SIZE_T p_size, struct opj_event_mgr * p_event_mgr);\n\n/**\n * Writes some bytes to the stream.\n * @param\t\tp_stream\tthe stream to write data to.\n * @param\t\tp_buffer\tpointer to the data buffer holds the data to be writtent.\n * @param\t\tp_size\t\tnumber of bytes to write.\n * @param\t\tp_event_mgr\tthe user event manager to be notified of special events.\n * @return\t\tthe number of bytes writtent, or -1 if an error occured.\n */\nOPJ_SIZE_T opj_stream_write_data (opj_stream_private_t * p_stream,const OPJ_BYTE * p_buffer, OPJ_SIZE_T p_size, struct opj_event_mgr * p_event_mgr);\n\n/**\n * Writes the content of the stream buffer to the stream.\n * @param\t\tp_stream\tthe stream to write data to.\n * @param\t\tp_event_mgr\tthe user event manager to be notified of special events.\n * @return\t\ttrue if the data could be flushed, false else.\n */\nOPJ_BOOL opj_stream_flush (opj_stream_private_t * p_stream, struct opj_event_mgr * p_event_mgr);\n\n/**\n * Skips a number of bytes from the stream.\n * @param\t\tp_stream\tthe stream to skip data from.\n * @param\t\tp_size\t\tthe number of bytes to skip.\n * @param\t\tp_event_mgr\tthe user event manager to be notified of special events.\n * @return\t\tthe number of bytes skipped, or -1 if an error occured.\n */\nOPJ_OFF_T opj_stream_skip (opj_stream_private_t * p_stream,OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);\n\n/**\n * Tells the byte offset on the stream (similar to ftell).\n *\n * @param\t\tp_stream\tthe stream to get the information from.\n *\n * @return\t\tthe current position o fthe stream.\n */\nOPJ_OFF_T opj_stream_tell (const opj_stream_private_t * p_stream);\n\n\n/**\n * Get the number of bytes left before the end of the stream (similar to cio_numbytesleft).\n *\n * @param\t\tp_stream\tthe stream to get the information from.\n *\n * @return\t\tNumber of bytes left before the end of the stream.\n */\nOPJ_OFF_T opj_stream_get_number_byte_left (const opj_stream_private_t * p_stream);\n\n/**\n * Skips a number of bytes from the stream.\n * @param\t\tp_stream\tthe stream to skip data from.\n * @param\t\tp_size\t\tthe number of bytes to skip.\n * @param\t\tp_event_mgr\tthe user event manager to be notified of special events.\n * @return\t\tthe number of bytes skipped, or -1 if an error occured.\n */\nOPJ_OFF_T opj_stream_write_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);\n\n/**\n * Skips a number of bytes from the stream.\n * @param\t\tp_stream\tthe stream to skip data from.\n * @param\t\tp_size\t\tthe number of bytes to skip.\n * @param\t\tp_event_mgr\tthe user event manager to be notified of special events.\n * @return\t\tthe number of bytes skipped, or -1 if an error occured.\n */\nOPJ_OFF_T opj_stream_read_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);\n\n/**\n * Skips a number of bytes from the stream.\n * @param\t\tp_stream\tthe stream to skip data from.\n * @param\t\tp_size\t\tthe number of bytes to skip.\n * @param\t\tp_event_mgr\tthe user event manager to be notified of special events.\n * @return\t\tOPJ_TRUE if success, or OPJ_FALSE if an error occured.\n */\nOPJ_BOOL opj_stream_read_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);\n\n/**\n * Skips a number of bytes from the stream.\n * @param\t\tp_stream\tthe stream to skip data from.\n * @param\t\tp_size\t\tthe number of bytes to skip.\n * @param\t\tp_event_mgr\tthe user event manager to be notified of special events.\n * @return\t\tthe number of bytes skipped, or -1 if an error occured.\n */\nOPJ_BOOL opj_stream_write_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);\n\n/**\n * Seeks a number of bytes from the stream.\n * @param\t\tp_stream\tthe stream to skip data from.\n * @param\t\tp_size\t\tthe number of bytes to skip.\n * @param\t\tp_event_mgr\tthe user event manager to be notified of special events.\n * @return\t\ttrue if the stream is seekable.\n */\nOPJ_BOOL opj_stream_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr);\n\n/**\n * Tells if the given stream is seekable.\n */\nOPJ_BOOL opj_stream_has_seek (const opj_stream_private_t * p_stream);\n\n/**\n * FIXME DOC.\n */\nOPJ_SIZE_T opj_stream_default_read (void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data);\n\n/**\n * FIXME DOC.\n */\nOPJ_SIZE_T opj_stream_default_write (void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data);\n\n/**\n * FIXME DOC.\n */\nOPJ_OFF_T opj_stream_default_skip (OPJ_OFF_T p_nb_bytes, void * p_user_data);\n\n/**\n * FIXME DOC.\n */\nOPJ_BOOL opj_stream_default_seek (OPJ_OFF_T p_nb_bytes, void * p_user_data);\n\n/* ----------------------------------------------------------------------- */\n/*@}*/\n\n/*@}*/\n\n\n#endif /* __CIO_H */\n\n"
  },
  {
    "path": "ext/openjpeg/dwt.c",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2007, Jonathan Ballard <dzonatas@dzonux.net>\n * Copyright (c) 2007, Callum Lerwick <seg@haxxed.com>\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifdef __SSE__\n#include <xmmintrin.h>\n#endif\n\n#include \"opj_includes.h\"\n\n/** @defgroup DWT DWT - Implementation of a discrete wavelet transform */\n/*@{*/\n\n#define OPJ_WS(i) v->mem[(i)*2]\n#define OPJ_WD(i) v->mem[(1+(i)*2)]\n\n/** @name Local data structures */\n/*@{*/\n\ntypedef struct dwt_local {\n\tOPJ_INT32* mem;\n\tOPJ_INT32 dn;\n\tOPJ_INT32 sn;\n\tOPJ_INT32 cas;\n} opj_dwt_t;\n\ntypedef union {\n\tOPJ_FLOAT32\tf[4];\n} opj_v4_t;\n\ntypedef struct v4dwt_local {\n\topj_v4_t*\twavelet ;\n\tOPJ_INT32\t\tdn ;\n\tOPJ_INT32\t\tsn ;\n\tOPJ_INT32\t\tcas ;\n} opj_v4dwt_t ;\n\nstatic const OPJ_FLOAT32 opj_dwt_alpha =  1.586134342f; /*  12994 */\nstatic const OPJ_FLOAT32 opj_dwt_beta  =  0.052980118f; /*    434 */\nstatic const OPJ_FLOAT32 opj_dwt_gamma = -0.882911075f; /*  -7233 */\nstatic const OPJ_FLOAT32 opj_dwt_delta = -0.443506852f; /*  -3633 */\n\nstatic const OPJ_FLOAT32 opj_K      = 1.230174105f; /*  10078 */\nstatic const OPJ_FLOAT32 opj_c13318 = 1.625732422f;\n\n/*@}*/\n\n/**\nVirtual function type for wavelet transform in 1-D \n*/\ntypedef void (*DWT1DFN)(opj_dwt_t* v);\n\n/** @name Local static functions */\n/*@{*/\n\n/**\nForward lazy transform (horizontal)\n*/\nstatic void opj_dwt_deinterleave_h(OPJ_INT32 *a, OPJ_INT32 *b, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 cas);\n/**\nForward lazy transform (vertical)\n*/\nstatic void opj_dwt_deinterleave_v(OPJ_INT32 *a, OPJ_INT32 *b, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 x, OPJ_INT32 cas);\n/**\nInverse lazy transform (horizontal)\n*/\nstatic void opj_dwt_interleave_h(opj_dwt_t* h, OPJ_INT32 *a);\n/**\nInverse lazy transform (vertical)\n*/\nstatic void opj_dwt_interleave_v(opj_dwt_t* v, OPJ_INT32 *a, OPJ_INT32 x);\n/**\nForward 5-3 wavelet transform in 1-D\n*/\nstatic void opj_dwt_encode_1(OPJ_INT32 *a, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 cas);\n/**\nInverse 5-3 wavelet transform in 1-D\n*/\nstatic void opj_dwt_decode_1(opj_dwt_t *v);\nstatic void opj_dwt_decode_1_(OPJ_INT32 *a, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 cas);\n/**\nForward 9-7 wavelet transform in 1-D\n*/\nstatic void opj_dwt_encode_1_real(OPJ_INT32 *a, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 cas);\n/**\nExplicit calculation of the Quantization Stepsizes \n*/\nstatic void opj_dwt_encode_stepsize(OPJ_INT32 stepsize, OPJ_INT32 numbps, opj_stepsize_t *bandno_stepsize);\n/**\nInverse wavelet transform in 2-D.\n*/\nstatic OPJ_BOOL opj_dwt_decode_tile(opj_tcd_tilecomp_t* tilec, OPJ_UINT32 i, DWT1DFN fn);\n\nstatic OPJ_BOOL opj_dwt_encode_procedure(\topj_tcd_tilecomp_t * tilec,\n\t\t\t\t\t\t\t\t\t\t    void (*p_function)(OPJ_INT32 *, OPJ_INT32,OPJ_INT32,OPJ_INT32) );\n\nstatic OPJ_UINT32 opj_dwt_max_resolution(opj_tcd_resolution_t* restrict r, OPJ_UINT32 i);\n\n/* <summary>                             */\n/* Inverse 9-7 wavelet transform in 1-D. */\n/* </summary>                            */\nstatic void opj_v4dwt_decode(opj_v4dwt_t* restrict dwt);\n\nstatic void opj_v4dwt_interleave_h(opj_v4dwt_t* restrict w, OPJ_FLOAT32* restrict a, OPJ_INT32 x, OPJ_INT32 size);\n\nstatic void opj_v4dwt_interleave_v(opj_v4dwt_t* restrict v , OPJ_FLOAT32* restrict a , OPJ_INT32 x, OPJ_INT32 nb_elts_read);\n\n#ifdef __SSE__\nstatic void opj_v4dwt_decode_step1_sse(opj_v4_t* w, OPJ_INT32 count, const __m128 c);\n\nstatic void opj_v4dwt_decode_step2_sse(opj_v4_t* l, opj_v4_t* w, OPJ_INT32 k, OPJ_INT32 m, __m128 c);\n\n#else\nstatic void opj_v4dwt_decode_step1(opj_v4_t* w, OPJ_INT32 count, const OPJ_FLOAT32 c);\n\nstatic void opj_v4dwt_decode_step2(opj_v4_t* l, opj_v4_t* w, OPJ_INT32 k, OPJ_INT32 m, OPJ_FLOAT32 c);\n\n#endif\n\n/*@}*/\n\n/*@}*/\n\n#define OPJ_S(i) a[(i)*2]\n#define OPJ_D(i) a[(1+(i)*2)]\n#define OPJ_S_(i) ((i)<0?OPJ_S(0):((i)>=sn?OPJ_S(sn-1):OPJ_S(i)))\n#define OPJ_D_(i) ((i)<0?OPJ_D(0):((i)>=dn?OPJ_D(dn-1):OPJ_D(i)))\n/* new */\n#define OPJ_SS_(i) ((i)<0?OPJ_S(0):((i)>=dn?OPJ_S(dn-1):OPJ_S(i)))\n#define OPJ_DD_(i) ((i)<0?OPJ_D(0):((i)>=sn?OPJ_D(sn-1):OPJ_D(i)))\n\n/* <summary>                                                              */\n/* This table contains the norms of the 5-3 wavelets for different bands. */\n/* </summary>                                                             */\nstatic const OPJ_FLOAT64 opj_dwt_norms[4][10] = {\n\t{1.000, 1.500, 2.750, 5.375, 10.68, 21.34, 42.67, 85.33, 170.7, 341.3},\n\t{1.038, 1.592, 2.919, 5.703, 11.33, 22.64, 45.25, 90.48, 180.9},\n\t{1.038, 1.592, 2.919, 5.703, 11.33, 22.64, 45.25, 90.48, 180.9},\n\t{.7186, .9218, 1.586, 3.043, 6.019, 12.01, 24.00, 47.97, 95.93}\n};\n\n/* <summary>                                                              */\n/* This table contains the norms of the 9-7 wavelets for different bands. */\n/* </summary>                                                             */\nstatic const OPJ_FLOAT64 opj_dwt_norms_real[4][10] = {\n\t{1.000, 1.965, 4.177, 8.403, 16.90, 33.84, 67.69, 135.3, 270.6, 540.9},\n\t{2.022, 3.989, 8.355, 17.04, 34.27, 68.63, 137.3, 274.6, 549.0},\n\t{2.022, 3.989, 8.355, 17.04, 34.27, 68.63, 137.3, 274.6, 549.0},\n\t{2.080, 3.865, 8.307, 17.18, 34.71, 69.59, 139.3, 278.6, 557.2}\n};\n\n/* \n==========================================================\n   local functions\n==========================================================\n*/\n\n/* <summary>\t\t\t                 */\n/* Forward lazy transform (horizontal).  */\n/* </summary>                            */ \nvoid opj_dwt_deinterleave_h(OPJ_INT32 *a, OPJ_INT32 *b, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 cas) {\n\tOPJ_INT32 i;\n\tOPJ_INT32 * l_dest = b;\n\tOPJ_INT32 * l_src = a+cas;\n\n    for (i=0; i<sn; ++i) {\n\t\t*l_dest++ = *l_src;\n\t\tl_src += 2;\n\t}\n\t\n    l_dest = b + sn;\n\tl_src = a + 1 - cas;\n\n    for\t(i=0; i<dn; ++i)  {\n\t\t*l_dest++=*l_src;\n\t\tl_src += 2;\n\t}\n}\n\n/* <summary>                             */  \n/* Forward lazy transform (vertical).    */\n/* </summary>                            */ \nvoid opj_dwt_deinterleave_v(OPJ_INT32 *a, OPJ_INT32 *b, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 x, OPJ_INT32 cas) {\n    OPJ_INT32 i = sn;\n\tOPJ_INT32 * l_dest = b;\n\tOPJ_INT32 * l_src = a+cas;\n\n    while (i--) {\n\t\t*l_dest = *l_src;\n\t\tl_dest += x;\n\t\tl_src += 2;\n\t\t} /* b[i*x]=a[2*i+cas]; */\n\n\tl_dest = b + sn * x;\n\tl_src = a + 1 - cas;\n\t\n\ti = dn;\n    while (i--) {\n\t\t*l_dest = *l_src;\n\t\tl_dest += x;\n\t\tl_src += 2;\n        } /*b[(sn+i)*x]=a[(2*i+1-cas)];*/\n}\n\n/* <summary>                             */\n/* Inverse lazy transform (horizontal).  */\n/* </summary>                            */\nvoid opj_dwt_interleave_h(opj_dwt_t* h, OPJ_INT32 *a) {\n    OPJ_INT32 *ai = a;\n    OPJ_INT32 *bi = h->mem + h->cas;\n    OPJ_INT32  i\t= h->sn;\n    while( i-- ) {\n      *bi = *(ai++);\n\t  bi += 2;\n    }\n    ai\t= a + h->sn;\n    bi\t= h->mem + 1 - h->cas;\n    i\t= h->dn ;\n    while( i-- ) {\n      *bi = *(ai++);\n\t  bi += 2;\n    }\n}\n\n/* <summary>                             */  \n/* Inverse lazy transform (vertical).    */\n/* </summary>                            */ \nvoid opj_dwt_interleave_v(opj_dwt_t* v, OPJ_INT32 *a, OPJ_INT32 x) {\n    OPJ_INT32 *ai = a;\n    OPJ_INT32 *bi = v->mem + v->cas;\n    OPJ_INT32  i = v->sn;\n    while( i-- ) {\n      *bi = *ai;\n\t  bi += 2;\n\t  ai += x;\n    }\n    ai = a + (v->sn * x);\n    bi = v->mem + 1 - v->cas;\n    i = v->dn ;\n    while( i-- ) {\n      *bi = *ai;\n\t  bi += 2;  \n\t  ai += x;\n    }\n}\n\n\n/* <summary>                            */\n/* Forward 5-3 wavelet transform in 1-D. */\n/* </summary>                           */\nvoid opj_dwt_encode_1(OPJ_INT32 *a, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 cas) {\n\tOPJ_INT32 i;\n\t\n\tif (!cas) {\n\t\tif ((dn > 0) || (sn > 1)) {\t/* NEW :  CASE ONE ELEMENT */\n\t\t\tfor (i = 0; i < dn; i++) OPJ_D(i) -= (OPJ_S_(i) + OPJ_S_(i + 1)) >> 1;\n\t\t\tfor (i = 0; i < sn; i++) OPJ_S(i) += (OPJ_D_(i - 1) + OPJ_D_(i) + 2) >> 2;\n\t\t}\n\t} else {\n\t\tif (!sn && dn == 1)\t\t    /* NEW :  CASE ONE ELEMENT */\n\t\t\tOPJ_S(0) *= 2;\n\t\telse {\n\t\t\tfor (i = 0; i < dn; i++) OPJ_S(i) -= (OPJ_DD_(i) + OPJ_DD_(i - 1)) >> 1;\n\t\t\tfor (i = 0; i < sn; i++) OPJ_D(i) += (OPJ_SS_(i) + OPJ_SS_(i + 1) + 2) >> 2;\n\t\t}\n\t}\n}\n\n/* <summary>                            */\n/* Inverse 5-3 wavelet transform in 1-D. */\n/* </summary>                           */ \nvoid opj_dwt_decode_1_(OPJ_INT32 *a, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 cas) {\n\tOPJ_INT32 i;\n\t\n\tif (!cas) {\n\t\tif ((dn > 0) || (sn > 1)) { /* NEW :  CASE ONE ELEMENT */\n\t\t\tfor (i = 0; i < sn; i++) OPJ_S(i) -= (OPJ_D_(i - 1) + OPJ_D_(i) + 2) >> 2;\n\t\t\tfor (i = 0; i < dn; i++) OPJ_D(i) += (OPJ_S_(i) + OPJ_S_(i + 1)) >> 1;\n\t\t}\n\t} else {\n\t\tif (!sn  && dn == 1)          /* NEW :  CASE ONE ELEMENT */\n\t\t\tOPJ_S(0) /= 2;\n\t\telse {\n\t\t\tfor (i = 0; i < sn; i++) OPJ_D(i) -= (OPJ_SS_(i) + OPJ_SS_(i + 1) + 2) >> 2;\n\t\t\tfor (i = 0; i < dn; i++) OPJ_S(i) += (OPJ_DD_(i) + OPJ_DD_(i - 1)) >> 1;\n\t\t}\n\t}\n}\n\n/* <summary>                            */\n/* Inverse 5-3 wavelet transform in 1-D. */\n/* </summary>                           */ \nvoid opj_dwt_decode_1(opj_dwt_t *v) {\n\topj_dwt_decode_1_(v->mem, v->dn, v->sn, v->cas);\n}\n\n/* <summary>                             */\n/* Forward 9-7 wavelet transform in 1-D. */\n/* </summary>                            */\nvoid opj_dwt_encode_1_real(OPJ_INT32 *a, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 cas) {\n\tOPJ_INT32 i;\n\tif (!cas) {\n\t\tif ((dn > 0) || (sn > 1)) {\t/* NEW :  CASE ONE ELEMENT */\n\t\t\tfor (i = 0; i < dn; i++)\n\t\t\t\tOPJ_D(i) -= opj_int_fix_mul(OPJ_S_(i) + OPJ_S_(i + 1), 12993);\n\t\t\tfor (i = 0; i < sn; i++)\n\t\t\t\tOPJ_S(i) -= opj_int_fix_mul(OPJ_D_(i - 1) + OPJ_D_(i), 434);\n\t\t\tfor (i = 0; i < dn; i++)\n\t\t\t\tOPJ_D(i) += opj_int_fix_mul(OPJ_S_(i) + OPJ_S_(i + 1), 7233);\n\t\t\tfor (i = 0; i < sn; i++)\n\t\t\t\tOPJ_S(i) += opj_int_fix_mul(OPJ_D_(i - 1) + OPJ_D_(i), 3633);\n\t\t\tfor (i = 0; i < dn; i++)\n\t\t\t\tOPJ_D(i) = opj_int_fix_mul(OPJ_D(i), 5038);\t/*5038 */\n\t\t\tfor (i = 0; i < sn; i++)\n\t\t\t\tOPJ_S(i) = opj_int_fix_mul(OPJ_S(i), 6659);\t/*6660 */\n\t\t}\n\t} else {\n\t\tif ((sn > 0) || (dn > 1)) {\t/* NEW :  CASE ONE ELEMENT */\n\t\t\tfor (i = 0; i < dn; i++)\n\t\t\t\tOPJ_S(i) -= opj_int_fix_mul(OPJ_DD_(i) + OPJ_DD_(i - 1), 12993);\n\t\t\tfor (i = 0; i < sn; i++)\n\t\t\t\tOPJ_D(i) -= opj_int_fix_mul(OPJ_SS_(i) + OPJ_SS_(i + 1), 434);\n\t\t\tfor (i = 0; i < dn; i++)\n\t\t\t\tOPJ_S(i) += opj_int_fix_mul(OPJ_DD_(i) + OPJ_DD_(i - 1), 7233);\n\t\t\tfor (i = 0; i < sn; i++)\n\t\t\t\tOPJ_D(i) += opj_int_fix_mul(OPJ_SS_(i) + OPJ_SS_(i + 1), 3633);\n\t\t\tfor (i = 0; i < dn; i++)\n\t\t\t\tOPJ_S(i) = opj_int_fix_mul(OPJ_S(i), 5038);\t/*5038 */\n\t\t\tfor (i = 0; i < sn; i++)\n\t\t\t\tOPJ_D(i) = opj_int_fix_mul(OPJ_D(i), 6659);\t/*6660 */\n\t\t}\n\t}\n}\n\nvoid opj_dwt_encode_stepsize(OPJ_INT32 stepsize, OPJ_INT32 numbps, opj_stepsize_t *bandno_stepsize) {\n\tOPJ_INT32 p, n;\n\tp = opj_int_floorlog2(stepsize) - 13;\n\tn = 11 - opj_int_floorlog2(stepsize);\n\tbandno_stepsize->mant = (n < 0 ? stepsize >> -n : stepsize << n) & 0x7ff;\n\tbandno_stepsize->expn = numbps - p;\n}\n\n/* \n==========================================================\n   DWT interface\n==========================================================\n*/\n\n\n/* <summary>                            */\n/* Forward 5-3 wavelet transform in 2-D. */\n/* </summary>                           */\nINLINE OPJ_BOOL opj_dwt_encode_procedure(opj_tcd_tilecomp_t * tilec,void (*p_function)(OPJ_INT32 *, OPJ_INT32,OPJ_INT32,OPJ_INT32) )\n{\n\tOPJ_INT32 i, j, k;\n\tOPJ_INT32 *a = 00;\n\tOPJ_INT32 *aj = 00;\n\tOPJ_INT32 *bj = 00;\n\tOPJ_INT32 w, l;\n\n\tOPJ_INT32 rw;\t\t\t/* width of the resolution level computed   */\n\tOPJ_INT32 rh;\t\t\t/* height of the resolution level computed  */\n\tOPJ_UINT32 l_data_size;\n\n\topj_tcd_resolution_t * l_cur_res = 0;\n\topj_tcd_resolution_t * l_last_res = 0;\n\n\tw = tilec->x1-tilec->x0;\n\tl = (OPJ_INT32)tilec->numresolutions-1;\n\ta = tilec->data;\n\n\tl_cur_res = tilec->resolutions + l;\n\tl_last_res = l_cur_res - 1;\n\n\tl_data_size = opj_dwt_max_resolution( tilec->resolutions,tilec->numresolutions) * (OPJ_UINT32)sizeof(OPJ_INT32);\n\tbj = (OPJ_INT32*)opj_malloc((size_t)l_data_size);\n\tif (! bj) {\n\t\treturn OPJ_FALSE;\n\t}\n\ti = l;\n\n\twhile (i--) {\n\t\tOPJ_INT32 rw1;\t\t/* width of the resolution level once lower than computed one                                       */\n\t\tOPJ_INT32 rh1;\t\t/* height of the resolution level once lower than computed one                                      */\n\t\tOPJ_INT32 cas_col;\t/* 0 = non inversion on horizontal filtering 1 = inversion between low-pass and high-pass filtering */\n\t\tOPJ_INT32 cas_row;\t/* 0 = non inversion on vertical filtering 1 = inversion between low-pass and high-pass filtering   */\n\t\tOPJ_INT32 dn, sn;\n\n\t\trw  = l_cur_res->x1 - l_cur_res->x0;\n\t\trh  = l_cur_res->y1 - l_cur_res->y0;\n\t\trw1 = l_last_res->x1 - l_last_res->x0;\n\t\trh1 = l_last_res->y1 - l_last_res->y0;\n\n\t\tcas_row = l_cur_res->x0 & 1;\n\t\tcas_col = l_cur_res->y0 & 1;\n\n\t\tsn = rh1;\n\t\tdn = rh - rh1;\n\t\tfor (j = 0; j < rw; ++j) {\n\t\t\taj = a + j;\n\t\t\tfor (k = 0; k < rh; ++k) {\n\t\t\t\tbj[k] = aj[k*w];\n\t\t\t}\n\n\t\t\t(*p_function) (bj, dn, sn, cas_col);\n\n\t\t\topj_dwt_deinterleave_v(bj, aj, dn, sn, w, cas_col);\n\t\t}\n\n\t\tsn = rw1;\n\t\tdn = rw - rw1;\n\n\t\tfor (j = 0; j < rh; j++) {\n\t\t\taj = a + j * w;\n\t\t\tfor (k = 0; k < rw; k++)  bj[k] = aj[k];\n\t\t\t(*p_function) (bj, dn, sn, cas_row);\n\t\t\topj_dwt_deinterleave_h(bj, aj, dn, sn, cas_row);\n\t\t}\n\n\t\tl_cur_res = l_last_res;\n\n\t\t--l_last_res;\n\t}\n\n\topj_free(bj);\n\treturn OPJ_TRUE;\n}\n\n/* Forward 5-3 wavelet transform in 2-D. */\n/* </summary>                           */\nOPJ_BOOL opj_dwt_encode(opj_tcd_tilecomp_t * tilec)\n{\n\treturn opj_dwt_encode_procedure(tilec,opj_dwt_encode_1);\n}\n\n/* <summary>                            */\n/* Inverse 5-3 wavelet transform in 2-D. */\n/* </summary>                           */\nOPJ_BOOL opj_dwt_decode(opj_tcd_tilecomp_t* tilec, OPJ_UINT32 numres) {\n\treturn opj_dwt_decode_tile(tilec, numres, &opj_dwt_decode_1);\n}\n\n\n/* <summary>                          */\n/* Get gain of 5-3 wavelet transform. */\n/* </summary>                         */\nOPJ_UINT32 opj_dwt_getgain(OPJ_UINT32 orient) {\n\tif (orient == 0)\n\t\treturn 0;\n\tif (orient == 1 || orient == 2)\n\t\treturn 1;\n\treturn 2;\n}\n\n/* <summary>                */\n/* Get norm of 5-3 wavelet. */\n/* </summary>               */\nOPJ_FLOAT64 opj_dwt_getnorm(OPJ_UINT32 level, OPJ_UINT32 orient) {\n\treturn opj_dwt_norms[orient][level];\n}\n\n/* <summary>                             */\n/* Forward 9-7 wavelet transform in 2-D. */\n/* </summary>                            */\nOPJ_BOOL opj_dwt_encode_real(opj_tcd_tilecomp_t * tilec)\n{\n\treturn opj_dwt_encode_procedure(tilec,opj_dwt_encode_1_real);\n}\n\n/* <summary>                          */\n/* Get gain of 9-7 wavelet transform. */\n/* </summary>                         */\nOPJ_UINT32 opj_dwt_getgain_real(OPJ_UINT32 orient) {\n\t(void)orient;\n\treturn 0;\n}\n\n/* <summary>                */\n/* Get norm of 9-7 wavelet. */\n/* </summary>               */\nOPJ_FLOAT64 opj_dwt_getnorm_real(OPJ_UINT32 level, OPJ_UINT32 orient) {\n\treturn opj_dwt_norms_real[orient][level];\n}\n\nvoid opj_dwt_calc_explicit_stepsizes(opj_tccp_t * tccp, OPJ_UINT32 prec) {\n\tOPJ_UINT32 numbands, bandno;\n\tnumbands = 3 * tccp->numresolutions - 2;\n\tfor (bandno = 0; bandno < numbands; bandno++) {\n\t\tOPJ_FLOAT64 stepsize;\n\t\tOPJ_UINT32 resno, level, orient, gain;\n\n\t\tresno = (bandno == 0) ? 0 : ((bandno - 1) / 3 + 1);\n\t\torient = (bandno == 0) ? 0 : ((bandno - 1) % 3 + 1);\n\t\tlevel = tccp->numresolutions - 1 - resno;\n\t\tgain = (tccp->qmfbid == 0) ? 0 : ((orient == 0) ? 0 : (((orient == 1) || (orient == 2)) ? 1 : 2));\n\t\tif (tccp->qntsty == J2K_CCP_QNTSTY_NOQNT) {\n\t\t\tstepsize = 1.0;\n\t\t} else {\n\t\t\tOPJ_FLOAT64 norm = opj_dwt_norms_real[orient][level];\n\t\t\tstepsize = (1 << (gain)) / norm;\n\t\t}\n\t\topj_dwt_encode_stepsize((OPJ_INT32) floor(stepsize * 8192.0), (OPJ_INT32)(prec + gain), &tccp->stepsizes[bandno]);\n\t}\n}\n\n/* <summary>                             */\n/* Determine maximum computed resolution level for inverse wavelet transform */\n/* </summary>                            */\nOPJ_UINT32 opj_dwt_max_resolution(opj_tcd_resolution_t* restrict r, OPJ_UINT32 i) {\n\tOPJ_UINT32 mr\t= 0;\n\tOPJ_UINT32 w;\n\twhile( --i ) {\n\t\t++r;\n\t\tif( mr < ( w = (OPJ_UINT32)(r->x1 - r->x0) ) )\n\t\t\tmr = w ;\n\t\tif( mr < ( w = (OPJ_UINT32)(r->y1 - r->y0) ) )\n\t\t\tmr = w ;\n\t}\n\treturn mr ;\n}\n\n/* <summary>                            */\n/* Inverse wavelet transform in 2-D.     */\n/* </summary>                           */\nOPJ_BOOL opj_dwt_decode_tile(opj_tcd_tilecomp_t* tilec, OPJ_UINT32 numres, DWT1DFN dwt_1D) {\n\topj_dwt_t h;\n\topj_dwt_t v;\n\n\topj_tcd_resolution_t* tr = tilec->resolutions;\n\n\tOPJ_UINT32 rw = (OPJ_UINT32)(tr->x1 - tr->x0);\t/* width of the resolution level computed */\n\tOPJ_UINT32 rh = (OPJ_UINT32)(tr->y1 - tr->y0);\t/* height of the resolution level computed */\n\n\tOPJ_UINT32 w = (OPJ_UINT32)(tilec->x1 - tilec->x0);\n\n\th.mem = (OPJ_INT32*)\n\topj_aligned_malloc(opj_dwt_max_resolution(tr, numres) * sizeof(OPJ_INT32));\n\tif (! h.mem){\n\t\treturn OPJ_FALSE;\n\t}\n\n\tv.mem = h.mem;\n\n\twhile( --numres) {\n\t\tOPJ_INT32 * restrict tiledp = tilec->data;\n\t\tOPJ_UINT32 j;\n\n\t\t++tr;\n\t\th.sn = (OPJ_INT32)rw;\n\t\tv.sn = (OPJ_INT32)rh;\n\n\t\trw = (OPJ_UINT32)(tr->x1 - tr->x0);\n\t\trh = (OPJ_UINT32)(tr->y1 - tr->y0);\n\n\t\th.dn = (OPJ_INT32)(rw - (OPJ_UINT32)h.sn);\n\t\th.cas = tr->x0 % 2;\n\n\t\tfor(j = 0; j < rh; ++j) {\n\t\t\topj_dwt_interleave_h(&h, &tiledp[j*w]);\n\t\t\t(dwt_1D)(&h);\n\t\t\tmemcpy(&tiledp[j*w], h.mem, rw * sizeof(OPJ_INT32));\n\t\t}\n\n\t\tv.dn = (OPJ_INT32)(rh - (OPJ_UINT32)v.sn);\n\t\tv.cas = tr->y0 % 2;\n\n\t\tfor(j = 0; j < rw; ++j){\n\t\t\tOPJ_UINT32 k;\n\t\t\topj_dwt_interleave_v(&v, &tiledp[j], (OPJ_INT32)w);\n\t\t\t(dwt_1D)(&v);\n\t\t\tfor(k = 0; k < rh; ++k) {\n\t\t\t\ttiledp[k * w + j] = v.mem[k];\n\t\t\t}\n\t\t}\n\t}\n\topj_aligned_free(h.mem);\n\treturn OPJ_TRUE;\n}\n\nvoid opj_v4dwt_interleave_h(opj_v4dwt_t* restrict w, OPJ_FLOAT32* restrict a, OPJ_INT32 x, OPJ_INT32 size){\n\tOPJ_FLOAT32* restrict bi = (OPJ_FLOAT32*) (w->wavelet + w->cas);\n\tOPJ_INT32 count = w->sn;\n\tOPJ_INT32 i, k;\n\n\tfor(k = 0; k < 2; ++k){\n\t\tif ( count + 3 * x < size && ((size_t) a & 0x0f) == 0 && ((size_t) bi & 0x0f) == 0 && (x & 0x0f) == 0 ) {\n\t\t\t/* Fast code path */\n\t\t\tfor(i = 0; i < count; ++i){\n\t\t\t\tOPJ_INT32 j = i;\n\t\t\t\tbi[i*8    ] = a[j];\n\t\t\t\tj += x;\n\t\t\t\tbi[i*8 + 1] = a[j];\n\t\t\t\tj += x;\n\t\t\t\tbi[i*8 + 2] = a[j];\n\t\t\t\tj += x;\n\t\t\t\tbi[i*8 + 3] = a[j];\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t/* Slow code path */\n\t\t\tfor(i = 0; i < count; ++i){\n\t\t\t\tOPJ_INT32 j = i;\n\t\t\t\tbi[i*8    ] = a[j];\n\t\t\t\tj += x;\n\t\t\t\tif(j >= size) continue;\n\t\t\t\tbi[i*8 + 1] = a[j];\n\t\t\t\tj += x;\n\t\t\t\tif(j >= size) continue;\n\t\t\t\tbi[i*8 + 2] = a[j];\n\t\t\t\tj += x;\n\t\t\t\tif(j >= size) continue;\n\t\t\t\tbi[i*8 + 3] = a[j]; /* This one*/\n\t\t\t}\n\t\t}\n\n\t\tbi = (OPJ_FLOAT32*) (w->wavelet + 1 - w->cas);\n\t\ta += w->sn;\n\t\tsize -= w->sn;\n\t\tcount = w->dn;\n\t}\n}\n\nvoid opj_v4dwt_interleave_v(opj_v4dwt_t* restrict v , OPJ_FLOAT32* restrict a , OPJ_INT32 x, OPJ_INT32 nb_elts_read){\n\topj_v4_t* restrict bi = v->wavelet + v->cas;\n\tOPJ_INT32 i;\n\n\tfor(i = 0; i < v->sn; ++i){\n\t\tmemcpy(&bi[i*2], &a[i*x], (size_t)nb_elts_read * sizeof(OPJ_FLOAT32));\n\t}\n\n\ta += v->sn * x;\n\tbi = v->wavelet + 1 - v->cas;\n\n\tfor(i = 0; i < v->dn; ++i){\n\t\tmemcpy(&bi[i*2], &a[i*x], (size_t)nb_elts_read * sizeof(OPJ_FLOAT32));\n\t}\n}\n\n#ifdef __SSE__\n\nvoid opj_v4dwt_decode_step1_sse(opj_v4_t* w, OPJ_INT32 count, const __m128 c){\n\t__m128* restrict vw = (__m128*) w;\n\tOPJ_INT32 i;\n\t/* 4x unrolled loop */\n\tfor(i = 0; i < count >> 2; ++i){\n\t\t*vw = _mm_mul_ps(*vw, c);\n\t\tvw += 2;\n\t\t*vw = _mm_mul_ps(*vw, c);\n\t\tvw += 2;\n\t\t*vw = _mm_mul_ps(*vw, c);\n\t\tvw += 2;\n\t\t*vw = _mm_mul_ps(*vw, c);\n\t\tvw += 2;\n\t}\n\tcount &= 3;\n\tfor(i = 0; i < count; ++i){\n\t\t*vw = _mm_mul_ps(*vw, c);\n\t\tvw += 2;\n\t}\n}\n\nvoid opj_v4dwt_decode_step2_sse(opj_v4_t* l, opj_v4_t* w, OPJ_INT32 k, OPJ_INT32 m, __m128 c){\n\t__m128* restrict vl = (__m128*) l;\n\t__m128* restrict vw = (__m128*) w;\n\tOPJ_INT32 i;\n\t__m128 tmp1, tmp2, tmp3;\n\ttmp1 = vl[0];\n\tfor(i = 0; i < m; ++i){\n\t\ttmp2 = vw[-1];\n\t\ttmp3 = vw[ 0];\n\t\tvw[-1] = _mm_add_ps(tmp2, _mm_mul_ps(_mm_add_ps(tmp1, tmp3), c));\n\t\ttmp1 = tmp3;\n\t\tvw += 2;\n\t}\n\tvl = vw - 2;\n\tif(m >= k){\n\t\treturn;\n\t}\n\tc = _mm_add_ps(c, c);\n\tc = _mm_mul_ps(c, vl[0]);\n\tfor(; m < k; ++m){\n\t\t__m128 tmp = vw[-1];\n\t\tvw[-1] = _mm_add_ps(tmp, c);\n\t\tvw += 2;\n\t}\n}\n\n#else\n\nvoid opj_v4dwt_decode_step1(opj_v4_t* w, OPJ_INT32 count, const OPJ_FLOAT32 c)\n{\n\tOPJ_FLOAT32* restrict fw = (OPJ_FLOAT32*) w;\n\tOPJ_INT32 i;\n\tfor(i = 0; i < count; ++i){\n\t\tOPJ_FLOAT32 tmp1 = fw[i*8    ];\n\t\tOPJ_FLOAT32 tmp2 = fw[i*8 + 1];\n\t\tOPJ_FLOAT32 tmp3 = fw[i*8 + 2];\n\t\tOPJ_FLOAT32 tmp4 = fw[i*8 + 3];\n\t\tfw[i*8    ] = tmp1 * c;\n\t\tfw[i*8 + 1] = tmp2 * c;\n\t\tfw[i*8 + 2] = tmp3 * c;\n\t\tfw[i*8 + 3] = tmp4 * c;\n\t}\n}\n\nvoid opj_v4dwt_decode_step2(opj_v4_t* l, opj_v4_t* w, OPJ_INT32 k, OPJ_INT32 m, OPJ_FLOAT32 c)\n{\n\tOPJ_FLOAT32* restrict fl = (OPJ_FLOAT32*) l;\n\tOPJ_FLOAT32* restrict fw = (OPJ_FLOAT32*) w;\n\tOPJ_INT32 i;\n\tfor(i = 0; i < m; ++i){\n\t\tOPJ_FLOAT32 tmp1_1 = fl[0];\n\t\tOPJ_FLOAT32 tmp1_2 = fl[1];\n\t\tOPJ_FLOAT32 tmp1_3 = fl[2];\n\t\tOPJ_FLOAT32 tmp1_4 = fl[3];\n\t\tOPJ_FLOAT32 tmp2_1 = fw[-4];\n\t\tOPJ_FLOAT32 tmp2_2 = fw[-3];\n\t\tOPJ_FLOAT32 tmp2_3 = fw[-2];\n\t\tOPJ_FLOAT32 tmp2_4 = fw[-1];\n\t\tOPJ_FLOAT32 tmp3_1 = fw[0];\n\t\tOPJ_FLOAT32 tmp3_2 = fw[1];\n\t\tOPJ_FLOAT32 tmp3_3 = fw[2];\n\t\tOPJ_FLOAT32 tmp3_4 = fw[3];\n\t\tfw[-4] = tmp2_1 + ((tmp1_1 + tmp3_1) * c);\n\t\tfw[-3] = tmp2_2 + ((tmp1_2 + tmp3_2) * c);\n\t\tfw[-2] = tmp2_3 + ((tmp1_3 + tmp3_3) * c);\n\t\tfw[-1] = tmp2_4 + ((tmp1_4 + tmp3_4) * c);\n\t\tfl = fw;\n\t\tfw += 8;\n\t}\n\tif(m < k){\n\t\tOPJ_FLOAT32 c1;\n\t\tOPJ_FLOAT32 c2;\n\t\tOPJ_FLOAT32 c3;\n\t\tOPJ_FLOAT32 c4;\n\t\tc += c;\n\t\tc1 = fl[0] * c;\n\t\tc2 = fl[1] * c;\n\t\tc3 = fl[2] * c;\n\t\tc4 = fl[3] * c;\n\t\tfor(; m < k; ++m){\n\t\t\tOPJ_FLOAT32 tmp1 = fw[-4];\n\t\t\tOPJ_FLOAT32 tmp2 = fw[-3];\n\t\t\tOPJ_FLOAT32 tmp3 = fw[-2];\n\t\t\tOPJ_FLOAT32 tmp4 = fw[-1];\n\t\t\tfw[-4] = tmp1 + c1;\n\t\t\tfw[-3] = tmp2 + c2;\n\t\t\tfw[-2] = tmp3 + c3;\n\t\t\tfw[-1] = tmp4 + c4;\n\t\t\tfw += 8;\n\t\t}\n\t}\n}\n\n#endif\n\n/* <summary>                             */\n/* Inverse 9-7 wavelet transform in 1-D. */\n/* </summary>                            */\nvoid opj_v4dwt_decode(opj_v4dwt_t* restrict dwt)\n{\n\tOPJ_INT32 a, b;\n\tif(dwt->cas == 0) {\n\t\tif(!((dwt->dn > 0) || (dwt->sn > 1))){\n\t\t\treturn;\n\t\t}\n\t\ta = 0;\n\t\tb = 1;\n\t}else{\n\t\tif(!((dwt->sn > 0) || (dwt->dn > 1))) {\n\t\t\treturn;\n\t\t}\n\t\ta = 1;\n\t\tb = 0;\n\t}\n#ifdef __SSE__\n\topj_v4dwt_decode_step1_sse(dwt->wavelet+a, dwt->sn, _mm_set1_ps(opj_K));\n\topj_v4dwt_decode_step1_sse(dwt->wavelet+b, dwt->dn, _mm_set1_ps(opj_c13318));\n\topj_v4dwt_decode_step2_sse(dwt->wavelet+b, dwt->wavelet+a+1, dwt->sn, opj_int_min(dwt->sn, dwt->dn-a), _mm_set1_ps(opj_dwt_delta));\n\topj_v4dwt_decode_step2_sse(dwt->wavelet+a, dwt->wavelet+b+1, dwt->dn, opj_int_min(dwt->dn, dwt->sn-b), _mm_set1_ps(opj_dwt_gamma));\n\topj_v4dwt_decode_step2_sse(dwt->wavelet+b, dwt->wavelet+a+1, dwt->sn, opj_int_min(dwt->sn, dwt->dn-a), _mm_set1_ps(opj_dwt_beta));\n\topj_v4dwt_decode_step2_sse(dwt->wavelet+a, dwt->wavelet+b+1, dwt->dn, opj_int_min(dwt->dn, dwt->sn-b), _mm_set1_ps(opj_dwt_alpha));\n#else\n\topj_v4dwt_decode_step1(dwt->wavelet+a, dwt->sn, opj_K);\n\topj_v4dwt_decode_step1(dwt->wavelet+b, dwt->dn, opj_c13318);\n\topj_v4dwt_decode_step2(dwt->wavelet+b, dwt->wavelet+a+1, dwt->sn, opj_int_min(dwt->sn, dwt->dn-a), opj_dwt_delta);\n\topj_v4dwt_decode_step2(dwt->wavelet+a, dwt->wavelet+b+1, dwt->dn, opj_int_min(dwt->dn, dwt->sn-b), opj_dwt_gamma);\n\topj_v4dwt_decode_step2(dwt->wavelet+b, dwt->wavelet+a+1, dwt->sn, opj_int_min(dwt->sn, dwt->dn-a), opj_dwt_beta);\n\topj_v4dwt_decode_step2(dwt->wavelet+a, dwt->wavelet+b+1, dwt->dn, opj_int_min(dwt->dn, dwt->sn-b), opj_dwt_alpha);\n#endif\n}\n\n\n/* <summary>                             */\n/* Inverse 9-7 wavelet transform in 2-D. */\n/* </summary>                            */\nOPJ_BOOL opj_dwt_decode_real(opj_tcd_tilecomp_t* restrict tilec, OPJ_UINT32 numres)\n{\n\topj_v4dwt_t h;\n\topj_v4dwt_t v;\n\n\topj_tcd_resolution_t* res = tilec->resolutions;\n\n\tOPJ_UINT32 rw = (OPJ_UINT32)(res->x1 - res->x0);\t/* width of the resolution level computed */\n\tOPJ_UINT32 rh = (OPJ_UINT32)(res->y1 - res->y0);\t/* height of the resolution level computed */\n\n\tOPJ_UINT32 w = (OPJ_UINT32)(tilec->x1 - tilec->x0);\n\n\th.wavelet = (opj_v4_t*) opj_aligned_malloc((opj_dwt_max_resolution(res, numres)+5) * sizeof(opj_v4_t));\n\tv.wavelet = h.wavelet;\n\n\twhile( --numres) {\n\t\tOPJ_FLOAT32 * restrict aj = (OPJ_FLOAT32*) tilec->data;\n\t\tOPJ_UINT32 bufsize = (OPJ_UINT32)((tilec->x1 - tilec->x0) * (tilec->y1 - tilec->y0));\n\t\tOPJ_INT32 j;\n\n\t\th.sn = (OPJ_INT32)rw;\n\t\tv.sn = (OPJ_INT32)rh;\n\n\t\t++res;\n\n\t\trw = (OPJ_UINT32)(res->x1 - res->x0);\t/* width of the resolution level computed */\n\t\trh = (OPJ_UINT32)(res->y1 - res->y0);\t/* height of the resolution level computed */\n\n\t\th.dn = (OPJ_INT32)(rw - (OPJ_UINT32)h.sn);\n\t\th.cas = res->x0 % 2;\n\n\t\tfor(j = (OPJ_INT32)rh; j > 3; j -= 4) {\n\t\t\tOPJ_INT32 k;\n\t\t\topj_v4dwt_interleave_h(&h, aj, (OPJ_INT32)w, (OPJ_INT32)bufsize);\n\t\t\topj_v4dwt_decode(&h);\n\n\t\t\tfor(k = (OPJ_INT32)rw; --k >= 0;){\n\t\t\t\taj[k               ] = h.wavelet[k].f[0];\n\t\t\t\taj[k+(OPJ_INT32)w  ] = h.wavelet[k].f[1];\n\t\t\t\taj[k+(OPJ_INT32)w*2] = h.wavelet[k].f[2];\n\t\t\t\taj[k+(OPJ_INT32)w*3] = h.wavelet[k].f[3];\n\t\t\t}\n\n\t\t\taj += w*4;\n\t\t\tbufsize -= w*4;\n\t\t}\n\n\t\tif (rh & 0x03) {\n\t\t\tOPJ_INT32 k;\n\t\t\tj = rh & 0x03;\n\t\t\topj_v4dwt_interleave_h(&h, aj, (OPJ_INT32)w, (OPJ_INT32)bufsize);\n\t\t\topj_v4dwt_decode(&h);\n\t\t\tfor(k = (OPJ_INT32)rw; --k >= 0;){\n\t\t\t\tswitch(j) {\n\t\t\t\t\tcase 3: aj[k+(OPJ_INT32)w*2] = h.wavelet[k].f[2];\n\t\t\t\t\tcase 2: aj[k+(OPJ_INT32)w  ] = h.wavelet[k].f[1];\n\t\t\t\t\tcase 1: aj[k               ] = h.wavelet[k].f[0];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tv.dn = (OPJ_INT32)(rh - (OPJ_UINT32)v.sn);\n\t\tv.cas = res->y0 % 2;\n\n\t\taj = (OPJ_FLOAT32*) tilec->data;\n\t\tfor(j = (OPJ_INT32)rw; j > 3; j -= 4){\n\t\t\tOPJ_UINT32 k;\n\n\t\t\topj_v4dwt_interleave_v(&v, aj, (OPJ_INT32)w, 4);\n\t\t\topj_v4dwt_decode(&v);\n\n\t\t\tfor(k = 0; k < rh; ++k){\n\t\t\t\tmemcpy(&aj[k*w], &v.wavelet[k], 4 * sizeof(OPJ_FLOAT32));\n\t\t\t}\n\t\t\taj += 4;\n\t\t}\n\n\t\tif (rw & 0x03){\n\t\t\tOPJ_UINT32 k;\n\n\t\t\tj = rw & 0x03;\n\n\t\t\topj_v4dwt_interleave_v(&v, aj, (OPJ_INT32)w, j);\n\t\t\topj_v4dwt_decode(&v);\n\n\t\t\tfor(k = 0; k < rh; ++k){\n\t\t\t\tmemcpy(&aj[k*w], &v.wavelet[k], (size_t)j * sizeof(OPJ_FLOAT32));\n\t\t\t}\n\t\t}\n\t}\n\n\topj_aligned_free(h.wavelet);\n\treturn OPJ_TRUE;\n}\n"
  },
  {
    "path": "ext/openjpeg/dwt.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef __DWT_H\n#define __DWT_H\n/**\n@file dwt.h\n@brief Implementation of a discrete wavelet transform (DWT)\n\nThe functions in DWT.C have for goal to realize forward and inverse discret wavelet\ntransform with filter 5-3 (reversible) and filter 9-7 (irreversible). The functions in\nDWT.C are used by some function in TCD.C.\n*/\n\n/** @defgroup DWT DWT - Implementation of a discrete wavelet transform */\n/*@{*/\n\n\n/** @name Exported functions */\n/*@{*/\n/* ----------------------------------------------------------------------- */\n/**\nForward 5-3 wavelet tranform in 2-D. \nApply a reversible DWT transform to a component of an image.\n@param tilec Tile component information (current tile)\n*/\nOPJ_BOOL opj_dwt_encode(opj_tcd_tilecomp_t * tilec);\n\n/**\nInverse 5-3 wavelet tranform in 2-D.\nApply a reversible inverse DWT transform to a component of an image.\n@param tilec Tile component information (current tile)\n@param numres Number of resolution levels to decode\n*/\nOPJ_BOOL opj_dwt_decode(opj_tcd_tilecomp_t* tilec, OPJ_UINT32 numres);\n\n/**\nGet the gain of a subband for the reversible 5-3 DWT.\n@param orient Number that identifies the subband (0->LL, 1->HL, 2->LH, 3->HH)\n@return Returns 0 if orient = 0, returns 1 if orient = 1 or 2, returns 2 otherwise\n*/\nOPJ_UINT32 opj_dwt_getgain(OPJ_UINT32 orient) ;\n/**\nGet the norm of a wavelet function of a subband at a specified level for the reversible 5-3 DWT.\n@param level Level of the wavelet function\n@param orient Band of the wavelet function\n@return Returns the norm of the wavelet function\n*/\nOPJ_FLOAT64 opj_dwt_getnorm(OPJ_UINT32 level, OPJ_UINT32 orient);\n/**\nForward 9-7 wavelet transform in 2-D. \nApply an irreversible DWT transform to a component of an image.\n@param tilec Tile component information (current tile)\n*/\nOPJ_BOOL opj_dwt_encode_real(opj_tcd_tilecomp_t * tilec);\n/**\nInverse 9-7 wavelet transform in 2-D. \nApply an irreversible inverse DWT transform to a component of an image.\n@param tilec Tile component information (current tile)\n@param numres Number of resolution levels to decode\n*/\nOPJ_BOOL opj_dwt_decode_real(opj_tcd_tilecomp_t* restrict tilec, OPJ_UINT32 numres);\n\n/**\nGet the gain of a subband for the irreversible 9-7 DWT.\n@param orient Number that identifies the subband (0->LL, 1->HL, 2->LH, 3->HH)\n@return Returns the gain of the 9-7 wavelet transform\n*/\nOPJ_UINT32 opj_dwt_getgain_real(OPJ_UINT32 orient);\n/**\nGet the norm of a wavelet function of a subband at a specified level for the irreversible 9-7 DWT\n@param level Level of the wavelet function\n@param orient Band of the wavelet function\n@return Returns the norm of the 9-7 wavelet\n*/\nOPJ_FLOAT64 opj_dwt_getnorm_real(OPJ_UINT32 level, OPJ_UINT32 orient);\n/**\nExplicit calculation of the Quantization Stepsizes \n@param tccp Tile-component coding parameters\n@param prec Precint analyzed\n*/\nvoid opj_dwt_calc_explicit_stepsizes(opj_tccp_t * tccp, OPJ_UINT32 prec);\n/* ----------------------------------------------------------------------- */\n/*@}*/\n\n/*@}*/\n\n#endif /* __DWT_H */\n"
  },
  {
    "path": "ext/openjpeg/event.c",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR \n * Copyright (c) 2012, CS Systemes d'Information, France\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include \"opj_includes.h\"\n\n/* ==========================================================\n     Utility functions\n   ==========================================================*/\n\n#ifdef OPJ_CODE_NOT_USED\n#ifndef _WIN32\nstatic char*\ni2a(unsigned i, char *a, unsigned r) {\n\tif (i/r > 0) a = i2a(i/r,a,r);\n\t*a = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\"[i%r];\n\treturn a+1;\n}\n\n/** \n Transforms integer i into an ascii string and stores the result in a; \n string is encoded in the base indicated by r.\n @param i Number to be converted\n @param a String result\n @param r Base of value; must be in the range 2 - 36\n @return Returns a\n*/\nstatic char *\n_itoa(int i, char *a, int r) {\n\tr = ((r < 2) || (r > 36)) ? 10 : r;\n\tif(i < 0) {\n\t\t*a = '-';\n\t\t*i2a(-i, a+1, r) = 0;\n\t}\n\telse *i2a(i, a, r) = 0;\n\treturn a;\n}\n\n#endif /* !_WIN32 */\n#endif\n\n/* ----------------------------------------------------------------------- */\n/**\n * Default callback function.\n * Do nothing.\n */\nstatic void opj_default_callback (const char *msg, void *client_data)\n{\n    OPJ_ARG_NOT_USED(msg);\n    OPJ_ARG_NOT_USED(client_data);\n}\n\n/* ----------------------------------------------------------------------- */\n\n\n/* ----------------------------------------------------------------------- */\nOPJ_BOOL opj_event_msg(opj_event_mgr_t* p_event_mgr, OPJ_INT32 event_type, const char *fmt, ...) {\n#define OPJ_MSG_SIZE 512 /* 512 bytes should be more than enough for a short message */\n\topj_msg_callback msg_handler = 00;\n\tvoid * l_data = 00;\n\n\tif(p_event_mgr != 00) {\n\t\tswitch(event_type) {\n\t\t\tcase EVT_ERROR:\n\t\t\t\tmsg_handler = p_event_mgr->error_handler;\n\t\t\t\tl_data = p_event_mgr->m_error_data;\n\t\t\t\tbreak;\n\t\t\tcase EVT_WARNING:\n\t\t\t\tmsg_handler = p_event_mgr->warning_handler;\n\t\t\t\tl_data = p_event_mgr->m_warning_data;\n\t\t\t\tbreak;\n\t\t\tcase EVT_INFO:\n\t\t\t\tmsg_handler = p_event_mgr->info_handler;\n\t\t\t\tl_data = p_event_mgr->m_info_data;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t\tif(msg_handler == 00) {\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\t} else {\n\t\treturn OPJ_FALSE;\n\t}\n\n\tif ((fmt != 00) && (p_event_mgr != 00)) {\n\t\tva_list arg;\n\t\tsize_t str_length/*, i, j*/; /* UniPG */\n\t\tchar message[OPJ_MSG_SIZE];\n\t\tmemset(message, 0, OPJ_MSG_SIZE);\n\t\t/* initialize the optional parameter list */\n\t\tva_start(arg, fmt);\n\t\t/* check the length of the format string */\n\t\tstr_length = (strlen(fmt) > OPJ_MSG_SIZE) ? OPJ_MSG_SIZE : strlen(fmt);\n        (void)str_length;\n\t\t/* parse the format string and put the result in 'message' */\n\t\tvsnprintf(message, OPJ_MSG_SIZE, fmt, arg); /* UniPG */\n\t\t/* deinitialize the optional parameter list */\n\t\tva_end(arg);\n\n\t\t/* output the message to the user program */\n\t\tmsg_handler(message, l_data);\n\t}\n\n\treturn OPJ_TRUE;\n}\n\nvoid opj_set_default_event_handler(opj_event_mgr_t * p_manager)\n{\n\tp_manager->m_error_data = 00;\n\tp_manager->m_warning_data = 00;\n\tp_manager->m_info_data = 00;\n\tp_manager->error_handler = opj_default_callback;\n\tp_manager->info_handler = opj_default_callback;\n\tp_manager->warning_handler = opj_default_callback;\n}\n\n"
  },
  {
    "path": "ext/openjpeg/event.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR \n * Copyright (c) 2012, CS Systemes d'Information, France\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n#ifndef __EVENT_H\n#define __EVENT_H\n/**\n@file event.h\n@brief Implementation of a event callback system\n\nThe functions in EVENT.C have for goal to send output messages (errors, warnings, debug) to the user.\n*/\n/**\nMessage handler object\nused for \n<ul>\n<li>Error messages\n<li>Warning messages\n<li>Debugging messages\n</ul>\n*/\ntypedef struct opj_event_mgr \n{\n\t/** Data to call the event manager upon */\n\tvoid *\t\t\tm_error_data;\n\t/** Data to call the event manager upon */\n\tvoid *\t\t\tm_warning_data;\n\t/** Data to call the event manager upon */\n\tvoid *\t\t\tm_info_data;\n\t/** Error message callback if available, NULL otherwise */\n\topj_msg_callback error_handler;\n\t/** Warning message callback if available, NULL otherwise */\n\topj_msg_callback warning_handler;\n\t/** Debug message callback if available, NULL otherwise */\n\topj_msg_callback info_handler;\n} opj_event_mgr_t;\n\n\n#define EVT_ERROR\t1\t/**< Error event type */\n#define EVT_WARNING\t2\t/**< Warning event type */\n#define EVT_INFO\t4\t/**< Debug event type */\n\n/** @defgroup EVENT EVENT - Implementation of a event callback system */\n/*@{*/\n\n/** @name Exported functions (see also openjpeg.h) */\n/*@{*/\n/* ----------------------------------------------------------------------- */\n\n\n/* ----------------------------------------------------------------------- */\n\n/**\n * Write formatted data to a string and send the string to a user callback.\n *\n * @param event_mgr\t\t\tEvent handler\n * @param event_type \t\tEvent type or callback to use to send the message\n * @param fmt \t\t\t\tFormat-control string (plus optional arguments)\n *\n * @return Returns true if successful, returns false otherwise\n */\nOPJ_BOOL opj_event_msg(opj_event_mgr_t* event_mgr, OPJ_INT32 event_type, const char *fmt, ...);\n/* ----------------------------------------------------------------------- */\n\n/**\n * Set the event manager with the default callback function for the 3 levels.\n */\nvoid opj_set_default_event_handler(opj_event_mgr_t * p_manager);\n\n/*@}*/\n\n/*@}*/\n\n#endif /* __EVENT_H */\n"
  },
  {
    "path": "ext/openjpeg/function_list.c",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include \"opj_includes.h\"\n\n/**\n * Default size of the validation list, if not sufficient, data will be reallocated with a double size.\n */\n#define OPJ_VALIDATION_SIZE 10\n\nopj_procedure_list_t *  opj_procedure_list_create()\n{\n        /* memory allocation */\n        opj_procedure_list_t * l_validation = (opj_procedure_list_t *) opj_malloc(sizeof(opj_procedure_list_t));\n        if (! l_validation)\n        {\n                return 00;\n        }\n        /* initialization */\n        memset(l_validation,0,sizeof(opj_procedure_list_t));\n        l_validation->m_nb_max_procedures = OPJ_VALIDATION_SIZE;\n        l_validation->m_procedures = (opj_procedure*)opj_malloc(\n                OPJ_VALIDATION_SIZE * sizeof(opj_procedure));\n        if (! l_validation->m_procedures)\n        {\n                opj_free(l_validation);\n                return 00;\n        }\n        memset(l_validation->m_procedures,0,OPJ_VALIDATION_SIZE * sizeof(opj_procedure));\n        return l_validation;\n}\n\nvoid  opj_procedure_list_destroy(opj_procedure_list_t * p_list)\n{\n        if (! p_list)\n        {\n                return;\n        }\n        /* initialization */\n        if (p_list->m_procedures)\n        {\n                opj_free(p_list->m_procedures);\n        }\n        opj_free(p_list);\n}\n\nOPJ_BOOL opj_procedure_list_add_procedure (opj_procedure_list_t * p_validation_list, opj_procedure p_procedure)\n{\n        if (p_validation_list->m_nb_max_procedures == p_validation_list->m_nb_procedures)\n        {\n                opj_procedure * new_procedures;\n\n                p_validation_list->m_nb_max_procedures += OPJ_VALIDATION_SIZE;\n                new_procedures = (opj_procedure*)opj_realloc(\n                        p_validation_list->m_procedures,\n                        p_validation_list->m_nb_max_procedures * sizeof(opj_procedure));\n                if (! new_procedures)\n                {\n                        opj_free(p_validation_list->m_procedures);\n                        p_validation_list->m_nb_max_procedures = 0;\n                        p_validation_list->m_nb_procedures = 0;\n                        /* opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to add a new validation procedure\\n\"); */\n                        fprintf(stderr, \"Not enough memory to add a new validation procedure\\n\");\n                        \n                        return OPJ_FALSE;\n                }\n                else\n                {\n                        p_validation_list->m_procedures = new_procedures;\n                }\n        }\n        p_validation_list->m_procedures[p_validation_list->m_nb_procedures] = p_procedure;\n        ++p_validation_list->m_nb_procedures;\n\n        return OPJ_TRUE;\n}\n\nOPJ_UINT32 opj_procedure_list_get_nb_procedures (opj_procedure_list_t * p_validation_list)\n{\n        return p_validation_list->m_nb_procedures;\n}\n\nopj_procedure* opj_procedure_list_get_first_procedure (opj_procedure_list_t * p_validation_list)\n{\n        return p_validation_list->m_procedures;\n}\n\nvoid opj_procedure_list_clear (opj_procedure_list_t * p_validation_list)\n{\n        p_validation_list->m_nb_procedures = 0;\n}\n"
  },
  {
    "path": "ext/openjpeg/function_list.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef __FUNCTION_LIST_H\n#define __FUNCTION_LIST_H\n\n/** \n * @file function_list.h\n * @brief Implementation of a list of procedures.\n\n * The functions in validation.c aims to have access to a list of procedures.\n*/\n\n/** @defgroup VAL VAL - validation procedure*/\n/*@{*/\n\n/**************************************************************************************************\n ***************************************** FORWARD DECLARATION ************************************\n **************************************************************************************************/\n\n/**\n * declare a function pointer\n */\ntypedef void (*opj_procedure)(void);\n\n/**\n * A list of procedures.\n*/\ntypedef struct opj_procedure_list \n{\n\t/**\n\t * The number of validation procedures.\n\t */\n\tOPJ_UINT32 m_nb_procedures;\n\t/**\n\t * The number of the array of validation procedures.\n\t */\n\tOPJ_UINT32 m_nb_max_procedures;\n\t/**\n\t * The array of procedures.\n\t */\n\topj_procedure * m_procedures;\n\n} opj_procedure_list_t;\n\n/* ----------------------------------------------------------------------- */\n\n/**\n * Creates a validation list.\n *\n * @return\tthe newly created validation list.\n */\nopj_procedure_list_t *  opj_procedure_list_create(void);\n\n/**\n * Destroys a validation list.\n *\n * @param p_list the list to destroy.\n */\nvoid  opj_procedure_list_destroy(opj_procedure_list_t * p_list);\n\n/**\n * Adds a new validation procedure.\n *\n * @param\tp_validation_list the list of procedure to modify.\n * @param\tp_procedure\t\tthe procedure to add.\n *\n * @return\tOPJ_TRUE if the procedure could be added.\n */\nOPJ_BOOL opj_procedure_list_add_procedure (opj_procedure_list_t * p_validation_list, opj_procedure p_procedure);\n\n/**\n * Gets the number of validation procedures.\n *\n * @param\tp_validation_list the list of procedure to modify.\n *\n * @return the number of validation procedures.\n */\nOPJ_UINT32 opj_procedure_list_get_nb_procedures (opj_procedure_list_t * p_validation_list);\n\n/**\n * Gets the pointer on the first validation procedure. This function is similar to the C++\n * iterator class to iterate through all the procedures inside the validation list.\n * the caller does not take ownership of the pointer.\n *\n * @param\tp_validation_list the list of procedure to get the first procedure from.\n *\n * @return\ta pointer to the first procedure.\n */\nopj_procedure* opj_procedure_list_get_first_procedure (opj_procedure_list_t * p_validation_list);\n\n\n/**\n * Clears the list of validation procedures.\n *\n * @param\tp_validation_list the list of procedure to clear.\n *\n */\nvoid opj_procedure_list_clear (opj_procedure_list_t * p_validation_list);\n/*@}*/\n\n#endif /* __FUNCTION_LIST_H */\n\n"
  },
  {
    "path": "ext/openjpeg/image.c",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include \"opj_includes.h\"\n\nopj_image_t* opj_image_create0(void) {\n\topj_image_t *image = (opj_image_t*)opj_calloc(1, sizeof(opj_image_t));\n\treturn image;\n}\n\nopj_image_t* OPJ_CALLCONV opj_image_create(OPJ_UINT32 numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc) {\n\tOPJ_UINT32 compno;\n\topj_image_t *image = NULL;\n\n\timage = (opj_image_t*) opj_calloc(1, sizeof(opj_image_t));\n\tif(image) {\n\t\timage->color_space = clrspc;\n\t\timage->numcomps = numcmpts;\n\t\t/* allocate memory for the per-component information */\n\t\timage->comps = (opj_image_comp_t*)opj_calloc(1,image->numcomps * sizeof(opj_image_comp_t));\n\t\tif(!image->comps) {\n\t\t\tfprintf(stderr,\"Unable to allocate memory for image.\\n\");\n\t\t\topj_image_destroy(image);\n\t\t\treturn NULL;\n\t\t}\n\t\t/* create the individual image components */\n\t\tfor(compno = 0; compno < numcmpts; compno++) {\n\t\t\topj_image_comp_t *comp = &image->comps[compno];\n\t\t\tcomp->dx = cmptparms[compno].dx;\n\t\t\tcomp->dy = cmptparms[compno].dy;\n\t\t\tcomp->w = cmptparms[compno].w;\n\t\t\tcomp->h = cmptparms[compno].h;\n\t\t\tcomp->x0 = cmptparms[compno].x0;\n\t\t\tcomp->y0 = cmptparms[compno].y0;\n\t\t\tcomp->prec = cmptparms[compno].prec;\n\t\t\tcomp->bpp = cmptparms[compno].bpp;\n\t\t\tcomp->sgnd = cmptparms[compno].sgnd;\n\t\t\tcomp->data = (OPJ_INT32*) opj_calloc(comp->w * comp->h, sizeof(OPJ_INT32));\n\t\t\tif(!comp->data) {\n\t\t\t\tfprintf(stderr,\"Unable to allocate memory for image.\\n\");\n\t\t\t\topj_image_destroy(image);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn image;\n}\n\nvoid OPJ_CALLCONV opj_image_destroy(opj_image_t *image) {\n\tif(image) {\n\t\tif(image->comps) {\n\t\t\tOPJ_UINT32 compno;\n\n\t\t\t/* image components */\n\t\t\tfor(compno = 0; compno < image->numcomps; compno++) {\n\t\t\t\topj_image_comp_t *image_comp = &(image->comps[compno]);\n\t\t\t\tif(image_comp->data) {\n\t\t\t\t\topj_free(image_comp->data);\n\t\t\t\t}\n\t\t\t}\n\t\t\topj_free(image->comps);\n\t\t}\n\n\t\tif(image->icc_profile_buf) {\n\t\t\topj_free(image->icc_profile_buf);\n\t\t}\n\n\t\topj_free(image);\n\t}\n}\n\n/**\n * Updates the components characteristics of the image from the coding parameters.\n *\n * @param p_image_header\tthe image header to update.\n * @param p_cp\t\t\t\tthe coding parameters from which to update the image.\n */\nvoid opj_image_comp_header_update(opj_image_t * p_image_header, const struct opj_cp * p_cp)\n{\n\tOPJ_UINT32 i, l_width, l_height;\n\tOPJ_INT32 l_x0, l_y0, l_x1, l_y1;\n\tOPJ_INT32 l_comp_x0, l_comp_y0, l_comp_x1, l_comp_y1;\n\topj_image_comp_t* l_img_comp = NULL;\n\n\tl_x0 = opj_int_max((OPJ_INT32)p_cp->tx0 , (OPJ_INT32)p_image_header->x0);\n\tl_y0 = opj_int_max((OPJ_INT32)p_cp->ty0 , (OPJ_INT32)p_image_header->y0);\n\tl_x1 = opj_int_min((OPJ_INT32)(p_cp->tx0 + p_cp->tw * p_cp->tdx), (OPJ_INT32)p_image_header->x1);\n\tl_y1 = opj_int_min((OPJ_INT32)(p_cp->ty0 + p_cp->th * p_cp->tdy), (OPJ_INT32)p_image_header->y1);\n\n\tl_img_comp = p_image_header->comps;\n\tfor\t(i = 0; i < p_image_header->numcomps; ++i) {\n\t\tl_comp_x0 = opj_int_ceildiv(l_x0, (OPJ_INT32)l_img_comp->dx);\n\t\tl_comp_y0 = opj_int_ceildiv(l_y0, (OPJ_INT32)l_img_comp->dy);\n\t\tl_comp_x1 = opj_int_ceildiv(l_x1, (OPJ_INT32)l_img_comp->dx);\n\t\tl_comp_y1 = opj_int_ceildiv(l_y1, (OPJ_INT32)l_img_comp->dy);\n\t\tl_width = (OPJ_UINT32)opj_int_ceildivpow2(l_comp_x1 - l_comp_x0, (OPJ_INT32)l_img_comp->factor);\n\t\tl_height = (OPJ_UINT32)opj_int_ceildivpow2(l_comp_y1 - l_comp_y0, (OPJ_INT32)l_img_comp->factor);\n\t\tl_img_comp->w = l_width;\n\t\tl_img_comp->h = l_height;\n\t\tl_img_comp->x0 = (OPJ_UINT32)l_comp_x0/*l_x0*/;\n\t\tl_img_comp->y0 = (OPJ_UINT32)l_comp_y0/*l_y0*/;\n\t\t++l_img_comp;\n\t}\n}\n\n\n/**\n * Copy only header of image and its component header (no data are copied)\n * if dest image have data, they will be freed\n *\n * @param\tp_image_src\t\tthe src image\n * @param\tp_image_dest\tthe dest image\n *\n */\nvoid opj_copy_image_header(const opj_image_t* p_image_src, opj_image_t* p_image_dest)\n{\n\tOPJ_UINT32 compno;\n\n\t/* preconditions */\n\tassert(p_image_src != 00);\n\tassert(p_image_dest != 00);\n\n\tp_image_dest->x0 = p_image_src->x0;\n\tp_image_dest->y0 = p_image_src->y0;\n\tp_image_dest->x1 = p_image_src->x1;\n\tp_image_dest->y1 = p_image_src->y1;\n\n\tif (p_image_dest->comps){\n\t\tfor(compno = 0; compno < p_image_dest->numcomps; compno++) {\n\t\t\topj_image_comp_t *image_comp = &(p_image_dest->comps[compno]);\n\t\t\tif(image_comp->data) {\n\t\t\t\topj_free(image_comp->data);\n\t\t\t}\n\t\t}\n\t\topj_free(p_image_dest->comps);\n\t\tp_image_dest->comps = NULL;\n\t}\n\n\tp_image_dest->numcomps = p_image_src->numcomps;\n\n\tp_image_dest->comps = (opj_image_comp_t*) opj_malloc(p_image_dest->numcomps * sizeof(opj_image_comp_t));\n\tif (!p_image_dest->comps){\n\t\tp_image_dest->comps = NULL;\n\t\tp_image_dest->numcomps = 0;\n\t\treturn;\n\t}\n\n\tfor (compno=0; compno < p_image_dest->numcomps; compno++){\n\t\tmemcpy( &(p_image_dest->comps[compno]),\n\t\t\t\t&(p_image_src->comps[compno]),\n\t\t\t\tsizeof(opj_image_comp_t));\n\t\tp_image_dest->comps[compno].data = NULL;\n\t}\n\n\tp_image_dest->color_space = p_image_src->color_space;\n\tp_image_dest->icc_profile_len = p_image_src->icc_profile_len;\n\n\tif (p_image_dest->icc_profile_len) {\n\t\tp_image_dest->icc_profile_buf = (OPJ_BYTE*)opj_malloc(p_image_dest->icc_profile_len);\n\t\tif (!p_image_dest->icc_profile_buf){\n\t\t\tp_image_dest->icc_profile_buf = NULL;\n\t\t\tp_image_dest->icc_profile_len = 0;\n\t\t\treturn;\n\t\t}\n\t\tmemcpy( p_image_dest->icc_profile_buf,\n\t\t\t\tp_image_src->icc_profile_buf,\n\t\t\t\tp_image_src->icc_profile_len);\n\t\t}\n\t\telse\n\t\t\tp_image_dest->icc_profile_buf = NULL;\n\n\treturn;\n}\n\nopj_image_t* OPJ_CALLCONV opj_image_tile_create(OPJ_UINT32 numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc) {\n\tOPJ_UINT32 compno;\n\topj_image_t *image = 00;\n\n\timage = (opj_image_t*) opj_malloc(sizeof(opj_image_t));\n\tif (image)\n\t{\n\t\tmemset(image,0,sizeof(opj_image_t));\n\t\t\n\t\timage->color_space = clrspc;\n\t\timage->numcomps = numcmpts;\n\t\t\n\t\t/* allocate memory for the per-component information */\n\t\timage->comps = (opj_image_comp_t*)opj_malloc(image->numcomps * sizeof(opj_image_comp_t));\n\t\tif (!image->comps) {\n\t\t\topj_image_destroy(image);\n\t\t\treturn 00;\n\t\t}\n\t\tmemset(image->comps,0,image->numcomps * sizeof(opj_image_comp_t));\n\t\t\n\t\t/* create the individual image components */\n\t\tfor(compno = 0; compno < numcmpts; compno++) {\n\t\t\topj_image_comp_t *comp = &image->comps[compno];\n\t\t\tcomp->dx = cmptparms[compno].dx;\n\t\t\tcomp->dy = cmptparms[compno].dy;\n\t\t\tcomp->w = cmptparms[compno].w;\n\t\t\tcomp->h = cmptparms[compno].h;\n\t\t\tcomp->x0 = cmptparms[compno].x0;\n\t\t\tcomp->y0 = cmptparms[compno].y0;\n\t\t\tcomp->prec = cmptparms[compno].prec;\n\t\t\tcomp->sgnd = cmptparms[compno].sgnd;\n\t\t\tcomp->data = 0;\n\t\t}\n\t}\n\n\treturn image;\n}\n"
  },
  {
    "path": "ext/openjpeg/image.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n#ifndef __IMAGE_H\n#define __IMAGE_H\n/**\n@file image.h\n@brief Implementation of operations on images (IMAGE)\n\nThe functions in IMAGE.C have for goal to realize operations on images.\n*/\n\nstruct opj_image;\nstruct opj_cp;\n\n/** @defgroup IMAGE IMAGE - Implementation of operations on images */\n/*@{*/\n\n/**\n * Create an empty image\n *\n * @return returns an empty image if successful, returns NULL otherwise\n */\nopj_image_t* opj_image_create0(void);\n\n\n\n/**\n * Updates the components characteristics of the image from the coding parameters.\n *\n * @param p_image_header\t\tthe image header to update.\n * @param p_cp\t\t\t\t\tthe coding parameters from which to update the image.\n */\nvoid opj_image_comp_header_update(opj_image_t * p_image, const struct opj_cp* p_cp);\n\nvoid opj_copy_image_header(const opj_image_t* p_image_src, opj_image_t* p_image_dest);\n\n/*@}*/\n\n#endif /* __IMAGE_H */\n\n"
  },
  {
    "path": "ext/openjpeg/indexbox_manager.h",
    "content": "/*\n * $Id: indexbox_manager.h 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2003-2004, Yannick Verschueren\n * Copyright (c) 2010-2011, Kaori Hagihara\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*! \\file\n *  \\brief Modification of jpip.c from 2KAN indexer\n */\n\n#ifndef  INDEXBOX_MANAGER_H_\n# define INDEXBOX_MANAGER_H_\n\n#include \"openjpeg.h\"\n#include \"j2k.h\" /* needed to use jp2.h */\n#include \"jp2.h\"\n\n#define JPIP_CIDX 0x63696478   /* Codestream index                */\n#define JPIP_CPTR 0x63707472   /* Codestream Finder Box           */\n#define JPIP_MANF 0x6d616e66   /* Manifest Box                    */\n#define JPIP_FAIX 0x66616978   /* Fragment array Index box        */\n#define JPIP_MHIX 0x6d686978   /* Main Header Index Table         */\n#define JPIP_TPIX 0x74706978   /* Tile-part Index Table box       */\n#define JPIP_THIX 0x74686978   /* Tile header Index Table box     */\n#define JPIP_PPIX 0x70706978   /* Precinct Packet Index Table box */\n#define JPIP_PHIX 0x70686978   /* Packet Header index Table       */\n#define JPIP_FIDX 0x66696478   /* File Index                      */\n#define JPIP_FPTR 0x66707472   /* File Finder                     */\n#define JPIP_PRXY 0x70727879   /* Proxy boxes                     */\n#define JPIP_IPTR 0x69707472   /* Index finder box                */\n#define JPIP_PHLD 0x70686c64   /* Place holder                    */\n\n\n/* \n * Write tile-part Index table box (superbox)\n *\n * @param[in] coff      offset of j2k codestream\n * @param[in] cstr_info codestream information\n * @param[in] j2klen    length of j2k codestream\n * @param[in] cio       file output handle\n * @return              length of tpix box\n */\nint opj_write_tpix( int coff, opj_codestream_info_t cstr_info, int j2klen, opj_stream_private_t *cio,\n              opj_event_mgr_t * p_manager );\n\n\n/* \n * Write tile header index table box (superbox)\n *\n * @param[in] coff      offset of j2k codestream\n * @param[in] cstr_info codestream information pointer\n * @param[in] cio       file output handle\n * @return              length of thix box\n */\nint opj_write_thix( int coff, opj_codestream_info_t cstr_info, opj_stream_private_t *cio, opj_event_mgr_t * p_manager );\n\n\n/* \n * Write precinct packet index table box (superbox)\n *\n * @param[in] coff      offset of j2k codestream\n * @param[in] cstr_info codestream information\n * @param[in] EPHused   true if EPH option used\n * @param[in] j2klen    length of j2k codestream\n * @param[in] cio       file output handle\n * @return              length of ppix box\n */\nint opj_write_ppix( int coff, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio,\n              opj_event_mgr_t * p_manager );\n\n\n/* \n * Write packet header index table box (superbox)\n *\n * @param[in] coff      offset of j2k codestream\n * @param[in] cstr_info codestream information\n * @param[in] EPHused   true if EPH option used\n * @param[in] j2klen    length of j2k codestream\n * @param[in] cio       file output handle\n * @return              length of ppix box\n */\nint opj_write_phix( int coff, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio,\n              opj_event_mgr_t * p_manager );\n\n/* \n * Wriet manifest box (box)\n *\n * @param[in] second number to be visited\n * @param[in] v      number of boxes\n * @param[in] box    box to be manifested\n * @param[in] cio    file output handle\n */\n\nvoid opj_write_manf(int second, \n                    int v, \n                    opj_jp2_box_t *box, \n                    opj_stream_private_t *cio,\n                    opj_event_mgr_t * p_manager );\n\n/* \n * Write main header index table (box)\n *\n * @param[in] coff offset of j2k codestream\n * @param[in] cstr_info codestream information\n * @param[in] cio  file output handle\n * @return         length of mainmhix box\n */\nint opj_write_mainmhix( int coff, opj_codestream_info_t cstr_info, opj_stream_private_t *cio,\n              opj_event_mgr_t * p_manager );\n\nint opj_write_phixfaix( int coff, int compno, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio,\n              opj_event_mgr_t * p_manager );\n\nint opj_write_ppixfaix( int coff, int compno, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio,\n              opj_event_mgr_t * p_manager );\n\nint opj_write_tilemhix( int coff, opj_codestream_info_t cstr_info, int tileno, opj_stream_private_t *cio,\n              opj_event_mgr_t * p_manager );\n\nint opj_write_tpixfaix( int coff, int compno, opj_codestream_info_t cstr_info, int j2klen, opj_stream_private_t *cio,\n              opj_event_mgr_t * p_manager );\n\n#endif      /* !INDEXBOX_MANAGER_H_ */\n"
  },
  {
    "path": "ext/openjpeg/invert.c",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include \"opj_includes.h\"\n\n/** \n * LUP decomposition\n */\nstatic OPJ_BOOL opj_lupDecompose(OPJ_FLOAT32 * matrix,\n                                 OPJ_UINT32 * permutations, \n                                 OPJ_FLOAT32 * p_swap_area,\n                                 OPJ_UINT32 nb_compo);\n/** \n * LUP solving\n */\nstatic void opj_lupSolve(OPJ_FLOAT32 * pResult, \n                         OPJ_FLOAT32* pMatrix, \n                         OPJ_FLOAT32* pVector, \n                         OPJ_UINT32* pPermutations, \n                         OPJ_UINT32 nb_compo,\n                         OPJ_FLOAT32 * p_intermediate_data);\n\n/** \n *LUP inversion (call with the result of lupDecompose)\n */\nstatic void opj_lupInvert ( OPJ_FLOAT32 * pSrcMatrix,\n                            OPJ_FLOAT32 * pDestMatrix,\n                            OPJ_UINT32 nb_compo,\n                            OPJ_UINT32 * pPermutations,\n                            OPJ_FLOAT32 * p_src_temp,\n                            OPJ_FLOAT32 * p_dest_temp,\n                            OPJ_FLOAT32 * p_swap_area);\n\n/*\n==========================================================\n   Matric inversion interface\n==========================================================\n*/\n/**\n * Matrix inversion.\n */\nOPJ_BOOL opj_matrix_inversion_f(OPJ_FLOAT32 * pSrcMatrix,\n                                OPJ_FLOAT32 * pDestMatrix, \n                                OPJ_UINT32 nb_compo)\n{\n\tOPJ_BYTE * l_data = 00;\n\tOPJ_UINT32 l_permutation_size = nb_compo * (OPJ_UINT32)sizeof(OPJ_UINT32);\n\tOPJ_UINT32 l_swap_size = nb_compo * (OPJ_UINT32)sizeof(OPJ_FLOAT32);\n\tOPJ_UINT32 l_total_size = l_permutation_size + 3 * l_swap_size;\n\tOPJ_UINT32 * lPermutations = 00;\n\tOPJ_FLOAT32 * l_double_data = 00;\n\n\tl_data = (OPJ_BYTE *) opj_malloc(l_total_size);\n\tif (l_data == 0) {\n\t\treturn OPJ_FALSE;\n\t}\n\tlPermutations = (OPJ_UINT32 *) l_data;\n\tl_double_data = (OPJ_FLOAT32 *) (l_data + l_permutation_size);\n\tmemset(lPermutations,0,l_permutation_size);\n\n\tif(! opj_lupDecompose(pSrcMatrix,lPermutations,l_double_data,nb_compo)) {\n\t\topj_free(l_data);\n\t\treturn OPJ_FALSE;\n\t}\n\t\n    opj_lupInvert(pSrcMatrix,pDestMatrix,nb_compo,lPermutations,l_double_data,l_double_data + nb_compo,l_double_data + 2*nb_compo);\n\topj_free(l_data);\n\t\n    return OPJ_TRUE;\n}\n\n\n/*\n==========================================================\n   Local functions\n==========================================================\n*/\nOPJ_BOOL opj_lupDecompose(OPJ_FLOAT32 * matrix,OPJ_UINT32 * permutations, \n                          OPJ_FLOAT32 * p_swap_area,\n                          OPJ_UINT32 nb_compo) \n{\n\tOPJ_UINT32 * tmpPermutations = permutations;\n\tOPJ_UINT32 * dstPermutations;\n\tOPJ_UINT32 k2=0,t;\n\tOPJ_FLOAT32 temp;\n\tOPJ_UINT32 i,j,k;\n\tOPJ_FLOAT32 p;\n\tOPJ_UINT32 lLastColum = nb_compo - 1;\n\tOPJ_UINT32 lSwapSize = nb_compo * (OPJ_UINT32)sizeof(OPJ_FLOAT32);\n\tOPJ_FLOAT32 * lTmpMatrix = matrix;\n\tOPJ_FLOAT32 * lColumnMatrix,* lDestMatrix;\n\tOPJ_UINT32 offset = 1;\n\tOPJ_UINT32 lStride = nb_compo-1;\n\n\t/*initialize permutations */\n\tfor (i = 0; i < nb_compo; ++i) \n\t{\n    \t*tmpPermutations++ = i;\n\t}\n\t/* now make a pivot with colum switch */\n\ttmpPermutations = permutations;\n\tfor (k = 0; k < lLastColum; ++k) {\n\t\tp = 0.0;\n\n\t\t/* take the middle element */\n\t\tlColumnMatrix = lTmpMatrix + k;\n\t\t\n\t\t/* make permutation with the biggest value in the column */\n        for (i = k; i < nb_compo; ++i) {\n\t\t\ttemp = ((*lColumnMatrix > 0) ? *lColumnMatrix : -(*lColumnMatrix));\n     \t\tif (temp > p) {\n     \t\t\tp = temp;\n     \t\t\tk2 = i;\n     \t\t}\n\t\t\t/* next line */\n\t\t\tlColumnMatrix += nb_compo;\n     \t}\n\n     \t/* a whole rest of 0 -> non singular */\n     \tif (p == 0.0) {\n    \t\treturn OPJ_FALSE;\n\t\t}\n\n\t\t/* should we permute ? */\n\t\tif (k2 != k) {\n\t\t\t/*exchange of line */\n     \t\t/* k2 > k */\n\t\t\tdstPermutations = tmpPermutations + k2 - k;\n\t\t\t/* swap indices */\n\t\t\tt = *tmpPermutations;\n     \t\t*tmpPermutations = *dstPermutations;\n     \t\t*dstPermutations = t;\n\n\t\t\t/* and swap entire line. */\n\t\t\tlColumnMatrix = lTmpMatrix + (k2 - k) * nb_compo;\n\t\t\tmemcpy(p_swap_area,lColumnMatrix,lSwapSize);\n\t\t\tmemcpy(lColumnMatrix,lTmpMatrix,lSwapSize);\n\t\t\tmemcpy(lTmpMatrix,p_swap_area,lSwapSize);\n\t\t}\n\n\t\t/* now update data in the rest of the line and line after */\n\t\tlDestMatrix = lTmpMatrix + k;\n\t\tlColumnMatrix = lDestMatrix + nb_compo;\n\t\t/* take the middle element */\n\t\ttemp = *(lDestMatrix++);\n\n\t\t/* now compute up data (i.e. coeff up of the diagonal). */\n     \tfor (i = offset; i < nb_compo; ++i)  {\n\t\t\t/*lColumnMatrix; */\n\t\t\t/* divide the lower column elements by the diagonal value */\n\n\t\t\t/* matrix[i][k] /= matrix[k][k]; */\n     \t\t/* p = matrix[i][k] */\n\t\t\tp = *lColumnMatrix / temp;\n\t\t\t*(lColumnMatrix++) = p;\n     \t\t\n            for (j = /* k + 1 */ offset; j < nb_compo; ++j) {\n\t\t\t\t/* matrix[i][j] -= matrix[i][k] * matrix[k][j]; */\n     \t\t\t*(lColumnMatrix++) -= p * (*(lDestMatrix++));\n\t\t\t}\n\t\t\t/* come back to the k+1th element */\n\t\t\tlDestMatrix -= lStride;\n\t\t\t/* go to kth element of the next line */\n\t\t\tlColumnMatrix += k;\n     \t}\n\n\t\t/* offset is now k+2 */\n\t\t++offset;\n\t\t/* 1 element less for stride */\n\t\t--lStride;\n\t\t/* next line */\n\t\tlTmpMatrix+=nb_compo;\n\t\t/* next permutation element */\n\t\t++tmpPermutations;\n\t}\n    return OPJ_TRUE;\n}\n   \t\t\nvoid opj_lupSolve (OPJ_FLOAT32 * pResult, \n                   OPJ_FLOAT32 * pMatrix, \n                   OPJ_FLOAT32 * pVector, \n                   OPJ_UINT32* pPermutations, \n                   OPJ_UINT32 nb_compo,OPJ_FLOAT32 * p_intermediate_data) \n{\n\tOPJ_INT32 k;\n    OPJ_UINT32 i,j;\n\tOPJ_FLOAT32 sum;\n\tOPJ_FLOAT32 u;\n    OPJ_UINT32 lStride = nb_compo+1;\n\tOPJ_FLOAT32 * lCurrentPtr;\n\tOPJ_FLOAT32 * lIntermediatePtr;\n\tOPJ_FLOAT32 * lDestPtr;\n\tOPJ_FLOAT32 * lTmpMatrix;\n\tOPJ_FLOAT32 * lLineMatrix = pMatrix;\n\tOPJ_FLOAT32 * lBeginPtr = pResult + nb_compo - 1;\n\tOPJ_FLOAT32 * lGeneratedData;\n\tOPJ_UINT32 * lCurrentPermutationPtr = pPermutations;\n\n\t\n\tlIntermediatePtr = p_intermediate_data;\n\tlGeneratedData = p_intermediate_data + nb_compo - 1;\n\t\n    for (i = 0; i < nb_compo; ++i) {\n       \tsum = 0.0;\n\t\tlCurrentPtr = p_intermediate_data;\n\t\tlTmpMatrix = lLineMatrix;\n        for (j = 1; j <= i; ++j) \n\t\t{\n\t\t\t/* sum += matrix[i][j-1] * y[j-1]; */\n        \tsum += (*(lTmpMatrix++)) * (*(lCurrentPtr++));\n        }\n\t\t/*y[i] = pVector[pPermutations[i]] - sum; */\n        *(lIntermediatePtr++) = pVector[*(lCurrentPermutationPtr++)] - sum;\n\t\tlLineMatrix += nb_compo;\n\t}\n\n\t/* we take the last point of the matrix */\n\tlLineMatrix = pMatrix + nb_compo*nb_compo - 1;\n\n\t/* and we take after the last point of the destination vector */\n\tlDestPtr = pResult + nb_compo;\n\n\n    assert(nb_compo != 0);\n\tfor (k = (OPJ_INT32)nb_compo - 1; k != -1 ; --k) {\n\t\tsum = 0.0;\n\t\tlTmpMatrix = lLineMatrix;\n        u = *(lTmpMatrix++);\n\t\tlCurrentPtr = lDestPtr--;\n        for (j = (OPJ_UINT32)(k + 1); j < nb_compo; ++j) {\n\t\t\t/* sum += matrix[k][j] * x[j] */\n        \tsum += (*(lTmpMatrix++)) * (*(lCurrentPtr++));\n\t\t}\n\t\t/*x[k] = (y[k] - sum) / u; */\n        *(lBeginPtr--) = (*(lGeneratedData--) - sum) / u;\n\t\tlLineMatrix -= lStride;\n\t}\n}\n    \n\nvoid opj_lupInvert (OPJ_FLOAT32 * pSrcMatrix,\n                    OPJ_FLOAT32 * pDestMatrix,\n                    OPJ_UINT32 nb_compo,\n                    OPJ_UINT32 * pPermutations,\n                    OPJ_FLOAT32 * p_src_temp,\n                    OPJ_FLOAT32 * p_dest_temp,\n                    OPJ_FLOAT32 * p_swap_area )\n{\n\tOPJ_UINT32 j,i;\n\tOPJ_FLOAT32 * lCurrentPtr;\n\tOPJ_FLOAT32 * lLineMatrix = pDestMatrix;\n\tOPJ_UINT32 lSwapSize = nb_compo * (OPJ_UINT32)sizeof(OPJ_FLOAT32);\n\n\tfor (j = 0; j < nb_compo; ++j) {\n\t\tlCurrentPtr = lLineMatrix++;\n        memset(p_src_temp,0,lSwapSize);\n    \tp_src_temp[j] = 1.0;\n\t\topj_lupSolve(p_dest_temp,pSrcMatrix,p_src_temp, pPermutations, nb_compo , p_swap_area);\n\n\t\tfor (i = 0; i < nb_compo; ++i) {\n    \t\t*(lCurrentPtr) = p_dest_temp[i];\n\t\t\tlCurrentPtr+=nb_compo;\n    \t}\n    }\n}\n\n"
  },
  {
    "path": "ext/openjpeg/invert.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef __INVERT_H\n#define __INVERT_H\n/**\n@file invert.h\n@brief Implementation of the matrix inversion\n\nThe function in INVERT.H compute a matrix inversion with a LUP method\n*/\n\n/** @defgroup INVERT INVERT - Implementation of a matrix inversion */\n/*@{*/\n/** @name Exported functions */\n/*@{*/\n/* ----------------------------------------------------------------------- */\n\n/**\n * Calculates a n x n double matrix inversion with a LUP method. Data is aligned, rows after rows (or columns after columns).\n * The function does not take ownership of any memory block, data must be fred by the user.\n *\n * @param pSrcMatrix\tthe matrix to invert.\n * @param pDestMatrix\tdata to store the inverted matrix. \n * @param n size of the matrix\n * @return OPJ_TRUE if the inversion is successful, OPJ_FALSE if the matrix is singular.\n */\nOPJ_BOOL opj_matrix_inversion_f(OPJ_FLOAT32 * pSrcMatrix,\n                                OPJ_FLOAT32 * pDestMatrix, \n                                OPJ_UINT32 nb_compo);\n/* ----------------------------------------------------------------------- */\n/*@}*/\n\n/*@}*/\n\n#endif /* __INVERT_H */ \n"
  },
  {
    "path": "ext/openjpeg/j2k.c",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>\n * Copyright (c) 2006-2007, Parvatha Elangovan\n * Copyright (c) 2010-2011, Kaori Hagihara\n * Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France \n * Copyright (c) 2012, CS Systemes d'Information, France\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include \"opj_includes.h\"\n\n/** @defgroup J2K J2K - JPEG-2000 codestream reader/writer */\n/*@{*/\n\n/** @name Local static functions */\n/*@{*/\n\n/**\n * Sets up the procedures to do on reading header. Developpers wanting to extend the library can add their own reading procedures.\n */\nstatic void opj_j2k_setup_header_reading (opj_j2k_t *p_j2k);\n\n/**\n * The read header procedure.\n */\nstatic OPJ_BOOL opj_j2k_read_header_procedure(  opj_j2k_t *p_j2k,\n                                                opj_stream_private_t *p_stream,\n                                                opj_event_mgr_t * p_manager);\n\n/**\n * The default encoding validation procedure without any extension.\n *\n * @param       p_j2k                   the jpeg2000 codec to validate.\n * @param       p_stream                the input stream to validate.\n * @param       p_manager               the user event manager.\n *\n * @return true if the parameters are correct.\n */\nstatic OPJ_BOOL opj_j2k_encoding_validation (   opj_j2k_t * p_j2k,\n                                                opj_stream_private_t *p_stream,\n                                                opj_event_mgr_t * p_manager );\n\n/**\n * The default decoding validation procedure without any extension.\n *\n * @param       p_j2k                   the jpeg2000 codec to validate.\n * @param       p_stream                                the input stream to validate.\n * @param       p_manager               the user event manager.\n *\n * @return true if the parameters are correct.\n */\nstatic OPJ_BOOL opj_j2k_decoding_validation (   opj_j2k_t * p_j2k,\n                                                opj_stream_private_t *p_stream,\n                                                opj_event_mgr_t * p_manager );\n\n/**\n * Sets up the validation ,i.e. adds the procedures to lauch to make sure the codec parameters\n * are valid. Developpers wanting to extend the library can add their own validation procedures.\n */\nstatic void opj_j2k_setup_encoding_validation (opj_j2k_t *p_j2k);\n\n/**\n * Sets up the validation ,i.e. adds the procedures to lauch to make sure the codec parameters\n * are valid. Developpers wanting to extend the library can add their own validation procedures.\n */\nstatic void opj_j2k_setup_decoding_validation (opj_j2k_t *p_j2k);\n\n/**\n * Sets up the validation ,i.e. adds the procedures to lauch to make sure the codec parameters\n * are valid. Developpers wanting to extend the library can add their own validation procedures.\n */\nstatic void opj_j2k_setup_end_compress (opj_j2k_t *p_j2k);\n\n/**\n * The mct encoding validation procedure.\n *\n * @param       p_j2k                   the jpeg2000 codec to validate.\n * @param       p_stream                                the input stream to validate.\n * @param       p_manager               the user event manager.\n *\n * @return true if the parameters are correct.\n */\nstatic OPJ_BOOL opj_j2k_mct_validation (opj_j2k_t * p_j2k,\n                                        opj_stream_private_t *p_stream,\n                                        opj_event_mgr_t * p_manager );\n\n/**\n * Builds the tcd decoder to use to decode tile.\n */\nstatic OPJ_BOOL opj_j2k_build_decoder ( opj_j2k_t * p_j2k,\n                                        opj_stream_private_t *p_stream,\n                                        opj_event_mgr_t * p_manager );\n/**\n * Builds the tcd encoder to use to encode tile.\n */\nstatic OPJ_BOOL opj_j2k_build_encoder ( opj_j2k_t * p_j2k,\n                                        opj_stream_private_t *p_stream,\n                                        opj_event_mgr_t * p_manager );\n\n/**\n * Creates a tile-coder decoder.\n *\n * @param       p_stream                        the stream to write data to.\n * @param       p_j2k                           J2K codec.\n * @param       p_manager                   the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_create_tcd(     opj_j2k_t *p_j2k,\n                                                                    opj_stream_private_t *p_stream,\n                                                                    opj_event_mgr_t * p_manager );\n\n/**\n * Excutes the given procedures on the given codec.\n *\n * @param       p_procedure_list        the list of procedures to execute\n * @param       p_j2k                           the jpeg2000 codec to execute the procedures on.\n * @param       p_stream                        the stream to execute the procedures on.\n * @param       p_manager                       the user manager.\n *\n * @return      true                            if all the procedures were successfully executed.\n */\nstatic OPJ_BOOL opj_j2k_exec (  opj_j2k_t * p_j2k,\n                            opj_procedure_list_t * p_procedure_list,\n                            opj_stream_private_t *p_stream,\n                            opj_event_mgr_t * p_manager);\n\n/**\n * Updates the rates of the tcp.\n *\n * @param       p_stream                                the stream to write data to.\n * @param       p_j2k                           J2K codec.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_update_rates(   opj_j2k_t *p_j2k,\n                                                                            opj_stream_private_t *p_stream,\n                                                                            opj_event_mgr_t * p_manager );\n\n/**\n * Copies the decoding tile parameters onto all the tile parameters.\n * Creates also the tile decoder.\n */\nstatic OPJ_BOOL opj_j2k_copy_default_tcp_and_create_tcd (       opj_j2k_t * p_j2k,\n                                                            opj_stream_private_t *p_stream,\n                                                            opj_event_mgr_t * p_manager );\n\n/**\n * Destroys the memory associated with the decoding of headers.\n */\nstatic OPJ_BOOL opj_j2k_destroy_header_memory ( opj_j2k_t * p_j2k,\n                                                opj_stream_private_t *p_stream,\n                                                opj_event_mgr_t * p_manager );\n\n/**\n * Reads the lookup table containing all the marker, status and action, and returns the handler associated\n * with the marker value.\n * @param       p_id            Marker value to look up\n *\n * @return      the handler associated with the id.\n*/\nstatic const struct opj_dec_memory_marker_handler * opj_j2k_get_marker_handler (OPJ_UINT32 p_id);\n\n/**\n * Destroys a tile coding parameter structure.\n *\n * @param       p_tcp           the tile coding parameter to destroy.\n */\nstatic void opj_j2k_tcp_destroy (opj_tcp_t *p_tcp);\n\n/**\n * Destroys the data inside a tile coding parameter structure.\n *\n * @param       p_tcp           the tile coding parameter which contain data to destroy.\n */\nstatic void opj_j2k_tcp_data_destroy (opj_tcp_t *p_tcp);\n\n/**\n * Destroys a coding parameter structure.\n *\n * @param       p_cp            the coding parameter to destroy.\n */\nstatic void opj_j2k_cp_destroy (opj_cp_t *p_cp);\n\n/**\n * Writes a SPCod or SPCoc element, i.e. the coding style of a given component of a tile.\n *\n * @param       p_j2k           J2K codec.\n * @param       p_tile_no       FIXME DOC\n * @param       p_comp_no       the component number to output.\n * @param       p_data          FIXME DOC\n * @param       p_header_size   FIXME DOC\n * @param       p_manager       the user event manager.\n *\n * @return FIXME DOC\n*/\nstatic OPJ_BOOL opj_j2k_write_SPCod_SPCoc(      opj_j2k_t *p_j2k,\n                                                                                    OPJ_UINT32 p_tile_no,\n                                                                                    OPJ_UINT32 p_comp_no,\n                                                                                    OPJ_BYTE * p_data,\n                                                                                    OPJ_UINT32 * p_header_size,\n                                                                                    opj_event_mgr_t * p_manager );\n\n/**\n * Gets the size taken by writing a SPCod or SPCoc for the given tile and component.\n *\n * @param       p_j2k                   the J2K codec.\n * @param       p_tile_no               the tile index.\n * @param       p_comp_no               the component being outputted.\n *\n * @return      the number of bytes taken by the SPCod element.\n */\nstatic OPJ_UINT32 opj_j2k_get_SPCod_SPCoc_size (opj_j2k_t *p_j2k,\n                                                                                            OPJ_UINT32 p_tile_no,\n                                                                                            OPJ_UINT32 p_comp_no );\n\n/**\n * Reads a SPCod or SPCoc element, i.e. the coding style of a given component of a tile.\n * @param       p_j2k           the jpeg2000 codec.\n * @param       compno          FIXME DOC\n * @param       p_header_data   the data contained in the COM box.\n * @param       p_header_size   the size of the data contained in the COM marker.\n * @param       p_manager       the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_SPCod_SPCoc(   opj_j2k_t *p_j2k,\n                                            OPJ_UINT32 compno,\n                                            OPJ_BYTE * p_header_data,\n                                            OPJ_UINT32 * p_header_size,\n                                            opj_event_mgr_t * p_manager );\n\n/**\n * Gets the size taken by writing SQcd or SQcc element, i.e. the quantization values of a band in the QCD or QCC.\n *\n * @param       p_tile_no               the tile index.\n * @param       p_comp_no               the component being outputted.\n * @param       p_j2k                   the J2K codec.\n *\n * @return      the number of bytes taken by the SPCod element.\n */\nstatic OPJ_UINT32 opj_j2k_get_SQcd_SQcc_size (  opj_j2k_t *p_j2k,\n                                                                                    OPJ_UINT32 p_tile_no,\n                                                                                    OPJ_UINT32 p_comp_no );\n\n/**\n * Writes a SQcd or SQcc element, i.e. the quantization values of a band in the QCD or QCC.\n *\n * @param       p_tile_no               the tile to output.\n * @param       p_comp_no               the component number to output.\n * @param       p_data                  the data buffer.\n * @param       p_header_size   pointer to the size of the data buffer, it is changed by the function.\n * @param       p_j2k                   J2K codec.\n * @param       p_manager               the user event manager.\n *\n*/\nstatic OPJ_BOOL opj_j2k_write_SQcd_SQcc(opj_j2k_t *p_j2k,\n                                                                            OPJ_UINT32 p_tile_no,\n                                                                            OPJ_UINT32 p_comp_no,\n                                                                            OPJ_BYTE * p_data,\n                                                                            OPJ_UINT32 * p_header_size,\n                                                                            opj_event_mgr_t * p_manager);\n\n/**\n * Updates the Tile Length Marker.\n */\nstatic void opj_j2k_update_tlm ( opj_j2k_t * p_j2k, OPJ_UINT32 p_tile_part_size);\n\n/**\n * Reads a SQcd or SQcc element, i.e. the quantization values of a band in the QCD or QCC.\n *\n * @param       p_j2k           J2K codec.\n * @param       compno          the component number to output.\n * @param       p_header_data   the data buffer.\n * @param       p_header_size   pointer to the size of the data buffer, it is changed by the function.\n * @param       p_manager       the user event manager.\n *\n*/\nstatic OPJ_BOOL opj_j2k_read_SQcd_SQcc( opj_j2k_t *p_j2k,\n                                        OPJ_UINT32 compno,\n                                        OPJ_BYTE * p_header_data,\n                                        OPJ_UINT32 * p_header_size,\n                                        opj_event_mgr_t * p_manager );\n\n/**\n * Copies the tile component parameters of all the component from the first tile component.\n *\n * @param               p_j2k           the J2k codec.\n */\nstatic void opj_j2k_copy_tile_component_parameters( opj_j2k_t *p_j2k );\n\n/**\n * Copies the tile quantization parameters of all the component from the first tile component.\n *\n * @param               p_j2k           the J2k codec.\n */\nstatic void opj_j2k_copy_tile_quantization_parameters( opj_j2k_t *p_j2k );\n\n/**\n * Reads the tiles.\n */\nstatic OPJ_BOOL opj_j2k_decode_tiles (  opj_j2k_t *p_j2k,\n                                        opj_stream_private_t *p_stream,\n                                        opj_event_mgr_t * p_manager);\n\nstatic OPJ_BOOL opj_j2k_pre_write_tile ( opj_j2k_t * p_j2k,\n                                                                             OPJ_UINT32 p_tile_index,\n                                                                             opj_stream_private_t *p_stream,\n                                                                             opj_event_mgr_t * p_manager );\n\nstatic OPJ_BOOL opj_j2k_update_image_data (opj_tcd_t * p_tcd, OPJ_BYTE * p_data, opj_image_t* p_output_image);\n\nstatic void opj_j2k_get_tile_data (opj_tcd_t * p_tcd, OPJ_BYTE * p_data);\n\nstatic OPJ_BOOL opj_j2k_post_write_tile (opj_j2k_t * p_j2k,\n                                                                             OPJ_BYTE * p_data,\n                                                                             OPJ_UINT32 p_data_size,\n                                                                             opj_stream_private_t *p_stream,\n                                                                             opj_event_mgr_t * p_manager );\n\n/**\n * Sets up the procedures to do on writing header.\n * Developers wanting to extend the library can add their own writing procedures.\n */\nstatic void opj_j2k_setup_header_writing (opj_j2k_t *p_j2k);\n\nstatic OPJ_BOOL opj_j2k_write_first_tile_part(  opj_j2k_t *p_j2k,\n                                                                                            OPJ_BYTE * p_data,\n                                                                                            OPJ_UINT32 * p_data_written,\n                                                                                            OPJ_UINT32 p_total_data_size,\n                                                                                            opj_stream_private_t *p_stream,\n                                                                                            struct opj_event_mgr * p_manager );\n\nstatic OPJ_BOOL opj_j2k_write_all_tile_parts(   opj_j2k_t *p_j2k,\n                                                                                            OPJ_BYTE * p_data,\n                                                                                            OPJ_UINT32 * p_data_written,\n                                                                                            OPJ_UINT32 p_total_data_size,\n                                                                                            opj_stream_private_t *p_stream,\n                                                                                            struct opj_event_mgr * p_manager );\n\n/**\n * Gets the offset of the header.\n *\n * @param       p_stream                the stream to write data to.\n * @param       p_j2k                   J2K codec.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_get_end_header( opj_j2k_t *p_j2k,\n                                        opj_stream_private_t *p_stream,\n                                        opj_event_mgr_t * p_manager );\n\nstatic OPJ_BOOL opj_j2k_allocate_tile_element_cstr_index(opj_j2k_t *p_j2k);\n\n/*\n * -----------------------------------------------------------------------\n * -----------------------------------------------------------------------\n * -----------------------------------------------------------------------\n */\n\n/**\n * Writes the SOC marker (Start Of Codestream)\n *\n * @param       p_stream                        the stream to write data to.\n * @param       p_j2k                   J2K codec.\n * @param       p_manager       the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_soc(      opj_j2k_t *p_j2k,\n                                                        opj_stream_private_t *p_stream,\n                                                            opj_event_mgr_t * p_manager );\n\n/**\n * Reads a SOC marker (Start of Codestream)\n * @param       p_j2k           the jpeg2000 file codec.\n * @param       p_stream        XXX needs data\n * @param       p_manager       the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_soc(   opj_j2k_t *p_j2k,\n                                    opj_stream_private_t *p_stream,\n                                    opj_event_mgr_t * p_manager );\n\n/**\n * Writes the SIZ marker (image and tile size)\n *\n * @param       p_j2k           J2K codec.\n * @param       p_stream        the stream to write data to.\n * @param       p_manager       the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_siz(      opj_j2k_t *p_j2k,\n                                                                opj_stream_private_t *p_stream,\n                                                                opj_event_mgr_t * p_manager );\n\n/**\n * Reads a SIZ marker (image and tile size)\n * @param       p_j2k           the jpeg2000 file codec.\n * @param       p_header_data   the data contained in the SIZ box.\n * @param       p_header_size   the size of the data contained in the SIZ marker.\n * @param       p_manager       the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_siz(opj_j2k_t *p_j2k,\n                                 OPJ_BYTE * p_header_data,\n                                 OPJ_UINT32 p_header_size,\n                                 opj_event_mgr_t * p_manager);\n\n/**\n * Writes the COM marker (comment)\n *\n * @param       p_stream                        the stream to write data to.\n * @param       p_j2k                   J2K codec.\n * @param       p_manager       the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_com(      opj_j2k_t *p_j2k,\n                                                                        opj_stream_private_t *p_stream,\n                                                                        opj_event_mgr_t * p_manager );\n\n/**\n * Reads a COM marker (comments)\n * @param       p_j2k           the jpeg2000 file codec.\n * @param       p_header_data   the data contained in the COM box.\n * @param       p_header_size   the size of the data contained in the COM marker.\n * @param       p_manager       the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_com (  opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager );\n/**\n * Writes the COD marker (Coding style default)\n *\n * @param       p_stream                        the stream to write data to.\n * @param       p_j2k                   J2K codec.\n * @param       p_manager       the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_cod(      opj_j2k_t *p_j2k,\n                                                                        opj_stream_private_t *p_stream,\n                                                                        opj_event_mgr_t * p_manager );\n\n/**\n * Reads a COD marker (Coding Styke defaults)\n * @param       p_header_data   the data contained in the COD box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the COD marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_cod (  opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager);\n\n#if 0\n/**\n * Writes the COC marker (Coding style component)\n *\n * @param       p_j2k       J2K codec.\n * @param       p_comp_no   the index of the component to output.\n * @param       p_stream    the stream to write data to.\n * @param       p_manager   the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_coc(  opj_j2k_t *p_j2k,\n                                                                OPJ_UINT32 p_comp_no,\n                                                                opj_stream_private_t *p_stream,\n                                                                opj_event_mgr_t * p_manager );\n#endif\n\n#if 0\n/**\n * Writes the COC marker (Coding style component)\n *\n * @param       p_j2k                   J2K codec.\n * @param       p_comp_no               the index of the component to output.\n * @param       p_data          FIXME DOC\n * @param       p_data_written  FIXME DOC\n * @param       p_manager               the user event manager.\n*/\nstatic void opj_j2k_write_coc_in_memory(opj_j2k_t *p_j2k,\n                                                                            OPJ_UINT32 p_comp_no,\n                                                                            OPJ_BYTE * p_data,\n                                                                            OPJ_UINT32 * p_data_written,\n                                                                            opj_event_mgr_t * p_manager );\n#endif\n\n/**\n * Gets the maximum size taken by a coc.\n *\n * @param       p_j2k   the jpeg2000 codec to use.\n */\nstatic OPJ_UINT32 opj_j2k_get_max_coc_size(opj_j2k_t *p_j2k);\n\n/**\n * Reads a COC marker (Coding Style Component)\n * @param       p_header_data   the data contained in the COC box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the COC marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_coc (  opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager );\n\n/**\n * Writes the QCD marker (quantization default)\n *\n * @param       p_j2k                   J2K codec.\n * @param       p_stream                the stream to write data to.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_qcd(      opj_j2k_t *p_j2k,\n                                                                        opj_stream_private_t *p_stream,\n                                                                        opj_event_mgr_t * p_manager );\n\n/**\n * Reads a QCD marker (Quantization defaults)\n * @param       p_header_data   the data contained in the QCD box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the QCD marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_qcd (  opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager );\n#if 0\n/**\n * Writes the QCC marker (quantization component)\n *\n * @param       p_comp_no       the index of the component to output.\n * @param       p_stream                the stream to write data to.\n * @param       p_j2k                   J2K codec.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_qcc(      opj_j2k_t *p_j2k,\n                                                                        OPJ_UINT32 p_comp_no,\n                                                                        opj_stream_private_t *p_stream,\n                                                                        opj_event_mgr_t * p_manager );\n#endif\n\n#if 0\n/**\n * Writes the QCC marker (quantization component)\n *\n * @param       p_j2k           J2K codec.\n * @param       p_comp_no       the index of the component to output.\n * @param       p_data          FIXME DOC\n * @param       p_data_written  the stream to write data to.\n * @param       p_manager       the user event manager.\n*/\nstatic void opj_j2k_write_qcc_in_memory(opj_j2k_t *p_j2k,\n                                                                            OPJ_UINT32 p_comp_no,\n                                                                            OPJ_BYTE * p_data,\n                                                                            OPJ_UINT32 * p_data_written,\n                                                                            opj_event_mgr_t * p_manager );\n#endif\n\n/**\n * Gets the maximum size taken by a qcc.\n */\nstatic OPJ_UINT32 opj_j2k_get_max_qcc_size (opj_j2k_t *p_j2k);\n\n/**\n * Reads a QCC marker (Quantization component)\n * @param       p_header_data   the data contained in the QCC box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the QCC marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_qcc(   opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager);\n/**\n * Writes the POC marker (Progression Order Change)\n *\n * @param       p_stream                                the stream to write data to.\n * @param       p_j2k                           J2K codec.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_poc(      opj_j2k_t *p_j2k,\n                                                                        opj_stream_private_t *p_stream,\n                                                                        opj_event_mgr_t * p_manager );\n/**\n * Writes the POC marker (Progression Order Change)\n *\n * @param       p_j2k          J2K codec.\n * @param       p_data         FIXME DOC\n * @param       p_data_written the stream to write data to.\n * @param       p_manager      the user event manager.\n */\nstatic void opj_j2k_write_poc_in_memory(opj_j2k_t *p_j2k,\n                                                                            OPJ_BYTE * p_data,\n                                                                            OPJ_UINT32 * p_data_written,\n                                                                            opj_event_mgr_t * p_manager );\n/**\n * Gets the maximum size taken by the writing of a POC.\n */\nstatic OPJ_UINT32 opj_j2k_get_max_poc_size(opj_j2k_t *p_j2k);\n\n/**\n * Reads a POC marker (Progression Order Change)\n *\n * @param       p_header_data   the data contained in the POC box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the POC marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_poc (  opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager );\n\n/**\n * Gets the maximum size taken by the toc headers of all the tile parts of any given tile.\n */\nstatic OPJ_UINT32 opj_j2k_get_max_toc_size (opj_j2k_t *p_j2k);\n\n/**\n * Gets the maximum size taken by the headers of the SOT.\n *\n * @param       p_j2k   the jpeg2000 codec to use.\n */\nstatic OPJ_UINT32 opj_j2k_get_specific_header_sizes(opj_j2k_t *p_j2k);\n\n/**\n * Reads a CRG marker (Component registration)\n *\n * @param       p_header_data   the data contained in the TLM box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the TLM marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_crg (  opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager );\n/**\n * Reads a TLM marker (Tile Length Marker)\n *\n * @param       p_header_data   the data contained in the TLM box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the TLM marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_tlm (  opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager);\n\n/**\n * Writes the updated tlm.\n *\n * @param       p_stream                the stream to write data to.\n * @param       p_j2k                   J2K codec.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_updated_tlm(      opj_j2k_t *p_j2k,\n                                            opj_stream_private_t *p_stream,\n                                            opj_event_mgr_t * p_manager );\n\n/**\n * Reads a PLM marker (Packet length, main header marker)\n *\n * @param       p_header_data   the data contained in the TLM box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the TLM marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_plm (  opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager);\n/**\n * Reads a PLT marker (Packet length, tile-part header)\n *\n * @param       p_header_data   the data contained in the PLT box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the PLT marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_plt (  opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager );\n\n#if 0\n/**\n * Reads a PPM marker (Packed packet headers, main header)\n *\n * @param       p_header_data   the data contained in the POC box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the POC marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL j2k_read_ppm_v2 (\n                                                opj_j2k_t *p_j2k,\n                                                OPJ_BYTE * p_header_data,\n                                                OPJ_UINT32 p_header_size,\n                                                struct opj_event_mgr * p_manager\n                                        );\n#endif\n\nstatic OPJ_BOOL j2k_read_ppm_v3 (\n                                                opj_j2k_t *p_j2k,\n                                                OPJ_BYTE * p_header_data,\n                                                OPJ_UINT32 p_header_size,\n                                                opj_event_mgr_t * p_manager );\n\n/**\n * Reads a PPT marker (Packed packet headers, tile-part header)\n *\n * @param       p_header_data   the data contained in the PPT box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the PPT marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_ppt (  opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager );\n/**\n * Writes the TLM marker (Tile Length Marker)\n *\n * @param       p_stream                                the stream to write data to.\n * @param       p_j2k                           J2K codec.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_tlm(      opj_j2k_t *p_j2k,\n                                                                        opj_stream_private_t *p_stream,\n                                                                        opj_event_mgr_t * p_manager );\n\n/**\n * Writes the SOT marker (Start of tile-part)\n *\n * @param       p_j2k            J2K codec.\n * @param       p_data           FIXME DOC\n * @param       p_data_written   FIXME DOC\n * @param       p_stream         the stream to write data to.\n * @param       p_manager        the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_sot(      opj_j2k_t *p_j2k,\n                                                                        OPJ_BYTE * p_data,\n                                                                        OPJ_UINT32 * p_data_written,\n                                                                        const opj_stream_private_t *p_stream,\n                                                                        opj_event_mgr_t * p_manager );\n\n/**\n * Reads a PPT marker (Packed packet headers, tile-part header)\n *\n * @param       p_header_data   the data contained in the PPT box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the PPT marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_sot (  opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager );\n/**\n * Writes the SOD marker (Start of data)\n *\n * @param       p_j2k               J2K codec.\n * @param       p_tile_coder        FIXME DOC\n * @param       p_data              FIXME DOC\n * @param       p_data_written      FIXME DOC\n * @param       p_total_data_size   FIXME DOC\n * @param       p_stream            the stream to write data to.\n * @param       p_manager           the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_sod(      opj_j2k_t *p_j2k,\n                                                                        opj_tcd_t * p_tile_coder,\n                                                                        OPJ_BYTE * p_data,\n                                                                        OPJ_UINT32 * p_data_written,\n                                                                        OPJ_UINT32 p_total_data_size,\n                                                                        const opj_stream_private_t *p_stream,\n                                                                        opj_event_mgr_t * p_manager );\n\n/**\n * Reads a SOD marker (Start Of Data)\n *\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_stream                FIXME DOC\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_sod(   opj_j2k_t *p_j2k,\n                                    opj_stream_private_t *p_stream,\n                                    opj_event_mgr_t * p_manager );\n\nvoid opj_j2k_update_tlm (opj_j2k_t * p_j2k, OPJ_UINT32 p_tile_part_size )\n{\n        opj_write_bytes(p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_current,p_j2k->m_current_tile_number,1);            /* PSOT */\n        ++p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_current;\n\n        opj_write_bytes(p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_current,p_tile_part_size,4);                                        /* PSOT */\n        p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_current += 4;\n}\n\n/**\n * Writes the RGN marker (Region Of Interest)\n *\n * @param       p_tile_no               the tile to output\n * @param       p_comp_no               the component to output\n * @param       nb_comps                the number of components\n * @param       p_stream                the stream to write data to.\n * @param       p_j2k                   J2K codec.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_rgn(  opj_j2k_t *p_j2k,\n                                    OPJ_UINT32 p_tile_no,\n                                    OPJ_UINT32 p_comp_no,\n                                    OPJ_UINT32 nb_comps,\n                                    opj_stream_private_t *p_stream,\n                                    opj_event_mgr_t * p_manager );\n\n/**\n * Reads a RGN marker (Region Of Interest)\n *\n * @param       p_header_data   the data contained in the POC box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the POC marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_rgn (opj_j2k_t *p_j2k,\n                                  OPJ_BYTE * p_header_data,\n                                  OPJ_UINT32 p_header_size,\n                                  opj_event_mgr_t * p_manager );\n\n/**\n * Writes the EOC marker (End of Codestream)\n *\n * @param       p_stream                the stream to write data to.\n * @param       p_j2k                   J2K codec.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_eoc(      opj_j2k_t *p_j2k,\n                                    opj_stream_private_t *p_stream,\n                                    opj_event_mgr_t * p_manager );\n\n#if 0\n/**\n * Reads a EOC marker (End Of Codestream)\n *\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_stream                FIXME DOC\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_eoc (      opj_j2k_t *p_j2k,\n                                                                opj_stream_private_t *p_stream,\n                                                                opj_event_mgr_t * p_manager );\n#endif\n\n/**\n * Writes the CBD-MCT-MCC-MCO markers (Multi components transform)\n *\n * @param       p_stream                        the stream to write data to.\n * @param       p_j2k                   J2K codec.\n * @param       p_manager       the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_mct_data_group(   opj_j2k_t *p_j2k,\n                                                opj_stream_private_t *p_stream,\n                                                opj_event_mgr_t * p_manager );\n\n/**\n * Inits the Info\n *\n * @param       p_stream                the stream to write data to.\n * @param       p_j2k                   J2K codec.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_init_info(      opj_j2k_t *p_j2k,\n                                    opj_stream_private_t *p_stream,\n                                    opj_event_mgr_t * p_manager );\n\n/**\nAdd main header marker information\n@param cstr_index    Codestream information structure\n@param type         marker type\n@param pos          byte offset of marker segment\n@param len          length of marker segment\n */\nstatic OPJ_BOOL opj_j2k_add_mhmarker(opj_codestream_index_t *cstr_index, OPJ_UINT32 type, OPJ_OFF_T pos, OPJ_UINT32 len) ;\n/**\nAdd tile header marker information\n@param tileno       tile index number\n@param cstr_index   Codestream information structure\n@param type         marker type\n@param pos          byte offset of marker segment\n@param len          length of marker segment\n */\nstatic OPJ_BOOL opj_j2k_add_tlmarker(OPJ_UINT32 tileno, opj_codestream_index_t *cstr_index, OPJ_UINT32 type, OPJ_OFF_T pos, OPJ_UINT32 len);\n\n/**\n * Reads an unknown marker\n *\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_stream                the stream object to read from.\n * @param       output_marker           FIXME DOC\n * @param       p_manager               the user event manager.\n *\n * @return      true                    if the marker could be deduced.\n*/\nstatic OPJ_BOOL opj_j2k_read_unk( opj_j2k_t *p_j2k,\n                                  opj_stream_private_t *p_stream,\n                                  OPJ_UINT32 *output_marker,\n                                  opj_event_mgr_t * p_manager );\n\n/**\n * Writes the MCT marker (Multiple Component Transform)\n *\n * @param       p_j2k           J2K codec.\n * @param       p_mct_record    FIXME DOC\n * @param       p_stream        the stream to write data to.\n * @param       p_manager       the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_mct_record(       opj_j2k_t *p_j2k,\n                                                                                    opj_mct_data_t * p_mct_record,\n                                            opj_stream_private_t *p_stream,\n                                            opj_event_mgr_t * p_manager );\n\n/**\n * Reads a MCT marker (Multiple Component Transform)\n *\n * @param       p_header_data   the data contained in the MCT box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the MCT marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_mct (      opj_j2k_t *p_j2k,\n                                                                    OPJ_BYTE * p_header_data,\n                                                                    OPJ_UINT32 p_header_size,\n                                                                    opj_event_mgr_t * p_manager );\n\n/**\n * Writes the MCC marker (Multiple Component Collection)\n *\n * @param       p_j2k                   J2K codec.\n * @param       p_mcc_record            FIXME DOC\n * @param       p_stream                the stream to write data to.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_mcc_record(   opj_j2k_t *p_j2k,\n                                            opj_simple_mcc_decorrelation_data_t * p_mcc_record,\n                                            opj_stream_private_t *p_stream,\n                                            opj_event_mgr_t * p_manager );\n\n/**\n * Reads a MCC marker (Multiple Component Collection)\n *\n * @param       p_header_data   the data contained in the MCC box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the MCC marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_mcc (      opj_j2k_t *p_j2k,\n                                                                    OPJ_BYTE * p_header_data,\n                                                                    OPJ_UINT32 p_header_size,\n                                                                    opj_event_mgr_t * p_manager );\n\n/**\n * Writes the MCO marker (Multiple component transformation ordering)\n *\n * @param       p_stream                                the stream to write data to.\n * @param       p_j2k                           J2K codec.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_mco(      opj_j2k_t *p_j2k,\n                                    opj_stream_private_t *p_stream,\n                                    opj_event_mgr_t * p_manager );\n\n/**\n * Reads a MCO marker (Multiple Component Transform Ordering)\n *\n * @param       p_header_data   the data contained in the MCO box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the MCO marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_mco (      opj_j2k_t *p_j2k,\n                                                                    OPJ_BYTE * p_header_data,\n                                                                    OPJ_UINT32 p_header_size,\n                                                                    opj_event_mgr_t * p_manager );\n\nstatic OPJ_BOOL opj_j2k_add_mct(opj_tcp_t * p_tcp, opj_image_t * p_image, OPJ_UINT32 p_index);\n\nstatic void  opj_j2k_read_int16_to_float (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem);\nstatic void  opj_j2k_read_int32_to_float (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem);\nstatic void  opj_j2k_read_float32_to_float (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem);\nstatic void  opj_j2k_read_float64_to_float (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem);\n\nstatic void  opj_j2k_read_int16_to_int32 (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem);\nstatic void  opj_j2k_read_int32_to_int32 (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem);\nstatic void  opj_j2k_read_float32_to_int32 (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem);\nstatic void  opj_j2k_read_float64_to_int32 (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem);\n\nstatic void  opj_j2k_write_float_to_int16 (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem);\nstatic void  opj_j2k_write_float_to_int32 (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem);\nstatic void  opj_j2k_write_float_to_float (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem);\nstatic void  opj_j2k_write_float_to_float64 (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem);\n\n/**\n * Ends the encoding, i.e. frees memory.\n *\n * @param       p_stream                the stream to write data to.\n * @param       p_j2k                   J2K codec.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_end_encoding(   opj_j2k_t *p_j2k,\n                                                                            opj_stream_private_t *p_stream,\n                                                                            opj_event_mgr_t * p_manager );\n\n/**\n * Writes the CBD marker (Component bit depth definition)\n *\n * @param       p_stream                                the stream to write data to.\n * @param       p_j2k                           J2K codec.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_cbd(      opj_j2k_t *p_j2k,\n                                                                    opj_stream_private_t *p_stream,\n                                                                        opj_event_mgr_t * p_manager );\n\n/**\n * Reads a CBD marker (Component bit depth definition)\n * @param       p_header_data   the data contained in the CBD box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the CBD marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_cbd (      opj_j2k_t *p_j2k,\n                                                                OPJ_BYTE * p_header_data,\n                                                                OPJ_UINT32 p_header_size,\n                                                                opj_event_mgr_t * p_manager);\n\n#if 0\n/**\n * Writes COC marker for each component.\n *\n * @param       p_stream                the stream to write data to.\n * @param       p_j2k                   J2K codec.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_all_coc( opj_j2k_t *p_j2k,\n                                                                        opj_stream_private_t *p_stream,\n                                                                        opj_event_mgr_t * p_manager );\n#endif\n\n#if 0\n/**\n * Writes QCC marker for each component.\n *\n * @param       p_stream                the stream to write data to.\n * @param       p_j2k                   J2K codec.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_all_qcc( opj_j2k_t *p_j2k,\n                                                                        opj_stream_private_t *p_stream,\n                                                                        opj_event_mgr_t * p_manager );\n#endif\n\n/**\n * Writes regions of interests.\n *\n * @param       p_stream                the stream to write data to.\n * @param       p_j2k                   J2K codec.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_regions(  opj_j2k_t *p_j2k,\n                                                                        opj_stream_private_t *p_stream,\n                                                                        opj_event_mgr_t * p_manager );\n\n/**\n * Writes EPC ????\n *\n * @param       p_stream                the stream to write data to.\n * @param       p_j2k                   J2K codec.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_write_epc(      opj_j2k_t *p_j2k,\n                                                                    opj_stream_private_t *p_stream,\n                                                                    opj_event_mgr_t * p_manager );\n\n/**\n * Checks the progression order changes values. Tells of the poc given as input are valid.\n * A nice message is outputted at errors.\n *\n * @param       p_pocs                  the progression order changes.\n * @param       p_nb_pocs               the number of progression order changes.\n * @param       p_nb_resolutions        the number of resolutions.\n * @param       numcomps                the number of components\n * @param       numlayers               the number of layers.\n * @param       p_manager               the user event manager.\n *\n * @return      true if the pocs are valid.\n */\nstatic OPJ_BOOL opj_j2k_check_poc_val(  const opj_poc_t *p_pocs,\n                                                                            OPJ_UINT32 p_nb_pocs,\n                                                                            OPJ_UINT32 p_nb_resolutions,\n                                                                            OPJ_UINT32 numcomps,\n                                                                            OPJ_UINT32 numlayers,\n                                                                            opj_event_mgr_t * p_manager);\n\n/**\n * Gets the number of tile parts used for the given change of progression (if any) and the given tile.\n *\n * @param               cp                      the coding parameters.\n * @param               pino            the offset of the given poc (i.e. its position in the coding parameter).\n * @param               tileno          the given tile.\n *\n * @return              the number of tile parts.\n */\nstatic OPJ_UINT32 opj_j2k_get_num_tp( opj_cp_t *cp, OPJ_UINT32 pino, OPJ_UINT32 tileno);\n\n/**\n * Calculates the total number of tile parts needed by the encoder to\n * encode such an image. If not enough memory is available, then the function return false.\n *\n * @param       p_nb_tiles      pointer that will hold the number of tile parts.\n * @param       cp                      the coding parameters for the image.\n * @param       image           the image to encode.\n * @param       p_j2k                   the p_j2k encoder.\n * @param       p_manager       the user event manager.\n *\n * @return true if the function was successful, false else.\n */\nstatic OPJ_BOOL opj_j2k_calculate_tp(   opj_j2k_t *p_j2k,\n                                                                            opj_cp_t *cp,\n                                                                            OPJ_UINT32 * p_nb_tiles,\n                                                                            opj_image_t *image,\n                                                                            opj_event_mgr_t * p_manager);\n\nstatic void opj_j2k_dump_MH_info(opj_j2k_t* p_j2k, FILE* out_stream);\n\nstatic void opj_j2k_dump_MH_index(opj_j2k_t* p_j2k, FILE* out_stream);\n\nstatic opj_codestream_index_t* opj_j2k_create_cstr_index(void);\n\nstatic OPJ_FLOAT32 opj_j2k_get_tp_stride (opj_tcp_t * p_tcp);\n\nstatic OPJ_FLOAT32 opj_j2k_get_default_stride (opj_tcp_t * p_tcp);\n\nstatic int opj_j2k_initialise_4K_poc(opj_poc_t *POC, int numres);\n\nstatic void opj_j2k_set_cinema_parameters(opj_cparameters_t *parameters, opj_image_t *image, opj_event_mgr_t *p_manager);\n\nstatic OPJ_BOOL opj_j2k_is_cinema_compliant(opj_image_t *image, OPJ_UINT16 rsiz, opj_event_mgr_t *p_manager);\n\n/*@}*/\n\n/*@}*/\n\n/* ----------------------------------------------------------------------- */\ntypedef struct j2k_prog_order{\n        OPJ_PROG_ORDER enum_prog;\n        char str_prog[5];\n}j2k_prog_order_t;\n\nj2k_prog_order_t j2k_prog_order_list[] = {\n        {OPJ_CPRL, \"CPRL\"},\n        {OPJ_LRCP, \"LRCP\"},\n        {OPJ_PCRL, \"PCRL\"},\n        {OPJ_RLCP, \"RLCP\"},\n        {OPJ_RPCL, \"RPCL\"},\n        {(OPJ_PROG_ORDER)-1, \"\"}\n};\n\n/**\n * FIXME DOC\n */\nstatic const OPJ_UINT32 MCT_ELEMENT_SIZE [] =\n{\n        2,\n        4,\n        4,\n        8\n};\n\ntypedef void (* opj_j2k_mct_function) (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem);\n\nconst opj_j2k_mct_function j2k_mct_read_functions_to_float [] =\n{\n        opj_j2k_read_int16_to_float,\n        opj_j2k_read_int32_to_float,\n        opj_j2k_read_float32_to_float,\n        opj_j2k_read_float64_to_float\n};\n\nconst opj_j2k_mct_function j2k_mct_read_functions_to_int32 [] =\n{\n        opj_j2k_read_int16_to_int32,\n        opj_j2k_read_int32_to_int32,\n        opj_j2k_read_float32_to_int32,\n        opj_j2k_read_float64_to_int32\n};\n\nconst opj_j2k_mct_function j2k_mct_write_functions_from_float [] =\n{\n        opj_j2k_write_float_to_int16,\n        opj_j2k_write_float_to_int32,\n        opj_j2k_write_float_to_float,\n        opj_j2k_write_float_to_float64\n};\n\ntypedef struct opj_dec_memory_marker_handler\n{\n        /** marker value */\n        OPJ_UINT32 id;\n        /** value of the state when the marker can appear */\n        OPJ_UINT32 states;\n        /** action linked to the marker */\n        OPJ_BOOL (*handler) (   opj_j2k_t *p_j2k,\n                            OPJ_BYTE * p_header_data,\n                            OPJ_UINT32 p_header_size,\n                            opj_event_mgr_t * p_manager );\n}\nopj_dec_memory_marker_handler_t;\n\nconst opj_dec_memory_marker_handler_t j2k_memory_marker_handler_tab [] =\n{\n  {J2K_MS_SOT, J2K_STATE_MH | J2K_STATE_TPHSOT, opj_j2k_read_sot},\n  {J2K_MS_COD, J2K_STATE_MH | J2K_STATE_TPH, opj_j2k_read_cod},\n  {J2K_MS_COC, J2K_STATE_MH | J2K_STATE_TPH, opj_j2k_read_coc},\n  {J2K_MS_RGN, J2K_STATE_MH | J2K_STATE_TPH, opj_j2k_read_rgn},\n  {J2K_MS_QCD, J2K_STATE_MH | J2K_STATE_TPH, opj_j2k_read_qcd},\n  {J2K_MS_QCC, J2K_STATE_MH | J2K_STATE_TPH, opj_j2k_read_qcc},\n  {J2K_MS_POC, J2K_STATE_MH | J2K_STATE_TPH, opj_j2k_read_poc},\n  {J2K_MS_SIZ, J2K_STATE_MHSIZ, opj_j2k_read_siz},\n  {J2K_MS_TLM, J2K_STATE_MH, opj_j2k_read_tlm},\n  {J2K_MS_PLM, J2K_STATE_MH, opj_j2k_read_plm},\n  {J2K_MS_PLT, J2K_STATE_TPH, opj_j2k_read_plt},\n  {J2K_MS_PPM, J2K_STATE_MH, j2k_read_ppm_v3},\n  {J2K_MS_PPT, J2K_STATE_TPH, opj_j2k_read_ppt},\n  {J2K_MS_SOP, 0, 0},\n  {J2K_MS_CRG, J2K_STATE_MH, opj_j2k_read_crg},\n  {J2K_MS_COM, J2K_STATE_MH | J2K_STATE_TPH, opj_j2k_read_com},\n  {J2K_MS_MCT, J2K_STATE_MH | J2K_STATE_TPH, opj_j2k_read_mct},\n  {J2K_MS_CBD, J2K_STATE_MH , opj_j2k_read_cbd},\n  {J2K_MS_MCC, J2K_STATE_MH | J2K_STATE_TPH, opj_j2k_read_mcc},\n  {J2K_MS_MCO, J2K_STATE_MH | J2K_STATE_TPH, opj_j2k_read_mco},\n#ifdef USE_JPWL\n#ifdef TODO_MS /* remove these functions which are not commpatible with the v2 API */\n  {J2K_MS_EPC, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_epc},\n  {J2K_MS_EPB, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_epb},\n  {J2K_MS_ESD, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_esd},\n  {J2K_MS_RED, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_red},\n#endif\n#endif /* USE_JPWL */\n#ifdef USE_JPSEC\n  {J2K_MS_SEC, J2K_DEC_STATE_MH, j2k_read_sec},\n  {J2K_MS_INSEC, 0, j2k_read_insec}\n#endif /* USE_JPSEC */\n  {J2K_MS_UNK, J2K_STATE_MH | J2K_STATE_TPH, 0}/*opj_j2k_read_unk is directly used*/\n};\n\nvoid  opj_j2k_read_int16_to_float (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem)\n{\n        OPJ_BYTE * l_src_data = (OPJ_BYTE *) p_src_data;\n        OPJ_FLOAT32 * l_dest_data = (OPJ_FLOAT32 *) p_dest_data;\n        OPJ_UINT32 i;\n        OPJ_UINT32 l_temp;\n\n        for (i=0;i<p_nb_elem;++i) {\n                opj_read_bytes(l_src_data,&l_temp,2);\n\n                l_src_data+=sizeof(OPJ_INT16);\n\n                *(l_dest_data++) = (OPJ_FLOAT32) l_temp;\n        }\n}\n\nvoid  opj_j2k_read_int32_to_float (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem)\n{\n        OPJ_BYTE * l_src_data = (OPJ_BYTE *) p_src_data;\n        OPJ_FLOAT32 * l_dest_data = (OPJ_FLOAT32 *) p_dest_data;\n        OPJ_UINT32 i;\n        OPJ_UINT32 l_temp;\n\n        for (i=0;i<p_nb_elem;++i) {\n                opj_read_bytes(l_src_data,&l_temp,4);\n\n                l_src_data+=sizeof(OPJ_INT32);\n\n                *(l_dest_data++) = (OPJ_FLOAT32) l_temp;\n        }\n}\n\nvoid  opj_j2k_read_float32_to_float (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem)\n{\n        OPJ_BYTE * l_src_data = (OPJ_BYTE *) p_src_data;\n        OPJ_FLOAT32 * l_dest_data = (OPJ_FLOAT32 *) p_dest_data;\n        OPJ_UINT32 i;\n        OPJ_FLOAT32 l_temp;\n\n        for (i=0;i<p_nb_elem;++i) {\n                opj_read_float(l_src_data,&l_temp);\n\n                l_src_data+=sizeof(OPJ_FLOAT32);\n\n                *(l_dest_data++) = l_temp;\n        }\n}\n\nvoid  opj_j2k_read_float64_to_float (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem)\n{\n        OPJ_BYTE * l_src_data = (OPJ_BYTE *) p_src_data;\n        OPJ_FLOAT32 * l_dest_data = (OPJ_FLOAT32 *) p_dest_data;\n        OPJ_UINT32 i;\n        OPJ_FLOAT64 l_temp;\n\n        for (i=0;i<p_nb_elem;++i) {\n                opj_read_double(l_src_data,&l_temp);\n\n                l_src_data+=sizeof(OPJ_FLOAT64);\n\n                *(l_dest_data++) = (OPJ_FLOAT32) l_temp;\n        }\n}\n\nvoid  opj_j2k_read_int16_to_int32 (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem)\n{\n        OPJ_BYTE * l_src_data = (OPJ_BYTE *) p_src_data;\n        OPJ_INT32 * l_dest_data = (OPJ_INT32 *) p_dest_data;\n        OPJ_UINT32 i;\n        OPJ_UINT32 l_temp;\n\n        for (i=0;i<p_nb_elem;++i) {\n                opj_read_bytes(l_src_data,&l_temp,2);\n\n                l_src_data+=sizeof(OPJ_INT16);\n\n                *(l_dest_data++) = (OPJ_INT32) l_temp;\n        }\n}\n\nvoid  opj_j2k_read_int32_to_int32 (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem)\n{\n        OPJ_BYTE * l_src_data = (OPJ_BYTE *) p_src_data;\n        OPJ_INT32 * l_dest_data = (OPJ_INT32 *) p_dest_data;\n        OPJ_UINT32 i;\n        OPJ_UINT32 l_temp;\n\n        for (i=0;i<p_nb_elem;++i) {\n                opj_read_bytes(l_src_data,&l_temp,4);\n\n                l_src_data+=sizeof(OPJ_INT32);\n\n                *(l_dest_data++) = (OPJ_INT32) l_temp;\n        }\n}\n\nvoid  opj_j2k_read_float32_to_int32 (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem)\n{\n        OPJ_BYTE * l_src_data = (OPJ_BYTE *) p_src_data;\n        OPJ_INT32 * l_dest_data = (OPJ_INT32 *) p_dest_data;\n        OPJ_UINT32 i;\n        OPJ_FLOAT32 l_temp;\n\n        for (i=0;i<p_nb_elem;++i) {\n                opj_read_float(l_src_data,&l_temp);\n\n                l_src_data+=sizeof(OPJ_FLOAT32);\n\n                *(l_dest_data++) = (OPJ_INT32) l_temp;\n        }\n}\n\nvoid  opj_j2k_read_float64_to_int32 (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem)\n{\n        OPJ_BYTE * l_src_data = (OPJ_BYTE *) p_src_data;\n        OPJ_INT32 * l_dest_data = (OPJ_INT32 *) p_dest_data;\n        OPJ_UINT32 i;\n        OPJ_FLOAT64 l_temp;\n\n        for (i=0;i<p_nb_elem;++i) {\n                opj_read_double(l_src_data,&l_temp);\n\n                l_src_data+=sizeof(OPJ_FLOAT64);\n\n                *(l_dest_data++) = (OPJ_INT32) l_temp;\n        }\n}\n\nvoid  opj_j2k_write_float_to_int16 (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem)\n{\n        OPJ_BYTE * l_dest_data = (OPJ_BYTE *) p_dest_data;\n        OPJ_FLOAT32 * l_src_data = (OPJ_FLOAT32 *) p_src_data;\n        OPJ_UINT32 i;\n        OPJ_UINT32 l_temp;\n\n        for (i=0;i<p_nb_elem;++i) {\n                l_temp = (OPJ_UINT32) *(l_src_data++);\n\n                opj_write_bytes(l_dest_data,l_temp,sizeof(OPJ_INT16));\n\n                l_dest_data+=sizeof(OPJ_INT16);\n        }\n}\n\nvoid opj_j2k_write_float_to_int32 (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem)\n{\n        OPJ_BYTE * l_dest_data = (OPJ_BYTE *) p_dest_data;\n        OPJ_FLOAT32 * l_src_data = (OPJ_FLOAT32 *) p_src_data;\n        OPJ_UINT32 i;\n        OPJ_UINT32 l_temp;\n\n        for (i=0;i<p_nb_elem;++i) {\n                l_temp = (OPJ_UINT32) *(l_src_data++);\n\n                opj_write_bytes(l_dest_data,l_temp,sizeof(OPJ_INT32));\n\n                l_dest_data+=sizeof(OPJ_INT32);\n        }\n}\n\nvoid  opj_j2k_write_float_to_float (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem)\n{\n        OPJ_BYTE * l_dest_data = (OPJ_BYTE *) p_dest_data;\n        OPJ_FLOAT32 * l_src_data = (OPJ_FLOAT32 *) p_src_data;\n        OPJ_UINT32 i;\n        OPJ_FLOAT32 l_temp;\n\n        for (i=0;i<p_nb_elem;++i) {\n                l_temp = (OPJ_FLOAT32) *(l_src_data++);\n\n                opj_write_float(l_dest_data,l_temp);\n\n                l_dest_data+=sizeof(OPJ_FLOAT32);\n        }\n}\n\nvoid  opj_j2k_write_float_to_float64 (const void * p_src_data, void * p_dest_data, OPJ_UINT32 p_nb_elem)\n{\n        OPJ_BYTE * l_dest_data = (OPJ_BYTE *) p_dest_data;\n        OPJ_FLOAT32 * l_src_data = (OPJ_FLOAT32 *) p_src_data;\n        OPJ_UINT32 i;\n        OPJ_FLOAT64 l_temp;\n\n        for (i=0;i<p_nb_elem;++i) {\n                l_temp = (OPJ_FLOAT64) *(l_src_data++);\n\n                opj_write_double(l_dest_data,l_temp);\n\n                l_dest_data+=sizeof(OPJ_FLOAT64);\n        }\n}\n\nchar *opj_j2k_convert_progression_order(OPJ_PROG_ORDER prg_order){\n        j2k_prog_order_t *po;\n        for(po = j2k_prog_order_list; po->enum_prog != -1; po++ ){\n                if(po->enum_prog == prg_order){\n                        return po->str_prog;\n                }\n        }\n        return po->str_prog;\n}\n\nOPJ_BOOL opj_j2k_check_poc_val( const opj_poc_t *p_pocs,\n                                                        OPJ_UINT32 p_nb_pocs,\n                                                        OPJ_UINT32 p_nb_resolutions,\n                                                        OPJ_UINT32 p_num_comps,\n                                                        OPJ_UINT32 p_num_layers,\n                                                        opj_event_mgr_t * p_manager)\n{\n        OPJ_UINT32* packet_array;\n        OPJ_UINT32 index , resno, compno, layno;\n        OPJ_UINT32 i;\n        OPJ_UINT32 step_c = 1;\n        OPJ_UINT32 step_r = p_num_comps * step_c;\n        OPJ_UINT32 step_l = p_nb_resolutions * step_r;\n        OPJ_BOOL loss = OPJ_FALSE;\n        OPJ_UINT32 layno0 = 0;\n\n        packet_array = (OPJ_UINT32*) opj_calloc(step_l * p_num_layers, sizeof(OPJ_UINT32));\n        if (packet_array == 00) {\n                opj_event_msg(p_manager , EVT_ERROR, \"Not enough memory for checking the poc values.\\n\");\n                return OPJ_FALSE;\n        }\n        memset(packet_array,0,step_l * p_num_layers* sizeof(OPJ_UINT32));\n\n        if (p_nb_pocs == 0) {\n        opj_free(packet_array);\n                return OPJ_TRUE;\n        }\n\n        index = step_r * p_pocs->resno0;\n        /* take each resolution for each poc */\n        for (resno = p_pocs->resno0 ; resno < p_pocs->resno1 ; ++resno)\n        {\n                OPJ_UINT32 res_index = index + p_pocs->compno0 * step_c;\n\n                /* take each comp of each resolution for each poc */\n                for (compno = p_pocs->compno0 ; compno < p_pocs->compno1 ; ++compno) {\n                        OPJ_UINT32 comp_index = res_index + layno0 * step_l;\n\n                        /* and finally take each layer of each res of ... */\n                        for (layno = layno0; layno < p_pocs->layno1 ; ++layno) {\n                                /*index = step_r * resno + step_c * compno + step_l * layno;*/\n                                packet_array[comp_index] = 1;\n                                comp_index += step_l;\n                        }\n\n                        res_index += step_c;\n                }\n\n                index += step_r;\n        }\n        ++p_pocs;\n\n        /* iterate through all the pocs */\n        for (i = 1; i < p_nb_pocs ; ++i) {\n                OPJ_UINT32 l_last_layno1 = (p_pocs-1)->layno1 ;\n\n                layno0 = (p_pocs->layno1 > l_last_layno1)? l_last_layno1 : 0;\n                index = step_r * p_pocs->resno0;\n\n                /* take each resolution for each poc */\n                for (resno = p_pocs->resno0 ; resno < p_pocs->resno1 ; ++resno) {\n                        OPJ_UINT32 res_index = index + p_pocs->compno0 * step_c;\n\n                        /* take each comp of each resolution for each poc */\n                        for (compno = p_pocs->compno0 ; compno < p_pocs->compno1 ; ++compno) {\n                                OPJ_UINT32 comp_index = res_index + layno0 * step_l;\n\n                                /* and finally take each layer of each res of ... */\n                                for (layno = layno0; layno < p_pocs->layno1 ; ++layno) {\n                                        /*index = step_r * resno + step_c * compno + step_l * layno;*/\n                                        packet_array[comp_index] = 1;\n                                        comp_index += step_l;\n                                }\n\n                                res_index += step_c;\n                        }\n\n                        index += step_r;\n                }\n\n                ++p_pocs;\n        }\n\n        index = 0;\n        for (layno = 0; layno < p_num_layers ; ++layno) {\n                for (resno = 0; resno < p_nb_resolutions; ++resno) {\n                        for (compno = 0; compno < p_num_comps; ++compno) {\n                                loss |= (packet_array[index]!=1);\n                                /*index = step_r * resno + step_c * compno + step_l * layno;*/\n                                index += step_c;\n                        }\n                }\n        }\n\n        if (loss) {\n                opj_event_msg(p_manager , EVT_ERROR, \"Missing packets possible loss of data\\n\");\n        }\n\n        opj_free(packet_array);\n\n        return !loss;\n}\n\n/* ----------------------------------------------------------------------- */\n\nOPJ_UINT32 opj_j2k_get_num_tp(opj_cp_t *cp, OPJ_UINT32 pino, OPJ_UINT32 tileno)\n{\n        const OPJ_CHAR *prog = 00;\n        OPJ_INT32 i;\n        OPJ_UINT32 tpnum = 1;\n        opj_tcp_t *tcp = 00;\n        opj_poc_t * l_current_poc = 00;\n\n        /*  preconditions */\n        assert(tileno < (cp->tw * cp->th));\n        assert(pino < (cp->tcps[tileno].numpocs + 1));\n\n        /* get the given tile coding parameter */\n        tcp = &cp->tcps[tileno];\n        assert(tcp != 00);\n\n        l_current_poc = &(tcp->pocs[pino]);\n        assert(l_current_poc != 0);\n\n        /* get the progression order as a character string */\n        prog = opj_j2k_convert_progression_order(tcp->prg);\n        assert(strlen(prog) > 0);\n\n        if (cp->m_specific_param.m_enc.m_tp_on == 1) {\n                for (i=0;i<4;++i) {\n                        switch (prog[i])\n                        {\n                                /* component wise */\n                                case 'C':\n                                        tpnum *= l_current_poc->compE;\n                                        break;\n                                /* resolution wise */\n                                case 'R':\n                                        tpnum *= l_current_poc->resE;\n                                        break;\n                                /* precinct wise */\n                                case 'P':\n                                        tpnum *= l_current_poc->prcE;\n                                        break;\n                                /* layer wise */\n                                case 'L':\n                                        tpnum *= l_current_poc->layE;\n                                        break;\n                        }\n                        /* whould we split here ? */\n                        if ( cp->m_specific_param.m_enc.m_tp_flag == prog[i] ) {\n                                cp->m_specific_param.m_enc.m_tp_pos=i;\n                                break;\n                        }\n                }\n        }\n        else {\n                tpnum=1;\n        }\n\n        return tpnum;\n}\n\nOPJ_BOOL opj_j2k_calculate_tp(  opj_j2k_t *p_j2k,\n                                                        opj_cp_t *cp,\n                                                        OPJ_UINT32 * p_nb_tiles,\n                                                        opj_image_t *image,\n                                                        opj_event_mgr_t * p_manager\n                                )\n{\n        OPJ_UINT32 pino,tileno;\n        OPJ_UINT32 l_nb_tiles;\n        opj_tcp_t *tcp;\n\n        /* preconditions */\n        assert(p_nb_tiles != 00);\n        assert(cp != 00);\n        assert(image != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        l_nb_tiles = cp->tw * cp->th;\n        * p_nb_tiles = 0;\n        tcp = cp->tcps;\n\n        /* INDEX >> */\n        /* TODO mergeV2: check this part which use cstr_info */\n        /*if (p_j2k->cstr_info) {\n                opj_tile_info_t * l_info_tile_ptr = p_j2k->cstr_info->tile;\n\n                for (tileno = 0; tileno < l_nb_tiles; ++tileno) {\n                        OPJ_UINT32 cur_totnum_tp = 0;\n\n                        opj_pi_update_encoding_parameters(image,cp,tileno);\n\n                        for (pino = 0; pino <= tcp->numpocs; ++pino)\n                        {\n                                OPJ_UINT32 tp_num = opj_j2k_get_num_tp(cp,pino,tileno);\n\n                                *p_nb_tiles = *p_nb_tiles + tp_num;\n\n                                cur_totnum_tp += tp_num;\n                        }\n\n                        tcp->m_nb_tile_parts = cur_totnum_tp;\n\n                        l_info_tile_ptr->tp = (opj_tp_info_t *) opj_malloc(cur_totnum_tp * sizeof(opj_tp_info_t));\n                        if (l_info_tile_ptr->tp == 00) {\n                                return OPJ_FALSE;\n                        }\n\n                        memset(l_info_tile_ptr->tp,0,cur_totnum_tp * sizeof(opj_tp_info_t));\n\n                        l_info_tile_ptr->num_tps = cur_totnum_tp;\n\n                        ++l_info_tile_ptr;\n                        ++tcp;\n                }\n        }\n        else */{\n                for (tileno = 0; tileno < l_nb_tiles; ++tileno) {\n                        OPJ_UINT32 cur_totnum_tp = 0;\n\n                        opj_pi_update_encoding_parameters(image,cp,tileno);\n\n                        for (pino = 0; pino <= tcp->numpocs; ++pino) {\n                                OPJ_UINT32 tp_num = opj_j2k_get_num_tp(cp,pino,tileno);\n\n                                *p_nb_tiles = *p_nb_tiles + tp_num;\n\n                                cur_totnum_tp += tp_num;\n                        }\n                        tcp->m_nb_tile_parts = cur_totnum_tp;\n\n                        ++tcp;\n                }\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_write_soc(     opj_j2k_t *p_j2k,\n                                                opj_stream_private_t *p_stream,\n                                                    opj_event_mgr_t * p_manager )\n{\n        /* 2 bytes will be written */\n        OPJ_BYTE * l_start_stream = 00;\n\n        /* preconditions */\n        assert(p_stream != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        l_start_stream = p_j2k->m_specific_param.m_encoder.m_header_tile_data;\n\n        /* write SOC identifier */\n        opj_write_bytes(l_start_stream,J2K_MS_SOC,2);\n\n        if (opj_stream_write_data(p_stream,l_start_stream,2,p_manager) != 2) {\n                return OPJ_FALSE;\n        }\n\n/* UniPG>> */\n#ifdef USE_JPWL\n        /* update markers struct */\n/*\n        OPJ_BOOL res = j2k_add_marker(p_j2k->cstr_info, J2K_MS_SOC, p_stream_tell(p_stream) - 2, 2);\n*/\n  assert( 0 && \"TODO\" );\n#endif /* USE_JPWL */\n/* <<UniPG */\n\n        return OPJ_TRUE;\n}\n\n/**\n * Reads a SOC marker (Start of Codestream)\n * @param       p_j2k           the jpeg2000 file codec.\n * @param       p_stream        FIXME DOC\n * @param       p_manager       the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_soc(   opj_j2k_t *p_j2k,\n                                    opj_stream_private_t *p_stream,\n                                    opj_event_mgr_t * p_manager\n                                    )\n{\n        OPJ_BYTE l_data [2];\n        OPJ_UINT32 l_marker;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        if (opj_stream_read_data(p_stream,l_data,2,p_manager) != 2) {\n                return OPJ_FALSE;\n        }\n\n        opj_read_bytes(l_data,&l_marker,2);\n        if (l_marker != J2K_MS_SOC) {\n                return OPJ_FALSE;\n        }\n\n        /* Next marker should be a SIZ marker in the main header */\n        p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_MHSIZ;\n\n        /* FIXME move it in a index structure included in p_j2k*/\n        p_j2k->cstr_index->main_head_start = opj_stream_tell(p_stream) - 2;\n\n        opj_event_msg(p_manager, EVT_INFO, \"Start to read j2k main header (%d).\\n\", p_j2k->cstr_index->main_head_start);\n\n        /* Add the marker to the codestream index*/\n        if (OPJ_FALSE == opj_j2k_add_mhmarker(p_j2k->cstr_index, J2K_MS_SOC, p_j2k->cstr_index->main_head_start, 2)) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to add mh marker\\n\");\n                return OPJ_FALSE;\n        }\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_write_siz(     opj_j2k_t *p_j2k,\n                                                        opj_stream_private_t *p_stream,\n                                                        opj_event_mgr_t * p_manager )\n{\n        OPJ_UINT32 i;\n        OPJ_UINT32 l_size_len;\n        OPJ_BYTE * l_current_ptr;\n        opj_image_t * l_image = 00;\n        opj_cp_t *cp = 00;\n        opj_image_comp_t * l_img_comp = 00;\n\n        /* preconditions */\n        assert(p_stream != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        l_image = p_j2k->m_private_image;\n        cp = &(p_j2k->m_cp);\n        l_size_len = 40 + 3 * l_image->numcomps;\n        l_img_comp = l_image->comps;\n\n        if (l_size_len > p_j2k->m_specific_param.m_encoder.m_header_tile_data_size) {\n\n                OPJ_BYTE *new_header_tile_data = (OPJ_BYTE *) opj_realloc(p_j2k->m_specific_param.m_encoder.m_header_tile_data, l_size_len);\n                if (! new_header_tile_data) {\n                        opj_free(p_j2k->m_specific_param.m_encoder.m_header_tile_data);\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data = NULL;\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = 0;\n                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory for the SIZ marker\\n\");\n                        return OPJ_FALSE;\n                }\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data = new_header_tile_data;\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = l_size_len;\n        }\n\n        l_current_ptr = p_j2k->m_specific_param.m_encoder.m_header_tile_data;\n\n        /* write SOC identifier */\n        opj_write_bytes(l_current_ptr,J2K_MS_SIZ,2);    /* SIZ */\n        l_current_ptr+=2;\n\n        opj_write_bytes(l_current_ptr,l_size_len-2,2); /* L_SIZ */\n        l_current_ptr+=2;\n\n        opj_write_bytes(l_current_ptr, cp->rsiz, 2);    /* Rsiz (capabilities) */\n        l_current_ptr+=2;\n\n        opj_write_bytes(l_current_ptr, l_image->x1, 4); /* Xsiz */\n        l_current_ptr+=4;\n\n        opj_write_bytes(l_current_ptr, l_image->y1, 4); /* Ysiz */\n        l_current_ptr+=4;\n\n        opj_write_bytes(l_current_ptr, l_image->x0, 4); /* X0siz */\n        l_current_ptr+=4;\n\n        opj_write_bytes(l_current_ptr, l_image->y0, 4); /* Y0siz */\n        l_current_ptr+=4;\n\n        opj_write_bytes(l_current_ptr, cp->tdx, 4);             /* XTsiz */\n        l_current_ptr+=4;\n\n        opj_write_bytes(l_current_ptr, cp->tdy, 4);             /* YTsiz */\n        l_current_ptr+=4;\n\n        opj_write_bytes(l_current_ptr, cp->tx0, 4);             /* XT0siz */\n        l_current_ptr+=4;\n\n        opj_write_bytes(l_current_ptr, cp->ty0, 4);             /* YT0siz */\n        l_current_ptr+=4;\n\n        opj_write_bytes(l_current_ptr, l_image->numcomps, 2);   /* Csiz */\n        l_current_ptr+=2;\n\n        for (i = 0; i < l_image->numcomps; ++i) {\n                /* TODO here with MCT ? */\n                opj_write_bytes(l_current_ptr, l_img_comp->prec - 1 + (l_img_comp->sgnd << 7), 1);      /* Ssiz_i */\n                ++l_current_ptr;\n\n                opj_write_bytes(l_current_ptr, l_img_comp->dx, 1);      /* XRsiz_i */\n                ++l_current_ptr;\n\n                opj_write_bytes(l_current_ptr, l_img_comp->dy, 1);      /* YRsiz_i */\n                ++l_current_ptr;\n\n                ++l_img_comp;\n        }\n\n        if (opj_stream_write_data(p_stream,p_j2k->m_specific_param.m_encoder.m_header_tile_data,l_size_len,p_manager) != l_size_len) {\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\n/**\n * Reads a SIZ marker (image and tile size)\n * @param       p_j2k           the jpeg2000 file codec.\n * @param       p_header_data   the data contained in the SIZ box.\n * @param       p_header_size   the size of the data contained in the SIZ marker.\n * @param       p_manager       the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_siz(opj_j2k_t *p_j2k,\n                                 OPJ_BYTE * p_header_data,\n                                 OPJ_UINT32 p_header_size,\n                                 opj_event_mgr_t * p_manager\n                                 )\n{\n        OPJ_UINT32 i;\n        OPJ_UINT32 l_nb_comp;\n        OPJ_UINT32 l_nb_comp_remain;\n        OPJ_UINT32 l_remaining_size;\n        OPJ_UINT32 l_nb_tiles;\n        OPJ_UINT32 l_tmp;\n        opj_image_t *l_image = 00;\n        opj_cp_t *l_cp = 00;\n        opj_image_comp_t * l_img_comp = 00;\n        opj_tcp_t * l_current_tile_param = 00;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_header_data != 00);\n\n        l_image = p_j2k->m_private_image;\n        l_cp = &(p_j2k->m_cp);\n\n        /* minimum size == 39 - 3 (= minimum component parameter) */\n        if (p_header_size < 36) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error with SIZ marker size\\n\");\n                return OPJ_FALSE;\n        }\n\n        l_remaining_size = p_header_size - 36;\n        l_nb_comp = l_remaining_size / 3;\n        l_nb_comp_remain = l_remaining_size % 3;\n        if (l_nb_comp_remain != 0){\n                opj_event_msg(p_manager, EVT_ERROR, \"Error with SIZ marker size\\n\");\n                return OPJ_FALSE;\n        }\n\n        opj_read_bytes(p_header_data,&l_tmp ,2);                                                /* Rsiz (capabilities) */\n        p_header_data+=2;\n        l_cp->rsiz = (OPJ_UINT16) l_tmp;\n        opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_image->x1, 4);   /* Xsiz */\n        p_header_data+=4;\n        opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_image->y1, 4);   /* Ysiz */\n        p_header_data+=4;\n        opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_image->x0, 4);   /* X0siz */\n        p_header_data+=4;\n        opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_image->y0, 4);   /* Y0siz */\n        p_header_data+=4;\n        opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_cp->tdx, 4);             /* XTsiz */\n        p_header_data+=4;\n        opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_cp->tdy, 4);             /* YTsiz */\n        p_header_data+=4;\n        opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_cp->tx0, 4);             /* XT0siz */\n        p_header_data+=4;\n        opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_cp->ty0, 4);             /* YT0siz */\n        p_header_data+=4;\n        opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_tmp, 2);                 /* Csiz */\n        p_header_data+=2;\n        if (l_tmp < 16385)\n                l_image->numcomps = (OPJ_UINT16) l_tmp;\n        else {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error with SIZ marker: number of component is illegal -> %d\\n\", l_tmp);\n                return OPJ_FALSE;\n        }\n\n        if (l_image->numcomps != l_nb_comp) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error with SIZ marker: number of component is not compatible with the remaining number of parameters ( %d vs %d)\\n\", l_image->numcomps, l_nb_comp);\n                return OPJ_FALSE;\n        }\n\n        /* testcase 4035.pdf.SIGSEGV.d8b.3375 */\n        if (l_image->x0 > l_image->x1 || l_image->y0 > l_image->y1) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error with SIZ marker: negative image size (%d x %d)\\n\", l_image->x1 - l_image->x0, l_image->y1 - l_image->y0);\n                return OPJ_FALSE;\n        }\n        /* testcase 2539.pdf.SIGFPE.706.1712 (also 3622.pdf.SIGFPE.706.2916 and 4008.pdf.SIGFPE.706.3345 and maybe more) */\n        if (!(l_cp->tdx * l_cp->tdy)) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error with SIZ marker: invalid tile size (tdx: %d, tdy: %d)\\n\", l_cp->tdx, l_cp->tdy);\n                return OPJ_FALSE;\n        }\n\n        /* testcase 1610.pdf.SIGSEGV.59c.681 */\n        if (((OPJ_UINT64)l_image->x1) * ((OPJ_UINT64)l_image->y1) != (l_image->x1 * l_image->y1)) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Prevent buffer overflow (x1: %d, y1: %d)\\n\", l_image->x1, l_image->y1);\n                return OPJ_FALSE;\n        }\n\n#ifdef USE_JPWL\n        if (l_cp->correct) {\n                /* if JPWL is on, we check whether TX errors have damaged\n                  too much the SIZ parameters */\n                if (!(l_image->x1 * l_image->y1)) {\n                        opj_event_msg(p_manager, EVT_ERROR,\n                                \"JPWL: bad image size (%d x %d)\\n\",\n                                l_image->x1, l_image->y1);\n                        if (!JPWL_ASSUME || JPWL_ASSUME) {\n                                opj_event_msg(p_manager, EVT_ERROR, \"JPWL: giving up\\n\");\n                                return OPJ_FALSE;\n                        }\n                }\n\n        /* FIXME check previously in the function so why keep this piece of code ? Need by the norm ?\n                if (l_image->numcomps != ((len - 38) / 3)) {\n                        opj_event_msg(p_manager, JPWL_ASSUME ? EVT_WARNING : EVT_ERROR,\n                                \"JPWL: Csiz is %d => space in SIZ only for %d comps.!!!\\n\",\n                                l_image->numcomps, ((len - 38) / 3));\n                        if (!JPWL_ASSUME) {\n                                opj_event_msg(p_manager, EVT_ERROR, \"JPWL: giving up\\n\");\n                                return OPJ_FALSE;\n                        }\n        */              /* we try to correct */\n        /*              opj_event_msg(p_manager, EVT_WARNING, \"- trying to adjust this\\n\");\n                        if (l_image->numcomps < ((len - 38) / 3)) {\n                                len = 38 + 3 * l_image->numcomps;\n                                opj_event_msg(p_manager, EVT_WARNING, \"- setting Lsiz to %d => HYPOTHESIS!!!\\n\",\n                                        len);\n                        } else {\n                                l_image->numcomps = ((len - 38) / 3);\n                                opj_event_msg(p_manager, EVT_WARNING, \"- setting Csiz to %d => HYPOTHESIS!!!\\n\",\n                                        l_image->numcomps);\n                        }\n                }\n        */\n\n                /* update components number in the jpwl_exp_comps filed */\n                l_cp->exp_comps = l_image->numcomps;\n        }\n#endif /* USE_JPWL */\n\n        /* Allocate the resulting image components */\n        l_image->comps = (opj_image_comp_t*) opj_calloc(l_image->numcomps, sizeof(opj_image_comp_t));\n        if (l_image->comps == 00){\n                l_image->numcomps = 0;\n                opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to take in charge SIZ marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        memset(l_image->comps,0,l_image->numcomps * sizeof(opj_image_comp_t));\n        l_img_comp = l_image->comps;\n\n        /* Read the component information */\n        for (i = 0; i < l_image->numcomps; ++i){\n                OPJ_UINT32 tmp;\n                opj_read_bytes(p_header_data,&tmp,1);   /* Ssiz_i */\n                ++p_header_data;\n                l_img_comp->prec = (tmp & 0x7f) + 1;\n                l_img_comp->sgnd = tmp >> 7;\n                opj_read_bytes(p_header_data,&tmp,1);   /* XRsiz_i */\n                ++p_header_data;\n                l_img_comp->dx = (OPJ_UINT32)tmp; /* should be between 1 and 255 */\n                opj_read_bytes(p_header_data,&tmp,1);   /* YRsiz_i */\n                ++p_header_data;\n                l_img_comp->dy = (OPJ_UINT32)tmp; /* should be between 1 and 255 */\n                if( l_img_comp->dx < 1 || l_img_comp->dx > 255 ||\n                    l_img_comp->dy < 1 || l_img_comp->dy > 255 ) {\n                    opj_event_msg(p_manager, EVT_ERROR,\n                                  \"Invalid values for comp = %d : dx=%u dy=%u\\n (should be between 1 and 255 according the JPEG2000 norm)\",\n                                  i, l_img_comp->dx, l_img_comp->dy);\n                    return OPJ_FALSE;\n                }\n\n#ifdef USE_JPWL\n                if (l_cp->correct) {\n                /* if JPWL is on, we check whether TX errors have damaged\n                        too much the SIZ parameters, again */\n                        if (!(l_image->comps[i].dx * l_image->comps[i].dy)) {\n                                opj_event_msg(p_manager, JPWL_ASSUME ? EVT_WARNING : EVT_ERROR,\n                                        \"JPWL: bad XRsiz_%d/YRsiz_%d (%d x %d)\\n\",\n                                        i, i, l_image->comps[i].dx, l_image->comps[i].dy);\n                                if (!JPWL_ASSUME) {\n                                        opj_event_msg(p_manager, EVT_ERROR, \"JPWL: giving up\\n\");\n                                        return OPJ_FALSE;\n                                }\n                                /* we try to correct */\n                                opj_event_msg(p_manager, EVT_WARNING, \"- trying to adjust them\\n\");\n                                if (!l_image->comps[i].dx) {\n                                        l_image->comps[i].dx = 1;\n                                        opj_event_msg(p_manager, EVT_WARNING, \"- setting XRsiz_%d to %d => HYPOTHESIS!!!\\n\",\n                                                i, l_image->comps[i].dx);\n                                }\n                                if (!l_image->comps[i].dy) {\n                                        l_image->comps[i].dy = 1;\n                                        opj_event_msg(p_manager, EVT_WARNING, \"- setting YRsiz_%d to %d => HYPOTHESIS!!!\\n\",\n                                                i, l_image->comps[i].dy);\n                                }\n                        }\n                }\n#endif /* USE_JPWL */\n                l_img_comp->resno_decoded = 0;                                                          /* number of resolution decoded */\n                l_img_comp->factor = l_cp->m_specific_param.m_dec.m_reduce; /* reducing factor per component */\n                ++l_img_comp;\n        }\n\n        /* Compute the number of tiles */\n        l_cp->tw = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)(l_image->x1 - l_cp->tx0), (OPJ_INT32)l_cp->tdx);\n        l_cp->th = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)(l_image->y1 - l_cp->ty0), (OPJ_INT32)l_cp->tdy);\n\n        /* Check that the number of tiles is valid */\n        if (l_cp->tw == 0 || l_cp->th == 0 || l_cp->tw > 65535 / l_cp->th) {\n            opj_event_msg(  p_manager, EVT_ERROR, \n                            \"Invalid number of tiles : %u x %u (maximum fixed by jpeg2000 norm is 65535 tiles)\\n\",\n                            l_cp->tw, l_cp->th);\n            return OPJ_FALSE;\n        }\n        l_nb_tiles = l_cp->tw * l_cp->th;\n\n        /* Define the tiles which will be decoded */\n        if (p_j2k->m_specific_param.m_decoder.m_discard_tiles) {\n                p_j2k->m_specific_param.m_decoder.m_start_tile_x = (p_j2k->m_specific_param.m_decoder.m_start_tile_x - l_cp->tx0) / l_cp->tdx;\n                p_j2k->m_specific_param.m_decoder.m_start_tile_y = (p_j2k->m_specific_param.m_decoder.m_start_tile_y - l_cp->ty0) / l_cp->tdy;\n                p_j2k->m_specific_param.m_decoder.m_end_tile_x = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)(p_j2k->m_specific_param.m_decoder.m_end_tile_x - l_cp->tx0), (OPJ_INT32)l_cp->tdx);\n                p_j2k->m_specific_param.m_decoder.m_end_tile_y = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)(p_j2k->m_specific_param.m_decoder.m_end_tile_y - l_cp->ty0), (OPJ_INT32)l_cp->tdy);\n        }\n        else {\n                p_j2k->m_specific_param.m_decoder.m_start_tile_x = 0;\n                p_j2k->m_specific_param.m_decoder.m_start_tile_y = 0;\n                p_j2k->m_specific_param.m_decoder.m_end_tile_x = l_cp->tw;\n                p_j2k->m_specific_param.m_decoder.m_end_tile_y = l_cp->th;\n        }\n\n#ifdef USE_JPWL\n        if (l_cp->correct) {\n                /* if JPWL is on, we check whether TX errors have damaged\n                  too much the SIZ parameters */\n                if ((l_cp->tw < 1) || (l_cp->th < 1) || (l_cp->tw > l_cp->max_tiles) || (l_cp->th > l_cp->max_tiles)) {\n                        opj_event_msg(p_manager, JPWL_ASSUME ? EVT_WARNING : EVT_ERROR,\n                                \"JPWL: bad number of tiles (%d x %d)\\n\",\n                                l_cp->tw, l_cp->th);\n                        if (!JPWL_ASSUME) {\n                                opj_event_msg(p_manager, EVT_ERROR, \"JPWL: giving up\\n\");\n                                return OPJ_FALSE;\n                        }\n                        /* we try to correct */\n                        opj_event_msg(p_manager, EVT_WARNING, \"- trying to adjust them\\n\");\n                        if (l_cp->tw < 1) {\n                                l_cp->tw= 1;\n                                opj_event_msg(p_manager, EVT_WARNING, \"- setting %d tiles in x => HYPOTHESIS!!!\\n\",\n                                                l_cp->tw);\n                        }\n                        if (l_cp->tw > l_cp->max_tiles) {\n                                l_cp->tw= 1;\n                                opj_event_msg(p_manager, EVT_WARNING, \"- too large x, increase expectance of %d\\n\"\n                                        \"- setting %d tiles in x => HYPOTHESIS!!!\\n\",\n                                        l_cp->max_tiles, l_cp->tw);\n                        }\n                        if (l_cp->th < 1) {\n                                l_cp->th= 1;\n                                opj_event_msg(p_manager, EVT_WARNING, \"- setting %d tiles in y => HYPOTHESIS!!!\\n\",\n                                                l_cp->th);\n                        }\n                        if (l_cp->th > l_cp->max_tiles) {\n                                l_cp->th= 1;\n                                opj_event_msg(p_manager, EVT_WARNING, \"- too large y, increase expectance of %d to continue\\n\",\n                                        \"- setting %d tiles in y => HYPOTHESIS!!!\\n\",\n                                        l_cp->max_tiles, l_cp->th);\n                        }\n                }\n        }\n#endif /* USE_JPWL */\n\n        /* memory allocations */\n        l_cp->tcps = (opj_tcp_t*) opj_calloc(l_nb_tiles, sizeof(opj_tcp_t));\n        if (l_cp->tcps == 00) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to take in charge SIZ marker\\n\");\n                return OPJ_FALSE;\n        }\n        memset(l_cp->tcps,0,l_nb_tiles*sizeof(opj_tcp_t));\n\n#ifdef USE_JPWL\n        if (l_cp->correct) {\n                if (!l_cp->tcps) {\n                        opj_event_msg(p_manager, JPWL_ASSUME ? EVT_WARNING : EVT_ERROR,\n                                \"JPWL: could not alloc tcps field of cp\\n\");\n                        if (!JPWL_ASSUME || JPWL_ASSUME) {\n                                opj_event_msg(p_manager, EVT_ERROR, \"JPWL: giving up\\n\");\n                                return OPJ_FALSE;\n                        }\n                }\n        }\n#endif /* USE_JPWL */\n\n        p_j2k->m_specific_param.m_decoder.m_default_tcp->tccps =\n                        (opj_tccp_t*) opj_calloc(l_image->numcomps, sizeof(opj_tccp_t));\n        if(p_j2k->m_specific_param.m_decoder.m_default_tcp->tccps  == 00) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to take in charge SIZ marker\\n\");\n                return OPJ_FALSE;\n        }\n        memset(p_j2k->m_specific_param.m_decoder.m_default_tcp->tccps ,0,l_image->numcomps*sizeof(opj_tccp_t));\n\n        p_j2k->m_specific_param.m_decoder.m_default_tcp->m_mct_records =\n                        (opj_mct_data_t*)opj_malloc(OPJ_J2K_MCT_DEFAULT_NB_RECORDS * sizeof(opj_mct_data_t));\n\n        if (! p_j2k->m_specific_param.m_decoder.m_default_tcp->m_mct_records) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to take in charge SIZ marker\\n\");\n                return OPJ_FALSE;\n        }\n        memset(p_j2k->m_specific_param.m_decoder.m_default_tcp->m_mct_records,0,OPJ_J2K_MCT_DEFAULT_NB_RECORDS * sizeof(opj_mct_data_t));\n        p_j2k->m_specific_param.m_decoder.m_default_tcp->m_nb_max_mct_records = OPJ_J2K_MCT_DEFAULT_NB_RECORDS;\n\n        p_j2k->m_specific_param.m_decoder.m_default_tcp->m_mcc_records =\n                        (opj_simple_mcc_decorrelation_data_t*)\n                        opj_malloc(OPJ_J2K_MCC_DEFAULT_NB_RECORDS * sizeof(opj_simple_mcc_decorrelation_data_t));\n\n        if (! p_j2k->m_specific_param.m_decoder.m_default_tcp->m_mcc_records) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to take in charge SIZ marker\\n\");\n                return OPJ_FALSE;\n        }\n        memset(p_j2k->m_specific_param.m_decoder.m_default_tcp->m_mcc_records,0,OPJ_J2K_MCC_DEFAULT_NB_RECORDS * sizeof(opj_simple_mcc_decorrelation_data_t));\n        p_j2k->m_specific_param.m_decoder.m_default_tcp->m_nb_max_mcc_records = OPJ_J2K_MCC_DEFAULT_NB_RECORDS;\n\n        /* set up default dc level shift */\n        for (i=0;i<l_image->numcomps;++i) {\n                if (! l_image->comps[i].sgnd) {\n                        p_j2k->m_specific_param.m_decoder.m_default_tcp->tccps[i].m_dc_level_shift = 1 << (l_image->comps[i].prec - 1);\n                }\n        }\n\n        l_current_tile_param = l_cp->tcps;\n        for     (i = 0; i < l_nb_tiles; ++i) {\n                l_current_tile_param->tccps = (opj_tccp_t*) opj_malloc(l_image->numcomps * sizeof(opj_tccp_t));\n                if (l_current_tile_param->tccps == 00) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to take in charge SIZ marker\\n\");\n                        return OPJ_FALSE;\n                }\n                memset(l_current_tile_param->tccps,0,l_image->numcomps * sizeof(opj_tccp_t));\n\n                ++l_current_tile_param;\n        }\n\n        p_j2k->m_specific_param.m_decoder.m_state =  J2K_STATE_MH; /* FIXME J2K_DEC_STATE_MH; */\n        opj_image_comp_header_update(l_image,l_cp);\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_write_com(     opj_j2k_t *p_j2k,\n                                                        opj_stream_private_t *p_stream,\n                                                        opj_event_mgr_t * p_manager\n                            )\n{\n        OPJ_UINT32 l_comment_size;\n        OPJ_UINT32 l_total_com_size;\n        const OPJ_CHAR *l_comment;\n        OPJ_BYTE * l_current_ptr = 00;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_stream != 00);\n        assert(p_manager != 00);\n\n        l_comment = p_j2k->m_cp.comment;\n        l_comment_size = (OPJ_UINT32)strlen(l_comment);\n        l_total_com_size = l_comment_size + 6;\n\n        if (l_total_com_size > p_j2k->m_specific_param.m_encoder.m_header_tile_data_size) {\n                OPJ_BYTE *new_header_tile_data = (OPJ_BYTE *) opj_realloc(p_j2k->m_specific_param.m_encoder.m_header_tile_data, l_total_com_size);\n                if (! new_header_tile_data) {\n                        opj_free(p_j2k->m_specific_param.m_encoder.m_header_tile_data);\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data = NULL;\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = 0;\n                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to write the COM marker\\n\");\n                        return OPJ_FALSE;\n                }\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data = new_header_tile_data;\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = l_total_com_size;\n        }\n\n        l_current_ptr = p_j2k->m_specific_param.m_encoder.m_header_tile_data;\n\n        opj_write_bytes(l_current_ptr,J2K_MS_COM , 2);  /* COM */\n        l_current_ptr+=2;\n\n        opj_write_bytes(l_current_ptr,l_total_com_size - 2 , 2);        /* L_COM */\n        l_current_ptr+=2;\n\n        opj_write_bytes(l_current_ptr,1 , 2);   /* General use (IS 8859-15:1999 (Latin) values) */\n        l_current_ptr+=2;\n\n        memcpy( l_current_ptr,l_comment,l_comment_size);\n\n        if (opj_stream_write_data(p_stream,p_j2k->m_specific_param.m_encoder.m_header_tile_data,l_total_com_size,p_manager) != l_total_com_size) {\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\n/**\n * Reads a COM marker (comments)\n * @param       p_j2k           the jpeg2000 file codec.\n * @param       p_header_data   the data contained in the COM box.\n * @param       p_header_size   the size of the data contained in the COM marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_com (  opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager\n                                    )\n{\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_header_data != 00);\n  (void)p_header_size;\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_write_cod(     opj_j2k_t *p_j2k,\n                                                        opj_stream_private_t *p_stream,\n                                                        opj_event_mgr_t * p_manager )\n{\n        opj_cp_t *l_cp = 00;\n        opj_tcp_t *l_tcp = 00;\n        OPJ_UINT32 l_code_size,l_remaining_size;\n        OPJ_BYTE * l_current_data = 00;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        l_cp = &(p_j2k->m_cp);\n        l_tcp = &l_cp->tcps[p_j2k->m_current_tile_number];\n        l_code_size = 9 + opj_j2k_get_SPCod_SPCoc_size(p_j2k,p_j2k->m_current_tile_number,0);\n        l_remaining_size = l_code_size;\n\n        if (l_code_size > p_j2k->m_specific_param.m_encoder.m_header_tile_data_size) {\n                OPJ_BYTE *new_header_tile_data = (OPJ_BYTE *) opj_realloc(p_j2k->m_specific_param.m_encoder.m_header_tile_data, l_code_size);\n                if (! new_header_tile_data) {\n                        opj_free(p_j2k->m_specific_param.m_encoder.m_header_tile_data);\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data = NULL;\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = 0;\n                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to write COD marker\\n\");\n                        return OPJ_FALSE;\n                }\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data = new_header_tile_data;\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = l_code_size;\n        }\n\n        l_current_data = p_j2k->m_specific_param.m_encoder.m_header_tile_data;\n\n        opj_write_bytes(l_current_data,J2K_MS_COD,2);           /* COD */\n        l_current_data += 2;\n\n        opj_write_bytes(l_current_data,l_code_size-2,2);        /* L_COD */\n        l_current_data += 2;\n\n        opj_write_bytes(l_current_data,l_tcp->csty,1);          /* Scod */\n        ++l_current_data;\n\n        opj_write_bytes(l_current_data,l_tcp->prg,1);           /* SGcod (A) */\n        ++l_current_data;\n\n        opj_write_bytes(l_current_data,l_tcp->numlayers,2);     /* SGcod (B) */\n        l_current_data+=2;\n\n        opj_write_bytes(l_current_data,l_tcp->mct,1);           /* SGcod (C) */\n        ++l_current_data;\n\n        l_remaining_size -= 9;\n\n        if (! opj_j2k_write_SPCod_SPCoc(p_j2k,p_j2k->m_current_tile_number,0,l_current_data,&l_remaining_size,p_manager)) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error writing COD marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        if (l_remaining_size != 0) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error writing COD marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        if (opj_stream_write_data(p_stream,p_j2k->m_specific_param.m_encoder.m_header_tile_data,l_code_size,p_manager) != l_code_size) {\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\n/**\n * Reads a COD marker (Coding Styke defaults)\n * @param       p_header_data   the data contained in the COD box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the COD marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_cod (  opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager\n                                    )\n{\n        /* loop */\n        OPJ_UINT32 i;\n        OPJ_UINT32 l_tmp;\n        opj_cp_t *l_cp = 00;\n        opj_tcp_t *l_tcp = 00;\n        opj_image_t *l_image = 00;\n\n        /* preconditions */\n        assert(p_header_data != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        l_image = p_j2k->m_private_image;\n        l_cp = &(p_j2k->m_cp);\n\n        /* If we are in the first tile-part header of the current tile */\n        l_tcp = (p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH) ?\n                                &l_cp->tcps[p_j2k->m_current_tile_number] :\n                                p_j2k->m_specific_param.m_decoder.m_default_tcp;\n\n        /* Make sure room is sufficient */\n        if (p_header_size < 5) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading COD marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        opj_read_bytes(p_header_data,&l_tcp->csty,1);           /* Scod */\n        ++p_header_data;\n        opj_read_bytes(p_header_data,&l_tmp,1);                         /* SGcod (A) */\n        ++p_header_data;\n        l_tcp->prg = (OPJ_PROG_ORDER) l_tmp;\n        opj_read_bytes(p_header_data,&l_tcp->numlayers,2);      /* SGcod (B) */\n        p_header_data+=2;\n\n        /* If user didn't set a number layer to decode take the max specify in the codestream. */\n        if      (l_cp->m_specific_param.m_dec.m_layer) {\n                l_tcp->num_layers_to_decode = l_cp->m_specific_param.m_dec.m_layer;\n        }\n        else {\n                l_tcp->num_layers_to_decode = l_tcp->numlayers;\n        }\n\n        opj_read_bytes(p_header_data,&l_tcp->mct,1);            /* SGcod (C) */\n        ++p_header_data;\n\n        p_header_size -= 5;\n        for     (i = 0; i < l_image->numcomps; ++i) {\n                l_tcp->tccps[i].csty = l_tcp->csty & J2K_CCP_CSTY_PRT;\n        }\n\n        if (! opj_j2k_read_SPCod_SPCoc(p_j2k,0,p_header_data,&p_header_size,p_manager)) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading COD marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        if (p_header_size != 0) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading COD marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        /* Apply the coding style to other components of the current tile or the m_default_tcp*/\n        opj_j2k_copy_tile_component_parameters(p_j2k);\n\n        /* Index */\n#ifdef WIP_REMOVE_MSD\n        if (p_j2k->cstr_info) {\n                /*opj_codestream_info_t *l_cstr_info = p_j2k->cstr_info;*/\n                p_j2k->cstr_info->prog = l_tcp->prg;\n                p_j2k->cstr_info->numlayers = l_tcp->numlayers;\n                p_j2k->cstr_info->numdecompos = (OPJ_INT32*) opj_malloc(l_image->numcomps * sizeof(OPJ_UINT32));\n                for     (i = 0; i < l_image->numcomps; ++i) {\n                        p_j2k->cstr_info->numdecompos[i] = l_tcp->tccps[i].numresolutions - 1;\n                }\n        }\n#endif\n\n        return OPJ_TRUE;\n}\n\n#if 0\nOPJ_BOOL opj_j2k_write_coc( opj_j2k_t *p_j2k,\n                                                OPJ_UINT32 p_comp_no,\n                                                opj_stream_private_t *p_stream,\n                                                opj_event_mgr_t * p_manager )\n{\n        OPJ_UINT32 l_coc_size,l_remaining_size;\n        OPJ_UINT32 l_comp_room;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        l_comp_room = (p_j2k->m_private_image->numcomps <= 256) ? 1 : 2;\n\n        l_coc_size = 5 + l_comp_room + opj_j2k_get_SPCod_SPCoc_size(p_j2k,p_j2k->m_current_tile_number,p_comp_no);\n\n        if (l_coc_size > p_j2k->m_specific_param.m_encoder.m_header_tile_data_size) {\n                OPJ_BYTE *new_header_tile_data;\n                /*p_j2k->m_specific_param.m_encoder.m_header_tile_data\n                        = (OPJ_BYTE*)opj_realloc(\n                                p_j2k->m_specific_param.m_encoder.m_header_tile_data,\n                                l_coc_size);*/\n\n                new_header_tile_data = (OPJ_BYTE *) opj_realloc(p_j2k->m_specific_param.m_encoder.m_header_tile_data, l_coc_size);\n                if (! new_header_tile_data) {\n                        opj_free(p_j2k->m_specific_param.m_encoder.m_header_tile_data);\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data = NULL;\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = 0;\n                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to write COC marker\\n\");\n                        return OPJ_FALSE;\n                }\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data = new_header_tile_data;\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = l_coc_size;\n        }\n\n        opj_j2k_write_coc_in_memory(p_j2k,p_comp_no,p_j2k->m_specific_param.m_encoder.m_header_tile_data,&l_remaining_size,p_manager);\n\n        if (opj_stream_write_data(p_stream,p_j2k->m_specific_param.m_encoder.m_header_tile_data,l_coc_size,p_manager) != l_coc_size) {\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n#endif\n\n#if 0\nvoid opj_j2k_write_coc_in_memory(   opj_j2k_t *p_j2k,\n                                                OPJ_UINT32 p_comp_no,\n                                                OPJ_BYTE * p_data,\n                                                OPJ_UINT32 * p_data_written,\n                                                opj_event_mgr_t * p_manager\n                                    )\n{\n        opj_cp_t *l_cp = 00;\n        opj_tcp_t *l_tcp = 00;\n        OPJ_UINT32 l_coc_size,l_remaining_size;\n        OPJ_BYTE * l_current_data = 00;\n        opj_image_t *l_image = 00;\n        OPJ_UINT32 l_comp_room;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        l_cp = &(p_j2k->m_cp);\n        l_tcp = &l_cp->tcps[p_j2k->m_current_tile_number];\n        l_image = p_j2k->m_private_image;\n        l_comp_room = (l_image->numcomps <= 256) ? 1 : 2;\n\n        l_coc_size = 5 + l_comp_room + opj_j2k_get_SPCod_SPCoc_size(p_j2k,p_j2k->m_current_tile_number,p_comp_no);\n        l_remaining_size = l_coc_size;\n\n        l_current_data = p_data;\n\n        opj_write_bytes(l_current_data,J2K_MS_COC,2);                           /* COC */\n        l_current_data += 2;\n\n        opj_write_bytes(l_current_data,l_coc_size-2,2);                         /* L_COC */\n        l_current_data += 2;\n\n        opj_write_bytes(l_current_data,p_comp_no, l_comp_room);         /* Ccoc */\n        l_current_data+=l_comp_room;\n\n        opj_write_bytes(l_current_data, l_tcp->tccps[p_comp_no].csty, 1);               /* Scoc */\n        ++l_current_data;\n\n        l_remaining_size -= (5 + l_comp_room);\n        opj_j2k_write_SPCod_SPCoc(p_j2k,p_j2k->m_current_tile_number,0,l_current_data,&l_remaining_size,p_manager);\n        * p_data_written = l_coc_size;\n}\n#endif\n\nOPJ_UINT32 opj_j2k_get_max_coc_size(opj_j2k_t *p_j2k)\n{\n        OPJ_UINT32 i,j;\n        OPJ_UINT32 l_nb_comp;\n        OPJ_UINT32 l_nb_tiles;\n        OPJ_UINT32 l_max = 0;\n\n        /* preconditions */\n\n        l_nb_tiles = p_j2k->m_cp.tw * p_j2k->m_cp.th ;\n        l_nb_comp = p_j2k->m_private_image->numcomps;\n\n        for (i=0;i<l_nb_tiles;++i) {\n                for (j=0;j<l_nb_comp;++j) {\n                        l_max = opj_uint_max(l_max,opj_j2k_get_SPCod_SPCoc_size(p_j2k,i,j));\n                }\n        }\n\n        return 6 + l_max;\n}\n\n/**\n * Reads a COC marker (Coding Style Component)\n * @param       p_header_data   the data contained in the COC box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the COC marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_coc (  opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager\n                                    )\n{\n        opj_cp_t *l_cp = NULL;\n        opj_tcp_t *l_tcp = NULL;\n        opj_image_t *l_image = NULL;\n        OPJ_UINT32 l_comp_room;\n        OPJ_UINT32 l_comp_no;\n\n        /* preconditions */\n        assert(p_header_data != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        l_cp = &(p_j2k->m_cp);\n        l_tcp = (p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH ) ? /*FIXME J2K_DEC_STATE_TPH*/\n                                &l_cp->tcps[p_j2k->m_current_tile_number] :\n                                p_j2k->m_specific_param.m_decoder.m_default_tcp;\n        l_image = p_j2k->m_private_image;\n\n        l_comp_room = l_image->numcomps <= 256 ? 1 : 2;\n\n        /* make sure room is sufficient*/\n        if (p_header_size < l_comp_room + 1) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading COC marker\\n\");\n                return OPJ_FALSE;\n        }\n        p_header_size -= l_comp_room + 1;\n\n        opj_read_bytes(p_header_data,&l_comp_no,l_comp_room);                   /* Ccoc */\n        p_header_data += l_comp_room;\n        if (l_comp_no >= l_image->numcomps) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading COC marker (bad number of components)\\n\");\n                return OPJ_FALSE;\n        }\n\n        opj_read_bytes(p_header_data,&l_tcp->tccps[l_comp_no].csty,1);                  /* Scoc */\n        ++p_header_data ;\n\n        if (! opj_j2k_read_SPCod_SPCoc(p_j2k,l_comp_no,p_header_data,&p_header_size,p_manager)) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading COC marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        if (p_header_size != 0) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading COC marker\\n\");\n                return OPJ_FALSE;\n        }\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_write_qcd(     opj_j2k_t *p_j2k,\n                                                        opj_stream_private_t *p_stream,\n                                                        opj_event_mgr_t * p_manager\n                            )\n{\n        OPJ_UINT32 l_qcd_size,l_remaining_size;\n        OPJ_BYTE * l_current_data = 00;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        l_qcd_size = 4 + opj_j2k_get_SQcd_SQcc_size(p_j2k,p_j2k->m_current_tile_number,0);\n        l_remaining_size = l_qcd_size;\n\n        if (l_qcd_size > p_j2k->m_specific_param.m_encoder.m_header_tile_data_size) {\n                OPJ_BYTE *new_header_tile_data = (OPJ_BYTE *) opj_realloc(p_j2k->m_specific_param.m_encoder.m_header_tile_data, l_qcd_size);\n                if (! new_header_tile_data) {\n                        opj_free(p_j2k->m_specific_param.m_encoder.m_header_tile_data);\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data = NULL;\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = 0;\n                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to write QCD marker\\n\");\n                        return OPJ_FALSE;\n                }\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data = new_header_tile_data;\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = l_qcd_size;\n        }\n\n        l_current_data = p_j2k->m_specific_param.m_encoder.m_header_tile_data;\n\n        opj_write_bytes(l_current_data,J2K_MS_QCD,2);           /* QCD */\n        l_current_data += 2;\n\n        opj_write_bytes(l_current_data,l_qcd_size-2,2);         /* L_QCD */\n        l_current_data += 2;\n\n        l_remaining_size -= 4;\n\n        if (! opj_j2k_write_SQcd_SQcc(p_j2k,p_j2k->m_current_tile_number,0,l_current_data,&l_remaining_size,p_manager)) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error writing QCD marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        if (l_remaining_size != 0) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error writing QCD marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        if (opj_stream_write_data(p_stream, p_j2k->m_specific_param.m_encoder.m_header_tile_data,l_qcd_size,p_manager) != l_qcd_size) {\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\n/**\n * Reads a QCD marker (Quantization defaults)\n * @param       p_header_data   the data contained in the QCD box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the QCD marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_qcd (  opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager\n                                    )\n{\n        /* preconditions */\n        assert(p_header_data != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        if (! opj_j2k_read_SQcd_SQcc(p_j2k,0,p_header_data,&p_header_size,p_manager)) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading QCD marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        if (p_header_size != 0) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading QCD marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        /* Apply the quantization parameters to other components of the current tile or the m_default_tcp */\n        opj_j2k_copy_tile_quantization_parameters(p_j2k);\n\n        return OPJ_TRUE;\n}\n\n#if 0\nOPJ_BOOL opj_j2k_write_qcc(     opj_j2k_t *p_j2k,\n                                                OPJ_UINT32 p_comp_no,\n                                                opj_stream_private_t *p_stream,\n                                                opj_event_mgr_t * p_manager\n                            )\n{\n        OPJ_UINT32 l_qcc_size,l_remaining_size;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        l_qcc_size = 5 + opj_j2k_get_SQcd_SQcc_size(p_j2k,p_j2k->m_current_tile_number,p_comp_no);\n        l_qcc_size += p_j2k->m_private_image->numcomps <= 256 ? 0:1;\n        l_remaining_size = l_qcc_size;\n\n        if (l_qcc_size > p_j2k->m_specific_param.m_encoder.m_header_tile_data_size) {\n                OPJ_BYTE *new_header_tile_data = (OPJ_BYTE *) opj_realloc(p_j2k->m_specific_param.m_encoder.m_header_tile_data, l_qcc_size);\n                if (! new_header_tile_data) {\n                        opj_free(p_j2k->m_specific_param.m_encoder.m_header_tile_data);\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data = NULL;\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = 0;\n                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to write QCC marker\\n\");\n                        return OPJ_FALSE;\n                }\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data = new_header_tile_data;\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = l_qcc_size;\n        }\n\n        opj_j2k_write_qcc_in_memory(p_j2k,p_comp_no,p_j2k->m_specific_param.m_encoder.m_header_tile_data,&l_remaining_size,p_manager);\n\n        if (opj_stream_write_data(p_stream,p_j2k->m_specific_param.m_encoder.m_header_tile_data,l_qcc_size,p_manager) != l_qcc_size) {\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n#endif\n\n#if 0\nvoid opj_j2k_write_qcc_in_memory(   opj_j2k_t *p_j2k,\n                                                                OPJ_UINT32 p_comp_no,\n                                                                OPJ_BYTE * p_data,\n                                                                OPJ_UINT32 * p_data_written,\n                                                                opj_event_mgr_t * p_manager\n                                    )\n{\n        OPJ_UINT32 l_qcc_size,l_remaining_size;\n        OPJ_BYTE * l_current_data = 00;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        l_qcc_size = 6 + opj_j2k_get_SQcd_SQcc_size(p_j2k,p_j2k->m_current_tile_number,p_comp_no);\n        l_remaining_size = l_qcc_size;\n\n        l_current_data = p_data;\n\n        opj_write_bytes(l_current_data,J2K_MS_QCC,2);           /* QCC */\n        l_current_data += 2;\n\n        if (p_j2k->m_private_image->numcomps <= 256) {\n                --l_qcc_size;\n\n                opj_write_bytes(l_current_data,l_qcc_size-2,2);         /* L_QCC */\n                l_current_data += 2;\n\n                opj_write_bytes(l_current_data, p_comp_no, 1);  /* Cqcc */\n                ++l_current_data;\n\n                /* in the case only one byte is sufficient the last byte allocated is useless -> still do -6 for available */\n                l_remaining_size -= 6;\n        }\n        else {\n                opj_write_bytes(l_current_data,l_qcc_size-2,2);         /* L_QCC */\n                l_current_data += 2;\n\n                opj_write_bytes(l_current_data, p_comp_no, 2);  /* Cqcc */\n                l_current_data+=2;\n\n                l_remaining_size -= 6;\n        }\n\n        opj_j2k_write_SQcd_SQcc(p_j2k,p_j2k->m_current_tile_number,p_comp_no,l_current_data,&l_remaining_size,p_manager);\n\n        *p_data_written = l_qcc_size;\n}\n#endif\n\nOPJ_UINT32 opj_j2k_get_max_qcc_size (opj_j2k_t *p_j2k)\n{\n        return opj_j2k_get_max_coc_size(p_j2k);\n}\n\n/**\n * Reads a QCC marker (Quantization component)\n * @param       p_header_data   the data contained in the QCC box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the QCC marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_qcc(   opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager\n                                    )\n{\n        OPJ_UINT32 l_num_comp,l_comp_no;\n\n        /* preconditions */\n        assert(p_header_data != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        l_num_comp = p_j2k->m_private_image->numcomps;\n\n        if (l_num_comp <= 256) {\n                if (p_header_size < 1) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Error reading QCC marker\\n\");\n                        return OPJ_FALSE;\n                }\n                opj_read_bytes(p_header_data,&l_comp_no,1);\n                ++p_header_data;\n                --p_header_size;\n        }\n        else {\n                if (p_header_size < 2) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Error reading QCC marker\\n\");\n                        return OPJ_FALSE;\n                }\n                opj_read_bytes(p_header_data,&l_comp_no,2);\n                p_header_data+=2;\n                p_header_size-=2;\n        }\n\n#ifdef USE_JPWL\n        if (p_j2k->m_cp.correct) {\n\n                static OPJ_UINT32 backup_compno = 0;\n\n                /* compno is negative or larger than the number of components!!! */\n                if (/*(l_comp_no < 0) ||*/ (l_comp_no >= l_num_comp)) {\n                        opj_event_msg(p_manager, EVT_ERROR,\n                                \"JPWL: bad component number in QCC (%d out of a maximum of %d)\\n\",\n                                l_comp_no, l_num_comp);\n                        if (!JPWL_ASSUME) {\n                                opj_event_msg(p_manager, EVT_ERROR, \"JPWL: giving up\\n\");\n                                return OPJ_FALSE;\n                        }\n                        /* we try to correct */\n                        l_comp_no = backup_compno % l_num_comp;\n                        opj_event_msg(p_manager, EVT_WARNING, \"- trying to adjust this\\n\"\n                                \"- setting component number to %d\\n\",\n                                l_comp_no);\n                }\n\n                /* keep your private count of tiles */\n                backup_compno++;\n        };\n#endif /* USE_JPWL */\n\n        if (l_comp_no >= p_j2k->m_private_image->numcomps) {\n                opj_event_msg(p_manager, EVT_ERROR,\n                              \"Invalid component number: %d, regarding the number of components %d\\n\",\n                              l_comp_no, p_j2k->m_private_image->numcomps);\n                return OPJ_FALSE;\n        }\n\n        if (! opj_j2k_read_SQcd_SQcc(p_j2k,l_comp_no,p_header_data,&p_header_size,p_manager)) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading QCC marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        if (p_header_size != 0) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading QCC marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_write_poc(     opj_j2k_t *p_j2k,\n                                                        opj_stream_private_t *p_stream,\n                                                        opj_event_mgr_t * p_manager\n                            )\n{\n        OPJ_UINT32 l_nb_comp;\n        OPJ_UINT32 l_nb_poc;\n        OPJ_UINT32 l_poc_size;\n        OPJ_UINT32 l_written_size = 0;\n        opj_tcp_t *l_tcp = 00;\n        OPJ_UINT32 l_poc_room;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        l_tcp = &p_j2k->m_cp.tcps[p_j2k->m_current_tile_number];\n        l_nb_comp = p_j2k->m_private_image->numcomps;\n        l_nb_poc = 1 + l_tcp->numpocs;\n\n        if (l_nb_comp <= 256) {\n                l_poc_room = 1;\n        }\n        else {\n                l_poc_room = 2;\n        }\n        l_poc_size = 4 + (5 + 2 * l_poc_room) * l_nb_poc;\n\n        if (l_poc_size > p_j2k->m_specific_param.m_encoder.m_header_tile_data_size) {\n                OPJ_BYTE *new_header_tile_data = (OPJ_BYTE *) opj_realloc(p_j2k->m_specific_param.m_encoder.m_header_tile_data, l_poc_size);\n                if (! new_header_tile_data) {\n                        opj_free(p_j2k->m_specific_param.m_encoder.m_header_tile_data);\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data = NULL;\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = 0;\n                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to write POC marker\\n\");\n                        return OPJ_FALSE;\n                }\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data = new_header_tile_data;\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = l_poc_size;\n        }\n\n        opj_j2k_write_poc_in_memory(p_j2k,p_j2k->m_specific_param.m_encoder.m_header_tile_data,&l_written_size,p_manager);\n\n        if (opj_stream_write_data(p_stream,p_j2k->m_specific_param.m_encoder.m_header_tile_data,l_poc_size,p_manager) != l_poc_size) {\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\nvoid opj_j2k_write_poc_in_memory(   opj_j2k_t *p_j2k,\n                                                                OPJ_BYTE * p_data,\n                                                                OPJ_UINT32 * p_data_written,\n                                                                opj_event_mgr_t * p_manager\n                                    )\n{\n        OPJ_UINT32 i;\n        OPJ_BYTE * l_current_data = 00;\n        OPJ_UINT32 l_nb_comp;\n        OPJ_UINT32 l_nb_poc;\n        OPJ_UINT32 l_poc_size;\n        opj_image_t *l_image = 00;\n        opj_tcp_t *l_tcp = 00;\n        opj_tccp_t *l_tccp = 00;\n        opj_poc_t *l_current_poc = 00;\n        OPJ_UINT32 l_poc_room;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        l_tcp = &p_j2k->m_cp.tcps[p_j2k->m_current_tile_number];\n        l_tccp = &l_tcp->tccps[0];\n        l_image = p_j2k->m_private_image;\n        l_nb_comp = l_image->numcomps;\n        l_nb_poc = 1 + l_tcp->numpocs;\n\n        if (l_nb_comp <= 256) {\n                l_poc_room = 1;\n        }\n        else {\n                l_poc_room = 2;\n        }\n\n        l_poc_size = 4 + (5 + 2 * l_poc_room) * l_nb_poc;\n\n        l_current_data = p_data;\n\n        opj_write_bytes(l_current_data,J2K_MS_POC,2);                                   /* POC  */\n        l_current_data += 2;\n\n        opj_write_bytes(l_current_data,l_poc_size-2,2);                                 /* Lpoc */\n        l_current_data += 2;\n\n        l_current_poc =  l_tcp->pocs;\n        for (i = 0; i < l_nb_poc; ++i) {\n                opj_write_bytes(l_current_data,l_current_poc->resno0,1);                                /* RSpoc_i */\n                ++l_current_data;\n\n                opj_write_bytes(l_current_data,l_current_poc->compno0,l_poc_room);              /* CSpoc_i */\n                l_current_data+=l_poc_room;\n\n                opj_write_bytes(l_current_data,l_current_poc->layno1,2);                                /* LYEpoc_i */\n                l_current_data+=2;\n\n                opj_write_bytes(l_current_data,l_current_poc->resno1,1);                                /* REpoc_i */\n                ++l_current_data;\n\n                opj_write_bytes(l_current_data,l_current_poc->compno1,l_poc_room);              /* CEpoc_i */\n                l_current_data+=l_poc_room;\n\n                opj_write_bytes(l_current_data,l_current_poc->prg,1);                                   /* Ppoc_i */\n                ++l_current_data;\n\n                /* change the value of the max layer according to the actual number of layers in the file, components and resolutions*/\n                l_current_poc->layno1 = (OPJ_UINT32)opj_int_min((OPJ_INT32)l_current_poc->layno1, (OPJ_INT32)l_tcp->numlayers);\n                l_current_poc->resno1 = (OPJ_UINT32)opj_int_min((OPJ_INT32)l_current_poc->resno1, (OPJ_INT32)l_tccp->numresolutions);\n                l_current_poc->compno1 = (OPJ_UINT32)opj_int_min((OPJ_INT32)l_current_poc->compno1, (OPJ_INT32)l_nb_comp);\n\n                ++l_current_poc;\n        }\n\n        *p_data_written = l_poc_size;\n}\n\nOPJ_UINT32 opj_j2k_get_max_poc_size(opj_j2k_t *p_j2k)\n{\n        opj_tcp_t * l_tcp = 00;\n        OPJ_UINT32 l_nb_tiles = 0;\n        OPJ_UINT32 l_max_poc = 0;\n        OPJ_UINT32 i;\n\n        l_tcp = p_j2k->m_cp.tcps;\n        l_nb_tiles = p_j2k->m_cp.th * p_j2k->m_cp.tw;\n\n        for (i=0;i<l_nb_tiles;++i) {\n                l_max_poc = opj_uint_max(l_max_poc,l_tcp->numpocs);\n                ++l_tcp;\n        }\n\n        ++l_max_poc;\n\n        return 4 + 9 * l_max_poc;\n}\n\nOPJ_UINT32 opj_j2k_get_max_toc_size (opj_j2k_t *p_j2k)\n{\n        OPJ_UINT32 i;\n        OPJ_UINT32 l_nb_tiles;\n        OPJ_UINT32 l_max = 0;\n        opj_tcp_t * l_tcp = 00;\n\n        l_tcp = p_j2k->m_cp.tcps;\n        l_nb_tiles = p_j2k->m_cp.tw * p_j2k->m_cp.th ;\n\n        for (i=0;i<l_nb_tiles;++i) {\n                l_max = opj_uint_max(l_max,l_tcp->m_nb_tile_parts);\n\n                ++l_tcp;\n        }\n\n        return 12 * l_max;\n}\n\nOPJ_UINT32 opj_j2k_get_specific_header_sizes(opj_j2k_t *p_j2k)\n{\n        OPJ_UINT32 l_nb_bytes = 0;\n        OPJ_UINT32 l_nb_comps;\n        OPJ_UINT32 l_coc_bytes,l_qcc_bytes;\n\n        l_nb_comps = p_j2k->m_private_image->numcomps - 1;\n        l_nb_bytes += opj_j2k_get_max_toc_size(p_j2k);\n\n        if (!(OPJ_IS_CINEMA(p_j2k->m_cp.rsiz))) {\n                l_coc_bytes = opj_j2k_get_max_coc_size(p_j2k);\n                l_nb_bytes += l_nb_comps * l_coc_bytes;\n\n                l_qcc_bytes = opj_j2k_get_max_qcc_size(p_j2k);\n                l_nb_bytes += l_nb_comps * l_qcc_bytes;\n        }\n\n        l_nb_bytes += opj_j2k_get_max_poc_size(p_j2k);\n\n        /*** DEVELOPER CORNER, Add room for your headers ***/\n\n        return l_nb_bytes;\n}\n\n/**\n * Reads a POC marker (Progression Order Change)\n *\n * @param       p_header_data   the data contained in the POC box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the POC marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_poc (  opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager\n                                    )\n{\n        OPJ_UINT32 i, l_nb_comp, l_tmp;\n        opj_image_t * l_image = 00;\n        OPJ_UINT32 l_old_poc_nb, l_current_poc_nb, l_current_poc_remaining;\n        OPJ_UINT32 l_chunk_size, l_comp_room;\n\n        opj_cp_t *l_cp = 00;\n        opj_tcp_t *l_tcp = 00;\n        opj_poc_t *l_current_poc = 00;\n\n        /* preconditions */\n        assert(p_header_data != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        l_image = p_j2k->m_private_image;\n        l_nb_comp = l_image->numcomps;\n        if (l_nb_comp <= 256) {\n                l_comp_room = 1;\n        }\n        else {\n                l_comp_room = 2;\n        }\n        l_chunk_size = 5 + 2 * l_comp_room;\n        l_current_poc_nb = p_header_size / l_chunk_size;\n        l_current_poc_remaining = p_header_size % l_chunk_size;\n\n        if ((l_current_poc_nb <= 0) || (l_current_poc_remaining != 0)) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading POC marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        l_cp = &(p_j2k->m_cp);\n        l_tcp = (p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH) ?\n                                &l_cp->tcps[p_j2k->m_current_tile_number] :\n                                p_j2k->m_specific_param.m_decoder.m_default_tcp;\n        l_old_poc_nb = l_tcp->POC ? l_tcp->numpocs + 1 : 0;\n        l_current_poc_nb += l_old_poc_nb;\n\n        if(l_current_poc_nb >= sizeof(l_tcp->pocs) / sizeof(l_tcp->pocs[0]))\n          {\n          opj_event_msg(p_manager, EVT_ERROR, \"Too many POCs %d\\n\", l_current_poc_nb);\n          return OPJ_FALSE;\n          }\n        assert(l_current_poc_nb < 32);\n\n        /* now poc is in use.*/\n        l_tcp->POC = 1;\n\n        l_current_poc = &l_tcp->pocs[l_old_poc_nb];\n        for     (i = l_old_poc_nb; i < l_current_poc_nb; ++i) {\n                opj_read_bytes(p_header_data,&(l_current_poc->resno0),1);                               /* RSpoc_i */\n                ++p_header_data;\n                opj_read_bytes(p_header_data,&(l_current_poc->compno0),l_comp_room);    /* CSpoc_i */\n                p_header_data+=l_comp_room;\n                opj_read_bytes(p_header_data,&(l_current_poc->layno1),2);                               /* LYEpoc_i */\n                /* make sure layer end is in acceptable bounds */\n                l_current_poc->layno1 = opj_uint_min(l_current_poc->layno1, l_tcp->numlayers);\n                p_header_data+=2;\n                opj_read_bytes(p_header_data,&(l_current_poc->resno1),1);                               /* REpoc_i */\n                ++p_header_data;\n                opj_read_bytes(p_header_data,&(l_current_poc->compno1),l_comp_room);    /* CEpoc_i */\n                p_header_data+=l_comp_room;\n                opj_read_bytes(p_header_data,&l_tmp,1);                                                                 /* Ppoc_i */\n                ++p_header_data;\n                l_current_poc->prg = (OPJ_PROG_ORDER) l_tmp;\n                /* make sure comp is in acceptable bounds */\n                l_current_poc->compno1 = opj_uint_min(l_current_poc->compno1, l_nb_comp);\n                ++l_current_poc;\n        }\n\n        l_tcp->numpocs = l_current_poc_nb - 1;\n        return OPJ_TRUE;\n}\n\n/**\n * Reads a CRG marker (Component registration)\n *\n * @param       p_header_data   the data contained in the TLM box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the TLM marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_crg (  opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager\n                                    )\n{\n        OPJ_UINT32 l_nb_comp;\n        /* preconditions */\n        assert(p_header_data != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        l_nb_comp = p_j2k->m_private_image->numcomps;\n\n        if (p_header_size != l_nb_comp *4) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading CRG marker\\n\");\n                return OPJ_FALSE;\n        }\n        /* Do not care of this at the moment since only local variables are set here */\n        /*\n        for\n                (i = 0; i < l_nb_comp; ++i)\n        {\n                opj_read_bytes(p_header_data,&l_Xcrg_i,2);                              // Xcrg_i\n                p_header_data+=2;\n                opj_read_bytes(p_header_data,&l_Ycrg_i,2);                              // Xcrg_i\n                p_header_data+=2;\n        }\n        */\n        return OPJ_TRUE;\n}\n\n/**\n * Reads a TLM marker (Tile Length Marker)\n *\n * @param       p_header_data   the data contained in the TLM box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the TLM marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_tlm (  opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager\n                                    )\n{\n        OPJ_UINT32 l_Ztlm, l_Stlm, l_ST, l_SP, l_tot_num_tp_remaining, l_quotient, l_Ptlm_size;\n        /* preconditions */\n        assert(p_header_data != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        if (p_header_size < 2) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading TLM marker\\n\");\n                return OPJ_FALSE;\n        }\n        p_header_size -= 2;\n\n        opj_read_bytes(p_header_data,&l_Ztlm,1);                                /* Ztlm */\n        ++p_header_data;\n        opj_read_bytes(p_header_data,&l_Stlm,1);                                /* Stlm */\n        ++p_header_data;\n\n        l_ST = ((l_Stlm >> 4) & 0x3);\n        l_SP = (l_Stlm >> 6) & 0x1;\n\n        l_Ptlm_size = (l_SP + 1) * 2;\n        l_quotient = l_Ptlm_size + l_ST;\n\n        l_tot_num_tp_remaining = p_header_size % l_quotient;\n\n        if (l_tot_num_tp_remaining != 0) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading TLM marker\\n\");\n                return OPJ_FALSE;\n        }\n        /* FIXME Do not care of this at the moment since only local variables are set here */\n        /*\n        for\n                (i = 0; i < l_tot_num_tp; ++i)\n        {\n                opj_read_bytes(p_header_data,&l_Ttlm_i,l_ST);                           // Ttlm_i\n                p_header_data += l_ST;\n                opj_read_bytes(p_header_data,&l_Ptlm_i,l_Ptlm_size);            // Ptlm_i\n                p_header_data += l_Ptlm_size;\n        }*/\n        return OPJ_TRUE;\n}\n\n/**\n * Reads a PLM marker (Packet length, main header marker)\n *\n * @param       p_header_data   the data contained in the TLM box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the TLM marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_plm (  opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager\n                                    )\n{\n        /* preconditions */\n        assert(p_header_data != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        if (p_header_size < 1) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading PLM marker\\n\");\n                return OPJ_FALSE;\n        }\n        /* Do not care of this at the moment since only local variables are set here */\n        /*\n        opj_read_bytes(p_header_data,&l_Zplm,1);                                        // Zplm\n        ++p_header_data;\n        --p_header_size;\n\n        while\n                (p_header_size > 0)\n        {\n                opj_read_bytes(p_header_data,&l_Nplm,1);                                // Nplm\n                ++p_header_data;\n                p_header_size -= (1+l_Nplm);\n                if\n                        (p_header_size < 0)\n                {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Error reading PLM marker\\n\");\n                        return false;\n                }\n                for\n                        (i = 0; i < l_Nplm; ++i)\n                {\n                        opj_read_bytes(p_header_data,&l_tmp,1);                         // Iplm_ij\n                        ++p_header_data;\n                        // take only the last seven bytes\n                        l_packet_len |= (l_tmp & 0x7f);\n                        if\n                                (l_tmp & 0x80)\n                        {\n                                l_packet_len <<= 7;\n                        }\n                        else\n                        {\n                // store packet length and proceed to next packet\n                                l_packet_len = 0;\n                        }\n                }\n                if\n                        (l_packet_len != 0)\n                {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Error reading PLM marker\\n\");\n                        return false;\n                }\n        }\n        */\n        return OPJ_TRUE;\n}\n\n/**\n * Reads a PLT marker (Packet length, tile-part header)\n *\n * @param       p_header_data   the data contained in the PLT box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the PLT marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_plt (  opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager\n                                    )\n{\n        OPJ_UINT32 l_Zplt, l_tmp, l_packet_len = 0, i;\n\n        /* preconditions */\n        assert(p_header_data != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        if (p_header_size < 1) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading PLT marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        opj_read_bytes(p_header_data,&l_Zplt,1);                /* Zplt */\n        ++p_header_data;\n        --p_header_size;\n\n        for (i = 0; i < p_header_size; ++i) {\n                opj_read_bytes(p_header_data,&l_tmp,1);         /* Iplt_ij */\n                ++p_header_data;\n                /* take only the last seven bytes */\n                l_packet_len |= (l_tmp & 0x7f);\n                if (l_tmp & 0x80) {\n                        l_packet_len <<= 7;\n                }\n                else {\n            /* store packet length and proceed to next packet */\n                        l_packet_len = 0;\n                }\n        }\n\n        if (l_packet_len != 0) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading PLT marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\n#if 0\nOPJ_BOOL j2k_read_ppm_v2 (\n                                                opj_j2k_t *p_j2k,\n                                                OPJ_BYTE * p_header_data,\n                                                OPJ_UINT32 p_header_size,\n                                                struct opj_event_mgr * p_manager\n                                        )\n{\n\n        opj_cp_t *l_cp = 00;\n        OPJ_UINT32 l_remaining_data, l_Z_ppm, l_N_ppm;\n\n        /* preconditions */\n        assert(p_header_data != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        if (p_header_size < 1) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading PPM marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        l_cp = &(p_j2k->m_cp);\n        l_cp->ppm = 1;\n\n        opj_read_bytes(p_header_data,&l_Z_ppm,1);               /* Z_ppm */\n        ++p_header_data;\n        --p_header_size;\n\n        /* First PPM marker */\n        if (l_Z_ppm == 0) {\n                if (p_header_size < 4) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Error reading PPM marker\\n\");\n                        return OPJ_FALSE;\n                }\n\n                opj_read_bytes(p_header_data,&l_N_ppm,4);               /* N_ppm */\n                p_header_data+=4;\n                p_header_size-=4;\n\n                /* First PPM marker: Initialization */\n                l_cp->ppm_len = l_N_ppm;\n                l_cp->ppm_data_size = 0;\n\n                l_cp->ppm_buffer = (OPJ_BYTE *) opj_malloc(l_cp->ppm_len);\n                if (l_cp->ppm_buffer == 00) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory reading ppm marker\\n\");\n                        return OPJ_FALSE;\n                }\n                memset(l_cp->ppm_buffer,0,l_cp->ppm_len);\n\n                l_cp->ppm_data = l_cp->ppm_buffer;\n        }\n\n        while (1) {\n                if (l_cp->ppm_data_size == l_cp->ppm_len) {\n                        if (p_header_size >= 4) {\n                                /* read a N_ppm */\n                                opj_read_bytes(p_header_data,&l_N_ppm,4);               /* N_ppm */\n                                p_header_data+=4;\n                                p_header_size-=4;\n                                l_cp->ppm_len += l_N_ppm ;\n\n                                OPJ_BYTE *new_ppm_buffer = (OPJ_BYTE *) opj_realloc(l_cp->ppm_buffer, l_cp->ppm_len);\n                                if (! new_ppm_buffer) {\n                                        opj_free(l_cp->ppm_buffer);\n                                        l_cp->ppm_buffer = NULL;\n                                        l_cp->ppm_len = 0;\n                                        l_cp->ppm_data = NULL;\n                                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory reading ppm marker\\n\");\n                                        return OPJ_FALSE;\n                                }\n                                l_cp->ppm_buffer = new_ppm_buffer;\n                                memset(l_cp->ppm_buffer+l_cp->ppm_data_size,0,l_N_ppm);\n                                l_cp->ppm_data = l_cp->ppm_buffer;\n                        }\n                        else {\n                                return OPJ_FALSE;\n                        }\n                }\n\n                l_remaining_data = l_cp->ppm_len - l_cp->ppm_data_size;\n\n                if (l_remaining_data <= p_header_size) {\n                        /* we must store less information than available in the packet */\n                        memcpy(l_cp->ppm_buffer + l_cp->ppm_data_size , p_header_data , l_remaining_data);\n                        l_cp->ppm_data_size = l_cp->ppm_len;\n                        p_header_size -= l_remaining_data;\n                        p_header_data += l_remaining_data;\n                }\n                else {\n                        memcpy(l_cp->ppm_buffer + l_cp->ppm_data_size , p_header_data , p_header_size);\n                        l_cp->ppm_data_size += p_header_size;\n                        p_header_data += p_header_size;\n                        p_header_size = 0;\n                        break;\n                }\n        }\n\n        return OPJ_TRUE;\n}\n#endif\n\nOPJ_BOOL j2k_read_ppm_v3 (\n                                                opj_j2k_t *p_j2k,\n                                                OPJ_BYTE * p_header_data,\n                                                OPJ_UINT32 p_header_size,\n                                                struct opj_event_mgr * p_manager\n                                        )\n{\n        opj_cp_t *l_cp = 00;\n        OPJ_UINT32 l_remaining_data, l_Z_ppm, l_N_ppm;\n\n        /* preconditions */\n        assert(p_header_data != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        /* Minimum size of PPM marker is equal to the size of Zppm element */\n        if (p_header_size < 1) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading PPM marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        l_cp = &(p_j2k->m_cp);\n        l_cp->ppm = 1;\n\n        opj_read_bytes(p_header_data,&l_Z_ppm,1);               /* Z_ppm */\n        ++p_header_data;\n        --p_header_size;\n\n        /* First PPM marker */\n        if (l_Z_ppm == 0) {\n                /* We need now at least the Nppm^0 element */\n                if (p_header_size < 4) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Error reading PPM marker\\n\");\n                        return OPJ_FALSE;\n                }\n\n                opj_read_bytes(p_header_data,&l_N_ppm,4);               /* First N_ppm */\n                p_header_data+=4;\n                p_header_size-=4;\n\n                /* sanity check: how much bytes is left for Ippm */\n                if( p_header_size < l_N_ppm )\n                  {\n                  opj_event_msg(p_manager, EVT_ERROR, \"Not enough bytes (%u) to hold Ippm series (%u), Index (%d)\\n\", p_header_size, l_N_ppm, l_Z_ppm );\n                  opj_free(l_cp->ppm_data);\n                  l_cp->ppm_data = NULL;\n                  l_cp->ppm_buffer = NULL;\n                  l_cp->ppm = 0; /* do not use PPM */\n                  return OPJ_FALSE;\n                  }\n\n                /* First PPM marker: Initialization */\n                l_cp->ppm_len = l_N_ppm;\n                l_cp->ppm_data_read = 0;\n\n                l_cp->ppm_data = (OPJ_BYTE *) opj_malloc(l_cp->ppm_len);\n                l_cp->ppm_buffer = l_cp->ppm_data;\n                if (l_cp->ppm_data == 00) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to read ppm marker\\n\");\n                        return OPJ_FALSE;\n                }\n                memset(l_cp->ppm_data,0,l_cp->ppm_len);\n\n                l_cp->ppm_data_current = l_cp->ppm_data;\n\n                /*l_cp->ppm_data = l_cp->ppm_buffer;*/\n        }\n        else {\n                if (p_header_size < 4) {\n                        opj_event_msg(p_manager, EVT_WARNING, \"Empty PPM marker\\n\");\n                        return OPJ_TRUE;\n                }\n                else {\n                        /* Uncompleted Ippm series in the previous PPM marker?*/\n                        if (l_cp->ppm_data_read < l_cp->ppm_len) {\n                                /* Get the place where add the remaining Ippm series*/\n                                l_cp->ppm_data_current = &(l_cp->ppm_data[l_cp->ppm_data_read]);\n                                l_N_ppm = l_cp->ppm_len - l_cp->ppm_data_read;\n                        }\n                        else {\n                                OPJ_BYTE *new_ppm_data;\n                                opj_read_bytes(p_header_data,&l_N_ppm,4);               /* First N_ppm */\n                                p_header_data+=4;\n                                p_header_size-=4;\n\n                                /* sanity check: how much bytes is left for Ippm */\n                                if( p_header_size < l_N_ppm )\n                                  {\n                                  opj_event_msg(p_manager, EVT_ERROR, \"Not enough bytes (%u) to hold Ippm series (%u), Index (%d)\\n\", p_header_size, l_N_ppm, l_Z_ppm );\n                                  opj_free(l_cp->ppm_data);\n                                  l_cp->ppm_data = NULL;\n                                  l_cp->ppm_buffer = NULL;\n                                  l_cp->ppm = 0; /* do not use PPM */\n                                  return OPJ_FALSE;\n                                  }\n                                /* Increase the size of ppm_data to add the new Ippm series*/\n                                assert(l_cp->ppm_data == l_cp->ppm_buffer && \"We need ppm_data and ppm_buffer to be the same when reallocating\");\n                                new_ppm_data = (OPJ_BYTE *) opj_realloc(l_cp->ppm_data, l_cp->ppm_len + l_N_ppm);\n                                if (! new_ppm_data) {\n                                        opj_free(l_cp->ppm_data);\n                                        l_cp->ppm_data = NULL;\n                                        l_cp->ppm_buffer = NULL;  /* TODO: no need for a new local variable: ppm_buffer and ppm_data are enough */\n                                        l_cp->ppm_len = 0;\n                                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to increase the size of ppm_data to add the new Ippm series\\n\");\n                                        return OPJ_FALSE;\n                                }\n                                l_cp->ppm_data = new_ppm_data;\n                                l_cp->ppm_buffer = l_cp->ppm_data;\n\n                                /* Keep the position of the place where concatenate the new series*/\n                                l_cp->ppm_data_current = &(l_cp->ppm_data[l_cp->ppm_len]);\n                                l_cp->ppm_len += l_N_ppm;\n                        }\n                }\n        }\n\n        l_remaining_data = p_header_size;\n\n        while (l_remaining_data >= l_N_ppm) {\n                /* read a complete Ippm series*/\n                memcpy(l_cp->ppm_data_current, p_header_data, l_N_ppm);\n                p_header_size -= l_N_ppm;\n                p_header_data += l_N_ppm;\n\n                l_cp->ppm_data_read += l_N_ppm; /* Increase the number of data read*/\n\n                /* cf. https://code.google.com/p/openjpeg/issues/detail?id=362 */\n                if (p_header_size >= 4)\n                {\n                        opj_read_bytes(p_header_data,&l_N_ppm,4);               /* N_ppm^i */\n                        p_header_data+=4;\n                        p_header_size-=4;\n                }\n                else {\n                        l_remaining_data = p_header_size;\n                        break;\n                }\n\n                l_remaining_data = p_header_size;\n\n                /* Next Ippm series is a complete series ?*/\n                if (l_remaining_data >= l_N_ppm) {\n                        OPJ_BYTE *new_ppm_data;\n                        /* Increase the size of ppm_data to add the new Ippm series*/\n                        assert(l_cp->ppm_data == l_cp->ppm_buffer && \"We need ppm_data and ppm_buffer to be the same when reallocating\");\n                        new_ppm_data = (OPJ_BYTE *) opj_realloc(l_cp->ppm_data, l_cp->ppm_len + l_N_ppm);\n                        if (! new_ppm_data) {\n                                opj_free(l_cp->ppm_data);\n                                l_cp->ppm_data = NULL;\n                                l_cp->ppm_buffer = NULL;  /* TODO: no need for a new local variable: ppm_buffer and ppm_data are enough */\n                                l_cp->ppm_len = 0;\n                                opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to increase the size of ppm_data to add the new (complete) Ippm series\\n\");\n                                return OPJ_FALSE;\n                        }\n                        l_cp->ppm_data = new_ppm_data;\n                        l_cp->ppm_buffer = l_cp->ppm_data;\n\n                        /* Keep the position of the place where concatenate the new series */\n                        l_cp->ppm_data_current = &(l_cp->ppm_data[l_cp->ppm_len]);\n                        l_cp->ppm_len += l_N_ppm;\n                }\n\n        }\n\n        /* Need to read an incomplete Ippm series*/\n        if (l_remaining_data) {\n                OPJ_BYTE *new_ppm_data;\n                assert(l_cp->ppm_data == l_cp->ppm_buffer && \"We need ppm_data and ppm_buffer to be the same when reallocating\");\n                /* cf. https://code.google.com/p/openjpeg/issues/detail?id=362 */\n                new_ppm_data = (OPJ_BYTE *) opj_realloc(l_cp->ppm_data, l_cp->ppm_len + l_remaining_data);\n                if (! new_ppm_data) {\n                        opj_free(l_cp->ppm_data);\n                        l_cp->ppm_data = NULL;\n                        l_cp->ppm_buffer = NULL;  /* TODO: no need for a new local variable: ppm_buffer and ppm_data are enough */\n                        l_cp->ppm_len = 0;\n                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to increase the size of ppm_data to add the new (incomplete) Ippm series\\n\");\n                        return OPJ_FALSE;\n                }\n                l_cp->ppm_data = new_ppm_data;\n                l_cp->ppm_buffer = l_cp->ppm_data;\n\n                /* Keep the position of the place where concatenate the new series*/\n                l_cp->ppm_data_current = &(l_cp->ppm_data[l_cp->ppm_len]);\n                l_cp->ppm_len += l_N_ppm;\n\n                /* Read incomplete Ippm series*/\n                memcpy(l_cp->ppm_data_current, p_header_data, l_remaining_data);\n                p_header_size -= l_remaining_data;\n                p_header_data += l_remaining_data;\n\n                l_cp->ppm_data_read += l_remaining_data; /* Increase the number of data read*/\n        }\n\n#ifdef CLEAN_MSD\n\n                if (l_cp->ppm_data_size == l_cp->ppm_len) {\n                        if (p_header_size >= 4) {\n                                /* read a N_ppm*/\n                                opj_read_bytes(p_header_data,&l_N_ppm,4);               /* N_ppm */\n                                p_header_data+=4;\n                                p_header_size-=4;\n                                l_cp->ppm_len += l_N_ppm ;\n\n                                OPJ_BYTE *new_ppm_buffer = (OPJ_BYTE *) opj_realloc(l_cp->ppm_buffer, l_cp->ppm_len);\n                                if (! new_ppm_buffer) {\n                                        opj_free(l_cp->ppm_buffer);\n                                        l_cp->ppm_buffer = NULL;\n                                        l_cp->ppm_len = 0;\n                                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to read ppm marker\\n\");\n                                        return OPJ_FALSE;\n                                }\n                                l_cp->ppm_buffer = new_ppm_buffer;\n                                memset(l_cp->ppm_buffer+l_cp->ppm_data_size,0,l_N_ppm);\n\n                                l_cp->ppm_data = l_cp->ppm_buffer;\n                        }\n                        else {\n                                return OPJ_FALSE;\n                        }\n                }\n\n                l_remaining_data = l_cp->ppm_len - l_cp->ppm_data_size;\n\n                if (l_remaining_data <= p_header_size) {\n                        /* we must store less information than available in the packet */\n                        memcpy(l_cp->ppm_buffer + l_cp->ppm_data_size , p_header_data , l_remaining_data);\n                        l_cp->ppm_data_size = l_cp->ppm_len;\n                        p_header_size -= l_remaining_data;\n                        p_header_data += l_remaining_data;\n                }\n                else {\n                        memcpy(l_cp->ppm_buffer + l_cp->ppm_data_size , p_header_data , p_header_size);\n                        l_cp->ppm_data_size += p_header_size;\n                        p_header_data += p_header_size;\n                        p_header_size = 0;\n                        break;\n                }\n        }\n#endif\n        return OPJ_TRUE;\n}\n\n/**\n * Reads a PPT marker (Packed packet headers, tile-part header)\n *\n * @param       p_header_data   the data contained in the PPT box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the PPT marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_ppt (  opj_j2k_t *p_j2k,\n                                    OPJ_BYTE * p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager\n                                    )\n{\n        opj_cp_t *l_cp = 00;\n        opj_tcp_t *l_tcp = 00;\n        OPJ_UINT32 l_Z_ppt;\n\n        /* preconditions */\n        assert(p_header_data != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        /* We need to have the Z_ppt element at minimum */\n        if (p_header_size < 1) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading PPT marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        l_cp = &(p_j2k->m_cp);\n        if (l_cp->ppm){\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading PPT marker: packet header have been previously found in the main header (PPM marker).\\n\");\n                return OPJ_FALSE;\n        }\n\n        l_tcp = &(l_cp->tcps[p_j2k->m_current_tile_number]);\n        l_tcp->ppt = 1;\n\n        opj_read_bytes(p_header_data,&l_Z_ppt,1);               /* Z_ppt */\n        ++p_header_data;\n        --p_header_size;\n\n        /* Allocate buffer to read the packet header */\n        if (l_Z_ppt == 0) {\n                /* First PPT marker */\n                l_tcp->ppt_data_size = 0;\n                l_tcp->ppt_len = p_header_size;\n\n                opj_free(l_tcp->ppt_buffer);\n                l_tcp->ppt_buffer = (OPJ_BYTE *) opj_calloc(l_tcp->ppt_len, sizeof(OPJ_BYTE) );\n                if (l_tcp->ppt_buffer == 00) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to read PPT marker\\n\");\n                        return OPJ_FALSE;\n                }\n                l_tcp->ppt_data = l_tcp->ppt_buffer;\n\n                /* memset(l_tcp->ppt_buffer,0,l_tcp->ppt_len); */\n        }\n        else {\n                OPJ_BYTE *new_ppt_buffer;\n                l_tcp->ppt_len += p_header_size;\n\n                new_ppt_buffer = (OPJ_BYTE *) opj_realloc(l_tcp->ppt_buffer, l_tcp->ppt_len);\n                if (! new_ppt_buffer) {\n                        opj_free(l_tcp->ppt_buffer);\n                        l_tcp->ppt_buffer = NULL;\n                        l_tcp->ppt_len = 0;\n                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to read PPT marker\\n\");\n                        return OPJ_FALSE;\n                }\n                l_tcp->ppt_buffer = new_ppt_buffer;\n                l_tcp->ppt_data = l_tcp->ppt_buffer;\n\n                memset(l_tcp->ppt_buffer+l_tcp->ppt_data_size,0,p_header_size);\n        }\n\n        /* Read packet header from buffer */\n        memcpy(l_tcp->ppt_buffer+l_tcp->ppt_data_size,p_header_data,p_header_size);\n\n        l_tcp->ppt_data_size += p_header_size;\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_write_tlm(     opj_j2k_t *p_j2k,\n                                                        opj_stream_private_t *p_stream,\n                                                        opj_event_mgr_t * p_manager\n                            )\n{\n        OPJ_BYTE * l_current_data = 00;\n        OPJ_UINT32 l_tlm_size;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        l_tlm_size = 6 + (5*p_j2k->m_specific_param.m_encoder.m_total_tile_parts);\n\n        if (l_tlm_size > p_j2k->m_specific_param.m_encoder.m_header_tile_data_size) {\n                OPJ_BYTE *new_header_tile_data = (OPJ_BYTE *) opj_realloc(p_j2k->m_specific_param.m_encoder.m_header_tile_data, l_tlm_size);\n                if (! new_header_tile_data) {\n                        opj_free(p_j2k->m_specific_param.m_encoder.m_header_tile_data);\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data = NULL;\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = 0;\n                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to write TLM marker\\n\");\n                        return OPJ_FALSE;\n                }\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data = new_header_tile_data;\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = l_tlm_size;\n        }\n\n        l_current_data = p_j2k->m_specific_param.m_encoder.m_header_tile_data;\n\n        /* change the way data is written to avoid seeking if possible */\n        /* TODO */\n        p_j2k->m_specific_param.m_encoder.m_tlm_start = opj_stream_tell(p_stream);\n\n        opj_write_bytes(l_current_data,J2K_MS_TLM,2);                                   /* TLM */\n        l_current_data += 2;\n\n        opj_write_bytes(l_current_data,l_tlm_size-2,2);                                 /* Lpoc */\n        l_current_data += 2;\n\n        opj_write_bytes(l_current_data,0,1);                                                    /* Ztlm=0*/\n        ++l_current_data;\n\n        opj_write_bytes(l_current_data,0x50,1);                                                 /* Stlm ST=1(8bits-255 tiles max),SP=1(Ptlm=32bits) */\n        ++l_current_data;\n\n        /* do nothing on the 5 * l_j2k->m_specific_param.m_encoder.m_total_tile_parts remaining data */\n        if (opj_stream_write_data(p_stream,p_j2k->m_specific_param.m_encoder.m_header_tile_data,l_tlm_size,p_manager) != l_tlm_size) {\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_write_sot(     opj_j2k_t *p_j2k,\n                                                        OPJ_BYTE * p_data,\n                                                        OPJ_UINT32 * p_data_written,\n                                                        const opj_stream_private_t *p_stream,\n                                                        opj_event_mgr_t * p_manager\n                            )\n{\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        opj_write_bytes(p_data,J2K_MS_SOT,2);                                   /* SOT */\n        p_data += 2;\n\n        opj_write_bytes(p_data,10,2);                                                   /* Lsot */\n        p_data += 2;\n\n        opj_write_bytes(p_data, p_j2k->m_current_tile_number,2);                        /* Isot */\n        p_data += 2;\n\n        /* Psot  */\n        p_data += 4;\n\n        opj_write_bytes(p_data, p_j2k->m_specific_param.m_encoder.m_current_tile_part_number,1);                        /* TPsot */\n        ++p_data;\n\n        opj_write_bytes(p_data, p_j2k->m_cp.tcps[p_j2k->m_current_tile_number].m_nb_tile_parts,1);                      /* TNsot */\n        ++p_data;\n\n        /* UniPG>> */\n#ifdef USE_JPWL\n        /* update markers struct */\n/*\n        OPJ_BOOL res = j2k_add_marker(p_j2k->cstr_info, J2K_MS_SOT, p_j2k->sot_start, len + 2);\n*/\n  assert( 0 && \"TODO\" );\n#endif /* USE_JPWL */\n\n        * p_data_written = 12;\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_read_sot ( opj_j2k_t *p_j2k,\n                            OPJ_BYTE * p_header_data,\n                            OPJ_UINT32 p_header_size,\n                            opj_event_mgr_t * p_manager )\n{\n        opj_cp_t *l_cp = 00;\n        opj_tcp_t *l_tcp = 00;\n        OPJ_UINT32 l_tot_len, l_num_parts = 0;\n        OPJ_UINT32 l_current_part;\n        OPJ_UINT32 l_tile_x,l_tile_y;\n\n        /* preconditions */\n        assert(p_header_data != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        /* Size of this marker is fixed = 12 (we have already read marker and its size)*/\n        if (p_header_size != 8) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading SOT marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        l_cp = &(p_j2k->m_cp);\n        opj_read_bytes(p_header_data,&(p_j2k->m_current_tile_number),2);                /* Isot */\n        p_header_data+=2;\n\n        /* testcase 2.pdf.SIGFPE.706.1112 */\n        if (p_j2k->m_current_tile_number >= l_cp->tw * l_cp->th) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Invalid tile number %d\\n\", p_j2k->m_current_tile_number);\n                return OPJ_FALSE;\n        }\n\n        l_tcp = &l_cp->tcps[p_j2k->m_current_tile_number];\n        l_tile_x = p_j2k->m_current_tile_number % l_cp->tw;\n        l_tile_y = p_j2k->m_current_tile_number / l_cp->tw;\n\n#ifdef USE_JPWL\n        if (l_cp->correct) {\n\n                OPJ_UINT32 tileno = p_j2k->m_current_tile_number;\n                static OPJ_UINT32 backup_tileno = 0;\n\n                /* tileno is negative or larger than the number of tiles!!! */\n                if (tileno > (l_cp->tw * l_cp->th)) {\n                        opj_event_msg(p_manager, EVT_ERROR,\n                                        \"JPWL: bad tile number (%d out of a maximum of %d)\\n\",\n                                        tileno, (l_cp->tw * l_cp->th));\n                        if (!JPWL_ASSUME) {\n                                opj_event_msg(p_manager, EVT_ERROR, \"JPWL: giving up\\n\");\n                                return OPJ_FALSE;\n                        }\n                        /* we try to correct */\n                        tileno = backup_tileno;\n                        opj_event_msg(p_manager, EVT_WARNING, \"- trying to adjust this\\n\"\n                                        \"- setting tile number to %d\\n\",\n                                        tileno);\n                }\n\n                /* keep your private count of tiles */\n                backup_tileno++;\n        };\n#endif /* USE_JPWL */\n\n        /* look for the tile in the list of already processed tile (in parts). */\n        /* Optimization possible here with a more complex data structure and with the removing of tiles */\n        /* since the time taken by this function can only grow at the time */\n\n        opj_read_bytes(p_header_data,&l_tot_len,4);             /* Psot */\n        p_header_data+=4;\n\n        /* PSot should be equal to zero or >=14 or <= 2^32-1 */\n        if ((l_tot_len !=0 ) && (l_tot_len < 14) )\n        {\n            if (l_tot_len == 12 ) /* MSD: Special case for the PHR data which are read by kakadu*/\n            {\n                opj_event_msg(p_manager, EVT_WARNING, \"Empty SOT marker detected: Psot=%d.\\n\", l_tot_len);\n            }\n            else\n            {\n                opj_event_msg(p_manager, EVT_ERROR, \"Psot value is not correct regards to the JPEG2000 norm: %d.\\n\", l_tot_len);\n                return OPJ_FALSE;\n            }\n        }\n\n#ifdef USE_JPWL\n        if (l_cp->correct) {\n\n                /* totlen is negative or larger than the bytes left!!! */\n                if (/*(l_tot_len < 0) ||*/ (l_tot_len > p_header_size ) ) { /* FIXME it seems correct; for info in V1 -> (p_stream_numbytesleft(p_stream) + 8))) { */\n                        opj_event_msg(p_manager, EVT_ERROR,\n                                        \"JPWL: bad tile byte size (%d bytes against %d bytes left)\\n\",\n                                        l_tot_len, p_header_size ); /* FIXME it seems correct; for info in V1 -> p_stream_numbytesleft(p_stream) + 8); */\n                        if (!JPWL_ASSUME) {\n                                opj_event_msg(p_manager, EVT_ERROR, \"JPWL: giving up\\n\");\n                                return OPJ_FALSE;\n                        }\n                        /* we try to correct */\n                        l_tot_len = 0;\n                        opj_event_msg(p_manager, EVT_WARNING, \"- trying to adjust this\\n\"\n                                        \"- setting Psot to %d => assuming it is the last tile\\n\",\n                                        l_tot_len);\n                }\n                };\n#endif /* USE_JPWL */\n\n                /* Ref A.4.2: Psot could be equal zero if it is the last tile-part of the codestream.*/\n                if (!l_tot_len) {\n                        opj_event_msg(p_manager, EVT_INFO, \"Psot value of the current tile-part is equal to zero, \"\n                                        \"we assuming it is the last tile-part of the codestream.\\n\");\n                        p_j2k->m_specific_param.m_decoder.m_last_tile_part = 1;\n                }\n\n                opj_read_bytes(p_header_data,&l_current_part ,1);       /* TPsot */\n                ++p_header_data;\n\n                opj_read_bytes(p_header_data,&l_num_parts ,1);          /* TNsot */\n                ++p_header_data;\n\n                if (l_num_parts != 0) { /* Number of tile-part header is provided by this tile-part header */\n                        /* Useful to manage the case of textGBR.jp2 file because two values of TNSot are allowed: the correct numbers of\n                         * tile-parts for that tile and zero (A.4.2 of 15444-1 : 2002). */\n                        if (l_tcp->m_nb_tile_parts) {\n                                if (l_current_part >= l_tcp->m_nb_tile_parts){\n                                        opj_event_msg(p_manager, EVT_ERROR, \"In SOT marker, TPSot (%d) is not valid regards to the current \"\n                                                        \"number of tile-part (%d), giving up\\n\", l_current_part, l_tcp->m_nb_tile_parts );\n                                        p_j2k->m_specific_param.m_decoder.m_last_tile_part = 1;\n                                        return OPJ_FALSE;\n                                }\n                        }\n                        /* cf. https://code.google.com/p/openjpeg/issues/detail?id=254 */\n                        if (++l_num_parts < l_tcp->m_nb_tile_parts) {\n                                l_num_parts = l_tcp->m_nb_tile_parts;\n                        }\n                        if( l_current_part >= l_num_parts ) {\n                          /* testcase 451.pdf.SIGSEGV.ce9.3723 */\n                          opj_event_msg(p_manager, EVT_ERROR, \"In SOT marker, TPSot (%d) is not valid regards to the current \"\n                            \"number of tile-part (header) (%d), giving up\\n\", l_current_part, l_num_parts );\n                          p_j2k->m_specific_param.m_decoder.m_last_tile_part = 1;\n                          return OPJ_FALSE;\n                        }\n                        l_tcp->m_nb_tile_parts = l_num_parts;\n                }\n\n                /* If know the number of tile part header we will check if we didn't read the last*/\n                if (l_tcp->m_nb_tile_parts) {\n                        if (l_tcp->m_nb_tile_parts == (l_current_part+1)) {\n                                p_j2k->m_specific_param.m_decoder.m_can_decode = 1; /* Process the last tile-part header*/\n                        }\n                }\n\n                if (!p_j2k->m_specific_param.m_decoder.m_last_tile_part){\n                        /* Keep the size of data to skip after this marker */\n                        p_j2k->m_specific_param.m_decoder.m_sot_length = l_tot_len - 12; /* SOT_marker_size = 12 */\n                }\n                else {\n                        /* FIXME: need to be computed from the number of bytes remaining in the codestream */\n                        p_j2k->m_specific_param.m_decoder.m_sot_length = 0;\n                }\n\n                p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_TPH;\n\n                /* Check if the current tile is outside the area we want decode or not corresponding to the tile index*/\n                if (p_j2k->m_specific_param.m_decoder.m_tile_ind_to_dec == -1) {\n                        p_j2k->m_specific_param.m_decoder.m_skip_data =\n                                (l_tile_x < p_j2k->m_specific_param.m_decoder.m_start_tile_x)\n                                ||      (l_tile_x >= p_j2k->m_specific_param.m_decoder.m_end_tile_x)\n                                ||  (l_tile_y < p_j2k->m_specific_param.m_decoder.m_start_tile_y)\n                                ||      (l_tile_y >= p_j2k->m_specific_param.m_decoder.m_end_tile_y);\n                }\n                else {\n                        assert( p_j2k->m_specific_param.m_decoder.m_tile_ind_to_dec >= 0 );\n                        p_j2k->m_specific_param.m_decoder.m_skip_data =\n                                (p_j2k->m_current_tile_number != (OPJ_UINT32)p_j2k->m_specific_param.m_decoder.m_tile_ind_to_dec);\n                }\n\n                /* Index */\n                if (p_j2k->cstr_index)\n                {\n                        assert(p_j2k->cstr_index->tile_index != 00);\n                        p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tileno = p_j2k->m_current_tile_number;\n                        p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].current_tpsno = l_current_part;\n\n                        if (l_num_parts != 0){\n                                p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].nb_tps = l_num_parts;\n                                p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].current_nb_tps = l_num_parts;\n\n                                if (!p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index) {\n                                        p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index =\n                                                (opj_tp_index_t*)opj_calloc(l_num_parts, sizeof(opj_tp_index_t));\n                                }\n                                else {\n                                        opj_tp_index_t *new_tp_index = (opj_tp_index_t *) opj_realloc(\n                                                        p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index, l_num_parts* sizeof(opj_tp_index_t));\n                                        if (! new_tp_index) {\n                                                opj_free(p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index);\n                                                p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index = NULL;\n                                                opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to read PPT marker\\n\");\n                                                return OPJ_FALSE;\n                                        }\n                                        p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index = new_tp_index;\n                                }\n                        }\n                        else{\n                                /*if (!p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index)*/ {\n\n                                        if (!p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index) {\n                                                p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].current_nb_tps = 10;\n                                                p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index =\n                                                        (opj_tp_index_t*)opj_calloc( p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].current_nb_tps,\n                                                                        sizeof(opj_tp_index_t));\n                                        }\n\n                                        if ( l_current_part >= p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].current_nb_tps ){\n                                                opj_tp_index_t *new_tp_index;\n                                                p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].current_nb_tps = l_current_part + 1;\n                                                new_tp_index = (opj_tp_index_t *) opj_realloc(\n                                                                p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index,\n                                                                p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].current_nb_tps * sizeof(opj_tp_index_t));\n                                                if (! new_tp_index) {\n                                                        opj_free(p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index);\n                                                        p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index = NULL;\n                                                        p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].current_nb_tps = 0;\n                                                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to read PPT marker\\n\");\n                                                        return OPJ_FALSE;\n                                                }\n                                                p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index = new_tp_index;\n                                        }\n                                }\n\n                        }\n\n                }\n\n                /* FIXME move this onto a separate method to call before reading any SOT, remove part about main_end header, use a index struct inside p_j2k */\n                /* if (p_j2k->cstr_info) {\n                   if (l_tcp->first) {\n                   if (tileno == 0) {\n                   p_j2k->cstr_info->main_head_end = p_stream_tell(p_stream) - 13;\n                   }\n\n                   p_j2k->cstr_info->tile[tileno].tileno = tileno;\n                   p_j2k->cstr_info->tile[tileno].start_pos = p_stream_tell(p_stream) - 12;\n                   p_j2k->cstr_info->tile[tileno].end_pos = p_j2k->cstr_info->tile[tileno].start_pos + totlen - 1;\n                   p_j2k->cstr_info->tile[tileno].num_tps = numparts;\n\n                   if (numparts) {\n                   p_j2k->cstr_info->tile[tileno].tp = (opj_tp_info_t *) opj_malloc(numparts * sizeof(opj_tp_info_t));\n                   }\n                   else {\n                   p_j2k->cstr_info->tile[tileno].tp = (opj_tp_info_t *) opj_malloc(10 * sizeof(opj_tp_info_t)); // Fixme (10)\n                   }\n                   }\n                   else {\n                   p_j2k->cstr_info->tile[tileno].end_pos += totlen;\n                   }\n\n                   p_j2k->cstr_info->tile[tileno].tp[partno].tp_start_pos = p_stream_tell(p_stream) - 12;\n                   p_j2k->cstr_info->tile[tileno].tp[partno].tp_end_pos =\n                   p_j2k->cstr_info->tile[tileno].tp[partno].tp_start_pos + totlen - 1;\n                   }*/\n                return OPJ_TRUE;\n        }\n\nOPJ_BOOL opj_j2k_write_sod(     opj_j2k_t *p_j2k,\n                                                        opj_tcd_t * p_tile_coder,\n                                                        OPJ_BYTE * p_data,\n                                                        OPJ_UINT32 * p_data_written,\n                                                        OPJ_UINT32 p_total_data_size,\n                                                        const opj_stream_private_t *p_stream,\n                                                        opj_event_mgr_t * p_manager\n                            )\n{\n        opj_codestream_info_t *l_cstr_info = 00;\n        OPJ_UINT32 l_remaining_data;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        opj_write_bytes(p_data,J2K_MS_SOD,2);                                   /* SOD */\n        p_data += 2;\n\n        /* make room for the EOF marker */\n        l_remaining_data =  p_total_data_size - 4;\n\n        /* update tile coder */\n        p_tile_coder->tp_num = p_j2k->m_specific_param.m_encoder.m_current_poc_tile_part_number ;\n        p_tile_coder->cur_tp_num = p_j2k->m_specific_param.m_encoder.m_current_tile_part_number;\n\n         /* INDEX >> */\n        /* TODO mergeV2: check this part which use cstr_info */\n        /*l_cstr_info = p_j2k->cstr_info;\n        if (l_cstr_info) {\n                if (!p_j2k->m_specific_param.m_encoder.m_current_tile_part_number ) {\n                        //TODO cstr_info->tile[p_j2k->m_current_tile_number].end_header = p_stream_tell(p_stream) + p_j2k->pos_correction - 1;\n                        l_cstr_info->tile[p_j2k->m_current_tile_number].tileno = p_j2k->m_current_tile_number;\n                }\n                else {*/\n                        /*\n                        TODO\n                        if\n                                (cstr_info->tile[p_j2k->m_current_tile_number].packet[cstr_info->packno - 1].end_pos < p_stream_tell(p_stream))\n                        {\n                                cstr_info->tile[p_j2k->m_current_tile_number].packet[cstr_info->packno].start_pos = p_stream_tell(p_stream);\n                        }*/\n                /*}*/\n                /* UniPG>> */\n#ifdef USE_JPWL\n                /* update markers struct */\n                /*OPJ_BOOL res = j2k_add_marker(p_j2k->cstr_info, J2K_MS_SOD, p_j2k->sod_start, 2);\n*/\n  assert( 0 && \"TODO\" );\n#endif /* USE_JPWL */\n                /* <<UniPG */\n        /*}*/\n        /* << INDEX */\n\n        if (p_j2k->m_specific_param.m_encoder.m_current_tile_part_number == 0) {\n                p_tile_coder->tcd_image->tiles->packno = 0;\n                if (l_cstr_info) {\n                        l_cstr_info->packno = 0;\n                }\n        }\n\n        *p_data_written = 0;\n\n        if (! opj_tcd_encode_tile(p_tile_coder, p_j2k->m_current_tile_number, p_data, p_data_written, l_remaining_data , l_cstr_info)) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Cannot encode tile\\n\");\n                return OPJ_FALSE;\n        }\n\n        *p_data_written += 2;\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_read_sod (opj_j2k_t *p_j2k,\n                           opj_stream_private_t *p_stream,\n                                                   opj_event_mgr_t * p_manager\n                           )\n{\n        OPJ_SIZE_T l_current_read_size;\n        opj_codestream_index_t * l_cstr_index = 00;\n        OPJ_BYTE ** l_current_data = 00;\n        opj_tcp_t * l_tcp = 00;\n        OPJ_UINT32 * l_tile_len = 00;\n        OPJ_BOOL l_sot_length_pb_detected = OPJ_FALSE;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        l_tcp = &(p_j2k->m_cp.tcps[p_j2k->m_current_tile_number]);\n\n        if (p_j2k->m_specific_param.m_decoder.m_last_tile_part) {\n                /* opj_stream_get_number_byte_left returns OPJ_OFF_T\n                // but we are in the last tile part,\n                // so its result will fit on OPJ_UINT32 unless we find\n                // a file with a single tile part of more than 4 GB...*/\n                p_j2k->m_specific_param.m_decoder.m_sot_length = (OPJ_UINT32)(opj_stream_get_number_byte_left(p_stream) - 2);\n        }\n        else {\n            /* Check to avoid pass the limit of OPJ_UINT32 */\n            if (p_j2k->m_specific_param.m_decoder.m_sot_length >= 2 )\n                p_j2k->m_specific_param.m_decoder.m_sot_length -= 2;\n            else {\n                /* MSD: case commented to support empty SOT marker (PHR data) */\n            }\n        }\n\n        l_current_data = &(l_tcp->m_data);\n        l_tile_len = &l_tcp->m_data_size;\n\n        /* Patch to support new PHR data */\n        if (p_j2k->m_specific_param.m_decoder.m_sot_length) {\n            /* cf. https://code.google.com/p/openjpeg/issues/detail?id=348 */\n            if (p_j2k->m_specific_param.m_decoder.m_sot_length > opj_stream_get_number_byte_left(p_stream)) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Not enough data to decode tile\\n\");\n                return OPJ_FALSE;\n            }\n\n            if (! *l_current_data) {\n                /* LH: oddly enough, in this path, l_tile_len!=0.\n                 * TODO: If this was consistant, we could simplify the code to only use realloc(), as realloc(0,...) default to malloc(0,...).\n                 */\n                *l_current_data = (OPJ_BYTE*) opj_malloc(p_j2k->m_specific_param.m_decoder.m_sot_length);\n            }\n            else {\n                OPJ_BYTE *l_new_current_data = (OPJ_BYTE *) opj_realloc(*l_current_data, *l_tile_len + p_j2k->m_specific_param.m_decoder.m_sot_length);\n                if (! l_new_current_data) {\n                        opj_free(*l_current_data);\n                        /*nothing more is done as l_current_data will be set to null, and just\n                          afterward we enter in the error path\n                          and the actual tile_len is updated (committed) at the end of the\n                          function. */\n                }\n                *l_current_data = l_new_current_data;\n            }\n            \n            if (*l_current_data == 00) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to decode tile\\n\");\n                return OPJ_FALSE;\n            }\n        }\n        else {\n            l_sot_length_pb_detected = OPJ_TRUE;\n        }\n\n        /* Index */\n        l_cstr_index = p_j2k->cstr_index;\n        if (l_cstr_index) {\n                OPJ_OFF_T l_current_pos = opj_stream_tell(p_stream) - 2;\n\n                OPJ_UINT32 l_current_tile_part = l_cstr_index->tile_index[p_j2k->m_current_tile_number].current_tpsno;\n                l_cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index[l_current_tile_part].end_header =\n                                l_current_pos;\n                l_cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index[l_current_tile_part].end_pos =\n                                l_current_pos + p_j2k->m_specific_param.m_decoder.m_sot_length + 2;\n\n                if (OPJ_FALSE == opj_j2k_add_tlmarker(p_j2k->m_current_tile_number,\n                                        l_cstr_index,\n                                        J2K_MS_SOD,\n                                        l_current_pos,\n                                        p_j2k->m_specific_param.m_decoder.m_sot_length + 2)) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to add tl marker\\n\");\n                        return OPJ_FALSE;\n                }\n\n                /*l_cstr_index->packno = 0;*/\n        }\n\n        /* Patch to support new PHR data */\n        if (!l_sot_length_pb_detected) {\n            l_current_read_size = opj_stream_read_data(\n                        p_stream,\n                        *l_current_data + *l_tile_len,\n                        p_j2k->m_specific_param.m_decoder.m_sot_length,\n                        p_manager);\n        }\n        else\n        {\n            l_current_read_size = 0;\n        }\n\n        if (l_current_read_size != p_j2k->m_specific_param.m_decoder.m_sot_length) {\n                p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_NEOC;\n        }\n        else {\n                p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_TPHSOT;\n        }\n\n        *l_tile_len += (OPJ_UINT32)l_current_read_size;\n\n        return OPJ_TRUE;\n}\n\n OPJ_BOOL opj_j2k_write_rgn(opj_j2k_t *p_j2k,\n                            OPJ_UINT32 p_tile_no,\n                            OPJ_UINT32 p_comp_no,\n                            OPJ_UINT32 nb_comps,\n                            opj_stream_private_t *p_stream,\n                            opj_event_mgr_t * p_manager\n                            )\n{\n        OPJ_BYTE * l_current_data = 00;\n        OPJ_UINT32 l_rgn_size;\n        opj_cp_t *l_cp = 00;\n        opj_tcp_t *l_tcp = 00;\n        opj_tccp_t *l_tccp = 00;\n        OPJ_UINT32 l_comp_room;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        l_cp = &(p_j2k->m_cp);\n        l_tcp = &l_cp->tcps[p_tile_no];\n        l_tccp = &l_tcp->tccps[p_comp_no];\n\n        if (nb_comps <= 256) {\n                l_comp_room = 1;\n        }\n        else {\n                l_comp_room = 2;\n        }\n\n        l_rgn_size = 6 + l_comp_room;\n\n        l_current_data = p_j2k->m_specific_param.m_encoder.m_header_tile_data;\n\n        opj_write_bytes(l_current_data,J2K_MS_RGN,2);                                   /* RGN  */\n        l_current_data += 2;\n\n        opj_write_bytes(l_current_data,l_rgn_size-2,2);                                 /* Lrgn */\n        l_current_data += 2;\n\n        opj_write_bytes(l_current_data,p_comp_no,l_comp_room);                          /* Crgn */\n        l_current_data+=l_comp_room;\n\n        opj_write_bytes(l_current_data, 0,1);                                           /* Srgn */\n        ++l_current_data;\n\n        opj_write_bytes(l_current_data, (OPJ_UINT32)l_tccp->roishift,1);                            /* SPrgn */\n        ++l_current_data;\n\n        if (opj_stream_write_data(p_stream,p_j2k->m_specific_param.m_encoder.m_header_tile_data,l_rgn_size,p_manager) != l_rgn_size) {\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_write_eoc(     opj_j2k_t *p_j2k,\n                            opj_stream_private_t *p_stream,\n                            opj_event_mgr_t * p_manager\n                            )\n{\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        opj_write_bytes(p_j2k->m_specific_param.m_encoder.m_header_tile_data,J2K_MS_EOC,2);                                     /* EOC */\n\n/* UniPG>> */\n#ifdef USE_JPWL\n        /* update markers struct */\n        /*\n        OPJ_BOOL res = j2k_add_marker(p_j2k->cstr_info, J2K_MS_EOC, p_stream_tell(p_stream) - 2, 2);\n*/\n#endif /* USE_JPWL */\n\n        if ( opj_stream_write_data(p_stream,p_j2k->m_specific_param.m_encoder.m_header_tile_data,2,p_manager) != 2) {\n                return OPJ_FALSE;\n        }\n\n        if ( ! opj_stream_flush(p_stream,p_manager) ) {\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\n/**\n * Reads a RGN marker (Region Of Interest)\n *\n * @param       p_header_data   the data contained in the POC box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the POC marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_rgn (opj_j2k_t *p_j2k,\n                                  OPJ_BYTE * p_header_data,\n                                  OPJ_UINT32 p_header_size,\n                                  opj_event_mgr_t * p_manager\n                                  )\n{\n        OPJ_UINT32 l_nb_comp;\n        opj_image_t * l_image = 00;\n\n        opj_cp_t *l_cp = 00;\n        opj_tcp_t *l_tcp = 00;\n        OPJ_UINT32 l_comp_room, l_comp_no, l_roi_sty;\n\n        /* preconditions*/\n        assert(p_header_data != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        l_image = p_j2k->m_private_image;\n        l_nb_comp = l_image->numcomps;\n\n        if (l_nb_comp <= 256) {\n                l_comp_room = 1; }\n        else {\n                l_comp_room = 2; }\n\n        if (p_header_size != 2 + l_comp_room) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading RGN marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        l_cp = &(p_j2k->m_cp);\n        l_tcp = (p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH) ?\n                                &l_cp->tcps[p_j2k->m_current_tile_number] :\n                                p_j2k->m_specific_param.m_decoder.m_default_tcp;\n\n        opj_read_bytes(p_header_data,&l_comp_no,l_comp_room);           /* Crgn */\n        p_header_data+=l_comp_room;\n        opj_read_bytes(p_header_data,&l_roi_sty,1);                                     /* Srgn */\n        ++p_header_data;\n\n#ifdef USE_JPWL\n        if (l_cp->correct) {\n                /* totlen is negative or larger than the bytes left!!! */\n                if (l_comp_room >= l_nb_comp) {\n                        opj_event_msg(p_manager, EVT_ERROR,\n                                \"JPWL: bad component number in RGN (%d when there are only %d)\\n\",\n                                l_comp_room, l_nb_comp);\n                        if (!JPWL_ASSUME || JPWL_ASSUME) {\n                                opj_event_msg(p_manager, EVT_ERROR, \"JPWL: giving up\\n\");\n                                return OPJ_FALSE;\n                        }\n                }\n        };\n#endif /* USE_JPWL */\n\n        /* testcase 3635.pdf.asan.77.2930 */\n        if (l_comp_no >= l_nb_comp) {\n                opj_event_msg(p_manager, EVT_ERROR,\n                        \"bad component number in RGN (%d when there are only %d)\\n\",\n                        l_comp_no, l_nb_comp);\n                return OPJ_FALSE;\n        }\n\n        opj_read_bytes(p_header_data,(OPJ_UINT32 *) (&(l_tcp->tccps[l_comp_no].roishift)),1);   /* SPrgn */\n        ++p_header_data;\n\n        return OPJ_TRUE;\n\n}\n\nOPJ_FLOAT32 opj_j2k_get_tp_stride (opj_tcp_t * p_tcp)\n{\n        return (OPJ_FLOAT32) ((p_tcp->m_nb_tile_parts - 1) * 14);\n}\n\nOPJ_FLOAT32 opj_j2k_get_default_stride (opj_tcp_t * p_tcp)\n{\n    (void)p_tcp;\n    return 0;\n}\n\nOPJ_BOOL opj_j2k_update_rates(  opj_j2k_t *p_j2k,\n                                                            opj_stream_private_t *p_stream,\n                                                            opj_event_mgr_t * p_manager )\n{\n        opj_cp_t * l_cp = 00;\n        opj_image_t * l_image = 00;\n        opj_tcp_t * l_tcp = 00;\n        opj_image_comp_t * l_img_comp = 00;\n\n        OPJ_UINT32 i,j,k;\n        OPJ_INT32 l_x0,l_y0,l_x1,l_y1;\n        OPJ_FLOAT32 * l_rates = 0;\n        OPJ_FLOAT32 l_sot_remove;\n        OPJ_UINT32 l_bits_empty, l_size_pixel;\n        OPJ_UINT32 l_tile_size = 0;\n        OPJ_UINT32 l_last_res;\n        OPJ_FLOAT32 (* l_tp_stride_func)(opj_tcp_t *) = 00;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        l_cp = &(p_j2k->m_cp);\n        l_image = p_j2k->m_private_image;\n        l_tcp = l_cp->tcps;\n\n        l_bits_empty = 8 * l_image->comps->dx * l_image->comps->dy;\n        l_size_pixel = l_image->numcomps * l_image->comps->prec;\n        l_sot_remove = (OPJ_FLOAT32) opj_stream_tell(p_stream) / (OPJ_FLOAT32)(l_cp->th * l_cp->tw);\n\n        if (l_cp->m_specific_param.m_enc.m_tp_on) {\n                l_tp_stride_func = opj_j2k_get_tp_stride;\n        }\n        else {\n                l_tp_stride_func = opj_j2k_get_default_stride;\n        }\n\n        for (i=0;i<l_cp->th;++i) {\n                for (j=0;j<l_cp->tw;++j) {\n                        OPJ_FLOAT32 l_offset = (OPJ_FLOAT32)(*l_tp_stride_func)(l_tcp) / (OPJ_FLOAT32)l_tcp->numlayers;\n\n                        /* 4 borders of the tile rescale on the image if necessary */\n                        l_x0 = opj_int_max((OPJ_INT32)(l_cp->tx0 + j * l_cp->tdx), (OPJ_INT32)l_image->x0);\n                        l_y0 = opj_int_max((OPJ_INT32)(l_cp->ty0 + i * l_cp->tdy), (OPJ_INT32)l_image->y0);\n                        l_x1 = opj_int_min((OPJ_INT32)(l_cp->tx0 + (j + 1) * l_cp->tdx), (OPJ_INT32)l_image->x1);\n                        l_y1 = opj_int_min((OPJ_INT32)(l_cp->ty0 + (i + 1) * l_cp->tdy), (OPJ_INT32)l_image->y1);\n\n                        l_rates = l_tcp->rates;\n\n                        /* Modification of the RATE >> */\n                        if (*l_rates) {\n                                *l_rates =              (( (OPJ_FLOAT32) (l_size_pixel * (OPJ_UINT32)(l_x1 - l_x0) * (OPJ_UINT32)(l_y1 - l_y0)))\n                                                                /\n                                                                ((*l_rates) * (OPJ_FLOAT32)l_bits_empty)\n                                                                )\n                                                                -\n                                                                l_offset;\n                        }\n\n                        ++l_rates;\n\n                        for (k = 1; k < l_tcp->numlayers; ++k) {\n                                if (*l_rates) {\n                                        *l_rates =              (( (OPJ_FLOAT32) (l_size_pixel * (OPJ_UINT32)(l_x1 - l_x0) * (OPJ_UINT32)(l_y1 - l_y0)))\n                                                                        /\n                                                                                ((*l_rates) * (OPJ_FLOAT32)l_bits_empty)\n                                                                        )\n                                                                        -\n                                                                        l_offset;\n                                }\n\n                                ++l_rates;\n                        }\n\n                        ++l_tcp;\n\n                }\n        }\n\n        l_tcp = l_cp->tcps;\n\n        for (i=0;i<l_cp->th;++i) {\n                for     (j=0;j<l_cp->tw;++j) {\n                        l_rates = l_tcp->rates;\n\n                        if (*l_rates) {\n                                *l_rates -= l_sot_remove;\n\n                                if (*l_rates < 30) {\n                                        *l_rates = 30;\n                                }\n                        }\n\n                        ++l_rates;\n\n                        l_last_res = l_tcp->numlayers - 1;\n\n                        for (k = 1; k < l_last_res; ++k) {\n\n                                if (*l_rates) {\n                                        *l_rates -= l_sot_remove;\n\n                                        if (*l_rates < *(l_rates - 1) + 10) {\n                                                *l_rates  = (*(l_rates - 1)) + 20;\n                                        }\n                                }\n\n                                ++l_rates;\n                        }\n\n                        if (*l_rates) {\n                                *l_rates -= (l_sot_remove + 2.f);\n\n                                if (*l_rates < *(l_rates - 1) + 10) {\n                                        *l_rates  = (*(l_rates - 1)) + 20;\n                                }\n                        }\n\n                        ++l_tcp;\n                }\n        }\n\n        l_img_comp = l_image->comps;\n        l_tile_size = 0;\n\n        for (i=0;i<l_image->numcomps;++i) {\n                l_tile_size += (        opj_uint_ceildiv(l_cp->tdx,l_img_comp->dx)\n                                                        *\n                                                        opj_uint_ceildiv(l_cp->tdy,l_img_comp->dy)\n                                                        *\n                                                        l_img_comp->prec\n                                                );\n\n                ++l_img_comp;\n        }\n\n        l_tile_size = (OPJ_UINT32) (l_tile_size * 0.1625); /* 1.3/8 = 0.1625 */\n\n        l_tile_size += opj_j2k_get_specific_header_sizes(p_j2k);\n\n        p_j2k->m_specific_param.m_encoder.m_encoded_tile_size = l_tile_size;\n        p_j2k->m_specific_param.m_encoder.m_encoded_tile_data =\n                        (OPJ_BYTE *) opj_malloc(p_j2k->m_specific_param.m_encoder.m_encoded_tile_size);\n        if (p_j2k->m_specific_param.m_encoder.m_encoded_tile_data == 00) {\n                return OPJ_FALSE;\n        }\n\n        if (OPJ_IS_CINEMA(l_cp->rsiz)) {\n                p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_buffer =\n                                (OPJ_BYTE *) opj_malloc(5*p_j2k->m_specific_param.m_encoder.m_total_tile_parts);\n                if (! p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_buffer) {\n                        return OPJ_FALSE;\n                }\n\n                p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_current =\n                                p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_buffer;\n        }\n\n        return OPJ_TRUE;\n}\n\n#if 0\nOPJ_BOOL opj_j2k_read_eoc (     opj_j2k_t *p_j2k,\n                                                        opj_stream_private_t *p_stream,\n                                                        opj_event_mgr_t * p_manager )\n{\n        OPJ_UINT32 i;\n        opj_tcd_t * l_tcd = 00;\n        OPJ_UINT32 l_nb_tiles;\n        opj_tcp_t * l_tcp = 00;\n        OPJ_BOOL l_success;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        l_nb_tiles = p_j2k->m_cp.th * p_j2k->m_cp.tw;\n        l_tcp = p_j2k->m_cp.tcps;\n\n        l_tcd = opj_tcd_create(OPJ_TRUE);\n        if (l_tcd == 00) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Cannot decode tile, memory error\\n\");\n                return OPJ_FALSE;\n        }\n\n        for (i = 0; i < l_nb_tiles; ++i) {\n                if (l_tcp->m_data) {\n                        if (! opj_tcd_init_decode_tile(l_tcd, i)) {\n                                opj_tcd_destroy(l_tcd);\n                                opj_event_msg(p_manager, EVT_ERROR, \"Cannot decode tile, memory error\\n\");\n                                return OPJ_FALSE;\n                        }\n\n                        l_success = opj_tcd_decode_tile(l_tcd, l_tcp->m_data, l_tcp->m_data_size, i, p_j2k->cstr_index);\n                        /* cleanup */\n\n                        if (! l_success) {\n                                p_j2k->m_specific_param.m_decoder.m_state |= J2K_STATE_ERR;\n                                break;\n                        }\n                }\n\n                opj_j2k_tcp_destroy(l_tcp);\n                ++l_tcp;\n        }\n\n        opj_tcd_destroy(l_tcd);\n        return OPJ_TRUE;\n}\n#endif\n\nOPJ_BOOL opj_j2k_get_end_header(opj_j2k_t *p_j2k,\n                                                        struct opj_stream_private *p_stream,\n                                                        struct opj_event_mgr * p_manager )\n{\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        p_j2k->cstr_index->main_head_end = opj_stream_tell(p_stream);\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_write_mct_data_group(  opj_j2k_t *p_j2k,\n                                                                        struct opj_stream_private *p_stream,\n                                                                        struct opj_event_mgr * p_manager )\n{\n        OPJ_UINT32 i;\n        opj_simple_mcc_decorrelation_data_t * l_mcc_record;\n        opj_mct_data_t * l_mct_record;\n        opj_tcp_t * l_tcp;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_stream != 00);\n        assert(p_manager != 00);\n\n        if (! opj_j2k_write_cbd(p_j2k,p_stream,p_manager)) {\n                return OPJ_FALSE;\n        }\n\n        l_tcp = &(p_j2k->m_cp.tcps[p_j2k->m_current_tile_number]);\n        l_mct_record = l_tcp->m_mct_records;\n\n        for (i=0;i<l_tcp->m_nb_mct_records;++i) {\n\n                if (! opj_j2k_write_mct_record(p_j2k,l_mct_record,p_stream,p_manager)) {\n                        return OPJ_FALSE;\n                }\n\n                ++l_mct_record;\n        }\n\n        l_mcc_record = l_tcp->m_mcc_records;\n\n        for     (i=0;i<l_tcp->m_nb_mcc_records;++i) {\n\n                if (! opj_j2k_write_mcc_record(p_j2k,l_mcc_record,p_stream,p_manager)) {\n                        return OPJ_FALSE;\n                }\n\n                ++l_mcc_record;\n        }\n\n        if (! opj_j2k_write_mco(p_j2k,p_stream,p_manager)) {\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\n#if 0\nOPJ_BOOL opj_j2k_write_all_coc(opj_j2k_t *p_j2k,\n                                                                        struct opj_stream_private *p_stream,\n                                                                        struct opj_event_mgr * p_manager )\n{\n        OPJ_UINT32 compno;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        for (compno = 0; compno < p_j2k->m_private_image->numcomps; ++compno)\n        {\n                if (! opj_j2k_write_coc(p_j2k,compno,p_stream, p_manager)) {\n                        return OPJ_FALSE;\n                }\n        }\n\n        return OPJ_TRUE;\n}\n#endif\n\n#if 0\nOPJ_BOOL opj_j2k_write_all_qcc(opj_j2k_t *p_j2k,\n                                                                        struct opj_stream_private *p_stream,\n                                                                        struct opj_event_mgr * p_manager )\n{\n        OPJ_UINT32 compno;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        for (compno = 0; compno < p_j2k->m_private_image->numcomps; ++compno)\n        {\n                if (! opj_j2k_write_qcc(p_j2k,compno,p_stream, p_manager)) {\n                        return OPJ_FALSE;\n                }\n        }\n\n        return OPJ_TRUE;\n}\n#endif\n\n\nOPJ_BOOL opj_j2k_write_regions( opj_j2k_t *p_j2k,\n                                                        struct opj_stream_private *p_stream,\n                                                        struct opj_event_mgr * p_manager )\n{\n        OPJ_UINT32 compno;\n        const opj_tccp_t *l_tccp = 00;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        l_tccp = p_j2k->m_cp.tcps->tccps;\n\n        for     (compno = 0; compno < p_j2k->m_private_image->numcomps; ++compno)  {\n                if (l_tccp->roishift) {\n\n                        if (! opj_j2k_write_rgn(p_j2k,0,compno,p_j2k->m_private_image->numcomps,p_stream,p_manager)) {\n                                return OPJ_FALSE;\n                        }\n                }\n\n                ++l_tccp;\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_write_epc(     opj_j2k_t *p_j2k,\n                                                struct opj_stream_private *p_stream,\n                                                struct opj_event_mgr * p_manager )\n{\n        opj_codestream_index_t * l_cstr_index = 00;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        l_cstr_index = p_j2k->cstr_index;\n        if (l_cstr_index) {\n                l_cstr_index->codestream_size = (OPJ_UINT64)opj_stream_tell(p_stream);\n                /* UniPG>> */\n                /* The following adjustment is done to adjust the codestream size */\n                /* if SOD is not at 0 in the buffer. Useful in case of JP2, where */\n                /* the first bunch of bytes is not in the codestream              */\n                l_cstr_index->codestream_size -= (OPJ_UINT64)l_cstr_index->main_head_start;\n                /* <<UniPG */\n        }\n\n#ifdef USE_JPWL\n        /* preparation of JPWL marker segments */\n#if 0\n        if(cp->epc_on) {\n\n                /* encode according to JPWL */\n                jpwl_encode(p_j2k, p_stream, image);\n\n        }\n#endif\n  assert( 0 && \"TODO\" );\n#endif /* USE_JPWL */\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_read_unk (     opj_j2k_t *p_j2k,\n                                                        opj_stream_private_t *p_stream,\n                                                        OPJ_UINT32 *output_marker,\n                                                        opj_event_mgr_t * p_manager\n                                                        )\n{\n        OPJ_UINT32 l_unknown_marker;\n        const opj_dec_memory_marker_handler_t * l_marker_handler;\n        OPJ_UINT32 l_size_unk = 2;\n\n        /* preconditions*/\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        opj_event_msg(p_manager, EVT_WARNING, \"Unknown marker\\n\");\n\n        while(1) {\n                /* Try to read 2 bytes (the next marker ID) from stream and copy them into the buffer*/\n                if (opj_stream_read_data(p_stream,p_j2k->m_specific_param.m_decoder.m_header_data,2,p_manager) != 2) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Stream too short\\n\");\n                        return OPJ_FALSE;\n                }\n\n                /* read 2 bytes as the new marker ID*/\n                opj_read_bytes(p_j2k->m_specific_param.m_decoder.m_header_data,&l_unknown_marker,2);\n\n                if (!(l_unknown_marker < 0xff00)) {\n\n                        /* Get the marker handler from the marker ID*/\n                        l_marker_handler = opj_j2k_get_marker_handler(l_unknown_marker);\n\n                        if (!(p_j2k->m_specific_param.m_decoder.m_state & l_marker_handler->states)) {\n                                opj_event_msg(p_manager, EVT_ERROR, \"Marker is not compliant with its position\\n\");\n                                return OPJ_FALSE;\n                        }\n                        else {\n                                if (l_marker_handler->id != J2K_MS_UNK) {\n                                        /* Add the marker to the codestream index*/\n                                        if (l_marker_handler->id != J2K_MS_SOT)\n                                        {\n                                                OPJ_BOOL res = opj_j2k_add_mhmarker(p_j2k->cstr_index, J2K_MS_UNK,\n                                                                (OPJ_UINT32) opj_stream_tell(p_stream) - l_size_unk,\n                                                                l_size_unk);\n                                                if (res == OPJ_FALSE) {\n                                                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to add mh marker\\n\");\n                                                        return OPJ_FALSE;\n                                                }\n                                        }\n                                        break; /* next marker is known and well located */\n                                }\n                                else\n                                        l_size_unk += 2;\n                        }\n                }\n        }\n\n        *output_marker = l_marker_handler->id ;\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_write_mct_record(      opj_j2k_t *p_j2k,\n                                                                opj_mct_data_t * p_mct_record,\n                                                                struct opj_stream_private *p_stream,\n                                                                struct opj_event_mgr * p_manager )\n{\n        OPJ_UINT32 l_mct_size;\n        OPJ_BYTE * l_current_data = 00;\n        OPJ_UINT32 l_tmp;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        l_mct_size = 10 + p_mct_record->m_data_size;\n\n        if (l_mct_size > p_j2k->m_specific_param.m_encoder.m_header_tile_data_size) {\n                OPJ_BYTE *new_header_tile_data = (OPJ_BYTE *) opj_realloc(p_j2k->m_specific_param.m_encoder.m_header_tile_data, l_mct_size);\n                if (! new_header_tile_data) {\n                        opj_free(p_j2k->m_specific_param.m_encoder.m_header_tile_data);\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data = NULL;\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = 0;\n                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to write MCT marker\\n\");\n                        return OPJ_FALSE;\n                }\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data = new_header_tile_data;\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = l_mct_size;\n        }\n\n        l_current_data = p_j2k->m_specific_param.m_encoder.m_header_tile_data;\n\n        opj_write_bytes(l_current_data,J2K_MS_MCT,2);                                   /* MCT */\n        l_current_data += 2;\n\n        opj_write_bytes(l_current_data,l_mct_size-2,2);                                 /* Lmct */\n        l_current_data += 2;\n\n        opj_write_bytes(l_current_data,0,2);                                                    /* Zmct */\n        l_current_data += 2;\n\n        /* only one marker atm */\n        l_tmp = (p_mct_record->m_index & 0xff) | (p_mct_record->m_array_type << 8) | (p_mct_record->m_element_type << 10);\n\n        opj_write_bytes(l_current_data,l_tmp,2);\n        l_current_data += 2;\n\n        opj_write_bytes(l_current_data,0,2);                                                    /* Ymct */\n        l_current_data+=2;\n\n        memcpy(l_current_data,p_mct_record->m_data,p_mct_record->m_data_size);\n\n        if (opj_stream_write_data(p_stream,p_j2k->m_specific_param.m_encoder.m_header_tile_data,l_mct_size,p_manager) != l_mct_size) {\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\n/**\n * Reads a MCT marker (Multiple Component Transform)\n *\n * @param       p_header_data   the data contained in the MCT box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the MCT marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_mct (      opj_j2k_t *p_j2k,\n                                                                    OPJ_BYTE * p_header_data,\n                                                                    OPJ_UINT32 p_header_size,\n                                                                    opj_event_mgr_t * p_manager\n                                    )\n{\n        OPJ_UINT32 i;\n        opj_tcp_t *l_tcp = 00;\n        OPJ_UINT32 l_tmp;\n        OPJ_UINT32 l_indix;\n        opj_mct_data_t * l_mct_data;\n\n        /* preconditions */\n        assert(p_header_data != 00);\n        assert(p_j2k != 00);\n\n        l_tcp = p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH ?\n                        &p_j2k->m_cp.tcps[p_j2k->m_current_tile_number] :\n                        p_j2k->m_specific_param.m_decoder.m_default_tcp;\n\n        if (p_header_size < 2) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading MCT marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        /* first marker */\n        opj_read_bytes(p_header_data,&l_tmp,2);                         /* Zmct */\n        p_header_data += 2;\n        if (l_tmp != 0) {\n                opj_event_msg(p_manager, EVT_WARNING, \"Cannot take in charge mct data within multiple MCT records\\n\");\n                return OPJ_TRUE;\n        }\n\n        if(p_header_size <= 6) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading MCT marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        /* Imct -> no need for other values, take the first, type is double with decorrelation x0000 1101 0000 0000*/\n        opj_read_bytes(p_header_data,&l_tmp,2);                         /* Imct */\n        p_header_data += 2;\n\n        l_indix = l_tmp & 0xff;\n        l_mct_data = l_tcp->m_mct_records;\n\n        for (i=0;i<l_tcp->m_nb_mct_records;++i) {\n                if (l_mct_data->m_index == l_indix) {\n                        break;\n                }\n                ++l_mct_data;\n        }\n\n        /* NOT FOUND */\n        if (i == l_tcp->m_nb_mct_records) {\n                if (l_tcp->m_nb_mct_records == l_tcp->m_nb_max_mct_records) {\n                        opj_mct_data_t *new_mct_records;\n                        l_tcp->m_nb_max_mct_records += OPJ_J2K_MCT_DEFAULT_NB_RECORDS;\n\n                        new_mct_records = (opj_mct_data_t *) opj_realloc(l_tcp->m_mct_records, l_tcp->m_nb_max_mct_records * sizeof(opj_mct_data_t));\n                        if (! new_mct_records) {\n                                opj_free(l_tcp->m_mct_records);\n                                l_tcp->m_mct_records = NULL;\n                                l_tcp->m_nb_max_mct_records = 0;\n                                l_tcp->m_nb_mct_records = 0;\n                                opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to read MCT marker\\n\");\n                                return OPJ_FALSE;\n                        }\n                        l_tcp->m_mct_records = new_mct_records;\n                        l_mct_data = l_tcp->m_mct_records + l_tcp->m_nb_mct_records;\n                        memset(l_mct_data ,0,(l_tcp->m_nb_max_mct_records - l_tcp->m_nb_mct_records) * sizeof(opj_mct_data_t));\n                }\n\n                l_mct_data = l_tcp->m_mct_records + l_tcp->m_nb_mct_records;\n        }\n\n        if (l_mct_data->m_data) {\n                opj_free(l_mct_data->m_data);\n                l_mct_data->m_data = 00;\n        }\n\n        l_mct_data->m_index = l_indix;\n        l_mct_data->m_array_type = (J2K_MCT_ARRAY_TYPE)((l_tmp  >> 8) & 3);\n        l_mct_data->m_element_type = (J2K_MCT_ELEMENT_TYPE)((l_tmp  >> 10) & 3);\n\n        opj_read_bytes(p_header_data,&l_tmp,2);                         /* Ymct */\n        p_header_data+=2;\n        if (l_tmp != 0) {\n                opj_event_msg(p_manager, EVT_WARNING, \"Cannot take in charge multiple MCT markers\\n\");\n                return OPJ_TRUE;\n        }\n\n        p_header_size -= 6;\n\n        l_mct_data->m_data = (OPJ_BYTE*)opj_malloc(p_header_size);\n        if (! l_mct_data->m_data) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading MCT marker\\n\");\n                return OPJ_FALSE;\n        }\n        memcpy(l_mct_data->m_data,p_header_data,p_header_size);\n\n        l_mct_data->m_data_size = p_header_size;\n        ++l_tcp->m_nb_mct_records;\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_write_mcc_record(      opj_j2k_t *p_j2k,\n                                                                struct opj_simple_mcc_decorrelation_data * p_mcc_record,\n                                                                struct opj_stream_private *p_stream,\n                                                                struct opj_event_mgr * p_manager )\n{\n        OPJ_UINT32 i;\n        OPJ_UINT32 l_mcc_size;\n        OPJ_BYTE * l_current_data = 00;\n        OPJ_UINT32 l_nb_bytes_for_comp;\n        OPJ_UINT32 l_mask;\n        OPJ_UINT32 l_tmcc;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        if (p_mcc_record->m_nb_comps > 255 ) {\n        l_nb_bytes_for_comp = 2;\n                l_mask = 0x8000;\n        }\n        else {\n                l_nb_bytes_for_comp = 1;\n                l_mask = 0;\n        }\n\n        l_mcc_size = p_mcc_record->m_nb_comps * 2 * l_nb_bytes_for_comp + 19;\n        if (l_mcc_size > p_j2k->m_specific_param.m_encoder.m_header_tile_data_size)\n        {\n                OPJ_BYTE *new_header_tile_data = (OPJ_BYTE *) opj_realloc(p_j2k->m_specific_param.m_encoder.m_header_tile_data, l_mcc_size);\n                if (! new_header_tile_data) {\n                        opj_free(p_j2k->m_specific_param.m_encoder.m_header_tile_data);\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data = NULL;\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = 0;\n                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to write MCC marker\\n\");\n                        return OPJ_FALSE;\n                }\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data = new_header_tile_data;\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = l_mcc_size;\n        }\n\n        l_current_data = p_j2k->m_specific_param.m_encoder.m_header_tile_data;\n\n        opj_write_bytes(l_current_data,J2K_MS_MCC,2);                                   /* MCC */\n        l_current_data += 2;\n\n        opj_write_bytes(l_current_data,l_mcc_size-2,2);                                 /* Lmcc */\n        l_current_data += 2;\n\n        /* first marker */\n        opj_write_bytes(l_current_data,0,2);                                    /* Zmcc */\n        l_current_data += 2;\n\n        opj_write_bytes(l_current_data,p_mcc_record->m_index,1);                                        /* Imcc -> no need for other values, take the first */\n        ++l_current_data;\n\n        /* only one marker atm */\n        opj_write_bytes(l_current_data,0,2);                                    /* Ymcc */\n        l_current_data+=2;\n\n        opj_write_bytes(l_current_data,1,2);                                    /* Qmcc -> number of collections -> 1 */\n        l_current_data+=2;\n\n        opj_write_bytes(l_current_data,0x1,1);                                  /* Xmcci type of component transformation -> array based decorrelation */\n        ++l_current_data;\n\n        opj_write_bytes(l_current_data,p_mcc_record->m_nb_comps | l_mask,2);    /* Nmcci number of input components involved and size for each component offset = 8 bits */\n        l_current_data+=2;\n\n        for (i=0;i<p_mcc_record->m_nb_comps;++i) {\n                opj_write_bytes(l_current_data,i,l_nb_bytes_for_comp);                          /* Cmccij Component offset*/\n                l_current_data+=l_nb_bytes_for_comp;\n        }\n\n        opj_write_bytes(l_current_data,p_mcc_record->m_nb_comps|l_mask,2);      /* Mmcci number of output components involved and size for each component offset = 8 bits */\n        l_current_data+=2;\n\n        for (i=0;i<p_mcc_record->m_nb_comps;++i)\n        {\n                opj_write_bytes(l_current_data,i,l_nb_bytes_for_comp);                          /* Wmccij Component offset*/\n                l_current_data+=l_nb_bytes_for_comp;\n        }\n\n        l_tmcc = ((!p_mcc_record->m_is_irreversible)&1)<<16;\n\n        if (p_mcc_record->m_decorrelation_array) {\n                l_tmcc |= p_mcc_record->m_decorrelation_array->m_index;\n        }\n\n        if (p_mcc_record->m_offset_array) {\n                l_tmcc |= ((p_mcc_record->m_offset_array->m_index)<<8);\n        }\n\n        opj_write_bytes(l_current_data,l_tmcc,3);       /* Tmcci : use MCT defined as number 1 and irreversible array based. */\n        l_current_data+=3;\n\n        if (opj_stream_write_data(p_stream,p_j2k->m_specific_param.m_encoder.m_header_tile_data,l_mcc_size,p_manager) != l_mcc_size) {\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_read_mcc (     opj_j2k_t *p_j2k,\n                                                OPJ_BYTE * p_header_data,\n                                                OPJ_UINT32 p_header_size,\n                                                opj_event_mgr_t * p_manager )\n{\n        OPJ_UINT32 i,j;\n        OPJ_UINT32 l_tmp;\n        OPJ_UINT32 l_indix;\n        opj_tcp_t * l_tcp;\n        opj_simple_mcc_decorrelation_data_t * l_mcc_record;\n        opj_mct_data_t * l_mct_data;\n        OPJ_UINT32 l_nb_collections;\n        OPJ_UINT32 l_nb_comps;\n        OPJ_UINT32 l_nb_bytes_by_comp;\n\n        /* preconditions */\n        assert(p_header_data != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        l_tcp = p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH ?\n                        &p_j2k->m_cp.tcps[p_j2k->m_current_tile_number] :\n                        p_j2k->m_specific_param.m_decoder.m_default_tcp;\n\n        if (p_header_size < 2) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading MCC marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        /* first marker */\n        opj_read_bytes(p_header_data,&l_tmp,2);                         /* Zmcc */\n        p_header_data += 2;\n        if (l_tmp != 0) {\n                opj_event_msg(p_manager, EVT_WARNING, \"Cannot take in charge multiple data spanning\\n\");\n                return OPJ_TRUE;\n        }\n\n        if (p_header_size < 7) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading MCC marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        opj_read_bytes(p_header_data,&l_indix,1); /* Imcc -> no need for other values, take the first */\n        ++p_header_data;\n\n        l_mcc_record = l_tcp->m_mcc_records;\n\n        for(i=0;i<l_tcp->m_nb_mcc_records;++i) {\n                if (l_mcc_record->m_index == l_indix) {\n                        break;\n                }\n                ++l_mcc_record;\n        }\n\n        /** NOT FOUND */\n        if (i == l_tcp->m_nb_mcc_records) {\n                if (l_tcp->m_nb_mcc_records == l_tcp->m_nb_max_mcc_records) {\n                        opj_simple_mcc_decorrelation_data_t *new_mcc_records;\n                        l_tcp->m_nb_max_mcc_records += OPJ_J2K_MCC_DEFAULT_NB_RECORDS;\n\n                        new_mcc_records = (opj_simple_mcc_decorrelation_data_t *) opj_realloc(\n                                        l_tcp->m_mcc_records, l_tcp->m_nb_max_mcc_records * sizeof(opj_simple_mcc_decorrelation_data_t));\n                        if (! new_mcc_records) {\n                                opj_free(l_tcp->m_mcc_records);\n                                l_tcp->m_mcc_records = NULL;\n                                l_tcp->m_nb_max_mcc_records = 0;\n                                l_tcp->m_nb_mcc_records = 0;\n                                opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to read MCC marker\\n\");\n                                return OPJ_FALSE;\n                        }\n                        l_tcp->m_mcc_records = new_mcc_records;\n                        l_mcc_record = l_tcp->m_mcc_records + l_tcp->m_nb_mcc_records;\n                        memset(l_mcc_record,0,(l_tcp->m_nb_max_mcc_records-l_tcp->m_nb_mcc_records) * sizeof(opj_simple_mcc_decorrelation_data_t));\n                }\n                l_mcc_record = l_tcp->m_mcc_records + l_tcp->m_nb_mcc_records;\n        }\n        l_mcc_record->m_index = l_indix;\n\n        /* only one marker atm */\n        opj_read_bytes(p_header_data,&l_tmp,2);                         /* Ymcc */\n        p_header_data+=2;\n        if (l_tmp != 0) {\n                opj_event_msg(p_manager, EVT_WARNING, \"Cannot take in charge multiple data spanning\\n\");\n                return OPJ_TRUE;\n        }\n\n        opj_read_bytes(p_header_data,&l_nb_collections,2);                              /* Qmcc -> number of collections -> 1 */\n        p_header_data+=2;\n\n        if (l_nb_collections > 1) {\n                opj_event_msg(p_manager, EVT_WARNING, \"Cannot take in charge multiple collections\\n\");\n                return OPJ_TRUE;\n        }\n\n        p_header_size -= 7;\n\n        for (i=0;i<l_nb_collections;++i) {\n                if (p_header_size < 3) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Error reading MCC marker\\n\");\n                        return OPJ_FALSE;\n                }\n\n                opj_read_bytes(p_header_data,&l_tmp,1); /* Xmcci type of component transformation -> array based decorrelation */\n                ++p_header_data;\n\n                if (l_tmp != 1) {\n                        opj_event_msg(p_manager, EVT_WARNING, \"Cannot take in charge collections other than array decorrelation\\n\");\n                        return OPJ_TRUE;\n                }\n\n                opj_read_bytes(p_header_data,&l_nb_comps,2);\n\n                p_header_data+=2;\n                p_header_size-=3;\n\n                l_nb_bytes_by_comp = 1 + (l_nb_comps>>15);\n                l_mcc_record->m_nb_comps = l_nb_comps & 0x7fff;\n\n                if (p_header_size < (l_nb_bytes_by_comp * l_mcc_record->m_nb_comps + 2)) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Error reading MCC marker\\n\");\n                        return OPJ_FALSE;\n                }\n\n                p_header_size -= (l_nb_bytes_by_comp * l_mcc_record->m_nb_comps + 2);\n\n                for (j=0;j<l_mcc_record->m_nb_comps;++j) {\n                        opj_read_bytes(p_header_data,&l_tmp,l_nb_bytes_by_comp);        /* Cmccij Component offset*/\n                        p_header_data+=l_nb_bytes_by_comp;\n\n                        if (l_tmp != j) {\n                                opj_event_msg(p_manager, EVT_WARNING, \"Cannot take in charge collections with indix shuffle\\n\");\n                                return OPJ_TRUE;\n                        }\n                }\n\n                opj_read_bytes(p_header_data,&l_nb_comps,2);\n                p_header_data+=2;\n\n                l_nb_bytes_by_comp = 1 + (l_nb_comps>>15);\n                l_nb_comps &= 0x7fff;\n\n                if (l_nb_comps != l_mcc_record->m_nb_comps) {\n                        opj_event_msg(p_manager, EVT_WARNING, \"Cannot take in charge collections without same number of indixes\\n\");\n                        return OPJ_TRUE;\n                }\n\n                if (p_header_size < (l_nb_bytes_by_comp * l_mcc_record->m_nb_comps + 3)) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Error reading MCC marker\\n\");\n                        return OPJ_FALSE;\n                }\n\n                p_header_size -= (l_nb_bytes_by_comp * l_mcc_record->m_nb_comps + 3);\n\n                for (j=0;j<l_mcc_record->m_nb_comps;++j) {\n                        opj_read_bytes(p_header_data,&l_tmp,l_nb_bytes_by_comp);        /* Wmccij Component offset*/\n                        p_header_data+=l_nb_bytes_by_comp;\n\n                        if (l_tmp != j) {\n                                opj_event_msg(p_manager, EVT_WARNING, \"Cannot take in charge collections with indix shuffle\\n\");\n                                return OPJ_TRUE;\n                        }\n                }\n\n                opj_read_bytes(p_header_data,&l_tmp,3); /* Wmccij Component offset*/\n                p_header_data += 3;\n\n                l_mcc_record->m_is_irreversible = ! ((l_tmp>>16) & 1);\n                l_mcc_record->m_decorrelation_array = 00;\n                l_mcc_record->m_offset_array = 00;\n\n                l_indix = l_tmp & 0xff;\n                if (l_indix != 0) {\n                        l_mct_data = l_tcp->m_mct_records;\n                        for (j=0;j<l_tcp->m_nb_mct_records;++j) {\n                                if (l_mct_data->m_index == l_indix) {\n                                        l_mcc_record->m_decorrelation_array = l_mct_data;\n                                        break;\n                                }\n                                ++l_mct_data;\n                        }\n\n                        if (l_mcc_record->m_decorrelation_array == 00) {\n                                opj_event_msg(p_manager, EVT_ERROR, \"Error reading MCC marker\\n\");\n                                return OPJ_FALSE;\n                        }\n                }\n\n                l_indix = (l_tmp >> 8) & 0xff;\n                if (l_indix != 0) {\n                        l_mct_data = l_tcp->m_mct_records;\n                        for (j=0;j<l_tcp->m_nb_mct_records;++j) {\n                                if (l_mct_data->m_index == l_indix) {\n                                        l_mcc_record->m_offset_array = l_mct_data;\n                                        break;\n                                }\n                                ++l_mct_data;\n                        }\n\n                        if (l_mcc_record->m_offset_array == 00) {\n                                opj_event_msg(p_manager, EVT_ERROR, \"Error reading MCC marker\\n\");\n                                return OPJ_FALSE;\n                        }\n                }\n        }\n\n        if (p_header_size != 0) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading MCC marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        ++l_tcp->m_nb_mcc_records;\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_write_mco(     opj_j2k_t *p_j2k,\n                                                struct opj_stream_private *p_stream,\n                                                struct opj_event_mgr * p_manager\n                                  )\n{\n        OPJ_BYTE * l_current_data = 00;\n        OPJ_UINT32 l_mco_size;\n        opj_tcp_t * l_tcp = 00;\n        opj_simple_mcc_decorrelation_data_t * l_mcc_record;\n        OPJ_UINT32 i;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        l_tcp =&(p_j2k->m_cp.tcps[p_j2k->m_current_tile_number]);\n        l_current_data = p_j2k->m_specific_param.m_encoder.m_header_tile_data;\n\n        l_mco_size = 5 + l_tcp->m_nb_mcc_records;\n        if (l_mco_size > p_j2k->m_specific_param.m_encoder.m_header_tile_data_size) {\n\n                OPJ_BYTE *new_header_tile_data = (OPJ_BYTE *) opj_realloc(p_j2k->m_specific_param.m_encoder.m_header_tile_data, l_mco_size);\n                if (! new_header_tile_data) {\n                        opj_free(p_j2k->m_specific_param.m_encoder.m_header_tile_data);\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data = NULL;\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = 0;\n                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to write MCO marker\\n\");\n                        return OPJ_FALSE;\n                }\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data = new_header_tile_data;\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = l_mco_size;\n        }\n\n        opj_write_bytes(l_current_data,J2K_MS_MCO,2);                   /* MCO */\n        l_current_data += 2;\n\n        opj_write_bytes(l_current_data,l_mco_size-2,2);                 /* Lmco */\n        l_current_data += 2;\n\n        opj_write_bytes(l_current_data,l_tcp->m_nb_mcc_records,1);      /* Nmco : only one tranform stage*/\n        ++l_current_data;\n\n        l_mcc_record = l_tcp->m_mcc_records;\n        for     (i=0;i<l_tcp->m_nb_mcc_records;++i) {\n                opj_write_bytes(l_current_data,l_mcc_record->m_index,1);/* Imco -> use the mcc indicated by 1*/\n                ++l_current_data;\n\n                ++l_mcc_record;\n        }\n\n        if (opj_stream_write_data(p_stream,p_j2k->m_specific_param.m_encoder.m_header_tile_data,l_mco_size,p_manager) != l_mco_size) {\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\n/**\n * Reads a MCO marker (Multiple Component Transform Ordering)\n *\n * @param       p_header_data   the data contained in the MCO box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the MCO marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_mco (      opj_j2k_t *p_j2k,\n                                                                    OPJ_BYTE * p_header_data,\n                                                                    OPJ_UINT32 p_header_size,\n                                                                    opj_event_mgr_t * p_manager\n                                    )\n{\n        OPJ_UINT32 l_tmp, i;\n        OPJ_UINT32 l_nb_stages;\n        opj_tcp_t * l_tcp;\n        opj_tccp_t * l_tccp;\n        opj_image_t * l_image;\n\n        /* preconditions */\n        assert(p_header_data != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        l_image = p_j2k->m_private_image;\n        l_tcp = p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH ?\n                        &p_j2k->m_cp.tcps[p_j2k->m_current_tile_number] :\n                        p_j2k->m_specific_param.m_decoder.m_default_tcp;\n\n        if (p_header_size < 1) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading MCO marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        opj_read_bytes(p_header_data,&l_nb_stages,1);                           /* Nmco : only one tranform stage*/\n        ++p_header_data;\n\n        if (l_nb_stages > 1) {\n                opj_event_msg(p_manager, EVT_WARNING, \"Cannot take in charge multiple transformation stages.\\n\");\n                return OPJ_TRUE;\n        }\n\n        if (p_header_size != l_nb_stages + 1) {\n                opj_event_msg(p_manager, EVT_WARNING, \"Error reading MCO marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        l_tccp = l_tcp->tccps;\n\n        for (i=0;i<l_image->numcomps;++i) {\n                l_tccp->m_dc_level_shift = 0;\n                ++l_tccp;\n        }\n\n        if (l_tcp->m_mct_decoding_matrix) {\n                opj_free(l_tcp->m_mct_decoding_matrix);\n                l_tcp->m_mct_decoding_matrix = 00;\n        }\n\n        for (i=0;i<l_nb_stages;++i) {\n                opj_read_bytes(p_header_data,&l_tmp,1);\n                ++p_header_data;\n\n                if (! opj_j2k_add_mct(l_tcp,p_j2k->m_private_image,l_tmp)) {\n                        return OPJ_FALSE;\n                }\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_add_mct(opj_tcp_t * p_tcp, opj_image_t * p_image, OPJ_UINT32 p_index)\n{\n        OPJ_UINT32 i;\n        opj_simple_mcc_decorrelation_data_t * l_mcc_record;\n        opj_mct_data_t * l_deco_array, * l_offset_array;\n        OPJ_UINT32 l_data_size,l_mct_size, l_offset_size;\n        OPJ_UINT32 l_nb_elem;\n        OPJ_UINT32 * l_offset_data, * l_current_offset_data;\n        opj_tccp_t * l_tccp;\n\n        /* preconditions */\n        assert(p_tcp != 00);\n\n        l_mcc_record = p_tcp->m_mcc_records;\n\n        for (i=0;i<p_tcp->m_nb_mcc_records;++i) {\n                if (l_mcc_record->m_index == p_index) {\n                        break;\n                }\n        }\n\n        if (i==p_tcp->m_nb_mcc_records) {\n                /** element discarded **/\n                return OPJ_TRUE;\n        }\n\n        if (l_mcc_record->m_nb_comps != p_image->numcomps) {\n                /** do not support number of comps != image */\n                return OPJ_TRUE;\n        }\n\n        l_deco_array = l_mcc_record->m_decorrelation_array;\n\n        if (l_deco_array) {\n                l_data_size = MCT_ELEMENT_SIZE[l_deco_array->m_element_type] * p_image->numcomps * p_image->numcomps;\n                if (l_deco_array->m_data_size != l_data_size) {\n                        return OPJ_FALSE;\n                }\n\n                l_nb_elem = p_image->numcomps * p_image->numcomps;\n                l_mct_size = l_nb_elem * (OPJ_UINT32)sizeof(OPJ_FLOAT32);\n                p_tcp->m_mct_decoding_matrix = (OPJ_FLOAT32*)opj_malloc(l_mct_size);\n\n                if (! p_tcp->m_mct_decoding_matrix ) {\n                        return OPJ_FALSE;\n                }\n\n                j2k_mct_read_functions_to_float[l_deco_array->m_element_type](l_deco_array->m_data,p_tcp->m_mct_decoding_matrix,l_nb_elem);\n        }\n\n        l_offset_array = l_mcc_record->m_offset_array;\n\n        if (l_offset_array) {\n                l_data_size = MCT_ELEMENT_SIZE[l_offset_array->m_element_type] * p_image->numcomps;\n                if (l_offset_array->m_data_size != l_data_size) {\n                        return OPJ_FALSE;\n                }\n\n                l_nb_elem = p_image->numcomps;\n                l_offset_size = l_nb_elem * (OPJ_UINT32)sizeof(OPJ_UINT32);\n                l_offset_data = (OPJ_UINT32*)opj_malloc(l_offset_size);\n\n                if (! l_offset_data ) {\n                        return OPJ_FALSE;\n                }\n\n                j2k_mct_read_functions_to_int32[l_offset_array->m_element_type](l_offset_array->m_data,l_offset_data,l_nb_elem);\n\n                l_tccp = p_tcp->tccps;\n                l_current_offset_data = l_offset_data;\n\n                for (i=0;i<p_image->numcomps;++i) {\n                        l_tccp->m_dc_level_shift = (OPJ_INT32)*(l_current_offset_data++);\n                        ++l_tccp;\n                }\n\n                opj_free(l_offset_data);\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_write_cbd( opj_j2k_t *p_j2k,\n                                                struct opj_stream_private *p_stream,\n                                                struct opj_event_mgr * p_manager )\n{\n        OPJ_UINT32 i;\n        OPJ_UINT32 l_cbd_size;\n        OPJ_BYTE * l_current_data = 00;\n        opj_image_t *l_image = 00;\n        opj_image_comp_t * l_comp = 00;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        l_image = p_j2k->m_private_image;\n        l_cbd_size = 6 + p_j2k->m_private_image->numcomps;\n\n        if (l_cbd_size > p_j2k->m_specific_param.m_encoder.m_header_tile_data_size) {\n                OPJ_BYTE *new_header_tile_data = (OPJ_BYTE *) opj_realloc(p_j2k->m_specific_param.m_encoder.m_header_tile_data, l_cbd_size);\n                if (! new_header_tile_data) {\n                        opj_free(p_j2k->m_specific_param.m_encoder.m_header_tile_data);\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data = NULL;\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = 0;\n                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to write CBD marker\\n\");\n                        return OPJ_FALSE;\n                }\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data = new_header_tile_data;\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = l_cbd_size;\n        }\n\n        l_current_data = p_j2k->m_specific_param.m_encoder.m_header_tile_data;\n\n        opj_write_bytes(l_current_data,J2K_MS_CBD,2);                   /* CBD */\n        l_current_data += 2;\n\n        opj_write_bytes(l_current_data,l_cbd_size-2,2);                 /* L_CBD */\n        l_current_data += 2;\n\n        opj_write_bytes(l_current_data,l_image->numcomps, 2);           /* Ncbd */\n        l_current_data+=2;\n\n        l_comp = l_image->comps;\n\n        for (i=0;i<l_image->numcomps;++i) {\n                opj_write_bytes(l_current_data, (l_comp->sgnd << 7) | (l_comp->prec - 1), 1);           /* Component bit depth */\n                ++l_current_data;\n\n                ++l_comp;\n        }\n\n        if (opj_stream_write_data(p_stream,p_j2k->m_specific_param.m_encoder.m_header_tile_data,l_cbd_size,p_manager) != l_cbd_size) {\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\n/**\n * Reads a CBD marker (Component bit depth definition)\n * @param       p_header_data   the data contained in the CBD box.\n * @param       p_j2k                   the jpeg2000 codec.\n * @param       p_header_size   the size of the data contained in the CBD marker.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_read_cbd (      opj_j2k_t *p_j2k,\n                                                                OPJ_BYTE * p_header_data,\n                                                                OPJ_UINT32 p_header_size,\n                                                                opj_event_mgr_t * p_manager\n                                    )\n{\n        OPJ_UINT32 l_nb_comp,l_num_comp;\n        OPJ_UINT32 l_comp_def;\n        OPJ_UINT32 i;\n        opj_image_comp_t * l_comp = 00;\n\n        /* preconditions */\n        assert(p_header_data != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        l_num_comp = p_j2k->m_private_image->numcomps;\n\n        if (p_header_size != (p_j2k->m_private_image->numcomps + 2)) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Crror reading CBD marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        opj_read_bytes(p_header_data,&l_nb_comp,2);                             /* Ncbd */\n        p_header_data+=2;\n\n        if (l_nb_comp != l_num_comp) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Crror reading CBD marker\\n\");\n                return OPJ_FALSE;\n        }\n\n        l_comp = p_j2k->m_private_image->comps;\n        for (i=0;i<l_num_comp;++i) {\n                opj_read_bytes(p_header_data,&l_comp_def,1);                    /* Component bit depth */\n                ++p_header_data;\n        l_comp->sgnd = (l_comp_def>>7) & 1;\n                l_comp->prec = (l_comp_def&0x7f) + 1;\n                ++l_comp;\n        }\n\n        return OPJ_TRUE;\n}\n\n/* ----------------------------------------------------------------------- */\n/* J2K / JPT decoder interface                                             */\n/* ----------------------------------------------------------------------- */\n\nvoid opj_j2k_setup_decoder(opj_j2k_t *j2k, opj_dparameters_t *parameters)\n{\n        if(j2k && parameters) {\n                j2k->m_cp.m_specific_param.m_dec.m_layer = parameters->cp_layer;\n                j2k->m_cp.m_specific_param.m_dec.m_reduce = parameters->cp_reduce;\n\n#ifdef USE_JPWL\n                j2k->m_cp.correct = parameters->jpwl_correct;\n                j2k->m_cp.exp_comps = parameters->jpwl_exp_comps;\n                j2k->m_cp.max_tiles = parameters->jpwl_max_tiles;\n#endif /* USE_JPWL */\n        }\n}\n\n/* ----------------------------------------------------------------------- */\n/* J2K encoder interface                                                       */\n/* ----------------------------------------------------------------------- */\n\nopj_j2k_t* opj_j2k_create_compress(void)\n{\n        opj_j2k_t *l_j2k = (opj_j2k_t*) opj_malloc(sizeof(opj_j2k_t));\n        if (!l_j2k) {\n                return NULL;\n        }\n\n        memset(l_j2k,0,sizeof(opj_j2k_t));\n\n        l_j2k->m_is_decoder = 0;\n        l_j2k->m_cp.m_is_decoder = 0;\n\n        l_j2k->m_specific_param.m_encoder.m_header_tile_data = (OPJ_BYTE *) opj_malloc(OPJ_J2K_DEFAULT_HEADER_SIZE);\n        if (! l_j2k->m_specific_param.m_encoder.m_header_tile_data) {\n                opj_j2k_destroy(l_j2k);\n                return NULL;\n        }\n\n        l_j2k->m_specific_param.m_encoder.m_header_tile_data_size = OPJ_J2K_DEFAULT_HEADER_SIZE;\n\n        /* validation list creation*/\n        l_j2k->m_validation_list = opj_procedure_list_create();\n        if (! l_j2k->m_validation_list) {\n                opj_j2k_destroy(l_j2k);\n                return NULL;\n        }\n\n        /* execution list creation*/\n        l_j2k->m_procedure_list = opj_procedure_list_create();\n        if (! l_j2k->m_procedure_list) {\n                opj_j2k_destroy(l_j2k);\n                return NULL;\n        }\n\n        return l_j2k;\n}\n\nint opj_j2k_initialise_4K_poc(opj_poc_t *POC, int numres){\n    POC[0].tile  = 1;\n    POC[0].resno0  = 0;\n    POC[0].compno0 = 0;\n    POC[0].layno1  = 1;\n    POC[0].resno1  = (OPJ_UINT32)(numres-1);\n    POC[0].compno1 = 3;\n    POC[0].prg1 = OPJ_CPRL;\n    POC[1].tile  = 1;\n    POC[1].resno0  = (OPJ_UINT32)(numres-1);\n    POC[1].compno0 = 0;\n    POC[1].layno1  = 1;\n    POC[1].resno1  = (OPJ_UINT32)numres;\n    POC[1].compno1 = 3;\n    POC[1].prg1 = OPJ_CPRL;\n    return 2;\n}\n\nvoid opj_j2k_set_cinema_parameters(opj_cparameters_t *parameters, opj_image_t *image, opj_event_mgr_t *p_manager)\n{\n    /* Configure cinema parameters */\n    int i;\n\n    /* No tiling */\n    parameters->tile_size_on = OPJ_FALSE;\n    parameters->cp_tdx=1;\n    parameters->cp_tdy=1;\n\n    /* One tile part for each component */\n    parameters->tp_flag = 'C';\n    parameters->tp_on = 1;\n\n    /* Tile and Image shall be at (0,0) */\n    parameters->cp_tx0 = 0;\n    parameters->cp_ty0 = 0;\n    parameters->image_offset_x0 = 0;\n    parameters->image_offset_y0 = 0;\n\n    /* Codeblock size= 32*32 */\n    parameters->cblockw_init = 32;\n    parameters->cblockh_init = 32;\n\n    /* Codeblock style: no mode switch enabled */\n    parameters->mode = 0;\n\n    /* No ROI */\n    parameters->roi_compno = -1;\n\n    /* No subsampling */\n    parameters->subsampling_dx = 1;\n    parameters->subsampling_dy = 1;\n\n    /* 9-7 transform */\n    parameters->irreversible = 1;\n\n    /* Number of layers */\n    if (parameters->tcp_numlayers > 1){\n        opj_event_msg(p_manager, EVT_WARNING,\n                \"JPEG 2000 Profile-3 and 4 (2k/4k dc profile) requires:\\n\"\n                \"1 single quality layer\"\n                \"-> Number of layers forced to 1 (rather than %d)\\n\"\n                \"-> Rate of the last layer (%3.1f) will be used\",\n                parameters->tcp_numlayers, parameters->tcp_rates[parameters->tcp_numlayers-1]);\n        parameters->tcp_rates[0] = parameters->tcp_rates[parameters->tcp_numlayers-1];\n        parameters->tcp_numlayers = 1;\n    }\n\n    /* Resolution levels */\n    switch (parameters->rsiz){\n    case OPJ_PROFILE_CINEMA_2K:\n        if(parameters->numresolution > 6){\n            opj_event_msg(p_manager, EVT_WARNING,\n                    \"JPEG 2000 Profile-3 (2k dc profile) requires:\\n\"\n                    \"Number of decomposition levels <= 5\\n\"\n                    \"-> Number of decomposition levels forced to 5 (rather than %d)\\n\",\n                    parameters->numresolution+1);\n            parameters->numresolution = 6;\n        }\n        break;\n    case OPJ_PROFILE_CINEMA_4K:\n        if(parameters->numresolution < 2){\n            opj_event_msg(p_manager, EVT_WARNING,\n                    \"JPEG 2000 Profile-4 (4k dc profile) requires:\\n\"\n                    \"Number of decomposition levels >= 1 && <= 6\\n\"\n                    \"-> Number of decomposition levels forced to 1 (rather than %d)\\n\",\n                    parameters->numresolution+1);\n            parameters->numresolution = 1;\n        }else if(parameters->numresolution > 7){\n            opj_event_msg(p_manager, EVT_WARNING,\n                    \"JPEG 2000 Profile-4 (4k dc profile) requires:\\n\"\n                    \"Number of decomposition levels >= 1 && <= 6\\n\"\n                    \"-> Number of decomposition levels forced to 6 (rather than %d)\\n\",\n                    parameters->numresolution+1);\n            parameters->numresolution = 7;\n        }\n        break;\n    default :\n        break;\n    }\n\n    /* Precincts */\n    parameters->csty |= 0x01;\n    parameters->res_spec = parameters->numresolution-1;\n    for (i = 0; i<parameters->res_spec; i++) {\n        parameters->prcw_init[i] = 256;\n        parameters->prch_init[i] = 256;\n    }\n\n    /* The progression order shall be CPRL */\n    parameters->prog_order = OPJ_CPRL;\n\n    /* Progression order changes for 4K, disallowed for 2K */\n    if (parameters->rsiz == OPJ_PROFILE_CINEMA_4K) {\n        parameters->numpocs = (OPJ_UINT32)opj_j2k_initialise_4K_poc(parameters->POC,parameters->numresolution);\n    } else {\n        parameters->numpocs = 0;\n    }\n\n    /* Limited bit-rate */\n    parameters->cp_disto_alloc = 1;\n    if (parameters->max_cs_size <= 0) {\n        /* No rate has been introduced, 24 fps is assumed */\n        parameters->max_cs_size = OPJ_CINEMA_24_CS;\n        opj_event_msg(p_manager, EVT_WARNING,\n                      \"JPEG 2000 Profile-3 and 4 (2k/4k dc profile) requires:\\n\"\n                      \"Maximum 1302083 compressed bytes @ 24fps\\n\"\n                      \"As no rate has been given, this limit will be used.\\n\");\n    } else if (parameters->max_cs_size > OPJ_CINEMA_24_CS) {\n        opj_event_msg(p_manager, EVT_WARNING,\n                      \"JPEG 2000 Profile-3 and 4 (2k/4k dc profile) requires:\\n\"\n                      \"Maximum 1302083 compressed bytes @ 24fps\\n\"\n                      \"-> Specified rate exceeds this limit. Rate will be forced to 1302083 bytes.\\n\");\n        parameters->max_cs_size = OPJ_CINEMA_24_CS;\n    }\n\n    if (parameters->max_comp_size <= 0) {\n        /* No rate has been introduced, 24 fps is assumed */\n        parameters->max_comp_size = OPJ_CINEMA_24_COMP;\n        opj_event_msg(p_manager, EVT_WARNING,\n                      \"JPEG 2000 Profile-3 and 4 (2k/4k dc profile) requires:\\n\"\n                      \"Maximum 1041666 compressed bytes @ 24fps\\n\"\n                      \"As no rate has been given, this limit will be used.\\n\");\n    } else if (parameters->max_comp_size > OPJ_CINEMA_24_COMP) {\n        opj_event_msg(p_manager, EVT_WARNING,\n                      \"JPEG 2000 Profile-3 and 4 (2k/4k dc profile) requires:\\n\"\n                      \"Maximum 1041666 compressed bytes @ 24fps\\n\"\n                      \"-> Specified rate exceeds this limit. Rate will be forced to 1041666 bytes.\\n\");\n        parameters->max_comp_size = OPJ_CINEMA_24_COMP;\n    }\n\n    parameters->tcp_rates[0] = (OPJ_FLOAT32) (image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec)/\n            (OPJ_FLOAT32)(((OPJ_UINT32)parameters->max_cs_size) * 8 * image->comps[0].dx * image->comps[0].dy);\n\n}\n\nOPJ_BOOL opj_j2k_is_cinema_compliant(opj_image_t *image, OPJ_UINT16 rsiz, opj_event_mgr_t *p_manager)\n{\n    OPJ_UINT32 i;\n\n    /* Number of components */\n    if (image->numcomps != 3){\n        opj_event_msg(p_manager, EVT_WARNING,\n                \"JPEG 2000 Profile-3 (2k dc profile) requires:\\n\"\n                \"3 components\"\n                \"-> Number of components of input image (%d) is not compliant\\n\"\n                \"-> Non-profile-3 codestream will be generated\\n\",\n                image->numcomps);\n        return OPJ_FALSE;\n    }\n\n    /* Bitdepth */\n    for (i = 0; i < image->numcomps; i++) {\n        if ((image->comps[i].bpp != 12) | (image->comps[i].sgnd)){\n            char signed_str[] = \"signed\";\n            char unsigned_str[] = \"unsigned\";\n            char *tmp_str = image->comps[i].sgnd?signed_str:unsigned_str;\n            opj_event_msg(p_manager, EVT_WARNING,\n                    \"JPEG 2000 Profile-3 (2k dc profile) requires:\\n\"\n                    \"Precision of each component shall be 12 bits unsigned\"\n                    \"-> At least component %d of input image (%d bits, %s) is not compliant\\n\"\n                    \"-> Non-profile-3 codestream will be generated\\n\",\n                    i,image->comps[i].bpp, tmp_str);\n            return OPJ_FALSE;\n        }\n    }\n\n    /* Image size */\n    switch (rsiz){\n    case OPJ_PROFILE_CINEMA_2K:\n        if (((image->comps[0].w > 2048) | (image->comps[0].h > 1080))){\n            opj_event_msg(p_manager, EVT_WARNING,\n                    \"JPEG 2000 Profile-3 (2k dc profile) requires:\\n\"\n                    \"width <= 2048 and height <= 1080\\n\"\n                    \"-> Input image size %d x %d is not compliant\\n\"\n                    \"-> Non-profile-3 codestream will be generated\\n\",\n                    image->comps[0].w,image->comps[0].h);\n            return OPJ_FALSE;\n        }\n        break;\n    case OPJ_PROFILE_CINEMA_4K:\n        if (((image->comps[0].w > 4096) | (image->comps[0].h > 2160))){\n            opj_event_msg(p_manager, EVT_WARNING,\n                    \"JPEG 2000 Profile-4 (4k dc profile) requires:\\n\"\n                    \"width <= 4096 and height <= 2160\\n\"\n                    \"-> Image size %d x %d is not compliant\\n\"\n                    \"-> Non-profile-4 codestream will be generated\\n\",\n                    image->comps[0].w,image->comps[0].h);\n            return OPJ_FALSE;\n        }\n        break;\n    default :\n        break;\n    }\n\n    return OPJ_TRUE;\n}\n\nvoid opj_j2k_setup_encoder(     opj_j2k_t *p_j2k,\n                                                    opj_cparameters_t *parameters,\n                                                    opj_image_t *image,\n                                                    opj_event_mgr_t * p_manager)\n{\n        OPJ_UINT32 i, j, tileno, numpocs_tile;\n        opj_cp_t *cp = 00;\n\n        if(!p_j2k || !parameters || ! image) {\n                return;\n        }\n\n        /* keep a link to cp so that we can destroy it later in j2k_destroy_compress */\n        cp = &(p_j2k->m_cp);\n\n        /* set default values for cp */\n        cp->tw = 1;\n        cp->th = 1;\n\n        /* FIXME ADE: to be removed once deprecated cp_cinema and cp_rsiz have been removed */\n        if (parameters->rsiz == OPJ_PROFILE_NONE) { /* consider deprecated fields only if RSIZ has not been set */\n            OPJ_BOOL deprecated_used = OPJ_FALSE;\n            switch (parameters->cp_cinema){\n            case OPJ_CINEMA2K_24:\n                parameters->rsiz = OPJ_PROFILE_CINEMA_2K;\n                parameters->max_cs_size = OPJ_CINEMA_24_CS;\n                parameters->max_comp_size = OPJ_CINEMA_24_COMP;\n                deprecated_used = OPJ_TRUE;\n                break;\n            case OPJ_CINEMA2K_48:\n                parameters->rsiz = OPJ_PROFILE_CINEMA_2K;\n                parameters->max_cs_size = OPJ_CINEMA_48_CS;\n                parameters->max_comp_size = OPJ_CINEMA_48_COMP;\n                deprecated_used = OPJ_TRUE;\n                break;\n            case OPJ_CINEMA4K_24:\n                parameters->rsiz = OPJ_PROFILE_CINEMA_4K;\n                parameters->max_cs_size = OPJ_CINEMA_24_CS;\n                parameters->max_comp_size = OPJ_CINEMA_24_COMP;\n                deprecated_used = OPJ_TRUE;\n                break;\n            case OPJ_OFF:\n            default:\n                break;\n            }\n            switch (parameters->cp_rsiz){\n            case OPJ_CINEMA2K:\n                parameters->rsiz = OPJ_PROFILE_CINEMA_2K;\n                deprecated_used = OPJ_TRUE;\n                break;\n            case OPJ_CINEMA4K:\n                parameters->rsiz = OPJ_PROFILE_CINEMA_4K;\n                deprecated_used = OPJ_TRUE;\n                break;\n            case OPJ_MCT:\n                parameters->rsiz = OPJ_PROFILE_PART2 | OPJ_EXTENSION_MCT;\n                deprecated_used = OPJ_TRUE;\n            case OPJ_STD_RSIZ:\n            default:\n                break;\n            }\n            if (deprecated_used) {\n                opj_event_msg(p_manager, EVT_WARNING,\n                        \"Deprecated fields cp_cinema or cp_rsiz are used\\n\"\n                        \"Please consider using only the rsiz field\\n\"\n                        \"See openjpeg.h documentation for more details\\n\");\n            }\n        }\n\n        /* see if max_codestream_size does limit input rate */\n        if (parameters->max_cs_size <= 0) {\n            if (parameters->tcp_rates[parameters->tcp_numlayers-1] > 0) {\n                OPJ_FLOAT32 temp_size;\n                temp_size =(OPJ_FLOAT32)(image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec)/\n                        (parameters->tcp_rates[parameters->tcp_numlayers-1] * 8 * (OPJ_FLOAT32)image->comps[0].dx * (OPJ_FLOAT32)image->comps[0].dy);\n                parameters->max_cs_size = (int) floor(temp_size);\n            } else {\n                parameters->max_cs_size = 0;\n            }\n        } else {\n            OPJ_FLOAT32 temp_rate;\n            OPJ_BOOL cap = OPJ_FALSE;\n            temp_rate = (OPJ_FLOAT32) (image->numcomps * image->comps[0].w * image->comps[0].h * image->comps[0].prec)/\n                    (OPJ_FLOAT32)(((OPJ_UINT32)parameters->max_cs_size) * 8 * image->comps[0].dx * image->comps[0].dy);\n            for (i = 0; i < (OPJ_UINT32) parameters->tcp_numlayers; i++) {\n                if (parameters->tcp_rates[i] < temp_rate) {\n                    parameters->tcp_rates[i] = temp_rate;\n                    cap = OPJ_TRUE;\n                }\n            }\n            if (cap) {\n                opj_event_msg(p_manager, EVT_WARNING,\n                        \"The desired maximum codestream size has limited\\n\"\n                        \"at least one of the desired quality layers\\n\");\n            }\n        }\n\n        /* Manage profiles and applications and set RSIZ */\n        /* set cinema parameters if required */\n        if (OPJ_IS_CINEMA(parameters->rsiz)){\n            if ((parameters->rsiz == OPJ_PROFILE_CINEMA_S2K)\n                    || (parameters->rsiz == OPJ_PROFILE_CINEMA_S4K)){\n                opj_event_msg(p_manager, EVT_WARNING,\n                        \"JPEG 2000 Scalable Digital Cinema profiles not yet supported\\n\");\n                parameters->rsiz = OPJ_PROFILE_NONE;\n            } else {\n                opj_j2k_set_cinema_parameters(parameters,image,p_manager);\n                if (!opj_j2k_is_cinema_compliant(image,parameters->rsiz,p_manager)) {\n                    parameters->rsiz = OPJ_PROFILE_NONE;\n                }\n            }\n        } else if (OPJ_IS_STORAGE(parameters->rsiz)) {\n            opj_event_msg(p_manager, EVT_WARNING,\n                    \"JPEG 2000 Long Term Storage profile not yet supported\\n\");\n            parameters->rsiz = OPJ_PROFILE_NONE;\n        } else if (OPJ_IS_BROADCAST(parameters->rsiz)) {\n            opj_event_msg(p_manager, EVT_WARNING,\n                    \"JPEG 2000 Broadcast profiles not yet supported\\n\");\n            parameters->rsiz = OPJ_PROFILE_NONE;\n        } else if (OPJ_IS_IMF(parameters->rsiz)) {\n            opj_event_msg(p_manager, EVT_WARNING,\n                    \"JPEG 2000 IMF profiles not yet supported\\n\");\n            parameters->rsiz = OPJ_PROFILE_NONE;\n        } else if (OPJ_IS_PART2(parameters->rsiz)) {\n            if (parameters->rsiz == ((OPJ_PROFILE_PART2) | (OPJ_EXTENSION_NONE))) {\n                opj_event_msg(p_manager, EVT_WARNING,\n                              \"JPEG 2000 Part-2 profile defined\\n\"\n                              \"but no Part-2 extension enabled.\\n\"\n                              \"Profile set to NONE.\\n\");\n                parameters->rsiz = OPJ_PROFILE_NONE;\n            } else if (parameters->rsiz != ((OPJ_PROFILE_PART2) | (OPJ_EXTENSION_MCT))) {\n                opj_event_msg(p_manager, EVT_WARNING,\n                              \"Unsupported Part-2 extension enabled\\n\"\n                              \"Profile set to NONE.\\n\");\n                parameters->rsiz = OPJ_PROFILE_NONE;\n            }\n        }\n\n        /*\n        copy user encoding parameters\n        */\n        cp->m_specific_param.m_enc.m_max_comp_size = (OPJ_UINT32)parameters->max_comp_size;\n        cp->rsiz = parameters->rsiz;\n        cp->m_specific_param.m_enc.m_disto_alloc = (OPJ_UINT32)parameters->cp_disto_alloc & 1u;\n        cp->m_specific_param.m_enc.m_fixed_alloc = (OPJ_UINT32)parameters->cp_fixed_alloc & 1u;\n        cp->m_specific_param.m_enc.m_fixed_quality = (OPJ_UINT32)parameters->cp_fixed_quality & 1u;\n\n        /* mod fixed_quality */\n        if (parameters->cp_fixed_alloc && parameters->cp_matrice) {\n                size_t array_size = (size_t)parameters->tcp_numlayers * (size_t)parameters->numresolution * 3 * sizeof(OPJ_INT32);\n                cp->m_specific_param.m_enc.m_matrice = (OPJ_INT32 *) opj_malloc(array_size);\n                memcpy(cp->m_specific_param.m_enc.m_matrice, parameters->cp_matrice, array_size);\n        }\n\n        /* tiles */\n        cp->tdx = (OPJ_UINT32)parameters->cp_tdx;\n        cp->tdy = (OPJ_UINT32)parameters->cp_tdy;\n\n        /* tile offset */\n        cp->tx0 = (OPJ_UINT32)parameters->cp_tx0;\n        cp->ty0 = (OPJ_UINT32)parameters->cp_ty0;\n\n        /* comment string */\n        if(parameters->cp_comment) {\n                cp->comment = (char*)opj_malloc(strlen(parameters->cp_comment) + 1);\n                if(cp->comment) {\n                        strcpy(cp->comment, parameters->cp_comment);\n                }\n        }\n\n        /*\n        calculate other encoding parameters\n        */\n\n        if (parameters->tile_size_on) {\n                cp->tw = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)(image->x1 - cp->tx0), (OPJ_INT32)cp->tdx);\n                cp->th = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)(image->y1 - cp->ty0), (OPJ_INT32)cp->tdy);\n        } else {\n                cp->tdx = image->x1 - cp->tx0;\n                cp->tdy = image->y1 - cp->ty0;\n        }\n\n        if (parameters->tp_on) {\n                cp->m_specific_param.m_enc.m_tp_flag = (OPJ_BYTE)parameters->tp_flag;\n                cp->m_specific_param.m_enc.m_tp_on = 1;\n        }\n\n#ifdef USE_JPWL\n        /*\n        calculate JPWL encoding parameters\n        */\n\n        if (parameters->jpwl_epc_on) {\n                OPJ_INT32 i;\n\n                /* set JPWL on */\n                cp->epc_on = OPJ_TRUE;\n                cp->info_on = OPJ_FALSE; /* no informative technique */\n\n                /* set EPB on */\n                if ((parameters->jpwl_hprot_MH > 0) || (parameters->jpwl_hprot_TPH[0] > 0)) {\n                        cp->epb_on = OPJ_TRUE;\n\n                        cp->hprot_MH = parameters->jpwl_hprot_MH;\n                        for (i = 0; i < JPWL_MAX_NO_TILESPECS; i++) {\n                                cp->hprot_TPH_tileno[i] = parameters->jpwl_hprot_TPH_tileno[i];\n                                cp->hprot_TPH[i] = parameters->jpwl_hprot_TPH[i];\n                        }\n                        /* if tile specs are not specified, copy MH specs */\n                        if (cp->hprot_TPH[0] == -1) {\n                                cp->hprot_TPH_tileno[0] = 0;\n                                cp->hprot_TPH[0] = parameters->jpwl_hprot_MH;\n                        }\n                        for (i = 0; i < JPWL_MAX_NO_PACKSPECS; i++) {\n                                cp->pprot_tileno[i] = parameters->jpwl_pprot_tileno[i];\n                                cp->pprot_packno[i] = parameters->jpwl_pprot_packno[i];\n                                cp->pprot[i] = parameters->jpwl_pprot[i];\n                        }\n                }\n\n                /* set ESD writing */\n                if ((parameters->jpwl_sens_size == 1) || (parameters->jpwl_sens_size == 2)) {\n                        cp->esd_on = OPJ_TRUE;\n\n                        cp->sens_size = parameters->jpwl_sens_size;\n                        cp->sens_addr = parameters->jpwl_sens_addr;\n                        cp->sens_range = parameters->jpwl_sens_range;\n\n                        cp->sens_MH = parameters->jpwl_sens_MH;\n                        for (i = 0; i < JPWL_MAX_NO_TILESPECS; i++) {\n                                cp->sens_TPH_tileno[i] = parameters->jpwl_sens_TPH_tileno[i];\n                                cp->sens_TPH[i] = parameters->jpwl_sens_TPH[i];\n                        }\n                }\n\n                /* always set RED writing to false: we are at the encoder */\n                cp->red_on = OPJ_FALSE;\n\n        } else {\n                cp->epc_on = OPJ_FALSE;\n        }\n#endif /* USE_JPWL */\n\n        /* initialize the mutiple tiles */\n        /* ---------------------------- */\n        cp->tcps = (opj_tcp_t*) opj_calloc(cp->tw * cp->th, sizeof(opj_tcp_t));\n        if (parameters->numpocs) {\n                /* initialisation of POC */\n                opj_j2k_check_poc_val(parameters->POC,parameters->numpocs, (OPJ_UINT32)parameters->numresolution, image->numcomps, (OPJ_UINT32)parameters->tcp_numlayers, p_manager);\n                /* TODO MSD use the return value*/\n        }\n\n        for (tileno = 0; tileno < cp->tw * cp->th; tileno++) {\n                opj_tcp_t *tcp = &cp->tcps[tileno];\n                tcp->numlayers = (OPJ_UINT32)parameters->tcp_numlayers;\n\n                for (j = 0; j < tcp->numlayers; j++) {\n                        if(OPJ_IS_CINEMA(cp->rsiz)){\n                                if (cp->m_specific_param.m_enc.m_fixed_quality) {\n                                        tcp->distoratio[j] = parameters->tcp_distoratio[j];\n                                }\n                                tcp->rates[j] = parameters->tcp_rates[j];\n                        }else{\n                                if (cp->m_specific_param.m_enc.m_fixed_quality) {       /* add fixed_quality */\n                                        tcp->distoratio[j] = parameters->tcp_distoratio[j];\n                                } else {\n                                        tcp->rates[j] = parameters->tcp_rates[j];\n                                }\n                        }\n                }\n\n                tcp->csty = (OPJ_UINT32)parameters->csty;\n                tcp->prg = parameters->prog_order;\n                tcp->mct = (OPJ_UINT32)parameters->tcp_mct;\n\n                numpocs_tile = 0;\n                tcp->POC = 0;\n\n                if (parameters->numpocs) {\n                        /* initialisation of POC */\n                        tcp->POC = 1;\n                        for (i = 0; i < parameters->numpocs; i++) {\n                                if (tileno + 1 == parameters->POC[i].tile )  {\n                                        opj_poc_t *tcp_poc = &tcp->pocs[numpocs_tile];\n\n                                        tcp_poc->resno0         = parameters->POC[numpocs_tile].resno0;\n                                        tcp_poc->compno0        = parameters->POC[numpocs_tile].compno0;\n                                        tcp_poc->layno1         = parameters->POC[numpocs_tile].layno1;\n                                        tcp_poc->resno1         = parameters->POC[numpocs_tile].resno1;\n                                        tcp_poc->compno1        = parameters->POC[numpocs_tile].compno1;\n                                        tcp_poc->prg1           = parameters->POC[numpocs_tile].prg1;\n                                        tcp_poc->tile           = parameters->POC[numpocs_tile].tile;\n\n                                        numpocs_tile++;\n                                }\n                        }\n\n                        tcp->numpocs = numpocs_tile -1 ;\n                }else{\n                        tcp->numpocs = 0;\n                }\n\n                tcp->tccps = (opj_tccp_t*) opj_calloc(image->numcomps, sizeof(opj_tccp_t));\n\n                if (parameters->mct_data) {\n                      \n                    OPJ_UINT32 lMctSize = image->numcomps * image->numcomps * (OPJ_UINT32)sizeof(OPJ_FLOAT32);\n                    OPJ_FLOAT32 * lTmpBuf = (OPJ_FLOAT32*)opj_malloc(lMctSize);\n                    OPJ_INT32 * l_dc_shift = (OPJ_INT32 *) ((OPJ_BYTE *) parameters->mct_data + lMctSize);\n\n                    tcp->mct = 2;\n                    tcp->m_mct_coding_matrix = (OPJ_FLOAT32*)opj_malloc(lMctSize);\n                    memcpy(tcp->m_mct_coding_matrix,parameters->mct_data,lMctSize);\n                    memcpy(lTmpBuf,parameters->mct_data,lMctSize);\n\n                    tcp->m_mct_decoding_matrix = (OPJ_FLOAT32*)opj_malloc(lMctSize);\n                    assert(opj_matrix_inversion_f(lTmpBuf,(tcp->m_mct_decoding_matrix),image->numcomps));\n\n                    tcp->mct_norms = (OPJ_FLOAT64*)\n                                    opj_malloc(image->numcomps * sizeof(OPJ_FLOAT64));\n\n                    opj_calculate_norms(tcp->mct_norms,image->numcomps,tcp->m_mct_decoding_matrix);\n                    opj_free(lTmpBuf);\n\n                    for (i = 0; i < image->numcomps; i++) {\n                            opj_tccp_t *tccp = &tcp->tccps[i];\n                            tccp->m_dc_level_shift = l_dc_shift[i];\n                    }\n\n                    opj_j2k_setup_mct_encoding(tcp,image);                        \n                }\n                else {\n                        for (i = 0; i < image->numcomps; i++) {\n                                opj_tccp_t *tccp = &tcp->tccps[i];\n                                opj_image_comp_t * l_comp = &(image->comps[i]);\n\n                                if (! l_comp->sgnd) {\n                                        tccp->m_dc_level_shift = 1 << (l_comp->prec - 1);\n                                }\n                        }\n                }\n\n                for (i = 0; i < image->numcomps; i++) {\n                        opj_tccp_t *tccp = &tcp->tccps[i];\n\n                        tccp->csty = parameters->csty & 0x01;   /* 0 => one precinct || 1 => custom precinct  */\n                        tccp->numresolutions = (OPJ_UINT32)parameters->numresolution;\n                        tccp->cblkw = (OPJ_UINT32)opj_int_floorlog2(parameters->cblockw_init);\n                        tccp->cblkh = (OPJ_UINT32)opj_int_floorlog2(parameters->cblockh_init);\n                        tccp->cblksty = (OPJ_UINT32)parameters->mode;\n                        tccp->qmfbid = parameters->irreversible ? 0 : 1;\n                        tccp->qntsty = parameters->irreversible ? J2K_CCP_QNTSTY_SEQNT : J2K_CCP_QNTSTY_NOQNT;\n                        tccp->numgbits = 2;\n\n                        if ((OPJ_INT32)i == parameters->roi_compno) {\n                                tccp->roishift = parameters->roi_shift;\n                        } else {\n                                tccp->roishift = 0;\n                        }\n\n                                if (parameters->csty & J2K_CCP_CSTY_PRT) {\n                                        OPJ_INT32 p = 0, it_res;\n                                        assert( tccp->numresolutions > 0 );\n                                        for (it_res = (OPJ_INT32)tccp->numresolutions - 1; it_res >= 0; it_res--) {\n                                                if (p < parameters->res_spec) {\n\n                                                        if (parameters->prcw_init[p] < 1) {\n                                                                tccp->prcw[it_res] = 1;\n                                                        } else {\n                                                                tccp->prcw[it_res] = (OPJ_UINT32)opj_int_floorlog2(parameters->prcw_init[p]);\n                                                        }\n\n                                                        if (parameters->prch_init[p] < 1) {\n                                                                tccp->prch[it_res] = 1;\n                                                        }else {\n                                                                tccp->prch[it_res] = (OPJ_UINT32)opj_int_floorlog2(parameters->prch_init[p]);\n                                                        }\n\n                                                } else {\n                                                        OPJ_INT32 res_spec = parameters->res_spec;\n                                                        OPJ_INT32 size_prcw = 0;\n                                                        OPJ_INT32 size_prch = 0;\n\n                                                        assert(res_spec>0); /* issue 189 */\n                                                        size_prcw = parameters->prcw_init[res_spec - 1] >> (p - (res_spec - 1));\n                                                        size_prch = parameters->prch_init[res_spec - 1] >> (p - (res_spec - 1));\n\n\n                                                        if (size_prcw < 1) {\n                                                                tccp->prcw[it_res] = 1;\n                                                        } else {\n                                                                tccp->prcw[it_res] = (OPJ_UINT32)opj_int_floorlog2(size_prcw);\n                                                        }\n\n                                                        if (size_prch < 1) {\n                                                                tccp->prch[it_res] = 1;\n                                                        } else {\n                                                                tccp->prch[it_res] = (OPJ_UINT32)opj_int_floorlog2(size_prch);\n                                                        }\n                                                }\n                                                p++;\n                                                /*printf(\"\\nsize precinct for level %d : %d,%d\\n\", it_res,tccp->prcw[it_res], tccp->prch[it_res]); */\n                                        }       /*end for*/\n                                } else {\n                                        for (j = 0; j < tccp->numresolutions; j++) {\n                                                tccp->prcw[j] = 15;\n                                                tccp->prch[j] = 15;\n                                        }\n                                }\n\n                        opj_dwt_calc_explicit_stepsizes(tccp, image->comps[i].prec);\n                }\n        }\n\n        if (parameters->mct_data) {\n                opj_free(parameters->mct_data);\n                parameters->mct_data = 00;\n        }\n}\n\nstatic OPJ_BOOL opj_j2k_add_mhmarker(opj_codestream_index_t *cstr_index, OPJ_UINT32 type, OPJ_OFF_T pos, OPJ_UINT32 len)\n{\n        assert(cstr_index != 00);\n\n        /* expand the list? */\n        if ((cstr_index->marknum + 1) > cstr_index->maxmarknum) {\n                opj_marker_info_t *new_marker;\n                cstr_index->maxmarknum = (OPJ_UINT32)(100 + (OPJ_FLOAT32) cstr_index->maxmarknum);\n                new_marker = (opj_marker_info_t *) opj_realloc(cstr_index->marker, cstr_index->maxmarknum *sizeof(opj_marker_info_t));\n                if (! new_marker) {\n                        opj_free(cstr_index->marker);\n                        cstr_index->marker = NULL;\n                        cstr_index->maxmarknum = 0;\n                        cstr_index->marknum = 0;\n                        /* opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to add mh marker\\n\"); */\n                        return OPJ_FALSE;\n                }\n                cstr_index->marker = new_marker;\n        }\n\n        /* add the marker */\n        cstr_index->marker[cstr_index->marknum].type = (OPJ_UINT16)type;\n        cstr_index->marker[cstr_index->marknum].pos = (OPJ_INT32)pos;\n        cstr_index->marker[cstr_index->marknum].len = (OPJ_INT32)len;\n        cstr_index->marknum++;\n        return OPJ_TRUE;\n}\n\nstatic OPJ_BOOL opj_j2k_add_tlmarker(OPJ_UINT32 tileno, opj_codestream_index_t *cstr_index, OPJ_UINT32 type, OPJ_OFF_T pos, OPJ_UINT32 len)\n{\n        assert(cstr_index != 00);\n        assert(cstr_index->tile_index != 00);\n\n        /* expand the list? */\n        if ((cstr_index->tile_index[tileno].marknum + 1) > cstr_index->tile_index[tileno].maxmarknum) {\n                opj_marker_info_t *new_marker;\n                cstr_index->tile_index[tileno].maxmarknum = (OPJ_UINT32)(100 + (OPJ_FLOAT32) cstr_index->tile_index[tileno].maxmarknum);\n                new_marker = (opj_marker_info_t *) opj_realloc(\n                                cstr_index->tile_index[tileno].marker,\n                                cstr_index->tile_index[tileno].maxmarknum *sizeof(opj_marker_info_t));\n                if (! new_marker) {\n                        opj_free(cstr_index->tile_index[tileno].marker);\n                        cstr_index->tile_index[tileno].marker = NULL;\n                        cstr_index->tile_index[tileno].maxmarknum = 0;\n                        cstr_index->tile_index[tileno].marknum = 0;\n                        /* opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to add tl marker\\n\"); */\n                        return OPJ_FALSE;\n                }\n                cstr_index->tile_index[tileno].marker = new_marker;\n        }\n\n        /* add the marker */\n        cstr_index->tile_index[tileno].marker[cstr_index->tile_index[tileno].marknum].type = (OPJ_UINT16)type;\n        cstr_index->tile_index[tileno].marker[cstr_index->tile_index[tileno].marknum].pos = (OPJ_INT32)pos;\n        cstr_index->tile_index[tileno].marker[cstr_index->tile_index[tileno].marknum].len = (OPJ_INT32)len;\n        cstr_index->tile_index[tileno].marknum++;\n\n        if (type == J2K_MS_SOT) {\n                OPJ_UINT32 l_current_tile_part = cstr_index->tile_index[tileno].current_tpsno;\n\n                if (cstr_index->tile_index[tileno].tp_index)\n                        cstr_index->tile_index[tileno].tp_index[l_current_tile_part].start_pos = pos;\n\n        }\n        return OPJ_TRUE;\n}\n\n/*\n * -----------------------------------------------------------------------\n * -----------------------------------------------------------------------\n * -----------------------------------------------------------------------\n */\n\nOPJ_BOOL opj_j2k_end_decompress(opj_j2k_t *p_j2k,\n                                opj_stream_private_t *p_stream,\n                                opj_event_mgr_t * p_manager\n                                )\n{\n    (void)p_j2k;\n    (void)p_stream;\n    (void)p_manager;\n    return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_read_header(   opj_stream_private_t *p_stream,\n                                                            opj_j2k_t* p_j2k,\n                                                            opj_image_t** p_image,\n                                                            opj_event_mgr_t* p_manager )\n{\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_stream != 00);\n        assert(p_manager != 00);\n\n        /* create an empty image header */\n        p_j2k->m_private_image = opj_image_create0();\n        if (! p_j2k->m_private_image) {\n                return OPJ_FALSE;\n        }\n\n        /* customization of the validation */\n        opj_j2k_setup_decoding_validation(p_j2k);\n\n        /* validation of the parameters codec */\n        if (! opj_j2k_exec(p_j2k, p_j2k->m_validation_list, p_stream,p_manager)) {\n                opj_image_destroy(p_j2k->m_private_image);\n                p_j2k->m_private_image = NULL;\n                return OPJ_FALSE;\n        }\n\n        /* customization of the encoding */\n        opj_j2k_setup_header_reading(p_j2k);\n\n        /* read header */\n        if (! opj_j2k_exec (p_j2k,p_j2k->m_procedure_list,p_stream,p_manager)) {\n                opj_image_destroy(p_j2k->m_private_image);\n                p_j2k->m_private_image = NULL;\n                return OPJ_FALSE;\n        }\n\n        *p_image = opj_image_create0();\n        if (! (*p_image)) {\n                return OPJ_FALSE;\n        }\n\n        /* Copy codestream image information to the output image */\n        opj_copy_image_header(p_j2k->m_private_image, *p_image);\n\n    /*Allocate and initialize some elements of codestrem index*/\n        if (!opj_j2k_allocate_tile_element_cstr_index(p_j2k)){\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\nvoid opj_j2k_setup_header_reading (opj_j2k_t *p_j2k)\n{\n        /* preconditions*/\n        assert(p_j2k != 00);\n\n        opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_read_header_procedure);\n\n        /* DEVELOPER CORNER, add your custom procedures */\n        opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_copy_default_tcp_and_create_tcd);\n\n}\n\nvoid opj_j2k_setup_decoding_validation (opj_j2k_t *p_j2k)\n{\n        /* preconditions*/\n        assert(p_j2k != 00);\n\n        opj_procedure_list_add_procedure(p_j2k->m_validation_list, (opj_procedure)opj_j2k_build_decoder);\n        opj_procedure_list_add_procedure(p_j2k->m_validation_list, (opj_procedure)opj_j2k_decoding_validation);\n        /* DEVELOPER CORNER, add your custom validation procedure */\n\n}\n\nOPJ_BOOL opj_j2k_mct_validation (       opj_j2k_t * p_j2k,\n                                                                opj_stream_private_t *p_stream,\n                                                                opj_event_mgr_t * p_manager )\n{\n        OPJ_BOOL l_is_valid = OPJ_TRUE;\n        OPJ_UINT32 i,j;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_stream != 00);\n        assert(p_manager != 00);\n\n        if ((p_j2k->m_cp.rsiz & 0x8200) == 0x8200) {\n                OPJ_UINT32 l_nb_tiles = p_j2k->m_cp.th * p_j2k->m_cp.tw;\n                opj_tcp_t * l_tcp = p_j2k->m_cp.tcps;\n\n                for (i=0;i<l_nb_tiles;++i) {\n                        if (l_tcp->mct == 2) {\n                                opj_tccp_t * l_tccp = l_tcp->tccps;\n                                l_is_valid &= (l_tcp->m_mct_coding_matrix != 00);\n\n                                for (j=0;j<p_j2k->m_private_image->numcomps;++j) {\n                                        l_is_valid &= ! (l_tccp->qmfbid & 1);\n                                        ++l_tccp;\n                                }\n                        }\n                        ++l_tcp;\n                }\n        }\n\n        return l_is_valid;\n}\n\nOPJ_BOOL opj_j2k_setup_mct_encoding(opj_tcp_t * p_tcp, opj_image_t * p_image)\n{\n        OPJ_UINT32 i;\n        OPJ_UINT32 l_indix = 1;\n        opj_mct_data_t * l_mct_deco_data = 00,* l_mct_offset_data = 00;\n        opj_simple_mcc_decorrelation_data_t * l_mcc_data;\n        OPJ_UINT32 l_mct_size,l_nb_elem;\n        OPJ_FLOAT32 * l_data, * l_current_data;\n        opj_tccp_t * l_tccp;\n\n        /* preconditions */\n        assert(p_tcp != 00);\n\n        if (p_tcp->mct != 2) {\n                return OPJ_TRUE;\n        }\n\n        if (p_tcp->m_mct_decoding_matrix) {\n                if (p_tcp->m_nb_mct_records == p_tcp->m_nb_max_mct_records) {\n                        opj_mct_data_t *new_mct_records;\n                        p_tcp->m_nb_max_mct_records += OPJ_J2K_MCT_DEFAULT_NB_RECORDS;\n\n                        new_mct_records = (opj_mct_data_t *) opj_realloc(p_tcp->m_mct_records, p_tcp->m_nb_max_mct_records * sizeof(opj_mct_data_t));\n                        if (! new_mct_records) {\n                                opj_free(p_tcp->m_mct_records);\n                                p_tcp->m_mct_records = NULL;\n                                p_tcp->m_nb_max_mct_records = 0;\n                                p_tcp->m_nb_mct_records = 0;\n                                /* opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to setup mct encoding\\n\"); */\n                                return OPJ_FALSE;\n                        }\n                        p_tcp->m_mct_records = new_mct_records;\n                        l_mct_deco_data = p_tcp->m_mct_records + p_tcp->m_nb_mct_records;\n\n                        memset(l_mct_deco_data ,0,(p_tcp->m_nb_max_mct_records - p_tcp->m_nb_mct_records) * sizeof(opj_mct_data_t));\n                }\n                l_mct_deco_data = p_tcp->m_mct_records + p_tcp->m_nb_mct_records;\n\n                if (l_mct_deco_data->m_data) {\n                        opj_free(l_mct_deco_data->m_data);\n                        l_mct_deco_data->m_data = 00;\n                }\n\n                l_mct_deco_data->m_index = l_indix++;\n                l_mct_deco_data->m_array_type = MCT_TYPE_DECORRELATION;\n                l_mct_deco_data->m_element_type = MCT_TYPE_FLOAT;\n                l_nb_elem = p_image->numcomps * p_image->numcomps;\n                l_mct_size = l_nb_elem * MCT_ELEMENT_SIZE[l_mct_deco_data->m_element_type];\n                l_mct_deco_data->m_data = (OPJ_BYTE*)opj_malloc(l_mct_size );\n\n                if (! l_mct_deco_data->m_data) {\n                        return OPJ_FALSE;\n                }\n\n                j2k_mct_write_functions_from_float[l_mct_deco_data->m_element_type](p_tcp->m_mct_decoding_matrix,l_mct_deco_data->m_data,l_nb_elem);\n\n                l_mct_deco_data->m_data_size = l_mct_size;\n                ++p_tcp->m_nb_mct_records;\n        }\n\n        if (p_tcp->m_nb_mct_records == p_tcp->m_nb_max_mct_records) {\n                opj_mct_data_t *new_mct_records;\n                p_tcp->m_nb_max_mct_records += OPJ_J2K_MCT_DEFAULT_NB_RECORDS;\n                new_mct_records = (opj_mct_data_t *) opj_realloc(p_tcp->m_mct_records, p_tcp->m_nb_max_mct_records * sizeof(opj_mct_data_t));\n                if (! new_mct_records) {\n                        opj_free(p_tcp->m_mct_records);\n                        p_tcp->m_mct_records = NULL;\n                        p_tcp->m_nb_max_mct_records = 0;\n                        p_tcp->m_nb_mct_records = 0;\n                        /* opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to setup mct encoding\\n\"); */\n                        return OPJ_FALSE;\n                }\n                p_tcp->m_mct_records = new_mct_records;\n                l_mct_offset_data = p_tcp->m_mct_records + p_tcp->m_nb_mct_records;\n\n                memset(l_mct_offset_data ,0,(p_tcp->m_nb_max_mct_records - p_tcp->m_nb_mct_records) * sizeof(opj_mct_data_t));\n\n                if (l_mct_deco_data) {\n                        l_mct_deco_data = l_mct_offset_data - 1;\n                }\n        }\n\n        l_mct_offset_data = p_tcp->m_mct_records + p_tcp->m_nb_mct_records;\n\n        if (l_mct_offset_data->m_data) {\n                opj_free(l_mct_offset_data->m_data);\n                l_mct_offset_data->m_data = 00;\n        }\n\n        l_mct_offset_data->m_index = l_indix++;\n        l_mct_offset_data->m_array_type = MCT_TYPE_OFFSET;\n        l_mct_offset_data->m_element_type = MCT_TYPE_FLOAT;\n        l_nb_elem = p_image->numcomps;\n        l_mct_size = l_nb_elem * MCT_ELEMENT_SIZE[l_mct_offset_data->m_element_type];\n        l_mct_offset_data->m_data = (OPJ_BYTE*)opj_malloc(l_mct_size );\n\n        if (! l_mct_offset_data->m_data) {\n                return OPJ_FALSE;\n        }\n\n        l_data = (OPJ_FLOAT32*)opj_malloc(l_nb_elem * sizeof(OPJ_FLOAT32));\n        if (! l_data) {\n                opj_free(l_mct_offset_data->m_data);\n                l_mct_offset_data->m_data = 00;\n                return OPJ_FALSE;\n        }\n\n        l_tccp = p_tcp->tccps;\n        l_current_data = l_data;\n\n        for (i=0;i<l_nb_elem;++i) {\n                *(l_current_data++) = (OPJ_FLOAT32) (l_tccp->m_dc_level_shift);\n                ++l_tccp;\n        }\n\n        j2k_mct_write_functions_from_float[l_mct_offset_data->m_element_type](l_data,l_mct_offset_data->m_data,l_nb_elem);\n\n        opj_free(l_data);\n\n        l_mct_offset_data->m_data_size = l_mct_size;\n\n        ++p_tcp->m_nb_mct_records;\n\n        if (p_tcp->m_nb_mcc_records == p_tcp->m_nb_max_mcc_records) {\n                opj_simple_mcc_decorrelation_data_t *new_mcc_records;\n                p_tcp->m_nb_max_mcc_records += OPJ_J2K_MCT_DEFAULT_NB_RECORDS;\n                new_mcc_records = (opj_simple_mcc_decorrelation_data_t *) opj_realloc(\n                                p_tcp->m_mcc_records, p_tcp->m_nb_max_mcc_records * sizeof(opj_simple_mcc_decorrelation_data_t));\n                if (! new_mcc_records) {\n                        opj_free(p_tcp->m_mcc_records);\n                        p_tcp->m_mcc_records = NULL;\n                        p_tcp->m_nb_max_mcc_records = 0;\n                        p_tcp->m_nb_mcc_records = 0;\n                        /* opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to setup mct encoding\\n\"); */\n                        return OPJ_FALSE;\n                }\n                p_tcp->m_mcc_records = new_mcc_records;\n                l_mcc_data = p_tcp->m_mcc_records + p_tcp->m_nb_mcc_records;\n                memset(l_mcc_data ,0,(p_tcp->m_nb_max_mcc_records - p_tcp->m_nb_mcc_records) * sizeof(opj_simple_mcc_decorrelation_data_t));\n\n        }\n\n        l_mcc_data = p_tcp->m_mcc_records + p_tcp->m_nb_mcc_records;\n        l_mcc_data->m_decorrelation_array = l_mct_deco_data;\n        l_mcc_data->m_is_irreversible = 1;\n        l_mcc_data->m_nb_comps = p_image->numcomps;\n        l_mcc_data->m_index = l_indix++;\n        l_mcc_data->m_offset_array = l_mct_offset_data;\n        ++p_tcp->m_nb_mcc_records;\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_build_decoder (opj_j2k_t * p_j2k,\n                                                            opj_stream_private_t *p_stream,\n                                                            opj_event_mgr_t * p_manager )\n{\n        /* add here initialization of cp\n           copy paste of setup_decoder */\n  (void)p_j2k;\n  (void)p_stream;\n  (void)p_manager;\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_build_encoder (opj_j2k_t * p_j2k,\n                                                        opj_stream_private_t *p_stream,\n                                                        opj_event_mgr_t * p_manager )\n{\n        /* add here initialization of cp\n           copy paste of setup_encoder */\n  (void)p_j2k;\n  (void)p_stream;\n  (void)p_manager;\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_encoding_validation (  opj_j2k_t * p_j2k,\n                                                                            opj_stream_private_t *p_stream,\n                                                                            opj_event_mgr_t * p_manager )\n{\n        OPJ_BOOL l_is_valid = OPJ_TRUE;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_stream != 00);\n        assert(p_manager != 00);\n\n        /* STATE checking */\n        /* make sure the state is at 0 */\n        l_is_valid &= (p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_NONE);\n\n        /* POINTER validation */\n        /* make sure a p_j2k codec is present */\n        l_is_valid &= (p_j2k->m_procedure_list != 00);\n        /* make sure a validation list is present */\n        l_is_valid &= (p_j2k->m_validation_list != 00);\n\n        if ((p_j2k->m_cp.tdx) < (OPJ_UINT32) (1 << p_j2k->m_cp.tcps->tccps->numresolutions)) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Number of resolutions is too high in comparison to the size of tiles\\n\");\n                return OPJ_FALSE;\n        }\n\n        if ((p_j2k->m_cp.tdy) < (OPJ_UINT32) (1 << p_j2k->m_cp.tcps->tccps->numresolutions)) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Number of resolutions is too high in comparison to the size of tiles\\n\");\n                return OPJ_FALSE;\n        }\n\n        /* PARAMETER VALIDATION */\n        return l_is_valid;\n}\n\nOPJ_BOOL opj_j2k_decoding_validation (  opj_j2k_t *p_j2k,\n                                        opj_stream_private_t *p_stream,\n                                        opj_event_mgr_t * p_manager\n                                        )\n{\n        OPJ_BOOL l_is_valid = OPJ_TRUE;\n\n        /* preconditions*/\n        assert(p_j2k != 00);\n        assert(p_stream != 00);\n        assert(p_manager != 00);\n\n        /* STATE checking */\n        /* make sure the state is at 0 */\n#ifdef TODO_MSD\n        l_is_valid &= (p_j2k->m_specific_param.m_decoder.m_state == J2K_DEC_STATE_NONE);\n#endif\n        l_is_valid &= (p_j2k->m_specific_param.m_decoder.m_state == 0x0000);\n\n        /* POINTER validation */\n        /* make sure a p_j2k codec is present */\n        /* make sure a procedure list is present */\n        l_is_valid &= (p_j2k->m_procedure_list != 00);\n        /* make sure a validation list is present */\n        l_is_valid &= (p_j2k->m_validation_list != 00);\n\n        /* PARAMETER VALIDATION */\n        return l_is_valid;\n}\n\nOPJ_BOOL opj_j2k_read_header_procedure( opj_j2k_t *p_j2k,\n                                                                            opj_stream_private_t *p_stream,\n                                                                            opj_event_mgr_t * p_manager)\n{\n        OPJ_UINT32 l_current_marker;\n        OPJ_UINT32 l_marker_size;\n        const opj_dec_memory_marker_handler_t * l_marker_handler = 00;\n\n        /* preconditions */\n        assert(p_stream != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        /*  We enter in the main header */\n        p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_MHSOC;\n\n        /* Try to read the SOC marker, the codestream must begin with SOC marker */\n        if (! opj_j2k_read_soc(p_j2k,p_stream,p_manager)) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Expected a SOC marker \\n\");\n                return OPJ_FALSE;\n        }\n\n        /* Try to read 2 bytes (the next marker ID) from stream and copy them into the buffer */\n        if (opj_stream_read_data(p_stream,p_j2k->m_specific_param.m_decoder.m_header_data,2,p_manager) != 2) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Stream too short\\n\");\n                return OPJ_FALSE;\n        }\n\n        /* Read 2 bytes as the new marker ID */\n        opj_read_bytes(p_j2k->m_specific_param.m_decoder.m_header_data,&l_current_marker,2);\n\n        /* Try to read until the SOT is detected */\n        while (l_current_marker != J2K_MS_SOT) {\n\n                /* Check if the current marker ID is valid */\n                if (l_current_marker < 0xff00) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"We expected read a marker ID (0xff--) instead of %.8x\\n\", l_current_marker);\n                        return OPJ_FALSE;\n                }\n\n                /* Get the marker handler from the marker ID */\n                l_marker_handler = opj_j2k_get_marker_handler(l_current_marker);\n\n                /* Manage case where marker is unknown */\n                if (l_marker_handler->id == J2K_MS_UNK) {\n                        if (! opj_j2k_read_unk(p_j2k, p_stream, &l_current_marker, p_manager)){\n                                opj_event_msg(p_manager, EVT_ERROR, \"Unknow marker have been detected and generated error.\\n\");\n                                return OPJ_FALSE;\n                        }\n\n                        if (l_current_marker == J2K_MS_SOT)\n                                break; /* SOT marker is detected main header is completely read */\n                        else    /* Get the marker handler from the marker ID */\n                                l_marker_handler = opj_j2k_get_marker_handler(l_current_marker);\n                }\n\n                /* Check if the marker is known and if it is the right place to find it */\n                if (! (p_j2k->m_specific_param.m_decoder.m_state & l_marker_handler->states) ) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Marker is not compliant with its position\\n\");\n                        return OPJ_FALSE;\n                }\n\n                /* Try to read 2 bytes (the marker size) from stream and copy them into the buffer */\n                if (opj_stream_read_data(p_stream,p_j2k->m_specific_param.m_decoder.m_header_data,2,p_manager) != 2) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Stream too short\\n\");\n                        return OPJ_FALSE;\n                }\n\n                /* read 2 bytes as the marker size */\n                opj_read_bytes(p_j2k->m_specific_param.m_decoder.m_header_data,&l_marker_size,2);\n                l_marker_size -= 2; /* Subtract the size of the marker ID already read */\n\n                /* Check if the marker size is compatible with the header data size */\n                if (l_marker_size > p_j2k->m_specific_param.m_decoder.m_header_data_size) {\n                        OPJ_BYTE *new_header_data = (OPJ_BYTE *) opj_realloc(p_j2k->m_specific_param.m_decoder.m_header_data, l_marker_size);\n                        if (! new_header_data) {\n                                opj_free(p_j2k->m_specific_param.m_decoder.m_header_data);\n                                p_j2k->m_specific_param.m_decoder.m_header_data = NULL;\n                                p_j2k->m_specific_param.m_decoder.m_header_data_size = 0;\n                                opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to read header\\n\");\n                                return OPJ_FALSE;\n                        }\n                        p_j2k->m_specific_param.m_decoder.m_header_data = new_header_data;\n                        p_j2k->m_specific_param.m_decoder.m_header_data_size = l_marker_size;\n                }\n\n                /* Try to read the rest of the marker segment from stream and copy them into the buffer */\n                if (opj_stream_read_data(p_stream,p_j2k->m_specific_param.m_decoder.m_header_data,l_marker_size,p_manager) != l_marker_size) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Stream too short\\n\");\n                        return OPJ_FALSE;\n                }\n\n                /* Read the marker segment with the correct marker handler */\n                if (! (*(l_marker_handler->handler))(p_j2k,p_j2k->m_specific_param.m_decoder.m_header_data,l_marker_size,p_manager)) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Marker handler function failed to read the marker segment\\n\");\n                        return OPJ_FALSE;\n                }\n\n                /* Add the marker to the codestream index*/\n                if (OPJ_FALSE == opj_j2k_add_mhmarker(\n                                        p_j2k->cstr_index,\n                                        l_marker_handler->id,\n                                        (OPJ_UINT32) opj_stream_tell(p_stream) - l_marker_size - 4,\n                                        l_marker_size + 4 )) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to add mh marker\\n\");\n                        return OPJ_FALSE;\n                }\n\n                /* Try to read 2 bytes (the next marker ID) from stream and copy them into the buffer */\n                if (opj_stream_read_data(p_stream,p_j2k->m_specific_param.m_decoder.m_header_data,2,p_manager) != 2) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Stream too short\\n\");\n                        return OPJ_FALSE;\n                }\n\n                /* read 2 bytes as the new marker ID */\n                opj_read_bytes(p_j2k->m_specific_param.m_decoder.m_header_data,&l_current_marker,2);\n        }\n\n        opj_event_msg(p_manager, EVT_INFO, \"Main header has been correctly decoded.\\n\");\n\n        /* Position of the last element if the main header */\n        p_j2k->cstr_index->main_head_end = (OPJ_UINT32) opj_stream_tell(p_stream) - 2;\n\n        /* Next step: read a tile-part header */\n        p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_TPHSOT;\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_exec ( opj_j2k_t * p_j2k,\n                                        opj_procedure_list_t * p_procedure_list,\n                                        opj_stream_private_t *p_stream,\n                                        opj_event_mgr_t * p_manager )\n{\n        OPJ_BOOL (** l_procedure) (opj_j2k_t * ,opj_stream_private_t *,opj_event_mgr_t *) = 00;\n        OPJ_BOOL l_result = OPJ_TRUE;\n        OPJ_UINT32 l_nb_proc, i;\n\n        /* preconditions*/\n        assert(p_procedure_list != 00);\n        assert(p_j2k != 00);\n        assert(p_stream != 00);\n        assert(p_manager != 00);\n\n        l_nb_proc = opj_procedure_list_get_nb_procedures(p_procedure_list);\n        l_procedure = (OPJ_BOOL (**) (opj_j2k_t * ,opj_stream_private_t *,opj_event_mgr_t *)) opj_procedure_list_get_first_procedure(p_procedure_list);\n\n        for     (i=0;i<l_nb_proc;++i) {\n                l_result = l_result && ((*l_procedure) (p_j2k,p_stream,p_manager));\n                ++l_procedure;\n        }\n\n        /* and clear the procedure list at the end.*/\n        opj_procedure_list_clear(p_procedure_list);\n        return l_result;\n}\n\n/* FIXME DOC*/\nstatic OPJ_BOOL opj_j2k_copy_default_tcp_and_create_tcd (       opj_j2k_t * p_j2k,\n                                                            opj_stream_private_t *p_stream,\n                                                            opj_event_mgr_t * p_manager\n                                                            )\n{\n        opj_tcp_t * l_tcp = 00;\n        opj_tcp_t * l_default_tcp = 00;\n        OPJ_UINT32 l_nb_tiles;\n        OPJ_UINT32 i,j;\n        opj_tccp_t *l_current_tccp = 00;\n        OPJ_UINT32 l_tccp_size;\n        OPJ_UINT32 l_mct_size;\n        opj_image_t * l_image;\n        OPJ_UINT32 l_mcc_records_size,l_mct_records_size;\n        opj_mct_data_t * l_src_mct_rec, *l_dest_mct_rec;\n        opj_simple_mcc_decorrelation_data_t * l_src_mcc_rec, *l_dest_mcc_rec;\n        OPJ_UINT32 l_offset;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_stream != 00);\n        assert(p_manager != 00);\n\n        l_image = p_j2k->m_private_image;\n        l_nb_tiles = p_j2k->m_cp.th * p_j2k->m_cp.tw;\n        l_tcp = p_j2k->m_cp.tcps;\n        l_tccp_size = l_image->numcomps * (OPJ_UINT32)sizeof(opj_tccp_t);\n        l_default_tcp = p_j2k->m_specific_param.m_decoder.m_default_tcp;\n        l_mct_size = l_image->numcomps * l_image->numcomps * (OPJ_UINT32)sizeof(OPJ_FLOAT32);\n\n        /* For each tile */\n        for (i=0; i<l_nb_tiles; ++i) {\n                /* keep the tile-compo coding parameters pointer of the current tile coding parameters*/\n                l_current_tccp = l_tcp->tccps;\n                /*Copy default coding parameters into the current tile coding parameters*/\n                memcpy(l_tcp, l_default_tcp, sizeof(opj_tcp_t));\n                /* Initialize some values of the current tile coding parameters*/\n                l_tcp->ppt = 0;\n                l_tcp->ppt_data = 00;\n                /* Reconnect the tile-compo coding parameters pointer to the current tile coding parameters*/\n                l_tcp->tccps = l_current_tccp;\n\n                /* Get the mct_decoding_matrix of the dflt_tile_cp and copy them into the current tile cp*/\n                if (l_default_tcp->m_mct_decoding_matrix) {\n                        l_tcp->m_mct_decoding_matrix = (OPJ_FLOAT32*)opj_malloc(l_mct_size);\n                        if (! l_tcp->m_mct_decoding_matrix ) {\n                                return OPJ_FALSE;\n                        }\n                        memcpy(l_tcp->m_mct_decoding_matrix,l_default_tcp->m_mct_decoding_matrix,l_mct_size);\n                }\n\n                /* Get the mct_record of the dflt_tile_cp and copy them into the current tile cp*/\n                l_mct_records_size = l_default_tcp->m_nb_max_mct_records * (OPJ_UINT32)sizeof(opj_mct_data_t);\n                l_tcp->m_mct_records = (opj_mct_data_t*)opj_malloc(l_mct_records_size);\n                if (! l_tcp->m_mct_records) {\n                        return OPJ_FALSE;\n                }\n                memcpy(l_tcp->m_mct_records, l_default_tcp->m_mct_records,l_mct_records_size);\n\n                /* Copy the mct record data from dflt_tile_cp to the current tile*/\n                l_src_mct_rec = l_default_tcp->m_mct_records;\n                l_dest_mct_rec = l_tcp->m_mct_records;\n\n                for (j=0;j<l_default_tcp->m_nb_mct_records;++j) {\n\n                        if (l_src_mct_rec->m_data) {\n\n                                l_dest_mct_rec->m_data = (OPJ_BYTE*) opj_malloc(l_src_mct_rec->m_data_size);\n                                if(! l_dest_mct_rec->m_data) {\n                                        return OPJ_FALSE;\n                                }\n                                memcpy(l_dest_mct_rec->m_data,l_src_mct_rec->m_data,l_src_mct_rec->m_data_size);\n                        }\n\n                        ++l_src_mct_rec;\n                        ++l_dest_mct_rec;\n                }\n\n                /* Get the mcc_record of the dflt_tile_cp and copy them into the current tile cp*/\n                l_mcc_records_size = l_default_tcp->m_nb_max_mcc_records * (OPJ_UINT32)sizeof(opj_simple_mcc_decorrelation_data_t);\n                l_tcp->m_mcc_records = (opj_simple_mcc_decorrelation_data_t*) opj_malloc(l_mcc_records_size);\n                if (! l_tcp->m_mcc_records) {\n                        return OPJ_FALSE;\n                }\n                memcpy(l_tcp->m_mcc_records,l_default_tcp->m_mcc_records,l_mcc_records_size);\n\n                /* Copy the mcc record data from dflt_tile_cp to the current tile*/\n                l_src_mcc_rec = l_default_tcp->m_mcc_records;\n                l_dest_mcc_rec = l_tcp->m_mcc_records;\n\n                for (j=0;j<l_default_tcp->m_nb_max_mcc_records;++j) {\n\n                        if (l_src_mcc_rec->m_decorrelation_array) {\n                                l_offset = (OPJ_UINT32)(l_src_mcc_rec->m_decorrelation_array - l_default_tcp->m_mct_records);\n                                l_dest_mcc_rec->m_decorrelation_array = l_tcp->m_mct_records + l_offset;\n                        }\n\n                        if (l_src_mcc_rec->m_offset_array) {\n                                l_offset = (OPJ_UINT32)(l_src_mcc_rec->m_offset_array - l_default_tcp->m_mct_records);\n                                l_dest_mcc_rec->m_offset_array = l_tcp->m_mct_records + l_offset;\n                        }\n\n                        ++l_src_mcc_rec;\n                        ++l_dest_mcc_rec;\n                }\n\n                /* Copy all the dflt_tile_compo_cp to the current tile cp */\n                memcpy(l_current_tccp,l_default_tcp->tccps,l_tccp_size);\n\n                /* Move to next tile cp*/\n                ++l_tcp;\n        }\n\n        /* Create the current tile decoder*/\n        p_j2k->m_tcd = (opj_tcd_t*)opj_tcd_create(OPJ_TRUE); /* FIXME why a cast ? */\n        if (! p_j2k->m_tcd ) {\n                return OPJ_FALSE;\n        }\n\n        if ( !opj_tcd_init(p_j2k->m_tcd, l_image, &(p_j2k->m_cp)) ) {\n                opj_tcd_destroy(p_j2k->m_tcd);\n                p_j2k->m_tcd = 00;\n                opj_event_msg(p_manager, EVT_ERROR, \"Cannot decode tile, memory error\\n\");\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\nconst opj_dec_memory_marker_handler_t * opj_j2k_get_marker_handler (OPJ_UINT32 p_id)\n{\n        const opj_dec_memory_marker_handler_t *e;\n        for (e = j2k_memory_marker_handler_tab; e->id != 0; ++e) {\n                if (e->id == p_id) {\n                        break; /* we find a handler corresponding to the marker ID*/\n                }\n        }\n        return e;\n}\n\nvoid opj_j2k_destroy (opj_j2k_t *p_j2k)\n{\n        if (p_j2k == 00) {\n                return;\n        }\n\n        if (p_j2k->m_is_decoder) {\n\n                if (p_j2k->m_specific_param.m_decoder.m_default_tcp != 00) {\n                        opj_j2k_tcp_destroy(p_j2k->m_specific_param.m_decoder.m_default_tcp);\n                        opj_free(p_j2k->m_specific_param.m_decoder.m_default_tcp);\n                        p_j2k->m_specific_param.m_decoder.m_default_tcp = 00;\n                }\n\n                if (p_j2k->m_specific_param.m_decoder.m_header_data != 00) {\n                        opj_free(p_j2k->m_specific_param.m_decoder.m_header_data);\n                        p_j2k->m_specific_param.m_decoder.m_header_data = 00;\n                        p_j2k->m_specific_param.m_decoder.m_header_data_size = 0;\n                }\n        }\n        else {\n\n                if (p_j2k->m_specific_param.m_encoder.m_encoded_tile_data) {\n                        opj_free(p_j2k->m_specific_param.m_encoder.m_encoded_tile_data);\n                        p_j2k->m_specific_param.m_encoder.m_encoded_tile_data = 00;\n                }\n\n                if (p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_buffer) {\n                        opj_free(p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_buffer);\n                        p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_buffer = 00;\n                        p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_current = 00;\n                }\n\n                if (p_j2k->m_specific_param.m_encoder.m_header_tile_data) {\n                        opj_free(p_j2k->m_specific_param.m_encoder.m_header_tile_data);\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data = 00;\n                        p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = 0;\n                }\n        }\n\n        opj_tcd_destroy(p_j2k->m_tcd);\n\n        opj_j2k_cp_destroy(&(p_j2k->m_cp));\n        memset(&(p_j2k->m_cp),0,sizeof(opj_cp_t));\n\n        opj_procedure_list_destroy(p_j2k->m_procedure_list);\n        p_j2k->m_procedure_list = 00;\n\n        opj_procedure_list_destroy(p_j2k->m_validation_list);\n        p_j2k->m_procedure_list = 00;\n\n        j2k_destroy_cstr_index(p_j2k->cstr_index);\n        p_j2k->cstr_index = NULL;\n\n        opj_image_destroy(p_j2k->m_private_image);\n        p_j2k->m_private_image = NULL;\n\n        opj_image_destroy(p_j2k->m_output_image);\n        p_j2k->m_output_image = NULL;\n\n        opj_free(p_j2k);\n}\n\nvoid j2k_destroy_cstr_index (opj_codestream_index_t *p_cstr_ind)\n{\n        if (p_cstr_ind) {\n\n                if (p_cstr_ind->marker) {\n                        opj_free(p_cstr_ind->marker);\n                        p_cstr_ind->marker = NULL;\n                }\n\n                if (p_cstr_ind->tile_index) {\n                        OPJ_UINT32 it_tile = 0;\n\n                        for (it_tile=0; it_tile < p_cstr_ind->nb_of_tiles; it_tile++) {\n\n                                if(p_cstr_ind->tile_index[it_tile].packet_index) {\n                                        opj_free(p_cstr_ind->tile_index[it_tile].packet_index);\n                                        p_cstr_ind->tile_index[it_tile].packet_index = NULL;\n                                }\n\n                                if(p_cstr_ind->tile_index[it_tile].tp_index){\n                                        opj_free(p_cstr_ind->tile_index[it_tile].tp_index);\n                                        p_cstr_ind->tile_index[it_tile].tp_index = NULL;\n                                }\n\n                                if(p_cstr_ind->tile_index[it_tile].marker){\n                                        opj_free(p_cstr_ind->tile_index[it_tile].marker);\n                                        p_cstr_ind->tile_index[it_tile].marker = NULL;\n\n                                }\n                        }\n\n                        opj_free( p_cstr_ind->tile_index);\n                        p_cstr_ind->tile_index = NULL;\n                }\n\n                opj_free(p_cstr_ind);\n        }\n}\n\nvoid opj_j2k_tcp_destroy (opj_tcp_t *p_tcp)\n{\n        if (p_tcp == 00) {\n                return;\n        }\n\n        if (p_tcp->ppt_buffer != 00) {\n                opj_free(p_tcp->ppt_buffer);\n                p_tcp->ppt_buffer = 00;\n        }\n\n        if (p_tcp->tccps != 00) {\n                opj_free(p_tcp->tccps);\n                p_tcp->tccps = 00;\n        }\n\n        if (p_tcp->m_mct_coding_matrix != 00) {\n                opj_free(p_tcp->m_mct_coding_matrix);\n                p_tcp->m_mct_coding_matrix = 00;\n        }\n\n        if (p_tcp->m_mct_decoding_matrix != 00) {\n                opj_free(p_tcp->m_mct_decoding_matrix);\n                p_tcp->m_mct_decoding_matrix = 00;\n        }\n\n        if (p_tcp->m_mcc_records) {\n                opj_free(p_tcp->m_mcc_records);\n                p_tcp->m_mcc_records = 00;\n                p_tcp->m_nb_max_mcc_records = 0;\n                p_tcp->m_nb_mcc_records = 0;\n        }\n\n        if (p_tcp->m_mct_records) {\n                opj_mct_data_t * l_mct_data = p_tcp->m_mct_records;\n                OPJ_UINT32 i;\n\n                for (i=0;i<p_tcp->m_nb_mct_records;++i) {\n                        if (l_mct_data->m_data) {\n                                opj_free(l_mct_data->m_data);\n                                l_mct_data->m_data = 00;\n                        }\n\n                        ++l_mct_data;\n                }\n\n                opj_free(p_tcp->m_mct_records);\n                p_tcp->m_mct_records = 00;\n        }\n\n        if (p_tcp->mct_norms != 00) {\n                opj_free(p_tcp->mct_norms);\n                p_tcp->mct_norms = 00;\n        }\n\n        opj_j2k_tcp_data_destroy(p_tcp);\n\n}\n\nvoid opj_j2k_tcp_data_destroy (opj_tcp_t *p_tcp)\n{\n        if (p_tcp->m_data) {\n                opj_free(p_tcp->m_data);\n                p_tcp->m_data = NULL;\n                p_tcp->m_data_size = 0;\n        }\n}\n\nvoid opj_j2k_cp_destroy (opj_cp_t *p_cp)\n{\n        OPJ_UINT32 l_nb_tiles;\n        opj_tcp_t * l_current_tile = 00;\n        OPJ_UINT32 i;\n\n        if (p_cp == 00)\n        {\n                return;\n        }\n        if (p_cp->tcps != 00)\n        {\n                l_current_tile = p_cp->tcps;\n                l_nb_tiles = p_cp->th * p_cp->tw;\n\n                for (i = 0; i < l_nb_tiles; ++i)\n                {\n                        opj_j2k_tcp_destroy(l_current_tile);\n                        ++l_current_tile;\n                }\n                opj_free(p_cp->tcps);\n                p_cp->tcps = 00;\n        }\n        opj_free(p_cp->ppm_buffer);\n        p_cp->ppm_buffer = 00;\n        p_cp->ppm_data = NULL; /* ppm_data belongs to the allocated buffer pointed by ppm_buffer */\n        opj_free(p_cp->comment);\n        p_cp->comment = 00;\n        if (! p_cp->m_is_decoder)\n        {\n                opj_free(p_cp->m_specific_param.m_enc.m_matrice);\n                p_cp->m_specific_param.m_enc.m_matrice = 00;\n        }\n}\n\nOPJ_BOOL opj_j2k_read_tile_header(      opj_j2k_t * p_j2k,\n                                                                    OPJ_UINT32 * p_tile_index,\n                                                                    OPJ_UINT32 * p_data_size,\n                                                                    OPJ_INT32 * p_tile_x0, OPJ_INT32 * p_tile_y0,\n                                                                    OPJ_INT32 * p_tile_x1, OPJ_INT32 * p_tile_y1,\n                                                                    OPJ_UINT32 * p_nb_comps,\n                                                                    OPJ_BOOL * p_go_on,\n                                                                    opj_stream_private_t *p_stream,\n                                                                    opj_event_mgr_t * p_manager )\n{\n        OPJ_UINT32 l_current_marker = J2K_MS_SOT;\n        OPJ_UINT32 l_marker_size;\n        const opj_dec_memory_marker_handler_t * l_marker_handler = 00;\n        opj_tcp_t * l_tcp = NULL;\n        OPJ_UINT32 l_nb_tiles;\n\n        /* preconditions */\n        assert(p_stream != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        /* Reach the End Of Codestream ?*/\n        if (p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_EOC){\n                l_current_marker = J2K_MS_EOC;\n        }\n        /* We need to encounter a SOT marker (a new tile-part header) */\n        else if (p_j2k->m_specific_param.m_decoder.m_state != J2K_STATE_TPHSOT){\n                return OPJ_FALSE;\n        }\n\n        /* Read into the codestream until reach the EOC or ! can_decode ??? FIXME */\n        while ( (!p_j2k->m_specific_param.m_decoder.m_can_decode) && (l_current_marker != J2K_MS_EOC) ) {\n\n                /* Try to read until the Start Of Data is detected */\n                while (l_current_marker != J2K_MS_SOD) {\n                    \n                    if(opj_stream_get_number_byte_left(p_stream) == 0)\n                    {\n                        p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_NEOC;\n                        break;\n                    }\n\n                        /* Try to read 2 bytes (the marker size) from stream and copy them into the buffer */\n                        if (opj_stream_read_data(p_stream,p_j2k->m_specific_param.m_decoder.m_header_data,2,p_manager) != 2) {\n                                opj_event_msg(p_manager, EVT_ERROR, \"Stream too short\\n\");\n                                return OPJ_FALSE;\n                        }\n\n                        /* Read 2 bytes from the buffer as the marker size */\n                        opj_read_bytes(p_j2k->m_specific_param.m_decoder.m_header_data,&l_marker_size,2);\n\n                        /* cf. https://code.google.com/p/openjpeg/issues/detail?id=226 */\n                        if (l_current_marker == 0x8080 && opj_stream_get_number_byte_left(p_stream) == 0) {\n                                p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_NEOC;\n                                break;\n                        }\n\n                        /* Why this condition? FIXME */\n                        if (p_j2k->m_specific_param.m_decoder.m_state & J2K_STATE_TPH){\n                                p_j2k->m_specific_param.m_decoder.m_sot_length -= (l_marker_size + 2);\n                        }\n                        l_marker_size -= 2; /* Subtract the size of the marker ID already read */\n\n                        /* Get the marker handler from the marker ID */\n                        l_marker_handler = opj_j2k_get_marker_handler(l_current_marker);\n\n                        /* Check if the marker is known and if it is the right place to find it */\n                        if (! (p_j2k->m_specific_param.m_decoder.m_state & l_marker_handler->states) ) {\n                                opj_event_msg(p_manager, EVT_ERROR, \"Marker is not compliant with its position\\n\");\n                                return OPJ_FALSE;\n                        }\n/* FIXME manage case of unknown marker as in the main header ? */\n\n                        /* Check if the marker size is compatible with the header data size */\n                        if (l_marker_size > p_j2k->m_specific_param.m_decoder.m_header_data_size) {\n                                OPJ_BYTE *new_header_data = (OPJ_BYTE *) opj_realloc(p_j2k->m_specific_param.m_decoder.m_header_data, l_marker_size);\n                                if (! new_header_data) {\n                                        opj_free(p_j2k->m_specific_param.m_decoder.m_header_data);\n                                        p_j2k->m_specific_param.m_decoder.m_header_data = NULL;\n                                        p_j2k->m_specific_param.m_decoder.m_header_data_size = 0;\n                                        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to read header\\n\");\n                                        return OPJ_FALSE;\n                                }\n                                p_j2k->m_specific_param.m_decoder.m_header_data = new_header_data;\n                                p_j2k->m_specific_param.m_decoder.m_header_data_size = l_marker_size;\n                        }\n\n                        /* Try to read the rest of the marker segment from stream and copy them into the buffer */\n                        if (opj_stream_read_data(p_stream,p_j2k->m_specific_param.m_decoder.m_header_data,l_marker_size,p_manager) != l_marker_size) {\n                                opj_event_msg(p_manager, EVT_ERROR, \"Stream too short\\n\");\n                                return OPJ_FALSE;\n                        }\n\n                        if (!l_marker_handler->handler) {\n                                /* See issue #175 */\n                                opj_event_msg(p_manager, EVT_ERROR, \"Not sure how that happened.\\n\");\n                                return OPJ_FALSE;\n                        }\n                        /* Read the marker segment with the correct marker handler */\n                        if (! (*(l_marker_handler->handler))(p_j2k,p_j2k->m_specific_param.m_decoder.m_header_data,l_marker_size,p_manager)) {\n                                opj_event_msg(p_manager, EVT_ERROR, \"Fail to read the current marker segment (%#x)\\n\", l_current_marker);\n                                return OPJ_FALSE;\n                        }\n\n                        /* Add the marker to the codestream index*/\n                        if (OPJ_FALSE == opj_j2k_add_tlmarker(p_j2k->m_current_tile_number,\n                                                p_j2k->cstr_index,\n                                                l_marker_handler->id,\n                                                (OPJ_UINT32) opj_stream_tell(p_stream) - l_marker_size - 4,\n                                                l_marker_size + 4 )) {\n                                opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to add tl marker\\n\");\n                                return OPJ_FALSE;\n                        }\n\n                        /* Keep the position of the last SOT marker read */\n                        if ( l_marker_handler->id == J2K_MS_SOT ) {\n                                OPJ_UINT32 sot_pos = (OPJ_UINT32) opj_stream_tell(p_stream) - l_marker_size - 4 ;\n                                if (sot_pos > p_j2k->m_specific_param.m_decoder.m_last_sot_read_pos)\n                                {\n                                        p_j2k->m_specific_param.m_decoder.m_last_sot_read_pos = sot_pos;\n                                }\n                        }\n\n                        if (p_j2k->m_specific_param.m_decoder.m_skip_data) {\n                                /* Skip the rest of the tile part header*/\n                                if (opj_stream_skip(p_stream,p_j2k->m_specific_param.m_decoder.m_sot_length,p_manager) != p_j2k->m_specific_param.m_decoder.m_sot_length) {\n                                        opj_event_msg(p_manager, EVT_ERROR, \"Stream too short\\n\");\n                                        return OPJ_FALSE;\n                                }\n                                l_current_marker = J2K_MS_SOD; /* Normally we reached a SOD */\n                        }\n                        else {\n                                /* Try to read 2 bytes (the next marker ID) from stream and copy them into the buffer*/\n                                if (opj_stream_read_data(p_stream,p_j2k->m_specific_param.m_decoder.m_header_data,2,p_manager) != 2) {\n                                        opj_event_msg(p_manager, EVT_ERROR, \"Stream too short\\n\");\n                                        return OPJ_FALSE;\n                                }\n                                /* Read 2 bytes from the buffer as the new marker ID */\n                                opj_read_bytes(p_j2k->m_specific_param.m_decoder.m_header_data,&l_current_marker,2);\n                        }\n                }\n                if(opj_stream_get_number_byte_left(p_stream) == 0\n                    && p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_NEOC)\n                    break;\n\n                /* If we didn't skip data before, we need to read the SOD marker*/\n                if (! p_j2k->m_specific_param.m_decoder.m_skip_data) {\n                        /* Try to read the SOD marker and skip data ? FIXME */\n                        if (! opj_j2k_read_sod(p_j2k, p_stream, p_manager)) {\n                                return OPJ_FALSE;\n                        }\n\n                        if (! p_j2k->m_specific_param.m_decoder.m_can_decode){\n                                /* Try to read 2 bytes (the next marker ID) from stream and copy them into the buffer */\n                                if (opj_stream_read_data(p_stream,p_j2k->m_specific_param.m_decoder.m_header_data,2,p_manager) != 2) {\n                                        opj_event_msg(p_manager, EVT_ERROR, \"Stream too short\\n\");\n                                        return OPJ_FALSE;\n                                }\n\n                                /* Read 2 bytes from buffer as the new marker ID */\n                                opj_read_bytes(p_j2k->m_specific_param.m_decoder.m_header_data,&l_current_marker,2);\n                        }\n                }\n                else {\n                        /* Indicate we will try to read a new tile-part header*/\n                        p_j2k->m_specific_param.m_decoder.m_skip_data = 0;\n                        p_j2k->m_specific_param.m_decoder.m_can_decode = 0;\n                        p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_TPHSOT;\n\n                        /* Try to read 2 bytes (the next marker ID) from stream and copy them into the buffer */\n                        if (opj_stream_read_data(p_stream,p_j2k->m_specific_param.m_decoder.m_header_data,2,p_manager) != 2) {\n                                opj_event_msg(p_manager, EVT_ERROR, \"Stream too short\\n\");\n                                return OPJ_FALSE;\n                        }\n\n                        /* Read 2 bytes from buffer as the new marker ID */\n                        opj_read_bytes(p_j2k->m_specific_param.m_decoder.m_header_data,&l_current_marker,2);\n                }\n        }\n\n        /* Current marker is the EOC marker ?*/\n        if (l_current_marker == J2K_MS_EOC) {\n                if (p_j2k->m_specific_param.m_decoder.m_state != J2K_STATE_EOC ){\n                        p_j2k->m_current_tile_number = 0;\n                        p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_EOC;\n                }\n        }\n\n        /* FIXME DOC ???*/\n        if ( ! p_j2k->m_specific_param.m_decoder.m_can_decode) {\n                l_tcp = p_j2k->m_cp.tcps + p_j2k->m_current_tile_number;\n                l_nb_tiles = p_j2k->m_cp.th * p_j2k->m_cp.tw;\n\n                while( (p_j2k->m_current_tile_number < l_nb_tiles) && (l_tcp->m_data == 00) ) {\n                        ++p_j2k->m_current_tile_number;\n                        ++l_tcp;\n                }\n\n                if (p_j2k->m_current_tile_number == l_nb_tiles) {\n                        *p_go_on = OPJ_FALSE;\n                        return OPJ_TRUE;\n                }\n        }\n\n        /*FIXME ???*/\n        if (! opj_tcd_init_decode_tile(p_j2k->m_tcd, p_j2k->m_current_tile_number)) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Cannot decode tile, memory error\\n\");\n                return OPJ_FALSE;\n        }\n\n        opj_event_msg(p_manager, EVT_INFO, \"Header of tile %d / %d has been read.\\n\",\n                        p_j2k->m_current_tile_number, (p_j2k->m_cp.th * p_j2k->m_cp.tw) - 1);\n\n        *p_tile_index = p_j2k->m_current_tile_number;\n        *p_go_on = OPJ_TRUE;\n        *p_data_size = opj_tcd_get_decoded_tile_size(p_j2k->m_tcd);\n        *p_tile_x0 = p_j2k->m_tcd->tcd_image->tiles->x0;\n        *p_tile_y0 = p_j2k->m_tcd->tcd_image->tiles->y0;\n        *p_tile_x1 = p_j2k->m_tcd->tcd_image->tiles->x1;\n        *p_tile_y1 = p_j2k->m_tcd->tcd_image->tiles->y1;\n        *p_nb_comps = p_j2k->m_tcd->tcd_image->tiles->numcomps;\n\n         p_j2k->m_specific_param.m_decoder.m_state |= 0x0080;/* FIXME J2K_DEC_STATE_DATA;*/\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_decode_tile (  opj_j2k_t * p_j2k,\n                                                        OPJ_UINT32 p_tile_index,\n                                                        OPJ_BYTE * p_data,\n                                                        OPJ_UINT32 p_data_size,\n                                                        opj_stream_private_t *p_stream,\n                                                        opj_event_mgr_t * p_manager )\n{\n        OPJ_UINT32 l_current_marker;\n        OPJ_BYTE l_data [2];\n        opj_tcp_t * l_tcp;\n\n        /* preconditions */\n        assert(p_stream != 00);\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n\n        if ( !(p_j2k->m_specific_param.m_decoder.m_state & 0x0080/*FIXME J2K_DEC_STATE_DATA*/)\n                || (p_tile_index != p_j2k->m_current_tile_number) ) {\n                return OPJ_FALSE;\n        }\n\n        l_tcp = &(p_j2k->m_cp.tcps[p_tile_index]);\n        if (! l_tcp->m_data) {\n                opj_j2k_tcp_destroy(l_tcp);\n                return OPJ_FALSE;\n        }\n\n        if (! opj_tcd_decode_tile(      p_j2k->m_tcd,\n                                                                l_tcp->m_data,\n                                                                l_tcp->m_data_size,\n                                                                p_tile_index,\n                                                                p_j2k->cstr_index) ) {\n                opj_j2k_tcp_destroy(l_tcp);\n                p_j2k->m_specific_param.m_decoder.m_state |= 0x8000;/*FIXME J2K_DEC_STATE_ERR;*/\n                opj_event_msg(p_manager, EVT_ERROR, \"Failed to decode.\\n\");\n                return OPJ_FALSE;\n        }\n\n        if (! opj_tcd_update_tile_data(p_j2k->m_tcd,p_data,p_data_size)) {\n                return OPJ_FALSE;\n        }\n\n        /* To avoid to destroy the tcp which can be useful when we try to decode a tile decoded before (cf j2k_random_tile_access)\n         * we destroy just the data which will be re-read in read_tile_header*/\n        /*opj_j2k_tcp_destroy(l_tcp);\n        p_j2k->m_tcd->tcp = 0;*/\n        opj_j2k_tcp_data_destroy(l_tcp);\n\n        p_j2k->m_specific_param.m_decoder.m_can_decode = 0;\n        p_j2k->m_specific_param.m_decoder.m_state &= (~ (0x0080u));/* FIXME J2K_DEC_STATE_DATA);*/\n\n        if(opj_stream_get_number_byte_left(p_stream) == 0 \n            && p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_NEOC){\n            return OPJ_TRUE;\n        }\n\n        if (p_j2k->m_specific_param.m_decoder.m_state != 0x0100){ /*FIXME J2K_DEC_STATE_EOC)*/\n                if (opj_stream_read_data(p_stream,l_data,2,p_manager) != 2) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Stream too short\\n\");\n                        return OPJ_FALSE;\n                }\n\n                opj_read_bytes(l_data,&l_current_marker,2);\n\n                if (l_current_marker == J2K_MS_EOC) {\n                        p_j2k->m_current_tile_number = 0;\n                        p_j2k->m_specific_param.m_decoder.m_state =  0x0100;/*FIXME J2K_DEC_STATE_EOC;*/\n                }\n                else if (l_current_marker != J2K_MS_SOT)\n                {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Stream too short, expected SOT\\n\");\n                        \n                        if(opj_stream_get_number_byte_left(p_stream) == 0) {\n                            p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_NEOC;\n                            return OPJ_TRUE;\n                        }\n                        return OPJ_FALSE;\n                }\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_update_image_data (opj_tcd_t * p_tcd, OPJ_BYTE * p_data, opj_image_t* p_output_image)\n{\n        OPJ_UINT32 i,j,k = 0;\n        OPJ_UINT32 l_width_src,l_height_src;\n        OPJ_UINT32 l_width_dest,l_height_dest;\n        OPJ_INT32 l_offset_x0_src, l_offset_y0_src, l_offset_x1_src, l_offset_y1_src;\n        OPJ_INT32 l_start_offset_src, l_line_offset_src, l_end_offset_src ;\n        OPJ_UINT32 l_start_x_dest , l_start_y_dest;\n        OPJ_UINT32 l_x0_dest, l_y0_dest, l_x1_dest, l_y1_dest;\n        OPJ_INT32 l_start_offset_dest, l_line_offset_dest;\n\n        opj_image_comp_t * l_img_comp_src = 00;\n        opj_image_comp_t * l_img_comp_dest = 00;\n\n        opj_tcd_tilecomp_t * l_tilec = 00;\n        opj_image_t * l_image_src = 00;\n        OPJ_UINT32 l_size_comp, l_remaining;\n        OPJ_INT32 * l_dest_ptr;\n        opj_tcd_resolution_t* l_res= 00;\n\n        l_tilec = p_tcd->tcd_image->tiles->comps;\n        l_image_src = p_tcd->image;\n        l_img_comp_src = l_image_src->comps;\n\n        l_img_comp_dest = p_output_image->comps;\n\n        for (i=0; i<l_image_src->numcomps; i++) {\n\n                /* Allocate output component buffer if necessary */\n                if (!l_img_comp_dest->data) {\n\n                        l_img_comp_dest->data = (OPJ_INT32*) opj_calloc(l_img_comp_dest->w * l_img_comp_dest->h, sizeof(OPJ_INT32));\n                        if (! l_img_comp_dest->data) {\n                                return OPJ_FALSE;\n                        }\n                }\n\n                /* Copy info from decoded comp image to output image */\n                l_img_comp_dest->resno_decoded = l_img_comp_src->resno_decoded;\n\n                /*-----*/\n                /* Compute the precision of the output buffer */\n                l_size_comp = l_img_comp_src->prec >> 3; /*(/ 8)*/\n                l_remaining = l_img_comp_src->prec & 7;  /* (%8) */\n                l_res = l_tilec->resolutions + l_img_comp_src->resno_decoded;\n\n                if (l_remaining) {\n                        ++l_size_comp;\n                }\n\n                if (l_size_comp == 3) {\n                        l_size_comp = 4;\n                }\n                /*-----*/\n\n                /* Current tile component size*/\n                /*if (i == 0) {\n                fprintf(stdout, \"SRC: l_res_x0=%d, l_res_x1=%d, l_res_y0=%d, l_res_y1=%d\\n\",\n                                l_res->x0, l_res->x1, l_res->y0, l_res->y1);\n                }*/\n\n                l_width_src = (OPJ_UINT32)(l_res->x1 - l_res->x0);\n                l_height_src = (OPJ_UINT32)(l_res->y1 - l_res->y0);\n\n                /* Border of the current output component*/\n                l_x0_dest = (OPJ_UINT32)opj_int_ceildivpow2((OPJ_INT32)l_img_comp_dest->x0, (OPJ_INT32)l_img_comp_dest->factor);\n                l_y0_dest = (OPJ_UINT32)opj_int_ceildivpow2((OPJ_INT32)l_img_comp_dest->y0, (OPJ_INT32)l_img_comp_dest->factor);\n                l_x1_dest = l_x0_dest + l_img_comp_dest->w;\n                l_y1_dest = l_y0_dest + l_img_comp_dest->h;\n\n                /*if (i == 0) {\n                fprintf(stdout, \"DEST: l_x0_dest=%d, l_x1_dest=%d, l_y0_dest=%d, l_y1_dest=%d (%d)\\n\",\n                                l_x0_dest, l_x1_dest, l_y0_dest, l_y1_dest, l_img_comp_dest->factor );\n                }*/\n\n                /*-----*/\n                /* Compute the area (l_offset_x0_src, l_offset_y0_src, l_offset_x1_src, l_offset_y1_src)\n                 * of the input buffer (decoded tile component) which will be move\n                 * in the output buffer. Compute the area of the output buffer (l_start_x_dest,\n                 * l_start_y_dest, l_width_dest, l_height_dest)  which will be modified\n                 * by this input area.\n                 * */\n                assert( l_res->x0 >= 0);\n                assert( l_res->x1 >= 0);\n                if ( l_x0_dest < (OPJ_UINT32)l_res->x0 ) {\n                        l_start_x_dest = (OPJ_UINT32)l_res->x0 - l_x0_dest;\n                        l_offset_x0_src = 0;\n\n                        if ( l_x1_dest >= (OPJ_UINT32)l_res->x1 ) {\n                                l_width_dest = l_width_src;\n                                l_offset_x1_src = 0;\n                        }\n                        else {\n                                l_width_dest = l_x1_dest - (OPJ_UINT32)l_res->x0 ;\n                                l_offset_x1_src = (OPJ_INT32)(l_width_src - l_width_dest);\n                        }\n                }\n                else {\n                        l_start_x_dest = 0 ;\n                        l_offset_x0_src = (OPJ_INT32)l_x0_dest - l_res->x0;\n\n                        if ( l_x1_dest >= (OPJ_UINT32)l_res->x1 ) {\n                                l_width_dest = l_width_src - (OPJ_UINT32)l_offset_x0_src;\n                                l_offset_x1_src = 0;\n                        }\n                        else {\n                                l_width_dest = l_img_comp_dest->w ;\n                                l_offset_x1_src = l_res->x1 - (OPJ_INT32)l_x1_dest;\n                        }\n                }\n\n                if ( l_y0_dest < (OPJ_UINT32)l_res->y0 ) {\n                        l_start_y_dest = (OPJ_UINT32)l_res->y0 - l_y0_dest;\n                        l_offset_y0_src = 0;\n\n                        if ( l_y1_dest >= (OPJ_UINT32)l_res->y1 ) {\n                                l_height_dest = l_height_src;\n                                l_offset_y1_src = 0;\n                        }\n                        else {\n                                l_height_dest = l_y1_dest - (OPJ_UINT32)l_res->y0 ;\n                                l_offset_y1_src =  (OPJ_INT32)(l_height_src - l_height_dest);\n                        }\n                }\n                else {\n                        l_start_y_dest = 0 ;\n                        l_offset_y0_src = (OPJ_INT32)l_y0_dest - l_res->y0;\n\n                        if ( l_y1_dest >= (OPJ_UINT32)l_res->y1 ) {\n                                l_height_dest = l_height_src - (OPJ_UINT32)l_offset_y0_src;\n                                l_offset_y1_src = 0;\n                        }\n                        else {\n                                l_height_dest = l_img_comp_dest->h ;\n                                l_offset_y1_src = l_res->y1 - (OPJ_INT32)l_y1_dest;\n                        }\n                }\n\n                if( (l_offset_x0_src < 0 ) || (l_offset_y0_src < 0 ) || (l_offset_x1_src < 0 ) || (l_offset_y1_src < 0 ) ){\n                        return OPJ_FALSE;\n                }\n                /* testcase 2977.pdf.asan.67.2198 */\n                if ((OPJ_INT32)l_width_dest < 0 || (OPJ_INT32)l_height_dest < 0) {\n                        return OPJ_FALSE;\n                }\n                /*-----*/\n\n                /* Compute the input buffer offset */\n                l_start_offset_src = l_offset_x0_src + l_offset_y0_src * (OPJ_INT32)l_width_src;\n                l_line_offset_src = l_offset_x1_src + l_offset_x0_src;\n                l_end_offset_src = l_offset_y1_src * (OPJ_INT32)l_width_src - l_offset_x0_src;\n\n                /* Compute the output buffer offset */\n                l_start_offset_dest = (OPJ_INT32)(l_start_x_dest + l_start_y_dest * l_img_comp_dest->w);\n                l_line_offset_dest = (OPJ_INT32)(l_img_comp_dest->w - l_width_dest);\n\n                /* Move the output buffer to the first place where we will write*/\n                l_dest_ptr = l_img_comp_dest->data + l_start_offset_dest;\n\n                /*if (i == 0) {\n                        fprintf(stdout, \"COMPO[%d]:\\n\",i);\n                        fprintf(stdout, \"SRC: l_start_x_src=%d, l_start_y_src=%d, l_width_src=%d, l_height_src=%d\\n\"\n                                        \"\\t tile offset:%d, %d, %d, %d\\n\"\n                                        \"\\t buffer offset: %d; %d, %d\\n\",\n                                        l_res->x0, l_res->y0, l_width_src, l_height_src,\n                                        l_offset_x0_src, l_offset_y0_src, l_offset_x1_src, l_offset_y1_src,\n                                        l_start_offset_src, l_line_offset_src, l_end_offset_src);\n\n                        fprintf(stdout, \"DEST: l_start_x_dest=%d, l_start_y_dest=%d, l_width_dest=%d, l_height_dest=%d\\n\"\n                                        \"\\t start offset: %d, line offset= %d\\n\",\n                                        l_start_x_dest, l_start_y_dest, l_width_dest, l_height_dest, l_start_offset_dest, l_line_offset_dest);\n                }*/\n\n                switch (l_size_comp) {\n                        case 1:\n                                {\n                                        OPJ_CHAR * l_src_ptr = (OPJ_CHAR*) p_data;\n                                        l_src_ptr += l_start_offset_src; /* Move to the first place where we will read*/\n\n                                        if (l_img_comp_src->sgnd) {\n                                                for (j = 0 ; j < l_height_dest ; ++j) {\n                                                        for ( k = 0 ; k < l_width_dest ; ++k) {\n                                                                *(l_dest_ptr++) = (OPJ_INT32) (*(l_src_ptr++)); /* Copy only the data needed for the output image */\n                                                        }\n\n                                                        l_dest_ptr+= l_line_offset_dest; /* Move to the next place where we will write */\n                                                        l_src_ptr += l_line_offset_src ; /* Move to the next place where we will read */\n                                                }\n                                        }\n                                        else {\n                                                for ( j = 0 ; j < l_height_dest ; ++j ) {\n                                                        for ( k = 0 ; k < l_width_dest ; ++k) {\n                                                                *(l_dest_ptr++) = (OPJ_INT32) ((*(l_src_ptr++))&0xff);\n                                                        }\n\n                                                        l_dest_ptr+= l_line_offset_dest;\n                                                        l_src_ptr += l_line_offset_src;\n                                                }\n                                        }\n\n                                        l_src_ptr += l_end_offset_src; /* Move to the end of this component-part of the input buffer */\n                                        p_data = (OPJ_BYTE*) l_src_ptr; /* Keep the current position for the next component-part */\n                                }\n                                break;\n                        case 2:\n                                {\n                                        OPJ_INT16 * l_src_ptr = (OPJ_INT16 *) p_data;\n                                        l_src_ptr += l_start_offset_src;\n\n                                        if (l_img_comp_src->sgnd) {\n                                                for (j=0;j<l_height_dest;++j) {\n                                                        for (k=0;k<l_width_dest;++k) {\n                                                                *(l_dest_ptr++) = *(l_src_ptr++);\n                                                        }\n\n                                                        l_dest_ptr+= l_line_offset_dest;\n                                                        l_src_ptr += l_line_offset_src ;\n                                                }\n                                        }\n                                        else {\n                                                for (j=0;j<l_height_dest;++j) {\n                                                        for (k=0;k<l_width_dest;++k) {\n                                                                *(l_dest_ptr++) = (*(l_src_ptr++))&0xffff;\n                                                        }\n\n                                                        l_dest_ptr+= l_line_offset_dest;\n                                                        l_src_ptr += l_line_offset_src ;\n                                                }\n                                        }\n\n                                        l_src_ptr += l_end_offset_src;\n                                        p_data = (OPJ_BYTE*) l_src_ptr;\n                                }\n                                break;\n                        case 4:\n                                {\n                                        OPJ_INT32 * l_src_ptr = (OPJ_INT32 *) p_data;\n                                        l_src_ptr += l_start_offset_src;\n\n                                        for (j=0;j<l_height_dest;++j) {\n                                                for (k=0;k<l_width_dest;++k) {\n                                                        *(l_dest_ptr++) = (*(l_src_ptr++));\n                                                }\n\n                                                l_dest_ptr+= l_line_offset_dest;\n                                                l_src_ptr += l_line_offset_src ;\n                                        }\n\n                                        l_src_ptr += l_end_offset_src;\n                                        p_data = (OPJ_BYTE*) l_src_ptr;\n                                }\n                                break;\n                }\n\n                ++l_img_comp_dest;\n                ++l_img_comp_src;\n                ++l_tilec;\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_set_decode_area(       opj_j2k_t *p_j2k,\n                                                                    opj_image_t* p_image,\n                                                                    OPJ_INT32 p_start_x, OPJ_INT32 p_start_y,\n                                                                    OPJ_INT32 p_end_x, OPJ_INT32 p_end_y,\n                                                                    opj_event_mgr_t * p_manager )\n{\n        opj_cp_t * l_cp = &(p_j2k->m_cp);\n        opj_image_t * l_image = p_j2k->m_private_image;\n\n        OPJ_UINT32 it_comp;\n        OPJ_INT32 l_comp_x1, l_comp_y1;\n        opj_image_comp_t* l_img_comp = NULL;\n\n        /* Check if we are read the main header */\n        if (p_j2k->m_specific_param.m_decoder.m_state != J2K_STATE_TPHSOT) { /* FIXME J2K_DEC_STATE_TPHSOT)*/\n                opj_event_msg(p_manager, EVT_ERROR, \"Need to decode the main header before begin to decode the remaining codestream\");\n                return OPJ_FALSE;\n        }\n\n        if ( !p_start_x && !p_start_y && !p_end_x && !p_end_y){\n                opj_event_msg(p_manager, EVT_INFO, \"No decoded area parameters, set the decoded area to the whole image\\n\");\n\n                p_j2k->m_specific_param.m_decoder.m_start_tile_x = 0;\n                p_j2k->m_specific_param.m_decoder.m_start_tile_y = 0;\n                p_j2k->m_specific_param.m_decoder.m_end_tile_x = l_cp->tw;\n                p_j2k->m_specific_param.m_decoder.m_end_tile_y = l_cp->th;\n\n                return OPJ_TRUE;\n        }\n\n        /* ----- */\n        /* Check if the positions provided by the user are correct */\n\n        /* Left */\n        assert(p_start_x >= 0 );\n        assert(p_start_y >= 0 );\n\n        if ((OPJ_UINT32)p_start_x > l_image->x1 ) {\n                opj_event_msg(p_manager, EVT_ERROR,\n                        \"Left position of the decoded area (region_x0=%d) is outside the image area (Xsiz=%d).\\n\",\n                        p_start_x, l_image->x1);\n                return OPJ_FALSE;\n        }\n        else if ((OPJ_UINT32)p_start_x < l_image->x0){\n                opj_event_msg(p_manager, EVT_WARNING,\n                                \"Left position of the decoded area (region_x0=%d) is outside the image area (XOsiz=%d).\\n\",\n                                p_start_x, l_image->x0);\n                p_j2k->m_specific_param.m_decoder.m_start_tile_x = 0;\n                p_image->x0 = l_image->x0;\n        }\n        else {\n                p_j2k->m_specific_param.m_decoder.m_start_tile_x = ((OPJ_UINT32)p_start_x - l_cp->tx0) / l_cp->tdx;\n                p_image->x0 = (OPJ_UINT32)p_start_x;\n        }\n\n        /* Up */\n        if ((OPJ_UINT32)p_start_y > l_image->y1){\n                opj_event_msg(p_manager, EVT_ERROR,\n                                \"Up position of the decoded area (region_y0=%d) is outside the image area (Ysiz=%d).\\n\",\n                                p_start_y, l_image->y1);\n                return OPJ_FALSE;\n        }\n        else if ((OPJ_UINT32)p_start_y < l_image->y0){\n                opj_event_msg(p_manager, EVT_WARNING,\n                                \"Up position of the decoded area (region_y0=%d) is outside the image area (YOsiz=%d).\\n\",\n                                p_start_y, l_image->y0);\n                p_j2k->m_specific_param.m_decoder.m_start_tile_y = 0;\n                p_image->y0 = l_image->y0;\n        }\n        else {\n                p_j2k->m_specific_param.m_decoder.m_start_tile_y = ((OPJ_UINT32)p_start_y - l_cp->ty0) / l_cp->tdy;\n                p_image->y0 = (OPJ_UINT32)p_start_y;\n        }\n\n        /* Right */\n        assert((OPJ_UINT32)p_end_x > 0);\n        assert((OPJ_UINT32)p_end_y > 0);\n        if ((OPJ_UINT32)p_end_x < l_image->x0) {\n                opj_event_msg(p_manager, EVT_ERROR,\n                        \"Right position of the decoded area (region_x1=%d) is outside the image area (XOsiz=%d).\\n\",\n                        p_end_x, l_image->x0);\n                return OPJ_FALSE;\n        }\n        else if ((OPJ_UINT32)p_end_x > l_image->x1) {\n                opj_event_msg(p_manager, EVT_WARNING,\n                        \"Right position of the decoded area (region_x1=%d) is outside the image area (Xsiz=%d).\\n\",\n                        p_end_x, l_image->x1);\n                p_j2k->m_specific_param.m_decoder.m_end_tile_x = l_cp->tw;\n                p_image->x1 = l_image->x1;\n        }\n        else {\n                p_j2k->m_specific_param.m_decoder.m_end_tile_x = (OPJ_UINT32)opj_int_ceildiv(p_end_x - (OPJ_INT32)l_cp->tx0, (OPJ_INT32)l_cp->tdx);\n                p_image->x1 = (OPJ_UINT32)p_end_x;\n        }\n\n        /* Bottom */\n        if ((OPJ_UINT32)p_end_y < l_image->y0) {\n                opj_event_msg(p_manager, EVT_ERROR,\n                        \"Bottom position of the decoded area (region_y1=%d) is outside the image area (YOsiz=%d).\\n\",\n                        p_end_y, l_image->y0);\n                return OPJ_FALSE;\n        }\n        if ((OPJ_UINT32)p_end_y > l_image->y1){\n                opj_event_msg(p_manager, EVT_WARNING,\n                        \"Bottom position of the decoded area (region_y1=%d) is outside the image area (Ysiz=%d).\\n\",\n                        p_end_y, l_image->y1);\n                p_j2k->m_specific_param.m_decoder.m_end_tile_y = l_cp->th;\n                p_image->y1 = l_image->y1;\n        }\n        else{\n                p_j2k->m_specific_param.m_decoder.m_end_tile_y = (OPJ_UINT32)opj_int_ceildiv(p_end_y - (OPJ_INT32)l_cp->ty0, (OPJ_INT32)l_cp->tdy);\n                p_image->y1 = (OPJ_UINT32)p_end_y;\n        }\n        /* ----- */\n\n        p_j2k->m_specific_param.m_decoder.m_discard_tiles = 1;\n\n        l_img_comp = p_image->comps;\n        for (it_comp=0; it_comp < p_image->numcomps; ++it_comp)\n        {\n                OPJ_INT32 l_h,l_w;\n\n                l_img_comp->x0 = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)p_image->x0, (OPJ_INT32)l_img_comp->dx);\n                l_img_comp->y0 = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)p_image->y0, (OPJ_INT32)l_img_comp->dy);\n                l_comp_x1 = opj_int_ceildiv((OPJ_INT32)p_image->x1, (OPJ_INT32)l_img_comp->dx);\n                l_comp_y1 = opj_int_ceildiv((OPJ_INT32)p_image->y1, (OPJ_INT32)l_img_comp->dy);\n\n                l_w = opj_int_ceildivpow2(l_comp_x1, (OPJ_INT32)l_img_comp->factor)\n                                - opj_int_ceildivpow2((OPJ_INT32)l_img_comp->x0, (OPJ_INT32)l_img_comp->factor);\n                if (l_w < 0){\n                        opj_event_msg(p_manager, EVT_ERROR,\n                                \"Size x of the decoded component image is incorrect (comp[%d].w=%d).\\n\",\n                                it_comp, l_w);\n                        return OPJ_FALSE;\n                }\n                l_img_comp->w = (OPJ_UINT32)l_w;\n\n                l_h = opj_int_ceildivpow2(l_comp_y1, (OPJ_INT32)l_img_comp->factor)\n                                - opj_int_ceildivpow2((OPJ_INT32)l_img_comp->y0, (OPJ_INT32)l_img_comp->factor);\n                if (l_h < 0){\n                        opj_event_msg(p_manager, EVT_ERROR,\n                                \"Size y of the decoded component image is incorrect (comp[%d].h=%d).\\n\",\n                                it_comp, l_h);\n                        return OPJ_FALSE;\n                }\n                l_img_comp->h = (OPJ_UINT32)l_h;\n\n                l_img_comp++;\n        }\n\n        opj_event_msg( p_manager, EVT_INFO,\"Setting decoding area to %d,%d,%d,%d\\n\",\n                        p_image->x0, p_image->y0, p_image->x1, p_image->y1);\n\n        return OPJ_TRUE;\n}\n\nopj_j2k_t* opj_j2k_create_decompress(void)\n{\n        opj_j2k_t *l_j2k = (opj_j2k_t*) opj_malloc(sizeof(opj_j2k_t));\n        if (!l_j2k) {\n                return 00;\n        }\n        memset(l_j2k,0,sizeof(opj_j2k_t));\n\n        l_j2k->m_is_decoder = 1;\n        l_j2k->m_cp.m_is_decoder = 1;\n\n        l_j2k->m_specific_param.m_decoder.m_default_tcp = (opj_tcp_t*) opj_malloc(sizeof(opj_tcp_t));\n        if (!l_j2k->m_specific_param.m_decoder.m_default_tcp) {\n                opj_j2k_destroy(l_j2k);\n                return 00;\n        }\n        memset(l_j2k->m_specific_param.m_decoder.m_default_tcp,0,sizeof(opj_tcp_t));\n\n        l_j2k->m_specific_param.m_decoder.m_header_data = (OPJ_BYTE *) opj_malloc(OPJ_J2K_DEFAULT_HEADER_SIZE);\n        if (! l_j2k->m_specific_param.m_decoder.m_header_data) {\n                opj_j2k_destroy(l_j2k);\n                return 00;\n        }\n\n        l_j2k->m_specific_param.m_decoder.m_header_data_size = OPJ_J2K_DEFAULT_HEADER_SIZE;\n\n        l_j2k->m_specific_param.m_decoder.m_tile_ind_to_dec = -1 ;\n\n        l_j2k->m_specific_param.m_decoder.m_last_sot_read_pos = 0 ;\n\n        /* codestream index creation */\n        l_j2k->cstr_index = opj_j2k_create_cstr_index();\n\n                        /*(opj_codestream_index_t*) opj_malloc(sizeof(opj_codestream_index_t));\n        if (!l_j2k->cstr_index){\n                opj_j2k_destroy(l_j2k);\n                return NULL;\n        }\n\n        l_j2k->cstr_index->marker = (opj_marker_info_t*) opj_malloc(100 * sizeof(opj_marker_info_t));\n*/\n\n        /* validation list creation */\n        l_j2k->m_validation_list = opj_procedure_list_create();\n        if (! l_j2k->m_validation_list) {\n                opj_j2k_destroy(l_j2k);\n                return 00;\n        }\n\n        /* execution list creation */\n        l_j2k->m_procedure_list = opj_procedure_list_create();\n        if (! l_j2k->m_procedure_list) {\n                opj_j2k_destroy(l_j2k);\n                return 00;\n        }\n\n        return l_j2k;\n}\n\nopj_codestream_index_t* opj_j2k_create_cstr_index(void)\n{\n        opj_codestream_index_t* cstr_index = (opj_codestream_index_t*)\n                        opj_calloc(1,sizeof(opj_codestream_index_t));\n        if (!cstr_index)\n                return NULL;\n\n        cstr_index->maxmarknum = 100;\n        cstr_index->marknum = 0;\n        cstr_index->marker = (opj_marker_info_t*)\n                        opj_calloc(cstr_index->maxmarknum, sizeof(opj_marker_info_t));\n        if (!cstr_index-> marker)\n                return NULL;\n\n        cstr_index->tile_index = NULL;\n\n        return cstr_index;\n}\n\nOPJ_UINT32 opj_j2k_get_SPCod_SPCoc_size (       opj_j2k_t *p_j2k,\n                                                                                OPJ_UINT32 p_tile_no,\n                                                                                OPJ_UINT32 p_comp_no )\n{\n        opj_cp_t *l_cp = 00;\n        opj_tcp_t *l_tcp = 00;\n        opj_tccp_t *l_tccp = 00;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n\n        l_cp = &(p_j2k->m_cp);\n        l_tcp = &l_cp->tcps[p_tile_no];\n        l_tccp = &l_tcp->tccps[p_comp_no];\n\n        /* preconditions again */\n        assert(p_tile_no < (l_cp->tw * l_cp->th));\n        assert(p_comp_no < p_j2k->m_private_image->numcomps);\n\n        if (l_tccp->csty & J2K_CCP_CSTY_PRT) {\n                return 5 + l_tccp->numresolutions;\n        }\n        else {\n                return 5;\n        }\n}\n\nOPJ_BOOL opj_j2k_write_SPCod_SPCoc(     opj_j2k_t *p_j2k,\n                                                                    OPJ_UINT32 p_tile_no,\n                                                                    OPJ_UINT32 p_comp_no,\n                                                                    OPJ_BYTE * p_data,\n                                                                    OPJ_UINT32 * p_header_size,\n                                                                    struct opj_event_mgr * p_manager )\n{\n        OPJ_UINT32 i;\n        opj_cp_t *l_cp = 00;\n        opj_tcp_t *l_tcp = 00;\n        opj_tccp_t *l_tccp = 00;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_header_size != 00);\n        assert(p_manager != 00);\n        assert(p_data != 00);\n\n        l_cp = &(p_j2k->m_cp);\n        l_tcp = &l_cp->tcps[p_tile_no];\n        l_tccp = &l_tcp->tccps[p_comp_no];\n\n        /* preconditions again */\n        assert(p_tile_no < (l_cp->tw * l_cp->th));\n        assert(p_comp_no <(p_j2k->m_private_image->numcomps));\n\n        if (*p_header_size < 5) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error writing SPCod SPCoc element\\n\");\n                return OPJ_FALSE;\n        }\n\n        opj_write_bytes(p_data,l_tccp->numresolutions - 1, 1);  /* SPcoc (D) */\n        ++p_data;\n\n        opj_write_bytes(p_data,l_tccp->cblkw - 2, 1);                   /* SPcoc (E) */\n        ++p_data;\n\n        opj_write_bytes(p_data,l_tccp->cblkh - 2, 1);                   /* SPcoc (F) */\n        ++p_data;\n\n        opj_write_bytes(p_data,l_tccp->cblksty, 1);                             /* SPcoc (G) */\n        ++p_data;\n\n        opj_write_bytes(p_data,l_tccp->qmfbid, 1);                              /* SPcoc (H) */\n        ++p_data;\n\n        *p_header_size = *p_header_size - 5;\n\n        if (l_tccp->csty & J2K_CCP_CSTY_PRT) {\n\n                if (*p_header_size < l_tccp->numresolutions) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Error writing SPCod SPCoc element\\n\");\n                        return OPJ_FALSE;\n                }\n\n                for (i = 0; i < l_tccp->numresolutions; ++i) {\n                        opj_write_bytes(p_data,l_tccp->prcw[i] + (l_tccp->prch[i] << 4), 1);    /* SPcoc (I_i) */\n                        ++p_data;\n                }\n\n                *p_header_size = *p_header_size - l_tccp->numresolutions;\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_read_SPCod_SPCoc(  opj_j2k_t *p_j2k,\n                                                                OPJ_UINT32 compno,\n                                                                OPJ_BYTE * p_header_data,\n                                                                OPJ_UINT32 * p_header_size,\n                                                                opj_event_mgr_t * p_manager)\n{\n        OPJ_UINT32 i, l_tmp;\n        opj_cp_t *l_cp = NULL;\n        opj_tcp_t *l_tcp = NULL;\n        opj_tccp_t *l_tccp = NULL;\n        OPJ_BYTE * l_current_ptr = NULL;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_header_data != 00);\n\n        l_cp = &(p_j2k->m_cp);\n        l_tcp = (p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH) ?\n                                &l_cp->tcps[p_j2k->m_current_tile_number] :\n                                p_j2k->m_specific_param.m_decoder.m_default_tcp;\n\n        /* precondition again */\n        assert(compno < p_j2k->m_private_image->numcomps);\n\n        l_tccp = &l_tcp->tccps[compno];\n        l_current_ptr = p_header_data;\n\n        /* make sure room is sufficient */\n        if (*p_header_size < 5) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading SPCod SPCoc element\\n\");\n                return OPJ_FALSE;\n        }\n\n        opj_read_bytes(l_current_ptr, &l_tccp->numresolutions ,1);              /* SPcox (D) */\n        ++l_tccp->numresolutions;                                                                               /* tccp->numresolutions = read() + 1 */\n        if (l_tccp->numresolutions > OPJ_J2K_MAXRLVLS) {\n                opj_event_msg(p_manager, EVT_ERROR,\n                              \"Invalid value for numresolutions : %d, max value is set in openjpeg.h at %d\\n\",\n                              l_tccp->numresolutions, OPJ_J2K_MAXRLVLS);\n                return OPJ_FALSE;\n        }\n        ++l_current_ptr;\n\n        /* If user wants to remove more resolutions than the codestream contains, return error */\n        if (l_cp->m_specific_param.m_dec.m_reduce >= l_tccp->numresolutions) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error decoding component %d.\\nThe number of resolutions to remove is higher than the number \"\n                                        \"of resolutions of this component\\nModify the cp_reduce parameter.\\n\\n\", compno);\n                p_j2k->m_specific_param.m_decoder.m_state |= 0x8000;/* FIXME J2K_DEC_STATE_ERR;*/\n                return OPJ_FALSE;\n        }\n\n        opj_read_bytes(l_current_ptr,&l_tccp->cblkw ,1);                /* SPcoc (E) */\n        ++l_current_ptr;\n        l_tccp->cblkw += 2;\n\n        opj_read_bytes(l_current_ptr,&l_tccp->cblkh ,1);                /* SPcoc (F) */\n        ++l_current_ptr;\n        l_tccp->cblkh += 2;\n\n        opj_read_bytes(l_current_ptr,&l_tccp->cblksty ,1);              /* SPcoc (G) */\n        ++l_current_ptr;\n\n        opj_read_bytes(l_current_ptr,&l_tccp->qmfbid ,1);               /* SPcoc (H) */\n        ++l_current_ptr;\n\n        *p_header_size = *p_header_size - 5;\n\n        /* use custom precinct size ? */\n        if (l_tccp->csty & J2K_CCP_CSTY_PRT) {\n                if (*p_header_size < l_tccp->numresolutions) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Error reading SPCod SPCoc element\\n\");\n                        return OPJ_FALSE;\n                }\n\n                for     (i = 0; i < l_tccp->numresolutions; ++i) {\n                        opj_read_bytes(l_current_ptr,&l_tmp ,1);                /* SPcoc (I_i) */\n                        ++l_current_ptr;\n                        l_tccp->prcw[i] = l_tmp & 0xf;\n                        l_tccp->prch[i] = l_tmp >> 4;\n                }\n\n                *p_header_size = *p_header_size - l_tccp->numresolutions;\n        }\n        else {\n                /* set default size for the precinct width and height */\n                for     (i = 0; i < l_tccp->numresolutions; ++i) {\n                        l_tccp->prcw[i] = 15;\n                        l_tccp->prch[i] = 15;\n                }\n        }\n\n#ifdef WIP_REMOVE_MSD\n        /* INDEX >> */\n        if (p_j2k->cstr_info && compno == 0) {\n                OPJ_UINT32 l_data_size = l_tccp->numresolutions * sizeof(OPJ_UINT32);\n\n                p_j2k->cstr_info->tile[p_j2k->m_current_tile_number].tccp_info[compno].cblkh = l_tccp->cblkh;\n                p_j2k->cstr_info->tile[p_j2k->m_current_tile_number].tccp_info[compno].cblkw = l_tccp->cblkw;\n                p_j2k->cstr_info->tile[p_j2k->m_current_tile_number].tccp_info[compno].numresolutions = l_tccp->numresolutions;\n                p_j2k->cstr_info->tile[p_j2k->m_current_tile_number].tccp_info[compno].cblksty = l_tccp->cblksty;\n                p_j2k->cstr_info->tile[p_j2k->m_current_tile_number].tccp_info[compno].qmfbid = l_tccp->qmfbid;\n\n                memcpy(p_j2k->cstr_info->tile[p_j2k->m_current_tile_number].pdx,l_tccp->prcw, l_data_size);\n                memcpy(p_j2k->cstr_info->tile[p_j2k->m_current_tile_number].pdy,l_tccp->prch, l_data_size);\n        }\n        /* << INDEX */\n#endif\n\n        return OPJ_TRUE;\n}\n\nvoid opj_j2k_copy_tile_component_parameters( opj_j2k_t *p_j2k )\n{\n        /* loop */\n        OPJ_UINT32 i;\n        opj_cp_t *l_cp = NULL;\n        opj_tcp_t *l_tcp = NULL;\n        opj_tccp_t *l_ref_tccp = NULL, *l_copied_tccp = NULL;\n        OPJ_UINT32 l_prc_size;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n\n        l_cp = &(p_j2k->m_cp);\n        l_tcp = (p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH) ? /* FIXME J2K_DEC_STATE_TPH*/\n                                &l_cp->tcps[p_j2k->m_current_tile_number] :\n                                p_j2k->m_specific_param.m_decoder.m_default_tcp;\n\n        l_ref_tccp = &l_tcp->tccps[0];\n        l_copied_tccp = l_ref_tccp + 1;\n        l_prc_size = l_ref_tccp->numresolutions * (OPJ_UINT32)sizeof(OPJ_UINT32);\n\n        for     (i=1; i<p_j2k->m_private_image->numcomps; ++i) {\n                l_copied_tccp->numresolutions = l_ref_tccp->numresolutions;\n                l_copied_tccp->cblkw = l_ref_tccp->cblkw;\n                l_copied_tccp->cblkh = l_ref_tccp->cblkh;\n                l_copied_tccp->cblksty = l_ref_tccp->cblksty;\n                l_copied_tccp->qmfbid = l_ref_tccp->qmfbid;\n                memcpy(l_copied_tccp->prcw,l_ref_tccp->prcw,l_prc_size);\n                memcpy(l_copied_tccp->prch,l_ref_tccp->prch,l_prc_size);\n                ++l_copied_tccp;\n        }\n}\n\nOPJ_UINT32 opj_j2k_get_SQcd_SQcc_size ( opj_j2k_t *p_j2k,\n                                                                        OPJ_UINT32 p_tile_no,\n                                                                        OPJ_UINT32 p_comp_no )\n{\n        OPJ_UINT32 l_num_bands;\n\n        opj_cp_t *l_cp = 00;\n        opj_tcp_t *l_tcp = 00;\n        opj_tccp_t *l_tccp = 00;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n\n        l_cp = &(p_j2k->m_cp);\n        l_tcp = &l_cp->tcps[p_tile_no];\n        l_tccp = &l_tcp->tccps[p_comp_no];\n\n        /* preconditions again */\n        assert(p_tile_no < l_cp->tw * l_cp->th);\n        assert(p_comp_no < p_j2k->m_private_image->numcomps);\n\n        l_num_bands = (l_tccp->qntsty == J2K_CCP_QNTSTY_SIQNT) ? 1 : (l_tccp->numresolutions * 3 - 2);\n\n        if (l_tccp->qntsty == J2K_CCP_QNTSTY_NOQNT)  {\n                return 1 + l_num_bands;\n        }\n        else {\n                return 1 + 2*l_num_bands;\n        }\n}\n\nOPJ_BOOL opj_j2k_write_SQcd_SQcc(       opj_j2k_t *p_j2k,\n                                                                OPJ_UINT32 p_tile_no,\n                                                                OPJ_UINT32 p_comp_no,\n                                                                OPJ_BYTE * p_data,\n                                                                OPJ_UINT32 * p_header_size,\n                                                                struct opj_event_mgr * p_manager )\n{\n        OPJ_UINT32 l_header_size;\n        OPJ_UINT32 l_band_no, l_num_bands;\n        OPJ_UINT32 l_expn,l_mant;\n\n        opj_cp_t *l_cp = 00;\n        opj_tcp_t *l_tcp = 00;\n        opj_tccp_t *l_tccp = 00;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_header_size != 00);\n        assert(p_manager != 00);\n        assert(p_data != 00);\n\n        l_cp = &(p_j2k->m_cp);\n        l_tcp = &l_cp->tcps[p_tile_no];\n        l_tccp = &l_tcp->tccps[p_comp_no];\n\n        /* preconditions again */\n        assert(p_tile_no < l_cp->tw * l_cp->th);\n        assert(p_comp_no <p_j2k->m_private_image->numcomps);\n\n        l_num_bands = (l_tccp->qntsty == J2K_CCP_QNTSTY_SIQNT) ? 1 : (l_tccp->numresolutions * 3 - 2);\n\n        if (l_tccp->qntsty == J2K_CCP_QNTSTY_NOQNT)  {\n                l_header_size = 1 + l_num_bands;\n\n                if (*p_header_size < l_header_size) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Error writing SQcd SQcc element\\n\");\n                        return OPJ_FALSE;\n                }\n\n                opj_write_bytes(p_data,l_tccp->qntsty + (l_tccp->numgbits << 5), 1);    /* Sqcx */\n                ++p_data;\n\n                for (l_band_no = 0; l_band_no < l_num_bands; ++l_band_no) {\n                        l_expn = (OPJ_UINT32)l_tccp->stepsizes[l_band_no].expn;\n                        opj_write_bytes(p_data, l_expn << 3, 1);        /* SPqcx_i */\n                        ++p_data;\n                }\n        }\n        else {\n                l_header_size = 1 + 2*l_num_bands;\n\n                if (*p_header_size < l_header_size) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Error writing SQcd SQcc element\\n\");\n                        return OPJ_FALSE;\n                }\n\n                opj_write_bytes(p_data,l_tccp->qntsty + (l_tccp->numgbits << 5), 1);    /* Sqcx */\n                ++p_data;\n\n                for (l_band_no = 0; l_band_no < l_num_bands; ++l_band_no) {\n                        l_expn = (OPJ_UINT32)l_tccp->stepsizes[l_band_no].expn;\n                        l_mant = (OPJ_UINT32)l_tccp->stepsizes[l_band_no].mant;\n\n                        opj_write_bytes(p_data, (l_expn << 11) + l_mant, 2);    /* SPqcx_i */\n                        p_data += 2;\n                }\n        }\n\n        *p_header_size = *p_header_size - l_header_size;\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_read_SQcd_SQcc(opj_j2k_t *p_j2k,\n                                                            OPJ_UINT32 p_comp_no,\n                                                            OPJ_BYTE* p_header_data,\n                                                            OPJ_UINT32 * p_header_size,\n                                                            opj_event_mgr_t * p_manager\n                                                            )\n{\n        /* loop*/\n        OPJ_UINT32 l_band_no;\n        opj_cp_t *l_cp = 00;\n        opj_tcp_t *l_tcp = 00;\n        opj_tccp_t *l_tccp = 00;\n        OPJ_BYTE * l_current_ptr = 00;\n        OPJ_UINT32 l_tmp, l_num_band;\n\n        /* preconditions*/\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_header_data != 00);\n\n        l_cp = &(p_j2k->m_cp);\n        /* come from tile part header or main header ?*/\n        l_tcp = (p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH) ? /*FIXME J2K_DEC_STATE_TPH*/\n                                &l_cp->tcps[p_j2k->m_current_tile_number] :\n                                p_j2k->m_specific_param.m_decoder.m_default_tcp;\n\n        /* precondition again*/\n        assert(p_comp_no <  p_j2k->m_private_image->numcomps);\n\n        l_tccp = &l_tcp->tccps[p_comp_no];\n        l_current_ptr = p_header_data;\n\n        if (*p_header_size < 1) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error reading SQcd or SQcc element\\n\");\n                return OPJ_FALSE;\n        }\n        *p_header_size -= 1;\n\n        opj_read_bytes(l_current_ptr, &l_tmp ,1);                       /* Sqcx */\n        ++l_current_ptr;\n\n        l_tccp->qntsty = l_tmp & 0x1f;\n        l_tccp->numgbits = l_tmp >> 5;\n        if (l_tccp->qntsty == J2K_CCP_QNTSTY_SIQNT) {\n        l_num_band = 1;\n        }\n        else {\n                l_num_band = (l_tccp->qntsty == J2K_CCP_QNTSTY_NOQNT) ?\n                        (*p_header_size) :\n                        (*p_header_size) / 2;\n\n                if( l_num_band > OPJ_J2K_MAXBANDS ) {\n                        opj_event_msg(p_manager, EVT_WARNING, \"While reading CCP_QNTSTY element inside QCD or QCC marker segment, \"\n                                \"number of subbands (%d) is greater to OPJ_J2K_MAXBANDS (%d). So we limit the number of elements stored to \"\n                                \"OPJ_J2K_MAXBANDS (%d) and skip the rest. \\n\", l_num_band, OPJ_J2K_MAXBANDS, OPJ_J2K_MAXBANDS);\n                        /*return OPJ_FALSE;*/\n                }\n        }\n\n#ifdef USE_JPWL\n        if (l_cp->correct) {\n\n                /* if JPWL is on, we check whether there are too many subbands */\n                if (/*(l_num_band < 0) ||*/ (l_num_band >= OPJ_J2K_MAXBANDS)) {\n                        opj_event_msg(p_manager, JPWL_ASSUME ? EVT_WARNING : EVT_ERROR,\n                                \"JPWL: bad number of subbands in Sqcx (%d)\\n\",\n                                l_num_band);\n                        if (!JPWL_ASSUME) {\n                                opj_event_msg(p_manager, EVT_ERROR, \"JPWL: giving up\\n\");\n                                return OPJ_FALSE;\n                        }\n                        /* we try to correct */\n                        l_num_band = 1;\n                        opj_event_msg(p_manager, EVT_WARNING, \"- trying to adjust them\\n\"\n                                \"- setting number of bands to %d => HYPOTHESIS!!!\\n\",\n                                l_num_band);\n                };\n\n        };\n#endif /* USE_JPWL */\n\n        if (l_tccp->qntsty == J2K_CCP_QNTSTY_NOQNT) {\n                for     (l_band_no = 0; l_band_no < l_num_band; l_band_no++) {\n                        opj_read_bytes(l_current_ptr, &l_tmp ,1);                       /* SPqcx_i */\n                        ++l_current_ptr;\n                        if (l_band_no < OPJ_J2K_MAXBANDS){\n                                l_tccp->stepsizes[l_band_no].expn = (OPJ_INT32)(l_tmp >> 3);\n                                l_tccp->stepsizes[l_band_no].mant = 0;\n                        }\n                }\n                *p_header_size = *p_header_size - l_num_band;\n        }\n        else {\n                for     (l_band_no = 0; l_band_no < l_num_band; l_band_no++) {\n                        opj_read_bytes(l_current_ptr, &l_tmp ,2);                       /* SPqcx_i */\n                        l_current_ptr+=2;\n                        if (l_band_no < OPJ_J2K_MAXBANDS){\n                                l_tccp->stepsizes[l_band_no].expn = (OPJ_INT32)(l_tmp >> 11);\n                                l_tccp->stepsizes[l_band_no].mant = l_tmp & 0x7ff;\n                        }\n                }\n                *p_header_size = *p_header_size - 2*l_num_band;\n        }\n\n        /* Add Antonin : if scalar_derived -> compute other stepsizes */\n        if (l_tccp->qntsty == J2K_CCP_QNTSTY_SIQNT) {\n                for (l_band_no = 1; l_band_no < OPJ_J2K_MAXBANDS; l_band_no++) {\n                        l_tccp->stepsizes[l_band_no].expn =\n                                ((OPJ_INT32)(l_tccp->stepsizes[0].expn) - (OPJ_INT32)((l_band_no - 1) / 3) > 0) ?\n                                        (OPJ_INT32)(l_tccp->stepsizes[0].expn) - (OPJ_INT32)((l_band_no - 1) / 3) : 0;\n                        l_tccp->stepsizes[l_band_no].mant = l_tccp->stepsizes[0].mant;\n                }\n        }\n\n        return OPJ_TRUE;\n}\n\nvoid opj_j2k_copy_tile_quantization_parameters( opj_j2k_t *p_j2k )\n{\n        OPJ_UINT32 i;\n        opj_cp_t *l_cp = NULL;\n        opj_tcp_t *l_tcp = NULL;\n        opj_tccp_t *l_ref_tccp = NULL;\n        opj_tccp_t *l_copied_tccp = NULL;\n        OPJ_UINT32 l_size;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n\n        l_cp = &(p_j2k->m_cp);\n        l_tcp = p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH ?\n                        &l_cp->tcps[p_j2k->m_current_tile_number] :\n                        p_j2k->m_specific_param.m_decoder.m_default_tcp;\n\n        l_ref_tccp = &l_tcp->tccps[0];\n        l_copied_tccp = l_ref_tccp + 1;\n        l_size = OPJ_J2K_MAXBANDS * sizeof(opj_stepsize_t);\n\n        for     (i=1;i<p_j2k->m_private_image->numcomps;++i) {\n                l_copied_tccp->qntsty = l_ref_tccp->qntsty;\n                l_copied_tccp->numgbits = l_ref_tccp->numgbits;\n                memcpy(l_copied_tccp->stepsizes,l_ref_tccp->stepsizes,l_size);\n                ++l_copied_tccp;\n        }\n}\n\nstatic void opj_j2k_dump_tile_info( opj_tcp_t * l_default_tile,OPJ_INT32 numcomps,FILE* out_stream)\n{\n        if (l_default_tile)\n        {\n                OPJ_INT32 compno;\n\n                fprintf(out_stream, \"\\t default tile {\\n\");\n                fprintf(out_stream, \"\\t\\t csty=%#x\\n\", l_default_tile->csty);\n                fprintf(out_stream, \"\\t\\t prg=%#x\\n\", l_default_tile->prg);\n                fprintf(out_stream, \"\\t\\t numlayers=%d\\n\", l_default_tile->numlayers);\n                fprintf(out_stream, \"\\t\\t mct=%x\\n\", l_default_tile->mct);\n\n                for (compno = 0; compno < numcomps; compno++) {\n                        opj_tccp_t *l_tccp = &(l_default_tile->tccps[compno]);\n                        OPJ_UINT32 resno;\n      OPJ_INT32 bandno, numbands;\n\n                        /* coding style*/\n                        fprintf(out_stream, \"\\t\\t comp %d {\\n\", compno);\n                        fprintf(out_stream, \"\\t\\t\\t csty=%#x\\n\", l_tccp->csty);\n                        fprintf(out_stream, \"\\t\\t\\t numresolutions=%d\\n\", l_tccp->numresolutions);\n                        fprintf(out_stream, \"\\t\\t\\t cblkw=2^%d\\n\", l_tccp->cblkw);\n                        fprintf(out_stream, \"\\t\\t\\t cblkh=2^%d\\n\", l_tccp->cblkh);\n                        fprintf(out_stream, \"\\t\\t\\t cblksty=%#x\\n\", l_tccp->cblksty);\n                        fprintf(out_stream, \"\\t\\t\\t qmfbid=%d\\n\", l_tccp->qmfbid);\n\n                        fprintf(out_stream, \"\\t\\t\\t preccintsize (w,h)=\");\n                        for (resno = 0; resno < l_tccp->numresolutions; resno++) {\n                                fprintf(out_stream, \"(%d,%d) \", l_tccp->prcw[resno], l_tccp->prch[resno]);\n                        }\n                        fprintf(out_stream, \"\\n\");\n\n                        /* quantization style*/\n                        fprintf(out_stream, \"\\t\\t\\t qntsty=%d\\n\", l_tccp->qntsty);\n                        fprintf(out_stream, \"\\t\\t\\t numgbits=%d\\n\", l_tccp->numgbits);\n                        fprintf(out_stream, \"\\t\\t\\t stepsizes (m,e)=\");\n                        numbands = (l_tccp->qntsty == J2K_CCP_QNTSTY_SIQNT) ? 1 : (OPJ_INT32)l_tccp->numresolutions * 3 - 2;\n                        for (bandno = 0; bandno < numbands; bandno++) {\n                                fprintf(out_stream, \"(%d,%d) \", l_tccp->stepsizes[bandno].mant,\n                                        l_tccp->stepsizes[bandno].expn);\n                        }\n                        fprintf(out_stream, \"\\n\");\n\n                        /* RGN value*/\n                        fprintf(out_stream, \"\\t\\t\\t roishift=%d\\n\", l_tccp->roishift);\n\n                        fprintf(out_stream, \"\\t\\t }\\n\");\n                } /*end of component of default tile*/\n                fprintf(out_stream, \"\\t }\\n\"); /*end of default tile*/\n            }\n}\n\nvoid j2k_dump (opj_j2k_t* p_j2k, OPJ_INT32 flag, FILE* out_stream)\n{\n        /* Check if the flag is compatible with j2k file*/\n        if ( (flag & OPJ_JP2_INFO) || (flag & OPJ_JP2_IND)){\n                fprintf(out_stream, \"Wrong flag\\n\");\n                return;\n        }\n\n        /* Dump the image_header */\n        if (flag & OPJ_IMG_INFO){\n                if (p_j2k->m_private_image)\n                        j2k_dump_image_header(p_j2k->m_private_image, 0, out_stream);\n        }\n\n        /* Dump the codestream info from main header */\n        if (flag & OPJ_J2K_MH_INFO){\n                opj_j2k_dump_MH_info(p_j2k, out_stream);\n        }\n        /* Dump all tile/codestream info */\n        if (flag & OPJ_J2K_TCH_INFO){\n          OPJ_UINT32 l_nb_tiles = p_j2k->m_cp.th * p_j2k->m_cp.tw;\n          OPJ_UINT32 i;\n          opj_tcp_t * l_tcp = p_j2k->m_cp.tcps;\n          for (i=0;i<l_nb_tiles;++i) {\n            opj_j2k_dump_tile_info( l_tcp,(OPJ_INT32)p_j2k->m_private_image->numcomps, out_stream);\n            ++l_tcp;\n          }\n        }\n\n        /* Dump the codestream info of the current tile */\n        if (flag & OPJ_J2K_TH_INFO){\n\n        }\n\n        /* Dump the codestream index from main header */\n        if (flag & OPJ_J2K_MH_IND){\n                opj_j2k_dump_MH_index(p_j2k, out_stream);\n        }\n\n        /* Dump the codestream index of the current tile */\n        if (flag & OPJ_J2K_TH_IND){\n\n        }\n\n}\n\nvoid opj_j2k_dump_MH_index(opj_j2k_t* p_j2k, FILE* out_stream)\n{\n        opj_codestream_index_t* cstr_index = p_j2k->cstr_index;\n        OPJ_UINT32 it_marker, it_tile, it_tile_part;\n\n        fprintf(out_stream, \"Codestream index from main header: {\\n\");\n\n        fprintf(out_stream, \"\\t Main header start position=%\" PRIi64 \"\\n\"\n                                    \"\\t Main header end position=%\" PRIi64 \"\\n\",\n                        cstr_index->main_head_start, cstr_index->main_head_end);\n\n        fprintf(out_stream, \"\\t Marker list: {\\n\");\n\n        if (cstr_index->marker){\n                for (it_marker=0; it_marker < cstr_index->marknum ; it_marker++){\n                        fprintf(out_stream, \"\\t\\t type=%#x, pos=%\" PRIi64 \", len=%d\\n\",\n                                        cstr_index->marker[it_marker].type,\n                                        cstr_index->marker[it_marker].pos,\n                                        cstr_index->marker[it_marker].len );\n                }\n        }\n\n        fprintf(out_stream, \"\\t }\\n\");\n\n        if (cstr_index->tile_index){\n\n        /* Simple test to avoid to write empty information*/\n        OPJ_UINT32 l_acc_nb_of_tile_part = 0;\n        for (it_tile=0; it_tile < cstr_index->nb_of_tiles ; it_tile++){\n                        l_acc_nb_of_tile_part += cstr_index->tile_index[it_tile].nb_tps;\n        }\n\n        if (l_acc_nb_of_tile_part)\n        {\n            fprintf(out_stream, \"\\t Tile index: {\\n\");\n\n                    for (it_tile=0; it_tile < cstr_index->nb_of_tiles ; it_tile++){\n                            OPJ_UINT32 nb_of_tile_part = cstr_index->tile_index[it_tile].nb_tps;\n\n                            fprintf(out_stream, \"\\t\\t nb of tile-part in tile [%d]=%d\\n\", it_tile, nb_of_tile_part);\n\n                            if (cstr_index->tile_index[it_tile].tp_index){\n                                    for (it_tile_part =0; it_tile_part < nb_of_tile_part; it_tile_part++){\n                                            fprintf(out_stream, \"\\t\\t\\t tile-part[%d]: star_pos=%\" PRIi64 \", end_header=%\" PRIi64 \", end_pos=%\" PRIi64 \".\\n\",\n                                                            it_tile_part,\n                                                            cstr_index->tile_index[it_tile].tp_index[it_tile_part].start_pos,\n                                                            cstr_index->tile_index[it_tile].tp_index[it_tile_part].end_header,\n                                                            cstr_index->tile_index[it_tile].tp_index[it_tile_part].end_pos);\n                                    }\n                            }\n\n                            if (cstr_index->tile_index[it_tile].marker){\n                                    for (it_marker=0; it_marker < cstr_index->tile_index[it_tile].marknum ; it_marker++){\n                                            fprintf(out_stream, \"\\t\\t type=%#x, pos=%\" PRIi64 \", len=%d\\n\",\n                                                            cstr_index->tile_index[it_tile].marker[it_marker].type,\n                                                            cstr_index->tile_index[it_tile].marker[it_marker].pos,\n                                                            cstr_index->tile_index[it_tile].marker[it_marker].len );\n                                    }\n                            }\n                    }\n                    fprintf(out_stream,\"\\t }\\n\");\n        }\n        }\n\n        fprintf(out_stream,\"}\\n\");\n\n}\n\n\nvoid opj_j2k_dump_MH_info(opj_j2k_t* p_j2k, FILE* out_stream)\n{\n\n        fprintf(out_stream, \"Codestream info from main header: {\\n\");\n\n        fprintf(out_stream, \"\\t tx0=%d, ty0=%d\\n\", p_j2k->m_cp.tx0, p_j2k->m_cp.ty0);\n        fprintf(out_stream, \"\\t tdx=%d, tdy=%d\\n\", p_j2k->m_cp.tdx, p_j2k->m_cp.tdy);\n        fprintf(out_stream, \"\\t tw=%d, th=%d\\n\", p_j2k->m_cp.tw, p_j2k->m_cp.th);\n        opj_j2k_dump_tile_info(p_j2k->m_specific_param.m_decoder.m_default_tcp,(OPJ_INT32)p_j2k->m_private_image->numcomps, out_stream);\n        fprintf(out_stream, \"}\\n\");\n}\n\nvoid j2k_dump_image_header(opj_image_t* img_header, OPJ_BOOL dev_dump_flag, FILE* out_stream)\n{\n        char tab[2];\n\n        if (dev_dump_flag){\n                fprintf(stdout, \"[DEV] Dump an image_header struct {\\n\");\n                tab[0] = '\\0';\n        }\n        else {\n                fprintf(out_stream, \"Image info {\\n\");\n                tab[0] = '\\t';tab[1] = '\\0';\n        }\n\n        fprintf(out_stream, \"%s x0=%d, y0=%d\\n\", tab, img_header->x0, img_header->y0);\n        fprintf(out_stream,     \"%s x1=%d, y1=%d\\n\", tab, img_header->x1, img_header->y1);\n        fprintf(out_stream, \"%s numcomps=%d\\n\", tab, img_header->numcomps);\n\n        if (img_header->comps){\n                OPJ_UINT32 compno;\n                for (compno = 0; compno < img_header->numcomps; compno++) {\n                        fprintf(out_stream, \"%s\\t component %d {\\n\", tab, compno);\n                        j2k_dump_image_comp_header(&(img_header->comps[compno]), dev_dump_flag, out_stream);\n                        fprintf(out_stream,\"%s}\\n\",tab);\n                }\n        }\n\n        fprintf(out_stream, \"}\\n\");\n}\n\nvoid j2k_dump_image_comp_header(opj_image_comp_t* comp_header, OPJ_BOOL dev_dump_flag, FILE* out_stream)\n{\n        char tab[3];\n\n        if (dev_dump_flag){\n                fprintf(stdout, \"[DEV] Dump an image_comp_header struct {\\n\");\n                tab[0] = '\\0';\n        }       else {\n                tab[0] = '\\t';tab[1] = '\\t';tab[2] = '\\0';\n        }\n\n        fprintf(out_stream, \"%s dx=%d, dy=%d\\n\", tab, comp_header->dx, comp_header->dy);\n        fprintf(out_stream, \"%s prec=%d\\n\", tab, comp_header->prec);\n        fprintf(out_stream, \"%s sgnd=%d\\n\", tab, comp_header->sgnd);\n\n        if (dev_dump_flag)\n                fprintf(out_stream, \"}\\n\");\n}\n\nopj_codestream_info_v2_t* j2k_get_cstr_info(opj_j2k_t* p_j2k)\n{\n        OPJ_UINT32 compno;\n        OPJ_UINT32 numcomps = p_j2k->m_private_image->numcomps;\n        opj_tcp_t *l_default_tile;\n        opj_codestream_info_v2_t* cstr_info = (opj_codestream_info_v2_t*) opj_calloc(1,sizeof(opj_codestream_info_v2_t));\n\t\tif (!cstr_info)\n\t\t\treturn NULL;\n\n        cstr_info->nbcomps = p_j2k->m_private_image->numcomps;\n\n        cstr_info->tx0 = p_j2k->m_cp.tx0;\n        cstr_info->ty0 = p_j2k->m_cp.ty0;\n        cstr_info->tdx = p_j2k->m_cp.tdx;\n        cstr_info->tdy = p_j2k->m_cp.tdy;\n        cstr_info->tw = p_j2k->m_cp.tw;\n        cstr_info->th = p_j2k->m_cp.th;\n\n        cstr_info->tile_info = NULL; /* Not fill from the main header*/\n\n        l_default_tile = p_j2k->m_specific_param.m_decoder.m_default_tcp;\n\n        cstr_info->m_default_tile_info.csty = l_default_tile->csty;\n        cstr_info->m_default_tile_info.prg = l_default_tile->prg;\n        cstr_info->m_default_tile_info.numlayers = l_default_tile->numlayers;\n        cstr_info->m_default_tile_info.mct = l_default_tile->mct;\n\n        cstr_info->m_default_tile_info.tccp_info = (opj_tccp_info_t*) opj_calloc(cstr_info->nbcomps, sizeof(opj_tccp_info_t));\n\t\tif (!cstr_info->m_default_tile_info.tccp_info)\n\t\t{\n\t\t\topj_destroy_cstr_info(&cstr_info);\n\t\t\treturn NULL;\n\t\t}\n\n        for (compno = 0; compno < numcomps; compno++) {\n                opj_tccp_t *l_tccp = &(l_default_tile->tccps[compno]);\n                opj_tccp_info_t *l_tccp_info = &(cstr_info->m_default_tile_info.tccp_info[compno]);\n                OPJ_INT32 bandno, numbands;\n\n                /* coding style*/\n                l_tccp_info->csty = l_tccp->csty;\n                l_tccp_info->numresolutions = l_tccp->numresolutions;\n                l_tccp_info->cblkw = l_tccp->cblkw;\n                l_tccp_info->cblkh = l_tccp->cblkh;\n                l_tccp_info->cblksty = l_tccp->cblksty;\n                l_tccp_info->qmfbid = l_tccp->qmfbid;\n                if (l_tccp->numresolutions < OPJ_J2K_MAXRLVLS)\n                {\n                        memcpy(l_tccp_info->prch, l_tccp->prch, l_tccp->numresolutions);\n                        memcpy(l_tccp_info->prcw, l_tccp->prcw, l_tccp->numresolutions);\n                }\n\n                /* quantization style*/\n                l_tccp_info->qntsty = l_tccp->qntsty;\n                l_tccp_info->numgbits = l_tccp->numgbits;\n\n                numbands = (l_tccp->qntsty == J2K_CCP_QNTSTY_SIQNT) ? 1 : (OPJ_INT32)l_tccp->numresolutions * 3 - 2;\n                if (numbands < OPJ_J2K_MAXBANDS) {\n                        for (bandno = 0; bandno < numbands; bandno++) {\n                                l_tccp_info->stepsizes_mant[bandno] = (OPJ_UINT32)l_tccp->stepsizes[bandno].mant;\n                                l_tccp_info->stepsizes_expn[bandno] = (OPJ_UINT32)l_tccp->stepsizes[bandno].expn;\n                        }\n                }\n\n                /* RGN value*/\n                l_tccp_info->roishift = l_tccp->roishift;\n        }\n\n        return cstr_info;\n}\n\nopj_codestream_index_t* j2k_get_cstr_index(opj_j2k_t* p_j2k)\n{\n        opj_codestream_index_t* l_cstr_index = (opj_codestream_index_t*)\n                        opj_calloc(1,sizeof(opj_codestream_index_t));\n        if (!l_cstr_index)\n                return NULL;\n\n        l_cstr_index->main_head_start = p_j2k->cstr_index->main_head_start;\n        l_cstr_index->main_head_end = p_j2k->cstr_index->main_head_end;\n        l_cstr_index->codestream_size = p_j2k->cstr_index->codestream_size;\n\n        l_cstr_index->marknum = p_j2k->cstr_index->marknum;\n        l_cstr_index->marker = (opj_marker_info_t*)opj_malloc(l_cstr_index->marknum*sizeof(opj_marker_info_t));\n        if (!l_cstr_index->marker){\n                opj_free( l_cstr_index);\n                return NULL;\n        }\n\n        if (p_j2k->cstr_index->marker)\n                memcpy(l_cstr_index->marker, p_j2k->cstr_index->marker, l_cstr_index->marknum * sizeof(opj_marker_info_t) );\n        else{\n                opj_free(l_cstr_index->marker);\n                l_cstr_index->marker = NULL;\n        }\n\n        l_cstr_index->nb_of_tiles = p_j2k->cstr_index->nb_of_tiles;\n        l_cstr_index->tile_index = (opj_tile_index_t*)opj_calloc(l_cstr_index->nb_of_tiles, sizeof(opj_tile_index_t) );\n        if (!l_cstr_index->tile_index){\n                opj_free( l_cstr_index->marker);\n                opj_free( l_cstr_index);\n                return NULL;\n        }\n\n        if (!p_j2k->cstr_index->tile_index){\n                opj_free(l_cstr_index->tile_index);\n                l_cstr_index->tile_index = NULL;\n        }\n        else {\n                OPJ_UINT32 it_tile = 0;\n                for (it_tile = 0; it_tile < l_cstr_index->nb_of_tiles; it_tile++ ){\n\n                        /* Tile Marker*/\n                        l_cstr_index->tile_index[it_tile].marknum = p_j2k->cstr_index->tile_index[it_tile].marknum;\n\n                        l_cstr_index->tile_index[it_tile].marker =\n                                (opj_marker_info_t*)opj_malloc(l_cstr_index->tile_index[it_tile].marknum*sizeof(opj_marker_info_t));\n\n                        if (!l_cstr_index->tile_index[it_tile].marker) {\n                                OPJ_UINT32 it_tile_free;\n\n                                for (it_tile_free=0; it_tile_free < it_tile; it_tile_free++){\n                                        opj_free(l_cstr_index->tile_index[it_tile_free].marker);\n                                }\n\n                                opj_free( l_cstr_index->tile_index);\n                                opj_free( l_cstr_index->marker);\n                                opj_free( l_cstr_index);\n                                return NULL;\n                        }\n\n                        if (p_j2k->cstr_index->tile_index[it_tile].marker)\n                                memcpy( l_cstr_index->tile_index[it_tile].marker,\n                                                p_j2k->cstr_index->tile_index[it_tile].marker,\n                                                l_cstr_index->tile_index[it_tile].marknum * sizeof(opj_marker_info_t) );\n                        else{\n                                opj_free(l_cstr_index->tile_index[it_tile].marker);\n                                l_cstr_index->tile_index[it_tile].marker = NULL;\n                        }\n\n                        /* Tile part index*/\n                        l_cstr_index->tile_index[it_tile].nb_tps = p_j2k->cstr_index->tile_index[it_tile].nb_tps;\n\n                        l_cstr_index->tile_index[it_tile].tp_index =\n                                (opj_tp_index_t*)opj_malloc(l_cstr_index->tile_index[it_tile].nb_tps*sizeof(opj_tp_index_t));\n\n                        if(!l_cstr_index->tile_index[it_tile].tp_index){\n                                OPJ_UINT32 it_tile_free;\n\n                                for (it_tile_free=0; it_tile_free < it_tile; it_tile_free++){\n                                        opj_free(l_cstr_index->tile_index[it_tile_free].marker);\n                                        opj_free(l_cstr_index->tile_index[it_tile_free].tp_index);\n                                }\n\n                                opj_free( l_cstr_index->tile_index);\n                                opj_free( l_cstr_index->marker);\n                                opj_free( l_cstr_index);\n                                return NULL;\n                        }\n\n                        if (p_j2k->cstr_index->tile_index[it_tile].tp_index){\n                                memcpy( l_cstr_index->tile_index[it_tile].tp_index,\n                                                p_j2k->cstr_index->tile_index[it_tile].tp_index,\n                                                l_cstr_index->tile_index[it_tile].nb_tps * sizeof(opj_tp_index_t) );\n                        }\n                        else{\n                                opj_free(l_cstr_index->tile_index[it_tile].tp_index);\n                                l_cstr_index->tile_index[it_tile].tp_index = NULL;\n                        }\n\n                        /* Packet index (NOT USED)*/\n                        l_cstr_index->tile_index[it_tile].nb_packet = 0;\n                        l_cstr_index->tile_index[it_tile].packet_index = NULL;\n\n                }\n        }\n\n        return l_cstr_index;\n}\n\nOPJ_BOOL opj_j2k_allocate_tile_element_cstr_index(opj_j2k_t *p_j2k)\n{\n        OPJ_UINT32 it_tile=0;\n\n        p_j2k->cstr_index->nb_of_tiles = p_j2k->m_cp.tw * p_j2k->m_cp.th;\n        p_j2k->cstr_index->tile_index = (opj_tile_index_t*)opj_calloc(p_j2k->cstr_index->nb_of_tiles, sizeof(opj_tile_index_t));\n        if (!p_j2k->cstr_index->tile_index)\n                return OPJ_FALSE;\n\n        for (it_tile=0; it_tile < p_j2k->cstr_index->nb_of_tiles; it_tile++){\n                p_j2k->cstr_index->tile_index[it_tile].maxmarknum = 100;\n                p_j2k->cstr_index->tile_index[it_tile].marknum = 0;\n                p_j2k->cstr_index->tile_index[it_tile].marker = (opj_marker_info_t*)\n                                opj_calloc(p_j2k->cstr_index->tile_index[it_tile].maxmarknum, sizeof(opj_marker_info_t));\n                if (!p_j2k->cstr_index->tile_index[it_tile].marker)\n                        return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_decode_tiles ( opj_j2k_t *p_j2k,\n                                                            opj_stream_private_t *p_stream,\n                                                            opj_event_mgr_t * p_manager)\n{\n        OPJ_BOOL l_go_on = OPJ_TRUE;\n        OPJ_UINT32 l_current_tile_no;\n        OPJ_UINT32 l_data_size,l_max_data_size;\n        OPJ_INT32 l_tile_x0,l_tile_y0,l_tile_x1,l_tile_y1;\n        OPJ_UINT32 l_nb_comps;\n        OPJ_BYTE * l_current_data;\n        OPJ_UINT32 nr_tiles = 0;\n\n        l_current_data = (OPJ_BYTE*)opj_malloc(1000);\n        if (! l_current_data) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to decode tiles\\n\");\n                return OPJ_FALSE;\n        }\n        l_max_data_size = 1000;\n\n        while (OPJ_TRUE) {\n                if (! opj_j2k_read_tile_header( p_j2k,\n                                        &l_current_tile_no,\n                                        &l_data_size,\n                                        &l_tile_x0, &l_tile_y0,\n                                        &l_tile_x1, &l_tile_y1,\n                                        &l_nb_comps,\n                                        &l_go_on,\n                                        p_stream,\n                                        p_manager)) {\n                        opj_free(l_current_data);\n                        return OPJ_FALSE;\n                }\n\n                if (! l_go_on) {\n                        break;\n                }\n\n                if (l_data_size > l_max_data_size) {\n                        OPJ_BYTE *l_new_current_data = (OPJ_BYTE *) opj_realloc(l_current_data, l_data_size);\n                        if (! l_new_current_data) {\n                                opj_free(l_current_data);\n                                opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to decode tile %d/%d\\n\", l_current_tile_no +1, p_j2k->m_cp.th * p_j2k->m_cp.tw);\n                                return OPJ_FALSE;\n                        }\n                        l_current_data = l_new_current_data;\n                        l_max_data_size = l_data_size;\n                }\n\n                if (! opj_j2k_decode_tile(p_j2k,l_current_tile_no,l_current_data,l_data_size,p_stream,p_manager)) {\n                        opj_free(l_current_data);\n                        opj_event_msg(p_manager, EVT_ERROR, \"Failed to decode tile %d/%d\\n\", l_current_tile_no +1, p_j2k->m_cp.th * p_j2k->m_cp.tw);\n                        return OPJ_FALSE;\n                }\n                opj_event_msg(p_manager, EVT_INFO, \"Tile %d/%d has been decoded.\\n\", l_current_tile_no +1, p_j2k->m_cp.th * p_j2k->m_cp.tw);\n\n                if (! opj_j2k_update_image_data(p_j2k->m_tcd,l_current_data, p_j2k->m_output_image)) {\n                        opj_free(l_current_data);\n                        return OPJ_FALSE;\n                }\n                opj_event_msg(p_manager, EVT_INFO, \"Image data has been updated with tile %d.\\n\\n\", l_current_tile_no + 1);\n                \n                if(opj_stream_get_number_byte_left(p_stream) == 0  \n                    && p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_NEOC)\n                    break;\n                if(++nr_tiles ==  p_j2k->m_cp.th * p_j2k->m_cp.tw) \n                    break;\n        }\n\n        opj_free(l_current_data);\n\n        return OPJ_TRUE;\n}\n\n/**\n * Sets up the procedures to do on decoding data. Developpers wanting to extend the library can add their own reading procedures.\n */\nstatic void opj_j2k_setup_decoding (opj_j2k_t *p_j2k)\n{\n        /* preconditions*/\n        assert(p_j2k != 00);\n\n        opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_decode_tiles);\n        /* DEVELOPER CORNER, add your custom procedures */\n\n}\n\n/*\n * Read and decode one tile.\n */\nstatic OPJ_BOOL opj_j2k_decode_one_tile (       opj_j2k_t *p_j2k,\n                                                                            opj_stream_private_t *p_stream,\n                                                                            opj_event_mgr_t * p_manager)\n{\n        OPJ_BOOL l_go_on = OPJ_TRUE;\n        OPJ_UINT32 l_current_tile_no;\n        OPJ_UINT32 l_tile_no_to_dec;\n        OPJ_UINT32 l_data_size,l_max_data_size;\n        OPJ_INT32 l_tile_x0,l_tile_y0,l_tile_x1,l_tile_y1;\n        OPJ_UINT32 l_nb_comps;\n        OPJ_BYTE * l_current_data;\n\n        l_current_data = (OPJ_BYTE*)opj_malloc(1000);\n        if (! l_current_data) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to decode one tile\\n\");\n                return OPJ_FALSE;\n        }\n        l_max_data_size = 1000;\n\n        /*Allocate and initialize some elements of codestrem index if not already done*/\n        if( !p_j2k->cstr_index->tile_index)\n        {\n                if (!opj_j2k_allocate_tile_element_cstr_index(p_j2k)){\n                        opj_free(l_current_data);\n                        return OPJ_FALSE;\n                }\n        }\n        /* Move into the codestream to the first SOT used to decode the desired tile */\n        l_tile_no_to_dec = (OPJ_UINT32)p_j2k->m_specific_param.m_decoder.m_tile_ind_to_dec;\n        if (p_j2k->cstr_index->tile_index)\n                if(p_j2k->cstr_index->tile_index->tp_index)\n                {\n                        if ( ! p_j2k->cstr_index->tile_index[l_tile_no_to_dec].nb_tps) {\n                                /* the index for this tile has not been built,\n                                 *  so move to the last SOT read */\n                                if ( !(opj_stream_read_seek(p_stream, p_j2k->m_specific_param.m_decoder.m_last_sot_read_pos+2, p_manager)) ){\n                                        opj_event_msg(p_manager, EVT_ERROR, \"Problem with seek function\\n\");\n                        opj_free(l_current_data);\n                                        return OPJ_FALSE;\n                                }\n                        }\n                        else{\n                                if ( !(opj_stream_read_seek(p_stream, p_j2k->cstr_index->tile_index[l_tile_no_to_dec].tp_index[0].start_pos+2, p_manager)) ) {\n                                        opj_event_msg(p_manager, EVT_ERROR, \"Problem with seek function\\n\");\n                        opj_free(l_current_data);\n                                        return OPJ_FALSE;\n                                }\n                        }\n                        /* Special case if we have previously read the EOC marker (if the previous tile getted is the last ) */\n                        if(p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_EOC)\n                                p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_TPHSOT;\n                }\n\n        while (OPJ_TRUE) {\n                if (! opj_j2k_read_tile_header( p_j2k,\n                                        &l_current_tile_no,\n                                        &l_data_size,\n                                        &l_tile_x0, &l_tile_y0,\n                                        &l_tile_x1, &l_tile_y1,\n                                        &l_nb_comps,\n                                        &l_go_on,\n                                        p_stream,\n                                        p_manager)) {\n                        opj_free(l_current_data);\n                        return OPJ_FALSE;\n                }\n\n                if (! l_go_on) {\n                        break;\n                }\n\n                if (l_data_size > l_max_data_size) {\n                        OPJ_BYTE *l_new_current_data = (OPJ_BYTE *) opj_realloc(l_current_data, l_data_size);\n                        if (! l_new_current_data) {\n                                opj_free(l_current_data);\n                                l_current_data = NULL;\n                                /* TODO: LH: why tile numbering policy used in messages differs from\n                                   the one used in opj_j2k_decode_tiles() ? */\n                                opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to decode tile %d/%d\\n\", l_current_tile_no, (p_j2k->m_cp.th * p_j2k->m_cp.tw) - 1);\n                                return OPJ_FALSE;\n                        }\n                        l_current_data = l_new_current_data;\n                        l_max_data_size = l_data_size;\n                }\n\n                if (! opj_j2k_decode_tile(p_j2k,l_current_tile_no,l_current_data,l_data_size,p_stream,p_manager)) {\n                        opj_free(l_current_data);\n                        return OPJ_FALSE;\n                }\n                opj_event_msg(p_manager, EVT_INFO, \"Tile %d/%d has been decoded.\\n\", l_current_tile_no, (p_j2k->m_cp.th * p_j2k->m_cp.tw) - 1);\n\n                if (! opj_j2k_update_image_data(p_j2k->m_tcd,l_current_data, p_j2k->m_output_image)) {\n                        opj_free(l_current_data);\n                        return OPJ_FALSE;\n                }\n                opj_event_msg(p_manager, EVT_INFO, \"Image data has been updated with tile %d.\\n\\n\", l_current_tile_no);\n\n                if(l_current_tile_no == l_tile_no_to_dec)\n                {\n                        /* move into the codestream to the the first SOT (FIXME or not move?)*/\n                        if (!(opj_stream_read_seek(p_stream, p_j2k->cstr_index->main_head_end + 2, p_manager) ) ) {\n                                opj_event_msg(p_manager, EVT_ERROR, \"Problem with seek function\\n\");\n                                return OPJ_FALSE;\n                        }\n                        break;\n                }\n                else {\n                        opj_event_msg(p_manager, EVT_WARNING, \"Tile read, decode and updated is not the desired (%d vs %d).\\n\", l_current_tile_no, l_tile_no_to_dec);\n                }\n\n        }\n\n        opj_free(l_current_data);\n\n        return OPJ_TRUE;\n}\n\n/**\n * Sets up the procedures to do on decoding one tile. Developpers wanting to extend the library can add their own reading procedures.\n */\nstatic void opj_j2k_setup_decoding_tile (opj_j2k_t *p_j2k)\n{\n        /* preconditions*/\n        assert(p_j2k != 00);\n\n        opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_decode_one_tile);\n        /* DEVELOPER CORNER, add your custom procedures */\n\n}\n\nOPJ_BOOL opj_j2k_decode(opj_j2k_t * p_j2k,\n                                                opj_stream_private_t * p_stream,\n                                                opj_image_t * p_image,\n                                                opj_event_mgr_t * p_manager)\n{\n        OPJ_UINT32 compno;\n\n        if (!p_image)\n                return OPJ_FALSE;\n\n        p_j2k->m_output_image = opj_image_create0();\n        if (! (p_j2k->m_output_image)) {\n                return OPJ_FALSE;\n        }\n        opj_copy_image_header(p_image, p_j2k->m_output_image);\n\n        /* customization of the decoding */\n        opj_j2k_setup_decoding(p_j2k);\n\n        /* Decode the codestream */\n        if (! opj_j2k_exec (p_j2k,p_j2k->m_procedure_list,p_stream,p_manager)) {\n                opj_image_destroy(p_j2k->m_private_image);\n                p_j2k->m_private_image = NULL;\n                return OPJ_FALSE;\n        }\n\n        /* Move data and copy one information from codec to output image*/\n        for (compno = 0; compno < p_image->numcomps; compno++) {\n                p_image->comps[compno].resno_decoded = p_j2k->m_output_image->comps[compno].resno_decoded;\n                p_image->comps[compno].data = p_j2k->m_output_image->comps[compno].data;\n#if 0\n                char fn[256];\n                sprintf( fn, \"/tmp/%d.raw\", compno );\n                FILE *debug = fopen( fn, \"wb\" );\n                fwrite( p_image->comps[compno].data, sizeof(OPJ_INT32), p_image->comps[compno].w * p_image->comps[compno].h, debug );\n                fclose( debug );\n#endif\n                p_j2k->m_output_image->comps[compno].data = NULL;\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_get_tile(      opj_j2k_t *p_j2k,\n                                                    opj_stream_private_t *p_stream,\n                                                    opj_image_t* p_image,\n                                                    opj_event_mgr_t * p_manager,\n                                                    OPJ_UINT32 tile_index )\n{\n        OPJ_UINT32 compno;\n        OPJ_UINT32 l_tile_x, l_tile_y;\n        opj_image_comp_t* l_img_comp;\n\n        if (!p_image) {\n                opj_event_msg(p_manager, EVT_ERROR, \"We need an image previously created.\\n\");\n                return OPJ_FALSE;\n        }\n\n        if ( /*(tile_index < 0) &&*/ (tile_index >= p_j2k->m_cp.tw * p_j2k->m_cp.th) ){\n                opj_event_msg(p_manager, EVT_ERROR, \"Tile index provided by the user is incorrect %d (max = %d) \\n\", tile_index, (p_j2k->m_cp.tw * p_j2k->m_cp.th) - 1);\n                return OPJ_FALSE;\n        }\n\n        /* Compute the dimension of the desired tile*/\n        l_tile_x = tile_index % p_j2k->m_cp.tw;\n        l_tile_y = tile_index / p_j2k->m_cp.tw;\n\n        p_image->x0 = l_tile_x * p_j2k->m_cp.tdx + p_j2k->m_cp.tx0;\n        if (p_image->x0 < p_j2k->m_private_image->x0)\n                p_image->x0 = p_j2k->m_private_image->x0;\n        p_image->x1 = (l_tile_x + 1) * p_j2k->m_cp.tdx + p_j2k->m_cp.tx0;\n        if (p_image->x1 > p_j2k->m_private_image->x1)\n                p_image->x1 = p_j2k->m_private_image->x1;\n\n        p_image->y0 = l_tile_y * p_j2k->m_cp.tdy + p_j2k->m_cp.ty0;\n        if (p_image->y0 < p_j2k->m_private_image->y0)\n                p_image->y0 = p_j2k->m_private_image->y0;\n        p_image->y1 = (l_tile_y + 1) * p_j2k->m_cp.tdy + p_j2k->m_cp.ty0;\n        if (p_image->y1 > p_j2k->m_private_image->y1)\n                p_image->y1 = p_j2k->m_private_image->y1;\n\n        l_img_comp = p_image->comps;\n        for (compno=0; compno < p_image->numcomps; ++compno)\n        {\n                OPJ_INT32 l_comp_x1, l_comp_y1;\n\n                l_img_comp->factor = p_j2k->m_private_image->comps[compno].factor;\n\n                l_img_comp->x0 = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)p_image->x0, (OPJ_INT32)l_img_comp->dx);\n                l_img_comp->y0 = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)p_image->y0, (OPJ_INT32)l_img_comp->dy);\n                l_comp_x1 = opj_int_ceildiv((OPJ_INT32)p_image->x1, (OPJ_INT32)l_img_comp->dx);\n                l_comp_y1 = opj_int_ceildiv((OPJ_INT32)p_image->y1, (OPJ_INT32)l_img_comp->dy);\n\n                l_img_comp->w = (OPJ_UINT32)(opj_int_ceildivpow2(l_comp_x1, (OPJ_INT32)l_img_comp->factor) - opj_int_ceildivpow2((OPJ_INT32)l_img_comp->x0, (OPJ_INT32)l_img_comp->factor));\n                l_img_comp->h = (OPJ_UINT32)(opj_int_ceildivpow2(l_comp_y1, (OPJ_INT32)l_img_comp->factor) - opj_int_ceildivpow2((OPJ_INT32)l_img_comp->y0, (OPJ_INT32)l_img_comp->factor));\n\n                l_img_comp++;\n        }\n\n        /* Destroy the previous output image*/\n        if (p_j2k->m_output_image)\n                opj_image_destroy(p_j2k->m_output_image);\n\n        /* Create the ouput image from the information previously computed*/\n        p_j2k->m_output_image = opj_image_create0();\n        if (! (p_j2k->m_output_image)) {\n                return OPJ_FALSE;\n        }\n        opj_copy_image_header(p_image, p_j2k->m_output_image);\n\n        p_j2k->m_specific_param.m_decoder.m_tile_ind_to_dec = (OPJ_INT32)tile_index;\n\n        /* customization of the decoding */\n        opj_j2k_setup_decoding_tile(p_j2k);\n\n        /* Decode the codestream */\n        if (! opj_j2k_exec (p_j2k,p_j2k->m_procedure_list,p_stream,p_manager)) {\n                opj_image_destroy(p_j2k->m_private_image);\n                p_j2k->m_private_image = NULL;\n                return OPJ_FALSE;\n        }\n\n        /* Move data and copy one information from codec to output image*/\n        for (compno = 0; compno < p_image->numcomps; compno++) {\n                p_image->comps[compno].resno_decoded = p_j2k->m_output_image->comps[compno].resno_decoded;\n\n                if (p_image->comps[compno].data)\n                        opj_free(p_image->comps[compno].data);\n\n                p_image->comps[compno].data = p_j2k->m_output_image->comps[compno].data;\n\n                p_j2k->m_output_image->comps[compno].data = NULL;\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_set_decoded_resolution_factor(opj_j2k_t *p_j2k,\n                                               OPJ_UINT32 res_factor,\n                                               opj_event_mgr_t * p_manager)\n{\n        OPJ_UINT32 it_comp;\n\n        p_j2k->m_cp.m_specific_param.m_dec.m_reduce = res_factor;\n\n        if (p_j2k->m_private_image) {\n                if (p_j2k->m_private_image->comps) {\n                        if (p_j2k->m_specific_param.m_decoder.m_default_tcp) {\n                                if (p_j2k->m_specific_param.m_decoder.m_default_tcp->tccps) {\n                                        for (it_comp = 0 ; it_comp < p_j2k->m_private_image->numcomps; it_comp++) {\n                                                OPJ_UINT32 max_res = p_j2k->m_specific_param.m_decoder.m_default_tcp->tccps[it_comp].numresolutions;\n                                                if ( res_factor >= max_res){\n                                                        opj_event_msg(p_manager, EVT_ERROR, \"Resolution factor is greater than the maximum resolution in the component.\\n\");\n                                                        return OPJ_FALSE;\n                                                }\n                                                p_j2k->m_private_image->comps[it_comp].factor = res_factor;\n                                        }\n                                        return OPJ_TRUE;\n                                }\n                        }\n                }\n        }\n\n        return OPJ_FALSE;\n}\n\nOPJ_BOOL opj_j2k_encode(opj_j2k_t * p_j2k,\n                        opj_stream_private_t *p_stream,\n                        opj_event_mgr_t * p_manager )\n{\n        OPJ_UINT32 i;\n        OPJ_UINT32 l_nb_tiles;\n        OPJ_UINT32 l_max_tile_size, l_current_tile_size;\n        OPJ_BYTE * l_current_data;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_stream != 00);\n        assert(p_manager != 00);\n\n        l_current_data = (OPJ_BYTE*)opj_malloc(1000);\n        if (! l_current_data) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to encode all tiles\\n\");\n                return OPJ_FALSE;\n        }\n        l_max_tile_size = 1000;\n\n        l_nb_tiles = p_j2k->m_cp.th * p_j2k->m_cp.tw;\n        for (i=0;i<l_nb_tiles;++i) {\n                if (! opj_j2k_pre_write_tile(p_j2k,i,p_stream,p_manager)) {\n                        opj_free(l_current_data);\n                        return OPJ_FALSE;\n                }\n\n                l_current_tile_size = opj_tcd_get_encoded_tile_size(p_j2k->m_tcd);\n                if (l_current_tile_size > l_max_tile_size) {\n                        OPJ_BYTE *l_new_current_data = (OPJ_BYTE *) opj_realloc(l_current_data, l_current_tile_size);\n                        if (! l_new_current_data) {\n                                opj_free(l_current_data);\n                                opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to encode all tiles\\n\");\n                                return OPJ_FALSE;\n                        }\n                        l_current_data = l_new_current_data;\n                        l_max_tile_size = l_current_tile_size;\n                }\n\n                opj_j2k_get_tile_data(p_j2k->m_tcd,l_current_data);\n\n                if (! opj_j2k_post_write_tile (p_j2k,l_current_data,l_current_tile_size,p_stream,p_manager)) {\n                        return OPJ_FALSE;\n                }\n        }\n\n        opj_free(l_current_data);\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_end_compress(  opj_j2k_t *p_j2k,\n                                                        opj_stream_private_t *p_stream,\n                                                        opj_event_mgr_t * p_manager)\n{\n        /* customization of the encoding */\n        opj_j2k_setup_end_compress(p_j2k);\n\n        if (! opj_j2k_exec (p_j2k, p_j2k->m_procedure_list, p_stream, p_manager))\n        {\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_start_compress(opj_j2k_t *p_j2k,\n                                                            opj_stream_private_t *p_stream,\n                                                            opj_image_t * p_image,\n                                                            opj_event_mgr_t * p_manager)\n{\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_stream != 00);\n        assert(p_manager != 00);\n\n        p_j2k->m_private_image = opj_image_create0();\n        opj_copy_image_header(p_image, p_j2k->m_private_image);\n\n        /* TODO_MSD: Find a better way */\n        if (p_image->comps) {\n                OPJ_UINT32 it_comp;\n                for (it_comp = 0 ; it_comp < p_image->numcomps; it_comp++) {\n                        if (p_image->comps[it_comp].data) {\n                                p_j2k->m_private_image->comps[it_comp].data =p_image->comps[it_comp].data;\n                                p_image->comps[it_comp].data = NULL;\n\n                        }\n                }\n        }\n\n        /* customization of the validation */\n        opj_j2k_setup_encoding_validation (p_j2k);\n\n        /* validation of the parameters codec */\n        if (! opj_j2k_exec(p_j2k,p_j2k->m_validation_list,p_stream,p_manager)) {\n                return OPJ_FALSE;\n        }\n\n        /* customization of the encoding */\n        opj_j2k_setup_header_writing(p_j2k);\n\n        /* write header */\n        if (! opj_j2k_exec (p_j2k,p_j2k->m_procedure_list,p_stream,p_manager)) {\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_pre_write_tile (       opj_j2k_t * p_j2k,\n                                                                OPJ_UINT32 p_tile_index,\n                                                                opj_stream_private_t *p_stream,\n                                                                opj_event_mgr_t * p_manager )\n{\n  (void)p_stream;\n        if (p_tile_index != p_j2k->m_current_tile_number) {\n                opj_event_msg(p_manager, EVT_ERROR, \"The given tile index does not match.\" );\n                return OPJ_FALSE;\n        }\n\n        opj_event_msg(p_manager, EVT_INFO, \"tile number %d / %d\\n\", p_j2k->m_current_tile_number + 1, p_j2k->m_cp.tw * p_j2k->m_cp.th);\n\n        p_j2k->m_specific_param.m_encoder.m_current_tile_part_number = 0;\n        p_j2k->m_tcd->cur_totnum_tp = p_j2k->m_cp.tcps[p_tile_index].m_nb_tile_parts;\n        p_j2k->m_specific_param.m_encoder.m_current_poc_tile_part_number = 0;\n\n        /* initialisation before tile encoding  */\n        if (! opj_tcd_init_encode_tile(p_j2k->m_tcd, p_j2k->m_current_tile_number)) {\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\nvoid opj_j2k_get_tile_data (opj_tcd_t * p_tcd, OPJ_BYTE * p_data)\n{\n        OPJ_UINT32 i,j,k = 0;\n        OPJ_UINT32 l_width,l_height,l_stride, l_offset_x,l_offset_y, l_image_width;\n        opj_image_comp_t * l_img_comp = 00;\n        opj_tcd_tilecomp_t * l_tilec = 00;\n        opj_image_t * l_image = 00;\n        OPJ_UINT32 l_size_comp, l_remaining;\n        OPJ_INT32 * l_src_ptr;\n        l_tilec = p_tcd->tcd_image->tiles->comps;\n        l_image = p_tcd->image;\n        l_img_comp = l_image->comps;\n\n        for (i=0;i<p_tcd->image->numcomps;++i) {\n                l_size_comp = l_img_comp->prec >> 3; /* (/8) */\n                l_remaining = l_img_comp->prec & 7;  /* (%8) */\n                if (l_remaining) {\n                        ++l_size_comp;\n                }\n\n                if (l_size_comp == 3) {\n                        l_size_comp = 4;\n                }\n\n                l_width  = (OPJ_UINT32)(l_tilec->x1 - l_tilec->x0);\n                l_height = (OPJ_UINT32)(l_tilec->y1 - l_tilec->y0);\n                l_offset_x = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)l_image->x0, (OPJ_INT32)l_img_comp->dx);\n                l_offset_y = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)l_image->y0, (OPJ_INT32)l_img_comp->dy);\n                l_image_width = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)l_image->x1 - (OPJ_INT32)l_image->x0, (OPJ_INT32)l_img_comp->dx);\n                l_stride = l_image_width - l_width;\n                l_src_ptr = l_img_comp->data + ((OPJ_UINT32)l_tilec->x0 - l_offset_x) + ((OPJ_UINT32)l_tilec->y0 - l_offset_y) * l_image_width;\n\n                switch (l_size_comp) {\n                        case 1:\n                                {\n                                        OPJ_CHAR * l_dest_ptr = (OPJ_CHAR*) p_data;\n                                        if (l_img_comp->sgnd) {\n                                                for     (j=0;j<l_height;++j) {\n                                                        for (k=0;k<l_width;++k) {\n                                                                *(l_dest_ptr) = (OPJ_CHAR) (*l_src_ptr);\n                                                                ++l_dest_ptr;\n                                                                ++l_src_ptr;\n                                                        }\n                                                        l_src_ptr += l_stride;\n                                                }\n                                        }\n                                        else {\n                                                for (j=0;j<l_height;++j) {\n                                                        for (k=0;k<l_width;++k) {\n                                                                *(l_dest_ptr) = (OPJ_CHAR)((*l_src_ptr)&0xff);\n                                                                ++l_dest_ptr;\n                                                                ++l_src_ptr;\n                                                        }\n                                                        l_src_ptr += l_stride;\n                                                }\n                                        }\n\n                                        p_data = (OPJ_BYTE*) l_dest_ptr;\n                                }\n                                break;\n                        case 2:\n                                {\n                                        OPJ_INT16 * l_dest_ptr = (OPJ_INT16 *) p_data;\n                                        if (l_img_comp->sgnd) {\n                                                for (j=0;j<l_height;++j) {\n                                                        for (k=0;k<l_width;++k) {\n                                                                *(l_dest_ptr++) = (OPJ_INT16) (*(l_src_ptr++));\n                                                        }\n                                                        l_src_ptr += l_stride;\n                                                }\n                                        }\n                                        else {\n                                                for (j=0;j<l_height;++j) {\n                                                        for (k=0;k<l_width;++k) {\n                                                                *(l_dest_ptr++) = (OPJ_INT16)((*(l_src_ptr++)) & 0xffff);\n                                                        }\n                                                        l_src_ptr += l_stride;\n                                                }\n                                        }\n\n                                        p_data = (OPJ_BYTE*) l_dest_ptr;\n                                }\n                                break;\n                        case 4:\n                                {\n                                        OPJ_INT32 * l_dest_ptr = (OPJ_INT32 *) p_data;\n                                        for (j=0;j<l_height;++j) {\n                                                for (k=0;k<l_width;++k) {\n                                                        *(l_dest_ptr++) = *(l_src_ptr++);\n                                                }\n                                                l_src_ptr += l_stride;\n                                        }\n\n                                        p_data = (OPJ_BYTE*) l_dest_ptr;\n                                }\n                                break;\n                }\n\n                ++l_img_comp;\n                ++l_tilec;\n        }\n}\n\nOPJ_BOOL opj_j2k_post_write_tile (      opj_j2k_t * p_j2k,\n                                                                OPJ_BYTE * p_data,\n                                                                OPJ_UINT32 p_data_size,\n                                                                opj_stream_private_t *p_stream,\n                                                                opj_event_mgr_t * p_manager )\n{\n        opj_tcd_t * l_tcd = 00;\n        OPJ_UINT32 l_nb_bytes_written;\n        OPJ_BYTE * l_current_data = 00;\n        OPJ_UINT32 l_tile_size = 0;\n        OPJ_UINT32 l_available_data;\n\n        /* preconditions */\n        assert(p_j2k->m_specific_param.m_encoder.m_encoded_tile_data);\n\n        l_tcd = p_j2k->m_tcd;\n        \n        l_tile_size = p_j2k->m_specific_param.m_encoder.m_encoded_tile_size;\n        l_available_data = l_tile_size;\n        l_current_data = p_j2k->m_specific_param.m_encoder.m_encoded_tile_data;\n\n        if (! opj_tcd_copy_tile_data(l_tcd,p_data,p_data_size)) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Size mismatch between tile data and sent data.\" );\n                return OPJ_FALSE;\n        }\n\n        l_nb_bytes_written = 0;\n        if (! opj_j2k_write_first_tile_part(p_j2k,l_current_data,&l_nb_bytes_written,l_available_data,p_stream,p_manager)) {\n                return OPJ_FALSE;\n        }\n        l_current_data += l_nb_bytes_written;\n        l_available_data -= l_nb_bytes_written;\n\n        l_nb_bytes_written = 0;\n        if (! opj_j2k_write_all_tile_parts(p_j2k,l_current_data,&l_nb_bytes_written,l_available_data,p_stream,p_manager)) {\n                return OPJ_FALSE;\n        }\n\n        l_available_data -= l_nb_bytes_written;\n        l_nb_bytes_written = l_tile_size - l_available_data;\n\n        if ( opj_stream_write_data(     p_stream,\n                                                                p_j2k->m_specific_param.m_encoder.m_encoded_tile_data,\n                                                                l_nb_bytes_written,p_manager) != l_nb_bytes_written) {\n                return OPJ_FALSE;\n        }\n\n        ++p_j2k->m_current_tile_number;\n\n        return OPJ_TRUE;\n}\n\nvoid opj_j2k_setup_end_compress (opj_j2k_t *p_j2k)\n{\n        /* preconditions */\n        assert(p_j2k != 00);\n\n        /* DEVELOPER CORNER, insert your custom procedures */\n        opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_eoc );\n\n        if (OPJ_IS_CINEMA(p_j2k->m_cp.rsiz)) {\n                opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_updated_tlm);\n        }\n\n        opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_epc );\n        opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_end_encoding );\n        opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_destroy_header_memory);\n}\n\nvoid opj_j2k_setup_encoding_validation (opj_j2k_t *p_j2k)\n{\n        /* preconditions */\n        assert(p_j2k != 00);\n\n        opj_procedure_list_add_procedure(p_j2k->m_validation_list, (opj_procedure)opj_j2k_build_encoder);\n        opj_procedure_list_add_procedure(p_j2k->m_validation_list, (opj_procedure)opj_j2k_encoding_validation);\n\n        /* DEVELOPER CORNER, add your custom validation procedure */\n        opj_procedure_list_add_procedure(p_j2k->m_validation_list, (opj_procedure)opj_j2k_mct_validation);\n}\n\nvoid opj_j2k_setup_header_writing (opj_j2k_t *p_j2k)\n{\n        /* preconditions */\n        assert(p_j2k != 00);\n\n        opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_init_info );\n        opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_soc );\n        opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_siz );\n        opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_cod );\n        opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_qcd );\n\n        if (OPJ_IS_CINEMA(p_j2k->m_cp.rsiz)) {\n                /* No need for COC or QCC, QCD and COD are used\n                opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_all_coc );\n                opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_all_qcc );\n                */\n                opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_tlm );\n\n                if (p_j2k->m_cp.rsiz == OPJ_PROFILE_CINEMA_4K) {\n                        opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_poc );\n                }\n        }\n\n        opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_regions);\n\n        if (p_j2k->m_cp.comment != 00)  {\n                opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_com);\n        }\n\n        /* DEVELOPER CORNER, insert your custom procedures */\n        if (p_j2k->m_cp.rsiz & OPJ_EXTENSION_MCT) {\n                opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_write_mct_data_group );\n        }\n        /* End of Developer Corner */\n\n        if (p_j2k->cstr_index) {\n                opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_get_end_header );\n        }\n\n        opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_create_tcd);\n        opj_procedure_list_add_procedure(p_j2k->m_procedure_list,(opj_procedure)opj_j2k_update_rates);\n}\n\nOPJ_BOOL opj_j2k_write_first_tile_part (opj_j2k_t *p_j2k,\n                                                                        OPJ_BYTE * p_data,\n                                                                        OPJ_UINT32 * p_data_written,\n                                                                        OPJ_UINT32 p_total_data_size,\n                                                                        opj_stream_private_t *p_stream,\n                                                                        struct opj_event_mgr * p_manager )\n{\n        OPJ_UINT32 l_nb_bytes_written = 0;\n        OPJ_UINT32 l_current_nb_bytes_written;\n        OPJ_BYTE * l_begin_data = 00;\n\n        opj_tcd_t * l_tcd = 00;\n        opj_cp_t * l_cp = 00;\n\n        l_tcd = p_j2k->m_tcd;\n        l_cp = &(p_j2k->m_cp);\n\n        l_tcd->cur_pino = 0;\n\n        /*Get number of tile parts*/\n        p_j2k->m_specific_param.m_encoder.m_current_poc_tile_part_number = 0;\n\n        /* INDEX >> */\n        /* << INDEX */\n\n        l_current_nb_bytes_written = 0;\n        l_begin_data = p_data;\n        if (! opj_j2k_write_sot(p_j2k,p_data,&l_current_nb_bytes_written,p_stream,p_manager))\n        {\n                return OPJ_FALSE;\n        }\n\n        l_nb_bytes_written += l_current_nb_bytes_written;\n        p_data += l_current_nb_bytes_written;\n        p_total_data_size -= l_current_nb_bytes_written;\n\n        if (!OPJ_IS_CINEMA(l_cp->rsiz)) {\n#if 0\n                for (compno = 1; compno < p_j2k->m_private_image->numcomps; compno++) {\n                        l_current_nb_bytes_written = 0;\n                        opj_j2k_write_coc_in_memory(p_j2k,compno,p_data,&l_current_nb_bytes_written,p_manager);\n                        l_nb_bytes_written += l_current_nb_bytes_written;\n                        p_data += l_current_nb_bytes_written;\n                        p_total_data_size -= l_current_nb_bytes_written;\n\n                        l_current_nb_bytes_written = 0;\n                        opj_j2k_write_qcc_in_memory(p_j2k,compno,p_data,&l_current_nb_bytes_written,p_manager);\n                        l_nb_bytes_written += l_current_nb_bytes_written;\n                        p_data += l_current_nb_bytes_written;\n                        p_total_data_size -= l_current_nb_bytes_written;\n                }\n#endif\n\n                if (l_cp->tcps[p_j2k->m_current_tile_number].numpocs) {\n                        l_current_nb_bytes_written = 0;\n                        opj_j2k_write_poc_in_memory(p_j2k,p_data,&l_current_nb_bytes_written,p_manager);\n                        l_nb_bytes_written += l_current_nb_bytes_written;\n                        p_data += l_current_nb_bytes_written;\n                        p_total_data_size -= l_current_nb_bytes_written;\n                }\n        }\n\n        l_current_nb_bytes_written = 0;\n        if (! opj_j2k_write_sod(p_j2k,l_tcd,p_data,&l_current_nb_bytes_written,p_total_data_size,p_stream,p_manager)) {\n                return OPJ_FALSE;\n        }\n\n        l_nb_bytes_written += l_current_nb_bytes_written;\n        * p_data_written = l_nb_bytes_written;\n\n        /* Writing Psot in SOT marker */\n        opj_write_bytes(l_begin_data + 6,l_nb_bytes_written,4);                                 /* PSOT */\n\n        if (OPJ_IS_CINEMA(l_cp->rsiz)){\n                opj_j2k_update_tlm(p_j2k,l_nb_bytes_written);\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_write_all_tile_parts(  opj_j2k_t *p_j2k,\n                                                                        OPJ_BYTE * p_data,\n                                                                        OPJ_UINT32 * p_data_written,\n                                                                        OPJ_UINT32 p_total_data_size,\n                                                                        opj_stream_private_t *p_stream,\n                                                                        struct opj_event_mgr * p_manager\n                                                                )\n{\n        OPJ_UINT32 tilepartno=0;\n        OPJ_UINT32 l_nb_bytes_written = 0;\n        OPJ_UINT32 l_current_nb_bytes_written;\n        OPJ_UINT32 l_part_tile_size;\n        OPJ_UINT32 tot_num_tp;\n        OPJ_UINT32 pino;\n\n        OPJ_BYTE * l_begin_data;\n        opj_tcp_t *l_tcp = 00;\n        opj_tcd_t * l_tcd = 00;\n        opj_cp_t * l_cp = 00;\n\n        l_tcd = p_j2k->m_tcd;\n        l_cp = &(p_j2k->m_cp);\n        l_tcp = l_cp->tcps + p_j2k->m_current_tile_number;\n\n        /*Get number of tile parts*/\n        tot_num_tp = opj_j2k_get_num_tp(l_cp,0,p_j2k->m_current_tile_number);\n\n        /* start writing remaining tile parts */\n        ++p_j2k->m_specific_param.m_encoder.m_current_tile_part_number;\n        for (tilepartno = 1; tilepartno < tot_num_tp ; ++tilepartno) {\n                p_j2k->m_specific_param.m_encoder.m_current_poc_tile_part_number = tilepartno;\n                l_current_nb_bytes_written = 0;\n                l_part_tile_size = 0;\n                l_begin_data = p_data;\n\n                if (! opj_j2k_write_sot(p_j2k,p_data,&l_current_nb_bytes_written,p_stream,p_manager)) {\n                        return OPJ_FALSE;\n                }\n\n                l_nb_bytes_written += l_current_nb_bytes_written;\n                p_data += l_current_nb_bytes_written;\n                p_total_data_size -= l_current_nb_bytes_written;\n                l_part_tile_size += l_current_nb_bytes_written;\n\n                l_current_nb_bytes_written = 0;\n                if (! opj_j2k_write_sod(p_j2k,l_tcd,p_data,&l_current_nb_bytes_written,p_total_data_size,p_stream,p_manager)) {\n                        return OPJ_FALSE;\n                }\n\n                p_data += l_current_nb_bytes_written;\n                l_nb_bytes_written += l_current_nb_bytes_written;\n                p_total_data_size -= l_current_nb_bytes_written;\n                l_part_tile_size += l_current_nb_bytes_written;\n\n                /* Writing Psot in SOT marker */\n                opj_write_bytes(l_begin_data + 6,l_part_tile_size,4);                                   /* PSOT */\n\n                if (OPJ_IS_CINEMA(l_cp->rsiz)) {\n                        opj_j2k_update_tlm(p_j2k,l_part_tile_size);\n                }\n\n                ++p_j2k->m_specific_param.m_encoder.m_current_tile_part_number;\n        }\n\n        for (pino = 1; pino <= l_tcp->numpocs; ++pino) {\n                l_tcd->cur_pino = pino;\n\n                /*Get number of tile parts*/\n                tot_num_tp = opj_j2k_get_num_tp(l_cp,pino,p_j2k->m_current_tile_number);\n                for (tilepartno = 0; tilepartno < tot_num_tp ; ++tilepartno) {\n                        p_j2k->m_specific_param.m_encoder.m_current_poc_tile_part_number = tilepartno;\n                        l_current_nb_bytes_written = 0;\n                        l_part_tile_size = 0;\n                        l_begin_data = p_data;\n\n                        if (! opj_j2k_write_sot(p_j2k,p_data,&l_current_nb_bytes_written,p_stream,p_manager)) {\n                                return OPJ_FALSE;\n                        }\n\n                        l_nb_bytes_written += l_current_nb_bytes_written;\n                        p_data += l_current_nb_bytes_written;\n                        p_total_data_size -= l_current_nb_bytes_written;\n                        l_part_tile_size += l_current_nb_bytes_written;\n\n                        l_current_nb_bytes_written = 0;\n\n                        if (! opj_j2k_write_sod(p_j2k,l_tcd,p_data,&l_current_nb_bytes_written,p_total_data_size,p_stream,p_manager)) {\n                                return OPJ_FALSE;\n                        }\n\n                        l_nb_bytes_written += l_current_nb_bytes_written;\n                        p_data += l_current_nb_bytes_written;\n                        p_total_data_size -= l_current_nb_bytes_written;\n                        l_part_tile_size += l_current_nb_bytes_written;\n\n                        /* Writing Psot in SOT marker */\n                        opj_write_bytes(l_begin_data + 6,l_part_tile_size,4);                                   /* PSOT */\n\n                        if (OPJ_IS_CINEMA(l_cp->rsiz)) {\n                                opj_j2k_update_tlm(p_j2k,l_part_tile_size);\n                        }\n\n                        ++p_j2k->m_specific_param.m_encoder.m_current_tile_part_number;\n                }\n        }\n\n        *p_data_written = l_nb_bytes_written;\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_write_updated_tlm( opj_j2k_t *p_j2k,\n                                                                    struct opj_stream_private *p_stream,\n                                                                    struct opj_event_mgr * p_manager )\n{\n        OPJ_UINT32 l_tlm_size;\n        OPJ_OFF_T l_tlm_position, l_current_position;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        l_tlm_size = 5 * p_j2k->m_specific_param.m_encoder.m_total_tile_parts;\n        l_tlm_position = 6 + p_j2k->m_specific_param.m_encoder.m_tlm_start;\n        l_current_position = opj_stream_tell(p_stream);\n\n        if (! opj_stream_seek(p_stream,l_tlm_position,p_manager)) {\n                return OPJ_FALSE;\n        }\n\n        if (opj_stream_write_data(p_stream,p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_buffer,l_tlm_size,p_manager) != l_tlm_size) {\n                return OPJ_FALSE;\n        }\n\n        if (! opj_stream_seek(p_stream,l_current_position,p_manager)) {\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_end_encoding(  opj_j2k_t *p_j2k,\n                                                        struct opj_stream_private *p_stream,\n                                                        struct opj_event_mgr * p_manager )\n{\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        opj_tcd_destroy(p_j2k->m_tcd);\n        p_j2k->m_tcd = 00;\n\n        if (p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_buffer) {\n                opj_free(p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_buffer);\n                p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_buffer = 0;\n                p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_current = 0;\n        }\n\n        if (p_j2k->m_specific_param.m_encoder.m_encoded_tile_data) {\n                opj_free(p_j2k->m_specific_param.m_encoder.m_encoded_tile_data);\n                p_j2k->m_specific_param.m_encoder.m_encoded_tile_data = 0;\n        }\n\n        p_j2k->m_specific_param.m_encoder.m_encoded_tile_size = 0;\n\n        return OPJ_TRUE;\n}\n\n/**\n * Destroys the memory associated with the decoding of headers.\n */\nstatic OPJ_BOOL opj_j2k_destroy_header_memory ( opj_j2k_t * p_j2k,\n                                                opj_stream_private_t *p_stream,\n                                                opj_event_mgr_t * p_manager\n                                                )\n{\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_stream != 00);\n        assert(p_manager != 00);\n\n        if (p_j2k->m_specific_param.m_encoder.m_header_tile_data) {\n                opj_free(p_j2k->m_specific_param.m_encoder.m_header_tile_data);\n                p_j2k->m_specific_param.m_encoder.m_header_tile_data = 0;\n        }\n\n        p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = 0;\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_init_info(     opj_j2k_t *p_j2k,\n                                                struct opj_stream_private *p_stream,\n                                                struct opj_event_mgr * p_manager )\n{\n        opj_codestream_info_t * l_cstr_info = 00;\n\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n  (void)l_cstr_info;\n\n        /* TODO mergeV2: check this part which use cstr_info */\n        /*l_cstr_info = p_j2k->cstr_info;\n\n        if (l_cstr_info)  {\n                OPJ_UINT32 compno;\n                l_cstr_info->tile = (opj_tile_info_t *) opj_malloc(p_j2k->m_cp.tw * p_j2k->m_cp.th * sizeof(opj_tile_info_t));\n\n                l_cstr_info->image_w = p_j2k->m_image->x1 - p_j2k->m_image->x0;\n                l_cstr_info->image_h = p_j2k->m_image->y1 - p_j2k->m_image->y0;\n\n                l_cstr_info->prog = (&p_j2k->m_cp.tcps[0])->prg;\n\n                l_cstr_info->tw = p_j2k->m_cp.tw;\n                l_cstr_info->th = p_j2k->m_cp.th;\n\n                l_cstr_info->tile_x = p_j2k->m_cp.tdx;*/        /* new version parser */\n                /*l_cstr_info->tile_y = p_j2k->m_cp.tdy;*/      /* new version parser */\n                /*l_cstr_info->tile_Ox = p_j2k->m_cp.tx0;*/     /* new version parser */\n                /*l_cstr_info->tile_Oy = p_j2k->m_cp.ty0;*/     /* new version parser */\n\n                /*l_cstr_info->numcomps = p_j2k->m_image->numcomps;\n\n                l_cstr_info->numlayers = (&p_j2k->m_cp.tcps[0])->numlayers;\n\n                l_cstr_info->numdecompos = (OPJ_INT32*) opj_malloc(p_j2k->m_image->numcomps * sizeof(OPJ_INT32));\n\n                for (compno=0; compno < p_j2k->m_image->numcomps; compno++) {\n                        l_cstr_info->numdecompos[compno] = (&p_j2k->m_cp.tcps[0])->tccps->numresolutions - 1;\n                }\n\n                l_cstr_info->D_max = 0.0;       */      /* ADD Marcela */\n\n                /*l_cstr_info->main_head_start = opj_stream_tell(p_stream);*/ /* position of SOC */\n\n                /*l_cstr_info->maxmarknum = 100;\n                l_cstr_info->marker = (opj_marker_info_t *) opj_malloc(l_cstr_info->maxmarknum * sizeof(opj_marker_info_t));\n                l_cstr_info->marknum = 0;\n        }*/\n\n        return opj_j2k_calculate_tp(p_j2k,&(p_j2k->m_cp),&p_j2k->m_specific_param.m_encoder.m_total_tile_parts,p_j2k->m_private_image,p_manager);\n}\n\n/**\n * Creates a tile-coder decoder.\n *\n * @param       p_stream                the stream to write data to.\n * @param       p_j2k                   J2K codec.\n * @param       p_manager               the user event manager.\n*/\nstatic OPJ_BOOL opj_j2k_create_tcd(     opj_j2k_t *p_j2k,\n                                                                    opj_stream_private_t *p_stream,\n                                                                    opj_event_mgr_t * p_manager\n                                    )\n{\n        /* preconditions */\n        assert(p_j2k != 00);\n        assert(p_manager != 00);\n        assert(p_stream != 00);\n\n        p_j2k->m_tcd = opj_tcd_create(OPJ_FALSE);\n\n        if (! p_j2k->m_tcd) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to create Tile Coder\\n\");\n                return OPJ_FALSE;\n        }\n\n        if (!opj_tcd_init(p_j2k->m_tcd,p_j2k->m_private_image,&p_j2k->m_cp)) {\n                opj_tcd_destroy(p_j2k->m_tcd);\n                p_j2k->m_tcd = 00;\n                return OPJ_FALSE;\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_j2k_write_tile (opj_j2k_t * p_j2k,\n                                                 OPJ_UINT32 p_tile_index,\n                                                 OPJ_BYTE * p_data,\n                                                 OPJ_UINT32 p_data_size,\n                                                 opj_stream_private_t *p_stream,\n                                                 opj_event_mgr_t * p_manager )\n{\n        if (! opj_j2k_pre_write_tile(p_j2k,p_tile_index,p_stream,p_manager)) {\n                opj_event_msg(p_manager, EVT_ERROR, \"Error while opj_j2k_pre_write_tile with tile index = %d\\n\", p_tile_index);\n                return OPJ_FALSE;\n        }\n        else {\n                if (! opj_j2k_post_write_tile(p_j2k,p_data,p_data_size,p_stream,p_manager)) {\n                        opj_event_msg(p_manager, EVT_ERROR, \"Error while opj_j2k_post_write_tile with tile index = %d\\n\", p_tile_index);\n                        return OPJ_FALSE;\n                }\n        }\n\n        return OPJ_TRUE;\n}\n"
  },
  {
    "path": "ext/openjpeg/j2k.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2006-2007, Parvatha Elangovan\n * Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>\n * Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France \n * Copyright (c) 2012, CS Systemes d'Information, France\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n#ifndef __J2K_H\n#define __J2K_H\n/**\n@file j2k.h\n@brief The JPEG-2000 Codestream Reader/Writer (J2K)\n\nThe functions in J2K.C have for goal to read/write the several parts of the codestream: markers and data.\n*/\n\n/** @defgroup J2K J2K - JPEG-2000 codestream reader/writer */\n/*@{*/\n\n#define J2K_CP_CSTY_PRT 0x01\n#define J2K_CP_CSTY_SOP 0x02\n#define J2K_CP_CSTY_EPH 0x04\n#define J2K_CCP_CSTY_PRT 0x01\n#define J2K_CCP_CBLKSTY_LAZY 0x01     /**< Selective arithmetic coding bypass */\n#define J2K_CCP_CBLKSTY_RESET 0x02    /**< Reset context probabilities on coding pass boundaries */\n#define J2K_CCP_CBLKSTY_TERMALL 0x04  /**< Termination on each coding pass */\n#define J2K_CCP_CBLKSTY_VSC 0x08      /**< Vertically stripe causal context */\n#define J2K_CCP_CBLKSTY_PTERM 0x10    /**< Predictable termination */\n#define J2K_CCP_CBLKSTY_SEGSYM 0x20   /**< Segmentation symbols are used */\n#define J2K_CCP_QNTSTY_NOQNT 0\n#define J2K_CCP_QNTSTY_SIQNT 1\n#define J2K_CCP_QNTSTY_SEQNT 2\n\n#define OPJ_J2K_DEFAULT_CBLK_DATA_SIZE 8192\n\n/* ----------------------------------------------------------------------- */\n\n#define J2K_MS_SOC 0xff4f\t/**< SOC marker value */\n#define J2K_MS_SOT 0xff90\t/**< SOT marker value */\n#define J2K_MS_SOD 0xff93\t/**< SOD marker value */\n#define J2K_MS_EOC 0xffd9\t/**< EOC marker value */\n#define J2K_MS_SIZ 0xff51\t/**< SIZ marker value */\n#define J2K_MS_COD 0xff52\t/**< COD marker value */\n#define J2K_MS_COC 0xff53\t/**< COC marker value */\n#define J2K_MS_RGN 0xff5e\t/**< RGN marker value */\n#define J2K_MS_QCD 0xff5c\t/**< QCD marker value */\n#define J2K_MS_QCC 0xff5d\t/**< QCC marker value */\n#define J2K_MS_POC 0xff5f\t/**< POC marker value */\n#define J2K_MS_TLM 0xff55\t/**< TLM marker value */\n#define J2K_MS_PLM 0xff57\t/**< PLM marker value */\n#define J2K_MS_PLT 0xff58\t/**< PLT marker value */\n#define J2K_MS_PPM 0xff60\t/**< PPM marker value */\n#define J2K_MS_PPT 0xff61\t/**< PPT marker value */\n#define J2K_MS_SOP 0xff91\t/**< SOP marker value */\n#define J2K_MS_EPH 0xff92\t/**< EPH marker value */\n#define J2K_MS_CRG 0xff63\t/**< CRG marker value */\n#define J2K_MS_COM 0xff64\t/**< COM marker value */\n#define J2K_MS_CBD 0xff78\t/**< CBD marker value */\n#define J2K_MS_MCC 0xff75\t/**< MCC marker value */\n#define J2K_MS_MCT 0xff74\t/**< MCT marker value */\n#define J2K_MS_MCO 0xff77\t/**< MCO marker value */\n\n#define J2K_MS_UNK 0\t\t/**< UNKNOWN marker value */\n\n/* UniPG>> */\n#ifdef USE_JPWL\n#define J2K_MS_EPC 0xff68\t/**< EPC marker value (Part 11: JPEG 2000 for Wireless) */\n#define J2K_MS_EPB 0xff66\t/**< EPB marker value (Part 11: JPEG 2000 for Wireless) */ \n#define J2K_MS_ESD 0xff67\t/**< ESD marker value (Part 11: JPEG 2000 for Wireless) */ \n#define J2K_MS_RED 0xff69\t/**< RED marker value (Part 11: JPEG 2000 for Wireless) */\n#endif /* USE_JPWL */\n#ifdef USE_JPSEC\n#define J2K_MS_SEC 0xff65    /**< SEC marker value (Part 8: Secure JPEG 2000) */\n#define J2K_MS_INSEC 0xff94  /**< INSEC marker value (Part 8: Secure JPEG 2000) */\n#endif /* USE_JPSEC */\n/* <<UniPG */\n\n/* ----------------------------------------------------------------------- */\n\n/**\n * Values that specify the status of the decoding process when decoding the main header.\n * These values may be combined with a | operator.\n * */\ntypedef enum J2K_STATUS {\n\tJ2K_STATE_NONE  =  0x0000, /**< a SOC marker is expected */\n\tJ2K_STATE_MHSOC  = 0x0001, /**< a SOC marker is expected */\n\tJ2K_STATE_MHSIZ  = 0x0002, /**< a SIZ marker is expected */\n\tJ2K_STATE_MH     = 0x0004, /**< the decoding process is in the main header */\n\tJ2K_STATE_TPHSOT = 0x0008, /**< the decoding process is in a tile part header and expects a SOT marker */\n\tJ2K_STATE_TPH    = 0x0010, /**< the decoding process is in a tile part header */\n\tJ2K_STATE_MT     = 0x0020, /**< the EOC marker has just been read */\n\tJ2K_STATE_NEOC   = 0x0040, /**< the decoding process must not expect a EOC marker because the codestream is truncated */\n\n\tJ2K_STATE_EOC\t = 0x0100, /**< the decoding process has encountered the EOC marker */\n\tJ2K_STATE_ERR    = 0x8000  /**< the decoding process has encountered an error (FIXME warning V1 = 0x0080)*/\n} J2K_STATUS;\n\n/**\n * Type of elements storing in the MCT data\n */\ntypedef enum MCT_ELEMENT_TYPE\n{\n\tMCT_TYPE_INT16 = 0,\t\t/** MCT data is stored as signed shorts*/\n\tMCT_TYPE_INT32 = 1,\t\t/** MCT data is stored as signed integers*/\n\tMCT_TYPE_FLOAT = 2,\t\t/** MCT data is stored as floats*/\n\tMCT_TYPE_DOUBLE = 3\t\t/** MCT data is stored as doubles*/\n} J2K_MCT_ELEMENT_TYPE;\n\n/**\n * Type of MCT array\n */\ntypedef enum MCT_ARRAY_TYPE\n{\n\tMCT_TYPE_DEPENDENCY = 0,\n\tMCT_TYPE_DECORRELATION = 1,\n\tMCT_TYPE_OFFSET = 2\n} J2K_MCT_ARRAY_TYPE;\n\n/* ----------------------------------------------------------------------- */\n\n/** \nT2 encoding mode \n*/\ntypedef enum T2_MODE {\n\tTHRESH_CALC = 0,\t/** Function called in Rate allocation process*/\n\tFINAL_PASS = 1\t\t/** Function called in Tier 2 process*/\n}J2K_T2_MODE;\n\n/**\n * Quantization stepsize\n */\ntypedef struct opj_stepsize {\n\t/** exponent */\n\tOPJ_INT32 expn;\n\t/** mantissa */\n\tOPJ_INT32 mant;\n} opj_stepsize_t;\n\n/**\nTile-component coding parameters\n*/\ntypedef struct opj_tccp\n{\n\t/** coding style */\n\tOPJ_UINT32 csty;\n\t/** number of resolutions */\n\tOPJ_UINT32 numresolutions;\n\t/** code-blocks width */\n\tOPJ_UINT32 cblkw;\n\t/** code-blocks height */\n\tOPJ_UINT32 cblkh;\n\t/** code-block coding style */\n\tOPJ_UINT32 cblksty;\n\t/** discrete wavelet transform identifier */\n\tOPJ_UINT32 qmfbid;\n\t/** quantisation style */\n\tOPJ_UINT32 qntsty;\n\t/** stepsizes used for quantization */\n\topj_stepsize_t stepsizes[OPJ_J2K_MAXBANDS];\n\t/** number of guard bits */\n\tOPJ_UINT32 numgbits;\n\t/** Region Of Interest shift */\n\tOPJ_INT32 roishift;\n\t/** precinct width */\n\tOPJ_UINT32 prcw[OPJ_J2K_MAXRLVLS];\n\t/** precinct height */\n\tOPJ_UINT32 prch[OPJ_J2K_MAXRLVLS];\n\t/** the dc_level_shift **/\n\tOPJ_INT32 m_dc_level_shift;\n}\nopj_tccp_t;\n\n\n\n/**\n * FIXME DOC\n */\ntypedef struct opj_mct_data\n{\n\tJ2K_MCT_ELEMENT_TYPE m_element_type;\n\tJ2K_MCT_ARRAY_TYPE\t m_array_type;\n\tOPJ_UINT32\t\t\t m_index;\n\tOPJ_BYTE *\t\t\t m_data;\n\tOPJ_UINT32\t\t\t m_data_size;\n}\nopj_mct_data_t;\n\n/**\n * FIXME DOC\n */\ntypedef struct opj_simple_mcc_decorrelation_data\n{\n\tOPJ_UINT32\t\t\t m_index;\n\tOPJ_UINT32\t\t\t m_nb_comps;\n\topj_mct_data_t *\t m_decorrelation_array;\n\topj_mct_data_t *\t m_offset_array;\n\tOPJ_UINT32\t\t\t m_is_irreversible : 1;\n}\nopj_simple_mcc_decorrelation_data_t;\n\n/**\nTile coding parameters :\nthis structure is used to store coding/decoding parameters common to all\ntiles (information like COD, COC in main header)\n*/\ntypedef struct opj_tcp\n{\n\t/** coding style */\n\tOPJ_UINT32 csty;\n\t/** progression order */\n\tOPJ_PROG_ORDER prg;\n\t/** number of layers */\n\tOPJ_UINT32 numlayers;\n\tOPJ_UINT32 num_layers_to_decode;\n\t/** multi-component transform identifier */\n\tOPJ_UINT32 mct;\n\t/** rates of layers */\n\tOPJ_FLOAT32 rates[100];\n\t/** number of progression order changes */\n\tOPJ_UINT32 numpocs;\n\t/** progression order changes */\n\topj_poc_t pocs[32];\n\t/** packet header store there for futur use in t2_decode_packet */\n\tOPJ_BYTE *ppt_data;\n\t/** used to keep a track of the allocated memory */\n\tOPJ_BYTE *ppt_buffer;\n\t/** Number of bytes stored inside ppt_data*/\n\tOPJ_UINT32 ppt_data_size;\n\t/** size of ppt_data*/\n\tOPJ_UINT32 ppt_len;\n\t/** add fixed_quality */\n\tOPJ_FLOAT32 distoratio[100];\n\t/** tile-component coding parameters */\n\topj_tccp_t *tccps;\n\t/** number of tile parts for the tile. */\n\tOPJ_UINT32 m_nb_tile_parts;\n\t/** data for the tile */\n\tOPJ_BYTE *\t\tm_data;\n\t/** size of data */\n\tOPJ_UINT32\t\tm_data_size;\n\t/** encoding norms */\n\tOPJ_FLOAT64 *\tmct_norms;\n\t/** the mct decoding matrix */\n\tOPJ_FLOAT32 *\tm_mct_decoding_matrix;\n\t/** the mct coding matrix */\n\tOPJ_FLOAT32 *\tm_mct_coding_matrix;\n\t/** mct records */\n\topj_mct_data_t * m_mct_records;\n\t/** the number of mct records. */\n\tOPJ_UINT32 m_nb_mct_records;\n\t/** the max number of mct records. */\n\tOPJ_UINT32 m_nb_max_mct_records;\n\t/** mcc records */\n\topj_simple_mcc_decorrelation_data_t * m_mcc_records;\n\t/** the number of mct records. */\n\tOPJ_UINT32 m_nb_mcc_records;\n\t/** the max number of mct records. */\n\tOPJ_UINT32 m_nb_max_mcc_records;\n\n\n\t/***** FLAGS *******/\n\t/** If ppt == 1 --> there was a PPT marker for the present tile */\n\tOPJ_UINT32 ppt : 1;\n\t/** indicates if a POC marker has been used O:NO, 1:YES */\n\tOPJ_UINT32 POC : 1;\n} opj_tcp_t;\n\n\n\n\ntypedef struct opj_encoding_param\n{\n\t/** Maximum rate for each component. If == 0, component size limitation is not considered */\n\tOPJ_UINT32 m_max_comp_size;\n\t/** Position of tile part flag in progression order*/\n\tOPJ_INT32 m_tp_pos;\n\t/** fixed layer */\n\tOPJ_INT32 *m_matrice;\n\t/** Flag determining tile part generation*/\n\tOPJ_BYTE m_tp_flag;\n\t/** allocation by rate/distortion */\n\tOPJ_UINT32 m_disto_alloc : 1;\n\t/** allocation by fixed layer */\n\tOPJ_UINT32 m_fixed_alloc : 1;\n\t/** add fixed_quality */\n\tOPJ_UINT32 m_fixed_quality : 1;\n\t/** Enabling Tile part generation*/\n\tOPJ_UINT32 m_tp_on : 1;\n}\nopj_encoding_param_t;\n\ntypedef struct opj_decoding_param\n{\n\t/** if != 0, then original dimension divided by 2^(reduce); if == 0 or not used, image is decoded to the full resolution */\n\tOPJ_UINT32 m_reduce;\n\t/** if != 0, then only the first \"layer\" layers are decoded; if == 0 or not used, all the quality layers are decoded */\n\tOPJ_UINT32 m_layer;\n}\nopj_decoding_param_t;\n\n\n/**\n * Coding parameters\n */\ntypedef struct opj_cp\n{\n\t/** Size of the image in bits*/\n\t/*int img_size;*/\n\t/** Rsiz*/\n    OPJ_UINT16 rsiz;\n\t/** XTOsiz */\n\tOPJ_UINT32 tx0; /* MSD see norm */\n\t/** YTOsiz */\n\tOPJ_UINT32 ty0; /* MSD see norm */\n\t/** XTsiz */\n\tOPJ_UINT32 tdx;\n\t/** YTsiz */\n\tOPJ_UINT32 tdy;\n\t/** comment */\n\tOPJ_CHAR *comment;\n\t/** number of tiles in width */\n\tOPJ_UINT32 tw;\n\t/** number of tiles in heigth */\n\tOPJ_UINT32 th;\n\n\t/** packet header store there for futur use in t2_decode_packet */\n\tOPJ_BYTE *ppm_data;\n\t/** size of the ppm_data*/\n\tOPJ_UINT32 ppm_len;\n\t/** size of the ppm_data*/\n\tOPJ_UINT32 ppm_data_read;\n\n\tOPJ_BYTE *ppm_data_current;\n\n\t/** packet header storage original buffer */\n\tOPJ_BYTE *ppm_buffer;\n\t/** pointer remaining on the first byte of the first header if ppm is used */\n\tOPJ_BYTE *ppm_data_first;\n\t/** Number of bytes actually stored inside the ppm_data */\n\tOPJ_UINT32 ppm_data_size;\n\t/** use in case of multiple marker PPM (number of info already store) */\n\tOPJ_INT32 ppm_store;\n\t/** use in case of multiple marker PPM (case on non-finished previous info) */\n\tOPJ_INT32 ppm_previous;\n\n\t/** tile coding parameters */\n\topj_tcp_t *tcps;\n\n\tunion\n\t{\n\t\topj_decoding_param_t m_dec;\n\t\topj_encoding_param_t m_enc;\n\t}\n\tm_specific_param;\n\n\n/* UniPG>> */\n#ifdef USE_JPWL\n\t/** enables writing of EPC in MH, thus activating JPWL */\n\tOPJ_BOOL epc_on;\n\t/** enables writing of EPB, in case of activated JPWL */\n\tOPJ_BOOL epb_on;\n\t/** enables writing of ESD, in case of activated JPWL */\n\tOPJ_BOOL esd_on;\n\t/** enables writing of informative techniques of ESD, in case of activated JPWL */\n\tOPJ_BOOL info_on;\n\t/** enables writing of RED, in case of activated JPWL */\n\tOPJ_BOOL red_on;\n\t/** error protection method for MH (0,1,16,32,37-128) */\n\tint hprot_MH;\n\t/** tile number of header protection specification (>=0) */\n\tint hprot_TPH_tileno[JPWL_MAX_NO_TILESPECS];\n\t/** error protection methods for TPHs (0,1,16,32,37-128) */\n\tint hprot_TPH[JPWL_MAX_NO_TILESPECS];\n\t/** tile number of packet protection specification (>=0) */\n\tint pprot_tileno[JPWL_MAX_NO_PACKSPECS];\n\t/** packet number of packet protection specification (>=0) */\n\tint pprot_packno[JPWL_MAX_NO_PACKSPECS];\n\t/** error protection methods for packets (0,1,16,32,37-128) */\n\tint pprot[JPWL_MAX_NO_PACKSPECS];\n\t/** enables writing of ESD, (0/2/4 bytes) */\n\tint sens_size;\n\t/** sensitivity addressing size (0=auto/2/4 bytes) */\n\tint sens_addr;\n\t/** sensitivity range (0-3) */\n\tint sens_range;\n\t/** sensitivity method for MH (-1,0-7) */\n\tint sens_MH;\n\t/** tile number of sensitivity specification (>=0) */\n\tint sens_TPH_tileno[JPWL_MAX_NO_TILESPECS];\n\t/** sensitivity methods for TPHs (-1,0-7) */\n\tint sens_TPH[JPWL_MAX_NO_TILESPECS];\n\t/** enables JPWL correction at the decoder */\n\tOPJ_BOOL correct;\n\t/** expected number of components at the decoder */\n\tint exp_comps;\n\t/** maximum number of tiles at the decoder */\n\tOPJ_UINT32 max_tiles;\n#endif /* USE_JPWL */\n\n\t/******** FLAGS *********/\n\t/** if ppm == 1 --> there was a PPM marker*/\n\tOPJ_UINT32 ppm : 1;\n\t/** tells if the parameter is a coding or decoding one */\n\tOPJ_UINT32 m_is_decoder : 1;\n/* <<UniPG */\n} opj_cp_t;\n\n\ntypedef struct opj_j2k_dec\n{\n\t/** locate in which part of the codestream the decoder is (main header, tile header, end) */\n\tOPJ_UINT32 m_state;\n\t/**\n\t * store decoding parameters common to all tiles (information like COD, COC in main header)\n\t */\n\topj_tcp_t *m_default_tcp;\n\tOPJ_BYTE  *m_header_data;\n\tOPJ_UINT32 m_header_data_size;\n\t/** to tell the tile part length */\n\tOPJ_UINT32 m_sot_length;\n\t/** Only tiles index in the correct range will be decoded.*/\n\tOPJ_UINT32 m_start_tile_x;\n\tOPJ_UINT32 m_start_tile_y;\n\tOPJ_UINT32 m_end_tile_x;\n\tOPJ_UINT32 m_end_tile_y;\n\t/**\n\t * Decoded area set by the user\n\t */\n\tOPJ_UINT32 m_DA_x0;\n\tOPJ_UINT32 m_DA_y0;\n\tOPJ_UINT32 m_DA_x1;\n\tOPJ_UINT32 m_DA_y1;\n\n\t/** Index of the tile to decode (used in get_tile) */\n\tOPJ_INT32 m_tile_ind_to_dec;\n\t/** Position of the last SOT marker read */\n\tOPJ_OFF_T m_last_sot_read_pos;\n\n\t/**\n\t * Indicate that the current tile-part is assume as the last tile part of the codestream.\n\t * It is useful in the case of PSot is equal to zero. The sot length will be compute in the\n\t * SOD reader function. FIXME NOT USED for the moment\n\t */\n\tOPJ_BOOL   m_last_tile_part;\n\t/** to tell that a tile can be decoded. */\n\tOPJ_UINT32 m_can_decode\t\t\t: 1;\n\tOPJ_UINT32 m_discard_tiles\t\t: 1;\n\tOPJ_UINT32 m_skip_data\t\t\t: 1;\n\n} opj_j2k_dec_t;\n\ntypedef struct opj_j2k_enc\n{\n\t/** Tile part number, regardless of poc, for each new poc, tp is reset to 1*/\n\tOPJ_UINT32 m_current_poc_tile_part_number; /* tp_num */\n\n\t/** Tile part number currently coding, taking into account POC. m_current_tile_part_number holds the total number of tile parts while encoding the last tile part.*/\n\tOPJ_UINT32 m_current_tile_part_number; /*cur_tp_num */\n\n\t/**\n\tlocate the start position of the TLM marker\n\tafter encoding the tilepart, a jump (in j2k_write_sod) is done to the TLM marker to store the value of its length.\n\t*/\n    OPJ_OFF_T m_tlm_start;\n\t/**\n\t * Stores the sizes of the tlm.\n\t */\n\tOPJ_BYTE * m_tlm_sot_offsets_buffer;\n\t/**\n\t * The current offset of the tlm buffer.\n\t */\n\tOPJ_BYTE * m_tlm_sot_offsets_current;\n\n\t/** Total num of tile parts in whole image = num tiles* num tileparts in each tile*/\n\t/** used in TLMmarker*/\n\tOPJ_UINT32 m_total_tile_parts;\t /* totnum_tp */\n\n\t/* encoded data for a tile */\n\tOPJ_BYTE * m_encoded_tile_data;\n\n\t/* size of the encoded_data */\n\tOPJ_UINT32 m_encoded_tile_size;\n\n\t/* encoded data for a tile */\n\tOPJ_BYTE * m_header_tile_data;\n\n\t/* size of the encoded_data */\n\tOPJ_UINT32 m_header_tile_data_size;\n\n\n} opj_j2k_enc_t;\n\n\n\nstruct opj_tcd;\n/**\nJPEG-2000 codestream reader/writer\n*/\ntypedef struct opj_j2k\n{\n\t/* J2K codestream is decoded*/\n\tOPJ_BOOL m_is_decoder;\n\n\t/* FIXME DOC*/\n\tunion\n\t{\n\t\topj_j2k_dec_t m_decoder;\n\t\topj_j2k_enc_t m_encoder;\n\t}\n\tm_specific_param;\n\n\t/** pointer to the internal/private encoded / decoded image */\n\topj_image_t* m_private_image;\n\n\t/* pointer to the output image (decoded)*/\n\topj_image_t* m_output_image;\n\n\t/** Coding parameters */\n\topj_cp_t m_cp;\n\n\t/** the list of procedures to exec **/\n\topj_procedure_list_t *\tm_procedure_list;\n\n\t/** the list of validation procedures to follow to make sure the code is valid **/\n\topj_procedure_list_t *\tm_validation_list;\n\n\t/** helper used to write the index file */\n\topj_codestream_index_t *cstr_index;\n\n\t/** number of the tile curently concern by coding/decoding */\n\tOPJ_UINT32 m_current_tile_number;\n\n\t/** the current tile coder/decoder **/\n\tstruct opj_tcd *\tm_tcd;\n\n}\nopj_j2k_t;\n\n\n\n\n/** @name Exported functions */\n/*@{*/\n/* ----------------------------------------------------------------------- */\n\n/**\nSetup the decoder decoding parameters using user parameters.\nDecoding parameters are returned in j2k->cp. \n@param j2k J2K decompressor handle\n@param parameters decompression parameters\n*/\nvoid opj_j2k_setup_decoder(opj_j2k_t *j2k, opj_dparameters_t *parameters);\n\n/**\n * Creates a J2K compression structure\n *\n * @return Returns a handle to a J2K compressor if successful, returns NULL otherwise\n*/\nopj_j2k_t* opj_j2k_create_compress(void);\n\n\nvoid opj_j2k_setup_encoder(\topj_j2k_t *p_j2k,\n\t\t\t\t\t\t    opj_cparameters_t *parameters,\n\t\t\t\t\t\t    opj_image_t *image,\n\t\t\t\t\t\t    opj_event_mgr_t * p_manager);\n\n/**\nConverts an enum type progression order to string type\n*/\nchar *opj_j2k_convert_progression_order(OPJ_PROG_ORDER prg_order);\n\n/* ----------------------------------------------------------------------- */\n/*@}*/\n\n/*@}*/\n\n/**\n * Ends the decompression procedures and possibiliy add data to be read after the\n * codestream.\n */\nOPJ_BOOL opj_j2k_end_decompress(opj_j2k_t *j2k,\n                                opj_stream_private_t *p_stream,\n                                opj_event_mgr_t * p_manager);\n\n/**\n * Reads a jpeg2000 codestream header structure.\n *\n * @param p_stream the stream to read data from.\n * @param p_j2k the jpeg2000 codec.\n * @param p_image FIXME DOC\n * @param p_manager the user event manager.\n *\n * @return true if the box is valid.\n */\nOPJ_BOOL opj_j2k_read_header(\topj_stream_private_t *p_stream,\n                                opj_j2k_t* p_j2k,\n                                opj_image_t** p_image,\n                                opj_event_mgr_t* p_manager );\n\n\n/**\n * Destroys a jpeg2000 codec.\n *\n * @param\tp_j2k\tthe jpeg20000 structure to destroy.\n */\nvoid opj_j2k_destroy (opj_j2k_t *p_j2k);\n\n/**\n * Destroys a codestream index structure.\n *\n * @param\tp_cstr_ind\tthe codestream index parameter to destroy.\n */\nvoid j2k_destroy_cstr_index (opj_codestream_index_t *p_cstr_ind);\n\n/**\n * Decode tile data.\n * @param\tp_j2k\t\tthe jpeg2000 codec.\n * @param\tp_tile_index\n * @param p_data       FIXME DOC\n * @param p_data_size  FIXME DOC\n * @param\tp_stream\t\t\tthe stream to write data to.\n * @param\tp_manager\tthe user event manager.\n */\nOPJ_BOOL opj_j2k_decode_tile (  opj_j2k_t * p_j2k,\n                                OPJ_UINT32 p_tile_index,\n                                OPJ_BYTE * p_data,\n                                OPJ_UINT32 p_data_size,\n                                opj_stream_private_t *p_stream,\n                                opj_event_mgr_t * p_manager );\n\n/**\n * Reads a tile header.\n * @param\tp_j2k\t\tthe jpeg2000 codec.\n * @param\tp_tile_index FIXME DOC\n * @param\tp_data_size FIXME DOC\n * @param\tp_tile_x0 FIXME DOC\n * @param\tp_tile_y0 FIXME DOC\n * @param\tp_tile_x1 FIXME DOC\n * @param\tp_tile_y1 FIXME DOC\n * @param\tp_nb_comps FIXME DOC\n * @param\tp_go_on FIXME DOC\n * @param\tp_stream\t\t\tthe stream to write data to.\n * @param\tp_manager\tthe user event manager.\n */\nOPJ_BOOL opj_j2k_read_tile_header ( opj_j2k_t * p_j2k,\n                                    OPJ_UINT32 * p_tile_index,\n                                    OPJ_UINT32 * p_data_size,\n                                    OPJ_INT32 * p_tile_x0,\n                                    OPJ_INT32 * p_tile_y0,\n                                    OPJ_INT32 * p_tile_x1,\n                                    OPJ_INT32 * p_tile_y1,\n                                    OPJ_UINT32 * p_nb_comps,\n                                    OPJ_BOOL * p_go_on,\n                                    opj_stream_private_t *p_stream,\n                                    opj_event_mgr_t * p_manager );\n\n\n/**\n * Sets the given area to be decoded. This function should be called right after opj_read_header and before any tile header reading.\n *\n * @param\tp_j2k\t\t\tthe jpeg2000 codec.\n * @param\tp_image     FIXME DOC\n * @param\tp_start_x\t\tthe left position of the rectangle to decode (in image coordinates).\n * @param\tp_start_y\t\tthe up position of the rectangle to decode (in image coordinates).\n * @param\tp_end_x\t\t\tthe right position of the rectangle to decode (in image coordinates).\n * @param\tp_end_y\t\t\tthe bottom position of the rectangle to decode (in image coordinates).\n * @param\tp_manager\t\tthe user event manager\n *\n * @return\ttrue\t\t\tif the area could be set.\n */\nOPJ_BOOL opj_j2k_set_decode_area(\topj_j2k_t *p_j2k,\n\t\t\t\t\t\t\t\t    opj_image_t* p_image,\n\t\t\t\t\t\t\t\t    OPJ_INT32 p_start_x, OPJ_INT32 p_start_y,\n\t\t\t\t\t\t\t\t    OPJ_INT32 p_end_x, OPJ_INT32 p_end_y,\n\t\t\t\t\t\t\t\t    opj_event_mgr_t * p_manager );\n\n/**\n * Creates a J2K decompression structure.\n *\n * @return a handle to a J2K decompressor if successful, NULL otherwise.\n */\nopj_j2k_t* opj_j2k_create_decompress(void);\n\n\n/**\n * Dump some elements from the J2K decompression structure .\n *\n *@param p_j2k\t\t\t\tthe jpeg2000 codec.\n *@param flag\t\t\t\tflag to describe what elments are dump.\n *@param out_stream\t\t\toutput stream where dump the elements.\n *\n*/\nvoid j2k_dump (opj_j2k_t* p_j2k, OPJ_INT32 flag, FILE* out_stream);\n\n\n\n/**\n * Dump an image header structure.\n *\n *@param image\t\t\tthe image header to dump.\n *@param dev_dump_flag\t\tflag to describe if we are in the case of this function is use outside j2k_dump function\n *@param out_stream\t\t\toutput stream where dump the elements.\n */\nvoid j2k_dump_image_header(opj_image_t* image, OPJ_BOOL dev_dump_flag, FILE* out_stream);\n\n/**\n * Dump a component image header structure.\n *\n *@param comp\t\tthe component image header to dump.\n *@param dev_dump_flag\t\tflag to describe if we are in the case of this function is use outside j2k_dump function\n *@param out_stream\t\t\toutput stream where dump the elements.\n */\nvoid j2k_dump_image_comp_header(opj_image_comp_t* comp, OPJ_BOOL dev_dump_flag, FILE* out_stream);\n\n/**\n * Get the codestream info from a JPEG2000 codec.\n *\n *@param\tp_j2k\t\t\t\tthe component image header to dump.\n *\n *@return\tthe codestream information extract from the jpg2000 codec\n */\nopj_codestream_info_v2_t* j2k_get_cstr_info(opj_j2k_t* p_j2k);\n\n/**\n * Get the codestream index from a JPEG2000 codec.\n *\n *@param\tp_j2k\t\t\t\tthe component image header to dump.\n *\n *@return\tthe codestream index extract from the jpg2000 codec\n */\nopj_codestream_index_t* j2k_get_cstr_index(opj_j2k_t* p_j2k);\n\n/**\n * Decode an image from a JPEG-2000 codestream\n * @param j2k J2K decompressor handle\n * @param p_stream  FIXME DOC\n * @param p_image   FIXME DOC\n * @param p_manager FIXME DOC\n * @return FIXME DOC\n*/\nOPJ_BOOL opj_j2k_decode(opj_j2k_t *j2k,\n                        opj_stream_private_t *p_stream,\n                        opj_image_t *p_image,\n                        opj_event_mgr_t *p_manager);\n\n\nOPJ_BOOL opj_j2k_get_tile(\topj_j2k_t *p_j2k,\n\t\t\t    \t\t\topj_stream_private_t *p_stream,\n\t\t\t\t    \t\topj_image_t* p_image,\n\t\t\t\t\t    \topj_event_mgr_t * p_manager,\n\t\t\t\t\t\t    OPJ_UINT32 tile_index );\n\nOPJ_BOOL opj_j2k_set_decoded_resolution_factor(opj_j2k_t *p_j2k, \n                                               OPJ_UINT32 res_factor,\n                                               opj_event_mgr_t * p_manager);\n\n\n/**\n * Writes a tile.\n * @param\tp_j2k\t\tthe jpeg2000 codec.\n * @param p_tile_index FIXME DOC\n * @param p_data FIXME DOC\n * @param p_data_size FIXME DOC\n * @param\tp_stream\t\t\tthe stream to write data to.\n * @param\tp_manager\tthe user event manager.\n */\nOPJ_BOOL opj_j2k_write_tile (\topj_j2k_t * p_j2k,\n\t\t\t\t\t\t\t    OPJ_UINT32 p_tile_index,\n\t\t\t\t\t\t\t    OPJ_BYTE * p_data,\n\t\t\t\t\t\t\t    OPJ_UINT32 p_data_size,\n\t\t\t\t\t\t\t    opj_stream_private_t *p_stream,\n\t\t\t\t\t\t\t    opj_event_mgr_t * p_manager );\n\n/**\n * Encodes an image into a JPEG-2000 codestream\n */\nOPJ_BOOL opj_j2k_encode(\topj_j2k_t * p_j2k,\n\t\t\t    \t\t\topj_stream_private_t *cio,\n\t\t\t\t    \t\topj_event_mgr_t * p_manager );\n\n/**\n * Starts a compression scheme, i.e. validates the codec parameters, writes the header.\n *\n * @param\tp_j2k\t\tthe jpeg2000 codec.\n * @param\tp_stream\t\t\tthe stream object.\n * @param\tp_image FIXME DOC\n * @param\tp_manager\tthe user event manager.\n *\n * @return true if the codec is valid.\n */\nOPJ_BOOL opj_j2k_start_compress(opj_j2k_t *p_j2k,\n\t\t\t\t\t\t\t    opj_stream_private_t *p_stream,\n\t\t\t\t\t\t\t    opj_image_t * p_image,\n\t\t\t\t\t\t\t    opj_event_mgr_t * p_manager);\n\n/**\n * Ends the compression procedures and possibiliy add data to be read after the\n * codestream.\n */\nOPJ_BOOL opj_j2k_end_compress( \topj_j2k_t *p_j2k,\n\t\t\t\t\t\t\t    opj_stream_private_t *cio,\n\t\t\t\t\t\t\t    opj_event_mgr_t * p_manager);\n\nOPJ_BOOL opj_j2k_setup_mct_encoding (opj_tcp_t * p_tcp, opj_image_t * p_image);\n\n\n#endif /* __J2K_H */\n"
  },
  {
    "path": "ext/openjpeg/jp2.c",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2010-2011, Kaori Hagihara\n * Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR \n * Copyright (c) 2012, CS Systemes d'Information, France\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n#include \"opj_includes.h\"\n\n/** @defgroup JP2 JP2 - JPEG-2000 file format reader/writer */\n/*@{*/\n\n#define OPJ_BOX_SIZE\t1024\n\n/** @name Local static functions */\n/*@{*/\n\n/*static void jp2_write_url(opj_cio_t *cio, char *Idx_file);*/\n\n/**\n * Reads a IHDR box - Image Header box\n *\n * @param\tp_image_header_data\t\t\tpointer to actual data (already read from file)\n * @param\tjp2\t\t\t\t\t\t\tthe jpeg2000 file codec.\n * @param\tp_image_header_size\t\t\tthe size of the image header\n * @param\tp_manager\t\t\t\t\tthe user event manager.\n *\n * @return\ttrue if the image header is valid, false else.\n */\nstatic OPJ_BOOL opj_jp2_read_ihdr(  opj_jp2_t *jp2,\n                                    OPJ_BYTE *p_image_header_data,\n                                    OPJ_UINT32 p_image_header_size,\n                                    opj_event_mgr_t * p_manager );\n\n/**\n * Writes the Image Header box - Image Header box.\n *\n * @param jp2\t\t\t\t\tjpeg2000 file codec.\n * @param p_nb_bytes_written\tpointer to store the nb of bytes written by the function.\n *\n * @return\tthe data being copied.\n*/\nstatic OPJ_BYTE * opj_jp2_write_ihdr(opj_jp2_t *jp2,\n                                     OPJ_UINT32 * p_nb_bytes_written );\n\n/**\n * Writes the Bit per Component box.\n *\n * @param\tjp2\t\t\t\t\t\tjpeg2000 file codec.\n * @param\tp_nb_bytes_written\t\tpointer to store the nb of bytes written by the function.\n *\n * @return\tthe data being copied.\n*/\nstatic OPJ_BYTE * opj_jp2_write_bpcc(\topj_jp2_t *jp2,\n\t\t\t\t\t\t\t\t        OPJ_UINT32 * p_nb_bytes_written );\n\n/**\n * Reads a Bit per Component box.\n *\n * @param\tp_bpc_header_data\t\t\tpointer to actual data (already read from file)\n * @param\tjp2\t\t\t\t\t\t\tthe jpeg2000 file codec.\n * @param\tp_bpc_header_size\t\t\tthe size of the bpc header\n * @param\tp_manager\t\t\t\t\tthe user event manager.\n *\n * @return\ttrue if the bpc header is valid, fale else.\n */\nstatic OPJ_BOOL opj_jp2_read_bpcc(  opj_jp2_t *jp2,\n                                    OPJ_BYTE * p_bpc_header_data,\n                                    OPJ_UINT32 p_bpc_header_size,\n                                    opj_event_mgr_t * p_manager );\n\nstatic OPJ_BOOL opj_jp2_read_cdef(\topj_jp2_t * jp2,\n                                    OPJ_BYTE * p_cdef_header_data,\n\t\t\t\t\t\t\t\t\tOPJ_UINT32 p_cdef_header_size,\n\t\t\t\t\t\t\t\t\topj_event_mgr_t * p_manager );\n\nstatic void opj_jp2_apply_cdef(opj_image_t *image, opj_jp2_color_t *color);\n\n/**\n * Writes the Colour Specification box.\n *\n * @param jp2\t\t\t\t\tjpeg2000 file codec.\n * @param p_nb_bytes_written\tpointer to store the nb of bytes written by the function.\n *\n * @return\tthe data being copied.\n*/\nstatic OPJ_BYTE * opj_jp2_write_colr(   opj_jp2_t *jp2,\n\t\t\t\t\t\t\t\t\t    OPJ_UINT32 * p_nb_bytes_written );\n\n/**\n * Writes a FTYP box - File type box\n *\n * @param\tcio\t\t\tthe stream to write data to.\n * @param\tjp2\t\t\tthe jpeg2000 file codec.\n * @param\tp_manager\tthe user event manager.\n *\n * @return\ttrue if writing was successful.\n */\nstatic OPJ_BOOL opj_jp2_write_ftyp(\topj_jp2_t *jp2,\n\t\t\t\t\t\t\t\t\topj_stream_private_t *cio,\n\t\t\t\t\t\t\t\t\topj_event_mgr_t * p_manager );\n\n/**\n * Reads a a FTYP box - File type box\n *\n * @param\tp_header_data\tthe data contained in the FTYP box.\n * @param\tjp2\t\t\t\tthe jpeg2000 file codec.\n * @param\tp_header_size\tthe size of the data contained in the FTYP box.\n * @param\tp_manager\t\tthe user event manager.\n *\n * @return true if the FTYP box is valid.\n */\nstatic OPJ_BOOL opj_jp2_read_ftyp(\topj_jp2_t *jp2,\n\t\t\t\t\t\t\t\t\tOPJ_BYTE * p_header_data,\n\t\t\t\t\t\t\t\t\tOPJ_UINT32 p_header_size,\n\t\t\t\t\t\t\t\t\topj_event_mgr_t * p_manager );\n\nOPJ_BOOL opj_jp2_skip_jp2c(\topj_jp2_t *jp2,\n\t\t\t\t\t\t    opj_stream_private_t *cio,\n\t\t\t\t\t\t    opj_event_mgr_t * p_manager );\n\n/**\n * Reads the Jpeg2000 file Header box - JP2 Header box (warning, this is a super box).\n *\n * @param\tp_header_data\tthe data contained in the file header box.\n * @param\tjp2\t\t\t\tthe jpeg2000 file codec.\n * @param\tp_header_size\tthe size of the data contained in the file header box.\n * @param\tp_manager\t\tthe user event manager.\n *\n * @return true if the JP2 Header box was successfully reconized.\n*/\nstatic OPJ_BOOL opj_jp2_read_jp2h(  opj_jp2_t *jp2,\n                                    OPJ_BYTE *p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager );\n\n/**\n * Writes the Jpeg2000 codestream Header box - JP2C Header box. This function must be called AFTER the coding has been done.\n *\n * @param\tcio\t\t\tthe stream to write data to.\n * @param\tjp2\t\t\tthe jpeg2000 file codec.\n * @param\tp_manager\tuser event manager.\n *\n * @return true if writing was successful.\n*/\nstatic OPJ_BOOL opj_jp2_write_jp2c(\topj_jp2_t *jp2,\n\t\t\t\t\t\t\t\t    opj_stream_private_t *cio,\n\t\t\t\t\t\t\t\t    opj_event_mgr_t * p_manager );\n\n#ifdef USE_JPIP\n/**\n * Write index Finder box\n * @param cio     the stream to write to.\n * @param\tjp2\t\t\tthe jpeg2000 file codec.\n * @param\tp_manager\tuser event manager.\n*/\nstatic OPJ_BOOL opj_jpip_write_iptr(\topj_jp2_t *jp2,\n\t\t\t\t\t\t\t\t    opj_stream_private_t *cio,\n\t\t\t\t\t\t\t\t    opj_event_mgr_t * p_manager );\n\n/**\n * Write index Finder box\n * @param cio     the stream to write to.\n * @param\tjp2\t\t\tthe jpeg2000 file codec.\n * @param\tp_manager\tuser event manager.\n */\nstatic OPJ_BOOL opj_jpip_write_cidx(opj_jp2_t *jp2,\n  opj_stream_private_t *cio,\n  opj_event_mgr_t * p_manager );\n\n/**\n * Write file Index (superbox)\n * @param cio     the stream to write to.\n * @param\tjp2\t\t\tthe jpeg2000 file codec.\n * @param\tp_manager\tuser event manager.\n */\nstatic OPJ_BOOL opj_jpip_write_fidx(opj_jp2_t *jp2,\n  opj_stream_private_t *cio,\n  opj_event_mgr_t * p_manager );\n#endif /* USE_JPIP */\n\n/**\n * Reads a jpeg2000 file signature box.\n *\n * @param\tp_header_data\tthe data contained in the signature box.\n * @param\tjp2\t\t\t\tthe jpeg2000 file codec.\n * @param\tp_header_size\tthe size of the data contained in the signature box.\n * @param\tp_manager\t\tthe user event manager.\n *\n * @return true if the file signature box is valid.\n */\nstatic OPJ_BOOL opj_jp2_read_jp(opj_jp2_t *jp2,\n                                OPJ_BYTE * p_header_data,\n                                OPJ_UINT32 p_header_size,\n                                opj_event_mgr_t * p_manager);\n\n/**\n * Writes a jpeg2000 file signature box.\n *\n * @param cio the stream to write data to.\n * @param\tjp2\t\t\tthe jpeg2000 file codec.\n * @param p_manager the user event manager.\n *\n * @return true if writing was successful.\n */\nstatic OPJ_BOOL opj_jp2_write_jp(\topj_jp2_t *jp2,\n\t\t\t    \t        \t    opj_stream_private_t *cio,\n\t\t\t\t            \t\topj_event_mgr_t * p_manager );\n\n/**\nApply collected palette data\n@param color Collector for profile, cdef and pclr data\n@param image\n*/\nstatic void opj_jp2_apply_pclr(opj_image_t *image, opj_jp2_color_t *color);\n\nstatic void opj_jp2_free_pclr(opj_jp2_color_t *color);\n\n/**\n * Collect palette data\n *\n * @param jp2 JP2 handle\n * @param p_pclr_header_data    FIXME DOC\n * @param p_pclr_header_size    FIXME DOC\n * @param p_manager\n *\n * @return Returns true if successful, returns false otherwise\n*/\nstatic OPJ_BOOL opj_jp2_read_pclr(\topj_jp2_t *jp2,\n                                    OPJ_BYTE * p_pclr_header_data,\n                                    OPJ_UINT32 p_pclr_header_size,\n                                    opj_event_mgr_t * p_manager );\n\n/**\n * Collect component mapping data\n *\n * @param jp2                 JP2 handle\n * @param p_cmap_header_data  FIXME DOC\n * @param p_cmap_header_size  FIXME DOC\n * @param p_manager           FIXME DOC\n *\n * @return Returns true if successful, returns false otherwise\n*/\n\nstatic OPJ_BOOL opj_jp2_read_cmap(\topj_jp2_t * jp2,\n                                    OPJ_BYTE * p_cmap_header_data,\n                                    OPJ_UINT32 p_cmap_header_size,\n                                    opj_event_mgr_t * p_manager );\n\n/**\n * Reads the Color Specification box.\n *\n * @param\tp_colr_header_data\t\t\tpointer to actual data (already read from file)\n * @param\tjp2\t\t\t\t\t\t\tthe jpeg2000 file codec.\n * @param\tp_colr_header_size\t\t\tthe size of the color header\n * @param\tp_manager\t\t\t\t\tthe user event manager.\n *\n * @return\ttrue if the bpc header is valid, fale else.\n*/\nstatic OPJ_BOOL opj_jp2_read_colr(  opj_jp2_t *jp2,\n                                    OPJ_BYTE * p_colr_header_data,\n                                    OPJ_UINT32 p_colr_header_size,\n                                    opj_event_mgr_t * p_manager );\n\n/*@}*/\n\n/*@}*/\n\n/**\n * Sets up the procedures to do on writing header after the codestream.\n * Developpers wanting to extend the library can add their own writing procedures.\n */\nstatic void opj_jp2_setup_end_header_writing (opj_jp2_t *jp2);\n\n/**\n * Sets up the procedures to do on reading header after the codestream.\n * Developpers wanting to extend the library can add their own writing procedures.\n */\nstatic void opj_jp2_setup_end_header_reading (opj_jp2_t *jp2);\n\n/**\n * Reads a jpeg2000 file header structure.\n *\n * @param jp2 the jpeg2000 file header structure.\n * @param stream the stream to read data from.\n * @param p_manager the user event manager.\n *\n * @return true if the box is valid.\n */\nstatic OPJ_BOOL opj_jp2_read_header_procedure(  opj_jp2_t *jp2,\n                                                opj_stream_private_t *stream,\n                                                opj_event_mgr_t * p_manager );\n\n/**\n * Excutes the given procedures on the given codec.\n *\n * @param\tp_procedure_list\tthe list of procedures to execute\n * @param\tjp2\t\t\t\t\tthe jpeg2000 file codec to execute the procedures on.\n * @param\tstream\t\t\t\t\tthe stream to execute the procedures on.\n * @param\tp_manager\t\t\tthe user manager.\n *\n * @return\ttrue\t\t\t\tif all the procedures were successfully executed.\n */\nstatic OPJ_BOOL opj_jp2_exec (  opj_jp2_t * jp2,\n                                opj_procedure_list_t * p_procedure_list,\n                                opj_stream_private_t *stream,\n                                opj_event_mgr_t * p_manager );\n\n/**\n * Reads a box header. The box is the way data is packed inside a jpeg2000 file structure.\n *\n * @param\tcio\t\t\t\t\t\tthe input stream to read data from.\n * @param\tbox\t\t\t\t\t\tthe box structure to fill.\n * @param\tp_number_bytes_read\t\tpointer to an int that will store the number of bytes read from the stream (shoul usually be 2).\n * @param\tp_manager\t\t\t\tuser event manager.\n *\n * @return\ttrue if the box is reconized, false otherwise\n*/\nstatic OPJ_BOOL opj_jp2_read_boxhdr(opj_jp2_box_t *box,\n                                    OPJ_UINT32 * p_number_bytes_read,\n                                    opj_stream_private_t *cio,\n                                    opj_event_mgr_t * p_manager);\n\n/**\n * Sets up the validation ,i.e. adds the procedures to lauch to make sure the codec parameters\n * are valid. Developpers wanting to extend the library can add their own validation procedures.\n */\nstatic void opj_jp2_setup_encoding_validation (opj_jp2_t *jp2);\n\n/**\n * Sets up the procedures to do on writing header. Developpers wanting to extend the library can add their own writing procedures.\n */\nstatic void opj_jp2_setup_header_writing (opj_jp2_t *jp2);\n\nOPJ_BOOL opj_jp2_default_validation (\topj_jp2_t * jp2,\n                                        opj_stream_private_t *cio,\n                                        opj_event_mgr_t * p_manager );\n\n/**\n * Finds the image execution function related to the given box id.\n *\n * @param\tp_id\tthe id of the handler to fetch.\n *\n * @return\tthe given handler or NULL if it could not be found.\n */\nstatic const opj_jp2_header_handler_t * opj_jp2_img_find_handler (OPJ_UINT32 p_id);\n\n/**\n * Finds the execution function related to the given box id.\n *\n * @param\tp_id\tthe id of the handler to fetch.\n *\n * @return\tthe given handler or NULL if it could not be found.\n */\nstatic const opj_jp2_header_handler_t * opj_jp2_find_handler (OPJ_UINT32 p_id );\n\nconst opj_jp2_header_handler_t jp2_header [] =\n{\n\t{JP2_JP,opj_jp2_read_jp},\n\t{JP2_FTYP,opj_jp2_read_ftyp},\n\t{JP2_JP2H,opj_jp2_read_jp2h}\n};\n\nconst opj_jp2_header_handler_t jp2_img_header [] =\n{\n\t{JP2_IHDR,opj_jp2_read_ihdr},\n\t{JP2_COLR,opj_jp2_read_colr},\n\t{JP2_BPCC,opj_jp2_read_bpcc},\n\t{JP2_PCLR,opj_jp2_read_pclr},\n\t{JP2_CMAP,opj_jp2_read_cmap},\n\t{JP2_CDEF,opj_jp2_read_cdef}\n\n};\n\n/**\n * Reads a box header. The box is the way data is packed inside a jpeg2000 file structure. Data is read from a character string\n *\n * @param\tbox\t\t\t\t\t\tthe box structure to fill.\n * @param\tp_data\t\t\t\t\tthe character string to read data from.\n * @param\tp_number_bytes_read\t\tpointer to an int that will store the number of bytes read from the stream (shoul usually be 2).\n * @param\tp_box_max_size\t\t\tthe maximum number of bytes in the box.\n * @param\tp_manager         FIXME DOC\n *\n * @return\ttrue if the box is reconized, false otherwise\n*/\nstatic OPJ_BOOL opj_jp2_read_boxhdr_char(   opj_jp2_box_t *box,\n                                            OPJ_BYTE * p_data,\n                                            OPJ_UINT32 * p_number_bytes_read,\n                                            OPJ_UINT32 p_box_max_size,\n                                            opj_event_mgr_t * p_manager );\n\n/**\n * Sets up the validation ,i.e. adds the procedures to lauch to make sure the codec parameters\n * are valid. Developpers wanting to extend the library can add their own validation procedures.\n */\nstatic void opj_jp2_setup_decoding_validation (opj_jp2_t *jp2);\n\n/**\n * Sets up the procedures to do on reading header.\n * Developpers wanting to extend the library can add their own writing procedures.\n */\nstatic void opj_jp2_setup_header_reading (opj_jp2_t *jp2);\n\n/* ----------------------------------------------------------------------- */\n OPJ_BOOL opj_jp2_read_boxhdr(opj_jp2_box_t *box,\n                              OPJ_UINT32 * p_number_bytes_read,\n                              opj_stream_private_t *cio,\n                              opj_event_mgr_t * p_manager )\n{\n\t/* read header from file */\n\tOPJ_BYTE l_data_header [8];\n\n\t/* preconditions */\n\tassert(cio != 00);\n\tassert(box != 00);\n\tassert(p_number_bytes_read != 00);\n\tassert(p_manager != 00);\n\n\t*p_number_bytes_read = (OPJ_UINT32)opj_stream_read_data(cio,l_data_header,8,p_manager);\n\tif (*p_number_bytes_read != 8) {\n\t\treturn OPJ_FALSE;\n\t}\n\n\t/* process read data */\n\topj_read_bytes(l_data_header,&(box->length), 4);\n\topj_read_bytes(l_data_header+4,&(box->type), 4);\n    \n  if(box->length == 0)/* last box */\n    {\n    const OPJ_OFF_T bleft = opj_stream_get_number_byte_left(cio);\n    box->length = (OPJ_UINT32)bleft;\n    assert( (OPJ_OFF_T)box->length == bleft );\n    return OPJ_TRUE;\n    }\n\n\t/* do we have a \"special very large box ?\" */\n\t/* read then the XLBox */\n\tif (box->length == 1) {\n\t\tOPJ_UINT32 l_xl_part_size;\n\n\t\tOPJ_UINT32 l_nb_bytes_read = (OPJ_UINT32)opj_stream_read_data(cio,l_data_header,8,p_manager);\n\t\tif (l_nb_bytes_read != 8) {\n\t\t\tif (l_nb_bytes_read > 0) {\n\t\t\t\t*p_number_bytes_read += l_nb_bytes_read;\n\t\t\t}\n\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\n        *p_number_bytes_read = 16;\n\t\topj_read_bytes(l_data_header,&l_xl_part_size, 4);\n\t\tif (l_xl_part_size != 0) {\n\t\t\topj_event_msg(p_manager, EVT_ERROR, \"Cannot handle box sizes higher than 2^32\\n\");\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\t\topj_read_bytes(l_data_header+4,&(box->length), 4);\n\t}\n    return OPJ_TRUE;\n}\n\n#if 0\nstatic void jp2_write_url(opj_cio_t *cio, char *Idx_file) {\n\tOPJ_UINT32 i;\n\topj_jp2_box_t box;\n\n\tbox.init_pos = cio_tell(cio);\n\tcio_skip(cio, 4);\n\tcio_write(cio, JP2_URL, 4);\t/* DBTL */\n\tcio_write(cio, 0, 1);\t\t/* VERS */\n\tcio_write(cio, 0, 3);\t\t/* FLAG */\n\n\tif(Idx_file) {\n\t\tfor (i = 0; i < strlen(Idx_file); i++) {\n\t\t\tcio_write(cio, Idx_file[i], 1);\n\t\t}\n\t}\n\n\tbox.length = cio_tell(cio) - box.init_pos;\n\tcio_seek(cio, box.init_pos);\n\tcio_write(cio, box.length, 4);\t/* L */\n\tcio_seek(cio, box.init_pos + box.length);\n}\n#endif\n\nOPJ_BOOL opj_jp2_read_ihdr( opj_jp2_t *jp2,\n                            OPJ_BYTE *p_image_header_data,\n                            OPJ_UINT32 p_image_header_size,\n                            opj_event_mgr_t * p_manager )\n{\n\t/* preconditions */\n\tassert(p_image_header_data != 00);\n\tassert(jp2 != 00);\n\tassert(p_manager != 00);\n\n\tif (p_image_header_size != 14) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Bad image header box (bad size)\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\topj_read_bytes(p_image_header_data,&(jp2->h),4);\t\t\t/* HEIGHT */\n\tp_image_header_data += 4;\n\topj_read_bytes(p_image_header_data,&(jp2->w),4);\t\t\t/* WIDTH */\n\tp_image_header_data += 4;\n\topj_read_bytes(p_image_header_data,&(jp2->numcomps),2);\t\t/* NC */\n\tp_image_header_data += 2;\n\n\t/* allocate memory for components */\n\tjp2->comps = (opj_jp2_comps_t*) opj_malloc(jp2->numcomps * sizeof(opj_jp2_comps_t));\n\tif (jp2->comps == 0) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to handle image header (ihdr)\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\tmemset(jp2->comps,0,jp2->numcomps * sizeof(opj_jp2_comps_t));\n\n\topj_read_bytes(p_image_header_data,&(jp2->bpc),1);\t\t\t/* BPC */\n\t++ p_image_header_data;\n\n\topj_read_bytes(p_image_header_data,&(jp2->C),1);\t\t\t/* C */\n\t++ p_image_header_data;\n\n\t/* Should be equal to 7 cf. chapter about image header box of the norm */\n\tif (jp2->C != 7){\n\t\topj_event_msg(p_manager, EVT_INFO, \"JP2 IHDR box: compression type indicate that the file is not a conforming JP2 file (%d) \\n\", jp2->C);\n\t}\n\n\topj_read_bytes(p_image_header_data,&(jp2->UnkC),1);\t\t\t/* UnkC */\n\t++ p_image_header_data;\n\topj_read_bytes(p_image_header_data,&(jp2->IPR),1);\t\t\t/* IPR */\n\t++ p_image_header_data;\n\n\treturn OPJ_TRUE;\n}\n\nOPJ_BYTE * opj_jp2_write_ihdr(opj_jp2_t *jp2,\n                              OPJ_UINT32 * p_nb_bytes_written\n                              )\n{\n\tOPJ_BYTE * l_ihdr_data,* l_current_ihdr_ptr;\n\t\n\t/* preconditions */\n\tassert(jp2 != 00);\n\tassert(p_nb_bytes_written != 00);\n\n\t/* default image header is 22 bytes wide */\n\tl_ihdr_data = (OPJ_BYTE *) opj_malloc(22);\n\tif (l_ihdr_data == 00) {\n\t\treturn 00;\n\t}\n\tmemset(l_ihdr_data,0,22);\n\n\tl_current_ihdr_ptr = l_ihdr_data;\n\t\n\topj_write_bytes(l_current_ihdr_ptr,22,4);\t\t\t\t/* write box size */\n\tl_current_ihdr_ptr+=4;\n\n\topj_write_bytes(l_current_ihdr_ptr,JP2_IHDR, 4);\t\t/* IHDR */\n\tl_current_ihdr_ptr+=4;\n\t\n\topj_write_bytes(l_current_ihdr_ptr,jp2->h, 4);\t\t/* HEIGHT */\n\tl_current_ihdr_ptr+=4;\n\t\n\topj_write_bytes(l_current_ihdr_ptr, jp2->w, 4);\t\t/* WIDTH */\n\tl_current_ihdr_ptr+=4;\n\t\n\topj_write_bytes(l_current_ihdr_ptr, jp2->numcomps, 2);\t\t/* NC */\n\tl_current_ihdr_ptr+=2;\n\t\n\topj_write_bytes(l_current_ihdr_ptr, jp2->bpc, 1);\t\t/* BPC */\n\t++l_current_ihdr_ptr;\n\t\n\topj_write_bytes(l_current_ihdr_ptr, jp2->C, 1);\t\t/* C : Always 7 */\n\t++l_current_ihdr_ptr;\n\t\n\topj_write_bytes(l_current_ihdr_ptr, jp2->UnkC, 1);\t\t/* UnkC, colorspace unknown */\n\t++l_current_ihdr_ptr;\n\t\n\topj_write_bytes(l_current_ihdr_ptr, jp2->IPR, 1);\t\t/* IPR, no intellectual property */\n\t++l_current_ihdr_ptr;\n\t\n\t*p_nb_bytes_written = 22;\n\t\n\treturn l_ihdr_data;\n}\n\nOPJ_BYTE * opj_jp2_write_bpcc(\topj_jp2_t *jp2,\n\t\t\t\t\t\t        OPJ_UINT32 * p_nb_bytes_written\n                                )\n{\n\tOPJ_UINT32 i;\n\t/* room for 8 bytes for box and 1 byte for each component */\n\tOPJ_UINT32 l_bpcc_size = 8 + jp2->numcomps;\n\tOPJ_BYTE * l_bpcc_data,* l_current_bpcc_ptr;\n\t\n\t/* preconditions */\n\tassert(jp2 != 00);\n\tassert(p_nb_bytes_written != 00);\n\n\tl_bpcc_data = (OPJ_BYTE *) opj_malloc(l_bpcc_size);\n\tif (l_bpcc_data == 00) {\n\t\treturn 00;\n\t}\n\tmemset(l_bpcc_data,0,l_bpcc_size);\n\n\tl_current_bpcc_ptr = l_bpcc_data;\n\n\topj_write_bytes(l_current_bpcc_ptr,l_bpcc_size,4);\t\t\t\t/* write box size */\n\tl_current_bpcc_ptr += 4;\n\t\n\topj_write_bytes(l_current_bpcc_ptr,JP2_BPCC,4);\t\t\t\t\t/* BPCC */\n\tl_current_bpcc_ptr += 4;\n\n\tfor (i = 0; i < jp2->numcomps; ++i)  {\n\t\topj_write_bytes(l_current_bpcc_ptr, jp2->comps[i].bpcc, 1); /* write each component information */\n\t\t++l_current_bpcc_ptr;\n\t}\n\n\t*p_nb_bytes_written = l_bpcc_size;\n\t\n\treturn l_bpcc_data;\n}\n\nOPJ_BOOL opj_jp2_read_bpcc( opj_jp2_t *jp2,\n                            OPJ_BYTE * p_bpc_header_data,\n                            OPJ_UINT32 p_bpc_header_size,\n                            opj_event_mgr_t * p_manager\n                            )\n{\n\tOPJ_UINT32 i;\n\n\t/* preconditions */\n\tassert(p_bpc_header_data != 00);\n\tassert(jp2 != 00);\n\tassert(p_manager != 00);\n\n\t\n\tif (jp2->bpc != 255 ){\n\t\topj_event_msg(p_manager, EVT_WARNING, \"A BPCC header box is available although BPC given by the IHDR box (%d) indicate components bit depth is constant\\n\",jp2->bpc);\n\t}\n\n\t/* and length is relevant */\n\tif (p_bpc_header_size != jp2->numcomps) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Bad BPCC header box (bad size)\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\t/* read info for each component */\n\tfor (i = 0; i < jp2->numcomps; ++i) {\n\t\topj_read_bytes(p_bpc_header_data,&jp2->comps[i].bpcc ,1);\t/* read each BPCC component */\n\t\t++p_bpc_header_data;\n\t}\n\n\treturn OPJ_TRUE;\n}\n\nOPJ_BYTE * opj_jp2_write_colr(  opj_jp2_t *jp2,\n\t\t\t\t\t\t\t    OPJ_UINT32 * p_nb_bytes_written\n                                )\n{\n\t/* room for 8 bytes for box 3 for common data and variable upon profile*/\n\tOPJ_UINT32 l_colr_size = 11;\n\tOPJ_BYTE * l_colr_data,* l_current_colr_ptr;\n\t\n\t/* preconditions */\n\tassert(jp2 != 00);\n\tassert(p_nb_bytes_written != 00);\n    assert(jp2->meth == 1 || jp2->meth == 2);\n\n\tswitch (jp2->meth) { \n\t\tcase 1 :\n\t\t\tl_colr_size += 4; /* EnumCS */\n\t\t\tbreak;\n\t\tcase 2 :\n            assert(jp2->color.icc_profile_len);\t/* ICC profile */\n            l_colr_size += jp2->color.icc_profile_len;\n\t\t\tbreak;\n\t\tdefault :\n\t\t\treturn 00;\n\t}\n\n\tl_colr_data = (OPJ_BYTE *) opj_malloc(l_colr_size);\n\tif (l_colr_data == 00) {\n\t\treturn 00;\n\t}\n\tmemset(l_colr_data,0,l_colr_size);\n\t\n\tl_current_colr_ptr = l_colr_data;\n\n\topj_write_bytes(l_current_colr_ptr,l_colr_size,4);\t\t\t\t/* write box size */\n\tl_current_colr_ptr += 4;\n\t\n\topj_write_bytes(l_current_colr_ptr,JP2_COLR,4);\t\t\t\t\t/* BPCC */\n\tl_current_colr_ptr += 4;\n\t\n\topj_write_bytes(l_current_colr_ptr, jp2->meth,1);\t\t\t\t/* METH */\n\t++l_current_colr_ptr;\n\t\n\topj_write_bytes(l_current_colr_ptr, jp2->precedence,1);\t\t\t/* PRECEDENCE */\n\t++l_current_colr_ptr;\n\t\n\topj_write_bytes(l_current_colr_ptr, jp2->approx,1);\t\t\t\t/* APPROX */\n\t++l_current_colr_ptr;\n\t\n\tif (jp2->meth == 1) { /* Meth value is restricted to 1 or 2 (Table I.9 of part 1) */\n        opj_write_bytes(l_current_colr_ptr, jp2->enumcs,4); }       /* EnumCS */\n    else {\n        if (jp2->meth == 2) {                                      /* ICC profile */\n            OPJ_UINT32 i;\n            for(i = 0; i < jp2->color.icc_profile_len; ++i) {\n                opj_write_bytes(l_current_colr_ptr, jp2->color.icc_profile_buf[i], 1);\n                ++l_current_colr_ptr;\n            }\n        }\n\t}\n\n\t*p_nb_bytes_written = l_colr_size;\n\t\n\treturn l_colr_data;\n}\n\nvoid opj_jp2_free_pclr(opj_jp2_color_t *color)\n{\n    opj_free(color->jp2_pclr->channel_sign);\n    opj_free(color->jp2_pclr->channel_size);\n    opj_free(color->jp2_pclr->entries);\n\n\tif(color->jp2_pclr->cmap) opj_free(color->jp2_pclr->cmap);\n\n    opj_free(color->jp2_pclr); color->jp2_pclr = NULL;\n}\n\nstatic OPJ_BOOL opj_jp2_check_color(opj_image_t *image, opj_jp2_color_t *color, opj_event_mgr_t *p_manager)\n{\n\tOPJ_UINT16 i;\n\n\t/* testcase 4149.pdf.SIGSEGV.cf7.3501 */\n\tif (color->jp2_cdef) {\n\t\topj_jp2_cdef_info_t *info = color->jp2_cdef->info;\n\t\tOPJ_UINT16 n = color->jp2_cdef->n;\n\n\t\tfor (i = 0; i < n; i++) {\n\t\t\tif (info[i].cn >= image->numcomps) {\n\t\t\t\topj_event_msg(p_manager, EVT_ERROR, \"Invalid component index %d (>= %d).\\n\", info[i].cn, image->numcomps);\n\t\t\t\treturn OPJ_FALSE;\n\t\t\t}\n\t\t\tif (info[i].asoc > 0 && (OPJ_UINT32)(info[i].asoc - 1) >= image->numcomps) {\n\t\t\t\topj_event_msg(p_manager, EVT_ERROR, \"Invalid component index %d (>= %d).\\n\", info[i].asoc - 1, image->numcomps);\n\t\t\t\treturn OPJ_FALSE;\n\t\t\t}\n\t\t}\n\t}\n\n\t/* testcases 451.pdf.SIGSEGV.f4c.3723, 451.pdf.SIGSEGV.5b5.3723 and\n\t   66ea31acbb0f23a2bbc91f64d69a03f5_signal_sigsegv_13937c0_7030_5725.pdf */\n\tif (color->jp2_pclr && color->jp2_pclr->cmap) {\n\t\tOPJ_UINT16 nr_channels = color->jp2_pclr->nr_channels;\n\t\topj_jp2_cmap_comp_t *cmap = color->jp2_pclr->cmap;\n\t\tOPJ_BOOL *pcol_usage, is_sane = OPJ_TRUE;\n\n\t\t/* verify that all original components match an existing one */\n\t\tfor (i = 0; i < nr_channels; i++) {\n\t\t\tif (cmap[i].cmp >= image->numcomps) {\n\t\t\t\topj_event_msg(p_manager, EVT_ERROR, \"Invalid component index %d (>= %d).\\n\", cmap[i].cmp, image->numcomps);\n\t\t\t\tis_sane = OPJ_FALSE;\n\t\t\t}\n\t\t}\n\n\t\tpcol_usage = opj_calloc(nr_channels, sizeof(OPJ_BOOL));\n\t\tif (!pcol_usage) {\n\t\t\topj_event_msg(p_manager, EVT_ERROR, \"Unexpected OOM.\\n\");\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\t\t/* verify that no component is targeted more than once */\n\t\tfor (i = 0; i < nr_channels; i++) {\n      OPJ_UINT16 pcol = cmap[i].pcol;\n      assert(cmap[i].mtyp == 0 || cmap[i].mtyp == 1);\n\t\t\tif (pcol >= nr_channels) {\n\t\t\t\topj_event_msg(p_manager, EVT_ERROR, \"Invalid component/palette index for direct mapping %d.\\n\", pcol);\n\t\t\t\tis_sane = OPJ_FALSE;\n\t\t\t}\n\t\t\telse if (pcol_usage[pcol] && cmap[i].mtyp == 1) {\n\t\t\t\topj_event_msg(p_manager, EVT_ERROR, \"Component %d is mapped twice.\\n\", pcol);\n\t\t\t\tis_sane = OPJ_FALSE;\n\t\t\t}\n      else if (cmap[i].mtyp == 0 && cmap[i].pcol != 0) {\n        /* I.5.3.5 PCOL: If the value of the MTYP field for this channel is 0, then\n         * the value of this field shall be 0. */\n\t\t\t\topj_event_msg(p_manager, EVT_ERROR, \"Direct use at #%d however pcol=%d.\\n\", i, pcol);\n\t\t\t\tis_sane = OPJ_FALSE;\n      }\n\t\t\telse\n\t\t\t\tpcol_usage[pcol] = OPJ_TRUE;\n\t\t}\n\t\t/* verify that all components are targeted at least once */\n\t\tfor (i = 0; i < nr_channels; i++) {\n\t\t\tif (!pcol_usage[i] && cmap[i].mtyp != 0) {\n\t\t\t\topj_event_msg(p_manager, EVT_ERROR, \"Component %d doesn't have a mapping.\\n\", i);\n\t\t\t\tis_sane = OPJ_FALSE;\n\t\t\t}\n\t\t}\n\t\topj_free(pcol_usage);\n\t\tif (!is_sane) {\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\t}\n\n\treturn OPJ_TRUE;\n}\n\n/* file9.jp2 */\nvoid opj_jp2_apply_pclr(opj_image_t *image, opj_jp2_color_t *color)\n{\n\topj_image_comp_t *old_comps, *new_comps;\n\tOPJ_BYTE *channel_size, *channel_sign;\n\tOPJ_UINT32 *entries;\n\topj_jp2_cmap_comp_t *cmap;\n\tOPJ_INT32 *src, *dst;\n\tOPJ_UINT32 j, max;\n\tOPJ_UINT16 i, nr_channels, cmp, pcol;\n\tOPJ_INT32 k, top_k;\n\n\tchannel_size = color->jp2_pclr->channel_size;\n\tchannel_sign = color->jp2_pclr->channel_sign;\n\tentries = color->jp2_pclr->entries;\n\tcmap = color->jp2_pclr->cmap;\n\tnr_channels = color->jp2_pclr->nr_channels;\n\n\told_comps = image->comps;\n\tnew_comps = (opj_image_comp_t*)\n\t\t\topj_malloc(nr_channels * sizeof(opj_image_comp_t));\n\n\tfor(i = 0; i < nr_channels; ++i) {\n\t\tpcol = cmap[i].pcol; cmp = cmap[i].cmp;\n\n\t\t/* Direct use */\n    if(cmap[i].mtyp == 0){\n      assert( pcol == 0 );\n      new_comps[i] = old_comps[cmp];\n    } else {\n      assert( i == pcol );\n      new_comps[pcol] = old_comps[cmp];\n    }\n\n\t\t/* Palette mapping: */\n\t\tnew_comps[i].data = (OPJ_INT32*)\n\t\t\t\topj_malloc(old_comps[cmp].w * old_comps[cmp].h * sizeof(OPJ_INT32));\n\t\tnew_comps[i].prec = channel_size[i];\n\t\tnew_comps[i].sgnd = channel_sign[i];\n\t}\n\n\ttop_k = color->jp2_pclr->nr_entries - 1;\n\n\tfor(i = 0; i < nr_channels; ++i) {\n\t\t/* Palette mapping: */\n\t\tcmp = cmap[i].cmp; pcol = cmap[i].pcol;\n\t\tsrc = old_comps[cmp].data;\n    assert( src );\n\t\tmax = new_comps[pcol].w * new_comps[pcol].h;\n\n\t\t/* Direct use: */\n    if(cmap[i].mtyp == 0) {\n      assert( cmp == 0 );\n      dst = new_comps[i].data;\n      assert( dst );\n      for(j = 0; j < max; ++j) {\n        dst[j] = src[j];\n      }\n    }\n    else {\n      assert( i == pcol );\n      dst = new_comps[pcol].data;\n      assert( dst );\n      for(j = 0; j < max; ++j) {\n        /* The index */\n        if((k = src[j]) < 0) k = 0; else if(k > top_k) k = top_k;\n\n        /* The colour */\n        dst[j] = (OPJ_INT32)entries[k * nr_channels + pcol];\n        }\n    }\n\t}\n\n\tmax = image->numcomps;\n\tfor(i = 0; i < max; ++i) {\n\t\tif(old_comps[i].data) opj_free(old_comps[i].data);\n\t}\n\n\topj_free(old_comps);\n\timage->comps = new_comps;\n\timage->numcomps = nr_channels;\n\n\topj_jp2_free_pclr(color);\n\n}/* apply_pclr() */\n\nOPJ_BOOL opj_jp2_read_pclr(\topj_jp2_t *jp2,\n                            OPJ_BYTE * p_pclr_header_data,\n                            OPJ_UINT32 p_pclr_header_size,\n                            opj_event_mgr_t * p_manager\n                            )\n{\n\topj_jp2_pclr_t *jp2_pclr;\n\tOPJ_BYTE *channel_size, *channel_sign;\n\tOPJ_UINT32 *entries;\n\tOPJ_UINT16 nr_entries,nr_channels;\n\tOPJ_UINT16 i, j;\n\tOPJ_UINT32 l_value;\n\tOPJ_BYTE *orig_header_data = p_pclr_header_data;\n\n\t/* preconditions */\n\tassert(p_pclr_header_data != 00);\n\tassert(jp2 != 00);\n\tassert(p_manager != 00);\n    (void)p_pclr_header_size;\n\n\tif(jp2->color.jp2_pclr)\n\t\treturn OPJ_FALSE;\n\n\tif (p_pclr_header_size < 3)\n\t\treturn OPJ_FALSE;\n\n\topj_read_bytes(p_pclr_header_data, &l_value , 2);\t/* NE */\n\tp_pclr_header_data += 2;\n\tnr_entries = (OPJ_UINT16) l_value;\n\n\topj_read_bytes(p_pclr_header_data, &l_value , 1);\t/* NPC */\n\t++p_pclr_header_data;\n\tnr_channels = (OPJ_UINT16) l_value;\n\n\tif (p_pclr_header_size < 3 + (OPJ_UINT32)nr_channels || nr_channels == 0 || nr_entries >= (OPJ_UINT32)-1 / nr_channels)\n\t\treturn OPJ_FALSE;\n\n\tentries = (OPJ_UINT32*) opj_malloc((size_t)nr_channels * nr_entries * sizeof(OPJ_UINT32));\n    if (!entries)\n        return OPJ_FALSE;\n\tchannel_size = (OPJ_BYTE*) opj_malloc(nr_channels);\n    if (!channel_size)\n    {\n        opj_free(entries);\n        return OPJ_FALSE;\n    }\n\tchannel_sign = (OPJ_BYTE*) opj_malloc(nr_channels);\n\tif (!channel_sign)\n\t{\n        opj_free(entries);\n        opj_free(channel_size);\n        return OPJ_FALSE;\n\t}\n\n\tjp2_pclr = (opj_jp2_pclr_t*)opj_malloc(sizeof(opj_jp2_pclr_t));\n    if (!jp2_pclr)\n    {\n        opj_free(entries);\n        opj_free(channel_size);\n        opj_free(channel_sign);\n        return OPJ_FALSE;\n    }\n\n\tjp2_pclr->channel_sign = channel_sign;\n\tjp2_pclr->channel_size = channel_size;\n\tjp2_pclr->entries = entries;\n\tjp2_pclr->nr_entries = nr_entries;\n\tjp2_pclr->nr_channels = (OPJ_BYTE) l_value;\n\tjp2_pclr->cmap = NULL;\n\n\tjp2->color.jp2_pclr = jp2_pclr;\n\n\tfor(i = 0; i < nr_channels; ++i) {\n\t\topj_read_bytes(p_pclr_header_data, &l_value , 1);\t/* Bi */\n\t\t++p_pclr_header_data;\n\n\t\tchannel_size[i] = (OPJ_BYTE)((l_value & 0x7f) + 1);\n\t\tchannel_sign[i] = (l_value & 0x80) ? 1 : 0;\n\t}\n\n\tfor(j = 0; j < nr_entries; ++j) {\n\t\tfor(i = 0; i < nr_channels; ++i) {\n\t\t\tOPJ_UINT32 bytes_to_read = (OPJ_UINT32)((channel_size[i]+7)>>3);\n\n\t\t\tif (bytes_to_read > sizeof(OPJ_UINT32))\n\t\t\t\tbytes_to_read = sizeof(OPJ_UINT32);\n\t\t\tif ((ptrdiff_t)p_pclr_header_size < p_pclr_header_data - orig_header_data + (ptrdiff_t)bytes_to_read)\n\t\t\t\treturn OPJ_FALSE;\n\n\t\t\topj_read_bytes(p_pclr_header_data, &l_value , bytes_to_read);\t/* Cji */\n\t\t\tp_pclr_header_data += bytes_to_read;\n\t\t\t*entries = (OPJ_UINT32) l_value;\n\t\t\tentries++;\n\t\t}\n\t}\n\n\treturn OPJ_TRUE;\n}\n\nOPJ_BOOL opj_jp2_read_cmap(\topj_jp2_t * jp2,\n                            OPJ_BYTE * p_cmap_header_data,\n                            OPJ_UINT32 p_cmap_header_size,\n                            opj_event_mgr_t * p_manager\n                            )\n{\n\topj_jp2_cmap_comp_t *cmap;\n\tOPJ_BYTE i, nr_channels;\n\tOPJ_UINT32 l_value;\n\n\t/* preconditions */\n\tassert(jp2 != 00);\n\tassert(p_cmap_header_data != 00);\n\tassert(p_manager != 00);\n    (void)p_cmap_header_size;\n\n\t/* Need nr_channels: */\n\tif(jp2->color.jp2_pclr == NULL) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Need to read a PCLR box before the CMAP box.\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\t/* Part 1, I.5.3.5: 'There shall be at most one Component Mapping box\n\t * inside a JP2 Header box' :\n\t*/\n\tif(jp2->color.jp2_pclr->cmap) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Only one CMAP box is allowed.\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\tnr_channels = jp2->color.jp2_pclr->nr_channels;\n\tif (p_cmap_header_size < (OPJ_UINT32)nr_channels * 4) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Insufficient data for CMAP box.\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\tcmap = (opj_jp2_cmap_comp_t*) opj_malloc(nr_channels * sizeof(opj_jp2_cmap_comp_t));\n    if (!cmap)\n        return OPJ_FALSE;\n\n\n\tfor(i = 0; i < nr_channels; ++i) {\n\t\topj_read_bytes(p_cmap_header_data, &l_value, 2);\t\t\t/* CMP^i */\n\t\tp_cmap_header_data +=2;\n\t\tcmap[i].cmp = (OPJ_UINT16) l_value;\n\n\t\topj_read_bytes(p_cmap_header_data, &l_value, 1);\t\t\t/* MTYP^i */\n\t\t++p_cmap_header_data;\n\t\tcmap[i].mtyp = (OPJ_BYTE) l_value;\n\n\t\topj_read_bytes(p_cmap_header_data, &l_value, 1);\t\t\t/* PCOL^i */\n\t\t++p_cmap_header_data;\n\t\tcmap[i].pcol = (OPJ_BYTE) l_value;\n\t}\n\n\tjp2->color.jp2_pclr->cmap = cmap;\n\n\treturn OPJ_TRUE;\n}\n\nvoid opj_jp2_apply_cdef(opj_image_t *image, opj_jp2_color_t *color)\n{\n\topj_jp2_cdef_info_t *info;\n\tOPJ_UINT16 i, n, cn, asoc, acn;\n\n\tinfo = color->jp2_cdef->info;\n\tn = color->jp2_cdef->n;\n\n  for(i = 0; i < n; ++i)\n    {\n    /* WATCH: acn = asoc - 1 ! */\n    asoc = info[i].asoc;\n    if(asoc == 0 || asoc == 65535)\n      {\n      if (i < image->numcomps)\n        image->comps[i].alpha = info[i].typ;\n      continue;\n      }\n\n    cn = info[i].cn; \n    acn = (OPJ_UINT16)(asoc - 1);\n    if( cn >= image->numcomps || acn >= image->numcomps )\n      {\n      fprintf(stderr, \"cn=%d, acn=%d, numcomps=%d\\n\", cn, acn, image->numcomps);\n      continue;\n      }\n\n\t\tif(cn != acn)\n\t\t{\n\t\t\topj_image_comp_t saved;\n\n\t\t\tmemcpy(&saved, &image->comps[cn], sizeof(opj_image_comp_t));\n\t\t\tmemcpy(&image->comps[cn], &image->comps[acn], sizeof(opj_image_comp_t));\n\t\t\tmemcpy(&image->comps[acn], &saved, sizeof(opj_image_comp_t));\n\n\t\t\tinfo[i].asoc = (OPJ_UINT16)(cn + 1);\n\t\t\tinfo[acn].asoc = (OPJ_UINT16)(info[acn].cn + 1);\n\t\t}\n\n\t\timage->comps[cn].alpha = info[i].typ;\n\t}\n\n\tif(color->jp2_cdef->info) opj_free(color->jp2_cdef->info);\n\n\topj_free(color->jp2_cdef); color->jp2_cdef = NULL;\n\n}/* jp2_apply_cdef() */\n\nOPJ_BOOL opj_jp2_read_cdef(\topj_jp2_t * jp2,\n                            OPJ_BYTE * p_cdef_header_data,\n\t\t\t\t\t\t\tOPJ_UINT32 p_cdef_header_size,\n\t\t\t\t\t\t\topj_event_mgr_t * p_manager\n                            )\n{\n\topj_jp2_cdef_info_t *cdef_info;\n\tOPJ_UINT16 i;\n\tOPJ_UINT32 l_value;\n\n\t/* preconditions */\n\tassert(jp2 != 00);\n\tassert(p_cdef_header_data != 00);\n\tassert(p_manager != 00);\n    (void)p_cdef_header_size;\n\n\t/* Part 1, I.5.3.6: 'The shall be at most one Channel Definition box\n\t * inside a JP2 Header box.'*/\n\tif(jp2->color.jp2_cdef) return OPJ_FALSE;\n\n\tif (p_cdef_header_size < 2) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Insufficient data for CDEF box.\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\topj_read_bytes(p_cdef_header_data,&l_value ,2);\t\t\t/* N */\n\tp_cdef_header_data+= 2;\n\n\tif ( (OPJ_UINT16)l_value == 0){ /* szukw000: FIXME */\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Number of channel description is equal to zero in CDEF box.\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\tif (p_cdef_header_size < 2 + (OPJ_UINT32)(OPJ_UINT16)l_value * 6) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Insufficient data for CDEF box.\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\tcdef_info = (opj_jp2_cdef_info_t*) opj_malloc(l_value * sizeof(opj_jp2_cdef_info_t));\n    if (!cdef_info)\n        return OPJ_FALSE;\n\n\tjp2->color.jp2_cdef = (opj_jp2_cdef_t*)opj_malloc(sizeof(opj_jp2_cdef_t));\n    if(!jp2->color.jp2_cdef)\n    {\n        opj_free(cdef_info);\n        return OPJ_FALSE;\n    }\n\tjp2->color.jp2_cdef->info = cdef_info;\n\tjp2->color.jp2_cdef->n = (OPJ_UINT16) l_value;\n\n\tfor(i = 0; i < jp2->color.jp2_cdef->n; ++i) {\n\t\topj_read_bytes(p_cdef_header_data, &l_value, 2);\t\t\t/* Cn^i */\n\t\tp_cdef_header_data +=2;\n\t\tcdef_info[i].cn = (OPJ_UINT16) l_value;\n\n\t\topj_read_bytes(p_cdef_header_data, &l_value, 2);\t\t\t/* Typ^i */\n\t\tp_cdef_header_data +=2;\n\t\tcdef_info[i].typ = (OPJ_UINT16) l_value;\n\n\t\topj_read_bytes(p_cdef_header_data, &l_value, 2);\t\t\t/* Asoc^i */\n\t\tp_cdef_header_data +=2;\n\t\tcdef_info[i].asoc = (OPJ_UINT16) l_value;\n   }\n\n\treturn OPJ_TRUE;\n}\n\nOPJ_BOOL opj_jp2_read_colr( opj_jp2_t *jp2,\n                            OPJ_BYTE * p_colr_header_data,\n                            OPJ_UINT32 p_colr_header_size,\n                            opj_event_mgr_t * p_manager\n                            )\n{\n\tOPJ_UINT32 l_value;\n\n\t/* preconditions */\n\tassert(jp2 != 00);\n\tassert(p_colr_header_data != 00);\n\tassert(p_manager != 00);\n\n\tif (p_colr_header_size < 3) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Bad COLR header box (bad size)\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\t/* Part 1, I.5.3.3 : 'A conforming JP2 reader shall ignore all Colour\n\t * Specification boxes after the first.'\n\t*/\n\tif(jp2->color.jp2_has_colr) {\n\t\topj_event_msg(p_manager, EVT_INFO, \"A conforming JP2 reader shall ignore all Colour Specification boxes after the first, so we ignore this one.\\n\");\n\t\tp_colr_header_data += p_colr_header_size;\n\t\treturn OPJ_TRUE;\n\t}\n\n\topj_read_bytes(p_colr_header_data,&jp2->meth ,1);\t\t\t/* METH */\n\t++p_colr_header_data;\n\n\topj_read_bytes(p_colr_header_data,&jp2->precedence ,1);\t\t/* PRECEDENCE */\n\t++p_colr_header_data;\n\n\topj_read_bytes(p_colr_header_data,&jp2->approx ,1);\t\t\t/* APPROX */\n\t++p_colr_header_data;\n\n\tif (jp2->meth == 1) {\n\t\tif (p_colr_header_size < 7) {\n\t\t\topj_event_msg(p_manager, EVT_ERROR, \"Bad COLR header box (bad size: %d)\\n\", p_colr_header_size);\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\t\tif (p_colr_header_size > 7) {\n\t\t\t/* testcase Altona_Technical_v20_x4.pdf */\n\t\t\topj_event_msg(p_manager, EVT_WARNING, \"Bad COLR header box (bad size: %d)\\n\", p_colr_header_size);\n\t\t}\n\n\t\topj_read_bytes(p_colr_header_data,&jp2->enumcs ,4);\t\t\t/* EnumCS */\n        \n        jp2->color.jp2_has_colr = 1;\n\t}\n\telse if (jp2->meth == 2) {\n\t\t/* ICC profile */\n\t\tOPJ_INT32 it_icc_value = 0;\n\t\tOPJ_INT32 icc_len = (OPJ_INT32)p_colr_header_size - 3;\n\n\t\tjp2->color.icc_profile_len = (OPJ_UINT32)icc_len;\n\t\tjp2->color.icc_profile_buf = (OPJ_BYTE*) opj_malloc((size_t)icc_len);\n        if (!jp2->color.icc_profile_buf)\n        {\n            jp2->color.icc_profile_len = 0;\n            return OPJ_FALSE;\n        }\n\t\tmemset(jp2->color.icc_profile_buf, 0, (size_t)icc_len * sizeof(OPJ_BYTE));\n\n\t\tfor (it_icc_value = 0; it_icc_value < icc_len; ++it_icc_value)\n\t\t{\n\t\t\topj_read_bytes(p_colr_header_data,&l_value,1);\t\t/* icc values */\n\t\t\t++p_colr_header_data;\n\t\t\tjp2->color.icc_profile_buf[it_icc_value] = (OPJ_BYTE) l_value;\n\t\t}\n\t    \n        jp2->color.jp2_has_colr = 1;\n\t}\n\telse if (jp2->meth > 2)\n    {\n        /*\tISO/IEC 15444-1:2004 (E), Table I.9  Legal METH values:\n        conforming JP2 reader shall ignore the entire Colour Specification box.*/\n        opj_event_msg(p_manager, EVT_INFO, \"COLR BOX meth value is not a regular value (%d), \" \n            \"so we will ignore the entire Colour Specification box. \\n\", jp2->meth);\n    }\n    return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_jp2_decode(opj_jp2_t *jp2,\n                        opj_stream_private_t *p_stream,\n                        opj_image_t* p_image,\n                        opj_event_mgr_t * p_manager)\n{\n\tif (!p_image)\n\t\treturn OPJ_FALSE;\n\n\t/* J2K decoding */\n\tif( ! opj_j2k_decode(jp2->j2k, p_stream, p_image, p_manager) ) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Failed to decode the codestream in the JP2 file\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n    if (!jp2->ignore_pclr_cmap_cdef){\n\t    if (!opj_jp2_check_color(p_image, &(jp2->color), p_manager)) {\n\t\t    return OPJ_FALSE;\n\t    }\n\n\t    /* Set Image Color Space */\n\t    if (jp2->enumcs == 16)\n\t\t    p_image->color_space = OPJ_CLRSPC_SRGB;\n\t    else if (jp2->enumcs == 17)\n\t\t    p_image->color_space = OPJ_CLRSPC_GRAY;\n\t    else if (jp2->enumcs == 18)\n\t\t    p_image->color_space = OPJ_CLRSPC_SYCC;\n            else if (jp2->enumcs == 24)\n                    p_image->color_space = OPJ_CLRSPC_EYCC;\n\t    else\n\t\t    p_image->color_space = OPJ_CLRSPC_UNKNOWN;\n\n\t    /* Apply the color space if needed */\n\t    if(jp2->color.jp2_cdef) {\n\t\t    opj_jp2_apply_cdef(p_image, &(jp2->color));\n\t    }\n\n\t    if(jp2->color.jp2_pclr) {\n\t\t    /* Part 1, I.5.3.4: Either both or none : */\n\t\t    if( !jp2->color.jp2_pclr->cmap)\n\t\t\t    opj_jp2_free_pclr(&(jp2->color));\n\t\t    else\n\t\t\t    opj_jp2_apply_pclr(p_image, &(jp2->color));\n\t    }\n\n\t    if(jp2->color.icc_profile_buf) {\n\t\t    p_image->icc_profile_buf = jp2->color.icc_profile_buf;\n\t\t    p_image->icc_profile_len = jp2->color.icc_profile_len;\n\t\t    jp2->color.icc_profile_buf = NULL;\n\t    }\n    }\n\n\treturn OPJ_TRUE;\n}\n\nOPJ_BOOL opj_jp2_write_jp2h(opj_jp2_t *jp2,\n                            opj_stream_private_t *stream,\n                            opj_event_mgr_t * p_manager\n                            )\n{\n\topj_jp2_img_header_writer_handler_t l_writers [3];\n\topj_jp2_img_header_writer_handler_t * l_current_writer;\n\n\tOPJ_INT32 i, l_nb_pass;\n\t/* size of data for super box*/\n\tOPJ_UINT32 l_jp2h_size = 8;\n\tOPJ_BOOL l_result = OPJ_TRUE;\n\n\t/* to store the data of the super box */\n\tOPJ_BYTE l_jp2h_data [8];\n\t\n\t/* preconditions */\n\tassert(stream != 00);\n\tassert(jp2 != 00);\n\tassert(p_manager != 00);\n\n\tmemset(l_writers,0,sizeof(l_writers));\n\n\tif (jp2->bpc == 255) {\n\t\tl_nb_pass = 3;\n\t\tl_writers[0].handler = opj_jp2_write_ihdr;\n\t\tl_writers[1].handler = opj_jp2_write_bpcc;\n\t\tl_writers[2].handler = opj_jp2_write_colr;\n\t}\n\telse {\n\t\tl_nb_pass = 2;\n\t\tl_writers[0].handler = opj_jp2_write_ihdr;\n\t\tl_writers[1].handler = opj_jp2_write_colr;\n\t}\n\t\n\t/* write box header */\n\t/* write JP2H type */\n\topj_write_bytes(l_jp2h_data+4,JP2_JP2H,4);\n\n\tl_current_writer = l_writers;\n\tfor (i=0;i<l_nb_pass;++i) {\n\t\tl_current_writer->m_data = l_current_writer->handler(jp2,&(l_current_writer->m_size));\n\t\tif (l_current_writer->m_data == 00) {\n\t\t\topj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to hold JP2 Header data\\n\");\n\t\t\tl_result = OPJ_FALSE;\n\t\t\tbreak;\n\t\t}\n\n\t\tl_jp2h_size += l_current_writer->m_size;\n\t\t++l_current_writer;\n\t}\n\n\tif (! l_result) {\n\t\tl_current_writer = l_writers;\n\t\tfor (i=0;i<l_nb_pass;++i) {\n\t\t\tif (l_current_writer->m_data != 00) {\n\t\t\t\topj_free(l_current_writer->m_data );\n\t\t\t}\n\t\t\t++l_current_writer;\n\t\t}\n\n\t\treturn OPJ_FALSE;\n\t}\n\n\t/* write super box size */\n\topj_write_bytes(l_jp2h_data,l_jp2h_size,4);\n\t\n\t/* write super box data on stream */\n\tif (opj_stream_write_data(stream,l_jp2h_data,8,p_manager) != 8) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Stream error while writing JP2 Header box\\n\");\n\t\tl_result = OPJ_FALSE;\n\t}\n\t\n\tif (l_result) {\n\t\tl_current_writer = l_writers;\n\t\tfor (i=0;i<l_nb_pass;++i) {\n\t\t\tif (opj_stream_write_data(stream,l_current_writer->m_data,l_current_writer->m_size,p_manager) != l_current_writer->m_size) {\n\t\t\t\topj_event_msg(p_manager, EVT_ERROR, \"Stream error while writing JP2 Header box\\n\");\n\t\t\t\tl_result = OPJ_FALSE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t++l_current_writer;\n\t\t}\n\t}\n\n\tl_current_writer = l_writers;\n\t\n\t/* cleanup */\n\tfor (i=0;i<l_nb_pass;++i) {\n\t\tif (l_current_writer->m_data != 00) {\n\t\t\topj_free(l_current_writer->m_data );\n\t\t}\n\t\t++l_current_writer;\n\t}\n\n\treturn l_result;\n}\n\nOPJ_BOOL opj_jp2_write_ftyp(opj_jp2_t *jp2,\n\t\t\t\t\t\t\topj_stream_private_t *cio,\n\t\t\t\t\t\t\topj_event_mgr_t * p_manager )\n{\n\tOPJ_UINT32 i;\n\tOPJ_UINT32 l_ftyp_size = 16 + 4 * jp2->numcl;\n\tOPJ_BYTE * l_ftyp_data, * l_current_data_ptr;\n\tOPJ_BOOL l_result;\n\n\t/* preconditions */\n\tassert(cio != 00);\n\tassert(jp2 != 00);\n\tassert(p_manager != 00);\n\n\tl_ftyp_data = (OPJ_BYTE *) opj_malloc(l_ftyp_size);\n\t\n\tif (l_ftyp_data == 00) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to handle ftyp data\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\tmemset(l_ftyp_data,0,l_ftyp_size);\n\n\tl_current_data_ptr = l_ftyp_data;\n\n\topj_write_bytes(l_current_data_ptr, l_ftyp_size,4); /* box size */\n\tl_current_data_ptr += 4;\n\n\topj_write_bytes(l_current_data_ptr, JP2_FTYP,4); /* FTYP */\n\tl_current_data_ptr += 4;\n\n\topj_write_bytes(l_current_data_ptr, jp2->brand,4); /* BR */\n\tl_current_data_ptr += 4;\n\n\topj_write_bytes(l_current_data_ptr, jp2->minversion,4); /* MinV */\n\tl_current_data_ptr += 4;\n\n\tfor (i = 0; i < jp2->numcl; i++)  {\n\t\topj_write_bytes(l_current_data_ptr, jp2->cl[i],4);\t/* CL */\n\t}\n\t\n\tl_result = (opj_stream_write_data(cio,l_ftyp_data,l_ftyp_size,p_manager) == l_ftyp_size);\n\tif (! l_result)\n\t{\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Error while writing ftyp data to stream\\n\");\n\t}\n\n\topj_free(l_ftyp_data);\n\t\n\treturn l_result;\n}\n\nOPJ_BOOL opj_jp2_write_jp2c(opj_jp2_t *jp2,\n\t\t\t\t\t\t\topj_stream_private_t *cio,\n\t\t\t\t\t\t\topj_event_mgr_t * p_manager )\n{\n\tOPJ_OFF_T j2k_codestream_exit;\n\tOPJ_BYTE l_data_header [8];\n\t\n\t/* preconditions */\n\tassert(jp2 != 00);\n\tassert(cio != 00);\n\tassert(p_manager != 00);\n\tassert(opj_stream_has_seek(cio));\n\t\n\tj2k_codestream_exit = opj_stream_tell(cio);\n\topj_write_bytes(l_data_header,\n                    (OPJ_UINT32) (j2k_codestream_exit - jp2->j2k_codestream_offset),\n                    4); /* size of codestream */\n\topj_write_bytes(l_data_header + 4,JP2_JP2C,4);\t\t\t\t\t\t\t\t\t   /* JP2C */\n\n\tif (! opj_stream_seek(cio,jp2->j2k_codestream_offset,p_manager)) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Failed to seek in the stream.\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\t\n\tif (opj_stream_write_data(cio,l_data_header,8,p_manager) != 8) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Failed to seek in the stream.\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\tif (! opj_stream_seek(cio,j2k_codestream_exit,p_manager)) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Failed to seek in the stream.\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\treturn OPJ_TRUE;\n}\n\nOPJ_BOOL opj_jp2_write_jp(\topj_jp2_t *jp2,\n\t\t\t    \t\t    opj_stream_private_t *cio,\n\t\t\t\t    \t\topj_event_mgr_t * p_manager )\n{\n\t/* 12 bytes will be read */\n\tOPJ_BYTE l_signature_data [12];\n\n\t/* preconditions */\n\tassert(cio != 00);\n\tassert(jp2 != 00);\n\tassert(p_manager != 00);\n\n\t/* write box length */\n\topj_write_bytes(l_signature_data,12,4);\n\t/* writes box type */\n\topj_write_bytes(l_signature_data+4,JP2_JP,4);\n\t/* writes magic number*/\n\topj_write_bytes(l_signature_data+8,0x0d0a870a,4);\n\t\n\tif (opj_stream_write_data(cio,l_signature_data,12,p_manager) != 12) {\n\t\treturn OPJ_FALSE;\n\t}\n\n\treturn OPJ_TRUE;\n}\n\n/* ----------------------------------------------------------------------- */\n/* JP2 decoder interface                                             */\n/* ----------------------------------------------------------------------- */\n\nvoid opj_jp2_setup_decoder(opj_jp2_t *jp2, opj_dparameters_t *parameters)\n{\n\t/* setup the J2K codec */\n\topj_j2k_setup_decoder(jp2->j2k, parameters);\n\n\t/* further JP2 initializations go here */\n\tjp2->color.jp2_has_colr = 0;\n    jp2->ignore_pclr_cmap_cdef = parameters->flags & OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG;\n}\n\n/* ----------------------------------------------------------------------- */\n/* JP2 encoder interface                                             */\n/* ----------------------------------------------------------------------- */\n\nvoid opj_jp2_setup_encoder(\topj_jp2_t *jp2,\n                            opj_cparameters_t *parameters,\n                            opj_image_t *image,\n                            opj_event_mgr_t * p_manager)\n{\n    OPJ_UINT32 i;\n\tOPJ_UINT32 depth_0;\n  OPJ_UINT32 sign;\n\n\tif(!jp2 || !parameters || !image)\n\t\treturn;\n\n\t/* setup the J2K codec */\n\t/* ------------------- */\n\n\t/* Check if number of components respects standard */\n\tif (image->numcomps < 1 || image->numcomps > 16384) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Invalid number of components specified while setting up JP2 encoder\\n\");\n\t\treturn;\n\t}\n\n\topj_j2k_setup_encoder(jp2->j2k, parameters, image, p_manager );\n\n\t/* setup the JP2 codec */\n\t/* ------------------- */\n\t\n\t/* Profile box */\n\n\tjp2->brand = JP2_JP2;\t/* BR */\n\tjp2->minversion = 0;\t/* MinV */\n\tjp2->numcl = 1;\n\tjp2->cl = (OPJ_UINT32*) opj_malloc(jp2->numcl * sizeof(OPJ_UINT32));\n    if (!jp2->cl){\n        jp2->cl = NULL;\n        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory when setup the JP2 encoder\\n\");\n        return;\n    }\n\tjp2->cl[0] = JP2_JP2;\t/* CL0 : JP2 */\n\n\t/* Image Header box */\n\n\tjp2->numcomps = image->numcomps;\t/* NC */\n\tjp2->comps = (opj_jp2_comps_t*) opj_malloc(jp2->numcomps * sizeof(opj_jp2_comps_t));\n    if (!jp2->comps) {\n        jp2->comps = NULL;\n        opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory when setup the JP2 encoder\\n\");\n        return;\n    }\n\n\tjp2->h = image->y1 - image->y0;\t\t/* HEIGHT */\n\tjp2->w = image->x1 - image->x0;\t\t/* WIDTH */\n\t/* BPC */\n\tdepth_0 = image->comps[0].prec - 1;\n\tsign = image->comps[0].sgnd;\n\tjp2->bpc = depth_0 + (sign << 7);\n\tfor (i = 1; i < image->numcomps; i++) {\n\t\tOPJ_UINT32 depth = image->comps[i].prec - 1;\n\t\tsign = image->comps[i].sgnd;\n\t\tif (depth_0 != depth)\n\t\t\tjp2->bpc = 255;\n\t}\n\tjp2->C = 7;\t\t\t/* C : Always 7 */\n\tjp2->UnkC = 0;\t\t/* UnkC, colorspace specified in colr box */\n\tjp2->IPR = 0;\t\t/* IPR, no intellectual property */\n\t\n\t/* BitsPerComponent box */\n\tfor (i = 0; i < image->numcomps; i++) {\n\t\tjp2->comps[i].bpcc = image->comps[i].prec - 1 + (image->comps[i].sgnd << 7);\n\t}\n\n\t/* Colour Specification box */\n    if(image->icc_profile_len) {\n        jp2->meth = 2;\n        jp2->enumcs = 0;\n    } \n    else {\n        jp2->meth = 1;\n        if (image->color_space == 1)\n            jp2->enumcs = 16;\t/* sRGB as defined by IEC 61966-2-1 */\n        else if (image->color_space == 2)\n            jp2->enumcs = 17;\t/* greyscale */\n        else if (image->color_space == 3)\n            jp2->enumcs = 18;\t/* YUV */\n    }\n\n\n\tjp2->precedence = 0;\t/* PRECEDENCE */\n\tjp2->approx = 0;\t\t/* APPROX */\n\n\tjp2->jpip_on = parameters->jpip_on;\n}\n\nOPJ_BOOL opj_jp2_encode(opj_jp2_t *jp2,\n\t\t\t\t\t\topj_stream_private_t *stream,\n\t\t\t\t\t\topj_event_mgr_t * p_manager)\n{\n\treturn opj_j2k_encode(jp2->j2k, stream, p_manager);\n}\n\nOPJ_BOOL opj_jp2_end_decompress(opj_jp2_t *jp2,\n                                opj_stream_private_t *cio,\n                                opj_event_mgr_t * p_manager\n                                )\n{\n\t/* preconditions */\n\tassert(jp2 != 00);\n\tassert(cio != 00);\n\tassert(p_manager != 00);\n\n\t/* customization of the end encoding */\n\topj_jp2_setup_end_header_reading(jp2);\n\n\t/* write header */\n\tif (! opj_jp2_exec (jp2,jp2->m_procedure_list,cio,p_manager)) {\n\t\treturn OPJ_FALSE;\n\t}\n\n\treturn opj_j2k_end_decompress(jp2->j2k, cio, p_manager);\n}\n\nOPJ_BOOL opj_jp2_end_compress(\topj_jp2_t *jp2,\n\t\t\t\t\t\t\t    opj_stream_private_t *cio,\n\t\t\t\t\t\t\t    opj_event_mgr_t * p_manager\n                                )\n{\n\t/* preconditions */\n\tassert(jp2 != 00);\n\tassert(cio != 00);\n\tassert(p_manager != 00);\n\n\t/* customization of the end encoding */\n\topj_jp2_setup_end_header_writing(jp2);\n\n\tif (! opj_j2k_end_compress(jp2->j2k,cio,p_manager)) {\n\t\treturn OPJ_FALSE;\n\t}\n\n\t/* write header */\n\treturn opj_jp2_exec(jp2,jp2->m_procedure_list,cio,p_manager);\n}\n\nvoid opj_jp2_setup_end_header_writing (opj_jp2_t *jp2)\n{\n\t/* preconditions */\n\tassert(jp2 != 00);\n\n#ifdef USE_JPIP\n  if( jp2->jpip_on )\n    opj_procedure_list_add_procedure(jp2->m_procedure_list,(opj_procedure)opj_jpip_write_iptr );\n#endif\n\topj_procedure_list_add_procedure(jp2->m_procedure_list,(opj_procedure)opj_jp2_write_jp2c );\n\t/* DEVELOPER CORNER, add your custom procedures */\n#ifdef USE_JPIP\n  if( jp2->jpip_on )\n    {\n    opj_procedure_list_add_procedure(jp2->m_procedure_list,(opj_procedure)opj_jpip_write_cidx );\n    opj_procedure_list_add_procedure(jp2->m_procedure_list,(opj_procedure)opj_jpip_write_fidx );\n    }\n#endif\n}\n\nvoid opj_jp2_setup_end_header_reading (opj_jp2_t *jp2)\n{\n\t/* preconditions */\n\tassert(jp2 != 00);\n\topj_procedure_list_add_procedure(jp2->m_procedure_list,(opj_procedure)opj_jp2_read_header_procedure );\n\t/* DEVELOPER CORNER, add your custom procedures */\n}\n\nOPJ_BOOL opj_jp2_default_validation (\topj_jp2_t * jp2,\n                                        opj_stream_private_t *cio,\n                                        opj_event_mgr_t * p_manager\n                                        )\n{\n\tOPJ_BOOL l_is_valid = OPJ_TRUE;\n\tOPJ_UINT32 i;\n\n\t/* preconditions */\n\tassert(jp2 != 00);\n\tassert(cio != 00);\n\tassert(p_manager != 00);\n\n\t/* JPEG2000 codec validation */\n\n\t/* STATE checking */\n\t/* make sure the state is at 0 */\n\tl_is_valid &= (jp2->jp2_state == JP2_STATE_NONE);\n\n\t/* make sure not reading a jp2h ???? WEIRD */\n\tl_is_valid &= (jp2->jp2_img_state == JP2_IMG_STATE_NONE);\n\n\t/* POINTER validation */\n\t/* make sure a j2k codec is present */\n\tl_is_valid &= (jp2->j2k != 00);\n\n\t/* make sure a procedure list is present */\n\tl_is_valid &= (jp2->m_procedure_list != 00);\n\n\t/* make sure a validation list is present */\n\tl_is_valid &= (jp2->m_validation_list != 00);\n\n\t/* PARAMETER VALIDATION */\n\t/* number of components */\n\tl_is_valid &= (jp2->numcl > 0);\n\t/* width */\n\tl_is_valid &= (jp2->h > 0);\n\t/* height */\n\tl_is_valid &= (jp2->w > 0);\n\t/* precision */\n\tfor (i = 0; i < jp2->numcomps; ++i)\t{\n\t\tl_is_valid &= (jp2->comps[i].bpcc > 0);\n\t}\n\n\t/* METH */\n\tl_is_valid &= ((jp2->meth > 0) && (jp2->meth < 3));\n\n\t/* stream validation */\n\t/* back and forth is needed */\n\tl_is_valid &= opj_stream_has_seek(cio);\n\n\treturn l_is_valid;\n}\n\nOPJ_BOOL opj_jp2_read_header_procedure(  opj_jp2_t *jp2,\n                                                opj_stream_private_t *stream,\n                                                opj_event_mgr_t * p_manager\n                                                )\n{\n\topj_jp2_box_t box;\n\tOPJ_UINT32 l_nb_bytes_read;\n\tconst opj_jp2_header_handler_t * l_current_handler;\n\tOPJ_UINT32 l_last_data_size = OPJ_BOX_SIZE;\n\tOPJ_UINT32 l_current_data_size;\n\tOPJ_BYTE * l_current_data = 00;\n\n\t/* preconditions */\n\tassert(stream != 00);\n\tassert(jp2 != 00);\n\tassert(p_manager != 00);\n\n\tl_current_data = (OPJ_BYTE*)opj_malloc(l_last_data_size);\n\n\tif (l_current_data == 00) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to handle jpeg2000 file header\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\tmemset(l_current_data, 0 , l_last_data_size);\n\n\twhile (opj_jp2_read_boxhdr(&box,&l_nb_bytes_read,stream,p_manager)) {\n\t\t/* is it the codestream box ? */\n\t\tif (box.type == JP2_JP2C) {\n\t\t\tif (jp2->jp2_state & JP2_STATE_HEADER) {\n\t\t\t\tjp2->jp2_state |= JP2_STATE_CODESTREAM;\n                                opj_free(l_current_data);\n\t\t\t\treturn OPJ_TRUE;\n\t\t\t}\n\t\t\telse {\n\t\t\t\topj_event_msg(p_manager, EVT_ERROR, \"bad placed jpeg codestream\\n\");\n\t\t\t\topj_free(l_current_data);\n\t\t\t\treturn OPJ_FALSE;\n\t\t\t}\n\t\t}\n\t\telse if\t(box.length == 0) {\n\t\t\topj_event_msg(p_manager, EVT_ERROR, \"Cannot handle box of undefined sizes\\n\");\n\t\t\topj_free(l_current_data);\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\t\t/* testcase 1851.pdf.SIGSEGV.ce9.948 */\n\t\telse if\t(box.length < l_nb_bytes_read) {\n\t\t\topj_event_msg(p_manager, EVT_ERROR, \"invalid box size %d (%x)\\n\", box.length, box.type);\n\t\t\topj_free(l_current_data);\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\n\t\tl_current_handler = opj_jp2_find_handler(box.type);\n\t\tl_current_data_size = box.length - l_nb_bytes_read;\n\n\t\tif (l_current_handler != 00) {\n\t\t\tif (l_current_data_size > l_last_data_size) {\n\t\t\t\tOPJ_BYTE* new_current_data = (OPJ_BYTE*)opj_realloc(l_current_data,l_current_data_size);\n\t\t\t\tif (!new_current_data) {\n\t\t\t\t\topj_free(l_current_data);\n                    opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to handle jpeg2000 box\\n\");\n\t\t\t\t\treturn OPJ_FALSE;\n\t\t\t\t}\n                l_current_data = new_current_data;\n\t\t\t\tl_last_data_size = l_current_data_size;\n\t\t\t}\n\n\t\t\tl_nb_bytes_read = (OPJ_UINT32)opj_stream_read_data(stream,l_current_data,l_current_data_size,p_manager);\n\t\t\tif (l_nb_bytes_read != l_current_data_size) {\n\t\t\t\topj_event_msg(p_manager, EVT_ERROR, \"Problem with reading JPEG2000 box, stream error\\n\");\n                opj_free(l_current_data);                \n\t\t\t\treturn OPJ_FALSE;\n\t\t\t}\n\n\t\t\tif (! l_current_handler->handler(jp2,l_current_data,l_current_data_size,p_manager)) {\n\t\t\t\topj_free(l_current_data);\n\t\t\t\treturn OPJ_FALSE;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tjp2->jp2_state |= JP2_STATE_UNKNOWN;\n\t\t\tif (opj_stream_skip(stream,l_current_data_size,p_manager) != l_current_data_size) {\n\t\t\t\topj_event_msg(p_manager, EVT_ERROR, \"Problem with skipping JPEG2000 box, stream error\\n\");\n\t\t\t\topj_free(l_current_data);\n\t\t\t\treturn OPJ_FALSE;\n\t\t\t}\n\t\t}\n\t}\n\n\topj_free(l_current_data);\n\n\treturn OPJ_TRUE;\n}\n\n/**\n * Excutes the given procedures on the given codec.\n *\n * @param\tp_procedure_list\tthe list of procedures to execute\n * @param\tjp2\t\t\t\t\tthe jpeg2000 file codec to execute the procedures on.\n * @param\tstream\t\t\t\t\tthe stream to execute the procedures on.\n * @param\tp_manager\t\t\tthe user manager.\n *\n * @return\ttrue\t\t\t\tif all the procedures were successfully executed.\n */\nstatic OPJ_BOOL opj_jp2_exec (  opj_jp2_t * jp2,\n                                opj_procedure_list_t * p_procedure_list,\n                                opj_stream_private_t *stream,\n                                opj_event_mgr_t * p_manager\n                                )\n\n{\n\tOPJ_BOOL (** l_procedure) (opj_jp2_t * jp2, opj_stream_private_t *, opj_event_mgr_t *) = 00;\n\tOPJ_BOOL l_result = OPJ_TRUE;\n\tOPJ_UINT32 l_nb_proc, i;\n\n\t/* preconditions */\n\tassert(p_procedure_list != 00);\n\tassert(jp2 != 00);\n\tassert(stream != 00);\n\tassert(p_manager != 00);\n\n\tl_nb_proc = opj_procedure_list_get_nb_procedures(p_procedure_list);\n\tl_procedure = (OPJ_BOOL (**) (opj_jp2_t * jp2, opj_stream_private_t *, opj_event_mgr_t *)) opj_procedure_list_get_first_procedure(p_procedure_list);\n\n\tfor\t(i=0;i<l_nb_proc;++i) {\n\t\tl_result = l_result && (*l_procedure) (jp2,stream,p_manager);\n\t\t++l_procedure;\n\t}\n\n\t/* and clear the procedure list at the end. */\n\topj_procedure_list_clear(p_procedure_list);\n\treturn l_result;\n}\n\nOPJ_BOOL opj_jp2_start_compress(opj_jp2_t *jp2,\n                                opj_stream_private_t *stream,\n                                opj_image_t * p_image,\n                                opj_event_mgr_t * p_manager\n                                )\n{\n\t/* preconditions */\n\tassert(jp2 != 00);\n\tassert(stream != 00);\n\tassert(p_manager != 00);\n\n\t/* customization of the validation */\n\topj_jp2_setup_encoding_validation (jp2);\n\n\t/* validation of the parameters codec */\n\tif (! opj_jp2_exec(jp2,jp2->m_validation_list,stream,p_manager)) {\n\t\treturn OPJ_FALSE;\n\t}\n\n\t/* customization of the encoding */\n\topj_jp2_setup_header_writing(jp2);\n\n\t/* write header */\n\tif (! opj_jp2_exec (jp2,jp2->m_procedure_list,stream,p_manager)) {\n\t\treturn OPJ_FALSE;\n\t}\n\n\treturn opj_j2k_start_compress(jp2->j2k,stream,p_image,p_manager);\n}\n\nconst opj_jp2_header_handler_t * opj_jp2_find_handler (OPJ_UINT32 p_id)\n{\n\tOPJ_UINT32 i, l_handler_size = sizeof(jp2_header) / sizeof(opj_jp2_header_handler_t);\n\n\tfor (i=0;i<l_handler_size;++i) {\n\t\tif (jp2_header[i].id == p_id) {\n\t\t\treturn &jp2_header[i];\n\t\t}\n\t}\n\treturn NULL;\n}\n\n/**\n * Finds the image execution function related to the given box id.\n *\n * @param\tp_id\tthe id of the handler to fetch.\n *\n * @return\tthe given handler or 00 if it could not be found.\n */\nstatic const opj_jp2_header_handler_t * opj_jp2_img_find_handler (OPJ_UINT32 p_id)\n{\n\tOPJ_UINT32 i, l_handler_size = sizeof(jp2_img_header) / sizeof(opj_jp2_header_handler_t);\n\tfor (i=0;i<l_handler_size;++i)\n\t{\n\t\tif (jp2_img_header[i].id == p_id) {\n\t\t\treturn &jp2_img_header[i];\n\t\t}\n\t}\n\n\treturn NULL;\n}\n\n/**\n * Reads a jpeg2000 file signature box.\n *\n * @param\tp_header_data\tthe data contained in the signature box.\n * @param\tjp2\t\t\t\tthe jpeg2000 file codec.\n * @param\tp_header_size\tthe size of the data contained in the signature box.\n * @param\tp_manager\t\tthe user event manager.\n *\n * @return true if the file signature box is valid.\n */\nstatic OPJ_BOOL opj_jp2_read_jp(opj_jp2_t *jp2,\n                                OPJ_BYTE * p_header_data,\n                                OPJ_UINT32 p_header_size,\n                                opj_event_mgr_t * p_manager\n                                )\n\n{\n\tOPJ_UINT32 l_magic_number;\n\n\t/* preconditions */\n\tassert(p_header_data != 00);\n\tassert(jp2 != 00);\n\tassert(p_manager != 00);\n\n\tif (jp2->jp2_state != JP2_STATE_NONE) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"The signature box must be the first box in the file.\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\t/* assure length of data is correct (4 -> magic number) */\n\tif (p_header_size != 4) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Error with JP signature Box size\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\t/* rearrange data */\n\topj_read_bytes(p_header_data,&l_magic_number,4);\n\tif (l_magic_number != 0x0d0a870a ) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Error with JP Signature : bad magic number\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\tjp2->jp2_state |= JP2_STATE_SIGNATURE;\n\n\treturn OPJ_TRUE;\n}\n\n/**\n * Reads a a FTYP box - File type box\n *\n * @param\tp_header_data\tthe data contained in the FTYP box.\n * @param\tjp2\t\t\t\tthe jpeg2000 file codec.\n * @param\tp_header_size\tthe size of the data contained in the FTYP box.\n * @param\tp_manager\t\tthe user event manager.\n *\n * @return true if the FTYP box is valid.\n */\nstatic OPJ_BOOL opj_jp2_read_ftyp(\topj_jp2_t *jp2,\n\t\t\t\t\t\t\t\t\tOPJ_BYTE * p_header_data,\n\t\t\t\t\t\t\t\t\tOPJ_UINT32 p_header_size,\n\t\t\t\t\t\t\t\t\topj_event_mgr_t * p_manager\n                                    )\n{\n\tOPJ_UINT32 i, l_remaining_bytes;\n\n\t/* preconditions */\n\tassert(p_header_data != 00);\n\tassert(jp2 != 00);\n\tassert(p_manager != 00);\n\n\tif (jp2->jp2_state != JP2_STATE_SIGNATURE) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"The ftyp box must be the second box in the file.\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\t/* assure length of data is correct */\n\tif (p_header_size < 8) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Error with FTYP signature Box size\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\topj_read_bytes(p_header_data,&jp2->brand,4);\t\t/* BR */\n\tp_header_data += 4;\n\n\topj_read_bytes(p_header_data,&jp2->minversion,4);\t\t/* MinV */\n\tp_header_data += 4;\n\n\tl_remaining_bytes = p_header_size - 8;\n\n\t/* the number of remaining bytes should be a multiple of 4 */\n\tif ((l_remaining_bytes & 0x3) != 0) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Error with FTYP signature Box size\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\t/* div by 4 */\n\tjp2->numcl = l_remaining_bytes >> 2;\n\tif (jp2->numcl) {\n\t\tjp2->cl = (OPJ_UINT32 *) opj_malloc(jp2->numcl * sizeof(OPJ_UINT32));\n\t\tif (jp2->cl == 00) {\n\t\t\topj_event_msg(p_manager, EVT_ERROR, \"Not enough memory with FTYP Box\\n\");\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\t\tmemset(jp2->cl,0,jp2->numcl * sizeof(OPJ_UINT32));\n\t}\n\n\tfor (i = 0; i < jp2->numcl; ++i)\n\t{\n\t\topj_read_bytes(p_header_data,&jp2->cl[i],4);\t\t/* CLi */\n\t\tp_header_data += 4;\n\t}\n\n\tjp2->jp2_state |= JP2_STATE_FILE_TYPE;\n\n\treturn OPJ_TRUE;\n}\n\nOPJ_BOOL opj_jp2_skip_jp2c(\topj_jp2_t *jp2,\n\t\t\t\t\t    \topj_stream_private_t *stream,\n\t\t\t\t\t    \topj_event_mgr_t * p_manager )\n{\n\t/* preconditions */\n\tassert(jp2 != 00);\n\tassert(stream != 00);\n\tassert(p_manager != 00);\n\n\tjp2->j2k_codestream_offset = opj_stream_tell(stream);\n\n\tif (opj_stream_skip(stream,8,p_manager) != 8) {\n\t\treturn OPJ_FALSE;\n\t}\n\n\treturn OPJ_TRUE;\n}\n\nstatic OPJ_BOOL opj_jpip_skip_iptr(\topj_jp2_t *jp2,\n  opj_stream_private_t *stream,\n  opj_event_mgr_t * p_manager )\n{\n  /* preconditions */\n  assert(jp2 != 00);\n  assert(stream != 00);\n  assert(p_manager != 00);\n\n  jp2->jpip_iptr_offset = opj_stream_tell(stream);\n\n  if (opj_stream_skip(stream,24,p_manager) != 24) {\n    return OPJ_FALSE;\n  }\n\n  return OPJ_TRUE;\n}\n\n/**\n * Reads the Jpeg2000 file Header box - JP2 Header box (warning, this is a super box).\n *\n * @param\tp_header_data\tthe data contained in the file header box.\n * @param\tjp2\t\t\t\tthe jpeg2000 file codec.\n * @param\tp_header_size\tthe size of the data contained in the file header box.\n * @param\tp_manager\t\tthe user event manager.\n *\n * @return true if the JP2 Header box was successfully reconized.\n*/\nstatic OPJ_BOOL opj_jp2_read_jp2h(  opj_jp2_t *jp2,\n                                    OPJ_BYTE *p_header_data,\n                                    OPJ_UINT32 p_header_size,\n                                    opj_event_mgr_t * p_manager\n                                    )\n{\n\tOPJ_UINT32 l_box_size=0, l_current_data_size = 0;\n\topj_jp2_box_t box;\n\tconst opj_jp2_header_handler_t * l_current_handler;\n\n\t/* preconditions */\n\tassert(p_header_data != 00);\n\tassert(jp2 != 00);\n\tassert(p_manager != 00);\n\n\t/* make sure the box is well placed */\n\tif ((jp2->jp2_state & JP2_STATE_FILE_TYPE) != JP2_STATE_FILE_TYPE ) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"The  box must be the first box in the file.\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\tjp2->jp2_img_state = JP2_IMG_STATE_NONE;\n\n\t/* iterate while remaining data */\n\twhile (p_header_size > 0) {\n\n\t\tif (! opj_jp2_read_boxhdr_char(&box,p_header_data,&l_box_size,p_header_size, p_manager)) {\n\t\t\topj_event_msg(p_manager, EVT_ERROR, \"Stream error while reading JP2 Header box\\n\");\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\n\t\tif (box.length > p_header_size) {\n\t\t\topj_event_msg(p_manager, EVT_ERROR, \"Stream error while reading JP2 Header box: box length is inconsistent.\\n\");\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\n\t\tl_current_handler = opj_jp2_img_find_handler(box.type);\n\t\tl_current_data_size = box.length - l_box_size;\n\t\tp_header_data += l_box_size;\n\n\t\tif (l_current_handler != 00) {\n\t\t\tif (! l_current_handler->handler(jp2,p_header_data,l_current_data_size,p_manager)) {\n\t\t\t\treturn OPJ_FALSE;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tjp2->jp2_img_state |= JP2_IMG_STATE_UNKNOWN;\n\t\t}\n\n\t\tp_header_data += l_current_data_size;\n\t\tp_header_size -= box.length;\n\t}\n\n\tjp2->jp2_state |= JP2_STATE_HEADER;\n\n\treturn OPJ_TRUE;\n}\n\nOPJ_BOOL opj_jp2_read_boxhdr_char(   opj_jp2_box_t *box,\n                                     OPJ_BYTE * p_data,\n                                     OPJ_UINT32 * p_number_bytes_read,\n                                     OPJ_UINT32 p_box_max_size,\n                                     opj_event_mgr_t * p_manager\n                                     )\n{\n\tOPJ_UINT32 l_value;\n\n\t/* preconditions */\n\tassert(p_data != 00);\n\tassert(box != 00);\n\tassert(p_number_bytes_read != 00);\n\tassert(p_manager != 00);\n\n\tif (p_box_max_size < 8) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Cannot handle box of less than 8 bytes\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\t/* process read data */\n\topj_read_bytes(p_data, &l_value, 4);\n\tp_data += 4;\n\tbox->length = (OPJ_UINT32)(l_value);\n\n\topj_read_bytes(p_data, &l_value, 4);\n\tp_data += 4;\n\tbox->type = (OPJ_UINT32)(l_value);\n\n\t*p_number_bytes_read = 8;\n\n\t/* do we have a \"special very large box ?\" */\n\t/* read then the XLBox */\n\tif (box->length == 1) {\n\t\tOPJ_UINT32 l_xl_part_size;\n\n\t\tif (p_box_max_size < 16) {\n\t\t\topj_event_msg(p_manager, EVT_ERROR, \"Cannot handle XL box of less than 16 bytes\\n\");\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\n\t\topj_read_bytes(p_data,&l_xl_part_size, 4);\n\t\tp_data += 4;\n\t\t*p_number_bytes_read += 4;\n\n\t\tif (l_xl_part_size != 0) {\n\t\t\topj_event_msg(p_manager, EVT_ERROR, \"Cannot handle box sizes higher than 2^32\\n\");\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\n\t\topj_read_bytes(p_data, &l_value, 4);\n\t\t*p_number_bytes_read += 4;\n\t\tbox->length = (OPJ_UINT32)(l_value);\n\n\t\tif (box->length == 0) {\n\t\t\topj_event_msg(p_manager, EVT_ERROR, \"Cannot handle box of undefined sizes\\n\");\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\t}\n\telse if (box->length == 0) {\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Cannot handle box of undefined sizes\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\treturn OPJ_TRUE;\n}\n\nOPJ_BOOL opj_jp2_read_header(\topj_stream_private_t *p_stream,\n                                opj_jp2_t *jp2,\n                                opj_image_t ** p_image,\n                                opj_event_mgr_t * p_manager\n                                )\n{\n\t/* preconditions */\n\tassert(jp2 != 00);\n\tassert(p_stream != 00);\n\tassert(p_manager != 00);\n\n\t/* customization of the validation */\n\topj_jp2_setup_decoding_validation (jp2);\n\n\t/* customization of the encoding */\n\topj_jp2_setup_header_reading(jp2);\n\n\t/* validation of the parameters codec */\n\tif (! opj_jp2_exec(jp2,jp2->m_validation_list,p_stream,p_manager)) {\n\t\treturn OPJ_FALSE;\n\t}\n\n\t/* read header */\n\tif (! opj_jp2_exec (jp2,jp2->m_procedure_list,p_stream,p_manager)) {\n\t\treturn OPJ_FALSE;\n\t}\n\n\treturn opj_j2k_read_header(\tp_stream,\n\t\t\t\t\t\t\tjp2->j2k,\n\t\t\t\t\t\t\tp_image,\n\t\t\t\t\t\t\tp_manager);\n}\n\nvoid opj_jp2_setup_encoding_validation (opj_jp2_t *jp2)\n{\n\t/* preconditions */\n\tassert(jp2 != 00);\n\n\topj_procedure_list_add_procedure(jp2->m_validation_list, (opj_procedure)opj_jp2_default_validation);\n\t/* DEVELOPER CORNER, add your custom validation procedure */\n}\n\nvoid opj_jp2_setup_decoding_validation (opj_jp2_t *jp2)\n{\n\t/* preconditions */\n\tassert(jp2 != 00);\n\t/* DEVELOPER CORNER, add your custom validation procedure */\n}\n\nvoid opj_jp2_setup_header_writing (opj_jp2_t *jp2)\n{\n\t/* preconditions */\n\tassert(jp2 != 00);\n\n\topj_procedure_list_add_procedure(jp2->m_procedure_list,(opj_procedure)opj_jp2_write_jp );\n\topj_procedure_list_add_procedure(jp2->m_procedure_list,(opj_procedure)opj_jp2_write_ftyp );\n\topj_procedure_list_add_procedure(jp2->m_procedure_list,(opj_procedure)opj_jp2_write_jp2h );\n  if( jp2->jpip_on )\n    opj_procedure_list_add_procedure(jp2->m_procedure_list,(opj_procedure)opj_jpip_skip_iptr );\n\topj_procedure_list_add_procedure(jp2->m_procedure_list,(opj_procedure)opj_jp2_skip_jp2c );\n\n\t/* DEVELOPER CORNER, insert your custom procedures */\n\n}\n\nvoid opj_jp2_setup_header_reading (opj_jp2_t *jp2)\n{\n\t/* preconditions */\n\tassert(jp2 != 00);\n\n\topj_procedure_list_add_procedure(jp2->m_procedure_list,(opj_procedure)opj_jp2_read_header_procedure );\n\t/* DEVELOPER CORNER, add your custom procedures */\n}\n\nOPJ_BOOL opj_jp2_read_tile_header ( opj_jp2_t * p_jp2,\n                                    OPJ_UINT32 * p_tile_index,\n                                    OPJ_UINT32 * p_data_size,\n                                    OPJ_INT32 * p_tile_x0,\n                                    OPJ_INT32 * p_tile_y0,\n                                    OPJ_INT32 * p_tile_x1,\n                                    OPJ_INT32 * p_tile_y1,\n                                    OPJ_UINT32 * p_nb_comps,\n                                    OPJ_BOOL * p_go_on,\n                                    opj_stream_private_t *p_stream,\n                                    opj_event_mgr_t * p_manager\n                                    )\n{\n\treturn opj_j2k_read_tile_header(p_jp2->j2k,\n\t\t\t\t\t\t\t\tp_tile_index,\n\t\t\t\t\t\t\t\tp_data_size,\n\t\t\t\t\t\t\t\tp_tile_x0, p_tile_y0,\n\t\t\t\t\t\t\t\tp_tile_x1, p_tile_y1,\n\t\t\t\t\t\t\t\tp_nb_comps,\n\t\t\t\t\t\t\t\tp_go_on,\n\t\t\t\t\t\t\t\tp_stream,\n\t\t\t\t\t\t\t\tp_manager);\n}\n\nOPJ_BOOL opj_jp2_write_tile (\topj_jp2_t *p_jp2,\n\t\t\t\t\t \t \t    OPJ_UINT32 p_tile_index,\n\t\t\t\t\t \t \t    OPJ_BYTE * p_data,\n\t\t\t\t\t \t \t    OPJ_UINT32 p_data_size,\n\t\t\t\t\t \t \t    opj_stream_private_t *p_stream,\n\t\t\t\t\t \t \t    opj_event_mgr_t * p_manager\n                                )\n\n{\n\treturn opj_j2k_write_tile (p_jp2->j2k,p_tile_index,p_data,p_data_size,p_stream,p_manager);\n}\n\nOPJ_BOOL opj_jp2_decode_tile (  opj_jp2_t * p_jp2,\n                                OPJ_UINT32 p_tile_index,\n                                OPJ_BYTE * p_data,\n                                OPJ_UINT32 p_data_size,\n                                opj_stream_private_t *p_stream,\n                                opj_event_mgr_t * p_manager\n                                )\n{\n\treturn opj_j2k_decode_tile (p_jp2->j2k,p_tile_index,p_data,p_data_size,p_stream,p_manager);\n}\n\nvoid opj_jp2_destroy(opj_jp2_t *jp2)\n{\n\tif (jp2) {\n\t\t/* destroy the J2K codec */\n\t\topj_j2k_destroy(jp2->j2k);\n\t\tjp2->j2k = 00;\n\n\t\tif (jp2->comps) {\n\t\t\topj_free(jp2->comps);\n\t\t\tjp2->comps = 00;\n\t\t}\n\n\t\tif (jp2->cl) {\n\t\t\topj_free(jp2->cl);\n\t\t\tjp2->cl = 00;\n\t\t}\n\n\t\tif (jp2->color.icc_profile_buf) {\n\t\t\topj_free(jp2->color.icc_profile_buf);\n\t\t\tjp2->color.icc_profile_buf = 00;\n\t\t}\n\n\t\tif (jp2->color.jp2_cdef) {\n\t\t\tif (jp2->color.jp2_cdef->info) {\n\t\t\t\topj_free(jp2->color.jp2_cdef->info);\n\t\t\t\tjp2->color.jp2_cdef->info = NULL;\n\t\t\t}\n\n\t\t\topj_free(jp2->color.jp2_cdef);\n\t\t\tjp2->color.jp2_cdef = 00;\n\t\t}\n\n\t\tif (jp2->color.jp2_pclr) {\n\t\t\tif (jp2->color.jp2_pclr->cmap) {\n\t\t\t\topj_free(jp2->color.jp2_pclr->cmap);\n\t\t\t\tjp2->color.jp2_pclr->cmap = NULL;\n\t\t\t}\n\t\t\tif (jp2->color.jp2_pclr->channel_sign) {\n\t\t\t\topj_free(jp2->color.jp2_pclr->channel_sign);\n\t\t\t\tjp2->color.jp2_pclr->channel_sign = NULL;\n\t\t\t}\n\t\t\tif (jp2->color.jp2_pclr->channel_size) {\n\t\t\t\topj_free(jp2->color.jp2_pclr->channel_size);\n\t\t\t\tjp2->color.jp2_pclr->channel_size = NULL;\n\t\t\t}\n\t\t\tif (jp2->color.jp2_pclr->entries) {\n\t\t\t\topj_free(jp2->color.jp2_pclr->entries);\n\t\t\t\tjp2->color.jp2_pclr->entries = NULL;\n\t\t\t}\n\n\t\t\topj_free(jp2->color.jp2_pclr);\n\t\t\tjp2->color.jp2_pclr = 00;\n\t\t}\n\n\t\tif (jp2->m_validation_list) {\n\t\t\topj_procedure_list_destroy(jp2->m_validation_list);\n\t\t\tjp2->m_validation_list = 00;\n\t\t}\n\n\t\tif (jp2->m_procedure_list) {\n\t\t\topj_procedure_list_destroy(jp2->m_procedure_list);\n\t\t\tjp2->m_procedure_list = 00;\n\t\t}\n\n\t\topj_free(jp2);\n\t}\n}\n\nOPJ_BOOL opj_jp2_set_decode_area(\topj_jp2_t *p_jp2,\n\t\t\t\t\t\t\t\t    opj_image_t* p_image,\n\t\t\t\t\t\t\t\t    OPJ_INT32 p_start_x, OPJ_INT32 p_start_y,\n\t\t\t\t\t\t\t\t    OPJ_INT32 p_end_x, OPJ_INT32 p_end_y,\n\t\t\t\t\t\t\t\t    opj_event_mgr_t * p_manager\n                                    )\n{\n\treturn opj_j2k_set_decode_area(p_jp2->j2k, p_image, p_start_x, p_start_y, p_end_x, p_end_y, p_manager);\n}\n\nOPJ_BOOL opj_jp2_get_tile(\topj_jp2_t *p_jp2,\n                            opj_stream_private_t *p_stream,\n                            opj_image_t* p_image,\n                            opj_event_mgr_t * p_manager,\n                            OPJ_UINT32 tile_index\n                            )\n{\n\tif (!p_image)\n\t\treturn OPJ_FALSE;\n\n\topj_event_msg(p_manager, EVT_WARNING, \"JP2 box which are after the codestream will not be read by this function.\\n\");\n\n\tif (! opj_j2k_get_tile(p_jp2->j2k, p_stream, p_image, p_manager, tile_index) ){\n\t\topj_event_msg(p_manager, EVT_ERROR, \"Failed to decode the codestream in the JP2 file\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\tif (!opj_jp2_check_color(p_image, &(p_jp2->color), p_manager)) {\n\t\treturn OPJ_FALSE;\n\t}\n\n\t/* Set Image Color Space */\n\tif (p_jp2->enumcs == 16)\n\t\tp_image->color_space = OPJ_CLRSPC_SRGB;\n\telse if (p_jp2->enumcs == 17)\n\t\tp_image->color_space = OPJ_CLRSPC_GRAY;\n\telse if (p_jp2->enumcs == 18)\n\t\tp_image->color_space = OPJ_CLRSPC_SYCC;\n\telse\n\t\tp_image->color_space = OPJ_CLRSPC_UNKNOWN;\n\n\t/* Apply the color space if needed */\n\tif(p_jp2->color.jp2_cdef) {\n\t\topj_jp2_apply_cdef(p_image, &(p_jp2->color));\n\t}\n\n\tif(p_jp2->color.jp2_pclr) {\n\t\t/* Part 1, I.5.3.4: Either both or none : */\n\t\tif( !p_jp2->color.jp2_pclr->cmap)\n\t\t\topj_jp2_free_pclr(&(p_jp2->color));\n\t\telse\n\t\t\topj_jp2_apply_pclr(p_image, &(p_jp2->color));\n\t}\n\n\tif(p_jp2->color.icc_profile_buf) {\n\t\tp_image->icc_profile_buf = p_jp2->color.icc_profile_buf;\n\t\tp_image->icc_profile_len = p_jp2->color.icc_profile_len;\n\t\tp_jp2->color.icc_profile_buf = NULL;\n\t}\n\n\treturn OPJ_TRUE;\n}\n\n/* ----------------------------------------------------------------------- */\n/* JP2 encoder interface                                             */\n/* ----------------------------------------------------------------------- */\n\nopj_jp2_t* opj_jp2_create(OPJ_BOOL p_is_decoder)\n{\n\topj_jp2_t *jp2 = (opj_jp2_t*)opj_malloc(sizeof(opj_jp2_t));\n\tif (jp2) {\n\t\tmemset(jp2,0,sizeof(opj_jp2_t));\n\n\t\t/* create the J2K codec */\n\t\tif (! p_is_decoder) {\n\t\t\tjp2->j2k = opj_j2k_create_compress();\n\t\t}\n\t\telse {\n\t\t\tjp2->j2k = opj_j2k_create_decompress();\n\t\t}\n\n\t\tif (jp2->j2k == 00) {\n\t\t\topj_jp2_destroy(jp2);\n\t\t\treturn 00;\n\t\t}\n\n\t\t/* Color structure */\n\t\tjp2->color.icc_profile_buf = NULL;\n\t\tjp2->color.icc_profile_len = 0;\n\t\tjp2->color.jp2_cdef = NULL;\n\t\tjp2->color.jp2_pclr = NULL;\n\t\tjp2->color.jp2_has_colr = 0;\n\n\t\t/* validation list creation */\n\t\tjp2->m_validation_list = opj_procedure_list_create();\n\t\tif (! jp2->m_validation_list) {\n\t\t\topj_jp2_destroy(jp2);\n\t\t\treturn 00;\n\t\t}\n\n\t\t/* execution list creation */\n\t\tjp2->m_procedure_list = opj_procedure_list_create();\n\t\tif (! jp2->m_procedure_list) {\n\t\t\topj_jp2_destroy(jp2);\n\t\t\treturn 00;\n\t\t}\n\t}\n\n\treturn jp2;\n}\n\nvoid jp2_dump(opj_jp2_t* p_jp2, OPJ_INT32 flag, FILE* out_stream)\n{\n\t/* preconditions */\n\tassert(p_jp2 != 00);\n\n\tj2k_dump(p_jp2->j2k,\n\t\t\t\t\tflag,\n\t\t\t\t\tout_stream);\n}\n\nopj_codestream_index_t* jp2_get_cstr_index(opj_jp2_t* p_jp2)\n{\n\treturn j2k_get_cstr_index(p_jp2->j2k);\n}\n\nopj_codestream_info_v2_t* jp2_get_cstr_info(opj_jp2_t* p_jp2)\n{\n\treturn j2k_get_cstr_info(p_jp2->j2k);\n}\n\nOPJ_BOOL opj_jp2_set_decoded_resolution_factor(opj_jp2_t *p_jp2,\n                                               OPJ_UINT32 res_factor,\n                                               opj_event_mgr_t * p_manager)\n{\n\treturn opj_j2k_set_decoded_resolution_factor(p_jp2->j2k, res_factor, p_manager);\n}\n\n/* JPIP specific */\n\n#ifdef USE_JPIP\nstatic OPJ_BOOL opj_jpip_write_iptr(opj_jp2_t *jp2,\n  opj_stream_private_t *cio,\n  opj_event_mgr_t * p_manager )\n{\n  OPJ_OFF_T j2k_codestream_exit;\n  OPJ_BYTE l_data_header [24];\n\n  /* preconditions */\n  assert(jp2 != 00);\n  assert(cio != 00);\n  assert(p_manager != 00);\n  assert(opj_stream_has_seek(cio));\n\n  j2k_codestream_exit = opj_stream_tell(cio);\n  opj_write_bytes(l_data_header, 24, 4); /* size of iptr */\n  opj_write_bytes(l_data_header + 4,JPIP_IPTR,4);\t\t\t\t\t\t\t\t\t   /* IPTR */\n#if 0\n  opj_write_bytes(l_data_header + 4 + 4, 0, 8); /* offset */\n  opj_write_bytes(l_data_header + 8 + 8, 0, 8); /* length */\n#else\n  opj_write_double(l_data_header + 4 + 4, 0); /* offset */\n  opj_write_double(l_data_header + 8 + 8, 0); /* length */\n#endif\n\n  if (! opj_stream_seek(cio,jp2->jpip_iptr_offset,p_manager)) {\n    opj_event_msg(p_manager, EVT_ERROR, \"Failed to seek in the stream.\\n\");\n    return OPJ_FALSE;\n  }\n\n  if (opj_stream_write_data(cio,l_data_header,24,p_manager) != 24) {\n    opj_event_msg(p_manager, EVT_ERROR, \"Failed to seek in the stream.\\n\");\n    return OPJ_FALSE;\n  }\n\n  if (! opj_stream_seek(cio,j2k_codestream_exit,p_manager)) {\n    opj_event_msg(p_manager, EVT_ERROR, \"Failed to seek in the stream.\\n\");\n    return OPJ_FALSE;\n  }\n\n  return OPJ_TRUE;\n}\n\nstatic OPJ_BOOL opj_jpip_write_fidx(opj_jp2_t *jp2,\n  opj_stream_private_t *cio,\n  opj_event_mgr_t * p_manager )\n{\n  OPJ_OFF_T j2k_codestream_exit;\n  OPJ_BYTE l_data_header [24];\n\n  /* preconditions */\n  assert(jp2 != 00);\n  assert(cio != 00);\n  assert(p_manager != 00);\n  assert(opj_stream_has_seek(cio));\n\n  opj_write_bytes(l_data_header, 24, 4); /* size of iptr */\n  opj_write_bytes(l_data_header + 4,JPIP_FIDX,4);\t\t\t\t\t\t\t\t\t   /* IPTR */\n  opj_write_double(l_data_header + 4 + 4, 0); /* offset */\n  opj_write_double(l_data_header + 8 + 8, 0); /* length */\n\n  if (opj_stream_write_data(cio,l_data_header,24,p_manager) != 24) {\n    opj_event_msg(p_manager, EVT_ERROR, \"Failed to seek in the stream.\\n\");\n    return OPJ_FALSE;\n  }\n\n  j2k_codestream_exit = opj_stream_tell(cio);\n  if (! opj_stream_seek(cio,j2k_codestream_exit,p_manager)) {\n    opj_event_msg(p_manager, EVT_ERROR, \"Failed to seek in the stream.\\n\");\n    return OPJ_FALSE;\n  }\n\n  return OPJ_TRUE;\n}\n\nstatic OPJ_BOOL opj_jpip_write_cidx(opj_jp2_t *jp2,\n  opj_stream_private_t *cio,\n  opj_event_mgr_t * p_manager )\n{\n  OPJ_OFF_T j2k_codestream_exit;\n  OPJ_BYTE l_data_header [24];\n\n  /* preconditions */\n  assert(jp2 != 00);\n  assert(cio != 00);\n  assert(p_manager != 00);\n  assert(opj_stream_has_seek(cio));\n\n  j2k_codestream_exit = opj_stream_tell(cio);\n  opj_write_bytes(l_data_header, 24, 4); /* size of iptr */\n  opj_write_bytes(l_data_header + 4,JPIP_CIDX,4);\t\t\t\t\t\t\t\t\t   /* IPTR */\n#if 0\n  opj_write_bytes(l_data_header + 4 + 4, 0, 8); /* offset */\n  opj_write_bytes(l_data_header + 8 + 8, 0, 8); /* length */\n#else\n  opj_write_double(l_data_header + 4 + 4, 0); /* offset */\n  opj_write_double(l_data_header + 8 + 8, 0); /* length */\n#endif\n\n  if (! opj_stream_seek(cio,j2k_codestream_exit,p_manager)) {\n    opj_event_msg(p_manager, EVT_ERROR, \"Failed to seek in the stream.\\n\");\n    return OPJ_FALSE;\n  }\n\n  if (opj_stream_write_data(cio,l_data_header,24,p_manager) != 24) {\n    opj_event_msg(p_manager, EVT_ERROR, \"Failed to seek in the stream.\\n\");\n    return OPJ_FALSE;\n  }\n\n  j2k_codestream_exit = opj_stream_tell(cio);\n  if (! opj_stream_seek(cio,j2k_codestream_exit,p_manager)) {\n    opj_event_msg(p_manager, EVT_ERROR, \"Failed to seek in the stream.\\n\");\n    return OPJ_FALSE;\n  }\n\n  return OPJ_TRUE;\n}\n\n#if 0\nstatic void write_prxy( int offset_jp2c, int length_jp2c, int offset_idx, int length_idx, opj_stream_private_t *cio,\n  opj_event_mgr_t * p_manager )\n{\n  OPJ_BYTE l_data_header [8];\n  OPJ_OFF_T len, lenp;\n\n  lenp = opj_stream_tell(cio);\n  opj_stream_skip(cio, 4, p_manager);         /* L [at the end] */\n  opj_write_bytes(l_data_header,JPIP_PRXY,4); /* IPTR           */\n  opj_stream_write_data(cio,l_data_header,4,p_manager);\n\n  opj_write_bytes( l_data_header, offset_jp2c, 8); /* OOFF           */\n  opj_stream_write_data(cio,l_data_header,8,p_manager);\n  opj_write_bytes( l_data_header, length_jp2c, 4); /* OBH part 1     */\n  opj_write_bytes( l_data_header+4, JP2_JP2C, 4);  /* OBH part 2     */\n  opj_stream_write_data(cio,l_data_header,8,p_manager);\n\n  opj_write_bytes( l_data_header, 1, 1);/* NI             */\n  opj_stream_write_data(cio,l_data_header,1,p_manager);\n\n  opj_write_bytes( l_data_header, offset_idx, 8);  /* IOFF           */\n  opj_stream_write_data(cio,l_data_header,8,p_manager);\n  opj_write_bytes( l_data_header, length_idx, 4);  /* IBH part 1     */\n  opj_write_bytes( l_data_header+4, JPIP_CIDX, 4);   /* IBH part 2     */\n  opj_stream_write_data(cio,l_data_header,8,p_manager);\n\n  len = opj_stream_tell(cio)-lenp;\n  opj_stream_skip(cio, lenp, p_manager);\n  opj_write_bytes(l_data_header,len,4);/* L              */\n  opj_stream_write_data(cio,l_data_header,4,p_manager);\n  opj_stream_seek(cio, lenp+len,p_manager);\n}\n#endif\n\n\n#if 0\nstatic int write_fidx( int offset_jp2c, int length_jp2c, int offset_idx, int length_idx, opj_stream_private_t *cio,\n  opj_event_mgr_t * p_manager )\n{\n  OPJ_BYTE l_data_header [4];\n  OPJ_OFF_T len, lenp;\n\n  lenp = opj_stream_tell(cio);\n  opj_stream_skip(cio, 4, p_manager);\n  opj_write_bytes(l_data_header,JPIP_FIDX,4); /* FIDX */\n  opj_stream_write_data(cio,l_data_header,4,p_manager);\n\n  write_prxy( offset_jp2c, length_jp2c, offset_idx, length_idx, cio,p_manager);\n\n  len = opj_stream_tell(cio)-lenp;\n  opj_stream_skip(cio, lenp, p_manager);\n  opj_write_bytes(l_data_header,len,4);/* L              */\n  opj_stream_write_data(cio,l_data_header,4,p_manager);\n  opj_stream_seek(cio, lenp+len,p_manager);\n\n  return len;\n}\n#endif\n#endif /* USE_JPIP */\n"
  },
  {
    "path": "ext/openjpeg/jp2.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR \n * Copyright (c) 2012, CS Systemes d'Information, France\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n#ifndef __JP2_H\n#define __JP2_H\n/**\n@file jp2.h\n@brief The JPEG-2000 file format Reader/Writer (JP2)\n\n*/\n\n/** @defgroup JP2 JP2 - JPEG-2000 file format reader/writer */\n/*@{*/\n\n/*#define JPIP_JPIP 0x6a706970*/\n\n#define     JP2_JP   0x6a502020    /**< JPEG 2000 signature box */\n#define     JP2_FTYP 0x66747970    /**< File type box */\n#define     JP2_JP2H 0x6a703268    /**< JP2 header box (super-box) */\n#define     JP2_IHDR 0x69686472    /**< Image header box */\n#define     JP2_COLR 0x636f6c72    /**< Colour specification box */\n#define     JP2_JP2C 0x6a703263    /**< Contiguous codestream box */\n#define     JP2_URL  0x75726c20    /**< Data entry URL box */\n#define     JP2_PCLR 0x70636c72    /**< Palette box */\n#define     JP2_CMAP 0x636d6170    /**< Component Mapping box */\n#define     JP2_CDEF 0x63646566    /**< Channel Definition box */\n#define     JP2_DTBL 0x6474626c    /**< Data Reference box */\n#define     JP2_BPCC 0x62706363    /**< Bits per component box */\n#define     JP2_JP2  0x6a703220    /**< File type fields */\n\n/* For the future */\n/* #define JP2_RES 0x72657320 */  /**< Resolution box (super-box) */\n/* #define JP2_JP2I 0x6a703269 */  /**< Intellectual property box */\n/* #define JP2_XML  0x786d6c20 */  /**< XML box */\n/* #define JP2_UUID 0x75756994 */  /**< UUID box */\n/* #define JP2_UINF 0x75696e66 */  /**< UUID info box (super-box) */\n/* #define JP2_ULST 0x756c7374 */  /**< UUID list box */\n\n/* ----------------------------------------------------------------------- */\n\ntypedef enum\n{\n  JP2_STATE_NONE            = 0x0,\n  JP2_STATE_SIGNATURE       = 0x1,\n  JP2_STATE_FILE_TYPE       = 0x2,\n  JP2_STATE_HEADER          = 0x4,\n  JP2_STATE_CODESTREAM      = 0x8,\n  JP2_STATE_END_CODESTREAM  = 0x10,\n  JP2_STATE_UNKNOWN         = 0x7fffffff /* ISO C restricts enumerator values to range of 'int' */\n}\nJP2_STATE;\n\ntypedef enum\n{\n  JP2_IMG_STATE_NONE        = 0x0,\n  JP2_IMG_STATE_UNKNOWN     = 0x7fffffff\n}\nJP2_IMG_STATE;\n\n/** \nChannel description: channel index, type, assocation\n*/\ntypedef struct opj_jp2_cdef_info\n{\n    OPJ_UINT16 cn, typ, asoc;\n} opj_jp2_cdef_info_t;\n\n/** \nChannel descriptions and number of descriptions\n*/\ntypedef struct opj_jp2_cdef\n{\n    opj_jp2_cdef_info_t *info;\n    OPJ_UINT16 n;\n} opj_jp2_cdef_t;\n\n/** \nComponent mappings: channel index, mapping type, palette index\n*/\ntypedef struct opj_jp2_cmap_comp\n{\n    OPJ_UINT16 cmp;\n    OPJ_BYTE mtyp, pcol;\n} opj_jp2_cmap_comp_t;\n\n/** \nPalette data: table entries, palette columns\n*/\ntypedef struct opj_jp2_pclr\n{\n    OPJ_UINT32 *entries;\n    OPJ_BYTE *channel_sign;\n    OPJ_BYTE *channel_size;\n    opj_jp2_cmap_comp_t *cmap;\n    OPJ_UINT16 nr_entries;\n    OPJ_BYTE nr_channels;\n} opj_jp2_pclr_t;\n\n/** \nCollector for ICC profile, palette, component mapping, channel description \n*/\ntypedef struct opj_jp2_color\n{\n    OPJ_BYTE *icc_profile_buf;\n    OPJ_UINT32 icc_profile_len;\n\n    opj_jp2_cdef_t *jp2_cdef;\n    opj_jp2_pclr_t *jp2_pclr;\n    OPJ_BYTE jp2_has_colr;\n} opj_jp2_color_t;\n\n/** \nJP2 component\n*/\ntypedef struct opj_jp2_comps {\n  OPJ_UINT32 depth;      \n  OPJ_UINT32 sgnd;       \n  OPJ_UINT32 bpcc;\n} opj_jp2_comps_t;\n\n/**\nJPEG-2000 file format reader/writer\n*/\ntypedef struct opj_jp2\n{\n  /** handle to the J2K codec  */\n  opj_j2k_t *j2k;\n  /** list of validation procedures */\n  struct opj_procedure_list * m_validation_list;\n  /** list of execution procedures */\n  struct opj_procedure_list * m_procedure_list;\n\n  /* width of image */\n  OPJ_UINT32 w;\n  /* height of image */\n  OPJ_UINT32 h;\n  /* number of components in the image */\n  OPJ_UINT32 numcomps;\n  OPJ_UINT32 bpc;\n  OPJ_UINT32 C;\n  OPJ_UINT32 UnkC;\n  OPJ_UINT32 IPR;\n  OPJ_UINT32 meth;\n  OPJ_UINT32 approx;\n  OPJ_UINT32 enumcs;\n  OPJ_UINT32 precedence;\n  OPJ_UINT32 brand;\n  OPJ_UINT32 minversion;\n  OPJ_UINT32 numcl;\n  OPJ_UINT32 *cl;\n  opj_jp2_comps_t *comps;\n  /* FIXME: The following two variables are used to save offset\n    as we write out a JP2 file to disk. This mecanism is not flexible\n    as codec writers will need to extand those fields as new part\n    of the standard are implemented.\n  */\n    OPJ_OFF_T j2k_codestream_offset;\n    OPJ_OFF_T jpip_iptr_offset;\n\tOPJ_BOOL jpip_on;\n  OPJ_UINT32 jp2_state;\n  OPJ_UINT32 jp2_img_state;\n\n  opj_jp2_color_t color;\n    \n    OPJ_BOOL ignore_pclr_cmap_cdef;\n}\nopj_jp2_t;\n\n/**\nJP2 Box\n*/\ntypedef struct opj_jp2_box {\n    OPJ_UINT32 length;\n    OPJ_UINT32 type;\n    OPJ_INT32 init_pos;\n} opj_jp2_box_t;\n\ntypedef struct opj_jp2_header_handler\n{\n  /* marker value */\n  OPJ_UINT32 id;\n  /* action linked to the marker */\n  OPJ_BOOL (*handler) (     opj_jp2_t *jp2, \n                            OPJ_BYTE *p_header_data, \n                            OPJ_UINT32 p_header_size, \n                            opj_event_mgr_t * p_manager);\n}\nopj_jp2_header_handler_t;\n\n\ntypedef struct opj_jp2_img_header_writer_handler \n{\n  /* action to perform */\n  OPJ_BYTE*   (*handler) (opj_jp2_t *jp2, OPJ_UINT32 * p_data_size);\n  /* result of the action : data */\n  OPJ_BYTE*   m_data;\n  /* size of data */\n  OPJ_UINT32  m_size;\n} \nopj_jp2_img_header_writer_handler_t;\n\n/** @name Exported functions */\n/*@{*/\n/* ----------------------------------------------------------------------- */\n\n/**\n * Writes the Jpeg2000 file Header box - JP2 Header box (warning, this is a super box).\n *\n * @param  jp2      the jpeg2000 file codec.\n * @param  stream      the stream to write data to.\n * @param  p_manager  user event manager.\n *\n * @return true if writing was successful.\n*/\nOPJ_BOOL opj_jp2_write_jp2h(opj_jp2_t *jp2,\n                            opj_stream_private_t *stream,\n                            opj_event_mgr_t * p_manager );\n\n/**\nSetup the decoder decoding parameters using user parameters.\nDecoding parameters are returned in jp2->j2k->cp.\n@param jp2 JP2 decompressor handle\n@param parameters decompression parameters\n*/\nvoid opj_jp2_setup_decoder(opj_jp2_t *jp2, opj_dparameters_t *parameters);\n\n/**\n * Decode an image from a JPEG-2000 file stream\n * @param jp2 JP2 decompressor handle\n * @param p_stream  FIXME DOC\n * @param p_image   FIXME DOC\n * @param p_manager FIXME DOC\n *\n * @return Returns a decoded image if successful, returns NULL otherwise\n*/\nOPJ_BOOL opj_jp2_decode(opj_jp2_t *jp2,\n                        opj_stream_private_t *p_stream,\n            opj_image_t* p_image,\n            opj_event_mgr_t * p_manager);\n\n/**\n * Setup the encoder parameters using the current image and using user parameters. \n * Coding parameters are returned in jp2->j2k->cp. \n *\n * @param jp2 JP2 compressor handle\n * @param parameters compression parameters\n * @param image input filled image\n * @param p_manager  FIXME DOC\n*/\nvoid opj_jp2_setup_encoder(  opj_jp2_t *jp2, \n                            opj_cparameters_t *parameters, \n                            opj_image_t *image, \n                            opj_event_mgr_t * p_manager);\n\n/**\nEncode an image into a JPEG-2000 file stream\n@param jp2      JP2 compressor handle\n@param stream    Output buffer stream\n@param p_manager  event manager\n@return Returns true if successful, returns false otherwise\n*/\nOPJ_BOOL opj_jp2_encode(  opj_jp2_t *jp2, \n              opj_stream_private_t *stream, \n              opj_event_mgr_t * p_manager);\n\n\n/**\n * Starts a compression scheme, i.e. validates the codec parameters, writes the header.\n *\n * @param  jp2    the jpeg2000 file codec.\n * @param  stream    the stream object.\n * @param  p_image   FIXME DOC\n * @param p_manager FIXME DOC\n *\n * @return true if the codec is valid.\n */\nOPJ_BOOL opj_jp2_start_compress(opj_jp2_t *jp2,\n                                opj_stream_private_t *stream,\n                                opj_image_t * p_image,\n                                opj_event_mgr_t * p_manager);\n\n\n/**\n * Ends the compression procedures and possibiliy add data to be read after the\n * codestream.\n */\nOPJ_BOOL opj_jp2_end_compress(  opj_jp2_t *jp2,\n                  opj_stream_private_t *cio,\n                  opj_event_mgr_t * p_manager);\n\n/* ----------------------------------------------------------------------- */\n\n/**\n * Ends the decompression procedures and possibiliy add data to be read after the\n * codestream.\n */\nOPJ_BOOL opj_jp2_end_decompress(opj_jp2_t *jp2, \n                                opj_stream_private_t *cio,\n                                opj_event_mgr_t * p_manager);\n\n/**\n * Reads a jpeg2000 file header structure.\n *\n * @param p_stream the stream to read data from.\n * @param jp2 the jpeg2000 file header structure.\n * @param p_image   FIXME DOC\n * @param p_manager the user event manager.\n *\n * @return true if the box is valid.\n */\nOPJ_BOOL opj_jp2_read_header(  opj_stream_private_t *p_stream,\n                                opj_jp2_t *jp2,\n                                opj_image_t ** p_image,\n                                opj_event_mgr_t * p_manager );\n\n/**\n * Reads a tile header.\n * @param  p_jp2         the jpeg2000 codec.\n * @param  p_tile_index  FIXME DOC\n * @param  p_data_size   FIXME DOC\n * @param  p_tile_x0     FIXME DOC\n * @param  p_tile_y0     FIXME DOC\n * @param  p_tile_x1     FIXME DOC\n * @param  p_tile_y1     FIXME DOC\n * @param  p_nb_comps    FIXME DOC\n * @param  p_go_on       FIXME DOC\n * @param  p_stream      the stream to write data to.\n * @param  p_manager     the user event manager.\n */\nOPJ_BOOL opj_jp2_read_tile_header ( opj_jp2_t * p_jp2,\n                                    OPJ_UINT32 * p_tile_index,\n                                    OPJ_UINT32 * p_data_size,\n                                    OPJ_INT32 * p_tile_x0,\n                                    OPJ_INT32 * p_tile_y0,\n                                    OPJ_INT32 * p_tile_x1,\n                                    OPJ_INT32 * p_tile_y1,\n                                    OPJ_UINT32 * p_nb_comps,\n                                    OPJ_BOOL * p_go_on,\n                                    opj_stream_private_t *p_stream,\n                                    opj_event_mgr_t * p_manager );\n\n/**\n * Writes a tile.\n *\n * @param  p_jp2    the jpeg2000 codec.\n * @param p_tile_index  FIXME DOC\n * @param p_data        FIXME DOC\n * @param p_data_size   FIXME DOC\n * @param  p_stream      the stream to write data to.\n * @param  p_manager  the user event manager.\n */\nOPJ_BOOL opj_jp2_write_tile (  opj_jp2_t *p_jp2,\n                    OPJ_UINT32 p_tile_index,\n                    OPJ_BYTE * p_data,\n                    OPJ_UINT32 p_data_size,\n                    opj_stream_private_t *p_stream,\n                    opj_event_mgr_t * p_manager );\n\n/**\n * Decode tile data.\n * @param  p_jp2    the jpeg2000 codec.\n * @param  p_tile_index FIXME DOC\n * @param  p_data       FIXME DOC\n * @param  p_data_size  FIXME DOC\n * @param  p_stream      the stream to write data to.\n * @param  p_manager  the user event manager.\n *\n * @return FIXME DOC\n */\nOPJ_BOOL opj_jp2_decode_tile (  opj_jp2_t * p_jp2,\n                                OPJ_UINT32 p_tile_index,\n                                OPJ_BYTE * p_data,\n                                OPJ_UINT32 p_data_size,\n                                opj_stream_private_t *p_stream,\n                                opj_event_mgr_t * p_manager );\n\n/**\n * Creates a jpeg2000 file decompressor.\n *\n * @return  an empty jpeg2000 file codec.\n */\nopj_jp2_t* opj_jp2_create (OPJ_BOOL p_is_decoder);\n\n/**\nDestroy a JP2 decompressor handle\n@param jp2 JP2 decompressor handle to destroy\n*/\nvoid opj_jp2_destroy(opj_jp2_t *jp2);\n\n\n/**\n * Sets the given area to be decoded. This function should be called right after opj_read_header and before any tile header reading.\n *\n * @param  p_jp2      the jpeg2000 codec.\n * @param  p_image     FIXME DOC\n * @param  p_start_x   the left position of the rectangle to decode (in image coordinates).\n * @param  p_start_y    the up position of the rectangle to decode (in image coordinates).\n * @param  p_end_x      the right position of the rectangle to decode (in image coordinates).\n * @param  p_end_y      the bottom position of the rectangle to decode (in image coordinates).\n * @param  p_manager    the user event manager\n *\n * @return  true      if the area could be set.\n */\nOPJ_BOOL opj_jp2_set_decode_area(  opj_jp2_t *p_jp2,\n                    opj_image_t* p_image,\n                    OPJ_INT32 p_start_x, OPJ_INT32 p_start_y,\n                    OPJ_INT32 p_end_x, OPJ_INT32 p_end_y,\n                    opj_event_mgr_t * p_manager );\n\n /**\n * \n */\nOPJ_BOOL opj_jp2_get_tile(  opj_jp2_t *p_jp2,\n                            opj_stream_private_t *p_stream,\n                            opj_image_t* p_image,\n                            opj_event_mgr_t * p_manager,\n                            OPJ_UINT32 tile_index );\n\n\n/**\n * \n */\nOPJ_BOOL opj_jp2_set_decoded_resolution_factor(opj_jp2_t *p_jp2, \n                                               OPJ_UINT32 res_factor, \n                                               opj_event_mgr_t * p_manager);\n\n\n/* TODO MSD: clean these 3 functions */\n/**\n * Dump some elements from the JP2 decompression structure .\n *\n *@param p_jp2        the jp2 codec.\n *@param flag        flag to describe what elments are dump.\n *@param out_stream      output stream where dump the elements.\n *\n*/\nvoid jp2_dump (opj_jp2_t* p_jp2, OPJ_INT32 flag, FILE* out_stream);\n\n/**\n * Get the codestream info from a JPEG2000 codec.\n *\n *@param  p_jp2        jp2 codec.\n *\n *@return  the codestream information extract from the jpg2000 codec\n */\nopj_codestream_info_v2_t* jp2_get_cstr_info(opj_jp2_t* p_jp2);\n\n/**\n * Get the codestream index from a JPEG2000 codec.\n *\n *@param  p_jp2        jp2 codec.\n *\n *@return  the codestream index extract from the jpg2000 codec\n */\nopj_codestream_index_t* jp2_get_cstr_index(opj_jp2_t* p_jp2);\n\n\n/*@}*/\n\n/*@}*/\n\n#endif /* __JP2_H */\n\n"
  },
  {
    "path": "ext/openjpeg/libopenjp2.pc.cmake.in",
    "content": "prefix=@CMAKE_INSTALL_PREFIX@\nbindir=${prefix}/@OPENJPEG_INSTALL_BIN_DIR@\nmandir=${prefix}/@OPENJPEG_INSTALL_MAN_DIR@\ndocdir=${prefix}/@OPENJPEG_INSTALL_DOC_DIR@\nlibdir=${prefix}/@OPENJPEG_INSTALL_LIB_DIR@\nincludedir=${prefix}/@OPENJPEG_INSTALL_INCLUDE_DIR@\n\nName: openjp2\nDescription: JPEG2000 library (Part 1 and 2)\nURL: http://www.openjpeg.org/\nVersion: @OPENJPEG_VERSION@\nLibs: -L${libdir} -lopenjp2\nLibs.private: -lm\nCflags: -I${includedir}\n"
  },
  {
    "path": "ext/openjpeg/mct.c",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR \n * Copyright (c) 2012, CS Systemes d'Information, France\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifdef __SSE__\n#include <xmmintrin.h>\n#endif\n\n#include \"opj_includes.h\"\n\n/* <summary> */\n/* This table contains the norms of the basis function of the reversible MCT. */\n/* </summary> */\nstatic const OPJ_FLOAT64 opj_mct_norms[3] = { 1.732, .8292, .8292 };\n\n/* <summary> */\n/* This table contains the norms of the basis function of the irreversible MCT. */\n/* </summary> */\nstatic const OPJ_FLOAT64 opj_mct_norms_real[3] = { 1.732, 1.805, 1.573 };\n\nconst OPJ_FLOAT64 * opj_mct_get_mct_norms ()\n{\n\treturn opj_mct_norms;\n}\n\nconst OPJ_FLOAT64 * opj_mct_get_mct_norms_real ()\n{\n\treturn opj_mct_norms_real;\n}\n\n/* <summary> */\n/* Foward reversible MCT. */\n/* </summary> */\nvoid opj_mct_encode(\n\t\tOPJ_INT32* restrict c0,\n\t\tOPJ_INT32* restrict c1,\n\t\tOPJ_INT32* restrict c2,\n\t\tOPJ_UINT32 n)\n{\n\tOPJ_UINT32 i;\n\tfor(i = 0; i < n; ++i) {\n\t\tOPJ_INT32 r = c0[i];\n\t\tOPJ_INT32 g = c1[i];\n\t\tOPJ_INT32 b = c2[i];\n\t\tOPJ_INT32 y = (r + (g * 2) + b) >> 2;\n\t\tOPJ_INT32 u = b - g;\n\t\tOPJ_INT32 v = r - g;\n\t\tc0[i] = y;\n\t\tc1[i] = u;\n\t\tc2[i] = v;\n\t}\n}\n\n/* <summary> */\n/* Inverse reversible MCT. */\n/* </summary> */\nvoid opj_mct_decode(\n\t\tOPJ_INT32* restrict c0,\n\t\tOPJ_INT32* restrict c1, \n\t\tOPJ_INT32* restrict c2, \n\t\tOPJ_UINT32 n)\n{\n\tOPJ_UINT32 i;\n\tfor (i = 0; i < n; ++i) {\n\t\tOPJ_INT32 y = c0[i];\n\t\tOPJ_INT32 u = c1[i];\n\t\tOPJ_INT32 v = c2[i];\n\t\tOPJ_INT32 g = y - ((u + v) >> 2);\n\t\tOPJ_INT32 r = v + g;\n\t\tOPJ_INT32 b = u + g;\n\t\tc0[i] = r;\n\t\tc1[i] = g;\n\t\tc2[i] = b;\n\t}\n}\n\n/* <summary> */\n/* Get norm of basis function of reversible MCT. */\n/* </summary> */\nOPJ_FLOAT64 opj_mct_getnorm(OPJ_UINT32 compno) {\n\treturn opj_mct_norms[compno];\n}\n\n/* <summary> */\n/* Foward irreversible MCT. */\n/* </summary> */\nvoid opj_mct_encode_real(\n\t\tOPJ_INT32* restrict c0,\n\t\tOPJ_INT32* restrict c1,\n\t\tOPJ_INT32* restrict c2,\n\t\tOPJ_UINT32 n)\n{\n\tOPJ_UINT32 i;\n\tfor(i = 0; i < n; ++i) {\n\t\tOPJ_INT32 r = c0[i];\n\t\tOPJ_INT32 g = c1[i];\n\t\tOPJ_INT32 b = c2[i];\n\t\tOPJ_INT32 y =  opj_int_fix_mul(r, 2449) + opj_int_fix_mul(g, 4809) + opj_int_fix_mul(b, 934);\n\t\tOPJ_INT32 u = -opj_int_fix_mul(r, 1382) - opj_int_fix_mul(g, 2714) + opj_int_fix_mul(b, 4096);\n\t\tOPJ_INT32 v =  opj_int_fix_mul(r, 4096) - opj_int_fix_mul(g, 3430) - opj_int_fix_mul(b, 666);\n\t\tc0[i] = y;\n\t\tc1[i] = u;\n\t\tc2[i] = v;\n\t}\n}\n\n/* <summary> */\n/* Inverse irreversible MCT. */\n/* </summary> */\nvoid opj_mct_decode_real(\n\t\tOPJ_FLOAT32* restrict c0,\n\t\tOPJ_FLOAT32* restrict c1,\n\t\tOPJ_FLOAT32* restrict c2,\n\t\tOPJ_UINT32 n)\n{\n\tOPJ_UINT32 i;\n#ifdef __SSE__\n\t__m128 vrv, vgu, vgv, vbu;\n\tvrv = _mm_set1_ps(1.402f);\n\tvgu = _mm_set1_ps(0.34413f);\n\tvgv = _mm_set1_ps(0.71414f);\n\tvbu = _mm_set1_ps(1.772f);\n\tfor (i = 0; i < (n >> 3); ++i) {\n\t\t__m128 vy, vu, vv;\n\t\t__m128 vr, vg, vb;\n\n\t\tvy = _mm_load_ps(c0);\n\t\tvu = _mm_load_ps(c1);\n\t\tvv = _mm_load_ps(c2);\n\t\tvr = _mm_add_ps(vy, _mm_mul_ps(vv, vrv));\n\t\tvg = _mm_sub_ps(_mm_sub_ps(vy, _mm_mul_ps(vu, vgu)), _mm_mul_ps(vv, vgv));\n\t\tvb = _mm_add_ps(vy, _mm_mul_ps(vu, vbu));\n\t\t_mm_store_ps(c0, vr);\n\t\t_mm_store_ps(c1, vg);\n\t\t_mm_store_ps(c2, vb);\n\t\tc0 += 4;\n\t\tc1 += 4;\n\t\tc2 += 4;\n\n\t\tvy = _mm_load_ps(c0);\n\t\tvu = _mm_load_ps(c1);\n\t\tvv = _mm_load_ps(c2);\n\t\tvr = _mm_add_ps(vy, _mm_mul_ps(vv, vrv));\n\t\tvg = _mm_sub_ps(_mm_sub_ps(vy, _mm_mul_ps(vu, vgu)), _mm_mul_ps(vv, vgv));\n\t\tvb = _mm_add_ps(vy, _mm_mul_ps(vu, vbu));\n\t\t_mm_store_ps(c0, vr);\n\t\t_mm_store_ps(c1, vg);\n\t\t_mm_store_ps(c2, vb);\n\t\tc0 += 4;\n\t\tc1 += 4;\n\t\tc2 += 4;\n\t}\n\tn &= 7;\n#endif\n\tfor(i = 0; i < n; ++i) {\n\t\tOPJ_FLOAT32 y = c0[i];\n\t\tOPJ_FLOAT32 u = c1[i];\n\t\tOPJ_FLOAT32 v = c2[i];\n\t\tOPJ_FLOAT32 r = y + (v * 1.402f);\n\t\tOPJ_FLOAT32 g = y - (u * 0.34413f) - (v * (0.71414f));\n\t\tOPJ_FLOAT32 b = y + (u * 1.772f);\n\t\tc0[i] = r;\n\t\tc1[i] = g;\n\t\tc2[i] = b;\n\t}\n}\n\n/* <summary> */\n/* Get norm of basis function of irreversible MCT. */\n/* </summary> */\nOPJ_FLOAT64 opj_mct_getnorm_real(OPJ_UINT32 compno) {\n\treturn opj_mct_norms_real[compno];\n}\n\n\nOPJ_BOOL opj_mct_encode_custom(\n\t\t\t\t\t   OPJ_BYTE * pCodingdata,\n\t\t\t\t\t   OPJ_UINT32 n,\n\t\t\t\t\t   OPJ_BYTE ** pData,\n\t\t\t\t\t   OPJ_UINT32 pNbComp,\n\t\t\t\t\t   OPJ_UINT32 isSigned)\n{\n\tOPJ_FLOAT32 * lMct = (OPJ_FLOAT32 *) pCodingdata;\n\tOPJ_UINT32 i;\n\tOPJ_UINT32 j;\n\tOPJ_UINT32 k;\n\tOPJ_UINT32 lNbMatCoeff = pNbComp * pNbComp;\n\tOPJ_INT32 * lCurrentData = 00;\n\tOPJ_INT32 * lCurrentMatrix = 00;\n\tOPJ_INT32 ** lData = (OPJ_INT32 **) pData;\n\tOPJ_UINT32 lMultiplicator = 1 << 13;\n\tOPJ_INT32 * lMctPtr;\n\n    OPJ_ARG_NOT_USED(isSigned);\n\n\tlCurrentData = (OPJ_INT32 *) opj_malloc((pNbComp + lNbMatCoeff) * sizeof(OPJ_INT32));\n\tif (! lCurrentData) {\n\t\treturn OPJ_FALSE;\n\t}\n\n\tlCurrentMatrix = lCurrentData + pNbComp;\n\n\tfor (i =0;i<lNbMatCoeff;++i) {\n\t\tlCurrentMatrix[i] = (OPJ_INT32) (*(lMct++) * (OPJ_FLOAT32)lMultiplicator);\n\t}\n\n\tfor (i = 0; i < n; ++i)  {\n\t\tlMctPtr = lCurrentMatrix;\n\t\tfor (j=0;j<pNbComp;++j) {\n\t\t\tlCurrentData[j] = (*(lData[j]));\n\t\t}\n\n\t\tfor (j=0;j<pNbComp;++j) {\n\t\t\t*(lData[j]) = 0;\n\t\t\tfor (k=0;k<pNbComp;++k) {\n\t\t\t\t*(lData[j]) += opj_int_fix_mul(*lMctPtr, lCurrentData[k]);\n\t\t\t\t++lMctPtr;\n\t\t\t}\n\n\t\t\t++lData[j];\n\t\t}\n\t}\n\n\topj_free(lCurrentData);\n\n\treturn OPJ_TRUE;\n}\n\nOPJ_BOOL opj_mct_decode_custom(\n\t\t\t\t\t   OPJ_BYTE * pDecodingData,\n\t\t\t\t\t   OPJ_UINT32 n,\n\t\t\t\t\t   OPJ_BYTE ** pData,\n\t\t\t\t\t   OPJ_UINT32 pNbComp,\n\t\t\t\t\t   OPJ_UINT32 isSigned)\n{\n\tOPJ_FLOAT32 * lMct;\n\tOPJ_UINT32 i;\n\tOPJ_UINT32 j;\n\tOPJ_UINT32 k;\n\n\tOPJ_FLOAT32 * lCurrentData = 00;\n\tOPJ_FLOAT32 * lCurrentResult = 00;\n\tOPJ_FLOAT32 ** lData = (OPJ_FLOAT32 **) pData;\n\n    OPJ_ARG_NOT_USED(isSigned);\n\n\tlCurrentData = (OPJ_FLOAT32 *) opj_malloc (2 * pNbComp * sizeof(OPJ_FLOAT32));\n\tif (! lCurrentData) {\n\t\treturn OPJ_FALSE;\n\t}\n\tlCurrentResult = lCurrentData + pNbComp;\n\n\tfor (i = 0; i < n; ++i) {\n\t\tlMct = (OPJ_FLOAT32 *) pDecodingData;\n\t\tfor (j=0;j<pNbComp;++j) {\n\t\t\tlCurrentData[j] = (OPJ_FLOAT32) (*(lData[j]));\n\t\t}\n\t\tfor (j=0;j<pNbComp;++j) {\n\t\t\tlCurrentResult[j] = 0;\n\t\t\tfor\t(k=0;k<pNbComp;++k)\t{\n\t\t\t\tlCurrentResult[j] += *(lMct++) * lCurrentData[k];\n\t\t\t}\n\t\t\t*(lData[j]++) = (OPJ_FLOAT32) (lCurrentResult[j]);\n\t\t}\n\t}\n\topj_free(lCurrentData);\n\treturn OPJ_TRUE;\n}\n\nvoid opj_calculate_norms(\tOPJ_FLOAT64 * pNorms,\n\t\t\t\t\t\t\tOPJ_UINT32 pNbComps,\n\t\t\t\t\t\t\tOPJ_FLOAT32 * pMatrix)\n{\n\tOPJ_UINT32 i,j,lIndex;\n\tOPJ_FLOAT32 lCurrentValue;\n\tOPJ_FLOAT64 * lNorms = (OPJ_FLOAT64 *) pNorms;\n\tOPJ_FLOAT32 * lMatrix = (OPJ_FLOAT32 *) pMatrix;\n\n\tfor\t(i=0;i<pNbComps;++i) {\n\t\tlNorms[i] = 0;\n\t\tlIndex = i;\n\n\t\tfor\t(j=0;j<pNbComps;++j) {\n\t\t\tlCurrentValue = lMatrix[lIndex];\n\t\t\tlIndex += pNbComps;\n\t\t\tlNorms[i] += lCurrentValue * lCurrentValue;\n\t\t}\n\t\tlNorms[i] = sqrt(lNorms[i]);\n\t}\n}\n"
  },
  {
    "path": "ext/openjpeg/mct.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR \n * Copyright (c) 2012, CS Systemes d'Information, France\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef __MCT_H\n#define __MCT_H\n/**\n@file mct.h\n@brief Implementation of a multi-component transforms (MCT)\n\nThe functions in MCT.C have for goal to realize reversible and irreversible multicomponent\ntransform. The functions in MCT.C are used by some function in TCD.C.\n*/\n\n/** @defgroup MCT MCT - Implementation of a multi-component transform */\n/*@{*/\n\n/** @name Exported functions */\n/*@{*/\n/* ----------------------------------------------------------------------- */\n/**\nApply a reversible multi-component transform to an image\n@param c0 Samples for red component\n@param c1 Samples for green component\n@param c2 Samples blue component\n@param n Number of samples for each component\n*/\nvoid opj_mct_encode(OPJ_INT32 *c0, OPJ_INT32 *c1, OPJ_INT32 *c2, OPJ_UINT32 n);\n/**\nApply a reversible multi-component inverse transform to an image\n@param c0 Samples for luminance component\n@param c1 Samples for red chrominance component\n@param c2 Samples for blue chrominance component\n@param n Number of samples for each component\n*/\nvoid opj_mct_decode(OPJ_INT32 *c0, OPJ_INT32 *c1, OPJ_INT32 *c2, OPJ_UINT32 n);\n/**\nGet norm of the basis function used for the reversible multi-component transform\n@param compno Number of the component (0->Y, 1->U, 2->V)\n@return \n*/\nOPJ_FLOAT64 opj_mct_getnorm(OPJ_UINT32 compno);\n\n/**\nApply an irreversible multi-component transform to an image\n@param c0 Samples for red component\n@param c1 Samples for green component\n@param c2 Samples blue component\n@param n Number of samples for each component\n*/\nvoid opj_mct_encode_real(OPJ_INT32 *c0, OPJ_INT32 *c1, OPJ_INT32 *c2, OPJ_UINT32 n);\n/**\nApply an irreversible multi-component inverse transform to an image\n@param c0 Samples for luminance component\n@param c1 Samples for red chrominance component\n@param c2 Samples for blue chrominance component\n@param n Number of samples for each component\n*/\nvoid opj_mct_decode_real(OPJ_FLOAT32* c0, OPJ_FLOAT32* c1, OPJ_FLOAT32* c2, OPJ_UINT32 n);\n/**\nGet norm of the basis function used for the irreversible multi-component transform\n@param compno Number of the component (0->Y, 1->U, 2->V)\n@return \n*/\nOPJ_FLOAT64 opj_mct_getnorm_real(OPJ_UINT32 compno);\n\n/**\nFIXME DOC\n@param p_coding_data    MCT data\n@param n                size of components\n@param p_data           components\n@param p_nb_comp        nb of components (i.e. size of p_data)\n@param is_signed        tells if the data is signed\n@return OPJ_FALSE if function encounter a problem, OPJ_TRUE otherwise\n*/\nOPJ_BOOL opj_mct_encode_custom(\n\t\t\t\t\t   OPJ_BYTE * p_coding_data,\n\t\t\t\t\t   OPJ_UINT32 n,\n\t\t\t\t\t   OPJ_BYTE ** p_data,\n\t\t\t\t\t   OPJ_UINT32 p_nb_comp,\n\t\t\t\t\t   OPJ_UINT32 is_signed);\n/**\nFIXME DOC\n@param pDecodingData    MCT data\n@param n                size of components\n@param pData            components\n@param pNbComp          nb of components (i.e. size of p_data)\n@param isSigned         tells if the data is signed\n@return OPJ_FALSE if function encounter a problem, OPJ_TRUE otherwise\n*/\nOPJ_BOOL opj_mct_decode_custom(\n\t\t\t\t\t   OPJ_BYTE * pDecodingData,\n\t\t\t\t\t   OPJ_UINT32 n,\n\t\t\t\t\t   OPJ_BYTE ** pData,\n\t\t\t\t\t   OPJ_UINT32 pNbComp,\n\t\t\t\t\t   OPJ_UINT32 isSigned);\n/**\nFIXME DOC\n@param pNorms           MCT data\n@param p_nb_comps       size of components\n@param pMatrix          components\n@return \n*/\nvoid opj_calculate_norms(   OPJ_FLOAT64 * pNorms,\n                            OPJ_UINT32 p_nb_comps,\n                            OPJ_FLOAT32 * pMatrix);\n/**\nFIXME DOC \n*/\nconst OPJ_FLOAT64 * opj_mct_get_mct_norms (void);\n/**\nFIXME DOC \n*/\nconst OPJ_FLOAT64 * opj_mct_get_mct_norms_real (void);\n/* ----------------------------------------------------------------------- */\n/*@}*/\n\n/*@}*/\n\n#endif /* __MCT_H */\n"
  },
  {
    "path": "ext/openjpeg/mqc.c",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include \"opj_includes.h\"\n\n/** @defgroup MQC MQC - Implementation of an MQ-Coder */\n/*@{*/\n\n/** @name Local static functions */\n/*@{*/\n\n/**\nOutput a byte, doing bit-stuffing if necessary.\nAfter a 0xff byte, the next byte must be smaller than 0x90.\n@param mqc MQC handle\n*/\nstatic void opj_mqc_byteout(opj_mqc_t *mqc);\n/**\nRenormalize mqc->a and mqc->c while encoding, so that mqc->a stays between 0x8000 and 0x10000\n@param mqc MQC handle\n*/\nstatic void opj_mqc_renorme(opj_mqc_t *mqc);\n/**\nEncode the most probable symbol\n@param mqc MQC handle\n*/\nstatic void opj_mqc_codemps(opj_mqc_t *mqc);\n/**\nEncode the most least symbol\n@param mqc MQC handle\n*/\nstatic void opj_mqc_codelps(opj_mqc_t *mqc);\n/**\nFill mqc->c with 1's for flushing\n@param mqc MQC handle\n*/\nstatic void opj_mqc_setbits(opj_mqc_t *mqc);\n/**\nFIXME DOC\n@param mqc MQC handle\n@return \n*/\nstatic INLINE OPJ_INT32 opj_mqc_mpsexchange(opj_mqc_t *const mqc);\n/**\nFIXME DOC\n@param mqc MQC handle\n@return \n*/\nstatic INLINE OPJ_INT32 opj_mqc_lpsexchange(opj_mqc_t *const mqc);\n/**\nInput a byte\n@param mqc MQC handle\n*/\nstatic INLINE void opj_mqc_bytein(opj_mqc_t *const mqc);\n/**\nRenormalize mqc->a and mqc->c while decoding\n@param mqc MQC handle\n*/\nstatic INLINE void opj_mqc_renormd(opj_mqc_t *const mqc);\n/*@}*/\n\n/*@}*/\n\n/* <summary> */\n/* This array defines all the possible states for a context. */\n/* </summary> */\nstatic opj_mqc_state_t mqc_states[47 * 2] = {\n\t{0x5601, 0, &mqc_states[2], &mqc_states[3]},\n\t{0x5601, 1, &mqc_states[3], &mqc_states[2]},\n\t{0x3401, 0, &mqc_states[4], &mqc_states[12]},\n\t{0x3401, 1, &mqc_states[5], &mqc_states[13]},\n\t{0x1801, 0, &mqc_states[6], &mqc_states[18]},\n\t{0x1801, 1, &mqc_states[7], &mqc_states[19]},\n\t{0x0ac1, 0, &mqc_states[8], &mqc_states[24]},\n\t{0x0ac1, 1, &mqc_states[9], &mqc_states[25]},\n\t{0x0521, 0, &mqc_states[10], &mqc_states[58]},\n\t{0x0521, 1, &mqc_states[11], &mqc_states[59]},\n\t{0x0221, 0, &mqc_states[76], &mqc_states[66]},\n\t{0x0221, 1, &mqc_states[77], &mqc_states[67]},\n\t{0x5601, 0, &mqc_states[14], &mqc_states[13]},\n\t{0x5601, 1, &mqc_states[15], &mqc_states[12]},\n\t{0x5401, 0, &mqc_states[16], &mqc_states[28]},\n\t{0x5401, 1, &mqc_states[17], &mqc_states[29]},\n\t{0x4801, 0, &mqc_states[18], &mqc_states[28]},\n\t{0x4801, 1, &mqc_states[19], &mqc_states[29]},\n\t{0x3801, 0, &mqc_states[20], &mqc_states[28]},\n\t{0x3801, 1, &mqc_states[21], &mqc_states[29]},\n\t{0x3001, 0, &mqc_states[22], &mqc_states[34]},\n\t{0x3001, 1, &mqc_states[23], &mqc_states[35]},\n\t{0x2401, 0, &mqc_states[24], &mqc_states[36]},\n\t{0x2401, 1, &mqc_states[25], &mqc_states[37]},\n\t{0x1c01, 0, &mqc_states[26], &mqc_states[40]},\n\t{0x1c01, 1, &mqc_states[27], &mqc_states[41]},\n\t{0x1601, 0, &mqc_states[58], &mqc_states[42]},\n\t{0x1601, 1, &mqc_states[59], &mqc_states[43]},\n\t{0x5601, 0, &mqc_states[30], &mqc_states[29]},\n\t{0x5601, 1, &mqc_states[31], &mqc_states[28]},\n\t{0x5401, 0, &mqc_states[32], &mqc_states[28]},\n\t{0x5401, 1, &mqc_states[33], &mqc_states[29]},\n\t{0x5101, 0, &mqc_states[34], &mqc_states[30]},\n\t{0x5101, 1, &mqc_states[35], &mqc_states[31]},\n\t{0x4801, 0, &mqc_states[36], &mqc_states[32]},\n\t{0x4801, 1, &mqc_states[37], &mqc_states[33]},\n\t{0x3801, 0, &mqc_states[38], &mqc_states[34]},\n\t{0x3801, 1, &mqc_states[39], &mqc_states[35]},\n\t{0x3401, 0, &mqc_states[40], &mqc_states[36]},\n\t{0x3401, 1, &mqc_states[41], &mqc_states[37]},\n\t{0x3001, 0, &mqc_states[42], &mqc_states[38]},\n\t{0x3001, 1, &mqc_states[43], &mqc_states[39]},\n\t{0x2801, 0, &mqc_states[44], &mqc_states[38]},\n\t{0x2801, 1, &mqc_states[45], &mqc_states[39]},\n\t{0x2401, 0, &mqc_states[46], &mqc_states[40]},\n\t{0x2401, 1, &mqc_states[47], &mqc_states[41]},\n\t{0x2201, 0, &mqc_states[48], &mqc_states[42]},\n\t{0x2201, 1, &mqc_states[49], &mqc_states[43]},\n\t{0x1c01, 0, &mqc_states[50], &mqc_states[44]},\n\t{0x1c01, 1, &mqc_states[51], &mqc_states[45]},\n\t{0x1801, 0, &mqc_states[52], &mqc_states[46]},\n\t{0x1801, 1, &mqc_states[53], &mqc_states[47]},\n\t{0x1601, 0, &mqc_states[54], &mqc_states[48]},\n\t{0x1601, 1, &mqc_states[55], &mqc_states[49]},\n\t{0x1401, 0, &mqc_states[56], &mqc_states[50]},\n\t{0x1401, 1, &mqc_states[57], &mqc_states[51]},\n\t{0x1201, 0, &mqc_states[58], &mqc_states[52]},\n\t{0x1201, 1, &mqc_states[59], &mqc_states[53]},\n\t{0x1101, 0, &mqc_states[60], &mqc_states[54]},\n\t{0x1101, 1, &mqc_states[61], &mqc_states[55]},\n\t{0x0ac1, 0, &mqc_states[62], &mqc_states[56]},\n\t{0x0ac1, 1, &mqc_states[63], &mqc_states[57]},\n\t{0x09c1, 0, &mqc_states[64], &mqc_states[58]},\n\t{0x09c1, 1, &mqc_states[65], &mqc_states[59]},\n\t{0x08a1, 0, &mqc_states[66], &mqc_states[60]},\n\t{0x08a1, 1, &mqc_states[67], &mqc_states[61]},\n\t{0x0521, 0, &mqc_states[68], &mqc_states[62]},\n\t{0x0521, 1, &mqc_states[69], &mqc_states[63]},\n\t{0x0441, 0, &mqc_states[70], &mqc_states[64]},\n\t{0x0441, 1, &mqc_states[71], &mqc_states[65]},\n\t{0x02a1, 0, &mqc_states[72], &mqc_states[66]},\n\t{0x02a1, 1, &mqc_states[73], &mqc_states[67]},\n\t{0x0221, 0, &mqc_states[74], &mqc_states[68]},\n\t{0x0221, 1, &mqc_states[75], &mqc_states[69]},\n\t{0x0141, 0, &mqc_states[76], &mqc_states[70]},\n\t{0x0141, 1, &mqc_states[77], &mqc_states[71]},\n\t{0x0111, 0, &mqc_states[78], &mqc_states[72]},\n\t{0x0111, 1, &mqc_states[79], &mqc_states[73]},\n\t{0x0085, 0, &mqc_states[80], &mqc_states[74]},\n\t{0x0085, 1, &mqc_states[81], &mqc_states[75]},\n\t{0x0049, 0, &mqc_states[82], &mqc_states[76]},\n\t{0x0049, 1, &mqc_states[83], &mqc_states[77]},\n\t{0x0025, 0, &mqc_states[84], &mqc_states[78]},\n\t{0x0025, 1, &mqc_states[85], &mqc_states[79]},\n\t{0x0015, 0, &mqc_states[86], &mqc_states[80]},\n\t{0x0015, 1, &mqc_states[87], &mqc_states[81]},\n\t{0x0009, 0, &mqc_states[88], &mqc_states[82]},\n\t{0x0009, 1, &mqc_states[89], &mqc_states[83]},\n\t{0x0005, 0, &mqc_states[90], &mqc_states[84]},\n\t{0x0005, 1, &mqc_states[91], &mqc_states[85]},\n\t{0x0001, 0, &mqc_states[90], &mqc_states[86]},\n\t{0x0001, 1, &mqc_states[91], &mqc_states[87]},\n\t{0x5601, 0, &mqc_states[92], &mqc_states[92]},\n\t{0x5601, 1, &mqc_states[93], &mqc_states[93]},\n};\n\n/* \n==========================================================\n   local functions\n==========================================================\n*/\n\nvoid opj_mqc_byteout(opj_mqc_t *mqc) {\n\tif (*mqc->bp == 0xff) {\n\t\tmqc->bp++;\n\t\t*mqc->bp = (OPJ_BYTE)(mqc->c >> 20);\n\t\tmqc->c &= 0xfffff;\n\t\tmqc->ct = 7;\n\t} else {\n\t\tif ((mqc->c & 0x8000000) == 0) {\t/* ((mqc->c&0x8000000)==0) CHANGE */\n\t\t\tmqc->bp++;\n\t\t\t*mqc->bp = (OPJ_BYTE)(mqc->c >> 19);\n\t\t\tmqc->c &= 0x7ffff;\n\t\t\tmqc->ct = 8;\n\t\t} else {\n\t\t\t(*mqc->bp)++;\n\t\t\tif (*mqc->bp == 0xff) {\n\t\t\t\tmqc->c &= 0x7ffffff;\n\t\t\t\tmqc->bp++;\n\t\t\t\t*mqc->bp = (OPJ_BYTE)(mqc->c >> 20);\n\t\t\t\tmqc->c &= 0xfffff;\n\t\t\t\tmqc->ct = 7;\n\t\t\t} else {\n\t\t\t\tmqc->bp++;\n\t\t\t\t*mqc->bp = (OPJ_BYTE)(mqc->c >> 19);\n\t\t\t\tmqc->c &= 0x7ffff;\n\t\t\t\tmqc->ct = 8;\n\t\t\t}\n\t\t}\n\t}\n}\n\nvoid opj_mqc_renorme(opj_mqc_t *mqc) {\n\tdo {\n\t\tmqc->a <<= 1;\n\t\tmqc->c <<= 1;\n\t\tmqc->ct--;\n\t\tif (mqc->ct == 0) {\n\t\t\topj_mqc_byteout(mqc);\n\t\t}\n\t} while ((mqc->a & 0x8000) == 0);\n}\n\nvoid opj_mqc_codemps(opj_mqc_t *mqc) {\n\tmqc->a -= (*mqc->curctx)->qeval;\n\tif ((mqc->a & 0x8000) == 0) {\n\t\tif (mqc->a < (*mqc->curctx)->qeval) {\n\t\t\tmqc->a = (*mqc->curctx)->qeval;\n\t\t} else {\n\t\t\tmqc->c += (*mqc->curctx)->qeval;\n\t\t}\n\t\t*mqc->curctx = (*mqc->curctx)->nmps;\n\t\topj_mqc_renorme(mqc);\n\t} else {\n\t\tmqc->c += (*mqc->curctx)->qeval;\n\t}\n}\n\nvoid opj_mqc_codelps(opj_mqc_t *mqc) {\n\tmqc->a -= (*mqc->curctx)->qeval;\n\tif (mqc->a < (*mqc->curctx)->qeval) {\n\t\tmqc->c += (*mqc->curctx)->qeval;\n\t} else {\n\t\tmqc->a = (*mqc->curctx)->qeval;\n\t}\n\t*mqc->curctx = (*mqc->curctx)->nlps;\n\topj_mqc_renorme(mqc);\n}\n\nvoid opj_mqc_setbits(opj_mqc_t *mqc) {\n\tOPJ_UINT32 tempc = mqc->c + mqc->a;\n\tmqc->c |= 0xffff;\n\tif (mqc->c >= tempc) {\n\t\tmqc->c -= 0x8000;\n\t}\n}\n\nstatic INLINE OPJ_INT32 opj_mqc_mpsexchange(opj_mqc_t *const mqc) {\n\tOPJ_INT32 d;\n\tif (mqc->a < (*mqc->curctx)->qeval) {\n\t\td = (OPJ_INT32)(1 - (*mqc->curctx)->mps);\n\t\t*mqc->curctx = (*mqc->curctx)->nlps;\n\t} else {\n\t\td = (OPJ_INT32)(*mqc->curctx)->mps;\n\t\t*mqc->curctx = (*mqc->curctx)->nmps;\n\t}\n\t\n\treturn d;\n}\n\nstatic INLINE OPJ_INT32 opj_mqc_lpsexchange(opj_mqc_t *const mqc) {\n\tOPJ_INT32 d;\n\tif (mqc->a < (*mqc->curctx)->qeval) {\n\t\tmqc->a = (*mqc->curctx)->qeval;\n\t\td = (OPJ_INT32)(*mqc->curctx)->mps;\n\t\t*mqc->curctx = (*mqc->curctx)->nmps;\n\t} else {\n\t\tmqc->a = (*mqc->curctx)->qeval;\n\t\td = (OPJ_INT32)(1 - (*mqc->curctx)->mps);\n\t\t*mqc->curctx = (*mqc->curctx)->nlps;\n\t}\n\t\n\treturn d;\n}\n\n#ifdef MQC_PERF_OPT\nstatic INLINE void opj_mqc_bytein(opj_mqc_t *const mqc) {\n\tunsigned int i = *((unsigned int *) mqc->bp);\n\tmqc->c += i & 0xffff00;\n\tmqc->ct = i & 0x0f;\n\tmqc->bp += (i >> 2) & 0x04;\n}\n#else\nstatic void opj_mqc_bytein(opj_mqc_t *const mqc) {\n\tif (mqc->bp != mqc->end) {\n\t\tOPJ_UINT32 c;\n\t\tif (mqc->bp + 1 != mqc->end) {\n\t\t\tc = *(mqc->bp + 1);\n\t\t} else {\n\t\t\tc = 0xff;\n\t\t}\n\t\tif (*mqc->bp == 0xff) {\n\t\t\tif (c > 0x8f) {\n\t\t\t\tmqc->c += 0xff00;\n\t\t\t\tmqc->ct = 8;\n\t\t\t} else {\n\t\t\t\tmqc->bp++;\n\t\t\t\tmqc->c += c << 9;\n\t\t\t\tmqc->ct = 7;\n\t\t\t}\n\t\t} else {\n\t\t\tmqc->bp++;\n\t\t\tmqc->c += c << 8;\n\t\t\tmqc->ct = 8;\n\t\t}\n\t} else {\n\t\tmqc->c += 0xff00;\n\t\tmqc->ct = 8;\n\t}\n}\n#endif\n\nstatic INLINE void opj_mqc_renormd(opj_mqc_t *const mqc) {\n\tdo {\n\t\tif (mqc->ct == 0) {\n\t\t\topj_mqc_bytein(mqc);\n\t\t}\n\t\tmqc->a <<= 1;\n\t\tmqc->c <<= 1;\n\t\tmqc->ct--;\n\t} while (mqc->a < 0x8000);\n}\n\n/* \n==========================================================\n   MQ-Coder interface\n==========================================================\n*/\n\nopj_mqc_t* opj_mqc_create(void) {\n\topj_mqc_t *mqc = (opj_mqc_t*)opj_malloc(sizeof(opj_mqc_t));\n#ifdef MQC_PERF_OPT\n\tmqc->buffer = NULL;\n#endif\n\treturn mqc;\n}\n\nvoid opj_mqc_destroy(opj_mqc_t *mqc) {\n\tif(mqc) {\n#ifdef MQC_PERF_OPT\n\t\topj_free(mqc->buffer);\n#endif\n\t\topj_free(mqc);\n\t}\n}\n\nOPJ_UINT32 opj_mqc_numbytes(opj_mqc_t *mqc) {\n\tconst ptrdiff_t diff = mqc->bp - mqc->start;\n#if 0\n  assert( diff <= 0xffffffff && diff >= 0 ); /* UINT32_MAX */\n#endif\n\treturn (OPJ_UINT32)diff;\n}\n\nvoid opj_mqc_init_enc(opj_mqc_t *mqc, OPJ_BYTE *bp) {\n    /* TODO MSD: need to take a look to the v2 version */\n\topj_mqc_setcurctx(mqc, 0);\n\tmqc->a = 0x8000;\n\tmqc->c = 0;\n\tmqc->bp = bp - 1;\n\tmqc->ct = 12;\n\tif (*mqc->bp == 0xff) {\n\t\tmqc->ct = 13;\n\t}\n\tmqc->start = bp;\n}\n\nvoid opj_mqc_encode(opj_mqc_t *mqc, OPJ_UINT32 d) {\n\tif ((*mqc->curctx)->mps == d) {\n\t\topj_mqc_codemps(mqc);\n\t} else {\n\t\topj_mqc_codelps(mqc);\n\t}\n}\n\nvoid opj_mqc_flush(opj_mqc_t *mqc) {\n\topj_mqc_setbits(mqc);\n\tmqc->c <<= mqc->ct;\n\topj_mqc_byteout(mqc);\n\tmqc->c <<= mqc->ct;\n\topj_mqc_byteout(mqc);\n\t\n\tif (*mqc->bp != 0xff) {\n\t\tmqc->bp++;\n\t}\n}\n\nvoid opj_mqc_bypass_init_enc(opj_mqc_t *mqc) {\n\tmqc->c = 0;\n\tmqc->ct = 8;\n\t/*if (*mqc->bp == 0xff) {\n\tmqc->ct = 7;\n     } */\n}\n\nvoid opj_mqc_bypass_enc(opj_mqc_t *mqc, OPJ_UINT32 d) {\n\tmqc->ct--;\n\tmqc->c = mqc->c + (d << mqc->ct);\n\tif (mqc->ct == 0) {\n\t\tmqc->bp++;\n\t\t*mqc->bp = (OPJ_BYTE)mqc->c;\n\t\tmqc->ct = 8;\n\t\tif (*mqc->bp == 0xff) {\n\t\t\tmqc->ct = 7;\n\t\t}\n\t\tmqc->c = 0;\n\t}\n}\n\nOPJ_UINT32 opj_mqc_bypass_flush_enc(opj_mqc_t *mqc) {\n\tOPJ_BYTE bit_padding;\n\t\n\tbit_padding = 0;\n\t\n\tif (mqc->ct != 0) {\n\t\twhile (mqc->ct > 0) {\n\t\t\tmqc->ct--;\n\t\t\tmqc->c += (OPJ_UINT32)(bit_padding << mqc->ct);\n\t\t\tbit_padding = (bit_padding + 1) & 0x01;\n\t\t}\n\t\tmqc->bp++;\n\t\t*mqc->bp = (OPJ_BYTE)mqc->c;\n\t\tmqc->ct = 8;\n\t\tmqc->c = 0;\n\t}\n\t\n\treturn 1;\n}\n\nvoid opj_mqc_reset_enc(opj_mqc_t *mqc) {\n\topj_mqc_resetstates(mqc);\n\topj_mqc_setstate(mqc, T1_CTXNO_UNI, 0, 46);\n\topj_mqc_setstate(mqc, T1_CTXNO_AGG, 0, 3);\n\topj_mqc_setstate(mqc, T1_CTXNO_ZC, 0, 4);\n}\n\nOPJ_UINT32 opj_mqc_restart_enc(opj_mqc_t *mqc) {\n\tOPJ_UINT32 correction = 1;\n\t\n\t/* <flush part> */\n\tOPJ_INT32 n = (OPJ_INT32)(27 - 15 - mqc->ct);\n\tmqc->c <<= mqc->ct;\n\twhile (n > 0) {\n\t\topj_mqc_byteout(mqc);\n\t\tn -= (OPJ_INT32)mqc->ct;\n\t\tmqc->c <<= mqc->ct;\n\t}\n\topj_mqc_byteout(mqc);\n\t\n\treturn correction;\n}\n\nvoid opj_mqc_restart_init_enc(opj_mqc_t *mqc) {\n\t/* <Re-init part> */\n\topj_mqc_setcurctx(mqc, 0);\n\tmqc->a = 0x8000;\n\tmqc->c = 0;\n\tmqc->ct = 12;\n\tmqc->bp--;\n\tif (*mqc->bp == 0xff) {\n\t\tmqc->ct = 13;\n\t}\n}\n\nvoid opj_mqc_erterm_enc(opj_mqc_t *mqc) {\n\tOPJ_INT32 k = (OPJ_INT32)(11 - mqc->ct + 1);\n\t\n\twhile (k > 0) {\n\t\tmqc->c <<= mqc->ct;\n\t\tmqc->ct = 0;\n\t\topj_mqc_byteout(mqc);\n\t\tk -= (OPJ_INT32)mqc->ct;\n\t}\n\t\n\tif (*mqc->bp != 0xff) {\n\t\topj_mqc_byteout(mqc);\n\t}\n}\n\nvoid opj_mqc_segmark_enc(opj_mqc_t *mqc) {\n\tOPJ_UINT32 i;\n\topj_mqc_setcurctx(mqc, 18);\n\t\n\tfor (i = 1; i < 5; i++) {\n\t\topj_mqc_encode(mqc, i % 2);\n\t}\n}\n\nOPJ_BOOL opj_mqc_init_dec(opj_mqc_t *mqc, OPJ_BYTE *bp, OPJ_UINT32 len) {\n\topj_mqc_setcurctx(mqc, 0);\n\tmqc->start = bp;\n\tmqc->end = bp + len;\n\tmqc->bp = bp;\n\tif (len==0) mqc->c = 0xff << 16;\n\telse mqc->c = (OPJ_UINT32)(*mqc->bp << 16);\n\n#ifdef MQC_PERF_OPT /* TODO_MSD: check this option and put in experimental */\n\t{\n        OPJ_UINT32 c;\n\t\tOPJ_UINT32 *ip;\n\t\tOPJ_BYTE *end = mqc->end - 1;\n        void* new_buffer = opj_realloc(mqc->buffer, (len + 1) * sizeof(OPJ_UINT32));\n        if (! new_buffer) {\n            opj_free(mqc->buffer);\n            mqc->buffer = NULL;\n            return OPJ_FALSE;\n        }\n        mqc->buffer = new_buffer;\n\t\t\n        ip = (OPJ_UINT32 *) mqc->buffer;\n\n\t\twhile (bp < end) {\n\t\t\tc = *(bp + 1);\n\t\t\tif (*bp == 0xff) {\n\t\t\t\tif (c > 0x8f) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t*ip = 0x00000017 | (c << 9);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t*ip = 0x00000018 | (c << 8);\n\t\t\t}\n\t\t\tbp++;\n\t\t\tip++;\n\t\t}\n\n\t\t/* Handle last byte of data */\n\t\tc = 0xff;\n\t\tif (*bp == 0xff) {\n\t\t\t*ip = 0x0000ff18;\n\t\t} else {\n\t\t\tbp++;\n\t\t\t*ip = 0x00000018 | (c << 8);\n\t\t}\n\t\tip++;\n\n\t\t*ip = 0x0000ff08;\n\t\tmqc->bp = mqc->buffer;\n\t}\n#endif\n\topj_mqc_bytein(mqc);\n\tmqc->c <<= 7;\n\tmqc->ct -= 7;\n\tmqc->a = 0x8000;\n        return OPJ_TRUE;\n}\n\nOPJ_INT32 opj_mqc_decode(opj_mqc_t *const mqc) {\n\tOPJ_INT32 d;\n\tmqc->a -= (*mqc->curctx)->qeval;\n\tif ((mqc->c >> 16) < (*mqc->curctx)->qeval) {\n\t\td = opj_mqc_lpsexchange(mqc);\n\t\topj_mqc_renormd(mqc);\n\t} else {\n\t\tmqc->c -= (*mqc->curctx)->qeval << 16;\n\t\tif ((mqc->a & 0x8000) == 0) {\n\t\t\td = opj_mqc_mpsexchange(mqc);\n\t\t\topj_mqc_renormd(mqc);\n\t\t} else {\n\t\t\td = (OPJ_INT32)(*mqc->curctx)->mps;\n\t\t}\n\t}\n\n\treturn d;\n}\n\nvoid opj_mqc_resetstates(opj_mqc_t *mqc) {\n\tOPJ_UINT32 i;\n\tfor (i = 0; i < MQC_NUMCTXS; i++) {\n\t\tmqc->ctxs[i] = mqc_states;\n\t}\n}\n\nvoid opj_mqc_setstate(opj_mqc_t *mqc, OPJ_UINT32 ctxno, OPJ_UINT32 msb, OPJ_INT32 prob) {\n\tmqc->ctxs[ctxno] = &mqc_states[msb + (OPJ_UINT32)(prob << 1)];\n}\n\n\n"
  },
  {
    "path": "ext/openjpeg/mqc.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef __MQC_H\n#define __MQC_H\n/**\n@file mqc.h\n@brief Implementation of an MQ-Coder (MQC)\n\nThe functions in MQC.C have for goal to realize the MQ-coder operations. The functions\nin MQC.C are used by some function in T1.C.\n*/\n\n/** @defgroup MQC MQC - Implementation of an MQ-Coder */\n/*@{*/\n\n/**\nThis struct defines the state of a context.\n*/\ntypedef struct opj_mqc_state {\n\t/** the probability of the Least Probable Symbol (0.75->0x8000, 1.5->0xffff) */\n\tOPJ_UINT32 qeval;\n\t/** the Most Probable Symbol (0 or 1) */\n\tOPJ_UINT32 mps;\n\t/** next state if the next encoded symbol is the MPS */\n\tstruct opj_mqc_state *nmps;\n\t/** next state if the next encoded symbol is the LPS */\n\tstruct opj_mqc_state *nlps;\n} opj_mqc_state_t;\n\n#define MQC_NUMCTXS 19\n\n/**\nMQ coder\n*/\ntypedef struct opj_mqc {\n\tOPJ_UINT32 c;\n\tOPJ_UINT32 a;\n\tOPJ_UINT32 ct;\n\tOPJ_BYTE *bp;\n\tOPJ_BYTE *start;\n\tOPJ_BYTE *end;\n\topj_mqc_state_t *ctxs[MQC_NUMCTXS];\n\topj_mqc_state_t **curctx;\n#ifdef MQC_PERF_OPT\n\tunsigned char *buffer;\n#endif\n} opj_mqc_t;\n\n/** @name Exported functions */\n/*@{*/\n/* ----------------------------------------------------------------------- */\n/**\nCreate a new MQC handle \n@return Returns a new MQC handle if successful, returns NULL otherwise\n*/\nopj_mqc_t* opj_mqc_create(void);\n/**\nDestroy a previously created MQC handle\n@param mqc MQC handle to destroy\n*/\nvoid opj_mqc_destroy(opj_mqc_t *mqc);\n/**\nReturn the number of bytes written/read since initialisation\n@param mqc MQC handle\n@return Returns the number of bytes already encoded\n*/\nOPJ_UINT32 opj_mqc_numbytes(opj_mqc_t *mqc);\n/**\nReset the states of all the context of the coder/decoder \n(each context is set to a state where 0 and 1 are more or less equiprobable)\n@param mqc MQC handle\n*/\nvoid opj_mqc_resetstates(opj_mqc_t *mqc);\n/**\nSet the state of a particular context\n@param mqc MQC handle\n@param ctxno Number that identifies the context\n@param msb The MSB of the new state of the context\n@param prob Number that identifies the probability of the symbols for the new state of the context\n*/\nvoid opj_mqc_setstate(opj_mqc_t *mqc, OPJ_UINT32 ctxno, OPJ_UINT32 msb, OPJ_INT32 prob);\n/**\nInitialize the encoder\n@param mqc MQC handle\n@param bp Pointer to the start of the buffer where the bytes will be written\n*/\nvoid opj_mqc_init_enc(opj_mqc_t *mqc, OPJ_BYTE *bp);\n/**\nSet the current context used for coding/decoding\n@param mqc MQC handle\n@param ctxno Number that identifies the context\n*/\n#define opj_mqc_setcurctx(mqc, ctxno)\t(mqc)->curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]\n/**\nEncode a symbol using the MQ-coder\n@param mqc MQC handle\n@param d The symbol to be encoded (0 or 1)\n*/\nvoid opj_mqc_encode(opj_mqc_t *mqc, OPJ_UINT32 d);\n/**\nFlush the encoder, so that all remaining data is written\n@param mqc MQC handle\n*/\nvoid opj_mqc_flush(opj_mqc_t *mqc);\n/**\nBYPASS mode switch, initialization operation. \nJPEG 2000 p 505. \n<h2>Not fully implemented and tested !!</h2>\n@param mqc MQC handle\n*/\nvoid opj_mqc_bypass_init_enc(opj_mqc_t *mqc);\n/**\nBYPASS mode switch, coding operation. \nJPEG 2000 p 505. \n<h2>Not fully implemented and tested !!</h2>\n@param mqc MQC handle\n@param d The symbol to be encoded (0 or 1)\n*/\nvoid opj_mqc_bypass_enc(opj_mqc_t *mqc, OPJ_UINT32 d);\n/**\nBYPASS mode switch, flush operation\n<h2>Not fully implemented and tested !!</h2>\n@param mqc MQC handle\n@return Returns 1 (always)\n*/\nOPJ_UINT32 opj_mqc_bypass_flush_enc(opj_mqc_t *mqc);\n/**\nRESET mode switch\n@param mqc MQC handle\n*/\nvoid opj_mqc_reset_enc(opj_mqc_t *mqc);\n/**\nRESTART mode switch (TERMALL)\n@param mqc MQC handle\n@return Returns 1 (always)\n*/\nOPJ_UINT32 opj_mqc_restart_enc(opj_mqc_t *mqc);\n/**\nRESTART mode switch (TERMALL) reinitialisation\n@param mqc MQC handle\n*/\nvoid opj_mqc_restart_init_enc(opj_mqc_t *mqc);\n/**\nERTERM mode switch (PTERM)\n@param mqc MQC handle\n*/\nvoid opj_mqc_erterm_enc(opj_mqc_t *mqc);\n/**\nSEGMARK mode switch (SEGSYM)\n@param mqc MQC handle\n*/\nvoid opj_mqc_segmark_enc(opj_mqc_t *mqc);\n/**\nInitialize the decoder\n@param mqc MQC handle\n@param bp Pointer to the start of the buffer from which the bytes will be read\n@param len Length of the input buffer\n*/\nOPJ_BOOL opj_mqc_init_dec(opj_mqc_t *mqc, OPJ_BYTE *bp, OPJ_UINT32 len);\n/**\nDecode a symbol\n@param mqc MQC handle\n@return Returns the decoded symbol (0 or 1)\n*/\nOPJ_INT32 opj_mqc_decode(opj_mqc_t * const mqc);\n/* ----------------------------------------------------------------------- */\n/*@}*/\n\n/*@}*/\n\n#endif /* __MQC_H */\n"
  },
  {
    "path": "ext/openjpeg/openjpeg.c",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR \n * Copyright (c) 2012, CS Systemes d'Information, France\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifdef _WIN32\n#include <windows.h>\n#endif /* _WIN32 */\n\n#include \"opj_includes.h\"\n\n\n/* ---------------------------------------------------------------------- */\n/* Functions to set the message handlers */\n\nOPJ_BOOL OPJ_CALLCONV opj_set_info_handler(\topj_codec_t * p_codec, \n\t\t\t\t\t\t\t\t\t\t\topj_msg_callback p_callback,\n\t\t\t\t\t\t\t\t\t\t\tvoid * p_user_data)\n{\n\topj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;\n\tif(! l_codec){\n\t\treturn OPJ_FALSE;\n\t}\n\t\n\tl_codec->m_event_mgr.info_handler = p_callback;\n\tl_codec->m_event_mgr.m_info_data = p_user_data;\n\t\n\treturn OPJ_TRUE;\n}\n\nOPJ_BOOL OPJ_CALLCONV opj_set_warning_handler(\topj_codec_t * p_codec, \n\t\t\t\t\t\t\t\t\t\t\t\topj_msg_callback p_callback,\n\t\t\t\t\t\t\t\t\t\t\t\tvoid * p_user_data)\n{\n\topj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;\n\tif (! l_codec) {\n\t\treturn OPJ_FALSE;\n\t}\n\t\n\tl_codec->m_event_mgr.warning_handler = p_callback;\n\tl_codec->m_event_mgr.m_warning_data = p_user_data;\n\t\n\treturn OPJ_TRUE;\n}\n\nOPJ_BOOL OPJ_CALLCONV opj_set_error_handler(opj_codec_t * p_codec, \n\t\t\t\t\t\t\t\t\t\t\topj_msg_callback p_callback,\n\t\t\t\t\t\t\t\t\t\t\tvoid * p_user_data)\n{\n\topj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;\n\tif (! l_codec) {\n\t\treturn OPJ_FALSE;\n\t}\n\t\n\tl_codec->m_event_mgr.error_handler = p_callback;\n\tl_codec->m_event_mgr.m_error_data = p_user_data;\n\t\n\treturn OPJ_TRUE;\n}\n\n/* ---------------------------------------------------------------------- */\n\nstatic OPJ_SIZE_T opj_read_from_file (void * p_buffer, OPJ_SIZE_T p_nb_bytes, FILE * p_file)\n{\n\tOPJ_SIZE_T l_nb_read = fread(p_buffer,1,p_nb_bytes,p_file);\n\treturn l_nb_read ? l_nb_read : (OPJ_SIZE_T)-1;\n}\n\nstatic OPJ_UINT64 opj_get_data_length_from_file (FILE * p_file)\n{\n\tOPJ_OFF_T file_length = 0;\n\n\tOPJ_FSEEK(p_file, 0, SEEK_END);\n\tfile_length = (OPJ_OFF_T)OPJ_FTELL(p_file);\n\tOPJ_FSEEK(p_file, 0, SEEK_SET);\n\n\treturn (OPJ_UINT64)file_length;\n}\n\nstatic OPJ_SIZE_T opj_write_from_file (void * p_buffer, OPJ_SIZE_T p_nb_bytes, FILE * p_file)\n{\n\treturn fwrite(p_buffer,1,p_nb_bytes,p_file);\n}\n\nstatic OPJ_OFF_T opj_skip_from_file (OPJ_OFF_T p_nb_bytes, FILE * p_user_data)\n{\n\tif (OPJ_FSEEK(p_user_data,p_nb_bytes,SEEK_CUR)) {\n\t\treturn -1;\n\t}\n\n\treturn p_nb_bytes;\n}\n\nstatic OPJ_BOOL opj_seek_from_file (OPJ_OFF_T p_nb_bytes, FILE * p_user_data)\n{\n\tif (OPJ_FSEEK(p_user_data,p_nb_bytes,SEEK_SET)) {\n\t\treturn OPJ_FALSE;\n\t}\n\n\treturn OPJ_TRUE;\n}\n\n/* ---------------------------------------------------------------------- */\n#ifdef _WIN32\n#ifndef OPJ_STATIC\nBOOL APIENTRY\nDllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {\n\n\tOPJ_ARG_NOT_USED(lpReserved);\n\tOPJ_ARG_NOT_USED(hModule);\n\n\tswitch (ul_reason_for_call) {\n\t\tcase DLL_PROCESS_ATTACH :\n\t\t\tbreak;\n\t\tcase DLL_PROCESS_DETACH :\n\t\t\tbreak;\n\t\tcase DLL_THREAD_ATTACH :\n\t\tcase DLL_THREAD_DETACH :\n\t\t\tbreak;\n    }\n\n    return TRUE;\n}\n#endif /* OPJ_STATIC */\n#endif /* _WIN32 */\n\n/* ---------------------------------------------------------------------- */\n\nconst char* OPJ_CALLCONV opj_version(void) {\n    return OPJ_PACKAGE_VERSION;\n}\n\n/* ---------------------------------------------------------------------- */\n/* DECOMPRESSION FUNCTIONS*/\n\nopj_codec_t* OPJ_CALLCONV opj_create_decompress(OPJ_CODEC_FORMAT p_format)\n{\n\topj_codec_private_t *l_codec = 00;\n\n\tl_codec = (opj_codec_private_t*) opj_calloc(1, sizeof(opj_codec_private_t));\n\tif (!l_codec){\n\t\treturn 00;\n\t}\n\tmemset(l_codec, 0, sizeof(opj_codec_private_t));\n\n\tl_codec->is_decompressor = 1;\n\n\tswitch (p_format) {\n\t\tcase OPJ_CODEC_J2K:\n\t\t\tl_codec->opj_dump_codec = (void (*) (void*, OPJ_INT32, FILE*)) j2k_dump;\n\n\t\t\tl_codec->opj_get_codec_info = (opj_codestream_info_v2_t* (*) (void*) ) j2k_get_cstr_info;\n\n\t\t\tl_codec->opj_get_codec_index = (opj_codestream_index_t* (*) (void*) ) j2k_get_cstr_index;\n\n\t\t\tl_codec->m_codec_data.m_decompression.opj_decode =\n\t\t\t\t\t(OPJ_BOOL (*) (\tvoid *,\n\t\t\t\t\t\t\t\t\tstruct opj_stream_private *,\n\t\t\t\t\t\t\t\t\topj_image_t*, struct opj_event_mgr * )) opj_j2k_decode;\n\n\t\t\tl_codec->m_codec_data.m_decompression.opj_end_decompress =\n\t\t\t\t\t(OPJ_BOOL (*) (\tvoid *,\n\t\t\t\t\t\t\t\t\tstruct opj_stream_private *,\n\t\t\t\t\t\t\t\t\tstruct opj_event_mgr *)) opj_j2k_end_decompress;\n\n\t\t\tl_codec->m_codec_data.m_decompression.opj_read_header =\n\t\t\t\t\t(OPJ_BOOL (*) (\tstruct opj_stream_private *,\n\t\t\t\t\t\t\t\t\tvoid *,\n\t\t\t\t\t\t\t\t\topj_image_t **,\n\t\t\t\t\t\t\t\t\tstruct opj_event_mgr * )) opj_j2k_read_header;\n\n\t\t\tl_codec->m_codec_data.m_decompression.opj_destroy =\n\t\t\t\t\t(void (*) (void *))opj_j2k_destroy;\n\n\t\t\tl_codec->m_codec_data.m_decompression.opj_setup_decoder =\n\t\t\t\t\t(void (*) (void * , opj_dparameters_t * )) opj_j2k_setup_decoder;\n\n\t\t\tl_codec->m_codec_data.m_decompression.opj_read_tile_header =\n\t\t\t\t\t(OPJ_BOOL (*) (\tvoid *,\n\t\t\t\t\t\t\t\t\tOPJ_UINT32*,\n\t\t\t\t\t\t\t\t\tOPJ_UINT32*,\n\t\t\t\t\t\t\t\t\tOPJ_INT32*, OPJ_INT32*,\n\t\t\t\t\t\t\t\t\tOPJ_INT32*, OPJ_INT32*,\n\t\t\t\t\t\t\t\t\tOPJ_UINT32*,\n\t\t\t\t\t\t\t\t\tOPJ_BOOL*,\n\t\t\t\t\t\t\t\t\tstruct opj_stream_private *,\n\t\t\t\t\t\t\t\t\tstruct opj_event_mgr * )) opj_j2k_read_tile_header;\n\n\t\t\tl_codec->m_codec_data.m_decompression.opj_decode_tile_data =\n\t\t\t\t\t(OPJ_BOOL (*) ( void *, \n                                    OPJ_UINT32, \n                                    OPJ_BYTE*, \n                                    OPJ_UINT32, \n                                    struct opj_stream_private *,\n                                    struct opj_event_mgr *)) opj_j2k_decode_tile;\n\n\t\t\tl_codec->m_codec_data.m_decompression.opj_set_decode_area =\n\t\t\t\t\t(OPJ_BOOL (*) ( void *, \n                                    opj_image_t*, \n                                    OPJ_INT32, OPJ_INT32, OPJ_INT32, OPJ_INT32, \n                                    struct opj_event_mgr *)) opj_j2k_set_decode_area;\n\n\t\t\tl_codec->m_codec_data.m_decompression.opj_get_decoded_tile = \n                    (OPJ_BOOL (*) ( void *p_codec,\n\t\t\t\t\t\t\t\t    opj_stream_private_t *p_cio,\n\t\t\t\t\t\t\t\t    opj_image_t *p_image,\n\t\t\t\t\t\t\t\t    struct opj_event_mgr * p_manager,\n\t\t\t\t\t\t\t\t    OPJ_UINT32 tile_index)) opj_j2k_get_tile;\n\n\t\t\tl_codec->m_codec_data.m_decompression.opj_set_decoded_resolution_factor = \n                    (OPJ_BOOL (*) ( void * p_codec,\n\t\t\t\t\t\t\t\t\tOPJ_UINT32 res_factor,\n\t\t\t\t\t\t\t\t\tstruct opj_event_mgr * p_manager)) opj_j2k_set_decoded_resolution_factor;\n\n\t\t\tl_codec->m_codec = opj_j2k_create_decompress();\n\n\t\t\tif (! l_codec->m_codec) {\n\t\t\t\topj_free(l_codec);\n\t\t\t\treturn NULL;\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase OPJ_CODEC_JP2:\n\t\t\t/* get a JP2 decoder handle */\n\t\t\tl_codec->opj_dump_codec = (void (*) (void*, OPJ_INT32, FILE*)) jp2_dump;\n\n\t\t\tl_codec->opj_get_codec_info = (opj_codestream_info_v2_t* (*) (void*) ) jp2_get_cstr_info;\n\n\t\t\tl_codec->opj_get_codec_index = (opj_codestream_index_t* (*) (void*) ) jp2_get_cstr_index;\n\n\t\t\tl_codec->m_codec_data.m_decompression.opj_decode =\n\t\t\t\t\t(OPJ_BOOL (*) (\tvoid *,\n\t\t\t\t\t\t\t\t\tstruct opj_stream_private *,\n\t\t\t\t\t\t\t\t\topj_image_t*,\n\t\t\t\t\t\t\t\t\tstruct opj_event_mgr * )) opj_jp2_decode;\n\n\t\t\tl_codec->m_codec_data.m_decompression.opj_end_decompress =  \n                    (OPJ_BOOL (*) ( void *,\n                                    struct opj_stream_private *,\n                                    struct opj_event_mgr *)) opj_jp2_end_decompress;\n\n\t\t\tl_codec->m_codec_data.m_decompression.opj_read_header =  \n                    (OPJ_BOOL (*) ( struct opj_stream_private *,\n\t\t\t\t\t                void *,\n\t\t\t\t\t                opj_image_t **,\n\t\t\t\t\t                struct opj_event_mgr * )) opj_jp2_read_header;\n\n\t\t\tl_codec->m_codec_data.m_decompression.opj_read_tile_header = \n                    (OPJ_BOOL (*) ( void *,\n\t\t\t\t\t                OPJ_UINT32*,\n\t\t\t\t\t                OPJ_UINT32*,\n\t\t\t\t\t                OPJ_INT32*,\n\t\t\t\t\t                OPJ_INT32*,\n\t\t\t\t\t                OPJ_INT32 * ,\n\t\t\t\t\t                OPJ_INT32 * ,\n\t\t\t\t\t                OPJ_UINT32 * ,\n\t\t\t\t\t                OPJ_BOOL *,\n\t\t\t\t\t                struct opj_stream_private *,\n\t\t\t\t\t                struct opj_event_mgr * )) opj_jp2_read_tile_header;\n\n\t\t\tl_codec->m_codec_data.m_decompression.opj_decode_tile_data = \n                    (OPJ_BOOL (*) ( void *,\n                                    OPJ_UINT32,OPJ_BYTE*,OPJ_UINT32,\n                                    struct opj_stream_private *,\n                                    struct opj_event_mgr * )) opj_jp2_decode_tile;\n\n\t\t\tl_codec->m_codec_data.m_decompression.opj_destroy = (void (*) (void *))opj_jp2_destroy;\n\n\t\t\tl_codec->m_codec_data.m_decompression.opj_setup_decoder = \n                    (void (*) (void * ,opj_dparameters_t * )) opj_jp2_setup_decoder;\n\n\t\t\tl_codec->m_codec_data.m_decompression.opj_set_decode_area = \n                    (OPJ_BOOL (*) ( void *,\n                                    opj_image_t*, \n                                    OPJ_INT32,OPJ_INT32,OPJ_INT32,OPJ_INT32,\n                                    struct opj_event_mgr * )) opj_jp2_set_decode_area;\n\n\t\t\tl_codec->m_codec_data.m_decompression.opj_get_decoded_tile = \n                    (OPJ_BOOL (*) ( void *p_codec,\n\t\t\t\t\t\t\t\t\topj_stream_private_t *p_cio,\n\t\t\t\t\t\t\t\t\topj_image_t *p_image,\n\t\t\t\t\t\t\t\t\tstruct opj_event_mgr * p_manager,\n\t\t\t\t\t\t\t\t\tOPJ_UINT32 tile_index)) opj_jp2_get_tile;\n\n\t\t\tl_codec->m_codec_data.m_decompression.opj_set_decoded_resolution_factor = \n                    (OPJ_BOOL (*) ( void * p_codec,\n\t\t\t\t\t\t    \t\tOPJ_UINT32 res_factor,\n\t\t\t\t\t\t\t    \topj_event_mgr_t * p_manager)) opj_jp2_set_decoded_resolution_factor;\n\n\t\t\tl_codec->m_codec = opj_jp2_create(OPJ_TRUE);\n\n\t\t\tif (! l_codec->m_codec) {\n\t\t\t\topj_free(l_codec);\n\t\t\t\treturn 00;\n\t\t\t}\n\n\t\t\tbreak;\n\t\tcase OPJ_CODEC_UNKNOWN:\n\t\tcase OPJ_CODEC_JPT:\n\t\tdefault:\n\t\t\topj_free(l_codec);\n\t\t\treturn 00;\n\t}\n\n\topj_set_default_event_handler(&(l_codec->m_event_mgr));\n\treturn (opj_codec_t*) l_codec;\n}\n\nvoid OPJ_CALLCONV opj_set_default_decoder_parameters(opj_dparameters_t *parameters) {\n\tif(parameters) {\n\t\tmemset(parameters, 0, sizeof(opj_dparameters_t));\n\t\t/* default decoding parameters */\n\t\tparameters->cp_layer = 0;\n\t\tparameters->cp_reduce = 0;\n\n\t\tparameters->decod_format = -1;\n\t\tparameters->cod_format = -1;\n\t\tparameters->flags = 0;\t\t\n/* UniPG>> */\n#ifdef USE_JPWL\n\t\tparameters->jpwl_correct = OPJ_FALSE;\n\t\tparameters->jpwl_exp_comps = JPWL_EXPECTED_COMPONENTS;\n\t\tparameters->jpwl_max_tiles = JPWL_MAXIMUM_TILES;\n#endif /* USE_JPWL */\n/* <<UniPG */\n\t}\n}\n\nOPJ_BOOL OPJ_CALLCONV opj_setup_decoder(opj_codec_t *p_codec,\n                                        opj_dparameters_t *parameters \n\t\t\t\t\t\t\t\t\t\t)\n{\n\tif (p_codec && parameters) { \n\t\topj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;\n\n\t\tif (! l_codec->is_decompressor) {\n\t\t\topj_event_msg(&(l_codec->m_event_mgr), EVT_ERROR, \n                \"Codec provided to the opj_setup_decoder function is not a decompressor handler.\\n\");\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\n\t\tl_codec->m_codec_data.m_decompression.opj_setup_decoder(l_codec->m_codec,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tparameters);\n\t\treturn OPJ_TRUE;\n\t}\n\treturn OPJ_FALSE;\n}\n\nOPJ_BOOL OPJ_CALLCONV opj_read_header (\topj_stream_t *p_stream,\n\t\t\t\t\t\t\t\t\t\topj_codec_t *p_codec,\n\t\t\t\t\t\t\t\t\t\topj_image_t **p_image )\n{\n\tif (p_codec && p_stream) {\n\t\topj_codec_private_t* l_codec = (opj_codec_private_t*) p_codec;\n\t\topj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;\n\n\t\tif(! l_codec->is_decompressor) {\n\t\t\topj_event_msg(&(l_codec->m_event_mgr), EVT_ERROR, \n                \"Codec provided to the opj_read_header function is not a decompressor handler.\\n\");\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\n\t\treturn l_codec->m_codec_data.m_decompression.opj_read_header(\tl_stream,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tl_codec->m_codec,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_image,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&(l_codec->m_event_mgr) );\n\t}\n\n\treturn OPJ_FALSE;\n}\n\nOPJ_BOOL OPJ_CALLCONV opj_decode(   opj_codec_t *p_codec,\n                                    opj_stream_t *p_stream,\n                                    opj_image_t* p_image)\n{\n\tif (p_codec && p_stream) {\n\t\topj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;\n\t\topj_stream_private_t * l_stream = (opj_stream_private_t *) p_stream;\n\n\t\tif (! l_codec->is_decompressor) {\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\n\t\treturn l_codec->m_codec_data.m_decompression.opj_decode(l_codec->m_codec,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tl_stream,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_image,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&(l_codec->m_event_mgr) );\n\t}\n\n\treturn OPJ_FALSE;\n}\n\nOPJ_BOOL OPJ_CALLCONV opj_set_decode_area(\topj_codec_t *p_codec,\n\t\t\t\t\t\t\t\t\t\t\topj_image_t* p_image,\n\t\t\t\t\t\t\t\t\t\t\tOPJ_INT32 p_start_x, OPJ_INT32 p_start_y,\n\t\t\t\t\t\t\t\t\t\t\tOPJ_INT32 p_end_x, OPJ_INT32 p_end_y\n\t\t\t\t\t\t\t\t\t\t\t)\n{\n\tif (p_codec) {\n\t\topj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;\n\t\t\n\t\tif (! l_codec->is_decompressor) {\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\n\t\treturn  l_codec->m_codec_data.m_decompression.opj_set_decode_area(\tl_codec->m_codec,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_image,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_start_x, p_start_y,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_end_x, p_end_y,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&(l_codec->m_event_mgr) );\n\t}\n\treturn OPJ_FALSE;\n}\n\nOPJ_BOOL OPJ_CALLCONV opj_read_tile_header(\topj_codec_t *p_codec,\n\t\t\t\t\t\t\t\t\t\t\topj_stream_t * p_stream,\n\t\t\t\t\t\t\t\t\t\t\tOPJ_UINT32 * p_tile_index,\n\t\t\t\t\t\t\t\t\t\t\tOPJ_UINT32 * p_data_size,\n\t\t\t\t\t\t\t\t\t\t\tOPJ_INT32 * p_tile_x0, OPJ_INT32 * p_tile_y0,\n\t\t\t\t\t\t\t\t\t\t\tOPJ_INT32 * p_tile_x1, OPJ_INT32 * p_tile_y1,\n\t\t\t\t\t\t\t\t\t\t\tOPJ_UINT32 * p_nb_comps,\n\t\t\t\t\t\t\t\t\t\t\tOPJ_BOOL * p_should_go_on)\n{\n\tif (p_codec && p_stream && p_data_size && p_tile_index) {\n\t\topj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;\n\t\topj_stream_private_t * l_stream = (opj_stream_private_t *) p_stream;\n\n\t\tif (! l_codec->is_decompressor) {\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\n\t\treturn l_codec->m_codec_data.m_decompression.opj_read_tile_header(\tl_codec->m_codec,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_tile_index,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_data_size,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_tile_x0, p_tile_y0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_tile_x1, p_tile_y1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_nb_comps,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_should_go_on,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tl_stream,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&(l_codec->m_event_mgr));\n\t}\n\treturn OPJ_FALSE;\n}\n\nOPJ_BOOL OPJ_CALLCONV opj_decode_tile_data(\topj_codec_t *p_codec,\n\t\t\t\t\t\t\t\t\t\t\tOPJ_UINT32 p_tile_index,\n\t\t\t\t\t\t\t\t\t\t\tOPJ_BYTE * p_data,\n\t\t\t\t\t\t\t\t\t\t\tOPJ_UINT32 p_data_size,\n\t\t\t\t\t\t\t\t\t\t\topj_stream_t *p_stream\n\t\t\t\t\t\t\t\t\t\t\t)\n{\n\tif (p_codec && p_data && p_stream) {\n\t\topj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;\n\t\topj_stream_private_t * l_stream = (opj_stream_private_t *) p_stream;\n\n\t\tif (! l_codec->is_decompressor) {\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\n\t\treturn l_codec->m_codec_data.m_decompression.opj_decode_tile_data(\tl_codec->m_codec,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_tile_index,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_data,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_data_size,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tl_stream,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&(l_codec->m_event_mgr) );\n\t}\n\treturn OPJ_FALSE;\n}\n\nOPJ_BOOL OPJ_CALLCONV opj_get_decoded_tile(\topj_codec_t *p_codec,\n\t\t\t\t\t\t\t\t\t\t\topj_stream_t *p_stream,\n\t\t\t\t\t\t\t\t\t\t\topj_image_t *p_image,\n\t\t\t\t\t\t\t\t\t\t\tOPJ_UINT32 tile_index)\n{\n\tif (p_codec && p_stream) {\n\t\topj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;\n\t\topj_stream_private_t * l_stream = (opj_stream_private_t *) p_stream;\n\n\t\tif (! l_codec->is_decompressor) {\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\t\t\n\t\treturn l_codec->m_codec_data.m_decompression.opj_get_decoded_tile(\tl_codec->m_codec,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tl_stream,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_image,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&(l_codec->m_event_mgr),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttile_index);\n\t}\n\n\treturn OPJ_FALSE;\n}\n\nOPJ_BOOL OPJ_CALLCONV opj_set_decoded_resolution_factor(opj_codec_t *p_codec, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tOPJ_UINT32 res_factor )\n{\n\topj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;\n\n\tif ( !l_codec ){\n\t\tfprintf(stderr, \"[ERROR] Input parameters of the setup_decoder function are incorrect.\\n\");\n\t\treturn OPJ_FALSE;\n\t}\n\n\tl_codec->m_codec_data.m_decompression.opj_set_decoded_resolution_factor(l_codec->m_codec, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tres_factor,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&(l_codec->m_event_mgr) );\n\treturn OPJ_TRUE;\n}\n\n/* ---------------------------------------------------------------------- */\n/* COMPRESSION FUNCTIONS*/\n\nopj_codec_t* OPJ_CALLCONV opj_create_compress(OPJ_CODEC_FORMAT p_format)\n{\n\topj_codec_private_t *l_codec = 00;\n\n\tl_codec = (opj_codec_private_t*)opj_calloc(1, sizeof(opj_codec_private_t));\n\tif (!l_codec) {\n\t\treturn 00;\n\t}\n\tmemset(l_codec, 0, sizeof(opj_codec_private_t));\n\t\n\tl_codec->is_decompressor = 0;\n\n\tswitch(p_format) {\n\t\tcase OPJ_CODEC_J2K:\n\t\t\tl_codec->m_codec_data.m_compression.opj_encode = (OPJ_BOOL (*) (void *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstruct opj_stream_private *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstruct opj_event_mgr * )) opj_j2k_encode;\n\n\t\t\tl_codec->m_codec_data.m_compression.opj_end_compress = (OPJ_BOOL (*) (\tvoid *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstruct opj_stream_private *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstruct opj_event_mgr *)) opj_j2k_end_compress;\n\n\t\t\tl_codec->m_codec_data.m_compression.opj_start_compress = (OPJ_BOOL (*) (void *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstruct opj_stream_private *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstruct opj_image * ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstruct opj_event_mgr *)) opj_j2k_start_compress;\n\n\t\t\tl_codec->m_codec_data.m_compression.opj_write_tile = (OPJ_BOOL (*) (void *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOPJ_UINT32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOPJ_BYTE*,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOPJ_UINT32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstruct opj_stream_private *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstruct opj_event_mgr *) ) opj_j2k_write_tile;\n\n\t\t\tl_codec->m_codec_data.m_compression.opj_destroy = (void (*) (void *)) opj_j2k_destroy;\n\n\t\t\tl_codec->m_codec_data.m_compression.opj_setup_encoder = (void (*) (\tvoid *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topj_cparameters_t *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstruct opj_image *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstruct opj_event_mgr * )) opj_j2k_setup_encoder;\n\n\t\t\tl_codec->m_codec = opj_j2k_create_compress();\n\t\t\tif (! l_codec->m_codec) {\n\t\t\t\topj_free(l_codec);\n\t\t\t\treturn 00;\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase OPJ_CODEC_JP2:\n\t\t\t/* get a JP2 decoder handle */\n\t\t\tl_codec->m_codec_data.m_compression.opj_encode = (OPJ_BOOL (*) (void *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstruct opj_stream_private *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstruct opj_event_mgr * )) opj_jp2_encode;\n\n\t\t\tl_codec->m_codec_data.m_compression.opj_end_compress = (OPJ_BOOL (*) (\tvoid *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstruct opj_stream_private *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstruct opj_event_mgr *)) opj_jp2_end_compress;\n\n\t\t\tl_codec->m_codec_data.m_compression.opj_start_compress = (OPJ_BOOL (*) (void *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstruct opj_stream_private *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstruct opj_image * ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstruct opj_event_mgr *))  opj_jp2_start_compress;\n\n\t\t\tl_codec->m_codec_data.m_compression.opj_write_tile = (OPJ_BOOL (*) (void *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOPJ_UINT32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOPJ_BYTE*,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOPJ_UINT32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstruct opj_stream_private *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstruct opj_event_mgr *)) opj_jp2_write_tile;\n\n\t\t\tl_codec->m_codec_data.m_compression.opj_destroy = (void (*) (void *)) opj_jp2_destroy;\n\n\t\t\tl_codec->m_codec_data.m_compression.opj_setup_encoder = (void (*) (\tvoid *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topj_cparameters_t *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstruct opj_image *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstruct opj_event_mgr * )) opj_jp2_setup_encoder;\n\n\t\t\tl_codec->m_codec = opj_jp2_create(OPJ_FALSE);\n\t\t\tif (! l_codec->m_codec) {\n\t\t\t\topj_free(l_codec);\n\t\t\t\treturn 00;\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase OPJ_CODEC_UNKNOWN:\n\t\tcase OPJ_CODEC_JPT:\n\t\tdefault:\n\t\t\topj_free(l_codec);\n\t\t\treturn 00;\n\t}\n\n\topj_set_default_event_handler(&(l_codec->m_event_mgr));\n\treturn (opj_codec_t*) l_codec;\n}\n\nvoid OPJ_CALLCONV opj_set_default_encoder_parameters(opj_cparameters_t *parameters) {\n\tif(parameters) {\n\t\tmemset(parameters, 0, sizeof(opj_cparameters_t));\n\t\t/* default coding parameters */\n        parameters->cp_cinema = OPJ_OFF; /* DEPRECATED */\n        parameters->rsiz = OPJ_PROFILE_NONE;\n\t\tparameters->max_comp_size = 0;\n\t\tparameters->numresolution = 6;\n        parameters->cp_rsiz = OPJ_STD_RSIZ; /* DEPRECATED */\n\t\tparameters->cblockw_init = 64;\n\t\tparameters->cblockh_init = 64;\n\t\tparameters->prog_order = OPJ_LRCP;\n\t\tparameters->roi_compno = -1;\t\t/* no ROI */\n\t\tparameters->subsampling_dx = 1;\n\t\tparameters->subsampling_dy = 1;\n\t\tparameters->tp_on = 0;\n\t\tparameters->decod_format = -1;\n\t\tparameters->cod_format = -1;\n\t\tparameters->tcp_rates[0] = 0;   \n\t\tparameters->tcp_numlayers = 0;\n\t\tparameters->cp_disto_alloc = 0;\n\t\tparameters->cp_fixed_alloc = 0;\n\t\tparameters->cp_fixed_quality = 0;\n\t\tparameters->jpip_on = OPJ_FALSE;\n/* UniPG>> */\n#ifdef USE_JPWL\n\t\tparameters->jpwl_epc_on = OPJ_FALSE;\n\t\tparameters->jpwl_hprot_MH = -1; /* -1 means unassigned */\n\t\t{\n\t\t\tint i;\n\t\t\tfor (i = 0; i < JPWL_MAX_NO_TILESPECS; i++) {\n\t\t\t\tparameters->jpwl_hprot_TPH_tileno[i] = -1; /* unassigned */\n\t\t\t\tparameters->jpwl_hprot_TPH[i] = 0; /* absent */\n\t\t\t}\n\t\t};\n\t\t{\n\t\t\tint i;\n\t\t\tfor (i = 0; i < JPWL_MAX_NO_PACKSPECS; i++) {\n\t\t\t\tparameters->jpwl_pprot_tileno[i] = -1; /* unassigned */\n\t\t\t\tparameters->jpwl_pprot_packno[i] = -1; /* unassigned */\n\t\t\t\tparameters->jpwl_pprot[i] = 0; /* absent */\n\t\t\t}\n\t\t};\n\t\tparameters->jpwl_sens_size = 0; /* 0 means no ESD */\n\t\tparameters->jpwl_sens_addr = 0; /* 0 means auto */\n\t\tparameters->jpwl_sens_range = 0; /* 0 means packet */\n\t\tparameters->jpwl_sens_MH = -1; /* -1 means unassigned */\n\t\t{\n\t\t\tint i;\n\t\t\tfor (i = 0; i < JPWL_MAX_NO_TILESPECS; i++) {\n\t\t\t\tparameters->jpwl_sens_TPH_tileno[i] = -1; /* unassigned */\n\t\t\t\tparameters->jpwl_sens_TPH[i] = -1; /* absent */\n\t\t\t}\n\t\t};\n#endif /* USE_JPWL */\n/* <<UniPG */\n\t}\n}\n\nOPJ_BOOL OPJ_CALLCONV opj_setup_encoder(opj_codec_t *p_codec, \n\t\t\t\t\t\t\t\t\t\topj_cparameters_t *parameters, \n\t\t\t\t\t\t\t\t\t\topj_image_t *p_image)\n{\n\tif (p_codec && parameters && p_image) {\n\t\topj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;\n\n\t\tif (! l_codec->is_decompressor) {\n\t\t\tl_codec->m_codec_data.m_compression.opj_setup_encoder(\tl_codec->m_codec,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tparameters,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_image,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&(l_codec->m_event_mgr) );\n\t\t\treturn OPJ_TRUE;\n\t\t}\n\t}\n\n\treturn OPJ_FALSE;\n}\n\nOPJ_BOOL OPJ_CALLCONV opj_start_compress (\topj_codec_t *p_codec,\n\t\t\t\t\t\t\t\t\t\t\topj_image_t * p_image,\n\t\t\t\t\t\t\t\t\t\t\topj_stream_t *p_stream)\n{\n\tif (p_codec && p_stream) {\n\t\topj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;\n\t\topj_stream_private_t * l_stream = (opj_stream_private_t *) p_stream;\n\n\t\tif (! l_codec->is_decompressor) {\n\t\t\treturn l_codec->m_codec_data.m_compression.opj_start_compress(\tl_codec->m_codec,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tl_stream,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_image,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&(l_codec->m_event_mgr));\n\t\t}\n\t}\n\n\treturn OPJ_FALSE;\n}\n\nOPJ_BOOL OPJ_CALLCONV opj_encode(opj_codec_t *p_info, opj_stream_t *p_stream)\n{\n\tif (p_info && p_stream) {\n\t\topj_codec_private_t * l_codec = (opj_codec_private_t *) p_info;\n\t\topj_stream_private_t * l_stream = (opj_stream_private_t *) p_stream;\n\n\t\tif (! l_codec->is_decompressor) {\n\t\t\treturn l_codec->m_codec_data.m_compression.opj_encode(\tl_codec->m_codec,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tl_stream,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&(l_codec->m_event_mgr));\n\t\t}\n\t}\n\n\treturn OPJ_FALSE;\n\n}\n\nOPJ_BOOL OPJ_CALLCONV opj_end_compress (opj_codec_t *p_codec,\n\t\t\t\t\t\t\t\t\t\topj_stream_t *p_stream)\n{\n\tif (p_codec && p_stream) {\n\t\topj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;\n\t\topj_stream_private_t * l_stream = (opj_stream_private_t *) p_stream;\n\n\t\tif (! l_codec->is_decompressor) {\n\t\t\treturn l_codec->m_codec_data.m_compression.opj_end_compress(l_codec->m_codec,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tl_stream,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&(l_codec->m_event_mgr));\n\t\t}\n\t}\n\treturn OPJ_FALSE;\n\n}\n\nOPJ_BOOL OPJ_CALLCONV opj_end_decompress (\topj_codec_t *p_codec,\n\t\t\t\t\t\t\t\t\t\t\topj_stream_t *p_stream)\n{\n\tif (p_codec && p_stream) {\n\t\topj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;\n\t\topj_stream_private_t * l_stream = (opj_stream_private_t *) p_stream;\n\n\t\tif (! l_codec->is_decompressor) {\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\t\t\n\t\treturn l_codec->m_codec_data.m_decompression.opj_end_decompress(l_codec->m_codec,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tl_stream,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&(l_codec->m_event_mgr) );\n\t}\n\n\treturn OPJ_FALSE;\n}\n\nOPJ_BOOL OPJ_CALLCONV opj_set_MCT(opj_cparameters_t *parameters,\n                                  OPJ_FLOAT32 * pEncodingMatrix,\n                                  OPJ_INT32 * p_dc_shift,OPJ_UINT32 pNbComp)\n{\n\tOPJ_UINT32 l_matrix_size = pNbComp * pNbComp * (OPJ_UINT32)sizeof(OPJ_FLOAT32);\n\tOPJ_UINT32 l_dc_shift_size = pNbComp * (OPJ_UINT32)sizeof(OPJ_INT32);\n\tOPJ_UINT32 l_mct_total_size = l_matrix_size + l_dc_shift_size;\n\n\t/* add MCT capability */\n    if (OPJ_IS_PART2(parameters->rsiz)) {\n        parameters->rsiz |= OPJ_EXTENSION_MCT;\n    } else {\n        parameters->rsiz = ((OPJ_PROFILE_PART2) | (OPJ_EXTENSION_MCT));\n    }\n\tparameters->irreversible = 1;\n\n\t/* use array based MCT */\n\tparameters->tcp_mct = 2;\n\tparameters->mct_data = opj_malloc(l_mct_total_size);\n\tif (! parameters->mct_data) {\n\t\treturn OPJ_FALSE;\n\t}\n\n\tmemcpy(parameters->mct_data,pEncodingMatrix,l_matrix_size);\n\tmemcpy(((OPJ_BYTE *) parameters->mct_data) +  l_matrix_size,p_dc_shift,l_dc_shift_size);\n\n\treturn OPJ_TRUE;\n}\n\nOPJ_BOOL OPJ_CALLCONV opj_write_tile (\topj_codec_t *p_codec,\n\t\t\t\t\t\t\t\t\t\tOPJ_UINT32 p_tile_index,\n\t\t\t\t\t\t\t\t\t\tOPJ_BYTE * p_data,\n\t\t\t\t\t\t\t\t\t\tOPJ_UINT32 p_data_size,\n\t\t\t\t\t\t\t\t\t\topj_stream_t *p_stream )\n{\n\tif (p_codec && p_stream && p_data) {\n\t\topj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;\n\t\topj_stream_private_t * l_stream = (opj_stream_private_t *) p_stream;\n\n\t\tif (l_codec->is_decompressor) {\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\n\t\treturn l_codec->m_codec_data.m_compression.opj_write_tile(\tl_codec->m_codec,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_tile_index,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_data,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp_data_size,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tl_stream,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&(l_codec->m_event_mgr) );\n\t}\n\n\treturn OPJ_FALSE;\n}\n\n/* ---------------------------------------------------------------------- */\n\nvoid OPJ_CALLCONV opj_destroy_codec(opj_codec_t *p_codec)\n{\n\tif (p_codec) {\n\t\topj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;\n\n\t\tif (l_codec->is_decompressor) {\n\t\t\tl_codec->m_codec_data.m_decompression.opj_destroy(l_codec->m_codec);\n\t\t}\n\t\telse {\n\t\t\tl_codec->m_codec_data.m_compression.opj_destroy(l_codec->m_codec);\n\t\t}\n\n\t\tl_codec->m_codec = 00;\n\t\topj_free(l_codec);\n\t}\n}\n\n/* ---------------------------------------------------------------------- */\n\nvoid OPJ_CALLCONV opj_dump_codec(\topj_codec_t *p_codec,\n\t\t\t\t\t\t\t\t\tOPJ_INT32 info_flag,\n\t\t\t\t\t\t\t\t\tFILE* output_stream)\n{\n\tif (p_codec) {\n\t\topj_codec_private_t* l_codec = (opj_codec_private_t*) p_codec;\n\n\t\tl_codec->opj_dump_codec(l_codec->m_codec, info_flag, output_stream);\n\t\treturn;\n\t}\n\n\tfprintf(stderr, \"[ERROR] Input parameter of the dump_codec function are incorrect.\\n\");\n\treturn;\n}\n\nopj_codestream_info_v2_t* OPJ_CALLCONV opj_get_cstr_info(opj_codec_t *p_codec)\n{\n\tif (p_codec) {\n\t\topj_codec_private_t* l_codec = (opj_codec_private_t*) p_codec;\n\n\t\treturn l_codec->opj_get_codec_info(l_codec->m_codec);\n\t}\n\n\treturn NULL;\n}\n\nvoid OPJ_CALLCONV opj_destroy_cstr_info(opj_codestream_info_v2_t **cstr_info) {\n\tif (cstr_info) {\n\n\t\tif ((*cstr_info)->m_default_tile_info.tccp_info){\n\t\t\topj_free((*cstr_info)->m_default_tile_info.tccp_info);\n\t\t}\n\n\t\tif ((*cstr_info)->tile_info){\n\t\t\t/* FIXME not used for the moment*/\n\t\t}\n\n\t\topj_free((*cstr_info));\n\t\t(*cstr_info) = NULL;\n\t}\n}\n\nopj_codestream_index_t * OPJ_CALLCONV opj_get_cstr_index(opj_codec_t *p_codec)\n{\n\tif (p_codec) {\n\t\topj_codec_private_t* l_codec = (opj_codec_private_t*) p_codec;\n\n\t\treturn l_codec->opj_get_codec_index(l_codec->m_codec);\n\t}\n\n\treturn NULL;\n}\n\nvoid OPJ_CALLCONV opj_destroy_cstr_index(opj_codestream_index_t **p_cstr_index)\n{\n\tif (*p_cstr_index){\n\t\tj2k_destroy_cstr_index(*p_cstr_index);\n\t\t(*p_cstr_index) = NULL;\n\t}\n}\n\nopj_stream_t* OPJ_CALLCONV opj_stream_create_default_file_stream (const char *fname, OPJ_BOOL p_is_read_stream)\n{\n    return opj_stream_create_file_stream(fname, OPJ_J2K_STREAM_CHUNK_SIZE, p_is_read_stream);\n}\n\nopj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream (\n        const char *fname, \n\t\tOPJ_SIZE_T p_size, \n        OPJ_BOOL p_is_read_stream)\n{\n    opj_stream_t* l_stream = 00;\n    FILE *p_file;\n    const char *mode;\n\n    if (! fname) {\n        return NULL;\n    }\n    \n    if(p_is_read_stream) mode = \"rb\"; else mode = \"wb\";\n\n    p_file = fopen(fname, mode);\n\n    if (! p_file) {\n\t    return NULL;\n    }\n\n    l_stream = opj_stream_create(p_size,p_is_read_stream);\n    if (! l_stream) {\n        fclose(p_file);\n        return NULL;\n    }\n\n    opj_stream_set_user_data(l_stream, p_file, (opj_stream_free_user_data_fn) fclose);\n    opj_stream_set_user_data_length(l_stream, opj_get_data_length_from_file(p_file));\n    opj_stream_set_read_function(l_stream, (opj_stream_read_fn) opj_read_from_file);\n    opj_stream_set_write_function(l_stream, (opj_stream_write_fn) opj_write_from_file);\n    opj_stream_set_skip_function(l_stream, (opj_stream_skip_fn) opj_skip_from_file);\n    opj_stream_set_seek_function(l_stream, (opj_stream_seek_fn) opj_seek_from_file);\n\n    return l_stream;\n}\n"
  },
  {
    "path": "ext/openjpeg/openjpeg.h",
    "content": " /*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2006-2007, Parvatha Elangovan\n * Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>\n * Copyright (c) 2010-2011, Kaori Hagihara\n * Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France \n * Copyright (c) 2012, CS Systemes d'Information, France\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n#ifndef OPENJPEG_H\n#define OPENJPEG_H\n\n\n/* \n==========================================================\n   Compiler directives\n==========================================================\n*/\n\n/*\nThe inline keyword is supported by C99 but not by C90. \nMost compilers implement their own version of this keyword ... \n*/\n#ifndef INLINE\n\t#if defined(_MSC_VER)\n\t\t#define INLINE __forceinline\n\t#elif defined(__GNUC__)\n\t\t#define INLINE __inline__\n\t#elif defined(__MWERKS__)\n\t\t#define INLINE inline\n\t#else \n\t\t/* add other compilers here ... */\n\t\t#define INLINE \n\t#endif /* defined(<Compiler>) */\n#endif /* INLINE */\n\n/* deprecated attribute */\n#ifdef __GNUC__\n\t#define OPJ_DEPRECATED(func) func __attribute__ ((deprecated))\n#elif defined(_MSC_VER)\n\t#define OPJ_DEPRECATED(func) __declspec(deprecated) func\n#else\n\t#pragma message(\"WARNING: You need to implement DEPRECATED for this compiler\")\n\t#define OPJ_DEPRECATED(func) func\n#endif\n\n#if defined(OPJ_STATIC) || !defined(_WIN32)\n/* http://gcc.gnu.org/wiki/Visibility */\n#if __GNUC__ >= 4\n#define OPJ_API    __attribute__ ((visibility (\"default\")))\n#define OPJ_LOCAL  __attribute__ ((visibility (\"hidden\")))\n#else\n#define OPJ_API\n#define OPJ_LOCAL\n#endif\n#define OPJ_CALLCONV\n#else\n#define OPJ_CALLCONV __stdcall\n/*\nThe following ifdef block is the standard way of creating macros which make exporting \nfrom a DLL simpler. All files within this DLL are compiled with the OPJ_EXPORTS\nsymbol defined on the command line. this symbol should not be defined on any project\nthat uses this DLL. This way any other project whose source files include this file see \nOPJ_API functions as being imported from a DLL, wheras this DLL sees symbols\ndefined with this macro as being exported.\n*/\n#if defined(OPJ_EXPORTS) || defined(DLL_EXPORT)\n#define OPJ_API __declspec(dllexport)\n#else\n#define OPJ_API __declspec(dllimport)\n#endif /* OPJ_EXPORTS */\n#endif /* !OPJ_STATIC || !_WIN32 */\n\ntypedef int OPJ_BOOL;\n#define OPJ_TRUE 1\n#define OPJ_FALSE 0\n\ntypedef char          OPJ_CHAR;\ntypedef float         OPJ_FLOAT32;\ntypedef double        OPJ_FLOAT64;\ntypedef unsigned char OPJ_BYTE;\n\n#include \"opj_stdint.h\"\n\ntypedef int8_t   OPJ_INT8;\ntypedef uint8_t  OPJ_UINT8;\ntypedef int16_t  OPJ_INT16;\ntypedef uint16_t OPJ_UINT16;\ntypedef int32_t  OPJ_INT32;\ntypedef uint32_t OPJ_UINT32;\ntypedef int64_t  OPJ_INT64;\ntypedef uint64_t OPJ_UINT64;\n\ntypedef int64_t  OPJ_OFF_T; /* 64-bit file offset type */\n\n#include <stdio.h>\ntypedef size_t   OPJ_SIZE_T;\n\n/* Avoid compile-time warning because parameter is not used */\n#define OPJ_ARG_NOT_USED(x) (void)(x)\n\n/* \n==========================================================\n   Useful constant definitions\n==========================================================\n*/\n\n#define OPJ_PATH_LEN 4096 /**< Maximum allowed size for filenames */\n\n#define OPJ_J2K_MAXRLVLS 33\t\t\t\t\t/**< Number of maximum resolution level authorized */\n#define OPJ_J2K_MAXBANDS (3*OPJ_J2K_MAXRLVLS-2)\t/**< Number of maximum sub-band linked to number of resolution level */\n\n#define OPJ_J2K_DEFAULT_NB_SEGS\t\t\t\t10\n#define OPJ_J2K_STREAM_CHUNK_SIZE\t\t\t0x100000 /** 1 mega by default */\n#define OPJ_J2K_DEFAULT_HEADER_SIZE\t\t\t1000\n#define OPJ_J2K_MCC_DEFAULT_NB_RECORDS\t\t10\n#define OPJ_J2K_MCT_DEFAULT_NB_RECORDS\t\t10\n\n/* UniPG>> */ /* NOT YET USED IN THE V2 VERSION OF OPENJPEG */\n#define JPWL_MAX_NO_TILESPECS\t16 /**< Maximum number of tile parts expected by JPWL: increase at your will */\n#define JPWL_MAX_NO_PACKSPECS\t16 /**< Maximum number of packet parts expected by JPWL: increase at your will */\n#define JPWL_MAX_NO_MARKERS\t512 /**< Maximum number of JPWL markers: increase at your will */\n#define JPWL_PRIVATEINDEX_NAME \"jpwl_index_privatefilename\" /**< index file name used when JPWL is on */\n#define JPWL_EXPECTED_COMPONENTS 3 /**< Expect this number of components, so you'll find better the first EPB */\n#define JPWL_MAXIMUM_TILES 8192 /**< Expect this maximum number of tiles, to avoid some crashes */\n#define JPWL_MAXIMUM_HAMMING 2 /**< Expect this maximum number of bit errors in marker id's */\n#define JPWL_MAXIMUM_EPB_ROOM 65450 /**< Expect this maximum number of bytes for composition of EPBs */\n/* <<UniPG */\n\n/**\n * EXPERIMENTAL FOR THE MOMENT\n * Supported options about file information used only in j2k_dump\n*/\n#define OPJ_IMG_INFO\t\t1\t/**< Basic image information provided to the user */\n#define OPJ_J2K_MH_INFO\t\t2\t/**< Codestream information based only on the main header */\n#define OPJ_J2K_TH_INFO\t\t4\t/**< Tile information based on the current tile header */\n#define OPJ_J2K_TCH_INFO\t8\t/**< Tile/Component information of all tiles */\n#define OPJ_J2K_MH_IND\t\t16\t/**< Codestream index based only on the main header */\n#define OPJ_J2K_TH_IND\t\t32\t/**< Tile index based on the current tile */\n/*FIXME #define OPJ_J2K_CSTR_IND\t48*/\t/**<  */\n#define OPJ_JP2_INFO\t\t128\t/**< JP2 file information */\n#define OPJ_JP2_IND\t\t\t256\t/**< JP2 file index */\n\n/**\n * JPEG 2000 Profiles, see Table A.10 from 15444-1 (updated in various AMD)\n * These values help chosing the RSIZ value for the J2K codestream.\n * The RSIZ value triggers various encoding options, as detailed in Table A.10.\n * If OPJ_PROFILE_PART2 is chosen, it has to be combined with one or more extensions\n * described hereunder.\n *   Example: rsiz = OPJ_PROFILE_PART2 | OPJ_EXTENSION_MCT;\n * For broadcast profiles, the OPJ_PROFILE value has to be combined with the targeted\n * mainlevel (3-0 LSB, value between 0 and 11):\n *   Example: rsiz = OPJ_PROFILE_BC_MULTI | 0x0005; (here mainlevel 5)\n * For IMF profiles, the OPJ_PROFILE value has to be combined with the targeted mainlevel\n * (3-0 LSB, value between 0 and 11) and sublevel (7-4 LSB, value between 0 and 9):\n *   Example: rsiz = OPJ_PROFILE_IMF_2K | 0x0040 | 0x0005; (here main 5 and sublevel 4)\n * */\n#define OPJ_PROFILE_NONE        0x0000 /** no profile, conform to 15444-1 */\n#define OPJ_PROFILE_0           0x0001 /** Profile 0 as described in 15444-1,Table A.45 */\n#define OPJ_PROFILE_1           0x0002 /** Profile 1 as described in 15444-1,Table A.45 */\n#define OPJ_PROFILE_PART2       0x8000 /** At least 1 extension defined in 15444-2 (Part-2) */\n#define OPJ_PROFILE_CINEMA_2K   0x0003 /** 2K cinema profile defined in 15444-1 AMD1 */\n#define OPJ_PROFILE_CINEMA_4K   0x0004 /** 4K cinema profile defined in 15444-1 AMD1 */\n#define OPJ_PROFILE_CINEMA_S2K  0x0005 /** Scalable 2K cinema profile defined in 15444-1 AMD2 */\n#define OPJ_PROFILE_CINEMA_S4K  0x0006 /** Scalable 4K cinema profile defined in 15444-1 AMD2 */\n#define OPJ_PROFILE_CINEMA_LTS  0x0007 /** Long term storage cinema profile defined in 15444-1 AMD2 */\n#define OPJ_PROFILE_BC_SINGLE   0x0100 /** Single Tile Broadcast profile defined in 15444-1 AMD3 */\n#define OPJ_PROFILE_BC_MULTI    0x0200 /** Multi Tile Broadcast profile defined in 15444-1 AMD3 */\n#define OPJ_PROFILE_BC_MULTI_R  0x0300 /** Multi Tile Reversible Broadcast profile defined in 15444-1 AMD3 */\n#define OPJ_PROFILE_IMF_2K      0x0400 /** 2K Single Tile Lossy IMF profile defined in 15444-1 AMD 8 */\n#define OPJ_PROFILE_IMF_4K      0x0401 /** 4K Single Tile Lossy IMF profile defined in 15444-1 AMD 8 */\n#define OPJ_PROFILE_IMF_8K      0x0402 /** 8K Single Tile Lossy IMF profile defined in 15444-1 AMD 8 */\n#define OPJ_PROFILE_IMF_2K_R    0x0403 /** 2K Single/Multi Tile Reversible IMF profile defined in 15444-1 AMD 8 */\n#define OPJ_PROFILE_IMF_4K_R    0x0800 /** 4K Single/Multi Tile Reversible IMF profile defined in 15444-1 AMD 8 */\n#define OPJ_PROFILE_IMF_8K_R    0x0801  /** 8K Single/Multi Tile Reversible IMF profile defined in 15444-1 AMD 8 */\n\n/**\n * JPEG 2000 Part-2 extensions\n * */\n#define OPJ_EXTENSION_NONE      0x0000 /** No Part-2 extension */\n#define OPJ_EXTENSION_MCT       0x0100  /** Custom MCT support */\n\n/**\n * JPEG 2000 profile macros\n * */\n#define OPJ_IS_CINEMA(v)     (((v) >= OPJ_PROFILE_CINEMA_2K)&&((v) <= OPJ_PROFILE_CINEMA_S4K))\n#define OPJ_IS_STORAGE(v)    ((v) == OPJ_PROFILE_CINEMA_LTS)\n#define OPJ_IS_BROADCAST(v)  (((v) >= OPJ_PROFILE_BC_SINGLE)&&((v) <= ((OPJ_PROFILE_BC_MULTI_R) | (0x000b))))\n#define OPJ_IS_IMF(v)        (((v) >= OPJ_PROFILE_IMF_2K)&&((v) <= ((OPJ_PROFILE_IMF_8K_R) | (0x009b))))\n#define OPJ_IS_PART2(v)      ((v) & OPJ_PROFILE_PART2)\n\n/**\n * JPEG 2000 codestream and component size limits in cinema profiles\n * */\n#define OPJ_CINEMA_24_CS     1302083   \t/** Maximum codestream length for 24fps */\n#define OPJ_CINEMA_48_CS     651041     /** Maximum codestream length for 48fps */\n#define OPJ_CINEMA_24_COMP   1041666    /** Maximum size per color component for 2K & 4K @ 24fps */\n#define OPJ_CINEMA_48_COMP   520833\t\t/** Maximum size per color component for 2K @ 48fps */\n\n/* \n==========================================================\n   enum definitions\n==========================================================\n*/\n\n/**\n * DEPRECATED: use RSIZ, OPJ_PROFILE_* and OPJ_EXTENSION_* instead\n * Rsiz Capabilities\n * */\ntypedef enum RSIZ_CAPABILITIES {\n    OPJ_STD_RSIZ = 0,\t\t/** Standard JPEG2000 profile*/\n    OPJ_CINEMA2K = 3,\t\t/** Profile name for a 2K image*/\n    OPJ_CINEMA4K = 4,\t\t/** Profile name for a 4K image*/\n    OPJ_MCT = 0x8100\n} OPJ_RSIZ_CAPABILITIES;\n\n/**\n * DEPRECATED: use RSIZ, OPJ_PROFILE_* and OPJ_EXTENSION_* instead\n * Digital cinema operation mode\n * */\ntypedef enum CINEMA_MODE {\n    OPJ_OFF = 0,\t\t\t/** Not Digital Cinema*/\n    OPJ_CINEMA2K_24 = 1,\t/** 2K Digital Cinema at 24 fps*/\n    OPJ_CINEMA2K_48 = 2,\t/** 2K Digital Cinema at 48 fps*/\n    OPJ_CINEMA4K_24 = 3\t\t/** 4K Digital Cinema at 24 fps*/\n}OPJ_CINEMA_MODE;\n\n/** \n * Progression order\n * */\ntypedef enum PROG_ORDER {\n\tOPJ_PROG_UNKNOWN = -1,\t/**< place-holder */\n\tOPJ_LRCP = 0,\t\t\t/**< layer-resolution-component-precinct order */\n\tOPJ_RLCP = 1,\t\t\t/**< resolution-layer-component-precinct order */\n\tOPJ_RPCL = 2,\t\t\t/**< resolution-precinct-component-layer order */\n\tOPJ_PCRL = 3,\t\t\t/**< precinct-component-resolution-layer order */\n\tOPJ_CPRL = 4\t\t\t/**< component-precinct-resolution-layer order */\n} OPJ_PROG_ORDER;\n\n/**\n * Supported image color spaces\n*/\ntypedef enum COLOR_SPACE {\n    OPJ_CLRSPC_UNKNOWN = -1,\t/**< not supported by the library */\n    OPJ_CLRSPC_UNSPECIFIED = 0,\t/**< not specified in the codestream */\n    OPJ_CLRSPC_SRGB = 1,\t\t/**< sRGB */\n    OPJ_CLRSPC_GRAY = 2,\t\t/**< grayscale */\n    OPJ_CLRSPC_SYCC = 3,\t\t/**< YUV */\n    OPJ_CLRSPC_EYCC = 4,        /**< e-YCC */\n    OPJ_CLRSPC_CMYK = 5         /**< CMYK */\n} OPJ_COLOR_SPACE;\n\n/**\n * Supported codec\n*/\ntypedef enum CODEC_FORMAT {\n\tOPJ_CODEC_UNKNOWN = -1,\t/**< place-holder */\n\tOPJ_CODEC_J2K  = 0,\t\t/**< JPEG-2000 codestream : read/write */\n\tOPJ_CODEC_JPT  = 1,\t\t/**< JPT-stream (JPEG 2000, JPIP) : read only */\n    OPJ_CODEC_JP2  = 2,\t\t/**< JP2 file format : read/write */\n    OPJ_CODEC_JPP  = 3,\t\t/**< JPP-stream (JPEG 2000, JPIP) : to be coded */\n    OPJ_CODEC_JPX  = 4\t\t/**< JPX file format (JPEG 2000 Part-2) : to be coded */\n} OPJ_CODEC_FORMAT;\n\n\n/* \n==========================================================\n   event manager typedef definitions\n==========================================================\n*/\n\n/**\n * Callback function prototype for events\n * @param msg               Event message\n * @param client_data       Client object where will be return the event message \n * */\ntypedef void (*opj_msg_callback) (const char *msg, void *client_data);\n\n/* \n==========================================================\n   codec typedef definitions\n==========================================================\n*/\n\n/**\n * Progression order changes\n * \n */\ntypedef struct opj_poc {\n\t/** Resolution num start, Component num start, given by POC */\n\tOPJ_UINT32 resno0, compno0;\n\t/** Layer num end,Resolution num end, Component num end, given by POC */\n\tOPJ_UINT32 layno1, resno1, compno1;\n\t/** Layer num start,Precinct num start, Precinct num end */\n\tOPJ_UINT32 layno0, precno0, precno1;\n\t/** Progression order enum*/\n\tOPJ_PROG_ORDER prg1,prg;\n\t/** Progression order string*/\n\tOPJ_CHAR progorder[5];\n\t/** Tile number */\n\tOPJ_UINT32 tile;\n\t/** Start and end values for Tile width and height*/\n\tOPJ_INT32 tx0,tx1,ty0,ty1;\n\t/** Start value, initialised in pi_initialise_encode*/\n\tOPJ_UINT32 layS, resS, compS, prcS;\n\t/** End value, initialised in pi_initialise_encode */\n\tOPJ_UINT32 layE, resE, compE, prcE;\n\t/** Start and end values of Tile width and height, initialised in pi_initialise_encode*/\n\tOPJ_UINT32 txS,txE,tyS,tyE,dx,dy;\n\t/** Temporary values for Tile parts, initialised in pi_create_encode */\n\tOPJ_UINT32 lay_t, res_t, comp_t, prc_t,tx0_t,ty0_t;\n} opj_poc_t;\n\n/**\n * Compression parameters\n * */\ntypedef struct opj_cparameters {\n\t/** size of tile: tile_size_on = false (not in argument) or = true (in argument) */\n\tOPJ_BOOL tile_size_on;\n\t/** XTOsiz */\n\tint cp_tx0;\n\t/** YTOsiz */\n\tint cp_ty0;\n\t/** XTsiz */\n\tint cp_tdx;\n\t/** YTsiz */\n\tint cp_tdy;\n\t/** allocation by rate/distortion */\n\tint cp_disto_alloc;\n\t/** allocation by fixed layer */\n\tint cp_fixed_alloc;\n\t/** add fixed_quality */\n\tint cp_fixed_quality;\n\t/** fixed layer */\n\tint *cp_matrice;\n\t/** comment for coding */\n\tchar *cp_comment;\n\t/** csty : coding style */\n\tint csty;\n\t/** progression order (default OPJ_LRCP) */\n\tOPJ_PROG_ORDER prog_order;\n\t/** progression order changes */\n\topj_poc_t POC[32];\n\t/** number of progression order changes (POC), default to 0 */\n\tOPJ_UINT32 numpocs;\n\t/** number of layers */\n\tint tcp_numlayers;\n    /** rates of layers - might be subsequently limited by the max_cs_size field */\n\tfloat tcp_rates[100];\n\t/** different psnr for successive layers */\n\tfloat tcp_distoratio[100];\n\t/** number of resolutions */\n\tint numresolution;\n\t/** initial code block width, default to 64 */\n \tint cblockw_init;\n\t/** initial code block height, default to 64 */\n\tint cblockh_init;\n\t/** mode switch (cblk_style) */\n\tint mode;\n\t/** 1 : use the irreversible DWT 9-7, 0 : use lossless compression (default) */\n\tint irreversible;\n\t/** region of interest: affected component in [0..3], -1 means no ROI */\n\tint roi_compno;\n\t/** region of interest: upshift value */\n\tint roi_shift;\n\t/* number of precinct size specifications */\n\tint res_spec;\n\t/** initial precinct width */\n\tint prcw_init[OPJ_J2K_MAXRLVLS];\n\t/** initial precinct height */\n\tint prch_init[OPJ_J2K_MAXRLVLS];\n\n\t/**@name command line encoder parameters (not used inside the library) */\n\t/*@{*/\n\t/** input file name */\n\tchar infile[OPJ_PATH_LEN];\n\t/** output file name */\n\tchar outfile[OPJ_PATH_LEN];\n\t/** DEPRECATED. Index generation is now handeld with the opj_encode_with_info() function. Set to NULL */\n\tint index_on;\n\t/** DEPRECATED. Index generation is now handeld with the opj_encode_with_info() function. Set to NULL */\n\tchar index[OPJ_PATH_LEN];\n\t/** subimage encoding: origin image offset in x direction */\n\tint image_offset_x0;\n\t/** subimage encoding: origin image offset in y direction */\n\tint image_offset_y0;\n\t/** subsampling value for dx */\n\tint subsampling_dx;\n\t/** subsampling value for dy */\n\tint subsampling_dy;\n\t/** input file format 0: PGX, 1: PxM, 2: BMP 3:TIF*/\n\tint decod_format;\n\t/** output file format 0: J2K, 1: JP2, 2: JPT */\n\tint cod_format;\n\t/*@}*/\n\n/* UniPG>> */ /* NOT YET USED IN THE V2 VERSION OF OPENJPEG */\n\t/**@name JPWL encoding parameters */\n\t/*@{*/\n\t/** enables writing of EPC in MH, thus activating JPWL */\n\tOPJ_BOOL jpwl_epc_on;\n\t/** error protection method for MH (0,1,16,32,37-128) */\n\tint jpwl_hprot_MH;\n\t/** tile number of header protection specification (>=0) */\n\tint jpwl_hprot_TPH_tileno[JPWL_MAX_NO_TILESPECS];\n\t/** error protection methods for TPHs (0,1,16,32,37-128) */\n\tint jpwl_hprot_TPH[JPWL_MAX_NO_TILESPECS];\n\t/** tile number of packet protection specification (>=0) */\n\tint jpwl_pprot_tileno[JPWL_MAX_NO_PACKSPECS];\n\t/** packet number of packet protection specification (>=0) */\n\tint jpwl_pprot_packno[JPWL_MAX_NO_PACKSPECS];\n\t/** error protection methods for packets (0,1,16,32,37-128) */\n\tint jpwl_pprot[JPWL_MAX_NO_PACKSPECS];\n\t/** enables writing of ESD, (0=no/1/2 bytes) */\n\tint jpwl_sens_size;\n\t/** sensitivity addressing size (0=auto/2/4 bytes) */\n\tint jpwl_sens_addr;\n\t/** sensitivity range (0-3) */\n\tint jpwl_sens_range;\n\t/** sensitivity method for MH (-1=no,0-7) */\n\tint jpwl_sens_MH;\n\t/** tile number of sensitivity specification (>=0) */\n\tint jpwl_sens_TPH_tileno[JPWL_MAX_NO_TILESPECS];\n\t/** sensitivity methods for TPHs (-1=no,0-7) */\n\tint jpwl_sens_TPH[JPWL_MAX_NO_TILESPECS];\n\t/*@}*/\n/* <<UniPG */\n\n    /**\n     * DEPRECATED: use RSIZ, OPJ_PROFILE_* and MAX_COMP_SIZE instead\n     * Digital Cinema compliance 0-not compliant, 1-compliant\n     * */\n    OPJ_CINEMA_MODE cp_cinema;\n    /**\n     * Maximum size (in bytes) for each component.\n     * If == 0, component size limitation is not considered\n     * */\n\tint max_comp_size;\n    /**\n     * DEPRECATED: use RSIZ, OPJ_PROFILE_* and OPJ_EXTENSION_* instead\n     * Profile name\n     * */\n    OPJ_RSIZ_CAPABILITIES cp_rsiz;\n\t/** Tile part generation*/\n\tchar tp_on;\n\t/** Flag for Tile part generation*/\n\tchar tp_flag;\n\t/** MCT (multiple component transform) */\n\tchar tcp_mct;\n\t/** Enable JPIP indexing*/\n\tOPJ_BOOL jpip_on;\n\t/** Naive implementation of MCT restricted to a single reversible array based \n        encoding without offset concerning all the components. */\n\tvoid * mct_data;\n    /**\n     * Maximum size (in bytes) for the whole codestream.\n     * If == 0, codestream size limitation is not considered\n     * If it does not comply with tcp_rates, max_cs_size prevails\n     * and a warning is issued.\n     * */\n    int max_cs_size;\n    /** RSIZ value\n        To be used to combine OPJ_PROFILE_*, OPJ_EXTENSION_* and (sub)levels values. */\n    OPJ_UINT16 rsiz;\n} opj_cparameters_t;  \n\n#define OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG\t0x0001\n\n/**\n * Decompression parameters\n * */\ntypedef struct opj_dparameters {\n\t/** \n\tSet the number of highest resolution levels to be discarded. \n\tThe image resolution is effectively divided by 2 to the power of the number of discarded levels. \n\tThe reduce factor is limited by the smallest total number of decomposition levels among tiles.\n\tif != 0, then original dimension divided by 2^(reduce); \n\tif == 0 or not used, image is decoded to the full resolution \n\t*/\n\tOPJ_UINT32 cp_reduce;\n\t/** \n\tSet the maximum number of quality layers to decode. \n\tIf there are less quality layers than the specified number, all the quality layers are decoded.\n\tif != 0, then only the first \"layer\" layers are decoded; \n\tif == 0 or not used, all the quality layers are decoded \n\t*/\n\tOPJ_UINT32 cp_layer;\n\n\t/**@name command line decoder parameters (not used inside the library) */\n\t/*@{*/\n\t/** input file name */\n\tchar infile[OPJ_PATH_LEN];\n\t/** output file name */\n\tchar outfile[OPJ_PATH_LEN];\n\t/** input file format 0: J2K, 1: JP2, 2: JPT */\n\tint decod_format;\n\t/** output file format 0: PGX, 1: PxM, 2: BMP */\n\tint cod_format;\n\n\t/** Decoding area left boundary */\n\tOPJ_UINT32 DA_x0;\n\t/** Decoding area right boundary */\n\tOPJ_UINT32 DA_x1;\n\t/** Decoding area up boundary */\n\tOPJ_UINT32 DA_y0;\n\t/** Decoding area bottom boundary */\n\tOPJ_UINT32 DA_y1;\n\t/** Verbose mode */\n\tOPJ_BOOL m_verbose;\n\n\t/** tile number ot the decoded tile*/\n\tOPJ_UINT32 tile_index;\n\t/** Nb of tile to decode */\n\tOPJ_UINT32 nb_tile_to_decode;\n\n\t/*@}*/\n\n/* UniPG>> */ /* NOT YET USED IN THE V2 VERSION OF OPENJPEG */\n\t/**@name JPWL decoding parameters */\n\t/*@{*/\n\t/** activates the JPWL correction capabilities */\n\tOPJ_BOOL jpwl_correct;\n\t/** expected number of components */\n\tint jpwl_exp_comps;\n\t/** maximum number of tiles */\n\tint jpwl_max_tiles;\n\t/*@}*/\n/* <<UniPG */\n\n\tunsigned int flags;\n\n} opj_dparameters_t;\n\n\n/**\n * JPEG2000 codec V2.\n * */\ntypedef void * opj_codec_t;\n\n/* \n==========================================================\n   I/O stream typedef definitions\n==========================================================\n*/\n\n/**\n * Stream open flags.\n * */\n/** The stream was opened for reading. */\n#define OPJ_STREAM_READ\tOPJ_TRUE\n/** The stream was opened for writing. */\n#define OPJ_STREAM_WRITE OPJ_FALSE\n\n/*\n * Callback function prototype for read function\n */\ntypedef OPJ_SIZE_T (* opj_stream_read_fn) (void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data) ;\n\n/*\n * Callback function prototype for write function\n */\ntypedef OPJ_SIZE_T (* opj_stream_write_fn) (void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data) ;\n\n/*\n * Callback function prototype for skip function\n */\ntypedef OPJ_OFF_T (* opj_stream_skip_fn) (OPJ_OFF_T p_nb_bytes, void * p_user_data) ;\n\n/*\n * Callback function prototype for seek function\n */\ntypedef OPJ_BOOL (* opj_stream_seek_fn) (OPJ_OFF_T p_nb_bytes, void * p_user_data) ;\n\n/*\n * Callback function prototype for free user data function\n */\ntypedef void (* opj_stream_free_user_data_fn) (void * p_user_data) ;\n\n/*\n * JPEG2000 Stream.\n */\ntypedef void * opj_stream_t;\n\n/* \n==========================================================\n   image typedef definitions\n==========================================================\n*/\n\n/**\n * Defines a single image component\n * */\ntypedef struct opj_image_comp {\n\t/** XRsiz: horizontal separation of a sample of ith component with respect to the reference grid */\n\tOPJ_UINT32 dx;\n\t/** YRsiz: vertical separation of a sample of ith component with respect to the reference grid */\n\tOPJ_UINT32 dy;\n\t/** data width */\n\tOPJ_UINT32 w;\n\t/** data height */\n\tOPJ_UINT32 h;\n\t/** x component offset compared to the whole image */\n\tOPJ_UINT32 x0;\n\t/** y component offset compared to the whole image */\n\tOPJ_UINT32 y0;\n\t/** precision */\n\tOPJ_UINT32 prec;\n\t/** image depth in bits */\n\tOPJ_UINT32 bpp;\n\t/** signed (1) / unsigned (0) */\n\tOPJ_UINT32 sgnd;\n\t/** number of decoded resolution */\n\tOPJ_UINT32 resno_decoded;\n\t/** number of division by 2 of the out image compared to the original size of image */\n\tOPJ_UINT32 factor;\n\t/** image component data */\n\tOPJ_INT32 *data;\n  /** alpha channel */\n  OPJ_UINT16 alpha;\n} opj_image_comp_t;\n\n/** \n * Defines image data and characteristics\n * */\ntypedef struct opj_image {\n\t/** XOsiz: horizontal offset from the origin of the reference grid to the left side of the image area */\n\tOPJ_UINT32 x0;\n\t/** YOsiz: vertical offset from the origin of the reference grid to the top side of the image area */\n\tOPJ_UINT32 y0;\n\t/** Xsiz: width of the reference grid */\n\tOPJ_UINT32 x1;\n\t/** Ysiz: height of the reference grid */\n\tOPJ_UINT32 y1;\n\t/** number of components in the image */\n\tOPJ_UINT32 numcomps;\n\t/** color space: sRGB, Greyscale or YUV */\n\tOPJ_COLOR_SPACE color_space;\n\t/** image components */\n\topj_image_comp_t *comps;\n\t/** 'restricted' ICC profile */\n\tOPJ_BYTE *icc_profile_buf;\n\t/** size of ICC profile */\n\tOPJ_UINT32 icc_profile_len;\n} opj_image_t;\n\n\n/**\n * Component parameters structure used by the opj_image_create function\n * */\ntypedef struct opj_image_comptparm {\n\t/** XRsiz: horizontal separation of a sample of ith component with respect to the reference grid */\n\tOPJ_UINT32 dx;\n\t/** YRsiz: vertical separation of a sample of ith component with respect to the reference grid */\n\tOPJ_UINT32 dy;\n\t/** data width */\n\tOPJ_UINT32 w;\n\t/** data height */\n\tOPJ_UINT32 h;\n\t/** x component offset compared to the whole image */\n\tOPJ_UINT32 x0;\n\t/** y component offset compared to the whole image */\n\tOPJ_UINT32 y0;\n\t/** precision */\n\tOPJ_UINT32 prec;\n\t/** image depth in bits */\n\tOPJ_UINT32 bpp;\n\t/** signed (1) / unsigned (0) */\n\tOPJ_UINT32 sgnd;\n} opj_image_cmptparm_t;\n\n\n/* \n==========================================================\n   Information on the JPEG 2000 codestream\n==========================================================\n*/\n/* QUITE EXPERIMENTAL FOR THE MOMENT */\n\n/**\n * Index structure : Information concerning a packet inside tile\n * */\ntypedef struct opj_packet_info {\n\t/** packet start position (including SOP marker if it exists) */\n\tOPJ_OFF_T start_pos;\n\t/** end of packet header position (including EPH marker if it exists)*/\n\tOPJ_OFF_T end_ph_pos;\n\t/** packet end position */\n\tOPJ_OFF_T end_pos;\n\t/** packet distorsion */\n\tdouble disto;\n} opj_packet_info_t;\n\n\n/* UniPG>> */\n/**\n * Marker structure\n * */\ntypedef struct opj_marker_info {\n\t/** marker type */\n\tunsigned short int type;\n\t/** position in codestream */\n\tOPJ_OFF_T pos;\n\t/** length, marker val included */\n\tint len;\n} opj_marker_info_t;\n/* <<UniPG */\n\n/**\n * Index structure : Information concerning tile-parts\n*/\ntypedef struct opj_tp_info {\n\t/** start position of tile part */\n\tint tp_start_pos;\n\t/** end position of tile part header */\n\tint tp_end_header;\n\t/** end position of tile part */\n\tint tp_end_pos;\n\t/** start packet of tile part */\n\tint tp_start_pack;\n\t/** number of packets of tile part */\n\tint tp_numpacks;\n} opj_tp_info_t;\n\n/**\n * Index structure : information regarding tiles\n*/\ntypedef struct opj_tile_info {\n\t/** value of thresh for each layer by tile cfr. Marcela   */\n\tdouble *thresh;\n\t/** number of tile */\n\tint tileno;\n\t/** start position */\n\tint start_pos;\n\t/** end position of the header */\n\tint end_header;\n\t/** end position */\n\tint end_pos;\n\t/** precinct number for each resolution level (width) */\n\tint pw[33];\n\t/** precinct number for each resolution level (height) */\n\tint ph[33];\n\t/** precinct size (in power of 2), in X for each resolution level */\n\tint pdx[33];\n\t/** precinct size (in power of 2), in Y for each resolution level */\n\tint pdy[33];\n\t/** information concerning packets inside tile */\n\topj_packet_info_t *packet;\n\t/** add fixed_quality */\n\tint numpix;\n\t/** add fixed_quality */\n\tdouble distotile;\n  \t/** number of markers */\n\tint marknum;\n\t/** list of markers */\n\topj_marker_info_t *marker;\n\t/** actual size of markers array */\n\tint maxmarknum;\n\t/** number of tile parts */\n\tint num_tps;\n\t/** information concerning tile parts */\n\topj_tp_info_t *tp;\n} opj_tile_info_t;\n\n/**\n * Index structure of the codestream\n*/\ntypedef struct opj_codestream_info {\n\t/** maximum distortion reduction on the whole image (add for Marcela) */\n\tdouble D_max;\n\t/** packet number */\n\tint packno;\n\t/** writing the packet in the index with t2_encode_packets */\n\tint index_write;\n\t/** image width */\n\tint image_w;\n\t/** image height */\n\tint image_h;\n\t/** progression order */\n\tOPJ_PROG_ORDER prog;\n\t/** tile size in x */\n\tint tile_x;\n\t/** tile size in y */\n\tint tile_y;\n\t/** */\n\tint tile_Ox;\n\t/** */\n\tint tile_Oy;\n\t/** number of tiles in X */\n\tint tw;\n\t/** number of tiles in Y */\n\tint th;\n\t/** component numbers */\n\tint numcomps;\n\t/** number of layer */\n\tint numlayers;\n\t/** number of decomposition for each component */\n\tint *numdecompos;\n/* UniPG>> */\n\t/** number of markers */\n\tint marknum;\n\t/** list of markers */\n\topj_marker_info_t *marker;\n\t/** actual size of markers array */\n\tint maxmarknum;\n/* <<UniPG */\n\t/** main header position */\n\tint main_head_start;\n\t/** main header position */\n\tint main_head_end;\n\t/** codestream's size */\n\tint codestream_size;\n\t/** information regarding tiles inside image */\n\topj_tile_info_t *tile;\n} opj_codestream_info_t;\n\n/* <----------------------------------------------------------- */\n/* new output managment of the codestream information and index */\n\n/**\n * Tile-component coding parameters information\n */\ntypedef struct opj_tccp_info\n{\n\t/** component index */\n\tOPJ_UINT32 compno;\n\t/** coding style */\n\tOPJ_UINT32 csty;\n\t/** number of resolutions */\n\tOPJ_UINT32 numresolutions;\n\t/** code-blocks width */\n\tOPJ_UINT32 cblkw;\n\t/** code-blocks height */\n\tOPJ_UINT32 cblkh;\n\t/** code-block coding style */\n\tOPJ_UINT32 cblksty;\n\t/** discrete wavelet transform identifier */\n\tOPJ_UINT32 qmfbid;\n\t/** quantisation style */\n\tOPJ_UINT32 qntsty;\n\t/** stepsizes used for quantization */\n\tOPJ_UINT32 stepsizes_mant[OPJ_J2K_MAXBANDS];\n\t/** stepsizes used for quantization */\n\tOPJ_UINT32 stepsizes_expn[OPJ_J2K_MAXBANDS];\n\t/** number of guard bits */\n\tOPJ_UINT32 numgbits;\n\t/** Region Of Interest shift */\n\tOPJ_INT32 roishift;\n\t/** precinct width */\n\tOPJ_UINT32 prcw[OPJ_J2K_MAXRLVLS];\n\t/** precinct height */\n\tOPJ_UINT32 prch[OPJ_J2K_MAXRLVLS];\n}\nopj_tccp_info_t;\n\n/**\n * Tile coding parameters information\n */\ntypedef struct opj_tile_v2_info {\n\n\t/** number (index) of tile */\n\tint tileno;\n\t/** coding style */\n\tOPJ_UINT32 csty;\n\t/** progression order */\n\tOPJ_PROG_ORDER prg;\n\t/** number of layers */\n\tOPJ_UINT32 numlayers;\n\t/** multi-component transform identifier */\n\tOPJ_UINT32 mct;\n\n\t/** information concerning tile component parameters*/\n\topj_tccp_info_t *tccp_info;\n\n} opj_tile_info_v2_t;\n\n/**\n * Information structure about the codestream (FIXME should be expand and enhance)\n */\ntypedef struct opj_codestream_info_v2 {\n\t/* Tile info */\n\t/** tile origin in x = XTOsiz */\n\tOPJ_UINT32 tx0;\n\t/** tile origin in y = YTOsiz */\n\tOPJ_UINT32 ty0;\n\t/** tile size in x = XTsiz */\n\tOPJ_UINT32 tdx;\n\t/** tile size in y = YTsiz */\n\tOPJ_UINT32 tdy;\n\t/** number of tiles in X */\n\tOPJ_UINT32 tw;\n\t/** number of tiles in Y */\n\tOPJ_UINT32 th;\n\n\t/** number of components*/\n\tOPJ_UINT32 nbcomps;\n\n\t/** Default information regarding tiles inside image */\n\topj_tile_info_v2_t m_default_tile_info;\n\n\t/** information regarding tiles inside image */\n\topj_tile_info_v2_t *tile_info; /* FIXME not used for the moment */\n\n} opj_codestream_info_v2_t;\n\n\n/**\n * Index structure about a tile part\n */\ntypedef struct opj_tp_index {\n\t/** start position */\n\tOPJ_OFF_T start_pos;\n\t/** end position of the header */\n\tOPJ_OFF_T end_header;\n\t/** end position */\n\tOPJ_OFF_T end_pos;\n\n} opj_tp_index_t;\n\n/**\n * Index structure about a tile\n */\ntypedef struct opj_tile_index {\n\t/** tile index */\n\tOPJ_UINT32 tileno;\n\n\t/** number of tile parts */\n\tOPJ_UINT32 nb_tps;\n\t/** current nb of tile part (allocated)*/\n\tOPJ_UINT32 current_nb_tps;\n\t/** current tile-part index */\n\tOPJ_UINT32 current_tpsno;\n\t/** information concerning tile parts */\n\topj_tp_index_t *tp_index;\n\n\t/* UniPG>> */ /* NOT USED FOR THE MOMENT IN THE V2 VERSION */\n\t\t/** number of markers */\n\t\tOPJ_UINT32 marknum;\n\t\t/** list of markers */\n\t\topj_marker_info_t *marker;\n\t\t/** actual size of markers array */\n\t\tOPJ_UINT32 maxmarknum;\n\t/* <<UniPG */\n\n\t/** packet number */\n\tOPJ_UINT32 nb_packet;\n\t/** information concerning packets inside tile */\n\topj_packet_info_t *packet_index;\n\n} opj_tile_index_t;\n\n/**\n * Index structure of the codestream (FIXME should be expand and enhance)\n */\ntypedef struct opj_codestream_index {\n\t/** main header start position (SOC position) */\n\tOPJ_OFF_T main_head_start;\n\t/** main header end position (first SOT position) */\n\tOPJ_OFF_T main_head_end;\n\n\t/** codestream's size */\n\tOPJ_UINT64 codestream_size;\n\n/* UniPG>> */ /* NOT USED FOR THE MOMENT IN THE V2 VERSION */\n\t/** number of markers */\n\tOPJ_UINT32 marknum;\n\t/** list of markers */\n\topj_marker_info_t *marker;\n\t/** actual size of markers array */\n\tOPJ_UINT32 maxmarknum;\n/* <<UniPG */\n\n\t/** */\n\tOPJ_UINT32 nb_of_tiles;\n\t/** */\n\topj_tile_index_t *tile_index; /* FIXME not used for the moment */\n\n}opj_codestream_index_t;\n/* -----------------------------------------------------------> */\n\n/*\n==========================================================\n   Metadata from the JP2file\n==========================================================\n*/\n\n/**\n * Info structure of the JP2 file\n * EXPERIMENTAL FOR THE MOMENT\n */\ntypedef struct opj_jp2_metadata {\n\t/** */\n\tOPJ_INT32\tnot_used;\n\n} opj_jp2_metadata_t;\n\n/**\n * Index structure of the JP2 file\n * EXPERIMENTAL FOR THE MOMENT\n */\ntypedef struct opj_jp2_index {\n\t/** */\n\tOPJ_INT32\tnot_used;\n\n} opj_jp2_index_t;\n\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n\n/* \n==========================================================\n   openjpeg version\n==========================================================\n*/\n\n/* Get the version of the openjpeg library*/\nOPJ_API const char * OPJ_CALLCONV opj_version(void);\n\n/* \n==========================================================\n   image functions definitions\n==========================================================\n*/\n\n/**\n * Create an image\n *\n * @param numcmpts      number of components\n * @param cmptparms     components parameters\n * @param clrspc        image color space\n * @return returns      a new image structure if successful, returns NULL otherwise\n * */\nOPJ_API opj_image_t* OPJ_CALLCONV opj_image_create(OPJ_UINT32 numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);\n\n/**\n * Deallocate any resources associated with an image\n *\n * @param image         image to be destroyed\n */\nOPJ_API void OPJ_CALLCONV opj_image_destroy(opj_image_t *image);\n\n/**\n * Creates an image without allocating memory for the image (used in the new version of the library).\n *\n * @param\tnumcmpts    the number of components\n * @param\tcmptparms   the components parameters\n * @param\tclrspc      the image color space\n *\n * @return\ta new image structure if successful, NULL otherwise.\n*/\nOPJ_API opj_image_t* OPJ_CALLCONV opj_image_tile_create(OPJ_UINT32 numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc);\n\n/* \n==========================================================\n   stream functions definitions\n==========================================================\n*/\n\n/**\n * Creates an abstract stream. This function does nothing except allocating memory and initializing the abstract stream.\n *\n * @param\tp_is_input\t\tif set to true then the stream will be an input stream, an output stream else.\n *\n * @return\ta stream object.\n*/\nOPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_default_create(OPJ_BOOL p_is_input);\n\n/**\n * Creates an abstract stream. This function does nothing except allocating memory and initializing the abstract stream.\n *\n * @param\tp_buffer_size  FIXME DOC\n * @param\tp_is_input\t\tif set to true then the stream will be an input stream, an output stream else.\n *\n * @return\ta stream object.\n*/\nOPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create(OPJ_SIZE_T p_buffer_size, OPJ_BOOL p_is_input);\n\n/**\n * Destroys a stream created by opj_create_stream. This function does NOT close the abstract stream. If needed the user must\n * close its own implementation of the stream.\n *\n * @param\tp_stream\tthe stream to destroy.\n */\nOPJ_API void OPJ_CALLCONV opj_stream_destroy(opj_stream_t* p_stream);\n \n/**\n * Sets the given function to be used as a read function.\n * @param\t\tp_stream\tthe stream to modify\n * @param\t\tp_function\tthe function to use a read function.\n*/\nOPJ_API void OPJ_CALLCONV opj_stream_set_read_function(opj_stream_t* p_stream, opj_stream_read_fn p_function);\n\n/**\n * Sets the given function to be used as a write function.\n * @param\t\tp_stream\tthe stream to modify\n * @param\t\tp_function\tthe function to use a write function.\n*/\nOPJ_API void OPJ_CALLCONV opj_stream_set_write_function(opj_stream_t* p_stream, opj_stream_write_fn p_function);\n\n/**\n * Sets the given function to be used as a skip function.\n * @param\t\tp_stream\tthe stream to modify\n * @param\t\tp_function\tthe function to use a skip function.\n*/\nOPJ_API void OPJ_CALLCONV opj_stream_set_skip_function(opj_stream_t* p_stream, opj_stream_skip_fn p_function);\n\n/**\n * Sets the given function to be used as a seek function, the stream is then seekable.\n * @param\t\tp_stream\tthe stream to modify\n * @param\t\tp_function\tthe function to use a skip function.\n*/\nOPJ_API void OPJ_CALLCONV opj_stream_set_seek_function(opj_stream_t* p_stream, opj_stream_seek_fn p_function);\n\n/**\n * Sets the given data to be used as a user data for the stream.\n * @param\t\tp_stream\tthe stream to modify\n * @param\t\tp_data\t\tthe data to set.\n * @param\t\tp_function\tthe function to free p_data when opj_stream_destroy() is called.\n*/\nOPJ_API void OPJ_CALLCONV opj_stream_set_user_data (opj_stream_t* p_stream, void * p_data, opj_stream_free_user_data_fn p_function);\n\n/**\n * Sets the length of the user data for the stream.\n *\n * @param p_stream    the stream to modify\n * @param data_length length of the user_data.\n*/\nOPJ_API void OPJ_CALLCONV opj_stream_set_user_data_length(opj_stream_t* p_stream, OPJ_UINT64 data_length);\n\n/**\n * Create a stream from a file identified with its filename with default parameters (helper function)\n * @param fname             the filename of the file to stream\n * @param p_is_read_stream  whether the stream is a read stream (true) or not (false)\n*/\nOPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_default_file_stream (const char *fname, OPJ_BOOL p_is_read_stream);\n \n/** Create a stream from a file identified with its filename with a specific buffer size\n * @param fname             the filename of the file to stream\n * @param p_buffer_size     size of the chunk used to stream\n * @param p_is_read_stream  whether the stream is a read stream (true) or not (false)\n*/\nOPJ_API opj_stream_t* OPJ_CALLCONV opj_stream_create_file_stream (const char *fname,\n                                                                     OPJ_SIZE_T p_buffer_size,\n                                                                     OPJ_BOOL p_is_read_stream);\n \n/* \n==========================================================\n   event manager functions definitions\n==========================================================\n*/\n/**\n * Set the info handler use by openjpeg.\n * @param p_codec       the codec previously initialise\n * @param p_callback    the callback function which will be used\n * @param p_user_data   client object where will be returned the message\n*/\nOPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_info_handler(opj_codec_t * p_codec, \n                                                   opj_msg_callback p_callback,\n                                                   void * p_user_data);\n/**\n * Set the warning handler use by openjpeg.\n * @param p_codec       the codec previously initialise\n * @param p_callback    the callback function which will be used\n * @param p_user_data   client object where will be returned the message\n*/\nOPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_warning_handler(opj_codec_t * p_codec,\n                                                      opj_msg_callback p_callback,\n                                                      void * p_user_data);\n/**\n * Set the error handler use by openjpeg.\n * @param p_codec       the codec previously initialise\n * @param p_callback    the callback function which will be used\n * @param p_user_data   client object where will be returned the message\n*/\nOPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_error_handler(opj_codec_t * p_codec, \n                                                    opj_msg_callback p_callback,\n                                                    void * p_user_data);\n\n/* \n==========================================================\n   codec functions definitions\n==========================================================\n*/\n\n/**\n * Creates a J2K/JP2 decompression structure\n * @param format \t\tDecoder to select\n *\n * @return Returns a handle to a decompressor if successful, returns NULL otherwise\n * */\nOPJ_API opj_codec_t* OPJ_CALLCONV opj_create_decompress(OPJ_CODEC_FORMAT format);\n\n/**\n * Destroy a decompressor handle\n *\n * @param\tp_codec\t\t\tdecompressor handle to destroy\n */\nOPJ_API void OPJ_CALLCONV opj_destroy_codec(opj_codec_t * p_codec);\n\n/**\n * Read after the codestream if necessary\n * @param\tp_codec\t\t\tthe JPEG2000 codec to read.\n * @param\tp_stream\t\tthe JPEG2000 stream.\n */\nOPJ_API OPJ_BOOL OPJ_CALLCONV opj_end_decompress (\topj_codec_t *p_codec,\n\t\t\t\t\t\t\t\t\t\t\t\t\topj_stream_t *p_stream);\n\n\n/**\n * Set decoding parameters to default values\n * @param parameters Decompression parameters\n */\nOPJ_API void OPJ_CALLCONV opj_set_default_decoder_parameters(opj_dparameters_t *parameters);\n\n/**\n * Setup the decoder with decompression parameters provided by the user and with the message handler\n * provided by the user.\n *\n * @param p_codec \t\tdecompressor handler\n * @param parameters \tdecompression parameters\n *\n * @return true\t\t\tif the decoder is correctly set\n */\nOPJ_API OPJ_BOOL OPJ_CALLCONV opj_setup_decoder(opj_codec_t *p_codec,\n\t\t\t\t\t\t\t\t\t\t\t\topj_dparameters_t *parameters );\n\n/**\n * Decodes an image header.\n *\n * @param\tp_stream\t\tthe jpeg2000 stream.\n * @param\tp_codec\t\t\tthe jpeg2000 codec to read.\n * @param\tp_image\t\t\tthe image structure initialized with the characteristics of encoded image.\n *\n * @return true\t\t\t\tif the main header of the codestream and the JP2 header is correctly read.\n */\nOPJ_API OPJ_BOOL OPJ_CALLCONV opj_read_header (\topj_stream_t *p_stream,\n\t\t\t\t\t\t\t\t\t\t\t\topj_codec_t *p_codec,\n\t\t\t\t\t\t\t\t\t\t\t\topj_image_t **p_image);\n\n/**\n * Sets the given area to be decoded. This function should be called right after opj_read_header and before any tile header reading.\n *\n * @param\tp_codec\t\t\tthe jpeg2000 codec.\n * @param\tp_image         the decoded image previously setted by opj_read_header\n * @param\tp_start_x\t\tthe left position of the rectangle to decode (in image coordinates).\n * @param\tp_end_x\t\t\tthe right position of the rectangle to decode (in image coordinates).\n * @param\tp_start_y\t\tthe up position of the rectangle to decode (in image coordinates).\n * @param\tp_end_y\t\t\tthe bottom position of the rectangle to decode (in image coordinates).\n *\n * @return\ttrue\t\t\tif the area could be set.\n */\nOPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_decode_area(\topj_codec_t *p_codec,\n\t\t\t\t\t\t\t\t\t\t\t\t\topj_image_t* p_image,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOPJ_INT32 p_start_x, OPJ_INT32 p_start_y,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOPJ_INT32 p_end_x, OPJ_INT32 p_end_y );\n\n/**\n * Decode an image from a JPEG-2000 codestream\n *\n * @param p_decompressor \tdecompressor handle\n * @param p_stream\t\t\tInput buffer stream\n * @param p_image \t\t\tthe decoded image\n * @return \t\t\t\t\ttrue if success, otherwise false\n * */\nOPJ_API OPJ_BOOL OPJ_CALLCONV opj_decode(   opj_codec_t *p_decompressor,\n                                            opj_stream_t *p_stream,\n                                            opj_image_t *p_image);\n\n/**\n * Get the decoded tile from the codec\n *\n * @param\tp_codec\t\t\tthe jpeg2000 codec.\n * @param\tp_stream\t\tinput streamm\n * @param\tp_image\t\t\toutput image\n * @param\ttile_index\t\tindex of the tile which will be decode\n *\n * @return\t\t\t\t\ttrue if success, otherwise false\n */\nOPJ_API OPJ_BOOL OPJ_CALLCONV opj_get_decoded_tile(\topj_codec_t *p_codec,\n\t\t\t\t\t\t\t\t\t\t\t\t\topj_stream_t *p_stream,\n\t\t\t\t\t\t\t\t\t\t\t\t\topj_image_t *p_image,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOPJ_UINT32 tile_index);\n\n/**\n * Set the resolution factor of the decoded image\n * @param\tp_codec\t\t\tthe jpeg2000 codec.\n * @param\tres_factor\t\tresolution factor to set\n *\n * @return\t\t\t\t\ttrue if success, otherwise false\n */\nOPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_decoded_resolution_factor(opj_codec_t *p_codec, OPJ_UINT32 res_factor);\n\n/**\n * Writes a tile with the given data.\n *\n * @param\tp_codec\t\t        the jpeg2000 codec.\n * @param\tp_tile_index\t\tthe index of the tile to write. At the moment, the tiles must be written from 0 to n-1 in sequence.\n * @param\tp_data\t\t\t\tpointer to the data to write. Data is arranged in sequence, data_comp0, then data_comp1, then ... NO INTERLEAVING should be set.\n * @param\tp_data_size\t\t\tthis value os used to make sure the data being written is correct. The size must be equal to the sum for each component of \n *                              tile_width * tile_height * component_size. component_size can be 1,2 or 4 bytes, depending on the precision of the given component.\n * @param\tp_stream\t\t\tthe stream to write data to.\n *\n * @return\ttrue if the data could be written.\n */\nOPJ_API OPJ_BOOL OPJ_CALLCONV opj_write_tile (\topj_codec_t *p_codec,\n\t\t\t\t\t\t\t\t\t\t\t\tOPJ_UINT32 p_tile_index,\n\t\t\t\t\t\t\t\t\t\t\t\tOPJ_BYTE * p_data,\n\t\t\t\t\t\t\t\t\t\t\t\tOPJ_UINT32 p_data_size,\n\t\t\t\t\t\t\t\t\t\t\t\topj_stream_t *p_stream );\n\n/**\n * Reads a tile header. This function is compulsory and allows one to know the size of the tile thta will be decoded.\n * The user may need to refer to the image got by opj_read_header to understand the size being taken by the tile.\n *\n * @param\tp_codec\t\t\tthe jpeg2000 codec.\n * @param\tp_tile_index\tpointer to a value that will hold the index of the tile being decoded, in case of success.\n * @param\tp_data_size\t\tpointer to a value that will hold the maximum size of the decoded data, in case of success. In case\n *\t\t\t\t\t\t\tof truncated codestreams, the actual number of bytes decoded may be lower. The computation of the size is the same\n *\t\t\t\t\t\t\tas depicted in opj_write_tile.\n * @param\tp_tile_x0\t\tpointer to a value that will hold the x0 pos of the tile (in the image).\n * @param\tp_tile_y0\t\tpointer to a value that will hold the y0 pos of the tile (in the image).\n * @param\tp_tile_x1\t\tpointer to a value that will hold the x1 pos of the tile (in the image).\n * @param\tp_tile_y1\t\tpointer to a value that will hold the y1 pos of the tile (in the image).\n * @param\tp_nb_comps\t\tpointer to a value that will hold the number of components in the tile.\n * @param\tp_should_go_on\tpointer to a boolean that will hold the fact that the decoding should go on. In case the\n *\t\t\t\t\t\t\tcodestream is over at the time of the call, the value will be set to false. The user should then stop\n *\t\t\t\t\t\t\tthe decoding.\n * @param\tp_stream\t\tthe stream to decode.\n * @return\ttrue\t\t\tif the tile header could be decoded. In case the decoding should end, the returned value is still true.\n *\t\t\t\t\t\t\treturning false may be the result of a shortage of memory or an internal error.\n */\nOPJ_API OPJ_BOOL OPJ_CALLCONV opj_read_tile_header(\topj_codec_t *p_codec,\n\t\t\t\t\t\t\t\t\t\t\t\topj_stream_t * p_stream,\n\t\t\t\t\t\t\t\t\t\t\t\tOPJ_UINT32 * p_tile_index,\n\t\t\t\t\t\t\t\t\t\t\t\tOPJ_UINT32 * p_data_size,\n\t\t\t\t\t\t\t\t\t\t\t\tOPJ_INT32 * p_tile_x0, OPJ_INT32 * p_tile_y0,\n\t\t\t\t\t\t\t\t\t\t\t\tOPJ_INT32 * p_tile_x1, OPJ_INT32 * p_tile_y1,\n\t\t\t\t\t\t\t\t\t\t\t\tOPJ_UINT32 * p_nb_comps,\n\t\t\t\t\t\t\t\t\t\t\t\tOPJ_BOOL * p_should_go_on );\n\n/**\n * Reads a tile data. This function is compulsory and allows one to decode tile data. opj_read_tile_header should be called before.\n * The user may need to refer to the image got by opj_read_header to understand the size being taken by the tile.\n *\n * @param\tp_codec\t\t\tthe jpeg2000 codec.\n * @param\tp_tile_index\tthe index of the tile being decoded, this should be the value set by opj_read_tile_header.\n * @param\tp_data\t\t\tpointer to a memory block that will hold the decoded data.\n * @param\tp_data_size\t\tsize of p_data. p_data_size should be bigger or equal to the value set by opj_read_tile_header.\n * @param\tp_stream\t\tthe stream to decode.\n *\n * @return\ttrue\t\t\tif the data could be decoded.\n */\nOPJ_API OPJ_BOOL OPJ_CALLCONV opj_decode_tile_data(\topj_codec_t *p_codec,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOPJ_UINT32 p_tile_index,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOPJ_BYTE * p_data,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOPJ_UINT32 p_data_size,\n\t\t\t\t\t\t\t\t\t\t\t\t\topj_stream_t *p_stream );\n\n/* COMPRESSION FUNCTIONS*/\n\n/**\n * Creates a J2K/JP2 compression structure\n * @param \tformat \t\tCoder to select\n * @return \t\t\t\tReturns a handle to a compressor if successful, returns NULL otherwise\n */\nOPJ_API opj_codec_t* OPJ_CALLCONV opj_create_compress(OPJ_CODEC_FORMAT format);\n\n/**\nSet encoding parameters to default values, that means : \n<ul>\n<li>Lossless\n<li>1 tile\n<li>Size of precinct : 2^15 x 2^15 (means 1 precinct)\n<li>Size of code-block : 64 x 64\n<li>Number of resolutions: 6\n<li>No SOP marker in the codestream\n<li>No EPH marker in the codestream\n<li>No sub-sampling in x or y direction\n<li>No mode switch activated\n<li>Progression order: LRCP\n<li>No index file\n<li>No ROI upshifted\n<li>No offset of the origin of the image\n<li>No offset of the origin of the tiles\n<li>Reversible DWT 5-3\n</ul>\n@param parameters Compression parameters\n*/\nOPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters(opj_cparameters_t *parameters);\n\n/**\n * Setup the encoder parameters using the current image and using user parameters.\n * @param p_codec \t\tCompressor handle\n * @param parameters \tCompression parameters\n * @param image \t\tInput filled image\n */\nOPJ_API OPJ_BOOL OPJ_CALLCONV opj_setup_encoder(opj_codec_t *p_codec, \n\t\t\t\t\t\t\t\t\t\t\t\topj_cparameters_t *parameters, \n\t\t\t\t\t\t\t\t\t\t\t\topj_image_t *image);\n\n/**\n * Start to compress the current image.\n * @param p_codec \t\tCompressor handle\n * @param image \t    Input filled image\n * @param p_stream \t\tInput stgream\n */\nOPJ_API OPJ_BOOL OPJ_CALLCONV opj_start_compress (\topj_codec_t *p_codec,\n\t\t\t\t\t\t\t\t\t\t\t\t\topj_image_t * p_image,\n\t\t\t\t\t\t\t\t\t\t\t\t\topj_stream_t *p_stream);\n\n/**\n * End to compress the current image.\n * @param p_codec \t\tCompressor handle\n * @param p_stream \t\tInput stgream\n */\nOPJ_API OPJ_BOOL OPJ_CALLCONV opj_end_compress (opj_codec_t *p_codec,\n\t\t\t\t\t\t\t\t\t\t\t\topj_stream_t *p_stream);\n\n/**\n * Encode an image into a JPEG-2000 codestream\n * @param p_codec \t\tcompressor handle\n * @param p_stream \t\tOutput buffer stream\n *\n * @return \t\t\t\tReturns true if successful, returns false otherwise\n */\nOPJ_API OPJ_BOOL OPJ_CALLCONV opj_encode(opj_codec_t *p_codec,\n                                         opj_stream_t *p_stream);\n/*\n==========================================================\n   codec output functions definitions\n==========================================================\n*/\n/* EXPERIMENTAL FUNCTIONS FOR NOW, USED ONLY IN J2K_DUMP*/\n\n/**\nDestroy Codestream information after compression or decompression\n@param cstr_info Codestream information structure\n*/\nOPJ_API void OPJ_CALLCONV opj_destroy_cstr_info(opj_codestream_info_v2_t **cstr_info);\n\n\n/**\n * Dump the codec information into the output stream\n *\n * @param\tp_codec\t\t\tthe jpeg2000 codec.\n * @param\tinfo_flag\t\ttype of information dump.\n * @param\toutput_stream\toutput stream where dump the informations get from the codec.\n *\n */\nOPJ_API void OPJ_CALLCONV opj_dump_codec(\topj_codec_t *p_codec,\n\t\t\t\t\t\t\t\t\t\t\tOPJ_INT32 info_flag,\n\t\t\t\t\t\t\t\t\t\t\tFILE* output_stream);\n\n/**\n * Get the codestream information from the codec\n *\n * @param\tp_codec\t\t\tthe jpeg2000 codec.\n *\n * @return\t\t\t\t\ta pointer to a codestream information structure.\n *\n */\nOPJ_API opj_codestream_info_v2_t* OPJ_CALLCONV opj_get_cstr_info(opj_codec_t *p_codec);\n\n/**\n * Get the codestream index from the codec\n *\n * @param\tp_codec\t\t\tthe jpeg2000 codec.\n *\n * @return\t\t\t\t\ta pointer to a codestream index structure.\n *\n */\nOPJ_API opj_codestream_index_t * OPJ_CALLCONV opj_get_cstr_index(opj_codec_t *p_codec);\n\nOPJ_API void OPJ_CALLCONV opj_destroy_cstr_index(opj_codestream_index_t **p_cstr_index);\n\n\n/**\n * Get the JP2 file information from the codec FIXME\n *\n * @param\tp_codec\t\t\tthe jpeg2000 codec.\n *\n * @return\t\t\t\t\ta pointer to a JP2 metadata structure.\n *\n */\nOPJ_API opj_jp2_metadata_t* OPJ_CALLCONV opj_get_jp2_metadata(opj_codec_t *p_codec);\n\n/**\n * Get the JP2 file index from the codec FIXME\n *\n * @param\tp_codec\t\t\tthe jpeg2000 codec.\n *\n * @return\t\t\t\t\ta pointer to a JP2 index structure.\n *\n */\nOPJ_API opj_jp2_index_t* OPJ_CALLCONV opj_get_jp2_index(opj_codec_t *p_codec);\n\n\n/*\n==========================================================\n   MCT functions\n==========================================================\n*/\n\n/**\n * Sets the MCT matrix to use.\n *\n * @param\tparameters\t\tthe parameters to change.\n * @param\tpEncodingMatrix\tthe encoding matrix.\n * @param\tp_dc_shift\t\tthe dc shift coefficients to use.\n * @param\tpNbComp\t\t\tthe number of components of the image.\n *\n * @return\ttrue if the parameters could be set.\n */\nOPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_MCT( opj_cparameters_t *parameters,\n\t\t                               \t   OPJ_FLOAT32 * pEncodingMatrix,\n\t\t                               \t   OPJ_INT32 * p_dc_shift,\n\t\t                               \t   OPJ_UINT32 pNbComp);\n\n\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* OPENJPEG_H */\n"
  },
  {
    "path": "ext/openjpeg/opj_clock.c",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifdef _WIN32\n#include <windows.h>\n#else\n#include <sys/time.h>\n#include <sys/resource.h>\n#include <sys/times.h>\n#endif /* _WIN32 */\n#include \"opj_includes.h\"\n\nOPJ_FLOAT64 opj_clock(void) {\n#ifdef _WIN32\n\t/* _WIN32: use QueryPerformance (very accurate) */\n    LARGE_INTEGER freq , t ;\n    /* freq is the clock speed of the CPU */\n    QueryPerformanceFrequency(&freq) ;\n\t/* cout << \"freq = \" << ((double) freq.QuadPart) << endl; */\n    /* t is the high resolution performance counter (see MSDN) */\n    QueryPerformanceCounter ( & t ) ;\n    return ( t.QuadPart /(OPJ_FLOAT64) freq.QuadPart ) ;\n#else\n\t/* Unix or Linux: use resource usage */\n    struct rusage t;\n    OPJ_FLOAT64 procTime;\n    /* (1) Get the rusage data structure at this moment (man getrusage) */\n    getrusage(0,&t);\n    /* (2) What is the elapsed time ? - CPU time = User time + System time */\n\t/* (2a) Get the seconds */\n    procTime = (OPJ_FLOAT64)(t.ru_utime.tv_sec + t.ru_stime.tv_sec);\n    /* (2b) More precisely! Get the microseconds part ! */\n    return ( procTime + (OPJ_FLOAT64)(t.ru_utime.tv_usec + t.ru_stime.tv_usec) * 1e-6 ) ;\n#endif\n}\n\n"
  },
  {
    "path": "ext/openjpeg/opj_clock.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n#ifndef __OPJ_CLOCK_H\n#define __OPJ_CLOCK_H\n/**\n@file opj_clock.h\n@brief Internal function for timing\n\nThe functions in OPJ_CLOCK.C are internal utilities mainly used for timing.\n*/\n\n/** @defgroup MISC MISC - Miscellaneous internal functions */\n/*@{*/\n\n/** @name Exported functions */\n/*@{*/\n/* ----------------------------------------------------------------------- */\n\n/**\nDifference in successive opj_clock() calls tells you the elapsed time\n@return Returns time in seconds\n*/\nOPJ_FLOAT64 opj_clock(void);\n\n/* ----------------------------------------------------------------------- */\n/*@}*/\n\n/*@}*/\n\n#endif /* __OPJ_CLOCK_H */\n\n"
  },
  {
    "path": "ext/openjpeg/opj_codec.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n#ifndef __OPJ_CODEC_H\n#define __OPJ_CODEC_H\n/**\n@file opj_codec.h\n*/\n\n\n/**\n * Main codec handler used for compression or decompression.\n */\ntypedef struct opj_codec_private\n{\n    /** FIXME DOC */\n    union\n    {\n        /**\n         * Decompression handler.\n         */\n        struct opj_decompression\n        {\n            /** Main header reading function handler */\n            OPJ_BOOL (*opj_read_header) ( struct opj_stream_private * cio,\n                                          void * p_codec,\n                                          opj_image_t **p_image,\n                                          struct opj_event_mgr * p_manager);\n\n            /** Decoding function */\n            OPJ_BOOL (*opj_decode) ( void * p_codec,\n                                     struct opj_stream_private * p_cio,\n                                     opj_image_t * p_image,\n                                     struct opj_event_mgr * p_manager);\n\n            /** FIXME DOC */\n            OPJ_BOOL (*opj_read_tile_header)( void * p_codec,\n                                              OPJ_UINT32 * p_tile_index,\n                                              OPJ_UINT32 * p_data_size,\n                                              OPJ_INT32 * p_tile_x0,\n                                              OPJ_INT32 * p_tile_y0,\n                                              OPJ_INT32 * p_tile_x1,\n                                              OPJ_INT32 * p_tile_y1,\n                                              OPJ_UINT32 * p_nb_comps,\n                                              OPJ_BOOL * p_should_go_on,\n                                              struct opj_stream_private * p_cio,\n                                              struct opj_event_mgr * p_manager);\n\n            /** FIXME DOC */\n            OPJ_BOOL (*opj_decode_tile_data)( void * p_codec,\n                                              OPJ_UINT32 p_tile_index,\n                                              OPJ_BYTE * p_data,\n                                              OPJ_UINT32 p_data_size,\n                                              struct opj_stream_private * p_cio,\n                                              struct opj_event_mgr * p_manager);\n\n            /** Reading function used after codestream if necessary */\n            OPJ_BOOL (* opj_end_decompress) ( void *p_codec,\n                                              struct opj_stream_private * cio,\n                                              struct opj_event_mgr * p_manager);\n\n            /** Codec destroy function handler */\n            void (*opj_destroy) (void * p_codec);\n\n            /** Setup decoder function handler */\n            void (*opj_setup_decoder) ( void * p_codec, opj_dparameters_t * p_param);\n\n            /** Set decode area function handler */\n            OPJ_BOOL (*opj_set_decode_area) ( void * p_codec,\n                                              opj_image_t * p_image,\n                                              OPJ_INT32 p_start_x,\n                                              OPJ_INT32 p_end_x,\n                                              OPJ_INT32 p_start_y,\n                                              OPJ_INT32 p_end_y,\n                                              struct opj_event_mgr * p_manager);\n\n            /** Get tile function */\n            OPJ_BOOL (*opj_get_decoded_tile) ( void *p_codec,\n                                               opj_stream_private_t * p_cio,\n                                               opj_image_t *p_image,\n                                               struct opj_event_mgr * p_manager,\n                                               OPJ_UINT32 tile_index);\n\n            /** Set the decoded resolution factor */\n            OPJ_BOOL (*opj_set_decoded_resolution_factor) ( void * p_codec,\n                                                            OPJ_UINT32 res_factor,\n                                                            opj_event_mgr_t * p_manager);\n        } m_decompression;\n\n        /**\n         * Compression handler. FIXME DOC\n         */\n        struct opj_compression\n        {\n            OPJ_BOOL (* opj_start_compress) ( void *p_codec,\n                                              struct opj_stream_private * cio,\n                                              struct opj_image * p_image,\n                                              struct opj_event_mgr * p_manager);\n\n            OPJ_BOOL (* opj_encode) ( void * p_codec,\n                                      struct opj_stream_private *p_cio,\n                                      struct opj_event_mgr * p_manager);\n\n            OPJ_BOOL (* opj_write_tile) ( void * p_codec,\n                                          OPJ_UINT32 p_tile_index,\n                                          OPJ_BYTE * p_data,\n                                          OPJ_UINT32 p_data_size,\n                                          struct opj_stream_private * p_cio,\n                                          struct opj_event_mgr * p_manager);\n\n            OPJ_BOOL (* opj_end_compress) (\tvoid * p_codec,\n                                            struct opj_stream_private * p_cio,\n                                            struct opj_event_mgr * p_manager);\n\n            void (* opj_destroy) (void * p_codec);\n\n            void (* opj_setup_encoder) ( void * p_codec,\n                                         opj_cparameters_t * p_param,\n                                         struct opj_image * p_image,\n                                         struct opj_event_mgr * p_manager);\n        } m_compression;\n    } m_codec_data;\n    /** FIXME DOC*/\n    void * m_codec;\n    /** Event handler */\n    opj_event_mgr_t m_event_mgr;\n    /** Flag to indicate if the codec is used to decode or encode*/\n    OPJ_BOOL is_decompressor;\n    void (*opj_dump_codec) (void * p_codec, OPJ_INT32 info_flag, FILE* output_stream);\n    opj_codestream_info_v2_t* (*opj_get_codec_info)(void* p_codec);\n    opj_codestream_index_t* (*opj_get_codec_index)(void* p_codec);\n}\nopj_codec_private_t;\n\n\n#endif /* __OPJ_CODEC_H */\n\n"
  },
  {
    "path": "ext/openjpeg/opj_config.h",
    "content": "// #define OPJ_HAVE_STDINT_H\n\n#define OPJ_VERSION_MAJOR 2\n#define OPJ_VERSION_MINOR 1\n#define OPJ_VERSION_BUILD 0\n"
  },
  {
    "path": "ext/openjpeg/opj_config.h.cmake.in",
    "content": "/* create opj_config.h for CMake */\n#cmakedefine OPJ_HAVE_STDINT_H \t\t@OPJ_HAVE_STDINT_H@\n\n/*--------------------------------------------------------------------------*/\n/* OpenJPEG Versioning                                                      */\n\n/* Version number. */\n#define OPJ_VERSION_MAJOR @OPENJPEG_VERSION_MAJOR@\n#define OPJ_VERSION_MINOR @OPENJPEG_VERSION_MINOR@\n#define OPJ_VERSION_BUILD @OPENJPEG_VERSION_BUILD@\n"
  },
  {
    "path": "ext/openjpeg/opj_config_private.h",
    "content": "// #define OPJ_HAVE_STDINT_H\n\n#define OPJ_PACKAGE_VERSION \"2.1.0\"\n\n// #define OPJ_HAVE_INTTYPES_H\n// #define OPJ_HAVE_FSEEKO\n\n#define OPJ_STATIC\n#define OPJ_EXPORTS\n\n#define USE_JPIP\n"
  },
  {
    "path": "ext/openjpeg/opj_config_private.h.cmake.in",
    "content": "/* create opj_config_private.h for CMake */\n#cmakedefine OPJ_HAVE_INTTYPES_H \t@OPJ_HAVE_INTTYPES_H@\n\n#define OPJ_PACKAGE_VERSION \"@PACKAGE_VERSION@\"\n\n/* Not used by openjp2*/\n/*#cmakedefine HAVE_MEMORY_H @HAVE_MEMORY_H@*/\n/*#cmakedefine HAVE_STDLIB_H @HAVE_STDLIB_H@*/\n/*#cmakedefine HAVE_STRINGS_H @HAVE_STRINGS_H@*/\n/*#cmakedefine HAVE_STRING_H @HAVE_STRING_H@*/\n/*#cmakedefine HAVE_SYS_STAT_H @HAVE_SYS_STAT_H@*/\n/*#cmakedefine HAVE_SYS_TYPES_H @HAVE_SYS_TYPES_H@ */\n/*#cmakedefine HAVE_UNISTD_H @HAVE_UNISTD_H@*/\n\n#cmakedefine _LARGEFILE_SOURCE\n#cmakedefine _LARGE_FILES\n#cmakedefine _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@\n#cmakedefine OPJ_HAVE_FSEEKO @OPJ_HAVE_FSEEKO@\n\n/* Byte order.  */\n/* All compilers that support Mac OS X define either __BIG_ENDIAN__ or\n__LITTLE_ENDIAN__ to match the endianness of the architecture being\ncompiled for. This is not necessarily the same as the architecture of the\nmachine doing the building. In order to support Universal Binaries on\nMac OS X, we prefer those defines to decide the endianness.\nOn other platforms we use the result of the TRY_RUN. */\n#if !defined(__APPLE__)\n#cmakedefine OPJ_BIG_ENDIAN\n#elif defined(__BIG_ENDIAN__)\n# define OPJ_BIG_ENDIAN\n#endif"
  },
  {
    "path": "ext/openjpeg/opj_includes.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR \n * Copyright (c) 2012, CS Systemes d'Information, France\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n#ifndef OPJ_INCLUDES_H\n#define OPJ_INCLUDES_H\n\n/*\n * This must be included before any system headers,\n * since they can react to macro defined there\n */\n#include \"opj_config_private.h\"\n\n/*\n ==========================================================\n   Standard includes used by the library\n ==========================================================\n*/\n#include <memory.h>\n#include <stdlib.h>\n#include <string.h>\n#include <math.h>\n#include <float.h>\n#include <time.h>\n#include <stdio.h>\n#include <stdarg.h>\n#include <ctype.h>\n#include <assert.h>\n\n/*\n  Use fseeko() and ftello() if they are available since they use\n  'off_t' rather than 'long'.  It is wrong to use fseeko() and\n  ftello() only on systems with special LFS support since some systems\n  (e.g. FreeBSD) support a 64-bit off_t by default.\n*/\n#if defined(OPJ_HAVE_FSEEKO) && !defined(fseek)\n#  define fseek  fseeko\n#  define ftell  ftello\n#endif\n\n\n#if defined(WIN32) && !defined(Windows95) && !defined(__BORLANDC__) && \\\n  !(defined(_MSC_VER) && _MSC_VER < 1400) && \\\n  !(defined(__MINGW32__) && __MSVCRT_VERSION__ < 0x800)\n  /*\n    Windows '95 and Borland C do not support _lseeki64\n    Visual Studio does not support _fseeki64 and _ftelli64 until the 2005 release.\n    Without these interfaces, files over 2GB in size are not supported for Windows.\n  */\n#  define OPJ_FSEEK(stream,offset,whence) _fseeki64(stream,/* __int64 */ offset,whence)\n#  define OPJ_FSTAT(fildes,stat_buff) _fstati64(fildes,/* struct _stati64 */ stat_buff)\n#  define OPJ_FTELL(stream) /* __int64 */ _ftelli64(stream)\n#  define OPJ_STAT_STRUCT_T struct _stati64\n#  define OPJ_STAT(path,stat_buff) _stati64(path,/* struct _stati64 */ stat_buff)\n#else\n#  define OPJ_FSEEK(stream,offset,whence) fseek(stream,offset,whence)\n#  define OPJ_FSTAT(fildes,stat_buff) fstat(fildes,stat_buff)\n#  define OPJ_FTELL(stream) ftell(stream)\n#  define OPJ_STAT_STRUCT_T struct stat\n#  define OPJ_STAT(path,stat_buff) stat(path,stat_buff)\n#endif\n\n\n/*\n ==========================================================\n   OpenJPEG interface\n ==========================================================\n */\n#include \"openjpeg.h\"\n\n/*\n ==========================================================\n   OpenJPEG modules\n ==========================================================\n*/\n\n/* Ignore GCC attributes if this is not GCC */\n#ifndef __GNUC__\n\t#define __attribute__(x) /* __attribute__(x) */\n#endif\n\n\n/* Are restricted pointers available? (C99) */\n#if (__STDC_VERSION__ != 199901L)\n\t/* Not a C99 compiler */\n\t#ifdef __GNUC__\n\t\t#define restrict __restrict__\n\t#else\n\t\t#define restrict /* restrict */\n\t#endif\n#endif\n\n/* MSVC before 2013 and Borland C do not have lrintf */\n#if defined(_MSC_VER) && (_MSC_VER < 1800) || defined(__BORLANDC__)\nstatic INLINE long lrintf(float f){\n#ifdef _M_X64\n    return (long)((f>0.0f) ? (f + 0.5f):(f -0.5f));\n#else\n    int i;\n \n    _asm{\n        fld f\n        fistp i\n    };\n \n    return i;\n#endif\n}\n#endif\n\n#include \"opj_inttypes.h\"\n#include \"opj_clock.h\"\n#include \"opj_malloc.h\"\n#include \"function_list.h\"\n#include \"event.h\"\n#include \"bio.h\"\n#include \"cio.h\"\n\n#include \"image.h\"\n#include \"invert.h\"\n#include \"j2k.h\"\n#include \"jp2.h\"\n\n#include \"mqc.h\"\n#include \"raw.h\"\n#include \"bio.h\"\n\n#include \"pi.h\"\n#include \"tgt.h\"\n#include \"tcd.h\"\n#include \"t1.h\"\n#include \"dwt.h\"\n#include \"t2.h\"\n#include \"mct.h\"\n#include \"opj_intmath.h\"\n\n#ifdef USE_JPIP\n#include \"cidx_manager.h\"\n#include \"indexbox_manager.h\"\n#endif\n\n/* JPWL>> */\n#ifdef USE_JPWL\n#include \"openjpwl/jpwl.h\"\n#endif /* USE_JPWL */\n/* <<JPWL */\n\n/* V2 */\n#include \"opj_codec.h\"\n\n\n#endif /* OPJ_INCLUDES_H */\n"
  },
  {
    "path": "ext/openjpeg/opj_intmath.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n#ifndef __INT_H\n#define __INT_H\n/**\n@file opj_intmath.h\n@brief Implementation of operations on integers (INT)\n\nThe functions in OPJ_INTMATH.H have for goal to realize operations on integers.\n*/\n\n/** @defgroup OPJ_INTMATH OPJ_INTMATH - Implementation of operations on integers */\n/*@{*/\n\n/** @name Exported functions (see also openjpeg.h) */\n/*@{*/\n/* ----------------------------------------------------------------------- */\n/**\nGet the minimum of two integers\n@return Returns a if a < b else b\n*/\nstatic INLINE OPJ_INT32 opj_int_min(OPJ_INT32 a, OPJ_INT32 b) {\n\treturn a < b ? a : b;\n}\n\n/**\nGet the minimum of two integers\n@return Returns a if a < b else b\n*/\nstatic INLINE OPJ_UINT32 opj_uint_min(OPJ_UINT32 a, OPJ_UINT32 b) {\n\treturn a < b ? a : b;\n}\n\n/**\nGet the maximum of two integers\n@return Returns a if a > b else b\n*/\nstatic INLINE OPJ_INT32 opj_int_max(OPJ_INT32 a, OPJ_INT32 b) {\n\treturn (a > b) ? a : b;\n}\n\n/**\nGet the maximum of two integers\n@return Returns a if a > b else b\n*/\nstatic INLINE OPJ_UINT32 opj_uint_max(OPJ_UINT32  a, OPJ_UINT32  b) {\n\treturn (a > b) ? a : b;\n}\n\n/**\nClamp an integer inside an interval\n@return\n<ul>\n<li>Returns a if (min < a < max)\n<li>Returns max if (a > max)\n<li>Returns min if (a < min) \n</ul>\n*/\nstatic INLINE OPJ_INT32 opj_int_clamp(OPJ_INT32 a, OPJ_INT32 min, OPJ_INT32 max) {\n\tif (a < min)\n\t\treturn min;\n\tif (a > max)\n\t\treturn max;\n\treturn a;\n}\n/**\n@return Get absolute value of integer\n*/\nstatic INLINE OPJ_INT32 opj_int_abs(OPJ_INT32 a) {\n\treturn a < 0 ? -a : a;\n}\n/**\nDivide an integer and round upwards\n@return Returns a divided by b\n*/\nstatic INLINE OPJ_INT32 opj_int_ceildiv(OPJ_INT32 a, OPJ_INT32 b) {\n  assert(b);\n\treturn (a + b - 1) / b;\n}\n\n/**\nDivide an integer and round upwards\n@return Returns a divided by b\n*/\nstatic INLINE OPJ_UINT32  opj_uint_ceildiv(OPJ_UINT32  a, OPJ_UINT32  b) {\n\treturn (a + b - 1) / b;\n}\n\n/**\nDivide an integer by a power of 2 and round upwards\n@return Returns a divided by 2^b\n*/\nstatic INLINE OPJ_INT32 opj_int_ceildivpow2(OPJ_INT32 a, OPJ_INT32 b) {\n\treturn (OPJ_INT32)((a + (OPJ_INT64)(1 << b) - 1) >> b);\n}\n/**\nDivide an integer by a power of 2 and round downwards\n@return Returns a divided by 2^b\n*/\nstatic INLINE OPJ_INT32 opj_int_floordivpow2(OPJ_INT32 a, OPJ_INT32 b) {\n\treturn a >> b;\n}\n/**\nGet logarithm of an integer and round downwards\n@return Returns log2(a)\n*/\nstatic INLINE OPJ_INT32 opj_int_floorlog2(OPJ_INT32 a) {\n\tOPJ_INT32 l;\n\tfor (l = 0; a > 1; l++) {\n\t\ta >>= 1;\n\t}\n\treturn l;\n}\n/**\nGet logarithm of an integer and round downwards\n@return Returns log2(a)\n*/\nstatic INLINE OPJ_UINT32  opj_uint_floorlog2(OPJ_UINT32  a) {\n\tOPJ_UINT32  l;\n\tfor (l = 0; a > 1; ++l)\n\t{\n\t\ta >>= 1;\n\t}\n\treturn l;\n}\n\n/**\nMultiply two fixed-precision rational numbers.\n@param a\n@param b\n@return Returns a * b\n*/\nstatic INLINE OPJ_INT32 opj_int_fix_mul(OPJ_INT32 a, OPJ_INT32 b) {\n    OPJ_INT64 temp = (OPJ_INT64) a * (OPJ_INT64) b ;\n    temp += temp & 4096;\n    return (OPJ_INT32) (temp >> 13) ;\n}\n\n/* ----------------------------------------------------------------------- */\n/*@}*/\n\n/*@}*/\n\n#endif\n"
  },
  {
    "path": "ext/openjpeg/opj_inttypes.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2012, Mathieu Malaterre <mathieu.malaterre@gmail.com>\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n#ifndef OPJ_INTTYPES_H\n#define OPJ_INTTYPES_H\n\n#include \"opj_config_private.h\"\n#ifdef OPJ_HAVE_INTTYPES_H\n#include <inttypes.h>\n#else\n#if defined(_WIN32)\n#define PRId64 \"I64d\"\n#define PRIi64 \"I64i\"\n#define PRIu64 \"I64u\"\n#define PRIx64 \"I64x\"\n#else\n#error unsupported platform\n#endif\n#endif\n\n#endif /* OPJ_INTTYPES_H */\n"
  },
  {
    "path": "ext/openjpeg/opj_malloc.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2007, Callum Lerwick <seg@haxxed.com>\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n#ifndef __OPJ_MALLOC_H\n#define __OPJ_MALLOC_H\n/**\n@file opj_malloc.h\n@brief Internal functions\n\nThe functions in opj_malloc.h are internal utilities used for memory management.\n*/\n\n/** @defgroup MISC MISC - Miscellaneous internal functions */\n/*@{*/\n\n/** @name Exported functions */\n/*@{*/\n/* ----------------------------------------------------------------------- */\n\n/**\nAllocate an uninitialized memory block\n@param size Bytes to allocate\n@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available\n*/\n#ifdef ALLOC_PERF_OPT\nvoid * OPJ_CALLCONV opj_malloc(size_t size);\n#else\n/* prevent assertion on overflow for MSVC */\n#ifdef _MSC_VER\n#define opj_malloc(size) ((size_t)(size) >= 0x7ffdefff ? NULL : malloc(size))\n#else\n#define opj_malloc(size) malloc(size)\n#endif\n#endif\n\n/**\nAllocate a memory block with elements initialized to 0\n@param num Blocks to allocate\n@param size Bytes per block to allocate\n@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available\n*/\n#ifdef ALLOC_PERF_OPT\nvoid * OPJ_CALLCONV opj_calloc(size_t _NumOfElements, size_t _SizeOfElements);\n#else\n/* prevent assertion on overflow for MSVC */\n#ifdef _MSC_VER\n#define opj_calloc(num, size) ((size_t)(num) != 0 && (size_t)(num) >= 0x7ffdefff / (size_t)(size) ? NULL : calloc(num, size))\n#else\n#define opj_calloc(num, size) calloc(num, size)\n#endif\n#endif\n\n/**\nAllocate memory aligned to a 16 byte boundry\n@param size Bytes to allocate\n@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available\n*/\n/* FIXME: These should be set with cmake tests, but we're currently not requiring use of cmake */\n#ifdef _WIN32\n\t/* Someone should tell the mingw people that their malloc.h ought to provide _mm_malloc() */\n\t#ifdef __GNUC__\n\t\t#include <mm_malloc.h>\n\t\t#define HAVE_MM_MALLOC\n\t#else /* MSVC, Intel C++ */\n\t\t#include <malloc.h>\n\t\t#ifdef _mm_malloc\n\t\t\t#define HAVE_MM_MALLOC\n\t\t#endif\n\t#endif\n#else /* Not _WIN32 */\n\t#if defined(__sun)\n\t\t#define HAVE_MEMALIGN\n  #elif defined(__FreeBSD__)\n    #define HAVE_POSIX_MEMALIGN\n\t/* Linux x86_64 and OSX always align allocations to 16 bytes */\n\t#elif !defined(__amd64__) && !defined(__APPLE__) && !defined(_AIX)\n\t\t#define HAVE_MEMALIGN\n\t\t#include <malloc.h>\t\t\t\n\t#endif\n#endif\n\n#define opj_aligned_malloc(size) malloc(size)\n#define opj_aligned_free(m) free(m)\n\n#ifdef HAVE_MM_MALLOC\n\t#undef opj_aligned_malloc\n\t#define opj_aligned_malloc(size) _mm_malloc(size, 16)\n\t#undef opj_aligned_free\n\t#define opj_aligned_free(m) _mm_free(m)\n#endif\n\n#ifdef HAVE_MEMALIGN\n\textern void* memalign(size_t, size_t);\n\t#undef opj_aligned_malloc\n\t#define opj_aligned_malloc(size) memalign(16, (size))\n\t#undef opj_aligned_free\n\t#define opj_aligned_free(m) free(m)\n#endif\n\n#ifdef HAVE_POSIX_MEMALIGN\n\t#undef opj_aligned_malloc\n\textern int posix_memalign(void**, size_t, size_t);\n\n\tstatic INLINE void* __attribute__ ((malloc)) opj_aligned_malloc(size_t size){\n\t\tvoid* mem = NULL;\n\t\tposix_memalign(&mem, 16, size);\n\t\treturn mem;\n\t}\n\t#undef opj_aligned_free\n\t#define opj_aligned_free(m) free(m)\n#endif\n\n#ifdef ALLOC_PERF_OPT\n\t#undef opj_aligned_malloc\n\t#define opj_aligned_malloc(size) opj_malloc(size)\n\t#undef opj_aligned_free\n\t#define opj_aligned_free(m) opj_free(m)\n#endif\n\n/**\nReallocate memory blocks.\n@param m Pointer to previously allocated memory block\n@param s New size in bytes\n@return Returns a void pointer to the reallocated (and possibly moved) memory block\n*/\n#ifdef ALLOC_PERF_OPT\nvoid * OPJ_CALLCONV opj_realloc(void * m, size_t s);\n#else\n/* prevent assertion on overflow for MSVC */\n#ifdef _MSC_VER\n#define opj_realloc(m, s) ((size_t)(s) >= 0x7ffdefff ? NULL : realloc(m, s))\n#else\n#define opj_realloc(m, s) realloc(m, s)\n#endif\n#endif\n\n/**\nDeallocates or frees a memory block.\n@param m Previously allocated memory block to be freed\n*/\n#ifdef ALLOC_PERF_OPT\nvoid OPJ_CALLCONV opj_free(void * m);\n#else\n#define opj_free(m) free(m)\n#endif\n\n#ifdef __GNUC__\n#pragma GCC poison malloc calloc realloc free\n#endif\n\n/* ----------------------------------------------------------------------- */\n/*@}*/\n\n/*@}*/\n\n#endif /* __OPJ_MALLOC_H */\n\n"
  },
  {
    "path": "ext/openjpeg/opj_stdint.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2012, Mathieu Malaterre <mathieu.malaterre@gmail.com>\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n#ifndef OPJ_STDINT_H\n#define OPJ_STDINT_H\n\n#include \"opj_config.h\"\n#ifdef OPJ_HAVE_STDINT_H\n#include <stdint.h>\n#else\n#if defined(_WIN32)\ntypedef   signed __int8   int8_t;\ntypedef unsigned __int8   uint8_t;\ntypedef   signed __int16  int16_t;\ntypedef unsigned __int16  uint16_t;\ntypedef   signed __int32  int32_t;\ntypedef unsigned __int32  uint32_t;\ntypedef   signed __int64  int64_t;\ntypedef unsigned __int64  uint64_t;\n#else\n#error unsupported platform\n#endif\n#endif\n\n#endif /* OPJ_STDINT_H */\n"
  },
  {
    "path": "ext/openjpeg/phix_manager.c",
    "content": "/*\n * $Id: phix_manager.c 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2003-2004, Yannick Verschueren\n * Copyright (c) 2010-2011, Kaori Hagihara\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*! \\file\n *  \\brief Modification of jpip.c from 2KAN indexer\n */\n\n#include \"opj_includes.h\"\n\n\n/* \n * Write faix box of phix\n *\n * @param[in] coff      offset of j2k codestream\n * @param[in] compno    component number\n * @param[in] cstr_info codestream information\n * @param[in] EPHused   true if if EPH option used\n * @param[in] j2klen    length of j2k codestream\n * @param[in] cio       file output handle\n * @return              length of faix box\n */\n\nint opj_write_phix( int coff, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio,\n              opj_event_mgr_t * p_manager )\n{\n  OPJ_BYTE l_data_header [8];\n  OPJ_UINT32 len, compno, i;\n  opj_jp2_box_t *box;\n  OPJ_OFF_T lenp = 0;\n\n  box = (opj_jp2_box_t *)opj_calloc( (size_t)cstr_info.numcomps, sizeof(opj_jp2_box_t));\n  \n  for( i=0;i<2;i++){\n    if (i)\n      opj_stream_seek( cio, lenp, p_manager);\n      \n    lenp = opj_stream_tell(cio);\n    opj_stream_skip(cio, 4, p_manager);         /* L [at the end]      */\n    opj_write_bytes(l_data_header,JPIP_PHIX,4); /* PHIX */\n    opj_stream_write_data(cio,l_data_header,4,p_manager);\n      \n    opj_write_manf( (int)i, cstr_info.numcomps, box, cio, p_manager );\n\n    for( compno=0; compno<(OPJ_UINT32)cstr_info.numcomps; compno++){       \n      box[compno].length = (OPJ_UINT32)opj_write_phixfaix( coff, (int)compno, cstr_info, EPHused, j2klen, cio,p_manager);\n      box[compno].type = JPIP_FAIX;\n    }\n\n    len = (OPJ_UINT32)(opj_stream_tell(cio)-lenp);\n    opj_stream_seek(cio, 4, p_manager);\n    opj_write_bytes(l_data_header,len,4);/* L              */\n    opj_stream_write_data(cio,l_data_header,4,p_manager);\n    opj_stream_seek( cio, lenp+len,p_manager);\n  }\n\n  opj_free(box);\n\n  return (int)len;\n}\n\n\nint opj_write_phixfaix( int coff, int compno, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio,\n              opj_event_mgr_t * p_manager )\n{\n  OPJ_UINT32 tileno, version, i, nmax, size_of_coding; /* 4 or 8 */\n  opj_tile_info_t *tile_Idx;\n  opj_packet_info_t packet;\n  int resno, precno, layno;\n  OPJ_UINT32 num_packet;\n  int numOfres, numOfprec, numOflayers;\n  OPJ_BYTE l_data_header [8];\n  OPJ_OFF_T lenp;\n  OPJ_UINT32 len;\n\n  packet.end_ph_pos = packet.start_pos = -1;\n  (void)EPHused; /* unused ? */\n\n\n  if( j2klen > pow( 2, 32)){\n    size_of_coding =  8;\n    version = 1;\n  }\n  else{\n    size_of_coding = 4;\n    version = 0;\n  }\n\n  lenp = opj_stream_tell(cio);\n  opj_stream_skip(cio, 4, p_manager);         /* L [at the end]      */\n  opj_write_bytes(l_data_header,JPIP_FAIX,4); /* FAIX */\n  opj_stream_write_data(cio,l_data_header,4,p_manager);\n  opj_write_bytes(l_data_header,version,1);   /* Version 0 = 4 bytes */\n  opj_stream_write_data(cio,l_data_header,1,p_manager);\n\n  nmax = 0;\n  for( i=0; i<=(OPJ_UINT32)cstr_info.numdecompos[compno]; i++)\n    nmax += (OPJ_UINT32)(cstr_info.tile[0].ph[i] * cstr_info.tile[0].pw[i] * cstr_info.numlayers);\n  \n  opj_write_bytes(l_data_header,nmax,size_of_coding);         /* NMAX           */\n  opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);\n  opj_write_bytes(l_data_header,(OPJ_UINT32)(cstr_info.tw*cstr_info.th),size_of_coding);  /* M              */\n  opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);\n  \n  for( tileno=0; tileno<(OPJ_UINT32)(cstr_info.tw*cstr_info.th); tileno++){\n    tile_Idx = &cstr_info.tile[ tileno];\n    \n    num_packet = 0;\n    numOfres = cstr_info.numdecompos[compno] + 1;\n\n    for( resno=0; resno<numOfres ; resno++){\n      numOfprec = tile_Idx->pw[resno]*tile_Idx->ph[resno];\n      for( precno=0; precno<numOfprec; precno++){\n\tnumOflayers = cstr_info.numlayers;\n\tfor( layno=0; layno<numOflayers; layno++){\n\t  \n\t  switch ( cstr_info.prog){\n\t  case OPJ_LRCP:\n\t    packet = tile_Idx->packet[ ((layno*numOfres+resno)*cstr_info.numcomps+compno)*numOfprec+precno];\n\t    break;\n\t  case OPJ_RLCP:\n\t    packet = tile_Idx->packet[ ((resno*numOflayers+layno)*cstr_info.numcomps+compno)*numOfprec+precno];\n\t    break;\n\t  case OPJ_RPCL:\n\t    packet = tile_Idx->packet[ ((resno*numOfprec+precno)*cstr_info.numcomps+compno)*numOflayers+layno];\n\t    break;\n\t  case OPJ_PCRL:\n\t    packet = tile_Idx->packet[ ((precno*cstr_info.numcomps+compno)*numOfres+resno)*numOflayers + layno];\n\t    break;\n\t  case OPJ_CPRL:\n\t    packet = tile_Idx->packet[ ((compno*numOfprec+precno)*numOfres+resno)*numOflayers + layno];\n\t    break;\n\t  default:\n\t    fprintf( stderr, \"failed to ppix indexing\\n\");\n\t  }\n\n    opj_write_bytes(l_data_header,(OPJ_UINT32)(packet.start_pos-coff),size_of_coding);            /* start position */\n    opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);\n    opj_write_bytes(l_data_header,(OPJ_UINT32)(packet.end_ph_pos-packet.start_pos+1),size_of_coding); /* length         */\n    opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);\n\t  \n\t  num_packet++;\n\t}\n      }\n    }\n\n    /* PADDING */\n    while( num_packet < nmax){\n      opj_write_bytes(l_data_header,0,size_of_coding);/* start position            */\n      opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);\n      opj_write_bytes(l_data_header,0,size_of_coding);/* length                    */\n      opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);\n      num_packet++;\n    }\n  }\n\n  len = (OPJ_UINT32)(opj_stream_tell(cio)-lenp);\n  opj_stream_seek(cio, lenp,p_manager);\n  opj_write_bytes(l_data_header,len,4);/* L  */\n  opj_stream_write_data(cio,l_data_header,4,p_manager);\n  opj_stream_seek(cio, lenp+len,p_manager);\n\n  return (int)len;\n}\n"
  },
  {
    "path": "ext/openjpeg/pi.c",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2006-2007, Parvatha Elangovan\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include \"opj_includes.h\"\n\n/** @defgroup PI PI - Implementation of a packet iterator */\n/*@{*/\n\n/** @name Local static functions */\n/*@{*/\n\n/**\nGet next packet in layer-resolution-component-precinct order.\n@param pi packet iterator to modify\n@return returns false if pi pointed to the last packet or else returns true\n*/\nstatic OPJ_BOOL opj_pi_next_lrcp(opj_pi_iterator_t * pi);\n/**\nGet next packet in resolution-layer-component-precinct order.\n@param pi packet iterator to modify\n@return returns false if pi pointed to the last packet or else returns true\n*/\nstatic OPJ_BOOL opj_pi_next_rlcp(opj_pi_iterator_t * pi);\n/**\nGet next packet in resolution-precinct-component-layer order.\n@param pi packet iterator to modify\n@return returns false if pi pointed to the last packet or else returns true\n*/\nstatic OPJ_BOOL opj_pi_next_rpcl(opj_pi_iterator_t * pi);\n/**\nGet next packet in precinct-component-resolution-layer order.\n@param pi packet iterator to modify\n@return returns false if pi pointed to the last packet or else returns true\n*/\nstatic OPJ_BOOL opj_pi_next_pcrl(opj_pi_iterator_t * pi);\n/**\nGet next packet in component-precinct-resolution-layer order.\n@param pi packet iterator to modify\n@return returns false if pi pointed to the last packet or else returns true\n*/\nstatic OPJ_BOOL opj_pi_next_cprl(opj_pi_iterator_t * pi);\n\n/**\n * Updates the coding parameters if the encoding is used with Progression order changes and final (or cinema parameters are used).\n *\n * @param\tp_cp\t\tthe coding parameters to modify\n * @param\tp_tileno\tthe tile index being concerned.\n * @param\tp_tx0\t\tX0 parameter for the tile\n * @param\tp_tx1\t\tX1 parameter for the tile\n * @param\tp_ty0\t\tY0 parameter for the tile\n * @param\tp_ty1\t\tY1 parameter for the tile\n * @param\tp_max_prec\tthe maximum precision for all the bands of the tile\n * @param\tp_max_res\tthe maximum number of resolutions for all the poc inside the tile.\n * @param\tp_dx_min\t\tthe minimum dx of all the components of all the resolutions for the tile.\n * @param\tp_dy_min\t\tthe minimum dy of all the components of all the resolutions for the tile.\n */\nstatic void opj_pi_update_encode_poc_and_final ( opj_cp_t *p_cp,\n                                                 OPJ_UINT32 p_tileno,\n                                                 OPJ_INT32 p_tx0,\n                                                 OPJ_INT32 p_tx1,\n                                                 OPJ_INT32 p_ty0,\n                                                 OPJ_INT32 p_ty1,\n                                                 OPJ_UINT32 p_max_prec,\n                                                 OPJ_UINT32 p_max_res,\n                                                 OPJ_UINT32 p_dx_min,\n                                                 OPJ_UINT32 p_dy_min);\n\n/**\n * Updates the coding parameters if the encoding is not used with Progression order changes and final (and cinema parameters are used).\n *\n * @param\tp_cp\t\tthe coding parameters to modify\n * @param\tp_num_comps\t\tthe number of components\n * @param\tp_tileno\tthe tile index being concerned.\n * @param\tp_tx0\t\tX0 parameter for the tile\n * @param\tp_tx1\t\tX1 parameter for the tile\n * @param\tp_ty0\t\tY0 parameter for the tile\n * @param\tp_ty1\t\tY1 parameter for the tile\n * @param\tp_max_prec\tthe maximum precision for all the bands of the tile\n * @param\tp_max_res\tthe maximum number of resolutions for all the poc inside the tile.\n * @param\tp_dx_min\t\tthe minimum dx of all the components of all the resolutions for the tile.\n * @param\tp_dy_min\t\tthe minimum dy of all the components of all the resolutions for the tile.\n */\nstatic void opj_pi_update_encode_not_poc (  opj_cp_t *p_cp,\n                                            OPJ_UINT32 p_num_comps,\n                                            OPJ_UINT32 p_tileno,\n                                            OPJ_INT32 p_tx0,\n                                            OPJ_INT32 p_tx1,\n                                            OPJ_INT32 p_ty0,\n                                            OPJ_INT32 p_ty1,\n                                            OPJ_UINT32 p_max_prec,\n                                            OPJ_UINT32 p_max_res,\n                                            OPJ_UINT32 p_dx_min,\n                                            OPJ_UINT32 p_dy_min);\n/**\n * Gets the encoding parameters needed to update the coding parameters and all the pocs.\n * \n * @param\tp_image\t\t\tthe image being encoded.\n * @param\tp_cp\t\t\tthe coding parameters.\n * @param\ttileno\t\t\tthe tile index of the tile being encoded.\n * @param\tp_tx0\t\t\tpointer that will hold the X0 parameter for the tile\n * @param\tp_tx1\t\t\tpointer that will hold the X1 parameter for the tile\n * @param\tp_ty0\t\t\tpointer that will hold the Y0 parameter for the tile\n * @param\tp_ty1\t\t\tpointer that will hold the Y1 parameter for the tile\n * @param\tp_max_prec\t\tpointer that will hold the the maximum precision for all the bands of the tile\n * @param\tp_max_res\t\tpointer that will hold the the maximum number of resolutions for all the poc inside the tile.\n * @param\tp_dx_min\t\t\tpointer that will hold the the minimum dx of all the components of all the resolutions for the tile.\n * @param\tp_dy_min\t\t\tpointer that will hold the the minimum dy of all the components of all the resolutions for the tile.\n */\nstatic void opj_get_encoding_parameters(const opj_image_t *p_image,\n                                        const opj_cp_t *p_cp,\n                                        OPJ_UINT32  tileno,\n                                        OPJ_INT32  * p_tx0,\n                                        OPJ_INT32 * p_tx1,\n                                        OPJ_INT32 * p_ty0,\n                                        OPJ_INT32 * p_ty1,\n                                        OPJ_UINT32 * p_dx_min,\n                                        OPJ_UINT32 * p_dy_min,\n                                        OPJ_UINT32 * p_max_prec,\n                                        OPJ_UINT32 * p_max_res );\n\n/**\n * Gets the encoding parameters needed to update the coding parameters and all the pocs.\n * The precinct widths, heights, dx and dy for each component at each resolution will be stored as well.\n * the last parameter of the function should be an array of pointers of size nb components, each pointer leading\n * to an area of size 4 * max_res. The data is stored inside this area with the following pattern :\n * dx_compi_res0 , dy_compi_res0 , w_compi_res0, h_compi_res0 , dx_compi_res1 , dy_compi_res1 , w_compi_res1, h_compi_res1 , ...\n *\n * @param\tp_image\t\t\tthe image being encoded.\n * @param\tp_cp\t\t\tthe coding parameters.\n * @param\ttileno\t\t\tthe tile index of the tile being encoded.\n * @param\tp_tx0\t\t\tpointer that will hold the X0 parameter for the tile\n * @param\tp_tx1\t\t\tpointer that will hold the X1 parameter for the tile\n * @param\tp_ty0\t\t\tpointer that will hold the Y0 parameter for the tile\n * @param\tp_ty1\t\t\tpointer that will hold the Y1 parameter for the tile\n * @param\tp_max_prec\t\tpointer that will hold the the maximum precision for all the bands of the tile\n * @param\tp_max_res\t\tpointer that will hold the the maximum number of resolutions for all the poc inside the tile.\n * @param\tp_dx_min\t\tpointer that will hold the the minimum dx of all the components of all the resolutions for the tile.\n * @param\tp_dy_min\t\tpointer that will hold the the minimum dy of all the components of all the resolutions for the tile.\n * @param\tp_resolutions\tpointer to an area corresponding to the one described above.\n */\nstatic void opj_get_all_encoding_parameters(const opj_image_t *p_image,\n                                            const opj_cp_t *p_cp,\n                                            OPJ_UINT32 tileno,\n                                            OPJ_INT32 * p_tx0,\n                                            OPJ_INT32 * p_tx1,\n                                            OPJ_INT32 * p_ty0,\n                                            OPJ_INT32 * p_ty1,\n                                            OPJ_UINT32 * p_dx_min,\n                                            OPJ_UINT32 * p_dy_min,\n                                            OPJ_UINT32 * p_max_prec,\n                                            OPJ_UINT32 * p_max_res,\n                                            OPJ_UINT32 ** p_resolutions );\n/**\n * Allocates memory for a packet iterator. Data and data sizes are set by this operation.\n * No other data is set. The include section of the packet  iterator is not allocated.\n * \n * @param\tp_image\t\tthe image used to initialize the packet iterator (in fact only the number of components is relevant.\n * @param\tp_cp\t\tthe coding parameters.\n * @param\ttileno\tthe index of the tile from which creating the packet iterator.\n */\nstatic opj_pi_iterator_t * opj_pi_create(\tconst opj_image_t *p_image,\n                                            const opj_cp_t *p_cp,\n                                            OPJ_UINT32 tileno );\n/**\n * FIXME DOC\n */\nstatic void opj_pi_update_decode_not_poc (opj_pi_iterator_t * p_pi,\n                                          opj_tcp_t * p_tcp,\n                                          OPJ_UINT32 p_max_precision,\n                                          OPJ_UINT32 p_max_res);\n/**\n * FIXME DOC\n */\nstatic void opj_pi_update_decode_poc (  opj_pi_iterator_t * p_pi,\n                                        opj_tcp_t * p_tcp,\n                                        OPJ_UINT32 p_max_precision,\n                                        OPJ_UINT32 p_max_res);\n\n/**\n * FIXME DOC\n */\nOPJ_BOOL opj_pi_check_next_level(\tOPJ_INT32 pos,\n\t\t\t\t\t\t\t\topj_cp_t *cp,\n\t\t\t\t\t\t\t\tOPJ_UINT32 tileno,\n\t\t\t\t\t\t\t\tOPJ_UINT32 pino,\n\t\t\t\t\t\t\t\tconst OPJ_CHAR *prog);\n\n/*@}*/\n\n/*@}*/\n\n/*\n==========================================================\n   local functions\n==========================================================\n*/\n\nOPJ_BOOL opj_pi_next_lrcp(opj_pi_iterator_t * pi) {\n\topj_pi_comp_t *comp = NULL;\n\topj_pi_resolution_t *res = NULL;\n\tOPJ_UINT32 index = 0;\n\t\n\tif (!pi->first) {\n\t\tcomp = &pi->comps[pi->compno];\n\t\tres = &comp->resolutions[pi->resno];\n\t\tgoto LABEL_SKIP;\n\t} else {\n\t\tpi->first = 0;\n\t}\n\n\tfor (pi->layno = pi->poc.layno0; pi->layno < pi->poc.layno1; pi->layno++) {\n\t\tfor (pi->resno = pi->poc.resno0; pi->resno < pi->poc.resno1;\n\t\tpi->resno++) {\n\t\t\tfor (pi->compno = pi->poc.compno0; pi->compno < pi->poc.compno1; pi->compno++) {\n\t\t\t\tcomp = &pi->comps[pi->compno];\n\t\t\t\tif (pi->resno >= comp->numresolutions) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tres = &comp->resolutions[pi->resno];\n\t\t\t\tif (!pi->tp_on){\n\t\t\t\t\tpi->poc.precno1 = res->pw * res->ph;\n\t\t\t\t}\n\t\t\t\tfor (pi->precno = pi->poc.precno0; pi->precno < pi->poc.precno1; pi->precno++) {\n\t\t\t\t\tindex = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;\n\t\t\t\t\tif (!pi->include[index]) {\n\t\t\t\t\t\tpi->include[index] = 1;\n\t\t\t\t\t\treturn OPJ_TRUE;\n\t\t\t\t\t}\nLABEL_SKIP:;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn OPJ_FALSE;\n}\n\nOPJ_BOOL opj_pi_next_rlcp(opj_pi_iterator_t * pi) {\n\topj_pi_comp_t *comp = NULL;\n\topj_pi_resolution_t *res = NULL;\n\tOPJ_UINT32 index = 0;\n\n\tif (!pi->first) {\n\t\tcomp = &pi->comps[pi->compno];\n\t\tres = &comp->resolutions[pi->resno];\n\t\tgoto LABEL_SKIP;\n\t} else {\n\t\tpi->first = 0;\n\t}\n\n\tfor (pi->resno = pi->poc.resno0; pi->resno < pi->poc.resno1; pi->resno++) {\n\t\tfor (pi->layno = pi->poc.layno0; pi->layno < pi->poc.layno1; pi->layno++) {\n\t\t\tfor (pi->compno = pi->poc.compno0; pi->compno < pi->poc.compno1; pi->compno++) {\n\t\t\t\tcomp = &pi->comps[pi->compno];\n\t\t\t\tif (pi->resno >= comp->numresolutions) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tres = &comp->resolutions[pi->resno];\n\t\t\t\tif(!pi->tp_on){\n\t\t\t\t\tpi->poc.precno1 = res->pw * res->ph;\n\t\t\t\t}\n\t\t\t\tfor (pi->precno = pi->poc.precno0; pi->precno < pi->poc.precno1; pi->precno++) {\n\t\t\t\t\tindex = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;\n\t\t\t\t\tif (!pi->include[index]) {\n\t\t\t\t\t\tpi->include[index] = 1;\n\t\t\t\t\t\treturn OPJ_TRUE;\n\t\t\t\t\t}\nLABEL_SKIP:;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn OPJ_FALSE;\n}\n\nOPJ_BOOL opj_pi_next_rpcl(opj_pi_iterator_t * pi) {\n\topj_pi_comp_t *comp = NULL;\n\topj_pi_resolution_t *res = NULL;\n\tOPJ_UINT32 index = 0;\n\n\tif (!pi->first) {\n\t\tgoto LABEL_SKIP;\n\t} else {\n\t\tOPJ_UINT32 compno, resno;\n\t\tpi->first = 0;\n\t\tpi->dx = 0;\n\t\tpi->dy = 0;\n\t\tfor (compno = 0; compno < pi->numcomps; compno++) {\n\t\t\tcomp = &pi->comps[compno];\n\t\t\tfor (resno = 0; resno < comp->numresolutions; resno++) {\n\t\t\t\tOPJ_UINT32 dx, dy;\n\t\t\t\tres = &comp->resolutions[resno];\n\t\t\t\tdx = comp->dx * (1u << (res->pdx + comp->numresolutions - 1 - resno));\n\t\t\t\tdy = comp->dy * (1u << (res->pdy + comp->numresolutions - 1 - resno));\n\t\t\t\tpi->dx = !pi->dx ? dx : opj_uint_min(pi->dx, dx);\n\t\t\t\tpi->dy = !pi->dy ? dy : opj_uint_min(pi->dy, dy);\n\t\t\t}\n\t\t}\n\t}\nif (!pi->tp_on){\n\t\t\tpi->poc.ty0 = pi->ty0;\n\t\t\tpi->poc.tx0 = pi->tx0;\n\t\t\tpi->poc.ty1 = pi->ty1;\n\t\t\tpi->poc.tx1 = pi->tx1;\n\t\t}\n\tfor (pi->resno = pi->poc.resno0; pi->resno < pi->poc.resno1; pi->resno++) {\n\t\tfor (pi->y = pi->poc.ty0; pi->y < pi->poc.ty1; pi->y += (OPJ_INT32)(pi->dy - (OPJ_UINT32)(pi->y % (OPJ_INT32)pi->dy))) {\n\t\t\tfor (pi->x = pi->poc.tx0; pi->x < pi->poc.tx1; pi->x += (OPJ_INT32)(pi->dx - (OPJ_UINT32)(pi->x % (OPJ_INT32)pi->dx))) {\n\t\t\t\tfor (pi->compno = pi->poc.compno0; pi->compno < pi->poc.compno1; pi->compno++) {\n\t\t\t\t\tOPJ_UINT32 levelno;\n\t\t\t\t\tOPJ_INT32 trx0, try0;\n\t\t\t\t\tOPJ_INT32  trx1, try1;\n\t\t\t\t\tOPJ_UINT32  rpx, rpy;\n\t\t\t\t\tOPJ_INT32  prci, prcj;\n\t\t\t\t\tcomp = &pi->comps[pi->compno];\n\t\t\t\t\tif (pi->resno >= comp->numresolutions) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tres = &comp->resolutions[pi->resno];\n\t\t\t\t\tlevelno = comp->numresolutions - 1 - pi->resno;\n\t\t\t\t\ttrx0 = opj_int_ceildiv(pi->tx0, (OPJ_INT32)(comp->dx << levelno));\n\t\t\t\t\ttry0 = opj_int_ceildiv(pi->ty0, (OPJ_INT32)(comp->dy << levelno));\n\t\t\t\t\ttrx1 = opj_int_ceildiv(pi->tx1, (OPJ_INT32)(comp->dx << levelno));\n\t\t\t\t\ttry1 = opj_int_ceildiv(pi->ty1, (OPJ_INT32)(comp->dy << levelno));\n\t\t\t\t\trpx = res->pdx + levelno;\n\t\t\t\t\trpy = res->pdy + levelno;\n\t\t\t\t\tif (!((pi->y % (OPJ_INT32)(comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpy))))){\n\t\t\t\t\t\tcontinue;\t\n\t\t\t\t\t}\n\t\t\t\t\tif (!((pi->x % (OPJ_INT32)(comp->dx << rpx) == 0) || ((pi->x == pi->tx0) && ((trx0 << levelno) % (1 << rpx))))){\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ((res->pw==0)||(res->ph==0)) continue;\n\t\t\t\t\t\n\t\t\t\t\tif ((trx0==trx1)||(try0==try1)) continue;\n\t\t\t\t\t\n\t\t\t\t\tprci = opj_int_floordivpow2(opj_int_ceildiv(pi->x, (OPJ_INT32)(comp->dx << levelno)), (OPJ_INT32)res->pdx)\n\t\t\t\t\t\t - opj_int_floordivpow2(trx0, (OPJ_INT32)res->pdx);\n\t\t\t\t\tprcj = opj_int_floordivpow2(opj_int_ceildiv(pi->y, (OPJ_INT32)(comp->dy << levelno)), (OPJ_INT32)res->pdy)\n\t\t\t\t\t\t - opj_int_floordivpow2(try0, (OPJ_INT32)res->pdy);\n\t\t\t\t\tpi->precno = (OPJ_UINT32)(prci + prcj * (OPJ_INT32)res->pw);\n\t\t\t\t\tfor (pi->layno = pi->poc.layno0; pi->layno < pi->poc.layno1; pi->layno++) {\n\t\t\t\t\t\tindex = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;\n\t\t\t\t\t\tif (!pi->include[index]) {\n\t\t\t\t\t\t\tpi->include[index] = 1;\n\t\t\t\t\t\t\treturn OPJ_TRUE;\n\t\t\t\t\t\t}\nLABEL_SKIP:;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn OPJ_FALSE;\n}\n\nOPJ_BOOL opj_pi_next_pcrl(opj_pi_iterator_t * pi) {\n\topj_pi_comp_t *comp = NULL;\n\topj_pi_resolution_t *res = NULL;\n\tOPJ_UINT32 index = 0;\n\n\tif (!pi->first) {\n\t\tcomp = &pi->comps[pi->compno];\n\t\tgoto LABEL_SKIP;\n\t} else {\n\t\tOPJ_UINT32 compno, resno;\n\t\tpi->first = 0;\n\t\tpi->dx = 0;\n\t\tpi->dy = 0;\n\t\tfor (compno = 0; compno < pi->numcomps; compno++) {\n\t\t\tcomp = &pi->comps[compno];\n\t\t\tfor (resno = 0; resno < comp->numresolutions; resno++) {\n\t\t\t\tOPJ_UINT32 dx, dy;\n\t\t\t\tres = &comp->resolutions[resno];\n\t\t\t\tdx = comp->dx * (1u << (res->pdx + comp->numresolutions - 1 - resno));\n\t\t\t\tdy = comp->dy * (1u << (res->pdy + comp->numresolutions - 1 - resno));\n\t\t\t\tpi->dx = !pi->dx ? dx : opj_uint_min(pi->dx, dx);\n\t\t\t\tpi->dy = !pi->dy ? dy : opj_uint_min(pi->dy, dy);\n\t\t\t}\n\t\t}\n\t}\n\tif (!pi->tp_on){\n\t\t\tpi->poc.ty0 = pi->ty0;\n\t\t\tpi->poc.tx0 = pi->tx0;\n\t\t\tpi->poc.ty1 = pi->ty1;\n\t\t\tpi->poc.tx1 = pi->tx1;\n\t\t}\n\tfor (pi->y = pi->poc.ty0; pi->y < pi->poc.ty1; pi->y += (OPJ_INT32)(pi->dy - (OPJ_UINT32)(pi->y % (OPJ_INT32)pi->dy))) {\n\t\tfor (pi->x = pi->poc.tx0; pi->x < pi->poc.tx1; pi->x += (OPJ_INT32)(pi->dx - (OPJ_UINT32)(pi->x % (OPJ_INT32)pi->dx))) {\n\t\t\tfor (pi->compno = pi->poc.compno0; pi->compno < pi->poc.compno1; pi->compno++) {\n\t\t\t\tcomp = &pi->comps[pi->compno];\n\t\t\t\tfor (pi->resno = pi->poc.resno0; pi->resno < opj_uint_min(pi->poc.resno1, comp->numresolutions); pi->resno++) {\n\t\t\t\t\tOPJ_UINT32 levelno;\n\t\t\t\t\tOPJ_INT32 trx0, try0;\n\t\t\t\t\tOPJ_INT32 trx1, try1;\n\t\t\t\t\tOPJ_UINT32 rpx, rpy;\n\t\t\t\t\tOPJ_INT32 prci, prcj;\n\t\t\t\t\tres = &comp->resolutions[pi->resno];\n\t\t\t\t\tlevelno = comp->numresolutions - 1 - pi->resno;\n\t\t\t\t\ttrx0 = opj_int_ceildiv(pi->tx0, (OPJ_INT32)(comp->dx << levelno));\n\t\t\t\t\ttry0 = opj_int_ceildiv(pi->ty0, (OPJ_INT32)(comp->dy << levelno));\n\t\t\t\t\ttrx1 = opj_int_ceildiv(pi->tx1, (OPJ_INT32)(comp->dx << levelno));\n\t\t\t\t\ttry1 = opj_int_ceildiv(pi->ty1, (OPJ_INT32)(comp->dy << levelno));\n\t\t\t\t\trpx = res->pdx + levelno;\n\t\t\t\t\trpy = res->pdy + levelno;\n\t\t\t\t\tif (!((pi->y % (OPJ_INT32)(comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpy))))){\n\t\t\t\t\t\tcontinue;\t\n\t\t\t\t\t}\n\t\t\t\t\tif (!((pi->x % (OPJ_INT32)(comp->dx << rpx) == 0) || ((pi->x == pi->tx0) && ((trx0 << levelno) % (1 << rpx))))){\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ((res->pw==0)||(res->ph==0)) continue;\n\t\t\t\t\t\n\t\t\t\t\tif ((trx0==trx1)||(try0==try1)) continue;\n\t\t\t\t\t\n\t\t\t\t\tprci = opj_int_floordivpow2(opj_int_ceildiv(pi->x, (OPJ_INT32)(comp->dx << levelno)), (OPJ_INT32)res->pdx)\n\t\t\t\t\t\t - opj_int_floordivpow2(trx0, (OPJ_INT32)res->pdx);\n\t\t\t\t\tprcj = opj_int_floordivpow2(opj_int_ceildiv(pi->y, (OPJ_INT32)(comp->dy << levelno)), (OPJ_INT32)res->pdy)\n\t\t\t\t\t\t - opj_int_floordivpow2(try0, (OPJ_INT32)res->pdy);\n\t\t\t\t\tpi->precno = (OPJ_UINT32)(prci + prcj * (OPJ_INT32)res->pw);\n\t\t\t\t\tfor (pi->layno = pi->poc.layno0; pi->layno < pi->poc.layno1; pi->layno++) {\n\t\t\t\t\t\tindex = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;\n\t\t\t\t\t\tif (!pi->include[index]) {\n\t\t\t\t\t\t\tpi->include[index] = 1;\n\t\t\t\t\t\t\treturn OPJ_TRUE;\n\t\t\t\t\t\t}\t\nLABEL_SKIP:;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn OPJ_FALSE;\n}\n\nOPJ_BOOL opj_pi_next_cprl(opj_pi_iterator_t * pi) {\n\topj_pi_comp_t *comp = NULL;\n\topj_pi_resolution_t *res = NULL;\n\tOPJ_UINT32 index = 0;\n\n\tif (!pi->first) {\n\t\tcomp = &pi->comps[pi->compno];\n\t\tgoto LABEL_SKIP;\n\t} else {\n\t\tpi->first = 0;\n\t}\n\n\tfor (pi->compno = pi->poc.compno0; pi->compno < pi->poc.compno1; pi->compno++) {\n\t\tOPJ_UINT32 resno;\n\t\tcomp = &pi->comps[pi->compno];\n\t\tpi->dx = 0;\n\t\tpi->dy = 0;\n\t\tfor (resno = 0; resno < comp->numresolutions; resno++) {\n\t\t\tOPJ_UINT32 dx, dy;\n\t\t\tres = &comp->resolutions[resno];\n\t\t\tdx = comp->dx * (1u << (res->pdx + comp->numresolutions - 1 - resno));\n\t\t\tdy = comp->dy * (1u << (res->pdy + comp->numresolutions - 1 - resno));\n\t\t\tpi->dx = !pi->dx ? dx : opj_uint_min(pi->dx, dx);\n\t\t\tpi->dy = !pi->dy ? dy : opj_uint_min(pi->dy, dy);\n\t\t}\n\t\tif (!pi->tp_on){\n\t\t\tpi->poc.ty0 = pi->ty0;\n\t\t\tpi->poc.tx0 = pi->tx0;\n\t\t\tpi->poc.ty1 = pi->ty1;\n\t\t\tpi->poc.tx1 = pi->tx1;\n\t\t}\n\t\tfor (pi->y = pi->poc.ty0; pi->y < pi->poc.ty1; pi->y += (OPJ_INT32)(pi->dy - (OPJ_UINT32)(pi->y % (OPJ_INT32)pi->dy))) {\n\t\t\tfor (pi->x = pi->poc.tx0; pi->x < pi->poc.tx1; pi->x += (OPJ_INT32)(pi->dx - (OPJ_UINT32)(pi->x % (OPJ_INT32)pi->dx))) {\n\t\t\t\tfor (pi->resno = pi->poc.resno0; pi->resno < opj_uint_min(pi->poc.resno1, comp->numresolutions); pi->resno++) {\n\t\t\t\t\tOPJ_UINT32 levelno;\n\t\t\t\t\tOPJ_INT32 trx0, try0;\n\t\t\t\t\tOPJ_INT32 trx1, try1;\n\t\t\t\t\tOPJ_UINT32 rpx, rpy;\n\t\t\t\t\tOPJ_INT32 prci, prcj;\n\t\t\t\t\tres = &comp->resolutions[pi->resno];\n\t\t\t\t\tlevelno = comp->numresolutions - 1 - pi->resno;\n\t\t\t\t\ttrx0 = opj_int_ceildiv(pi->tx0, (OPJ_INT32)(comp->dx << levelno));\n\t\t\t\t\ttry0 = opj_int_ceildiv(pi->ty0, (OPJ_INT32)(comp->dy << levelno));\n\t\t\t\t\ttrx1 = opj_int_ceildiv(pi->tx1, (OPJ_INT32)(comp->dx << levelno));\n\t\t\t\t\ttry1 = opj_int_ceildiv(pi->ty1, (OPJ_INT32)(comp->dy << levelno));\n\t\t\t\t\trpx = res->pdx + levelno;\n\t\t\t\t\trpy = res->pdy + levelno;\n\t\t\t\t\tif (!((pi->y % (OPJ_INT32)(comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpy))))){\n\t\t\t\t\t\tcontinue;\t\n\t\t\t\t\t}\n\t\t\t\t\tif (!((pi->x % (OPJ_INT32)(comp->dx << rpx) == 0) || ((pi->x == pi->tx0) && ((trx0 << levelno) % (1 << rpx))))){\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ((res->pw==0)||(res->ph==0)) continue;\n\t\t\t\t\t\n\t\t\t\t\tif ((trx0==trx1)||(try0==try1)) continue;\n\t\t\t\t\t\n\t\t\t\t\tprci = opj_int_floordivpow2(opj_int_ceildiv(pi->x, (OPJ_INT32)(comp->dx << levelno)), (OPJ_INT32)res->pdx)\n\t\t\t\t\t\t - opj_int_floordivpow2(trx0, (OPJ_INT32)res->pdx);\n\t\t\t\t\tprcj = opj_int_floordivpow2(opj_int_ceildiv(pi->y, (OPJ_INT32)(comp->dy << levelno)), (OPJ_INT32)res->pdy)\n\t\t\t\t\t\t - opj_int_floordivpow2(try0, (OPJ_INT32)res->pdy);\n\t\t\t\t\tpi->precno = (OPJ_UINT32)(prci + prcj * (OPJ_INT32)res->pw);\n\t\t\t\t\tfor (pi->layno = pi->poc.layno0; pi->layno < pi->poc.layno1; pi->layno++) {\n\t\t\t\t\t\tindex = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno * pi->step_c + pi->precno * pi->step_p;\n\t\t\t\t\t\tif (!pi->include[index]) {\n\t\t\t\t\t\t\tpi->include[index] = 1;\n\t\t\t\t\t\t\treturn OPJ_TRUE;\n\t\t\t\t\t\t}\nLABEL_SKIP:;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn OPJ_FALSE;\n}\n\nvoid opj_get_encoding_parameters(\tconst opj_image_t *p_image,\n                                    const opj_cp_t *p_cp,\n                                    OPJ_UINT32 p_tileno,\n                                    OPJ_INT32 * p_tx0,\n                                    OPJ_INT32  * p_tx1,\n                                    OPJ_INT32  * p_ty0,\n                                    OPJ_INT32  * p_ty1,\n                                    OPJ_UINT32 * p_dx_min,\n                                    OPJ_UINT32 * p_dy_min,\n                                    OPJ_UINT32 * p_max_prec,\n                                    OPJ_UINT32 * p_max_res )\n{\n\t/* loop */\n\tOPJ_UINT32  compno, resno;\n\t/* pointers */\n\tconst opj_tcp_t *l_tcp = 00;\n\tconst opj_tccp_t * l_tccp = 00;\n\tconst opj_image_comp_t * l_img_comp = 00;\n\n\t/* position in x and y of tile */\n\tOPJ_UINT32 p, q;\n\n\t/* preconditions */\n\tassert(p_cp != 00);\n\tassert(p_image != 00);\n\tassert(p_tileno < p_cp->tw * p_cp->th);\n\n\t/* initializations */\n\tl_tcp = &p_cp->tcps [p_tileno];\n\tl_img_comp = p_image->comps;\n\tl_tccp = l_tcp->tccps;\n\n\t/* here calculation of tx0, tx1, ty0, ty1, maxprec, dx and dy */\n\tp = p_tileno % p_cp->tw;\n\tq = p_tileno / p_cp->tw;\n\n\t/* find extent of tile */\n\t*p_tx0 = opj_int_max((OPJ_INT32)(p_cp->tx0 + p * p_cp->tdx), (OPJ_INT32)p_image->x0);\n\t*p_tx1 = opj_int_min((OPJ_INT32)(p_cp->tx0 + (p + 1) * p_cp->tdx), (OPJ_INT32)p_image->x1);\n\t*p_ty0 = opj_int_max((OPJ_INT32)(p_cp->ty0 + q * p_cp->tdy), (OPJ_INT32)p_image->y0);\n\t*p_ty1 = opj_int_min((OPJ_INT32)(p_cp->ty0 + (q + 1) * p_cp->tdy), (OPJ_INT32)p_image->y1);\n\n\t/* max precision is 0 (can only grow) */\n\t*p_max_prec = 0;\n\t*p_max_res = 0;\n\n\t/* take the largest value for dx_min and dy_min */\n\t*p_dx_min = 0x7fffffff;\n\t*p_dy_min  = 0x7fffffff;\n\n\tfor (compno = 0; compno < p_image->numcomps; ++compno) {\n\t\t/* arithmetic variables to calculate */\n\t\tOPJ_UINT32 l_level_no;\n\t\tOPJ_INT32 l_rx0, l_ry0, l_rx1, l_ry1;\n\t\tOPJ_INT32 l_px0, l_py0, l_px1, py1;\n\t\tOPJ_UINT32 l_pdx, l_pdy;\n\t\tOPJ_UINT32 l_pw, l_ph;\n\t\tOPJ_UINT32 l_product;\n\t\tOPJ_INT32 l_tcx0, l_tcy0, l_tcx1, l_tcy1;\n\n\t\tl_tcx0 = opj_int_ceildiv(*p_tx0, (OPJ_INT32)l_img_comp->dx);\n\t\tl_tcy0 = opj_int_ceildiv(*p_ty0, (OPJ_INT32)l_img_comp->dy);\n\t\tl_tcx1 = opj_int_ceildiv(*p_tx1, (OPJ_INT32)l_img_comp->dx);\n\t\tl_tcy1 = opj_int_ceildiv(*p_ty1, (OPJ_INT32)l_img_comp->dy);\n\n\t\tif (l_tccp->numresolutions > *p_max_res) {\n\t\t\t*p_max_res = l_tccp->numresolutions;\n\t\t}\n\n\t\t/* use custom size for precincts */\n\t\tfor (resno = 0; resno < l_tccp->numresolutions; ++resno) {\n\t\t\tOPJ_UINT32 l_dx, l_dy;\n\n\t\t\t/* precinct width and height */\n\t\t\tl_pdx = l_tccp->prcw[resno];\n\t\t\tl_pdy = l_tccp->prch[resno];\n\n\t\t\tl_dx = l_img_comp->dx * (1u << (l_pdx + l_tccp->numresolutions - 1 - resno));\n\t\t\tl_dy = l_img_comp->dy * (1u << (l_pdy + l_tccp->numresolutions - 1 - resno));\n\n\t\t\t/* take the minimum size for dx for each comp and resolution */\n\t\t\t*p_dx_min = opj_uint_min(*p_dx_min, l_dx);\n\t\t\t*p_dy_min = opj_uint_min(*p_dy_min, l_dy);\n\n\t\t\t/* various calculations of extents */\n\t\t\tl_level_no = l_tccp->numresolutions - 1 - resno;\n\n\t\t\tl_rx0 = opj_int_ceildivpow2(l_tcx0, (OPJ_INT32)l_level_no);\n\t\t\tl_ry0 = opj_int_ceildivpow2(l_tcy0, (OPJ_INT32)l_level_no);\n\t\t\tl_rx1 = opj_int_ceildivpow2(l_tcx1, (OPJ_INT32)l_level_no);\n\t\t\tl_ry1 = opj_int_ceildivpow2(l_tcy1, (OPJ_INT32)l_level_no);\n\n\t\t\tl_px0 = opj_int_floordivpow2(l_rx0, (OPJ_INT32)l_pdx) << l_pdx;\n\t\t\tl_py0 = opj_int_floordivpow2(l_ry0, (OPJ_INT32)l_pdy) << l_pdy;\n\t\t\tl_px1 = opj_int_ceildivpow2(l_rx1, (OPJ_INT32)l_pdx) << l_pdx;\n\n\t\t\tpy1 = opj_int_ceildivpow2(l_ry1, (OPJ_INT32)l_pdy) << l_pdy;\n\n\t\t\tl_pw = (l_rx0==l_rx1)?0:(OPJ_UINT32)((l_px1 - l_px0) >> l_pdx);\n\t\t\tl_ph = (l_ry0==l_ry1)?0:(OPJ_UINT32)((py1 - l_py0) >> l_pdy);\n\n\t\t\tl_product = l_pw * l_ph;\n\n\t\t\t/* update precision */\n\t\t\tif (l_product > *p_max_prec) {\n\t\t\t\t*p_max_prec = l_product;\n\t\t\t}\n\t\t}\n\t\t++l_img_comp;\n\t\t++l_tccp;\n\t}\n}\n\n\nvoid opj_get_all_encoding_parameters(   const opj_image_t *p_image,\n                                        const opj_cp_t *p_cp,\n                                        OPJ_UINT32 tileno,\n                                        OPJ_INT32 * p_tx0,\n                                        OPJ_INT32 * p_tx1,\n                                        OPJ_INT32 * p_ty0,\n                                        OPJ_INT32 * p_ty1,\n                                        OPJ_UINT32 * p_dx_min,\n                                        OPJ_UINT32 * p_dy_min,\n                                        OPJ_UINT32 * p_max_prec,\n                                        OPJ_UINT32 * p_max_res,\n                                        OPJ_UINT32 ** p_resolutions )\n{\n\t/* loop*/\n\tOPJ_UINT32 compno, resno;\n\n\t/* pointers*/\n\tconst opj_tcp_t *tcp = 00;\n\tconst opj_tccp_t * l_tccp = 00;\n\tconst opj_image_comp_t * l_img_comp = 00;\n\n\t/* to store l_dx, l_dy, w and h for each resolution and component.*/\n\tOPJ_UINT32 * lResolutionPtr;\n\n\t/* position in x and y of tile*/\n\tOPJ_UINT32 p, q;\n\n\t/* preconditions in debug*/\n\tassert(p_cp != 00);\n\tassert(p_image != 00);\n\tassert(tileno < p_cp->tw * p_cp->th);\n\n\t/* initializations*/\n\ttcp = &p_cp->tcps [tileno];\n\tl_tccp = tcp->tccps;\n\tl_img_comp = p_image->comps;\n\n\t/* position in x and y of tile*/\n\tp = tileno % p_cp->tw;\n\tq = tileno / p_cp->tw;\n\n\t/* here calculation of tx0, tx1, ty0, ty1, maxprec, l_dx and l_dy */\n\t*p_tx0 = opj_int_max((OPJ_INT32)(p_cp->tx0 + p * p_cp->tdx), (OPJ_INT32)p_image->x0);\n\t*p_tx1 = opj_int_min((OPJ_INT32)(p_cp->tx0 + (p + 1) * p_cp->tdx), (OPJ_INT32)p_image->x1);\n\t*p_ty0 = opj_int_max((OPJ_INT32)(p_cp->ty0 + q * p_cp->tdy), (OPJ_INT32)p_image->y0);\n\t*p_ty1 = opj_int_min((OPJ_INT32)(p_cp->ty0 + (q + 1) * p_cp->tdy), (OPJ_INT32)p_image->y1);\n\n\t/* max precision and resolution is 0 (can only grow)*/\n\t*p_max_prec = 0;\n\t*p_max_res = 0;\n\n\t/* take the largest value for dx_min and dy_min*/\n\t*p_dx_min = 0x7fffffff;\n\t*p_dy_min = 0x7fffffff;\n\n\tfor (compno = 0; compno < p_image->numcomps; ++compno) {\n\t\t/* aritmetic variables to calculate*/\n\t\tOPJ_UINT32 l_level_no;\n\t\tOPJ_INT32 l_rx0, l_ry0, l_rx1, l_ry1;\n\t\tOPJ_INT32 l_px0, l_py0, l_px1, py1;\n\t\tOPJ_UINT32 l_product;\n\t\tOPJ_INT32 l_tcx0, l_tcy0, l_tcx1, l_tcy1;\n\t\tOPJ_UINT32 l_pdx, l_pdy , l_pw , l_ph;\n\n\t\tlResolutionPtr = p_resolutions[compno];\n\n\t\tl_tcx0 = opj_int_ceildiv(*p_tx0, (OPJ_INT32)l_img_comp->dx);\n\t\tl_tcy0 = opj_int_ceildiv(*p_ty0, (OPJ_INT32)l_img_comp->dy);\n\t\tl_tcx1 = opj_int_ceildiv(*p_tx1, (OPJ_INT32)l_img_comp->dx);\n\t\tl_tcy1 = opj_int_ceildiv(*p_ty1, (OPJ_INT32)l_img_comp->dy);\n\n\t\tif (l_tccp->numresolutions > *p_max_res) {\n\t\t\t*p_max_res = l_tccp->numresolutions;\n\t\t}\n\n\t\t/* use custom size for precincts*/\n\t\tl_level_no = l_tccp->numresolutions - 1;\n\t\tfor (resno = 0; resno < l_tccp->numresolutions; ++resno) {\n\t\t\tOPJ_UINT32 l_dx, l_dy;\n\n\t\t\t/* precinct width and height*/\n\t\t\tl_pdx = l_tccp->prcw[resno];\n\t\t\tl_pdy = l_tccp->prch[resno];\n\t\t\t*lResolutionPtr++ = l_pdx;\n\t\t\t*lResolutionPtr++ = l_pdy;\n\t\t\tl_dx = l_img_comp->dx * (1u << (l_pdx + l_level_no));\n\t\t\tl_dy = l_img_comp->dy * (1u << (l_pdy + l_level_no));\n\t\t\t/* take the minimum size for l_dx for each comp and resolution*/\n\t\t\t*p_dx_min = (OPJ_UINT32)opj_int_min((OPJ_INT32)*p_dx_min, (OPJ_INT32)l_dx);\n\t\t\t*p_dy_min = (OPJ_UINT32)opj_int_min((OPJ_INT32)*p_dy_min, (OPJ_INT32)l_dy);\n\n\t\t\t/* various calculations of extents*/\n\t\t\tl_rx0 = opj_int_ceildivpow2(l_tcx0, (OPJ_INT32)l_level_no);\n\t\t\tl_ry0 = opj_int_ceildivpow2(l_tcy0, (OPJ_INT32)l_level_no);\n\t\t\tl_rx1 = opj_int_ceildivpow2(l_tcx1, (OPJ_INT32)l_level_no);\n\t\t\tl_ry1 = opj_int_ceildivpow2(l_tcy1, (OPJ_INT32)l_level_no);\n\t\t\tl_px0 = opj_int_floordivpow2(l_rx0, (OPJ_INT32)l_pdx) << l_pdx;\n\t\t\tl_py0 = opj_int_floordivpow2(l_ry0, (OPJ_INT32)l_pdy) << l_pdy;\n\t\t\tl_px1 = opj_int_ceildivpow2(l_rx1, (OPJ_INT32)l_pdx) << l_pdx;\n\t\t\tpy1 = opj_int_ceildivpow2(l_ry1, (OPJ_INT32)l_pdy) << l_pdy;\n\t\t\tl_pw = (l_rx0==l_rx1)?0:(OPJ_UINT32)((l_px1 - l_px0) >> l_pdx);\n\t\t\tl_ph = (l_ry0==l_ry1)?0:(OPJ_UINT32)((py1 - l_py0) >> l_pdy);\n\t\t\t*lResolutionPtr++ = l_pw;\n\t\t\t*lResolutionPtr++ = l_ph;\n\t\t\tl_product = l_pw * l_ph;\n\t\t\t\n            /* update precision*/\n\t\t\tif (l_product > *p_max_prec) {\n\t\t\t\t*p_max_prec = l_product;\n\t\t\t}\n\n\t\t\t--l_level_no;\n\t\t}\n\t\t++l_tccp;\n\t\t++l_img_comp;\n\t}\n}\n\nopj_pi_iterator_t * opj_pi_create(\tconst opj_image_t *image,\n                                    const opj_cp_t *cp,\n                                    OPJ_UINT32 tileno )\n{\n\t/* loop*/\n\tOPJ_UINT32 pino, compno;\n\t/* number of poc in the p_pi*/\n\tOPJ_UINT32 l_poc_bound;\n\n\t/* pointers to tile coding parameters and components.*/\n\topj_pi_iterator_t *l_pi = 00;\n\topj_tcp_t *tcp = 00;\n\tconst opj_tccp_t *tccp = 00;\n\n\t/* current packet iterator being allocated*/\n\topj_pi_iterator_t *l_current_pi = 00;\n\n\t/* preconditions in debug*/\n\tassert(cp != 00);\n\tassert(image != 00);\n\tassert(tileno < cp->tw * cp->th);\n\n\t/* initializations*/\n\ttcp = &cp->tcps[tileno];\n\tl_poc_bound = tcp->numpocs+1;\n\n\t/* memory allocations*/\n\tl_pi = (opj_pi_iterator_t*) opj_calloc((l_poc_bound), sizeof(opj_pi_iterator_t));\n\tif (!l_pi) {\n\t\treturn NULL;\n\t}\n\tmemset(l_pi,0,l_poc_bound * sizeof(opj_pi_iterator_t));\n\n\tl_current_pi = l_pi;\n\tfor (pino = 0; pino < l_poc_bound ; ++pino) {\n\n\t\tl_current_pi->comps = (opj_pi_comp_t*) opj_calloc(image->numcomps, sizeof(opj_pi_comp_t));\n\t\tif (! l_current_pi->comps) {\n\t\t\topj_pi_destroy(l_pi, l_poc_bound);\n\t\t\treturn NULL;\n\t\t}\n\n\t\tl_current_pi->numcomps = image->numcomps;\n\t\tmemset(l_current_pi->comps,0,image->numcomps * sizeof(opj_pi_comp_t));\n\n\t\tfor (compno = 0; compno < image->numcomps; ++compno) {\n\t\t\topj_pi_comp_t *comp = &l_current_pi->comps[compno];\n\n\t\t\ttccp = &tcp->tccps[compno];\n\n\t\t\tcomp->resolutions = (opj_pi_resolution_t*) opj_malloc(tccp->numresolutions * sizeof(opj_pi_resolution_t));\n\t\t\tif (!comp->resolutions) {\n\t\t\t\topj_pi_destroy(l_pi, l_poc_bound);\n\t\t\t\treturn 00;\n\t\t\t}\n\n\t\t\tcomp->numresolutions = tccp->numresolutions;\n\t\t\tmemset(comp->resolutions,0,tccp->numresolutions * sizeof(opj_pi_resolution_t));\n\t\t}\n\t\t++l_current_pi;\n\t}\n\treturn l_pi;\n}\n\nvoid opj_pi_update_encode_poc_and_final (   opj_cp_t *p_cp,\n                                            OPJ_UINT32 p_tileno,\n                                            OPJ_INT32 p_tx0,\n                                            OPJ_INT32 p_tx1,\n                                            OPJ_INT32 p_ty0,\n                                            OPJ_INT32 p_ty1,\n                                            OPJ_UINT32 p_max_prec,\n                                            OPJ_UINT32 p_max_res,\n                                            OPJ_UINT32 p_dx_min,\n                                            OPJ_UINT32 p_dy_min)\n{\n\t/* loop*/\n\tOPJ_UINT32 pino;\n\t/* tile coding parameter*/\n\topj_tcp_t *l_tcp = 00;\n\t/* current poc being updated*/\n\topj_poc_t * l_current_poc = 00;\n\n\t/* number of pocs*/\n\tOPJ_UINT32 l_poc_bound;\n\n    OPJ_ARG_NOT_USED(p_max_res);\n\n\t/* preconditions in debug*/\n\tassert(p_cp != 00);\n\tassert(p_tileno < p_cp->tw * p_cp->th);\n\n\t/* initializations*/\n\tl_tcp = &p_cp->tcps [p_tileno];\n\t/* number of iterations in the loop */\n\tl_poc_bound = l_tcp->numpocs+1;\n\n\t/* start at first element, and to make sure the compiler will not make a calculation each time in the loop\n\t   store a pointer to the current element to modify rather than l_tcp->pocs[i]*/\n\tl_current_poc = l_tcp->pocs;\n\n\tl_current_poc->compS = l_current_poc->compno0;\n\tl_current_poc->compE = l_current_poc->compno1;\n\tl_current_poc->resS = l_current_poc->resno0;\n\tl_current_poc->resE = l_current_poc->resno1;\n\tl_current_poc->layE = l_current_poc->layno1;\n\n\t/* special treatment for the first element*/\n\tl_current_poc->layS = 0;\n\tl_current_poc->prg  = l_current_poc->prg1;\n\tl_current_poc->prcS = 0;\n\n\tl_current_poc->prcE = p_max_prec;\n\tl_current_poc->txS = (OPJ_UINT32)p_tx0;\n\tl_current_poc->txE = (OPJ_UINT32)p_tx1;\n\tl_current_poc->tyS = (OPJ_UINT32)p_ty0;\n\tl_current_poc->tyE = (OPJ_UINT32)p_ty1;\n\tl_current_poc->dx = p_dx_min;\n\tl_current_poc->dy = p_dy_min;\n\n\t++ l_current_poc;\n\tfor (pino = 1;pino < l_poc_bound ; ++pino) {\n\t\tl_current_poc->compS = l_current_poc->compno0;\n\t\tl_current_poc->compE= l_current_poc->compno1;\n\t\tl_current_poc->resS = l_current_poc->resno0;\n\t\tl_current_poc->resE = l_current_poc->resno1;\n\t\tl_current_poc->layE = l_current_poc->layno1;\n\t\tl_current_poc->prg  = l_current_poc->prg1;\n\t\tl_current_poc->prcS = 0;\n\t\t/* special treatment here different from the first element*/\n\t\tl_current_poc->layS = (l_current_poc->layE > (l_current_poc-1)->layE) ? l_current_poc->layE : 0;\n\n\t\tl_current_poc->prcE = p_max_prec;\n\t\tl_current_poc->txS = (OPJ_UINT32)p_tx0;\n\t\tl_current_poc->txE = (OPJ_UINT32)p_tx1;\n\t\tl_current_poc->tyS = (OPJ_UINT32)p_ty0;\n\t\tl_current_poc->tyE = (OPJ_UINT32)p_ty1;\n\t\tl_current_poc->dx = p_dx_min;\n\t\tl_current_poc->dy = p_dy_min;\n\t\t++ l_current_poc;\n\t}\n}\n\nvoid opj_pi_update_encode_not_poc (\topj_cp_t *p_cp,\n                                    OPJ_UINT32 p_num_comps,\n                                    OPJ_UINT32 p_tileno,\n                                    OPJ_INT32 p_tx0,\n                                    OPJ_INT32 p_tx1,\n                                    OPJ_INT32 p_ty0,\n                                    OPJ_INT32 p_ty1,\n                                    OPJ_UINT32 p_max_prec,\n                                    OPJ_UINT32 p_max_res,\n                                    OPJ_UINT32 p_dx_min,\n                                    OPJ_UINT32 p_dy_min)\n{\n\t/* loop*/\n\tOPJ_UINT32 pino;\n\t/* tile coding parameter*/\n\topj_tcp_t *l_tcp = 00;\n\t/* current poc being updated*/\n\topj_poc_t * l_current_poc = 00;\n\t/* number of pocs*/\n\tOPJ_UINT32 l_poc_bound;\n\n\t/* preconditions in debug*/\n\tassert(p_cp != 00);\n\tassert(p_tileno < p_cp->tw * p_cp->th);\n\n\t/* initializations*/\n\tl_tcp = &p_cp->tcps [p_tileno];\n\n\t/* number of iterations in the loop */\n\tl_poc_bound = l_tcp->numpocs+1;\n\n\t/* start at first element, and to make sure the compiler will not make a calculation each time in the loop\n\t   store a pointer to the current element to modify rather than l_tcp->pocs[i]*/\n\tl_current_poc = l_tcp->pocs;\n\n\tfor (pino = 0; pino < l_poc_bound ; ++pino) {\n\t\tl_current_poc->compS = 0;\n\t\tl_current_poc->compE = p_num_comps;/*p_image->numcomps;*/\n\t\tl_current_poc->resS = 0;\n\t\tl_current_poc->resE = p_max_res;\n\t\tl_current_poc->layS = 0;\n\t\tl_current_poc->layE = l_tcp->numlayers;\n\t\tl_current_poc->prg  = l_tcp->prg;\n\t\tl_current_poc->prcS = 0;\n\t\tl_current_poc->prcE = p_max_prec;\n\t\tl_current_poc->txS = (OPJ_UINT32)p_tx0;\n\t\tl_current_poc->txE = (OPJ_UINT32)p_tx1;\n\t\tl_current_poc->tyS = (OPJ_UINT32)p_ty0;\n\t\tl_current_poc->tyE = (OPJ_UINT32)p_ty1;\n\t\tl_current_poc->dx = p_dx_min;\n\t\tl_current_poc->dy = p_dy_min;\n\t\t++ l_current_poc;\n\t}\n}\n\nvoid opj_pi_update_decode_poc (opj_pi_iterator_t * p_pi,\n                               opj_tcp_t * p_tcp,\n                               OPJ_UINT32 p_max_precision,\n                               OPJ_UINT32 p_max_res)\n{\n\t/* loop*/\n\tOPJ_UINT32 pino;\n\n\t/* encoding prameters to set*/\n\tOPJ_UINT32 l_bound;\n\n\topj_pi_iterator_t * l_current_pi = 00;\n\topj_poc_t* l_current_poc = 0;\n\n    OPJ_ARG_NOT_USED(p_max_res);\n\n\t/* preconditions in debug*/\n\tassert(p_pi != 00);\n\tassert(p_tcp != 00);\n\n\t/* initializations*/\n\tl_bound = p_tcp->numpocs+1;\n\tl_current_pi = p_pi;\n\tl_current_poc = p_tcp->pocs;\n\n\tfor\t(pino = 0;pino<l_bound;++pino) {\n\t\tl_current_pi->poc.prg = l_current_poc->prg; /* Progression Order #0 */\n\t\tl_current_pi->first = 1;\n\n\t\tl_current_pi->poc.resno0 = l_current_poc->resno0; /* Resolution Level Index #0 (Start) */\n\t\tl_current_pi->poc.compno0 = l_current_poc->compno0; /* Component Index #0 (Start) */\n\t\tl_current_pi->poc.layno0 = 0;\n\t\tl_current_pi->poc.precno0 = 0;\n\t\tl_current_pi->poc.resno1 = l_current_poc->resno1; /* Resolution Level Index #0 (End) */\n\t\tl_current_pi->poc.compno1 = l_current_poc->compno1; /* Component Index #0 (End) */\n\t\tl_current_pi->poc.layno1 = l_current_poc->layno1; /* Layer Index #0 (End) */\n\t\tl_current_pi->poc.precno1 = p_max_precision;\n\t\t++l_current_pi;\n\t\t++l_current_poc;\n\t}\n}\n\nvoid opj_pi_update_decode_not_poc (opj_pi_iterator_t * p_pi,\n                                   opj_tcp_t * p_tcp,\n                                   OPJ_UINT32 p_max_precision,\n                                   OPJ_UINT32 p_max_res)\n{\n\t/* loop*/\n\tOPJ_UINT32 pino;\n\n\t/* encoding prameters to set*/\n\tOPJ_UINT32 l_bound;\n\n\topj_pi_iterator_t * l_current_pi = 00;\n\t/* preconditions in debug*/\n\tassert(p_tcp != 00);\n\tassert(p_pi != 00);\n\n\t/* initializations*/\n\tl_bound = p_tcp->numpocs+1;\n\tl_current_pi = p_pi;\n\n\tfor (pino = 0;pino<l_bound;++pino) {\n\t\tl_current_pi->poc.prg = p_tcp->prg;\n\t\tl_current_pi->first = 1;\n\t\tl_current_pi->poc.resno0 = 0;\n\t\tl_current_pi->poc.compno0 = 0;\n\t\tl_current_pi->poc.layno0 = 0;\n\t\tl_current_pi->poc.precno0 = 0;\n\t\tl_current_pi->poc.resno1 = p_max_res;\n\t\tl_current_pi->poc.compno1 = l_current_pi->numcomps;\n\t\tl_current_pi->poc.layno1 = p_tcp->numlayers;\n\t\tl_current_pi->poc.precno1 = p_max_precision;\n\t\t++l_current_pi;\n\t}\n}\n\n\n\nOPJ_BOOL opj_pi_check_next_level(\tOPJ_INT32 pos,\n\t\t\t\t\t\t\t\topj_cp_t *cp,\n\t\t\t\t\t\t\t\tOPJ_UINT32 tileno,\n\t\t\t\t\t\t\t\tOPJ_UINT32 pino,\n\t\t\t\t\t\t\t\tconst OPJ_CHAR *prog)\n{\n\tOPJ_INT32 i;\n\topj_tcp_t *tcps =&cp->tcps[tileno];\n\topj_poc_t *tcp = &tcps->pocs[pino];\n\n\tif(pos>=0){\n\t\tfor(i=pos;pos>=0;i--){\n\t\t\tswitch(prog[i]){\n\t\t    case 'R':\n\t\t\t    if(tcp->res_t==tcp->resE){\n\t\t\t\t    if(opj_pi_check_next_level(pos-1,cp,tileno,pino,prog)){\n\t\t\t\t\t    return OPJ_TRUE;\n\t\t\t\t    }else{\n\t\t\t\t\t    return OPJ_FALSE;\n\t\t\t\t    }\n\t\t\t    }else{\n\t\t\t\t    return OPJ_TRUE;\n\t\t\t    }\n\t\t\t    break;\n\t\t    case 'C':\n\t\t\t    if(tcp->comp_t==tcp->compE){\n\t\t\t\t    if(opj_pi_check_next_level(pos-1,cp,tileno,pino,prog)){\n\t\t\t\t\t    return OPJ_TRUE;\n\t\t\t\t    }else{\n\t\t\t\t\t    return OPJ_FALSE;\n\t\t\t\t    }\n\t\t\t    }else{\n\t\t\t\t    return OPJ_TRUE;\n\t\t\t    }\n\t\t\t    break;\n\t\t    case 'L':\n\t\t\t    if(tcp->lay_t==tcp->layE){\n\t\t\t\t    if(opj_pi_check_next_level(pos-1,cp,tileno,pino,prog)){\n\t\t\t\t\t    return OPJ_TRUE;\n\t\t\t\t    }else{\n\t\t\t\t\t    return OPJ_FALSE;\n\t\t\t\t    }\n\t\t\t    }else{\n\t\t\t\t    return OPJ_TRUE;\n\t\t\t    }\n\t\t\t    break;\n\t\t    case 'P':\n\t\t\t    switch(tcp->prg){\n\t\t\t\t    case OPJ_LRCP||OPJ_RLCP:\n\t\t\t\t\t    if(tcp->prc_t == tcp->prcE){\n\t\t\t\t\t\t    if(opj_pi_check_next_level(i-1,cp,tileno,pino,prog)){\n\t\t\t\t\t\t\t    return OPJ_TRUE;\n\t\t\t\t\t\t    }else{\n\t\t\t\t\t\t\t    return OPJ_FALSE;\n\t\t\t\t\t\t    }\n\t\t\t\t\t    }else{\n\t\t\t\t\t\t    return OPJ_TRUE;\n\t\t\t\t\t    }\n\t\t\t\t\t    break;\n\t\t\t    default:\n\t\t\t\t    if(tcp->tx0_t == tcp->txE){\n\t\t\t\t\t    /*TY*/\n\t\t\t\t\t    if(tcp->ty0_t == tcp->tyE){\n\t\t\t\t\t\t    if(opj_pi_check_next_level(i-1,cp,tileno,pino,prog)){\n\t\t\t\t\t\t\t    return OPJ_TRUE;\n\t\t\t\t\t\t    }else{\n\t\t\t\t\t\t\t    return OPJ_FALSE;\n\t\t\t\t\t\t    }\n\t\t\t\t\t    }else{\n\t\t\t\t\t\t    return OPJ_TRUE;\n\t\t\t\t\t    }/*TY*/\n\t\t\t\t    }else{\n\t\t\t\t\t    return OPJ_TRUE;\n\t\t\t\t    }\n\t\t\t\t    break;\n\t\t\t    }/*end case P*/\n\t\t    }/*end switch*/\n\t\t}/*end for*/\n\t}/*end if*/\n\treturn OPJ_FALSE;\n}\n\n\n/*\n==========================================================\n   Packet iterator interface\n==========================================================\n*/\nopj_pi_iterator_t *opj_pi_create_decode(opj_image_t *p_image,\n\t\t\t\t\t\t\t\t\t\topj_cp_t *p_cp,\n\t\t\t\t\t\t\t\t\t\tOPJ_UINT32 p_tile_no)\n{\n\t/* loop */\n\tOPJ_UINT32 pino;\n\tOPJ_UINT32 compno, resno;\n\n\t/* to store w, h, dx and dy fro all components and resolutions */\n\tOPJ_UINT32 * l_tmp_data;\n\tOPJ_UINT32 ** l_tmp_ptr;\n\n\t/* encoding prameters to set */\n\tOPJ_UINT32 l_max_res;\n\tOPJ_UINT32 l_max_prec;\n\tOPJ_INT32 l_tx0,l_tx1,l_ty0,l_ty1;\n\tOPJ_UINT32 l_dx_min,l_dy_min;\n\tOPJ_UINT32 l_bound;\n\tOPJ_UINT32 l_step_p , l_step_c , l_step_r , l_step_l ;\n\tOPJ_UINT32 l_data_stride;\n\n\t/* pointers */\n\topj_pi_iterator_t *l_pi = 00;\n\topj_tcp_t *l_tcp = 00;\n\tconst opj_tccp_t *l_tccp = 00;\n\topj_pi_comp_t *l_current_comp = 00;\n\topj_image_comp_t * l_img_comp = 00;\n\topj_pi_iterator_t * l_current_pi = 00;\n\tOPJ_UINT32 * l_encoding_value_ptr = 00;\n\n\t/* preconditions in debug */\n\tassert(p_cp != 00);\n\tassert(p_image != 00);\n\tassert(p_tile_no < p_cp->tw * p_cp->th);\n\n\t/* initializations */\n\tl_tcp = &p_cp->tcps[p_tile_no];\n\tl_bound = l_tcp->numpocs+1;\n\n\tl_data_stride = 4 * OPJ_J2K_MAXRLVLS;\n\tl_tmp_data = (OPJ_UINT32*)opj_malloc(\n\t\tl_data_stride * p_image->numcomps * sizeof(OPJ_UINT32));\n\tif\n\t\t(! l_tmp_data)\n\t{\n\t\treturn 00;\n\t}\n\tl_tmp_ptr = (OPJ_UINT32**)opj_malloc(\n\t\tp_image->numcomps * sizeof(OPJ_UINT32 *));\n\tif\n\t\t(! l_tmp_ptr)\n\t{\n\t\topj_free(l_tmp_data);\n\t\treturn 00;\n\t}\n\n\t/* memory allocation for pi */\n\tl_pi = opj_pi_create(p_image, p_cp, p_tile_no);\n\tif (!l_pi) {\n\t\topj_free(l_tmp_data);\n\t\topj_free(l_tmp_ptr);\n\t\treturn 00;\n\t}\n\n\tl_encoding_value_ptr = l_tmp_data;\n\t/* update pointer array */\n\tfor\n\t\t(compno = 0; compno < p_image->numcomps; ++compno)\n\t{\n\t\tl_tmp_ptr[compno] = l_encoding_value_ptr;\n\t\tl_encoding_value_ptr += l_data_stride;\n\t}\n\t/* get encoding parameters */\n\topj_get_all_encoding_parameters(p_image,p_cp,p_tile_no,&l_tx0,&l_tx1,&l_ty0,&l_ty1,&l_dx_min,&l_dy_min,&l_max_prec,&l_max_res,l_tmp_ptr);\n\n\t/* step calculations */\n\tl_step_p = 1;\n\tl_step_c = l_max_prec * l_step_p;\n\tl_step_r = p_image->numcomps * l_step_c;\n\tl_step_l = l_max_res * l_step_r;\n\n\t/* set values for first packet iterator */\n\tl_current_pi = l_pi;\n\n\t/* memory allocation for include */\n\tl_current_pi->include = (OPJ_INT16*) opj_calloc((l_tcp->numlayers +1) * l_step_l, sizeof(OPJ_INT16));\n\tif\n\t\t(!l_current_pi->include)\n\t{\n\t\topj_free(l_tmp_data);\n\t\topj_free(l_tmp_ptr);\n\t\topj_pi_destroy(l_pi, l_bound);\n\t\treturn 00;\n\t}\n\tmemset(l_current_pi->include,0, (l_tcp->numlayers + 1) * l_step_l* sizeof(OPJ_INT16));\n\n\t/* special treatment for the first packet iterator */\n\tl_current_comp = l_current_pi->comps;\n\tl_img_comp = p_image->comps;\n\tl_tccp = l_tcp->tccps;\n\n\tl_current_pi->tx0 = l_tx0;\n\tl_current_pi->ty0 = l_ty0;\n\tl_current_pi->tx1 = l_tx1;\n\tl_current_pi->ty1 = l_ty1;\n\n\t/*l_current_pi->dx = l_img_comp->dx;*/\n\t/*l_current_pi->dy = l_img_comp->dy;*/\n\n\tl_current_pi->step_p = l_step_p;\n\tl_current_pi->step_c = l_step_c;\n\tl_current_pi->step_r = l_step_r;\n\tl_current_pi->step_l = l_step_l;\n\n\t/* allocation for components and number of components has already been calculated by opj_pi_create */\n\tfor\n\t\t(compno = 0; compno < l_current_pi->numcomps; ++compno)\n\t{\n\t\topj_pi_resolution_t *l_res = l_current_comp->resolutions;\n\t\tl_encoding_value_ptr = l_tmp_ptr[compno];\n\n\t\tl_current_comp->dx = l_img_comp->dx;\n\t\tl_current_comp->dy = l_img_comp->dy;\n\t\t/* resolutions have already been initialized */\n\t\tfor\n\t\t\t(resno = 0; resno < l_current_comp->numresolutions; resno++)\n\t\t{\n\t\t\tl_res->pdx = *(l_encoding_value_ptr++);\n\t\t\tl_res->pdy = *(l_encoding_value_ptr++);\n\t\t\tl_res->pw =  *(l_encoding_value_ptr++);\n\t\t\tl_res->ph =  *(l_encoding_value_ptr++);\n\t\t\t++l_res;\n\t\t}\n\t\t++l_current_comp;\n\t\t++l_img_comp;\n\t\t++l_tccp;\n\t}\n\t++l_current_pi;\n\n\tfor (pino = 1 ; pino<l_bound ; ++pino )\n\t{\n\t\tl_current_comp = l_current_pi->comps;\n\t\tl_img_comp = p_image->comps;\n\t\tl_tccp = l_tcp->tccps;\n\n\t\tl_current_pi->tx0 = l_tx0;\n\t\tl_current_pi->ty0 = l_ty0;\n\t\tl_current_pi->tx1 = l_tx1;\n\t\tl_current_pi->ty1 = l_ty1;\n\t\t/*l_current_pi->dx = l_dx_min;*/\n\t\t/*l_current_pi->dy = l_dy_min;*/\n\t\tl_current_pi->step_p = l_step_p;\n\t\tl_current_pi->step_c = l_step_c;\n\t\tl_current_pi->step_r = l_step_r;\n\t\tl_current_pi->step_l = l_step_l;\n\n\t\t/* allocation for components and number of components has already been calculated by opj_pi_create */\n\t\tfor\n\t\t\t(compno = 0; compno < l_current_pi->numcomps; ++compno)\n\t\t{\n\t\t\topj_pi_resolution_t *l_res = l_current_comp->resolutions;\n\t\t\tl_encoding_value_ptr = l_tmp_ptr[compno];\n\n\t\t\tl_current_comp->dx = l_img_comp->dx;\n\t\t\tl_current_comp->dy = l_img_comp->dy;\n\t\t\t/* resolutions have already been initialized */\n\t\t\tfor\n\t\t\t\t(resno = 0; resno < l_current_comp->numresolutions; resno++)\n\t\t\t{\n\t\t\t\tl_res->pdx = *(l_encoding_value_ptr++);\n\t\t\t\tl_res->pdy = *(l_encoding_value_ptr++);\n\t\t\t\tl_res->pw =  *(l_encoding_value_ptr++);\n\t\t\t\tl_res->ph =  *(l_encoding_value_ptr++);\n\t\t\t\t++l_res;\n\t\t\t}\n\t\t\t++l_current_comp;\n\t\t\t++l_img_comp;\n\t\t\t++l_tccp;\n\t\t}\n\t\t/* special treatment*/\n\t\tl_current_pi->include = (l_current_pi-1)->include;\n\t\t++l_current_pi;\n\t}\n\topj_free(l_tmp_data);\n\tl_tmp_data = 00;\n\topj_free(l_tmp_ptr);\n\tl_tmp_ptr = 00;\n\tif\n\t\t(l_tcp->POC)\n\t{\n\t\topj_pi_update_decode_poc (l_pi,l_tcp,l_max_prec,l_max_res);\n\t}\n\telse\n\t{\n\t\topj_pi_update_decode_not_poc(l_pi,l_tcp,l_max_prec,l_max_res);\n\t}\n\treturn l_pi;\n}\n\n\n\nopj_pi_iterator_t *opj_pi_initialise_encode(const opj_image_t *p_image,\n                                            opj_cp_t *p_cp,\n                                            OPJ_UINT32 p_tile_no,\n                                            J2K_T2_MODE p_t2_mode )\n{\n\t/* loop*/\n\tOPJ_UINT32 pino;\n\tOPJ_UINT32 compno, resno;\n\n\t/* to store w, h, dx and dy fro all components and resolutions*/\n\tOPJ_UINT32 * l_tmp_data;\n\tOPJ_UINT32 ** l_tmp_ptr;\n\n\t/* encoding prameters to set*/\n\tOPJ_UINT32 l_max_res;\n\tOPJ_UINT32 l_max_prec;\n\tOPJ_INT32 l_tx0,l_tx1,l_ty0,l_ty1;\n\tOPJ_UINT32 l_dx_min,l_dy_min;\n\tOPJ_UINT32 l_bound;\n\tOPJ_UINT32 l_step_p , l_step_c , l_step_r , l_step_l ;\n\tOPJ_UINT32 l_data_stride;\n\n\t/* pointers*/\n\topj_pi_iterator_t *l_pi = 00;\n\topj_tcp_t *l_tcp = 00;\n\tconst opj_tccp_t *l_tccp = 00;\n\topj_pi_comp_t *l_current_comp = 00;\n\topj_image_comp_t * l_img_comp = 00;\n\topj_pi_iterator_t * l_current_pi = 00;\n\tOPJ_UINT32 * l_encoding_value_ptr = 00;\n\n\t/* preconditions in debug*/\n\tassert(p_cp != 00);\n\tassert(p_image != 00);\n\tassert(p_tile_no < p_cp->tw * p_cp->th);\n\n\t/* initializations*/\n\tl_tcp = &p_cp->tcps[p_tile_no];\n\tl_bound = l_tcp->numpocs+1;\n\n\tl_data_stride = 4 * OPJ_J2K_MAXRLVLS;\n\tl_tmp_data = (OPJ_UINT32*)opj_malloc(\n\t\tl_data_stride * p_image->numcomps * sizeof(OPJ_UINT32));\n\tif (! l_tmp_data) {\n\t\treturn 00;\n\t}\n\n\tl_tmp_ptr = (OPJ_UINT32**)opj_malloc(\n\t\tp_image->numcomps * sizeof(OPJ_UINT32 *));\n\tif (! l_tmp_ptr) {\n\t\topj_free(l_tmp_data);\n\t\treturn 00;\n\t}\n\n\t/* memory allocation for pi*/\n\tl_pi = opj_pi_create(p_image,p_cp,p_tile_no);\n\tif (!l_pi) {\n\t\topj_free(l_tmp_data);\n\t\topj_free(l_tmp_ptr);\n\t\treturn 00;\n\t}\n\n\tl_encoding_value_ptr = l_tmp_data;\n\t/* update pointer array*/\n\tfor (compno = 0; compno < p_image->numcomps; ++compno) {\n\t\tl_tmp_ptr[compno] = l_encoding_value_ptr;\n\t\tl_encoding_value_ptr += l_data_stride;\n\t}\n\n\t/* get encoding parameters*/\n\topj_get_all_encoding_parameters(p_image,p_cp,p_tile_no,&l_tx0,&l_tx1,&l_ty0,&l_ty1,&l_dx_min,&l_dy_min,&l_max_prec,&l_max_res,l_tmp_ptr);\n\n\t/* step calculations*/\n\tl_step_p = 1;\n\tl_step_c = l_max_prec * l_step_p;\n\tl_step_r = p_image->numcomps * l_step_c;\n\tl_step_l = l_max_res * l_step_r;\n\n\t/* set values for first packet iterator*/\n\tl_pi->tp_on = p_cp->m_specific_param.m_enc.m_tp_on;\n\tl_current_pi = l_pi;\n\n\t/* memory allocation for include*/\n\tl_current_pi->include = (OPJ_INT16*) opj_calloc(l_tcp->numlayers * l_step_l, sizeof(OPJ_INT16));\n\tif (!l_current_pi->include) {\n\t\topj_free(l_tmp_data);\n\t\topj_free(l_tmp_ptr);\n\t\topj_pi_destroy(l_pi, l_bound);\n\t\treturn 00;\n\t}\n\tmemset(l_current_pi->include,0,l_tcp->numlayers * l_step_l* sizeof(OPJ_INT16));\n\n\t/* special treatment for the first packet iterator*/\n\tl_current_comp = l_current_pi->comps;\n\tl_img_comp = p_image->comps;\n\tl_tccp = l_tcp->tccps;\n\tl_current_pi->tx0 = l_tx0;\n\tl_current_pi->ty0 = l_ty0;\n\tl_current_pi->tx1 = l_tx1;\n\tl_current_pi->ty1 = l_ty1;\n\tl_current_pi->dx = l_dx_min;\n\tl_current_pi->dy = l_dy_min;\n\tl_current_pi->step_p = l_step_p;\n\tl_current_pi->step_c = l_step_c;\n\tl_current_pi->step_r = l_step_r;\n\tl_current_pi->step_l = l_step_l;\n\n\t/* allocation for components and number of components has already been calculated by opj_pi_create */\n\tfor (compno = 0; compno < l_current_pi->numcomps; ++compno) {\n\t\topj_pi_resolution_t *l_res = l_current_comp->resolutions;\n\t\tl_encoding_value_ptr = l_tmp_ptr[compno];\n\n\t\tl_current_comp->dx = l_img_comp->dx;\n\t\tl_current_comp->dy = l_img_comp->dy;\n\n\t\t/* resolutions have already been initialized */\n\t\tfor (resno = 0; resno < l_current_comp->numresolutions; resno++) {\n\t\t\tl_res->pdx = *(l_encoding_value_ptr++);\n\t\t\tl_res->pdy = *(l_encoding_value_ptr++);\n\t\t\tl_res->pw =  *(l_encoding_value_ptr++);\n\t\t\tl_res->ph =  *(l_encoding_value_ptr++);\n\t\t\t++l_res;\n\t\t}\n\n\t\t++l_current_comp;\n\t\t++l_img_comp;\n\t\t++l_tccp;\n\t}\n\t++l_current_pi;\n\n\tfor (pino = 1 ; pino<l_bound ; ++pino ) {\n\t\tl_current_comp = l_current_pi->comps;\n\t\tl_img_comp = p_image->comps;\n\t\tl_tccp = l_tcp->tccps;\n\n\t\tl_current_pi->tx0 = l_tx0;\n\t\tl_current_pi->ty0 = l_ty0;\n\t\tl_current_pi->tx1 = l_tx1;\n\t\tl_current_pi->ty1 = l_ty1;\n\t\tl_current_pi->dx = l_dx_min;\n\t\tl_current_pi->dy = l_dy_min;\n\t\tl_current_pi->step_p = l_step_p;\n\t\tl_current_pi->step_c = l_step_c;\n\t\tl_current_pi->step_r = l_step_r;\n\t\tl_current_pi->step_l = l_step_l;\n\n\t\t/* allocation for components and number of components has already been calculated by opj_pi_create */\n\t\tfor (compno = 0; compno < l_current_pi->numcomps; ++compno) {\n\t\t\topj_pi_resolution_t *l_res = l_current_comp->resolutions;\n\t\t\tl_encoding_value_ptr = l_tmp_ptr[compno];\n\n\t\t\tl_current_comp->dx = l_img_comp->dx;\n\t\t\tl_current_comp->dy = l_img_comp->dy;\n\t\t\t/* resolutions have already been initialized */\n\t\t\tfor (resno = 0; resno < l_current_comp->numresolutions; resno++) {\n\t\t\t\tl_res->pdx = *(l_encoding_value_ptr++);\n\t\t\t\tl_res->pdy = *(l_encoding_value_ptr++);\n\t\t\t\tl_res->pw =  *(l_encoding_value_ptr++);\n\t\t\t\tl_res->ph =  *(l_encoding_value_ptr++);\n\t\t\t\t++l_res;\n\t\t\t}\n\t\t\t++l_current_comp;\n\t\t\t++l_img_comp;\n\t\t\t++l_tccp;\n\t\t}\n\n\t\t/* special treatment*/\n\t\tl_current_pi->include = (l_current_pi-1)->include;\n\t\t++l_current_pi;\n\t}\n\n\topj_free(l_tmp_data);\n\tl_tmp_data = 00;\n\topj_free(l_tmp_ptr);\n\tl_tmp_ptr = 00;\n\n    if (l_tcp->POC && (OPJ_IS_CINEMA(p_cp->rsiz) || p_t2_mode == FINAL_PASS)) {\n\t\topj_pi_update_encode_poc_and_final(p_cp,p_tile_no,l_tx0,l_tx1,l_ty0,l_ty1,l_max_prec,l_max_res,l_dx_min,l_dy_min);\n\t}\n\telse {\n\t\topj_pi_update_encode_not_poc(p_cp,p_image->numcomps,p_tile_no,l_tx0,l_tx1,l_ty0,l_ty1,l_max_prec,l_max_res,l_dx_min,l_dy_min);\n\t}\n\n\treturn l_pi;\n}\n\nvoid opj_pi_create_encode( \topj_pi_iterator_t *pi,\n\t\t\t\t\t\t\topj_cp_t *cp,\n\t\t\t\t\t\t\tOPJ_UINT32 tileno,\n\t\t\t\t\t\t\tOPJ_UINT32 pino,\n\t\t\t\t\t\t\tOPJ_UINT32 tpnum,\n\t\t\t\t\t\t\tOPJ_INT32 tppos,\n\t\t\t\t\t\t\tJ2K_T2_MODE t2_mode)\n{\n\tconst OPJ_CHAR *prog;\n\tOPJ_INT32 i;\n\tOPJ_UINT32 incr_top=1,resetX=0;\n\topj_tcp_t *tcps =&cp->tcps[tileno];\n\topj_poc_t *tcp= &tcps->pocs[pino];\n\n\tprog = opj_j2k_convert_progression_order(tcp->prg);\n\n\tpi[pino].first = 1;\n\tpi[pino].poc.prg = tcp->prg;\n\n    if(!(cp->m_specific_param.m_enc.m_tp_on && ((!OPJ_IS_CINEMA(cp->rsiz) && (t2_mode == FINAL_PASS)) || OPJ_IS_CINEMA(cp->rsiz)))){\n\t\tpi[pino].poc.resno0 = tcp->resS;\n\t\tpi[pino].poc.resno1 = tcp->resE;\n\t\tpi[pino].poc.compno0 = tcp->compS;\n\t\tpi[pino].poc.compno1 = tcp->compE;\n\t\tpi[pino].poc.layno0 = tcp->layS;\n\t\tpi[pino].poc.layno1 = tcp->layE;\n\t\tpi[pino].poc.precno0 = tcp->prcS;\n\t\tpi[pino].poc.precno1 = tcp->prcE;\n\t\tpi[pino].poc.tx0 = (OPJ_INT32)tcp->txS;\n\t\tpi[pino].poc.ty0 = (OPJ_INT32)tcp->tyS;\n\t\tpi[pino].poc.tx1 = (OPJ_INT32)tcp->txE;\n\t\tpi[pino].poc.ty1 = (OPJ_INT32)tcp->tyE;\n\t}else {\n\t\tfor(i=tppos+1;i<4;i++){\n\t\t\tswitch(prog[i]){\n\t\t\tcase 'R':\n\t\t\t\tpi[pino].poc.resno0 = tcp->resS;\n\t\t\t\tpi[pino].poc.resno1 = tcp->resE;\n\t\t\t\tbreak;\n\t\t\tcase 'C':\n\t\t\t\tpi[pino].poc.compno0 = tcp->compS;\n\t\t\t\tpi[pino].poc.compno1 = tcp->compE;\n\t\t\t\tbreak;\n\t\t\tcase 'L':\n\t\t\t\tpi[pino].poc.layno0 = tcp->layS;\n\t\t\t\tpi[pino].poc.layno1 = tcp->layE;\n\t\t\t\tbreak;\n\t\t\tcase 'P':\n\t\t\t\tswitch(tcp->prg){\n\t\t\t\tcase OPJ_LRCP:\n\t\t\t\tcase OPJ_RLCP:\n\t\t\t\t\tpi[pino].poc.precno0 = tcp->prcS;\n\t\t\t\t\tpi[pino].poc.precno1 = tcp->prcE;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tpi[pino].poc.tx0 = (OPJ_INT32)tcp->txS;\n\t\t\t\t\tpi[pino].poc.ty0 = (OPJ_INT32)tcp->tyS;\n\t\t\t\t\tpi[pino].poc.tx1 = (OPJ_INT32)tcp->txE;\n\t\t\t\t\tpi[pino].poc.ty1 = (OPJ_INT32)tcp->tyE;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif(tpnum==0){\n\t\t\tfor(i=tppos;i>=0;i--){\n\t\t\t\tswitch(prog[i]){\n\t\t\t\tcase 'C':\n\t\t\t\t\ttcp->comp_t = tcp->compS;\n\t\t\t\t\tpi[pino].poc.compno0 = tcp->comp_t;\n\t\t\t\t\tpi[pino].poc.compno1 = tcp->comp_t+1;\n\t\t\t\t\ttcp->comp_t+=1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'R':\n\t\t\t\t\ttcp->res_t = tcp->resS;\n\t\t\t\t\tpi[pino].poc.resno0 = tcp->res_t;\n\t\t\t\t\tpi[pino].poc.resno1 = tcp->res_t+1;\n\t\t\t\t\ttcp->res_t+=1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'L':\n\t\t\t\t\ttcp->lay_t = tcp->layS;\n\t\t\t\t\tpi[pino].poc.layno0 = tcp->lay_t;\n\t\t\t\t\tpi[pino].poc.layno1 = tcp->lay_t+1;\n\t\t\t\t\ttcp->lay_t+=1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'P':\n\t\t\t\t\tswitch(tcp->prg){\n\t\t\t\t\tcase OPJ_LRCP:\n\t\t\t\t\tcase OPJ_RLCP:\n\t\t\t\t\t\ttcp->prc_t = tcp->prcS;\n\t\t\t\t\t\tpi[pino].poc.precno0 = tcp->prc_t;\n\t\t\t\t\t\tpi[pino].poc.precno1 = tcp->prc_t+1;\n\t\t\t\t\t\ttcp->prc_t+=1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\ttcp->tx0_t = tcp->txS;\n\t\t\t\t\t\ttcp->ty0_t = tcp->tyS;\n\t\t\t\t\t\tpi[pino].poc.tx0 = (OPJ_INT32)tcp->tx0_t;\n\t\t\t\t\t\tpi[pino].poc.tx1 = (OPJ_INT32)(tcp->tx0_t + tcp->dx - (tcp->tx0_t % tcp->dx));\n\t\t\t\t\t\tpi[pino].poc.ty0 = (OPJ_INT32)tcp->ty0_t;\n\t\t\t\t\t\tpi[pino].poc.ty1 = (OPJ_INT32)(tcp->ty0_t + tcp->dy - (tcp->ty0_t % tcp->dy));\n\t\t\t\t\t\ttcp->tx0_t = (OPJ_UINT32)pi[pino].poc.tx1;\n\t\t\t\t\t\ttcp->ty0_t = (OPJ_UINT32)pi[pino].poc.ty1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tincr_top=1;\n\t\t}else{\n\t\t\tfor(i=tppos;i>=0;i--){\n\t\t\t\tswitch(prog[i]){\n\t\t\t\tcase 'C':\n\t\t\t\t\tpi[pino].poc.compno0 = tcp->comp_t-1;\n\t\t\t\t\tpi[pino].poc.compno1 = tcp->comp_t;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'R':\n\t\t\t\t\tpi[pino].poc.resno0 = tcp->res_t-1;\n\t\t\t\t\tpi[pino].poc.resno1 = tcp->res_t;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'L':\n\t\t\t\t\tpi[pino].poc.layno0 = tcp->lay_t-1;\n\t\t\t\t\tpi[pino].poc.layno1 = tcp->lay_t;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'P':\n\t\t\t\t\tswitch(tcp->prg){\n\t\t\t\t\tcase OPJ_LRCP:\n\t\t\t\t\tcase OPJ_RLCP:\n\t\t\t\t\t\tpi[pino].poc.precno0 = tcp->prc_t-1;\n\t\t\t\t\t\tpi[pino].poc.precno1 = tcp->prc_t;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tpi[pino].poc.tx0 = (OPJ_INT32)(tcp->tx0_t - tcp->dx - (tcp->tx0_t % tcp->dx));\n\t\t\t\t\t\tpi[pino].poc.tx1 = (OPJ_INT32)tcp->tx0_t ;\n\t\t\t\t\t\tpi[pino].poc.ty0 = (OPJ_INT32)(tcp->ty0_t - tcp->dy - (tcp->ty0_t % tcp->dy));\n\t\t\t\t\t\tpi[pino].poc.ty1 = (OPJ_INT32)tcp->ty0_t ;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(incr_top==1){\n\t\t\t\t\tswitch(prog[i]){\n\t\t\t\t\tcase 'R':\n\t\t\t\t\t\tif(tcp->res_t==tcp->resE){\n\t\t\t\t\t\t\tif(opj_pi_check_next_level(i-1,cp,tileno,pino,prog)){\n\t\t\t\t\t\t\t\ttcp->res_t = tcp->resS;\n\t\t\t\t\t\t\t\tpi[pino].poc.resno0 = tcp->res_t;\n\t\t\t\t\t\t\t\tpi[pino].poc.resno1 = tcp->res_t+1;\n\t\t\t\t\t\t\t\ttcp->res_t+=1;\n\t\t\t\t\t\t\t\tincr_top=1;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tincr_top=0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tpi[pino].poc.resno0 = tcp->res_t;\n\t\t\t\t\t\t\tpi[pino].poc.resno1 = tcp->res_t+1;\n\t\t\t\t\t\t\ttcp->res_t+=1;\n\t\t\t\t\t\t\tincr_top=0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'C':\n\t\t\t\t\t\tif(tcp->comp_t ==tcp->compE){\n\t\t\t\t\t\t\tif(opj_pi_check_next_level(i-1,cp,tileno,pino,prog)){\n\t\t\t\t\t\t\t\ttcp->comp_t = tcp->compS;\n\t\t\t\t\t\t\t\tpi[pino].poc.compno0 = tcp->comp_t;\n\t\t\t\t\t\t\t\tpi[pino].poc.compno1 = tcp->comp_t+1;\n\t\t\t\t\t\t\t\ttcp->comp_t+=1;\n\t\t\t\t\t\t\t\tincr_top=1;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tincr_top=0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tpi[pino].poc.compno0 = tcp->comp_t;\n\t\t\t\t\t\t\tpi[pino].poc.compno1 = tcp->comp_t+1;\n\t\t\t\t\t\t\ttcp->comp_t+=1;\n\t\t\t\t\t\t\tincr_top=0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'L':\n\t\t\t\t\t\tif(tcp->lay_t == tcp->layE){\n\t\t\t\t\t\t\tif(opj_pi_check_next_level(i-1,cp,tileno,pino,prog)){\n\t\t\t\t\t\t\t\ttcp->lay_t = tcp->layS;\n\t\t\t\t\t\t\t\tpi[pino].poc.layno0 = tcp->lay_t;\n\t\t\t\t\t\t\t\tpi[pino].poc.layno1 = tcp->lay_t+1;\n\t\t\t\t\t\t\t\ttcp->lay_t+=1;\n\t\t\t\t\t\t\t\tincr_top=1;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tincr_top=0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tpi[pino].poc.layno0 = tcp->lay_t;\n\t\t\t\t\t\t\tpi[pino].poc.layno1 = tcp->lay_t+1;\n\t\t\t\t\t\t\ttcp->lay_t+=1;\n\t\t\t\t\t\t\tincr_top=0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'P':\n\t\t\t\t\t\tswitch(tcp->prg){\n\t\t\t\t\t\tcase OPJ_LRCP:\n\t\t\t\t\t\tcase OPJ_RLCP:\n\t\t\t\t\t\t\tif(tcp->prc_t == tcp->prcE){\n\t\t\t\t\t\t\t\tif(opj_pi_check_next_level(i-1,cp,tileno,pino,prog)){\n\t\t\t\t\t\t\t\t\ttcp->prc_t = tcp->prcS;\n\t\t\t\t\t\t\t\t\tpi[pino].poc.precno0 = tcp->prc_t;\n\t\t\t\t\t\t\t\t\tpi[pino].poc.precno1 = tcp->prc_t+1;\n\t\t\t\t\t\t\t\t\ttcp->prc_t+=1;\n\t\t\t\t\t\t\t\t\tincr_top=1;\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tincr_top=0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tpi[pino].poc.precno0 = tcp->prc_t;\n\t\t\t\t\t\t\t\tpi[pino].poc.precno1 = tcp->prc_t+1;\n\t\t\t\t\t\t\t\ttcp->prc_t+=1;\n\t\t\t\t\t\t\t\tincr_top=0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif(tcp->tx0_t >= tcp->txE){\n\t\t\t\t\t\t\t\tif(tcp->ty0_t >= tcp->tyE){\n\t\t\t\t\t\t\t\t\tif(opj_pi_check_next_level(i-1,cp,tileno,pino,prog)){\n\t\t\t\t\t\t\t\t\t\ttcp->ty0_t = tcp->tyS;\n\t\t\t\t\t\t\t\t\t\tpi[pino].poc.ty0 = (OPJ_INT32)tcp->ty0_t;\n\t\t\t\t\t\t\t\t\t\tpi[pino].poc.ty1 = (OPJ_INT32)(tcp->ty0_t + tcp->dy - (tcp->ty0_t % tcp->dy));\n\t\t\t\t\t\t\t\t\t\ttcp->ty0_t = (OPJ_UINT32)pi[pino].poc.ty1;\n\t\t\t\t\t\t\t\t\t\tincr_top=1;resetX=1;\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\tincr_top=0;resetX=0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tpi[pino].poc.ty0 = (OPJ_INT32)tcp->ty0_t;\n\t\t\t\t\t\t\t\t\tpi[pino].poc.ty1 = (OPJ_INT32)(tcp->ty0_t + tcp->dy - (tcp->ty0_t % tcp->dy));\n\t\t\t\t\t\t\t\t\ttcp->ty0_t = (OPJ_UINT32)pi[pino].poc.ty1;\n\t\t\t\t\t\t\t\t\tincr_top=0;resetX=1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(resetX==1){\n\t\t\t\t\t\t\t\t\ttcp->tx0_t = tcp->txS;\n\t\t\t\t\t\t\t\t\tpi[pino].poc.tx0 = (OPJ_INT32)tcp->tx0_t;\n\t\t\t\t\t\t\t\t\tpi[pino].poc.tx1 = (OPJ_INT32)(tcp->tx0_t + tcp->dx- (tcp->tx0_t % tcp->dx));\n\t\t\t\t\t\t\t\t\ttcp->tx0_t = (OPJ_UINT32)pi[pino].poc.tx1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tpi[pino].poc.tx0 = (OPJ_INT32)tcp->tx0_t;\n\t\t\t\t\t\t\t\tpi[pino].poc.tx1 = (OPJ_INT32)(tcp->tx0_t + tcp->dx- (tcp->tx0_t % tcp->dx));\n\t\t\t\t\t\t\t\ttcp->tx0_t = (OPJ_UINT32)pi[pino].poc.tx1;\n\t\t\t\t\t\t\t\tincr_top=0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nvoid opj_pi_destroy(opj_pi_iterator_t *p_pi,\n                    OPJ_UINT32 p_nb_elements)\n{\n\tOPJ_UINT32 compno, pino;\n\topj_pi_iterator_t *l_current_pi = p_pi;\n    if (p_pi) {\n\t\tif (p_pi->include) {\n\t\t\topj_free(p_pi->include);\n\t\t\tp_pi->include = 00;\n\t\t}\n\t\tfor (pino = 0; pino < p_nb_elements; ++pino){\n\t\t\tif(l_current_pi->comps) {\n\t\t\t\topj_pi_comp_t *l_current_component = l_current_pi->comps;\n                for (compno = 0; compno < l_current_pi->numcomps; compno++){\n                    if(l_current_component->resolutions) {\n\t\t\t\t\t\topj_free(l_current_component->resolutions);\n\t\t\t\t\t\tl_current_component->resolutions = 00;\n\t\t\t\t\t}\n\n\t\t\t\t\t++l_current_component;\n\t\t\t\t}\n\t\t\t\topj_free(l_current_pi->comps);\n\t\t\t\tl_current_pi->comps = 0;\n\t\t\t}\n\t\t\t++l_current_pi;\n\t\t}\n\t\topj_free(p_pi);\n\t}\n}\n\n\n\nvoid opj_pi_update_encoding_parameters(\tconst opj_image_t *p_image,\n                                        opj_cp_t *p_cp,\n                                        OPJ_UINT32 p_tile_no )\n{\n\t/* encoding parameters to set */\n\tOPJ_UINT32 l_max_res;\n\tOPJ_UINT32 l_max_prec;\n\tOPJ_INT32 l_tx0,l_tx1,l_ty0,l_ty1;\n\tOPJ_UINT32 l_dx_min,l_dy_min;\n\n\t/* pointers */\n\topj_tcp_t *l_tcp = 00;\n\n\t/* preconditions */\n\tassert(p_cp != 00);\n\tassert(p_image != 00);\n\tassert(p_tile_no < p_cp->tw * p_cp->th);\n\n\tl_tcp = &(p_cp->tcps[p_tile_no]);\n\n\t/* get encoding parameters */\n\topj_get_encoding_parameters(p_image,p_cp,p_tile_no,&l_tx0,&l_tx1,&l_ty0,&l_ty1,&l_dx_min,&l_dy_min,&l_max_prec,&l_max_res);\n\n\tif (l_tcp->POC) {\n\t\topj_pi_update_encode_poc_and_final(p_cp,p_tile_no,l_tx0,l_tx1,l_ty0,l_ty1,l_max_prec,l_max_res,l_dx_min,l_dy_min);\n\t}\n\telse {\n\t\topj_pi_update_encode_not_poc(p_cp,p_image->numcomps,p_tile_no,l_tx0,l_tx1,l_ty0,l_ty1,l_max_prec,l_max_res,l_dx_min,l_dy_min);\n\t}\n}\n\nOPJ_BOOL opj_pi_next(opj_pi_iterator_t * pi) {\n\tswitch (pi->poc.prg) {\n\t\tcase OPJ_LRCP:\n\t\t\treturn opj_pi_next_lrcp(pi);\n\t\tcase OPJ_RLCP:\n\t\t\treturn opj_pi_next_rlcp(pi);\n\t\tcase OPJ_RPCL:\n\t\t\treturn opj_pi_next_rpcl(pi);\n\t\tcase OPJ_PCRL:\n\t\t\treturn opj_pi_next_pcrl(pi);\n\t\tcase OPJ_CPRL:\n\t\t\treturn opj_pi_next_cprl(pi);\n\t\tcase OPJ_PROG_UNKNOWN:\n\t\t\treturn OPJ_FALSE;\n\t}\n\t\n\treturn OPJ_FALSE;\n}\n"
  },
  {
    "path": "ext/openjpeg/pi.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef __PI_H\n#define __PI_H\n/**\n@file pi.h\n@brief Implementation of a packet iterator (PI)\n\nThe functions in PI.C have for goal to realize a packet iterator that permits to get the next\npacket following the progression order and change of it. The functions in PI.C are used\nby some function in T2.C.\n*/\n\n/** @defgroup PI PI - Implementation of a packet iterator */\n/*@{*/\n\n/**\nFIXME DOC\n*/\ntypedef struct opj_pi_resolution {\n  OPJ_UINT32 pdx, pdy;\n  OPJ_UINT32 pw, ph;\n} opj_pi_resolution_t;\n\n/**\nFIXME DOC\n*/\ntypedef struct opj_pi_comp {\n  OPJ_UINT32 dx, dy;\n  /** number of resolution levels */\n  OPJ_UINT32 numresolutions;\n  opj_pi_resolution_t *resolutions;\n} opj_pi_comp_t;\n\n/**\nPacket iterator\n*/\ntypedef struct opj_pi_iterator {\n  /** Enabling Tile part generation*/\n  OPJ_BYTE tp_on;\n  /** precise if the packet has been already used (usefull for progression order change) */\n  OPJ_INT16 *include;\n  /** layer step used to localize the packet in the include vector */\n  OPJ_UINT32 step_l;\n  /** resolution step used to localize the packet in the include vector */\n  OPJ_UINT32 step_r;\n  /** component step used to localize the packet in the include vector */\n  OPJ_UINT32 step_c;\n  /** precinct step used to localize the packet in the include vector */\n  OPJ_UINT32 step_p;\n  /** component that identify the packet */\n  OPJ_UINT32 compno;\n  /** resolution that identify the packet */\n  OPJ_UINT32 resno;\n  /** precinct that identify the packet */\n  OPJ_UINT32 precno;\n  /** layer that identify the packet */\n  OPJ_UINT32 layno;\n  /** 0 if the first packet */\n  OPJ_BOOL first;\n  /** progression order change information */\n  opj_poc_t poc;\n  /** number of components in the image */\n  OPJ_UINT32 numcomps;\n  /** Components*/\n  opj_pi_comp_t *comps;\n  /** FIXME DOC*/\n  OPJ_INT32 tx0, ty0, tx1, ty1;\n  /** FIXME DOC*/\n  OPJ_INT32 x, y;\n  /** FIXME DOC*/\n  OPJ_UINT32 dx, dy;\n} opj_pi_iterator_t;\n\n/** @name Exported functions */\n/*@{*/\n/* ----------------------------------------------------------------------- */\n/**\n * Creates a packet iterator for encoding.\n *\n * @param\timage\t\tthe image being encoded.\n * @param\tcp\t\tthe coding parameters.\n * @param\ttileno\tindex of the tile being encoded.\n * @param\tt2_mode\tthe type of pass for generating the packet iterator\n *\n * @return\ta list of packet iterator that points to the first packet of the tile (not true).\n*/\nopj_pi_iterator_t *opj_pi_initialise_encode(const opj_image_t *image,\n                                            opj_cp_t *cp,\n                                            OPJ_UINT32 tileno,\n                                            J2K_T2_MODE t2_mode);\n\n/**\n * Updates the encoding parameters of the codec.\n *\n * @param\tp_image\t\tthe image being encoded.\n * @param\tp_cp\t\tthe coding parameters.\n * @param\tp_tile_no\tindex of the tile being encoded.\n*/\nvoid opj_pi_update_encoding_parameters(\tconst opj_image_t *p_image,\n                                        opj_cp_t *p_cp,\n                                        OPJ_UINT32 p_tile_no );\n\n/**\nModify the packet iterator for enabling tile part generation\n@param pi Handle to the packet iterator generated in pi_initialise_encode\n@param cp Coding parameters\n@param tileno Number that identifies the tile for which to list the packets\n@param pino   FIXME DOC\n@param tpnum Tile part number of the current tile\n@param tppos The position of the tile part flag in the progression order\n@param t2_mode FIXME DOC\n*/\nvoid opj_pi_create_encode(  opj_pi_iterator_t *pi, \n                            opj_cp_t *cp,\n                            OPJ_UINT32 tileno, \n                            OPJ_UINT32 pino,\n                            OPJ_UINT32 tpnum, \n                            OPJ_INT32 tppos, \n                            J2K_T2_MODE t2_mode);\n\n/**\nCreate a packet iterator for Decoder\n@param image Raw image for which the packets will be listed\n@param cp Coding parameters\n@param tileno Number that identifies the tile for which to list the packets\n@return Returns a packet iterator that points to the first packet of the tile\n@see opj_pi_destroy\n*/\nopj_pi_iterator_t *opj_pi_create_decode(opj_image_t * image, \n                                        opj_cp_t * cp,\n                                        OPJ_UINT32 tileno);\n/**\n * Destroys a packet iterator array.\n *\n * @param\tp_pi\t\t\tthe packet iterator array to destroy.\n * @param\tp_nb_elements\tthe number of elements in the array.\n */\nvoid opj_pi_destroy(opj_pi_iterator_t *p_pi,\n                    OPJ_UINT32 p_nb_elements);\n\n/**\nModify the packet iterator to point to the next packet\n@param pi Packet iterator to modify\n@return Returns false if pi pointed to the last packet or else returns true\n*/\nOPJ_BOOL opj_pi_next(opj_pi_iterator_t * pi);\n/* ----------------------------------------------------------------------- */\n/*@}*/\n\n/*@}*/\n\n#endif /* __PI_H */\n"
  },
  {
    "path": "ext/openjpeg/ppix_manager.c",
    "content": "/*\n * $Id: ppix_manager.c 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2003-2004, Yannick Verschueren\n * Copyright (c) 2010-2011, Kaori Hagihara\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*! \\file\n *  \\brief Modification of jpip.c from 2KAN indexer\n */\n\n#include \"opj_includes.h\"\n\n/* \n * Write faix box of ppix\n *\n * @param[in] coff offset of j2k codestream\n * @param[in] compno    component number\n * @param[in] cstr_info codestream information\n * @param[in] EPHused   true if if EPH option used\n * @param[in] j2klen    length of j2k codestream\n * @param[in] cio       file output handle\n * @return              length of faix box\n */\n\n\nint opj_write_ppix( int coff, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio,\n              opj_event_mgr_t * p_manager )\n{\n  OPJ_BYTE l_data_header [4];\n  int compno, i;\n  opj_jp2_box_t *box;\n  OPJ_OFF_T lenp;\n  OPJ_UINT32 len;\n\n  /*  printf(\"cstr_info.packno %d\\n\", cstr_info.packno); //NMAX? */\n\n  lenp = -1;\n  box = (opj_jp2_box_t *)opj_calloc( (size_t)cstr_info.numcomps, sizeof(opj_jp2_box_t));\n  \n  for (i=0;i<2;i++){\n    if (i)\n\n      opj_stream_seek( cio, lenp, p_manager);\n    \n    lenp = (OPJ_UINT32)(opj_stream_tell(cio));\n    opj_stream_skip( cio, 4, p_manager);       /* L [at the end] */\n    opj_write_bytes(l_data_header,JPIP_PPIX,4);/* PPIX           */\n    opj_stream_write_data(cio,l_data_header,4,p_manager);\n\n    opj_write_manf( i, cstr_info.numcomps, box, cio, p_manager);\n    \n    for (compno=0; compno<cstr_info.numcomps; compno++){\n      box[compno].length = (OPJ_UINT32)opj_write_ppixfaix( coff, compno, cstr_info, EPHused, j2klen, cio,p_manager);\n      box[compno].type = JPIP_FAIX;\n    }\n   \n\n  len = (OPJ_UINT32)(opj_stream_tell(cio)-lenp);\n  opj_stream_seek(cio, lenp,p_manager);\n  opj_write_bytes(l_data_header,len,4);/* L              */\n  opj_stream_write_data(cio,l_data_header,4,p_manager);\n  opj_stream_seek(cio, lenp+len,p_manager);\n  }\n  \n  opj_free(box);\n\n  return (int)len;\n}\n\n\n\nint opj_write_ppixfaix( int coff, int compno, opj_codestream_info_t cstr_info, OPJ_BOOL EPHused, int j2klen, opj_stream_private_t *cio,\n              opj_event_mgr_t * p_manager )\n{\n  OPJ_BYTE l_data_header [8];\n  OPJ_UINT32 tileno, version, i, nmax, size_of_coding; /* 4 or 8*/\n  OPJ_UINT32 len;\n  OPJ_OFF_T lenp;\n  opj_tile_info_t *tile_Idx;\n  opj_packet_info_t packet;\n  int resno, precno, layno;\n  OPJ_UINT32 num_packet;\n  int numOfres, numOfprec, numOflayers;\n  packet.end_pos = packet.end_ph_pos = packet.start_pos = -1;\n  (void)EPHused; /* unused ? */\n\n  if( j2klen > pow( 2, 32)){\n    size_of_coding =  8;\n    version = 1;\n  }\n  else{\n    size_of_coding = 4;\n    version = 0;\n  }\n  \n  lenp = opj_stream_tell(cio);\n  opj_stream_skip(cio, 4, p_manager);         /* L [at the end]      */\n  opj_write_bytes(l_data_header,JPIP_FAIX,4); /* FAIX */\n  opj_write_bytes(l_data_header,version,1);\n  opj_stream_write_data(cio,l_data_header,1,p_manager);/* Version 0 = 4 bytes */\n\n  nmax = 0;\n  for( i=0; i<=(OPJ_UINT32)cstr_info.numdecompos[compno]; i++)\n    nmax += (OPJ_UINT32)(cstr_info.tile[0].ph[i] * cstr_info.tile[0].pw[i] * cstr_info.numlayers);\n  \n  opj_write_bytes(l_data_header,nmax,size_of_coding);         /* NMAX           */\n  opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);\n  opj_write_bytes(l_data_header,(OPJ_UINT32)(cstr_info.tw*cstr_info.th),size_of_coding);  /* M              */\n  opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);\n\n  for( tileno=0; tileno<(OPJ_UINT32)(cstr_info.tw*cstr_info.th); tileno++){\n    tile_Idx = &cstr_info.tile[ tileno];\n \n    num_packet=0;\n    numOfres = cstr_info.numdecompos[compno] + 1;\n  \n    for( resno=0; resno<numOfres ; resno++){\n      numOfprec = tile_Idx->pw[resno]*tile_Idx->ph[resno];\n      for( precno=0; precno<numOfprec; precno++){\n\tnumOflayers = cstr_info.numlayers;\n\tfor( layno=0; layno<numOflayers; layno++){\n\n\t  switch ( cstr_info.prog){\n\t  case OPJ_LRCP:\n\t    packet = tile_Idx->packet[ ((layno*numOfres+resno)*cstr_info.numcomps+compno)*numOfprec+precno];\n\t    break;\n\t  case OPJ_RLCP:\n\t    packet = tile_Idx->packet[ ((resno*numOflayers+layno)*cstr_info.numcomps+compno)*numOfprec+precno];\n\t    break;\n\t  case OPJ_RPCL:\n\t    packet = tile_Idx->packet[ ((resno*numOfprec+precno)*cstr_info.numcomps+compno)*numOflayers+layno];\n\t    break;\n\t  case OPJ_PCRL:\n\t    packet = tile_Idx->packet[ ((precno*cstr_info.numcomps+compno)*numOfres+resno)*numOflayers + layno];\n\t    break;\n\t  case OPJ_CPRL:\n\t    packet = tile_Idx->packet[ ((compno*numOfprec+precno)*numOfres+resno)*numOflayers + layno];\n\t    break;\n\t  default:\n\t    fprintf( stderr, \"failed to ppix indexing\\n\");\n\t  }\n\n    opj_write_bytes(l_data_header,(OPJ_UINT32)(packet.start_pos-coff),size_of_coding);            /* start position */\n    opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);\n    opj_write_bytes(l_data_header,(OPJ_UINT32)(packet.end_pos-packet.start_pos+1),size_of_coding); /* length         */\n    opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);\n\t  \n\t  num_packet++;\n\t}\n      }\n    }\n  \n    while( num_packet < nmax){     /* PADDING */\n      opj_write_bytes(l_data_header,0,size_of_coding);/* start position            */\n      opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);\n      opj_write_bytes(l_data_header,0,size_of_coding);/* length                    */\n      opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);\n      num_packet++;\n    }   \n  }\n\n  len = (OPJ_UINT32)(opj_stream_tell(cio)-lenp);\n  opj_stream_seek(cio, lenp,p_manager);\n  opj_write_bytes(l_data_header,len,4);/* L  */\n  opj_stream_write_data(cio,l_data_header,4,p_manager);\n  opj_stream_seek(cio, lenp+len,p_manager);\n\n  return (int)len;\n}\n"
  },
  {
    "path": "ext/openjpeg/raw.c",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include \"opj_includes.h\"\n\n/* \n==========================================================\n   local functions\n==========================================================\n*/\n\n\n/* \n==========================================================\n   RAW encoding interface\n==========================================================\n*/\n\nopj_raw_t* opj_raw_create(void) {\n\topj_raw_t *raw = (opj_raw_t*)opj_malloc(sizeof(opj_raw_t));\n\treturn raw;\n}\n\nvoid opj_raw_destroy(opj_raw_t *raw) {\n\tif(raw) {\n\t\topj_free(raw);\n\t}\n}\n\nOPJ_UINT32 opj_raw_numbytes(opj_raw_t *raw) {\n\tconst ptrdiff_t diff = raw->bp - raw->start;\n  assert( diff <= (ptrdiff_t)0xffffffff && diff >= 0 ); /* UINT32_MAX */\n\treturn (OPJ_UINT32)diff;\n}\n\nvoid opj_raw_init_dec(opj_raw_t *raw, OPJ_BYTE *bp, OPJ_UINT32 len) {\n\traw->start = bp;\n\traw->lenmax = len;\n\traw->len = 0;\n\traw->c = 0;\n\traw->ct = 0;\n}\n\nOPJ_UINT32 opj_raw_decode(opj_raw_t *raw) {\n\tOPJ_UINT32 d;\n\tif (raw->ct == 0) {\n\t\traw->ct = 8;\n\t\tif (raw->len == raw->lenmax) {\n\t\t\traw->c = 0xff;\n\t\t} else {\n\t\t\tif (raw->c == 0xff) {\n\t\t\t\traw->ct = 7;\n\t\t\t}\n\t\t\traw->c = *(raw->start + raw->len);\n\t\t\traw->len++;\n\t\t}\n\t}\n\traw->ct--;\n\td = (raw->c >> raw->ct) & 0x01;\n\t\n\treturn d;\n}\n\n"
  },
  {
    "path": "ext/openjpeg/raw.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef __RAW_H\n#define __RAW_H\n/**\n@file raw.h\n@brief Implementation of operations for raw encoding (RAW)\n\nThe functions in RAW.C have for goal to realize the operation of raw encoding linked\nwith the corresponding mode switch.\n*/\n\n/** @defgroup RAW RAW - Implementation of operations for raw encoding */\n/*@{*/\n\n/**\nRAW encoding operations\n*/\ntypedef struct opj_raw {\n\t/** temporary buffer where bits are coded or decoded */\n\tOPJ_BYTE c;\n\t/** number of bits already read or free to write */\n\tOPJ_UINT32 ct;\n\t/** maximum length to decode */\n\tOPJ_UINT32 lenmax;\n\t/** length decoded */\n\tOPJ_UINT32 len;\n\t/** pointer to the current position in the buffer */\n\tOPJ_BYTE *bp;\n\t/** pointer to the start of the buffer */\n\tOPJ_BYTE *start;\n\t/** pointer to the end of the buffer */\n\tOPJ_BYTE *end;\n} opj_raw_t;\n\n/** @name Exported functions */\n/*@{*/\n/* ----------------------------------------------------------------------- */\n/**\nCreate a new RAW handle \n@return Returns a new RAW handle if successful, returns NULL otherwise\n*/\nopj_raw_t* opj_raw_create(void);\n/**\nDestroy a previously created RAW handle\n@param raw RAW handle to destroy\n*/\nvoid opj_raw_destroy(opj_raw_t *raw);\n/**\nReturn the number of bytes written/read since initialisation\n@param raw RAW handle to destroy\n@return Returns the number of bytes already encoded\n*/\nOPJ_UINT32 opj_raw_numbytes(opj_raw_t *raw);\n/**\nInitialize the decoder\n@param raw RAW handle\n@param bp Pointer to the start of the buffer from which the bytes will be read\n@param len Length of the input buffer\n*/\nvoid opj_raw_init_dec(opj_raw_t *raw, OPJ_BYTE *bp, OPJ_UINT32 len);\n/**\nDecode a symbol using raw-decoder. Cfr p.506 TAUBMAN\n@param raw RAW handle\n@return Returns the decoded symbol (0 or 1)\n*/\nOPJ_UINT32 opj_raw_decode(opj_raw_t *raw);\n/* ----------------------------------------------------------------------- */\n/*@}*/\n\n/*@}*/\n\n#endif /* __RAW_H */\n"
  },
  {
    "path": "ext/openjpeg/t1.c",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2007, Callum Lerwick <seg@haxxed.com>\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include \"opj_includes.h\"\n#include \"t1_luts.h\"\n\n/** @defgroup T1 T1 - Implementation of the tier-1 coding */\n/*@{*/\n\n/** @name Local static functions */\n/*@{*/\n\nstatic INLINE OPJ_BYTE opj_t1_getctxno_zc(OPJ_UINT32 f, OPJ_UINT32 orient);\nstatic OPJ_BYTE opj_t1_getctxno_sc(OPJ_UINT32 f);\nstatic INLINE OPJ_UINT32 opj_t1_getctxno_mag(OPJ_UINT32 f);\nstatic OPJ_BYTE opj_t1_getspb(OPJ_UINT32 f);\nstatic OPJ_INT16 opj_t1_getnmsedec_sig(OPJ_UINT32 x, OPJ_UINT32 bitpos);\nstatic OPJ_INT16 opj_t1_getnmsedec_ref(OPJ_UINT32 x, OPJ_UINT32 bitpos);\nstatic void opj_t1_updateflags(opj_flag_t *flagsp, OPJ_UINT32 s, OPJ_UINT32 stride);\n/**\nEncode significant pass\n*/\nstatic void opj_t1_enc_sigpass_step(opj_t1_t *t1,\n                                    opj_flag_t *flagsp,\n                                    OPJ_INT32 *datap,\n                                    OPJ_UINT32 orient,\n                                    OPJ_INT32 bpno,\n                                    OPJ_INT32 one,\n                                    OPJ_INT32 *nmsedec,\n                                    OPJ_BYTE type,\n                                    OPJ_UINT32 vsc);\n\n/**\nDecode significant pass\n*/\n#if 0\nstatic void opj_t1_dec_sigpass_step(opj_t1_t *t1,\n                                    opj_flag_t *flagsp,\n                                    OPJ_INT32 *datap,\n                                    OPJ_UINT32 orient,\n                                    OPJ_INT32 oneplushalf,\n                                    OPJ_BYTE type,\n                                    OPJ_UINT32 vsc);\n#endif\n\nstatic INLINE void opj_t1_dec_sigpass_step_raw(\n                opj_t1_t *t1,\n                opj_flag_t *flagsp,\n                OPJ_INT32 *datap,\n                OPJ_INT32 orient,\n                OPJ_INT32 oneplushalf,\n                OPJ_INT32 vsc);\nstatic INLINE void opj_t1_dec_sigpass_step_mqc(\n                opj_t1_t *t1,\n                opj_flag_t *flagsp,\n                OPJ_INT32 *datap,\n                OPJ_INT32 orient,\n                OPJ_INT32 oneplushalf);\nstatic INLINE void opj_t1_dec_sigpass_step_mqc_vsc(\n                opj_t1_t *t1,\n                opj_flag_t *flagsp,\n                OPJ_INT32 *datap,\n                OPJ_INT32 orient,\n                OPJ_INT32 oneplushalf,\n                OPJ_INT32 vsc);\n\n\n/**\nEncode significant pass\n*/\nstatic void opj_t1_enc_sigpass( opj_t1_t *t1,\n                                OPJ_INT32 bpno,\n                                OPJ_UINT32 orient,\n                                OPJ_INT32 *nmsedec,\n                                OPJ_BYTE type,\n                                OPJ_UINT32 cblksty);\n\n/**\nDecode significant pass\n*/\nstatic void opj_t1_dec_sigpass_raw(\n                opj_t1_t *t1,\n                OPJ_INT32 bpno,\n                OPJ_INT32 orient,\n                OPJ_INT32 cblksty);\nstatic void opj_t1_dec_sigpass_mqc(\n                opj_t1_t *t1,\n                OPJ_INT32 bpno,\n                OPJ_INT32 orient);\nstatic void opj_t1_dec_sigpass_mqc_vsc(\n                opj_t1_t *t1,\n                OPJ_INT32 bpno,\n                OPJ_INT32 orient);\n\n\n\n/**\nEncode refinement pass\n*/\nstatic void opj_t1_enc_refpass_step(opj_t1_t *t1,\n                                    opj_flag_t *flagsp,\n                                    OPJ_INT32 *datap,\n                                    OPJ_INT32 bpno,\n                                    OPJ_INT32 one,\n                                    OPJ_INT32 *nmsedec,\n                                    OPJ_BYTE type,\n                                    OPJ_UINT32 vsc);\n\n\n/**\nEncode refinement pass\n*/\nstatic void opj_t1_enc_refpass( opj_t1_t *t1,\n                                OPJ_INT32 bpno,\n                                OPJ_INT32 *nmsedec,\n                                OPJ_BYTE type,\n                                OPJ_UINT32 cblksty);\n\n/**\nDecode refinement pass\n*/\nstatic void opj_t1_dec_refpass_raw(\n                opj_t1_t *t1,\n                OPJ_INT32 bpno,\n                OPJ_INT32 cblksty);\nstatic void opj_t1_dec_refpass_mqc(\n                opj_t1_t *t1,\n                OPJ_INT32 bpno);\nstatic void opj_t1_dec_refpass_mqc_vsc(\n                opj_t1_t *t1,\n                OPJ_INT32 bpno);\n\n\n/**\nDecode refinement pass\n*/\n#if 0\nstatic void opj_t1_dec_refpass_step(opj_t1_t *t1,\n                                    opj_flag_t *flagsp,\n                                    OPJ_INT32 *datap,\n                                    OPJ_INT32 poshalf,\n                                    OPJ_INT32 neghalf,\n                                    OPJ_BYTE type,\n                                    OPJ_UINT32 vsc);\n#endif\n\nstatic INLINE void  opj_t1_dec_refpass_step_raw(\n                opj_t1_t *t1,\n                opj_flag_t *flagsp,\n                OPJ_INT32 *datap,\n                OPJ_INT32 poshalf,\n                OPJ_INT32 neghalf,\n                OPJ_INT32 vsc);\nstatic INLINE void opj_t1_dec_refpass_step_mqc(\n                opj_t1_t *t1,\n                opj_flag_t *flagsp,\n                OPJ_INT32 *datap,\n                OPJ_INT32 poshalf,\n                OPJ_INT32 neghalf);\nstatic INLINE void opj_t1_dec_refpass_step_mqc_vsc(\n                opj_t1_t *t1,\n                opj_flag_t *flagsp,\n                OPJ_INT32 *datap,\n                OPJ_INT32 poshalf,\n                OPJ_INT32 neghalf,\n                OPJ_INT32 vsc);\n\n\n\n/**\nEncode clean-up pass\n*/\nstatic void opj_t1_enc_clnpass_step(\n\t\topj_t1_t *t1,\n\t\topj_flag_t *flagsp,\n\t\tOPJ_INT32 *datap,\n\t\tOPJ_UINT32 orient,\n\t\tOPJ_INT32 bpno,\n\t\tOPJ_INT32 one,\n\t\tOPJ_INT32 *nmsedec,\n\t\tOPJ_UINT32 partial,\n\t\tOPJ_UINT32 vsc);\n/**\nDecode clean-up pass\n*/\nstatic void opj_t1_dec_clnpass_step_partial(\n\t\topj_t1_t *t1,\n\t\topj_flag_t *flagsp,\n\t\tOPJ_INT32 *datap,\n\t\tOPJ_INT32 orient,\n\t\tOPJ_INT32 oneplushalf);\nstatic void opj_t1_dec_clnpass_step(\n\t\topj_t1_t *t1,\n\t\topj_flag_t *flagsp,\n\t\tOPJ_INT32 *datap,\n\t\tOPJ_INT32 orient,\n\t\tOPJ_INT32 oneplushalf);\nstatic void opj_t1_dec_clnpass_step_vsc(\n\t\topj_t1_t *t1,\n\t\topj_flag_t *flagsp,\n\t\tOPJ_INT32 *datap,\n\t\tOPJ_INT32 orient,\n\t\tOPJ_INT32 oneplushalf,\n\t\tOPJ_INT32 partial,\n\t\tOPJ_INT32 vsc);\n/**\nEncode clean-up pass\n*/\nstatic void opj_t1_enc_clnpass(\n\t\topj_t1_t *t1,\n\t\tOPJ_INT32 bpno,\n\t\tOPJ_UINT32 orient,\n\t\tOPJ_INT32 *nmsedec,\n\t\tOPJ_UINT32 cblksty);\n/**\nDecode clean-up pass\n*/\nstatic void opj_t1_dec_clnpass(\n\t\topj_t1_t *t1,\n\t\tOPJ_INT32 bpno,\n\t\tOPJ_INT32 orient,\n\t\tOPJ_INT32 cblksty);\n\nstatic OPJ_FLOAT64 opj_t1_getwmsedec(\n\t\tOPJ_INT32 nmsedec,\n\t\tOPJ_UINT32 compno,\n\t\tOPJ_UINT32 level,\n\t\tOPJ_UINT32 orient,\n\t\tOPJ_INT32 bpno,\n\t\tOPJ_UINT32 qmfbid,\n\t\tOPJ_FLOAT64 stepsize,\n\t\tOPJ_UINT32 numcomps,\n\t\tconst OPJ_FLOAT64 * mct_norms);\n\nstatic void opj_t1_encode_cblk( opj_t1_t *t1,\n                                opj_tcd_cblk_enc_t* cblk,\n                                OPJ_UINT32 orient,\n                                OPJ_UINT32 compno,\n                                OPJ_UINT32 level,\n                                OPJ_UINT32 qmfbid,\n                                OPJ_FLOAT64 stepsize,\n                                OPJ_UINT32 cblksty,\n                                OPJ_UINT32 numcomps,\n                                opj_tcd_tile_t * tile,\n                                const OPJ_FLOAT64 * mct_norms);\n\n/**\nDecode 1 code-block\n@param t1 T1 handle\n@param cblk Code-block coding parameters\n@param orient\n@param roishift Region of interest shifting value\n@param cblksty Code-block style\n*/\nstatic OPJ_BOOL opj_t1_decode_cblk( opj_t1_t *t1,\n                                    opj_tcd_cblk_dec_t* cblk,\n                                    OPJ_UINT32 orient,\n                                    OPJ_UINT32 roishift,\n                                    OPJ_UINT32 cblksty);\n\nOPJ_BOOL opj_t1_allocate_buffers(   opj_t1_t *t1,\n                                    OPJ_UINT32 w,\n                                    OPJ_UINT32 h);\n\n/*@}*/\n\n/*@}*/\n\n/* ----------------------------------------------------------------------- */\n\nOPJ_BYTE opj_t1_getctxno_zc(OPJ_UINT32 f, OPJ_UINT32 orient) {\n\treturn lut_ctxno_zc[(orient << 8) | (f & T1_SIG_OTH)];\n}\n\nOPJ_BYTE opj_t1_getctxno_sc(OPJ_UINT32 f) {\n\treturn lut_ctxno_sc[(f & (T1_SIG_PRIM | T1_SGN)) >> 4];\n}\n\nOPJ_UINT32 opj_t1_getctxno_mag(OPJ_UINT32 f) {\n\tOPJ_UINT32 tmp1 = (f & T1_SIG_OTH) ? T1_CTXNO_MAG + 1 : T1_CTXNO_MAG;\n\tOPJ_UINT32 tmp2 = (f & T1_REFINE) ? T1_CTXNO_MAG + 2 : tmp1;\n\treturn (tmp2);\n}\n\nOPJ_BYTE opj_t1_getspb(OPJ_UINT32 f) {\n\treturn lut_spb[(f & (T1_SIG_PRIM | T1_SGN)) >> 4];\n}\n\nOPJ_INT16 opj_t1_getnmsedec_sig(OPJ_UINT32 x, OPJ_UINT32 bitpos) {\n\tif (bitpos > T1_NMSEDEC_FRACBITS) {\n\t\treturn lut_nmsedec_sig[(x >> (bitpos - T1_NMSEDEC_FRACBITS)) & ((1 << T1_NMSEDEC_BITS) - 1)];\n\t}\n\t\n\treturn lut_nmsedec_sig0[x & ((1 << T1_NMSEDEC_BITS) - 1)];\n}\n\nOPJ_INT16 opj_t1_getnmsedec_ref(OPJ_UINT32 x, OPJ_UINT32 bitpos) {\n\tif (bitpos > T1_NMSEDEC_FRACBITS) {\n\t\treturn lut_nmsedec_ref[(x >> (bitpos - T1_NMSEDEC_FRACBITS)) & ((1 << T1_NMSEDEC_BITS) - 1)];\n\t}\n\n    return lut_nmsedec_ref0[x & ((1 << T1_NMSEDEC_BITS) - 1)];\n}\n\nvoid opj_t1_updateflags(opj_flag_t *flagsp, OPJ_UINT32 s, OPJ_UINT32 stride) {\n\topj_flag_t *np = flagsp - stride;\n\topj_flag_t *sp = flagsp + stride;\n\n\tstatic const opj_flag_t mod[] = {\n\t\tT1_SIG_S, T1_SIG_S|T1_SGN_S,\n\t\tT1_SIG_E, T1_SIG_E|T1_SGN_E,\n\t\tT1_SIG_W, T1_SIG_W|T1_SGN_W,\n\t\tT1_SIG_N, T1_SIG_N|T1_SGN_N\n\t};\n\n\tnp[-1] |= T1_SIG_SE;\n\tnp[0]  |= mod[s];\n\tnp[1]  |= T1_SIG_SW;\n\n\tflagsp[-1] |= mod[s+2];\n\tflagsp[0]  |= T1_SIG;\n\tflagsp[1]  |= mod[s+4];\n\n\tsp[-1] |= T1_SIG_NE;\n\tsp[0]  |= mod[s+6];\n\tsp[1]  |= T1_SIG_NW;\n}\n\nvoid opj_t1_enc_sigpass_step(   opj_t1_t *t1,\n                                opj_flag_t *flagsp,\n                                OPJ_INT32 *datap,\n                                OPJ_UINT32 orient,\n                                OPJ_INT32 bpno,\n                                OPJ_INT32 one,\n                                OPJ_INT32 *nmsedec,\n                                OPJ_BYTE type,\n                                OPJ_UINT32 vsc\n                                )\n{\n\tOPJ_INT32 v;\n    OPJ_UINT32 flag;\n\t\n\topj_mqc_t *mqc = t1->mqc;\t/* MQC component */\n\t\n\tflag = vsc ? (OPJ_UINT32)((*flagsp) & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) : (OPJ_UINT32)(*flagsp);\n\tif ((flag & T1_SIG_OTH) && !(flag & (T1_SIG | T1_VISIT))) {\n\t\tv = opj_int_abs(*datap) & one ? 1 : 0;\n\t\topj_mqc_setcurctx(mqc, opj_t1_getctxno_zc(flag, orient));\t/* ESSAI */\n\t\tif (type == T1_TYPE_RAW) {\t/* BYPASS/LAZY MODE */\n\t\t\topj_mqc_bypass_enc(mqc, (OPJ_UINT32)v);\n\t\t} else {\n\t\t\topj_mqc_encode(mqc, (OPJ_UINT32)v);\n\t\t}\n\t\tif (v) {\n\t\t\tv = *datap < 0 ? 1 : 0;\n\t\t\t*nmsedec +=\topj_t1_getnmsedec_sig((OPJ_UINT32)opj_int_abs(*datap), (OPJ_UINT32)(bpno + T1_NMSEDEC_FRACBITS));\n\t\t\topj_mqc_setcurctx(mqc, opj_t1_getctxno_sc(flag));\t/* ESSAI */\n\t\t\tif (type == T1_TYPE_RAW) {\t/* BYPASS/LAZY MODE */\n\t\t\t\topj_mqc_bypass_enc(mqc, (OPJ_UINT32)v);\n\t\t\t} else {\n\t\t\t\topj_mqc_encode(mqc, (OPJ_UINT32)(v ^ opj_t1_getspb((OPJ_UINT32)flag)));\n\t\t\t}\n\t\t\topj_t1_updateflags(flagsp, (OPJ_UINT32)v, t1->flags_stride);\n\t\t}\n\t\t*flagsp |= T1_VISIT;\n\t}\n}\n\n\nstatic INLINE void opj_t1_dec_sigpass_step_raw(\n                opj_t1_t *t1,\n                opj_flag_t *flagsp,\n                OPJ_INT32 *datap,\n                OPJ_INT32 orient,\n                OPJ_INT32 oneplushalf,\n                OPJ_INT32 vsc)\n{\n        OPJ_INT32 v, flag;\n        opj_raw_t *raw = t1->raw;       /* RAW component */\n        OPJ_ARG_NOT_USED(orient);\n       \n        flag = vsc ? ((*flagsp) & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) : (*flagsp);\n        if ((flag & T1_SIG_OTH) && !(flag & (T1_SIG | T1_VISIT))) {\n                        if (opj_raw_decode(raw)) {\n                                v = (OPJ_INT32)opj_raw_decode(raw);    /* ESSAI */\n                                *datap = v ? -oneplushalf : oneplushalf;\n                                opj_t1_updateflags(flagsp, (OPJ_UINT32)v, t1->flags_stride);\n                        }\n                *flagsp |= T1_VISIT;\n        }\n}      \n\nINLINE void opj_t1_dec_sigpass_step_mqc(\n                opj_t1_t *t1,\n                opj_flag_t *flagsp,\n                OPJ_INT32 *datap,\n                OPJ_INT32 orient,\n                OPJ_INT32 oneplushalf)\n{\n        OPJ_INT32 v, flag;\n       \n        opj_mqc_t *mqc = t1->mqc;       /* MQC component */\n       \n        flag = *flagsp;\n        if ((flag & T1_SIG_OTH) && !(flag & (T1_SIG | T1_VISIT))) {\n                        opj_mqc_setcurctx(mqc, opj_t1_getctxno_zc((OPJ_UINT32)flag, (OPJ_UINT32)orient));\n                        if (opj_mqc_decode(mqc)) {\n                                opj_mqc_setcurctx(mqc, opj_t1_getctxno_sc((OPJ_UINT32)flag));\n                                v = opj_mqc_decode(mqc) ^ opj_t1_getspb((OPJ_UINT32)flag);\n                                *datap = v ? -oneplushalf : oneplushalf;\n                                opj_t1_updateflags(flagsp, (OPJ_UINT32)v, t1->flags_stride);\n                        }\n                *flagsp |= T1_VISIT;\n        }\n}                               /* VSC and  BYPASS by Antonin */\n\nINLINE void opj_t1_dec_sigpass_step_mqc_vsc(\n                opj_t1_t *t1,\n                opj_flag_t *flagsp,\n                OPJ_INT32 *datap,\n                OPJ_INT32 orient,\n                OPJ_INT32 oneplushalf,\n                OPJ_INT32 vsc)\n{\n        OPJ_INT32 v, flag;\n       \n        opj_mqc_t *mqc = t1->mqc;       /* MQC component */\n       \n        flag = vsc ? ((*flagsp) & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) : (*flagsp);\n        if ((flag & T1_SIG_OTH) && !(flag & (T1_SIG | T1_VISIT))) {\n                opj_mqc_setcurctx(mqc, opj_t1_getctxno_zc((OPJ_UINT32)flag, (OPJ_UINT32)orient));\n                if (opj_mqc_decode(mqc)) {\n                        opj_mqc_setcurctx(mqc, opj_t1_getctxno_sc((OPJ_UINT32)flag));\n                        v = opj_mqc_decode(mqc) ^ opj_t1_getspb((OPJ_UINT32)flag);\n                        *datap = v ? -oneplushalf : oneplushalf;\n                        opj_t1_updateflags(flagsp, (OPJ_UINT32)v, t1->flags_stride);\n                }\n                *flagsp |= T1_VISIT;\n        }\n}                               /* VSC and  BYPASS by Antonin */\n\n\n\nvoid opj_t1_enc_sigpass(opj_t1_t *t1,\n                        OPJ_INT32 bpno,\n                        OPJ_UINT32 orient,\n                        OPJ_INT32 *nmsedec,\n                        OPJ_BYTE type,\n                        OPJ_UINT32 cblksty\n                        )\n{\n\tOPJ_UINT32 i, j, k, vsc; \n    OPJ_INT32 one;\n\n\t*nmsedec = 0;\n\tone = 1 << (bpno + T1_NMSEDEC_FRACBITS);\n\tfor (k = 0; k < t1->h; k += 4) {\n\t\tfor (i = 0; i < t1->w; ++i) {\n\t\t\tfor (j = k; j < k + 4 && j < t1->h; ++j) {\n\t\t\t\tvsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;\n\t\t\t\topj_t1_enc_sigpass_step(\n\t\t\t\t\t\tt1,\n\t\t\t\t\t\t&t1->flags[((j+1) * t1->flags_stride) + i + 1],\n\t\t\t\t\t\t&t1->data[(j * t1->w) + i],\n\t\t\t\t\t\torient,\n\t\t\t\t\t\tbpno,\n\t\t\t\t\t\tone,\n\t\t\t\t\t\tnmsedec,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\tvsc);\n\t\t\t}\n\t\t}\n\t}\n}\n\nvoid opj_t1_dec_sigpass_raw(\n                opj_t1_t *t1,\n                OPJ_INT32 bpno,\n                OPJ_INT32 orient,\n                OPJ_INT32 cblksty)\n{\n        OPJ_INT32 one, half, oneplushalf, vsc;\n        OPJ_UINT32 i, j, k; \n        one = 1 << bpno;\n        half = one >> 1;\n        oneplushalf = one | half;\n        for (k = 0; k < t1->h; k += 4) {\n                for (i = 0; i < t1->w; ++i) {\n                        for (j = k; j < k + 4 && j < t1->h; ++j) {\n                                vsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;\n                                opj_t1_dec_sigpass_step_raw(\n                                                t1,\n                                                &t1->flags[((j+1) * t1->flags_stride) + i + 1],\n                                                &t1->data[(j * t1->w) + i],\n                                                orient,\n                                                oneplushalf,\n                                                vsc);\n                        }\n                }\n        }\n}                               /* VSC and  BYPASS by Antonin */\n\nvoid opj_t1_dec_sigpass_mqc(\n                opj_t1_t *t1,\n                OPJ_INT32 bpno,\n                OPJ_INT32 orient)\n{\n        OPJ_INT32 one, half, oneplushalf;\n        OPJ_UINT32 i, j, k;\n        OPJ_INT32 *data1 = t1->data;\n        opj_flag_t *flags1 = &t1->flags[1];\n        one = 1 << bpno;\n        half = one >> 1;\n        oneplushalf = one | half;\n        for (k = 0; k < (t1->h & ~3u); k += 4) {\n                for (i = 0; i < t1->w; ++i) {\n                        OPJ_INT32 *data2 = data1 + i;\n                        opj_flag_t *flags2 = flags1 + i;\n                        flags2 += t1->flags_stride;\n                        opj_t1_dec_sigpass_step_mqc(t1, flags2, data2, orient, oneplushalf);\n                        data2 += t1->w;\n                        flags2 += t1->flags_stride;\n                        opj_t1_dec_sigpass_step_mqc(t1, flags2, data2, orient, oneplushalf);\n                        data2 += t1->w;\n                        flags2 += t1->flags_stride;\n                        opj_t1_dec_sigpass_step_mqc(t1, flags2, data2, orient, oneplushalf);\n                        data2 += t1->w;\n                        flags2 += t1->flags_stride;\n                        opj_t1_dec_sigpass_step_mqc(t1, flags2, data2, orient, oneplushalf);\n                        data2 += t1->w;\n                }\n                data1 += t1->w << 2;\n                flags1 += t1->flags_stride << 2;\n        }\n        for (i = 0; i < t1->w; ++i) {\n                OPJ_INT32 *data2 = data1 + i;\n                opj_flag_t *flags2 = flags1 + i;\n                for (j = k; j < t1->h; ++j) {\n                        flags2 += t1->flags_stride;\n                        opj_t1_dec_sigpass_step_mqc(t1, flags2, data2, orient, oneplushalf);\n                        data2 += t1->w;\n                }\n        }\n}                               /* VSC and  BYPASS by Antonin */\n\nvoid opj_t1_dec_sigpass_mqc_vsc(\n                opj_t1_t *t1,\n                OPJ_INT32 bpno,\n                OPJ_INT32 orient)\n{\n        OPJ_INT32 one, half, oneplushalf, vsc;\n        OPJ_UINT32 i, j, k;\n        one = 1 << bpno;\n        half = one >> 1;\n        oneplushalf = one | half;\n        for (k = 0; k < t1->h; k += 4) {\n                for (i = 0; i < t1->w; ++i) {\n                        for (j = k; j < k + 4 && j < t1->h; ++j) {\n                                vsc = (j == k + 3 || j == t1->h - 1) ? 1 : 0;\n                                opj_t1_dec_sigpass_step_mqc_vsc(\n                                                t1,\n                                                &t1->flags[((j+1) * t1->flags_stride) + i + 1],\n                                                &t1->data[(j * t1->w) + i],\n                                                orient,\n                                                oneplushalf,\n                                                vsc);\n                        }\n                }\n        }\n}                               /* VSC and  BYPASS by Antonin */\n\n\n\nvoid opj_t1_enc_refpass_step(   opj_t1_t *t1,\n                                opj_flag_t *flagsp,\n                                OPJ_INT32 *datap,\n                                OPJ_INT32 bpno,\n                                OPJ_INT32 one,\n                                OPJ_INT32 *nmsedec,\n                                OPJ_BYTE type,\n                                OPJ_UINT32 vsc)\n{\n\tOPJ_INT32 v;\n\tOPJ_UINT32 flag;\n\t\n\topj_mqc_t *mqc = t1->mqc;\t/* MQC component */\n\t\n\tflag = vsc ? (OPJ_UINT32)((*flagsp) & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) : (OPJ_UINT32)(*flagsp);\n\tif ((flag & (T1_SIG | T1_VISIT)) == T1_SIG) {\n\t\t*nmsedec += opj_t1_getnmsedec_ref((OPJ_UINT32)opj_int_abs(*datap), (OPJ_UINT32)(bpno + T1_NMSEDEC_FRACBITS));\n\t\tv = opj_int_abs(*datap) & one ? 1 : 0;\n\t\topj_mqc_setcurctx(mqc, opj_t1_getctxno_mag(flag));\t/* ESSAI */\n\t\tif (type == T1_TYPE_RAW) {\t/* BYPASS/LAZY MODE */\n\t\t\topj_mqc_bypass_enc(mqc, (OPJ_UINT32)v);\n\t\t} else {\n\t\t\topj_mqc_encode(mqc, (OPJ_UINT32)v);\n\t\t}\n\t\t*flagsp |= T1_REFINE;\n\t}\n}\n\nINLINE void opj_t1_dec_refpass_step_raw(\n                opj_t1_t *t1,\n                opj_flag_t *flagsp,\n                OPJ_INT32 *datap,\n                OPJ_INT32 poshalf,\n                OPJ_INT32 neghalf,\n                OPJ_INT32 vsc)\n{\n        OPJ_INT32 v, t, flag;\n       \n        opj_raw_t *raw = t1->raw;       /* RAW component */\n       \n        flag = vsc ? ((*flagsp) & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) : (*flagsp);\n        if ((flag & (T1_SIG | T1_VISIT)) == T1_SIG) {\n                        v = (OPJ_INT32)opj_raw_decode(raw);\n                t = v ? poshalf : neghalf;\n                *datap += *datap < 0 ? -t : t;\n                *flagsp |= T1_REFINE;\n        }\n}                               /* VSC and  BYPASS by Antonin  */\n\nINLINE void opj_t1_dec_refpass_step_mqc(\n                opj_t1_t *t1,\n                opj_flag_t *flagsp,\n                OPJ_INT32 *datap,\n                OPJ_INT32 poshalf,\n                OPJ_INT32 neghalf)\n{\n        OPJ_INT32 v, t, flag;\n       \n        opj_mqc_t *mqc = t1->mqc;       /* MQC component */\n       \n        flag = *flagsp;\n        if ((flag & (T1_SIG | T1_VISIT)) == T1_SIG) {\n                opj_mqc_setcurctx(mqc, opj_t1_getctxno_mag((OPJ_UINT32)flag));      /* ESSAI */\n                        v = opj_mqc_decode(mqc);\n                t = v ? poshalf : neghalf;\n                *datap += *datap < 0 ? -t : t;\n                *flagsp |= T1_REFINE;\n                }\n}                               /* VSC and  BYPASS by Antonin  */\n\nINLINE void opj_t1_dec_refpass_step_mqc_vsc(\n                opj_t1_t *t1,\n                opj_flag_t *flagsp,\n                OPJ_INT32 *datap,\n                OPJ_INT32 poshalf,\n                OPJ_INT32 neghalf,\n                OPJ_INT32 vsc)\n{\n        OPJ_INT32 v, t, flag;\n       \n        opj_mqc_t *mqc = t1->mqc;       /* MQC component */\n       \n        flag = vsc ? ((*flagsp) & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) : (*flagsp);\n        if ((flag & (T1_SIG | T1_VISIT)) == T1_SIG) {\n                opj_mqc_setcurctx(mqc, opj_t1_getctxno_mag((OPJ_UINT32)flag));      /* ESSAI */\n                v = opj_mqc_decode(mqc);\n                t = v ? poshalf : neghalf;\n                *datap += *datap < 0 ? -t : t;\n                *flagsp |= T1_REFINE;\n        }\n}                               /* VSC and  BYPASS by Antonin  */\n\n\nvoid opj_t1_enc_refpass(\n\t\topj_t1_t *t1,\n\t\tOPJ_INT32 bpno,\n\t\tOPJ_INT32 *nmsedec,\n\t\tOPJ_BYTE type,\n\t\tOPJ_UINT32 cblksty)\n{\n\tOPJ_UINT32 i, j, k, vsc;\n    OPJ_INT32 one;\n\n\t*nmsedec = 0;\n\tone = 1 << (bpno + T1_NMSEDEC_FRACBITS);\n\tfor (k = 0; k < t1->h; k += 4) {\n\t\tfor (i = 0; i < t1->w; ++i) {\n\t\t\tfor (j = k; j < k + 4 && j < t1->h; ++j) {\n\t\t\t\tvsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;\n\t\t\t\topj_t1_enc_refpass_step(\n\t\t\t\t\t\tt1,\n\t\t\t\t\t\t&t1->flags[((j+1) * t1->flags_stride) + i + 1],\n\t\t\t\t\t\t&t1->data[(j * t1->w) + i],\n\t\t\t\t\t\tbpno,\n\t\t\t\t\t\tone,\n\t\t\t\t\t\tnmsedec,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\tvsc);\n\t\t\t}\n\t\t}\n\t}\n}\n\nvoid opj_t1_dec_refpass_raw(\n                opj_t1_t *t1,\n                OPJ_INT32 bpno,\n                OPJ_INT32 cblksty)\n{\n        OPJ_INT32 one, poshalf, neghalf;\n        OPJ_UINT32 i, j, k;\n        OPJ_INT32 vsc;\n        one = 1 << bpno;\n        poshalf = one >> 1;\n        neghalf = bpno > 0 ? -poshalf : -1;\n        for (k = 0; k < t1->h; k += 4) {\n                for (i = 0; i < t1->w; ++i) {\n                        for (j = k; j < k + 4 && j < t1->h; ++j) {\n                                vsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;\n                                opj_t1_dec_refpass_step_raw(\n                                                t1,\n                                                &t1->flags[((j+1) * t1->flags_stride) + i + 1],\n                                                &t1->data[(j * t1->w) + i],\n                                                poshalf,\n                                                neghalf,\n                                                vsc);\n                        }\n                }\n        }\n}                               /* VSC and  BYPASS by Antonin */\n\nvoid opj_t1_dec_refpass_mqc(\n                opj_t1_t *t1,\n                OPJ_INT32 bpno)\n{\n        OPJ_INT32 one, poshalf, neghalf;\n        OPJ_UINT32 i, j, k;\n        OPJ_INT32 *data1 = t1->data;\n        opj_flag_t *flags1 = &t1->flags[1];\n        one = 1 << bpno;\n        poshalf = one >> 1;\n        neghalf = bpno > 0 ? -poshalf : -1;\n        for (k = 0; k < (t1->h & ~3u); k += 4) {\n                for (i = 0; i < t1->w; ++i) {\n                        OPJ_INT32 *data2 = data1 + i;\n                        opj_flag_t *flags2 = flags1 + i;\n                        flags2 += t1->flags_stride;\n                        opj_t1_dec_refpass_step_mqc(t1, flags2, data2, poshalf, neghalf);\n                        data2 += t1->w;\n                        flags2 += t1->flags_stride;\n                        opj_t1_dec_refpass_step_mqc(t1, flags2, data2, poshalf, neghalf);\n                        data2 += t1->w;\n                        flags2 += t1->flags_stride;\n                        opj_t1_dec_refpass_step_mqc(t1, flags2, data2, poshalf, neghalf);\n                        data2 += t1->w;\n                        flags2 += t1->flags_stride;\n                        opj_t1_dec_refpass_step_mqc(t1, flags2, data2, poshalf, neghalf);\n                        data2 += t1->w;\n                }\n                data1 += t1->w << 2;\n                flags1 += t1->flags_stride << 2;\n        }\n        for (i = 0; i < t1->w; ++i) {\n                OPJ_INT32 *data2 = data1 + i;\n                opj_flag_t *flags2 = flags1 + i;\n                for (j = k; j < t1->h; ++j) {\n                        flags2 += t1->flags_stride;\n                        opj_t1_dec_refpass_step_mqc(t1, flags2, data2, poshalf, neghalf);\n                        data2 += t1->w;\n                }\n        }\n}                               /* VSC and  BYPASS by Antonin */\n\nvoid opj_t1_dec_refpass_mqc_vsc(\n                opj_t1_t *t1,\n                OPJ_INT32 bpno)\n{\n        OPJ_INT32 one, poshalf, neghalf;\n        OPJ_UINT32 i, j, k;\n        OPJ_INT32 vsc;\n        one = 1 << bpno;\n        poshalf = one >> 1;\n        neghalf = bpno > 0 ? -poshalf : -1;\n        for (k = 0; k < t1->h; k += 4) {\n                for (i = 0; i < t1->w; ++i) {\n                        for (j = k; j < k + 4 && j < t1->h; ++j) {\n                                vsc = ((j == k + 3 || j == t1->h - 1)) ? 1 : 0;\n                                opj_t1_dec_refpass_step_mqc_vsc(\n                                                t1,\n                                                &t1->flags[((j+1) * t1->flags_stride) + i + 1],\n                                                &t1->data[(j * t1->w) + i],\n                                                poshalf,\n                                                neghalf,\n                                                vsc);\n                        }\n                }\n        }\n}                               /* VSC and  BYPASS by Antonin */\n\n\nvoid opj_t1_enc_clnpass_step(\n\t\topj_t1_t *t1,\n\t\topj_flag_t *flagsp,\n\t\tOPJ_INT32 *datap,\n\t\tOPJ_UINT32 orient,\n\t\tOPJ_INT32 bpno,\n\t\tOPJ_INT32 one,\n\t\tOPJ_INT32 *nmsedec,\n\t\tOPJ_UINT32 partial,\n\t\tOPJ_UINT32 vsc)\n{\n\tOPJ_INT32 v;\n\tOPJ_UINT32 flag;\n\t\n\topj_mqc_t *mqc = t1->mqc;\t/* MQC component */\n\t\n\tflag = vsc ? (OPJ_UINT32)((*flagsp) & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) : (OPJ_UINT32)(*flagsp);\n\tif (partial) {\n\t\tgoto LABEL_PARTIAL;\n\t}\n\tif (!(*flagsp & (T1_SIG | T1_VISIT))) {\n\t\topj_mqc_setcurctx(mqc, opj_t1_getctxno_zc(flag, orient));\n\t\tv = opj_int_abs(*datap) & one ? 1 : 0;\n\t\topj_mqc_encode(mqc, (OPJ_UINT32)v);\n\t\tif (v) {\nLABEL_PARTIAL:\n\t\t\t*nmsedec += opj_t1_getnmsedec_sig((OPJ_UINT32)opj_int_abs(*datap), (OPJ_UINT32)(bpno + T1_NMSEDEC_FRACBITS));\n\t\t\topj_mqc_setcurctx(mqc, opj_t1_getctxno_sc(flag));\n\t\t\tv = *datap < 0 ? 1 : 0;\n\t\t\topj_mqc_encode(mqc, (OPJ_UINT32)(v ^ opj_t1_getspb((OPJ_UINT32)flag)));\n\t\t\topj_t1_updateflags(flagsp, (OPJ_UINT32)v, t1->flags_stride);\n\t\t}\n\t}\n\t*flagsp &= ~T1_VISIT;\n}\n\nstatic void opj_t1_dec_clnpass_step_partial(\n\t\topj_t1_t *t1,\n\t\topj_flag_t *flagsp,\n\t\tOPJ_INT32 *datap,\n\t\tOPJ_INT32 orient,\n\t\tOPJ_INT32 oneplushalf)\n{\n\tOPJ_INT32 v, flag;\n\topj_mqc_t *mqc = t1->mqc;\t/* MQC component */\n\t\n\tOPJ_ARG_NOT_USED(orient);\n\t\n\tflag = *flagsp;\n\topj_mqc_setcurctx(mqc, opj_t1_getctxno_sc((OPJ_UINT32)flag));\n\tv = opj_mqc_decode(mqc) ^ opj_t1_getspb((OPJ_UINT32)flag);\n\t*datap = v ? -oneplushalf : oneplushalf;\n\topj_t1_updateflags(flagsp, (OPJ_UINT32)v, t1->flags_stride);\n\t*flagsp &= ~T1_VISIT;\n}\t\t\t\t/* VSC and  BYPASS by Antonin */\n\nstatic void opj_t1_dec_clnpass_step(\n\t\topj_t1_t *t1,\n\t\topj_flag_t *flagsp,\n\t\tOPJ_INT32 *datap,\n\t\tOPJ_INT32 orient,\n\t\tOPJ_INT32 oneplushalf)\n{\n\tOPJ_INT32 v, flag;\n\t\n\topj_mqc_t *mqc = t1->mqc;\t/* MQC component */\n\t\n\tflag = *flagsp;\n\tif (!(flag & (T1_SIG | T1_VISIT))) {\n\t\topj_mqc_setcurctx(mqc, opj_t1_getctxno_zc((OPJ_UINT32)flag, (OPJ_UINT32)orient));\n\t\tif (opj_mqc_decode(mqc)) {\n\t\t\topj_mqc_setcurctx(mqc, opj_t1_getctxno_sc((OPJ_UINT32)flag));\n\t\t\tv = opj_mqc_decode(mqc) ^ opj_t1_getspb((OPJ_UINT32)flag);\n\t\t\t*datap = v ? -oneplushalf : oneplushalf;\n\t\t\topj_t1_updateflags(flagsp, (OPJ_UINT32)v, t1->flags_stride);\n\t\t}\n\t}\n\t*flagsp &= ~T1_VISIT;\n}\t\t\t\t/* VSC and  BYPASS by Antonin */\n\nstatic void opj_t1_dec_clnpass_step_vsc(\n\t\topj_t1_t *t1,\n\t\topj_flag_t *flagsp,\n\t\tOPJ_INT32 *datap,\n\t\tOPJ_INT32 orient,\n\t\tOPJ_INT32 oneplushalf,\n\t\tOPJ_INT32 partial,\n\t\tOPJ_INT32 vsc)\n{\n\tOPJ_INT32 v, flag;\n\t\n\topj_mqc_t *mqc = t1->mqc;\t/* MQC component */\n\t\n\tflag = vsc ? ((*flagsp) & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) : (*flagsp);\n\tif (partial) {\n\t\tgoto LABEL_PARTIAL;\n\t}\n\tif (!(flag & (T1_SIG | T1_VISIT))) {\n\t\topj_mqc_setcurctx(mqc, opj_t1_getctxno_zc((OPJ_UINT32)flag, (OPJ_UINT32)orient));\n\t\tif (opj_mqc_decode(mqc)) {\nLABEL_PARTIAL:\n\t\t\topj_mqc_setcurctx(mqc, opj_t1_getctxno_sc((OPJ_UINT32)flag));\n\t\t\tv = opj_mqc_decode(mqc) ^ opj_t1_getspb((OPJ_UINT32)flag);\n\t\t\t*datap = v ? -oneplushalf : oneplushalf;\n\t\t\topj_t1_updateflags(flagsp, (OPJ_UINT32)v, t1->flags_stride);\n\t\t}\n\t}\n\t*flagsp &= ~T1_VISIT;\n}\n\nvoid opj_t1_enc_clnpass(\n\t\topj_t1_t *t1,\n\t\tOPJ_INT32 bpno,\n\t\tOPJ_UINT32 orient,\n\t\tOPJ_INT32 *nmsedec,\n\t\tOPJ_UINT32 cblksty)\n{\n\tOPJ_UINT32 i, j, k;\n\tOPJ_INT32 one;\n\tOPJ_UINT32 agg, runlen, vsc;\n\t\n\topj_mqc_t *mqc = t1->mqc;\t/* MQC component */\n\t\n\t*nmsedec = 0;\n\tone = 1 << (bpno + T1_NMSEDEC_FRACBITS);\n\tfor (k = 0; k < t1->h; k += 4) {\n\t\tfor (i = 0; i < t1->w; ++i) {\n\t\t\tif (k + 3 < t1->h) {\n\t\t\t\tif (cblksty & J2K_CCP_CBLKSTY_VSC) {\n\t\t\t\t\tagg = !(MACRO_t1_flags(1 + k,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)\n\t\t\t\t\t\t|| MACRO_t1_flags(1 + k + 1,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)\n\t\t\t\t\t\t|| MACRO_t1_flags(1 + k + 2,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)\n\t\t\t\t\t\t|| (MACRO_t1_flags(1 + k + 3,1 + i) \n\t\t\t\t\t\t& (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW |\tT1_SGN_S))) & (T1_SIG | T1_VISIT | T1_SIG_OTH));\n\t\t\t\t} else {\n\t\t\t\t\tagg = !(MACRO_t1_flags(1 + k,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)\n\t\t\t\t\t\t|| MACRO_t1_flags(1 + k + 1,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)\n\t\t\t\t\t\t|| MACRO_t1_flags(1 + k + 2,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)\n\t\t\t\t\t\t|| MACRO_t1_flags(1 + k + 3,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tagg = 0;\n\t\t\t}\n\t\t\tif (agg) {\n\t\t\t\tfor (runlen = 0; runlen < 4; ++runlen) {\n\t\t\t\t\tif (opj_int_abs(t1->data[((k + runlen)*t1->w) + i]) & one)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\topj_mqc_setcurctx(mqc, T1_CTXNO_AGG);\n\t\t\t\topj_mqc_encode(mqc, runlen != 4);\n\t\t\t\tif (runlen == 4) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\topj_mqc_setcurctx(mqc, T1_CTXNO_UNI);\n\t\t\t\topj_mqc_encode(mqc, runlen >> 1);\n\t\t\t\topj_mqc_encode(mqc, runlen & 1);\n\t\t\t} else {\n\t\t\t\trunlen = 0;\n\t\t\t}\n\t\t\tfor (j = k + runlen; j < k + 4 && j < t1->h; ++j) {\n\t\t\t\tvsc = ((cblksty & J2K_CCP_CBLKSTY_VSC) && (j == k + 3 || j == t1->h - 1)) ? 1 : 0;\n\t\t\t\topj_t1_enc_clnpass_step(\n\t\t\t\t\t\tt1,\n\t\t\t\t\t\t&t1->flags[((j+1) * t1->flags_stride) + i + 1],\n\t\t\t\t\t\t&t1->data[(j * t1->w) + i],\n\t\t\t\t\t\torient,\n\t\t\t\t\t\tbpno,\n\t\t\t\t\t\tone,\n\t\t\t\t\t\tnmsedec,\n\t\t\t\t\t\tagg && (j == k + runlen),\n\t\t\t\t\t\tvsc);\n\t\t\t}\n\t\t}\n\t}\n}\n\nstatic void opj_t1_dec_clnpass(\n\t\topj_t1_t *t1,\n\t\tOPJ_INT32 bpno,\n\t\tOPJ_INT32 orient,\n\t\tOPJ_INT32 cblksty)\n{\n\tOPJ_INT32 one, half, oneplushalf, agg, runlen, vsc;\n    OPJ_UINT32 i, j, k;\n\tOPJ_INT32 segsym = cblksty & J2K_CCP_CBLKSTY_SEGSYM;\n\t\n\topj_mqc_t *mqc = t1->mqc;\t/* MQC component */\n\t\n\tone = 1 << bpno;\n\thalf = one >> 1;\n\toneplushalf = one | half;\n\tif (cblksty & J2K_CCP_CBLKSTY_VSC) {\n\tfor (k = 0; k < t1->h; k += 4) {\n\t\tfor (i = 0; i < t1->w; ++i) {\n\t\t\tif (k + 3 < t1->h) {\n\t\t\t\t\tagg = !(MACRO_t1_flags(1 + k,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)\n\t\t\t\t\t\t|| MACRO_t1_flags(1 + k + 1,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)\n\t\t\t\t\t\t|| MACRO_t1_flags(1 + k + 2,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)\n\t\t\t\t\t\t|| (MACRO_t1_flags(1 + k + 3,1 + i) \n\t\t\t\t\t\t& (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW |\tT1_SGN_S))) & (T1_SIG | T1_VISIT | T1_SIG_OTH));\n\t\t\t\t} else {\n\t\t\t\tagg = 0;\n\t\t\t}\n\t\t\tif (agg) {\n\t\t\t\topj_mqc_setcurctx(mqc, T1_CTXNO_AGG);\n\t\t\t\tif (!opj_mqc_decode(mqc)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\topj_mqc_setcurctx(mqc, T1_CTXNO_UNI);\n\t\t\t\trunlen = opj_mqc_decode(mqc);\n\t\t\t\trunlen = (runlen << 1) | opj_mqc_decode(mqc);\n\t\t\t} else {\n\t\t\t\trunlen = 0;\n\t\t\t}\n\t\t\tfor (j = k + (OPJ_UINT32)runlen; j < k + 4 && j < t1->h; ++j) {\n\t\t\t\t\tvsc = (j == k + 3 || j == t1->h - 1) ? 1 : 0;\n\t\t\t\t\topj_t1_dec_clnpass_step_vsc(\n\t\t\t\t\t\tt1,\n\t\t\t\t\t\t&t1->flags[((j+1) * t1->flags_stride) + i + 1],\n\t\t\t\t\t\t&t1->data[(j * t1->w) + i],\n\t\t\t\t\t\torient,\n\t\t\t\t\t\toneplushalf,\n\t\t\t\t\t\tagg && (j == k + (OPJ_UINT32)runlen),\n\t\t\t\t\t\tvsc);\n\t\t\t}\n\t\t}\n\t}\n\t} else {\n\t\tOPJ_INT32 *data1 = t1->data;\n\t\topj_flag_t *flags1 = &t1->flags[1];\n\t\tfor (k = 0; k < (t1->h & ~3u); k += 4) {\n\t\t\tfor (i = 0; i < t1->w; ++i) {\n\t\t\t\tOPJ_INT32 *data2 = data1 + i;\n\t\t\t\topj_flag_t *flags2 = flags1 + i;\n\t\t\t\tagg = !(MACRO_t1_flags(1 + k,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)\n\t\t\t\t\t|| MACRO_t1_flags(1 + k + 1,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)\n\t\t\t\t\t|| MACRO_t1_flags(1 + k + 2,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH)\n\t\t\t\t\t|| MACRO_t1_flags(1 + k + 3,1 + i) & (T1_SIG | T1_VISIT | T1_SIG_OTH));\n\t\t\t\tif (agg) {\n\t\t\t\t\topj_mqc_setcurctx(mqc, T1_CTXNO_AGG);\n\t\t\t\t\tif (!opj_mqc_decode(mqc)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\topj_mqc_setcurctx(mqc, T1_CTXNO_UNI);\n\t\t\t\t\trunlen = opj_mqc_decode(mqc);\n\t\t\t\t\trunlen = (runlen << 1) | opj_mqc_decode(mqc);\n\t\t\t\t\tflags2 += (OPJ_UINT32)runlen * t1->flags_stride;\n\t\t\t\t\tdata2 += (OPJ_UINT32)runlen * t1->w;\n\t\t\t\t\tfor (j = k + (OPJ_UINT32)runlen; j < k + 4 && j < t1->h; ++j) {\n\t\t\t\t\t\tflags2 += t1->flags_stride;\n\t\t\t\t\t\tif (agg && (j == k + (OPJ_UINT32)runlen)) {\n\t\t\t\t\t\t\topj_t1_dec_clnpass_step_partial(t1, flags2, data2, orient, oneplushalf);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\topj_t1_dec_clnpass_step(t1, flags2, data2, orient, oneplushalf);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdata2 += t1->w;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tflags2 += t1->flags_stride;\n\t\t\t\t\topj_t1_dec_clnpass_step(t1, flags2, data2, orient, oneplushalf);\n\t\t\t\t\tdata2 += t1->w;\n\t\t\t\t\tflags2 += t1->flags_stride;\n\t\t\t\t\topj_t1_dec_clnpass_step(t1, flags2, data2, orient, oneplushalf);\n\t\t\t\t\tdata2 += t1->w;\n\t\t\t\t\tflags2 += t1->flags_stride;\n\t\t\t\t\topj_t1_dec_clnpass_step(t1, flags2, data2, orient, oneplushalf);\n\t\t\t\t\tdata2 += t1->w;\n\t\t\t\t\tflags2 += t1->flags_stride;\n\t\t\t\t\topj_t1_dec_clnpass_step(t1, flags2, data2, orient, oneplushalf);\n\t\t\t\t\tdata2 += t1->w;\n\t\t\t\t}\n\t\t\t}\n\t\t\tdata1 += t1->w << 2;\n\t\t\tflags1 += t1->flags_stride << 2;\n\t\t}\n\t\tfor (i = 0; i < t1->w; ++i) {\n\t\t\tOPJ_INT32 *data2 = data1 + i;\n\t\t\topj_flag_t *flags2 = flags1 + i;\n\t\t\tfor (j = k; j < t1->h; ++j) {\n\t\t\t\tflags2 += t1->flags_stride;\n\t\t\t\topj_t1_dec_clnpass_step(t1, flags2, data2, orient, oneplushalf);\n\t\t\t\tdata2 += t1->w;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (segsym) {\n\t\tOPJ_INT32 v = 0;\n\t\topj_mqc_setcurctx(mqc, T1_CTXNO_UNI);\n\t\tv = opj_mqc_decode(mqc);\n\t\tv = (v << 1) | opj_mqc_decode(mqc);\n\t\tv = (v << 1) | opj_mqc_decode(mqc);\n\t\tv = (v << 1) | opj_mqc_decode(mqc);\n\t\t/*\n\t\tif (v!=0xa) {\n\t\t\topj_event_msg(t1->cinfo, EVT_WARNING, \"Bad segmentation symbol %x\\n\", v);\n\t\t} \n\t\t*/\n\t}\n}\t\t\t\t/* VSC and  BYPASS by Antonin */\n\n\n/** mod fixed_quality */\nstatic OPJ_FLOAT64 opj_t1_getwmsedec(\n\t\tOPJ_INT32 nmsedec,\n\t\tOPJ_UINT32 compno,\n\t\tOPJ_UINT32 level,\n\t\tOPJ_UINT32 orient,\n\t\tOPJ_INT32 bpno,\n\t\tOPJ_UINT32 qmfbid,\n\t\tOPJ_FLOAT64 stepsize,\n\t\tOPJ_UINT32 numcomps,\n\t\tconst OPJ_FLOAT64 * mct_norms)\n{\n\tOPJ_FLOAT64 w1 = 1, w2, wmsedec;\n    OPJ_ARG_NOT_USED(numcomps);\n\n\tif (mct_norms) {\n\t\tw1 = mct_norms[compno];\n\t}\n\n\tif (qmfbid == 1) {\n\t\tw2 = opj_dwt_getnorm(level, orient);\n\t} else {\t/* if (qmfbid == 0) */\n\t\tw2 = opj_dwt_getnorm_real(level, orient);\n\t}\n\n\twmsedec = w1 * w2 * stepsize * (1 << bpno);\n\twmsedec *= wmsedec * nmsedec / 8192.0;\n\n\treturn wmsedec;\n}\n\nOPJ_BOOL opj_t1_allocate_buffers(\n\t\topj_t1_t *t1,\n\t\tOPJ_UINT32 w,\n\t\tOPJ_UINT32 h)\n{\n\tOPJ_UINT32 datasize=w * h;\n\tOPJ_UINT32 flagssize;\n\n\tif(datasize > t1->datasize){\n\t\topj_aligned_free(t1->data);\n\t\tt1->data = (OPJ_INT32*) opj_aligned_malloc(datasize * sizeof(OPJ_INT32));\n\t\tif(!t1->data){\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\t\tt1->datasize=datasize;\n\t}\n\tmemset(t1->data,0,datasize * sizeof(OPJ_INT32));\n\n\tt1->flags_stride=w+2;\n\tflagssize=t1->flags_stride * (h+2);\n\n\tif(flagssize > t1->flagssize){\n\t\topj_aligned_free(t1->flags);\n\t\tt1->flags = (opj_flag_t*) opj_aligned_malloc(flagssize * sizeof(opj_flag_t));\n\t\tif(!t1->flags){\n\t\t\treturn OPJ_FALSE;\n\t\t}\n\t\tt1->flagssize=flagssize;\n\t}\n\tmemset(t1->flags,0,flagssize * sizeof(opj_flag_t));\n\n\tt1->w=w;\n\tt1->h=h;\n\n\treturn OPJ_TRUE;\n}\n\n/* ----------------------------------------------------------------------- */\n\n/* ----------------------------------------------------------------------- */\n/**\n * Creates a new Tier 1 handle\n * and initializes the look-up tables of the Tier-1 coder/decoder\n * @return a new T1 handle if successful, returns NULL otherwise\n*/\nopj_t1_t* opj_t1_create()\n{\n\topj_t1_t *l_t1 = 00;\n\n\tl_t1 = (opj_t1_t*) opj_malloc(sizeof(opj_t1_t));\n\tif (!l_t1) {\n\t\treturn 00;\n\t}\n\tmemset(l_t1,0,sizeof(opj_t1_t));\n\n\t/* create MQC and RAW handles */\n\tl_t1->mqc = opj_mqc_create();\n\tif (! l_t1->mqc) {\n\t\topj_t1_destroy(l_t1);\n\t\treturn 00;\n\t}\n\n\tl_t1->raw = opj_raw_create();\n\tif (! l_t1->raw) {\n\t\topj_t1_destroy(l_t1);\n\t\treturn 00;\n\t}\n\n\treturn l_t1;\n}\n\n\n/**\n * Destroys a previously created T1 handle\n *\n * @param p_t1 Tier 1 handle to destroy\n*/\nvoid opj_t1_destroy(opj_t1_t *p_t1)\n{\n\tif (! p_t1) {\n\t\treturn;\n\t}\n\n\t/* destroy MQC and RAW handles */\n\topj_mqc_destroy(p_t1->mqc);\n\tp_t1->mqc = 00;\n\topj_raw_destroy(p_t1->raw);\n\tp_t1->raw = 00;\n\t\n    if (p_t1->data) {\n\t\topj_aligned_free(p_t1->data);\n\t\tp_t1->data = 00;\n\t}\n\n\tif (p_t1->flags) {\n\t\topj_aligned_free(p_t1->flags);\n\t\tp_t1->flags = 00;\n\t}\n\n\topj_free(p_t1);\n}\n\nOPJ_BOOL opj_t1_decode_cblks(   opj_t1_t* t1,\n                            opj_tcd_tilecomp_t* tilec,\n                            opj_tccp_t* tccp\n                            )\n{\n\tOPJ_UINT32 resno, bandno, precno, cblkno;\n\tOPJ_UINT32 tile_w = (OPJ_UINT32)(tilec->x1 - tilec->x0);\n\n\tfor (resno = 0; resno < tilec->minimum_num_resolutions; ++resno) {\n\t\topj_tcd_resolution_t* res = &tilec->resolutions[resno];\n\n\t\tfor (bandno = 0; bandno < res->numbands; ++bandno) {\n\t\t\topj_tcd_band_t* restrict band = &res->bands[bandno];\n\n\t\t\tfor (precno = 0; precno < res->pw * res->ph; ++precno) {\n\t\t\t\topj_tcd_precinct_t* precinct = &band->precincts[precno];\n\n\t\t\t\tfor (cblkno = 0; cblkno < precinct->cw * precinct->ch; ++cblkno) {\n\t\t\t\t\topj_tcd_cblk_dec_t* cblk = &precinct->cblks.dec[cblkno];\n\t\t\t\t\tOPJ_INT32* restrict datap;\n\t\t\t\t\t/*void* restrict tiledp;*/\n\t\t\t\t\tOPJ_UINT32 cblk_w, cblk_h;\n\t\t\t\t\tOPJ_INT32 x, y;\n\t\t\t\t\tOPJ_UINT32 i, j;\n\n                    if (OPJ_FALSE == opj_t1_decode_cblk(\n                                            t1,\n                                            cblk,\n                                            band->bandno,\n                                            (OPJ_UINT32)tccp->roishift,\n                                            tccp->cblksty)) {\n                            return OPJ_FALSE;\n                    }\n\n\t\t\t\t\tx = cblk->x0 - band->x0;\n\t\t\t\t\ty = cblk->y0 - band->y0;\n\t\t\t\t\tif (band->bandno & 1) {\n\t\t\t\t\t\topj_tcd_resolution_t* pres = &tilec->resolutions[resno - 1];\n\t\t\t\t\t\tx += pres->x1 - pres->x0;\n\t\t\t\t\t}\n\t\t\t\t\tif (band->bandno & 2) {\n\t\t\t\t\t\topj_tcd_resolution_t* pres = &tilec->resolutions[resno - 1];\n\t\t\t\t\t\ty += pres->y1 - pres->y0;\n\t\t\t\t\t}\n\n\t\t\t\t\tdatap=t1->data;\n\t\t\t\t\tcblk_w = t1->w;\n\t\t\t\t\tcblk_h = t1->h;\n\n\t\t\t\t\tif (tccp->roishift) {\n\t\t\t\t\t\tOPJ_INT32 thresh = 1 << tccp->roishift;\n\t\t\t\t\t\tfor (j = 0; j < cblk_h; ++j) {\n\t\t\t\t\t\t\tfor (i = 0; i < cblk_w; ++i) {\n\t\t\t\t\t\t\t\tOPJ_INT32 val = datap[(j * cblk_w) + i];\n\t\t\t\t\t\t\t\tOPJ_INT32 mag = abs(val);\n\t\t\t\t\t\t\t\tif (mag >= thresh) {\n\t\t\t\t\t\t\t\t\tmag >>= tccp->roishift;\n\t\t\t\t\t\t\t\t\tdatap[(j * cblk_w) + i] = val < 0 ? -mag : mag;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t/*tiledp=(void*)&tilec->data[(y * tile_w) + x];*/\n\t\t\t\t\tif (tccp->qmfbid == 1) {\n                        OPJ_INT32* restrict tiledp = &tilec->data[(OPJ_UINT32)y * tile_w + (OPJ_UINT32)x];\n\t\t\t\t\t\tfor (j = 0; j < cblk_h; ++j) {\n\t\t\t\t\t\t\tfor (i = 0; i < cblk_w; ++i) {\n\t\t\t\t\t\t\t\tOPJ_INT32 tmp = datap[(j * cblk_w) + i];\n\t\t\t\t\t\t\t\t((OPJ_INT32*)tiledp)[(j * tile_w) + i] = tmp / 2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\t\t/* if (tccp->qmfbid == 0) */\n                        OPJ_FLOAT32* restrict tiledp = (OPJ_FLOAT32*) &tilec->data[(OPJ_UINT32)y * tile_w + (OPJ_UINT32)x];\n\t\t\t\t\t\tfor (j = 0; j < cblk_h; ++j) {\n                            OPJ_FLOAT32* restrict tiledp2 = tiledp;\n\t\t\t\t\t\t\tfor (i = 0; i < cblk_w; ++i) {\n                                OPJ_FLOAT32 tmp = (OPJ_FLOAT32)*datap * band->stepsize;\n                                *tiledp2 = tmp;\n                                datap++;\n                                tiledp2++;\n\t\t\t\t\t\t\t\t/*float tmp = datap[(j * cblk_w) + i] * band->stepsize;\n\t\t\t\t\t\t\t\t((float*)tiledp)[(j * tile_w) + i] = tmp;*/\n\n\t\t\t\t\t\t\t}\n                            tiledp += tile_w;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n                    /*opj_free(cblk->data);\n\t\t\t\t\topj_free(cblk->segs);*/\n\t\t\t\t\t/*cblk->segs = 00;*/\n\t\t\t\t} /* cblkno */\n                /*opj_free(precinct->cblks.dec);*/\n\t\t\t} /* precno */\n\t\t} /* bandno */\n\t} /* resno */\n        return OPJ_TRUE;\n}\n\n\nOPJ_BOOL opj_t1_decode_cblk(opj_t1_t *t1,\n                            opj_tcd_cblk_dec_t* cblk,\n                            OPJ_UINT32 orient,\n                            OPJ_UINT32 roishift,\n                            OPJ_UINT32 cblksty)\n{\n\topj_raw_t *raw = t1->raw;\t/* RAW component */\n\topj_mqc_t *mqc = t1->mqc;\t/* MQC component */\n\n\tOPJ_INT32 bpno;\n\tOPJ_UINT32 passtype;\n\tOPJ_UINT32 segno, passno;\n\tOPJ_BYTE type = T1_TYPE_MQ; /* BYPASS mode */\n\n\tif(!opj_t1_allocate_buffers(\n\t\t\t\tt1,\n\t\t\t\t(OPJ_UINT32)(cblk->x1 - cblk->x0),\n\t\t\t\t(OPJ_UINT32)(cblk->y1 - cblk->y0)))\n\t{\n\t\treturn OPJ_FALSE;\n\t}\n\n\tbpno = (OPJ_INT32)(roishift + cblk->numbps - 1);\n\tpasstype = 2;\n\n\topj_mqc_resetstates(mqc);\n\topj_mqc_setstate(mqc, T1_CTXNO_UNI, 0, 46);\n\topj_mqc_setstate(mqc, T1_CTXNO_AGG, 0, 3);\n\topj_mqc_setstate(mqc, T1_CTXNO_ZC, 0, 4);\n\n\tfor (segno = 0; segno < cblk->real_num_segs; ++segno) {\n\t\topj_tcd_seg_t *seg = &cblk->segs[segno];\n\n\t\t/* BYPASS mode */\n\t\ttype = ((bpno <= ((OPJ_INT32) (cblk->numbps) - 1) - 4) && (passtype < 2) && (cblksty & J2K_CCP_CBLKSTY_LAZY)) ? T1_TYPE_RAW : T1_TYPE_MQ;\n\t\t/* FIXME: slviewer gets here with a null pointer. Why? Partially downloaded and/or corrupt textures? */\n\t\tif(seg->data == 00){\n\t\t\tcontinue;\n\t\t}\n\t\tif (type == T1_TYPE_RAW) {\n\t\t\topj_raw_init_dec(raw, (*seg->data) + seg->dataindex, seg->len);\n\t\t} else {\n            if (OPJ_FALSE == opj_mqc_init_dec(mqc, (*seg->data) + seg->dataindex, seg->len)) {\n                    return OPJ_FALSE;\n            }\n\t\t}\n\n\t\tfor (passno = 0; passno < seg->real_num_passes; ++passno) {\n            switch (passtype) {\n                case 0:\n                    if (type == T1_TYPE_RAW) {\n                        opj_t1_dec_sigpass_raw(t1, bpno+1, (OPJ_INT32)orient, (OPJ_INT32)cblksty);\n                    } else {\n                        if (cblksty & J2K_CCP_CBLKSTY_VSC) {\n                            opj_t1_dec_sigpass_mqc_vsc(t1, bpno+1, (OPJ_INT32)orient);\n                        } else {\n                            opj_t1_dec_sigpass_mqc(t1, bpno+1, (OPJ_INT32)orient);\n                        }\n                    }\n                    break;\n                case 1:\n                    if (type == T1_TYPE_RAW) {\n                            opj_t1_dec_refpass_raw(t1, bpno+1, (OPJ_INT32)cblksty);\n                    } else {\n                        if (cblksty & J2K_CCP_CBLKSTY_VSC) {\n                            opj_t1_dec_refpass_mqc_vsc(t1, bpno+1);\n                        } else {\n                            opj_t1_dec_refpass_mqc(t1, bpno+1);\n                        }\n                    }\n                    break;\n                case 2:\n                    opj_t1_dec_clnpass(t1, bpno+1, (OPJ_INT32)orient, (OPJ_INT32)cblksty);\n                    break;\n            }\n\n\t\t\tif ((cblksty & J2K_CCP_CBLKSTY_RESET) && type == T1_TYPE_MQ) {\n\t\t\t\topj_mqc_resetstates(mqc);\n\t\t\t\topj_mqc_setstate(mqc, T1_CTXNO_UNI, 0, 46);\n\t\t\t\topj_mqc_setstate(mqc, T1_CTXNO_AGG, 0, 3);\n\t\t\t\topj_mqc_setstate(mqc, T1_CTXNO_ZC, 0, 4);\n\t\t\t}\n\t\t\tif (++passtype == 3) {\n\t\t\t\tpasstype = 0;\n\t\t\t\tbpno--;\n\t\t\t}\n\t\t}\n\t}\n        return OPJ_TRUE;\n}\n\n\n\n\nOPJ_BOOL opj_t1_encode_cblks(   opj_t1_t *t1,\n                                opj_tcd_tile_t *tile,\n                                opj_tcp_t *tcp,\n                                const OPJ_FLOAT64 * mct_norms\n                                )\n{\n\tOPJ_UINT32 compno, resno, bandno, precno, cblkno;\n\n\ttile->distotile = 0;\t\t/* fixed_quality */\n\n\tfor (compno = 0; compno < tile->numcomps; ++compno) {\n\t\topj_tcd_tilecomp_t* tilec = &tile->comps[compno];\n\t\topj_tccp_t* tccp = &tcp->tccps[compno];\n\t\tOPJ_UINT32 tile_w = (OPJ_UINT32)(tilec->x1 - tilec->x0);\n\n\t\tfor (resno = 0; resno < tilec->numresolutions; ++resno) {\n\t\t\topj_tcd_resolution_t *res = &tilec->resolutions[resno];\n\n\t\t\tfor (bandno = 0; bandno < res->numbands; ++bandno) {\n\t\t\t\topj_tcd_band_t* restrict band = &res->bands[bandno];\n                OPJ_INT32 bandconst = 8192 * 8192 / ((OPJ_INT32) floor(band->stepsize * 8192));\n\n\t\t\t\tfor (precno = 0; precno < res->pw * res->ph; ++precno) {\n\t\t\t\t\topj_tcd_precinct_t *prc = &band->precincts[precno];\n\n\t\t\t\t\tfor (cblkno = 0; cblkno < prc->cw * prc->ch; ++cblkno) {\n\t\t\t\t\t\topj_tcd_cblk_enc_t* cblk = &prc->cblks.enc[cblkno];\n\t\t\t\t\t\tOPJ_INT32 * restrict datap;\n\t\t\t\t\t\tOPJ_INT32* restrict tiledp;\n\t\t\t\t\t\tOPJ_UINT32 cblk_w;\n\t\t\t\t\t\tOPJ_UINT32 cblk_h;\n\t\t\t\t\t\tOPJ_UINT32 i, j;\n\n\t\t\t\t\t\tOPJ_INT32 x = cblk->x0 - band->x0;\n\t\t\t\t\t\tOPJ_INT32 y = cblk->y0 - band->y0;\n\t\t\t\t\t\tif (band->bandno & 1) {\n\t\t\t\t\t\t\topj_tcd_resolution_t *pres = &tilec->resolutions[resno - 1];\n\t\t\t\t\t\t\tx += pres->x1 - pres->x0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (band->bandno & 2) {\n\t\t\t\t\t\t\topj_tcd_resolution_t *pres = &tilec->resolutions[resno - 1];\n\t\t\t\t\t\t\ty += pres->y1 - pres->y0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(!opj_t1_allocate_buffers(\n\t\t\t\t\t\t\t\t\tt1,\n\t\t\t\t\t\t\t\t\t(OPJ_UINT32)(cblk->x1 - cblk->x0),\n\t\t\t\t\t\t\t\t\t(OPJ_UINT32)(cblk->y1 - cblk->y0)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn OPJ_FALSE;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdatap=t1->data;\n\t\t\t\t\t\tcblk_w = t1->w;\n\t\t\t\t\t\tcblk_h = t1->h;\n\n\t\t\t\t\t\ttiledp=&tilec->data[(OPJ_UINT32)y * tile_w + (OPJ_UINT32)x];\n\t\t\t\t\t\tif (tccp->qmfbid == 1) {\n\t\t\t\t\t\t\tfor (j = 0; j < cblk_h; ++j) {\n\t\t\t\t\t\t\t\tfor (i = 0; i < cblk_w; ++i) {\n\t\t\t\t\t\t\t\t\tOPJ_INT32 tmp = tiledp[(j * tile_w) + i];\n\t\t\t\t\t\t\t\t\tdatap[(j * cblk_w) + i] = tmp << T1_NMSEDEC_FRACBITS;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\t\t/* if (tccp->qmfbid == 0) */\n\t\t\t\t\t\t\tfor (j = 0; j < cblk_h; ++j) {\n\t\t\t\t\t\t\t\tfor (i = 0; i < cblk_w; ++i) {\n\t\t\t\t\t\t\t\t\tOPJ_INT32 tmp = tiledp[(j * tile_w) + i];\n\t\t\t\t\t\t\t\t\tdatap[(j * cblk_w) + i] =\n\t\t\t\t\t\t\t\t\t\topj_int_fix_mul(\n\t\t\t\t\t\t\t\t\t\ttmp,\n\t\t\t\t\t\t\t\t\t\tbandconst) >> (11 - T1_NMSEDEC_FRACBITS);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\topj_t1_encode_cblk(\n\t\t\t\t\t\t\t\tt1,\n\t\t\t\t\t\t\t\tcblk,\n\t\t\t\t\t\t\t\tband->bandno,\n\t\t\t\t\t\t\t\tcompno,\n\t\t\t\t\t\t\t\ttilec->numresolutions - 1 - resno,\n\t\t\t\t\t\t\t\ttccp->qmfbid,\n\t\t\t\t\t\t\t\tband->stepsize,\n\t\t\t\t\t\t\t\ttccp->cblksty,\n\t\t\t\t\t\t\t\ttile->numcomps,\n\t\t\t\t\t\t\t\ttile,\n\t\t\t\t\t\t\t\tmct_norms);\n\n\t\t\t\t\t} /* cblkno */\n\t\t\t\t} /* precno */\n\t\t\t} /* bandno */\n\t\t} /* resno  */\n\t} /* compno  */\n\treturn OPJ_TRUE;\n}\n\n/** mod fixed_quality */\nvoid opj_t1_encode_cblk(opj_t1_t *t1,\n                        opj_tcd_cblk_enc_t* cblk,\n                        OPJ_UINT32 orient,\n                        OPJ_UINT32 compno,\n                        OPJ_UINT32 level,\n                        OPJ_UINT32 qmfbid,\n                        OPJ_FLOAT64 stepsize,\n                        OPJ_UINT32 cblksty,\n                        OPJ_UINT32 numcomps,\n                        opj_tcd_tile_t * tile,\n                        const OPJ_FLOAT64 * mct_norms)\n{\n\tOPJ_FLOAT64 cumwmsedec = 0.0;\n\n\topj_mqc_t *mqc = t1->mqc;\t/* MQC component */\n\n\tOPJ_UINT32 passno;\n\tOPJ_INT32 bpno;\n\tOPJ_UINT32 passtype;\n\tOPJ_INT32 nmsedec = 0;\n\tOPJ_INT32 max;\n\tOPJ_UINT32 i;\n\tOPJ_BYTE type = T1_TYPE_MQ;\n\tOPJ_FLOAT64 tempwmsedec;\n\n\tmax = 0;\n\tfor (i = 0; i < t1->w * t1->h; ++i) {\n\t\tOPJ_INT32 tmp = abs(t1->data[i]);\n\t\tmax = opj_int_max(max, tmp);\n\t}\n\n\tcblk->numbps = max ? (OPJ_UINT32)((opj_int_floorlog2(max) + 1) - T1_NMSEDEC_FRACBITS) : 0;\n\n\tbpno = (OPJ_INT32)(cblk->numbps - 1);\n\tpasstype = 2;\n\n\topj_mqc_resetstates(mqc);\n\topj_mqc_setstate(mqc, T1_CTXNO_UNI, 0, 46);\n\topj_mqc_setstate(mqc, T1_CTXNO_AGG, 0, 3);\n\topj_mqc_setstate(mqc, T1_CTXNO_ZC, 0, 4);\n\topj_mqc_init_enc(mqc, cblk->data);\n\n\tfor (passno = 0; bpno >= 0; ++passno) {\n\t\topj_tcd_pass_t *pass = &cblk->passes[passno];\n\t\tOPJ_UINT32 correction = 3;\n\t\ttype = ((bpno < ((OPJ_INT32) (cblk->numbps) - 4)) && (passtype < 2) && (cblksty & J2K_CCP_CBLKSTY_LAZY)) ? T1_TYPE_RAW : T1_TYPE_MQ;\n\n\t\tswitch (passtype) {\n\t\t\tcase 0:\n\t\t\t\topj_t1_enc_sigpass(t1, bpno, orient, &nmsedec, type, cblksty);\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\topj_t1_enc_refpass(t1, bpno, &nmsedec, type, cblksty);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\topj_t1_enc_clnpass(t1, bpno, orient, &nmsedec, cblksty);\n\t\t\t\t/* code switch SEGMARK (i.e. SEGSYM) */\n\t\t\t\tif (cblksty & J2K_CCP_CBLKSTY_SEGSYM)\n\t\t\t\t\topj_mqc_segmark_enc(mqc);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t/* fixed_quality */\n\t\ttempwmsedec = opj_t1_getwmsedec(nmsedec, compno, level, orient, bpno, qmfbid, stepsize, numcomps,mct_norms) ;\n\t\tcumwmsedec += tempwmsedec;\n\t\ttile->distotile += tempwmsedec;\n\n\t\t/* Code switch \"RESTART\" (i.e. TERMALL) */\n\t\tif ((cblksty & J2K_CCP_CBLKSTY_TERMALL)\t&& !((passtype == 2) && (bpno - 1 < 0))) {\n\t\t\tif (type == T1_TYPE_RAW) {\n\t\t\t\topj_mqc_flush(mqc);\n\t\t\t\tcorrection = 1;\n\t\t\t\t/* correction = mqc_bypass_flush_enc(); */\n\t\t\t} else {\t\t\t/* correction = mqc_restart_enc(); */\n\t\t\t\topj_mqc_flush(mqc);\n\t\t\t\tcorrection = 1;\n\t\t\t}\n\t\t\tpass->term = 1;\n\t\t} else {\n\t\t\tif (((bpno < ((OPJ_INT32) (cblk->numbps) - 4) && (passtype > 0))\n\t\t\t\t|| ((bpno == ((OPJ_INT32)cblk->numbps - 4)) && (passtype == 2))) && (cblksty & J2K_CCP_CBLKSTY_LAZY)) {\n\t\t\t\tif (type == T1_TYPE_RAW) {\n\t\t\t\t\topj_mqc_flush(mqc);\n\t\t\t\t\tcorrection = 1;\n\t\t\t\t\t/* correction = mqc_bypass_flush_enc(); */\n\t\t\t\t} else {\t\t/* correction = mqc_restart_enc(); */\n\t\t\t\t\topj_mqc_flush(mqc);\n\t\t\t\t\tcorrection = 1;\n\t\t\t\t}\n\t\t\t\tpass->term = 1;\n\t\t\t} else {\n\t\t\t\tpass->term = 0;\n\t\t\t}\n\t\t}\n\n\t\tif (++passtype == 3) {\n\t\t\tpasstype = 0;\n\t\t\tbpno--;\n\t\t}\n\n\t\tif (pass->term && bpno > 0) {\n\t\t\ttype = ((bpno < ((OPJ_INT32) (cblk->numbps) - 4)) && (passtype < 2) && (cblksty & J2K_CCP_CBLKSTY_LAZY)) ? T1_TYPE_RAW : T1_TYPE_MQ;\n\t\t\tif (type == T1_TYPE_RAW)\n\t\t\t\topj_mqc_bypass_init_enc(mqc);\n\t\t\telse\n\t\t\t\topj_mqc_restart_init_enc(mqc);\n\t\t}\n\n\t\tpass->distortiondec = cumwmsedec;\n\t\tpass->rate = opj_mqc_numbytes(mqc) + correction;\t/* FIXME */\n\n\t\t/* Code-switch \"RESET\" */\n\t\tif (cblksty & J2K_CCP_CBLKSTY_RESET)\n\t\t\topj_mqc_reset_enc(mqc);\n\t}\n\n\t/* Code switch \"ERTERM\" (i.e. PTERM) */\n\tif (cblksty & J2K_CCP_CBLKSTY_PTERM)\n\t\topj_mqc_erterm_enc(mqc);\n\telse /* Default coding */ if (!(cblksty & J2K_CCP_CBLKSTY_LAZY))\n\t\topj_mqc_flush(mqc);\n\n\tcblk->totalpasses = passno;\n\n\tfor (passno = 0; passno<cblk->totalpasses; passno++) {\n\t\topj_tcd_pass_t *pass = &cblk->passes[passno];\n\t\tif (pass->rate > opj_mqc_numbytes(mqc))\n\t\t\tpass->rate = opj_mqc_numbytes(mqc);\n\t\t/*Preventing generation of FF as last data byte of a pass*/\n\t\tif((pass->rate>1) && (cblk->data[pass->rate - 1] == 0xFF)){\n\t\t\tpass->rate--;\n\t\t}\n\t\tpass->len = pass->rate - (passno == 0 ? 0 : cblk->passes[passno - 1].rate);\n\t}\n}\n\n#if 0\nvoid opj_t1_dec_refpass_step(   opj_t1_t *t1,\n                                opj_flag_t *flagsp,\n                                OPJ_INT32 *datap,\n                                OPJ_INT32 poshalf,\n                                OPJ_INT32 neghalf,\n                                OPJ_BYTE type,\n                                OPJ_UINT32 vsc)\n{\n\tOPJ_INT32  t;\n\tOPJ_UINT32 v,flag;\n\n\topj_mqc_t *mqc = t1->mqc;\t/* MQC component */\n\topj_raw_t *raw = t1->raw;\t/* RAW component */\n\n\tflag = vsc ? ((*flagsp) & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) : (*flagsp);\n\tif ((flag & (T1_SIG | T1_VISIT)) == T1_SIG) {\n\t\topj_mqc_setcurctx(mqc, opj_t1_getctxno_mag(flag));\t/* ESSAI */\n\t\tif (type == T1_TYPE_RAW) {\n\t\t\tv = opj_raw_decode(raw);\n\t\t} else {\n\t\t\tv = opj_mqc_decode(mqc);\n\t\t}\n\t\tt = v ? poshalf : neghalf;\n\t\t*datap += *datap < 0 ? -t : t;\n\t\t*flagsp |= T1_REFINE;\n\t}\n}\t\t\t\t/* VSC and  BYPASS by Antonin  */\n#endif\n\n\n\n#if 0\nvoid opj_t1_dec_sigpass_step(   opj_t1_t *t1,\n                                opj_flag_t *flagsp,\n                                OPJ_INT32 *datap,\n                                OPJ_UINT32 orient,\n                                OPJ_INT32 oneplushalf,\n                                OPJ_BYTE type,\n                                OPJ_UINT32 vsc)\n{\n\tOPJ_UINT32 v, flag;\n\n\topj_raw_t *raw = t1->raw;\t/* RAW component */\n\topj_mqc_t *mqc = t1->mqc;\t/* MQC component */\n\n\tflag = vsc ? ((*flagsp) & (~(T1_SIG_S | T1_SIG_SE | T1_SIG_SW | T1_SGN_S))) : (*flagsp);\n\tif ((flag & T1_SIG_OTH) && !(flag & (T1_SIG | T1_VISIT))) {\n\t\tif (type == T1_TYPE_RAW) {\n\t\t\tif (opj_raw_decode(raw)) {\n\t\t\t\tv = opj_raw_decode(raw);\t/* ESSAI */\n\t\t\t\t*datap = v ? -oneplushalf : oneplushalf;\n\t\t\t\topj_t1_updateflags(flagsp, v, t1->flags_stride);\n\t\t\t}\n\t\t} else {\n\t\t\topj_mqc_setcurctx(mqc, opj_t1_getctxno_zc(flag, orient));\n\t\t\tif (opj_mqc_decode(mqc)) {\n\t\t\t\topj_mqc_setcurctx(mqc, opj_t1_getctxno_sc(flag));\n\t\t\t\tv = opj_mqc_decode(mqc) ^ opj_t1_getspb(flag);\n\t\t\t\t*datap = v ? -oneplushalf : oneplushalf;\n\t\t\t\topj_t1_updateflags(flagsp, v, t1->flags_stride);\n\t\t\t}\n\t\t}\n\t\t*flagsp |= T1_VISIT;\n\t}\n}\t\t\t\t/* VSC and  BYPASS by Antonin */\n#endif\n"
  },
  {
    "path": "ext/openjpeg/t1.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n#ifndef __T1_H\n#define __T1_H\n/**\n@file t1.h\n@brief Implementation of the tier-1 coding (coding of code-block coefficients) (T1)\n\nThe functions in T1.C have for goal to realize the tier-1 coding operation. The functions\nin T1.C are used by some function in TCD.C.\n*/\n\n/** @defgroup T1 T1 - Implementation of the tier-1 coding */\n/*@{*/\n\n/* ----------------------------------------------------------------------- */\n#define T1_NMSEDEC_BITS 7\n\n#define T1_SIG_NE 0x0001\t/**< Context orientation : North-East direction */\n#define T1_SIG_SE 0x0002\t/**< Context orientation : South-East direction */\n#define T1_SIG_SW 0x0004\t/**< Context orientation : South-West direction */\n#define T1_SIG_NW 0x0008\t/**< Context orientation : North-West direction */\n#define T1_SIG_N 0x0010\t\t/**< Context orientation : North direction */\n#define T1_SIG_E 0x0020\t\t/**< Context orientation : East direction */\n#define T1_SIG_S 0x0040\t\t/**< Context orientation : South direction */\n#define T1_SIG_W 0x0080\t\t/**< Context orientation : West direction */\n#define T1_SIG_OTH (T1_SIG_N|T1_SIG_NE|T1_SIG_E|T1_SIG_SE|T1_SIG_S|T1_SIG_SW|T1_SIG_W|T1_SIG_NW)\n#define T1_SIG_PRIM (T1_SIG_N|T1_SIG_E|T1_SIG_S|T1_SIG_W)\n\n#define T1_SGN_N 0x0100\n#define T1_SGN_E 0x0200\n#define T1_SGN_S 0x0400\n#define T1_SGN_W 0x0800\n#define T1_SGN (T1_SGN_N|T1_SGN_E|T1_SGN_S|T1_SGN_W)\n\n#define T1_SIG 0x1000\n#define T1_REFINE 0x2000\n#define T1_VISIT 0x4000\n\n#define T1_NUMCTXS_ZC 9\n#define T1_NUMCTXS_SC 5\n#define T1_NUMCTXS_MAG 3\n#define T1_NUMCTXS_AGG 1\n#define T1_NUMCTXS_UNI 1\n\n#define T1_CTXNO_ZC 0\n#define T1_CTXNO_SC (T1_CTXNO_ZC+T1_NUMCTXS_ZC)\n#define T1_CTXNO_MAG (T1_CTXNO_SC+T1_NUMCTXS_SC)\n#define T1_CTXNO_AGG (T1_CTXNO_MAG+T1_NUMCTXS_MAG)\n#define T1_CTXNO_UNI (T1_CTXNO_AGG+T1_NUMCTXS_AGG)\n#define T1_NUMCTXS (T1_CTXNO_UNI+T1_NUMCTXS_UNI)\n\n#define T1_NMSEDEC_FRACBITS (T1_NMSEDEC_BITS-1)\n\n#define T1_TYPE_MQ 0\t/**< Normal coding using entropy coder */\n#define T1_TYPE_RAW 1\t/**< No encoding the information is store under raw format in codestream (mode switch RAW)*/\n\n/* ----------------------------------------------------------------------- */\n\ntypedef OPJ_INT16 opj_flag_t;\n\n/**\nTier-1 coding (coding of code-block coefficients)\n*/\ntypedef struct opj_t1 {\n\n\t/** MQC component */\n\topj_mqc_t *mqc;\n\t/** RAW component */\n\topj_raw_t *raw;\n\n    OPJ_INT32 *data;\n\topj_flag_t *flags;\n\tOPJ_UINT32 w;\n\tOPJ_UINT32 h;\n\tOPJ_UINT32 datasize;\n\tOPJ_UINT32 flagssize;\n\tOPJ_UINT32 flags_stride;\n} opj_t1_t;\n\n#define MACRO_t1_flags(x,y) t1->flags[((x)*(t1->flags_stride))+(y)]\n\n/** @name Exported functions */\n/*@{*/\n/* ----------------------------------------------------------------------- */\n\n/**\nEncode the code-blocks of a tile\n@param t1 T1 handle\n@param tile The tile to encode\n@param tcp Tile coding parameters\n@param mct_norms  FIXME DOC\n*/\nOPJ_BOOL opj_t1_encode_cblks(   opj_t1_t *t1,\n                                opj_tcd_tile_t *tile,\n                                opj_tcp_t *tcp,\n                                const OPJ_FLOAT64 * mct_norms);\n\n/**\nDecode the code-blocks of a tile\n@param t1 T1 handle\n@param tilec The tile to decode\n@param tccp Tile coding parameters\n*/\nOPJ_BOOL opj_t1_decode_cblks(   opj_t1_t* t1,\n                                opj_tcd_tilecomp_t* tilec,\n                                opj_tccp_t* tccp);\n\n\n\n/**\n * Creates a new Tier 1 handle\n * and initializes the look-up tables of the Tier-1 coder/decoder\n * @return a new T1 handle if successful, returns NULL otherwise\n*/\nopj_t1_t* opj_t1_create(void);\n\n/**\n * Destroys a previously created T1 handle\n *\n * @param p_t1 Tier 1 handle to destroy\n*/\nvoid opj_t1_destroy(opj_t1_t *p_t1);\n/* ----------------------------------------------------------------------- */\n/*@}*/\n\n/*@}*/\n\n#endif /* __T1_H */\n"
  },
  {
    "path": "ext/openjpeg/t1_generate_luts.c",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2007, Callum Lerwick <seg@haxxed.com>\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include \"opj_includes.h\"\n\nstatic int t1_init_ctxno_zc(int f, int orient) {\n\tint h, v, d, n, t, hv;\n\tn = 0;\n\th = ((f & T1_SIG_W) != 0) + ((f & T1_SIG_E) != 0);\n\tv = ((f & T1_SIG_N) != 0) + ((f & T1_SIG_S) != 0);\n\td = ((f & T1_SIG_NW) != 0) + ((f & T1_SIG_NE) != 0) + ((f & T1_SIG_SE) != 0) + ((f & T1_SIG_SW) != 0);\n\n\tswitch (orient) {\n\t\tcase 2:\n\t\t\tt = h;\n\t\t\th = v;\n\t\t\tv = t;\n\t\tcase 0:\n\t\tcase 1:\n\t\t\tif (!h) {\n\t\t\t\tif (!v) {\n\t\t\t\t\tif (!d)\n\t\t\t\t\t\tn = 0;\n\t\t\t\t\telse if (d == 1)\n\t\t\t\t\t\tn = 1;\n\t\t\t\t\telse\n\t\t\t\t\t\tn = 2;\n\t\t\t\t} else if (v == 1) {\n\t\t\t\t\tn = 3;\n\t\t\t\t} else {\n\t\t\t\t\tn = 4;\n\t\t\t\t}\n\t\t\t} else if (h == 1) {\n\t\t\t\tif (!v) {\n\t\t\t\t\tif (!d)\n\t\t\t\t\t\tn = 5;\n\t\t\t\t\telse\n\t\t\t\t\t\tn = 6;\n\t\t\t\t} else {\n\t\t\t\t\tn = 7;\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\tn = 8;\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\thv = h + v;\n\t\t\tif (!d) {\n\t\t\t\tif (!hv) {\n\t\t\t\t\tn = 0;\n\t\t\t\t} else if (hv == 1) {\n\t\t\t\t\tn = 1;\n\t\t\t\t} else {\n\t\t\t\t\tn = 2;\n\t\t\t\t}\n\t\t\t} else if (d == 1) {\n\t\t\t\tif (!hv) {\n\t\t\t\t\tn = 3;\n\t\t\t\t} else if (hv == 1) {\n\t\t\t\t\tn = 4;\n\t\t\t\t} else {\n\t\t\t\t\tn = 5;\n\t\t\t\t}\n\t\t\t} else if (d == 2) {\n\t\t\t\tif (!hv) {\n\t\t\t\t\tn = 6;\n\t\t\t\t} else {\n\t\t\t\t\tn = 7;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tn = 8;\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\treturn (T1_CTXNO_ZC + n);\n}\n\nstatic int t1_init_ctxno_sc(int f) {\n\tint hc, vc, n;\n\tn = 0;\n\n\thc = opj_int_min(((f & (T1_SIG_E | T1_SGN_E)) ==\n\t\t\t\tT1_SIG_E) + ((f & (T1_SIG_W | T1_SGN_W)) == T1_SIG_W),\n\t\t\t1) - opj_int_min(((f & (T1_SIG_E | T1_SGN_E)) ==\n\t\t\t\t\t(T1_SIG_E | T1_SGN_E)) +\n\t\t\t\t((f & (T1_SIG_W | T1_SGN_W)) ==\n\t\t\t\t (T1_SIG_W | T1_SGN_W)), 1);\n\n\tvc = opj_int_min(((f & (T1_SIG_N | T1_SGN_N)) ==\n\t\t\t\tT1_SIG_N) + ((f & (T1_SIG_S | T1_SGN_S)) == T1_SIG_S),\n\t\t\t1) - opj_int_min(((f & (T1_SIG_N | T1_SGN_N)) ==\n\t\t\t\t\t(T1_SIG_N | T1_SGN_N)) +\n\t\t\t\t((f & (T1_SIG_S | T1_SGN_S)) ==\n\t\t\t\t (T1_SIG_S | T1_SGN_S)), 1);\n\n\tif (hc < 0) {\n\t\thc = -hc;\n\t\tvc = -vc;\n\t}\n\tif (!hc) {\n\t\tif (vc == -1)\n\t\t\tn = 1;\n\t\telse if (!vc)\n\t\t\tn = 0;\n\t\telse\n\t\t\tn = 1;\n\t} else if (hc == 1) {\n\t\tif (vc == -1)\n\t\t\tn = 2;\n\t\telse if (!vc)\n\t\t\tn = 3;\n\t\telse\n\t\t\tn = 4;\n\t}\n\n\treturn (T1_CTXNO_SC + n);\n}\n\nstatic int t1_init_spb(int f) {\n\tint hc, vc, n;\n\n\thc = opj_int_min(((f & (T1_SIG_E | T1_SGN_E)) ==\n\t\t\t\tT1_SIG_E) + ((f & (T1_SIG_W | T1_SGN_W)) == T1_SIG_W),\n\t\t\t1) - opj_int_min(((f & (T1_SIG_E | T1_SGN_E)) ==\n\t\t\t\t\t(T1_SIG_E | T1_SGN_E)) +\n\t\t\t\t((f & (T1_SIG_W | T1_SGN_W)) ==\n\t\t\t\t (T1_SIG_W | T1_SGN_W)), 1);\n\n\tvc = opj_int_min(((f & (T1_SIG_N | T1_SGN_N)) ==\n\t\t\t\tT1_SIG_N) + ((f & (T1_SIG_S | T1_SGN_S)) == T1_SIG_S),\n\t\t\t1) - opj_int_min(((f & (T1_SIG_N | T1_SGN_N)) ==\n\t\t\t\t\t(T1_SIG_N | T1_SGN_N)) +\n\t\t\t\t((f & (T1_SIG_S | T1_SGN_S)) ==\n\t\t\t\t (T1_SIG_S | T1_SGN_S)), 1);\n\n\tif (!hc && !vc)\n\t\tn = 0;\n\telse\n\t\tn = (!(hc > 0 || (!hc && vc > 0)));\n\n\treturn n;\n}\n\nstatic void dump_array16(int array[],int size){\n\tint i;\n\t--size;\n\tfor (i = 0; i < size; ++i) {\n\t\tprintf(\"0x%04x, \", array[i]);\n\t\tif(!((i+1)&0x7))\n\t\t\tprintf(\"\\n  \");\n\t}\n\tprintf(\"0x%04x\\n};\\n\\n\", array[size]);\n}\n\nint main(int argc, char **argv)\n{\n\tint i, j;\n\tdouble u, v, t;\n\n\tint lut_ctxno_zc[1024];\n\tint lut_nmsedec_sig[1 << T1_NMSEDEC_BITS];\n\tint lut_nmsedec_sig0[1 << T1_NMSEDEC_BITS];\n\tint lut_nmsedec_ref[1 << T1_NMSEDEC_BITS];\n\tint lut_nmsedec_ref0[1 << T1_NMSEDEC_BITS];\n  (void)argc; (void)argv;\n\n\tprintf(\"/* This file was automatically generated by t1_generate_luts.c */\\n\\n\");\n\n\t/* lut_ctxno_zc */\n\tfor (j = 0; j < 4; ++j) {\n\t\tfor (i = 0; i < 256; ++i) {\n\t\t\tint orient = j;\n\t\t\tif (orient == 2) {\n\t\t\t\torient = 1;\n\t\t\t} else if (orient == 1) {\n\t\t\t\torient = 2;\n\t\t\t}\n\t\t\tlut_ctxno_zc[(orient << 8) | i] = t1_init_ctxno_zc(i, j);\n\t\t}\n\t}\n\n\tprintf(\"static OPJ_BYTE lut_ctxno_zc[1024] = {\\n  \");\n\tfor (i = 0; i < 1023; ++i) {\n\t\tprintf(\"%i, \", lut_ctxno_zc[i]);\n\t\tif(!((i+1)&0x1f))\n\t\t\tprintf(\"\\n  \");\n\t}\n\tprintf(\"%i\\n};\\n\\n\", lut_ctxno_zc[1023]);\n\n\t/* lut_ctxno_sc */\n\tprintf(\"static OPJ_BYTE lut_ctxno_sc[256] = {\\n  \");\n\tfor (i = 0; i < 255; ++i) {\n\t\tprintf(\"0x%x, \", t1_init_ctxno_sc(i << 4));\n\t\tif(!((i+1)&0xf))\n\t\t\tprintf(\"\\n  \");\n\t}\n\tprintf(\"0x%x\\n};\\n\\n\", t1_init_ctxno_sc(255 << 4));\n\n\t/* lut_spb */\n\tprintf(\"static OPJ_BYTE lut_spb[256] = {\\n  \");\n\tfor (i = 0; i < 255; ++i) {\n\t\tprintf(\"%i, \", t1_init_spb(i << 4));\n\t\tif(!((i+1)&0x1f))\n\t\t\tprintf(\"\\n  \");\n\t}\n\tprintf(\"%i\\n};\\n\\n\", t1_init_spb(255 << 4));\n\n\t/* FIXME FIXME FIXME */\n\t/* fprintf(stdout,\"nmsedec luts:\\n\"); */\n\tfor (i = 0; i < (1 << T1_NMSEDEC_BITS); ++i) {\n\t\tt = i / pow(2, T1_NMSEDEC_FRACBITS);\n\t\tu = t;\n\t\tv = t - 1.5;\n\t\tlut_nmsedec_sig[i] = \n\t\t\topj_int_max(0, \n\t\t\t\t\t(int) (floor((u * u - v * v) * pow(2, T1_NMSEDEC_FRACBITS) + 0.5) / pow(2, T1_NMSEDEC_FRACBITS) * 8192.0));\n\t\tlut_nmsedec_sig0[i] =\n\t\t\topj_int_max(0,\n\t\t\t\t\t(int) (floor((u * u) * pow(2, T1_NMSEDEC_FRACBITS) + 0.5) / pow(2, T1_NMSEDEC_FRACBITS) * 8192.0));\n\t\tu = t - 1.0;\n\t\tif (i & (1 << (T1_NMSEDEC_BITS - 1))) {\n\t\t\tv = t - 1.5;\n\t\t} else {\n\t\t\tv = t - 0.5;\n\t\t}\n\t\tlut_nmsedec_ref[i] =\n\t\t\topj_int_max(0,\n\t\t\t\t\t(int) (floor((u * u - v * v) * pow(2, T1_NMSEDEC_FRACBITS) + 0.5) / pow(2, T1_NMSEDEC_FRACBITS) * 8192.0));\n\t\tlut_nmsedec_ref0[i] =\n\t\t\topj_int_max(0,\n\t\t\t\t\t(int) (floor((u * u) * pow(2, T1_NMSEDEC_FRACBITS) + 0.5) / pow(2, T1_NMSEDEC_FRACBITS) * 8192.0));\n\t}\n\n\tprintf(\"static OPJ_INT16 lut_nmsedec_sig[1 << T1_NMSEDEC_BITS] = {\\n  \");\n\tdump_array16(lut_nmsedec_sig, 1 << T1_NMSEDEC_BITS);\n\n\tprintf(\"static OPJ_INT16 lut_nmsedec_sig0[1 << T1_NMSEDEC_BITS] = {\\n  \");\n\tdump_array16(lut_nmsedec_sig0, 1 << T1_NMSEDEC_BITS);\n\n\tprintf(\"static OPJ_INT16 lut_nmsedec_ref[1 << T1_NMSEDEC_BITS] = {\\n  \");\n\tdump_array16(lut_nmsedec_ref, 1 << T1_NMSEDEC_BITS);\n\n\tprintf(\"static OPJ_INT16 lut_nmsedec_ref0[1 << T1_NMSEDEC_BITS] = {\\n  \");\n\tdump_array16(lut_nmsedec_ref0, 1 << T1_NMSEDEC_BITS);\n\n\treturn 0;\n}\n"
  },
  {
    "path": "ext/openjpeg/t1_luts.h",
    "content": "/* This file was automatically generated by t1_generate_luts.c */\n\nstatic OPJ_BYTE lut_ctxno_zc[1024] = {\n  0, 1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, \n  5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \n  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, \n  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \n  5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \n  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, \n  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \n  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, \n  0, 1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, \n  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \n  5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, \n  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, \n  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \n  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \n  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, \n  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, \n  0, 1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, \n  5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \n  3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, \n  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \n  5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \n  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, \n  7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \n  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, \n  0, 3, 3, 6, 3, 6, 6, 8, 3, 6, 6, 8, 6, 8, 8, 8, 1, 4, 4, 7, 4, 7, 7, 8, 4, 7, 7, 8, 7, 8, 8, 8, \n  1, 4, 4, 7, 4, 7, 7, 8, 4, 7, 7, 8, 7, 8, 8, 8, 2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8, \n  1, 4, 4, 7, 4, 7, 7, 8, 4, 7, 7, 8, 7, 8, 8, 8, 2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8, \n  2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8, 2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8, \n  1, 4, 4, 7, 4, 7, 7, 8, 4, 7, 7, 8, 7, 8, 8, 8, 2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8, \n  2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8, 2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8, \n  2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8, 2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8, \n  2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8, 2, 5, 5, 7, 5, 7, 7, 8, 5, 7, 7, 8, 7, 8, 8, 8\n};\n\nstatic OPJ_BYTE lut_ctxno_sc[256] = {\n  0x9, 0xa, 0xc, 0xd, 0xa, 0xa, 0xd, 0xd, 0xc, 0xd, 0xc, 0xd, 0xd, 0xd, 0xd, 0xd, \n  0x9, 0xa, 0xc, 0xb, 0xa, 0x9, 0xd, 0xc, 0xc, 0xb, 0xc, 0xb, 0xd, 0xc, 0xd, 0xc, \n  0x9, 0xa, 0xc, 0xb, 0xa, 0xa, 0xb, 0xb, 0xc, 0xd, 0x9, 0xa, 0xd, 0xd, 0xa, 0xa, \n  0x9, 0xa, 0xc, 0xd, 0xa, 0x9, 0xb, 0xc, 0xc, 0xb, 0x9, 0xa, 0xd, 0xc, 0xa, 0x9, \n  0x9, 0xa, 0xc, 0xd, 0xa, 0x9, 0xb, 0xc, 0xc, 0xd, 0xc, 0xd, 0xb, 0xc, 0xb, 0xc, \n  0x9, 0xa, 0xc, 0xb, 0xa, 0xa, 0xb, 0xb, 0xc, 0xb, 0xc, 0xb, 0xb, 0xb, 0xb, 0xb, \n  0x9, 0xa, 0xc, 0xb, 0xa, 0x9, 0xd, 0xc, 0xc, 0xd, 0x9, 0xa, 0xb, 0xc, 0xa, 0x9, \n  0x9, 0xa, 0xc, 0xd, 0xa, 0xa, 0xd, 0xd, 0xc, 0xb, 0x9, 0xa, 0xb, 0xb, 0xa, 0xa, \n  0x9, 0xa, 0xc, 0xd, 0xa, 0xa, 0xd, 0xd, 0xc, 0xb, 0x9, 0xa, 0xb, 0xb, 0xa, 0xa, \n  0x9, 0xa, 0xc, 0xb, 0xa, 0x9, 0xd, 0xc, 0xc, 0xd, 0x9, 0xa, 0xb, 0xc, 0xa, 0x9, \n  0x9, 0xa, 0xc, 0xb, 0xa, 0xa, 0xb, 0xb, 0xc, 0xb, 0xc, 0xb, 0xb, 0xb, 0xb, 0xb, \n  0x9, 0xa, 0xc, 0xd, 0xa, 0x9, 0xb, 0xc, 0xc, 0xd, 0xc, 0xd, 0xb, 0xc, 0xb, 0xc, \n  0x9, 0xa, 0xc, 0xd, 0xa, 0x9, 0xb, 0xc, 0xc, 0xb, 0x9, 0xa, 0xd, 0xc, 0xa, 0x9, \n  0x9, 0xa, 0xc, 0xb, 0xa, 0xa, 0xb, 0xb, 0xc, 0xd, 0x9, 0xa, 0xd, 0xd, 0xa, 0xa, \n  0x9, 0xa, 0xc, 0xb, 0xa, 0x9, 0xd, 0xc, 0xc, 0xb, 0xc, 0xb, 0xd, 0xc, 0xd, 0xc, \n  0x9, 0xa, 0xc, 0xd, 0xa, 0xa, 0xd, 0xd, 0xc, 0xd, 0xc, 0xd, 0xd, 0xd, 0xd, 0xd\n};\n\nstatic OPJ_BYTE lut_spb[256] = {\n  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \n  0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, \n  0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \n  0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, \n  0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, \n  0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \n  0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, \n  0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n};\n\nstatic OPJ_INT16 lut_nmsedec_sig[1 << T1_NMSEDEC_BITS] = {\n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, \n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, \n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, \n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, \n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, \n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, \n  0x0000, 0x0180, 0x0300, 0x0480, 0x0600, 0x0780, 0x0900, 0x0a80, \n  0x0c00, 0x0d80, 0x0f00, 0x1080, 0x1200, 0x1380, 0x1500, 0x1680, \n  0x1800, 0x1980, 0x1b00, 0x1c80, 0x1e00, 0x1f80, 0x2100, 0x2280, \n  0x2400, 0x2580, 0x2700, 0x2880, 0x2a00, 0x2b80, 0x2d00, 0x2e80, \n  0x3000, 0x3180, 0x3300, 0x3480, 0x3600, 0x3780, 0x3900, 0x3a80, \n  0x3c00, 0x3d80, 0x3f00, 0x4080, 0x4200, 0x4380, 0x4500, 0x4680, \n  0x4800, 0x4980, 0x4b00, 0x4c80, 0x4e00, 0x4f80, 0x5100, 0x5280, \n  0x5400, 0x5580, 0x5700, 0x5880, 0x5a00, 0x5b80, 0x5d00, 0x5e80, \n  0x6000, 0x6180, 0x6300, 0x6480, 0x6600, 0x6780, 0x6900, 0x6a80, \n  0x6c00, 0x6d80, 0x6f00, 0x7080, 0x7200, 0x7380, 0x7500, 0x7680\n};\n\nstatic OPJ_INT16 lut_nmsedec_sig0[1 << T1_NMSEDEC_BITS] = {\n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0080, 0x0080, \n  0x0080, 0x0080, 0x0100, 0x0100, 0x0100, 0x0180, 0x0180, 0x0200, \n  0x0200, 0x0280, 0x0280, 0x0300, 0x0300, 0x0380, 0x0400, 0x0400, \n  0x0480, 0x0500, 0x0580, 0x0580, 0x0600, 0x0680, 0x0700, 0x0780, \n  0x0800, 0x0880, 0x0900, 0x0980, 0x0a00, 0x0a80, 0x0b80, 0x0c00, \n  0x0c80, 0x0d00, 0x0e00, 0x0e80, 0x0f00, 0x1000, 0x1080, 0x1180, \n  0x1200, 0x1300, 0x1380, 0x1480, 0x1500, 0x1600, 0x1700, 0x1780, \n  0x1880, 0x1980, 0x1a80, 0x1b00, 0x1c00, 0x1d00, 0x1e00, 0x1f00, \n  0x2000, 0x2100, 0x2200, 0x2300, 0x2400, 0x2500, 0x2680, 0x2780, \n  0x2880, 0x2980, 0x2b00, 0x2c00, 0x2d00, 0x2e80, 0x2f80, 0x3100, \n  0x3200, 0x3380, 0x3480, 0x3600, 0x3700, 0x3880, 0x3a00, 0x3b00, \n  0x3c80, 0x3e00, 0x3f80, 0x4080, 0x4200, 0x4380, 0x4500, 0x4680, \n  0x4800, 0x4980, 0x4b00, 0x4c80, 0x4e00, 0x4f80, 0x5180, 0x5300, \n  0x5480, 0x5600, 0x5800, 0x5980, 0x5b00, 0x5d00, 0x5e80, 0x6080, \n  0x6200, 0x6400, 0x6580, 0x6780, 0x6900, 0x6b00, 0x6d00, 0x6e80, \n  0x7080, 0x7280, 0x7480, 0x7600, 0x7800, 0x7a00, 0x7c00, 0x7e00\n};\n\nstatic OPJ_INT16 lut_nmsedec_ref[1 << T1_NMSEDEC_BITS] = {\n  0x1800, 0x1780, 0x1700, 0x1680, 0x1600, 0x1580, 0x1500, 0x1480, \n  0x1400, 0x1380, 0x1300, 0x1280, 0x1200, 0x1180, 0x1100, 0x1080, \n  0x1000, 0x0f80, 0x0f00, 0x0e80, 0x0e00, 0x0d80, 0x0d00, 0x0c80, \n  0x0c00, 0x0b80, 0x0b00, 0x0a80, 0x0a00, 0x0980, 0x0900, 0x0880, \n  0x0800, 0x0780, 0x0700, 0x0680, 0x0600, 0x0580, 0x0500, 0x0480, \n  0x0400, 0x0380, 0x0300, 0x0280, 0x0200, 0x0180, 0x0100, 0x0080, \n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, \n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, \n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, \n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, \n  0x0000, 0x0080, 0x0100, 0x0180, 0x0200, 0x0280, 0x0300, 0x0380, \n  0x0400, 0x0480, 0x0500, 0x0580, 0x0600, 0x0680, 0x0700, 0x0780, \n  0x0800, 0x0880, 0x0900, 0x0980, 0x0a00, 0x0a80, 0x0b00, 0x0b80, \n  0x0c00, 0x0c80, 0x0d00, 0x0d80, 0x0e00, 0x0e80, 0x0f00, 0x0f80, \n  0x1000, 0x1080, 0x1100, 0x1180, 0x1200, 0x1280, 0x1300, 0x1380, \n  0x1400, 0x1480, 0x1500, 0x1580, 0x1600, 0x1680, 0x1700, 0x1780\n};\n\nstatic OPJ_INT16 lut_nmsedec_ref0[1 << T1_NMSEDEC_BITS] = {\n  0x2000, 0x1f00, 0x1e00, 0x1d00, 0x1c00, 0x1b00, 0x1a80, 0x1980, \n  0x1880, 0x1780, 0x1700, 0x1600, 0x1500, 0x1480, 0x1380, 0x1300, \n  0x1200, 0x1180, 0x1080, 0x1000, 0x0f00, 0x0e80, 0x0e00, 0x0d00, \n  0x0c80, 0x0c00, 0x0b80, 0x0a80, 0x0a00, 0x0980, 0x0900, 0x0880, \n  0x0800, 0x0780, 0x0700, 0x0680, 0x0600, 0x0580, 0x0580, 0x0500, \n  0x0480, 0x0400, 0x0400, 0x0380, 0x0300, 0x0300, 0x0280, 0x0280, \n  0x0200, 0x0200, 0x0180, 0x0180, 0x0100, 0x0100, 0x0100, 0x0080, \n  0x0080, 0x0080, 0x0080, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, \n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0080, 0x0080, \n  0x0080, 0x0080, 0x0100, 0x0100, 0x0100, 0x0180, 0x0180, 0x0200, \n  0x0200, 0x0280, 0x0280, 0x0300, 0x0300, 0x0380, 0x0400, 0x0400, \n  0x0480, 0x0500, 0x0580, 0x0580, 0x0600, 0x0680, 0x0700, 0x0780, \n  0x0800, 0x0880, 0x0900, 0x0980, 0x0a00, 0x0a80, 0x0b80, 0x0c00, \n  0x0c80, 0x0d00, 0x0e00, 0x0e80, 0x0f00, 0x1000, 0x1080, 0x1180, \n  0x1200, 0x1300, 0x1380, 0x1480, 0x1500, 0x1600, 0x1700, 0x1780, \n  0x1880, 0x1980, 0x1a80, 0x1b00, 0x1c00, 0x1d00, 0x1e00, 0x1f00\n};\n\n"
  },
  {
    "path": "ext/openjpeg/t2.c",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR \n * Copyright (c) 2012, CS Systemes d'Information, France\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include \"opj_includes.h\"\n\n/** @defgroup T2 T2 - Implementation of a tier-2 coding */\n/*@{*/\n\n/** @name Local static functions */\n/*@{*/\n\nstatic void opj_t2_putcommacode(opj_bio_t *bio, OPJ_INT32 n);\n\nstatic OPJ_UINT32 opj_t2_getcommacode(opj_bio_t *bio); \n/**\nVariable length code for signalling delta Zil (truncation point)\n@param bio  Bit Input/Output component\n@param n    delta Zil\n*/\nstatic void opj_t2_putnumpasses(opj_bio_t *bio, OPJ_UINT32 n);\nstatic OPJ_UINT32 opj_t2_getnumpasses(opj_bio_t *bio);\n\n/**\nEncode a packet of a tile to a destination buffer\n@param tileno Number of the tile encoded\n@param tile Tile for which to write the packets\n@param tcp Tile coding parameters\n@param pi Packet identity\n@param dest Destination buffer\n@param p_data_written   FIXME DOC\n@param len Length of the destination buffer\n@param cstr_info Codestream information structure\n@return\n*/\nstatic OPJ_BOOL opj_t2_encode_packet(   OPJ_UINT32 tileno,\n                                        opj_tcd_tile_t *tile,\n                                        opj_tcp_t *tcp,\n                                        opj_pi_iterator_t *pi,\n                                        OPJ_BYTE *dest,\n                                        OPJ_UINT32 * p_data_written,\n                                        OPJ_UINT32 len,\n                                        opj_codestream_info_t *cstr_info);\n\n/**\nDecode a packet of a tile from a source buffer\n@param t2 T2 handle\n@param tile Tile for which to write the packets\n@param tcp Tile coding parameters\n@param pi Packet identity\n@param src Source buffer\n@param data_read   FIXME DOC\n@param max_length  FIXME DOC\n@param pack_info Packet information\n\n@return  FIXME DOC\n*/\nstatic OPJ_BOOL opj_t2_decode_packet(   opj_t2_t* t2,\n                                        opj_tcd_tile_t *tile,\n                                        opj_tcp_t *tcp,\n                                        opj_pi_iterator_t *pi,\n                                        OPJ_BYTE *src,\n                                        OPJ_UINT32 * data_read,\n                                        OPJ_UINT32 max_length,\n                                        opj_packet_info_t *pack_info);\n\nstatic OPJ_BOOL opj_t2_skip_packet( opj_t2_t* p_t2,\n                                    opj_tcd_tile_t *p_tile,\n                                    opj_tcp_t *p_tcp,\n                                    opj_pi_iterator_t *p_pi,\n                                    OPJ_BYTE *p_src,\n                                    OPJ_UINT32 * p_data_read,\n                                    OPJ_UINT32 p_max_length,\n                                    opj_packet_info_t *p_pack_info);\n\nstatic OPJ_BOOL opj_t2_read_packet_header(  opj_t2_t* p_t2,\n                                            opj_tcd_tile_t *p_tile,\n                                            opj_tcp_t *p_tcp,\n                                            opj_pi_iterator_t *p_pi,\n                                            OPJ_BOOL * p_is_data_present,\n                                            OPJ_BYTE *p_src_data,\n                                            OPJ_UINT32 * p_data_read,\n                                            OPJ_UINT32 p_max_length,\n                                            opj_packet_info_t *p_pack_info);\n\nstatic OPJ_BOOL opj_t2_read_packet_data(opj_t2_t* p_t2,\n                                        opj_tcd_tile_t *p_tile,\n                                        opj_pi_iterator_t *p_pi,\n                                        OPJ_BYTE *p_src_data,\n                                        OPJ_UINT32 * p_data_read,\n                                        OPJ_UINT32 p_max_length,\n                                        opj_packet_info_t *pack_info);\n\nstatic OPJ_BOOL opj_t2_skip_packet_data(opj_t2_t* p_t2,\n                                        opj_tcd_tile_t *p_tile,\n                                        opj_pi_iterator_t *p_pi,\n                                        OPJ_UINT32 * p_data_read,\n                                        OPJ_UINT32 p_max_length,\n                                        opj_packet_info_t *pack_info);\n\n/**\n@param cblk\n@param index\n@param cblksty\n@param first\n*/\nstatic OPJ_BOOL opj_t2_init_seg(    opj_tcd_cblk_dec_t* cblk,\n                                    OPJ_UINT32 index,\n                                    OPJ_UINT32 cblksty,\n                                    OPJ_UINT32 first);\n\n/*@}*/\n\n/*@}*/\n\n/* ----------------------------------------------------------------------- */\n\n/* #define RESTART 0x04 */\nstatic void opj_t2_putcommacode(opj_bio_t *bio, OPJ_INT32 n) {\n        while (--n >= 0) {\n                opj_bio_write(bio, 1, 1);\n        }\n        opj_bio_write(bio, 0, 1);\n}\n\nOPJ_UINT32 opj_t2_getcommacode(opj_bio_t *bio) \n{\n    OPJ_UINT32 n = 0;\n    while (opj_bio_read(bio, 1)) {\n\t    ++n;\n    }\n    return n;\n}\n\nvoid opj_t2_putnumpasses(opj_bio_t *bio, OPJ_UINT32 n) {\n        if (n == 1) {\n                opj_bio_write(bio, 0, 1);\n        } else if (n == 2) {\n                opj_bio_write(bio, 2, 2);\n        } else if (n <= 5) {\n                opj_bio_write(bio, 0xc | (n - 3), 4);\n        } else if (n <= 36) {\n                opj_bio_write(bio, 0x1e0 | (n - 6), 9);\n        } else if (n <= 164) {\n                opj_bio_write(bio, 0xff80 | (n - 37), 16);\n        }\n}\n\nOPJ_UINT32 opj_t2_getnumpasses(opj_bio_t *bio) {\n        OPJ_UINT32 n;\n        if (!opj_bio_read(bio, 1))\n                return 1;\n        if (!opj_bio_read(bio, 1))\n                return 2;\n        if ((n = opj_bio_read(bio, 2)) != 3)\n                return (3 + n);\n        if ((n = opj_bio_read(bio, 5)) != 31)\n                return (6 + n);\n        return (37 + opj_bio_read(bio, 7));\n}\n\n/* ----------------------------------------------------------------------- */\n\nOPJ_BOOL opj_t2_encode_packets( opj_t2_t* p_t2,\n                                OPJ_UINT32 p_tile_no,\n                                opj_tcd_tile_t *p_tile,\n                                OPJ_UINT32 p_maxlayers,\n                                OPJ_BYTE *p_dest,\n                                OPJ_UINT32 * p_data_written,\n                                OPJ_UINT32 p_max_len,\n                                opj_codestream_info_t *cstr_info,\n                                OPJ_UINT32 p_tp_num,\n                                OPJ_INT32 p_tp_pos,\n                                OPJ_UINT32 p_pino,\n                                J2K_T2_MODE p_t2_mode)\n{\n        OPJ_BYTE *l_current_data = p_dest;\n        OPJ_UINT32 l_nb_bytes = 0;\n        OPJ_UINT32 compno;\n        OPJ_UINT32 poc;\n        opj_pi_iterator_t *l_pi = 00;\n        opj_pi_iterator_t *l_current_pi = 00;\n        opj_image_t *l_image = p_t2->image;\n        opj_cp_t *l_cp = p_t2->cp;\n        opj_tcp_t *l_tcp = &l_cp->tcps[p_tile_no];\n        OPJ_UINT32 pocno = (l_cp->rsiz == OPJ_PROFILE_CINEMA_4K)? 2: 1;\n        OPJ_UINT32 l_max_comp = l_cp->m_specific_param.m_enc.m_max_comp_size > 0 ? l_image->numcomps : 1;\n        OPJ_UINT32 l_nb_pocs = l_tcp->numpocs + 1;\n\n        l_pi = opj_pi_initialise_encode(l_image, l_cp, p_tile_no, p_t2_mode);\n        if (!l_pi) {\n                return OPJ_FALSE;\n        }\n\n        * p_data_written = 0;\n\n        if (p_t2_mode == THRESH_CALC ){ /* Calculating threshold */\n                l_current_pi = l_pi;\n\n                for     (compno = 0; compno < l_max_comp; ++compno) {\n                        OPJ_UINT32 l_comp_len = 0;\n                        l_current_pi = l_pi;\n\n                        for (poc = 0; poc < pocno ; ++poc) {\n                                OPJ_UINT32 l_tp_num = compno;\n\n                                /* TODO MSD : check why this function cannot fail (cf. v1) */\n                                opj_pi_create_encode(l_pi, l_cp,p_tile_no,poc,l_tp_num,p_tp_pos,p_t2_mode);\n\n                                while (opj_pi_next(l_current_pi)) {\n                                        if (l_current_pi->layno < p_maxlayers) {\n                                                l_nb_bytes = 0;\n\n                                                if (! opj_t2_encode_packet(p_tile_no,p_tile, l_tcp, l_current_pi, l_current_data, &l_nb_bytes, p_max_len, cstr_info)) {\n                                                        opj_pi_destroy(l_pi, l_nb_pocs);\n                                                        return OPJ_FALSE;\n                                                }\n\n                                                l_comp_len += l_nb_bytes;\n                                                l_current_data += l_nb_bytes;\n                                                p_max_len -= l_nb_bytes;\n\n                                                * p_data_written += l_nb_bytes;\n                                        }\n                                }\n\n                                if (l_cp->m_specific_param.m_enc.m_max_comp_size) {\n                                        if (l_comp_len > l_cp->m_specific_param.m_enc.m_max_comp_size) {\n                                                opj_pi_destroy(l_pi, l_nb_pocs);\n                                                return OPJ_FALSE;\n                                        }\n                                }\n\n                                ++l_current_pi;\n                        }\n                }\n        }\n        else {  /* t2_mode == FINAL_PASS  */\n                opj_pi_create_encode(l_pi, l_cp,p_tile_no,p_pino,p_tp_num,p_tp_pos,p_t2_mode);\n\n                l_current_pi = &l_pi[p_pino];\n\n                while (opj_pi_next(l_current_pi)) {\n                        if (l_current_pi->layno < p_maxlayers) {\n                                l_nb_bytes=0;\n\n                                if (! opj_t2_encode_packet(p_tile_no,p_tile, l_tcp, l_current_pi, l_current_data, &l_nb_bytes, p_max_len, cstr_info)) {\n                                        opj_pi_destroy(l_pi, l_nb_pocs);\n                                        return OPJ_FALSE;\n                                }\n\n                                l_current_data += l_nb_bytes;\n                                p_max_len -= l_nb_bytes;\n\n                                * p_data_written += l_nb_bytes;\n\n                                /* INDEX >> */\n                                if(cstr_info) {\n                                        if(cstr_info->index_write) {\n                                                opj_tile_info_t *info_TL = &cstr_info->tile[p_tile_no];\n                                                opj_packet_info_t *info_PK = &info_TL->packet[cstr_info->packno];\n                                                if (!cstr_info->packno) {\n                                                        info_PK->start_pos = info_TL->end_header + 1;\n                                                } else {\n                                                        info_PK->start_pos = ((l_cp->m_specific_param.m_enc.m_tp_on | l_tcp->POC)&& info_PK->start_pos) ? info_PK->start_pos : info_TL->packet[cstr_info->packno - 1].end_pos + 1;\n                                                }\n                                                info_PK->end_pos = info_PK->start_pos + l_nb_bytes - 1;\n                                                info_PK->end_ph_pos += info_PK->start_pos - 1;  /* End of packet header which now only represents the distance\n                                                                                                                                                                                                                                                   to start of packet is incremented by value of start of packet*/\n                                        }\n\n                                        cstr_info->packno++;\n                                }\n                                /* << INDEX */\n                                ++p_tile->packno;\n                        }\n                }\n        }\n\n        opj_pi_destroy(l_pi, l_nb_pocs);\n\n        return OPJ_TRUE;\n}\n\n/* see issue 80 */\n#if 0\n#define JAS_FPRINTF fprintf\n#else\n/* issue 290 */\nstatic void opj_null_jas_fprintf(FILE* file, const char * format, ...)\n{\n  (void)file;\n  (void)format;\n}\n#define JAS_FPRINTF opj_null_jas_fprintf\n#endif\n\nOPJ_BOOL opj_t2_decode_packets( opj_t2_t *p_t2,\n                                OPJ_UINT32 p_tile_no,\n                                opj_tcd_tile_t *p_tile,\n                                OPJ_BYTE *p_src,\n                                OPJ_UINT32 * p_data_read,\n                                OPJ_UINT32 p_max_len,\n                                opj_codestream_index_t *p_cstr_index)\n{\n        OPJ_BYTE *l_current_data = p_src;\n        opj_pi_iterator_t *l_pi = 00;\n        OPJ_UINT32 pino;\n        opj_image_t *l_image = p_t2->image;\n        opj_cp_t *l_cp = p_t2->cp;\n        opj_tcp_t *l_tcp = &(p_t2->cp->tcps[p_tile_no]);\n        OPJ_UINT32 l_nb_bytes_read;\n        OPJ_UINT32 l_nb_pocs = l_tcp->numpocs + 1;\n        opj_pi_iterator_t *l_current_pi = 00;\n#ifdef TODO_MSD\n        OPJ_UINT32 curtp = 0;\n        OPJ_UINT32 tp_start_packno;\n#endif \n        opj_packet_info_t *l_pack_info = 00;\n        opj_image_comp_t* l_img_comp = 00;\n\n        OPJ_ARG_NOT_USED(p_cstr_index);\n\n#ifdef TODO_MSD\n        if (p_cstr_index) {\n                l_pack_info = p_cstr_index->tile_index[p_tile_no].packet;\n        }\n#endif\n\n        /* create a packet iterator */\n        l_pi = opj_pi_create_decode(l_image, l_cp, p_tile_no);\n        if (!l_pi) {\n                return OPJ_FALSE;\n        }\n\n\n        l_current_pi = l_pi;\n\n        for     (pino = 0; pino <= l_tcp->numpocs; ++pino) {\n\n                /* if the resolution needed is too low, one dim of the tilec could be equal to zero\n                 * and no packets are used to decode this resolution and\n                 * l_current_pi->resno is always >= p_tile->comps[l_current_pi->compno].minimum_num_resolutions\n                 * and no l_img_comp->resno_decoded are computed\n                 */\n                OPJ_BOOL* first_pass_failed = (OPJ_BOOL*)opj_malloc(l_image->numcomps * sizeof(OPJ_BOOL));\n                if (!first_pass_failed)\n                {\n                    opj_pi_destroy(l_pi,l_nb_pocs);\n                    return OPJ_FALSE;\n                }\n                memset(first_pass_failed, OPJ_TRUE, l_image->numcomps * sizeof(OPJ_BOOL));\n\n                while (opj_pi_next(l_current_pi)) {\n                  JAS_FPRINTF( stderr, \"packet offset=00000166 prg=%d cmptno=%02d rlvlno=%02d prcno=%03d lyrno=%02d\\n\\n\",\n                    l_current_pi->poc.prg1, l_current_pi->compno, l_current_pi->resno, l_current_pi->precno, l_current_pi->layno );\n\n                        if (l_tcp->num_layers_to_decode > l_current_pi->layno\n                                        && l_current_pi->resno < p_tile->comps[l_current_pi->compno].minimum_num_resolutions) {\n                                l_nb_bytes_read = 0;\n\n                                first_pass_failed[l_current_pi->compno] = OPJ_FALSE;\n\n                                if (! opj_t2_decode_packet(p_t2,p_tile,l_tcp,l_current_pi,l_current_data,&l_nb_bytes_read,p_max_len,l_pack_info)) {\n                                        opj_pi_destroy(l_pi,l_nb_pocs);\n                                        opj_free(first_pass_failed);\n                                        return OPJ_FALSE;\n                                }\n\n                                l_img_comp = &(l_image->comps[l_current_pi->compno]);\n                                l_img_comp->resno_decoded = opj_uint_max(l_current_pi->resno, l_img_comp->resno_decoded);\n                        }\n                        else {\n                                l_nb_bytes_read = 0;\n                                if (! opj_t2_skip_packet(p_t2,p_tile,l_tcp,l_current_pi,l_current_data,&l_nb_bytes_read,p_max_len,l_pack_info)) {\n                                        opj_pi_destroy(l_pi,l_nb_pocs);\n                                        opj_free(first_pass_failed);\n                                        return OPJ_FALSE;\n                                }\n                        }\n\n                        if (first_pass_failed[l_current_pi->compno]) {\n                                l_img_comp = &(l_image->comps[l_current_pi->compno]);\n                                if (l_img_comp->resno_decoded == 0)\n                                        l_img_comp->resno_decoded = p_tile->comps[l_current_pi->compno].minimum_num_resolutions - 1;\n                        }\n\n                        l_current_data += l_nb_bytes_read;\n                        p_max_len -= l_nb_bytes_read;\n\n                        /* INDEX >> */\n#ifdef TODO_MSD\n                        if(p_cstr_info) {\n                                opj_tile_info_v2_t *info_TL = &p_cstr_info->tile[p_tile_no];\n                                opj_packet_info_t *info_PK = &info_TL->packet[p_cstr_info->packno];\n                                tp_start_packno = 0;\n                                if (!p_cstr_info->packno) {\n                                        info_PK->start_pos = info_TL->end_header + 1;\n                                } else if (info_TL->packet[p_cstr_info->packno-1].end_pos >= (OPJ_INT32)p_cstr_info->tile[p_tile_no].tp[curtp].tp_end_pos){ /* New tile part */\n                                        info_TL->tp[curtp].tp_numpacks = p_cstr_info->packno - tp_start_packno; /* Number of packets in previous tile-part */\n                                        tp_start_packno = p_cstr_info->packno;\n                                        curtp++;\n                                        info_PK->start_pos = p_cstr_info->tile[p_tile_no].tp[curtp].tp_end_header+1;\n                                } else {\n                                        info_PK->start_pos = (l_cp->m_specific_param.m_enc.m_tp_on && info_PK->start_pos) ? info_PK->start_pos : info_TL->packet[p_cstr_info->packno - 1].end_pos + 1;\n                                }\n                                info_PK->end_pos = info_PK->start_pos + l_nb_bytes_read - 1;\n                                info_PK->end_ph_pos += info_PK->start_pos - 1;  /* End of packet header which now only represents the distance */\n                                ++p_cstr_info->packno;\n                        }\n#endif\n                        /* << INDEX */\n                }\n                ++l_current_pi;\n\n                opj_free(first_pass_failed);\n        }\n        /* INDEX >> */\n#ifdef TODO_MSD\n        if\n                (p_cstr_info) {\n                p_cstr_info->tile[p_tile_no].tp[curtp].tp_numpacks = p_cstr_info->packno - tp_start_packno; /* Number of packets in last tile-part */\n        }\n#endif\n        /* << INDEX */\n\n        /* don't forget to release pi */\n        opj_pi_destroy(l_pi,l_nb_pocs);\n        *p_data_read = (OPJ_UINT32)(l_current_data - p_src);\n        return OPJ_TRUE;\n}\n\n/* ----------------------------------------------------------------------- */\n\n/**\n * Creates a Tier 2 handle\n *\n * @param       p_image         Source or destination image\n * @param       p_cp            Image coding parameters.\n * @return              a new T2 handle if successful, NULL otherwise.\n*/\nopj_t2_t* opj_t2_create(opj_image_t *p_image, opj_cp_t *p_cp)\n{\n        /* create the t2 structure */\n        opj_t2_t *l_t2 = (opj_t2_t*)opj_malloc(sizeof(opj_t2_t));\n        if (!l_t2) {\n                return NULL;\n        }\n        memset(l_t2,0,sizeof(opj_t2_t));\n\n        l_t2->image = p_image;\n        l_t2->cp = p_cp;\n\n        return l_t2;\n}\n\nvoid opj_t2_destroy(opj_t2_t *t2) {\n        if(t2) {\n                opj_free(t2);\n        }\n}\n\nOPJ_BOOL opj_t2_decode_packet(  opj_t2_t* p_t2,\n                                opj_tcd_tile_t *p_tile,\n                                opj_tcp_t *p_tcp,\n                                opj_pi_iterator_t *p_pi,\n                                OPJ_BYTE *p_src,\n                                OPJ_UINT32 * p_data_read,\n                                OPJ_UINT32 p_max_length,\n                                opj_packet_info_t *p_pack_info)\n{\n        OPJ_BOOL l_read_data;\n        OPJ_UINT32 l_nb_bytes_read = 0;\n        OPJ_UINT32 l_nb_total_bytes_read = 0;\n\n        *p_data_read = 0;\n\n        if (! opj_t2_read_packet_header(p_t2,p_tile,p_tcp,p_pi,&l_read_data,p_src,&l_nb_bytes_read,p_max_length,p_pack_info)) {\n                return OPJ_FALSE;\n        }\n\n        p_src += l_nb_bytes_read;\n        l_nb_total_bytes_read += l_nb_bytes_read;\n        p_max_length -= l_nb_bytes_read;\n\n        /* we should read data for the packet */\n        if (l_read_data) {\n                l_nb_bytes_read = 0;\n\n                if (! opj_t2_read_packet_data(p_t2,p_tile,p_pi,p_src,&l_nb_bytes_read,p_max_length,p_pack_info)) {\n                        return OPJ_FALSE;\n                }\n\n                l_nb_total_bytes_read += l_nb_bytes_read;\n        }\n\n        *p_data_read = l_nb_total_bytes_read;\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_t2_encode_packet(  OPJ_UINT32 tileno,\n                                opj_tcd_tile_t * tile,\n                                opj_tcp_t * tcp,\n                                opj_pi_iterator_t *pi,\n                                OPJ_BYTE *dest,\n                                OPJ_UINT32 * p_data_written,\n                                OPJ_UINT32 length,\n                                opj_codestream_info_t *cstr_info)\n{\n        OPJ_UINT32 bandno, cblkno;\n        OPJ_BYTE* c = dest;\n        OPJ_UINT32 l_nb_bytes;\n        OPJ_UINT32 compno = pi->compno;     /* component value */\n        OPJ_UINT32 resno  = pi->resno;      /* resolution level value */\n        OPJ_UINT32 precno = pi->precno;     /* precinct value */\n        OPJ_UINT32 layno  = pi->layno;      /* quality layer value */\n        OPJ_UINT32 l_nb_blocks;\n        opj_tcd_band_t *band = 00;\n        opj_tcd_cblk_enc_t* cblk = 00;\n        opj_tcd_pass_t *pass = 00;\n\n        opj_tcd_tilecomp_t *tilec = &tile->comps[compno];\n        opj_tcd_resolution_t *res = &tilec->resolutions[resno];\n\n        opj_bio_t *bio = 00;    /* BIO component */\n\n        /* <SOP 0xff91> */\n        if (tcp->csty & J2K_CP_CSTY_SOP) {\n                c[0] = 255;\n                c[1] = 145;\n                c[2] = 0;\n                c[3] = 4;\n#if 0\n                c[4] = (tile->packno % 65536) / 256;\n                c[5] = (tile->packno % 65536) % 256;\n#else\n                c[4] = (tile->packno >> 8) & 0xff; /* packno is uint32_t */\n                c[5] = tile->packno & 0xff;\n#endif\n                c += 6;\n                length -= 6;\n        }\n        /* </SOP> */\n\n        if (!layno) {\n                band = res->bands;\n\n                for(bandno = 0; bandno < res->numbands; ++bandno) {\n                        opj_tcd_precinct_t *prc = &band->precincts[precno];\n\n                        opj_tgt_reset(prc->incltree);\n                        opj_tgt_reset(prc->imsbtree);\n\n                        l_nb_blocks = prc->cw * prc->ch;\n                        for     (cblkno = 0; cblkno < l_nb_blocks; ++cblkno) {\n                                cblk = &prc->cblks.enc[cblkno];\n\n                                cblk->numpasses = 0;\n                                opj_tgt_setvalue(prc->imsbtree, cblkno, band->numbps - (OPJ_INT32)cblk->numbps);\n                        }\n                        ++band;\n                }\n        }\n\n        bio = opj_bio_create();\n        opj_bio_init_enc(bio, c, length);\n        opj_bio_write(bio, 1, 1);           /* Empty header bit */\n\n        /* Writing Packet header */\n        band = res->bands;\n        for (bandno = 0; bandno < res->numbands; ++bandno)      {\n                opj_tcd_precinct_t *prc = &band->precincts[precno];\n\n                l_nb_blocks = prc->cw * prc->ch;\n                cblk = prc->cblks.enc;\n\n                for (cblkno = 0; cblkno < l_nb_blocks; ++cblkno) {\n                        opj_tcd_layer_t *layer = &cblk->layers[layno];\n\n                        if (!cblk->numpasses && layer->numpasses) {\n                                opj_tgt_setvalue(prc->incltree, cblkno, (OPJ_INT32)layno);\n                        }\n\n                        ++cblk;\n                }\n\n                cblk = prc->cblks.enc;\n                for (cblkno = 0; cblkno < l_nb_blocks; cblkno++) {\n                        opj_tcd_layer_t *layer = &cblk->layers[layno];\n                        OPJ_UINT32 increment = 0;\n                        OPJ_UINT32 nump = 0;\n                        OPJ_UINT32 len = 0, passno;\n                        OPJ_UINT32 l_nb_passes;\n\n                        /* cblk inclusion bits */\n                        if (!cblk->numpasses) {\n                                opj_tgt_encode(bio, prc->incltree, cblkno, (OPJ_INT32)(layno + 1));\n                        } else {\n                                opj_bio_write(bio, layer->numpasses != 0, 1);\n                        }\n\n                        /* if cblk not included, go to the next cblk  */\n                        if (!layer->numpasses) {\n                                ++cblk;\n                                continue;\n                        }\n\n                        /* if first instance of cblk --> zero bit-planes information */\n                        if (!cblk->numpasses) {\n                                cblk->numlenbits = 3;\n                                opj_tgt_encode(bio, prc->imsbtree, cblkno, 999);\n                        }\n\n                        /* number of coding passes included */\n                        opj_t2_putnumpasses(bio, layer->numpasses);\n                        l_nb_passes = cblk->numpasses + layer->numpasses;\n                        pass = cblk->passes +  cblk->numpasses;\n\n                        /* computation of the increase of the length indicator and insertion in the header     */\n                        for (passno = cblk->numpasses; passno < l_nb_passes; ++passno) {\n                                ++nump;\n                                len += pass->len;\n\n                                if (pass->term || passno == (cblk->numpasses + layer->numpasses) - 1) {\n                                  increment = (OPJ_UINT32)opj_int_max((OPJ_INT32)increment, opj_int_floorlog2((OPJ_INT32)len) + 1\n                                    - ((OPJ_INT32)cblk->numlenbits + opj_int_floorlog2((OPJ_INT32)nump)));\n                                        len = 0;\n                                        nump = 0;\n                                }\n\n                                ++pass;\n                        }\n                        opj_t2_putcommacode(bio, (OPJ_INT32)increment);\n\n                        /* computation of the new Length indicator */\n                        cblk->numlenbits += increment;\n\n                        pass = cblk->passes +  cblk->numpasses;\n                        /* insertion of the codeword segment length */\n                        for (passno = cblk->numpasses; passno < l_nb_passes; ++passno) {\n                                nump++;\n                                len += pass->len;\n\n                                if (pass->term || passno == (cblk->numpasses + layer->numpasses) - 1) {\n                                        opj_bio_write(bio, (OPJ_UINT32)len, cblk->numlenbits + (OPJ_UINT32)opj_int_floorlog2((OPJ_INT32)nump));\n                                        len = 0;\n                                        nump = 0;\n                                }\n                                ++pass;\n                        }\n\n                        ++cblk;\n                }\n\n                ++band;\n        }\n\n        if (!opj_bio_flush(bio)) {\n                opj_bio_destroy(bio);\n                return OPJ_FALSE;               /* modified to eliminate longjmp !! */\n        }\n\n        l_nb_bytes = (OPJ_UINT32)opj_bio_numbytes(bio);\n        c += l_nb_bytes;\n        length -= l_nb_bytes;\n\n        opj_bio_destroy(bio);\n\n        /* <EPH 0xff92> */\n        if (tcp->csty & J2K_CP_CSTY_EPH) {\n                c[0] = 255;\n                c[1] = 146;\n                c += 2;\n                length -= 2;\n        }\n        /* </EPH> */\n\n        /* << INDEX */\n        /* End of packet header position. Currently only represents the distance to start of packet\n           Will be updated later by incrementing with packet start value*/\n        if(cstr_info && cstr_info->index_write) {\n                opj_packet_info_t *info_PK = &cstr_info->tile[tileno].packet[cstr_info->packno];\n                info_PK->end_ph_pos = (OPJ_INT32)(c - dest);\n        }\n        /* INDEX >> */\n\n        /* Writing the packet body */\n        band = res->bands;\n        for (bandno = 0; bandno < res->numbands; bandno++) {\n                opj_tcd_precinct_t *prc = &band->precincts[precno];\n\n                l_nb_blocks = prc->cw * prc->ch;\n                cblk = prc->cblks.enc;\n\n                for (cblkno = 0; cblkno < l_nb_blocks; ++cblkno) {\n                        opj_tcd_layer_t *layer = &cblk->layers[layno];\n\n                        if (!layer->numpasses) {\n                                ++cblk;\n                                continue;\n                        }\n\n                        if (layer->len > length) {\n                                return OPJ_FALSE;\n                        }\n\n                        memcpy(c, layer->data, layer->len);\n                        cblk->numpasses += layer->numpasses;\n                        c += layer->len;\n                        length -= layer->len;\n\n                        /* << INDEX */\n                        if(cstr_info && cstr_info->index_write) {\n                                opj_packet_info_t *info_PK = &cstr_info->tile[tileno].packet[cstr_info->packno];\n                                info_PK->disto += layer->disto;\n                                if (cstr_info->D_max < info_PK->disto) {\n                                        cstr_info->D_max = info_PK->disto;\n                                }\n                        }\n\n                        ++cblk;\n                        /* INDEX >> */\n                }\n                ++band;\n        }\n\n        assert( c >= dest );\n        * p_data_written += (OPJ_UINT32)(c - dest);\n\n        return OPJ_TRUE;\n}\n\nstatic OPJ_BOOL opj_t2_skip_packet( opj_t2_t* p_t2,\n                                    opj_tcd_tile_t *p_tile,\n                                    opj_tcp_t *p_tcp,\n                                    opj_pi_iterator_t *p_pi,\n                                    OPJ_BYTE *p_src,\n                                    OPJ_UINT32 * p_data_read,\n                                    OPJ_UINT32 p_max_length,\n                                    opj_packet_info_t *p_pack_info)\n{\n        OPJ_BOOL l_read_data;\n        OPJ_UINT32 l_nb_bytes_read = 0;\n        OPJ_UINT32 l_nb_total_bytes_read = 0;\n\n        *p_data_read = 0;\n\n        if (! opj_t2_read_packet_header(p_t2,p_tile,p_tcp,p_pi,&l_read_data,p_src,&l_nb_bytes_read,p_max_length,p_pack_info)) {\n                return OPJ_FALSE;\n        }\n\n        p_src += l_nb_bytes_read;\n        l_nb_total_bytes_read += l_nb_bytes_read;\n        p_max_length -= l_nb_bytes_read;\n\n        /* we should read data for the packet */\n        if (l_read_data) {\n                l_nb_bytes_read = 0;\n\n                if (! opj_t2_skip_packet_data(p_t2,p_tile,p_pi,&l_nb_bytes_read,p_max_length,p_pack_info)) {\n                        return OPJ_FALSE;\n                }\n\n                l_nb_total_bytes_read += l_nb_bytes_read;\n        }\n        *p_data_read = l_nb_total_bytes_read;\n\n        return OPJ_TRUE;\n}\n\n\nOPJ_BOOL opj_t2_read_packet_header( opj_t2_t* p_t2,\n                                    opj_tcd_tile_t *p_tile,\n                                    opj_tcp_t *p_tcp,\n                                    opj_pi_iterator_t *p_pi,\n                                    OPJ_BOOL * p_is_data_present,\n                                    OPJ_BYTE *p_src_data,\n                                    OPJ_UINT32 * p_data_read,\n                                    OPJ_UINT32 p_max_length,\n                                    opj_packet_info_t *p_pack_info)\n\n{\n        /* loop */\n        OPJ_UINT32 bandno, cblkno;\n        OPJ_UINT32 l_nb_code_blocks;\n        OPJ_UINT32 l_remaining_length;\n        OPJ_UINT32 l_header_length;\n        OPJ_UINT32 * l_modified_length_ptr = 00;\n        OPJ_BYTE *l_current_data = p_src_data;\n        opj_cp_t *l_cp = p_t2->cp;\n        opj_bio_t *l_bio = 00;  /* BIO component */\n        opj_tcd_band_t *l_band = 00;\n        opj_tcd_cblk_dec_t* l_cblk = 00;\n        opj_tcd_resolution_t* l_res = &p_tile->comps[p_pi->compno].resolutions[p_pi->resno];\n\n        OPJ_BYTE *l_header_data = 00;\n        OPJ_BYTE **l_header_data_start = 00;\n\n        OPJ_UINT32 l_present;\n\n        if (p_pi->layno == 0) {\n                l_band = l_res->bands;\n\n                /* reset tagtrees */\n                for (bandno = 0; bandno < l_res->numbands; ++bandno) {\n                        opj_tcd_precinct_t *l_prc = &l_band->precincts[p_pi->precno];\n\n                        if ( ! ((l_band->x1-l_band->x0 == 0)||(l_band->y1-l_band->y0 == 0)) ) {\n                                opj_tgt_reset(l_prc->incltree);\n                                opj_tgt_reset(l_prc->imsbtree);\n                                l_cblk = l_prc->cblks.dec;\n\n                                l_nb_code_blocks = l_prc->cw * l_prc->ch;\n                                for (cblkno = 0; cblkno < l_nb_code_blocks; ++cblkno) {\n                                        l_cblk->numsegs = 0;\n                                        l_cblk->real_num_segs = 0;\n                                        ++l_cblk;\n                                }\n                        }\n\n                        ++l_band;\n                }\n        }\n\n        /* SOP markers */\n\n        if (p_tcp->csty & J2K_CP_CSTY_SOP) {\n                if (p_max_length < 6) {\n                        /* TODO opj_event_msg(p_t2->cinfo->event_mgr, EVT_WARNING, \"Not enough space for expected SOP marker\\n\"); */\n                        fprintf(stderr, \"Not enough space for expected SOP marker\\n\");\n                } else if ((*l_current_data) != 0xff || (*(l_current_data + 1) != 0x91)) {\n                        /* TODO opj_event_msg(p_t2->cinfo->event_mgr, EVT_WARNING, \"Expected SOP marker\\n\"); */\n                        fprintf(stderr, \"Error : expected SOP marker\\n\");\n                } else {\n                        l_current_data += 6;\n                }\n\n                /** TODO : check the Nsop value */\n        }\n\n        /*\n        When the marker PPT/PPM is used the packet header are store in PPT/PPM marker\n        This part deal with this caracteristic\n        step 1: Read packet header in the saved structure\n        step 2: Return to codestream for decoding\n        */\n\n        l_bio = opj_bio_create();\n        if (! l_bio) {\n                return OPJ_FALSE;\n        }\n\n        if (l_cp->ppm == 1) { /* PPM */\n                l_header_data_start = &l_cp->ppm_data;\n                l_header_data = *l_header_data_start;\n                l_modified_length_ptr = &(l_cp->ppm_len);\n\n        }\n        else if (p_tcp->ppt == 1) { /* PPT */\n                l_header_data_start = &(p_tcp->ppt_data);\n                l_header_data = *l_header_data_start;\n                l_modified_length_ptr = &(p_tcp->ppt_len);\n        }\n        else {  /* Normal Case */\n                l_header_data_start = &(l_current_data);\n                l_header_data = *l_header_data_start;\n                l_remaining_length = (OPJ_UINT32)(p_src_data+p_max_length-l_header_data);\n                l_modified_length_ptr = &(l_remaining_length);\n        }\n\n        opj_bio_init_dec(l_bio, l_header_data,*l_modified_length_ptr);\n\n        l_present = opj_bio_read(l_bio, 1);\n        JAS_FPRINTF(stderr, \"present=%d \\n\", l_present );\n        if (!l_present) {\n            /* TODO MSD: no test to control the output of this function*/\n                opj_bio_inalign(l_bio);\n                l_header_data += opj_bio_numbytes(l_bio);\n                opj_bio_destroy(l_bio);\n\n                /* EPH markers */\n                if (p_tcp->csty & J2K_CP_CSTY_EPH) {\n                        if (p_max_length < 2) {\n                                fprintf(stderr, \"Not enough space for expected EPH marker\\n\");\n                        } else if ((*l_header_data) != 0xff || (*(l_header_data + 1) != 0x92)) {\n                                fprintf(stderr, \"Error : expected EPH marker\\n\");\n                        } else {\n                                l_header_data += 2;\n                        }\n                }\n\n                l_header_length = (OPJ_UINT32)(l_header_data - *l_header_data_start);\n                *l_modified_length_ptr -= l_header_length;\n                *l_header_data_start += l_header_length;\n\n                /* << INDEX */\n                /* End of packet header position. Currently only represents the distance to start of packet\n                   Will be updated later by incrementing with packet start value */\n                if (p_pack_info) {\n                        p_pack_info->end_ph_pos = (OPJ_INT32)(l_current_data - p_src_data);\n                }\n                /* INDEX >> */\n\n                * p_is_data_present = OPJ_FALSE;\n                *p_data_read = (OPJ_UINT32)(l_current_data - p_src_data);\n                return OPJ_TRUE;\n        }\n\n        l_band = l_res->bands;\n        for (bandno = 0; bandno < l_res->numbands; ++bandno) {\n                opj_tcd_precinct_t *l_prc = &(l_band->precincts[p_pi->precno]);\n\n                if ((l_band->x1-l_band->x0 == 0)||(l_band->y1-l_band->y0 == 0)) {\n                        ++l_band;\n                        continue;\n                }\n\n                l_nb_code_blocks = l_prc->cw * l_prc->ch;\n                l_cblk = l_prc->cblks.dec;\n                for (cblkno = 0; cblkno < l_nb_code_blocks; cblkno++) {\n                        OPJ_UINT32 l_included,l_increment, l_segno;\n                        OPJ_INT32 n;\n\n                        /* if cblk not yet included before --> inclusion tagtree */\n                        if (!l_cblk->numsegs) {\n                                l_included = opj_tgt_decode(l_bio, l_prc->incltree, cblkno, (OPJ_INT32)(p_pi->layno + 1));\n                                /* else one bit */\n                        }\n                        else {\n                                l_included = opj_bio_read(l_bio, 1);\n                        }\n\n                        /* if cblk not included */\n                        if (!l_included) {\n                                l_cblk->numnewpasses = 0;\n                                ++l_cblk;\n        JAS_FPRINTF(stderr, \"included=%d \\n\", l_included);\n                                continue;\n                        }\n\n                        /* if cblk not yet included --> zero-bitplane tagtree */\n                        if (!l_cblk->numsegs) {\n                                OPJ_UINT32 i = 0;\n\n                                while (!opj_tgt_decode(l_bio, l_prc->imsbtree, cblkno, (OPJ_INT32)i)) {\n                                        ++i;\n                                }\n\n                                l_cblk->numbps = (OPJ_UINT32)l_band->numbps + 1 - i;\n                                l_cblk->numlenbits = 3;\n                        }\n\n                        /* number of coding passes */\n                        l_cblk->numnewpasses = opj_t2_getnumpasses(l_bio);\n                        l_increment = opj_t2_getcommacode(l_bio);\n\n                        /* length indicator increment */\n                        l_cblk->numlenbits += l_increment;\n                        l_segno = 0;\n\n                        if (!l_cblk->numsegs) {\n                                if (! opj_t2_init_seg(l_cblk, l_segno, p_tcp->tccps[p_pi->compno].cblksty, 1)) {\n                                        opj_bio_destroy(l_bio);\n                                        return OPJ_FALSE;\n                                }\n                        }\n                        else {\n                                l_segno = l_cblk->numsegs - 1;\n                                if (l_cblk->segs[l_segno].numpasses == l_cblk->segs[l_segno].maxpasses) {\n                                        ++l_segno;\n                                        if (! opj_t2_init_seg(l_cblk, l_segno, p_tcp->tccps[p_pi->compno].cblksty, 0)) {\n                                                opj_bio_destroy(l_bio);\n                                                return OPJ_FALSE;\n                                        }\n                                }\n                        }\n                        n = (OPJ_INT32)l_cblk->numnewpasses;\n\n                        do {\n                                l_cblk->segs[l_segno].numnewpasses = (OPJ_UINT32)opj_int_min((OPJ_INT32)(l_cblk->segs[l_segno].maxpasses - l_cblk->segs[l_segno].numpasses), n);\n                                l_cblk->segs[l_segno].newlen = opj_bio_read(l_bio, l_cblk->numlenbits + opj_uint_floorlog2(l_cblk->segs[l_segno].numnewpasses));\n                                        JAS_FPRINTF(stderr, \"included=%d numnewpasses=%d increment=%d len=%d \\n\", l_included, l_cblk->segs[l_segno].numnewpasses, l_increment, l_cblk->segs[l_segno].newlen );\n                                /* testcase 1802.pdf.SIGSEGV.36e.894 */\n                                if (l_cblk->segs[l_segno].newlen > *l_modified_length_ptr) {\n                                        opj_bio_destroy(l_bio);\n                                        return OPJ_FALSE;\n                                }\n\n                                n -= (OPJ_INT32)l_cblk->segs[l_segno].numnewpasses;\n                                if (n > 0) {\n                                        ++l_segno;\n\n                                        if (! opj_t2_init_seg(l_cblk, l_segno, p_tcp->tccps[p_pi->compno].cblksty, 0)) {\n                                                opj_bio_destroy(l_bio);\n                                                return OPJ_FALSE;\n                                        }\n                                }\n                        } while (n > 0);\n\n                        ++l_cblk;\n                }\n\n                ++l_band;\n        }\n\n        if (!opj_bio_inalign(l_bio)) {\n                opj_bio_destroy(l_bio);\n                return OPJ_FALSE;\n        }\n\n        l_header_data += opj_bio_numbytes(l_bio);\n        opj_bio_destroy(l_bio);\n\n        /* EPH markers */\n        if (p_tcp->csty & J2K_CP_CSTY_EPH) {\n                if (p_max_length < 2) {\n                        fprintf(stderr, \"Not enough space for expected EPH marker\\n\");\n                } else if ((*l_header_data) != 0xff || (*(l_header_data + 1) != 0x92)) {\n                        /* TODO opj_event_msg(t2->cinfo->event_mgr, EVT_ERROR, \"Expected EPH marker\\n\"); */\n                        fprintf(stderr, \"Error : expected EPH marker\\n\");\n                } else {\n                        l_header_data += 2;\n                }\n        }\n\n        l_header_length = (OPJ_UINT32)(l_header_data - *l_header_data_start);\n        JAS_FPRINTF( stderr, \"hdrlen=%d \\n\", l_header_length );\n        JAS_FPRINTF( stderr, \"packet body\\n\");\n        *l_modified_length_ptr -= l_header_length;\n        *l_header_data_start += l_header_length;\n\n        /* << INDEX */\n        /* End of packet header position. Currently only represents the distance to start of packet\n         Will be updated later by incrementing with packet start value */\n        if (p_pack_info) {\n                p_pack_info->end_ph_pos = (OPJ_INT32)(l_current_data - p_src_data);\n        }\n        /* INDEX >> */\n\n        *p_is_data_present = OPJ_TRUE;\n        *p_data_read = (OPJ_UINT32)(l_current_data - p_src_data);\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_t2_read_packet_data(   opj_t2_t* p_t2,\n                                    opj_tcd_tile_t *p_tile,\n                                    opj_pi_iterator_t *p_pi,\n                                    OPJ_BYTE *p_src_data,\n                                    OPJ_UINT32 * p_data_read,\n                                    OPJ_UINT32 p_max_length,\n                                    opj_packet_info_t *pack_info)\n{\n        OPJ_UINT32 bandno, cblkno;\n        OPJ_UINT32 l_nb_code_blocks;\n        OPJ_BYTE *l_current_data = p_src_data;\n        opj_tcd_band_t *l_band = 00;\n        opj_tcd_cblk_dec_t* l_cblk = 00;\n        opj_tcd_resolution_t* l_res = &p_tile->comps[p_pi->compno].resolutions[p_pi->resno];\n\n        OPJ_ARG_NOT_USED(p_t2);\n        OPJ_ARG_NOT_USED(pack_info);\n\n        l_band = l_res->bands;\n        for (bandno = 0; bandno < l_res->numbands; ++bandno) {\n                opj_tcd_precinct_t *l_prc = &l_band->precincts[p_pi->precno];\n\n                if ((l_band->x1-l_band->x0 == 0)||(l_band->y1-l_band->y0 == 0)) {\n                        ++l_band;\n                        continue;\n                }\n\n                l_nb_code_blocks = l_prc->cw * l_prc->ch;\n                l_cblk = l_prc->cblks.dec;\n\n                for (cblkno = 0; cblkno < l_nb_code_blocks; ++cblkno) {\n                        opj_tcd_seg_t *l_seg = 00;\n\n                        if (!l_cblk->numnewpasses) {\n                                /* nothing to do */\n                                ++l_cblk;\n                                continue;\n                        }\n\n                        if (!l_cblk->numsegs) {\n                                l_seg = l_cblk->segs;\n                                ++l_cblk->numsegs;\n                                l_cblk->data_current_size = 0;\n                        }\n                        else {\n                                l_seg = &l_cblk->segs[l_cblk->numsegs - 1];\n\n                                if (l_seg->numpasses == l_seg->maxpasses) {\n                                        ++l_seg;\n                                        ++l_cblk->numsegs;\n                                }\n                        }\n\n                        do {\n                                if (l_current_data + l_seg->newlen > p_src_data + p_max_length) {\n                                        fprintf(stderr, \"read: segment too long (%d) with max (%d) for codeblock %d (p=%d, b=%d, r=%d, c=%d)\\n\",\n                                                l_seg->newlen, p_max_length, cblkno, p_pi->precno, bandno, p_pi->resno, p_pi->compno);\n                                        return OPJ_FALSE;\n                                }\n\n#ifdef USE_JPWL\n                        /* we need here a j2k handle to verify if making a check to\n                        the validity of cblocks parameters is selected from user (-W) */\n\n                                /* let's check that we are not exceeding */\n                                if ((l_cblk->len + l_seg->newlen) > 8192) {\n                                        opj_event_msg(p_t2->cinfo, EVT_WARNING,\n                                                \"JPWL: segment too long (%d) for codeblock %d (p=%d, b=%d, r=%d, c=%d)\\n\",\n                                                l_seg->newlen, cblkno, p_pi->precno, bandno, p_pi->resno, p_pi->compno);\n                                        if (!JPWL_ASSUME) {\n                                                opj_event_msg(p_t2->cinfo, EVT_ERROR, \"JPWL: giving up\\n\");\n                                                return OPJ_FALSE;\n                                        }\n                                        l_seg->newlen = 8192 - l_cblk->len;\n                                        opj_event_msg(p_t2->cinfo, EVT_WARNING, \"      - truncating segment to %d\\n\", l_seg->newlen);\n                                        break;\n                                };\n\n#endif /* USE_JPWL */\n                                /* Check if the cblk->data have allocated enough memory */\n                                if ((l_cblk->data_current_size + l_seg->newlen) > l_cblk->data_max_size) {\n                                    OPJ_BYTE* new_cblk_data = (OPJ_BYTE*) opj_realloc(l_cblk->data, l_cblk->data_current_size + l_seg->newlen);\n                                    if(! new_cblk_data) {\n                                        opj_free(l_cblk->data);\n                                        l_cblk->data = NULL;\n                                        l_cblk->data_max_size = 0;\n                                        /* opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to realloc code block cata!\\n\"); */\n                                        return OPJ_FALSE;\n                                    }\n                                    l_cblk->data_max_size = l_cblk->data_current_size + l_seg->newlen;\n                                    l_cblk->data = new_cblk_data;\n                                }\n                               \n                                memcpy(l_cblk->data + l_cblk->data_current_size, l_current_data, l_seg->newlen);\n\n                                if (l_seg->numpasses == 0) {\n                                        l_seg->data = &l_cblk->data;\n                                        l_seg->dataindex = l_cblk->data_current_size;\n                                }\n\n                                l_current_data += l_seg->newlen;\n                                l_seg->numpasses += l_seg->numnewpasses;\n                                l_cblk->numnewpasses -= l_seg->numnewpasses;\n\n                                l_seg->real_num_passes = l_seg->numpasses;\n                                l_cblk->data_current_size += l_seg->newlen;\n                                l_seg->len += l_seg->newlen;\n\n                                if (l_cblk->numnewpasses > 0) {\n                                        ++l_seg;\n                                        ++l_cblk->numsegs;\n                                }\n                        } while (l_cblk->numnewpasses > 0);\n\n                        l_cblk->real_num_segs = l_cblk->numsegs;\n                        ++l_cblk;\n                } /* next code_block */\n\n                ++l_band;\n        }\n\n        *(p_data_read) = (OPJ_UINT32)(l_current_data - p_src_data);\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_t2_skip_packet_data(   opj_t2_t* p_t2,\n                                    opj_tcd_tile_t *p_tile,\n                                    opj_pi_iterator_t *p_pi,\n                                    OPJ_UINT32 * p_data_read,\n                                    OPJ_UINT32 p_max_length,\n                                    opj_packet_info_t *pack_info)\n{\n        OPJ_UINT32 bandno, cblkno;\n        OPJ_UINT32 l_nb_code_blocks;\n        opj_tcd_band_t *l_band = 00;\n        opj_tcd_cblk_dec_t* l_cblk = 00;\n        opj_tcd_resolution_t* l_res = &p_tile->comps[p_pi->compno].resolutions[p_pi->resno];\n\n        OPJ_ARG_NOT_USED(p_t2);\n        OPJ_ARG_NOT_USED(pack_info);\n\n        *p_data_read = 0;\n        l_band = l_res->bands;\n\n        for (bandno = 0; bandno < l_res->numbands; ++bandno) {\n                opj_tcd_precinct_t *l_prc = &l_band->precincts[p_pi->precno];\n\n                if ((l_band->x1-l_band->x0 == 0)||(l_band->y1-l_band->y0 == 0)) {\n                        ++l_band;\n                        continue;\n                }\n\n                l_nb_code_blocks = l_prc->cw * l_prc->ch;\n                l_cblk = l_prc->cblks.dec;\n\n                for (cblkno = 0; cblkno < l_nb_code_blocks; ++cblkno) {\n                        opj_tcd_seg_t *l_seg = 00;\n\n                        if (!l_cblk->numnewpasses) {\n                                /* nothing to do */\n                                ++l_cblk;\n                                continue;\n                        }\n\n                        if (!l_cblk->numsegs) {\n                                l_seg = l_cblk->segs;\n                                ++l_cblk->numsegs;\n                                l_cblk->data_current_size = 0;\n                        }\n                        else {\n                                l_seg = &l_cblk->segs[l_cblk->numsegs - 1];\n\n                                if (l_seg->numpasses == l_seg->maxpasses) {\n                                        ++l_seg;\n                                        ++l_cblk->numsegs;\n                                }\n                        }\n\n                        do {\n                                if (* p_data_read + l_seg->newlen > p_max_length) {\n                                        fprintf(stderr, \"skip: segment too long (%d) with max (%d) for codeblock %d (p=%d, b=%d, r=%d, c=%d)\\n\",\n                                                l_seg->newlen, p_max_length, cblkno, p_pi->precno, bandno, p_pi->resno, p_pi->compno);\n                                        return OPJ_FALSE;\n                                }\n\n#ifdef USE_JPWL\n                        /* we need here a j2k handle to verify if making a check to\n                        the validity of cblocks parameters is selected from user (-W) */\n\n                                /* let's check that we are not exceeding */\n                                if ((l_cblk->len + l_seg->newlen) > 8192) {\n                                        opj_event_msg(p_t2->cinfo, EVT_WARNING,\n                                                \"JPWL: segment too long (%d) for codeblock %d (p=%d, b=%d, r=%d, c=%d)\\n\",\n                                                l_seg->newlen, cblkno, p_pi->precno, bandno, p_pi->resno, p_pi->compno);\n                                        if (!JPWL_ASSUME) {\n                                                opj_event_msg(p_t2->cinfo, EVT_ERROR, \"JPWL: giving up\\n\");\n                                                return -999;\n                                        }\n                                        l_seg->newlen = 8192 - l_cblk->len;\n                                        opj_event_msg(p_t2->cinfo, EVT_WARNING, \"      - truncating segment to %d\\n\", l_seg->newlen);\n                                        break;\n                                };\n\n#endif /* USE_JPWL */\n                                        JAS_FPRINTF(stderr, \"p_data_read (%d) newlen (%d) \\n\", *p_data_read, l_seg->newlen );\n                                *(p_data_read) += l_seg->newlen;\n\n                                l_seg->numpasses += l_seg->numnewpasses;\n                                l_cblk->numnewpasses -= l_seg->numnewpasses;\n                                if (l_cblk->numnewpasses > 0)\n                                {\n                                        ++l_seg;\n                                        ++l_cblk->numsegs;\n                                }\n                        } while (l_cblk->numnewpasses > 0);\n\n                        ++l_cblk;\n                }\n\n                ++l_band;\n        }\n\n        return OPJ_TRUE;\n}\n\n\nOPJ_BOOL opj_t2_init_seg(   opj_tcd_cblk_dec_t* cblk,\n                            OPJ_UINT32 index, \n                            OPJ_UINT32 cblksty, \n                            OPJ_UINT32 first)\n{\n        opj_tcd_seg_t* seg = 00;\n        OPJ_UINT32 l_nb_segs = index + 1;\n\n        if (l_nb_segs > cblk->m_current_max_segs) {\n                opj_tcd_seg_t* new_segs;\n                cblk->m_current_max_segs += OPJ_J2K_DEFAULT_NB_SEGS;\n\n                new_segs = (opj_tcd_seg_t*) opj_realloc(cblk->segs, cblk->m_current_max_segs * sizeof(opj_tcd_seg_t));\n                if(! new_segs) {\n                        opj_free(cblk->segs);\n                        cblk->segs = NULL;\n                        cblk->m_current_max_segs = 0;\n                        /* opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to initialize segment %d\\n\", l_nb_segs); */\n                        return OPJ_FALSE;\n                }\n                cblk->segs = new_segs;\n        }\n\n        seg = &cblk->segs[index];\n        memset(seg,0,sizeof(opj_tcd_seg_t));\n\n        if (cblksty & J2K_CCP_CBLKSTY_TERMALL) {\n                seg->maxpasses = 1;\n        }\n        else if (cblksty & J2K_CCP_CBLKSTY_LAZY) {\n                if (first) {\n                        seg->maxpasses = 10;\n                } else {\n                        seg->maxpasses = (((seg - 1)->maxpasses == 1) || ((seg - 1)->maxpasses == 10)) ? 2 : 1;\n                }\n        } else {\n                seg->maxpasses = 109;\n        }\n\n        return OPJ_TRUE;\n}\n"
  },
  {
    "path": "ext/openjpeg/t2.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR \n * Copyright (c) 2012, CS Systemes d'Information, France\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n#ifndef __T2_H\n#define __T2_H\n/**\n@file t2.h\n@brief Implementation of a tier-2 coding (packetization of code-block data) (T2)\n\n*/\n\n/** @defgroup T2 T2 - Implementation of a tier-2 coding */\n/*@{*/\n\n/**\nTier-2 coding\n*/\ntypedef struct opj_t2 {\n\n\t/** Encoding: pointer to the src image. Decoding: pointer to the dst image. */\n\topj_image_t *image;\n\t/** pointer to the image coding parameters */\n\topj_cp_t *cp;\n} opj_t2_t;\n\n/** @name Exported functions */\n/*@{*/\n/* ----------------------------------------------------------------------- */\n\n/**\nEncode the packets of a tile to a destination buffer\n@param t2               T2 handle\n@param tileno           number of the tile encoded\n@param tile             the tile for which to write the packets\n@param maxlayers        maximum number of layers\n@param dest             the destination buffer\n@param p_data_written   FIXME DOC\n@param len              the length of the destination buffer\n@param cstr_info        Codestream information structure\n@param tpnum            Tile part number of the current tile\n@param tppos            The position of the tile part flag in the progression order\n@param pino             FIXME DOC\n@param t2_mode          If == 0 In Threshold calculation ,If == 1 Final pass\n*/\nOPJ_BOOL opj_t2_encode_packets(\topj_t2_t* t2,\n\t\t\t\t\t\t\t\tOPJ_UINT32 tileno,\n\t\t\t\t\t\t\t\topj_tcd_tile_t *tile,\n\t\t\t\t\t\t\t\tOPJ_UINT32 maxlayers,\n\t\t\t\t\t\t\t\tOPJ_BYTE *dest,\n\t\t\t\t\t\t\t\tOPJ_UINT32 * p_data_written,\n\t\t\t\t\t\t\t\tOPJ_UINT32 len,\n\t\t\t\t\t\t\t\topj_codestream_info_t *cstr_info,\n\t\t\t\t\t\t\t\tOPJ_UINT32 tpnum,\n\t\t\t\t\t\t\t\tOPJ_INT32 tppos,\n\t\t\t\t\t\t\t\tOPJ_UINT32 pino,\n\t\t\t\t\t\t\t\tJ2K_T2_MODE t2_mode);\n\n/**\nDecode the packets of a tile from a source buffer\n@param t2 T2 handle\n@param tileno number that identifies the tile for which to decode the packets\n@param tile tile for which to decode the packets\n@param src         FIXME DOC\n@param p_data_read the source buffer\n@param len length of the source buffer\n@param cstr_info   FIXME DOC\n\n@return FIXME DOC\n */\nOPJ_BOOL opj_t2_decode_packets(\topj_t2_t *t2,\n                                OPJ_UINT32 tileno,\n                                opj_tcd_tile_t *tile,\n                                OPJ_BYTE *src,\n                                OPJ_UINT32 * p_data_read,\n                                OPJ_UINT32 len,\n                                opj_codestream_index_t *cstr_info);\n\n/**\n * Creates a Tier 2 handle\n *\n * @param\tp_image\t\tSource or destination image\n * @param\tp_cp\t\tImage coding parameters.\n * @return\t\ta new T2 handle if successful, NULL otherwise.\n*/\nopj_t2_t* opj_t2_create(opj_image_t *p_image, opj_cp_t *p_cp);\n\n/**\nDestroy a T2 handle\n@param t2 T2 handle to destroy\n*/\nvoid opj_t2_destroy(opj_t2_t *t2);\n\n/* ----------------------------------------------------------------------- */\n/*@}*/\n\n/*@}*/\n\n#endif /* __T2_H */\n"
  },
  {
    "path": "ext/openjpeg/tcd.c",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2006-2007, Parvatha Elangovan\n * Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR \n * Copyright (c) 2012, CS Systemes d'Information, France\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include \"opj_includes.h\"\n\n/* ----------------------------------------------------------------------- */\n\n/* TODO MSD: */\n#ifdef TODO_MSD \nvoid tcd_dump(FILE *fd, opj_tcd_t *tcd, opj_tcd_image_t * img) {\n        int tileno, compno, resno, bandno, precno;/*, cblkno;*/\n\n        fprintf(fd, \"image {\\n\");\n        fprintf(fd, \"  tw=%d, th=%d x0=%d x1=%d y0=%d y1=%d\\n\", \n                img->tw, img->th, tcd->image->x0, tcd->image->x1, tcd->image->y0, tcd->image->y1);\n\n        for (tileno = 0; tileno < img->th * img->tw; tileno++) {\n                opj_tcd_tile_t *tile = &tcd->tcd_image->tiles[tileno];\n                fprintf(fd, \"  tile {\\n\");\n                fprintf(fd, \"    x0=%d, y0=%d, x1=%d, y1=%d, numcomps=%d\\n\",\n                        tile->x0, tile->y0, tile->x1, tile->y1, tile->numcomps);\n                for (compno = 0; compno < tile->numcomps; compno++) {\n                        opj_tcd_tilecomp_t *tilec = &tile->comps[compno];\n                        fprintf(fd, \"    tilec {\\n\");\n                        fprintf(fd,\n                                \"      x0=%d, y0=%d, x1=%d, y1=%d, numresolutions=%d\\n\",\n                                tilec->x0, tilec->y0, tilec->x1, tilec->y1, tilec->numresolutions);\n                        for (resno = 0; resno < tilec->numresolutions; resno++) {\n                                opj_tcd_resolution_t *res = &tilec->resolutions[resno];\n                                fprintf(fd, \"\\n   res {\\n\");\n                                fprintf(fd,\n                                        \"          x0=%d, y0=%d, x1=%d, y1=%d, pw=%d, ph=%d, numbands=%d\\n\",\n                                        res->x0, res->y0, res->x1, res->y1, res->pw, res->ph, res->numbands);\n                                for (bandno = 0; bandno < res->numbands; bandno++) {\n                                        opj_tcd_band_t *band = &res->bands[bandno];\n                                        fprintf(fd, \"        band {\\n\");\n                                        fprintf(fd,\n                                                \"          x0=%d, y0=%d, x1=%d, y1=%d, stepsize=%f, numbps=%d\\n\",\n                                                band->x0, band->y0, band->x1, band->y1, band->stepsize, band->numbps);\n                                        for (precno = 0; precno < res->pw * res->ph; precno++) {\n                                                opj_tcd_precinct_t *prec = &band->precincts[precno];\n                                                fprintf(fd, \"          prec {\\n\");\n                                                fprintf(fd,\n                                                        \"            x0=%d, y0=%d, x1=%d, y1=%d, cw=%d, ch=%d\\n\",\n                                                        prec->x0, prec->y0, prec->x1, prec->y1, prec->cw, prec->ch);\n                                                /*\n                                                for (cblkno = 0; cblkno < prec->cw * prec->ch; cblkno++) {\n                                                        opj_tcd_cblk_t *cblk = &prec->cblks[cblkno];\n                                                        fprintf(fd, \"            cblk {\\n\");\n                                                        fprintf(fd,\n                                                                \"              x0=%d, y0=%d, x1=%d, y1=%d\\n\",\n                                                                cblk->x0, cblk->y0, cblk->x1, cblk->y1);\n                                                        fprintf(fd, \"            }\\n\");\n                                                }\n                                                */\n                                                fprintf(fd, \"          }\\n\");\n                                        }\n                                        fprintf(fd, \"        }\\n\");\n                                }\n                                fprintf(fd, \"      }\\n\");\n                        }\n                        fprintf(fd, \"    }\\n\");\n                }\n                fprintf(fd, \"  }\\n\");\n        }\n        fprintf(fd, \"}\\n\");\n}\n#endif\n/**\n* Allocates memory for a decoding code block.\n*/\nstatic OPJ_BOOL opj_tcd_code_block_dec_allocate (opj_tcd_cblk_dec_t * p_code_block);\n\n/**\n * Deallocates the decoding data of the given precinct.\n */\nstatic void opj_tcd_code_block_dec_deallocate (opj_tcd_precinct_t * p_precinct);\n\n/**\n * Allocates memory for an encoding code block.\n */\nstatic OPJ_BOOL opj_tcd_code_block_enc_allocate (opj_tcd_cblk_enc_t * p_code_block);\n\n/**\n * Deallocates the encoding data of the given precinct.\n */\nstatic void opj_tcd_code_block_enc_deallocate (opj_tcd_precinct_t * p_precinct);\n\n\n/**\nFree the memory allocated for encoding\n@param tcd TCD handle\n*/\nstatic void opj_tcd_free_tile(opj_tcd_t *tcd);\n\n\nstatic OPJ_BOOL opj_tcd_t2_decode ( opj_tcd_t *p_tcd,\n                                    OPJ_BYTE * p_src_data,\n                                    OPJ_UINT32 * p_data_read,\n                                    OPJ_UINT32 p_max_src_size,\n                                    opj_codestream_index_t *p_cstr_index );\n\nstatic OPJ_BOOL opj_tcd_t1_decode (opj_tcd_t *p_tcd);\n\nstatic OPJ_BOOL opj_tcd_dwt_decode (opj_tcd_t *p_tcd);\n\nstatic OPJ_BOOL opj_tcd_mct_decode (opj_tcd_t *p_tcd);\n\nstatic OPJ_BOOL opj_tcd_dc_level_shift_decode (opj_tcd_t *p_tcd);\n\n\nstatic OPJ_BOOL opj_tcd_dc_level_shift_encode ( opj_tcd_t *p_tcd );\n\nstatic OPJ_BOOL opj_tcd_mct_encode ( opj_tcd_t *p_tcd );\n\nstatic OPJ_BOOL opj_tcd_dwt_encode ( opj_tcd_t *p_tcd );\n\nstatic OPJ_BOOL opj_tcd_t1_encode ( opj_tcd_t *p_tcd );\n\nstatic OPJ_BOOL opj_tcd_t2_encode (     opj_tcd_t *p_tcd,\n                                                                    OPJ_BYTE * p_dest_data,\n                                                                    OPJ_UINT32 * p_data_written,\n                                                                    OPJ_UINT32 p_max_dest_size,\n                                                                    opj_codestream_info_t *p_cstr_info );\n\nstatic OPJ_BOOL opj_tcd_rate_allocate_encode(   opj_tcd_t *p_tcd,\n                                                                                        OPJ_BYTE * p_dest_data,\n                                                                                        OPJ_UINT32 p_max_dest_size,\n                                                                                        opj_codestream_info_t *p_cstr_info );\n\n/* ----------------------------------------------------------------------- */\n\n/**\nCreate a new TCD handle\n*/\nopj_tcd_t* opj_tcd_create(OPJ_BOOL p_is_decoder)\n{\n        opj_tcd_t *l_tcd = 00;\n\n        /* create the tcd structure */\n        l_tcd = (opj_tcd_t*) opj_malloc(sizeof(opj_tcd_t));\n        if (!l_tcd) {\n                return 00;\n        }\n        memset(l_tcd,0,sizeof(opj_tcd_t));\n\n        l_tcd->m_is_decoder = p_is_decoder ? 1 : 0;\n\n        l_tcd->tcd_image = (opj_tcd_image_t*)opj_malloc(sizeof(opj_tcd_image_t));\n        if (!l_tcd->tcd_image) {\n                opj_free(l_tcd);\n                return 00;\n        }\n        memset(l_tcd->tcd_image,0,sizeof(opj_tcd_image_t));\n\n        return l_tcd;\n}\n\n\n/* ----------------------------------------------------------------------- */\n\nvoid opj_tcd_rateallocate_fixed(opj_tcd_t *tcd) {\n        OPJ_UINT32 layno;\n\n        for (layno = 0; layno < tcd->tcp->numlayers; layno++) {\n                opj_tcd_makelayer_fixed(tcd, layno, 1);\n        }\n}\n\n\nvoid opj_tcd_makelayer( opj_tcd_t *tcd,\n                                                OPJ_UINT32 layno,\n                                                OPJ_FLOAT64 thresh,\n                                                OPJ_UINT32 final)\n{\n        OPJ_UINT32 compno, resno, bandno, precno, cblkno;\n        OPJ_UINT32 passno;\n\n        opj_tcd_tile_t *tcd_tile = tcd->tcd_image->tiles;\n\n        tcd_tile->distolayer[layno] = 0;        /* fixed_quality */\n\n        for (compno = 0; compno < tcd_tile->numcomps; compno++) {\n                opj_tcd_tilecomp_t *tilec = &tcd_tile->comps[compno];\n\n                for (resno = 0; resno < tilec->numresolutions; resno++) {\n                        opj_tcd_resolution_t *res = &tilec->resolutions[resno];\n\n                        for (bandno = 0; bandno < res->numbands; bandno++) {\n                                opj_tcd_band_t *band = &res->bands[bandno];\n\n                                for (precno = 0; precno < res->pw * res->ph; precno++) {\n                                        opj_tcd_precinct_t *prc = &band->precincts[precno];\n\n                                        for (cblkno = 0; cblkno < prc->cw * prc->ch; cblkno++) {\n                                                opj_tcd_cblk_enc_t *cblk = &prc->cblks.enc[cblkno];\n                                                opj_tcd_layer_t *layer = &cblk->layers[layno];\n                                                OPJ_UINT32 n;\n\n                                                if (layno == 0) {\n                                                        cblk->numpassesinlayers = 0;\n                                                }\n\n                                                n = cblk->numpassesinlayers;\n\n                                                for (passno = cblk->numpassesinlayers; passno < cblk->totalpasses; passno++) {\n                                                        OPJ_UINT32 dr;\n                                                        OPJ_FLOAT64 dd;\n                                                        opj_tcd_pass_t *pass = &cblk->passes[passno];\n\n                                                        if (n == 0) {\n                                                                dr = pass->rate;\n                                                                dd = pass->distortiondec;\n                                                        } else {\n                                                                dr = pass->rate - cblk->passes[n - 1].rate;\n                                                                dd = pass->distortiondec - cblk->passes[n - 1].distortiondec;\n                                                        }\n\n                                                        if (!dr) {\n                                                                if (dd != 0)\n                                                                        n = passno + 1;\n                                                                continue;\n                                                        }\n                                                        if (dd / dr >= thresh)\n                                                                n = passno + 1;\n                                                }\n\n                                                layer->numpasses = n - cblk->numpassesinlayers;\n\n                                                if (!layer->numpasses) {\n                                                        layer->disto = 0;\n                                                        continue;\n                                                }\n\n                                                if (cblk->numpassesinlayers == 0) {\n                                                        layer->len = cblk->passes[n - 1].rate;\n                                                        layer->data = cblk->data;\n                                                        layer->disto = cblk->passes[n - 1].distortiondec;\n                                                } else {\n                                                        layer->len = cblk->passes[n - 1].rate - cblk->passes[cblk->numpassesinlayers - 1].rate;\n                                                        layer->data = cblk->data + cblk->passes[cblk->numpassesinlayers - 1].rate;\n                                                        layer->disto = cblk->passes[n - 1].distortiondec - cblk->passes[cblk->numpassesinlayers - 1].distortiondec;\n                                                }\n\n                                                tcd_tile->distolayer[layno] += layer->disto;    /* fixed_quality */\n\n                                                if (final)\n                                                        cblk->numpassesinlayers = n;\n                                        }\n                                }\n                        }\n                }\n        }\n}\n\nvoid opj_tcd_makelayer_fixed(opj_tcd_t *tcd, OPJ_UINT32 layno, OPJ_UINT32 final) {\n        OPJ_UINT32 compno, resno, bandno, precno, cblkno;\n        OPJ_INT32 value;                        /*, matrice[tcd_tcp->numlayers][tcd_tile->comps[0].numresolutions][3]; */\n        OPJ_INT32 matrice[10][10][3];\n        OPJ_UINT32 i, j, k;\n\n        opj_cp_t *cp = tcd->cp;\n        opj_tcd_tile_t *tcd_tile = tcd->tcd_image->tiles;\n        opj_tcp_t *tcd_tcp = tcd->tcp;\n\n        for (compno = 0; compno < tcd_tile->numcomps; compno++) {\n                opj_tcd_tilecomp_t *tilec = &tcd_tile->comps[compno];\n\n                for (i = 0; i < tcd_tcp->numlayers; i++) {\n                        for (j = 0; j < tilec->numresolutions; j++) {\n                                for (k = 0; k < 3; k++) {\n                                        matrice[i][j][k] =\n                                                (OPJ_INT32) ((OPJ_FLOAT32)cp->m_specific_param.m_enc.m_matrice[i * tilec->numresolutions * 3 + j * 3 + k]\n                                                * (OPJ_FLOAT32) (tcd->image->comps[compno].prec / 16.0));\n                                }\n                        }\n                }\n\n                for (resno = 0; resno < tilec->numresolutions; resno++) {\n                        opj_tcd_resolution_t *res = &tilec->resolutions[resno];\n\n                        for (bandno = 0; bandno < res->numbands; bandno++) {\n                                opj_tcd_band_t *band = &res->bands[bandno];\n\n                                for (precno = 0; precno < res->pw * res->ph; precno++) {\n                                        opj_tcd_precinct_t *prc = &band->precincts[precno];\n\n                                        for (cblkno = 0; cblkno < prc->cw * prc->ch; cblkno++) {\n                                                opj_tcd_cblk_enc_t *cblk = &prc->cblks.enc[cblkno];\n                                                opj_tcd_layer_t *layer = &cblk->layers[layno];\n                                                OPJ_UINT32 n;\n                                                OPJ_INT32 imsb = (OPJ_INT32)(tcd->image->comps[compno].prec - cblk->numbps); /* number of bit-plan equal to zero */\n\n                                                /* Correction of the matrix of coefficient to include the IMSB information */\n                                                if (layno == 0) {\n                                                        value = matrice[layno][resno][bandno];\n                                                        if (imsb >= value) {\n                                                                value = 0;\n                                                        } else {\n                                                                value -= imsb;\n                                                        }\n                                                } else {\n                                                        value = matrice[layno][resno][bandno] - matrice[layno - 1][resno][bandno];\n                                                        if (imsb >= matrice[layno - 1][resno][bandno]) {\n                                                                value -= (imsb - matrice[layno - 1][resno][bandno]);\n                                                                if (value < 0) {\n                                                                        value = 0;\n                                                                }\n                                                        }\n                                                }\n\n                                                if (layno == 0) {\n                                                        cblk->numpassesinlayers = 0;\n                                                }\n\n                                                n = cblk->numpassesinlayers;\n                                                if (cblk->numpassesinlayers == 0) {\n                                                        if (value != 0) {\n                                                                n = 3 * (OPJ_UINT32)value - 2 + cblk->numpassesinlayers;\n                                                        } else {\n                                                                n = cblk->numpassesinlayers;\n                                                        }\n                                                } else {\n                                                        n = 3 * (OPJ_UINT32)value + cblk->numpassesinlayers;\n                                                }\n\n                                                layer->numpasses = n - cblk->numpassesinlayers;\n\n                                                if (!layer->numpasses)\n                                                        continue;\n\n                                                if (cblk->numpassesinlayers == 0) {\n                                                        layer->len = cblk->passes[n - 1].rate;\n                                                        layer->data = cblk->data;\n                                                } else {\n                                                        layer->len = cblk->passes[n - 1].rate - cblk->passes[cblk->numpassesinlayers - 1].rate;\n                                                        layer->data = cblk->data + cblk->passes[cblk->numpassesinlayers - 1].rate;\n                                                }\n\n                                                if (final)\n                                                        cblk->numpassesinlayers = n;\n                                        }\n                                }\n                        }\n                }\n        }\n}\n\nOPJ_BOOL opj_tcd_rateallocate(  opj_tcd_t *tcd,\n                                                                OPJ_BYTE *dest,\n                                                                OPJ_UINT32 * p_data_written,\n                                                                OPJ_UINT32 len,\n                                                                opj_codestream_info_t *cstr_info)\n{\n        OPJ_UINT32 compno, resno, bandno, precno, cblkno, layno;\n        OPJ_UINT32 passno;\n        OPJ_FLOAT64 min, max;\n        OPJ_FLOAT64 cumdisto[100];      /* fixed_quality */\n        const OPJ_FLOAT64 K = 1;                /* 1.1; fixed_quality */\n        OPJ_FLOAT64 maxSE = 0;\n\n        opj_cp_t *cp = tcd->cp;\n        opj_tcd_tile_t *tcd_tile = tcd->tcd_image->tiles;\n        opj_tcp_t *tcd_tcp = tcd->tcp;\n\n        min = DBL_MAX;\n        max = 0;\n\n        tcd_tile->numpix = 0;           /* fixed_quality */\n\n        for (compno = 0; compno < tcd_tile->numcomps; compno++) {\n                opj_tcd_tilecomp_t *tilec = &tcd_tile->comps[compno];\n                tilec->numpix = 0;\n\n                for (resno = 0; resno < tilec->numresolutions; resno++) {\n                        opj_tcd_resolution_t *res = &tilec->resolutions[resno];\n\n                        for (bandno = 0; bandno < res->numbands; bandno++) {\n                                opj_tcd_band_t *band = &res->bands[bandno];\n\n                                for (precno = 0; precno < res->pw * res->ph; precno++) {\n                                        opj_tcd_precinct_t *prc = &band->precincts[precno];\n\n                                        for (cblkno = 0; cblkno < prc->cw * prc->ch; cblkno++) {\n                                                opj_tcd_cblk_enc_t *cblk = &prc->cblks.enc[cblkno];\n\n                                                for (passno = 0; passno < cblk->totalpasses; passno++) {\n                                                        opj_tcd_pass_t *pass = &cblk->passes[passno];\n                                                        OPJ_INT32 dr;\n                                                        OPJ_FLOAT64 dd, rdslope;\n\n                                                        if (passno == 0) {\n                                                                dr = (OPJ_INT32)pass->rate;\n                                                                dd = pass->distortiondec;\n                                                        } else {\n                                                                dr = (OPJ_INT32)(pass->rate - cblk->passes[passno - 1].rate);\n                                                                dd = pass->distortiondec - cblk->passes[passno - 1].distortiondec;\n                                                        }\n\n                                                        if (dr == 0) {\n                                                                continue;\n                                                        }\n\n                                                        rdslope = dd / dr;\n                                                        if (rdslope < min) {\n                                                                min = rdslope;\n                                                        }\n\n                                                        if (rdslope > max) {\n                                                                max = rdslope;\n                                                        }\n                                                } /* passno */\n\n                                                /* fixed_quality */\n                                                tcd_tile->numpix += ((cblk->x1 - cblk->x0) * (cblk->y1 - cblk->y0));\n                                                tilec->numpix += ((cblk->x1 - cblk->x0) * (cblk->y1 - cblk->y0));\n                                        } /* cbklno */\n                                } /* precno */\n                        } /* bandno */\n                } /* resno */\n\n                maxSE += (((OPJ_FLOAT64)(1 << tcd->image->comps[compno].prec) - 1.0)\n                        * ((OPJ_FLOAT64)(1 << tcd->image->comps[compno].prec) -1.0))\n                        * ((OPJ_FLOAT64)(tilec->numpix));\n        } /* compno */\n\n        /* index file */\n        if(cstr_info) {\n                opj_tile_info_t *tile_info = &cstr_info->tile[tcd->tcd_tileno];\n                tile_info->numpix = tcd_tile->numpix;\n                tile_info->distotile = tcd_tile->distotile;\n                tile_info->thresh = (OPJ_FLOAT64 *) opj_malloc(tcd_tcp->numlayers * sizeof(OPJ_FLOAT64));\n        }\n\n        for (layno = 0; layno < tcd_tcp->numlayers; layno++) {\n                OPJ_FLOAT64 lo = min;\n                OPJ_FLOAT64 hi = max;\n                OPJ_BOOL success = OPJ_FALSE;\n                OPJ_UINT32 maxlen = tcd_tcp->rates[layno] ? opj_uint_min(((OPJ_UINT32) ceil(tcd_tcp->rates[layno])), len) : len;\n                OPJ_FLOAT64 goodthresh = 0;\n                OPJ_FLOAT64 stable_thresh = 0;\n                OPJ_UINT32 i;\n                OPJ_FLOAT64 distotarget;                /* fixed_quality */\n\n                /* fixed_quality */\n                distotarget = tcd_tile->distotile - ((K * maxSE) / pow((OPJ_FLOAT32)10, tcd_tcp->distoratio[layno] / 10));\n\n                /* Don't try to find an optimal threshold but rather take everything not included yet, if\n                  -r xx,yy,zz,0   (disto_alloc == 1 and rates == 0)\n                  -q xx,yy,zz,0   (fixed_quality == 1 and distoratio == 0)\n                  ==> possible to have some lossy layers and the last layer for sure lossless */\n                if ( ((cp->m_specific_param.m_enc.m_disto_alloc==1) && (tcd_tcp->rates[layno]>0)) || ((cp->m_specific_param.m_enc.m_fixed_quality==1) && (tcd_tcp->distoratio[layno]>0))) {\n                        opj_t2_t*t2 = opj_t2_create(tcd->image, cp);\n                        OPJ_FLOAT64 thresh = 0;\n\n                        if (t2 == 00) {\n                                return OPJ_FALSE;\n                        }\n\n                        for     (i = 0; i < 128; ++i) {\n                                OPJ_FLOAT64 distoachieved = 0;  /* fixed_quality */\n\n                                thresh = (lo + hi) / 2;\n\n                                opj_tcd_makelayer(tcd, layno, thresh, 0);\n\n                                if (cp->m_specific_param.m_enc.m_fixed_quality) {       /* fixed_quality */\n                                        if(OPJ_IS_CINEMA(cp->rsiz)){\n                                                if (! opj_t2_encode_packets(t2,tcd->tcd_tileno, tcd_tile, layno + 1, dest, p_data_written, maxlen, cstr_info,tcd->cur_tp_num,tcd->tp_pos,tcd->cur_pino,THRESH_CALC)) {\n\n                                                        lo = thresh;\n                                                        continue;\n                                                }\n                                                else {\n                                                        distoachieved = layno == 0 ?\n                                                                        tcd_tile->distolayer[0] : cumdisto[layno - 1] + tcd_tile->distolayer[layno];\n\n                                                        if (distoachieved < distotarget) {\n                                                                hi=thresh;\n                                                                stable_thresh = thresh;\n                                                                continue;\n                                                        }else{\n                                                                lo=thresh;\n                                                        }\n                                                }\n                                        }else{\n                                                distoachieved = (layno == 0) ?\n                                                                tcd_tile->distolayer[0] : (cumdisto[layno - 1] + tcd_tile->distolayer[layno]);\n\n                                                if (distoachieved < distotarget) {\n                                                        hi = thresh;\n                                                        stable_thresh = thresh;\n                                                        continue;\n                                                }\n                                                lo = thresh;\n                                        }\n                                } else {\n                                        if (! opj_t2_encode_packets(t2, tcd->tcd_tileno, tcd_tile, layno + 1, dest,p_data_written, maxlen, cstr_info,tcd->cur_tp_num,tcd->tp_pos,tcd->cur_pino,THRESH_CALC))\n                                        {\n                                                /* TODO: what to do with l ??? seek / tell ??? */\n                                                /* opj_event_msg(tcd->cinfo, EVT_INFO, \"rate alloc: len=%d, max=%d\\n\", l, maxlen); */\n                                                lo = thresh;\n                                                continue;\n                                        }\n\n                                        hi = thresh;\n                                        stable_thresh = thresh;\n                                }\n                        }\n\n                        success = OPJ_TRUE;\n                        goodthresh = stable_thresh == 0? thresh : stable_thresh;\n\n                        opj_t2_destroy(t2);\n                } else {\n                        success = OPJ_TRUE;\n                        goodthresh = min;\n                }\n\n                if (!success) {\n                        return OPJ_FALSE;\n                }\n\n                if(cstr_info) { /* Threshold for Marcela Index */\n                        cstr_info->tile[tcd->tcd_tileno].thresh[layno] = goodthresh;\n                }\n\n                opj_tcd_makelayer(tcd, layno, goodthresh, 1);\n\n                /* fixed_quality */\n                cumdisto[layno] = (layno == 0) ? tcd_tile->distolayer[0] : (cumdisto[layno - 1] + tcd_tile->distolayer[layno]);\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_tcd_init( opj_tcd_t *p_tcd,\n                                           opj_image_t * p_image,\n                                           opj_cp_t * p_cp )\n{\n        OPJ_UINT32 l_tile_comp_size;\n\n        p_tcd->image = p_image;\n        p_tcd->cp = p_cp;\n\n        p_tcd->tcd_image->tiles = (opj_tcd_tile_t *) opj_malloc(sizeof(opj_tcd_tile_t));\n        if (! p_tcd->tcd_image->tiles) {\n                return OPJ_FALSE;\n        }\n        memset(p_tcd->tcd_image->tiles,0, sizeof(opj_tcd_tile_t));\n\n        l_tile_comp_size = p_image->numcomps * (OPJ_UINT32)sizeof(opj_tcd_tilecomp_t);\n        p_tcd->tcd_image->tiles->comps = (opj_tcd_tilecomp_t *) opj_malloc(l_tile_comp_size);\n        if (! p_tcd->tcd_image->tiles->comps ) {\n                return OPJ_FALSE;\n        }\n        memset( p_tcd->tcd_image->tiles->comps , 0 , l_tile_comp_size);\n\n        p_tcd->tcd_image->tiles->numcomps = p_image->numcomps;\n        p_tcd->tp_pos = p_cp->m_specific_param.m_enc.m_tp_pos;\n\n        return OPJ_TRUE;\n}\n\n/**\nDestroy a previously created TCD handle\n*/\nvoid opj_tcd_destroy(opj_tcd_t *tcd) {\n        if (tcd) {\n                opj_tcd_free_tile(tcd);\n\n                if (tcd->tcd_image) {\n                        opj_free(tcd->tcd_image);\n                        tcd->tcd_image = 00;\n                }\n                opj_free(tcd);\n        }\n}\n\n/* ----------------------------------------------------------------------- */\n#define OPJ_MACRO_TCD_ALLOCATE(FUNCTION,TYPE,FRACTION,ELEMENT,FUNCTION_ELEMENT)                                                                                                                                       \\\nOPJ_BOOL FUNCTION (     opj_tcd_t *p_tcd,                        \\\n                        OPJ_UINT32 p_tile_no                        \\\n                        )                                           \\\n{                                                                   \\\n        OPJ_UINT32 (*l_gain_ptr)(OPJ_UINT32) = 00;                  \\\n        OPJ_UINT32 compno, resno, bandno, precno, cblkno;           \\\n        opj_tcp_t * l_tcp = 00;                                  \\\n        opj_cp_t * l_cp = 00;                                    \\\n        opj_tcd_tile_t * l_tile = 00;                            \\\n        opj_tccp_t *l_tccp = 00;                                    \\\n        opj_tcd_tilecomp_t *l_tilec = 00;                        \\\n        opj_image_comp_t * l_image_comp = 00;                       \\\n        opj_tcd_resolution_t *l_res = 00;                        \\\n        opj_tcd_band_t *l_band = 00;                             \\\n        opj_stepsize_t * l_step_size = 00;                          \\\n        opj_tcd_precinct_t *l_current_precinct = 00;             \\\n        TYPE* l_code_block = 00;                                    \\\n        opj_image_t *l_image = 00;                                  \\\n        OPJ_UINT32 p,q;                                             \\\n        OPJ_UINT32 l_level_no;                                      \\\n        OPJ_UINT32 l_pdx, l_pdy;                                    \\\n        OPJ_UINT32 l_gain;                                          \\\n        OPJ_INT32 l_x0b, l_y0b;                                     \\\n        /* extent of precincts , top left, bottom right**/          \\\n        OPJ_INT32 l_tl_prc_x_start, l_tl_prc_y_start, l_br_prc_x_end, l_br_prc_y_end;                                                                                                                             \\\n        /* number of precinct for a resolution */                   \\\n        OPJ_UINT32 l_nb_precincts;                                  \\\n        /* room needed to store l_nb_precinct precinct for a resolution */                                                                                                                                        \\\n        OPJ_UINT32 l_nb_precinct_size;                              \\\n        /* number of code blocks for a precinct*/                   \\\n        OPJ_UINT32 l_nb_code_blocks;                                \\\n        /* room needed to store l_nb_code_blocks code blocks for a precinct*/                                                                                                                                     \\\n        OPJ_UINT32 l_nb_code_blocks_size;                           \\\n        /* size of data for a tile */                               \\\n        OPJ_UINT32 l_data_size;                                     \\\n                                                                    \\\n        l_cp = p_tcd->cp;                                           \\\n        l_tcp = &(l_cp->tcps[p_tile_no]);                           \\\n        l_tile = p_tcd->tcd_image->tiles;                           \\\n        l_tccp = l_tcp->tccps;                                      \\\n        l_tilec = l_tile->comps;                                    \\\n        l_image = p_tcd->image;                                     \\\n        l_image_comp = p_tcd->image->comps;                         \\\n                                                                    \\\n        p = p_tile_no % l_cp->tw;       /* tile coordinates */      \\\n        q = p_tile_no / l_cp->tw;                                   \\\n        /*fprintf(stderr, \"Tile coordinate = %d,%d\\n\", p, q);*/     \\\n                                                                    \\\n        /* 4 borders of the tile rescale on the image if necessary */                                                                                                                                             \\\n        l_tile->x0 = opj_int_max((OPJ_INT32)(l_cp->tx0 + p * l_cp->tdx), (OPJ_INT32)l_image->x0);                                                                                                                                             \\\n        l_tile->y0 = opj_int_max((OPJ_INT32)(l_cp->ty0 + q * l_cp->tdy), (OPJ_INT32)l_image->y0);                                                                                                                                             \\\n        l_tile->x1 = opj_int_min((OPJ_INT32)(l_cp->tx0 + (p + 1) * l_cp->tdx), (OPJ_INT32)l_image->x1);                                                                                                                                       \\\n        l_tile->y1 = opj_int_min((OPJ_INT32)(l_cp->ty0 + (q + 1) * l_cp->tdy), (OPJ_INT32)l_image->y1);                                                                                                                                       \\\n        /* testcase 1888.pdf.asan.35.988 */ \\\n        if (l_tccp->numresolutions == 0) { \\\n            fprintf(stderr, \"tiles require at least one resolution\\n\"); \\\n            return OPJ_FALSE; \\\n        } \\\n        /*fprintf(stderr, \"Tile border = %d,%d,%d,%d\\n\", l_tile->x0, l_tile->y0,l_tile->x1,l_tile->y1);*/                                                                                                         \\\n                                                                    \\\n        /*tile->numcomps = image->numcomps; */                      \\\n        for(compno = 0; compno < l_tile->numcomps; ++compno) {      \\\n                /*fprintf(stderr, \"compno = %d/%d\\n\", compno, l_tile->numcomps);*/                                                                                                                                \\\n                                                                    \\\n                /* border of each l_tile component (global) */      \\\n                l_tilec->x0 = opj_int_ceildiv(l_tile->x0, (OPJ_INT32)l_image_comp->dx);                                                                                                                                          \\\n                l_tilec->y0 = opj_int_ceildiv(l_tile->y0, (OPJ_INT32)l_image_comp->dy);                                                                                                                                          \\\n                l_tilec->x1 = opj_int_ceildiv(l_tile->x1, (OPJ_INT32)l_image_comp->dx);                                                                                                                                          \\\n                l_tilec->y1 = opj_int_ceildiv(l_tile->y1, (OPJ_INT32)l_image_comp->dy);                                                                                                                                          \\\n                /*fprintf(stderr, \"\\tTile compo border = %d,%d,%d,%d\\n\", l_tilec->x0, l_tilec->y0,l_tilec->x1,l_tilec->y1);*/                                                                                     \\\n                                                                    \\\n                l_data_size = (OPJ_UINT32)(l_tilec->x1 - l_tilec->x0)           \\\n                * (OPJ_UINT32)(l_tilec->y1 - l_tilec->y0) * (OPJ_UINT32)sizeof(OPJ_UINT32 );\\\n                l_tilec->numresolutions = l_tccp->numresolutions;   \\\n                if (l_tccp->numresolutions < l_cp->m_specific_param.m_dec.m_reduce) {                                                                                                                             \\\n                        l_tilec->minimum_num_resolutions = 1;       \\\n                }                                                   \\\n                else {                                              \\\n                        l_tilec->minimum_num_resolutions = l_tccp->numresolutions                                                                                                                                 \\\n                        - l_cp->m_specific_param.m_dec.m_reduce;    \\\n                }                                                   \\\n                                                                    \\\n                if (l_tilec->data == 00) {                          \\\n                        l_tilec->data = (OPJ_INT32 *) opj_malloc(l_data_size);                                                                                                                                    \\\n                        if (! l_tilec->data ) {                     \\\n                                return OPJ_FALSE;                   \\\n                        }                                           \\\n                        /*fprintf(stderr, \"\\tAllocate data of tilec (int): %d x OPJ_UINT32\\n\",l_data_size);*/                                                                                                     \\\n                                                                    \\\n                        l_tilec->data_size = l_data_size;           \\\n                }                                                   \\\n                else if (l_data_size > l_tilec->data_size) {        \\\n                        OPJ_INT32 * new_data = (OPJ_INT32 *) opj_realloc(l_tilec->data, l_data_size);                                                                                                             \\\n                        /* opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to handle tile data\\n\");                                                                                                 */  \\\n                        fprintf(stderr, \"Not enough memory to handle tile data\\n\");                                                                                                                               \\\n                        if (! new_data) {                           \\\n                                opj_free(l_tilec->data);            \\\n                                l_tilec->data = NULL;               \\\n                                l_tilec->data_size = 0;             \\\n                                return OPJ_FALSE;                   \\\n                        }                                           \\\n                        l_tilec->data = new_data;                   \\\n                        /*fprintf(stderr, \"\\tReallocate data of tilec (int): from %d to %d x OPJ_UINT32\\n\", l_tilec->data_size, l_data_size);*/                                                                   \\\n                        l_tilec->data_size = l_data_size;           \\\n                }                                                   \\\n                                                                    \\\n                l_data_size = l_tilec->numresolutions * (OPJ_UINT32)sizeof(opj_tcd_resolution_t);                                                                                                                          \\\n                                                                    \\\n                if (l_tilec->resolutions == 00) {                   \\\n                        l_tilec->resolutions = (opj_tcd_resolution_t *) opj_malloc(l_data_size);                                                                                                               \\\n                        if (! l_tilec->resolutions ) {              \\\n                                return OPJ_FALSE;                   \\\n                        }                                           \\\n                        /*fprintf(stderr, \"\\tAllocate resolutions of tilec (opj_tcd_resolution_t): %d\\n\",l_data_size);*/                                                                                       \\\n                        l_tilec->resolutions_size = l_data_size;    \\\n                        memset(l_tilec->resolutions,0,l_data_size); \\\n                }                                                   \\\n                else if (l_data_size > l_tilec->resolutions_size) { \\\n                        opj_tcd_resolution_t* new_resolutions = (opj_tcd_resolution_t *) opj_realloc(l_tilec->resolutions, l_data_size);                                                                    \\\n                        if (! new_resolutions) {                    \\\n                                /* opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to tile resolutions\\n\");                                                                                         */  \\\n                                fprintf(stderr, \"Not enough memory to tile resolutions\\n\");                                                                                                                       \\\n                                opj_free(l_tilec->resolutions);     \\\n                                l_tilec->resolutions = NULL;        \\\n                                l_tilec->resolutions_size = 0;      \\\n                                return OPJ_FALSE;                   \\\n                        }                                           \\\n                        l_tilec->resolutions = new_resolutions;     \\\n                        /*fprintf(stderr, \"\\tReallocate data of tilec (int): from %d to %d x OPJ_UINT32\\n\", l_tilec->resolutions_size, l_data_size);*/                                                            \\\n                        memset(((OPJ_BYTE*) l_tilec->resolutions)+l_tilec->resolutions_size,0,l_data_size - l_tilec->resolutions_size);                                                                           \\\n                        l_tilec->resolutions_size = l_data_size;    \\\n                }                                                   \\\n                                                                    \\\n                l_level_no = l_tilec->numresolutions - 1;           \\\n                l_res = l_tilec->resolutions;                       \\\n                l_step_size = l_tccp->stepsizes;                    \\\n                if (l_tccp->qmfbid == 0) {                          \\\n                        l_gain_ptr = &opj_dwt_getgain_real;         \\\n                }                                                   \\\n                else {                                              \\\n                        l_gain_ptr  = &opj_dwt_getgain;             \\\n                }                                                   \\\n                /*fprintf(stderr, \"\\tlevel_no=%d\\n\",l_level_no);*/  \\\n                                                                                                                                                                                                                  \\\n                for(resno = 0; resno < l_tilec->numresolutions; ++resno) {                                                                                                                                        \\\n                        /*fprintf(stderr, \"\\t\\tresno = %d/%d\\n\", resno, l_tilec->numresolutions);*/                                                                                                               \\\n                        OPJ_INT32 tlcbgxstart, tlcbgystart /*, brcbgxend, brcbgyend*/;                                                                                                                                 \\\n                        OPJ_UINT32 cbgwidthexpn, cbgheightexpn;                                                                                                                                                   \\\n                        OPJ_UINT32 cblkwidthexpn, cblkheightexpn;                                                                                                                                                 \\\n                                                                                                                                                                                                                  \\\n                        /* border for each resolution level (global) */                                                                                                                                           \\\n                        l_res->x0 = opj_int_ceildivpow2(l_tilec->x0, (OPJ_INT32)l_level_no);                                                                                                                                     \\\n                        l_res->y0 = opj_int_ceildivpow2(l_tilec->y0, (OPJ_INT32)l_level_no);                                                                                                                                     \\\n                        l_res->x1 = opj_int_ceildivpow2(l_tilec->x1, (OPJ_INT32)l_level_no);                                                                                                                                     \\\n                        l_res->y1 = opj_int_ceildivpow2(l_tilec->y1, (OPJ_INT32)l_level_no);                                                                                                                                     \\\n                        /*fprintf(stderr, \"\\t\\t\\tres_x0= %d, res_y0 =%d, res_x1=%d, res_y1=%d\\n\", l_res->x0, l_res->y0, l_res->x1, l_res->y1);*/                                                                  \\\n                        /* p. 35, table A-23, ISO/IEC FDIS154444-1 : 2000 (18 august 2000) */                                                                                                                     \\\n                        l_pdx = l_tccp->prcw[resno];                                                                                                                                                              \\\n                        l_pdy = l_tccp->prch[resno];                                                                                                                                                              \\\n                        /*fprintf(stderr, \"\\t\\t\\tpdx=%d, pdy=%d\\n\", l_pdx, l_pdy);*/                                                                                                                              \\\n                        /* p. 64, B.6, ISO/IEC FDIS15444-1 : 2000 (18 august 2000)  */                                                                                                                            \\\n                        l_tl_prc_x_start = opj_int_floordivpow2(l_res->x0, (OPJ_INT32)l_pdx) << l_pdx;                                                                                                                           \\\n                        l_tl_prc_y_start = opj_int_floordivpow2(l_res->y0, (OPJ_INT32)l_pdy) << l_pdy;                                                                                                                           \\\n                        l_br_prc_x_end = opj_int_ceildivpow2(l_res->x1, (OPJ_INT32)l_pdx) << l_pdx;                                                                                                                              \\\n                        l_br_prc_y_end = opj_int_ceildivpow2(l_res->y1, (OPJ_INT32)l_pdy) << l_pdy;                                                                                                                              \\\n                        /*fprintf(stderr, \"\\t\\t\\tprc_x_start=%d, prc_y_start=%d, br_prc_x_end=%d, br_prc_y_end=%d \\n\", l_tl_prc_x_start, l_tl_prc_y_start, l_br_prc_x_end ,l_br_prc_y_end );*/                    \\\n                                                                                                                                                                                                                  \\\n                        l_res->pw = (l_res->x0 == l_res->x1) ? 0 : (OPJ_UINT32)((l_br_prc_x_end - l_tl_prc_x_start) >> l_pdx);                                                                                                \\\n                        l_res->ph = (l_res->y0 == l_res->y1) ? 0 : (OPJ_UINT32)((l_br_prc_y_end - l_tl_prc_y_start) >> l_pdy);                                                                                                \\\n                        /*fprintf(stderr, \"\\t\\t\\tres_pw=%d, res_ph=%d\\n\", l_res->pw, l_res->ph );*/                                                                                                               \\\n                                                                                                                                                                                                                  \\\n                        l_nb_precincts = l_res->pw * l_res->ph;                                                                                                                                                   \\\n                        l_nb_precinct_size = l_nb_precincts * (OPJ_UINT32)sizeof(opj_tcd_precinct_t);                                                                                                                      \\\n                        if (resno == 0) {                                                                                                                                                                         \\\n                                tlcbgxstart = l_tl_prc_x_start;                                                                                                                                                   \\\n                                tlcbgystart = l_tl_prc_y_start;                                                                                                                                                   \\\n                                /*brcbgxend = l_br_prc_x_end;*/                                                                                                                                                       \\\n                               /* brcbgyend = l_br_prc_y_end;*/                                                                                                                                                       \\\n                                cbgwidthexpn = l_pdx;                                                                                                                                                             \\\n                                cbgheightexpn = l_pdy;                                                                                                                                                            \\\n                                l_res->numbands = 1;                                                                                                                                                              \\\n                        }                                                                                                                                                                                         \\\n                        else {                                                                                                                                                                                    \\\n                                tlcbgxstart = opj_int_ceildivpow2(l_tl_prc_x_start, 1);                                                                                                                               \\\n                                tlcbgystart = opj_int_ceildivpow2(l_tl_prc_y_start, 1);                                                                                                                               \\\n                                /*brcbgxend = opj_int_ceildivpow2(l_br_prc_x_end, 1);*/                                                                                                                            \\\n                                /*brcbgyend = opj_int_ceildivpow2(l_br_prc_y_end, 1);*/                                                                                                                            \\\n                                cbgwidthexpn = l_pdx - 1;                                                                                                                                                         \\\n                                cbgheightexpn = l_pdy - 1;                                                                                                                                                        \\\n                                l_res->numbands = 3;                                                                                                                                                              \\\n                        }                                                                                                                                                                                         \\\n                                                                                                                                                                                                                  \\\n                        cblkwidthexpn = opj_uint_min(l_tccp->cblkw, cbgwidthexpn);                                                                                                                                    \\\n                        cblkheightexpn = opj_uint_min(l_tccp->cblkh, cbgheightexpn);                                                                                                                                  \\\n                        l_band = l_res->bands;                                                                                                                                                                    \\\n                                                                                                                                                                                                                  \\\n                        for (bandno = 0; bandno < l_res->numbands; ++bandno) {                                                                                                                                    \\\n                                OPJ_INT32 numbps;                                                                                                                                                                 \\\n                                /*fprintf(stderr, \"\\t\\t\\tband_no=%d/%d\\n\", bandno, l_res->numbands );*/                                                                                                           \\\n                                                                                                                                                                                                                  \\\n                                if (resno == 0) {                                                                                                                                                                 \\\n                                        l_band->bandno = 0 ;                                                                                                                                                      \\\n                                        l_band->x0 = opj_int_ceildivpow2(l_tilec->x0, (OPJ_INT32)l_level_no);                                                                                                                    \\\n                                        l_band->y0 = opj_int_ceildivpow2(l_tilec->y0, (OPJ_INT32)l_level_no);                                                                                                                    \\\n                                        l_band->x1 = opj_int_ceildivpow2(l_tilec->x1, (OPJ_INT32)l_level_no);                                                                                                                    \\\n                                        l_band->y1 = opj_int_ceildivpow2(l_tilec->y1, (OPJ_INT32)l_level_no);                                                                                                                    \\\n                                }                                                                                                                                                                                 \\\n                                else {                                                                                                                                                                            \\\n                                        l_band->bandno = bandno + 1;                                                                                                                                              \\\n                                        /* x0b = 1 if bandno = 1 or 3 */                                                                                                                                          \\\n                                        l_x0b = l_band->bandno&1;                                                                                                                                                 \\\n                                        /* y0b = 1 if bandno = 2 or 3 */                                                                                                                                          \\\n                                        l_y0b = (OPJ_INT32)((l_band->bandno)>>1);                                                                                                                                              \\\n                                        /* l_band border (global) */                                                                                                                                              \\\n                                        l_band->x0 = opj_int_ceildivpow2(l_tilec->x0 - (1 << l_level_no) * l_x0b, (OPJ_INT32)(l_level_no + 1));                                                                                    \\\n                                        l_band->y0 = opj_int_ceildivpow2(l_tilec->y0 - (1 << l_level_no) * l_y0b, (OPJ_INT32)(l_level_no + 1));                                                                                    \\\n                                        l_band->x1 = opj_int_ceildivpow2(l_tilec->x1 - (1 << l_level_no) * l_x0b, (OPJ_INT32)(l_level_no + 1));                                                                                    \\\n                                        l_band->y1 = opj_int_ceildivpow2(l_tilec->y1 - (1 << l_level_no) * l_y0b, (OPJ_INT32)(l_level_no + 1));                                                                                    \\\n                                }                                                                                                                                                                                 \\\n                                                                                                                                                                                                                  \\\n                                /** avoid an if with storing function pointer */                                                                                                                                  \\\n                                l_gain = (*l_gain_ptr) (l_band->bandno);                                                                                                                                          \\\n                                numbps = (OPJ_INT32)(l_image_comp->prec + l_gain);                                                                                                                                             \\\n                                l_band->stepsize = (OPJ_FLOAT32)(((1.0 + l_step_size->mant / 2048.0) * pow(2.0, (OPJ_INT32) (numbps - l_step_size->expn)))) * FRACTION;                                           \\\n                                l_band->numbps = l_step_size->expn + (OPJ_INT32)l_tccp->numgbits - 1;      /* WHY -1 ? */                                                                                                    \\\n                                                                                                                                                                                                                  \\\n                                if (! l_band->precincts) {                                                                                                                                                        \\\n                                        l_band->precincts = (opj_tcd_precinct_t *) opj_malloc( /*3 * */ l_nb_precinct_size);                                                                                   \\\n                                        if (! l_band->precincts) {                                                                                                                                                \\\n                                                return OPJ_FALSE;                                                                                                                                                 \\\n                                        }                                                                                                                                                                         \\\n                                        /*fprintf(stderr, \"\\t\\t\\t\\tAllocate precincts of a band (opj_tcd_precinct_t): %d\\n\",l_nb_precinct_size);     */                                                        \\\n                                        memset(l_band->precincts,0,l_nb_precinct_size);                                                                                                                           \\\n                                        l_band->precincts_data_size = l_nb_precinct_size;                                                                                                                         \\\n                                }                                                                                                                                                                                 \\\n                                else if (l_band->precincts_data_size < l_nb_precinct_size) {                                                                                                                      \\\n                                                                                                                                                                                                                  \\\n                                        opj_tcd_precinct_t * new_precincts = (opj_tcd_precinct_t *) opj_realloc(l_band->precincts,/*3 * */ l_nb_precinct_size);                                             \\\n                                        if (! new_precincts) {                                                                                                                                                    \\\n                                                /* opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory to handle band precints\\n\");                                                                    */   \\\n                                                fprintf(stderr, \"Not enough memory to handle band precints\\n\");                                                                                                   \\\n                                                opj_free(l_band->precincts);                                                                                                                                      \\\n                                                l_band->precincts = NULL;                                                                                                                                         \\\n                                                l_band->precincts_data_size = 0;                                                                                                                                  \\\n                                                return OPJ_FALSE;                                                                                                                                                 \\\n                                        }                                                                                                                                                                         \\\n                                        l_band->precincts = new_precincts;                                                                                                                                        \\\n                                        /*fprintf(stderr, \"\\t\\t\\t\\tReallocate precincts of a band (opj_tcd_precinct_t): from %d to %d\\n\",l_band->precincts_data_size, l_nb_precinct_size);*/                   \\\n                                        memset(((OPJ_BYTE *) l_band->precincts) + l_band->precincts_data_size,0,l_nb_precinct_size - l_band->precincts_data_size);                                                \\\n                                        l_band->precincts_data_size = l_nb_precinct_size;                                                                                                                         \\\n                                }                                                                                                                                                                                 \\\n                                                                                                                                                                                                                  \\\n                                l_current_precinct = l_band->precincts;                                                                                                                                           \\\n                                for     (precno = 0; precno < l_nb_precincts; ++precno) {                                                                                                                         \\\n                                        OPJ_INT32 tlcblkxstart, tlcblkystart, brcblkxend, brcblkyend;                                                                                                             \\\n                                        OPJ_INT32 cbgxstart = tlcbgxstart + (OPJ_INT32)(precno % l_res->pw) * (1 << cbgwidthexpn);                                                                                           \\\n                                        OPJ_INT32 cbgystart = tlcbgystart + (OPJ_INT32)(precno / l_res->pw) * (1 << cbgheightexpn);                                                                                          \\\n                                        OPJ_INT32 cbgxend = cbgxstart + (1 << cbgwidthexpn);                                                                                                                      \\\n                                        OPJ_INT32 cbgyend = cbgystart + (1 << cbgheightexpn);                                                                                                                     \\\n                                        /*fprintf(stderr, \"\\t precno=%d; bandno=%d, resno=%d; compno=%d\\n\", precno, bandno , resno, compno);*/                                                                    \\\n                                        /*fprintf(stderr, \"\\t tlcbgxstart(=%d) + (precno(=%d) percent res->pw(=%d)) * (1 << cbgwidthexpn(=%d)) \\n\",tlcbgxstart,precno,l_res->pw,cbgwidthexpn);*/                  \\\n                                                                                                                                                                                                                  \\\n                                        /* precinct size (global) */                                                                                                                                              \\\n                                        /*fprintf(stderr, \"\\t cbgxstart=%d, l_band->x0 = %d \\n\",cbgxstart, l_band->x0);*/                                                                                         \\\n                                                                                                                                                                                                                  \\\n                                        l_current_precinct->x0 = opj_int_max(cbgxstart, l_band->x0);                                                                                                                  \\\n                                        l_current_precinct->y0 = opj_int_max(cbgystart, l_band->y0);                                                                                                                  \\\n                                        l_current_precinct->x1 = opj_int_min(cbgxend, l_band->x1);                                                                                                                    \\\n                                        l_current_precinct->y1 = opj_int_min(cbgyend, l_band->y1);                                                                                                                    \\\n                                        /*fprintf(stderr, \"\\t prc_x0=%d; prc_y0=%d, prc_x1=%d; prc_y1=%d\\n\",l_current_precinct->x0, l_current_precinct->y0 ,l_current_precinct->x1, l_current_precinct->y1);*/    \\\n                                                                                                                                                                                                                  \\\n                                        tlcblkxstart = opj_int_floordivpow2(l_current_precinct->x0, (OPJ_INT32)cblkwidthexpn) << cblkwidthexpn;                                                                                  \\\n                                        /*fprintf(stderr, \"\\t tlcblkxstart =%d\\n\",tlcblkxstart );*/                                                                                                               \\\n                                        tlcblkystart = opj_int_floordivpow2(l_current_precinct->y0, (OPJ_INT32)cblkheightexpn) << cblkheightexpn;                                                                                \\\n                                        /*fprintf(stderr, \"\\t tlcblkystart =%d\\n\",tlcblkystart );*/                                                                                                               \\\n                                        brcblkxend = opj_int_ceildivpow2(l_current_precinct->x1, (OPJ_INT32)cblkwidthexpn) << cblkwidthexpn;                                                                                     \\\n                                        /*fprintf(stderr, \"\\t brcblkxend =%d\\n\",brcblkxend );*/                                                                                                                   \\\n                                        brcblkyend = opj_int_ceildivpow2(l_current_precinct->y1, (OPJ_INT32)cblkheightexpn) << cblkheightexpn;                                                                                   \\\n                                        /*fprintf(stderr, \"\\t brcblkyend =%d\\n\",brcblkyend );*/                                                                                                                   \\\n                                        l_current_precinct->cw = (OPJ_UINT32)((brcblkxend - tlcblkxstart) >> cblkwidthexpn);                                                                                                    \\\n                                        l_current_precinct->ch = (OPJ_UINT32)((brcblkyend - tlcblkystart) >> cblkheightexpn);                                                                                                   \\\n                                                                                                                                                                                                                  \\\n                                        l_nb_code_blocks = l_current_precinct->cw * l_current_precinct->ch;                                                                                                       \\\n                                        /*fprintf(stderr, \"\\t\\t\\t\\t precinct_cw = %d x recinct_ch = %d\\n\",l_current_precinct->cw, l_current_precinct->ch);      */                                                \\\n                                        l_nb_code_blocks_size = l_nb_code_blocks * (OPJ_UINT32)sizeof(TYPE);                                                                                                                  \\\n                                                                                                                                                                                                                  \\\n                                        if (! l_current_precinct->cblks.ELEMENT) {                                                                                                                                \\\n                                                l_current_precinct->cblks.ELEMENT = (TYPE*) opj_malloc(l_nb_code_blocks_size);                                                                                    \\\n                                                if (! l_current_precinct->cblks.ELEMENT ) {                                                                                                                       \\\n                                                        return OPJ_FALSE;                                                                                                                                         \\\n                                                }                                                                                                                                                                 \\\n                                                /*fprintf(stderr, \"\\t\\t\\t\\tAllocate cblks of a precinct (opj_tcd_cblk_dec_t): %d\\n\",l_nb_code_blocks_size);*/                                                  \\\n                                                                                                                                                                                                                  \\\n                                                memset(l_current_precinct->cblks.ELEMENT,0,l_nb_code_blocks_size);                                                                                                \\\n                                                                                                                                                                                                                  \\\n                                                l_current_precinct->block_size = l_nb_code_blocks_size;                                                                                                           \\\n                                        }                                                                                                                                                                         \\\n                                        else if (l_nb_code_blocks_size > l_current_precinct->block_size) {                                                                                                        \\\n                                                TYPE *new_ELEMENT = (TYPE*) opj_realloc(l_current_precinct->cblks.ELEMENT, l_nb_code_blocks_size);                                                                \\\n                                                if (! new_ELEMENT) {                                                                                                                                              \\\n                                                        opj_free(l_current_precinct->cblks.ELEMENT);                                                                                                              \\\n                                                        l_current_precinct->cblks.ELEMENT = NULL;                                                                                                                 \\\n                                                        l_current_precinct->block_size = 0;                                                                                                                       \\\n                                                        /* opj_event_msg(p_manager, EVT_ERROR, \"Not enough memory for current precinct codeblock element\\n\");                                              */  \\\n                                                        fprintf(stderr, \"Not enough memory for current precinct codeblock element\\n\");                                                                            \\\n                                                        return OPJ_FALSE;                                                                                                                                         \\\n                                                }                                                                                                                                                                 \\\n                                                l_current_precinct->cblks.ELEMENT = new_ELEMENT;                                                                                                                  \\\n                                                /*fprintf(stderr, \"\\t\\t\\t\\tReallocate cblks of a precinct (opj_tcd_cblk_dec_t): from %d to %d\\n\",l_current_precinct->block_size, l_nb_code_blocks_size);     */\\\n                                                                                                                                                                                                                  \\\n                                                memset(((OPJ_BYTE *) l_current_precinct->cblks.ELEMENT) + l_current_precinct->block_size                                                                          \\\n                                                                ,0                                                                                                                                                \\\n                                                                ,l_nb_code_blocks_size - l_current_precinct->block_size);                                                                                         \\\n                                                                                                                                                                                                                  \\\n                                                l_current_precinct->block_size = l_nb_code_blocks_size;                                                                                                           \\\n                                        }                                                                                                                                                                         \\\n                                                                                                                                                                                                                  \\\n                                        if (! l_current_precinct->incltree) {                                                                                                                                     \\\n                                                l_current_precinct->incltree = opj_tgt_create(l_current_precinct->cw,                                                                                              \\\n                                                                l_current_precinct->ch);                                                                                                                          \\\n                                        }                                                                                                                                                                         \\\n                                        else{                                                                                                                                                                     \\\n                                                l_current_precinct->incltree = opj_tgt_init(l_current_precinct->incltree,                                                                                             \\\n                                                                l_current_precinct->cw,                                                                                                                           \\\n                                                                l_current_precinct->ch);                                                                                                                          \\\n                                        }                                                                                                                                                                         \\\n                                                                                                                                                                                                                  \\\n                                        if (! l_current_precinct->incltree)     {                                                                                                                                 \\\n                                                fprintf(stderr, \"WARNING: No incltree created.\\n\");                                                                                                               \\\n                                                /*return OPJ_FALSE;*/                                                                                                                                             \\\n                                        }                                                                                                                                                                         \\\n                                                                                                                                                                                                                  \\\n                                        if (! l_current_precinct->imsbtree) {                                                                                                                                     \\\n                                                l_current_precinct->imsbtree = opj_tgt_create(                                                                                                                     \\\n                                                                l_current_precinct->cw,                                                                                                                           \\\n                                                                l_current_precinct->ch);                                                                                                                          \\\n                                        }                                                                                                                                                                         \\\n                                        else {                                                                                                                                                                    \\\n                                                l_current_precinct->imsbtree = opj_tgt_init(                                                                                                                          \\\n                                                                l_current_precinct->imsbtree,                                                                                                                     \\\n                                                                l_current_precinct->cw,                                                                                                                           \\\n                                                                l_current_precinct->ch);                                                                                                                          \\\n                                        }                                                                                                                                                                         \\\n                                                                                                                                                                                                                  \\\n                                        if (! l_current_precinct->imsbtree) {                                                                                                                                     \\\n                                                fprintf(stderr, \"WARNING: No imsbtree created.\\n\");                                                                                                               \\\n                                                /*return OPJ_FALSE;*/                                                                                                                                             \\\n                                        }                                                                                                                                                                         \\\n                                                                                                                                                                                                                  \\\n                                        l_code_block = l_current_precinct->cblks.ELEMENT;                                                                                                                         \\\n                                                                                                                                                                                                                  \\\n                                        for (cblkno = 0; cblkno < l_nb_code_blocks; ++cblkno) {                                                                                                                   \\\n                                                OPJ_INT32 cblkxstart = tlcblkxstart + (OPJ_INT32)(cblkno % l_current_precinct->cw) * (1 << cblkwidthexpn);                                                                   \\\n                                                OPJ_INT32 cblkystart = tlcblkystart + (OPJ_INT32)(cblkno / l_current_precinct->cw) * (1 << cblkheightexpn);                                                                  \\\n                                                OPJ_INT32 cblkxend = cblkxstart + (1 << cblkwidthexpn);                                                                                                           \\\n                                                OPJ_INT32 cblkyend = cblkystart + (1 << cblkheightexpn);                                                                                                          \\\n                                                                                                                                                                                                                  \\\n                                                /* code-block size (global) */                                                                                                                                    \\\n                                                l_code_block->x0 = opj_int_max(cblkxstart, l_current_precinct->x0);                                                                                                   \\\n                                                l_code_block->y0 = opj_int_max(cblkystart, l_current_precinct->y0);                                                                                                   \\\n                                                l_code_block->x1 = opj_int_min(cblkxend, l_current_precinct->x1);                                                                                                     \\\n                                                l_code_block->y1 = opj_int_min(cblkyend, l_current_precinct->y1);                                                                                                     \\\n                                                                                                                                                                                                                  \\\n                                                if (! FUNCTION_ELEMENT(l_code_block)) {                                                                                                                           \\\n                                                        return OPJ_FALSE;                                                                                                                                         \\\n                                                }                                                                                                                                                                 \\\n                                                ++l_code_block;                                                                                                                                                   \\\n                                        }                                                                                                                                                                         \\\n                                        ++l_current_precinct;                                                                                                                                                     \\\n                                } /* precno */                                                                                                                                                                    \\\n                                ++l_band;                                                                                                                                                                         \\\n                                ++l_step_size;                                                                                                                                                                    \\\n                        } /* bandno */                                                                                                                                                                            \\\n                        ++l_res;                                                                                                                                                                                  \\\n                        --l_level_no;                                                                                                                                                                             \\\n                } /* resno */                                                                                                                                                                                     \\\n                ++l_tccp;                                                                                                                                                                                         \\\n                ++l_tilec;                                                                                                                                                                                        \\\n                ++l_image_comp;                                                                                                                                                                                   \\\n        } /* compno */                                                                                                                                                                                            \\\n        return OPJ_TRUE;                                                                                                                                                                                          \\\n}                                                                                                                                                                                                                 \\\n\n\nOPJ_MACRO_TCD_ALLOCATE(opj_tcd_init_encode_tile, opj_tcd_cblk_enc_t, 1.f, enc, opj_tcd_code_block_enc_allocate)\nOPJ_MACRO_TCD_ALLOCATE(opj_tcd_init_decode_tile, opj_tcd_cblk_dec_t, 0.5f, dec, opj_tcd_code_block_dec_allocate)\n\n#undef OPJ_MACRO_TCD_ALLOCATE\n\n/**\n * Allocates memory for an encoding code block.\n */\nOPJ_BOOL opj_tcd_code_block_enc_allocate (opj_tcd_cblk_enc_t * p_code_block)\n{\n        if (! p_code_block->data) {\n\n                p_code_block->data = (OPJ_BYTE*) opj_malloc(OPJ_J2K_DEFAULT_CBLK_DATA_SIZE*2); /*why +1 ?*/\n                if(! p_code_block->data) {\n                        return OPJ_FALSE;\n                }\n\n                p_code_block->data[0] = 0;\n                p_code_block->data+=1;\n\n                /* no memset since data */\n                p_code_block->layers = (opj_tcd_layer_t*) opj_malloc(100 * sizeof(opj_tcd_layer_t));\n                if (! p_code_block->layers) {\n                        return OPJ_FALSE;\n                }\n\n                p_code_block->passes = (opj_tcd_pass_t*) opj_malloc(100 * sizeof(opj_tcd_pass_t));\n                if (! p_code_block->passes) {\n                        return OPJ_FALSE;\n                }\n        }\n\n        memset(p_code_block->layers,0,100 * sizeof(opj_tcd_layer_t));\n        memset(p_code_block->passes,0,100 * sizeof(opj_tcd_pass_t));\n\n        return OPJ_TRUE;\n}\n\n/**\n * Allocates memory for a decoding code block.\n */\nOPJ_BOOL opj_tcd_code_block_dec_allocate (opj_tcd_cblk_dec_t * p_code_block)\n{\n        OPJ_UINT32 l_seg_size;\n\n        if (! p_code_block->data) {\n\n                p_code_block->data = (OPJ_BYTE*) opj_malloc(OPJ_J2K_DEFAULT_CBLK_DATA_SIZE);\n                if (! p_code_block->data) {\n                        return OPJ_FALSE;\n                }\n                p_code_block->data_max_size = OPJ_J2K_DEFAULT_CBLK_DATA_SIZE;\n                /*fprintf(stderr, \"Allocate 8192 elements of code_block->data\\n\");*/\n\n                l_seg_size = OPJ_J2K_DEFAULT_NB_SEGS * sizeof(opj_tcd_seg_t);\n                p_code_block->segs = (opj_tcd_seg_t *) opj_malloc(l_seg_size);\n                if (! p_code_block->segs) {\n                        return OPJ_FALSE;\n                }\n                memset(p_code_block->segs,0,l_seg_size);\n                /*fprintf(stderr, \"Allocate %d elements of code_block->data\\n\", OPJ_J2K_DEFAULT_NB_SEGS * sizeof(opj_tcd_seg_t));*/\n\n                p_code_block->m_current_max_segs = OPJ_J2K_DEFAULT_NB_SEGS;\n                /*fprintf(stderr, \"m_current_max_segs of code_block->data = %d\\n\", p_code_block->m_current_max_segs);*/\n        }\n        /* TODO */\n        /*p_code_block->numsegs = 0; */\n\n        return OPJ_TRUE;\n}\n\nOPJ_UINT32 opj_tcd_get_decoded_tile_size ( opj_tcd_t *p_tcd )\n{\n        OPJ_UINT32 i;\n        OPJ_UINT32 l_data_size = 0;\n        opj_image_comp_t * l_img_comp = 00;\n        opj_tcd_tilecomp_t * l_tile_comp = 00;\n        opj_tcd_resolution_t * l_res = 00;\n        OPJ_UINT32 l_size_comp, l_remaining;\n\n        l_tile_comp = p_tcd->tcd_image->tiles->comps;\n        l_img_comp = p_tcd->image->comps;\n\n        for (i=0;i<p_tcd->image->numcomps;++i) {\n                l_size_comp = l_img_comp->prec >> 3; /*(/ 8)*/\n                l_remaining = l_img_comp->prec & 7;  /* (%8) */\n\n                if(l_remaining) {\n                        ++l_size_comp;\n                }\n\n                if (l_size_comp == 3) {\n                        l_size_comp = 4;\n                }\n\n                l_res = l_tile_comp->resolutions + l_tile_comp->minimum_num_resolutions - 1;\n                l_data_size += l_size_comp * (OPJ_UINT32)((l_res->x1 - l_res->x0) * (l_res->y1 - l_res->y0));\n                ++l_img_comp;\n                ++l_tile_comp;\n        }\n\n        return l_data_size;\n}\n\nOPJ_BOOL opj_tcd_encode_tile(   opj_tcd_t *p_tcd,\n                                                        OPJ_UINT32 p_tile_no,\n                                                        OPJ_BYTE *p_dest,\n                                                        OPJ_UINT32 * p_data_written,\n                                                        OPJ_UINT32 p_max_length,\n                                                        opj_codestream_info_t *p_cstr_info)\n{\n\n        if (p_tcd->cur_tp_num == 0) {\n\n                p_tcd->tcd_tileno = p_tile_no;\n                p_tcd->tcp = &p_tcd->cp->tcps[p_tile_no];\n\n                /* INDEX >> \"Precinct_nb_X et Precinct_nb_Y\" */\n                if(p_cstr_info)  {\n                        OPJ_UINT32 l_num_packs = 0;\n                        OPJ_UINT32 i;\n                        opj_tcd_tilecomp_t *l_tilec_idx = &p_tcd->tcd_image->tiles->comps[0];        /* based on component 0 */\n                        opj_tccp_t *l_tccp = p_tcd->tcp->tccps; /* based on component 0 */\n\n                        for (i = 0; i < l_tilec_idx->numresolutions; i++) {\n                                opj_tcd_resolution_t *l_res_idx = &l_tilec_idx->resolutions[i];\n\n                                p_cstr_info->tile[p_tile_no].pw[i] = (int)l_res_idx->pw;\n                                p_cstr_info->tile[p_tile_no].ph[i] = (int)l_res_idx->ph;\n\n                                l_num_packs += l_res_idx->pw * l_res_idx->ph;\n                                p_cstr_info->tile[p_tile_no].pdx[i] = (int)l_tccp->prcw[i];\n                                p_cstr_info->tile[p_tile_no].pdy[i] = (int)l_tccp->prch[i];\n                        }\n                        p_cstr_info->tile[p_tile_no].packet = (opj_packet_info_t*) opj_calloc((size_t)p_cstr_info->numcomps * (size_t)p_cstr_info->numlayers * l_num_packs, sizeof(opj_packet_info_t));\n                }\n                /* << INDEX */\n\n                /* FIXME _ProfStart(PGROUP_DC_SHIFT); */\n                /*---------------TILE-------------------*/\n                if (! opj_tcd_dc_level_shift_encode(p_tcd)) {\n                        return OPJ_FALSE;\n                }\n                /* FIXME _ProfStop(PGROUP_DC_SHIFT); */\n\n                /* FIXME _ProfStart(PGROUP_MCT); */\n                if (! opj_tcd_mct_encode(p_tcd)) {\n                        return OPJ_FALSE;\n                }\n                /* FIXME _ProfStop(PGROUP_MCT); */\n\n                /* FIXME _ProfStart(PGROUP_DWT); */\n                if (! opj_tcd_dwt_encode(p_tcd)) {\n                        return OPJ_FALSE;\n                }\n                /* FIXME  _ProfStop(PGROUP_DWT); */\n\n                /* FIXME  _ProfStart(PGROUP_T1); */\n                if (! opj_tcd_t1_encode(p_tcd)) {\n                        return OPJ_FALSE;\n                }\n                /* FIXME _ProfStop(PGROUP_T1); */\n\n                /* FIXME _ProfStart(PGROUP_RATE); */\n                if (! opj_tcd_rate_allocate_encode(p_tcd,p_dest,p_max_length,p_cstr_info)) {\n                        return OPJ_FALSE;\n                }\n                /* FIXME _ProfStop(PGROUP_RATE); */\n\n        }\n        /*--------------TIER2------------------*/\n\n        /* INDEX */\n        if (p_cstr_info) {\n                p_cstr_info->index_write = 1;\n        }\n        /* FIXME _ProfStart(PGROUP_T2); */\n\n        if (! opj_tcd_t2_encode(p_tcd,p_dest,p_data_written,p_max_length,p_cstr_info)) {\n                return OPJ_FALSE;\n        }\n        /* FIXME _ProfStop(PGROUP_T2); */\n\n        /*---------------CLEAN-------------------*/\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_tcd_decode_tile(   opj_tcd_t *p_tcd,\n                                OPJ_BYTE *p_src,\n                                OPJ_UINT32 p_max_length,\n                                OPJ_UINT32 p_tile_no,\n                                opj_codestream_index_t *p_cstr_index\n                                )\n{\n        OPJ_UINT32 l_data_read;\n        p_tcd->tcd_tileno = p_tile_no;\n        p_tcd->tcp = &(p_tcd->cp->tcps[p_tile_no]);\n\n#ifdef TODO_MSD /* FIXME */\n        /* INDEX >>  */\n        if(p_cstr_info) {\n                OPJ_UINT32 resno, compno, numprec = 0;\n                for (compno = 0; compno < (OPJ_UINT32) p_cstr_info->numcomps; compno++) {\n                        opj_tcp_t *tcp = &p_tcd->cp->tcps[0];\n                        opj_tccp_t *tccp = &tcp->tccps[compno];\n                        opj_tcd_tilecomp_t *tilec_idx = &p_tcd->tcd_image->tiles->comps[compno];\n                        for (resno = 0; resno < tilec_idx->numresolutions; resno++) {\n                                opj_tcd_resolution_t *res_idx = &tilec_idx->resolutions[resno];\n                                p_cstr_info->tile[p_tile_no].pw[resno] = res_idx->pw;\n                                p_cstr_info->tile[p_tile_no].ph[resno] = res_idx->ph;\n                                numprec += res_idx->pw * res_idx->ph;\n                                p_cstr_info->tile[p_tile_no].pdx[resno] = tccp->prcw[resno];\n                                p_cstr_info->tile[p_tile_no].pdy[resno] = tccp->prch[resno];\n                        }\n                }\n                p_cstr_info->tile[p_tile_no].packet = (opj_packet_info_t *) opj_malloc(p_cstr_info->numlayers * numprec * sizeof(opj_packet_info_t));\n                p_cstr_info->packno = 0;\n        }\n        /* << INDEX */\n#endif\n\n        /*--------------TIER2------------------*/\n        /* FIXME _ProfStart(PGROUP_T2); */\n        l_data_read = 0;\n        if (! opj_tcd_t2_decode(p_tcd, p_src, &l_data_read, p_max_length, p_cstr_index))\n        {\n                return OPJ_FALSE;\n        }\n        /* FIXME _ProfStop(PGROUP_T2); */\n\n        /*------------------TIER1-----------------*/\n\n        /* FIXME _ProfStart(PGROUP_T1); */\n        if\n                (! opj_tcd_t1_decode(p_tcd))\n        {\n                return OPJ_FALSE;\n        }\n        /* FIXME _ProfStop(PGROUP_T1); */\n\n        /*----------------DWT---------------------*/\n\n        /* FIXME _ProfStart(PGROUP_DWT); */\n        if\n                (! opj_tcd_dwt_decode(p_tcd))\n        {\n                return OPJ_FALSE;\n        }\n        /* FIXME _ProfStop(PGROUP_DWT); */\n\n        /*----------------MCT-------------------*/\n        /* FIXME _ProfStart(PGROUP_MCT); */\n        if\n                (! opj_tcd_mct_decode(p_tcd))\n        {\n                return OPJ_FALSE;\n        }\n        /* FIXME _ProfStop(PGROUP_MCT); */\n\n        /* FIXME _ProfStart(PGROUP_DC_SHIFT); */\n        if\n                (! opj_tcd_dc_level_shift_decode(p_tcd))\n        {\n                return OPJ_FALSE;\n        }\n        /* FIXME _ProfStop(PGROUP_DC_SHIFT); */\n\n\n        /*---------------TILE-------------------*/\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_tcd_update_tile_data ( opj_tcd_t *p_tcd,\n                                    OPJ_BYTE * p_dest,\n                                    OPJ_UINT32 p_dest_length\n                                    )\n{\n        OPJ_UINT32 i,j,k,l_data_size = 0;\n        opj_image_comp_t * l_img_comp = 00;\n        opj_tcd_tilecomp_t * l_tilec = 00;\n        opj_tcd_resolution_t * l_res;\n        OPJ_UINT32 l_size_comp, l_remaining;\n        OPJ_UINT32 l_stride, l_width,l_height;\n\n        l_data_size = opj_tcd_get_decoded_tile_size(p_tcd);\n        if (l_data_size > p_dest_length) {\n                return OPJ_FALSE;\n        }\n\n        l_tilec = p_tcd->tcd_image->tiles->comps;\n        l_img_comp = p_tcd->image->comps;\n\n        for (i=0;i<p_tcd->image->numcomps;++i) {\n                l_size_comp = l_img_comp->prec >> 3; /*(/ 8)*/\n                l_remaining = l_img_comp->prec & 7;  /* (%8) */\n                l_res = l_tilec->resolutions + l_img_comp->resno_decoded;\n                l_width = (OPJ_UINT32)(l_res->x1 - l_res->x0);\n                l_height = (OPJ_UINT32)(l_res->y1 - l_res->y0);\n                l_stride = (OPJ_UINT32)(l_tilec->x1 - l_tilec->x0) - l_width;\n\n                if (l_remaining) {\n                        ++l_size_comp;\n                }\n\n                if (l_size_comp == 3) {\n                        l_size_comp = 4;\n                }\n\n                switch (l_size_comp)\n                        {\n                        case 1:\n                                {\n                                        OPJ_CHAR * l_dest_ptr = (OPJ_CHAR *) p_dest;\n                                        const OPJ_INT32 * l_src_ptr = l_tilec->data;\n\n                                        if (l_img_comp->sgnd) {\n                                                for (j=0;j<l_height;++j) {\n                                                        for (k=0;k<l_width;++k) {\n                                                                *(l_dest_ptr++) = (OPJ_CHAR) (*(l_src_ptr++));\n                                                        }\n                                                        l_src_ptr += l_stride;\n                                                }\n                                        }\n                                        else {\n                                                for (j=0;j<l_height;++j) {\n                                                        for     (k=0;k<l_width;++k) {\n                                                                *(l_dest_ptr++) = (OPJ_CHAR) ((*(l_src_ptr++))&0xff);\n                                                        }\n                                                        l_src_ptr += l_stride;\n                                                }\n                                        }\n\n                                        p_dest = (OPJ_BYTE *)l_dest_ptr;\n                                }\n                                break;\n                        case 2:\n                                {\n                                        const OPJ_INT32 * l_src_ptr = l_tilec->data;\n                                        OPJ_INT16 * l_dest_ptr = (OPJ_INT16 *) p_dest;\n\n                                        if (l_img_comp->sgnd) {\n                                                for (j=0;j<l_height;++j) {\n                                                        for (k=0;k<l_width;++k) {\n                                                                *(l_dest_ptr++) = (OPJ_INT16) (*(l_src_ptr++));\n                                                        }\n                                                        l_src_ptr += l_stride;\n                                                }\n                                        }\n                                        else {\n                                                for (j=0;j<l_height;++j) {\n                                                        for (k=0;k<l_width;++k) {\n                                                                *(l_dest_ptr++) = (OPJ_INT16) ((*(l_src_ptr++))&0xffff);\n                                                        }\n                                                        l_src_ptr += l_stride;\n                                                }\n                                        }\n\n                                        p_dest = (OPJ_BYTE*) l_dest_ptr;\n                                }\n                                break;\n                        case 4:\n                                {\n                                        OPJ_INT32 * l_dest_ptr = (OPJ_INT32 *) p_dest;\n                                        OPJ_INT32 * l_src_ptr = l_tilec->data;\n\n                                        for (j=0;j<l_height;++j) {\n                                                for (k=0;k<l_width;++k) {\n                                                        *(l_dest_ptr++) = (*(l_src_ptr++));\n                                                }\n                                                l_src_ptr += l_stride;\n                                        }\n\n                                        p_dest = (OPJ_BYTE*) l_dest_ptr;\n                                }\n                                break;\n                }\n\n                ++l_img_comp;\n                ++l_tilec;\n        }\n\n        return OPJ_TRUE;\n}\n\n\n\n\nvoid opj_tcd_free_tile(opj_tcd_t *p_tcd)\n{\n        OPJ_UINT32 compno, resno, bandno, precno;\n        opj_tcd_tile_t *l_tile = 00;\n        opj_tcd_tilecomp_t *l_tile_comp = 00;\n        opj_tcd_resolution_t *l_res = 00;\n        opj_tcd_band_t *l_band = 00;\n        opj_tcd_precinct_t *l_precinct = 00;\n        OPJ_UINT32 l_nb_resolutions, l_nb_precincts;\n        void (* l_tcd_code_block_deallocate) (opj_tcd_precinct_t *) = 00;\n\n        if (! p_tcd) {\n                return;\n        }\n\n        if (! p_tcd->tcd_image) {\n                return;\n        }\n\n        if (p_tcd->m_is_decoder) {\n                l_tcd_code_block_deallocate = opj_tcd_code_block_dec_deallocate;\n        }\n        else {\n                l_tcd_code_block_deallocate = opj_tcd_code_block_enc_deallocate;\n        }\n\n        l_tile = p_tcd->tcd_image->tiles;\n        if (! l_tile) {\n                return;\n        }\n\n        l_tile_comp = l_tile->comps;\n\n        for (compno = 0; compno < l_tile->numcomps; ++compno) {\n                l_res = l_tile_comp->resolutions;\n                if (l_res) {\n\n                        l_nb_resolutions = l_tile_comp->resolutions_size / sizeof(opj_tcd_resolution_t);\n                        for (resno = 0; resno < l_nb_resolutions; ++resno) {\n                                l_band = l_res->bands;\n                                for     (bandno = 0; bandno < 3; ++bandno) {\n                                        l_precinct = l_band->precincts;\n                                        if (l_precinct) {\n\n                                                l_nb_precincts = l_band->precincts_data_size / sizeof(opj_tcd_precinct_t);\n                                                for (precno = 0; precno < l_nb_precincts; ++precno) {\n                                                        opj_tgt_destroy(l_precinct->incltree);\n                                                        l_precinct->incltree = 00;\n                                                        opj_tgt_destroy(l_precinct->imsbtree);\n                                                        l_precinct->imsbtree = 00;\n                                                        (*l_tcd_code_block_deallocate) (l_precinct);\n                                                        ++l_precinct;\n                                                }\n\n                                                opj_free(l_band->precincts);\n                                                l_band->precincts = 00;\n                                        }\n                                        ++l_band;\n                                } /* for (resno */\n                                ++l_res;\n                        }\n\n                        opj_free(l_tile_comp->resolutions);\n                        l_tile_comp->resolutions = 00;\n                }\n\n                if (l_tile_comp->data) {\n                        opj_free(l_tile_comp->data);\n                        l_tile_comp->data = 00;\n                }\n                ++l_tile_comp;\n        }\n\n        opj_free(l_tile->comps);\n        l_tile->comps = 00;\n        opj_free(p_tcd->tcd_image->tiles);\n        p_tcd->tcd_image->tiles = 00;\n}\n\n\nOPJ_BOOL opj_tcd_t2_decode (opj_tcd_t *p_tcd,\n                            OPJ_BYTE * p_src_data,\n                            OPJ_UINT32 * p_data_read,\n                            OPJ_UINT32 p_max_src_size,\n                            opj_codestream_index_t *p_cstr_index\n                            )\n{\n        opj_t2_t * l_t2;\n\n        l_t2 = opj_t2_create(p_tcd->image, p_tcd->cp);\n        if (l_t2 == 00) {\n                return OPJ_FALSE;\n        }\n\n        if (! opj_t2_decode_packets(\n                                        l_t2,\n                                        p_tcd->tcd_tileno,\n                                        p_tcd->tcd_image->tiles,\n                                        p_src_data,\n                                        p_data_read,\n                                        p_max_src_size,\n                                        p_cstr_index)) {\n                opj_t2_destroy(l_t2);\n                return OPJ_FALSE;\n        }\n\n        opj_t2_destroy(l_t2);\n\n        /*---------------CLEAN-------------------*/\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_tcd_t1_decode ( opj_tcd_t *p_tcd )\n{\n        OPJ_UINT32 compno;\n        opj_t1_t * l_t1;\n        opj_tcd_tile_t * l_tile = p_tcd->tcd_image->tiles;\n        opj_tcd_tilecomp_t* l_tile_comp = l_tile->comps;\n        opj_tccp_t * l_tccp = p_tcd->tcp->tccps;\n\n\n        l_t1 = opj_t1_create();\n        if (l_t1 == 00) {\n                return OPJ_FALSE;\n        }\n\n        for (compno = 0; compno < l_tile->numcomps; ++compno) {\n                /* The +3 is headroom required by the vectorized DWT */\n                if (OPJ_FALSE == opj_t1_decode_cblks(l_t1, l_tile_comp, l_tccp)) {\n                        opj_t1_destroy(l_t1);\n                        return OPJ_FALSE;\n                }\n                ++l_tile_comp;\n                ++l_tccp;\n        }\n\n        opj_t1_destroy(l_t1);\n\n        return OPJ_TRUE;\n}\n\n\nOPJ_BOOL opj_tcd_dwt_decode ( opj_tcd_t *p_tcd )\n{\n        OPJ_UINT32 compno;\n        opj_tcd_tile_t * l_tile = p_tcd->tcd_image->tiles;\n        opj_tcd_tilecomp_t * l_tile_comp = l_tile->comps;\n        opj_tccp_t * l_tccp = p_tcd->tcp->tccps;\n        opj_image_comp_t * l_img_comp = p_tcd->image->comps;\n\n        for (compno = 0; compno < l_tile->numcomps; compno++) {\n                /*\n                if (tcd->cp->reduce != 0) {\n                        tcd->image->comps[compno].resno_decoded =\n                                tile->comps[compno].numresolutions - tcd->cp->reduce - 1;\n                        if (tcd->image->comps[compno].resno_decoded < 0)\n                        {\n                                return false;\n                        }\n                }\n                numres2decode = tcd->image->comps[compno].resno_decoded + 1;\n                if(numres2decode > 0){\n                */\n\n                if (l_tccp->qmfbid == 1) {\n                        if (! opj_dwt_decode(l_tile_comp, l_img_comp->resno_decoded+1)) {\n                                return OPJ_FALSE;\n                        }\n                }\n                else {\n                        if (! opj_dwt_decode_real(l_tile_comp, l_img_comp->resno_decoded+1)) {\n                                return OPJ_FALSE;\n                        }\n                }\n\n                ++l_tile_comp;\n                ++l_img_comp;\n                ++l_tccp;\n        }\n\n        return OPJ_TRUE;\n}\nOPJ_BOOL opj_tcd_mct_decode ( opj_tcd_t *p_tcd )\n{\n        opj_tcd_tile_t * l_tile = p_tcd->tcd_image->tiles;\n        opj_tcp_t * l_tcp = p_tcd->tcp;\n        opj_tcd_tilecomp_t * l_tile_comp = l_tile->comps;\n        OPJ_UINT32 l_samples,i;\n\n        if (! l_tcp->mct) {\n                return OPJ_TRUE;\n        }\n\n        l_samples = (OPJ_UINT32)((l_tile_comp->x1 - l_tile_comp->x0) * (l_tile_comp->y1 - l_tile_comp->y0));\n\n        if (l_tile->numcomps >= 3 ){\n                /* testcase 1336.pdf.asan.47.376 */\n                if ((l_tile->comps[0].x1 - l_tile->comps[0].x0) * (l_tile->comps[0].y1 - l_tile->comps[0].y0) < (OPJ_INT32)l_samples ||\n                    (l_tile->comps[1].x1 - l_tile->comps[1].x0) * (l_tile->comps[1].y1 - l_tile->comps[1].y0) < (OPJ_INT32)l_samples ||\n                    (l_tile->comps[2].x1 - l_tile->comps[2].x0) * (l_tile->comps[2].y1 - l_tile->comps[2].y0) < (OPJ_INT32)l_samples) {\n                        fprintf(stderr, \"Tiles don't all have the same dimension. Skip the MCT step.\\n\");\n                        return OPJ_FALSE;\n                }\n                else if (l_tcp->mct == 2) {\n                        OPJ_BYTE ** l_data;\n\n                        if (! l_tcp->m_mct_decoding_matrix) {\n                                return OPJ_TRUE;\n                        }\n\n                        l_data = (OPJ_BYTE **) opj_malloc(l_tile->numcomps*sizeof(OPJ_BYTE*));\n                        if (! l_data) {\n                                return OPJ_FALSE;\n                        }\n\n                        for (i=0;i<l_tile->numcomps;++i) {\n                                l_data[i] = (OPJ_BYTE*) l_tile_comp->data;\n                                ++l_tile_comp;\n                        }\n\n                        if (! opj_mct_decode_custom(/* MCT data */\n                                                                        (OPJ_BYTE*) l_tcp->m_mct_decoding_matrix,\n                                                                        /* size of components */\n                                                                        l_samples,\n                                                                        /* components */\n                                                                        l_data,\n                                                                        /* nb of components (i.e. size of pData) */\n                                                                        l_tile->numcomps,\n                                                                        /* tells if the data is signed */\n                                                                        p_tcd->image->comps->sgnd)) {\n                                opj_free(l_data);\n                                return OPJ_FALSE;\n                        }\n\n                        opj_free(l_data);\n                }\n                else {\n                        if (l_tcp->tccps->qmfbid == 1) {\n                                opj_mct_decode(     l_tile->comps[0].data,\n                                                        l_tile->comps[1].data,\n                                                        l_tile->comps[2].data,\n                                                        l_samples);\n                        }\n                        else {\n                            opj_mct_decode_real((OPJ_FLOAT32*)l_tile->comps[0].data,\n                                                (OPJ_FLOAT32*)l_tile->comps[1].data,\n                                                (OPJ_FLOAT32*)l_tile->comps[2].data,\n                                                l_samples);\n                        }\n                }\n        }\n        else {\n                /* FIXME need to use opj_event_msg function */\n                fprintf(stderr,\"Number of components (%d) is inconsistent with a MCT. Skip the MCT step.\\n\",l_tile->numcomps);\n        }\n\n        return OPJ_TRUE;\n}\n\n\nOPJ_BOOL opj_tcd_dc_level_shift_decode ( opj_tcd_t *p_tcd )\n{\n        OPJ_UINT32 compno;\n        opj_tcd_tilecomp_t * l_tile_comp = 00;\n        opj_tccp_t * l_tccp = 00;\n        opj_image_comp_t * l_img_comp = 00;\n        opj_tcd_resolution_t* l_res = 00;\n        opj_tcd_tile_t * l_tile;\n        OPJ_UINT32 l_width,l_height,i,j;\n        OPJ_INT32 * l_current_ptr;\n        OPJ_INT32 l_min, l_max;\n        OPJ_UINT32 l_stride;\n\n        l_tile = p_tcd->tcd_image->tiles;\n        l_tile_comp = l_tile->comps;\n        l_tccp = p_tcd->tcp->tccps;\n        l_img_comp = p_tcd->image->comps;\n\n        for (compno = 0; compno < l_tile->numcomps; compno++) {\n                l_res = l_tile_comp->resolutions + l_img_comp->resno_decoded;\n                l_width = (OPJ_UINT32)(l_res->x1 - l_res->x0);\n                l_height = (OPJ_UINT32)(l_res->y1 - l_res->y0);\n                l_stride = (OPJ_UINT32)(l_tile_comp->x1 - l_tile_comp->x0) - l_width;\n\n                assert(l_height == 0 || l_width + l_stride <= l_tile_comp->data_size / l_height); /*MUPDF*/\n\n                if (l_img_comp->sgnd) {\n                        l_min = -(1 << (l_img_comp->prec - 1));\n                        l_max = (1 << (l_img_comp->prec - 1)) - 1;\n                }\n                else {\n            l_min = 0;\n                        l_max = (1 << l_img_comp->prec) - 1;\n                }\n\n                l_current_ptr = l_tile_comp->data;\n\n                if (l_tccp->qmfbid == 1) {\n                        for (j=0;j<l_height;++j) {\n                                for (i = 0; i < l_width; ++i) {\n                                        *l_current_ptr = opj_int_clamp(*l_current_ptr + l_tccp->m_dc_level_shift, l_min, l_max);\n                                        ++l_current_ptr;\n                                }\n                                l_current_ptr += l_stride;\n                        }\n                }\n                else {\n                        for (j=0;j<l_height;++j) {\n                                for (i = 0; i < l_width; ++i) {\n                                        OPJ_FLOAT32 l_value = *((OPJ_FLOAT32 *) l_current_ptr);\n                                        *l_current_ptr = opj_int_clamp((OPJ_INT32)lrintf(l_value) + l_tccp->m_dc_level_shift, l_min, l_max); ;\n                                        ++l_current_ptr;\n                                }\n                                l_current_ptr += l_stride;\n                        }\n                }\n\n                ++l_img_comp;\n                ++l_tccp;\n                ++l_tile_comp;\n        }\n\n        return OPJ_TRUE;\n}\n\n\n\n/**\n * Deallocates the encoding data of the given precinct.\n */\nvoid opj_tcd_code_block_dec_deallocate (opj_tcd_precinct_t * p_precinct)\n{\n        OPJ_UINT32 cblkno , l_nb_code_blocks;\n\n        opj_tcd_cblk_dec_t * l_code_block = p_precinct->cblks.dec;\n        if (l_code_block) {\n                /*fprintf(stderr,\"deallocate codeblock:{\\n\");*/\n                /*fprintf(stderr,\"\\t x0=%d, y0=%d, x1=%d, y1=%d\\n\",l_code_block->x0, l_code_block->y0, l_code_block->x1, l_code_block->y1);*/\n                /*fprintf(stderr,\"\\t numbps=%d, numlenbits=%d, len=%d, numnewpasses=%d, real_num_segs=%d, m_current_max_segs=%d\\n \",\n                                l_code_block->numbps, l_code_block->numlenbits, l_code_block->len, l_code_block->numnewpasses, l_code_block->real_num_segs, l_code_block->m_current_max_segs );*/\n\n\n                l_nb_code_blocks = p_precinct->block_size / sizeof(opj_tcd_cblk_dec_t);\n                /*fprintf(stderr,\"nb_code_blocks =%d\\t}\\n\", l_nb_code_blocks);*/\n\n                for (cblkno = 0; cblkno < l_nb_code_blocks; ++cblkno) {\n\n                        if (l_code_block->data) {\n                                opj_free(l_code_block->data);\n                                l_code_block->data = 00;\n                        }\n\n                        if (l_code_block->segs) {\n                                opj_free(l_code_block->segs );\n                                l_code_block->segs = 00;\n                        }\n\n                        ++l_code_block;\n                }\n\n                opj_free(p_precinct->cblks.dec);\n                p_precinct->cblks.dec = 00;\n        }\n}\n\n/**\n * Deallocates the encoding data of the given precinct.\n */\nvoid opj_tcd_code_block_enc_deallocate (opj_tcd_precinct_t * p_precinct)\n{       \n        OPJ_UINT32 cblkno , l_nb_code_blocks;\n\n        opj_tcd_cblk_enc_t * l_code_block = p_precinct->cblks.enc;\n        if (l_code_block) {\n                l_nb_code_blocks = p_precinct->block_size / sizeof(opj_tcd_cblk_enc_t);\n                \n                for     (cblkno = 0; cblkno < l_nb_code_blocks; ++cblkno)  {\n                        if (l_code_block->data) {\n                                opj_free(l_code_block->data - 1);\n                                l_code_block->data = 00;\n                        }\n\n                        if (l_code_block->layers) {\n                                opj_free(l_code_block->layers );\n                                l_code_block->layers = 00;\n                        }\n\n                        if (l_code_block->passes) {\n                                opj_free(l_code_block->passes );\n                                l_code_block->passes = 00;\n                        }\n                        ++l_code_block;\n                }\n\n                opj_free(p_precinct->cblks.enc);\n                \n                p_precinct->cblks.enc = 00;\n        }\n}\n\nOPJ_UINT32 opj_tcd_get_encoded_tile_size ( opj_tcd_t *p_tcd )\n{\n        OPJ_UINT32 i,l_data_size = 0;\n        opj_image_comp_t * l_img_comp = 00;\n        opj_tcd_tilecomp_t * l_tilec = 00;\n        OPJ_UINT32 l_size_comp, l_remaining;\n\n        l_tilec = p_tcd->tcd_image->tiles->comps;\n        l_img_comp = p_tcd->image->comps;\n        for (i=0;i<p_tcd->image->numcomps;++i) {\n                l_size_comp = l_img_comp->prec >> 3; /*(/ 8)*/\n                l_remaining = l_img_comp->prec & 7;  /* (%8) */\n\n                if (l_remaining) {\n                        ++l_size_comp;\n                }\n\n                if (l_size_comp == 3) {\n                        l_size_comp = 4;\n                }\n\n                l_data_size += l_size_comp * (OPJ_UINT32)((l_tilec->x1 - l_tilec->x0) * (l_tilec->y1 - l_tilec->y0));\n                ++l_img_comp;\n                ++l_tilec;\n        }\n\n        return l_data_size;\n}\n                \nOPJ_BOOL opj_tcd_dc_level_shift_encode ( opj_tcd_t *p_tcd )\n{\n        OPJ_UINT32 compno;\n        opj_tcd_tilecomp_t * l_tile_comp = 00;\n        opj_tccp_t * l_tccp = 00;\n        opj_image_comp_t * l_img_comp = 00;\n        opj_tcd_tile_t * l_tile;\n        OPJ_UINT32 l_nb_elem,i;\n        OPJ_INT32 * l_current_ptr;\n\n        l_tile = p_tcd->tcd_image->tiles;\n        l_tile_comp = l_tile->comps;\n        l_tccp = p_tcd->tcp->tccps;\n        l_img_comp = p_tcd->image->comps;\n\n        for (compno = 0; compno < l_tile->numcomps; compno++) {\n                l_current_ptr = l_tile_comp->data;\n                l_nb_elem = (OPJ_UINT32)((l_tile_comp->x1 - l_tile_comp->x0) * (l_tile_comp->y1 - l_tile_comp->y0));\n\n                if (l_tccp->qmfbid == 1) {\n                        for     (i = 0; i < l_nb_elem; ++i) {\n                                *l_current_ptr -= l_tccp->m_dc_level_shift ;\n                                ++l_current_ptr;\n                        }\n                }\n                else {\n                        for (i = 0; i < l_nb_elem; ++i) {\n                                *l_current_ptr = (*l_current_ptr - l_tccp->m_dc_level_shift) << 11 ;\n                                ++l_current_ptr;\n                        }\n                }\n\n                ++l_img_comp;\n                ++l_tccp;\n                ++l_tile_comp;\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_tcd_mct_encode ( opj_tcd_t *p_tcd )\n{\n        opj_tcd_tile_t * l_tile = p_tcd->tcd_image->tiles;\n        opj_tcd_tilecomp_t * l_tile_comp = p_tcd->tcd_image->tiles->comps;\n        OPJ_UINT32 samples = (OPJ_UINT32)((l_tile_comp->x1 - l_tile_comp->x0) * (l_tile_comp->y1 - l_tile_comp->y0));\n        OPJ_UINT32 i;\n        OPJ_BYTE ** l_data = 00;\n        opj_tcp_t * l_tcp = p_tcd->tcp;\n\n        if(!p_tcd->tcp->mct) {\n                return OPJ_TRUE;\n        }\n\n        if (p_tcd->tcp->mct == 2) {\n                if (! p_tcd->tcp->m_mct_coding_matrix) {\n                        return OPJ_TRUE;\n                }\n\n        l_data = (OPJ_BYTE **) opj_malloc(l_tile->numcomps*sizeof(OPJ_BYTE*));\n                if (! l_data) {\n                        return OPJ_FALSE;\n                }\n\n                for (i=0;i<l_tile->numcomps;++i) {\n                        l_data[i] = (OPJ_BYTE*) l_tile_comp->data;\n                        ++l_tile_comp;\n                }\n\n                if (! opj_mct_encode_custom(/* MCT data */\n                                        (OPJ_BYTE*) p_tcd->tcp->m_mct_coding_matrix,\n                                        /* size of components */\n                                        samples,\n                                        /* components */\n                                        l_data,\n                                        /* nb of components (i.e. size of pData) */\n                                        l_tile->numcomps,\n                                        /* tells if the data is signed */\n                                        p_tcd->image->comps->sgnd) )\n                {\n            opj_free(l_data);\n                        return OPJ_FALSE;\n                }\n\n                opj_free(l_data);\n        }\n        else if (l_tcp->tccps->qmfbid == 0) {\n                opj_mct_encode_real(l_tile->comps[0].data, l_tile->comps[1].data, l_tile->comps[2].data, samples);\n        }\n        else {\n                opj_mct_encode(l_tile->comps[0].data, l_tile->comps[1].data, l_tile->comps[2].data, samples);\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_tcd_dwt_encode ( opj_tcd_t *p_tcd )\n{\n        opj_tcd_tile_t * l_tile = p_tcd->tcd_image->tiles;\n        opj_tcd_tilecomp_t * l_tile_comp = p_tcd->tcd_image->tiles->comps;\n        opj_tccp_t * l_tccp = p_tcd->tcp->tccps;\n        OPJ_UINT32 compno;\n\n        for (compno = 0; compno < l_tile->numcomps; ++compno) {\n                if (l_tccp->qmfbid == 1) {\n                        if (! opj_dwt_encode(l_tile_comp)) {\n                                return OPJ_FALSE;\n                        }\n                }\n                else if (l_tccp->qmfbid == 0) {\n                        if (! opj_dwt_encode_real(l_tile_comp)) {\n                                return OPJ_FALSE;\n                        }\n                }\n\n                ++l_tile_comp;\n                ++l_tccp;\n        }\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_tcd_t1_encode ( opj_tcd_t *p_tcd )\n{\n        opj_t1_t * l_t1;\n        const OPJ_FLOAT64 * l_mct_norms;\n        opj_tcp_t * l_tcp = p_tcd->tcp;\n\n        l_t1 = opj_t1_create();\n        if (l_t1 == 00) {\n                return OPJ_FALSE;\n        }\n\n        if (l_tcp->mct == 1) {\n                /* irreversible encoding */\n                if (l_tcp->tccps->qmfbid == 0) {\n                        l_mct_norms = opj_mct_get_mct_norms_real();\n                }\n                else {\n                        l_mct_norms = opj_mct_get_mct_norms();\n                }\n        }\n        else {\n                l_mct_norms = (const OPJ_FLOAT64 *) (l_tcp->mct_norms);\n        }\n\n        if (! opj_t1_encode_cblks(l_t1, p_tcd->tcd_image->tiles , l_tcp, l_mct_norms)) {\n        opj_t1_destroy(l_t1);\n                return OPJ_FALSE;\n        }\n\n        opj_t1_destroy(l_t1);\n\n        return OPJ_TRUE;\n}\n\nOPJ_BOOL opj_tcd_t2_encode (opj_tcd_t *p_tcd,\n                                                OPJ_BYTE * p_dest_data,\n                                                OPJ_UINT32 * p_data_written,\n                                                OPJ_UINT32 p_max_dest_size,\n                                                opj_codestream_info_t *p_cstr_info )\n{\n        opj_t2_t * l_t2;\n\n        l_t2 = opj_t2_create(p_tcd->image, p_tcd->cp);\n        if (l_t2 == 00) {\n                return OPJ_FALSE;\n        }\n\n        if (! opj_t2_encode_packets(\n                                        l_t2,\n                                        p_tcd->tcd_tileno,\n                                        p_tcd->tcd_image->tiles,\n                                        p_tcd->tcp->numlayers,\n                                        p_dest_data,\n                                        p_data_written,\n                                        p_max_dest_size,\n                                        p_cstr_info,\n                                        p_tcd->tp_num,\n                                        p_tcd->tp_pos,\n                                        p_tcd->cur_pino,\n                                        FINAL_PASS))\n        {\n                opj_t2_destroy(l_t2);\n                return OPJ_FALSE;\n        }\n\n        opj_t2_destroy(l_t2);\n\n        /*---------------CLEAN-------------------*/\n        return OPJ_TRUE;\n}\n\n\nOPJ_BOOL opj_tcd_rate_allocate_encode(  opj_tcd_t *p_tcd,\n                                                                            OPJ_BYTE * p_dest_data,\n                                                                            OPJ_UINT32 p_max_dest_size,\n                                                                            opj_codestream_info_t *p_cstr_info )\n{\n        opj_cp_t * l_cp = p_tcd->cp;\n        OPJ_UINT32 l_nb_written = 0;\n\n        if (p_cstr_info)  {\n                p_cstr_info->index_write = 0;\n        }\n\n        if (l_cp->m_specific_param.m_enc.m_disto_alloc|| l_cp->m_specific_param.m_enc.m_fixed_quality)  {\n                /* fixed_quality */\n                /* Normal Rate/distortion allocation */\n                if (! opj_tcd_rateallocate(p_tcd, p_dest_data,&l_nb_written, p_max_dest_size, p_cstr_info)) {\n                        return OPJ_FALSE;\n                }\n        }\n        else {\n                /* Fixed layer allocation */\n                opj_tcd_rateallocate_fixed(p_tcd);\n        }\n\n        return OPJ_TRUE;\n}\n\n\nOPJ_BOOL opj_tcd_copy_tile_data (       opj_tcd_t *p_tcd,\n                                                                    OPJ_BYTE * p_src,\n                                                                    OPJ_UINT32 p_src_length )\n{\n        OPJ_UINT32 i,j,l_data_size = 0;\n        opj_image_comp_t * l_img_comp = 00;\n        opj_tcd_tilecomp_t * l_tilec = 00;\n        OPJ_UINT32 l_size_comp, l_remaining;\n        OPJ_UINT32 l_nb_elem;\n\n        l_data_size = opj_tcd_get_encoded_tile_size(p_tcd);\n        if (l_data_size != p_src_length) {\n                return OPJ_FALSE;\n        }\n\n        l_tilec = p_tcd->tcd_image->tiles->comps;\n        l_img_comp = p_tcd->image->comps;\n        for (i=0;i<p_tcd->image->numcomps;++i) {\n                l_size_comp = l_img_comp->prec >> 3; /*(/ 8)*/\n                l_remaining = l_img_comp->prec & 7;  /* (%8) */\n                l_nb_elem = (OPJ_UINT32)((l_tilec->x1 - l_tilec->x0) * (l_tilec->y1 - l_tilec->y0));\n\n                if (l_remaining) {\n                        ++l_size_comp;\n                }\n\n                if (l_size_comp == 3) {\n                        l_size_comp = 4;\n                }\n\n                switch (l_size_comp) {\n                        case 1:\n                                {\n                                        OPJ_CHAR * l_src_ptr = (OPJ_CHAR *) p_src;\n                                        OPJ_INT32 * l_dest_ptr = l_tilec->data;\n\n                                        if (l_img_comp->sgnd) {\n                                                for (j=0;j<l_nb_elem;++j) {\n                                                        *(l_dest_ptr++) = (OPJ_INT32) (*(l_src_ptr++));\n                                                }\n                                        }\n                                        else {\n                                                for (j=0;j<l_nb_elem;++j) {\n                                                        *(l_dest_ptr++) = (*(l_src_ptr++))&0xff;\n                                                }\n                                        }\n\n                                        p_src = (OPJ_BYTE*) l_src_ptr;\n                                }\n                                break;\n                        case 2:\n                                {\n                                        OPJ_INT32 * l_dest_ptr = l_tilec->data;\n                                        OPJ_INT16 * l_src_ptr = (OPJ_INT16 *) p_src;\n\n                                        if (l_img_comp->sgnd) {\n                                                for (j=0;j<l_nb_elem;++j) {\n                                                        *(l_dest_ptr++) = (OPJ_INT32) (*(l_src_ptr++));\n                                                }\n                                        }\n                                        else {\n                                                for (j=0;j<l_nb_elem;++j) {\n                                                        *(l_dest_ptr++) = (*(l_src_ptr++))&0xffff;\n                                                }\n                                        }\n\n                                        p_src = (OPJ_BYTE*) l_src_ptr;\n                                }\n                                break;\n                        case 4:\n                                {\n                                        OPJ_INT32 * l_src_ptr = (OPJ_INT32 *) p_src;\n                                        OPJ_INT32 * l_dest_ptr = l_tilec->data;\n\n                                        for (j=0;j<l_nb_elem;++j) {\n                                                *(l_dest_ptr++) = (OPJ_INT32) (*(l_src_ptr++));\n                                        }\n\n                                        p_src = (OPJ_BYTE*) l_src_ptr;\n                                }\n                                break;\n                }\n\n                ++l_img_comp;\n                ++l_tilec;\n        }\n\n        return OPJ_TRUE;\n}\n"
  },
  {
    "path": "ext/openjpeg/tcd.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR \n * Copyright (c) 2012, CS Systemes d'Information, France\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n#ifndef __TCD_H\n#define __TCD_H\n/**\n@file tcd.h\n@brief Implementation of a tile coder/decoder (TCD)\n\nThe functions in TCD.C encode or decode each tile independently from\neach other. The functions in TCD.C are used by other functions in J2K.C.\n*/\n\n/** @defgroup TCD TCD - Implementation of a tile coder/decoder */\n/*@{*/\n\n/**\nFIXME DOC\n*/\ntypedef struct opj_tcd_seg {\n\tOPJ_BYTE ** data;\n\tOPJ_UINT32 dataindex;\n\tOPJ_UINT32 numpasses;\n\tOPJ_UINT32 real_num_passes;\n\tOPJ_UINT32 len;\n\tOPJ_UINT32 maxpasses;\n\tOPJ_UINT32 numnewpasses;\n\tOPJ_UINT32 newlen;\n} opj_tcd_seg_t;\n\n/**\nFIXME DOC\n*/\ntypedef struct opj_tcd_pass {\n\tOPJ_UINT32 rate;\n\tOPJ_FLOAT64 distortiondec;\n\tOPJ_UINT32 len;\n\tOPJ_UINT32 term : 1;\n} opj_tcd_pass_t;\n\n/**\nFIXME DOC\n*/\ntypedef struct opj_tcd_layer {\n\tOPJ_UINT32 numpasses;\t\t/* Number of passes in the layer */\n\tOPJ_UINT32 len;\t\t\t\t/* len of information */\n\tOPJ_FLOAT64 disto;\t\t\t/* add for index (Cfr. Marcela) */\n\tOPJ_BYTE *data;\t\t\t\t/* data */\n} opj_tcd_layer_t;\n\n/**\nFIXME DOC\n*/\ntypedef struct opj_tcd_cblk_enc {\n\tOPJ_BYTE* data;\t\t\t\t\t/* Data */\n\topj_tcd_layer_t* layers;\t\t/* layer information */\n\topj_tcd_pass_t* passes;\t\t/* information about the passes */\n\tOPJ_INT32 x0, y0, x1, y1;\t\t/* dimension of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */\n\tOPJ_UINT32 numbps;\n\tOPJ_UINT32 numlenbits;\n\tOPJ_UINT32 numpasses;\t\t\t/* number of pass already done for the code-blocks */\n\tOPJ_UINT32 numpassesinlayers;\t/* number of passes in the layer */\n\tOPJ_UINT32 totalpasses;\t\t\t/* total number of passes */\n} opj_tcd_cblk_enc_t;\n\n\ntypedef struct opj_tcd_cblk_dec {\n\tOPJ_BYTE * data;\t\t\t\t/* Data */\n\topj_tcd_seg_t* segs;\t\t\t/* segments information */\n\tOPJ_INT32 x0, y0, x1, y1;\t\t/* position of the code-blocks : left upper corner (x0, y0) right low corner (x1,y1) */\n\tOPJ_UINT32 numbps;\n\tOPJ_UINT32 numlenbits;\n    OPJ_UINT32 data_max_size;\t\t/* Size of allocated data buffer */\n\tOPJ_UINT32 data_current_size;\t/* Size of used data buffer */\n\tOPJ_UINT32 numnewpasses;\t\t/* number of pass added to the code-blocks */\n\tOPJ_UINT32 numsegs;\t\t\t\t/* number of segments */\n\tOPJ_UINT32 real_num_segs;\n\tOPJ_UINT32 m_current_max_segs;\n} opj_tcd_cblk_dec_t;\n\n/**\nFIXME DOC\n*/\ntypedef struct opj_tcd_precinct {\n\tOPJ_INT32 x0, y0, x1, y1;\t\t/* dimension of the precinct : left upper corner (x0, y0) right low corner (x1,y1) */\n\tOPJ_UINT32 cw, ch;\t\t\t\t/* number of precinct in width and height */\n\tunion{\t\t\t\t\t\t\t/* code-blocks information */\n\t\topj_tcd_cblk_enc_t* enc;\n\t\topj_tcd_cblk_dec_t* dec;\n\t} cblks;\n\tOPJ_UINT32 block_size;\t\t\t/* size taken by cblks (in bytes) */\n\topj_tgt_tree_t *incltree;\t    /* inclusion tree */\n\topj_tgt_tree_t *imsbtree;\t    /* IMSB tree */\n} opj_tcd_precinct_t;\n\n/**\nFIXME DOC\n*/\ntypedef struct opj_tcd_band {\n\tOPJ_INT32 x0, y0, x1, y1;\t\t/* dimension of the subband : left upper corner (x0, y0) right low corner (x1,y1) */\n\tOPJ_UINT32 bandno;\n\topj_tcd_precinct_t *precincts;\t/* precinct information */\n\tOPJ_UINT32 precincts_data_size;\t/* size of data taken by precincts */\n\tOPJ_INT32 numbps;\n\tOPJ_FLOAT32 stepsize;\n} opj_tcd_band_t;\n\n/**\nFIXME DOC\n*/\ntypedef struct opj_tcd_resolution {\n\tOPJ_INT32 x0, y0, x1, y1;\t\t/* dimension of the resolution level : left upper corner (x0, y0) right low corner (x1,y1) */\n\tOPJ_UINT32 pw, ph;\n\tOPJ_UINT32 numbands;\t\t\t/* number sub-band for the resolution level */\n\topj_tcd_band_t bands[3];\t\t/* subband information */\n} opj_tcd_resolution_t;\n\n/**\nFIXME DOC\n*/\ntypedef struct opj_tcd_tilecomp\n{\n\tOPJ_INT32 x0, y0, x1, y1;\t\t\t\t/* dimension of component : left upper corner (x0, y0) right low corner (x1,y1) */\n\tOPJ_UINT32 numresolutions;\t\t\t\t/* number of resolutions level */\n\tOPJ_UINT32 minimum_num_resolutions;\t\t/* number of resolutions level to decode (at max)*/\n\topj_tcd_resolution_t *resolutions;\t/* resolutions information */\n\tOPJ_UINT32 resolutions_size;\t\t\t/* size of data for resolutions (in bytes) */\n\tOPJ_INT32 *data;\t\t\t\t\t\t/* data of the component */\n\tOPJ_UINT32 data_size;\t\t\t\t\t/* size of the data of the component */\n\tOPJ_INT32 numpix;\t\t\t\t\t\t/* add fixed_quality */\n} opj_tcd_tilecomp_t;\n\n\n/**\nFIXME DOC\n*/\ntypedef struct opj_tcd_tile {\n\tOPJ_INT32 x0, y0, x1, y1;\t\t/* dimension of the tile : left upper corner (x0, y0) right low corner (x1,y1) */\n\tOPJ_UINT32 numcomps;\t\t\t/* number of components in tile */\n\topj_tcd_tilecomp_t *comps;\t/* Components information */\n\tOPJ_INT32 numpix;\t\t\t\t/* add fixed_quality */\n\tOPJ_FLOAT64 distotile;\t\t\t/* add fixed_quality */\n\tOPJ_FLOAT64 distolayer[100];\t/* add fixed_quality */\n\tOPJ_UINT32 packno;              /* packet number */\n} opj_tcd_tile_t;\n\n/**\nFIXME DOC\n*/\ntypedef struct opj_tcd_image\n{\n\topj_tcd_tile_t *tiles;\t\t/* Tiles information */\n}\nopj_tcd_image_t;\n\n\n/**\nTile coder/decoder\n*/\ntypedef struct opj_tcd\n{\n\t/** Position of the tilepart flag in Progression order*/\n\tOPJ_INT32 tp_pos;\n\t/** Tile part number*/\n\tOPJ_UINT32 tp_num;\n\t/** Current tile part number*/\n\tOPJ_UINT32 cur_tp_num;\n\t/** Total number of tileparts of the current tile*/\n\tOPJ_UINT32 cur_totnum_tp;\n\t/** Current Packet iterator number */\n\tOPJ_UINT32 cur_pino;\n\t/** info on each image tile */\n\topj_tcd_image_t *tcd_image;\n\t/** image header */\n\topj_image_t *image;\n\t/** coding parameters */\n\topj_cp_t *cp;\n\t/** coding/decoding parameters common to all tiles */\n\topj_tcp_t *tcp;\n\t/** current encoded/decoded tile */\n\tOPJ_UINT32 tcd_tileno;\n\t/** tell if the tcd is a decoder. */\n\tOPJ_UINT32 m_is_decoder : 1;\n} opj_tcd_t;\n\n/** @name Exported functions */\n/*@{*/\n/* ----------------------------------------------------------------------- */\n\n/**\nDump the content of a tcd structure\n*/\n/*void tcd_dump(FILE *fd, opj_tcd_t *tcd, opj_tcd_image_t *img);*/ /* TODO MSD shoul use the new v2 structures */ \n\n/**\nCreate a new TCD handle\n@param p_is_decoder FIXME DOC\n@return Returns a new TCD handle if successful returns NULL otherwise\n*/\nopj_tcd_t* opj_tcd_create(OPJ_BOOL p_is_decoder);\n\n/**\nDestroy a previously created TCD handle\n@param tcd TCD handle to destroy\n*/\nvoid opj_tcd_destroy(opj_tcd_t *tcd);\n\n/**\n * Initialize the tile coder and may reuse some memory.\n * @param\tp_tcd\t\tTCD handle.\n * @param\tp_image\t\traw image.\n * @param\tp_cp\t\tcoding parameters.\n *\n * @return true if the encoding values could be set (false otherwise).\n*/\nOPJ_BOOL opj_tcd_init(\topj_tcd_t *p_tcd,\n\t\t\t\t\t\topj_image_t * p_image,\n\t\t\t\t\t\topj_cp_t * p_cp );\n\n/**\n * Allocates memory for decoding a specific tile.\n *\n * @param\tp_tcd\t\tthe tile decoder.\n * @param\tp_tile_no\tthe index of the tile received in sequence. This not necessarily lead to the\n * tile at index p_tile_no.\n *\n * @return\ttrue if the remaining data is sufficient.\n */\nOPJ_BOOL opj_tcd_init_decode_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no);\n\nvoid opj_tcd_makelayer_fixed(opj_tcd_t *tcd, OPJ_UINT32 layno, OPJ_UINT32 final);\n\nvoid opj_tcd_rateallocate_fixed(opj_tcd_t *tcd);\n\nvoid opj_tcd_makelayer(\topj_tcd_t *tcd,\n\t\t\t\t\t\tOPJ_UINT32 layno,\n\t\t\t\t\t\tOPJ_FLOAT64 thresh,\n\t\t\t\t\t\tOPJ_UINT32 final);\n\nOPJ_BOOL opj_tcd_rateallocate(\topj_tcd_t *tcd,\n\t\t\t\t\t\t\t\tOPJ_BYTE *dest,\n\t\t\t\t\t\t\t\tOPJ_UINT32 * p_data_written,\n\t\t\t\t\t\t\t\tOPJ_UINT32 len,\n\t\t\t\t\t\t\t\topj_codestream_info_t *cstr_info);\n\n/**\n * Gets the maximum tile size that will be taken by the tile once decoded.\n */\nOPJ_UINT32 opj_tcd_get_decoded_tile_size (opj_tcd_t *p_tcd );\n\n/**\n * Encodes a tile from the raw image into the given buffer.\n * @param\tp_tcd\t\t\tTile Coder handle\n * @param\tp_tile_no\t\tIndex of the tile to encode.\n * @param\tp_dest\t\t\tDestination buffer\n * @param\tp_data_written\tpointer to an int that is incremented by the number of bytes really written on p_dest\n * @param\tp_len\t\t\tMaximum length of the destination buffer\n * @param\tp_cstr_info\t\tCodestream information structure\n * @return  true if the coding is successfull.\n*/\nOPJ_BOOL opj_tcd_encode_tile(   opj_tcd_t *p_tcd,\n\t\t\t\t\t\t\t    OPJ_UINT32 p_tile_no,\n\t\t\t\t\t\t\t    OPJ_BYTE *p_dest,\n\t\t\t\t\t\t\t    OPJ_UINT32 * p_data_written,\n\t\t\t\t\t\t\t    OPJ_UINT32 p_len,\n\t\t\t\t\t\t\t    struct opj_codestream_info *p_cstr_info);\n\n\n/**\nDecode a tile from a buffer into a raw image\n@param tcd TCD handle\n@param src Source buffer\n@param len Length of source buffer\n@param tileno Number that identifies one of the tiles to be decoded\n@param cstr_info  FIXME DOC\n*/\nOPJ_BOOL opj_tcd_decode_tile(   opj_tcd_t *tcd,\n\t\t\t\t\t\t\t    OPJ_BYTE *src,\n\t\t\t\t\t\t\t    OPJ_UINT32 len,\n\t\t\t\t\t\t\t    OPJ_UINT32 tileno,\n\t\t\t\t\t\t\t    opj_codestream_index_t *cstr_info);\n\n\n/**\n * Copies tile data from the system onto the given memory block.\n */\nOPJ_BOOL opj_tcd_update_tile_data (\topj_tcd_t *p_tcd,\n\t\t\t\t\t\t\t\t    OPJ_BYTE * p_dest,\n\t\t\t\t\t\t\t\t    OPJ_UINT32 p_dest_length );\n\n/**\n *\n */\nOPJ_UINT32 opj_tcd_get_encoded_tile_size ( opj_tcd_t *p_tcd );\n\n/**\n * Initialize the tile coder and may reuse some meory.\n *\n * @param\tp_tcd\t\tTCD handle.\n * @param\tp_tile_no\tcurrent tile index to encode.\n *\n * @return true if the encoding values could be set (false otherwise).\n*/\nOPJ_BOOL opj_tcd_init_encode_tile (\topj_tcd_t *p_tcd,\n\t\t\t\t\t\t\t\t    OPJ_UINT32 p_tile_no );\n\n/**\n * Copies tile data from the given memory block onto the system.\n */\nOPJ_BOOL opj_tcd_copy_tile_data (opj_tcd_t *p_tcd,\n                                 OPJ_BYTE * p_src,\n                                 OPJ_UINT32 p_src_length );\n\n/* ----------------------------------------------------------------------- */\n/*@}*/\n\n/*@}*/\n\n#endif /* __TCD_H */\n"
  },
  {
    "path": "ext/openjpeg/tgt.c",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2008, 2011-2012, Centre National d'Etudes Spatiales (CNES), FR \n * Copyright (c) 2012, CS Systemes d'Information, France\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include \"opj_includes.h\"\n\n/* \n==========================================================\n   Tag-tree coder interface\n==========================================================\n*/\n\nopj_tgt_tree_t *opj_tgt_create(OPJ_UINT32 numleafsh, OPJ_UINT32 numleafsv) {\n        OPJ_INT32 nplh[32];\n        OPJ_INT32 nplv[32];\n        opj_tgt_node_t *node = 00;\n        opj_tgt_node_t *l_parent_node = 00;\n        opj_tgt_node_t *l_parent_node0 = 00;\n        opj_tgt_tree_t *tree = 00;\n        OPJ_UINT32 i;\n        OPJ_INT32  j,k;\n        OPJ_UINT32 numlvls;\n        OPJ_UINT32 n;\n\n        tree = (opj_tgt_tree_t *) opj_malloc(sizeof(opj_tgt_tree_t));\n        if(!tree) {\n                fprintf(stderr, \"ERROR in tgt_create while allocating tree\\n\");\n                return 00;\n        }\n        memset(tree,0,sizeof(opj_tgt_tree_t));\n\n        tree->numleafsh = numleafsh;\n        tree->numleafsv = numleafsv;\n\n        numlvls = 0;\n        nplh[0] = (OPJ_INT32)numleafsh;\n        nplv[0] = (OPJ_INT32)numleafsv;\n        tree->numnodes = 0;\n        do {\n                n = (OPJ_UINT32)(nplh[numlvls] * nplv[numlvls]);\n                nplh[numlvls + 1] = (nplh[numlvls] + 1) / 2;\n                nplv[numlvls + 1] = (nplv[numlvls] + 1) / 2;\n                tree->numnodes += n;\n                ++numlvls;\n        } while (n > 1);\n\n        /* ADD */\n        if (tree->numnodes == 0) {\n                opj_free(tree);\n                fprintf(stderr, \"WARNING in tgt_create tree->numnodes == 0, no tree created.\\n\");\n                return 00;\n        }\n\n        tree->nodes = (opj_tgt_node_t*) opj_calloc(tree->numnodes, sizeof(opj_tgt_node_t));\n        if(!tree->nodes) {\n                fprintf(stderr, \"ERROR in tgt_create while allocating node of the tree\\n\");\n                opj_free(tree);\n                return 00;\n        }\n        memset(tree->nodes,0,tree->numnodes * sizeof(opj_tgt_node_t));\n        tree->nodes_size = tree->numnodes * (OPJ_UINT32)sizeof(opj_tgt_node_t);\n\n        node = tree->nodes;\n        l_parent_node = &tree->nodes[tree->numleafsh * tree->numleafsv];\n        l_parent_node0 = l_parent_node;\n\n        for (i = 0; i < numlvls - 1; ++i) {\n                for (j = 0; j < nplv[i]; ++j) {\n                        k = nplh[i];\n                        while (--k >= 0) {\n                                node->parent = l_parent_node;\n                                ++node;\n                                if (--k >= 0) {\n                                        node->parent = l_parent_node;\n                                        ++node;\n                                }\n                                ++l_parent_node;\n                        }\n                        if ((j & 1) || j == nplv[i] - 1) {\n                                l_parent_node0 = l_parent_node;\n                        } else {\n                                l_parent_node = l_parent_node0;\n                                l_parent_node0 += nplh[i];\n                        }\n                }\n        }\n        node->parent = 0;\n        opj_tgt_reset(tree);\n        return tree;\n}\n\n/**\n * Reinitialises a tag-tree from an existing one.\n *\n * @param       p_tree                          the tree to reinitialize.\n * @param       p_num_leafs_h           the width of the array of leafs of the tree\n * @param       p_num_leafs_v           the height of the array of leafs of the tree\n * @return      a new tag-tree if successful, NULL otherwise\n*/\nopj_tgt_tree_t *opj_tgt_init(opj_tgt_tree_t * p_tree,OPJ_UINT32 p_num_leafs_h, OPJ_UINT32 p_num_leafs_v)\n{\n        OPJ_INT32 l_nplh[32];\n        OPJ_INT32 l_nplv[32];\n        opj_tgt_node_t *l_node = 00;\n        opj_tgt_node_t *l_parent_node = 00;\n        opj_tgt_node_t *l_parent_node0 = 00;\n        OPJ_UINT32 i;\n        OPJ_INT32 j,k;\n        OPJ_UINT32 l_num_levels;\n        OPJ_UINT32 n;\n        OPJ_UINT32 l_node_size;\n\n        if (! p_tree){\n                return 00;\n        }\n\n        if ((p_tree->numleafsh != p_num_leafs_h) || (p_tree->numleafsv != p_num_leafs_v)) {\n                p_tree->numleafsh = p_num_leafs_h;\n                p_tree->numleafsv = p_num_leafs_v;\n\n                l_num_levels = 0;\n                l_nplh[0] = (OPJ_INT32)p_num_leafs_h;\n                l_nplv[0] = (OPJ_INT32)p_num_leafs_v;\n                p_tree->numnodes = 0;\n                do\n                {\n                        n = (OPJ_UINT32)(l_nplh[l_num_levels] * l_nplv[l_num_levels]);\n                        l_nplh[l_num_levels + 1] = (l_nplh[l_num_levels] + 1) / 2;\n                        l_nplv[l_num_levels + 1] = (l_nplv[l_num_levels] + 1) / 2;\n                        p_tree->numnodes += n;\n                        ++l_num_levels;\n                }\n                while (n > 1);\n\n                /* ADD */\n                if (p_tree->numnodes == 0) {\n                        opj_tgt_destroy(p_tree);\n                        return 00;\n                }\n                l_node_size = p_tree->numnodes * (OPJ_UINT32)sizeof(opj_tgt_node_t);\n                \n                if (l_node_size > p_tree->nodes_size) {\n                        opj_tgt_node_t* new_nodes = (opj_tgt_node_t*) opj_realloc(p_tree->nodes, l_node_size);\n                        if (! new_nodes) {\n                                fprintf(stderr, \"ERROR Not enough memory to reinitialize the tag tree\\n\");\n                                opj_tgt_destroy(p_tree);\n                                return 00;\n                        }\n                        p_tree->nodes = new_nodes;\n                        memset(((char *) p_tree->nodes) + p_tree->nodes_size, 0 , l_node_size - p_tree->nodes_size);\n                        p_tree->nodes_size = l_node_size;\n                }\n                l_node = p_tree->nodes;\n                l_parent_node = &p_tree->nodes[p_tree->numleafsh * p_tree->numleafsv];\n                l_parent_node0 = l_parent_node;\n\n                for (i = 0; i < l_num_levels - 1; ++i) {\n                        for (j = 0; j < l_nplv[i]; ++j) {\n                                k = l_nplh[i];\n                                while (--k >= 0) {\n                                        l_node->parent = l_parent_node;\n                                        ++l_node;\n                                        if (--k >= 0) {\n                                                l_node->parent = l_parent_node;\n                                                ++l_node;\n                                        }\n                                        ++l_parent_node;\n                                        }\n                                if ((j & 1) || j == l_nplv[i] - 1)\n                                {\n                                        l_parent_node0 = l_parent_node;\n                                }\n                                else\n                                {\n                                        l_parent_node = l_parent_node0;\n                                        l_parent_node0 += l_nplh[i];\n                                }\n                        }\n                }\n                l_node->parent = 0;\n        }\n        opj_tgt_reset(p_tree);\n\n        return p_tree;\n}\n\nvoid opj_tgt_destroy(opj_tgt_tree_t *p_tree)\n{\n        if (! p_tree) {\n                return;\n        }\n\n        if (p_tree->nodes) {\n                opj_free(p_tree->nodes);\n                p_tree->nodes = 00;\n        }\n        opj_free(p_tree);\n}\n\nvoid opj_tgt_reset(opj_tgt_tree_t *p_tree) {\n        OPJ_UINT32 i;\n        opj_tgt_node_t * l_current_node = 00;;\n\n        if (! p_tree) {\n                return;\n        }\n\n        l_current_node = p_tree->nodes;\n        for     (i = 0; i < p_tree->numnodes; ++i)\n        {\n                l_current_node->value = 999;\n                l_current_node->low = 0;\n                l_current_node->known = 0;\n                ++l_current_node;\n        }\n}\n\nvoid opj_tgt_setvalue(opj_tgt_tree_t *tree, OPJ_UINT32 leafno, OPJ_INT32 value) {\n        opj_tgt_node_t *node;\n        node = &tree->nodes[leafno];\n        while (node && node->value > value) {\n                node->value = value;\n                node = node->parent;\n        }\n}\n\nvoid opj_tgt_encode(opj_bio_t *bio, opj_tgt_tree_t *tree, OPJ_UINT32 leafno, OPJ_INT32 threshold) {\n        opj_tgt_node_t *stk[31];\n        opj_tgt_node_t **stkptr;\n        opj_tgt_node_t *node;\n        OPJ_INT32 low;\n\n        stkptr = stk;\n        node = &tree->nodes[leafno];\n        while (node->parent) {\n                *stkptr++ = node;\n                node = node->parent;\n        }\n        \n        low = 0;\n        for (;;) {\n                if (low > node->low) {\n                        node->low = low;\n                } else {\n                        low = node->low;\n                }\n                \n                while (low < threshold) {\n                        if (low >= node->value) {\n                                if (!node->known) {\n                                        opj_bio_write(bio, 1, 1);\n                                        node->known = 1;\n                                }\n                                break;\n                        }\n                        opj_bio_write(bio, 0, 1);\n                        ++low;\n                }\n                \n                node->low = low;\n                if (stkptr == stk)\n                        break;\n                node = *--stkptr;\n        }\n}\n\nOPJ_UINT32 opj_tgt_decode(opj_bio_t *bio, opj_tgt_tree_t *tree, OPJ_UINT32 leafno, OPJ_INT32 threshold) {\n        opj_tgt_node_t *stk[31];\n        opj_tgt_node_t **stkptr;\n        opj_tgt_node_t *node;\n        OPJ_INT32 low;\n\n        stkptr = stk;\n        node = &tree->nodes[leafno];\n        while (node->parent) {\n                *stkptr++ = node;\n                node = node->parent;\n        }\n        \n        low = 0;\n        for (;;) {\n                if (low > node->low) {\n                        node->low = low;\n                } else {\n                        low = node->low;\n                }\n                while (low < threshold && low < node->value) {\n                        if (opj_bio_read(bio, 1)) {\n                                node->value = low;\n                        } else {\n                                ++low;\n                        }\n                }\n                node->low = low;\n                if (stkptr == stk) {\n                        break;\n                }\n                node = *--stkptr;\n        }\n        \n        return (node->value < threshold) ? 1 : 0;\n}\n"
  },
  {
    "path": "ext/openjpeg/tgt.h",
    "content": "/*\n * The copyright in this software is being made available under the 2-clauses \n * BSD License, included below. This software may be subject to other third \n * party and contributor rights, including patent rights, and no such rights\n * are granted under this license.\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2001-2003, David Janssens\n * Copyright (c) 2002-2003, Yannick Verschueren\n * Copyright (c) 2003-2007, Francois-Olivier Devaux \n * Copyright (c) 2003-2014, Antonin Descampe\n * Copyright (c) 2005, Herve Drolon, FreeImage Team\n * Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fimes@c-s.fr>\n * Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France \n * Copyright (c) 2012, CS Systemes d'Information, France\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef __TGT_H\n#define __TGT_H\n/**\n@file tgt.h\n@brief Implementation of a tag-tree coder (TGT)\n\nThe functions in TGT.C have for goal to realize a tag-tree coder. The functions in TGT.C\nare used by some function in T2.C.\n*/\n\n/** @defgroup TGT TGT - Implementation of a tag-tree coder */\n/*@{*/\n\n/**\nTag node\n*/\ntypedef struct opj_tgt_node {\n    struct opj_tgt_node *parent;\n    OPJ_INT32 value;\n    OPJ_INT32 low;\n    OPJ_UINT32 known;\n} opj_tgt_node_t;\n\n/**\nTag tree\n*/\ntypedef struct opj_tgt_tree\n{\n\tOPJ_UINT32  numleafsh;\n\tOPJ_UINT32  numleafsv;\n\tOPJ_UINT32 numnodes;\n\topj_tgt_node_t *nodes;\n\tOPJ_UINT32  nodes_size;\t\t/* maximum size taken by nodes */\n} opj_tgt_tree_t;\n\n\n/** @name Exported functions */\n/*@{*/\n/* ----------------------------------------------------------------------- */\n/**\nCreate a tag-tree\n@param numleafsh Width of the array of leafs of the tree\n@param numleafsv Height of the array of leafs of the tree\n@return Returns a new tag-tree if successful, returns NULL otherwise\n*/\nopj_tgt_tree_t *opj_tgt_create(OPJ_UINT32 numleafsh, OPJ_UINT32 numleafsv);\n\n/**\n * Reinitialises a tag-tree from an exixting one.\n *\n * @param\tp_tree\t\t\t\tthe tree to reinitialize.\n * @param\tp_num_leafs_h\t\tthe width of the array of leafs of the tree\n * @param\tp_num_leafs_v\t\tthe height of the array of leafs of the tree\n * @return\ta new tag-tree if successful, NULL otherwise\n*/\nopj_tgt_tree_t *opj_tgt_init(opj_tgt_tree_t * p_tree, \n                             OPJ_UINT32  p_num_leafs_h, \n                             OPJ_UINT32  p_num_leafs_v);\n/**\nDestroy a tag-tree, liberating memory\n@param tree Tag-tree to destroy\n*/\nvoid opj_tgt_destroy(opj_tgt_tree_t *tree);\n/**\nReset a tag-tree (set all leaves to 0)\n@param tree Tag-tree to reset\n*/\nvoid opj_tgt_reset(opj_tgt_tree_t *tree);\n/**\nSet the value of a leaf of a tag-tree\n@param tree Tag-tree to modify\n@param leafno Number that identifies the leaf to modify\n@param value New value of the leaf\n*/\nvoid opj_tgt_setvalue(opj_tgt_tree_t *tree, \n                      OPJ_UINT32 leafno, \n                      OPJ_INT32 value);\n/**\nEncode the value of a leaf of the tag-tree up to a given threshold\n@param bio Pointer to a BIO handle\n@param tree Tag-tree to modify\n@param leafno Number that identifies the leaf to encode\n@param threshold Threshold to use when encoding value of the leaf\n*/\nvoid opj_tgt_encode(opj_bio_t *bio, \n                    opj_tgt_tree_t *tree, \n                    OPJ_UINT32 leafno, \n                    OPJ_INT32 threshold);\n/**\nDecode the value of a leaf of the tag-tree up to a given threshold\n@param bio Pointer to a BIO handle\n@param tree Tag-tree to decode\n@param leafno Number that identifies the leaf to decode\n@param threshold Threshold to use when decoding value of the leaf\n@return Returns 1 if the node's value < threshold, returns 0 otherwise\n*/\nOPJ_UINT32 opj_tgt_decode(opj_bio_t *bio, \n                          opj_tgt_tree_t *tree, \n                          OPJ_UINT32 leafno, \n                          OPJ_INT32 threshold);\n/* ----------------------------------------------------------------------- */\n/*@}*/\n\n/*@}*/\n\n#endif /* __TGT_H */\n"
  },
  {
    "path": "ext/openjpeg/thix_manager.c",
    "content": "/*\n * $Id: thix_manager.c 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2003-2004, Yannick Verschueren\n * Copyright (c) 2010-2011, Kaori Hagihara\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*! \\file\n *  \\brief Modification of jpip.c from 2KAN indexer\n */\n\n#include \"opj_includes.h\"\n\n\n\nint opj_write_thix( int coff, opj_codestream_info_t cstr_info, opj_stream_private_t *cio,\n              opj_event_mgr_t * p_manager )\n{\n  OPJ_BYTE l_data_header [4];\n  int i;\n  int tileno;\n  opj_jp2_box_t *box;\n  OPJ_UINT32 len;\n  OPJ_OFF_T lenp;\n\n  lenp = 0;\n  box = (opj_jp2_box_t *)opj_calloc( (size_t)(cstr_info.tw*cstr_info.th), sizeof(opj_jp2_box_t));\n\n  for ( i = 0; i < 2 ; i++ ){\n    if (i)\n      opj_stream_seek( cio, lenp, p_manager);\n\n    lenp = opj_stream_tell(cio);\n    opj_stream_skip(cio, 4, p_manager);             /* L [at the end] */\n    opj_write_bytes(l_data_header,JPIP_THIX,4); /* THIX */\n    opj_stream_write_data(cio,l_data_header,4,p_manager);\n\n    opj_write_manf( i, cstr_info.tw*cstr_info.th, box, cio, p_manager);\n    \n    for (tileno = 0; tileno < cstr_info.tw*cstr_info.th; tileno++){\n      box[tileno].length = (OPJ_UINT32)opj_write_tilemhix( coff, cstr_info, tileno, cio,p_manager);\n      box[tileno].type = JPIP_MHIX;\n    }\n \n    len = (OPJ_UINT32)(opj_stream_tell(cio)-lenp);\n    opj_stream_seek(cio, lenp, p_manager);\n    opj_write_bytes(l_data_header,len,4); /* L              */\n    opj_stream_write_data(cio,l_data_header,4,p_manager);\n    opj_stream_seek( cio, lenp+len,p_manager);\n\n  }\n\n  opj_free(box);\n\n  return (int)len;\n}\n\n/* \n * Write tile-part headers mhix box\n *\n * @param[in] coff      offset of j2k codestream\n * @param[in] cstr_info codestream information\n * @param[in] tileno    tile number\n * @param[in] cio       file output handle\n * @return              length of mhix box\n */\nint opj_write_tilemhix( int coff, opj_codestream_info_t cstr_info, int tileno, opj_stream_private_t *cio,\n              opj_event_mgr_t * p_manager )\n{\n  OPJ_BYTE l_data_header [8];\n  int i;\n  opj_tile_info_t tile;\n  opj_tp_info_t tp;\n  opj_marker_info_t *marker;\n  OPJ_UINT32 len;\n  OPJ_OFF_T lenp;\n\n  lenp = opj_stream_tell (cio);\n  opj_stream_skip(cio, 4, p_manager);               /* L [at the end]                    */\n  opj_write_bytes(l_data_header,JPIP_MHIX,4);       /* MHIX                              */\n  opj_stream_write_data(cio,l_data_header,4,p_manager);\n\n  tile = cstr_info.tile[tileno];\n  tp = tile.tp[0];\n\n  opj_write_bytes(l_data_header,(OPJ_UINT32)(tp.tp_end_header-tp.tp_start_pos+1), 8);        /* TLEN                              */\n  opj_stream_write_data(cio,l_data_header,8,p_manager);\n\n  marker = cstr_info.tile[tileno].marker;\n\n  for( i=0; i<cstr_info.tile[tileno].marknum; i++){             /* Marker restricted to 1 apparition */\n    opj_write_bytes( l_data_header, marker[i].type, 2);\n    opj_write_bytes( l_data_header+2, 0, 2);\n    opj_stream_write_data(cio,l_data_header,4,p_manager);\n    opj_write_bytes( l_data_header, (OPJ_UINT32)(marker[i].pos-coff), 8);\n    opj_stream_write_data(cio,l_data_header,8,p_manager);\n    opj_write_bytes( l_data_header, (OPJ_UINT32)marker[i].len, 2);\n    opj_stream_write_data(cio,l_data_header,2,p_manager);\n  }\n     \n  /*  free( marker);*/\n\n  len = (OPJ_UINT32)(opj_stream_tell(cio)-lenp);\n  opj_stream_seek(cio, lenp,p_manager);\n  opj_write_bytes(l_data_header,len,4);/* L  */\n  opj_stream_write_data(cio,l_data_header,4,p_manager);\n  opj_stream_seek(cio, lenp+len,p_manager);\n\n  return (int)len;\n}\n"
  },
  {
    "path": "ext/openjpeg/tpix_manager.c",
    "content": "/*\n * $Id: tpix_manager.c 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $\n *\n * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium\n * Copyright (c) 2002-2014, Professor Benoit Macq\n * Copyright (c) 2003-2004, Yannick Verschueren\n * Copyright (c) 2010-2011, Kaori Hagihara\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*! \\file\n *  \\brief Modification of jpip.c from 2KAN indexer\n */\n\n#include \"opj_includes.h\"\n\n#define MAX(a,b) ((a)>(b)?(a):(b))\n\n/* \n * Get number of maximum tile parts per tile\n *\n * @param[in] cstr_info codestream information\n * @return              number of maximum tile parts per tile\n */\nint get_num_max_tile_parts( opj_codestream_info_t cstr_info);\n\n\n/* \n * Write faix box of tpix\n *\n * @param[in] coff offset of j2k codestream\n * @param[in] compno    component number\n * @param[in] cstr_info codestream information\n * @param[in] j2klen    length of j2k codestream\n * @param[in] cio       file output handle\n * @return              length of faix box\n */\n\nint opj_write_tpix( int coff, \n                    opj_codestream_info_t cstr_info, \n                    int j2klen, opj_stream_private_t *cio,\n                    opj_event_mgr_t * p_manager )\n{\n  OPJ_BYTE l_data_header [4];\n  OPJ_UINT32 len;\n  OPJ_OFF_T lenp;\n\n  lenp = opj_stream_tell(cio);\n  opj_stream_skip(cio, 4, p_manager);\n  opj_write_bytes(l_data_header,JPIP_TPIX,4); /* TPIX */\n  opj_stream_write_data(cio,l_data_header,4,p_manager);\n  \n  opj_write_tpixfaix( coff, 0, cstr_info, j2klen, cio,p_manager);\n\n  len = (OPJ_UINT32)(opj_stream_tell(cio)-lenp);\n \n  opj_stream_skip(cio, lenp, p_manager);\n  opj_write_bytes(l_data_header,len,4);/* L              */\n  opj_stream_write_data(cio,l_data_header,4,p_manager);\n  opj_stream_seek(cio, lenp+len,p_manager);\n\n  return (int)len;\n}\n\nint opj_write_tpixfaix( int coff,\n                        int compno, \n                        opj_codestream_info_t cstr_info, \n                        int j2klen, \n                        opj_stream_private_t *cio,\n                        opj_event_mgr_t * p_manager )\n{\n  OPJ_UINT32 len;\n  OPJ_OFF_T lenp;\n  OPJ_UINT32 i, j;\n  OPJ_UINT32 Aux;\n  OPJ_UINT32 num_max_tile_parts;\n  OPJ_UINT32 size_of_coding; /* 4 or 8 */\n  opj_tp_info_t tp;\n  OPJ_BYTE l_data_header [8];\n  OPJ_UINT32 version;\n\n  num_max_tile_parts = (OPJ_UINT32)get_num_max_tile_parts( cstr_info);\n\n  if( j2klen > pow( 2, 32)){\n    size_of_coding =  8;\n    version = num_max_tile_parts == 1 ? 1:3;\n  }\n  else{\n    size_of_coding = 4;\n    version = num_max_tile_parts == 1 ? 0:2;\n  }\n\n  lenp = opj_stream_tell(cio);\n  opj_stream_skip(cio, 4, p_manager);         /* L [at the end]      */\n  opj_write_bytes(l_data_header,JPIP_FAIX,4); /* FAIX */\n  opj_stream_write_data(cio,l_data_header,4,p_manager);\n  opj_write_bytes(l_data_header,version,1);   /* Version 0 = 4 bytes */\n  opj_stream_write_data(cio,l_data_header,1,p_manager);\n\n  opj_write_bytes(l_data_header,num_max_tile_parts,size_of_coding);         /* NMAX           */\n  opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);\n  opj_write_bytes(l_data_header,(OPJ_UINT32)(cstr_info.tw*cstr_info.th),size_of_coding);  /* M              */\n  opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);\n\n  for (i = 0; i < (OPJ_UINT32)(cstr_info.tw*cstr_info.th); i++)\n    {\n    for (j = 0; j < (OPJ_UINT32)cstr_info.tile[i].num_tps; j++)\n      {\n      tp = cstr_info.tile[i].tp[j];\n\n      opj_write_bytes(l_data_header,(OPJ_UINT32)(tp.tp_start_pos-coff),size_of_coding);            /* start position */\n      opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);\n      opj_write_bytes(l_data_header,(OPJ_UINT32)(tp.tp_end_pos-tp.tp_start_pos+1),size_of_coding); /* length         */\n      opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);\n\n      if (version & 0x02)\n        {\n        if( cstr_info.tile[i].num_tps == 1 && cstr_info.numdecompos[compno] > 1)\n          Aux = (OPJ_UINT32)(cstr_info.numdecompos[compno] + 1);\n        else\n          Aux = j + 1;\n\n        opj_write_bytes(l_data_header,Aux,4);\n        opj_stream_write_data(cio,l_data_header,4,p_manager);\n\n        /*cio_write(img.tile[i].tile_parts[j].num_reso_AUX,4);*/ /* Aux_i,j : Auxiliary value */\n        /* fprintf(stderr,\"AUX value %d\\n\",Aux);*/\n        }\n      /*cio_write(0,4);*/\n      }\n    /* PADDING */\n    while (j < num_max_tile_parts)\n      {\n\n          opj_write_bytes(l_data_header,0,size_of_coding);/* start position            */\n      opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);\n      opj_write_bytes(l_data_header,0,size_of_coding);/* length                    */\n      opj_stream_write_data(cio,l_data_header,size_of_coding,p_manager);\n\n      if (version & 0x02)\n      opj_write_bytes(l_data_header,0,4);      /* Aux_i,j : Auxiliary value */\n      opj_stream_write_data(cio,l_data_header,4,p_manager);\n      j++;\n      }\n    }\n  \n  len = (OPJ_UINT32)(opj_stream_tell(cio)-lenp);\n  opj_stream_seek(cio, lenp,p_manager);\n  opj_write_bytes(l_data_header,len,4);/* L  */\n  opj_stream_write_data(cio,l_data_header,4,p_manager);\n  opj_stream_seek(cio, lenp+len,p_manager);\n\n  return (int)len;\n}\n\nint get_num_max_tile_parts( opj_codestream_info_t cstr_info)\n{\n  int num_max_tp = 0, i;\n\n  for( i=0; i<cstr_info.tw*cstr_info.th; i++)\n    num_max_tp = MAX( cstr_info.tile[i].num_tps, num_max_tp);\n  \n  return num_max_tp;\n}\n"
  },
  {
    "path": "ext/synctex/synctex_parser.c",
    "content": "/* \nCopyright (c) 2008, 2009, 2010 , 2011 jerome DOT laurens AT u-bourgogne DOT fr\n\nThis file is part of the SyncTeX package.\n\nLatest Revision: Tue Jun 14 08:23:30 UTC 2011\n\nVersion: 1.16\n\nSee synctex_parser_readme.txt for more details\n\nLicense:\n--------\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE\n\nExcept as contained in this notice, the name of the copyright holder  \nshall not be used in advertising or otherwise to promote the sale,  \nuse or other dealings in this Software without prior written  \nauthorization from the copyright holder.\n\nAcknowledgments:\n----------------\nThe author received useful remarks from the pdfTeX developers, especially Hahn The Thanh,\nand significant help from XeTeX developer Jonathan Kew\n\nNota Bene:\n----------\nIf you include or use a significant part of the synctex package into a software,\nI would appreciate to be listed as contributor and see \"SyncTeX\" highlighted.\n\nVersion 1\nThu Jun 19 09:39:21 UTC 2008\n\n*/\n\n/*  We assume that high level application like pdf viewers will want\n *  to embed this code as is. We assume that they also have locale.h and setlocale.\n *  For other tools such as TeXLive tools, you must define SYNCTEX_USE_LOCAL_HEADER,\n *  when building. You also have to create and customize synctex_parser_local.h to fit your system.\n *  In particular, the HAVE_LOCALE_H and HAVE_SETLOCALE macros should be properly defined.\n *  With this design, you should not need to edit this file. */\n\n#   if defined(SYNCTEX_USE_LOCAL_HEADER)\n#       include \"synctex_parser_local.h\"\n#   else\n#       define HAVE_LOCALE_H 1\n#       define HAVE_SETLOCALE 1\n#       if defined(_MSC_VER) \n#          define SYNCTEX_INLINE __inline\n#       else\n#          define SYNCTEX_INLINE inline\n#       endif\n#   endif\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include <errno.h>\n#include <limits.h>\n\n#if defined(HAVE_LOCALE_H)\n#include <locale.h>\n#endif\n\n/*  The data is organized in a graph with multiple entries.\n *  The root object is a scanner, it is created with the contents on a synctex file.\n *  Each leaf of the tree is a synctex_node_t object.\n *  There are 3 subtrees, two of them sharing the same leaves.\n *  The first tree is the list of input records, where input file names are associated with tags.\n *  The second tree is the box tree as given by TeX when shipping pages out.\n *  First level objects are sheets, containing boxes, glues, kerns...\n *  The third tree allows to browse leaves according to tag and line.\n */\n\n#include \"synctex_parser.h\"\n#include \"synctex_parser_utils.h\"\n\n/*  These are the possible extensions of the synctex file */\nconst char * synctex_suffix = \".synctex\";\nconst char * synctex_suffix_gz = \".gz\";\n\n/*  each synctex node has a class */\ntypedef struct __synctex_class_t _synctex_class_t;\ntypedef _synctex_class_t * synctex_class_t;\n\n\n/*  synctex_node_t is a pointer to a node\n *  _synctex_node is the target of the synctex_node_t pointer\n *  It is a pseudo object oriented program.\n *  class is a pointer to the class object the node belongs to.\n *  implementation is meant to contain the private data of the node\n *  basically, there are 2 kinds of information: navigation information and\n *  synctex information. Both will depend on the type of the node,\n *  thus different nodes will have different private data.\n *  There is no inheritancy overhead.\n */\ntypedef union _synctex_info_t {\n\tint    INT;\n\tchar * PTR;\n} synctex_info_t;\n\nstruct _synctex_node {\n\tsynctex_class_t class;\n\tsynctex_info_t * implementation;\n};\n\n/*  Each node of the tree, except the scanner itself belongs to a class.\n *  The class object is just a struct declaring the owning scanner\n *  This is a pointer to the scanner as root of the tree.\n *  The type is used to identify the kind of node.\n *  The class declares pointers to a creator and a destructor method.\n *  The log and display fields are used to log and display the node.\n *  display will also display the child, sibling and parent sibling.\n *  parent, child and sibling are used to navigate the tree,\n *  from TeX box hierarchy point of view.\n *  The friend field points to a method which allows to navigate from friend to friend.\n *  A friend is a node with very close tag and line numbers.\n *  Finally, the info field point to a method giving the private node info offset.\n */\n\ntypedef synctex_node_t *(*_synctex_node_getter_t)(synctex_node_t);\ntypedef synctex_info_t *(*_synctex_info_getter_t)(synctex_node_t);\n\nstruct __synctex_class_t {\n\tsynctex_scanner_t scanner;\n\tint type;\n\tsynctex_node_t (*new)(synctex_scanner_t scanner);\n\tvoid (*free)(synctex_node_t);\n\tvoid (*log)(synctex_node_t);\n\tvoid (*display)(synctex_node_t);\n\t_synctex_node_getter_t parent;\n\t_synctex_node_getter_t child;\n\t_synctex_node_getter_t sibling;\n\t_synctex_node_getter_t friend;\n\t_synctex_node_getter_t next_box;\n\t_synctex_info_getter_t info;\n};\n\n#\tifdef SYNCTEX_NOTHING\n#       pragma mark -\n#       pragma mark Abstract OBJECTS and METHODS\n#   endif\n\n/*  These macros are shortcuts\n *  This macro checks if a message can be sent.\n */\n#   define SYNCTEX_CAN_PERFORM(NODE,SELECTOR)\\\n\t\t(NULL!=((((NODE)->class))->SELECTOR))\n\n/*  This macro is some kind of objc_msg_send.\n *  It takes care of sending the proper message if possible.\n */\n#   define SYNCTEX_MSG_SEND(NODE,SELECTOR) if (NODE && SYNCTEX_CAN_PERFORM(NODE,SELECTOR)) {\\\n\t\t(*((((NODE)->class))->SELECTOR))(NODE);\\\n\t}\n\n/*  read only safe getter\n */\n#   define SYNCTEX_GET(NODE,SELECTOR)((NODE && SYNCTEX_CAN_PERFORM(NODE,SELECTOR))?SYNCTEX_GETTER(NODE,SELECTOR)[0]:(NULL))\n\n/*  read/write getter\n */\n#   define SYNCTEX_GETTER(NODE,SELECTOR)\\\n\t\t((synctex_node_t *)((*((((NODE)->class))->SELECTOR))(NODE)))\n\n#   define SYNCTEX_FREE(NODE) SYNCTEX_MSG_SEND(NODE,free);\n\n/*  Parent getter and setter\n */\n#   define SYNCTEX_PARENT(NODE) SYNCTEX_GET(NODE,parent)\n#   define SYNCTEX_SET_PARENT(NODE,NEW_PARENT) if (NODE && NEW_PARENT && SYNCTEX_CAN_PERFORM(NODE,parent)){\\\n\t\tSYNCTEX_GETTER(NODE,parent)[0]=NEW_PARENT;\\\n\t}\n\n/*  Child getter and setter\n */\n#   define SYNCTEX_CHILD(NODE) SYNCTEX_GET(NODE,child)\n#   define SYNCTEX_SET_CHILD(NODE,NEW_CHILD) if (NODE && NEW_CHILD){\\\n\t\tSYNCTEX_GETTER(NODE,child)[0]=NEW_CHILD;\\\n\t\tSYNCTEX_GETTER(NEW_CHILD,parent)[0]=NODE;\\\n\t}\n\n/*  Sibling getter and setter\n */\n#   define SYNCTEX_SIBLING(NODE) SYNCTEX_GET(NODE,sibling)\n#   define SYNCTEX_SET_SIBLING(NODE,NEW_SIBLING) if (NODE && NEW_SIBLING) {\\\n\t\tSYNCTEX_GETTER(NODE,sibling)[0]=NEW_SIBLING;\\\n\t\tif (SYNCTEX_CAN_PERFORM(NEW_SIBLING,parent) && SYNCTEX_CAN_PERFORM(NODE,parent)) {\\\n\t\t\tSYNCTEX_GETTER(NEW_SIBLING,parent)[0]=SYNCTEX_GETTER(NODE,parent)[0];\\\n\t\t}\\\n\t}\n/*  Friend getter and setter. A friend is a kern, math, glue or void box node which tag and line numbers are similar.\n *  This is a first filter on the nodes that avoids testing all of them.\n *  Friends are used mainly in forward synchronization aka from source to output.\n */\n#   define SYNCTEX_FRIEND(NODE) SYNCTEX_GET(NODE,friend)\n#   define SYNCTEX_SET_FRIEND(NODE,NEW_FRIEND) if (NODE && NEW_FRIEND){\\\n\t\tSYNCTEX_GETTER(NODE,friend)[0]=NEW_FRIEND;\\\n\t}\n\n/*  Next box getter and setter. The box tree can be traversed from one horizontal box to the other.\n *  Navigation starts with the deeper boxes.\n */\n#   define SYNCTEX_NEXT_HORIZ_BOX(NODE) SYNCTEX_GET(NODE,next_box)\n#   define SYNCTEX_SET_NEXT_HORIZ_BOX(NODE,NEXT_BOX) if (NODE && NEXT_BOX){\\\n\t\tSYNCTEX_GETTER(NODE,next_box)[0]=NEXT_BOX;\\\n\t}\n\nvoid _synctex_free_node(synctex_node_t node);\n/* SumatraPDF: prevent stack overflow */\n#\tdefine _synctex_free_leaf _synctex_free_node\n\n/*  A node is meant to own its child and sibling.\n *  It is not owned by its parent, unless it is its first child.\n *  This destructor is for all nodes with children.\n */\nvoid _synctex_free_node(synctex_node_t node) {\n\t/* SumatraPDF: prevent stack overflow */\n\tsynctex_node_t next;\n\twhile (node) {\n\t\t(*((node->class)->sibling))(node);\n\t\tnext = SYNCTEX_SIBLING(node);\n\t\tSYNCTEX_FREE(SYNCTEX_CHILD(node));\n\t\tfree(node);\n\t\tnode = next;\n\t}\n\treturn;\n}\n\n/*  A node is meant to own its child and sibling.\n *  It is not owned by its parent, unless it is its first child.\n *  This destructor is for nodes with no child.\n */\n/* SumatraPDF: prevent stack overflow * /\nvoid _synctex_free_leaf(synctex_node_t node) {\n\tif (node) {\n\t\tSYNCTEX_FREE(SYNCTEX_SIBLING(node));\n\t\tfree(node);\n\t}\n\treturn;\n}\n*/\n#\tifdef\t__SYNCTEX_WORK__\n#\t\tinclude \"/usr/include/zlib.h\"\n#\telse\n#\t\tinclude <zlib.h>\n#\tendif\n\n/*  The synctex scanner is the root object.\n *  Is is initialized with the contents of a text file or a gzipped file.\n *  The buffer_? are first used to parse the text.\n */\nstruct __synctex_scanner_t {\n\tgzFile file;                  /*  The (possibly compressed) file */\n\tchar * buffer_cur;            /*  current location in the buffer */\n\tchar * buffer_start;          /*  start of the buffer */\n\tchar * buffer_end;            /*  end of the buffer */\n\tchar * output_fmt;            /*  dvi or pdf, not yet used */\n\tchar * output;                /*  the output name used to create the scanner */\n\tchar * synctex;               /*  the .synctex or .synctex.gz name used to create the scanner */\n\tint version;                  /*  1, not yet used */\n\tstruct {\n\t\tunsigned has_parsed:1;\t\t/*  Whether the scanner has parsed its underlying synctex file. */\n\t\tunsigned reserved:sizeof(unsigned)-1;\t/*  alignment */\n\t} flags;\n\tint pre_magnification;        /*  magnification from the synctex preamble */\n\tint pre_unit;                 /*  unit from the synctex preamble */\n\tint pre_x_offset;             /*  X offste from the synctex preamble */\n\tint pre_y_offset;             /*  Y offset from the synctex preamble */\n\tint count;                    /*  Number of records, from the synctex postamble */\n\tfloat unit;                   /*  real unit, from synctex preamble or post scriptum */\n\tfloat x_offset;               /*  X offset, from synctex preamble or post scriptum */\n\tfloat y_offset;               /*  Y Offset, from synctex preamble or post scriptum */\n\tsynctex_node_t sheet;         /*  The first sheet node, its siblings are the other sheet nodes */\n\tsynctex_node_t input;         /*  The first input node, its siblings are the other input nodes */\n\tint number_of_lists;          /*  The number of friend lists */\n\tsynctex_node_t * lists_of_friends;/*  The friend lists */\n\t_synctex_class_t class[synctex_node_number_of_types]; /*  The classes of the nodes of the scanner */\n};\n\n/*  SYNCTEX_CUR, SYNCTEX_START and SYNCTEX_END are convenient shortcuts\n */\n#   define SYNCTEX_CUR (scanner->buffer_cur)\n#   define SYNCTEX_START (scanner->buffer_start)\n#   define SYNCTEX_END (scanner->buffer_end)\n\n#\tifdef SYNCTEX_NOTHING\n#       pragma mark -\n#       pragma mark OBJECTS, their creators and destructors.\n#   endif\n\n/*  Here, we define the indices for the different informations.\n *  They are used to declare the size of the implementation.\n *  For example, if one object uses SYNCTEX_HORIZ_IDX is its size,\n *  then its info will contain a tag, line, column, horiz but no width nor height nor depth\n */\n\n/*  The sheet is a first level node.\n *  It has no parent (the parent is the scanner itself)\n *  Its sibling points to another sheet.\n *  Its child points to its first child, in general a box.\n *  A sheet node contains only one synctex information: the page.\n *  This is the 1 based page index as given by TeX.\n */\n/*  The next macros are used to access the node info\n *  SYNCTEX_INFO(node) points to the first synctex integer or pointer data of node\n *  SYNCTEX_INFO(node)[index] is the information at index\n *  for example, the page of a sheet is stored in SYNCTEX_INFO(sheet)[SYNCTEX_PAGE_IDX]\n */\n#   define SYNCTEX_INFO(NODE) ((*((((NODE)->class))->info))(NODE))\n#   define SYNCTEX_PAGE_IDX 0\n#   define SYNCTEX_PAGE(NODE) SYNCTEX_INFO(NODE)[SYNCTEX_PAGE_IDX].INT\n\n/*  This macro defines implementation offsets\n *  It is only used for pointer values\n */\n#   define SYNCTEX_MAKE_GET(SYNCTEX_GETTER,OFFSET)\\\nsynctex_node_t * SYNCTEX_GETTER (synctex_node_t node);\\\nsynctex_node_t * SYNCTEX_GETTER (synctex_node_t node) {\\\n\treturn node?(synctex_node_t *)((&((node)->implementation))+OFFSET):NULL;\\\n}\nSYNCTEX_MAKE_GET(_synctex_implementation_0,0)\nSYNCTEX_MAKE_GET(_synctex_implementation_1,1)\nSYNCTEX_MAKE_GET(_synctex_implementation_2,2)\nSYNCTEX_MAKE_GET(_synctex_implementation_3,3)\nSYNCTEX_MAKE_GET(_synctex_implementation_4,4)\nSYNCTEX_MAKE_GET(_synctex_implementation_5,5)\n\ntypedef struct {\n\tsynctex_class_t class;\n\tsynctex_info_t implementation[3+SYNCTEX_PAGE_IDX+1];/*  child, sibling, next box,\n\t                         *  SYNCTEX_PAGE_IDX */\n} synctex_sheet_t;\n\nsynctex_node_t _synctex_new_sheet(synctex_scanner_t scanner);\nvoid _synctex_display_sheet(synctex_node_t sheet);\nvoid _synctex_log_sheet(synctex_node_t sheet);\n\nstatic _synctex_class_t synctex_class_sheet = {\n\tNULL,                       /*  No scanner yet */\n\tsynctex_node_type_sheet,    /*  Node type */\n\t&_synctex_new_sheet,        /*  creator */\n\t&_synctex_free_node,        /*  destructor */\n\t&_synctex_log_sheet,        /*  log */\n\t&_synctex_display_sheet,    /*  display */\n\tNULL,                       /*  No parent */\n\t&_synctex_implementation_0, /*  child */\n\t&_synctex_implementation_1, /*  sibling */\n\tNULL,                       /*  No friend */\n\t&_synctex_implementation_2, /*  Next box */\n\t(_synctex_info_getter_t)&_synctex_implementation_3  /*  info */\n};\n\n/*  sheet node creator */\nsynctex_node_t _synctex_new_sheet(synctex_scanner_t scanner) {\n\tsynctex_node_t node = _synctex_malloc(sizeof(synctex_sheet_t));\n\tif (node) {\n\t\tnode->class = scanner?scanner->class+synctex_node_type_sheet:(synctex_class_t)&synctex_class_sheet;\n\t}\n\treturn node;\n}\n\n/*  A box node contains navigation and synctex information\n *  There are different kind of boxes.\n *  Only horizontal boxes are treated differently because of their visible size.\n */\n#   define SYNCTEX_TAG_IDX 0\n#   define SYNCTEX_LINE_IDX (SYNCTEX_TAG_IDX+1)\n#   define SYNCTEX_COLUMN_IDX (SYNCTEX_LINE_IDX+1)\n#   define SYNCTEX_HORIZ_IDX (SYNCTEX_COLUMN_IDX+1)\n#   define SYNCTEX_VERT_IDX (SYNCTEX_HORIZ_IDX+1)\n#   define SYNCTEX_WIDTH_IDX (SYNCTEX_VERT_IDX+1)\n#   define SYNCTEX_HEIGHT_IDX (SYNCTEX_WIDTH_IDX+1)\n#   define SYNCTEX_DEPTH_IDX (SYNCTEX_HEIGHT_IDX+1)\n/*  the corresponding info accessors */\n#   define SYNCTEX_TAG(NODE) SYNCTEX_INFO(NODE)[SYNCTEX_TAG_IDX].INT\n#   define SYNCTEX_LINE(NODE) SYNCTEX_INFO(NODE)[SYNCTEX_LINE_IDX].INT\n#   define SYNCTEX_COLUMN(NODE) SYNCTEX_INFO(NODE)[SYNCTEX_COLUMN_IDX].INT\n#   define SYNCTEX_HORIZ(NODE) SYNCTEX_INFO(NODE)[SYNCTEX_HORIZ_IDX].INT\n#   define SYNCTEX_VERT(NODE) SYNCTEX_INFO(NODE)[SYNCTEX_VERT_IDX].INT\n#   define SYNCTEX_WIDTH(NODE) SYNCTEX_INFO(NODE)[SYNCTEX_WIDTH_IDX].INT\n#   define SYNCTEX_HEIGHT(NODE) SYNCTEX_INFO(NODE)[SYNCTEX_HEIGHT_IDX].INT\n#   define SYNCTEX_DEPTH(NODE) SYNCTEX_INFO(NODE)[SYNCTEX_DEPTH_IDX].INT\n#   define SYNCTEX_ABS_WIDTH(NODE) ((SYNCTEX_WIDTH(NODE)>0?SYNCTEX_WIDTH(NODE):-SYNCTEX_WIDTH(NODE)))\n#   define SYNCTEX_ABS_HEIGHT(NODE) ((SYNCTEX_HEIGHT(NODE)>0?SYNCTEX_HEIGHT(NODE):-SYNCTEX_HEIGHT(NODE)))\n#   define SYNCTEX_ABS_DEPTH(NODE) ((SYNCTEX_DEPTH(NODE)>0?SYNCTEX_DEPTH(NODE):-SYNCTEX_DEPTH(NODE)))\n\ntypedef struct {\n\tsynctex_class_t class;\n\tsynctex_info_t implementation[5+SYNCTEX_DEPTH_IDX+1]; /*  parent,child,sibling,friend,next box,\n\t\t\t\t\t\t        *  SYNCTEX_TAG,SYNCTEX_LINE,SYNCTEX_COLUMN,\n\t\t\t\t\t\t\t\t*  SYNCTEX_HORIZ,SYNCTEX_VERT,SYNCTEX_WIDTH,SYNCTEX_HEIGHT,SYNCTEX_DEPTH */\n} synctex_vert_box_node_t;\n\nsynctex_node_t _synctex_new_vbox(synctex_scanner_t scanner);\nvoid _synctex_log_box(synctex_node_t sheet);\nvoid _synctex_display_vbox(synctex_node_t node);\n\n/*  These are static class objects, each scanner will make a copy of them and setup the scanner field.\n */\nstatic _synctex_class_t synctex_class_vbox = {\n\tNULL,                       /*  No scanner yet */\n\tsynctex_node_type_vbox,     /*  Node type */\n\t&_synctex_new_vbox,         /*  creator */\n\t&_synctex_free_node,        /*  destructor */\n\t&_synctex_log_box,          /*  log */\n\t&_synctex_display_vbox,     /*  display */\n\t&_synctex_implementation_0, /*  parent */\n\t&_synctex_implementation_1, /*  child */\n\t&_synctex_implementation_2, /*  sibling */\n\t&_synctex_implementation_3, /*  friend */\n\t&_synctex_implementation_4, /*  next box */\n\t(_synctex_info_getter_t)&_synctex_implementation_5\n};\n\n/*  vertical box node creator */\nsynctex_node_t _synctex_new_vbox(synctex_scanner_t scanner) {\n\tsynctex_node_t node = _synctex_malloc(sizeof(synctex_vert_box_node_t));\n\tif (node) {\n\t\tnode->class = scanner?scanner->class+synctex_node_type_vbox:(synctex_class_t)&synctex_class_vbox;\n\t}\n\treturn node;\n}\n\n#   define SYNCTEX_HORIZ_V_IDX (SYNCTEX_DEPTH_IDX+1)\n#   define SYNCTEX_VERT_V_IDX (SYNCTEX_HORIZ_V_IDX+1)\n#   define SYNCTEX_WIDTH_V_IDX (SYNCTEX_VERT_V_IDX+1)\n#   define SYNCTEX_HEIGHT_V_IDX (SYNCTEX_WIDTH_V_IDX+1)\n#   define SYNCTEX_DEPTH_V_IDX (SYNCTEX_HEIGHT_V_IDX+1)\n/*  the corresponding info accessors */\n#   define SYNCTEX_HORIZ_V(NODE) SYNCTEX_INFO(NODE)[SYNCTEX_HORIZ_V_IDX].INT\n#   define SYNCTEX_VERT_V(NODE) SYNCTEX_INFO(NODE)[SYNCTEX_VERT_V_IDX].INT\n#   define SYNCTEX_WIDTH_V(NODE) SYNCTEX_INFO(NODE)[SYNCTEX_WIDTH_V_IDX].INT\n#   define SYNCTEX_HEIGHT_V(NODE) SYNCTEX_INFO(NODE)[SYNCTEX_HEIGHT_V_IDX].INT\n#   define SYNCTEX_DEPTH_V(NODE) SYNCTEX_INFO(NODE)[SYNCTEX_DEPTH_V_IDX].INT\n#   define SYNCTEX_ABS_WIDTH_V(NODE) ((SYNCTEX_WIDTH_V(NODE)>0?SYNCTEX_WIDTH_V(NODE):-SYNCTEX_WIDTH_V(NODE)))\n#   define SYNCTEX_ABS_HEIGHT_V(NODE) ((SYNCTEX_HEIGHT_V(NODE)>0?SYNCTEX_HEIGHT_V(NODE):-SYNCTEX_HEIGHT_V(NODE)))\n#   define SYNCTEX_ABS_DEPTH_V(NODE) ((SYNCTEX_DEPTH_V(NODE)>0?SYNCTEX_DEPTH_V(NODE):-SYNCTEX_DEPTH_V(NODE)))\n\n/*  Horizontal boxes must contain visible size, because 0 width does not mean emptiness */\ntypedef struct {\n\tsynctex_class_t class;\n\tsynctex_info_t implementation[5+SYNCTEX_DEPTH_V_IDX+1]; /*parent,child,sibling,friend,next box,\n\t\t\t\t\t\t*  SYNCTEX_TAG,SYNCTEX_LINE,SYNCTEX_COLUMN,\n\t\t\t\t\t\t*  SYNCTEX_HORIZ,SYNCTEX_VERT,SYNCTEX_WIDTH,SYNCTEX_HEIGHT,SYNCTEX_DEPTH,\n\t\t\t\t\t\t*  SYNCTEX_HORIZ_V,SYNCTEX_VERT_V,SYNCTEX_WIDTH_V,SYNCTEX_HEIGHT_V,SYNCTEX_DEPTH_V*/\n} synctex_horiz_box_node_t;\n\nsynctex_node_t _synctex_new_hbox(synctex_scanner_t scanner);\nvoid _synctex_display_hbox(synctex_node_t node);\nvoid _synctex_log_horiz_box(synctex_node_t sheet);\n\n\nstatic _synctex_class_t synctex_class_hbox = {\n\tNULL,                       /*  No scanner yet */\n\tsynctex_node_type_hbox,     /*  Node type */\n\t&_synctex_new_hbox,         /*  creator */\n\t&_synctex_free_node,        /*  destructor */\n\t&_synctex_log_horiz_box,    /*  log */\n\t&_synctex_display_hbox,     /*  display */\n\t&_synctex_implementation_0, /*  parent */\n\t&_synctex_implementation_1, /*  child */\n\t&_synctex_implementation_2, /*  sibling */\n\t&_synctex_implementation_3, /*  friend */\n\t&_synctex_implementation_4, /*  next box */\n\t(_synctex_info_getter_t)&_synctex_implementation_5\n};\n\n/*  horizontal box node creator */\nsynctex_node_t _synctex_new_hbox(synctex_scanner_t scanner) {\n\tsynctex_node_t node = _synctex_malloc(sizeof(synctex_horiz_box_node_t));\n\tif (node) {\n\t\tnode->class = scanner?scanner->class+synctex_node_type_hbox:(synctex_class_t)&synctex_class_hbox;\n\t}\n\treturn node;\n}\n\n/*  This void box node implementation is either horizontal or vertical\n *  It does not contain a child field.\n */\ntypedef struct {\n\tsynctex_class_t class;\n\tsynctex_info_t implementation[3+SYNCTEX_DEPTH_IDX+1]; /*  parent,sibling,friend,\n\t                  *  SYNCTEX_TAG,SYNCTEX_LINE,SYNCTEX_COLUMN,\n\t\t\t\t\t  *  SYNCTEX_HORIZ,SYNCTEX_VERT,SYNCTEX_WIDTH,SYNCTEX_HEIGHT,SYNCTEX_DEPTH*/\n} synctex_void_box_node_t;\n\nsynctex_node_t _synctex_new_void_vbox(synctex_scanner_t scanner);\nvoid _synctex_log_void_box(synctex_node_t sheet);\nvoid _synctex_display_void_vbox(synctex_node_t node);\n\nstatic _synctex_class_t synctex_class_void_vbox = {\n\tNULL,                       /*  No scanner yet */\n\tsynctex_node_type_void_vbox,/*  Node type */\n\t&_synctex_new_void_vbox,    /*  creator */\n\t&_synctex_free_node,        /*  destructor */\n\t&_synctex_log_void_box,     /*  log */\n\t&_synctex_display_void_vbox,/*  display */\n\t&_synctex_implementation_0, /*  parent */\n\tNULL,                       /*  No child */\n\t&_synctex_implementation_1, /*  sibling */\n\t&_synctex_implementation_2, /*  friend */\n\tNULL,\t\t\t\t\t\t/*  No next box */\n\t(_synctex_info_getter_t)&_synctex_implementation_3\n};\n\n/*  vertical void box node creator */\nsynctex_node_t _synctex_new_void_vbox(synctex_scanner_t scanner) {\n\tsynctex_node_t node = _synctex_malloc(sizeof(synctex_void_box_node_t));\n\tif (node) {\n\t\tnode->class = scanner?scanner->class+synctex_node_type_void_vbox:(synctex_class_t)&synctex_class_void_vbox;\n\t}\n\treturn node;\n}\n\nsynctex_node_t _synctex_new_void_hbox(synctex_scanner_t scanner);\nvoid _synctex_display_void_hbox(synctex_node_t node);\n\nstatic _synctex_class_t synctex_class_void_hbox = {\n\tNULL,                       /*  No scanner yet */\n\tsynctex_node_type_void_hbox,/*  Node type */\n\t&_synctex_new_void_hbox,    /*  creator */\n\t&_synctex_free_node,        /*  destructor */\n\t&_synctex_log_void_box,     /*  log */\n\t&_synctex_display_void_hbox,/*  display */\n\t&_synctex_implementation_0, /*  parent */\n\tNULL,                       /*  No child */\n\t&_synctex_implementation_1, /*  sibling */\n\t&_synctex_implementation_2, /*  friend */\n\tNULL,\t\t\t\t\t\t/*  No next box */\n\t(_synctex_info_getter_t)&_synctex_implementation_3\n};\n\n/*  horizontal void box node creator */\nsynctex_node_t _synctex_new_void_hbox(synctex_scanner_t scanner) {\n\tsynctex_node_t node = _synctex_malloc(sizeof(synctex_void_box_node_t));\n\tif (node) {\n\t\tnode->class = scanner?scanner->class+synctex_node_type_void_hbox:(synctex_class_t)&synctex_class_void_hbox;\n\t}\n\treturn node;\n}\n\n/*  The medium nodes correspond to kern, glue, penalty and math nodes.  */\ntypedef struct {\n\tsynctex_class_t class;\n\tsynctex_info_t implementation[3+SYNCTEX_WIDTH_IDX+1]; /*  parent,sibling,friend,\n\t                  *  SYNCTEX_TAG,SYNCTEX_LINE,SYNCTEX_COLUMN,\n\t\t\t\t\t  *  SYNCTEX_HORIZ,SYNCTEX_VERT,SYNCTEX_WIDTH */\n} synctex_medium_node_t;\n\n#define SYNCTEX_IS_BOX(NODE)\\\n\t((NODE->class->type == synctex_node_type_vbox)\\\n\t|| (NODE->class->type == synctex_node_type_void_vbox)\\\n\t|| (NODE->class->type == synctex_node_type_hbox)\\\n\t|| (NODE->class->type == synctex_node_type_void_hbox))\n\t\n#define SYNCTEX_HAS_CHILDREN(NODE) (NODE && SYNCTEX_CHILD(NODE))\n\t\nvoid _synctex_log_medium_node(synctex_node_t node);\n\n/*  math node creator */\nsynctex_node_t _synctex_new_math(synctex_scanner_t scanner);\nvoid _synctex_display_math(synctex_node_t node);\n\nstatic _synctex_class_t synctex_class_math = {\n\tNULL,                       /*  No scanner yet */\n\tsynctex_node_type_math,     /*  Node type */\n\t&_synctex_new_math,         /*  creator */\n\t&_synctex_free_leaf,        /*  destructor */\n\t&_synctex_log_medium_node,  /*  log */\n\t&_synctex_display_math,     /*  display */\n\t&_synctex_implementation_0, /*  parent */\n\tNULL,                       /*  No child */\n\t&_synctex_implementation_1, /*  sibling */\n\t&_synctex_implementation_2, /*  friend */\n\tNULL,                       /*  No next box */\n\t(_synctex_info_getter_t)&_synctex_implementation_3\n};\n\nsynctex_node_t _synctex_new_math(synctex_scanner_t scanner) {\n\tsynctex_node_t node = _synctex_malloc(sizeof(synctex_medium_node_t));\n\tif (node) {\n\t\tnode->class = scanner?scanner->class+synctex_node_type_math:(synctex_class_t)&synctex_class_math;\n\t}\n\treturn node;\n}\n\n/*  kern node creator */\nsynctex_node_t _synctex_new_kern(synctex_scanner_t scanner);\nvoid _synctex_display_kern(synctex_node_t node);\n\nstatic _synctex_class_t synctex_class_kern = {\n\tNULL,                       /*  No scanner yet */\n\tsynctex_node_type_kern,     /*  Node type */\n\t&_synctex_new_kern,         /*  creator */\n\t&_synctex_free_leaf,        /*  destructor */\n\t&_synctex_log_medium_node,  /*  log */\n\t&_synctex_display_kern,     /*  display */\n\t&_synctex_implementation_0, /*  parent */\n\tNULL,                       /*  No child */\n\t&_synctex_implementation_1, /*  sibling */\n\t&_synctex_implementation_2, /*  friend */\n\tNULL,                       /*  No next box */\n\t(_synctex_info_getter_t)&_synctex_implementation_3\n};\n\nsynctex_node_t _synctex_new_kern(synctex_scanner_t scanner) {\n\tsynctex_node_t node = _synctex_malloc(sizeof(synctex_medium_node_t));\n\tif (node) {\n\t\tnode->class = scanner?scanner->class+synctex_node_type_kern:(synctex_class_t)&synctex_class_kern;\n\t}\n\treturn node;\n}\n\n/*  The small nodes correspond to glue and boundary nodes.  */\ntypedef struct {\n\tsynctex_class_t class;\n\tsynctex_info_t implementation[3+SYNCTEX_VERT_IDX+1]; /*  parent,sibling,friend,\n\t                  *  SYNCTEX_TAG,SYNCTEX_LINE,SYNCTEX_COLUMN,\n\t\t\t\t\t  *  SYNCTEX_HORIZ,SYNCTEX_VERT */\n} synctex_small_node_t;\n\nvoid _synctex_log_small_node(synctex_node_t node);\n/*  glue node creator */\nsynctex_node_t _synctex_new_glue(synctex_scanner_t scanner);\nvoid _synctex_display_glue(synctex_node_t node);\n\nstatic _synctex_class_t synctex_class_glue = {\n\tNULL,                       /*  No scanner yet */\n\tsynctex_node_type_glue,     /*  Node type */\n\t&_synctex_new_glue,         /*  creator */\n\t&_synctex_free_leaf,        /*  destructor */\n\t&_synctex_log_medium_node,  /*  log */\n\t&_synctex_display_glue,     /*  display */\n\t&_synctex_implementation_0, /*  parent */\n\tNULL,                       /*  No child */\n\t&_synctex_implementation_1, /*  sibling */\n\t&_synctex_implementation_2, /*  friend */\n\tNULL,                       /*  No next box */\n\t(_synctex_info_getter_t)&_synctex_implementation_3\n};\nsynctex_node_t _synctex_new_glue(synctex_scanner_t scanner) {\n\tsynctex_node_t node = _synctex_malloc(sizeof(synctex_medium_node_t));\n\tif (node) {\n\t\tnode->class = scanner?scanner->class+synctex_node_type_glue:(synctex_class_t)&synctex_class_glue;\n\t}\n\treturn node;\n}\n\n/*  boundary node creator */\nsynctex_node_t _synctex_new_boundary(synctex_scanner_t scanner);\nvoid _synctex_display_boundary(synctex_node_t node);\n\nstatic _synctex_class_t synctex_class_boundary = {\n\tNULL,                       /*  No scanner yet */\n\tsynctex_node_type_boundary,     /*  Node type */\n\t&_synctex_new_boundary, /*  creator */\n\t&_synctex_free_leaf,        /*  destructor */\n\t&_synctex_log_small_node,   /*  log */\n\t&_synctex_display_boundary,     /*  display */\n\t&_synctex_implementation_0, /*  parent */\n\tNULL,                       /*  No child */\n\t&_synctex_implementation_1, /*  sibling */\n\t&_synctex_implementation_2, /*  friend */\n\tNULL,                       /*  No next box */\n\t(_synctex_info_getter_t)&_synctex_implementation_3\n};\n\nsynctex_node_t _synctex_new_boundary(synctex_scanner_t scanner) {\n\tsynctex_node_t node = _synctex_malloc(sizeof(synctex_small_node_t));\n\tif (node) {\n\t\tnode->class = scanner?scanner->class+synctex_node_type_boundary:(synctex_class_t)&synctex_class_boundary;\n\t}\n\treturn node;\n}\n\n#   define SYNCTEX_NAME_IDX (SYNCTEX_TAG_IDX+1)\n#   define SYNCTEX_NAME(NODE) SYNCTEX_INFO(NODE)[SYNCTEX_NAME_IDX].PTR\n\n/*  Input nodes only know about their sibling, which is another input node.\n *  The synctex information is the SYNCTEX_TAG and SYNCTEX_NAME*/\ntypedef struct {\n\tsynctex_class_t class;\n\tsynctex_info_t implementation[1+SYNCTEX_NAME_IDX+1]; /*  sibling,\n\t                          *  SYNCTEX_TAG,SYNCTEX_NAME */\n} synctex_input_t;\n\nsynctex_node_t _synctex_new_input(synctex_scanner_t scanner);\nvoid _synctex_free_input(synctex_node_t node);\nvoid _synctex_display_input(synctex_node_t node);\nvoid _synctex_log_input(synctex_node_t sheet);\n\nstatic _synctex_class_t synctex_class_input = {\n\tNULL,                       /*  No scanner yet */\n\tsynctex_node_type_input,    /*  Node type */\n\t&_synctex_new_input,        /*  creator */\n\t&_synctex_free_input,       /*  destructor */\n\t&_synctex_log_input,        /*  log */\n\t&_synctex_display_input,    /*  display */\n\tNULL,                       /*  No parent */\n\tNULL,                       /*  No child */\n\t&_synctex_implementation_0, /*  sibling */\n\tNULL,                       /*  No friend */\n\tNULL,                       /*  No next box */\n\t(_synctex_info_getter_t)&_synctex_implementation_1\n};\n\nsynctex_node_t _synctex_new_input(synctex_scanner_t scanner) {\n\tsynctex_node_t node = _synctex_malloc(sizeof(synctex_input_t));\n\tif (node) {\n\t\tnode->class = scanner?scanner->class+synctex_node_type_input:(synctex_class_t)&synctex_class_input;\n\t}\n\treturn node;\n}\nvoid _synctex_free_input(synctex_node_t node){\n\tif (node) {\n\t\tSYNCTEX_FREE(SYNCTEX_SIBLING(node));\n\t\tfree(SYNCTEX_NAME(node));\n\t\tfree(node);\n\t}\n}\n#\tifdef SYNCTEX_NOTHING\n#       pragma mark -\n#       pragma mark Navigation\n#   endif\nsynctex_node_t synctex_node_parent(synctex_node_t node)\n{\n\treturn SYNCTEX_PARENT(node);\n}\nsynctex_node_t synctex_node_sheet(synctex_node_t node)\n{\n\twhile(node && node->class->type != synctex_node_type_sheet) {\n\t\tnode = SYNCTEX_PARENT(node);\n\t}\n\t/*  exit the while loop either when node is NULL or node is a sheet */\n\treturn node;\n}\nsynctex_node_t synctex_node_child(synctex_node_t node)\n{\n\treturn SYNCTEX_CHILD(node);\n}\nsynctex_node_t synctex_node_sibling(synctex_node_t node)\n{\n\treturn SYNCTEX_SIBLING(node);\n}\nsynctex_node_t synctex_node_next(synctex_node_t node) {\n\tif (SYNCTEX_CHILD(node)) {\n\t\treturn SYNCTEX_CHILD(node);\n\t}\nsibling:\n\tif (SYNCTEX_SIBLING(node)) {\n\t\treturn SYNCTEX_SIBLING(node);\n\t}\n\tif ((node = SYNCTEX_PARENT(node))) {\n\t\tif (node->class->type == synctex_node_type_sheet) {/*  EXC_BAD_ACCESS? */\n\t\t\treturn NULL;\n\t\t}\n\t\tgoto sibling;\n\t}\n\treturn NULL;\n}\n#\tifdef SYNCTEX_NOTHING\n#       pragma mark -\n#       pragma mark CLASS\n#   endif\n\n/*  Public node accessor: the type  */\nsynctex_node_type_t synctex_node_type(synctex_node_t node) {\n\tif (node) {\n\t\treturn (((node)->class))->type;\n\t}\n\treturn synctex_node_type_error;\n}\n\n/*  Public node accessor: the human readable type  */\nconst char * synctex_node_isa(synctex_node_t node) {\nstatic const char * isa[synctex_node_number_of_types] =\n\t\t{\"Not a node\",\"input\",\"sheet\",\"vbox\",\"void vbox\",\"hbox\",\"void hbox\",\"kern\",\"glue\",\"math\",\"boundary\"};\n\treturn isa[synctex_node_type(node)];\n}\n\n#\tifdef SYNCTEX_NOTHING\n#       pragma mark -\n#       pragma mark SYNCTEX_LOG\n#   endif\n\n#   define SYNCTEX_LOG(NODE) SYNCTEX_MSG_SEND(NODE,log)\n\n/*  Public node logger  */\nvoid synctex_node_log(synctex_node_t node) {\n\tSYNCTEX_LOG(node);\n}\n\n#   define SYNCTEX_DISPLAY(NODE) SYNCTEX_MSG_SEND(NODE,display)\n\nvoid synctex_node_display(synctex_node_t node) {\n\tSYNCTEX_DISPLAY(node);\n}\n\nvoid _synctex_display_input(synctex_node_t node) {\n\tprintf(\"....Input:%i:%s\\n\",\n\t\tSYNCTEX_TAG(node),\n\t\tSYNCTEX_NAME(node));\n\tSYNCTEX_DISPLAY(SYNCTEX_SIBLING(node));\n}\n\nvoid _synctex_log_sheet(synctex_node_t sheet) {\n\tif (sheet) {\n\t\tprintf(\"%s:%i\\n\",synctex_node_isa(sheet),SYNCTEX_PAGE(sheet));\n\t\tprintf(\"SELF:%p\",(void *)sheet);\n\t\tprintf(\" SYNCTEX_PARENT:%p\",(void *)SYNCTEX_PARENT(sheet));\n\t\tprintf(\" SYNCTEX_CHILD:%p\",(void *)SYNCTEX_CHILD(sheet));\n\t\tprintf(\" SYNCTEX_SIBLING:%p\",(void *)SYNCTEX_SIBLING(sheet));\n\t\tprintf(\" SYNCTEX_FRIEND:%p\\n\",(void *)SYNCTEX_FRIEND(sheet));\n\t}\n}\n\nvoid _synctex_log_small_node(synctex_node_t node) {\n\tprintf(\"%s:%i,%i:%i,%i\\n\",\n\t\tsynctex_node_isa(node),\n\t\tSYNCTEX_TAG(node),\n\t\tSYNCTEX_LINE(node),\n\t\tSYNCTEX_HORIZ(node),\n\t\tSYNCTEX_VERT(node));\n\tprintf(\"SELF:%p\",(void *)node);\n\tprintf(\" SYNCTEX_PARENT:%p\",(void *)SYNCTEX_PARENT(node));\n\tprintf(\" SYNCTEX_CHILD:%p\",(void *)SYNCTEX_CHILD(node));\n\tprintf(\" SYNCTEX_SIBLING:%p\",(void *)SYNCTEX_SIBLING(node));\n\tprintf(\" SYNCTEX_FRIEND:%p\\n\",(void *)SYNCTEX_FRIEND(node));\n}\n\nvoid _synctex_log_medium_node(synctex_node_t node) {\n\tprintf(\"%s:%i,%i:%i,%i:%i\\n\",\n\t\tsynctex_node_isa(node),\n\t\tSYNCTEX_TAG(node),\n\t\tSYNCTEX_LINE(node),\n\t\tSYNCTEX_HORIZ(node),\n\t\tSYNCTEX_VERT(node),\n\t\tSYNCTEX_WIDTH(node));\n\tprintf(\"SELF:%p\",(void *)node);\n\tprintf(\" SYNCTEX_PARENT:%p\",(void *)SYNCTEX_PARENT(node));\n\tprintf(\" SYNCTEX_CHILD:%p\",(void *)SYNCTEX_CHILD(node));\n\tprintf(\" SYNCTEX_SIBLING:%p\",(void *)SYNCTEX_SIBLING(node));\n\tprintf(\" SYNCTEX_FRIEND:%p\\n\",(void *)SYNCTEX_FRIEND(node));\n}\n\nvoid _synctex_log_void_box(synctex_node_t node) {\n\tprintf(\"%s\",synctex_node_isa(node));\n\tprintf(\":%i\",SYNCTEX_TAG(node));\n\tprintf(\",%i\",SYNCTEX_LINE(node));\n\tprintf(\",%i\",0);\n\tprintf(\":%i\",SYNCTEX_HORIZ(node));\n\tprintf(\",%i\",SYNCTEX_VERT(node));\n\tprintf(\":%i\",SYNCTEX_WIDTH(node));\n\tprintf(\",%i\",SYNCTEX_HEIGHT(node));\n\tprintf(\",%i\",SYNCTEX_DEPTH(node));\n\tprintf(\"\\nSELF:%p\",(void *)node);\n\tprintf(\" SYNCTEX_PARENT:%p\",(void *)SYNCTEX_PARENT(node));\n\tprintf(\" SYNCTEX_CHILD:%p\",(void *)SYNCTEX_CHILD(node));\n\tprintf(\" SYNCTEX_SIBLING:%p\",(void *)SYNCTEX_SIBLING(node));\n\tprintf(\" SYNCTEX_FRIEND:%p\\n\",(void *)SYNCTEX_FRIEND(node));\n}\n\nvoid _synctex_log_box(synctex_node_t node) {\n\tprintf(\"%s\",synctex_node_isa(node));\n\tprintf(\":%i\",SYNCTEX_TAG(node));\n\tprintf(\",%i\",SYNCTEX_LINE(node));\n\tprintf(\",%i\",0);\n\tprintf(\":%i\",SYNCTEX_HORIZ(node));\n\tprintf(\",%i\",SYNCTEX_VERT(node));\n\tprintf(\":%i\",SYNCTEX_WIDTH(node));\n\tprintf(\",%i\",SYNCTEX_HEIGHT(node));\n\tprintf(\",%i\",SYNCTEX_DEPTH(node));\n\tprintf(\"\\nSELF:%p\",(void *)node);\n\tprintf(\" SYNCTEX_PARENT:%p\",(void *)SYNCTEX_PARENT(node));\n\tprintf(\" SYNCTEX_CHILD:%p\",(void *)SYNCTEX_CHILD(node));\n\tprintf(\" SYNCTEX_SIBLING:%p\",(void *)SYNCTEX_SIBLING(node));\n\tprintf(\" SYNCTEX_FRIEND:%p\\n\",(void *)SYNCTEX_FRIEND(node));\n}\n\nvoid _synctex_log_horiz_box(synctex_node_t node) {\n\tprintf(\"%s\",synctex_node_isa(node));\n\tprintf(\":%i\",SYNCTEX_TAG(node));\n\tprintf(\",%i\",SYNCTEX_LINE(node));\n\tprintf(\",%i\",0);\n\tprintf(\":%i\",SYNCTEX_HORIZ(node));\n\tprintf(\",%i\",SYNCTEX_VERT(node));\n\tprintf(\":%i\",SYNCTEX_WIDTH(node));\n\tprintf(\",%i\",SYNCTEX_HEIGHT(node));\n\tprintf(\",%i\",SYNCTEX_DEPTH(node));\n\tprintf(\"/%i\",SYNCTEX_HORIZ_V(node));\n\tprintf(\",%i\",SYNCTEX_VERT_V(node));\n\tprintf(\":%i\",SYNCTEX_WIDTH_V(node));\n\tprintf(\",%i\",SYNCTEX_HEIGHT_V(node));\n\tprintf(\",%i\",SYNCTEX_DEPTH_V(node));\n\tprintf(\"\\nSELF:%p\",(void *)node);\n\tprintf(\" SYNCTEX_PARENT:%p\",(void *)SYNCTEX_PARENT(node));\n\tprintf(\" SYNCTEX_CHILD:%p\",(void *)SYNCTEX_CHILD(node));\n\tprintf(\" SYNCTEX_SIBLING:%p\",(void *)SYNCTEX_SIBLING(node));\n\tprintf(\" SYNCTEX_FRIEND:%p\\n\",(void *)SYNCTEX_FRIEND(node));\n}\n\nvoid _synctex_log_input(synctex_node_t node) {\n\tprintf(\"%s\",synctex_node_isa(node));\n\tprintf(\":%i\",SYNCTEX_TAG(node));\n\tprintf(\",%s\",SYNCTEX_NAME(node));\n\tprintf(\" SYNCTEX_SIBLING:%p\",(void *)SYNCTEX_SIBLING(node));\n}\n\nvoid _synctex_display_sheet(synctex_node_t sheet) {\n\tif (sheet) {\n\t\tprintf(\"....{%i\\n\",SYNCTEX_PAGE(sheet));\n\t\tSYNCTEX_DISPLAY(SYNCTEX_CHILD(sheet));\n\t\tprintf(\"....}\\n\");\n\t\tSYNCTEX_DISPLAY(SYNCTEX_SIBLING(sheet));\n\t}\n}\n\nvoid _synctex_display_vbox(synctex_node_t node) {\n\tprintf(\"....[%i,%i:%i,%i:%i,%i,%i\\n\",\n\t\tSYNCTEX_TAG(node),\n\t\tSYNCTEX_LINE(node),\n\t\tSYNCTEX_HORIZ(node),\n\t\tSYNCTEX_VERT(node),\n\t\tSYNCTEX_WIDTH(node),\n\t\tSYNCTEX_HEIGHT(node),\n\t\tSYNCTEX_DEPTH(node));\n\tSYNCTEX_DISPLAY(SYNCTEX_CHILD(node));\n\tprintf(\"....]\\n\");\n\tSYNCTEX_DISPLAY(SYNCTEX_SIBLING(node));\n}\n\nvoid _synctex_display_hbox(synctex_node_t node) {\n\tprintf(\"....(%i,%i:%i,%i:%i,%i,%i\\n\",\n\t\tSYNCTEX_TAG(node),\n\t\tSYNCTEX_LINE(node),\n\t\tSYNCTEX_HORIZ(node),\n\t\tSYNCTEX_VERT(node),\n\t\tSYNCTEX_WIDTH(node),\n\t\tSYNCTEX_HEIGHT(node),\n\t\tSYNCTEX_DEPTH(node));\n\tSYNCTEX_DISPLAY(SYNCTEX_CHILD(node));\n\tprintf(\"....)\\n\");\n\tSYNCTEX_DISPLAY(SYNCTEX_SIBLING(node));\n}\n\nvoid _synctex_display_void_vbox(synctex_node_t node) {\n\tprintf(\"....v%i,%i;%i,%i:%i,%i,%i\\n\",\n\t\tSYNCTEX_TAG(node),\n\t\tSYNCTEX_LINE(node),\n\t\tSYNCTEX_HORIZ(node),\n\t\tSYNCTEX_VERT(node),\n\t\tSYNCTEX_WIDTH(node),\n\t\tSYNCTEX_HEIGHT(node),\n\t\tSYNCTEX_DEPTH(node));\n\tSYNCTEX_DISPLAY(SYNCTEX_SIBLING(node));\n}\n\nvoid _synctex_display_void_hbox(synctex_node_t node) {\n\tprintf(\"....h%i,%i:%i,%i:%i,%i,%i\\n\",\n\t\tSYNCTEX_TAG(node),\n\t\tSYNCTEX_LINE(node),\n\t\tSYNCTEX_HORIZ(node),\n\t\tSYNCTEX_VERT(node),\n\t\tSYNCTEX_WIDTH(node),\n\t\tSYNCTEX_HEIGHT(node),\n\t\tSYNCTEX_DEPTH(node));\n\tSYNCTEX_DISPLAY(SYNCTEX_SIBLING(node));\n}\n\nvoid _synctex_display_glue(synctex_node_t node) {\n\tprintf(\"....glue:%i,%i:%i,%i\\n\",\n\t\tSYNCTEX_TAG(node),\n\t\tSYNCTEX_LINE(node),\n\t\tSYNCTEX_HORIZ(node),\n\t\tSYNCTEX_VERT(node));\n\tSYNCTEX_DISPLAY(SYNCTEX_SIBLING(node));\n}\n\nvoid _synctex_display_math(synctex_node_t node) {\n\tprintf(\"....math:%i,%i:%i,%i\\n\",\n\t\tSYNCTEX_TAG(node),\n\t\tSYNCTEX_LINE(node),\n\t\tSYNCTEX_HORIZ(node),\n\t\tSYNCTEX_VERT(node));\n\tSYNCTEX_DISPLAY(SYNCTEX_SIBLING(node));\n}\n\nvoid _synctex_display_kern(synctex_node_t node) {\n\tprintf(\"....kern:%i,%i:%i,%i:%i\\n\",\n\t\tSYNCTEX_TAG(node),\n\t\tSYNCTEX_LINE(node),\n\t\tSYNCTEX_HORIZ(node),\n\t\tSYNCTEX_VERT(node),\n\t\tSYNCTEX_WIDTH(node));\n\tSYNCTEX_DISPLAY(SYNCTEX_SIBLING(node));\n}\n\nvoid _synctex_display_boundary(synctex_node_t node) {\n\tprintf(\"....boundary:%i,%i:%i,%i\\n\",\n\t\tSYNCTEX_TAG(node),\n\t\tSYNCTEX_LINE(node),\n\t\tSYNCTEX_HORIZ(node),\n\t\tSYNCTEX_VERT(node));\n\tSYNCTEX_DISPLAY(SYNCTEX_SIBLING(node));\n}\n\n#\tifdef SYNCTEX_NOTHING\n#       pragma mark -\n#       pragma mark SCANNER\n#   endif\n\n/*  Here are gathered all the possible status that the next scanning functions will return.\n *  All these functions return a status, and pass their result through pointers.\n *  Negative values correspond to errors.\n *  The management of the buffer is causing some significant overhead.\n *  Every function that may access the buffer returns a status related to the buffer and file state.\n *  status >= SYNCTEX_STATUS_OK means the function worked as expected\n *  status < SYNCTEX_STATUS_OK means the function did not work as expected\n *  status == SYNCTEX_STATUS_NOT_OK means the function did not work as expected but there is still some material to parse.\n *  status == SYNCTEX_STATUS_EOF means the function did not work as expected and there is no more material.\n *  status<SYNCTEX_STATUS_EOF means an error\n */\ntypedef int synctex_status_t;\n/*  When the end of the synctex file has been reached: */\n#   define SYNCTEX_STATUS_EOF 0\n/*  When the function could not return the value it was asked for: */\n#   define SYNCTEX_STATUS_NOT_OK (SYNCTEX_STATUS_EOF+1)\n/*  When the function returns the value it was asked for: */\n#   define SYNCTEX_STATUS_OK (SYNCTEX_STATUS_NOT_OK+1)\n/*  Generic error: */\n#   define SYNCTEX_STATUS_ERROR -1\n/*  Parameter error: */\n#   define SYNCTEX_STATUS_BAD_ARGUMENT -2\n\n#   define SYNCTEX_FILE (scanner->file)\n\n/*  Actually, the minimum buffer size is driven by integer and float parsing.\n *  0.123456789e123\n */\n#   define SYNCTEX_BUFFER_MIN_SIZE 16\n#   define SYNCTEX_BUFFER_SIZE 32768\n\n#\tifdef SYNCTEX_NOTHING\n#       pragma mark -\n#       pragma mark Prototypes\n#   endif\nvoid _synctex_log_void_box(synctex_node_t node);\nvoid _synctex_log_box(synctex_node_t node);\nvoid _synctex_log_horiz_box(synctex_node_t node);\nvoid _synctex_log_input(synctex_node_t node);\nsynctex_status_t _synctex_buffer_get_available_size(synctex_scanner_t scanner, size_t * size_ptr);\nsynctex_status_t _synctex_next_line(synctex_scanner_t scanner);\nsynctex_status_t _synctex_match_string(synctex_scanner_t scanner, const char * the_string);\nsynctex_status_t _synctex_decode_int(synctex_scanner_t scanner, int* value_ref);\nsynctex_status_t _synctex_decode_string(synctex_scanner_t scanner, char ** value_ref);\nsynctex_status_t _synctex_scan_input(synctex_scanner_t scanner);\nsynctex_status_t _synctex_scan_preamble(synctex_scanner_t scanner);\nsynctex_status_t _synctex_scan_float_and_dimension(synctex_scanner_t scanner, float * value_ref);\nsynctex_status_t _synctex_scan_post_scriptum(synctex_scanner_t scanner);\nint _synctex_scan_postamble(synctex_scanner_t scanner);\nsynctex_status_t _synctex_setup_visible_box(synctex_node_t box);\nsynctex_status_t _synctex_horiz_box_setup_visible(synctex_node_t node,int h, int v);\nsynctex_status_t _synctex_scan_sheet(synctex_scanner_t scanner, synctex_node_t parent);\nsynctex_status_t _synctex_scan_nested_sheet(synctex_scanner_t scanner);\nsynctex_status_t _synctex_scan_content(synctex_scanner_t scanner);\nint synctex_scanner_pre_x_offset(synctex_scanner_t scanner);\nint synctex_scanner_pre_y_offset(synctex_scanner_t scanner);\nconst char * synctex_scanner_get_output_fmt(synctex_scanner_t scanner);\nint _synctex_node_is_box(synctex_node_t node);\nint _synctex_bail(void);\n\n/*  Try to ensure that the buffer contains at least size bytes.\n *  Passing a huge size argument means the whole buffer length.\n *  Passing a null size argument means return the available buffer length, without reading the file.\n *  In that case, the return status is always SYNCTEX_STATUS_OK unless the given scanner is NULL,\n *  in which case, SYNCTEX_STATUS_BAD_ARGUMENT is returned.\n *  The value returned in size_ptr is the number of bytes now available in the buffer.\n *  This is a nonnegative integer, it may take the value 0.\n *  It is the responsibility of the caller to test whether this size is conforming to its needs.\n *  Negative values may return in case of error, actually\n *  when there was an error reading the synctex file. */\nsynctex_status_t _synctex_buffer_get_available_size(synctex_scanner_t scanner, size_t * size_ptr) {\n  \tsize_t available = 0;\n\tif (NULL == scanner || NULL == size_ptr) {\n\t\treturn SYNCTEX_STATUS_BAD_ARGUMENT;\n\t}\n#   define size (* size_ptr)\n\tif (size>SYNCTEX_BUFFER_SIZE){\n\t\tsize = SYNCTEX_BUFFER_SIZE;\n\t}\n\tavailable = SYNCTEX_END - SYNCTEX_CUR; /*  available is the number of unparsed chars in the buffer */\n\tif (size<=available) {\n\t\t/*  There are already sufficiently many characters in the buffer */\n\t\tsize = available;\n\t\treturn SYNCTEX_STATUS_OK;\n\t}\n\tif (SYNCTEX_FILE) {\n\t\t/*  Copy the remaining part of the buffer to the beginning,\n\t\t *  then read the next part of the file */\n\t\tint already_read = 0;\n\t\tif (available) {\n\t\t\tmemmove(SYNCTEX_START, SYNCTEX_CUR, available);\n\t\t}\n\t\tSYNCTEX_CUR = SYNCTEX_START + available; /*  the next character after the move, will change. */\n\t\t/*  Fill the buffer up to its end */\n\t\talready_read = gzread(SYNCTEX_FILE,(void *)SYNCTEX_CUR,SYNCTEX_BUFFER_SIZE - available);\n\t\tif (already_read>0) {\n\t\t\t/*  We assume that 0<already_read<=SYNCTEX_BUFFER_SIZE - available, such that\n\t\t\t *  SYNCTEX_CUR + already_read = SYNCTEX_START + available  + already_read <= SYNCTEX_START + SYNCTEX_BUFFER_SIZE */\n\t\t\tSYNCTEX_END = SYNCTEX_CUR + already_read;\n\t\t\t/*  If the end of the file was reached, all the required SYNCTEX_BUFFER_SIZE - available\n\t\t\t *  may not be filled with values from the file.\n\t\t\t *  In that case, the buffer should stop properly after already_read characters. */\n\t\t\t* SYNCTEX_END = '\\0';\n\t\t\tSYNCTEX_CUR = SYNCTEX_START;\n\t\t\tsize = SYNCTEX_END - SYNCTEX_CUR; /* == old available + already_read*/\n\t\t\treturn SYNCTEX_STATUS_OK; /*  May be available is less than size, the caller will have to test. */\n\t\t} else if (0>already_read) {\n\t\t\t/*  There is a possible error in reading the file */\n\t\t\tint errnum = 0;\n\t\t\tconst char * error_string = gzerror(SYNCTEX_FILE, &errnum);\n\t\t\tif (Z_ERRNO == errnum) {\n\t\t\t\t/*  There is an error in zlib caused by the file system */\n\t\t\t\t_synctex_error(\"gzread error from the file system (%i)\",errno);\n                return SYNCTEX_STATUS_ERROR;\n\t\t\t} else if (errnum) {\n\t\t\t\t_synctex_error(\"gzread error (%i:%i,%s)\",already_read,errnum,error_string);\n                return SYNCTEX_STATUS_ERROR;\n\t\t\t}\n\t\t}\n        /*  Nothing was read, we are at the end of the file. */\n        gzclose(SYNCTEX_FILE);\n        SYNCTEX_FILE = NULL;\n        SYNCTEX_END = SYNCTEX_CUR;\n        SYNCTEX_CUR = SYNCTEX_START;\n        * SYNCTEX_END = '\\0';/*  Terminate the string properly.*/\n        size = SYNCTEX_END - SYNCTEX_CUR;\n        return SYNCTEX_STATUS_EOF; /*  there might be a bit of text left */\n    }\n\t/*  We cannot enlarge the buffer because the end of the file was reached. */\n\tsize = available;\n \treturn SYNCTEX_STATUS_EOF;\n#   undef size\n}\n\n/*  Used when parsing the synctex file.\n *  Advance to the next character starting a line.\n *  Actually, only '\\n' is recognized as end of line marker.\n *  On normal completion, the returned value is the number of unparsed characters available in the buffer.\n *  In general, it is a positive value, 0 meaning that the end of file was reached.\n *  -1 is returned in case of error, actually because there was an error while feeding the buffer.\n *  When the function returns with no error, SYNCTEX_CUR points to the first character of the next line, if any.\n *  J. Laurens: Sat May 10 07:52:31 UTC 2008\n */\nsynctex_status_t _synctex_next_line(synctex_scanner_t scanner) {\n\tsynctex_status_t status = SYNCTEX_STATUS_OK;\n\tsize_t available = 0;\n\tif (NULL == scanner) {\n\t\treturn SYNCTEX_STATUS_BAD_ARGUMENT;\n\t}\ninfinite_loop:\n\twhile(SYNCTEX_CUR<SYNCTEX_END) {\n\t\tif (*SYNCTEX_CUR == '\\n') {\n\t\t\t++SYNCTEX_CUR;\n\t\t\tavailable = 1;\n\t\t\treturn _synctex_buffer_get_available_size(scanner, &available);\n\t\t}\n\t\t++SYNCTEX_CUR;\n\t}\n\t/*  Here, we have SYNCTEX_CUR == SYNCTEX_END, such that the next call to _synctex_buffer_get_available_size\n\t *  will read another bunch of synctex file. Little by little, we advance to the end of the file. */\n\tavailable = 1;\n\tstatus = _synctex_buffer_get_available_size(scanner, &available);\n\tif (status<=0) {\n\t\treturn status;\n\t}\n\tgoto infinite_loop;\n}\n\n/*  Scan the given string.\n *  Both scanner and the_string must not be NULL, and the_string must not be 0 length.\n *  SYNCTEX_STATUS_OK is returned if the string is found,\n *  SYNCTEX_STATUS_EOF is returned when the EOF is reached,\n *  SYNCTEX_STATUS_NOT_OK is returned is the string is not found,\n *  an error status is returned otherwise.\n *  This is a critical method because buffering renders things more difficult.\n *  The given string might be as long as the maximum size_t value.\n *  As side effect, the buffer state may have changed if the given argument string can't fit into the buffer.\n */\nsynctex_status_t _synctex_match_string(synctex_scanner_t scanner, const char * the_string) {\n\tsize_t tested_len = 0; /*  the number of characters at the beginning of the_string that match */\n\tsize_t remaining_len = 0; /*  the number of remaining characters of the_string that should match */\n\tsize_t available = 0;\n\tsynctex_status_t status = 0;\n\tif (NULL == scanner || NULL == the_string) {\n\t\treturn SYNCTEX_STATUS_BAD_ARGUMENT;\n\t}\n\tremaining_len = strlen(the_string); /*  All the_string should match */\n\tif (0 == remaining_len) {\n\t\treturn SYNCTEX_STATUS_BAD_ARGUMENT;\n\t}\n\t/*  How many characters available in the buffer? */\n\tavailable = remaining_len;\n\tstatus = _synctex_buffer_get_available_size(scanner,&available);\n\tif (status<SYNCTEX_STATUS_EOF) {\n\t\treturn status;\n\t}\n\t/*  Maybe we have less characters than expected because the buffer is too small. */\n\tif (available>=remaining_len) {\n\t\t/*  The buffer is sufficiently big to hold the expected number of characters. */\n\t\tif (strncmp((char *)SYNCTEX_CUR,the_string,remaining_len)) {\n\t\t\treturn SYNCTEX_STATUS_NOT_OK;\n\t\t}\nreturn_OK:\n\t\t/*  Advance SYNCTEX_CUR to the next character after the_string. */\n\t\tSYNCTEX_CUR += remaining_len;\n\t\treturn SYNCTEX_STATUS_OK;\n\t} else if (strncmp((char *)SYNCTEX_CUR,the_string,available)) {\n\t\t\t/*  No need to goo further, this is not the expected string in the buffer. */\n\t\t\treturn SYNCTEX_STATUS_NOT_OK;\n\t} else if (SYNCTEX_FILE) {\n\t\t/*  The buffer was too small to contain remaining_len characters.\n\t\t *  We have to cut the string into pieces. */\n\t\tz_off_t offset = 0L;\n\t\t/*  the first part of the string is found, advance the_string to the next untested character. */\n\t\tthe_string += available;\n\t\t/*  update the remaining length and the parsed length. */\n\t\tremaining_len -= available;\n\t\ttested_len += available;\n\t\tSYNCTEX_CUR += available; /*  We validate the tested characters. */\n\t\tif (0 == remaining_len) {\n\t\t\t/*  Nothing left to test, we have found the given string, we return the length. */\n\t\t\treturn tested_len;\n\t\t}\n\t\t/*  We also have to record the current state of the file cursor because\n\t\t *  if the_string does not match, all this should be a totally blank operation,\n\t\t *  for which the file and buffer states should not be modified at all.\n\t\t *  In fact, the states of the buffer before and after this function are in general different\n\t\t *  but they are totally equivalent as long as the values of the buffer before SYNCTEX_CUR\n\t\t *  can be safely discarded.  */\n\t\toffset = gztell(SYNCTEX_FILE);\n\t\t/*  offset now corresponds to the first character of the file that was not buffered. */\n\t\tavailable = SYNCTEX_CUR - SYNCTEX_START; /*  available can be used as temporary placeholder. */\n\t\t/*  available now corresponds to the number of chars that where already buffered and\n\t\t *  that match the head of the_string. If in fine the_string does not match, all these chars must be recovered\n\t\t *  because the buffer contents is completely replaced by _synctex_buffer_get_available_size.\n\t\t *  They were buffered from offset-len location in the file. */\n\t\toffset -= available;\nmore_characters:\n\t\t/*  There is still some work to be done, so read another bunch of file.\n\t\t *  This is the second call to _synctex_buffer_get_available_size,\n\t\t *  which means that the actual contents of the buffer will be discarded.\n\t\t *  We will definitely have to recover the previous state in case we do not find the expected string. */\n\t\tavailable = remaining_len;\n\t\tstatus = _synctex_buffer_get_available_size(scanner,&available);\n\t\tif (status<SYNCTEX_STATUS_EOF) {\n\t\t\treturn status; /*  This is an error, no need to go further. */\n\t\t}\n\t\tif (available==0) {\n\t\t\t/*  Missing characters: recover the initial state of the file and return. */\nreturn_NOT_OK:\n\t\t\tif (offset != gzseek(SYNCTEX_FILE,offset,SEEK_SET)) {\n\t\t\t\t/*  This is a critical error, we could not recover the previous state. */\n\t\t\t\t_synctex_error(\"can't seek file\");\n\t\t\t\treturn SYNCTEX_STATUS_ERROR;\n\t\t\t}\n\t\t\t/*  Next time we are asked to fill the buffer,\n\t\t\t *  we will read a complete bunch of text from the file. */\n\t\t\tSYNCTEX_CUR = SYNCTEX_END;\n\t\t\treturn SYNCTEX_STATUS_NOT_OK;\n\t\t}\n\t\tif (available<remaining_len) {\n\t\t\t/*  We'll have to loop one more time. */\n\t\t\tif (strncmp((char *)SYNCTEX_CUR,the_string,available)) {\n\t\t\t\t/*  This is not the expected string, recover the previous state and return. */\n\t\t\t\tgoto return_NOT_OK;\n\t\t\t}\n\t\t\t/*  Advance the_string to the first untested character. */\n\t\t\tthe_string += available;\n\t\t\t/*  update the remaining length and the parsed length. */\n\t\t\tremaining_len -= available;\n\t\t\ttested_len += available;\n\t\t\tSYNCTEX_CUR += available; /*  We validate the tested characters. */\n\t\t\tif (0 == remaining_len) {\n\t\t\t\t/*  Nothing left to test, we have found the given string. */\n\t\t\t\treturn SYNCTEX_STATUS_OK;\n\t\t\t}\n\t\t\tgoto more_characters;\n\t\t}\n\t\t/*  This is the last step. */\n\t\tif (strncmp((char *)SYNCTEX_CUR,the_string,remaining_len)) {\n\t\t\t/*  This is not the expected string, recover the previous state and return. */\n\t\t\tgoto return_NOT_OK;\n\t\t}\n\t\tgoto return_OK;\n\t} else {\n\t\t/*  The buffer can't contain the given string argument, and the EOF was reached */\n\t\treturn SYNCTEX_STATUS_EOF;\n\t}\n}\n\n/*  Used when parsing the synctex file.\n *  Decode an integer.\n *  First, field separators, namely ':' and ',' characters are skipped\n *  The returned value is negative if there is an unrecoverable error.\n *  It is SYNCTEX_STATUS_NOT_OK if an integer could not be parsed, for example\n *  if the characters at the current cursor position are not digits or\n *  if the end of the file has been reached.\n *  It is SYNCTEX_STATUS_OK if an int has been successfully parsed.\n *  The given scanner argument must not be NULL, on the contrary, value_ref may be NULL.\n */\nsynctex_status_t _synctex_decode_int(synctex_scanner_t scanner, int* value_ref) {\n\tchar * ptr = NULL;\n\tchar * end = NULL;\n\tint result = 0;\n\tsize_t available = 0;\n\tsynctex_status_t status = 0;\n\tif (NULL == scanner) {\n\t\t return SYNCTEX_STATUS_BAD_ARGUMENT;\n\t}\n\tavailable = SYNCTEX_BUFFER_MIN_SIZE;\n\tstatus = _synctex_buffer_get_available_size(scanner, &available);\n\tif (status<SYNCTEX_STATUS_EOF) {\n\t\treturn status;/*  Forward error. */\n\t}\n\tif (available==0) {\n\t\treturn SYNCTEX_STATUS_EOF;/*  it is the end of file. */\n\t}\n\tptr = SYNCTEX_CUR;\n\tif (*ptr==':' || *ptr==',') {\n\t\t++ptr;\n\t\t--available;\n\t\tif (available==0) {\n\t\t\treturn SYNCTEX_STATUS_NOT_OK;/*  It is not possible to scan an int */\n\t\t}\n\t}\n\tresult = (int)strtol(ptr, &end, 10);\n\tif (end>ptr) {\n\t\tSYNCTEX_CUR = end;\n\t\tif (value_ref) {\n\t\t\t* value_ref = result;\n\t\t}\n\t\treturn SYNCTEX_STATUS_OK;/*  Successfully scanned an int */\n\t}\t\n\treturn SYNCTEX_STATUS_NOT_OK;/*  Could not scan an int */\n}\n\n/*  The purpose of this function is to read a string.\n *  A string is an array of characters from the current parser location\n *  and before the next '\\n' character.\n *  If a string was properly decoded, it is returned in value_ref and\n *  the cursor points to the new line marker.\n *  The returned string was alloced on the heap, the caller is the owner and\n *  is responsible to free it in due time.\n *  If no string is parsed, * value_ref is undefined.\n *  The maximum length of a string that a scanner can decode is platform dependent, namely UINT_MAX.\n *  If you just want to blindly parse the file up to the end of the current line,\n *  use _synctex_next_line instead.\n *  On return, the scanner cursor is unchanged if a string could not be scanned or\n *  points to the terminating '\\n' character otherwise. As a consequence,\n *  _synctex_next_line is necessary after.\n *  If either scanner or value_ref is NULL, it is considered as an error and\n *  SYNCTEX_STATUS_BAD_ARGUMENT is returned.\n */\nsynctex_status_t _synctex_decode_string(synctex_scanner_t scanner, char ** value_ref) {\n\tchar * end = NULL;\n\tsize_t current_size = 0;\n\tsize_t new_size = 0;\n\tsize_t len = 0;/*  The number of bytes to copy */\n\tsize_t available = 0;\n\tsynctex_status_t status = 0;\n\tif (NULL == scanner || NULL == value_ref) {\n\t\treturn SYNCTEX_STATUS_BAD_ARGUMENT;\n\t}\n\t/*  The buffer must at least contain one character: the '\\n' end of line marker */\n\tif (SYNCTEX_CUR>=SYNCTEX_END) {\n\t\tavailable = 1;\n\t\tstatus = _synctex_buffer_get_available_size(scanner,&available);\n\t\tif (status < 0) {\n\t\t\treturn status;\n\t\t}\n\t\tif (0 == available) {\n\t\t\treturn SYNCTEX_STATUS_EOF;\n\t\t}\n\t}\n\t/*  Now we are sure that there is at least one available character, either because\n\t *  SYNCTEX_CUR was already < SYNCTEX_END, or because the buffer has been properly filled. */\n\t/*  end will point to the next unparsed '\\n' character in the file, when mapped to the buffer. */\n\tend = SYNCTEX_CUR;\n\t* value_ref = NULL;/*  Initialize, it will be realloc'ed */\n\t/*  We scan all the characters up to the next '\\n' */\nnext_character:\n\tif (end<SYNCTEX_END) {\n\t\tif (*end == '\\n') {\n\t\t\t/*  OK, we found where to stop */\n\t\t\tlen = end - SYNCTEX_CUR;\n\t\t\tif (current_size>UINT_MAX-len-1) {\n\t\t\t\t/*  But we have reached the limit: we do not have current_size+len+1>UINT_MAX.\n\t\t\t\t *  We return the missing amount of memory.\n\t\t\t\t *  This will never occur in practice. */\n\t\t\t\treturn UINT_MAX-len-1 - current_size;\n\t\t\t}\n\t\t\tnew_size = current_size+len;\n\t\t\t/*  We have current_size+len+1<=UINT_MAX\n\t\t\t *  or equivalently new_size<UINT_MAX,\n\t\t\t *  where we have assumed that len<UINT_MAX */\n\t\t\tif ((* value_ref = realloc(* value_ref,new_size+1)) != NULL) {\n\t\t\t\tif (memcpy((*value_ref)+current_size,SYNCTEX_CUR,len)) {\n\t\t\t\t\t/* SumatraPDF: fix reading files with DOS line endings*/\n\t\t\t\t\tif (new_size > 0 && (*value_ref)[new_size - 1] == '\\r')\n\t\t\t\t\t\tnew_size--;\n\t\t\t\t\t(* value_ref)[new_size]='\\0'; /*  Terminate the string */\n\t\t\t\t\tSYNCTEX_CUR += len;/*  Advance to the terminating '\\n' */\n\t\t\t\t\treturn SYNCTEX_STATUS_OK;\n\t\t\t\t}\n\t\t\t\tfree(* value_ref);\n\t\t\t\t* value_ref = NULL;\n\t\t\t\t_synctex_error(\"could not copy memory (1).\");\n\t\t\t\treturn SYNCTEX_STATUS_ERROR;\n\t\t\t}\n\t\t\t_synctex_error(\"could not allocate memory (1).\");\n\t\t\treturn SYNCTEX_STATUS_ERROR;\n\t\t} else {\n\t\t\t++end;\n\t\t\tgoto next_character;\n\t\t}\n\t} else {\n\t\t/*  end == SYNCTEX_END */\n\t\tlen = SYNCTEX_END - SYNCTEX_CUR;\n\t\tif (current_size>UINT_MAX-len-1) {\n\t\t\t/*  We have reached the limit. */\n\t\t\t_synctex_error(\"limit reached (missing %i).\",current_size-(UINT_MAX-len-1));\n\t\t\treturn SYNCTEX_STATUS_ERROR;\n\t\t}\n\t\tnew_size = current_size+len;\n\t\tif ((* value_ref = realloc(* value_ref,new_size+1)) != NULL) {\n\t\t\tif (memcpy((*value_ref)+current_size,SYNCTEX_CUR,len)) {\n\t\t\t\t(* value_ref)[new_size]='\\0'; /*  Terminate the string */\n\t\t\t\tSYNCTEX_CUR = SYNCTEX_END;/*  Advance the cursor to the end of the bufer */\n\t\t\t\treturn SYNCTEX_STATUS_OK;\n\t\t\t}\n\t\t\tfree(* value_ref);\n\t\t\t* value_ref = NULL;\n\t\t\t_synctex_error(\"could not copy memory (2).\");\n\t\t\treturn SYNCTEX_STATUS_ERROR;\n\t\t}\n\t\t/*  Huge memory problem */\n\t\t_synctex_error(\"could not allocate memory (2).\");\n\t\treturn SYNCTEX_STATUS_ERROR;\n\t}\n}\n\n/*  Used when parsing the synctex file.\n *  Read an Input record.\n */\nsynctex_status_t _synctex_scan_input(synctex_scanner_t scanner) {\n\tsynctex_status_t status = 0;\n\tsize_t available = 0;\n\tsynctex_node_t input = NULL;\n\tif (NULL == scanner) {\n\t\treturn SYNCTEX_STATUS_BAD_ARGUMENT;\n\t}\n\tstatus = _synctex_match_string(scanner,\"Input:\");\n\tif (status<SYNCTEX_STATUS_OK) {\n\t\treturn status;\n\t}\n\t/*  Create a node */\n\tinput = _synctex_new_input(scanner);\n\tif (NULL == input) {\n\t\t_synctex_error(\"could not create an input node.\");\n\t\treturn SYNCTEX_STATUS_ERROR;\n\t}\n\t/*  Decode the synctag  */\n\tstatus = _synctex_decode_int(scanner,&(SYNCTEX_TAG(input)));\n\tif (status<SYNCTEX_STATUS_OK) {\n\t\t_synctex_error(\"bad format of input node.\");\n\t\tSYNCTEX_FREE(input);\n\t\treturn status;\n\t}\n\t/*  The next character is a field separator, we expect one character in the buffer. */\n\tavailable = 1;\n\tstatus = _synctex_buffer_get_available_size(scanner, &available);\n\tif (status<=SYNCTEX_STATUS_ERROR) {\n\t\treturn status;\n\t}\n\tif (0 == available) {\n\t\treturn SYNCTEX_STATUS_EOF;\n\t}\n\t/*  We can now safely advance to the next character, stepping over the field separator. */\n\t++SYNCTEX_CUR;\n\t--available;\n\t/*  Then we scan the file name */\n\tstatus = _synctex_decode_string(scanner,&(SYNCTEX_NAME(input)));\n\tif (status<SYNCTEX_STATUS_OK) {\n\t\tSYNCTEX_FREE(input);\n\t\treturn status;\n\t}\n\t/*  Prepend this input node to the input linked list of the scanner */\n\tSYNCTEX_SET_SIBLING(input,scanner->input);\n\tscanner->input = input;\n\treturn _synctex_next_line(scanner);/*  read the line termination character, if any */\n\t/*  Now, set up the path */\n}\n\ntypedef synctex_status_t (*synctex_decoder_t)(synctex_scanner_t,void *);\n\nsynctex_status_t _synctex_scan_named(synctex_scanner_t scanner,const char * name,void * value_ref,synctex_decoder_t decoder);\n\n/*  Used when parsing the synctex file.\n *  Read one of the settings.\n *  On normal completion, returns SYNCTEX_STATUS_OK.\n *  On error, returns SYNCTEX_STATUS_ERROR.\n *  Both arguments must not be NULL.\n *  On return, the scanner points to the next character after the decoded object whatever it is.\n *  It is the responsibility of the caller to prepare the scanner for the next line.\n */\nsynctex_status_t _synctex_scan_named(synctex_scanner_t scanner,const char * name,void * value_ref,synctex_decoder_t decoder) {\n\tsynctex_status_t status = 0;\n\tif (NULL == scanner || NULL == name || NULL == value_ref || NULL == decoder) {\n\t\treturn SYNCTEX_STATUS_BAD_ARGUMENT;\n\t}\nnot_found:\n\tstatus = _synctex_match_string(scanner,name);\n\tif (status<SYNCTEX_STATUS_NOT_OK) {\n\t\treturn status;\n\t} else if (status == SYNCTEX_STATUS_NOT_OK) {\n\t\tstatus = _synctex_next_line(scanner);\n\t\tif (status<SYNCTEX_STATUS_OK) {\n\t\t\treturn status;\n\t\t}\n\t\tgoto not_found;\n\t}\n\t/*  A line is found, scan the value */\n\treturn (*decoder)(scanner,value_ref);\n}\n\n/*  Used when parsing the synctex file.\n *  Read the preamble.\n */\nsynctex_status_t _synctex_scan_preamble(synctex_scanner_t scanner) {\n\tsynctex_status_t status = 0;\n\tif (NULL == scanner) {\n\t\treturn SYNCTEX_STATUS_BAD_ARGUMENT;\n\t}\n\tstatus = _synctex_scan_named(scanner,\"SyncTeX Version:\",&(scanner->version),(synctex_decoder_t)&_synctex_decode_int);\n\tif (status<SYNCTEX_STATUS_OK) {\n\t\treturn status;\n\t}\n\tstatus = _synctex_next_line(scanner);\n\tif (status<SYNCTEX_STATUS_OK) {\n\t\treturn status;\n\t}\n\t/*  Read all the input records */\n\tdo {\n\t\tstatus = _synctex_scan_input(scanner);\n\t\tif (status<SYNCTEX_STATUS_NOT_OK) {\n\t\t\treturn status;\n\t\t}\n\t} while(status == SYNCTEX_STATUS_OK);\n\t/*  the loop exits when status == SYNCTEX_STATUS_NOT_OK */\n\t/*  Now read all the required settings. */\n\tstatus = _synctex_scan_named(scanner,\"Output:\",&(scanner->output_fmt),(synctex_decoder_t)&_synctex_decode_string);\n\tif (status<SYNCTEX_STATUS_NOT_OK) {\n\t\treturn status;\n\t}\n\tstatus = _synctex_next_line(scanner);\n\tif (status<SYNCTEX_STATUS_OK) {\n\t\treturn status;\n\t}\n\tstatus = _synctex_scan_named(scanner,\"Magnification:\",&(scanner->pre_magnification),(synctex_decoder_t)&_synctex_decode_int);\n\tif (status<SYNCTEX_STATUS_OK) {\n\t\treturn status;\n\t}\n\tstatus = _synctex_next_line(scanner);\n\tif (status<SYNCTEX_STATUS_OK) {\n\t\treturn status;\n\t}\n\tstatus = _synctex_scan_named(scanner,\"Unit:\",&(scanner->pre_unit),(synctex_decoder_t)&_synctex_decode_int);\n\tif (status<SYNCTEX_STATUS_OK) {\n\t\treturn status;\n\t}\n\tstatus = _synctex_next_line(scanner);\n\tif (status<SYNCTEX_STATUS_OK) {\n\t\treturn status;\n\t}\n\tstatus = _synctex_scan_named(scanner,\"X Offset:\",&(scanner->pre_x_offset),(synctex_decoder_t)&_synctex_decode_int);\n\tif (status<SYNCTEX_STATUS_OK) {\n\t\treturn status;\n\t}\n\tstatus = _synctex_next_line(scanner);\n\tif (status<SYNCTEX_STATUS_OK) {\n\t\treturn status;\n\t}\n\tstatus = _synctex_scan_named(scanner,\"Y Offset:\",&(scanner->pre_y_offset),(synctex_decoder_t)&_synctex_decode_int);\n\tif (status<SYNCTEX_STATUS_OK) {\n\t\treturn status;\n\t}\n\treturn _synctex_next_line(scanner);\n}\n\n/*  parse a float with a dimension */\nsynctex_status_t _synctex_scan_float_and_dimension(synctex_scanner_t scanner, float * value_ref) {\n\tsynctex_status_t status = 0;\n\tchar * endptr = NULL;\n\tfloat f = 0;\n#ifdef HAVE_SETLOCALE\n\tchar * loc = setlocale(LC_NUMERIC, NULL);\n#endif\n\tsize_t available = 0;\n\tif (NULL == scanner || NULL == value_ref) {\n\t\treturn SYNCTEX_STATUS_BAD_ARGUMENT;\n\t}\n\tavailable = SYNCTEX_BUFFER_MIN_SIZE;\n\tstatus = _synctex_buffer_get_available_size(scanner, &available);\n\tif (status<SYNCTEX_STATUS_EOF) {\n\t\t_synctex_error(\"problem with float.\");\n\t\treturn status;\n\t}\n#ifdef HAVE_SETLOCALE\n\tsetlocale(LC_NUMERIC, \"C\");\n#endif\n\tf = strtod(SYNCTEX_CUR,&endptr);\n#ifdef HAVE_SETLOCALE\n\tsetlocale(LC_NUMERIC, loc);\n#endif\n\tif (endptr == SYNCTEX_CUR) {\n\t\t_synctex_error(\"a float was expected.\");\n\t\treturn SYNCTEX_STATUS_ERROR;\n\t}\n\tSYNCTEX_CUR = endptr;\n\tif ((status = _synctex_match_string(scanner,\"in\")) >= SYNCTEX_STATUS_OK) {\n\t\tf *= 72.27f*65536;\n\t} else if (status<SYNCTEX_STATUS_EOF) {\nreport_unit_error:\n\t\t_synctex_error(\"problem with unit.\");\n\t\treturn status;\n\t} else if ((status = _synctex_match_string(scanner,\"cm\")) >= SYNCTEX_STATUS_OK) {\n\t\tf *= 72.27f*65536/2.54f;\n\t} else if (status<0) {\n\t\tgoto report_unit_error;\n\t} else if ((status = _synctex_match_string(scanner,\"mm\")) >= SYNCTEX_STATUS_OK) {\n\t\tf *= 72.27f*65536/25.4f;\n\t} else if (status<0) {\n\t\tgoto report_unit_error;\n\t} else if ((status = _synctex_match_string(scanner,\"pt\")) >= SYNCTEX_STATUS_OK) {\n\t\tf *= 65536.0f;\n\t} else if (status<0) {\n\t\tgoto report_unit_error;\n\t} else if ((status = _synctex_match_string(scanner,\"bp\")) >= SYNCTEX_STATUS_OK) {\n\t\tf *= 72.27f/72*65536.0f;\n\t}  else if (status<0) {\n\t\tgoto report_unit_error;\n\t} else if ((status = _synctex_match_string(scanner,\"pc\")) >= SYNCTEX_STATUS_OK) {\n\t\tf *= 12.0*65536.0f;\n\t}  else if (status<0) {\n\t\tgoto report_unit_error;\n\t} else if ((status = _synctex_match_string(scanner,\"sp\")) >= SYNCTEX_STATUS_OK) {\n\t\tf *= 1.0f;\n\t}  else if (status<0) {\n\t\tgoto report_unit_error;\n\t} else if ((status = _synctex_match_string(scanner,\"dd\")) >= SYNCTEX_STATUS_OK) {\n\t\tf *= 1238.0f/1157*65536.0f;\n\t}  else if (status<0) {\n\t\tgoto report_unit_error;\n\t} else if ((status = _synctex_match_string(scanner,\"cc\")) >= SYNCTEX_STATUS_OK) {\n\t\tf *= 14856.0f/1157*65536;\n\t} else if (status<0) {\n\t\tgoto report_unit_error;\n\t} else if ((status = _synctex_match_string(scanner,\"nd\")) >= SYNCTEX_STATUS_OK) {\n\t\tf *= 685.0f/642*65536;\n\t}  else if (status<0) {\n\t\tgoto report_unit_error;\n\t} else if ((status = _synctex_match_string(scanner,\"nc\")) >= SYNCTEX_STATUS_OK) {\n\t\tf *= 1370.0f/107*65536;\n\t} else if (status<0) {\n\t\tgoto report_unit_error;\n\t}\n\t*value_ref = f;\n\treturn SYNCTEX_STATUS_OK;\n}\n\n/*  parse the post scriptum\n *  SYNCTEX_STATUS_OK is returned on completion\n *  a negative error is returned otherwise */\nsynctex_status_t _synctex_scan_post_scriptum(synctex_scanner_t scanner) {\n\tsynctex_status_t status = 0;\n\tchar * endptr = NULL;\n#ifdef HAVE_SETLOCALE\n\tchar * loc = setlocale(LC_NUMERIC, NULL);\n#endif\n\tif (NULL == scanner) {\n\t\treturn SYNCTEX_STATUS_BAD_ARGUMENT;\n\t}\n\t/*  Scan the file until a post scriptum line is found */\npost_scriptum_not_found:\n\tstatus = _synctex_match_string(scanner,\"Post scriptum:\");\n\tif (status<SYNCTEX_STATUS_NOT_OK) {\n\t\treturn status;\n\t}\n\tif (status == SYNCTEX_STATUS_NOT_OK) {\n\t\tstatus = _synctex_next_line(scanner);\n\t\tif (status<SYNCTEX_STATUS_EOF) {\n\t\t\treturn status;\n\t\t} else if (status<SYNCTEX_STATUS_OK) {\n\t\t\treturn SYNCTEX_STATUS_OK;/*  The EOF is found, we have properly scanned the file */\n\t\t}\n\t\tgoto post_scriptum_not_found;\n\t}\n\t/*  We found the name, advance to the next line. */\nnext_line:\n\tstatus = _synctex_next_line(scanner);\n\tif (status<SYNCTEX_STATUS_EOF) {\n\t\treturn status;\n\t} else if (status<SYNCTEX_STATUS_OK) {\n\t\treturn SYNCTEX_STATUS_OK;/*  The EOF is found, we have properly scanned the file */\n\t}\n\t/*  Scanning the information */\n\tstatus = _synctex_match_string(scanner,\"Magnification:\");\n\tif (status == SYNCTEX_STATUS_OK ) {\n#ifdef HAVE_SETLOCALE\n\t\tsetlocale(LC_NUMERIC, \"C\");\n#endif\n\t\tscanner->unit = strtod(SYNCTEX_CUR,&endptr);\n#ifdef HAVE_SETLOCALE\n\t\tsetlocale(LC_NUMERIC, loc);\n#endif\n\t\tif (endptr == SYNCTEX_CUR) {\n\t\t\t_synctex_error(\"bad magnification in the post scriptum, a float was expected.\");\n\t\t\treturn SYNCTEX_STATUS_ERROR;\n\t\t}\n\t\tif (scanner->unit<=0) {\n\t\t\t_synctex_error(\"bad magnification in the post scriptum, a positive float was expected.\");\n\t\t\treturn SYNCTEX_STATUS_ERROR;\n\t\t}\n\t\tSYNCTEX_CUR = endptr;\n\t\tgoto next_line;\n\t}\n\tif (status<SYNCTEX_STATUS_EOF){\nreport_record_problem:\n\t\t_synctex_error(\"Problem reading the Post Scriptum records\");\n\t\treturn status; /*  echo the error. */\n\t}\n\tstatus = _synctex_match_string(scanner,\"X Offset:\");\n\tif (status == SYNCTEX_STATUS_OK) {\n\t\tstatus = _synctex_scan_float_and_dimension(scanner, &(scanner->x_offset));\n\t\tif (status<SYNCTEX_STATUS_OK) {\n\t\t\t_synctex_error(\"problem with X offset in the Post Scriptum.\");\n\t\t\treturn status;\n\t\t}\n\t\tgoto next_line;\n\t} else if (status<SYNCTEX_STATUS_EOF){\n\t\tgoto report_record_problem;\n\t}\n\tstatus = _synctex_match_string(scanner,\"Y Offset:\");\n\tif (status==SYNCTEX_STATUS_OK) {\n\t\tstatus = _synctex_scan_float_and_dimension(scanner, &(scanner->y_offset));\n\t\tif (status<SYNCTEX_STATUS_OK) {\n\t\t\t_synctex_error(\"problem with Y offset in the Post Scriptum.\");\n\t\t\treturn status;\n\t\t}\n\t\tgoto next_line;\n\t} else if (status<SYNCTEX_STATUS_EOF){\n\t\tgoto report_record_problem;\n\t}\n\tgoto next_line;\n}\n\n/*  SYNCTEX_STATUS_OK is returned if the postamble is read\n *  SYNCTEX_STATUS_NOT_OK is returned if the postamble is not at the current location\n *  a negative error otherwise\n *  The postamble comprises the post scriptum section.\n */\nint _synctex_scan_postamble(synctex_scanner_t scanner) {\n\tint status = 0;\n\tif (NULL == scanner) {\n\t\treturn SYNCTEX_STATUS_BAD_ARGUMENT;\n\t}\n\tstatus = _synctex_match_string(scanner,\"Postamble:\");\n\tif (status < SYNCTEX_STATUS_OK) {\n\t\treturn status;\n\t}\ncount_again:\n\tstatus = _synctex_next_line(scanner);\n\tif (status < SYNCTEX_STATUS_OK) {\n\t\treturn status;\n\t}\n\tstatus = _synctex_scan_named(scanner,\"Count:\",&(scanner->count),(synctex_decoder_t)&_synctex_decode_int);\n\tif (status < SYNCTEX_STATUS_EOF) {\n\t\treturn status; /*  forward the error */\n\t} else if (status < SYNCTEX_STATUS_OK) { /*  No Count record found */\n\t\tstatus = _synctex_next_line(scanner); /*  Advance one more line */\n\t\tif (status<SYNCTEX_STATUS_OK) {\n\t\t\treturn status;\n\t\t}\n\t\tgoto count_again;\n\t}\n\t/*  Now we scan the last part of the SyncTeX file: the Post Scriptum section. */\n\treturn _synctex_scan_post_scriptum(scanner);\n}\n\n/*  Horizontal boxes also have visible size.\n *  Visible size are bigger than real size.\n *  For example 0 width boxes may contain text.\n *  At creation time, the visible size is set to the values of the real size.\n */\nsynctex_status_t _synctex_setup_visible_box(synctex_node_t box) {\n\tif (box) {\n\t\tswitch(box->class->type) {\n\t\t\tcase synctex_node_type_hbox:\n\t\t\t\tif (SYNCTEX_INFO(box) != NULL) {\n\t\t\t\t\tSYNCTEX_HORIZ_V(box)  = SYNCTEX_HORIZ(box);\n\t\t\t\t\tSYNCTEX_VERT_V(box)   = SYNCTEX_VERT(box);\n\t\t\t\t\tSYNCTEX_WIDTH_V(box)  = SYNCTEX_WIDTH(box);\n\t\t\t\t\tSYNCTEX_HEIGHT_V(box) = SYNCTEX_HEIGHT(box);\n\t\t\t\t\tSYNCTEX_DEPTH_V(box)  = SYNCTEX_DEPTH(box);\n\t\t\t\t\treturn SYNCTEX_STATUS_OK;\n\t\t\t\t}\n\t\t\t\treturn SYNCTEX_STATUS_ERROR;\n\t\t}\n\t}\n\treturn SYNCTEX_STATUS_BAD_ARGUMENT;\n}\n\n/*  This method is sent to an horizontal box to setup the visible size\n *  Some box have 0 width but do contain text material.\n *  With this method, one can enlarge the box to contain the given point (h,v).\n */\nsynctex_status_t _synctex_horiz_box_setup_visible(synctex_node_t node,int h, int v) {\n#\tifdef __DARWIN_UNIX03\n#       pragma unused(v)\n#   endif\n\tint itsBtm, itsTop;\n\tif (NULL == node || node->class->type != synctex_node_type_hbox) {\n\t\treturn SYNCTEX_STATUS_BAD_ARGUMENT;\n\t}\n\tif (SYNCTEX_WIDTH_V(node)<0) {\n\t\titsBtm = SYNCTEX_HORIZ_V(node);\n\t\titsTop = SYNCTEX_HORIZ_V(node)-SYNCTEX_WIDTH_V(node);\n\t\tif (h<itsBtm) {\n\t\t\tSYNCTEX_HORIZ_V(node) = h;\n\t\t\tSYNCTEX_WIDTH_V(node) = SYNCTEX_HORIZ_V(node) - itsTop;\n\t\t} else if (h>itsTop) {\n\t\t\tSYNCTEX_WIDTH_V(node) = SYNCTEX_HORIZ_V(node) - h;\n\t\t}\n\t} else {\n\t\titsBtm = SYNCTEX_HORIZ_V(node);\n\t\titsTop = SYNCTEX_HORIZ_V(node)+SYNCTEX_WIDTH_V(node);\n\t\tif (h<itsBtm) {\n\t\t\tSYNCTEX_HORIZ_V(node) = h;\n\t\t\tSYNCTEX_WIDTH_V(node) = itsTop - SYNCTEX_HORIZ_V(node);\n\t\t} else if (h>itsTop) {\n\t\t\tSYNCTEX_WIDTH_V(node) = h - SYNCTEX_HORIZ_V(node);\n\t\t}\n\t}\n\treturn SYNCTEX_STATUS_OK;\n}\n\n/*  Here are the control characters that strat each line of the synctex output file.\n *  Their values define the meaning of the line.\n */\n#   define SYNCTEX_CHAR_BEGIN_SHEET '{'\n#   define SYNCTEX_CHAR_END_SHEET   '}'\n#   define SYNCTEX_CHAR_BEGIN_VBOX  '['\n#   define SYNCTEX_CHAR_END_VBOX    ']'\n#   define SYNCTEX_CHAR_BEGIN_HBOX  '('\n#   define SYNCTEX_CHAR_END_HBOX    ')'\n#   define SYNCTEX_CHAR_ANCHOR      '!'\n#   define SYNCTEX_CHAR_VOID_VBOX   'v'\n#   define SYNCTEX_CHAR_VOID_HBOX   'h'\n#   define SYNCTEX_CHAR_KERN        'k'\n#   define SYNCTEX_CHAR_GLUE        'g'\n#   define SYNCTEX_CHAR_MATH        '$'\n#   define SYNCTEX_CHAR_BOUNDARY    'x'\n\n#   define SYNCTEX_RETURN(STATUS) return STATUS;\n\n/*  Used when parsing the synctex file. A '{' character has just been parsed.\n *  The purpose is to gobble everything until the closing '}'.\n *  Actually only one nesting depth has been observed when using the clip option\n *  of \\includegraphics option. Here we use arbitrary level of depth.\n */\nsynctex_status_t _synctex_scan_nested_sheet(synctex_scanner_t scanner) {\n    unsigned int depth = 0;\ndeeper:\n    ++depth;\n    if (_synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n        _synctex_error(\"Unexpected end of nested sheet (1).\");\n        SYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n    }\nscan_next_line:\n    if (SYNCTEX_CUR<SYNCTEX_END) {\n\t\tif (*SYNCTEX_CUR == SYNCTEX_CHAR_END_SHEET) {\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (_synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t_synctex_error(\"Unexpected end of nested sheet (2).\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n            if (--depth>0) {\n                goto scan_next_line;\n            } else {\n            \tSYNCTEX_RETURN(SYNCTEX_STATUS_OK);\n            }\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_BEGIN_SHEET) {\n\t\t\t++SYNCTEX_CUR;\n\t\t\tgoto deeper;\n            \n\t\t} else if (_synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n            _synctex_error(\"Unexpected end of nested sheet (3).\");\n            SYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n        }\n    }\n    _synctex_error(\"Unexpected end of nested sheet (4).\");\n    SYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n}\n\n/*  Used when parsing the synctex file.\n *  The sheet argument is a newly created sheet node that will hold the contents.\n *  Something is returned in case of error.\n */\nsynctex_status_t _synctex_scan_sheet(synctex_scanner_t scanner, synctex_node_t sheet) {\n\tsynctex_node_t parent = sheet;\n\tsynctex_node_t child = NULL;\n\tsynctex_node_t sibling = NULL;\n\tsynctex_node_t box = sheet;\n\tint friend_index = 0;\n\tsynctex_info_t * info = NULL;\n\tsynctex_status_t status = 0;\n\tsize_t available = 0;\n\tif ((NULL == scanner) || (NULL == sheet)) {\n\t\treturn SYNCTEX_STATUS_BAD_ARGUMENT;\n\t}\n\t/*  We MUST start with a box, so at this level, the unique possibility is '[', '(' or \"}\". */\nprepare_loop:\n\tif (SYNCTEX_CUR<SYNCTEX_END) {\n\t\tif (*SYNCTEX_CUR == SYNCTEX_CHAR_BEGIN_VBOX) {\nscan_vbox:\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif ((child = _synctex_new_vbox(scanner)) && (info = SYNCTEX_INFO(child))) {\n#               define SYNCTEX_DECODE_FAILED(WHAT) \\\n\t\t\t\t\t(_synctex_decode_int(scanner,&(info[WHAT].INT))<SYNCTEX_STATUS_OK)\n\t\t\t\tif (SYNCTEX_DECODE_FAILED(SYNCTEX_TAG_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_LINE_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HORIZ_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_VERT_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_WIDTH_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HEIGHT_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_DEPTH_IDX)\n\t\t\t\t\t\t|| _synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t\t_synctex_error(\"Bad vbox record.\");\n\t\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t\t}\n\t\t\t\tSYNCTEX_SET_CHILD(parent,child);\n\t\t\t\tparent = child;\n\t\t\t\tchild = NULL;\n\t\t\t\tgoto child_loop;/*  next created node will be a child */\n\t\t\t} else {\n\t\t\t\t_synctex_error(\"Can't create vbox record.\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_BEGIN_HBOX) {\nscan_hbox:\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif ((child = _synctex_new_hbox(scanner)) && (info = SYNCTEX_INFO(child))) {\n\t\t\t\tif (SYNCTEX_DECODE_FAILED(SYNCTEX_TAG_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_LINE_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HORIZ_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_VERT_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_WIDTH_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HEIGHT_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_DEPTH_IDX)\n\t\t\t\t\t\t|| _synctex_setup_visible_box(child)<SYNCTEX_STATUS_OK\n\t\t\t\t\t\t|| _synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t\t_synctex_error(\"Bad hbox record.\");\n\t\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t\t}\n\t\t\t\t_synctex_horiz_box_setup_visible(parent,SYNCTEX_HORIZ(child),SYNCTEX_VERT(child));\n\t\t\t\t_synctex_horiz_box_setup_visible(parent,SYNCTEX_HORIZ(child)+SYNCTEX_ABS_WIDTH(child),SYNCTEX_VERT(child));\n\t\t\t\tSYNCTEX_SET_CHILD(parent,child);\n\t\t\t\tparent = child;\n\t\t\t\tchild = NULL;\n\t\t\t\tgoto child_loop;/*  next created node will be a child */\n\t\t\t} else {\n\t\t\t\t_synctex_error(\"Can't create hbox record.\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_END_SHEET) {\nscan_teehs:\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (NULL == parent || parent->class->type != synctex_node_type_sheet\n\t\t\t\t\t|| _synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t_synctex_error(\"Unexpected end of sheet.\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_OK);\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_BEGIN_SHEET) {\n\t\t\t/*  Addendum to version 1.10 to manage nested sheets  */\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (_synctex_scan_nested_sheet(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t_synctex_error(\"Unexpected nested sheet.\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t\tgoto prepare_loop;\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_ANCHOR) {\nscan_anchor:\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (_synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t_synctex_error(\"Missing anchor.\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t\tgoto prepare_loop;\n\t\t} else {\n\t\t\t/*  _synctex_error(\"Ignored record %c\\n\",*SYNCTEX_CUR); */\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (_synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t_synctex_error(\"Unexpected end.\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t\tgoto prepare_loop;\n\t\t}\n\t} else {\n\t\tavailable = 1;\n\t\tstatus = _synctex_buffer_get_available_size(scanner,&available);\n\t\t if (status<SYNCTEX_STATUS_OK && available>0){\n\t\t\t_synctex_error(\"Uncomplete sheet(0)\");\n\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t} else {\n\t\t\tgoto prepare_loop;\n\t\t}\n\t}\n\t_synctex_bail();\n/*  The child loop means that we go do one level, when we just created a box node,\n *  the next node created is a child of this box. */\nchild_loop:\n\tif (SYNCTEX_CUR<SYNCTEX_END) {\n\t\tif (*SYNCTEX_CUR == SYNCTEX_CHAR_BEGIN_VBOX) {\n\t\t\tgoto scan_vbox;\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_END_VBOX) {\nscan_xobv:\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (NULL != parent && parent->class->type == synctex_node_type_vbox) {\n\t\t\t\t#define SYNCTEX_UPDATE_BOX_FRIEND(NODE)\\\n\t\t\t\tfriend_index = ((SYNCTEX_INFO(NODE))[SYNCTEX_TAG_IDX].INT+(SYNCTEX_INFO(NODE))[SYNCTEX_LINE_IDX].INT)%(scanner->number_of_lists);\\\n\t\t\t\tSYNCTEX_SET_FRIEND(NODE,(scanner->lists_of_friends)[friend_index]);\\\n\t\t\t\t(scanner->lists_of_friends)[friend_index] = NODE;\n\t\t\t\tif (NULL == SYNCTEX_CHILD(parent)) {\n\t\t\t\t\t/*  only void boxes are friends */\n\t\t\t\t\tSYNCTEX_UPDATE_BOX_FRIEND(parent);\n\t\t\t\t}\n\t\t\t\tchild = parent;\n\t\t\t\tparent = SYNCTEX_PARENT(child);\n\t\t\t} else {\n\t\t\t\t_synctex_error(\"Unexpected end of vbox, ignored.\");\n\t\t\t}\n\t\t\tif (_synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t_synctex_error(\"Uncomplete sheet.\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t\tgoto sibling_loop;\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_BEGIN_HBOX) {\n\t\t\tgoto scan_hbox;\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_END_HBOX) {\nscan_xobh:\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif ((parent) && parent->class->type == synctex_node_type_hbox) {\n\t\t\t\tif (NULL == child) {\n\t\t\t\t\t/*  Only boxes with no children are friends,\n\t\t\t\t\t *  boxes with children are indirectly friends through one of their descendants. */\n\t\t\t\t\tSYNCTEX_UPDATE_BOX_FRIEND(parent);\n\t\t\t\t}\n\t\t\t\t/*  setting the next horizontal box at the end ensures that a child is recorded before any of its ancestors. */\n\t\t\t\tSYNCTEX_SET_NEXT_HORIZ_BOX(box,parent);\n\t\t\t\tbox = parent;\n\t\t\t\tchild = parent;\n\t\t\t\tparent = SYNCTEX_PARENT(child);\n\t\t\t} else {\n\t\t\t\t_synctex_error(\"Unexpected enf of hbox, ignored.\");\n\t\t\t}\n\t\t\tif (_synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t_synctex_error(\"Uncomplete sheet.\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t\tgoto sibling_loop;\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_VOID_VBOX) {\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (NULL != (child = _synctex_new_void_vbox(scanner))\n\t\t\t\t\t&& NULL != (info = SYNCTEX_INFO(child))) {\n\t\t\t\tif (SYNCTEX_DECODE_FAILED(SYNCTEX_TAG_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_LINE_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HORIZ_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_VERT_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_WIDTH_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HEIGHT_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_DEPTH_IDX)\n\t\t\t\t\t\t|| _synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t\t_synctex_error(\"Bad void vbox record.\");\n\t\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t\t}\n\t\t\t\tSYNCTEX_SET_CHILD(parent,child);\n\t\t\t\t#define SYNCTEX_UPDATE_FRIEND(NODE)\\\n\t\t\t\tfriend_index = (info[SYNCTEX_TAG_IDX].INT+info[SYNCTEX_LINE_IDX].INT)%(scanner->number_of_lists);\\\n\t\t\t\tSYNCTEX_SET_FRIEND(NODE,(scanner->lists_of_friends)[friend_index]);\\\n\t\t\t\t(scanner->lists_of_friends)[friend_index] = NODE;\n\t\t\t\tSYNCTEX_UPDATE_FRIEND(child);\n\t\t\t\tgoto sibling_loop;\n\t\t\t} else {\n\t\t\t\t_synctex_error(\"Can't create vbox record.\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_VOID_HBOX) {\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (NULL != (child = _synctex_new_void_hbox(scanner))\n\t\t\t\t\t&& NULL != (info = SYNCTEX_INFO(child))) {\n\t\t\t\tif (SYNCTEX_DECODE_FAILED(SYNCTEX_TAG_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_LINE_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HORIZ_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_VERT_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_WIDTH_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HEIGHT_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_DEPTH_IDX)\n\t\t\t\t\t\t|| _synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t\t_synctex_error(\"Bad void hbox record.\");\n\t\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t\t}\n\t\t\t\tSYNCTEX_SET_CHILD(parent,child);\n\t\t\t\tSYNCTEX_UPDATE_FRIEND(child);\n\t\t\t\t_synctex_horiz_box_setup_visible(parent,SYNCTEX_HORIZ(child),SYNCTEX_VERT(child));\n\t\t\t\t_synctex_horiz_box_setup_visible(parent,SYNCTEX_HORIZ(child)+SYNCTEX_ABS_WIDTH(child),SYNCTEX_VERT(child));\n\t\t\t\tgoto sibling_loop;\n\t\t\t} else {\n\t\t\t\t_synctex_error(\"Can't create void hbox record.\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_KERN) {\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (NULL != (child = _synctex_new_kern(scanner))\n\t\t\t\t\t&& NULL != (info = SYNCTEX_INFO(child))) {\n\t\t\t\tif (SYNCTEX_DECODE_FAILED(SYNCTEX_TAG_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_LINE_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HORIZ_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_VERT_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_WIDTH_IDX)\n\t\t\t\t\t\t|| _synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t\t_synctex_error(\"Bad kern record.\");\n\t\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t\t}\n\t\t\t\tSYNCTEX_SET_CHILD(parent,child);\n\t\t\t\tSYNCTEX_UPDATE_FRIEND(child);\n\t\t\t\t_synctex_horiz_box_setup_visible(parent,SYNCTEX_HORIZ(child),SYNCTEX_VERT(child));\n\t\t\t\t_synctex_horiz_box_setup_visible(parent,SYNCTEX_HORIZ(child)-SYNCTEX_WIDTH(child),SYNCTEX_VERT(child));\n\t\t\t\tgoto sibling_loop;\n\t\t\t} else {\n\t\t\t\t_synctex_error(\"Can't create kern record.\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_GLUE) {\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (NULL != (child = _synctex_new_glue(scanner))\n\t\t\t\t\t&& NULL != (info = SYNCTEX_INFO(child))) {\n\t\t\t\tif (SYNCTEX_DECODE_FAILED(SYNCTEX_TAG_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_LINE_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HORIZ_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_VERT_IDX)\n\t\t\t\t\t\t|| _synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t\t_synctex_error(\"Bad glue record.\");\n\t\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t\t}\n\t\t\t\tSYNCTEX_SET_CHILD(parent,child);\n\t\t\t\t_synctex_horiz_box_setup_visible(parent,SYNCTEX_HORIZ(child),SYNCTEX_VERT(child));\n\t\t\t\tSYNCTEX_UPDATE_FRIEND(child);\n\t\t\t\tgoto sibling_loop;\n\t\t\t} else {\n\t\t\t\t_synctex_error(\"Can't create glue record.\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_MATH) {\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (NULL != (child = _synctex_new_math(scanner))\n\t\t\t\t\t&& NULL != (info = SYNCTEX_INFO(child))) {\n\t\t\t\tif (SYNCTEX_DECODE_FAILED(SYNCTEX_TAG_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_LINE_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HORIZ_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_VERT_IDX)\n\t\t\t\t\t\t|| _synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t\t_synctex_error(\"Bad math record.\");\n\t\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t\t}\n\t\t\t\tSYNCTEX_SET_CHILD(parent,child);\n\t\t\t\t_synctex_horiz_box_setup_visible(parent,SYNCTEX_HORIZ(child),SYNCTEX_VERT(child));\n\t\t\t\tSYNCTEX_UPDATE_FRIEND(child);\n\t\t\t\tgoto sibling_loop;\n\t\t\t} else {\n\t\t\t\t_synctex_error(\"Can't create math record.\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_BOUNDARY) {\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (NULL != (child = _synctex_new_boundary(scanner))\n\t\t\t\t\t&& NULL != (info = SYNCTEX_INFO(child))) {\n\t\t\t\tif (SYNCTEX_DECODE_FAILED(SYNCTEX_TAG_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_LINE_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HORIZ_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_VERT_IDX)\n\t\t\t\t\t\t|| _synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t\t_synctex_error(\"Bad boundary record.\");\n\t\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t\t}\n\t\t\t\tSYNCTEX_SET_CHILD(parent,child);\n\t\t\t\t_synctex_horiz_box_setup_visible(parent,SYNCTEX_HORIZ(child),SYNCTEX_VERT(child));\n\t\t\t\tSYNCTEX_UPDATE_FRIEND(child);\n\t\t\t\tgoto sibling_loop;\n\t\t\t} else {\n\t\t\t\t_synctex_error(\"Can't create math record.\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_END_SHEET) {\n\t\t\tgoto scan_teehs;\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_BEGIN_SHEET) {\n\t\t\t/*  Addendum to version 1.10 to manage nested sheets  */\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (_synctex_scan_nested_sheet(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t_synctex_error(\"Unexpected nested sheet.\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t\tgoto child_loop;\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_ANCHOR) {\n\t\t\tgoto scan_anchor;\n\t\t} else {\n\t\t\t/*  _synctex_error(\"Ignored record %c\\n\",*SYNCTEX_CUR); */\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (_synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t_synctex_error(\"Unexpected end.\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t\tgoto child_loop;\n\t\t}\n\t} else {\n\t\tavailable = 1;\n\t\tstatus = _synctex_buffer_get_available_size(scanner,&available);\n\t\t if (status<SYNCTEX_STATUS_OK && available>0){\n\t\t\t_synctex_error(\"Uncomplete sheet(0)\");\n\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t} else {\n\t\t\tgoto child_loop;\n\t\t}\n\t}\n\t_synctex_bail();\n/*  The vertical loop means that we are on the same level, for example when we just ended a box.\n *  If a node is created now, it will be a sibling of the current node, sharing the same parent. */\nsibling_loop:\n\tif (SYNCTEX_CUR<SYNCTEX_END) {\n\t\tif (*SYNCTEX_CUR == SYNCTEX_CHAR_BEGIN_VBOX) {\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (NULL != (sibling = _synctex_new_vbox(scanner))\n\t\t\t\t\t&& NULL != (info = SYNCTEX_INFO(sibling))) {\n\t\t\t\tif (SYNCTEX_DECODE_FAILED(SYNCTEX_TAG_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_LINE_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HORIZ_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_VERT_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_WIDTH_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HEIGHT_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_DEPTH_IDX)\n\t\t\t\t\t\t|| _synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t\t_synctex_error(\"Bad vbox record (2).\");\n\t\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t\t}\n\t\t\t\tSYNCTEX_SET_SIBLING(child,sibling);\n\t\t\t\tparent = sibling;\n\t\t\t\tchild = NULL;\n\t\t\t\tgoto child_loop;\n\t\t\t} else {\n\t\t\t\t_synctex_error(\"Can't create vbox record (2).\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_END_VBOX) {\n\t\t\tgoto scan_xobv;\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_BEGIN_HBOX) {\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (NULL != (sibling = _synctex_new_hbox(scanner)) &&\n\t\t\t\t\tNULL != (info = SYNCTEX_INFO(sibling))) {\n\t\t\t\tif (SYNCTEX_DECODE_FAILED(SYNCTEX_TAG_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_LINE_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HORIZ_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_VERT_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_WIDTH_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HEIGHT_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_DEPTH_IDX)\n\t\t\t\t\t\t|| _synctex_setup_visible_box(sibling)<SYNCTEX_STATUS_OK\n\t\t\t\t\t\t|| _synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t\t_synctex_error(\"Bad hbox record (2).\");\n\t\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t\t}\n\t\t\t\tSYNCTEX_SET_SIBLING(child,sibling);\n\t\t\t\tchild = sibling;\n\t\t\t\t_synctex_horiz_box_setup_visible(parent,SYNCTEX_HORIZ(child),SYNCTEX_VERT(child));\n\t\t\t\t_synctex_horiz_box_setup_visible(parent,SYNCTEX_HORIZ(child)+SYNCTEX_ABS_WIDTH(child),SYNCTEX_VERT(child));\n\t\t\t\tparent = child;\n\t\t\t\tchild = NULL;\n\t\t\t\tgoto child_loop;\n\t\t\t} else {\n\t\t\t\t_synctex_error(\"Can't create hbox record (2).\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_END_HBOX) {\n\t\t\tgoto scan_xobh;\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_VOID_VBOX) {\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (NULL != (sibling = _synctex_new_void_vbox(scanner)) &&\n\t\t\t\t\tNULL != (info = SYNCTEX_INFO(sibling))) {\n\t\t\t\tif (SYNCTEX_DECODE_FAILED(SYNCTEX_TAG_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_LINE_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HORIZ_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_VERT_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_WIDTH_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HEIGHT_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_DEPTH_IDX)\n\t\t\t\t\t\t|| _synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t\t_synctex_error(\"Bad void vbox record (2).\");\n\t\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t\t}\n\t\t\t\tSYNCTEX_SET_SIBLING(child,sibling);\n\t\t\t\tchild = sibling;\n\t\t\t\tSYNCTEX_UPDATE_FRIEND(child);\n\t\t\t\tgoto sibling_loop;\n\t\t\t} else {\n\t\t\t\t_synctex_error(\"can't create void vbox record (2).\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_VOID_HBOX) {\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (NULL != (sibling = _synctex_new_void_hbox(scanner)) &&\n\t\t\t\t\tNULL != (info = SYNCTEX_INFO(sibling))) {\n\t\t\t\tif (SYNCTEX_DECODE_FAILED(SYNCTEX_TAG_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_LINE_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HORIZ_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_VERT_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_WIDTH_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HEIGHT_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_DEPTH_IDX)\n\t\t\t\t\t\t|| _synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t\t_synctex_error(\"Bad void hbox record (2).\");\n\t\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t\t}\n\t\t\t\tSYNCTEX_SET_SIBLING(child,sibling);\n\t\t\t\tchild = sibling;\n\t\t\t\tSYNCTEX_UPDATE_FRIEND(child);\n\t\t\t\t_synctex_horiz_box_setup_visible(parent,SYNCTEX_HORIZ(child),SYNCTEX_VERT(child));\n\t\t\t\t_synctex_horiz_box_setup_visible(parent,SYNCTEX_HORIZ(child)+SYNCTEX_ABS_WIDTH(child),SYNCTEX_VERT(child));\n\t\t\t\tgoto sibling_loop;\n\t\t\t} else {\n\t\t\t\t_synctex_error(\"can't create void hbox record (2).\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_KERN) {\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (NULL != (sibling = _synctex_new_kern(scanner))\n\t\t\t\t\t&& NULL != (info = SYNCTEX_INFO(sibling))) {\n\t\t\t\tif (SYNCTEX_DECODE_FAILED(SYNCTEX_TAG_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_LINE_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HORIZ_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_VERT_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_WIDTH_IDX)\n\t\t\t\t\t\t|| _synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t\t_synctex_error(\"Bad kern record (2).\");\n\t\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t\t}\n\t\t\t\tSYNCTEX_SET_SIBLING(child,sibling);\n\t\t\t\tchild = sibling;\n\t\t\t\tSYNCTEX_UPDATE_FRIEND(child);\n\t\t\t\t_synctex_horiz_box_setup_visible(parent,SYNCTEX_HORIZ(child),SYNCTEX_VERT(child));\n\t\t\t\t_synctex_horiz_box_setup_visible(parent,SYNCTEX_HORIZ(child)-SYNCTEX_WIDTH(child),SYNCTEX_VERT(child));\n\t\t\t\tgoto sibling_loop;\n\t\t\t} else {\n\t\t\t\t_synctex_error(\"Can't create kern record (2).\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_GLUE) {\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (NULL != (sibling = _synctex_new_glue(scanner))\n\t\t\t\t\t&& NULL != (info = SYNCTEX_INFO(sibling))) {\n\t\t\t\tif (SYNCTEX_DECODE_FAILED(SYNCTEX_TAG_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_LINE_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HORIZ_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_VERT_IDX)\n\t\t\t\t\t\t|| _synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t\t_synctex_error(\"Bad glue record (2).\");\n\t\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t\t}\n\t\t\t\tSYNCTEX_SET_SIBLING(child,sibling);\n\t\t\t\tchild = sibling;\n\t\t\t\tSYNCTEX_UPDATE_FRIEND(child);\n\t\t\t\t_synctex_horiz_box_setup_visible(parent,SYNCTEX_HORIZ(child),SYNCTEX_VERT(child));\n\t\t\t\tgoto sibling_loop;\n\t\t\t} else {\n\t\t\t\t_synctex_error(\"Can't create glue record (2).\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_MATH) {\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (NULL != (sibling = _synctex_new_math(scanner))\n\t\t\t\t\t&& NULL != (info = SYNCTEX_INFO(sibling))) {\n\t\t\t\tif (SYNCTEX_DECODE_FAILED(SYNCTEX_TAG_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_LINE_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HORIZ_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_VERT_IDX)\n\t\t\t\t\t\t|| _synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t\t_synctex_error(\"Bad math record (2).\");\n\t\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t\t}\n\t\t\t\tSYNCTEX_SET_SIBLING(child,sibling);\n\t\t\t\tchild = sibling;\n\t\t\t\tSYNCTEX_UPDATE_FRIEND(child);\n\t\t\t\t_synctex_horiz_box_setup_visible(parent,SYNCTEX_HORIZ(child),SYNCTEX_VERT(child));\n\t\t\t\tgoto sibling_loop;\n\t\t\t} else {\n\t\t\t\t_synctex_error(\"Can't create math record (2).\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_BOUNDARY) {\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (NULL != (sibling = _synctex_new_boundary(scanner))\n\t\t\t\t\t&& NULL != (info = SYNCTEX_INFO(sibling))) {\n\t\t\t\tif (SYNCTEX_DECODE_FAILED(SYNCTEX_TAG_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_LINE_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_HORIZ_IDX)\n\t\t\t\t\t\t|| SYNCTEX_DECODE_FAILED(SYNCTEX_VERT_IDX)\n\t\t\t\t\t\t|| _synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t\t_synctex_error(\"Bad boundary record (2).\");\n\t\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t\t}\n\t\t\t\tSYNCTEX_SET_SIBLING(child,sibling);\n\t\t\t\tchild = sibling;\n\t\t\t\tSYNCTEX_UPDATE_FRIEND(child);\n\t\t\t\t_synctex_horiz_box_setup_visible(parent,SYNCTEX_HORIZ(child),SYNCTEX_VERT(child));\n\t\t\t\tgoto sibling_loop;\n\t\t\t} else {\n\t\t\t\t_synctex_error(\"Can't create boundary record (2).\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_END_SHEET) {\n\t\t\tgoto scan_teehs;\n\t\t} else if (*SYNCTEX_CUR == SYNCTEX_CHAR_ANCHOR) {\n\t\t\t++SYNCTEX_CUR;\n\t\t\tif (_synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\t_synctex_error(\"Missing anchor (2).\");\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t\tgoto sibling_loop;\n\t\t} else {\n\t\t\t++SYNCTEX_CUR;\n\t\t\t/* _synctex_error(\"Ignored record %c(2)\\n\",*SYNCTEX_CUR); */\n\t\t\tif (_synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t\t}\n\t\t\tgoto sibling_loop;\n\t\t}\n\t} else {\n\t\tavailable = 1;\n\t\tstatus = _synctex_buffer_get_available_size(scanner,&available);\n\t\tif (status<SYNCTEX_STATUS_OK && available>0){\n\t\t\tgoto sibling_loop;\n\t\t} else {\n\t\t\t_synctex_error(\"Uncomplete sheet(2)\");\n\t\t\tSYNCTEX_RETURN(SYNCTEX_STATUS_ERROR);\n\t\t}\n\t}\n#   undef SYNCTEX_DECODE_FAILED\n}\n\n/*  Used when parsing the synctex file\n */\nsynctex_status_t _synctex_scan_content(synctex_scanner_t scanner) {\n\tsynctex_node_t sheet = NULL;\n\tsynctex_status_t status = 0;\n\tif (NULL == scanner) {\n\t\treturn SYNCTEX_STATUS_BAD_ARGUMENT;\n\t}\n\t/*  set up the lists of friends */\n\tif (NULL == scanner->lists_of_friends) {\n\t\tscanner->number_of_lists = 1024;\n\t\tscanner->lists_of_friends = (synctex_node_t *)_synctex_malloc(scanner->number_of_lists*sizeof(synctex_node_t));\n\t\tif (NULL == scanner->lists_of_friends) {\n\t\t\t_synctex_error(\"malloc:2\");\n\t\t\treturn SYNCTEX_STATUS_ERROR;\n\t\t}\n\t}\n\t/*  Find where this section starts */\ncontent_not_found:\n\tstatus = _synctex_match_string(scanner,\"Content:\");\n\tif (status<SYNCTEX_STATUS_EOF) {\n\t\treturn status;\n\t}\n\tif (_synctex_next_line(scanner)<SYNCTEX_STATUS_OK) {\n\t\t_synctex_error(\"Uncomplete Content.\");\n\t\treturn SYNCTEX_STATUS_ERROR;\n\t}\n\tif (status == SYNCTEX_STATUS_NOT_OK) {\n\t\tgoto content_not_found;\n\t}\nnext_sheet:\n\tif (*SYNCTEX_CUR != SYNCTEX_CHAR_BEGIN_SHEET) {\n\t\tstatus = _synctex_scan_postamble(scanner);\n\t\tif (status < SYNCTEX_STATUS_EOF) {\n\t\t\t_synctex_error(\"Bad content.\");\n\t\t\treturn status;\n\t\t}\n\t\tif (status<SYNCTEX_STATUS_OK) {\n\t\t\tstatus = _synctex_next_line(scanner);\n\t\t\tif (status < SYNCTEX_STATUS_OK) {\n\t\t\t\t_synctex_error(\"Bad content.\");\n\t\t\t\treturn status;\n\t\t\t}\n\t\t\tgoto next_sheet;\n\t\t}\n\t\treturn SYNCTEX_STATUS_OK;\n\t}\n\t++SYNCTEX_CUR;\n\t/*  Create a new sheet node */\n\tsheet = _synctex_new_sheet(scanner);\n\tstatus = _synctex_decode_int(scanner,&(SYNCTEX_PAGE(sheet)));\n\tif (status<SYNCTEX_STATUS_OK) {\n\t\t_synctex_error(\"Missing sheet number.\");\nbail:\n\t\tSYNCTEX_FREE(sheet);\n\t\treturn SYNCTEX_STATUS_ERROR;\n\t}\n\tstatus = _synctex_next_line(scanner);\n\tif (status<SYNCTEX_STATUS_OK) {\n\t\t_synctex_error(\"Uncomplete file.\");\n\t\tgoto bail;\n\t}\n\tstatus = _synctex_scan_sheet(scanner,sheet);\n\tif (status<SYNCTEX_STATUS_OK) {\n\t\t_synctex_error(\"Bad sheet content.\");\n\t\tgoto bail;\n\t}\n\tSYNCTEX_SET_SIBLING(sheet,scanner->sheet);\n\tscanner->sheet = sheet;\n\tsheet = NULL;\n\t/*  Now read the list of Inputs between 2 sheets. */\n\tdo {\n\t\tstatus = _synctex_scan_input(scanner);\n\t\tif (status<SYNCTEX_STATUS_EOF) {\n\t\t\t_synctex_error(\"Bad input section.\");\n\t\t\tgoto bail;\n\t\t}\n\t}\n\twhile(status >= SYNCTEX_STATUS_OK);\n\tgoto next_sheet;\n}\n\nint _synctex_open(const char * output, const char * build_directory, char ** synctex_name_ref, gzFile * file_ref, synctex_bool_t add_quotes, synctex_io_mode_t * io_modeRef);\n\n/*  Where the synctex scanner is created. */\nsynctex_scanner_t synctex_scanner_new_with_output_file(const char * output, const char * build_directory, int parse) {\n\tgzFile file = NULL;\n\tchar * synctex = NULL;\n\tsynctex_scanner_t scanner = NULL;\n\tsynctex_io_mode_t io_mode = 0;\n\t/*  Here we assume that int are smaller than void * */\n\tif (sizeof(int)>sizeof(void*)) {\n\t\t_synctex_error(\"INTERNAL INCONSISTENCY: int's are unexpectedly bigger than pointers, bailing out.\");\n\t\treturn NULL;\n\t}\n\t/*  We ensure that SYNCTEX_BUFFER_SIZE < UINT_MAX, I don't know if it makes sense... */\n\tif (SYNCTEX_BUFFER_SIZE >= UINT_MAX) {\n\t\t_synctex_error(\"SyncTeX BUG: Internal inconsistency, bad SYNCTEX_BUFFER_SIZE (1)\");\n\t\treturn NULL;\n\t}\n\t/*  for integers: */\n\tif (SYNCTEX_BUFFER_SIZE < SYNCTEX_BUFFER_MIN_SIZE) {\n\t\t_synctex_error(\"SyncTeX BUG: Internal inconsistency, bad SYNCTEX_BUFFER_SIZE (2)\");\n\t\treturn NULL;\n\t}\n\t/*  now open the synctex file */\n\tif (_synctex_open(output,build_directory,&synctex,&file,synctex_ADD_QUOTES,&io_mode) || !file) {\n\t\tif (_synctex_open(output,build_directory,&synctex,&file,synctex_DONT_ADD_QUOTES,&io_mode) || !file) {\n\t\t\treturn NULL;\n\t\t}\n\t}\n\tscanner = (synctex_scanner_t)_synctex_malloc(sizeof(_synctex_scanner_t));\n\tif (NULL == scanner) {\n\t\t_synctex_error(\"SyncTeX: malloc problem\");\n\t\tfree(synctex);\n\t\tgzclose(file);\n\t\treturn NULL;\n\t}\n\t/*  make a private copy of output for the scanner */\n\tif (NULL == (scanner->output = (char *)malloc(strlen(output)+1))){\n\t\t_synctex_error(\"!  synctex_scanner_new_with_output_file: Memory problem (2), scanner's output is not reliable.\");\n\t} else if (scanner->output != strcpy(scanner->output,output)) {\n\t\t_synctex_error(\"!  synctex_scanner_new_with_output_file: Copy problem, scanner's output is not reliable.\");\n\t}\n\tscanner->synctex = synctex;/*  Now the scanner owns synctex */\n\tSYNCTEX_FILE = file;\n\treturn parse? synctex_scanner_parse(scanner):scanner;\n}\n\nint __synctex_open(const char * output, char ** synctex_name_ref, gzFile * file_ref, synctex_bool_t add_quotes, synctex_io_mode_t * io_mode_ref);\n\n/*\tThis functions opens the file at the \"output\" given location.\n *  It manages the problem of quoted filenames that appear with pdftex and filenames containing the space character.\n *  In TeXLive 2008, the synctex file created with pdftex did contain unexpected quotes.\n *\tThis function will remove them if possible.\n *  All the reference arguments will take a value on return. They must be non NULL.\n *\t0 on success, non 0 on error. */\nint __synctex_open(const char * output, char ** synctex_name_ref, gzFile * file_ref, synctex_bool_t add_quotes, synctex_io_mode_t * io_mode_ref) {\n\tif (synctex_name_ref && file_ref && io_mode_ref) {\n        /*  1 local variables that uses dynamic memory */\n        char * synctex_name = NULL;\n        gzFile the_file = NULL;\n        char * quoteless_synctex_name = NULL;\n\t\tsize_t size = 0;\n        synctex_io_mode_t io_mode = *io_mode_ref;\n\t\tconst char * mode = _synctex_get_io_mode_name(io_mode);\n\t\t/*  now create the synctex file name */\n\t\tsize = strlen(output)+strlen(synctex_suffix)+strlen(synctex_suffix_gz)+1;\n\t\tsynctex_name = (char *)malloc(size);\n\t\tif (NULL == synctex_name) {\n\t\t\t_synctex_error(\"!  __synctex_open: Memory problem (1)\\n\");\n\t\t\treturn 1;\n\t\t}\n\t\t/*  we have reserved for synctex enough memory to copy output (including its 2 eventual quotes), both suffices,\n\t\t *  including the terminating character. size is free now. */\n\t\tif (synctex_name != strcpy(synctex_name,output)) {\n\t\t\t_synctex_error(\"!  __synctex_open: Copy problem\\n\");\nreturn_on_error:\n\t\t\tfree(synctex_name);\n\t\t\tfree(quoteless_synctex_name);\n\t\t\treturn 2;\n\t\t}\n\t\t/*  remove the last path extension if any */\n\t\t_synctex_strip_last_path_extension(synctex_name);\n\t\tif (!strlen(synctex_name)) {\n\t\t\tgoto return_on_error;\t\t\n\t\t}\n\t\t/*  now insert quotes. */\n\t\tif (add_quotes) {\n\t\t\tchar * quoted = NULL;\n\t\t\tif (_synctex_copy_with_quoting_last_path_component(synctex_name,&quoted,size) || (NULL == quoted)) {\n\t\t\t\t/*\tThere was an error or quoting does not make sense: */\n\t\t\t\tgoto return_on_error;\n\t\t\t}\n\t\t\tquoteless_synctex_name = synctex_name;\n\t\t\tsynctex_name = quoted;\n\t\t}\n\t\t/*\tNow add to synctex_name the first path extension. */\n\t\tif (synctex_name != strcat(synctex_name,synctex_suffix)){\n\t\t\t_synctex_error(\"!  __synctex_open: Concatenation problem (can't add suffix '%s')\\n\",synctex_suffix);\n\t\t\tgoto return_on_error;\n\t\t}\n\t\t/*\tAdd to quoteless_synctex_name as well, if relevant. */\n\t\tif (quoteless_synctex_name && (quoteless_synctex_name != strcat(quoteless_synctex_name,synctex_suffix))){\n\t\t\tfree(quoteless_synctex_name);\n\t\t\tquoteless_synctex_name = NULL;\n\t\t}\n\t\tif (NULL == (the_file = gzopen(synctex_name,mode))) {\n\t\t\t/*  Could not open this file */\n\t\t\tif (errno != ENOENT) {\n\t\t\t\t/*  The file does exist, this is a lower level error, I can't do anything. */\n\t\t\t\t_synctex_error(\"SyncTeX: could not open %s, error %i\\n\",synctex_name,errno);\n\t\t\t\tgoto return_on_error;\n\t\t\t}\n\t\t\t/*  Apparently, there is no uncompressed synctex file. Try the compressed version */\n\t\t\tif (synctex_name != strcat(synctex_name,synctex_suffix_gz)){\n\t\t\t\t_synctex_error(\"!  __synctex_open: Concatenation problem (can't add suffix '%s')\\n\",synctex_suffix_gz);\n\t\t\t\tgoto return_on_error;\n\t\t\t}\n\t\t\tio_mode |= synctex_io_gz_mask;\n\t\t\tmode = _synctex_get_io_mode_name(io_mode); /* the file is a compressed and is a binary file, this caused errors on Windows */\n\t\t\t/*\tAdd the suffix to the quoteless_synctex_name as well. */\n\t\t\tif (quoteless_synctex_name && (quoteless_synctex_name != strcat(quoteless_synctex_name,synctex_suffix_gz))){\n\t\t\t\tfree(quoteless_synctex_name);\n\t\t\t\tquoteless_synctex_name = NULL;\n\t\t\t}\n\t\t\tif (NULL == (the_file = gzopen(synctex_name,mode))) {\n\t\t\t\t/*  Could not open this file */\n\t\t\t\tif (errno != ENOENT) {\n\t\t\t\t\t/*  The file does exist, this is a lower level error, I can't do anything. */\n\t\t\t\t\t_synctex_error(\"SyncTeX: could not open %s, error %i\\n\",synctex_name,errno);\n\t\t\t\t}\n\t\t\t\tgoto return_on_error;\n\t\t\t}\n\t\t}\n\t\t/*\tAt this point, the file is properly open.\n\t\t *  If we are in the add_quotes mode, we change the file name by removing the quotes. */\n\t\tif (quoteless_synctex_name) {\n\t\t\tgzclose(the_file);\n\t\t\tif (rename(synctex_name,quoteless_synctex_name)) {\n\t\t\t\t_synctex_error(\"SyncTeX: could not rename %s to %s, error %i\\n\",synctex_name,quoteless_synctex_name,errno);\n\t\t\t\t/*\tWe could not rename, reopen the file with the quoted name. */\n\t\t\t\tif (NULL == (the_file = gzopen(synctex_name,mode))) {\n\t\t\t\t\t/*  No luck, could not re open this file, something has happened meanwhile */\n\t\t\t\t\tif (errno != ENOENT) {\n\t\t\t\t\t\t/*  The file does not exist any more, it has certainly be removed somehow\n                         *  this is a lower level error, I can't do anything. */\n\t\t\t\t\t\t_synctex_error(\"SyncTeX: could not open again %s, error %i\\n\",synctex_name,errno);\n\t\t\t\t\t}\n\t\t\t\t\tgoto return_on_error;\n\t\t\t\t}\n\t\t\t} else {\n                /*  The file has been successfully renamed */\n\t\t\t\tif (NULL == (the_file = gzopen(quoteless_synctex_name,mode))) {\n\t\t\t\t\t/*  Could not open this file */\n\t\t\t\t\tif (errno != ENOENT) {\n\t\t\t\t\t\t/*  The file does exist, this is a lower level error, I can't do anything. */\n\t\t\t\t\t\t_synctex_error(\"SyncTeX: could not open renamed %s, error %i\\n\",quoteless_synctex_name,errno);\n\t\t\t\t\t}\n\t\t\t\t\tgoto return_on_error;\n\t\t\t\t}\n\t\t\t\t/*  The quote free file name should replace the old one:*/\n\t\t\t\tfree(synctex_name);\n\t\t\t\tsynctex_name = quoteless_synctex_name;\n\t\t\t\tquoteless_synctex_name = NULL;\n\t\t\t}\n\t\t}\n        /*  The operation is successfull, return the arguments by value.    */\n        * file_ref = the_file;\n        * io_mode_ref = io_mode;\n        * synctex_name_ref = synctex_name;\n\t\treturn 0;\n\t}\n\treturn 3;\t/*\tBad parameter.\t*/\n}\n\n/*\tOpens the ouput file, taking into account the eventual build_directory.\n *\t0 on success, non 0 on error. */\nint _synctex_open(const char * output, const char * build_directory, char ** synctex_name_ref, gzFile * file_ref, synctex_bool_t add_quotes, synctex_io_mode_t * io_mode_ref) {\n#\tdefine synctex_name (*synctex_name_ref)\n#\tdefine the_file (*file_ref)\n\tint result = __synctex_open(output,synctex_name_ref,file_ref,add_quotes,io_mode_ref);\n\tif ((result || !*file_ref) && build_directory && strlen(build_directory)) {\n\t\tchar * build_output;\n\t\tconst char *lpc;\n\t\tsize_t size;\n\t\tsynctex_bool_t is_absolute;\n\t\tbuild_output = NULL;\n\t\tlpc = _synctex_last_path_component(output);\n\t\tsize = strlen(build_directory)+strlen(lpc)+2;   /*  One for the '/' and one for the '\\0'.   */\n\t\tis_absolute = _synctex_path_is_absolute(build_directory);\n\t\tif (!is_absolute) {\n\t\t\tsize += strlen(output);\n\t\t}\n\t\tif ((build_output = (char *)malloc(size))) {\n\t\t\tif (is_absolute) {\n\t\t\t\tbuild_output[0] = '\\0';\n\t\t\t} else {\n\t\t\t\tif (build_output != strcpy(build_output,output)) {\n\t\t\t\t\treturn -4;\n\t\t\t\t}\n\t\t\t\tbuild_output[lpc-output]='\\0';\n\t\t\t}\n\t\t\tif (build_output == strcat(build_output,build_directory)) {\n\t\t\t\t/*\tAppend a path separator if necessary. */\n\t\t\t\tif (!SYNCTEX_IS_PATH_SEPARATOR(build_output[strlen(build_directory)-1])) {\n\t\t\t\t\tif (build_output != strcat(build_output,\"/\")) {\n\t\t\t\t\t\treturn -2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/*\tAppend the last path component of the output. */\n\t\t\t\tif (build_output != strcat(build_output,lpc)) {\n\t\t\t\t\treturn -3;\n\t\t\t\t}\n\t\t\t\treturn __synctex_open(build_output,synctex_name_ref,file_ref,add_quotes,io_mode_ref);\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\treturn result;\n#\tundef synctex_name\n#\tundef the_file\n}\n\n/*  The scanner destructor\n */\nvoid synctex_scanner_free(synctex_scanner_t scanner) {\n\tif (NULL == scanner) {\n\t\treturn;\n\t}\n\tif (SYNCTEX_FILE) {\n\t\tgzclose(SYNCTEX_FILE);\n\t\tSYNCTEX_FILE = NULL;\n\t}\n\tSYNCTEX_FREE(scanner->sheet);\n\tSYNCTEX_FREE(scanner->input);\n\tfree(SYNCTEX_START);\n\tfree(scanner->output_fmt);\n\tfree(scanner->output);\n\tfree(scanner->synctex);\n\tfree(scanner->lists_of_friends);\n\tfree(scanner);\n}\n\n/*  Where the synctex scanner parses the contents of the file. */\nsynctex_scanner_t synctex_scanner_parse(synctex_scanner_t scanner) {\n\tsynctex_status_t status = 0;\n\tif (!scanner || scanner->flags.has_parsed) {\n\t\treturn scanner;\n\t}\n\tscanner->flags.has_parsed=1;\n\tscanner->pre_magnification = 1000;\n\tscanner->pre_unit = 8192;\n\tscanner->pre_x_offset = scanner->pre_y_offset = 578;\n\t/*  initialize the offset with a fake unprobable value,\n\t *  If there is a post scriptum section, this value will be overriden by the real life value */\n\tscanner->x_offset = scanner->y_offset = 6.027e23f;\n\tscanner->class[synctex_node_type_sheet] = synctex_class_sheet;\n\tscanner->class[synctex_node_type_input] = synctex_class_input;\n\t(scanner->class[synctex_node_type_input]).scanner = scanner;\n\t(scanner->class[synctex_node_type_sheet]).scanner = scanner;\n\tscanner->class[synctex_node_type_vbox] = synctex_class_vbox;\n\t(scanner->class[synctex_node_type_vbox]).scanner = scanner;\n\tscanner->class[synctex_node_type_void_vbox] = synctex_class_void_vbox;\n\t(scanner->class[synctex_node_type_void_vbox]).scanner = scanner;\n\tscanner->class[synctex_node_type_hbox] = synctex_class_hbox;\n\t(scanner->class[synctex_node_type_hbox]).scanner = scanner;\n\tscanner->class[synctex_node_type_void_hbox] = synctex_class_void_hbox;\n\t(scanner->class[synctex_node_type_void_hbox]).scanner = scanner;\n\tscanner->class[synctex_node_type_kern] = synctex_class_kern;\n\t(scanner->class[synctex_node_type_kern]).scanner = scanner;\n\tscanner->class[synctex_node_type_glue] = synctex_class_glue;\n\t(scanner->class[synctex_node_type_glue]).scanner = scanner;\n\tscanner->class[synctex_node_type_math] = synctex_class_math;\n\t(scanner->class[synctex_node_type_math]).scanner = scanner;\n\tscanner->class[synctex_node_type_boundary] = synctex_class_boundary;\n\t(scanner->class[synctex_node_type_boundary]).scanner = scanner;\n\tSYNCTEX_START = (char *)malloc(SYNCTEX_BUFFER_SIZE+1); /*  one more character for null termination */\n\tif (NULL == SYNCTEX_START) {\n\t\t_synctex_error(\"SyncTeX: malloc error\");\n\t\tsynctex_scanner_free(scanner);\n\t\treturn NULL;\n\t}\n\tSYNCTEX_END = SYNCTEX_START+SYNCTEX_BUFFER_SIZE;\n\t/*  SYNCTEX_END always points to a null terminating character.\n\t *  Maybe there is another null terminating character between SYNCTEX_CUR and SYNCTEX_END-1.\n\t *  At least, we are sure that SYNCTEX_CUR points to a string covering a valid part of the memory. */\n\t*SYNCTEX_END = '\\0';\n\tSYNCTEX_CUR = SYNCTEX_END;\n\tstatus = _synctex_scan_preamble(scanner);\n\tif (status<SYNCTEX_STATUS_OK) {\n\t\t_synctex_error(\"SyncTeX Error: Bad preamble\\n\");\nbailey:\n\t\tsynctex_scanner_free(scanner);\n\t\treturn NULL;\n\t}\n\tstatus = _synctex_scan_content(scanner);\n\tif (status<SYNCTEX_STATUS_OK) {\n\t\t_synctex_error(\"SyncTeX Error: Bad content\\n\");\n\t\tgoto bailey;\n\t}\n\t/*  Everything is finished, free the buffer, close the file */\n\tfree((void *)SYNCTEX_START);\n\tSYNCTEX_START = SYNCTEX_CUR = SYNCTEX_END = NULL;\n\tgzclose(SYNCTEX_FILE);\n\tSYNCTEX_FILE = NULL;\n\t/*  Final tuning: set the default values for various parameters */\n\t/*  1 pre_unit = (scanner->pre_unit)/65536 pt = (scanner->pre_unit)/65781.76 bp\n\t * 1 pt = 65536 sp */\n\tif (scanner->pre_unit<=0) {\n\t\tscanner->pre_unit = 8192;\n\t}\n\tif (scanner->pre_magnification<=0) {\n\t\tscanner->pre_magnification = 1000;\n\t}\n\tif (scanner->unit <= 0) {\n\t\t/*  no post magnification */\n\t\tscanner->unit = scanner->pre_unit / 65781.76;/*  65781.76 or 65536.0*/\n\t} else {\n\t\t/*  post magnification */\n\t\tscanner->unit *= scanner->pre_unit / 65781.76;\n\t}\n\tscanner->unit *= scanner->pre_magnification / 1000.0;\n\tif (scanner->x_offset > 6e23) {\n\t\t/*  no post offset */\n\t\tscanner->x_offset = scanner->pre_x_offset * (scanner->pre_unit / 65781.76);\n\t\tscanner->y_offset = scanner->pre_y_offset * (scanner->pre_unit / 65781.76);\n\t} else {\n\t\t/*  post offset */\n\t\tscanner->x_offset /= 65781.76f;\n\t\tscanner->y_offset /= 65781.76f;\n\t}\n\treturn scanner;\n\t#undef SYNCTEX_FILE\n}\n\n/*  Scanner accessors.\n */\nint synctex_scanner_pre_x_offset(synctex_scanner_t scanner){\n\treturn scanner?scanner->pre_x_offset:0;\n}\nint synctex_scanner_pre_y_offset(synctex_scanner_t scanner){\n\treturn scanner?scanner->pre_y_offset:0;\n}\nint synctex_scanner_x_offset(synctex_scanner_t scanner){\n\treturn scanner?scanner->x_offset:0;\n}\nint synctex_scanner_y_offset(synctex_scanner_t scanner){\n\treturn scanner?scanner->y_offset:0;\n}\nfloat synctex_scanner_magnification(synctex_scanner_t scanner){\n\treturn scanner?scanner->unit:1;\n}\nvoid synctex_scanner_display(synctex_scanner_t scanner) {\n\tif (NULL == scanner) {\n\t\treturn;\n\t}\n\tprintf(\"The scanner:\\noutput:%s\\noutput_fmt:%s\\nversion:%i\\n\",scanner->output,scanner->output_fmt,scanner->version);\n\tprintf(\"pre_unit:%i\\nx_offset:%i\\ny_offset:%i\\n\",scanner->pre_unit,scanner->pre_x_offset,scanner->pre_y_offset);\n\tprintf(\"count:%i\\npost_magnification:%f\\npost_x_offset:%f\\npost_y_offset:%f\\n\",\n\t\tscanner->count,scanner->unit,scanner->x_offset,scanner->y_offset);\n\tprintf(\"The input:\\n\");\n\tSYNCTEX_DISPLAY(scanner->input);\n\tif (scanner->count<1000) {\n\t\tprintf(\"The sheets:\\n\");\n\t\tSYNCTEX_DISPLAY(scanner->sheet);\n\t\tprintf(\"The friends:\\n\");\n\t\tif (scanner->lists_of_friends) {\n\t\t\tint i = scanner->number_of_lists;\n\t\t\tsynctex_node_t node;\n\t\t\twhile(i--) {\n\t\t\t\tprintf(\"Friend index:%i\\n\",i);\n\t\t\t\tnode = (scanner->lists_of_friends)[i];\n\t\t\t\twhile(node) {\n\t\t\t\t\tprintf(\"%s:%i,%i\\n\",\n\t\t\t\t\t\tsynctex_node_isa(node),\n\t\t\t\t\t\tSYNCTEX_TAG(node),\n\t\t\t\t\t\tSYNCTEX_LINE(node)\n\t\t\t\t\t);\n\t\t\t\t\tnode = SYNCTEX_FRIEND(node);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tprintf(\"SyncTeX Warning: Too many objects\\n\");\n\t}\n}\n/*  Public*/\nconst char * synctex_scanner_get_name(synctex_scanner_t scanner,int tag) {\n\tsynctex_node_t input = NULL;\n\tif (NULL == scanner) {\n\t\treturn NULL;\n\t}\n\tinput = scanner->input;\n\tdo {\n\t\tif (tag == SYNCTEX_TAG(input)) {\n\t\t\treturn (SYNCTEX_NAME(input));\n\t\t}\n\t} while((input = SYNCTEX_SIBLING(input)) != NULL);\n\treturn NULL;\n}\n\nint _synctex_scanner_get_tag(synctex_scanner_t scanner,const char * name);\nint _synctex_scanner_get_tag(synctex_scanner_t scanner,const char * name) {\n\tsynctex_node_t input = NULL;\n\tif (NULL == scanner) {\n\t\treturn 0;\n\t}\n\tinput = scanner->input;\n\tdo {\n\t\tif (_synctex_is_equivalent_file_name(name,(SYNCTEX_NAME(input)))) {\n\t\t\treturn SYNCTEX_TAG(input);\n\t\t}\n\t} while((input = SYNCTEX_SIBLING(input)) != NULL);\n\treturn 0;\n}\n\nint synctex_scanner_get_tag(synctex_scanner_t scanner,const char * name) {\n\tsize_t char_index = strlen(name);\n\tif ((scanner = synctex_scanner_parse(scanner)) && (0 < char_index)) {\n\t\t/*  the name is not void */\n\t\tchar_index -= 1;\n\t\tif (!SYNCTEX_IS_PATH_SEPARATOR(name[char_index])) {\n\t\t\t/*  the last character of name is not a path separator */\n\t\t\tint result = _synctex_scanner_get_tag(scanner,name);\n\t\t\tif (result) {\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\t/*  the given name was not the one known by TeX\n\t\t\t\t *  try a name relative to the enclosing directory of the scanner->output file */\n\t\t\t\tconst char * relative = name;\n\t\t\t\tconst char * ptr = scanner->output;\n\t\t\t\twhile((strlen(relative) > 0) && (strlen(ptr) > 0) && (*relative == *ptr))\n\t\t\t\t{\n\t\t\t\t\trelative += 1;\n\t\t\t\t\tptr += 1;\n\t\t\t\t}\n\t\t\t\t/*  Find the last path separator before relative */\n\t\t\t\twhile(relative > name) {\n\t\t\t\t\tif (SYNCTEX_IS_PATH_SEPARATOR(*(relative-1))) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\trelative -= 1;\n\t\t\t\t}\n\t\t\t\tif ((relative > name) && (result = _synctex_scanner_get_tag(scanner,relative))) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t\tif (SYNCTEX_IS_PATH_SEPARATOR(name[0])) {\n\t\t\t\t\t/*  No tag found for the given absolute name,\n\t\t\t\t\t *  Try each relative path starting from the shortest one */\n\t\t\t\t\twhile(0<char_index) {\n\t\t\t\t\t\tchar_index -= 1;\n\t\t\t\t\t\tif (SYNCTEX_IS_PATH_SEPARATOR(name[char_index])\n\t\t\t\t\t\t\t\t&& (result = _synctex_scanner_get_tag(scanner,name+char_index+1))) {\n\t\t\t\t\t\t\treturn result;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\treturn 0;\n}\nsynctex_node_t synctex_scanner_input(synctex_scanner_t scanner) {\n\treturn scanner?scanner->input:NULL;\n}\nconst char * synctex_scanner_get_output_fmt(synctex_scanner_t scanner) {\n\treturn NULL != scanner && scanner->output_fmt?scanner->output_fmt:\"\";\n}\nconst char * synctex_scanner_get_output(synctex_scanner_t scanner) {\n\treturn NULL != scanner && scanner->output?scanner->output:\"\";\n}\nconst char * synctex_scanner_get_synctex(synctex_scanner_t scanner) {\n\treturn NULL != scanner && scanner->synctex?scanner->synctex:\"\";\n}\n#\tifdef SYNCTEX_NOTHING\n#       pragma mark -\n#       pragma mark Public node attributes\n#   endif\nint synctex_node_h(synctex_node_t node){\n\tif (!node) {\n\t\treturn 0;\n\t}\n\treturn SYNCTEX_HORIZ(node);\n}\nint synctex_node_v(synctex_node_t node){\n\tif (!node) {\n\t\treturn 0;\n\t}\n\treturn SYNCTEX_VERT(node);\n}\nint synctex_node_width(synctex_node_t node){\n\tif (!node) {\n\t\treturn 0;\n\t}\n\treturn SYNCTEX_WIDTH(node);\n}\nint synctex_node_box_h(synctex_node_t node){\n\tif (!node) {\n\t\treturn 0;\n\t}\n\tif (SYNCTEX_IS_BOX(node)) {\nresult:\n\t\treturn SYNCTEX_HORIZ(node);\n\t}\n\tif ((node = SYNCTEX_PARENT(node)) && (node->class->type != synctex_node_type_sheet)) {\n\t\tgoto result;\n\t}\n\treturn 0;\n}\nint synctex_node_box_v(synctex_node_t node){\n\tif (!node) {\n\t\treturn 0;\n\t}\n\tif (SYNCTEX_IS_BOX(node)) {\nresult:\n\t\treturn SYNCTEX_VERT(node);\n\t}\n\tif ((node = SYNCTEX_PARENT(node)) && (node->class->type != synctex_node_type_sheet)) {\n\t\tgoto result;\n\t}\n\treturn 0;\n}\nint synctex_node_box_width(synctex_node_t node){\n\tif (!node) {\n\t\treturn 0;\n\t}\n\tif (SYNCTEX_IS_BOX(node)) {\nresult:\n\t\treturn SYNCTEX_WIDTH(node);\n\t}\n\tif ((node = SYNCTEX_PARENT(node)) && (node->class->type != synctex_node_type_sheet)) {\n\t\tgoto result;\n\t}\n\treturn 0;\n}\nint synctex_node_box_height(synctex_node_t node){\n\tif (!node) {\n\t\treturn 0;\n\t}\n\tif (SYNCTEX_IS_BOX(node)) {\nresult:\n\t\treturn SYNCTEX_HEIGHT(node);\n\t}\n\tif ((node = SYNCTEX_PARENT(node)) && (node->class->type != synctex_node_type_sheet)) {\n\t\tgoto result;\n\t}\n\treturn 0;\n}\nint synctex_node_box_depth(synctex_node_t node){\n\tif (!node) {\n\t\treturn 0;\n\t}\n\tif (SYNCTEX_IS_BOX(node)) {\nresult:\n\t\treturn SYNCTEX_DEPTH(node);\n\t}\n\tif ((node = SYNCTEX_PARENT(node)) && (node->class->type != synctex_node_type_sheet)) {\n\t\tgoto result;\n\t}\n\treturn 0;\n}\n#\tifdef SYNCTEX_NOTHING\n#       pragma mark -\n#       pragma mark Public node visible attributes\n#   endif\nfloat synctex_node_visible_h(synctex_node_t node){\n\tif (!node) {\n\t\treturn 0;\n\t}\n\treturn SYNCTEX_HORIZ(node)*node->class->scanner->unit+node->class->scanner->x_offset;\n}\nfloat synctex_node_visible_v(synctex_node_t node){\n\tif (!node) {\n\t\treturn 0;\n\t}\n\treturn SYNCTEX_VERT(node)*node->class->scanner->unit+node->class->scanner->y_offset;\n}\nfloat synctex_node_visible_width(synctex_node_t node){\n\tif (!node) {\n\t\treturn 0;\n\t}\n\treturn SYNCTEX_WIDTH(node)*node->class->scanner->unit;\n}\nfloat synctex_node_box_visible_h(synctex_node_t node){\n\tif (!node) {\n\t\treturn 0;\n\t}\n\tswitch(node->class->type) {\n\t\tcase synctex_node_type_vbox:\n\t\tcase synctex_node_type_void_vbox:\n\t\tcase synctex_node_type_void_hbox:\n\t\t\treturn SYNCTEX_HORIZ(node)*node->class->scanner->unit+node->class->scanner->x_offset;\n\t\tcase synctex_node_type_hbox:\nresult:\n\t\t\treturn SYNCTEX_HORIZ_V(node)*node->class->scanner->unit+node->class->scanner->x_offset;\n\t}\n\tif ((node = SYNCTEX_PARENT(node)) && (node->class->type != synctex_node_type_sheet)) {\n\t\tgoto result;\n\t}\n\treturn 0;\n}\nfloat synctex_node_box_visible_v(synctex_node_t node){\n\tif (!node) {\n\t\treturn 0;\n\t}\n\tswitch(node->class->type) {\n\t\tcase synctex_node_type_vbox:\n\t\tcase synctex_node_type_void_vbox:\n\t\tcase synctex_node_type_void_hbox:\n\t\t\treturn SYNCTEX_VERT(node)*node->class->scanner->unit+node->class->scanner->y_offset;\n\t\tcase synctex_node_type_hbox:\nresult:\n\t\t\treturn SYNCTEX_VERT_V(node)*node->class->scanner->unit+node->class->scanner->y_offset;\n\t}\n\tif ((node = SYNCTEX_PARENT(node)) && (node->class->type != synctex_node_type_sheet)) {\n\t\tgoto result;\n\t}\n\treturn 0;\n}\nfloat synctex_node_box_visible_width(synctex_node_t node){\n\tif (!node) {\n\t\treturn 0;\n\t}\n\tswitch(node->class->type) {\n\t\tcase synctex_node_type_vbox:\n\t\tcase synctex_node_type_void_vbox:\n\t\tcase synctex_node_type_void_hbox:\n\t\t\treturn SYNCTEX_WIDTH(node)*node->class->scanner->unit;\n\t\tcase synctex_node_type_hbox:\nresult:\n\t\t\treturn SYNCTEX_WIDTH_V(node)*node->class->scanner->unit;\n\t}\n\tif ((node = SYNCTEX_PARENT(node)) && (node->class->type != synctex_node_type_sheet)) {\n\t\tgoto result;\n\t}\n\treturn 0;\n}\nfloat synctex_node_box_visible_height(synctex_node_t node){\n\tif (!node) {\n\t\treturn 0;\n\t}\n\tswitch(node->class->type) {\n\t\tcase synctex_node_type_vbox:\n\t\tcase synctex_node_type_void_vbox:\n\t\tcase synctex_node_type_void_hbox:\n\t\t\treturn SYNCTEX_HEIGHT(node)*node->class->scanner->unit;\n\t\tcase synctex_node_type_hbox:\nresult:\n\t\t\treturn SYNCTEX_HEIGHT_V(node)*node->class->scanner->unit;\n\t}\n\tif ((node = SYNCTEX_PARENT(node)) && (node->class->type != synctex_node_type_sheet)) {\n\t\tgoto result;\n\t}\n\treturn 0;\n}\nfloat synctex_node_box_visible_depth(synctex_node_t node){\n\tif (!node) {\n\t\treturn 0;\n\t}\n\tswitch(node->class->type) {\n\t\tcase synctex_node_type_vbox:\n\t\tcase synctex_node_type_void_vbox:\n\t\tcase synctex_node_type_void_hbox:\n\t\t\treturn SYNCTEX_DEPTH(node)*node->class->scanner->unit;\n\t\tcase synctex_node_type_hbox:\nresult:\n\t\t\treturn SYNCTEX_DEPTH_V(node)*node->class->scanner->unit;\n\t}\n\tif ((node = SYNCTEX_PARENT(node)) && (node->class->type != synctex_node_type_sheet)) {\n\t\tgoto result;\n\t}\n\treturn 0;\n}\n#\tifdef SYNCTEX_NOTHING\n#       pragma mark -\n#       pragma mark Other public node attributes\n#   endif\n\nint synctex_node_page(synctex_node_t node){\n\tsynctex_node_t parent = NULL;\n\tif (!node) {\n\t\treturn -1;\n\t}\n\tparent = SYNCTEX_PARENT(node);\n\twhile(parent) {\n\t\tnode = parent;\n\t\tparent = SYNCTEX_PARENT(node);\n\t}\n\tif (node->class->type == synctex_node_type_sheet) {\n\t\treturn SYNCTEX_PAGE(node);\n\t}\n\treturn -1;\n}\nint synctex_node_tag(synctex_node_t node) {\n\treturn node?SYNCTEX_TAG(node):-1;\n}\nint synctex_node_line(synctex_node_t node) {\n\treturn node?SYNCTEX_LINE(node):-1;\n}\nint synctex_node_column(synctex_node_t node) {\n#\tifdef __DARWIN_UNIX03\n#       pragma unused(node)\n#   endif\n\treturn -1;\n}\n#\tifdef SYNCTEX_NOTHING\n#       pragma mark -\n#       pragma mark Sheet\n#   endif\n\nsynctex_node_t synctex_sheet_content(synctex_scanner_t scanner,int page) {\n\tif (scanner) {\n\t\tsynctex_node_t sheet = scanner->sheet;\n\t\twhile(sheet) {\n\t\t\tif (page == SYNCTEX_PAGE(sheet)) {\n\t\t\t\treturn SYNCTEX_CHILD(sheet);\n\t\t\t}\n\t\t\tsheet = SYNCTEX_SIBLING(sheet);\n\t\t}\n\t}\n\treturn NULL;\n}\n\n#\tifdef SYNCTEX_NOTHING\n#       pragma mark -\n#       pragma mark Query\n#   endif\n\nint synctex_display_query(synctex_scanner_t scanner,const char * name,int line,int column) {\n#\tifdef __DARWIN_UNIX03\n#       pragma unused(column)\n#   endif\n\tint tag = synctex_scanner_get_tag(scanner,name);\n\tsize_t size = 0;\n\tint friend_index = 0;\n\tint max_line = 0;\n\tsynctex_node_t node = NULL;\n\tif (tag == 0) {\n\t\tprintf(\"SyncTeX Warning: No tag for %s\\n\",name);\n\t\treturn -1;\n\t}\n\tfree(SYNCTEX_START);\n\tSYNCTEX_CUR = SYNCTEX_END = SYNCTEX_START = NULL;\n\tmax_line = line < INT_MAX-scanner->number_of_lists ? line+scanner->number_of_lists:INT_MAX;\n\twhile(line<max_line) {\n\t\t/*  This loop will only be performed once for advanced viewers */\n\t\tfriend_index = (tag+line)%(scanner->number_of_lists);\n\t\tif ((node = (scanner->lists_of_friends)[friend_index])) {\n\t\t\tdo {\n\t\t\t\tif ((synctex_node_type(node)>=synctex_node_type_boundary)\n\t\t\t\t\t&& (tag == SYNCTEX_TAG(node))\n\t\t\t\t\t\t&& (line == SYNCTEX_LINE(node))) {\n\t\t\t\t\tif (SYNCTEX_CUR == SYNCTEX_END) {\n\t\t\t\t\t\tsize += 16;\n\t\t\t\t\t\tSYNCTEX_END = realloc(SYNCTEX_START,size*sizeof(synctex_node_t *));\n\t\t\t\t\t\tSYNCTEX_CUR += SYNCTEX_END - SYNCTEX_START;\n\t\t\t\t\t\tSYNCTEX_START = SYNCTEX_END;\n\t\t\t\t\t\tSYNCTEX_END = SYNCTEX_START + size*sizeof(synctex_node_t *);\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t*(synctex_node_t *)SYNCTEX_CUR = node;\n\t\t\t\t\tSYNCTEX_CUR += sizeof(synctex_node_t);\n\t\t\t\t}\n\t\t\t} while((node = SYNCTEX_FRIEND(node)));\n\t\t\tif (SYNCTEX_START == NULL) {\n\t\t\t\t/*  We did not find any matching boundary, retry with glue or kern */\n\t\t\t\tnode = (scanner->lists_of_friends)[friend_index];/*  no need to test it again, already done */\n\t\t\t\tdo {\n\t\t\t\t\tif ((synctex_node_type(node)>=synctex_node_type_kern)\n\t\t\t\t\t\t&& (tag == SYNCTEX_TAG(node))\n\t\t\t\t\t\t\t&& (line == SYNCTEX_LINE(node))) {\n\t\t\t\t\t\tif (SYNCTEX_CUR == SYNCTEX_END) {\n\t\t\t\t\t\t\tsize += 16;\n\t\t\t\t\t\t\tSYNCTEX_END = realloc(SYNCTEX_START,size*sizeof(synctex_node_t *));\n\t\t\t\t\t\t\tSYNCTEX_CUR += SYNCTEX_END - SYNCTEX_START;\n\t\t\t\t\t\t\tSYNCTEX_START = SYNCTEX_END;\n\t\t\t\t\t\t\tSYNCTEX_END = SYNCTEX_START + size*sizeof(synctex_node_t *);\n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t*(synctex_node_t *)SYNCTEX_CUR = node;\n\t\t\t\t\t\tSYNCTEX_CUR += sizeof(synctex_node_t);\n\t\t\t\t\t}\n\t\t\t\t} while((node = SYNCTEX_FRIEND(node)));\n\t\t\t\tif (SYNCTEX_START == NULL) {\n\t\t\t\t\t/*  We did not find any matching glue or kern, retry with boxes */\n\t\t\t\t\tnode = (scanner->lists_of_friends)[friend_index];/*  no need to test it again, already done */\n\t\t\t\t\tdo {\n\t\t\t\t\t\tif ((tag == SYNCTEX_TAG(node))\n\t\t\t\t\t\t\t\t&& (line == SYNCTEX_LINE(node))) {\n\t\t\t\t\t\t\tif (SYNCTEX_CUR == SYNCTEX_END) {\n\t\t\t\t\t\t\t\tsize += 16;\n\t\t\t\t\t\t\t\tSYNCTEX_END = realloc(SYNCTEX_START,size*sizeof(synctex_node_t *));\n\t\t\t\t\t\t\t\tSYNCTEX_CUR += SYNCTEX_END - SYNCTEX_START;\n\t\t\t\t\t\t\t\tSYNCTEX_START = SYNCTEX_END;\n\t\t\t\t\t\t\t\tSYNCTEX_END = SYNCTEX_START + size*sizeof(synctex_node_t *);\n\t\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t\t*(synctex_node_t *)SYNCTEX_CUR = node;\n\t\t\t\t\t\t\tSYNCTEX_CUR += sizeof(synctex_node_t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} while((node = SYNCTEX_FRIEND(node)));\n\t\t\t\t}\n\t\t\t}\n\t\t\tSYNCTEX_END = SYNCTEX_CUR;\n\t\t\t/*  Now reverse the order to have nodes in display order, and keep just a few nodes */\n\t\t\tif ((SYNCTEX_START) && (SYNCTEX_END))\n\t\t\t{\n\t\t\t\tsynctex_node_t * start_ref = (synctex_node_t *)SYNCTEX_START;\n\t\t\t\tsynctex_node_t * end_ref   = (synctex_node_t *)SYNCTEX_END;\n\t\t\t\tend_ref -= 1;\n\t\t\t\twhile(start_ref < end_ref) {\n\t\t\t\t\tnode = *start_ref;\n\t\t\t\t\t*start_ref = *end_ref;\n\t\t\t\t\t*end_ref = node;\n\t\t\t\t\tstart_ref += 1;\n\t\t\t\t\tend_ref -= 1;\n\t\t\t\t}\n\t\t\t\t/*  Basically, we keep the first node for each parent.\n\t\t\t\t *  More precisely, we keep only nodes that are not descendants of\n\t\t\t\t *  their predecessor's parent. */\n\t\t\t\tstart_ref = (synctex_node_t *)SYNCTEX_START;\n\t\t\t\tend_ref   = (synctex_node_t *)SYNCTEX_START;\n\t\tnext_end:\n\t\t\t\tend_ref += 1; /*  we allways have start_ref<= end_ref*/\n\t\t\t\tif (end_ref < (synctex_node_t *)SYNCTEX_END) {\n\t\t\t\t\tnode = *end_ref;\n\t\t\t\t\twhile((node = SYNCTEX_PARENT(node))) {\n\t\t\t\t\t\tif (SYNCTEX_PARENT(*start_ref) == node) {\n\t\t\t\t\t\t\tgoto next_end;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tstart_ref += 1;\n\t\t\t\t\t*start_ref = *end_ref;\n\t\t\t\t\tgoto next_end;\n\t\t\t\t}\n\t\t\t\tstart_ref += 1;\n                SYNCTEX_END = (char *)start_ref;\n                SYNCTEX_CUR = NULL;// added on behalf of Jose Alliste\n\t\t\t\treturn (SYNCTEX_END-SYNCTEX_START)/sizeof(synctex_node_t);// added on behalf Jan Sundermeyer\n            }\n\t\t\tSYNCTEX_CUR = NULL;\n\t\t\t// return (SYNCTEX_END-SYNCTEX_START)/sizeof(synctex_node_t); removed on behalf Jan Sundermeyer\n\t\t}\n#       if defined(__SYNCTEX_STRONG_DISPLAY_QUERY__)\n\t\tbreak;\n#       else\n\t\t++line;\n#       endif\n\t}\n\treturn 0;\n}\n\nsynctex_node_t synctex_next_result(synctex_scanner_t scanner) {\n\tif (NULL == SYNCTEX_CUR) {\n\t\tSYNCTEX_CUR = SYNCTEX_START;\n\t} else {\n\t\tSYNCTEX_CUR+=sizeof(synctex_node_t);\n\t}\n\tif (SYNCTEX_CUR<SYNCTEX_END) {\n\t\treturn *(synctex_node_t*)SYNCTEX_CUR;\n\t} else {\n\t\treturn NULL;\n\t}\n}\n\n/*  This struct records a point in TeX coordinates.*/\ntypedef struct {\n\tint h;\n\tint v;\n} synctex_point_t;\n\n/*  This struct records distances, the left one is positive or 0 and the right one is negative or 0.\n *  When comparing the locations of 2 different graphical objects on the page, we will have to also record the\n *  horizontal distance as signed to keep track of the typesetting order.*/\ntypedef struct {\n\tint left;\n\tint right;\n} synctex_distances_t;\n\ntypedef struct {\n\tsynctex_point_t left;\n\tsynctex_point_t right;\n} synctex_offsets_t;\n\n\ntypedef struct {\n\tsynctex_node_t left;\n\tsynctex_node_t right;\n} synctex_node_set_t;\n\n/*  The smallest container between two has the smallest width or height.\n *  This comparison is used when there are 2 overlapping boxes that contain the hit point.\n *  For ConTeXt, the problem appears at each page.\n *  The chosen box is the one with the smallest height, then the smallest width. */\nSYNCTEX_INLINE static synctex_node_t _synctex_smallest_container(synctex_node_t node, synctex_node_t other_node);\n\n/*  Returns the distance between the hit point hitPoint=(H,V) and the given node. */\nsynctex_bool_t _synctex_point_in_box(synctex_point_t hitPoint, synctex_node_t node, synctex_bool_t visible);\nint _synctex_node_distance_to_point(synctex_point_t hitPoint, synctex_node_t node, synctex_bool_t visible);\n\n/*  The best container is the deeper box that contains the hit point (H,V).\n *  _synctex_eq_deepest_container starts with node whereas\n *  _synctex_box_child_deepest starts with node's children, if any\n *  if node is not a box, or a void box, NULL is returned.\n *  We traverse the node tree in a deep first manner and stop as soon as a result is found. */\nstatic synctex_node_t _synctex_eq_deepest_container(synctex_point_t hitPoint,synctex_node_t node, synctex_bool_t visible);\n\n/*  Once a best container is found, the closest children are the closest nodes to the left or right of the hit point.\n *  Only horizontal and vertical offsets are used to compare the positions of the nodes. */\nSYNCTEX_INLINE static int _synctex_eq_get_closest_children_in_box(synctex_point_t hitPoint, synctex_node_t node, synctex_node_set_t*  bestNodesRef,synctex_distances_t*  bestDistancesRef, synctex_bool_t visible);\n\n/*  The closest container is the box that is the one closest to the given point.\n *  The \"visible\" version takes into account the visible dimensions instead of the real ones given by TeX. */\nSYNCTEX_INLINE static synctex_node_t _synctex_eq_closest_child(synctex_point_t hitPoint,synctex_node_t node, synctex_bool_t visible);\n\n#define SYNCTEX_MASK_LEFT 1\n#define SYNCTEX_MASK_RIGHT 2\n\nint synctex_edit_query(synctex_scanner_t scanner,int page,float h,float v) {\n\tsynctex_node_t sheet = NULL;\n\tsynctex_node_t node = NULL; /*  placeholder */\n\tsynctex_node_t other_node = NULL; /*  placeholder */\n\tsynctex_point_t hitPoint = {0,0}; /*  placeholder */\n\tsynctex_node_set_t bestNodes = {NULL,NULL}; /*  holds the best node */\n\tsynctex_distances_t bestDistances = {INT_MAX,INT_MAX}; /*  holds the best distances for the best node */\n\tsynctex_node_t bestContainer = NULL; /*  placeholder */\n\tif (NULL == (scanner = synctex_scanner_parse(scanner)) || 0 >= scanner->unit) {/*  scanner->unit must be >0 */\n\t\treturn 0;\n\t}\n\t/*  Convert the given point to scanner integer coordinates */\n\thitPoint.h = (h-scanner->x_offset)/scanner->unit;\n\thitPoint.v = (v-scanner->y_offset)/scanner->unit;\n\t/*  We will store in the scanner's buffer the result of the query. */\n\tfree(SYNCTEX_START);\n\tSYNCTEX_START = SYNCTEX_END = SYNCTEX_CUR = NULL;\n\t/*  Find the proper sheet */\n\tsheet = scanner->sheet;\n\twhile((sheet) && SYNCTEX_PAGE(sheet) != page) {\n\t\tsheet = SYNCTEX_SIBLING(sheet);\n\t}\n\tif (NULL == sheet) {\n\t\treturn -1;\n\t}\n\t/*  Now sheet points to the sheet node with proper page number */\n\t/*  Here is how we work:\n\t *  At first we do not consider the visible box dimensions. This will cover the most frequent cases.\n\t *  Then we try with the visible box dimensions.\n\t *  We try to find a non void box containing the hit point.\n\t *  We browse all the horizontal boxes until we find one containing the hit point. */\n\tif ((node = SYNCTEX_NEXT_HORIZ_BOX(sheet))) {\n\t\tdo {\n\t\t\tif (_synctex_point_in_box(hitPoint,node,synctex_YES)) {\n\t\t\t\t/*  Maybe the hitPoint belongs to a contained vertical box. */\nend:\n\t\t\t\t/*  This trick is for catching overlapping boxes */\n\t\t\t\tif ((other_node = SYNCTEX_NEXT_HORIZ_BOX(node))) {\n\t\t\t\t\tdo {\n\t\t\t\t\t\tif (_synctex_point_in_box(hitPoint,other_node,synctex_YES)) {\n\t\t\t\t\t\t\tnode = _synctex_smallest_container(other_node,node); \n\t\t\t\t\t\t}\n\t\t\t\t\t} while((other_node = SYNCTEX_NEXT_HORIZ_BOX(other_node)));\n\t\t\t\t}\n                /*  node is the smallest horizontal box that contains hitPoint. */\n\t\t\t\tif ((bestContainer = _synctex_eq_deepest_container(hitPoint,node,synctex_YES))) {\n\t\t\t\t\tnode = bestContainer;\n\t\t\t\t}\n\t\t\t\t_synctex_eq_get_closest_children_in_box(hitPoint,node,&bestNodes,&bestDistances,synctex_YES);\n\t\t\t\tif (bestNodes.right && bestNodes.left) {\n\t\t\t\t\tif ((SYNCTEX_TAG(bestNodes.right)!=SYNCTEX_TAG(bestNodes.left))\n\t\t\t\t\t\t\t|| (SYNCTEX_LINE(bestNodes.right)!=SYNCTEX_LINE(bestNodes.left))\n\t\t\t\t\t\t\t\t|| (SYNCTEX_COLUMN(bestNodes.right)!=SYNCTEX_COLUMN(bestNodes.left))) {\n\t\t\t\t\t\tif ((SYNCTEX_START = malloc(2*sizeof(synctex_node_t)))) {\n\t\t\t\t\t\t\tif (bestDistances.left>bestDistances.right) {\n\t\t\t\t\t\t\t\t((synctex_node_t *)SYNCTEX_START)[0] = bestNodes.right;\n\t\t\t\t\t\t\t\t((synctex_node_t *)SYNCTEX_START)[1] = bestNodes.left;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t((synctex_node_t *)SYNCTEX_START)[0] = bestNodes.left;\n\t\t\t\t\t\t\t\t((synctex_node_t *)SYNCTEX_START)[1] = bestNodes.right;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tSYNCTEX_END = SYNCTEX_START + 2*sizeof(synctex_node_t);\n\t\t\t\t\t\t\tSYNCTEX_CUR = NULL;\n\t\t\t\t\t\t\treturn (SYNCTEX_END-SYNCTEX_START)/sizeof(synctex_node_t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn SYNCTEX_STATUS_ERROR;\n\t\t\t\t\t}\n\t\t\t\t\t/*  both nodes have the same input coordinates\n\t\t\t\t\t *  We choose the one closest to the hit point  */\n\t\t\t\t\tif (bestDistances.left>bestDistances.right) {\n\t\t\t\t\t\tbestNodes.left = bestNodes.right;\n\t\t\t\t\t}\n\t\t\t\t\tbestNodes.right = NULL;\n\t\t\t\t} else if (bestNodes.right) {\n\t\t\t\t\tbestNodes.left = bestNodes.right;\n\t\t\t\t} else if (!bestNodes.left){\n\t\t\t\t\tbestNodes.left = node;\n\t\t\t\t}\n\t\t\t\tif ((SYNCTEX_START = malloc(sizeof(synctex_node_t)))) {\n\t\t\t\t\t* (synctex_node_t *)SYNCTEX_START = bestNodes.left;\n\t\t\t\t\tSYNCTEX_END = SYNCTEX_START + sizeof(synctex_node_t);\n\t\t\t\t\tSYNCTEX_CUR = NULL;\n\t\t\t\t\treturn (SYNCTEX_END-SYNCTEX_START)/sizeof(synctex_node_t);\n\t\t\t\t}\n\t\t\t\treturn SYNCTEX_STATUS_ERROR;\n\t\t\t}\n\t\t} while ((node = SYNCTEX_NEXT_HORIZ_BOX(node)));\n\t\t/*  All the horizontal boxes have been tested,\n\t\t *  None of them contains the hit point.\n\t\t */\n\t}\n\t/*  We are not lucky */\n\tif ((node = SYNCTEX_CHILD(sheet))) {\n\t\tgoto end;\n\t}\n\treturn 0;\n}\n\n#\tifdef SYNCTEX_NOTHING\n#       pragma mark -\n#       pragma mark Utilities\n#   endif\n\nint _synctex_bail(void) {\n\t\t_synctex_error(\"SyncTeX ERROR\\n\");\n\t\treturn -1;\n}\n/*  Rougly speaking, this is:\n *  node's h coordinate - hitPoint's h coordinate.\n *  If node is to the right of the hit point, then this distance is positive,\n *  if node is to the left of the hit point, this distance is negative.*/\nint _synctex_point_h_distance(synctex_point_t hitPoint, synctex_node_t node, synctex_bool_t visible);\nint _synctex_point_h_distance(synctex_point_t hitPoint, synctex_node_t node, synctex_bool_t visible) {\n\tif (node) {\n\t\tint min,med,max;\n\t\tswitch(node->class->type) {\n\t\t\t/*  The distance between a point and a box is special.\n\t\t\t *  It is not the euclidian distance, nor something similar.\n\t\t\t *  We have to take into account the particular layout,\n\t\t\t *  and the box hierarchy.\n\t\t\t *  Given a box, there are 9 regions delimited by the lines of the edges of the box.\n\t\t\t *  The origin being at the top left corner of the page,\n\t\t\t *  we also give names to the vertices of the box.\n\t\t\t *\n\t\t\t *   1 | 2 | 3\n\t\t\t *  ---A---B--->\n\t\t\t *   4 | 5 | 6\n\t\t\t *  ---C---D--->\n\t\t\t *   7 | 8 | 9\n\t\t\t *     v   v\n\t\t\t */\n\t\t\tcase synctex_node_type_hbox:\n\t\t\t\t/*  getting the box bounds, taking into account negative width, height and depth. */\n\t\t\t\tmin = visible?SYNCTEX_HORIZ_V(node):SYNCTEX_HORIZ(node);\n\t\t\t\tmax = min + (visible?SYNCTEX_ABS_WIDTH_V(node):SYNCTEX_ABS_WIDTH(node));\n\t\t\t\t/*  We allways have min <= max */\n\t\t\t\tif (hitPoint.h<min) {\n\t\t\t\t\treturn min - hitPoint.h; /*  regions 1+4+7, result is > 0 */\n\t\t\t\t} else if (hitPoint.h>max) {\n\t\t\t\t\treturn max - hitPoint.h; /*  regions 3+6+9, result is < 0 */\n\t\t\t\t} else {\n\t\t\t\t\treturn 0; /*  regions 2+5+8, inside the box, except for vertical coordinates */\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase synctex_node_type_vbox:\n\t\t\tcase synctex_node_type_void_vbox:\n\t\t\tcase synctex_node_type_void_hbox:\n\t\t\t\t/*  getting the box bounds, taking into account negative width, height and depth.\n\t\t\t\t *  For these boxes, no visible dimension available */\n\t\t\t\tmin = SYNCTEX_HORIZ(node);\n\t\t\t\tmax = min + SYNCTEX_ABS_WIDTH(node);\n\t\t\t\t/*  We allways have min <= max */\n\t\t\t\tif (hitPoint.h<min) {\n\t\t\t\t\treturn min - hitPoint.h; /*  regions 1+4+7, result is > 0 */\n\t\t\t\t} else if (hitPoint.h>max) {\n\t\t\t\t\treturn max - hitPoint.h; /*  regions 3+6+9, result is < 0 */\n\t\t\t\t} else {\n\t\t\t\t\treturn 0; /*  regions 2+5+8, inside the box, except for vertical coordinates */\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase synctex_node_type_kern:\n\t\t\t\t/*  IMPORTANT NOTICE: the location of the kern is recorded AFTER the move.\n\t\t\t\t *  The distance to the kern is very special,\n\t\t\t\t *  in general, there is no text material in the kern,\n\t\t\t\t *  this is why we compute the offset relative to the closest edge of the kern.*/\n\t\t\t\tmax = SYNCTEX_WIDTH(node);\n\t\t\t\tif (max<0) {\n\t\t\t\t\tmin = SYNCTEX_HORIZ(node);\n\t\t\t\t\tmax = min - max;\n\t\t\t\t} else {\n\t\t\t\t\tmin = -max;\n\t\t\t\t\tmax = SYNCTEX_HORIZ(node);\n\t\t\t\t\tmin += max;\n\t\t\t\t}\n\t\t\t\tmed = (min+max)/2;\n\t\t\t\t/*  positive kern: '.' means text, '>' means kern offset\n\t\t\t\t *      .............\n\t\t\t\t *                   min>>>>med>>>>max\n\t\t\t\t *                                    ...............\n\t\t\t\t *  negative kern: '.' means text, '<' means kern offset\n\t\t\t\t *      ............................\n\t\t\t\t *                 min<<<<med<<<<max\n\t\t\t\t *                 .................................\n\t\t\t\t *  Actually, we do not take into account negative widths.\n\t\t\t\t *  There is a problem for such situation when there is efectively overlapping text.\n\t\t\t\t *  But this should be extremely rare. I guess that in that case, many different choices\n\t\t\t\t *  could be made, one being in contradiction of the other.\n\t\t\t\t *  It means that the best choice should be made according to the situation that occurs\n\t\t\t\t *  most frequently.\n\t\t\t\t */\n\t\t\t\tif (hitPoint.h<min) {\n\t\t\t\t\treturn min - hitPoint.h + 1; /*  penalty to ensure other nodes are chosen first in case of overlapping ones */\n\t\t\t\t} else if (hitPoint.h>max) {\n\t\t\t\t\treturn max - hitPoint.h - 1; /*  same kind of penalty */\n\t\t\t\t} else if (hitPoint.h>med) {\n\t\t\t\t\t/*  do things like if the node had 0 width and was placed at the max edge + 1*/\n\t\t\t\t\treturn max - hitPoint.h + 1; /*  positive, the kern is to the right of the hitPoint */\n\t\t\t\t} else {\n\t\t\t\t\treturn min - hitPoint.h - 1; /*  negative, the kern is to the left of the hitPoint */\n\t\t\t\t}\n\t\t\tcase synctex_node_type_glue:\n\t\t\tcase synctex_node_type_math:\n\t\t\t\treturn SYNCTEX_HORIZ(node) - hitPoint.h;\n\t\t}\n\t}\n\treturn INT_MAX;/*  We always assume that the node is faraway to the right*/\n}\n/*  Rougly speaking, this is:\n *  node's v coordinate - hitPoint's v coordinate.\n *  If node is at the top of the hit point, then this distance is positive,\n *  if node is at the bottom of the hit point, this distance is negative.*/\nint _synctex_point_v_distance(synctex_point_t hitPoint, synctex_node_t node,synctex_bool_t visible);\nint _synctex_point_v_distance(synctex_point_t hitPoint, synctex_node_t node,synctex_bool_t visible) {\n#\tifdef __DARWIN_UNIX03\n#       pragma unused(visible)\n#   endif\n\tif (node) {\n\t\tint min,max;\n\t\tswitch(node->class->type) {\n\t\t\t/*  The distance between a point and a box is special.\n\t\t\t *  It is not the euclidian distance, nor something similar.\n\t\t\t *  We have to take into account the particular layout,\n\t\t\t *  and the box hierarchy.\n\t\t\t *  Given a box, there are 9 regions delimited by the lines of the edges of the box.\n\t\t\t *  The origin being at the top left corner of the page,\n\t\t\t *  we also give names to the vertices of the box.\n\t\t\t *\n\t\t\t *   1 | 2 | 3\n\t\t\t *  ---A---B--->\n\t\t\t *   4 | 5 | 6\n\t\t\t *  ---C---D--->\n\t\t\t *   7 | 8 | 9\n\t\t\t *     v   v\n\t\t\t */\n\t\t\tcase synctex_node_type_hbox:\n\t\t\t\t/*  getting the box bounds, taking into account negative width, height and depth. */\n\t\t\t\tmin = SYNCTEX_VERT_V(node);\n\t\t\t\tmax = min + SYNCTEX_ABS_DEPTH_V(node);\n\t\t\t\tmin -= SYNCTEX_ABS_HEIGHT_V(node);\n\t\t\t\t/*  We allways have min <= max */\n\t\t\t\tif (hitPoint.v<min) {\n\t\t\t\t\treturn min - hitPoint.v; /*  regions 1+2+3, result is > 0 */\n\t\t\t\t} else if (hitPoint.v>max) {\n\t\t\t\t\treturn max - hitPoint.v; /*  regions 7+8+9, result is < 0 */\n\t\t\t\t} else {\n\t\t\t\t\treturn 0; /*  regions 4.5.6, inside the box, except for horizontal coordinates */\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase synctex_node_type_vbox:\n\t\t\tcase synctex_node_type_void_vbox:\n\t\t\tcase synctex_node_type_void_hbox:\n\t\t\t\t/*  getting the box bounds, taking into account negative width, height and depth. */\n\t\t\t\tmin = SYNCTEX_VERT(node);\n\t\t\t\tmax = min + SYNCTEX_ABS_DEPTH(node);\n\t\t\t\tmin -= SYNCTEX_ABS_HEIGHT(node);\n\t\t\t\t/*  We allways have min <= max */\n\t\t\t\tif (hitPoint.v<min) {\n\t\t\t\t\treturn min - hitPoint.v; /*  regions 1+2+3, result is > 0 */\n\t\t\t\t} else if (hitPoint.v>max) {\n\t\t\t\t\treturn max - hitPoint.v; /*  regions 7+8+9, result is < 0 */\n\t\t\t\t} else {\n\t\t\t\t\treturn 0; /*  regions 4.5.6, inside the box, except for horizontal coordinates */\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase synctex_node_type_kern:\n\t\t\tcase synctex_node_type_glue:\n\t\t\tcase synctex_node_type_math:\n\t\t\t\treturn SYNCTEX_VERT(node) - hitPoint.v;\n\t\t}\n\t}\n\treturn INT_MAX;/*  We always assume that the node is faraway to the top*/\n}\n\nSYNCTEX_INLINE static synctex_node_t _synctex_smallest_container(synctex_node_t node, synctex_node_t other_node) {\n\tfloat height, other_height;\n\tif (SYNCTEX_ABS_WIDTH(node)<SYNCTEX_ABS_WIDTH(other_node)) {\n\t\treturn node;\n\t}\n\tif (SYNCTEX_ABS_WIDTH(node)>SYNCTEX_ABS_WIDTH(other_node)) {\n\t\treturn other_node;\n\t}\n\theight = SYNCTEX_ABS_DEPTH(node) + SYNCTEX_ABS_HEIGHT(node);\n\tother_height = SYNCTEX_ABS_DEPTH(other_node) + SYNCTEX_ABS_HEIGHT(other_node);\n\tif (height<other_height) {\n\t\treturn node;\n\t}\n\tif (height>other_height) {\n\t\treturn other_node;\n\t}\n\treturn node;\n}\n\nsynctex_bool_t _synctex_point_in_box(synctex_point_t hitPoint, synctex_node_t node, synctex_bool_t visible) {\n\tif (node) {\n\t\tif (0 == _synctex_point_h_distance(hitPoint,node,visible)\n\t\t\t\t&& 0 == _synctex_point_v_distance(hitPoint,node,visible)) {\n\t\t\treturn synctex_YES;\n\t\t}\n\t}\n\treturn synctex_NO;\t\n}\n\nint _synctex_node_distance_to_point(synctex_point_t hitPoint, synctex_node_t node, synctex_bool_t visible) {\n#\tifdef __DARWIN_UNIX03\n#       pragma unused(visible)\n#   endif\n\tint result = INT_MAX; /*  when the distance is meaning less (sheet, input...)  */\n\tif (node) {\n\t\tint minH,maxH,minV,maxV;\n\t\tswitch(node->class->type) {\n\t\t\t/*  The distance between a point and a box is special.\n\t\t\t *  It is not the euclidian distance, nor something similar.\n\t\t\t *  We have to take into account the particular layout,\n\t\t\t *  and the box hierarchy.\n\t\t\t *  Given a box, there are 9 regions delimited by the lines of the edges of the box.\n\t\t\t *  The origin being at the top left corner of the page,\n\t\t\t *  we also give names to the vertices of the box.\n\t\t\t *\n\t\t\t *   1 | 2 | 3\n\t\t\t *  ---A---B--->\n\t\t\t *   4 | 5 | 6\n\t\t\t *  ---C---D--->\n\t\t\t *   7 | 8 | 9\n\t\t\t *     v   v\n\t\t\t *  In each region, there is a different formula.\n\t\t\t *  In the end we have a continuous distance which may not be a mathematical distance but who cares. */\n\t\t\tcase synctex_node_type_vbox:\n\t\t\tcase synctex_node_type_void_vbox:\n\t\t\tcase synctex_node_type_hbox:\n\t\t\tcase synctex_node_type_void_hbox:\n\t\t\t\t/*  getting the box bounds, taking into account negative widths. */\n\t\t\t\tminH = SYNCTEX_HORIZ(node);\n\t\t\t\tmaxH = minH + SYNCTEX_ABS_WIDTH(node);\n\t\t\t\tminV = SYNCTEX_VERT(node);\n\t\t\t\tmaxV = minV + SYNCTEX_ABS_DEPTH(node);\n\t\t\t\tminV -= SYNCTEX_ABS_HEIGHT(node);\n\t\t\t\t/*  In what region is the point hitPoint=(H,V) ? */\n\t\t\t\tif (hitPoint.v<minV) {\n\t\t\t\t\tif (hitPoint.h<minH) {\n\t\t\t\t\t\t/*  This is region 1. The distance to the box is the L1 distance PA. */\n\t\t\t\t\t\tresult = minV - hitPoint.v + minH - hitPoint.h;/*  Integer overflow? probability epsilon */\n\t\t\t\t\t} else if (hitPoint.h<=maxH) {\n\t\t\t\t\t\t/*  This is region 2. The distance to the box is the geometrical distance to the top edge.  */\n\t\t\t\t\t\tresult = minV - hitPoint.v;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/*  This is region 3. The distance to the box is the L1 distance PB. */\n\t\t\t\t\t\tresult = minV - hitPoint.v + hitPoint.h - maxH;\n\t\t\t\t\t}\n\t\t\t\t} else if (hitPoint.v<=maxV) {\n\t\t\t\t\tif (hitPoint.h<minH) {\n\t\t\t\t\t\t/*  This is region 4. The distance to the box is the geometrical distance to the left edge.  */\n\t\t\t\t\t\tresult = minH - hitPoint.h;\n\t\t\t\t\t} else if (hitPoint.h<=maxH) {\n\t\t\t\t\t\t/*  This is region 4. We are inside the box.  */\n\t\t\t\t\t\tresult = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/*  This is region 6. The distance to the box is the geometrical distance to the right edge.  */\n\t\t\t\t\t\tresult = hitPoint.h - maxH;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (hitPoint.h<minH) {\n\t\t\t\t\t\t/*  This is region 7. The distance to the box is the L1 distance PC. */\n\t\t\t\t\t\tresult = hitPoint.v - maxV + minH - hitPoint.h;\n\t\t\t\t\t} else if (hitPoint.h<=maxH) {\n\t\t\t\t\t\t/*  This is region 8. The distance to the box is the geometrical distance to the top edge.  */\n\t\t\t\t\t\tresult = hitPoint.v - maxV;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/*  This is region 9. The distance to the box is the L1 distance PD. */\n\t\t\t\t\t\tresult = hitPoint.v - maxV + hitPoint.h - maxH;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase synctex_node_type_kern:\n\t\t\t\tmaxH = SYNCTEX_WIDTH(node);\n\t\t\t\tif (maxH<0) {\n\t\t\t\t\tminH = SYNCTEX_HORIZ(node);\n\t\t\t\t\tmaxH = minH - maxH;\n\t\t\t\t} else {\n\t\t\t\t\tminH = -maxH;\n\t\t\t\t\tmaxH = SYNCTEX_HORIZ(node);\n\t\t\t\t\tminH += maxH;\n\t\t\t\t}\n\t\t\t\tminV = SYNCTEX_VERT(node);\n\t\t\t\tif (hitPoint.h<minH) {\n\t\t\t\t\tif (hitPoint.v>minV) {\n\t\t\t\t\t\tresult = hitPoint.v - minV + minH - hitPoint.h;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = minV - hitPoint.v + minH - hitPoint.h;\n\t\t\t\t\t}\n\t\t\t\t} else if (hitPoint.h>maxH) {\n\t\t\t\t\tif (hitPoint.v>minV) {\n\t\t\t\t\t\tresult = hitPoint.v - minV + hitPoint.h - maxH;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = minV - hitPoint.v + hitPoint.h - maxH;\n\t\t\t\t\t}\n\t\t\t\t} else if (hitPoint.v>minV) {\n\t\t\t\t\tresult = hitPoint.v - minV;\n\t\t\t\t} else {\n\t\t\t\t\tresult = minV - hitPoint.v;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase synctex_node_type_glue:\n\t\t\tcase synctex_node_type_math:\n\t\t\t\tminH = SYNCTEX_HORIZ(node);\n\t\t\t\tminV = SYNCTEX_VERT(node);\n\t\t\t\tif (hitPoint.h<minH) {\n\t\t\t\t\tif (hitPoint.v>minV) {\n\t\t\t\t\t\tresult = hitPoint.v - minV + minH - hitPoint.h;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = minV - hitPoint.v + minH - hitPoint.h;\n\t\t\t\t\t}\n\t\t\t\t} else if (hitPoint.v>minV) {\n\t\t\t\t\tresult = hitPoint.v - minV + hitPoint.h - minH;\n\t\t\t\t} else {\n\t\t\t\t\tresult = minV - hitPoint.v + hitPoint.h - minH;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\treturn result;\n}\n\nstatic synctex_node_t _synctex_eq_deepest_container(synctex_point_t hitPoint,synctex_node_t node, synctex_bool_t visible) {\n\tif (node) {\n\t\tsynctex_node_t result = NULL;\n\t\tsynctex_node_t child = NULL;\n\t\tswitch(node->class->type) {\n\t\t\tcase synctex_node_type_vbox:\n\t\t\tcase synctex_node_type_hbox:\n\t\t\t\t/*  test the deep nodes first */\n\t\t\t\tif ((child = SYNCTEX_CHILD(node))) {\n\t\t\t\t\tdo {\n\t\t\t\t\t\tif ((result = _synctex_eq_deepest_container(hitPoint,child,visible))) {\n\t\t\t\t\t\t\treturn result;\n\t\t\t\t\t\t}\n\t\t\t\t\t} while((child = SYNCTEX_SIBLING(child)));\n\t\t\t\t}\n\t\t\t\t/*  is the hit point inside the box? */\n\t\t\t\tif (_synctex_point_in_box(hitPoint,node,visible)) {\n\t\t\t\t\t/*  for vboxes we try to use some node inside.\n\t\t\t\t\t *  Walk through the list of siblings until we find the closest one.\n\t\t\t\t\t *  Only consider siblings with children. */\n\t\t\t\t\tif ((node->class->type == synctex_node_type_vbox) && (child = SYNCTEX_CHILD(node))) {\n\t\t\t\t\t\tint bestDistance = INT_MAX;\n\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\tif (SYNCTEX_CHILD(child)) {\n\t\t\t\t\t\t\t\tint distance = _synctex_node_distance_to_point(hitPoint,child,visible);\n\t\t\t\t\t\t\t\tif (distance < bestDistance) {\n\t\t\t\t\t\t\t\t\tbestDistance = distance;\n\t\t\t\t\t\t\t\t\tnode = child;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} while((child = SYNCTEX_SIBLING(child)));\n\t\t\t\t\t}\n\t\t\t\t\treturn node;\n\t\t\t\t}\n\t\t}\n\t}\n\treturn NULL;\n}\n\n/*  Compares the locations of the hitPoint with the locations of the various nodes contained in the box.\n *  As it is an horizontal box, we only compare horizontal coordinates. */\nSYNCTEX_INLINE static int __synctex_eq_get_closest_children_in_hbox(synctex_point_t hitPoint, synctex_node_t node, synctex_node_set_t*  bestNodesRef,synctex_distances_t*  bestDistancesRef, synctex_bool_t visible);\nSYNCTEX_INLINE static int __synctex_eq_get_closest_children_in_hbox(synctex_point_t hitPoint, synctex_node_t node, synctex_node_set_t*  bestNodesRef,synctex_distances_t*  bestDistancesRef, synctex_bool_t visible) {\n\tint result = 0;\n\tif ((node = SYNCTEX_CHILD(node))) {\n\t\tdo {\n\t\t\tint off7 = _synctex_point_h_distance(hitPoint,node,visible);\n\t\t\tif (off7 > 0) {\n\t\t\t\t/*  node is to the right of the hit point.\n\t\t\t\t *  We compare node and the previously recorded one, through the recorded distance.\n\t\t\t\t *  If the nodes have the same tag, prefer the one with the smallest line number,\n\t\t\t\t *  if the nodes also have the same line number, prefer the one with the smallest column. */\n\t\t\t\tif (bestDistancesRef->right > off7) {\n\t\t\t\t\tbestDistancesRef->right = off7;\n\t\t\t\t\tbestNodesRef->right = node;\n\t\t\t\t\tresult |= SYNCTEX_MASK_RIGHT;\n\t\t\t\t} else if (bestDistancesRef->right == off7 && bestNodesRef->right) {\n\t\t\t\t\tif (SYNCTEX_TAG(bestNodesRef->right) == SYNCTEX_TAG(node)\n\t\t\t\t\t\t&& (SYNCTEX_LINE(bestNodesRef->right) > SYNCTEX_LINE(node)\n\t\t\t\t\t\t\t|| (SYNCTEX_LINE(bestNodesRef->right) == SYNCTEX_LINE(node)\n\t\t\t\t\t\t\t\t&& SYNCTEX_COLUMN(bestNodesRef->right) > SYNCTEX_COLUMN(node)))) {\n\t\t\t\t\t\tbestNodesRef->right = node;\n\t\t\t\t\t\tresult |= SYNCTEX_MASK_RIGHT;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (off7 == 0) {\n\t\t\t\t/*  hitPoint is inside node. */ \n\t\t\t\tbestDistancesRef->left = bestDistancesRef->right = 0;\n\t\t\t\tbestNodesRef->left = node;\n\t\t\t\tbestNodesRef->right = NULL;\n\t\t\t\tresult |= SYNCTEX_MASK_LEFT;\n\t\t\t} else { /*  here off7 < 0, hitPoint is to the right of node */\n\t\t\t\toff7 = -off7;\n\t\t\t\tif (bestDistancesRef->left > off7) {\n\t\t\t\t\tbestDistancesRef->left = off7;\n\t\t\t\t\tbestNodesRef->left = node;\n\t\t\t\t\tresult |= SYNCTEX_MASK_LEFT;\n\t\t\t\t} else if (bestDistancesRef->left == off7 && bestNodesRef->left) {\n\t\t\t\t\tif (SYNCTEX_TAG(bestNodesRef->left) == SYNCTEX_TAG(node)\n\t\t\t\t\t\t&& (SYNCTEX_LINE(bestNodesRef->left) > SYNCTEX_LINE(node)\n\t\t\t\t\t\t\t|| (SYNCTEX_LINE(bestNodesRef->left) == SYNCTEX_LINE(node)\n\t\t\t\t\t\t\t\t&& SYNCTEX_COLUMN(bestNodesRef->left) > SYNCTEX_COLUMN(node)))) {\n\t\t\t\t\t\tbestNodesRef->left = node;\n\t\t\t\t\t\tresult |= SYNCTEX_MASK_LEFT;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} while((node = SYNCTEX_SIBLING(node)));\n\t\tif (result & SYNCTEX_MASK_LEFT) {\n\t\t\t/*  the left node is new, try to narrow the result */\n\t\t\tif ((node = _synctex_eq_deepest_container(hitPoint,bestNodesRef->left,visible))) {\n\t\t\t\tbestNodesRef->left = node;\n\t\t\t} \n\t\t\tif ((node = _synctex_eq_closest_child(hitPoint,bestNodesRef->left,visible))) {\n\t\t\t\tbestNodesRef->left = node;\n\t\t\t} \n\t\t}\n\t\tif (result & SYNCTEX_MASK_RIGHT) {\n\t\t\t/*  the right node is new, try to narrow the result */\n\t\t\tif ((node = _synctex_eq_deepest_container(hitPoint,bestNodesRef->right,visible))) {\n\t\t\t\tbestNodesRef->right = node;\n\t\t\t} \n\t\t\tif ((node = _synctex_eq_closest_child(hitPoint,bestNodesRef->right,visible))) {\n\t\t\t\tbestNodesRef->right = node;\n\t\t\t} \n\t\t}\n\t}\n\treturn result;\n}\nSYNCTEX_INLINE static int __synctex_eq_get_closest_children_in_vbox(synctex_point_t hitPoint, synctex_node_t node, synctex_node_set_t*  bestNodesRef,synctex_distances_t*  bestDistancesRef,synctex_bool_t visible);\nSYNCTEX_INLINE static int __synctex_eq_get_closest_children_in_vbox(synctex_point_t hitPoint, synctex_node_t node, synctex_node_set_t*  bestNodesRef,synctex_distances_t*  bestDistancesRef,synctex_bool_t visible) {\n\tint result = 0;\n\tif ((node = SYNCTEX_CHILD(node))) {\n\t\tdo {\n\t\t\tint off7 = _synctex_point_v_distance(hitPoint,node,visible);/*  this is what makes the difference with the h version above */\n\t\t\tif (off7 > 0) {\n\t\t\t\t/*  node is to the top of the hit point (below because TeX is oriented from top to bottom.\n\t\t\t\t *  We compare node and the previously recorded one, through the recorded distance.\n\t\t\t\t *  If the nodes have the same tag, prefer the one with the smallest line number,\n\t\t\t\t *  if the nodes also have the same line number, prefer the one with the smallest column. */\n\t\t\t\tif (bestDistancesRef->right > off7) {\n\t\t\t\t\tbestDistancesRef->right = off7;\n\t\t\t\t\tbestNodesRef->right = node;\n\t\t\t\t\tresult |= SYNCTEX_MASK_RIGHT;\n\t\t\t\t} else if (bestDistancesRef->right == off7 && bestNodesRef->right) {\n\t\t\t\t\tif (SYNCTEX_TAG(bestNodesRef->right) == SYNCTEX_TAG(node)\n\t\t\t\t\t\t&& (SYNCTEX_LINE(bestNodesRef->right) > SYNCTEX_LINE(node)\n\t\t\t\t\t\t\t|| (SYNCTEX_LINE(bestNodesRef->right) == SYNCTEX_LINE(node)\n\t\t\t\t\t\t\t\t&& SYNCTEX_COLUMN(bestNodesRef->right) > SYNCTEX_COLUMN(node)))) {\n\t\t\t\t\t\tbestNodesRef->right = node;\n\t\t\t\t\t\tresult |= SYNCTEX_MASK_RIGHT;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (off7 == 0) {\n\t\t\t\tbestDistancesRef->left = bestDistancesRef->right = 0;\n\t\t\t\tbestNodesRef->left = node;\n\t\t\t\tbestNodesRef->right = NULL;\n\t\t\t\tresult |= SYNCTEX_MASK_LEFT;\n\t\t\t} else { /*  here off7 < 0 */\n\t\t\t\toff7 = -off7;\n\t\t\t\tif (bestDistancesRef->left > off7) {\n\t\t\t\t\tbestDistancesRef->left = off7;\n\t\t\t\t\tbestNodesRef->left = node;\n\t\t\t\t\tresult |= SYNCTEX_MASK_LEFT;\n\t\t\t\t} else if (bestDistancesRef->left == off7 && bestNodesRef->left) {\n\t\t\t\t\tif (SYNCTEX_TAG(bestNodesRef->left) == SYNCTEX_TAG(node)\n\t\t\t\t\t\t&& (SYNCTEX_LINE(bestNodesRef->left) > SYNCTEX_LINE(node)\n\t\t\t\t\t\t\t|| (SYNCTEX_LINE(bestNodesRef->left) == SYNCTEX_LINE(node)\n\t\t\t\t\t\t\t\t&& SYNCTEX_COLUMN(bestNodesRef->left) > SYNCTEX_COLUMN(node)))) {\n\t\t\t\t\t\tbestNodesRef->left = node;\n\t\t\t\t\t\tresult |= SYNCTEX_MASK_LEFT;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} while((node = SYNCTEX_SIBLING(node)));\n\t\tif (result & SYNCTEX_MASK_LEFT) {\n\t\t\t/*  the left node is new, try to narrow the result */\n\t\t\tif ((node = _synctex_eq_deepest_container(hitPoint,bestNodesRef->left,visible))) {\n\t\t\t\tbestNodesRef->left = node;\n\t\t\t} \n\t\t\tif ((node = _synctex_eq_closest_child(hitPoint,bestNodesRef->left,visible))) {\n\t\t\t\tbestNodesRef->left = node;\n\t\t\t} \n\t\t}\n\t\tif (result & SYNCTEX_MASK_RIGHT) {\n\t\t\t/*  the right node is new, try to narrow the result */\n\t\t\tif ((node = _synctex_eq_deepest_container(hitPoint,bestNodesRef->right,visible))) {\n\t\t\t\tbestNodesRef->right = node;\n\t\t\t} \n\t\t\tif ((node = _synctex_eq_closest_child(hitPoint,bestNodesRef->right,visible))) {\n\t\t\t\tbestNodesRef->right = node;\n\t\t\t} \n\t\t}\n\t}\n\treturn result;\n}\nSYNCTEX_INLINE static int _synctex_eq_get_closest_children_in_box(synctex_point_t hitPoint, synctex_node_t node, synctex_node_set_t*  bestNodesRef,synctex_distances_t*  bestDistancesRef,synctex_bool_t visible) {\n\tif (node) {\n\t\tswitch(node->class->type) {\n\t\t\tcase synctex_node_type_hbox:\n\t\t\t\treturn __synctex_eq_get_closest_children_in_hbox(hitPoint, node, bestNodesRef, bestDistancesRef,visible);\n\t\t\tcase synctex_node_type_vbox:\n\t\t\t\treturn __synctex_eq_get_closest_children_in_vbox(hitPoint, node, bestNodesRef, bestDistancesRef,visible);\n\t\t}\n\t}\n\treturn 0;\n}\n\nSYNCTEX_INLINE static synctex_node_t __synctex_eq_closest_child(synctex_point_t hitPoint, synctex_node_t node,int*  distanceRef, synctex_bool_t visible);\nSYNCTEX_INLINE static synctex_node_t __synctex_eq_closest_child(synctex_point_t hitPoint, synctex_node_t node,int*  distanceRef, synctex_bool_t visible) {\n\tsynctex_node_t best_node = NULL;\n\tif ((node = SYNCTEX_CHILD(node))) {\n\t\tdo {\n\t\t\tint distance = _synctex_node_distance_to_point(hitPoint,node,visible);\n\t\t\tsynctex_node_t candidate = NULL;\n\t\t\tif (distance<=*distanceRef) {\n\t\t\t\t*distanceRef = distance;\n\t\t\t\tbest_node = node;\n\t\t\t}\n\t\t\tswitch(node->class->type) {\n\t\t\t\tcase synctex_node_type_vbox:\n\t\t\t\tcase synctex_node_type_hbox:\n\t\t\t\t\tif ((candidate = __synctex_eq_closest_child(hitPoint,node,distanceRef,visible))) {\n\t\t\t\t\t\tbest_node = candidate;\n\t\t\t\t\t}\n\t\t\t}\n\t\t} while((node = SYNCTEX_SIBLING(node)));\n\t}\n\treturn best_node;\n}\nSYNCTEX_INLINE static synctex_node_t _synctex_eq_closest_child(synctex_point_t hitPoint,synctex_node_t node, synctex_bool_t visible) {\n\tif (node) {\n\t\tswitch(node->class->type) {\n\t\t\tcase synctex_node_type_hbox:\n\t\t\tcase synctex_node_type_vbox:\n\t\t\t{\n\t\t\t\tint best_distance = INT_MAX;\n\t\t\t\tsynctex_node_t best_node = __synctex_eq_closest_child(hitPoint,node,&best_distance,visible);\n\t\t\t\tif ((best_node)) {\n\t\t\t\t\tsynctex_node_t child = NULL;\n\t\t\t\t\tswitch(best_node->class->type) {\n\t\t\t\t\t\tcase synctex_node_type_vbox:\n\t\t\t\t\t\tcase synctex_node_type_hbox:\n\t\t\t\t\t\t\tif ((child = SYNCTEX_CHILD(best_node))) {\n\t\t\t\t\t\t\t\tbest_distance = _synctex_node_distance_to_point(hitPoint,child,visible);\n\t\t\t\t\t\t\t\twhile((child = SYNCTEX_SIBLING(child))) {\n\t\t\t\t\t\t\t\t\tint distance = _synctex_node_distance_to_point(hitPoint,child,visible);\n\t\t\t\t\t\t\t\t\tif (distance<=best_distance) {\n\t\t\t\t\t\t\t\t\t\tbest_distance = distance;\n\t\t\t\t\t\t\t\t\t\tbest_node = child;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn best_node;\n\t\t\t}\n\t\t}\n\t}\n\treturn NULL;\n}\n\n#\tifdef SYNCTEX_NOTHING\n#       pragma mark -\n#       pragma mark Updater\n#   endif\n\ntypedef int (*synctex_fprintf_t)(void *, const char * , ...); /*  print formatted to either FILE *  or gzFile */\n\n#   define SYNCTEX_BITS_PER_BYTE 8\n\nstruct __synctex_updater_t {\n    gzFile file;                /*  the foo.synctex or foo.synctex.gz I/O identifier  */\n\tsynctex_fprintf_t fprintf;  /*  either fprintf or gzprintf */\n\tint length;                 /*  the number of chars appended */\n    struct _flags {\n        unsigned int no_gz:1;   /*  Whether zlib is used or not */\n        unsigned int reserved:SYNCTEX_BITS_PER_BYTE*sizeof(int)-1; /*  Align */\n\t} flags;\n};\n#   define SYNCTEX_FILE updater->file\n#   define SYNCTEX_NO_GZ ((updater->flags).no_gz)\n#   define SYNCTEX_fprintf (*(updater->fprintf))\n\nsynctex_updater_t synctex_updater_new_with_output_file(const char * output, const char * build_directory) {\n\tsynctex_updater_t updater = NULL;\n\tchar * synctex = NULL;\n\tsynctex_io_mode_t io_mode = 0;\n\tconst char * mode = NULL;\n\t/*  prepare the updater, the memory is the only one dynamically allocated */\n\tupdater = (synctex_updater_t)_synctex_malloc(sizeof(synctex_updater_t));\n\tif (NULL == updater) {\n\t\t_synctex_error(\"!  synctex_updater_new_with_file: malloc problem\");\n\t\treturn NULL;\n\t}\n\tif (_synctex_open(output,build_directory,&synctex,&SYNCTEX_FILE,synctex_ADD_QUOTES,&io_mode)\n\t\t&& _synctex_open(output,build_directory,&synctex,&SYNCTEX_FILE,synctex_DONT_ADD_QUOTES,&io_mode)) {\nreturn_on_error:\n\t\tfree(updater);\n        updater = NULL;\n\t\treturn NULL;\n\t}\n\t/*  OK, the file exists, we close it and reopen it with the correct mode.\n     *  The receiver is now the owner of the \"synctex\" variable. */\n\tgzclose(SYNCTEX_FILE);\n\tSYNCTEX_FILE = NULL;\n\tSYNCTEX_NO_GZ = (io_mode&synctex_io_gz_mask)?synctex_NO:synctex_YES;\n    mode = _synctex_get_io_mode_name(io_mode|synctex_io_append_mask);/* either \"a\" or \"ab\", depending on the file extension */\n\tif (SYNCTEX_NO_GZ) {\n\t\tif (NULL == (SYNCTEX_FILE = (void *)fopen(synctex,mode))) {\nno_write_error:\n\t\t\t_synctex_error(\"!  synctex_updater_new_with_file: Can't append to %s\",synctex);\n\t\t\tfree(synctex);\n\t\t\tgoto return_on_error;\n\t\t}\n\t\tupdater->fprintf = (synctex_fprintf_t)(&fprintf);\n\t} else {\n\t\tif (NULL == (SYNCTEX_FILE = (void *)gzopen(synctex,mode))) {\n\t\t\tgoto no_write_error;\n\t\t}\n\t\tupdater->fprintf = (synctex_fprintf_t)(&gzprintf);\n\t}\n\tprintf(\"SyncTeX: updating %s...\",synctex);\n\tfree(synctex);\n\treturn updater;\n}\n\n\nvoid synctex_updater_append_magnification(synctex_updater_t updater, char * magnification){\n\tif (NULL==updater) {\n\t\treturn;\n\t}\n\tif (magnification && strlen(magnification)) {\n\t\tupdater->length += SYNCTEX_fprintf(SYNCTEX_FILE,\"Magnification:%s\\n\",magnification);\n\t}\n}\n\nvoid synctex_updater_append_x_offset(synctex_updater_t updater, char * x_offset){\n\tif (NULL==updater) {\n\t\treturn;\n\t}\n\tif (x_offset && strlen(x_offset)) {\n\t\tupdater->length += SYNCTEX_fprintf(SYNCTEX_FILE,\"X Offset:%s\\n\",x_offset);\n\t}\n}\n\nvoid synctex_updater_append_y_offset(synctex_updater_t updater, char * y_offset){\n\tif (NULL==updater) {\n\t\treturn;\n\t}\n\tif (y_offset && strlen(y_offset)) {\n\t\tupdater->length += SYNCTEX_fprintf(SYNCTEX_FILE,\"Y Offset:%s\\n\",y_offset);\n\t}\n}\n\nvoid synctex_updater_free(synctex_updater_t updater){\n\tif (NULL==updater) {\n\t\treturn;\n\t}\n\tif (updater->length>0) {\n\t\tSYNCTEX_fprintf(SYNCTEX_FILE,\"!%i\\n\",updater->length);\n\t}\n\tif (SYNCTEX_NO_GZ) {\n\t\tfclose((FILE *)SYNCTEX_FILE);\n\t} else {\n\t\tgzclose((gzFile)SYNCTEX_FILE);\n\t}\n\tfree(updater);\n\tprintf(\"... done.\\n\");\n\treturn;\n}\n"
  },
  {
    "path": "ext/synctex/synctex_parser.h",
    "content": "/* \nCopyright (c) 2008, 2009, 2010 , 2011 jerome DOT laurens AT u-bourgogne DOT fr\n\nThis file is part of the SyncTeX package.\n\nLatest Revision: Tue Jun 14 08:23:30 UTC 2011\n\nVersion: 1.16\n\nSee synctex_parser_readme.txt for more details\n\nLicense:\n--------\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE\n\nExcept as contained in this notice, the name of the copyright holder  \nshall not be used in advertising or otherwise to promote the sale,  \nuse or other dealings in this Software without prior written  \nauthorization from the copyright holder.\n\nAcknowledgments:\n----------------\nThe author received useful remarks from the pdfTeX developers, especially Hahn The Thanh,\nand significant help from XeTeX developer Jonathan Kew\n\nNota Bene:\n----------\nIf you include or use a significant part of the synctex package into a software,\nI would appreciate to be listed as contributor and see \"SyncTeX\" highlighted.\n\nVersion 1\nThu Jun 19 09:39:21 UTC 2008\n\n*/\n\n#ifndef __SYNCTEX_PARSER__\n#   define __SYNCTEX_PARSER__\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/*  synctex_node_t is the type for all synctex nodes.\n *  The synctex file is parsed into a tree of nodes, either sheet, boxes, math nodes... */\ntypedef struct _synctex_node *  synctex_node_t;\n\n/*  The main synctex object is a scanner\n *  Its implementation is considered private.\n *  The basic workflow is\n * - create a \"synctex scanner\" with the contents of a file\n * - perform actions on that scanner like display or edit queries\n * - free the scanner when the work is done\n */\ntypedef struct __synctex_scanner_t _synctex_scanner_t;\ntypedef _synctex_scanner_t *  synctex_scanner_t;\n\n/*  This is the designated method to create a new synctex scanner object.\n *  output is the pdf/dvi/xdv file associated to the synctex file.\n *  If necessary, it can be the tex file that originated the synctex file\n *  but this might cause problems if the \\jobname has a custom value.\n *  Despite this method can accept a relative path in practice,\n *  you should only pass a full path name.\n *  The path should be encoded by the underlying file system,\n *  assuming that it is based on 8 bits characters, including UTF8,\n *  not 16 bits nor 32 bits.\n *  The last file extension is removed and replaced by the proper extension.\n *  Then the private method _synctex_scanner_new_with_contents_of_file is called.\n *  NULL is returned in case of an error or non existent file.\n *  Once you have a scanner, use the synctex_display_query and synctex_edit_query below.\n *\tThe new \"build_directory\" argument is available since version 1.5.\n *\tIt is the directory where all the auxiliary stuff is created.\n *\tSometimes, the synctex output file and the pdf, dvi or xdv files are not created in the same directory.\n *\tThis is the case in MikTeX (I will include this into TeX Live).\n *\tThis directory path can be nil, it will be ignored then.\n *\tIt can be either absolute or relative to the directory of the output pdf (dvi or xdv) file.\n *\tIf no synctex file is found in the same directory as the output file, then we try to find one in the build directory.\n *  Please note that this new \"build_directory\" is provided as a convenient argument but should not be used.\n *  In fact, this is implempented as a work around of a bug in MikTeX where the synctex file does not follow the pdf file.\n *  The new \"parse\" argument is available since version 1.5. In general, use 1.\n *  Use 0 only if you do not want to parse the content but just check the existence.\n */\nsynctex_scanner_t synctex_scanner_new_with_output_file(const char * output, const char * build_directory, int parse);\n\n/*  This is the designated method to delete a synctex scanner object.\n *  Frees all the memory, you must call it when you are finished with the scanner.\n */\nvoid synctex_scanner_free(synctex_scanner_t scanner);\n\n/*  Send this message to force the scanner to parse the contents of the synctex output file.\n *  Nothing is performed if the file was already parsed.\n *  In each query below, this message is sent, but if you need to access information more directly,\n *  you must be sure that the parsing did occur.\n *  Usage:\n *\t\tif((my_scanner = synctex_scanner_parse(my_scanner))) {\n *\t\t\tcontinue with my_scanner...\n *\t\t} else {\n *\t\t\tthere was a problem\n *\t\t}\n */\nsynctex_scanner_t synctex_scanner_parse(synctex_scanner_t scanner);\n\n/*  The main entry points.\n *  Given the file name, a line and a column number, synctex_display_query returns the number of nodes\n *  satisfying the contrain. Use code like\n *\n *     if(synctex_display_query(scanner,name,line,column)>0) {\n *         synctex_node_t node;\n *         while((node = synctex_next_result(scanner))) {\n *             // do something with node\n *             ...\n *         }\n *     }\n *\n *  For example, one can\n * - highlight each resulting node in the output, using synctex_node_h and synctex_node_v\n * - highlight all the rectangles enclosing those nodes, using synctex_box_... functions\n * - highlight just the character using that information\n *\n *  Given the page and the position in the page, synctex_edit_query returns the number of nodes\n *  satisfying the contrain. Use code like\n *\n *     if(synctex_edit_query(scanner,page,h,v)>0) {\n *         synctex_node_t node;\n *         while(node = synctex_next_result(scanner)) {\n *             // do something with node\n *             ...\n *         }\n *     }\n *\n *  For example, one can\n * - highlight each resulting line in the input,\n * - highlight just the character using that information\n *\n *  page is 1 based\n *  h and v are coordinates in 72 dpi unit, relative to the top left corner of the page.\n *  If you make a new query, the result of the previous one is discarded.\n *  If one of this function returns a non positive integer,\n *  it means that an error occurred.\n *\n *  Both methods are conservative, in the sense that matching is weak.\n *  If the exact column number is not found, there will be an answer with the whole line.\n *\n *  Sumatra-PDF, Skim, iTeXMac2 and Texworks are examples of open source software that use this library.\n *  You can browse their code for a concrete implementation.\n */\nint synctex_display_query(synctex_scanner_t scanner,const char *  name,int line,int column);\nint synctex_edit_query(synctex_scanner_t scanner,int page,float h,float v);\nsynctex_node_t synctex_next_result(synctex_scanner_t scanner);\n\n/*  Display all the information contained in the scanner object.\n *  If the records are too numerous, only the first ones are displayed.\n *  This is mainly for informatinal purpose to help developers.\n */\nvoid synctex_scanner_display(synctex_scanner_t scanner);\n\n/*  The x and y offset of the origin in TeX coordinates. The magnification\n   These are used by pdf viewers that want to display the real box size.\n   For example, getting the horizontal coordinates of a node would require\n   synctex_node_box_h(node)*synctex_scanner_magnification(scanner)+synctex_scanner_x_offset(scanner)\n   Getting its TeX width would simply require\n   synctex_node_box_width(node)*synctex_scanner_magnification(scanner)\n   but direct methods are available for that below.\n */\nint synctex_scanner_x_offset(synctex_scanner_t scanner);\nint synctex_scanner_y_offset(synctex_scanner_t scanner);\nfloat synctex_scanner_magnification(synctex_scanner_t scanner);\n\n/*  Managing the input file names.\n *  Given a tag, synctex_scanner_get_name will return the corresponding file name.\n *  Conversely, given a file name, synctex_scanner_get_tag will retur, the corresponding tag.\n *  The file name must be the very same as understood by TeX.\n *  For example, if you \\input myDir/foo.tex, the file name is myDir/foo.tex.\n *  No automatic path expansion is performed.\n *  Finally, synctex_scanner_input is the first input node of the scanner.\n *  To browse all the input node, use a loop like\n *\n *     if((input_node = synctex_scanner_input(scanner))){\n *         do {\n *             blah\n *         } while((input_node=synctex_node_sibling(input_node)));\n *     }\n *\n *  The output is the name that was used to create the scanner.\n *  The synctex is the real name of the synctex file,\n *  it was obtained from output by setting the proper file extension.\n */\nconst char * synctex_scanner_get_name(synctex_scanner_t scanner,int tag);\nint synctex_scanner_get_tag(synctex_scanner_t scanner,const char * name);\nsynctex_node_t synctex_scanner_input(synctex_scanner_t scanner);\nconst char * synctex_scanner_get_output(synctex_scanner_t scanner);\nconst char * synctex_scanner_get_synctex(synctex_scanner_t scanner);\n\n/*  Browsing the nodes\n *  parent, child and sibling are standard names for tree nodes.\n *  The parent is one level higher, the child is one level deeper,\n *  and the sibling is at the same level.\n *  The sheet of a node is the first ancestor, it is of type sheet.\n *  A node and its sibling have the same parent.\n *  A node is the parent of its child.\n *  A node is either the child of its parent,\n *  or belongs to the sibling chain of its parent's child.\n *  The next node is either the child, the sibling or the parent's sibling,\n *  unless the parent is a sheet.\n *  This allows to navigate through all the nodes of a given sheet node:\n *\n *     synctex_node_t node = sheet;\n *     while((node = synctex_node_next(node))) {\n *         // do something with node\n *     }\n *\n *  With synctex_sheet_content, you can retrieve the sheet node given the page.\n *  The page is 1 based, according to TeX standards.\n *  Conversely synctex_node_sheet allows to retrieve the sheet containing a given node.\n */\nsynctex_node_t synctex_node_parent(synctex_node_t node);\nsynctex_node_t synctex_node_sheet(synctex_node_t node);\nsynctex_node_t synctex_node_child(synctex_node_t node);\nsynctex_node_t synctex_node_sibling(synctex_node_t node);\nsynctex_node_t synctex_node_next(synctex_node_t node);\nsynctex_node_t synctex_sheet_content(synctex_scanner_t scanner,int page);\n\n/*  These are the types of the synctex nodes */\ntypedef enum {\n\tsynctex_node_type_error = 0,\n\tsynctex_node_type_input,\n\tsynctex_node_type_sheet,\n\tsynctex_node_type_vbox,\n\tsynctex_node_type_void_vbox,\n\tsynctex_node_type_hbox,\n\tsynctex_node_type_void_hbox,\n\tsynctex_node_type_kern,\n\tsynctex_node_type_glue,\n\tsynctex_node_type_math,\n\tsynctex_node_type_boundary,\n\tsynctex_node_number_of_types\n} synctex_node_type_t;\n\n/*  synctex_node_type gives the type of a given node,\n *  synctex_node_isa gives the same information as a human readable text. */\nsynctex_node_type_t synctex_node_type(synctex_node_t node);\nconst char * synctex_node_isa(synctex_node_t node);\n\n/*  This is primarily used for debugging purpose.\n *  The second one logs information for the node and recursively displays information for its next node */\nvoid synctex_node_log(synctex_node_t node);\nvoid synctex_node_display(synctex_node_t node);\n\n/*  Given a node, access to its tag, line and column.\n *  The line and column numbers are 1 based.\n *  The latter is not yet fully supported in TeX, the default implementation returns 0 which means the whole line.\n *  When the tag is known, the scanner of the node will give the corresponding file name.\n *  When the tag is known, the scanner of the node will give the name.\n */\nint synctex_node_tag(synctex_node_t node);\nint synctex_node_line(synctex_node_t node);\nint synctex_node_column(synctex_node_t node);\n\n/*  This is the page where the node appears.\n *  This is a 1 based index as given by TeX.\n */\nint synctex_node_page(synctex_node_t node);\n\n/*  For quite all nodes, horizontal, vertical coordinates, and width.\n *  These are expressed in TeX small points coordinates, with origin at the top left corner.\n */\nint synctex_node_h(synctex_node_t node);\nint synctex_node_v(synctex_node_t node);\nint synctex_node_width(synctex_node_t node);\n\n/*  For all nodes, dimensions of the enclosing box.\n *  These are expressed in TeX small points coordinates, with origin at the top left corner.\n *  A box is enclosing itself.\n */\nint synctex_node_box_h(synctex_node_t node);\nint synctex_node_box_v(synctex_node_t node);\nint synctex_node_box_width(synctex_node_t node);\nint synctex_node_box_height(synctex_node_t node);\nint synctex_node_box_depth(synctex_node_t node);\n\n/*  For quite all nodes, horizontal, vertical coordinates, and width.\n *  The visible dimensions are bigger than real ones to compensate 0 width boxes\n *  that do contain nodes.\n *  These are expressed in page coordinates, with origin at the top left corner.\n *  A box is enclosing itself.\n */\nfloat synctex_node_visible_h(synctex_node_t node);\nfloat synctex_node_visible_v(synctex_node_t node);\nfloat synctex_node_visible_width(synctex_node_t node);\n/*  For all nodes, visible dimensions of the enclosing box.\n *  A box is enclosing itself.\n *  The visible dimensions are bigger than real ones to compensate 0 width boxes\n *  that do contain nodes.\n */\nfloat synctex_node_box_visible_h(synctex_node_t node);\nfloat synctex_node_box_visible_v(synctex_node_t node);\nfloat synctex_node_box_visible_width(synctex_node_t node);\nfloat synctex_node_box_visible_height(synctex_node_t node);\nfloat synctex_node_box_visible_depth(synctex_node_t node);\n\n/*  The main synctex updater object.\n *  This object is used to append information to the synctex file.\n *  Its implementation is considered private.\n *  It is used by the synctex command line tool to take into account modifications\n *  that could occur while postprocessing files by dvipdf like filters.\n */\ntypedef struct __synctex_updater_t _synctex_updater_t;\ntypedef _synctex_updater_t * synctex_updater_t;\n\n/*  Designated initializer.\n *  Once you are done with your whole job,\n *  free the updater */\nsynctex_updater_t synctex_updater_new_with_output_file(const char * output, const char * directory);\n\n/*  Use the next functions to append records to the synctex file,\n *  no consistency tests made on the arguments */\nvoid synctex_updater_append_magnification(synctex_updater_t updater, char *  magnification);\nvoid synctex_updater_append_x_offset(synctex_updater_t updater, char *  x_offset);\nvoid synctex_updater_append_y_offset(synctex_updater_t updater, char *  y_offset);\n\n/*  You MUST free the updater, once everything is properly appended */\nvoid synctex_updater_free(synctex_updater_t updater);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "ext/synctex/synctex_parser_local.h",
    "content": "/* \nCopyright (c) 2008, 2009, 2010 , 2011 jerome DOT laurens AT u-bourgogne DOT fr\n\nThis file is part of the SyncTeX package.\n\nLatest Revision: Tue Jun 14 08:23:30 UTC 2011\n\nVersion: 1.16\n\nSee synctex_parser_readme.txt for more details\n\nLicense:\n--------\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE\n\nExcept as contained in this notice, the name of the copyright holder  \nshall not be used in advertising or otherwise to promote the sale,  \nuse or other dealings in this Software without prior written  \nauthorization from the copyright holder.\n\n*/\n\n/* This local header file is for TEXLIVE, use your own header to fit your system */\n#   include <w2c/c-auto.h> /* for inline && HAVE_xxx */\n/*\tNo inlining for synctex tool in texlive. */\n#\tdefine SYNCTEX_INLINE\n"
  },
  {
    "path": "ext/synctex/synctex_parser_readme.txt",
    "content": "This file is part of the SyncTeX package.\n\nThe Synchronization TeXnology named SyncTeX is a new feature\nof recent TeX engines designed by Jerome Laurens.\nIt allows to synchronize between input and output, which means to\nnavigate from the source document to the typeset material and vice versa.\nMore informations on http://itexmac2.sourceforge.net/SyncTeX.html\n\nThis package is mainly for developers, it mainly contains the following files:\n\nsynctex_parser_readme.txt\nsynctex_parser_version.txt\nsynctex_parser_utils.c\nsynctex_parser_utils.h\nsynctex_parser_local.h\nsynctex_parser.h\nsynctex_parser.c\n\nThe file you are reading contains more informations about the SyncTeX parser history.\n\nIn order to support SyncTeX in a viewer, it is sufficient to include\nin the source the files synctex_parser.h and synctex_parser.c.\nThe synctex parser usage is described in synctex_parser.h header file.\n\nThe other files are used by tex engines or by the synctex command line utility:\n\nChangeLog\nREADME.txt\nam\nman1\nman5\nsynctex-common.h\nsynctex-convert.sh\nsynctex-e-mem.ch0\nsynctex-e-mem.ch1\nsynctex-e-rec.ch0\nsynctex-e-rec.ch1\nsynctex-etex.h\nsynctex-mem.ch0\nsynctex-mem.ch1\nsynctex-mem.ch2\nsynctex-pdf-rec.ch2\nsynctex-pdftex.h\nsynctex-rec.ch0\nsynctex-rec.ch1\nsynctex-rec.ch2\nsynctex-tex.h\nsynctex-xe-mem.ch2\nsynctex-xe-rec.ch2\nsynctex-xe-rec.ch3\nsynctex-xetex.h\nsynctex.c\nsynctex.defines\nsynctex.h\nsynctex_main.c\ntests\n\n\nVersion:\n--------\nThis is version 1, which refers to the synctex output file format.\nThe files are identified by a build number.\nIn order to help developers to automatically manage the version and build numbers\nand download the parser only when necessary, the synctex_parser.version\nis an ASCII text file just containing the current version and build numbers.\n\nHistory:\n--------\n1.1: Thu Jul 17 09:28:13 UTC 2008\n- First official version available in TeXLive 2008 DVD.\n  Unfortunately, the backwards synchronization is not working properly mainly for ConTeXt users, see below.\n1.2: Tue Sep  2 10:28:32 UTC 2008\n- Correction for ConTeXt support in the edit query.\n  The previous method was assuming that TeX boxes do not overlap,\n  which is reasonable for LaTeX but not for ConTeXt.\n  This assumption is no longer considered.\n1.3: Fri Sep  5 09:39:57 UTC 2008\n- Local variable \"read\" renamed to \"already_read\" to avoid conflicts.\n- \"inline\" compiler directive renamed to \"SYNCTEX_INLINE\" for code support and maintenance\n- _synctex_error cannot be inlined due to variable arguments (thanks Christiaan Hofman)\n- Correction in the display query, extra boundary nodes are used for a more precise forwards synchronization\n1.4: Fri Sep 12 08:12:34 UTC 2008\n- For an unknown reason, the previous version was not the real 1.3 (as used in iTeXMac2 build 747).\n  As a consequence, a crash was observed.\n- Some typos are fixed.\n1.6: Mon Nov  3 20:20:02 UTC 2008\n- The bug that prevented synchronization with compressed files on windows has been fixed.\n- New interface to allow system specific customization.\n- Note that some APIs have changed.\n1.8: Mer  8 jul 2009 11:32:38 UTC\nNote that version 1.7 was delivered privately.\n- bug fix: synctex was causing a memory leak in pdftex and xetex, thus some processing speed degradation\n- bug fix: the synctex command line tool was broken when updating a .synctex file\n- enhancement: better accuracy of the synchronization process\n- enhancement: the pdf output file and the associated .synctex file no longer need to live in the same directory.\n               The new -d option of the synctex command line tool manages this situation.\n               This is handy when using something like tex -output-directory=DIR ...\n1.9: Wed Nov  4 11:52:35 UTC 2009\n- Various typo fixed\n- OutputDebugString replaced by OutputDebugStringA to deliberately disable unicode preprocessing\n- New conditional created because OutputDebugStringA is only available since Windows 2K professional\n1.10: Sun Jan  10 10:12:32 UTC 2010 \n- Bug fix in synctex_parser.c to solve a synchronization problem with amsmath's gather environment.\n  Concerns the synctex tool.\n1.11: Sun Jan  17 09:12:31 UTC 2010\n- Bug fix in synctex_parser.c, function synctex_node_box_visible_v: 'x' replaced by 'y'.\n  Only 3rd party tools are concerned.\n1.12: Mon Jul 19 21:52:10 UTC 2010\n- Bug fix in synctex_parser.c, function __synctex_open: the io_mode was modified even in case of a non zero return,\ncausing a void .synctex.gz file to be created even if it was not expected. Reported by Marek Kasik concerning a bug on evince.\n1.13: Fri Mar 11 07:39:12 UTC 2011\n- Bug fix in synctex_parser.c, better synchronization as suggested by Jan Sundermeyer (near line 3388).\n- Stronger code design in synctex_parser_utils.c, function _synctex_get_name (really neutral behavior).\n  Only 3rd party tools are concerned.\n1.14: Fri Apr 15 19:10:57 UTC 2011\n- taking output_directory into account\n- Replaced FOPEN_WBIN_MODE by FOPEN_W_MODE when opening the text version of the .synctex file.\n- Merging with LuaTeX's version of synctex.c\n1.15: Fri Jun 10 14:10:17 UTC 2011\nThis concerns the synctex command line tool and 3rd party developers.\nTeX and friends are not concerned by these changes.\n- Bug fixed in _synctex_get_io_mode_name, sometimes the wrong mode was returned\n- Support for LuaTeX convention of './' file prefixing\n1.16: Tue Jun 14 08:23:30 UTC 2011\nThis concerns the synctex command line tool and 3rd party developers.\nTeX and friends are not concerned by these changes.\n- Better forward search (thanks Jose Alliste)\n- Support for LuaTeX convention of './' file prefixing now for everyone, not only for Windows\n\nAcknowledgments:\n----------------\nThe author received useful remarks from the pdfTeX developers, especially Hahn The Thanh,\nand significant help from XeTeX developer Jonathan Kew\n\nNota Bene:\n----------\nIf you include or use a significant part of the synctex package into a software,\nI would appreciate to be listed as contributor and see \"SyncTeX\" highlighted.\n\nCopyright (c) 2008-2011 jerome DOT laurens AT u-bourgogne DOT fr\n\n"
  },
  {
    "path": "ext/synctex/synctex_parser_utils.c",
    "content": "/* \nCopyright (c) 2008, 2009, 2010 , 2011 jerome DOT laurens AT u-bourgogne DOT fr\n\nThis file is part of the SyncTeX package.\n\nLatest Revision: Tue Jun 14 08:23:30 UTC 2011\n\nVersion: 1.16\n\nSee synctex_parser_readme.txt for more details\n\nLicense:\n--------\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE\n\nExcept as contained in this notice, the name of the copyright holder  \nshall not be used in advertising or otherwise to promote the sale,  \nuse or other dealings in this Software without prior written  \nauthorization from the copyright holder.\n\n*/\n\n/*  In this file, we find all the functions that may depend on the operating system. */\n\n#include <synctex_parser_utils.h>\n#include <stdlib.h>\n#include <string.h>\n#include <stdarg.h>\n#include <stdio.h>\n\n#include <limits.h>\n#include <ctype.h>\n#include <string.h>\n\n#include <sys/stat.h>\n\n#if defined(_WIN32) || defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__)\n#define SYNCTEX_WINDOWS 1\n#endif\n\n#ifdef _WIN32_WINNT_WINXP\n#define SYNCTEX_RECENT_WINDOWS 1\n#endif\n\n#ifdef SYNCTEX_WINDOWS\n#include <windows.h>\n#endif\n\nvoid *_synctex_malloc(size_t size) {\n\tvoid * ptr = malloc(size);\n\tif(ptr) {\n/*  There used to be a switch to use bzero because it is more secure. JL */\n\t\tmemset(ptr,0, size);\n\t}\n\treturn (void *)ptr;\n}\n\nint _synctex_error(const char * reason,...) {\n\tva_list arg;\n\tint result;\n\tva_start (arg, reason);\n#\tifdef SYNCTEX_RECENT_WINDOWS\n\t{/*\tThis code is contributed by William Blum.\n        As it does not work on some older computers,\n        the _WIN32 conditional here is replaced with a SYNCTEX_RECENT_WINDOWS one.\n        According to http://msdn.microsoft.com/en-us/library/aa363362(VS.85).aspx\n        Minimum supported client\tWindows 2000 Professional\n        Minimum supported server\tWindows 2000 Server\n        People running Windows 2K standard edition will not have OutputDebugStringA.\n        JL.*/\n\t\tchar *buff;\n\t\tsize_t len;\n\t\tOutputDebugStringA(\"SyncTeX ERROR: \");\n\t\tlen = _vscprintf(reason, arg) + 1;\n\t\tbuff = (char*)malloc( len * sizeof(char) );\n\t\tresult = vsprintf(buff, reason, arg) +strlen(\"SyncTeX ERROR: \");\n\t\tOutputDebugStringA(buff);\n\t\tOutputDebugStringA(\"\\n\");\n\t\tfree(buff);\n\t}\n#   else\n\tresult = fprintf(stderr,\"SyncTeX ERROR: \");\n\tresult += vfprintf(stderr, reason, arg);\n\tresult += fprintf(stderr,\"\\n\");\n#   endif\n\tva_end (arg);\n\treturn result;\n}\n\n/*  strip the last extension of the given string, this string is modified! */\nvoid _synctex_strip_last_path_extension(char * string) {\n\tif(NULL != string){\n\t\tchar * last_component = NULL;\n\t\tchar * last_extension = NULL;\n\t\tchar * next = NULL;\n\t\t/*  first we find the last path component */\n\t\tif(NULL == (last_component = strstr(string,\"/\"))){\n\t\t\tlast_component = string;\n\t\t} else {\n\t\t\t++last_component;\n\t\t\twhile((next = strstr(last_component,\"/\"))){\n\t\t\t\tlast_component = next+1;\n\t\t\t}\n\t\t}\n#       ifdef\tSYNCTEX_WINDOWS\n\t\t/*  On Windows, the '\\' is also a path separator. */\n\t\twhile((next = strstr(last_component,\"\\\\\"))){\n\t\t\tlast_component = next+1;\n\t\t}\n#       endif\n\t\t/*  then we find the last path extension */\n\t\tif((last_extension = strstr(last_component,\".\"))){\n\t\t\t++last_extension;\n\t\t\twhile((next = strstr(last_extension,\".\"))){\n\t\t\t\tlast_extension = next+1;\n\t\t\t}\n\t\t\t--last_extension;/*  back to the \".\" */\n\t\t\tif(last_extension>last_component){/*  filter out paths like ....my/dir/.hidden\"*/\n\t\t\t\tlast_extension[0] = '\\0';\n\t\t\t}\n\t\t}\n\t}\n}\n\nconst char * synctex_ignore_leading_dot_slash(const char * name)\n{\n    while(SYNCTEX_IS_DOT(*name) && SYNCTEX_IS_PATH_SEPARATOR(name[1])) {\n        name += 2;\n        while (SYNCTEX_IS_PATH_SEPARATOR(*name)) {\n            ++name;\n        }\n    }\n    return name;\n}\n\n/*  Compare two file names, windows is sometimes case insensitive... */\nsynctex_bool_t _synctex_is_equivalent_file_name(const char *lhs, const char *rhs) {\n    /*  Remove the leading regex '(\\./+)*' in both rhs and lhs */\n    lhs = synctex_ignore_leading_dot_slash(lhs);\n    rhs = synctex_ignore_leading_dot_slash(rhs);\n#\tif SYNCTEX_WINDOWS\n    /*  On Windows, filename should be compared case insensitive.\n\t *  The characters '/' and '\\' are both valid path separators.\n\t *  There will be a very serious problem concerning UTF8 because\n\t *  not all the characters must be toupper...\n\t *  I would like to have URL's instead of filenames. */\nnext_character:\n\tif(SYNCTEX_IS_PATH_SEPARATOR(*lhs)) {/*  lhs points to a path separator */\n\t\tif(!SYNCTEX_IS_PATH_SEPARATOR(*rhs)) {/*  but not rhs */\n\t\t\treturn synctex_NO;\n\t\t}\n\t\t/* SumatraPDF: ignore spurious \"./\" parts (caused by TeXlive 2011) */\n\t\tlhs = synctex_ignore_leading_dot_slash(lhs + 1) - 1;\n\t\trhs = synctex_ignore_leading_dot_slash(rhs + 1) - 1;\n\t} else if(SYNCTEX_IS_PATH_SEPARATOR(*rhs)) {/*  rhs points to a path separator but not lhs */\n\t\treturn synctex_NO;\n\t} else if(toupper(*lhs) != toupper(*rhs)){/*  uppercase do not match */\n\t\treturn synctex_NO;\n\t} else if (!*lhs) {/*  lhs is at the end of the string */\n\t\treturn *rhs ? synctex_NO : synctex_YES;\n\t} else if(!*rhs) {/*  rhs is at the end of the string but not lhs */\n\t\treturn synctex_NO;\n\t}\n\t++lhs;\n\t++rhs;\n\tgoto next_character;\n#\telse\n    return 0 == strcmp(lhs,rhs)?synctex_YES:synctex_NO;\n#\tendif\n}\n\nsynctex_bool_t _synctex_path_is_absolute(const char * name) {\n\tif(!strlen(name)) {\n\t\treturn synctex_NO;\n\t}\n#\tif SYNCTEX_WINDOWS\n\tif(strlen(name)>2) {\n\t\treturn (name[1]==':' && SYNCTEX_IS_PATH_SEPARATOR(name[2]))?synctex_YES:synctex_NO;\n\t}\n\treturn synctex_NO;\n#\telse\n    return SYNCTEX_IS_PATH_SEPARATOR(name[0])?synctex_YES:synctex_NO;\n#\tendif\n}\n\n/*  We do not take care of UTF-8 */\nconst char * _synctex_last_path_component(const char * name) {\n\tconst char * c = name+strlen(name);\n\tif(c>name) {\n\t\tif(!SYNCTEX_IS_PATH_SEPARATOR(*c)) {\n\t\t\tdo {\n\t\t\t\t--c;\n\t\t\t\tif(SYNCTEX_IS_PATH_SEPARATOR(*c)) {\n\t\t\t\t\treturn c+1;\n\t\t\t\t}\n\t\t\t} while(c>name);\n\t\t}\n\t\treturn c;/* the last path component is the void string*/\n\t}\n\treturn c;\n}\n\nint _synctex_copy_with_quoting_last_path_component(const char * src, char ** dest_ref, size_t size) {\n  const char * lpc;\n  if(src && dest_ref) {\n#\t\tdefine dest (*dest_ref)\n\t\tdest = NULL;\t/*\tDefault behavior: no change and sucess. */\n\t\tlpc = _synctex_last_path_component(src);\n\t\tif(strlen(lpc)) {\n\t\t\tif(strchr(lpc,' ') && lpc[0]!='\"' && lpc[strlen(lpc)-1]!='\"') {\n\t\t\t\t/*\tWe are in the situation where adding the quotes is allowed.\t*/\n\t\t\t\t/*\tTime to add the quotes.\t*/\n\t\t\t\t/*  Consistency test: we must have dest+size>dest+strlen(dest)+2\n\t\t\t\t *\tor equivalently: strlen(dest)+2<size (see below) */\n\t\t\t\tif(strlen(src)<size) {\n\t\t\t\t\tif((dest = (char *)malloc(size+2))) {\n\t\t\t\t\t\tchar * dpc = dest + (lpc-src);\t/*\tdpc is the last path component of dest.\t*/\n\t\t\t\t\t\tif(dest != strncpy(dest,src,size)) {\n\t\t\t\t\t\t\t_synctex_error(\"!  _synctex_copy_with_quoting_last_path_component: Copy problem\");\n\t\t\t\t\t\t\tfree(dest);\n\t\t\t\t\t\t\tdest = NULL;/*  Don't forget to reinitialize. */\n\t\t\t\t\t\t\treturn -2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmemmove(dpc+1,dpc,strlen(dpc)+1);\t/*\tAlso move the null terminating character. */\n\t\t\t\t\t\tdpc[0]='\"';\n\t\t\t\t\t\tdpc[strlen(dpc)+1]='\\0';/*\tConsistency test */\n\t\t\t\t\t\tdpc[strlen(dpc)]='\"';\n\t\t\t\t\t\treturn 0;\t/*\tSuccess. */\n\t\t\t\t\t}\n\t\t\t\t\treturn -1;\t/*\tMemory allocation error.\t*/\n\t\t\t\t}\n\t\t\t\t_synctex_error(\"!  _synctex_copy_with_quoting_last_path_component: Internal inconsistency\");\n\t\t\t\treturn -3;\n\t\t\t}\n\t\t\treturn 0;\t/*\tSuccess. */\n\t\t}\n\t\treturn 0;\t/*\tNo last path component. */\n#\t\tundef dest\n\t}\n\treturn 1; /*  Bad parameter, this value is subject to changes. */\n}\n\n/*  The client is responsible of the management of the returned string, if any. */\nchar * _synctex_merge_strings(const char * first,...);\n\nchar * _synctex_merge_strings(const char * first,...) {\n\tva_list arg;\n\tsize_t size = 0;\n\tconst char * temp;\n\t/*   First retrieve the size necessary to store the merged string */\n\tva_start (arg, first);\n\ttemp = first;\n\tdo {\n\t\tsize_t len = strlen(temp);\n\t\tif(UINT_MAX-len<size) {\n\t\t\t_synctex_error(\"!  _synctex_merge_strings: Capacity exceeded.\");\n\t\t\treturn NULL;\n\t\t}\n\t\tsize+=len;\n\t} while( (temp = va_arg(arg, const char *)) != NULL);\n\tva_end(arg);\n\tif(size>0) {\n\t\tchar * result = NULL;\n\t\t++size;\n\t\t/*  Create the memory storage */\n\t\tif(NULL!=(result = (char *)malloc(size))) {\n\t\t\tchar * dest = result;\n\t\t\tva_start (arg, first);\n\t\t\ttemp = first;\n\t\t\tdo {\n\t\t\t\tif((size = strlen(temp))>0) {\n\t\t\t\t\t/*  There is something to merge */\n\t\t\t\t\tif(dest != strncpy(dest,temp,size)) {\n\t\t\t\t\t\t_synctex_error(\"!  _synctex_merge_strings: Copy problem\");\n\t\t\t\t\t\tfree(result);\n\t\t\t\t\t\tresult = NULL;\n\t\t\t\t\t\treturn NULL;\n\t\t\t\t\t}\n\t\t\t\t\tdest += size;\n\t\t\t\t}\n\t\t\t} while( (temp = va_arg(arg, const char *)) != NULL);\n\t\t\tva_end(arg);\n\t\t\tdest[0]='\\0';/*  Terminate the merged string */\n\t\t\treturn result;\n\t\t}\n\t\t_synctex_error(\"!  _synctex_merge_strings: Memory problem\");\n\t\treturn NULL;\n\t}\n\treturn NULL;\t\n}\n\n/*  The purpose of _synctex_get_name is to find the name of the synctex file.\n *  There is a list of possible filenames from which we return the most recent one and try to remove all the others.\n *  With two runs of pdftex or xetex we are sure the the synctex file is really the most appropriate.\n */\nint _synctex_get_name(const char * output, const char * build_directory, char ** synctex_name_ref, synctex_io_mode_t * io_mode_ref)\n{\n\tif(output && synctex_name_ref && io_mode_ref) {\n\t\t/*  If output is already absolute, we just have to manage the quotes and the compress mode */\n\t\tsize_t size = 0;\n        char * synctex_name = NULL;\n        synctex_io_mode_t io_mode = *io_mode_ref;\n\t\tconst char * base_name = _synctex_last_path_component(output); /*  do not free, output is the owner. base name of output*/\n\t\t/*  Do we have a real base name ? */\n\t\tif(strlen(base_name)>0) {\n\t\t\t/*  Yes, we do. */\n\t\t\tconst char * temp = NULL;\n\t\t\tchar * core_name = NULL; /*  base name of output without path extension. */\n\t\t\tchar * dir_name = NULL; /*  dir name of output */\n\t\t\tchar * quoted_core_name = NULL;\n\t\t\tchar * basic_name = NULL;\n\t\t\tchar * gz_name = NULL;\n\t\t\tchar * quoted_name = NULL;\n\t\t\tchar * quoted_gz_name = NULL;\n\t\t\tchar * build_name = NULL;\n\t\t\tchar * build_gz_name = NULL;\n\t\t\tchar * build_quoted_name = NULL;\n\t\t\tchar * build_quoted_gz_name = NULL;\n\t\t\tstruct stat buf;\n\t\t\ttime_t the_time = 0;\n\t\t\t/*  Create core_name: let temp point to the dot before the path extension of base_name;\n\t\t\t *  We start form the \\0 terminating character and scan the string upward until we find a dot.\n\t\t\t *  The leading dot is not accepted. */\n\t\t\tif((temp = strrchr(base_name,'.')) && (size = temp - base_name)>0) {\n\t\t\t\t/*  There is a dot and it is not at the leading position    */\n\t\t\t\tif(NULL == (core_name = (char *)malloc(size+1))) {\n\t\t\t\t\t_synctex_error(\"!  _synctex_get_name: Memory problem 1\");\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\tif(core_name != strncpy(core_name,base_name,size)) {\n\t\t\t\t\t_synctex_error(\"!  _synctex_get_name: Copy problem 1\");\n\t\t\t\t\tfree(core_name);\n\t\t\t\t\tdir_name = NULL;\n\t\t\t\t\treturn -2;\n\t\t\t\t}\n\t\t\t\tcore_name[size] = '\\0';\n\t\t\t} else {\n\t\t\t\t/*  There is no path extension,\n\t\t\t\t *  Just make a copy of base_name */\n\t\t\t\tcore_name = _synctex_merge_strings(base_name);\n\t\t\t}\n\t\t\t/*  core_name is properly set up, owned by \"self\". */\n\t\t\t/*  creating dir_name. */\n\t\t\tsize = strlen(output)-strlen(base_name);\n\t\t\tif(size>0) {\n\t\t\t\t/*  output contains more than one path component */\n\t\t\t\tif(NULL == (dir_name = (char *)malloc(size+1))) {\n\t\t\t\t\t_synctex_error(\"!  _synctex_get_name: Memory problem\");\n\t\t\t\t\tfree(core_name);\n\t\t\t\t\tdir_name = NULL;\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\tif(dir_name != strncpy(dir_name,output,size)) {\n\t\t\t\t\t_synctex_error(\"!  _synctex_get_name: Copy problem\");\n\t\t\t\t\tfree(dir_name);\n\t\t\t\t\tdir_name = NULL;\n\t\t\t\t\tfree(core_name);\n\t\t\t\t\tdir_name = NULL;\n\t\t\t\t\treturn -2;\n\t\t\t\t}\n\t\t\t\tdir_name[size] = '\\0';\n\t\t\t}\n\t\t\t/*  dir_name is properly set up. It ends with a path separator, if non void. */\n\t\t\t/*  creating quoted_core_name. */\n\t\t\tif(strchr(core_name,' ')) {\n\t\t\t\tquoted_core_name = _synctex_merge_strings(\"\\\"\",core_name,\"\\\"\");\n\t\t\t}\n\t\t\t/*  quoted_core_name is properly set up. */\n\t\t\tif(dir_name &&strlen(dir_name)>0) {\n\t\t\t\tbasic_name = _synctex_merge_strings(dir_name,core_name,synctex_suffix,NULL);\n\t\t\t\tif(quoted_core_name && strlen(quoted_core_name)>0) {\n\t\t\t\t\tquoted_name = _synctex_merge_strings(dir_name,quoted_core_name,synctex_suffix,NULL);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbasic_name = _synctex_merge_strings(core_name,synctex_suffix,NULL);\n\t\t\t\tif(quoted_core_name && strlen(quoted_core_name)>0) {\n\t\t\t\t\tquoted_name = _synctex_merge_strings(quoted_core_name,synctex_suffix,NULL);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!_synctex_path_is_absolute(output) && build_directory && (size = strlen(build_directory))) {\n\t\t\t\ttemp = build_directory + size - 1;\n\t\t\t\tif(_synctex_path_is_absolute(temp)) {\n\t\t\t\t\tbuild_name = _synctex_merge_strings(build_directory,basic_name,NULL);\n\t\t\t\t\tif(quoted_core_name && strlen(quoted_core_name)>0) {\n\t\t\t\t\t\tbuild_quoted_name = _synctex_merge_strings(build_directory,quoted_name,NULL);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tbuild_name = _synctex_merge_strings(build_directory,\"/\",basic_name,NULL);\n\t\t\t\t\tif(quoted_core_name && strlen(quoted_core_name)>0) {\n\t\t\t\t\t\tbuild_quoted_name = _synctex_merge_strings(build_directory,\"/\",quoted_name,NULL);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(basic_name) {\n\t\t\t\tgz_name = _synctex_merge_strings(basic_name,synctex_suffix_gz,NULL);\n\t\t\t}\n\t\t\tif(quoted_name) {\n\t\t\t\tquoted_gz_name = _synctex_merge_strings(quoted_name,synctex_suffix_gz,NULL);\n\t\t\t}\n\t\t\tif(build_name) {\n\t\t\t\tbuild_gz_name = _synctex_merge_strings(build_name,synctex_suffix_gz,NULL);\n\t\t\t}\n\t\t\tif(build_quoted_name) {\n\t\t\t\tbuild_quoted_gz_name = _synctex_merge_strings(build_quoted_name,synctex_suffix_gz,NULL);\n\t\t\t}\n\t\t\t/*  All the others names are properly set up... */\n\t\t\t/*  retain the most recently modified file */\n#\t\t\tdefine TEST(FILENAME,COMPRESS_MODE) \\\n\t\t\tif(FILENAME) {\\\n\t\t\t\tif (stat(FILENAME, &buf)) { \\\n\t\t\t\t\tfree(FILENAME);\\\n\t\t\t\t\tFILENAME = NULL;\\\n\t\t\t\t} else if (buf.st_mtime>the_time) { \\\n                    the_time=buf.st_mtime; \\\n                    synctex_name = FILENAME; \\\n                    if (COMPRESS_MODE) { \\\n                        io_mode |= synctex_io_gz_mask; \\\n                    } else { \\\n                        io_mode &= ~synctex_io_gz_mask; \\\n                    } \\\n\t\t\t\t} \\\n\t\t\t}\n\t\t\tTEST(basic_name,synctex_DONT_COMPRESS);\n\t\t\tTEST(gz_name,synctex_COMPRESS);\n\t\t\tTEST(quoted_name,synctex_DONT_COMPRESS);\n\t\t\tTEST(quoted_gz_name,synctex_COMPRESS);\n\t\t\tTEST(build_name,synctex_DONT_COMPRESS);\n\t\t\tTEST(build_gz_name,synctex_COMPRESS);\n\t\t\tTEST(build_quoted_name,synctex_DONT_COMPRESS);\n\t\t\tTEST(build_quoted_gz_name,synctex_COMPRESS);\n#\t\t\tundef TEST\n\t\t\t/*  Free all the intermediate filenames, except the one that will be used as returned value. */\n#\t\t\tdefine CLEAN_AND_REMOVE(FILENAME) \\\n\t\t\tif(FILENAME && (FILENAME!=synctex_name)) {\\\n\t\t\t\tremove(FILENAME);\\\n\t\t\t\tprintf(\"synctex tool info: %s removed\\n\",FILENAME);\\\n\t\t\t\tfree(FILENAME);\\\n\t\t\t\tFILENAME = NULL;\\\n\t\t\t}\n\t\t\tCLEAN_AND_REMOVE(basic_name);\n\t\t\tCLEAN_AND_REMOVE(gz_name);\n\t\t\tCLEAN_AND_REMOVE(quoted_name);\n\t\t\tCLEAN_AND_REMOVE(quoted_gz_name);\n\t\t\tCLEAN_AND_REMOVE(build_name);\n\t\t\tCLEAN_AND_REMOVE(build_gz_name);\n\t\t\tCLEAN_AND_REMOVE(build_quoted_name);\n\t\t\tCLEAN_AND_REMOVE(build_quoted_gz_name);\n#\t\t\tundef CLEAN_AND_REMOVE\n            /* set up the returned values */\n            * synctex_name_ref = synctex_name;\n            * io_mode_ref = io_mode;\n\t\t\treturn 0;\n\t\t}\n\t\treturn -1;/*  bad argument */\n\t}\n\treturn -2;\n}\n\nconst char * _synctex_get_io_mode_name(synctex_io_mode_t io_mode) {\n    static const char * synctex_io_modes[4] = {\"r\",\"rb\",\"a\",\"ab\"}; \n    unsigned index = ((io_mode & synctex_io_gz_mask)?1:0) + ((io_mode & synctex_io_append_mask)?2:0);// bug pointed out by Jose Alliste\n    return synctex_io_modes[index];\n}\n"
  },
  {
    "path": "ext/synctex/synctex_parser_utils.h",
    "content": "/* \nCopyright (c) 2008, 2009, 2010, 2011 jerome DOT laurens AT u-bourgogne DOT fr\n\nThis file is part of the SyncTeX package.\n\nLatest Revision: Tue Jun 14 08:23:30 UTC 2011\n\nVersion: 1.16\n\nSee synctex_parser_readme.txt for more details\n\nLicense:\n--------\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE\n\nExcept as contained in this notice, the name of the copyright holder  \nshall not be used in advertising or otherwise to promote the sale,  \nuse or other dealings in this Software without prior written  \nauthorization from the copyright holder.\n\n*/\n\n/*  The utilities declared here are subject to conditional implementation.\n *  All the operating system special stuff goes here.\n *  The problem mainly comes from file name management: path separator, encoding...\n */\n\n#\tdefine synctex_bool_t int\n#\tdefine synctex_YES -1\n#\tdefine synctex_ADD_QUOTES -1\n#\tdefine synctex_COMPRESS -1\n#\tdefine synctex_NO 0\n#\tdefine synctex_DONT_ADD_QUOTES 0\n#\tdefine synctex_DONT_COMPRESS 0\n\n#ifndef __SYNCTEX_PARSER_UTILS__\n#   define __SYNCTEX_PARSER_UTILS__\n\n#include <stdlib.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#\tif _WIN32\n#\t\tdefine SYNCTEX_IS_PATH_SEPARATOR(c) ('/' == c || '\\\\' == c)\n#\telse\n#\t\tdefine SYNCTEX_IS_PATH_SEPARATOR(c) ('/' == c)\n#\tendif\n    \n#\tif _WIN32\n#\t\tdefine SYNCTEX_IS_DOT(c) ('.' == c)\n#\telse\n#\t\tdefine SYNCTEX_IS_DOT(c) ('.' == c)\n#\tendif\n    \n/*  This custom malloc functions initializes to 0 the newly allocated memory.\n *  There is no bzero function on windows. */\nvoid *_synctex_malloc(size_t size);\n\n/*  This is used to log some informational message to the standard error stream.\n *  On Windows, the stderr stream is not exposed and another method is used.\n *\tThe return value is the number of characters printed.\t*/\nint _synctex_error(const char * reason,...);\n\n/*  strip the last extension of the given string, this string is modified!\n *  This function depends on the OS because the path separator may differ.\n *  This should be discussed more precisely. */\nvoid _synctex_strip_last_path_extension(char * string);\n\n/*  Compare two file names, windows is sometimes case insensitive...\n *  The given strings may differ stricto sensu, but represent the same file name.\n *  It might not be the real way of doing things.\n *  The return value is an undefined non 0 value when the two file names are equivalent.\n *  It is 0 otherwise. */\nsynctex_bool_t _synctex_is_equivalent_file_name(const char *lhs, const char *rhs);\n\n/*\tDescription forthcoming.*/\nsynctex_bool_t _synctex_path_is_absolute(const char * name);\n\n/*\tDescription forthcoming...*/\nconst char * _synctex_last_path_component(const char * name);\n\n/*\tIf the core of the last path component of src is not already enclosed with double quotes ('\"')\n *  and contains a space character (' '), then a new buffer is created, the src is copied and quotes are added.\n *\tIn all other cases, no destination buffer is created and the src is not copied.\n *  0 on success, which means no error, something non 0 means error, mainly due to memory allocation failure, or bad parameter.\n *  This is used to fix a bug in the first version of pdftex with synctex (1.40.9) for which names with spaces\n *  were not managed in a standard way.\n *  On success, the caller owns the buffer pointed to by dest_ref (is any) and\n *  is responsible of freeing the memory when done.\n *\tThe size argument is the size of the src buffer. On return the dest_ref points to a buffer sized size+2.*/\nint _synctex_copy_with_quoting_last_path_component(const char * src, char ** dest_ref, size_t size);\n\n/*  These are the possible extensions of the synctex file */\nextern const char * synctex_suffix;\nextern const char * synctex_suffix_gz;\n\ntypedef unsigned int synctex_io_mode_t;\n\ntypedef enum {\n\tsynctex_io_append_mask = 1,\n    synctex_io_gz_mask = synctex_io_append_mask<<1\n} synctex_io_mode_masks_t;\n\ntypedef enum {\n\tsynctex_compress_mode_none = 0,\n\tsynctex_compress_mode_gz = 1\n} synctex_compress_mode_t;\n\nint _synctex_get_name(const char * output, const char * build_directory, char ** synctex_name_ref, synctex_io_mode_t * io_mode_ref);\n\n/*  returns the correct mode required by fopen and gzopen from the given io_mode */\nconst char * _synctex_get_io_mode_name(synctex_io_mode_t io_mode);\n\nconst char * synctex_ignore_leading_dot_slash(const char * name);\n    \n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "ext/synctex/synctex_parser_version.txt",
    "content": "1.16"
  },
  {
    "path": "ext/unarr/AUTHORS",
    "content": "﻿unarr contains code by:\r\n\r\n* The Unarchiver project (https://code.google.com/p/theunarchiver/)\r\n* Simon Bünzli (zeniko at gmail.com, http://www.zeniko.ch/#SumatraPDF)\r\n\r\nMost code is licensed under LGPLv3 (see COPYING). Exceptions are in code\r\nincluded from other projects:\r\n\r\nFiles           License        URL\r\n----------------------------------------------------------------------------------\r\ncommon/crc32.c  Public Domain  https://gnunet.org/svn/gnunet/src/util/crypto_crc.c\r\nlzmasdk/*.*     Public Domain  http://www.7-zip.org/sdk.html\r\n"
  },
  {
    "path": "ext/unarr/COPYING",
    "content": "                   GNU LESSER GENERAL PUBLIC LICENSE\r\n                       Version 3, 29 June 2007\r\n\r\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\r\n Everyone is permitted to copy and distribute verbatim copies\r\n of this license document, but changing it is not allowed.\r\n\r\n\r\n  This version of the GNU Lesser General Public License incorporates\r\nthe terms and conditions of version 3 of the GNU General Public\r\nLicense, supplemented by the additional permissions listed below.\r\n\r\n  0. Additional Definitions.\r\n\r\n  As used herein, \"this License\" refers to version 3 of the GNU Lesser\r\nGeneral Public License, and the \"GNU GPL\" refers to version 3 of the GNU\r\nGeneral Public License.\r\n\r\n  \"The Library\" refers to a covered work governed by this License,\r\nother than an Application or a Combined Work as defined below.\r\n\r\n  An \"Application\" is any work that makes use of an interface provided\r\nby the Library, but which is not otherwise based on the Library.\r\nDefining a subclass of a class defined by the Library is deemed a mode\r\nof using an interface provided by the Library.\r\n\r\n  A \"Combined Work\" is a work produced by combining or linking an\r\nApplication with the Library.  The particular version of the Library\r\nwith which the Combined Work was made is also called the \"Linked\r\nVersion\".\r\n\r\n  The \"Minimal Corresponding Source\" for a Combined Work means the\r\nCorresponding Source for the Combined Work, excluding any source code\r\nfor portions of the Combined Work that, considered in isolation, are\r\nbased on the Application, and not on the Linked Version.\r\n\r\n  The \"Corresponding Application Code\" for a Combined Work means the\r\nobject code and/or source code for the Application, including any data\r\nand utility programs needed for reproducing the Combined Work from the\r\nApplication, but excluding the System Libraries of the Combined Work.\r\n\r\n  1. Exception to Section 3 of the GNU GPL.\r\n\r\n  You may convey a covered work under sections 3 and 4 of this License\r\nwithout being bound by section 3 of the GNU GPL.\r\n\r\n  2. Conveying Modified Versions.\r\n\r\n  If you modify a copy of the Library, and, in your modifications, a\r\nfacility refers to a function or data to be supplied by an Application\r\nthat uses the facility (other than as an argument passed when the\r\nfacility is invoked), then you may convey a copy of the modified\r\nversion:\r\n\r\n   a) under this License, provided that you make a good faith effort to\r\n   ensure that, in the event an Application does not supply the\r\n   function or data, the facility still operates, and performs\r\n   whatever part of its purpose remains meaningful, or\r\n\r\n   b) under the GNU GPL, with none of the additional permissions of\r\n   this License applicable to that copy.\r\n\r\n  3. Object Code Incorporating Material from Library Header Files.\r\n\r\n  The object code form of an Application may incorporate material from\r\na header file that is part of the Library.  You may convey such object\r\ncode under terms of your choice, provided that, if the incorporated\r\nmaterial is not limited to numerical parameters, data structure\r\nlayouts and accessors, or small macros, inline functions and templates\r\n(ten or fewer lines in length), you do both of the following:\r\n\r\n   a) Give prominent notice with each copy of the object code that the\r\n   Library is used in it and that the Library and its use are\r\n   covered by this License.\r\n\r\n   b) Accompany the object code with a copy of the GNU GPL and this license\r\n   document.\r\n\r\n  4. Combined Works.\r\n\r\n  You may convey a Combined Work under terms of your choice that,\r\ntaken together, effectively do not restrict modification of the\r\nportions of the Library contained in the Combined Work and reverse\r\nengineering for debugging such modifications, if you also do each of\r\nthe following:\r\n\r\n   a) Give prominent notice with each copy of the Combined Work that\r\n   the Library is used in it and that the Library and its use are\r\n   covered by this License.\r\n\r\n   b) Accompany the Combined Work with a copy of the GNU GPL and this license\r\n   document.\r\n\r\n   c) For a Combined Work that displays copyright notices during\r\n   execution, include the copyright notice for the Library among\r\n   these notices, as well as a reference directing the user to the\r\n   copies of the GNU GPL and this license document.\r\n\r\n   d) Do one of the following:\r\n\r\n       0) Convey the Minimal Corresponding Source under the terms of this\r\n       License, and the Corresponding Application Code in a form\r\n       suitable for, and under terms that permit, the user to\r\n       recombine or relink the Application with a modified version of\r\n       the Linked Version to produce a modified Combined Work, in the\r\n       manner specified by section 6 of the GNU GPL for conveying\r\n       Corresponding Source.\r\n\r\n       1) Use a suitable shared library mechanism for linking with the\r\n       Library.  A suitable mechanism is one that (a) uses at run time\r\n       a copy of the Library already present on the user's computer\r\n       system, and (b) will operate properly with a modified version\r\n       of the Library that is interface-compatible with the Linked\r\n       Version.\r\n\r\n   e) Provide Installation Information, but only if you would otherwise\r\n   be required to provide such information under section 6 of the\r\n   GNU GPL, and only to the extent that such information is\r\n   necessary to install and execute a modified version of the\r\n   Combined Work produced by recombining or relinking the\r\n   Application with a modified version of the Linked Version. (If\r\n   you use option 4d0, the Installation Information must accompany\r\n   the Minimal Corresponding Source and Corresponding Application\r\n   Code. If you use option 4d1, you must provide the Installation\r\n   Information in the manner specified by section 6 of the GNU GPL\r\n   for conveying Corresponding Source.)\r\n\r\n  5. Combined Libraries.\r\n\r\n  You may place library facilities that are a work based on the\r\nLibrary side by side in a single library together with other library\r\nfacilities that are not Applications and are not covered by this\r\nLicense, and convey such a combined library under terms of your\r\nchoice, if you do both of the following:\r\n\r\n   a) Accompany the combined library with a copy of the same work based\r\n   on the Library, uncombined with any other library facilities,\r\n   conveyed under the terms of this License.\r\n\r\n   b) Give prominent notice with the combined library that part of it\r\n   is a work based on the Library, and explaining where to find the\r\n   accompanying uncombined form of the same work.\r\n\r\n  6. Revised Versions of the GNU Lesser General Public License.\r\n\r\n  The Free Software Foundation may publish revised and/or new versions\r\nof the GNU Lesser General Public License from time to time. Such new\r\nversions will be similar in spirit to the present version, but may\r\ndiffer in detail to address new problems or concerns.\r\n\r\n  Each version is given a distinguishing version number. If the\r\nLibrary as you received it specifies that a certain numbered version\r\nof the GNU Lesser General Public License \"or any later version\"\r\napplies to it, you have the option of following the terms and\r\nconditions either of that published version or of any later version\r\npublished by the Free Software Foundation. If the Library as you\r\nreceived it does not specify a version number of the GNU Lesser\r\nGeneral Public License, you may choose any version of the GNU Lesser\r\nGeneral Public License ever published by the Free Software Foundation.\r\n\r\n  If the Library as you received it specifies that a proxy can decide\r\nwhether future versions of the GNU Lesser General Public License shall\r\napply, that proxy's public statement of acceptance of any version is\r\npermanent authorization for you to choose that version for the\r\nLibrary.\r\n"
  },
  {
    "path": "ext/unarr/Makefile",
    "content": "# GNU Makefile\n\nbuild ?= debug\n\nOUT := build/$(build)\n\ndefault: all\n\n# --- Configuration ---\n\nCFLAGS += -Wall -D_FILE_OFFSET_BITS=64\nLIBS += -lm\n\nifeq \"$(build)\" \"debug\"\nCFLAGS += -pipe -g -DDEBUG\nelse ifeq \"$(build)\" \"profile\"\nCFLAGS += -pipe -O3 -DNDEBUG -pg\nLDFLAGS += -pg\nelse ifeq \"$(build)\" \"release\"\nCFLAGS += -pipe -O3 -DNDEBUG -fomit-frame-pointer\nelse ifeq \"$(build)\" \"coverage\"\nCFLAGS += -pipe -g -DDEBUG -pg -fprofile-arcs -ftest-coverage\nLIBS += -lgcov\nelse\n$(error unknown build setting: '$(build)')\nendif\n\n# --- Commands ---\n\nifneq \"$(verbose)\" \"yes\"\nQUIET_AR = @ echo ' ' ' ' AR $@ ;\nQUIET_CC = @ echo ' ' ' ' CC $@ ;\nQUIET_LINK = @ echo ' ' ' ' LINK $@ ;\nendif\n\nCC_CMD = $(QUIET_CC) mkdir -p $(@D) ; $(CC) $(CFLAGS) -o $@ -c $<\nAR_CMD = $(QUIET_AR) $(AR) cr $@ $^\nLINK_CMD = $(QUIET_LINK) $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)\n\n# --- Third party libraries ---\n\n# TODO: build zlib, bzip2 and 7z when available\n\n# --- unarr files ---\n\nUNARR_OUT := $(OUT)/unarr\n\nUNARR_DIRS := common lzmasdk rar tar zip _7z\nUNARR_SRC := $(wildcard $(UNARR_DIRS:=/*.c))\nUNARR_OBJ := $(addprefix $(UNARR_OUT)/, $(addsuffix .o, $(basename $(UNARR_SRC))))\n\n$(UNARR_OUT)/%.o : %.c\n\t$(CC_CMD)\n\nUNARR_LIB := $(OUT)/libunarr.a\n\n$(UNARR_LIB): $(UNARR_OBJ)\n\t$(AR_CMD)\n\nUNARR_TEST := $(OUT)/unarr-test\n\n$(UNARR_TEST) : $(UNARR_OUT)/main.o $(UNARR_LIB)\n\t$(LINK_CMD)\n\n# TODO: add header dependencies\n\n# --- Clean and Default ---\n\nall: $(UNARR_TEST)\n\nclean:\n\trm -rf build\n\n.PHONY: all clean\n"
  },
  {
    "path": "ext/unarr/README",
    "content": "unarr is a decompression library for RAR, TAR, ZIP and 7z archives.\r\n\r\nunarr originated as a port of the RAR extraction features from\r\nThe Unarchiver project required for extracting images from comic\r\nbook archives (.cbr). It was written as an alternative to\r\nlibarchive which didn't have support for parsing filters or solid\r\ncompression at the time.\r\n\r\nThere is currently only an experimental Linux Makefile for building\r\nunarr (see ../makefile.msvc for what SumatraPDF does under Windows).\r\nIn any case, compiling unarr should be as simple as compiling all\r\nfiles with a C99 compatible compiler (omit main.c if you want to use\r\nit as a library).\r\n\r\nThe following symbols can be defined if other libraries are present\r\nin the include path:\r\n\r\nSymbol          Required header Required for (format/method)\r\n------------------------------------------------------------\r\nHAVE_ZLIB       zlib.h          faster CRC-32 and Deflate\r\nHAVE_BZIP2      bzlib.h         ZIP / Bzip2\r\nHAVE_7Z         7z.h            7Z  / LZMA, LZMA2, BCJ\r\n\r\n_7ZIP_PPMD_SUPPPORT             7Z  / PPMd\r\n"
  },
  {
    "path": "ext/unarr/_7z/_7z.c",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n#include \"_7z.h\"\r\n\r\n#ifdef HAVE_7Z\r\n\r\nstatic void *gSzAlloc_Alloc(void *self, size_t size) { (void)self; return malloc(size); }\r\nstatic void gSzAlloc_Free(void *self, void *ptr) { (void)self; free(ptr); }\r\nstatic ISzAlloc gSzAlloc = { gSzAlloc_Alloc, gSzAlloc_Free };\r\n\r\nstatic SRes CSeekStream_Read(void *p, void *data, size_t *size)\r\n{\r\n    struct CSeekStream *stm = p;\r\n    *size = ar_read(stm->stream, data, *size);\r\n    return SZ_OK;\r\n}\r\n\r\nstatic SRes CSeekStream_Seek(void *p, Int64 *pos, ESzSeek origin)\r\n{\r\n    struct CSeekStream *stm = p;\r\n    if (!ar_seek(stm->stream, *pos, (int)origin))\r\n        return SZ_ERROR_FAIL;\r\n    *pos = ar_tell(stm->stream);\r\n    return SZ_OK;\r\n}\r\n\r\nstatic void CSeekStream_CreateVTable(struct CSeekStream *in_stream, ar_stream *stream)\r\n{\r\n    in_stream->super.Read = CSeekStream_Read;\r\n    in_stream->super.Seek = CSeekStream_Seek;\r\n    in_stream->stream = stream;\r\n}\r\n\r\n#ifndef USE_7Z_CRC32\r\nUInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size)\r\n{\r\n    return ar_crc32(0, data, size);\r\n}\r\n#endif\r\n\r\nstatic void _7z_close(ar_archive *ar)\r\n{\r\n    ar_archive_7z *_7z = (ar_archive_7z *)ar;\r\n    free(_7z->entry_name);\r\n    SzArEx_Free(&_7z->data, &gSzAlloc);\r\n    IAlloc_Free(&gSzAlloc, _7z->uncomp.buffer);\r\n}\r\n\r\nstatic const char *_7z_get_name(ar_archive *ar);\r\n\r\nstatic bool _7z_parse_entry(ar_archive *ar, off64_t offset)\r\n{\r\n    ar_archive_7z *_7z = (ar_archive_7z *)ar;\r\n    const CSzFileItem *item = _7z->data.db.Files + offset;\r\n\r\n    if (offset < 0 || offset > _7z->data.db.NumFiles) {\r\n        warn(\"Offsets must be between 0 and %u\", _7z->data.db.NumFiles);\r\n        return false;\r\n    }\r\n    if (offset == _7z->data.db.NumFiles) {\r\n        ar->at_eof = true;\r\n        return false;\r\n    }\r\n\r\n    ar->entry_offset = offset;\r\n    ar->entry_offset_next = offset + 1;\r\n    ar->entry_size_uncompressed = (size_t)item->Size;\r\n    ar->entry_filetime = item->MTimeDefined ? (time64_t)(item->MTime.Low | ((time64_t)item->MTime.High << 32)) : 0;\r\n\r\n    free(_7z->entry_name);\r\n    _7z->entry_name = NULL;\r\n    _7z->uncomp.initialized = false;\r\n\r\n    if (item->IsDir) {\r\n        log(\"Skipping directory entry \\\"%s\\\"\", _7z_get_name(ar));\r\n        return _7z_parse_entry(ar, offset + 1);\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nstatic char *SzArEx_GetFileNameUtf8(const CSzArEx *p, UInt32 fileIndex)\r\n{\r\n    size_t len = p->FileNameOffsets[fileIndex + 1] - p->FileNameOffsets[fileIndex];\r\n    const Byte *src = p->FileNames.data + p->FileNameOffsets[fileIndex] * 2;\r\n    const Byte *srcEnd = src + len * 2;\r\n    size_t size = len * 3;\r\n    char *str, *out;\r\n\r\n    if (size == (size_t)-1)\r\n        return NULL;\r\n    str = malloc(size + 1);\r\n    if (!str)\r\n        return NULL;\r\n\r\n    for (out = str; src < srcEnd - 1; src += 2) {\r\n        out += ar_conv_rune_to_utf8(src[0] | src[1] << 8, out, str + size - out);\r\n    }\r\n    *out = '\\0';\r\n\r\n    return str;\r\n}\r\n\r\nstatic const char *_7z_get_name(ar_archive *ar)\r\n{\r\n    ar_archive_7z *_7z = (ar_archive_7z *)ar;\r\n    if (!_7z->entry_name && ar->entry_offset_next && !ar->at_eof) {\r\n        _7z->entry_name = SzArEx_GetFileNameUtf8(&_7z->data, (UInt32)ar->entry_offset);\r\n        /* normalize path separators */\r\n        if (_7z->entry_name) {\r\n            char *p = _7z->entry_name;\r\n            while ((p = strchr(p, '\\\\')) != NULL) {\r\n                *p = '/';\r\n            }\r\n        }\r\n    }\r\n    return _7z->entry_name;\r\n}\r\n\r\nstatic bool _7z_uncompress(ar_archive *ar, void *buffer, size_t buffer_size)\r\n{\r\n    ar_archive_7z *_7z = (ar_archive_7z *)ar;\r\n    struct ar_archive_7z_uncomp *uncomp = &_7z->uncomp;\r\n\r\n    if (!uncomp->initialized) {\r\n        /* TODO: this uncompresses all data for solid compressions */\r\n        SRes res = SzArEx_Extract(&_7z->data, &_7z->look_stream.s, (UInt32)ar->entry_offset, &uncomp->folder_index, &uncomp->buffer, &uncomp->buffer_size, &uncomp->offset, &uncomp->bytes_left, &gSzAlloc, &gSzAlloc);\r\n        if (res != SZ_OK) {\r\n            warn(\"Failed to extract file at index %\" PRIi64 \" (failed with error %d)\", ar->entry_offset, res);\r\n            return false;\r\n        }\r\n        if (uncomp->bytes_left != ar->entry_size_uncompressed) {\r\n            warn(\"Uncompressed sizes don't match (%\" PRIuPTR \" != %\" PRIuPTR \")\", uncomp->bytes_left, ar->entry_size_uncompressed);\r\n            return false;\r\n        }\r\n        uncomp->initialized = true;\r\n    }\r\n\r\n    if (buffer_size > uncomp->bytes_left) {\r\n        warn(\"Requesting too much data (%\" PRIuPTR \" < %\" PRIuPTR \")\", uncomp->bytes_left, buffer_size);\r\n        return false;\r\n    }\r\n\r\n    memcpy(buffer, uncomp->buffer + uncomp->offset + ar->entry_size_uncompressed - uncomp->bytes_left, buffer_size);\r\n    uncomp->bytes_left -= buffer_size;\r\n\r\n    return true;\r\n}\r\n\r\nar_archive *ar_open_7z_archive(ar_stream *stream)\r\n{\r\n    ar_archive *ar;\r\n    ar_archive_7z *_7z;\r\n    SRes res;\r\n\r\n    if (!ar_seek(stream, 0, SEEK_SET))\r\n        return NULL;\r\n\r\n    ar = ar_open_archive(stream, sizeof(ar_archive_7z), _7z_close, _7z_parse_entry, _7z_get_name, _7z_uncompress, NULL, 0);\r\n    if (!ar)\r\n        return NULL;\r\n\r\n    _7z = (ar_archive_7z *)ar;\r\n    CSeekStream_CreateVTable(&_7z->in_stream, stream);\r\n    LookToRead_CreateVTable(&_7z->look_stream, False);\r\n    _7z->look_stream.realStream = &_7z->in_stream.super;\r\n    LookToRead_Init(&_7z->look_stream);\r\n\r\n#ifdef USE_7Z_CRC32\r\n    CrcGenerateTable();\r\n#endif\r\n\r\n    SzArEx_Init(&_7z->data);\r\n    res = SzArEx_Open(&_7z->data, &_7z->look_stream.s, &gSzAlloc, &gSzAlloc);\r\n    if (res != SZ_OK) {\r\n        if (res != SZ_ERROR_NO_ARCHIVE)\r\n            warn(\"Invalid 7z archive (failed with error %d)\", res);\r\n        free(ar);\r\n        return NULL;\r\n    }\r\n\r\n    return ar;\r\n}\r\n\r\n#else\r\n\r\nar_archive *ar_open_7z_archive(ar_stream *stream)\r\n{\r\n    (void)stream;\r\n    warn(\"7z support requires 7z SDK (define HAVE_7Z)\");\r\n    return NULL;\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/unarr/_7z/_7z.h",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n#ifndef _7z_7z_h\r\n#define _7z_7z_h\r\n\r\n#include \"../common/unarr-imp.h\"\r\n\r\n#include \"../lzmasdk/7zTypes.h\"\r\n#ifdef HAVE_7Z\r\n#include <7z.h>\r\n#endif\r\n\r\ntypedef struct ar_archive_7z_s ar_archive_7z;\r\n\r\nstruct CSeekStream {\r\n    ISeekInStream super;\r\n    ar_stream *stream;\r\n};\r\n\r\nstruct ar_archive_7z_uncomp {\r\n    bool initialized;\r\n\r\n    UInt32 folder_index;\r\n    Byte *buffer;\r\n    size_t buffer_size;\r\n\r\n    size_t offset;\r\n    size_t bytes_left;\r\n};\r\n\r\nstruct ar_archive_7z_s {\r\n    ar_archive super;\r\n    struct CSeekStream in_stream;\r\n#ifdef HAVE_7Z\r\n    CLookToRead look_stream;\r\n    CSzArEx data;\r\n#endif\r\n    char *entry_name;\r\n    struct ar_archive_7z_uncomp uncomp;\r\n};\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/unarr/common/allocator.h",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n#ifndef common_allocator_h\r\n#define common_allocator_h\r\n\r\n#ifdef USE_CUSTOM_ALLOCATOR\r\n\r\n#include <stddef.h>\r\n\r\ntypedef void *(* custom_malloc_fn)(void *opaque, size_t size);\r\ntypedef void (* custom_free_fn)(void *opaque, void *ptr);\r\n\r\nvoid ar_set_custom_allocator(custom_malloc_fn custom_malloc, custom_free_fn custom_free, void *opaque);\r\n\r\n#define malloc(size) ar_malloc(size)\r\n#define calloc(count, size) ar_calloc(count, size)\r\n#define free(ptr) ar_free(ptr)\r\n\r\n#define realloc(ptr, size) _use_malloc_memcpy_free_instead(ptr, size)\r\n#define strdup(str) _use_malloc_memcpy_instead(str)\r\n\r\n#elif !defined(NDEBUG) && defined(_MSC_VER)\r\n\r\n#include <crtdbg.h>\r\n\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/unarr/common/conv.c",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n#include \"unarr-imp.h\"\r\n\r\n#include <time.h>\r\n\r\n/* data from http://en.wikipedia.org/wiki/Cp437 */\r\nstatic const wchar_t gCp437[256] = {\r\n    0, 0x263A, 0x263B, 0x2665, 0x2666, 0x2663, 0x2660, 0x2022, 0x25D8, 0x25CB, 0x25D9, 0x2642, 0x2640, 0x266A, 0x266C, 0x263C,\r\n    0x25BA, 0x25C4, 0x2195, 0x203C, 0x00B6, 0x00A7, 0x25AC, 0x21A8, 0x2191, 0x2193, 0x2192, 0x2190, 0x221F, 0x2194, 0x25B2, 0x25BC,\r\n    ' ', '!', '\"', '#', '$', '%', '&', '\\'', '(', ')', '*', '+', ',', '-', '.', '/',\r\n    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?',\r\n    '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',\r\n    'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\\\', ']', '^', '_',\r\n    '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',\r\n    'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', 0x2302,\r\n    0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5,\r\n    0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, 0x00FF, 0x00D6, 0x00DC, 0x00A2, 0x00A3, 0x00A5, 0x20A7, 0x0192,\r\n    0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x2310, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,\r\n    0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556, 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510,\r\n    0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F, 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567,\r\n    0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580,\r\n    0x03B1, 0x00DF, 0x0393, 0x03C0, 0x03A3, 0x03C3, 0x00B5, 0x03C4, 0x03A6, 0x0398, 0x03A9, 0x03B4, 0x221E, 0x03C6, 0x03B5, 0x2229,\r\n    0x2261, 0x00B1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00F7, 0x2248, 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0,\r\n};\r\n\r\nsize_t ar_conv_rune_to_utf8(wchar_t rune, char *out, size_t size)\r\n{\r\n    if (size < 1)\r\n        return 0;\r\n    if (rune < 0x0080) {\r\n        *out++ = rune & 0x7F;\r\n        return 1;\r\n    }\r\n    if (rune < 0x0800 && size >= 2) {\r\n        *out++ = 0xC0 | ((rune >> 6) & 0x1F);\r\n        *out++ = 0x80 | (rune & 0x3F);\r\n        return 2;\r\n    }\r\n    if (size >= 3) {\r\n        if ((0xD800 <= rune && rune <= 0xDFFF) || rune >= 0x10000)\r\n            rune = 0xFFFD;\r\n        *out++ = 0xE0 | ((rune >> 12) & 0x0F);\r\n        *out++ = 0x80 | ((rune >> 6) & 0x3F);\r\n        *out++ = 0x80 | (rune & 0x3F);\r\n        return 3;\r\n    }\r\n    *out++ = '?';\r\n    return 1;\r\n}\r\n\r\nchar *ar_conv_dos_to_utf8(const char *astr)\r\n{\r\n    char *str, *out;\r\n    const char *in;\r\n    size_t size;\r\n\r\n    size = 0;\r\n    for (in = astr; *in; in++) {\r\n        char buf[4];\r\n        size += ar_conv_rune_to_utf8(gCp437[(uint8_t)*in], buf, sizeof(buf));\r\n    }\r\n\r\n    if (size == (size_t)-1)\r\n        return NULL;\r\n    str = malloc(size + 1);\r\n    if (!str)\r\n        return NULL;\r\n\r\n    for (in = astr, out = str; *in; in++) {\r\n        out += ar_conv_rune_to_utf8(gCp437[(uint8_t)*in], out, str + size - out);\r\n    }\r\n    *out = '\\0';\r\n\r\n    return str;\r\n}\r\n\r\ntime64_t ar_conv_dosdate_to_filetime(uint32_t dosdate)\r\n{\r\n    struct tm tm;\r\n    time_t t1, t2;\r\n\r\n    tm.tm_sec = (dosdate & 0x1F) * 2;\r\n    tm.tm_min = (dosdate >> 5) & 0x3F;\r\n    tm.tm_hour = (dosdate >> 11) & 0x1F;\r\n    tm.tm_mday = (dosdate >> 16) & 0x1F;\r\n    tm.tm_mon = ((dosdate >> 21) & 0x0F) - 1;\r\n    tm.tm_year = ((dosdate >> 25) & 0x7F) + 80;\r\n    tm.tm_isdst = -1;\r\n\r\n    t1 = mktime(&tm);\r\n    t2 = mktime(gmtime(&t1));\r\n\r\n    return (time64_t)(2 * t1 - t2 + 11644473600) * 10000000;\r\n}\r\n"
  },
  {
    "path": "ext/unarr/common/crc32.c",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n#include \"unarr-imp.h\"\r\n\r\n#ifndef HAVE_ZLIB\r\n\r\n/* code adapted from https://gnunet.org/svn/gnunet/src/util/crypto_crc.c (public domain) */\r\n\r\nstatic bool crc_table_ready = false;\r\nstatic uint32_t crc_table[256];\r\n\r\nuint32_t ar_crc32(uint32_t crc32, const unsigned char *data, size_t data_len)\r\n{\r\n    if (!crc_table_ready) {\r\n        uint32_t i, j;\r\n        uint32_t h = 1;\r\n        crc_table[0] = 0;\r\n        for (i = 128; i; i >>= 1) {\r\n            h = (h >> 1) ^ ((h & 1) ? 0xEDB88320 : 0);\r\n            for (j = 0; j < 256; j += 2 * i) {\r\n                crc_table[i + j] = crc_table[j] ^ h;\r\n            }\r\n        }\r\n        crc_table_ready = true;\r\n    }\r\n\r\n    crc32 = crc32 ^ 0xFFFFFFFF;\r\n    while (data_len-- > 0) {\r\n        crc32 = (crc32 >> 8) ^ crc_table[(crc32 ^ *data++) & 0xFF];\r\n    }\r\n    return crc32 ^ 0xFFFFFFFF;\r\n}\r\n\r\n#else\r\n\r\n#include <zlib.h>\r\n\r\nuint32_t ar_crc32(uint32_t crc, const unsigned char *data, size_t data_len)\r\n{\r\n#if SIZE_MAX > UINT32_MAX\r\n    while (data_len > UINT32_MAX) {\r\n        crc = crc32(crc, data, UINT32_MAX);\r\n        data += UINT32_MAX;\r\n        data_len -= UINT32_MAX;\r\n    }\r\n#endif\r\n    return crc32(crc, data, (uint32_t)data_len);\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/unarr/common/custalloc.c",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n#include <stdlib.h>\r\n#include <stdint.h>\r\n#include <string.h>\r\n\r\ntypedef void *(* custom_malloc_fn)(void *opaque, size_t size);\r\ntypedef void (* custom_free_fn)(void *opaque, void *ptr);\r\n\r\nstatic void *default_malloc(void *opaque, size_t size) { (void)opaque; return malloc(size); }\r\nstatic void default_free(void *opaque, void *ptr) { (void)opaque; free(ptr); }\r\n\r\nstatic struct {\r\n    custom_malloc_fn malloc;\r\n    custom_free_fn free;\r\n    void *opaque;\r\n} gAllocator = {\r\n    default_malloc,\r\n    default_free,\r\n    NULL,\r\n};\r\n\r\nvoid *ar_malloc(size_t size)\r\n{\r\n    return gAllocator.malloc(gAllocator.opaque, size);\r\n}\r\n\r\nvoid *ar_calloc(size_t count, size_t size)\r\n{\r\n    void *ptr = NULL;\r\n    if (size <= SIZE_MAX / count)\r\n        ptr = ar_malloc(count * size);\r\n    if (ptr)\r\n        memset(ptr, 0, count * size);\r\n    return ptr;\r\n}\r\n\r\nvoid ar_free(void *ptr)\r\n{\r\n    gAllocator.free(gAllocator.opaque, ptr);\r\n}\r\n\r\nvoid ar_set_custom_allocator(custom_malloc_fn custom_malloc, custom_free_fn custom_free, void *opaque)\r\n{\r\n    gAllocator.malloc = custom_malloc ? custom_malloc : default_malloc;\r\n    gAllocator.free = custom_free ? custom_free : default_free;\r\n    gAllocator.opaque = opaque;\r\n}\r\n"
  },
  {
    "path": "ext/unarr/common/stream.c",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n#include \"unarr-imp.h\"\r\n\r\nar_stream *ar_open_stream(void *data, ar_stream_close_fn close, ar_stream_read_fn read, ar_stream_seek_fn seek, ar_stream_tell_fn tell)\r\n{\r\n    ar_stream *stream = malloc(sizeof(ar_stream));\r\n    if (!stream) {\r\n        close(data);\r\n        return NULL;\r\n    }\r\n    stream->data = data;\r\n    stream->close = close;\r\n    stream->read = read;\r\n    stream->seek = seek;\r\n    stream->tell = tell;\r\n    return stream;\r\n}\r\n\r\nvoid ar_close(ar_stream *stream)\r\n{\r\n    if (stream)\r\n        stream->close(stream->data);\r\n    free(stream);\r\n}\r\n\r\nsize_t ar_read(ar_stream *stream, void *buffer, size_t count)\r\n{\r\n    return stream->read(stream->data, buffer, count);\r\n}\r\n\r\nbool ar_seek(ar_stream *stream, off64_t offset, int origin)\r\n{\r\n    return stream->seek(stream->data, offset, origin);\r\n}\r\n\r\nbool ar_skip(ar_stream *stream, off64_t count)\r\n{\r\n    return stream->seek(stream->data, count, SEEK_CUR);\r\n}\r\n\r\noff64_t ar_tell(ar_stream *stream)\r\n{\r\n    return stream->tell(stream->data);\r\n}\r\n\r\n/***** stream based on FILE *****/\r\n\r\nstatic void file_close(void *data)\r\n{\r\n    fclose(data);\r\n}\r\n\r\nstatic size_t file_read(void *data, void *buffer, size_t count)\r\n{\r\n    return fread(buffer, 1, count, data);\r\n}\r\n\r\nstatic bool file_seek(void *data, off64_t offset, int origin)\r\n{\r\n#ifdef _MSC_VER\r\n    return _fseeki64(data, offset, origin) == 0;\r\n#else\r\n#if _POSIX_C_SOURCE >= 200112L\r\n    if (sizeof(off_t) == 8)\r\n        return fseeko(data, offset, origin) == 0;\r\n#endif\r\n    if (offset > INT32_MAX || offset < INT32_MIN)\r\n        return false;\r\n    return fseek(data, (long)offset, origin) == 0;\r\n#endif\r\n}\r\n\r\nstatic off64_t file_tell(void *data)\r\n{\r\n#ifdef _MSC_VER\r\n    return _ftelli64(data);\r\n#elif _POSIX_C_SOURCE >= 200112L\r\n    return ftello(data);\r\n#else\r\n    return ftell(data);\r\n#endif\r\n}\r\n\r\nar_stream *ar_open_file(const char *path)\r\n{\r\n    FILE *f = path ? fopen(path, \"rb\") : NULL;\r\n    if (!f)\r\n        return NULL;\r\n    return ar_open_stream(f, file_close, file_read, file_seek, file_tell);\r\n}\r\n\r\n#ifdef _WIN32\r\nar_stream *ar_open_file_w(const wchar_t *path)\r\n{\r\n    FILE *f = path ? _wfopen(path, L\"rb\") : NULL;\r\n    if (!f)\r\n        return NULL;\r\n    return ar_open_stream(f, file_close, file_read, file_seek, file_tell);\r\n}\r\n#endif\r\n\r\n/***** stream based on preallocated memory *****/\r\n\r\nstruct MemoryStream {\r\n    const uint8_t *data;\r\n    size_t length;\r\n    size_t offset;\r\n};\r\n\r\nstatic void memory_close(void *data)\r\n{\r\n    struct MemoryStream *stm = data;\r\n    free(stm);\r\n}\r\n\r\nstatic size_t memory_read(void *data, void *buffer, size_t count)\r\n{\r\n    struct MemoryStream *stm = data;\r\n    if (count > stm->length - stm->offset)\r\n        count = stm->length - stm->offset;\r\n    memcpy(buffer, stm->data + stm->offset, count);\r\n    stm->offset += count;\r\n    return count;\r\n}\r\n\r\nstatic bool memory_seek(void *data, off64_t offset, int origin)\r\n{\r\n    struct MemoryStream *stm = data;\r\n    if (origin == SEEK_CUR)\r\n        offset += stm->offset;\r\n    else if (origin == SEEK_END)\r\n        offset += stm->length;\r\n    if (offset < 0 || offset > (off64_t)stm->length || (size_t)offset > stm->length)\r\n        return false;\r\n    stm->offset = (size_t)offset;\r\n    return true;\r\n}\r\n\r\nstatic off64_t memory_tell(void *data)\r\n{\r\n    struct MemoryStream *stm = data;\r\n    return stm->offset;\r\n}\r\n\r\nar_stream *ar_open_memory(const void *data, size_t datalen)\r\n{\r\n    struct MemoryStream *stm = malloc(sizeof(struct MemoryStream));\r\n    if (!stm)\r\n        return NULL;\r\n    stm->data = data;\r\n    stm->length = datalen;\r\n    stm->offset = 0;\r\n    return ar_open_stream(stm, memory_close, memory_read, memory_seek, memory_tell);\r\n}\r\n\r\n#ifdef _WIN32\r\n/***** stream based on IStream *****/\r\n\r\n#define COBJMACROS\r\n#include <windows.h>\r\n\r\nstatic void stream_close(void *data)\r\n{\r\n    IUnknown_Release((IStream *)data);\r\n}\r\n\r\nstatic size_t stream_read(void *data, void *buffer, size_t count)\r\n{\r\n    size_t read = 0;\r\n    HRESULT res;\r\n    ULONG cbRead;\r\n#ifdef _WIN64\r\n    while (count > ULONG_MAX) {\r\n        res = IStream_Read((IStream *)data, buffer, ULONG_MAX, &cbRead);\r\n        if (FAILED(res))\r\n            return read;\r\n        read += cbRead;\r\n        buffer = (BYTE *)buffer + ULONG_MAX;\r\n        count -= ULONG_MAX;\r\n    }\r\n#endif\r\n    res = IStream_Read((IStream *)data, buffer, (ULONG)count, &cbRead);\r\n    if (SUCCEEDED(res))\r\n        read += cbRead;\r\n    return read;\r\n}\r\n\r\nstatic bool stream_seek(void *data, off64_t offset, int origin)\r\n{\r\n    LARGE_INTEGER off;\r\n    ULARGE_INTEGER n;\r\n    HRESULT res;\r\n    off.QuadPart = offset;\r\n    res = IStream_Seek((IStream *)data, off, origin, &n);\r\n    return SUCCEEDED(res);\r\n}\r\n\r\nstatic off64_t stream_tell(void *data)\r\n{\r\n    LARGE_INTEGER zero = { 0 };\r\n    ULARGE_INTEGER n = { 0 };\r\n    IStream_Seek((IStream *)data, zero, SEEK_CUR, &n);\r\n    return (off64_t)n.QuadPart;\r\n}\r\n\r\nar_stream *ar_open_istream(IStream *stream)\r\n{\r\n    LARGE_INTEGER zero = { 0 };\r\n    HRESULT res = IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);\r\n    if (FAILED(res))\r\n        return NULL;\r\n    IUnknown_AddRef(stream);\r\n    return ar_open_stream(stream, stream_close, stream_read, stream_seek, stream_tell);\r\n}\r\n#endif\r\n"
  },
  {
    "path": "ext/unarr/common/unarr-imp.h",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n/* this is the common private/implementation API of unarr which should only be used by unarr code */\r\n\r\n#ifndef common_unarr_imp_h\r\n#define common_unarr_imp_h\r\n\r\n#include \"../unarr.h\"\r\n#include \"allocator.h\"\r\n\r\n#include <stdlib.h>\r\n#include <stdio.h>\r\n#include <stdarg.h>\r\n#include <string.h>\r\n#include <inttypes.h>\r\n\r\n/***** conv ****/\r\n\r\nsize_t ar_conv_rune_to_utf8(wchar_t rune, char *out, size_t size);\r\nchar *ar_conv_dos_to_utf8(const char *astr);\r\ntime64_t ar_conv_dosdate_to_filetime(uint32_t dosdate);\r\n\r\n/***** crc32 *****/\r\n\r\nuint32_t ar_crc32(uint32_t crc32, const unsigned char *data, size_t data_len);\r\n\r\n/***** stream *****/\r\n\r\ntypedef void (* ar_stream_close_fn)(void *data);\r\ntypedef size_t (* ar_stream_read_fn)(void *data, void *buffer, size_t count);\r\ntypedef bool (* ar_stream_seek_fn)(void *data, off64_t offset, int origin);\r\ntypedef off64_t (* ar_stream_tell_fn)(void *data);\r\n\r\nstruct ar_stream_s {\r\n    ar_stream_close_fn close;\r\n    ar_stream_read_fn read;\r\n    ar_stream_seek_fn seek;\r\n    ar_stream_tell_fn tell;\r\n    void *data;\r\n};\r\n\r\nar_stream *ar_open_stream(void *data, ar_stream_close_fn close, ar_stream_read_fn read, ar_stream_seek_fn seek, ar_stream_tell_fn tell);\r\n\r\n/***** unarr *****/\r\n\r\n#define warn(...) ar_log(\"!\", __FILE__, __LINE__, __VA_ARGS__)\r\n#ifndef NDEBUG\r\n#define log(...) ar_log(\"-\", __FILE__, __LINE__, __VA_ARGS__)\r\n#else\r\n#define log(...) ((void)0)\r\n#endif\r\nvoid ar_log(const char *prefix, const char *file, int line, const char *msg, ...);\r\n\r\ntypedef void (* ar_archive_close_fn)(ar_archive *ar);\r\ntypedef bool (* ar_parse_entry_fn)(ar_archive *ar, off64_t offset);\r\ntypedef const char *(* ar_entry_get_name_fn)(ar_archive *ar);\r\ntypedef bool (* ar_entry_uncompress_fn)(ar_archive *ar, void *buffer, size_t count);\r\ntypedef size_t (* ar_get_global_comment_fn)(ar_archive *ar, void *buffer, size_t count);\r\n\r\nstruct ar_archive_s {\r\n    ar_archive_close_fn close;\r\n    ar_parse_entry_fn parse_entry;\r\n    ar_entry_get_name_fn get_name;\r\n    ar_entry_uncompress_fn uncompress;\r\n    ar_get_global_comment_fn get_comment;\r\n\r\n    ar_stream *stream;\r\n    bool at_eof;\r\n    off64_t entry_offset;\r\n    off64_t entry_offset_first;\r\n    off64_t entry_offset_next;\r\n    size_t entry_size_uncompressed;\r\n    time64_t entry_filetime;\r\n};\r\n\r\nar_archive *ar_open_archive(ar_stream *stream, size_t struct_size, ar_archive_close_fn close, ar_parse_entry_fn parse_entry,\r\n                            ar_entry_get_name_fn get_name, ar_entry_uncompress_fn uncompress, ar_get_global_comment_fn get_comment,\r\n                            off64_t first_entry_offset);\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/unarr/common/unarr.c",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n#include \"unarr-imp.h\"\r\n\r\nar_archive *ar_open_archive(ar_stream *stream, size_t struct_size, ar_archive_close_fn close, ar_parse_entry_fn parse_entry,\r\n                            ar_entry_get_name_fn get_name, ar_entry_uncompress_fn uncompress, ar_get_global_comment_fn get_comment,\r\n                            off64_t first_entry_offset)\r\n{\r\n    ar_archive *ar = malloc(struct_size);\r\n    if (!ar)\r\n        return NULL;\r\n    memset(ar, 0, struct_size);\r\n    ar->close = close;\r\n    ar->parse_entry = parse_entry;\r\n    ar->get_name = get_name;\r\n    ar->uncompress = uncompress;\r\n    ar->get_comment = get_comment;\r\n    ar->stream = stream;\r\n    ar->entry_offset_first = first_entry_offset;\r\n    ar->entry_offset_next = first_entry_offset;\r\n    return ar;\r\n}\r\n\r\nvoid ar_close_archive(ar_archive *ar)\r\n{\r\n    if (ar)\r\n        ar->close(ar);\r\n    free(ar);\r\n}\r\n\r\nbool ar_at_eof(ar_archive *ar)\r\n{\r\n    return ar->at_eof;\r\n}\r\n\r\nbool ar_parse_entry(ar_archive *ar)\r\n{\r\n    return ar->parse_entry(ar, ar->entry_offset_next);\r\n}\r\n\r\nbool ar_parse_entry_at(ar_archive *ar, off64_t offset)\r\n{\r\n    ar->at_eof = false;\r\n    return ar->parse_entry(ar, offset ? offset : ar->entry_offset_first);\r\n}\r\n\r\nbool ar_parse_entry_for(ar_archive *ar, const char *entry_name)\r\n{\r\n    ar->at_eof = false;\r\n    if (!entry_name)\r\n        return false;\r\n    if (!ar_parse_entry_at(ar, ar->entry_offset_first))\r\n        return false;\r\n    do {\r\n        const char *name = ar_entry_get_name(ar);\r\n        if (name && strcmp(name, entry_name) == 0)\r\n            return true;\r\n    } while (ar_parse_entry(ar));\r\n    return false;\r\n}\r\n\r\nconst char *ar_entry_get_name(ar_archive *ar)\r\n{\r\n    return ar->get_name(ar);\r\n}\r\n\r\noff64_t ar_entry_get_offset(ar_archive *ar)\r\n{\r\n    return ar->entry_offset;\r\n}\r\n\r\nsize_t ar_entry_get_size(ar_archive *ar)\r\n{\r\n    return ar->entry_size_uncompressed;\r\n}\r\n\r\ntime64_t ar_entry_get_filetime(ar_archive *ar)\r\n{\r\n    return ar->entry_filetime;\r\n}\r\n\r\nbool ar_entry_uncompress(ar_archive *ar, void *buffer, size_t count)\r\n{\r\n    return ar->uncompress(ar, buffer, count);\r\n}\r\n\r\nsize_t ar_get_global_comment(ar_archive *ar, void *buffer, size_t count)\r\n{\r\n    if (!ar->get_comment)\r\n        return 0;\r\n    return ar->get_comment(ar, buffer, count);\r\n}\r\n\r\nvoid ar_log(const char *prefix, const char *file, int line, const char *msg, ...)\r\n{\r\n    va_list args;\r\n    va_start(args, msg);\r\n    if (prefix)\r\n        fprintf(stderr, \"%s \", prefix);\r\n    if (strrchr(file, '/'))\r\n        file = strrchr(file, '/') + 1;\r\n    if (strrchr(file, '\\\\'))\r\n        file = strrchr(file, '\\\\') + 1;\r\n    fprintf(stderr, \"%s:%d: \", file, line);\r\n    vfprintf(stderr, msg, args);\r\n    fprintf(stderr, \"\\n\");\r\n    va_end(args);\r\n}\r\n"
  },
  {
    "path": "ext/unarr/lzmasdk/7zTypes.h",
    "content": "/* 7zTypes.h -- Basic types\r\n2013-11-12 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __7Z_TYPES_H\r\n#define __7Z_TYPES_H\r\n\r\n#ifdef _WIN32\r\n/* #include <windows.h> */\r\n#endif\r\n\r\n#include <stddef.h>\r\n\r\n#ifndef EXTERN_C_BEGIN\r\n#ifdef __cplusplus\r\n#define EXTERN_C_BEGIN extern \"C\" {\r\n#define EXTERN_C_END }\r\n#else\r\n#define EXTERN_C_BEGIN\r\n#define EXTERN_C_END\r\n#endif\r\n#endif\r\n\r\nEXTERN_C_BEGIN\r\n\r\n#define SZ_OK 0\r\n\r\n#define SZ_ERROR_DATA 1\r\n#define SZ_ERROR_MEM 2\r\n#define SZ_ERROR_CRC 3\r\n#define SZ_ERROR_UNSUPPORTED 4\r\n#define SZ_ERROR_PARAM 5\r\n#define SZ_ERROR_INPUT_EOF 6\r\n#define SZ_ERROR_OUTPUT_EOF 7\r\n#define SZ_ERROR_READ 8\r\n#define SZ_ERROR_WRITE 9\r\n#define SZ_ERROR_PROGRESS 10\r\n#define SZ_ERROR_FAIL 11\r\n#define SZ_ERROR_THREAD 12\r\n\r\n#define SZ_ERROR_ARCHIVE 16\r\n#define SZ_ERROR_NO_ARCHIVE 17\r\n\r\ntypedef int SRes;\r\n\r\n#ifdef _WIN32\r\n/* typedef DWORD WRes; */\r\ntypedef unsigned WRes;\r\n#else\r\ntypedef int WRes;\r\n#endif\r\n\r\n#ifndef RINOK\r\n#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; }\r\n#endif\r\n\r\ntypedef unsigned char Byte;\r\ntypedef short Int16;\r\ntypedef unsigned short UInt16;\r\n\r\n#ifdef _LZMA_UINT32_IS_ULONG\r\ntypedef long Int32;\r\ntypedef unsigned long UInt32;\r\n#else\r\ntypedef int Int32;\r\ntypedef unsigned int UInt32;\r\n#endif\r\n\r\n#ifdef _SZ_NO_INT_64\r\n\r\n/* define _SZ_NO_INT_64, if your compiler doesn't support 64-bit integers.\r\n   NOTES: Some code will work incorrectly in that case! */\r\n\r\ntypedef long Int64;\r\ntypedef unsigned long UInt64;\r\n\r\n#else\r\n\r\n#if defined(_MSC_VER) || defined(__BORLANDC__)\r\ntypedef __int64 Int64;\r\ntypedef unsigned __int64 UInt64;\r\n#define UINT64_CONST(n) n\r\n#else\r\ntypedef long long int Int64;\r\ntypedef unsigned long long int UInt64;\r\n#define UINT64_CONST(n) n ## ULL\r\n#endif\r\n\r\n#endif\r\n\r\n#ifdef _LZMA_NO_SYSTEM_SIZE_T\r\ntypedef UInt32 SizeT;\r\n#else\r\ntypedef size_t SizeT;\r\n#endif\r\n\r\ntypedef int Bool;\r\n#define True 1\r\n#define False 0\r\n\r\n\r\n#ifdef _WIN32\r\n#define MY_STD_CALL __stdcall\r\n#else\r\n#define MY_STD_CALL\r\n#endif\r\n\r\n#ifdef _MSC_VER\r\n\r\n#if _MSC_VER >= 1300\r\n#define MY_NO_INLINE __declspec(noinline)\r\n#else\r\n#define MY_NO_INLINE\r\n#endif\r\n\r\n#define MY_CDECL __cdecl\r\n#define MY_FAST_CALL __fastcall\r\n\r\n#else\r\n\r\n#define MY_NO_INLINE\r\n#define MY_CDECL\r\n#define MY_FAST_CALL\r\n\r\n#endif\r\n\r\n\r\n/* The following interfaces use first parameter as pointer to structure */\r\n\r\ntypedef struct\r\n{\r\n  Byte (*Read)(void *p); /* reads one byte, returns 0 in case of EOF or error */\r\n} IByteIn;\r\n\r\ntypedef struct\r\n{\r\n  void (*Write)(void *p, Byte b);\r\n} IByteOut;\r\n\r\ntypedef struct\r\n{\r\n  SRes (*Read)(void *p, void *buf, size_t *size);\r\n    /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.\r\n       (output(*size) < input(*size)) is allowed */\r\n} ISeqInStream;\r\n\r\n/* it can return SZ_ERROR_INPUT_EOF */\r\nSRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size);\r\nSRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType);\r\nSRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf);\r\n\r\ntypedef struct\r\n{\r\n  size_t (*Write)(void *p, const void *buf, size_t size);\r\n    /* Returns: result - the number of actually written bytes.\r\n       (result < size) means error */\r\n} ISeqOutStream;\r\n\r\ntypedef enum\r\n{\r\n  SZ_SEEK_SET = 0,\r\n  SZ_SEEK_CUR = 1,\r\n  SZ_SEEK_END = 2\r\n} ESzSeek;\r\n\r\ntypedef struct\r\n{\r\n  SRes (*Read)(void *p, void *buf, size_t *size);  /* same as ISeqInStream::Read */\r\n  SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin);\r\n} ISeekInStream;\r\n\r\ntypedef struct\r\n{\r\n  SRes (*Look)(void *p, const void **buf, size_t *size);\r\n    /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.\r\n       (output(*size) > input(*size)) is not allowed\r\n       (output(*size) < input(*size)) is allowed */\r\n  SRes (*Skip)(void *p, size_t offset);\r\n    /* offset must be <= output(*size) of Look */\r\n\r\n  SRes (*Read)(void *p, void *buf, size_t *size);\r\n    /* reads directly (without buffer). It's same as ISeqInStream::Read */\r\n  SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin);\r\n} ILookInStream;\r\n\r\nSRes LookInStream_LookRead(ILookInStream *stream, void *buf, size_t *size);\r\nSRes LookInStream_SeekTo(ILookInStream *stream, UInt64 offset);\r\n\r\n/* reads via ILookInStream::Read */\r\nSRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType);\r\nSRes LookInStream_Read(ILookInStream *stream, void *buf, size_t size);\r\n\r\n#define LookToRead_BUF_SIZE (1 << 14)\r\n\r\ntypedef struct\r\n{\r\n  ILookInStream s;\r\n  ISeekInStream *realStream;\r\n  size_t pos;\r\n  size_t size;\r\n  Byte buf[LookToRead_BUF_SIZE];\r\n} CLookToRead;\r\n\r\nvoid LookToRead_CreateVTable(CLookToRead *p, int lookahead);\r\nvoid LookToRead_Init(CLookToRead *p);\r\n\r\ntypedef struct\r\n{\r\n  ISeqInStream s;\r\n  ILookInStream *realStream;\r\n} CSecToLook;\r\n\r\nvoid SecToLook_CreateVTable(CSecToLook *p);\r\n\r\ntypedef struct\r\n{\r\n  ISeqInStream s;\r\n  ILookInStream *realStream;\r\n} CSecToRead;\r\n\r\nvoid SecToRead_CreateVTable(CSecToRead *p);\r\n\r\ntypedef struct\r\n{\r\n  SRes (*Progress)(void *p, UInt64 inSize, UInt64 outSize);\r\n    /* Returns: result. (result != SZ_OK) means break.\r\n       Value (UInt64)(Int64)-1 for size means unknown value. */\r\n} ICompressProgress;\r\n\r\ntypedef struct\r\n{\r\n  void *(*Alloc)(void *p, size_t size);\r\n  void (*Free)(void *p, void *address); /* address can be 0 */\r\n} ISzAlloc;\r\n\r\n#define IAlloc_Alloc(p, size) (p)->Alloc((p), size)\r\n#define IAlloc_Free(p, a) (p)->Free((p), a)\r\n\r\n#ifdef _WIN32\r\n\r\n#define CHAR_PATH_SEPARATOR '\\\\'\r\n#define WCHAR_PATH_SEPARATOR L'\\\\'\r\n#define STRING_PATH_SEPARATOR \"\\\\\"\r\n#define WSTRING_PATH_SEPARATOR L\"\\\\\"\r\n\r\n#else\r\n\r\n#define CHAR_PATH_SEPARATOR '/'\r\n#define WCHAR_PATH_SEPARATOR L'/'\r\n#define STRING_PATH_SEPARATOR \"/\"\r\n#define WSTRING_PATH_SEPARATOR L\"/\"\r\n\r\n#endif\r\n\r\nEXTERN_C_END\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/unarr/lzmasdk/CpuArch.c",
    "content": "/* CpuArch.c -- CPU specific code\r\n2012-05-29: Igor Pavlov : Public domain */\r\n\r\n#include \"Precomp.h\"\r\n\r\n#include \"CpuArch.h\"\r\n\r\n#ifdef MY_CPU_X86_OR_AMD64\r\n\r\n#if (defined(_MSC_VER) && !defined(MY_CPU_AMD64)) || defined(__GNUC__)\r\n#define USE_ASM\r\n#endif\r\n\r\n#if !defined(USE_ASM) && _MSC_VER >= 1500\r\n#include <intrin.h>\r\n#endif\r\n\r\n#if defined(USE_ASM) && !defined(MY_CPU_AMD64)\r\nstatic UInt32 CheckFlag(UInt32 flag)\r\n{\r\n  #ifdef _MSC_VER\r\n  __asm pushfd;\r\n  __asm pop EAX;\r\n  __asm mov EDX, EAX;\r\n  __asm xor EAX, flag;\r\n  __asm push EAX;\r\n  __asm popfd;\r\n  __asm pushfd;\r\n  __asm pop EAX;\r\n  __asm xor EAX, EDX;\r\n  __asm push EDX;\r\n  __asm popfd;\r\n  __asm and flag, EAX;\r\n  #else\r\n  __asm__ __volatile__ (\r\n    \"pushf\\n\\t\"\r\n    \"pop  %%EAX\\n\\t\"\r\n    \"movl %%EAX,%%EDX\\n\\t\"\r\n    \"xorl %0,%%EAX\\n\\t\"\r\n    \"push %%EAX\\n\\t\"\r\n    \"popf\\n\\t\"\r\n    \"pushf\\n\\t\"\r\n    \"pop  %%EAX\\n\\t\"\r\n    \"xorl %%EDX,%%EAX\\n\\t\"\r\n    \"push %%EDX\\n\\t\"\r\n    \"popf\\n\\t\"\r\n    \"andl %%EAX, %0\\n\\t\":\r\n    \"=c\" (flag) : \"c\" (flag));\r\n  #endif\r\n  return flag;\r\n}\r\n#define CHECK_CPUID_IS_SUPPORTED if (CheckFlag(1 << 18) == 0 || CheckFlag(1 << 21) == 0) return False;\r\n#else\r\n#define CHECK_CPUID_IS_SUPPORTED\r\n#endif\r\n\r\nstatic void MyCPUID(UInt32 function, UInt32 *a, UInt32 *b, UInt32 *c, UInt32 *d)\r\n{\r\n  #ifdef USE_ASM\r\n\r\n  #ifdef _MSC_VER\r\n\r\n  UInt32 a2, b2, c2, d2;\r\n  __asm xor EBX, EBX;\r\n  __asm xor ECX, ECX;\r\n  __asm xor EDX, EDX;\r\n  __asm mov EAX, function;\r\n  __asm cpuid;\r\n  __asm mov a2, EAX;\r\n  __asm mov b2, EBX;\r\n  __asm mov c2, ECX;\r\n  __asm mov d2, EDX;\r\n\r\n  *a = a2;\r\n  *b = b2;\r\n  *c = c2;\r\n  *d = d2;\r\n\r\n  #else\r\n\r\n  __asm__ __volatile__ (\r\n  #if defined(MY_CPU_X86) && defined(__PIC__)\r\n    \"mov %%ebx, %%edi;\"\r\n    \"cpuid;\"\r\n    \"xchgl %%ebx, %%edi;\"\r\n    : \"=a\" (*a) ,\r\n      \"=D\" (*b) ,\r\n  #else\r\n    \"cpuid\"\r\n    : \"=a\" (*a) ,\r\n      \"=b\" (*b) ,\r\n  #endif\r\n      \"=c\" (*c) ,\r\n      \"=d\" (*d)\r\n    : \"0\" (function)) ;\r\n\r\n  #endif\r\n  \r\n  #else\r\n\r\n  int CPUInfo[4];\r\n  __cpuid(CPUInfo, function);\r\n  *a = CPUInfo[0];\r\n  *b = CPUInfo[1];\r\n  *c = CPUInfo[2];\r\n  *d = CPUInfo[3];\r\n\r\n  #endif\r\n}\r\n\r\nBool x86cpuid_CheckAndRead(Cx86cpuid *p)\r\n{\r\n  CHECK_CPUID_IS_SUPPORTED\r\n  MyCPUID(0, &p->maxFunc, &p->vendor[0], &p->vendor[2], &p->vendor[1]);\r\n  MyCPUID(1, &p->ver, &p->b, &p->c, &p->d);\r\n  return True;\r\n}\r\n\r\nstatic UInt32 kVendors[][3] =\r\n{\r\n  { 0x756E6547, 0x49656E69, 0x6C65746E},\r\n  { 0x68747541, 0x69746E65, 0x444D4163},\r\n  { 0x746E6543, 0x48727561, 0x736C7561}\r\n};\r\n\r\nint x86cpuid_GetFirm(const Cx86cpuid *p)\r\n{\r\n  unsigned i;\r\n  for (i = 0; i < sizeof(kVendors) / sizeof(kVendors[i]); i++)\r\n  {\r\n    const UInt32 *v = kVendors[i];\r\n    if (v[0] == p->vendor[0] &&\r\n        v[1] == p->vendor[1] &&\r\n        v[2] == p->vendor[2])\r\n      return (int)i;\r\n  }\r\n  return -1;\r\n}\r\n\r\nBool CPU_Is_InOrder()\r\n{\r\n  Cx86cpuid p;\r\n  int firm;\r\n  UInt32 family, model;\r\n  if (!x86cpuid_CheckAndRead(&p))\r\n    return True;\r\n  family = x86cpuid_GetFamily(&p);\r\n  model = x86cpuid_GetModel(&p);\r\n  firm = x86cpuid_GetFirm(&p);\r\n  switch (firm)\r\n  {\r\n    case CPU_FIRM_INTEL: return (family < 6 || (family == 6 && (\r\n        /* Atom CPU */\r\n           model == 0x100C  /* 45 nm, N4xx, D4xx, N5xx, D5xx, 230, 330 */\r\n        || model == 0x2006  /* 45 nm, Z6xx */\r\n        || model == 0x2007  /* 32 nm, Z2460 */\r\n        || model == 0x3005  /* 32 nm, Z2760 */\r\n        || model == 0x3006  /* 32 nm, N2xxx, D2xxx */\r\n        )));\r\n    case CPU_FIRM_AMD: return (family < 5 || (family == 5 && (model < 6 || model == 0xA)));\r\n    case CPU_FIRM_VIA: return (family < 6 || (family == 6 && model < 0xF));\r\n  }\r\n  return True;\r\n}\r\n\r\n#if !defined(MY_CPU_AMD64) && defined(_WIN32)\r\n#include <windows.h>\r\nstatic Bool CPU_Sys_Is_SSE_Supported()\r\n{\r\n  OSVERSIONINFO vi;\r\n  vi.dwOSVersionInfoSize = sizeof(vi);\r\n  if (!GetVersionEx(&vi))\r\n    return False;\r\n  return (vi.dwMajorVersion >= 5);\r\n}\r\n#define CHECK_SYS_SSE_SUPPORT if (!CPU_Sys_Is_SSE_Supported()) return False;\r\n#else\r\n#define CHECK_SYS_SSE_SUPPORT\r\n#endif\r\n\r\nBool CPU_Is_Aes_Supported()\r\n{\r\n  Cx86cpuid p;\r\n  CHECK_SYS_SSE_SUPPORT\r\n  if (!x86cpuid_CheckAndRead(&p))\r\n    return False;\r\n  return (p.c >> 25) & 1;\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/unarr/lzmasdk/CpuArch.h",
    "content": "/* CpuArch.h -- CPU specific code\r\n2013-11-12: Igor Pavlov : Public domain */\r\n\r\n#ifndef __CPU_ARCH_H\r\n#define __CPU_ARCH_H\r\n\r\n#include \"7zTypes.h\"\r\n\r\nEXTERN_C_BEGIN\r\n\r\n/*\r\nMY_CPU_LE means that CPU is LITTLE ENDIAN.\r\nIf MY_CPU_LE is not defined, we don't know about that property of platform (it can be LITTLE ENDIAN).\r\n\r\nMY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned memory accesses.\r\nIf MY_CPU_LE_UNALIGN is not defined, we don't know about these properties of platform.\r\n*/\r\n\r\n#if defined(_M_X64) || defined(_M_AMD64) || defined(__x86_64__)\r\n#define MY_CPU_AMD64\r\n#endif\r\n\r\n#if defined(MY_CPU_AMD64) || defined(_M_IA64)\r\n#define MY_CPU_64BIT\r\n#endif\r\n\r\n#if defined(_M_IX86) || defined(__i386__)\r\n#define MY_CPU_X86\r\n#endif\r\n\r\n#if defined(MY_CPU_X86) || defined(MY_CPU_AMD64)\r\n#define MY_CPU_X86_OR_AMD64\r\n#endif\r\n\r\n#if defined(MY_CPU_X86) || defined(_M_ARM)\r\n#define MY_CPU_32BIT\r\n#endif\r\n\r\n#if defined(_WIN32) && defined(_M_ARM)\r\n#define MY_CPU_ARM_LE\r\n#endif\r\n\r\n#if defined(_WIN32) && defined(_M_IA64)\r\n#define MY_CPU_IA64_LE\r\n#endif\r\n\r\n#if defined(MY_CPU_X86_OR_AMD64)\r\n#define MY_CPU_LE_UNALIGN\r\n#endif\r\n\r\n#if defined(MY_CPU_X86_OR_AMD64) || defined(MY_CPU_ARM_LE)  || defined(MY_CPU_IA64_LE) || defined(__ARMEL__) || defined(__MIPSEL__) || defined(__LITTLE_ENDIAN__)\r\n#define MY_CPU_LE\r\n#endif\r\n\r\n#if defined(__BIG_ENDIAN__) || defined(__m68k__) ||  defined(__ARMEB__) || defined(__MIPSEB__)\r\n#define MY_CPU_BE\r\n#endif\r\n\r\n#if defined(MY_CPU_LE) && defined(MY_CPU_BE)\r\nStop_Compiling_Bad_Endian\r\n#endif\r\n\r\n#ifdef MY_CPU_LE_UNALIGN\r\n\r\n#define GetUi16(p) (*(const UInt16 *)(const void *)(p))\r\n#define GetUi32(p) (*(const UInt32 *)(const void *)(p))\r\n#define GetUi64(p) (*(const UInt64 *)(const void *)(p))\r\n#define SetUi16(p, d) *(UInt16 *)(p) = (d);\r\n#define SetUi32(p, d) *(UInt32 *)(p) = (d);\r\n#define SetUi64(p, d) *(UInt64 *)(p) = (d);\r\n\r\n#else\r\n\r\n#define GetUi16(p) (((const Byte *)(p))[0] | ((UInt16)((const Byte *)(p))[1] << 8))\r\n\r\n#define GetUi32(p) ( \\\r\n             ((const Byte *)(p))[0]        | \\\r\n    ((UInt32)((const Byte *)(p))[1] <<  8) | \\\r\n    ((UInt32)((const Byte *)(p))[2] << 16) | \\\r\n    ((UInt32)((const Byte *)(p))[3] << 24))\r\n\r\n#define GetUi64(p) (GetUi32(p) | ((UInt64)GetUi32(((const Byte *)(p)) + 4) << 32))\r\n\r\n#define SetUi16(p, d) { UInt32 _x_ = (d); \\\r\n    ((Byte *)(p))[0] = (Byte)_x_; \\\r\n    ((Byte *)(p))[1] = (Byte)(_x_ >> 8); }\r\n\r\n#define SetUi32(p, d) { UInt32 _x_ = (d); \\\r\n    ((Byte *)(p))[0] = (Byte)_x_; \\\r\n    ((Byte *)(p))[1] = (Byte)(_x_ >> 8); \\\r\n    ((Byte *)(p))[2] = (Byte)(_x_ >> 16); \\\r\n    ((Byte *)(p))[3] = (Byte)(_x_ >> 24); }\r\n\r\n#define SetUi64(p, d) { UInt64 _x64_ = (d); \\\r\n    SetUi32(p, (UInt32)_x64_); \\\r\n    SetUi32(((Byte *)(p)) + 4, (UInt32)(_x64_ >> 32)); }\r\n\r\n#endif\r\n\r\n#if defined(MY_CPU_LE_UNALIGN) && defined(_WIN64) && (_MSC_VER >= 1300)\r\n\r\n#include <stdlib.h>\r\n\r\n#pragma intrinsic(_byteswap_ulong)\r\n#pragma intrinsic(_byteswap_uint64)\r\n#define GetBe32(p) _byteswap_ulong(*(const UInt32 *)(const Byte *)(p))\r\n#define GetBe64(p) _byteswap_uint64(*(const UInt64 *)(const Byte *)(p))\r\n\r\n#else\r\n\r\n#define GetBe32(p) ( \\\r\n    ((UInt32)((const Byte *)(p))[0] << 24) | \\\r\n    ((UInt32)((const Byte *)(p))[1] << 16) | \\\r\n    ((UInt32)((const Byte *)(p))[2] <<  8) | \\\r\n             ((const Byte *)(p))[3] )\r\n\r\n#define GetBe64(p) (((UInt64)GetBe32(p) << 32) | GetBe32(((const Byte *)(p)) + 4))\r\n\r\n#endif\r\n\r\n#define GetBe16(p) ((UInt16)(((UInt16)((const Byte *)(p))[0] << 8) | ((const Byte *)(p))[1]))\r\n\r\n\r\n#ifdef MY_CPU_X86_OR_AMD64\r\n\r\ntypedef struct\r\n{\r\n  UInt32 maxFunc;\r\n  UInt32 vendor[3];\r\n  UInt32 ver;\r\n  UInt32 b;\r\n  UInt32 c;\r\n  UInt32 d;\r\n} Cx86cpuid;\r\n\r\nenum\r\n{\r\n  CPU_FIRM_INTEL,\r\n  CPU_FIRM_AMD,\r\n  CPU_FIRM_VIA\r\n};\r\n\r\nBool x86cpuid_CheckAndRead(Cx86cpuid *p);\r\nint x86cpuid_GetFirm(const Cx86cpuid *p);\r\n\r\n#define x86cpuid_GetFamily(p) (((p)->ver >> 8) & 0xFF00F)\r\n#define x86cpuid_GetModel(p) (((p)->ver >> 4) & 0xF00F)\r\n#define x86cpuid_GetStepping(p) ((p)->ver & 0xF)\r\n\r\nBool CPU_Is_InOrder();\r\nBool CPU_Is_Aes_Supported();\r\n\r\n#endif\r\n\r\nEXTERN_C_END\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/unarr/lzmasdk/LzmaDec.c",
    "content": "/* LzmaDec.c -- LZMA Decoder\r\n2015-01-01 : Igor Pavlov : Public domain */\r\n\r\n#include \"Precomp.h\"\r\n\r\n#include \"LzmaDec.h\"\r\n\r\n#include <string.h>\r\n\r\n#define kNumTopBits 24\r\n#define kTopValue ((UInt32)1 << kNumTopBits)\r\n\r\n#define kNumBitModelTotalBits 11\r\n#define kBitModelTotal (1 << kNumBitModelTotalBits)\r\n#define kNumMoveBits 5\r\n\r\n#define RC_INIT_SIZE 5\r\n\r\n#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); }\r\n\r\n#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)\r\n#define UPDATE_0(p) range = bound; *(p) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits));\r\n#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits));\r\n#define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \\\r\n  { UPDATE_0(p); i = (i + i); A0; } else \\\r\n  { UPDATE_1(p); i = (i + i) + 1; A1; }\r\n#define GET_BIT(p, i) GET_BIT2(p, i, ; , ;)\r\n\r\n#define TREE_GET_BIT(probs, i) { GET_BIT((probs + i), i); }\r\n#define TREE_DECODE(probs, limit, i) \\\r\n  { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; }\r\n\r\n/* #define _LZMA_SIZE_OPT */\r\n\r\n#ifdef _LZMA_SIZE_OPT\r\n#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i)\r\n#else\r\n#define TREE_6_DECODE(probs, i) \\\r\n  { i = 1; \\\r\n  TREE_GET_BIT(probs, i); \\\r\n  TREE_GET_BIT(probs, i); \\\r\n  TREE_GET_BIT(probs, i); \\\r\n  TREE_GET_BIT(probs, i); \\\r\n  TREE_GET_BIT(probs, i); \\\r\n  TREE_GET_BIT(probs, i); \\\r\n  i -= 0x40; }\r\n#endif\r\n\r\n#define NORMAL_LITER_DEC GET_BIT(prob + symbol, symbol)\r\n#define MATCHED_LITER_DEC \\\r\n  matchByte <<= 1; \\\r\n  bit = (matchByte & offs); \\\r\n  probLit = prob + offs + bit + symbol; \\\r\n  GET_BIT2(probLit, symbol, offs &= ~bit, offs &= bit)\r\n\r\n#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); }\r\n\r\n#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)\r\n#define UPDATE_0_CHECK range = bound;\r\n#define UPDATE_1_CHECK range -= bound; code -= bound;\r\n#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \\\r\n  { UPDATE_0_CHECK; i = (i + i); A0; } else \\\r\n  { UPDATE_1_CHECK; i = (i + i) + 1; A1; }\r\n#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;)\r\n#define TREE_DECODE_CHECK(probs, limit, i) \\\r\n  { i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; }\r\n\r\n\r\n#define kNumPosBitsMax 4\r\n#define kNumPosStatesMax (1 << kNumPosBitsMax)\r\n\r\n#define kLenNumLowBits 3\r\n#define kLenNumLowSymbols (1 << kLenNumLowBits)\r\n#define kLenNumMidBits 3\r\n#define kLenNumMidSymbols (1 << kLenNumMidBits)\r\n#define kLenNumHighBits 8\r\n#define kLenNumHighSymbols (1 << kLenNumHighBits)\r\n\r\n#define LenChoice 0\r\n#define LenChoice2 (LenChoice + 1)\r\n#define LenLow (LenChoice2 + 1)\r\n#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))\r\n#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))\r\n#define kNumLenProbs (LenHigh + kLenNumHighSymbols)\r\n\r\n\r\n#define kNumStates 12\r\n#define kNumLitStates 7\r\n\r\n#define kStartPosModelIndex 4\r\n#define kEndPosModelIndex 14\r\n#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))\r\n\r\n#define kNumPosSlotBits 6\r\n#define kNumLenToPosStates 4\r\n\r\n#define kNumAlignBits 4\r\n#define kAlignTableSize (1 << kNumAlignBits)\r\n\r\n#define kMatchMinLen 2\r\n#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols)\r\n\r\n#define IsMatch 0\r\n#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax))\r\n#define IsRepG0 (IsRep + kNumStates)\r\n#define IsRepG1 (IsRepG0 + kNumStates)\r\n#define IsRepG2 (IsRepG1 + kNumStates)\r\n#define IsRep0Long (IsRepG2 + kNumStates)\r\n#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax))\r\n#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits))\r\n#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex)\r\n#define LenCoder (Align + kAlignTableSize)\r\n#define RepLenCoder (LenCoder + kNumLenProbs)\r\n#define Literal (RepLenCoder + kNumLenProbs)\r\n\r\n#define LZMA_BASE_SIZE 1846\r\n#define LZMA_LIT_SIZE 768\r\n\r\n#define LzmaProps_GetNumProbs(p) ((UInt32)LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((p)->lc + (p)->lp)))\r\n\r\n#if Literal != LZMA_BASE_SIZE\r\nStopCompilingDueBUG\r\n#endif\r\n\r\n#define LZMA_DIC_MIN (1 << 12)\r\n\r\n/* First LZMA-symbol is always decoded.\r\nAnd it decodes new LZMA-symbols while (buf < bufLimit), but \"buf\" is without last normalization\r\nOut:\r\n  Result:\r\n    SZ_OK - OK\r\n    SZ_ERROR_DATA - Error\r\n  p->remainLen:\r\n    < kMatchSpecLenStart : normal remain\r\n    = kMatchSpecLenStart : finished\r\n    = kMatchSpecLenStart + 1 : Flush marker\r\n    = kMatchSpecLenStart + 2 : State Init Marker\r\n*/\r\n\r\nstatic int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte *bufLimit)\r\n{\r\n  CLzmaProb *probs = p->probs;\r\n\r\n  unsigned state = p->state;\r\n  UInt32 rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3];\r\n  unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1;\r\n  unsigned lpMask = ((unsigned)1 << (p->prop.lp)) - 1;\r\n  unsigned lc = p->prop.lc;\r\n\r\n  Byte *dic = p->dic;\r\n  SizeT dicBufSize = p->dicBufSize;\r\n  SizeT dicPos = p->dicPos;\r\n  \r\n  UInt32 processedPos = p->processedPos;\r\n  UInt32 checkDicSize = p->checkDicSize;\r\n  unsigned len = 0;\r\n\r\n  const Byte *buf = p->buf;\r\n  UInt32 range = p->range;\r\n  UInt32 code = p->code;\r\n\r\n  do\r\n  {\r\n    CLzmaProb *prob;\r\n    UInt32 bound;\r\n    unsigned ttt;\r\n    unsigned posState = processedPos & pbMask;\r\n\r\n    prob = probs + IsMatch + (state << kNumPosBitsMax) + posState;\r\n    IF_BIT_0(prob)\r\n    {\r\n      unsigned symbol;\r\n      UPDATE_0(prob);\r\n      prob = probs + Literal;\r\n      if (checkDicSize != 0 || processedPos != 0)\r\n        prob += (LZMA_LIT_SIZE * (((processedPos & lpMask) << lc) +\r\n        (dic[(dicPos == 0 ? dicBufSize : dicPos) - 1] >> (8 - lc))));\r\n\r\n      if (state < kNumLitStates)\r\n      {\r\n        state -= (state < 4) ? state : 3;\r\n        symbol = 1;\r\n        #ifdef _LZMA_SIZE_OPT\r\n        do { NORMAL_LITER_DEC } while (symbol < 0x100);\r\n        #else\r\n        NORMAL_LITER_DEC\r\n        NORMAL_LITER_DEC\r\n        NORMAL_LITER_DEC\r\n        NORMAL_LITER_DEC\r\n        NORMAL_LITER_DEC\r\n        NORMAL_LITER_DEC\r\n        NORMAL_LITER_DEC\r\n        NORMAL_LITER_DEC\r\n        #endif\r\n      }\r\n      else\r\n      {\r\n        unsigned matchByte = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];\r\n        unsigned offs = 0x100;\r\n        state -= (state < 10) ? 3 : 6;\r\n        symbol = 1;\r\n        #ifdef _LZMA_SIZE_OPT\r\n        do\r\n        {\r\n          unsigned bit;\r\n          CLzmaProb *probLit;\r\n          MATCHED_LITER_DEC\r\n        }\r\n        while (symbol < 0x100);\r\n        #else\r\n        {\r\n          unsigned bit;\r\n          CLzmaProb *probLit;\r\n          MATCHED_LITER_DEC\r\n          MATCHED_LITER_DEC\r\n          MATCHED_LITER_DEC\r\n          MATCHED_LITER_DEC\r\n          MATCHED_LITER_DEC\r\n          MATCHED_LITER_DEC\r\n          MATCHED_LITER_DEC\r\n          MATCHED_LITER_DEC\r\n        }\r\n        #endif\r\n      }\r\n      dic[dicPos++] = (Byte)symbol;\r\n      processedPos++;\r\n      continue;\r\n    }\r\n    else\r\n    {\r\n      UPDATE_1(prob);\r\n      prob = probs + IsRep + state;\r\n      IF_BIT_0(prob)\r\n      {\r\n        UPDATE_0(prob);\r\n        state += kNumStates;\r\n        prob = probs + LenCoder;\r\n      }\r\n      else\r\n      {\r\n        UPDATE_1(prob);\r\n        if (checkDicSize == 0 && processedPos == 0)\r\n          return SZ_ERROR_DATA;\r\n        prob = probs + IsRepG0 + state;\r\n        IF_BIT_0(prob)\r\n        {\r\n          UPDATE_0(prob);\r\n          prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState;\r\n          IF_BIT_0(prob)\r\n          {\r\n            UPDATE_0(prob);\r\n            dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];\r\n            dicPos++;\r\n            processedPos++;\r\n            state = state < kNumLitStates ? 9 : 11;\r\n            continue;\r\n          }\r\n          UPDATE_1(prob);\r\n        }\r\n        else\r\n        {\r\n          UInt32 distance;\r\n          UPDATE_1(prob);\r\n          prob = probs + IsRepG1 + state;\r\n          IF_BIT_0(prob)\r\n          {\r\n            UPDATE_0(prob);\r\n            distance = rep1;\r\n          }\r\n          else\r\n          {\r\n            UPDATE_1(prob);\r\n            prob = probs + IsRepG2 + state;\r\n            IF_BIT_0(prob)\r\n            {\r\n              UPDATE_0(prob);\r\n              distance = rep2;\r\n            }\r\n            else\r\n            {\r\n              UPDATE_1(prob);\r\n              distance = rep3;\r\n              rep3 = rep2;\r\n            }\r\n            rep2 = rep1;\r\n          }\r\n          rep1 = rep0;\r\n          rep0 = distance;\r\n        }\r\n        state = state < kNumLitStates ? 8 : 11;\r\n        prob = probs + RepLenCoder;\r\n      }\r\n      {\r\n        unsigned limit, offset;\r\n        CLzmaProb *probLen = prob + LenChoice;\r\n        IF_BIT_0(probLen)\r\n        {\r\n          UPDATE_0(probLen);\r\n          probLen = prob + LenLow + (posState << kLenNumLowBits);\r\n          offset = 0;\r\n          limit = (1 << kLenNumLowBits);\r\n        }\r\n        else\r\n        {\r\n          UPDATE_1(probLen);\r\n          probLen = prob + LenChoice2;\r\n          IF_BIT_0(probLen)\r\n          {\r\n            UPDATE_0(probLen);\r\n            probLen = prob + LenMid + (posState << kLenNumMidBits);\r\n            offset = kLenNumLowSymbols;\r\n            limit = (1 << kLenNumMidBits);\r\n          }\r\n          else\r\n          {\r\n            UPDATE_1(probLen);\r\n            probLen = prob + LenHigh;\r\n            offset = kLenNumLowSymbols + kLenNumMidSymbols;\r\n            limit = (1 << kLenNumHighBits);\r\n          }\r\n        }\r\n        TREE_DECODE(probLen, limit, len);\r\n        len += offset;\r\n      }\r\n\r\n      if (state >= kNumStates)\r\n      {\r\n        UInt32 distance;\r\n        prob = probs + PosSlot +\r\n            ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits);\r\n        TREE_6_DECODE(prob, distance);\r\n        if (distance >= kStartPosModelIndex)\r\n        {\r\n          unsigned posSlot = (unsigned)distance;\r\n          int numDirectBits = (int)(((distance >> 1) - 1));\r\n          distance = (2 | (distance & 1));\r\n          if (posSlot < kEndPosModelIndex)\r\n          {\r\n            distance <<= numDirectBits;\r\n            prob = probs + SpecPos + distance - posSlot - 1;\r\n            {\r\n              UInt32 mask = 1;\r\n              unsigned i = 1;\r\n              do\r\n              {\r\n                GET_BIT2(prob + i, i, ; , distance |= mask);\r\n                mask <<= 1;\r\n              }\r\n              while (--numDirectBits != 0);\r\n            }\r\n          }\r\n          else\r\n          {\r\n            numDirectBits -= kNumAlignBits;\r\n            do\r\n            {\r\n              NORMALIZE\r\n              range >>= 1;\r\n              \r\n              {\r\n                UInt32 t;\r\n                code -= range;\r\n                t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */\r\n                distance = (distance << 1) + (t + 1);\r\n                code += range & t;\r\n              }\r\n              /*\r\n              distance <<= 1;\r\n              if (code >= range)\r\n              {\r\n                code -= range;\r\n                distance |= 1;\r\n              }\r\n              */\r\n            }\r\n            while (--numDirectBits != 0);\r\n            prob = probs + Align;\r\n            distance <<= kNumAlignBits;\r\n            {\r\n              unsigned i = 1;\r\n              GET_BIT2(prob + i, i, ; , distance |= 1);\r\n              GET_BIT2(prob + i, i, ; , distance |= 2);\r\n              GET_BIT2(prob + i, i, ; , distance |= 4);\r\n              GET_BIT2(prob + i, i, ; , distance |= 8);\r\n            }\r\n            if (distance == (UInt32)0xFFFFFFFF)\r\n            {\r\n              len += kMatchSpecLenStart;\r\n              state -= kNumStates;\r\n              break;\r\n            }\r\n          }\r\n        }\r\n        rep3 = rep2;\r\n        rep2 = rep1;\r\n        rep1 = rep0;\r\n        rep0 = distance + 1;\r\n        if (checkDicSize == 0)\r\n        {\r\n          if (distance >= processedPos)\r\n            return SZ_ERROR_DATA;\r\n        }\r\n        else if (distance >= checkDicSize)\r\n          return SZ_ERROR_DATA;\r\n        state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3;\r\n      }\r\n\r\n      len += kMatchMinLen;\r\n\r\n      if (limit == dicPos)\r\n        return SZ_ERROR_DATA;\r\n      {\r\n        SizeT rem = limit - dicPos;\r\n        unsigned curLen = ((rem < len) ? (unsigned)rem : len);\r\n        SizeT pos = (dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0);\r\n\r\n        processedPos += curLen;\r\n\r\n        len -= curLen;\r\n        if (pos + curLen <= dicBufSize)\r\n        {\r\n          Byte *dest = dic + dicPos;\r\n          ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos;\r\n          const Byte *lim = dest + curLen;\r\n          dicPos += curLen;\r\n          do\r\n            *(dest) = (Byte)*(dest + src);\r\n          while (++dest != lim);\r\n        }\r\n        else\r\n        {\r\n          do\r\n          {\r\n            dic[dicPos++] = dic[pos];\r\n            if (++pos == dicBufSize)\r\n              pos = 0;\r\n          }\r\n          while (--curLen != 0);\r\n        }\r\n      }\r\n    }\r\n  }\r\n  while (dicPos < limit && buf < bufLimit);\r\n  NORMALIZE;\r\n  p->buf = buf;\r\n  p->range = range;\r\n  p->code = code;\r\n  p->remainLen = len;\r\n  p->dicPos = dicPos;\r\n  p->processedPos = processedPos;\r\n  p->reps[0] = rep0;\r\n  p->reps[1] = rep1;\r\n  p->reps[2] = rep2;\r\n  p->reps[3] = rep3;\r\n  p->state = state;\r\n\r\n  return SZ_OK;\r\n}\r\n\r\nstatic void MY_FAST_CALL LzmaDec_WriteRem(CLzmaDec *p, SizeT limit)\r\n{\r\n  if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart)\r\n  {\r\n    Byte *dic = p->dic;\r\n    SizeT dicPos = p->dicPos;\r\n    SizeT dicBufSize = p->dicBufSize;\r\n    unsigned len = p->remainLen;\r\n    UInt32 rep0 = p->reps[0];\r\n    if (limit - dicPos < len)\r\n      len = (unsigned)(limit - dicPos);\r\n\r\n    if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len)\r\n      p->checkDicSize = p->prop.dicSize;\r\n\r\n    p->processedPos += len;\r\n    p->remainLen -= len;\r\n    while (len != 0)\r\n    {\r\n      len--;\r\n      dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];\r\n      dicPos++;\r\n    }\r\n    p->dicPos = dicPos;\r\n  }\r\n}\r\n\r\nstatic int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const Byte *bufLimit)\r\n{\r\n  do\r\n  {\r\n    SizeT limit2 = limit;\r\n    if (p->checkDicSize == 0)\r\n    {\r\n      UInt32 rem = p->prop.dicSize - p->processedPos;\r\n      if (limit - p->dicPos > rem)\r\n        limit2 = p->dicPos + rem;\r\n    }\r\n    RINOK(LzmaDec_DecodeReal(p, limit2, bufLimit));\r\n    if (p->processedPos >= p->prop.dicSize)\r\n      p->checkDicSize = p->prop.dicSize;\r\n    LzmaDec_WriteRem(p, limit);\r\n  }\r\n  while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart);\r\n\r\n  if (p->remainLen > kMatchSpecLenStart)\r\n  {\r\n    p->remainLen = kMatchSpecLenStart;\r\n  }\r\n  return 0;\r\n}\r\n\r\ntypedef enum\r\n{\r\n  DUMMY_ERROR, /* unexpected end of input stream */\r\n  DUMMY_LIT,\r\n  DUMMY_MATCH,\r\n  DUMMY_REP\r\n} ELzmaDummy;\r\n\r\nstatic ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inSize)\r\n{\r\n  UInt32 range = p->range;\r\n  UInt32 code = p->code;\r\n  const Byte *bufLimit = buf + inSize;\r\n  CLzmaProb *probs = p->probs;\r\n  unsigned state = p->state;\r\n  ELzmaDummy res;\r\n\r\n  {\r\n    CLzmaProb *prob;\r\n    UInt32 bound;\r\n    unsigned ttt;\r\n    unsigned posState = (p->processedPos) & ((1 << p->prop.pb) - 1);\r\n\r\n    prob = probs + IsMatch + (state << kNumPosBitsMax) + posState;\r\n    IF_BIT_0_CHECK(prob)\r\n    {\r\n      UPDATE_0_CHECK\r\n\r\n      /* if (bufLimit - buf >= 7) return DUMMY_LIT; */\r\n\r\n      prob = probs + Literal;\r\n      if (p->checkDicSize != 0 || p->processedPos != 0)\r\n        prob += (LZMA_LIT_SIZE *\r\n          ((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) +\r\n          (p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc))));\r\n\r\n      if (state < kNumLitStates)\r\n      {\r\n        unsigned symbol = 1;\r\n        do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100);\r\n      }\r\n      else\r\n      {\r\n        unsigned matchByte = p->dic[p->dicPos - p->reps[0] +\r\n            ((p->dicPos < p->reps[0]) ? p->dicBufSize : 0)];\r\n        unsigned offs = 0x100;\r\n        unsigned symbol = 1;\r\n        do\r\n        {\r\n          unsigned bit;\r\n          CLzmaProb *probLit;\r\n          matchByte <<= 1;\r\n          bit = (matchByte & offs);\r\n          probLit = prob + offs + bit + symbol;\r\n          GET_BIT2_CHECK(probLit, symbol, offs &= ~bit, offs &= bit)\r\n        }\r\n        while (symbol < 0x100);\r\n      }\r\n      res = DUMMY_LIT;\r\n    }\r\n    else\r\n    {\r\n      unsigned len;\r\n      UPDATE_1_CHECK;\r\n\r\n      prob = probs + IsRep + state;\r\n      IF_BIT_0_CHECK(prob)\r\n      {\r\n        UPDATE_0_CHECK;\r\n        state = 0;\r\n        prob = probs + LenCoder;\r\n        res = DUMMY_MATCH;\r\n      }\r\n      else\r\n      {\r\n        UPDATE_1_CHECK;\r\n        res = DUMMY_REP;\r\n        prob = probs + IsRepG0 + state;\r\n        IF_BIT_0_CHECK(prob)\r\n        {\r\n          UPDATE_0_CHECK;\r\n          prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState;\r\n          IF_BIT_0_CHECK(prob)\r\n          {\r\n            UPDATE_0_CHECK;\r\n            NORMALIZE_CHECK;\r\n            return DUMMY_REP;\r\n          }\r\n          else\r\n          {\r\n            UPDATE_1_CHECK;\r\n          }\r\n        }\r\n        else\r\n        {\r\n          UPDATE_1_CHECK;\r\n          prob = probs + IsRepG1 + state;\r\n          IF_BIT_0_CHECK(prob)\r\n          {\r\n            UPDATE_0_CHECK;\r\n          }\r\n          else\r\n          {\r\n            UPDATE_1_CHECK;\r\n            prob = probs + IsRepG2 + state;\r\n            IF_BIT_0_CHECK(prob)\r\n            {\r\n              UPDATE_0_CHECK;\r\n            }\r\n            else\r\n            {\r\n              UPDATE_1_CHECK;\r\n            }\r\n          }\r\n        }\r\n        state = kNumStates;\r\n        prob = probs + RepLenCoder;\r\n      }\r\n      {\r\n        unsigned limit, offset;\r\n        CLzmaProb *probLen = prob + LenChoice;\r\n        IF_BIT_0_CHECK(probLen)\r\n        {\r\n          UPDATE_0_CHECK;\r\n          probLen = prob + LenLow + (posState << kLenNumLowBits);\r\n          offset = 0;\r\n          limit = 1 << kLenNumLowBits;\r\n        }\r\n        else\r\n        {\r\n          UPDATE_1_CHECK;\r\n          probLen = prob + LenChoice2;\r\n          IF_BIT_0_CHECK(probLen)\r\n          {\r\n            UPDATE_0_CHECK;\r\n            probLen = prob + LenMid + (posState << kLenNumMidBits);\r\n            offset = kLenNumLowSymbols;\r\n            limit = 1 << kLenNumMidBits;\r\n          }\r\n          else\r\n          {\r\n            UPDATE_1_CHECK;\r\n            probLen = prob + LenHigh;\r\n            offset = kLenNumLowSymbols + kLenNumMidSymbols;\r\n            limit = 1 << kLenNumHighBits;\r\n          }\r\n        }\r\n        TREE_DECODE_CHECK(probLen, limit, len);\r\n        len += offset;\r\n      }\r\n\r\n      if (state < 4)\r\n      {\r\n        unsigned posSlot;\r\n        prob = probs + PosSlot +\r\n            ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<\r\n            kNumPosSlotBits);\r\n        TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot);\r\n        if (posSlot >= kStartPosModelIndex)\r\n        {\r\n          int numDirectBits = ((posSlot >> 1) - 1);\r\n\r\n          /* if (bufLimit - buf >= 8) return DUMMY_MATCH; */\r\n\r\n          if (posSlot < kEndPosModelIndex)\r\n          {\r\n            prob = probs + SpecPos + ((2 | (posSlot & 1)) << numDirectBits) - posSlot - 1;\r\n          }\r\n          else\r\n          {\r\n            numDirectBits -= kNumAlignBits;\r\n            do\r\n            {\r\n              NORMALIZE_CHECK\r\n              range >>= 1;\r\n              code -= range & (((code - range) >> 31) - 1);\r\n              /* if (code >= range) code -= range; */\r\n            }\r\n            while (--numDirectBits != 0);\r\n            prob = probs + Align;\r\n            numDirectBits = kNumAlignBits;\r\n          }\r\n          {\r\n            unsigned i = 1;\r\n            do\r\n            {\r\n              GET_BIT_CHECK(prob + i, i);\r\n            }\r\n            while (--numDirectBits != 0);\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n  NORMALIZE_CHECK;\r\n  return res;\r\n}\r\n\r\n\r\nstatic void LzmaDec_InitRc(CLzmaDec *p, const Byte *data)\r\n{\r\n  p->code = ((UInt32)data[1] << 24) | ((UInt32)data[2] << 16) | ((UInt32)data[3] << 8) | ((UInt32)data[4]);\r\n  p->range = 0xFFFFFFFF;\r\n  p->needFlush = 0;\r\n}\r\n\r\nvoid LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState)\r\n{\r\n  p->needFlush = 1;\r\n  p->remainLen = 0;\r\n  p->tempBufSize = 0;\r\n\r\n  if (initDic)\r\n  {\r\n    p->processedPos = 0;\r\n    p->checkDicSize = 0;\r\n    p->needInitState = 1;\r\n  }\r\n  if (initState)\r\n    p->needInitState = 1;\r\n}\r\n\r\nvoid LzmaDec_Init(CLzmaDec *p)\r\n{\r\n  p->dicPos = 0;\r\n  LzmaDec_InitDicAndState(p, True, True);\r\n}\r\n\r\nstatic void LzmaDec_InitStateReal(CLzmaDec *p)\r\n{\r\n  UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (p->prop.lc + p->prop.lp));\r\n  UInt32 i;\r\n  CLzmaProb *probs = p->probs;\r\n  for (i = 0; i < numProbs; i++)\r\n    probs[i] = kBitModelTotal >> 1;\r\n  p->reps[0] = p->reps[1] = p->reps[2] = p->reps[3] = 1;\r\n  p->state = 0;\r\n  p->needInitState = 0;\r\n}\r\n\r\nSRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen,\r\n    ELzmaFinishMode finishMode, ELzmaStatus *status)\r\n{\r\n  SizeT inSize = *srcLen;\r\n  (*srcLen) = 0;\r\n  LzmaDec_WriteRem(p, dicLimit);\r\n  \r\n  *status = LZMA_STATUS_NOT_SPECIFIED;\r\n\r\n  while (p->remainLen != kMatchSpecLenStart)\r\n  {\r\n      int checkEndMarkNow;\r\n\r\n      if (p->needFlush != 0)\r\n      {\r\n        for (; inSize > 0 && p->tempBufSize < RC_INIT_SIZE; (*srcLen)++, inSize--)\r\n          p->tempBuf[p->tempBufSize++] = *src++;\r\n        if (p->tempBufSize < RC_INIT_SIZE)\r\n        {\r\n          *status = LZMA_STATUS_NEEDS_MORE_INPUT;\r\n          return SZ_OK;\r\n        }\r\n        if (p->tempBuf[0] != 0)\r\n          return SZ_ERROR_DATA;\r\n\r\n        LzmaDec_InitRc(p, p->tempBuf);\r\n        p->tempBufSize = 0;\r\n      }\r\n\r\n      checkEndMarkNow = 0;\r\n      if (p->dicPos >= dicLimit)\r\n      {\r\n        if (p->remainLen == 0 && p->code == 0)\r\n        {\r\n          *status = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK;\r\n          return SZ_OK;\r\n        }\r\n        if (finishMode == LZMA_FINISH_ANY)\r\n        {\r\n          *status = LZMA_STATUS_NOT_FINISHED;\r\n          return SZ_OK;\r\n        }\r\n        if (p->remainLen != 0)\r\n        {\r\n          *status = LZMA_STATUS_NOT_FINISHED;\r\n          return SZ_ERROR_DATA;\r\n        }\r\n        checkEndMarkNow = 1;\r\n      }\r\n\r\n      if (p->needInitState)\r\n        LzmaDec_InitStateReal(p);\r\n  \r\n      if (p->tempBufSize == 0)\r\n      {\r\n        SizeT processed;\r\n        const Byte *bufLimit;\r\n        if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow)\r\n        {\r\n          int dummyRes = LzmaDec_TryDummy(p, src, inSize);\r\n          if (dummyRes == DUMMY_ERROR)\r\n          {\r\n            memcpy(p->tempBuf, src, inSize);\r\n            p->tempBufSize = (unsigned)inSize;\r\n            (*srcLen) += inSize;\r\n            *status = LZMA_STATUS_NEEDS_MORE_INPUT;\r\n            return SZ_OK;\r\n          }\r\n          if (checkEndMarkNow && dummyRes != DUMMY_MATCH)\r\n          {\r\n            *status = LZMA_STATUS_NOT_FINISHED;\r\n            return SZ_ERROR_DATA;\r\n          }\r\n          bufLimit = src;\r\n        }\r\n        else\r\n          bufLimit = src + inSize - LZMA_REQUIRED_INPUT_MAX;\r\n        p->buf = src;\r\n        if (LzmaDec_DecodeReal2(p, dicLimit, bufLimit) != 0)\r\n          return SZ_ERROR_DATA;\r\n        processed = (SizeT)(p->buf - src);\r\n        (*srcLen) += processed;\r\n        src += processed;\r\n        inSize -= processed;\r\n      }\r\n      else\r\n      {\r\n        unsigned rem = p->tempBufSize, lookAhead = 0;\r\n        while (rem < LZMA_REQUIRED_INPUT_MAX && lookAhead < inSize)\r\n          p->tempBuf[rem++] = src[lookAhead++];\r\n        p->tempBufSize = rem;\r\n        if (rem < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow)\r\n        {\r\n          int dummyRes = LzmaDec_TryDummy(p, p->tempBuf, rem);\r\n          if (dummyRes == DUMMY_ERROR)\r\n          {\r\n            (*srcLen) += lookAhead;\r\n            *status = LZMA_STATUS_NEEDS_MORE_INPUT;\r\n            return SZ_OK;\r\n          }\r\n          if (checkEndMarkNow && dummyRes != DUMMY_MATCH)\r\n          {\r\n            *status = LZMA_STATUS_NOT_FINISHED;\r\n            return SZ_ERROR_DATA;\r\n          }\r\n        }\r\n        p->buf = p->tempBuf;\r\n        if (LzmaDec_DecodeReal2(p, dicLimit, p->buf) != 0)\r\n          return SZ_ERROR_DATA;\r\n        lookAhead -= (rem - (unsigned)(p->buf - p->tempBuf));\r\n        (*srcLen) += lookAhead;\r\n        src += lookAhead;\r\n        inSize -= lookAhead;\r\n        p->tempBufSize = 0;\r\n      }\r\n  }\r\n  if (p->code == 0)\r\n    *status = LZMA_STATUS_FINISHED_WITH_MARK;\r\n  return (p->code == 0) ? SZ_OK : SZ_ERROR_DATA;\r\n}\r\n\r\nSRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)\r\n{\r\n  SizeT outSize = *destLen;\r\n  SizeT inSize = *srcLen;\r\n  *srcLen = *destLen = 0;\r\n  for (;;)\r\n  {\r\n    SizeT inSizeCur = inSize, outSizeCur, dicPos;\r\n    ELzmaFinishMode curFinishMode;\r\n    SRes res;\r\n    if (p->dicPos == p->dicBufSize)\r\n      p->dicPos = 0;\r\n    dicPos = p->dicPos;\r\n    if (outSize > p->dicBufSize - dicPos)\r\n    {\r\n      outSizeCur = p->dicBufSize;\r\n      curFinishMode = LZMA_FINISH_ANY;\r\n    }\r\n    else\r\n    {\r\n      outSizeCur = dicPos + outSize;\r\n      curFinishMode = finishMode;\r\n    }\r\n\r\n    res = LzmaDec_DecodeToDic(p, outSizeCur, src, &inSizeCur, curFinishMode, status);\r\n    src += inSizeCur;\r\n    inSize -= inSizeCur;\r\n    *srcLen += inSizeCur;\r\n    outSizeCur = p->dicPos - dicPos;\r\n    memcpy(dest, p->dic + dicPos, outSizeCur);\r\n    dest += outSizeCur;\r\n    outSize -= outSizeCur;\r\n    *destLen += outSizeCur;\r\n    if (res != 0)\r\n      return res;\r\n    if (outSizeCur == 0 || outSize == 0)\r\n      return SZ_OK;\r\n  }\r\n}\r\n\r\nvoid LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc)\r\n{\r\n  alloc->Free(alloc, p->probs);\r\n  p->probs = 0;\r\n}\r\n\r\nstatic void LzmaDec_FreeDict(CLzmaDec *p, ISzAlloc *alloc)\r\n{\r\n  alloc->Free(alloc, p->dic);\r\n  p->dic = 0;\r\n}\r\n\r\nvoid LzmaDec_Free(CLzmaDec *p, ISzAlloc *alloc)\r\n{\r\n  LzmaDec_FreeProbs(p, alloc);\r\n  LzmaDec_FreeDict(p, alloc);\r\n}\r\n\r\nSRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size)\r\n{\r\n  UInt32 dicSize;\r\n  Byte d;\r\n  \r\n  if (size < LZMA_PROPS_SIZE)\r\n    return SZ_ERROR_UNSUPPORTED;\r\n  else\r\n    dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24);\r\n \r\n  if (dicSize < LZMA_DIC_MIN)\r\n    dicSize = LZMA_DIC_MIN;\r\n  p->dicSize = dicSize;\r\n\r\n  d = data[0];\r\n  if (d >= (9 * 5 * 5))\r\n    return SZ_ERROR_UNSUPPORTED;\r\n\r\n  p->lc = d % 9;\r\n  d /= 9;\r\n  p->pb = d / 5;\r\n  p->lp = d % 5;\r\n\r\n  return SZ_OK;\r\n}\r\n\r\nstatic SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc)\r\n{\r\n  UInt32 numProbs = LzmaProps_GetNumProbs(propNew);\r\n  if (p->probs == 0 || numProbs != p->numProbs)\r\n  {\r\n    LzmaDec_FreeProbs(p, alloc);\r\n    p->probs = (CLzmaProb *)alloc->Alloc(alloc, numProbs * sizeof(CLzmaProb));\r\n    p->numProbs = numProbs;\r\n    if (p->probs == 0)\r\n      return SZ_ERROR_MEM;\r\n  }\r\n  return SZ_OK;\r\n}\r\n\r\nSRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc)\r\n{\r\n  CLzmaProps propNew;\r\n  RINOK(LzmaProps_Decode(&propNew, props, propsSize));\r\n  RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc));\r\n  p->prop = propNew;\r\n  return SZ_OK;\r\n}\r\n\r\nSRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc)\r\n{\r\n  CLzmaProps propNew;\r\n  SizeT dicBufSize;\r\n  RINOK(LzmaProps_Decode(&propNew, props, propsSize));\r\n  RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc));\r\n  dicBufSize = propNew.dicSize;\r\n  if (p->dic == 0 || dicBufSize != p->dicBufSize)\r\n  {\r\n    LzmaDec_FreeDict(p, alloc);\r\n    p->dic = (Byte *)alloc->Alloc(alloc, dicBufSize);\r\n    if (p->dic == 0)\r\n    {\r\n      LzmaDec_FreeProbs(p, alloc);\r\n      return SZ_ERROR_MEM;\r\n    }\r\n  }\r\n  p->dicBufSize = dicBufSize;\r\n  p->prop = propNew;\r\n  return SZ_OK;\r\n}\r\n\r\nSRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,\r\n    const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,\r\n    ELzmaStatus *status, ISzAlloc *alloc)\r\n{\r\n  CLzmaDec p;\r\n  SRes res;\r\n  SizeT outSize = *destLen, inSize = *srcLen;\r\n  *destLen = *srcLen = 0;\r\n  *status = LZMA_STATUS_NOT_SPECIFIED;\r\n  if (inSize < RC_INIT_SIZE)\r\n    return SZ_ERROR_INPUT_EOF;\r\n  LzmaDec_Construct(&p);\r\n  RINOK(LzmaDec_AllocateProbs(&p, propData, propSize, alloc));\r\n  p.dic = dest;\r\n  p.dicBufSize = outSize;\r\n  LzmaDec_Init(&p);\r\n  *srcLen = inSize;\r\n  res = LzmaDec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status);\r\n  *destLen = p.dicPos;\r\n  if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT)\r\n    res = SZ_ERROR_INPUT_EOF;\r\n  LzmaDec_FreeProbs(&p, alloc);\r\n  return res;\r\n}\r\n"
  },
  {
    "path": "ext/unarr/lzmasdk/LzmaDec.h",
    "content": "/* LzmaDec.h -- LZMA Decoder\r\n2013-01-18 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __LZMA_DEC_H\r\n#define __LZMA_DEC_H\r\n\r\n#include \"7zTypes.h\"\r\n\r\nEXTERN_C_BEGIN\r\n\r\n/* #define _LZMA_PROB32 */\r\n/* _LZMA_PROB32 can increase the speed on some CPUs,\r\n   but memory usage for CLzmaDec::probs will be doubled in that case */\r\n\r\n#ifdef _LZMA_PROB32\r\n#define CLzmaProb UInt32\r\n#else\r\n#define CLzmaProb UInt16\r\n#endif\r\n\r\n\r\n/* ---------- LZMA Properties ---------- */\r\n\r\n#define LZMA_PROPS_SIZE 5\r\n\r\ntypedef struct _CLzmaProps\r\n{\r\n  unsigned lc, lp, pb;\r\n  UInt32 dicSize;\r\n} CLzmaProps;\r\n\r\n/* LzmaProps_Decode - decodes properties\r\nReturns:\r\n  SZ_OK\r\n  SZ_ERROR_UNSUPPORTED - Unsupported properties\r\n*/\r\n\r\nSRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size);\r\n\r\n\r\n/* ---------- LZMA Decoder state ---------- */\r\n\r\n/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case.\r\n   Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */\r\n\r\n#define LZMA_REQUIRED_INPUT_MAX 20\r\n\r\ntypedef struct\r\n{\r\n  CLzmaProps prop;\r\n  CLzmaProb *probs;\r\n  Byte *dic;\r\n  const Byte *buf;\r\n  UInt32 range, code;\r\n  SizeT dicPos;\r\n  SizeT dicBufSize;\r\n  UInt32 processedPos;\r\n  UInt32 checkDicSize;\r\n  unsigned state;\r\n  UInt32 reps[4];\r\n  unsigned remainLen;\r\n  int needFlush;\r\n  int needInitState;\r\n  UInt32 numProbs;\r\n  unsigned tempBufSize;\r\n  Byte tempBuf[LZMA_REQUIRED_INPUT_MAX];\r\n} CLzmaDec;\r\n\r\n#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; }\r\n\r\nvoid LzmaDec_Init(CLzmaDec *p);\r\n\r\n/* There are two types of LZMA streams:\r\n     0) Stream with end mark. That end mark adds about 6 bytes to compressed size.\r\n     1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */\r\n\r\ntypedef enum\r\n{\r\n  LZMA_FINISH_ANY,   /* finish at any point */\r\n  LZMA_FINISH_END    /* block must be finished at the end */\r\n} ELzmaFinishMode;\r\n\r\n/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!!\r\n\r\n   You must use LZMA_FINISH_END, when you know that current output buffer\r\n   covers last bytes of block. In other cases you must use LZMA_FINISH_ANY.\r\n\r\n   If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK,\r\n   and output value of destLen will be less than output buffer size limit.\r\n   You can check status result also.\r\n\r\n   You can use multiple checks to test data integrity after full decompression:\r\n     1) Check Result and \"status\" variable.\r\n     2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize.\r\n     3) Check that output(srcLen) = compressedSize, if you know real compressedSize.\r\n        You must use correct finish mode in that case. */\r\n\r\ntypedef enum\r\n{\r\n  LZMA_STATUS_NOT_SPECIFIED,               /* use main error code instead */\r\n  LZMA_STATUS_FINISHED_WITH_MARK,          /* stream was finished with end mark. */\r\n  LZMA_STATUS_NOT_FINISHED,                /* stream was not finished */\r\n  LZMA_STATUS_NEEDS_MORE_INPUT,            /* you must provide more input bytes */\r\n  LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK  /* there is probability that stream was finished without end mark */\r\n} ELzmaStatus;\r\n\r\n/* ELzmaStatus is used only as output value for function call */\r\n\r\n\r\n/* ---------- Interfaces ---------- */\r\n\r\n/* There are 3 levels of interfaces:\r\n     1) Dictionary Interface\r\n     2) Buffer Interface\r\n     3) One Call Interface\r\n   You can select any of these interfaces, but don't mix functions from different\r\n   groups for same object. */\r\n\r\n\r\n/* There are two variants to allocate state for Dictionary Interface:\r\n     1) LzmaDec_Allocate / LzmaDec_Free\r\n     2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs\r\n   You can use variant 2, if you set dictionary buffer manually.\r\n   For Buffer Interface you must always use variant 1.\r\n\r\nLzmaDec_Allocate* can return:\r\n  SZ_OK\r\n  SZ_ERROR_MEM         - Memory allocation error\r\n  SZ_ERROR_UNSUPPORTED - Unsupported properties\r\n*/\r\n   \r\nSRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc);\r\nvoid LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc);\r\n\r\nSRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc);\r\nvoid LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc);\r\n\r\n/* ---------- Dictionary Interface ---------- */\r\n\r\n/* You can use it, if you want to eliminate the overhead for data copying from\r\n   dictionary to some other external buffer.\r\n   You must work with CLzmaDec variables directly in this interface.\r\n\r\n   STEPS:\r\n     LzmaDec_Constr()\r\n     LzmaDec_Allocate()\r\n     for (each new stream)\r\n     {\r\n       LzmaDec_Init()\r\n       while (it needs more decompression)\r\n       {\r\n         LzmaDec_DecodeToDic()\r\n         use data from CLzmaDec::dic and update CLzmaDec::dicPos\r\n       }\r\n     }\r\n     LzmaDec_Free()\r\n*/\r\n\r\n/* LzmaDec_DecodeToDic\r\n   \r\n   The decoding to internal dictionary buffer (CLzmaDec::dic).\r\n   You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!!\r\n\r\nfinishMode:\r\n  It has meaning only if the decoding reaches output limit (dicLimit).\r\n  LZMA_FINISH_ANY - Decode just dicLimit bytes.\r\n  LZMA_FINISH_END - Stream must be finished after dicLimit.\r\n\r\nReturns:\r\n  SZ_OK\r\n    status:\r\n      LZMA_STATUS_FINISHED_WITH_MARK\r\n      LZMA_STATUS_NOT_FINISHED\r\n      LZMA_STATUS_NEEDS_MORE_INPUT\r\n      LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK\r\n  SZ_ERROR_DATA - Data error\r\n*/\r\n\r\nSRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit,\r\n    const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);\r\n\r\n\r\n/* ---------- Buffer Interface ---------- */\r\n\r\n/* It's zlib-like interface.\r\n   See LzmaDec_DecodeToDic description for information about STEPS and return results,\r\n   but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need\r\n   to work with CLzmaDec variables manually.\r\n\r\nfinishMode:\r\n  It has meaning only if the decoding reaches output limit (*destLen).\r\n  LZMA_FINISH_ANY - Decode just destLen bytes.\r\n  LZMA_FINISH_END - Stream must be finished after (*destLen).\r\n*/\r\n\r\nSRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,\r\n    const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);\r\n\r\n\r\n/* ---------- One Call Interface ---------- */\r\n\r\n/* LzmaDecode\r\n\r\nfinishMode:\r\n  It has meaning only if the decoding reaches output limit (*destLen).\r\n  LZMA_FINISH_ANY - Decode just destLen bytes.\r\n  LZMA_FINISH_END - Stream must be finished after (*destLen).\r\n\r\nReturns:\r\n  SZ_OK\r\n    status:\r\n      LZMA_STATUS_FINISHED_WITH_MARK\r\n      LZMA_STATUS_NOT_FINISHED\r\n      LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK\r\n  SZ_ERROR_DATA - Data error\r\n  SZ_ERROR_MEM  - Memory allocation error\r\n  SZ_ERROR_UNSUPPORTED - Unsupported properties\r\n  SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).\r\n*/\r\n\r\nSRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,\r\n    const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,\r\n    ELzmaStatus *status, ISzAlloc *alloc);\r\n\r\nEXTERN_C_END\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/unarr/lzmasdk/Ppmd.h",
    "content": "/* Ppmd.h -- PPMD codec common code\r\n2013-01-18 : Igor Pavlov : Public domain\r\nThis code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */\r\n\r\n#ifndef __PPMD_H\r\n#define __PPMD_H\r\n\r\n#include \"CpuArch.h\"\r\n\r\nEXTERN_C_BEGIN\r\n\r\n#ifdef MY_CPU_32BIT\r\n  #define PPMD_32BIT\r\n#endif\r\n\r\n#define PPMD_INT_BITS 7\r\n#define PPMD_PERIOD_BITS 7\r\n#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))\r\n\r\n#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))\r\n#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)\r\n#define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))\r\n#define PPMD_UPDATE_PROB_1(prob) ((prob) - PPMD_GET_MEAN(prob))\r\n\r\n#define PPMD_N1 4\r\n#define PPMD_N2 4\r\n#define PPMD_N3 4\r\n#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)\r\n#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)\r\n\r\n#pragma pack(push, 1)\r\n/* Most compilers works OK here even without #pragma pack(push, 1), but some GCC compilers need it. */\r\n\r\n/* SEE-contexts for PPM-contexts with masked symbols */\r\ntypedef struct\r\n{\r\n  UInt16 Summ; /* Freq */\r\n  Byte Shift;  /* Speed of Freq change; low Shift is for fast change */\r\n  Byte Count;  /* Count to next change of Shift */\r\n} CPpmd_See;\r\n\r\n#define Ppmd_See_Update(p)  if ((p)->Shift < PPMD_PERIOD_BITS && --(p)->Count == 0) \\\r\n    { (p)->Summ <<= 1; (p)->Count = (Byte)(3 << (p)->Shift++); }\r\n\r\ntypedef struct\r\n{\r\n  Byte Symbol;\r\n  Byte Freq;\r\n  UInt16 SuccessorLow;\r\n  UInt16 SuccessorHigh;\r\n} CPpmd_State;\r\n\r\n#pragma pack(pop)\r\n\r\ntypedef\r\n  #ifdef PPMD_32BIT\r\n    CPpmd_State *\r\n  #else\r\n    UInt32\r\n  #endif\r\n  CPpmd_State_Ref;\r\n\r\ntypedef\r\n  #ifdef PPMD_32BIT\r\n    void *\r\n  #else\r\n    UInt32\r\n  #endif\r\n  CPpmd_Void_Ref;\r\n\r\ntypedef\r\n  #ifdef PPMD_32BIT\r\n    Byte *\r\n  #else\r\n    UInt32\r\n  #endif\r\n  CPpmd_Byte_Ref;\r\n\r\n#define PPMD_SetAllBitsIn256Bytes(p) \\\r\n  { unsigned i; for (i = 0; i < 256 / sizeof(p[0]); i += 8) { \\\r\n  p[i+7] = p[i+6] = p[i+5] = p[i+4] = p[i+3] = p[i+2] = p[i+1] = p[i+0] = ~(size_t)0; }}\r\n\r\nEXTERN_C_END\r\n \r\n#endif\r\n"
  },
  {
    "path": "ext/unarr/lzmasdk/Ppmd7.c",
    "content": "/* Ppmd7.c -- PPMdH codec\r\n2010-03-12 : Igor Pavlov : Public domain\r\nThis code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */\r\n\r\n#include \"Precomp.h\"\r\n\r\n#include <memory.h>\r\n\r\n#include \"Ppmd7.h\"\r\n\r\nconst Byte PPMD7_kExpEscape[16] = { 25, 14, 9, 7, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2 };\r\nstatic const UInt16 kInitBinEsc[] = { 0x3CDD, 0x1F3F, 0x59BF, 0x48F3, 0x64A1, 0x5ABC, 0x6632, 0x6051};\r\n\r\n#define MAX_FREQ 124\r\n#define UNIT_SIZE 12\r\n\r\n#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)\r\n#define U2I(nu) (p->Units2Indx[(nu) - 1])\r\n#define I2U(indx) (p->Indx2Units[indx])\r\n\r\n#ifdef PPMD_32BIT\r\n  #define REF(ptr) (ptr)\r\n#else\r\n  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))\r\n#endif\r\n\r\n#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))\r\n\r\n#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))\r\n#define STATS(ctx) Ppmd7_GetStats(p, ctx)\r\n#define ONE_STATE(ctx) Ppmd7Context_OneState(ctx)\r\n#define SUFFIX(ctx) CTX((ctx)->Suffix)\r\n\r\ntypedef CPpmd7_Context * CTX_PTR;\r\n\r\nstruct CPpmd7_Node_;\r\n\r\ntypedef\r\n  #ifdef PPMD_32BIT\r\n    struct CPpmd7_Node_ *\r\n  #else\r\n    UInt32\r\n  #endif\r\n  CPpmd7_Node_Ref;\r\n\r\ntypedef struct CPpmd7_Node_\r\n{\r\n  UInt16 Stamp; /* must be at offset 0 as CPpmd7_Context::NumStats. Stamp=0 means free */\r\n  UInt16 NU;\r\n  CPpmd7_Node_Ref Next; /* must be at offset >= 4 */\r\n  CPpmd7_Node_Ref Prev;\r\n} CPpmd7_Node;\r\n\r\n#ifdef PPMD_32BIT\r\n  #define NODE(ptr) (ptr)\r\n#else\r\n  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))\r\n#endif\r\n\r\nvoid Ppmd7_Construct(CPpmd7 *p)\r\n{\r\n  unsigned i, k, m;\r\n\r\n  p->Base = 0;\r\n\r\n  for (i = 0, k = 0; i < PPMD_NUM_INDEXES; i++)\r\n  {\r\n    unsigned step = (i >= 12 ? 4 : (i >> 2) + 1);\r\n    do { p->Units2Indx[k++] = (Byte)i; } while(--step);\r\n    p->Indx2Units[i] = (Byte)k;\r\n  }\r\n\r\n  p->NS2BSIndx[0] = (0 << 1);\r\n  p->NS2BSIndx[1] = (1 << 1);\r\n  memset(p->NS2BSIndx + 2, (2 << 1), 9);\r\n  memset(p->NS2BSIndx + 11, (3 << 1), 256 - 11);\r\n\r\n  for (i = 0; i < 3; i++)\r\n    p->NS2Indx[i] = (Byte)i;\r\n  for (m = i, k = 1; i < 256; i++)\r\n  {\r\n    p->NS2Indx[i] = (Byte)m;\r\n    if (--k == 0)\r\n      k = (++m) - 2;\r\n  }\r\n\r\n  memset(p->HB2Flag, 0, 0x40);\r\n  memset(p->HB2Flag + 0x40, 8, 0x100 - 0x40);\r\n}\r\n\r\nvoid Ppmd7_Free(CPpmd7 *p, ISzAlloc *alloc)\r\n{\r\n  alloc->Free(alloc, p->Base);\r\n  p->Size = 0;\r\n  p->Base = 0;\r\n}\r\n\r\nBool Ppmd7_Alloc(CPpmd7 *p, UInt32 size, ISzAlloc *alloc)\r\n{\r\n  if (p->Base == 0 || p->Size != size)\r\n  {\r\n    Ppmd7_Free(p, alloc);\r\n    p->AlignOffset =\r\n      #ifdef PPMD_32BIT\r\n        (4 - size) & 3;\r\n      #else\r\n        4 - (size & 3);\r\n      #endif\r\n    if ((p->Base = (Byte *)alloc->Alloc(alloc, p->AlignOffset + size\r\n        #ifndef PPMD_32BIT\r\n        + UNIT_SIZE\r\n        #endif\r\n        )) == 0)\r\n      return False;\r\n    p->Size = size;\r\n  }\r\n  return True;\r\n}\r\n\r\nstatic void InsertNode(CPpmd7 *p, void *node, unsigned indx)\r\n{\r\n  *((CPpmd_Void_Ref *)node) = p->FreeList[indx];\r\n  p->FreeList[indx] = REF(node);\r\n}\r\n\r\nstatic void *RemoveNode(CPpmd7 *p, unsigned indx)\r\n{\r\n  CPpmd_Void_Ref *node = (CPpmd_Void_Ref *)Ppmd7_GetPtr(p, p->FreeList[indx]);\r\n  p->FreeList[indx] = *node;\r\n  return node;\r\n}\r\n\r\nstatic void SplitBlock(CPpmd7 *p, void *ptr, unsigned oldIndx, unsigned newIndx)\r\n{\r\n  unsigned i, nu = I2U(oldIndx) - I2U(newIndx);\r\n  ptr = (Byte *)ptr + U2B(I2U(newIndx));\r\n  if (I2U(i = U2I(nu)) != nu)\r\n  {\r\n    unsigned k = I2U(--i);\r\n    InsertNode(p, ((Byte *)ptr) + U2B(k), nu - k - 1);\r\n  }\r\n  InsertNode(p, ptr, i);\r\n}\r\n\r\nstatic void GlueFreeBlocks(CPpmd7 *p)\r\n{\r\n  #ifdef PPMD_32BIT\r\n  CPpmd7_Node headItem;\r\n  CPpmd7_Node_Ref head = &headItem;\r\n  #else\r\n  CPpmd7_Node_Ref head = p->AlignOffset + p->Size;\r\n  #endif\r\n  \r\n  CPpmd7_Node_Ref n = head;\r\n  unsigned i;\r\n\r\n  p->GlueCount = 255;\r\n\r\n  /* create doubly-linked list of free blocks */\r\n  for (i = 0; i < PPMD_NUM_INDEXES; i++)\r\n  {\r\n    UInt16 nu = I2U(i);\r\n    CPpmd7_Node_Ref next = (CPpmd7_Node_Ref)p->FreeList[i];\r\n    p->FreeList[i] = 0;\r\n    while (next != 0)\r\n    {\r\n      CPpmd7_Node *node = NODE(next);\r\n      node->Next = n;\r\n      n = NODE(n)->Prev = next;\r\n      next = *(const CPpmd7_Node_Ref *)node;\r\n      node->Stamp = 0;\r\n      node->NU = (UInt16)nu;\r\n    }\r\n  }\r\n  NODE(head)->Stamp = 1;\r\n  NODE(head)->Next = n;\r\n  NODE(n)->Prev = head;\r\n  if (p->LoUnit != p->HiUnit)\r\n    ((CPpmd7_Node *)p->LoUnit)->Stamp = 1;\r\n  \r\n  /* Glue free blocks */\r\n  while (n != head)\r\n  {\r\n    CPpmd7_Node *node = NODE(n);\r\n    UInt32 nu = (UInt32)node->NU;\r\n    for (;;)\r\n    {\r\n      CPpmd7_Node *node2 = NODE(n) + nu;\r\n      nu += node2->NU;\r\n      if (node2->Stamp != 0 || nu >= 0x10000)\r\n        break;\r\n      NODE(node2->Prev)->Next = node2->Next;\r\n      NODE(node2->Next)->Prev = node2->Prev;\r\n      node->NU = (UInt16)nu;\r\n    }\r\n    n = node->Next;\r\n  }\r\n  \r\n  /* Fill lists of free blocks */\r\n  for (n = NODE(head)->Next; n != head;)\r\n  {\r\n    CPpmd7_Node *node = NODE(n);\r\n    unsigned nu;\r\n    CPpmd7_Node_Ref next = node->Next;\r\n    for (nu = node->NU; nu > 128; nu -= 128, node += 128)\r\n      InsertNode(p, node, PPMD_NUM_INDEXES - 1);\r\n    if (I2U(i = U2I(nu)) != nu)\r\n    {\r\n      unsigned k = I2U(--i);\r\n      InsertNode(p, node + k, nu - k - 1);\r\n    }\r\n    InsertNode(p, node, i);\r\n    n = next;\r\n  }\r\n}\r\n\r\nstatic void *AllocUnitsRare(CPpmd7 *p, unsigned indx)\r\n{\r\n  unsigned i;\r\n  void *retVal;\r\n  if (p->GlueCount == 0)\r\n  {\r\n    GlueFreeBlocks(p);\r\n    if (p->FreeList[indx] != 0)\r\n      return RemoveNode(p, indx);\r\n  }\r\n  i = indx;\r\n  do\r\n  {\r\n    if (++i == PPMD_NUM_INDEXES)\r\n    {\r\n      UInt32 numBytes = U2B(I2U(indx));\r\n      p->GlueCount--;\r\n      return ((UInt32)(p->UnitsStart - p->Text) > numBytes) ? (p->UnitsStart -= numBytes) : (NULL);\r\n    }\r\n  }\r\n  while (p->FreeList[i] == 0);\r\n  retVal = RemoveNode(p, i);\r\n  SplitBlock(p, retVal, i, indx);\r\n  return retVal;\r\n}\r\n\r\nstatic void *AllocUnits(CPpmd7 *p, unsigned indx)\r\n{\r\n  UInt32 numBytes;\r\n  if (p->FreeList[indx] != 0)\r\n    return RemoveNode(p, indx);\r\n  numBytes = U2B(I2U(indx));\r\n  if (numBytes <= (UInt32)(p->HiUnit - p->LoUnit))\r\n  {\r\n    void *retVal = p->LoUnit;\r\n    p->LoUnit += numBytes;\r\n    return retVal;\r\n  }\r\n  return AllocUnitsRare(p, indx);\r\n}\r\n\r\n#define MyMem12Cpy(dest, src, num) \\\r\n  { UInt32 *d = (UInt32 *)dest; const UInt32 *s = (const UInt32 *)src; UInt32 n = num; \\\r\n    do { d[0] = s[0]; d[1] = s[1]; d[2] = s[2]; s += 3; d += 3; } while(--n); }\r\n\r\nstatic void *ShrinkUnits(CPpmd7 *p, void *oldPtr, unsigned oldNU, unsigned newNU)\r\n{\r\n  unsigned i0 = U2I(oldNU);\r\n  unsigned i1 = U2I(newNU);\r\n  if (i0 == i1)\r\n    return oldPtr;\r\n  if (p->FreeList[i1] != 0)\r\n  {\r\n    void *ptr = RemoveNode(p, i1);\r\n    MyMem12Cpy(ptr, oldPtr, newNU);\r\n    InsertNode(p, oldPtr, i0);\r\n    return ptr;\r\n  }\r\n  SplitBlock(p, oldPtr, i0, i1);\r\n  return oldPtr;\r\n}\r\n\r\n#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))\r\n\r\nstatic void SetSuccessor(CPpmd_State *p, CPpmd_Void_Ref v)\r\n{\r\n  (p)->SuccessorLow = (UInt16)((UInt32)(v) & 0xFFFF);\r\n  (p)->SuccessorHigh = (UInt16)(((UInt32)(v) >> 16) & 0xFFFF);\r\n}\r\n\r\nstatic void RestartModel(CPpmd7 *p)\r\n{\r\n  unsigned i, k, m;\r\n\r\n  memset(p->FreeList, 0, sizeof(p->FreeList));\r\n  p->Text = p->Base + p->AlignOffset;\r\n  p->HiUnit = p->Text + p->Size;\r\n  p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;\r\n  p->GlueCount = 0;\r\n\r\n  p->OrderFall = p->MaxOrder;\r\n  p->RunLength = p->InitRL = -(Int32)((p->MaxOrder < 12) ? p->MaxOrder : 12) - 1;\r\n  p->PrevSuccess = 0;\r\n\r\n  p->MinContext = p->MaxContext = (CTX_PTR)(p->HiUnit -= UNIT_SIZE); /* AllocContext(p); */\r\n  p->MinContext->Suffix = 0;\r\n  p->MinContext->NumStats = 256;\r\n  p->MinContext->SummFreq = 256 + 1;\r\n  p->FoundState = (CPpmd_State *)p->LoUnit; /* AllocUnits(p, PPMD_NUM_INDEXES - 1); */\r\n  p->LoUnit += U2B(256 / 2);\r\n  p->MinContext->Stats = REF(p->FoundState);\r\n  for (i = 0; i < 256; i++)\r\n  {\r\n    CPpmd_State *s = &p->FoundState[i];\r\n    s->Symbol = (Byte)i;\r\n    s->Freq = 1;\r\n    SetSuccessor(s, 0);\r\n  }\r\n\r\n  for (i = 0; i < 128; i++)\r\n    for (k = 0; k < 8; k++)\r\n    {\r\n      UInt16 *dest = p->BinSumm[i] + k;\r\n      UInt16 val = (UInt16)(PPMD_BIN_SCALE - kInitBinEsc[k] / (i + 2));\r\n      for (m = 0; m < 64; m += 8)\r\n        dest[m] = val;\r\n    }\r\n  \r\n  for (i = 0; i < 25; i++)\r\n    for (k = 0; k < 16; k++)\r\n    {\r\n      CPpmd_See *s = &p->See[i][k];\r\n      s->Summ = (UInt16)((5 * i + 10) << (s->Shift = PPMD_PERIOD_BITS - 4));\r\n      s->Count = 4;\r\n    }\r\n}\r\n\r\nvoid Ppmd7_Init(CPpmd7 *p, unsigned maxOrder)\r\n{\r\n  p->MaxOrder = maxOrder;\r\n  RestartModel(p);\r\n  p->DummySee.Shift = PPMD_PERIOD_BITS;\r\n  p->DummySee.Summ = 0; /* unused */\r\n  p->DummySee.Count = 64; /* unused */\r\n}\r\n\r\nstatic CTX_PTR CreateSuccessors(CPpmd7 *p, Bool skip)\r\n{\r\n  CPpmd_State upState;\r\n  CTX_PTR c = p->MinContext;\r\n  CPpmd_Byte_Ref upBranch = (CPpmd_Byte_Ref)SUCCESSOR(p->FoundState);\r\n  CPpmd_State *ps[PPMD7_MAX_ORDER];\r\n  unsigned numPs = 0;\r\n  \r\n  if (!skip)\r\n    ps[numPs++] = p->FoundState;\r\n  \r\n  while (c->Suffix)\r\n  {\r\n    CPpmd_Void_Ref successor;\r\n    CPpmd_State *s;\r\n    c = SUFFIX(c);\r\n    if (c->NumStats != 1)\r\n    {\r\n      for (s = STATS(c); s->Symbol != p->FoundState->Symbol; s++);\r\n    }\r\n    else\r\n      s = ONE_STATE(c);\r\n    successor = SUCCESSOR(s);\r\n    if (successor != upBranch)\r\n    {\r\n      c = CTX(successor);\r\n      if (numPs == 0)\r\n        return c;\r\n      break;\r\n    }\r\n    ps[numPs++] = s;\r\n  }\r\n  \r\n  upState.Symbol = *(const Byte *)Ppmd7_GetPtr(p, upBranch);\r\n  SetSuccessor(&upState, upBranch + 1);\r\n  \r\n  if (c->NumStats == 1)\r\n    upState.Freq = ONE_STATE(c)->Freq;\r\n  else\r\n  {\r\n    UInt32 cf, s0;\r\n    CPpmd_State *s;\r\n    for (s = STATS(c); s->Symbol != upState.Symbol; s++);\r\n    cf = s->Freq - 1;\r\n    s0 = c->SummFreq - c->NumStats - cf;\r\n    upState.Freq = (Byte)(1 + ((2 * cf <= s0) ? (5 * cf > s0) : ((2 * cf + 3 * s0 - 1) / (2 * s0))));\r\n  }\r\n\r\n  do\r\n  {\r\n    /* Create Child */\r\n    CTX_PTR c1; /* = AllocContext(p); */\r\n    if (p->HiUnit != p->LoUnit)\r\n      c1 = (CTX_PTR)(p->HiUnit -= UNIT_SIZE);\r\n    else if (p->FreeList[0] != 0)\r\n      c1 = (CTX_PTR)RemoveNode(p, 0);\r\n    else\r\n    {\r\n      c1 = (CTX_PTR)AllocUnitsRare(p, 0);\r\n      if (!c1)\r\n        return NULL;\r\n    }\r\n    c1->NumStats = 1;\r\n    *ONE_STATE(c1) = upState;\r\n    c1->Suffix = REF(c);\r\n    SetSuccessor(ps[--numPs], REF(c1));\r\n    c = c1;\r\n  }\r\n  while (numPs != 0);\r\n  \r\n  return c;\r\n}\r\n\r\nstatic void SwapStates(CPpmd_State *t1, CPpmd_State *t2)\r\n{\r\n  CPpmd_State tmp = *t1;\r\n  *t1 = *t2;\r\n  *t2 = tmp;\r\n}\r\n\r\nstatic void UpdateModel(CPpmd7 *p)\r\n{\r\n  CPpmd_Void_Ref successor, fSuccessor = SUCCESSOR(p->FoundState);\r\n  CTX_PTR c;\r\n  unsigned s0, ns;\r\n  \r\n  if (p->FoundState->Freq < MAX_FREQ / 4 && p->MinContext->Suffix != 0)\r\n  {\r\n    c = SUFFIX(p->MinContext);\r\n    \r\n    if (c->NumStats == 1)\r\n    {\r\n      CPpmd_State *s = ONE_STATE(c);\r\n      if (s->Freq < 32)\r\n        s->Freq++;\r\n    }\r\n    else\r\n    {\r\n      CPpmd_State *s = STATS(c);\r\n      if (s->Symbol != p->FoundState->Symbol)\r\n      {\r\n        do { s++; } while (s->Symbol != p->FoundState->Symbol);\r\n        if (s[0].Freq >= s[-1].Freq)\r\n        {\r\n          SwapStates(&s[0], &s[-1]);\r\n          s--;\r\n        }\r\n      }\r\n      if (s->Freq < MAX_FREQ - 9)\r\n      {\r\n        s->Freq += 2;\r\n        c->SummFreq += 2;\r\n      }\r\n    }\r\n  }\r\n\r\n  if (p->OrderFall == 0)\r\n  {\r\n    p->MinContext = p->MaxContext = CreateSuccessors(p, True);\r\n    if (p->MinContext == 0)\r\n    {\r\n      RestartModel(p);\r\n      return;\r\n    }\r\n    SetSuccessor(p->FoundState, REF(p->MinContext));\r\n    return;\r\n  }\r\n  \r\n  *p->Text++ = p->FoundState->Symbol;\r\n  successor = REF(p->Text);\r\n  if (p->Text >= p->UnitsStart)\r\n  {\r\n    RestartModel(p);\r\n    return;\r\n  }\r\n  \r\n  if (fSuccessor)\r\n  {\r\n    if (fSuccessor <= successor)\r\n    {\r\n      CTX_PTR cs = CreateSuccessors(p, False);\r\n      if (cs == NULL)\r\n      {\r\n        RestartModel(p);\r\n        return;\r\n      }\r\n      fSuccessor = REF(cs);\r\n    }\r\n    if (--p->OrderFall == 0)\r\n    {\r\n      successor = fSuccessor;\r\n      p->Text -= (p->MaxContext != p->MinContext);\r\n    }\r\n  }\r\n  else\r\n  {\r\n    SetSuccessor(p->FoundState, successor);\r\n    fSuccessor = REF(p->MinContext);\r\n  }\r\n  \r\n  s0 = p->MinContext->SummFreq - (ns = p->MinContext->NumStats) - (p->FoundState->Freq - 1);\r\n  \r\n  for (c = p->MaxContext; c != p->MinContext; c = SUFFIX(c))\r\n  {\r\n    unsigned ns1;\r\n    UInt32 cf, sf;\r\n    if ((ns1 = c->NumStats) != 1)\r\n    {\r\n      if ((ns1 & 1) == 0)\r\n      {\r\n        /* Expand for one UNIT */\r\n        unsigned oldNU = ns1 >> 1;\r\n        unsigned i = U2I(oldNU);\r\n        if (i != U2I(oldNU + 1))\r\n        {\r\n          void *ptr = AllocUnits(p, i + 1);\r\n          void *oldPtr;\r\n          if (!ptr)\r\n          {\r\n            RestartModel(p);\r\n            return;\r\n          }\r\n          oldPtr = STATS(c);\r\n          MyMem12Cpy(ptr, oldPtr, oldNU);\r\n          InsertNode(p, oldPtr, i);\r\n          c->Stats = STATS_REF(ptr);\r\n        }\r\n      }\r\n      c->SummFreq = (UInt16)(c->SummFreq + (2 * ns1 < ns) + 2 * ((4 * ns1 <= ns) & (c->SummFreq <= 8 * ns1)));\r\n    }\r\n    else\r\n    {\r\n      CPpmd_State *s = (CPpmd_State*)AllocUnits(p, 0);\r\n      if (!s)\r\n      {\r\n        RestartModel(p);\r\n        return;\r\n      }\r\n      *s = *ONE_STATE(c);\r\n      c->Stats = REF(s);\r\n      if (s->Freq < MAX_FREQ / 4 - 1)\r\n        s->Freq <<= 1;\r\n      else\r\n        s->Freq = MAX_FREQ - 4;\r\n      c->SummFreq = (UInt16)(s->Freq + p->InitEsc + (ns > 3));\r\n    }\r\n    cf = 2 * (UInt32)p->FoundState->Freq * (c->SummFreq + 6);\r\n    sf = (UInt32)s0 + c->SummFreq;\r\n    if (cf < 6 * sf)\r\n    {\r\n      cf = 1 + (cf > sf) + (cf >= 4 * sf);\r\n      c->SummFreq += 3;\r\n    }\r\n    else\r\n    {\r\n      cf = 4 + (cf >= 9 * sf) + (cf >= 12 * sf) + (cf >= 15 * sf);\r\n      c->SummFreq = (UInt16)(c->SummFreq + cf);\r\n    }\r\n    {\r\n      CPpmd_State *s = STATS(c) + ns1;\r\n      SetSuccessor(s, successor);\r\n      s->Symbol = p->FoundState->Symbol;\r\n      s->Freq = (Byte)cf;\r\n      c->NumStats = (UInt16)(ns1 + 1);\r\n    }\r\n  }\r\n  p->MaxContext = p->MinContext = CTX(fSuccessor);\r\n}\r\n  \r\nstatic void Rescale(CPpmd7 *p)\r\n{\r\n  unsigned i, adder, sumFreq, escFreq;\r\n  CPpmd_State *stats = STATS(p->MinContext);\r\n  CPpmd_State *s = p->FoundState;\r\n  {\r\n    CPpmd_State tmp = *s;\r\n    for (; s != stats; s--)\r\n      s[0] = s[-1];\r\n    *s = tmp;\r\n  }\r\n  escFreq = p->MinContext->SummFreq - s->Freq;\r\n  s->Freq += 4;\r\n  adder = (p->OrderFall != 0);\r\n  s->Freq = (Byte)((s->Freq + adder) >> 1);\r\n  sumFreq = s->Freq;\r\n  \r\n  i = p->MinContext->NumStats - 1;\r\n  do\r\n  {\r\n    escFreq -= (++s)->Freq;\r\n    s->Freq = (Byte)((s->Freq + adder) >> 1);\r\n    sumFreq += s->Freq;\r\n    if (s[0].Freq > s[-1].Freq)\r\n    {\r\n      CPpmd_State *s1 = s;\r\n      CPpmd_State tmp = *s1;\r\n      do\r\n        s1[0] = s1[-1];\r\n      while (--s1 != stats && tmp.Freq > s1[-1].Freq);\r\n      *s1 = tmp;\r\n    }\r\n  }\r\n  while (--i);\r\n  \r\n  if (s->Freq == 0)\r\n  {\r\n    unsigned numStats = p->MinContext->NumStats;\r\n    unsigned n0, n1;\r\n    do { i++; } while ((--s)->Freq == 0);\r\n    escFreq += i;\r\n    p->MinContext->NumStats = (UInt16)(p->MinContext->NumStats - i);\r\n    if (p->MinContext->NumStats == 1)\r\n    {\r\n      CPpmd_State tmp = *stats;\r\n      do\r\n      {\r\n        tmp.Freq = (Byte)(tmp.Freq - (tmp.Freq >> 1));\r\n        escFreq >>= 1;\r\n      }\r\n      while (escFreq > 1);\r\n      InsertNode(p, stats, U2I(((numStats + 1) >> 1)));\r\n      *(p->FoundState = ONE_STATE(p->MinContext)) = tmp;\r\n      return;\r\n    }\r\n    n0 = (numStats + 1) >> 1;\r\n    n1 = (p->MinContext->NumStats + 1) >> 1;\r\n    if (n0 != n1)\r\n      p->MinContext->Stats = STATS_REF(ShrinkUnits(p, stats, n0, n1));\r\n  }\r\n  p->MinContext->SummFreq = (UInt16)(sumFreq + escFreq - (escFreq >> 1));\r\n  p->FoundState = STATS(p->MinContext);\r\n}\r\n\r\nCPpmd_See *Ppmd7_MakeEscFreq(CPpmd7 *p, unsigned numMasked, UInt32 *escFreq)\r\n{\r\n  CPpmd_See *see;\r\n  unsigned nonMasked = p->MinContext->NumStats - numMasked;\r\n  if (p->MinContext->NumStats != 256)\r\n  {\r\n    see = p->See[p->NS2Indx[nonMasked - 1]] +\r\n        (nonMasked < (unsigned)SUFFIX(p->MinContext)->NumStats - p->MinContext->NumStats) +\r\n        2 * (p->MinContext->SummFreq < 11 * p->MinContext->NumStats) +\r\n        4 * (numMasked > nonMasked) +\r\n        p->HiBitsFlag;\r\n    {\r\n      unsigned r = (see->Summ >> see->Shift);\r\n      see->Summ = (UInt16)(see->Summ - r);\r\n      *escFreq = r + (r == 0);\r\n    }\r\n  }\r\n  else\r\n  {\r\n    see = &p->DummySee;\r\n    *escFreq = 1;\r\n  }\r\n  return see;\r\n}\r\n\r\nstatic void NextContext(CPpmd7 *p)\r\n{\r\n  CTX_PTR c = CTX(SUCCESSOR(p->FoundState));\r\n  if (p->OrderFall == 0 && (Byte *)c > p->Text)\r\n    p->MinContext = p->MaxContext = c;\r\n  else\r\n    UpdateModel(p);\r\n}\r\n\r\nvoid Ppmd7_Update1(CPpmd7 *p)\r\n{\r\n  CPpmd_State *s = p->FoundState;\r\n  s->Freq += 4;\r\n  p->MinContext->SummFreq += 4;\r\n  if (s[0].Freq > s[-1].Freq)\r\n  {\r\n    SwapStates(&s[0], &s[-1]);\r\n    p->FoundState = --s;\r\n    if (s->Freq > MAX_FREQ)\r\n      Rescale(p);\r\n  }\r\n  NextContext(p);\r\n}\r\n\r\nvoid Ppmd7_Update1_0(CPpmd7 *p)\r\n{\r\n  p->PrevSuccess = (2 * p->FoundState->Freq > p->MinContext->SummFreq);\r\n  p->RunLength += p->PrevSuccess;\r\n  p->MinContext->SummFreq += 4;\r\n  if ((p->FoundState->Freq += 4) > MAX_FREQ)\r\n    Rescale(p);\r\n  NextContext(p);\r\n}\r\n\r\nvoid Ppmd7_UpdateBin(CPpmd7 *p)\r\n{\r\n  p->FoundState->Freq = (Byte)(p->FoundState->Freq + (p->FoundState->Freq < 128 ? 1: 0));\r\n  p->PrevSuccess = 1;\r\n  p->RunLength++;\r\n  NextContext(p);\r\n}\r\n\r\nvoid Ppmd7_Update2(CPpmd7 *p)\r\n{\r\n  p->MinContext->SummFreq += 4;\r\n  if ((p->FoundState->Freq += 4) > MAX_FREQ)\r\n    Rescale(p);\r\n  p->RunLength = p->InitRL;\r\n  UpdateModel(p);\r\n}\r\n"
  },
  {
    "path": "ext/unarr/lzmasdk/Ppmd7.h",
    "content": "/* Ppmd7.h -- PPMdH compression codec\r\n2010-03-12 : Igor Pavlov : Public domain\r\nThis code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */\r\n\r\n/* This code supports virtual RangeDecoder and includes the implementation\r\nof RangeCoder from 7z, instead of RangeCoder from original PPMd var.H.\r\nIf you need the compatibility with original PPMd var.H, you can use external RangeDecoder */\r\n\r\n#ifndef __PPMD7_H\r\n#define __PPMD7_H\r\n\r\n#include \"Ppmd.h\"\r\n\r\nEXTERN_C_BEGIN\r\n\r\n#define PPMD7_MIN_ORDER 2\r\n#define PPMD7_MAX_ORDER 64\r\n\r\n#define PPMD7_MIN_MEM_SIZE (1 << 11)\r\n#define PPMD7_MAX_MEM_SIZE (0xFFFFFFFF - 12 * 3)\r\n\r\nstruct CPpmd7_Context_;\r\n\r\ntypedef\r\n  #ifdef PPMD_32BIT\r\n    struct CPpmd7_Context_ *\r\n  #else\r\n    UInt32\r\n  #endif\r\n  CPpmd7_Context_Ref;\r\n\r\ntypedef struct CPpmd7_Context_\r\n{\r\n  UInt16 NumStats;\r\n  UInt16 SummFreq;\r\n  CPpmd_State_Ref Stats;\r\n  CPpmd7_Context_Ref Suffix;\r\n} CPpmd7_Context;\r\n\r\n#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)\r\n\r\ntypedef struct\r\n{\r\n  CPpmd7_Context *MinContext, *MaxContext;\r\n  CPpmd_State *FoundState;\r\n  unsigned OrderFall, InitEsc, PrevSuccess, MaxOrder, HiBitsFlag;\r\n  Int32 RunLength, InitRL; /* must be 32-bit at least */\r\n\r\n  UInt32 Size;\r\n  UInt32 GlueCount;\r\n  Byte *Base, *LoUnit, *HiUnit, *Text, *UnitsStart;\r\n  UInt32 AlignOffset;\r\n\r\n  Byte Indx2Units[PPMD_NUM_INDEXES];\r\n  Byte Units2Indx[128];\r\n  CPpmd_Void_Ref FreeList[PPMD_NUM_INDEXES];\r\n  Byte NS2Indx[256], NS2BSIndx[256], HB2Flag[256];\r\n  CPpmd_See DummySee, See[25][16];\r\n  UInt16 BinSumm[128][64];\r\n} CPpmd7;\r\n\r\nvoid Ppmd7_Construct(CPpmd7 *p);\r\nBool Ppmd7_Alloc(CPpmd7 *p, UInt32 size, ISzAlloc *alloc);\r\nvoid Ppmd7_Free(CPpmd7 *p, ISzAlloc *alloc);\r\nvoid Ppmd7_Init(CPpmd7 *p, unsigned maxOrder);\r\n#define Ppmd7_WasAllocated(p) ((p)->Base != NULL)\r\n\r\n\r\n/* ---------- Internal Functions ---------- */\r\n\r\nextern const Byte PPMD7_kExpEscape[16];\r\n\r\n#ifdef PPMD_32BIT\r\n  #define Ppmd7_GetPtr(p, ptr) (ptr)\r\n  #define Ppmd7_GetContext(p, ptr) (ptr)\r\n  #define Ppmd7_GetStats(p, ctx) ((ctx)->Stats)\r\n#else\r\n  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))\r\n  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))\r\n  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))\r\n#endif\r\n\r\nvoid Ppmd7_Update1(CPpmd7 *p);\r\nvoid Ppmd7_Update1_0(CPpmd7 *p);\r\nvoid Ppmd7_Update2(CPpmd7 *p);\r\nvoid Ppmd7_UpdateBin(CPpmd7 *p);\r\n\r\n#define Ppmd7_GetBinSumm(p) \\\r\n    &p->BinSumm[Ppmd7Context_OneState(p->MinContext)->Freq - 1][p->PrevSuccess + \\\r\n    p->NS2BSIndx[Ppmd7_GetContext(p, p->MinContext->Suffix)->NumStats - 1] + \\\r\n    (p->HiBitsFlag = p->HB2Flag[p->FoundState->Symbol]) + \\\r\n    2 * p->HB2Flag[Ppmd7Context_OneState(p->MinContext)->Symbol] + \\\r\n    ((p->RunLength >> 26) & 0x20)]\r\n\r\nCPpmd_See *Ppmd7_MakeEscFreq(CPpmd7 *p, unsigned numMasked, UInt32 *scale);\r\n\r\n\r\n/* ---------- Decode ---------- */\r\n\r\ntypedef struct\r\n{\r\n  UInt32 (*GetThreshold)(void *p, UInt32 total);\r\n  void (*Decode)(void *p, UInt32 start, UInt32 size);\r\n  UInt32 (*DecodeBit)(void *p, UInt32 size0);\r\n} IPpmd7_RangeDec;\r\n\r\ntypedef struct\r\n{\r\n  IPpmd7_RangeDec p;\r\n  UInt32 Range;\r\n  UInt32 Code;\r\n  IByteIn *Stream;\r\n} CPpmd7z_RangeDec;\r\n\r\nvoid Ppmd7z_RangeDec_CreateVTable(CPpmd7z_RangeDec *p);\r\nBool Ppmd7z_RangeDec_Init(CPpmd7z_RangeDec *p);\r\n#define Ppmd7z_RangeDec_IsFinishedOK(p) ((p)->Code == 0)\r\n\r\nint Ppmd7_DecodeSymbol(CPpmd7 *p, IPpmd7_RangeDec *rc);\r\n\r\n\r\n/* ---------- Encode ---------- */\r\n\r\ntypedef struct\r\n{\r\n  UInt64 Low;\r\n  UInt32 Range;\r\n  Byte Cache;\r\n  UInt64 CacheSize;\r\n  IByteOut *Stream;\r\n} CPpmd7z_RangeEnc;\r\n\r\nvoid Ppmd7z_RangeEnc_Init(CPpmd7z_RangeEnc *p);\r\nvoid Ppmd7z_RangeEnc_FlushData(CPpmd7z_RangeEnc *p);\r\n\r\nvoid Ppmd7_EncodeSymbol(CPpmd7 *p, CPpmd7z_RangeEnc *rc, int symbol);\r\n\r\nEXTERN_C_END\r\n \r\n#endif\r\n"
  },
  {
    "path": "ext/unarr/lzmasdk/Ppmd7Dec.c",
    "content": "/* Ppmd7Dec.c -- PPMdH Decoder\r\n2010-03-12 : Igor Pavlov : Public domain\r\nThis code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */\r\n\r\n#include \"Precomp.h\"\r\n\r\n#include \"Ppmd7.h\"\r\n\r\n#define kTopValue (1 << 24)\r\n\r\nBool Ppmd7z_RangeDec_Init(CPpmd7z_RangeDec *p)\r\n{\r\n  unsigned i;\r\n  p->Code = 0;\r\n  p->Range = 0xFFFFFFFF;\r\n  if (p->Stream->Read((void *)p->Stream) != 0)\r\n    return False;\r\n  for (i = 0; i < 4; i++)\r\n    p->Code = (p->Code << 8) | p->Stream->Read((void *)p->Stream);\r\n  return (p->Code < 0xFFFFFFFF);\r\n}\r\n\r\nstatic UInt32 Range_GetThreshold(void *pp, UInt32 total)\r\n{\r\n  CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp;\r\n  return (p->Code) / (p->Range /= total);\r\n}\r\n\r\nstatic void Range_Normalize(CPpmd7z_RangeDec *p)\r\n{\r\n  if (p->Range < kTopValue)\r\n  {\r\n    p->Code = (p->Code << 8) | p->Stream->Read((void *)p->Stream);\r\n    p->Range <<= 8;\r\n    if (p->Range < kTopValue)\r\n    {\r\n      p->Code = (p->Code << 8) | p->Stream->Read((void *)p->Stream);\r\n      p->Range <<= 8;\r\n    }\r\n  }\r\n}\r\n\r\nstatic void Range_Decode(void *pp, UInt32 start, UInt32 size)\r\n{\r\n  CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp;\r\n  p->Code -= start * p->Range;\r\n  p->Range *= size;\r\n  Range_Normalize(p);\r\n}\r\n\r\nstatic UInt32 Range_DecodeBit(void *pp, UInt32 size0)\r\n{\r\n  CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp;\r\n  UInt32 newBound = (p->Range >> 14) * size0;\r\n  UInt32 symbol;\r\n  if (p->Code < newBound)\r\n  {\r\n    symbol = 0;\r\n    p->Range = newBound;\r\n  }\r\n  else\r\n  {\r\n    symbol = 1;\r\n    p->Code -= newBound;\r\n    p->Range -= newBound;\r\n  }\r\n  Range_Normalize(p);\r\n  return symbol;\r\n}\r\n\r\nvoid Ppmd7z_RangeDec_CreateVTable(CPpmd7z_RangeDec *p)\r\n{\r\n  p->p.GetThreshold = Range_GetThreshold;\r\n  p->p.Decode = Range_Decode;\r\n  p->p.DecodeBit = Range_DecodeBit;\r\n}\r\n\r\n\r\n#define MASK(sym) ((signed char *)charMask)[sym]\r\n\r\nint Ppmd7_DecodeSymbol(CPpmd7 *p, IPpmd7_RangeDec *rc)\r\n{\r\n  size_t charMask[256 / sizeof(size_t)];\r\n  if (p->MinContext->NumStats != 1)\r\n  {\r\n    CPpmd_State *s = Ppmd7_GetStats(p, p->MinContext);\r\n    unsigned i;\r\n    UInt32 count, hiCnt;\r\n    if ((count = rc->GetThreshold(rc, p->MinContext->SummFreq)) < (hiCnt = s->Freq))\r\n    {\r\n      Byte symbol;\r\n      rc->Decode(rc, 0, s->Freq);\r\n      p->FoundState = s;\r\n      symbol = s->Symbol;\r\n      Ppmd7_Update1_0(p);\r\n      return symbol;\r\n    }\r\n    p->PrevSuccess = 0;\r\n    i = p->MinContext->NumStats - 1;\r\n    do\r\n    {\r\n      if ((hiCnt += (++s)->Freq) > count)\r\n      {\r\n        Byte symbol;\r\n        rc->Decode(rc, hiCnt - s->Freq, s->Freq);\r\n        p->FoundState = s;\r\n        symbol = s->Symbol;\r\n        Ppmd7_Update1(p);\r\n        return symbol;\r\n      }\r\n    }\r\n    while (--i);\r\n    if (count >= p->MinContext->SummFreq)\r\n      return -2;\r\n    p->HiBitsFlag = p->HB2Flag[p->FoundState->Symbol];\r\n    rc->Decode(rc, hiCnt, p->MinContext->SummFreq - hiCnt);\r\n    PPMD_SetAllBitsIn256Bytes(charMask);\r\n    MASK(s->Symbol) = 0;\r\n    i = p->MinContext->NumStats - 1;\r\n    do { MASK((--s)->Symbol) = 0; } while (--i);\r\n  }\r\n  else\r\n  {\r\n    UInt16 *prob = Ppmd7_GetBinSumm(p);\r\n    if (rc->DecodeBit(rc, *prob) == 0)\r\n    {\r\n      Byte symbol;\r\n      *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);\r\n      symbol = (p->FoundState = Ppmd7Context_OneState(p->MinContext))->Symbol;\r\n      Ppmd7_UpdateBin(p);\r\n      return symbol;\r\n    }\r\n    *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob);\r\n    p->InitEsc = PPMD7_kExpEscape[*prob >> 10];\r\n    PPMD_SetAllBitsIn256Bytes(charMask);\r\n    MASK(Ppmd7Context_OneState(p->MinContext)->Symbol) = 0;\r\n    p->PrevSuccess = 0;\r\n  }\r\n  for (;;)\r\n  {\r\n    CPpmd_State *ps[256], *s;\r\n    UInt32 freqSum, count, hiCnt;\r\n    CPpmd_See *see;\r\n    unsigned i, num, numMasked = p->MinContext->NumStats;\r\n    do\r\n    {\r\n      p->OrderFall++;\r\n      if (!p->MinContext->Suffix)\r\n        return -1;\r\n      p->MinContext = Ppmd7_GetContext(p, p->MinContext->Suffix);\r\n    }\r\n    while (p->MinContext->NumStats == numMasked);\r\n    hiCnt = 0;\r\n    s = Ppmd7_GetStats(p, p->MinContext);\r\n    i = 0;\r\n    num = p->MinContext->NumStats - numMasked;\r\n    do\r\n    {\r\n      int k = (int)(MASK(s->Symbol));\r\n      hiCnt += (s->Freq & k);\r\n      ps[i] = s++;\r\n      i -= k;\r\n    }\r\n    while (i != num);\r\n    \r\n    see = Ppmd7_MakeEscFreq(p, numMasked, &freqSum);\r\n    freqSum += hiCnt;\r\n    count = rc->GetThreshold(rc, freqSum);\r\n    \r\n    if (count < hiCnt)\r\n    {\r\n      Byte symbol;\r\n      CPpmd_State **pps = ps;\r\n      for (hiCnt = 0; (hiCnt += (*pps)->Freq) <= count; pps++);\r\n      s = *pps;\r\n      rc->Decode(rc, hiCnt - s->Freq, s->Freq);\r\n      Ppmd_See_Update(see);\r\n      p->FoundState = s;\r\n      symbol = s->Symbol;\r\n      Ppmd7_Update2(p);\r\n      return symbol;\r\n    }\r\n    if (count >= freqSum)\r\n      return -2;\r\n    rc->Decode(rc, hiCnt, freqSum - hiCnt);\r\n    see->Summ = (UInt16)(see->Summ + freqSum);\r\n    do { MASK(ps[--i]->Symbol) = 0; } while (i != 0);\r\n  }\r\n}\r\n"
  },
  {
    "path": "ext/unarr/lzmasdk/Ppmd8.c",
    "content": "/* Ppmd8.c -- PPMdI codec\r\n2010-03-24 : Igor Pavlov : Public domain\r\nThis code is based on PPMd var.I (2002): Dmitry Shkarin : Public domain */\r\n\r\n#include \"Precomp.h\"\r\n\r\n#include <memory.h>\r\n\r\n#include \"Ppmd8.h\"\r\n\r\nconst Byte PPMD8_kExpEscape[16] = { 25, 14, 9, 7, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2 };\r\nstatic const UInt16 kInitBinEsc[] = { 0x3CDD, 0x1F3F, 0x59BF, 0x48F3, 0x64A1, 0x5ABC, 0x6632, 0x6051};\r\n\r\n#define MAX_FREQ 124\r\n#define UNIT_SIZE 12\r\n\r\n#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)\r\n#define U2I(nu) (p->Units2Indx[(nu) - 1])\r\n#define I2U(indx) (p->Indx2Units[indx])\r\n\r\n#ifdef PPMD_32BIT\r\n  #define REF(ptr) (ptr)\r\n#else\r\n  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))\r\n#endif\r\n\r\n#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))\r\n\r\n#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))\r\n#define STATS(ctx) Ppmd8_GetStats(p, ctx)\r\n#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)\r\n#define SUFFIX(ctx) CTX((ctx)->Suffix)\r\n\r\ntypedef CPpmd8_Context * CTX_PTR;\r\n\r\nstruct CPpmd8_Node_;\r\n\r\ntypedef\r\n  #ifdef PPMD_32BIT\r\n    struct CPpmd8_Node_ *\r\n  #else\r\n    UInt32\r\n  #endif\r\n  CPpmd8_Node_Ref;\r\n\r\ntypedef struct CPpmd8_Node_\r\n{\r\n  UInt32 Stamp;\r\n  CPpmd8_Node_Ref Next;\r\n  UInt32 NU;\r\n} CPpmd8_Node;\r\n\r\n#ifdef PPMD_32BIT\r\n  #define NODE(ptr) (ptr)\r\n#else\r\n  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))\r\n#endif\r\n\r\n#define EMPTY_NODE 0xFFFFFFFF\r\n\r\nvoid Ppmd8_Construct(CPpmd8 *p)\r\n{\r\n  unsigned i, k, m;\r\n\r\n  p->Base = 0;\r\n\r\n  for (i = 0, k = 0; i < PPMD_NUM_INDEXES; i++)\r\n  {\r\n    unsigned step = (i >= 12 ? 4 : (i >> 2) + 1);\r\n    do { p->Units2Indx[k++] = (Byte)i; } while(--step);\r\n    p->Indx2Units[i] = (Byte)k;\r\n  }\r\n\r\n  p->NS2BSIndx[0] = (0 << 1);\r\n  p->NS2BSIndx[1] = (1 << 1);\r\n  memset(p->NS2BSIndx + 2, (2 << 1), 9);\r\n  memset(p->NS2BSIndx + 11, (3 << 1), 256 - 11);\r\n\r\n  for (i = 0; i < 5; i++)\r\n    p->NS2Indx[i] = (Byte)i;\r\n  for (m = i, k = 1; i < 260; i++)\r\n  {\r\n    p->NS2Indx[i] = (Byte)m;\r\n    if (--k == 0)\r\n      k = (++m) - 4;\r\n  }\r\n}\r\n\r\nvoid Ppmd8_Free(CPpmd8 *p, ISzAlloc *alloc)\r\n{\r\n  alloc->Free(alloc, p->Base);\r\n  p->Size = 0;\r\n  p->Base = 0;\r\n}\r\n\r\nBool Ppmd8_Alloc(CPpmd8 *p, UInt32 size, ISzAlloc *alloc)\r\n{\r\n  if (p->Base == 0 || p->Size != size)\r\n  {\r\n    Ppmd8_Free(p, alloc);\r\n    p->AlignOffset =\r\n      #ifdef PPMD_32BIT\r\n        (4 - size) & 3;\r\n      #else\r\n        4 - (size & 3);\r\n      #endif\r\n    if ((p->Base = (Byte *)alloc->Alloc(alloc, p->AlignOffset + size)) == 0)\r\n      return False;\r\n    p->Size = size;\r\n  }\r\n  return True;\r\n}\r\n\r\nstatic void InsertNode(CPpmd8 *p, void *node, unsigned indx)\r\n{\r\n  ((CPpmd8_Node *)node)->Stamp = EMPTY_NODE;\r\n  ((CPpmd8_Node *)node)->Next = (CPpmd8_Node_Ref)p->FreeList[indx];\r\n  ((CPpmd8_Node *)node)->NU = I2U(indx);\r\n  p->FreeList[indx] = REF(node);\r\n  p->Stamps[indx]++;\r\n}\r\n\r\nstatic void *RemoveNode(CPpmd8 *p, unsigned indx)\r\n{\r\n  CPpmd8_Node *node = NODE((CPpmd8_Node_Ref)p->FreeList[indx]);\r\n  p->FreeList[indx] = node->Next;\r\n  p->Stamps[indx]--;\r\n  return node;\r\n}\r\n\r\nstatic void SplitBlock(CPpmd8 *p, void *ptr, unsigned oldIndx, unsigned newIndx)\r\n{\r\n  unsigned i, nu = I2U(oldIndx) - I2U(newIndx);\r\n  ptr = (Byte *)ptr + U2B(I2U(newIndx));\r\n  if (I2U(i = U2I(nu)) != nu)\r\n  {\r\n    unsigned k = I2U(--i);\r\n    InsertNode(p, ((Byte *)ptr) + U2B(k), nu - k - 1);\r\n  }\r\n  InsertNode(p, ptr, i);\r\n}\r\n\r\nstatic void GlueFreeBlocks(CPpmd8 *p)\r\n{\r\n  CPpmd8_Node_Ref head = 0;\r\n  CPpmd8_Node_Ref *prev = &head;\r\n  unsigned i;\r\n\r\n  p->GlueCount = 1 << 13;\r\n  memset(p->Stamps, 0, sizeof(p->Stamps));\r\n  \r\n  /* Order-0 context is always at top UNIT, so we don't need guard NODE at the end.\r\n     All blocks up to p->LoUnit can be free, so we need guard NODE at LoUnit. */\r\n  if (p->LoUnit != p->HiUnit)\r\n    ((CPpmd8_Node *)p->LoUnit)->Stamp = 0;\r\n\r\n  /* Glue free blocks */\r\n  for (i = 0; i < PPMD_NUM_INDEXES; i++)\r\n  {\r\n    CPpmd8_Node_Ref next = (CPpmd8_Node_Ref)p->FreeList[i];\r\n    p->FreeList[i] = 0;\r\n    while (next != 0)\r\n    {\r\n      CPpmd8_Node *node = NODE(next);\r\n      if (node->NU != 0)\r\n      {\r\n        CPpmd8_Node *node2;\r\n        *prev = next;\r\n        prev = &(node->Next);\r\n        while ((node2 = node + node->NU)->Stamp == EMPTY_NODE)\r\n        {\r\n          node->NU += node2->NU;\r\n          node2->NU = 0;\r\n        }\r\n      }\r\n      next = node->Next;\r\n    }\r\n  }\r\n  *prev = 0;\r\n  \r\n  /* Fill lists of free blocks */\r\n  while (head != 0)\r\n  {\r\n    CPpmd8_Node *node = NODE(head);\r\n    unsigned nu;\r\n    head = node->Next;\r\n    nu = node->NU;\r\n    if (nu == 0)\r\n      continue;\r\n    for (; nu > 128; nu -= 128, node += 128)\r\n      InsertNode(p, node, PPMD_NUM_INDEXES - 1);\r\n    if (I2U(i = U2I(nu)) != nu)\r\n    {\r\n      unsigned k = I2U(--i);\r\n      InsertNode(p, node + k, nu - k - 1);\r\n    }\r\n    InsertNode(p, node, i);\r\n  }\r\n}\r\n\r\nstatic void *AllocUnitsRare(CPpmd8 *p, unsigned indx)\r\n{\r\n  unsigned i;\r\n  void *retVal;\r\n  if (p->GlueCount == 0)\r\n  {\r\n    GlueFreeBlocks(p);\r\n    if (p->FreeList[indx] != 0)\r\n      return RemoveNode(p, indx);\r\n  }\r\n  i = indx;\r\n  do\r\n  {\r\n    if (++i == PPMD_NUM_INDEXES)\r\n    {\r\n      UInt32 numBytes = U2B(I2U(indx));\r\n      p->GlueCount--;\r\n      return ((UInt32)(p->UnitsStart - p->Text) > numBytes) ? (p->UnitsStart -= numBytes) : (NULL);\r\n    }\r\n  }\r\n  while (p->FreeList[i] == 0);\r\n  retVal = RemoveNode(p, i);\r\n  SplitBlock(p, retVal, i, indx);\r\n  return retVal;\r\n}\r\n\r\nstatic void *AllocUnits(CPpmd8 *p, unsigned indx)\r\n{\r\n  UInt32 numBytes;\r\n  if (p->FreeList[indx] != 0)\r\n    return RemoveNode(p, indx);\r\n  numBytes = U2B(I2U(indx));\r\n  if (numBytes <= (UInt32)(p->HiUnit - p->LoUnit))\r\n  {\r\n    void *retVal = p->LoUnit;\r\n    p->LoUnit += numBytes;\r\n    return retVal;\r\n  }\r\n  return AllocUnitsRare(p, indx);\r\n}\r\n\r\n#define MyMem12Cpy(dest, src, num) \\\r\n  { UInt32 *d = (UInt32 *)dest; const UInt32 *s = (const UInt32 *)src; UInt32 n = num; \\\r\n    do { d[0] = s[0]; d[1] = s[1]; d[2] = s[2]; s += 3; d += 3; } while(--n); }\r\n\r\nstatic void *ShrinkUnits(CPpmd8 *p, void *oldPtr, unsigned oldNU, unsigned newNU)\r\n{\r\n  unsigned i0 = U2I(oldNU);\r\n  unsigned i1 = U2I(newNU);\r\n  if (i0 == i1)\r\n    return oldPtr;\r\n  if (p->FreeList[i1] != 0)\r\n  {\r\n    void *ptr = RemoveNode(p, i1);\r\n    MyMem12Cpy(ptr, oldPtr, newNU);\r\n    InsertNode(p, oldPtr, i0);\r\n    return ptr;\r\n  }\r\n  SplitBlock(p, oldPtr, i0, i1);\r\n  return oldPtr;\r\n}\r\n\r\nstatic void FreeUnits(CPpmd8 *p, void *ptr, unsigned nu)\r\n{\r\n  InsertNode(p, ptr, U2I(nu));\r\n}\r\n\r\nstatic void SpecialFreeUnit(CPpmd8 *p, void *ptr)\r\n{\r\n  if ((Byte *)ptr != p->UnitsStart)\r\n    InsertNode(p, ptr, 0);\r\n  else\r\n  {\r\n    #ifdef PPMD8_FREEZE_SUPPORT\r\n    *(UInt32 *)ptr = EMPTY_NODE; /* it's used for (Flags == 0xFF) check in RemoveBinContexts */\r\n    #endif\r\n    p->UnitsStart += UNIT_SIZE;\r\n  }\r\n}\r\n\r\nstatic void *MoveUnitsUp(CPpmd8 *p, void *oldPtr, unsigned nu)\r\n{\r\n  unsigned indx = U2I(nu);\r\n  void *ptr;\r\n  if ((Byte *)oldPtr > p->UnitsStart + 16 * 1024 || REF(oldPtr) > p->FreeList[indx])\r\n    return oldPtr;\r\n  ptr = RemoveNode(p, indx);\r\n  MyMem12Cpy(ptr, oldPtr, nu);\r\n  if ((Byte*)oldPtr != p->UnitsStart)\r\n    InsertNode(p, oldPtr, indx);\r\n  else\r\n    p->UnitsStart += U2B(I2U(indx));\r\n  return ptr;\r\n}\r\n\r\nstatic void ExpandTextArea(CPpmd8 *p)\r\n{\r\n  UInt32 count[PPMD_NUM_INDEXES];\r\n  unsigned i;\r\n  memset(count, 0, sizeof(count));\r\n  if (p->LoUnit != p->HiUnit)\r\n    ((CPpmd8_Node *)p->LoUnit)->Stamp = 0;\r\n  \r\n  {\r\n    CPpmd8_Node *node = (CPpmd8_Node *)p->UnitsStart;\r\n    for (; node->Stamp == EMPTY_NODE; node += node->NU)\r\n    {\r\n      node->Stamp = 0;\r\n      count[U2I(node->NU)]++;\r\n    }\r\n    p->UnitsStart = (Byte *)node;\r\n  }\r\n  \r\n  for (i = 0; i < PPMD_NUM_INDEXES; i++)\r\n  {\r\n    CPpmd8_Node_Ref *next = (CPpmd8_Node_Ref *)&p->FreeList[i];\r\n    while (count[i] != 0)\r\n    {\r\n      CPpmd8_Node *node = NODE(*next);\r\n      while (node->Stamp == 0)\r\n      {\r\n        *next = node->Next;\r\n        node = NODE(*next);\r\n        p->Stamps[i]--;\r\n        if (--count[i] == 0)\r\n          break;\r\n      }\r\n      next = &node->Next;\r\n    }\r\n  }\r\n}\r\n\r\n#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))\r\n\r\nstatic void SetSuccessor(CPpmd_State *p, CPpmd_Void_Ref v)\r\n{\r\n  (p)->SuccessorLow = (UInt16)((UInt32)(v) & 0xFFFF);\r\n  (p)->SuccessorHigh = (UInt16)(((UInt32)(v) >> 16) & 0xFFFF);\r\n}\r\n\r\n#define RESET_TEXT(offs) { p->Text = p->Base + p->AlignOffset + (offs); }\r\n\r\nstatic void RestartModel(CPpmd8 *p)\r\n{\r\n  unsigned i, k, m, r;\r\n\r\n  memset(p->FreeList, 0, sizeof(p->FreeList));\r\n  memset(p->Stamps, 0, sizeof(p->Stamps));\r\n  RESET_TEXT(0);\r\n  p->HiUnit = p->Text + p->Size;\r\n  p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;\r\n  p->GlueCount = 0;\r\n\r\n  p->OrderFall = p->MaxOrder;\r\n  p->RunLength = p->InitRL = -(Int32)((p->MaxOrder < 12) ? p->MaxOrder : 12) - 1;\r\n  p->PrevSuccess = 0;\r\n\r\n  p->MinContext = p->MaxContext = (CTX_PTR)(p->HiUnit -= UNIT_SIZE); /* AllocContext(p); */\r\n  p->MinContext->Suffix = 0;\r\n  p->MinContext->NumStats = 255;\r\n  p->MinContext->Flags = 0;\r\n  p->MinContext->SummFreq = 256 + 1;\r\n  p->FoundState = (CPpmd_State *)p->LoUnit; /* AllocUnits(p, PPMD_NUM_INDEXES - 1); */\r\n  p->LoUnit += U2B(256 / 2);\r\n  p->MinContext->Stats = REF(p->FoundState);\r\n  for (i = 0; i < 256; i++)\r\n  {\r\n    CPpmd_State *s = &p->FoundState[i];\r\n    s->Symbol = (Byte)i;\r\n    s->Freq = 1;\r\n    SetSuccessor(s, 0);\r\n  }\r\n\r\n  for (i = m = 0; m < 25; m++)\r\n  {\r\n    while (p->NS2Indx[i] == m)\r\n      i++;\r\n    for (k = 0; k < 8; k++)\r\n    {\r\n      UInt16 val = (UInt16)(PPMD_BIN_SCALE - kInitBinEsc[k] / (i + 1));\r\n      UInt16 *dest = p->BinSumm[m] + k;\r\n      for (r = 0; r < 64; r += 8)\r\n        dest[r] = val;\r\n    }\r\n  }\r\n\r\n  for (i = m = 0; m < 24; m++)\r\n  {\r\n    while (p->NS2Indx[i + 3] == m + 3)\r\n      i++;\r\n    for (k = 0; k < 32; k++)\r\n    {\r\n      CPpmd_See *s = &p->See[m][k];\r\n      s->Summ = (UInt16)((2 * i + 5) << (s->Shift = PPMD_PERIOD_BITS - 4));\r\n      s->Count = 7;\r\n    }\r\n  }\r\n}\r\n\r\nvoid Ppmd8_Init(CPpmd8 *p, unsigned maxOrder, unsigned restoreMethod)\r\n{\r\n  p->MaxOrder = maxOrder;\r\n  p->RestoreMethod = restoreMethod;\r\n  RestartModel(p);\r\n  p->DummySee.Shift = PPMD_PERIOD_BITS;\r\n  p->DummySee.Summ = 0; /* unused */\r\n  p->DummySee.Count = 64; /* unused */\r\n}\r\n\r\nstatic void Refresh(CPpmd8 *p, CTX_PTR ctx, unsigned oldNU, unsigned scale)\r\n{\r\n  unsigned i = ctx->NumStats, escFreq, sumFreq, flags;\r\n  CPpmd_State *s = (CPpmd_State *)ShrinkUnits(p, STATS(ctx), oldNU, (i + 2) >> 1);\r\n  ctx->Stats = REF(s);\r\n  #ifdef PPMD8_FREEZE_SUPPORT\r\n  /* fixed over Shkarin's code. Fixed code is not compatible with original code for some files in FREEZE mode. */\r\n  scale |= (ctx->SummFreq >= ((UInt32)1 << 15));\r\n  #endif\r\n  flags = (ctx->Flags & (0x10 + 0x04 * scale)) + 0x08 * (s->Symbol >= 0x40);\r\n  escFreq = ctx->SummFreq - s->Freq;\r\n  sumFreq = (s->Freq = (Byte)((s->Freq + scale) >> scale));\r\n  do\r\n  {\r\n    escFreq -= (++s)->Freq;\r\n    sumFreq += (s->Freq = (Byte)((s->Freq + scale) >> scale));\r\n    flags |= 0x08 * (s->Symbol >= 0x40);\r\n  }\r\n  while (--i);\r\n  ctx->SummFreq = (UInt16)(sumFreq + ((escFreq + scale) >> scale));\r\n  ctx->Flags = (Byte)flags;\r\n}\r\n\r\nstatic void SwapStates(CPpmd_State *t1, CPpmd_State *t2)\r\n{\r\n  CPpmd_State tmp = *t1;\r\n  *t1 = *t2;\r\n  *t2 = tmp;\r\n}\r\n\r\nstatic CPpmd_Void_Ref CutOff(CPpmd8 *p, CTX_PTR ctx, unsigned order)\r\n{\r\n  int i;\r\n  unsigned tmp;\r\n  CPpmd_State *s;\r\n  \r\n  if (!ctx->NumStats)\r\n  {\r\n    s = ONE_STATE(ctx);\r\n    if ((Byte *)Ppmd8_GetPtr(p, SUCCESSOR(s)) >= p->UnitsStart)\r\n    {\r\n      if (order < p->MaxOrder)\r\n        SetSuccessor(s, CutOff(p, CTX(SUCCESSOR(s)), order + 1));\r\n      else\r\n        SetSuccessor(s, 0);\r\n      if (SUCCESSOR(s) || order <= 9) /* O_BOUND */\r\n        return REF(ctx);\r\n    }\r\n    SpecialFreeUnit(p, ctx);\r\n    return 0;\r\n  }\r\n\r\n  ctx->Stats = STATS_REF(MoveUnitsUp(p, STATS(ctx), tmp = ((unsigned)ctx->NumStats + 2) >> 1));\r\n\r\n  for (s = STATS(ctx) + (i = ctx->NumStats); s >= STATS(ctx); s--)\r\n    if ((Byte *)Ppmd8_GetPtr(p, SUCCESSOR(s)) < p->UnitsStart)\r\n    {\r\n      CPpmd_State *s2 = STATS(ctx) + (i--);\r\n      SetSuccessor(s, 0);\r\n      SwapStates(s, s2);\r\n    }\r\n    else if (order < p->MaxOrder)\r\n      SetSuccessor(s, CutOff(p, CTX(SUCCESSOR(s)), order + 1));\r\n    else\r\n      SetSuccessor(s, 0);\r\n    \r\n  if (i != ctx->NumStats && order)\r\n  {\r\n    ctx->NumStats = (Byte)i;\r\n    s = STATS(ctx);\r\n    if (i < 0)\r\n    {\r\n      FreeUnits(p, s, tmp);\r\n      SpecialFreeUnit(p, ctx);\r\n      return 0;\r\n    }\r\n    if (i == 0)\r\n    {\r\n      ctx->Flags = (ctx->Flags & 0x10) + 0x08 * (s->Symbol >= 0x40);\r\n      *ONE_STATE(ctx) = *s;\r\n      FreeUnits(p, s, tmp);\r\n      ONE_STATE(ctx)->Freq = (Byte)((unsigned)ONE_STATE(ctx)->Freq + 11) >> 3;\r\n    }\r\n    else\r\n      Refresh(p, ctx, tmp, ctx->SummFreq > 16 * i);\r\n  }\r\n  return REF(ctx);\r\n}\r\n\r\n#ifdef PPMD8_FREEZE_SUPPORT\r\nstatic CPpmd_Void_Ref RemoveBinContexts(CPpmd8 *p, CTX_PTR ctx, unsigned order)\r\n{\r\n  CPpmd_State *s;\r\n  if (!ctx->NumStats)\r\n  {\r\n    s = ONE_STATE(ctx);\r\n    if ((Byte *)Ppmd8_GetPtr(p, SUCCESSOR(s)) >= p->UnitsStart && order < p->MaxOrder)\r\n      SetSuccessor(s, RemoveBinContexts(p, CTX(SUCCESSOR(s)), order + 1));\r\n    else\r\n      SetSuccessor(s, 0);\r\n    /* Suffix context can be removed already, since different (high-order)\r\n       Successors may refer to same context. So we check Flags == 0xFF (Stamp == EMPTY_NODE) */\r\n    if (!SUCCESSOR(s) && (!SUFFIX(ctx)->NumStats || SUFFIX(ctx)->Flags == 0xFF))\r\n    {\r\n      FreeUnits(p, ctx, 1);\r\n      return 0;\r\n    }\r\n    else\r\n      return REF(ctx);\r\n  }\r\n\r\n  for (s = STATS(ctx) + ctx->NumStats; s >= STATS(ctx); s--)\r\n    if ((Byte *)Ppmd8_GetPtr(p, SUCCESSOR(s)) >= p->UnitsStart && order < p->MaxOrder)\r\n      SetSuccessor(s, RemoveBinContexts(p, CTX(SUCCESSOR(s)), order + 1));\r\n    else\r\n      SetSuccessor(s, 0);\r\n  \r\n  return REF(ctx);\r\n}\r\n#endif\r\n\r\nstatic UInt32 GetUsedMemory(const CPpmd8 *p)\r\n{\r\n  UInt32 v = 0;\r\n  unsigned i;\r\n  for (i = 0; i < PPMD_NUM_INDEXES; i++)\r\n    v += p->Stamps[i] * I2U(i);\r\n  return p->Size - (UInt32)(p->HiUnit - p->LoUnit) - (UInt32)(p->UnitsStart - p->Text) - U2B(v);\r\n}\r\n\r\n#ifdef PPMD8_FREEZE_SUPPORT\r\n  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1, fSuccessor)\r\n#else\r\n  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)\r\n#endif\r\n\r\nstatic void RestoreModel(CPpmd8 *p, CTX_PTR c1\r\n    #ifdef PPMD8_FREEZE_SUPPORT\r\n    , CTX_PTR fSuccessor\r\n    #endif\r\n    )\r\n{\r\n  CTX_PTR c;\r\n  CPpmd_State *s;\r\n  RESET_TEXT(0);\r\n  for (c = p->MaxContext; c != c1; c = SUFFIX(c))\r\n    if (--(c->NumStats) == 0)\r\n    {\r\n      s = STATS(c);\r\n      c->Flags = (c->Flags & 0x10) + 0x08 * (s->Symbol >= 0x40);\r\n      *ONE_STATE(c) = *s;\r\n      SpecialFreeUnit(p, s);\r\n      ONE_STATE(c)->Freq = (ONE_STATE(c)->Freq + 11) >> 3;\r\n    }\r\n    else\r\n      Refresh(p, c, (c->NumStats+3) >> 1, 0);\r\n \r\n  for (; c != p->MinContext; c = SUFFIX(c))\r\n    if (!c->NumStats)\r\n      ONE_STATE(c)->Freq -= ONE_STATE(c)->Freq >> 1;\r\n    else if ((c->SummFreq += 4) > 128 + 4 * c->NumStats)\r\n      Refresh(p, c, (c->NumStats + 2) >> 1, 1);\r\n\r\n  #ifdef PPMD8_FREEZE_SUPPORT\r\n  if (p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE)\r\n  {\r\n    p->MaxContext = fSuccessor;\r\n    p->GlueCount += !(p->Stamps[1] & 1);\r\n  }\r\n  else if (p->RestoreMethod == PPMD8_RESTORE_METHOD_FREEZE)\r\n  {\r\n    while (p->MaxContext->Suffix)\r\n      p->MaxContext = SUFFIX(p->MaxContext);\r\n    RemoveBinContexts(p, p->MaxContext, 0);\r\n    p->RestoreMethod++;\r\n    p->GlueCount = 0;\r\n    p->OrderFall = p->MaxOrder;\r\n  }\r\n  else\r\n  #endif\r\n  if (p->RestoreMethod == PPMD8_RESTORE_METHOD_RESTART || GetUsedMemory(p) < (p->Size >> 1))\r\n    RestartModel(p);\r\n  else\r\n  {\r\n    while (p->MaxContext->Suffix)\r\n      p->MaxContext = SUFFIX(p->MaxContext);\r\n    do\r\n    {\r\n      CutOff(p, p->MaxContext, 0);\r\n      ExpandTextArea(p);\r\n    }\r\n    while (GetUsedMemory(p) > 3 * (p->Size >> 2));\r\n    p->GlueCount = 0;\r\n    p->OrderFall = p->MaxOrder;\r\n  }\r\n}\r\n\r\nstatic CTX_PTR CreateSuccessors(CPpmd8 *p, Bool skip, CPpmd_State *s1, CTX_PTR c)\r\n{\r\n  CPpmd_State upState;\r\n  Byte flags;\r\n  CPpmd_Byte_Ref upBranch = (CPpmd_Byte_Ref)SUCCESSOR(p->FoundState);\r\n  /* fixed over Shkarin's code. Maybe it could work without + 1 too. */\r\n  CPpmd_State *ps[PPMD8_MAX_ORDER + 1];\r\n  unsigned numPs = 0;\r\n  \r\n  if (!skip)\r\n    ps[numPs++] = p->FoundState;\r\n  \r\n  while (c->Suffix)\r\n  {\r\n    CPpmd_Void_Ref successor;\r\n    CPpmd_State *s;\r\n    c = SUFFIX(c);\r\n    if (s1)\r\n    {\r\n      s = s1;\r\n      s1 = NULL;\r\n    }\r\n    else if (c->NumStats != 0)\r\n    {\r\n      for (s = STATS(c); s->Symbol != p->FoundState->Symbol; s++);\r\n      if (s->Freq < MAX_FREQ - 9)\r\n      {\r\n        s->Freq++;\r\n        c->SummFreq++;\r\n      }\r\n    }\r\n    else\r\n    {\r\n      s = ONE_STATE(c);\r\n      s->Freq += (!SUFFIX(c)->NumStats & (s->Freq < 24));\r\n    }\r\n    successor = SUCCESSOR(s);\r\n    if (successor != upBranch)\r\n    {\r\n      c = CTX(successor);\r\n      if (numPs == 0)\r\n        return c;\r\n      break;\r\n    }\r\n    ps[numPs++] = s;\r\n  }\r\n  \r\n  upState.Symbol = *(const Byte *)Ppmd8_GetPtr(p, upBranch);\r\n  SetSuccessor(&upState, upBranch + 1);\r\n  flags = 0x10 * (p->FoundState->Symbol >= 0x40) + 0x08 * (upState.Symbol >= 0x40);\r\n\r\n  if (c->NumStats == 0)\r\n    upState.Freq = ONE_STATE(c)->Freq;\r\n  else\r\n  {\r\n    UInt32 cf, s0;\r\n    CPpmd_State *s;\r\n    for (s = STATS(c); s->Symbol != upState.Symbol; s++);\r\n    cf = s->Freq - 1;\r\n    s0 = c->SummFreq - c->NumStats - cf;\r\n    upState.Freq = (Byte)(1 + ((2 * cf <= s0) ? (5 * cf > s0) : ((cf + 2 * s0 - 3) / s0)));\r\n  }\r\n\r\n  do\r\n  {\r\n    /* Create Child */\r\n    CTX_PTR c1; /* = AllocContext(p); */\r\n    if (p->HiUnit != p->LoUnit)\r\n      c1 = (CTX_PTR)(p->HiUnit -= UNIT_SIZE);\r\n    else if (p->FreeList[0] != 0)\r\n      c1 = (CTX_PTR)RemoveNode(p, 0);\r\n    else\r\n    {\r\n      c1 = (CTX_PTR)AllocUnitsRare(p, 0);\r\n      if (!c1)\r\n        return NULL;\r\n    }\r\n    c1->NumStats = 0;\r\n    c1->Flags = flags;\r\n    *ONE_STATE(c1) = upState;\r\n    c1->Suffix = REF(c);\r\n    SetSuccessor(ps[--numPs], REF(c1));\r\n    c = c1;\r\n  }\r\n  while (numPs != 0);\r\n  \r\n  return c;\r\n}\r\n\r\nstatic CTX_PTR ReduceOrder(CPpmd8 *p, CPpmd_State *s1, CTX_PTR c)\r\n{\r\n  CPpmd_State *s = NULL;\r\n  CTX_PTR c1 = c;\r\n  CPpmd_Void_Ref upBranch = REF(p->Text);\r\n  \r\n  #ifdef PPMD8_FREEZE_SUPPORT\r\n  /* The BUG in Shkarin's code was fixed: ps could overflow in CUT_OFF mode. */\r\n  CPpmd_State *ps[PPMD8_MAX_ORDER + 1];\r\n  unsigned numPs = 0;\r\n  ps[numPs++] = p->FoundState;\r\n  #endif\r\n\r\n  SetSuccessor(p->FoundState, upBranch);\r\n  p->OrderFall++;\r\n\r\n  for (;;)\r\n  {\r\n    if (s1)\r\n    {\r\n      c = SUFFIX(c);\r\n      s = s1;\r\n      s1 = NULL;\r\n    }\r\n    else\r\n    {\r\n      if (!c->Suffix)\r\n      {\r\n        #ifdef PPMD8_FREEZE_SUPPORT\r\n        if (p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE)\r\n        {\r\n          do { SetSuccessor(ps[--numPs], REF(c)); } while (numPs);\r\n          RESET_TEXT(1);\r\n          p->OrderFall = 1;\r\n        }\r\n        #endif\r\n        return c;\r\n      }\r\n      c = SUFFIX(c);\r\n      if (c->NumStats)\r\n      {\r\n        if ((s = STATS(c))->Symbol != p->FoundState->Symbol)\r\n          do { s++; } while (s->Symbol != p->FoundState->Symbol);\r\n        if (s->Freq < MAX_FREQ - 9)\r\n        {\r\n          s->Freq += 2;\r\n          c->SummFreq += 2;\r\n        }\r\n      }\r\n      else\r\n      {\r\n        s = ONE_STATE(c);\r\n        s->Freq += (s->Freq < 32);\r\n      }\r\n    }\r\n    if (SUCCESSOR(s))\r\n      break;\r\n    #ifdef PPMD8_FREEZE_SUPPORT\r\n    ps[numPs++] = s;\r\n    #endif\r\n    SetSuccessor(s, upBranch);\r\n    p->OrderFall++;\r\n  }\r\n  \r\n  #ifdef PPMD8_FREEZE_SUPPORT\r\n  if (p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE)\r\n  {\r\n    c = CTX(SUCCESSOR(s));\r\n    do { SetSuccessor(ps[--numPs], REF(c)); } while (numPs);\r\n    RESET_TEXT(1);\r\n    p->OrderFall = 1;\r\n    return c;\r\n  }\r\n  else\r\n  #endif\r\n  if (SUCCESSOR(s) <= upBranch)\r\n  {\r\n    CTX_PTR successor;\r\n    CPpmd_State *s1 = p->FoundState;\r\n    p->FoundState = s;\r\n\r\n    successor = CreateSuccessors(p, False, NULL, c);\r\n    if (successor == NULL)\r\n      SetSuccessor(s, 0);\r\n    else\r\n      SetSuccessor(s, REF(successor));\r\n    p->FoundState = s1;\r\n  }\r\n  \r\n  if (p->OrderFall == 1 && c1 == p->MaxContext)\r\n  {\r\n    SetSuccessor(p->FoundState, SUCCESSOR(s));\r\n    p->Text--;\r\n  }\r\n  if (SUCCESSOR(s) == 0)\r\n    return NULL;\r\n  return CTX(SUCCESSOR(s));\r\n}\r\n\r\nstatic void UpdateModel(CPpmd8 *p)\r\n{\r\n  CPpmd_Void_Ref successor, fSuccessor = SUCCESSOR(p->FoundState);\r\n  CTX_PTR c;\r\n  unsigned s0, ns, fFreq = p->FoundState->Freq;\r\n  Byte flag, fSymbol = p->FoundState->Symbol;\r\n  CPpmd_State *s = NULL;\r\n  \r\n  if (p->FoundState->Freq < MAX_FREQ / 4 && p->MinContext->Suffix != 0)\r\n  {\r\n    c = SUFFIX(p->MinContext);\r\n    \r\n    if (c->NumStats == 0)\r\n    {\r\n      s = ONE_STATE(c);\r\n      if (s->Freq < 32)\r\n        s->Freq++;\r\n    }\r\n    else\r\n    {\r\n      s = STATS(c);\r\n      if (s->Symbol != p->FoundState->Symbol)\r\n      {\r\n        do { s++; } while (s->Symbol != p->FoundState->Symbol);\r\n        if (s[0].Freq >= s[-1].Freq)\r\n        {\r\n          SwapStates(&s[0], &s[-1]);\r\n          s--;\r\n        }\r\n      }\r\n      if (s->Freq < MAX_FREQ - 9)\r\n      {\r\n        s->Freq += 2;\r\n        c->SummFreq += 2;\r\n      }\r\n    }\r\n  }\r\n  \r\n  c = p->MaxContext;\r\n  if (p->OrderFall == 0 && fSuccessor)\r\n  {\r\n    CTX_PTR cs = CreateSuccessors(p, True, s, p->MinContext);\r\n    if (cs == 0)\r\n    {\r\n      SetSuccessor(p->FoundState, 0);\r\n      RESTORE_MODEL(c, CTX(fSuccessor));\r\n    }\r\n    else\r\n    {\r\n      SetSuccessor(p->FoundState, REF(cs));\r\n      p->MaxContext = cs;\r\n    }\r\n    return;\r\n  }\r\n  \r\n  *p->Text++ = p->FoundState->Symbol;\r\n  successor = REF(p->Text);\r\n  if (p->Text >= p->UnitsStart)\r\n  {\r\n    RESTORE_MODEL(c, CTX(fSuccessor)); /* check it */\r\n    return;\r\n  }\r\n  \r\n  if (!fSuccessor)\r\n  {\r\n    CTX_PTR cs = ReduceOrder(p, s, p->MinContext);\r\n    if (cs == NULL)\r\n    {\r\n      RESTORE_MODEL(c, 0);\r\n      return;\r\n    }\r\n    fSuccessor = REF(cs);\r\n  }\r\n  else if ((Byte *)Ppmd8_GetPtr(p, fSuccessor) < p->UnitsStart)\r\n  {\r\n    CTX_PTR cs = CreateSuccessors(p, False, s, p->MinContext);\r\n    if (cs == NULL)\r\n    {\r\n      RESTORE_MODEL(c, 0);\r\n      return;\r\n    }\r\n    fSuccessor = REF(cs);\r\n  }\r\n  \r\n  if (--p->OrderFall == 0)\r\n  {\r\n    successor = fSuccessor;\r\n    p->Text -= (p->MaxContext != p->MinContext);\r\n  }\r\n  #ifdef PPMD8_FREEZE_SUPPORT\r\n  else if (p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE)\r\n  {\r\n    successor = fSuccessor;\r\n    RESET_TEXT(0);\r\n    p->OrderFall = 0;\r\n  }\r\n  #endif\r\n  \r\n  s0 = p->MinContext->SummFreq - (ns = p->MinContext->NumStats) - fFreq;\r\n  flag = 0x08 * (fSymbol >= 0x40);\r\n  \r\n  for (; c != p->MinContext; c = SUFFIX(c))\r\n  {\r\n    unsigned ns1;\r\n    UInt32 cf, sf;\r\n    if ((ns1 = c->NumStats) != 0)\r\n    {\r\n      if ((ns1 & 1) != 0)\r\n      {\r\n        /* Expand for one UNIT */\r\n        unsigned oldNU = (ns1 + 1) >> 1;\r\n        unsigned i = U2I(oldNU);\r\n        if (i != U2I(oldNU + 1))\r\n        {\r\n          void *ptr = AllocUnits(p, i + 1);\r\n          void *oldPtr;\r\n          if (!ptr)\r\n          {\r\n            RESTORE_MODEL(c, CTX(fSuccessor));\r\n            return;\r\n          }\r\n          oldPtr = STATS(c);\r\n          MyMem12Cpy(ptr, oldPtr, oldNU);\r\n          InsertNode(p, oldPtr, i);\r\n          c->Stats = STATS_REF(ptr);\r\n        }\r\n      }\r\n      c->SummFreq = (UInt16)(c->SummFreq + (3 * ns1 + 1 < ns));\r\n    }\r\n    else\r\n    {\r\n      CPpmd_State *s = (CPpmd_State*)AllocUnits(p, 0);\r\n      if (!s)\r\n      {\r\n        RESTORE_MODEL(c, CTX(fSuccessor));\r\n        return;\r\n      }\r\n      *s = *ONE_STATE(c);\r\n      c->Stats = REF(s);\r\n      if (s->Freq < MAX_FREQ / 4 - 1)\r\n        s->Freq <<= 1;\r\n      else\r\n        s->Freq = MAX_FREQ - 4;\r\n      c->SummFreq = (UInt16)(s->Freq + p->InitEsc + (ns > 2));\r\n    }\r\n    cf = 2 * fFreq * (c->SummFreq + 6);\r\n    sf = (UInt32)s0 + c->SummFreq;\r\n    if (cf < 6 * sf)\r\n    {\r\n      cf = 1 + (cf > sf) + (cf >= 4 * sf);\r\n      c->SummFreq += 4;\r\n    }\r\n    else\r\n    {\r\n      cf = 4 + (cf > 9 * sf) + (cf > 12 * sf) + (cf > 15 * sf);\r\n      c->SummFreq = (UInt16)(c->SummFreq + cf);\r\n    }\r\n    {\r\n      CPpmd_State *s = STATS(c) + ns1 + 1;\r\n      SetSuccessor(s, successor);\r\n      s->Symbol = fSymbol;\r\n      s->Freq = (Byte)cf;\r\n      c->Flags |= flag;\r\n      c->NumStats = (Byte)(ns1 + 1);\r\n    }\r\n  }\r\n  p->MaxContext = p->MinContext = CTX(fSuccessor);\r\n}\r\n  \r\nstatic void Rescale(CPpmd8 *p)\r\n{\r\n  unsigned i, adder, sumFreq, escFreq;\r\n  CPpmd_State *stats = STATS(p->MinContext);\r\n  CPpmd_State *s = p->FoundState;\r\n  {\r\n    CPpmd_State tmp = *s;\r\n    for (; s != stats; s--)\r\n      s[0] = s[-1];\r\n    *s = tmp;\r\n  }\r\n  escFreq = p->MinContext->SummFreq - s->Freq;\r\n  s->Freq += 4;\r\n  adder = (p->OrderFall != 0\r\n      #ifdef PPMD8_FREEZE_SUPPORT\r\n      || p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE\r\n      #endif\r\n      );\r\n  s->Freq = (Byte)((s->Freq + adder) >> 1);\r\n  sumFreq = s->Freq;\r\n  \r\n  i = p->MinContext->NumStats;\r\n  do\r\n  {\r\n    escFreq -= (++s)->Freq;\r\n    s->Freq = (Byte)((s->Freq + adder) >> 1);\r\n    sumFreq += s->Freq;\r\n    if (s[0].Freq > s[-1].Freq)\r\n    {\r\n      CPpmd_State *s1 = s;\r\n      CPpmd_State tmp = *s1;\r\n      do\r\n        s1[0] = s1[-1];\r\n      while (--s1 != stats && tmp.Freq > s1[-1].Freq);\r\n      *s1 = tmp;\r\n    }\r\n  }\r\n  while (--i);\r\n  \r\n  if (s->Freq == 0)\r\n  {\r\n    unsigned numStats = p->MinContext->NumStats;\r\n    unsigned n0, n1;\r\n    do { i++; } while ((--s)->Freq == 0);\r\n    escFreq += i;\r\n    p->MinContext->NumStats = (Byte)(p->MinContext->NumStats - i);\r\n    if (p->MinContext->NumStats == 0)\r\n    {\r\n      CPpmd_State tmp = *stats;\r\n      tmp.Freq = (Byte)((2 * tmp.Freq + escFreq - 1) / escFreq);\r\n      if (tmp.Freq > MAX_FREQ / 3)\r\n        tmp.Freq = MAX_FREQ / 3;\r\n      InsertNode(p, stats, U2I((numStats + 2) >> 1));\r\n      p->MinContext->Flags = (p->MinContext->Flags & 0x10) + 0x08 * (tmp.Symbol >= 0x40);\r\n      *(p->FoundState = ONE_STATE(p->MinContext)) = tmp;\r\n      return;\r\n    }\r\n    n0 = (numStats + 2) >> 1;\r\n    n1 = (p->MinContext->NumStats + 2) >> 1;\r\n    if (n0 != n1)\r\n      p->MinContext->Stats = STATS_REF(ShrinkUnits(p, stats, n0, n1));\r\n    p->MinContext->Flags &= ~0x08;\r\n    p->MinContext->Flags |= 0x08 * ((s = STATS(p->MinContext))->Symbol >= 0x40);\r\n    i = p->MinContext->NumStats;\r\n    do { p->MinContext->Flags |= 0x08*((++s)->Symbol >= 0x40); } while (--i);\r\n  }\r\n  p->MinContext->SummFreq = (UInt16)(sumFreq + escFreq - (escFreq >> 1));\r\n  p->MinContext->Flags |= 0x4;\r\n  p->FoundState = STATS(p->MinContext);\r\n}\r\n\r\nCPpmd_See *Ppmd8_MakeEscFreq(CPpmd8 *p, unsigned numMasked1, UInt32 *escFreq)\r\n{\r\n  CPpmd_See *see;\r\n  if (p->MinContext->NumStats != 0xFF)\r\n  {\r\n    see = p->See[p->NS2Indx[p->MinContext->NumStats + 2] - 3] +\r\n        (p->MinContext->SummFreq > 11 * ((unsigned)p->MinContext->NumStats + 1)) +\r\n        2 * (2 * (unsigned)p->MinContext->NumStats <\r\n        ((unsigned)SUFFIX(p->MinContext)->NumStats + numMasked1)) +\r\n        p->MinContext->Flags;\r\n    {\r\n      unsigned r = (see->Summ >> see->Shift);\r\n      see->Summ = (UInt16)(see->Summ - r);\r\n      *escFreq = r + (r == 0);\r\n    }\r\n  }\r\n  else\r\n  {\r\n    see = &p->DummySee;\r\n    *escFreq = 1;\r\n  }\r\n  return see;\r\n}\r\n\r\nstatic void NextContext(CPpmd8 *p)\r\n{\r\n  CTX_PTR c = CTX(SUCCESSOR(p->FoundState));\r\n  if (p->OrderFall == 0 && (Byte *)c >= p->UnitsStart)\r\n    p->MinContext = p->MaxContext = c;\r\n  else\r\n  {\r\n    UpdateModel(p);\r\n    p->MinContext = p->MaxContext;\r\n  }\r\n}\r\n\r\nvoid Ppmd8_Update1(CPpmd8 *p)\r\n{\r\n  CPpmd_State *s = p->FoundState;\r\n  s->Freq += 4;\r\n  p->MinContext->SummFreq += 4;\r\n  if (s[0].Freq > s[-1].Freq)\r\n  {\r\n    SwapStates(&s[0], &s[-1]);\r\n    p->FoundState = --s;\r\n    if (s->Freq > MAX_FREQ)\r\n      Rescale(p);\r\n  }\r\n  NextContext(p);\r\n}\r\n\r\nvoid Ppmd8_Update1_0(CPpmd8 *p)\r\n{\r\n  p->PrevSuccess = (2 * p->FoundState->Freq >= p->MinContext->SummFreq);\r\n  p->RunLength += p->PrevSuccess;\r\n  p->MinContext->SummFreq += 4;\r\n  if ((p->FoundState->Freq += 4) > MAX_FREQ)\r\n    Rescale(p);\r\n  NextContext(p);\r\n}\r\n\r\nvoid Ppmd8_UpdateBin(CPpmd8 *p)\r\n{\r\n  p->FoundState->Freq = (Byte)(p->FoundState->Freq + (p->FoundState->Freq < 196));\r\n  p->PrevSuccess = 1;\r\n  p->RunLength++;\r\n  NextContext(p);\r\n}\r\n\r\nvoid Ppmd8_Update2(CPpmd8 *p)\r\n{\r\n  p->MinContext->SummFreq += 4;\r\n  if ((p->FoundState->Freq += 4) > MAX_FREQ)\r\n    Rescale(p);\r\n  p->RunLength = p->InitRL;\r\n  UpdateModel(p);\r\n  p->MinContext = p->MaxContext;\r\n}\r\n\r\n/* H->I changes:\r\n  NS2Indx\r\n  GlewCount, and Glue method\r\n  BinSum\r\n  See / EscFreq\r\n  CreateSuccessors updates more suffix contexts\r\n  UpdateModel consts.\r\n  PrevSuccess Update\r\n*/\r\n"
  },
  {
    "path": "ext/unarr/lzmasdk/Ppmd8.h",
    "content": "/* Ppmd8.h -- PPMdI codec\r\n2011-01-27 : Igor Pavlov : Public domain\r\nThis code is based on:\r\n  PPMd var.I (2002): Dmitry Shkarin : Public domain\r\n  Carryless rangecoder (1999): Dmitry Subbotin : Public domain */\r\n\r\n#ifndef __PPMD8_H\r\n#define __PPMD8_H\r\n\r\n#include \"Ppmd.h\"\r\n\r\nEXTERN_C_BEGIN\r\n\r\n#define PPMD8_MIN_ORDER 2\r\n#define PPMD8_MAX_ORDER 16\r\n\r\nstruct CPpmd8_Context_;\r\n\r\ntypedef\r\n  #ifdef PPMD_32BIT\r\n    struct CPpmd8_Context_ *\r\n  #else\r\n    UInt32\r\n  #endif\r\n  CPpmd8_Context_Ref;\r\n\r\n#pragma pack(push, 1)\r\n\r\ntypedef struct CPpmd8_Context_\r\n{\r\n  Byte NumStats;\r\n  Byte Flags;\r\n  UInt16 SummFreq;\r\n  CPpmd_State_Ref Stats;\r\n  CPpmd8_Context_Ref Suffix;\r\n} CPpmd8_Context;\r\n\r\n#pragma pack(pop)\r\n\r\n#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)\r\n\r\n/* The BUG in Shkarin's code for FREEZE mode was fixed, but that fixed\r\n   code is not compatible with original code for some files compressed\r\n   in FREEZE mode. So we disable FREEZE mode support. */\r\n\r\nenum\r\n{\r\n  PPMD8_RESTORE_METHOD_RESTART,\r\n  PPMD8_RESTORE_METHOD_CUT_OFF\r\n  #ifdef PPMD8_FREEZE_SUPPORT\r\n  , PPMD8_RESTORE_METHOD_FREEZE\r\n  #endif\r\n};\r\n\r\ntypedef struct\r\n{\r\n  CPpmd8_Context *MinContext, *MaxContext;\r\n  CPpmd_State *FoundState;\r\n  unsigned OrderFall, InitEsc, PrevSuccess, MaxOrder;\r\n  Int32 RunLength, InitRL; /* must be 32-bit at least */\r\n\r\n  UInt32 Size;\r\n  UInt32 GlueCount;\r\n  Byte *Base, *LoUnit, *HiUnit, *Text, *UnitsStart;\r\n  UInt32 AlignOffset;\r\n  unsigned RestoreMethod;\r\n\r\n  /* Range Coder */\r\n  UInt32 Range;\r\n  UInt32 Code;\r\n  UInt32 Low;\r\n  union\r\n  {\r\n    IByteIn *In;\r\n    IByteOut *Out;\r\n  } Stream;\r\n\r\n  Byte Indx2Units[PPMD_NUM_INDEXES];\r\n  Byte Units2Indx[128];\r\n  CPpmd_Void_Ref FreeList[PPMD_NUM_INDEXES];\r\n  UInt32 Stamps[PPMD_NUM_INDEXES];\r\n\r\n  Byte NS2BSIndx[256], NS2Indx[260];\r\n  CPpmd_See DummySee, See[24][32];\r\n  UInt16 BinSumm[25][64];\r\n} CPpmd8;\r\n\r\nvoid Ppmd8_Construct(CPpmd8 *p);\r\nBool Ppmd8_Alloc(CPpmd8 *p, UInt32 size, ISzAlloc *alloc);\r\nvoid Ppmd8_Free(CPpmd8 *p, ISzAlloc *alloc);\r\nvoid Ppmd8_Init(CPpmd8 *p, unsigned maxOrder, unsigned restoreMethod);\r\n#define Ppmd8_WasAllocated(p) ((p)->Base != NULL)\r\n\r\n\r\n/* ---------- Internal Functions ---------- */\r\n\r\nextern const Byte PPMD8_kExpEscape[16];\r\n\r\n#ifdef PPMD_32BIT\r\n  #define Ppmd8_GetPtr(p, ptr) (ptr)\r\n  #define Ppmd8_GetContext(p, ptr) (ptr)\r\n  #define Ppmd8_GetStats(p, ctx) ((ctx)->Stats)\r\n#else\r\n  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))\r\n  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))\r\n  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))\r\n#endif\r\n\r\nvoid Ppmd8_Update1(CPpmd8 *p);\r\nvoid Ppmd8_Update1_0(CPpmd8 *p);\r\nvoid Ppmd8_Update2(CPpmd8 *p);\r\nvoid Ppmd8_UpdateBin(CPpmd8 *p);\r\n\r\n#define Ppmd8_GetBinSumm(p) \\\r\n    &p->BinSumm[p->NS2Indx[Ppmd8Context_OneState(p->MinContext)->Freq - 1]][ \\\r\n    p->NS2BSIndx[Ppmd8_GetContext(p, p->MinContext->Suffix)->NumStats] + \\\r\n    p->PrevSuccess + p->MinContext->Flags + ((p->RunLength >> 26) & 0x20)]\r\n\r\nCPpmd_See *Ppmd8_MakeEscFreq(CPpmd8 *p, unsigned numMasked, UInt32 *scale);\r\n\r\n\r\n/* ---------- Decode ---------- */\r\n\r\nBool Ppmd8_RangeDec_Init(CPpmd8 *p);\r\n#define Ppmd8_RangeDec_IsFinishedOK(p) ((p)->Code == 0)\r\nint Ppmd8_DecodeSymbol(CPpmd8 *p); /* returns: -1 as EndMarker, -2 as DataError */\r\n\r\n\r\n/* ---------- Encode ---------- */\r\n\r\n#define Ppmd8_RangeEnc_Init(p) { (p)->Low = 0; (p)->Range = 0xFFFFFFFF; }\r\nvoid Ppmd8_RangeEnc_FlushData(CPpmd8 *p);\r\nvoid Ppmd8_EncodeSymbol(CPpmd8 *p, int symbol); /* symbol = -1 means EndMarker */\r\n\r\nEXTERN_C_END\r\n \r\n#endif\r\n"
  },
  {
    "path": "ext/unarr/lzmasdk/Ppmd8Dec.c",
    "content": "/* Ppmd8Dec.c -- PPMdI Decoder\r\n2010-04-16 : Igor Pavlov : Public domain\r\nThis code is based on:\r\n  PPMd var.I (2002): Dmitry Shkarin : Public domain\r\n  Carryless rangecoder (1999): Dmitry Subbotin : Public domain */\r\n\r\n#include \"Precomp.h\"\r\n\r\n#include \"Ppmd8.h\"\r\n\r\n#define kTop (1 << 24)\r\n#define kBot (1 << 15)\r\n\r\nBool Ppmd8_RangeDec_Init(CPpmd8 *p)\r\n{\r\n  unsigned i;\r\n  p->Low = 0;\r\n  p->Range = 0xFFFFFFFF;\r\n  p->Code = 0;\r\n  for (i = 0; i < 4; i++)\r\n    p->Code = (p->Code << 8) | p->Stream.In->Read(p->Stream.In);\r\n  return (p->Code < 0xFFFFFFFF);\r\n}\r\n\r\nstatic UInt32 RangeDec_GetThreshold(CPpmd8 *p, UInt32 total)\r\n{\r\n  return p->Code / (p->Range /= total);\r\n}\r\n\r\nstatic void RangeDec_Decode(CPpmd8 *p, UInt32 start, UInt32 size)\r\n{\r\n  start *= p->Range;\r\n  p->Low += start;\r\n  p->Code -= start;\r\n  p->Range *= size;\r\n\r\n  while ((p->Low ^ (p->Low + p->Range)) < kTop ||\r\n      (p->Range < kBot && ((p->Range = (0 - p->Low) & (kBot - 1)), 1)))\r\n  {\r\n    p->Code = (p->Code << 8) | p->Stream.In->Read(p->Stream.In);\r\n    p->Range <<= 8;\r\n    p->Low <<= 8;\r\n  }\r\n}\r\n\r\n#define MASK(sym) ((signed char *)charMask)[sym]\r\n\r\nint Ppmd8_DecodeSymbol(CPpmd8 *p)\r\n{\r\n  size_t charMask[256 / sizeof(size_t)];\r\n  if (p->MinContext->NumStats != 0)\r\n  {\r\n    CPpmd_State *s = Ppmd8_GetStats(p, p->MinContext);\r\n    unsigned i;\r\n    UInt32 count, hiCnt;\r\n    if ((count = RangeDec_GetThreshold(p, p->MinContext->SummFreq)) < (hiCnt = s->Freq))\r\n    {\r\n      Byte symbol;\r\n      RangeDec_Decode(p, 0, s->Freq);\r\n      p->FoundState = s;\r\n      symbol = s->Symbol;\r\n      Ppmd8_Update1_0(p);\r\n      return symbol;\r\n    }\r\n    p->PrevSuccess = 0;\r\n    i = p->MinContext->NumStats;\r\n    do\r\n    {\r\n      if ((hiCnt += (++s)->Freq) > count)\r\n      {\r\n        Byte symbol;\r\n        RangeDec_Decode(p, hiCnt - s->Freq, s->Freq);\r\n        p->FoundState = s;\r\n        symbol = s->Symbol;\r\n        Ppmd8_Update1(p);\r\n        return symbol;\r\n      }\r\n    }\r\n    while (--i);\r\n    if (count >= p->MinContext->SummFreq)\r\n      return -2;\r\n    RangeDec_Decode(p, hiCnt, p->MinContext->SummFreq - hiCnt);\r\n    PPMD_SetAllBitsIn256Bytes(charMask);\r\n    MASK(s->Symbol) = 0;\r\n    i = p->MinContext->NumStats;\r\n    do { MASK((--s)->Symbol) = 0; } while (--i);\r\n  }\r\n  else\r\n  {\r\n    UInt16 *prob = Ppmd8_GetBinSumm(p);\r\n    if (((p->Code / (p->Range >>= 14)) < *prob))\r\n    {\r\n      Byte symbol;\r\n      RangeDec_Decode(p, 0, *prob);\r\n      *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);\r\n      symbol = (p->FoundState = Ppmd8Context_OneState(p->MinContext))->Symbol;\r\n      Ppmd8_UpdateBin(p);\r\n      return symbol;\r\n    }\r\n    RangeDec_Decode(p, *prob, (1 << 14) - *prob);\r\n    *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob);\r\n    p->InitEsc = PPMD8_kExpEscape[*prob >> 10];\r\n    PPMD_SetAllBitsIn256Bytes(charMask);\r\n    MASK(Ppmd8Context_OneState(p->MinContext)->Symbol) = 0;\r\n    p->PrevSuccess = 0;\r\n  }\r\n  for (;;)\r\n  {\r\n    CPpmd_State *ps[256], *s;\r\n    UInt32 freqSum, count, hiCnt;\r\n    CPpmd_See *see;\r\n    unsigned i, num, numMasked = p->MinContext->NumStats;\r\n    do\r\n    {\r\n      p->OrderFall++;\r\n      if (!p->MinContext->Suffix)\r\n        return -1;\r\n      p->MinContext = Ppmd8_GetContext(p, p->MinContext->Suffix);\r\n    }\r\n    while (p->MinContext->NumStats == numMasked);\r\n    hiCnt = 0;\r\n    s = Ppmd8_GetStats(p, p->MinContext);\r\n    i = 0;\r\n    num = p->MinContext->NumStats - numMasked;\r\n    do\r\n    {\r\n      int k = (int)(MASK(s->Symbol));\r\n      hiCnt += (s->Freq & k);\r\n      ps[i] = s++;\r\n      i -= k;\r\n    }\r\n    while (i != num);\r\n    \r\n    see = Ppmd8_MakeEscFreq(p, numMasked, &freqSum);\r\n    freqSum += hiCnt;\r\n    count = RangeDec_GetThreshold(p, freqSum);\r\n    \r\n    if (count < hiCnt)\r\n    {\r\n      Byte symbol;\r\n      CPpmd_State **pps = ps;\r\n      for (hiCnt = 0; (hiCnt += (*pps)->Freq) <= count; pps++);\r\n      s = *pps;\r\n      RangeDec_Decode(p, hiCnt - s->Freq, s->Freq);\r\n      Ppmd_See_Update(see);\r\n      p->FoundState = s;\r\n      symbol = s->Symbol;\r\n      Ppmd8_Update2(p);\r\n      return symbol;\r\n    }\r\n    if (count >= freqSum)\r\n      return -2;\r\n    RangeDec_Decode(p, hiCnt, freqSum - hiCnt);\r\n    see->Summ = (UInt16)(see->Summ + freqSum);\r\n    do { MASK(ps[--i]->Symbol) = 0; } while (i != 0);\r\n  }\r\n}\r\n"
  },
  {
    "path": "ext/unarr/lzmasdk/Precomp.h",
    "content": "/* Precomp.h -- StdAfx\r\n2013-11-12 : Igor Pavlov : Public domain */\r\n\r\n#ifndef __7Z_PRECOMP_H\r\n#define __7Z_PRECOMP_H\r\n\r\n/* #include \"Compiler.h\" */\r\n#ifdef _MSC_VER\r\n#pragma warning(disable : 4456) // declaration of * hides previous local declaration\r\n#pragma warning(disable : 4457) // declaration of * hides function parameter\r\n#pragma warning(disable : 4996) // This function or variable may be unsafe\r\n#endif\r\n/* #include \"7zTypes.h\" */\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/unarr/main.c",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n/* demonstration of most of the public unarr API:\r\n   parses and decompresses an archive into memory (integrity test) */\r\n\r\n#include \"unarr.h\"\r\n\r\n#include <stdio.h>\r\n#include <inttypes.h>\r\n#include <string.h>\r\n#if !defined(NDEBUG) && defined(_MSC_VER)\r\n#include <windows.h>\r\n#include <crtdbg.h>\r\n#endif\r\n\r\nar_archive *ar_open_any_archive(ar_stream *stream, const char *fileext)\r\n{\r\n    ar_archive *ar = ar_open_rar_archive(stream);\r\n    if (!ar)\r\n        ar = ar_open_zip_archive(stream, fileext && (strcmp(fileext, \".xps\") == 0 || strcmp(fileext, \".epub\") == 0));\r\n    if (!ar)\r\n        ar = ar_open_7z_archive(stream);\r\n    if (!ar)\r\n        ar = ar_open_tar_archive(stream);\r\n    return ar;\r\n}\r\n\r\n#define FailIf(cond, msg, ...) if (cond) { fprintf(stderr, msg \"\\n\", __VA_ARGS__); goto CleanUp; } error_step++\r\n\r\nint main(int argc, char *argv[])\r\n{\r\n    ar_stream *stream = NULL;\r\n    ar_archive *ar = NULL;\r\n    int entry_count = 1;\r\n    int entry_skips = 0;\r\n    int error_step = 1;\r\n\r\n#if !defined(NDEBUG) && defined(_MSC_VER)\r\n    if (!IsDebuggerPresent()) {\r\n        _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);\r\n        _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);\r\n    }\r\n    _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);\r\n#endif\r\n\r\n    FailIf(argc != 2, \"Syntax: %s <filename.ext>\", argv[0]);\r\n\r\n    stream = ar_open_file(argv[1]);\r\n    FailIf(!stream, \"Error: File \\\"%s\\\" not found!\", argv[1]);\r\n\r\n    printf(\"Parsing \\\"%s\\\":\\n\", argv[1]);\r\n    ar = ar_open_any_archive(stream, strrchr(argv[1], '.'));\r\n    FailIf(!ar, \"Error: No valid %s archive!\", \"RAR, ZIP, 7Z or TAR\");\r\n\r\n    while (ar_parse_entry(ar)) {\r\n        size_t size = ar_entry_get_size(ar);\r\n        printf(\"%02d. %s (@%\" PRIi64 \")\\n\", entry_count++, ar_entry_get_name(ar), ar_entry_get_offset(ar));\r\n        while (size > 0) {\r\n            unsigned char buffer[1024];\r\n            size_t count = size < sizeof(buffer) ? size : sizeof(buffer);\r\n            if (!ar_entry_uncompress(ar, buffer, count))\r\n                break;\r\n            size -= count;\r\n        }\r\n        if (size > 0) {\r\n            fprintf(stderr, \"Warning: Failed to uncompress... skipping\\n\");\r\n            entry_skips++;\r\n        }\r\n    }\r\n    FailIf(!ar_at_eof(ar), \"Error: Failed to parse entry %d!\", entry_count);\r\n    error_step = entry_skips > 0 ? 1000 + entry_skips : 0;\r\n\r\nCleanUp:\r\n    ar_close_archive(ar);\r\n    ar_close(stream);\r\n    return error_step;\r\n}\r\n"
  },
  {
    "path": "ext/unarr/rar/filter-rar.c",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n#include \"rar.h\"\r\n#include \"rarvm.h\"\r\n\r\n/* adapted from https://code.google.com/p/theunarchiver/source/browse/XADMaster/XADRARVirtualMachine.m */\r\n/* adapted from https://code.google.com/p/theunarchiver/source/browse/XADMaster/XADRAR30Filter.m */\r\n\r\nstruct MemBitReader {\r\n    const uint8_t *bytes;\r\n    size_t length;\r\n    size_t offset;\r\n    uint64_t bits;\r\n    int available;\r\n    bool at_eof;\r\n};\r\n\r\nstruct RARProgramCode {\r\n    RARProgram *prog;\r\n    uint8_t *staticdata;\r\n    uint32_t staticdatalen;\r\n    uint8_t *globalbackup;\r\n    uint32_t globalbackuplen;\r\n    uint64_t fingerprint;\r\n    uint32_t usagecount;\r\n    uint32_t oldfilterlength;\r\n    struct RARProgramCode *next;\r\n};\r\n\r\nstruct RARFilter {\r\n    struct RARProgramCode *prog;\r\n    uint32_t initialregisters[8];\r\n    uint8_t *globaldata;\r\n    uint32_t globaldatalen;\r\n    size_t blockstartpos;\r\n    uint32_t blocklength;\r\n    uint32_t filteredblockaddress;\r\n    uint32_t filteredblocklength;\r\n    struct RARFilter *next;\r\n};\r\n\r\nstatic bool br_fill(struct MemBitReader *br, int bits)\r\n{\r\n    while (br->available < bits && br->offset < br->length) {\r\n        br->bits = (br->bits << 8) | br->bytes[br->offset++];\r\n        br->available += 8;\r\n    }\r\n    if (bits > br->available) {\r\n        br->at_eof = true;\r\n        return false;\r\n    }\r\n    return true;\r\n}\r\n\r\nstatic inline uint32_t br_bits(struct MemBitReader *br, int bits)\r\n{\r\n    if (bits > br->available && (br->at_eof || !br_fill(br, bits)))\r\n        return 0;\r\n    return (uint32_t)((br->bits >> (br->available -= bits)) & (((uint64_t)1 << bits) - 1));\r\n}\r\n\r\nstatic inline bool br_available(struct MemBitReader *br, int bits)\r\n{\r\n    return !br->at_eof && (bits <= br->available || br_fill(br, bits));\r\n}\r\n\r\nstatic uint32_t br_next_rarvm_number(struct MemBitReader *br)\r\n{\r\n    uint32_t val;\r\n    switch (br_bits(br, 2)) {\r\n    case 0:\r\n        return br_bits(br, 4);\r\n    case 1:\r\n        val = br_bits(br, 8);\r\n        if (val >= 16)\r\n            return val;\r\n        return 0xFFFFFF00 | (val << 4) | br_bits(br, 4);\r\n    case 2:\r\n        return br_bits(br, 16);\r\n    default:\r\n        return br_bits(br, 32);\r\n    }\r\n}\r\n\r\nstatic void bw_write32le(uint8_t *dst, uint32_t value)\r\n{\r\n    dst[0] = value & 0xFF;\r\n    dst[1] = (value >> 8) & 0xFF;\r\n    dst[2] = (value >> 16) & 0xFF;\r\n    dst[3] = (value >> 24) & 0xFF;\r\n}\r\n\r\nstatic void rar_delete_program(struct RARProgramCode *prog)\r\n{\r\n    while (prog) {\r\n        struct RARProgramCode *next = prog->next;\r\n        RARDeleteProgram(prog->prog);\r\n        free(prog->staticdata);\r\n        free(prog->globalbackup);\r\n        free(prog);\r\n        prog = next;\r\n    }\r\n}\r\n\r\nstatic bool rar_parse_operand(struct MemBitReader *br, uint8_t instruction, bool bytemode, uint32_t instrcount, uint8_t *addressmode, uint32_t *value)\r\n{\r\n    if (br_bits(br, 1)) {\r\n        *addressmode = RARRegisterAddressingMode((uint8_t)br_bits(br, 3));\r\n        *value = 0;\r\n    }\r\n    else if (br_bits(br, 1)) {\r\n        if (br_bits(br, 1)) {\r\n            if (br_bits(br, 1))\r\n                *addressmode = RARAbsoluteAddressingMode;\r\n            else\r\n                *addressmode = RARIndexedAbsoluteAddressingMode((uint8_t)br_bits(br, 3));\r\n            *value = br_next_rarvm_number(br);\r\n        }\r\n        else {\r\n            *addressmode = RARRegisterIndirectAddressingMode((uint8_t)br_bits(br, 3));\r\n            *value = 0;\r\n        }\r\n    }\r\n    else {\r\n        *addressmode = RARImmediateAddressingMode;\r\n        if (!bytemode)\r\n            *value = br_next_rarvm_number(br);\r\n        else\r\n            *value = br_bits(br, 8);\r\n        if (instrcount != (uint32_t)-1 && RARInstructionIsRelativeJump(instruction)) {\r\n            if (*value >= 256) /* absolute address */\r\n                *value -= 256;\r\n            else { /* relative address */\r\n                if (*value >= 136)\r\n                    *value -= 264;\r\n                else if (*value >= 16)\r\n                    *value -= 8;\r\n                else if (*value >= 8)\r\n                    *value -= 16;\r\n                *value += instrcount;\r\n            }\r\n        }\r\n    }\r\n    return !br->at_eof;\r\n}\r\n\r\nstatic struct RARProgramCode *rar_compile_program(const uint8_t *bytes, size_t length)\r\n{\r\n    struct MemBitReader br = { 0 };\r\n    struct RARProgramCode *prog;\r\n    uint32_t instrcount = 0;\r\n    uint8_t xor;\r\n    size_t i;\r\n\r\n    xor = 0;\r\n    for (i = 1; i < length; i++)\r\n        xor ^= bytes[i];\r\n    if (!length || xor != bytes[0])\r\n        return NULL;\r\n\r\n    br.bytes = bytes;\r\n    br.length = length;\r\n    br.offset = 1;\r\n\r\n    prog = calloc(1, sizeof(*prog));\r\n    if (!prog)\r\n        return NULL;\r\n    prog->prog = RARCreateProgram();\r\n    if (!prog->prog) {\r\n        rar_delete_program(prog);\r\n        return NULL;\r\n    }\r\n    prog->fingerprint = ar_crc32(0, bytes, length) | ((uint64_t)length << 32);\r\n\r\n    if (br_bits(&br, 1)) {\r\n        prog->staticdatalen = br_next_rarvm_number(&br) + 1;\r\n        prog->staticdata = malloc(prog->staticdatalen);\r\n        if (!prog->staticdata) {\r\n            rar_delete_program(prog);\r\n            return NULL;\r\n        }\r\n        for (i = 0; i < prog->staticdatalen; i++)\r\n            prog->staticdata[i] = (uint8_t)br_bits(&br, 8);\r\n    }\r\n\r\n    while (br_available(&br, 8)) {\r\n        bool ok = true;\r\n        uint8_t instruction = (uint8_t)br_bits(&br, 4);\r\n        bool bytemode = false;\r\n        int numargs = 0;\r\n        uint8_t addrmode1 = 0, addrmode2 = 0;\r\n        uint32_t value1 = 0, value2 = 0;\r\n\r\n        if ((instruction & 0x08))\r\n            instruction = ((instruction << 2) | (uint8_t)br_bits(&br, 2)) - 24;\r\n        if (RARInstructionHasByteMode(instruction))\r\n            bytemode = br_bits(&br, 1) != 0;\r\n        ok = RARProgramAddInstr(prog->prog, instruction, bytemode);\r\n        numargs = NumberOfRARInstructionOperands(instruction);\r\n        if (ok && numargs >= 1)\r\n            ok = rar_parse_operand(&br, instruction, bytemode, instrcount, &addrmode1, &value1);\r\n        if (ok && numargs == 2)\r\n            ok = rar_parse_operand(&br, instruction, bytemode, (uint32_t)-1, &addrmode2, &value2);\r\n        if (ok)\r\n            ok = RARSetLastInstrOperands(prog->prog, addrmode1, value1, addrmode2, value2);\r\n        if (!ok) {\r\n            warn(\"Invalid RAR program instruction\");\r\n            rar_delete_program(prog);\r\n            return NULL;\r\n        }\r\n        instrcount++;\r\n    }\r\n\r\n    if (!RARIsProgramTerminated(prog->prog)) {\r\n        if (!RARProgramAddInstr(prog->prog, RARRetInstruction, false)) {\r\n            rar_delete_program(prog);\r\n            return NULL;\r\n        }\r\n    }\r\n\r\n    return prog;\r\n}\r\n\r\nstatic bool rar_execute_filter_prog(struct RARFilter *filter, RARVirtualMachine *vm)\r\n{\r\n    uint32_t newgloballength;\r\n    uint32_t globallength = filter->globaldatalen;\r\n    if (globallength > RARProgramSystemGlobalSize)\r\n        globallength = RARProgramSystemGlobalSize;\r\n    memcpy(&vm->memory[RARProgramSystemGlobalAddress], filter->globaldata, globallength);\r\n    if (filter->prog->staticdata) {\r\n        uint32_t staticlength = filter->prog->staticdatalen;\r\n        if (staticlength > RARProgramUserGlobalSize - globallength)\r\n            staticlength = RARProgramUserGlobalSize - globallength;\r\n        memcpy(&vm->memory[RARProgramUserGlobalAddress], filter->prog->staticdata, staticlength);\r\n    }\r\n    RARSetVirtualMachineRegisters(vm, filter->initialregisters);\r\n\r\n    if (!RARExecuteProgram(vm, filter->prog->prog)) {\r\n        warn(\"Error while executing program in RAR VM\");\r\n        return false;\r\n    }\r\n\r\n    newgloballength = RARVirtualMachineRead32(vm, RARProgramSystemGlobalAddress + 0x30);\r\n    if (newgloballength > RARProgramUserGlobalSize)\r\n        newgloballength = RARProgramUserGlobalSize;\r\n    if (newgloballength > 0) {\r\n        uint32_t newglobaldatalength = RARProgramSystemGlobalSize + newgloballength;\r\n        if (newglobaldatalength > filter->globaldatalen) {\r\n            uint8_t *newglobaldata = malloc(newglobaldatalength);\r\n            if (!newglobaldata)\r\n                return false;\r\n            free(filter->globaldata);\r\n            filter->globaldata = newglobaldata;\r\n        }\r\n        filter->globaldatalen = newglobaldatalength;\r\n        memcpy(filter->globaldata, &vm->memory[RARProgramSystemGlobalAddress], filter->globaldatalen);\r\n    }\r\n    else\r\n        filter->globaldatalen = 0;\r\n\r\n    return true;\r\n}\r\n\r\nstatic struct RARFilter *rar_create_filter(struct RARProgramCode *prog, const uint8_t *globaldata, uint32_t globaldatalen, uint32_t registers[8], size_t startpos, uint32_t length)\r\n{\r\n    struct RARFilter *filter;\r\n\r\n    filter = calloc(1, sizeof(*filter));\r\n    if (!filter)\r\n        return NULL;\r\n    filter->prog = prog;\r\n    filter->globaldatalen = globaldatalen > RARProgramSystemGlobalSize ? globaldatalen : RARProgramSystemGlobalSize;\r\n    filter->globaldata = calloc(1, filter->globaldatalen);\r\n    if (!filter->globaldata)\r\n        return NULL;\r\n    if (globaldata)\r\n        memcpy(filter->globaldata, globaldata, globaldatalen);\r\n    if (registers)\r\n        memcpy(filter->initialregisters, registers, sizeof(filter->initialregisters));\r\n    filter->blockstartpos = startpos;\r\n    filter->blocklength = length;\r\n\r\n    return filter;\r\n}\r\n\r\nstatic void rar_delete_filter(struct RARFilter *filter)\r\n{\r\n    while (filter) {\r\n        struct RARFilter *next = filter->next;\r\n        free(filter->globaldata);\r\n        free(filter);\r\n        filter = next;\r\n    }\r\n}\r\n\r\nstatic bool rar_execute_filter_delta(struct RARFilter *filter, RARVirtualMachine *vm)\r\n{\r\n    uint32_t length = filter->initialregisters[4];\r\n    uint32_t numchannels = filter->initialregisters[0];\r\n    uint8_t *src, *dst;\r\n    uint32_t i, idx;\r\n\r\n    if (length > RARProgramWorkSize / 2)\r\n        return false;\r\n\r\n    src = &vm->memory[0];\r\n    dst = &vm->memory[length];\r\n    for (i = 0; i < numchannels; i++) {\r\n        uint8_t lastbyte = 0;\r\n        for (idx = i; idx < length; idx += numchannels)\r\n            lastbyte = dst[idx] = lastbyte - *src++;\r\n    }\r\n\r\n    filter->filteredblockaddress = length;\r\n    filter->filteredblocklength = length;\r\n\r\n    return true;\r\n}\r\n\r\nstatic bool rar_execute_filter_e8(struct RARFilter *filter, RARVirtualMachine *vm, size_t pos, bool e9also)\r\n{\r\n    uint32_t length = filter->initialregisters[4];\r\n    uint32_t filesize = 0x1000000;\r\n    uint32_t i;\r\n\r\n    if (length > RARProgramWorkSize || length < 4)\r\n        return false;\r\n\r\n    for (i = 0; i <= length - 5; i++) {\r\n        if (vm->memory[i] == 0xE8 || (e9also && vm->memory[i] == 0xE9)) {\r\n            uint32_t currpos = (uint32_t)pos + i + 1;\r\n            int32_t address = (int32_t)RARVirtualMachineRead32(vm, i + 1);\r\n            if (address < 0 && currpos >= (uint32_t)-address)\r\n                RARVirtualMachineWrite32(vm, i + 1, address + filesize);\r\n            else if (address >= 0 && (uint32_t)address < filesize)\r\n                RARVirtualMachineWrite32(vm, i + 1, address - currpos);\r\n            i += 4;\r\n        }\r\n    }\r\n\r\n    filter->filteredblockaddress = 0;\r\n    filter->filteredblocklength = length;\r\n\r\n    return true;\r\n}\r\n\r\nstatic bool rar_execute_filter_rgb(struct RARFilter *filter, RARVirtualMachine *vm)\r\n{\r\n    uint32_t stride = filter->initialregisters[0];\r\n    uint32_t byteoffset = filter->initialregisters[1];\r\n    uint32_t blocklength = filter->initialregisters[4];\r\n    uint8_t *src, *dst;\r\n    uint32_t i, j;\r\n\r\n    if (blocklength > RARProgramWorkSize / 2 || stride > blocklength)\r\n        return false;\r\n\r\n    src = &vm->memory[0];\r\n    dst = &vm->memory[blocklength];\r\n    for (i = 0; i < 3; i++) {\r\n        uint8_t byte = 0;\r\n        uint8_t *prev = dst + i - stride;\r\n        for (j = i; j < blocklength; j += 3) {\r\n            if (prev >= dst) {\r\n                uint32_t delta1 = abs(prev[3] - prev[0]);\r\n                uint32_t delta2 = abs(byte - prev[0]);\r\n                uint32_t delta3 = abs(prev[3] - prev[0] + byte - prev[0]);\r\n                if (delta1 > delta2 || delta1 > delta3)\r\n                    byte = delta2 <= delta3 ? prev[3] : prev[0];\r\n            }\r\n            byte -= *src++;\r\n            dst[j] = byte;\r\n            prev += 3;\r\n        }\r\n    }\r\n    for (i = byteoffset; i < blocklength - 2; i += 3) {\r\n        dst[i] += dst[i + 1];\r\n        dst[i + 2] += dst[i + 1];\r\n    }\r\n\r\n    filter->filteredblockaddress = blocklength;\r\n    filter->filteredblocklength = blocklength;\r\n\r\n    return true;\r\n}\r\n\r\nstatic bool rar_execute_filter_audio(struct RARFilter *filter, RARVirtualMachine *vm)\r\n{\r\n    uint32_t length = filter->initialregisters[4];\r\n    uint32_t numchannels = filter->initialregisters[0];\r\n    uint8_t *src, *dst;\r\n    uint32_t i, j;\r\n\r\n    if (length > RARProgramWorkSize / 2)\r\n        return false;\r\n\r\n    src = &vm->memory[0];\r\n    dst = &vm->memory[length];\r\n    for (i = 0; i < numchannels; i++) {\r\n        struct AudioState state;\r\n        memset(&state, 0, sizeof(state));\r\n        for (j = i; j < length; j += numchannels) {\r\n            int8_t delta = (int8_t)*src++;\r\n            uint8_t predbyte, byte;\r\n            int prederror;\r\n            state.delta[2] = state.delta[1];\r\n            state.delta[1] = state.lastdelta - state.delta[0];\r\n            state.delta[0] = state.lastdelta;\r\n            predbyte = ((8 * state.lastbyte + state.weight[0] * state.delta[0] + state.weight[1] * state.delta[1] + state.weight[2] * state.delta[2]) >> 3) & 0xFF;\r\n            byte = (predbyte - delta) & 0xFF;\r\n            prederror = delta << 3;\r\n            state.error[0] += abs(prederror);\r\n            state.error[1] += abs(prederror - state.delta[0]); state.error[2] += abs(prederror + state.delta[0]);\r\n            state.error[3] += abs(prederror - state.delta[1]); state.error[4] += abs(prederror + state.delta[1]);\r\n            state.error[5] += abs(prederror - state.delta[2]); state.error[6] += abs(prederror + state.delta[2]);\r\n            state.lastdelta = (int8_t)(byte - state.lastbyte);\r\n            dst[j] = state.lastbyte = byte;\r\n            if (!(state.count++ & 0x1F)) {\r\n                uint8_t k, idx = 0;\r\n                for (k = 1; k < 7; k++) {\r\n                    if (state.error[k] < state.error[idx])\r\n                        idx = k;\r\n                }\r\n                memset(state.error, 0, sizeof(state.error));\r\n                switch (idx) {\r\n                case 1: if (state.weight[0] >= -16) state.weight[0]--; break;\r\n                case 2: if (state.weight[0] < 16) state.weight[0]++; break;\r\n                case 3: if (state.weight[1] >= -16) state.weight[1]--; break;\r\n                case 4: if (state.weight[1] < 16) state.weight[1]++; break;\r\n                case 5: if (state.weight[2] >= -16) state.weight[2]--; break;\r\n                case 6: if (state.weight[2] < 16) state.weight[2]++; break;\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    filter->filteredblockaddress = length;\r\n    filter->filteredblocklength = length;\r\n\r\n    return true;\r\n}\r\n\r\nstatic bool rar_execute_filter(struct RARFilter *filter, RARVirtualMachine *vm, size_t pos)\r\n{\r\n    if (filter->prog->fingerprint == 0x1D0E06077D)\r\n        return rar_execute_filter_delta(filter, vm);\r\n    if (filter->prog->fingerprint == 0x35AD576887)\r\n        return rar_execute_filter_e8(filter, vm, pos, false);\r\n    if (filter->prog->fingerprint == 0x393CD7E57E)\r\n        return rar_execute_filter_e8(filter, vm, pos, true);\r\n    if (filter->prog->fingerprint == 0x951C2C5DC8)\r\n        return rar_execute_filter_rgb(filter, vm);\r\n    if (filter->prog->fingerprint == 0xD8BC85E701)\r\n        return rar_execute_filter_audio(filter, vm);\r\n    log(\"Unknown parsing filter 0x%x%08x\", (uint32_t)(filter->prog->fingerprint >> 32), (uint32_t)filter->prog->fingerprint);\r\n\r\n    /* XADRAR30Filter.m @executeOnVirtualMachine claims that this is required */\r\n    if (filter->prog->globalbackuplen > RARProgramSystemGlobalSize) {\r\n        uint8_t *newglobaldata = malloc(filter->prog->globalbackuplen);\r\n        if (newglobaldata) {\r\n            free(filter->globaldata);\r\n            filter->globaldata = newglobaldata;\r\n            filter->globaldatalen = filter->prog->globalbackuplen;\r\n            memcpy(filter->globaldata, filter->prog->globalbackup, filter->prog->globalbackuplen);\r\n        }\r\n    }\r\n\r\n    filter->initialregisters[6] = (uint32_t)pos;\r\n    bw_write32le(&filter->globaldata[0x24], (uint32_t)pos);\r\n    bw_write32le(&filter->globaldata[0x28], (uint32_t)((uint64_t)pos >> 32));\r\n\r\n    if (!rar_execute_filter_prog(filter, vm))\r\n        return false;\r\n\r\n    filter->filteredblockaddress = RARVirtualMachineRead32(vm, RARProgramSystemGlobalAddress + 0x20) & RARProgramMemoryMask;\r\n    filter->filteredblocklength = RARVirtualMachineRead32(vm, RARProgramSystemGlobalAddress + 0x1C) & RARProgramMemoryMask;\r\n    if (filter->filteredblockaddress + filter->filteredblocklength >= RARProgramMemorySize) {\r\n        filter->filteredblockaddress = filter->filteredblocklength = 0;\r\n        return false;\r\n    }\r\n\r\n    if (filter->globaldatalen > RARProgramSystemGlobalSize) {\r\n        uint8_t *newglobalbackup = malloc(filter->globaldatalen);\r\n        if (newglobalbackup) {\r\n            free(filter->prog->globalbackup);\r\n            filter->prog->globalbackup = newglobalbackup;\r\n            filter->prog->globalbackuplen = filter->globaldatalen;\r\n            memcpy(filter->prog->globalbackup, filter->globaldata, filter->globaldatalen);\r\n        }\r\n    }\r\n    else\r\n        filter->prog->globalbackuplen = 0;\r\n\r\n    return true;\r\n}\r\n\r\nbool rar_parse_filter(ar_archive_rar *rar, const uint8_t *bytes, uint16_t length, uint8_t flags)\r\n{\r\n    struct ar_archive_rar_uncomp_v3 *uncomp = &rar->uncomp.state.v3;\r\n    struct ar_archive_rar_filters *filters = &uncomp->filters;\r\n\r\n    struct MemBitReader br = { 0 };\r\n    struct RARProgramCode *prog;\r\n    struct RARFilter *filter, **nextfilter;\r\n\r\n    uint32_t numprogs, num, blocklength, globaldatalen;\r\n    uint8_t *globaldata;\r\n    size_t blockstartpos;\r\n    uint32_t registers[8] = { 0 };\r\n    uint32_t i;\r\n\r\n    br.bytes = bytes;\r\n    br.length = length;\r\n\r\n    numprogs = 0;\r\n    for (prog = filters->progs; prog; prog = prog->next)\r\n        numprogs++;\r\n\r\n    if ((flags & 0x80)) {\r\n        num = br_next_rarvm_number(&br);\r\n        if (num == 0) {\r\n            rar_delete_filter(filters->stack);\r\n            filters->stack = NULL;\r\n            rar_delete_program(filters->progs);\r\n            filters->progs = NULL;\r\n        }\r\n        else\r\n            num--;\r\n        if (num > numprogs) {\r\n            warn(\"Invalid program number\");\r\n            return false;\r\n        }\r\n        filters->lastfilternum = num;\r\n    }\r\n    else\r\n        num = filters->lastfilternum;\r\n\r\n    prog = filters->progs;\r\n    for (i = 0; i < num; i++)\r\n        prog = prog->next;\r\n    if (prog)\r\n        prog->usagecount++;\r\n\r\n    blockstartpos = br_next_rarvm_number(&br) + (size_t)lzss_position(&rar->uncomp.lzss);\r\n    if ((flags & 0x40))\r\n        blockstartpos += 258;\r\n    if ((flags & 0x20))\r\n        blocklength = br_next_rarvm_number(&br);\r\n    else\r\n        blocklength = prog ? prog->oldfilterlength : 0;\r\n\r\n    registers[3] = RARProgramSystemGlobalAddress;\r\n    registers[4] = blocklength;\r\n    registers[5] = prog ? prog->usagecount : 0;\r\n    registers[7] = RARProgramMemorySize;\r\n\r\n    if ((flags & 0x10)) {\r\n        uint8_t mask = (uint8_t)br_bits(&br, 7);\r\n        for (i = 0; i < 7; i++) {\r\n            if ((mask & (1 << i)))\r\n                registers[i] = br_next_rarvm_number(&br);\r\n        }\r\n    }\r\n\r\n    if (!prog) {\r\n        uint32_t len = br_next_rarvm_number(&br);\r\n        uint8_t *bytecode;\r\n        struct RARProgramCode **next;\r\n\r\n        if (len == 0 || len > 0x10000) {\r\n            warn(\"Invalid RARVM bytecode length\");\r\n            return false;\r\n        }\r\n        bytecode = malloc(len);\r\n        if (!bytecode)\r\n            return false;\r\n        for (i = 0; i < len; i++)\r\n            bytecode[i] = (uint8_t)br_bits(&br, 8);\r\n        prog = rar_compile_program(bytecode, len);\r\n        if (!prog) {\r\n            free(bytecode);\r\n            return false;\r\n        }\r\n        free(bytecode);\r\n        next = &filters->progs;\r\n        while (*next)\r\n            next = &(*next)->next;\r\n        *next = prog;\r\n    }\r\n    prog->oldfilterlength = blocklength;\r\n\r\n    globaldata = NULL;\r\n    globaldatalen = 0;\r\n    if ((flags & 0x08)) {\r\n        globaldatalen = br_next_rarvm_number(&br);\r\n        if (globaldatalen > RARProgramUserGlobalSize) {\r\n            warn(\"Invalid RARVM data length\");\r\n            return false;\r\n        }\r\n        globaldata = malloc(globaldatalen + RARProgramSystemGlobalSize);\r\n        if (!globaldata)\r\n            return false;\r\n        for (i = 0; i < globaldatalen; i++)\r\n            globaldata[i + RARProgramSystemGlobalSize] = (uint8_t)br_bits(&br, 8);\r\n    }\r\n\r\n    if (br.at_eof) {\r\n        free(globaldata);\r\n        return false;\r\n    }\r\n\r\n    filter = rar_create_filter(prog, globaldata, globaldatalen, registers, blockstartpos, blocklength);\r\n    free(globaldata);\r\n    if (!filter)\r\n        return false;\r\n\r\n    for (i = 0; i < 7; i++)\r\n        bw_write32le(&filter->globaldata[i * 4], registers[i]);\r\n    bw_write32le(&filter->globaldata[0x1C], blocklength);\r\n    bw_write32le(&filter->globaldata[0x20], 0);\r\n    bw_write32le(&filter->globaldata[0x2C], prog->usagecount);\r\n\r\n    nextfilter = &filters->stack;\r\n    while (*nextfilter)\r\n        nextfilter = &(*nextfilter)->next;\r\n    *nextfilter = filter;\r\n\r\n    if (!filters->stack->next)\r\n        filters->filterstart = blockstartpos;\r\n\r\n    return true;\r\n}\r\n\r\nbool rar_run_filters(ar_archive_rar *rar)\r\n{\r\n    struct ar_archive_rar_filters *filters = &rar->uncomp.state.v3.filters;\r\n    struct RARFilter *filter = filters->stack;\r\n    size_t start = filters->filterstart;\r\n    size_t end = start + filter->blocklength;\r\n    uint32_t lastfilteraddress;\r\n    uint32_t lastfilterlength;\r\n\r\n    filters->filterstart = SIZE_MAX;\r\n    end = (size_t)rar_expand(rar, end);\r\n    if (end != start + filter->blocklength) {\r\n        warn(\"Failed to expand the expected amout of bytes\");\r\n        return false;\r\n    }\r\n\r\n    if (!filters->vm) {\r\n        filters->vm = calloc(1, sizeof(*filters->vm));\r\n        if (!filters->vm)\r\n            return false;\r\n    }\r\n\r\n    lzss_copy_bytes_from_window(&rar->uncomp.lzss, filters->vm->memory, start, filter->blocklength);\r\n    if (!rar_execute_filter(filter, filters->vm, rar->progress.bytes_done)) {\r\n        warn(\"Failed to execute parsing filter\");\r\n        return false;\r\n    }\r\n\r\n    lastfilteraddress = filter->filteredblockaddress;\r\n    lastfilterlength = filter->filteredblocklength;\r\n    filters->stack = filter->next;\r\n    filter->next = NULL;\r\n    rar_delete_filter(filter);\r\n\r\n    while ((filter = filters->stack) != NULL && filter->blockstartpos == filters->filterstart && filter->blocklength == lastfilterlength) {\r\n        memmove(&filters->vm->memory[0], &filters->vm->memory[lastfilteraddress], lastfilterlength);\r\n        if (!rar_execute_filter(filter, filters->vm, rar->progress.bytes_done)) {\r\n            warn(\"Failed to execute parsing filter\");\r\n            return false;\r\n        }\r\n\r\n        lastfilteraddress = filter->filteredblockaddress;\r\n        lastfilterlength = filter->filteredblocklength;\r\n        filters->stack = filter->next;\r\n        filter->next = NULL;\r\n        rar_delete_filter(filter);\r\n    }\r\n\r\n    if (filters->stack) {\r\n        if (filters->stack->blockstartpos < end) {\r\n            warn(\"Bad filter order\");\r\n            return false;\r\n        }\r\n        filters->filterstart = filters->stack->blockstartpos;\r\n    }\r\n\r\n    filters->lastend = end;\r\n    filters->bytes = &filters->vm->memory[lastfilteraddress];\r\n    filters->bytes_ready = lastfilterlength;\r\n\r\n    return true;\r\n}\r\n\r\nvoid rar_clear_filters(struct ar_archive_rar_filters *filters)\r\n{\r\n    rar_delete_filter(filters->stack);\r\n    rar_delete_program(filters->progs);\r\n    free(filters->vm);\r\n}\r\n"
  },
  {
    "path": "ext/unarr/rar/huffman-rar.c",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n/* adapted from https://code.google.com/p/theunarchiver/source/browse/XADMaster/XADPrefixCode.m */\r\n\r\n#include \"rar.h\"\r\n\r\nbool rar_new_node(struct huffman_code *code)\r\n{\r\n    if (!code->tree) {\r\n        code->minlength = INT_MAX;\r\n        code->maxlength = INT_MIN;\r\n    }\r\n    if (code->numentries + 1 >= code->capacity) {\r\n        /* in my small file sample, 1024 is the value needed most often */\r\n        int new_capacity = code->capacity ? code->capacity * 2 : 1024;\r\n        void *new_tree = calloc(new_capacity, sizeof(*code->tree));\r\n        if (!new_tree) {\r\n            warn(\"OOM during decompression\");\r\n            return false;\r\n        }\r\n        memcpy(new_tree, code->tree, code->capacity * sizeof(*code->tree));\r\n        free(code->tree);\r\n        code->tree = new_tree;\r\n        code->capacity = new_capacity;\r\n    }\r\n    code->tree[code->numentries].branches[0] = -1;\r\n    code->tree[code->numentries].branches[1] = -2;\r\n    code->numentries++;\r\n    return true;\r\n}\r\n\r\nbool rar_add_value(struct huffman_code *code, int value, int codebits, int length)\r\n{\r\n    int lastnode, bitpos, bit;\r\n\r\n    free(code->table);\r\n    code->table = NULL;\r\n\r\n    if (length > code->maxlength)\r\n        code->maxlength = length;\r\n    if (length < code->minlength)\r\n        code->minlength = length;\r\n\r\n    lastnode = 0;\r\n    for (bitpos = length - 1; bitpos >= 0; bitpos--) {\r\n        bit = (codebits >> bitpos) & 1;\r\n        if (rar_is_leaf_node(code, lastnode)) {\r\n            warn(\"Invalid data in bitstream\"); /* prefix found */\r\n            return false;\r\n        }\r\n        if (code->tree[lastnode].branches[bit] < 0) {\r\n            if (!rar_new_node(code))\r\n                return false;\r\n            code->tree[lastnode].branches[bit] = code->numentries - 1;\r\n        }\r\n        lastnode = code->tree[lastnode].branches[bit];\r\n    }\r\n\r\n    if (code->tree[lastnode].branches[0] != -1 || code->tree[lastnode].branches[1] != -2) {\r\n        warn(\"Invalid data in bitstream\"); /* prefix found */\r\n        return false;\r\n    }\r\n    code->tree[lastnode].branches[0] = code->tree[lastnode].branches[1] = value;\r\n    return true;\r\n}\r\n\r\nbool rar_create_code(struct huffman_code *code, uint8_t *lengths, int numsymbols)\r\n{\r\n    int symbolsleft = numsymbols;\r\n    int codebits = 0;\r\n    int i, j;\r\n\r\n    if (!rar_new_node(code))\r\n        return false;\r\n\r\n    for (i = 1; i <= 0x0F; i++) {\r\n        for (j = 0; j < numsymbols; j++) {\r\n            if (lengths[j] != i)\r\n                continue;\r\n            if (!rar_add_value(code, j, codebits, i))\r\n                return false;\r\n            if (--symbolsleft <= 0)\r\n                return true;\r\n            codebits++;\r\n        }\r\n        codebits <<= 1;\r\n    }\r\n    return true;\r\n}\r\n\r\nstatic bool rar_make_table_rec(struct huffman_code *code, int node, int offset, int depth, int maxdepth)\r\n{\r\n    int currtablesize = 1 << (maxdepth - depth);\r\n\r\n    if (node < 0 || code->numentries <= node) {\r\n        warn(\"Invalid data in bitstream\"); /* invalid location to Huffman tree specified */\r\n        return false;\r\n    }\r\n\r\n    if (rar_is_leaf_node(code, node)) {\r\n        int i;\r\n        for (i = 0; i < currtablesize; i++) {\r\n            code->table[offset + i].length = depth;\r\n            code->table[offset + i].value = code->tree[node].branches[0];\r\n        }\r\n    }\r\n    else if (depth == maxdepth) {\r\n        code->table[offset].length = maxdepth + 1;\r\n        code->table[offset].value = node;\r\n    }\r\n    else {\r\n        if (!rar_make_table_rec(code, code->tree[node].branches[0], offset, depth + 1, maxdepth))\r\n            return false;\r\n        if (!rar_make_table_rec(code, code->tree[node].branches[1], offset + currtablesize / 2, depth + 1, maxdepth))\r\n            return false;\r\n    }\r\n    return true;\r\n}\r\n\r\nbool rar_make_table(struct huffman_code *code)\r\n{\r\n    if (code->minlength <= code->maxlength && code->maxlength <= 10)\r\n        code->tablesize = code->maxlength;\r\n    else\r\n        code->tablesize = 10;\r\n\r\n    code->table = calloc(1ULL << code->tablesize, sizeof(*code->table));\r\n    if (!code->table) {\r\n        warn(\"OOM during decompression\");\r\n        return false;\r\n    }\r\n\r\n    return rar_make_table_rec(code, 0, 0, 0, code->tablesize);\r\n}\r\n\r\nvoid rar_free_code(struct huffman_code *code)\r\n{\r\n    free(code->tree);\r\n    free(code->table);\r\n    memset(code, 0, sizeof(*code));\r\n}\r\n"
  },
  {
    "path": "ext/unarr/rar/lzss.h",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n/* adapted from https://code.google.com/p/theunarchiver/source/browse/XADMaster/LZSS.h */\r\n\r\n#ifndef rar_lzss_h\r\n#define rar_lzss_h\r\n\r\n#include <stdlib.h>\r\n#include <stdint.h>\r\n#include <stdbool.h>\r\n#include <string.h>\r\n\r\n#if defined(_MSC_VER) && !defined(inline)\r\n#define inline __inline\r\n#endif\r\n\r\ntypedef struct {\r\n    uint8_t *window;\r\n    int mask;\r\n    int64_t position;\r\n} LZSS;\r\n\r\nstatic inline int64_t lzss_position(LZSS *self) { return self->position; }\r\n\r\nstatic inline int lzss_mask(LZSS *self) { return self->mask; }\r\n\r\nstatic inline int lzss_size(LZSS *self) { return self->mask + 1; }\r\n\r\nstatic inline uint8_t *lzss_window_pointer(LZSS *self) { return self->window; }\r\n\r\nstatic inline int lzss_offset_for_position(LZSS *self, int64_t pos) { return (int)(pos & self->mask); }\r\n\r\nstatic inline uint8_t *lzss_window_pointer_for_position(LZSS *self, int64_t pos) { return &self->window[lzss_offset_for_position(self, pos)]; }\r\n\r\nstatic inline int lzss_current_window_offset(LZSS *self) { return lzss_offset_for_position(self, self->position); }\r\n\r\nstatic inline uint8_t *lzss_current_window_pointer(LZSS *self) { return lzss_window_pointer_for_position(self, self->position); }\r\n\r\nstatic inline int64_t lzss_next_window_edge_after_position(LZSS *self, int64_t pos) { return (pos + lzss_size(self)) & ~(int64_t)lzss_mask(self); }\r\n\r\nstatic inline int64_t lzss_next_window_edge(LZSS *self) { return lzss_next_window_edge_after_position(self, self->position); }\r\n\r\nstatic inline uint8_t lzss_get_byte_from_window(LZSS *self, int64_t pos) { return *lzss_window_pointer_for_position(self, pos); }\r\n\r\nstatic inline void lzss_emit_literal(LZSS *self, uint8_t literal) {\r\n    /* self->window[(self->position & self->mask)] = literal; */\r\n    *lzss_current_window_pointer(self) = literal;\r\n    self->position++;\r\n}\r\n\r\nstatic inline void lzss_emit_match(LZSS *self, int offset, int length) {\r\n    int windowoffs = lzss_current_window_offset(self);\r\n    int i;\r\n    for (i = 0; i < length; i++) {\r\n        self->window[(windowoffs + i) & lzss_mask(self)] = self->window[(windowoffs + i - offset) & lzss_mask(self)];\r\n    }\r\n    self->position += length;\r\n}\r\n\r\nstatic inline void lzss_copy_bytes_from_window(LZSS *self, uint8_t *buffer, int64_t startpos, int length) {\r\n    int windowoffs = lzss_offset_for_position(self, startpos);\r\n    int firstpart = lzss_size(self) - windowoffs;\r\n    if (length <= firstpart) {\r\n        /* Request fits inside window */\r\n        memcpy(buffer, &self->window[windowoffs], length);\r\n    }\r\n    else {\r\n        /* Request wraps around window */\r\n        memcpy(buffer, &self->window[windowoffs], firstpart);\r\n        memcpy(buffer + firstpart, &self->window[0], length - firstpart);\r\n    }\r\n}\r\n\r\nstatic inline bool lzss_initialize(LZSS *self, int windowsize) {\r\n    self->window = malloc(windowsize);\r\n    if (!self->window)\r\n        return false;\r\n\r\n    self->mask = windowsize - 1; /* Assume windows are power-of-two sized! */\r\n    memset(self->window, 0, lzss_size(self));\r\n    self->position = 0;\r\n    return true;\r\n}\r\n\r\nstatic inline void lzss_cleanup(LZSS *self) { free(self->window); }\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/unarr/rar/parse-rar.c",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n/* adapted from https://code.google.com/p/theunarchiver/source/browse/XADMaster/XADRARParser.m */\r\n\r\n#include \"rar.h\"\r\n\r\nstatic inline uint8_t uint8le(unsigned char *data) { return data[0]; }\r\nstatic inline uint16_t uint16le(unsigned char *data) { return data[0] | data[1] << 8; }\r\nstatic inline uint32_t uint32le(unsigned char *data) { return data[0] | data[1] << 8 | data[2] << 16 | data[3] << 24; }\r\n\r\nbool rar_parse_header(ar_archive *ar, struct rar_header *header)\r\n{\r\n    unsigned char header_data[7];\r\n    size_t read = ar_read(ar->stream, header_data, sizeof(header_data));\r\n    if (read == 0) {\r\n        ar->at_eof = true;\r\n        return false;\r\n    }\r\n    if (read < sizeof(header_data))\r\n        return false;\r\n\r\n    header->crc = uint16le(header_data + 0);\r\n    header->type = uint8le(header_data + 2);\r\n    header->flags = uint16le(header_data + 3);\r\n    header->size = uint16le(header_data + 5);\r\n\r\n    header->datasize = 0;\r\n    if ((header->flags & LHD_LONG_BLOCK) || header->type == 0x74) {\r\n        unsigned char size_data[4];\r\n        if (!(header->flags & LHD_LONG_BLOCK))\r\n            log(\"File header without LHD_LONG_BLOCK set\");\r\n        read += ar_read(ar->stream, size_data, sizeof(size_data));\r\n        if (read < sizeof(header_data) + sizeof(size_data))\r\n            return false;\r\n        header->datasize = uint32le(size_data);\r\n    }\r\n\r\n    if (header->size < read) {\r\n        warn(\"Invalid header size %d\", header->size);\r\n        return false;\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nbool rar_check_header_crc(ar_archive *ar)\r\n{\r\n    unsigned char buffer[256];\r\n    uint16_t crc16, size;\r\n    uint32_t crc32;\r\n\r\n    if (!ar_seek(ar->stream, ar->entry_offset, SEEK_SET))\r\n        return false;\r\n    if (ar_read(ar->stream, buffer, 7) != 7)\r\n        return false;\r\n\r\n    crc16 = uint16le(buffer + 0);\r\n    size = uint16le(buffer + 5);\r\n    if (size < 7)\r\n        return false;\r\n    size -= 7;\r\n\r\n    crc32 = ar_crc32(0, buffer + 2, 5);\r\n    while (size > 0) {\r\n        if (ar_read(ar->stream, buffer, smin(size, sizeof(buffer))) != smin(size, sizeof(buffer)))\r\n            return false;\r\n        crc32 = ar_crc32(crc32, buffer, smin(size, sizeof(buffer)));\r\n        size -= (uint16_t)smin(size, sizeof(buffer));\r\n    }\r\n    return (crc32 & 0xFFFF) == crc16;\r\n}\r\n\r\nbool rar_parse_header_entry(ar_archive_rar *rar, struct rar_header *header, struct rar_entry *entry)\r\n{\r\n    unsigned char data[21];\r\n    if (ar_read(rar->super.stream, data, sizeof(data)) != sizeof(data))\r\n        return false;\r\n\r\n    entry->size = uint32le(data + 0);\r\n    entry->os = uint8le(data + 4);\r\n    entry->crc = uint32le(data + 5);\r\n    entry->dosdate = uint32le(data + 9);\r\n    entry->version = uint8le(data + 13);\r\n    entry->method = uint8le(data + 14);\r\n    entry->namelen = uint16le(data + 15);\r\n    entry->attrs = uint32le(data + 17);\r\n    if ((header->flags & LHD_LARGE)) {\r\n        unsigned char more_data[8];\r\n        if (ar_read(rar->super.stream, more_data, sizeof(more_data)) != sizeof(more_data))\r\n            return false;\r\n        header->datasize += (uint64_t)uint32le(more_data + 0);\r\n        entry->size += (uint64_t)uint32le(more_data + 4);\r\n    }\r\n    if (!ar_skip(rar->super.stream, entry->namelen))\r\n        return false;\r\n    if ((header->flags & LHD_SALT)) {\r\n        log(\"Skipping LHD_SALT\");\r\n        ar_skip(rar->super.stream, 8);\r\n    }\r\n\r\n    rar->entry.version = entry->version;\r\n    rar->entry.method = entry->method;\r\n    rar->entry.crc = entry->crc;\r\n    rar->entry.header_size = header->size;\r\n    rar->entry.solid = entry->version < 20 ? (rar->archive_flags & MHD_SOLID) : (header->flags & LHD_SOLID);\r\n    free(rar->entry.name);\r\n    rar->entry.name = NULL;\r\n\r\n    return true;\r\n}\r\n\r\n/* this seems to be what RAR considers \"Unicode\" */\r\nstatic char *rar_conv_unicode_to_utf8(const char *data, uint16_t len)\r\n{\r\n#define Check(cond) if (!(cond)) { free(str); return NULL; } else ((void)0)\r\n\r\n    uint8_t highbyte, flagbyte, flagbits, size, length, i;\r\n    const uint8_t *in = (uint8_t *)data + strlen(data) + 1;\r\n    const uint8_t *end_in = (uint8_t *)data + len;\r\n    char *str = calloc(len + 1, 3);\r\n    char *out = str;\r\n    char *end_out = str + len * 3;\r\n\r\n    if (!str)\r\n        return NULL;\r\n    if (end_in - in <= 1) {\r\n        memcpy(str, data, len);\r\n        return str;\r\n    }\r\n\r\n    highbyte = *in++;\r\n    flagbyte = 0;\r\n    flagbits = 0;\r\n    size = 0;\r\n\r\n    while (in < end_in && out < end_out) {\r\n        if (flagbits == 0) {\r\n            flagbyte = *in++;\r\n            flagbits = 8;\r\n        }\r\n        flagbits -= 2;\r\n        switch ((flagbyte >> flagbits) & 3) {\r\n        case 0:\r\n            Check(in + 1 <= end_in);\r\n            out += ar_conv_rune_to_utf8(*in++, out, end_out - out);\r\n            size++;\r\n            break;\r\n        case 1:\r\n            Check(in + 1 <= end_in);\r\n            out += ar_conv_rune_to_utf8(((uint16_t)highbyte << 8) | *in++, out, end_out - out);\r\n            size++;\r\n            break;\r\n        case 2:\r\n            Check(in + 2 <= end_in);\r\n            out += ar_conv_rune_to_utf8(((uint16_t)*(in + 1) << 8) | *in, out, end_out - out);\r\n            in += 2;\r\n            size++;\r\n            break;\r\n        case 3:\r\n            Check(in + 1 <= end_in);\r\n            length = *in++;\r\n            if ((length & 0x80)) {\r\n                uint8_t correction = *in++;\r\n                for (i = 0; i < (length & 0x7F) + 2; i++) {\r\n                    Check(size < len);\r\n                    out += ar_conv_rune_to_utf8(((uint16_t)highbyte << 8) | (data[size] + (correction & 0xFF)), out, end_out - out);\r\n                    size++;\r\n                }\r\n            }\r\n            else {\r\n                for (i = 0; i < (length & 0x7F) + 2; i++) {\r\n                    Check(size < len);\r\n                    out += ar_conv_rune_to_utf8(data[size], out, end_out - out);\r\n                    size++;\r\n                }\r\n            }\r\n            break;\r\n        }\r\n    }\r\n\r\n    return str;\r\n\r\n#undef Check\r\n}\r\n\r\nconst char *rar_get_name(ar_archive *ar)\r\n{\r\n    ar_archive_rar *rar = (ar_archive_rar *)ar;\r\n    if (!rar->entry.name) {\r\n        unsigned char data[21];\r\n        uint16_t namelen;\r\n        char *name;\r\n\r\n        struct rar_header header;\r\n        if (!ar_seek(ar->stream, ar->entry_offset, SEEK_SET))\r\n            return NULL;\r\n        if (!rar_parse_header(ar, &header))\r\n            return NULL;\r\n        if (ar_read(ar->stream, data, sizeof(data)) != sizeof(data))\r\n            return NULL;\r\n        if ((header.flags & LHD_LARGE) && !ar_skip(ar->stream, 8))\r\n            return NULL;\r\n\r\n        namelen = uint16le(data + 15);\r\n        name = malloc(namelen + 1);\r\n        if (!name || ar_read(ar->stream, name, namelen) != namelen) {\r\n            free(name);\r\n            return NULL;\r\n        }\r\n        name[namelen] = '\\0';\r\n\r\n        if (!(header.flags & LHD_UNICODE)) {\r\n            rar->entry.name = ar_conv_dos_to_utf8(name);\r\n            free(name);\r\n        }\r\n        else if (namelen == strlen(name)) {\r\n            rar->entry.name = name;\r\n        }\r\n        else {\r\n            rar->entry.name = rar_conv_unicode_to_utf8(name, namelen);\r\n            free(name);\r\n        }\r\n        /* normalize path separators */\r\n        if (rar->entry.name) {\r\n            char *p = rar->entry.name;\r\n            while ((p = strchr(p, '\\\\')) != NULL) {\r\n                *p = '/';\r\n            }\r\n        }\r\n\r\n        if (!ar_seek(ar->stream, ar->entry_offset + rar->entry.header_size, SEEK_SET))\r\n            warn(\"Couldn't seek back to the end of the entry header\");\r\n    }\r\n    return rar->entry.name;\r\n}\r\n"
  },
  {
    "path": "ext/unarr/rar/rar.c",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n#include \"rar.h\"\r\n\r\nstatic void rar_close(ar_archive *ar)\r\n{\r\n    ar_archive_rar *rar = (ar_archive_rar *)ar;\r\n    free(rar->entry.name);\r\n    rar_clear_uncompress(&rar->uncomp);\r\n}\r\n\r\nstatic bool rar_parse_entry(ar_archive *ar, off64_t offset)\r\n{\r\n    ar_archive_rar *rar = (ar_archive_rar *)ar;\r\n    struct rar_header header;\r\n    struct rar_entry entry;\r\n    bool out_of_order = offset != ar->entry_offset_next;\r\n\r\n    if (!ar_seek(ar->stream, offset, SEEK_SET)) {\r\n        warn(\"Couldn't seek to offset %\" PRIi64, offset);\r\n        return false;\r\n    }\r\n\r\n    for (;;) {\r\n        ar->entry_offset = ar_tell(ar->stream);\r\n        ar->entry_size_uncompressed = 0;\r\n\r\n        if (!rar_parse_header(ar, &header))\r\n            return false;\r\n\r\n        ar->entry_offset_next = ar->entry_offset + header.size + header.datasize;\r\n        if (ar->entry_offset_next < ar->entry_offset + header.size) {\r\n            warn(\"Integer overflow due to overly large data size\");\r\n            return false;\r\n        }\r\n\r\n        switch (header.type) {\r\n        case TYPE_MAIN_HEADER:\r\n            if ((header.flags & MHD_PASSWORD)) {\r\n                warn(\"Encrypted archives aren't supported\");\r\n                return false;\r\n            }\r\n            ar_skip(ar->stream, 6 /* reserved data */);\r\n            if ((header.flags & MHD_ENCRYPTVER)) {\r\n                log(\"MHD_ENCRYPTVER is set\");\r\n                ar_skip(ar->stream, 1);\r\n            }\r\n            if ((header.flags & MHD_COMMENT))\r\n                log(\"MHD_COMMENT is set\");\r\n            if (ar_tell(ar->stream) - ar->entry_offset > header.size) {\r\n                warn(\"Invalid RAR header size: %d\", header.size);\r\n                return false;\r\n            }\r\n            rar->archive_flags = header.flags;\r\n            break;\r\n\r\n        case TYPE_FILE_ENTRY:\r\n            if (!rar_parse_header_entry(rar, &header, &entry))\r\n                return false;\r\n            if ((header.flags & LHD_PASSWORD))\r\n                warn(\"Encrypted entries will fail to uncompress\");\r\n            if ((header.flags & LHD_DIRECTORY) == LHD_DIRECTORY) {\r\n                if (header.datasize == 0) {\r\n                    log(\"Skipping directory entry \\\"%s\\\"\", rar_get_name(ar));\r\n                    break;\r\n                }\r\n                warn(\"Can't skip directory entries containing data\");\r\n            }\r\n            if ((header.flags & (LHD_SPLIT_BEFORE | LHD_SPLIT_AFTER)))\r\n                warn(\"Splitting files isn't really supported\");\r\n            ar->entry_size_uncompressed = (size_t)entry.size;\r\n            ar->entry_filetime = ar_conv_dosdate_to_filetime(entry.dosdate);\r\n            if (!rar->entry.solid || rar->entry.method == METHOD_STORE || out_of_order) {\r\n                rar_clear_uncompress(&rar->uncomp);\r\n                memset(&rar->solid, 0, sizeof(rar->solid));\r\n            }\r\n            else {\r\n                br_clear_leftover_bits(&rar->uncomp);\r\n            }\r\n\r\n            rar->solid.restart = rar->entry.solid && (out_of_order || !rar->solid.part_done);\r\n            rar->solid.part_done = !ar->entry_size_uncompressed;\r\n            rar->progress.data_left = (size_t)header.datasize;\r\n            rar->progress.bytes_done = 0;\r\n            rar->progress.crc = 0;\r\n\r\n            /* TODO: CRC checks don't always hold (claim in XADRARParser.m @readBlockHeader) */\r\n            if (!rar_check_header_crc(ar))\r\n                warn(\"Invalid header checksum @%\" PRIi64, ar->entry_offset);\r\n            if (ar_tell(ar->stream) != ar->entry_offset + rar->entry.header_size) {\r\n                warn(\"Couldn't seek to offset %\" PRIi64, ar->entry_offset + rar->entry.header_size);\r\n                return false;\r\n            }\r\n            return true;\r\n\r\n        case TYPE_NEWSUB:\r\n            log(\"Skipping newsub header @%\" PRIi64, ar->entry_offset);\r\n            break;\r\n\r\n        case TYPE_END_OF_ARCHIVE:\r\n            ar->at_eof = true;\r\n            return false;\r\n\r\n        default:\r\n            log(\"Unknown RAR header type %02x\", header.type);\r\n            break;\r\n        }\r\n\r\n        /* TODO: CRC checks don't always hold (claim in XADRARParser.m @readBlockHeader) */\r\n        if (!rar_check_header_crc(ar))\r\n            warn(\"Invalid header checksum @%\" PRIi64, ar->entry_offset);\r\n        if (!ar_seek(ar->stream, ar->entry_offset_next, SEEK_SET)) {\r\n            warn(\"Couldn't seek to offset %\" PRIi64, ar->entry_offset_next);\r\n            return false;\r\n        }\r\n    }\r\n}\r\n\r\nstatic bool rar_copy_stored(ar_archive_rar *rar, void *buffer, size_t count)\r\n{\r\n    if (count > rar->progress.data_left) {\r\n        warn(\"Unexpected EOS in stored data\");\r\n        return false;\r\n    }\r\n    if (ar_read(rar->super.stream, buffer, count) != count) {\r\n        warn(\"Unexpected EOF in stored data\");\r\n        return false;\r\n    }\r\n    rar->progress.data_left -= count;\r\n    rar->progress.bytes_done += count;\r\n    return true;\r\n}\r\n\r\nstatic bool rar_restart_solid(ar_archive *ar)\r\n{\r\n    ar_archive_rar *rar = (ar_archive_rar *)ar;\r\n    off64_t current_offset = ar->entry_offset;\r\n    log(\"Restarting decompression for solid entry\");\r\n    if (!ar_parse_entry_at(ar, ar->entry_offset_first)) {\r\n        ar_parse_entry_at(ar, current_offset);\r\n        return false;\r\n    }\r\n    while (ar->entry_offset < current_offset) {\r\n        size_t size = ar->entry_size_uncompressed;\r\n        rar->solid.restart = false;\r\n        while (size > 0) {\r\n            unsigned char buffer[1024];\r\n            size_t count = smin(size, sizeof(buffer));\r\n            if (!ar_entry_uncompress(ar, buffer, count)) {\r\n                ar_parse_entry_at(ar, current_offset);\r\n                return false;\r\n            }\r\n            size -= count;\r\n        }\r\n        if (!ar_parse_entry(ar)) {\r\n            ar_parse_entry_at(ar, current_offset);\r\n            return false;\r\n        }\r\n    }\r\n    rar->solid.restart = false;\r\n    return true;\r\n}\r\n\r\nstatic bool rar_uncompress(ar_archive *ar, void *buffer, size_t count)\r\n{\r\n    ar_archive_rar *rar = (ar_archive_rar *)ar;\r\n    if (count > ar->entry_size_uncompressed - rar->progress.bytes_done) {\r\n        warn(\"Requesting too much data (%\" PRIuPTR \" < %\" PRIuPTR \")\", ar->entry_size_uncompressed - rar->progress.bytes_done, count);\r\n        return false;\r\n    }\r\n    if (rar->entry.method == METHOD_STORE) {\r\n        if (!rar_copy_stored(rar, buffer, count))\r\n            return false;\r\n    }\r\n    else if (rar->entry.method == METHOD_FASTEST || rar->entry.method == METHOD_FAST ||\r\n             rar->entry.method == METHOD_NORMAL || rar->entry.method == METHOD_GOOD ||\r\n             rar->entry.method == METHOD_BEST) {\r\n        if (rar->solid.restart && !rar_restart_solid(ar)) {\r\n            warn(\"Failed to produce the required solid decompression state\");\r\n            return false;\r\n        }\r\n        if (!rar_uncompress_part(rar, buffer, count))\r\n            return false;\r\n    }\r\n    else {\r\n        warn(\"Unknown compression method %#02x\", rar->entry.method);\r\n        return false;\r\n    }\r\n\r\n    rar->progress.crc = ar_crc32(rar->progress.crc, buffer, count);\r\n    if (rar->progress.bytes_done < ar->entry_size_uncompressed)\r\n        return true;\r\n    if (rar->progress.data_left)\r\n        log(\"Compressed block has more data than required\");\r\n    rar->solid.part_done = true;\r\n    rar->solid.size_total += rar->progress.bytes_done;\r\n    if (rar->progress.crc != rar->entry.crc) {\r\n        warn(\"Checksum of extracted data doesn't match\");\r\n        return false;\r\n    }\r\n    return true;\r\n}\r\n\r\nar_archive *ar_open_rar_archive(ar_stream *stream)\r\n{\r\n    char signature[FILE_SIGNATURE_SIZE];\r\n    if (!ar_seek(stream, 0, SEEK_SET))\r\n        return NULL;\r\n    if (ar_read(stream, signature, sizeof(signature)) != sizeof(signature))\r\n        return NULL;\r\n    if (memcmp(signature, \"Rar!\\x1A\\x07\\x00\", sizeof(signature)) != 0) {\r\n        if (memcmp(signature, \"Rar!\\x1A\\x07\\x01\", sizeof(signature)) == 0)\r\n            warn(\"RAR 5 format isn't supported\");\r\n        else if (memcmp(signature, \"RE~^\", 4) == 0)\r\n            warn(\"Ancient RAR format isn't supported\");\r\n        else if (memcmp(signature, \"MZ\", 2) == 0 || memcmp(signature, \"\\x7F\\x45LF\", 4) == 0)\r\n            warn(\"SFX archives aren't supported\");\r\n        return NULL;\r\n    }\r\n\r\n    return ar_open_archive(stream, sizeof(ar_archive_rar), rar_close, rar_parse_entry, rar_get_name, rar_uncompress, NULL, FILE_SIGNATURE_SIZE);\r\n}\r\n"
  },
  {
    "path": "ext/unarr/rar/rar.h",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n#ifndef rar_rar_h\r\n#define rar_rar_h\r\n\r\n#include \"../common/unarr-imp.h\"\r\n\r\n#include \"lzss.h\"\r\n#include \"../lzmasdk/Ppmd7.h\"\r\n#include <limits.h>\r\n\r\nstatic inline size_t smin(size_t a, size_t b) { return a < b ? a : b; }\r\n\r\ntypedef struct ar_archive_rar_s ar_archive_rar;\r\n\r\n/***** parse-rar *****/\r\n\r\n#define FILE_SIGNATURE_SIZE 7\r\n\r\nenum block_types {\r\n    TYPE_FILE_SIGNATURE = 0x72, TYPE_MAIN_HEADER = 0x73, TYPE_FILE_ENTRY = 0x74,\r\n    TYPE_NEWSUB = 0x7A, TYPE_END_OF_ARCHIVE = 0x7B,\r\n};\r\n\r\nenum archive_flags {\r\n    MHD_VOLUME = 1 << 0, MHD_COMMENT = 1 << 1, MHD_LOCK = 1 << 2,\r\n    MHD_SOLID = 1 << 3, MHD_PACK_COMMENT = 1 << 4, MHD_AV = 1 << 5,\r\n    MHD_PROTECT = 1 << 6, MHD_PASSWORD = 1 << 7, MHD_FIRSTVOLUME = 1 << 8,\r\n    MHD_ENCRYPTVER = 1 << 9,\r\n    MHD_LONG_BLOCK = 1 << 15,\r\n};\r\n\r\nenum entry_flags {\r\n    LHD_SPLIT_BEFORE = 1 << 0, LHD_SPLIT_AFTER = 1 << 1, LHD_PASSWORD = 1 << 2,\r\n    LHD_COMMENT = 1 << 3, LHD_SOLID = 1 << 4,\r\n    LHD_DIRECTORY = (1 << 5) | (1 << 6) | (1 << 7),\r\n    LHD_LARGE = 1 << 8, LHD_UNICODE = 1 << 9, LHD_SALT = 1 << 10,\r\n    LHD_VERSION = 1 << 11, LHD_EXTTIME = 1 << 12, LHD_EXTFLAGS = 1 << 13,\r\n    LHD_LONG_BLOCK = 1 << 15,\r\n};\r\n\r\nenum compression_method {\r\n    METHOD_STORE = 0x30,\r\n    METHOD_FASTEST = 0x31, METHOD_FAST = 0x32, METHOD_NORMAL = 0x33,\r\n    METHOD_GOOD = 0x34, METHOD_BEST = 0x35,\r\n};\r\n\r\nstruct rar_header {\r\n    uint16_t crc;\r\n    uint8_t type;\r\n    uint16_t flags;\r\n    uint16_t size;\r\n    uint64_t datasize;\r\n};\r\n\r\nstruct rar_entry {\r\n    uint64_t size;\r\n    uint8_t os;\r\n    uint32_t crc;\r\n    uint32_t dosdate;\r\n    uint8_t version;\r\n    uint8_t method;\r\n    uint16_t namelen;\r\n    uint32_t attrs;\r\n};\r\n\r\nstruct ar_archive_rar_entry {\r\n    uint8_t version;\r\n    uint8_t method;\r\n    uint32_t crc;\r\n    uint16_t header_size;\r\n    bool solid;\r\n    char *name;\r\n};\r\n\r\nbool rar_parse_header(ar_archive *ar, struct rar_header *header);\r\nbool rar_check_header_crc(ar_archive *ar);\r\nbool rar_parse_header_entry(ar_archive_rar *rar, struct rar_header *header, struct rar_entry *entry);\r\nconst char *rar_get_name(ar_archive *ar);\r\n\r\n/***** filter-rar *****/\r\n\r\nstruct RARVirtualMachine;\r\nstruct RARProgramCode;\r\nstruct RARFilter;\r\n\r\nstruct ar_archive_rar_filters {\r\n    struct RARVirtualMachine *vm;\r\n    struct RARProgramCode *progs;\r\n    struct RARFilter *stack;\r\n    size_t filterstart;\r\n    uint32_t lastfilternum;\r\n    size_t lastend;\r\n    uint8_t *bytes;\r\n    size_t bytes_ready;\r\n};\r\n\r\nbool rar_parse_filter(ar_archive_rar *rar, const uint8_t *bytes, uint16_t length, uint8_t flags);\r\nbool rar_run_filters(ar_archive_rar *rar);\r\nvoid rar_clear_filters(struct ar_archive_rar_filters *filters);\r\n\r\n/***** huffman-rar *****/\r\n\r\nstruct huffman_code {\r\n    struct {\r\n        int branches[2];\r\n    } *tree;\r\n    int numentries;\r\n    int capacity;\r\n    int minlength;\r\n    int maxlength;\r\n    struct {\r\n        int length;\r\n        int value;\r\n    } *table;\r\n    int tablesize;\r\n};\r\n\r\nbool rar_new_node(struct huffman_code *code);\r\nbool rar_add_value(struct huffman_code *code, int value, int codebits, int length);\r\nbool rar_create_code(struct huffman_code *code, uint8_t *lengths, int numsymbols);\r\nbool rar_make_table(struct huffman_code *code);\r\nvoid rar_free_code(struct huffman_code *code);\r\n\r\nstatic inline bool rar_is_leaf_node(struct huffman_code *code, int node) { return code->tree[node].branches[0] == code->tree[node].branches[1]; }\r\n\r\n/***** uncompress-rar *****/\r\n\r\n#define LZSS_WINDOW_SIZE   0x400000\r\n#define LZSS_OVERFLOW_SIZE 288\r\n\r\n#define MAINCODE_SIZE      299\r\n#define OFFSETCODE_SIZE    60\r\n#define LOWOFFSETCODE_SIZE 17\r\n#define LENGTHCODE_SIZE    28\r\n#define HUFFMAN_TABLE_SIZE MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE\r\n\r\nstruct ByteReader {\r\n    IByteIn super;\r\n    ar_archive_rar *rar;\r\n};\r\n\r\nstruct CPpmdRAR_RangeDec {\r\n    IPpmd7_RangeDec super;\r\n    UInt32 Range;\r\n    UInt32 Code;\r\n    UInt32 Low;\r\n    IByteIn *Stream;\r\n};\r\n\r\nstruct ar_archive_rar_uncomp_v3 {\r\n    struct huffman_code maincode;\r\n    struct huffman_code offsetcode;\r\n    struct huffman_code lowoffsetcode;\r\n    struct huffman_code lengthcode;\r\n    uint8_t lengthtable[HUFFMAN_TABLE_SIZE];\r\n    uint32_t lastlength;\r\n    uint32_t lastoffset;\r\n    uint32_t oldoffset[4];\r\n    uint32_t lastlowoffset;\r\n    uint32_t numlowoffsetrepeats;\r\n\r\n    bool is_ppmd_block;\r\n    int ppmd_escape;\r\n    CPpmd7 ppmd7_context;\r\n    struct CPpmdRAR_RangeDec range_dec;\r\n    struct ByteReader bytein;\r\n\r\n    struct ar_archive_rar_filters filters;\r\n};\r\n\r\n#define MAINCODE_SIZE_20        298\r\n#define OFFSETCODE_SIZE_20      48\r\n#define LENGTHCODE_SIZE_20      28\r\n#define HUFFMAN_TABLE_SIZE_20   4 * 257\r\n\r\nstruct AudioState {\r\n    int8_t weight[5];\r\n    int16_t delta[4];\r\n    int8_t lastdelta;\r\n    int error[11];\r\n    int count;\r\n    uint8_t lastbyte;\r\n};\r\n\r\nstruct ar_archive_rar_uncomp_v2 {\r\n    struct huffman_code maincode;\r\n    struct huffman_code offsetcode;\r\n    struct huffman_code lengthcode;\r\n    struct huffman_code audiocode[4];\r\n    uint8_t lengthtable[HUFFMAN_TABLE_SIZE_20];\r\n    uint32_t lastoffset;\r\n    uint32_t lastlength;\r\n    uint32_t oldoffset[4];\r\n    uint32_t oldoffsetindex;\r\n\r\n    bool audioblock;\r\n    uint8_t channel;\r\n    uint8_t numchannels;\r\n    struct AudioState audiostate[4];\r\n    int8_t channeldelta;\r\n};\r\n\r\nstruct ar_archive_rar_uncomp {\r\n    uint8_t version;\r\n\r\n    LZSS lzss;\r\n    size_t bytes_ready;\r\n    bool start_new_table;\r\n\r\n    union {\r\n        struct ar_archive_rar_uncomp_v3 v3;\r\n        struct ar_archive_rar_uncomp_v2 v2;\r\n    } state;\r\n\r\n    struct StreamBitReader {\r\n        uint64_t bits;\r\n        int available;\r\n        bool at_eof;\r\n    } br;\r\n};\r\n\r\nbool rar_uncompress_part(ar_archive_rar *rar, void *buffer, size_t buffer_size);\r\nint64_t rar_expand(ar_archive_rar *rar, int64_t end);\r\nvoid rar_clear_uncompress(struct ar_archive_rar_uncomp *uncomp);\r\nstatic inline void br_clear_leftover_bits(struct ar_archive_rar_uncomp *uncomp) { uncomp->br.available &= ~0x07; }\r\n\r\n/***** rar *****/\r\n\r\nstruct ar_archive_rar_progress {\r\n    size_t data_left;\r\n    size_t bytes_done;\r\n    uint32_t crc;\r\n};\r\n\r\nstruct ar_archive_rar_solid {\r\n    size_t size_total;\r\n    bool part_done;\r\n    bool restart;\r\n};\r\n\r\nstruct ar_archive_rar_s {\r\n    ar_archive super;\r\n    uint16_t archive_flags;\r\n    struct ar_archive_rar_entry entry;\r\n    struct ar_archive_rar_uncomp uncomp;\r\n    struct ar_archive_rar_progress progress;\r\n    struct ar_archive_rar_solid solid;\r\n};\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/unarr/rar/rarvm.c",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n/* adapted from https://code.google.com/p/theunarchiver/source/browse/XADMaster/RARVirtualMachine.c */\r\n\r\n#include \"rarvm.h\"\r\n#include \"../common/allocator.h\"\r\n\r\n#include <stdlib.h>\r\n#include <string.h>\r\n\r\ntypedef struct RAROpcode_s RAROpcode;\r\n\r\nstruct RAROpcode_s {\r\n    uint8_t instruction;\r\n    uint8_t bytemode;\r\n    uint8_t addressingmode1;\r\n    uint8_t addressingmode2;\r\n    uint32_t value1;\r\n    uint32_t value2;\r\n};\r\n\r\nstruct RARProgram_s {\r\n    RAROpcode *opcodes;\r\n    uint32_t length;\r\n    uint32_t capacity;\r\n};\r\n\r\n/* Program building */\r\n\r\nRARProgram *RARCreateProgram()\r\n{\r\n    return calloc(1, sizeof(RARProgram));\r\n}\r\n\r\nvoid RARDeleteProgram(RARProgram *prog)\r\n{\r\n    if (prog)\r\n        free(prog->opcodes);\r\n    free(prog);\r\n}\r\n\r\nbool RARProgramAddInstr(RARProgram *prog, uint8_t instruction, bool bytemode)\r\n{\r\n    if (instruction >= RARNumberOfInstructions)\r\n        return false;\r\n    if (bytemode && !RARInstructionHasByteMode(instruction))\r\n        return false;\r\n    if (prog->length + 1 >= prog->capacity) {\r\n        /* in my small file sample, 16 is the value needed most often */\r\n        uint32_t newCapacity = prog->capacity ? prog->capacity * 4 : 32;\r\n        RAROpcode *newCodes = calloc(newCapacity, sizeof(*prog->opcodes));\r\n        if (!newCodes)\r\n            return false;\r\n        memcpy(newCodes, prog->opcodes, prog->capacity * sizeof(*prog->opcodes));\r\n        free(prog->opcodes);\r\n        prog->opcodes = newCodes;\r\n        prog->capacity = newCapacity;\r\n    }\r\n    memset(&prog->opcodes[prog->length], 0, sizeof(prog->opcodes[prog->length]));\r\n    prog->opcodes[prog->length].instruction = instruction;\r\n    if (instruction == RARMovzxInstruction || instruction == RARMovsxInstruction)\r\n        prog->opcodes[prog->length].bytemode = 2; /* second argument only */\r\n    else if (bytemode)\r\n        prog->opcodes[prog->length].bytemode = (1 | 2);\r\n    else\r\n        prog->opcodes[prog->length].bytemode = 0;\r\n    prog->length++;\r\n    return true;\r\n}\r\n\r\nbool RARSetLastInstrOperands(RARProgram *prog, uint8_t addressingmode1, uint32_t value1, uint8_t addressingmode2, uint32_t value2)\r\n{\r\n    RAROpcode *opcode = &prog->opcodes[prog->length - 1];\r\n    int numoperands;\r\n\r\n    if (addressingmode1 >= RARNumberOfAddressingModes || addressingmode2 >= RARNumberOfAddressingModes)\r\n        return false;\r\n    if (!prog->length || opcode->addressingmode1 || opcode->value1 || opcode->addressingmode2 || opcode->value2)\r\n        return false;\r\n\r\n    numoperands = NumberOfRARInstructionOperands(opcode->instruction);\r\n    if (numoperands == 0)\r\n        return true;\r\n\r\n    if (addressingmode1 == RARImmediateAddressingMode && RARInstructionWritesFirstOperand(opcode->instruction))\r\n        return false;\r\n    opcode->addressingmode1 = addressingmode1;\r\n    opcode->value1 = value1;\r\n\r\n    if (numoperands == 2) {\r\n        if (addressingmode2 == RARImmediateAddressingMode && RARInstructionWritesSecondOperand(opcode->instruction))\r\n            return false;\r\n        opcode->addressingmode2 = addressingmode2;\r\n        opcode->value2 = value2;\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nbool RARIsProgramTerminated(RARProgram *prog)\r\n{\r\n    return prog->length > 0 && RARInstructionIsUnconditionalJump(prog->opcodes[prog->length - 1].instruction);\r\n}\r\n\r\n/* Execution */\r\n\r\n#define EXTMACRO_BEGIN do {\r\n#ifdef _MSC_VER\r\n#define EXTMACRO_END } __pragma(warning(push)) __pragma(warning(disable:4127)) while (0) __pragma(warning(pop))\r\n#else\r\n#define EXTMACRO_END } while (0)\r\n#endif\r\n\r\n#define CarryFlag 1\r\n#define ZeroFlag 2\r\n#define SignFlag 0x80000000\r\n\r\n#define SignExtend(a) ((uint32_t)((int8_t)(a)))\r\n\r\nstatic uint32_t _RARGetOperand(RARVirtualMachine *vm, uint8_t addressingmode, uint32_t value, bool bytemode);\r\nstatic void _RARSetOperand(RARVirtualMachine *vm, uint8_t addressingmode, uint32_t value, bool bytemode, uint32_t data);\r\n\r\n#define GetOperand1() _RARGetOperand(vm, opcode->addressingmode1, opcode->value1, opcode->bytemode & 1)\r\n#define GetOperand2() _RARGetOperand(vm, opcode->addressingmode2, opcode->value2, opcode->bytemode & 2)\r\n#define SetOperand1(data) _RARSetOperand(vm, opcode->addressingmode1, opcode->value1, opcode->bytemode & 1, data)\r\n#define SetOperand2(data) _RARSetOperand(vm, opcode->addressingmode2, opcode->value2, opcode->bytemode & 2, data)\r\n\r\n#define SetFlagsWithCarry(res, carry) EXTMACRO_BEGIN uint32_t result = (res); flags = (result == 0 ? ZeroFlag : (result & SignFlag)) | ((carry) ? CarryFlag : 0); EXTMACRO_END\r\n#define SetByteFlagsWithCarry(res, carry) EXTMACRO_BEGIN uint8_t result = (res); flags = (result == 0 ? ZeroFlag : (SignExtend(result) & SignFlag)) | ((carry) ? CarryFlag : 0); EXTMACRO_END\r\n#define SetFlags(res) SetFlagsWithCarry(res, 0)\r\n\r\n#define SetOperand1AndFlagsWithCarry(res, carry) EXTMACRO_BEGIN uint32_t r = (res); SetFlagsWithCarry(r, carry); SetOperand1(r); EXTMACRO_END\r\n#define SetOperand1AndByteFlagsWithCarry(res, carry) EXTMACRO_BEGIN uint8_t r = (res); SetByteFlagsWithCarry(r, carry); SetOperand1(r); EXTMACRO_END\r\n#define SetOperand1AndFlags(res) EXTMACRO_BEGIN uint32_t r = (res); SetFlags(r); SetOperand1(r); EXTMACRO_END\r\n\r\n#define NextInstruction() { opcode++; continue; }\r\n#define Jump(offs) { uint32_t o = (offs); if (o >= prog->length) return false; opcode = &prog->opcodes[o]; continue; }\r\n\r\nbool RARExecuteProgram(RARVirtualMachine *vm, RARProgram *prog)\r\n{\r\n    RAROpcode *opcode = prog->opcodes;\r\n    uint32_t flags = 0;\r\n    uint32_t op1, op2, carry, i;\r\n    uint32_t counter = 0;\r\n\r\n    if (!RARIsProgramTerminated(prog))\r\n        return false;\r\n\r\n    while ((uint32_t)(opcode - prog->opcodes) < prog->length && counter++ < RARRuntimeMaxInstructions) {\r\n        switch (opcode->instruction) {\r\n        case RARMovInstruction:\r\n            SetOperand1(GetOperand2());\r\n            NextInstruction();\r\n\r\n        case RARCmpInstruction:\r\n            op1 = GetOperand1();\r\n            SetFlagsWithCarry(op1 - GetOperand2(), result > op1);\r\n            NextInstruction();\r\n\r\n        case RARAddInstruction:\r\n            op1 = GetOperand1();\r\n            if (opcode->bytemode)\r\n                SetOperand1AndByteFlagsWithCarry((op1 + GetOperand2()) & 0xFF, result < op1);\r\n            else\r\n                SetOperand1AndFlagsWithCarry(op1 + GetOperand2(), result < op1);\r\n            NextInstruction();\r\n\r\n        case RARSubInstruction:\r\n            op1 = GetOperand1();\r\n#if 0 /* apparently not correctly implemented in the RAR VM */\r\n            if (opcode->bytemode)\r\n                SetOperand1AndByteFlagsWithCarry((op1 - GetOperand2()) & 0xFF, result > op1);\r\n            else\r\n#endif\r\n            SetOperand1AndFlagsWithCarry(op1 - GetOperand2(), result > op1);\r\n            NextInstruction();\r\n\r\n        case RARJzInstruction:\r\n            if ((flags & ZeroFlag))\r\n                Jump(GetOperand1());\r\n            NextInstruction();\r\n\r\n        case RARJnzInstruction:\r\n            if (!(flags & ZeroFlag))\r\n                Jump(GetOperand1());\r\n            NextInstruction();\r\n\r\n        case RARIncInstruction:\r\n            if (opcode->bytemode)\r\n                SetOperand1AndFlags((GetOperand1() + 1) & 0xFF);\r\n            else\r\n                SetOperand1AndFlags(GetOperand1() + 1);\r\n            NextInstruction();\r\n\r\n        case RARDecInstruction:\r\n            if (opcode->bytemode)\r\n                SetOperand1AndFlags((GetOperand1() - 1) & 0xFF);\r\n            else\r\n                SetOperand1AndFlags(GetOperand1() - 1);\r\n            NextInstruction();\r\n\r\n        case RARJmpInstruction:\r\n            Jump(GetOperand1());\r\n\r\n        case RARXorInstruction:\r\n            SetOperand1AndFlags(GetOperand1() ^ GetOperand2());\r\n            NextInstruction();\r\n\r\n        case RARAndInstruction:\r\n            SetOperand1AndFlags(GetOperand1() & GetOperand2());\r\n            NextInstruction();\r\n\r\n        case RAROrInstruction:\r\n            SetOperand1AndFlags(GetOperand1() | GetOperand2());\r\n            NextInstruction();\r\n\r\n        case RARTestInstruction:\r\n            SetFlags(GetOperand1() & GetOperand2());\r\n            NextInstruction();\r\n\r\n        case RARJsInstruction:\r\n            if ((flags & SignFlag))\r\n                Jump(GetOperand1());\r\n            NextInstruction();\r\n\r\n        case RARJnsInstruction:\r\n            if (!(flags & SignFlag))\r\n                Jump(GetOperand1());\r\n            NextInstruction();\r\n\r\n        case RARJbInstruction:\r\n            if ((flags & CarryFlag))\r\n                Jump(GetOperand1());\r\n            NextInstruction();\r\n\r\n        case RARJbeInstruction:\r\n            if ((flags & (CarryFlag | ZeroFlag)))\r\n                Jump(GetOperand1());\r\n            NextInstruction();\r\n\r\n        case RARJaInstruction:\r\n            if (!(flags & (CarryFlag | ZeroFlag)))\r\n                Jump(GetOperand1());\r\n            NextInstruction();\r\n\r\n        case RARJaeInstruction:\r\n            if (!(flags & CarryFlag))\r\n                Jump(GetOperand1());\r\n            NextInstruction();\r\n\r\n        case RARPushInstruction:\r\n            vm->registers[7] -= 4;\r\n            RARVirtualMachineWrite32(vm, vm->registers[7], GetOperand1());\r\n            NextInstruction();\r\n\r\n        case RARPopInstruction:\r\n            SetOperand1(RARVirtualMachineRead32(vm, vm->registers[7]));\r\n            vm->registers[7] += 4;\r\n            NextInstruction();\r\n\r\n        case RARCallInstruction:\r\n            vm->registers[7] -= 4;\r\n            RARVirtualMachineWrite32(vm, vm->registers[7], (uint32_t)(opcode - prog->opcodes + 1));\r\n            Jump(GetOperand1());\r\n\r\n        case RARRetInstruction:\r\n            if (vm->registers[7] >= RARProgramMemorySize)\r\n                return true;\r\n            i = RARVirtualMachineRead32(vm, vm->registers[7]);\r\n            vm->registers[7] += 4;\r\n            Jump(i);\r\n\r\n        case RARNotInstruction:\r\n            SetOperand1(~GetOperand1());\r\n            NextInstruction();\r\n\r\n        case RARShlInstruction:\r\n            op1 = GetOperand1();\r\n            op2 = GetOperand2();\r\n            SetOperand1AndFlagsWithCarry(op1 << op2, ((op1 << (op2 - 1)) & 0x80000000) != 0);\r\n            NextInstruction();\r\n\r\n        case RARShrInstruction:\r\n            op1 = GetOperand1();\r\n            op2 = GetOperand2();\r\n            SetOperand1AndFlagsWithCarry(op1 >> op2, ((op1 >> (op2 - 1)) & 1) != 0);\r\n            NextInstruction();\r\n\r\n        case RARSarInstruction:\r\n            op1 = GetOperand1();\r\n            op2 = GetOperand2();\r\n            SetOperand1AndFlagsWithCarry(((int32_t)op1) >> op2, ((op1 >> (op2 - 1)) & 1) != 0);\r\n            NextInstruction();\r\n\r\n        case RARNegInstruction:\r\n            SetOperand1AndFlagsWithCarry(-(int32_t)GetOperand1(), result != 0);\r\n            NextInstruction();\r\n\r\n        case RARPushaInstruction:\r\n            vm->registers[7] -= 32;\r\n            for (i = 0; i < 8; i++)\r\n                RARVirtualMachineWrite32(vm, vm->registers[7] + (7 - i) * 4, vm->registers[i]);\r\n            NextInstruction();\r\n\r\n        case RARPopaInstruction:\r\n            for (i = 0; i < 8; i++)\r\n                vm->registers[i] = RARVirtualMachineRead32(vm, vm->registers[7] + (7 - i) * 4);\r\n            vm->registers[7] += 32;\r\n            NextInstruction();\r\n\r\n        case RARPushfInstruction:\r\n            vm->registers[7] -= 4;\r\n            RARVirtualMachineWrite32(vm, vm->registers[7], flags);\r\n            NextInstruction();\r\n\r\n        case RARPopfInstruction:\r\n            flags = RARVirtualMachineRead32(vm, vm->registers[7]);\r\n            vm->registers[7] += 4;\r\n            NextInstruction();\r\n\r\n        case RARMovzxInstruction:\r\n            SetOperand1(GetOperand2());\r\n            NextInstruction();\r\n\r\n        case RARMovsxInstruction:\r\n            SetOperand1(SignExtend(GetOperand2()));\r\n            NextInstruction();\r\n\r\n        case RARXchgInstruction:\r\n            op1 = GetOperand1();\r\n            op2 = GetOperand2();\r\n            SetOperand1(op2);\r\n            SetOperand2(op1);\r\n            NextInstruction();\r\n\r\n        case RARMulInstruction:\r\n            SetOperand1(GetOperand1() * GetOperand2());\r\n            NextInstruction();\r\n\r\n        case RARDivInstruction:\r\n            op2 = GetOperand2();\r\n            if (op2 != 0)\r\n                SetOperand1(GetOperand1() / op2);\r\n            NextInstruction();\r\n\r\n        case RARAdcInstruction:\r\n            op1 = GetOperand1();\r\n            carry = (flags & CarryFlag);\r\n            if (opcode->bytemode)\r\n                SetOperand1AndFlagsWithCarry((op1 + GetOperand2() + carry) & 0xFF, result < op1 || (result == op1 && carry)); /* does not correctly set sign bit */\r\n            else\r\n                SetOperand1AndFlagsWithCarry(op1 + GetOperand2() + carry, result < op1 || (result == op1 && carry));\r\n            NextInstruction();\r\n\r\n        case RARSbbInstruction:\r\n            op1 = GetOperand1();\r\n            carry = (flags & CarryFlag);\r\n            if (opcode->bytemode)\r\n                SetOperand1AndFlagsWithCarry((op1 - GetOperand2() - carry) & 0xFF, result > op1 || (result == op1 && carry)); /* does not correctly set sign bit */\r\n            else\r\n                SetOperand1AndFlagsWithCarry(op1 - GetOperand2() - carry, result > op1 || (result == op1 && carry));\r\n            NextInstruction();\r\n\r\n        case RARPrintInstruction:\r\n            /* TODO: ??? */\r\n            NextInstruction();\r\n        }\r\n    }\r\n\r\n    return false;\r\n}\r\n\r\n/* Memory and register access */\r\n\r\nstatic uint32_t _RARRead32(const uint8_t *b)\r\n{\r\n    return ((uint32_t)b[3] << 24) | ((uint32_t)b[2] << 16) | ((uint32_t)b[1] << 8) | (uint32_t)b[0];\r\n}\r\n\r\nstatic void _RARWrite32(uint8_t *b, uint32_t n)\r\n{\r\n    b[3] = (n >> 24) & 0xFF;\r\n    b[2] = (n >> 16) & 0xFF;\r\n    b[1] = (n >> 8) & 0xFF;\r\n    b[0] = n & 0xFF;\r\n}\r\n\r\nvoid RARSetVirtualMachineRegisters(RARVirtualMachine *vm, uint32_t registers[8])\r\n{\r\n    if (registers)\r\n        memcpy(vm->registers, registers, sizeof(vm->registers));\r\n    else\r\n        memset(vm->registers, 0, sizeof(vm->registers));\r\n}\r\n\r\nuint32_t RARVirtualMachineRead32(RARVirtualMachine *vm, uint32_t address)\r\n{\r\n    return _RARRead32(&vm->memory[address & RARProgramMemoryMask]);\r\n}\r\n\r\nvoid RARVirtualMachineWrite32(RARVirtualMachine *vm, uint32_t address, uint32_t val)\r\n{\r\n    _RARWrite32(&vm->memory[address & RARProgramMemoryMask], val);\r\n}\r\n\r\nuint8_t RARVirtualMachineRead8(RARVirtualMachine *vm, uint32_t address)\r\n{\r\n    return vm->memory[address & RARProgramMemoryMask];\r\n}\r\n\r\nvoid RARVirtualMachineWrite8(RARVirtualMachine *vm, uint32_t address, uint8_t val)\r\n{\r\n    vm->memory[address & RARProgramMemoryMask] = val;\r\n}\r\n\r\nstatic uint32_t _RARGetOperand(RARVirtualMachine *vm, uint8_t addressingmode, uint32_t value, bool bytemode)\r\n{\r\n    if (RARRegisterAddressingMode(0) <= addressingmode && addressingmode <= RARRegisterAddressingMode(7)) {\r\n        uint32_t result = vm->registers[addressingmode % 8];\r\n        if (bytemode)\r\n            result = result & 0xFF;\r\n        return result;\r\n    }\r\n    if (RARRegisterIndirectAddressingMode(0) <= addressingmode && addressingmode <= RARRegisterIndirectAddressingMode(7)) {\r\n        if (bytemode)\r\n            return RARVirtualMachineRead8(vm, vm->registers[addressingmode % 8]);\r\n        return RARVirtualMachineRead32(vm, vm->registers[addressingmode % 8]);\r\n    }\r\n    if (RARIndexedAbsoluteAddressingMode(0) <= addressingmode && addressingmode <= RARIndexedAbsoluteAddressingMode(7)) {\r\n        if (bytemode)\r\n            return RARVirtualMachineRead8(vm, value + vm->registers[addressingmode % 8]);\r\n        return RARVirtualMachineRead32(vm, value + vm->registers[addressingmode % 8]);\r\n    }\r\n    if (addressingmode == RARAbsoluteAddressingMode) {\r\n        if (bytemode)\r\n            return RARVirtualMachineRead8(vm, value);\r\n        return RARVirtualMachineRead32(vm, value);\r\n    }\r\n    /* if (addressingmode == RARImmediateAddressingMode) */\r\n    return value;\r\n}\r\n\r\nstatic void _RARSetOperand(RARVirtualMachine *vm, uint8_t addressingmode, uint32_t value, bool bytemode, uint32_t data)\r\n{\r\n    if (RARRegisterAddressingMode(0) <= addressingmode && addressingmode <= RARRegisterAddressingMode(7)) {\r\n        if (bytemode)\r\n            data = data & 0xFF;\r\n        vm->registers[addressingmode % 8] = data;\r\n    }\r\n    else if (RARRegisterIndirectAddressingMode(0) <= addressingmode && addressingmode <= RARRegisterIndirectAddressingMode(7)) {\r\n        if (bytemode)\r\n            RARVirtualMachineWrite8(vm, vm->registers[addressingmode % 8], (uint8_t)data);\r\n        else\r\n            RARVirtualMachineWrite32(vm, vm->registers[addressingmode % 8], data);\r\n    }\r\n    else if (RARIndexedAbsoluteAddressingMode(0) <= addressingmode && addressingmode <= RARIndexedAbsoluteAddressingMode(7)) {\r\n        if (bytemode)\r\n            RARVirtualMachineWrite8(vm, value + vm->registers[addressingmode % 8], (uint8_t)data);\r\n        else\r\n            RARVirtualMachineWrite32(vm, value + vm->registers[addressingmode % 8], data);\r\n    }\r\n    else if (addressingmode == RARAbsoluteAddressingMode) {\r\n        if (bytemode)\r\n            RARVirtualMachineWrite8(vm, value, (uint8_t)data);\r\n        else\r\n            RARVirtualMachineWrite32(vm, value, data);\r\n    }\r\n}\r\n\r\n/* Instruction properties */\r\n\r\n#define RAR0OperandsFlag 0\r\n#define RAR1OperandFlag 1\r\n#define RAR2OperandsFlag 2\r\n#define RAROperandsFlag 3\r\n#define RARHasByteModeFlag 4\r\n#define RARIsUnconditionalJumpFlag 8\r\n#define RARIsRelativeJumpFlag 16\r\n#define RARWritesFirstOperandFlag 32\r\n#define RARWritesSecondOperandFlag 64\r\n#define RARReadsStatusFlag 128\r\n#define RARWritesStatusFlag 256\r\n\r\nstatic const int InstructionFlags[RARNumberOfInstructions] = {\r\n    /*RARMovInstruction*/ RAR2OperandsFlag | RARHasByteModeFlag | RARWritesFirstOperandFlag,\r\n    /*RARCmpInstruction*/ RAR2OperandsFlag | RARHasByteModeFlag | RARWritesStatusFlag,\r\n    /*RARAddInstruction*/ RAR2OperandsFlag | RARHasByteModeFlag | RARWritesFirstOperandFlag | RARWritesStatusFlag,\r\n    /*RARSubInstruction*/ RAR2OperandsFlag | RARHasByteModeFlag | RARWritesFirstOperandFlag | RARWritesStatusFlag,\r\n    /*RARJzInstruction*/ RAR1OperandFlag | RARIsUnconditionalJumpFlag | RARIsRelativeJumpFlag | RARReadsStatusFlag,\r\n    /*RARJnzInstruction*/ RAR1OperandFlag | RARIsRelativeJumpFlag | RARReadsStatusFlag,\r\n    /*RARIncInstruction*/ RAR1OperandFlag | RARHasByteModeFlag | RARWritesFirstOperandFlag | RARWritesStatusFlag,\r\n    /*RARDecInstruction*/ RAR1OperandFlag | RARHasByteModeFlag | RARWritesFirstOperandFlag | RARWritesStatusFlag,\r\n    /*RARJmpInstruction*/ RAR1OperandFlag | RARIsRelativeJumpFlag,\r\n    /*RARXorInstruction*/ RAR2OperandsFlag | RARHasByteModeFlag | RARWritesFirstOperandFlag | RARWritesStatusFlag,\r\n    /*RARAndInstruction*/ RAR2OperandsFlag | RARHasByteModeFlag | RARWritesFirstOperandFlag | RARWritesStatusFlag,\r\n    /*RAROrInstruction*/ RAR2OperandsFlag | RARHasByteModeFlag | RARWritesFirstOperandFlag | RARWritesStatusFlag,\r\n    /*RARTestInstruction*/ RAR2OperandsFlag | RARHasByteModeFlag | RARWritesStatusFlag,\r\n    /*RARJsInstruction*/ RAR1OperandFlag | RARIsRelativeJumpFlag | RARReadsStatusFlag,\r\n    /*RARJnsInstruction*/ RAR1OperandFlag | RARIsRelativeJumpFlag | RARReadsStatusFlag,\r\n    /*RARJbInstruction*/ RAR1OperandFlag | RARIsRelativeJumpFlag | RARReadsStatusFlag,\r\n    /*RARJbeInstruction*/ RAR1OperandFlag | RARIsRelativeJumpFlag | RARReadsStatusFlag,\r\n    /*RARJaInstruction*/ RAR1OperandFlag | RARIsRelativeJumpFlag | RARReadsStatusFlag,\r\n    /*RARJaeInstruction*/ RAR1OperandFlag | RARIsRelativeJumpFlag | RARReadsStatusFlag,\r\n    /*RARPushInstruction*/ RAR1OperandFlag,\r\n    /*RARPopInstruction*/ RAR1OperandFlag,\r\n    /*RARCallInstruction*/ RAR1OperandFlag | RARIsRelativeJumpFlag,\r\n    /*RARRetInstruction*/ RAR0OperandsFlag | RARIsUnconditionalJumpFlag,\r\n    /*RARNotInstruction*/ RAR1OperandFlag | RARHasByteModeFlag | RARWritesFirstOperandFlag,\r\n    /*RARShlInstruction*/ RAR2OperandsFlag | RARHasByteModeFlag | RARWritesFirstOperandFlag | RARWritesStatusFlag,\r\n    /*RARShrInstruction*/ RAR2OperandsFlag | RARHasByteModeFlag | RARWritesFirstOperandFlag | RARWritesStatusFlag,\r\n    /*RARSarInstruction*/ RAR2OperandsFlag | RARHasByteModeFlag | RARWritesFirstOperandFlag | RARWritesStatusFlag,\r\n    /*RARNegInstruction*/ RAR1OperandFlag | RARHasByteModeFlag | RARWritesFirstOperandFlag | RARWritesStatusFlag,\r\n    /*RARPushaInstruction*/ RAR0OperandsFlag,\r\n    /*RARPopaInstruction*/ RAR0OperandsFlag,\r\n    /*RARPushfInstruction*/ RAR0OperandsFlag | RARReadsStatusFlag,\r\n    /*RARPopfInstruction*/ RAR0OperandsFlag | RARWritesStatusFlag,\r\n    /*RARMovzxInstruction*/ RAR2OperandsFlag | RARWritesFirstOperandFlag,\r\n    /*RARMovsxInstruction*/ RAR2OperandsFlag | RARWritesFirstOperandFlag,\r\n    /*RARXchgInstruction*/ RAR2OperandsFlag | RARWritesFirstOperandFlag | RARWritesSecondOperandFlag | RARHasByteModeFlag,\r\n    /*RARMulInstruction*/ RAR2OperandsFlag | RARHasByteModeFlag | RARWritesFirstOperandFlag,\r\n    /*RARDivInstruction*/ RAR2OperandsFlag | RARHasByteModeFlag | RARWritesFirstOperandFlag,\r\n    /*RARAdcInstruction*/ RAR2OperandsFlag | RARHasByteModeFlag | RARWritesFirstOperandFlag | RARReadsStatusFlag | RARWritesStatusFlag,\r\n    /*RARSbbInstruction*/ RAR2OperandsFlag | RARHasByteModeFlag | RARWritesFirstOperandFlag | RARReadsStatusFlag | RARWritesStatusFlag,\r\n    /*RARPrintInstruction*/ RAR0OperandsFlag\r\n};\r\n\r\nint NumberOfRARInstructionOperands(uint8_t instruction)\r\n{\r\n    if (instruction >= RARNumberOfInstructions)\r\n        return 0;\r\n    return InstructionFlags[instruction] & RAROperandsFlag;\r\n}\r\n\r\nbool RARInstructionHasByteMode(uint8_t instruction)\r\n{\r\n    if (instruction >= RARNumberOfInstructions)\r\n        return false;\r\n    return (InstructionFlags[instruction] & RARHasByteModeFlag)!=0;\r\n}\r\n\r\nbool RARInstructionIsUnconditionalJump(uint8_t instruction)\r\n{\r\n    if (instruction >= RARNumberOfInstructions)\r\n        return false;\r\n    return (InstructionFlags[instruction] & RARIsUnconditionalJumpFlag) != 0;\r\n}\r\n\r\nbool RARInstructionIsRelativeJump(uint8_t instruction)\r\n{\r\n    if (instruction >= RARNumberOfInstructions)\r\n        return false;\r\n    return (InstructionFlags[instruction] & RARIsRelativeJumpFlag) != 0;\r\n}\r\n\r\nbool RARInstructionWritesFirstOperand(uint8_t instruction)\r\n{\r\n    if (instruction >= RARNumberOfInstructions)\r\n        return false;\r\n    return (InstructionFlags[instruction] & RARWritesFirstOperandFlag) != 0;\r\n}\r\n\r\nbool RARInstructionWritesSecondOperand(uint8_t instruction)\r\n{\r\n    if (instruction >= RARNumberOfInstructions)\r\n        return false;\r\n    return (InstructionFlags[instruction] & RARWritesSecondOperandFlag) != 0;\r\n}\r\n\r\n/* Program debugging */\r\n\r\n#ifndef NDEBUG\r\n#include <stdio.h>\r\n\r\nstatic void RARPrintOperand(uint8_t addressingmode, uint32_t value)\r\n{\r\n    if (RARRegisterAddressingMode(0) <= addressingmode && addressingmode <= RARRegisterAddressingMode(7))\r\n        printf(\"r%d\", addressingmode % 8);\r\n    else if (RARRegisterIndirectAddressingMode(0) <= addressingmode && addressingmode <= RARRegisterIndirectAddressingMode(7))\r\n        printf(\"@(r%d)\", addressingmode % 8);\r\n    else if (RARIndexedAbsoluteAddressingMode(0) <= addressingmode && addressingmode <= RARIndexedAbsoluteAddressingMode(7))\r\n        printf(\"@(r%d+$%02x)\", addressingmode % 8, value);\r\n    else if (addressingmode == RARAbsoluteAddressingMode)\r\n        printf(\"@($%02x)\", value);\r\n    else if (addressingmode == RARImmediateAddressingMode)\r\n        printf(\"$%02x\", value);\r\n}\r\n\r\nvoid RARPrintProgram(RARProgram *prog)\r\n{\r\n    static const char *instructionNames[RARNumberOfInstructions] = {\r\n        \"Mov\", \"Cmp\", \"Add\", \"Sub\", \"Jz\", \"Jnz\", \"Inc\", \"Dec\", \"Jmp\", \"Xor\",\r\n        \"And\", \"Or\", \"Test\", \"Js\", \"Jns\", \"Jb\", \"Jbe\", \"Ja\", \"Jae\", \"Push\",\r\n        \"Pop\", \"Call\", \"Ret\", \"Not\", \"Shl\", \"Shr\", \"Sar\", \"Neg\", \"Pusha\", \"Popa\",\r\n        \"Pushf\", \"Popf\", \"Movzx\", \"Movsx\", \"Xchg\", \"Mul\", \"Div\", \"Adc\", \"Sbb\", \"Print\",\r\n    };\r\n\r\n    uint32_t i;\r\n    for (i = 0; i < prog->length; i++) {\r\n        RAROpcode *opcode = &prog->opcodes[i];\r\n        int numoperands = NumberOfRARInstructionOperands(opcode->instruction);\r\n        printf(\"  %02x: %s\", i, instructionNames[opcode->instruction]);\r\n        if (opcode->bytemode)\r\n            printf(\"B\");\r\n        if (numoperands >= 1) {\r\n            printf(\" \");\r\n            RARPrintOperand(opcode->addressingmode1, opcode->value1);\r\n        }\r\n        if (numoperands == 2) {\r\n            printf(\", \");\r\n            RARPrintOperand(opcode->addressingmode2, opcode->value2);\r\n        }\r\n        printf(\"\\n\");\r\n    }\r\n}\r\n#endif\r\n"
  },
  {
    "path": "ext/unarr/rar/rarvm.h",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n/* adapted from https://code.google.com/p/theunarchiver/source/browse/XADMaster/RARVirtualMachine.h */\r\n\r\n#ifndef rar_vm_h\r\n#define rar_vm_h\r\n\r\n#include <stdint.h>\r\n#include <stdbool.h>\r\n\r\n#define RARProgramMemorySize 0x40000\r\n#define RARProgramMemoryMask (RARProgramMemorySize - 1)\r\n#define RARProgramWorkSize 0x3c000\r\n#define RARProgramGlobalSize 0x2000\r\n#define RARProgramSystemGlobalAddress RARProgramWorkSize\r\n#define RARProgramSystemGlobalSize 64\r\n#define RARProgramUserGlobalAddress (RARProgramSystemGlobalAddress + RARProgramSystemGlobalSize)\r\n#define RARProgramUserGlobalSize (RARProgramGlobalSize - RARProgramSystemGlobalSize)\r\n#define RARRuntimeMaxInstructions 250000000\r\n\r\n#define RARRegisterAddressingMode(n) (0 + (n))\r\n#define RARRegisterIndirectAddressingMode(n) (8 + (n))\r\n#define RARIndexedAbsoluteAddressingMode(n) (16 + (n))\r\n#define RARAbsoluteAddressingMode 24\r\n#define RARImmediateAddressingMode 25\r\n#define RARNumberOfAddressingModes 26\r\n\r\ntypedef struct RARVirtualMachine RARVirtualMachine;\r\n\r\nstruct RARVirtualMachine {\r\n    uint32_t registers[8];\r\n    uint8_t memory[RARProgramMemorySize + sizeof(uint32_t) /* overflow sentinel */];\r\n};\r\n\r\ntypedef struct RARProgram_s RARProgram;\r\n\r\n/* Program building */\r\n\r\nenum {\r\n    RARMovInstruction = 0,\r\n    RARCmpInstruction = 1,\r\n    RARAddInstruction = 2,\r\n    RARSubInstruction = 3,\r\n    RARJzInstruction = 4,\r\n    RARJnzInstruction = 5,\r\n    RARIncInstruction = 6,\r\n    RARDecInstruction = 7,\r\n    RARJmpInstruction = 8,\r\n    RARXorInstruction = 9,\r\n    RARAndInstruction = 10,\r\n    RAROrInstruction = 11,\r\n    RARTestInstruction = 12,\r\n    RARJsInstruction = 13,\r\n    RARJnsInstruction = 14,\r\n    RARJbInstruction = 15,\r\n    RARJbeInstruction = 16,\r\n    RARJaInstruction = 17,\r\n    RARJaeInstruction = 18,\r\n    RARPushInstruction = 19,\r\n    RARPopInstruction = 20,\r\n    RARCallInstruction = 21,\r\n    RARRetInstruction = 22,\r\n    RARNotInstruction = 23,\r\n    RARShlInstruction = 24,\r\n    RARShrInstruction = 25,\r\n    RARSarInstruction = 26,\r\n    RARNegInstruction = 27,\r\n    RARPushaInstruction = 28,\r\n    RARPopaInstruction = 29,\r\n    RARPushfInstruction = 30,\r\n    RARPopfInstruction = 31,\r\n    RARMovzxInstruction = 32,\r\n    RARMovsxInstruction = 33,\r\n    RARXchgInstruction = 34,\r\n    RARMulInstruction = 35,\r\n    RARDivInstruction = 36,\r\n    RARAdcInstruction = 37,\r\n    RARSbbInstruction = 38,\r\n    RARPrintInstruction = 39,\r\n    RARNumberOfInstructions = 40,\r\n};\r\n\r\nRARProgram *RARCreateProgram();\r\nvoid RARDeleteProgram(RARProgram *prog);\r\nbool RARProgramAddInstr(RARProgram *prog, uint8_t instruction, bool bytemode);\r\nbool RARSetLastInstrOperands(RARProgram *prog, uint8_t addressingmode1, uint32_t value1, uint8_t addressingmode2, uint32_t value2);\r\nbool RARIsProgramTerminated(RARProgram *prog);\r\n\r\n/* Execution */\r\n\r\nbool RARExecuteProgram(RARVirtualMachine *vm, RARProgram *prog);\r\n\r\n/* Memory and register access (convenience) */\r\n\r\nvoid RARSetVirtualMachineRegisters(RARVirtualMachine *vm, uint32_t registers[8]);\r\nuint32_t RARVirtualMachineRead32(RARVirtualMachine *vm, uint32_t address);\r\nvoid RARVirtualMachineWrite32(RARVirtualMachine *vm, uint32_t address, uint32_t val);\r\nuint8_t RARVirtualMachineRead8(RARVirtualMachine *vm, uint32_t address);\r\nvoid RARVirtualMachineWrite8(RARVirtualMachine *vm, uint32_t address, uint8_t val);\r\n\r\n/* Instruction properties */\r\n\r\nint NumberOfRARInstructionOperands(uint8_t instruction);\r\nbool RARInstructionHasByteMode(uint8_t instruction);\r\nbool RARInstructionIsUnconditionalJump(uint8_t instruction);\r\nbool RARInstructionIsRelativeJump(uint8_t instruction);\r\nbool RARInstructionWritesFirstOperand(uint8_t instruction);\r\nbool RARInstructionWritesSecondOperand(uint8_t instruction);\r\n\r\n/* Program debugging */\r\n\r\n#ifndef NDEBUG\r\nvoid RARPrintProgram(RARProgram *prog);\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/unarr/rar/uncompress-rar.c",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n/* adapted from https://code.google.com/p/theunarchiver/source/browse/XADMaster/XADRAR30Handle.m */\r\n/* adapted from https://code.google.com/p/theunarchiver/source/browse/XADMaster/XADRAR20Handle.m */\r\n\r\n#include \"rar.h\"\r\n\r\nstatic void *gSzAlloc_Alloc(void *self, size_t size) { (void)self; return malloc(size); }\r\nstatic void gSzAlloc_Free(void *self, void *ptr) { (void)self; free(ptr); }\r\nstatic ISzAlloc gSzAlloc = { gSzAlloc_Alloc, gSzAlloc_Free };\r\n\r\nstatic bool br_fill(ar_archive_rar *rar, int bits)\r\n{\r\n    uint8_t bytes[8];\r\n    int count, i;\r\n    /* read as many bits as possible */\r\n    count = (64 - rar->uncomp.br.available) / 8;\r\n    if (rar->progress.data_left < (size_t)count)\r\n        count = (int)rar->progress.data_left;\r\n\r\n    if (bits > rar->uncomp.br.available + 8 * count || ar_read(rar->super.stream, bytes, count) != (size_t)count) {\r\n        if (!rar->uncomp.br.at_eof) {\r\n            warn(\"Unexpected EOF during decompression (truncated file?)\");\r\n            rar->uncomp.br.at_eof = true;\r\n        }\r\n        return false;\r\n    }\r\n    rar->progress.data_left -= count;\r\n    for (i = 0; i < count; i++) {\r\n        rar->uncomp.br.bits = (rar->uncomp.br.bits << 8) | bytes[i];\r\n    }\r\n    rar->uncomp.br.available += 8 * count;\r\n    return true;\r\n}\r\n\r\nstatic inline bool br_check(ar_archive_rar *rar, int bits)\r\n{\r\n    return bits <= rar->uncomp.br.available || br_fill(rar, bits);\r\n}\r\n\r\nstatic inline uint64_t br_bits(ar_archive_rar *rar, int bits)\r\n{\r\n    return (rar->uncomp.br.bits >> (rar->uncomp.br.available -= bits)) & (((uint64_t)1 << bits) - 1);\r\n}\r\n\r\nstatic Byte ByteIn_Read(void *p)\r\n{\r\n    struct ByteReader *self = p;\r\n    return br_check(self->rar, 8) ? (Byte)br_bits(self->rar, 8) : 0xFF;\r\n}\r\n\r\nstatic void ByteIn_CreateVTable(struct ByteReader *br, ar_archive_rar *rar)\r\n{\r\n    br->super.Read = ByteIn_Read;\r\n    br->rar = rar;\r\n}\r\n\r\n/* Ppmd7 range decoder differs between 7z and RAR */\r\nstatic void PpmdRAR_RangeDec_Init(struct CPpmdRAR_RangeDec *p)\r\n{\r\n    int i;\r\n    p->Code = 0;\r\n    p->Low = 0;\r\n    p->Range = 0xFFFFFFFF;\r\n    for (i = 0; i < 4; i++) {\r\n        p->Code = (p->Code << 8) | p->Stream->Read(p->Stream);\r\n    }\r\n}\r\n\r\nstatic UInt32 Range_GetThreshold(void *p, UInt32 total)\r\n{\r\n    struct CPpmdRAR_RangeDec *self = p;\r\n    return self->Code / (self->Range /= total);\r\n}\r\n\r\nstatic void Range_Decode_RAR(void *p, UInt32 start, UInt32 size)\r\n{\r\n    struct CPpmdRAR_RangeDec *self = p;\r\n    self->Low += start * self->Range;\r\n    self->Code -= start * self->Range;\r\n    self->Range *= size;\r\n    for (;;) {\r\n        if ((self->Low ^ (self->Low + self->Range)) >= (1 << 24)) {\r\n            if (self->Range >= (1 << 15))\r\n                break;\r\n            self->Range = ((uint32_t)(-(int32_t)self->Low)) & ((1 << 15) - 1);\r\n        }\r\n        self->Code = (self->Code << 8) | self->Stream->Read(self->Stream);\r\n        self->Range <<= 8;\r\n        self->Low <<= 8;\r\n    }\r\n}\r\n\r\nstatic UInt32 Range_DecodeBit_RAR(void *p, UInt32 size0)\r\n{\r\n    UInt32 value = Range_GetThreshold(p, PPMD_BIN_SCALE);\r\n    UInt32 bit = value < size0 ? 0 : 1;\r\n    if (!bit)\r\n        Range_Decode_RAR(p, 0, size0);\r\n    else\r\n        Range_Decode_RAR(p, size0, PPMD_BIN_SCALE - size0);\r\n    return bit;\r\n}\r\n\r\nstatic void PpmdRAR_RangeDec_CreateVTable(struct CPpmdRAR_RangeDec *p, IByteIn *stream)\r\n{\r\n    p->super.GetThreshold = Range_GetThreshold;\r\n    p->super.Decode = Range_Decode_RAR;\r\n    p->super.DecodeBit = Range_DecodeBit_RAR;\r\n    p->Stream = stream;\r\n}\r\n\r\nstatic bool rar_init_uncompress(struct ar_archive_rar_uncomp *uncomp, uint8_t version)\r\n{\r\n    /* per XADRARParser.m @handleForSolidStreamWithObject these versions are identical */\r\n    if (version == 29 || version == 36)\r\n        version = 3;\r\n    else if (version == 20 || version == 26)\r\n        version = 2;\r\n    else {\r\n        warn(\"Unsupported compression version: %d\", version);\r\n        return false;\r\n    }\r\n    if (uncomp->version) {\r\n        if (uncomp->version != version) {\r\n            warn(\"Compression version mismatch: %d != %d\", version, uncomp->version);\r\n            return false;\r\n        }\r\n        return true;\r\n    }\r\n    memset(uncomp, 0, sizeof(*uncomp));\r\n    uncomp->start_new_table = true;\r\n    if (!lzss_initialize(&uncomp->lzss, LZSS_WINDOW_SIZE)) {\r\n        warn(\"OOM during decompression\");\r\n        return false;\r\n    }\r\n    if (version == 3) {\r\n        uncomp->state.v3.ppmd_escape = 2;\r\n        uncomp->state.v3.filters.filterstart = SIZE_MAX;\r\n    }\r\n    uncomp->version = version;\r\n    return true;\r\n}\r\n\r\nstatic void rar_free_codes(struct ar_archive_rar_uncomp *uncomp);\r\n\r\nvoid rar_clear_uncompress(struct ar_archive_rar_uncomp *uncomp)\r\n{\r\n    if (!uncomp->version)\r\n        return;\r\n    rar_free_codes(uncomp);\r\n    lzss_cleanup(&uncomp->lzss);\r\n    if (uncomp->version == 3) {\r\n        Ppmd7_Free(&uncomp->state.v3.ppmd7_context, &gSzAlloc);\r\n        rar_clear_filters(&uncomp->state.v3.filters);\r\n    }\r\n    uncomp->version = 0;\r\n}\r\n\r\nstatic int rar_read_next_symbol(ar_archive_rar *rar, struct huffman_code *code)\r\n{\r\n    int node = 0;\r\n\r\n    if (!code->table && !rar_make_table(code))\r\n        return -1;\r\n\r\n    /* performance optimization */\r\n    if (code->tablesize <= rar->uncomp.br.available) {\r\n        uint16_t bits = (uint16_t)br_bits(rar, code->tablesize);\r\n        int length = code->table[bits].length;\r\n        int value = code->table[bits].value;\r\n\r\n        if (length < 0) {\r\n            warn(\"Invalid data in bitstream\"); /* invalid prefix code in bitstream */\r\n            return -1;\r\n        }\r\n        if (length <= code->tablesize) {\r\n            /* Skip only length bits */\r\n            rar->uncomp.br.available += code->tablesize - length;\r\n            return value;\r\n        }\r\n\r\n        node = value;\r\n    }\r\n\r\n    while (!rar_is_leaf_node(code, node)) {\r\n        uint8_t bit;\r\n        if (!br_check(rar, 1))\r\n            return -1;\r\n        bit = (uint8_t)br_bits(rar, 1);\r\n        if (code->tree[node].branches[bit] < 0) {\r\n            warn(\"Invalid data in bitstream\"); /* invalid prefix code in bitstream */\r\n            return -1;\r\n        }\r\n        node = code->tree[node].branches[bit];\r\n    }\r\n\r\n    return code->tree[node].branches[0];\r\n}\r\n\r\n/***** RAR version 2 decompression *****/\r\n\r\nstatic void rar_free_codes_v2(struct ar_archive_rar_uncomp_v2 *uncomp_v2)\r\n{\r\n    int i;\r\n    rar_free_code(&uncomp_v2->maincode);\r\n    rar_free_code(&uncomp_v2->offsetcode);\r\n    rar_free_code(&uncomp_v2->lengthcode);\r\n    for (i = 0; i < 4; i++)\r\n        rar_free_code(&uncomp_v2->audiocode[i]);\r\n}\r\n\r\nstatic bool rar_parse_codes_v2(ar_archive_rar *rar)\r\n{\r\n    struct ar_archive_rar_uncomp_v2 *uncomp_v2 = &rar->uncomp.state.v2;\r\n    struct huffman_code precode;\r\n    uint8_t prelengths[19];\r\n    uint16_t i, count;\r\n    int j, val, n;\r\n    bool ok = false;\r\n\r\n    rar_free_codes_v2(uncomp_v2);\r\n\r\n    if (!br_check(rar, 2))\r\n        return false;\r\n    uncomp_v2->audioblock = br_bits(rar, 1) != 0;\r\n    if (!br_bits(rar, 1))\r\n        memset(uncomp_v2->lengthtable, 0, sizeof(uncomp_v2->lengthtable));\r\n\r\n    if (uncomp_v2->audioblock) {\r\n        if (!br_check(rar, 2))\r\n            return false;\r\n        uncomp_v2->numchannels = (uint8_t)br_bits(rar, 2) + 1;\r\n        count = uncomp_v2->numchannels * 257;\r\n        if (uncomp_v2->channel > uncomp_v2->numchannels)\r\n            uncomp_v2->channel = 0;\r\n    }\r\n    else\r\n        count = MAINCODE_SIZE_20 + OFFSETCODE_SIZE_20 + LENGTHCODE_SIZE_20;\r\n\r\n    for (i = 0; i < 19; i++) {\r\n        if (!br_check(rar, 4))\r\n            return false;\r\n        prelengths[i] = (uint8_t)br_bits(rar, 4);\r\n    }\r\n\r\n    memset(&precode, 0, sizeof(precode));\r\n    if (!rar_create_code(&precode, prelengths, 19))\r\n        goto PrecodeError;\r\n    for (i = 0; i < count; ) {\r\n        val = rar_read_next_symbol(rar, &precode);\r\n        if (val < 0)\r\n            goto PrecodeError;\r\n        if (val < 16) {\r\n            uncomp_v2->lengthtable[i] = (uncomp_v2->lengthtable[i] + val) & 0x0F;\r\n            i++;\r\n        }\r\n        else if (val == 16) {\r\n            if (i == 0) {\r\n                warn(\"Invalid data in bitstream\");\r\n                goto PrecodeError;\r\n            }\r\n            if (!br_check(rar, 2))\r\n                goto PrecodeError;\r\n            n = (uint8_t)br_bits(rar, 2) + 3;\r\n            for (j = 0; j < n && i < count; i++, j++) {\r\n                uncomp_v2->lengthtable[i] = uncomp_v2->lengthtable[i - 1];\r\n            }\r\n        }\r\n        else {\r\n            if (val == 17) {\r\n                if (!br_check(rar, 3))\r\n                    goto PrecodeError;\r\n                n = (uint8_t)br_bits(rar, 3) + 3;\r\n            }\r\n            else {\r\n                if (!br_check(rar, 7))\r\n                    goto PrecodeError;\r\n                n = (uint8_t)br_bits(rar, 7) + 11;\r\n            }\r\n            for (j = 0; j < n && i < count; i++, j++) {\r\n                uncomp_v2->lengthtable[i] = 0;\r\n            }\r\n        }\r\n    }\r\n    ok = true;\r\nPrecodeError:\r\n    rar_free_code(&precode);\r\n    if (!ok)\r\n        return false;\r\n\r\n    if (uncomp_v2->audioblock) {\r\n        for (i = 0; i < uncomp_v2->numchannels; i++) {\r\n            if (!rar_create_code(&uncomp_v2->audiocode[i], uncomp_v2->lengthtable + i * 257, 257))\r\n                return false;\r\n        }\r\n    }\r\n    else {\r\n        if (!rar_create_code(&uncomp_v2->maincode, uncomp_v2->lengthtable, MAINCODE_SIZE_20))\r\n            return false;\r\n        if (!rar_create_code(&uncomp_v2->offsetcode, uncomp_v2->lengthtable + MAINCODE_SIZE_20, OFFSETCODE_SIZE_20))\r\n            return false;\r\n        if (!rar_create_code(&uncomp_v2->lengthcode, uncomp_v2->lengthtable + MAINCODE_SIZE_20 + OFFSETCODE_SIZE_20, LENGTHCODE_SIZE_20))\r\n            return false;\r\n    }\r\n\r\n    rar->uncomp.start_new_table = false;\r\n    return true;\r\n}\r\n\r\nstatic uint8_t rar_decode_audio(struct AudioState *state, int8_t *channeldelta, int8_t delta)\r\n{\r\n    uint8_t predbyte, byte;\r\n    int prederror;\r\n\r\n    state->delta[3] = state->delta[2];\r\n    state->delta[2] = state->delta[1];\r\n    state->delta[1] = state->lastdelta - state->delta[0];\r\n    state->delta[0] = state->lastdelta;\r\n\r\n    predbyte = ((8 * state->lastbyte + state->weight[0] * state->delta[0] + state->weight[1] * state->delta[1] + state->weight[2] * state->delta[2] + state->weight[3] * state->delta[3] + state->weight[4] * *channeldelta) >> 3) & 0xFF;\r\n    byte = (predbyte - delta) & 0xFF;\r\n\r\n    prederror = delta << 3;\r\n    state->error[0] += abs(prederror);\r\n    state->error[1] += abs(prederror - state->delta[0]); state->error[2] += abs(prederror + state->delta[0]);\r\n    state->error[3] += abs(prederror - state->delta[1]); state->error[4] += abs(prederror + state->delta[1]);\r\n    state->error[5] += abs(prederror - state->delta[2]); state->error[6] += abs(prederror + state->delta[2]);\r\n    state->error[7] += abs(prederror - state->delta[3]); state->error[8] += abs(prederror + state->delta[3]);\r\n    state->error[9] += abs(prederror - *channeldelta); state->error[10] += abs(prederror + *channeldelta);\r\n\r\n    *channeldelta = state->lastdelta = (int8_t)(byte - state->lastbyte);\r\n    state->lastbyte = byte;\r\n\r\n    if (!(++state->count & 0x1F)) {\r\n        uint8_t i, idx = 0;\r\n        for (i = 1; i < 11; i++) {\r\n            if (state->error[i] < state->error[idx])\r\n                idx = i;\r\n        }\r\n        memset(state->error, 0, sizeof(state->error));\r\n\r\n        switch (idx) {\r\n        case 1: if (state->weight[0] >= -16) state->weight[0]--; break;\r\n        case 2: if (state->weight[0] < 16) state->weight[0]++; break;\r\n        case 3: if (state->weight[1] >= -16) state->weight[1]--; break;\r\n        case 4: if (state->weight[1] < 16) state->weight[1]++; break;\r\n        case 5: if (state->weight[2] >= -16) state->weight[2]--; break;\r\n        case 6: if (state->weight[2] < 16) state->weight[2]++; break;\r\n        case 7: if (state->weight[3] >= -16) state->weight[3]--; break;\r\n        case 8: if (state->weight[3] < 16) state->weight[3]++; break;\r\n        case 9: if (state->weight[4] >= -16) state->weight[4]--; break;\r\n        case 10: if (state->weight[4] < 16) state->weight[4]++; break;\r\n        }\r\n    }\r\n\r\n    return byte;\r\n}\r\n\r\nint64_t rar_expand_v2(ar_archive_rar *rar, int64_t end)\r\n{\r\n    static const uint8_t lengthbases[] =\r\n        {   0,   1,   2,   3,   4,   5,   6,\r\n            7,   8,  10,  12,  14,  16,  20,\r\n           24,  28,  32,  40,  48,  56,  64,\r\n           80,  96, 112, 128, 160, 192, 224 };\r\n    static const uint8_t lengthbits[] =\r\n        { 0, 0, 0, 0, 0, 0, 0,\r\n          0, 1, 1, 1, 1, 2, 2,\r\n          2, 2, 3, 3, 3, 3, 4,\r\n          4, 4, 4, 5, 5, 5, 5 };\r\n    static const int32_t offsetbases[] =\r\n        {       0,       1,       2,       3,       4,       6,\r\n                8,      12,      16,      24,      32,      48,\r\n               64,      96,     128,     192,     256,     384,\r\n              512,     768,    1024,    1536,    2048,    3072,\r\n             4096,    6144,    8192,   12288,   16384,   24576,\r\n            32768,   49152,   65536,   98304,  131072,  196608,\r\n           262144,  327680,  393216,  458752,  524288,  589824,\r\n           655360,  720896,  786432,  851968,  917504,  983040 };\r\n    static const uint8_t offsetbits[] =\r\n        {  0,  0,  0,  0,  1,  1,  2,  2,  3,  3,  4,  4,\r\n           5,  5,  6,  6,  7,  7,  8,  8,  9,  9, 10, 10,\r\n          11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16,\r\n          16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 };\r\n    static const uint8_t shortbases[] =\r\n        { 0, 4, 8, 16, 32, 64, 128, 192 };\r\n    static const uint8_t shortbits[] =\r\n        { 2, 2, 3, 4, 5, 6, 6, 6 };\r\n\r\n    struct ar_archive_rar_uncomp_v2 *uncomp_v2 = &rar->uncomp.state.v2;\r\n    LZSS *lzss = &rar->uncomp.lzss;\r\n    int symbol, offs, len;\r\n\r\n    if ((uint64_t)end > rar->super.entry_size_uncompressed + rar->solid.size_total)\r\n        end = rar->super.entry_size_uncompressed + rar->solid.size_total;\r\n\r\n    for (;;) {\r\n        if (lzss_position(lzss) >= end)\r\n            return end;\r\n\r\n        if (uncomp_v2->audioblock) {\r\n            uint8_t byte;\r\n            symbol = rar_read_next_symbol(rar, &uncomp_v2->audiocode[uncomp_v2->channel]);\r\n            if (symbol < 0)\r\n                return -1;\r\n            if (symbol == 256) {\r\n                rar->uncomp.start_new_table = true;\r\n                return lzss_position(lzss);\r\n            }\r\n            byte = rar_decode_audio(&uncomp_v2->audiostate[uncomp_v2->channel], &uncomp_v2->channeldelta, (int8_t)(uint8_t)symbol);\r\n            uncomp_v2->channel++;\r\n            if (uncomp_v2->channel == uncomp_v2->numchannels)\r\n                uncomp_v2->channel = 0;\r\n            lzss_emit_literal(lzss, byte);\r\n            continue;\r\n        }\r\n\r\n        symbol = rar_read_next_symbol(rar, &uncomp_v2->maincode);\r\n        if (symbol < 0)\r\n            return -1;\r\n        if (symbol < 256) {\r\n            lzss_emit_literal(lzss, (uint8_t)symbol);\r\n            continue;\r\n        }\r\n        if (symbol == 256) {\r\n            offs = uncomp_v2->lastoffset;\r\n            len = uncomp_v2->lastlength;\r\n        }\r\n        else if (symbol <= 260) {\r\n            int idx = symbol - 256;\r\n            int lensymbol = rar_read_next_symbol(rar, &uncomp_v2->lengthcode);\r\n            offs = uncomp_v2->oldoffset[(uncomp_v2->oldoffsetindex - idx) & 0x03];\r\n            if (lensymbol < 0 || lensymbol > (int)(sizeof(lengthbases) / sizeof(lengthbases[0])) || lensymbol > (int)(sizeof(lengthbits) / sizeof(lengthbits[0]))) {\r\n                warn(\"Invalid data in bitstream\");\r\n                return -1;\r\n            }\r\n            len = lengthbases[lensymbol] + 2;\r\n            if (lengthbits[lensymbol] > 0) {\r\n                if (!br_check(rar, lengthbits[lensymbol]))\r\n                    return -1;\r\n                len += (uint8_t)br_bits(rar, lengthbits[lensymbol]);\r\n            }\r\n            if (offs >= 0x40000)\r\n                len++;\r\n            if (offs >= 0x2000)\r\n                len++;\r\n            if (offs >= 0x101)\r\n                len++;\r\n        }\r\n        else if (symbol <= 268) {\r\n            int idx = symbol - 261;\r\n            offs = shortbases[idx] + 1;\r\n            if (shortbits[idx] > 0) {\r\n                if (!br_check(rar, shortbits[idx]))\r\n                    return -1;\r\n                offs += (uint8_t)br_bits(rar, shortbits[idx]);\r\n            }\r\n            len = 2;\r\n        }\r\n        else if (symbol == 269) {\r\n            rar->uncomp.start_new_table = true;\r\n            return lzss_position(lzss);\r\n        }\r\n        else {\r\n            int idx = symbol - 270;\r\n            int offssymbol;\r\n            if (idx > (int)(sizeof(lengthbases) / sizeof(lengthbases[0])) || idx > (int)(sizeof(lengthbits) / sizeof(lengthbits[0]))) {\r\n                warn(\"Invalid data in bitstream\");\r\n                return -1;\r\n            }\r\n            len = lengthbases[idx] + 3;\r\n            if (lengthbits[idx] > 0) {\r\n                if (!br_check(rar, lengthbits[idx]))\r\n                    return -1;\r\n                len += (uint8_t)br_bits(rar, lengthbits[idx]);\r\n            }\r\n            offssymbol = rar_read_next_symbol(rar, &uncomp_v2->offsetcode);\r\n            if (offssymbol < 0 || offssymbol > (int)(sizeof(offsetbases) / sizeof(offsetbases[0])) || offssymbol > (int)(sizeof(offsetbits) / sizeof(offsetbits[0]))) {\r\n                warn(\"Invalid data in bitstream\");\r\n                return -1;\r\n            }\r\n            offs = offsetbases[offssymbol] + 1;\r\n            if (offsetbits[offssymbol] > 0) {\r\n                if (!br_check(rar, offsetbits[offssymbol]))\r\n                    return -1;\r\n                offs += (int)br_bits(rar, offsetbits[offssymbol]);\r\n            }\r\n            if (offs >= 0x40000)\r\n                len++;\r\n            if (offs >= 0x2000)\r\n                len++;\r\n        }\r\n\r\n        uncomp_v2->lastoffset = uncomp_v2->oldoffset[uncomp_v2->oldoffsetindex++ & 0x03] = offs;\r\n        uncomp_v2->lastlength = len;\r\n\r\n        lzss_emit_match(lzss, offs, len);\r\n    }\r\n}\r\n\r\n/***** RAR version 3 decompression *****/\r\n\r\nstatic void rar_free_codes(struct ar_archive_rar_uncomp *uncomp)\r\n{\r\n    struct ar_archive_rar_uncomp_v3 *uncomp_v3 = &uncomp->state.v3;\r\n\r\n    if (uncomp->version == 2) {\r\n        rar_free_codes_v2(&uncomp->state.v2);\r\n        return;\r\n    }\r\n\r\n    rar_free_code(&uncomp_v3->maincode);\r\n    rar_free_code(&uncomp_v3->offsetcode);\r\n    rar_free_code(&uncomp_v3->lowoffsetcode);\r\n    rar_free_code(&uncomp_v3->lengthcode);\r\n}\r\n\r\nstatic bool rar_parse_codes(ar_archive_rar *rar)\r\n{\r\n    struct ar_archive_rar_uncomp_v3 *uncomp_v3 = &rar->uncomp.state.v3;\r\n\r\n    if (rar->uncomp.version == 2)\r\n        return rar_parse_codes_v2(rar);\r\n\r\n    rar_free_codes(&rar->uncomp);\r\n\r\n    br_clear_leftover_bits(&rar->uncomp);\r\n\r\n    if (!br_check(rar, 1))\r\n        return false;\r\n    uncomp_v3->is_ppmd_block = br_bits(rar, 1) != 0;\r\n    if (uncomp_v3->is_ppmd_block) {\r\n        uint8_t ppmd_flags;\r\n        uint32_t max_alloc = 0;\r\n\r\n        if (!br_check(rar, 7))\r\n            return false;\r\n        ppmd_flags = (uint8_t)br_bits(rar, 7);\r\n        if ((ppmd_flags & 0x20)) {\r\n            if (!br_check(rar, 8))\r\n                return false;\r\n            max_alloc = ((uint8_t)br_bits(rar, 8) + 1) << 20;\r\n        }\r\n        if ((ppmd_flags & 0x40)) {\r\n            if (!br_check(rar, 8))\r\n                return false;\r\n            uncomp_v3->ppmd_escape = (uint8_t)br_bits(rar, 8);\r\n        }\r\n        if ((ppmd_flags & 0x20)) {\r\n            uint32_t maxorder = (ppmd_flags & 0x1F) + 1;\r\n            if (maxorder == 1)\r\n                return false;\r\n            if (maxorder > 16)\r\n                maxorder = 16 + (maxorder - 16) * 3;\r\n\r\n            Ppmd7_Free(&uncomp_v3->ppmd7_context, &gSzAlloc);\r\n            Ppmd7_Construct(&uncomp_v3->ppmd7_context);\r\n            if (!Ppmd7_Alloc(&uncomp_v3->ppmd7_context, max_alloc, &gSzAlloc)) {\r\n                warn(\"OOM during decompression\");\r\n                return false;\r\n            }\r\n            ByteIn_CreateVTable(&uncomp_v3->bytein, rar);\r\n            PpmdRAR_RangeDec_CreateVTable(&uncomp_v3->range_dec, &uncomp_v3->bytein.super);\r\n            PpmdRAR_RangeDec_Init(&uncomp_v3->range_dec);\r\n            Ppmd7_Init(&uncomp_v3->ppmd7_context, maxorder);\r\n        }\r\n        else {\r\n            if (!Ppmd7_WasAllocated(&uncomp_v3->ppmd7_context)) {\r\n                warn(\"Invalid data in bitstream\"); /* invalid PPMd sequence */\r\n                return false;\r\n            }\r\n            PpmdRAR_RangeDec_Init(&uncomp_v3->range_dec);\r\n        }\r\n    }\r\n    else {\r\n        struct huffman_code precode;\r\n        uint8_t bitlengths[20];\r\n        uint8_t zerocount;\r\n        int i, j, val, n;\r\n        bool ok = false;\r\n\r\n        if (!br_check(rar, 1))\r\n            return false;\r\n        if (!br_bits(rar, 1))\r\n            memset(uncomp_v3->lengthtable, 0, sizeof(uncomp_v3->lengthtable));\r\n        memset(&bitlengths, 0, sizeof(bitlengths));\r\n        for (i = 0; i < sizeof(bitlengths); i++) {\r\n            if (!br_check(rar, 4))\r\n                return false;\r\n            bitlengths[i] = (uint8_t)br_bits(rar, 4);\r\n            if (bitlengths[i] == 0x0F) {\r\n                if (!br_check(rar, 4))\r\n                    return false;\r\n                zerocount = (uint8_t)br_bits(rar, 4);\r\n                if (zerocount) {\r\n                    for (j = 0; j < zerocount + 2 && i < sizeof(bitlengths); j++) {\r\n                        bitlengths[i++] = 0;\r\n                    }\r\n                    i--;\r\n                }\r\n            }\r\n        }\r\n\r\n        memset(&precode, 0, sizeof(precode));\r\n        if (!rar_create_code(&precode, bitlengths, sizeof(bitlengths)))\r\n            goto PrecodeError;\r\n        for (i = 0; i < HUFFMAN_TABLE_SIZE; ) {\r\n            val = rar_read_next_symbol(rar, &precode);\r\n            if (val < 0)\r\n                goto PrecodeError;\r\n            if (val < 16) {\r\n                uncomp_v3->lengthtable[i] = (uncomp_v3->lengthtable[i] + val) & 0x0F;\r\n                i++;\r\n            }\r\n            else if (val < 18) {\r\n                if (i == 0) {\r\n                    warn(\"Invalid data in bitstream\");\r\n                    goto PrecodeError;\r\n                }\r\n                if (val == 16) {\r\n                    if (!br_check(rar, 3))\r\n                        goto PrecodeError;\r\n                    n = (uint8_t)br_bits(rar, 3) + 3;\r\n                }\r\n                else {\r\n                    if (!br_check(rar, 7))\r\n                        goto PrecodeError;\r\n                    n = (uint8_t)br_bits(rar, 7) + 11;\r\n                }\r\n                for (j = 0; j < n && i < HUFFMAN_TABLE_SIZE; i++, j++) {\r\n                    uncomp_v3->lengthtable[i] = uncomp_v3->lengthtable[i - 1];\r\n                }\r\n            }\r\n            else {\r\n                if (val == 18) {\r\n                    if (!br_check(rar, 3))\r\n                        goto PrecodeError;\r\n                    n = (uint8_t)br_bits(rar, 3) + 3;\r\n                }\r\n                else {\r\n                    if (!br_check(rar, 7))\r\n                        goto PrecodeError;\r\n                    n = (uint8_t)br_bits(rar, 7) + 11;\r\n                }\r\n                for (j = 0; j < n && i < HUFFMAN_TABLE_SIZE; i++, j++) {\r\n                    uncomp_v3->lengthtable[i] = 0;\r\n                }\r\n            }\r\n        }\r\n        ok = true;\r\nPrecodeError:\r\n        rar_free_code(&precode);\r\n        if (!ok)\r\n            return false;\r\n\r\n        if (!rar_create_code(&uncomp_v3->maincode, uncomp_v3->lengthtable, MAINCODE_SIZE))\r\n            return false;\r\n        if (!rar_create_code(&uncomp_v3->offsetcode, uncomp_v3->lengthtable + MAINCODE_SIZE, OFFSETCODE_SIZE))\r\n            return false;\r\n        if (!rar_create_code(&uncomp_v3->lowoffsetcode, uncomp_v3->lengthtable + MAINCODE_SIZE + OFFSETCODE_SIZE, LOWOFFSETCODE_SIZE))\r\n            return false;\r\n        if (!rar_create_code(&uncomp_v3->lengthcode, uncomp_v3->lengthtable + MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE, LENGTHCODE_SIZE))\r\n            return false;\r\n    }\r\n\r\n    rar->uncomp.start_new_table = false;\r\n    return true;\r\n}\r\n\r\nstatic bool rar_read_filter(ar_archive_rar *rar, bool (* decode_byte)(ar_archive_rar *rar, uint8_t *byte), int64_t *end)\r\n{\r\n    uint8_t flags, val, *code;\r\n    uint16_t length, i;\r\n\r\n    if (!decode_byte(rar, &flags))\r\n        return false;\r\n    length = (flags & 0x07) + 1;\r\n    if (length == 7) {\r\n        if (!decode_byte(rar, &val))\r\n            return false;\r\n        length = val + 7;\r\n    }\r\n    else if (length == 8) {\r\n        if (!decode_byte(rar, &val))\r\n            return false;\r\n        length = val << 8;\r\n        if (!decode_byte(rar, &val))\r\n            return false;\r\n        length |= val;\r\n    }\r\n\r\n    code = malloc(length);\r\n    if (!code) {\r\n        warn(\"OOM during decompression\");\r\n        return false;\r\n    }\r\n    for (i = 0; i < length; i++) {\r\n        if (!decode_byte(rar, &code[i])) {\r\n            free(code);\r\n            return false;\r\n        }\r\n    }\r\n    if (!rar_parse_filter(rar, code, length, flags)) {\r\n        free(code);\r\n        return false;\r\n    }\r\n    free(code);\r\n\r\n    if (rar->uncomp.state.v3.filters.filterstart < (size_t)*end)\r\n        *end = rar->uncomp.state.v3.filters.filterstart;\r\n\r\n    return true;\r\n}\r\n\r\nstatic inline bool rar_decode_ppmd7_symbol(struct ar_archive_rar_uncomp_v3 *uncomp_v3, Byte *symbol)\r\n{\r\n    int value = Ppmd7_DecodeSymbol(&uncomp_v3->ppmd7_context, &uncomp_v3->range_dec.super);\r\n    if (value < 0) {\r\n        warn(\"Invalid data in bitstream\"); /* invalid PPMd symbol */\r\n        return false;\r\n    }\r\n    *symbol = (Byte)value;\r\n    return true;\r\n}\r\n\r\nstatic bool rar_decode_byte(ar_archive_rar *rar, uint8_t *byte)\r\n{\r\n    if (!br_check(rar, 8))\r\n        return false;\r\n    *byte = (uint8_t)br_bits(rar, 8);\r\n    return true;\r\n}\r\n\r\nstatic bool rar_decode_ppmd7_byte(ar_archive_rar *rar, uint8_t *byte)\r\n{\r\n    return rar_decode_ppmd7_symbol(&rar->uncomp.state.v3, byte);\r\n}\r\n\r\nstatic bool rar_handle_ppmd_sequence(ar_archive_rar *rar, int64_t *end)\r\n{\r\n    struct ar_archive_rar_uncomp_v3 *uncomp_v3 = &rar->uncomp.state.v3;\r\n    LZSS *lzss = &rar->uncomp.lzss;\r\n    Byte sym, code, length;\r\n    int lzss_offset;\r\n\r\n    if (!rar_decode_ppmd7_symbol(uncomp_v3, &sym))\r\n        return false;\r\n    if (sym != uncomp_v3->ppmd_escape) {\r\n        lzss_emit_literal(lzss, sym);\r\n        return true;\r\n    }\r\n\r\n    if (!rar_decode_ppmd7_symbol(uncomp_v3, &code))\r\n        return false;\r\n    switch (code) {\r\n    case 0:\r\n        return rar_parse_codes(rar);\r\n\r\n    case 2:\r\n        rar->uncomp.start_new_table = true;\r\n        return true;\r\n\r\n    case 3:\r\n        return rar_read_filter(rar, rar_decode_ppmd7_byte, end);\r\n\r\n    case 4:\r\n        if (!rar_decode_ppmd7_symbol(uncomp_v3, &code))\r\n            return false;\r\n        lzss_offset = code << 16;\r\n        if (!rar_decode_ppmd7_symbol(uncomp_v3, &code))\r\n            return false;\r\n        lzss_offset |= code << 8;\r\n        if (!rar_decode_ppmd7_symbol(uncomp_v3, &code))\r\n            return false;\r\n        lzss_offset |= code;\r\n        if (!rar_decode_ppmd7_symbol(uncomp_v3, &length))\r\n            return false;\r\n        lzss_emit_match(lzss, lzss_offset + 2, length + 32);\r\n        return true;\r\n\r\n    case 5:\r\n        if (!rar_decode_ppmd7_symbol(uncomp_v3, &length))\r\n            return false;\r\n        lzss_emit_match(lzss, 1, length + 4);\r\n        return true;\r\n\r\n    default:\r\n        lzss_emit_literal(lzss, sym);\r\n        return true;\r\n    }\r\n}\r\n\r\nint64_t rar_expand(ar_archive_rar *rar, int64_t end)\r\n{\r\n    static const uint8_t lengthbases[] =\r\n        {   0,   1,   2,   3,   4,   5,   6,\r\n            7,   8,  10,  12,  14,  16,  20,\r\n           24,  28,  32,  40,  48,  56,  64,\r\n           80,  96, 112, 128, 160, 192, 224 };\r\n    static const uint8_t lengthbits[] =\r\n        { 0, 0, 0, 0, 0, 0, 0,\r\n          0, 1, 1, 1, 1, 2, 2,\r\n          2, 2, 3, 3, 3, 3, 4,\r\n          4, 4, 4, 5, 5, 5, 5 };\r\n    static const int32_t offsetbases[] =\r\n        {       0,       1,       2,       3,       4,       6,\r\n                8,      12,      16,      24,      32,      48,\r\n               64,      96,     128,     192,     256,     384,\r\n              512,     768,    1024,    1536,    2048,    3072,\r\n             4096,    6144,    8192,   12288,   16384,   24576,\r\n            32768,   49152,   65536,   98304,  131072,  196608,\r\n           262144,  327680,  393216,  458752,  524288,  589824,\r\n           655360,  720896,  786432,  851968,  917504,  983040,\r\n          1048576, 1310720, 1572864, 1835008, 2097152, 2359296,\r\n          2621440, 2883584, 3145728, 3407872, 3670016, 3932160 };\r\n    static const uint8_t offsetbits[] =\r\n        {  0,  0,  0,  0,  1,  1,  2,  2,  3,  3,  4,  4,\r\n           5,  5,  6,  6,  7,  7,  8,  8,  9,  9, 10, 10,\r\n          11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16,\r\n          16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,\r\n          18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18 };\r\n    static const uint8_t shortbases[] =\r\n        { 0, 4, 8, 16, 32, 64, 128, 192 };\r\n    static const uint8_t shortbits[] =\r\n        { 2, 2, 3, 4, 5, 6, 6, 6 };\r\n\r\n    struct ar_archive_rar_uncomp_v3 *uncomp_v3 = &rar->uncomp.state.v3;\r\n    LZSS *lzss = &rar->uncomp.lzss;\r\n    int symbol, offs, len, i;\r\n\r\n    if (rar->uncomp.version == 2)\r\n        return rar_expand_v2(rar, end);\r\n\r\n    for (;;) {\r\n        if (lzss_position(lzss) >= end)\r\n            return end;\r\n\r\n        if (uncomp_v3->is_ppmd_block) {\r\n            if (!rar_handle_ppmd_sequence(rar, &end))\r\n                return -1;\r\n            if (rar->uncomp.start_new_table)\r\n                return lzss_position(lzss);\r\n            continue;\r\n        }\r\n\r\n        symbol = rar_read_next_symbol(rar, &uncomp_v3->maincode);\r\n        if (symbol < 0)\r\n            return -1;\r\n        if (symbol < 256) {\r\n            lzss_emit_literal(lzss, (uint8_t)symbol);\r\n            continue;\r\n        }\r\n        if (symbol == 256) {\r\n            if (!br_check(rar, 1))\r\n                return -1;\r\n            if (!br_bits(rar, 1)) {\r\n                if (!br_check(rar, 1))\r\n                    return -1;\r\n                rar->uncomp.start_new_table = br_bits(rar, 1) != 0;\r\n                return lzss_position(lzss);\r\n            }\r\n            if (!rar_parse_codes(rar))\r\n                return -1;\r\n            continue;\r\n        }\r\n        if (symbol == 257) {\r\n            if (!rar_read_filter(rar, rar_decode_byte, &end))\r\n                return -1;\r\n            continue;\r\n        }\r\n        if (symbol == 258) {\r\n            if (uncomp_v3->lastlength == 0)\r\n                continue;\r\n            offs = uncomp_v3->lastoffset;\r\n            len = uncomp_v3->lastlength;\r\n        }\r\n        else if (symbol <= 262) {\r\n            int idx = symbol - 259;\r\n            int lensymbol = rar_read_next_symbol(rar, &uncomp_v3->lengthcode);\r\n            offs = uncomp_v3->oldoffset[idx];\r\n            if (lensymbol < 0 || lensymbol > (int)(sizeof(lengthbases) / sizeof(lengthbases[0])) || lensymbol > (int)(sizeof(lengthbits) / sizeof(lengthbits[0]))) {\r\n                warn(\"Invalid data in bitstream\");\r\n                return -1;\r\n            }\r\n            len = lengthbases[lensymbol] + 2;\r\n            if (lengthbits[lensymbol] > 0) {\r\n                if (!br_check(rar, lengthbits[lensymbol]))\r\n                    return -1;\r\n                len += (uint8_t)br_bits(rar, lengthbits[lensymbol]);\r\n            }\r\n            for (i = idx; i > 0; i--)\r\n                uncomp_v3->oldoffset[i] = uncomp_v3->oldoffset[i - 1];\r\n            uncomp_v3->oldoffset[0] = offs;\r\n        }\r\n        else if (symbol <= 270) {\r\n            int idx = symbol - 263;\r\n            offs = shortbases[idx] + 1;\r\n            if (shortbits[idx] > 0) {\r\n                if (!br_check(rar, shortbits[idx]))\r\n                    return -1;\r\n                offs += (uint8_t)br_bits(rar, shortbits[idx]);\r\n            }\r\n            len = 2;\r\n            for (i = 3; i > 0; i--)\r\n                uncomp_v3->oldoffset[i] = uncomp_v3->oldoffset[i - 1];\r\n            uncomp_v3->oldoffset[0] = offs;\r\n        }\r\n        else {\r\n            int idx = symbol - 271;\r\n            int offssymbol;\r\n            if (idx > (int)(sizeof(lengthbases) / sizeof(lengthbases[0])) || idx > (int)(sizeof(lengthbits) / sizeof(lengthbits[0]))) {\r\n                warn(\"Invalid data in bitstream\");\r\n                return -1;\r\n            }\r\n            len = lengthbases[idx] + 3;\r\n            if (lengthbits[idx] > 0) {\r\n                if (!br_check(rar, lengthbits[idx]))\r\n                    return -1;\r\n                len += (uint8_t)br_bits(rar, lengthbits[idx]);\r\n            }\r\n            offssymbol = rar_read_next_symbol(rar, &uncomp_v3->offsetcode);\r\n            if (offssymbol < 0 || offssymbol > (int)(sizeof(offsetbases) / sizeof(offsetbases[0])) || offssymbol > (int)(sizeof(offsetbits) / sizeof(offsetbits[0]))) {\r\n                warn(\"Invalid data in bitstream\");\r\n                return -1;\r\n            }\r\n            offs = offsetbases[offssymbol] + 1;\r\n            if (offsetbits[offssymbol] > 0) {\r\n                if (offssymbol > 9) {\r\n                    if (offsetbits[offssymbol] > 4) {\r\n                        if (!br_check(rar, offsetbits[offssymbol] - 4))\r\n                            return -1;\r\n                        offs += (int)br_bits(rar, offsetbits[offssymbol] - 4) << 4;\r\n                    }\r\n                    if (uncomp_v3->numlowoffsetrepeats > 0) {\r\n                        uncomp_v3->numlowoffsetrepeats--;\r\n                        offs += uncomp_v3->lastlowoffset;\r\n                    }\r\n                    else {\r\n                        int lowoffsetsymbol = rar_read_next_symbol(rar, &uncomp_v3->lowoffsetcode);\r\n                        if (lowoffsetsymbol < 0)\r\n                            return -1;\r\n                        if (lowoffsetsymbol == 16) {\r\n                            uncomp_v3->numlowoffsetrepeats = 15;\r\n                            offs += uncomp_v3->lastlowoffset;\r\n                        }\r\n                        else {\r\n                            offs += lowoffsetsymbol;\r\n                            uncomp_v3->lastlowoffset = lowoffsetsymbol;\r\n                        }\r\n                    }\r\n                }\r\n                else {\r\n                    if (!br_check(rar, offsetbits[offssymbol]))\r\n                        return -1;\r\n                    offs += (int)br_bits(rar, offsetbits[offssymbol]);\r\n                }\r\n            }\r\n\r\n            if (offs >= 0x40000)\r\n                len++;\r\n            if (offs >= 0x2000)\r\n                len++;\r\n\r\n            for (i = 3; i > 0; i--)\r\n                uncomp_v3->oldoffset[i] = uncomp_v3->oldoffset[i - 1];\r\n            uncomp_v3->oldoffset[0] = offs;\r\n        }\r\n\r\n        uncomp_v3->lastoffset = offs;\r\n        uncomp_v3->lastlength = len;\r\n\r\n        lzss_emit_match(lzss, offs, len);\r\n    }\r\n}\r\n\r\nbool rar_uncompress_part(ar_archive_rar *rar, void *buffer, size_t buffer_size)\r\n{\r\n    struct ar_archive_rar_uncomp *uncomp = &rar->uncomp;\r\n    struct ar_archive_rar_uncomp_v3 *uncomp_v3 = NULL;\r\n    size_t end;\r\n\r\n    if (!rar_init_uncompress(uncomp, rar->entry.version))\r\n        return false;\r\n    if (uncomp->version == 3)\r\n        uncomp_v3 = &uncomp->state.v3;\r\n\r\n    for (;;) {\r\n        if (uncomp_v3 && uncomp_v3->filters.bytes_ready > 0) {\r\n            size_t count = smin(uncomp_v3->filters.bytes_ready, buffer_size);\r\n            memcpy(buffer, uncomp_v3->filters.bytes, count);\r\n            uncomp_v3->filters.bytes_ready -= count;\r\n            uncomp_v3->filters.bytes += count;\r\n            rar->progress.bytes_done += count;\r\n            buffer_size -= count;\r\n            buffer = (uint8_t *)buffer + count;\r\n            if (rar->progress.bytes_done == rar->super.entry_size_uncompressed)\r\n                goto FinishBlock;\r\n        }\r\n        else if (uncomp->bytes_ready > 0) {\r\n            int count = (int)smin(uncomp->bytes_ready, buffer_size);\r\n            lzss_copy_bytes_from_window(&uncomp->lzss, buffer, rar->progress.bytes_done + rar->solid.size_total, count);\r\n            uncomp->bytes_ready -= count;\r\n            rar->progress.bytes_done += count;\r\n            buffer_size -= count;\r\n            buffer = (uint8_t *)buffer + count;\r\n        }\r\n        if (buffer_size == 0)\r\n            return true;\r\n\r\n        if (uncomp->br.at_eof)\r\n            return false;\r\n\r\n        if (uncomp_v3 && uncomp_v3->filters.lastend == uncomp_v3->filters.filterstart) {\r\n            if (!rar_run_filters(rar))\r\n                return false;\r\n            continue;\r\n        }\r\n\r\nFinishBlock:\r\n        if (uncomp->start_new_table && !rar_parse_codes(rar))\r\n            return false;\r\n\r\n        end = rar->progress.bytes_done + rar->solid.size_total + LZSS_WINDOW_SIZE - LZSS_OVERFLOW_SIZE;\r\n        if (uncomp_v3 && uncomp_v3->filters.filterstart < end)\r\n            end = uncomp_v3->filters.filterstart;\r\n        end = (size_t)rar_expand(rar, end);\r\n        if (end == (size_t)-1 || end < rar->progress.bytes_done + rar->solid.size_total)\r\n            return false;\r\n        uncomp->bytes_ready = end - rar->progress.bytes_done - rar->solid.size_total;\r\n        if (uncomp_v3)\r\n            uncomp_v3->filters.lastend = end;\r\n\r\n        if (uncomp_v3 && uncomp_v3->is_ppmd_block && uncomp->start_new_table)\r\n            goto FinishBlock;\r\n    }\r\n}\r\n"
  },
  {
    "path": "ext/unarr/tar/parse-tar.c",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n#include \"tar.h\"\r\n\r\nstatic bool tar_is_number(const char *data, size_t size)\r\n{\r\n    size_t i;\r\n\r\n    for (i = 0; i < size; i++) {\r\n        if ((data[i] < '0' || '7' < data[i]) && data[i] != ' ' && data[i] != '\\0')\r\n            return false;\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nstatic uint64_t tar_parse_number(const char *data, size_t size)\r\n{\r\n    uint64_t value = 0;\r\n    size_t i;\r\n\r\n    for (i = 0; i < size; i++) {\r\n        if (data[i] == ' ' || data[i] == '\\0')\r\n            continue;\r\n        if (data[i] < '0' || '7' < data[i])\r\n            break;\r\n        value = value * 8 + (data[i] - '0');\r\n    }\r\n\r\n    return value;\r\n}\r\n\r\nstatic bool tar_is_zeroed_block(const char *data)\r\n{\r\n    size_t i;\r\n    for (i = 0; i < TAR_BLOCK_SIZE; i++) {\r\n        if (data[i] != 0)\r\n            return false;\r\n    }\r\n    return true;\r\n}\r\n\r\nstatic bool ar_is_valid_utf8(const char *string)\r\n{\r\n    const unsigned char *s;\r\n    for (s = (const unsigned char *)string; *s; s++) {\r\n        int skip = *s < 0x80 ? 0 :\r\n                   *s < 0xC0 ? -1 :\r\n                   *s < 0xE0 ? 1 :\r\n                   *s < 0xF0 ? 2 :\r\n                   *s < 0xF5 ? 3 : -1;\r\n        if (skip < 0)\r\n            return false;\r\n        while (skip-- > 0) {\r\n            if ((*++s & 0xC0) != 0x80)\r\n                return false;\r\n        }\r\n    }\r\n    return true;\r\n}\r\n\r\nbool tar_parse_header(ar_archive_tar *tar)\r\n{\r\n    char data[TAR_BLOCK_SIZE];\r\n    uint32_t checksum;\r\n    int32_t checksum2;\r\n    size_t i;\r\n\r\n    if (ar_read(tar->super.stream, data, sizeof(data)) != sizeof(data))\r\n        return false;\r\n\r\n    if (tar_is_zeroed_block(data)) {\r\n        free(tar->entry.name);\r\n        memset(&tar->entry, 0, sizeof(tar->entry));\r\n        return true;\r\n    }\r\n\r\n    if (!tar_is_number(data + 124, 12) || !tar_is_number(data + 136, 12) || !tar_is_number(data + 148, 8))\r\n        return false;\r\n\r\n    tar->entry.filesize = (size_t)tar_parse_number(data + 124, 12);\r\n    tar->entry.mtime = (tar_parse_number(data + 136, 12) + 11644473600) * 10000000;\r\n    tar->entry.checksum = (uint32_t)tar_parse_number(data + 148, 8);\r\n    tar->entry.filetype = data[156];\r\n    free(tar->entry.name);\r\n    tar->entry.name = NULL;\r\n\r\n    if (tar->entry.filetype == TYPE_FILE_OLD) {\r\n        i = 100;\r\n        while (--i > 0 && data[i] == '\\0');\r\n        if (data[i] == '/')\r\n            tar->entry.filetype = TYPE_DIRECTORY;\r\n    }\r\n    tar->entry.is_ustar = memcmp(data + 257, \"ustar\\x00\"\"00\", 8) == 0 && memcmp(data + 508, \"tar\\0\", 4) != 0;\r\n\r\n    if (tar->entry.filesize > (size_t)-1 - tar->super.entry_offset - 2 * TAR_BLOCK_SIZE)\r\n        return false;\r\n\r\n    checksum = 0;\r\n    checksum2 = 0;\r\n    memset(data + 148, ' ', 8);\r\n    for (i = 0; i < sizeof(data); i++) {\r\n        checksum += (unsigned char)data[i];\r\n        checksum2 += (signed char)data[i];\r\n    }\r\n\r\n    if (checksum != (uint32_t)checksum2 && tar->entry.checksum == (uint32_t)checksum2) {\r\n        log(\"Checksum was calculated using signed data\");\r\n        tar->entry.checksum = checksum;\r\n    }\r\n    return tar->entry.checksum == checksum;\r\n}\r\n\r\nbool tar_handle_pax_extended(ar_archive *ar)\r\n{\r\n    ar_archive_tar *tar = (ar_archive_tar *)ar;\r\n    off64_t offset = ar->entry_offset;\r\n    size_t size = tar->entry.filesize;\r\n    char *data, *line;\r\n\r\n    data = malloc(size);\r\n    if (!data) {\r\n        log(\"Ignoring PAX extended header on OOM\");\r\n        return ar_parse_entry(ar);\r\n    }\r\n    if (!ar_entry_uncompress(ar, data, size) || !ar_parse_entry(ar)) {\r\n        free(data);\r\n        return false;\r\n    }\r\n    if (tar->last_seen_dir > offset) {\r\n        free(data);\r\n        return true;\r\n    }\r\n\r\n    line = data;\r\n    while (line < data + size) {\r\n        char *key, *value, *ptr;\r\n        size_t length, max_size = line - data + size;\r\n\r\n        ptr = memchr(line, '=', max_size);\r\n        if (!ptr || *line < '1' || '9' < *line) {\r\n            warn(\"Invalid PAX extended header record @%\" PRIi64, offset);\r\n            break;\r\n        }\r\n        value = ptr + 1;\r\n        *ptr = '\\0';\r\n        length = (size_t)strtoul(line, &ptr, 10);\r\n        if (max_size < length || length <= (size_t)(value - line) || line[length - 1] != '\\n' || *ptr != ' ') {\r\n            warn(\"Invalid PAX extended header record @%\" PRIi64, offset);\r\n            break;\r\n        }\r\n        key = ptr + 1;\r\n        line += length;\r\n        line[-1] = '\\0';\r\n\r\n        if (strcmp(key, \"path\") == 0) {\r\n            ptr = malloc(strlen(value) + 1);\r\n            if (ptr) {\r\n                strcpy(ptr, value);\r\n                free(tar->entry.name);\r\n                tar->entry.name = ptr;\r\n            }\r\n        }\r\n        else if (strcmp(key, \"mtime\") == 0)\r\n            tar->entry.mtime = (time64_t)((strtod(value, &ptr) + 11644473600) * 10000000);\r\n        else if (strcmp(key, \"size\") == 0)\r\n            tar->entry.filesize = (size_t)strtoul(value, &ptr, 10);\r\n        else\r\n            log(\"Skipping value for %s\", key);\r\n    }\r\n    free(data);\r\n\r\n    tar_get_name(ar);\r\n    ar->entry_offset = offset;\r\n    ar->entry_size_uncompressed = tar->entry.filesize;\r\n    ar->entry_filetime = tar->entry.mtime;\r\n\r\n    return true;\r\n}\r\n\r\nbool tar_handle_gnu_longname(ar_archive *ar)\r\n{\r\n    ar_archive_tar *tar = (ar_archive_tar *)ar;\r\n    off64_t offset = ar->entry_offset;\r\n    size_t size = tar->entry.filesize;\r\n    char *longname;\r\n\r\n    longname = malloc(size + 1);\r\n    if (!longname || size == (size_t)-1) {\r\n        log(\"Falling back to the short filename on OOM\");\r\n        free(longname);\r\n        return ar_parse_entry(ar);\r\n    }\r\n    if (!ar_entry_uncompress(ar, longname, size) || !ar_parse_entry(ar)) {\r\n        free(longname);\r\n        return false;\r\n    }\r\n    if (tar->last_seen_dir > offset) {\r\n        free(longname);\r\n        return true;\r\n    }\r\n    if (tar->entry.name) {\r\n        log(\"Skipping GNU long filename in favor of PAX name\");\r\n        free(longname);\r\n        return true;\r\n    }\r\n    longname[size] = '\\0';\r\n    ar->entry_offset = offset;\r\n    /* name could be in any encoding, assume UTF-8 or whatever (DOS) */\r\n    if (ar_is_valid_utf8(longname)) {\r\n        tar->entry.name = longname;\r\n    }\r\n    else {\r\n        tar->entry.name = ar_conv_dos_to_utf8(longname);\r\n        free(longname);\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nconst char *tar_get_name(ar_archive *ar)\r\n{\r\n    ar_archive_tar *tar = (ar_archive_tar *)ar;\r\n    if (!tar->entry.name) {\r\n        char *name;\r\n\r\n        if (!ar_seek(ar->stream, ar->entry_offset, SEEK_SET))\r\n            return NULL;\r\n\r\n        name = malloc(100 + 1);\r\n        if (!name || ar_read(ar->stream, name, 100) != 100) {\r\n            free(name);\r\n            ar_seek(ar->stream, ar->entry_offset + TAR_BLOCK_SIZE, SEEK_SET);\r\n            return NULL;\r\n        }\r\n        name[100] = '\\0';\r\n\r\n        if (tar->entry.is_ustar) {\r\n            char *prefixed = malloc(256 + 1);\r\n            if (!prefixed || !ar_skip(ar->stream, 245) || ar_read(ar->stream, prefixed, 167) != 167) {\r\n                free(name);\r\n                free(prefixed);\r\n                ar_seek(ar->stream, ar->entry_offset + TAR_BLOCK_SIZE, SEEK_SET);\r\n                return NULL;\r\n            }\r\n            if (prefixed[0] != '\\0') {\r\n                prefixed[156] = '\\0';\r\n                strcat(prefixed, \"/\");\r\n                strcat(prefixed, name);\r\n                free(name);\r\n                name = prefixed;\r\n                prefixed = NULL;\r\n            }\r\n            free(prefixed);\r\n        }\r\n        else\r\n            ar_skip(ar->stream, TAR_BLOCK_SIZE - 100);\r\n\r\n        /* name could be in any encoding, assume UTF-8 or whatever (DOS) */\r\n        if (ar_is_valid_utf8(name)) {\r\n            tar->entry.name = name;\r\n        }\r\n        else {\r\n            tar->entry.name = ar_conv_dos_to_utf8(name);\r\n            free(name);\r\n        }\r\n        /* normalize path separators */\r\n        if (tar->entry.name) {\r\n            char *p = tar->entry.name;\r\n            while ((p = strchr(p, '\\\\')) != NULL) {\r\n                *p = '/';\r\n            }\r\n        }\r\n    }\r\n    return tar->entry.name;\r\n}\r\n"
  },
  {
    "path": "ext/unarr/tar/tar.c",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n#include \"tar.h\"\r\n\r\nstatic void tar_close(ar_archive *ar)\r\n{\r\n    ar_archive_tar *tar = (ar_archive_tar *)ar;\r\n    free(tar->entry.name);\r\n}\r\n\r\nstatic bool tar_parse_entry(ar_archive *ar, off64_t offset)\r\n{\r\n    ar_archive_tar *tar = (ar_archive_tar *)ar;\r\n\r\n    if (!ar_seek(ar->stream, offset, SEEK_SET)) {\r\n        warn(\"Couldn't seek to offset %\" PRIi64, offset);\r\n        return false;\r\n    }\r\n    if (!tar_parse_header(tar)) {\r\n        warn(\"Invalid tar header data @%\" PRIi64, offset);\r\n        return false;\r\n    }\r\n    if (!tar->entry.checksum) {\r\n        ar->at_eof = true;\r\n        return false;\r\n    }\r\n\r\n    ar->entry_offset = offset;\r\n    ar->entry_offset_next = offset + TAR_BLOCK_SIZE + (tar->entry.filesize + TAR_BLOCK_SIZE - 1) / TAR_BLOCK_SIZE * TAR_BLOCK_SIZE;\r\n    ar->entry_size_uncompressed = tar->entry.filesize;\r\n    ar->entry_filetime = tar->entry.mtime;\r\n    tar->bytes_done = 0;\r\n\r\n    if (tar->last_seen_dir > offset)\r\n        tar->last_seen_dir = 0;\r\n\r\n    switch (tar->entry.filetype) {\r\n    case TYPE_FILE:\r\n    case TYPE_FILE_OLD:\r\n        return true;\r\n    case TYPE_DIRECTORY:\r\n        log(\"Skipping directory entry \\\"%s\\\"\", tar_get_name(ar));\r\n        tar->last_seen_dir = ar->entry_offset;\r\n        return tar_parse_entry(ar, ar->entry_offset_next);\r\n    case TYPE_PAX_GLOBAL:\r\n        log(\"Skipping PAX global extended header record\");\r\n        return tar_parse_entry(ar, ar->entry_offset_next);\r\n    case TYPE_PAX_EXTENDED:\r\n        return tar_handle_pax_extended(ar);\r\n    case TYPE_GNU_LONGNAME:\r\n        return tar_handle_gnu_longname(ar);\r\n    default:\r\n        warn(\"Unknown entry type '%c'\", tar->entry.filetype);\r\n        return true;\r\n    }\r\n}\r\n\r\nstatic bool tar_uncompress(ar_archive *ar, void *buffer, size_t count)\r\n{\r\n    ar_archive_tar *tar = (ar_archive_tar *)ar;\r\n    if (count > ar->entry_size_uncompressed - tar->bytes_done) {\r\n        warn(\"Requesting too much data (%\" PRIuPTR \" < %\" PRIuPTR \")\", ar->entry_size_uncompressed - tar->bytes_done, count);\r\n        return false;\r\n    }\r\n    if (ar_read(ar->stream, buffer, count) != count) {\r\n        warn(\"Unexpected EOF in stored data\");\r\n        return false;\r\n    }\r\n    tar->bytes_done += count;\r\n    return true;\r\n}\r\n\r\nar_archive *ar_open_tar_archive(ar_stream *stream)\r\n{\r\n    ar_archive *ar;\r\n    ar_archive_tar *tar;\r\n\r\n    if (!ar_seek(stream, 0, SEEK_SET))\r\n        return NULL;\r\n\r\n    ar = ar_open_archive(stream, sizeof(ar_archive_tar), tar_close, tar_parse_entry, tar_get_name, tar_uncompress, NULL, 0);\r\n    if (!ar)\r\n        return NULL;\r\n\r\n    tar = (ar_archive_tar *)ar;\r\n    if (!tar_parse_header(tar) || !tar->entry.checksum) {\r\n        free(ar);\r\n        return NULL;\r\n    }\r\n\r\n    return ar;\r\n}\r\n"
  },
  {
    "path": "ext/unarr/tar/tar.h",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n#ifndef tar_tar_h\r\n#define tar_tar_h\r\n\r\n#include \"../common/unarr-imp.h\"\r\n\r\ntypedef struct ar_archive_tar_s ar_archive_tar;\r\n\r\n/***** parse-tar *****/\r\n\r\n#define TAR_BLOCK_SIZE 512\r\n\r\nenum tar_filetype {\r\n    TYPE_FILE = '0', TYPE_FILE_OLD = '\\0',\r\n    TYPE_HARD_LINK = '1', TYPE_SOFT_LINK = '2',\r\n    TYPE_DIRECTORY = '5',\r\n    TYPE_GNU_LONGNAME = 'L',\r\n    TYPE_PAX_GLOBAL = 'g', TYPE_PAX_EXTENDED = 'x',\r\n};\r\n\r\nstruct tar_entry {\r\n    char *name;\r\n    size_t filesize;\r\n    time64_t mtime;\r\n    uint32_t checksum;\r\n    char filetype;\r\n    bool is_ustar;\r\n};\r\n\r\nbool tar_parse_header(ar_archive_tar *tar);\r\nbool tar_handle_pax_extended(ar_archive *ar);\r\nbool tar_handle_gnu_longname(ar_archive *ar);\r\nconst char *tar_get_name(ar_archive *ar);\r\n\r\n/***** tar *****/\r\n\r\nstruct ar_archive_tar_s {\r\n    ar_archive super;\r\n    struct tar_entry entry;\r\n    size_t bytes_done;\r\n    off64_t last_seen_dir;\r\n};\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/unarr/unarr.h",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n#ifndef unarr_h\r\n#define unarr_h\r\n\r\n#include <stddef.h>\r\n#include <stdint.h>\r\n#include <stdbool.h>\r\ntypedef int64_t off64_t;\r\ntypedef int64_t time64_t;\r\n\r\n#define UNARR_API_VERSION 100\r\n\r\n/***** common/stream *****/\r\n\r\ntypedef struct ar_stream_s ar_stream;\r\n\r\n/* opens a read-only stream for the given file path; returns NULL on error */\r\nar_stream *ar_open_file(const char *path);\r\n#ifdef _WIN32\r\nar_stream *ar_open_file_w(const wchar_t *path);\r\n#endif\r\n/* opens a read-only stream for the given chunk of memory; the pointer must be valid until ar_close is called */\r\nar_stream *ar_open_memory(const void *data, size_t datalen);\r\n#ifdef _WIN32\r\ntypedef struct IStream IStream;\r\n/* opens a read-only stream based on the given IStream */\r\nar_stream *ar_open_istream(IStream *stream);\r\n#endif\r\n\r\n/* closes the stream and releases underlying resources */\r\nvoid ar_close(ar_stream *stream);\r\n/* tries to read 'count' bytes into buffer, advancing the read offset pointer; returns the actual number of bytes read */\r\nsize_t ar_read(ar_stream *stream, void *buffer, size_t count);\r\n/* moves the read offset pointer (same as fseek); returns false on failure */\r\nbool ar_seek(ar_stream *stream, off64_t offset, int origin);\r\n/* shortcut for ar_seek(stream, count, SEEK_CUR); returns false on failure */\r\nbool ar_skip(ar_stream *stream, off64_t count);\r\n/* returns the current read offset (or 0 on error) */\r\noff64_t ar_tell(ar_stream *stream);\r\n\r\n/***** common/unarr *****/\r\n\r\ntypedef struct ar_archive_s ar_archive;\r\n\r\n/* frees all data stored for the given archive; does not close the underlying stream */\r\nvoid ar_close_archive(ar_archive *ar);\r\n/* reads the next archive entry; returns false on error or at the end of the file (use ar_at_eof to distinguish the two cases) */\r\nbool ar_parse_entry(ar_archive *ar);\r\n/* reads the archive entry at the given offset as returned by ar_entry_get_offset (offset 0 always restarts at the first entry); should always succeed */\r\nbool ar_parse_entry_at(ar_archive *ar, off64_t offset);\r\n/* reads the (first) archive entry associated with the given name; returns false if the entry couldn't be found */\r\nbool ar_parse_entry_for(ar_archive *ar, const char *entry_name);\r\n/* returns whether the last ar_parse_entry call has reached the file's expected end */\r\nbool ar_at_eof(ar_archive *ar);\r\n\r\n/* returns the name of the current entry as UTF-8 string; this pointer is only valid until the next call to ar_parse_entry; returns NULL on failure */\r\nconst char *ar_entry_get_name(ar_archive *ar);\r\n/* returns the stream offset of the current entry for use with ar_parse_entry_at */\r\noff64_t ar_entry_get_offset(ar_archive *ar);\r\n/* returns the total size of uncompressed data of the current entry; read exactly that many bytes using ar_entry_uncompress */\r\nsize_t ar_entry_get_size(ar_archive *ar);\r\n/* returns the stored modification date of the current entry in 100ns since 1601/01/01 */\r\ntime64_t ar_entry_get_filetime(ar_archive *ar);\r\n/* WARNING: don't manually seek in the stream between ar_parse_entry and the last corresponding ar_entry_uncompress call! */\r\n/* uncompresses the next 'count' bytes of the current entry into buffer; returns false on error */\r\nbool ar_entry_uncompress(ar_archive *ar, void *buffer, size_t count);\r\n\r\n/* copies at most 'count' bytes of the archive's global comment (if any) into buffer; returns the actual amout of bytes copied (or, if 'buffer' is NULL, the required buffer size) */\r\nsize_t ar_get_global_comment(ar_archive *ar, void *buffer, size_t count);\r\n\r\n/***** rar/rar *****/\r\n\r\n/* checks whether 'stream' could contain RAR data and prepares for archive listing/extraction; returns NULL on failure */\r\nar_archive *ar_open_rar_archive(ar_stream *stream);\r\n\r\n/***** tar/tar *****/\r\n\r\n/* checks whether 'stream' could contain TAR data and prepares for archive listing/extraction; returns NULL on failure */\r\nar_archive *ar_open_tar_archive(ar_stream *stream);\r\n\r\n/***** zip/zip *****/\r\n\r\n/* checks whether 'stream' could contain ZIP data and prepares for archive listing/extraction; returns NULL on failure */\r\n/* set deflatedonly for extracting XPS, EPUB, etc. documents where non-Deflate compression methods are not supported by specification */\r\nar_archive *ar_open_zip_archive(ar_stream *stream, bool deflatedonly);\r\n\r\n/***** _7z/_7z *****/\r\n\r\n/* checks whether 'stream' could contain 7Z data and prepares for archive listing/extraction; returns NULL on failure */\r\nar_archive *ar_open_7z_archive(ar_stream *stream);\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/unarr/zip/inflate.c",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n#include \"inflate.h\"\r\n#include \"../common/allocator.h\"\r\n\r\n#include <stdlib.h>\r\n#include <stdint.h>\r\n#include <string.h>\r\n\r\n#ifndef _MSC_VER\r\n#define __forceinline inline\r\n#endif\r\n\r\n#define MAX_BITS 16\r\n#define TREE_FAST_BITS 10\r\n#define MAX_TREE_NODES 288\r\n\r\nenum inflate_step {\r\n    STEP_NEXT_BLOCK = 0,\r\n    STEP_COPY_INIT, STEP_COPY,\r\n    STEP_INFLATE_STATIC_INIT, STEP_INFLATE_DYNAMIC_INIT, STEP_INFLATE_DYNAMIC_INIT_PRETREE, STEP_INFLATE_DYNAMIC_INIT_TREES,\r\n    STEP_INFLATE_CODE, STEP_INFLATE, STEP_INFLATE_DISTANCE_CODE, STEP_INFLATE_DISTANCE, STEP_INFLATE_REPEAT,\r\n};\r\nenum { RESULT_EOS = -1, RESULT_NOT_DONE = 0, RESULT_ERROR = 1 };\r\n\r\n#if defined(_MSC_VER) || defined(__GNUC__)\r\n#define RESULT_ERROR (RESULT_ERROR + __COUNTER__)\r\n#endif\r\n\r\nstruct tree {\r\n    struct {\r\n        unsigned value : 11;\r\n        unsigned is_value : 1;\r\n        unsigned length : 4;\r\n    } nodes[(1 << TREE_FAST_BITS) + MAX_TREE_NODES * 2];\r\n    int next_node;\r\n};\r\n\r\nstruct inflate_state_s {\r\n    enum inflate_step step;\r\n    struct {\r\n        int value;\r\n        int length;\r\n        int dist;\r\n        int tree_idx;\r\n    } state;\r\n    struct {\r\n        int hlit;\r\n        int hdist;\r\n        int hclen;\r\n        int idx;\r\n        int clens[288 + 32];\r\n    } prepare;\r\n    bool inflate64;\r\n    bool is_final_block;\r\n    struct tree tree_lengths;\r\n    struct tree tree_dists;\r\n    struct {\r\n        const uint8_t *data_in;\r\n        size_t *avail_in;\r\n        uint64_t bits;\r\n        int available;\r\n    } in;\r\n    struct {\r\n        uint8_t *data_out;\r\n        size_t *avail_out;\r\n        uint8_t window[1 << 16];\r\n        size_t offset;\r\n    } out;\r\n};\r\n\r\nstatic const struct {\r\n    int bits;\r\n    int length;\r\n} table_lengths[30] = {\r\n    { 0, 3 }, { 0, 4 }, { 0, 5 }, { 0, 6 }, { 0, 7 }, { 0, 8 }, { 0, 9 }, { 0, 10 },\r\n    { 1, 11 }, { 1, 13 }, { 1, 15 }, { 1, 17 }, { 2, 19 }, { 2, 23 }, { 2, 27 }, { 2, 31 },\r\n    { 3, 35 }, { 3, 43 }, { 3, 51 }, { 3, 59 }, { 4, 67 }, { 4, 83 }, { 4, 99 }, { 4, 115 },\r\n    { 5, 131 }, { 5, 163 }, { 5, 195 }, { 5, 227 },\r\n    { 0, 258 }, /* Deflate64 (replaces { 0, 258 }) */ { 16, 3 }\r\n};\r\n\r\nstatic const struct {\r\n    int bits;\r\n    int dist;\r\n} table_dists[32] = {\r\n    { 0, 1 }, { 0, 2 }, { 0, 3 }, { 0, 4 }, { 1, 5 }, { 1, 7 },\r\n    { 2, 9 }, { 2, 13 }, { 3, 17 }, { 3, 25 }, { 4, 33 }, { 4, 49 },\r\n    { 5, 65 }, { 5, 97 }, { 6, 129 }, { 6, 193 }, { 7, 257 }, { 7, 385 },\r\n    { 8, 513 }, { 8, 769 }, { 9, 1025 }, { 9, 1537 }, { 10, 2049 }, { 10, 3073 },\r\n    { 11, 4097 }, { 11, 6145 }, { 12, 8193 }, { 12, 12289 }, { 13, 16385 }, { 13, 24577 },\r\n    /* Deflate64 */ { 14, 32769 }, { 14, 49153 }\r\n};\r\n\r\nstatic const int table_code_length_idxs[19] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 };\r\n\r\nstatic __forceinline bool br_ensure(inflate_state *state, int bits)\r\n{\r\n    while (state->in.available < bits) {\r\n        if (*state->in.avail_in == 0)\r\n            return false;\r\n        state->in.bits |= ((uint64_t)*state->in.data_in++ << state->in.available);\r\n        (*state->in.avail_in)--;\r\n        state->in.available += 8;\r\n    }\r\n    return true;\r\n}\r\n\r\nstatic __forceinline uint64_t br_bits(inflate_state *state, int bits)\r\n{\r\n    uint64_t res = state->in.bits & (((uint64_t)1 << bits) - 1);\r\n    state->in.available -= bits;\r\n    state->in.bits >>= bits;\r\n    return res;\r\n}\r\n\r\nstatic __forceinline void output(inflate_state *state, uint8_t value)\r\n{\r\n    *state->out.data_out++ = value;\r\n    (*state->out.avail_out)--;\r\n    state->out.window[state->out.offset++ & (sizeof(state->out.window) - 1)] = value;\r\n}\r\n\r\nstatic bool tree_add_value(struct tree *tree, int key, int bits, int value)\r\n{\r\n    int rkey = 0, i;\r\n    for (i = 0; i < bits; i++)\r\n        rkey = (rkey << 1) | ((key >> i) & 1);\r\n\r\n    if (bits <= TREE_FAST_BITS) {\r\n        if (tree->nodes[rkey].length)\r\n            return false;\r\n        tree->nodes[rkey].length = bits;\r\n        tree->nodes[rkey].value = value;\r\n        tree->nodes[rkey].is_value = true;\r\n        for (i = 1; i < (1 << (TREE_FAST_BITS - bits)); i++) {\r\n            if (tree->nodes[rkey | (i << bits)].length)\r\n                return false;\r\n            tree->nodes[rkey | (i << bits)] = tree->nodes[rkey];\r\n        }\r\n        return true;\r\n    }\r\n\r\n    rkey &= (1 << TREE_FAST_BITS) - 1;\r\n    if (tree->nodes[rkey].is_value)\r\n        return false;\r\n    tree->nodes[rkey].length = TREE_FAST_BITS + 1;\r\n    if (!tree->nodes[rkey].value)\r\n        tree->nodes[rkey].value = (1 << TREE_FAST_BITS) + tree->next_node++ * 2;\r\n    i = tree->nodes[rkey].value;\r\n    bits -= TREE_FAST_BITS;\r\n\r\n    while (bits > 1) {\r\n        i |= (key >> (bits - 1)) & 1;\r\n        if (tree->nodes[i].is_value)\r\n            return false;\r\n        if (!tree->nodes[i].value) {\r\n            if (tree->next_node == MAX_TREE_NODES)\r\n                return false;\r\n            tree->nodes[i].value = (1 << TREE_FAST_BITS) + tree->next_node++ * 2;\r\n        }\r\n        i = tree->nodes[i].value;\r\n        bits--;\r\n    }\r\n    i |= key & 1;\r\n    if (tree->nodes[i].value || tree->nodes[i].is_value)\r\n        return false;\r\n    tree->nodes[i].value = value;\r\n    tree->nodes[i].is_value = true;\r\n\r\n    return true;\r\n}\r\n\r\nstatic __forceinline int tree_get_value(inflate_state *state, const struct tree *tree, bool not_fast)\r\n{\r\n    if (state->state.tree_idx == 0) {\r\n        int key = state->in.bits & ((1 << TREE_FAST_BITS) - 1);\r\n        while (not_fast && state->in.available < TREE_FAST_BITS && state->in.available < (int)tree->nodes[key].length) {\r\n            if (!br_ensure(state, tree->nodes[key].length))\r\n                return RESULT_NOT_DONE;\r\n            key = state->in.bits & ((1 << TREE_FAST_BITS) - 1);\r\n        }\r\n        if (tree->nodes[key].is_value) {\r\n            state->state.value = tree->nodes[key].value;\r\n            (void)br_bits(state, tree->nodes[key].length);\r\n            return RESULT_EOS;\r\n        }\r\n        if (tree->nodes[key].length == 0)\r\n            return RESULT_ERROR;\r\n        (void)br_bits(state, TREE_FAST_BITS);\r\n        state->state.tree_idx = tree->nodes[key].value;\r\n    }\r\n    while (state->state.value == -1) {\r\n        int idx;\r\n        if (not_fast && !br_ensure(state, 1))\r\n            return RESULT_NOT_DONE;\r\n        idx = state->state.tree_idx | (int)br_bits(state, 1);\r\n        if (tree->nodes[idx].is_value)\r\n            state->state.value = tree->nodes[idx].value;\r\n        else if (tree->nodes[idx].value)\r\n            state->state.tree_idx = tree->nodes[idx].value;\r\n        else\r\n            return RESULT_ERROR;\r\n    }\r\n    state->state.tree_idx = 0;\r\n    return RESULT_EOS;\r\n}\r\n\r\nstatic void setup_static_trees(inflate_state *state)\r\n{\r\n    int i;\r\n\r\n    memset(&state->tree_lengths, 0, sizeof(state->tree_lengths));\r\n    for (i = 0; i < 144; i++)\r\n        tree_add_value(&state->tree_lengths, i + 48, 8, i);\r\n    for (i = 144; i < 256; i++)\r\n        tree_add_value(&state->tree_lengths, i + 256, 9, i);\r\n    for (i = 256; i < 280; i++)\r\n        tree_add_value(&state->tree_lengths, i - 256, 7, i);\r\n    for (i = 280; i < 288; i++)\r\n        tree_add_value(&state->tree_lengths, i - 88, 8, i);\r\n\r\n    memset(&state->tree_dists, 0, sizeof(state->tree_dists));\r\n    for (i = 0; i < 32; i++)\r\n        tree_add_value(&state->tree_dists, i, 5, i);\r\n}\r\n\r\nstatic bool setup_dynamic_tree(struct tree *tree, int *clens, int count)\r\n{\r\n    int code, i;\r\n    int bl_count[MAX_BITS];\r\n    int next_code[MAX_BITS];\r\n\r\n    memset(bl_count, 0, sizeof(bl_count));\r\n    for (i = 0; i < count; i++)\r\n        bl_count[clens[i]]++;\r\n    bl_count[0] = 0;\r\n\r\n    code = 0;\r\n    for (i = 1; i < MAX_BITS; i++) {\r\n        code = (code + bl_count[i - 1]) << 1;\r\n        next_code[i] = code;\r\n    }\r\n\r\n    memset(tree, 0, sizeof(*tree));\r\n    for (i = 0; i < count; i++) {\r\n        if (clens[i] != 0) {\r\n            if (!tree_add_value(tree, next_code[clens[i]], clens[i], i))\r\n                return false;\r\n            next_code[clens[i]]++;\r\n        }\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\ninflate_state *inflate_create(bool inflate64)\r\n{\r\n    inflate_state *state = calloc(1, sizeof(inflate_state));\r\n    if (state)\r\n        state->inflate64 = inflate64;\r\n    return state;\r\n}\r\n\r\nvoid inflate_free(inflate_state *state)\r\n{\r\n    free(state);\r\n}\r\n\r\nint inflate_process(inflate_state *state, const void *data_in, size_t *avail_in, void *data_out, size_t *avail_out)\r\n{\r\n    bool not_fast = true;\r\n    int res;\r\n\r\n    if (!state || !data_in || !avail_in || !data_out || !avail_out)\r\n        return RESULT_ERROR;\r\n\r\n    state->in.data_in = data_in;\r\n    state->in.avail_in = avail_in;\r\n    state->out.data_out = data_out;\r\n    state->out.avail_out = avail_out;\r\n\r\n    for (;;) {\r\n        switch (state->step) {\r\n        case STEP_NEXT_BLOCK:\r\n            if (state->is_final_block)\r\n                return RESULT_EOS;\r\n\r\n            if (!br_ensure(state, 3))\r\n                return RESULT_NOT_DONE;\r\n            state->is_final_block = br_bits(state, 1) != 0;\r\n            switch (br_bits(state, 2)) {\r\n            case 0:\r\n                state->step = STEP_COPY_INIT;\r\n                break;\r\n            case 1:\r\n                state->step = STEP_INFLATE_STATIC_INIT;\r\n                break;\r\n            case 2:\r\n                state->step = STEP_INFLATE_DYNAMIC_INIT;\r\n                break;\r\n            default:\r\n                return RESULT_ERROR;\r\n            }\r\n            break;\r\n\r\n        case STEP_COPY_INIT:\r\n            if (!br_ensure(state, 32))\r\n                return RESULT_NOT_DONE;\r\n            (void)br_bits(state, state->in.available & 0x7);\r\n            state->state.length = (uint16_t)br_bits(state, 16);\r\n            if (state->state.length != 0xFFFF - (uint16_t)br_bits(state, 16))\r\n                return RESULT_ERROR;\r\n            state->step = STEP_COPY;\r\n            /* fall through */\r\n\r\n        case STEP_COPY:\r\n            while (state->state.length > 0) {\r\n                if (!br_ensure(state, 8) || *avail_out == 0)\r\n                    return RESULT_NOT_DONE;\r\n                output(state, (uint8_t)br_bits(state, 8));\r\n                state->state.length--;\r\n            }\r\n            state->step = STEP_NEXT_BLOCK;\r\n            break;\r\n\r\n        case STEP_INFLATE_STATIC_INIT:\r\n            setup_static_trees(state);\r\n            /* fall through */\r\n\r\n        STEP_INFLATE_START:\r\n            not_fast = !br_ensure(state, state->inflate64 ? 49 : 48);\r\n            state->state.value = -1;\r\n            /* fall through */\r\n\r\n        case STEP_INFLATE_CODE:\r\n            res = tree_get_value(state, &state->tree_lengths, not_fast);\r\n            if (res != RESULT_EOS) {\r\n                state->step = STEP_INFLATE_CODE;\r\n                return res;\r\n            }\r\n            /* fall through */\r\n\r\n        case STEP_INFLATE:\r\n            if (state->state.value < 256) {\r\n                if (*avail_out == 0) {\r\n                    state->step = STEP_INFLATE;\r\n                    return RESULT_NOT_DONE;\r\n                }\r\n                output(state, (uint8_t)state->state.value);\r\n                goto STEP_INFLATE_START;\r\n            }\r\n            if (state->state.value == 256) {\r\n                state->step = STEP_NEXT_BLOCK;\r\n                break;\r\n            }\r\n            if (state->state.value > 285)\r\n                return RESULT_ERROR;\r\n            if (state->inflate64 && state->state.value == 285) {\r\n                not_fast = !br_ensure(state, 45);\r\n                state->state.value = 286;\r\n            }\r\n            if (not_fast && !br_ensure(state, table_lengths[state->state.value - 257].bits)) {\r\n                state->step = STEP_INFLATE;\r\n                return RESULT_NOT_DONE;\r\n            }\r\n            state->state.length = table_lengths[state->state.value - 257].length + (int)br_bits(state, table_lengths[state->state.value - 257].bits);\r\n            state->state.value = -1;\r\n            /* fall through */\r\n\r\n        case STEP_INFLATE_DISTANCE_CODE:\r\n            res = tree_get_value(state, &state->tree_dists, not_fast);\r\n            if (res != RESULT_EOS) {\r\n                state->step = STEP_INFLATE_DISTANCE_CODE;\r\n                return res;\r\n            }\r\n            /* fall through */\r\n\r\n        case STEP_INFLATE_DISTANCE:\r\n            if (not_fast && !br_ensure(state, table_dists[state->state.value].bits)) {\r\n                state->step = STEP_INFLATE_DISTANCE;\r\n                return RESULT_NOT_DONE;\r\n            }\r\n            state->state.dist = table_dists[state->state.value].dist + (int)br_bits(state, table_dists[state->state.value].bits);\r\n            if ((size_t)state->state.dist > state->out.offset || (state->state.value > 30 && !state->inflate64))\r\n                return RESULT_ERROR;\r\n            state->step = STEP_INFLATE_REPEAT;\r\n            /* fall through */\r\n\r\n        case STEP_INFLATE_REPEAT:\r\n            while (state->state.length > 0) {\r\n                if (*avail_out == 0)\r\n                    return RESULT_NOT_DONE;\r\n                output(state, state->out.window[(state->out.offset - state->state.dist) & (sizeof(state->out.window) - 1)]);\r\n                state->state.length--;\r\n            }\r\n            goto STEP_INFLATE_START;\r\n\r\n        case STEP_INFLATE_DYNAMIC_INIT:\r\n            if (!br_ensure(state, 14))\r\n                return RESULT_NOT_DONE;\r\n            state->prepare.hlit = (int)br_bits(state, 5) + 257;\r\n            state->prepare.hdist = (int)br_bits(state, 5) + 1;\r\n            state->prepare.hclen = (int)br_bits(state, 4) + 4;\r\n            memset(state->prepare.clens, 0, sizeof(state->prepare.clens));\r\n            state->prepare.idx = 0;\r\n            state->step = STEP_INFLATE_DYNAMIC_INIT_PRETREE;\r\n            /* fall through */\r\n\r\n        case STEP_INFLATE_DYNAMIC_INIT_PRETREE:\r\n            while (state->prepare.idx < state->prepare.hclen) {\r\n                if (!br_ensure(state, 3))\r\n                    return RESULT_NOT_DONE;\r\n                state->prepare.clens[table_code_length_idxs[state->prepare.idx]] = (int)br_bits(state, 3);\r\n                state->prepare.idx++;\r\n            }\r\n            if (!setup_dynamic_tree(&state->tree_lengths, state->prepare.clens, 19))\r\n                return RESULT_ERROR;\r\n            memset(state->prepare.clens, 0, sizeof(state->prepare.clens));\r\n            state->prepare.idx = 0;\r\n            state->state.value = -1;\r\n            state->step = STEP_INFLATE_DYNAMIC_INIT_TREES;\r\n            /* fall through */\r\n\r\n        case STEP_INFLATE_DYNAMIC_INIT_TREES:\r\n            while (state->prepare.idx < state->prepare.hlit + state->prepare.hdist) {\r\n                int value = 0, repeat = 0;\r\n                if (state->state.value == -1) {\r\n                    res = tree_get_value(state, &state->tree_lengths, true);\r\n                    if (res != RESULT_EOS)\r\n                        return res;\r\n                }\r\n                if (state->state.value < 16) {\r\n                    state->prepare.clens[state->prepare.idx++] = state->state.value;\r\n                }\r\n                else if (state->state.value == 16) {\r\n                    if (state->prepare.idx == 0)\r\n                        return RESULT_ERROR;\r\n                    if (!br_ensure(state, 2))\r\n                        return RESULT_NOT_DONE;\r\n                    value = state->prepare.clens[state->prepare.idx - 1];\r\n                    repeat = (int)br_bits(state, 2) + 3;\r\n                }\r\n                else if (state->state.value == 17) {\r\n                    if (!br_ensure(state, 3))\r\n                        return RESULT_NOT_DONE;\r\n                    value = 0;\r\n                    repeat = (int)br_bits(state, 3) + 3;\r\n                }\r\n                else {\r\n                    if (!br_ensure(state, 7))\r\n                        return RESULT_NOT_DONE;\r\n                    value = 0;\r\n                    repeat = (int)br_bits(state, 7) + 11;\r\n                }\r\n                if (repeat) {\r\n                    if (state->prepare.idx + repeat > state->prepare.hlit + state->prepare.hdist)\r\n                        return RESULT_ERROR;\r\n                    while (repeat-- > 0)\r\n                        state->prepare.clens[state->prepare.idx++] = value;\r\n                }\r\n                state->state.value = -1;\r\n            }\r\n            if (!setup_dynamic_tree(&state->tree_lengths, state->prepare.clens, state->prepare.hlit))\r\n                return RESULT_ERROR;\r\n            if (!setup_dynamic_tree(&state->tree_dists, state->prepare.clens + state->prepare.hlit, state->prepare.hdist))\r\n                return RESULT_ERROR;\r\n            goto STEP_INFLATE_START;\r\n        }\r\n    }\r\n}\r\n\r\nint inflate_flush(inflate_state *state, unsigned char data_in[8])\r\n{\r\n    int count = 0;\r\n    int keep = state->in.available & 0x7;\r\n    while (count < state->in.available / 8) {\r\n        data_in[count] = (state->in.bits >> (count * 8 + keep)) & 0xFF;\r\n        count++;\r\n    }\r\n    state->in.available = keep;\r\n    return count;\r\n}\r\n"
  },
  {
    "path": "ext/unarr/zip/inflate.h",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n#ifndef zip_inflate_h\r\n#define zip_inflate_h\r\n\r\n#include <stddef.h>\r\n#include <stdbool.h>\r\n\r\ntypedef struct inflate_state_s inflate_state;\r\n\r\ninflate_state *inflate_create(bool inflate64);\r\n/* updates avail_in and avail_out and returns -1 on EOF or any other non-zero value on error */\r\nint inflate_process(inflate_state *state, const void *data_in, size_t *avail_in, void *data_out, size_t *avail_out);\r\n/* restores up to 8 bytes of data cached by inflate_process */\r\nint inflate_flush(inflate_state *state, unsigned char data_in[8]);\r\nvoid inflate_free(inflate_state *state);\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/unarr/zip/parse-zip.c",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n#include \"zip.h\"\r\n\r\n#if defined(_MSC_VER) && !defined(inline)\r\n#define inline __inline\r\n#endif\r\n\r\nstatic inline uint16_t uint16le(unsigned char *data) { return data[0] | data[1] << 8; }\r\nstatic inline uint32_t uint32le(unsigned char *data) { return data[0] | data[1] << 8 | data[2] << 16 | data[3] << 24; }\r\nstatic inline uint64_t uint64le(unsigned char *data) { return (uint64_t)uint32le(data) | (uint64_t)uint32le(data + 4) << 32; }\r\n\r\nbool zip_seek_to_compressed_data(ar_archive_zip *zip)\r\n{\r\n    struct zip_entry entry;\r\n\r\n    if (!ar_seek(zip->super.stream, zip->entry.offset, SEEK_SET))\r\n        return false;\r\n    if (!zip_parse_local_file_entry(zip, &entry))\r\n        return false;\r\n    if (zip->entry.method != entry.method) {\r\n        warn(\"Compression methods don't match: %d != %d\", zip->entry.method, entry.method);\r\n        if (!zip->entry.method)\r\n            zip->entry.method = entry.method;\r\n    }\r\n    if (zip->entry.dosdate != entry.dosdate) {\r\n        warn(\"Timestamps don't match\");\r\n        if (!zip->entry.dosdate) {\r\n            zip->entry.dosdate = entry.dosdate;\r\n            zip->super.entry_filetime = ar_conv_dosdate_to_filetime(zip->entry.dosdate);\r\n        }\r\n    }\r\n\r\n    return ar_seek(zip->super.stream, zip->entry.offset + ZIP_LOCAL_ENTRY_FIXED_SIZE + entry.namelen + entry.extralen, SEEK_SET);\r\n}\r\n\r\nstatic bool zip_parse_extra_fields(ar_archive_zip *zip, struct zip_entry *entry)\r\n{\r\n    uint8_t *extra;\r\n    uint32_t idx;\r\n\r\n    if (!entry->extralen)\r\n        return true;\r\n\r\n    /* read ZIP64 values where needed */\r\n    if (!ar_skip(zip->super.stream, entry->namelen))\r\n        return false;\r\n    extra = malloc(entry->extralen);\r\n    if (!extra || ar_read(zip->super.stream, extra, entry->extralen) != entry->extralen) {\r\n        free(extra);\r\n        return false;\r\n    }\r\n    for (idx = 0; idx + 4 < entry->extralen; idx += 4 + uint16le(&extra[idx + 2])) {\r\n        if (uint16le(&extra[idx]) == 0x0001) {\r\n            uint16_t size = uint16le(&extra[idx + 2]);\r\n            uint16_t offset = 0;\r\n            if (entry->uncompressed == UINT32_MAX && offset + 8 <= size) {\r\n                entry->uncompressed = uint64le(&extra[idx + 4 + offset]);\r\n                offset += 8;\r\n            }\r\n            if (entry->datasize == UINT32_MAX && offset + 8 <= size) {\r\n                entry->datasize = uint64le(&extra[idx + 4 + offset]);\r\n                offset += 8;\r\n            }\r\n            if (entry->header_offset == UINT32_MAX && offset + 8 <= size) {\r\n                entry->header_offset = (off64_t)uint64le(&extra[idx + 4 + offset]);\r\n                offset += 8;\r\n            }\r\n            if (entry->disk == UINT16_MAX && offset + 4 <= size) {\r\n                entry->disk = uint32le(&extra[idx + 4 + offset]);\r\n                offset += 4;\r\n            }\r\n            break;\r\n        }\r\n    }\r\n    free(extra);\r\n\r\n    return true;\r\n}\r\n\r\nbool zip_parse_local_file_entry(ar_archive_zip *zip, struct zip_entry *entry)\r\n{\r\n    uint8_t data[ZIP_LOCAL_ENTRY_FIXED_SIZE];\r\n\r\n    if (ar_read(zip->super.stream, data, sizeof(data)) != sizeof(data))\r\n        return false;\r\n\r\n    memset(entry, 0, sizeof(*entry));\r\n    entry->signature = uint32le(data + 0);\r\n    entry->version = uint16le(data + 4);\r\n    entry->flags = uint16le(data + 6);\r\n    entry->method = uint16le(data + 8);\r\n    entry->dosdate = uint32le(data + 10);\r\n    entry->crc = uint32le(data + 14);\r\n    entry->datasize = uint32le(data + 18);\r\n    entry->uncompressed = uint32le(data + 22);\r\n    entry->namelen = uint16le(data + 26);\r\n    entry->extralen = uint16le(data + 28);\r\n\r\n    if (entry->signature != SIG_LOCAL_FILE_HEADER)\r\n        return false;\r\n\r\n    return zip_parse_extra_fields(zip, entry);\r\n}\r\n\r\noff64_t zip_find_next_local_file_entry(ar_stream *stream, off64_t offset)\r\n{\r\n    uint8_t data[512];\r\n    int count, i;\r\n\r\n    if (!ar_seek(stream, offset, SEEK_SET))\r\n        return -1;\r\n    count = (int)ar_read(stream, data, sizeof(data));\r\n\r\n    while (count >= ZIP_LOCAL_ENTRY_FIXED_SIZE) {\r\n        for (i = 0; i < count - 4; i++) {\r\n            if (uint32le(data + i) == SIG_LOCAL_FILE_HEADER)\r\n                return offset + i;\r\n        }\r\n        memmove(data, data + count - 4, count);\r\n        offset += count - 4;\r\n        count = (int)ar_read(stream, data + 4, sizeof(data) - 4) + 4;\r\n    }\r\n\r\n    return -1;\r\n}\r\n\r\nbool zip_parse_directory_entry(ar_archive_zip *zip, struct zip_entry *entry)\r\n{\r\n    uint8_t data[ZIP_DIR_ENTRY_FIXED_SIZE];\r\n\r\n    if (ar_read(zip->super.stream, data, sizeof(data)) != sizeof(data))\r\n        return false;\r\n\r\n    entry->signature = uint32le(data + 0);\r\n    entry->version = uint16le(data + 4);\r\n    entry->min_version = uint16le(data + 6);\r\n    entry->flags = uint16le(data + 8);\r\n    entry->method = uint16le(data + 10);\r\n    entry->dosdate = uint32le(data + 12);\r\n    entry->crc = uint32le(data + 16);\r\n    entry->datasize = uint32le(data + 20);\r\n    entry->uncompressed = uint32le(data + 24);\r\n    entry->namelen = uint16le(data + 28);\r\n    entry->extralen = uint16le(data + 30);\r\n    entry->commentlen = uint16le(data + 32);\r\n    entry->disk = uint16le(data + 34);\r\n    entry->attr_internal = uint16le(data + 36);\r\n    entry->attr_external = uint32le(data + 38);\r\n    entry->header_offset = uint32le(data + 42);\r\n\r\n    if (entry->signature != SIG_CENTRAL_DIRECTORY)\r\n        return false;\r\n\r\n    return zip_parse_extra_fields(zip, entry);\r\n}\r\n\r\noff64_t zip_find_end_of_last_directory_entry(ar_stream *stream, struct zip_eocd64 *eocd)\r\n{\r\n    uint8_t data[ZIP_DIR_ENTRY_FIXED_SIZE];\r\n    uint64_t i;\r\n\r\n    if (!ar_seek(stream, eocd->dir_offset, SEEK_SET))\r\n        return -1;\r\n    for (i = 0; i < eocd->numentries; i++) {\r\n        if (ar_read(stream, data, sizeof(data)) != sizeof(data))\r\n            return -1;\r\n        if (uint32le(data + 0) != SIG_CENTRAL_DIRECTORY)\r\n            return -1;\r\n        if (!ar_skip(stream, uint16le(data + 28) + uint16le(data + 30) + uint16le(data + 32)))\r\n            return -1;\r\n    }\r\n\r\n    return ar_tell(stream);\r\n}\r\n\r\nbool zip_parse_end_of_central_directory(ar_stream *stream, struct zip_eocd64 *eocd)\r\n{\r\n    uint8_t data[56];\r\n    if (ar_read(stream, data, ZIP_END_OF_CENTRAL_DIR_SIZE) != ZIP_END_OF_CENTRAL_DIR_SIZE)\r\n        return false;\r\n\r\n    eocd->signature = uint32le(data + 0);\r\n    eocd->diskno = uint16le(data + 4);\r\n    eocd->diskno_dir = uint16le(data + 6);\r\n    eocd->numentries_disk = uint16le(data + 8);\r\n    eocd->numentries = uint16le(data + 10);\r\n    eocd->dir_size = uint32le(data + 12);\r\n    eocd->dir_offset = uint32le(data + 16);\r\n    eocd->commentlen = uint16le(data + 20);\r\n\r\n    if (eocd->signature != SIG_END_OF_CENTRAL_DIRECTORY)\r\n        return false;\r\n\r\n    /* try to locate the ZIP64 end of central directory */\r\n    if (!ar_skip(stream, -42))\r\n        return eocd->dir_size < 20;\r\n    if (ar_read(stream, data, 20) != 20)\r\n        return false;\r\n    if (uint32le(data + 0) != SIG_END_OF_CENTRAL_DIRECTORY_64_LOCATOR)\r\n        return true;\r\n    if ((eocd->diskno != UINT16_MAX && uint32le(data + 4) != eocd->diskno) || uint32le(data + 16) != 1) {\r\n        warn(\"Archive spanning isn't supported\");\r\n        return false;\r\n    }\r\n    if (!ar_seek(stream, (off64_t)uint64le(data + 8), SEEK_SET))\r\n        return false;\r\n    if (ar_read(stream, data, 56) != 56)\r\n        return false;\r\n\r\n    /* use data from ZIP64 end of central directory (when necessary) */\r\n    eocd->signature = uint32le(data + 0);\r\n    eocd->version = uint16le(data + 12);\r\n    eocd->min_version = uint16le(data + 14);\r\n    if (eocd->diskno == UINT16_MAX)\r\n        eocd->diskno = uint32le(data + 16);\r\n    if (eocd->diskno_dir == UINT16_MAX)\r\n        eocd->diskno_dir = uint32le(data + 20);\r\n    if (eocd->numentries_disk == UINT16_MAX)\r\n        eocd->numentries_disk = uint64le(data + 24);\r\n    if (eocd->numentries == UINT16_MAX)\r\n        eocd->numentries = uint64le(data + 32);\r\n    if (eocd->dir_size == UINT32_MAX)\r\n        eocd->dir_size = uint64le(data + 40);\r\n    if (eocd->dir_offset == UINT32_MAX)\r\n        eocd->dir_offset = (off64_t)uint64le(data + 48);\r\n\r\n    if (eocd->signature != SIG_END_OF_CENTRAL_DIRECTORY_64)\r\n        return false;\r\n    if (eocd->diskno != eocd->diskno_dir || eocd->numentries != eocd->numentries_disk) {\r\n        warn(\"Archive spanning isn't supported\");\r\n        return false;\r\n    }\r\n    if (uint64le(data + 4) > 44)\r\n        log(\"ZIP64 extensible data sector present @\" PRIi64, ar_tell(stream));\r\n\r\n    return true;\r\n}\r\n\r\noff64_t zip_find_end_of_central_directory(ar_stream *stream)\r\n{\r\n    uint8_t data[512];\r\n    off64_t filesize;\r\n    int fromend = 0;\r\n    int count, i;\r\n\r\n    if (!ar_seek(stream, 0, SEEK_END))\r\n        return -1;\r\n    filesize = ar_tell(stream);\r\n\r\n    while (fromend < UINT16_MAX + ZIP_END_OF_CENTRAL_DIR_SIZE && fromend < filesize) {\r\n        count = (int)(filesize - fromend < sizeof(data) ? filesize - fromend : sizeof(data));\r\n        fromend += count;\r\n        if (count < ZIP_END_OF_CENTRAL_DIR_SIZE)\r\n            return -1;\r\n        if (!ar_seek(stream, -fromend, SEEK_END))\r\n            return -1;\r\n        if (ar_read(stream, data, count) != (size_t)count)\r\n            return -1;\r\n        for (i = count - ZIP_END_OF_CENTRAL_DIR_SIZE; i >= 0; i--) {\r\n            if (uint32le(data + i) == SIG_END_OF_CENTRAL_DIRECTORY)\r\n                return filesize - fromend + i;\r\n        }\r\n        fromend -= ZIP_END_OF_CENTRAL_DIR_SIZE - 1;\r\n    }\r\n\r\n    return -1;\r\n}\r\n\r\nconst char *zip_get_name(ar_archive *ar)\r\n{\r\n    ar_archive_zip *zip = (ar_archive_zip *)ar;\r\n    if (!zip->entry.name) {\r\n        struct zip_entry entry;\r\n        char *name;\r\n\r\n        if (zip->dir.end_offset >= 0) {\r\n            if (!ar_seek(ar->stream, ar->entry_offset, SEEK_SET))\r\n                return NULL;\r\n            if (!zip_parse_directory_entry(zip, &entry))\r\n                return NULL;\r\n            if (!ar_seek(ar->stream, ar->entry_offset + ZIP_DIR_ENTRY_FIXED_SIZE, SEEK_SET))\r\n                return NULL;\r\n        }\r\n        else {\r\n            if (!ar_seek(ar->stream, zip->entry.offset, SEEK_SET))\r\n                return NULL;\r\n            if (!zip_parse_local_file_entry(zip, &entry))\r\n                return NULL;\r\n            if (!ar_seek(ar->stream, ar->entry_offset + ZIP_LOCAL_ENTRY_FIXED_SIZE, SEEK_SET))\r\n                return NULL;\r\n        }\r\n\r\n        name = malloc(entry.namelen + 1);\r\n        if (!name || ar_read(ar->stream, name, entry.namelen) != entry.namelen) {\r\n            free(name);\r\n            return NULL;\r\n        }\r\n        name[entry.namelen] = '\\0';\r\n\r\n        if ((entry.flags & (1 << 11))) {\r\n            zip->entry.name = name;\r\n        }\r\n        else {\r\n            zip->entry.name = ar_conv_dos_to_utf8(name);\r\n            free(name);\r\n        }\r\n        /* normalize path separators */\r\n        if (zip->entry.name) {\r\n            char *p = zip->entry.name;\r\n            while ((p = strchr(p, '\\\\')) != NULL) {\r\n                *p = '/';\r\n            }\r\n        }\r\n    }\r\n    return zip->entry.name;\r\n}\r\n"
  },
  {
    "path": "ext/unarr/zip/uncompress-zip.c",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n#include \"zip.h\"\r\n\r\n#define ERR_UNCOMP UINT32_MAX\r\n\r\nstatic bool zip_fill_input_buffer(ar_archive_zip *zip)\r\n{\r\n    struct ar_archive_zip_uncomp *uncomp = &zip->uncomp;\r\n    size_t count;\r\n\r\n    if (uncomp->input.offset) {\r\n        memmove(&uncomp->input.data[0], &uncomp->input.data[uncomp->input.offset], uncomp->input.bytes_left);\r\n        uncomp->input.offset = 0;\r\n    }\r\n    count = sizeof(uncomp->input.data) - uncomp->input.bytes_left;\r\n    if (count > zip->progress.data_left)\r\n        count = zip->progress.data_left;\r\n    if (ar_read(zip->super.stream, &uncomp->input.data[uncomp->input.bytes_left], count) != count) {\r\n        warn(\"Unexpected EOF during decompression (invalid data size?)\");\r\n        return false;\r\n    }\r\n    zip->progress.data_left -= count;\r\n    uncomp->input.bytes_left += (uint16_t)count;\r\n    uncomp->input.at_eof = !zip->progress.data_left;\r\n\r\n    return true;\r\n}\r\n\r\n/***** Deflate compression *****/\r\n\r\n#ifdef HAVE_ZLIB\r\nstatic void *gZlib_Alloc(void *opaque, uInt count, uInt size) { (void)opaque; return calloc(count, size); }\r\nstatic void gZlib_Free(void *opaque, void *ptr) { (void)opaque; free(ptr); }\r\n\r\nstatic bool zip_init_uncompress_deflate(struct ar_archive_zip_uncomp *uncomp)\r\n{\r\n    int err;\r\n\r\n    uncomp->state.zstream.zalloc = gZlib_Alloc;\r\n    uncomp->state.zstream.zfree = gZlib_Free;\r\n    uncomp->state.zstream.opaque = NULL;\r\n\r\n    err = inflateInit2(&uncomp->state.zstream, -15);\r\n    return err == Z_OK;\r\n}\r\n\r\nstatic uint32_t zip_uncompress_data_deflate(struct ar_archive_zip_uncomp *uncomp, void *buffer, uint32_t buffer_size, bool is_last_chunk)\r\n{\r\n    int err;\r\n\r\n    uncomp->state.zstream.next_in = &uncomp->input.data[uncomp->input.offset];\r\n    uncomp->state.zstream.avail_in = uncomp->input.bytes_left;\r\n    uncomp->state.zstream.next_out = buffer;\r\n    uncomp->state.zstream.avail_out = buffer_size;\r\n\r\n    err = inflate(&uncomp->state.zstream, Z_SYNC_FLUSH);\r\n\r\n    uncomp->input.offset += uncomp->input.bytes_left - (uint16_t)uncomp->state.zstream.avail_in;\r\n    uncomp->input.bytes_left = (uint16_t)uncomp->state.zstream.avail_in;\r\n\r\n    if (err != Z_OK && err != Z_STREAM_END) {\r\n        warn(\"Unexpected ZLIB error %d\", err);\r\n        return ERR_UNCOMP;\r\n    }\r\n    if (err == Z_STREAM_END && (!is_last_chunk || uncomp->state.zstream.avail_out)) {\r\n        warn(\"Premature EOS in Deflate stream\");\r\n        return ERR_UNCOMP;\r\n    }\r\n\r\n    return buffer_size - uncomp->state.zstream.avail_out;\r\n}\r\n\r\nstatic void zip_clear_uncompress_deflate(struct ar_archive_zip_uncomp *uncomp)\r\n{\r\n    inflateEnd(&uncomp->state.zstream);\r\n}\r\n#endif\r\n\r\n/***** Deflate(64) compression *****/\r\n\r\nstatic bool zip_init_uncompress_deflate64(struct ar_archive_zip_uncomp *uncomp, bool deflate64)\r\n{\r\n    uncomp->state.inflate = inflate_create(deflate64);\r\n\r\n    return uncomp->state.inflate != NULL;\r\n}\r\n\r\nstatic uint32_t zip_uncompress_data_deflate64(struct ar_archive_zip_uncomp *uncomp, void *buffer, uint32_t buffer_size, bool is_last_chunk)\r\n{\r\n    size_t avail_in = uncomp->input.bytes_left;\r\n    size_t avail_out = buffer_size;\r\n\r\n    int result = inflate_process(uncomp->state.inflate, &uncomp->input.data[uncomp->input.offset], &avail_in, buffer, &avail_out);\r\n\r\n    uncomp->input.offset += uncomp->input.bytes_left - (uint16_t)avail_in;\r\n    uncomp->input.bytes_left = (uint16_t)avail_in;\r\n\r\n    if (result && result != EOF) {\r\n        warn(\"Unexpected Inflate error %d\", result);\r\n        return ERR_UNCOMP;\r\n    }\r\n    if (result == EOF && (!is_last_chunk || avail_out)) {\r\n        warn(\"Premature EOS in Deflate stream\");\r\n        return ERR_UNCOMP;\r\n    }\r\n\r\n    return buffer_size - (uint32_t)avail_out;\r\n}\r\n\r\nstatic void zip_clear_uncompress_deflate64(struct ar_archive_zip_uncomp *uncomp)\r\n{\r\n    inflate_free(uncomp->state.inflate);\r\n}\r\n\r\n/***** BZIP2 compression *****/\r\n\r\n#ifdef HAVE_BZIP2\r\nstatic void *gBzip2_Alloc(void *opaque, int count, int size) { (void)opaque; return calloc(count, size); }\r\nstatic void gBzip2_Free(void *opaque, void *ptr) { (void)opaque; free(ptr); }\r\n\r\nstatic bool zip_init_uncompress_bzip2(struct ar_archive_zip_uncomp *uncomp)\r\n{\r\n    int err;\r\n\r\n    uncomp->state.bstream.bzalloc = gBzip2_Alloc;\r\n    uncomp->state.bstream.bzfree = gBzip2_Free;\r\n    uncomp->state.bstream.opaque = NULL;\r\n\r\n    err = BZ2_bzDecompressInit(&uncomp->state.bstream, 0, 0);\r\n    return err == BZ_OK;\r\n}\r\n\r\nstatic uint32_t zip_uncompress_data_bzip2(struct ar_archive_zip_uncomp *uncomp, void *buffer, uint32_t buffer_size, bool is_last_chunk)\r\n{\r\n    int err;\r\n\r\n    uncomp->state.bstream.next_in = (char *)&uncomp->input.data[uncomp->input.offset];\r\n    uncomp->state.bstream.avail_in = uncomp->input.bytes_left;\r\n    uncomp->state.bstream.next_out = (char *)buffer;\r\n    uncomp->state.bstream.avail_out = buffer_size;\r\n\r\n    err = BZ2_bzDecompress(&uncomp->state.bstream);\r\n\r\n    uncomp->input.offset += uncomp->input.bytes_left - (uint16_t)uncomp->state.bstream.avail_in;\r\n    uncomp->input.bytes_left = (uint16_t)uncomp->state.bstream.avail_in;\r\n\r\n    if (err != BZ_OK && err != BZ_STREAM_END) {\r\n        warn(\"Unexpected BZIP2 error %d\", err);\r\n        return ERR_UNCOMP;\r\n    }\r\n    if (err == BZ_STREAM_END && (!is_last_chunk || uncomp->state.bstream.avail_out)) {\r\n        warn(\"Premature EOS in BZIP2 stream\");\r\n        return ERR_UNCOMP;\r\n    }\r\n\r\n    return buffer_size - uncomp->state.bstream.avail_out;\r\n}\r\n\r\nstatic void zip_clear_uncompress_bzip2(struct ar_archive_zip_uncomp *uncomp)\r\n{\r\n    BZ2_bzDecompressEnd(&uncomp->state.bstream);\r\n}\r\n#endif\r\n\r\n/***** LZMA compression *****/\r\n\r\nstatic void *gLzma_Alloc(void *self, size_t size) { (void)self; return malloc(size); }\r\nstatic void gLzma_Free(void *self, void *ptr) { (void)self; free(ptr); }\r\n\r\nstatic bool zip_init_uncompress_lzma(struct ar_archive_zip_uncomp *uncomp, uint16_t flags)\r\n{\r\n    uncomp->state.lzma.alloc.Alloc = gLzma_Alloc;\r\n    uncomp->state.lzma.alloc.Free = gLzma_Free;\r\n    uncomp->state.lzma.finish = (flags & (1 << 1)) ? LZMA_FINISH_END : LZMA_FINISH_ANY;\r\n    LzmaDec_Construct(&uncomp->state.lzma.dec);\r\n    return true;\r\n}\r\n\r\nstatic uint32_t zip_uncompress_data_lzma(struct ar_archive_zip_uncomp *uncomp, void *buffer, uint32_t buffer_size, bool is_last_chunk)\r\n{\r\n    SizeT srclen, dstlen;\r\n    ELzmaStatus status;\r\n    ELzmaFinishMode finish;\r\n    SRes res;\r\n\r\n    if (!uncomp->state.lzma.dec.dic) {\r\n        uint8_t propsize;\r\n        if (uncomp->input.bytes_left < 9) {\r\n            warn(\"Insufficient data in compressed stream\");\r\n            return ERR_UNCOMP;\r\n        }\r\n        propsize = uncomp->input.data[uncomp->input.offset + 2];\r\n        if (uncomp->input.data[uncomp->input.offset + 3] != 0 || uncomp->input.bytes_left < 4 + propsize) {\r\n            warn(\"Insufficient data in compressed stream\");\r\n            return ERR_UNCOMP;\r\n        }\r\n        res = LzmaDec_Allocate(&uncomp->state.lzma.dec, &uncomp->input.data[uncomp->input.offset + 4], propsize, &uncomp->state.lzma.alloc);\r\n        uncomp->input.offset += 4 + propsize;\r\n        uncomp->input.bytes_left -= 4 + propsize;\r\n        if (res != SZ_OK)\r\n            return ERR_UNCOMP;\r\n        LzmaDec_Init(&uncomp->state.lzma.dec);\r\n    }\r\n\r\n    srclen = uncomp->input.bytes_left;\r\n    dstlen = buffer_size;\r\n    finish = uncomp->input.at_eof && is_last_chunk ? uncomp->state.lzma.finish : LZMA_FINISH_ANY;\r\n    res = LzmaDec_DecodeToBuf(&uncomp->state.lzma.dec, buffer, &dstlen, &uncomp->input.data[uncomp->input.offset], &srclen, finish, &status);\r\n\r\n    uncomp->input.offset += (uint16_t)srclen;\r\n    uncomp->input.bytes_left -= (uint16_t)srclen;\r\n\r\n    if (res != SZ_OK || (srclen == 0 && dstlen == 0)) {\r\n        warn(\"Unexpected LZMA error %d\", res);\r\n        return ERR_UNCOMP;\r\n    }\r\n    if (status == LZMA_STATUS_FINISHED_WITH_MARK && (!is_last_chunk || dstlen != buffer_size)) {\r\n        warn(\"Premature EOS in LZMA stream\");\r\n        return ERR_UNCOMP;\r\n    }\r\n\r\n    return (uint32_t)dstlen;\r\n}\r\n\r\nstatic void zip_clear_uncompress_lzma(struct ar_archive_zip_uncomp *uncomp)\r\n{\r\n    LzmaDec_Free(&uncomp->state.lzma.dec, &uncomp->state.lzma.alloc);\r\n}\r\n\r\n/***** PPMd compression *****/\r\n\r\nstatic void *gPpmd_Alloc(void *self, size_t size) { (void)self; return malloc(size); }\r\nstatic void gPpmd_Free(void *self, void *ptr) { (void)self; free(ptr); }\r\n\r\nstatic Byte gPpmd_ByteIn_Read(void *p)\r\n{\r\n    struct ByteReader *self = p;\r\n    if (!self->input->bytes_left && (!self->zip->progress.data_left || !zip_fill_input_buffer(self->zip)))\r\n        return 0xFF;\r\n    self->input->bytes_left--;\r\n    return self->input->data[self->input->offset++];\r\n}\r\n\r\nstatic bool zip_init_uncompress_ppmd(ar_archive_zip *zip)\r\n{\r\n    struct ar_archive_zip_uncomp *uncomp = &zip->uncomp;\r\n    uncomp->state.ppmd8.alloc.Alloc = gPpmd_Alloc;\r\n    uncomp->state.ppmd8.alloc.Free = gPpmd_Free;\r\n    uncomp->state.ppmd8.bytein.super.Read = gPpmd_ByteIn_Read;\r\n    uncomp->state.ppmd8.bytein.input = &uncomp->input;\r\n    uncomp->state.ppmd8.bytein.zip = zip;\r\n    uncomp->state.ppmd8.ctx.Stream.In = &uncomp->state.ppmd8.bytein.super;\r\n    Ppmd8_Construct(&uncomp->state.ppmd8.ctx);\r\n    return true;\r\n}\r\n\r\nstatic uint32_t zip_uncompress_data_ppmd(struct ar_archive_zip_uncomp *uncomp, void *buffer, uint32_t buffer_size, bool is_last_chunk)\r\n{\r\n    uint32_t bytes_done = 0;\r\n\r\n    if (!uncomp->state.ppmd8.ctx.Base) {\r\n        uint8_t order, size, method;\r\n        if (uncomp->input.bytes_left < 2) {\r\n            warn(\"Insufficient data in compressed stream\");\r\n            return ERR_UNCOMP;\r\n        }\r\n        order = (uncomp->input.data[uncomp->input.offset] & 0x0F) + 1;\r\n        size = ((uncomp->input.data[uncomp->input.offset] >> 4) | ((uncomp->input.data[uncomp->input.offset + 1] << 4) & 0xFF));\r\n        method = uncomp->input.data[uncomp->input.offset + 1] >> 4;\r\n        uncomp->input.bytes_left -= 2;\r\n        uncomp->input.offset += 2;\r\n        if (order < 2 || method > 2) {\r\n            warn(\"Invalid PPMd data stream\");\r\n            return ERR_UNCOMP;\r\n        }\r\n#ifndef PPMD8_FREEZE_SUPPORT\r\n        if (order == 2) {\r\n            warn(\"PPMd freeze method isn't supported\");\r\n            return ERR_UNCOMP;\r\n        }\r\n#endif\r\n        if (!Ppmd8_Alloc(&uncomp->state.ppmd8.ctx, (size + 1) << 20, &uncomp->state.ppmd8.alloc))\r\n            return ERR_UNCOMP;\r\n        if (!Ppmd8_RangeDec_Init(&uncomp->state.ppmd8.ctx))\r\n            return ERR_UNCOMP;\r\n        Ppmd8_Init(&uncomp->state.ppmd8.ctx, order, method);\r\n    }\r\n\r\n    while (bytes_done < buffer_size) {\r\n        int symbol = Ppmd8_DecodeSymbol(&uncomp->state.ppmd8.ctx);\r\n        if (symbol < 0) {\r\n            warn(\"Invalid PPMd data stream\");\r\n            return ERR_UNCOMP;\r\n        }\r\n        ((uint8_t *)buffer)[bytes_done++] = (uint8_t)symbol;\r\n    }\r\n\r\n    if (is_last_chunk) {\r\n        int symbol = Ppmd8_DecodeSymbol(&uncomp->state.ppmd8.ctx);\r\n        if (symbol != -1 || !Ppmd8_RangeDec_IsFinishedOK(&uncomp->state.ppmd8.ctx)) {\r\n            warn(\"Invalid PPMd data stream\");\r\n            return ERR_UNCOMP;\r\n        }\r\n    }\r\n\r\n    return bytes_done;\r\n}\r\n\r\nstatic void zip_clear_uncompress_ppmd(struct ar_archive_zip_uncomp *uncomp)\r\n{\r\n    Ppmd8_Free(&uncomp->state.ppmd8.ctx, &uncomp->state.ppmd8.alloc);\r\n}\r\n\r\n/***** common decompression handling *****/\r\n\r\nstatic bool zip_init_uncompress(ar_archive_zip *zip)\r\n{\r\n    struct ar_archive_zip_uncomp *uncomp = &zip->uncomp;\r\n    if (uncomp->initialized)\r\n        return true;\r\n    memset(uncomp, 0, sizeof(*uncomp));\r\n    if (zip->entry.method == METHOD_DEFLATE) {\r\n#ifdef HAVE_ZLIB\r\n        if (zip_init_uncompress_deflate(uncomp)) {\r\n            uncomp->uncompress_data = zip_uncompress_data_deflate;\r\n            uncomp->clear_state = zip_clear_uncompress_deflate;\r\n        }\r\n#else\r\n        if (zip_init_uncompress_deflate64(uncomp, false)) {\r\n            uncomp->uncompress_data = zip_uncompress_data_deflate64;\r\n            uncomp->clear_state = zip_clear_uncompress_deflate64;\r\n        }\r\n#endif\r\n    }\r\n    else if (zip->entry.method == METHOD_DEFLATE64) {\r\n        if (zip_init_uncompress_deflate64(uncomp, true)) {\r\n            uncomp->uncompress_data = zip_uncompress_data_deflate64;\r\n            uncomp->clear_state = zip_clear_uncompress_deflate64;\r\n        }\r\n    }\r\n    else if (zip->entry.method == METHOD_BZIP2) {\r\n#ifdef HAVE_BZIP2\r\n        if (zip_init_uncompress_bzip2(uncomp)) {\r\n            uncomp->uncompress_data = zip_uncompress_data_bzip2;\r\n            uncomp->clear_state = zip_clear_uncompress_bzip2;\r\n        }\r\n#else\r\n        warn(\"BZIP2 support requires BZIP2 (define HAVE_BZIP2)\");\r\n#endif\r\n    }\r\n    else if (zip->entry.method == METHOD_LZMA) {\r\n        if (zip_init_uncompress_lzma(uncomp, zip->entry.flags)) {\r\n            uncomp->uncompress_data = zip_uncompress_data_lzma;\r\n            uncomp->clear_state = zip_clear_uncompress_lzma;\r\n        }\r\n    }\r\n    else if (zip->entry.method == METHOD_PPMD) {\r\n        if (zip_init_uncompress_ppmd(zip)) {\r\n            uncomp->uncompress_data = zip_uncompress_data_ppmd;\r\n            uncomp->clear_state = zip_clear_uncompress_ppmd;\r\n        }\r\n    }\r\n    else\r\n        warn(\"Unsupported compression method %d\", zip->entry.method);\r\n    uncomp->initialized = uncomp->uncompress_data != NULL && uncomp->clear_state != NULL;\r\n    return uncomp->initialized;\r\n}\r\n\r\nvoid zip_clear_uncompress(struct ar_archive_zip_uncomp *uncomp)\r\n{\r\n    if (!uncomp->initialized)\r\n        return;\r\n    uncomp->clear_state(uncomp);\r\n    uncomp->initialized = false;\r\n}\r\n\r\nbool zip_uncompress_part(ar_archive_zip *zip, void *buffer, size_t buffer_size)\r\n{\r\n    struct ar_archive_zip_uncomp *uncomp = &zip->uncomp;\r\n    uint32_t count;\r\n\r\n    if (!zip_init_uncompress(zip))\r\n        return false;\r\n\r\n    for (;;) {\r\n        if (buffer_size == 0)\r\n            return true;\r\n\r\n        if (uncomp->input.bytes_left < sizeof(uncomp->input.data) / 2 && zip->progress.data_left) {\r\n            if (!zip_fill_input_buffer(zip))\r\n                return false;\r\n        }\r\n\r\n        count = buffer_size >= UINT32_MAX ? UINT32_MAX - 1 : (uint32_t)buffer_size;\r\n        count = uncomp->uncompress_data(uncomp, buffer, count, zip->progress.bytes_done + count == zip->super.entry_size_uncompressed);\r\n        if (count == ERR_UNCOMP)\r\n            return false;\r\n        if (count == 0 && !zip->progress.data_left) {\r\n            warn(\"Insufficient data in compressed stream\");\r\n            return false;\r\n        }\r\n        zip->progress.bytes_done += count;\r\n        buffer = (uint8_t *)buffer + count;\r\n        buffer_size -= count;\r\n    }\r\n}\r\n"
  },
  {
    "path": "ext/unarr/zip/zip.c",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n#include \"zip.h\"\r\n\r\nstatic void zip_close(ar_archive *ar)\r\n{\r\n    ar_archive_zip *zip = (ar_archive_zip *)ar;\r\n    free(zip->entry.name);\r\n    zip_clear_uncompress(&zip->uncomp);\r\n}\r\n\r\nstatic bool zip_parse_local_entry(ar_archive *ar, off64_t offset)\r\n{\r\n    ar_archive_zip *zip = (ar_archive_zip *)ar;\r\n    struct zip_entry entry;\r\n\r\n    offset = zip_find_next_local_file_entry(ar->stream, offset);\r\n    if (offset < 0) {\r\n        if (ar->entry_offset_next)\r\n            ar->at_eof = true;\r\n        else\r\n            warn(\"Work around failed, no entries found in this file\");\r\n        return false;\r\n    }\r\n    if (!ar_seek(ar->stream, offset, SEEK_SET)) {\r\n        warn(\"Couldn't seek to offset %\" PRIi64, offset);\r\n        return false;\r\n    }\r\n    if (!zip_parse_local_file_entry(zip, &entry))\r\n        return false;\r\n\r\n    ar->entry_offset = offset;\r\n    ar->entry_offset_next = offset + ZIP_LOCAL_ENTRY_FIXED_SIZE + entry.namelen + entry.extralen + (off64_t)entry.datasize;\r\n    if (ar->entry_offset_next <= ar->entry_offset) {\r\n        warn(\"Compressed size is too large (%\" PRIu64 \")\", entry.datasize);\r\n        return false;\r\n    }\r\n    ar->entry_size_uncompressed = (size_t)entry.uncompressed;\r\n    ar->entry_filetime = ar_conv_dosdate_to_filetime(entry.dosdate);\r\n\r\n    zip->entry.offset = offset;\r\n    zip->entry.method = entry.method;\r\n    zip->entry.flags = entry.flags;\r\n    zip->entry.crc = entry.crc;\r\n    free(zip->entry.name);\r\n    zip->entry.name = NULL;\r\n    zip->entry.dosdate = entry.dosdate;\r\n\r\n    zip->progress.crc = 0;\r\n    zip->progress.bytes_done = 0;\r\n    zip->progress.data_left = (size_t)entry.datasize;\r\n    zip_clear_uncompress(&zip->uncomp);\r\n\r\n    if (entry.datasize == 0 && ar_entry_get_name(ar) && *zip->entry.name && zip->entry.name[strlen(zip->entry.name) - 1] == '/') {\r\n        log(\"Skipping directory entry \\\"%s\\\"\", zip->entry.name);\r\n        return zip_parse_local_entry(ar, ar->entry_offset_next);\r\n    }\r\n    if (entry.datasize == 0 && entry.uncompressed == 0 && (entry.flags & (1 << 3))) {\r\n        warn(\"Deferring sizes to data descriptor isn't supported\");\r\n        ar->entry_size_uncompressed = 1;\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nstatic bool zip_parse_entry(ar_archive *ar, off64_t offset)\r\n{\r\n    ar_archive_zip *zip = (ar_archive_zip *)ar;\r\n    struct zip_entry entry;\r\n\r\n    if (offset >= zip->dir.end_offset) {\r\n        ar->at_eof = true;\r\n        return false;\r\n    }\r\n    if (!ar_seek(ar->stream, offset, SEEK_SET)) {\r\n        warn(\"Couldn't seek to offset %\" PRIi64, offset);\r\n        return false;\r\n    }\r\n    if (!zip_parse_directory_entry(zip, &entry)) {\r\n        warn(\"Couldn't read directory entry @%\" PRIi64, offset);\r\n        return false;\r\n    }\r\n\r\n    ar->entry_offset = offset;\r\n    ar->entry_offset_next = offset + ZIP_DIR_ENTRY_FIXED_SIZE + entry.namelen + entry.extralen + entry.commentlen;\r\n    ar->entry_size_uncompressed = (size_t)entry.uncompressed;\r\n    ar->entry_filetime = ar_conv_dosdate_to_filetime(entry.dosdate);\r\n\r\n    zip->entry.offset = entry.header_offset;\r\n    zip->entry.method = entry.method;\r\n    zip->entry.flags = entry.flags;\r\n    zip->entry.crc = entry.crc;\r\n    free(zip->entry.name);\r\n    zip->entry.name = NULL;\r\n    zip->entry.dosdate = entry.dosdate;\r\n\r\n    zip->progress.crc = 0;\r\n    zip->progress.bytes_done = 0;\r\n    zip->progress.data_left = (size_t)entry.datasize;\r\n    zip_clear_uncompress(&zip->uncomp);\r\n\r\n    if (entry.datasize == 0 && ((entry.version >> 8) == 0 || (entry.version >> 8) == 3) && (entry.attr_external & 0x40000010)) {\r\n        log(\"Skipping directory entry \\\"%s\\\"\", zip_get_name(ar));\r\n        return zip_parse_entry(ar, ar->entry_offset_next);\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nstatic bool zip_copy_stored(ar_archive_zip *zip, void *buffer, size_t count)\r\n{\r\n    if (count > zip->progress.data_left) {\r\n        warn(\"Unexpected EOS in stored data\");\r\n        return false;\r\n    }\r\n    if (ar_read(zip->super.stream, buffer, count) != count) {\r\n        warn(\"Unexpected EOF in stored data\");\r\n        return false;\r\n    }\r\n    zip->progress.data_left -= count;\r\n    zip->progress.bytes_done += count;\r\n    return true;\r\n}\r\n\r\nstatic bool zip_uncompress(ar_archive *ar, void *buffer, size_t count)\r\n{\r\n    ar_archive_zip *zip = (ar_archive_zip *)ar;\r\n    if (zip->progress.bytes_done == 0) {\r\n        if ((zip->entry.flags & ((1 << 0) | (1 << 6)))) {\r\n            warn(\"Encrypted archives aren't supported\");\r\n            return false;\r\n        }\r\n        if (!zip_seek_to_compressed_data(zip)) {\r\n            warn(\"Couldn't find data for file\");\r\n            return false;\r\n        }\r\n    }\r\n    if (count > ar->entry_size_uncompressed - zip->progress.bytes_done) {\r\n        warn(\"Requesting too much data (%\" PRIuPTR \" < %\" PRIuPTR \")\", ar->entry_size_uncompressed - zip->progress.bytes_done, count);\r\n        return false;\r\n    }\r\n    if (zip->entry.method == METHOD_STORE) {\r\n        if (!zip_copy_stored(zip, buffer, count))\r\n            return false;\r\n    }\r\n    else if (zip->deflatedonly && zip->entry.method != METHOD_DEFLATE) {\r\n        warn(\"Only store and deflate compression methods are allowed\");\r\n        return false;\r\n    }\r\n    else {\r\n        if (!zip_uncompress_part(zip, buffer, count))\r\n            return false;\r\n    }\r\n\r\n    zip->progress.crc = ar_crc32(zip->progress.crc, buffer, count);\r\n    if (zip->progress.bytes_done < ar->entry_size_uncompressed)\r\n        return true;\r\n    if (zip->uncomp.initialized ? !zip->uncomp.input.at_eof || zip->uncomp.input.bytes_left : zip->progress.data_left)\r\n        log(\"Compressed block has more data than required\");\r\n    if (zip->progress.crc != zip->entry.crc) {\r\n        warn(\"Checksum of extracted data doesn't match\");\r\n        return false;\r\n    }\r\n    return true;\r\n}\r\n\r\nsize_t zip_get_global_comment(ar_archive *ar, void *buffer, size_t count)\r\n{\r\n    ar_archive_zip *zip = (ar_archive_zip *)ar;\r\n    if (!zip->comment_size)\r\n        return 0;\r\n    if (!buffer)\r\n        return zip->comment_size;\r\n    if (!ar_seek(ar->stream, zip->comment_offset, SEEK_SET))\r\n        return 0;\r\n    if (count > zip->comment_size)\r\n        count = zip->comment_size;\r\n    return ar_read(ar->stream, buffer, count);\r\n}\r\n\r\nar_archive *ar_open_zip_archive(ar_stream *stream, bool deflatedonly)\r\n{\r\n    ar_archive *ar;\r\n    ar_archive_zip *zip;\r\n    struct zip_eocd64 eocd = { 0 };\r\n\r\n    off64_t offset = zip_find_end_of_central_directory(stream);\r\n    if (offset < 0)\r\n        return NULL;\r\n    if (!ar_seek(stream, offset, SEEK_SET))\r\n        return NULL;\r\n    if (!zip_parse_end_of_central_directory(stream, &eocd))\r\n        return NULL;\r\n\r\n    ar = ar_open_archive(stream, sizeof(ar_archive_zip), zip_close, zip_parse_entry, zip_get_name, zip_uncompress, zip_get_global_comment, eocd.dir_offset);\r\n    if (!ar)\r\n        return NULL;\r\n\r\n    zip = (ar_archive_zip *)ar;\r\n    zip->dir.end_offset = zip_find_end_of_last_directory_entry(stream, &eocd);\r\n    if (zip->dir.end_offset < 0) {\r\n        warn(\"Couldn't read central directory @%\" PRIi64 \", trying to work around...\", eocd.dir_offset);\r\n        ar->parse_entry = zip_parse_local_entry;\r\n        ar->entry_offset_first = ar->entry_offset_next = 0;\r\n    }\r\n    zip->deflatedonly = deflatedonly;\r\n    zip->comment_offset = offset + ZIP_END_OF_CENTRAL_DIR_SIZE;\r\n    zip->comment_size = eocd.commentlen;\r\n\r\n    return ar;\r\n}\r\n"
  },
  {
    "path": "ext/unarr/zip/zip.h",
    "content": "/* Copyright 2015 the unarr project authors (see AUTHORS file).\r\n   License: LGPLv3 */\r\n\r\n#ifndef zip_zip_h\r\n#define zip_zip_h\r\n\r\n#include \"../common/unarr-imp.h\"\r\n\r\n#ifdef HAVE_ZLIB\r\n#include <zlib.h>\r\n#endif\r\n#include \"inflate.h\"\r\n#ifdef HAVE_BZIP2\r\n#include <bzlib.h>\r\n#endif\r\n#include \"../lzmasdk/LzmaDec.h\"\r\n#include \"../lzmasdk/Ppmd8.h\"\r\n\r\ntypedef struct ar_archive_zip_s ar_archive_zip;\r\n\r\n/***** parse-zip *****/\r\n\r\nenum zip_signatures {\r\n    SIG_LOCAL_FILE_HEADER = 0x04034B50,\r\n    SIG_CENTRAL_DIRECTORY = 0x02014B50,\r\n    SIG_END_OF_CENTRAL_DIRECTORY_64 = 0x06064B50,\r\n    SIG_END_OF_CENTRAL_DIRECTORY_64_LOCATOR = 0x07064B50,\r\n    SIG_END_OF_CENTRAL_DIRECTORY = 0x06054B50,\r\n};\r\n\r\nenum compression_method {\r\n    METHOD_STORE = 0, METHOD_DEFLATE = 8,\r\n    METHOD_DEFLATE64 = 9, METHOD_BZIP2 = 12, METHOD_LZMA = 14,\r\n    METHOD_PPMD = 98,\r\n};\r\n\r\n#define ZIP_LOCAL_ENTRY_FIXED_SIZE 30\r\n#define ZIP_DIR_ENTRY_FIXED_SIZE 46\r\n#define ZIP_END_OF_CENTRAL_DIR_SIZE 22\r\n\r\nstruct zip_entry {\r\n    uint32_t signature;\r\n    uint16_t version;\r\n    uint16_t min_version;\r\n    uint16_t flags;\r\n    uint16_t method;\r\n    uint32_t dosdate;\r\n    uint32_t crc;\r\n    uint64_t datasize;\r\n    uint64_t uncompressed;\r\n    uint16_t namelen;\r\n    uint16_t extralen;\r\n    uint16_t commentlen;\r\n    uint32_t disk;\r\n    uint16_t attr_internal;\r\n    uint32_t attr_external;\r\n    off64_t header_offset;\r\n};\r\n\r\nstruct zip_eocd64 {\r\n    uint32_t signature;\r\n    uint16_t version;\r\n    uint16_t min_version;\r\n    uint32_t diskno;\r\n    uint32_t diskno_dir;\r\n    uint64_t numentries_disk;\r\n    uint64_t numentries;\r\n    uint64_t dir_size;\r\n    off64_t dir_offset;\r\n    uint16_t commentlen;\r\n};\r\n\r\nstruct ar_archive_zip_entry {\r\n    off64_t offset;\r\n    uint16_t method;\r\n    uint16_t flags;\r\n    uint32_t crc;\r\n    char *name;\r\n    uint32_t dosdate;\r\n};\r\n\r\nbool zip_seek_to_compressed_data(ar_archive_zip *zip);\r\nbool zip_parse_local_file_entry(ar_archive_zip *zip, struct zip_entry *entry);\r\noff64_t zip_find_next_local_file_entry(ar_stream *stream, off64_t offset);\r\nbool zip_parse_directory_entry(ar_archive_zip *zip, struct zip_entry *entry);\r\noff64_t zip_find_end_of_last_directory_entry(ar_stream *stream, struct zip_eocd64 *eocd);\r\nbool zip_parse_end_of_central_directory(ar_stream *stream, struct zip_eocd64 *eocd);\r\noff64_t zip_find_end_of_central_directory(ar_stream *stream);\r\nconst char *zip_get_name(ar_archive *ar);\r\n\r\n/***** uncompress-zip *****/\r\n\r\nstruct ar_archive_zip_uncomp;\r\n\r\ntypedef uint32_t (* zip_uncomp_uncompress_data_fn)(struct ar_archive_zip_uncomp *uncomp, void *buffer, uint32_t buffer_size, bool is_last_chunk);\r\ntypedef void (* zip_uncomp_clear_state_fn)(struct ar_archive_zip_uncomp *uncomp);\r\n\r\nstruct InputBuffer {\r\n    uint8_t data[4096];\r\n    uint16_t offset;\r\n    uint16_t bytes_left;\r\n    bool at_eof;\r\n};\r\n\r\nstruct ByteReader {\r\n    IByteIn super;\r\n    struct InputBuffer *input;\r\n    ar_archive_zip *zip;\r\n};\r\n\r\nstruct ar_archive_zip_uncomp {\r\n    bool initialized;\r\n    zip_uncomp_uncompress_data_fn uncompress_data;\r\n    zip_uncomp_clear_state_fn clear_state;\r\n    union {\r\n#ifdef HAVE_ZLIB\r\n        z_stream zstream;\r\n#endif\r\n        inflate_state *inflate;\r\n#ifdef HAVE_BZIP2\r\n        bz_stream bstream;\r\n#endif\r\n        struct {\r\n            CLzmaDec dec;\r\n            ELzmaFinishMode finish;\r\n            ISzAlloc alloc;\r\n        } lzma;\r\n        struct {\r\n            CPpmd8 ctx;\r\n            struct ByteReader bytein;\r\n            ISzAlloc alloc;\r\n        } ppmd8;\r\n    } state;\r\n    struct InputBuffer input;\r\n};\r\n\r\nbool zip_uncompress_part(ar_archive_zip *zip, void *buffer, size_t buffer_size);\r\nvoid zip_clear_uncompress(struct ar_archive_zip_uncomp *uncomp);\r\n\r\n/***** zip *****/\r\n\r\nstruct ar_archive_zip_dir {\r\n    /* off64_t offset; // use ar_archive::entry_offset_first */\r\n    off64_t end_offset;\r\n};\r\n\r\nstruct ar_archive_zip_progress {\r\n    size_t data_left;\r\n    size_t bytes_done;\r\n    uint32_t crc;\r\n};\r\n\r\nstruct ar_archive_zip_s {\r\n    ar_archive super;\r\n    struct ar_archive_zip_dir dir;\r\n    struct ar_archive_zip_entry entry;\r\n    struct ar_archive_zip_uncomp uncomp;\r\n    struct ar_archive_zip_progress progress;\r\n    bool deflatedonly;\r\n    off64_t comment_offset;\r\n    uint16_t comment_size;\r\n};\r\n\r\n#endif\r\n"
  },
  {
    "path": "ext/versions.txt",
    "content": "Project         Version Date         Download URL\r\n----------------------------------------------------------------------------------------------\r\nbzip2           1.0.6   2010-09-06   http://bzip.org/downloads.html\r\nCHMLib          0.40a   2009-07-02   https://github.com/jedwing/CHMLib\r\nfreetype2       2.5.5   2014-12-30   http://sourceforge.net/projects/freetype/files/freetype2/\r\njbig2dec        0.12git 2015-09-23   http://git.ghostscript.com/?p=jbig2dec.git\r\nlibjpeg-turbo   1.3.1   2014-04-20   http://sourceforge.net/projects/libjpeg-turbo/files/\r\nlibdjvu         3.5.25  2012-05-08   http://djvu.sourceforge.net/\r\nlibwebp         0.4.2   2014-10-17   https://developers.google.com/speed/webp/download\r\nlzma            9.22b   2011-04-19   http://www.7-zip.org/sdk.html\r\nopenjpeg        2.1.0   2014-04-29   https://code.google.com/p/openjpeg/wiki/Downloads?tm=2\r\nsynctex         1.16    2011-06-14   http://itexmac.sourceforge.net/SyncTeX.html\r\nunarr           trunk                https://github.com/zeniko/unarr\r\nzlib            1.2.8   2013-04-28   http://www.zlib.net/\r\n../mupdf        trunk                http://git.ghostscript.com/?p=mupdf.git\r\n"
  },
  {
    "path": "ext/zlib/adler32.c",
    "content": "/* adler32.c -- compute the Adler-32 checksum of a data stream\n * Copyright (C) 1995-2011 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/* @(#) $Id$ */\n\n#include \"zutil.h\"\n\n#define local static\n\nlocal uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));\n\n#define BASE 65521      /* largest prime smaller than 65536 */\n#define NMAX 5552\n/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */\n\n#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}\n#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);\n#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);\n#define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);\n#define DO16(buf)   DO8(buf,0); DO8(buf,8);\n\n/* use NO_DIVIDE if your processor does not do division in hardware --\n   try it both ways to see which is faster */\n#ifdef NO_DIVIDE\n/* note that this assumes BASE is 65521, where 65536 % 65521 == 15\n   (thank you to John Reiser for pointing this out) */\n#  define CHOP(a) \\\n    do { \\\n        unsigned long tmp = a >> 16; \\\n        a &= 0xffffUL; \\\n        a += (tmp << 4) - tmp; \\\n    } while (0)\n#  define MOD28(a) \\\n    do { \\\n        CHOP(a); \\\n        if (a >= BASE) a -= BASE; \\\n    } while (0)\n#  define MOD(a) \\\n    do { \\\n        CHOP(a); \\\n        MOD28(a); \\\n    } while (0)\n#  define MOD63(a) \\\n    do { /* this assumes a is not negative */ \\\n        z_off64_t tmp = a >> 32; \\\n        a &= 0xffffffffL; \\\n        a += (tmp << 8) - (tmp << 5) + tmp; \\\n        tmp = a >> 16; \\\n        a &= 0xffffL; \\\n        a += (tmp << 4) - tmp; \\\n        tmp = a >> 16; \\\n        a &= 0xffffL; \\\n        a += (tmp << 4) - tmp; \\\n        if (a >= BASE) a -= BASE; \\\n    } while (0)\n#else\n#  define MOD(a) a %= BASE\n#  define MOD28(a) a %= BASE\n#  define MOD63(a) a %= BASE\n#endif\n\n/* ========================================================================= */\nuLong ZEXPORT adler32(adler, buf, len)\n    uLong adler;\n    const Bytef *buf;\n    uInt len;\n{\n    unsigned long sum2;\n    unsigned n;\n\n    /* split Adler-32 into component sums */\n    sum2 = (adler >> 16) & 0xffff;\n    adler &= 0xffff;\n\n    /* in case user likes doing a byte at a time, keep it fast */\n    if (len == 1) {\n        adler += buf[0];\n        if (adler >= BASE)\n            adler -= BASE;\n        sum2 += adler;\n        if (sum2 >= BASE)\n            sum2 -= BASE;\n        return adler | (sum2 << 16);\n    }\n\n    /* initial Adler-32 value (deferred check for len == 1 speed) */\n    if (buf == Z_NULL)\n        return 1L;\n\n    /* in case short lengths are provided, keep it somewhat fast */\n    if (len < 16) {\n        while (len--) {\n            adler += *buf++;\n            sum2 += adler;\n        }\n        if (adler >= BASE)\n            adler -= BASE;\n        MOD28(sum2);            /* only added so many BASE's */\n        return adler | (sum2 << 16);\n    }\n\n    /* do length NMAX blocks -- requires just one modulo operation */\n    while (len >= NMAX) {\n        len -= NMAX;\n        n = NMAX / 16;          /* NMAX is divisible by 16 */\n        do {\n            DO16(buf);          /* 16 sums unrolled */\n            buf += 16;\n        } while (--n);\n        MOD(adler);\n        MOD(sum2);\n    }\n\n    /* do remaining bytes (less than NMAX, still just one modulo) */\n    if (len) {                  /* avoid modulos if none remaining */\n        while (len >= 16) {\n            len -= 16;\n            DO16(buf);\n            buf += 16;\n        }\n        while (len--) {\n            adler += *buf++;\n            sum2 += adler;\n        }\n        MOD(adler);\n        MOD(sum2);\n    }\n\n    /* return recombined sums */\n    return adler | (sum2 << 16);\n}\n\n/* ========================================================================= */\nlocal uLong adler32_combine_(adler1, adler2, len2)\n    uLong adler1;\n    uLong adler2;\n    z_off64_t len2;\n{\n    unsigned long sum1;\n    unsigned long sum2;\n    unsigned rem;\n\n    /* for negative len, return invalid adler32 as a clue for debugging */\n    if (len2 < 0)\n        return 0xffffffffUL;\n\n    /* the derivation of this formula is left as an exercise for the reader */\n    MOD63(len2);                /* assumes len2 >= 0 */\n    rem = (unsigned)len2;\n    sum1 = adler1 & 0xffff;\n    sum2 = rem * sum1;\n    MOD(sum2);\n    sum1 += (adler2 & 0xffff) + BASE - 1;\n    sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;\n    if (sum1 >= BASE) sum1 -= BASE;\n    if (sum1 >= BASE) sum1 -= BASE;\n    if (sum2 >= (BASE << 1)) sum2 -= (BASE << 1);\n    if (sum2 >= BASE) sum2 -= BASE;\n    return sum1 | (sum2 << 16);\n}\n\n/* ========================================================================= */\nuLong ZEXPORT adler32_combine(adler1, adler2, len2)\n    uLong adler1;\n    uLong adler2;\n    z_off_t len2;\n{\n    return adler32_combine_(adler1, adler2, len2);\n}\n\nuLong ZEXPORT adler32_combine64(adler1, adler2, len2)\n    uLong adler1;\n    uLong adler2;\n    z_off64_t len2;\n{\n    return adler32_combine_(adler1, adler2, len2);\n}\n"
  },
  {
    "path": "ext/zlib/compress.c",
    "content": "/* compress.c -- compress a memory buffer\n * Copyright (C) 1995-2005 Jean-loup Gailly.\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/* @(#) $Id$ */\n\n#define ZLIB_INTERNAL\n#include \"zlib.h\"\n\n/* ===========================================================================\n     Compresses the source buffer into the destination buffer. The level\n   parameter has the same meaning as in deflateInit.  sourceLen is the byte\n   length of the source buffer. Upon entry, destLen is the total size of the\n   destination buffer, which must be at least 0.1% larger than sourceLen plus\n   12 bytes. Upon exit, destLen is the actual size of the compressed buffer.\n\n     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough\n   memory, Z_BUF_ERROR if there was not enough room in the output buffer,\n   Z_STREAM_ERROR if the level parameter is invalid.\n*/\nint ZEXPORT compress2 (dest, destLen, source, sourceLen, level)\n    Bytef *dest;\n    uLongf *destLen;\n    const Bytef *source;\n    uLong sourceLen;\n    int level;\n{\n    z_stream stream;\n    int err;\n\n    stream.next_in = (z_const Bytef *)source;\n    stream.avail_in = (uInt)sourceLen;\n#ifdef MAXSEG_64K\n    /* Check for source > 64K on 16-bit machine: */\n    if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;\n#endif\n    stream.next_out = dest;\n    stream.avail_out = (uInt)*destLen;\n    if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;\n\n    stream.zalloc = (alloc_func)0;\n    stream.zfree = (free_func)0;\n    stream.opaque = (voidpf)0;\n\n    err = deflateInit(&stream, level);\n    if (err != Z_OK) return err;\n\n    err = deflate(&stream, Z_FINISH);\n    if (err != Z_STREAM_END) {\n        deflateEnd(&stream);\n        return err == Z_OK ? Z_BUF_ERROR : err;\n    }\n    *destLen = stream.total_out;\n\n    err = deflateEnd(&stream);\n    return err;\n}\n\n/* ===========================================================================\n */\nint ZEXPORT compress (dest, destLen, source, sourceLen)\n    Bytef *dest;\n    uLongf *destLen;\n    const Bytef *source;\n    uLong sourceLen;\n{\n    return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);\n}\n\n/* ===========================================================================\n     If the default memLevel or windowBits for deflateInit() is changed, then\n   this function needs to be updated.\n */\nuLong ZEXPORT compressBound (sourceLen)\n    uLong sourceLen;\n{\n    return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +\n           (sourceLen >> 25) + 13;\n}\n"
  },
  {
    "path": "ext/zlib/crc32.c",
    "content": "/* crc32.c -- compute the CRC-32 of a data stream\n * Copyright (C) 1995-2006, 2010, 2011, 2012 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n *\n * Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster\n * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing\n * tables for updating the shift register in one step with three exclusive-ors\n * instead of four steps with four exclusive-ors.  This results in about a\n * factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3.\n */\n\n/* @(#) $Id$ */\n\n/*\n  Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore\n  protection on the static variables used to control the first-use generation\n  of the crc tables.  Therefore, if you #define DYNAMIC_CRC_TABLE, you should\n  first call get_crc_table() to initialize the tables before allowing more than\n  one thread to use crc32().\n\n  DYNAMIC_CRC_TABLE and MAKECRCH can be #defined to write out crc32.h.\n */\n\n#ifdef MAKECRCH\n#  include <stdio.h>\n#  ifndef DYNAMIC_CRC_TABLE\n#    define DYNAMIC_CRC_TABLE\n#  endif /* !DYNAMIC_CRC_TABLE */\n#endif /* MAKECRCH */\n\n#include \"zutil.h\"      /* for STDC and FAR definitions */\n\n#define local static\n\n/* Definitions for doing the crc four data bytes at a time. */\n#if !defined(NOBYFOUR) && defined(Z_U4)\n#  define BYFOUR\n#endif\n#ifdef BYFOUR\n   local unsigned long crc32_little OF((unsigned long,\n                        const unsigned char FAR *, unsigned));\n   local unsigned long crc32_big OF((unsigned long,\n                        const unsigned char FAR *, unsigned));\n#  define TBLS 8\n#else\n#  define TBLS 1\n#endif /* BYFOUR */\n\n/* Local functions for crc concatenation */\nlocal unsigned long gf2_matrix_times OF((unsigned long *mat,\n                                         unsigned long vec));\nlocal void gf2_matrix_square OF((unsigned long *square, unsigned long *mat));\nlocal uLong crc32_combine_ OF((uLong crc1, uLong crc2, z_off64_t len2));\n\n\n#ifdef DYNAMIC_CRC_TABLE\n\nlocal volatile int crc_table_empty = 1;\nlocal z_crc_t FAR crc_table[TBLS][256];\nlocal void make_crc_table OF((void));\n#ifdef MAKECRCH\n   local void write_table OF((FILE *, const z_crc_t FAR *));\n#endif /* MAKECRCH */\n/*\n  Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:\n  x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.\n\n  Polynomials over GF(2) are represented in binary, one bit per coefficient,\n  with the lowest powers in the most significant bit.  Then adding polynomials\n  is just exclusive-or, and multiplying a polynomial by x is a right shift by\n  one.  If we call the above polynomial p, and represent a byte as the\n  polynomial q, also with the lowest power in the most significant bit (so the\n  byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,\n  where a mod b means the remainder after dividing a by b.\n\n  This calculation is done using the shift-register method of multiplying and\n  taking the remainder.  The register is initialized to zero, and for each\n  incoming bit, x^32 is added mod p to the register if the bit is a one (where\n  x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by\n  x (which is shifting right by one and adding x^32 mod p if the bit shifted\n  out is a one).  We start with the highest power (least significant bit) of\n  q and repeat for all eight bits of q.\n\n  The first table is simply the CRC of all possible eight bit values.  This is\n  all the information needed to generate CRCs on data a byte at a time for all\n  combinations of CRC register values and incoming bytes.  The remaining tables\n  allow for word-at-a-time CRC calculation for both big-endian and little-\n  endian machines, where a word is four bytes.\n*/\nlocal void make_crc_table()\n{\n    z_crc_t c;\n    int n, k;\n    z_crc_t poly;                       /* polynomial exclusive-or pattern */\n    /* terms of polynomial defining this crc (except x^32): */\n    static volatile int first = 1;      /* flag to limit concurrent making */\n    static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};\n\n    /* See if another task is already doing this (not thread-safe, but better\n       than nothing -- significantly reduces duration of vulnerability in\n       case the advice about DYNAMIC_CRC_TABLE is ignored) */\n    if (first) {\n        first = 0;\n\n        /* make exclusive-or pattern from polynomial (0xedb88320UL) */\n        poly = 0;\n        for (n = 0; n < (int)(sizeof(p)/sizeof(unsigned char)); n++)\n            poly |= (z_crc_t)1 << (31 - p[n]);\n\n        /* generate a crc for every 8-bit value */\n        for (n = 0; n < 256; n++) {\n            c = (z_crc_t)n;\n            for (k = 0; k < 8; k++)\n                c = c & 1 ? poly ^ (c >> 1) : c >> 1;\n            crc_table[0][n] = c;\n        }\n\n#ifdef BYFOUR\n        /* generate crc for each value followed by one, two, and three zeros,\n           and then the byte reversal of those as well as the first table */\n        for (n = 0; n < 256; n++) {\n            c = crc_table[0][n];\n            crc_table[4][n] = ZSWAP32(c);\n            for (k = 1; k < 4; k++) {\n                c = crc_table[0][c & 0xff] ^ (c >> 8);\n                crc_table[k][n] = c;\n                crc_table[k + 4][n] = ZSWAP32(c);\n            }\n        }\n#endif /* BYFOUR */\n\n        crc_table_empty = 0;\n    }\n    else {      /* not first */\n        /* wait for the other guy to finish (not efficient, but rare) */\n        while (crc_table_empty)\n            ;\n    }\n\n#ifdef MAKECRCH\n    /* write out CRC tables to crc32.h */\n    {\n        FILE *out;\n\n        out = fopen(\"crc32.h\", \"w\");\n        if (out == NULL) return;\n        fprintf(out, \"/* crc32.h -- tables for rapid CRC calculation\\n\");\n        fprintf(out, \" * Generated automatically by crc32.c\\n */\\n\\n\");\n        fprintf(out, \"local const z_crc_t FAR \");\n        fprintf(out, \"crc_table[TBLS][256] =\\n{\\n  {\\n\");\n        write_table(out, crc_table[0]);\n#  ifdef BYFOUR\n        fprintf(out, \"#ifdef BYFOUR\\n\");\n        for (k = 1; k < 8; k++) {\n            fprintf(out, \"  },\\n  {\\n\");\n            write_table(out, crc_table[k]);\n        }\n        fprintf(out, \"#endif\\n\");\n#  endif /* BYFOUR */\n        fprintf(out, \"  }\\n};\\n\");\n        fclose(out);\n    }\n#endif /* MAKECRCH */\n}\n\n#ifdef MAKECRCH\nlocal void write_table(out, table)\n    FILE *out;\n    const z_crc_t FAR *table;\n{\n    int n;\n\n    for (n = 0; n < 256; n++)\n        fprintf(out, \"%s0x%08lxUL%s\", n % 5 ? \"\" : \"    \",\n                (unsigned long)(table[n]),\n                n == 255 ? \"\\n\" : (n % 5 == 4 ? \",\\n\" : \", \"));\n}\n#endif /* MAKECRCH */\n\n#else /* !DYNAMIC_CRC_TABLE */\n/* ========================================================================\n * Tables of CRC-32s of all single-byte values, made by make_crc_table().\n */\n#include \"crc32.h\"\n#endif /* DYNAMIC_CRC_TABLE */\n\n/* =========================================================================\n * This function can be used by asm versions of crc32()\n */\nconst z_crc_t FAR * ZEXPORT get_crc_table()\n{\n#ifdef DYNAMIC_CRC_TABLE\n    if (crc_table_empty)\n        make_crc_table();\n#endif /* DYNAMIC_CRC_TABLE */\n    return (const z_crc_t FAR *)crc_table;\n}\n\n/* ========================================================================= */\n#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8)\n#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1\n\n/* ========================================================================= */\nunsigned long ZEXPORT crc32(crc, buf, len)\n    unsigned long crc;\n    const unsigned char FAR *buf;\n    uInt len;\n{\n    if (buf == Z_NULL) return 0UL;\n\n#ifdef DYNAMIC_CRC_TABLE\n    if (crc_table_empty)\n        make_crc_table();\n#endif /* DYNAMIC_CRC_TABLE */\n\n#ifdef BYFOUR\n    if (sizeof(void *) == sizeof(ptrdiff_t)) {\n        z_crc_t endian;\n\n        endian = 1;\n        if (*((unsigned char *)(&endian)))\n            return crc32_little(crc, buf, len);\n        else\n            return crc32_big(crc, buf, len);\n    }\n#endif /* BYFOUR */\n    crc = crc ^ 0xffffffffUL;\n    while (len >= 8) {\n        DO8;\n        len -= 8;\n    }\n    if (len) do {\n        DO1;\n    } while (--len);\n    return crc ^ 0xffffffffUL;\n}\n\n#ifdef BYFOUR\n\n/* ========================================================================= */\n#define DOLIT4 c ^= *buf4++; \\\n        c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \\\n            crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24]\n#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4\n\n/* ========================================================================= */\nlocal unsigned long crc32_little(crc, buf, len)\n    unsigned long crc;\n    const unsigned char FAR *buf;\n    unsigned len;\n{\n    register z_crc_t c;\n    register const z_crc_t FAR *buf4;\n\n    c = (z_crc_t)crc;\n    c = ~c;\n    while (len && ((ptrdiff_t)buf & 3)) {\n        c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);\n        len--;\n    }\n\n    buf4 = (const z_crc_t FAR *)(const void FAR *)buf;\n    while (len >= 32) {\n        DOLIT32;\n        len -= 32;\n    }\n    while (len >= 4) {\n        DOLIT4;\n        len -= 4;\n    }\n    buf = (const unsigned char FAR *)buf4;\n\n    if (len) do {\n        c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);\n    } while (--len);\n    c = ~c;\n    return (unsigned long)c;\n}\n\n/* ========================================================================= */\n#define DOBIG4 c ^= *++buf4; \\\n        c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \\\n            crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24]\n#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4\n\n/* ========================================================================= */\nlocal unsigned long crc32_big(crc, buf, len)\n    unsigned long crc;\n    const unsigned char FAR *buf;\n    unsigned len;\n{\n    register z_crc_t c;\n    register const z_crc_t FAR *buf4;\n\n    c = ZSWAP32((z_crc_t)crc);\n    c = ~c;\n    while (len && ((ptrdiff_t)buf & 3)) {\n        c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);\n        len--;\n    }\n\n    buf4 = (const z_crc_t FAR *)(const void FAR *)buf;\n    buf4--;\n    while (len >= 32) {\n        DOBIG32;\n        len -= 32;\n    }\n    while (len >= 4) {\n        DOBIG4;\n        len -= 4;\n    }\n    buf4++;\n    buf = (const unsigned char FAR *)buf4;\n\n    if (len) do {\n        c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);\n    } while (--len);\n    c = ~c;\n    return (unsigned long)(ZSWAP32(c));\n}\n\n#endif /* BYFOUR */\n\n#define GF2_DIM 32      /* dimension of GF(2) vectors (length of CRC) */\n\n/* ========================================================================= */\nlocal unsigned long gf2_matrix_times(mat, vec)\n    unsigned long *mat;\n    unsigned long vec;\n{\n    unsigned long sum;\n\n    sum = 0;\n    while (vec) {\n        if (vec & 1)\n            sum ^= *mat;\n        vec >>= 1;\n        mat++;\n    }\n    return sum;\n}\n\n/* ========================================================================= */\nlocal void gf2_matrix_square(square, mat)\n    unsigned long *square;\n    unsigned long *mat;\n{\n    int n;\n\n    for (n = 0; n < GF2_DIM; n++)\n        square[n] = gf2_matrix_times(mat, mat[n]);\n}\n\n/* ========================================================================= */\nlocal uLong crc32_combine_(crc1, crc2, len2)\n    uLong crc1;\n    uLong crc2;\n    z_off64_t len2;\n{\n    int n;\n    unsigned long row;\n    unsigned long even[GF2_DIM];    /* even-power-of-two zeros operator */\n    unsigned long odd[GF2_DIM];     /* odd-power-of-two zeros operator */\n\n    /* degenerate case (also disallow negative lengths) */\n    if (len2 <= 0)\n        return crc1;\n\n    /* put operator for one zero bit in odd */\n    odd[0] = 0xedb88320UL;          /* CRC-32 polynomial */\n    row = 1;\n    for (n = 1; n < GF2_DIM; n++) {\n        odd[n] = row;\n        row <<= 1;\n    }\n\n    /* put operator for two zero bits in even */\n    gf2_matrix_square(even, odd);\n\n    /* put operator for four zero bits in odd */\n    gf2_matrix_square(odd, even);\n\n    /* apply len2 zeros to crc1 (first square will put the operator for one\n       zero byte, eight zero bits, in even) */\n    do {\n        /* apply zeros operator for this bit of len2 */\n        gf2_matrix_square(even, odd);\n        if (len2 & 1)\n            crc1 = gf2_matrix_times(even, crc1);\n        len2 >>= 1;\n\n        /* if no more bits set, then done */\n        if (len2 == 0)\n            break;\n\n        /* another iteration of the loop with odd and even swapped */\n        gf2_matrix_square(odd, even);\n        if (len2 & 1)\n            crc1 = gf2_matrix_times(odd, crc1);\n        len2 >>= 1;\n\n        /* if no more bits set, then done */\n    } while (len2 != 0);\n\n    /* return combined crc */\n    crc1 ^= crc2;\n    return crc1;\n}\n\n/* ========================================================================= */\nuLong ZEXPORT crc32_combine(crc1, crc2, len2)\n    uLong crc1;\n    uLong crc2;\n    z_off_t len2;\n{\n    return crc32_combine_(crc1, crc2, len2);\n}\n\nuLong ZEXPORT crc32_combine64(crc1, crc2, len2)\n    uLong crc1;\n    uLong crc2;\n    z_off64_t len2;\n{\n    return crc32_combine_(crc1, crc2, len2);\n}\n"
  },
  {
    "path": "ext/zlib/crc32.h",
    "content": "/* crc32.h -- tables for rapid CRC calculation\n * Generated automatically by crc32.c\n */\n\nlocal const z_crc_t FAR crc_table[TBLS][256] =\n{\n  {\n    0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL,\n    0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL,\n    0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL,\n    0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL,\n    0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL,\n    0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL,\n    0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL,\n    0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL,\n    0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL,\n    0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL,\n    0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL,\n    0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL,\n    0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL,\n    0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL,\n    0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL,\n    0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL,\n    0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL,\n    0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL,\n    0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL,\n    0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL,\n    0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL,\n    0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL,\n    0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL,\n    0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL,\n    0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL,\n    0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL,\n    0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL,\n    0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL,\n    0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL,\n    0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL,\n    0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL,\n    0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL,\n    0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL,\n    0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL,\n    0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL,\n    0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL,\n    0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL,\n    0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL,\n    0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL,\n    0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL,\n    0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL,\n    0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL,\n    0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL,\n    0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL,\n    0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL,\n    0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL,\n    0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL,\n    0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL,\n    0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL,\n    0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL,\n    0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL,\n    0x2d02ef8dUL\n#ifdef BYFOUR\n  },\n  {\n    0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL,\n    0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL,\n    0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL,\n    0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL,\n    0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL,\n    0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL,\n    0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL,\n    0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL,\n    0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL,\n    0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL,\n    0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL,\n    0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL,\n    0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL,\n    0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL,\n    0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL,\n    0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL,\n    0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL,\n    0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL,\n    0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL,\n    0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL,\n    0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL,\n    0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL,\n    0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL,\n    0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL,\n    0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL,\n    0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL,\n    0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL,\n    0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL,\n    0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL,\n    0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL,\n    0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL,\n    0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL,\n    0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL,\n    0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL,\n    0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL,\n    0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL,\n    0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL,\n    0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL,\n    0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL,\n    0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL,\n    0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL,\n    0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL,\n    0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL,\n    0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL,\n    0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL,\n    0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL,\n    0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL,\n    0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL,\n    0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL,\n    0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL,\n    0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL,\n    0x9324fd72UL\n  },\n  {\n    0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL,\n    0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL,\n    0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL,\n    0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL,\n    0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL,\n    0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL,\n    0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL,\n    0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL,\n    0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL,\n    0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL,\n    0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL,\n    0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL,\n    0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL,\n    0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL,\n    0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL,\n    0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL,\n    0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL,\n    0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL,\n    0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL,\n    0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL,\n    0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL,\n    0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL,\n    0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL,\n    0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL,\n    0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL,\n    0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL,\n    0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL,\n    0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL,\n    0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL,\n    0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL,\n    0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL,\n    0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL,\n    0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL,\n    0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL,\n    0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL,\n    0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL,\n    0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL,\n    0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL,\n    0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL,\n    0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL,\n    0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL,\n    0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL,\n    0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL,\n    0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL,\n    0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL,\n    0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL,\n    0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL,\n    0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL,\n    0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL,\n    0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL,\n    0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL,\n    0xbe9834edUL\n  },\n  {\n    0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL,\n    0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL,\n    0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL,\n    0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL,\n    0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL,\n    0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL,\n    0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL,\n    0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL,\n    0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL,\n    0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL,\n    0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL,\n    0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL,\n    0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL,\n    0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL,\n    0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL,\n    0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL,\n    0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL,\n    0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL,\n    0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL,\n    0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL,\n    0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL,\n    0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL,\n    0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL,\n    0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL,\n    0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL,\n    0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL,\n    0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL,\n    0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL,\n    0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL,\n    0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL,\n    0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL,\n    0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL,\n    0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL,\n    0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL,\n    0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL,\n    0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL,\n    0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL,\n    0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL,\n    0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL,\n    0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL,\n    0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL,\n    0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL,\n    0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL,\n    0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL,\n    0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL,\n    0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL,\n    0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL,\n    0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL,\n    0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL,\n    0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL,\n    0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL,\n    0xde0506f1UL\n  },\n  {\n    0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL,\n    0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL,\n    0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL,\n    0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL,\n    0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL,\n    0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL,\n    0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL,\n    0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL,\n    0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL,\n    0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL,\n    0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL,\n    0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL,\n    0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL,\n    0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL,\n    0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL,\n    0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL,\n    0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL,\n    0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL,\n    0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL,\n    0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL,\n    0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL,\n    0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL,\n    0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL,\n    0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL,\n    0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL,\n    0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL,\n    0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL,\n    0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL,\n    0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL,\n    0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL,\n    0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL,\n    0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL,\n    0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL,\n    0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL,\n    0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL,\n    0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL,\n    0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL,\n    0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL,\n    0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL,\n    0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL,\n    0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL,\n    0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL,\n    0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL,\n    0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL,\n    0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL,\n    0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL,\n    0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL,\n    0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL,\n    0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL,\n    0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL,\n    0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL,\n    0x8def022dUL\n  },\n  {\n    0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL,\n    0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL,\n    0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL,\n    0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL,\n    0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL,\n    0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL,\n    0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL,\n    0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL,\n    0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL,\n    0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL,\n    0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL,\n    0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL,\n    0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL,\n    0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL,\n    0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL,\n    0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL,\n    0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL,\n    0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL,\n    0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL,\n    0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL,\n    0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL,\n    0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL,\n    0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL,\n    0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL,\n    0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL,\n    0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL,\n    0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL,\n    0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL,\n    0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL,\n    0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL,\n    0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL,\n    0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL,\n    0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL,\n    0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL,\n    0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL,\n    0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL,\n    0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL,\n    0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL,\n    0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL,\n    0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL,\n    0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL,\n    0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL,\n    0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL,\n    0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL,\n    0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL,\n    0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL,\n    0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL,\n    0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL,\n    0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL,\n    0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL,\n    0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL,\n    0x72fd2493UL\n  },\n  {\n    0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL,\n    0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL,\n    0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL,\n    0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL,\n    0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL,\n    0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL,\n    0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL,\n    0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL,\n    0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL,\n    0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL,\n    0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL,\n    0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL,\n    0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL,\n    0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL,\n    0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL,\n    0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL,\n    0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL,\n    0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL,\n    0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL,\n    0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL,\n    0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL,\n    0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL,\n    0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL,\n    0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL,\n    0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL,\n    0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL,\n    0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL,\n    0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL,\n    0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL,\n    0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL,\n    0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL,\n    0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL,\n    0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL,\n    0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL,\n    0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL,\n    0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL,\n    0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL,\n    0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL,\n    0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL,\n    0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL,\n    0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL,\n    0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL,\n    0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL,\n    0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL,\n    0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL,\n    0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL,\n    0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL,\n    0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL,\n    0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL,\n    0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL,\n    0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL,\n    0xed3498beUL\n  },\n  {\n    0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL,\n    0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL,\n    0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL,\n    0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL,\n    0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL,\n    0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL,\n    0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL,\n    0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL,\n    0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL,\n    0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL,\n    0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL,\n    0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL,\n    0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL,\n    0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL,\n    0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL,\n    0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL,\n    0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL,\n    0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL,\n    0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL,\n    0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL,\n    0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL,\n    0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL,\n    0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL,\n    0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL,\n    0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL,\n    0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL,\n    0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL,\n    0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL,\n    0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL,\n    0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL,\n    0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL,\n    0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL,\n    0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL,\n    0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL,\n    0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL,\n    0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL,\n    0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL,\n    0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL,\n    0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL,\n    0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL,\n    0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL,\n    0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL,\n    0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL,\n    0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL,\n    0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL,\n    0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL,\n    0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL,\n    0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL,\n    0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL,\n    0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL,\n    0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL,\n    0xf10605deUL\n#endif\n  }\n};\n"
  },
  {
    "path": "ext/zlib/deflate.c",
    "content": "/* deflate.c -- compress data using the deflation algorithm\n * Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/*\n *  ALGORITHM\n *\n *      The \"deflation\" process depends on being able to identify portions\n *      of the input text which are identical to earlier input (within a\n *      sliding window trailing behind the input currently being processed).\n *\n *      The most straightforward technique turns out to be the fastest for\n *      most input files: try all possible matches and select the longest.\n *      The key feature of this algorithm is that insertions into the string\n *      dictionary are very simple and thus fast, and deletions are avoided\n *      completely. Insertions are performed at each input character, whereas\n *      string matches are performed only when the previous match ends. So it\n *      is preferable to spend more time in matches to allow very fast string\n *      insertions and avoid deletions. The matching algorithm for small\n *      strings is inspired from that of Rabin & Karp. A brute force approach\n *      is used to find longer strings when a small match has been found.\n *      A similar algorithm is used in comic (by Jan-Mark Wams) and freeze\n *      (by Leonid Broukhis).\n *         A previous version of this file used a more sophisticated algorithm\n *      (by Fiala and Greene) which is guaranteed to run in linear amortized\n *      time, but has a larger average cost, uses more memory and is patented.\n *      However the F&G algorithm may be faster for some highly redundant\n *      files if the parameter max_chain_length (described below) is too large.\n *\n *  ACKNOWLEDGEMENTS\n *\n *      The idea of lazy evaluation of matches is due to Jan-Mark Wams, and\n *      I found it in 'freeze' written by Leonid Broukhis.\n *      Thanks to many people for bug reports and testing.\n *\n *  REFERENCES\n *\n *      Deutsch, L.P.,\"DEFLATE Compressed Data Format Specification\".\n *      Available in http://tools.ietf.org/html/rfc1951\n *\n *      A description of the Rabin and Karp algorithm is given in the book\n *         \"Algorithms\" by R. Sedgewick, Addison-Wesley, p252.\n *\n *      Fiala,E.R., and Greene,D.H.\n *         Data Compression with Finite Windows, Comm.ACM, 32,4 (1989) 490-595\n *\n */\n\n/* @(#) $Id$ */\n\n#include \"deflate.h\"\n\nconst char deflate_copyright[] =\n   \" deflate 1.2.8 Copyright 1995-2013 Jean-loup Gailly and Mark Adler \";\n/*\n  If you use the zlib library in a product, an acknowledgment is welcome\n  in the documentation of your product. If for some reason you cannot\n  include such an acknowledgment, I would appreciate that you keep this\n  copyright string in the executable of your product.\n */\n\n/* ===========================================================================\n *  Function prototypes.\n */\ntypedef enum {\n    need_more,      /* block not completed, need more input or more output */\n    block_done,     /* block flush performed */\n    finish_started, /* finish started, need only more output at next deflate */\n    finish_done     /* finish done, accept no more input or output */\n} block_state;\n\ntypedef block_state (*compress_func) OF((deflate_state *s, int flush));\n/* Compression function. Returns the block state after the call. */\n\nlocal void fill_window    OF((deflate_state *s));\nlocal block_state deflate_stored OF((deflate_state *s, int flush));\nlocal block_state deflate_fast   OF((deflate_state *s, int flush));\n#ifndef FASTEST\nlocal block_state deflate_slow   OF((deflate_state *s, int flush));\n#endif\nlocal block_state deflate_rle    OF((deflate_state *s, int flush));\nlocal block_state deflate_huff   OF((deflate_state *s, int flush));\nlocal void lm_init        OF((deflate_state *s));\nlocal void putShortMSB    OF((deflate_state *s, uInt b));\nlocal void flush_pending  OF((z_streamp strm));\nlocal int read_buf        OF((z_streamp strm, Bytef *buf, unsigned size));\n#ifdef ASMV\n      void match_init OF((void)); /* asm code initialization */\n      uInt longest_match  OF((deflate_state *s, IPos cur_match));\n#else\nlocal uInt longest_match  OF((deflate_state *s, IPos cur_match));\n#endif\n\n#ifdef DEBUG\nlocal  void check_match OF((deflate_state *s, IPos start, IPos match,\n                            int length));\n#endif\n\n/* ===========================================================================\n * Local data\n */\n\n#define NIL 0\n/* Tail of hash chains */\n\n#ifndef TOO_FAR\n#  define TOO_FAR 4096\n#endif\n/* Matches of length 3 are discarded if their distance exceeds TOO_FAR */\n\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\ntypedef struct config_s {\n   ush good_length; /* reduce lazy search above this match length */\n   ush max_lazy;    /* do not perform lazy search above this match length */\n   ush nice_length; /* quit search above this match length */\n   ush max_chain;\n   compress_func func;\n} config;\n\n#ifdef FASTEST\nlocal const config configuration_table[2] = {\n/*      good lazy nice chain */\n/* 0 */ {0,    0,  0,    0, deflate_stored},  /* store only */\n/* 1 */ {4,    4,  8,    4, deflate_fast}}; /* max speed, no lazy matches */\n#else\nlocal const config configuration_table[10] = {\n/*      good lazy nice chain */\n/* 0 */ {0,    0,  0,    0, deflate_stored},  /* store only */\n/* 1 */ {4,    4,  8,    4, deflate_fast}, /* max speed, no lazy matches */\n/* 2 */ {4,    5, 16,    8, deflate_fast},\n/* 3 */ {4,    6, 32,   32, deflate_fast},\n\n/* 4 */ {4,    4, 16,   16, deflate_slow},  /* lazy matches */\n/* 5 */ {8,   16, 32,   32, deflate_slow},\n/* 6 */ {8,   16, 128, 128, deflate_slow},\n/* 7 */ {8,   32, 128, 256, deflate_slow},\n/* 8 */ {32, 128, 258, 1024, deflate_slow},\n/* 9 */ {32, 258, 258, 4096, deflate_slow}}; /* max compression */\n#endif\n\n/* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4\n * For deflate_fast() (levels <= 3) good is ignored and lazy has a different\n * meaning.\n */\n\n#define EQUAL 0\n/* result of memcmp for equal strings */\n\n#ifndef NO_DUMMY_DECL\nstruct static_tree_desc_s {int dummy;}; /* for buggy compilers */\n#endif\n\n/* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */\n#define RANK(f) (((f) << 1) - ((f) > 4 ? 9 : 0))\n\n/* ===========================================================================\n * Update a hash value with the given input byte\n * IN  assertion: all calls to to UPDATE_HASH are made with consecutive\n *    input characters, so that a running hash key can be computed from the\n *    previous key instead of complete recalculation each time.\n */\n#define UPDATE_HASH(s,h,c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)\n\n\n/* ===========================================================================\n * Insert string str in the dictionary and set match_head to the previous head\n * of the hash chain (the most recent string with same hash key). Return\n * the previous length of the hash chain.\n * If this file is compiled with -DFASTEST, the compression level is forced\n * to 1, and no hash chains are maintained.\n * IN  assertion: all calls to to INSERT_STRING are made with consecutive\n *    input characters and the first MIN_MATCH bytes of str are valid\n *    (except for the last MIN_MATCH-1 bytes of the input file).\n */\n#ifdef FASTEST\n#define INSERT_STRING(s, str, match_head) \\\n   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \\\n    match_head = s->head[s->ins_h], \\\n    s->head[s->ins_h] = (Pos)(str))\n#else\n#define INSERT_STRING(s, str, match_head) \\\n   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \\\n    match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \\\n    s->head[s->ins_h] = (Pos)(str))\n#endif\n\n/* ===========================================================================\n * Initialize the hash table (avoiding 64K overflow for 16 bit systems).\n * prev[] will be initialized on the fly.\n */\n#define CLEAR_HASH(s) \\\n    s->head[s->hash_size-1] = NIL; \\\n    zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));\n\n/* ========================================================================= */\nint ZEXPORT deflateInit_(strm, level, version, stream_size)\n    z_streamp strm;\n    int level;\n    const char *version;\n    int stream_size;\n{\n    return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,\n                         Z_DEFAULT_STRATEGY, version, stream_size);\n    /* To do: ignore strm->next_in if we use it as window */\n}\n\n/* ========================================================================= */\nint ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,\n                  version, stream_size)\n    z_streamp strm;\n    int  level;\n    int  method;\n    int  windowBits;\n    int  memLevel;\n    int  strategy;\n    const char *version;\n    int stream_size;\n{\n    deflate_state *s;\n    int wrap = 1;\n    static const char my_version[] = ZLIB_VERSION;\n\n    ushf *overlay;\n    /* We overlay pending_buf and d_buf+l_buf. This works since the average\n     * output size for (length,distance) codes is <= 24 bits.\n     */\n\n    if (version == Z_NULL || version[0] != my_version[0] ||\n        stream_size != sizeof(z_stream)) {\n        return Z_VERSION_ERROR;\n    }\n    if (strm == Z_NULL) return Z_STREAM_ERROR;\n\n    strm->msg = Z_NULL;\n    if (strm->zalloc == (alloc_func)0) {\n#ifdef Z_SOLO\n        return Z_STREAM_ERROR;\n#else\n        strm->zalloc = zcalloc;\n        strm->opaque = (voidpf)0;\n#endif\n    }\n    if (strm->zfree == (free_func)0)\n#ifdef Z_SOLO\n        return Z_STREAM_ERROR;\n#else\n        strm->zfree = zcfree;\n#endif\n\n#ifdef FASTEST\n    if (level != 0) level = 1;\n#else\n    if (level == Z_DEFAULT_COMPRESSION) level = 6;\n#endif\n\n    if (windowBits < 0) { /* suppress zlib wrapper */\n        wrap = 0;\n        windowBits = -windowBits;\n    }\n#ifdef GZIP\n    else if (windowBits > 15) {\n        wrap = 2;       /* write gzip wrapper instead */\n        windowBits -= 16;\n    }\n#endif\n    if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||\n        windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n        strategy < 0 || strategy > Z_FIXED) {\n        return Z_STREAM_ERROR;\n    }\n    if (windowBits == 8) windowBits = 9;  /* until 256-byte window bug fixed */\n    s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));\n    if (s == Z_NULL) return Z_MEM_ERROR;\n    strm->state = (struct internal_state FAR *)s;\n    s->strm = strm;\n\n    s->wrap = wrap;\n    s->gzhead = Z_NULL;\n    s->w_bits = windowBits;\n    s->w_size = 1 << s->w_bits;\n    s->w_mask = s->w_size - 1;\n\n    s->hash_bits = memLevel + 7;\n    s->hash_size = 1 << s->hash_bits;\n    s->hash_mask = s->hash_size - 1;\n    s->hash_shift =  ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);\n\n    s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));\n    s->prev   = (Posf *)  ZALLOC(strm, s->w_size, sizeof(Pos));\n    s->head   = (Posf *)  ZALLOC(strm, s->hash_size, sizeof(Pos));\n\n    s->high_water = 0;      /* nothing written to s->window yet */\n\n    s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n    overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);\n    s->pending_buf = (uchf *) overlay;\n    s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);\n\n    if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||\n        s->pending_buf == Z_NULL) {\n        s->status = FINISH_STATE;\n        strm->msg = ERR_MSG(Z_MEM_ERROR);\n        deflateEnd (strm);\n        return Z_MEM_ERROR;\n    }\n    s->d_buf = overlay + s->lit_bufsize/sizeof(ush);\n    s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;\n\n    s->level = level;\n    s->strategy = strategy;\n    s->method = (Byte)method;\n\n    return deflateReset(strm);\n}\n\n/* ========================================================================= */\nint ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)\n    z_streamp strm;\n    const Bytef *dictionary;\n    uInt  dictLength;\n{\n    deflate_state *s;\n    uInt str, n;\n    int wrap;\n    unsigned avail;\n    z_const unsigned char *next;\n\n    if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL)\n        return Z_STREAM_ERROR;\n    s = strm->state;\n    wrap = s->wrap;\n    if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead)\n        return Z_STREAM_ERROR;\n\n    /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n    if (wrap == 1)\n        strm->adler = adler32(strm->adler, dictionary, dictLength);\n    s->wrap = 0;                    /* avoid computing Adler-32 in read_buf */\n\n    /* if dictionary would fill window, just replace the history */\n    if (dictLength >= s->w_size) {\n        if (wrap == 0) {            /* already empty otherwise */\n            CLEAR_HASH(s);\n            s->strstart = 0;\n            s->block_start = 0L;\n            s->insert = 0;\n        }\n        dictionary += dictLength - s->w_size;  /* use the tail */\n        dictLength = s->w_size;\n    }\n\n    /* insert dictionary into window and hash */\n    avail = strm->avail_in;\n    next = strm->next_in;\n    strm->avail_in = dictLength;\n    strm->next_in = (z_const Bytef *)dictionary;\n    fill_window(s);\n    while (s->lookahead >= MIN_MATCH) {\n        str = s->strstart;\n        n = s->lookahead - (MIN_MATCH-1);\n        do {\n            UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]);\n#ifndef FASTEST\n            s->prev[str & s->w_mask] = s->head[s->ins_h];\n#endif\n            s->head[s->ins_h] = (Pos)str;\n            str++;\n        } while (--n);\n        s->strstart = str;\n        s->lookahead = MIN_MATCH-1;\n        fill_window(s);\n    }\n    s->strstart += s->lookahead;\n    s->block_start = (long)s->strstart;\n    s->insert = s->lookahead;\n    s->lookahead = 0;\n    s->match_length = s->prev_length = MIN_MATCH-1;\n    s->match_available = 0;\n    strm->next_in = next;\n    strm->avail_in = avail;\n    s->wrap = wrap;\n    return Z_OK;\n}\n\n/* ========================================================================= */\nint ZEXPORT deflateResetKeep (strm)\n    z_streamp strm;\n{\n    deflate_state *s;\n\n    if (strm == Z_NULL || strm->state == Z_NULL ||\n        strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) {\n        return Z_STREAM_ERROR;\n    }\n\n    strm->total_in = strm->total_out = 0;\n    strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */\n    strm->data_type = Z_UNKNOWN;\n\n    s = (deflate_state *)strm->state;\n    s->pending = 0;\n    s->pending_out = s->pending_buf;\n\n    if (s->wrap < 0) {\n        s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */\n    }\n    s->status = s->wrap ? INIT_STATE : BUSY_STATE;\n    strm->adler =\n#ifdef GZIP\n        s->wrap == 2 ? crc32(0L, Z_NULL, 0) :\n#endif\n        adler32(0L, Z_NULL, 0);\n    s->last_flush = Z_NO_FLUSH;\n\n    _tr_init(s);\n\n    return Z_OK;\n}\n\n/* ========================================================================= */\nint ZEXPORT deflateReset (strm)\n    z_streamp strm;\n{\n    int ret;\n\n    ret = deflateResetKeep(strm);\n    if (ret == Z_OK)\n        lm_init(strm->state);\n    return ret;\n}\n\n/* ========================================================================= */\nint ZEXPORT deflateSetHeader (strm, head)\n    z_streamp strm;\n    gz_headerp head;\n{\n    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;\n    if (strm->state->wrap != 2) return Z_STREAM_ERROR;\n    strm->state->gzhead = head;\n    return Z_OK;\n}\n\n/* ========================================================================= */\nint ZEXPORT deflatePending (strm, pending, bits)\n    unsigned *pending;\n    int *bits;\n    z_streamp strm;\n{\n    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;\n    if (pending != Z_NULL)\n        *pending = strm->state->pending;\n    if (bits != Z_NULL)\n        *bits = strm->state->bi_valid;\n    return Z_OK;\n}\n\n/* ========================================================================= */\nint ZEXPORT deflatePrime (strm, bits, value)\n    z_streamp strm;\n    int bits;\n    int value;\n{\n    deflate_state *s;\n    int put;\n\n    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;\n    s = strm->state;\n    if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3))\n        return Z_BUF_ERROR;\n    do {\n        put = Buf_size - s->bi_valid;\n        if (put > bits)\n            put = bits;\n        s->bi_buf |= (ush)((value & ((1 << put) - 1)) << s->bi_valid);\n        s->bi_valid += put;\n        _tr_flush_bits(s);\n        value >>= put;\n        bits -= put;\n    } while (bits);\n    return Z_OK;\n}\n\n/* ========================================================================= */\nint ZEXPORT deflateParams(strm, level, strategy)\n    z_streamp strm;\n    int level;\n    int strategy;\n{\n    deflate_state *s;\n    compress_func func;\n    int err = Z_OK;\n\n    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;\n    s = strm->state;\n\n#ifdef FASTEST\n    if (level != 0) level = 1;\n#else\n    if (level == Z_DEFAULT_COMPRESSION) level = 6;\n#endif\n    if (level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) {\n        return Z_STREAM_ERROR;\n    }\n    func = configuration_table[s->level].func;\n\n    if ((strategy != s->strategy || func != configuration_table[level].func) &&\n        strm->total_in != 0) {\n        /* Flush the last buffer: */\n        err = deflate(strm, Z_BLOCK);\n        if (err == Z_BUF_ERROR && s->pending == 0)\n            err = Z_OK;\n    }\n    if (s->level != level) {\n        s->level = level;\n        s->max_lazy_match   = configuration_table[level].max_lazy;\n        s->good_match       = configuration_table[level].good_length;\n        s->nice_match       = configuration_table[level].nice_length;\n        s->max_chain_length = configuration_table[level].max_chain;\n    }\n    s->strategy = strategy;\n    return err;\n}\n\n/* ========================================================================= */\nint ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain)\n    z_streamp strm;\n    int good_length;\n    int max_lazy;\n    int nice_length;\n    int max_chain;\n{\n    deflate_state *s;\n\n    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;\n    s = strm->state;\n    s->good_match = good_length;\n    s->max_lazy_match = max_lazy;\n    s->nice_match = nice_length;\n    s->max_chain_length = max_chain;\n    return Z_OK;\n}\n\n/* =========================================================================\n * For the default windowBits of 15 and memLevel of 8, this function returns\n * a close to exact, as well as small, upper bound on the compressed size.\n * They are coded as constants here for a reason--if the #define's are\n * changed, then this function needs to be changed as well.  The return\n * value for 15 and 8 only works for those exact settings.\n *\n * For any setting other than those defaults for windowBits and memLevel,\n * the value returned is a conservative worst case for the maximum expansion\n * resulting from using fixed blocks instead of stored blocks, which deflate\n * can emit on compressed data for some combinations of the parameters.\n *\n * This function could be more sophisticated to provide closer upper bounds for\n * every combination of windowBits and memLevel.  But even the conservative\n * upper bound of about 14% expansion does not seem onerous for output buffer\n * allocation.\n */\nuLong ZEXPORT deflateBound(strm, sourceLen)\n    z_streamp strm;\n    uLong sourceLen;\n{\n    deflate_state *s;\n    uLong complen, wraplen;\n    Bytef *str;\n\n    /* conservative upper bound for compressed data */\n    complen = sourceLen +\n              ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5;\n\n    /* if can't get parameters, return conservative bound plus zlib wrapper */\n    if (strm == Z_NULL || strm->state == Z_NULL)\n        return complen + 6;\n\n    /* compute wrapper length */\n    s = strm->state;\n    switch (s->wrap) {\n    case 0:                                 /* raw deflate */\n        wraplen = 0;\n        break;\n    case 1:                                 /* zlib wrapper */\n        wraplen = 6 + (s->strstart ? 4 : 0);\n        break;\n    case 2:                                 /* gzip wrapper */\n        wraplen = 18;\n        if (s->gzhead != Z_NULL) {          /* user-supplied gzip header */\n            if (s->gzhead->extra != Z_NULL)\n                wraplen += 2 + s->gzhead->extra_len;\n            str = s->gzhead->name;\n            if (str != Z_NULL)\n                do {\n                    wraplen++;\n                } while (*str++);\n            str = s->gzhead->comment;\n            if (str != Z_NULL)\n                do {\n                    wraplen++;\n                } while (*str++);\n            if (s->gzhead->hcrc)\n                wraplen += 2;\n        }\n        break;\n    default:                                /* for compiler happiness */\n        wraplen = 6;\n    }\n\n    /* if not default parameters, return conservative bound */\n    if (s->w_bits != 15 || s->hash_bits != 8 + 7)\n        return complen + wraplen;\n\n    /* default settings: return tight bound for that case */\n    return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +\n           (sourceLen >> 25) + 13 - 6 + wraplen;\n}\n\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\nlocal void putShortMSB (s, b)\n    deflate_state *s;\n    uInt b;\n{\n    put_byte(s, (Byte)(b >> 8));\n    put_byte(s, (Byte)(b & 0xff));\n}\n\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output goes\n * through this function so some applications may wish to modify it\n * to avoid allocating a large strm->next_out buffer and copying into it.\n * (See also read_buf()).\n */\nlocal void flush_pending(strm)\n    z_streamp strm;\n{\n    unsigned len;\n    deflate_state *s = strm->state;\n\n    _tr_flush_bits(s);\n    len = s->pending;\n    if (len > strm->avail_out) len = strm->avail_out;\n    if (len == 0) return;\n\n    zmemcpy(strm->next_out, s->pending_out, len);\n    strm->next_out  += len;\n    s->pending_out  += len;\n    strm->total_out += len;\n    strm->avail_out  -= len;\n    s->pending -= len;\n    if (s->pending == 0) {\n        s->pending_out = s->pending_buf;\n    }\n}\n\n/* ========================================================================= */\nint ZEXPORT deflate (strm, flush)\n    z_streamp strm;\n    int flush;\n{\n    int old_flush; /* value of flush param for previous deflate call */\n    deflate_state *s;\n\n    if (strm == Z_NULL || strm->state == Z_NULL ||\n        flush > Z_BLOCK || flush < 0) {\n        return Z_STREAM_ERROR;\n    }\n    s = strm->state;\n\n    if (strm->next_out == Z_NULL ||\n        (strm->next_in == Z_NULL && strm->avail_in != 0) ||\n        (s->status == FINISH_STATE && flush != Z_FINISH)) {\n        ERR_RETURN(strm, Z_STREAM_ERROR);\n    }\n    if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);\n\n    s->strm = strm; /* just in case */\n    old_flush = s->last_flush;\n    s->last_flush = flush;\n\n    /* Write the header */\n    if (s->status == INIT_STATE) {\n#ifdef GZIP\n        if (s->wrap == 2) {\n            strm->adler = crc32(0L, Z_NULL, 0);\n            put_byte(s, 31);\n            put_byte(s, 139);\n            put_byte(s, 8);\n            if (s->gzhead == Z_NULL) {\n                put_byte(s, 0);\n                put_byte(s, 0);\n                put_byte(s, 0);\n                put_byte(s, 0);\n                put_byte(s, 0);\n                put_byte(s, s->level == 9 ? 2 :\n                            (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?\n                             4 : 0));\n                put_byte(s, OS_CODE);\n                s->status = BUSY_STATE;\n            }\n            else {\n                put_byte(s, (s->gzhead->text ? 1 : 0) +\n                            (s->gzhead->hcrc ? 2 : 0) +\n                            (s->gzhead->extra == Z_NULL ? 0 : 4) +\n                            (s->gzhead->name == Z_NULL ? 0 : 8) +\n                            (s->gzhead->comment == Z_NULL ? 0 : 16)\n                        );\n                put_byte(s, (Byte)(s->gzhead->time & 0xff));\n                put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff));\n                put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff));\n                put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff));\n                put_byte(s, s->level == 9 ? 2 :\n                            (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?\n                             4 : 0));\n                put_byte(s, s->gzhead->os & 0xff);\n                if (s->gzhead->extra != Z_NULL) {\n                    put_byte(s, s->gzhead->extra_len & 0xff);\n                    put_byte(s, (s->gzhead->extra_len >> 8) & 0xff);\n                }\n                if (s->gzhead->hcrc)\n                    strm->adler = crc32(strm->adler, s->pending_buf,\n                                        s->pending);\n                s->gzindex = 0;\n                s->status = EXTRA_STATE;\n            }\n        }\n        else\n#endif\n        {\n            uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8;\n            uInt level_flags;\n\n            if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2)\n                level_flags = 0;\n            else if (s->level < 6)\n                level_flags = 1;\n            else if (s->level == 6)\n                level_flags = 2;\n            else\n                level_flags = 3;\n            header |= (level_flags << 6);\n            if (s->strstart != 0) header |= PRESET_DICT;\n            header += 31 - (header % 31);\n\n            s->status = BUSY_STATE;\n            putShortMSB(s, header);\n\n            /* Save the adler32 of the preset dictionary: */\n            if (s->strstart != 0) {\n                putShortMSB(s, (uInt)(strm->adler >> 16));\n                putShortMSB(s, (uInt)(strm->adler & 0xffff));\n            }\n            strm->adler = adler32(0L, Z_NULL, 0);\n        }\n    }\n#ifdef GZIP\n    if (s->status == EXTRA_STATE) {\n        if (s->gzhead->extra != Z_NULL) {\n            uInt beg = s->pending;  /* start of bytes to update crc */\n\n            while (s->gzindex < (s->gzhead->extra_len & 0xffff)) {\n                if (s->pending == s->pending_buf_size) {\n                    if (s->gzhead->hcrc && s->pending > beg)\n                        strm->adler = crc32(strm->adler, s->pending_buf + beg,\n                                            s->pending - beg);\n                    flush_pending(strm);\n                    beg = s->pending;\n                    if (s->pending == s->pending_buf_size)\n                        break;\n                }\n                put_byte(s, s->gzhead->extra[s->gzindex]);\n                s->gzindex++;\n            }\n            if (s->gzhead->hcrc && s->pending > beg)\n                strm->adler = crc32(strm->adler, s->pending_buf + beg,\n                                    s->pending - beg);\n            if (s->gzindex == s->gzhead->extra_len) {\n                s->gzindex = 0;\n                s->status = NAME_STATE;\n            }\n        }\n        else\n            s->status = NAME_STATE;\n    }\n    if (s->status == NAME_STATE) {\n        if (s->gzhead->name != Z_NULL) {\n            uInt beg = s->pending;  /* start of bytes to update crc */\n            int val;\n\n            do {\n                if (s->pending == s->pending_buf_size) {\n                    if (s->gzhead->hcrc && s->pending > beg)\n                        strm->adler = crc32(strm->adler, s->pending_buf + beg,\n                                            s->pending - beg);\n                    flush_pending(strm);\n                    beg = s->pending;\n                    if (s->pending == s->pending_buf_size) {\n                        val = 1;\n                        break;\n                    }\n                }\n                val = s->gzhead->name[s->gzindex++];\n                put_byte(s, val);\n            } while (val != 0);\n            if (s->gzhead->hcrc && s->pending > beg)\n                strm->adler = crc32(strm->adler, s->pending_buf + beg,\n                                    s->pending - beg);\n            if (val == 0) {\n                s->gzindex = 0;\n                s->status = COMMENT_STATE;\n            }\n        }\n        else\n            s->status = COMMENT_STATE;\n    }\n    if (s->status == COMMENT_STATE) {\n        if (s->gzhead->comment != Z_NULL) {\n            uInt beg = s->pending;  /* start of bytes to update crc */\n            int val;\n\n            do {\n                if (s->pending == s->pending_buf_size) {\n                    if (s->gzhead->hcrc && s->pending > beg)\n                        strm->adler = crc32(strm->adler, s->pending_buf + beg,\n                                            s->pending - beg);\n                    flush_pending(strm);\n                    beg = s->pending;\n                    if (s->pending == s->pending_buf_size) {\n                        val = 1;\n                        break;\n                    }\n                }\n                val = s->gzhead->comment[s->gzindex++];\n                put_byte(s, val);\n            } while (val != 0);\n            if (s->gzhead->hcrc && s->pending > beg)\n                strm->adler = crc32(strm->adler, s->pending_buf + beg,\n                                    s->pending - beg);\n            if (val == 0)\n                s->status = HCRC_STATE;\n        }\n        else\n            s->status = HCRC_STATE;\n    }\n    if (s->status == HCRC_STATE) {\n        if (s->gzhead->hcrc) {\n            if (s->pending + 2 > s->pending_buf_size)\n                flush_pending(strm);\n            if (s->pending + 2 <= s->pending_buf_size) {\n                put_byte(s, (Byte)(strm->adler & 0xff));\n                put_byte(s, (Byte)((strm->adler >> 8) & 0xff));\n                strm->adler = crc32(0L, Z_NULL, 0);\n                s->status = BUSY_STATE;\n            }\n        }\n        else\n            s->status = BUSY_STATE;\n    }\n#endif\n\n    /* Flush as much pending output as possible */\n    if (s->pending != 0) {\n        flush_pending(strm);\n        if (strm->avail_out == 0) {\n            /* Since avail_out is 0, deflate will be called again with\n             * more output space, but possibly with both pending and\n             * avail_in equal to zero. There won't be anything to do,\n             * but this is not an error situation so make sure we\n             * return OK instead of BUF_ERROR at next call of deflate:\n             */\n            s->last_flush = -1;\n            return Z_OK;\n        }\n\n    /* Make sure there is something to do and avoid duplicate consecutive\n     * flushes. For repeated and useless calls with Z_FINISH, we keep\n     * returning Z_STREAM_END instead of Z_BUF_ERROR.\n     */\n    } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) &&\n               flush != Z_FINISH) {\n        ERR_RETURN(strm, Z_BUF_ERROR);\n    }\n\n    /* User must not provide more input after the first FINISH: */\n    if (s->status == FINISH_STATE && strm->avail_in != 0) {\n        ERR_RETURN(strm, Z_BUF_ERROR);\n    }\n\n    /* Start a new block or continue the current one.\n     */\n    if (strm->avail_in != 0 || s->lookahead != 0 ||\n        (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {\n        block_state bstate;\n\n        bstate = s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :\n                    (s->strategy == Z_RLE ? deflate_rle(s, flush) :\n                        (*(configuration_table[s->level].func))(s, flush));\n\n        if (bstate == finish_started || bstate == finish_done) {\n            s->status = FINISH_STATE;\n        }\n        if (bstate == need_more || bstate == finish_started) {\n            if (strm->avail_out == 0) {\n                s->last_flush = -1; /* avoid BUF_ERROR next call, see above */\n            }\n            return Z_OK;\n            /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n             * of deflate should use the same flush parameter to make sure\n             * that the flush is complete. So we don't have to output an\n             * empty block here, this will be done at next call. This also\n             * ensures that for a very small output buffer, we emit at most\n             * one empty block.\n             */\n        }\n        if (bstate == block_done) {\n            if (flush == Z_PARTIAL_FLUSH) {\n                _tr_align(s);\n            } else if (flush != Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */\n                _tr_stored_block(s, (char*)0, 0L, 0);\n                /* For a full flush, this empty block will be recognized\n                 * as a special marker by inflate_sync().\n                 */\n                if (flush == Z_FULL_FLUSH) {\n                    CLEAR_HASH(s);             /* forget history */\n                    if (s->lookahead == 0) {\n                        s->strstart = 0;\n                        s->block_start = 0L;\n                        s->insert = 0;\n                    }\n                }\n            }\n            flush_pending(strm);\n            if (strm->avail_out == 0) {\n              s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */\n              return Z_OK;\n            }\n        }\n    }\n    Assert(strm->avail_out > 0, \"bug2\");\n\n    if (flush != Z_FINISH) return Z_OK;\n    if (s->wrap <= 0) return Z_STREAM_END;\n\n    /* Write the trailer */\n#ifdef GZIP\n    if (s->wrap == 2) {\n        put_byte(s, (Byte)(strm->adler & 0xff));\n        put_byte(s, (Byte)((strm->adler >> 8) & 0xff));\n        put_byte(s, (Byte)((strm->adler >> 16) & 0xff));\n        put_byte(s, (Byte)((strm->adler >> 24) & 0xff));\n        put_byte(s, (Byte)(strm->total_in & 0xff));\n        put_byte(s, (Byte)((strm->total_in >> 8) & 0xff));\n        put_byte(s, (Byte)((strm->total_in >> 16) & 0xff));\n        put_byte(s, (Byte)((strm->total_in >> 24) & 0xff));\n    }\n    else\n#endif\n    {\n        putShortMSB(s, (uInt)(strm->adler >> 16));\n        putShortMSB(s, (uInt)(strm->adler & 0xffff));\n    }\n    flush_pending(strm);\n    /* If avail_out is zero, the application will call deflate again\n     * to flush the rest.\n     */\n    if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */\n    return s->pending != 0 ? Z_OK : Z_STREAM_END;\n}\n\n/* ========================================================================= */\nint ZEXPORT deflateEnd (strm)\n    z_streamp strm;\n{\n    int status;\n\n    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;\n\n    status = strm->state->status;\n    if (status != INIT_STATE &&\n        status != EXTRA_STATE &&\n        status != NAME_STATE &&\n        status != COMMENT_STATE &&\n        status != HCRC_STATE &&\n        status != BUSY_STATE &&\n        status != FINISH_STATE) {\n      return Z_STREAM_ERROR;\n    }\n\n    /* Deallocate in reverse order of allocations: */\n    TRY_FREE(strm, strm->state->pending_buf);\n    TRY_FREE(strm, strm->state->head);\n    TRY_FREE(strm, strm->state->prev);\n    TRY_FREE(strm, strm->state->window);\n\n    ZFREE(strm, strm->state);\n    strm->state = Z_NULL;\n\n    return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;\n}\n\n/* =========================================================================\n * Copy the source state to the destination state.\n * To simplify the source, this is not supported for 16-bit MSDOS (which\n * doesn't have enough memory anyway to duplicate compression states).\n */\nint ZEXPORT deflateCopy (dest, source)\n    z_streamp dest;\n    z_streamp source;\n{\n#ifdef MAXSEG_64K\n    return Z_STREAM_ERROR;\n#else\n    deflate_state *ds;\n    deflate_state *ss;\n    ushf *overlay;\n\n\n    if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) {\n        return Z_STREAM_ERROR;\n    }\n\n    ss = source->state;\n\n    zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));\n\n    ds = (deflate_state *) ZALLOC(dest, 1, sizeof(deflate_state));\n    if (ds == Z_NULL) return Z_MEM_ERROR;\n    dest->state = (struct internal_state FAR *) ds;\n    zmemcpy((voidpf)ds, (voidpf)ss, sizeof(deflate_state));\n    ds->strm = dest;\n\n    ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));\n    ds->prev   = (Posf *)  ZALLOC(dest, ds->w_size, sizeof(Pos));\n    ds->head   = (Posf *)  ZALLOC(dest, ds->hash_size, sizeof(Pos));\n    overlay = (ushf *) ZALLOC(dest, ds->lit_bufsize, sizeof(ush)+2);\n    ds->pending_buf = (uchf *) overlay;\n\n    if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||\n        ds->pending_buf == Z_NULL) {\n        deflateEnd (dest);\n        return Z_MEM_ERROR;\n    }\n    /* following zmemcpy do not work for 16-bit MSDOS */\n    zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));\n    zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos));\n    zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos));\n    zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);\n\n    ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);\n    ds->d_buf = overlay + ds->lit_bufsize/sizeof(ush);\n    ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize;\n\n    ds->l_desc.dyn_tree = ds->dyn_ltree;\n    ds->d_desc.dyn_tree = ds->dyn_dtree;\n    ds->bl_desc.dyn_tree = ds->bl_tree;\n\n    return Z_OK;\n#endif /* MAXSEG_64K */\n}\n\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read.  All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->next_in buffer and copying from it.\n * (See also flush_pending()).\n */\nlocal int read_buf(strm, buf, size)\n    z_streamp strm;\n    Bytef *buf;\n    unsigned size;\n{\n    unsigned len = strm->avail_in;\n\n    if (len > size) len = size;\n    if (len == 0) return 0;\n\n    strm->avail_in  -= len;\n\n    zmemcpy(buf, strm->next_in, len);\n    if (strm->state->wrap == 1) {\n        strm->adler = adler32(strm->adler, buf, len);\n    }\n#ifdef GZIP\n    else if (strm->state->wrap == 2) {\n        strm->adler = crc32(strm->adler, buf, len);\n    }\n#endif\n    strm->next_in  += len;\n    strm->total_in += len;\n\n    return (int)len;\n}\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nlocal void lm_init (s)\n    deflate_state *s;\n{\n    s->window_size = (ulg)2L*s->w_size;\n\n    CLEAR_HASH(s);\n\n    /* Set the default configuration parameters:\n     */\n    s->max_lazy_match   = configuration_table[s->level].max_lazy;\n    s->good_match       = configuration_table[s->level].good_length;\n    s->nice_match       = configuration_table[s->level].nice_length;\n    s->max_chain_length = configuration_table[s->level].max_chain;\n\n    s->strstart = 0;\n    s->block_start = 0L;\n    s->lookahead = 0;\n    s->insert = 0;\n    s->match_length = s->prev_length = MIN_MATCH-1;\n    s->match_available = 0;\n    s->ins_h = 0;\n#ifndef FASTEST\n#ifdef ASMV\n    match_init(); /* initialize the asm code */\n#endif\n#endif\n}\n\n#ifndef FASTEST\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n *   string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\n#ifndef ASMV\n/* For 80x86 and 680x0, an optimized version will be provided in match.asm or\n * match.S. The code will be functionally equivalent.\n */\nlocal uInt longest_match(s, cur_match)\n    deflate_state *s;\n    IPos cur_match;                             /* current match */\n{\n    unsigned chain_length = s->max_chain_length;/* max hash chain length */\n    register Bytef *scan = s->window + s->strstart; /* current string */\n    register Bytef *match;                       /* matched string */\n    register int len;                           /* length of current match */\n    int best_len = s->prev_length;              /* best match length so far */\n    int nice_match = s->nice_match;             /* stop if match long enough */\n    IPos limit = s->strstart > (IPos)MAX_DIST(s) ?\n        s->strstart - (IPos)MAX_DIST(s) : NIL;\n    /* Stop when cur_match becomes <= limit. To simplify the code,\n     * we prevent matches with the string of window index 0.\n     */\n    Posf *prev = s->prev;\n    uInt wmask = s->w_mask;\n\n#ifdef UNALIGNED_OK\n    /* Compare two bytes at a time. Note: this is not always beneficial.\n     * Try with and without -DUNALIGNED_OK to check.\n     */\n    register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;\n    register ush scan_start = *(ushf*)scan;\n    register ush scan_end   = *(ushf*)(scan+best_len-1);\n#else\n    register Bytef *strend = s->window + s->strstart + MAX_MATCH;\n    register Byte scan_end1  = scan[best_len-1];\n    register Byte scan_end   = scan[best_len];\n#endif\n\n    /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n     * It is easy to get rid of this optimization if necessary.\n     */\n    Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n    /* Do not waste too much time if we already have a good match: */\n    if (s->prev_length >= s->good_match) {\n        chain_length >>= 2;\n    }\n    /* Do not look for matches beyond the end of the input. This is necessary\n     * to make deflate deterministic.\n     */\n    if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;\n\n    Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n    do {\n        Assert(cur_match < s->strstart, \"no future\");\n        match = s->window + cur_match;\n\n        /* Skip to next match if the match length cannot increase\n         * or if the match length is less than 2.  Note that the checks below\n         * for insufficient lookahead only occur occasionally for performance\n         * reasons.  Therefore uninitialized memory will be accessed, and\n         * conditional jumps will be made that depend on those values.\n         * However the length of the match is limited to the lookahead, so\n         * the output of deflate is not affected by the uninitialized values.\n         */\n#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)\n        /* This code assumes sizeof(unsigned short) == 2. Do not use\n         * UNALIGNED_OK if your compiler uses a different size.\n         */\n        if (*(ushf*)(match+best_len-1) != scan_end ||\n            *(ushf*)match != scan_start) continue;\n\n        /* It is not necessary to compare scan[2] and match[2] since they are\n         * always equal when the other bytes match, given that the hash keys\n         * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at\n         * strstart+3, +5, ... up to strstart+257. We check for insufficient\n         * lookahead only every 4th comparison; the 128th check will be made\n         * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is\n         * necessary to put more guard bytes at the end of the window, or\n         * to check more often for insufficient lookahead.\n         */\n        Assert(scan[2] == match[2], \"scan[2]?\");\n        scan++, match++;\n        do {\n        } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&\n                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&\n                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&\n                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&\n                 scan < strend);\n        /* The funny \"do {}\" generates better code on most compilers */\n\n        /* Here, scan <= window+strstart+257 */\n        Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n        if (*scan == *match) scan++;\n\n        len = (MAX_MATCH - 1) - (int)(strend-scan);\n        scan = strend - (MAX_MATCH-1);\n\n#else /* UNALIGNED_OK */\n\n        if (match[best_len]   != scan_end  ||\n            match[best_len-1] != scan_end1 ||\n            *match            != *scan     ||\n            *++match          != scan[1])      continue;\n\n        /* The check at best_len-1 can be removed because it will be made\n         * again later. (This heuristic is not always a win.)\n         * It is not necessary to compare scan[2] and match[2] since they\n         * are always equal when the other bytes match, given that\n         * the hash keys are equal and that HASH_BITS >= 8.\n         */\n        scan += 2, match++;\n        Assert(*scan == *match, \"match[2]?\");\n\n        /* We check for insufficient lookahead only every 8th comparison;\n         * the 256th check will be made at strstart+258.\n         */\n        do {\n        } while (*++scan == *++match && *++scan == *++match &&\n                 *++scan == *++match && *++scan == *++match &&\n                 *++scan == *++match && *++scan == *++match &&\n                 *++scan == *++match && *++scan == *++match &&\n                 scan < strend);\n\n        Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n        len = MAX_MATCH - (int)(strend - scan);\n        scan = strend - MAX_MATCH;\n\n#endif /* UNALIGNED_OK */\n\n        if (len > best_len) {\n            s->match_start = cur_match;\n            best_len = len;\n            if (len >= nice_match) break;\n#ifdef UNALIGNED_OK\n            scan_end = *(ushf*)(scan+best_len-1);\n#else\n            scan_end1  = scan[best_len-1];\n            scan_end   = scan[best_len];\n#endif\n        }\n    } while ((cur_match = prev[cur_match & wmask]) > limit\n             && --chain_length != 0);\n\n    if ((uInt)best_len <= s->lookahead) return (uInt)best_len;\n    return s->lookahead;\n}\n#endif /* ASMV */\n\n#else /* FASTEST */\n\n/* ---------------------------------------------------------------------------\n * Optimized version for FASTEST only\n */\nlocal uInt longest_match(s, cur_match)\n    deflate_state *s;\n    IPos cur_match;                             /* current match */\n{\n    register Bytef *scan = s->window + s->strstart; /* current string */\n    register Bytef *match;                       /* matched string */\n    register int len;                           /* length of current match */\n    register Bytef *strend = s->window + s->strstart + MAX_MATCH;\n\n    /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n     * It is easy to get rid of this optimization if necessary.\n     */\n    Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n    Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n    Assert(cur_match < s->strstart, \"no future\");\n\n    match = s->window + cur_match;\n\n    /* Return failure if the match length is less than 2:\n     */\n    if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;\n\n    /* The check at best_len-1 can be removed because it will be made\n     * again later. (This heuristic is not always a win.)\n     * It is not necessary to compare scan[2] and match[2] since they\n     * are always equal when the other bytes match, given that\n     * the hash keys are equal and that HASH_BITS >= 8.\n     */\n    scan += 2, match += 2;\n    Assert(*scan == *match, \"match[2]?\");\n\n    /* We check for insufficient lookahead only every 8th comparison;\n     * the 256th check will be made at strstart+258.\n     */\n    do {\n    } while (*++scan == *++match && *++scan == *++match &&\n             *++scan == *++match && *++scan == *++match &&\n             *++scan == *++match && *++scan == *++match &&\n             *++scan == *++match && *++scan == *++match &&\n             scan < strend);\n\n    Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n    len = MAX_MATCH - (int)(strend - scan);\n\n    if (len < MIN_MATCH) return MIN_MATCH - 1;\n\n    s->match_start = cur_match;\n    return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead;\n}\n\n#endif /* FASTEST */\n\n#ifdef DEBUG\n/* ===========================================================================\n * Check that the match at match_start is indeed a match.\n */\nlocal void check_match(s, start, match, length)\n    deflate_state *s;\n    IPos start, match;\n    int length;\n{\n    /* check that the match is indeed a match */\n    if (zmemcmp(s->window + match,\n                s->window + start, length) != EQUAL) {\n        fprintf(stderr, \" start %u, match %u, length %d\\n\",\n                start, match, length);\n        do {\n            fprintf(stderr, \"%c%c\", s->window[match++], s->window[start++]);\n        } while (--length != 0);\n        z_error(\"invalid match\");\n    }\n    if (z_verbose > 1) {\n        fprintf(stderr,\"\\\\[%d,%d]\", start-match, length);\n        do { putc(s->window[start++], stderr); } while (--length != 0);\n    }\n}\n#else\n#  define check_match(s, start, match, length)\n#endif /* DEBUG */\n\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n *    At least one byte has been read, or avail_in == 0; reads are\n *    performed for at least two bytes (required for the zip translate_eol\n *    option -- not supported here).\n */\nlocal void fill_window(s)\n    deflate_state *s;\n{\n    register unsigned n, m;\n    register Posf *p;\n    unsigned more;    /* Amount of free space at the end of the window. */\n    uInt wsize = s->w_size;\n\n    Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n    do {\n        more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);\n\n        /* Deal with !@#$% 64K limit: */\n        if (sizeof(int) <= 2) {\n            if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n                more = wsize;\n\n            } else if (more == (unsigned)(-1)) {\n                /* Very unlikely, but possible on 16 bit machine if\n                 * strstart == 0 && lookahead == 1 (input done a byte at time)\n                 */\n                more--;\n            }\n        }\n\n        /* If the window is almost full and there is insufficient lookahead,\n         * move the upper half to the lower one to make room in the upper half.\n         */\n        if (s->strstart >= wsize+MAX_DIST(s)) {\n\n            zmemcpy(s->window, s->window+wsize, (unsigned)wsize);\n            s->match_start -= wsize;\n            s->strstart    -= wsize; /* we now have strstart >= MAX_DIST */\n            s->block_start -= (long) wsize;\n\n            /* Slide the hash table (could be avoided with 32 bit values\n               at the expense of memory usage). We slide even when level == 0\n               to keep the hash table consistent if we switch back to level > 0\n               later. (Using level 0 permanently is not an optimal usage of\n               zlib, so we don't care about this pathological case.)\n             */\n            n = s->hash_size;\n            p = &s->head[n];\n            do {\n                m = *--p;\n                *p = (Pos)(m >= wsize ? m-wsize : NIL);\n            } while (--n);\n\n            n = wsize;\n#ifndef FASTEST\n            p = &s->prev[n];\n            do {\n                m = *--p;\n                *p = (Pos)(m >= wsize ? m-wsize : NIL);\n                /* If n is not on any hash chain, prev[n] is garbage but\n                 * its value will never be used.\n                 */\n            } while (--n);\n#endif\n            more += wsize;\n        }\n        if (s->strm->avail_in == 0) break;\n\n        /* If there was no sliding:\n         *    strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n         *    more == window_size - lookahead - strstart\n         * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n         * => more >= window_size - 2*WSIZE + 2\n         * In the BIG_MEM or MMAP case (not yet supported),\n         *   window_size == input_size + MIN_LOOKAHEAD  &&\n         *   strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n         * Otherwise, window_size == 2*WSIZE so more >= 2.\n         * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n         */\n        Assert(more >= 2, \"more < 2\");\n\n        n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);\n        s->lookahead += n;\n\n        /* Initialize the hash value now that we have some input: */\n        if (s->lookahead + s->insert >= MIN_MATCH) {\n            uInt str = s->strstart - s->insert;\n            s->ins_h = s->window[str];\n            UPDATE_HASH(s, s->ins_h, s->window[str + 1]);\n#if MIN_MATCH != 3\n            Call UPDATE_HASH() MIN_MATCH-3 more times\n#endif\n            while (s->insert) {\n                UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]);\n#ifndef FASTEST\n                s->prev[str & s->w_mask] = s->head[s->ins_h];\n#endif\n                s->head[s->ins_h] = (Pos)str;\n                str++;\n                s->insert--;\n                if (s->lookahead + s->insert < MIN_MATCH)\n                    break;\n            }\n        }\n        /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n         * but this is not important since only literal bytes will be emitted.\n         */\n\n    } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);\n\n    /* If the WIN_INIT bytes after the end of the current data have never been\n     * written, then zero those bytes in order to avoid memory check reports of\n     * the use of uninitialized (or uninitialised as Julian writes) bytes by\n     * the longest match routines.  Update the high water mark for the next\n     * time through here.  WIN_INIT is set to MAX_MATCH since the longest match\n     * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n     */\n    if (s->high_water < s->window_size) {\n        ulg curr = s->strstart + (ulg)(s->lookahead);\n        ulg init;\n\n        if (s->high_water < curr) {\n            /* Previous high water mark below current data -- zero WIN_INIT\n             * bytes or up to end of window, whichever is less.\n             */\n            init = s->window_size - curr;\n            if (init > WIN_INIT)\n                init = WIN_INIT;\n            zmemzero(s->window + curr, (unsigned)init);\n            s->high_water = curr + init;\n        }\n        else if (s->high_water < (ulg)curr + WIN_INIT) {\n            /* High water mark at or above current data, but below current data\n             * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n             * to end of window, whichever is less.\n             */\n            init = (ulg)curr + WIN_INIT - s->high_water;\n            if (init > s->window_size - s->high_water)\n                init = s->window_size - s->high_water;\n            zmemzero(s->window + s->high_water, (unsigned)init);\n            s->high_water += init;\n        }\n    }\n\n    Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n           \"not enough room for search\");\n}\n\n/* ===========================================================================\n * Flush the current block, with given end-of-file flag.\n * IN assertion: strstart is set to the end of the current match.\n */\n#define FLUSH_BLOCK_ONLY(s, last) { \\\n   _tr_flush_block(s, (s->block_start >= 0L ? \\\n                   (charf *)&s->window[(unsigned)s->block_start] : \\\n                   (charf *)Z_NULL), \\\n                (ulg)((long)s->strstart - s->block_start), \\\n                (last)); \\\n   s->block_start = s->strstart; \\\n   flush_pending(s->strm); \\\n   Tracev((stderr,\"[FLUSH]\")); \\\n}\n\n/* Same but force premature exit if necessary. */\n#define FLUSH_BLOCK(s, last) { \\\n   FLUSH_BLOCK_ONLY(s, last); \\\n   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \\\n}\n\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n * This function does not insert new strings in the dictionary since\n * uncompressible data is probably not useful. This function is used\n * only for the level=0 compression option.\n * NOTE: this function should be optimized to avoid extra copying from\n * window to pending_buf.\n */\nlocal block_state deflate_stored(s, flush)\n    deflate_state *s;\n    int flush;\n{\n    /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n     * to pending_buf_size, and each stored block has a 5 byte header:\n     */\n    ulg max_block_size = 0xffff;\n    ulg max_start;\n\n    if (max_block_size > s->pending_buf_size - 5) {\n        max_block_size = s->pending_buf_size - 5;\n    }\n\n    /* Copy as much as possible from input to output: */\n    for (;;) {\n        /* Fill the window as much as possible: */\n        if (s->lookahead <= 1) {\n\n            Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n                   s->block_start >= (long)s->w_size, \"slide too late\");\n\n            fill_window(s);\n            if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more;\n\n            if (s->lookahead == 0) break; /* flush the current block */\n        }\n        Assert(s->block_start >= 0L, \"block gone\");\n\n        s->strstart += s->lookahead;\n        s->lookahead = 0;\n\n        /* Emit a stored block if pending_buf will be full: */\n        max_start = s->block_start + max_block_size;\n        if (s->strstart == 0 || (ulg)s->strstart >= max_start) {\n            /* strstart == 0 is possible when wraparound on 16-bit machine */\n            s->lookahead = (uInt)(s->strstart - max_start);\n            s->strstart = (uInt)max_start;\n            FLUSH_BLOCK(s, 0);\n        }\n        /* Flush if we may have to slide, otherwise block_start may become\n         * negative and the data will be gone:\n         */\n        if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) {\n            FLUSH_BLOCK(s, 0);\n        }\n    }\n    s->insert = 0;\n    if (flush == Z_FINISH) {\n        FLUSH_BLOCK(s, 1);\n        return finish_done;\n    }\n    if ((long)s->strstart > s->block_start)\n        FLUSH_BLOCK(s, 0);\n    return block_done;\n}\n\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\nlocal block_state deflate_fast(s, flush)\n    deflate_state *s;\n    int flush;\n{\n    IPos hash_head;       /* head of the hash chain */\n    int bflush;           /* set if current block must be flushed */\n\n    for (;;) {\n        /* Make sure that we always have enough lookahead, except\n         * at the end of the input file. We need MAX_MATCH bytes\n         * for the next match, plus MIN_MATCH bytes to insert the\n         * string following the next match.\n         */\n        if (s->lookahead < MIN_LOOKAHEAD) {\n            fill_window(s);\n            if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n                return need_more;\n            }\n            if (s->lookahead == 0) break; /* flush the current block */\n        }\n\n        /* Insert the string window[strstart .. strstart+2] in the\n         * dictionary, and set hash_head to the head of the hash chain:\n         */\n        hash_head = NIL;\n        if (s->lookahead >= MIN_MATCH) {\n            INSERT_STRING(s, s->strstart, hash_head);\n        }\n\n        /* Find the longest match, discarding those <= prev_length.\n         * At this point we have always match_length < MIN_MATCH\n         */\n        if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) {\n            /* To simplify the code, we prevent matches with the string\n             * of window index 0 (in particular we have to avoid a match\n             * of the string with itself at the start of the input file).\n             */\n            s->match_length = longest_match (s, hash_head);\n            /* longest_match() sets match_start */\n        }\n        if (s->match_length >= MIN_MATCH) {\n            check_match(s, s->strstart, s->match_start, s->match_length);\n\n            _tr_tally_dist(s, s->strstart - s->match_start,\n                           s->match_length - MIN_MATCH, bflush);\n\n            s->lookahead -= s->match_length;\n\n            /* Insert new strings in the hash table only if the match length\n             * is not too large. This saves time but degrades compression.\n             */\n#ifndef FASTEST\n            if (s->match_length <= s->max_insert_length &&\n                s->lookahead >= MIN_MATCH) {\n                s->match_length--; /* string at strstart already in table */\n                do {\n                    s->strstart++;\n                    INSERT_STRING(s, s->strstart, hash_head);\n                    /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n                     * always MIN_MATCH bytes ahead.\n                     */\n                } while (--s->match_length != 0);\n                s->strstart++;\n            } else\n#endif\n            {\n                s->strstart += s->match_length;\n                s->match_length = 0;\n                s->ins_h = s->window[s->strstart];\n                UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);\n#if MIN_MATCH != 3\n                Call UPDATE_HASH() MIN_MATCH-3 more times\n#endif\n                /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n                 * matter since it will be recomputed at next deflate call.\n                 */\n            }\n        } else {\n            /* No match, output a literal byte */\n            Tracevv((stderr,\"%c\", s->window[s->strstart]));\n            _tr_tally_lit (s, s->window[s->strstart], bflush);\n            s->lookahead--;\n            s->strstart++;\n        }\n        if (bflush) FLUSH_BLOCK(s, 0);\n    }\n    s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;\n    if (flush == Z_FINISH) {\n        FLUSH_BLOCK(s, 1);\n        return finish_done;\n    }\n    if (s->last_lit)\n        FLUSH_BLOCK(s, 0);\n    return block_done;\n}\n\n#ifndef FASTEST\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\nlocal block_state deflate_slow(s, flush)\n    deflate_state *s;\n    int flush;\n{\n    IPos hash_head;          /* head of hash chain */\n    int bflush;              /* set if current block must be flushed */\n\n    /* Process the input block. */\n    for (;;) {\n        /* Make sure that we always have enough lookahead, except\n         * at the end of the input file. We need MAX_MATCH bytes\n         * for the next match, plus MIN_MATCH bytes to insert the\n         * string following the next match.\n         */\n        if (s->lookahead < MIN_LOOKAHEAD) {\n            fill_window(s);\n            if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n                return need_more;\n            }\n            if (s->lookahead == 0) break; /* flush the current block */\n        }\n\n        /* Insert the string window[strstart .. strstart+2] in the\n         * dictionary, and set hash_head to the head of the hash chain:\n         */\n        hash_head = NIL;\n        if (s->lookahead >= MIN_MATCH) {\n            INSERT_STRING(s, s->strstart, hash_head);\n        }\n\n        /* Find the longest match, discarding those <= prev_length.\n         */\n        s->prev_length = s->match_length, s->prev_match = s->match_start;\n        s->match_length = MIN_MATCH-1;\n\n        if (hash_head != NIL && s->prev_length < s->max_lazy_match &&\n            s->strstart - hash_head <= MAX_DIST(s)) {\n            /* To simplify the code, we prevent matches with the string\n             * of window index 0 (in particular we have to avoid a match\n             * of the string with itself at the start of the input file).\n             */\n            s->match_length = longest_match (s, hash_head);\n            /* longest_match() sets match_start */\n\n            if (s->match_length <= 5 && (s->strategy == Z_FILTERED\n#if TOO_FAR <= 32767\n                || (s->match_length == MIN_MATCH &&\n                    s->strstart - s->match_start > TOO_FAR)\n#endif\n                )) {\n\n                /* If prev_match is also MIN_MATCH, match_start is garbage\n                 * but we will ignore the current match anyway.\n                 */\n                s->match_length = MIN_MATCH-1;\n            }\n        }\n        /* If there was a match at the previous step and the current\n         * match is not better, output the previous match:\n         */\n        if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {\n            uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;\n            /* Do not insert strings in hash table beyond this. */\n\n            check_match(s, s->strstart-1, s->prev_match, s->prev_length);\n\n            _tr_tally_dist(s, s->strstart -1 - s->prev_match,\n                           s->prev_length - MIN_MATCH, bflush);\n\n            /* Insert in hash table all strings up to the end of the match.\n             * strstart-1 and strstart are already inserted. If there is not\n             * enough lookahead, the last two strings are not inserted in\n             * the hash table.\n             */\n            s->lookahead -= s->prev_length-1;\n            s->prev_length -= 2;\n            do {\n                if (++s->strstart <= max_insert) {\n                    INSERT_STRING(s, s->strstart, hash_head);\n                }\n            } while (--s->prev_length != 0);\n            s->match_available = 0;\n            s->match_length = MIN_MATCH-1;\n            s->strstart++;\n\n            if (bflush) FLUSH_BLOCK(s, 0);\n\n        } else if (s->match_available) {\n            /* If there was no match at the previous position, output a\n             * single literal. If there was a match but the current match\n             * is longer, truncate the previous match to a single literal.\n             */\n            Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n            _tr_tally_lit(s, s->window[s->strstart-1], bflush);\n            if (bflush) {\n                FLUSH_BLOCK_ONLY(s, 0);\n            }\n            s->strstart++;\n            s->lookahead--;\n            if (s->strm->avail_out == 0) return need_more;\n        } else {\n            /* There is no previous match to compare with, wait for\n             * the next step to decide.\n             */\n            s->match_available = 1;\n            s->strstart++;\n            s->lookahead--;\n        }\n    }\n    Assert (flush != Z_NO_FLUSH, \"no flush?\");\n    if (s->match_available) {\n        Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n        _tr_tally_lit(s, s->window[s->strstart-1], bflush);\n        s->match_available = 0;\n    }\n    s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;\n    if (flush == Z_FINISH) {\n        FLUSH_BLOCK(s, 1);\n        return finish_done;\n    }\n    if (s->last_lit)\n        FLUSH_BLOCK(s, 0);\n    return block_done;\n}\n#endif /* FASTEST */\n\n/* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one.  Do not maintain a hash table.  (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\nlocal block_state deflate_rle(s, flush)\n    deflate_state *s;\n    int flush;\n{\n    int bflush;             /* set if current block must be flushed */\n    uInt prev;              /* byte at distance one to match */\n    Bytef *scan, *strend;   /* scan goes up to strend for length of run */\n\n    for (;;) {\n        /* Make sure that we always have enough lookahead, except\n         * at the end of the input file. We need MAX_MATCH bytes\n         * for the longest run, plus one for the unrolled loop.\n         */\n        if (s->lookahead <= MAX_MATCH) {\n            fill_window(s);\n            if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) {\n                return need_more;\n            }\n            if (s->lookahead == 0) break; /* flush the current block */\n        }\n\n        /* See how many times the previous byte repeats */\n        s->match_length = 0;\n        if (s->lookahead >= MIN_MATCH && s->strstart > 0) {\n            scan = s->window + s->strstart - 1;\n            prev = *scan;\n            if (prev == *++scan && prev == *++scan && prev == *++scan) {\n                strend = s->window + s->strstart + MAX_MATCH;\n                do {\n                } while (prev == *++scan && prev == *++scan &&\n                         prev == *++scan && prev == *++scan &&\n                         prev == *++scan && prev == *++scan &&\n                         prev == *++scan && prev == *++scan &&\n                         scan < strend);\n                s->match_length = MAX_MATCH - (int)(strend - scan);\n                if (s->match_length > s->lookahead)\n                    s->match_length = s->lookahead;\n            }\n            Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n        }\n\n        /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n        if (s->match_length >= MIN_MATCH) {\n            check_match(s, s->strstart, s->strstart - 1, s->match_length);\n\n            _tr_tally_dist(s, 1, s->match_length - MIN_MATCH, bflush);\n\n            s->lookahead -= s->match_length;\n            s->strstart += s->match_length;\n            s->match_length = 0;\n        } else {\n            /* No match, output a literal byte */\n            Tracevv((stderr,\"%c\", s->window[s->strstart]));\n            _tr_tally_lit (s, s->window[s->strstart], bflush);\n            s->lookahead--;\n            s->strstart++;\n        }\n        if (bflush) FLUSH_BLOCK(s, 0);\n    }\n    s->insert = 0;\n    if (flush == Z_FINISH) {\n        FLUSH_BLOCK(s, 1);\n        return finish_done;\n    }\n    if (s->last_lit)\n        FLUSH_BLOCK(s, 0);\n    return block_done;\n}\n\n/* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches.  Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\nlocal block_state deflate_huff(s, flush)\n    deflate_state *s;\n    int flush;\n{\n    int bflush;             /* set if current block must be flushed */\n\n    for (;;) {\n        /* Make sure that we have a literal to write. */\n        if (s->lookahead == 0) {\n            fill_window(s);\n            if (s->lookahead == 0) {\n                if (flush == Z_NO_FLUSH)\n                    return need_more;\n                break;      /* flush the current block */\n            }\n        }\n\n        /* Output a literal byte */\n        s->match_length = 0;\n        Tracevv((stderr,\"%c\", s->window[s->strstart]));\n        _tr_tally_lit (s, s->window[s->strstart], bflush);\n        s->lookahead--;\n        s->strstart++;\n        if (bflush) FLUSH_BLOCK(s, 0);\n    }\n    s->insert = 0;\n    if (flush == Z_FINISH) {\n        FLUSH_BLOCK(s, 1);\n        return finish_done;\n    }\n    if (s->last_lit)\n        FLUSH_BLOCK(s, 0);\n    return block_done;\n}\n"
  },
  {
    "path": "ext/zlib/deflate.h",
    "content": "/* deflate.h -- internal compression state\n * Copyright (C) 1995-2012 Jean-loup Gailly\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/* WARNING: this file should *not* be used by applications. It is\n   part of the implementation of the compression library and is\n   subject to change. Applications should only use zlib.h.\n */\n\n/* @(#) $Id$ */\n\n#ifndef DEFLATE_H\n#define DEFLATE_H\n\n#include \"zutil.h\"\n\n/* define NO_GZIP when compiling if you want to disable gzip header and\n   trailer creation by deflate().  NO_GZIP would be used to avoid linking in\n   the crc code when it is not needed.  For shared libraries, gzip encoding\n   should be left enabled. */\n#ifndef NO_GZIP\n#  define GZIP\n#endif\n\n/* ===========================================================================\n * Internal compression state.\n */\n\n#define LENGTH_CODES 29\n/* number of length codes, not counting the special END_BLOCK code */\n\n#define LITERALS  256\n/* number of literal bytes 0..255 */\n\n#define L_CODES (LITERALS+1+LENGTH_CODES)\n/* number of Literal or Length codes, including the END_BLOCK code */\n\n#define D_CODES   30\n/* number of distance codes */\n\n#define BL_CODES  19\n/* number of codes used to transfer the bit lengths */\n\n#define HEAP_SIZE (2*L_CODES+1)\n/* maximum heap size */\n\n#define MAX_BITS 15\n/* All codes must not exceed MAX_BITS bits */\n\n#define Buf_size 16\n/* size of bit buffer in bi_buf */\n\n#define INIT_STATE    42\n#define EXTRA_STATE   69\n#define NAME_STATE    73\n#define COMMENT_STATE 91\n#define HCRC_STATE   103\n#define BUSY_STATE   113\n#define FINISH_STATE 666\n/* Stream status */\n\n\n/* Data structure describing a single value and its code string. */\ntypedef struct ct_data_s {\n    union {\n        ush  freq;       /* frequency count */\n        ush  code;       /* bit string */\n    } fc;\n    union {\n        ush  dad;        /* father node in Huffman tree */\n        ush  len;        /* length of bit string */\n    } dl;\n} FAR ct_data;\n\n#define Freq fc.freq\n#define Code fc.code\n#define Dad  dl.dad\n#define Len  dl.len\n\ntypedef struct static_tree_desc_s  static_tree_desc;\n\ntypedef struct tree_desc_s {\n    ct_data *dyn_tree;           /* the dynamic tree */\n    int     max_code;            /* largest code with non zero frequency */\n    static_tree_desc *stat_desc; /* the corresponding static tree */\n} FAR tree_desc;\n\ntypedef ush Pos;\ntypedef Pos FAR Posf;\ntypedef unsigned IPos;\n\n/* A Pos is an index in the character window. We use short instead of int to\n * save space in the various tables. IPos is used only for parameter passing.\n */\n\ntypedef struct internal_state {\n    z_streamp strm;      /* pointer back to this zlib stream */\n    int   status;        /* as the name implies */\n    Bytef *pending_buf;  /* output still pending */\n    ulg   pending_buf_size; /* size of pending_buf */\n    Bytef *pending_out;  /* next pending byte to output to the stream */\n    uInt   pending;      /* nb of bytes in the pending buffer */\n    int   wrap;          /* bit 0 true for zlib, bit 1 true for gzip */\n    gz_headerp  gzhead;  /* gzip header information to write */\n    uInt   gzindex;      /* where in extra, name, or comment */\n    Byte  method;        /* can only be DEFLATED */\n    int   last_flush;    /* value of flush param for previous deflate call */\n\n                /* used by deflate.c: */\n\n    uInt  w_size;        /* LZ77 window size (32K by default) */\n    uInt  w_bits;        /* log2(w_size)  (8..16) */\n    uInt  w_mask;        /* w_size - 1 */\n\n    Bytef *window;\n    /* Sliding window. Input bytes are read into the second half of the window,\n     * and move to the first half later to keep a dictionary of at least wSize\n     * bytes. With this organization, matches are limited to a distance of\n     * wSize-MAX_MATCH bytes, but this ensures that IO is always\n     * performed with a length multiple of the block size. Also, it limits\n     * the window size to 64K, which is quite useful on MSDOS.\n     * To do: use the user input buffer as sliding window.\n     */\n\n    ulg window_size;\n    /* Actual size of window: 2*wSize, except when the user input buffer\n     * is directly used as sliding window.\n     */\n\n    Posf *prev;\n    /* Link to older string with same hash index. To limit the size of this\n     * array to 64K, this link is maintained only for the last 32K strings.\n     * An index in this array is thus a window index modulo 32K.\n     */\n\n    Posf *head; /* Heads of the hash chains or NIL. */\n\n    uInt  ins_h;          /* hash index of string to be inserted */\n    uInt  hash_size;      /* number of elements in hash table */\n    uInt  hash_bits;      /* log2(hash_size) */\n    uInt  hash_mask;      /* hash_size-1 */\n\n    uInt  hash_shift;\n    /* Number of bits by which ins_h must be shifted at each input\n     * step. It must be such that after MIN_MATCH steps, the oldest\n     * byte no longer takes part in the hash key, that is:\n     *   hash_shift * MIN_MATCH >= hash_bits\n     */\n\n    long block_start;\n    /* Window position at the beginning of the current output block. Gets\n     * negative when the window is moved backwards.\n     */\n\n    uInt match_length;           /* length of best match */\n    IPos prev_match;             /* previous match */\n    int match_available;         /* set if previous match exists */\n    uInt strstart;               /* start of string to insert */\n    uInt match_start;            /* start of matching string */\n    uInt lookahead;              /* number of valid bytes ahead in window */\n\n    uInt prev_length;\n    /* Length of the best match at previous step. Matches not greater than this\n     * are discarded. This is used in the lazy match evaluation.\n     */\n\n    uInt max_chain_length;\n    /* To speed up deflation, hash chains are never searched beyond this\n     * length.  A higher limit improves compression ratio but degrades the\n     * speed.\n     */\n\n    uInt max_lazy_match;\n    /* Attempt to find a better match only when the current match is strictly\n     * smaller than this value. This mechanism is used only for compression\n     * levels >= 4.\n     */\n#   define max_insert_length  max_lazy_match\n    /* Insert new strings in the hash table only if the match length is not\n     * greater than this length. This saves time but degrades compression.\n     * max_insert_length is used only for compression levels <= 3.\n     */\n\n    int level;    /* compression level (1..9) */\n    int strategy; /* favor or force Huffman coding*/\n\n    uInt good_match;\n    /* Use a faster search when the previous match is longer than this */\n\n    int nice_match; /* Stop searching when current match exceeds this */\n\n                /* used by trees.c: */\n    /* Didn't use ct_data typedef below to suppress compiler warning */\n    struct ct_data_s dyn_ltree[HEAP_SIZE];   /* literal and length tree */\n    struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n    struct ct_data_s bl_tree[2*BL_CODES+1];  /* Huffman tree for bit lengths */\n\n    struct tree_desc_s l_desc;               /* desc. for literal tree */\n    struct tree_desc_s d_desc;               /* desc. for distance tree */\n    struct tree_desc_s bl_desc;              /* desc. for bit length tree */\n\n    ush bl_count[MAX_BITS+1];\n    /* number of codes at each bit length for an optimal tree */\n\n    int heap[2*L_CODES+1];      /* heap used to build the Huffman trees */\n    int heap_len;               /* number of elements in the heap */\n    int heap_max;               /* element of largest frequency */\n    /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n     * The same heap array is used to build all trees.\n     */\n\n    uch depth[2*L_CODES+1];\n    /* Depth of each subtree used as tie breaker for trees of equal frequency\n     */\n\n    uchf *l_buf;          /* buffer for literals or lengths */\n\n    uInt  lit_bufsize;\n    /* Size of match buffer for literals/lengths.  There are 4 reasons for\n     * limiting lit_bufsize to 64K:\n     *   - frequencies can be kept in 16 bit counters\n     *   - if compression is not successful for the first block, all input\n     *     data is still in the window so we can still emit a stored block even\n     *     when input comes from standard input.  (This can also be done for\n     *     all blocks if lit_bufsize is not greater than 32K.)\n     *   - if compression is not successful for a file smaller than 64K, we can\n     *     even emit a stored file instead of a stored block (saving 5 bytes).\n     *     This is applicable only for zip (not gzip or zlib).\n     *   - creating new Huffman trees less frequently may not provide fast\n     *     adaptation to changes in the input data statistics. (Take for\n     *     example a binary file with poorly compressible code followed by\n     *     a highly compressible string table.) Smaller buffer sizes give\n     *     fast adaptation but have of course the overhead of transmitting\n     *     trees more frequently.\n     *   - I can't count above 4\n     */\n\n    uInt last_lit;      /* running index in l_buf */\n\n    ushf *d_buf;\n    /* Buffer for distances. To simplify the code, d_buf and l_buf have\n     * the same number of elements. To use different lengths, an extra flag\n     * array would be necessary.\n     */\n\n    ulg opt_len;        /* bit length of current block with optimal trees */\n    ulg static_len;     /* bit length of current block with static trees */\n    uInt matches;       /* number of string matches in current block */\n    uInt insert;        /* bytes at end of window left to insert */\n\n#ifdef DEBUG\n    ulg compressed_len; /* total bit length of compressed file mod 2^32 */\n    ulg bits_sent;      /* bit length of compressed data sent mod 2^32 */\n#endif\n\n    ush bi_buf;\n    /* Output buffer. bits are inserted starting at the bottom (least\n     * significant bits).\n     */\n    int bi_valid;\n    /* Number of valid bits in bi_buf.  All bits above the last valid bit\n     * are always zero.\n     */\n\n    ulg high_water;\n    /* High water mark offset in window for initialized bytes -- bytes above\n     * this are set to zero in order to avoid memory check warnings when\n     * longest match routines access bytes past the input.  This is then\n     * updated to the new high water mark.\n     */\n\n} FAR deflate_state;\n\n/* Output a byte on the stream.\n * IN assertion: there is enough room in pending_buf.\n */\n#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);}\n\n\n#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)\n/* Minimum amount of lookahead, except at the end of the input file.\n * See deflate.c for comments about the MIN_MATCH+1.\n */\n\n#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)\n/* In order to simplify the code, particularly on 16 bit machines, match\n * distances are limited to MAX_DIST instead of WSIZE.\n */\n\n#define WIN_INIT MAX_MATCH\n/* Number of bytes after end of data in window to initialize in order to avoid\n   memory checker errors from longest match routines */\n\n        /* in trees.c */\nvoid ZLIB_INTERNAL _tr_init OF((deflate_state *s));\nint ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));\nvoid ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf,\n                        ulg stored_len, int last));\nvoid ZLIB_INTERNAL _tr_flush_bits OF((deflate_state *s));\nvoid ZLIB_INTERNAL _tr_align OF((deflate_state *s));\nvoid ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,\n                        ulg stored_len, int last));\n\n#define d_code(dist) \\\n   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])\n/* Mapping from a distance to a distance code. dist is the distance - 1 and\n * must not have side effects. _dist_code[256] and _dist_code[257] are never\n * used.\n */\n\n#ifndef DEBUG\n/* Inline versions of _tr_tally for speed: */\n\n#if defined(GEN_TREES_H) || !defined(STDC)\n  extern uch ZLIB_INTERNAL _length_code[];\n  extern uch ZLIB_INTERNAL _dist_code[];\n#else\n  extern const uch ZLIB_INTERNAL _length_code[];\n  extern const uch ZLIB_INTERNAL _dist_code[];\n#endif\n\n# define _tr_tally_lit(s, c, flush) \\\n  { uch cc = (c); \\\n    s->d_buf[s->last_lit] = 0; \\\n    s->l_buf[s->last_lit++] = cc; \\\n    s->dyn_ltree[cc].Freq++; \\\n    flush = (s->last_lit == s->lit_bufsize-1); \\\n   }\n# define _tr_tally_dist(s, distance, length, flush) \\\n  { uch len = (length); \\\n    ush dist = (distance); \\\n    s->d_buf[s->last_lit] = dist; \\\n    s->l_buf[s->last_lit++] = len; \\\n    dist--; \\\n    s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \\\n    s->dyn_dtree[d_code(dist)].Freq++; \\\n    flush = (s->last_lit == s->lit_bufsize-1); \\\n  }\n#else\n# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)\n# define _tr_tally_dist(s, distance, length, flush) \\\n              flush = _tr_tally(s, distance, length)\n#endif\n\n#endif /* DEFLATE_H */\n"
  },
  {
    "path": "ext/zlib/gzclose.c",
    "content": "/* gzclose.c -- zlib gzclose() function\n * Copyright (C) 2004, 2010 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n#include \"gzguts.h\"\n\n/* gzclose() is in a separate file so that it is linked in only if it is used.\n   That way the other gzclose functions can be used instead to avoid linking in\n   unneeded compression or decompression routines. */\nint ZEXPORT gzclose(file)\n    gzFile file;\n{\n#ifndef NO_GZCOMPRESS\n    gz_statep state;\n\n    if (file == NULL)\n        return Z_STREAM_ERROR;\n    state = (gz_statep)file;\n\n    return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);\n#else\n    return gzclose_r(file);\n#endif\n}\n"
  },
  {
    "path": "ext/zlib/gzguts.h",
    "content": "/* gzguts.h -- zlib internal header definitions for gz* operations\n * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n#ifdef _LARGEFILE64_SOURCE\n#  ifndef _LARGEFILE_SOURCE\n#    define _LARGEFILE_SOURCE 1\n#  endif\n#  ifdef _FILE_OFFSET_BITS\n#    undef _FILE_OFFSET_BITS\n#  endif\n#endif\n\n#ifdef HAVE_HIDDEN\n#  define ZLIB_INTERNAL __attribute__((visibility (\"hidden\")))\n#else\n#  define ZLIB_INTERNAL\n#endif\n\n#include <stdio.h>\n#include \"zlib.h\"\n#ifdef STDC\n#  include <string.h>\n#  include <stdlib.h>\n#  include <limits.h>\n#endif\n#include <fcntl.h>\n\n#ifdef _WIN32\n#  include <stddef.h>\n#endif\n\n#if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32)\n#  include <io.h>\n#endif\n\n#ifdef WINAPI_FAMILY\n#  define open _open\n#  define read _read\n#  define write _write\n#  define close _close\n#endif\n\n#ifdef NO_DEFLATE       /* for compatibility with old definition */\n#  define NO_GZCOMPRESS\n#endif\n\n#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)\n#  ifndef HAVE_VSNPRINTF\n#    define HAVE_VSNPRINTF\n#  endif\n#endif\n\n#if defined(__CYGWIN__)\n#  ifndef HAVE_VSNPRINTF\n#    define HAVE_VSNPRINTF\n#  endif\n#endif\n\n#if defined(MSDOS) && defined(__BORLANDC__) && (BORLANDC > 0x410)\n#  ifndef HAVE_VSNPRINTF\n#    define HAVE_VSNPRINTF\n#  endif\n#endif\n\n#ifndef HAVE_VSNPRINTF\n#  ifdef MSDOS\n/* vsnprintf may exist on some MS-DOS compilers (DJGPP?),\n   but for now we just assume it doesn't. */\n#    define NO_vsnprintf\n#  endif\n#  ifdef __TURBOC__\n#    define NO_vsnprintf\n#  endif\n#  ifdef WIN32\n/* In Win32, vsnprintf is available as the \"non-ANSI\" _vsnprintf. */\n#    if !defined(vsnprintf) && !defined(NO_vsnprintf)\n#      if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )\n#         define vsnprintf _vsnprintf\n#      endif\n#    endif\n#  endif\n#  ifdef __SASC\n#    define NO_vsnprintf\n#  endif\n#  ifdef VMS\n#    define NO_vsnprintf\n#  endif\n#  ifdef __OS400__\n#    define NO_vsnprintf\n#  endif\n#  ifdef __MVS__\n#    define NO_vsnprintf\n#  endif\n#endif\n\n/* unlike snprintf (which is required in C99, yet still not supported by\n   Microsoft more than a decade later!), _snprintf does not guarantee null\n   termination of the result -- however this is only used in gzlib.c where\n   the result is assured to fit in the space provided */\n#ifdef _MSC_VER\n#  define snprintf _snprintf\n#endif\n\n#ifndef local\n#  define local static\n#endif\n/* compile with -Dlocal if your debugger can't find static symbols */\n\n/* gz* functions always use library allocation functions */\n#ifndef STDC\n  extern voidp  malloc OF((uInt size));\n  extern void   free   OF((voidpf ptr));\n#endif\n\n/* get errno and strerror definition */\n#if defined UNDER_CE\n#  include <windows.h>\n#  define zstrerror() gz_strwinerror((DWORD)GetLastError())\n#else\n#  ifndef NO_STRERROR\n#    include <errno.h>\n#    define zstrerror() strerror(errno)\n#  else\n#    define zstrerror() \"stdio error (consult errno)\"\n#  endif\n#endif\n\n/* provide prototypes for these when building zlib without LFS */\n#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0\n    ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));\n    ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));\n    ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));\n    ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));\n#endif\n\n/* default memLevel */\n#if MAX_MEM_LEVEL >= 8\n#  define DEF_MEM_LEVEL 8\n#else\n#  define DEF_MEM_LEVEL  MAX_MEM_LEVEL\n#endif\n\n/* default i/o buffer size -- double this for output when reading (this and\n   twice this must be able to fit in an unsigned type) */\n#define GZBUFSIZE 8192\n\n/* gzip modes, also provide a little integrity check on the passed structure */\n#define GZ_NONE 0\n#define GZ_READ 7247\n#define GZ_WRITE 31153\n#define GZ_APPEND 1     /* mode set to GZ_WRITE after the file is opened */\n\n/* values for gz_state how */\n#define LOOK 0      /* look for a gzip header */\n#define COPY 1      /* copy input directly */\n#define GZIP 2      /* decompress a gzip stream */\n\n/* internal gzip file state data structure */\ntypedef struct {\n        /* exposed contents for gzgetc() macro */\n    struct gzFile_s x;      /* \"x\" for exposed */\n                            /* x.have: number of bytes available at x.next */\n                            /* x.next: next output data to deliver or write */\n                            /* x.pos: current position in uncompressed data */\n        /* used for both reading and writing */\n    int mode;               /* see gzip modes above */\n    int fd;                 /* file descriptor */\n    char *path;             /* path or fd for error messages */\n    unsigned size;          /* buffer size, zero if not allocated yet */\n    unsigned want;          /* requested buffer size, default is GZBUFSIZE */\n    unsigned char *in;      /* input buffer */\n    unsigned char *out;     /* output buffer (double-sized when reading) */\n    int direct;             /* 0 if processing gzip, 1 if transparent */\n        /* just for reading */\n    int how;                /* 0: get header, 1: copy, 2: decompress */\n    z_off64_t start;        /* where the gzip data started, for rewinding */\n    int eof;                /* true if end of input file reached */\n    int past;               /* true if read requested past end */\n        /* just for writing */\n    int level;              /* compression level */\n    int strategy;           /* compression strategy */\n        /* seek request */\n    z_off64_t skip;         /* amount to skip (already rewound if backwards) */\n    int seek;               /* true if seek request pending */\n        /* error information */\n    int err;                /* error code */\n    char *msg;              /* error message */\n        /* zlib inflate or deflate stream */\n    z_stream strm;          /* stream structure in-place (not a pointer) */\n} gz_state;\ntypedef gz_state FAR *gz_statep;\n\n/* shared functions */\nvoid ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *));\n#if defined UNDER_CE\nchar ZLIB_INTERNAL *gz_strwinerror OF((DWORD error));\n#endif\n\n/* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t\n   value -- needed when comparing unsigned to z_off64_t, which is signed\n   (possible z_off64_t types off_t, off64_t, and long are all signed) */\n#ifdef INT_MAX\n#  define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX)\n#else\nunsigned ZLIB_INTERNAL gz_intmax OF((void));\n#  define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())\n#endif\n"
  },
  {
    "path": "ext/zlib/gzlib.c",
    "content": "/* gzlib.c -- zlib functions common to reading and writing gzip files\n * Copyright (C) 2004, 2010, 2011, 2012, 2013 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n#include \"gzguts.h\"\n\n#if defined(_WIN32) && !defined(__BORLANDC__)\n#  define LSEEK _lseeki64\n#else\n#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0\n#  define LSEEK lseek64\n#else\n#  define LSEEK lseek\n#endif\n#endif\n\n/* Local functions */\nlocal void gz_reset OF((gz_statep));\nlocal gzFile gz_open OF((const void *, int, const char *));\n\n#if defined UNDER_CE\n\n/* Map the Windows error number in ERROR to a locale-dependent error message\n   string and return a pointer to it.  Typically, the values for ERROR come\n   from GetLastError.\n\n   The string pointed to shall not be modified by the application, but may be\n   overwritten by a subsequent call to gz_strwinerror\n\n   The gz_strwinerror function does not change the current setting of\n   GetLastError. */\nchar ZLIB_INTERNAL *gz_strwinerror (error)\n     DWORD error;\n{\n    static char buf[1024];\n\n    wchar_t *msgbuf;\n    DWORD lasterr = GetLastError();\n    DWORD chars = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM\n        | FORMAT_MESSAGE_ALLOCATE_BUFFER,\n        NULL,\n        error,\n        0, /* Default language */\n        (LPVOID)&msgbuf,\n        0,\n        NULL);\n    if (chars != 0) {\n        /* If there is an \\r\\n appended, zap it.  */\n        if (chars >= 2\n            && msgbuf[chars - 2] == '\\r' && msgbuf[chars - 1] == '\\n') {\n            chars -= 2;\n            msgbuf[chars] = 0;\n        }\n\n        if (chars > sizeof (buf) - 1) {\n            chars = sizeof (buf) - 1;\n            msgbuf[chars] = 0;\n        }\n\n        wcstombs(buf, msgbuf, chars + 1);\n        LocalFree(msgbuf);\n    }\n    else {\n        sprintf(buf, \"unknown win32 error (%ld)\", error);\n    }\n\n    SetLastError(lasterr);\n    return buf;\n}\n\n#endif /* UNDER_CE */\n\n/* Reset gzip file state */\nlocal void gz_reset(state)\n    gz_statep state;\n{\n    state->x.have = 0;              /* no output data available */\n    if (state->mode == GZ_READ) {   /* for reading ... */\n        state->eof = 0;             /* not at end of file */\n        state->past = 0;            /* have not read past end yet */\n        state->how = LOOK;          /* look for gzip header */\n    }\n    state->seek = 0;                /* no seek request pending */\n    gz_error(state, Z_OK, NULL);    /* clear error */\n    state->x.pos = 0;               /* no uncompressed data yet */\n    state->strm.avail_in = 0;       /* no input data yet */\n}\n\n/* Open a gzip file either by name or file descriptor. */\nlocal gzFile gz_open(path, fd, mode)\n    const void *path;\n    int fd;\n    const char *mode;\n{\n    gz_statep state;\n    size_t len;\n    int oflag;\n#ifdef O_CLOEXEC\n    int cloexec = 0;\n#endif\n#ifdef O_EXCL\n    int exclusive = 0;\n#endif\n\n    /* check input */\n    if (path == NULL)\n        return NULL;\n\n    /* allocate gzFile structure to return */\n    state = (gz_statep)malloc(sizeof(gz_state));\n    if (state == NULL)\n        return NULL;\n    state->size = 0;            /* no buffers allocated yet */\n    state->want = GZBUFSIZE;    /* requested buffer size */\n    state->msg = NULL;          /* no error message yet */\n\n    /* interpret mode */\n    state->mode = GZ_NONE;\n    state->level = Z_DEFAULT_COMPRESSION;\n    state->strategy = Z_DEFAULT_STRATEGY;\n    state->direct = 0;\n    while (*mode) {\n        if (*mode >= '0' && *mode <= '9')\n            state->level = *mode - '0';\n        else\n            switch (*mode) {\n            case 'r':\n                state->mode = GZ_READ;\n                break;\n#ifndef NO_GZCOMPRESS\n            case 'w':\n                state->mode = GZ_WRITE;\n                break;\n            case 'a':\n                state->mode = GZ_APPEND;\n                break;\n#endif\n            case '+':       /* can't read and write at the same time */\n                free(state);\n                return NULL;\n            case 'b':       /* ignore -- will request binary anyway */\n                break;\n#ifdef O_CLOEXEC\n            case 'e':\n                cloexec = 1;\n                break;\n#endif\n#ifdef O_EXCL\n            case 'x':\n                exclusive = 1;\n                break;\n#endif\n            case 'f':\n                state->strategy = Z_FILTERED;\n                break;\n            case 'h':\n                state->strategy = Z_HUFFMAN_ONLY;\n                break;\n            case 'R':\n                state->strategy = Z_RLE;\n                break;\n            case 'F':\n                state->strategy = Z_FIXED;\n                break;\n            case 'T':\n                state->direct = 1;\n                break;\n            default:        /* could consider as an error, but just ignore */\n                ;\n            }\n        mode++;\n    }\n\n    /* must provide an \"r\", \"w\", or \"a\" */\n    if (state->mode == GZ_NONE) {\n        free(state);\n        return NULL;\n    }\n\n    /* can't force transparent read */\n    if (state->mode == GZ_READ) {\n        if (state->direct) {\n            free(state);\n            return NULL;\n        }\n        state->direct = 1;      /* for empty file */\n    }\n\n    /* save the path name for error messages */\n#ifdef _WIN32\n    if (fd == -2) {\n        len = wcstombs(NULL, path, 0);\n        if (len == (size_t)-1)\n            len = 0;\n    }\n    else\n#endif\n        len = strlen((const char *)path);\n    state->path = (char *)malloc(len + 1);\n    if (state->path == NULL) {\n        free(state);\n        return NULL;\n    }\n#ifdef _WIN32\n    if (fd == -2)\n        if (len)\n            wcstombs(state->path, path, len + 1);\n        else\n            *(state->path) = 0;\n    else\n#endif\n#if !defined(NO_snprintf) && !defined(NO_vsnprintf)\n        snprintf(state->path, len + 1, \"%s\", (const char *)path);\n#else\n        strcpy(state->path, path);\n#endif\n\n    /* compute the flags for open() */\n    oflag =\n#ifdef O_LARGEFILE\n        O_LARGEFILE |\n#endif\n#ifdef O_BINARY\n        O_BINARY |\n#endif\n#ifdef O_CLOEXEC\n        (cloexec ? O_CLOEXEC : 0) |\n#endif\n        (state->mode == GZ_READ ?\n         O_RDONLY :\n         (O_WRONLY | O_CREAT |\n#ifdef O_EXCL\n          (exclusive ? O_EXCL : 0) |\n#endif\n          (state->mode == GZ_WRITE ?\n           O_TRUNC :\n           O_APPEND)));\n\n    /* open the file with the appropriate flags (or just use fd) */\n    state->fd = fd > -1 ? fd : (\n#ifdef _WIN32\n        fd == -2 ? _wopen(path, oflag, 0666) :\n#endif\n        open((const char *)path, oflag, 0666));\n    if (state->fd == -1) {\n        free(state->path);\n        free(state);\n        return NULL;\n    }\n    if (state->mode == GZ_APPEND)\n        state->mode = GZ_WRITE;         /* simplify later checks */\n\n    /* save the current position for rewinding (only if reading) */\n    if (state->mode == GZ_READ) {\n        state->start = LSEEK(state->fd, 0, SEEK_CUR);\n        if (state->start == -1) state->start = 0;\n    }\n\n    /* initialize stream */\n    gz_reset(state);\n\n    /* return stream */\n    return (gzFile)state;\n}\n\n/* -- see zlib.h -- */\ngzFile ZEXPORT gzopen(path, mode)\n    const char *path;\n    const char *mode;\n{\n    return gz_open(path, -1, mode);\n}\n\n/* -- see zlib.h -- */\ngzFile ZEXPORT gzopen64(path, mode)\n    const char *path;\n    const char *mode;\n{\n    return gz_open(path, -1, mode);\n}\n\n/* -- see zlib.h -- */\ngzFile ZEXPORT gzdopen(fd, mode)\n    int fd;\n    const char *mode;\n{\n    char *path;         /* identifier for error messages */\n    gzFile gz;\n\n    if (fd == -1 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL)\n        return NULL;\n#if !defined(NO_snprintf) && !defined(NO_vsnprintf)\n    snprintf(path, 7 + 3 * sizeof(int), \"<fd:%d>\", fd); /* for debugging */\n#else\n    sprintf(path, \"<fd:%d>\", fd);   /* for debugging */\n#endif\n    gz = gz_open(path, fd, mode);\n    free(path);\n    return gz;\n}\n\n/* -- see zlib.h -- */\n#ifdef _WIN32\ngzFile ZEXPORT gzopen_w(path, mode)\n    const wchar_t *path;\n    const char *mode;\n{\n    return gz_open(path, -2, mode);\n}\n#endif\n\n/* -- see zlib.h -- */\nint ZEXPORT gzbuffer(file, size)\n    gzFile file;\n    unsigned size;\n{\n    gz_statep state;\n\n    /* get internal structure and check integrity */\n    if (file == NULL)\n        return -1;\n    state = (gz_statep)file;\n    if (state->mode != GZ_READ && state->mode != GZ_WRITE)\n        return -1;\n\n    /* make sure we haven't already allocated memory */\n    if (state->size != 0)\n        return -1;\n\n    /* check and set requested size */\n    if (size < 2)\n        size = 2;               /* need two bytes to check magic header */\n    state->want = size;\n    return 0;\n}\n\n/* -- see zlib.h -- */\nint ZEXPORT gzrewind(file)\n    gzFile file;\n{\n    gz_statep state;\n\n    /* get internal structure */\n    if (file == NULL)\n        return -1;\n    state = (gz_statep)file;\n\n    /* check that we're reading and that there's no error */\n    if (state->mode != GZ_READ ||\n            (state->err != Z_OK && state->err != Z_BUF_ERROR))\n        return -1;\n\n    /* back up and start over */\n    if (LSEEK(state->fd, state->start, SEEK_SET) == -1)\n        return -1;\n    gz_reset(state);\n    return 0;\n}\n\n/* -- see zlib.h -- */\nz_off64_t ZEXPORT gzseek64(file, offset, whence)\n    gzFile file;\n    z_off64_t offset;\n    int whence;\n{\n    unsigned n;\n    z_off64_t ret;\n    gz_statep state;\n\n    /* get internal structure and check integrity */\n    if (file == NULL)\n        return -1;\n    state = (gz_statep)file;\n    if (state->mode != GZ_READ && state->mode != GZ_WRITE)\n        return -1;\n\n    /* check that there's no error */\n    if (state->err != Z_OK && state->err != Z_BUF_ERROR)\n        return -1;\n\n    /* can only seek from start or relative to current position */\n    if (whence != SEEK_SET && whence != SEEK_CUR)\n        return -1;\n\n    /* normalize offset to a SEEK_CUR specification */\n    if (whence == SEEK_SET)\n        offset -= state->x.pos;\n    else if (state->seek)\n        offset += state->skip;\n    state->seek = 0;\n\n    /* if within raw area while reading, just go there */\n    if (state->mode == GZ_READ && state->how == COPY &&\n            state->x.pos + offset >= 0) {\n        ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR);\n        if (ret == -1)\n            return -1;\n        state->x.have = 0;\n        state->eof = 0;\n        state->past = 0;\n        state->seek = 0;\n        gz_error(state, Z_OK, NULL);\n        state->strm.avail_in = 0;\n        state->x.pos += offset;\n        return state->x.pos;\n    }\n\n    /* calculate skip amount, rewinding if needed for back seek when reading */\n    if (offset < 0) {\n        if (state->mode != GZ_READ)         /* writing -- can't go backwards */\n            return -1;\n        offset += state->x.pos;\n        if (offset < 0)                     /* before start of file! */\n            return -1;\n        if (gzrewind(file) == -1)           /* rewind, then skip to offset */\n            return -1;\n    }\n\n    /* if reading, skip what's in output buffer (one less gzgetc() check) */\n    if (state->mode == GZ_READ) {\n        n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > offset ?\n            (unsigned)offset : state->x.have;\n        state->x.have -= n;\n        state->x.next += n;\n        state->x.pos += n;\n        offset -= n;\n    }\n\n    /* request skip (if not zero) */\n    if (offset) {\n        state->seek = 1;\n        state->skip = offset;\n    }\n    return state->x.pos + offset;\n}\n\n/* -- see zlib.h -- */\nz_off_t ZEXPORT gzseek(file, offset, whence)\n    gzFile file;\n    z_off_t offset;\n    int whence;\n{\n    z_off64_t ret;\n\n    ret = gzseek64(file, (z_off64_t)offset, whence);\n    return ret == (z_off_t)ret ? (z_off_t)ret : -1;\n}\n\n/* -- see zlib.h -- */\nz_off64_t ZEXPORT gztell64(file)\n    gzFile file;\n{\n    gz_statep state;\n\n    /* get internal structure and check integrity */\n    if (file == NULL)\n        return -1;\n    state = (gz_statep)file;\n    if (state->mode != GZ_READ && state->mode != GZ_WRITE)\n        return -1;\n\n    /* return position */\n    return state->x.pos + (state->seek ? state->skip : 0);\n}\n\n/* -- see zlib.h -- */\nz_off_t ZEXPORT gztell(file)\n    gzFile file;\n{\n    z_off64_t ret;\n\n    ret = gztell64(file);\n    return ret == (z_off_t)ret ? (z_off_t)ret : -1;\n}\n\n/* -- see zlib.h -- */\nz_off64_t ZEXPORT gzoffset64(file)\n    gzFile file;\n{\n    z_off64_t offset;\n    gz_statep state;\n\n    /* get internal structure and check integrity */\n    if (file == NULL)\n        return -1;\n    state = (gz_statep)file;\n    if (state->mode != GZ_READ && state->mode != GZ_WRITE)\n        return -1;\n\n    /* compute and return effective offset in file */\n    offset = LSEEK(state->fd, 0, SEEK_CUR);\n    if (offset == -1)\n        return -1;\n    if (state->mode == GZ_READ)             /* reading */\n        offset -= state->strm.avail_in;     /* don't count buffered input */\n    return offset;\n}\n\n/* -- see zlib.h -- */\nz_off_t ZEXPORT gzoffset(file)\n    gzFile file;\n{\n    z_off64_t ret;\n\n    ret = gzoffset64(file);\n    return ret == (z_off_t)ret ? (z_off_t)ret : -1;\n}\n\n/* -- see zlib.h -- */\nint ZEXPORT gzeof(file)\n    gzFile file;\n{\n    gz_statep state;\n\n    /* get internal structure and check integrity */\n    if (file == NULL)\n        return 0;\n    state = (gz_statep)file;\n    if (state->mode != GZ_READ && state->mode != GZ_WRITE)\n        return 0;\n\n    /* return end-of-file state */\n    return state->mode == GZ_READ ? state->past : 0;\n}\n\n/* -- see zlib.h -- */\nconst char * ZEXPORT gzerror(file, errnum)\n    gzFile file;\n    int *errnum;\n{\n    gz_statep state;\n\n    /* get internal structure and check integrity */\n    if (file == NULL)\n        return NULL;\n    state = (gz_statep)file;\n    if (state->mode != GZ_READ && state->mode != GZ_WRITE)\n        return NULL;\n\n    /* return error information */\n    if (errnum != NULL)\n        *errnum = state->err;\n    return state->err == Z_MEM_ERROR ? \"out of memory\" :\n                                       (state->msg == NULL ? \"\" : state->msg);\n}\n\n/* -- see zlib.h -- */\nvoid ZEXPORT gzclearerr(file)\n    gzFile file;\n{\n    gz_statep state;\n\n    /* get internal structure and check integrity */\n    if (file == NULL)\n        return;\n    state = (gz_statep)file;\n    if (state->mode != GZ_READ && state->mode != GZ_WRITE)\n        return;\n\n    /* clear error and end-of-file */\n    if (state->mode == GZ_READ) {\n        state->eof = 0;\n        state->past = 0;\n    }\n    gz_error(state, Z_OK, NULL);\n}\n\n/* Create an error message in allocated memory and set state->err and\n   state->msg accordingly.  Free any previous error message already there.  Do\n   not try to free or allocate space if the error is Z_MEM_ERROR (out of\n   memory).  Simply save the error message as a static string.  If there is an\n   allocation failure constructing the error message, then convert the error to\n   out of memory. */\nvoid ZLIB_INTERNAL gz_error(state, err, msg)\n    gz_statep state;\n    int err;\n    const char *msg;\n{\n    /* free previously allocated message and clear */\n    if (state->msg != NULL) {\n        if (state->err != Z_MEM_ERROR)\n            free(state->msg);\n        state->msg = NULL;\n    }\n\n    /* if fatal, set state->x.have to 0 so that the gzgetc() macro fails */\n    if (err != Z_OK && err != Z_BUF_ERROR)\n        state->x.have = 0;\n\n    /* set error code, and if no message, then done */\n    state->err = err;\n    if (msg == NULL)\n        return;\n\n    /* for an out of memory error, return literal string when requested */\n    if (err == Z_MEM_ERROR)\n        return;\n\n    /* construct error message with path */\n    if ((state->msg = (char *)malloc(strlen(state->path) + strlen(msg) + 3)) ==\n            NULL) {\n        state->err = Z_MEM_ERROR;\n        return;\n    }\n#if !defined(NO_snprintf) && !defined(NO_vsnprintf)\n    snprintf(state->msg, strlen(state->path) + strlen(msg) + 3,\n             \"%s%s%s\", state->path, \": \", msg);\n#else\n    strcpy(state->msg, state->path);\n    strcat(state->msg, \": \");\n    strcat(state->msg, msg);\n#endif\n    return;\n}\n\n#ifndef INT_MAX\n/* portably return maximum value for an int (when limits.h presumed not\n   available) -- we need to do this to cover cases where 2's complement not\n   used, since C standard permits 1's complement and sign-bit representations,\n   otherwise we could just use ((unsigned)-1) >> 1 */\nunsigned ZLIB_INTERNAL gz_intmax()\n{\n    unsigned p, q;\n\n    p = 1;\n    do {\n        q = p;\n        p <<= 1;\n        p++;\n    } while (p > q);\n    return q >> 1;\n}\n#endif\n"
  },
  {
    "path": "ext/zlib/gzread.c",
    "content": "/* gzread.c -- zlib functions for reading gzip files\n * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n#include \"gzguts.h\"\n\n/* Local functions */\nlocal int gz_load OF((gz_statep, unsigned char *, unsigned, unsigned *));\nlocal int gz_avail OF((gz_statep));\nlocal int gz_look OF((gz_statep));\nlocal int gz_decomp OF((gz_statep));\nlocal int gz_fetch OF((gz_statep));\nlocal int gz_skip OF((gz_statep, z_off64_t));\n\n/* Use read() to load a buffer -- return -1 on error, otherwise 0.  Read from\n   state->fd, and update state->eof, state->err, and state->msg as appropriate.\n   This function needs to loop on read(), since read() is not guaranteed to\n   read the number of bytes requested, depending on the type of descriptor. */\nlocal int gz_load(state, buf, len, have)\n    gz_statep state;\n    unsigned char *buf;\n    unsigned len;\n    unsigned *have;\n{\n    int ret;\n\n    *have = 0;\n    do {\n        ret = read(state->fd, buf + *have, len - *have);\n        if (ret <= 0)\n            break;\n        *have += ret;\n    } while (*have < len);\n    if (ret < 0) {\n        gz_error(state, Z_ERRNO, zstrerror());\n        return -1;\n    }\n    if (ret == 0)\n        state->eof = 1;\n    return 0;\n}\n\n/* Load up input buffer and set eof flag if last data loaded -- return -1 on\n   error, 0 otherwise.  Note that the eof flag is set when the end of the input\n   file is reached, even though there may be unused data in the buffer.  Once\n   that data has been used, no more attempts will be made to read the file.\n   If strm->avail_in != 0, then the current data is moved to the beginning of\n   the input buffer, and then the remainder of the buffer is loaded with the\n   available data from the input file. */\nlocal int gz_avail(state)\n    gz_statep state;\n{\n    unsigned got;\n    z_streamp strm = &(state->strm);\n\n    if (state->err != Z_OK && state->err != Z_BUF_ERROR)\n        return -1;\n    if (state->eof == 0) {\n        if (strm->avail_in) {       /* copy what's there to the start */\n            unsigned char *p = state->in;\n            unsigned const char *q = strm->next_in;\n            unsigned n = strm->avail_in;\n            do {\n                *p++ = *q++;\n            } while (--n);\n        }\n        if (gz_load(state, state->in + strm->avail_in,\n                    state->size - strm->avail_in, &got) == -1)\n            return -1;\n        strm->avail_in += got;\n        strm->next_in = state->in;\n    }\n    return 0;\n}\n\n/* Look for gzip header, set up for inflate or copy.  state->x.have must be 0.\n   If this is the first time in, allocate required memory.  state->how will be\n   left unchanged if there is no more input data available, will be set to COPY\n   if there is no gzip header and direct copying will be performed, or it will\n   be set to GZIP for decompression.  If direct copying, then leftover input\n   data from the input buffer will be copied to the output buffer.  In that\n   case, all further file reads will be directly to either the output buffer or\n   a user buffer.  If decompressing, the inflate state will be initialized.\n   gz_look() will return 0 on success or -1 on failure. */\nlocal int gz_look(state)\n    gz_statep state;\n{\n    z_streamp strm = &(state->strm);\n\n    /* allocate read buffers and inflate memory */\n    if (state->size == 0) {\n        /* allocate buffers */\n        state->in = (unsigned char *)malloc(state->want);\n        state->out = (unsigned char *)malloc(state->want << 1);\n        if (state->in == NULL || state->out == NULL) {\n            if (state->out != NULL)\n                free(state->out);\n            if (state->in != NULL)\n                free(state->in);\n            gz_error(state, Z_MEM_ERROR, \"out of memory\");\n            return -1;\n        }\n        state->size = state->want;\n\n        /* allocate inflate memory */\n        state->strm.zalloc = Z_NULL;\n        state->strm.zfree = Z_NULL;\n        state->strm.opaque = Z_NULL;\n        state->strm.avail_in = 0;\n        state->strm.next_in = Z_NULL;\n        if (inflateInit2(&(state->strm), 15 + 16) != Z_OK) {    /* gunzip */\n            free(state->out);\n            free(state->in);\n            state->size = 0;\n            gz_error(state, Z_MEM_ERROR, \"out of memory\");\n            return -1;\n        }\n    }\n\n    /* get at least the magic bytes in the input buffer */\n    if (strm->avail_in < 2) {\n        if (gz_avail(state) == -1)\n            return -1;\n        if (strm->avail_in == 0)\n            return 0;\n    }\n\n    /* look for gzip magic bytes -- if there, do gzip decoding (note: there is\n       a logical dilemma here when considering the case of a partially written\n       gzip file, to wit, if a single 31 byte is written, then we cannot tell\n       whether this is a single-byte file, or just a partially written gzip\n       file -- for here we assume that if a gzip file is being written, then\n       the header will be written in a single operation, so that reading a\n       single byte is sufficient indication that it is not a gzip file) */\n    if (strm->avail_in > 1 &&\n            strm->next_in[0] == 31 && strm->next_in[1] == 139) {\n        inflateReset(strm);\n        state->how = GZIP;\n        state->direct = 0;\n        return 0;\n    }\n\n    /* no gzip header -- if we were decoding gzip before, then this is trailing\n       garbage.  Ignore the trailing garbage and finish. */\n    if (state->direct == 0) {\n        strm->avail_in = 0;\n        state->eof = 1;\n        state->x.have = 0;\n        return 0;\n    }\n\n    /* doing raw i/o, copy any leftover input to output -- this assumes that\n       the output buffer is larger than the input buffer, which also assures\n       space for gzungetc() */\n    state->x.next = state->out;\n    if (strm->avail_in) {\n        memcpy(state->x.next, strm->next_in, strm->avail_in);\n        state->x.have = strm->avail_in;\n        strm->avail_in = 0;\n    }\n    state->how = COPY;\n    state->direct = 1;\n    return 0;\n}\n\n/* Decompress from input to the provided next_out and avail_out in the state.\n   On return, state->x.have and state->x.next point to the just decompressed\n   data.  If the gzip stream completes, state->how is reset to LOOK to look for\n   the next gzip stream or raw data, once state->x.have is depleted.  Returns 0\n   on success, -1 on failure. */\nlocal int gz_decomp(state)\n    gz_statep state;\n{\n    int ret = Z_OK;\n    unsigned had;\n    z_streamp strm = &(state->strm);\n\n    /* fill output buffer up to end of deflate stream */\n    had = strm->avail_out;\n    do {\n        /* get more input for inflate() */\n        if (strm->avail_in == 0 && gz_avail(state) == -1)\n            return -1;\n        if (strm->avail_in == 0) {\n            gz_error(state, Z_BUF_ERROR, \"unexpected end of file\");\n            break;\n        }\n\n        /* decompress and handle errors */\n        ret = inflate(strm, Z_NO_FLUSH);\n        if (ret == Z_STREAM_ERROR || ret == Z_NEED_DICT) {\n            gz_error(state, Z_STREAM_ERROR,\n                     \"internal error: inflate stream corrupt\");\n            return -1;\n        }\n        if (ret == Z_MEM_ERROR) {\n            gz_error(state, Z_MEM_ERROR, \"out of memory\");\n            return -1;\n        }\n        if (ret == Z_DATA_ERROR) {              /* deflate stream invalid */\n            gz_error(state, Z_DATA_ERROR,\n                     strm->msg == NULL ? \"compressed data error\" : strm->msg);\n            return -1;\n        }\n    } while (strm->avail_out && ret != Z_STREAM_END);\n\n    /* update available output */\n    state->x.have = had - strm->avail_out;\n    state->x.next = strm->next_out - state->x.have;\n\n    /* if the gzip stream completed successfully, look for another */\n    if (ret == Z_STREAM_END)\n        state->how = LOOK;\n\n    /* good decompression */\n    return 0;\n}\n\n/* Fetch data and put it in the output buffer.  Assumes state->x.have is 0.\n   Data is either copied from the input file or decompressed from the input\n   file depending on state->how.  If state->how is LOOK, then a gzip header is\n   looked for to determine whether to copy or decompress.  Returns -1 on error,\n   otherwise 0.  gz_fetch() will leave state->how as COPY or GZIP unless the\n   end of the input file has been reached and all data has been processed.  */\nlocal int gz_fetch(state)\n    gz_statep state;\n{\n    z_streamp strm = &(state->strm);\n\n    do {\n        switch(state->how) {\n        case LOOK:      /* -> LOOK, COPY (only if never GZIP), or GZIP */\n            if (gz_look(state) == -1)\n                return -1;\n            if (state->how == LOOK)\n                return 0;\n            break;\n        case COPY:      /* -> COPY */\n            if (gz_load(state, state->out, state->size << 1, &(state->x.have))\n                    == -1)\n                return -1;\n            state->x.next = state->out;\n            return 0;\n        case GZIP:      /* -> GZIP or LOOK (if end of gzip stream) */\n            strm->avail_out = state->size << 1;\n            strm->next_out = state->out;\n            if (gz_decomp(state) == -1)\n                return -1;\n        }\n    } while (state->x.have == 0 && (!state->eof || strm->avail_in));\n    return 0;\n}\n\n/* Skip len uncompressed bytes of output.  Return -1 on error, 0 on success. */\nlocal int gz_skip(state, len)\n    gz_statep state;\n    z_off64_t len;\n{\n    unsigned n;\n\n    /* skip over len bytes or reach end-of-file, whichever comes first */\n    while (len)\n        /* skip over whatever is in output buffer */\n        if (state->x.have) {\n            n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > len ?\n                (unsigned)len : state->x.have;\n            state->x.have -= n;\n            state->x.next += n;\n            state->x.pos += n;\n            len -= n;\n        }\n\n        /* output buffer empty -- return if we're at the end of the input */\n        else if (state->eof && state->strm.avail_in == 0)\n            break;\n\n        /* need more data to skip -- load up output buffer */\n        else {\n            /* get more output, looking for header if required */\n            if (gz_fetch(state) == -1)\n                return -1;\n        }\n    return 0;\n}\n\n/* -- see zlib.h -- */\nint ZEXPORT gzread(file, buf, len)\n    gzFile file;\n    voidp buf;\n    unsigned len;\n{\n    unsigned got, n;\n    gz_statep state;\n    z_streamp strm;\n\n    /* get internal structure */\n    if (file == NULL)\n        return -1;\n    state = (gz_statep)file;\n    strm = &(state->strm);\n\n    /* check that we're reading and that there's no (serious) error */\n    if (state->mode != GZ_READ ||\n            (state->err != Z_OK && state->err != Z_BUF_ERROR))\n        return -1;\n\n    /* since an int is returned, make sure len fits in one, otherwise return\n       with an error (this avoids the flaw in the interface) */\n    if ((int)len < 0) {\n        gz_error(state, Z_DATA_ERROR, \"requested length does not fit in int\");\n        return -1;\n    }\n\n    /* if len is zero, avoid unnecessary operations */\n    if (len == 0)\n        return 0;\n\n    /* process a skip request */\n    if (state->seek) {\n        state->seek = 0;\n        if (gz_skip(state, state->skip) == -1)\n            return -1;\n    }\n\n    /* get len bytes to buf, or less than len if at the end */\n    got = 0;\n    do {\n        /* first just try copying data from the output buffer */\n        if (state->x.have) {\n            n = state->x.have > len ? len : state->x.have;\n            memcpy(buf, state->x.next, n);\n            state->x.next += n;\n            state->x.have -= n;\n        }\n\n        /* output buffer empty -- return if we're at the end of the input */\n        else if (state->eof && strm->avail_in == 0) {\n            state->past = 1;        /* tried to read past end */\n            break;\n        }\n\n        /* need output data -- for small len or new stream load up our output\n           buffer */\n        else if (state->how == LOOK || len < (state->size << 1)) {\n            /* get more output, looking for header if required */\n            if (gz_fetch(state) == -1)\n                return -1;\n            continue;       /* no progress yet -- go back to copy above */\n            /* the copy above assures that we will leave with space in the\n               output buffer, allowing at least one gzungetc() to succeed */\n        }\n\n        /* large len -- read directly into user buffer */\n        else if (state->how == COPY) {      /* read directly */\n            if (gz_load(state, (unsigned char *)buf, len, &n) == -1)\n                return -1;\n        }\n\n        /* large len -- decompress directly into user buffer */\n        else {  /* state->how == GZIP */\n            strm->avail_out = len;\n            strm->next_out = (unsigned char *)buf;\n            if (gz_decomp(state) == -1)\n                return -1;\n            n = state->x.have;\n            state->x.have = 0;\n        }\n\n        /* update progress */\n        len -= n;\n        buf = (char *)buf + n;\n        got += n;\n        state->x.pos += n;\n    } while (len);\n\n    /* return number of bytes read into user buffer (will fit in int) */\n    return (int)got;\n}\n\n/* -- see zlib.h -- */\n#ifdef Z_PREFIX_SET\n#  undef z_gzgetc\n#else\n#  undef gzgetc\n#endif\nint ZEXPORT gzgetc(file)\n    gzFile file;\n{\n    int ret;\n    unsigned char buf[1];\n    gz_statep state;\n\n    /* get internal structure */\n    if (file == NULL)\n        return -1;\n    state = (gz_statep)file;\n\n    /* check that we're reading and that there's no (serious) error */\n    if (state->mode != GZ_READ ||\n        (state->err != Z_OK && state->err != Z_BUF_ERROR))\n        return -1;\n\n    /* try output buffer (no need to check for skip request) */\n    if (state->x.have) {\n        state->x.have--;\n        state->x.pos++;\n        return *(state->x.next)++;\n    }\n\n    /* nothing there -- try gzread() */\n    ret = gzread(file, buf, 1);\n    return ret < 1 ? -1 : buf[0];\n}\n\nint ZEXPORT gzgetc_(file)\ngzFile file;\n{\n    return gzgetc(file);\n}\n\n/* -- see zlib.h -- */\nint ZEXPORT gzungetc(c, file)\n    int c;\n    gzFile file;\n{\n    gz_statep state;\n\n    /* get internal structure */\n    if (file == NULL)\n        return -1;\n    state = (gz_statep)file;\n\n    /* check that we're reading and that there's no (serious) error */\n    if (state->mode != GZ_READ ||\n        (state->err != Z_OK && state->err != Z_BUF_ERROR))\n        return -1;\n\n    /* process a skip request */\n    if (state->seek) {\n        state->seek = 0;\n        if (gz_skip(state, state->skip) == -1)\n            return -1;\n    }\n\n    /* can't push EOF */\n    if (c < 0)\n        return -1;\n\n    /* if output buffer empty, put byte at end (allows more pushing) */\n    if (state->x.have == 0) {\n        state->x.have = 1;\n        state->x.next = state->out + (state->size << 1) - 1;\n        state->x.next[0] = c;\n        state->x.pos--;\n        state->past = 0;\n        return c;\n    }\n\n    /* if no room, give up (must have already done a gzungetc()) */\n    if (state->x.have == (state->size << 1)) {\n        gz_error(state, Z_DATA_ERROR, \"out of room to push characters\");\n        return -1;\n    }\n\n    /* slide output data if needed and insert byte before existing data */\n    if (state->x.next == state->out) {\n        unsigned char *src = state->out + state->x.have;\n        unsigned char *dest = state->out + (state->size << 1);\n        while (src > state->out)\n            *--dest = *--src;\n        state->x.next = dest;\n    }\n    state->x.have++;\n    state->x.next--;\n    state->x.next[0] = c;\n    state->x.pos--;\n    state->past = 0;\n    return c;\n}\n\n/* -- see zlib.h -- */\nchar * ZEXPORT gzgets(file, buf, len)\n    gzFile file;\n    char *buf;\n    int len;\n{\n    unsigned left, n;\n    char *str;\n    unsigned char *eol;\n    gz_statep state;\n\n    /* check parameters and get internal structure */\n    if (file == NULL || buf == NULL || len < 1)\n        return NULL;\n    state = (gz_statep)file;\n\n    /* check that we're reading and that there's no (serious) error */\n    if (state->mode != GZ_READ ||\n        (state->err != Z_OK && state->err != Z_BUF_ERROR))\n        return NULL;\n\n    /* process a skip request */\n    if (state->seek) {\n        state->seek = 0;\n        if (gz_skip(state, state->skip) == -1)\n            return NULL;\n    }\n\n    /* copy output bytes up to new line or len - 1, whichever comes first --\n       append a terminating zero to the string (we don't check for a zero in\n       the contents, let the user worry about that) */\n    str = buf;\n    left = (unsigned)len - 1;\n    if (left) do {\n        /* assure that something is in the output buffer */\n        if (state->x.have == 0 && gz_fetch(state) == -1)\n            return NULL;                /* error */\n        if (state->x.have == 0) {       /* end of file */\n            state->past = 1;            /* read past end */\n            break;                      /* return what we have */\n        }\n\n        /* look for end-of-line in current output buffer */\n        n = state->x.have > left ? left : state->x.have;\n        eol = (unsigned char *)memchr(state->x.next, '\\n', n);\n        if (eol != NULL)\n            n = (unsigned)(eol - state->x.next) + 1;\n\n        /* copy through end-of-line, or remainder if not found */\n        memcpy(buf, state->x.next, n);\n        state->x.have -= n;\n        state->x.next += n;\n        state->x.pos += n;\n        left -= n;\n        buf += n;\n    } while (left && eol == NULL);\n\n    /* return terminated string, or if nothing, end of file */\n    if (buf == str)\n        return NULL;\n    buf[0] = 0;\n    return str;\n}\n\n/* -- see zlib.h -- */\nint ZEXPORT gzdirect(file)\n    gzFile file;\n{\n    gz_statep state;\n\n    /* get internal structure */\n    if (file == NULL)\n        return 0;\n    state = (gz_statep)file;\n\n    /* if the state is not known, but we can find out, then do so (this is\n       mainly for right after a gzopen() or gzdopen()) */\n    if (state->mode == GZ_READ && state->how == LOOK && state->x.have == 0)\n        (void)gz_look(state);\n\n    /* return 1 if transparent, 0 if processing a gzip stream */\n    return state->direct;\n}\n\n/* -- see zlib.h -- */\nint ZEXPORT gzclose_r(file)\n    gzFile file;\n{\n    int ret, err;\n    gz_statep state;\n\n    /* get internal structure */\n    if (file == NULL)\n        return Z_STREAM_ERROR;\n    state = (gz_statep)file;\n\n    /* check that we're reading */\n    if (state->mode != GZ_READ)\n        return Z_STREAM_ERROR;\n\n    /* free memory and close file */\n    if (state->size) {\n        inflateEnd(&(state->strm));\n        free(state->out);\n        free(state->in);\n    }\n    err = state->err == Z_BUF_ERROR ? Z_BUF_ERROR : Z_OK;\n    gz_error(state, Z_OK, NULL);\n    free(state->path);\n    ret = close(state->fd);\n    free(state);\n    return ret ? Z_ERRNO : err;\n}\n"
  },
  {
    "path": "ext/zlib/gzwrite.c",
    "content": "/* gzwrite.c -- zlib functions for writing gzip files\n * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n#include \"gzguts.h\"\n\n/* Local functions */\nlocal int gz_init OF((gz_statep));\nlocal int gz_comp OF((gz_statep, int));\nlocal int gz_zero OF((gz_statep, z_off64_t));\n\n/* Initialize state for writing a gzip file.  Mark initialization by setting\n   state->size to non-zero.  Return -1 on failure or 0 on success. */\nlocal int gz_init(state)\n    gz_statep state;\n{\n    int ret;\n    z_streamp strm = &(state->strm);\n\n    /* allocate input buffer */\n    state->in = (unsigned char *)malloc(state->want);\n    if (state->in == NULL) {\n        gz_error(state, Z_MEM_ERROR, \"out of memory\");\n        return -1;\n    }\n\n    /* only need output buffer and deflate state if compressing */\n    if (!state->direct) {\n        /* allocate output buffer */\n        state->out = (unsigned char *)malloc(state->want);\n        if (state->out == NULL) {\n            free(state->in);\n            gz_error(state, Z_MEM_ERROR, \"out of memory\");\n            return -1;\n        }\n\n        /* allocate deflate memory, set up for gzip compression */\n        strm->zalloc = Z_NULL;\n        strm->zfree = Z_NULL;\n        strm->opaque = Z_NULL;\n        ret = deflateInit2(strm, state->level, Z_DEFLATED,\n                           MAX_WBITS + 16, DEF_MEM_LEVEL, state->strategy);\n        if (ret != Z_OK) {\n            free(state->out);\n            free(state->in);\n            gz_error(state, Z_MEM_ERROR, \"out of memory\");\n            return -1;\n        }\n    }\n\n    /* mark state as initialized */\n    state->size = state->want;\n\n    /* initialize write buffer if compressing */\n    if (!state->direct) {\n        strm->avail_out = state->size;\n        strm->next_out = state->out;\n        state->x.next = strm->next_out;\n    }\n    return 0;\n}\n\n/* Compress whatever is at avail_in and next_in and write to the output file.\n   Return -1 if there is an error writing to the output file, otherwise 0.\n   flush is assumed to be a valid deflate() flush value.  If flush is Z_FINISH,\n   then the deflate() state is reset to start a new gzip stream.  If gz->direct\n   is true, then simply write to the output file without compressing, and\n   ignore flush. */\nlocal int gz_comp(state, flush)\n    gz_statep state;\n    int flush;\n{\n    int ret, got;\n    unsigned have;\n    z_streamp strm = &(state->strm);\n\n    /* allocate memory if this is the first time through */\n    if (state->size == 0 && gz_init(state) == -1)\n        return -1;\n\n    /* write directly if requested */\n    if (state->direct) {\n        got = write(state->fd, strm->next_in, strm->avail_in);\n        if (got < 0 || (unsigned)got != strm->avail_in) {\n            gz_error(state, Z_ERRNO, zstrerror());\n            return -1;\n        }\n        strm->avail_in = 0;\n        return 0;\n    }\n\n    /* run deflate() on provided input until it produces no more output */\n    ret = Z_OK;\n    do {\n        /* write out current buffer contents if full, or if flushing, but if\n           doing Z_FINISH then don't write until we get to Z_STREAM_END */\n        if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&\n            (flush != Z_FINISH || ret == Z_STREAM_END))) {\n            have = (unsigned)(strm->next_out - state->x.next);\n            if (have && ((got = write(state->fd, state->x.next, have)) < 0 ||\n                         (unsigned)got != have)) {\n                gz_error(state, Z_ERRNO, zstrerror());\n                return -1;\n            }\n            if (strm->avail_out == 0) {\n                strm->avail_out = state->size;\n                strm->next_out = state->out;\n            }\n            state->x.next = strm->next_out;\n        }\n\n        /* compress */\n        have = strm->avail_out;\n        ret = deflate(strm, flush);\n        if (ret == Z_STREAM_ERROR) {\n            gz_error(state, Z_STREAM_ERROR,\n                      \"internal error: deflate stream corrupt\");\n            return -1;\n        }\n        have -= strm->avail_out;\n    } while (have);\n\n    /* if that completed a deflate stream, allow another to start */\n    if (flush == Z_FINISH)\n        deflateReset(strm);\n\n    /* all done, no errors */\n    return 0;\n}\n\n/* Compress len zeros to output.  Return -1 on error, 0 on success. */\nlocal int gz_zero(state, len)\n    gz_statep state;\n    z_off64_t len;\n{\n    int first;\n    unsigned n;\n    z_streamp strm = &(state->strm);\n\n    /* consume whatever's left in the input buffer */\n    if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)\n        return -1;\n\n    /* compress len zeros (len guaranteed > 0) */\n    first = 1;\n    while (len) {\n        n = GT_OFF(state->size) || (z_off64_t)state->size > len ?\n            (unsigned)len : state->size;\n        if (first) {\n            memset(state->in, 0, n);\n            first = 0;\n        }\n        strm->avail_in = n;\n        strm->next_in = state->in;\n        state->x.pos += n;\n        if (gz_comp(state, Z_NO_FLUSH) == -1)\n            return -1;\n        len -= n;\n    }\n    return 0;\n}\n\n/* -- see zlib.h -- */\nint ZEXPORT gzwrite(file, buf, len)\n    gzFile file;\n    voidpc buf;\n    unsigned len;\n{\n    unsigned put = len;\n    gz_statep state;\n    z_streamp strm;\n\n    /* get internal structure */\n    if (file == NULL)\n        return 0;\n    state = (gz_statep)file;\n    strm = &(state->strm);\n\n    /* check that we're writing and that there's no error */\n    if (state->mode != GZ_WRITE || state->err != Z_OK)\n        return 0;\n\n    /* since an int is returned, make sure len fits in one, otherwise return\n       with an error (this avoids the flaw in the interface) */\n    if ((int)len < 0) {\n        gz_error(state, Z_DATA_ERROR, \"requested length does not fit in int\");\n        return 0;\n    }\n\n    /* if len is zero, avoid unnecessary operations */\n    if (len == 0)\n        return 0;\n\n    /* allocate memory if this is the first time through */\n    if (state->size == 0 && gz_init(state) == -1)\n        return 0;\n\n    /* check for seek request */\n    if (state->seek) {\n        state->seek = 0;\n        if (gz_zero(state, state->skip) == -1)\n            return 0;\n    }\n\n    /* for small len, copy to input buffer, otherwise compress directly */\n    if (len < state->size) {\n        /* copy to input buffer, compress when full */\n        do {\n            unsigned have, copy;\n\n            if (strm->avail_in == 0)\n                strm->next_in = state->in;\n            have = (unsigned)((strm->next_in + strm->avail_in) - state->in);\n            copy = state->size - have;\n            if (copy > len)\n                copy = len;\n            memcpy(state->in + have, buf, copy);\n            strm->avail_in += copy;\n            state->x.pos += copy;\n            buf = (const char *)buf + copy;\n            len -= copy;\n            if (len && gz_comp(state, Z_NO_FLUSH) == -1)\n                return 0;\n        } while (len);\n    }\n    else {\n        /* consume whatever's left in the input buffer */\n        if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)\n            return 0;\n\n        /* directly compress user buffer to file */\n        strm->avail_in = len;\n        strm->next_in = (z_const Bytef *)buf;\n        state->x.pos += len;\n        if (gz_comp(state, Z_NO_FLUSH) == -1)\n            return 0;\n    }\n\n    /* input was all buffered or compressed (put will fit in int) */\n    return (int)put;\n}\n\n/* -- see zlib.h -- */\nint ZEXPORT gzputc(file, c)\n    gzFile file;\n    int c;\n{\n    unsigned have;\n    unsigned char buf[1];\n    gz_statep state;\n    z_streamp strm;\n\n    /* get internal structure */\n    if (file == NULL)\n        return -1;\n    state = (gz_statep)file;\n    strm = &(state->strm);\n\n    /* check that we're writing and that there's no error */\n    if (state->mode != GZ_WRITE || state->err != Z_OK)\n        return -1;\n\n    /* check for seek request */\n    if (state->seek) {\n        state->seek = 0;\n        if (gz_zero(state, state->skip) == -1)\n            return -1;\n    }\n\n    /* try writing to input buffer for speed (state->size == 0 if buffer not\n       initialized) */\n    if (state->size) {\n        if (strm->avail_in == 0)\n            strm->next_in = state->in;\n        have = (unsigned)((strm->next_in + strm->avail_in) - state->in);\n        if (have < state->size) {\n            state->in[have] = c;\n            strm->avail_in++;\n            state->x.pos++;\n            return c & 0xff;\n        }\n    }\n\n    /* no room in buffer or not initialized, use gz_write() */\n    buf[0] = c;\n    if (gzwrite(file, buf, 1) != 1)\n        return -1;\n    return c & 0xff;\n}\n\n/* -- see zlib.h -- */\nint ZEXPORT gzputs(file, str)\n    gzFile file;\n    const char *str;\n{\n    int ret;\n    unsigned len;\n\n    /* write string */\n    len = (unsigned)strlen(str);\n    ret = gzwrite(file, str, len);\n    return ret == 0 && len != 0 ? -1 : ret;\n}\n\n#if defined(STDC) || defined(Z_HAVE_STDARG_H)\n#include <stdarg.h>\n\n/* -- see zlib.h -- */\nint ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va)\n{\n    int size, len;\n    gz_statep state;\n    z_streamp strm;\n\n    /* get internal structure */\n    if (file == NULL)\n        return -1;\n    state = (gz_statep)file;\n    strm = &(state->strm);\n\n    /* check that we're writing and that there's no error */\n    if (state->mode != GZ_WRITE || state->err != Z_OK)\n        return 0;\n\n    /* make sure we have some buffer space */\n    if (state->size == 0 && gz_init(state) == -1)\n        return 0;\n\n    /* check for seek request */\n    if (state->seek) {\n        state->seek = 0;\n        if (gz_zero(state, state->skip) == -1)\n            return 0;\n    }\n\n    /* consume whatever's left in the input buffer */\n    if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)\n        return 0;\n\n    /* do the printf() into the input buffer, put length in len */\n    size = (int)(state->size);\n    state->in[size - 1] = 0;\n#ifdef NO_vsnprintf\n#  ifdef HAS_vsprintf_void\n    (void)vsprintf((char *)(state->in), format, va);\n    for (len = 0; len < size; len++)\n        if (state->in[len] == 0) break;\n#  else\n    len = vsprintf((char *)(state->in), format, va);\n#  endif\n#else\n#  ifdef HAS_vsnprintf_void\n    (void)vsnprintf((char *)(state->in), size, format, va);\n    len = strlen((char *)(state->in));\n#  else\n    len = vsnprintf((char *)(state->in), size, format, va);\n#  endif\n#endif\n\n    /* check that printf() results fit in buffer */\n    if (len <= 0 || len >= (int)size || state->in[size - 1] != 0)\n        return 0;\n\n    /* update buffer and position, defer compression until needed */\n    strm->avail_in = (unsigned)len;\n    strm->next_in = state->in;\n    state->x.pos += len;\n    return len;\n}\n\nint ZEXPORTVA gzprintf(gzFile file, const char *format, ...)\n{\n    va_list va;\n    int ret;\n\n    va_start(va, format);\n    ret = gzvprintf(file, format, va);\n    va_end(va);\n    return ret;\n}\n\n#else /* !STDC && !Z_HAVE_STDARG_H */\n\n/* -- see zlib.h -- */\nint ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,\n                       a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)\n    gzFile file;\n    const char *format;\n    int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,\n        a11, a12, a13, a14, a15, a16, a17, a18, a19, a20;\n{\n    int size, len;\n    gz_statep state;\n    z_streamp strm;\n\n    /* get internal structure */\n    if (file == NULL)\n        return -1;\n    state = (gz_statep)file;\n    strm = &(state->strm);\n\n    /* check that can really pass pointer in ints */\n    if (sizeof(int) != sizeof(void *))\n        return 0;\n\n    /* check that we're writing and that there's no error */\n    if (state->mode != GZ_WRITE || state->err != Z_OK)\n        return 0;\n\n    /* make sure we have some buffer space */\n    if (state->size == 0 && gz_init(state) == -1)\n        return 0;\n\n    /* check for seek request */\n    if (state->seek) {\n        state->seek = 0;\n        if (gz_zero(state, state->skip) == -1)\n            return 0;\n    }\n\n    /* consume whatever's left in the input buffer */\n    if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1)\n        return 0;\n\n    /* do the printf() into the input buffer, put length in len */\n    size = (int)(state->size);\n    state->in[size - 1] = 0;\n#ifdef NO_snprintf\n#  ifdef HAS_sprintf_void\n    sprintf((char *)(state->in), format, a1, a2, a3, a4, a5, a6, a7, a8,\n            a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);\n    for (len = 0; len < size; len++)\n        if (state->in[len] == 0) break;\n#  else\n    len = sprintf((char *)(state->in), format, a1, a2, a3, a4, a5, a6, a7, a8,\n                  a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);\n#  endif\n#else\n#  ifdef HAS_snprintf_void\n    snprintf((char *)(state->in), size, format, a1, a2, a3, a4, a5, a6, a7, a8,\n             a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20);\n    len = strlen((char *)(state->in));\n#  else\n    len = snprintf((char *)(state->in), size, format, a1, a2, a3, a4, a5, a6,\n                   a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18,\n                   a19, a20);\n#  endif\n#endif\n\n    /* check that printf() results fit in buffer */\n    if (len <= 0 || len >= (int)size || state->in[size - 1] != 0)\n        return 0;\n\n    /* update buffer and position, defer compression until needed */\n    strm->avail_in = (unsigned)len;\n    strm->next_in = state->in;\n    state->x.pos += len;\n    return len;\n}\n\n#endif\n\n/* -- see zlib.h -- */\nint ZEXPORT gzflush(file, flush)\n    gzFile file;\n    int flush;\n{\n    gz_statep state;\n\n    /* get internal structure */\n    if (file == NULL)\n        return -1;\n    state = (gz_statep)file;\n\n    /* check that we're writing and that there's no error */\n    if (state->mode != GZ_WRITE || state->err != Z_OK)\n        return Z_STREAM_ERROR;\n\n    /* check flush parameter */\n    if (flush < 0 || flush > Z_FINISH)\n        return Z_STREAM_ERROR;\n\n    /* check for seek request */\n    if (state->seek) {\n        state->seek = 0;\n        if (gz_zero(state, state->skip) == -1)\n            return -1;\n    }\n\n    /* compress remaining data with requested flush */\n    gz_comp(state, flush);\n    return state->err;\n}\n\n/* -- see zlib.h -- */\nint ZEXPORT gzsetparams(file, level, strategy)\n    gzFile file;\n    int level;\n    int strategy;\n{\n    gz_statep state;\n    z_streamp strm;\n\n    /* get internal structure */\n    if (file == NULL)\n        return Z_STREAM_ERROR;\n    state = (gz_statep)file;\n    strm = &(state->strm);\n\n    /* check that we're writing and that there's no error */\n    if (state->mode != GZ_WRITE || state->err != Z_OK)\n        return Z_STREAM_ERROR;\n\n    /* if no change is requested, then do nothing */\n    if (level == state->level && strategy == state->strategy)\n        return Z_OK;\n\n    /* check for seek request */\n    if (state->seek) {\n        state->seek = 0;\n        if (gz_zero(state, state->skip) == -1)\n            return -1;\n    }\n\n    /* change compression parameters for subsequent input */\n    if (state->size) {\n        /* flush previous input with previous parameters before changing */\n        if (strm->avail_in && gz_comp(state, Z_PARTIAL_FLUSH) == -1)\n            return state->err;\n        deflateParams(strm, level, strategy);\n    }\n    state->level = level;\n    state->strategy = strategy;\n    return Z_OK;\n}\n\n/* -- see zlib.h -- */\nint ZEXPORT gzclose_w(file)\n    gzFile file;\n{\n    int ret = Z_OK;\n    gz_statep state;\n\n    /* get internal structure */\n    if (file == NULL)\n        return Z_STREAM_ERROR;\n    state = (gz_statep)file;\n\n    /* check that we're writing */\n    if (state->mode != GZ_WRITE)\n        return Z_STREAM_ERROR;\n\n    /* check for seek request */\n    if (state->seek) {\n        state->seek = 0;\n        if (gz_zero(state, state->skip) == -1)\n            ret = state->err;\n    }\n\n    /* flush, free memory, and close file */\n    if (gz_comp(state, Z_FINISH) == -1)\n        ret = state->err;\n    if (state->size) {\n        if (!state->direct) {\n            (void)deflateEnd(&(state->strm));\n            free(state->out);\n        }\n        free(state->in);\n    }\n    gz_error(state, Z_OK, NULL);\n    free(state->path);\n    if (close(state->fd) == -1)\n        ret = Z_ERRNO;\n    free(state);\n    return ret;\n}\n"
  },
  {
    "path": "ext/zlib/infback.c",
    "content": "/* infback.c -- inflate using a call-back interface\n * Copyright (C) 1995-2011 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/*\n   This code is largely copied from inflate.c.  Normally either infback.o or\n   inflate.o would be linked into an application--not both.  The interface\n   with inffast.c is retained so that optimized assembler-coded versions of\n   inflate_fast() can be used with either inflate.c or infback.c.\n */\n\n#include \"zutil.h\"\n#include \"inftrees.h\"\n#include \"inflate.h\"\n#include \"inffast.h\"\n\n/* function prototypes */\nlocal void fixedtables OF((struct inflate_state FAR *state));\n\n/*\n   strm provides memory allocation functions in zalloc and zfree, or\n   Z_NULL to use the library memory allocation functions.\n\n   windowBits is in the range 8..15, and window is a user-supplied\n   window and output buffer that is 2**windowBits bytes.\n */\nint ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size)\nz_streamp strm;\nint windowBits;\nunsigned char FAR *window;\nconst char *version;\nint stream_size;\n{\n    struct inflate_state FAR *state;\n\n    if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||\n        stream_size != (int)(sizeof(z_stream)))\n        return Z_VERSION_ERROR;\n    if (strm == Z_NULL || window == Z_NULL ||\n        windowBits < 8 || windowBits > 15)\n        return Z_STREAM_ERROR;\n    strm->msg = Z_NULL;                 /* in case we return an error */\n    if (strm->zalloc == (alloc_func)0) {\n#ifdef Z_SOLO\n        return Z_STREAM_ERROR;\n#else\n        strm->zalloc = zcalloc;\n        strm->opaque = (voidpf)0;\n#endif\n    }\n    if (strm->zfree == (free_func)0)\n#ifdef Z_SOLO\n        return Z_STREAM_ERROR;\n#else\n    strm->zfree = zcfree;\n#endif\n    state = (struct inflate_state FAR *)ZALLOC(strm, 1,\n                                               sizeof(struct inflate_state));\n    if (state == Z_NULL) return Z_MEM_ERROR;\n    Tracev((stderr, \"inflate: allocated\\n\"));\n    strm->state = (struct internal_state FAR *)state;\n    state->dmax = 32768U;\n    state->wbits = windowBits;\n    state->wsize = 1U << windowBits;\n    state->window = window;\n    state->wnext = 0;\n    state->whave = 0;\n    return Z_OK;\n}\n\n/*\n   Return state with length and distance decoding tables and index sizes set to\n   fixed code decoding.  Normally this returns fixed tables from inffixed.h.\n   If BUILDFIXED is defined, then instead this routine builds the tables the\n   first time it's called, and returns those tables the first time and\n   thereafter.  This reduces the size of the code by about 2K bytes, in\n   exchange for a little execution time.  However, BUILDFIXED should not be\n   used for threaded applications, since the rewriting of the tables and virgin\n   may not be thread-safe.\n */\nlocal void fixedtables(state)\nstruct inflate_state FAR *state;\n{\n#ifdef BUILDFIXED\n    static int virgin = 1;\n    static code *lenfix, *distfix;\n    static code fixed[544];\n\n    /* build fixed huffman tables if first call (may not be thread safe) */\n    if (virgin) {\n        unsigned sym, bits;\n        static code *next;\n\n        /* literal/length table */\n        sym = 0;\n        while (sym < 144) state->lens[sym++] = 8;\n        while (sym < 256) state->lens[sym++] = 9;\n        while (sym < 280) state->lens[sym++] = 7;\n        while (sym < 288) state->lens[sym++] = 8;\n        next = fixed;\n        lenfix = next;\n        bits = 9;\n        inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);\n\n        /* distance table */\n        sym = 0;\n        while (sym < 32) state->lens[sym++] = 5;\n        distfix = next;\n        bits = 5;\n        inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);\n\n        /* do this just once */\n        virgin = 0;\n    }\n#else /* !BUILDFIXED */\n#   include \"inffixed.h\"\n#endif /* BUILDFIXED */\n    state->lencode = lenfix;\n    state->lenbits = 9;\n    state->distcode = distfix;\n    state->distbits = 5;\n}\n\n/* Macros for inflateBack(): */\n\n/* Load returned state from inflate_fast() */\n#define LOAD() \\\n    do { \\\n        put = strm->next_out; \\\n        left = strm->avail_out; \\\n        next = strm->next_in; \\\n        have = strm->avail_in; \\\n        hold = state->hold; \\\n        bits = state->bits; \\\n    } while (0)\n\n/* Set state from registers for inflate_fast() */\n#define RESTORE() \\\n    do { \\\n        strm->next_out = put; \\\n        strm->avail_out = left; \\\n        strm->next_in = next; \\\n        strm->avail_in = have; \\\n        state->hold = hold; \\\n        state->bits = bits; \\\n    } while (0)\n\n/* Clear the input bit accumulator */\n#define INITBITS() \\\n    do { \\\n        hold = 0; \\\n        bits = 0; \\\n    } while (0)\n\n/* Assure that some input is available.  If input is requested, but denied,\n   then return a Z_BUF_ERROR from inflateBack(). */\n#define PULL() \\\n    do { \\\n        if (have == 0) { \\\n            have = in(in_desc, &next); \\\n            if (have == 0) { \\\n                next = Z_NULL; \\\n                ret = Z_BUF_ERROR; \\\n                goto inf_leave; \\\n            } \\\n        } \\\n    } while (0)\n\n/* Get a byte of input into the bit accumulator, or return from inflateBack()\n   with an error if there is no input available. */\n#define PULLBYTE() \\\n    do { \\\n        PULL(); \\\n        have--; \\\n        hold += (unsigned long)(*next++) << bits; \\\n        bits += 8; \\\n    } while (0)\n\n/* Assure that there are at least n bits in the bit accumulator.  If there is\n   not enough available input to do that, then return from inflateBack() with\n   an error. */\n#define NEEDBITS(n) \\\n    do { \\\n        while (bits < (unsigned)(n)) \\\n            PULLBYTE(); \\\n    } while (0)\n\n/* Return the low n bits of the bit accumulator (n < 16) */\n#define BITS(n) \\\n    ((unsigned)hold & ((1U << (n)) - 1))\n\n/* Remove n bits from the bit accumulator */\n#define DROPBITS(n) \\\n    do { \\\n        hold >>= (n); \\\n        bits -= (unsigned)(n); \\\n    } while (0)\n\n/* Remove zero to seven bits as needed to go to a byte boundary */\n#define BYTEBITS() \\\n    do { \\\n        hold >>= bits & 7; \\\n        bits -= bits & 7; \\\n    } while (0)\n\n/* Assure that some output space is available, by writing out the window\n   if it's full.  If the write fails, return from inflateBack() with a\n   Z_BUF_ERROR. */\n#define ROOM() \\\n    do { \\\n        if (left == 0) { \\\n            put = state->window; \\\n            left = state->wsize; \\\n            state->whave = left; \\\n            if (out(out_desc, put, left)) { \\\n                ret = Z_BUF_ERROR; \\\n                goto inf_leave; \\\n            } \\\n        } \\\n    } while (0)\n\n/*\n   strm provides the memory allocation functions and window buffer on input,\n   and provides information on the unused input on return.  For Z_DATA_ERROR\n   returns, strm will also provide an error message.\n\n   in() and out() are the call-back input and output functions.  When\n   inflateBack() needs more input, it calls in().  When inflateBack() has\n   filled the window with output, or when it completes with data in the\n   window, it calls out() to write out the data.  The application must not\n   change the provided input until in() is called again or inflateBack()\n   returns.  The application must not change the window/output buffer until\n   inflateBack() returns.\n\n   in() and out() are called with a descriptor parameter provided in the\n   inflateBack() call.  This parameter can be a structure that provides the\n   information required to do the read or write, as well as accumulated\n   information on the input and output such as totals and check values.\n\n   in() should return zero on failure.  out() should return non-zero on\n   failure.  If either in() or out() fails, than inflateBack() returns a\n   Z_BUF_ERROR.  strm->next_in can be checked for Z_NULL to see whether it\n   was in() or out() that caused in the error.  Otherwise,  inflateBack()\n   returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format\n   error, or Z_MEM_ERROR if it could not allocate memory for the state.\n   inflateBack() can also return Z_STREAM_ERROR if the input parameters\n   are not correct, i.e. strm is Z_NULL or the state was not initialized.\n */\nint ZEXPORT inflateBack(strm, in, in_desc, out, out_desc)\nz_streamp strm;\nin_func in;\nvoid FAR *in_desc;\nout_func out;\nvoid FAR *out_desc;\n{\n    struct inflate_state FAR *state;\n    z_const unsigned char FAR *next;    /* next input */\n    unsigned char FAR *put;     /* next output */\n    unsigned have, left;        /* available input and output */\n    unsigned long hold;         /* bit buffer */\n    unsigned bits;              /* bits in bit buffer */\n    unsigned copy;              /* number of stored or match bytes to copy */\n    unsigned char FAR *from;    /* where to copy match bytes from */\n    code here;                  /* current decoding table entry */\n    code last;                  /* parent table entry */\n    unsigned len;               /* length to copy for repeats, bits to drop */\n    int ret;                    /* return code */\n    static const unsigned short order[19] = /* permutation of code lengths */\n        {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};\n\n    /* Check that the strm exists and that the state was initialized */\n    if (strm == Z_NULL || strm->state == Z_NULL)\n        return Z_STREAM_ERROR;\n    state = (struct inflate_state FAR *)strm->state;\n\n    /* Reset the state */\n    strm->msg = Z_NULL;\n    state->mode = TYPE;\n    state->last = 0;\n    state->whave = 0;\n    next = strm->next_in;\n    have = next != Z_NULL ? strm->avail_in : 0;\n    hold = 0;\n    bits = 0;\n    put = state->window;\n    left = state->wsize;\n\n    /* Inflate until end of block marked as last */\n    for (;;)\n        switch (state->mode) {\n        case TYPE:\n            /* determine and dispatch block type */\n            if (state->last) {\n                BYTEBITS();\n                state->mode = DONE;\n                break;\n            }\n            NEEDBITS(3);\n            state->last = BITS(1);\n            DROPBITS(1);\n            switch (BITS(2)) {\n            case 0:                             /* stored block */\n                Tracev((stderr, \"inflate:     stored block%s\\n\",\n                        state->last ? \" (last)\" : \"\"));\n                state->mode = STORED;\n                break;\n            case 1:                             /* fixed block */\n                fixedtables(state);\n                Tracev((stderr, \"inflate:     fixed codes block%s\\n\",\n                        state->last ? \" (last)\" : \"\"));\n                state->mode = LEN;              /* decode codes */\n                break;\n            case 2:                             /* dynamic block */\n                Tracev((stderr, \"inflate:     dynamic codes block%s\\n\",\n                        state->last ? \" (last)\" : \"\"));\n                state->mode = TABLE;\n                break;\n            case 3:\n                strm->msg = (char *)\"invalid block type\";\n                state->mode = BAD;\n            }\n            DROPBITS(2);\n            break;\n\n        case STORED:\n            /* get and verify stored block length */\n            BYTEBITS();                         /* go to byte boundary */\n            NEEDBITS(32);\n            if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {\n                strm->msg = (char *)\"invalid stored block lengths\";\n                state->mode = BAD;\n                break;\n            }\n            state->length = (unsigned)hold & 0xffff;\n            Tracev((stderr, \"inflate:       stored length %u\\n\",\n                    state->length));\n            INITBITS();\n\n            /* copy stored block from input to output */\n            while (state->length != 0) {\n                copy = state->length;\n                PULL();\n                ROOM();\n                if (copy > have) copy = have;\n                if (copy > left) copy = left;\n                zmemcpy(put, next, copy);\n                have -= copy;\n                next += copy;\n                left -= copy;\n                put += copy;\n                state->length -= copy;\n            }\n            Tracev((stderr, \"inflate:       stored end\\n\"));\n            state->mode = TYPE;\n            break;\n\n        case TABLE:\n            /* get dynamic table entries descriptor */\n            NEEDBITS(14);\n            state->nlen = BITS(5) + 257;\n            DROPBITS(5);\n            state->ndist = BITS(5) + 1;\n            DROPBITS(5);\n            state->ncode = BITS(4) + 4;\n            DROPBITS(4);\n#ifndef PKZIP_BUG_WORKAROUND\n            if (state->nlen > 286 || state->ndist > 30) {\n                strm->msg = (char *)\"too many length or distance symbols\";\n                state->mode = BAD;\n                break;\n            }\n#endif\n            Tracev((stderr, \"inflate:       table sizes ok\\n\"));\n\n            /* get code length code lengths (not a typo) */\n            state->have = 0;\n            while (state->have < state->ncode) {\n                NEEDBITS(3);\n                state->lens[order[state->have++]] = (unsigned short)BITS(3);\n                DROPBITS(3);\n            }\n            while (state->have < 19)\n                state->lens[order[state->have++]] = 0;\n            state->next = state->codes;\n            state->lencode = (code const FAR *)(state->next);\n            state->lenbits = 7;\n            ret = inflate_table(CODES, state->lens, 19, &(state->next),\n                                &(state->lenbits), state->work);\n            if (ret) {\n                strm->msg = (char *)\"invalid code lengths set\";\n                state->mode = BAD;\n                break;\n            }\n            Tracev((stderr, \"inflate:       code lengths ok\\n\"));\n\n            /* get length and distance code code lengths */\n            state->have = 0;\n            while (state->have < state->nlen + state->ndist) {\n                for (;;) {\n                    here = state->lencode[BITS(state->lenbits)];\n                    if ((unsigned)(here.bits) <= bits) break;\n                    PULLBYTE();\n                }\n                if (here.val < 16) {\n                    DROPBITS(here.bits);\n                    state->lens[state->have++] = here.val;\n                }\n                else {\n                    if (here.val == 16) {\n                        NEEDBITS(here.bits + 2);\n                        DROPBITS(here.bits);\n                        if (state->have == 0) {\n                            strm->msg = (char *)\"invalid bit length repeat\";\n                            state->mode = BAD;\n                            break;\n                        }\n                        len = (unsigned)(state->lens[state->have - 1]);\n                        copy = 3 + BITS(2);\n                        DROPBITS(2);\n                    }\n                    else if (here.val == 17) {\n                        NEEDBITS(here.bits + 3);\n                        DROPBITS(here.bits);\n                        len = 0;\n                        copy = 3 + BITS(3);\n                        DROPBITS(3);\n                    }\n                    else {\n                        NEEDBITS(here.bits + 7);\n                        DROPBITS(here.bits);\n                        len = 0;\n                        copy = 11 + BITS(7);\n                        DROPBITS(7);\n                    }\n                    if (state->have + copy > state->nlen + state->ndist) {\n                        strm->msg = (char *)\"invalid bit length repeat\";\n                        state->mode = BAD;\n                        break;\n                    }\n                    while (copy--)\n                        state->lens[state->have++] = (unsigned short)len;\n                }\n            }\n\n            /* handle error breaks in while */\n            if (state->mode == BAD) break;\n\n            /* check for end-of-block code (better have one) */\n            if (state->lens[256] == 0) {\n                strm->msg = (char *)\"invalid code -- missing end-of-block\";\n                state->mode = BAD;\n                break;\n            }\n\n            /* build code tables -- note: do not change the lenbits or distbits\n               values here (9 and 6) without reading the comments in inftrees.h\n               concerning the ENOUGH constants, which depend on those values */\n            state->next = state->codes;\n            state->lencode = (code const FAR *)(state->next);\n            state->lenbits = 9;\n            ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),\n                                &(state->lenbits), state->work);\n            if (ret) {\n                strm->msg = (char *)\"invalid literal/lengths set\";\n                state->mode = BAD;\n                break;\n            }\n            state->distcode = (code const FAR *)(state->next);\n            state->distbits = 6;\n            ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,\n                            &(state->next), &(state->distbits), state->work);\n            if (ret) {\n                strm->msg = (char *)\"invalid distances set\";\n                state->mode = BAD;\n                break;\n            }\n            Tracev((stderr, \"inflate:       codes ok\\n\"));\n            state->mode = LEN;\n\n        case LEN:\n            /* use inflate_fast() if we have enough input and output */\n            if (have >= 6 && left >= 258) {\n                RESTORE();\n                if (state->whave < state->wsize)\n                    state->whave = state->wsize - left;\n                inflate_fast(strm, state->wsize);\n                LOAD();\n                break;\n            }\n\n            /* get a literal, length, or end-of-block code */\n            for (;;) {\n                here = state->lencode[BITS(state->lenbits)];\n                if ((unsigned)(here.bits) <= bits) break;\n                PULLBYTE();\n            }\n            if (here.op && (here.op & 0xf0) == 0) {\n                last = here;\n                for (;;) {\n                    here = state->lencode[last.val +\n                            (BITS(last.bits + last.op) >> last.bits)];\n                    if ((unsigned)(last.bits + here.bits) <= bits) break;\n                    PULLBYTE();\n                }\n                DROPBITS(last.bits);\n            }\n            DROPBITS(here.bits);\n            state->length = (unsigned)here.val;\n\n            /* process literal */\n            if (here.op == 0) {\n                Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n                        \"inflate:         literal '%c'\\n\" :\n                        \"inflate:         literal 0x%02x\\n\", here.val));\n                ROOM();\n                *put++ = (unsigned char)(state->length);\n                left--;\n                state->mode = LEN;\n                break;\n            }\n\n            /* process end of block */\n            if (here.op & 32) {\n                Tracevv((stderr, \"inflate:         end of block\\n\"));\n                state->mode = TYPE;\n                break;\n            }\n\n            /* invalid code */\n            if (here.op & 64) {\n                strm->msg = (char *)\"invalid literal/length code\";\n                state->mode = BAD;\n                break;\n            }\n\n            /* length code -- get extra bits, if any */\n            state->extra = (unsigned)(here.op) & 15;\n            if (state->extra != 0) {\n                NEEDBITS(state->extra);\n                state->length += BITS(state->extra);\n                DROPBITS(state->extra);\n            }\n            Tracevv((stderr, \"inflate:         length %u\\n\", state->length));\n\n            /* get distance code */\n            for (;;) {\n                here = state->distcode[BITS(state->distbits)];\n                if ((unsigned)(here.bits) <= bits) break;\n                PULLBYTE();\n            }\n            if ((here.op & 0xf0) == 0) {\n                last = here;\n                for (;;) {\n                    here = state->distcode[last.val +\n                            (BITS(last.bits + last.op) >> last.bits)];\n                    if ((unsigned)(last.bits + here.bits) <= bits) break;\n                    PULLBYTE();\n                }\n                DROPBITS(last.bits);\n            }\n            DROPBITS(here.bits);\n            if (here.op & 64) {\n                strm->msg = (char *)\"invalid distance code\";\n                state->mode = BAD;\n                break;\n            }\n            state->offset = (unsigned)here.val;\n\n            /* get distance extra bits, if any */\n            state->extra = (unsigned)(here.op) & 15;\n            if (state->extra != 0) {\n                NEEDBITS(state->extra);\n                state->offset += BITS(state->extra);\n                DROPBITS(state->extra);\n            }\n            if (state->offset > state->wsize - (state->whave < state->wsize ?\n                                                left : 0)) {\n                strm->msg = (char *)\"invalid distance too far back\";\n                state->mode = BAD;\n                break;\n            }\n            Tracevv((stderr, \"inflate:         distance %u\\n\", state->offset));\n\n            /* copy match from window to output */\n            do {\n                ROOM();\n                copy = state->wsize - state->offset;\n                if (copy < left) {\n                    from = put + copy;\n                    copy = left - copy;\n                }\n                else {\n                    from = put - state->offset;\n                    copy = left;\n                }\n                if (copy > state->length) copy = state->length;\n                state->length -= copy;\n                left -= copy;\n                do {\n                    *put++ = *from++;\n                } while (--copy);\n            } while (state->length != 0);\n            break;\n\n        case DONE:\n            /* inflate stream terminated properly -- write leftover output */\n            ret = Z_STREAM_END;\n            if (left < state->wsize) {\n                if (out(out_desc, state->window, state->wsize - left))\n                    ret = Z_BUF_ERROR;\n            }\n            goto inf_leave;\n\n        case BAD:\n            ret = Z_DATA_ERROR;\n            goto inf_leave;\n\n        default:                /* can't happen, but makes compilers happy */\n            ret = Z_STREAM_ERROR;\n            goto inf_leave;\n        }\n\n    /* Return unused input */\n  inf_leave:\n    strm->next_in = next;\n    strm->avail_in = have;\n    return ret;\n}\n\nint ZEXPORT inflateBackEnd(strm)\nz_streamp strm;\n{\n    if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)\n        return Z_STREAM_ERROR;\n    ZFREE(strm, strm->state);\n    strm->state = Z_NULL;\n    Tracev((stderr, \"inflate: end\\n\"));\n    return Z_OK;\n}\n"
  },
  {
    "path": "ext/zlib/inffast.c",
    "content": "/* inffast.c -- fast decoding\n * Copyright (C) 1995-2008, 2010, 2013 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n#include \"zutil.h\"\n#include \"inftrees.h\"\n#include \"inflate.h\"\n#include \"inffast.h\"\n\n#ifndef ASMINF\n\n/* Allow machine dependent optimization for post-increment or pre-increment.\n   Based on testing to date,\n   Pre-increment preferred for:\n   - PowerPC G3 (Adler)\n   - MIPS R5000 (Randers-Pehrson)\n   Post-increment preferred for:\n   - none\n   No measurable difference:\n   - Pentium III (Anderson)\n   - M68060 (Nikl)\n */\n#ifdef POSTINC\n#  define OFF 0\n#  define PUP(a) *(a)++\n#else\n#  define OFF 1\n#  define PUP(a) *++(a)\n#endif\n\n/*\n   Decode literal, length, and distance codes and write out the resulting\n   literal and match bytes until either not enough input or output is\n   available, an end-of-block is encountered, or a data error is encountered.\n   When large enough input and output buffers are supplied to inflate(), for\n   example, a 16K input buffer and a 64K output buffer, more than 95% of the\n   inflate execution time is spent in this routine.\n\n   Entry assumptions:\n\n        state->mode == LEN\n        strm->avail_in >= 6\n        strm->avail_out >= 258\n        start >= strm->avail_out\n        state->bits < 8\n\n   On return, state->mode is one of:\n\n        LEN -- ran out of enough output space or enough available input\n        TYPE -- reached end of block code, inflate() to interpret next block\n        BAD -- error in block data\n\n   Notes:\n\n    - The maximum input bits used by a length/distance pair is 15 bits for the\n      length code, 5 bits for the length extra, 15 bits for the distance code,\n      and 13 bits for the distance extra.  This totals 48 bits, or six bytes.\n      Therefore if strm->avail_in >= 6, then there is enough input to avoid\n      checking for available input while decoding.\n\n    - The maximum bytes that a single length/distance pair can output is 258\n      bytes, which is the maximum length that can be coded.  inflate_fast()\n      requires strm->avail_out >= 258 for each loop to avoid checking for\n      output space.\n */\nvoid ZLIB_INTERNAL inflate_fast(strm, start)\nz_streamp strm;\nunsigned start;         /* inflate()'s starting value for strm->avail_out */\n{\n    struct inflate_state FAR *state;\n    z_const unsigned char FAR *in;      /* local strm->next_in */\n    z_const unsigned char FAR *last;    /* have enough input while in < last */\n    unsigned char FAR *out;     /* local strm->next_out */\n    unsigned char FAR *beg;     /* inflate()'s initial strm->next_out */\n    unsigned char FAR *end;     /* while out < end, enough space available */\n#ifdef INFLATE_STRICT\n    unsigned dmax;              /* maximum distance from zlib header */\n#endif\n    unsigned wsize;             /* window size or zero if not using window */\n    unsigned whave;             /* valid bytes in the window */\n    unsigned wnext;             /* window write index */\n    unsigned char FAR *window;  /* allocated sliding window, if wsize != 0 */\n    unsigned long hold;         /* local strm->hold */\n    unsigned bits;              /* local strm->bits */\n    code const FAR *lcode;      /* local strm->lencode */\n    code const FAR *dcode;      /* local strm->distcode */\n    unsigned lmask;             /* mask for first level of length codes */\n    unsigned dmask;             /* mask for first level of distance codes */\n    code here;                  /* retrieved table entry */\n    unsigned op;                /* code bits, operation, extra bits, or */\n                                /*  window position, window bytes to copy */\n    unsigned len;               /* match length, unused bytes */\n    unsigned dist;              /* match distance */\n    unsigned char FAR *from;    /* where to copy match from */\n\n    /* copy state to local variables */\n    state = (struct inflate_state FAR *)strm->state;\n    in = strm->next_in - OFF;\n    last = in + (strm->avail_in - 5);\n    out = strm->next_out - OFF;\n    beg = out - (start - strm->avail_out);\n    end = out + (strm->avail_out - 257);\n#ifdef INFLATE_STRICT\n    dmax = state->dmax;\n#endif\n    wsize = state->wsize;\n    whave = state->whave;\n    wnext = state->wnext;\n    window = state->window;\n    hold = state->hold;\n    bits = state->bits;\n    lcode = state->lencode;\n    dcode = state->distcode;\n    lmask = (1U << state->lenbits) - 1;\n    dmask = (1U << state->distbits) - 1;\n\n    /* decode literals and length/distances until end-of-block or not enough\n       input data or output space */\n    do {\n        if (bits < 15) {\n            hold += (unsigned long)(PUP(in)) << bits;\n            bits += 8;\n            hold += (unsigned long)(PUP(in)) << bits;\n            bits += 8;\n        }\n        here = lcode[hold & lmask];\n      dolen:\n        op = (unsigned)(here.bits);\n        hold >>= op;\n        bits -= op;\n        op = (unsigned)(here.op);\n        if (op == 0) {                          /* literal */\n            Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n                    \"inflate:         literal '%c'\\n\" :\n                    \"inflate:         literal 0x%02x\\n\", here.val));\n            PUP(out) = (unsigned char)(here.val);\n        }\n        else if (op & 16) {                     /* length base */\n            len = (unsigned)(here.val);\n            op &= 15;                           /* number of extra bits */\n            if (op) {\n                if (bits < op) {\n                    hold += (unsigned long)(PUP(in)) << bits;\n                    bits += 8;\n                }\n                len += (unsigned)hold & ((1U << op) - 1);\n                hold >>= op;\n                bits -= op;\n            }\n            Tracevv((stderr, \"inflate:         length %u\\n\", len));\n            if (bits < 15) {\n                hold += (unsigned long)(PUP(in)) << bits;\n                bits += 8;\n                hold += (unsigned long)(PUP(in)) << bits;\n                bits += 8;\n            }\n            here = dcode[hold & dmask];\n          dodist:\n            op = (unsigned)(here.bits);\n            hold >>= op;\n            bits -= op;\n            op = (unsigned)(here.op);\n            if (op & 16) {                      /* distance base */\n                dist = (unsigned)(here.val);\n                op &= 15;                       /* number of extra bits */\n                if (bits < op) {\n                    hold += (unsigned long)(PUP(in)) << bits;\n                    bits += 8;\n                    if (bits < op) {\n                        hold += (unsigned long)(PUP(in)) << bits;\n                        bits += 8;\n                    }\n                }\n                dist += (unsigned)hold & ((1U << op) - 1);\n#ifdef INFLATE_STRICT\n                if (dist > dmax) {\n                    strm->msg = (char *)\"invalid distance too far back\";\n                    state->mode = BAD;\n                    break;\n                }\n#endif\n                hold >>= op;\n                bits -= op;\n                Tracevv((stderr, \"inflate:         distance %u\\n\", dist));\n                op = (unsigned)(out - beg);     /* max distance in output */\n                if (dist > op) {                /* see if copy from window */\n                    op = dist - op;             /* distance back in window */\n                    if (op > whave) {\n                        if (state->sane) {\n                            strm->msg =\n                                (char *)\"invalid distance too far back\";\n                            state->mode = BAD;\n                            break;\n                        }\n#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n                        if (len <= op - whave) {\n                            do {\n                                PUP(out) = 0;\n                            } while (--len);\n                            continue;\n                        }\n                        len -= op - whave;\n                        do {\n                            PUP(out) = 0;\n                        } while (--op > whave);\n                        if (op == 0) {\n                            from = out - dist;\n                            do {\n                                PUP(out) = PUP(from);\n                            } while (--len);\n                            continue;\n                        }\n#endif\n                    }\n                    from = window - OFF;\n                    if (wnext == 0) {           /* very common case */\n                        from += wsize - op;\n                        if (op < len) {         /* some from window */\n                            len -= op;\n                            do {\n                                PUP(out) = PUP(from);\n                            } while (--op);\n                            from = out - dist;  /* rest from output */\n                        }\n                    }\n                    else if (wnext < op) {      /* wrap around window */\n                        from += wsize + wnext - op;\n                        op -= wnext;\n                        if (op < len) {         /* some from end of window */\n                            len -= op;\n                            do {\n                                PUP(out) = PUP(from);\n                            } while (--op);\n                            from = window - OFF;\n                            if (wnext < len) {  /* some from start of window */\n                                op = wnext;\n                                len -= op;\n                                do {\n                                    PUP(out) = PUP(from);\n                                } while (--op);\n                                from = out - dist;      /* rest from output */\n                            }\n                        }\n                    }\n                    else {                      /* contiguous in window */\n                        from += wnext - op;\n                        if (op < len) {         /* some from window */\n                            len -= op;\n                            do {\n                                PUP(out) = PUP(from);\n                            } while (--op);\n                            from = out - dist;  /* rest from output */\n                        }\n                    }\n                    while (len > 2) {\n                        PUP(out) = PUP(from);\n                        PUP(out) = PUP(from);\n                        PUP(out) = PUP(from);\n                        len -= 3;\n                    }\n                    if (len) {\n                        PUP(out) = PUP(from);\n                        if (len > 1)\n                            PUP(out) = PUP(from);\n                    }\n                }\n                else {\n                    from = out - dist;          /* copy direct from output */\n                    do {                        /* minimum length is three */\n                        PUP(out) = PUP(from);\n                        PUP(out) = PUP(from);\n                        PUP(out) = PUP(from);\n                        len -= 3;\n                    } while (len > 2);\n                    if (len) {\n                        PUP(out) = PUP(from);\n                        if (len > 1)\n                            PUP(out) = PUP(from);\n                    }\n                }\n            }\n            else if ((op & 64) == 0) {          /* 2nd level distance code */\n                here = dcode[here.val + (hold & ((1U << op) - 1))];\n                goto dodist;\n            }\n            else {\n                strm->msg = (char *)\"invalid distance code\";\n                state->mode = BAD;\n                break;\n            }\n        }\n        else if ((op & 64) == 0) {              /* 2nd level length code */\n            here = lcode[here.val + (hold & ((1U << op) - 1))];\n            goto dolen;\n        }\n        else if (op & 32) {                     /* end-of-block */\n            Tracevv((stderr, \"inflate:         end of block\\n\"));\n            state->mode = TYPE;\n            break;\n        }\n        else {\n            strm->msg = (char *)\"invalid literal/length code\";\n            state->mode = BAD;\n            break;\n        }\n    } while (in < last && out < end);\n\n    /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n    len = bits >> 3;\n    in -= len;\n    bits -= len << 3;\n    hold &= (1U << bits) - 1;\n\n    /* update state and return */\n    strm->next_in = in + OFF;\n    strm->next_out = out + OFF;\n    strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));\n    strm->avail_out = (unsigned)(out < end ?\n                                 257 + (end - out) : 257 - (out - end));\n    state->hold = hold;\n    state->bits = bits;\n    return;\n}\n\n/*\n   inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe):\n   - Using bit fields for code structure\n   - Different op definition to avoid & for extra bits (do & for table bits)\n   - Three separate decoding do-loops for direct, window, and wnext == 0\n   - Special case for distance > 1 copies to do overlapped load and store copy\n   - Explicit branch predictions (based on measured branch probabilities)\n   - Deferring match copy and interspersed it with decoding subsequent codes\n   - Swapping literal/length else\n   - Swapping window/direct else\n   - Larger unrolled copy loops (three is about right)\n   - Moving len -= 3 statement into middle of loop\n */\n\n#endif /* !ASMINF */\n"
  },
  {
    "path": "ext/zlib/inffast.h",
    "content": "/* inffast.h -- header to use inffast.c\n * Copyright (C) 1995-2003, 2010 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/* WARNING: this file should *not* be used by applications. It is\n   part of the implementation of the compression library and is\n   subject to change. Applications should only use zlib.h.\n */\n\nvoid ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));\n"
  },
  {
    "path": "ext/zlib/inffixed.h",
    "content": "    /* inffixed.h -- table for decoding fixed codes\n     * Generated automatically by makefixed().\n     */\n\n    /* WARNING: this file should *not* be used by applications.\n       It is part of the implementation of this library and is\n       subject to change. Applications should only use zlib.h.\n     */\n\n    static const code lenfix[512] = {\n        {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48},\n        {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128},\n        {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59},\n        {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176},\n        {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20},\n        {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100},\n        {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8},\n        {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216},\n        {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76},\n        {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114},\n        {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},\n        {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148},\n        {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42},\n        {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86},\n        {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15},\n        {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236},\n        {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62},\n        {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},\n        {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31},\n        {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162},\n        {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25},\n        {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105},\n        {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4},\n        {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202},\n        {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69},\n        {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125},\n        {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13},\n        {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195},\n        {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35},\n        {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91},\n        {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19},\n        {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246},\n        {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55},\n        {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135},\n        {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99},\n        {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190},\n        {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16},\n        {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96},\n        {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6},\n        {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209},\n        {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},\n        {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116},\n        {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4},\n        {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153},\n        {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44},\n        {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82},\n        {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11},\n        {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},\n        {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58},\n        {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138},\n        {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51},\n        {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173},\n        {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30},\n        {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110},\n        {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0},\n        {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195},\n        {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65},\n        {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121},\n        {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},\n        {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258},\n        {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37},\n        {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93},\n        {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23},\n        {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251},\n        {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51},\n        {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},\n        {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67},\n        {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183},\n        {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23},\n        {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103},\n        {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9},\n        {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223},\n        {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79},\n        {0,9,255}\n    };\n\n    static const code distfix[32] = {\n        {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025},\n        {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193},\n        {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385},\n        {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577},\n        {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073},\n        {22,5,193},{64,5,0}\n    };\n"
  },
  {
    "path": "ext/zlib/inflate.c",
    "content": "/* inflate.c -- zlib decompression\n * Copyright (C) 1995-2012 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/*\n * Change history:\n *\n * 1.2.beta0    24 Nov 2002\n * - First version -- complete rewrite of inflate to simplify code, avoid\n *   creation of window when not needed, minimize use of window when it is\n *   needed, make inffast.c even faster, implement gzip decoding, and to\n *   improve code readability and style over the previous zlib inflate code\n *\n * 1.2.beta1    25 Nov 2002\n * - Use pointers for available input and output checking in inffast.c\n * - Remove input and output counters in inffast.c\n * - Change inffast.c entry and loop from avail_in >= 7 to >= 6\n * - Remove unnecessary second byte pull from length extra in inffast.c\n * - Unroll direct copy to three copies per loop in inffast.c\n *\n * 1.2.beta2    4 Dec 2002\n * - Change external routine names to reduce potential conflicts\n * - Correct filename to inffixed.h for fixed tables in inflate.c\n * - Make hbuf[] unsigned char to match parameter type in inflate.c\n * - Change strm->next_out[-state->offset] to *(strm->next_out - state->offset)\n *   to avoid negation problem on Alphas (64 bit) in inflate.c\n *\n * 1.2.beta3    22 Dec 2002\n * - Add comments on state->bits assertion in inffast.c\n * - Add comments on op field in inftrees.h\n * - Fix bug in reuse of allocated window after inflateReset()\n * - Remove bit fields--back to byte structure for speed\n * - Remove distance extra == 0 check in inflate_fast()--only helps for lengths\n * - Change post-increments to pre-increments in inflate_fast(), PPC biased?\n * - Add compile time option, POSTINC, to use post-increments instead (Intel?)\n * - Make MATCH copy in inflate() much faster for when inflate_fast() not used\n * - Use local copies of stream next and avail values, as well as local bit\n *   buffer and bit count in inflate()--for speed when inflate_fast() not used\n *\n * 1.2.beta4    1 Jan 2003\n * - Split ptr - 257 statements in inflate_table() to avoid compiler warnings\n * - Move a comment on output buffer sizes from inffast.c to inflate.c\n * - Add comments in inffast.c to introduce the inflate_fast() routine\n * - Rearrange window copies in inflate_fast() for speed and simplification\n * - Unroll last copy for window match in inflate_fast()\n * - Use local copies of window variables in inflate_fast() for speed\n * - Pull out common wnext == 0 case for speed in inflate_fast()\n * - Make op and len in inflate_fast() unsigned for consistency\n * - Add FAR to lcode and dcode declarations in inflate_fast()\n * - Simplified bad distance check in inflate_fast()\n * - Added inflateBackInit(), inflateBack(), and inflateBackEnd() in new\n *   source file infback.c to provide a call-back interface to inflate for\n *   programs like gzip and unzip -- uses window as output buffer to avoid\n *   window copying\n *\n * 1.2.beta5    1 Jan 2003\n * - Improved inflateBack() interface to allow the caller to provide initial\n *   input in strm.\n * - Fixed stored blocks bug in inflateBack()\n *\n * 1.2.beta6    4 Jan 2003\n * - Added comments in inffast.c on effectiveness of POSTINC\n * - Typecasting all around to reduce compiler warnings\n * - Changed loops from while (1) or do {} while (1) to for (;;), again to\n *   make compilers happy\n * - Changed type of window in inflateBackInit() to unsigned char *\n *\n * 1.2.beta7    27 Jan 2003\n * - Changed many types to unsigned or unsigned short to avoid warnings\n * - Added inflateCopy() function\n *\n * 1.2.0        9 Mar 2003\n * - Changed inflateBack() interface to provide separate opaque descriptors\n *   for the in() and out() functions\n * - Changed inflateBack() argument and in_func typedef to swap the length\n *   and buffer address return values for the input function\n * - Check next_in and next_out for Z_NULL on entry to inflate()\n *\n * The history for versions after 1.2.0 are in ChangeLog in zlib distribution.\n */\n\n#include \"zutil.h\"\n#include \"inftrees.h\"\n#include \"inflate.h\"\n#include \"inffast.h\"\n\n#ifdef MAKEFIXED\n#  ifndef BUILDFIXED\n#    define BUILDFIXED\n#  endif\n#endif\n\n/* function prototypes */\nlocal void fixedtables OF((struct inflate_state FAR *state));\nlocal int updatewindow OF((z_streamp strm, const unsigned char FAR *end,\n                           unsigned copy));\n#ifdef BUILDFIXED\n   void makefixed OF((void));\n#endif\nlocal unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf,\n                              unsigned len));\n\nint ZEXPORT inflateResetKeep(strm)\nz_streamp strm;\n{\n    struct inflate_state FAR *state;\n\n    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;\n    state = (struct inflate_state FAR *)strm->state;\n    strm->total_in = strm->total_out = state->total = 0;\n    strm->msg = Z_NULL;\n    if (state->wrap)        /* to support ill-conceived Java test suite */\n        strm->adler = state->wrap & 1;\n    state->mode = HEAD;\n    state->last = 0;\n    state->havedict = 0;\n    state->dmax = 32768U;\n    state->head = Z_NULL;\n    state->hold = 0;\n    state->bits = 0;\n    state->lencode = state->distcode = state->next = state->codes;\n    state->sane = 1;\n    state->back = -1;\n    Tracev((stderr, \"inflate: reset\\n\"));\n    return Z_OK;\n}\n\nint ZEXPORT inflateReset(strm)\nz_streamp strm;\n{\n    struct inflate_state FAR *state;\n\n    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;\n    state = (struct inflate_state FAR *)strm->state;\n    state->wsize = 0;\n    state->whave = 0;\n    state->wnext = 0;\n    return inflateResetKeep(strm);\n}\n\nint ZEXPORT inflateReset2(strm, windowBits)\nz_streamp strm;\nint windowBits;\n{\n    int wrap;\n    struct inflate_state FAR *state;\n\n    /* get the state */\n    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;\n    state = (struct inflate_state FAR *)strm->state;\n\n    /* extract wrap request from windowBits parameter */\n    if (windowBits < 0) {\n        wrap = 0;\n        windowBits = -windowBits;\n    }\n    else {\n        wrap = (windowBits >> 4) + 1;\n#ifdef GUNZIP\n        if (windowBits < 48)\n            windowBits &= 15;\n#endif\n    }\n\n    /* set number of window bits, free window if different */\n    if (windowBits && (windowBits < 8 || windowBits > 15))\n        return Z_STREAM_ERROR;\n    if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) {\n        ZFREE(strm, state->window);\n        state->window = Z_NULL;\n    }\n\n    /* update state and reset the rest of it */\n    state->wrap = wrap;\n    state->wbits = (unsigned)windowBits;\n    return inflateReset(strm);\n}\n\nint ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)\nz_streamp strm;\nint windowBits;\nconst char *version;\nint stream_size;\n{\n    int ret;\n    struct inflate_state FAR *state;\n\n    if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||\n        stream_size != (int)(sizeof(z_stream)))\n        return Z_VERSION_ERROR;\n    if (strm == Z_NULL) return Z_STREAM_ERROR;\n    strm->msg = Z_NULL;                 /* in case we return an error */\n    if (strm->zalloc == (alloc_func)0) {\n#ifdef Z_SOLO\n        return Z_STREAM_ERROR;\n#else\n        strm->zalloc = zcalloc;\n        strm->opaque = (voidpf)0;\n#endif\n    }\n    if (strm->zfree == (free_func)0)\n#ifdef Z_SOLO\n        return Z_STREAM_ERROR;\n#else\n        strm->zfree = zcfree;\n#endif\n    state = (struct inflate_state FAR *)\n            ZALLOC(strm, 1, sizeof(struct inflate_state));\n    if (state == Z_NULL) return Z_MEM_ERROR;\n    Tracev((stderr, \"inflate: allocated\\n\"));\n    strm->state = (struct internal_state FAR *)state;\n    state->window = Z_NULL;\n    ret = inflateReset2(strm, windowBits);\n    if (ret != Z_OK) {\n        ZFREE(strm, state);\n        strm->state = Z_NULL;\n    }\n    return ret;\n}\n\nint ZEXPORT inflateInit_(strm, version, stream_size)\nz_streamp strm;\nconst char *version;\nint stream_size;\n{\n    return inflateInit2_(strm, DEF_WBITS, version, stream_size);\n}\n\nint ZEXPORT inflatePrime(strm, bits, value)\nz_streamp strm;\nint bits;\nint value;\n{\n    struct inflate_state FAR *state;\n\n    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;\n    state = (struct inflate_state FAR *)strm->state;\n    if (bits < 0) {\n        state->hold = 0;\n        state->bits = 0;\n        return Z_OK;\n    }\n    if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR;\n    value &= (1L << bits) - 1;\n    state->hold += value << state->bits;\n    state->bits += bits;\n    return Z_OK;\n}\n\n/*\n   Return state with length and distance decoding tables and index sizes set to\n   fixed code decoding.  Normally this returns fixed tables from inffixed.h.\n   If BUILDFIXED is defined, then instead this routine builds the tables the\n   first time it's called, and returns those tables the first time and\n   thereafter.  This reduces the size of the code by about 2K bytes, in\n   exchange for a little execution time.  However, BUILDFIXED should not be\n   used for threaded applications, since the rewriting of the tables and virgin\n   may not be thread-safe.\n */\nlocal void fixedtables(state)\nstruct inflate_state FAR *state;\n{\n#ifdef BUILDFIXED\n    static int virgin = 1;\n    static code *lenfix, *distfix;\n    static code fixed[544];\n\n    /* build fixed huffman tables if first call (may not be thread safe) */\n    if (virgin) {\n        unsigned sym, bits;\n        static code *next;\n\n        /* literal/length table */\n        sym = 0;\n        while (sym < 144) state->lens[sym++] = 8;\n        while (sym < 256) state->lens[sym++] = 9;\n        while (sym < 280) state->lens[sym++] = 7;\n        while (sym < 288) state->lens[sym++] = 8;\n        next = fixed;\n        lenfix = next;\n        bits = 9;\n        inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);\n\n        /* distance table */\n        sym = 0;\n        while (sym < 32) state->lens[sym++] = 5;\n        distfix = next;\n        bits = 5;\n        inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);\n\n        /* do this just once */\n        virgin = 0;\n    }\n#else /* !BUILDFIXED */\n#   include \"inffixed.h\"\n#endif /* BUILDFIXED */\n    state->lencode = lenfix;\n    state->lenbits = 9;\n    state->distcode = distfix;\n    state->distbits = 5;\n}\n\n#ifdef MAKEFIXED\n#include <stdio.h>\n\n/*\n   Write out the inffixed.h that is #include'd above.  Defining MAKEFIXED also\n   defines BUILDFIXED, so the tables are built on the fly.  makefixed() writes\n   those tables to stdout, which would be piped to inffixed.h.  A small program\n   can simply call makefixed to do this:\n\n    void makefixed(void);\n\n    int main(void)\n    {\n        makefixed();\n        return 0;\n    }\n\n   Then that can be linked with zlib built with MAKEFIXED defined and run:\n\n    a.out > inffixed.h\n */\nvoid makefixed()\n{\n    unsigned low, size;\n    struct inflate_state state;\n\n    fixedtables(&state);\n    puts(\"    /* inffixed.h -- table for decoding fixed codes\");\n    puts(\"     * Generated automatically by makefixed().\");\n    puts(\"     */\");\n    puts(\"\");\n    puts(\"    /* WARNING: this file should *not* be used by applications.\");\n    puts(\"       It is part of the implementation of this library and is\");\n    puts(\"       subject to change. Applications should only use zlib.h.\");\n    puts(\"     */\");\n    puts(\"\");\n    size = 1U << 9;\n    printf(\"    static const code lenfix[%u] = {\", size);\n    low = 0;\n    for (;;) {\n        if ((low % 7) == 0) printf(\"\\n        \");\n        printf(\"{%u,%u,%d}\", (low & 127) == 99 ? 64 : state.lencode[low].op,\n               state.lencode[low].bits, state.lencode[low].val);\n        if (++low == size) break;\n        putchar(',');\n    }\n    puts(\"\\n    };\");\n    size = 1U << 5;\n    printf(\"\\n    static const code distfix[%u] = {\", size);\n    low = 0;\n    for (;;) {\n        if ((low % 6) == 0) printf(\"\\n        \");\n        printf(\"{%u,%u,%d}\", state.distcode[low].op, state.distcode[low].bits,\n               state.distcode[low].val);\n        if (++low == size) break;\n        putchar(',');\n    }\n    puts(\"\\n    };\");\n}\n#endif /* MAKEFIXED */\n\n/*\n   Update the window with the last wsize (normally 32K) bytes written before\n   returning.  If window does not exist yet, create it.  This is only called\n   when a window is already in use, or when output has been written during this\n   inflate call, but the end of the deflate stream has not been reached yet.\n   It is also called to create a window for dictionary data when a dictionary\n   is loaded.\n\n   Providing output buffers larger than 32K to inflate() should provide a speed\n   advantage, since only the last 32K of output is copied to the sliding window\n   upon return from inflate(), and since all distances after the first 32K of\n   output will fall in the output data, making match copies simpler and faster.\n   The advantage may be dependent on the size of the processor's data caches.\n */\nlocal int updatewindow(strm, end, copy)\nz_streamp strm;\nconst Bytef *end;\nunsigned copy;\n{\n    struct inflate_state FAR *state;\n    unsigned dist;\n\n    state = (struct inflate_state FAR *)strm->state;\n\n    /* if it hasn't been done already, allocate space for the window */\n    if (state->window == Z_NULL) {\n        state->window = (unsigned char FAR *)\n                        ZALLOC(strm, 1U << state->wbits,\n                               sizeof(unsigned char));\n        if (state->window == Z_NULL) return 1;\n    }\n\n    /* if window not in use yet, initialize */\n    if (state->wsize == 0) {\n        state->wsize = 1U << state->wbits;\n        state->wnext = 0;\n        state->whave = 0;\n    }\n\n    /* copy state->wsize or less output bytes into the circular window */\n    if (copy >= state->wsize) {\n        zmemcpy(state->window, end - state->wsize, state->wsize);\n        state->wnext = 0;\n        state->whave = state->wsize;\n    }\n    else {\n        dist = state->wsize - state->wnext;\n        if (dist > copy) dist = copy;\n        zmemcpy(state->window + state->wnext, end - copy, dist);\n        copy -= dist;\n        if (copy) {\n            zmemcpy(state->window, end - copy, copy);\n            state->wnext = copy;\n            state->whave = state->wsize;\n        }\n        else {\n            state->wnext += dist;\n            if (state->wnext == state->wsize) state->wnext = 0;\n            if (state->whave < state->wsize) state->whave += dist;\n        }\n    }\n    return 0;\n}\n\n/* Macros for inflate(): */\n\n/* check function to use adler32() for zlib or crc32() for gzip */\n#ifdef GUNZIP\n#  define UPDATE(check, buf, len) \\\n    (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))\n#else\n#  define UPDATE(check, buf, len) adler32(check, buf, len)\n#endif\n\n/* check macros for header crc */\n#ifdef GUNZIP\n#  define CRC2(check, word) \\\n    do { \\\n        hbuf[0] = (unsigned char)(word); \\\n        hbuf[1] = (unsigned char)((word) >> 8); \\\n        check = crc32(check, hbuf, 2); \\\n    } while (0)\n\n#  define CRC4(check, word) \\\n    do { \\\n        hbuf[0] = (unsigned char)(word); \\\n        hbuf[1] = (unsigned char)((word) >> 8); \\\n        hbuf[2] = (unsigned char)((word) >> 16); \\\n        hbuf[3] = (unsigned char)((word) >> 24); \\\n        check = crc32(check, hbuf, 4); \\\n    } while (0)\n#endif\n\n/* Load registers with state in inflate() for speed */\n#define LOAD() \\\n    do { \\\n        put = strm->next_out; \\\n        left = strm->avail_out; \\\n        next = strm->next_in; \\\n        have = strm->avail_in; \\\n        hold = state->hold; \\\n        bits = state->bits; \\\n    } while (0)\n\n/* Restore state from registers in inflate() */\n#define RESTORE() \\\n    do { \\\n        strm->next_out = put; \\\n        strm->avail_out = left; \\\n        strm->next_in = next; \\\n        strm->avail_in = have; \\\n        state->hold = hold; \\\n        state->bits = bits; \\\n    } while (0)\n\n/* Clear the input bit accumulator */\n#define INITBITS() \\\n    do { \\\n        hold = 0; \\\n        bits = 0; \\\n    } while (0)\n\n/* Get a byte of input into the bit accumulator, or return from inflate()\n   if there is no input available. */\n#define PULLBYTE() \\\n    do { \\\n        if (have == 0) goto inf_leave; \\\n        have--; \\\n        hold += (unsigned long)(*next++) << bits; \\\n        bits += 8; \\\n    } while (0)\n\n/* Assure that there are at least n bits in the bit accumulator.  If there is\n   not enough available input to do that, then return from inflate(). */\n#define NEEDBITS(n) \\\n    do { \\\n        while (bits < (unsigned)(n)) \\\n            PULLBYTE(); \\\n    } while (0)\n\n/* Return the low n bits of the bit accumulator (n < 16) */\n#define BITS(n) \\\n    ((unsigned)hold & ((1U << (n)) - 1))\n\n/* Remove n bits from the bit accumulator */\n#define DROPBITS(n) \\\n    do { \\\n        hold >>= (n); \\\n        bits -= (unsigned)(n); \\\n    } while (0)\n\n/* Remove zero to seven bits as needed to go to a byte boundary */\n#define BYTEBITS() \\\n    do { \\\n        hold >>= bits & 7; \\\n        bits -= bits & 7; \\\n    } while (0)\n\n/*\n   inflate() uses a state machine to process as much input data and generate as\n   much output data as possible before returning.  The state machine is\n   structured roughly as follows:\n\n    for (;;) switch (state) {\n    ...\n    case STATEn:\n        if (not enough input data or output space to make progress)\n            return;\n        ... make progress ...\n        state = STATEm;\n        break;\n    ...\n    }\n\n   so when inflate() is called again, the same case is attempted again, and\n   if the appropriate resources are provided, the machine proceeds to the\n   next state.  The NEEDBITS() macro is usually the way the state evaluates\n   whether it can proceed or should return.  NEEDBITS() does the return if\n   the requested bits are not available.  The typical use of the BITS macros\n   is:\n\n        NEEDBITS(n);\n        ... do something with BITS(n) ...\n        DROPBITS(n);\n\n   where NEEDBITS(n) either returns from inflate() if there isn't enough\n   input left to load n bits into the accumulator, or it continues.  BITS(n)\n   gives the low n bits in the accumulator.  When done, DROPBITS(n) drops\n   the low n bits off the accumulator.  INITBITS() clears the accumulator\n   and sets the number of available bits to zero.  BYTEBITS() discards just\n   enough bits to put the accumulator on a byte boundary.  After BYTEBITS()\n   and a NEEDBITS(8), then BITS(8) would return the next byte in the stream.\n\n   NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return\n   if there is no input available.  The decoding of variable length codes uses\n   PULLBYTE() directly in order to pull just enough bytes to decode the next\n   code, and no more.\n\n   Some states loop until they get enough input, making sure that enough\n   state information is maintained to continue the loop where it left off\n   if NEEDBITS() returns in the loop.  For example, want, need, and keep\n   would all have to actually be part of the saved state in case NEEDBITS()\n   returns:\n\n    case STATEw:\n        while (want < need) {\n            NEEDBITS(n);\n            keep[want++] = BITS(n);\n            DROPBITS(n);\n        }\n        state = STATEx;\n    case STATEx:\n\n   As shown above, if the next state is also the next case, then the break\n   is omitted.\n\n   A state may also return if there is not enough output space available to\n   complete that state.  Those states are copying stored data, writing a\n   literal byte, and copying a matching string.\n\n   When returning, a \"goto inf_leave\" is used to update the total counters,\n   update the check value, and determine whether any progress has been made\n   during that inflate() call in order to return the proper return code.\n   Progress is defined as a change in either strm->avail_in or strm->avail_out.\n   When there is a window, goto inf_leave will update the window with the last\n   output written.  If a goto inf_leave occurs in the middle of decompression\n   and there is no window currently, goto inf_leave will create one and copy\n   output to the window for the next call of inflate().\n\n   In this implementation, the flush parameter of inflate() only affects the\n   return code (per zlib.h).  inflate() always writes as much as possible to\n   strm->next_out, given the space available and the provided input--the effect\n   documented in zlib.h of Z_SYNC_FLUSH.  Furthermore, inflate() always defers\n   the allocation of and copying into a sliding window until necessary, which\n   provides the effect documented in zlib.h for Z_FINISH when the entire input\n   stream available.  So the only thing the flush parameter actually does is:\n   when flush is set to Z_FINISH, inflate() cannot return Z_OK.  Instead it\n   will return Z_BUF_ERROR if it has not reached the end of the stream.\n */\n\nint ZEXPORT inflate(strm, flush)\nz_streamp strm;\nint flush;\n{\n    struct inflate_state FAR *state;\n    z_const unsigned char FAR *next;    /* next input */\n    unsigned char FAR *put;     /* next output */\n    unsigned have, left;        /* available input and output */\n    unsigned long hold;         /* bit buffer */\n    unsigned bits;              /* bits in bit buffer */\n    unsigned in, out;           /* save starting available input and output */\n    unsigned copy;              /* number of stored or match bytes to copy */\n    unsigned char FAR *from;    /* where to copy match bytes from */\n    code here;                  /* current decoding table entry */\n    code last;                  /* parent table entry */\n    unsigned len;               /* length to copy for repeats, bits to drop */\n    int ret;                    /* return code */\n#ifdef GUNZIP\n    unsigned char hbuf[4];      /* buffer for gzip header crc calculation */\n#endif\n    static const unsigned short order[19] = /* permutation of code lengths */\n        {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};\n\n    if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL ||\n        (strm->next_in == Z_NULL && strm->avail_in != 0))\n        return Z_STREAM_ERROR;\n\n    state = (struct inflate_state FAR *)strm->state;\n    if (state->mode == TYPE) state->mode = TYPEDO;      /* skip check */\n    LOAD();\n    in = have;\n    out = left;\n    ret = Z_OK;\n    for (;;)\n        switch (state->mode) {\n        case HEAD:\n            if (state->wrap == 0) {\n                state->mode = TYPEDO;\n                break;\n            }\n            NEEDBITS(16);\n#ifdef GUNZIP\n            if ((state->wrap & 2) && hold == 0x8b1f) {  /* gzip header */\n                state->check = crc32(0L, Z_NULL, 0);\n                CRC2(state->check, hold);\n                INITBITS();\n                state->mode = FLAGS;\n                break;\n            }\n            state->flags = 0;           /* expect zlib header */\n            if (state->head != Z_NULL)\n                state->head->done = -1;\n            if (!(state->wrap & 1) ||   /* check if zlib header allowed */\n#else\n            if (\n#endif\n                ((BITS(8) << 8) + (hold >> 8)) % 31) {\n                strm->msg = (char *)\"incorrect header check\";\n                state->mode = BAD;\n                break;\n            }\n            if (BITS(4) != Z_DEFLATED) {\n                strm->msg = (char *)\"unknown compression method\";\n                state->mode = BAD;\n                break;\n            }\n            DROPBITS(4);\n            len = BITS(4) + 8;\n            if (state->wbits == 0)\n                state->wbits = len;\n            else if (len > state->wbits) {\n                strm->msg = (char *)\"invalid window size\";\n                state->mode = BAD;\n                break;\n            }\n            state->dmax = 1U << len;\n            Tracev((stderr, \"inflate:   zlib header ok\\n\"));\n            strm->adler = state->check = adler32(0L, Z_NULL, 0);\n            state->mode = hold & 0x200 ? DICTID : TYPE;\n            INITBITS();\n            break;\n#ifdef GUNZIP\n        case FLAGS:\n            NEEDBITS(16);\n            state->flags = (int)(hold);\n            if ((state->flags & 0xff) != Z_DEFLATED) {\n                strm->msg = (char *)\"unknown compression method\";\n                state->mode = BAD;\n                break;\n            }\n            if (state->flags & 0xe000) {\n                strm->msg = (char *)\"unknown header flags set\";\n                state->mode = BAD;\n                break;\n            }\n            if (state->head != Z_NULL)\n                state->head->text = (int)((hold >> 8) & 1);\n            if (state->flags & 0x0200) CRC2(state->check, hold);\n            INITBITS();\n            state->mode = TIME;\n        case TIME:\n            NEEDBITS(32);\n            if (state->head != Z_NULL)\n                state->head->time = hold;\n            if (state->flags & 0x0200) CRC4(state->check, hold);\n            INITBITS();\n            state->mode = OS;\n        case OS:\n            NEEDBITS(16);\n            if (state->head != Z_NULL) {\n                state->head->xflags = (int)(hold & 0xff);\n                state->head->os = (int)(hold >> 8);\n            }\n            if (state->flags & 0x0200) CRC2(state->check, hold);\n            INITBITS();\n            state->mode = EXLEN;\n        case EXLEN:\n            if (state->flags & 0x0400) {\n                NEEDBITS(16);\n                state->length = (unsigned)(hold);\n                if (state->head != Z_NULL)\n                    state->head->extra_len = (unsigned)hold;\n                if (state->flags & 0x0200) CRC2(state->check, hold);\n                INITBITS();\n            }\n            else if (state->head != Z_NULL)\n                state->head->extra = Z_NULL;\n            state->mode = EXTRA;\n        case EXTRA:\n            if (state->flags & 0x0400) {\n                copy = state->length;\n                if (copy > have) copy = have;\n                if (copy) {\n                    if (state->head != Z_NULL &&\n                        state->head->extra != Z_NULL) {\n                        len = state->head->extra_len - state->length;\n                        zmemcpy(state->head->extra + len, next,\n                                len + copy > state->head->extra_max ?\n                                state->head->extra_max - len : copy);\n                    }\n                    if (state->flags & 0x0200)\n                        state->check = crc32(state->check, next, copy);\n                    have -= copy;\n                    next += copy;\n                    state->length -= copy;\n                }\n                if (state->length) goto inf_leave;\n            }\n            state->length = 0;\n            state->mode = NAME;\n        case NAME:\n            if (state->flags & 0x0800) {\n                if (have == 0) goto inf_leave;\n                copy = 0;\n                do {\n                    len = (unsigned)(next[copy++]);\n                    if (state->head != Z_NULL &&\n                            state->head->name != Z_NULL &&\n                            state->length < state->head->name_max)\n                        state->head->name[state->length++] = len;\n                } while (len && copy < have);\n                if (state->flags & 0x0200)\n                    state->check = crc32(state->check, next, copy);\n                have -= copy;\n                next += copy;\n                if (len) goto inf_leave;\n            }\n            else if (state->head != Z_NULL)\n                state->head->name = Z_NULL;\n            state->length = 0;\n            state->mode = COMMENT;\n        case COMMENT:\n            if (state->flags & 0x1000) {\n                if (have == 0) goto inf_leave;\n                copy = 0;\n                do {\n                    len = (unsigned)(next[copy++]);\n                    if (state->head != Z_NULL &&\n                            state->head->comment != Z_NULL &&\n                            state->length < state->head->comm_max)\n                        state->head->comment[state->length++] = len;\n                } while (len && copy < have);\n                if (state->flags & 0x0200)\n                    state->check = crc32(state->check, next, copy);\n                have -= copy;\n                next += copy;\n                if (len) goto inf_leave;\n            }\n            else if (state->head != Z_NULL)\n                state->head->comment = Z_NULL;\n            state->mode = HCRC;\n        case HCRC:\n            if (state->flags & 0x0200) {\n                NEEDBITS(16);\n                if (hold != (state->check & 0xffff)) {\n                    strm->msg = (char *)\"header crc mismatch\";\n                    state->mode = BAD;\n                    break;\n                }\n                INITBITS();\n            }\n            if (state->head != Z_NULL) {\n                state->head->hcrc = (int)((state->flags >> 9) & 1);\n                state->head->done = 1;\n            }\n            strm->adler = state->check = crc32(0L, Z_NULL, 0);\n            state->mode = TYPE;\n            break;\n#endif\n        case DICTID:\n            NEEDBITS(32);\n            strm->adler = state->check = ZSWAP32(hold);\n            INITBITS();\n            state->mode = DICT;\n        case DICT:\n            if (state->havedict == 0) {\n                RESTORE();\n                return Z_NEED_DICT;\n            }\n            strm->adler = state->check = adler32(0L, Z_NULL, 0);\n            state->mode = TYPE;\n        case TYPE:\n            if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;\n        case TYPEDO:\n            if (state->last) {\n                BYTEBITS();\n                state->mode = CHECK;\n                break;\n            }\n            NEEDBITS(3);\n            state->last = BITS(1);\n            DROPBITS(1);\n            switch (BITS(2)) {\n            case 0:                             /* stored block */\n                Tracev((stderr, \"inflate:     stored block%s\\n\",\n                        state->last ? \" (last)\" : \"\"));\n                state->mode = STORED;\n                break;\n            case 1:                             /* fixed block */\n                fixedtables(state);\n                Tracev((stderr, \"inflate:     fixed codes block%s\\n\",\n                        state->last ? \" (last)\" : \"\"));\n                state->mode = LEN_;             /* decode codes */\n                if (flush == Z_TREES) {\n                    DROPBITS(2);\n                    goto inf_leave;\n                }\n                break;\n            case 2:                             /* dynamic block */\n                Tracev((stderr, \"inflate:     dynamic codes block%s\\n\",\n                        state->last ? \" (last)\" : \"\"));\n                state->mode = TABLE;\n                break;\n            case 3:\n                strm->msg = (char *)\"invalid block type\";\n                state->mode = BAD;\n            }\n            DROPBITS(2);\n            break;\n        case STORED:\n            BYTEBITS();                         /* go to byte boundary */\n            NEEDBITS(32);\n            if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {\n                strm->msg = (char *)\"invalid stored block lengths\";\n                state->mode = BAD;\n                break;\n            }\n            state->length = (unsigned)hold & 0xffff;\n            Tracev((stderr, \"inflate:       stored length %u\\n\",\n                    state->length));\n            INITBITS();\n            state->mode = COPY_;\n            if (flush == Z_TREES) goto inf_leave;\n        case COPY_:\n            state->mode = COPY;\n        case COPY:\n            copy = state->length;\n            if (copy) {\n                if (copy > have) copy = have;\n                if (copy > left) copy = left;\n                if (copy == 0) goto inf_leave;\n                zmemcpy(put, next, copy);\n                have -= copy;\n                next += copy;\n                left -= copy;\n                put += copy;\n                state->length -= copy;\n                break;\n            }\n            Tracev((stderr, \"inflate:       stored end\\n\"));\n            state->mode = TYPE;\n            break;\n        case TABLE:\n            NEEDBITS(14);\n            state->nlen = BITS(5) + 257;\n            DROPBITS(5);\n            state->ndist = BITS(5) + 1;\n            DROPBITS(5);\n            state->ncode = BITS(4) + 4;\n            DROPBITS(4);\n#ifndef PKZIP_BUG_WORKAROUND\n            if (state->nlen > 286 || state->ndist > 30) {\n                strm->msg = (char *)\"too many length or distance symbols\";\n                state->mode = BAD;\n                break;\n            }\n#endif\n            Tracev((stderr, \"inflate:       table sizes ok\\n\"));\n            state->have = 0;\n            state->mode = LENLENS;\n        case LENLENS:\n            while (state->have < state->ncode) {\n                NEEDBITS(3);\n                state->lens[order[state->have++]] = (unsigned short)BITS(3);\n                DROPBITS(3);\n            }\n            while (state->have < 19)\n                state->lens[order[state->have++]] = 0;\n            state->next = state->codes;\n            state->lencode = (const code FAR *)(state->next);\n            state->lenbits = 7;\n            ret = inflate_table(CODES, state->lens, 19, &(state->next),\n                                &(state->lenbits), state->work);\n            if (ret) {\n                strm->msg = (char *)\"invalid code lengths set\";\n                state->mode = BAD;\n                break;\n            }\n            Tracev((stderr, \"inflate:       code lengths ok\\n\"));\n            state->have = 0;\n            state->mode = CODELENS;\n        case CODELENS:\n            while (state->have < state->nlen + state->ndist) {\n                for (;;) {\n                    here = state->lencode[BITS(state->lenbits)];\n                    if ((unsigned)(here.bits) <= bits) break;\n                    PULLBYTE();\n                }\n                if (here.val < 16) {\n                    DROPBITS(here.bits);\n                    state->lens[state->have++] = here.val;\n                }\n                else {\n                    if (here.val == 16) {\n                        NEEDBITS(here.bits + 2);\n                        DROPBITS(here.bits);\n                        if (state->have == 0) {\n                            strm->msg = (char *)\"invalid bit length repeat\";\n                            state->mode = BAD;\n                            break;\n                        }\n                        len = state->lens[state->have - 1];\n                        copy = 3 + BITS(2);\n                        DROPBITS(2);\n                    }\n                    else if (here.val == 17) {\n                        NEEDBITS(here.bits + 3);\n                        DROPBITS(here.bits);\n                        len = 0;\n                        copy = 3 + BITS(3);\n                        DROPBITS(3);\n                    }\n                    else {\n                        NEEDBITS(here.bits + 7);\n                        DROPBITS(here.bits);\n                        len = 0;\n                        copy = 11 + BITS(7);\n                        DROPBITS(7);\n                    }\n                    if (state->have + copy > state->nlen + state->ndist) {\n                        strm->msg = (char *)\"invalid bit length repeat\";\n                        state->mode = BAD;\n                        break;\n                    }\n                    while (copy--)\n                        state->lens[state->have++] = (unsigned short)len;\n                }\n            }\n\n            /* handle error breaks in while */\n            if (state->mode == BAD) break;\n\n            /* check for end-of-block code (better have one) */\n            if (state->lens[256] == 0) {\n                strm->msg = (char *)\"invalid code -- missing end-of-block\";\n                state->mode = BAD;\n                break;\n            }\n\n            /* build code tables -- note: do not change the lenbits or distbits\n               values here (9 and 6) without reading the comments in inftrees.h\n               concerning the ENOUGH constants, which depend on those values */\n            state->next = state->codes;\n            state->lencode = (const code FAR *)(state->next);\n            state->lenbits = 9;\n            ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),\n                                &(state->lenbits), state->work);\n            if (ret) {\n                strm->msg = (char *)\"invalid literal/lengths set\";\n                state->mode = BAD;\n                break;\n            }\n            state->distcode = (const code FAR *)(state->next);\n            state->distbits = 6;\n            ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,\n                            &(state->next), &(state->distbits), state->work);\n            if (ret) {\n                strm->msg = (char *)\"invalid distances set\";\n                state->mode = BAD;\n                break;\n            }\n            Tracev((stderr, \"inflate:       codes ok\\n\"));\n            state->mode = LEN_;\n            if (flush == Z_TREES) goto inf_leave;\n        case LEN_:\n            state->mode = LEN;\n        case LEN:\n            if (have >= 6 && left >= 258) {\n                RESTORE();\n                inflate_fast(strm, out);\n                LOAD();\n                if (state->mode == TYPE)\n                    state->back = -1;\n                break;\n            }\n            state->back = 0;\n            for (;;) {\n                here = state->lencode[BITS(state->lenbits)];\n                if ((unsigned)(here.bits) <= bits) break;\n                PULLBYTE();\n            }\n            if (here.op && (here.op & 0xf0) == 0) {\n                last = here;\n                for (;;) {\n                    here = state->lencode[last.val +\n                            (BITS(last.bits + last.op) >> last.bits)];\n                    if ((unsigned)(last.bits + here.bits) <= bits) break;\n                    PULLBYTE();\n                }\n                DROPBITS(last.bits);\n                state->back += last.bits;\n            }\n            DROPBITS(here.bits);\n            state->back += here.bits;\n            state->length = (unsigned)here.val;\n            if ((int)(here.op) == 0) {\n                Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n                        \"inflate:         literal '%c'\\n\" :\n                        \"inflate:         literal 0x%02x\\n\", here.val));\n                state->mode = LIT;\n                break;\n            }\n            if (here.op & 32) {\n                Tracevv((stderr, \"inflate:         end of block\\n\"));\n                state->back = -1;\n                state->mode = TYPE;\n                break;\n            }\n            if (here.op & 64) {\n                strm->msg = (char *)\"invalid literal/length code\";\n                state->mode = BAD;\n                break;\n            }\n            state->extra = (unsigned)(here.op) & 15;\n            state->mode = LENEXT;\n        case LENEXT:\n            if (state->extra) {\n                NEEDBITS(state->extra);\n                state->length += BITS(state->extra);\n                DROPBITS(state->extra);\n                state->back += state->extra;\n            }\n            Tracevv((stderr, \"inflate:         length %u\\n\", state->length));\n            state->was = state->length;\n            state->mode = DIST;\n        case DIST:\n            for (;;) {\n                here = state->distcode[BITS(state->distbits)];\n                if ((unsigned)(here.bits) <= bits) break;\n                PULLBYTE();\n            }\n            if ((here.op & 0xf0) == 0) {\n                last = here;\n                for (;;) {\n                    here = state->distcode[last.val +\n                            (BITS(last.bits + last.op) >> last.bits)];\n                    if ((unsigned)(last.bits + here.bits) <= bits) break;\n                    PULLBYTE();\n                }\n                DROPBITS(last.bits);\n                state->back += last.bits;\n            }\n            DROPBITS(here.bits);\n            state->back += here.bits;\n            if (here.op & 64) {\n                strm->msg = (char *)\"invalid distance code\";\n                state->mode = BAD;\n                break;\n            }\n            state->offset = (unsigned)here.val;\n            state->extra = (unsigned)(here.op) & 15;\n            state->mode = DISTEXT;\n        case DISTEXT:\n            if (state->extra) {\n                NEEDBITS(state->extra);\n                state->offset += BITS(state->extra);\n                DROPBITS(state->extra);\n                state->back += state->extra;\n            }\n#ifdef INFLATE_STRICT\n            if (state->offset > state->dmax) {\n                strm->msg = (char *)\"invalid distance too far back\";\n                state->mode = BAD;\n                break;\n            }\n#endif\n            Tracevv((stderr, \"inflate:         distance %u\\n\", state->offset));\n            state->mode = MATCH;\n        case MATCH:\n            if (left == 0) goto inf_leave;\n            copy = out - left;\n            if (state->offset > copy) {         /* copy from window */\n                copy = state->offset - copy;\n                if (copy > state->whave) {\n                    if (state->sane) {\n                        strm->msg = (char *)\"invalid distance too far back\";\n                        state->mode = BAD;\n                        break;\n                    }\n#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n                    Trace((stderr, \"inflate.c too far\\n\"));\n                    copy -= state->whave;\n                    if (copy > state->length) copy = state->length;\n                    if (copy > left) copy = left;\n                    left -= copy;\n                    state->length -= copy;\n                    do {\n                        *put++ = 0;\n                    } while (--copy);\n                    if (state->length == 0) state->mode = LEN;\n                    break;\n#endif\n                }\n                if (copy > state->wnext) {\n                    copy -= state->wnext;\n                    from = state->window + (state->wsize - copy);\n                }\n                else\n                    from = state->window + (state->wnext - copy);\n                if (copy > state->length) copy = state->length;\n            }\n            else {                              /* copy from output */\n                from = put - state->offset;\n                copy = state->length;\n            }\n            if (copy > left) copy = left;\n            left -= copy;\n            state->length -= copy;\n            do {\n                *put++ = *from++;\n            } while (--copy);\n            if (state->length == 0) state->mode = LEN;\n            break;\n        case LIT:\n            if (left == 0) goto inf_leave;\n            *put++ = (unsigned char)(state->length);\n            left--;\n            state->mode = LEN;\n            break;\n        case CHECK:\n            if (state->wrap) {\n                NEEDBITS(32);\n                out -= left;\n                strm->total_out += out;\n                state->total += out;\n                if (out)\n                    strm->adler = state->check =\n                        UPDATE(state->check, put - out, out);\n                out = left;\n                if ((\n#ifdef GUNZIP\n                     state->flags ? hold :\n#endif\n                     ZSWAP32(hold)) != state->check) {\n                    strm->msg = (char *)\"incorrect data check\";\n                    state->mode = BAD;\n                    break;\n                }\n                INITBITS();\n                Tracev((stderr, \"inflate:   check matches trailer\\n\"));\n            }\n#ifdef GUNZIP\n            state->mode = LENGTH;\n        case LENGTH:\n            if (state->wrap && state->flags) {\n                NEEDBITS(32);\n                if (hold != (state->total & 0xffffffffUL)) {\n                    strm->msg = (char *)\"incorrect length check\";\n                    state->mode = BAD;\n                    break;\n                }\n                INITBITS();\n                Tracev((stderr, \"inflate:   length matches trailer\\n\"));\n            }\n#endif\n            state->mode = DONE;\n        case DONE:\n            ret = Z_STREAM_END;\n            goto inf_leave;\n        case BAD:\n            ret = Z_DATA_ERROR;\n            goto inf_leave;\n        case MEM:\n            return Z_MEM_ERROR;\n        case SYNC:\n        default:\n            return Z_STREAM_ERROR;\n        }\n\n    /*\n       Return from inflate(), updating the total counts and the check value.\n       If there was no progress during the inflate() call, return a buffer\n       error.  Call updatewindow() to create and/or update the window state.\n       Note: a memory error from inflate() is non-recoverable.\n     */\n  inf_leave:\n    RESTORE();\n    if (state->wsize || (out != strm->avail_out && state->mode < BAD &&\n            (state->mode < CHECK || flush != Z_FINISH)))\n        if (updatewindow(strm, strm->next_out, out - strm->avail_out)) {\n            state->mode = MEM;\n            return Z_MEM_ERROR;\n        }\n    in -= strm->avail_in;\n    out -= strm->avail_out;\n    strm->total_in += in;\n    strm->total_out += out;\n    state->total += out;\n    if (state->wrap && out)\n        strm->adler = state->check =\n            UPDATE(state->check, strm->next_out - out, out);\n    strm->data_type = state->bits + (state->last ? 64 : 0) +\n                      (state->mode == TYPE ? 128 : 0) +\n                      (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);\n    if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)\n        ret = Z_BUF_ERROR;\n    return ret;\n}\n\nint ZEXPORT inflateEnd(strm)\nz_streamp strm;\n{\n    struct inflate_state FAR *state;\n    if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)\n        return Z_STREAM_ERROR;\n    state = (struct inflate_state FAR *)strm->state;\n    if (state->window != Z_NULL) ZFREE(strm, state->window);\n    ZFREE(strm, strm->state);\n    strm->state = Z_NULL;\n    Tracev((stderr, \"inflate: end\\n\"));\n    return Z_OK;\n}\n\nint ZEXPORT inflateGetDictionary(strm, dictionary, dictLength)\nz_streamp strm;\nBytef *dictionary;\nuInt *dictLength;\n{\n    struct inflate_state FAR *state;\n\n    /* check state */\n    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;\n    state = (struct inflate_state FAR *)strm->state;\n\n    /* copy dictionary */\n    if (state->whave && dictionary != Z_NULL) {\n        zmemcpy(dictionary, state->window + state->wnext,\n                state->whave - state->wnext);\n        zmemcpy(dictionary + state->whave - state->wnext,\n                state->window, state->wnext);\n    }\n    if (dictLength != Z_NULL)\n        *dictLength = state->whave;\n    return Z_OK;\n}\n\nint ZEXPORT inflateSetDictionary(strm, dictionary, dictLength)\nz_streamp strm;\nconst Bytef *dictionary;\nuInt dictLength;\n{\n    struct inflate_state FAR *state;\n    unsigned long dictid;\n    int ret;\n\n    /* check state */\n    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;\n    state = (struct inflate_state FAR *)strm->state;\n    if (state->wrap != 0 && state->mode != DICT)\n        return Z_STREAM_ERROR;\n\n    /* check for correct dictionary identifier */\n    if (state->mode == DICT) {\n        dictid = adler32(0L, Z_NULL, 0);\n        dictid = adler32(dictid, dictionary, dictLength);\n        if (dictid != state->check)\n            return Z_DATA_ERROR;\n    }\n\n    /* copy dictionary to window using updatewindow(), which will amend the\n       existing dictionary if appropriate */\n    ret = updatewindow(strm, dictionary + dictLength, dictLength);\n    if (ret) {\n        state->mode = MEM;\n        return Z_MEM_ERROR;\n    }\n    state->havedict = 1;\n    Tracev((stderr, \"inflate:   dictionary set\\n\"));\n    return Z_OK;\n}\n\nint ZEXPORT inflateGetHeader(strm, head)\nz_streamp strm;\ngz_headerp head;\n{\n    struct inflate_state FAR *state;\n\n    /* check state */\n    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;\n    state = (struct inflate_state FAR *)strm->state;\n    if ((state->wrap & 2) == 0) return Z_STREAM_ERROR;\n\n    /* save header structure */\n    state->head = head;\n    head->done = 0;\n    return Z_OK;\n}\n\n/*\n   Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff.  Return when found\n   or when out of input.  When called, *have is the number of pattern bytes\n   found in order so far, in 0..3.  On return *have is updated to the new\n   state.  If on return *have equals four, then the pattern was found and the\n   return value is how many bytes were read including the last byte of the\n   pattern.  If *have is less than four, then the pattern has not been found\n   yet and the return value is len.  In the latter case, syncsearch() can be\n   called again with more data and the *have state.  *have is initialized to\n   zero for the first call.\n */\nlocal unsigned syncsearch(have, buf, len)\nunsigned FAR *have;\nconst unsigned char FAR *buf;\nunsigned len;\n{\n    unsigned got;\n    unsigned next;\n\n    got = *have;\n    next = 0;\n    while (next < len && got < 4) {\n        if ((int)(buf[next]) == (got < 2 ? 0 : 0xff))\n            got++;\n        else if (buf[next])\n            got = 0;\n        else\n            got = 4 - got;\n        next++;\n    }\n    *have = got;\n    return next;\n}\n\nint ZEXPORT inflateSync(strm)\nz_streamp strm;\n{\n    unsigned len;               /* number of bytes to look at or looked at */\n    unsigned long in, out;      /* temporary to save total_in and total_out */\n    unsigned char buf[4];       /* to restore bit buffer to byte string */\n    struct inflate_state FAR *state;\n\n    /* check parameters */\n    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;\n    state = (struct inflate_state FAR *)strm->state;\n    if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;\n\n    /* if first time, start search in bit buffer */\n    if (state->mode != SYNC) {\n        state->mode = SYNC;\n        state->hold <<= state->bits & 7;\n        state->bits -= state->bits & 7;\n        len = 0;\n        while (state->bits >= 8) {\n            buf[len++] = (unsigned char)(state->hold);\n            state->hold >>= 8;\n            state->bits -= 8;\n        }\n        state->have = 0;\n        syncsearch(&(state->have), buf, len);\n    }\n\n    /* search available input */\n    len = syncsearch(&(state->have), strm->next_in, strm->avail_in);\n    strm->avail_in -= len;\n    strm->next_in += len;\n    strm->total_in += len;\n\n    /* return no joy or set up to restart inflate() on a new block */\n    if (state->have != 4) return Z_DATA_ERROR;\n    in = strm->total_in;  out = strm->total_out;\n    inflateReset(strm);\n    strm->total_in = in;  strm->total_out = out;\n    state->mode = TYPE;\n    return Z_OK;\n}\n\n/*\n   Returns true if inflate is currently at the end of a block generated by\n   Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP\n   implementation to provide an additional safety check. PPP uses\n   Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored\n   block. When decompressing, PPP checks that at the end of input packet,\n   inflate is waiting for these length bytes.\n */\nint ZEXPORT inflateSyncPoint(strm)\nz_streamp strm;\n{\n    struct inflate_state FAR *state;\n\n    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;\n    state = (struct inflate_state FAR *)strm->state;\n    return state->mode == STORED && state->bits == 0;\n}\n\nint ZEXPORT inflateCopy(dest, source)\nz_streamp dest;\nz_streamp source;\n{\n    struct inflate_state FAR *state;\n    struct inflate_state FAR *copy;\n    unsigned char FAR *window;\n    unsigned wsize;\n\n    /* check input */\n    if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL ||\n        source->zalloc == (alloc_func)0 || source->zfree == (free_func)0)\n        return Z_STREAM_ERROR;\n    state = (struct inflate_state FAR *)source->state;\n\n    /* allocate space */\n    copy = (struct inflate_state FAR *)\n           ZALLOC(source, 1, sizeof(struct inflate_state));\n    if (copy == Z_NULL) return Z_MEM_ERROR;\n    window = Z_NULL;\n    if (state->window != Z_NULL) {\n        window = (unsigned char FAR *)\n                 ZALLOC(source, 1U << state->wbits, sizeof(unsigned char));\n        if (window == Z_NULL) {\n            ZFREE(source, copy);\n            return Z_MEM_ERROR;\n        }\n    }\n\n    /* copy state */\n    zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));\n    zmemcpy((voidpf)copy, (voidpf)state, sizeof(struct inflate_state));\n    if (state->lencode >= state->codes &&\n        state->lencode <= state->codes + ENOUGH - 1) {\n        copy->lencode = copy->codes + (state->lencode - state->codes);\n        copy->distcode = copy->codes + (state->distcode - state->codes);\n    }\n    copy->next = copy->codes + (state->next - state->codes);\n    if (window != Z_NULL) {\n        wsize = 1U << state->wbits;\n        zmemcpy(window, state->window, wsize);\n    }\n    copy->window = window;\n    dest->state = (struct internal_state FAR *)copy;\n    return Z_OK;\n}\n\nint ZEXPORT inflateUndermine(strm, subvert)\nz_streamp strm;\nint subvert;\n{\n    struct inflate_state FAR *state;\n\n    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;\n    state = (struct inflate_state FAR *)strm->state;\n    state->sane = !subvert;\n#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n    return Z_OK;\n#else\n    state->sane = 1;\n    return Z_DATA_ERROR;\n#endif\n}\n\nlong ZEXPORT inflateMark(strm)\nz_streamp strm;\n{\n    struct inflate_state FAR *state;\n\n    if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;\n    state = (struct inflate_state FAR *)strm->state;\n    return ((long)(state->back) << 16) +\n        (state->mode == COPY ? state->length :\n            (state->mode == MATCH ? state->was - state->length : 0));\n}\n"
  },
  {
    "path": "ext/zlib/inflate.h",
    "content": "/* inflate.h -- internal inflate state definition\n * Copyright (C) 1995-2009 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/* WARNING: this file should *not* be used by applications. It is\n   part of the implementation of the compression library and is\n   subject to change. Applications should only use zlib.h.\n */\n\n/* define NO_GZIP when compiling if you want to disable gzip header and\n   trailer decoding by inflate().  NO_GZIP would be used to avoid linking in\n   the crc code when it is not needed.  For shared libraries, gzip decoding\n   should be left enabled. */\n#ifndef NO_GZIP\n#  define GUNZIP\n#endif\n\n/* Possible inflate modes between inflate() calls */\ntypedef enum {\n    HEAD,       /* i: waiting for magic header */\n    FLAGS,      /* i: waiting for method and flags (gzip) */\n    TIME,       /* i: waiting for modification time (gzip) */\n    OS,         /* i: waiting for extra flags and operating system (gzip) */\n    EXLEN,      /* i: waiting for extra length (gzip) */\n    EXTRA,      /* i: waiting for extra bytes (gzip) */\n    NAME,       /* i: waiting for end of file name (gzip) */\n    COMMENT,    /* i: waiting for end of comment (gzip) */\n    HCRC,       /* i: waiting for header crc (gzip) */\n    DICTID,     /* i: waiting for dictionary check value */\n    DICT,       /* waiting for inflateSetDictionary() call */\n        TYPE,       /* i: waiting for type bits, including last-flag bit */\n        TYPEDO,     /* i: same, but skip check to exit inflate on new block */\n        STORED,     /* i: waiting for stored size (length and complement) */\n        COPY_,      /* i/o: same as COPY below, but only first time in */\n        COPY,       /* i/o: waiting for input or output to copy stored block */\n        TABLE,      /* i: waiting for dynamic block table lengths */\n        LENLENS,    /* i: waiting for code length code lengths */\n        CODELENS,   /* i: waiting for length/lit and distance code lengths */\n            LEN_,       /* i: same as LEN below, but only first time in */\n            LEN,        /* i: waiting for length/lit/eob code */\n            LENEXT,     /* i: waiting for length extra bits */\n            DIST,       /* i: waiting for distance code */\n            DISTEXT,    /* i: waiting for distance extra bits */\n            MATCH,      /* o: waiting for output space to copy string */\n            LIT,        /* o: waiting for output space to write literal */\n    CHECK,      /* i: waiting for 32-bit check value */\n    LENGTH,     /* i: waiting for 32-bit length (gzip) */\n    DONE,       /* finished check, done -- remain here until reset */\n    BAD,        /* got a data error -- remain here until reset */\n    MEM,        /* got an inflate() memory error -- remain here until reset */\n    SYNC        /* looking for synchronization bytes to restart inflate() */\n} inflate_mode;\n\n/*\n    State transitions between above modes -\n\n    (most modes can go to BAD or MEM on error -- not shown for clarity)\n\n    Process header:\n        HEAD -> (gzip) or (zlib) or (raw)\n        (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME -> COMMENT ->\n                  HCRC -> TYPE\n        (zlib) -> DICTID or TYPE\n        DICTID -> DICT -> TYPE\n        (raw) -> TYPEDO\n    Read deflate blocks:\n            TYPE -> TYPEDO -> STORED or TABLE or LEN_ or CHECK\n            STORED -> COPY_ -> COPY -> TYPE\n            TABLE -> LENLENS -> CODELENS -> LEN_\n            LEN_ -> LEN\n    Read deflate codes in fixed or dynamic block:\n                LEN -> LENEXT or LIT or TYPE\n                LENEXT -> DIST -> DISTEXT -> MATCH -> LEN\n                LIT -> LEN\n    Process trailer:\n        CHECK -> LENGTH -> DONE\n */\n\n/* state maintained between inflate() calls.  Approximately 10K bytes. */\nstruct inflate_state {\n    inflate_mode mode;          /* current inflate mode */\n    int last;                   /* true if processing last block */\n    int wrap;                   /* bit 0 true for zlib, bit 1 true for gzip */\n    int havedict;               /* true if dictionary provided */\n    int flags;                  /* gzip header method and flags (0 if zlib) */\n    unsigned dmax;              /* zlib header max distance (INFLATE_STRICT) */\n    unsigned long check;        /* protected copy of check value */\n    unsigned long total;        /* protected copy of output count */\n    gz_headerp head;            /* where to save gzip header information */\n        /* sliding window */\n    unsigned wbits;             /* log base 2 of requested window size */\n    unsigned wsize;             /* window size or zero if not using window */\n    unsigned whave;             /* valid bytes in the window */\n    unsigned wnext;             /* window write index */\n    unsigned char FAR *window;  /* allocated sliding window, if needed */\n        /* bit accumulator */\n    unsigned long hold;         /* input bit accumulator */\n    unsigned bits;              /* number of bits in \"in\" */\n        /* for string and stored block copying */\n    unsigned length;            /* literal or length of data to copy */\n    unsigned offset;            /* distance back to copy string from */\n        /* for table and code decoding */\n    unsigned extra;             /* extra bits needed */\n        /* fixed and dynamic code tables */\n    code const FAR *lencode;    /* starting table for length/literal codes */\n    code const FAR *distcode;   /* starting table for distance codes */\n    unsigned lenbits;           /* index bits for lencode */\n    unsigned distbits;          /* index bits for distcode */\n        /* dynamic table building */\n    unsigned ncode;             /* number of code length code lengths */\n    unsigned nlen;              /* number of length code lengths */\n    unsigned ndist;             /* number of distance code lengths */\n    unsigned have;              /* number of code lengths in lens[] */\n    code FAR *next;             /* next available space in codes[] */\n    unsigned short lens[320];   /* temporary storage for code lengths */\n    unsigned short work[288];   /* work area for code table building */\n    code codes[ENOUGH];         /* space for code tables */\n    int sane;                   /* if false, allow invalid distance too far */\n    int back;                   /* bits back of last unprocessed length/lit */\n    unsigned was;               /* initial length of match */\n};\n"
  },
  {
    "path": "ext/zlib/inftrees.c",
    "content": "/* inftrees.c -- generate Huffman trees for efficient decoding\n * Copyright (C) 1995-2013 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n#include \"zutil.h\"\n#include \"inftrees.h\"\n\n#define MAXBITS 15\n\nconst char inflate_copyright[] =\n   \" inflate 1.2.8 Copyright 1995-2013 Mark Adler \";\n/*\n  If you use the zlib library in a product, an acknowledgment is welcome\n  in the documentation of your product. If for some reason you cannot\n  include such an acknowledgment, I would appreciate that you keep this\n  copyright string in the executable of your product.\n */\n\n/*\n   Build a set of tables to decode the provided canonical Huffman code.\n   The code lengths are lens[0..codes-1].  The result starts at *table,\n   whose indices are 0..2^bits-1.  work is a writable array of at least\n   lens shorts, which is used as a work area.  type is the type of code\n   to be generated, CODES, LENS, or DISTS.  On return, zero is success,\n   -1 is an invalid code, and +1 means that ENOUGH isn't enough.  table\n   on return points to the next available entry's address.  bits is the\n   requested root table index bits, and on return it is the actual root\n   table index bits.  It will differ if the request is greater than the\n   longest code or if it is less than the shortest code.\n */\nint ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work)\ncodetype type;\nunsigned short FAR *lens;\nunsigned codes;\ncode FAR * FAR *table;\nunsigned FAR *bits;\nunsigned short FAR *work;\n{\n    unsigned len;               /* a code's length in bits */\n    unsigned sym;               /* index of code symbols */\n    unsigned min, max;          /* minimum and maximum code lengths */\n    unsigned root;              /* number of index bits for root table */\n    unsigned curr;              /* number of index bits for current table */\n    unsigned drop;              /* code bits to drop for sub-table */\n    int left;                   /* number of prefix codes available */\n    unsigned used;              /* code entries in table used */\n    unsigned huff;              /* Huffman code */\n    unsigned incr;              /* for incrementing code, index */\n    unsigned fill;              /* index for replicating entries */\n    unsigned low;               /* low bits for current root entry */\n    unsigned mask;              /* mask for low root bits */\n    code here;                  /* table entry for duplication */\n    code FAR *next;             /* next available space in table */\n    const unsigned short FAR *base;     /* base value table to use */\n    const unsigned short FAR *extra;    /* extra bits table to use */\n    int end;                    /* use base and extra for symbol > end */\n    unsigned short count[MAXBITS+1];    /* number of codes of each length */\n    unsigned short offs[MAXBITS+1];     /* offsets in table for each length */\n    static const unsigned short lbase[31] = { /* Length codes 257..285 base */\n        3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n        35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};\n    static const unsigned short lext[31] = { /* Length codes 257..285 extra */\n        16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78};\n    static const unsigned short dbase[32] = { /* Distance codes 0..29 base */\n        1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n        257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n        8193, 12289, 16385, 24577, 0, 0};\n    static const unsigned short dext[32] = { /* Distance codes 0..29 extra */\n        16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n        23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n        28, 28, 29, 29, 64, 64};\n\n    /*\n       Process a set of code lengths to create a canonical Huffman code.  The\n       code lengths are lens[0..codes-1].  Each length corresponds to the\n       symbols 0..codes-1.  The Huffman code is generated by first sorting the\n       symbols by length from short to long, and retaining the symbol order\n       for codes with equal lengths.  Then the code starts with all zero bits\n       for the first code of the shortest length, and the codes are integer\n       increments for the same length, and zeros are appended as the length\n       increases.  For the deflate format, these bits are stored backwards\n       from their more natural integer increment ordering, and so when the\n       decoding tables are built in the large loop below, the integer codes\n       are incremented backwards.\n\n       This routine assumes, but does not check, that all of the entries in\n       lens[] are in the range 0..MAXBITS.  The caller must assure this.\n       1..MAXBITS is interpreted as that code length.  zero means that that\n       symbol does not occur in this code.\n\n       The codes are sorted by computing a count of codes for each length,\n       creating from that a table of starting indices for each length in the\n       sorted table, and then entering the symbols in order in the sorted\n       table.  The sorted table is work[], with that space being provided by\n       the caller.\n\n       The length counts are used for other purposes as well, i.e. finding\n       the minimum and maximum length codes, determining if there are any\n       codes at all, checking for a valid set of lengths, and looking ahead\n       at length counts to determine sub-table sizes when building the\n       decoding tables.\n     */\n\n    /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n    for (len = 0; len <= MAXBITS; len++)\n        count[len] = 0;\n    for (sym = 0; sym < codes; sym++)\n        count[lens[sym]]++;\n\n    /* bound code lengths, force root to be within code lengths */\n    root = *bits;\n    for (max = MAXBITS; max >= 1; max--)\n        if (count[max] != 0) break;\n    if (root > max) root = max;\n    if (max == 0) {                     /* no symbols to code at all */\n        here.op = (unsigned char)64;    /* invalid code marker */\n        here.bits = (unsigned char)1;\n        here.val = (unsigned short)0;\n        *(*table)++ = here;             /* make a table to force an error */\n        *(*table)++ = here;\n        *bits = 1;\n        return 0;     /* no symbols, but wait for decoding to report error */\n    }\n    for (min = 1; min < max; min++)\n        if (count[min] != 0) break;\n    if (root < min) root = min;\n\n    /* check for an over-subscribed or incomplete set of lengths */\n    left = 1;\n    for (len = 1; len <= MAXBITS; len++) {\n        left <<= 1;\n        left -= count[len];\n        if (left < 0) return -1;        /* over-subscribed */\n    }\n    if (left > 0 && (type == CODES || max != 1))\n        return -1;                      /* incomplete set */\n\n    /* generate offsets into symbol table for each length for sorting */\n    offs[1] = 0;\n    for (len = 1; len < MAXBITS; len++)\n        offs[len + 1] = offs[len] + count[len];\n\n    /* sort symbols by length, by symbol order within each length */\n    for (sym = 0; sym < codes; sym++)\n        if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;\n\n    /*\n       Create and fill in decoding tables.  In this loop, the table being\n       filled is at next and has curr index bits.  The code being used is huff\n       with length len.  That code is converted to an index by dropping drop\n       bits off of the bottom.  For codes where len is less than drop + curr,\n       those top drop + curr - len bits are incremented through all values to\n       fill the table with replicated entries.\n\n       root is the number of index bits for the root table.  When len exceeds\n       root, sub-tables are created pointed to by the root entry with an index\n       of the low root bits of huff.  This is saved in low to check for when a\n       new sub-table should be started.  drop is zero when the root table is\n       being filled, and drop is root when sub-tables are being filled.\n\n       When a new sub-table is needed, it is necessary to look ahead in the\n       code lengths to determine what size sub-table is needed.  The length\n       counts are used for this, and so count[] is decremented as codes are\n       entered in the tables.\n\n       used keeps track of how many table entries have been allocated from the\n       provided *table space.  It is checked for LENS and DIST tables against\n       the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n       the initial root table size constants.  See the comments in inftrees.h\n       for more information.\n\n       sym increments through all symbols, and the loop terminates when\n       all codes of length max, i.e. all codes, have been processed.  This\n       routine permits incomplete codes, so another loop after this one fills\n       in the rest of the decoding tables with invalid code markers.\n     */\n\n    /* set up for code type */\n    switch (type) {\n    case CODES:\n        base = extra = work;    /* dummy value--not used */\n        end = 19;\n        break;\n    case LENS:\n        base = lbase;\n        base -= 257;\n        extra = lext;\n        extra -= 257;\n        end = 256;\n        break;\n    default:            /* DISTS */\n        base = dbase;\n        extra = dext;\n        end = -1;\n    }\n\n    /* initialize state for loop */\n    huff = 0;                   /* starting code */\n    sym = 0;                    /* starting code symbol */\n    len = min;                  /* starting code length */\n    next = *table;              /* current table to fill in */\n    curr = root;                /* current table index bits */\n    drop = 0;                   /* current bits to drop from code for index */\n    low = (unsigned)(-1);       /* trigger new sub-table when len > root */\n    used = 1U << root;          /* use root table entries */\n    mask = used - 1;            /* mask for comparing low */\n\n    /* check available table space */\n    if ((type == LENS && used > ENOUGH_LENS) ||\n        (type == DISTS && used > ENOUGH_DISTS))\n        return 1;\n\n    /* process all codes and make table entries */\n    for (;;) {\n        /* create table entry */\n        here.bits = (unsigned char)(len - drop);\n        if ((int)(work[sym]) < end) {\n            here.op = (unsigned char)0;\n            here.val = work[sym];\n        }\n        else if ((int)(work[sym]) > end) {\n            here.op = (unsigned char)(extra[work[sym]]);\n            here.val = base[work[sym]];\n        }\n        else {\n            here.op = (unsigned char)(32 + 64);         /* end of block */\n            here.val = 0;\n        }\n\n        /* replicate for those indices with low len bits equal to huff */\n        incr = 1U << (len - drop);\n        fill = 1U << curr;\n        min = fill;                 /* save offset to next table */\n        do {\n            fill -= incr;\n            next[(huff >> drop) + fill] = here;\n        } while (fill != 0);\n\n        /* backwards increment the len-bit code huff */\n        incr = 1U << (len - 1);\n        while (huff & incr)\n            incr >>= 1;\n        if (incr != 0) {\n            huff &= incr - 1;\n            huff += incr;\n        }\n        else\n            huff = 0;\n\n        /* go to next symbol, update count, len */\n        sym++;\n        if (--(count[len]) == 0) {\n            if (len == max) break;\n            len = lens[work[sym]];\n        }\n\n        /* create new sub-table if needed */\n        if (len > root && (huff & mask) != low) {\n            /* if first time, transition to sub-tables */\n            if (drop == 0)\n                drop = root;\n\n            /* increment past last table */\n            next += min;            /* here min is 1 << curr */\n\n            /* determine length of next table */\n            curr = len - drop;\n            left = (int)(1 << curr);\n            while (curr + drop < max) {\n                left -= count[curr + drop];\n                if (left <= 0) break;\n                curr++;\n                left <<= 1;\n            }\n\n            /* check for enough space */\n            used += 1U << curr;\n            if ((type == LENS && used > ENOUGH_LENS) ||\n                (type == DISTS && used > ENOUGH_DISTS))\n                return 1;\n\n            /* point entry in root table to sub-table */\n            low = huff & mask;\n            (*table)[low].op = (unsigned char)curr;\n            (*table)[low].bits = (unsigned char)root;\n            (*table)[low].val = (unsigned short)(next - *table);\n        }\n    }\n\n    /* fill in remaining table entry if code is incomplete (guaranteed to have\n       at most one remaining entry, since if the code is incomplete, the\n       maximum code length that was allowed to get this far is one bit) */\n    if (huff != 0) {\n        here.op = (unsigned char)64;            /* invalid code marker */\n        here.bits = (unsigned char)(len - drop);\n        here.val = (unsigned short)0;\n        next[huff] = here;\n    }\n\n    /* set return parameters */\n    *table += used;\n    *bits = root;\n    return 0;\n}\n"
  },
  {
    "path": "ext/zlib/inftrees.h",
    "content": "/* inftrees.h -- header to use inftrees.c\n * Copyright (C) 1995-2005, 2010 Mark Adler\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/* WARNING: this file should *not* be used by applications. It is\n   part of the implementation of the compression library and is\n   subject to change. Applications should only use zlib.h.\n */\n\n/* Structure for decoding tables.  Each entry provides either the\n   information needed to do the operation requested by the code that\n   indexed that table entry, or it provides a pointer to another\n   table that indexes more bits of the code.  op indicates whether\n   the entry is a pointer to another table, a literal, a length or\n   distance, an end-of-block, or an invalid code.  For a table\n   pointer, the low four bits of op is the number of index bits of\n   that table.  For a length or distance, the low four bits of op\n   is the number of extra bits to get after the code.  bits is\n   the number of bits in this code or part of the code to drop off\n   of the bit buffer.  val is the actual byte to output in the case\n   of a literal, the base length or distance, or the offset from\n   the current table to the next table.  Each entry is four bytes. */\ntypedef struct {\n    unsigned char op;           /* operation, extra bits, table bits */\n    unsigned char bits;         /* bits in this part of the code */\n    unsigned short val;         /* offset in table or code value */\n} code;\n\n/* op values as set by inflate_table():\n    00000000 - literal\n    0000tttt - table link, tttt != 0 is the number of table index bits\n    0001eeee - length or distance, eeee is the number of extra bits\n    01100000 - end of block\n    01000000 - invalid code\n */\n\n/* Maximum size of the dynamic table.  The maximum number of code structures is\n   1444, which is the sum of 852 for literal/length codes and 592 for distance\n   codes.  These values were found by exhaustive searches using the program\n   examples/enough.c found in the zlib distribtution.  The arguments to that\n   program are the number of symbols, the initial root table size, and the\n   maximum bit length of a code.  \"enough 286 9 15\" for literal/length codes\n   returns returns 852, and \"enough 30 6 15\" for distance codes returns 592.\n   The initial root table size (9 or 6) is found in the fifth argument of the\n   inflate_table() calls in inflate.c and infback.c.  If the root table size is\n   changed, then these maximum sizes would be need to be recalculated and\n   updated. */\n#define ENOUGH_LENS 852\n#define ENOUGH_DISTS 592\n#define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS)\n\n/* Type of code to build for inflate_table() */\ntypedef enum {\n    CODES,\n    LENS,\n    DISTS\n} codetype;\n\nint ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,\n                             unsigned codes, code FAR * FAR *table,\n                             unsigned FAR *bits, unsigned short FAR *work));\n"
  },
  {
    "path": "ext/zlib/trees.c",
    "content": "/* trees.c -- output deflated data using Huffman coding\n * Copyright (C) 1995-2012 Jean-loup Gailly\n * detect_data_type() function provided freely by Cosmin Truta, 2006\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/*\n *  ALGORITHM\n *\n *      The \"deflation\" process uses several Huffman trees. The more\n *      common source values are represented by shorter bit sequences.\n *\n *      Each code tree is stored in a compressed form which is itself\n * a Huffman encoding of the lengths of all the code strings (in\n * ascending order by source values).  The actual code strings are\n * reconstructed from the lengths in the inflate process, as described\n * in the deflate specification.\n *\n *  REFERENCES\n *\n *      Deutsch, L.P.,\"'Deflate' Compressed Data Format Specification\".\n *      Available in ftp.uu.net:/pub/archiving/zip/doc/deflate-1.1.doc\n *\n *      Storer, James A.\n *          Data Compression:  Methods and Theory, pp. 49-50.\n *          Computer Science Press, 1988.  ISBN 0-7167-8156-5.\n *\n *      Sedgewick, R.\n *          Algorithms, p290.\n *          Addison-Wesley, 1983. ISBN 0-201-06672-6.\n */\n\n/* @(#) $Id$ */\n\n/* #define GEN_TREES_H */\n\n#include \"deflate.h\"\n\n#ifdef DEBUG\n#  include <ctype.h>\n#endif\n\n/* ===========================================================================\n * Constants\n */\n\n#define MAX_BL_BITS 7\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\n#define END_BLOCK 256\n/* end of block literal code */\n\n#define REP_3_6      16\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\n#define REPZ_3_10    17\n/* repeat a zero length 3-10 times  (3 bits of repeat count) */\n\n#define REPZ_11_138  18\n/* repeat a zero length 11-138 times  (7 bits of repeat count) */\n\nlocal const int extra_lbits[LENGTH_CODES] /* extra bits for each length code */\n   = {0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0};\n\nlocal const int extra_dbits[D_CODES] /* extra bits for each distance code */\n   = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};\n\nlocal const int extra_blbits[BL_CODES]/* extra bits for each bit length code */\n   = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7};\n\nlocal const uch bl_order[BL_CODES]\n   = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n#define DIST_CODE_LEN  512 /* see definition of array dist_code below */\n\n#if defined(GEN_TREES_H) || !defined(STDC)\n/* non ANSI compilers may not accept trees.h */\n\nlocal ct_data static_ltree[L_CODES+2];\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nlocal ct_data static_dtree[D_CODES];\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nuch _dist_code[DIST_CODE_LEN];\n/* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nuch _length_code[MAX_MATCH-MIN_MATCH+1];\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nlocal int base_length[LENGTH_CODES];\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nlocal int base_dist[D_CODES];\n/* First normalized distance for each code (0 = distance of 1) */\n\n#else\n#  include \"trees.h\"\n#endif /* GEN_TREES_H */\n\nstruct static_tree_desc_s {\n    const ct_data *static_tree;  /* static tree or NULL */\n    const intf *extra_bits;      /* extra bits for each code or NULL */\n    int     extra_base;          /* base index for extra_bits */\n    int     elems;               /* max number of elements in the tree */\n    int     max_length;          /* max bit length for the codes */\n};\n\nlocal static_tree_desc  static_l_desc =\n{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS};\n\nlocal static_tree_desc  static_d_desc =\n{static_dtree, extra_dbits, 0,          D_CODES, MAX_BITS};\n\nlocal static_tree_desc  static_bl_desc =\n{(const ct_data *)0, extra_blbits, 0,   BL_CODES, MAX_BL_BITS};\n\n/* ===========================================================================\n * Local (static) routines in this file.\n */\n\nlocal void tr_static_init OF((void));\nlocal void init_block     OF((deflate_state *s));\nlocal void pqdownheap     OF((deflate_state *s, ct_data *tree, int k));\nlocal void gen_bitlen     OF((deflate_state *s, tree_desc *desc));\nlocal void gen_codes      OF((ct_data *tree, int max_code, ushf *bl_count));\nlocal void build_tree     OF((deflate_state *s, tree_desc *desc));\nlocal void scan_tree      OF((deflate_state *s, ct_data *tree, int max_code));\nlocal void send_tree      OF((deflate_state *s, ct_data *tree, int max_code));\nlocal int  build_bl_tree  OF((deflate_state *s));\nlocal void send_all_trees OF((deflate_state *s, int lcodes, int dcodes,\n                              int blcodes));\nlocal void compress_block OF((deflate_state *s, const ct_data *ltree,\n                              const ct_data *dtree));\nlocal int  detect_data_type OF((deflate_state *s));\nlocal unsigned bi_reverse OF((unsigned value, int length));\nlocal void bi_windup      OF((deflate_state *s));\nlocal void bi_flush       OF((deflate_state *s));\nlocal void copy_block     OF((deflate_state *s, charf *buf, unsigned len,\n                              int header));\n\n#ifdef GEN_TREES_H\nlocal void gen_trees_header OF((void));\n#endif\n\n#ifndef DEBUG\n#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)\n   /* Send a code of the given tree. c and tree must not have side effects */\n\n#else /* DEBUG */\n#  define send_code(s, c, tree) \\\n     { if (z_verbose>2) fprintf(stderr,\"\\ncd %3d \",(c)); \\\n       send_bits(s, tree[c].Code, tree[c].Len); }\n#endif\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\n#define put_short(s, w) { \\\n    put_byte(s, (uch)((w) & 0xff)); \\\n    put_byte(s, (uch)((ush)(w) >> 8)); \\\n}\n\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\n#ifdef DEBUG\nlocal void send_bits      OF((deflate_state *s, int value, int length));\n\nlocal void send_bits(s, value, length)\n    deflate_state *s;\n    int value;  /* value to send */\n    int length; /* number of bits */\n{\n    Tracevv((stderr,\" l %2d v %4x \", length, value));\n    Assert(length > 0 && length <= 15, \"invalid length\");\n    s->bits_sent += (ulg)length;\n\n    /* If not enough room in bi_buf, use (valid) bits from bi_buf and\n     * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))\n     * unused bits in value.\n     */\n    if (s->bi_valid > (int)Buf_size - length) {\n        s->bi_buf |= (ush)value << s->bi_valid;\n        put_short(s, s->bi_buf);\n        s->bi_buf = (ush)value >> (Buf_size - s->bi_valid);\n        s->bi_valid += length - Buf_size;\n    } else {\n        s->bi_buf |= (ush)value << s->bi_valid;\n        s->bi_valid += length;\n    }\n}\n#else /* !DEBUG */\n\n#define send_bits(s, value, length) \\\n{ int len = length;\\\n  if (s->bi_valid > (int)Buf_size - len) {\\\n    int val = value;\\\n    s->bi_buf |= (ush)val << s->bi_valid;\\\n    put_short(s, s->bi_buf);\\\n    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\\\n    s->bi_valid += len - Buf_size;\\\n  } else {\\\n    s->bi_buf |= (ush)(value) << s->bi_valid;\\\n    s->bi_valid += len;\\\n  }\\\n}\n#endif /* DEBUG */\n\n\n/* the arguments must not have side effects */\n\n/* ===========================================================================\n * Initialize the various 'constant' tables.\n */\nlocal void tr_static_init()\n{\n#if defined(GEN_TREES_H) || !defined(STDC)\n    static int static_init_done = 0;\n    int n;        /* iterates over tree elements */\n    int bits;     /* bit counter */\n    int length;   /* length value */\n    int code;     /* code value */\n    int dist;     /* distance index */\n    ush bl_count[MAX_BITS+1];\n    /* number of codes at each bit length for an optimal tree */\n\n    if (static_init_done) return;\n\n    /* For some embedded targets, global variables are not initialized: */\n#ifdef NO_INIT_GLOBAL_POINTERS\n    static_l_desc.static_tree = static_ltree;\n    static_l_desc.extra_bits = extra_lbits;\n    static_d_desc.static_tree = static_dtree;\n    static_d_desc.extra_bits = extra_dbits;\n    static_bl_desc.extra_bits = extra_blbits;\n#endif\n\n    /* Initialize the mapping length (0..255) -> length code (0..28) */\n    length = 0;\n    for (code = 0; code < LENGTH_CODES-1; code++) {\n        base_length[code] = length;\n        for (n = 0; n < (1<<extra_lbits[code]); n++) {\n            _length_code[length++] = (uch)code;\n        }\n    }\n    Assert (length == 256, \"tr_static_init: length != 256\");\n    /* Note that the length 255 (match length 258) can be represented\n     * in two different ways: code 284 + 5 bits or code 285, so we\n     * overwrite length_code[255] to use the best encoding:\n     */\n    _length_code[length-1] = (uch)code;\n\n    /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n    dist = 0;\n    for (code = 0 ; code < 16; code++) {\n        base_dist[code] = dist;\n        for (n = 0; n < (1<<extra_dbits[code]); n++) {\n            _dist_code[dist++] = (uch)code;\n        }\n    }\n    Assert (dist == 256, \"tr_static_init: dist != 256\");\n    dist >>= 7; /* from now on, all distances are divided by 128 */\n    for ( ; code < D_CODES; code++) {\n        base_dist[code] = dist << 7;\n        for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {\n            _dist_code[256 + dist++] = (uch)code;\n        }\n    }\n    Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n    /* Construct the codes of the static literal tree */\n    for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;\n    n = 0;\n    while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++;\n    while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++;\n    while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++;\n    while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++;\n    /* Codes 286 and 287 do not exist, but we must include them in the\n     * tree construction to get a canonical Huffman tree (longest code\n     * all ones)\n     */\n    gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count);\n\n    /* The static distance tree is trivial: */\n    for (n = 0; n < D_CODES; n++) {\n        static_dtree[n].Len = 5;\n        static_dtree[n].Code = bi_reverse((unsigned)n, 5);\n    }\n    static_init_done = 1;\n\n#  ifdef GEN_TREES_H\n    gen_trees_header();\n#  endif\n#endif /* defined(GEN_TREES_H) || !defined(STDC) */\n}\n\n/* ===========================================================================\n * Genererate the file trees.h describing the static trees.\n */\n#ifdef GEN_TREES_H\n#  ifndef DEBUG\n#    include <stdio.h>\n#  endif\n\n#  define SEPARATOR(i, last, width) \\\n      ((i) == (last)? \"\\n};\\n\\n\" :    \\\n       ((i) % (width) == (width)-1 ? \",\\n\" : \", \"))\n\nvoid gen_trees_header()\n{\n    FILE *header = fopen(\"trees.h\", \"w\");\n    int i;\n\n    Assert (header != NULL, \"Can't open trees.h\");\n    fprintf(header,\n            \"/* header created automatically with -DGEN_TREES_H */\\n\\n\");\n\n    fprintf(header, \"local const ct_data static_ltree[L_CODES+2] = {\\n\");\n    for (i = 0; i < L_CODES+2; i++) {\n        fprintf(header, \"{{%3u},{%3u}}%s\", static_ltree[i].Code,\n                static_ltree[i].Len, SEPARATOR(i, L_CODES+1, 5));\n    }\n\n    fprintf(header, \"local const ct_data static_dtree[D_CODES] = {\\n\");\n    for (i = 0; i < D_CODES; i++) {\n        fprintf(header, \"{{%2u},{%2u}}%s\", static_dtree[i].Code,\n                static_dtree[i].Len, SEPARATOR(i, D_CODES-1, 5));\n    }\n\n    fprintf(header, \"const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {\\n\");\n    for (i = 0; i < DIST_CODE_LEN; i++) {\n        fprintf(header, \"%2u%s\", _dist_code[i],\n                SEPARATOR(i, DIST_CODE_LEN-1, 20));\n    }\n\n    fprintf(header,\n        \"const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {\\n\");\n    for (i = 0; i < MAX_MATCH-MIN_MATCH+1; i++) {\n        fprintf(header, \"%2u%s\", _length_code[i],\n                SEPARATOR(i, MAX_MATCH-MIN_MATCH, 20));\n    }\n\n    fprintf(header, \"local const int base_length[LENGTH_CODES] = {\\n\");\n    for (i = 0; i < LENGTH_CODES; i++) {\n        fprintf(header, \"%1u%s\", base_length[i],\n                SEPARATOR(i, LENGTH_CODES-1, 20));\n    }\n\n    fprintf(header, \"local const int base_dist[D_CODES] = {\\n\");\n    for (i = 0; i < D_CODES; i++) {\n        fprintf(header, \"%5u%s\", base_dist[i],\n                SEPARATOR(i, D_CODES-1, 10));\n    }\n\n    fclose(header);\n}\n#endif /* GEN_TREES_H */\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nvoid ZLIB_INTERNAL _tr_init(s)\n    deflate_state *s;\n{\n    tr_static_init();\n\n    s->l_desc.dyn_tree = s->dyn_ltree;\n    s->l_desc.stat_desc = &static_l_desc;\n\n    s->d_desc.dyn_tree = s->dyn_dtree;\n    s->d_desc.stat_desc = &static_d_desc;\n\n    s->bl_desc.dyn_tree = s->bl_tree;\n    s->bl_desc.stat_desc = &static_bl_desc;\n\n    s->bi_buf = 0;\n    s->bi_valid = 0;\n#ifdef DEBUG\n    s->compressed_len = 0L;\n    s->bits_sent = 0L;\n#endif\n\n    /* Initialize the first block of the first file: */\n    init_block(s);\n}\n\n/* ===========================================================================\n * Initialize a new block.\n */\nlocal void init_block(s)\n    deflate_state *s;\n{\n    int n; /* iterates over tree elements */\n\n    /* Initialize the trees. */\n    for (n = 0; n < L_CODES;  n++) s->dyn_ltree[n].Freq = 0;\n    for (n = 0; n < D_CODES;  n++) s->dyn_dtree[n].Freq = 0;\n    for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;\n\n    s->dyn_ltree[END_BLOCK].Freq = 1;\n    s->opt_len = s->static_len = 0L;\n    s->last_lit = s->matches = 0;\n}\n\n#define SMALLEST 1\n/* Index within the heap array of least frequent node in the Huffman tree */\n\n\n/* ===========================================================================\n * Remove the smallest element from the heap and recreate the heap with\n * one less element. Updates heap and heap_len.\n */\n#define pqremove(s, tree, top) \\\n{\\\n    top = s->heap[SMALLEST]; \\\n    s->heap[SMALLEST] = s->heap[s->heap_len--]; \\\n    pqdownheap(s, tree, SMALLEST); \\\n}\n\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\n#define smaller(tree, n, m, depth) \\\n   (tree[n].Freq < tree[m].Freq || \\\n   (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))\n\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\nlocal void pqdownheap(s, tree, k)\n    deflate_state *s;\n    ct_data *tree;  /* the tree to restore */\n    int k;               /* node to move down */\n{\n    int v = s->heap[k];\n    int j = k << 1;  /* left son of k */\n    while (j <= s->heap_len) {\n        /* Set j to the smallest of the two sons: */\n        if (j < s->heap_len &&\n            smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {\n            j++;\n        }\n        /* Exit if v is smaller than both sons */\n        if (smaller(tree, v, s->heap[j], s->depth)) break;\n\n        /* Exchange v with the smallest son */\n        s->heap[k] = s->heap[j];  k = j;\n\n        /* And continue down the tree, setting j to the left son of k */\n        j <<= 1;\n    }\n    s->heap[k] = v;\n}\n\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n *    above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n *     array bl_count contains the frequencies for each bit length.\n *     The length opt_len is updated; static_len is also updated if stree is\n *     not null.\n */\nlocal void gen_bitlen(s, desc)\n    deflate_state *s;\n    tree_desc *desc;    /* the tree descriptor */\n{\n    ct_data *tree        = desc->dyn_tree;\n    int max_code         = desc->max_code;\n    const ct_data *stree = desc->stat_desc->static_tree;\n    const intf *extra    = desc->stat_desc->extra_bits;\n    int base             = desc->stat_desc->extra_base;\n    int max_length       = desc->stat_desc->max_length;\n    int h;              /* heap index */\n    int n, m;           /* iterate over the tree elements */\n    int bits;           /* bit length */\n    int xbits;          /* extra bits */\n    ush f;              /* frequency */\n    int overflow = 0;   /* number of elements with bit length too large */\n\n    for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;\n\n    /* In a first pass, compute the optimal bit lengths (which may\n     * overflow in the case of the bit length tree).\n     */\n    tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */\n\n    for (h = s->heap_max+1; h < HEAP_SIZE; h++) {\n        n = s->heap[h];\n        bits = tree[tree[n].Dad].Len + 1;\n        if (bits > max_length) bits = max_length, overflow++;\n        tree[n].Len = (ush)bits;\n        /* We overwrite tree[n].Dad which is no longer needed */\n\n        if (n > max_code) continue; /* not a leaf node */\n\n        s->bl_count[bits]++;\n        xbits = 0;\n        if (n >= base) xbits = extra[n-base];\n        f = tree[n].Freq;\n        s->opt_len += (ulg)f * (bits + xbits);\n        if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits);\n    }\n    if (overflow == 0) return;\n\n    Trace((stderr,\"\\nbit length overflow\\n\"));\n    /* This happens for example on obj2 and pic of the Calgary corpus */\n\n    /* Find the first bit length which could increase: */\n    do {\n        bits = max_length-1;\n        while (s->bl_count[bits] == 0) bits--;\n        s->bl_count[bits]--;      /* move one leaf down the tree */\n        s->bl_count[bits+1] += 2; /* move one overflow item as its brother */\n        s->bl_count[max_length]--;\n        /* The brother of the overflow item also moves one step up,\n         * but this does not affect bl_count[max_length]\n         */\n        overflow -= 2;\n    } while (overflow > 0);\n\n    /* Now recompute all bit lengths, scanning in increasing frequency.\n     * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n     * lengths instead of fixing only the wrong ones. This idea is taken\n     * from 'ar' written by Haruhiko Okumura.)\n     */\n    for (bits = max_length; bits != 0; bits--) {\n        n = s->bl_count[bits];\n        while (n != 0) {\n            m = s->heap[--h];\n            if (m > max_code) continue;\n            if ((unsigned) tree[m].Len != (unsigned) bits) {\n                Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n                s->opt_len += ((long)bits - (long)tree[m].Len)\n                              *(long)tree[m].Freq;\n                tree[m].Len = (ush)bits;\n            }\n            n--;\n        }\n    }\n}\n\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n *     zero code length.\n */\nlocal void gen_codes (tree, max_code, bl_count)\n    ct_data *tree;             /* the tree to decorate */\n    int max_code;              /* largest code with non zero frequency */\n    ushf *bl_count;            /* number of codes at each bit length */\n{\n    ush next_code[MAX_BITS+1]; /* next code value for each bit length */\n    ush code = 0;              /* running code value */\n    int bits;                  /* bit index */\n    int n;                     /* code index */\n\n    /* The distribution counts are first used to generate the code values\n     * without bit reversal.\n     */\n    for (bits = 1; bits <= MAX_BITS; bits++) {\n        next_code[bits] = code = (code + bl_count[bits-1]) << 1;\n    }\n    /* Check that the bit counts in bl_count are consistent. The last code\n     * must be all ones.\n     */\n    Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n            \"inconsistent bit counts\");\n    Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n    for (n = 0;  n <= max_code; n++) {\n        int len = tree[n].Len;\n        if (len == 0) continue;\n        /* Now reverse the bits */\n        tree[n].Code = bi_reverse(next_code[len]++, len);\n\n        Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n             n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n    }\n}\n\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n *     and corresponding code. The length opt_len is updated; static_len is\n *     also updated if stree is not null. The field max_code is set.\n */\nlocal void build_tree(s, desc)\n    deflate_state *s;\n    tree_desc *desc; /* the tree descriptor */\n{\n    ct_data *tree         = desc->dyn_tree;\n    const ct_data *stree  = desc->stat_desc->static_tree;\n    int elems             = desc->stat_desc->elems;\n    int n, m;          /* iterate over heap elements */\n    int max_code = -1; /* largest code with non zero frequency */\n    int node;          /* new node being created */\n\n    /* Construct the initial heap, with least frequent element in\n     * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n     * heap[0] is not used.\n     */\n    s->heap_len = 0, s->heap_max = HEAP_SIZE;\n\n    for (n = 0; n < elems; n++) {\n        if (tree[n].Freq != 0) {\n            s->heap[++(s->heap_len)] = max_code = n;\n            s->depth[n] = 0;\n        } else {\n            tree[n].Len = 0;\n        }\n    }\n\n    /* The pkzip format requires that at least one distance code exists,\n     * and that at least one bit should be sent even if there is only one\n     * possible code. So to avoid special checks later on we force at least\n     * two codes of non zero frequency.\n     */\n    while (s->heap_len < 2) {\n        node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);\n        tree[node].Freq = 1;\n        s->depth[node] = 0;\n        s->opt_len--; if (stree) s->static_len -= stree[node].Len;\n        /* node is 0 or 1 so it does not have extra bits */\n    }\n    desc->max_code = max_code;\n\n    /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n     * establish sub-heaps of increasing lengths:\n     */\n    for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);\n\n    /* Construct the Huffman tree by repeatedly combining the least two\n     * frequent nodes.\n     */\n    node = elems;              /* next internal node of the tree */\n    do {\n        pqremove(s, tree, n);  /* n = node of least frequency */\n        m = s->heap[SMALLEST]; /* m = node of next least frequency */\n\n        s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */\n        s->heap[--(s->heap_max)] = m;\n\n        /* Create a new node father of n and m */\n        tree[node].Freq = tree[n].Freq + tree[m].Freq;\n        s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ?\n                                s->depth[n] : s->depth[m]) + 1);\n        tree[n].Dad = tree[m].Dad = (ush)node;\n#ifdef DUMP_BL_TREE\n        if (tree == s->bl_tree) {\n            fprintf(stderr,\"\\nnode %d(%d), sons %d(%d) %d(%d)\",\n                    node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq);\n        }\n#endif\n        /* and insert the new node in the heap */\n        s->heap[SMALLEST] = node++;\n        pqdownheap(s, tree, SMALLEST);\n\n    } while (s->heap_len >= 2);\n\n    s->heap[--(s->heap_max)] = s->heap[SMALLEST];\n\n    /* At this point, the fields freq and dad are set. We can now\n     * generate the bit lengths.\n     */\n    gen_bitlen(s, (tree_desc *)desc);\n\n    /* The field len is now set, we can generate the bit codes */\n    gen_codes ((ct_data *)tree, max_code, s->bl_count);\n}\n\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nlocal void scan_tree (s, tree, max_code)\n    deflate_state *s;\n    ct_data *tree;   /* the tree to be scanned */\n    int max_code;    /* and its largest code of non zero frequency */\n{\n    int n;                     /* iterates over all tree elements */\n    int prevlen = -1;          /* last emitted length */\n    int curlen;                /* length of current code */\n    int nextlen = tree[0].Len; /* length of next code */\n    int count = 0;             /* repeat count of the current code */\n    int max_count = 7;         /* max repeat count */\n    int min_count = 4;         /* min repeat count */\n\n    if (nextlen == 0) max_count = 138, min_count = 3;\n    tree[max_code+1].Len = (ush)0xffff; /* guard */\n\n    for (n = 0; n <= max_code; n++) {\n        curlen = nextlen; nextlen = tree[n+1].Len;\n        if (++count < max_count && curlen == nextlen) {\n            continue;\n        } else if (count < min_count) {\n            s->bl_tree[curlen].Freq += count;\n        } else if (curlen != 0) {\n            if (curlen != prevlen) s->bl_tree[curlen].Freq++;\n            s->bl_tree[REP_3_6].Freq++;\n        } else if (count <= 10) {\n            s->bl_tree[REPZ_3_10].Freq++;\n        } else {\n            s->bl_tree[REPZ_11_138].Freq++;\n        }\n        count = 0; prevlen = curlen;\n        if (nextlen == 0) {\n            max_count = 138, min_count = 3;\n        } else if (curlen == nextlen) {\n            max_count = 6, min_count = 3;\n        } else {\n            max_count = 7, min_count = 4;\n        }\n    }\n}\n\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nlocal void send_tree (s, tree, max_code)\n    deflate_state *s;\n    ct_data *tree; /* the tree to be scanned */\n    int max_code;       /* and its largest code of non zero frequency */\n{\n    int n;                     /* iterates over all tree elements */\n    int prevlen = -1;          /* last emitted length */\n    int curlen;                /* length of current code */\n    int nextlen = tree[0].Len; /* length of next code */\n    int count = 0;             /* repeat count of the current code */\n    int max_count = 7;         /* max repeat count */\n    int min_count = 4;         /* min repeat count */\n\n    /* tree[max_code+1].Len = -1; */  /* guard already set */\n    if (nextlen == 0) max_count = 138, min_count = 3;\n\n    for (n = 0; n <= max_code; n++) {\n        curlen = nextlen; nextlen = tree[n+1].Len;\n        if (++count < max_count && curlen == nextlen) {\n            continue;\n        } else if (count < min_count) {\n            do { send_code(s, curlen, s->bl_tree); } while (--count != 0);\n\n        } else if (curlen != 0) {\n            if (curlen != prevlen) {\n                send_code(s, curlen, s->bl_tree); count--;\n            }\n            Assert(count >= 3 && count <= 6, \" 3_6?\");\n            send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2);\n\n        } else if (count <= 10) {\n            send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3);\n\n        } else {\n            send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7);\n        }\n        count = 0; prevlen = curlen;\n        if (nextlen == 0) {\n            max_count = 138, min_count = 3;\n        } else if (curlen == nextlen) {\n            max_count = 6, min_count = 3;\n        } else {\n            max_count = 7, min_count = 4;\n        }\n    }\n}\n\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\nlocal int build_bl_tree(s)\n    deflate_state *s;\n{\n    int max_blindex;  /* index of last bit length code of non zero freq */\n\n    /* Determine the bit length frequencies for literal and distance trees */\n    scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);\n    scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);\n\n    /* Build the bit length tree: */\n    build_tree(s, (tree_desc *)(&(s->bl_desc)));\n    /* opt_len now includes the length of the tree representations, except\n     * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n     */\n\n    /* Determine the number of bit length codes to send. The pkzip format\n     * requires that at least 4 bit length codes be sent. (appnote.txt says\n     * 3 but the actual value used is 4.)\n     */\n    for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {\n        if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;\n    }\n    /* Update opt_len to include the bit length tree and counts */\n    s->opt_len += 3*(max_blindex+1) + 5+5+4;\n    Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n            s->opt_len, s->static_len));\n\n    return max_blindex;\n}\n\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\nlocal void send_all_trees(s, lcodes, dcodes, blcodes)\n    deflate_state *s;\n    int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n    int rank;                    /* index in bl_order */\n\n    Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n    Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n            \"too many codes\");\n    Tracev((stderr, \"\\nbl counts: \"));\n    send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */\n    send_bits(s, dcodes-1,   5);\n    send_bits(s, blcodes-4,  4); /* not -3 as stated in appnote.txt */\n    for (rank = 0; rank < blcodes; rank++) {\n        Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n        send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);\n    }\n    Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n    send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */\n    Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n    send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */\n    Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}\n\n/* ===========================================================================\n * Send a stored block\n */\nvoid ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)\n    deflate_state *s;\n    charf *buf;       /* input block */\n    ulg stored_len;   /* length of input block */\n    int last;         /* one if this is the last block for a file */\n{\n    send_bits(s, (STORED_BLOCK<<1)+last, 3);    /* send block type */\n#ifdef DEBUG\n    s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;\n    s->compressed_len += (stored_len + 4) << 3;\n#endif\n    copy_block(s, buf, (unsigned)stored_len, 1); /* with header */\n}\n\n/* ===========================================================================\n * Flush the bits in the bit buffer to pending output (leaves at most 7 bits)\n */\nvoid ZLIB_INTERNAL _tr_flush_bits(s)\n    deflate_state *s;\n{\n    bi_flush(s);\n}\n\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\nvoid ZLIB_INTERNAL _tr_align(s)\n    deflate_state *s;\n{\n    send_bits(s, STATIC_TREES<<1, 3);\n    send_code(s, END_BLOCK, static_ltree);\n#ifdef DEBUG\n    s->compressed_len += 10L; /* 3 for block type, 7 for EOB */\n#endif\n    bi_flush(s);\n}\n\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and output the encoded block to the zip file.\n */\nvoid ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)\n    deflate_state *s;\n    charf *buf;       /* input block, or NULL if too old */\n    ulg stored_len;   /* length of input block */\n    int last;         /* one if this is the last block for a file */\n{\n    ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n    int max_blindex = 0;  /* index of last bit length code of non zero freq */\n\n    /* Build the Huffman trees unless a stored block is forced */\n    if (s->level > 0) {\n\n        /* Check if the file is binary or text */\n        if (s->strm->data_type == Z_UNKNOWN)\n            s->strm->data_type = detect_data_type(s);\n\n        /* Construct the literal and distance trees */\n        build_tree(s, (tree_desc *)(&(s->l_desc)));\n        Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n                s->static_len));\n\n        build_tree(s, (tree_desc *)(&(s->d_desc)));\n        Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n                s->static_len));\n        /* At this point, opt_len and static_len are the total bit lengths of\n         * the compressed block data, excluding the tree representations.\n         */\n\n        /* Build the bit length tree for the above two trees, and get the index\n         * in bl_order of the last bit length code to send.\n         */\n        max_blindex = build_bl_tree(s);\n\n        /* Determine the best encoding. Compute the block lengths in bytes. */\n        opt_lenb = (s->opt_len+3+7)>>3;\n        static_lenb = (s->static_len+3+7)>>3;\n\n        Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n                opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n                s->last_lit));\n\n        if (static_lenb <= opt_lenb) opt_lenb = static_lenb;\n\n    } else {\n        Assert(buf != (char*)0, \"lost buf\");\n        opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n    }\n\n#ifdef FORCE_STORED\n    if (buf != (char*)0) { /* force stored block */\n#else\n    if (stored_len+4 <= opt_lenb && buf != (char*)0) {\n                       /* 4: two words for the lengths */\n#endif\n        /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n         * Otherwise we can't have processed more than WSIZE input bytes since\n         * the last block flush, because compression would have been\n         * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n         * transform a block into a stored block.\n         */\n        _tr_stored_block(s, buf, stored_len, last);\n\n#ifdef FORCE_STATIC\n    } else if (static_lenb >= 0) { /* force static trees */\n#else\n    } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) {\n#endif\n        send_bits(s, (STATIC_TREES<<1)+last, 3);\n        compress_block(s, (const ct_data *)static_ltree,\n                       (const ct_data *)static_dtree);\n#ifdef DEBUG\n        s->compressed_len += 3 + s->static_len;\n#endif\n    } else {\n        send_bits(s, (DYN_TREES<<1)+last, 3);\n        send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,\n                       max_blindex+1);\n        compress_block(s, (const ct_data *)s->dyn_ltree,\n                       (const ct_data *)s->dyn_dtree);\n#ifdef DEBUG\n        s->compressed_len += 3 + s->opt_len;\n#endif\n    }\n    Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n    /* The above check is made mod 2^32, for files larger than 512 MB\n     * and uLong implemented on 32 bits.\n     */\n    init_block(s);\n\n    if (last) {\n        bi_windup(s);\n#ifdef DEBUG\n        s->compressed_len += 7;  /* align on byte boundary */\n#endif\n    }\n    Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n           s->compressed_len-7*last));\n}\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nint ZLIB_INTERNAL _tr_tally (s, dist, lc)\n    deflate_state *s;\n    unsigned dist;  /* distance of matched string */\n    unsigned lc;    /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n    s->d_buf[s->last_lit] = (ush)dist;\n    s->l_buf[s->last_lit++] = (uch)lc;\n    if (dist == 0) {\n        /* lc is the unmatched char */\n        s->dyn_ltree[lc].Freq++;\n    } else {\n        s->matches++;\n        /* Here, lc is the match length - MIN_MATCH */\n        dist--;             /* dist = match distance - 1 */\n        Assert((ush)dist < (ush)MAX_DIST(s) &&\n               (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n               (ush)d_code(dist) < (ush)D_CODES,  \"_tr_tally: bad match\");\n\n        s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++;\n        s->dyn_dtree[d_code(dist)].Freq++;\n    }\n\n#ifdef TRUNCATE_BLOCK\n    /* Try to guess if it is profitable to stop the current block here */\n    if ((s->last_lit & 0x1fff) == 0 && s->level > 2) {\n        /* Compute an upper bound for the compressed length */\n        ulg out_length = (ulg)s->last_lit*8L;\n        ulg in_length = (ulg)((long)s->strstart - s->block_start);\n        int dcode;\n        for (dcode = 0; dcode < D_CODES; dcode++) {\n            out_length += (ulg)s->dyn_dtree[dcode].Freq *\n                (5L+extra_dbits[dcode]);\n        }\n        out_length >>= 3;\n        Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n               s->last_lit, in_length, out_length,\n               100L - out_length*100L/in_length));\n        if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1;\n    }\n#endif\n    return (s->last_lit == s->lit_bufsize-1);\n    /* We avoid equality with lit_bufsize because of wraparound at 64K\n     * on 16 bit machines and because stored blocks are restricted to\n     * 64K-1 bytes.\n     */\n}\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nlocal void compress_block(s, ltree, dtree)\n    deflate_state *s;\n    const ct_data *ltree; /* literal tree */\n    const ct_data *dtree; /* distance tree */\n{\n    unsigned dist;      /* distance of matched string */\n    int lc;             /* match length or unmatched char (if dist == 0) */\n    unsigned lx = 0;    /* running index in l_buf */\n    unsigned code;      /* the code to send */\n    int extra;          /* number of extra bits to send */\n\n    if (s->last_lit != 0) do {\n        dist = s->d_buf[lx];\n        lc = s->l_buf[lx++];\n        if (dist == 0) {\n            send_code(s, lc, ltree); /* send a literal byte */\n            Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n        } else {\n            /* Here, lc is the match length - MIN_MATCH */\n            code = _length_code[lc];\n            send_code(s, code+LITERALS+1, ltree); /* send the length code */\n            extra = extra_lbits[code];\n            if (extra != 0) {\n                lc -= base_length[code];\n                send_bits(s, lc, extra);       /* send the extra length bits */\n            }\n            dist--; /* dist is now the match distance - 1 */\n            code = d_code(dist);\n            Assert (code < D_CODES, \"bad d_code\");\n\n            send_code(s, code, dtree);       /* send the distance code */\n            extra = extra_dbits[code];\n            if (extra != 0) {\n                dist -= base_dist[code];\n                send_bits(s, dist, extra);   /* send the extra distance bits */\n            }\n        } /* literal or match pair ? */\n\n        /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */\n        Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,\n               \"pendingBuf overflow\");\n\n    } while (lx < s->last_lit);\n\n    send_code(s, END_BLOCK, ltree);\n}\n\n/* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n *    a) There are no non-portable control characters belonging to the\n *       \"black list\" (0..6, 14..25, 28..31).\n *    b) There is at least one printable character belonging to the\n *       \"white list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n *   \"gray list\" that is ignored in this detection algorithm:\n *   (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\nlocal int detect_data_type(s)\n    deflate_state *s;\n{\n    /* black_mask is the bit mask of black-listed bytes\n     * set bits 0..6, 14..25, and 28..31\n     * 0xf3ffc07f = binary 11110011111111111100000001111111\n     */\n    unsigned long black_mask = 0xf3ffc07fUL;\n    int n;\n\n    /* Check for non-textual (\"black-listed\") bytes. */\n    for (n = 0; n <= 31; n++, black_mask >>= 1)\n        if ((black_mask & 1) && (s->dyn_ltree[n].Freq != 0))\n            return Z_BINARY;\n\n    /* Check for textual (\"white-listed\") bytes. */\n    if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0\n            || s->dyn_ltree[13].Freq != 0)\n        return Z_TEXT;\n    for (n = 32; n < LITERALS; n++)\n        if (s->dyn_ltree[n].Freq != 0)\n            return Z_TEXT;\n\n    /* There are no \"black-listed\" or \"white-listed\" bytes:\n     * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n     */\n    return Z_BINARY;\n}\n\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\nlocal unsigned bi_reverse(code, len)\n    unsigned code; /* the value to invert */\n    int len;       /* its bit length */\n{\n    register unsigned res = 0;\n    do {\n        res |= code & 1;\n        code >>= 1, res <<= 1;\n    } while (--len > 0);\n    return res >> 1;\n}\n\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nlocal void bi_flush(s)\n    deflate_state *s;\n{\n    if (s->bi_valid == 16) {\n        put_short(s, s->bi_buf);\n        s->bi_buf = 0;\n        s->bi_valid = 0;\n    } else if (s->bi_valid >= 8) {\n        put_byte(s, (Byte)s->bi_buf);\n        s->bi_buf >>= 8;\n        s->bi_valid -= 8;\n    }\n}\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nlocal void bi_windup(s)\n    deflate_state *s;\n{\n    if (s->bi_valid > 8) {\n        put_short(s, s->bi_buf);\n    } else if (s->bi_valid > 0) {\n        put_byte(s, (Byte)s->bi_buf);\n    }\n    s->bi_buf = 0;\n    s->bi_valid = 0;\n#ifdef DEBUG\n    s->bits_sent = (s->bits_sent+7) & ~7;\n#endif\n}\n\n/* ===========================================================================\n * Copy a stored block, storing first the length and its\n * one's complement if requested.\n */\nlocal void copy_block(s, buf, len, header)\n    deflate_state *s;\n    charf    *buf;    /* the input data */\n    unsigned len;     /* its length */\n    int      header;  /* true if block header must be written */\n{\n    bi_windup(s);        /* align on byte boundary */\n\n    if (header) {\n        put_short(s, (ush)len);\n        put_short(s, (ush)~len);\n#ifdef DEBUG\n        s->bits_sent += 2*16;\n#endif\n    }\n#ifdef DEBUG\n    s->bits_sent += (ulg)len<<3;\n#endif\n    while (len--) {\n        put_byte(s, *buf++);\n    }\n}\n"
  },
  {
    "path": "ext/zlib/trees.h",
    "content": "/* header created automatically with -DGEN_TREES_H */\n\nlocal const ct_data static_ltree[L_CODES+2] = {\n{{ 12},{  8}}, {{140},{  8}}, {{ 76},{  8}}, {{204},{  8}}, {{ 44},{  8}},\n{{172},{  8}}, {{108},{  8}}, {{236},{  8}}, {{ 28},{  8}}, {{156},{  8}},\n{{ 92},{  8}}, {{220},{  8}}, {{ 60},{  8}}, {{188},{  8}}, {{124},{  8}},\n{{252},{  8}}, {{  2},{  8}}, {{130},{  8}}, {{ 66},{  8}}, {{194},{  8}},\n{{ 34},{  8}}, {{162},{  8}}, {{ 98},{  8}}, {{226},{  8}}, {{ 18},{  8}},\n{{146},{  8}}, {{ 82},{  8}}, {{210},{  8}}, {{ 50},{  8}}, {{178},{  8}},\n{{114},{  8}}, {{242},{  8}}, {{ 10},{  8}}, {{138},{  8}}, {{ 74},{  8}},\n{{202},{  8}}, {{ 42},{  8}}, {{170},{  8}}, {{106},{  8}}, {{234},{  8}},\n{{ 26},{  8}}, {{154},{  8}}, {{ 90},{  8}}, {{218},{  8}}, {{ 58},{  8}},\n{{186},{  8}}, {{122},{  8}}, {{250},{  8}}, {{  6},{  8}}, {{134},{  8}},\n{{ 70},{  8}}, {{198},{  8}}, {{ 38},{  8}}, {{166},{  8}}, {{102},{  8}},\n{{230},{  8}}, {{ 22},{  8}}, {{150},{  8}}, {{ 86},{  8}}, {{214},{  8}},\n{{ 54},{  8}}, {{182},{  8}}, {{118},{  8}}, {{246},{  8}}, {{ 14},{  8}},\n{{142},{  8}}, {{ 78},{  8}}, {{206},{  8}}, {{ 46},{  8}}, {{174},{  8}},\n{{110},{  8}}, {{238},{  8}}, {{ 30},{  8}}, {{158},{  8}}, {{ 94},{  8}},\n{{222},{  8}}, {{ 62},{  8}}, {{190},{  8}}, {{126},{  8}}, {{254},{  8}},\n{{  1},{  8}}, {{129},{  8}}, {{ 65},{  8}}, {{193},{  8}}, {{ 33},{  8}},\n{{161},{  8}}, {{ 97},{  8}}, {{225},{  8}}, {{ 17},{  8}}, {{145},{  8}},\n{{ 81},{  8}}, {{209},{  8}}, {{ 49},{  8}}, {{177},{  8}}, {{113},{  8}},\n{{241},{  8}}, {{  9},{  8}}, {{137},{  8}}, {{ 73},{  8}}, {{201},{  8}},\n{{ 41},{  8}}, {{169},{  8}}, {{105},{  8}}, {{233},{  8}}, {{ 25},{  8}},\n{{153},{  8}}, {{ 89},{  8}}, {{217},{  8}}, {{ 57},{  8}}, {{185},{  8}},\n{{121},{  8}}, {{249},{  8}}, {{  5},{  8}}, {{133},{  8}}, {{ 69},{  8}},\n{{197},{  8}}, {{ 37},{  8}}, {{165},{  8}}, {{101},{  8}}, {{229},{  8}},\n{{ 21},{  8}}, {{149},{  8}}, {{ 85},{  8}}, {{213},{  8}}, {{ 53},{  8}},\n{{181},{  8}}, {{117},{  8}}, {{245},{  8}}, {{ 13},{  8}}, {{141},{  8}},\n{{ 77},{  8}}, {{205},{  8}}, {{ 45},{  8}}, {{173},{  8}}, {{109},{  8}},\n{{237},{  8}}, {{ 29},{  8}}, {{157},{  8}}, {{ 93},{  8}}, {{221},{  8}},\n{{ 61},{  8}}, {{189},{  8}}, {{125},{  8}}, {{253},{  8}}, {{ 19},{  9}},\n{{275},{  9}}, {{147},{  9}}, {{403},{  9}}, {{ 83},{  9}}, {{339},{  9}},\n{{211},{  9}}, {{467},{  9}}, {{ 51},{  9}}, {{307},{  9}}, {{179},{  9}},\n{{435},{  9}}, {{115},{  9}}, {{371},{  9}}, {{243},{  9}}, {{499},{  9}},\n{{ 11},{  9}}, {{267},{  9}}, {{139},{  9}}, {{395},{  9}}, {{ 75},{  9}},\n{{331},{  9}}, {{203},{  9}}, {{459},{  9}}, {{ 43},{  9}}, {{299},{  9}},\n{{171},{  9}}, {{427},{  9}}, {{107},{  9}}, {{363},{  9}}, {{235},{  9}},\n{{491},{  9}}, {{ 27},{  9}}, {{283},{  9}}, {{155},{  9}}, {{411},{  9}},\n{{ 91},{  9}}, {{347},{  9}}, {{219},{  9}}, {{475},{  9}}, {{ 59},{  9}},\n{{315},{  9}}, {{187},{  9}}, {{443},{  9}}, {{123},{  9}}, {{379},{  9}},\n{{251},{  9}}, {{507},{  9}}, {{  7},{  9}}, {{263},{  9}}, {{135},{  9}},\n{{391},{  9}}, {{ 71},{  9}}, {{327},{  9}}, {{199},{  9}}, {{455},{  9}},\n{{ 39},{  9}}, {{295},{  9}}, {{167},{  9}}, {{423},{  9}}, {{103},{  9}},\n{{359},{  9}}, {{231},{  9}}, {{487},{  9}}, {{ 23},{  9}}, {{279},{  9}},\n{{151},{  9}}, {{407},{  9}}, {{ 87},{  9}}, {{343},{  9}}, {{215},{  9}},\n{{471},{  9}}, {{ 55},{  9}}, {{311},{  9}}, {{183},{  9}}, {{439},{  9}},\n{{119},{  9}}, {{375},{  9}}, {{247},{  9}}, {{503},{  9}}, {{ 15},{  9}},\n{{271},{  9}}, {{143},{  9}}, {{399},{  9}}, {{ 79},{  9}}, {{335},{  9}},\n{{207},{  9}}, {{463},{  9}}, {{ 47},{  9}}, {{303},{  9}}, {{175},{  9}},\n{{431},{  9}}, {{111},{  9}}, {{367},{  9}}, {{239},{  9}}, {{495},{  9}},\n{{ 31},{  9}}, {{287},{  9}}, {{159},{  9}}, {{415},{  9}}, {{ 95},{  9}},\n{{351},{  9}}, {{223},{  9}}, {{479},{  9}}, {{ 63},{  9}}, {{319},{  9}},\n{{191},{  9}}, {{447},{  9}}, {{127},{  9}}, {{383},{  9}}, {{255},{  9}},\n{{511},{  9}}, {{  0},{  7}}, {{ 64},{  7}}, {{ 32},{  7}}, {{ 96},{  7}},\n{{ 16},{  7}}, {{ 80},{  7}}, {{ 48},{  7}}, {{112},{  7}}, {{  8},{  7}},\n{{ 72},{  7}}, {{ 40},{  7}}, {{104},{  7}}, {{ 24},{  7}}, {{ 88},{  7}},\n{{ 56},{  7}}, {{120},{  7}}, {{  4},{  7}}, {{ 68},{  7}}, {{ 36},{  7}},\n{{100},{  7}}, {{ 20},{  7}}, {{ 84},{  7}}, {{ 52},{  7}}, {{116},{  7}},\n{{  3},{  8}}, {{131},{  8}}, {{ 67},{  8}}, {{195},{  8}}, {{ 35},{  8}},\n{{163},{  8}}, {{ 99},{  8}}, {{227},{  8}}\n};\n\nlocal const ct_data static_dtree[D_CODES] = {\n{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}},\n{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}},\n{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}},\n{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}},\n{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}},\n{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}\n};\n\nconst uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {\n 0,  1,  2,  3,  4,  4,  5,  5,  6,  6,  6,  6,  7,  7,  7,  7,  8,  8,  8,  8,\n 8,  8,  8,  8,  9,  9,  9,  9,  9,  9,  9,  9, 10, 10, 10, 10, 10, 10, 10, 10,\n10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,\n11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,\n12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13,\n13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,\n14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,\n15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,\n15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,  0,  0, 16, 17,\n18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22,\n23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,\n26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,\n26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,\n27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,\n27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,\n28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,\n28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,\n28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,\n29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,\n29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,\n29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29\n};\n\nconst uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {\n 0,  1,  2,  3,  4,  5,  6,  7,  8,  8,  9,  9, 10, 10, 11, 11, 12, 12, 12, 12,\n13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,\n17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,\n19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,\n21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22,\n22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,\n23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,\n25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26,\n26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,\n26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,\n27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28\n};\n\nlocal const int base_length[LENGTH_CODES] = {\n0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56,\n64, 80, 96, 112, 128, 160, 192, 224, 0\n};\n\nlocal const int base_dist[D_CODES] = {\n    0,     1,     2,     3,     4,     6,     8,    12,    16,    24,\n   32,    48,    64,    96,   128,   192,   256,   384,   512,   768,\n 1024,  1536,  2048,  3072,  4096,  6144,  8192, 12288, 16384, 24576\n};\n\n"
  },
  {
    "path": "ext/zlib/uncompr.c",
    "content": "/* uncompr.c -- decompress a memory buffer\n * Copyright (C) 1995-2003, 2010 Jean-loup Gailly.\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/* @(#) $Id$ */\n\n#define ZLIB_INTERNAL\n#include \"zlib.h\"\n\n/* ===========================================================================\n     Decompresses the source buffer into the destination buffer.  sourceLen is\n   the byte length of the source buffer. Upon entry, destLen is the total\n   size of the destination buffer, which must be large enough to hold the\n   entire uncompressed data. (The size of the uncompressed data must have\n   been saved previously by the compressor and transmitted to the decompressor\n   by some mechanism outside the scope of this compression library.)\n   Upon exit, destLen is the actual size of the compressed buffer.\n\n     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not\n   enough memory, Z_BUF_ERROR if there was not enough room in the output\n   buffer, or Z_DATA_ERROR if the input data was corrupted.\n*/\nint ZEXPORT uncompress (dest, destLen, source, sourceLen)\n    Bytef *dest;\n    uLongf *destLen;\n    const Bytef *source;\n    uLong sourceLen;\n{\n    z_stream stream;\n    int err;\n\n    stream.next_in = (z_const Bytef *)source;\n    stream.avail_in = (uInt)sourceLen;\n    /* Check for source > 64K on 16-bit machine: */\n    if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;\n\n    stream.next_out = dest;\n    stream.avail_out = (uInt)*destLen;\n    if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;\n\n    stream.zalloc = (alloc_func)0;\n    stream.zfree = (free_func)0;\n\n    err = inflateInit(&stream);\n    if (err != Z_OK) return err;\n\n    err = inflate(&stream, Z_FINISH);\n    if (err != Z_STREAM_END) {\n        inflateEnd(&stream);\n        if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0))\n            return Z_DATA_ERROR;\n        return err;\n    }\n    *destLen = stream.total_out;\n\n    err = inflateEnd(&stream);\n    return err;\n}\n"
  },
  {
    "path": "ext/zlib/zconf.h",
    "content": "/* zconf.h -- configuration of the zlib compression library\n * Copyright (C) 1995-2013 Jean-loup Gailly.\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/* @(#) $Id$ */\n\n#ifndef ZCONF_H\n#define ZCONF_H\n\n/*\n * If you *really* need a unique prefix for all types and library functions,\n * compile with -DZ_PREFIX. The \"standard\" zlib should be compiled without it.\n * Even better than compiling with -DZ_PREFIX would be to use configure to set\n * this permanently in zconf.h using \"./configure --zprefix\".\n */\n#ifdef Z_PREFIX     /* may be set to #if 1 by ./configure */\n#  define Z_PREFIX_SET\n\n/* all linked symbols */\n#  define _dist_code            z__dist_code\n#  define _length_code          z__length_code\n#  define _tr_align             z__tr_align\n#  define _tr_flush_bits        z__tr_flush_bits\n#  define _tr_flush_block       z__tr_flush_block\n#  define _tr_init              z__tr_init\n#  define _tr_stored_block      z__tr_stored_block\n#  define _tr_tally             z__tr_tally\n#  define adler32               z_adler32\n#  define adler32_combine       z_adler32_combine\n#  define adler32_combine64     z_adler32_combine64\n#  ifndef Z_SOLO\n#    define compress              z_compress\n#    define compress2             z_compress2\n#    define compressBound         z_compressBound\n#  endif\n#  define crc32                 z_crc32\n#  define crc32_combine         z_crc32_combine\n#  define crc32_combine64       z_crc32_combine64\n#  define deflate               z_deflate\n#  define deflateBound          z_deflateBound\n#  define deflateCopy           z_deflateCopy\n#  define deflateEnd            z_deflateEnd\n#  define deflateInit2_         z_deflateInit2_\n#  define deflateInit_          z_deflateInit_\n#  define deflateParams         z_deflateParams\n#  define deflatePending        z_deflatePending\n#  define deflatePrime          z_deflatePrime\n#  define deflateReset          z_deflateReset\n#  define deflateResetKeep      z_deflateResetKeep\n#  define deflateSetDictionary  z_deflateSetDictionary\n#  define deflateSetHeader      z_deflateSetHeader\n#  define deflateTune           z_deflateTune\n#  define deflate_copyright     z_deflate_copyright\n#  define get_crc_table         z_get_crc_table\n#  ifndef Z_SOLO\n#    define gz_error              z_gz_error\n#    define gz_intmax             z_gz_intmax\n#    define gz_strwinerror        z_gz_strwinerror\n#    define gzbuffer              z_gzbuffer\n#    define gzclearerr            z_gzclearerr\n#    define gzclose               z_gzclose\n#    define gzclose_r             z_gzclose_r\n#    define gzclose_w             z_gzclose_w\n#    define gzdirect              z_gzdirect\n#    define gzdopen               z_gzdopen\n#    define gzeof                 z_gzeof\n#    define gzerror               z_gzerror\n#    define gzflush               z_gzflush\n#    define gzgetc                z_gzgetc\n#    define gzgetc_               z_gzgetc_\n#    define gzgets                z_gzgets\n#    define gzoffset              z_gzoffset\n#    define gzoffset64            z_gzoffset64\n#    define gzopen                z_gzopen\n#    define gzopen64              z_gzopen64\n#    ifdef _WIN32\n#      define gzopen_w              z_gzopen_w\n#    endif\n#    define gzprintf              z_gzprintf\n#    define gzvprintf             z_gzvprintf\n#    define gzputc                z_gzputc\n#    define gzputs                z_gzputs\n#    define gzread                z_gzread\n#    define gzrewind              z_gzrewind\n#    define gzseek                z_gzseek\n#    define gzseek64              z_gzseek64\n#    define gzsetparams           z_gzsetparams\n#    define gztell                z_gztell\n#    define gztell64              z_gztell64\n#    define gzungetc              z_gzungetc\n#    define gzwrite               z_gzwrite\n#  endif\n#  define inflate               z_inflate\n#  define inflateBack           z_inflateBack\n#  define inflateBackEnd        z_inflateBackEnd\n#  define inflateBackInit_      z_inflateBackInit_\n#  define inflateCopy           z_inflateCopy\n#  define inflateEnd            z_inflateEnd\n#  define inflateGetHeader      z_inflateGetHeader\n#  define inflateInit2_         z_inflateInit2_\n#  define inflateInit_          z_inflateInit_\n#  define inflateMark           z_inflateMark\n#  define inflatePrime          z_inflatePrime\n#  define inflateReset          z_inflateReset\n#  define inflateReset2         z_inflateReset2\n#  define inflateSetDictionary  z_inflateSetDictionary\n#  define inflateGetDictionary  z_inflateGetDictionary\n#  define inflateSync           z_inflateSync\n#  define inflateSyncPoint      z_inflateSyncPoint\n#  define inflateUndermine      z_inflateUndermine\n#  define inflateResetKeep      z_inflateResetKeep\n#  define inflate_copyright     z_inflate_copyright\n#  define inflate_fast          z_inflate_fast\n#  define inflate_table         z_inflate_table\n#  ifndef Z_SOLO\n#    define uncompress            z_uncompress\n#  endif\n#  define zError                z_zError\n#  ifndef Z_SOLO\n#    define zcalloc               z_zcalloc\n#    define zcfree                z_zcfree\n#  endif\n#  define zlibCompileFlags      z_zlibCompileFlags\n#  define zlibVersion           z_zlibVersion\n\n/* all zlib typedefs in zlib.h and zconf.h */\n#  define Byte                  z_Byte\n#  define Bytef                 z_Bytef\n#  define alloc_func            z_alloc_func\n#  define charf                 z_charf\n#  define free_func             z_free_func\n#  ifndef Z_SOLO\n#    define gzFile                z_gzFile\n#  endif\n#  define gz_header             z_gz_header\n#  define gz_headerp            z_gz_headerp\n#  define in_func               z_in_func\n#  define intf                  z_intf\n#  define out_func              z_out_func\n#  define uInt                  z_uInt\n#  define uIntf                 z_uIntf\n#  define uLong                 z_uLong\n#  define uLongf                z_uLongf\n#  define voidp                 z_voidp\n#  define voidpc                z_voidpc\n#  define voidpf                z_voidpf\n\n/* all zlib structs in zlib.h and zconf.h */\n#  define gz_header_s           z_gz_header_s\n#  define internal_state        z_internal_state\n\n#endif\n\n#if defined(__MSDOS__) && !defined(MSDOS)\n#  define MSDOS\n#endif\n#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)\n#  define OS2\n#endif\n#if defined(_WINDOWS) && !defined(WINDOWS)\n#  define WINDOWS\n#endif\n#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)\n#  ifndef WIN32\n#    define WIN32\n#  endif\n#endif\n#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)\n#  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)\n#    ifndef SYS16BIT\n#      define SYS16BIT\n#    endif\n#  endif\n#endif\n\n/*\n * Compile with -DMAXSEG_64K if the alloc function cannot allocate more\n * than 64k bytes at a time (needed on systems with 16-bit int).\n */\n#ifdef SYS16BIT\n#  define MAXSEG_64K\n#endif\n#ifdef MSDOS\n#  define UNALIGNED_OK\n#endif\n\n#ifdef __STDC_VERSION__\n#  ifndef STDC\n#    define STDC\n#  endif\n#  if __STDC_VERSION__ >= 199901L\n#    ifndef STDC99\n#      define STDC99\n#    endif\n#  endif\n#endif\n#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))\n#  define STDC\n#endif\n#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))\n#  define STDC\n#endif\n#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))\n#  define STDC\n#endif\n#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))\n#  define STDC\n#endif\n\n#if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */\n#  define STDC\n#endif\n\n#ifndef STDC\n#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */\n#    define const       /* note: need a more gentle solution here */\n#  endif\n#endif\n\n#if defined(ZLIB_CONST) && !defined(z_const)\n#  define z_const const\n#else\n#  define z_const\n#endif\n\n/* Some Mac compilers merge all .h files incorrectly: */\n#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)\n#  define NO_DUMMY_DECL\n#endif\n\n/* Maximum value for memLevel in deflateInit2 */\n#ifndef MAX_MEM_LEVEL\n#  ifdef MAXSEG_64K\n#    define MAX_MEM_LEVEL 8\n#  else\n#    define MAX_MEM_LEVEL 9\n#  endif\n#endif\n\n/* Maximum value for windowBits in deflateInit2 and inflateInit2.\n * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files\n * created by gzip. (Files created by minigzip can still be extracted by\n * gzip.)\n */\n#ifndef MAX_WBITS\n#  define MAX_WBITS   15 /* 32K LZ77 window */\n#endif\n\n/* The memory requirements for deflate are (in bytes):\n            (1 << (windowBits+2)) +  (1 << (memLevel+9))\n that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)\n plus a few kilobytes for small objects. For example, if you want to reduce\n the default memory requirements from 256K to 128K, compile with\n     make CFLAGS=\"-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7\"\n Of course this will generally degrade compression (there's no free lunch).\n\n   The memory requirements for inflate are (in bytes) 1 << windowBits\n that is, 32K for windowBits=15 (default value) plus a few kilobytes\n for small objects.\n*/\n\n                        /* Type declarations */\n\n#ifndef OF /* function prototypes */\n#  ifdef STDC\n#    define OF(args)  args\n#  else\n#    define OF(args)  ()\n#  endif\n#endif\n\n#ifndef Z_ARG /* function prototypes for stdarg */\n#  if defined(STDC) || defined(Z_HAVE_STDARG_H)\n#    define Z_ARG(args)  args\n#  else\n#    define Z_ARG(args)  ()\n#  endif\n#endif\n\n/* The following definitions for FAR are needed only for MSDOS mixed\n * model programming (small or medium model with some far allocations).\n * This was tested only with MSC; for other MSDOS compilers you may have\n * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,\n * just define FAR to be empty.\n */\n#ifdef SYS16BIT\n#  if defined(M_I86SM) || defined(M_I86MM)\n     /* MSC small or medium model */\n#    define SMALL_MEDIUM\n#    ifdef _MSC_VER\n#      define FAR _far\n#    else\n#      define FAR far\n#    endif\n#  endif\n#  if (defined(__SMALL__) || defined(__MEDIUM__))\n     /* Turbo C small or medium model */\n#    define SMALL_MEDIUM\n#    ifdef __BORLANDC__\n#      define FAR _far\n#    else\n#      define FAR far\n#    endif\n#  endif\n#endif\n\n#if defined(WINDOWS) || defined(WIN32)\n   /* If building or using zlib as a DLL, define ZLIB_DLL.\n    * This is not mandatory, but it offers a little performance increase.\n    */\n#  ifdef ZLIB_DLL\n#    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))\n#      ifdef ZLIB_INTERNAL\n#        define ZEXTERN extern __declspec(dllexport)\n#      else\n#        define ZEXTERN extern __declspec(dllimport)\n#      endif\n#    endif\n#  endif  /* ZLIB_DLL */\n   /* If building or using zlib with the WINAPI/WINAPIV calling convention,\n    * define ZLIB_WINAPI.\n    * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.\n    */\n#  ifdef ZLIB_WINAPI\n#    ifdef FAR\n#      undef FAR\n#    endif\n#    include <windows.h>\n     /* No need for _export, use ZLIB.DEF instead. */\n     /* For complete Windows compatibility, use WINAPI, not __stdcall. */\n#    define ZEXPORT WINAPI\n#    ifdef WIN32\n#      define ZEXPORTVA WINAPIV\n#    else\n#      define ZEXPORTVA FAR CDECL\n#    endif\n#  endif\n#endif\n\n#if defined (__BEOS__)\n#  ifdef ZLIB_DLL\n#    ifdef ZLIB_INTERNAL\n#      define ZEXPORT   __declspec(dllexport)\n#      define ZEXPORTVA __declspec(dllexport)\n#    else\n#      define ZEXPORT   __declspec(dllimport)\n#      define ZEXPORTVA __declspec(dllimport)\n#    endif\n#  endif\n#endif\n\n#ifndef ZEXTERN\n#  define ZEXTERN extern\n#endif\n#ifndef ZEXPORT\n#  define ZEXPORT\n#endif\n#ifndef ZEXPORTVA\n#  define ZEXPORTVA\n#endif\n\n#ifndef FAR\n#  define FAR\n#endif\n\n#if !defined(__MACTYPES__)\ntypedef unsigned char  Byte;  /* 8 bits */\n#endif\ntypedef unsigned int   uInt;  /* 16 bits or more */\ntypedef unsigned long  uLong; /* 32 bits or more */\n\n#ifdef SMALL_MEDIUM\n   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */\n#  define Bytef Byte FAR\n#else\n   typedef Byte  FAR Bytef;\n#endif\ntypedef char  FAR charf;\ntypedef int   FAR intf;\ntypedef uInt  FAR uIntf;\ntypedef uLong FAR uLongf;\n\n#ifdef STDC\n   typedef void const *voidpc;\n   typedef void FAR   *voidpf;\n   typedef void       *voidp;\n#else\n   typedef Byte const *voidpc;\n   typedef Byte FAR   *voidpf;\n   typedef Byte       *voidp;\n#endif\n\n#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)\n#  include <limits.h>\n#  if (UINT_MAX == 0xffffffffUL)\n#    define Z_U4 unsigned\n#  elif (ULONG_MAX == 0xffffffffUL)\n#    define Z_U4 unsigned long\n#  elif (USHRT_MAX == 0xffffffffUL)\n#    define Z_U4 unsigned short\n#  endif\n#endif\n\n#ifdef Z_U4\n   typedef Z_U4 z_crc_t;\n#else\n   typedef unsigned long z_crc_t;\n#endif\n\n#ifdef HAVE_UNISTD_H    /* may be set to #if 1 by ./configure */\n#  define Z_HAVE_UNISTD_H\n#endif\n\n#ifdef HAVE_STDARG_H    /* may be set to #if 1 by ./configure */\n#  define Z_HAVE_STDARG_H\n#endif\n\n#ifdef STDC\n#  ifndef Z_SOLO\n#    include <sys/types.h>      /* for off_t */\n#  endif\n#endif\n\n#if defined(STDC) || defined(Z_HAVE_STDARG_H)\n#  ifndef Z_SOLO\n#    include <stdarg.h>         /* for va_list */\n#  endif\n#endif\n\n#ifdef _WIN32\n#  ifndef Z_SOLO\n#    include <stddef.h>         /* for wchar_t */\n#  endif\n#endif\n\n/* a little trick to accommodate both \"#define _LARGEFILE64_SOURCE\" and\n * \"#define _LARGEFILE64_SOURCE 1\" as requesting 64-bit operations, (even\n * though the former does not conform to the LFS document), but considering\n * both \"#undef _LARGEFILE64_SOURCE\" and \"#define _LARGEFILE64_SOURCE 0\" as\n * equivalently requesting no 64-bit operations\n */\n#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1\n#  undef _LARGEFILE64_SOURCE\n#endif\n\n#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)\n#  define Z_HAVE_UNISTD_H\n#endif\n#ifndef Z_SOLO\n#  if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)\n#    include <unistd.h>         /* for SEEK_*, off_t, and _LFS64_LARGEFILE */\n#    ifdef VMS\n#      include <unixio.h>       /* for off_t */\n#    endif\n#    ifndef z_off_t\n#      define z_off_t off_t\n#    endif\n#  endif\n#endif\n\n#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0\n#  define Z_LFS64\n#endif\n\n#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)\n#  define Z_LARGE64\n#endif\n\n#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)\n#  define Z_WANT64\n#endif\n\n#if !defined(SEEK_SET) && !defined(Z_SOLO)\n#  define SEEK_SET        0       /* Seek from beginning of file.  */\n#  define SEEK_CUR        1       /* Seek from current position.  */\n#  define SEEK_END        2       /* Set file pointer to EOF plus \"offset\" */\n#endif\n\n#ifndef z_off_t\n#  define z_off_t long\n#endif\n\n#if !defined(_WIN32) && defined(Z_LARGE64)\n#  define z_off64_t off64_t\n#else\n#  if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)\n#    define z_off64_t __int64\n#  else\n#    define z_off64_t z_off_t\n#  endif\n#endif\n\n/* MVS linker does not support external names larger than 8 bytes */\n#if defined(__MVS__)\n  #pragma map(deflateInit_,\"DEIN\")\n  #pragma map(deflateInit2_,\"DEIN2\")\n  #pragma map(deflateEnd,\"DEEND\")\n  #pragma map(deflateBound,\"DEBND\")\n  #pragma map(inflateInit_,\"ININ\")\n  #pragma map(inflateInit2_,\"ININ2\")\n  #pragma map(inflateEnd,\"INEND\")\n  #pragma map(inflateSync,\"INSY\")\n  #pragma map(inflateSetDictionary,\"INSEDI\")\n  #pragma map(compressBound,\"CMBND\")\n  #pragma map(inflate_table,\"INTABL\")\n  #pragma map(inflate_fast,\"INFA\")\n  #pragma map(inflate_copyright,\"INCOPY\")\n#endif\n\n#endif /* ZCONF_H */\n"
  },
  {
    "path": "ext/zlib/zlib.h",
    "content": "/* zlib.h -- interface of the 'zlib' general purpose compression library\n  version 1.2.8, April 28th, 2013\n\n  Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler\n\n  This software is provided 'as-is', without any express or implied\n  warranty.  In no event will the authors be held liable for any damages\n  arising from the use of this software.\n\n  Permission is granted to anyone to use this software for any purpose,\n  including commercial applications, and to alter it and redistribute it\n  freely, subject to the following restrictions:\n\n  1. The origin of this software must not be misrepresented; you must not\n     claim that you wrote the original software. If you use this software\n     in a product, an acknowledgment in the product documentation would be\n     appreciated but is not required.\n  2. Altered source versions must be plainly marked as such, and must not be\n     misrepresented as being the original software.\n  3. This notice may not be removed or altered from any source distribution.\n\n  Jean-loup Gailly        Mark Adler\n  jloup@gzip.org          madler@alumni.caltech.edu\n\n\n  The data format used by the zlib library is described by RFCs (Request for\n  Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950\n  (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).\n*/\n\n#ifndef ZLIB_H\n#define ZLIB_H\n\n#include \"zconf.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#define ZLIB_VERSION \"1.2.8\"\n#define ZLIB_VERNUM 0x1280\n#define ZLIB_VER_MAJOR 1\n#define ZLIB_VER_MINOR 2\n#define ZLIB_VER_REVISION 8\n#define ZLIB_VER_SUBREVISION 0\n\n/*\n    The 'zlib' compression library provides in-memory compression and\n  decompression functions, including integrity checks of the uncompressed data.\n  This version of the library supports only one compression method (deflation)\n  but other algorithms will be added later and will have the same stream\n  interface.\n\n    Compression can be done in a single step if the buffers are large enough,\n  or can be done by repeated calls of the compression function.  In the latter\n  case, the application must provide more input and/or consume the output\n  (providing more output space) before each call.\n\n    The compressed data format used by default by the in-memory functions is\n  the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped\n  around a deflate stream, which is itself documented in RFC 1951.\n\n    The library also supports reading and writing files in gzip (.gz) format\n  with an interface similar to that of stdio using the functions that start\n  with \"gz\".  The gzip format is different from the zlib format.  gzip is a\n  gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.\n\n    This library can optionally read and write gzip streams in memory as well.\n\n    The zlib format was designed to be compact and fast for use in memory\n  and on communications channels.  The gzip format was designed for single-\n  file compression on file systems, has a larger header than zlib to maintain\n  directory information, and uses a different, slower check method than zlib.\n\n    The library does not install any signal handler.  The decoder checks\n  the consistency of the compressed data, so the library should never crash\n  even in case of corrupted input.\n*/\n\ntypedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));\ntypedef void   (*free_func)  OF((voidpf opaque, voidpf address));\n\nstruct internal_state;\n\ntypedef struct z_stream_s {\n    z_const Bytef *next_in;     /* next input byte */\n    uInt     avail_in;  /* number of bytes available at next_in */\n    uLong    total_in;  /* total number of input bytes read so far */\n\n    Bytef    *next_out; /* next output byte should be put there */\n    uInt     avail_out; /* remaining free space at next_out */\n    uLong    total_out; /* total number of bytes output so far */\n\n    z_const char *msg;  /* last error message, NULL if no error */\n    struct internal_state FAR *state; /* not visible by applications */\n\n    alloc_func zalloc;  /* used to allocate the internal state */\n    free_func  zfree;   /* used to free the internal state */\n    voidpf     opaque;  /* private data object passed to zalloc and zfree */\n\n    int     data_type;  /* best guess about the data type: binary or text */\n    uLong   adler;      /* adler32 value of the uncompressed data */\n    uLong   reserved;   /* reserved for future use */\n} z_stream;\n\ntypedef z_stream FAR *z_streamp;\n\n/*\n     gzip header information passed to and from zlib routines.  See RFC 1952\n  for more details on the meanings of these fields.\n*/\ntypedef struct gz_header_s {\n    int     text;       /* true if compressed data believed to be text */\n    uLong   time;       /* modification time */\n    int     xflags;     /* extra flags (not used when writing a gzip file) */\n    int     os;         /* operating system */\n    Bytef   *extra;     /* pointer to extra field or Z_NULL if none */\n    uInt    extra_len;  /* extra field length (valid if extra != Z_NULL) */\n    uInt    extra_max;  /* space at extra (only when reading header) */\n    Bytef   *name;      /* pointer to zero-terminated file name or Z_NULL */\n    uInt    name_max;   /* space at name (only when reading header) */\n    Bytef   *comment;   /* pointer to zero-terminated comment or Z_NULL */\n    uInt    comm_max;   /* space at comment (only when reading header) */\n    int     hcrc;       /* true if there was or will be a header crc */\n    int     done;       /* true when done reading gzip header (not used\n                           when writing a gzip file) */\n} gz_header;\n\ntypedef gz_header FAR *gz_headerp;\n\n/*\n     The application must update next_in and avail_in when avail_in has dropped\n   to zero.  It must update next_out and avail_out when avail_out has dropped\n   to zero.  The application must initialize zalloc, zfree and opaque before\n   calling the init function.  All other fields are set by the compression\n   library and must not be updated by the application.\n\n     The opaque value provided by the application will be passed as the first\n   parameter for calls of zalloc and zfree.  This can be useful for custom\n   memory management.  The compression library attaches no meaning to the\n   opaque value.\n\n     zalloc must return Z_NULL if there is not enough memory for the object.\n   If zlib is used in a multi-threaded application, zalloc and zfree must be\n   thread safe.\n\n     On 16-bit systems, the functions zalloc and zfree must be able to allocate\n   exactly 65536 bytes, but will not be required to allocate more than this if\n   the symbol MAXSEG_64K is defined (see zconf.h).  WARNING: On MSDOS, pointers\n   returned by zalloc for objects of exactly 65536 bytes *must* have their\n   offset normalized to zero.  The default allocation function provided by this\n   library ensures this (see zutil.c).  To reduce memory requirements and avoid\n   any allocation of 64K objects, at the expense of compression ratio, compile\n   the library with -DMAX_WBITS=14 (see zconf.h).\n\n     The fields total_in and total_out can be used for statistics or progress\n   reports.  After compression, total_in holds the total size of the\n   uncompressed data and may be saved for use in the decompressor (particularly\n   if the decompressor wants to decompress everything in a single step).\n*/\n\n                        /* constants */\n\n#define Z_NO_FLUSH      0\n#define Z_PARTIAL_FLUSH 1\n#define Z_SYNC_FLUSH    2\n#define Z_FULL_FLUSH    3\n#define Z_FINISH        4\n#define Z_BLOCK         5\n#define Z_TREES         6\n/* Allowed flush values; see deflate() and inflate() below for details */\n\n#define Z_OK            0\n#define Z_STREAM_END    1\n#define Z_NEED_DICT     2\n#define Z_ERRNO        (-1)\n#define Z_STREAM_ERROR (-2)\n#define Z_DATA_ERROR   (-3)\n#define Z_MEM_ERROR    (-4)\n#define Z_BUF_ERROR    (-5)\n#define Z_VERSION_ERROR (-6)\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n\n#define Z_NO_COMPRESSION         0\n#define Z_BEST_SPEED             1\n#define Z_BEST_COMPRESSION       9\n#define Z_DEFAULT_COMPRESSION  (-1)\n/* compression levels */\n\n#define Z_FILTERED            1\n#define Z_HUFFMAN_ONLY        2\n#define Z_RLE                 3\n#define Z_FIXED               4\n#define Z_DEFAULT_STRATEGY    0\n/* compression strategy; see deflateInit2() below for details */\n\n#define Z_BINARY   0\n#define Z_TEXT     1\n#define Z_ASCII    Z_TEXT   /* for compatibility with 1.2.2 and earlier */\n#define Z_UNKNOWN  2\n/* Possible values of the data_type field (though see inflate()) */\n\n#define Z_DEFLATED   8\n/* The deflate compression method (the only one supported in this version) */\n\n#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */\n\n#define zlib_version zlibVersion()\n/* for compatibility with versions < 1.0.2 */\n\n\n                        /* basic functions */\n\nZEXTERN const char * ZEXPORT zlibVersion OF((void));\n/* The application can compare zlibVersion and ZLIB_VERSION for consistency.\n   If the first character differs, the library code actually used is not\n   compatible with the zlib.h header file used by the application.  This check\n   is automatically made by deflateInit and inflateInit.\n */\n\n/*\nZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));\n\n     Initializes the internal stream state for compression.  The fields\n   zalloc, zfree and opaque must be initialized before by the caller.  If\n   zalloc and zfree are set to Z_NULL, deflateInit updates them to use default\n   allocation functions.\n\n     The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:\n   1 gives best speed, 9 gives best compression, 0 gives no compression at all\n   (the input data is simply copied a block at a time).  Z_DEFAULT_COMPRESSION\n   requests a default compromise between speed and compression (currently\n   equivalent to level 6).\n\n     deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough\n   memory, Z_STREAM_ERROR if level is not a valid compression level, or\n   Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible\n   with the version assumed by the caller (ZLIB_VERSION).  msg is set to null\n   if there is no error message.  deflateInit does not perform any compression:\n   this will be done by deflate().\n*/\n\n\nZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));\n/*\n    deflate compresses as much data as possible, and stops when the input\n  buffer becomes empty or the output buffer becomes full.  It may introduce\n  some output latency (reading input without producing any output) except when\n  forced to flush.\n\n    The detailed semantics are as follows.  deflate performs one or both of the\n  following actions:\n\n  - Compress more input starting at next_in and update next_in and avail_in\n    accordingly.  If not all input can be processed (because there is not\n    enough room in the output buffer), next_in and avail_in are updated and\n    processing will resume at this point for the next call of deflate().\n\n  - Provide more output starting at next_out and update next_out and avail_out\n    accordingly.  This action is forced if the parameter flush is non zero.\n    Forcing flush frequently degrades the compression ratio, so this parameter\n    should be set only when necessary (in interactive applications).  Some\n    output may be provided even if flush is not set.\n\n    Before the call of deflate(), the application should ensure that at least\n  one of the actions is possible, by providing more input and/or consuming more\n  output, and updating avail_in or avail_out accordingly; avail_out should\n  never be zero before the call.  The application can consume the compressed\n  output when it wants, for example when the output buffer is full (avail_out\n  == 0), or after each call of deflate().  If deflate returns Z_OK and with\n  zero avail_out, it must be called again after making room in the output\n  buffer because there might be more output pending.\n\n    Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to\n  decide how much data to accumulate before producing output, in order to\n  maximize compression.\n\n    If the parameter flush is set to Z_SYNC_FLUSH, all pending output is\n  flushed to the output buffer and the output is aligned on a byte boundary, so\n  that the decompressor can get all input data available so far.  (In\n  particular avail_in is zero after the call if enough output space has been\n  provided before the call.) Flushing may degrade compression for some\n  compression algorithms and so it should be used only when necessary.  This\n  completes the current deflate block and follows it with an empty stored block\n  that is three bits plus filler bits to the next byte, followed by four bytes\n  (00 00 ff ff).\n\n    If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the\n  output buffer, but the output is not aligned to a byte boundary.  All of the\n  input data so far will be available to the decompressor, as for Z_SYNC_FLUSH.\n  This completes the current deflate block and follows it with an empty fixed\n  codes block that is 10 bits long.  This assures that enough bytes are output\n  in order for the decompressor to finish the block before the empty fixed code\n  block.\n\n    If flush is set to Z_BLOCK, a deflate block is completed and emitted, as\n  for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to\n  seven bits of the current block are held to be written as the next byte after\n  the next deflate block is completed.  In this case, the decompressor may not\n  be provided enough bits at this point in order to complete decompression of\n  the data provided so far to the compressor.  It may need to wait for the next\n  block to be emitted.  This is for advanced applications that need to control\n  the emission of deflate blocks.\n\n    If flush is set to Z_FULL_FLUSH, all output is flushed as with\n  Z_SYNC_FLUSH, and the compression state is reset so that decompression can\n  restart from this point if previous compressed data has been damaged or if\n  random access is desired.  Using Z_FULL_FLUSH too often can seriously degrade\n  compression.\n\n    If deflate returns with avail_out == 0, this function must be called again\n  with the same value of the flush parameter and more output space (updated\n  avail_out), until the flush is complete (deflate returns with non-zero\n  avail_out).  In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that\n  avail_out is greater than six to avoid repeated flush markers due to\n  avail_out == 0 on return.\n\n    If the parameter flush is set to Z_FINISH, pending input is processed,\n  pending output is flushed and deflate returns with Z_STREAM_END if there was\n  enough output space; if deflate returns with Z_OK, this function must be\n  called again with Z_FINISH and more output space (updated avail_out) but no\n  more input data, until it returns with Z_STREAM_END or an error.  After\n  deflate has returned Z_STREAM_END, the only possible operations on the stream\n  are deflateReset or deflateEnd.\n\n    Z_FINISH can be used immediately after deflateInit if all the compression\n  is to be done in a single step.  In this case, avail_out must be at least the\n  value returned by deflateBound (see below).  Then deflate is guaranteed to\n  return Z_STREAM_END.  If not enough output space is provided, deflate will\n  not return Z_STREAM_END, and it must be called again as described above.\n\n    deflate() sets strm->adler to the adler32 checksum of all input read\n  so far (that is, total_in bytes).\n\n    deflate() may update strm->data_type if it can make a good guess about\n  the input data type (Z_BINARY or Z_TEXT).  In doubt, the data is considered\n  binary.  This field is only for information purposes and does not affect the\n  compression algorithm in any manner.\n\n    deflate() returns Z_OK if some progress has been made (more input\n  processed or more output produced), Z_STREAM_END if all input has been\n  consumed and all output has been produced (only when flush is set to\n  Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example\n  if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible\n  (for example avail_in or avail_out was zero).  Note that Z_BUF_ERROR is not\n  fatal, and deflate() can be called again with more input and more output\n  space to continue compressing.\n*/\n\n\nZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));\n/*\n     All dynamically allocated data structures for this stream are freed.\n   This function discards any unprocessed input and does not flush any pending\n   output.\n\n     deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the\n   stream state was inconsistent, Z_DATA_ERROR if the stream was freed\n   prematurely (some input or output was discarded).  In the error case, msg\n   may be set but then points to a static string (which must not be\n   deallocated).\n*/\n\n\n/*\nZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));\n\n     Initializes the internal stream state for decompression.  The fields\n   next_in, avail_in, zalloc, zfree and opaque must be initialized before by\n   the caller.  If next_in is not Z_NULL and avail_in is large enough (the\n   exact value depends on the compression method), inflateInit determines the\n   compression method from the zlib header and allocates all data structures\n   accordingly; otherwise the allocation will be deferred to the first call of\n   inflate.  If zalloc and zfree are set to Z_NULL, inflateInit updates them to\n   use default allocation functions.\n\n     inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough\n   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the\n   version assumed by the caller, or Z_STREAM_ERROR if the parameters are\n   invalid, such as a null pointer to the structure.  msg is set to null if\n   there is no error message.  inflateInit does not perform any decompression\n   apart from possibly reading the zlib header if present: actual decompression\n   will be done by inflate().  (So next_in and avail_in may be modified, but\n   next_out and avail_out are unused and unchanged.) The current implementation\n   of inflateInit() does not process any header information -- that is deferred\n   until inflate() is called.\n*/\n\n\nZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));\n/*\n    inflate decompresses as much data as possible, and stops when the input\n  buffer becomes empty or the output buffer becomes full.  It may introduce\n  some output latency (reading input without producing any output) except when\n  forced to flush.\n\n  The detailed semantics are as follows.  inflate performs one or both of the\n  following actions:\n\n  - Decompress more input starting at next_in and update next_in and avail_in\n    accordingly.  If not all input can be processed (because there is not\n    enough room in the output buffer), next_in is updated and processing will\n    resume at this point for the next call of inflate().\n\n  - Provide more output starting at next_out and update next_out and avail_out\n    accordingly.  inflate() provides as much output as possible, until there is\n    no more input data or no more space in the output buffer (see below about\n    the flush parameter).\n\n    Before the call of inflate(), the application should ensure that at least\n  one of the actions is possible, by providing more input and/or consuming more\n  output, and updating the next_* and avail_* values accordingly.  The\n  application can consume the uncompressed output when it wants, for example\n  when the output buffer is full (avail_out == 0), or after each call of\n  inflate().  If inflate returns Z_OK and with zero avail_out, it must be\n  called again after making room in the output buffer because there might be\n  more output pending.\n\n    The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH,\n  Z_BLOCK, or Z_TREES.  Z_SYNC_FLUSH requests that inflate() flush as much\n  output as possible to the output buffer.  Z_BLOCK requests that inflate()\n  stop if and when it gets to the next deflate block boundary.  When decoding\n  the zlib or gzip format, this will cause inflate() to return immediately\n  after the header and before the first block.  When doing a raw inflate,\n  inflate() will go ahead and process the first block, and will return when it\n  gets to the end of that block, or when it runs out of data.\n\n    The Z_BLOCK option assists in appending to or combining deflate streams.\n  Also to assist in this, on return inflate() will set strm->data_type to the\n  number of unused bits in the last byte taken from strm->next_in, plus 64 if\n  inflate() is currently decoding the last block in the deflate stream, plus\n  128 if inflate() returned immediately after decoding an end-of-block code or\n  decoding the complete header up to just before the first byte of the deflate\n  stream.  The end-of-block will not be indicated until all of the uncompressed\n  data from that block has been written to strm->next_out.  The number of\n  unused bits may in general be greater than seven, except when bit 7 of\n  data_type is set, in which case the number of unused bits will be less than\n  eight.  data_type is set as noted here every time inflate() returns for all\n  flush options, and so can be used to determine the amount of currently\n  consumed input in bits.\n\n    The Z_TREES option behaves as Z_BLOCK does, but it also returns when the\n  end of each deflate block header is reached, before any actual data in that\n  block is decoded.  This allows the caller to determine the length of the\n  deflate block header for later use in random access within a deflate block.\n  256 is added to the value of strm->data_type when inflate() returns\n  immediately after reaching the end of the deflate block header.\n\n    inflate() should normally be called until it returns Z_STREAM_END or an\n  error.  However if all decompression is to be performed in a single step (a\n  single call of inflate), the parameter flush should be set to Z_FINISH.  In\n  this case all pending input is processed and all pending output is flushed;\n  avail_out must be large enough to hold all of the uncompressed data for the\n  operation to complete.  (The size of the uncompressed data may have been\n  saved by the compressor for this purpose.) The use of Z_FINISH is not\n  required to perform an inflation in one step.  However it may be used to\n  inform inflate that a faster approach can be used for the single inflate()\n  call.  Z_FINISH also informs inflate to not maintain a sliding window if the\n  stream completes, which reduces inflate's memory footprint.  If the stream\n  does not complete, either because not all of the stream is provided or not\n  enough output space is provided, then a sliding window will be allocated and\n  inflate() can be called again to continue the operation as if Z_NO_FLUSH had\n  been used.\n\n     In this implementation, inflate() always flushes as much output as\n  possible to the output buffer, and always uses the faster approach on the\n  first call.  So the effects of the flush parameter in this implementation are\n  on the return value of inflate() as noted below, when inflate() returns early\n  when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of\n  memory for a sliding window when Z_FINISH is used.\n\n     If a preset dictionary is needed after this call (see inflateSetDictionary\n  below), inflate sets strm->adler to the Adler-32 checksum of the dictionary\n  chosen by the compressor and returns Z_NEED_DICT; otherwise it sets\n  strm->adler to the Adler-32 checksum of all output produced so far (that is,\n  total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described\n  below.  At the end of the stream, inflate() checks that its computed adler32\n  checksum is equal to that saved by the compressor and returns Z_STREAM_END\n  only if the checksum is correct.\n\n    inflate() can decompress and check either zlib-wrapped or gzip-wrapped\n  deflate data.  The header type is detected automatically, if requested when\n  initializing with inflateInit2().  Any information contained in the gzip\n  header is not retained, so applications that need that information should\n  instead use raw inflate, see inflateInit2() below, or inflateBack() and\n  perform their own processing of the gzip header and trailer.  When processing\n  gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output\n  producted so far.  The CRC-32 is checked against the gzip trailer.\n\n    inflate() returns Z_OK if some progress has been made (more input processed\n  or more output produced), Z_STREAM_END if the end of the compressed data has\n  been reached and all uncompressed output has been produced, Z_NEED_DICT if a\n  preset dictionary is needed at this point, Z_DATA_ERROR if the input data was\n  corrupted (input stream not conforming to the zlib format or incorrect check\n  value), Z_STREAM_ERROR if the stream structure was inconsistent (for example\n  next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory,\n  Z_BUF_ERROR if no progress is possible or if there was not enough room in the\n  output buffer when Z_FINISH is used.  Note that Z_BUF_ERROR is not fatal, and\n  inflate() can be called again with more input and more output space to\n  continue decompressing.  If Z_DATA_ERROR is returned, the application may\n  then call inflateSync() to look for a good compression block if a partial\n  recovery of the data is desired.\n*/\n\n\nZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));\n/*\n     All dynamically allocated data structures for this stream are freed.\n   This function discards any unprocessed input and does not flush any pending\n   output.\n\n     inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state\n   was inconsistent.  In the error case, msg may be set but then points to a\n   static string (which must not be deallocated).\n*/\n\n\n                        /* Advanced functions */\n\n/*\n    The following functions are needed only in some special applications.\n*/\n\n/*\nZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,\n                                     int  level,\n                                     int  method,\n                                     int  windowBits,\n                                     int  memLevel,\n                                     int  strategy));\n\n     This is another version of deflateInit with more compression options.  The\n   fields next_in, zalloc, zfree and opaque must be initialized before by the\n   caller.\n\n     The method parameter is the compression method.  It must be Z_DEFLATED in\n   this version of the library.\n\n     The windowBits parameter is the base two logarithm of the window size\n   (the size of the history buffer).  It should be in the range 8..15 for this\n   version of the library.  Larger values of this parameter result in better\n   compression at the expense of memory usage.  The default value is 15 if\n   deflateInit is used instead.\n\n     windowBits can also be -8..-15 for raw deflate.  In this case, -windowBits\n   determines the window size.  deflate() will then generate raw deflate data\n   with no zlib header or trailer, and will not compute an adler32 check value.\n\n     windowBits can also be greater than 15 for optional gzip encoding.  Add\n   16 to windowBits to write a simple gzip header and trailer around the\n   compressed data instead of a zlib wrapper.  The gzip header will have no\n   file name, no extra data, no comment, no modification time (set to zero), no\n   header crc, and the operating system will be set to 255 (unknown).  If a\n   gzip stream is being written, strm->adler is a crc32 instead of an adler32.\n\n     The memLevel parameter specifies how much memory should be allocated\n   for the internal compression state.  memLevel=1 uses minimum memory but is\n   slow and reduces compression ratio; memLevel=9 uses maximum memory for\n   optimal speed.  The default value is 8.  See zconf.h for total memory usage\n   as a function of windowBits and memLevel.\n\n     The strategy parameter is used to tune the compression algorithm.  Use the\n   value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a\n   filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no\n   string match), or Z_RLE to limit match distances to one (run-length\n   encoding).  Filtered data consists mostly of small values with a somewhat\n   random distribution.  In this case, the compression algorithm is tuned to\n   compress them better.  The effect of Z_FILTERED is to force more Huffman\n   coding and less string matching; it is somewhat intermediate between\n   Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY.  Z_RLE is designed to be almost as\n   fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data.  The\n   strategy parameter only affects the compression ratio but not the\n   correctness of the compressed output even if it is not set appropriately.\n   Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler\n   decoder for special applications.\n\n     deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough\n   memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid\n   method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is\n   incompatible with the version assumed by the caller (ZLIB_VERSION).  msg is\n   set to null if there is no error message.  deflateInit2 does not perform any\n   compression: this will be done by deflate().\n*/\n\nZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,\n                                             const Bytef *dictionary,\n                                             uInt  dictLength));\n/*\n     Initializes the compression dictionary from the given byte sequence\n   without producing any compressed output.  When using the zlib format, this\n   function must be called immediately after deflateInit, deflateInit2 or\n   deflateReset, and before any call of deflate.  When doing raw deflate, this\n   function must be called either before any call of deflate, or immediately\n   after the completion of a deflate block, i.e. after all input has been\n   consumed and all output has been delivered when using any of the flush\n   options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH.  The\n   compressor and decompressor must use exactly the same dictionary (see\n   inflateSetDictionary).\n\n     The dictionary should consist of strings (byte sequences) that are likely\n   to be encountered later in the data to be compressed, with the most commonly\n   used strings preferably put towards the end of the dictionary.  Using a\n   dictionary is most useful when the data to be compressed is short and can be\n   predicted with good accuracy; the data can then be compressed better than\n   with the default empty dictionary.\n\n     Depending on the size of the compression data structures selected by\n   deflateInit or deflateInit2, a part of the dictionary may in effect be\n   discarded, for example if the dictionary is larger than the window size\n   provided in deflateInit or deflateInit2.  Thus the strings most likely to be\n   useful should be put at the end of the dictionary, not at the front.  In\n   addition, the current implementation of deflate will use at most the window\n   size minus 262 bytes of the provided dictionary.\n\n     Upon return of this function, strm->adler is set to the adler32 value\n   of the dictionary; the decompressor may later use this value to determine\n   which dictionary has been used by the compressor.  (The adler32 value\n   applies to the whole dictionary even if only a subset of the dictionary is\n   actually used by the compressor.) If a raw deflate was requested, then the\n   adler32 value is not computed and strm->adler is not set.\n\n     deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a\n   parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is\n   inconsistent (for example if deflate has already been called for this stream\n   or if not at a block boundary for raw deflate).  deflateSetDictionary does\n   not perform any compression: this will be done by deflate().\n*/\n\nZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,\n                                    z_streamp source));\n/*\n     Sets the destination stream as a complete copy of the source stream.\n\n     This function can be useful when several compression strategies will be\n   tried, for example when there are several ways of pre-processing the input\n   data with a filter.  The streams that will be discarded should then be freed\n   by calling deflateEnd.  Note that deflateCopy duplicates the internal\n   compression state which can be quite large, so this strategy is slow and can\n   consume lots of memory.\n\n     deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not\n   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent\n   (such as zalloc being Z_NULL).  msg is left unchanged in both source and\n   destination.\n*/\n\nZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));\n/*\n     This function is equivalent to deflateEnd followed by deflateInit,\n   but does not free and reallocate all the internal compression state.  The\n   stream will keep the same compression level and any other attributes that\n   may have been set by deflateInit2.\n\n     deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent (such as zalloc or state being Z_NULL).\n*/\n\nZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,\n                                      int level,\n                                      int strategy));\n/*\n     Dynamically update the compression level and compression strategy.  The\n   interpretation of level and strategy is as in deflateInit2.  This can be\n   used to switch between compression and straight copy of the input data, or\n   to switch to a different kind of input data requiring a different strategy.\n   If the compression level is changed, the input available so far is\n   compressed with the old level (and may be flushed); the new level will take\n   effect only at the next call of deflate().\n\n     Before the call of deflateParams, the stream state must be set as for\n   a call of deflate(), since the currently available input may have to be\n   compressed and flushed.  In particular, strm->avail_out must be non-zero.\n\n     deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source\n   stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if\n   strm->avail_out was zero.\n*/\n\nZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,\n                                    int good_length,\n                                    int max_lazy,\n                                    int nice_length,\n                                    int max_chain));\n/*\n     Fine tune deflate's internal compression parameters.  This should only be\n   used by someone who understands the algorithm used by zlib's deflate for\n   searching for the best matching string, and even then only by the most\n   fanatic optimizer trying to squeeze out the last compressed bit for their\n   specific input data.  Read the deflate.c source code for the meaning of the\n   max_lazy, good_length, nice_length, and max_chain parameters.\n\n     deflateTune() can be called after deflateInit() or deflateInit2(), and\n   returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.\n */\n\nZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,\n                                       uLong sourceLen));\n/*\n     deflateBound() returns an upper bound on the compressed size after\n   deflation of sourceLen bytes.  It must be called after deflateInit() or\n   deflateInit2(), and after deflateSetHeader(), if used.  This would be used\n   to allocate an output buffer for deflation in a single pass, and so would be\n   called before deflate().  If that first deflate() call is provided the\n   sourceLen input bytes, an output buffer allocated to the size returned by\n   deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed\n   to return Z_STREAM_END.  Note that it is possible for the compressed size to\n   be larger than the value returned by deflateBound() if flush options other\n   than Z_FINISH or Z_NO_FLUSH are used.\n*/\n\nZEXTERN int ZEXPORT deflatePending OF((z_streamp strm,\n                                       unsigned *pending,\n                                       int *bits));\n/*\n     deflatePending() returns the number of bytes and bits of output that have\n   been generated, but not yet provided in the available output.  The bytes not\n   provided would be due to the available output space having being consumed.\n   The number of bits of output not provided are between 0 and 7, where they\n   await more bits to join them in order to fill out a full byte.  If pending\n   or bits are Z_NULL, then those values are not set.\n\n     deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent.\n */\n\nZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,\n                                     int bits,\n                                     int value));\n/*\n     deflatePrime() inserts bits in the deflate output stream.  The intent\n   is that this function is used to start off the deflate output with the bits\n   leftover from a previous deflate stream when appending to it.  As such, this\n   function can only be used for raw deflate, and must be used before the first\n   deflate() call after a deflateInit2() or deflateReset().  bits must be less\n   than or equal to 16, and that many of the least significant bits of value\n   will be inserted in the output.\n\n     deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough\n   room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the\n   source stream state was inconsistent.\n*/\n\nZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,\n                                         gz_headerp head));\n/*\n     deflateSetHeader() provides gzip header information for when a gzip\n   stream is requested by deflateInit2().  deflateSetHeader() may be called\n   after deflateInit2() or deflateReset() and before the first call of\n   deflate().  The text, time, os, extra field, name, and comment information\n   in the provided gz_header structure are written to the gzip header (xflag is\n   ignored -- the extra flags are set according to the compression level).  The\n   caller must assure that, if not Z_NULL, name and comment are terminated with\n   a zero byte, and that if extra is not Z_NULL, that extra_len bytes are\n   available there.  If hcrc is true, a gzip header crc is included.  Note that\n   the current versions of the command-line version of gzip (up through version\n   1.3.x) do not support header crc's, and will report that it is a \"multi-part\n   gzip file\" and give up.\n\n     If deflateSetHeader is not used, the default gzip header has text false,\n   the time set to zero, and os set to 255, with no extra, name, or comment\n   fields.  The gzip header is returned to the default state by deflateReset().\n\n     deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent.\n*/\n\n/*\nZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,\n                                     int  windowBits));\n\n     This is another version of inflateInit with an extra parameter.  The\n   fields next_in, avail_in, zalloc, zfree and opaque must be initialized\n   before by the caller.\n\n     The windowBits parameter is the base two logarithm of the maximum window\n   size (the size of the history buffer).  It should be in the range 8..15 for\n   this version of the library.  The default value is 15 if inflateInit is used\n   instead.  windowBits must be greater than or equal to the windowBits value\n   provided to deflateInit2() while compressing, or it must be equal to 15 if\n   deflateInit2() was not used.  If a compressed stream with a larger window\n   size is given as input, inflate() will return with the error code\n   Z_DATA_ERROR instead of trying to allocate a larger window.\n\n     windowBits can also be zero to request that inflate use the window size in\n   the zlib header of the compressed stream.\n\n     windowBits can also be -8..-15 for raw inflate.  In this case, -windowBits\n   determines the window size.  inflate() will then process raw deflate data,\n   not looking for a zlib or gzip header, not generating a check value, and not\n   looking for any check values for comparison at the end of the stream.  This\n   is for use with other formats that use the deflate compressed data format\n   such as zip.  Those formats provide their own check values.  If a custom\n   format is developed using the raw deflate format for compressed data, it is\n   recommended that a check value such as an adler32 or a crc32 be applied to\n   the uncompressed data as is done in the zlib, gzip, and zip formats.  For\n   most applications, the zlib format should be used as is.  Note that comments\n   above on the use in deflateInit2() applies to the magnitude of windowBits.\n\n     windowBits can also be greater than 15 for optional gzip decoding.  Add\n   32 to windowBits to enable zlib and gzip decoding with automatic header\n   detection, or add 16 to decode only the gzip format (the zlib format will\n   return a Z_DATA_ERROR).  If a gzip stream is being decoded, strm->adler is a\n   crc32 instead of an adler32.\n\n     inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough\n   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the\n   version assumed by the caller, or Z_STREAM_ERROR if the parameters are\n   invalid, such as a null pointer to the structure.  msg is set to null if\n   there is no error message.  inflateInit2 does not perform any decompression\n   apart from possibly reading the zlib header if present: actual decompression\n   will be done by inflate().  (So next_in and avail_in may be modified, but\n   next_out and avail_out are unused and unchanged.) The current implementation\n   of inflateInit2() does not process any header information -- that is\n   deferred until inflate() is called.\n*/\n\nZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,\n                                             const Bytef *dictionary,\n                                             uInt  dictLength));\n/*\n     Initializes the decompression dictionary from the given uncompressed byte\n   sequence.  This function must be called immediately after a call of inflate,\n   if that call returned Z_NEED_DICT.  The dictionary chosen by the compressor\n   can be determined from the adler32 value returned by that call of inflate.\n   The compressor and decompressor must use exactly the same dictionary (see\n   deflateSetDictionary).  For raw inflate, this function can be called at any\n   time to set the dictionary.  If the provided dictionary is smaller than the\n   window and there is already data in the window, then the provided dictionary\n   will amend what's there.  The application must insure that the dictionary\n   that was used for compression is provided.\n\n     inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a\n   parameter is invalid (e.g.  dictionary being Z_NULL) or the stream state is\n   inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the\n   expected one (incorrect adler32 value).  inflateSetDictionary does not\n   perform any decompression: this will be done by subsequent calls of\n   inflate().\n*/\n\nZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm,\n                                             Bytef *dictionary,\n                                             uInt  *dictLength));\n/*\n     Returns the sliding dictionary being maintained by inflate.  dictLength is\n   set to the number of bytes in the dictionary, and that many bytes are copied\n   to dictionary.  dictionary must have enough space, where 32768 bytes is\n   always enough.  If inflateGetDictionary() is called with dictionary equal to\n   Z_NULL, then only the dictionary length is returned, and nothing is copied.\n   Similary, if dictLength is Z_NULL, then it is not set.\n\n     inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the\n   stream state is inconsistent.\n*/\n\nZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));\n/*\n     Skips invalid compressed data until a possible full flush point (see above\n   for the description of deflate with Z_FULL_FLUSH) can be found, or until all\n   available input is skipped.  No output is provided.\n\n     inflateSync searches for a 00 00 FF FF pattern in the compressed data.\n   All full flush points have this pattern, but not all occurrences of this\n   pattern are full flush points.\n\n     inflateSync returns Z_OK if a possible full flush point has been found,\n   Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point\n   has been found, or Z_STREAM_ERROR if the stream structure was inconsistent.\n   In the success case, the application may save the current current value of\n   total_in which indicates where valid compressed data was found.  In the\n   error case, the application may repeatedly call inflateSync, providing more\n   input each time, until success or end of the input data.\n*/\n\nZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,\n                                    z_streamp source));\n/*\n     Sets the destination stream as a complete copy of the source stream.\n\n     This function can be useful when randomly accessing a large stream.  The\n   first pass through the stream can periodically record the inflate state,\n   allowing restarting inflate at those points when randomly accessing the\n   stream.\n\n     inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not\n   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent\n   (such as zalloc being Z_NULL).  msg is left unchanged in both source and\n   destination.\n*/\n\nZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));\n/*\n     This function is equivalent to inflateEnd followed by inflateInit,\n   but does not free and reallocate all the internal decompression state.  The\n   stream will keep attributes that may have been set by inflateInit2.\n\n     inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent (such as zalloc or state being Z_NULL).\n*/\n\nZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,\n                                      int windowBits));\n/*\n     This function is the same as inflateReset, but it also permits changing\n   the wrap and window size requests.  The windowBits parameter is interpreted\n   the same as it is for inflateInit2.\n\n     inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent (such as zalloc or state being Z_NULL), or if\n   the windowBits parameter is invalid.\n*/\n\nZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,\n                                     int bits,\n                                     int value));\n/*\n     This function inserts bits in the inflate input stream.  The intent is\n   that this function is used to start inflating at a bit position in the\n   middle of a byte.  The provided bits will be used before any bytes are used\n   from next_in.  This function should only be used with raw inflate, and\n   should be used before the first inflate() call after inflateInit2() or\n   inflateReset().  bits must be less than or equal to 16, and that many of the\n   least significant bits of value will be inserted in the input.\n\n     If bits is negative, then the input stream bit buffer is emptied.  Then\n   inflatePrime() can be called again to put bits in the buffer.  This is used\n   to clear out bits leftover after feeding inflate a block description prior\n   to feeding inflate codes.\n\n     inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent.\n*/\n\nZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));\n/*\n     This function returns two values, one in the lower 16 bits of the return\n   value, and the other in the remaining upper bits, obtained by shifting the\n   return value down 16 bits.  If the upper value is -1 and the lower value is\n   zero, then inflate() is currently decoding information outside of a block.\n   If the upper value is -1 and the lower value is non-zero, then inflate is in\n   the middle of a stored block, with the lower value equaling the number of\n   bytes from the input remaining to copy.  If the upper value is not -1, then\n   it is the number of bits back from the current bit position in the input of\n   the code (literal or length/distance pair) currently being processed.  In\n   that case the lower value is the number of bytes already emitted for that\n   code.\n\n     A code is being processed if inflate is waiting for more input to complete\n   decoding of the code, or if it has completed decoding but is waiting for\n   more output space to write the literal or match data.\n\n     inflateMark() is used to mark locations in the input data for random\n   access, which may be at bit positions, and to note those cases where the\n   output of a code may span boundaries of random access blocks.  The current\n   location in the input stream can be determined from avail_in and data_type\n   as noted in the description for the Z_BLOCK flush parameter for inflate.\n\n     inflateMark returns the value noted above or -1 << 16 if the provided\n   source stream state was inconsistent.\n*/\n\nZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,\n                                         gz_headerp head));\n/*\n     inflateGetHeader() requests that gzip header information be stored in the\n   provided gz_header structure.  inflateGetHeader() may be called after\n   inflateInit2() or inflateReset(), and before the first call of inflate().\n   As inflate() processes the gzip stream, head->done is zero until the header\n   is completed, at which time head->done is set to one.  If a zlib stream is\n   being decoded, then head->done is set to -1 to indicate that there will be\n   no gzip header information forthcoming.  Note that Z_BLOCK or Z_TREES can be\n   used to force inflate() to return immediately after header processing is\n   complete and before any actual data is decompressed.\n\n     The text, time, xflags, and os fields are filled in with the gzip header\n   contents.  hcrc is set to true if there is a header CRC.  (The header CRC\n   was valid if done is set to one.) If extra is not Z_NULL, then extra_max\n   contains the maximum number of bytes to write to extra.  Once done is true,\n   extra_len contains the actual extra field length, and extra contains the\n   extra field, or that field truncated if extra_max is less than extra_len.\n   If name is not Z_NULL, then up to name_max characters are written there,\n   terminated with a zero unless the length is greater than name_max.  If\n   comment is not Z_NULL, then up to comm_max characters are written there,\n   terminated with a zero unless the length is greater than comm_max.  When any\n   of extra, name, or comment are not Z_NULL and the respective field is not\n   present in the header, then that field is set to Z_NULL to signal its\n   absence.  This allows the use of deflateSetHeader() with the returned\n   structure to duplicate the header.  However if those fields are set to\n   allocated memory, then the application will need to save those pointers\n   elsewhere so that they can be eventually freed.\n\n     If inflateGetHeader is not used, then the header information is simply\n   discarded.  The header is always checked for validity, including the header\n   CRC if present.  inflateReset() will reset the process to discard the header\n   information.  The application would need to call inflateGetHeader() again to\n   retrieve the header from the next gzip stream.\n\n     inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source\n   stream state was inconsistent.\n*/\n\n/*\nZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,\n                                        unsigned char FAR *window));\n\n     Initialize the internal stream state for decompression using inflateBack()\n   calls.  The fields zalloc, zfree and opaque in strm must be initialized\n   before the call.  If zalloc and zfree are Z_NULL, then the default library-\n   derived memory allocation routines are used.  windowBits is the base two\n   logarithm of the window size, in the range 8..15.  window is a caller\n   supplied buffer of that size.  Except for special applications where it is\n   assured that deflate was used with small window sizes, windowBits must be 15\n   and a 32K byte window must be supplied to be able to decompress general\n   deflate streams.\n\n     See inflateBack() for the usage of these routines.\n\n     inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of\n   the parameters are invalid, Z_MEM_ERROR if the internal state could not be\n   allocated, or Z_VERSION_ERROR if the version of the library does not match\n   the version of the header file.\n*/\n\ntypedef unsigned (*in_func) OF((void FAR *,\n                                z_const unsigned char FAR * FAR *));\ntypedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));\n\nZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,\n                                    in_func in, void FAR *in_desc,\n                                    out_func out, void FAR *out_desc));\n/*\n     inflateBack() does a raw inflate with a single call using a call-back\n   interface for input and output.  This is potentially more efficient than\n   inflate() for file i/o applications, in that it avoids copying between the\n   output and the sliding window by simply making the window itself the output\n   buffer.  inflate() can be faster on modern CPUs when used with large\n   buffers.  inflateBack() trusts the application to not change the output\n   buffer passed by the output function, at least until inflateBack() returns.\n\n     inflateBackInit() must be called first to allocate the internal state\n   and to initialize the state with the user-provided window buffer.\n   inflateBack() may then be used multiple times to inflate a complete, raw\n   deflate stream with each call.  inflateBackEnd() is then called to free the\n   allocated state.\n\n     A raw deflate stream is one with no zlib or gzip header or trailer.\n   This routine would normally be used in a utility that reads zip or gzip\n   files and writes out uncompressed files.  The utility would decode the\n   header and process the trailer on its own, hence this routine expects only\n   the raw deflate stream to decompress.  This is different from the normal\n   behavior of inflate(), which expects either a zlib or gzip header and\n   trailer around the deflate stream.\n\n     inflateBack() uses two subroutines supplied by the caller that are then\n   called by inflateBack() for input and output.  inflateBack() calls those\n   routines until it reads a complete deflate stream and writes out all of the\n   uncompressed data, or until it encounters an error.  The function's\n   parameters and return types are defined above in the in_func and out_func\n   typedefs.  inflateBack() will call in(in_desc, &buf) which should return the\n   number of bytes of provided input, and a pointer to that input in buf.  If\n   there is no input available, in() must return zero--buf is ignored in that\n   case--and inflateBack() will return a buffer error.  inflateBack() will call\n   out(out_desc, buf, len) to write the uncompressed data buf[0..len-1].  out()\n   should return zero on success, or non-zero on failure.  If out() returns\n   non-zero, inflateBack() will return with an error.  Neither in() nor out()\n   are permitted to change the contents of the window provided to\n   inflateBackInit(), which is also the buffer that out() uses to write from.\n   The length written by out() will be at most the window size.  Any non-zero\n   amount of input may be provided by in().\n\n     For convenience, inflateBack() can be provided input on the first call by\n   setting strm->next_in and strm->avail_in.  If that input is exhausted, then\n   in() will be called.  Therefore strm->next_in must be initialized before\n   calling inflateBack().  If strm->next_in is Z_NULL, then in() will be called\n   immediately for input.  If strm->next_in is not Z_NULL, then strm->avail_in\n   must also be initialized, and then if strm->avail_in is not zero, input will\n   initially be taken from strm->next_in[0 ..  strm->avail_in - 1].\n\n     The in_desc and out_desc parameters of inflateBack() is passed as the\n   first parameter of in() and out() respectively when they are called.  These\n   descriptors can be optionally used to pass any information that the caller-\n   supplied in() and out() functions need to do their job.\n\n     On return, inflateBack() will set strm->next_in and strm->avail_in to\n   pass back any unused input that was provided by the last in() call.  The\n   return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR\n   if in() or out() returned an error, Z_DATA_ERROR if there was a format error\n   in the deflate stream (in which case strm->msg is set to indicate the nature\n   of the error), or Z_STREAM_ERROR if the stream was not properly initialized.\n   In the case of Z_BUF_ERROR, an input or output error can be distinguished\n   using strm->next_in which will be Z_NULL only if in() returned an error.  If\n   strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning\n   non-zero.  (in() will always be called before out(), so strm->next_in is\n   assured to be defined if out() returns non-zero.) Note that inflateBack()\n   cannot return Z_OK.\n*/\n\nZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));\n/*\n     All memory allocated by inflateBackInit() is freed.\n\n     inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream\n   state was inconsistent.\n*/\n\nZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));\n/* Return flags indicating compile-time options.\n\n    Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:\n     1.0: size of uInt\n     3.2: size of uLong\n     5.4: size of voidpf (pointer)\n     7.6: size of z_off_t\n\n    Compiler, assembler, and debug options:\n     8: DEBUG\n     9: ASMV or ASMINF -- use ASM code\n     10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention\n     11: 0 (reserved)\n\n    One-time table building (smaller code, but not thread-safe if true):\n     12: BUILDFIXED -- build static block decoding tables when needed\n     13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed\n     14,15: 0 (reserved)\n\n    Library content (indicates missing functionality):\n     16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking\n                          deflate code when not needed)\n     17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect\n                    and decode gzip streams (to avoid linking crc code)\n     18-19: 0 (reserved)\n\n    Operation variations (changes in library functionality):\n     20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate\n     21: FASTEST -- deflate algorithm with only one, lowest compression level\n     22,23: 0 (reserved)\n\n    The sprintf variant used by gzprintf (zero is best):\n     24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format\n     25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!\n     26: 0 = returns value, 1 = void -- 1 means inferred string length returned\n\n    Remainder:\n     27-31: 0 (reserved)\n */\n\n#ifndef Z_SOLO\n\n                        /* utility functions */\n\n/*\n     The following utility functions are implemented on top of the basic\n   stream-oriented functions.  To simplify the interface, some default options\n   are assumed (compression level and memory usage, standard memory allocation\n   functions).  The source code of these utility functions can be modified if\n   you need special options.\n*/\n\nZEXTERN int ZEXPORT compress OF((Bytef *dest,   uLongf *destLen,\n                                 const Bytef *source, uLong sourceLen));\n/*\n     Compresses the source buffer into the destination buffer.  sourceLen is\n   the byte length of the source buffer.  Upon entry, destLen is the total size\n   of the destination buffer, which must be at least the value returned by\n   compressBound(sourceLen).  Upon exit, destLen is the actual size of the\n   compressed buffer.\n\n     compress returns Z_OK if success, Z_MEM_ERROR if there was not\n   enough memory, Z_BUF_ERROR if there was not enough room in the output\n   buffer.\n*/\n\nZEXTERN int ZEXPORT compress2 OF((Bytef *dest,   uLongf *destLen,\n                                  const Bytef *source, uLong sourceLen,\n                                  int level));\n/*\n     Compresses the source buffer into the destination buffer.  The level\n   parameter has the same meaning as in deflateInit.  sourceLen is the byte\n   length of the source buffer.  Upon entry, destLen is the total size of the\n   destination buffer, which must be at least the value returned by\n   compressBound(sourceLen).  Upon exit, destLen is the actual size of the\n   compressed buffer.\n\n     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough\n   memory, Z_BUF_ERROR if there was not enough room in the output buffer,\n   Z_STREAM_ERROR if the level parameter is invalid.\n*/\n\nZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));\n/*\n     compressBound() returns an upper bound on the compressed size after\n   compress() or compress2() on sourceLen bytes.  It would be used before a\n   compress() or compress2() call to allocate the destination buffer.\n*/\n\nZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,\n                                   const Bytef *source, uLong sourceLen));\n/*\n     Decompresses the source buffer into the destination buffer.  sourceLen is\n   the byte length of the source buffer.  Upon entry, destLen is the total size\n   of the destination buffer, which must be large enough to hold the entire\n   uncompressed data.  (The size of the uncompressed data must have been saved\n   previously by the compressor and transmitted to the decompressor by some\n   mechanism outside the scope of this compression library.) Upon exit, destLen\n   is the actual size of the uncompressed buffer.\n\n     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not\n   enough memory, Z_BUF_ERROR if there was not enough room in the output\n   buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.  In\n   the case where there is not enough room, uncompress() will fill the output\n   buffer with the uncompressed data up to that point.\n*/\n\n                        /* gzip file access functions */\n\n/*\n     This library supports reading and writing files in gzip (.gz) format with\n   an interface similar to that of stdio, using the functions that start with\n   \"gz\".  The gzip format is different from the zlib format.  gzip is a gzip\n   wrapper, documented in RFC 1952, wrapped around a deflate stream.\n*/\n\ntypedef struct gzFile_s *gzFile;    /* semi-opaque gzip file descriptor */\n\n/*\nZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));\n\n     Opens a gzip (.gz) file for reading or writing.  The mode parameter is as\n   in fopen (\"rb\" or \"wb\") but can also include a compression level (\"wb9\") or\n   a strategy: 'f' for filtered data as in \"wb6f\", 'h' for Huffman-only\n   compression as in \"wb1h\", 'R' for run-length encoding as in \"wb1R\", or 'F'\n   for fixed code compression as in \"wb9F\".  (See the description of\n   deflateInit2 for more information about the strategy parameter.)  'T' will\n   request transparent writing or appending with no compression and not using\n   the gzip format.\n\n     \"a\" can be used instead of \"w\" to request that the gzip stream that will\n   be written be appended to the file.  \"+\" will result in an error, since\n   reading and writing to the same gzip file is not supported.  The addition of\n   \"x\" when writing will create the file exclusively, which fails if the file\n   already exists.  On systems that support it, the addition of \"e\" when\n   reading or writing will set the flag to close the file on an execve() call.\n\n     These functions, as well as gzip, will read and decode a sequence of gzip\n   streams in a file.  The append function of gzopen() can be used to create\n   such a file.  (Also see gzflush() for another way to do this.)  When\n   appending, gzopen does not test whether the file begins with a gzip stream,\n   nor does it look for the end of the gzip streams to begin appending.  gzopen\n   will simply append a gzip stream to the existing file.\n\n     gzopen can be used to read a file which is not in gzip format; in this\n   case gzread will directly read from the file without decompression.  When\n   reading, this will be detected automatically by looking for the magic two-\n   byte gzip header.\n\n     gzopen returns NULL if the file could not be opened, if there was\n   insufficient memory to allocate the gzFile state, or if an invalid mode was\n   specified (an 'r', 'w', or 'a' was not provided, or '+' was provided).\n   errno can be checked to determine if the reason gzopen failed was that the\n   file could not be opened.\n*/\n\nZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));\n/*\n     gzdopen associates a gzFile with the file descriptor fd.  File descriptors\n   are obtained from calls like open, dup, creat, pipe or fileno (if the file\n   has been previously opened with fopen).  The mode parameter is as in gzopen.\n\n     The next call of gzclose on the returned gzFile will also close the file\n   descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor\n   fd.  If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,\n   mode);.  The duplicated descriptor should be saved to avoid a leak, since\n   gzdopen does not close fd if it fails.  If you are using fileno() to get the\n   file descriptor from a FILE *, then you will have to use dup() to avoid\n   double-close()ing the file descriptor.  Both gzclose() and fclose() will\n   close the associated file descriptor, so they need to have different file\n   descriptors.\n\n     gzdopen returns NULL if there was insufficient memory to allocate the\n   gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not\n   provided, or '+' was provided), or if fd is -1.  The file descriptor is not\n   used until the next gz* read, write, seek, or close operation, so gzdopen\n   will not detect if fd is invalid (unless fd is -1).\n*/\n\nZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));\n/*\n     Set the internal buffer size used by this library's functions.  The\n   default buffer size is 8192 bytes.  This function must be called after\n   gzopen() or gzdopen(), and before any other calls that read or write the\n   file.  The buffer memory allocation is always deferred to the first read or\n   write.  Two buffers are allocated, either both of the specified size when\n   writing, or one of the specified size and the other twice that size when\n   reading.  A larger buffer size of, for example, 64K or 128K bytes will\n   noticeably increase the speed of decompression (reading).\n\n     The new buffer size also affects the maximum length for gzprintf().\n\n     gzbuffer() returns 0 on success, or -1 on failure, such as being called\n   too late.\n*/\n\nZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));\n/*\n     Dynamically update the compression level or strategy.  See the description\n   of deflateInit2 for the meaning of these parameters.\n\n     gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not\n   opened for writing.\n*/\n\nZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));\n/*\n     Reads the given number of uncompressed bytes from the compressed file.  If\n   the input file is not in gzip format, gzread copies the given number of\n   bytes into the buffer directly from the file.\n\n     After reaching the end of a gzip stream in the input, gzread will continue\n   to read, looking for another gzip stream.  Any number of gzip streams may be\n   concatenated in the input file, and will all be decompressed by gzread().\n   If something other than a gzip stream is encountered after a gzip stream,\n   that remaining trailing garbage is ignored (and no error is returned).\n\n     gzread can be used to read a gzip file that is being concurrently written.\n   Upon reaching the end of the input, gzread will return with the available\n   data.  If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then\n   gzclearerr can be used to clear the end of file indicator in order to permit\n   gzread to be tried again.  Z_OK indicates that a gzip stream was completed\n   on the last gzread.  Z_BUF_ERROR indicates that the input file ended in the\n   middle of a gzip stream.  Note that gzread does not return -1 in the event\n   of an incomplete gzip stream.  This error is deferred until gzclose(), which\n   will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip\n   stream.  Alternatively, gzerror can be used before gzclose to detect this\n   case.\n\n     gzread returns the number of uncompressed bytes actually read, less than\n   len for end of file, or -1 for error.\n*/\n\nZEXTERN int ZEXPORT gzwrite OF((gzFile file,\n                                voidpc buf, unsigned len));\n/*\n     Writes the given number of uncompressed bytes into the compressed file.\n   gzwrite returns the number of uncompressed bytes written or 0 in case of\n   error.\n*/\n\nZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));\n/*\n     Converts, formats, and writes the arguments to the compressed file under\n   control of the format string, as in fprintf.  gzprintf returns the number of\n   uncompressed bytes actually written, or 0 in case of error.  The number of\n   uncompressed bytes written is limited to 8191, or one less than the buffer\n   size given to gzbuffer().  The caller should assure that this limit is not\n   exceeded.  If it is exceeded, then gzprintf() will return an error (0) with\n   nothing written.  In this case, there may also be a buffer overflow with\n   unpredictable consequences, which is possible only if zlib was compiled with\n   the insecure functions sprintf() or vsprintf() because the secure snprintf()\n   or vsnprintf() functions were not available.  This can be determined using\n   zlibCompileFlags().\n*/\n\nZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));\n/*\n     Writes the given null-terminated string to the compressed file, excluding\n   the terminating null character.\n\n     gzputs returns the number of characters written, or -1 in case of error.\n*/\n\nZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));\n/*\n     Reads bytes from the compressed file until len-1 characters are read, or a\n   newline character is read and transferred to buf, or an end-of-file\n   condition is encountered.  If any characters are read or if len == 1, the\n   string is terminated with a null character.  If no characters are read due\n   to an end-of-file or len < 1, then the buffer is left untouched.\n\n     gzgets returns buf which is a null-terminated string, or it returns NULL\n   for end-of-file or in case of error.  If there was an error, the contents at\n   buf are indeterminate.\n*/\n\nZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));\n/*\n     Writes c, converted to an unsigned char, into the compressed file.  gzputc\n   returns the value that was written, or -1 in case of error.\n*/\n\nZEXTERN int ZEXPORT gzgetc OF((gzFile file));\n/*\n     Reads one byte from the compressed file.  gzgetc returns this byte or -1\n   in case of end of file or error.  This is implemented as a macro for speed.\n   As such, it does not do all of the checking the other functions do.  I.e.\n   it does not check to see if file is NULL, nor whether the structure file\n   points to has been clobbered or not.\n*/\n\nZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));\n/*\n     Push one character back onto the stream to be read as the first character\n   on the next read.  At least one character of push-back is allowed.\n   gzungetc() returns the character pushed, or -1 on failure.  gzungetc() will\n   fail if c is -1, and may fail if a character has been pushed but not read\n   yet.  If gzungetc is used immediately after gzopen or gzdopen, at least the\n   output buffer size of pushed characters is allowed.  (See gzbuffer above.)\n   The pushed character will be discarded if the stream is repositioned with\n   gzseek() or gzrewind().\n*/\n\nZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));\n/*\n     Flushes all pending output into the compressed file.  The parameter flush\n   is as in the deflate() function.  The return value is the zlib error number\n   (see function gzerror below).  gzflush is only permitted when writing.\n\n     If the flush parameter is Z_FINISH, the remaining data is written and the\n   gzip stream is completed in the output.  If gzwrite() is called again, a new\n   gzip stream will be started in the output.  gzread() is able to read such\n   concatented gzip streams.\n\n     gzflush should be called only when strictly necessary because it will\n   degrade compression if called too often.\n*/\n\n/*\nZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,\n                                   z_off_t offset, int whence));\n\n     Sets the starting position for the next gzread or gzwrite on the given\n   compressed file.  The offset represents a number of bytes in the\n   uncompressed data stream.  The whence parameter is defined as in lseek(2);\n   the value SEEK_END is not supported.\n\n     If the file is opened for reading, this function is emulated but can be\n   extremely slow.  If the file is opened for writing, only forward seeks are\n   supported; gzseek then compresses a sequence of zeroes up to the new\n   starting position.\n\n     gzseek returns the resulting offset location as measured in bytes from\n   the beginning of the uncompressed stream, or -1 in case of error, in\n   particular if the file is opened for writing and the new starting position\n   would be before the current position.\n*/\n\nZEXTERN int ZEXPORT    gzrewind OF((gzFile file));\n/*\n     Rewinds the given file. This function is supported only for reading.\n\n     gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)\n*/\n\n/*\nZEXTERN z_off_t ZEXPORT    gztell OF((gzFile file));\n\n     Returns the starting position for the next gzread or gzwrite on the given\n   compressed file.  This position represents a number of bytes in the\n   uncompressed data stream, and is zero when starting, even if appending or\n   reading a gzip stream from the middle of a file using gzdopen().\n\n     gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)\n*/\n\n/*\nZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));\n\n     Returns the current offset in the file being read or written.  This offset\n   includes the count of bytes that precede the gzip stream, for example when\n   appending or when using gzdopen() for reading.  When reading, the offset\n   does not include as yet unused buffered input.  This information can be used\n   for a progress indicator.  On error, gzoffset() returns -1.\n*/\n\nZEXTERN int ZEXPORT gzeof OF((gzFile file));\n/*\n     Returns true (1) if the end-of-file indicator has been set while reading,\n   false (0) otherwise.  Note that the end-of-file indicator is set only if the\n   read tried to go past the end of the input, but came up short.  Therefore,\n   just like feof(), gzeof() may return false even if there is no more data to\n   read, in the event that the last read request was for the exact number of\n   bytes remaining in the input file.  This will happen if the input file size\n   is an exact multiple of the buffer size.\n\n     If gzeof() returns true, then the read functions will return no more data,\n   unless the end-of-file indicator is reset by gzclearerr() and the input file\n   has grown since the previous end of file was detected.\n*/\n\nZEXTERN int ZEXPORT gzdirect OF((gzFile file));\n/*\n     Returns true (1) if file is being copied directly while reading, or false\n   (0) if file is a gzip stream being decompressed.\n\n     If the input file is empty, gzdirect() will return true, since the input\n   does not contain a gzip stream.\n\n     If gzdirect() is used immediately after gzopen() or gzdopen() it will\n   cause buffers to be allocated to allow reading the file to determine if it\n   is a gzip file.  Therefore if gzbuffer() is used, it should be called before\n   gzdirect().\n\n     When writing, gzdirect() returns true (1) if transparent writing was\n   requested (\"wT\" for the gzopen() mode), or false (0) otherwise.  (Note:\n   gzdirect() is not needed when writing.  Transparent writing must be\n   explicitly requested, so the application already knows the answer.  When\n   linking statically, using gzdirect() will include all of the zlib code for\n   gzip file reading and decompression, which may not be desired.)\n*/\n\nZEXTERN int ZEXPORT    gzclose OF((gzFile file));\n/*\n     Flushes all pending output if necessary, closes the compressed file and\n   deallocates the (de)compression state.  Note that once file is closed, you\n   cannot call gzerror with file, since its structures have been deallocated.\n   gzclose must not be called more than once on the same file, just as free\n   must not be called more than once on the same allocation.\n\n     gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a\n   file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the\n   last read ended in the middle of a gzip stream, or Z_OK on success.\n*/\n\nZEXTERN int ZEXPORT gzclose_r OF((gzFile file));\nZEXTERN int ZEXPORT gzclose_w OF((gzFile file));\n/*\n     Same as gzclose(), but gzclose_r() is only for use when reading, and\n   gzclose_w() is only for use when writing or appending.  The advantage to\n   using these instead of gzclose() is that they avoid linking in zlib\n   compression or decompression code that is not used when only reading or only\n   writing respectively.  If gzclose() is used, then both compression and\n   decompression code will be included the application when linking to a static\n   zlib library.\n*/\n\nZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));\n/*\n     Returns the error message for the last error which occurred on the given\n   compressed file.  errnum is set to zlib error number.  If an error occurred\n   in the file system and not in the compression library, errnum is set to\n   Z_ERRNO and the application may consult errno to get the exact error code.\n\n     The application must not modify the returned string.  Future calls to\n   this function may invalidate the previously returned string.  If file is\n   closed, then the string previously returned by gzerror will no longer be\n   available.\n\n     gzerror() should be used to distinguish errors from end-of-file for those\n   functions above that do not distinguish those cases in their return values.\n*/\n\nZEXTERN void ZEXPORT gzclearerr OF((gzFile file));\n/*\n     Clears the error and end-of-file flags for file.  This is analogous to the\n   clearerr() function in stdio.  This is useful for continuing to read a gzip\n   file that is being written concurrently.\n*/\n\n#endif /* !Z_SOLO */\n\n                        /* checksum functions */\n\n/*\n     These functions are not related to compression but are exported\n   anyway because they might be useful in applications using the compression\n   library.\n*/\n\nZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));\n/*\n     Update a running Adler-32 checksum with the bytes buf[0..len-1] and\n   return the updated checksum.  If buf is Z_NULL, this function returns the\n   required initial value for the checksum.\n\n     An Adler-32 checksum is almost as reliable as a CRC32 but can be computed\n   much faster.\n\n   Usage example:\n\n     uLong adler = adler32(0L, Z_NULL, 0);\n\n     while (read_buffer(buffer, length) != EOF) {\n       adler = adler32(adler, buffer, length);\n     }\n     if (adler != original_adler) error();\n*/\n\n/*\nZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,\n                                          z_off_t len2));\n\n     Combine two Adler-32 checksums into one.  For two sequences of bytes, seq1\n   and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for\n   each, adler1 and adler2.  adler32_combine() returns the Adler-32 checksum of\n   seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.  Note\n   that the z_off_t type (like off_t) is a signed integer.  If len2 is\n   negative, the result has no meaning or utility.\n*/\n\nZEXTERN uLong ZEXPORT crc32   OF((uLong crc, const Bytef *buf, uInt len));\n/*\n     Update a running CRC-32 with the bytes buf[0..len-1] and return the\n   updated CRC-32.  If buf is Z_NULL, this function returns the required\n   initial value for the crc.  Pre- and post-conditioning (one's complement) is\n   performed within this function so it shouldn't be done by the application.\n\n   Usage example:\n\n     uLong crc = crc32(0L, Z_NULL, 0);\n\n     while (read_buffer(buffer, length) != EOF) {\n       crc = crc32(crc, buffer, length);\n     }\n     if (crc != original_crc) error();\n*/\n\n/*\nZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));\n\n     Combine two CRC-32 check values into one.  For two sequences of bytes,\n   seq1 and seq2 with lengths len1 and len2, CRC-32 check values were\n   calculated for each, crc1 and crc2.  crc32_combine() returns the CRC-32\n   check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and\n   len2.\n*/\n\n\n                        /* various hacks, don't look :) */\n\n/* deflateInit and inflateInit are macros to allow checking the zlib version\n * and the compiler's view of z_stream:\n */\nZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,\n                                     const char *version, int stream_size));\nZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,\n                                     const char *version, int stream_size));\nZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int  level, int  method,\n                                      int windowBits, int memLevel,\n                                      int strategy, const char *version,\n                                      int stream_size));\nZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int  windowBits,\n                                      const char *version, int stream_size));\nZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,\n                                         unsigned char FAR *window,\n                                         const char *version,\n                                         int stream_size));\n#define deflateInit(strm, level) \\\n        deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))\n#define inflateInit(strm) \\\n        inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))\n#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \\\n        deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\\\n                      (strategy), ZLIB_VERSION, (int)sizeof(z_stream))\n#define inflateInit2(strm, windowBits) \\\n        inflateInit2_((strm), (windowBits), ZLIB_VERSION, \\\n                      (int)sizeof(z_stream))\n#define inflateBackInit(strm, windowBits, window) \\\n        inflateBackInit_((strm), (windowBits), (window), \\\n                      ZLIB_VERSION, (int)sizeof(z_stream))\n\n#ifndef Z_SOLO\n\n/* gzgetc() macro and its supporting function and exposed data structure.  Note\n * that the real internal state is much larger than the exposed structure.\n * This abbreviated structure exposes just enough for the gzgetc() macro.  The\n * user should not mess with these exposed elements, since their names or\n * behavior could change in the future, perhaps even capriciously.  They can\n * only be used by the gzgetc() macro.  You have been warned.\n */\nstruct gzFile_s {\n    unsigned have;\n    unsigned char *next;\n    z_off64_t pos;\n};\nZEXTERN int ZEXPORT gzgetc_ OF((gzFile file));  /* backward compatibility */\n#ifdef Z_PREFIX_SET\n#  undef z_gzgetc\n#  define z_gzgetc(g) \\\n          ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))\n#else\n#  define gzgetc(g) \\\n          ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g))\n#endif\n\n/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or\n * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if\n * both are true, the application gets the *64 functions, and the regular\n * functions are changed to 64 bits) -- in case these are set on systems\n * without large file support, _LFS64_LARGEFILE must also be true\n */\n#ifdef Z_LARGE64\n   ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));\n   ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));\n   ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));\n   ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));\n   ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));\n   ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));\n#endif\n\n#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)\n#  ifdef Z_PREFIX_SET\n#    define z_gzopen z_gzopen64\n#    define z_gzseek z_gzseek64\n#    define z_gztell z_gztell64\n#    define z_gzoffset z_gzoffset64\n#    define z_adler32_combine z_adler32_combine64\n#    define z_crc32_combine z_crc32_combine64\n#  else\n#    define gzopen gzopen64\n#    define gzseek gzseek64\n#    define gztell gztell64\n#    define gzoffset gzoffset64\n#    define adler32_combine adler32_combine64\n#    define crc32_combine crc32_combine64\n#  endif\n#  ifndef Z_LARGE64\n     ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));\n     ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));\n     ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));\n     ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));\n     ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));\n     ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));\n#  endif\n#else\n   ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));\n   ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));\n   ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));\n   ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));\n   ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));\n   ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));\n#endif\n\n#else /* Z_SOLO */\n\n   ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));\n   ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));\n\n#endif /* !Z_SOLO */\n\n/* hack for buggy compilers */\n#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)\n    struct internal_state {int dummy;};\n#endif\n\n/* undocumented functions */\nZEXTERN const char   * ZEXPORT zError           OF((int));\nZEXTERN int            ZEXPORT inflateSyncPoint OF((z_streamp));\nZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table    OF((void));\nZEXTERN int            ZEXPORT inflateUndermine OF((z_streamp, int));\nZEXTERN int            ZEXPORT inflateResetKeep OF((z_streamp));\nZEXTERN int            ZEXPORT deflateResetKeep OF((z_streamp));\n#if defined(_WIN32) && !defined(Z_SOLO)\nZEXTERN gzFile         ZEXPORT gzopen_w OF((const wchar_t *path,\n                                            const char *mode));\n#endif\n#if defined(STDC) || defined(Z_HAVE_STDARG_H)\n#  ifndef Z_SOLO\nZEXTERN int            ZEXPORTVA gzvprintf Z_ARG((gzFile file,\n                                                  const char *format,\n                                                  va_list va));\n#  endif\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* ZLIB_H */\n"
  },
  {
    "path": "ext/zlib/zutil.c",
    "content": "/* zutil.c -- target dependent utility functions for the compression library\n * Copyright (C) 1995-2005, 2010, 2011, 2012 Jean-loup Gailly.\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/* @(#) $Id$ */\n\n#include \"zutil.h\"\n#ifndef Z_SOLO\n#  include \"gzguts.h\"\n#endif\n\n#ifndef NO_DUMMY_DECL\nstruct internal_state      {int dummy;}; /* for buggy compilers */\n#endif\n\nz_const char * const z_errmsg[10] = {\n\"need dictionary\",     /* Z_NEED_DICT       2  */\n\"stream end\",          /* Z_STREAM_END      1  */\n\"\",                    /* Z_OK              0  */\n\"file error\",          /* Z_ERRNO         (-1) */\n\"stream error\",        /* Z_STREAM_ERROR  (-2) */\n\"data error\",          /* Z_DATA_ERROR    (-3) */\n\"insufficient memory\", /* Z_MEM_ERROR     (-4) */\n\"buffer error\",        /* Z_BUF_ERROR     (-5) */\n\"incompatible version\",/* Z_VERSION_ERROR (-6) */\n\"\"};\n\n\nconst char * ZEXPORT zlibVersion()\n{\n    return ZLIB_VERSION;\n}\n\nuLong ZEXPORT zlibCompileFlags()\n{\n    uLong flags;\n\n    flags = 0;\n    switch ((int)(sizeof(uInt))) {\n    case 2:     break;\n    case 4:     flags += 1;     break;\n    case 8:     flags += 2;     break;\n    default:    flags += 3;\n    }\n    switch ((int)(sizeof(uLong))) {\n    case 2:     break;\n    case 4:     flags += 1 << 2;        break;\n    case 8:     flags += 2 << 2;        break;\n    default:    flags += 3 << 2;\n    }\n    switch ((int)(sizeof(voidpf))) {\n    case 2:     break;\n    case 4:     flags += 1 << 4;        break;\n    case 8:     flags += 2 << 4;        break;\n    default:    flags += 3 << 4;\n    }\n    switch ((int)(sizeof(z_off_t))) {\n    case 2:     break;\n    case 4:     flags += 1 << 6;        break;\n    case 8:     flags += 2 << 6;        break;\n    default:    flags += 3 << 6;\n    }\n#ifdef DEBUG\n    flags += 1 << 8;\n#endif\n#if defined(ASMV) || defined(ASMINF)\n    flags += 1 << 9;\n#endif\n#ifdef ZLIB_WINAPI\n    flags += 1 << 10;\n#endif\n#ifdef BUILDFIXED\n    flags += 1 << 12;\n#endif\n#ifdef DYNAMIC_CRC_TABLE\n    flags += 1 << 13;\n#endif\n#ifdef NO_GZCOMPRESS\n    flags += 1L << 16;\n#endif\n#ifdef NO_GZIP\n    flags += 1L << 17;\n#endif\n#ifdef PKZIP_BUG_WORKAROUND\n    flags += 1L << 20;\n#endif\n#ifdef FASTEST\n    flags += 1L << 21;\n#endif\n#if defined(STDC) || defined(Z_HAVE_STDARG_H)\n#  ifdef NO_vsnprintf\n    flags += 1L << 25;\n#    ifdef HAS_vsprintf_void\n    flags += 1L << 26;\n#    endif\n#  else\n#    ifdef HAS_vsnprintf_void\n    flags += 1L << 26;\n#    endif\n#  endif\n#else\n    flags += 1L << 24;\n#  ifdef NO_snprintf\n    flags += 1L << 25;\n#    ifdef HAS_sprintf_void\n    flags += 1L << 26;\n#    endif\n#  else\n#    ifdef HAS_snprintf_void\n    flags += 1L << 26;\n#    endif\n#  endif\n#endif\n    return flags;\n}\n\n#ifdef DEBUG\n\n#  ifndef verbose\n#    define verbose 0\n#  endif\nint ZLIB_INTERNAL z_verbose = verbose;\n\nvoid ZLIB_INTERNAL z_error (m)\n    char *m;\n{\n    fprintf(stderr, \"%s\\n\", m);\n    exit(1);\n}\n#endif\n\n/* exported to allow conversion of error code to string for compress() and\n * uncompress()\n */\nconst char * ZEXPORT zError(err)\n    int err;\n{\n    return ERR_MSG(err);\n}\n\n#if defined(_WIN32_WCE)\n    /* The Microsoft C Run-Time Library for Windows CE doesn't have\n     * errno.  We define it as a global variable to simplify porting.\n     * Its value is always 0 and should not be used.\n     */\n    int errno = 0;\n#endif\n\n#ifndef HAVE_MEMCPY\n\nvoid ZLIB_INTERNAL zmemcpy(dest, source, len)\n    Bytef* dest;\n    const Bytef* source;\n    uInt  len;\n{\n    if (len == 0) return;\n    do {\n        *dest++ = *source++; /* ??? to be unrolled */\n    } while (--len != 0);\n}\n\nint ZLIB_INTERNAL zmemcmp(s1, s2, len)\n    const Bytef* s1;\n    const Bytef* s2;\n    uInt  len;\n{\n    uInt j;\n\n    for (j = 0; j < len; j++) {\n        if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;\n    }\n    return 0;\n}\n\nvoid ZLIB_INTERNAL zmemzero(dest, len)\n    Bytef* dest;\n    uInt  len;\n{\n    if (len == 0) return;\n    do {\n        *dest++ = 0;  /* ??? to be unrolled */\n    } while (--len != 0);\n}\n#endif\n\n#ifndef Z_SOLO\n\n#ifdef SYS16BIT\n\n#ifdef __TURBOC__\n/* Turbo C in 16-bit mode */\n\n#  define MY_ZCALLOC\n\n/* Turbo C malloc() does not allow dynamic allocation of 64K bytes\n * and farmalloc(64K) returns a pointer with an offset of 8, so we\n * must fix the pointer. Warning: the pointer must be put back to its\n * original form in order to free it, use zcfree().\n */\n\n#define MAX_PTR 10\n/* 10*64K = 640K */\n\nlocal int next_ptr = 0;\n\ntypedef struct ptr_table_s {\n    voidpf org_ptr;\n    voidpf new_ptr;\n} ptr_table;\n\nlocal ptr_table table[MAX_PTR];\n/* This table is used to remember the original form of pointers\n * to large buffers (64K). Such pointers are normalized with a zero offset.\n * Since MSDOS is not a preemptive multitasking OS, this table is not\n * protected from concurrent access. This hack doesn't work anyway on\n * a protected system like OS/2. Use Microsoft C instead.\n */\n\nvoidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size)\n{\n    voidpf buf = opaque; /* just to make some compilers happy */\n    ulg bsize = (ulg)items*size;\n\n    /* If we allocate less than 65520 bytes, we assume that farmalloc\n     * will return a usable pointer which doesn't have to be normalized.\n     */\n    if (bsize < 65520L) {\n        buf = farmalloc(bsize);\n        if (*(ush*)&buf != 0) return buf;\n    } else {\n        buf = farmalloc(bsize + 16L);\n    }\n    if (buf == NULL || next_ptr >= MAX_PTR) return NULL;\n    table[next_ptr].org_ptr = buf;\n\n    /* Normalize the pointer to seg:0 */\n    *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4;\n    *(ush*)&buf = 0;\n    table[next_ptr++].new_ptr = buf;\n    return buf;\n}\n\nvoid ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)\n{\n    int n;\n    if (*(ush*)&ptr != 0) { /* object < 64K */\n        farfree(ptr);\n        return;\n    }\n    /* Find the original pointer */\n    for (n = 0; n < next_ptr; n++) {\n        if (ptr != table[n].new_ptr) continue;\n\n        farfree(table[n].org_ptr);\n        while (++n < next_ptr) {\n            table[n-1] = table[n];\n        }\n        next_ptr--;\n        return;\n    }\n    ptr = opaque; /* just to make some compilers happy */\n    Assert(0, \"zcfree: ptr not found\");\n}\n\n#endif /* __TURBOC__ */\n\n\n#ifdef M_I86\n/* Microsoft C in 16-bit mode */\n\n#  define MY_ZCALLOC\n\n#if (!defined(_MSC_VER) || (_MSC_VER <= 600))\n#  define _halloc  halloc\n#  define _hfree   hfree\n#endif\n\nvoidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size)\n{\n    if (opaque) opaque = 0; /* to make compiler happy */\n    return _halloc((long)items, size);\n}\n\nvoid ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)\n{\n    if (opaque) opaque = 0; /* to make compiler happy */\n    _hfree(ptr);\n}\n\n#endif /* M_I86 */\n\n#endif /* SYS16BIT */\n\n\n#ifndef MY_ZCALLOC /* Any system without a special alloc function */\n\n#ifndef STDC\nextern voidp  malloc OF((uInt size));\nextern voidp  calloc OF((uInt items, uInt size));\nextern void   free   OF((voidpf ptr));\n#endif\n\nvoidpf ZLIB_INTERNAL zcalloc (opaque, items, size)\n    voidpf opaque;\n    unsigned items;\n    unsigned size;\n{\n    if (opaque) items += size - size; /* make compiler happy */\n    return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :\n                              (voidpf)calloc(items, size);\n}\n\nvoid ZLIB_INTERNAL zcfree (opaque, ptr)\n    voidpf opaque;\n    voidpf ptr;\n{\n    free(ptr);\n    if (opaque) return; /* make compiler happy */\n}\n\n#endif /* MY_ZCALLOC */\n\n#endif /* !Z_SOLO */\n"
  },
  {
    "path": "ext/zlib/zutil.h",
    "content": "/* zutil.h -- internal interface and configuration of the compression library\n * Copyright (C) 1995-2013 Jean-loup Gailly.\n * For conditions of distribution and use, see copyright notice in zlib.h\n */\n\n/* WARNING: this file should *not* be used by applications. It is\n   part of the implementation of the compression library and is\n   subject to change. Applications should only use zlib.h.\n */\n\n/* @(#) $Id$ */\n\n#ifndef ZUTIL_H\n#define ZUTIL_H\n\n#ifdef HAVE_HIDDEN\n#  define ZLIB_INTERNAL __attribute__((visibility (\"hidden\")))\n#else\n#  define ZLIB_INTERNAL\n#endif\n\n#include \"zlib.h\"\n\n#if defined(STDC) && !defined(Z_SOLO)\n#  if !(defined(_WIN32_WCE) && defined(_MSC_VER))\n#    include <stddef.h>\n#  endif\n#  include <string.h>\n#  include <stdlib.h>\n#endif\n\n#ifdef Z_SOLO\n   typedef long ptrdiff_t;  /* guess -- will be caught if guess is wrong */\n#endif\n\n#ifndef local\n#  define local static\n#endif\n/* compile with -Dlocal if your debugger can't find static symbols */\n\ntypedef unsigned char  uch;\ntypedef uch FAR uchf;\ntypedef unsigned short ush;\ntypedef ush FAR ushf;\ntypedef unsigned long  ulg;\n\nextern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */\n/* (size given to avoid silly warnings with Visual C++) */\n\n#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]\n\n#define ERR_RETURN(strm,err) \\\n  return (strm->msg = ERR_MSG(err), (err))\n/* To be used only when the state is known to be valid */\n\n        /* common constants */\n\n#ifndef DEF_WBITS\n#  define DEF_WBITS MAX_WBITS\n#endif\n/* default windowBits for decompression. MAX_WBITS is for compression only */\n\n#if MAX_MEM_LEVEL >= 8\n#  define DEF_MEM_LEVEL 8\n#else\n#  define DEF_MEM_LEVEL  MAX_MEM_LEVEL\n#endif\n/* default memLevel */\n\n#define STORED_BLOCK 0\n#define STATIC_TREES 1\n#define DYN_TREES    2\n/* The three kinds of block type */\n\n#define MIN_MATCH  3\n#define MAX_MATCH  258\n/* The minimum and maximum match lengths */\n\n#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */\n\n        /* target dependencies */\n\n#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))\n#  define OS_CODE  0x00\n#  ifndef Z_SOLO\n#    if defined(__TURBOC__) || defined(__BORLANDC__)\n#      if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))\n         /* Allow compilation with ANSI keywords only enabled */\n         void _Cdecl farfree( void *block );\n         void *_Cdecl farmalloc( unsigned long nbytes );\n#      else\n#        include <alloc.h>\n#      endif\n#    else /* MSC or DJGPP */\n#      include <malloc.h>\n#    endif\n#  endif\n#endif\n\n#ifdef AMIGA\n#  define OS_CODE  0x01\n#endif\n\n#if defined(VAXC) || defined(VMS)\n#  define OS_CODE  0x02\n#  define F_OPEN(name, mode) \\\n     fopen((name), (mode), \"mbc=60\", \"ctx=stm\", \"rfm=fix\", \"mrs=512\")\n#endif\n\n#if defined(ATARI) || defined(atarist)\n#  define OS_CODE  0x05\n#endif\n\n#ifdef OS2\n#  define OS_CODE  0x06\n#  if defined(M_I86) && !defined(Z_SOLO)\n#    include <malloc.h>\n#  endif\n#endif\n\n#if defined(MACOS) || defined(TARGET_OS_MAC)\n#  define OS_CODE  0x07\n#  ifndef Z_SOLO\n#    if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os\n#      include <unix.h> /* for fdopen */\n#    else\n#      ifndef fdopen\n#        define fdopen(fd,mode) NULL /* No fdopen() */\n#      endif\n#    endif\n#  endif\n#endif\n\n#ifdef TOPS20\n#  define OS_CODE  0x0a\n#endif\n\n#ifdef WIN32\n#  ifndef __CYGWIN__  /* Cygwin is Unix, not Win32 */\n#    define OS_CODE  0x0b\n#  endif\n#endif\n\n#ifdef __50SERIES /* Prime/PRIMOS */\n#  define OS_CODE  0x0f\n#endif\n\n#if defined(_BEOS_) || defined(RISCOS)\n#  define fdopen(fd,mode) NULL /* No fdopen() */\n#endif\n\n#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX\n#  if defined(_WIN32_WCE)\n#    define fdopen(fd,mode) NULL /* No fdopen() */\n#    ifndef _PTRDIFF_T_DEFINED\n       typedef int ptrdiff_t;\n#      define _PTRDIFF_T_DEFINED\n#    endif\n#  else\n#    define fdopen(fd,type)  _fdopen(fd,type)\n#  endif\n#endif\n\n#if defined(__BORLANDC__) && !defined(MSDOS)\n  #pragma warn -8004\n  #pragma warn -8008\n  #pragma warn -8066\n#endif\n\n/* provide prototypes for these when building zlib without LFS */\n#if !defined(_WIN32) && \\\n    (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)\n    ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));\n    ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));\n#endif\n\n        /* common defaults */\n\n#ifndef OS_CODE\n#  define OS_CODE  0x03  /* assume Unix */\n#endif\n\n#ifndef F_OPEN\n#  define F_OPEN(name, mode) fopen((name), (mode))\n#endif\n\n         /* functions */\n\n#if defined(pyr) || defined(Z_SOLO)\n#  define NO_MEMCPY\n#endif\n#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)\n /* Use our own functions for small and medium model with MSC <= 5.0.\n  * You may have to use the same strategy for Borland C (untested).\n  * The __SC__ check is for Symantec.\n  */\n#  define NO_MEMCPY\n#endif\n#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)\n#  define HAVE_MEMCPY\n#endif\n#ifdef HAVE_MEMCPY\n#  ifdef SMALL_MEDIUM /* MSDOS small or medium model */\n#    define zmemcpy _fmemcpy\n#    define zmemcmp _fmemcmp\n#    define zmemzero(dest, len) _fmemset(dest, 0, len)\n#  else\n#    define zmemcpy memcpy\n#    define zmemcmp memcmp\n#    define zmemzero(dest, len) memset(dest, 0, len)\n#  endif\n#else\n   void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));\n   int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));\n   void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len));\n#endif\n\n/* Diagnostic functions */\n#ifdef DEBUG\n#  include <stdio.h>\n   extern int ZLIB_INTERNAL z_verbose;\n   extern void ZLIB_INTERNAL z_error OF((char *m));\n#  define Assert(cond,msg) {if(!(cond)) z_error(msg);}\n#  define Trace(x) {if (z_verbose>=0) fprintf x ;}\n#  define Tracev(x) {if (z_verbose>0) fprintf x ;}\n#  define Tracevv(x) {if (z_verbose>1) fprintf x ;}\n#  define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}\n#  define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}\n#else\n#  define Assert(cond,msg)\n#  define Trace(x)\n#  define Tracev(x)\n#  define Tracevv(x)\n#  define Tracec(c,x)\n#  define Tracecv(c,x)\n#endif\n\n#ifndef Z_SOLO\n   voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,\n                                    unsigned size));\n   void ZLIB_INTERNAL zcfree  OF((voidpf opaque, voidpf ptr));\n#endif\n\n#define ZALLOC(strm, items, size) \\\n           (*((strm)->zalloc))((strm)->opaque, (items), (size))\n#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))\n#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}\n\n/* Reverse the bytes in a 32-bit value */\n#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \\\n                    (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))\n\n#endif /* ZUTIL_H */\n"
  },
  {
    "path": "makefile.deps",
    "content": "## Header-dependencies for src\\* and src\\*\\*\r\n### the list below is auto-generated by update_dependencies.py\r\nB=$(BASEDIR)\r\n$(ODLL)\\CEpubFilter.obj: $B\\src\\BaseEngine.h $B\\src\\EbookBase.h $B\\src\\EbookDoc.h\r\n$(ODLL)\\CEpubFilter.obj: $B\\src\\ifilter\\CEpubFilter.h $B\\src\\ifilter\\FilterBase.h $B\\src\\ifilter\\PdfFilter.h\r\n$(ODLL)\\CEpubFilter.obj: $B\\src\\utils\\ArchUtil.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(ODLL)\\CEpubFilter.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\HtmlPullParser.h\r\n$(ODLL)\\CEpubFilter.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(ODLL)\\CEpubFilter.obj: $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(ODLL)\\CPdfFilter.obj: $B\\src\\BaseEngine.h $B\\src\\ifilter\\CPdfFilter.h $B\\src\\ifilter\\FilterBase.h\r\n$(ODLL)\\CPdfFilter.obj: $B\\src\\ifilter\\PdfFilter.h $B\\src\\PdfEngine.h $B\\src\\utils\\BaseUtil.h\r\n$(ODLL)\\CPdfFilter.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(ODLL)\\CPdfFilter.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(ODLL)\\CPdfFilter.obj: $B\\src\\utils\\WinUtil.h\r\n$(ODLL)\\CTeXFilter.obj: $B\\src\\ifilter\\CTeXFilter.h $B\\src\\ifilter\\FilterBase.h $B\\src\\ifilter\\PdfFilter.h\r\n$(ODLL)\\CTeXFilter.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(ODLL)\\CTeXFilter.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(ODLL)\\CTeXFilter.obj: $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(ODLL)\\PdfFilterDll.obj: $B\\src\\ifilter\\CEpubFilter.h $B\\src\\ifilter\\CPdfFilter.h $B\\src\\ifilter\\CTeXFilter.h\r\n$(ODLL)\\PdfFilterDll.obj: $B\\src\\ifilter\\FilterBase.h $B\\src\\ifilter\\PdfFilter.h $B\\src\\utils\\BaseUtil.h\r\n$(ODLL)\\PdfFilterDll.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(ODLL)\\PdfFilterDll.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(ODLL)\\PdfFilterDll.obj: $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(ODLL)\\PdfPreview.obj: $B\\src\\BaseEngine.h $B\\src\\DjVuEngine.h $B\\src\\EbookEngine.h\r\n$(ODLL)\\PdfPreview.obj: $B\\src\\ImagesEngine.h $B\\src\\mui\\MiniMui.h $B\\src\\PdfEngine.h\r\n$(ODLL)\\PdfPreview.obj: $B\\src\\previewer\\PdfPreview.h $B\\src\\previewer\\PdfPreviewBase.h $B\\src\\utils\\BaseUtil.h\r\n$(ODLL)\\PdfPreview.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(ODLL)\\PdfPreview.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(ODLL)\\PdfPreview.obj: $B\\src\\utils\\WinUtil.h\r\n$(ODLL)\\PdfPreviewDll.obj: $B\\src\\BaseEngine.h $B\\src\\previewer\\PdfPreview.h $B\\src\\previewer\\PdfPreviewBase.h\r\n$(ODLL)\\PdfPreviewDll.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\FileUtil.h\r\n$(ODLL)\\PdfPreviewDll.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(ODLL)\\PdfPreviewDll.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OM)\\MemTraceDll.obj: $B\\src\\memtrace\\MemTraceDll.h $B\\src\\memtrace\\nsWindowsDllInterceptor.h $B\\src\\utils\\BaseUtil.h\r\n$(OM)\\MemTraceDll.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\DebugLog.h $B\\src\\utils\\GeomUtil.h\r\n$(OM)\\MemTraceDll.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OM)\\MemTraceDll.obj: $B\\src\\utils\\Timer.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OMUI)\\MiniMui.obj: $B\\src\\mui\\MiniMui.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OMUI)\\MiniMui.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OMUI)\\MiniMui.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OMUI)\\Mui.obj: $B\\src\\mui\\Mui.h $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h\r\n$(OMUI)\\Mui.obj: $B\\src\\mui\\MuiControl.h $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiEventMgr.h\r\n$(OMUI)\\Mui.obj: $B\\src\\mui\\MuiFromText.h $B\\src\\mui\\MuiGrid.h $B\\src\\mui\\MuiHwndWrapper.h\r\n$(OMUI)\\Mui.obj: $B\\src\\mui\\MuiLayout.h $B\\src\\mui\\MuiPainter.h $B\\src\\mui\\MuiScrollBar.h\r\n$(OMUI)\\Mui.obj: $B\\src\\mui\\TextRender.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OMUI)\\Mui.obj: $B\\src\\utils\\DebugLog.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h\r\n$(OMUI)\\Mui.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OMUI)\\Mui.obj: $B\\src\\utils\\Vec.h\r\n$(OMUI)\\MuiBase.obj: $B\\src\\mui\\Mui.h $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h\r\n$(OMUI)\\MuiBase.obj: $B\\src\\mui\\MuiControl.h $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiEventMgr.h\r\n$(OMUI)\\MuiBase.obj: $B\\src\\mui\\MuiFromText.h $B\\src\\mui\\MuiGrid.h $B\\src\\mui\\MuiHwndWrapper.h\r\n$(OMUI)\\MuiBase.obj: $B\\src\\mui\\MuiLayout.h $B\\src\\mui\\MuiPainter.h $B\\src\\mui\\MuiScrollBar.h\r\n$(OMUI)\\MuiBase.obj: $B\\src\\mui\\TextRender.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OMUI)\\MuiBase.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\mingw_compat.h\r\n$(OMUI)\\MuiBase.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OMUI)\\MuiBase.obj: $B\\src\\utils\\WinUtil.h\r\n$(OMUI)\\MuiButton.obj: $B\\src\\mui\\Mui.h $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h\r\n$(OMUI)\\MuiButton.obj: $B\\src\\mui\\MuiControl.h $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiEventMgr.h\r\n$(OMUI)\\MuiButton.obj: $B\\src\\mui\\MuiFromText.h $B\\src\\mui\\MuiGrid.h $B\\src\\mui\\MuiHwndWrapper.h\r\n$(OMUI)\\MuiButton.obj: $B\\src\\mui\\MuiLayout.h $B\\src\\mui\\MuiPainter.h $B\\src\\mui\\MuiScrollBar.h\r\n$(OMUI)\\MuiButton.obj: $B\\src\\mui\\TextRender.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OMUI)\\MuiButton.obj: $B\\src\\utils\\DebugLog.h $B\\src\\utils\\GdiPlusUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(OMUI)\\MuiButton.obj: $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OMUI)\\MuiButton.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OMUI)\\MuiControl.obj: $B\\src\\mui\\Mui.h $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h\r\n$(OMUI)\\MuiControl.obj: $B\\src\\mui\\MuiControl.h $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiEventMgr.h\r\n$(OMUI)\\MuiControl.obj: $B\\src\\mui\\MuiFromText.h $B\\src\\mui\\MuiGrid.h $B\\src\\mui\\MuiHwndWrapper.h\r\n$(OMUI)\\MuiControl.obj: $B\\src\\mui\\MuiLayout.h $B\\src\\mui\\MuiPainter.h $B\\src\\mui\\MuiScrollBar.h\r\n$(OMUI)\\MuiControl.obj: $B\\src\\mui\\TextRender.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BitManip.h\r\n$(OMUI)\\MuiControl.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h\r\n$(OMUI)\\MuiControl.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OMUI)\\MuiControl.obj: $B\\src\\utils\\Vec.h\r\n$(OMUI)\\MuiCss.obj: $B\\src\\mui\\Mui.h $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h\r\n$(OMUI)\\MuiCss.obj: $B\\src\\mui\\MuiControl.h $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiEventMgr.h\r\n$(OMUI)\\MuiCss.obj: $B\\src\\mui\\MuiFromText.h $B\\src\\mui\\MuiGrid.h $B\\src\\mui\\MuiHwndWrapper.h\r\n$(OMUI)\\MuiCss.obj: $B\\src\\mui\\MuiLayout.h $B\\src\\mui\\MuiPainter.h $B\\src\\mui\\MuiScrollBar.h\r\n$(OMUI)\\MuiCss.obj: $B\\src\\mui\\TextRender.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OMUI)\\MuiCss.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\mingw_compat.h\r\n$(OMUI)\\MuiCss.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OMUI)\\MuiCss.obj: $B\\src\\utils\\VecSegmented.h\r\n$(OMUI)\\MuiDefs.obj: $B\\src\\mui\\MuiDefs.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OMUI)\\MuiDefs.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OMUI)\\MuiDefs.obj: $B\\src\\utils\\SerializeTxt.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OMUI)\\MuiEventMgr.obj: $B\\src\\mui\\Mui.h $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h\r\n$(OMUI)\\MuiEventMgr.obj: $B\\src\\mui\\MuiControl.h $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiEventMgr.h\r\n$(OMUI)\\MuiEventMgr.obj: $B\\src\\mui\\MuiFromText.h $B\\src\\mui\\MuiGrid.h $B\\src\\mui\\MuiHwndWrapper.h\r\n$(OMUI)\\MuiEventMgr.obj: $B\\src\\mui\\MuiLayout.h $B\\src\\mui\\MuiPainter.h $B\\src\\mui\\MuiScrollBar.h\r\n$(OMUI)\\MuiEventMgr.obj: $B\\src\\mui\\TextRender.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BitManip.h\r\n$(OMUI)\\MuiEventMgr.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\DebugLog.h $B\\src\\utils\\GeomUtil.h\r\n$(OMUI)\\MuiEventMgr.obj: $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OMUI)\\MuiEventMgr.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Timer.h $B\\src\\utils\\Vec.h\r\n$(OMUI)\\MuiEventMgr.obj: $B\\src\\wingui\\FrameRateWnd.h\r\n$(OMUI)\\MuiFromText.obj: $B\\src\\mui\\Mui.h $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h\r\n$(OMUI)\\MuiFromText.obj: $B\\src\\mui\\MuiControl.h $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiDefs.h\r\n$(OMUI)\\MuiFromText.obj: $B\\src\\mui\\MuiEventMgr.h $B\\src\\mui\\MuiFromText.h $B\\src\\mui\\MuiGrid.h\r\n$(OMUI)\\MuiFromText.obj: $B\\src\\mui\\MuiHwndWrapper.h $B\\src\\mui\\MuiLayout.h $B\\src\\mui\\MuiPainter.h\r\n$(OMUI)\\MuiFromText.obj: $B\\src\\mui\\MuiScrollBar.h $B\\src\\mui\\SvgPath.h $B\\src\\mui\\TextRender.h\r\n$(OMUI)\\MuiFromText.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OMUI)\\MuiFromText.obj: $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OMUI)\\MuiFromText.obj: $B\\src\\utils\\SerializeTxt.h $B\\src\\utils\\StrSlice.h $B\\src\\utils\\StrUtil.h\r\n$(OMUI)\\MuiFromText.obj: $B\\src\\utils\\TxtParser.h $B\\src\\utils\\Vec.h\r\n$(OMUI)\\MuiGrid.obj: $B\\src\\mui\\Mui.h $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h\r\n$(OMUI)\\MuiGrid.obj: $B\\src\\mui\\MuiControl.h $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiEventMgr.h\r\n$(OMUI)\\MuiGrid.obj: $B\\src\\mui\\MuiFromText.h $B\\src\\mui\\MuiGrid.h $B\\src\\mui\\MuiHwndWrapper.h\r\n$(OMUI)\\MuiGrid.obj: $B\\src\\mui\\MuiLayout.h $B\\src\\mui\\MuiPainter.h $B\\src\\mui\\MuiScrollBar.h\r\n$(OMUI)\\MuiGrid.obj: $B\\src\\mui\\TextRender.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OMUI)\\MuiGrid.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\mingw_compat.h\r\n$(OMUI)\\MuiGrid.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OMUI)\\MuiHwndWrapper.obj: $B\\src\\mui\\Mui.h $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h\r\n$(OMUI)\\MuiHwndWrapper.obj: $B\\src\\mui\\MuiControl.h $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiEventMgr.h\r\n$(OMUI)\\MuiHwndWrapper.obj: $B\\src\\mui\\MuiFromText.h $B\\src\\mui\\MuiGrid.h $B\\src\\mui\\MuiHwndWrapper.h\r\n$(OMUI)\\MuiHwndWrapper.obj: $B\\src\\mui\\MuiLayout.h $B\\src\\mui\\MuiPainter.h $B\\src\\mui\\MuiScrollBar.h\r\n$(OMUI)\\MuiHwndWrapper.obj: $B\\src\\mui\\TextRender.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OMUI)\\MuiHwndWrapper.obj: $B\\src\\utils\\DebugLog.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h\r\n$(OMUI)\\MuiHwndWrapper.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OMUI)\\MuiHwndWrapper.obj: $B\\src\\utils\\Timer.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OMUI)\\MuiHwndWrapper.obj: $B\\src\\wingui\\FrameRateWnd.h\r\n$(OMUI)\\MuiLayout.obj: $B\\src\\mui\\Mui.h $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h\r\n$(OMUI)\\MuiLayout.obj: $B\\src\\mui\\MuiControl.h $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiEventMgr.h\r\n$(OMUI)\\MuiLayout.obj: $B\\src\\mui\\MuiFromText.h $B\\src\\mui\\MuiGrid.h $B\\src\\mui\\MuiHwndWrapper.h\r\n$(OMUI)\\MuiLayout.obj: $B\\src\\mui\\MuiLayout.h $B\\src\\mui\\MuiPainter.h $B\\src\\mui\\MuiScrollBar.h\r\n$(OMUI)\\MuiLayout.obj: $B\\src\\mui\\TextRender.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OMUI)\\MuiLayout.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\mingw_compat.h\r\n$(OMUI)\\MuiLayout.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OMUI)\\MuiPainter.obj: $B\\src\\mui\\Mui.h $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h\r\n$(OMUI)\\MuiPainter.obj: $B\\src\\mui\\MuiControl.h $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiEventMgr.h\r\n$(OMUI)\\MuiPainter.obj: $B\\src\\mui\\MuiFromText.h $B\\src\\mui\\MuiGrid.h $B\\src\\mui\\MuiHwndWrapper.h\r\n$(OMUI)\\MuiPainter.obj: $B\\src\\mui\\MuiLayout.h $B\\src\\mui\\MuiPainter.h $B\\src\\mui\\MuiScrollBar.h\r\n$(OMUI)\\MuiPainter.obj: $B\\src\\mui\\TextRender.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OMUI)\\MuiPainter.obj: $B\\src\\utils\\DebugLog.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h\r\n$(OMUI)\\MuiPainter.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OMUI)\\MuiPainter.obj: $B\\src\\utils\\Vec.h\r\n$(OMUI)\\MuiScrollBar.obj: $B\\src\\mui\\Mui.h $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h\r\n$(OMUI)\\MuiScrollBar.obj: $B\\src\\mui\\MuiControl.h $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiEventMgr.h\r\n$(OMUI)\\MuiScrollBar.obj: $B\\src\\mui\\MuiFromText.h $B\\src\\mui\\MuiGrid.h $B\\src\\mui\\MuiHwndWrapper.h\r\n$(OMUI)\\MuiScrollBar.obj: $B\\src\\mui\\MuiLayout.h $B\\src\\mui\\MuiPainter.h $B\\src\\mui\\MuiScrollBar.h\r\n$(OMUI)\\MuiScrollBar.obj: $B\\src\\mui\\TextRender.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BitManip.h\r\n$(OMUI)\\MuiScrollBar.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h\r\n$(OMUI)\\MuiScrollBar.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OMUI)\\MuiScrollBar.obj: $B\\src\\utils\\Vec.h\r\n$(OMUI)\\SvgPath.obj: $B\\src\\mui\\SvgPath.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OMUI)\\SvgPath.obj: $B\\src\\utils\\GdiPlusUtil.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OMUI)\\SvgPath.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OMUI)\\SvgPath.obj: $B\\src\\utils\\VecSegmented.h\r\n$(OMUI)\\SvgPath_ut.obj: $B\\src\\mui\\SvgPath.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OMUI)\\SvgPath_ut.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OMUI)\\SvgPath_ut.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\UtAssert.h $B\\src\\utils\\Vec.h\r\n$(OMUI)\\SvgPath_ut.obj: $B\\src\\utils\\VecSegmented.h\r\n$(OMUI)\\TextRender.obj: $B\\src\\mui\\Mui.h $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h\r\n$(OMUI)\\TextRender.obj: $B\\src\\mui\\MuiControl.h $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiEventMgr.h\r\n$(OMUI)\\TextRender.obj: $B\\src\\mui\\MuiFromText.h $B\\src\\mui\\MuiGrid.h $B\\src\\mui\\MuiHwndWrapper.h\r\n$(OMUI)\\TextRender.obj: $B\\src\\mui\\MuiLayout.h $B\\src\\mui\\MuiPainter.h $B\\src\\mui\\MuiScrollBar.h\r\n$(OMUI)\\TextRender.obj: $B\\src\\mui\\TextRender.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OMUI)\\TextRender.obj: $B\\src\\utils\\GdiPlusUtil.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h\r\n$(OMUI)\\TextRender.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OMUI)\\TextRender.obj: $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\AppPrefs.obj: $B\\src\\AppPrefs.h $B\\src\\AppTools.h $B\\src\\BaseEngine.h\r\n$(OS)\\AppPrefs.obj: $B\\src\\EbookEngine.h $B\\src\\Favorites.h $B\\src\\FileHistory.h\r\n$(OS)\\AppPrefs.obj: $B\\src\\GlobalPrefs.h $B\\src\\SettingsStructs.h $B\\src\\SumatraPDF.h\r\n$(OS)\\AppPrefs.obj: $B\\src\\Toolbar.h $B\\src\\Translations.h $B\\src\\utils\\BaseUtil.h\r\n$(OS)\\AppPrefs.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\FileTransactions.h $B\\src\\utils\\FileUtil.h\r\n$(OS)\\AppPrefs.obj: $B\\src\\utils\\FileWatcher.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\AppPrefs.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\UITask.h\r\n$(OS)\\AppPrefs.obj: $B\\src\\utils\\Vec.h $B\\src\\WindowInfo.h\r\n$(OS)\\AppTools.obj: $B\\src\\AppTools.h $B\\src\\Translations.h $B\\src\\utils\\BaseUtil.h\r\n$(OS)\\AppTools.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\CmdLineParser.h $B\\src\\utils\\DbgHelpDyn.h\r\n$(OS)\\AppTools.obj: $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\AppTools.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OS)\\AppTools.obj: $B\\src\\utils\\WinDynCalls.h $B\\src\\utils\\WinUtil.h $B\\src\\Version.h\r\n$(OS)\\AppUtil.obj: $B\\src\\AppUtil.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OS)\\AppUtil.obj: $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\AppUtil.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OS)\\Canvas.obj: $B\\src\\BaseEngine.h $B\\src\\Canvas.h $B\\src\\Caption.h\r\n$(OS)\\Canvas.obj: $B\\src\\Controller.h $B\\src\\DisplayModel.h $B\\src\\Doc.h\r\n$(OS)\\Canvas.obj: $B\\src\\EbookController.h $B\\src\\EngineManager.h $B\\src\\GlobalPrefs.h\r\n$(OS)\\Canvas.obj: $B\\src\\Menu.h $B\\src\\Notifications.h $B\\src\\RenderCache.h\r\n$(OS)\\Canvas.obj: $B\\src\\resource.h $B\\src\\Search.h $B\\src\\Selection.h\r\n$(OS)\\Canvas.obj: $B\\src\\SettingsStructs.h $B\\src\\SumatraAbout.h $B\\src\\SumatraPDF.h\r\n$(OS)\\Canvas.obj: $B\\src\\TabInfo.h $B\\src\\Tabs.h $B\\src\\TextSearch.h\r\n$(OS)\\Canvas.obj: $B\\src\\TextSelection.h $B\\src\\Toolbar.h $B\\src\\Translations.h\r\n$(OS)\\Canvas.obj: $B\\src\\uia\\Provider.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OS)\\Canvas.obj: $B\\src\\utils\\Dpi.h $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\Canvas.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\Canvas.obj: $B\\src\\utils\\Timer.h $B\\src\\utils\\UITask.h $B\\src\\utils\\Vec.h\r\n$(OS)\\Canvas.obj: $B\\src\\utils\\WinDynCalls.h $B\\src\\utils\\WinUtil.h $B\\src\\WindowInfo.h\r\n$(OS)\\Canvas.obj: $B\\src\\wingui\\FrameRateWnd.h\r\n$(OS)\\Caption.obj: $B\\src\\Caption.h $B\\src\\SettingsStructs.h $B\\src\\SumatraPDF.h\r\n$(OS)\\Caption.obj: $B\\src\\Tabs.h $B\\src\\Translations.h $B\\src\\utils\\BaseUtil.h\r\n$(OS)\\Caption.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\Caption.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OS)\\Caption.obj: $B\\src\\utils\\WinDynCalls.h $B\\src\\utils\\WinUtil.h $B\\src\\WindowInfo.h\r\n$(OS)\\ChmDoc.obj: $B\\ext\\CHMlib\\src\\chm_lib.h $B\\src\\BaseEngine.h $B\\src\\ChmDoc.h\r\n$(OS)\\ChmDoc.obj: $B\\src\\EbookBase.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OS)\\ChmDoc.obj: $B\\src\\utils\\ByteReader.h $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\ChmDoc.obj: $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OS)\\ChmDoc.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\TrivialHtmlParser.h $B\\src\\utils\\Vec.h\r\n$(OS)\\ChmModel.obj: $B\\src\\BaseEngine.h $B\\src\\ChmDoc.h $B\\src\\ChmModel.h\r\n$(OS)\\ChmModel.obj: $B\\src\\Controller.h $B\\src\\EbookBase.h $B\\src\\GlobalPrefs.h\r\n$(OS)\\ChmModel.obj: $B\\src\\SettingsStructs.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OS)\\ChmModel.obj: $B\\src\\utils\\Dict.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlWindow.h\r\n$(OS)\\ChmModel.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\ChmModel.obj: $B\\src\\utils\\UITask.h $B\\src\\utils\\Vec.h\r\n$(OS)\\CrashHandler.obj: $B\\src\\AppTools.h $B\\src\\CrashHandler.h $B\\src\\SumatraPDF.h\r\n$(OS)\\CrashHandler.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\DbgHelpDyn.h\r\n$(OS)\\CrashHandler.obj: $B\\src\\utils\\DebugLog.h $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\CrashHandler.obj: $B\\src\\utils\\HttpUtil.h $B\\src\\utils\\LzmaSimpleArchive.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\CrashHandler.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OS)\\CrashHandler.obj: $B\\src\\utils\\WinDynCalls.h $B\\src\\utils\\WinUtil.h $B\\src\\Version.h\r\n$(OS)\\DialogSizer.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\DialogSizer.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\DialogSizer.obj: $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h $B\\src\\wingui\\DialogSizer.h\r\n$(OS)\\DisplayModel.obj: $B\\src\\BaseEngine.h $B\\src\\Controller.h $B\\src\\DisplayModel.h\r\n$(OS)\\DisplayModel.obj: $B\\src\\EngineManager.h $B\\src\\GlobalPrefs.h $B\\src\\PdfSync.h\r\n$(OS)\\DisplayModel.obj: $B\\src\\SettingsStructs.h $B\\src\\TextSearch.h $B\\src\\TextSelection.h\r\n$(OS)\\DisplayModel.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\DisplayModel.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\DisplayModel.obj: $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\DjVuEngine.obj: $B\\ext\\libdjvu\\ddjvuapi.h $B\\ext\\libdjvu\\miniexp.h $B\\src\\BaseEngine.h\r\n$(OS)\\DjVuEngine.obj: $B\\src\\DjVuEngine.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OS)\\DjVuEngine.obj: $B\\src\\utils\\ByteReader.h $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\DjVuEngine.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\DjVuEngine.obj: $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\Doc.obj: $B\\src\\BaseEngine.h $B\\src\\Doc.h $B\\src\\EbookBase.h\r\n$(OS)\\Doc.obj: $B\\src\\EbookDoc.h $B\\src\\EbookFormatter.h $B\\src\\HtmlFormatter.h\r\n$(OS)\\Doc.obj: $B\\src\\MobiDoc.h $B\\src\\mui\\Mui.h $B\\src\\mui\\MuiBase.h\r\n$(OS)\\Doc.obj: $B\\src\\mui\\MuiButton.h $B\\src\\mui\\MuiControl.h $B\\src\\mui\\MuiCss.h\r\n$(OS)\\Doc.obj: $B\\src\\mui\\MuiEventMgr.h $B\\src\\mui\\MuiFromText.h $B\\src\\mui\\MuiGrid.h\r\n$(OS)\\Doc.obj: $B\\src\\mui\\MuiHwndWrapper.h $B\\src\\mui\\MuiLayout.h $B\\src\\mui\\MuiPainter.h\r\n$(OS)\\Doc.obj: $B\\src\\mui\\MuiScrollBar.h $B\\src\\mui\\TextRender.h $B\\src\\utils\\ArchUtil.h\r\n$(OS)\\Doc.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\Doc.obj: $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\HtmlPullParser.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\Doc.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OS)\\EbookController.obj: $B\\src\\BaseEngine.h $B\\src\\Controller.h $B\\src\\Doc.h\r\n$(OS)\\EbookController.obj: $B\\src\\EbookBase.h $B\\src\\EbookController.h $B\\src\\EbookControls.h\r\n$(OS)\\EbookController.obj: $B\\src\\EbookDoc.h $B\\src\\GlobalPrefs.h $B\\src\\HtmlFormatter.h\r\n$(OS)\\EbookController.obj: $B\\src\\MobiDoc.h $B\\src\\mui\\Mui.h $B\\src\\mui\\MuiBase.h\r\n$(OS)\\EbookController.obj: $B\\src\\mui\\MuiButton.h $B\\src\\mui\\MuiControl.h $B\\src\\mui\\MuiCss.h\r\n$(OS)\\EbookController.obj: $B\\src\\mui\\MuiEventMgr.h $B\\src\\mui\\MuiFromText.h $B\\src\\mui\\MuiGrid.h\r\n$(OS)\\EbookController.obj: $B\\src\\mui\\MuiHwndWrapper.h $B\\src\\mui\\MuiLayout.h $B\\src\\mui\\MuiPainter.h\r\n$(OS)\\EbookController.obj: $B\\src\\mui\\MuiScrollBar.h $B\\src\\mui\\TextRender.h $B\\src\\SettingsStructs.h\r\n$(OS)\\EbookController.obj: $B\\src\\Translations.h $B\\src\\utils\\ArchUtil.h $B\\src\\utils\\BaseUtil.h\r\n$(OS)\\EbookController.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\DebugLog.h $B\\src\\utils\\GdiPlusUtil.h\r\n$(OS)\\EbookController.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\HtmlPullParser.h\r\n$(OS)\\EbookController.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\EbookController.obj: $B\\src\\utils\\ThreadUtil.h $B\\src\\utils\\Timer.h $B\\src\\utils\\TrivialHtmlParser.h\r\n$(OS)\\EbookController.obj: $B\\src\\utils\\Vec.h\r\n$(OS)\\EbookControls.obj: $B\\src\\EbookBase.h $B\\src\\EbookControls.h $B\\src\\HtmlFormatter.h\r\n$(OS)\\EbookControls.obj: $B\\src\\mui\\Mui.h $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h\r\n$(OS)\\EbookControls.obj: $B\\src\\mui\\MuiControl.h $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiEventMgr.h\r\n$(OS)\\EbookControls.obj: $B\\src\\mui\\MuiFromText.h $B\\src\\mui\\MuiGrid.h $B\\src\\mui\\MuiHwndWrapper.h\r\n$(OS)\\EbookControls.obj: $B\\src\\mui\\MuiLayout.h $B\\src\\mui\\MuiPainter.h $B\\src\\mui\\MuiScrollBar.h\r\n$(OS)\\EbookControls.obj: $B\\src\\mui\\TextRender.h $B\\src\\MuiEbookPageDef.h $B\\src\\PagesLayoutDef.h\r\n$(OS)\\EbookControls.obj: $B\\src\\resource.h $B\\src\\SumatraPDF.h $B\\src\\utils\\BaseUtil.h\r\n$(OS)\\EbookControls.obj: $B\\src\\utils\\BitManip.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\DebugLog.h\r\n$(OS)\\EbookControls.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\EbookControls.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\SerializeTxt.h $B\\src\\utils\\StrSlice.h\r\n$(OS)\\EbookControls.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Timer.h $B\\src\\utils\\TrivialHtmlParser.h\r\n$(OS)\\EbookControls.obj: $B\\src\\utils\\TxtParser.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\EbookDoc.obj: $B\\src\\BaseEngine.h $B\\src\\EbookBase.h $B\\src\\EbookDoc.h\r\n$(OS)\\EbookDoc.obj: $B\\src\\MobiDoc.h $B\\src\\utils\\ArchUtil.h $B\\src\\utils\\BaseUtil.h\r\n$(OS)\\EbookDoc.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\EbookDoc.obj: $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\HtmlPullParser.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\EbookDoc.obj: $B\\src\\utils\\PalmDbReader.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\EbookDoc.obj: $B\\src\\utils\\TrivialHtmlParser.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\EbookEngine.obj: $B\\src\\BaseEngine.h $B\\src\\ChmDoc.h $B\\src\\EbookBase.h\r\n$(OS)\\EbookEngine.obj: $B\\src\\EbookDoc.h $B\\src\\EbookEngine.h $B\\src\\EbookFormatter.h\r\n$(OS)\\EbookEngine.obj: $B\\src\\HtmlFormatter.h $B\\src\\MobiDoc.h $B\\src\\mui\\Mui.h\r\n$(OS)\\EbookEngine.obj: $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h $B\\src\\mui\\MuiControl.h\r\n$(OS)\\EbookEngine.obj: $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiEventMgr.h $B\\src\\mui\\MuiFromText.h\r\n$(OS)\\EbookEngine.obj: $B\\src\\mui\\MuiGrid.h $B\\src\\mui\\MuiHwndWrapper.h $B\\src\\mui\\MuiLayout.h\r\n$(OS)\\EbookEngine.obj: $B\\src\\mui\\MuiPainter.h $B\\src\\mui\\MuiScrollBar.h $B\\src\\mui\\TextRender.h\r\n$(OS)\\EbookEngine.obj: $B\\src\\utils\\ArchUtil.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OS)\\EbookEngine.obj: $B\\src\\utils\\Dpi.h $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GdiPlusUtil.h\r\n$(OS)\\EbookEngine.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\HtmlPullParser.h\r\n$(OS)\\EbookEngine.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\PalmDbReader.h $B\\src\\utils\\Scoped.h\r\n$(OS)\\EbookEngine.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\TrivialHtmlParser.h $B\\src\\utils\\Vec.h\r\n$(OS)\\EbookEngine.obj: $B\\src\\utils\\WinUtil.h $B\\src\\utils\\ZipUtil.h\r\n$(OS)\\EbookFormatter.obj: $B\\src\\BaseEngine.h $B\\src\\EbookBase.h $B\\src\\EbookDoc.h\r\n$(OS)\\EbookFormatter.obj: $B\\src\\EbookFormatter.h $B\\src\\HtmlFormatter.h $B\\src\\MobiDoc.h\r\n$(OS)\\EbookFormatter.obj: $B\\src\\mui\\Mui.h $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h\r\n$(OS)\\EbookFormatter.obj: $B\\src\\mui\\MuiControl.h $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiEventMgr.h\r\n$(OS)\\EbookFormatter.obj: $B\\src\\mui\\MuiFromText.h $B\\src\\mui\\MuiGrid.h $B\\src\\mui\\MuiHwndWrapper.h\r\n$(OS)\\EbookFormatter.obj: $B\\src\\mui\\MuiLayout.h $B\\src\\mui\\MuiPainter.h $B\\src\\mui\\MuiScrollBar.h\r\n$(OS)\\EbookFormatter.obj: $B\\src\\mui\\TextRender.h $B\\src\\utils\\ArchUtil.h $B\\src\\utils\\BaseUtil.h\r\n$(OS)\\EbookFormatter.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GdiPlusUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\EbookFormatter.obj: $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\HtmlPullParser.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\EbookFormatter.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OS)\\EditCtrl.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BitManip.h $B\\src\\utils\\BuildConfig.h\r\n$(OS)\\EditCtrl.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OS)\\EditCtrl.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\EditCtrl.obj: $B\\src\\wingui\\EditCtrl.h\r\n$(OS)\\EngineDump.obj: $B\\src\\BaseEngine.h $B\\src\\DjVuEngine.h $B\\src\\EngineManager.h\r\n$(OS)\\EngineDump.obj: $B\\src\\FileModifications.h $B\\src\\mui\\MiniMui.h $B\\src\\PdfCreator.h\r\n$(OS)\\EngineDump.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\CmdLineParser.h\r\n$(OS)\\EngineDump.obj: $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GdiPlusUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\EngineDump.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\EngineDump.obj: $B\\src\\utils\\TgaReader.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\EngineManager.obj: $B\\src\\BaseEngine.h $B\\src\\DjVuEngine.h $B\\src\\EbookEngine.h\r\n$(OS)\\EngineManager.obj: $B\\src\\EngineManager.h $B\\src\\ImagesEngine.h $B\\src\\PdfEngine.h\r\n$(OS)\\EngineManager.obj: $B\\src\\PsEngine.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OS)\\EngineManager.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OS)\\EngineManager.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OS)\\ExternalViewers.obj: $B\\src\\BaseEngine.h $B\\src\\Controller.h $B\\src\\EngineManager.h\r\n$(OS)\\ExternalViewers.obj: $B\\src\\ExternalViewers.h $B\\src\\GlobalPrefs.h $B\\src\\SettingsStructs.h\r\n$(OS)\\ExternalViewers.obj: $B\\src\\SumatraPDF.h $B\\src\\TabInfo.h $B\\src\\utils\\BaseUtil.h\r\n$(OS)\\ExternalViewers.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\CmdLineParser.h $B\\src\\utils\\FileUtil.h\r\n$(OS)\\ExternalViewers.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OS)\\ExternalViewers.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\Favorites.obj: $B\\src\\AppPrefs.h $B\\src\\BaseEngine.h $B\\src\\Controller.h\r\n$(OS)\\Favorites.obj: $B\\src\\EngineManager.h $B\\src\\Favorites.h $B\\src\\FileHistory.h\r\n$(OS)\\Favorites.obj: $B\\src\\GlobalPrefs.h $B\\src\\Menu.h $B\\src\\resource.h\r\n$(OS)\\Favorites.obj: $B\\src\\SettingsStructs.h $B\\src\\SumatraDialogs.h $B\\src\\SumatraPDF.h\r\n$(OS)\\Favorites.obj: $B\\src\\TabInfo.h $B\\src\\Tabs.h $B\\src\\Translations.h\r\n$(OS)\\Favorites.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\Dpi.h\r\n$(OS)\\Favorites.obj: $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GdiPlusUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\Favorites.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\Favorites.obj: $B\\src\\utils\\UITask.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\Favorites.obj: $B\\src\\WindowInfo.h $B\\src\\wingui\\LabelWithCloseWnd.h\r\n$(OS)\\FileHistory.obj: $B\\src\\BaseEngine.h $B\\src\\FileHistory.h $B\\src\\GlobalPrefs.h\r\n$(OS)\\FileHistory.obj: $B\\src\\SettingsStructs.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OS)\\FileHistory.obj: $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\FileHistory.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OS)\\FileModifications.obj: $B\\src\\BaseEngine.h $B\\src\\FileModifications.h $B\\src\\utils\\BaseUtil.h\r\n$(OS)\\FileModifications.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\FileTransactions.h $B\\src\\utils\\FileUtil.h\r\n$(OS)\\FileModifications.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OS)\\FileModifications.obj: $B\\src\\utils\\SquareTreeParser.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OS)\\FileModifications.obj: $B\\src\\Version.h\r\n$(OS)\\FileThumbnails.obj: $B\\src\\AppTools.h $B\\src\\BaseEngine.h $B\\src\\FileHistory.h\r\n$(OS)\\FileThumbnails.obj: $B\\src\\FileThumbnails.h $B\\src\\SettingsStructs.h $B\\src\\utils\\BaseUtil.h\r\n$(OS)\\FileThumbnails.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\CryptoUtil.h $B\\src\\utils\\FileUtil.h\r\n$(OS)\\FileThumbnails.obj: $B\\src\\utils\\GdiPlusUtil.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\FileThumbnails.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OS)\\FileThumbnails.obj: $B\\src\\utils\\WinUtil.h\r\n$(OS)\\FrameRateWnd.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\FrameRateWnd.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\FrameRateWnd.obj: $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h $B\\src\\wingui\\FrameRateWnd.h\r\n$(OS)\\GlobalPrefs.obj: $B\\src\\BaseEngine.h $B\\src\\GlobalPrefs.h $B\\src\\SettingsStructs.h\r\n$(OS)\\GlobalPrefs.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\DebugLog.h\r\n$(OS)\\GlobalPrefs.obj: $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\GlobalPrefs.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\SettingsUtil.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\GlobalPrefs.obj: $B\\src\\utils\\Vec.h\r\n$(OS)\\HtmlFormatter.obj: $B\\src\\EbookBase.h $B\\src\\HtmlFormatter.h $B\\src\\mui\\Mui.h\r\n$(OS)\\HtmlFormatter.obj: $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h $B\\src\\mui\\MuiControl.h\r\n$(OS)\\HtmlFormatter.obj: $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiEventMgr.h $B\\src\\mui\\MuiFromText.h\r\n$(OS)\\HtmlFormatter.obj: $B\\src\\mui\\MuiGrid.h $B\\src\\mui\\MuiHwndWrapper.h $B\\src\\mui\\MuiLayout.h\r\n$(OS)\\HtmlFormatter.obj: $B\\src\\mui\\MuiPainter.h $B\\src\\mui\\MuiScrollBar.h $B\\src\\mui\\TextRender.h\r\n$(OS)\\HtmlFormatter.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\CssParser.h\r\n$(OS)\\HtmlFormatter.obj: $B\\src\\utils\\DebugLog.h $B\\src\\utils\\GdiPlusUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\HtmlFormatter.obj: $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\HtmlPullParser.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\HtmlFormatter.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Timer.h\r\n$(OS)\\HtmlFormatter.obj: $B\\src\\utils\\Vec.h\r\n$(OS)\\ImagesEngine.obj: $B\\src\\BaseEngine.h $B\\src\\ImagesEngine.h $B\\src\\PdfCreator.h\r\n$(OS)\\ImagesEngine.obj: $B\\src\\utils\\ArchUtil.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OS)\\ImagesEngine.obj: $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GdiPlusUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\ImagesEngine.obj: $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\HtmlPullParser.h $B\\src\\utils\\JsonParser.h\r\n$(OS)\\ImagesEngine.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\ImagesEngine.obj: $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\Installer.obj: $B\\src\\CrashHandler.h $B\\src\\ifilter\\PdfFilter.h $B\\src\\installer\\Install.cpp\r\n$(OS)\\Installer.obj: $B\\src\\installer\\Installer.h $B\\src\\installer\\Resource.h $B\\src\\installer\\Uninstall.cpp\r\n$(OS)\\Installer.obj: $B\\src\\previewer\\PdfPreview.h $B\\src\\Translations.h $B\\src\\utils\\BaseUtil.h\r\n$(OS)\\Installer.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\ByteOrderDecoder.h $B\\src\\utils\\CmdLineParser.h\r\n$(OS)\\Installer.obj: $B\\src\\utils\\DebugLog.h $B\\src\\utils\\Dpi.h $B\\src\\utils\\FileTransactions.h\r\n$(OS)\\Installer.obj: $B\\src\\utils\\FileUtil.h $B\\src\\utils\\FrameTimeoutCalculator.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\Installer.obj: $B\\src\\utils\\LzmaSimpleArchive.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OS)\\Installer.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Timer.h $B\\src\\utils\\Vec.h\r\n$(OS)\\Installer.obj: $B\\src\\utils\\WinDynCalls.h $B\\src\\utils\\WinUtil.h $B\\src\\Version.h\r\n$(OS)\\LabelWithCloseWnd.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\Dpi.h\r\n$(OS)\\LabelWithCloseWnd.obj: $B\\src\\utils\\GdiPlusUtil.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\LabelWithCloseWnd.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OS)\\LabelWithCloseWnd.obj: $B\\src\\utils\\WinUtil.h $B\\src\\wingui\\LabelWithCloseWnd.h\r\n$(OS)\\Menu.obj: $B\\src\\BaseEngine.h $B\\src\\Controller.h $B\\src\\DisplayModel.h\r\n$(OS)\\Menu.obj: $B\\src\\EngineManager.h $B\\src\\ExternalViewers.h $B\\src\\Favorites.h\r\n$(OS)\\Menu.obj: $B\\src\\FileHistory.h $B\\src\\FileThumbnails.h $B\\src\\GlobalPrefs.h\r\n$(OS)\\Menu.obj: $B\\src\\Menu.h $B\\src\\mui\\Mui.h $B\\src\\mui\\MuiBase.h\r\n$(OS)\\Menu.obj: $B\\src\\mui\\MuiButton.h $B\\src\\mui\\MuiControl.h $B\\src\\mui\\MuiCss.h\r\n$(OS)\\Menu.obj: $B\\src\\mui\\MuiEventMgr.h $B\\src\\mui\\MuiFromText.h $B\\src\\mui\\MuiGrid.h\r\n$(OS)\\Menu.obj: $B\\src\\mui\\MuiHwndWrapper.h $B\\src\\mui\\MuiLayout.h $B\\src\\mui\\MuiPainter.h\r\n$(OS)\\Menu.obj: $B\\src\\mui\\MuiScrollBar.h $B\\src\\mui\\TextRender.h $B\\src\\resource.h\r\n$(OS)\\Menu.obj: $B\\src\\Selection.h $B\\src\\SettingsStructs.h $B\\src\\SumatraAbout.h\r\n$(OS)\\Menu.obj: $B\\src\\SumatraDialogs.h $B\\src\\SumatraPDF.h $B\\src\\TabInfo.h\r\n$(OS)\\Menu.obj: $B\\src\\Translations.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OS)\\Menu.obj: $B\\src\\utils\\CmdLineParser.h $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\Menu.obj: $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OS)\\Menu.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\Menu.obj: $B\\src\\WindowInfo.h\r\n$(OS)\\MobiDoc.obj: $B\\src\\BaseEngine.h $B\\src\\EbookBase.h $B\\src\\MobiDoc.h\r\n$(OS)\\MobiDoc.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BitReader.h $B\\src\\utils\\BuildConfig.h\r\n$(OS)\\MobiDoc.obj: $B\\src\\utils\\ByteOrderDecoder.h $B\\src\\utils\\DebugLog.h $B\\src\\utils\\FileUtil.h\r\n$(OS)\\MobiDoc.obj: $B\\src\\utils\\GdiPlusUtil.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h\r\n$(OS)\\MobiDoc.obj: $B\\src\\utils\\HtmlPullParser.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\PalmDbReader.h\r\n$(OS)\\MobiDoc.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\TrivialHtmlParser.h\r\n$(OS)\\MobiDoc.obj: $B\\src\\utils\\Vec.h\r\n$(OS)\\MuiEbookPageDef.obj: $B\\src\\MuiEbookPageDef.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OS)\\MuiEbookPageDef.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OS)\\MuiEbookPageDef.obj: $B\\src\\utils\\SerializeTxt.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OS)\\MuPDF_Exports.obj: $B\\mupdf\\include\\mupdf\\fitz\\math.h $B\\mupdf\\include\\mupdf\\fitz\\system.h\r\n$(OS)\\Notifications.obj: $B\\src\\Notifications.h $B\\src\\SumatraPDF.h $B\\src\\TextSearch.h\r\n$(OS)\\Notifications.obj: $B\\src\\TextSelection.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OS)\\Notifications.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OS)\\Notifications.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\PagesLayoutDef.obj: $B\\src\\PagesLayoutDef.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OS)\\PagesLayoutDef.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OS)\\PagesLayoutDef.obj: $B\\src\\utils\\SerializeTxt.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OS)\\ParseCommandLine.obj: $B\\src\\GlobalPrefs.h $B\\src\\ParseCommandLine.h $B\\src\\SettingsStructs.h\r\n$(OS)\\ParseCommandLine.obj: $B\\src\\StressTesting.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OS)\\ParseCommandLine.obj: $B\\src\\utils\\CmdLineParser.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\ParseCommandLine.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OS)\\ParseCommandLine.obj: $B\\src\\utils\\WinUtil.h\r\n$(OS)\\PdfCreator.obj: $B\\ext\\zlib\\zconf.h $B\\ext\\zlib\\zlib.h $B\\mupdf\\include\\mupdf\\fitz.h\r\n$(OS)\\PdfCreator.obj: $B\\mupdf\\include\\mupdf\\fitz\\annotation.h $B\\mupdf\\include\\mupdf\\fitz\\bitmap.h $B\\mupdf\\include\\mupdf\\fitz\\buffer.h\r\n$(OS)\\PdfCreator.obj: $B\\mupdf\\include\\mupdf\\fitz\\colorspace.h $B\\mupdf\\include\\mupdf\\fitz\\compressed-buffer.h $B\\mupdf\\include\\mupdf\\fitz\\context.h\r\n$(OS)\\PdfCreator.obj: $B\\mupdf\\include\\mupdf\\fitz\\crypt.h $B\\mupdf\\include\\mupdf\\fitz\\device.h $B\\mupdf\\include\\mupdf\\fitz\\display-list.h\r\n$(OS)\\PdfCreator.obj: $B\\mupdf\\include\\mupdf\\fitz\\document.h $B\\mupdf\\include\\mupdf\\fitz\\filter.h $B\\mupdf\\include\\mupdf\\fitz\\font.h\r\n$(OS)\\PdfCreator.obj: $B\\mupdf\\include\\mupdf\\fitz\\function.h $B\\mupdf\\include\\mupdf\\fitz\\getopt.h $B\\mupdf\\include\\mupdf\\fitz\\glyph-cache.h\r\n$(OS)\\PdfCreator.obj: $B\\mupdf\\include\\mupdf\\fitz\\glyph.h $B\\mupdf\\include\\mupdf\\fitz\\hash.h $B\\mupdf\\include\\mupdf\\fitz\\image.h\r\n$(OS)\\PdfCreator.obj: $B\\mupdf\\include\\mupdf\\fitz\\link.h $B\\mupdf\\include\\mupdf\\fitz\\math.h $B\\mupdf\\include\\mupdf\\fitz\\meta.h\r\n$(OS)\\PdfCreator.obj: $B\\mupdf\\include\\mupdf\\fitz\\outline.h $B\\mupdf\\include\\mupdf\\fitz\\output-pcl.h $B\\mupdf\\include\\mupdf\\fitz\\output-png.h\r\n$(OS)\\PdfCreator.obj: $B\\mupdf\\include\\mupdf\\fitz\\output-pnm.h $B\\mupdf\\include\\mupdf\\fitz\\output-pwg.h $B\\mupdf\\include\\mupdf\\fitz\\output-svg.h\r\n$(OS)\\PdfCreator.obj: $B\\mupdf\\include\\mupdf\\fitz\\output-tga.h $B\\mupdf\\include\\mupdf\\fitz\\output.h $B\\mupdf\\include\\mupdf\\fitz\\path.h\r\n$(OS)\\PdfCreator.obj: $B\\mupdf\\include\\mupdf\\fitz\\pixmap.h $B\\mupdf\\include\\mupdf\\fitz\\shade.h $B\\mupdf\\include\\mupdf\\fitz\\store.h\r\n$(OS)\\PdfCreator.obj: $B\\mupdf\\include\\mupdf\\fitz\\stream.h $B\\mupdf\\include\\mupdf\\fitz\\string.h $B\\mupdf\\include\\mupdf\\fitz\\structured-text.h\r\n$(OS)\\PdfCreator.obj: $B\\mupdf\\include\\mupdf\\fitz\\system.h $B\\mupdf\\include\\mupdf\\fitz\\text.h $B\\mupdf\\include\\mupdf\\fitz\\transition.h\r\n$(OS)\\PdfCreator.obj: $B\\mupdf\\include\\mupdf\\fitz\\tree.h $B\\mupdf\\include\\mupdf\\fitz\\unzip.h $B\\mupdf\\include\\mupdf\\fitz\\version.h\r\n$(OS)\\PdfCreator.obj: $B\\mupdf\\include\\mupdf\\fitz\\write-document.h $B\\mupdf\\include\\mupdf\\fitz\\xml.h $B\\mupdf\\include\\mupdf\\pdf.h\r\n$(OS)\\PdfCreator.obj: $B\\mupdf\\include\\mupdf\\pdf\\annot.h $B\\mupdf\\include\\mupdf\\pdf\\appearance.h $B\\mupdf\\include\\mupdf\\pdf\\cmap.h\r\n$(OS)\\PdfCreator.obj: $B\\mupdf\\include\\mupdf\\pdf\\crypt.h $B\\mupdf\\include\\mupdf\\pdf\\document.h $B\\mupdf\\include\\mupdf\\pdf\\event.h\r\n$(OS)\\PdfCreator.obj: $B\\mupdf\\include\\mupdf\\pdf\\field.h $B\\mupdf\\include\\mupdf\\pdf\\font.h $B\\mupdf\\include\\mupdf\\pdf\\javascript.h\r\n$(OS)\\PdfCreator.obj: $B\\mupdf\\include\\mupdf\\pdf\\object.h $B\\mupdf\\include\\mupdf\\pdf\\output-pdf.h $B\\mupdf\\include\\mupdf\\pdf\\page.h\r\n$(OS)\\PdfCreator.obj: $B\\mupdf\\include\\mupdf\\pdf\\parse.h $B\\mupdf\\include\\mupdf\\pdf\\resource.h $B\\mupdf\\include\\mupdf\\pdf\\widget.h\r\n$(OS)\\PdfCreator.obj: $B\\mupdf\\include\\mupdf\\pdf\\xref.h $B\\src\\BaseEngine.h $B\\src\\PdfCreator.h\r\n$(OS)\\PdfCreator.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GdiplusUtil.h\r\n$(OS)\\PdfCreator.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OS)\\PdfCreator.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OS)\\PdfEngine.obj: $B\\mupdf\\include\\mupdf\\fitz.h $B\\mupdf\\include\\mupdf\\fitz\\annotation.h $B\\mupdf\\include\\mupdf\\fitz\\bitmap.h\r\n$(OS)\\PdfEngine.obj: $B\\mupdf\\include\\mupdf\\fitz\\buffer.h $B\\mupdf\\include\\mupdf\\fitz\\colorspace.h $B\\mupdf\\include\\mupdf\\fitz\\compressed-buffer.h\r\n$(OS)\\PdfEngine.obj: $B\\mupdf\\include\\mupdf\\fitz\\context.h $B\\mupdf\\include\\mupdf\\fitz\\crypt.h $B\\mupdf\\include\\mupdf\\fitz\\device.h\r\n$(OS)\\PdfEngine.obj: $B\\mupdf\\include\\mupdf\\fitz\\display-list.h $B\\mupdf\\include\\mupdf\\fitz\\document.h $B\\mupdf\\include\\mupdf\\fitz\\filter.h\r\n$(OS)\\PdfEngine.obj: $B\\mupdf\\include\\mupdf\\fitz\\font.h $B\\mupdf\\include\\mupdf\\fitz\\function.h $B\\mupdf\\include\\mupdf\\fitz\\getopt.h\r\n$(OS)\\PdfEngine.obj: $B\\mupdf\\include\\mupdf\\fitz\\glyph-cache.h $B\\mupdf\\include\\mupdf\\fitz\\glyph.h $B\\mupdf\\include\\mupdf\\fitz\\hash.h\r\n$(OS)\\PdfEngine.obj: $B\\mupdf\\include\\mupdf\\fitz\\image.h $B\\mupdf\\include\\mupdf\\fitz\\link.h $B\\mupdf\\include\\mupdf\\fitz\\math.h\r\n$(OS)\\PdfEngine.obj: $B\\mupdf\\include\\mupdf\\fitz\\meta.h $B\\mupdf\\include\\mupdf\\fitz\\outline.h $B\\mupdf\\include\\mupdf\\fitz\\output-pcl.h\r\n$(OS)\\PdfEngine.obj: $B\\mupdf\\include\\mupdf\\fitz\\output-png.h $B\\mupdf\\include\\mupdf\\fitz\\output-pnm.h $B\\mupdf\\include\\mupdf\\fitz\\output-pwg.h\r\n$(OS)\\PdfEngine.obj: $B\\mupdf\\include\\mupdf\\fitz\\output-svg.h $B\\mupdf\\include\\mupdf\\fitz\\output-tga.h $B\\mupdf\\include\\mupdf\\fitz\\output.h\r\n$(OS)\\PdfEngine.obj: $B\\mupdf\\include\\mupdf\\fitz\\path.h $B\\mupdf\\include\\mupdf\\fitz\\pixmap.h $B\\mupdf\\include\\mupdf\\fitz\\shade.h\r\n$(OS)\\PdfEngine.obj: $B\\mupdf\\include\\mupdf\\fitz\\store.h $B\\mupdf\\include\\mupdf\\fitz\\stream.h $B\\mupdf\\include\\mupdf\\fitz\\string.h\r\n$(OS)\\PdfEngine.obj: $B\\mupdf\\include\\mupdf\\fitz\\structured-text.h $B\\mupdf\\include\\mupdf\\fitz\\system.h $B\\mupdf\\include\\mupdf\\fitz\\text.h\r\n$(OS)\\PdfEngine.obj: $B\\mupdf\\include\\mupdf\\fitz\\transition.h $B\\mupdf\\include\\mupdf\\fitz\\tree.h $B\\mupdf\\include\\mupdf\\fitz\\unzip.h\r\n$(OS)\\PdfEngine.obj: $B\\mupdf\\include\\mupdf\\fitz\\version.h $B\\mupdf\\include\\mupdf\\fitz\\write-document.h $B\\mupdf\\include\\mupdf\\fitz\\xml.h\r\n$(OS)\\PdfEngine.obj: $B\\mupdf\\include\\mupdf\\pdf.h $B\\mupdf\\include\\mupdf\\pdf\\annot.h $B\\mupdf\\include\\mupdf\\pdf\\appearance.h\r\n$(OS)\\PdfEngine.obj: $B\\mupdf\\include\\mupdf\\pdf\\cmap.h $B\\mupdf\\include\\mupdf\\pdf\\crypt.h $B\\mupdf\\include\\mupdf\\pdf\\document.h\r\n$(OS)\\PdfEngine.obj: $B\\mupdf\\include\\mupdf\\pdf\\event.h $B\\mupdf\\include\\mupdf\\pdf\\field.h $B\\mupdf\\include\\mupdf\\pdf\\font.h\r\n$(OS)\\PdfEngine.obj: $B\\mupdf\\include\\mupdf\\pdf\\javascript.h $B\\mupdf\\include\\mupdf\\pdf\\object.h $B\\mupdf\\include\\mupdf\\pdf\\output-pdf.h\r\n$(OS)\\PdfEngine.obj: $B\\mupdf\\include\\mupdf\\pdf\\page.h $B\\mupdf\\include\\mupdf\\pdf\\parse.h $B\\mupdf\\include\\mupdf\\pdf\\resource.h\r\n$(OS)\\PdfEngine.obj: $B\\mupdf\\include\\mupdf\\pdf\\widget.h $B\\mupdf\\include\\mupdf\\pdf\\xref.h $B\\mupdf\\include\\mupdf\\xps.h\r\n$(OS)\\PdfEngine.obj: $B\\src\\BaseEngine.h $B\\src\\PdfEngine.h $B\\src\\utils\\ArchUtil.h\r\n$(OS)\\PdfEngine.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\FileUtil.h\r\n$(OS)\\PdfEngine.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\HtmlPullParser.h\r\n$(OS)\\PdfEngine.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\PdfEngine.obj: $B\\src\\utils\\TrivialHtmlParser.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\PdfEngine.obj: $B\\src\\utils\\ZipUtil.h\r\n$(OS)\\PdfSync.obj: $B\\ext\\synctex\\synctex_parser.h $B\\src\\BaseEngine.h $B\\src\\PdfSync.h\r\n$(OS)\\PdfSync.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\FileUtil.h\r\n$(OS)\\PdfSync.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OS)\\PdfSync.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OS)\\Print.obj: $B\\src\\AppUtil.h $B\\src\\BaseEngine.h $B\\src\\ChmModel.h\r\n$(OS)\\Print.obj: $B\\src\\Controller.h $B\\src\\DisplayModel.h $B\\src\\EngineManager.h\r\n$(OS)\\Print.obj: $B\\src\\GlobalPrefs.h $B\\src\\Notifications.h $B\\src\\Print.h\r\n$(OS)\\Print.obj: $B\\src\\Selection.h $B\\src\\SettingsStructs.h $B\\src\\SumatraDialogs.h\r\n$(OS)\\Print.obj: $B\\src\\SumatraPDF.h $B\\src\\SumatraProperties.h $B\\src\\TabInfo.h\r\n$(OS)\\Print.obj: $B\\src\\TextSearch.h $B\\src\\TextSelection.h $B\\src\\Translations.h\r\n$(OS)\\Print.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\FileUtil.h\r\n$(OS)\\Print.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OS)\\Print.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\UITask.h $B\\src\\utils\\Vec.h\r\n$(OS)\\Print.obj: $B\\src\\utils\\WinUtil.h $B\\src\\WindowInfo.h\r\n$(OS)\\PsEngine.obj: $B\\ext\\zlib\\zconf.h $B\\ext\\zlib\\zlib.h $B\\src\\BaseEngine.h\r\n$(OS)\\PsEngine.obj: $B\\src\\PdfEngine.h $B\\src\\PsEngine.h $B\\src\\utils\\BaseUtil.h\r\n$(OS)\\PsEngine.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\ByteReader.h $B\\src\\utils\\FileUtil.h\r\n$(OS)\\PsEngine.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OS)\\PsEngine.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\Regress.obj: $B\\src\\BaseEngine.h $B\\src\\Doc.h $B\\src\\EbookBase.h\r\n$(OS)\\Regress.obj: $B\\src\\EbookDoc.h $B\\src\\EbookFormatter.h $B\\src\\HtmlFormatter.h\r\n$(OS)\\Regress.obj: $B\\src\\mui\\Mui.h $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h\r\n$(OS)\\Regress.obj: $B\\src\\mui\\MuiControl.h $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiEventMgr.h\r\n$(OS)\\Regress.obj: $B\\src\\mui\\MuiFromText.h $B\\src\\mui\\MuiGrid.h $B\\src\\mui\\MuiHwndWrapper.h\r\n$(OS)\\Regress.obj: $B\\src\\mui\\MuiLayout.h $B\\src\\mui\\MuiPainter.h $B\\src\\mui\\MuiScrollBar.h\r\n$(OS)\\Regress.obj: $B\\src\\mui\\TextRender.h $B\\src\\regress\\Regress00.cpp $B\\src\\utils\\ArchUtil.h\r\n$(OS)\\Regress.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\DbgHelpDyn.h\r\n$(OS)\\Regress.obj: $B\\src\\utils\\DirIter.h $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GdiPlusUtil.h\r\n$(OS)\\Regress.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\Regress.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OS)\\Regress.obj: $B\\src\\utils\\WinDynCalls.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\RenderCache.obj: $B\\src\\BaseEngine.h $B\\src\\Controller.h $B\\src\\DisplayModel.h\r\n$(OS)\\RenderCache.obj: $B\\src\\EngineManager.h $B\\src\\GlobalPrefs.h $B\\src\\RenderCache.h\r\n$(OS)\\RenderCache.obj: $B\\src\\SettingsStructs.h $B\\src\\TextSelection.h $B\\src\\utils\\BaseUtil.h\r\n$(OS)\\RenderCache.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\RenderCache.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OS)\\RenderCache.obj: $B\\src\\utils\\WinUtil.h\r\n$(OS)\\Search.obj: $B\\src\\AppTools.h $B\\src\\BaseEngine.h $B\\src\\ChmModel.h\r\n$(OS)\\Search.obj: $B\\src\\Controller.h $B\\src\\DisplayModel.h $B\\src\\EngineManager.h\r\n$(OS)\\Search.obj: $B\\src\\GlobalPrefs.h $B\\src\\Notifications.h $B\\src\\PdfSync.h\r\n$(OS)\\Search.obj: $B\\src\\resource.h $B\\src\\Search.h $B\\src\\Selection.h\r\n$(OS)\\Search.obj: $B\\src\\SettingsStructs.h $B\\src\\SumatraDialogs.h $B\\src\\SumatraPDF.h\r\n$(OS)\\Search.obj: $B\\src\\TabInfo.h $B\\src\\TextSearch.h $B\\src\\TextSelection.h\r\n$(OS)\\Search.obj: $B\\src\\Translations.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OS)\\Search.obj: $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\Search.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\UITask.h\r\n$(OS)\\Search.obj: $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h $B\\src\\WindowInfo.h\r\n$(OS)\\Selection.obj: $B\\src\\BaseEngine.h $B\\src\\ChmModel.h $B\\src\\Controller.h\r\n$(OS)\\Selection.obj: $B\\src\\DisplayModel.h $B\\src\\EngineManager.h $B\\src\\GlobalPrefs.h\r\n$(OS)\\Selection.obj: $B\\src\\Selection.h $B\\src\\SettingsStructs.h $B\\src\\SumatraPDF.h\r\n$(OS)\\Selection.obj: $B\\src\\TabInfo.h $B\\src\\TextSelection.h $B\\src\\Toolbar.h\r\n$(OS)\\Selection.obj: $B\\src\\Translations.h $B\\src\\uia\\Provider.h $B\\src\\utils\\BaseUtil.h\r\n$(OS)\\Selection.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\Dpi.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\Selection.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\Selection.obj: $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h $B\\src\\WindowInfo.h\r\n$(OS)\\SplitterWnd.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BitManip.h $B\\src\\utils\\BuildConfig.h\r\n$(OS)\\SplitterWnd.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OS)\\SplitterWnd.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\SplitterWnd.obj: $B\\src\\wingui\\SplitterWnd.h\r\n$(OS)\\StressTesting.obj: $B\\src\\AppTools.h $B\\src\\BaseEngine.h $B\\src\\ChmModel.h\r\n$(OS)\\StressTesting.obj: $B\\src\\Controller.h $B\\src\\DisplayModel.h $B\\src\\Doc.h\r\n$(OS)\\StressTesting.obj: $B\\src\\EbookBase.h $B\\src\\EbookController.h $B\\src\\EbookFormatter.h\r\n$(OS)\\StressTesting.obj: $B\\src\\EngineManager.h $B\\src\\GlobalPrefs.h $B\\src\\HtmlFormatter.h\r\n$(OS)\\StressTesting.obj: $B\\src\\mui\\Mui.h $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h\r\n$(OS)\\StressTesting.obj: $B\\src\\mui\\MuiControl.h $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiEventMgr.h\r\n$(OS)\\StressTesting.obj: $B\\src\\mui\\MuiFromText.h $B\\src\\mui\\MuiGrid.h $B\\src\\mui\\MuiHwndWrapper.h\r\n$(OS)\\StressTesting.obj: $B\\src\\mui\\MuiLayout.h $B\\src\\mui\\MuiPainter.h $B\\src\\mui\\MuiScrollBar.h\r\n$(OS)\\StressTesting.obj: $B\\src\\mui\\TextRender.h $B\\src\\ParseCommandLine.h $B\\src\\RenderCache.h\r\n$(OS)\\StressTesting.obj: $B\\src\\Search.h $B\\src\\SettingsStructs.h $B\\src\\StressTesting.h\r\n$(OS)\\StressTesting.obj: $B\\src\\SumatraPDF.h $B\\src\\TabInfo.h $B\\src\\TextSearch.h\r\n$(OS)\\StressTesting.obj: $B\\src\\TextSelection.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OS)\\StressTesting.obj: $B\\src\\utils\\DirIter.h $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\StressTesting.obj: $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\HtmlWindow.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\StressTesting.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\SimpleLog.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\StressTesting.obj: $B\\src\\utils\\Timer.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\StressTesting.obj: $B\\src\\WindowInfo.h\r\n$(OS)\\SumatraAbout.obj: $B\\src\\BaseEngine.h $B\\src\\FileHistory.h $B\\src\\FileThumbnails.h\r\n$(OS)\\SumatraAbout.obj: $B\\src\\GlobalPrefs.h $B\\src\\resource.h $B\\src\\SettingsStructs.h\r\n$(OS)\\SumatraAbout.obj: $B\\src\\SumatraAbout.h $B\\src\\SumatraPDF.h $B\\src\\Translations.h\r\n$(OS)\\SumatraAbout.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\Dpi.h\r\n$(OS)\\SumatraAbout.obj: $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\SumatraAbout.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OS)\\SumatraAbout.obj: $B\\src\\utils\\WinUtil.h $B\\src\\Version.h $B\\src\\WindowInfo.h\r\n$(OS)\\SumatraAbout2.obj: $B\\src\\mui\\Mui.h $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h\r\n$(OS)\\SumatraAbout2.obj: $B\\src\\mui\\MuiControl.h $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiEventMgr.h\r\n$(OS)\\SumatraAbout2.obj: $B\\src\\mui\\MuiFromText.h $B\\src\\mui\\MuiGrid.h $B\\src\\mui\\MuiHwndWrapper.h\r\n$(OS)\\SumatraAbout2.obj: $B\\src\\mui\\MuiLayout.h $B\\src\\mui\\MuiPainter.h $B\\src\\mui\\MuiScrollBar.h\r\n$(OS)\\SumatraAbout2.obj: $B\\src\\mui\\TextRender.h $B\\src\\resource.h $B\\src\\SumatraAbout2.h\r\n$(OS)\\SumatraAbout2.obj: $B\\src\\SumatraPDF.h $B\\src\\Translations.h $B\\src\\utils\\BaseUtil.h\r\n$(OS)\\SumatraAbout2.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GdiPlusUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\SumatraAbout2.obj: $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OS)\\SumatraAbout2.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\SumatraAbout2.obj: $B\\src\\Version.h\r\n$(OS)\\SumatraDialogs.obj: $B\\src\\AppTools.h $B\\src\\GlobalPrefs.h $B\\src\\resource.h\r\n$(OS)\\SumatraDialogs.obj: $B\\src\\SettingsStructs.h $B\\src\\SumatraDialogs.h $B\\src\\SumatraPDF.h\r\n$(OS)\\SumatraDialogs.obj: $B\\src\\Translations.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OS)\\SumatraDialogs.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OS)\\SumatraDialogs.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\SumatraDialogs.obj: $B\\src\\wingui\\DialogSizer.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\AppPrefs.h $B\\src\\AppTools.h $B\\src\\AppUtil.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\BaseEngine.h $B\\src\\Canvas.h $B\\src\\Caption.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\ChmModel.h $B\\src\\Controller.h $B\\src\\CrashHandler.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\DisplayModel.h $B\\src\\Doc.h $B\\src\\EbookController.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\EngineManager.h $B\\src\\ExternalViewers.h $B\\src\\Favorites.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\FileHistory.h $B\\src\\FileModifications.h $B\\src\\FileThumbnails.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\GlobalPrefs.h $B\\src\\Menu.h $B\\src\\mui\\Mui.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h $B\\src\\mui\\MuiControl.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiEventMgr.h $B\\src\\mui\\MuiFromText.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\mui\\MuiGrid.h $B\\src\\mui\\MuiHwndWrapper.h $B\\src\\mui\\MuiLayout.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\mui\\MuiPainter.h $B\\src\\mui\\MuiScrollBar.h $B\\src\\mui\\TextRender.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\Notifications.h $B\\src\\PdfCreator.h $B\\src\\PdfSync.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\Print.h $B\\src\\PsEngine.h $B\\src\\RenderCache.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\resource.h $B\\src\\Search.h $B\\src\\Selection.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\SettingsStructs.h $B\\src\\StressTesting.h $B\\src\\SumatraAbout.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\SumatraAbout2.h $B\\src\\SumatraDialogs.h $B\\src\\SumatraPDF.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\SumatraProperties.h $B\\src\\TabInfo.h $B\\src\\TableOfContents.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\Tabs.h $B\\src\\TextSearch.h $B\\src\\TextSelection.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\Toolbar.h $B\\src\\Translations.h $B\\src\\uia\\Provider.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\CryptoUtil.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\utils\\DebugLog.h $B\\src\\utils\\DirIter.h $B\\src\\utils\\Dpi.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\utils\\FileUtil.h $B\\src\\utils\\FileWatcher.h $B\\src\\utils\\GdiPlusUtil.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\HttpUtil.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\SquareTreeParser.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\ThreadUtil.h $B\\src\\utils\\UITask.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\utils\\Vec.h $B\\src\\utils\\WinDynCalls.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\Version.h $B\\src\\WindowInfo.h $B\\src\\wingui\\FrameRateWnd.h\r\n$(OS)\\SumatraPDF.obj: $B\\src\\wingui\\LabelWithCloseWnd.h $B\\src\\wingui\\SplitterWnd.h\r\n$(OS)\\SumatraProperties.obj: $B\\src\\BaseEngine.h $B\\src\\Controller.h $B\\src\\DisplayModel.h\r\n$(OS)\\SumatraProperties.obj: $B\\src\\EngineManager.h $B\\src\\resource.h $B\\src\\SettingsStructs.h\r\n$(OS)\\SumatraProperties.obj: $B\\src\\SumatraPDF.h $B\\src\\SumatraProperties.h $B\\src\\Translations.h\r\n$(OS)\\SumatraProperties.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\FileUtil.h\r\n$(OS)\\SumatraProperties.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OS)\\SumatraProperties.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\SumatraProperties.obj: $B\\src\\WindowInfo.h\r\n$(OS)\\SumatraStartup.obj: $B\\src\\AppPrefs.h $B\\src\\AppTools.h $B\\src\\BaseEngine.h\r\n$(OS)\\SumatraStartup.obj: $B\\src\\Canvas.h $B\\src\\Caption.h $B\\src\\Controller.h\r\n$(OS)\\SumatraStartup.obj: $B\\src\\CrashHandler.h $B\\src\\DisplayModel.h $B\\src\\EngineManager.h\r\n$(OS)\\SumatraStartup.obj: $B\\src\\FileHistory.h $B\\src\\FileThumbnails.h $B\\src\\GlobalPrefs.h\r\n$(OS)\\SumatraStartup.obj: $B\\src\\mui\\Mui.h $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h\r\n$(OS)\\SumatraStartup.obj: $B\\src\\mui\\MuiControl.h $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiEventMgr.h\r\n$(OS)\\SumatraStartup.obj: $B\\src\\mui\\MuiFromText.h $B\\src\\mui\\MuiGrid.h $B\\src\\mui\\MuiHwndWrapper.h\r\n$(OS)\\SumatraStartup.obj: $B\\src\\mui\\MuiLayout.h $B\\src\\mui\\MuiPainter.h $B\\src\\mui\\MuiScrollBar.h\r\n$(OS)\\SumatraStartup.obj: $B\\src\\mui\\TextRender.h $B\\src\\Notifications.h $B\\src\\ParseCommandLine.h\r\n$(OS)\\SumatraStartup.obj: $B\\src\\PdfSync.h $B\\src\\Print.h $B\\src\\RenderCache.h\r\n$(OS)\\SumatraStartup.obj: $B\\src\\resource.h $B\\src\\Search.h $B\\src\\Selection.h\r\n$(OS)\\SumatraStartup.obj: $B\\src\\SettingsStructs.h $B\\src\\StressTesting.h $B\\src\\SumatraDialogs.h\r\n$(OS)\\SumatraStartup.obj: $B\\src\\SumatraPDF.h $B\\src\\SumatraProperties.h $B\\src\\TabInfo.h\r\n$(OS)\\SumatraStartup.obj: $B\\src\\Tabs.h $B\\src\\TextSearch.h $B\\src\\TextSelection.h\r\n$(OS)\\SumatraStartup.obj: $B\\src\\Translations.h $B\\src\\uia\\Provider.h $B\\src\\utils\\BaseUtil.h\r\n$(OS)\\SumatraStartup.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\CmdLineParser.h $B\\src\\utils\\DbgHelpDyn.h\r\n$(OS)\\SumatraStartup.obj: $B\\src\\utils\\Dpi.h $B\\src\\utils\\FileUtil.h $B\\src\\utils\\FileWatcher.h\r\n$(OS)\\SumatraStartup.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\SumatraStartup.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\SquareTreeParser.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\SumatraStartup.obj: $B\\src\\utils\\ThreadUtil.h $B\\src\\utils\\UITask.h $B\\src\\utils\\Vec.h\r\n$(OS)\\SumatraStartup.obj: $B\\src\\utils\\WinDynCalls.h $B\\src\\utils\\WinUtil.h $B\\src\\Version.h\r\n$(OS)\\SumatraStartup.obj: $B\\src\\WindowInfo.h $B\\src\\wingui\\LabelWithCloseWnd.h $B\\src\\wingui\\SplitterWnd.h\r\n$(OS)\\TabInfo.obj: $B\\src\\AppUtil.h $B\\src\\BaseEngine.h $B\\src\\ChmModel.h\r\n$(OS)\\TabInfo.obj: $B\\src\\Controller.h $B\\src\\DisplayModel.h $B\\src\\EngineManager.h\r\n$(OS)\\TabInfo.obj: $B\\src\\GlobalPrefs.h $B\\src\\Selection.h $B\\src\\SettingsStructs.h\r\n$(OS)\\TabInfo.obj: $B\\src\\SumatraPDF.h $B\\src\\TabInfo.h $B\\src\\Translations.h\r\n$(OS)\\TabInfo.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\FileUtil.h\r\n$(OS)\\TabInfo.obj: $B\\src\\utils\\FileWatcher.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\TabInfo.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OS)\\TabInfo.obj: $B\\src\\utils\\WinUtil.h $B\\src\\WindowInfo.h\r\n$(OS)\\TableOfContents.obj: $B\\src\\AppTools.h $B\\src\\BaseEngine.h $B\\src\\Controller.h\r\n$(OS)\\TableOfContents.obj: $B\\src\\EngineManager.h $B\\src\\GlobalPrefs.h $B\\src\\resource.h\r\n$(OS)\\TableOfContents.obj: $B\\src\\SettingsStructs.h $B\\src\\SumatraPDF.h $B\\src\\TabInfo.h\r\n$(OS)\\TableOfContents.obj: $B\\src\\TableOfContents.h $B\\src\\Tabs.h $B\\src\\Translations.h\r\n$(OS)\\TableOfContents.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\Dpi.h\r\n$(OS)\\TableOfContents.obj: $B\\src\\utils\\GdiPlusUtil.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\TableOfContents.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\UITask.h\r\n$(OS)\\TableOfContents.obj: $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h $B\\src\\WindowInfo.h\r\n$(OS)\\TableOfContents.obj: $B\\src\\wingui\\LabelWithCloseWnd.h $B\\src\\wingui\\SplitterWnd.h\r\n$(OS)\\Tabs.obj: $B\\src\\BaseEngine.h $B\\src\\Caption.h $B\\src\\Controller.h\r\n$(OS)\\Tabs.obj: $B\\src\\EngineManager.h $B\\src\\GlobalPrefs.h $B\\src\\Menu.h\r\n$(OS)\\Tabs.obj: $B\\src\\resource.h $B\\src\\SettingsStructs.h $B\\src\\SumatraPDF.h\r\n$(OS)\\Tabs.obj: $B\\src\\TabInfo.h $B\\src\\TableOfContents.h $B\\src\\Tabs.h\r\n$(OS)\\Tabs.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\Dpi.h\r\n$(OS)\\Tabs.obj: $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GdiPlusUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\Tabs.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\Tabs.obj: $B\\src\\utils\\UITask.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinDynCalls.h\r\n$(OS)\\Tabs.obj: $B\\src\\utils\\WinUtil.h $B\\src\\WindowInfo.h\r\n$(OS)\\Tester.obj: $B\\src\\BaseEngine.h $B\\src\\EbookBase.h $B\\src\\EbookFormatter.h\r\n$(OS)\\Tester.obj: $B\\src\\HtmlFormatter.h $B\\src\\MobiDoc.h $B\\src\\mui\\Mui.h\r\n$(OS)\\Tester.obj: $B\\src\\mui\\MuiBase.h $B\\src\\mui\\MuiButton.h $B\\src\\mui\\MuiControl.h\r\n$(OS)\\Tester.obj: $B\\src\\mui\\MuiCss.h $B\\src\\mui\\MuiEventMgr.h $B\\src\\mui\\MuiFromText.h\r\n$(OS)\\Tester.obj: $B\\src\\mui\\MuiGrid.h $B\\src\\mui\\MuiHwndWrapper.h $B\\src\\mui\\MuiLayout.h\r\n$(OS)\\Tester.obj: $B\\src\\mui\\MuiPainter.h $B\\src\\mui\\MuiScrollBar.h $B\\src\\mui\\TextRender.h\r\n$(OS)\\Tester.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\CmdLineParser.h\r\n$(OS)\\Tester.obj: $B\\src\\utils\\CryptoUtil.h $B\\src\\utils\\DirIter.h $B\\src\\utils\\FileUtil.h\r\n$(OS)\\Tester.obj: $B\\src\\utils\\GdiPlusUtil.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h\r\n$(OS)\\Tester.obj: $B\\src\\utils\\HtmlPrettyPrint.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OS)\\Tester.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Timer.h $B\\src\\utils\\Vec.h\r\n$(OS)\\Tester.obj: $B\\src\\utils\\WinUtil.h $B\\src\\utils\\ZipUtil.h\r\n$(OS)\\TextSearch.obj: $B\\src\\BaseEngine.h $B\\src\\TextSearch.h $B\\src\\TextSelection.h\r\n$(OS)\\TextSearch.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\TextSearch.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\TextSearch.obj: $B\\src\\utils\\Vec.h\r\n$(OS)\\TextSelection.obj: $B\\src\\BaseEngine.h $B\\src\\TextSelection.h $B\\src\\utils\\BaseUtil.h\r\n$(OS)\\TextSelection.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\TextSelection.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OS)\\Toolbar.obj: $B\\src\\AppTools.h $B\\src\\BaseEngine.h $B\\src\\Controller.h\r\n$(OS)\\Toolbar.obj: $B\\src\\DisplayModel.h $B\\src\\EngineManager.h $B\\src\\GlobalPrefs.h\r\n$(OS)\\Toolbar.obj: $B\\src\\Menu.h $B\\src\\resource.h $B\\src\\Search.h\r\n$(OS)\\Toolbar.obj: $B\\src\\SettingsStructs.h $B\\src\\SumatraPDF.h $B\\src\\TabInfo.h\r\n$(OS)\\Toolbar.obj: $B\\src\\TextSearch.h $B\\src\\TextSelection.h $B\\src\\Toolbar.h\r\n$(OS)\\Toolbar.obj: $B\\src\\Translations.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OS)\\Toolbar.obj: $B\\src\\utils\\Dpi.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\Toolbar.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OS)\\Toolbar.obj: $B\\src\\utils\\WinDynCalls.h $B\\src\\utils\\WinUtil.h $B\\src\\WindowInfo.h\r\n$(OS)\\Trans_installer_txt.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\Trans_installer_txt.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\Trans_installer_txt.obj: $B\\src\\utils\\Vec.h\r\n$(OS)\\Trans_sumatra_txt.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\Trans_sumatra_txt.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\Trans_sumatra_txt.obj: $B\\src\\utils\\Vec.h\r\n$(OS)\\Translations.obj: $B\\ext\\zlib\\zconf.h $B\\ext\\zlib\\zlib.h $B\\src\\Translations.h\r\n$(OS)\\Translations.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\Translations.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\Translations.obj: $B\\src\\utils\\Vec.h\r\n$(OS)\\UnitTests.obj: $B\\src\\AppUtil.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OS)\\UnitTests.obj: $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OS)\\UnitTests.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrFormat.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\UnitTests.obj: $B\\src\\utils\\UtAssert.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\Win32Window.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\FileUtil.h\r\n$(OS)\\Win32Window.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OS)\\Win32Window.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OS)\\Win32Window.obj: $B\\src\\wingui\\EditCtrl.h $B\\src\\wingui\\Win32Window.h\r\n$(OS)\\WindowInfo.obj: $B\\src\\BaseEngine.h $B\\src\\Caption.h $B\\src\\ChmModel.h\r\n$(OS)\\WindowInfo.obj: $B\\src\\Controller.h $B\\src\\DisplayModel.h $B\\src\\Doc.h\r\n$(OS)\\WindowInfo.obj: $B\\src\\EbookController.h $B\\src\\EngineManager.h $B\\src\\GlobalPrefs.h\r\n$(OS)\\WindowInfo.obj: $B\\src\\Notifications.h $B\\src\\resource.h $B\\src\\Selection.h\r\n$(OS)\\WindowInfo.obj: $B\\src\\SettingsStructs.h $B\\src\\StressTesting.h $B\\src\\SumatraPDF.h\r\n$(OS)\\WindowInfo.obj: $B\\src\\TabInfo.h $B\\src\\TextSearch.h $B\\src\\TextSelection.h\r\n$(OS)\\WindowInfo.obj: $B\\src\\Translations.h $B\\src\\uia\\Provider.h $B\\src\\utils\\BaseUtil.h\r\n$(OS)\\WindowInfo.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(OS)\\WindowInfo.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OS)\\WindowInfo.obj: $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h $B\\src\\WindowInfo.h\r\n$(OS)\\WindowInfo.obj: $B\\src\\wingui\\FrameRateWnd.h\r\n$(OU)\\ArchUtil.obj: $B\\ext\\unarr\\unarr.h $B\\src\\utils\\ArchUtil.h $B\\src\\utils\\BaseUtil.h\r\n$(OU)\\ArchUtil.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\ArchUtil.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\ArchUtil.obj: $B\\src\\utils\\Vec.h\r\n$(OU)\\BaseUtil.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\BaseUtil.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\BaseUtil.obj: $B\\src\\utils\\Vec.h\r\n$(OU)\\BaseUtil_ut.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\BaseUtil_ut.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\BaseUtil_ut.obj: $B\\src\\utils\\UtAssert.h $B\\src\\utils\\Vec.h\r\n$(OU)\\BitReader.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BitReader.h $B\\src\\utils\\BuildConfig.h\r\n$(OU)\\BitReader.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OU)\\BitReader.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\ByteOrderDecoder.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\ByteOrderDecoder.h\r\n$(OU)\\ByteOrderDecoder.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OU)\\ByteOrderDecoder.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\ByteOrderDecoder_ut.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\ByteOrderDecoder.h\r\n$(OU)\\ByteOrderDecoder_ut.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OU)\\ByteOrderDecoder_ut.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\UtAssert.h $B\\src\\utils\\Vec.h\r\n$(OU)\\CmdLineParser.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\CmdLineParser.h\r\n$(OU)\\CmdLineParser.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OU)\\CmdLineParser.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\CmdLineParser_ut.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\CmdLineParser.h\r\n$(OU)\\CmdLineParser_ut.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OU)\\CmdLineParser_ut.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\UtAssert.h $B\\src\\utils\\Vec.h\r\n$(OU)\\CryptoUtil.obj: $B\\mupdf\\include\\mupdf\\fitz\\crypt.h $B\\mupdf\\include\\mupdf\\fitz\\system.h $B\\src\\utils\\BaseUtil.h\r\n$(OU)\\CryptoUtil.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\CryptoUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\CryptoUtil.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\CryptoUtil.obj: $B\\src\\utils\\Vec.h\r\n$(OU)\\CryptoUtil_ut.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\CryptoUtil.h\r\n$(OU)\\CryptoUtil_ut.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OU)\\CryptoUtil_ut.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\UtAssert.h $B\\src\\utils\\Vec.h\r\n$(OU)\\CssParser.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\CssParser.h\r\n$(OU)\\CssParser.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\mingw_compat.h\r\n$(OU)\\CssParser.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\CssParser_ut.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\CssParser.h\r\n$(OU)\\CssParser_ut.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\mingw_compat.h\r\n$(OU)\\CssParser_ut.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\UtAssert.h\r\n$(OU)\\CssParser_ut.obj: $B\\src\\utils\\Vec.h\r\n$(OU)\\DbgHelpDyn.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\DbgHelpDyn.h\r\n$(OU)\\DbgHelpDyn.obj: $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OU)\\DbgHelpDyn.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\DbgHelpDyn.obj: $B\\src\\utils\\WinDynCalls.h $B\\src\\utils\\WinUtil.h\r\n$(OU)\\DebugLog.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\DebugLog.h\r\n$(OU)\\DebugLog.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OU)\\DebugLog.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\Dict.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\Dict.h\r\n$(OU)\\Dict.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OU)\\Dict.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\Dict_ut.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\Dict.h\r\n$(OU)\\Dict_ut.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OU)\\Dict_ut.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\UtAssert.h $B\\src\\utils\\Vec.h\r\n$(OU)\\DirIter.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\DirIter.h\r\n$(OU)\\DirIter.obj: $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OU)\\DirIter.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\Dpi.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\Dpi.h\r\n$(OU)\\Dpi.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OU)\\Dpi.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\FileTransactions.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\FileTransactions.h\r\n$(OU)\\FileTransactions.obj: $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OU)\\FileTransactions.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\FileTransactions.obj: $B\\src\\utils\\WinDynCalls.h $B\\src\\utils\\WinUtil.h\r\n$(OU)\\FileUtil.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\FileUtil.h\r\n$(OU)\\FileUtil.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OU)\\FileUtil.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\FileUtil_ut.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\FileUtil.h\r\n$(OU)\\FileUtil_ut.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OU)\\FileUtil_ut.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\UtAssert.h $B\\src\\utils\\Vec.h\r\n$(OU)\\FileWatcher.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\DebugLog.h\r\n$(OU)\\FileWatcher.obj: $B\\src\\utils\\FileUtil.h $B\\src\\utils\\FileWatcher.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\FileWatcher.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\FileWatcher.obj: $B\\src\\utils\\ThreadUtil.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OU)\\FzImgReader.obj: $B\\mupdf\\include\\mupdf\\fitz.h $B\\mupdf\\include\\mupdf\\fitz\\annotation.h $B\\mupdf\\include\\mupdf\\fitz\\bitmap.h\r\n$(OU)\\FzImgReader.obj: $B\\mupdf\\include\\mupdf\\fitz\\buffer.h $B\\mupdf\\include\\mupdf\\fitz\\colorspace.h $B\\mupdf\\include\\mupdf\\fitz\\compressed-buffer.h\r\n$(OU)\\FzImgReader.obj: $B\\mupdf\\include\\mupdf\\fitz\\context.h $B\\mupdf\\include\\mupdf\\fitz\\crypt.h $B\\mupdf\\include\\mupdf\\fitz\\device.h\r\n$(OU)\\FzImgReader.obj: $B\\mupdf\\include\\mupdf\\fitz\\display-list.h $B\\mupdf\\include\\mupdf\\fitz\\document.h $B\\mupdf\\include\\mupdf\\fitz\\filter.h\r\n$(OU)\\FzImgReader.obj: $B\\mupdf\\include\\mupdf\\fitz\\font.h $B\\mupdf\\include\\mupdf\\fitz\\function.h $B\\mupdf\\include\\mupdf\\fitz\\getopt.h\r\n$(OU)\\FzImgReader.obj: $B\\mupdf\\include\\mupdf\\fitz\\glyph-cache.h $B\\mupdf\\include\\mupdf\\fitz\\glyph.h $B\\mupdf\\include\\mupdf\\fitz\\hash.h\r\n$(OU)\\FzImgReader.obj: $B\\mupdf\\include\\mupdf\\fitz\\image.h $B\\mupdf\\include\\mupdf\\fitz\\link.h $B\\mupdf\\include\\mupdf\\fitz\\math.h\r\n$(OU)\\FzImgReader.obj: $B\\mupdf\\include\\mupdf\\fitz\\meta.h $B\\mupdf\\include\\mupdf\\fitz\\outline.h $B\\mupdf\\include\\mupdf\\fitz\\output-pcl.h\r\n$(OU)\\FzImgReader.obj: $B\\mupdf\\include\\mupdf\\fitz\\output-png.h $B\\mupdf\\include\\mupdf\\fitz\\output-pnm.h $B\\mupdf\\include\\mupdf\\fitz\\output-pwg.h\r\n$(OU)\\FzImgReader.obj: $B\\mupdf\\include\\mupdf\\fitz\\output-svg.h $B\\mupdf\\include\\mupdf\\fitz\\output-tga.h $B\\mupdf\\include\\mupdf\\fitz\\output.h\r\n$(OU)\\FzImgReader.obj: $B\\mupdf\\include\\mupdf\\fitz\\path.h $B\\mupdf\\include\\mupdf\\fitz\\pixmap.h $B\\mupdf\\include\\mupdf\\fitz\\shade.h\r\n$(OU)\\FzImgReader.obj: $B\\mupdf\\include\\mupdf\\fitz\\store.h $B\\mupdf\\include\\mupdf\\fitz\\stream.h $B\\mupdf\\include\\mupdf\\fitz\\string.h\r\n$(OU)\\FzImgReader.obj: $B\\mupdf\\include\\mupdf\\fitz\\structured-text.h $B\\mupdf\\include\\mupdf\\fitz\\system.h $B\\mupdf\\include\\mupdf\\fitz\\text.h\r\n$(OU)\\FzImgReader.obj: $B\\mupdf\\include\\mupdf\\fitz\\transition.h $B\\mupdf\\include\\mupdf\\fitz\\tree.h $B\\mupdf\\include\\mupdf\\fitz\\unzip.h\r\n$(OU)\\FzImgReader.obj: $B\\mupdf\\include\\mupdf\\fitz\\version.h $B\\mupdf\\include\\mupdf\\fitz\\write-document.h $B\\mupdf\\include\\mupdf\\fitz\\xml.h\r\n$(OU)\\FzImgReader.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\FzImgReader.h\r\n$(OU)\\FzImgReader.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OU)\\FzImgReader.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\GdiPlusUtil.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\ByteReader.h\r\n$(OU)\\GdiPlusUtil.obj: $B\\src\\utils\\FzImgReader.h $B\\src\\utils\\GdiPlusUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\GdiPlusUtil.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\GdiPlusUtil.obj: $B\\src\\utils\\TgaReader.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WebpReader.h\r\n$(OU)\\GdiPlusUtil.obj: $B\\src\\utils\\WinUtil.h\r\n$(OU)\\HtmlParserLookup.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\HtmlParserLookup.obj: $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OU)\\HtmlParserLookup.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\HtmlPrettyPrint.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\HtmlPrettyPrint.obj: $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\HtmlPrettyPrint.h $B\\src\\utils\\HtmlPullParser.h\r\n$(OU)\\HtmlPrettyPrint.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\HtmlPrettyPrint.obj: $B\\src\\utils\\Vec.h\r\n$(OU)\\HtmlPrettyPrint_ut.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\HtmlPrettyPrint_ut.obj: $B\\src\\utils\\HtmlPrettyPrint.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OU)\\HtmlPrettyPrint_ut.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\UtAssert.h $B\\src\\utils\\Vec.h\r\n$(OU)\\HtmlPullParser.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\HtmlPullParser.obj: $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\HtmlPullParser.h $B\\src\\utils\\mingw_compat.h\r\n$(OU)\\HtmlPullParser.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\HtmlPullParser_ut.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\HtmlPullParser_ut.obj: $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\HtmlPullParser.h $B\\src\\utils\\mingw_compat.h\r\n$(OU)\\HtmlPullParser_ut.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\UtAssert.h\r\n$(OU)\\HtmlPullParser_ut.obj: $B\\src\\utils\\Vec.h\r\n$(OU)\\HtmlWindow.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GdiPlusUtil.h\r\n$(OU)\\HtmlWindow.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlWindow.h $B\\src\\utils\\mingw_compat.h\r\n$(OU)\\HtmlWindow.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Timer.h\r\n$(OU)\\HtmlWindow.obj: $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OU)\\HttpUtil.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\FileUtil.h\r\n$(OU)\\HttpUtil.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HttpUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OU)\\HttpUtil.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\ThreadUtil.h\r\n$(OU)\\HttpUtil.obj: $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OU)\\JsonParser.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\JsonParser.obj: $B\\src\\utils\\JsonParser.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OU)\\JsonParser.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\JsonParser_ut.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\JsonParser_ut.obj: $B\\src\\utils\\JsonParser.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OU)\\JsonParser_ut.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\UtAssert.h $B\\src\\utils\\Vec.h\r\n$(OU)\\LzmaSimpleArchive.obj: $B\\ext\\lzma\\C\\Bra.h $B\\ext\\lzma\\C\\LzmaDec.h $B\\ext\\lzma\\C\\Types.h\r\n$(OU)\\LzmaSimpleArchive.obj: $B\\ext\\zlib\\zconf.h $B\\ext\\zlib\\zlib.h $B\\src\\utils\\BaseUtil.h\r\n$(OU)\\LzmaSimpleArchive.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\ByteOrderDecoder.h $B\\src\\utils\\FileUtil.h\r\n$(OU)\\LzmaSimpleArchive.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\LzmaSimpleArchive.h $B\\src\\utils\\mingw_compat.h\r\n$(OU)\\LzmaSimpleArchive.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\MakeLzSA.obj: $B\\ext\\lzma\\C\\Bra.h $B\\ext\\lzma\\C\\LzmaEnc.h $B\\ext\\lzma\\C\\Types.h\r\n$(OU)\\MakeLzSA.obj: $B\\ext\\zlib\\zconf.h $B\\ext\\zlib\\zlib.h $B\\src\\utils\\BaseUtil.h\r\n$(OU)\\MakeLzSA.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\ByteWriter.h $B\\src\\utils\\CmdLineParser.h\r\n$(OU)\\MakeLzSA.obj: $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\LzmaSimpleArchive.h\r\n$(OU)\\MakeLzSA.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\MakeLzSA.obj: $B\\src\\utils\\Vec.h\r\n$(OU)\\PalmDbReader.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\ByteReader.h\r\n$(OU)\\PalmDbReader.obj: $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OU)\\PalmDbReader.obj: $B\\src\\utils\\PalmDbReader.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\PalmDbReader.obj: $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OU)\\plugin-test.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\CmdLineParser.h\r\n$(OU)\\plugin-test.obj: $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OU)\\plugin-test.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\SerializeTxt.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\SerializeTxt.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\SerializeTxt.h\r\n$(OU)\\SerializeTxt.obj: $B\\src\\utils\\StrSlice.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\TxtParser.h\r\n$(OU)\\SerializeTxt.obj: $B\\src\\utils\\Vec.h\r\n$(OU)\\SettingsUtil.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\SettingsUtil.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\SettingsUtil.h\r\n$(OU)\\SettingsUtil.obj: $B\\src\\utils\\SquareTreeParser.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\SettingsUtil_ut.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\SettingsUtil_ut.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\SettingsUtil.h\r\n$(OU)\\SettingsUtil_ut.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\UtAssert.h $B\\src\\utils\\Vec.h\r\n$(OU)\\signfile.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\CmdLineParser.h\r\n$(OU)\\signfile.obj: $B\\src\\utils\\CryptoUtil.h $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\signfile.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\signfile.obj: $B\\src\\utils\\Vec.h\r\n$(OU)\\SimpleLog_ut.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\SimpleLog_ut.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\SimpleLog.h\r\n$(OU)\\SimpleLog_ut.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\UtAssert.h $B\\src\\utils\\Vec.h\r\n$(OU)\\SquareTreeParser.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\SquareTreeParser.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\SquareTreeParser.h\r\n$(OU)\\SquareTreeParser.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\SquareTreeParser_ut.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\SquareTreeParser_ut.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\SquareTreeParser.h\r\n$(OU)\\SquareTreeParser_ut.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\UtAssert.h $B\\src\\utils\\Vec.h\r\n$(OU)\\StrFormat.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\StrFormat.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrFormat.h\r\n$(OU)\\StrFormat.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\StrFormat_ut.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\StrFormat_ut.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrFormat.h\r\n$(OU)\\StrFormat_ut.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\UtAssert.h $B\\src\\utils\\Vec.h\r\n$(OU)\\StrSlice.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\StrSlice.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrSlice.h\r\n$(OU)\\StrSlice.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\StrUtil.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\StrUtil.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\StrUtil.obj: $B\\src\\utils\\Vec.h\r\n$(OU)\\StrUtil_ut.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\StrUtil_ut.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\StrUtil_ut.obj: $B\\src\\utils\\UtAssert.h $B\\src\\utils\\Vec.h\r\n$(OU)\\test_util.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\test_util.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\test_util.obj: $B\\src\\utils\\UtAssert.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinDynCalls.h\r\n$(OU)\\TgaReader.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\TgaReader.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\TgaReader.obj: $B\\src\\utils\\TgaReader.h $B\\src\\utils\\Vec.h\r\n$(OU)\\ThreadUtil.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\ThreadUtil.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\ThreadUtil.obj: $B\\src\\utils\\ThreadUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\TrivialHtmlParser.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\TrivialHtmlParser.obj: $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\HtmlPullParser.h $B\\src\\utils\\mingw_compat.h\r\n$(OU)\\TrivialHtmlParser.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\TrivialHtmlParser.h\r\n$(OU)\\TrivialHtmlParser.obj: $B\\src\\utils\\Vec.h\r\n$(OU)\\TrivialHtmlParser_ut.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\FileUtil.h\r\n$(OU)\\TrivialHtmlParser_ut.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\HtmlParserLookup.h $B\\src\\utils\\mingw_compat.h\r\n$(OU)\\TrivialHtmlParser_ut.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\TrivialHtmlParser.h\r\n$(OU)\\TrivialHtmlParser_ut.obj: $B\\src\\utils\\UtAssert.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OU)\\TxtParser.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\TxtParser.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrSlice.h\r\n$(OU)\\TxtParser.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\TxtParser.h $B\\src\\utils\\Vec.h\r\n$(OU)\\UITask.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\UITask.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\UITask.obj: $B\\src\\utils\\UITask.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OU)\\UtAssert.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\UtAssert.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\UtAssert.obj: $B\\src\\utils\\UtAssert.h $B\\src\\utils\\Vec.h\r\n$(OU)\\VarintGob.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BitManip.h $B\\src\\utils\\BuildConfig.h\r\n$(OU)\\VarintGob.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OU)\\VarintGob.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\VarintGob.h $B\\src\\utils\\Vec.h\r\n$(OU)\\VarintGob_ut.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\VarintGob_ut.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\VarintGob_ut.obj: $B\\src\\utils\\UtAssert.h $B\\src\\utils\\VarintGob.h $B\\src\\utils\\Vec.h\r\n$(OU)\\Vec_ut.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\Vec_ut.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\Vec_ut.obj: $B\\src\\utils\\UtAssert.h $B\\src\\utils\\Vec.h\r\n$(OU)\\WebpReader.obj: $B\\ext\\libwebp\\webp\\decode.h $B\\ext\\libwebp\\webp\\types.h $B\\src\\utils\\BaseUtil.h\r\n$(OU)\\WebpReader.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OU)\\WebpReader.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OU)\\WebpReader.obj: $B\\src\\utils\\WebpReader.h\r\n$(OU)\\WinDynCalls.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\WinDynCalls.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\WinDynCalls.obj: $B\\src\\utils\\Vec.h $B\\src\\utils\\WinDynCalls.h\r\n$(OU)\\WinUtil.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BitManip.h $B\\src\\utils\\BuildConfig.h\r\n$(OU)\\WinUtil.obj: $B\\src\\utils\\DebugLog.h $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\WinUtil.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\WinUtil.obj: $B\\src\\utils\\Vec.h $B\\src\\utils\\WinDynCalls.h $B\\src\\utils\\WinUtil.h\r\n$(OU)\\WinUtil_ut.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\WinUtil_ut.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\WinUtil_ut.obj: $B\\src\\utils\\UtAssert.h $B\\src\\utils\\Vec.h $B\\src\\utils\\WinUtil.h\r\n$(OU)\\ZipUtil.obj: $B\\ext\\unarr\\unarr.h $B\\ext\\zlib\\zconf.h $B\\ext\\zlib\\zlib.h\r\n$(OU)\\ZipUtil.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\ByteWriter.h\r\n$(OU)\\ZipUtil.obj: $B\\src\\utils\\DirIter.h $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h\r\n$(OU)\\ZipUtil.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OU)\\ZipUtil.obj: $B\\src\\utils\\Vec.h $B\\src\\utils\\ZipUtil.h\r\n$(OUIA)\\DocumentProvider.obj: $B\\src\\BaseEngine.h $B\\src\\Controller.h $B\\src\\DisplayModel.h\r\n$(OUIA)\\DocumentProvider.obj: $B\\src\\EngineManager.h $B\\src\\SettingsStructs.h $B\\src\\uia\\Constants.h\r\n$(OUIA)\\DocumentProvider.obj: $B\\src\\uia\\DocumentProvider.h $B\\src\\uia\\PageProvider.h $B\\src\\uia\\Provider.h\r\n$(OUIA)\\DocumentProvider.obj: $B\\src\\uia\\TextRange.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OUIA)\\DocumentProvider.obj: $B\\src\\utils\\FileUtil.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OUIA)\\DocumentProvider.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OUIA)\\PageProvider.obj: $B\\src\\BaseEngine.h $B\\src\\Controller.h $B\\src\\DisplayModel.h\r\n$(OUIA)\\PageProvider.obj: $B\\src\\EngineManager.h $B\\src\\SettingsStructs.h $B\\src\\TextSelection.h\r\n$(OUIA)\\PageProvider.obj: $B\\src\\uia\\Constants.h $B\\src\\uia\\DocumentProvider.h $B\\src\\uia\\PageProvider.h\r\n$(OUIA)\\PageProvider.obj: $B\\src\\uia\\Provider.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OUIA)\\PageProvider.obj: $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h\r\n$(OUIA)\\PageProvider.obj: $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OUIA)\\Provider.obj: $B\\src\\uia\\Constants.h $B\\src\\uia\\DocumentProvider.h $B\\src\\uia\\Provider.h\r\n$(OUIA)\\Provider.obj: $B\\src\\uia\\StartPageProvider.h $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h\r\n$(OUIA)\\Provider.obj: $B\\src\\utils\\DbgHelpDyn.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OUIA)\\Provider.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OUIA)\\Provider.obj: $B\\src\\utils\\WinDynCalls.h $B\\src\\utils\\WinUtil.h\r\n$(OUIA)\\StartPageProvider.obj: $B\\src\\uia\\Constants.h $B\\src\\uia\\Provider.h $B\\src\\uia\\StartPageProvider.h\r\n$(OUIA)\\StartPageProvider.obj: $B\\src\\utils\\BaseUtil.h $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h\r\n$(OUIA)\\StartPageProvider.obj: $B\\src\\utils\\mingw_compat.h $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h\r\n$(OUIA)\\StartPageProvider.obj: $B\\src\\utils\\Vec.h\r\n$(OUIA)\\TextRange.obj: $B\\src\\BaseEngine.h $B\\src\\Controller.h $B\\src\\DisplayModel.h\r\n$(OUIA)\\TextRange.obj: $B\\src\\EngineManager.h $B\\src\\SettingsStructs.h $B\\src\\TextSelection.h\r\n$(OUIA)\\TextRange.obj: $B\\src\\uia\\Constants.h $B\\src\\uia\\DocumentProvider.h $B\\src\\uia\\PageProvider.h\r\n$(OUIA)\\TextRange.obj: $B\\src\\uia\\Provider.h $B\\src\\uia\\TextRange.h $B\\src\\utils\\BaseUtil.h\r\n$(OUIA)\\TextRange.obj: $B\\src\\utils\\BuildConfig.h $B\\src\\utils\\GeomUtil.h $B\\src\\utils\\mingw_compat.h\r\n$(OUIA)\\TextRange.obj: $B\\src\\utils\\Scoped.h $B\\src\\utils\\StrUtil.h $B\\src\\utils\\Vec.h\r\n$(OUIA)\\TextRange.obj: $B\\src\\utils\\WinDynCalls.h\r\n$(OUN)\\_7z.obj: $B\\ext\\lzma\\C\\7z.h $B\\ext\\lzma\\C\\7zBuf.h $B\\ext\\lzma\\C\\Types.h\r\n$(OUN)\\_7z.obj: $B\\ext\\unarr\\_7z\\_7z.h $B\\ext\\unarr\\common\\allocator.h $B\\ext\\unarr\\common\\unarr-imp.h\r\n$(OUN)\\_7z.obj: $B\\ext\\unarr\\lzmasdk\\7zTypes.h $B\\ext\\unarr\\unarr.h\r\n$(OUN)\\conv.obj: $B\\ext\\unarr\\common\\allocator.h $B\\ext\\unarr\\common\\unarr-imp.h $B\\ext\\unarr\\unarr.h\r\n$(OUN)\\crc32.obj: $B\\ext\\unarr\\common\\allocator.h $B\\ext\\unarr\\common\\unarr-imp.h $B\\ext\\unarr\\unarr.h\r\n$(OUN)\\crc32.obj: $B\\ext\\zlib\\zconf.h $B\\ext\\zlib\\zlib.h\r\n$(OUN)\\filter-rar.obj: $B\\ext\\unarr\\common\\allocator.h $B\\ext\\unarr\\common\\unarr-imp.h $B\\ext\\unarr\\lzmasdk\\7zTypes.h\r\n$(OUN)\\filter-rar.obj: $B\\ext\\unarr\\lzmasdk\\CpuArch.h $B\\ext\\unarr\\lzmasdk\\Ppmd.h $B\\ext\\unarr\\lzmasdk\\Ppmd7.h\r\n$(OUN)\\filter-rar.obj: $B\\ext\\unarr\\rar\\lzss.h $B\\ext\\unarr\\rar\\rar.h $B\\ext\\unarr\\rar\\rarvm.h\r\n$(OUN)\\filter-rar.obj: $B\\ext\\unarr\\unarr.h\r\n$(OUN)\\huffman-rar.obj: $B\\ext\\unarr\\common\\allocator.h $B\\ext\\unarr\\common\\unarr-imp.h $B\\ext\\unarr\\lzmasdk\\7zTypes.h\r\n$(OUN)\\huffman-rar.obj: $B\\ext\\unarr\\lzmasdk\\CpuArch.h $B\\ext\\unarr\\lzmasdk\\Ppmd.h $B\\ext\\unarr\\lzmasdk\\Ppmd7.h\r\n$(OUN)\\huffman-rar.obj: $B\\ext\\unarr\\rar\\lzss.h $B\\ext\\unarr\\rar\\rar.h $B\\ext\\unarr\\unarr.h\r\n$(OUN)\\inflate.obj: $B\\ext\\unarr\\common\\allocator.h $B\\ext\\unarr\\zip\\inflate.h\r\n$(OUN)\\main.obj: $B\\ext\\unarr\\unarr.h\r\n$(OUN)\\parse-rar.obj: $B\\ext\\unarr\\common\\allocator.h $B\\ext\\unarr\\common\\unarr-imp.h $B\\ext\\unarr\\lzmasdk\\7zTypes.h\r\n$(OUN)\\parse-rar.obj: $B\\ext\\unarr\\lzmasdk\\CpuArch.h $B\\ext\\unarr\\lzmasdk\\Ppmd.h $B\\ext\\unarr\\lzmasdk\\Ppmd7.h\r\n$(OUN)\\parse-rar.obj: $B\\ext\\unarr\\rar\\lzss.h $B\\ext\\unarr\\rar\\rar.h $B\\ext\\unarr\\unarr.h\r\n$(OUN)\\parse-tar.obj: $B\\ext\\unarr\\common\\allocator.h $B\\ext\\unarr\\common\\unarr-imp.h $B\\ext\\unarr\\tar\\tar.h\r\n$(OUN)\\parse-tar.obj: $B\\ext\\unarr\\unarr.h\r\n$(OUN)\\parse-zip.obj: $B\\ext\\bzip2\\bzlib.h $B\\ext\\unarr\\common\\allocator.h $B\\ext\\unarr\\common\\unarr-imp.h\r\n$(OUN)\\parse-zip.obj: $B\\ext\\unarr\\lzmasdk\\7zTypes.h $B\\ext\\unarr\\lzmasdk\\CpuArch.h $B\\ext\\unarr\\lzmasdk\\LzmaDec.h\r\n$(OUN)\\parse-zip.obj: $B\\ext\\unarr\\lzmasdk\\Ppmd.h $B\\ext\\unarr\\lzmasdk\\Ppmd8.h $B\\ext\\unarr\\unarr.h\r\n$(OUN)\\parse-zip.obj: $B\\ext\\unarr\\zip\\inflate.h $B\\ext\\unarr\\zip\\zip.h $B\\ext\\zlib\\zconf.h\r\n$(OUN)\\parse-zip.obj: $B\\ext\\zlib\\zlib.h\r\n$(OUN)\\rar.obj: $B\\ext\\unarr\\common\\allocator.h $B\\ext\\unarr\\common\\unarr-imp.h $B\\ext\\unarr\\lzmasdk\\7zTypes.h\r\n$(OUN)\\rar.obj: $B\\ext\\unarr\\lzmasdk\\CpuArch.h $B\\ext\\unarr\\lzmasdk\\Ppmd.h $B\\ext\\unarr\\lzmasdk\\Ppmd7.h\r\n$(OUN)\\rar.obj: $B\\ext\\unarr\\rar\\lzss.h $B\\ext\\unarr\\rar\\rar.h $B\\ext\\unarr\\unarr.h\r\n$(OUN)\\rarvm.obj: $B\\ext\\unarr\\common\\allocator.h $B\\ext\\unarr\\rar\\rarvm.h\r\n$(OUN)\\stream.obj: $B\\ext\\unarr\\common\\allocator.h $B\\ext\\unarr\\common\\unarr-imp.h $B\\ext\\unarr\\unarr.h\r\n$(OUN)\\tar.obj: $B\\ext\\unarr\\common\\allocator.h $B\\ext\\unarr\\common\\unarr-imp.h $B\\ext\\unarr\\tar\\tar.h\r\n$(OUN)\\tar.obj: $B\\ext\\unarr\\unarr.h\r\n$(OUN)\\unarr.obj: $B\\ext\\unarr\\common\\allocator.h $B\\ext\\unarr\\common\\unarr-imp.h $B\\ext\\unarr\\unarr.h\r\n$(OUN)\\uncompress-rar.obj: $B\\ext\\unarr\\common\\allocator.h $B\\ext\\unarr\\common\\unarr-imp.h $B\\ext\\unarr\\lzmasdk\\7zTypes.h\r\n$(OUN)\\uncompress-rar.obj: $B\\ext\\unarr\\lzmasdk\\CpuArch.h $B\\ext\\unarr\\lzmasdk\\Ppmd.h $B\\ext\\unarr\\lzmasdk\\Ppmd7.h\r\n$(OUN)\\uncompress-rar.obj: $B\\ext\\unarr\\rar\\lzss.h $B\\ext\\unarr\\rar\\rar.h $B\\ext\\unarr\\unarr.h\r\n$(OUN)\\uncompress-zip.obj: $B\\ext\\bzip2\\bzlib.h $B\\ext\\unarr\\common\\allocator.h $B\\ext\\unarr\\common\\unarr-imp.h\r\n$(OUN)\\uncompress-zip.obj: $B\\ext\\unarr\\lzmasdk\\7zTypes.h $B\\ext\\unarr\\lzmasdk\\CpuArch.h $B\\ext\\unarr\\lzmasdk\\LzmaDec.h\r\n$(OUN)\\uncompress-zip.obj: $B\\ext\\unarr\\lzmasdk\\Ppmd.h $B\\ext\\unarr\\lzmasdk\\Ppmd8.h $B\\ext\\unarr\\unarr.h\r\n$(OUN)\\uncompress-zip.obj: $B\\ext\\unarr\\zip\\inflate.h $B\\ext\\unarr\\zip\\zip.h $B\\ext\\zlib\\zconf.h\r\n$(OUN)\\uncompress-zip.obj: $B\\ext\\zlib\\zlib.h\r\n$(OUN)\\zip.obj: $B\\ext\\bzip2\\bzlib.h $B\\ext\\unarr\\common\\allocator.h $B\\ext\\unarr\\common\\unarr-imp.h\r\n$(OUN)\\zip.obj: $B\\ext\\unarr\\lzmasdk\\7zTypes.h $B\\ext\\unarr\\lzmasdk\\CpuArch.h $B\\ext\\unarr\\lzmasdk\\LzmaDec.h\r\n$(OUN)\\zip.obj: $B\\ext\\unarr\\lzmasdk\\Ppmd.h $B\\ext\\unarr\\lzmasdk\\Ppmd8.h $B\\ext\\unarr\\unarr.h\r\n$(OUN)\\zip.obj: $B\\ext\\unarr\\zip\\inflate.h $B\\ext\\unarr\\zip\\zip.h $B\\ext\\zlib\\zconf.h\r\n$(OUN)\\zip.obj: $B\\ext\\zlib\\zlib.h\r\n"
  },
  {
    "path": "makefile.msvc",
    "content": "# nmake -f makefile.msvc\r\n# Arguments:\r\n# CFG=dbg|rel (default: dbg)\r\n# BASEDIR=.\r\n# EXTDIR=<directory where zlib/freetype/jpeg lib live> (default: ext)\r\n#  e.g. ..\\sumatrapdf\\ext\r\n# EXTCFLAGS=$CFLAGS\r\n# MUPDF_DIR=mupdf\r\n# PLATFORM=X86\r\n#   the PLATFORM var is usually set in the x64 and x64 cross tools Visual Studio command prompt\r\n#   note: building on X64 isn't officially supported and might unintentionally be broken\r\n# WITH_ANALYZE=yes\r\n#   use /analyze for all code\r\n\r\n# Set default configuration\r\n!if \"$(CFG)\"==\"\"\r\nCFG=dbg\r\n!endif\r\n\r\n!if \"$(BASEDIR)\"==\"\"\r\nBASEDIR=.\r\n!endif\r\n\r\n!if \"$(PLATFORM)\"==\"x64\" || \"$(TARGET_CPU)\"==\"x64\"\r\nPLATFORM = X64\r\n!endif\r\n\r\n# O is directory where object and binary files go\r\nO = $(BASEDIR)\\obj-$(CFG)\r\n\r\n# for x86 : obj-dbg and obj-rel ; for x64 : obj-dbg64 and obj-rel64\r\n!if \"$(PLATFORM)\"==\"X64\"\r\nO = $(O)64\r\n!endif\r\n\r\n!if \"$(MUPDF_DIR)\"==\"\"\r\nMUPDF_DIR=$(BASEDIR)\\mupdf\r\n!endif\r\n\r\n!if \"$(EXTDIR)\"==\"\"\r\nEXTDIR=$(BASEDIR)\\ext\r\n!endif\r\n\r\n# default target\r\nall_sumatrapdf: SumatraPDF Installer EngineDump\r\n\r\n##### add configuration changes that should also affect MuPDF before this line #####\r\n\r\n!INCLUDE $(MUPDF_DIR)\\makefile.msvc\r\n\r\n##### add configuration changes that should NOT affect MuPDF after this line #####\r\n\r\nSRCDIR = $(BASEDIR)\\src\r\n\r\n# include build data for the remaining third-party libraries\r\n!INCLUDE $(EXTDIR)\\makefile.msvc\r\n\r\n# Modify the following defines if you have to target a platform prior to the ones specified below.\r\n# Their meaning: http://msdn.microsoft.com/en-us/library/aa383745(VS.85).aspx\r\n# and http://blogs.msdn.com/oldnewthing/archive/2007/04/11/2079137.aspx\r\n# We set the features uniformly to Windows XP or later.\r\nCFLAGS = $(CFLAGS) /D \"WINVER=0x0501\" /D \"_WIN32_WINNT=0x0501\"\r\n# Suppress warning C4800: forcing value to bool 'true' or 'false'\r\nCFLAGS = $(CFLAGS) /wd4800\r\n\r\n!if \"$(WITH_ANALYZE)\"==\"yes\"\r\nCFLAGS = /analyze:WX- $(CFLAGS)\r\n# C6211: Leaking memory 'foo' due to an exception\r\n# C28125: The function must be called from within a try/except block. (InitializeCriticalSection could have thrown before Windows Vista.)\r\n# C28251: Inconsistent annotation\r\n# C8204: <function> : Only one of this overload and the one at <filename>(<line>) are annotated for <paramname>: both or neither must be annotated.\r\n# TODO: verify that new doesn't throw\r\nCFLAGS = $(CFLAGS) /wd6211 /wd28125 /wd28204 /wd28251\r\n!endif\r\n\r\n!if \"$(CFG)\"==\"dbg\"\r\nCFLAGS = $(CFLAGS) /D \"DEBUG\" /D \"_DEBUG\"\r\n!endif\r\n\r\nUTILS_CFLAGS = $(CFLAGS) $(EXTCFLAGS) \\\r\n\t/I$(SRCDIR)/utils /I$(SRCDIR)/wingui /I$(SRCDIR)/mui /I$(ZLIB_DIR) \\\r\n\t/I$(EXTDIR)/lzma/C /I$(EXTDIR)/libwebp /I$(EXTDIR)/unarr \\\r\n\t/I$(MUPDF_DIR)\\include\r\n\r\nSUMATRA_CFLAGS = $(UTILS_CFLAGS) $(EXTCFLAGS) \\\r\n\t/I$(SRCDIR) /I$(MUPDF_DIR)\\include \\\r\n\t/I$(EXTDIR)/synctex /I$(EXTDIR)/libdjvu /I$(EXTDIR)/CHMLib/src\r\n\r\nINSTALLER_CFLAGS = $(CFLAGS) $(EXTCFLAGS) \\\r\n\t/I$(SRCDIR)/utils /I$(SRCDIR)/installer /I$(SRCDIR) /I$(ZLIB_DIR) /I$(EXTDIR)/lzma/C\r\n\r\nUNINSTALLER_CFLAGS = $(CFLAGS) $(EXTCFLAGS) \\\r\n\t/I$(SRCDIR)/utils /I$(SRCDIR)/installer /I$(SRCDIR) /D \"BUILD_UNINSTALLER\"\r\n\r\nRC_FLAGS = $(EXTCFLAGS)\r\n!if \"$(CFG)\"==\"dbg\"\r\nRC_FLAGS = $(RC_FLAGS) /D \"DEBUG\" /D \"_DEBUG\"\r\n!endif\r\n\r\nLIB_FLAGS = /nologo\r\n!if \"$(CFG)\"!=\"dbg\"\r\n# match LDFLAGS in mupdf\\makefile.msvc\r\nLIB_FLAGS = $(LIB_FLAGS) /LTCG\r\n!endif\r\n\r\nLIBS = $(LIBS) \\\r\n\tcomctl32.lib Msimg32.lib Winspool.lib wininet.lib urlmon.lib gdiplus.lib \\\r\n\tole32.lib OleAut32.lib shlwapi.lib version.lib WindowsCodecs.lib crypt32.lib\r\n\r\nOS   = $(O)\\sumatrapdf\r\nOU   = $(O)\\utils\r\nODLL = $(O)\\applibs\r\nOMUI = $(O)\\mui\r\nOM   = $(O)\\memtrace\r\nOUIA = $(O)\\uia\r\n\r\nSUMATRA_APP = $(O)\\SumatraPDF.exe\r\nSUMATRA_APP_NO_MUPDF = $(O)\\SumatraPDF-no-MuPDF.exe\r\nSUMATRA_RES = $(OS)\\sumatrapdf.res\r\n\r\nINSTALLER_APP   = $(O)\\Installer.exe\r\nINSTALLER_RES   = $(OS)\\Installer.res\r\nINSTALLER_DATA  = $(O)\\InstallerData.dat\r\nUNINSTALLER_APP = $(O)\\uninstall.exe\r\nUNINSTALLER_RES = $(OS)\\Uninstaller.res\r\n\r\nPDFFILTER_DLL = $(O)\\PdfFilter.dll\r\nPDFFILTER_RES = $(ODLL)\\PdfFilter.res\r\nPDFFILTER_CFLAGS = $(SUMATRA_CFLAGS)\r\n\r\nLIBMUPDF_LIB = $(O)\\libmupdf.lib\r\nLIBMUPDF_DEF = $(SRCDIR)\\libmupdf.def\r\nLIBMUPDF_DLL = $(O)\\libmupdf.dll\r\nLIBMUPDF_RES = $(O)\\libmupdf.res\r\n\r\nPDFPREVIEW_DLL = $(O)\\PdfPreview.dll\r\nPDFPREVIEW_RES = $(ODLL)\\PdfPreview.res\r\nPDFPREVIEW_CFLAGS = $(SUMATRA_CFLAGS)\r\n\r\nMEMTRACE_DLL = $(O)\\memtrace.dll\r\nMEMTRACE_RES = $(ODLL)\\memtrace.res\r\nMEMTRACE_CFLAGS = $(SUMATRA_CFLAGS)\r\n\r\nENGINEDUMP_APP = $(O)\\EngineDump.exe\r\nMAKELZSA_APP = $(O)\\MakeLzSA.exe\r\nTEST_UTIL_APP = $(O)\\test_util.exe\r\nSIGNFILE_APP = $(O)\\signfile.exe\r\nPLUGIN_TEST_APP = $(O)\\plugin-test.exe\r\n\r\nMUPDF_LIB   = $(O)\\libmupdfs.lib\r\nUNARR_LIB   = $(O)\\unarr.lib\r\nUTILS_LIB   = $(O)\\utils.lib\r\nMUI_LIB     = $(O)\\mui.lib\r\nENGINES_LIB = $(O)\\engines.lib\r\nMAIN_UI_LIB = $(O)\\sumatra.lib\r\n\r\nSYMBOLS_LZSA= $(O)\\SumatraPDF.pdb.lzsa\r\n\r\n# these are all included in libmupdf.dll for reuse by PdfPreview.dll\r\nFORMAT_LIBS = $(MUPDF_LIB) $(DJVU_OBJS) $(UNARR_LIB) $(WEBP_OBJS)\r\n\r\nUTILS_OBJS = \\\r\n\t$(OU)\\FileUtil.obj $(OU)\\HttpUtil.obj \\\r\n\t$(OU)\\StrUtil.obj $(OU)\\WinUtil.obj $(OU)\\GdiPlusUtil.obj \\\r\n\t$(OU)\\DialogSizer.obj $(OU)\\FileTransactions.obj \\\r\n\t$(OU)\\TrivialHtmlParser.obj $(OU)\\HtmlWindow.obj \\\r\n\t$(OU)\\DirIter.obj $(OU)\\BitReader.obj $(OU)\\HtmlPullParser.obj \\\r\n\t$(OU)\\HtmlPrettyPrint.obj $(OU)\\ThreadUtil.obj $(OU)\\DebugLog.obj \\\r\n\t$(OU)\\DbgHelpDyn.obj $(OU)\\JsonParser.obj $(OU)\\TgaReader.obj \\\r\n\t$(OU)\\HtmlParserLookup.obj $(OU)\\ByteOrderDecoder.obj $(OU)\\CmdLineParser.obj \\\r\n\t$(OU)\\UITask.obj $(OU)\\StrFormat.obj $(OU)\\Dict.obj $(OU)\\BaseUtil.obj \\\r\n\t$(OU)\\CssParser.obj $(OU)\\FileWatcher.obj $(OU)\\CryptoUtil.obj \\\r\n\t$(OU)\\StrSlice.obj $(OU)\\TxtParser.obj $(OU)\\SerializeTxt.obj \\\r\n\t$(OU)\\SquareTreeParser.obj $(OU)\\SettingsUtil.obj $(OU)\\SplitterWnd.obj \\\r\n\t$(OU)\\WebpReader.obj $(OU)\\FzImgReader.obj \\\r\n\t$(OU)\\ArchUtil.obj $(OU)\\ZipUtil.obj $(OU)\\LzmaSimpleArchive.obj \\\r\n\t$(OU)\\LabelWithCloseWnd.obj $(OU)\\FrameRateWnd.obj \\\r\n\t$(OU)\\Dpi.obj $(OU)\\EditCtrl.obj $(OU)\\Win32Window.obj \\\r\n\t$(OU)\\WinDynCalls.obj\r\n\r\nMUI_OBJS = \\\r\n\t$(OMUI)\\MuiBase.obj $(OMUI)\\Mui.obj $(OMUI)\\MuiCss.obj $(OMUI)\\MuiLayout.obj \\\r\n\t$(OMUI)\\MuiPainter.obj $(OMUI)\\MuiControl.obj $(OMUI)\\MuiButton.obj \\\r\n\t$(OMUI)\\MuiScrollBar.obj $(OMUI)\\MuiEventMgr.obj $(OMUI)\\MuiHwndWrapper.obj \\\r\n\t$(OMUI)\\MuiGrid.obj $(OMUI)\\SvgPath.obj $(OMUI)\\MuiDefs.obj \\\r\n\t$(OMUI)\\MuiFromText.obj $(OMUI)\\TextRender.obj\r\n\r\nEBOOK_OBJS = \\\r\n\t$(OS)\\EbookDoc.obj $(OS)\\MobiDoc.obj $(OU)\\PalmDbReader.obj \\\r\n\t$(OS)\\HtmlFormatter.obj $(OS)\\EbookFormatter.obj\r\n\r\nENGINE_OBJS = \\\r\n\t$(OS)\\PdfEngine.obj $(OS)\\PsEngine.obj $(OS)\\PdfCreator.obj \\\r\n\t$(OS)\\ImagesEngine.obj $(OS)\\DjVuEngine.obj \\\r\n\t$(OS)\\EbookEngine.obj $(EBOOK_OBJS) $(OS)\\ChmDoc.obj $(CHMLIB_OBJS) \\\r\n\t$(OS)\\EngineManager.obj $(OS)\\FileModifications.obj\r\n\r\nUIA_OBJS = \\\r\n\t$(OUIA)\\Provider.obj $(OUIA)\\StartPageProvider.obj $(OUIA)\\DocumentProvider.obj \\\r\n\t$(OUIA)\\PageProvider.obj $(OUIA)\\TextRange.obj\r\n\r\nMAIN_UI_OBJS = \\\r\n\t$(OS)\\AppPrefs.obj $(OS)\\DisplayModel.obj $(OS)\\CrashHandler.obj \\\r\n\t$(OS)\\Favorites.obj $(OS)\\TextSearch.obj $(OS)\\SumatraAbout.obj $(OS)\\SumatraAbout2.obj \\\r\n\t$(OS)\\SumatraDialogs.obj $(OS)\\SumatraProperties.obj $(OS)\\GlobalPrefs.obj \\\r\n\t$(OS)\\PdfSync.obj $(OS)\\RenderCache.obj $(OS)\\TextSelection.obj \\\r\n\t$(OS)\\WindowInfo.obj $(OS)\\ParseCommandLine.obj $(OS)\\StressTesting.obj \\\r\n\t$(OS)\\AppTools.obj $(OS)\\AppUtil.obj $(OS)\\TableOfContents.obj \\\r\n\t$(OS)\\Toolbar.obj $(OS)\\Print.obj $(OS)\\Notifications.obj $(OS)\\Selection.obj \\\r\n\t$(OS)\\Search.obj $(OS)\\Menu.obj $(OS)\\ExternalViewers.obj \\\r\n\t$(OS)\\EbookControls.obj $(OS)\\EbookController.obj $(OS)\\Doc.obj \\\r\n\t$(OS)\\MuiEbookPageDef.obj $(OS)\\PagesLayoutDef.obj \\\r\n\t$(OS)\\Tester.obj $(OS)\\Regress.obj \\\r\n\t$(OS)\\Translations.obj $(OS)\\Trans_sumatra_txt.obj \\\r\n\t$(OS)\\Tabs.obj $(OS)\\FileThumbnails.obj $(OS)\\FileHistory.obj \\\r\n\t$(OS)\\ChmModel.obj $(OS)\\Caption.obj $(OS)\\Canvas.obj $(OS)\\TabInfo.obj \\\r\n\t$(UIA_OBJS)\r\n\r\nSUMATRA_OBJS = \\\r\n\t$(OS)\\SumatraPDF.obj $(OS)\\SumatraStartup.obj $(SUMATRA_RES) $(MAIN_UI_LIB) \\\r\n\t$(UTILS_LIB) $(MUI_LIB) $(ENGINES_LIB) $(SYNCTEX_OBJS)\r\n\r\nINSTALLER_OBJS = \\\r\n\t$(OS)\\Installer.obj $(INSTALLER_RES) $(OS)\\CrashHandler.obj \\\r\n\t$(UTILS_LIB) $(ZLIB_OBJS) $(UNARR_LIB) \\\r\n\t$(OS)\\Translations.obj $(OS)\\Trans_installer_txt.obj\r\n\r\nUNINSTALLER_OBJS = \\\r\n\t$(OS)\\Uninstaller.obj $(UNINSTALLER_RES) $(UTILS_LIB) \\\r\n\t$(OS)\\Translations.obj $(OS)\\Trans_installer_txt.obj\r\n\r\nPDFFILTER_OBJS = \\\r\n\t$(ODLL)\\PdfFilterDll.obj $(ODLL)\\CPdfFilter.obj $(PDFFILTER_RES) \\\r\n\t$(UTILS_LIB) $(LIBMUPDF_LIB) $(OS)\\MuPDF_Exports.obj $(OS)\\PdfEngine.obj\r\n\r\nPDFPREVIEW_OBJS = \\\r\n\t$(ODLL)\\PdfPreviewDll.obj $(ODLL)\\PdfPreview.obj $(PDFPREVIEW_RES) \\\r\n\t$(UTILS_LIB) $(LIBMUPDF_LIB) $(OS)\\MuPDF_Exports.obj $(OS)\\PdfEngine.obj\r\n\r\nENGINEDUMP_OBJS = \\\r\n\t$(OS)\\EngineDump.obj $(ENGINES_LIB) $(FORMAT_LIBS) $(UTILS_LIB) $(OMUI)\\MiniMui.obj $(OMUI)\\TextRender.obj\r\n\r\nMAKELZSA_OBJS = \\\r\n\t$(OU)\\MakeLzSA.obj $(UTILS_LIB) $(ZLIB_OBJS) $(LZMA_OBJS)\r\n\r\nTEST_UTIL_OBJS = \\\r\n\t$(OU)\\test_util.obj $(OS)\\UnitTests.obj $(UTILS_LIB) $(MUPDF_LIB) \\\r\n\t$(OU)\\UtAssert.obj $(OU)\\VarintGob.obj $(OMUI)\\SvgPath.obj \\\r\n\t$(OU)\\BaseUtil_ut.obj $(OU)\\ByteOrderDecoder_ut.obj $(OU)\\CmdLineParser_ut.obj \\\r\n\t$(OU)\\CryptoUtil_ut.obj $(OU)\\CssParser_ut.obj $(OU)\\Dict_ut.obj \\\r\n\t$(OU)\\FileUtil_ut.obj $(OU)\\HtmlPrettyPrint_ut.obj $(OU)\\HtmlPullParser_ut.obj \\\r\n\t$(OU)\\JsonParser_ut.obj $(OU)\\SettingsUtil_ut.obj $(OU)\\SimpleLog_ut.obj \\\r\n\t$(OU)\\SquareTreeParser_ut.obj $(OU)\\StrFormat_ut.obj $(OU)\\StrUtil_ut.obj \\\r\n\t$(OU)\\TrivialHtmlParser_ut.obj $(OU)\\VarintGob_ut.obj $(OU)\\Vec_ut.obj \\\r\n\t$(OU)\\WinUtil_ut.obj $(OMUI)\\SvgPath_ut.obj $(OS)\\AppUtil.obj\r\n\r\nMEMTRACE_OBJS = \\\r\n\t$(OM)\\MemTraceDll.obj $(UTILS_LIB)\r\n\r\nSIGNFILE_OBJS = \\\r\n\t$(OU)\\signfile.obj $(UTILS_LIB) $(MUPDF_LIB)\r\n\r\nPLUGIN_TEST_OBJS = \\\r\n\t$(OU)\\plugin-test.obj $(UTILS_LIB)\r\n\r\n!if \"$(CFG)\"==\"dbg\"\r\n# build all optional IFilters for debug builds\r\nBUILD_TEX_IFILTER = 1\r\nBUILD_EPUB_IFILTER = 1\r\n# build all optional previews for debug builds\r\nBUILD_XPS_PREVIEW = 1\r\nBUILD_DJVU_PREVIEW = 1\r\nBUILD_EPUB_PREVIEW = 1\r\nBUILD_FB2_PREVIEW = 1\r\nBUILD_MOBI_PREVIEW = 1\r\nBUILD_CBZ_PREVIEW = 1\r\nBUILD_CBR_PREVIEW = 1\r\nBUILD_CB7_PREVIEW = 1\r\nBUILD_CBT_PREVIEW = 1\r\nBUILD_TGA_PREVIEW = 1\r\n!endif\r\n\r\n!if \"$(BUILD_TEX_IFILTER)\"!=\"\"\r\nPDFFILTER_OBJS = $(PDFFILTER_OBJS) $(ODLL)\\CTeXFilter.obj\r\nPDFFILTER_CFLAGS = $(PDFFILTER_CFLAGS) /D \"BUILD_TEX_IFILTER\"\r\n!endif\r\n\r\n!if \"$(BUILD_EPUB_IFILTER)\"!=\"\"\r\nPDFFILTER_OBJS = $(PDFFILTER_OBJS) $(ODLL)\\CEpubFilter.obj \\\r\n\t$(OS)\\EbookDoc.obj $(OS)\\MobiDoc.obj $(OU)\\PalmDbReader.obj\r\nPDFFILTER_CFLAGS = $(PDFFILTER_CFLAGS) /D \"BUILD_EPUB_IFILTER\"\r\n!endif\r\n\r\n!if \"$(BUILD_XPS_PREVIEW)\"!=\"\"\r\nPDFPREVIEW_CFLAGS = $(PDFPREVIEW_CFLAGS) /D \"BUILD_XPS_PREVIEW\"\r\n!endif\r\n\r\n!if \"$(BUILD_DJVU_PREVIEW)\"!=\"\"\r\nPDFPREVIEW_CFLAGS = $(PDFPREVIEW_CFLAGS) /D \"BUILD_DJVU_PREVIEW\"\r\nPDFPREVIEW_OBJS = $(PDFPREVIEW_OBJS) $(OS)\\DjVuEngine.obj\r\n!endif\r\n\r\n!if \"$(BUILD_EPUB_PREVIEW)$(BUILD_FB2_PREVIEW)$(BUILD_MOBI_PREVIEW)\"!=\"\"\r\nPDFPREVIEW_OBJS = $(PDFPREVIEW_OBJS) $(OS)\\EbookEngine.obj \\\r\n\t$(EBOOK_OBJS) $(OS)\\ChmDoc.obj $(CHMLIB_OBJS) \\\r\n\t$(OMUI)\\MiniMui.obj $(OMUI)\\TextRender.obj\r\n!if \"$(BUILD_EPUB_PREVIEW)\"!=\"\"\r\nPDFPREVIEW_CFLAGS = $(PDFPREVIEW_CFLAGS) /D \"BUILD_EPUB_PREVIEW\"\r\n!endif\r\n!if \"$(BUILD_FB2_PREVIEW)\"!=\"\"\r\nPDFPREVIEW_CFLAGS = $(PDFPREVIEW_CFLAGS) /D \"BUILD_FB2_PREVIEW\"\r\n!endif\r\n!if \"$(BUILD_MOBI_PREVIEW)\"!=\"\"\r\nPDFPREVIEW_CFLAGS = $(PDFPREVIEW_CFLAGS) /D \"BUILD_MOBI_PREVIEW\"\r\n!endif\r\n!endif\r\n\r\n!if \"$(BUILD_CBZ_PREVIEW)$(BUILD_CBR_PREVIEW)$(BUILD_CB7_PREVIEW)$(BUILD_CBT_PREVIEW)$(BUILD_TGA_PREVIEW)\"!=\"\"\r\nPDFPREVIEW_OBJS = $(PDFPREVIEW_OBJS) $(OS)\\ImagesEngine.obj $(OS)\\PdfCreator.obj\r\n!if \"$(BUILD_CBZ_PREVIEW)\"!=\"\"\r\nPDFPREVIEW_CFLAGS = $(PDFPREVIEW_CFLAGS) /D \"BUILD_CBZ_PREVIEW\"\r\n!endif\r\n!if \"$(BUILD_CBR_PREVIEW)\"!=\"\"\r\nPDFPREVIEW_CFLAGS = $(PDFPREVIEW_CFLAGS) /D \"BUILD_CBR_PREVIEW\"\r\n!endif\r\n!if \"$(BUILD_CB7_PREVIEW)\"!=\"\"\r\nPDFPREVIEW_CFLAGS = $(PDFPREVIEW_CFLAGS) /D \"BUILD_CB7_PREVIEW\"\r\n!endif\r\n!if \"$(BUILD_CBT_PREVIEW)\"!=\"\"\r\nPDFPREVIEW_CFLAGS = $(PDFPREVIEW_CFLAGS) /D \"BUILD_CBT_PREVIEW\"\r\n!endif\r\n!if \"$(BUILD_TGA_PREVIEW)\"!=\"\"\r\nPDFPREVIEW_CFLAGS = $(PDFPREVIEW_CFLAGS) /D \"BUILD_TGA_PREVIEW\"\r\n!endif\r\n!endif\r\n\r\nCJK_FALLBACK_FONT = $(MUPDF_DIR)\\resources\\fonts\\droid\\DroidSansFallback.ttf\r\n\r\n##### SumatraPDF-specific build rules #####\r\n\r\nrebuild: clean all_sumatrapdf\r\n\r\nrebuildquick: clean OnlySumatraPDF\r\n\r\ncleanmupdf: force\r\n\t-del $(FITZ_DRAW_OBJS) $(FITZ_OBJS) $(MUPDF_OBJS) $(MUXPS_OBJS) $(MUCBZ_OBJS)\r\n\r\ncleanall: force\r\n\t-rmdir /S /Q obj-dbg obj-rel\r\n\r\nOnlySumatraPDF: $(OS) $(SUMATRA_APP)\r\nSumatraPDF:    $(OS) $(SUMATRA_APP) $(SUMATRA_APP_NO_MUPDF)\r\nInstaller:     $(OS) $(INSTALLER_APP)\r\nUninstaller:   $(OS) $(UNINSTALLER_APP)\r\nPDFFilter:     $(OS) $(PDFFILTER_DLL)\r\nPdfPreview:    $(OS) $(PDFPREVIEW_DLL)\r\nEngineDump:    $(OS) $(ENGINEDUMP_APP)\r\nMakeLzsa:      $(OS) $(MAKELZSA_APP)\r\nUnitTest:      $(OS) $(TEST_UTIL_APP)\r\nAllSymbols:    $(O)  $(SYMBOLS_LZSA)\r\nmemtrace:      $(OS) $(MEMTRACE_DLL)\r\nmudraw:        $(O)  $(MUDRAW_APP)\r\nmutool:        $(O)  $(MUTOOL_APP)\r\nsignfile:      $(OU) $(SIGNFILE_APP)\r\nplugin-test:   $(OU) $(PLUGIN_TEST_APP)\r\n\r\n$(OS): $(O) $(OE)\r\n\t@if not exist $(OS) mkdir $(OS)\r\n\t@if not exist $(OU) mkdir $(OU)\r\n\t@if not exist $(ODLL) mkdir $(ODLL)\r\n\t@if not exist $(OMUI) mkdir $(OMUI)\r\n\t@if not exist $(OM) mkdir $(OM)\r\n\t@if not exist $(OUIA) mkdir $(OUIA)\r\n\r\n$(SUMATRA_RES): $(SRCDIR)\\SumatraPDF.rc $(SRCDIR)\\Resource.h $(SRCDIR)\\Version.h $(SRCDIR)\\EbookWinDesc.txt\r\n\trc /r /fo$@ $(RC_FLAGS) $(SRCDIR)\\SumatraPDF.rc\r\n\r\n$(SUMATRA_APP): $(SUMATRA_OBJS) $(FORMAT_LIBS)\r\n\t$(LD) $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@\r\n\r\n$(SUMATRA_APP_NO_MUPDF): $(SUMATRA_OBJS) $(LIBMUPDF_LIB) $(OS)\\MuPDF_Exports.obj\r\n\t$(LD) $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@\r\n\r\n$(LIBMUPDF_RES): $(SRCDIR)\\libmupdf.rc $(SRCDIR)\\Version.h\r\n\trc /r /fo$@ $(RC_FLAGS) $(SRCDIR)\\libmupdf.rc\r\n\r\n$(LIBMUPDF_DLL): $(FORMAT_LIBS) $(LIBMUPDF_RES) $(LIBMUPDF_DEF)\r\n\t$(LD) /DLL $(LDFLAGS) $(FORMAT_LIBS) $(LIBMUPDF_RES) $(LIBS) /DEF:$(LIBMUPDF_DEF) /IMPLIB:$(LIBMUPDF_LIB) /PDB:$*.pdb /OUT:$@\r\n\r\n$(LIBMUPDF_LIB): $(LIBMUPDF_DLL)\r\n\r\n$(INSTALLER_DATA): $(MAKELZSA_APP) $(SUMATRA_APP_NO_MUPDF) $(LIBMUPDF_DLL) $(CJK_FALLBACK_FONT) $(PDFFILTER_DLL) $(PDFPREVIEW_DLL) $(UNINSTALLER_APP)\r\n\t$(MAKELZSA_APP) $@ $(SUMATRA_APP_NO_MUPDF):SumatraPDF.exe $(LIBMUPDF_DLL):libmupdf.dll $(CJK_FALLBACK_FONT):DroidSansFallback.ttf $(PDFFILTER_DLL):PdfFilter.dll $(PDFPREVIEW_DLL):PdfPreview.dll $(UNINSTALLER_APP):uninstall.exe\r\n\r\n$(INSTALLER_RES): $(SRCDIR)\\installer\\Installer.rc $(SRCDIR)\\installer\\Resource.h $(SRCDIR)\\Version.h $(INSTALLER_DATA)\r\n\trc /r /fo$@ $(RC_FLAGS) /D \"INSTALL_PAYLOAD_ZIP=..\\..\\$(INSTALLER_DATA)\" $(SRCDIR)\\installer\\Installer.rc\r\n\r\n$(UNINSTALLER_RES): $(SRCDIR)\\installer\\Installer.rc $(SRCDIR)\\installer\\Resource.h $(SRCDIR)\\Version.h\r\n\trc /r /fo$@ $(RC_FLAGS) /D \"BUILD_UNINSTALLER\" $(SRCDIR)\\installer\\Installer.rc\r\n\r\n$(INSTALLER_APP): $(INSTALLER_OBJS)\r\n\t$(LD) $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@\r\n\r\n$(UNINSTALLER_APP): $(UNINSTALLER_OBJS)\r\n\t$(LD) $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@\r\n\r\n$(PDFFILTER_RES): $(SRCDIR)\\ifilter\\PdfFilter.rc $(SRCDIR)\\Version.h\r\n\trc /r /fo$@ $(RC_FLAGS) $(SRCDIR)\\ifilter\\PdfFilter.rc\r\n\r\n$(PDFFILTER_DLL): $(PDFFILTER_OBJS)\r\n\t$(LD) /DLL $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@\r\n\r\n$(PDFPREVIEW_RES): $(SRCDIR)\\previewer\\PdfPreview.rc $(SRCDIR)\\Version.h\r\n\trc /r /fo$@ $(RC_FLAGS) $(SRCDIR)\\previewer\\PdfPreview.rc\r\n\r\n$(PDFPREVIEW_DLL): $(PDFPREVIEW_OBJS)\r\n\t$(LD) /DLL $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@\r\n\r\n$(MEMTRACE_RES): $(SRCDIR)\\memtrace\\MemTrace.rc\r\n\trc /r /fo$@ $(RC_FLAGS) $(SRCDIR)\\memtrace\\MemTrace.rc\r\n\r\n$(MEMTRACE_DLL): $(MEMTRACE_OBJS)\r\n\t$(LD) /DLL $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@\r\n\r\n$(ENGINEDUMP_APP): $(ENGINEDUMP_OBJS)\r\n\t$(LD) $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@ /SUBSYSTEM:CONSOLE\r\n\r\n$(MAKELZSA_APP): $(MAKELZSA_OBJS)\r\n\t$(LD) $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@ /SUBSYSTEM:CONSOLE\r\n\r\n$(TEST_UTIL_APP): $(TEST_UTIL_OBJS)\r\n\t$(LD) $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@ /SUBSYSTEM:CONSOLE\r\n\r\n$(SIGNFILE_APP): $(SIGNFILE_OBJS)\r\n\t$(LD) $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@ /SUBSYSTEM:CONSOLE\r\n\r\n$(PLUGIN_TEST_APP): $(PLUGIN_TEST_OBJS)\r\n\t$(LD) $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@\r\n\r\n{$(SRCDIR)\\utils}.cpp{$(OU)}.obj::\r\n\t$(CC) $(UTILS_CFLAGS) /Fo$(OU)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(SRCDIR)\\wingui}.cpp{$(OU)}.obj::\r\n\t$(CC) $(UTILS_CFLAGS) /Fo$(OU)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(SRCDIR)\\mui}.cpp{$(OMUI)}.obj::\r\n\t$(CC) $(UTILS_CFLAGS) /Fo$(OMUI)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(SRCDIR)\\tools}.cpp{$(OU)}.obj::\r\n\t$(CC) $(UTILS_CFLAGS) /Fo$(OU)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(SRCDIR)\\utils\\tests}.cpp{$(OU)}.obj::\r\n\t$(CC) $(UTILS_CFLAGS) /Fo$(OU)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(SRCDIR)\\uia}.cpp{$(OUIA)}.obj::\r\n\t$(CC) $(SUMATRA_CFLAGS) /Fo$(OUIA)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(SRCDIR)}.cpp{$(OS)}.obj::\r\n\t$(CC) $(SUMATRA_CFLAGS) /Fo$(OS)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(SRCDIR)\\ifilter}.cpp{$(ODLL)}.obj::\r\n\t$(CC) $(PDFFILTER_CFLAGS) /Fo$(ODLL)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(SRCDIR)\\previewer}.cpp{$(ODLL)}.obj::\r\n\t$(CC) $(PDFPREVIEW_CFLAGS) /Fo$(ODLL)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(SRCDIR)\\regress}.cpp{$(OS)}.obj::\r\n\t$(CC) $(SUMATRA_CFLAGS) /Fo$(OS)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n{$(SRCDIR)\\installer}.cpp{$(OS)}.obj::\r\n\t$(CC) $(INSTALLER_CFLAGS) /Fo$(OS)\\ /Fd$(O)\\vc80.pdb $<\r\n$(OS)\\Uninstaller.obj: $(OS)\\Installer.obj\r\n\t$(CC) $(UNINSTALLER_CFLAGS) /Fo$(OS)\\Uninstaller.obj /Fd$(O)\\vc80.pdb $(SRCDIR)\\installer\\Installer.cpp\r\n\r\n{$(SRCDIR)\\memtrace}.cpp{$(OM)}.obj::\r\n\t$(CC) $(MEMTRACE_CFLAGS) /Fo$(OM)\\ /Fd$(O)\\vc80.pdb $<\r\n\r\n$(MUPDF_LIB): $(MUPDF_ALL_OBJS)\r\n\tlib $(LIB_FLAGS) /OUT:$@ $**\r\n\r\n$(UNARR_LIB): $(UNARR_OBJS) $(BZIP2_OBJS) $(LZMA_OBJS) $(_7Z_OBJS)\r\n\tlib $(LIB_FLAGS) /OUT:$@ $**\r\n\r\n$(UTILS_LIB): $(UTILS_OBJS)\r\n\tlib $(LIB_FLAGS) /OUT:$@ $**\r\n\r\n$(MUI_LIB): $(MUI_OBJS)\r\n\tlib $(LIB_FLAGS) /OUT:$@ $**\r\n\r\n$(ENGINES_LIB): $(ENGINE_OBJS)\r\n\tlib $(LIB_FLAGS) /OUT:$@ $**\r\n\r\n$(MAIN_UI_LIB): $(MAIN_UI_OBJS)\r\n\tlib $(LIB_FLAGS) /OUT:$@ $**\r\n\r\n$(SYMBOLS_LZSA): $(MAKELZSA_APP) $(SUMATRA_APP) $(INSTALLER_APP)\r\n\t$(MAKELZSA_APP) $@ $(O)\\libmupdf.pdb:libmupdf.pdb $(O)\\Installer.pdb:Installer.pdb $(O)\\SumatraPDF-no-MuPDF.pdb:SumatraPDF-no-MuPDF.pdb $(O)\\SumatraPDF.pdb:SumatraPDF.pdb\r\n\r\n## Header-dependencies for $(SRCDIR)\\* and $(SRCDIR)\\*\\*\r\n!INCLUDE makefile.deps\r\n"
  },
  {
    "path": "mupdf/CHANGES",
    "content": "List of changes in MuPDF 1.6\n\n* Features:\n\t* Color detection device (mudraw -T).\n\t* Sepia mode full-page color tinting in X11 and win32 viewer (keybinding: shift-C).\n\t* Re-implement printf and strtod due to portability issue with locales and number formatting.\n\t* Add 'gsview' project: a Windows Modern UI viewer.\n\t* Improve XML parser interface.\n* Bug fixes:\n\t* CBZ page ordering\n\t* ZIP64 support\n\t* iOS and Android bug fixes\n\t* Miscellaneous minor fixes\n\n\nList of changes in MuPDF 1.5\n\n* Bug fixes.\n\n\nList of changes in MuPDF 1.4\n\n* Headline changes:\n\t* CMYK rendering (mudraw PWG and PAM formats)\n\t* TIFF viewer (with multi-page support).\n\t* Added MuJS Javascript interpreter.\n\t\t* MuJS is the default, V8 and JavaScriptCore are compile time options.\n\t\t* Javascript support has to be explicitly enabled with pdf_enable_js.\n\t\t* All viewers now have JavaScript enabled in the default builds.\n* Viewers:\n\t* X11: Horizontal scroll wheel support.\n\t* X11: Status bar display with warnings.\n\t* Android: Digital signatures.\n\t* iOS: Links, form filling, annotation editing, and javascript.\n\t* iOS: Reflow mode.\n\t* WinRT: Printing.\n\t* WinRT: Improved zooming behaviour.\n* Tools:\n\t* mudraw: Banded rendering with -B /band-height/.\n\t* mudraw: Select output format with -F /format/.\n\t* mudraw: Write to stdout if you use '-' as the output file name.\n\t* mudraw: Add TGA output format.\n\t* mudraw: Improved SVG output.\n\t* mutool show: Write output to file instead of stdout with -o /filename/.\n\t* mutool clean: Clean content streams with -s option.\n* Annotations:\n\t* Improved font handling.\n\t* Form fields.\n\t* Free text.\n\t* Sticky notes.\n* Optimizations:\n\t* glyph cache: Partial eviction.\n\t* glyph cache: Run-length compressed glyphs.\n\t* Smarter handling of subpixel metrics in text rendering.\n\t* Optimized blitting functions.\n\t* Optimized gradient mesh drawing.\n* API changes and additions:\n\t* fz_stream API reworked: replace \"read\" function with \"next\".\n\t* \"Rebind\" functions to associate context bound objects with another context:\n\t\tfz_output, fz_stream, fz_device and fz_document.\n\t* Introduce \"document handlers\" to detect and open different file types.\n\t\t* Must now call fz_register_document_handlers() to register the defaults.\n\t\t* May register your own handlers as well to work with fz_open_document.\n\t* Hook to load system fonts: fz_install_load_system_font_funcs.\n\t* PDF xref cache flushing functions (mark/clear/clear-to-mark).\n\t* Add our own \"printf\" set of functions to format strings and write to fz_output:\n\t\t* Format %f as short as possible while preserving precision.\n\t\t* Has %C for formatting a unicode character as UTF-8.\n\t\t* Has %M to format fz_matrix.\n\t\t* Has %R to format fz_rect.\n\t\t* Has %q and %( to format strings with escaped characters.\n\t* PDF process interface: allow PDF interpreter to do more than just draw!\n\t\t* Content stream state cleaning filter.\n\t\t* Content stream rewriting filter.\n\t* PDF digital signatures.\n\t* Stroke states may now be stored on the stack.\n\t* Improved fz_path internals.\n\t* Gradient mesh drawing interface has been improved.\n\t* Save files with incremental updates.\n\n\nList of changes in MuPDF 1.3\n\n * Windows RT viewer app for MuPDF.\n * Library changes to support progressive loading (display PDF files as\n   they download). Windows/Linux/MacOS viewer supports this using curl.\n * Incremental updates to PDF files are now (optionally) preserved on\n   loading/saving.\n * Prototype support for checking PDF Digital Signatures.\n * Initial annotation support (strike-out, underline, highlight and ink)\n   (library and android builds only).\n * Fix operation on Android API level 8.\n * Android redraw optimisations.\n * Android app now supports Google Cloud Print.\n * Android app translated into many languages.\n * Android support for more architectures.\n * Improvements to store (avoid collisions causing unnecessary evictions).\n * Windows apps use Unicode filenames now.\n * PDF function handling improved; functions can now be passed to devices\n   without 'sampling'.\n * PDF image handling improved; images can now be passed to devices\n   without decompression.\n * Indexed images are no longer uncompressed at load time, saving memory.\n * Caching of rendered tiles for speed.\n * Improved text analysis mode, capable of spotting columns/indents,\n   right-to-left text etc.\n * HTML output mode now includes image output.\n * PDF password encoding handling improved.\n * MuPDF now opens Jpeg, Tiff and PNG files directly.\n * Bug preventing OpenXPS files from being opened fixed.\n * Initial (feature incomplete) SVG and PDF output devices.\n * PWG raster (mono/grey/RGB) and PCL (mono) output devices.\n * Various performance improvements (including tilings and mesh based\n   shadings).\n * Revamped directory structure to reflect recent changes.\n * Various potential SEGV, SoftMask and rendering fixes.\n * Many potential crashes in Jpeg2000 and JBIG2 images fixed.\n\n\nList of changes in MuPDF 1.2\n\n * Important API changes:\n    * fz_bbox is now fz_irect.\n    * APIs (including fz_device) now pass fz_rect/fz_matrix by reference.\n    * fz_device API is now more consistent with regards to use of\n      fz_rect rather than fz_bbox.\n * Add support for Javascript and forms handling.\n * Fix many SEGVs with out of spec files. Many thanks to Mateusz \"j00ru\"\n   Jurczyk and Gynvael Coldwind of the Google Security team, zeniko,\n   Sebastian Rasmussen and all other contributors.\n * Add fz_open_document_with_stream to allow non-file based operation.\n * Move to using git submodules for third party libraries.\n * Much enhanced Android application. Now on Google Play!\n * Oversized and stroke text clipping implemented.\n * Change shadings to decompose at render times; massive memory savings.\n * Renamed 'mubusy' to 'mutool'.\n * PDF 1.7 Extension Level 8 encryption implemented.\n * Added consts to various parts of the API to help C++ interworking.\n * Prototype transition support.\n * Text searching API moved to fitz.\n * Highlight and copy text selections.\n * Performance enhancements for color conversion and fax decompression.\n * ARM optimisations for color conversion and bitmap scaling.\n * Bitmap subsampling stage introduced, with ARM optimisations.\n * Type 3 fonts; glyphs are now handled as display lists.\n * Scan converter performance improvements.\n * Various rendering fixes.\n\n\nList of changes in MuPDF 1.1\n\n * Rendering bugs fixed (text clipping, stroked text etc).\n * Better handling of 'large' (uncachable) glyphs.\n * Added a delete button to the library view on the iOS port.\n * Minor speed optimisations.\n * Shading bug fixes.\n * Move to using dynamically allocated parsing buffers (more resilient).\n * Support for UserUnits.\n * Fix bugs with image predictors (including with 16 bit images).\n * More resilient to out of spec files.\n * Extract pdf writing capability into the library from pdfclean, and\n   expand on it to allow for linearisation. Bug fixes in the garbage\n   collection of unused objects.\n * Improve pdf writing recognition of images.\n * Improved font matching.\n * Start to move away from macros to inline functions (helpful for\n   applications requiring certification).\n * Many bugs fixed.\n"
  },
  {
    "path": "mupdf/CONTRIBUTORS",
    "content": "MuPDF was developed by Artifex Software, who own the copyright.\nAlong the way various patches for bug fixes and features were\ncontributed by many outside developers. We are grateful for\nthese contributions, and while privacy/brevity/confidentiality\nprevent us from listing everyone here, we would like to thank\nthe following in particular:\n\n * Simon Bnzli (zeniko, of the SumatraPDF project).\n\n * Krzysztof Kowalczyk (of the SumatraPDF project). \n\n * Sebastian Rasmussen (Sebras).\n"
  },
  {
    "path": "mupdf/COPYING",
    "content": "                    GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  Developers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\n  A secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate.  Many developers of free software are heartened and\nencouraged by the resulting cooperation.  However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\n  The GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community.  It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server.  Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\n  An older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals.  This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU Affero General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Remote Network Interaction; Use with the GNU General Public License.\n\n  Notwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software.  This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time.  Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Affero General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Affero General Public License for more details.\n\n    You should have received a copy of the GNU Affero General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source.  For example, if your program is a web application, its\ninterface could display a \"Source\" link that leads users to an archive\nof the code.  There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n<http://www.gnu.org/licenses/>.\n"
  },
  {
    "path": "mupdf/Makefile",
    "content": "# GNU Makefile\n\nbuild ?= debug\n\nOUT := build/$(build)\nGEN := generated\n\ndefault: all\n\n# --- Configuration ---\n\n# Do not specify CFLAGS or LIBS on the make invocation line - specify\n# XCFLAGS or XLIBS instead. Make ignores any lines in the makefile that\n# set a variable that was set on the command line.\nCFLAGS += $(XCFLAGS) -Iinclude -I$(GEN)\nLIBS += $(XLIBS) -lm\n\ninclude Makerules\ninclude Makethird\n\nTHIRD_LIBS += $(FREETYPE_LIB)\nTHIRD_LIBS += $(JBIG2DEC_LIB)\nTHIRD_LIBS += $(JPEG_LIB)\nTHIRD_LIBS += $(OPENJPEG_LIB)\nTHIRD_LIBS += $(OPENSSL_LIB)\nTHIRD_LIBS += $(ZLIB_LIB)\n\nLIBS += $(FREETYPE_LIBS)\nLIBS += $(JBIG2DEC_LIBS)\nLIBS += $(JPEG_LIBS)\nLIBS += $(OPENJPEG_LIBS)\nLIBS += $(OPENSSL_LIBS)\nLIBS += $(ZLIB_LIBS)\n\nCFLAGS += $(FREETYPE_CFLAGS)\nCFLAGS += $(JBIG2DEC_CFLAGS)\nCFLAGS += $(JPEG_CFLAGS)\nCFLAGS += $(OPENJPEG_CFLAGS)\nCFLAGS += $(OPENSSL_CFLAGS)\nCFLAGS += $(ZLIB_CFLAGS)\n\n# --- Commands ---\n\nifneq \"$(verbose)\" \"yes\"\nQUIET_AR = @ echo ' ' ' ' AR $@ ;\nQUIET_CC = @ echo ' ' ' ' CC $@ ;\nQUIET_CXX = @ echo ' ' ' ' CXX $@ ;\nQUIET_GEN = @ echo ' ' ' ' GEN $@ ;\nQUIET_LINK = @ echo ' ' ' ' LINK $@ ;\nQUIET_MKDIR = @ echo ' ' ' ' MKDIR $@ ;\nQUIET_RM = @ echo ' ' ' ' RM $@ ;\nendif\n\nCC_CMD = $(QUIET_CC) $(CC) $(CFLAGS) -o $@ -c $<\nCXX_CMD = $(QUIET_CXX) $(CXX) $(CFLAGS) -o $@ -c $<\nAR_CMD = $(QUIET_AR) $(AR) cr $@ $^\nLINK_CMD = $(QUIET_LINK) $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)\nMKDIR_CMD = $(QUIET_MKDIR) mkdir -p $@\nRM_CMD = $(QUIET_RM) rm -f $@\n\n# --- File lists ---\n\nALL_DIR := $(OUT)/fitz\nALL_DIR += $(OUT)/pdf $(OUT)/pdf/js\nALL_DIR += $(OUT)/xps\nALL_DIR += $(OUT)/cbz\nALL_DIR += $(OUT)/img\nALL_DIR += $(OUT)/tiff\nALL_DIR += $(OUT)/tools\nALL_DIR += $(OUT)/platform/x11\nALL_DIR += $(OUT)/platform/x11/curl\n\nFITZ_HDR := include/mupdf/fitz.h $(wildcard include/mupdf/fitz/*.h)\nPDF_HDR := include/mupdf/pdf.h $(wildcard include/mupdf/pdf/*.h)\nXPS_HDR := include/mupdf/xps.h\nCBZ_HDR := include/mupdf/cbz.h\nIMG_HDR := include/mupdf/img.h\n\nFITZ_SRC := $(wildcard source/fitz/*.c)\nPDF_SRC := $(wildcard source/pdf/*.c)\nXPS_SRC := $(wildcard source/xps/*.c)\nCBZ_SRC := $(wildcard source/cbz/*.c)\nIMG_SRC := $(wildcard source/img/*.c)\nTIFF_SRC := $(wildcard source/tiff/*.c)\n\nFITZ_SRC_HDR := $(wildcard source/fitz/*.h)\nPDF_SRC_HDR := $(wildcard source/pdf/*.h)\nXPS_SRC_HDR := $(wildcard source/xps/*.h)\nCBZ_SRC_HDR := $(wildcard source/cbz/*.h)\nIMG_SRC_HDR := $(wildcard source/img/*.h)\nTIFF_SRC_HDR := $(wildcard source/tiff/*.h)\n\nFITZ_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(FITZ_SRC))))\nPDF_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(PDF_SRC))))\nXPS_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(XPS_SRC))))\nCBZ_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(CBZ_SRC))))\nIMG_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(IMG_SRC))))\nTIFF_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(TIFF_SRC))))\n\n# --- Choice of Javascript library ---\n\nifeq \"$(HAVE_MUJS)\" \"yes\"\nPDF_OBJ += $(OUT)/pdf/js/pdf-js.o\nPDF_OBJ += $(OUT)/pdf/js/pdf-jsimp-mu.o\nTHIRD_LIBS += $(MUJS_LIB)\nLIBS += $(MUJS_LIBS)\nCFLAGS += $(MUJS_CFLAGS)\nelse ifeq \"$(HAVE_JSCORE)\" \"yes\"\nPDF_OBJ += $(OUT)/pdf/js/pdf-js.o\nPDF_OBJ += $(OUT)/pdf/js/pdf-jsimp-jscore.o\nLIBS += $(JSCORE_LIBS)\nCFLAGS += $(JSCORE_CFLAGS)\nelse ifeq \"$(HAVE_V8)\" \"yes\"\nPDF_OBJ += $(OUT)/pdf/js/pdf-js.o\nPDF_OBJ += $(OUT)/pdf/js/pdf-jsimp-cpp.o $(OUT)/pdf/js/pdf-jsimp-v8.o\nLIBS += $(V8_LIBS)\nCFLAGS += $(V8_CFLAGS)\nelse\nPDF_OBJ += $(OUT)/pdf/js/pdf-js-none.o\nendif\n\n$(FITZ_OBJ) : $(FITZ_HDR) $(FITZ_SRC_HDR)\n$(PDF_OBJ) : $(FITZ_HDR) $(PDF_HDR) $(PDF_SRC_HDR)\n$(XPS_OBJ) : $(FITZ_HDR) $(XPS_HDR) $(XPS_SRC_HDR)\n$(CBZ_OBJ) : $(FITZ_HDR) $(CBZ_HDR) $(CBZ_SRC_HDR)\n$(IMG_OBJ) : $(FITZ_HDR) $(IMG_HDR) $(IMG_SRC_HDR)\n$(TIFF_OBJ) : $(FITZ_HDR) $(IMG_HDR) $(TIFF_SRC_HDR)\n\n# --- Library ---\n\nMUPDF_LIB := $(OUT)/libmupdf.a\n\n$(MUPDF_LIB) : $(FITZ_OBJ) $(PDF_OBJ) $(XPS_OBJ) $(CBZ_OBJ) $(IMG_OBJ) $(TIFF_OBJ)\n\nINSTALL_LIBS := $(MUPDF_LIB)\n\n# --- Rules ---\n\n$(ALL_DIR) $(OUT) $(GEN) :\n\t$(MKDIR_CMD)\n\n$(OUT)/%.a :\n\t$(RM_CMD)\n\t$(AR_CMD)\n\t$(RANLIB_CMD)\n\n$(OUT)/%: $(OUT)/%.o\n\t$(LINK_CMD)\n\n$(OUT)/%.o : source/%.c | $(ALL_DIR)\n\t$(CC_CMD)\n\n$(OUT)/%.o : source/%.cpp | $(ALL_DIR)\n\t$(CXX_CMD)\n\n$(OUT)/%.o : scripts/%.c | $(OUT)\n\t$(CC_CMD)\n\n$(OUT)/platform/x11/%.o : platform/x11/%.c | $(ALL_DIR)\n\t$(CC_CMD) $(X11_CFLAGS)\n\n$(OUT)/platform/x11/curl/%.o : platform/x11/%.c | $(ALL_DIR)\n\t$(CC_CMD) $(X11_CFLAGS) $(CURL_CFLAGS) -DHAVE_CURL\n\n.PRECIOUS : $(OUT)/%.o # Keep intermediates from chained rules\n\n# --- Generated CMAP, FONT and JAVASCRIPT files ---\n\nCMAPDUMP := $(OUT)/cmapdump\nFONTDUMP := $(OUT)/fontdump\nCQUOTE := $(OUT)/cquote\nBIN2HEX := $(OUT)/bin2hex\n\nCMAP_CNS_SRC := $(wildcard resources/cmaps/cns/*)\nCMAP_GB_SRC := $(wildcard resources/cmaps/gb/*)\nCMAP_JAPAN_SRC := $(wildcard resources/cmaps/japan/*)\nCMAP_KOREA_SRC := $(wildcard resources/cmaps/korea/*)\n\nFONT_BASE14_SRC := $(wildcard resources/fonts/urw/*.cff)\nFONT_CJK_SRC := resources/fonts/droid/DroidSansFallback.ttc\nFONT_CJK_FULL_SRC := resources/fonts/droid/DroidSansFallbackFull.ttc\n\n$(GEN)/gen_cmap_cns.h : $(CMAP_CNS_SRC)\n\t$(QUIET_GEN) $(CMAPDUMP) $@ $(CMAP_CNS_SRC)\n$(GEN)/gen_cmap_gb.h : $(CMAP_GB_SRC)\n\t$(QUIET_GEN) $(CMAPDUMP) $@ $(CMAP_GB_SRC)\n$(GEN)/gen_cmap_japan.h : $(CMAP_JAPAN_SRC)\n\t$(QUIET_GEN) $(CMAPDUMP) $@ $(CMAP_JAPAN_SRC)\n$(GEN)/gen_cmap_korea.h : $(CMAP_KOREA_SRC)\n\t$(QUIET_GEN) $(CMAPDUMP) $@ $(CMAP_KOREA_SRC)\n\nCMAP_GEN := $(addprefix $(GEN)/, gen_cmap_cns.h gen_cmap_gb.h gen_cmap_japan.h gen_cmap_korea.h)\n\n$(GEN)/gen_font_base14.h : $(FONT_BASE14_SRC)\n\t$(QUIET_GEN) $(FONTDUMP) $@ $(FONT_BASE14_SRC)\n$(GEN)/gen_font_cjk.h : $(FONT_CJK_SRC)\n\t$(QUIET_GEN) $(FONTDUMP) $@ $(FONT_CJK_SRC)\n$(GEN)/gen_font_cjk_full.h : $(FONT_CJK_FULL_SRC)\n\t$(QUIET_GEN) $(FONTDUMP) $@ $(FONT_CJK_FULL_SRC)\n\nFONT_GEN := $(GEN)/gen_font_base14.h $(GEN)/gen_font_droid.h $(GEN)/gen_font_cjk.h $(GEN)/gen_font_cjk_full.h\n\nJAVASCRIPT_SRC := source/pdf/js/pdf-util.js\nJAVASCRIPT_GEN := $(GEN)/gen_js_util.h\n$(JAVASCRIPT_GEN) : $(JAVASCRIPT_SRC)\n\t$(QUIET_GEN) $(CQUOTE) $@ $(JAVASCRIPT_SRC)\n\nADOBECA_SRC := resources/certs/AdobeCA.p7c\nADOBECA_GEN := $(GEN)/gen_adobe_ca.h\n$(ADOBECA_GEN) : $(ADOBECA_SRC)\n\t$(QUIET_GEN) $(BIN2HEX) $@ $(ADOBECA_SRC)\n\nifneq \"$(CROSSCOMPILE)\" \"yes\"\n$(CMAP_GEN) : $(CMAPDUMP) | $(GEN)\n$(FONT_GEN) : $(FONTDUMP) | $(GEN)\n$(JAVASCRIPT_GEN) : $(CQUOTE) | $(GEN)\n$(ADOBECA_GEN) : $(BIN2HEX) | $(GEN)\nendif\n\ngenerate: $(CMAP_GEN) $(FONT_GEN) $(JAVASCRIPT_GEN) $(ADOBECA_GEN)\n\n$(OUT)/pdf/pdf-cmap-table.o : $(CMAP_GEN)\n$(OUT)/pdf/pdf-fontfile.o : $(FONT_GEN)\n$(OUT)/pdf/pdf-pkcs7.o : $(ADOBECA_GEN)\n$(OUT)/pdf/js/pdf-js.o : $(JAVASCRIPT_GEN)\n$(OUT)/cmapdump.o : include/mupdf/pdf/cmap.h source/pdf/pdf-cmap.c source/pdf/pdf-cmap-parse.c\n\n# --- Tools and Apps ---\n\nMUDRAW := $(addprefix $(OUT)/, mudraw)\nMUDRAW_OBJ := $(addprefix $(OUT)/tools/, mudraw.o)\n$(MUDRAW_OBJ) : $(FITZ_HDR)\n$(MUDRAW) : $(MUPDF_LIB) $(THIRD_LIBS)\n$(MUDRAW) : $(MUDRAW_OBJ)\n\t$(LINK_CMD)\n\nMUTOOL := $(addprefix $(OUT)/, mutool)\nMUTOOL_OBJ := $(addprefix $(OUT)/tools/, mutool.o pdfclean.o pdfextract.o pdfinfo.o pdfposter.o pdfshow.o)\n$(MUTOOL_OBJ): $(FITZ_HDR) $(PDF_HDR)\n$(MUTOOL) : $(MUPDF_LIB) $(THIRD_LIBS)\n$(MUTOOL) : $(MUTOOL_OBJ)\n\t$(LINK_CMD)\n\nMJSGEN := $(OUT)/mjsgen\n$(MJSGEN) : $(MUPDF_LIB) $(THIRD_LIBS)\n$(MJSGEN) : $(addprefix $(OUT)/tools/, mjsgen.o)\n\t$(LINK_CMD)\n\nMUJSTEST := $(OUT)/mujstest\n$(MUJSTEST) : $(MUPDF_LIB) $(THIRD_LIBS)\n$(MUJSTEST) : $(addprefix $(OUT)/platform/x11/, jstest_main.o pdfapp.o)\n\t$(LINK_CMD)\n\nifeq \"$(HAVE_X11)\" \"yes\"\nMUVIEW_X11 := $(OUT)/mupdf-x11\nMUVIEW_X11_OBJ := $(addprefix $(OUT)/platform/x11/, x11_main.o x11_image.o pdfapp.o)\n$(MUVIEW_X11_OBJ) : $(FITZ_HDR) $(PDF_HDR)\n$(MUVIEW_X11) : $(MUPDF_LIB) $(THIRD_LIBS)\n$(MUVIEW_X11) : $(MUVIEW_X11_OBJ)\n\t$(LINK_CMD) $(X11_LIBS)\n\nifeq \"$(HAVE_CURL)\" \"yes\"\nMUVIEW_X11_CURL := $(OUT)/mupdf-x11-curl\nMUVIEW_X11_CURL_OBJ := $(addprefix $(OUT)/platform/x11/curl/, x11_main.o x11_image.o pdfapp.o curl_stream.o)\n$(MUVIEW_X11_CURL_OBJ) : $(FITZ_HDR) $(PDF_HDR)\n$(MUVIEW_X11_CURL) : $(MUPDF_LIB) $(THIRD_LIBS) $(CURL_LIB)\n$(MUVIEW_X11_CURL) : $(MUVIEW_X11_CURL_OBJ)\n\t$(LINK_CMD) $(X11_LIBS) $(CURL_LIBS) $(SYS_CURL_DEPS)\nendif\nendif\n\nMUVIEW := $(MUVIEW_X11)\nMUVIEW_CURL := $(MUVIEW_X11_CURL)\n\nINSTALL_APPS := $(MUDRAW) $(MUTOOL) $(MUVIEW) $(MUJSTEST) $(MUVIEW_CURL)\n\n# --- Update version string header ---\n\nVERSION = $(shell git describe --tags)\n\nversion:\n\tsed -i~ -e '/FZ_VERSION /s/\".*\"/\"'$(VERSION)'\"/' include/mupdf/fitz/version.h\n\n# --- Format man pages ---\n\n%.txt: %.1\n\tnroff -man $< | col -b | expand > $@\n\nMAN_FILES := $(wildcard docs/man/*.1)\nTXT_FILES := $(MAN_FILES:%.1=%.txt)\n\ncatman: $(TXT_FILES)\n\n# --- Install ---\n\nprefix ?= /usr/local\nbindir ?= $(prefix)/bin\nlibdir ?= $(prefix)/lib\nincdir ?= $(prefix)/include\nmandir ?= $(prefix)/share/man\ndocdir ?= $(prefix)/share/doc/mupdf\n\nthird: $(THIRD_LIBS) $(CURL_LIB)\nlibs: $(INSTALL_LIBS)\napps: $(INSTALL_APPS)\n\ninstall: libs apps\n\tinstall -d $(DESTDIR)$(incdir)/mupdf\n\tinstall -d $(DESTDIR)$(incdir)/mupdf/fitz\n\tinstall -d $(DESTDIR)$(incdir)/mupdf/pdf\n\tinstall include/mupdf/*.h $(DESTDIR)$(incdir)/mupdf\n\tinstall include/mupdf/fitz/*.h $(DESTDIR)$(incdir)/mupdf/fitz\n\tinstall include/mupdf/pdf/*.h $(DESTDIR)$(incdir)/mupdf/pdf\n\n\tinstall -d $(DESTDIR)$(libdir)\n\tinstall $(INSTALL_LIBS) $(DESTDIR)$(libdir)\n\n\tinstall -d $(DESTDIR)$(bindir)\n\tinstall $(INSTALL_APPS) $(DESTDIR)$(bindir)\n\n\tinstall -d $(DESTDIR)$(mandir)/man1\n\tinstall docs/man/*.1 $(DESTDIR)$(mandir)/man1\n\n\tinstall -d $(DESTDIR)$(docdir)\n\tinstall README COPYING CHANGES docs/*.txt $(DESTDIR)$(docdir)\n\ntarball:\n\tbash scripts/archive.sh\n\n# --- Clean and Default ---\n\ntags: $(shell find include source platform -name '*.[ch]')\n\tctags $^\n\ncscope.files: $(shell find include source platform -name '*.[ch]')\n\t@ echo $^ | tr ' ' '\\n' > $@\n\ncscope.out: cscope.files\n\tcscope -b\n\nall: libs apps\n\nclean:\n\trm -rf $(OUT)\nnuke:\n\trm -rf build/* $(GEN)\n\n.PHONY: all clean nuke install third libs apps generate\n"
  },
  {
    "path": "mupdf/Makerules",
    "content": "# Configuration for the Makefile\n\nOS ?= $(shell uname)\nOS := $(OS:MINGW%=MINGW)\nOS := $(OS:Windows_NT=MINGW)\nOS := $(OS:Darwin=MACOS)\n\nCFLAGS += -Wall\n\nifeq \"$(build)\" \"debug\"\nCFLAGS += -pipe -g -DDEBUG\nelse ifeq \"$(build)\" \"profile\"\nCFLAGS += -pipe -O2 -DNDEBUG -pg\nLDFLAGS += -pg\nelse ifeq \"$(build)\" \"release\"\nCFLAGS += -pipe -O2 -DNDEBUG -fomit-frame-pointer\nelse ifeq \"$(build)\" \"coverage\"\nCFLAGS += -pipe -g -DDEBUG -pg -fprofile-arcs -ftest-coverage\nLIBS += -lgcov\nelse ifeq \"$(build)\" \"native\"\nCFLAGS += -pipe -O2 -DNDEBUG -fomit-frame-pointer -march=native -mfpmath=sse\nelse ifeq \"$(build)\" \"memento\"\nCFLAGS += -pipe -g -DMEMENTO -DDEBUG\nelse\n$(error unknown build setting: '$(build)')\nendif\n\n# Windows (MINGW) build doesn't use system libraries.\nifeq \"$(OS)\" \"MINGW\"\n\n# Mac OS X doesn't have pkg-config so we hard code paths.\nelse ifeq \"$(OS)\" \"MACOS\"\n\nHAVE_X11 ?= yes\n\nSYS_OPENSSL_CFLAGS = -DHAVE_OPENSSL\nSYS_OPENSSL_LIBS = -lcrypto\n\nSYS_CURL_DEPS = -lpthread\n\nSYS_X11_CFLAGS = -I/usr/X11R6/include\nSYS_X11_LIBS = -L/usr/X11R6/lib -lX11 -lXext\n\nSYS_FREETYPE_CFLAGS = -I/usr/X11R6/include/freetype2\nSYS_FREETYPE_LIBS = -lfreetype\nSYS_OPENJPEG_LIBS = -lopenjpeg\nSYS_JBIG2DEC_LIBS = -ljbig2dec\nSYS_JPEG_LIBS = -ljpeg\nSYS_ZLIB_LIBS = -lz\n\nCC = xcrun cc\nAR = xcrun ar\nLD = xcrun ld\nRANLIB_CMD = xcrun ranlib $@\n\n# Linux uses pkg-config for system libraries.\nelse ifeq \"$(OS)\" \"Linux\"\n\nHAVE_X11 ?= yes\n\nifeq \"$(shell pkg-config --exists libcrypto && echo yes)\" \"yes\"\nSYS_OPENSSL_CFLAGS = -DHAVE_OPENSSL $(shell pkg-config --cflags libcrypto)\nSYS_OPENSSL_LIBS = $(shell pkg-config --libs libcrypto)\nendif\n\nifeq \"$(shell pkg-config --exists libcurl && echo yes)\" \"yes\"\nHAVE_CURL = yes\nSYS_CURL_CFLAGS = $(shell pkg-config --cflags libcurl)\nSYS_CURL_LIBS = $(shell pkg-config --libs libcurl)\nendif\nSYS_CURL_DEPS = -lpthread -lrt\n\nSYS_X11_CFLAGS = $(shell pkg-config --cflags x11 xext)\nSYS_X11_LIBS = $(shell pkg-config --libs x11 xext)\n\nSYS_FREETYPE_CFLAGS = $(shell pkg-config --cflags freetype2)\nSYS_FREETYPE_LIBS = $(shell pkg-config --libs freetype2)\nSYS_OPENJPEG_CFLAGS = $(shell pkg-config --cflags libopenjp2)\nSYS_OPENJPEG_LIBS = $(shell pkg-config --libs libopenjp2)\nSYS_JBIG2DEC_LIBS = -ljbig2dec\nSYS_JPEG_LIBS = -ljpeg\nSYS_ZLIB_LIBS = -lz\n\nendif\n\n# The following section is an example of how to simply do cross-compilation\n# using these Makefiles. It builds for a beagleboard running ARM linux,\n# compiling on windows with the CodeSourcery G++ compilers.\n# Invoke this as:\n#      make OS=beagle-cross build=release\n# This does rely on the generated directory being populated with the cmap\n# files etc first. Either:\n#   1) do 'make generate' first (this relies on you having an appropriate host\n#   base C compiler set up - such as you would have on unix or in windows\n#   cygwin)\n#   2) do a non cross compile build (e.g. windows in MSVC) first.\n#   3) download the generated files from mupdf.com.\n\nifeq \"$(OS)\" \"beagle-cross\"\nCC = arm-none-linux-gnueabi-gcc\nLD = arm-none-linux-gnueabi-gcc\nAR = arm-none-linux-gnueabi-ar\nCFLAGS += -O3 -mfpu=neon -mcpu=cortex-a8 -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant\nCROSSCOMPILE=yes\nendif\n\nifeq \"$(OS)\" \"webos-pre-cross\"\nCC = arm-none-linux-gnueabi-gcc\nLD = arm-none-linux-gnueabi-gcc\nAR = arm-none-linux-gnueabi-ar\nCFLAGS += -O3 -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant\nCROSSCOMPILE=yes\nendif\n\nifeq \"$(OS)\" \"webos-pixi-cross\"\nCC = arm-none-linux-gnueabi-gcc\nLD = arm-none-linux-gnueabi-gcc\nAR = arm-none-linux-gnueabi-ar\nCFLAGS += -O3 -mcpu=arm1136jf-s -mfpu=vfp -mfloat-abi=softfp -ffast-math -fsingle-precision-constant\nCROSSCOMPILE=yes\nendif\n\nifeq \"$(OS)\" \"w64_x86-cross-mingw32\"\nCC = i686-w64-mingw32-gcc\nLD = i686-w64-mingw32-gcc\nAR = i686-w64-mingw32-ar\nCROSSCOMPILE=yes\nendif\n\nifeq \"$(OS)\" \"w64_amd64-cross-mingw32\"\nCC = x86_64-w64-mingw32-gcc\nLD = x86_64-w64-mingw32-gcc\nAR = x86_64-w64-mingw32-ar\nCROSSCOMPILE=yes\nendif\n\n# Most variables when building for iOS are set up in ios/build_libs.sh,\n# which is called from the Xcode project as a \"Run Script\" build step.\n# The following section works for both device and simulator builds.\n\nifeq \"$(OS)\" \"ios\"\nCC = xcrun cc\nAR = xcrun ar\nLD = xcrun ld\nRANLIB_CMD = xcrun ranlib $@\nCROSSCOMPILE=yes\nendif\n\n# TODO: If crosscompiling, why not just call \"make libs\" instead of this exception?\nifeq \"$(CROSSCOMPILE)\" \"yes\"\nHAVE_X11 ?= no\nendif\n"
  },
  {
    "path": "mupdf/Makethird",
    "content": "# GNU Makefile for third party libraries used by MuPDF\n#\n# If thirdparty libraries are supplied, they will be built as\n# static libraries.\n#\n# Use 'git submodule init' and 'git submodule update' to check\n# out the thirdparty libraries from git.\n\nFREETYPE_DIR := thirdparty/freetype\nJBIG2DEC_DIR := thirdparty/jbig2dec\nJPEG_DIR := thirdparty/jpeg\nMUJS_DIR := thirdparty/mujs\nOPENJPEG_DIR := thirdparty/openjpeg/libopenjpeg\nOPENSSL_DIR := thirdparty/openssl\nZLIB_DIR := thirdparty/zlib\nCURL_DIR := thirdparty/curl\n\n# --- V8 ---\n#\n# V8 is too big to be used as a submodule.\n#\n\nV8_DIR := $(wildcard thirdparty/v8*)\n\nifneq \"$(V8_DIR)\" \"\"\n\nifeq \"$(build)\" \"release\"\nV8_LIB_CHOICE := release\nelse ifeq \"$(build)\" \"profile\"\nV8_LIB_CHOICE := release\nelse\nV8_LIB_CHOICE := debug\nendif\n\nV8_ARCH ?= x64\n\n# If you are building for 32bit linux use V8_ARCH=ia32\nifeq \"$(OS)\" \"Darwin\"\nV8_LIBS := -L$(V8_DIR)/out-mac/$(V8_ARCH).$(V8_LIB_CHOICE)/ -lv8_base -lv8_snapshot -lstdc++\nelse\nV8_LIBS := -L$(V8_DIR)/out/$(V8_ARCH).$(V8_LIB_CHOICE)/obj.target/tools/gyp -lv8_base -lv8_snapshot -lpthread -ldl -lstdc++\nendif\n\nV8_CFLAGS := -I$(V8_DIR)/include\n\nHAVE_V8 := yes\nendif\n\n# --- MuJS ---\n\nifneq \"$(wildcard $(MUJS_DIR)/README)\" \"\"\n\nMUJS_LIB := $(OUT)/libmujs.a\nMUJS_OUT := $(OUT)/mujs\nMUJS_SRC := one.c\n\n$(MUJS_LIB): $(addprefix $(MUJS_OUT)/, $(MUJS_SRC:%.c=%.o))\n$(MUJS_OUT):\n\t$(MKDIR_CMD)\n$(MUJS_OUT)/%.o: $(MUJS_DIR)/%.c | $(MUJS_OUT)\n\t$(CC_CMD)\n\nMUJS_CFLAGS := -I$(MUJS_DIR)\n\nHAVE_MUJS := yes\nendif\n\n# --- FreeType 2 ---\n\nifneq \"$(wildcard $(FREETYPE_DIR)/README)\" \"\"\n\nFREETYPE_LIB := $(OUT)/libfreetype.a\nFREETYPE_OUT := $(OUT)/freetype\nFREETYPE_SRC := \\\n\tftbase.c \\\n\tftbbox.c \\\n\tftbitmap.c \\\n\tftdebug.c \\\n\tftgasp.c \\\n\tftglyph.c \\\n\tftinit.c \\\n\tftstroke.c \\\n\tftsynth.c \\\n\tftsystem.c \\\n\tfttype1.c \\\n\tftxf86.c \\\n\tcff.c \\\n\tpsaux.c \\\n\tpshinter.c \\\n\tpsnames.c \\\n\traster.c \\\n\tsfnt.c \\\n\tsmooth.c \\\n\ttruetype.c \\\n\ttype1.c \\\n\ttype1cid.c \\\n\n\n$(FREETYPE_LIB): $(addprefix $(FREETYPE_OUT)/, $(FREETYPE_SRC:%.c=%.o))\n\n$(FREETYPE_OUT):\n\t$(MKDIR_CMD)\n\nFT_CFLAGS := -DFT2_BUILD_LIBRARY -DDARWIN_NO_CARBON \\\n\t'-DFT_CONFIG_MODULES_H=\"slimftmodules.h\"' \\\n\t'-DFT_CONFIG_OPTIONS_H=\"slimftoptions.h\"'\n\n$(FREETYPE_OUT)/%.o: $(FREETYPE_DIR)/src/base/%.c\t| $(FREETYPE_OUT)\n\t$(CC_CMD) $(FT_CFLAGS)\n$(FREETYPE_OUT)/%.o: $(FREETYPE_DIR)/src/cff/%.c\t| $(FREETYPE_OUT)\n\t$(CC_CMD) $(FT_CFLAGS)\n$(FREETYPE_OUT)/%.o: $(FREETYPE_DIR)/src/cid/%.c\t| $(FREETYPE_OUT)\n\t$(CC_CMD) $(FT_CFLAGS)\n$(FREETYPE_OUT)/%.o: $(FREETYPE_DIR)/src/psaux/%.c\t| $(FREETYPE_OUT)\n\t$(CC_CMD) $(FT_CFLAGS)\n$(FREETYPE_OUT)/%.o: $(FREETYPE_DIR)/src/pshinter/%.c\t| $(FREETYPE_OUT)\n\t$(CC_CMD) $(FT_CFLAGS)\n$(FREETYPE_OUT)/%.o: $(FREETYPE_DIR)/src/psnames/%.c\t| $(FREETYPE_OUT)\n\t$(CC_CMD) $(FT_CFLAGS)\n$(FREETYPE_OUT)/%.o: $(FREETYPE_DIR)/src/raster/%.c\t| $(FREETYPE_OUT)\n\t$(CC_CMD) $(FT_CFLAGS)\n$(FREETYPE_OUT)/%.o: $(FREETYPE_DIR)/src/smooth/%.c\t| $(FREETYPE_OUT)\n\t$(CC_CMD) $(FT_CFLAGS)\n$(FREETYPE_OUT)/%.o: $(FREETYPE_DIR)/src/sfnt/%.c\t| $(FREETYPE_OUT)\n\t$(CC_CMD) $(FT_CFLAGS)\n$(FREETYPE_OUT)/%.o: $(FREETYPE_DIR)/src/truetype/%.c\t| $(FREETYPE_OUT)\n\t$(CC_CMD) $(FT_CFLAGS)\n$(FREETYPE_OUT)/%.o: $(FREETYPE_DIR)/src/type1/%.c\t| $(FREETYPE_OUT)\n\t$(CC_CMD) $(FT_CFLAGS)\n\nFREETYPE_CFLAGS := -Iscripts/freetype -I$(FREETYPE_DIR)/include\nelse\nFREETYPE_CFLAGS := $(SYS_FREETYPE_CFLAGS)\nFREETYPE_LIBS := $(SYS_FREETYPE_LIBS)\nendif\n\n# --- JBIG2DEC ---\n\nifneq \"$(wildcard $(JBIG2DEC_DIR)/README)\" \"\"\n\nJBIG2DEC_LIB := $(OUT)/libjbig2dec.a\nJBIG2DEC_OUT := $(OUT)/jbig2dec\nJBIG2DEC_SRC := \\\n\tjbig2.c \\\n\tjbig2_arith.c \\\n\tjbig2_arith_iaid.c \\\n\tjbig2_arith_int.c \\\n\tjbig2_generic.c \\\n\tjbig2_halftone.c \\\n\tjbig2_huffman.c \\\n\tjbig2_image.c \\\n\tjbig2_metadata.c \\\n\tjbig2_mmr.c \\\n\tjbig2_page.c \\\n\tjbig2_refinement.c \\\n\tjbig2_segment.c \\\n\tjbig2_symbol_dict.c \\\n\tjbig2_text.c \\\n\n$(JBIG2DEC_LIB): $(addprefix $(JBIG2DEC_OUT)/, $(JBIG2DEC_SRC:%.c=%.o))\n$(JBIG2DEC_OUT):\n\t$(MKDIR_CMD)\n$(JBIG2DEC_OUT)/%.o: $(JBIG2DEC_DIR)/%.c | $(JBIG2DEC_OUT)\n\t$(CC_CMD) -DHAVE_STDINT_H\n\nJBIG2DEC_CFLAGS := -I$(JBIG2DEC_DIR)\nelse\nJBIG2DEC_CFLAGS := $(SYS_JBIG2DEC_CFLAGS)\nJBIG2DEC_LIBS := $(SYS_JBIG2DEC_LIBS)\nendif\n\n# --- JPEG library from IJG ---\n\nifneq \"$(wildcard $(JPEG_DIR)/README)\" \"\"\n\nJPEG_LIB := $(OUT)/libjpeg.a\nJPEG_OUT := $(OUT)/jpeg\nJPEG_SRC := \\\n\tjaricom.c \\\n\tjcomapi.c \\\n\tjdapimin.c \\\n\tjdapistd.c \\\n\tjdarith.c \\\n\tjdatadst.c \\\n\tjdatasrc.c \\\n\tjdcoefct.c \\\n\tjdcolor.c \\\n\tjddctmgr.c \\\n\tjdhuff.c \\\n\tjdinput.c \\\n\tjdmainct.c \\\n\tjdmarker.c \\\n\tjdmaster.c \\\n\tjdmerge.c \\\n\tjdpostct.c \\\n\tjdsample.c \\\n\tjdtrans.c \\\n\tjerror.c \\\n\tjfdctflt.c \\\n\tjfdctfst.c \\\n\tjfdctint.c \\\n\tjidctflt.c \\\n\tjidctfst.c \\\n\tjidctint.c \\\n\tjmemmgr.c \\\n\tjquant1.c \\\n\tjquant2.c \\\n\tjutils.c \\\n\n$(JPEG_LIB): $(addprefix $(JPEG_OUT)/, $(JPEG_SRC:%.c=%.o))\n$(JPEG_OUT):\n\t$(MKDIR_CMD)\n$(JPEG_OUT)/%.o: $(JPEG_DIR)/%.c | $(JPEG_OUT)\n\t$(CC_CMD) -Dmain=xxxmain\n\nJPEG_CFLAGS := -Iscripts/jpeg -I$(JPEG_DIR)\nelse\nJPEG_CFLAGS := $(SYS_JPEG_CFLAGS) -DSHARE_JPEG\nJPEG_LIBS := $(SYS_JPEG_LIBS)\nendif\n\n# --- OpenJPEG ---\n\nifneq \"$(wildcard $(OPENJPEG_DIR)/CMakeLists.txt)\" \"\"\n\nOPENJPEG_LIB := $(OUT)/libopenjpeg.a\nOPENJPEG_OUT := $(OUT)/openjpeg\nOPENJPEG_SRC := \\\n\tbio.c \\\n\tcidx_manager.c \\\n\tcio.c \\\n\tdwt.c \\\n\tevent.c \\\n\tfunction_list.c \\\n\timage.c \\\n\tinvert.c \\\n\tj2k.c \\\n\tjp2.c \\\n\tmct.c \\\n\tmqc.c \\\n\topenjpeg.c \\\n\topj_clock.c \\\n\tphix_manager.c \\\n\tpi.c \\\n\tppix_manager.c \\\n\traw.c \\\n\tt1.c \\\n\tt2.c \\\n\ttcd.c \\\n\ttgt.c \\\n\tthix_manager.c \\\n\ttpix_manager.c \\\n\n$(OPENJPEG_LIB): $(addprefix $(OPENJPEG_OUT)/, $(OPENJPEG_SRC:%.c=%.o))\n$(OPENJPEG_OUT):\n\t$(MKDIR_CMD)\n$(OPENJPEG_OUT)/%.o: $(OPENJPEG_DIR)/%.c | $(OPENJPEG_OUT)\n\t$(CC_CMD) -DOPJ_STATIC -DOPJ_HAVE_STDINT_H\n\nOPENJPEG_CFLAGS += -Iscripts/openjpeg -I$(OPENJPEG_DIR)\nelse\nOPENJPEG_CFLAGS := $(SYS_OPENJPEG_CFLAGS)\nOPENJPEG_LIBS := $(SYS_OPENJPEG_LIBS)\nendif\n\n# --- ZLIB ---\n\nifneq \"$(wildcard $(ZLIB_DIR)/README)\" \"\"\n\nZLIB_LIB := $(OUT)/libz.a\nZLIB_OUT := $(OUT)/zlib\nZLIB_SRC := \\\n\tadler32.c \\\n\tcompress.c \\\n\tcrc32.c \\\n\tdeflate.c \\\n\tinffast.c \\\n\tinflate.c \\\n\tinftrees.c \\\n\ttrees.c \\\n\tuncompr.c \\\n\tzutil.c \\\n\n$(ZLIB_LIB): $(addprefix $(ZLIB_OUT)/, $(ZLIB_SRC:%.c=%.o))\n$(ZLIB_OUT):\n\t$(MKDIR_CMD)\n$(ZLIB_OUT)/%.o: $(ZLIB_DIR)/%.c | $(ZLIB_OUT)\n\t$(CC_CMD) -Dverbose=-1\n\nZLIB_CFLAGS := -I$(ZLIB_DIR)\nelse\nZLIB_CFLAGS := $(SYS_ZLIB_CFLAGS)\nZLIB_LIBS := $(SYS_ZLIB_LIBS)\nendif\n\n# --- OpenSSL ---\n\nifneq \"$(wildcard $(OPENSSL_DIR)/README)\" \"\"\n\nOPENSSL_LIB := $(OUT)/libcrypto.a\n\nOPENSSL_DIR_MAK := $(OPENSSL_DIR)/Makefile\nOPENSSL_DIR_LIB := $(OPENSSL_DIR)/libcrypto.a\n\n$(OPENSSL_DIR_MAK):\n\tcd $(OPENSSL_DIR) && ./config no-threads no-zlib no-shared no-asm no-dso\n\n$(OPENSSL_DIR_LIB): $(OPENSSL_DIR_MAK)\n\t$(MAKE) -C $(OPENSSL_DIR) build_crypto\n\n$(OPENSSL_LIB): $(OPENSSL_DIR_LIB) | $(OUT)\n\tcp $(OPENSSL_DIR_LIB) $(OPENSSL_LIB)\n\nopenssl-clean:\n\t$(MAKE) -C $(OPENSSL_DIR) clean\n\trm -f thirdparty/openssl/Makefile thirdparty/openssl/libcrypto.a\n\nOPENSSL_CFLAGS := -DHAVE_OPENSSL -I$(OPENSSL_DIR)/include\nelse\nOPENSSL_CFLAGS := $(SYS_OPENSSL_CFLAGS)\nOPENSSL_LIBS := $(SYS_OPENSSL_LIBS)\nendif\n\n# --- cURL ---\n\nifneq \"$(wildcard $(CURL_DIR)/README)\" \"\"\n\nCURL_LIB := $(OUT)/libcurl.a\nCURL_OUT := $(OUT)/curl\nCURL_SRC := \\\n\tamigaos.c \\\n\tasyn-ares.c \\\n\tasyn-thread.c \\\n\taxtls.c \\\n\tbase64.c \\\n\tbundles.c \\\n\tconncache.c \\\n\tconnect.c \\\n\tcontent_encoding.c \\\n\tcookie.c \\\n\tcurl_addrinfo.c \\\n\tcurl_darwinssl.c \\\n\tcurl_fnmatch.c \\\n\tcurl_gethostname.c \\\n\tcurl_gssapi.c \\\n\tcurl_memrchr.c \\\n\tcurl_multibyte.c \\\n\tcurl_ntlm.c \\\n\tcurl_ntlm_core.c \\\n\tcurl_ntlm_msgs.c \\\n\tcurl_ntlm_wb.c \\\n\tcurl_rand.c \\\n\tcurl_rtmp.c \\\n\tcurl_sasl.c \\\n\tcurl_schannel.c \\\n\tcurl_sspi.c \\\n\tcurl_threads.c \\\n\tcyassl.c \\\n\tdict.c \\\n\teasy.c \\\n\tescape.c \\\n\tfile.c \\\n\tfileinfo.c \\\n\tformdata.c \\\n\tftp.c \\\n\tftplistparser.c \\\n\tgetenv.c \\\n\tgetinfo.c \\\n\tgopher.c \\\n\tgtls.c \\\n\thash.c \\\n\thmac.c \\\n\thostasyn.c \\\n\thostcheck.c \\\n\thostip.c \\\n\thostip4.c \\\n\thostip6.c \\\n\thostsyn.c \\\n\thttp.c \\\n\thttp_chunks.c \\\n\thttp_digest.c \\\n\thttp_negotiate.c \\\n\thttp_negotiate_sspi.c \\\n\thttp_proxy.c \\\n\tidn_win32.c \\\n\tif2ip.c \\\n\timap.c \\\n\tinet_ntop.c \\\n\tinet_pton.c \\\n\tkrb4.c \\\n\tkrb5.c \\\n\tldap.c \\\n\tllist.c \\\n\tmd4.c \\\n\tmd5.c \\\n\tmemdebug.c \\\n\tmprintf.c \\\n\tmulti.c \\\n\tnetrc.c \\\n\tnon-ascii.c \\\n\tnonblock.c \\\n\tnss.c \\\n\topenldap.c \\\n\tparsedate.c \\\n\tpingpong.c \\\n\tpipeline.c \\\n\tpolarssl.c \\\n\tpolarssl_threadlock.c \\\n\tpop3.c \\\n\tprogress.c \\\n\tqssl.c \\\n\trawstr.c \\\n\trtsp.c \\\n\tsecurity.c \\\n\tselect.c \\\n\tsendf.c \\\n\tshare.c \\\n\tslist.c \\\n\tsmtp.c \\\n\tsocks.c \\\n\tsocks_gssapi.c \\\n\tspeedcheck.c \\\n\tsplay.c \\\n\tssh.c \\\n\tsslgen.c \\\n\tssluse.c \\\n\tstrdup.c \\\n\tstrequal.c \\\n\tstrerror.c \\\n\tstrtok.c \\\n\tstrtoofft.c \\\n\ttelnet.c \\\n\ttftp.c \\\n\ttimeval.c \\\n\ttransfer.c \\\n\turl.c \\\n\tversion.c \\\n\twarnless.c \\\n\twildcard.c \\\n\n\n$(CURL_LIB): $(addprefix $(CURL_OUT)/, $(CURL_SRC:%.c=%.o))\n\n$(CURL_OUT):\n\t$(MKDIR_CMD)\n\nCRL_CFLAGS := -DHAVE_CONFIG_H -DBUILDING_LIBCURL -DCURL_STATICLIB \\\n\t-DCURL_DISABLE_LDAP -I$(CURL_DIR)/include\n\n$(CURL_OUT)/%.o: $(CURL_DIR)/lib/%.c\t| $(CURL_OUT)\n\t$(CC_CMD) $(CRL_CFLAGS)\n\nCURL_CFLAGS := -I$(CURL_DIR)/include\nCURL_LIBS := $(SYS_CURL_DEPS)\n\nHAVE_CURL := yes\n\nelse ifeq \"$(HAVE_CURL)\" \"yes\"\nCURL_CFLAGS := $(SYS_CURL_CFLAGS)\nCURL_LIBS := $(SYS_CURL_LIBS)\nendif\n\n# --- X11 ---\n\nifeq \"$(HAVE_X11)\" \"yes\"\nX11_CFLAGS := $(SYS_X11_CFLAGS)\nX11_LIBS := $(SYS_X11_LIBS)\nendif\n"
  },
  {
    "path": "mupdf/README",
    "content": "ABOUT\n\nMuPDF is a lightweight PDF, XPS and CBZ viewer and parser/rendering library.\n\nThe renderer in MuPDF is tailored for high quality anti-aliased graphics. It\nrenders text with metrics and spacing accurate to within fractions of a pixel\nfor the highest fidelity in reproducing the look of a printed page on screen.\n\nMuPDF is also small, fast, and yet complete. We support PDF 1.7 with\ntransparency, encryption, hyperlinks, annotations, search and many other bells\nand whistles. MuPDF can also read XPS documents (OpenXPS / ECMA-388),\nand CBZ (Comic Book archive) files.\n\nMuPDF is written to be both modular and portable; the example applications\nare merely thin layers on top of the functionality offered by the library,\nso custom viewers can be easily built for a wide range of platforms. Example\nviewer applications are supplied for Windows, Linux, MacOS, iOS and Android.\n\nMuPDF is deliberately designed to be threading library agnostic, while still\nsupporting multi-threaded operation. In the absence of a thread library\nit will run single-threaded, but by adding one significant benefits in\nrendering speed on multi-core platforms can be obtained.\n\nInteractive features such as form filling, javascript and transitions\nare in development and partially supported by the Android application.\n\nLICENSE\n\nMuPDF is Copyright 2006-2014 Artifex Software, Inc.\n\nThis program is free software: you can redistribute it and/or modify it under\nthe terms of the GNU Affero General Public License as published by the Free\nSoftware Foundation, either version 3 of the License, or (at your option) any\nlater version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY\nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\nPARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License along\nwith this program. If not, see <http://www.gnu.org/licenses/>.\n\nFor commercial licensing please contact sales@artifex.com.\n\nCOMPILING\n\nIf you are compiling from source you will need several third party libraries:\nfreetype2, jbig2dec, libjpeg, openjpeg, and zlib. These libraries are contained\nin the source archive. If you are using git, they are included as git\nsubmodules.\n\nYou will also need the X11 headers and libraries if you're building on Linux.\nThese can typically be found in the xorg-dev package. Alternatively, if you\nonly want the command line tools, you can build with HAVE_X11=no.\n\nDOWNLOAD\n\nThe latest development source is available directly from the git repository:\n\n\tgit clone http://mupdf.com/repos/mupdf.git\n\nIn the mupdf directory, update the third party libraries:\n\n\tgit submodule update --init\n\nINSTALLING (UNIX)\n\nTyping \"make prefix=/usr/local install\" will install the binaries, man-pages,\nstatic libraries and header files on your system.\n\nREPORTING BUGS AND PROBLEMS\n\nThe MuPDF developers hang out on IRC in the #ghostscript channel on\nirc.freenode.net.\n\nReport bugs on the ghostscript bugzilla, with MuPDF as the selected component.\n\n\thttp://bugs.ghostscript.com/\n\nIf you are reporting a problem with PDF parsing, please include the problematic\nfile as an attachment.\n"
  },
  {
    "path": "mupdf/SumatraMuPDF.patch",
    "content": "An up-to-date version of the unified diff between vanilla MuPDF from\n\nhttp://git.ghostscript.com/?p=mupdf.git\n\nand SumatraPDF's copy in this directory is hosted at\n\nhttp://software.zeniko.ch/sumatrapdf/SumatraMuPDF.patch\n"
  },
  {
    "path": "mupdf/docs/example.c",
    "content": "// Rendering a page of a PDF document to a PNG image in less than 100 lines.\n\n// Compile a debug build of mupdf, then compile and run this example:\n//\n// gcc -g -o build/debug/example -Iinclude docs/example.c \\\n//\tbuild/debug/libmupdf.a \\\n//\tbuild/debug/libfreetype.a build/debug/libjbig2dec.a \\\n//\tbuild/debug/libjpeg.a build/debug/libopenjpeg.a \\\n//\tbuild/debug/libmujs.a \\\n//\tbuild/debug/libz.a -lm\n//\n// build/debug/example /path/to/document.pdf 1 200 25\n\n// Include the MuPDF header file.\n#include <mupdf/fitz.h>\n\nvoid\nrender(char *filename, int pagenumber, int zoom, int rotation)\n{\n\t// Create a context to hold the exception stack and various caches.\n\n\tfz_context *ctx = fz_new_context(NULL, NULL, FZ_STORE_UNLIMITED);\n\n\t// Register the default file types.\n\n\tfz_register_document_handlers(ctx);\n\n\t// Open the PDF, XPS or CBZ document.\n\n\tfz_document *doc = fz_open_document(ctx, filename);\n\n\t// Retrieve the number of pages (not used in this example).\n\n\tint pagecount = fz_count_pages(doc);\n\n\t// Load the page we want. Page numbering starts from zero.\n\n\tfz_page *page = fz_load_page(doc, pagenumber - 1);\n\n\t// Calculate a transform to use when rendering. This transform\n\t// contains the scale and rotation. Convert zoom percentage to a\n\t// scaling factor. Without scaling the resolution is 72 dpi.\n\n\tfz_matrix transform;\n\tfz_rotate(&transform, rotation);\n\tfz_pre_scale(&transform, zoom / 100.0f, zoom / 100.0f);\n\n\t// Take the page bounds and transform them by the same matrix that\n\t// we will use to render the page.\n\n\tfz_rect bounds;\n\tfz_bound_page(doc, page, &bounds);\n\tfz_transform_rect(&bounds, &transform);\n\n\t// Create a blank pixmap to hold the result of rendering. The\n\t// pixmap bounds used here are the same as the transformed page\n\t// bounds, so it will contain the entire page. The page coordinate\n\t// space has the origin at the top left corner and the x axis\n\t// extends to the right and the y axis extends down.\n\n\tfz_irect bbox;\n\tfz_round_rect(&bbox, &bounds);\n\tfz_pixmap *pix = fz_new_pixmap_with_bbox(ctx, fz_device_rgb(ctx), &bbox);\n\tfz_clear_pixmap_with_value(ctx, pix, 0xff);\n\n\t// A page consists of a series of objects (text, line art, images,\n\t// gradients). These objects are passed to a device when the\n\t// interpreter runs the page. There are several devices, used for\n\t// different purposes:\n\t//\n\t//\tdraw device -- renders objects to a target pixmap.\n\t//\n\t//\ttext device -- extracts the text in reading order with styling\n\t//\tinformation. This text can be used to provide text search.\n\t//\n\t//\tlist device -- records the graphic objects in a list that can\n\t//\tbe played back through another device. This is useful if you\n\t//\tneed to run the same page through multiple devices, without\n\t//\tthe overhead of parsing the page each time.\n\n\t// Create a draw device with the pixmap as its target.\n\t// Run the page with the transform.\n\n\tfz_device *dev = fz_new_draw_device(ctx, pix);\n\tfz_run_page(doc, page, dev, &transform, NULL);\n\tfz_free_device(dev);\n\n\t// Save the pixmap to a file.\n\n\tfz_write_png(ctx, pix, \"out.png\", 0);\n\n\t// Clean up.\n\n\tfz_drop_pixmap(ctx, pix);\n\tfz_free_page(doc, page);\n\tfz_close_document(doc);\n\tfz_free_context(ctx);\n}\n\nint main(int argc, char **argv)\n{\n\tchar *filename = argc >= 2 ? argv[1] : \"\";\n\tint pagenumber = argc > 2 ? atoi(argv[2]) : 1;\n\tint zoom = argc > 3 ? atoi(argv[3]) : 100;\n\tint rotation = argc > 4 ? atoi(argv[4]) : 0;\n\n\trender(filename, pagenumber, zoom, rotation);\n\treturn 0;\n}\n"
  },
  {
    "path": "mupdf/docs/man/mudraw.1",
    "content": ".TH MUDRAW 1 \"July 25, 2013\"\n.\\\" Please adjust this date whenever revising the manpage.\n\n.SH NAME\nmudraw \\- render PDF/XPS/CBZ documents\n\n.SH SYNOPSIS\n.B mudraw\n.RI [ options ]\n.RI input.{pdf,xps,cbz}\n.RI [ pages]\n\n.SH DESCRIPTION\n.B mudraw\nwill render a document of a supported document format to image files.\nThe supported document formats are: pdf, xps and cbz.\nThe supported image formats are: pgm, ppm, pam and png.\nSelect the pages to be rendered by specifying a comma\nseparated list of ranges and individual page numbers (for example: 1,5,10-15).\nIn no pages are specified all the pages will be rendered.\n\n.SH OPTIONS\n.TP\n.B \\-o output\nThe image format is deduced from the output file name.\nEmbed %d in the name to indicate the page number (for example: \"page%d.png\").\n.TP\n.B \\-p password\nUse the specified password if the file is encrypted.\n.TP\n.B \\-r resolution\nRender the page at the specified resolution.\nThe default resolution is 72 dpi.\n.TP\n.B \\-w width\nRender the page at the specified width (or, if the -r flag is used,\nrender with a maximum width).\n.TP\n.B \\-h height\nRender the page at the specified height (or, if the -r flag is used,\nrender with a maximum height).\n.TP\n.B \\-f\nFit exactly; ignore the aspect ratio when matching specified width/heights.\n.TP\n.B \\-R angle\nRotate clockwise by given number of degrees.\n.TP\n.B \\-a\nSave the alpha channel.\nThe default behavior is to render each page with a white background.\nWith this option, the page background is transparent.\nOnly supported for pam and png output formats.\n.TP\n.B \\-g\nRender in grayscale.\nThe default is to render a full color RGB image.\nIf the output format is pgm or ppm this option is ignored.\n.TP\n.B \\-m\nShow timing information.\nTake the time it takes for each page to render and print\na summary at the end.\n.TP\n.B \\-5\nPrint an MD5 checksum of the rendered image data for each page.\n.TP\n.B \\-t\nPrint the text contents of each page in UTF-8 encoding.\nGive the option twice to print detailed information\nabout the location of each character in XML format.\n.TP\n.B \\-x\nPrint the display list used to render each page.\n.TP\n.B \\-A\nDisable the use of accelerated functions.\n.TP\n.B \\-G gamma\nGamma correct the output image.\nSome typical values are 0.7 or 1.4 to thin or darken text rendering.\n.TP\n.B \\-I\nInvert the output image colors.\n.TP\n.B pages\nComma separated list of ranges to render.\n\n.SH SEE ALSO\n.BR mupdf (1),\n.BR mutool (1).\n\n.SH AUTHOR\nMuPDF is Copyright 2006-2014 Artifex Software, Inc.\n"
  },
  {
    "path": "mupdf/docs/man/mupdf.1",
    "content": ".TH MUPDF 1 \"July 25, 2013\"\n.\\\" Please adjust this date whenever revising the manpage.\n\n.SH NAME\nmupdf \\- MuPDF is a lightweight PDF viewer written in portable C\n\n.SH SYNOPSIS\n.B mupdf\n.RI [ options ] \" PDFfile\"\n\n.SH DESCRIPTION\nThis manual page briefly describes the\n.B mupdf\ncommand.\n.PP\n\n.SH OPTIONS\nA description of each of the supported options is included below.\n\n.TP\n.B \\-p password\nUses the given password to open an encrypted PDF file.\nThe password is tried both as user and owner password.\n.TP\n.B \\-r resolution\nChanges the initial zoom level, specified as the resolution in dpi.\nThe default value is 72.\n.TP\n.B \\-b bits\nChanges the anti-aliasing quality, specified as a number of bits between 0\n(off) and 8 (best). The default value is 8.\n.TP\n.B \\-C RRGGBB\nSets the full-page tint using hexadecimal color syntax. The default value\nis FFFAF0.\n\n.SH MOUSE BEHAVIOR\n\n.TP\n.B Left mouse button click\nA left click on a hyper link follows the link.\n.TP\n.B Left mouse button drag\nPan the page. Panning beyond the bottom or top\nedge will go to the next or previous page.\n.TP\n.B Right mouse button drag\nSelect text in an area. On X11, the selected text\ncan be pasted in another application with a middle click.\nPress Ctl+C to copy the selected text to the clipboard.\nOn windows, the selected text will automatically be copied\nto the clipboard.\n.TP\n.B Scroll wheel\nPan page up or down. Does not change page\nwhen reaching the bottom or top edge.\n.TP\n.B Shift + Scroll wheel\nPan page left or right.\n.TP\n.B Control + Scroll wheel\nZoom in or out.\n\n.SH KEY BINDINGS\n\n.TP\n.B L, R\nRotate page left (counter-clockwise) or right (clockwise).\n.TP\n.B h, j, k, l\nPan page left, down, up, or right.\n.TP\n.B \\+, \\-\nZoom in or out.\n.TP\n.B W, H\nZoom page to exactly fit width or height of window.\n.TP\n.B w\nShrinkwrap window to fit the page.\n.TP\n.B r\nReload file.\n.TP\n.B . pgdn right space\nGo to the next page\n.TP\n.B , pgup left b backspace\nGo to the previous page\n.TP\n.B <, >\nSkip back/forth 10 pages at a time.\n.TP\n.B m\nMark current page for snap back. Up to 256 pages can be marked.\n.TP\n.B t\nPop back to the latest mark.\n.TP\n.B [0-9]m\nSave the current page number in the numbered register.\n.TP\n.B [0-9]t\nGo to the page saved in the numbered register.\n.TP\n.B 123g\nGo to page 123.\n.TP\n.B g, G\nGo to the first or last page.\n.TP\n.B /, ?\nSearch for text forwards or backwards.\n.TP\n.B n, N\nFind the next/previous search result.\n.TP\n.B f\nToggles fullscreen mode.\n.TP\n.B p\nToggle presentation mode.\n.TP\n.B c\nToggle between color and grayscale rendering.\n.TP\n.B C\nToggle full-page color tinting.\n.B i\nToggle between normal and inverted color rendering.\n.TP\n.B q\nQuit.\n\n.SH SIGNALS\n\n.TP\n.B SIGHUP\nSending a \\fBSIGHUP\\fR signal to the mupdf process will also cause the viewed\nfile to be reloaded automatically, for use in e.g. build scripts.\n\n.SH SEE ALSO\n.BR mudraw (1),\n.BR mutool (1).\n\n.SH AUTHOR\nMuPDF is Copyright 2006-2014 Artifex Software, Inc.\n"
  },
  {
    "path": "mupdf/docs/man/mutool.1",
    "content": ".TH \"MUTOOL\" \"1\" \"July 25, 2013\"\n.\\\" Please adjust this date whenever revising the manpage.\n.\\\" no hyphenation\n.nh\n.\\\" adjust left\n.ad l\n\n.SH NAME\nmutool \\- all purpose tool for dealing with PDF files\n\n.SH SYNOPSIS\nmutool <sub-command> [options]\n\n.SH DESCRIPTION\nmutool is a tool based on MuPDF for dealing with PDF files in various manners.\nThere are several sub commands available, as described below.\n\n.SH CLEAN\nmutool clean [options] input.pdf [output.pdf] [pages]\n.PP\nThe clean command pretty prints and rewrites the syntax of a PDF file.\nIt can be used to repair broken files, expand compressed streams, filter\nout a range of pages, etc.\n.PP\nIf no output file is specified, it will write the cleaned PDF to \"out.pdf\"\nin the current directory.\n.TP\n.B \\-p password\nUse the specified password if the file is encrypted.\n.TP\n.B \\-g\nGarbage collect objects that have no references from other objects.\nGive the option twice to renumber all objects and compact the cross reference table.\nGive it three times to merge and reuse duplicate objects.\n.TP\n.B \\-d\nDecompress streams. This will make the output file larger, but provides\neasy access for reading and editing the contents with a text editor.\n.TP\n.B \\-l\nLinearize output. Create a \"Web Optimized\" output file.\n.TP\n.B \\-i\nToggle decompression of image streams. Use in conjunction with -d to leave\nimage- compressed.\n.TP\n.B \\-f\nToggle decompression of font streams. Use in conjunction with -d to leave\nfonts compressed.\n.TP\n.B \\-a\nASCII Hex encode binary streams. Use in conjuction with -d and -i or -f to\nensure that although the images and/or fonts are compressed, the resulting\nfile can still be viewed and edited with a text editor.\n.TP\n.B pages\nComma separated list of page ranges to include.\n\n.SH EXTRACT\nmutool extract [options] file.pdf [object numbers]\n.PP\nThe extract command can be used to extract images and font files from a PDF.\nIf no object numbers are given on the command line, all images and fonts\nwill be extracted.\n.TP\n.B \\-p password\nUse the specified password if the file is encrypted.\n.TP\n.B \\-r\nConvert images to RGB when extracting them.\n\n.SH INFO\nTODO\n\n.SH POSTER\nmutool poster [options] input.pdf [output.pdf]\n.PP\nThe poster command splits each page into tiles, and puts each tile on\na page of its own. It's useful for printing a large page onto smaller\npieces of paper that can then be glued together to create a large poster.\n.TP\n.B \\-p password\nUse the specified password if the file is encrypted.\n.TP\n.B \\-x factor\nSplit the page into this many horizontal pieces.\n.TP\n.B \\-y factor\nSplit the page into this many vertical pieces.\n.PP\nThe output will have x times y number of pages for each input page.\n.SH SHOW\nmutool show [options] file.pdf [object numbers ...]\n.PP\nThe show command will print the specified objects and streams to stdout.\nStreams are decoded and non-printable characters are represented\nwith a period by default.\n.TP\n.B \\-b\nPrint streams as binary data and omit the object header.\n.TP\n.B \\-e\nPrint streams in their original encoded (or compressed) form.\n.TP\n.B \\-p password\nUse the specified password if the file is encrypted.\n.PP\nSpecify objects by number, or use one of the following special names:\n.TP\n.B 'xref' or 'x'\nPrint the cross reference table.\n.TP\n.B 'trailer' or 't'\nPrint the trailer dictionary.\n.TP\n.B 'pages' or 'p'\nList the object numbers for every page.\n.TP\n.B 'grep' or 'g'\nPrint all the objects in the file in a compact one-line format suitable for piping to grep.\n\n.SH SEE ALSO\n.BR mudraw (1).\n.BR mupdf (1),\n\n.SH AUTHOR\nMuPDF is Copyright 2006-2014 Artifex Software, Inc.\n"
  },
  {
    "path": "mupdf/docs/multi-threaded.c",
    "content": "// Multi-threaded rendering of all pages in a document to PNG images.\n\n// First look at doc/example.c and make sure you understand it.\n// Then read the multi-threading section in doc/overview.txt,\n// before coming back here to see an example of multi-threading.\n\n// This example will create one main thread for reading pages from the\n// document, and one thread per page for rendering. After rendering\n// the main thread will wait for each rendering thread to complete before\n// writing that thread's rendered image to a PNG image. There is\n// nothing in MuPDF requiring a rendering thread to only render a\n// single page, this is just a design decision taken for this example.\n\n// Compile a debug build of mupdf, then compile and run this example:\n//\n// gcc -g -o build/debug/example-mt -Iinclude docs/multi-threaded.c \\\n//\tbuild/debug/libmupdf.a \\\n//\tbuild/debug/libfreetype.a build/debug/libjbig2dec.a \\\n//\tbuild/debug/libjpeg.a build/debug/libopenjpeg.a \\\n//\tbuild/debug/libmujs.a \\\n//\tbuild/debug/libz.a -lpthread -lm\n//\n// build/debug/example-mt /path/to/document.pdf\n//\n// Caution! As all pages are rendered simultaneously, please choose a\n// file with just a few pages to avoid stressing your machine too\n// much. Also you may run in to a limitation on the number of threads\n// depending on your environment.\n\n// Include the MuPDF header file, and pthread's header file.\n#include <mupdf/fitz.h>\n#include <pthread.h>\n\n// A convenience function for dying abruptly on pthread errors.\n\nvoid\nfail(char *msg)\n{\n\tfprintf(stderr, \"%s\\n\", msg);\n\tabort();\n}\n\n// The data structure passed between the requesting main thread and\n// each rendering thread.\n\nstruct data {\n\t// A pointer to the original context in the main thread sent\n\t// from main to rendering thread. It will be used to create\n\t// each rendering thread's context clone.\n\tfz_context *ctx;\n\n\t// Page number sent from main to rendering thread for printing\n\tint pagenumber;\n\n\t// The display list as obtained by the main thread and sent\n\t// from main to rendering thread. This contains the drawing\n\t// commands (text, images, etc.) for the page that should be\n\t// rendered.\n\tfz_display_list *list;\n\n\t// The area of the page to render as obtained by the main\n\t// thread and sent from main to rendering thread.\n\tfz_rect bbox;\n\n\t// This is the result, a pixmap containing the rendered page.\n\t// It is passed first from main thread to the rendering\n\t// thread, then its samples are changed by the rendering\n\t// thread, and then back from the rendering thread to the main\n\t// thread.\n\tfz_pixmap *pix;\n};\n\n// This is the function run by each rendering function. It takes\n// pointer to an instance of the data structure described above and\n// renders the display list into the pixmap before exiting.\n\nvoid *\nrenderer(void *data)\n{\n\tint pagenumber = ((struct data *) data)->pagenumber;\n\tfz_context *ctx = ((struct data *) data)->ctx;\n\tfz_display_list *list = ((struct data *) data)->list;\n\tfz_rect bbox = ((struct data *) data)->bbox;\n\tfz_pixmap *pix = ((struct data *) data)->pix;\n\n\tfprintf(stderr, \"thread at page %d loading!\\n\", pagenumber);\n\n\t// The context pointer is pointing to the main thread's\n\t// context, so here we create a new context based on it for\n\t// use in this thread.\n\n\tctx = fz_clone_context(ctx);\n\n\t// Next we run the display list through the draw device which\n\t// will render the request area of the page to the pixmap.\n\n\tfprintf(stderr, \"thread at page %d rendering!\\n\", pagenumber);\n\tfz_device *dev = fz_new_draw_device(ctx, pix);\n\tfz_run_display_list(list, dev, &fz_identity, &bbox, NULL);\n\tfz_free_device(dev);\n\n\t// This threads context is freed.\n\n\tfz_free_context(ctx);\n\n\tfprintf(stderr, \"thread at page %d done!\\n\", pagenumber);\n\n\treturn data;\n}\n\n// These are the two locking functions required by MuPDF when\n// operating in a multi-threaded environment. They each take a user\n// argument that can be used to transfer some state, in this case a\n// pointer to the array of mutexes.\n\nvoid lock_mutex(void *user, int lock)\n{\n\tpthread_mutex_t *mutex = (pthread_mutex_t *) user;\n\n\tif (pthread_mutex_lock(&mutex[lock]) != 0)\n\t\tfail(\"pthread_mutex_lock()\");\n}\n\nvoid unlock_mutex(void *user, int lock)\n{\n\tpthread_mutex_t *mutex = (pthread_mutex_t *) user;\n\n\tif (pthread_mutex_unlock(&mutex[lock]) != 0)\n\t\tfail(\"pthread_mutex_unlock()\");\n}\n\nint main(int argc, char **argv)\n{\n\tchar *filename = argc >= 2 ? argv[1] : \"\";\n\tpthread_t *thread = NULL;\n\tfz_locks_context locks;\n\tpthread_mutex_t mutex[FZ_LOCK_MAX];\n\tint i;\n\n\t// Initialize FZ_LOCK_MAX number of non-recursive mutexes.\n\n\tfor (i = 0; i < FZ_LOCK_MAX; i++)\n\t{\n\t\tif (pthread_mutex_init(&mutex[i], NULL) != 0)\n\t\t\tfail(\"pthread_mutex_init()\");\n\t}\n\n\t// Initialize the locking structure with function pointers to\n\t// the locking functions and to the user data. In this case\n\t// the user data is a pointer to the array of mutexes so the\n\t// locking functions can find the relevant lock to change when\n\t// they are called. This way we avoid global variables.\n\n\tlocks.user = mutex;\n\tlocks.lock = lock_mutex;\n\tlocks.unlock = unlock_mutex;\n\n\t// This is the main threads context function, so supply the\n\t// locking structure. This context will be used to parse all\n\t// the pages from the document.\n\n\tfz_context *ctx = fz_new_context(NULL, &locks, FZ_STORE_UNLIMITED);\n\n\t// Register default file types.\n\n\tfz_register_document_handlers(ctx);\n\n\t// Open the PDF, XPS or CBZ document. Note, this binds doc to ctx.\n\t// You must only ever use doc with ctx - never a clone of it!\n\n\tfz_document *doc = fz_open_document(ctx, filename);\n\n\t// Retrieve the number of pages, which translates to the\n\t// number of threads used for rendering pages.\n\n\tint threads = fz_count_pages(doc);\n\tfprintf(stderr, \"spawning %d threads, one per page...\\n\", threads);\n\n\tthread = malloc(threads * sizeof (pthread_t));\n\n\tfor (i = 0; i < threads; i++)\n\t{\n\t\t// Load the relevant page for each thread. Note, that this\n\t\t// cannot be done on the worker threads, as each use of doc\n\t\t// uses ctx, and only one thread can be using ctx at a time.\n\n\t\tfz_page *page = fz_load_page(doc, i);\n\n\t\t// Compute the bounding box for each page.\n\n\t\tfz_rect bbox;\n\t\tfz_irect rbox;\n\t\tfz_bound_page(doc, page, &bbox);\n\n\t\t// Create a display list that will hold the drawing\n\t\t// commands for the page. Once we have the display list\n\t\t// this can safely be used on any other thread as it is\n\t\t// not bound to a given context.\n\n\t\tfz_display_list *list = fz_new_display_list(ctx);\n\n\t\t// Run the loaded page through a display list device\n\t\t// to populate the page's display list.\n\n\t\tfz_device *dev = fz_new_list_device(ctx, list);\n\t\tfz_run_page(doc, page, dev, &fz_identity, NULL);\n\t\tfz_free_device(dev);\n\n\t\t// The page is no longer needed, all drawing commands\n\t\t// are now in the display list.\n\n\t\tfz_free_page(doc, page);\n\n\t\t// Create a white pixmap using the correct dimensions.\n\n\t\tfz_pixmap *pix = fz_new_pixmap_with_bbox(ctx, fz_device_rgb(ctx), fz_round_rect(&rbox, &bbox));\n\t\tfz_clear_pixmap_with_value(ctx, pix, 0xff);\n\n\t\t// Populate the data structure to be sent to the\n\t\t// rendering thread for this page.\n\n\t\tstruct data *data = malloc(sizeof (struct data));\n\n\t\tdata->pagenumber = i + 1;\n\t\tdata->ctx = ctx;\n\t\tdata->list = list;\n\t\tdata->bbox = bbox;\n\t\tdata->pix = pix;\n\n\t\t// Create the thread and pass it the data structure.\n\n\t\tif (pthread_create(&thread[i], NULL, renderer, data) != 0)\n\t\t\tfail(\"pthread_create()\");\n\t}\n\n\t// Now each thread is rendering pages, so wait for each thread\n\t// to complete its rendering.\n\n\tfprintf(stderr, \"joining %d threads...\\n\", threads);\n\tfor (i = threads - 1; i >= 0; i--)\n\t{\n\t\tchar filename[42];\n\t\tstruct data *data;\n\n\t\tif (pthread_join(thread[i], (void **) &data) != 0)\n\t\t\tfail(\"pthread_join\");\n\n\t\tsprintf(filename, \"out%04d.png\", i);\n\t\tfprintf(stderr, \"\\tSaving %s...\\n\", filename);\n\n\t\t// Write the rendered image to a PNG file\n\n\t\tfz_write_png(ctx, data->pix, filename, 0);\n\n\t\t// Free the thread's pixmap and display list since\n\t\t// they were allocated by the main thread above.\n\n\t\tfz_drop_pixmap(ctx, data->pix);\n\t\tfz_drop_display_list(ctx, data->list);\n\n\t\t// Free the data structured passed back and forth\n\t\t// between the main thread and rendering thread.\n\n\t\tfree(data);\n\t}\n\n\tfprintf(stderr, \"finally!\\n\");\n\tfflush(NULL);\n\n\tfree(thread);\n\n\t// Finally the document is closed and the main thread's\n\t// context is freed.\n\n\tfz_close_document(doc);\n\tfz_free_context(ctx);\n\n\treturn 0;\n}\n"
  },
  {
    "path": "mupdf/docs/naming.txt",
    "content": "Functions should be named according to one of the following schemes:\n\n\tverb_noun\n\tverb_noun_with_noun\n\n\tnoun_attribute\n\tget_noun_attribute -- when the 'noun_attribute' name conflicts with a type\n\tset_noun_attribute\n\nPrefixes are mandatory for exported functions, macros, enums, globals and types.\n\n\tfz for common code\n\tpdf, xps, etc., for interpreter specific code\n\nPrefixes are optional (but encouraged) for private functions and types.\n\nAvoid using 'get' as this is a meaningless and redundant filler word.\n\nThese words are reserved for reference counting schemes:\n\n\tnew, find, load, open, keep -- return objects that you are responsible for freeing.\n\n\tdrop, free, close -- relinquish ownership of the object passed in.\n\nWhen searching for an object or value, the name used depends on whether\nreturning the value is passing ownership:\n\n\tlookup -- return a value or borrowed pointer\n\n\tfind -- return an object that the caller is responsible for freeing\n"
  },
  {
    "path": "mupdf/docs/overview.txt",
    "content": "Contents\n========\n\n* Basic MuPDF usage example\n* Common function arguments\n* Error Handling\n* Multi-threading\n* Cloning the context\n* Bound contexts\n\nBasic MuPDF usage example\n=========================\n\nFor an example of how to use MuPDF in the most basic way, see\ndoc/example.c. To limit the complexity and give an easier introduction\nthis code has no error handling at all, but any serious piece of code\nusing MuPDF should use the error handling strategies described below.\n\nCommon function arguments\n=========================\n\nMany functions in MuPDFs interface take a context argument.\n\nA context contains global state used by MuPDF inside functions when\nparsing or rendering pages of the document. It contains for example:\n\n\tan exception stack (see error handling below),\n\n\ta memory allocator (allowing for custom allocators)\n\n\ta resource store (for caching of images, fonts, etc.)\n\n\ta set of locks and (un-)locking functions (for multi-threading)\n\nOther functions in MuPDF's interface take arguments such as document,\nstream and device which contain state for each type of object. Those\narguments each have a reference to a context and therefore act as\nproxies for a context.\n\nWithout the set of locks and accompanying functions the context and\nits proxies may only be used in a single-threaded application.\n\nError handling\n==============\n\nMuPDF uses a set of exception handling macros to simplify error return\nand cleanup. Conceptually, they work a lot like C++'s try/catch\nsystem, but do not require any special compiler support.\n\nThe basic formulation is as follows:\n\n\tfz_try(ctx)\n\t{\n\t\t// Try to perform a task. Never 'return', 'goto' or\n\t\t// 'longjmp' out of here. 'break' may be used to\n\t\t// safely exit (just) the try block scope.\n\t}\n\tfz_always(ctx)\n\t{\n\t\t// Any code here is always executed, regardless of\n\t\t// whether an exception was thrown within the try or\n\t\t// not. Never 'return', 'goto' or longjmp out from\n\t\t// here. 'break' may be used to safely exit (just) the\n\t\t// always block scope.\n\t}\n\tfz_catch(ctx)\n\t{\n\t\t// This code is called (after any always block) only\n\t\t// if something within the fz_try block (including any\n\t\t// functions it called) threw an exception. The code\n\t\t// here is expected to handle the exception (maybe\n\t\t// record/report the error, cleanup any stray state\n\t\t// etc) and can then either exit the block, or pass on\n\t\t// the exception to a higher level (enclosing) fz_try\n\t\t// block (using fz_throw, or fz_rethrow).\n\t}\n\nThe fz_always block is optional, and can safely be omitted.\n\nThe macro based nature of this system has 3 main limitations:\n\n1)\tNever return from within try (or 'goto' or longjmp out of it).\n\tThis upsets the internal housekeeping of the macros and will\n\tcause problems later on. The code will detect such things\n\thappening, but by then it is too late to give a helpful error\n\treport as to where the original infraction occurred.\n\n2)\tThe fz_try(ctx) { ... } fz_always(ctx) { ... } fz_catch(ctx) { ... }\n\tis not one atomic C statement. That is to say, if you do:\n\n\t\tif (condition)\n\t\t\tfz_try(ctx) { ... }\n\t\t\tfz_catch(ctx) { ... }\n\n\tthen you will not get what you want. Use the following instead:\n\n\t\tif (condition) {\n\t\t\tfz_try(ctx) { ... }\n\t\t\tfz_catch(ctx) { ... }\n\t\t}\n\n3)\tThe macros are implemented using setjmp and longjmp, and so\n\tthe standard C restrictions on the use of those functions\n\tapply to fz_try/fz_catch too. In particular, any \"truly local\"\n\tvariable that is set between the start of fz_try and something\n\tin fz_try throwing an exception may become undefined as part\n\tof the process of throwing that exception.\n\n\tAs a way of mitigating this problem, we provide an fz_var()\n\tmacro that tells the compiler to ensure that that variable is\n\tnot unset by the act of throwing the exception.\n\nA model piece of code using these macros then might be:\n\n\thouse build_house(plans *p)\n\t{\n\t\tmaterial m = NULL;\n\t\twalls w = NULL;\n\t\troof r = NULL;\n\t\thouse h = NULL;\n\t\ttiles t = make_tiles();\n\n\t\tfz_var(w);\n\t\tfz_var(r);\n\t\tfz_var(h);\n\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tfz_try(ctx)\n\t\t\t{\n\t\t\t\tm = make_bricks();\n\t\t\t}\n\t\t\tfz_catch(ctx)\n\t\t\t{\n\t\t\t\t// No bricks available, make do with straw?\n\t\t\t\tm = make_straw();\n\t\t\t}\n\t\t\tw = make_walls(m, p);\n\t\t\tr = make_roof(m, t);\n\t\t\t// Note, NOT: return combine(w,r);\n\t\t\th = combine(w, r);\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tdrop_walls(w);\n\t\t\tdrop_roof(r);\n\t\t\tdrop_material(m);\n\t\t\tdrop_tiles(t);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_throw(ctx, \"build_house failed\");\n\t\t}\n\t\treturn h;\n\t}\n\nThings to note about this:\n\na)\tIf make_tiles throws an exception, this will immediately be\n\thandled by some higher level exception handler. If it\n\tsucceeds, t will be set before fz_try starts, so there is no\n\tneed to fz_var(t);\n\nb)\tWe try first off to make some bricks as our building material.\n\tIf this fails, we fall back to straw. If this fails, we'll end\n\tup in the fz_catch, and the process will fail neatly.\n\nc)\tWe assume in this code that combine takes new reference to\n\tboth the walls and the roof it uses, and therefore that w and\n\tr need to be cleaned up in all cases.\n\nd)\tWe assume the standard C convention that it is safe to destroy\n\tNULL things.\n\nMulti-threading\n===============\n\nFirst off, study the basic usage example in doc/example.c and make\nsure you understand how it works as the data structures manipulated\nthere will be refered to in this section too.\n\nMuPDF can usefully be built into a multi-threaded application without\nthe library needing to know anything threading at all. If the library\nopens a document in one thread, and then sits there as a 'server'\nrequesting pages and rendering them for other threads that need them,\nthen the library is only ever being called from this one thread.\n\nOther threads can still be used to handle UI requests etc, but as far\nas MuPDF is concerned it is only being used in a single threaded way.\nIn this instance, there are no threading issues with MuPDF at all,\nand it can safely be used without any locking, as described in the\nprevious sections.\n\nThis section will attempt to explain how to use MuPDF in the more\ncomplex case; where we genuinely want to call the MuPDF library\nconcurrently from multiple threads within a single application.\n\nMuPDF can be invoked with a user supplied set of locking functions.\nIt uses these to take mutexes around operations that would conflict\nif performed concurrently in multiple threads. By leaving the\nexact implementation of locks to the caller MuPDF remains threading\nlibrary agnostic.\n\nThe following simple rules should be followed to ensure that\nmulti-threaded operations run smoothly:\n\n1)\t\"No simultaneous calls to MuPDF in different threads are\n\tallowed to use the same context.\"\n\n\tMost of the time it is simplest to just use a different\n\tcontext for every thread; just create a new context at the\n\tsame time as you create the thread. For more details see\n\t\"Cloning the context\" below.\n\n2)\t\"The document is bound to the context with which it is created.\"\n\n\tAll subsequent accesses to the document implicitly use the same\n\tcontext; this means that only 1 thread can ever be accessing\n\tthe document at once. This does not mean that the document can\n\tonly ever be used from one thread, though in many cases this\n\tis the simplest structure overall. See \"Bound contexts\" below.\n\n3)\t\"Any device is bound to the context with which it is created.\"\n\n\tAll subsequent uses of a device implicitly use the context with\n\twhich it was created; this means that if a device is used with\n\ta document, it should be created with the same context as that\n\tdocument was. This does not mean that the device can only ever\n\tbe used from one thread, though in many cases this is the\n\tsimplest structure overall. See \"Bound contexts\" below.\n\nSo, how does a multi-threaded example differ from a non-multithreaded\none?\n\nFirstly, when we create the first context, we call fz_new_context\nas before, but the second argument should be a pointer to a set\nof locking functions.\n\nThe calling code should provide FZ_LOCK_MAX mutexes, which will be\nlocked/unlocked by MuPDF calling the lock/unlock function pointers\nin the supplied structure with the user pointer from the structure\nand the lock number, i (0 <= i < FZ_LOCK_MAX). These mutexes can\nsafely be recursive or non-recursive as MuPDF only calls in a non-\nrecursive style.\n\nTo make subsequent contexts, the user should NOT call fz_new_context\nagain (as this will fail to share important resources such as the\nstore and glyphcache), but should rather call fz_clone_context.\nEach of these cloned contexts can be freed by fz_free_context as\nusual. They will share the important data structures (like store,\nglyph cache etc) with the original context, but will have their\nown exception stacks.\n\nTo open a document, call fz_open_document as usual, passing a context\nand a filename; this context is bound to the document. All future\ncalls to access the document will use this context internally.\n\nOnly one thread at a time can therefore perform operations such as\nfetching a page, or rendering that page to a display list. Once a\ndisplay list has been obtained however, it can be rendered from any\nother thread (or even from several threads simultaneously, giving\nbanded rendering).\n\nThis means that an implementer has 2 basic choices when constructing\nan application to use MuPDF in multi-threaded mode. Either he can\nconstruct it so that a single nominated thread opens the document\nand then acts as a 'server' creating display lists for other threads\nto render, or he can add his own mutex around calls to mupdf that\nuse the document. The former is likely to be far more efficient in\nthe long run.\n\nFor an example of how to do multi-threading see doc/multi-threaded.c\nwhich has a main thread and one rendering thread per page.\n\nCloning the context\n===================\n\nAs described above, every context contains an exception stack which is\nmanipulated during the course of nested fz_try/fz_catches. For obvious\nreasons the same exception stack cannot be used from more than one\nthread at a time.\n\nIf, however, we simply created a new context (using fz_new_context) for\nevery thread, we would end up with separate stores/glyph caches etc,\nwhich is not (generally) what is desired. MuPDF therefore provides a\nmechanism for \"cloning\" a context. This creates a new context that\nshares everything with the given context, except for the exception\nstack.\n\nA commonly used general scheme is therefore to create a 'base' context\nat program start up, and to clone this repeatedly to get new contexts\nthat can be used on new threads.\n\nBound contexts\n==============\n\nCertain objects, bind themselves to the context with which they are\ncreated. For instance, when a document (or device) is created it\nremembers the context which it was initially passed. The advantage\nof this is that any subsequent calls to the document do not need a\ncontext to be passed (and internally, we only need to pass a document\npointer around rather than both a document and a context pointer).\n\nThe downside to this is that care must be taken to only use the\ndocument pointer with the same context. For example consider the\nfollowing pseudo code:\n\n\t// Create the base context\n\tbase_ctx = fz_new_context(...);\n\n\t// Open the document. doc remembers ctx.\n\tdoc = fz_open_document(ctx, ...);\n\n\t// Create a new context, possibly to use in another thread\n\tctx2 = fz_clone_context(ctx);\n\n\t// Get a page using that new context\n\tfz_try(ctx2)\n\t{\n\t\tpage = fz_load_page(doc, page_number);\n\t}\n\tfz_catch(ctx2)\n\t{\n\t\t// handle the error\n\t\t...\n\t}\n\nOn the face of it, this seems fine, until you consider what happens\ninternally to fz_load_page. The internals of fz_load_page will use\nerror handling too, and so will fz_throw in some circumstances (and\nwill probably do fz_try/fz_catch for themselves). In order to do so,\nthey will retrieve the ctx that doc was created with - in the above\nexample this will be base_ctx.\n\nThis means that in the case of an error being thrown from within\nfz_load_page we'll end up with something like the following:\n\n\tfz_try(ctx2)\n\t{\n\t\t...\n\t\t// inside fz_load_page, an error occurs\n\t\tfz_throw(base_ctx, ... };\n\t\t...\n\n\t}\n\tfz_catch(ctx2)\n\t{\n\t\t// Handle the error\n\t}\n\nThe error will be thrown using the exception stack from base_ctx, but\nthe caller has set up the code to catch the error using the exception\nstack from ctx2. Code that gets this wrong may well appear to work\nperfectly well for long periods, and then only fail with files that\nraise errors in particular places. This will cause the program to\nterminate abnormally (or crash), and can be very hard to debug.\n"
  },
  {
    "path": "mupdf/docs/progressive.txt",
    "content": "How to do progressive loading with MuPDF.\n=========================================\n\nWhat is progressive loading?\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe idea of progressive loading is that as you download a PDF file\ninto a browser, you can display the pages as they appear.\n\nMuPDF can make use of 2 different mechanisms to achieve this. The\nfirst relies on the file being \"linearized\", the second relies on\nthe caller of MuPDF having fine control over the http fetch and on\nthe server supporting byte-range fetches.\n\nFor optimum performance a file should be both linearized and be\navailable over a byte-range supporting link, but benefits can still\nbe had with either one of these alone.\n\n\nProgressive download using \"linearized\" files\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nAdobe defines \"linearized\" PDFs as being ones that have both a\nspecific layout of objects and a small amount of extra\ninformation to help avoid seeking within a file. The stated aim\nis to deliver the first page of a document in advance of the whole\ndocument downloading, whereupon subsequent pages will become\navailable. Adobe also refers to these as \"Optimized for fast web\nview\" or \"Web Optimized\".\n\nIn fact, the standard outlines (poorly) a mechanism by which 'hints'\ncan be included that enable the subsequent pages to be found within\nthe file too. Unfortunately this is very poorly supported with\nmany tools, and so the hints have to be treated with suspicion.\n\nMuPDF will attempt to use hints if they are available, but will also\nuse a linear search of the file to discover pages if not. This means\nthat the first page will be displayed quickly, and then subsequent\nones will appear with 'incomplete' renderings that improve over time\nas more and more resources are gradually delivered.\n\nEssentially the file starts with a slightly modified header, and the\nfirst object in the file is a special one (the linearization object)\nthat a) indicates that the file is linearized, and b) gives some\nuseful information (like the number of pages in the file etc).\n\nThis object is then followed by all the objects required for the\nfirst page, then the \"hint stream\", then sets of object for each\nsubsequent page in turn, then shared objects required for those\npages, then various other random things.\n\n[Yes, really. While page 1 is sent with all the objects that it\nuses, shared or otherwise, subsequent pages do not get shared\nresources until after all the unshared page objects have been\nsent.]\n\n\nThe Hint Stream\n~~~~~~~~~~~~~~~\n\nAdobe intended Hint Stream to be useful to facilitate the display\nof subsequent pages, but it has never used it. Consequently you\ncan't trust people to write it properly - indeed Adobe outputs\nsomething that doesn't quite conform to the spec.\n\nConsequently very few people actually use it. MuPDF will use it\nafter sanity checking the values, and should cope with illegal/\nincorrect values.\n\n\nSo how does MuPDF handle progressive loading?\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nMuPDF has made various extensions to its mechanisms for handling\nprogressive loading.\n\n  + Progressive streams\n\n    At its lowest level MuPDF reads file data from an fz_stream,\n    using the fz_open_document_with_stream call. (fz_open_document\n    is implemented by calling this). We have extended the fz_stream\n    slightly, giving the system a way to ask for meta information\n    (or perform meta operations) on a stream.\n\n    Using this mechanism MuPDF can query:\n\n      + whether a stream is progressive or not (i.e. whether the\n        entire stream is accessible immediately)\n      + what the length of a stream should ultimately be (which an\n        http fetcher should know from the Content-Length header),\n\n    With this information MuPDF can decide whether to use its normal\n    object reading code, or whether to make use of a linearized\n    object. Knowing the length enables us to check with the length\n    value given in the linearized object - if these differ, the\n    assumption is that an incremental save has taken place, thus the\n    file is no longer linearized.\n\n    When data is pulled from a progressive stream, if we attempt to\n    read data that is not currently available, the stream should\n    throw an FZ_ERROR_TRYLATER error. This particular error code\n    will be interpreted by the caller as an indication that it\n    should retry the parsing of the current objects at a later time.\n\n    When a MuPDF call is made on a progressive stream, such as\n    fz_open_document_with_stream, or fz_load_page, the caller should\n    be prepared to handle an FZ_ERROR_TRYLATER error as meaning that\n    more data is required before it can continue. No indication is\n    directly given as to exactly how much more data is required, but\n    as the caller will be implementing the progressive fz_stream\n    that it has passed into MuPDF to start with, it can reasonably\n    be expected to figure out an estimate for itself.\n\n  + Cookie\n\n    Once a page has been loaded, if its contents are to be 'run'\n    as normal (using e.g. fz_run_page) any error (such as failing\n    to read a font, or an image, or even a content stream belonging\n    to the page) will result in a rendering that aborts with an\n    FZ_ERROR_TRYLATER error. The caller can catch this and display\n    a placeholder instead.\n\n    If each pages data was entirely self-contained and sent in\n    sequence this would perhaps be acceptable, with each page\n    appearing one after the other. Unfortunately, the linearization\n    procedure as laid down by Adobe does NOT do this: objects shared\n    between multiple pages (other than the first) are not sent with\n    the pages themselves, but rather AFTER all the pages have been\n    sent.\n\n    This means that a document that has a title page, then contents\n    that share a font used on pages 2 onwards, will not be able to\n    correctly display page 2 until after the font has arrived in\n    the file, which will not be until all the page data has been\n    sent.\n\n    To mitigate against this, MuPDF provides a way whereby callers\n    can indicate that they are prepared to accept an 'incomplete'\n    rendering of the file (perhaps with missing images, or with\n    substitute fonts).\n\n    Callers prepared to tolerate such renderings should set the\n    'incomplete_ok' flag in the cookie, then call fz_run_page etc\n    as normal. If an FZ_ERROR_TRYLATER error is thrown at any point\n    during the page rendering, the error will be swallowed, the\n    'incomplete' field in the cookie will become non-zero and\n    rendering will continue. When control returns to the caller\n    the caller can check the value of the 'incomplete' field and\n    know that the rendering it received is not authoritative.\n\n\nProgressive loading using byte range requests\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIf the caller has control over the http fetch, then it is possible\nto use byte range requests to fetch the document 'out of order'.\nThis enables non-linearized files to be progressively displayed as\nthey download, and fetches complete renderings of pages earlier than\nwould otherwise be the case. This process requires no changes within\nMuPDF itself, but rather in the way the progressive stream learns\nfrom the attempts MuPDF makes to fetch data.\n\nConsider for example, an attempt to fetch a hypothetical file from\na server.\n\n + The initial http request for the document is sent with a \"Range:\"\n   header to pull down the first (say) 4k of the file.\n\n + As soon as we get the header in from this initial request, we can\n   respond to meta stream operations to give the length, and whether\n   byte requests are accepted.\n\n   - If the header indicates that byte ranges are acceptable the\n     stream proceeds to go into a loop fetching chunks of the file\n     at a time (not necessarily in-order). Otherwise the server\n     will ignore the Range: header, and just serve the whole file.\n\n   - If the header indicates a content-length, the stream returns\n     that.\n\n + MuPDF can then decide how to proceed based upon these flags and\n   whether the file is linearized or not. (If the file contains a\n   linearized object, and the content length matches, then the file\n   is considered to be linear, otherwise it is not).\n\n   If the file is linear:\n\n   - we proceed to read objects out of the file as it downloads.\n     This will provide us the first page and all its resources. It\n     will also enable us to read the hint streams (if present).\n\n   - Once we have read the hint streams, we unpack (and sanity\n     check) them to give us a map of where in the file each object\n     is predicted to live, and which objects are required for each\n     page. If any of these values are out of range, we treat the\n     file as if there were no hint streams.\n\n   - If we have hints, any attempt to load a subsequent page will\n     cause MuPDF to attempt to read exactly the objects required.\n     This will cause a sequence of seeks in the fz_stream followed\n     by reads. If the stream does not have the data to satisfy that\n     request yet, the stream code should remember the location that\n     was fetched (and fetch that block in the background so that\n     future retries will succeed) and should raise an\n     FZ_ERROR_TRYLATER error.\n\n     [Typically therefore when we jump to a page in a linear file\n     on a byte request capable link, we will quickly see a rough\n     rendering, which will improve fairly fast as images and fonts\n     arrive.]\n\n   - Regardless of whether we have hints or byte requests, on every\n     fz_load_page call MuPDF will attempt to process more of the\n     stream (that is assumed to be being downloaded in the\n     background). As linearized files are guaranteed to have pages\n     in order, pages will gradually become available. In the absence\n     of byte requests and hints however, we have no way of getting\n     resources early, so the renderings for these pages will remain\n     incomplete until much more of the file has arrived.\n\n     [Typically therefore when we jump to a page in a linear file\n     on a non byte request capable link, we will see a rough\n     rendering for that page as soon as data arrives for it (which\n     will typically take much longer than would be the case with\n     byte range capable downloads), and that will improve much more\n     slowly as images and fonts may not appear until almost the\n     whole file has arrived.]\n\n   - When the whole file has arrived, then we will attempt to read\n     the outlines for the file.\n\n   For a non-linearized PDF on a byte request capable stream:\n\n   - MuPDF will immediately seek to the end of the file to attempt\n     to read the trailer. This will fail with an FZ_ERROR_TRYLATER\n     due to the data not being here yet, but the stream code should\n     remember that this data is required and it should be prioritized\n     in the background fetch process.\n\n   - Repeated attempts to open the stream should eventually succeed\n     therefore. As MuPDF jumps through the file trying to read first\n     the xrefs, then the page tree objects, then the page contents\n     themselves etc, the background fetching process will be driven\n     by the attempts to read the file in the foreground.\n\n     [Typically therefore the opening of a non-linearized file will\n     be slower than a linearized one, as the xrefs/page trees for a\n     non-linear file can be 20%+ of the file data. Once past this\n     initial point however, pages and data can be pulled from the\n     file almost as fast as with a linearized file.]\n     \n   For a non-linearized PDF on a non-byte request capable stream:\n\n   - MuPDF will immediately seek to the end of the file to attempt\n     to read the trailer. This will fail with an FZ_ERROR_TRYLATER\n     due to the data not being here yet. Subsequent retries will\n     continue to fail until the whole file has arrived, whereupon\n     the whole file will be instantly available.\n\n     [This is the worst case situation - nothing at all can be\n     displayed until the entire file has downloaded.]\n\n  A typical structure for a fetcher process (see curl-stream.c in\n  mupdf-curl as an example) might therefore look like this:\n\n + We consider the file as an (initially empty) buffer which we are\n   filling by making requests. In order to ensure that we make\n   maximum use of our download link, we ensure that whenever\n   one request finishes, we immediately launch another. Further, to\n   avoid the overheads for the request/response headers being too\n   large, we may want to divide the file into 'chunks', perhaps 4 or 32k\n   in size.\n\n + We can then have a receiver process that sits there in a loop\n   requesting chunks to fill this buffer. In the absence of\n   any other impetus the receiver should request the next 'chunk'\n   of data from the file that it does not yet have, following the last\n   fill point. Initially we start the fill point at the beginning of\n   the file, but this will move around based on the requests made of\n   the progressive stream.\n\n + Whenever MuPDF attempts to read from the stream, we check to see if\n   we have data for this area of the file already. If we do, we can\n   return it. If not, we remember this as the next \"fill point\" for our\n   receiver process and throw an FZ_ERROR_TRYLATER error.\n"
  },
  {
    "path": "mupdf/docs/refcount.txt",
    "content": "Reference counting uses special words in functions to make it easy to remember\nand follow the rules.\n\nWords that take ownership: new, find, load, open, keep.\n\nWords that release ownership: drop, free, close.\n\nIf an object is returned by a function with one of the special words that take\nownership, you are responsible for freeing it by calling \"drop\" or \"free\", or\n\"close\" before you return. You may pass ownership of an owned object by return\nit only if you name the function using one of the special words.\n\nAny objects returned by functions that do not have any of these special words,\nare borrowed and have a limited life time. Do not hold on to them past the\nduration of the current function, or stow them away inside structs. If you need\nto keep the object for longer than that, you have to either \"keep\" it or make\nyour own copy.\n"
  },
  {
    "path": "mupdf/font_base14.asm",
    "content": "; Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n; License: GPLv3\r\n\r\n; 64-bit linkers don't expect any name decorations\r\n%ifdef WIN64\r\n%define EXPORT(name) name\r\n%else\r\n%define EXPORT(name) _ %+ name\r\n%endif\r\n\r\nsection .data:\r\n\r\nglobal EXPORT(pdf_font_Dingbats)\r\nEXPORT(pdf_font_Dingbats):\r\n    incbin \"resources/fonts/urw/Dingbats.cff\"\r\n\r\nglobal EXPORT(pdf_font_NimbusMono_Bold)\r\nEXPORT(pdf_font_NimbusMono_Bold):\r\n    incbin \"resources/fonts/urw/NimbusMono-Bold.cff\"\r\n\r\nglobal EXPORT(pdf_font_NimbusMono_BoldOblique)\r\nEXPORT(pdf_font_NimbusMono_BoldOblique):\r\n    incbin \"resources/fonts/urw/NimbusMono-BoldOblique.cff\"\r\n\r\nglobal EXPORT(pdf_font_NimbusMono_Oblique)\r\nEXPORT(pdf_font_NimbusMono_Oblique):\r\n    incbin \"resources/fonts/urw/NimbusMono-Oblique.cff\"\r\n\r\nglobal EXPORT(pdf_font_NimbusMono_Regular)\r\nEXPORT(pdf_font_NimbusMono_Regular):\r\n    incbin \"resources/fonts/urw/NimbusMono-Regular.cff\"\r\n\r\nglobal EXPORT(pdf_font_NimbusRomNo9L_Med)\r\nEXPORT(pdf_font_NimbusRomNo9L_Med):\r\n    incbin \"resources/fonts/urw/NimbusRomNo9L-Med.cff\"\r\n\r\nglobal EXPORT(pdf_font_NimbusRomNo9L_MedIta)\r\nEXPORT(pdf_font_NimbusRomNo9L_MedIta):\r\n    incbin \"resources/fonts/urw/NimbusRomNo9L-MedIta.cff\"\r\n\r\nglobal EXPORT(pdf_font_NimbusRomNo9L_Reg)\r\nEXPORT(pdf_font_NimbusRomNo9L_Reg):\r\n    incbin \"resources/fonts/urw/NimbusRomNo9L-Reg.cff\"\r\n\r\nglobal EXPORT(pdf_font_NimbusRomNo9L_RegIta)\r\nEXPORT(pdf_font_NimbusRomNo9L_RegIta):\r\n    incbin \"resources/fonts/urw/NimbusRomNo9L-RegIta.cff\"\r\n\r\nglobal EXPORT(pdf_font_NimbusSanL_Bol)\r\nEXPORT(pdf_font_NimbusSanL_Bol):\r\n    incbin \"resources/fonts/urw/NimbusSanL-Bol.cff\"\r\n\r\nglobal EXPORT(pdf_font_NimbusSanL_BolIta)\r\nEXPORT(pdf_font_NimbusSanL_BolIta):\r\n    incbin \"resources/fonts/urw/NimbusSanL-BolIta.cff\"\r\n\r\nglobal EXPORT(pdf_font_NimbusSanL_Reg)\r\nEXPORT(pdf_font_NimbusSanL_Reg):\r\n    incbin \"resources/fonts/urw/NimbusSanL-Reg.cff\"\r\n\r\nglobal EXPORT(pdf_font_NimbusSanL_RegIta)\r\nEXPORT(pdf_font_NimbusSanL_RegIta):\r\n    incbin \"resources/fonts/urw/NimbusSanL-RegIta.cff\"\r\n\r\nglobal EXPORT(pdf_font_StandardSymL)\r\nEXPORT(pdf_font_StandardSymL):\r\n    incbin \"resources/fonts/urw/StandardSymL.cff\"\r\n"
  },
  {
    "path": "mupdf/include/mupdf/cbz.h",
    "content": "#ifndef MUPDF_CBZ_H\n#define MUPDF_CBZ_H\n\n#include \"mupdf/fitz.h\"\n\ntypedef struct cbz_document_s cbz_document;\ntypedef struct cbz_page_s cbz_page;\n\n/*\n\tcbz_open_document: Open a document.\n\n\tOpen a document for reading so the library is able to locate\n\tobjects and pages inside the file.\n\n\tThe returned cbz_document should be used when calling most\n\tother functions. Note that it wraps the context, so those\n\tfunctions implicitly get access to the global state in\n\tcontext.\n\n\tfilename: a path to a file as it would be given to open(2).\n*/\ncbz_document *cbz_open_document(fz_context *ctx, const char *filename);\n\n/*\n\tcbz_open_document_with_stream: Opens a document.\n\n\tSame as cbz_open_document, but takes a stream instead of a\n\tfilename to locate the document to open. Increments the\n\treference count of the stream. See fz_open_file,\n\tfz_open_file_w or fz_open_fd for opening a stream, and\n\tfz_close for closing an open stream.\n*/\ncbz_document *cbz_open_document_with_stream(fz_context *ctx, fz_stream *file);\n\n/*\n\tcbz_close_document: Closes and frees an opened document.\n\n\tThe resource store in the context associated with cbz_document\n\tis emptied.\n\n\tDoes not throw exceptions.\n*/\nvoid cbz_close_document(cbz_document *doc);\n\nint cbz_count_pages(cbz_document *doc);\ncbz_page *cbz_load_page(cbz_document *doc, int number);\nfz_rect *cbz_bound_page(cbz_document *doc, cbz_page *page, fz_rect *rect);\nvoid cbz_free_page(cbz_document *doc, cbz_page *page);\nvoid cbz_run_page(cbz_document *doc, cbz_page *page, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/annotation.h",
    "content": "#ifndef MUPDF_FITZ_ANNOTATION_H\n#define MUPDF_FITZ_ANNOTATION_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/math.h\"\n#include \"mupdf/fitz/document.h\"\n\ntypedef enum\n{\n\tFZ_ANNOT_TEXT,\n\tFZ_ANNOT_LINK,\n\tFZ_ANNOT_FREETEXT,\n\tFZ_ANNOT_LINE,\n\tFZ_ANNOT_SQUARE,\n\tFZ_ANNOT_CIRCLE,\n\tFZ_ANNOT_POLYGON,\n\tFZ_ANNOT_POLYLINE,\n\tFZ_ANNOT_HIGHLIGHT,\n\tFZ_ANNOT_UNDERLINE,\n\tFZ_ANNOT_SQUIGGLY,\n\tFZ_ANNOT_STRIKEOUT,\n\tFZ_ANNOT_STAMP,\n\tFZ_ANNOT_CARET,\n\tFZ_ANNOT_INK,\n\tFZ_ANNOT_POPUP,\n\tFZ_ANNOT_FILEATTACHMENT,\n\tFZ_ANNOT_SOUND,\n\tFZ_ANNOT_MOVIE,\n\tFZ_ANNOT_WIDGET,\n\tFZ_ANNOT_SCREEN,\n\tFZ_ANNOT_PRINTERMARK,\n\tFZ_ANNOT_TRAPNET,\n\tFZ_ANNOT_WATERMARK,\n\tFZ_ANNOT_3D\n} fz_annot_type;\n\n/*\n\tfz_get_annot_type: return the type of an annotation\n*/\nfz_annot_type fz_get_annot_type(fz_annot *annot);\n\n/*\n\tfz_first_annot: Return a pointer to the first annotation on a page.\n\n\tDoes not throw exceptions.\n*/\nfz_annot *fz_first_annot(fz_document *doc, fz_page *page);\n\n/*\n\tfz_next_annot: Return a pointer to the next annotation on a page.\n\n\tDoes not throw exceptions.\n*/\nfz_annot *fz_next_annot(fz_document *doc, fz_annot *annot);\n\n/*\n\tfz_bound_annot: Return the bounding rectangle of the annotation.\n\n\tDoes not throw exceptions.\n*/\nfz_rect *fz_bound_annot(fz_document *doc, fz_annot *annot, fz_rect *rect);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/bitmap.h",
    "content": "#ifndef MUPDF_FITZ_BITMAP_H\n#define MUPDF_FITZ_BITMAP_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/pixmap.h\"\n\n/*\n\tBitmaps have 1 bit per component. Only used for creating halftoned\n\tversions of contone buffers, and saving out. Samples are stored msb\n\tfirst, akin to pbms.\n*/\ntypedef struct fz_bitmap_s fz_bitmap;\n\n/*\n\tfz_keep_bitmap: Take a reference to a bitmap.\n\n\tbit: The bitmap to increment the reference for.\n\n\tReturns bit. Does not throw exceptions.\n*/\nfz_bitmap *fz_keep_bitmap(fz_context *ctx, fz_bitmap *bit);\n\n/*\n\tfz_drop_bitmap: Drop a reference and free a bitmap.\n\n\tDecrement the reference count for the bitmap. When no\n\treferences remain the pixmap will be freed.\n\n\tDoes not throw exceptions.\n*/\nvoid fz_drop_bitmap(fz_context *ctx, fz_bitmap *bit);\n\n/*\n\tA halftone is a set of threshold tiles, one per component. Each\n\tthreshold tile is a pixmap, possibly of varying sizes and phases.\n\tCurrently, we only provide one 'default' halftone tile for operating\n\ton 1 component plus alpha pixmaps (where the alpha is ignored). This\n\tis signified by an fz_halftone pointer to NULL.\n*/\ntypedef struct fz_halftone_s fz_halftone;\n\n/*\n\tfz_halftone_pixmap: Make a bitmap from a pixmap and a halftone.\n\n\tpix: The pixmap to generate from. Currently must be a single color\n\tcomponent + alpha (where the alpha is assumed to be solid).\n\n\tht: The halftone to use. NULL implies the default halftone.\n\n\tReturns the resultant bitmap. Throws exceptions in the case of\n\tfailure to allocate.\n*/\nfz_bitmap *fz_halftone_pixmap(fz_context *ctx, fz_pixmap *pix, fz_halftone *ht);\n\nstruct fz_bitmap_s\n{\n\tint refs;\n\tint w, h, stride, n;\n\tint xres, yres;\n\tunsigned char *samples;\n};\n\nfz_bitmap *fz_new_bitmap(fz_context *ctx, int w, int h, int n, int xres, int yres);\n\nvoid fz_bitmap_details(fz_bitmap *bitmap, int *w, int *h, int *n, int *stride);\n\nvoid fz_clear_bitmap(fz_context *ctx, fz_bitmap *bit);\n\nstruct fz_halftone_s\n{\n\tint refs;\n\tint n;\n\tfz_pixmap *comp[1];\n};\n\nfz_halftone *fz_new_halftone(fz_context *ctx, int num_comps);\nfz_halftone *fz_default_halftone(fz_context *ctx, int num_comps);\nvoid fz_drop_halftone(fz_context *ctx, fz_halftone *half);\nfz_halftone *fz_keep_halftone(fz_context *ctx, fz_halftone *half);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/buffer.h",
    "content": "#ifndef MUPDF_FITZ_BUFFER_H\n#define MUPDF_FITZ_BUFFER_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n\n/*\n\tfz_buffer is a wrapper around a dynamically allocated array of bytes.\n\n\tBuffers have a capacity (the number of bytes storage immediately\n\tavailable) and a current size.\n*/\ntypedef struct fz_buffer_s fz_buffer;\n\n/*\n\tfz_keep_buffer: Increment the reference count for a buffer.\n\n\tbuf: The buffer to increment the reference count for.\n\n\tReturns a pointer to the buffer. Does not throw exceptions.\n*/\nfz_buffer *fz_keep_buffer(fz_context *ctx, fz_buffer *buf);\n\n/*\n\tfz_drop_buffer: Decrement the reference count for a buffer.\n\n\tbuf: The buffer to decrement the reference count for.\n*/\nvoid fz_drop_buffer(fz_context *ctx, fz_buffer *buf);\n\n/*\n\tfz_buffer_storage: Retrieve information on the storage currently used\n\tby a buffer.\n\n\tdata: Pointer to place to retrieve data pointer.\n\n\tReturns length of stream.\n*/\nint fz_buffer_storage(fz_context *ctx, fz_buffer *buf, unsigned char **data);\n\nstruct fz_buffer_s\n{\n\tint refs;\n\tunsigned char *data;\n\tint cap, len;\n\tint unused_bits;\n};\n\n/*\n\tfz_new_buffer: Create a new buffer.\n\n\tcapacity: Initial capacity.\n\n\tReturns pointer to new buffer. Throws exception on allocation\n\tfailure.\n*/\nfz_buffer *fz_new_buffer(fz_context *ctx, int capacity);\n\n/*\n\tfz_new_buffer_from_data: Create a new buffer with existing data.\n\n\tdata: Pointer to existing data.\n\tsize: Size of existing data.\n\n\tTakes ownership of data. Does not make a copy. Calls fz_free on the\n\tdata when the buffer is deallocated. Do not use 'data' after passing\n\tto this function.\n\n\tReturns pointer to new buffer. Throws exception on allocation\n\tfailure.\n*/\nfz_buffer *fz_new_buffer_from_data(fz_context *ctx, unsigned char *data, int size);\n\n/*\n\tfz_resize_buffer: Ensure that a buffer has a given capacity,\n\ttruncating data if required.\n\n\tbuf: The buffer to alter.\n\n\tcapacity: The desired capacity for the buffer. If the current size\n\tof the buffer contents is smaller than capacity, it is truncated.\n\n*/\nvoid fz_resize_buffer(fz_context *ctx, fz_buffer *buf, int capacity);\n\n/*\n\tfz_grow_buffer: Make some space within a buffer (i.e. ensure that\n\tcapacity > size).\n\n\tbuf: The buffer to grow.\n\n\tMay throw exception on failure to allocate.\n*/\nvoid fz_grow_buffer(fz_context *ctx, fz_buffer *buf);\n\n/*\n\tfz_trim_buffer: Trim wasted capacity from a buffer.\n\n\tbuf: The buffer to trim.\n*/\nvoid fz_trim_buffer(fz_context *ctx, fz_buffer *buf);\n\n/*\n\tfz_buffer_cat: Concatenate buffers\n\n\tbuf: first to concatenate and the holder of the result\n\textra: second to concatenate\n\n\tMay throw exception on failure to allocate.\n*/\nvoid fz_buffer_cat(fz_context *ctx, fz_buffer *buf, fz_buffer *extra);\n\nvoid fz_write_buffer(fz_context *ctx, fz_buffer *buf, const void *data, int len);\n\nvoid fz_write_buffer_byte(fz_context *ctx, fz_buffer *buf, int val);\n\nvoid fz_write_buffer_rune(fz_context *ctx, fz_buffer *buf, int val);\n\nvoid fz_write_buffer_bits(fz_context *ctx, fz_buffer *buf, int val, int bits);\n\nvoid fz_write_buffer_pad(fz_context *ctx, fz_buffer *buf);\n\n/*\n\tfz_buffer_printf: print formatted to a buffer. The buffer will grow\n\tas required.\n*/\nint fz_buffer_printf(fz_context *ctx, fz_buffer *buffer, const char *fmt, ...);\nint fz_buffer_vprintf(fz_context *ctx, fz_buffer *buffer, const char *fmt, va_list args);\n\n/*\n\tfz_buffer_printf: print a string formatted as a pdf string to a buffer.\n\tThe buffer will grow.\n*/\nvoid\nfz_buffer_cat_pdf_string(fz_context *ctx, fz_buffer *buffer, const char *text);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/colorspace.h",
    "content": "#ifndef MUPDF_FITZ_COLORSPACE_H\n#define MUPDF_FITZ_COLORSPACE_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/store.h\"\n\n/* SumatraPDF: make fz_shades use less memory */\nenum { FZ_MAX_COLORS = 8 };\n\n/*\n\tAn fz_colorspace object represents an abstract colorspace. While\n\tthis should be treated as a black box by callers of the library at\n\tthis stage, know that it encapsulates knowledge of how to convert\n\tcolors to and from the colorspace, any lookup tables generated, the\n\tnumber of components in the colorspace etc.\n*/\ntypedef struct fz_colorspace_s fz_colorspace;\n\n/*\n\tfz_lookup_device_colorspace: Find a standard colorspace based upon\n\tit's name.\n*/\nfz_colorspace *fz_lookup_device_colorspace(fz_context *ctx, char *name);\n\n/*\n\tfz_colorspace_is_indexed: Return true, iff a given colorspace is\n\tindexed.\n*/\nint fz_colorspace_is_indexed(fz_colorspace *cs);\n\n/*\n\tfz_device_gray: Get colorspace representing device specific gray.\n*/\nfz_colorspace *fz_device_gray(fz_context *ctx);\n\n/*\n\tfz_device_rgb: Get colorspace representing device specific rgb.\n*/\nfz_colorspace *fz_device_rgb(fz_context *ctx);\n\n/*\n\tfz_device_bgr: Get colorspace representing device specific bgr.\n*/\nfz_colorspace *fz_device_bgr(fz_context *ctx);\n\n/*\n\tfz_device_cmyk: Get colorspace representing device specific CMYK.\n*/\nfz_colorspace *fz_device_cmyk(fz_context *ctx);\n\n/*\n\tfz_set_device_gray: Set colorspace representing device specific gray.\n*/\nvoid fz_set_device_gray(fz_context *ctx, fz_colorspace *cs);\n\n/*\n\tfz_set_device_rgb: Set colorspace representing device specific rgb.\n*/\nvoid fz_set_device_rgb(fz_context *ctx, fz_colorspace *cs);\n\n/*\n\tfz_set_device_bgr: Set colorspace representing device specific bgr.\n*/\nvoid fz_set_device_bgr(fz_context *ctx, fz_colorspace *cs);\n\n/*\n\tfz_set_device_cmyk: Set colorspace representing device specific CMYK.\n*/\nvoid fz_set_device_cmyk(fz_context *ctx, fz_colorspace *cs);\n\nstruct fz_colorspace_s\n{\n\tfz_storable storable;\n\tunsigned int size;\n\tchar name[16];\n\tint n;\n\tvoid (*to_rgb)(fz_context *ctx, fz_colorspace *, const float *src, float *rgb);\n\tvoid (*from_rgb)(fz_context *ctx, fz_colorspace *, const float *rgb, float *dst);\n\tvoid (*free_data)(fz_context *Ctx, fz_colorspace *);\n\tvoid *data;\n};\n\nfz_colorspace *fz_new_colorspace(fz_context *ctx, char *name, int n);\nfz_colorspace *fz_new_indexed_colorspace(fz_context *ctx, fz_colorspace *base, int high, unsigned char *lookup);\nfz_colorspace *fz_keep_colorspace(fz_context *ctx, fz_colorspace *colorspace);\nvoid fz_drop_colorspace(fz_context *ctx, fz_colorspace *colorspace);\nvoid fz_free_colorspace_imp(fz_context *ctx, fz_storable *colorspace);\n\nvoid fz_convert_color(fz_context *ctx, fz_colorspace *dsts, float *dstv, fz_colorspace *srcs, const float *srcv);\n\nvoid fz_new_colorspace_context(fz_context *ctx);\nfz_colorspace_context *fz_keep_colorspace_context(fz_context *ctx);\nvoid fz_drop_colorspace_context(fz_context *ctx);\n\ntypedef struct fz_color_converter_s fz_color_converter;\n\n/* This structure is public because it allows us to avoid dynamic allocations.\n * Callers should only rely on the convert entry - the rest of the structure\n * is subject to change without notice.\n */\nstruct fz_color_converter_s\n{\n\tvoid (*convert)(fz_color_converter *, float *, const float *);\n\tfz_context *ctx;\n\tfz_colorspace *ds;\n\tfz_colorspace *ss;\n\tvoid *opaque;\n};\n\nvoid fz_lookup_color_converter(fz_color_converter *cc, fz_context *ctx, fz_colorspace *ds, fz_colorspace *ss);\n\nvoid fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_colorspace *ds, fz_colorspace *ss);\nvoid fz_fin_cached_color_converter(fz_color_converter *cc);\n\n/* SumatraPDF: support transfer functions */\ntypedef struct fz_transfer_function_s fz_transfer_function;\nstruct fz_transfer_function_s\n{\n\tfz_storable storable;\n\tunsigned char function[4][256];\n};\n\nfz_transfer_function *fz_keep_transfer_function(fz_context *ctx, fz_transfer_function *tr);\nvoid fz_drop_transfer_function(fz_context *ctx, fz_transfer_function *tr);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/compressed-buffer.h",
    "content": "#ifndef MUPDF_FITZ_COMPRESSED_BUFFER_H\n#define MUPDF_FITZ_COMPRESSED_BUFFER_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/buffer.h\"\n#include \"mupdf/fitz/stream.h\"\n\ntypedef struct fz_compression_params_s fz_compression_params;\n\ntypedef struct fz_compressed_buffer_s fz_compressed_buffer;\nunsigned int fz_compressed_buffer_size(fz_compressed_buffer *buffer);\n\nfz_stream *fz_open_compressed_buffer(fz_context *ctx, fz_compressed_buffer *);\nfz_stream *fz_open_image_decomp_stream_from_buffer(fz_context *ctx, fz_compressed_buffer *, int *l2factor);\nfz_stream *fz_open_image_decomp_stream(fz_context *ctx, fz_stream *, fz_compression_params *, int *l2factor);\n\nenum\n{\n\tFZ_IMAGE_UNKNOWN = 0,\n\tFZ_IMAGE_JPEG = 1,\n\tFZ_IMAGE_JPX = 2, /* Placeholder until supported */\n\tFZ_IMAGE_FAX = 3,\n\tFZ_IMAGE_JBIG2 = 4, /* Placeholder until supported */\n\tFZ_IMAGE_RAW = 5,\n\tFZ_IMAGE_RLD = 6,\n\tFZ_IMAGE_FLATE = 7,\n\tFZ_IMAGE_LZW = 8,\n\tFZ_IMAGE_PNG = 9,\n\tFZ_IMAGE_TIFF = 10,\n\tFZ_IMAGE_JXR = 11, /* Placeholder until supported */\n};\n\nstruct fz_compression_params_s\n{\n\tint type;\n\tunion {\n\t\tstruct {\n\t\t\tint color_transform; /* Use -1 for unset */\n\t\t} jpeg;\n\t\tstruct {\n\t\t\tint smask_in_data;\n\t\t} jpx;\n\t\tstruct {\n\t\t\tint columns;\n\t\t\tint rows;\n\t\t\tint k;\n\t\t\tint end_of_line;\n\t\t\tint encoded_byte_align;\n\t\t\tint end_of_block;\n\t\t\tint black_is_1;\n\t\t\tint damaged_rows_before_error;\n\t\t} fax;\n\t\tstruct\n\t\t{\n\t\t\tint columns;\n\t\t\tint colors;\n\t\t\tint predictor;\n\t\t\tint bpc;\n\t\t}\n\t\tflate;\n\t\tstruct\n\t\t{\n\t\t\tint columns;\n\t\t\tint colors;\n\t\t\tint predictor;\n\t\t\tint bpc;\n\t\t\tint early_change;\n\t\t} lzw;\n\t} u;\n};\n\nstruct fz_compressed_buffer_s\n{\n\tfz_compression_params params;\n\tfz_buffer *buffer;\n};\n\nvoid fz_free_compressed_buffer(fz_context *ctx, fz_compressed_buffer *buf);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/context.h",
    "content": "#ifndef MUPDF_FITZ_CONTEXT_H\n#define MUPDF_FITZ_CONTEXT_H\n\n#include \"mupdf/fitz/version.h\"\n#include \"mupdf/fitz/system.h\"\n\n/*\n\tContexts\n*/\n\ntypedef struct fz_alloc_context_s fz_alloc_context;\ntypedef struct fz_error_context_s fz_error_context;\ntypedef struct fz_id_context_s fz_id_context;\ntypedef struct fz_warn_context_s fz_warn_context;\ntypedef struct fz_font_context_s fz_font_context;\ntypedef struct fz_colorspace_context_s fz_colorspace_context;\ntypedef struct fz_aa_context_s fz_aa_context;\ntypedef struct fz_locks_context_s fz_locks_context;\ntypedef struct fz_store_s fz_store;\ntypedef struct fz_glyph_cache_s fz_glyph_cache;\ntypedef struct fz_document_handler_context_s fz_document_handler_context;\ntypedef struct fz_context_s fz_context;\n\nstruct fz_alloc_context_s\n{\n\tvoid *user;\n\tvoid *(*malloc)(void *, unsigned int);\n\tvoid *(*realloc)(void *, void *, unsigned int);\n\tvoid (*free)(void *, void *);\n};\n\nstruct fz_error_context_s\n{\n\tint top;\n\tstruct {\n\t\tint code;\n\t\tfz_jmp_buf buffer;\n\t} stack[256];\n\tint errcode;\n\tchar message[256];\n};\n\nvoid fz_var_imp(void *);\n#define fz_var(var) fz_var_imp((void *)&(var))\n\n/*\n\tException macro definitions. Just treat these as a black box - pay no\n\tattention to the man behind the curtain.\n*/\n\n#define fz_try(ctx) \\\n\tif (fz_push_try(ctx->error) && \\\n\t\t((ctx->error->stack[ctx->error->top].code = fz_setjmp(ctx->error->stack[ctx->error->top].buffer)) == 0))\\\n\t{ do {\n\n#define fz_always(ctx) \\\n\t\t} while (0); \\\n\t} \\\n\tif (ctx->error->stack[ctx->error->top].code < 3) \\\n\t{ \\\n\t\tctx->error->stack[ctx->error->top].code++; \\\n\t\tdo { \\\n\n#define fz_catch(ctx) \\\n\t\t} while(0); \\\n\t} \\\n\tif (ctx->error->stack[ctx->error->top--].code > 1)\n\nint fz_push_try(fz_error_context *ex);\n/* SumatraPDF: add filename and line number to errors and warnings */\n#define fz_throw(CTX, ERRCODE, MSG, ...) fz_throw_imp(CTX, __FILE__, __LINE__, ERRCODE, MSG, __VA_ARGS__)\nFZ_NORETURN void fz_throw_imp(fz_context *ctx, char *file, int line, int errcode, const char *fmt, ...) __printflike(5, 6);\nFZ_NORETURN void fz_rethrow(fz_context *);\n/* SumatraPDF: add filename and line number to errors and warnings */\n#define fz_rethrow_message(CTX, MSG, ...) fz_rethrow_message_imp(CTX, __FILE__, __LINE__, MSG, __VA_ARGS__)\nFZ_NORETURN void fz_rethrow_message_imp(fz_context *, char *file, int line, const char *, ...)  __printflike(4, 5);\n#define fz_warn(CTX, MSG, ...) fz_warn_imp(CTX, __FILE__, __LINE__, MSG, __VA_ARGS__)\nvoid fz_warn_imp(fz_context *ctx, char *file, int line, const char *fmt, ...) __printflike(4, 5);\nconst char *fz_caught_message(fz_context *ctx);\nint fz_caught(fz_context *ctx);\nvoid fz_rethrow_if(fz_context *ctx, int errcode);\n\nenum\n{\n\tFZ_ERROR_NONE = 0,\n\tFZ_ERROR_GENERIC = 1,\n\tFZ_ERROR_TRYLATER = 2,\n\tFZ_ERROR_ABORT = 3,\n\tFZ_ERROR_COUNT\n};\n\n/*\n\tfz_flush_warnings: Flush any repeated warnings.\n\n\tRepeated warnings are buffered, counted and eventually printed\n\talong with the number of repetitions. Call fz_flush_warnings\n\tto force printing of the latest buffered warning and the\n\tnumber of repetitions, for example to make sure that all\n\twarnings are printed before exiting an application.\n\n\tDoes not throw exceptions.\n*/\nvoid fz_flush_warnings(fz_context *ctx);\n\nstruct fz_context_s\n{\n\tfz_alloc_context *alloc;\n\tfz_locks_context *locks;\n\tfz_id_context *id;\n\tfz_error_context *error;\n\tfz_warn_context *warn;\n\tfz_font_context *font;\n\tfz_colorspace_context *colorspace;\n\tfz_aa_context *aa;\n\tfz_store *store;\n\tfz_glyph_cache *glyph_cache;\n\tfz_document_handler_context *handler;\n};\n\n/*\n\tSpecifies the maximum size in bytes of the resource store in\n\tfz_context. Given as argument to fz_new_context.\n\n\tFZ_STORE_UNLIMITED: Let resource store grow unbounded.\n\n\tFZ_STORE_DEFAULT: A reasonable upper bound on the size, for\n\tdevices that are not memory constrained.\n*/\nenum {\n\tFZ_STORE_UNLIMITED = 0,\n\tFZ_STORE_DEFAULT = 256 << 20,\n};\n\n/*\n\tfz_new_context: Allocate context containing global state.\n\n\tThe global state contains an exception stack, resource store,\n\tetc. Most functions in MuPDF take a context argument to be\n\table to reference the global state. See fz_free_context for\n\tfreeing an allocated context.\n\n\talloc: Supply a custom memory allocator through a set of\n\tfunction pointers. Set to NULL for the standard library\n\tallocator. The context will keep the allocator pointer, so the\n\tdata it points to must not be modified or freed during the\n\tlifetime of the context.\n\n\tlocks: Supply a set of locks and functions to lock/unlock\n\tthem, intended for multi-threaded applications. Set to NULL\n\twhen using MuPDF in a single-threaded applications. The\n\tcontext will keep the locks pointer, so the data it points to\n\tmust not be modified or freed during the lifetime of the\n\tcontext.\n\n\tmax_store: Maximum size in bytes of the resource store, before\n\tit will start evicting cached resources such as fonts and\n\timages. FZ_STORE_UNLIMITED can be used if a hard limit is not\n\tdesired. Use FZ_STORE_DEFAULT to get a reasonable size.\n\n\tDoes not throw exceptions, but may return NULL.\n*/\nfz_context *fz_new_context_imp(fz_alloc_context *alloc, fz_locks_context *locks, unsigned int max_store, const char *version);\n\n#define fz_new_context(alloc, locks, max_store) fz_new_context_imp(alloc, locks, max_store, FZ_VERSION)\n\n/*\n\tfz_clone_context: Make a clone of an existing context.\n\n\tThis function is meant to be used in multi-threaded\n\tapplications where each thread requires its own context, yet\n\tparts of the global state, for example caching, is shared.\n\n\tctx: Context obtained from fz_new_context to make a copy of.\n\tctx must have had locks and lock/functions setup when created.\n\tThe two contexts will share the memory allocator, resource\n\tstore, locks and lock/unlock functions. They will each have\n\ttheir own exception stacks though.\n\n\tDoes not throw exception, but may return NULL.\n*/\nfz_context *fz_clone_context(fz_context *ctx);\n\n/*\n\tfz_free_context: Free a context and its global state.\n\n\tThe context and all of its global state is freed, and any\n\tbuffered warnings are flushed (see fz_flush_warnings). If NULL\n\tis passed in nothing will happen.\n\n\tDoes not throw exceptions.\n*/\nvoid fz_free_context(fz_context *ctx);\n\n/*\n\tfz_aa_level: Get the number of bits of antialiasing we are\n\tusing. Between 0 and 8.\n*/\nint fz_aa_level(fz_context *ctx);\n\n/*\n\tfz_set_aa_level: Set the number of bits of antialiasing we should use.\n\n\tbits: The number of bits of antialiasing to use (values are clamped\n\tto within the 0 to 8 range).\n*/\nvoid fz_set_aa_level(fz_context *ctx, int bits);\n\n/*\n\tLocking functions\n\n\tMuPDF is kept deliberately free of any knowledge of particular\n\tthreading systems. As such, in order for safe multi-threaded\n\toperation, we rely on callbacks to client provided functions.\n\n\tA client is expected to provide FZ_LOCK_MAX number of mutexes,\n\tand a function to lock/unlock each of them. These may be\n\trecursive mutexes, but do not have to be.\n\n\tIf a client does not intend to use multiple threads, then it\n\tmay pass NULL instead of a lock structure.\n\n\tIn order to avoid deadlocks, we have one simple rule\n\tinternally as to how we use locks: We can never take lock n\n\twhen we already hold any lock i, where 0 <= i <= n. In order\n\tto verify this, we have some debugging code, that can be\n\tenabled by defining FITZ_DEBUG_LOCKING.\n*/\n\nstruct fz_locks_context_s\n{\n\tvoid *user;\n\tvoid (*lock)(void *user, int lock);\n\tvoid (*unlock)(void *user, int lock);\n};\n\nenum {\n\tFZ_LOCK_ALLOC = 0,\n\tFZ_LOCK_FILE, /* Unused now */\n\tFZ_LOCK_FREETYPE,\n\tFZ_LOCK_GLYPHCACHE,\n\tFZ_LOCK_MAX\n};\n\n/*\n\tMemory Allocation and Scavenging:\n\n\tAll calls to MuPDFs allocator functions pass through to the\n\tunderlying allocators passed in when the initial context is\n\tcreated, after locks are taken (using the supplied locking function)\n\tto ensure that only one thread at a time calls through.\n\n\tIf the underlying allocator fails, MuPDF attempts to make room for\n\tthe allocation by evicting elements from the store, then retrying.\n\n\tAny call to allocate may then result in several calls to the underlying\n\tallocator, and result in elements that are only referred to by the\n\tstore being freed.\n*/\n\n/*\n\tfz_malloc: Allocate a block of memory (with scavenging)\n\n\tsize: The number of bytes to allocate.\n\n\tReturns a pointer to the allocated block. May return NULL if size is\n\t0. Throws exception on failure to allocate.\n*/\nvoid *fz_malloc(fz_context *ctx, unsigned int size);\n\n/*\n\tfz_calloc: Allocate a zeroed block of memory (with scavenging)\n\n\tcount: The number of objects to allocate space for.\n\n\tsize: The size (in bytes) of each object.\n\n\tReturns a pointer to the allocated block. May return NULL if size\n\tand/or count are 0. Throws exception on failure to allocate.\n*/\nvoid *fz_calloc(fz_context *ctx, unsigned int count, unsigned int size);\n\n/*\n\tfz_malloc_struct: Allocate storage for a structure (with scavenging),\n\tclear it, and (in Memento builds) tag the pointer as belonging to a\n\tstruct of this type.\n\n\tCTX: The context.\n\n\tSTRUCT: The structure type.\n\n\tReturns a pointer to allocated (and cleared) structure. Throws\n\texception on failure to allocate.\n*/\n#define fz_malloc_struct(CTX, STRUCT) \\\n\t((STRUCT *)Memento_label(fz_calloc(CTX,1,sizeof(STRUCT)), #STRUCT))\n\n/*\n\tfz_malloc_array: Allocate a block of (non zeroed) memory (with\n\tscavenging). Equivalent to fz_calloc without the memory clearing.\n\n\tcount: The number of objects to allocate space for.\n\n\tsize: The size (in bytes) of each object.\n\n\tReturns a pointer to the allocated block. May return NULL if size\n\tand/or count are 0. Throws exception on failure to allocate.\n*/\nvoid *fz_malloc_array(fz_context *ctx, unsigned int count, unsigned int size);\n\n/*\n\tfz_resize_array: Resize a block of memory (with scavenging).\n\n\tp: The existing block to resize\n\n\tcount: The number of objects to resize to.\n\n\tsize: The size (in bytes) of each object.\n\n\tReturns a pointer to the resized block. May return NULL if size\n\tand/or count are 0. Throws exception on failure to resize (original\n\tblock is left unchanged).\n*/\nvoid *fz_resize_array(fz_context *ctx, void *p, unsigned int count, unsigned int size);\n\n/*\n\tfz_strdup: Duplicate a C string (with scavenging)\n\n\ts: The string to duplicate.\n\n\tReturns a pointer to a duplicated string. Throws exception on failure\n\tto allocate.\n*/\nchar *fz_strdup(fz_context *ctx, const char *s);\n\n/*\n\tfz_free: Frees an allocation.\n\n\tDoes not throw exceptions.\n*/\nvoid fz_free(fz_context *ctx, void *p);\n\n/*\n\tfz_malloc_no_throw: Allocate a block of memory (with scavenging)\n\n\tsize: The number of bytes to allocate.\n\n\tReturns a pointer to the allocated block. May return NULL if size is\n\t0. Returns NULL on failure to allocate.\n*/\nvoid *fz_malloc_no_throw(fz_context *ctx, unsigned int size);\n\n/*\n\tfz_calloc_no_throw: Allocate a zeroed block of memory (with scavenging)\n\n\tcount: The number of objects to allocate space for.\n\n\tsize: The size (in bytes) of each object.\n\n\tReturns a pointer to the allocated block. May return NULL if size\n\tand/or count are 0. Returns NULL on failure to allocate.\n*/\nvoid *fz_calloc_no_throw(fz_context *ctx, unsigned int count, unsigned int size);\n\n/*\n\tfz_malloc_array_no_throw: Allocate a block of (non zeroed) memory\n\t(with scavenging). Equivalent to fz_calloc_no_throw without the\n\tmemory clearing.\n\n\tcount: The number of objects to allocate space for.\n\n\tsize: The size (in bytes) of each object.\n\n\tReturns a pointer to the allocated block. May return NULL if size\n\tand/or count are 0. Returns NULL on failure to allocate.\n*/\nvoid *fz_malloc_array_no_throw(fz_context *ctx, unsigned int count, unsigned int size);\n\n/*\n\tfz_resize_array_no_throw: Resize a block of memory (with scavenging).\n\n\tp: The existing block to resize\n\n\tcount: The number of objects to resize to.\n\n\tsize: The size (in bytes) of each object.\n\n\tReturns a pointer to the resized block. May return NULL if size\n\tand/or count are 0. Returns NULL on failure to resize (original\n\tblock is left unchanged).\n*/\nvoid *fz_resize_array_no_throw(fz_context *ctx, void *p, unsigned int count, unsigned int size);\n\n/*\n\tfz_strdup_no_throw: Duplicate a C string (with scavenging)\n\n\ts: The string to duplicate.\n\n\tReturns a pointer to a duplicated string. Returns NULL on failure\n\tto allocate.\n*/\nchar *fz_strdup_no_throw(fz_context *ctx, const char *s);\n\n/*\n\tfz_gen_id: Generate an id (guaranteed unique within this family of\n\tcontexts).\n*/\nint fz_gen_id(fz_context *ctx);\n\nstruct fz_warn_context_s\n{\n\tchar message[256];\n\tint count;\n};\n\nfz_context *fz_clone_context_internal(fz_context *ctx);\n\nvoid fz_new_aa_context(fz_context *ctx);\nvoid fz_free_aa_context(fz_context *ctx);\nvoid fz_copy_aa_context(fz_context *dst, fz_context *src);\n\nvoid fz_new_document_handler_context(fz_context *ctx);\nvoid fz_drop_document_handler_context(fz_context *ctx);\nfz_document_handler_context *fz_keep_document_handler_context(fz_context *ctx);\n\n/* Default allocator */\nextern fz_alloc_context fz_alloc_default;\n\n/* Default locks */\nextern fz_locks_context fz_locks_default;\n\n#if defined(MEMENTO) || defined(DEBUG)\n#define FITZ_DEBUG_LOCKING\n#endif\n\n#ifdef FITZ_DEBUG_LOCKING\n\nvoid fz_assert_lock_held(fz_context *ctx, int lock);\nvoid fz_assert_lock_not_held(fz_context *ctx, int lock);\nvoid fz_lock_debug_lock(fz_context *ctx, int lock);\nvoid fz_lock_debug_unlock(fz_context *ctx, int lock);\n\n#else\n\n#define fz_assert_lock_held(A,B) do { } while (0)\n#define fz_assert_lock_not_held(A,B) do { } while (0)\n#define fz_lock_debug_lock(A,B) do { } while (0)\n#define fz_lock_debug_unlock(A,B) do { } while (0)\n\n#endif /* !FITZ_DEBUG_LOCKING */\n\nstatic inline void\nfz_lock(fz_context *ctx, int lock)\n{\n\tfz_lock_debug_lock(ctx, lock);\n\tctx->locks->lock(ctx->locks->user, lock);\n}\n\nstatic inline void\nfz_unlock(fz_context *ctx, int lock)\n{\n\tfz_lock_debug_unlock(ctx, lock);\n\tctx->locks->unlock(ctx->locks->user, lock);\n}\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/crypt.h",
    "content": "#ifndef MUPDF_FITZ_CRYPT_H\n#define MUPDF_FITZ_CRYPT_H\n\n#include \"mupdf/fitz/system.h\"\n\n/*\n * Basic crypto functions.\n * Independent of the rest of fitz.\n * For further encapsulation in filters, or not.\n */\n\n/* md5 digests */\n\ntypedef struct fz_md5_s fz_md5;\n\nstruct fz_md5_s\n{\n\tunsigned int state[4];\n\tunsigned int count[2];\n\tunsigned char buffer[64];\n};\n\nvoid fz_md5_init(fz_md5 *state);\nvoid fz_md5_update(fz_md5 *state, const unsigned char *input, unsigned inlen);\nvoid fz_md5_final(fz_md5 *state, unsigned char digest[16]);\n\n/* sha-256 digests */\n\ntypedef struct fz_sha256_s fz_sha256;\n\nstruct fz_sha256_s\n{\n\tunsigned int state[8];\n\tunsigned int count[2];\n\tunion {\n\t\tunsigned char u8[64];\n\t\tunsigned int u32[16];\n\t} buffer;\n};\n\nvoid fz_sha256_init(fz_sha256 *state);\nvoid fz_sha256_update(fz_sha256 *state, const unsigned char *input, unsigned int inlen);\nvoid fz_sha256_final(fz_sha256 *state, unsigned char digest[32]);\n\n/* sha-512 digests */\n\ntypedef struct fz_sha512_s fz_sha512;\n\nstruct fz_sha512_s\n{\n\tuint64_t state[8];\n\tunsigned int count[2];\n\tunion {\n\t\tunsigned char u8[128];\n\t\tuint64_t u64[16];\n\t} buffer;\n};\n\nvoid fz_sha512_init(fz_sha512 *state);\nvoid fz_sha512_update(fz_sha512 *state, const unsigned char *input, unsigned int inlen);\nvoid fz_sha512_final(fz_sha512 *state, unsigned char digest[64]);\n\n/* sha-384 digests */\n\ntypedef struct fz_sha512_s fz_sha384;\n\nvoid fz_sha384_init(fz_sha384 *state);\nvoid fz_sha384_update(fz_sha384 *state, const unsigned char *input, unsigned int inlen);\nvoid fz_sha384_final(fz_sha384 *state, unsigned char digest[64]);\n\n/* arc4 crypto */\n\ntypedef struct fz_arc4_s fz_arc4;\n\nstruct fz_arc4_s\n{\n\tunsigned x;\n\tunsigned y;\n\tunsigned char state[256];\n};\n\nvoid fz_arc4_init(fz_arc4 *state, const unsigned char *key, unsigned len);\nvoid fz_arc4_encrypt(fz_arc4 *state, unsigned char *dest, const unsigned char *src, unsigned len);\n\n/* AES block cipher implementation from XYSSL */\n\ntypedef struct fz_aes_s fz_aes;\n\n#define AES_DECRYPT 0\n#define AES_ENCRYPT 1\n\nstruct fz_aes_s\n{\n\tint nr; /* number of rounds */\n\tunsigned long *rk; /* AES round keys */\n\tunsigned long buf[68]; /* unaligned data */\n};\n\nint aes_setkey_enc( fz_aes *ctx, const unsigned char *key, int keysize );\nint aes_setkey_dec( fz_aes *ctx, const unsigned char *key, int keysize );\nvoid aes_crypt_cbc( fz_aes *ctx, int mode, int length,\n\tunsigned char iv[16],\n\tconst unsigned char *input,\n\tunsigned char *output );\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/device.h",
    "content": "#ifndef MUPDF_FITZ_DEVICE_H\n#define MUPDF_FITZ_DEVICE_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/math.h\"\n#include \"mupdf/fitz/colorspace.h\"\n#include \"mupdf/fitz/image.h\"\n#include \"mupdf/fitz/shade.h\"\n#include \"mupdf/fitz/path.h\"\n#include \"mupdf/fitz/text.h\"\n\n/*\n\tThe different format handlers (pdf, xps etc) interpret pages to a\n\tdevice. These devices can then process the stream of calls they\n\trecieve in various ways:\n\t\tThe trace device outputs debugging information for the calls.\n\t\tThe draw device will render them.\n\t\tThe list device stores them in a list to play back later.\n\t\tThe text device performs text extraction and searching.\n\t\tThe bbox device calculates the bounding box for the page.\n\tOther devices can (and will) be written in future.\n*/\ntypedef struct fz_device_s fz_device;\n\nenum\n{\n\t/* Flags */\n\tFZ_DEVFLAG_MASK = 1,\n\tFZ_DEVFLAG_COLOR = 2,\n\tFZ_DEVFLAG_UNCACHEABLE = 4,\n\tFZ_DEVFLAG_FILLCOLOR_UNDEFINED = 8,\n\tFZ_DEVFLAG_STROKECOLOR_UNDEFINED = 16,\n\tFZ_DEVFLAG_STARTCAP_UNDEFINED = 32,\n\tFZ_DEVFLAG_DASHCAP_UNDEFINED = 64,\n\tFZ_DEVFLAG_ENDCAP_UNDEFINED = 128,\n\tFZ_DEVFLAG_LINEJOIN_UNDEFINED = 256,\n\tFZ_DEVFLAG_MITERLIMIT_UNDEFINED = 512,\n\tFZ_DEVFLAG_LINEWIDTH_UNDEFINED = 1024,\n\t/* Arguably we should have a bit for the dash pattern itself being\n\t * undefined, but that causes problems; do we assume that it should\n\t * always be set to non-dashing at the start of every glyph? */\n};\n\nenum\n{\n\t/* PDF 1.4 -- standard separable */\n\tFZ_BLEND_NORMAL,\n\tFZ_BLEND_MULTIPLY,\n\tFZ_BLEND_SCREEN,\n\tFZ_BLEND_OVERLAY,\n\tFZ_BLEND_DARKEN,\n\tFZ_BLEND_LIGHTEN,\n\tFZ_BLEND_COLOR_DODGE,\n\tFZ_BLEND_COLOR_BURN,\n\tFZ_BLEND_HARD_LIGHT,\n\tFZ_BLEND_SOFT_LIGHT,\n\tFZ_BLEND_DIFFERENCE,\n\tFZ_BLEND_EXCLUSION,\n\n\t/* PDF 1.4 -- standard non-separable */\n\tFZ_BLEND_HUE,\n\tFZ_BLEND_SATURATION,\n\tFZ_BLEND_COLOR,\n\tFZ_BLEND_LUMINOSITY,\n\n\t/* For packing purposes */\n\tFZ_BLEND_MODEMASK = 15,\n\tFZ_BLEND_ISOLATED = 16,\n\tFZ_BLEND_KNOCKOUT = 32\n};\n\nint fz_lookup_blendmode(char *name);\nchar *fz_blendmode_name(int blendmode);\n\ntypedef struct fz_device_container_stack_s fz_device_container_stack;\n\nstruct fz_device_container_stack_s\n{\n\tfz_rect scissor;\n\tint flags;\n\tint user;\n};\n\nenum\n{\n\tfz_device_container_stack_is_clip_path = 1,\n\tfz_device_container_stack_is_clip_stroke_path = 2,\n\tfz_device_container_stack_is_clip_text = 4,\n\tfz_device_container_stack_is_clip_stroke_text = 8,\n\tfz_device_container_stack_is_clip_image_mask = 16,\n\tfz_device_container_stack_in_mask = 32,\n\tfz_device_container_stack_is_mask = 64,\n\tfz_device_container_stack_is_group = 128,\n};\n\nstruct fz_device_s\n{\n\tint hints;\n\tint flags;\n\n\tvoid *user;\n\tvoid (*free_user)(fz_device *);\n\tfz_context *ctx;\n\n\tvoid (*rebind)(fz_device *);\n\n\tvoid (*begin_page)(fz_device *, const fz_rect *rect, const fz_matrix *ctm);\n\tvoid (*end_page)(fz_device *);\n\n\tvoid (*fill_path)(fz_device *, fz_path *, int even_odd, const fz_matrix *, fz_colorspace *, float *color, float alpha);\n\tvoid (*stroke_path)(fz_device *, fz_path *, fz_stroke_state *, const fz_matrix *, fz_colorspace *, float *color, float alpha);\n\tvoid (*clip_path)(fz_device *, fz_path *, const fz_rect *rect, int even_odd, const fz_matrix *);\n\tvoid (*clip_stroke_path)(fz_device *, fz_path *, const fz_rect *rect, fz_stroke_state *, const fz_matrix *);\n\n\tvoid (*fill_text)(fz_device *, fz_text *, const fz_matrix *, fz_colorspace *, float *color, float alpha);\n\tvoid (*stroke_text)(fz_device *, fz_text *, fz_stroke_state *, const fz_matrix *, fz_colorspace *, float *color, float alpha);\n\tvoid (*clip_text)(fz_device *, fz_text *, const fz_matrix *, int accumulate);\n\tvoid (*clip_stroke_text)(fz_device *, fz_text *, fz_stroke_state *, const fz_matrix *);\n\tvoid (*ignore_text)(fz_device *, fz_text *, const fz_matrix *);\n\n\tvoid (*fill_shade)(fz_device *, fz_shade *shd, const fz_matrix *ctm, float alpha);\n\tvoid (*fill_image)(fz_device *, fz_image *img, const fz_matrix *ctm, float alpha);\n\tvoid (*fill_image_mask)(fz_device *, fz_image *img, const fz_matrix *ctm, fz_colorspace *, float *color, float alpha);\n\tvoid (*clip_image_mask)(fz_device *, fz_image *img, const fz_rect *rect, const fz_matrix *ctm);\n\n\tvoid (*pop_clip)(fz_device *);\n\n\tvoid (*begin_mask)(fz_device *, const fz_rect *, int luminosity, fz_colorspace *, float *bc);\n\tvoid (*end_mask)(fz_device *);\n\tvoid (*begin_group)(fz_device *, const fz_rect *, int isolated, int knockout, int blendmode, float alpha);\n\tvoid (*end_group)(fz_device *);\n\n\tint (*begin_tile)(fz_device *, const fz_rect *area, const fz_rect *view, float xstep, float ystep, const fz_matrix *ctm, int id);\n\tvoid (*end_tile)(fz_device *);\n\n\t/* SumatraPDF: support transfer functions */\n\tvoid (*apply_transfer_function)(fz_device *, fz_transfer_function *tr, int for_mask);\n\n\tint error_depth;\n\tchar errmess[256];\n\n\tint container_len;\n\tint container_cap;\n\tfz_device_container_stack *container;\n\tfz_rect scissor_accumulator;\n};\n\nvoid fz_rebind_device(fz_device *dev, fz_context *ctx);\nvoid fz_begin_page(fz_device *dev, const fz_rect *rect, const fz_matrix *ctm);\nvoid fz_end_page(fz_device *dev);\nvoid fz_fill_path(fz_device *dev, fz_path *path, int even_odd, const fz_matrix *ctm, fz_colorspace *colorspace, float *color, float alpha);\nvoid fz_stroke_path(fz_device *dev, fz_path *path, fz_stroke_state *stroke, const fz_matrix *ctm, fz_colorspace *colorspace, float *color, float alpha);\nvoid fz_clip_path(fz_device *dev, fz_path *path, const fz_rect *rect, int even_odd, const fz_matrix *ctm);\nvoid fz_clip_stroke_path(fz_device *dev, fz_path *path, const fz_rect *rect, fz_stroke_state *stroke, const fz_matrix *ctm);\nvoid fz_fill_text(fz_device *dev, fz_text *text, const fz_matrix *ctm, fz_colorspace *colorspace, float *color, float alpha);\nvoid fz_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, const fz_matrix *ctm, fz_colorspace *colorspace, float *color, float alpha);\nvoid fz_clip_text(fz_device *dev, fz_text *text, const fz_matrix *ctm, int accumulate);\nvoid fz_clip_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, const fz_matrix *ctm);\nvoid fz_ignore_text(fz_device *dev, fz_text *text, const fz_matrix *ctm);\nvoid fz_pop_clip(fz_device *dev);\nvoid fz_fill_shade(fz_device *dev, fz_shade *shade, const fz_matrix *ctm, float alpha);\nvoid fz_fill_image(fz_device *dev, fz_image *image, const fz_matrix *ctm, float alpha);\nvoid fz_fill_image_mask(fz_device *dev, fz_image *image, const fz_matrix *ctm, fz_colorspace *colorspace, float *color, float alpha);\nvoid fz_clip_image_mask(fz_device *dev, fz_image *image, const fz_rect *rect, const fz_matrix *ctm);\nvoid fz_begin_mask(fz_device *dev, const fz_rect *area, int luminosity, fz_colorspace *colorspace, float *bc);\nvoid fz_end_mask(fz_device *dev);\nvoid fz_begin_group(fz_device *dev, const fz_rect *area, int isolated, int knockout, int blendmode, float alpha);\nvoid fz_end_group(fz_device *dev);\nvoid fz_begin_tile(fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, const fz_matrix *ctm);\nint fz_begin_tile_id(fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, const fz_matrix *ctm, int id);\nvoid fz_end_tile(fz_device *dev);\n/* SumatraPDF: support transfer functions */\nvoid fz_apply_transfer_function(fz_device *dev, fz_transfer_function *tr, int for_mask);\n\nfz_device *fz_new_device(fz_context *ctx, void *user);\n\n/*\n\tfz_free_device: Free a devices of any type and its resources.\n*/\nvoid fz_free_device(fz_device *dev);\n\n/*\n\tfz_enable_device_hints : Enable hints in a device.\n\n\thints: mask of hints to enable.\n\n\tFor example: By default the draw device renders shadings. For some\n\tpurposes (perhaps rendering fast low quality thumbnails) you may want\n\tto tell it to ignore shadings. For this you would enable the\n\tFZ_IGNORE_SHADE hint.\n*/\nvoid fz_enable_device_hints(fz_device *dev, int hints);\n\n/*\n\tfz_disable_device_hints : Disable hints in a device.\n\n\thints: mask of hints to disable.\n\n\tFor example: By default the text extraction device ignores images.\n\tFor some purposes however (such as extracting HTML) you may want to\n\tenable the capturing of image data too. For this you would disable\n\tthe FZ_IGNORE_IMAGE hint.\n*/\nvoid fz_disable_device_hints(fz_device *dev, int hints);\n\nenum\n{\n\t/* Hints */\n\tFZ_IGNORE_IMAGE = 1,\n\tFZ_IGNORE_SHADE = 2,\n\tFZ_DONT_INTERPOLATE_IMAGES = 4,\n\tFZ_MAINTAIN_CONTAINER_STACK = 8,\n\tFZ_NO_CACHE = 16,\n};\n\n/*\n\tCookie support - simple communication channel between app/library.\n*/\n\ntypedef struct fz_cookie_s fz_cookie;\n\n/*\n\tProvide two-way communication between application and library.\n\tIntended for multi-threaded applications where one thread is\n\trendering pages and another thread wants read progress\n\tfeedback or abort a job that takes a long time to finish. The\n\tcommunication is unsynchronized without locking.\n\n\tabort: The appliation should set this field to 0 before\n\tcalling fz_run_page to render a page. At any point when the\n\tpage is being rendered the application my set this field to 1\n\twhich will cause the rendering to finish soon. This field is\n\tchecked periodically when the page is rendered, but exactly\n\twhen is not known, therefore there is no upper bound on\n\texactly when the the rendering will abort. If the application\n\tdid not provide a set of locks to fz_new_context, it must also\n\tawait the completion of fz_run_page before issuing another\n\tcall to fz_run_page. Note that once the application has set\n\tthis field to 1 after it called fz_run_page it may not change\n\tthe value again.\n\n\tprogress: Communicates rendering progress back to the\n\tapplication and is read only. Increments as a page is being\n\trendered. The value starts out at 0 and is limited to less\n\tthan or equal to progress_max, unless progress_max is -1.\n\n\tprogress_max: Communicates the known upper bound of rendering\n\tback to the application and is read only. The maximum value\n\tthat the progress field may take. If there is no known upper\n\tbound on how long the rendering may take this value is -1 and\n\tprogress is not limited. Note that the value of progress_max\n\tmay change from -1 to a positive value once an upper bound is\n\tknown, so take this into consideration when comparing the\n\tvalue of progress to that of progress_max.\n\n\terrors: count of errors during current rendering.\n\n\tincomplete_ok: If this is set to 1 by the caller, then TRYLATER\n\terrors are swallowed as they occur, setting the 'incomplete' flag.\n\tRendering continues as much as possible ignoring errors. The caller\n\tis expected to check the 'incomplete' flag at the end to see if the\n\trendering may be considered final or not.\n\n\tincomplete: Initially should be set to 0. Will be set to non-zero\n\tif a TRYLATER error is thrown during rendering and the incomplete_ok\n\tflag is set.\n*/\nstruct fz_cookie_s\n{\n\tint abort;\n\tint progress;\n\tint progress_max; /* -1 for unknown */\n\tint errors;\n\tint incomplete_ok;\n\tint incomplete;\n};\n\n/*\n\tfz_new_trace_device: Create a device to print a debug trace of\n\tall device calls.\n*/\nfz_device *fz_new_trace_device(fz_context *ctx);\n\n/*\n\tfz_new_bbox_device: Create a device to compute the bounding\n\tbox of all marks on a page.\n\n\tThe returned bounding box will be the union of all bounding\n\tboxes of all objects on a page.\n*/\nfz_device *fz_new_bbox_device(fz_context *ctx, fz_rect *rectp);\n\n/*\n\tfz_new_test_device: Create a device to test for features.\n\n\tCurrently only tests for the presence of non-grayscale colors.\n\n\tthreshold: The difference from grayscale that will be tolerated.\n\tTypical values to use are either 0 (be exact) and 0.02 (allow an\n\timperceptible amount of slop).\n*/\nfz_device *fz_new_test_device(fz_context *ctx, int *is_color, float threshold);\n\n/*\n\tfz_new_draw_device: Create a device to draw on a pixmap.\n\n\tdest: Target pixmap for the draw device. See fz_new_pixmap*\n\tfor how to obtain a pixmap. The pixmap is not cleared by the\n\tdraw device, see fz_clear_pixmap* for how to clear it prior to\n\tcalling fz_new_draw_device. Free the device by calling\n\tfz_free_device.\n*/\nfz_device *fz_new_draw_device(fz_context *ctx, fz_pixmap *dest);\n\n/*\n\tfz_new_draw_device_with_bbox: Create a device to draw on a pixmap.\n\n\tdest: Target pixmap for the draw device. See fz_new_pixmap*\n\tfor how to obtain a pixmap. The pixmap is not cleared by the\n\tdraw device, see fz_clear_pixmap* for how to clear it prior to\n\tcalling fz_new_draw_device. Free the device by calling\n\tfz_free_device.\n\n\tclip: Bounding box to restrict any marking operations of the\n\tdraw device.\n*/\nfz_device *fz_new_draw_device_with_bbox(fz_context *ctx, fz_pixmap *dest, const fz_irect *clip);\n\nfz_device *fz_new_draw_device_type3(fz_context *ctx, fz_pixmap *dest);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/display-list.h",
    "content": "#ifndef MUPDF_FITZ_DISPLAY_LIST_H\n#define MUPDF_FITZ_DISPLAY_LIST_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/math.h\"\n#include \"mupdf/fitz/device.h\"\n\n/*\n\tDisplay list device -- record and play back device commands.\n*/\n\n/*\n\tfz_display_list is a list containing drawing commands (text,\n\timages, etc.). The intent is two-fold: as a caching-mechanism\n\tto reduce parsing of a page, and to be used as a data\n\tstructure in multi-threading where one thread parses the page\n\tand another renders pages.\n\n\tCreate a displaylist with fz_new_display_list, hand it over to\n\tfz_new_list_device to have it populated, and later replay the\n\tlist (once or many times) by calling fz_run_display_list. When\n\tthe list is no longer needed drop it with fz_drop_display_list.\n*/\ntypedef struct fz_display_list_s fz_display_list;\n\n/*\n\tfz_new_display_list: Create an empty display list.\n\n\tA display list contains drawing commands (text, images, etc.).\n\tUse fz_new_list_device for populating the list.\n*/\nfz_display_list *fz_new_display_list(fz_context *ctx);\n\n/*\n\tfz_new_list_device: Create a rendering device for a display list.\n\n\tWhen the device is rendering a page it will populate the\n\tdisplay list with drawing commsnds (text, images, etc.). The\n\tdisplay list can later be reused to render a page many times\n\twithout having to re-interpret the page from the document file\n\tfor each rendering. Once the device is no longer needed, free\n\tit with fz_free_device.\n\n\tlist: A display list that the list device takes ownership of.\n*/\nfz_device *fz_new_list_device(fz_context *ctx, fz_display_list *list);\n\n/*\n\tfz_run_display_list: (Re)-run a display list through a device.\n\n\tlist: A display list, created by fz_new_display_list and\n\tpopulated with objects from a page by running fz_run_page on a\n\tdevice obtained from fz_new_list_device.\n\n\tdev: Device obtained from fz_new_*_device.\n\n\tctm: Transform to apply to display list contents. May include\n\tfor example scaling and rotation, see fz_scale, fz_rotate and\n\tfz_concat. Set to fz_identity if no transformation is desired.\n\n\tarea: Only the part of the contents of the display list\n\tvisible within this area will be considered when the list is\n\trun through the device. This does not imply for tile objects\n\tcontained in the display list.\n\n\tcookie: Communication mechanism between caller and library\n\trunning the page. Intended for multi-threaded applications,\n\twhile single-threaded applications set cookie to NULL. The\n\tcaller may abort an ongoing page run. Cookie also communicates\n\tprogress information back to the caller. The fields inside\n\tcookie are continually updated while the page is being run.\n*/\nvoid fz_run_display_list(fz_display_list *list, fz_device *dev, const fz_matrix *ctm, const fz_rect *area, fz_cookie *cookie);\n\n/*\n\tfz_keep_display_list: Keep a reference to a display list.\n\n\tDoes not throw exceptions.\n*/\nfz_display_list *fz_keep_display_list(fz_context *ctx, fz_display_list *list);\n\n/*\n\tfz_drop_display_list: Drop a reference to a display list, freeing it\n\tif the reference count reaches zero.\n\n\tDoes not throw exceptions.\n*/\nvoid fz_drop_display_list(fz_context *ctx, fz_display_list *list);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/document.h",
    "content": "#ifndef MUPDF_FITZ_DOCUMENT_H\n#define MUPDF_FITZ_DOCUMENT_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/math.h\"\n#include \"mupdf/fitz/device.h\"\n#include \"mupdf/fitz/transition.h\"\n#include \"mupdf/fitz/link.h\"\n#include \"mupdf/fitz/outline.h\"\n\n/*\n\tDocument interface\n*/\ntypedef struct fz_document_s fz_document;\ntypedef struct fz_document_handler_s fz_document_handler;\ntypedef struct fz_page_s fz_page;\ntypedef struct fz_annot_s fz_annot;\n\n// TODO: move out of this interface (it's pdf specific)\ntypedef struct fz_write_options_s fz_write_options;\n\ntypedef void (fz_document_close_fn)(fz_document *doc);\ntypedef int (fz_document_needs_password_fn)(fz_document *doc);\ntypedef int (fz_document_authenticate_password_fn)(fz_document *doc, const char *password);\ntypedef fz_outline *(fz_document_load_outline_fn)(fz_document *doc);\ntypedef void (fz_document_layout_fn)(fz_document *doc, float w, float h, float em);\ntypedef int (fz_document_count_pages_fn)(fz_document *doc);\ntypedef fz_page *(fz_document_load_page_fn)(fz_document *doc, int number);\ntypedef fz_link *(fz_document_load_links_fn)(fz_document *doc, fz_page *page);\ntypedef fz_rect *(fz_document_bound_page_fn)(fz_document *doc, fz_page *page, fz_rect *);\ntypedef void (fz_document_run_page_contents_fn)(fz_document *doc, fz_page *page, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie);\ntypedef void (fz_document_run_annot_fn)(fz_document *doc, fz_page *page, fz_annot *annot, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie);\ntypedef void (fz_document_free_page_fn)(fz_document *doc, fz_page *page);\ntypedef int (fz_document_meta_fn)(fz_document *doc, int key, void *ptr, int size);\ntypedef fz_transition *(fz_document_page_presentation_fn)(fz_document *doc, fz_page *page, float *duration);\ntypedef fz_annot *(fz_document_first_annot_fn)(fz_document *doc, fz_page *page);\ntypedef fz_annot *(fz_document_next_annot_fn)(fz_document *doc, fz_annot *annot);\ntypedef fz_rect *(fz_document_bound_annot_fn)(fz_document *doc, fz_annot *annot, fz_rect *rect);\ntypedef void (fz_document_write_fn)(fz_document *doc, char *filename, fz_write_options *opts);\ntypedef void (fz_document_rebind_fn)(fz_document *doc, fz_context *ctx);\n\nstruct fz_document_s\n{\n\tfz_document_close_fn *close;\n\tfz_document_needs_password_fn *needs_password;\n\tfz_document_authenticate_password_fn *authenticate_password;\n\tfz_document_load_outline_fn *load_outline;\n\tfz_document_layout_fn *layout;\n\tfz_document_count_pages_fn *count_pages;\n\tfz_document_load_page_fn *load_page;\n\tfz_document_load_links_fn *load_links;\n\tfz_document_bound_page_fn *bound_page;\n\tfz_document_run_page_contents_fn *run_page_contents;\n\tfz_document_run_annot_fn *run_annot;\n\tfz_document_free_page_fn *free_page;\n\tfz_document_meta_fn *meta;\n\tfz_document_page_presentation_fn *page_presentation;\n\tfz_document_first_annot_fn *first_annot;\n\tfz_document_next_annot_fn *next_annot;\n\tfz_document_bound_annot_fn *bound_annot;\n\tfz_document_write_fn *write;\n\tfz_document_rebind_fn *rebind;\n};\n\ntypedef fz_document *(fz_document_open_fn)(fz_context *ctx, const char *filename);\ntypedef fz_document *(fz_document_open_with_stream_fn)(fz_context *ctx, fz_stream *stream);\ntypedef int (fz_document_recognize_fn)(fz_context *ctx, const char *magic);\n\nstruct fz_document_handler_s\n{\n\tfz_document_recognize_fn *recognize;\n\tfz_document_open_fn *open;\n\tfz_document_open_with_stream_fn *open_with_stream;\n};\n\nextern fz_document_handler pdf_document_handler;\nextern fz_document_handler pdf_no_run_document_handler;\nextern fz_document_handler xps_document_handler;\nextern fz_document_handler cbz_document_handler;\nextern fz_document_handler img_document_handler;\nextern fz_document_handler tiff_document_handler;\n\nvoid fz_register_document_handler(fz_context *ctx, const fz_document_handler *handler);\n\nvoid fz_register_document_handlers(fz_context *ctx);\nvoid fz_register_no_run_document_handlers(fz_context *ctx);\n\n/*\n\tfz_open_document: Open a PDF, XPS or CBZ document.\n\n\tOpen a document file and read its basic structure so pages and\n\tobjects can be located. MuPDF will try to repair broken\n\tdocuments (without actually changing the file contents).\n\n\tThe returned fz_document is used when calling most other\n\tdocument related functions. Note that it wraps the context, so\n\tthose functions implicitly can access the global state in\n\tcontext.\n\n\tfilename: a path to a file as it would be given to open(2).\n*/\nfz_document *fz_open_document(fz_context *ctx, const char *filename);\n\n/*\n\tfz_open_document_with_stream: Open a PDF, XPS or CBZ document.\n\n\tOpen a document using the specified stream object rather than\n\topening a file on disk.\n\n\tmagic: a string used to detect document type; either a file name or mime-type.\n*/\nfz_document *fz_open_document_with_stream(fz_context *ctx, const char *magic, fz_stream *stream);\n\n/*\n\tfz_close_document: Close and free an open document.\n\n\tThe resource store in the context associated with fz_document\n\tis emptied, and any allocations for the document are freed.\n\n\tDoes not throw exceptions.\n*/\nvoid fz_close_document(fz_document *doc);\n\n/*\n\tfz_needs_password: Check if a document is encrypted with a\n\tnon-blank password.\n\n\tDoes not throw exceptions.\n*/\nint fz_needs_password(fz_document *doc);\n\n/*\n\tfz_authenticate_password: Test if the given password can\n\tdecrypt the document.\n\n\tpassword: The password string to be checked. Some document\n\tspecifications do not specify any particular text encoding, so\n\tneither do we.\n\n\tDoes not throw exceptions.\n*/\nint fz_authenticate_password(fz_document *doc, const char *password);\n\n/*\n\tfz_load_outline: Load the hierarchical document outline.\n\n\tShould be freed by fz_free_outline.\n*/\nfz_outline *fz_load_outline(fz_document *doc);\n\n/*\n\tfz_layout_document: Layout reflowable document types.\n\n\tw, h: Page size in points.\n\tem: Default font size in points.\n*/\nvoid fz_layout_document(fz_document *doc, float w, float h, float em);\n\n/*\n\tfz_count_pages: Return the number of pages in document\n\n\tMay return 0 for documents with no pages.\n*/\nint fz_count_pages(fz_document *doc);\n\n/*\n\tfz_load_page: Load a page.\n\n\tAfter fz_load_page is it possible to retrieve the size of the\n\tpage using fz_bound_page, or to render the page using\n\tfz_run_page_*. Free the page by calling fz_free_page.\n\n\tnumber: page number, 0 is the first page of the document.\n*/\n/* SumatraPDF: caution: fz_load_page uses cached page objects for XPS documents! */\nfz_page *fz_load_page(fz_document *doc, int number);\n\n/*\n\tfz_load_links: Load the list of links for a page.\n\n\tReturns a linked list of all the links on the page, each with\n\tits clickable region and link destination. Each link is\n\treference counted so drop and free the list of links by\n\tcalling fz_drop_link on the pointer return from fz_load_links.\n\n\tpage: Page obtained from fz_load_page.\n*/\nfz_link *fz_load_links(fz_document *doc, fz_page *page);\n\n/*\n\tfz_bound_page: Determine the size of a page at 72 dpi.\n\n\tDoes not throw exceptions.\n*/\nfz_rect *fz_bound_page(fz_document *doc, fz_page *page, fz_rect *rect);\n\n/*\n\tfz_run_page: Run a page through a device.\n\n\tpage: Page obtained from fz_load_page.\n\n\tdev: Device obtained from fz_new_*_device.\n\n\ttransform: Transform to apply to page. May include for example\n\tscaling and rotation, see fz_scale, fz_rotate and fz_concat.\n\tSet to fz_identity if no transformation is desired.\n\n\tcookie: Communication mechanism between caller and library\n\trendering the page. Intended for multi-threaded applications,\n\twhile single-threaded applications set cookie to NULL. The\n\tcaller may abort an ongoing rendering of a page. Cookie also\n\tcommunicates progress information back to the caller. The\n\tfields inside cookie are continually updated while the page is\n\trendering.\n*/\nvoid fz_run_page(fz_document *doc, fz_page *page, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie);\n\n/*\n\tfz_run_page_contents: Run a page through a device. Just the main\n\tpage content, without the annotations, if any.\n\n\tpage: Page obtained from fz_load_page.\n\n\tdev: Device obtained from fz_new_*_device.\n\n\ttransform: Transform to apply to page. May include for example\n\tscaling and rotation, see fz_scale, fz_rotate and fz_concat.\n\tSet to fz_identity if no transformation is desired.\n\n\tcookie: Communication mechanism between caller and library\n\trendering the page. Intended for multi-threaded applications,\n\twhile single-threaded applications set cookie to NULL. The\n\tcaller may abort an ongoing rendering of a page. Cookie also\n\tcommunicates progress information back to the caller. The\n\tfields inside cookie are continually updated while the page is\n\trendering.\n*/\nvoid fz_run_page_contents(fz_document *doc, fz_page *page, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie);\n\n/*\n\tfz_run_annot: Run an annotation through a device.\n\n\tpage: Page obtained from fz_load_page.\n\n\tannot: an annotation.\n\n\tdev: Device obtained from fz_new_*_device.\n\n\ttransform: Transform to apply to page. May include for example\n\tscaling and rotation, see fz_scale, fz_rotate and fz_concat.\n\tSet to fz_identity if no transformation is desired.\n\n\tcookie: Communication mechanism between caller and library\n\trendering the page. Intended for multi-threaded applications,\n\twhile single-threaded applications set cookie to NULL. The\n\tcaller may abort an ongoing rendering of a page. Cookie also\n\tcommunicates progress information back to the caller. The\n\tfields inside cookie are continually updated while the page is\n\trendering.\n*/\nvoid fz_run_annot(fz_document *doc, fz_page *page, fz_annot *annot, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie);\n\n/*\n\tfz_free_page: Free a loaded page.\n\n\tDoes not throw exceptions.\n*/\nvoid fz_free_page(fz_document *doc, fz_page *page);\n\n/*\n\tfz_page_presentation: Get the presentation details for a given page.\n\n\tduration: NULL, or a pointer to a place to set the page duration in\n\tseconds. (Will be set to 0 if unspecified).\n\n\tReturns: a pointer to a transition structure, or NULL if there isn't\n\tone.\n\n\tDoes not throw exceptions.\n*/\nfz_transition *fz_page_presentation(fz_document *doc, fz_page *page, float *duration);\n\nvoid fz_rebind_document(fz_document *doc, fz_context *ctx);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/filter.h",
    "content": "#ifndef MUPDF_FITZ_FILTER_H\n#define MUPDF_FITZ_FILTER_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/buffer.h\"\n#include \"mupdf/fitz/store.h\"\n#include \"mupdf/fitz/stream.h\"\n\ntypedef struct fz_jbig2_globals_s fz_jbig2_globals;\n\nfz_stream *fz_open_copy(fz_stream *chain);\nfz_stream *fz_open_null(fz_stream *chain, int len, int offset);\nfz_stream *fz_open_concat(fz_context *ctx, int max, int pad);\nvoid fz_concat_push(fz_stream *concat, fz_stream *chain); /* Ownership of chain is passed in */\nfz_stream *fz_open_arc4(fz_stream *chain, unsigned char *key, unsigned keylen);\nfz_stream *fz_open_aesd(fz_stream *chain, unsigned char *key, unsigned keylen);\nfz_stream *fz_open_a85d(fz_stream *chain);\nfz_stream *fz_open_ahxd(fz_stream *chain);\nfz_stream *fz_open_rld(fz_stream *chain);\nfz_stream *fz_open_dctd(fz_stream *chain, int color_transform, int l2factor, fz_stream *jpegtables);\nfz_stream *fz_open_faxd(fz_stream *chain,\n\tint k, int end_of_line, int encoded_byte_align,\n\tint columns, int rows, int end_of_block, int black_is_1);\nfz_stream *fz_open_flated(fz_stream *chain, int window_bits);\nfz_stream *fz_open_lzwd(fz_stream *chain, int early_change);\nfz_stream *fz_open_predict(fz_stream *chain, int predictor, int columns, int colors, int bpc);\nfz_stream *fz_open_jbig2d(fz_stream *chain, fz_jbig2_globals *globals);\n\nfz_jbig2_globals *fz_load_jbig2_globals(fz_context *ctx, unsigned char *data, int size);\nvoid fz_free_jbig2_globals_imp(fz_context *ctx, fz_storable *globals);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/font.h",
    "content": "#ifndef MUPDF_FITZ_FONT_H\n#define MUPDF_FITZ_FONT_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/math.h\"\n#include \"mupdf/fitz/buffer.h\"\n\n/*\n\tAn abstract font handle. Currently there are no public API functions\n\tfor handling these.\n*/\ntypedef struct fz_font_s fz_font;\n\n/*\n * Fonts come in two variants:\n *\tRegular fonts are handled by FreeType.\n *\tType 3 fonts have callbacks to the interpreter.\n */\n\nchar *ft_error_string(int err);\n\n/* forward declaration for circular dependency */\nstruct fz_device_s;\nstruct fz_display_list_s;\n\nstruct fz_font_s\n{\n\tint refs;\n\tchar name[32];\n\n\tvoid *ft_face; /* has an FT_Face if used */\n\tint ft_substitute; /* ... substitute metrics */\n\tint ft_bold; /* ... synthesize bold */\n\tint ft_italic; /* ... synthesize italic */\n\tint ft_hint; /* ... force hinting for DynaLab fonts */\n\n\t/* origin of font data */\n\tfz_buffer *ft_buffer;\n\tchar *ft_filepath; /* kept for downstream consumers (such as SumatraPDF) */\n\n\tfz_matrix t3matrix;\n\tvoid *t3resources;\n\tfz_buffer **t3procs; /* has 256 entries if used */\n\tstruct fz_display_list_s **t3lists; /* has 256 entries if used */\n\tfloat *t3widths; /* has 256 entries if used */\n\tchar *t3flags; /* has 256 entries if used */\n\tvoid *t3doc; /* a pdf_document for the callback */\n\tvoid (*t3run)(void *doc, void *resources, fz_buffer *contents, struct fz_device_s *dev, const fz_matrix *ctm, void *gstate, int nestedDepth);\n\tvoid (*t3freeres)(void *doc, void *resources);\n\n\tfz_rect bbox;\t/* font bbox is used only for t3 fonts */\n\n\t/* per glyph bounding box cache */\n\tint use_glyph_bbox;\n\tint bbox_count;\n\tfz_rect *bbox_table;\n\n\t/* substitute metrics */\n\tint width_count;\n\tint *width_table; /* in 1000 units */\n};\n\n/* common CJK font collections */\nenum { FZ_ADOBE_CNS_1, FZ_ADOBE_GB_1, FZ_ADOBE_JAPAN_1, FZ_ADOBE_KOREA_1 };\n\nvoid fz_new_font_context(fz_context *ctx);\nfz_font_context *fz_keep_font_context(fz_context *ctx);\nvoid fz_drop_font_context(fz_context *ctx);\n\ntypedef fz_font *(*fz_load_system_font_func)(fz_context *ctx, const char *name, int bold, int italic, int needs_exact_metrics);\ntypedef fz_font *(*fz_load_system_cjk_font_func)(fz_context *ctx, const char *name, int ros, int serif);\nvoid fz_install_load_system_font_funcs(fz_context *ctx, fz_load_system_font_func f, fz_load_system_cjk_font_func f_cjk);\n/* fz_load_*_font returns NULL if no font could be loaded (also on error) */\nfz_font *fz_load_system_font(fz_context *ctx, const char *name, int bold, int italic, int needs_exact_metrics);\nfz_font *fz_load_system_cjk_font(fz_context *ctx, const char *name, int ros, int serif);\n\nfz_font *fz_new_type3_font(fz_context *ctx, const char *name, const fz_matrix *matrix);\n\nfz_font *fz_new_font_from_memory(fz_context *ctx, const char *name, unsigned char *data, int len, int index, int use_glyph_bbox);\nfz_font *fz_new_font_from_buffer(fz_context *ctx, const char *name, fz_buffer *buffer, int index, int use_glyph_bbox);\nfz_font *fz_new_font_from_file(fz_context *ctx, const char *name, const char *path, int index, int use_glyph_bbox);\n\nfz_font *fz_keep_font(fz_context *ctx, fz_font *font);\nvoid fz_drop_font(fz_context *ctx, fz_font *font);\n\nvoid fz_set_font_bbox(fz_context *ctx, fz_font *font, float xmin, float ymin, float xmax, float ymax);\nfz_rect *fz_bound_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, fz_rect *r);\nint fz_glyph_cacheable(fz_context *ctx, fz_font *font, int gid);\n\nvoid fz_run_t3_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, struct fz_device_s *dev);\n\nvoid fz_decouple_type3_font(fz_context *ctx, fz_font *font, void *t3doc);\n\nfloat fz_advance_glyph(fz_context *ctx, fz_font *font, int glyph);\nint fz_encode_character(fz_context *ctx, fz_font *font, int unicode);\n\n#ifndef NDEBUG\nvoid fz_print_font(fz_context *ctx, FILE *out, fz_font *font);\n#endif\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/function.h",
    "content": "#ifndef MUPDF_FITZ_FUNCTION_H\n#define MUPDF_FITZ_FUNCTION_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/store.h\"\n#include \"mupdf/fitz/colorspace.h\"\n\n/*\n * The generic function support.\n */\n\ntypedef struct fz_function_s fz_function;\n\nvoid fz_eval_function(fz_context *ctx, fz_function *func, const float *in, int inlen, float *out, int outlen);\nfz_function *fz_keep_function(fz_context *ctx, fz_function *func);\nvoid fz_drop_function(fz_context *ctx, fz_function *func);\nunsigned int fz_function_size(fz_function *func);\n#ifndef NDEBUG\nvoid pdf_debug_function(fz_function *func);\n#endif\n\nenum\n{\n\tFZ_FN_MAXN = FZ_MAX_COLORS,\n\tFZ_FN_MAXM = FZ_MAX_COLORS\n};\n\nstruct fz_function_s\n{\n\tfz_storable storable;\n\tunsigned int size;\n\tint m;\t\t\t\t\t/* number of input values */\n\tint n;\t\t\t\t\t/* number of output values */\n\tvoid (*evaluate)(fz_context *ctx, fz_function *func, const float *in, float *out);\n#ifndef NDEBUG\n\tvoid (*debug)(fz_function *func);\n#endif\n};\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/getopt.h",
    "content": "#ifndef MUPDF_FITZ_GETOPT_H\n#define MUPDF_FITZ_GETOPT_H\n\n/*\n\tgetopt: Simple functions/variables for use in tools.\n*/\nextern int fz_getopt(int nargc, char * const *nargv, const char *ostr);\nextern int fz_optind;\nextern char *fz_optarg;\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/glyph-cache.h",
    "content": "#ifndef MUPDF_FITZ_GLYPH_CACHE_H\n#define MUPDF_FITZ_GLYPH_CACHE_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/math.h\"\n#include \"mupdf/fitz/font.h\"\n#include \"mupdf/fitz/path.h\"\n#include \"mupdf/fitz/pixmap.h\"\n#include \"mupdf/fitz/device.h\"\n\n/*\n * Glyph cache\n */\n\nvoid fz_new_glyph_cache_context(fz_context *ctx);\nfz_glyph_cache *fz_keep_glyph_cache(fz_context *ctx);\nvoid fz_drop_glyph_cache_context(fz_context *ctx);\nvoid fz_purge_glyph_cache(fz_context *ctx);\n\nfz_path *fz_outline_ft_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm);\nfz_path *fz_outline_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *ctm);\nfz_glyph *fz_render_ft_glyph(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, int aa);\nfz_pixmap *fz_render_ft_glyph_pixmap(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, int aa);\nfz_glyph *fz_render_t3_glyph(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, fz_colorspace *model, const fz_irect *scissor);\nfz_pixmap *fz_render_t3_glyph_pixmap(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, fz_colorspace *model, const fz_irect *scissor);\nfz_glyph *fz_render_ft_stroked_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, const fz_matrix *ctm, fz_stroke_state *state);\nfz_pixmap *fz_render_ft_stroked_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, const fz_matrix *ctm, fz_stroke_state *state);\nfz_glyph *fz_render_glyph(fz_context *ctx, fz_font*, int, fz_matrix *, fz_colorspace *model, const fz_irect *scissor);\nfz_pixmap *fz_render_glyph_pixmap(fz_context *ctx, fz_font*, int, fz_matrix *, fz_colorspace *model, const fz_irect *scissor);\nfz_glyph *fz_render_stroked_glyph(fz_context *ctx, fz_font*, int, fz_matrix *, const fz_matrix *, fz_stroke_state *stroke, const fz_irect *scissor);\nfz_pixmap *fz_render_stroked_glyph_pixmap(fz_context *ctx, fz_font*, int, fz_matrix *, const fz_matrix *, fz_stroke_state *stroke, const fz_irect *scissor);\nvoid fz_render_t3_glyph_direct(fz_context *ctx, fz_device *dev, fz_font *font, int gid, const fz_matrix *trm, void *gstate, int nestedDepth);\nvoid fz_prepare_t3_glyph(fz_context *ctx, fz_font *font, int gid, int nestedDepth);\nvoid fz_dump_glyph_cache_stats(fz_context *ctx);\nfloat fz_subpixel_adjust(fz_matrix *ctm, fz_matrix *subpix_ctm, unsigned char *qe, unsigned char *qf);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/glyph.h",
    "content": "#ifndef MUPDF_FITZ_GLYPH_H\n#define MUPDF_FITZ_GLYPH_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/math.h\"\n#include \"mupdf/fitz/store.h\"\n#include \"mupdf/fitz/colorspace.h\"\n\n/*\n\tGlyphs represent a run length encoded set of pixels for a 2\n\tdimensional region of a plane.\n*/\ntypedef struct fz_glyph_s fz_glyph;\n\n/*\n\tfz_glyph_bbox: Return the bounding box for a glyph.\n*/\nfz_irect *fz_glyph_bbox(fz_context *ctx, fz_glyph *glyph, fz_irect *bbox);\n\n/*\n\tfz_glyph_width: Return the width of the glyph in pixels.\n*/\nint fz_glyph_width(fz_context *ctx, fz_glyph *glyph);\n\n/*\n\tfz_glyph_height: Return the height of the glyph in pixels.\n*/\nint fz_glyph_height(fz_context *ctx, fz_glyph *glyph);\n\n/*\n\tfz_new_glyph_from_pixmap: Create a new glyph from a pixmap\n\n\tReturns a pointer to the new glyph. Throws exception on failure to\n\tallocate.\n*/\nfz_glyph *fz_new_glyph_from_pixmap(fz_context *ctx, fz_pixmap *pix);\n\n/*\n\tfz_new_glyph_from_8bpp_data: Create a new glyph from 8bpp data\n\n\tx, y: X and Y position for the glyph\n\n\tw, h: Width and Height for the glyph\n\n\tsp: Source Pointer to data\n\n\tspan: Increment from line to line of data\n\n\tReturns a pointer to the new glyph. Throws exception on failure to\n\tallocate.\n*/\nfz_glyph *fz_new_glyph_from_8bpp_data(fz_context *ctx, int x, int y, int w, int h, unsigned char *sp, int span);\n\n/*\n\tfz_new_glyph_from_1bpp_data: Create a new glyph from 1bpp data\n\n\tx, y: X and Y position for the glyph\n\n\tw, h: Width and Height for the glyph\n\n\tsp: Source Pointer to data\n\n\tspan: Increment from line to line of data\n\n\tReturns a pointer to the new glyph. Throws exception on failure to\n\tallocate.\n*/fz_glyph *fz_new_glyph_from_1bpp_data(fz_context *ctx, int x, int y, int w, int h, unsigned char *sp, int span);\n\n\n/*\n\tfz_keep_glyph: Take a reference to a glyph.\n\n\tpix: The glyph to increment the reference for.\n\n\tReturns pix. Does not throw exceptions.\n*/\nfz_glyph *fz_keep_glyph(fz_context *ctx, fz_glyph *pix);\n\n/*\n\tfz_drop_glyph: Drop a reference and free a glyph.\n\n\tDecrement the reference count for the glyph. When no\n\treferences remain the glyph will be freed.\n\n\tDoes not throw exceptions.\n*/\nvoid fz_drop_glyph(fz_context *ctx, fz_glyph *pix);\n\n/*\n\tGlyphs represent a set of pixels for a 2 dimensional region of a\n\tplane.\n\n\tx, y: The minimum x and y coord of the region in pixels.\n\n\tw, h: The width and height of the region in pixels.\n\n\tsamples: The sample data. The sample data is in a compressed format\n\tdesigned to give reasonable compression, and to be fast to plot from.\n\n\tThe first sizeof(int) * h bytes of the table, when interpreted as\n\tints gives the offset within the data block of that lines data. An\n\toffset of 0 indicates that that line is completely blank.\n\n\tThe data for individual lines is a sequence of bytes:\n\t 00000000 = end of lines data\n\t LLLLLL00 = extend the length given in the next run by the 6 L bits\n\t\tgiven here.\n\t LLLLLL01 = A run of length L+1 transparent pixels.\n\t LLLLLE10 = A run of length L+1 solid pixels. If E then this is the\n\t\tlast run on this line.\n\t LLLLLE11 = A run of length L+1 intermediate pixels followed by L+1\n\t\tbytes of literal pixel data. If E then this is the last run\n\t\ton this line.\n*/\nstruct fz_glyph_s\n{\n\tfz_storable storable;\n\tint x, y, w, h;\n\tfz_pixmap *pixmap;\n\tint size;\n\tunsigned char data[1];\n};\n\nstatic unsigned int fz_glyph_size(fz_context *ctx, fz_glyph *glyph);\n\nfz_irect *fz_glyph_bbox_no_ctx(fz_glyph *src, fz_irect *bbox);\n\nstatic inline unsigned int\nfz_glyph_size(fz_context *ctx, fz_glyph *glyph)\n{\n\tif (glyph == NULL)\n\t\treturn 0;\n\treturn sizeof(fz_glyph) + glyph->size + fz_pixmap_size(ctx, glyph->pixmap);\n}\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/hash.h",
    "content": "#ifndef MUPDF_FITZ_HASH_H\n#define MUPDF_FITZ_HASH_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n\n/*\n * Generic hash-table with fixed-length keys.\n */\n\ntypedef struct fz_hash_table_s fz_hash_table;\n\nfz_hash_table *fz_new_hash_table(fz_context *ctx, int initialsize, int keylen, int lock);\nvoid fz_empty_hash(fz_context *ctx, fz_hash_table *table);\nvoid fz_free_hash(fz_context *ctx, fz_hash_table *table);\n\nvoid *fz_hash_find(fz_context *ctx, fz_hash_table *table, const void *key);\nvoid *fz_hash_insert(fz_context *ctx, fz_hash_table *table, const void *key, void *val);\nvoid *fz_hash_insert_with_pos(fz_context *ctx, fz_hash_table *table, const void *key, void *val, unsigned *pos);\nvoid fz_hash_remove(fz_context *ctx, fz_hash_table *table, const void *key);\nvoid fz_hash_remove_fast(fz_context *ctx, fz_hash_table *table, const void *key, unsigned pos);\n\nint fz_hash_len(fz_context *ctx, fz_hash_table *table);\nvoid *fz_hash_get_key(fz_context *ctx, fz_hash_table *table, int idx);\nvoid *fz_hash_get_val(fz_context *ctx, fz_hash_table *table, int idx);\n\n#ifndef NDEBUG\nvoid fz_print_hash(fz_context *ctx, FILE *out, fz_hash_table *table);\nvoid fz_print_hash_details(fz_context *ctx, FILE *out, fz_hash_table *table, void (*details)(FILE *, void *));\n#endif\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/image.h",
    "content": "#ifndef MUPDF_FITZ_IMAGE_H\n#define MUPDF_FITZ_IMAGE_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/store.h\"\n#include \"mupdf/fitz/colorspace.h\"\n#include \"mupdf/fitz/pixmap.h\"\n\n#include \"mupdf/fitz/buffer.h\"\n#include \"mupdf/fitz/stream.h\"\n#include \"mupdf/fitz/compressed-buffer.h\"\n\n/*\n\tImages are storable objects from which we can obtain fz_pixmaps.\n\tThese may be implemented as simple wrappers around a pixmap, or as\n\tmore complex things that decode at different subsample settings on\n\tdemand.\n*/\ntypedef struct fz_image_s fz_image;\n\n/*\n\tfz_new_pixmap_from_image: Called to get a handle to a pixmap from an image.\n\n\timage: The image to retrieve a pixmap from.\n\n\tw: The desired width (in pixels). This may be completely ignored, but\n\tmay serve as an indication of a suitable subsample factor to use for\n\timage types that support this.\n\n\th: The desired height (in pixels). This may be completely ignored, but\n\tmay serve as an indication of a suitable subsample factor to use for\n\timage types that support this.\n\n\tReturns a non NULL pixmap pointer. May throw exceptions.\n*/\nfz_pixmap *fz_new_pixmap_from_image(fz_context *ctx, fz_image *image, int w, int h);\n\n/*\n\tfz_drop_image: Drop a reference to an image.\n\n\timage: The image to drop a reference to.\n*/\nvoid fz_drop_image(fz_context *ctx, fz_image *image);\n\n/*\n\tfz_keep_image: Increment the reference count of an image.\n\n\timage: The image to take a reference to.\n\n\tReturns a pointer to the image.\n*/\nfz_image *fz_keep_image(fz_context *ctx, fz_image *image);\n\nfz_image *fz_new_image(fz_context *ctx, int w, int h, int bpc, fz_colorspace *colorspace, int xres, int yres, int interpolate, int imagemask, float *decode, int *colorkey, fz_compressed_buffer *buffer, fz_image *mask);\nfz_image *fz_new_image_from_pixmap(fz_context *ctx, fz_pixmap *pixmap, fz_image *mask);\nfz_image *fz_new_image_from_data(fz_context *ctx, unsigned char *data, int len);\nfz_image *fz_new_image_from_buffer(fz_context *ctx, fz_buffer *buffer);\nfz_pixmap *fz_image_get_pixmap(fz_context *ctx, fz_image *image, int w, int h);\nvoid fz_free_image(fz_context *ctx, fz_storable *image);\nfz_pixmap *fz_decomp_image_from_stream(fz_context *ctx, fz_stream *stm, fz_image *image, int indexed, int l2factor, int native_l2factor);\nfz_pixmap *fz_expand_indexed_pixmap(fz_context *ctx, fz_pixmap *src);\n\nstruct fz_image_s\n{\n\tfz_storable storable;\n\tint w, h, n, bpc;\n\tfz_image *mask;\n\tfz_colorspace *colorspace;\n\tfz_pixmap *(*get_pixmap)(fz_context *, fz_image *, int w, int h);\n\tfz_compressed_buffer *buffer;\n\tint colorkey[FZ_MAX_COLORS * 2];\n\tfloat decode[FZ_MAX_COLORS * 2];\n\tint imagemask;\n\tint interpolate;\n\tint usecolorkey;\n\tfz_pixmap *tile; /* Private to the implementation */\n\tint xres; /* As given in the image, not necessarily as rendered */\n\tint yres; /* As given in the image, not necessarily as rendered */\n\tint invert_cmyk_jpeg;\n};\n\nfz_pixmap *fz_load_jpx(fz_context *ctx, unsigned char *data, int size, fz_colorspace *cs, int indexed);\nfz_pixmap *fz_load_png(fz_context *ctx, unsigned char *data, int size);\nfz_pixmap *fz_load_tiff(fz_context *ctx, unsigned char *data, int size);\nfz_pixmap *fz_load_jxr(fz_context *ctx, unsigned char *data, int size);\n\nvoid fz_load_jpeg_info(fz_context *ctx, unsigned char *data, int size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace);\nvoid fz_load_png_info(fz_context *ctx, unsigned char *data, int size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace);\nvoid fz_load_tiff_info(fz_context *ctx, unsigned char *data, int size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace);\nvoid fz_load_jxr_info(fz_context *ctx, unsigned char *data, int size, int *w, int *h, int *xres, int *yres, fz_colorspace **cspace);\n\nint fz_load_tiff_subimage_count(fz_context *ctx, unsigned char *buf, int len);\nfz_pixmap *fz_load_tiff_subimage(fz_context *ctx, unsigned char *buf, int len, int subimage);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/link.h",
    "content": "#ifndef MUPDF_FITZ_LINK_H\n#define MUPDF_FITZ_LINK_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/math.h\"\n\n/*\n\tLinks\n\n\tNOTE: The link destination struct is scheduled for imminent change!\n\tUse at your own peril.\n*/\n\ntypedef struct fz_link_s fz_link;\n\ntypedef struct fz_link_dest_s fz_link_dest;\n\ntypedef enum fz_link_kind_e\n{\n\tFZ_LINK_NONE = 0,\n\tFZ_LINK_GOTO,\n\tFZ_LINK_URI,\n\tFZ_LINK_LAUNCH,\n\tFZ_LINK_NAMED,\n\tFZ_LINK_GOTOR\n} fz_link_kind;\n\nenum {\n\tfz_link_flag_l_valid = 1, /* lt.x is valid */\n\tfz_link_flag_t_valid = 2, /* lt.y is valid */\n\tfz_link_flag_r_valid = 4, /* rb.x is valid */\n\tfz_link_flag_b_valid = 8, /* rb.y is valid */\n\tfz_link_flag_fit_h = 16, /* Fit horizontally */\n\tfz_link_flag_fit_v = 32, /* Fit vertically */\n\tfz_link_flag_r_is_zoom = 64 /* rb.x is actually a zoom figure */\n};\n\n/*\n\tfz_link_dest: This structure represents the destination of\n\tan fz_link; this may be a page to display, a new file to open,\n\ta javascript action to perform, etc.\n\n\tkind: This identifies the kind of link destination. Different\n\tkinds use different sections of the union.\n\n\tFor FZ_LINK_GOTO or FZ_LINK_GOTOR:\n\n\t\tgotor.page: The target page number to move to (0 being the\n\t\tfirst page in the document). In the FZ_LINK_GOTOR case, the\n\t\tpage number either refers to to the file specified by\n\t\tgotor.file_spec, or the page number is -1 suggesting that\n\t\tthe destination is given by gotor.dest.\n\n\t\tgotor.dest: If set, the target destination name to be\n\t\tresolved in the file specified by gotor.file_spec. Always\n\t\tNULL in the FZ_LINK_GOTO case.\n\n\t\tgotor.flags: A bitfield consisting of fz_link_flag_*\n\t\tdescribing the validity and meaning of the different parts\n\t\tof gotor.lt and gotor.rb. Link destinations are constructed\n\t\t(as far as possible) so that lt and rb can be treated as a\n\t\tbounding box, though the validity flags indicate which of the\n\t\tvalues was actually specified in the file.\n\n\t\tgotor.lt: The top left corner of the destination bounding box.\n\n\t\tgotor.rb: The bottom right corner of the destination bounding\n\t\tbox. If fz_link_flag_r_is_zoom is set, then the r figure\n\t\tshould actually be interpretted as a zoom ratio.\n\n\t\tgotor.file_spec: If set, this destination should cause a new\n\t\tfile to be opened; this field holds a pointer to a remote\n\t\tfile specification (UTF-8). Always NULL in the FZ_LINK_GOTO\n\t\tcase.\n\n\t\tgotor.new_window: If true, the destination should open in a\n\t\tnew window. Always false in the FZ_LINK_GOTO case.\n\n\tFor FZ_LINK_URI:\n\n\t\turi.uri: A UTF-8 encoded URI to launch.\n\n\t\turi.is_map: If true, the x and y coords (as ints, in user\n\t\tspace) should be appended to the URI before launch.\n\n\tFor FZ_LINK_LAUNCH:\n\n\t\tlaunch.file_spec: A UTF-8 file specification to launch.\n\n\t\tlaunch.new_window: If true, the destination should be launched\n\t\tin a new window.\n\n\t\tlaunch.is_uri: If true, launch.file_spec is a URI to launch.\n\n\tFor FZ_LINK_NAMED:\n\n\t\tnamed.named: The named action to perform. Likely to be\n\t\tclient specific.\n*/\nstruct fz_link_dest_s\n{\n\tfz_link_kind kind;\n\tunion\n\t{\n\t\tstruct\n\t\t{\n\t\t\tint page;\n\t\t\tchar *dest;\n\t\t\tint flags;\n\t\t\tfz_point lt;\n\t\t\tfz_point rb;\n\t\t\tchar *file_spec;\n\t\t\tint new_window;\n\t\t}\n\t\tgotor;\n\t\tstruct\n\t\t{\n\t\t\tchar *uri;\n\t\t\tint is_map;\n\t\t}\n\t\turi;\n\t\tstruct\n\t\t{\n\t\t\tchar *file_spec;\n\t\t\tint new_window;\n\t\t\tint is_uri;\n\t\t\t/* SumatraPDF: support launching embedded files */\n\t\t\tint embedded_num, embedded_gen;\n\t\t}\n\t\tlaunch;\n\t\tstruct\n\t\t{\n\t\t\tchar *named;\n\t\t}\n\t\tnamed;\n\t}\n\tld;\n};\n\n/*\n\tfz_link is a list of interactive links on a page.\n\n\tThere is no relation between the order of the links in the\n\tlist and the order they appear on the page. The list of links\n\tfor a given page can be obtained from fz_load_links.\n\n\tA link is reference counted. Dropping a reference to a link is\n\tdone by calling fz_drop_link.\n\n\trect: The hot zone. The area that can be clicked in\n\tuntransformed coordinates.\n\n\tdest: Link destinations come in two forms: Page and area that\n\tan application should display when this link is activated. Or\n\tas an URI that can be given to a browser.\n\n\tnext: A pointer to the next link on the same page.\n*/\nstruct fz_link_s\n{\n\tint refs;\n\tfz_rect rect;\n\tfz_link_dest dest;\n\tfz_link *next;\n};\n\nfz_link *fz_new_link(fz_context *ctx, const fz_rect *bbox, fz_link_dest dest);\nfz_link *fz_keep_link(fz_context *ctx, fz_link *link);\n\n/*\n\tfz_drop_link: Drop and free a list of links.\n\n\tDoes not throw exceptions.\n*/\nvoid fz_drop_link(fz_context *ctx, fz_link *link);\n\nvoid fz_free_link_dest(fz_context *ctx, fz_link_dest *dest);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/math.h",
    "content": "#ifndef MUPDF_FITZ_MATH_H\n#define MUPDF_FITZ_MATH_H\n\n#include \"mupdf/fitz/system.h\"\n\n/* Multiply scaled two integers in the 0..255 range */\nstatic inline int fz_mul255(int a, int b)\n{\n\t/* see Jim Blinn's book \"Dirty Pixels\" for how this works */\n\tint x = a * b + 128;\n\tx += x >> 8;\n\treturn x >> 8;\n}\n\n/* Expand a value A from the 0...255 range to the 0..256 range */\n#define FZ_EXPAND(A) ((A)+((A)>>7))\n\n/* Combine values A (in any range) and B (in the 0..256 range),\n * to give a single value in the same range as A was. */\n#define FZ_COMBINE(A,B) (((A)*(B))>>8)\n\n/* Combine values A and C (in the same (any) range) and B and D (in the\n * 0..256 range), to give a single value in the same range as A and C were. */\n#define FZ_COMBINE2(A,B,C,D) (FZ_COMBINE((A), (B)) + FZ_COMBINE((C), (D)))\n\n/* Blend SRC and DST (in the same range) together according to\n * AMOUNT (in the 0...256 range). */\n#define FZ_BLEND(SRC, DST, AMOUNT) ((((SRC)-(DST))*(AMOUNT) + ((DST)<<8))>>8)\n\n/* Range checking atof */\nfloat fz_atof(const char *s);\n\n/* atoi that copes with NULL */\nint fz_atoi(const char *s);\n\n/*\n\tSome standard math functions, done as static inlines for speed.\n\tPeople with compilers that do not adequately implement inlines may\n\tlike to reimplement these using macros.\n*/\nstatic inline float fz_abs(float f)\n{\n\treturn (f < 0 ? -f : f);\n}\n\nstatic inline int fz_absi(int i)\n{\n\treturn (i < 0 ? -i : i);\n}\n\nstatic inline float fz_min(float a, float b)\n{\n\treturn (a < b ? a : b);\n}\n\nstatic inline int fz_mini(int a, int b)\n{\n\treturn (a < b ? a : b);\n}\n\nstatic inline float fz_max(float a, float b)\n{\n\treturn (a > b ? a : b);\n}\n\nstatic inline int fz_maxi(int a, int b)\n{\n\treturn (a > b ? a : b);\n}\n\nstatic inline float fz_clamp(float f, float min, float max)\n{\n\treturn (f > min ? (f < max ? f : max) : min);\n}\n\nstatic inline int fz_clampi(int i, int min, int max)\n{\n\treturn (i > min ? (i < max ? i : max) : min);\n}\n\nstatic inline double fz_clampd(double d, double min, double max)\n{\n\treturn (d > min ? (d < max ? d : max) : min);\n}\n\nstatic inline void *fz_clampp(void *p, void *min, void *max)\n{\n\treturn (p > min ? (p < max ? p : max) : min);\n}\n\n#define DIV_BY_ZERO(a, b, min, max) (((a) < 0) ^ ((b) < 0) ? (min) : (max))\n\n/*\n\tfz_point is a point in a two-dimensional space.\n*/\ntypedef struct fz_point_s fz_point;\nstruct fz_point_s\n{\n\tfloat x, y;\n};\n\n/*\n\tfz_rect is a rectangle represented by two diagonally opposite\n\tcorners at arbitrary coordinates.\n\n\tRectangles are always axis-aligned with the X- and Y- axes.\n\tThe relationship between the coordinates are that x0 <= x1 and\n\ty0 <= y1 in all cases except for infinte rectangles. The area\n\tof a rectangle is defined as (x1 - x0) * (y1 - y0). If either\n\tx0 > x1 or y0 > y1 is true for a given rectangle then it is\n\tdefined to be infinite.\n\n\tTo check for empty or infinite rectangles use fz_is_empty_rect\n\tand fz_is_infinite_rect.\n\n\tx0, y0: The top left corner.\n\n\tx1, y1: The botton right corner.\n*/\ntypedef struct fz_rect_s fz_rect;\nstruct fz_rect_s\n{\n\tfloat x0, y0;\n\tfloat x1, y1;\n};\n\n/*\n\tfz_rect_min: get the minimum point from a rectangle as an fz_point.\n*/\nstatic inline fz_point *fz_rect_min(fz_rect *f)\n{\n\treturn (fz_point *)&f->x0;\n}\n\n/*\n\tfz_rect_max: get the maximum point from a rectangle as an fz_point.\n*/\nstatic inline fz_point *fz_rect_max(fz_rect *f)\n{\n\treturn (fz_point *)&f->x1;\n}\n\n/*\n\tfz_irect is a rectangle using integers instead of floats.\n\n\tIt's used in the draw device and for pixmap dimensions.\n*/\ntypedef struct fz_irect_s fz_irect;\nstruct fz_irect_s\n{\n\tint x0, y0;\n\tint x1, y1;\n};\n\n/*\n\tA rectangle with sides of length one.\n\n\tThe bottom left corner is at (0, 0) and the top right corner\n\tis at (1, 1).\n*/\nextern const fz_rect fz_unit_rect;\n\n/*\n\tAn empty rectangle with an area equal to zero.\n\n\tBoth the top left and bottom right corner are at (0, 0).\n*/\nextern const fz_rect fz_empty_rect;\nextern const fz_irect fz_empty_irect;\n\n/*\n\tAn infinite rectangle with negative area.\n\n\tThe corner (x0, y0) is at (1, 1) while the corner (x1, y1) is\n\tat (-1, -1).\n*/\nextern const fz_rect fz_infinite_rect;\nextern const fz_irect fz_infinite_irect;\n\n/*\n\tfz_is_empty_rect: Check if rectangle is empty.\n\n\tAn empty rectangle is defined as one whose area is zero.\n*/\nstatic inline int\nfz_is_empty_rect(const fz_rect *r)\n{\n\treturn ((r)->x0 == (r)->x1 || (r)->y0 == (r)->y1);\n}\n\nstatic inline int\nfz_is_empty_irect(const fz_irect *r)\n{\n\treturn ((r)->x0 == (r)->x1 || (r)->y0 == (r)->y1);\n}\n\n/*\n\tfz_is_infinite: Check if rectangle is infinite.\n\n\tAn infinite rectangle is defined as one where either of the\n\ttwo relationships between corner coordinates are not true.\n*/\nstatic inline int\nfz_is_infinite_rect(const fz_rect *r)\n{\n\treturn ((r)->x0 > (r)->x1 || (r)->y0 > (r)->y1);\n}\n\nstatic inline int\nfz_is_infinite_irect(const fz_irect *r)\n{\n\treturn ((r)->x0 > (r)->x1 || (r)->y0 > (r)->y1);\n}\n\n/*\n\tfz_matrix is a a row-major 3x3 matrix used for representing\n\ttransformations of coordinates throughout MuPDF.\n\n\tSince all points reside in a two-dimensional space, one vector\n\tis always a constant unit vector; hence only some elements may\n\tvary in a matrix. Below is how the elements map between\n\tdifferent representations.\n\n\t/ a b 0 \\\n\t| c d 0 | normally represented as [ a b c d e f ].\n\t\\ e f 1 /\n*/\ntypedef struct fz_matrix_s fz_matrix;\nstruct fz_matrix_s\n{\n\tfloat a, b, c, d, e, f;\n};\n\n/*\n\tfz_identity: Identity transform matrix.\n*/\nextern const fz_matrix fz_identity;\n\nstatic inline fz_matrix *fz_copy_matrix(fz_matrix *restrict m, const fz_matrix *restrict s)\n{\n\t*m = *s;\n\treturn m;\n}\n\n/*\n\tfz_concat: Multiply two matrices.\n\n\tThe order of the two matrices are important since matrix\n\tmultiplication is not commutative.\n\n\tReturns result.\n\n\tDoes not throw exceptions.\n*/\nfz_matrix *fz_concat(fz_matrix *result, const fz_matrix *left, const fz_matrix *right);\n\n/*\n\tfz_scale: Create a scaling matrix.\n\n\tThe returned matrix is of the form [ sx 0 0 sy 0 0 ].\n\n\tm: Pointer to the matrix to populate\n\n\tsx, sy: Scaling factors along the X- and Y-axes. A scaling\n\tfactor of 1.0 will not cause any scaling along the relevant\n\taxis.\n\n\tReturns m.\n\n\tDoes not throw exceptions.\n*/\nfz_matrix *fz_scale(fz_matrix *m, float sx, float sy);\n\n/*\n\tfz_pre_scale: Scale a matrix by premultiplication.\n\n\tm: Pointer to the matrix to scale\n\n\tsx, sy: Scaling factors along the X- and Y-axes. A scaling\n\tfactor of 1.0 will not cause any scaling along the relevant\n\taxis.\n\n\tReturns m (updated).\n\n\tDoes not throw exceptions.\n*/\nfz_matrix *fz_pre_scale(fz_matrix *m, float sx, float sy);\n\n/*\n\tfz_shear: Create a shearing matrix.\n\n\tThe returned matrix is of the form [ 1 sy sx 1 0 0 ].\n\n\tm: pointer to place to store returned matrix\n\n\tsx, sy: Shearing factors. A shearing factor of 0.0 will not\n\tcause any shearing along the relevant axis.\n\n\tReturns m.\n\n\tDoes not throw exceptions.\n*/\nfz_matrix *fz_shear(fz_matrix *m, float sx, float sy);\n\n/*\n\tfz_pre_shear: Premultiply a matrix with a shearing matrix.\n\n\tThe shearing matrix is of the form [ 1 sy sx 1 0 0 ].\n\n\tm: pointer to matrix to premultiply\n\n\tsx, sy: Shearing factors. A shearing factor of 0.0 will not\n\tcause any shearing along the relevant axis.\n\n\tReturns m (updated).\n\n\tDoes not throw exceptions.\n*/\nfz_matrix *fz_pre_shear(fz_matrix *m, float sx, float sy);\n\n/*\n\tfz_rotate: Create a rotation matrix.\n\n\tThe returned matrix is of the form\n\t[ cos(deg) sin(deg) -sin(deg) cos(deg) 0 0 ].\n\n\tm: Pointer to place to store matrix\n\n\tdegrees: Degrees of counter clockwise rotation. Values less\n\tthan zero and greater than 360 are handled as expected.\n\n\tReturns m.\n\n\tDoes not throw exceptions.\n*/\nfz_matrix *fz_rotate(fz_matrix *m, float degrees);\n\n/*\n\tfz_pre_rotate: Rotate a transformation by premultiplying.\n\n\tThe premultiplied matrix is of the form\n\t[ cos(deg) sin(deg) -sin(deg) cos(deg) 0 0 ].\n\n\tm: Pointer to matrix to premultiply.\n\n\tdegrees: Degrees of counter clockwise rotation. Values less\n\tthan zero and greater than 360 are handled as expected.\n\n\tReturns m (updated).\n\n\tDoes not throw exceptions.\n*/\nfz_matrix *fz_pre_rotate(fz_matrix *m, float degrees);\n\n/*\n\tfz_translate: Create a translation matrix.\n\n\tThe returned matrix is of the form [ 1 0 0 1 tx ty ].\n\n\tm: A place to store the created matrix.\n\n\ttx, ty: Translation distances along the X- and Y-axes. A\n\ttranslation of 0 will not cause any translation along the\n\trelevant axis.\n\n\tReturns m.\n\n\tDoes not throw exceptions.\n*/\nfz_matrix *fz_translate(fz_matrix *m, float tx, float ty);\n\n/*\n\tfz_pre_translate: Translate a matrix by premultiplication.\n\n\tm: The matrix to translate\n\n\ttx, ty: Translation distances along the X- and Y-axes. A\n\ttranslation of 0 will not cause any translation along the\n\trelevant axis.\n\n\tReturns m.\n\n\tDoes not throw exceptions.\n*/\nfz_matrix *fz_pre_translate(fz_matrix *m, float tx, float ty);\n\n/*\n\tfz_invert_matrix: Create an inverse matrix.\n\n\tinverse: Place to store inverse matrix.\n\n\tmatrix: Matrix to invert. A degenerate matrix, where the\n\tdeterminant is equal to zero, can not be inverted and the\n\toriginal matrix is returned instead.\n\n\tReturns inverse.\n\n\tDoes not throw exceptions.\n*/\nfz_matrix *fz_invert_matrix(fz_matrix *inverse, const fz_matrix *matrix);\n\n/*\n\tfz_try_invert_matrix: Attempt to create an inverse matrix.\n\n\tinverse: Place to store inverse matrix.\n\n\tmatrix: Matrix to invert. A degenerate matrix, where the\n\tdeterminant is equal to zero, can not be inverted.\n\n\tReturns 1 if matrix is degenerate (singular), or 0 otherwise.\n\n\tDoes not throw exceptions.\n*/\n int fz_try_invert_matrix(fz_matrix *inverse, const fz_matrix *matrix);\n\n/*\n\tfz_is_rectilinear: Check if a transformation is rectilinear.\n\n\tRectilinear means that no shearing is present and that any\n\trotations present are a multiple of 90 degrees. Usually this\n\tis used to make sure that axis-aligned rectangles before the\n\ttransformation are still axis-aligned rectangles afterwards.\n\n\tDoes not throw exceptions.\n*/\nint fz_is_rectilinear(const fz_matrix *m);\n\n/*\n\tfz_matrix_expansion: Calculate average scaling factor of matrix.\n*/\nfloat fz_matrix_expansion(const fz_matrix *m); /* sumatrapdf */\n\n/*\n\tfz_intersect_rect: Compute intersection of two rectangles.\n\n\tGiven two rectangles, update the first to be the smallest\n\taxis-aligned rectangle that covers the area covered by both\n\tgiven rectangles. If either rectangle is empty then the\n\tintersection is also empty. If either rectangle is infinite\n\tthen the intersection is simply the non-infinite rectangle.\n\tShould both rectangles be infinite, then the intersection is\n\talso infinite.\n\n\tDoes not throw exceptions.\n*/\nfz_rect *fz_intersect_rect(fz_rect *restrict a, const fz_rect *restrict b);\n\n/*\n\tfz_intersect_irect: Compute intersection of two bounding boxes.\n\n\tSimilar to fz_intersect_rect but operates on two bounding\n\tboxes instead of two rectangles.\n\n\tDoes not throw exceptions.\n*/\nfz_irect *fz_intersect_irect(fz_irect *restrict a, const fz_irect *restrict b);\n\n/*\n\tfz_union_rect: Compute union of two rectangles.\n\n\tGiven two rectangles, update the first to be the smallest\n\taxis-aligned rectangle that encompasses both given rectangles.\n\tIf either rectangle is infinite then the union is also infinite.\n\tIf either rectangle is empty then the union is simply the\n\tnon-empty rectangle. Should both rectangles be empty, then the\n\tunion is also empty.\n\n\tDoes not throw exceptions.\n*/\nfz_rect *fz_union_rect(fz_rect *restrict a, const fz_rect *restrict b);\n\n/*\n\tfz_irect_from_rect: Convert a rect into the minimal bounding box\n\tthat covers the rectangle.\n\n\tbbox: Place to store the returned bbox.\n\n\trect: The rectangle to convert to a bbox.\n\n\tCoordinates in a bounding box are integers, so rounding of the\n\trects coordinates takes place. The top left corner is rounded\n\tupwards and left while the bottom right corner is rounded\n\tdownwards and to the right.\n\n\tReturns bbox (updated).\n\n\tDoes not throw exceptions.\n*/\n\nfz_irect *fz_irect_from_rect(fz_irect *restrict bbox, const fz_rect *restrict rect);\n\n/*\n\tfz_round_rect: Round rectangle coordinates.\n\n\tCoordinates in a bounding box are integers, so rounding of the\n\trects coordinates takes place. The top left corner is rounded\n\tupwards and left while the bottom right corner is rounded\n\tdownwards and to the right.\n\n\tThis differs from fz_irect_from_rect, in that fz_irect_from_rect\n\tslavishly follows the numbers (i.e any slight over/under calculations\n\tcan cause whole extra pixels to be added). fz_round_rect\n\tallows for a small amount of rounding error when calculating\n\tthe bbox.\n\n\tDoes not throw exceptions.\n*/\nfz_irect *fz_round_rect(fz_irect *restrict bbox, const fz_rect *restrict rect);\n\n/*\n\tfz_rect_from_irect: Convert a bbox into a rect.\n\n\tFor our purposes, a rect can represent all the values we meet in\n\ta bbox, so nothing can go wrong.\n\n\trect: A place to store the generated rectangle.\n\n\tbbox: The bbox to convert.\n\n\tReturns rect (updated).\n\n\tDoes not throw exceptions.\n*/\nfz_rect *fz_rect_from_irect(fz_rect *restrict rect, const fz_irect *restrict bbox);\n\n/*\n\tfz_expand_rect: Expand a bbox by a given amount in all directions.\n\n\tDoes not throw exceptions.\n*/\nfz_rect *fz_expand_rect(fz_rect *b, float expand);\n\n/*\n\tfz_include_point_in_rect: Expand a bbox to include a given point.\n\tTo create a rectangle that encompasses a sequence of points, the\n\trectangle must first be set to be the empty rectangle at one of\n\tthe points before including the others.\n*/\nfz_rect *fz_include_point_in_rect(fz_rect *r, const fz_point *p);\n\n/*\n\tfz_translate_irect: Translate bounding box.\n\n\tTranslate a bbox by a given x and y offset. Allows for overflow.\n\n\tDoes not throw exceptions.\n*/\nfz_irect *fz_translate_irect(fz_irect *a, int xoff, int yoff);\n\n/*\n\tfz_transform_point: Apply a transformation to a point.\n\n\ttransform: Transformation matrix to apply. See fz_concat,\n\tfz_scale, fz_rotate and fz_translate for how to create a\n\tmatrix.\n\n\tpoint: Pointer to point to update.\n\n\tReturns transform (unchanged).\n\n\tDoes not throw exceptions.\n*/\nfz_point *fz_transform_point(fz_point *restrict point, const fz_matrix *restrict transform);\nfz_point *fz_transform_point_xy(fz_point *restrict point, const fz_matrix *restrict transform, float x, float y);\n\n/*\n\tfz_transform_vector: Apply a transformation to a vector.\n\n\ttransform: Transformation matrix to apply. See fz_concat,\n\tfz_scale and fz_rotate for how to create a matrix. Any\n\ttranslation will be ignored.\n\n\tvector: Pointer to vector to update.\n\n\tDoes not throw exceptions.\n*/\nfz_point *fz_transform_vector(fz_point *restrict vector, const fz_matrix *restrict transform);\n\n/*\n\tfz_transform_rect: Apply a transform to a rectangle.\n\n\tAfter the four corner points of the axis-aligned rectangle\n\thave been transformed it may not longer be axis-aligned. So a\n\tnew axis-aligned rectangle is created covering at least the\n\tarea of the transformed rectangle.\n\n\ttransform: Transformation matrix to apply. See fz_concat,\n\tfz_scale and fz_rotate for how to create a matrix.\n\n\trect: Rectangle to be transformed. The two special cases\n\tfz_empty_rect and fz_infinite_rect, may be used but are\n\treturned unchanged as expected.\n\n\tDoes not throw exceptions.\n*/\nfz_rect *fz_transform_rect(fz_rect *restrict rect, const fz_matrix *restrict transform);\n\n/*\n\tfz_normalize_vector: Normalize a vector to length one.\n*/\nvoid fz_normalize_vector(fz_point *p);\n\nvoid fz_gridfit_matrix(fz_matrix *m);\n\nfloat fz_matrix_max_expansion(const fz_matrix *m);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/meta.h",
    "content": "#ifndef MUPDF_FITZ_META_H\n#define MUPDF_FITZ_META_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/document.h\"\n\n/*\n\tfz_meta: Perform a meta operation on a document.\n\n\t(In development - Subject to change in future versions)\n\n\tMeta operations provide a way to perform format specific\n\toperations on a document. The meta operation scheme is\n\tdesigned to be extensible so that new features can be\n\ttransparently added in later versions of the library.\n\n\tdoc: The document on which to perform the meta operation.\n\n\tkey: The meta operation to try. If a particular operation\n\tis unsupported on a given document, the function will return\n\tFZ_META_UNKNOWN_KEY.\n\n\tptr: An operation dependent (possibly NULL) pointer.\n\n\tsize: An operation dependent integer. Often this will\n\tbe the size of the block pointed to by ptr, but not always.\n\n\tReturns an operation dependent value; FZ_META_UNKNOWN_KEY\n\talways means \"unknown operation for this document\". In general\n\tFZ_META_OK should be used to indicate successful operation.\n*/\nint fz_meta(fz_document *doc, int key, void *ptr, int size);\n\nenum\n{\n\tFZ_META_UNKNOWN_KEY = -1,\n\tFZ_META_OK = 0,\n\n\t/*\n\t\tptr: Pointer to block (uninitialised on entry)\n\t\tsize: Size of block (at least 64 bytes)\n\t\tReturns: Document format as a brief text string.\n\t\tAll formats should support this.\n\t*/\n\tFZ_META_FORMAT_INFO = 1,\n\n\t/*\n\t\tptr: Pointer to block (uninitialised on entry)\n\t\tsize: Size of block (at least 64 bytes)\n\t\tReturns: Encryption info as a brief text string.\n\t*/\n\tFZ_META_CRYPT_INFO = 2,\n\n\t/*\n\t\tptr: NULL\n\t\tsize: Which permission to check\n\t\tReturns: 1 if permitted, 0 otherwise.\n\t*/\n\tFZ_META_HAS_PERMISSION = 3,\n\n\tFZ_PERMISSION_PRINT = 0,\n\tFZ_PERMISSION_CHANGE = 1,\n\tFZ_PERMISSION_COPY = 2,\n\tFZ_PERMISSION_NOTES = 3,\n\n\t/*\n\t\tptr: Pointer to block. First entry in the block is\n\t\ta pointer to a UTF8 string to lookup. The rest of the\n\t\tblock is uninitialised on entry.\n\t\tsize: size of the block in bytes.\n\t\tReturns: 0 if not found. 1 if found. The string\n\t\tresult is copied into the block (truncated to size\n\t\tand NULL terminated)\n\n\t*/\n\tFZ_META_INFO = 4,\n};\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/outline.h",
    "content": "#ifndef MUPDF_FITZ_OUTLINE_H\n#define MUPDF_FITZ_OUTLINE_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/link.h\"\n#include \"mupdf/fitz/output.h\"\n\n/* Outline */\n\n/*\n\tfz_outline is a tree of the outline of a document (also known\n\tas table of contents).\n\n\ttitle: Title of outline item using UTF-8 encoding. May be NULL\n\tif the outline item has no text string.\n\n\tdest: Destination in the document to be displayed when this\n\toutline item is activated. May be FZ_LINK_NONE if the outline\n\titem does not have a destination.\n\n\tnext: The next outline item at the same level as this outline\n\titem. May be NULL if no more outline items exist at this level.\n\n\tdown: The outline items immediate children in the hierarchy.\n\tMay be NULL if no children exist.\n*/\n\ntypedef struct fz_outline_s fz_outline;\n\nstruct fz_outline_s\n{\n\tchar *title;\n\tfz_link_dest dest;\n\tfz_outline *next;\n\tfz_outline *down;\n\tint is_open; /* SumatraPDF: support expansion states */\n};\n\n/*\n\tfz_print_outline_xml: Dump the given outlines as (pseudo) XML.\n\n\tout: The file handle to output to.\n\n\toutline: The outlines to output.\n*/\nvoid fz_print_outline_xml(fz_context *ctx, fz_output *out, fz_outline *outline);\n\n/*\n\tfz_print_outline: Dump the given outlines to as text.\n\n\tout: The file handle to output to.\n\n\toutline: The outlines to output.\n*/\nvoid fz_print_outline(fz_context *ctx, fz_output *out, fz_outline *outline);\n\n/*\n\tfz_free_outline: Free hierarchical outline.\n\n\tFree an outline obtained from fz_load_outline.\n\n\tDoes not throw exceptions.\n*/\nvoid fz_free_outline(fz_context *ctx, fz_outline *outline);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/output-pcl.h",
    "content": "#ifndef MUPDF_FITZ_OUTPUT_PCL_H\n#define MUPDF_FITZ_OUTPUT_PCL_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/output.h\"\n#include \"mupdf/fitz/pixmap.h\"\n#include \"mupdf/fitz/bitmap.h\"\n\n/*\n\tPCL output\n*/\ntypedef struct fz_pcl_options_s fz_pcl_options;\n\nstruct fz_pcl_options_s\n{\n\t/* Features of a particular printer */\n\tint features;\n\tconst char *odd_page_init;\n\tconst char *even_page_init;\n\n\t/* Options for this job */\n\tint tumble;\n\tint duplex_set;\n\tint duplex;\n\tint paper_size;\n\tint manual_feed_set;\n\tint manual_feed;\n\tint media_position_set;\n\tint media_position;\n\n\t/* Updated as we move through the job */\n\tint page_count;\n};\n\n/*\n\t fz_pcl_preset: Retrieve a set of fz_pcl_options suitable for a given\n\t preset.\n\n\t opts: pointer to options structure to populate.\n\n\t preset: Preset to fetch. Currently defined presets include:\n\t\tljet4\tHP DeskJet\n\t\tdj500\tHP DeskJet 500\n\t\tfs600\tKyocera FS-600\n\t\tlj\tHP LaserJet, HP LaserJet Plus\n\t\tlj2\tHP LaserJet IIp, HP LaserJet IId\n\t\tlj3\tHP LaserJet III\n\t\tlj3d\tHP LaserJet IIId\n\t\tlj4\tHP LaserJet 4\n\t\tlj4pl\tHP LaserJet 4 PL\n\t\tlj4d\tHP LaserJet 4d\n\t\tlp2563b\tHP 2563B line printer\n\t\toce9050\tOce 9050 Line printer\n\n\tThrows exception on unknown preset.\n*/\nvoid fz_pcl_preset(fz_context *ctx, fz_pcl_options *opts, const char *preset);\n\n/*\n\tfz_pcl_option: Set a given PCL option to a given value in the supplied\n\toptions structure.\n\n\topts: The option structure to modify,\n\n\toption: The option to change.\n\n\tval: The value that the option should be set to. Acceptable ranges of\n\tvalues depend on the option in question.\n\n\tThrows an exception on attempt to set an unknown option, or an illegal\n\tvalue.\n\n\tCurrently defined options/values are as follows:\n\n\t\tspacing,0\t\tNo vertical spacing capability\n\t\tspacing,1\t\tPCL 3 spacing (<ESC>*p+<n>Y)\n\t\tspacing,2\t\tPCL 4 spacing (<ESC>*b<n>Y)\n\t\tspacing,3\t\tPCL 5 spacing (<ESC>*b<n>Y and clear seed row)\n\t\tmode2,0 or 1\t\tDisable/Enable mode 2 graphics compression\n\t\tmode3,0 or 1\t\tDisable/Enable mode 3 graphics compression\n\t\tmode3,0 or 1\t\tDisable/Enable mode 3 graphics compression\n\t\teog_reset,0 or 1\tEnd of graphics (<ESC>*rB) resets all parameters\n\t\thas_duplex,0 or 1\tDuplex supported (<ESC>&l<duplex>S)\n\t\thas_papersize,0 or 1\tPapersize setting supported (<ESC>&l<sizecode>A)\n\t\thas_copies,0 or 1\tNumber of copies supported (<ESC>&l<copies>X)\n\t\tis_ljet4pjl,0 or 1\tDisable/Enable HP 4PJL model-specific output\n\t\tis_oce9050,0 or 1\tDisable/Enable Oce 9050 model-specific output\n*/\nvoid fz_pcl_option(fz_context *ctx, fz_pcl_options *opts, const char *option, int val);\n\nvoid fz_output_pcl(fz_output *out, const fz_pixmap *pixmap, fz_pcl_options *pcl);\n\nvoid fz_output_pcl_bitmap(fz_output *out, const fz_bitmap *bitmap, fz_pcl_options *pcl);\n\nvoid fz_write_pcl(fz_context *ctx, fz_pixmap *pixmap, char *filename, int append, fz_pcl_options *pcl);\n\nvoid fz_write_pcl_bitmap(fz_context *ctx, fz_bitmap *bitmap, char *filename, int append, fz_pcl_options *pcl);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/output-png.h",
    "content": "#ifndef MUPDF_FITZ_OUTPUT_PNG_H\n#define MUPDF_FITZ_OUTPUT_PNG_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/output.h\"\n#include \"mupdf/fitz/pixmap.h\"\n#include \"mupdf/fitz/bitmap.h\"\n\n#include \"mupdf/fitz/buffer.h\"\n#include \"mupdf/fitz/image.h\"\n\n/*\n\tfz_write_png: Save a pixmap as a png\n\n\tfilename: The filename to save as (including extension).\n*/\nvoid fz_write_png(fz_context *ctx, fz_pixmap *pixmap, char *filename, int savealpha);\n\n/*\n\tOutput a pixmap to an output stream as a png.\n*/\nvoid fz_output_png(fz_output *out, const fz_pixmap *pixmap, int savealpha);\n\n/*\n\tGet an image as a png in a buffer.\n*/\nfz_buffer *fz_new_png_from_image(fz_context *ctx, fz_image *image, int w, int h);\n\nfz_buffer *fz_new_png_from_pixmap(fz_context *ctx, fz_pixmap *pixmap);\n\ntypedef struct fz_png_output_context_s fz_png_output_context;\n\nfz_png_output_context *fz_output_png_header(fz_output *out, int w, int h, int n, int savealpha);\n\nvoid fz_output_png_band(fz_output *out, int w, int h, int n, int band, int bandheight, unsigned char *samples, int savealpha, fz_png_output_context *poc);\n\nvoid fz_output_png_trailer(fz_output *out, fz_png_output_context *poc);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/output-pnm.h",
    "content": "#ifndef MUPDF_FITZ_OUTPUT_PNM_H\n#define MUPDF_FITZ_OUTPUT_PNM_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/output.h\"\n#include \"mupdf/fitz/pixmap.h\"\n#include \"mupdf/fitz/bitmap.h\"\n\n/*\n\tfz_write_pnm: Save a pixmap as a pnm\n\n\tfilename: The filename to save as (including extension).\n*/\nvoid fz_write_pnm(fz_context *ctx, fz_pixmap *pixmap, char *filename);\n\nvoid fz_output_pnm_header(fz_output *out, int w, int h, int n);\nvoid fz_output_pnm_band(fz_output *out, int w, int h, int n, int band, int bandheight, unsigned char *p);\n\n/*\n\tfz_write_pam: Save a pixmap as a pam\n\n\tfilename: The filename to save as (including extension).\n*/\nvoid fz_write_pam(fz_context *ctx, fz_pixmap *pixmap, char *filename, int savealpha);\n\nvoid fz_output_pam_header(fz_output *out, int w, int h, int n, int savealpha);\nvoid fz_output_pam_band(fz_output *out, int w, int h, int n, int band, int bandheight, unsigned char *sp, int savealpha);\n\n/*\n\tfz_write_pbm: Save a bitmap as a pbm\n\n\tfilename: The filename to save as (including extension).\n*/\nvoid fz_write_pbm(fz_context *ctx, fz_bitmap *bitmap, char *filename);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/output-pwg.h",
    "content": "#ifndef MUPDF_FITZ_OUTPUT_PWG_H\n#define MUPDF_FITZ_OUTPUT_PWG_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/output.h\"\n#include \"mupdf/fitz/pixmap.h\"\n#include \"mupdf/fitz/bitmap.h\"\n\ntypedef struct fz_pwg_options_s fz_pwg_options;\n\nstruct fz_pwg_options_s\n{\n\t/* These are not interpreted as CStrings by the writing code, but\n\t * are rather copied directly out. */\n\tchar media_class[64];\n\tchar media_color[64];\n\tchar media_type[64];\n\tchar output_type[64];\n\n\tunsigned int advance_distance;\n\tint advance_media;\n\tint collate;\n\tint cut_media;\n\tint duplex;\n\tint insert_sheet;\n\tint jog;\n\tint leading_edge;\n\tint manual_feed;\n\tunsigned int media_position;\n\tunsigned int media_weight;\n\tint mirror_print;\n\tint negative_print;\n\tunsigned int num_copies;\n\tint orientation;\n\tint output_face_up;\n\tunsigned int PageSize[2];\n\tint separations;\n\tint tray_switch;\n\tint tumble;\n\n\tint media_type_num;\n\tint compression;\n\tunsigned int row_count;\n\tunsigned int row_feed;\n\tunsigned int row_step;\n\n\t/* These are not interpreted as CStrings by the writing code, but\n\t * are rather copied directly out. */\n\tchar rendering_intent[64];\n\tchar page_size_name[64];\n};\n\n/*\n\tfz_write_pwg: Save a pixmap as a pwg\n\n\tfilename: The filename to save as (including extension).\n\n\tappend: If non-zero, then append a new page to existing file.\n\n\tpwg: NULL, or a pointer to an options structure (initialised to zero\n\tbefore being filled in, for future expansion).\n*/\nvoid fz_write_pwg(fz_context *ctx, fz_pixmap *pixmap, char *filename, int append, const fz_pwg_options *pwg);\n\n/*\n\tfz_write_pwg_bitmap: Save a bitmap as a pwg\n\n\tfilename: The filename to save as (including extension).\n\n\tappend: If non-zero, then append a new page to existing file.\n\n\tpwg: NULL, or a pointer to an options structure (initialised to zero\n\tbefore being filled in, for future expansion).\n*/\nvoid fz_write_pwg_bitmap(fz_context *ctx, fz_bitmap *bitmap, char *filename, int append, const fz_pwg_options *pwg);\n\n/*\n\tOutput a pixmap to an output stream as a pwg raster.\n*/\nvoid fz_output_pwg(fz_output *out, const fz_pixmap *pixmap, const fz_pwg_options *pwg);\n\n/*\n\tOutput the file header to a pwg stream, ready for pages to follow it.\n*/\nvoid fz_output_pwg_file_header(fz_output *out);\n\n/*\n\tOutput a page to a pwg stream to follow a header, or other pages.\n*/\nvoid fz_output_pwg_page(fz_output *out, const fz_pixmap *pixmap, const fz_pwg_options *pwg);\n\n/*\n\tOutput a bitmap page to a pwg stream to follow a header, or other pages.\n*/\nvoid fz_output_pwg_bitmap_page(fz_output *out, const fz_bitmap *bitmap, const fz_pwg_options *pwg);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/output-svg.h",
    "content": "#ifndef MUPDF_FITZ_OUTPUT_SVG_H\n#define MUPDF_FITZ_OUTPUT_SVG_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/device.h\"\n#include \"mupdf/fitz/output.h\"\n\nfz_device *fz_new_svg_device(fz_context *ctx, fz_output *out, float page_width, float page_height);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/output-tga.h",
    "content": "#ifndef MUPDF_FITZ_OUTPUT_TGA_H\n#define MUPDF_FITZ_OUTPUT_TGA_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/pixmap.h\"\n\nvoid fz_write_tga(fz_context *ctx, fz_pixmap *pixmap, const char *filename, int savealpha);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/output.h",
    "content": "#ifndef MUPDF_FITZ_OUTPUT_H\n#define MUPDF_FITZ_OUTPUT_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/buffer.h\"\n\n/*\n\tGeneric output streams - generalise between outputting to a file,\n\ta buffer, etc.\n*/\ntypedef struct fz_output_s fz_output;\n\nstruct fz_output_s\n{\n\tfz_context *ctx;\n\tvoid *opaque;\n\tint (*printf)(fz_output *, const char *, va_list ap);\n\tint (*write)(fz_output *, const void *, int n);\n\tvoid (*close)(fz_output *);\n};\n\n/*\n\tfz_new_output_with_file: Open an output stream onto a FILE *.\n\n\tThe stream does NOT take ownership of the FILE *.\n*/\nfz_output *fz_new_output_with_file(fz_context *, FILE *);\n\n/*\n\tfz_new_output_to_filename: Open an output stream to a filename.\n*/\nfz_output *fz_new_output_to_filename(fz_context *, const char *filename);\n\n/*\n\tfz_new_output_with_buffer: Open an output stream onto a buffer.\n\n\tThe stream does NOT take ownership of the buffer.\n*/\nfz_output *fz_new_output_with_buffer(fz_context *, fz_buffer *);\n\n/*\n\tfz_printf: fprintf equivalent for output streams.\n*/\nint fz_printf(fz_output *, const char *, ...);\n\n/*\n\tfz_puts: fputs equivalent for output streams.\n*/\nint fz_puts(fz_output *, const char *);\n\n/*\n\tfz_write: fwrite equivalent for output streams.\n*/\nint fz_write(fz_output *out, const void *data, int len);\n\n/*\n\tfz_putc: putc equivalent for output streams.\n*/\nvoid fz_putc(fz_output *out, char c);\n\n/*\n\tfz_close_output: Close a previously opened fz_output stream.\n\n\tNote: whether or not this closes the underlying output method is\n\tmethod dependent. FILE * streams created by fz_new_output_with_file\n\tare NOT closed.\n*/\nvoid fz_close_output(fz_output *);\n\nvoid fz_rebind_output(fz_output *, fz_context *ctx);\n\nstatic inline int fz_write_int32be(fz_output *out, int x)\n{\n\tchar data[4];\n\n\tdata[0] = x>>24;\n\tdata[1] = x>>16;\n\tdata[2] = x>>8;\n\tdata[3] = x;\n\n\treturn fz_write(out, data, 4);\n}\n\nstatic inline void\nfz_write_byte(fz_output *out, int x)\n{\n\tchar data = x;\n\n\tfz_write(out, &data, 1);\n}\n\n/*\n\tfz_vsnprintf: Our customised vsnprintf routine. Takes %c, %d, %o, %s, %x, as usual.\n\tModifiers are not supported except for zero-padding ints (e.g. %02d, %03o, %04x, etc).\n\t%f and %g both output in \"as short as possible hopefully lossless non-exponent\" form,\n\tsee fz_ftoa for specifics.\n\t%C outputs a utf8 encoded int.\n\t%M outputs a fz_matrix*. %R outputs a fz_rect*. %P outputs a fz_point*.\n\t%q and %( output escaped strings in C/PDF syntax.\n*/\nint fz_vsnprintf(char *buffer, int space, const char *fmt, va_list args);\n\n/*\n\tfz_vfprintf: Our customised vfprintf routine. Same supported\n\tformat specifiers as for fz_vsnprintf.\n*/\nint fz_vfprintf(fz_context *ctx, FILE *file, const char *fmt, va_list ap);\n\n\nint fz_snprintf(char *buffer, int space, const char *fmt, ...);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/path.h",
    "content": "#ifndef MUPDF_FITZ_PATH_H\n#define MUPDF_FITZ_PATH_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/math.h\"\n\n/*\n * Vector path buffer.\n * It can be stroked and dashed, or be filled.\n * It has a fill rule (nonzero or even_odd).\n *\n * When rendering, they are flattened, stroked and dashed straight\n * into the Global Edge List.\n */\n\ntypedef struct fz_path_s fz_path;\ntypedef struct fz_stroke_state_s fz_stroke_state;\n\ntypedef enum fz_path_command_e\n{\n\tFZ_MOVETO = 'M',\n\tFZ_LINETO = 'L',\n\tFZ_CURVETO = 'C',\n\tFZ_CLOSE_PATH = 'Z',\n} fz_path_item_kind;\n\ntypedef enum fz_linecap_e\n{\n\tFZ_LINECAP_BUTT = 0,\n\tFZ_LINECAP_ROUND = 1,\n\tFZ_LINECAP_SQUARE = 2,\n\tFZ_LINECAP_TRIANGLE = 3\n} fz_linecap;\n\ntypedef enum fz_linejoin_e\n{\n\tFZ_LINEJOIN_MITER = 0,\n\tFZ_LINEJOIN_ROUND = 1,\n\tFZ_LINEJOIN_BEVEL = 2,\n\tFZ_LINEJOIN_MITER_XPS = 3\n} fz_linejoin;\n\nstruct fz_path_s\n{\n\tint cmd_len, cmd_cap;\n\tunsigned char *cmds;\n\tint coord_len, coord_cap;\n\tfloat *coords;\n\tfz_point current;\n\tfz_point begin;\n\tint last_cmd;\n};\n\nstruct fz_stroke_state_s\n{\n\tint refs;\n\tfz_linecap start_cap, dash_cap, end_cap;\n\tfz_linejoin linejoin;\n\tfloat linewidth;\n\tfloat miterlimit;\n\tfloat dash_phase;\n\tint dash_len;\n\tfloat dash_list[32];\n};\n\nfz_path *fz_new_path(fz_context *ctx);\nfz_point fz_currentpoint(fz_context *ctx, fz_path *path);\nvoid fz_moveto(fz_context*, fz_path*, float x, float y);\nvoid fz_lineto(fz_context*, fz_path*, float x, float y);\nvoid fz_curveto(fz_context*,fz_path*, float, float, float, float, float, float);\nvoid fz_curvetov(fz_context*,fz_path*, float, float, float, float);\nvoid fz_curvetoy(fz_context*,fz_path*, float, float, float, float);\nvoid fz_closepath(fz_context*,fz_path*);\nvoid fz_free_path(fz_context *ctx, fz_path *path);\n\nvoid fz_transform_path(fz_context *ctx, fz_path *path, const fz_matrix *transform);\n\nfz_path *fz_clone_path(fz_context *ctx, fz_path *old);\n\nfz_rect *fz_bound_path(fz_context *ctx, fz_path *path, const fz_stroke_state *stroke, const fz_matrix *ctm, fz_rect *r);\nfz_rect *fz_adjust_rect_for_stroke(fz_rect *r, const fz_stroke_state *stroke, const fz_matrix *ctm);\n\nextern const fz_stroke_state fz_default_stroke_state;\n\nfz_stroke_state *fz_new_stroke_state(fz_context *ctx);\nfz_stroke_state *fz_new_stroke_state_with_dash_len(fz_context *ctx, int len);\nfz_stroke_state *fz_keep_stroke_state(fz_context *ctx, fz_stroke_state *stroke);\nvoid fz_drop_stroke_state(fz_context *ctx, fz_stroke_state *stroke);\nfz_stroke_state *fz_unshare_stroke_state(fz_context *ctx, fz_stroke_state *shared);\nfz_stroke_state *fz_unshare_stroke_state_with_dash_len(fz_context *ctx, fz_stroke_state *shared, int len);\nfz_stroke_state *fz_clone_stroke_state(fz_context *ctx, fz_stroke_state *stroke);\n\n#ifndef NDEBUG\nvoid fz_print_path(fz_context *ctx, FILE *out, fz_path *, int indent);\n#endif\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/pixmap.h",
    "content": "#ifndef MUPDF_FITZ_PIXMAP_H\n#define MUPDF_FITZ_PIXMAP_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/math.h\"\n#include \"mupdf/fitz/store.h\"\n#include \"mupdf/fitz/colorspace.h\"\n\n/*\n\tPixmaps represent a set of pixels for a 2 dimensional region of a\n\tplane. Each pixel has n components per pixel, the last of which is\n\talways alpha. The data is in premultiplied alpha when rendering, but\n\tnon-premultiplied for colorspace conversions and rescaling.\n*/\ntypedef struct fz_pixmap_s fz_pixmap;\n\n/*\n\tfz_pixmap_bbox: Return the bounding box for a pixmap.\n*/\nfz_irect *fz_pixmap_bbox(fz_context *ctx, fz_pixmap *pix, fz_irect *bbox);\n\n/*\n\tfz_pixmap_width: Return the width of the pixmap in pixels.\n*/\nint fz_pixmap_width(fz_context *ctx, fz_pixmap *pix);\n\n/*\n\tfz_pixmap_height: Return the height of the pixmap in pixels.\n*/\nint fz_pixmap_height(fz_context *ctx, fz_pixmap *pix);\n\n/*\n\tfz_new_pixmap: Create a new pixmap, with it's origin at (0,0)\n\n\tcs: The colorspace to use for the pixmap, or NULL for an alpha\n\tplane/mask.\n\n\tw: The width of the pixmap (in pixels)\n\n\th: The height of the pixmap (in pixels)\n\n\tReturns a pointer to the new pixmap. Throws exception on failure to\n\tallocate.\n*/\nfz_pixmap *fz_new_pixmap(fz_context *ctx, fz_colorspace *cs, int w, int h);\n\n/*\n\tfz_new_pixmap_with_bbox: Create a pixmap of a given size,\n\tlocation and pixel format.\n\n\tThe bounding box specifies the size of the created pixmap and\n\twhere it will be located. The colorspace determines the number\n\tof components per pixel. Alpha is always present. Pixmaps are\n\treference counted, so drop references using fz_drop_pixmap.\n\n\tcolorspace: Colorspace format used for the created pixmap. The\n\tpixmap will keep a reference to the colorspace.\n\n\tbbox: Bounding box specifying location/size of created pixmap.\n\n\tReturns a pointer to the new pixmap. Throws exception on failure to\n\tallocate.\n*/\nfz_pixmap *fz_new_pixmap_with_bbox(fz_context *ctx, fz_colorspace *colorspace, const fz_irect *bbox);\n\n/*\n\tfz_new_pixmap_with_data: Create a new pixmap, with it's origin at\n\t(0,0) using the supplied data block.\n\n\tcs: The colorspace to use for the pixmap, or NULL for an alpha\n\tplane/mask.\n\n\tw: The width of the pixmap (in pixels)\n\n\th: The height of the pixmap (in pixels)\n\n\tsamples: The data block to keep the samples in.\n\n\tReturns a pointer to the new pixmap. Throws exception on failure to\n\tallocate.\n*/\nfz_pixmap *fz_new_pixmap_with_data(fz_context *ctx, fz_colorspace *colorspace, int w, int h, unsigned char *samples);\n\n/*\n\tfz_new_pixmap_with_bbox_and_data: Create a pixmap of a given size,\n\tlocation and pixel format, using the supplied data block.\n\n\tThe bounding box specifies the size of the created pixmap and\n\twhere it will be located. The colorspace determines the number\n\tof components per pixel. Alpha is always present. Pixmaps are\n\treference counted, so drop references using fz_drop_pixmap.\n\n\tcolorspace: Colorspace format used for the created pixmap. The\n\tpixmap will keep a reference to the colorspace.\n\n\tbbox: Bounding box specifying location/size of created pixmap.\n\n\tsamples: The data block to keep the samples in.\n\n\tReturns a pointer to the new pixmap. Throws exception on failure to\n\tallocate.\n*/\nfz_pixmap *fz_new_pixmap_with_bbox_and_data(fz_context *ctx, fz_colorspace *colorspace, const fz_irect *rect, unsigned char *samples);\n\n/*\n\tfz_keep_pixmap: Take a reference to a pixmap.\n\n\tpix: The pixmap to increment the reference for.\n\n\tReturns pix. Does not throw exceptions.\n*/\nfz_pixmap *fz_keep_pixmap(fz_context *ctx, fz_pixmap *pix);\n\n/*\n\tfz_drop_pixmap: Drop a reference and free a pixmap.\n\n\tDecrement the reference count for the pixmap. When no\n\treferences remain the pixmap will be freed.\n\n\tDoes not throw exceptions.\n*/\nvoid fz_drop_pixmap(fz_context *ctx, fz_pixmap *pix);\n\n/*\n\tfz_pixmap_colorspace: Return the colorspace of a pixmap\n\n\tReturns colorspace. Does not throw exceptions.\n*/\nfz_colorspace *fz_pixmap_colorspace(fz_context *ctx, fz_pixmap *pix);\n\n/*\n\tfz_pixmap_components: Return the number of components in a pixmap.\n\n\tReturns the number of components. Does not throw exceptions.\n*/\nint fz_pixmap_components(fz_context *ctx, fz_pixmap *pix);\n\n/*\n\tfz_pixmap_samples: Returns a pointer to the pixel data of a pixmap.\n\n\tReturns the pointer. Does not throw exceptions.\n*/\nunsigned char *fz_pixmap_samples(fz_context *ctx, fz_pixmap *pix);\n\nvoid fz_pixmap_set_resolution(fz_pixmap *pix, int res);\n\n/*\n\tfz_clear_pixmap_with_value: Clears a pixmap with the given value.\n\n\tpix: The pixmap to clear.\n\n\tvalue: Values in the range 0 to 255 are valid. Each component\n\tsample for each pixel in the pixmap will be set to this value,\n\twhile alpha will always be set to 255 (non-transparent).\n\n\tDoes not throw exceptions.\n*/\nvoid fz_clear_pixmap_with_value(fz_context *ctx, fz_pixmap *pix, int value);\n\n/*\n\tfz_clear_pixmap_with_value: Clears a subrect of a pixmap with the given value.\n\n\tpix: The pixmap to clear.\n\n\tvalue: Values in the range 0 to 255 are valid. Each component\n\tsample for each pixel in the pixmap will be set to this value,\n\twhile alpha will always be set to 255 (non-transparent).\n\n\tr: the rectangle.\n\n\tDoes not throw exceptions.\n*/\nvoid fz_clear_pixmap_rect_with_value(fz_context *ctx, fz_pixmap *pix, int value, const fz_irect *r);\n\n/*\n\tfz_clear_pixmap_with_value: Sets all components (including alpha) of\n\tall pixels in a pixmap to 0.\n\n\tpix: The pixmap to clear.\n\n\tDoes not throw exceptions.\n*/\nvoid fz_clear_pixmap(fz_context *ctx, fz_pixmap *pix);\n\n/*\n\tfz_invert_pixmap: Invert all the pixels in a pixmap. All components\n\tof all pixels are inverted (except alpha, which is unchanged).\n\n\tDoes not throw exceptions.\n*/\nvoid fz_invert_pixmap(fz_context *ctx, fz_pixmap *pix);\n\n/*\n\tfz_tint_pixmap: Tint all the pixels in an RGB or Gray pixmap.\n\n\tMultiplies all the samples with the input color argument.\n\n\tr,g,b: The color to tint with, in 0 to 255 range.\n*/\nvoid fz_tint_pixmap(fz_context *ctx, fz_pixmap *pix, int r, int g, int b);\n\n/*\n\tfz_invert_pixmap: Invert all the pixels in a given rectangle of a\n\tpixmap. All components of all pixels in the rectangle are inverted\n\t(except alpha, which is unchanged).\n\n\tDoes not throw exceptions.\n*/\nvoid fz_invert_pixmap_rect(fz_pixmap *image, const fz_irect *rect);\n\n/*\n\tfz_gamma_pixmap: Apply gamma correction to a pixmap. All components\n\tof all pixels are modified (except alpha, which is unchanged).\n\n\tgamma: The gamma value to apply; 1.0 for no change.\n\n\tDoes not throw exceptions.\n*/\nvoid fz_gamma_pixmap(fz_context *ctx, fz_pixmap *pix, float gamma);\n\n/*\n\tfz_unmultiply_pixmap: Convert a pixmap from premultiplied to\n\tnon-premultiplied format.\n\n\tDoes not throw exceptions.\n*/\nvoid fz_unmultiply_pixmap(fz_context *ctx, fz_pixmap *pix);\n\n/*\n\tfz_convert_pixmap: Convert from one pixmap to another (assumed to be\n\tthe same size, but possibly with a different colorspace).\n\n\tdst: the source pixmap.\n\n\tsrc: the destination pixmap.\n*/\nvoid fz_convert_pixmap(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src);\n\n/*\n\tPixmaps represent a set of pixels for a 2 dimensional region of a\n\tplane. Each pixel has n components per pixel, the last of which is\n\talways alpha. The data is in premultiplied alpha when rendering, but\n\tnon-premultiplied for colorspace conversions and rescaling.\n\n\tx, y: The minimum x and y coord of the region in pixels.\n\n\tw, h: The width and height of the region in pixels.\n\n\tn: The number of color components in the image. Always\n\tincludes a separate alpha channel. For mask images n=1, for greyscale\n\t(plus alpha) images n=2, for rgb (plus alpha) images n=3.\n\n\tinterpolate: A boolean flag set to non-zero if the image\n\twill be drawn using linear interpolation, or set to zero if\n\timage will be using nearest neighbour sampling.\n\n\txres, yres: Image resolution in dpi. Default is 96 dpi.\n\n\tcolorspace: Pointer to a colorspace object describing the colorspace\n\tthe pixmap is in. If NULL, the image is a mask.\n\n\tsamples: A simple block of memory w * h * n bytes of memory in which\n\tthe components are stored. The first n bytes are components 0 to n-1\n\tfor the pixel at (x,y). Each successive n bytes gives another pixel\n\tin scanline order. Subsequent scanlines follow on with no padding.\n\n\tfree_samples: Is zero when an application has provided its own\n\tbuffer for pixel data through fz_new_pixmap_with_bbox_and_data.\n\tIf not zero the buffer will be freed when fz_drop_pixmap is\n\tcalled for the pixmap.\n*/\nstruct fz_pixmap_s\n{\n\tfz_storable storable;\n\tint x, y, w, h, n;\n\tint interpolate;\n\tint xres, yres;\n\tfz_colorspace *colorspace;\n\tunsigned char *samples;\n\tint free_samples;\n};\n\nvoid fz_free_pixmap_imp(fz_context *ctx, fz_storable *pix);\n\nvoid fz_copy_pixmap_rect(fz_context *ctx, fz_pixmap *dest, fz_pixmap *src, const fz_irect *r);\nvoid fz_premultiply_pixmap(fz_context *ctx, fz_pixmap *pix);\nfz_pixmap *fz_alpha_from_gray(fz_context *ctx, fz_pixmap *gray, int luminosity);\nunsigned int fz_pixmap_size(fz_context *ctx, fz_pixmap *pix);\n\nfz_pixmap *fz_scale_pixmap(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_irect *clip);\n\ntypedef struct fz_scale_cache_s fz_scale_cache;\n\nfz_scale_cache *fz_new_scale_cache(fz_context *ctx);\nvoid fz_free_scale_cache(fz_context *ctx, fz_scale_cache *cache);\nfz_pixmap *fz_scale_pixmap_cached(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, const fz_irect *clip, fz_scale_cache *cache_x, fz_scale_cache *cache_y);\n\nvoid fz_subsample_pixmap(fz_context *ctx, fz_pixmap *tile, int factor);\n\nfz_irect *fz_pixmap_bbox_no_ctx(fz_pixmap *src, fz_irect *bbox);\n\nvoid fz_decode_tile(fz_pixmap *pix, float *decode);\nvoid fz_decode_indexed_tile(fz_pixmap *pix, float *decode, int maxval);\nvoid fz_unpack_tile(fz_pixmap *dst, unsigned char * restrict src, int n, int depth, int stride, int scale);\n\n/*\n\tfz_md5_pixmap: Return the md5 digest for a pixmap\n*/\nvoid fz_md5_pixmap(fz_pixmap *pixmap, unsigned char digest[16]);\n\nfz_pixmap *fz_new_pixmap_from_8bpp_data(fz_context *ctx, int x, int y, int w, int h, unsigned char *sp, int span);\nfz_pixmap *fz_new_pixmap_from_1bpp_data(fz_context *ctx, int x, int y, int w, int h, unsigned char *sp, int span);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/shade.h",
    "content": "#ifndef MUPDF_FITZ_SHADE_H\n#define MUPDF_FITZ_SHADE_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/math.h\"\n#include \"mupdf/fitz/store.h\"\n#include \"mupdf/fitz/colorspace.h\"\n#include \"mupdf/fitz/pixmap.h\"\n#include \"mupdf/fitz/compressed-buffer.h\"\n\n/*\n * The shading code uses gouraud shaded triangle meshes.\n */\n\nenum\n{\n\tFZ_FUNCTION_BASED = 1,\n\tFZ_LINEAR = 2,\n\tFZ_RADIAL = 3,\n\tFZ_MESH_TYPE4 = 4,\n\tFZ_MESH_TYPE5 = 5,\n\tFZ_MESH_TYPE6 = 6,\n\tFZ_MESH_TYPE7 = 7\n};\n\ntypedef struct fz_shade_s fz_shade;\n\nstruct fz_shade_s\n{\n\tfz_storable storable;\n\n\tfz_rect bbox;\t\t/* can be fz_infinite_rect */\n\tfz_colorspace *colorspace;\n\n\tfz_matrix matrix;\t/* matrix from pattern dict */\n\tint use_background;\t/* background color for fills but not 'sh' */\n\tfloat background[FZ_MAX_COLORS];\n\n\tint use_function;\n\tfloat function[256][FZ_MAX_COLORS + 1];\n\n\tint type; /* function, linear, radial, mesh */\n\tunion\n\t{\n\t\tstruct\n\t\t{\n\t\t\tint extend[2];\n\t\t\tfloat coords[2][3]; /* (x,y,r) twice */\n\t\t} l_or_r;\n\t\tstruct\n\t\t{\n\t\t\tint vprow;\n\t\t\tint bpflag;\n\t\t\tint bpcoord;\n\t\t\tint bpcomp;\n\t\t\tfloat x0, x1;\n\t\t\tfloat y0, y1;\n\t\t\tfloat c0[FZ_MAX_COLORS];\n\t\t\tfloat c1[FZ_MAX_COLORS];\n\t\t} m;\n\t\tstruct\n\t\t{\n\t\t\tfz_matrix matrix;\n\t\t\tint xdivs;\n\t\t\tint ydivs;\n\t\t\tfloat domain[2][2];\n\t\t\tfloat *fn_vals;\n\t\t} f;\n\t} u;\n\n\tfz_compressed_buffer *buffer;\n};\n\nfz_shade *fz_keep_shade(fz_context *ctx, fz_shade *shade);\nvoid fz_drop_shade(fz_context *ctx, fz_shade *shade);\nvoid fz_free_shade_imp(fz_context *ctx, fz_storable *shade);\n\nfz_rect *fz_bound_shade(fz_context *ctx, fz_shade *shade, const fz_matrix *ctm, fz_rect *r);\nvoid fz_paint_shade(fz_context *ctx, fz_shade *shade, const fz_matrix *ctm, fz_pixmap *dest, const fz_irect *bbox);\n\n/*\n *\tHandy routine for processing mesh based shades\n */\ntypedef struct fz_vertex_s fz_vertex;\n\nstruct fz_vertex_s\n{\n\tfz_point p;\n\tfloat c[FZ_MAX_COLORS];\n};\n\ntypedef struct fz_mesh_processor_s fz_mesh_processor;\n\ntypedef void (fz_mesh_prepare_fn)(void *arg, fz_vertex *v, const float *c);\ntypedef void (fz_mesh_process_fn)(void *arg, fz_vertex *av, fz_vertex *bv, fz_vertex *cv);\n\nstruct fz_mesh_processor_s {\n\tfz_context *ctx;\n\tfz_shade *shade;\n\tfz_mesh_prepare_fn *prepare;\n\tfz_mesh_process_fn *process;\n\tvoid *process_arg;\n\tint ncomp;\n};\n\nvoid fz_process_mesh(fz_context *ctx, fz_shade *shade, const fz_matrix *ctm,\n\t\t\tfz_mesh_prepare_fn *prepare, fz_mesh_process_fn *process, void *process_arg);\n\n#ifndef NDEBUG\nvoid fz_print_shade(fz_context *ctx, FILE *out, fz_shade *shade);\n#endif\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/store.h",
    "content": "#ifndef MUPDF_FITZ_STORE_H\n#define MUPDF_FITZ_STORE_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n\n/*\n\tResource store\n\n\tMuPDF stores decoded \"objects\" into a store for potential reuse.\n\tIf the size of the store gets too big, objects stored within it can\n\tbe evicted and freed to recover space. When MuPDF comes to decode\n\tsuch an object, it will check to see if a version of this object is\n\talready in the store - if it is, it will simply reuse it. If not, it\n\twill decode it and place it into the store.\n\n\tAll objects that can be placed into the store are derived from the\n\tfz_storable type (i.e. this should be the first component of the\n\tobjects structure). This allows for consistent (thread safe)\n\treference counting, and includes a function that will be called to\n\tfree the object as soon as the reference count reaches zero.\n\n\tMost objects offer fz_keep_XXXX/fz_drop_XXXX functions derived\n\tfrom fz_keep_storable/fz_drop_storable. Creation of such objects\n\tincludes a call to FZ_INIT_STORABLE to set up the fz_storable header.\n */\n\ntypedef struct fz_storable_s fz_storable;\n\ntypedef void (fz_store_free_fn)(fz_context *, fz_storable *);\n\nstruct fz_storable_s {\n\tint refs;\n\tfz_store_free_fn *free;\n};\n\n#define FZ_INIT_STORABLE(S_,RC,FREE) \\\n\tdo { fz_storable *S = &(S_)->storable; S->refs = (RC); \\\n\tS->free = (FREE); \\\n\t} while (0)\n\nvoid *fz_keep_storable(fz_context *, fz_storable *);\nvoid fz_drop_storable(fz_context *, fz_storable *);\n\n/*\n\tThe store can be seen as a dictionary that maps keys to fz_storable\n\tvalues. In order to allow keys of different types to be stored, we\n\thave a structure full of functions for each key 'type'; this\n\tfz_store_type pointer is stored with each key, and tells the store\n\thow to perform certain operations (like taking/dropping a reference,\n\tcomparing two keys, outputting details for debugging etc).\n\n\tThe store uses a hash table internally for speed where possible. In\n\torder for this to work, we need a mechanism for turning a generic\n\t'key' into 'a hashable string'. For this purpose the type structure\n\tcontains a make_hash_key function pointer that maps from a void *\n\tto an fz_store_hash structure. If make_hash_key function returns 0,\n\tthen the key is determined not to be hashable, and the value is\n\tnot stored in the hash table.\n*/\ntypedef struct fz_store_hash_s fz_store_hash;\n\nstruct fz_store_hash_s\n{\n\tfz_store_free_fn *free;\n\tunion\n\t{\n\t\tstruct\n\t\t{\n\t\t\tint i0;\n\t\t\tint i1;\n\t\t\tvoid *ptr;\n\t\t} i;\n\t\tstruct\n\t\t{\n\t\t\tvoid *ptr;\n\t\t\tint i;\n\t\t} pi;\n\t\tstruct\n\t\t{\n\t\t\tint id;\n\t\t\tfloat m[4];\n\t\t} im;\n\t} u;\n};\n\ntypedef struct fz_store_type_s fz_store_type;\n\nstruct fz_store_type_s\n{\n\tint (*make_hash_key)(fz_store_hash *, void *);\n\tvoid *(*keep_key)(fz_context *,void *);\n\tvoid (*drop_key)(fz_context *,void *);\n\tint (*cmp_key)(void *, void *);\n#ifndef NDEBUG\n\tvoid (*debug)(FILE *, void *);\n#endif\n};\n\n/*\n\tfz_store_new_context: Create a new store inside the context\n\n\tmax: The maximum size (in bytes) that the store is allowed to grow\n\tto. FZ_STORE_UNLIMITED means no limit.\n*/\nvoid fz_new_store_context(fz_context *ctx, unsigned int max);\n\n/*\n\tfz_drop_store_context: Drop a reference to the store.\n*/\nvoid fz_drop_store_context(fz_context *ctx);\n\n/*\n\tfz_keep_store_context: Take a reference to the store.\n*/\nfz_store *fz_keep_store_context(fz_context *ctx);\n\n/*\n\tfz_store_item: Add an item to the store.\n\n\tAdd an item into the store, returning NULL for success. If an item\n\twith the same key is found in the store, then our item will not be\n\tinserted, and the function will return a pointer to that value\n\tinstead. This function takes its own reference to val, as required\n\t(i.e. the caller maintains ownership of its own reference).\n\n\tkey: The key to use to index the item.\n\n\tval: The value to store.\n\n\titemsize: The size in bytes of the value (as counted towards the\n\tstore size).\n\n\ttype: Functions used to manipulate the key.\n*/\nvoid *fz_store_item(fz_context *ctx, void *key, void *val, unsigned int itemsize, fz_store_type *type);\n\n/*\n\tfz_find_item: Find an item within the store.\n\n\tfree: The function used to free the value (to ensure we get a value\n\tof the correct type).\n\n\tkey: The key to use to index the item.\n\n\ttype: Functions used to manipulate the key.\n\n\tReturns NULL for not found, otherwise returns a pointer to the value\n\tindexed by key to which a reference has been taken.\n*/\nvoid *fz_find_item(fz_context *ctx, fz_store_free_fn *free, void *key, fz_store_type *type);\n\n/*\n\tfz_remove_item: Remove an item from the store.\n\n\tIf an item indexed by the given key exists in the store, remove it.\n\n\tfree: The function used to free the value (to ensure we get a value\n\tof the correct type).\n\n\tkey: The key to use to find the item to remove.\n\n\ttype: Functions used to manipulate the key.\n*/\nvoid fz_remove_item(fz_context *ctx, fz_store_free_fn *free, void *key, fz_store_type *type);\n\n/*\n\tfz_empty_store: Evict everything from the store.\n*/\nvoid fz_empty_store(fz_context *ctx);\n\n/*\n\tfz_store_scavenge: Internal function used as part of the scavenging\n\tallocator; when we fail to allocate memory, before returning a\n\tfailure to the caller, we try to scavenge space within the store by\n\tevicting at least 'size' bytes. The allocator then retries.\n\n\tsize: The number of bytes we are trying to have free.\n\n\tphase: What phase of the scavenge we are in. Updated on exit.\n\n\tReturns non zero if we managed to free any memory.\n*/\nint fz_store_scavenge(fz_context *ctx, unsigned int size, int *phase);\n\n/*\n\tfz_shrink_store: Evict items from the store until the total size of\n\tthe objects in the store is reduced to a given percentage of its\n\tcurrent size.\n\n\tpercent: %age of current size to reduce the store to.\n\n\tReturns non zero if we managed to free enough memory, zero otherwise.\n*/\nint fz_shrink_store(fz_context *ctx, unsigned int percent);\n\n/*\n\tfz_print_store: Dump the contents of the store for debugging.\n*/\n#ifndef NDEBUG\nvoid fz_print_store(fz_context *ctx, FILE *out);\nvoid fz_print_store_locked(fz_context *ctx, FILE *out);\n#endif\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/stream.h",
    "content": "#ifndef MUPDF_FITZ_STREAM_H\n#define MUPDF_FITZ_STREAM_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/buffer.h\"\n\n/*\n\tfz_stream is a buffered reader capable of seeking in both\n\tdirections.\n\n\tStreams are reference counted, so references must be dropped\n\tby a call to fz_close.\n\n\tOnly the data between rp and wp is valid.\n*/\ntypedef struct fz_stream_s fz_stream;\n\n/*\n\tfz_open_file: Open the named file and wrap it in a stream.\n\n\tfilename: Path to a file. On non-Windows machines the filename should\n\tbe exactly as it would be passed to open(2). On Windows machines, the\n\tpath should be UTF-8 encoded so that non-ASCII characters can be\n\trepresented. Other platforms do the encoding as standard anyway (and\n\tin most cases, particularly for MacOS and Linux, the encoding they\n\tuse is UTF-8 anyway).\n*/\nfz_stream *fz_open_file(fz_context *ctx, const char *filename);\n\nfz_stream *fz_open_fd_progressive(fz_context *ctx, int fd, int bps);\nfz_stream *fz_open_file_progressive(fz_context *ctx, const char *filename, int bps);\n\n/*\n\tfz_open_file_w: Open the named file and wrap it in a stream.\n\n\tThis function is only available when compiling for Win32.\n\n\tfilename: Wide character path to the file as it would be given\n\tto _wopen().\n*/\nfz_stream *fz_open_file_w(fz_context *ctx, const wchar_t *filename);\n\n/*\n\tfz_open_fd: Wrap an open file descriptor in a stream.\n\n\tfile: An open file descriptor supporting bidirectional\n\tseeking. The stream will take ownership of the file\n\tdescriptor, so it may not be modified or closed after the call\n\tto fz_open_fd. When the stream is closed it will also close\n\tthe file descriptor.\n*/\nfz_stream *fz_open_fd(fz_context *ctx, int file);\n\n/*\n\tfz_open_memory: Open a block of memory as a stream.\n\n\tdata: Pointer to start of data block. Ownership of the data block is\n\tNOT passed in.\n\n\tlen: Number of bytes in data block.\n\n\tReturns pointer to newly created stream. May throw exceptions on\n\tfailure to allocate.\n*/\nfz_stream *fz_open_memory(fz_context *ctx, unsigned char *data, int len);\n\n/*\n\tfz_open_buffer: Open a buffer as a stream.\n\n\tbuf: The buffer to open. Ownership of the buffer is NOT passed in\n\t(this function takes it's own reference).\n\n\tReturns pointer to newly created stream. May throw exceptions on\n\tfailure to allocate.\n*/\nfz_stream *fz_open_buffer(fz_context *ctx, fz_buffer *buf);\n\n/* SumatraPDF: allow to clone a stream */\nfz_stream *fz_clone_stream(fz_context *ctx, fz_stream *stm);\n\n/*\n\tfz_open_leecher: Attach a filter to a stream that will store any\n\tcharacters read from the stream into the supplied buffer.\n\n\tchain: The underlying stream to leech from.\n\n\tbuf: The buffer into which the read data should be appended.\n\tThe buffer will be resized as required.\n\n\tReturns pointer to newly created stream. May throw exceptions on\n\tfailure to allocate.\n*/\nfz_stream *fz_open_leecher(fz_stream *chain, fz_buffer *buf);\n\n/*\n\tfz_close: Close an open stream.\n\n\tDrops a reference for the stream. Once no references remain\n\tthe stream will be closed, as will any file descriptor the\n\tstream is using.\n\n\tDoes not throw exceptions.\n*/\nvoid fz_close(fz_stream *stm);\n\n/*\n\tfz_tell: return the current reading position within a stream\n*/\nint fz_tell(fz_stream *stm);\n\n/*\n\tfz_seek: Seek within a stream.\n\n\tstm: The stream to seek within.\n\n\toffset: The offset to seek to.\n\n\twhence: From where the offset is measured (see fseek).\n*/\nvoid fz_seek(fz_stream *stm, int offset, int whence);\n\n/*\n\tfz_read: Read from a stream into a given data block.\n\n\tstm: The stream to read from.\n\n\tdata: The data block to read into.\n\n\tlen: The length of the data block (in bytes).\n\n\tReturns the number of bytes read. May throw exceptions.\n*/\nint fz_read(fz_stream *stm, unsigned char *data, int len);\n\n/*\n\tfz_read_all: Read all of a stream into a buffer.\n\n\tstm: The stream to read from\n\n\tinitial: Suggested initial size for the buffer.\n\n\tReturns a buffer created from reading from the stream. May throw\n\texceptions on failure to allocate.\n*/\nfz_buffer *fz_read_all(fz_stream *stm, int initial);\n\n/*\n\tfz_read_file: Read all the contents of a file into a buffer.\n*/\nfz_buffer *fz_read_file(fz_context *ctx, const char *filename);\n\nenum\n{\n\tFZ_STREAM_META_PROGRESSIVE = 1,\n\tFZ_STREAM_META_LENGTH = 2\n};\n\nint fz_stream_meta(fz_stream *stm, int key, int size, void *ptr);\n\nvoid fz_rebind_stream(fz_stream *stm, fz_context *ctx);\n\ntypedef int (fz_stream_next_fn)(fz_stream *stm, int max);\ntypedef void (fz_stream_close_fn)(fz_context *ctx, void *state);\ntypedef void (fz_stream_seek_fn)(fz_stream *stm, int offset, int whence);\ntypedef int (fz_stream_meta_fn)(fz_stream *stm, int key, int size, void *ptr);\ntypedef fz_stream *(fz_stream_rebind_fn)(fz_stream *stm);\n/* SumatraPDF: allow to clone a stream */\ntypedef fz_stream *(fz_stream_reopen_fn)(fz_context *ctx, fz_stream *stm);\n\nstruct fz_stream_s\n{\n\tfz_context *ctx;\n\tint refs;\n\tint error;\n\tint eof;\n\tint pos;\n\tint avail;\n\tint bits;\n\tunsigned char *rp, *wp;\n\tvoid *state;\n\tfz_stream_next_fn *next;\n\tfz_stream_close_fn *close;\n\tfz_stream_seek_fn *seek;\n\tfz_stream_meta_fn *meta;\n\tfz_stream_rebind_fn *rebind;\n\tfz_stream_reopen_fn *reopen; /* SumatraPDF: allow to clone a stream */\n};\n\nfz_stream *fz_new_stream(fz_context *ctx,\n\t\t\t void *state,\n\t\t\t fz_stream_next_fn *next,\n\t\t\t fz_stream_close_fn *close,\n\t\t\t fz_stream_rebind_fn *rebind);\nfz_stream *fz_keep_stream(fz_stream *stm);\n\n/*\n\tfz_read_best: Attempt to read a stream into a buffer. If truncated\n\tis NULL behaves as fz_read_all, otherwise does not throw exceptions\n\tin the case of failure, but instead sets a truncated flag.\n\n\tstm: The stream to read from.\n\n\tinitial: Suggested initial size for the buffer.\n\n\ttruncated: Flag to store success/failure indication in.\n\n\tReturns a buffer created from reading from the stream.\n*/\nfz_buffer *fz_read_best(fz_stream *stm, int initial, int *truncated);\n\nvoid fz_read_line(fz_stream *stm, char *buf, int max);\n\n/*\n\tfz_available: Ask how many bytes are available immediately from\n\ta given stream.\n\n\tstm: The stream to read from.\n\n\tmax: A hint for the underlying stream; the maximum number of\n\tbytes that we are sure we will want to read. If you do not know\n\tthis number, give 1.\n\n\tReturns the number of bytes immediately available between the\n\tread and write pointers. This number is guaranteed only to be 0\n\tif we have hit EOF. The number of bytes returned here need have\n\tno relation to max (could be larger, could be smaller).\n*/\nstatic inline int fz_available(fz_stream *stm, int max)\n{\n\tint len = stm->wp - stm->rp;\n\tint c = EOF;\n\n\tif (len)\n\t\treturn len;\n\tfz_try(stm->ctx)\n\t{\n\t\tc = stm->next(stm, max);\n\t}\n\tfz_catch(stm->ctx)\n\t{\n\t\tfz_rethrow_if(stm->ctx, FZ_ERROR_TRYLATER);\n\t\tfz_warn(stm->ctx, \"read error; treating as end of file\");\n\t\tstm->error = 1;\n\t\tc = EOF;\n\t}\n\tif (c == EOF)\n\t{\n\t\tstm->eof = 1;\n\t\treturn 0;\n\t}\n\tstm->rp--;\n\treturn stm->wp - stm->rp;\n}\n\nstatic inline int fz_read_byte(fz_stream *stm)\n{\n\tint c = EOF;\n\n\tif (stm->rp != stm->wp)\n\t\treturn *stm->rp++;\n\tfz_try(stm->ctx)\n\t{\n\t\tc = stm->next(stm, 1);\n\t}\n\tfz_catch(stm->ctx)\n\t{\n\t\tfz_rethrow_if(stm->ctx, FZ_ERROR_TRYLATER);\n\t\tfz_warn(stm->ctx, \"read error; treating as end of file\");\n\t\tstm->error = 1;\n\t\tc = EOF;\n\t}\n\tif (c == EOF)\n\t\tstm->eof = 1;\n\treturn c;\n}\n\nstatic inline int fz_peek_byte(fz_stream *stm)\n{\n\tint c;\n\n\tif (stm->rp != stm->wp)\n\t\treturn *stm->rp;\n\n\tc = stm->next(stm, 1);\n\tif (c != EOF)\n\t\tstm->rp--;\n\treturn c;\n}\n\nstatic inline void fz_unread_byte(fz_stream *stm)\n{\n\tstm->rp--;\n}\n\nstatic inline int fz_is_eof(fz_stream *stm)\n{\n\tif (stm->rp == stm->wp)\n\t{\n\t\tif (stm->eof)\n\t\t\treturn 1;\n\t\treturn fz_peek_byte(stm) == EOF;\n\t}\n\treturn 0;\n}\n\nstatic inline unsigned int fz_read_bits(fz_stream *stm, int n)\n{\n\tunsigned int x;\n\n\tif (n <= stm->avail)\n\t{\n\t\tstm->avail -= n;\n\t\tx = (stm->bits >> stm->avail) & ((1 << n) - 1);\n\t}\n\telse\n\t{\n\t\tx = stm->bits & ((1 << stm->avail) - 1);\n\t\tn -= stm->avail;\n\t\tstm->avail = 0;\n\n\t\twhile (n > 8)\n\t\t{\n\t\t\tx = (x << 8) | fz_read_byte(stm);\n\t\t\tn -= 8;\n\t\t}\n\n\t\tif (n > 0)\n\t\t{\n\t\t\tstm->bits = fz_read_byte(stm);\n\t\t\tstm->avail = 8 - n;\n\t\t\tx = (x << n) | (stm->bits >> stm->avail);\n\t\t}\n\t}\n\n\treturn x;\n}\n\nstatic inline void fz_sync_bits(fz_stream *stm)\n{\n\tstm->avail = 0;\n}\n\nstatic inline int fz_is_eof_bits(fz_stream *stm)\n{\n\treturn fz_is_eof(stm) && (stm->avail == 0 || stm->bits == EOF);\n}\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/string.h",
    "content": "#ifndef MUPDF_FITZ_STRING_H\n#define MUPDF_FITZ_STRING_H\n\n#include \"mupdf/fitz/system.h\"\n\n/*\n\tSafe string functions\n*/\n\n/*\n\tfz_strsep: Given a pointer to a C string (or a pointer to NULL) break\n\tit at the first occurence of a delimiter char (from a given set).\n\n\tstringp: Pointer to a C string pointer (or NULL). Updated on exit to\n\tpoint to the first char of the string after the delimiter that was\n\tfound. The string pointed to by stringp will be corrupted by this\n\tcall (as the found delimiter will be overwritten by 0).\n\n\tdelim: A C string of acceptable delimiter characters.\n\n\tReturns a pointer to a C string containing the chars of stringp up\n\tto the first delimiter char (or the end of the string), or NULL.\n*/\nchar *fz_strsep(char **stringp, const char *delim);\n\n/*\n\tfz_strlcpy: Copy at most n-1 chars of a string into a destination\n\tbuffer with null termination, returning the real length of the\n\tinitial string (excluding terminator).\n\n\tdst: Destination buffer, at least n bytes long.\n\n\tsrc: C string (non-NULL).\n\n\tn: Size of dst buffer in bytes.\n\n\tReturns the length (excluding terminator) of src.\n*/\nint fz_strlcpy(char *dst, const char *src, int n);\n\n/*\n\tfz_strlcat: Concatenate 2 strings, with a maximum length.\n\n\tdst: pointer to first string in a buffer of n bytes.\n\n\tsrc: pointer to string to concatenate.\n\n\tn: Size (in bytes) of buffer that dst is in.\n\n\tReturns the real length that a concatenated dst + src would have been\n\t(not including terminator).\n*/\nint fz_strlcat(char *dst, const char *src, int n);\n\n/*\n\tfz_dirname: extract the directory component from a path.\n*/\nvoid fz_dirname(char *dir, const char *path, int dirsize);\n\n/*\n\tfz_cleanname: rewrite path to the shortest string that names the same path.\n\n\tEliminates multiple and trailing slashes, interprets \".\" and \"..\".\n\tOverwrites the string in place.\n*/\nchar *fz_cleanname(char *name);\n\n/*\n\tfz_chartorune: UTF8 decode a single rune from a sequence of chars.\n\n\trune: Pointer to an int to assign the decoded 'rune' to.\n\n\tstr: Pointer to a UTF8 encoded string.\n\n\tReturns the number of bytes consumed. Does not throw exceptions.\n*/\nint fz_chartorune(int *rune, const char *str);\n\n/*\n\tfz_runetochar: UTF8 encode a rune to a sequence of chars.\n\n\tstr: Pointer to a place to put the UTF8 encoded character.\n\n\trune: Pointer to a 'rune'.\n\n\tReturns the number of bytes the rune took to output. Does not throw\n\texceptions.\n*/\nint fz_runetochar(char *str, int rune);\n\n/*\n\tfz_runelen: Count how many chars are required to represent a rune.\n\n\trune: The rune to encode.\n\n\tReturns the number of bytes required to represent this run in UTF8.\n*/\nint fz_runelen(int rune);\n\n/*\n\tfz_strtod: Locale-independent implementation of strtod().\n*/\ndouble fz_strtod(const char *s, char **es);\n\n/*\n\tfz_ftoa: Compute decimal integer m, exp such that:\n\t\tf = m * 10^exp\n\t\tm is as short as possible without losing exactness\n\tAssumes special cases (NaN, +Inf, -Inf) have been handled.\n*/\nvoid fz_ftoa(float f, char *s, int *exp, int *neg, int *ns);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/structured-text.h",
    "content": "#ifndef MUPDF_FITZ_STRUCTURED_TEXT_H\n#define MUPDF_FITZ_STRUCTURED_TEXT_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/math.h\"\n#include \"mupdf/fitz/font.h\"\n#include \"mupdf/fitz/colorspace.h\"\n#include \"mupdf/fitz/image.h\"\n#include \"mupdf/fitz/output.h\"\n#include \"mupdf/fitz/device.h\"\n\n/*\n\tText extraction device: Used for searching, format conversion etc.\n\n\t(In development - Subject to change in future versions)\n*/\n\ntypedef struct fz_text_style_s fz_text_style;\ntypedef struct fz_text_char_s fz_text_char;\ntypedef struct fz_text_span_s fz_text_span;\ntypedef struct fz_text_line_s fz_text_line;\ntypedef struct fz_text_block_s fz_text_block;\ntypedef struct fz_image_block_s fz_image_block;\ntypedef struct fz_page_block_s fz_page_block;\n\ntypedef struct fz_text_sheet_s fz_text_sheet;\ntypedef struct fz_text_page_s fz_text_page;\n\n/*\n\tfz_text_sheet: A text sheet contains a list of distinct text styles\n\tused on a page (or a series of pages).\n*/\nstruct fz_text_sheet_s\n{\n\tint maxid;\n\tfz_text_style *style;\n};\n\n/*\n\tfz_text_style: A text style contains details of a distinct text style\n\tused on a page.\n*/\nstruct fz_text_style_s\n{\n\tfz_text_style *next;\n\tint id;\n\tfz_font *font;\n\tfloat size;\n\tint wmode;\n\tint script;\n\tfloat ascender;\n\tfloat descender;\n\t/* etc... */\n};\n\n/*\n\tfz_text_page: A text page is a list of page blocks, together with\n\tan overall bounding box.\n*/\nstruct fz_text_page_s\n{\n\tfz_rect mediabox;\n\tint len, cap;\n\tfz_page_block *blocks;\n\tfz_text_page *next;\n};\n\n/*\n\tfz_page_block: A page block is a typed block pointer.\n*/\nstruct fz_page_block_s\n{\n\tint type;\n\tunion\n\t{\n\t\tfz_text_block *text;\n\t\tfz_image_block *image;\n\t} u;\n};\n\nenum\n{\n\tFZ_PAGE_BLOCK_TEXT = 0,\n\tFZ_PAGE_BLOCK_IMAGE = 1\n};\n\n/*\n\tfz_text_block: A text block is a list of lines of text. In typical\n\tcases this may correspond to a paragraph or a column of text. A\n\tcollection of blocks makes up a page.\n*/\nstruct fz_text_block_s\n{\n\tfz_rect bbox;\n\tint len, cap;\n\tfz_text_line *lines;\n};\n\n/*\n\tfz_image_block: An image block is an image, together with the  list of lines of text. In typical\n\tcases this may correspond to a paragraph or a column of text. A\n\tcollection of blocks makes up a page.\n*/\nstruct fz_image_block_s\n{\n\tfz_rect bbox;\n\tfz_matrix mat;\n\tfz_image *image;\n\tfz_colorspace *cspace;\n\tfloat colors[FZ_MAX_COLORS];\n};\n\n/*\n\tfz_text_line: A text line is a list of text spans, with the same\n\tbaseline. In typical cases this should correspond (as expected) to\n\tcomplete lines of text. A collection of lines makes up a block.\n*/\nstruct fz_text_line_s\n{\n\tfz_text_span *first_span, *last_span;\n\n\t/* Cached information */\n\tfloat distance; /* Perpendicular distance from previous line */\n\tfz_rect bbox;\n\tvoid *region; /* Opaque value for matching line masks */\n};\n\n/*\n\tfz_text_span: A text span is a list of characters that share a common\n\tbaseline/transformation. In typical cases a single span may be enough\n\tto represent a complete line. In cases where the text has big gaps in\n\tit (perhaps as it crosses columns or tables), a line may be represented\n\tby multiple spans.\n*/\nstruct fz_text_span_s\n{\n\tint len, cap;\n\tfz_text_char *text;\n\tfz_point min; /* Device space */\n\tfz_point max; /* Device space */\n\tint wmode; /* 0 for horizontal, 1 for vertical */\n\tfz_matrix transform; /* e and f are always 0 here */\n\tfloat ascender_max; /* Document space */\n\tfloat descender_min; /* Document space */\n\tfz_rect bbox; /* Device space */\n\n\t/* Cached information */\n\tfloat base_offset; /* Perpendicular distance from baseline of line */\n\tfloat spacing; /* Distance along baseline from previous span in this line (or 0 if first) */\n\tint column; /* If non zero, the column that it's in */\n\tfloat column_width; /* Percentage */\n\tint align; /* 0 = left, 1 = centre, 2 = right */\n\tfloat indent; /* The indent position for this column. */\n\n\tfz_text_span *next;\n};\n\n/*\n\tfz_text_char: A text char is a unicode character, the style in which\n\tis appears, and the point at which it is positioned. Transform\n\t(and hence bbox) information is given by the enclosing span.\n*/\nstruct fz_text_char_s\n{\n\tfz_point p; /* Device space */\n\tint c;\n\tfz_text_style *style;\n};\n\ntypedef struct fz_char_and_box_s fz_char_and_box;\n\nstruct fz_char_and_box_s\n{\n\tint c;\n\tfz_rect bbox;\n};\n\nfz_char_and_box *fz_text_char_at(fz_char_and_box *cab, fz_text_page *page, int idx);\n\n/*\n\tfz_text_char_bbox: Return the bbox of a text char. Calculated from\n\tthe supplied enclosing span.\n\n\tbbox: A place to store the bbox\n\n\tspan: The enclosing span\n\n\tidx: The index of the char within the span\n\n\tReturns bbox (updated)\n\n\tDoes not throw exceptions\n*/\nfz_rect *fz_text_char_bbox(fz_rect *bbox, fz_text_span *span, int idx);\n\n/*\n\tfz_new_text_sheet: Create an empty style sheet.\n\n\tThe style sheet is filled out by the text device, creating\n\tone style for each unique font, color, size combination that\n\tis used.\n*/\nfz_text_sheet *fz_new_text_sheet(fz_context *ctx);\nvoid fz_free_text_sheet(fz_context *ctx, fz_text_sheet *sheet);\n\n/*\n\tfz_new_text_page: Create an empty text page.\n\n\tThe text page is filled out by the text device to contain the blocks,\n\tlines and spans of text on the page.\n*/\nfz_text_page *fz_new_text_page(fz_context *ctx);\nvoid fz_free_text_page(fz_context *ctx, fz_text_page *page);\n\nvoid fz_analyze_text(fz_context *ctx, fz_text_sheet *sheet, fz_text_page *page);\n\n/*\n\tfz_print_text_sheet: Output a text sheet to a file as CSS.\n*/\nvoid fz_print_text_sheet(fz_context *ctx, fz_output *out, fz_text_sheet *sheet);\n\n/*\n\tfz_print_text_page_html: Output a page to a file in HTML format.\n*/\nvoid fz_print_text_page_html(fz_context *ctx, fz_output *out, fz_text_page *page);\n\n/*\n\tfz_print_text_page_xml: Output a page to a file in XML format.\n*/\nvoid fz_print_text_page_xml(fz_context *ctx, fz_output *out, fz_text_page *page);\n\n/*\n\tfz_print_text_page: Output a page to a file in UTF-8 format.\n*/\nvoid fz_print_text_page(fz_context *ctx, fz_output *out, fz_text_page *page);\n\n/*\n\tfz_search_text_page: Search for occurrence of 'needle' in text page.\n\n\tReturn the number of hits and store hit bboxes in the passed in array.\n\n\tNOTE: This is an experimental interface and subject to change without notice.\n*/\nint fz_search_text_page(fz_context *ctx, fz_text_page *text, const char *needle, fz_rect *hit_bbox, int hit_max);\n\n/*\n\tfz_highlight_selection: Return a list of rectangles to highlight given a selection rectangle.\n\n\tNOTE: This is an experimental interface and subject to change without notice.\n*/\nint fz_highlight_selection(fz_context *ctx, fz_text_page *page, fz_rect rect, fz_rect *hit_bbox, int hit_max);\n\n/*\n\tfz_copy_selection: Return a newly allocated UTF-8 string with the text for a given selection rectangle.\n\n\tNOTE: This is an experimental interface and subject to change without notice.\n*/\nchar *fz_copy_selection(fz_context *ctx, fz_text_page *page, fz_rect rect);\n\n/*\n\tfz_new_text_device: Create a device to extract the text on a page.\n\n\tGather and sort the text on a page into spans of uniform style,\n\tarranged into lines and blocks by reading order. The reading order\n\tis determined by various heuristics, so may not be accurate.\n\n\tsheet: The text sheet to which styles should be added. This can\n\teither be a newly created (empty) text sheet, or one containing\n\tstyles from a previous text device. The same sheet cannot be used\n\tin multiple threads simultaneously.\n\n\tpage: The text page to which content should be added. This will\n\tusually be a newly created (empty) text page, but it can be one\n\tcontaining data already (for example when merging multiple pages, or\n\twatermarking).\n*/\nfz_device *fz_new_text_device(fz_context *ctx, fz_text_sheet *sheet, fz_text_page *page);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/system.h",
    "content": "#ifndef MUPDF_FITZ_SYSTEM_H\n#define MUPDF_FITZ_SYSTEM_H\n\n/*\n\tInclude the standard libc headers.\n*/\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <stddef.h>\n#include <stdarg.h>\n#include <string.h>\n#include <math.h>\n\n#include <assert.h>\n#include <errno.h>\n#include <limits.h> /* INT_MAX & co */\n#include <float.h> /* FLT_EPSILON, FLT_MAX & co */\n#include <fcntl.h> /* O_RDONLY & co */\n#include <time.h>\n\n#include <setjmp.h>\n\n/* SumatraPDF: memento's license header can be read as being non-AGPLv3 */\n#ifndef MEMENTO\n#define MEMENTO_H\n#define Memento_label(ptr, label) (ptr)\n#else\n#include \"mupdf/memento.h\"\n#endif\n\n#define nelem(x) (sizeof(x)/sizeof((x)[0]))\n\n#ifndef M_PI\n#define M_PI 3.14159265358979323846\n#endif\n\n#ifndef M_SQRT2\n#define M_SQRT2 1.41421356237309504880\n#endif\n\n/*\n\tSome differences in libc can be smoothed over\n*/\n\n#ifdef __APPLE__\n#define HAVE_SIGSETJMP\n#elif defined(__unix)\n#define HAVE_SIGSETJMP\n#endif\n\n/*\n\tWhere possible (i.e. on platforms on which they are provided), use\n\tsigsetjmp/siglongjmp in preference to setjmp/longjmp. We don't alter\n\tsignal handlers within mupdf, so there is no need for us to\n\tstore/restore them - hence we use the non-restoring variants. This\n\tmakes a large speed difference on MacOSX (and probably other\n\tplatforms too.\n*/\n#ifdef HAVE_SIGSETJMP\n#define fz_setjmp(BUF) sigsetjmp(BUF, 0)\n#define fz_longjmp(BUF,VAL) siglongjmp(BUF, VAL)\n#define fz_jmp_buf sigjmp_buf\n#else\n#define fz_setjmp(BUF) setjmp(BUF)\n#define fz_longjmp(BUF,VAL) longjmp(BUF,VAL)\n#define fz_jmp_buf jmp_buf\n#endif\n\n#ifdef _MSC_VER /* Microsoft Visual C */\n\n/* MSVC up to VS2012 */\n#if _MSC_VER < 1800\n#define va_copy(a, oa) do { a=oa; } while (0)\n#define va_copy_end(a) do {} while(0)\n#else\n#define va_copy_end(a) va_end(a)\n#endif\n\ntypedef signed char int8_t;\ntypedef short int int16_t;\ntypedef int int32_t;\ntypedef __int64 int64_t;\n\ntypedef unsigned char uint8_t;\ntypedef unsigned short int uint16_t;\ntypedef unsigned int uint32_t;\ntypedef unsigned __int64 uint64_t;\n\n#pragma warning( disable: 4244 ) /* conversion from X to Y, possible loss of data */\n#pragma warning( disable: 4701 ) /* Potentially uninitialized local variable 'name' used */\n#pragma warning( disable: 4996 ) /* 'function': was declared deprecated */\n\n/* SumatraPDF: disable remaining warnings at warning level 4 */\n#pragma warning( disable: 4100 ) /* unreferenced formal parameter */\n#pragma warning( disable: 4127 ) /* conditional expression is constant */\n#pragma warning( disable: 4703 ) /* potentially uninitialized local variable (VS2012+) */\n#pragma warning( disable: 4456 ) /* declaration of '*' hides previous local declaration (VS2015+) */\n#pragma warning( disable: 4459 ) /* declaration of '*' hides global declaration (VS2015+) */\n\n#include <io.h>\n\nstruct timeval;\nstruct timezone;\nint gettimeofday(struct timeval *tv, struct timezone *tz);\n\n#define snprintf _snprintf\n#if _MSC_VER < 1800\n#define isnan(x) _isnan(x)\n#define isinf(x) (!_finite(x))\n#endif\n#define hypotf _hypotf\n\n#define fopen fz_fopen_utf8\n\nFILE *fz_fopen_utf8(const char *name, const char *mode);\n\n#define fopen fz_fopen_utf8\n\nchar *fz_utf8_from_wchar(const wchar_t *s);\nwchar_t *fz_wchar_from_utf8(const char *s);\n\nFILE *fz_fopen_utf8(const char *name, const char *mode);\nchar **fz_argv_from_wargv(int argc, wchar_t **wargv);\nvoid fz_free_argv(int argc, char **argv);\n\n#else /* Unix or close enough */\n\n#include <stdint.h>\n#include <unistd.h>\n\n#ifndef O_BINARY\n#define O_BINARY 0\n#endif\n\n#define va_copy_end(a) va_end(a)\n\n#endif\n\n#ifdef __ANDROID__\n#include <android/log.h>\n#define LOG_TAG \"libmupdf\"\n#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)\n#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)\n#else\n#define LOGI(...) do {} while(0)\n#define LOGE(...) do {} while(0)\n#endif\n\n/*\n\tVariadic macros, inline and restrict keywords\n\n\tinline is standard in C++, so don't touch the definition in this case.\n\tFor some compilers we can enable it within C too.\n*/\n\n#ifndef __cplusplus\n#if __STDC_VERSION__ == 199901L /* C99 */\n#elif _MSC_VER >= 1500 /* MSVC 9 or newer */\n#define inline __inline\n#elif __GNUC__ >= 3 /* GCC 3 or newer */\n#define inline __inline\n#else /* Unknown or ancient */\n#define inline\n#endif\n#endif\n\n/*\n\trestrict is standard in C99, but not in all C++ compilers. Enable\n\twhere possible, disable if in doubt.\n */\n#if __STDC_VERSION__ == 199901L /* C99 */\n#elif _MSC_VER >= 1500 /* MSVC 9 or newer */\n#define restrict __restrict\n#elif __GNUC__ >= 3 /* GCC 3 or newer */\n#define restrict __restrict\n#else /* Unknown or ancient */\n#define restrict\n#endif\n\n/* noreturn is a GCC extension */\n#ifdef __GNUC__\n#define FZ_NORETURN __attribute__((noreturn))\n#else\n#ifdef _MSC_VER\n#define FZ_NORETURN __declspec(noreturn)\n#else\n#define FZ_NORETURN\n#endif\n#endif\n\n/*\n\tGCC can do type checking of printf strings\n*/\n\n#ifndef __printflike\n#if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7\n#define __printflike(fmtarg, firstvararg) \\\n\t__attribute__((__format__ (__printf__, fmtarg, firstvararg)))\n#else\n#define __printflike(fmtarg, firstvararg)\n#endif\n#endif\n\n/*\n\tShut the compiler up about unused variables\n*/\n#define UNUSED(x) do { x = x; } while (0)\n\n/* ARM assembly specific defines */\n\n#ifdef ARCH_ARM\n#ifdef NDK_PROFILER\nextern void __gnu_mcount_nc(void);\n#define ENTER_PG \"push {lr}\\nbl __gnu_mcount_nc\\n\"\n#else\n#define ENTER_PG\n#endif\n\n/* If we're compiling as thumb code, then we need to tell the compiler\n * to enter and exit ARM mode around our assembly sections. If we move\n * the ARM functions to a separate file and arrange for it to be compiled\n * without thumb mode, we can save some time on entry.\n */\n/* This is slightly suboptimal; __thumb__ and __thumb2__ become defined\n * and undefined by #pragma arm/#pragma thumb - but we can't define a\n * macro to track that. */\n#if defined(__thumb__) || defined(__thumb2__)\n#define ENTER_ARM \".balign 4\\nmov r12,pc\\nbx r12\\n0:.arm\\n\" ENTER_PG\n#define ENTER_THUMB \"9:.thumb\\n\" ENTER_PG\n#else\n#define ENTER_ARM\n#define ENTER_THUMB\n#endif\n#endif\n\n#ifdef CLUSTER\n#define LOCAL_TRIG_FNS\n#endif\n\n#ifdef LOCAL_TRIG_FNS\n/*\n * Trig functions\n */\nstatic float\nmy_atan_table[258] =\n{\n0.0000000000f, 0.00390623013f,0.00781234106f,0.0117182136f,\n0.0156237286f, 0.0195287670f, 0.0234332099f, 0.0273369383f,\n0.0312398334f, 0.0351417768f, 0.0390426500f, 0.0429423347f,\n0.0468407129f, 0.0507376669f, 0.0546330792f, 0.0585268326f,\n0.0624188100f, 0.0663088949f, 0.0701969711f, 0.0740829225f,\n0.0779666338f, 0.0818479898f, 0.0857268758f, 0.0896031775f,\n0.0934767812f, 0.0973475735f, 0.1012154420f, 0.1050802730f,\n0.1089419570f, 0.1128003810f, 0.1166554350f, 0.1205070100f,\n0.1243549950f, 0.1281992810f, 0.1320397620f, 0.1358763280f,\n0.1397088740f, 0.1435372940f, 0.1473614810f, 0.1511813320f,\n0.1549967420f, 0.1588076080f, 0.1626138290f, 0.1664153010f,\n0.1702119250f, 0.1740036010f, 0.1777902290f, 0.1815717110f,\n0.1853479500f, 0.1891188490f, 0.1928843120f, 0.1966442450f,\n0.2003985540f, 0.2041471450f, 0.2078899270f, 0.2116268090f,\n0.2153577000f, 0.2190825110f, 0.2228011540f, 0.2265135410f,\n0.2302195870f, 0.2339192060f, 0.2376123140f, 0.2412988270f,\n0.2449786630f, 0.2486517410f, 0.2523179810f, 0.2559773030f,\n0.2596296290f, 0.2632748830f, 0.2669129880f, 0.2705438680f,\n0.2741674510f, 0.2777836630f, 0.2813924330f, 0.2849936890f,\n0.2885873620f, 0.2921733830f, 0.2957516860f, 0.2993222020f,\n0.3028848680f, 0.3064396190f, 0.3099863910f, 0.3135251230f,\n0.3170557530f, 0.3205782220f, 0.3240924700f, 0.3275984410f,\n0.3310960770f, 0.3345853220f, 0.3380661230f, 0.3415384250f,\n0.3450021770f, 0.3484573270f, 0.3519038250f, 0.3553416220f,\n0.3587706700f, 0.3621909220f, 0.3656023320f, 0.3690048540f,\n0.3723984470f, 0.3757830650f, 0.3791586690f, 0.3825252170f,\n0.3858826690f, 0.3892309880f, 0.3925701350f, 0.3959000740f,\n0.3992207700f, 0.4025321870f, 0.4058342930f, 0.4091270550f,\n0.4124104420f, 0.4156844220f, 0.4189489670f, 0.4222040480f,\n0.4254496370f, 0.4286857080f, 0.4319122350f, 0.4351291940f,\n0.4383365600f, 0.4415343100f, 0.4447224240f, 0.4479008790f,\n0.4510696560f, 0.4542287350f, 0.4573780990f, 0.4605177290f,\n0.4636476090f, 0.4667677240f, 0.4698780580f, 0.4729785980f,\n0.4760693300f, 0.4791502430f, 0.4822213240f, 0.4852825630f,\n0.4883339510f, 0.4913754780f, 0.4944071350f, 0.4974289160f,\n0.5004408130f, 0.5034428210f, 0.5064349340f, 0.5094171490f,\n0.5123894600f, 0.5153518660f, 0.5183043630f, 0.5212469510f,\n0.5241796290f, 0.5271023950f, 0.5300152510f, 0.5329181980f,\n0.5358112380f, 0.5386943730f, 0.5415676050f, 0.5444309400f,\n0.5472843810f, 0.5501279330f, 0.5529616020f, 0.5557853940f,\n0.5585993150f, 0.5614033740f, 0.5641975770f, 0.5669819340f,\n0.5697564530f, 0.5725211450f, 0.5752760180f, 0.5780210840f,\n0.5807563530f, 0.5834818390f, 0.5861975510f, 0.5889035040f,\n0.5915997100f, 0.5942861830f, 0.5969629370f, 0.5996299860f,\n0.6022873460f, 0.6049350310f, 0.6075730580f, 0.6102014430f,\n0.6128202020f, 0.6154293530f, 0.6180289120f, 0.6206188990f,\n0.6231993300f, 0.6257702250f, 0.6283316020f, 0.6308834820f,\n0.6334258830f, 0.6359588250f, 0.6384823300f, 0.6409964180f,\n0.6435011090f, 0.6459964250f, 0.6484823880f, 0.6509590190f,\n0.6534263410f, 0.6558843770f, 0.6583331480f, 0.6607726790f,\n0.6632029930f, 0.6656241120f, 0.6680360620f, 0.6704388650f,\n0.6728325470f, 0.6752171330f, 0.6775926450f, 0.6799591110f,\n0.6823165550f, 0.6846650020f, 0.6870044780f, 0.6893350100f,\n0.6916566220f, 0.6939693410f, 0.6962731940f, 0.6985682070f,\n0.7008544080f, 0.7031318220f, 0.7054004770f, 0.7076604000f,\n0.7099116190f, 0.7121541600f, 0.7143880520f, 0.7166133230f,\n0.7188300000f, 0.7210381110f, 0.7232376840f, 0.7254287490f,\n0.7276113330f, 0.7297854640f, 0.7319511710f, 0.7341084830f,\n0.7362574290f, 0.7383980370f, 0.7405303370f, 0.7426543560f,\n0.7447701260f, 0.7468776740f, 0.7489770290f, 0.7510682220f,\n0.7531512810f, 0.7552262360f, 0.7572931160f, 0.7593519510f,\n0.7614027700f, 0.7634456020f, 0.7654804790f, 0.7675074280f,\n0.7695264800f, 0.7715376650f, 0.7735410110f, 0.7755365500f,\n0.7775243100f, 0.7795043220f, 0.7814766150f, 0.7834412190f,\n0.7853981630f, 0.7853981630f /* Extended by 1 for interpolation */\n};\n\nstatic inline float my_sinf(float x)\n{\n\tfloat x2, xn;\n\tint i;\n\t/* Map x into the -PI to PI range. We could do this using:\n\t * x = fmodf(x, (float)(2.0 * M_PI));\n\t * but that's C99, and seems to misbehave with negative numbers\n\t * on some platforms. */\n\tx -= (float)M_PI;\n\ti = x / (float)(2.0f * M_PI);\n\tx -= i * (float)(2.0f * M_PI);\n\tif (x < 0.0f)\n\t\tx += (float)(2.0f * M_PI);\n\tx -= (float)M_PI;\n\tif (x <= (float)(-M_PI/2.0))\n\t\tx = -(float)M_PI-x;\n\telse if (x >= (float)(M_PI/2.0))\n\t\tx = (float)M_PI-x;\n\tx2 = x*x;\n\txn = x*x2/6.0f;\n\tx -= xn;\n\txn *= x2/20.0f;\n\tx += xn;\n\txn *= x2/42.0f;\n\tx -= xn;\n\txn *= x2/72.0f;\n\tx += xn;\n\treturn x;\n}\n\nstatic inline float my_atan2f(float o, float a)\n{\n\tint negate = 0, flip = 0, i;\n\tfloat r, s;\n\tif (o == 0.0f)\n\t{\n\t\tif (a > 0)\n\t\t\treturn 0.0f;\n\t\telse\n\t\t\treturn (float)M_PI;\n\t}\n\tif (o < 0)\n\t\to = -o, negate = 1;\n\tif (a < 0)\n\t\ta = -a, flip = 1;\n\tif (o < a)\n\t\ti = (int)(65536.0f*o/a + 0.5f);\n\telse\n\t\ti = (int)(65536.0f*a/o + 0.5f);\n\tr = my_atan_table[i>>8];\n\ts = my_atan_table[(i>>8)+1];\n\tr += (s-r)*(i&255)/256.0f;\n\tif (o >= a)\n\t\tr = (float)(M_PI/2.0f) - r;\n\tif (flip)\n\t\tr = (float)M_PI - r;\n\tif (negate)\n\t\tr = -r;\n\treturn r;\n}\n\n#define sinf(x) my_sinf(x)\n#define cosf(x) my_sinf(((float)(M_PI/2.0f)) + (x))\n#define atan2f(x,y) my_atan2f((x),(y))\n#endif\n\nint fz_strcasecmp(const char *a, const char *b);\n\n/* SumatraPDF: better support for libmupdf.dll */\n#ifdef _WIN32\nvoid fz_redirect_io_to_console();\n#endif\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/text.h",
    "content": "#ifndef MUPDF_FITZ_TEXT_H\n#define MUPDF_FITZ_TEXT_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/font.h\"\n#include \"mupdf/fitz/path.h\"\n\n/*\n * Text buffer.\n *\n * The trm field contains the a, b, c and d coefficients.\n * The e and f coefficients come from the individual elements,\n * together they form the transform matrix for the glyph.\n *\n * Glyphs are referenced by glyph ID.\n * The Unicode text equivalent is kept in a separate array\n * with indexes into the glyph array.\n */\n\ntypedef struct fz_text_s fz_text;\ntypedef struct fz_text_item_s fz_text_item;\n\nstruct fz_text_item_s\n{\n\tfloat x, y;\n\tint gid; /* -1 for one gid to many ucs mappings */\n\tint ucs; /* -1 for one ucs to many gid mappings */\n};\n\nstruct fz_text_s\n{\n\tfz_font *font;\n\tfz_matrix trm;\n\tint wmode;\n\tint len, cap;\n\tfz_text_item *items;\n};\n\nfz_text *fz_new_text(fz_context *ctx, fz_font *face, const fz_matrix *trm, int wmode);\nvoid fz_add_text(fz_context *ctx, fz_text *text, int gid, int ucs, float x, float y);\nvoid fz_free_text(fz_context *ctx, fz_text *text);\nfz_rect *fz_bound_text(fz_context *ctx, fz_text *text, const fz_stroke_state *stroke, const fz_matrix *ctm, fz_rect *r);\nfz_text *fz_clone_text(fz_context *ctx, fz_text *old);\nvoid fz_print_text(fz_context *ctx, FILE *out, fz_text*);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/transition.h",
    "content": "#ifndef MUPDF_FITZ_TRANSITION_H\n#define MUPDF_FITZ_TRANSITION_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/pixmap.h\"\n\n/* Transition support */\ntypedef struct fz_transition_s fz_transition;\n\nenum {\n\tFZ_TRANSITION_NONE = 0, /* aka 'R' or 'REPLACE' */\n\tFZ_TRANSITION_SPLIT,\n\tFZ_TRANSITION_BLINDS,\n\tFZ_TRANSITION_BOX,\n\tFZ_TRANSITION_WIPE,\n\tFZ_TRANSITION_DISSOLVE,\n\tFZ_TRANSITION_GLITTER,\n\tFZ_TRANSITION_FLY,\n\tFZ_TRANSITION_PUSH,\n\tFZ_TRANSITION_COVER,\n\tFZ_TRANSITION_UNCOVER,\n\tFZ_TRANSITION_FADE\n};\n\nstruct fz_transition_s\n{\n\tint type;\n\tfloat duration; /* Effect duration (seconds) */\n\n\t/* Parameters controlling the effect */\n\tint vertical; /* 0 or 1 */\n\tint outwards; /* 0 or 1 */\n\tint direction; /* Degrees */\n\t/* Potentially more to come */\n\n\t/* State variables for use of the transition code */\n\tint state0;\n\tint state1;\n};\n\n/*\n\tfz_generate_transition: Generate a frame of a transition.\n\n\ttpix: Target pixmap\n\topix: Old pixmap\n\tnpix: New pixmap\n\ttime: Position within the transition (0 to 256)\n\ttrans: Transition details\n\n\tReturns 1 if successfully generated a frame.\n*/\nint fz_generate_transition(fz_pixmap *tpix, fz_pixmap *opix, fz_pixmap *npix, int time, fz_transition *trans);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/tree.h",
    "content": "#ifndef MUPDF_FITZ_TREE_H\n#define MUPDF_FITZ_TREE_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n\n/* AA-tree to look up things by strings. */\n\ntypedef struct fz_tree_s fz_tree;\n\nvoid *fz_tree_lookup(fz_context *ctx, fz_tree *node, const char *key);\n\n/*\n\tInsert a new key/value pair and rebalance the tree.\n\tReturn the new root of the tree after inserting and rebalancing.\n\tMay be called with a NULL root to create a new tree.\n*/\nfz_tree *fz_tree_insert(fz_context *ctx, fz_tree *root, const char *key, void *value);\n\nvoid fz_free_tree(fz_context *ctx, fz_tree *node, void (*freefunc)(fz_context *ctx, void *value));\n\nvoid fz_debug_tree(fz_context *ctx, fz_tree *root);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/unzip.h",
    "content": "#ifndef MUPDF_FITZ_UNZIP_H\n#define MUPDF_FITZ_UNZIP_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/buffer.h\"\n#include \"mupdf/fitz/stream.h\"\n\ntypedef struct fz_archive_s fz_archive;\n\nfz_archive *fz_open_directory(fz_context *ctx, const char *dirname);\nfz_archive *fz_open_archive(fz_context *ctx, const char *filename);\nfz_archive *fz_open_archive_with_stream(fz_context *ctx, fz_stream *file);\nint fz_has_archive_entry(fz_context *ctx, fz_archive *zip, const char *name);\nfz_stream *fz_open_archive_entry(fz_context *ctx, fz_archive *zip, const char *entry);\nfz_buffer *fz_read_archive_entry(fz_context *ctx, fz_archive *zip, const char *entry);\nvoid fz_close_archive(fz_context *ctx, fz_archive *ar);\n\nvoid fz_rebind_archive(fz_archive *zip, fz_context *ctx);\n\nint fz_count_archive_entries(fz_context *ctx, fz_archive *zip);\nconst char *fz_list_archive_entry(fz_context *ctx, fz_archive *zip, int idx);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/version.h",
    "content": "#ifndef MUPDF_FITZ_VERSION_H\n#define MUPDF_FITZ_VERSION_H\n#ifndef FZ_VERSION\n#define FZ_VERSION \"1.6\"\n#endif\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/write-document.h",
    "content": "#ifndef MUPDF_FITZ_WRITE_DOCUMENT_H\n#define MUPDF_FITZ_WRITE_DOCUMENT_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n#include \"mupdf/fitz/document.h\"\n\n/*\n\tIn calls to fz_write, the following options structure can be used\n\tto control aspects of the writing process. This structure may grow\n\tin future, and should be zero-filled to allow forwards compatiblity.\n*/\nstruct fz_write_options_s\n{\n\tint do_incremental; /* Write just the changed objects */\n\tint do_ascii; /* If non-zero then attempt (where possible) to make\n\t\t\t\tthe output ascii. */\n\tint do_expand; /* Bitflags; each non zero bit indicates an aspect\n\t\t\t\tof the file that should be 'expanded' on\n\t\t\t\twriting. */\n\tint do_garbage; /* If non-zero then attempt (where possible) to\n\t\t\t\tgarbage collect the file before writing. */\n\tint do_linear; /* If non-zero then write linearised. */\n\tint do_clean; /* If non-zero then clean contents */\n\tint continue_on_error; /* If non-zero, errors are (optionally)\n\t\t\t\t\tcounted and writing continues. */\n\tint *errors; /* Pointer to a place to store a count of errors */\n};\n\n/*\tAn enumeration of bitflags to use in the above 'do_expand' field of\n\tfz_write_options.\n*/\nenum\n{\n\tfz_expand_images = 1,\n\tfz_expand_fonts = 2,\n\tfz_expand_all = -1\n};\n\n/*\n\tfz_write: Write a document out.\n\n\t(In development - Subject to change in future versions)\n\n\tSave a copy of the current document in its original format.\n\tInternally the document may change.\n\n\tdoc: The document to save.\n\n\tfilename: The filename to save to.\n\n\topts: NULL, or a pointer to an options structure.\n\n\tMay throw exceptions.\n*/\nvoid fz_write_document(fz_document *doc, char *filename, fz_write_options *opts);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz/xml.h",
    "content": "#ifndef MUPDF_FITZ_XML_H\n#define MUPDF_FITZ_XML_H\n\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n\n/*\n\tXML document model\n*/\n\ntypedef struct fz_xml_s fz_xml;\n\n/*\n\tfz_parse_xml: Parse a zero-terminated string into a tree of xml nodes.\n\n\tpreserve_white: whether to keep or delete all-whitespace nodes.\n*/\nfz_xml *fz_parse_xml(fz_context *ctx, unsigned char *buf, int len, int preserve_white);\n\n/*\n\tfz_xml_prev: Return previous sibling of XML node.\n*/\nfz_xml *fz_xml_prev(fz_xml *item);\n\n/*\n\tfz_xml_next: Return next sibling of XML node.\n*/\nfz_xml *fz_xml_next(fz_xml *item);\n\n/*\n\tfz_xml_up: Return parent of XML node.\n*/\nfz_xml *fz_xml_up(fz_xml *item);\n\n/*\n\tfz_xml_down: Return first child of XML node.\n*/\nfz_xml *fz_xml_down(fz_xml *item);\n\n/*\n\tfz_xml_is_tag: Return true if the tag name matches.\n*/\nint fz_xml_is_tag(fz_xml *item, const char *name);\n\n/*\n\tfz_xml_tag: Return tag of XML node. Return NULL for text nodes.\n*/\nchar *fz_xml_tag(fz_xml *item);\n\n/*\n\tfz_xml_att: Return the value of an attribute of an XML node.\n\tNULL if the attribute doesn't exist.\n*/\nchar *fz_xml_att(fz_xml *item, const char *att);\n\n/*\n\tfz_xml_text: Return the text content of an XML node.\n\tReturn NULL if the node is a tag.\n*/\nchar *fz_xml_text(fz_xml *item);\n\n/*\n\tfz_free_xml: Free the XML node and all its children and siblings.\n*/\nvoid fz_free_xml(fz_context *doc, fz_xml *item);\n\n/*\n\tfz_detach_xml: Detach a node from the tree, unlinking it from its parent.\n*/\nvoid fz_detach_xml(fz_xml *node);\n\n/*\n\tfz_debug_xml: Pretty-print an XML tree to stdout.\n*/\nvoid fz_debug_xml(fz_xml *item, int level);\n\nfz_xml *fz_xml_find(fz_xml *item, const char *tag);\nfz_xml *fz_xml_find_next(fz_xml *item, const char *tag);\nfz_xml *fz_xml_find_down(fz_xml *item, const char *tag);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/fitz.h",
    "content": "#ifndef MUDPF_FITZ_H\n#define MUDPF_FITZ_H\n\n#include \"mupdf/fitz/version.h\"\n#include \"mupdf/fitz/system.h\"\n#include \"mupdf/fitz/context.h\"\n\n#include \"mupdf/fitz/crypt.h\"\n#include \"mupdf/fitz/getopt.h\"\n#include \"mupdf/fitz/hash.h\"\n#include \"mupdf/fitz/math.h\"\n#include \"mupdf/fitz/string.h\"\n#include \"mupdf/fitz/tree.h\"\n#include \"mupdf/fitz/xml.h\"\n\n/* I/O */\n#include \"mupdf/fitz/buffer.h\"\n#include \"mupdf/fitz/stream.h\"\n#include \"mupdf/fitz/compressed-buffer.h\"\n#include \"mupdf/fitz/filter.h\"\n#include \"mupdf/fitz/output.h\"\n#include \"mupdf/fitz/unzip.h\"\n\n/* Resources */\n#include \"mupdf/fitz/store.h\"\n#include \"mupdf/fitz/colorspace.h\"\n#include \"mupdf/fitz/pixmap.h\"\n#include \"mupdf/fitz/glyph.h\"\n#include \"mupdf/fitz/bitmap.h\"\n#include \"mupdf/fitz/image.h\"\n#include \"mupdf/fitz/function.h\"\n#include \"mupdf/fitz/shade.h\"\n#include \"mupdf/fitz/font.h\"\n#include \"mupdf/fitz/path.h\"\n#include \"mupdf/fitz/text.h\"\n\n#include \"mupdf/fitz/device.h\"\n#include \"mupdf/fitz/display-list.h\"\n#include \"mupdf/fitz/structured-text.h\"\n\n#include \"mupdf/fitz/transition.h\"\n#include \"mupdf/fitz/glyph-cache.h\"\n\n/* Document */\n#include \"mupdf/fitz/link.h\"\n#include \"mupdf/fitz/outline.h\"\n#include \"mupdf/fitz/document.h\"\n#include \"mupdf/fitz/annotation.h\"\n#include \"mupdf/fitz/meta.h\"\n\n#include \"mupdf/fitz/write-document.h\"\n\n/* Output formats */\n#include \"mupdf/fitz/output-pnm.h\"\n#include \"mupdf/fitz/output-png.h\"\n#include \"mupdf/fitz/output-pwg.h\"\n#include \"mupdf/fitz/output-pcl.h\"\n#include \"mupdf/fitz/output-svg.h\"\n#include \"mupdf/fitz/output-tga.h\"\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/img.h",
    "content": "#ifndef MUIMAGE_H\n#define MUIMAGE_H\n\n#include \"mupdf/fitz.h\"\n\ntypedef struct image_document_s image_document;\ntypedef struct image_page_s image_page;\n\n/*\n\timage_open_document: Open a document.\n\n\tOpen a document for reading so the library is able to locate\n\tobjects and pages inside the file.\n\n\tThe returned image_document should be used when calling most\n\tother functions. Note that it wraps the context, so those\n\tfunctions implicitly get access to the global state in\n\tcontext.\n\n\tfilename: a path to a file as it would be given to open(2).\n*/\nimage_document *image_open_document(fz_context *ctx, const char *filename);\n\n/*\n\timage_open_document_with_stream: Opens a document.\n\n\tSame as image_open_document, but takes a stream instead of a\n\tfilename to locate the document to open. Increments the\n\treference count of the stream. See fz_open_file,\n\tfz_open_file_w or fz_open_fd for opening a stream, and\n\tfz_close for closing an open stream.\n*/\nimage_document *image_open_document_with_stream(fz_context *ctx, fz_stream *file);\n\n/*\n\timage_close_document: Closes and frees an opened document.\n\n\tThe resource store in the context associated with image_document\n\tis emptied.\n\n\tDoes not throw exceptions.\n*/\nvoid image_close_document(image_document *doc);\n\nint image_count_pages(image_document *doc);\nimage_page *image_load_page(image_document *doc, int number);\nfz_rect *image_bound_page(image_document *doc, image_page *page, fz_rect *rect);\nvoid image_free_page(image_document *doc, image_page *page);\nvoid image_run_page(image_document *doc, image_page *page, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/pdf/annot.h",
    "content": "#ifndef MUPDF_PDF_ANNOT_H\n#define MUPDF_PDF_ANNOT_H\n\nenum\n{\n\tF_Invisible = 1 << (1-1),\n\tF_Hidden = 1 << (2-1),\n\tF_Print = 1 << (3-1),\n\tF_NoZoom = 1 << (4-1),\n\tF_NoRotate = 1 << (5-1),\n\tF_NoView = 1 << (6-1),\n\tF_ReadOnly = 1 << (7-1),\n\tF_Locked = 1 << (8-1),\n\tF_ToggleNoView = 1 << (9-1),\n\tF_LockedContents = 1 << (10-1)\n};\n\n/*\n\tpdf_first_annot: Return the first annotation on a page.\n\n\tDoes not throw exceptions.\n*/\npdf_annot *pdf_first_annot(pdf_document *doc, pdf_page *page);\n\n/*\n\tpdf_next_annot: Return the next annotation on a page.\n\n\tDoes not throw exceptions.\n*/\npdf_annot *pdf_next_annot(pdf_document *doc, pdf_annot *annot);\n\n/*\n\tpdf_bound_annot: Return the rectangle for an annotation on a page.\n\n\tDoes not throw exceptions.\n*/\nfz_rect *pdf_bound_annot(pdf_document *doc, pdf_annot *annot, fz_rect *rect);\n\n/*\n\tpdf_annot_type: Return the type of an annotation\n*/\nfz_annot_type pdf_annot_type(pdf_annot *annot);\n\n/*\n\tpdf_run_annot: Interpret an annotation and render it on a device.\n\n\tpage: A page loaded by pdf_load_page.\n\n\tannot: an annotation.\n\n\tdev: Device used for rendering, obtained from fz_new_*_device.\n\n\tctm: A transformation matrix applied to the objects on the page,\n\te.g. to scale or rotate the page contents as desired.\n*/\nvoid pdf_run_annot(pdf_document *doc, pdf_page *page, pdf_annot *annot, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie);\n\nstruct pdf_annot_s\n{\n\tpdf_page *page;\n\tpdf_obj *obj;\n\tfz_rect rect;\n\tfz_rect pagerect;\n\tpdf_xobject *ap;\n\tint ap_iteration;\n\tfz_matrix matrix;\n\tpdf_annot *next;\n\tpdf_annot *next_changed;\n\tint annot_type;\n\tint widget_type;\n};\n\nfz_link_dest pdf_parse_link_dest(pdf_document *doc, fz_link_kind kind, pdf_obj *dest);\nfz_link_dest pdf_parse_action(pdf_document *doc, pdf_obj *action);\npdf_obj *pdf_lookup_dest(pdf_document *doc, pdf_obj *needle);\npdf_obj *pdf_lookup_name(pdf_document *doc, char *which, pdf_obj *needle);\npdf_obj *pdf_load_name_tree(pdf_document *doc, char *which);\n\n/* SumatraPDF: parse full file specifications */\nchar *pdf_file_spec_to_str(pdf_document *doc, pdf_obj *file_spec);\n\nfz_link *pdf_load_link_annots(pdf_document *, pdf_obj *annots, const fz_matrix *page_ctm);\n\nvoid pdf_transform_annot(pdf_annot *annot);\nvoid pdf_load_annots(pdf_document *, pdf_page *page, pdf_obj *annots);\nvoid pdf_update_annot(pdf_document *, pdf_annot *annot);\nvoid pdf_free_annot(fz_context *ctx, pdf_annot *link);\n\n/*\n\tpdf_create_annot: create a new annotation of the specified type on the\n\tspecified page. The returned pdf_annot structure is owned by the page\n\tand does not need to be freed.\n*/\npdf_annot *pdf_create_annot(pdf_document *doc, pdf_page *page, fz_annot_type type);\n\n/*\n\tpdf_delete_annot: delete an annotation\n*/\nvoid pdf_delete_annot(pdf_document *doc, pdf_page *page, pdf_annot *annot);\n\n/*\n\tpdf_set_markup_annot_quadpoints: set the quadpoints for a text-markup annotation.\n*/\nvoid pdf_set_markup_annot_quadpoints(pdf_document *doc, pdf_annot *annot, fz_point *qp, int n);\n\n/*\n\tpdf_set_ink_annot_list: set the details of an ink annotation. All the points of the multiple arcs\n\tare carried in a single array, with the counts for each arc held in a secondary array.\n*/\nvoid pdf_set_ink_annot_list(pdf_document *doc, pdf_annot *annot, fz_point *pts, int *counts, int ncount, float color[3], float thickness);\n\n/*\n\tpdf_set_text_annot_position: set the position on page for a text (sticky note) annotation.\n*/\nvoid pdf_set_text_annot_position(pdf_document *doc, pdf_annot *annot, fz_point pt);\n\n/*\n\tpdf_set_annot_contents: set the contents of an annotation.\n*/\nvoid pdf_set_annot_contents(pdf_document *doc, pdf_annot *annot, char *text);\n\n/*\n\tpdf_annot_contents: return the contents of an annotation.\n*/\nchar *pdf_annot_contents(pdf_document *doc, pdf_annot *annot);\n\n/*\n\tpdf_set_free_text_details: set the position, text, font and color for a free text annotation.\n\tOnly base 14 fonts are supported and are specified by name.\n*/\nvoid pdf_set_free_text_details(pdf_document *doc, pdf_annot *annot, fz_point *pos, char *text, char *font_name, float font_size, float color[3]);\n\nfz_annot_type pdf_annot_obj_type(pdf_obj *obj);\n\n/*\n\tpdf_poll_changed_annot: enumerate the changed annotations recoreded\n\tby a call to pdf_update_page.\n*/\npdf_annot *pdf_poll_changed_annot(pdf_document *idoc, pdf_page *page);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/pdf/appearance.h",
    "content": "#ifndef MUPDF_PDF_APPEARANCE_H\n#define MUPDF_PDF_APPEARANCE_H\n\ntypedef struct pdf_da_info_s\n{\n\tchar *font_name;\n\tint font_size;\n\tfloat col[4];\n\tint col_size;\n} pdf_da_info;\n\nvoid pdf_da_info_fin(fz_context *ctx, pdf_da_info *di);\nvoid pdf_parse_da(fz_context *ctx, char *da, pdf_da_info *di);\nvoid pdf_fzbuf_print_da(fz_context *ctx, fz_buffer *fzbuf, pdf_da_info *di);\n\nvoid pdf_update_text_appearance(pdf_document *doc, pdf_obj *obj, char *eventValue);\nvoid pdf_update_combobox_appearance(pdf_document *doc, pdf_obj *obj);\nvoid pdf_update_pushbutton_appearance(pdf_document *doc, pdf_obj *obj);\nvoid pdf_update_text_markup_appearance(pdf_document *doc, pdf_annot *annot, fz_annot_type type);\nvoid pdf_update_ink_appearance(pdf_document *doc, pdf_annot *annot);\nvoid pdf_update_text_annot_appearance(pdf_document *doc, pdf_annot *annot);\n/*\n\tpdf_update_free_text_annot_appearance: update the appearance stream for a free text\n\tannotation, basing it on the annoations rectangle and contents.\n*/\nvoid pdf_update_free_text_annot_appearance(pdf_document *doc, pdf_annot *annot);\n\n/*\n\tpdf_set_annot_appearance: update the appearance of an annotation based\n\ton a display list.\n*/\nvoid pdf_set_annot_appearance(pdf_document *doc, pdf_annot *annot, fz_rect *rect, fz_display_list *disp_list);\n\n/*\n\tfz_set_markup_appearance: set the appearance stream of a text markup annotations, basing it on\n\tits QuadPoints array\n*/\nvoid pdf_set_markup_appearance(pdf_document *doc, pdf_annot *annot, float color[3], float alpha, float line_thickness, float line_height);\n\nvoid pdf_set_signature_appearance(pdf_document *doc, pdf_annot *annot, char *name, char *dn, char *date);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/pdf/cmap.h",
    "content": "#ifndef MUPDF_PDF_CMAP_H\n#define MUPDF_PDF_CMAP_H\n\n/*\n * CMap\n */\n\ntypedef struct pdf_cmap_s pdf_cmap;\ntypedef struct pdf_range_s pdf_range;\ntypedef struct pdf_xrange_s pdf_xrange;\ntypedef struct pdf_mrange_s pdf_mrange;\n\n#define PDF_MRANGE_CAP 8\n\nstruct pdf_range_s\n{\n\tunsigned short low, high, out;\n};\n\nstruct pdf_xrange_s\n{\n\tunsigned int low, high, out;\n};\n\nstruct pdf_mrange_s\n{\n\tunsigned int low, len, out[PDF_MRANGE_CAP];\n};\n\nstruct pdf_cmap_s\n{\n\tfz_storable storable;\n\tchar cmap_name[32];\n\n\tchar usecmap_name[32];\n\tpdf_cmap *usecmap;\n\n\tint wmode;\n\n\tint codespace_len;\n\tstruct\n\t{\n\t\tint n;\n\t\tunsigned int low;\n\t\tunsigned int high;\n\t} codespace[40];\n\n\tint rlen, rcap;\n\tpdf_range *ranges;\n\n\tint xlen, xcap;\n\tpdf_xrange *xranges;\n\n\tint mlen, mcap;\n\tpdf_mrange *mranges;\n};\n\npdf_cmap *pdf_new_cmap(fz_context *ctx);\npdf_cmap *pdf_keep_cmap(fz_context *ctx, pdf_cmap *cmap);\nvoid pdf_drop_cmap(fz_context *ctx, pdf_cmap *cmap);\nvoid pdf_free_cmap_imp(fz_context *ctx, fz_storable *cmap);\nunsigned int pdf_cmap_size(fz_context *ctx, pdf_cmap *cmap);\n\nint pdf_cmap_wmode(fz_context *ctx, pdf_cmap *cmap);\nvoid pdf_set_cmap_wmode(fz_context *ctx, pdf_cmap *cmap, int wmode);\nvoid pdf_set_usecmap(fz_context *ctx, pdf_cmap *cmap, pdf_cmap *usecmap);\n\nvoid pdf_add_codespace(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high, int n);\nvoid pdf_map_range_to_table(fz_context *ctx, pdf_cmap *cmap, unsigned int low, int *map, int len);\nvoid pdf_map_range_to_range(fz_context *ctx, pdf_cmap *cmap, unsigned int srclo, unsigned int srchi, int dstlo);\nvoid pdf_map_one_to_many(fz_context *ctx, pdf_cmap *cmap, unsigned int one, int *many, int len);\nvoid pdf_sort_cmap(fz_context *ctx, pdf_cmap *cmap);\n\nint pdf_lookup_cmap(pdf_cmap *cmap, unsigned int cpt);\nint pdf_lookup_cmap_full(pdf_cmap *cmap, unsigned int cpt, int *out);\nint pdf_decode_cmap(pdf_cmap *cmap, unsigned char *s, unsigned char *e, unsigned int *cpt);\n\npdf_cmap *pdf_new_identity_cmap(fz_context *ctx, int wmode, int bytes);\npdf_cmap *pdf_load_cmap(fz_context *ctx, fz_stream *file);\npdf_cmap *pdf_load_system_cmap(fz_context *ctx, char *name);\npdf_cmap *pdf_load_builtin_cmap(fz_context *ctx, char *name);\npdf_cmap *pdf_load_embedded_cmap(pdf_document *doc, pdf_obj *ref);\n\n#ifndef NDEBUG\nvoid pdf_print_cmap(fz_context *ctx, pdf_cmap *cmap);\n#endif\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/pdf/crypt.h",
    "content": "#ifndef MUPDF_PDF_CRYPT_H\n#define MUPDF_PDF_CRYPT_H\n\n/*\n * Encryption\n */\n\npdf_crypt *pdf_new_crypt(fz_context *ctx, pdf_obj *enc, pdf_obj *id);\nvoid pdf_free_crypt(fz_context *ctx, pdf_crypt *crypt);\n\nvoid pdf_crypt_obj(fz_context *ctx, pdf_crypt *crypt, pdf_obj *obj, int num, int gen);\nvoid pdf_crypt_buffer(fz_context *ctx, pdf_crypt *crypt, fz_buffer *buf, int num, int gen);\nfz_stream *pdf_open_crypt(fz_stream *chain, pdf_crypt *crypt, int num, int gen);\nfz_stream *pdf_open_crypt_with_filter(fz_stream *chain, pdf_crypt *crypt, char *name, int num, int gen);\n\nint pdf_crypt_version(pdf_document *doc);\nint pdf_crypt_revision(pdf_document *doc);\nchar *pdf_crypt_method(pdf_document *doc);\nint pdf_crypt_length(pdf_document *doc);\nunsigned char *pdf_crypt_key(pdf_document *doc);\n\n#ifndef NDEBUG\nvoid pdf_print_crypt(pdf_crypt *crypt);\n#endif\n\ntypedef struct pdf_designated_name_s\n{\n\tchar *cn;\n\tchar *o;\n\tchar *ou;\n\tchar *email;\n\tchar *c;\n}\npdf_designated_name;\n\nvoid pdf_free_designated_name(pdf_designated_name *dn);\n\n\npdf_signer *pdf_read_pfx(fz_context *ctx, const char *sigfile, const char *password);\npdf_signer *pdf_keep_signer(pdf_signer *signer);\nvoid pdf_drop_signer(pdf_signer *signer);\npdf_designated_name *pdf_signer_designated_name(pdf_signer *signer);\nvoid pdf_write_digest(pdf_document *doc, char *filename, pdf_obj *byte_range, int digest_offset, int digest_length, pdf_signer *signer);\n\n/*\n\tpdf_signature_widget_byte_range: retrieve the byte range for a signature widget\n*/\nint pdf_signature_widget_byte_range(pdf_document *doc, pdf_widget *widget, int (*byte_range)[2]);\n\n/*\n\tpdf_signature_widget_contents: retrieve the contents for a signature widget\n*/\nint pdf_signature_widget_contents(pdf_document *doc, pdf_widget *widget, char **contents);\n\n/*\n\tpdf_check_signature: check a signature's certificate chain and digest\n*/\nint pdf_check_signature(pdf_document *doc, pdf_widget *widget, char *file, char *ebuf, int ebufsize);\n\n/*\n\tpdf_sign_signature: sign a signature form field\n*/\nvoid pdf_sign_signature(pdf_document *doc, pdf_widget *widget, const char *sigfile, const char *password);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/pdf/document.h",
    "content": "#ifndef MUPDF_PDF_DOCUMENT_H\n#define MUPDF_PDF_DOCUMENT_H\n\ntypedef struct pdf_lexbuf_s pdf_lexbuf;\ntypedef struct pdf_lexbuf_large_s pdf_lexbuf_large;\ntypedef struct pdf_xref_s pdf_xref;\ntypedef struct pdf_crypt_s pdf_crypt;\ntypedef struct pdf_ocg_descriptor_s pdf_ocg_descriptor;\n\ntypedef struct pdf_page_s pdf_page;\ntypedef struct pdf_annot_s pdf_annot;\ntypedef struct pdf_widget_s pdf_widget;\ntypedef struct pdf_hotspot_s pdf_hotspot;\ntypedef struct pdf_js_s pdf_js;\n\nenum\n{\n\tPDF_LEXBUF_SMALL = 256,\n\tPDF_LEXBUF_LARGE = 65536\n};\n\nstruct pdf_lexbuf_s\n{\n\tfz_context *ctx;\n\tint size;\n\tint base_size;\n\tint len;\n\tint i;\n\tfloat f;\n\tchar *scratch;\n\tchar buffer[PDF_LEXBUF_SMALL];\n};\n\nstruct pdf_lexbuf_large_s\n{\n\tpdf_lexbuf base;\n\tchar buffer[PDF_LEXBUF_LARGE - PDF_LEXBUF_SMALL];\n};\n\nstruct pdf_hotspot_s\n{\n\tint num;\n\tint gen;\n\tint state;\n};\n\n/*\n\tDocument event structures are mostly opaque to the app. Only the type\n\tis visible to the app.\n*/\ntypedef struct pdf_doc_event_s pdf_doc_event;\n\n/*\n\tpdf_doc_event_cb: the type of function via which the app receives\n\tdocument events.\n*/\ntypedef void (pdf_doc_event_cb)(pdf_doc_event *event, void *data);\n\n/*\n\tpdf_open_document: Open a PDF document.\n\n\tOpen a PDF document by reading its cross reference table, so\n\tMuPDF can locate PDF objects inside the file. Upon an broken\n\tcross reference table or other parse errors MuPDF will restart\n\tparsing the file from the beginning to try to rebuild a\n\t(hopefully correct) cross reference table to allow further\n\tprocessing of the file.\n\n\tThe returned pdf_document should be used when calling most\n\tother PDF functions. Note that it wraps the context, so those\n\tfunctions implicitly get access to the global state in\n\tcontext.\n\n\tfilename: a path to a file as it would be given to open(2).\n*/\npdf_document *pdf_open_document(fz_context *ctx, const char *filename);\n\n/*\n\tpdf_open_document_with_stream: Opens a PDF document.\n\n\tSame as pdf_open_document, but takes a stream instead of a\n\tfilename to locate the PDF document to open. Increments the\n\treference count of the stream. See fz_open_file,\n\tfz_open_file_w or fz_open_fd for opening a stream, and\n\tfz_close for closing an open stream.\n*/\npdf_document *pdf_open_document_with_stream(fz_context *ctx, fz_stream *file);\n\npdf_document *pdf_open_document_no_run(fz_context *ctx, const char *filename);\npdf_document *pdf_open_document_no_run_with_stream(fz_context *ctx, fz_stream *file);\n\n/*\n\tpdf_close_document: Closes and frees an opened PDF document.\n\n\tThe resource store in the context associated with pdf_document\n\tis emptied.\n\n\tDoes not throw exceptions.\n*/\nvoid pdf_close_document(pdf_document *doc);\n\n/*\n\tpdf_specific: down-cast an fz_document to a pdf_document.\n\tReturns NULL if underlying document is not PDF\n*/\npdf_document *pdf_specifics(fz_document *doc);\n\nint pdf_needs_password(pdf_document *doc);\nint pdf_authenticate_password(pdf_document *doc, const char *pw);\n\nenum\n{\n\tPDF_PERM_PRINT = 1 << 2,\n\tPDF_PERM_CHANGE = 1 << 3,\n\tPDF_PERM_COPY = 1 << 4,\n\tPDF_PERM_NOTES = 1 << 5,\n\tPDF_PERM_FILL_FORM = 1 << 8,\n\tPDF_PERM_ACCESSIBILITY = 1 << 9,\n\tPDF_PERM_ASSEMBLE = 1 << 10,\n\tPDF_PERM_HIGH_RES_PRINT = 1 << 11,\n\tPDF_DEFAULT_PERM_FLAGS = 0xfffc\n};\n\nint pdf_has_permission(pdf_document *doc, int p);\n\n/*\n\tMetadata interface.\n*/\nint pdf_meta(pdf_document *doc, int key, void *ptr, int size);\n\nfz_outline *pdf_load_outline(pdf_document *doc);\n\ntypedef struct pdf_ocg_entry_s pdf_ocg_entry;\n\nstruct pdf_ocg_entry_s\n{\n\tint num;\n\tint gen;\n\tint state;\n};\n\nstruct pdf_ocg_descriptor_s\n{\n\tint len;\n\tpdf_ocg_entry *ocgs;\n\tpdf_obj *intent;\n};\n\n/*\n\tpdf_update_page: update a page for the sake of changes caused by a call\n\tto pdf_pass_event. pdf_update_page regenerates any appearance streams that\n\tare out of date, checks for cases where different appearance streams\n\tshould be selected because of state changes, and records internally\n\teach annotation that has changed appearance. The list of changed annotations\n\tis then available via pdf_poll_changed_annot. Note that a call to\n\tpdf_pass_event for one page may lead to changes on any other, so an app\n\tshould call pdf_update_page for every page it currently displays. Also\n\tit is important that the pdf_page object is the one used to last render\n\tthe page. If instead the app were to drop the page and reload it then\n\ta call to pdf_update_page would not reliably be able to report all changed\n\tareas.\n*/\nvoid pdf_update_page(pdf_document *doc, pdf_page *page);\n\n/*\n\tDetermine whether changes have been made since the\n\tdocument was opened or last saved.\n*/\nint pdf_has_unsaved_changes(pdf_document *doc);\n\ntypedef struct pdf_signer_s pdf_signer;\n\n/* Unsaved signature fields */\ntypedef struct pdf_unsaved_sig_s pdf_unsaved_sig;\n\nstruct pdf_unsaved_sig_s\n{\n\tpdf_obj *field;\n\tint byte_range_start;\n\tint byte_range_end;\n\tint contents_start;\n\tint contents_end;\n\tpdf_signer *signer;\n\tpdf_unsaved_sig *next;\n};\n\n\nstruct pdf_document_s\n{\n\tfz_document super;\n\n\tfz_context *ctx;\n\tfz_stream *file;\n\n\tint version;\n\tint startxref;\n\tint file_size;\n\tpdf_crypt *crypt;\n\tpdf_ocg_descriptor *ocg;\n\tpdf_hotspot hotspot;\n\n\tint max_xref_len;\n\tint num_xref_sections;\n\tpdf_xref *xref_sections;\n\tint *xref_index;\n\tint xref_altered;\n\tint freeze_updates;\n\tint has_xref_streams;\n\n\tint page_count;\n\n\tint repair_attempted;\n\n\t/* State indicating which file parsing method we are using */\n\tint file_reading_linearly;\n\tint file_length;\n\n\tpdf_obj *linear_obj; /* Linearized object (if used) */\n\tpdf_obj **linear_page_refs; /* Page objects for linear loading */\n\tint linear_page1_obj_num;\n\n\t/* The state for the pdf_progressive_advance parser */\n\tint linear_pos;\n\tint linear_page_num;\n\n\tint hint_object_offset;\n\tint hint_object_length;\n\tint hints_loaded; /* Set to 1 after the hints loading has completed,\n\t\t\t   * whether successful or not! */\n\t/* Page n references shared object references:\n\t *   hint_shared_ref[i]\n\t * where\n\t *      i = s to e-1\n\t *\ts = hint_page[n]->index\n\t *\te = hint_page[n+1]->index\n\t * Shared object reference r accesses objects:\n\t *   rs to re-1\n\t * where\n\t *   rs = hint_shared[r]->number\n\t *   re = hint_shared[r]->count + rs\n\t * These are guaranteed to lie within the region starting at\n\t * hint_shared[r]->offset of length hint_shared[r]->length\n\t */\n\tstruct\n\t{\n\t\tint number; /* Page object number */\n\t\tint offset; /* Offset of page object */\n\t\tint index; /* Index into shared hint_shared_ref */\n\t} *hint_page;\n\tint *hint_shared_ref;\n\tstruct\n\t{\n\t\tint number; /* Object number of first object */\n\t\tint offset; /* Offset of first object */\n\t} *hint_shared;\n\tint hint_obj_offsets_max;\n\tint *hint_obj_offsets;\n\n\tint resources_localised;\n\n\tpdf_lexbuf_large lexbuf;\n\n\tpdf_annot *focus;\n\tpdf_obj *focus_obj;\n\n\tpdf_js *js;\n\tvoid (*drop_js)(pdf_js *js);\n\tint recalculating;\n\tint dirty;\n\tpdf_unsaved_sig *unsaved_sigs;\n\n\tvoid (*update_appearance)(pdf_document *doc, pdf_annot *annot);\n\n\tpdf_doc_event_cb *event_cb;\n\tvoid *event_cb_data;\n\n\tint num_type3_fonts;\n\tint max_type3_fonts;\n\tfz_font **type3_fonts;\n\n\t/* cf. http://bugs.ghostscript.com/show_bug.cgi?id=695761 */\n\tpdf_obj **page_objs;\n};\n\n/*\n\tPDF creation\n*/\n\n/*\n\tpdf_create_document: Create a blank PDF document\n*/\npdf_document *pdf_create_document(fz_context *ctx);\n\npdf_page *pdf_create_page(pdf_document *doc, fz_rect rect, int res, int rotate);\n\nvoid pdf_insert_page(pdf_document *doc, pdf_page *page, int at);\n\nvoid pdf_delete_page(pdf_document *doc, int number);\n\nvoid pdf_delete_page_range(pdf_document *doc, int start, int end);\n\nfz_device *pdf_page_write(pdf_document *doc, pdf_page *page);\n\nvoid pdf_finish_edit(pdf_document *doc);\n\nint pdf_recognize(fz_context *doc, const char *magic);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/pdf/event.h",
    "content": "#ifndef MUPDF_PDF_EVENT_H\n#define MUPDF_PDF_EVENT_H\n\nenum\n{\n\tHOTSPOT_POINTER_DOWN = 0x1,\n\tHOTSPOT_POINTER_OVER = 0x2\n};\n\n/* Types of UI event */\nenum\n{\n\tPDF_EVENT_TYPE_POINTER,\n};\n\n/* Types of pointer event */\nenum\n{\n\tPDF_POINTER_DOWN,\n\tPDF_POINTER_UP,\n};\n\n/*\n\tUI events that can be passed to an interactive document.\n*/\ntypedef struct pdf_ui_event_s\n{\n\tint etype;\n\tunion\n\t{\n\t\tstruct\n\t\t{\n\t\t\tint ptype;\n\t\t\tfz_point pt;\n\t\t} pointer;\n\t} event;\n} pdf_ui_event;\n\n/*\n\tpdf_init_ui_pointer_event: Set up a pointer event\n*/\nvoid pdf_init_ui_pointer_event(pdf_ui_event *event, int type, float x, float y);\n\n/*\n\tDocument events: the objects via which MuPDF informs the calling app\n\tof occurrences emanating from the document, possibly from user interaction\n\tor javascript execution. MuPDF informs the app of document events via a\n\tcallback.\n*/\n\n/*\n\tpdf_pass_event: Pass a UI event to an interactive\n\tdocument.\n\n\tReturns a boolean indication of whether the ui_event was\n\thandled. Example of use for the return value: when considering\n\tpassing the events that make up a drag, if the down event isn't\n\taccepted then don't send the move events or the up event.\n*/\nint pdf_pass_event(pdf_document *doc, pdf_page *page, pdf_ui_event *ui_event);\n\nstruct pdf_doc_event_s\n{\n\tint type;\n};\n\nenum\n{\n\tPDF_DOCUMENT_EVENT_ALERT,\n\tPDF_DOCUMENT_EVENT_PRINT,\n\tPDF_DOCUMENT_EVENT_LAUNCH_URL,\n\tPDF_DOCUMENT_EVENT_MAIL_DOC,\n\tPDF_DOCUMENT_EVENT_SUBMIT,\n\tPDF_DOCUMENT_EVENT_EXEC_MENU_ITEM,\n\tPDF_DOCUMENT_EVENT_EXEC_DIALOG\n};\n\n/*\n\tpdf_set_doc_event_callback: set the function via which to receive\n\tdocument events.\n*/\nvoid pdf_set_doc_event_callback(pdf_document *doc, pdf_doc_event_cb *event_cb, void *data);\n\n/*\n\tThe various types of document events\n*/\n\n/*\n\tpdf_alert_event: details of an alert event. In response the app should\n\tdisplay an alert dialog with the bittons specified by \"button_type_group\".\n\tIf \"check_box_message\" is non-NULL, a checkbox should be displayed in\n\tthe lower-left corned along with the messsage.\n\n\t\"finally_checked\" and \"button_pressed\" should be set by the app\n\tbefore returning from the callback. \"finally_checked\" need be set\n\tonly if \"check_box_message\" is non-NULL.\n*/\ntypedef struct\n{\n\tchar *message;\n\tint icon_type;\n\tint button_group_type;\n\tchar *title;\n\tchar *check_box_message;\n\tint initially_checked;\n\tint finally_checked;\n\tint button_pressed;\n} pdf_alert_event;\n\n/* Possible values of icon_type */\nenum\n{\n\tPDF_ALERT_ICON_ERROR,\n\tPDF_ALERT_ICON_WARNING,\n\tPDF_ALERT_ICON_QUESTION,\n\tPDF_ALERT_ICON_STATUS\n};\n\n/* Possible values of button_group_type */\nenum\n{\n\tPDF_ALERT_BUTTON_GROUP_OK,\n\tPDF_ALERT_BUTTON_GROUP_OK_CANCEL,\n\tPDF_ALERT_BUTTON_GROUP_YES_NO,\n\tPDF_ALERT_BUTTON_GROUP_YES_NO_CANCEL\n};\n\n/* Possible values of button_pressed */\nenum\n{\n\tPDF_ALERT_BUTTON_NONE,\n\tPDF_ALERT_BUTTON_OK,\n\tPDF_ALERT_BUTTON_CANCEL,\n\tPDF_ALERT_BUTTON_NO,\n\tPDF_ALERT_BUTTON_YES\n};\n\n/*\n\tpdf_access_alert_event: access the details of an alert event\n\tThe returned pointer and all the data referred to by the\n\tstructire are owned by mupdf and need not be freed by the\n\tcaller.\n*/\npdf_alert_event *pdf_access_alert_event(pdf_doc_event *event);\n\n/*\n\tpdf_access_exec_menu_item_event: access the details of am execMenuItem\n\tevent, which consists of just the name of the menu item\n*/\nchar *pdf_access_exec_menu_item_event(pdf_doc_event *event);\n\n/*\n\tpdf_submit_event: details of a submit event. The app should submit\n\tthe specified data to the specified url. \"get\" determines whether\n\tto use the GET or POST method.\n*/\ntypedef struct\n{\n\tchar *url;\n\tchar *data;\n\tint data_len;\n\tint get;\n} pdf_submit_event;\n\n/*\n\tpdf_access_submit_event: access the details of a submit event\n\tThe returned pointer and all data referred to by the structure are\n\towned by mupdf and need not be freed by the caller.\n*/\npdf_submit_event *pdf_access_submit_event(pdf_doc_event *event);\n\n/*\n\tpdf_launch_url_event: details of a launch-url event. The app should\n\topen the url, either in a new frame or in the current window.\n*/\ntypedef struct\n{\n\tchar *url;\n\tint new_frame;\n} pdf_launch_url_event;\n\n/*\n\tpdf_access_launch_url_event: access the details of a launch-url\n\tevent. The returned pointer and all data referred to by the structure\n\tare owned by mupdf and need not be freed by the caller.\n*/\npdf_launch_url_event *pdf_access_launch_url_event(pdf_doc_event *event);\n\n/*\n\tpdf_mail_doc_event: details of a mail_doc event. The app should save\n\tthe current state of the document and email it using the specified\n\tparameters.\n*/\ntypedef struct\n{\n\tint ask_user;\n\tchar *to;\n\tchar *cc;\n\tchar *bcc;\n\tchar *subject;\n\tchar *message;\n} pdf_mail_doc_event;\n\n/*\n\tpdf_acccess_mail_doc_event: access the details of a mail-doc event.\n*/\npdf_mail_doc_event *pdf_access_mail_doc_event(pdf_doc_event *event);\n\nvoid pdf_event_issue_alert(pdf_document *doc, pdf_alert_event *event);\nvoid pdf_event_issue_print(pdf_document *doc);\nvoid pdf_event_issue_exec_menu_item(pdf_document *doc, char *item);\nvoid pdf_event_issue_exec_dialog(pdf_document *doc);\nvoid pdf_event_issue_launch_url(pdf_document *doc, char *url, int new_frame);\nvoid pdf_event_issue_mail_doc(pdf_document *doc, pdf_mail_doc_event *event);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/pdf/field.h",
    "content": "#ifndef MUPDF_PDF_FIELD_H\n#define MUPDF_PDF_FIELD_H\n\n/* Field flags */\nenum\n{\n\t/* Common to all field types */\n\tFf_ReadOnly = 1 << (1-1),\n\tFf_Required = 1 << (2-1),\n\tFf_NoExport = 1 << (3-1),\n\n\t/* Text fields */\n\tFf_Multiline = 1 << (13-1),\n\tFf_Password = 1 << (14-1),\n\n\tFf_FileSelect = 1 << (21-1),\n\tFf_DoNotSpellCheck = 1 << (23-1),\n\tFf_DoNotScroll = 1 << (24-1),\n\tFf_Comb = 1 << (25-1),\n\tFf_RichText = 1 << (26-1),\n\n\t/* Button fields */\n\tFf_NoToggleToOff = 1 << (15-1),\n\tFf_Radio = 1 << (16-1),\n\tFf_Pushbutton = 1 << (17-1),\n\tFf_RadioInUnison = 1 << (26-1),\n\n\t/* Choice fields */\n\tFf_Combo = 1 << (18-1),\n\tFf_Edit = 1 << (19-1),\n\tFf_Sort = 1 << (20-1),\n\tFf_MultiSelect = 1 << (22-1),\n\tFf_CommitOnSelCHange = 1 << (27-1),\n};\n\nchar *pdf_get_string_or_stream(pdf_document *doc, pdf_obj *obj);\npdf_obj *pdf_get_inheritable(pdf_document *doc, pdf_obj *obj, char *key);\nint pdf_get_field_flags(pdf_document *doc, pdf_obj *obj);\nint pdf_field_type(pdf_document *doc, pdf_obj *field);\nvoid pdf_set_field_type(pdf_document *doc, pdf_obj *obj, int type);\nchar *pdf_field_value(pdf_document *doc, pdf_obj *field);\nint pdf_field_set_value(pdf_document *doc, pdf_obj *field, char *text);\nchar *pdf_field_border_style(pdf_document *doc, pdf_obj *field);\nvoid pdf_field_set_border_style(pdf_document *doc, pdf_obj *field, char *text);\nvoid pdf_field_set_button_caption(pdf_document *doc, pdf_obj *field, char *text);\nvoid pdf_field_set_fill_color(pdf_document *doc, pdf_obj *field, pdf_obj *col);\nvoid pdf_field_set_text_color(pdf_document *doc, pdf_obj *field, pdf_obj *col);\nvoid pdf_signature_set_value(pdf_document *doc, pdf_obj *field, pdf_signer *signer);\nint pdf_field_display(pdf_document *doc, pdf_obj *field);\nchar *pdf_field_name(pdf_document *doc, pdf_obj *field);\nvoid pdf_field_set_display(pdf_document *doc, pdf_obj *field, int d);\npdf_obj *pdf_lookup_field(pdf_obj *form, char *name);\nvoid pdf_field_reset(pdf_document *doc, pdf_obj *field);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/pdf/font.h",
    "content": "#ifndef MUPDF_PDF_FONT_H\n#define MUPDF_PDF_FONT_H\n\n/*\n * Font\n */\n\nenum\n{\n\tPDF_FD_FIXED_PITCH = 1 << 0,\n\tPDF_FD_SERIF = 1 << 1,\n\tPDF_FD_SYMBOLIC = 1 << 2,\n\tPDF_FD_SCRIPT = 1 << 3,\n\tPDF_FD_NONSYMBOLIC = 1 << 5,\n\tPDF_FD_ITALIC = 1 << 6,\n\tPDF_FD_ALL_CAP = 1 << 16,\n\tPDF_FD_SMALL_CAP = 1 << 17,\n\tPDF_FD_FORCE_BOLD = 1 << 18\n};\n\nvoid pdf_load_encoding(char **estrings, char *encoding);\nint pdf_lookup_agl(char *name);\nconst char **pdf_lookup_agl_duplicates(int ucs);\n\nextern const unsigned short pdf_doc_encoding[256];\nextern const char * const pdf_mac_roman[256];\nextern const char * const pdf_mac_expert[256];\nextern const char * const pdf_win_ansi[256];\nextern const char * const pdf_standard[256];\n\ntypedef struct pdf_font_desc_s pdf_font_desc;\ntypedef struct pdf_hmtx_s pdf_hmtx;\ntypedef struct pdf_vmtx_s pdf_vmtx;\n\nstruct pdf_hmtx_s\n{\n\tunsigned short lo;\n\tunsigned short hi;\n\tint w;\t/* type3 fonts can be big! */\n};\n\nstruct pdf_vmtx_s\n{\n\tunsigned short lo;\n\tunsigned short hi;\n\tshort x;\n\tshort y;\n\tshort w;\n};\n\nstruct pdf_font_desc_s\n{\n\tfz_storable storable;\n\tunsigned int size;\n\n\tfz_font *font;\n\n\t/* FontDescriptor */\n\tint flags;\n\tfloat italic_angle;\n\tfloat ascent;\n\tfloat descent;\n\tfloat cap_height;\n\tfloat x_height;\n\tfloat missing_width;\n\n\t/* Encoding (CMap) */\n\tpdf_cmap *encoding;\n\tpdf_cmap *to_ttf_cmap;\n\tint cid_to_gid_len;\n\tunsigned short *cid_to_gid;\n\n\t/* ToUnicode */\n\tpdf_cmap *to_unicode;\n\tint cid_to_ucs_len;\n\tunsigned short *cid_to_ucs;\n\n\t/* Metrics (given in the PDF file) */\n\tint wmode;\n\n\tint hmtx_len, hmtx_cap;\n\tpdf_hmtx dhmtx;\n\tpdf_hmtx *hmtx;\n\n\tint vmtx_len, vmtx_cap;\n\tpdf_vmtx dvmtx;\n\tpdf_vmtx *vmtx;\n\n\tint is_embedded;\n\n\tvoid *_vsubst; /* SumatraPDF: store vertical glyph substitution data for the font's lifetime */\n};\n\nvoid pdf_set_font_wmode(fz_context *ctx, pdf_font_desc *font, int wmode);\nvoid pdf_set_default_hmtx(fz_context *ctx, pdf_font_desc *font, int w);\nvoid pdf_set_default_vmtx(fz_context *ctx, pdf_font_desc *font, int y, int w);\nvoid pdf_add_hmtx(fz_context *ctx, pdf_font_desc *font, int lo, int hi, int w);\nvoid pdf_add_vmtx(fz_context *ctx, pdf_font_desc *font, int lo, int hi, int x, int y, int w);\nvoid pdf_end_hmtx(fz_context *ctx, pdf_font_desc *font);\nvoid pdf_end_vmtx(fz_context *ctx, pdf_font_desc *font);\npdf_hmtx pdf_lookup_hmtx(fz_context *ctx, pdf_font_desc *font, int cid);\npdf_vmtx pdf_lookup_vmtx(fz_context *ctx, pdf_font_desc *font, int cid);\n\n/* SumatraPDF: support vertical glyph substitution data */\nint pdf_ft_lookup_vgid(fz_context *ctx, pdf_font_desc *fontdesc, int gid);\nvoid pdf_ft_free_vsubst(pdf_font_desc *fontdesc);\n\nvoid pdf_load_to_unicode(pdf_document *doc, pdf_font_desc *font, char **strings, char *collection, pdf_obj *cmapstm);\n\nint pdf_font_cid_to_gid(fz_context *ctx, pdf_font_desc *fontdesc, int cid);\n\nunsigned char *pdf_lookup_builtin_font(const char *name, unsigned int *len);\nunsigned char *pdf_lookup_substitute_font(int mono, int serif, int bold, int italic, unsigned int *len);\nunsigned char *pdf_lookup_substitute_cjk_font(int ros, int serif, int wmode, unsigned int *len, int *index);\n\npdf_font_desc *pdf_load_type3_font(pdf_document *doc, pdf_obj *rdb, pdf_obj *obj);\nvoid pdf_load_type3_glyphs(pdf_document *doc, pdf_font_desc *fontdesc, int nestedDepth);\npdf_font_desc *pdf_load_font(pdf_document *doc, pdf_obj *rdb, pdf_obj *obj, int nestedDepth);\npdf_font_desc *pdf_load_hail_mary_font(pdf_document *doc);\n\n/* SumatraPDF: use locally installed fonts */\nconst char *pdf_clean_base14_name(const char *fontname);\nvoid pdf_install_load_system_font_funcs(fz_context *ctx);\n\npdf_font_desc *pdf_new_font_desc(fz_context *ctx);\npdf_font_desc *pdf_keep_font(fz_context *ctx, pdf_font_desc *fontdesc);\nvoid pdf_drop_font(fz_context *ctx, pdf_font_desc *font);\n\n#ifndef NDEBUG\nvoid pdf_print_font(fz_context *ctx, pdf_font_desc *fontdesc);\n#endif\n\nfz_rect *pdf_measure_text(fz_context *ctx, pdf_font_desc *fontdesc, unsigned char *buf, int len, fz_rect *rect);\nfloat pdf_text_stride(fz_context *ctx, pdf_font_desc *fontdesc, float fontsize, unsigned char *buf, int len, float room, int *count);\n\nvoid pdf_run_glyph(pdf_document *doc, pdf_obj *resources, fz_buffer *contents, fz_device *dev, const fz_matrix *ctm, void *gstate, int nestedDepth);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/pdf/javascript.h",
    "content": "#ifndef MUPDF_PDF_JAVASCRIPT_H\n#define MUPDF_PDF_JAVASCRIPT_H\n\ntypedef struct pdf_js_event_s\n{\n\tpdf_obj *target;\n\tchar *value;\n\tint rc;\n} pdf_js_event;\n\nvoid pdf_enable_js(pdf_document *doc);\nvoid pdf_disable_js(pdf_document *doc);\nint pdf_js_supported(pdf_document *doc);\n\nvoid pdf_js_setup_event(pdf_js *js, pdf_js_event *e);\npdf_js_event *pdf_js_get_event(pdf_js *js);\nvoid pdf_js_execute(pdf_js *js, char *code);\nvoid pdf_js_execute_count(pdf_js *js, char *code, int count);\n\n/*\n * Javascript engine interface\n */\ntypedef struct pdf_jsimp_s pdf_jsimp;\ntypedef struct pdf_jsimp_type_s pdf_jsimp_type;\ntypedef struct pdf_jsimp_obj_s pdf_jsimp_obj;\n\ntypedef void (pdf_jsimp_dtr)(void *jsctx, void *obj);\ntypedef pdf_jsimp_obj *(pdf_jsimp_method)(void *jsctx, void *obj, int argc, pdf_jsimp_obj *args[]);\ntypedef pdf_jsimp_obj *(pdf_jsimp_getter)(void *jsctx, void *obj);\ntypedef void (pdf_jsimp_setter)(void *jsctx, void *obj, pdf_jsimp_obj *val);\n\nenum\n{\n\tJS_TYPE_UNKNOWN,\n\tJS_TYPE_NULL,\n\tJS_TYPE_STRING,\n\tJS_TYPE_NUMBER,\n\tJS_TYPE_ARRAY,\n\tJS_TYPE_BOOLEAN\n};\n\npdf_jsimp *pdf_new_jsimp(fz_context *ctx, void *jsctx);\nvoid pdf_drop_jsimp(pdf_jsimp *imp);\n\npdf_jsimp_type *pdf_jsimp_new_type(pdf_jsimp *imp, pdf_jsimp_dtr *dtr, char *name);\nvoid pdf_jsimp_drop_type(pdf_jsimp *imp, pdf_jsimp_type *type);\nvoid pdf_jsimp_addmethod(pdf_jsimp *imp, pdf_jsimp_type *type, char *name, pdf_jsimp_method *meth);\nvoid pdf_jsimp_addproperty(pdf_jsimp *imp, pdf_jsimp_type *type, char *name, pdf_jsimp_getter *get, pdf_jsimp_setter *set);\nvoid pdf_jsimp_set_global_type(pdf_jsimp *imp, pdf_jsimp_type *type);\n\npdf_jsimp_obj *pdf_jsimp_new_obj(pdf_jsimp *imp, pdf_jsimp_type *type, void *obj);\nvoid pdf_jsimp_drop_obj(pdf_jsimp *imp, pdf_jsimp_obj *obj);\n\nint pdf_jsimp_to_type(pdf_jsimp *imp, pdf_jsimp_obj *obj);\n\npdf_jsimp_obj *pdf_jsimp_from_string(pdf_jsimp *imp, char *str);\nchar *pdf_jsimp_to_string(pdf_jsimp *imp, pdf_jsimp_obj *obj);\n\npdf_jsimp_obj *pdf_jsimp_from_number(pdf_jsimp *imp, double num);\ndouble pdf_jsimp_to_number(pdf_jsimp *imp, pdf_jsimp_obj *obj);\n\nint pdf_jsimp_array_len(pdf_jsimp *imp, pdf_jsimp_obj *obj);\npdf_jsimp_obj *pdf_jsimp_array_item(pdf_jsimp *imp, pdf_jsimp_obj *obj, int i);\n\npdf_jsimp_obj *pdf_jsimp_property(pdf_jsimp *imp, pdf_jsimp_obj *obj, char *prop);\n\nvoid pdf_jsimp_execute(pdf_jsimp *imp, char *code);\nvoid pdf_jsimp_execute_count(pdf_jsimp *imp, char *code, int count);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/pdf/object.h",
    "content": "#ifndef MUPDF_PDF_OBJECT_H\n#define MUPDF_PDF_OBJECT_H\n\ntypedef struct pdf_document_s pdf_document;\n\n/*\n * Dynamic objects.\n * The same type of objects as found in PDF and PostScript.\n * Used by the filters and the mupdf parser.\n */\n\ntypedef struct pdf_obj_s pdf_obj;\n\npdf_obj *pdf_new_null(pdf_document *doc);\npdf_obj *pdf_new_bool(pdf_document *doc, int b);\npdf_obj *pdf_new_int(pdf_document *doc, int i);\npdf_obj *pdf_new_real(pdf_document *doc, float f);\npdf_obj *pdf_new_name(pdf_document *doc, const char *str);\npdf_obj *pdf_new_string(pdf_document *doc, const char *str, int len);\npdf_obj *pdf_new_indirect(pdf_document *doc, int num, int gen);\npdf_obj *pdf_new_array(pdf_document *doc, int initialcap);\npdf_obj *pdf_new_dict(pdf_document *doc, int initialcap);\npdf_obj *pdf_new_rect(pdf_document *doc, const fz_rect *rect);\npdf_obj *pdf_new_matrix(pdf_document *doc, const fz_matrix *mtx);\npdf_obj *pdf_copy_array(pdf_obj *array);\npdf_obj *pdf_copy_dict(pdf_obj *dict);\n\npdf_obj *pdf_new_obj_from_str(pdf_document *doc, const char *src);\n\npdf_obj *pdf_keep_obj(pdf_obj *obj);\nvoid pdf_drop_obj(pdf_obj *obj);\n\n/* type queries */\nint pdf_is_null(pdf_obj *obj);\nint pdf_is_bool(pdf_obj *obj);\nint pdf_is_int(pdf_obj *obj);\nint pdf_is_real(pdf_obj *obj);\nint pdf_is_number(pdf_obj *obj);\nint pdf_is_name(pdf_obj *obj);\nint pdf_is_string(pdf_obj *obj);\nint pdf_is_array(pdf_obj *obj);\nint pdf_is_dict(pdf_obj *obj);\nint pdf_is_indirect(pdf_obj *obj);\nint pdf_is_stream(pdf_document *doc, int num, int gen);\n\nint pdf_objcmp(pdf_obj *a, pdf_obj *b);\n\n/* obj marking and unmarking functions - to avoid infinite recursions. */\nint pdf_obj_marked(pdf_obj *obj);\nint pdf_mark_obj(pdf_obj *obj);\nvoid pdf_unmark_obj(pdf_obj *obj);\n\n/* obj memo functions - allows us to secretly remember \"a memo\" (a bool) in\n * an object, and to read back whether there was a memo, and if so, what it\n * was. */\nvoid pdf_set_obj_memo(pdf_obj *obj, int memo);\nint pdf_obj_memo(pdf_obj *obj, int *memo);\n\n/* obj dirty bit support. */\nint pdf_obj_is_dirty(pdf_obj *obj);\nvoid pdf_dirty_obj(pdf_obj *obj);\nvoid pdf_clean_obj(pdf_obj *obj);\n\n/* safe, silent failure, no error reporting on type mismatches */\nint pdf_to_bool(pdf_obj *obj);\nint pdf_to_int(pdf_obj *obj);\nfloat pdf_to_real(pdf_obj *obj);\nchar *pdf_to_name(pdf_obj *obj);\nchar *pdf_to_str_buf(pdf_obj *obj);\npdf_obj *pdf_to_dict(pdf_obj *obj);\nint pdf_to_str_len(pdf_obj *obj);\nint pdf_to_num(pdf_obj *obj);\nint pdf_to_gen(pdf_obj *obj);\n\nint pdf_array_len(pdf_obj *array);\npdf_obj *pdf_array_get(pdf_obj *array, int i);\nvoid pdf_array_put(pdf_obj *array, int i, pdf_obj *obj);\nvoid pdf_array_push(pdf_obj *array, pdf_obj *obj);\nvoid pdf_array_push_drop(pdf_obj *array, pdf_obj *obj);\nvoid pdf_array_insert(pdf_obj *array, pdf_obj *obj, int index);\nvoid pdf_array_insert_drop(pdf_obj *array, pdf_obj *obj, int index);\nvoid pdf_array_delete(pdf_obj *array, int index);\nint pdf_array_contains(pdf_obj *array, pdf_obj *obj);\n\nint pdf_dict_len(pdf_obj *dict);\npdf_obj *pdf_dict_get_key(pdf_obj *dict, int idx);\npdf_obj *pdf_dict_get_val(pdf_obj *dict, int idx);\npdf_obj *pdf_dict_get(pdf_obj *dict, pdf_obj *key);\npdf_obj *pdf_dict_gets(pdf_obj *dict, const char *key);\npdf_obj *pdf_dict_getp(pdf_obj *dict, const char *key);\npdf_obj *pdf_dict_getsa(pdf_obj *dict, const char *key, const char *abbrev);\nvoid pdf_dict_put(pdf_obj *dict, pdf_obj *key, pdf_obj *val);\nvoid pdf_dict_puts(pdf_obj *dict, const char *key, pdf_obj *val);\nvoid pdf_dict_puts_drop(pdf_obj *dict, const char *key, pdf_obj *val);\nvoid pdf_dict_putp(pdf_obj *dict, const char *key, pdf_obj *val);\nvoid pdf_dict_putp_drop(pdf_obj *dict, const char *key, pdf_obj *val);\nvoid pdf_dict_del(pdf_obj *dict, pdf_obj *key);\nvoid pdf_dict_dels(pdf_obj *dict, const char *key);\nvoid pdf_sort_dict(pdf_obj *dict);\n\n/*\n\tRecurse through the object structure setting the node's parent_num to num.\n\tparent_num is used when a subobject is to be changed during a document edit.\n\tThe whole containing hierarchy is moved to the incremental xref section, so\n\tto be later written out as an incremental file update.\n*/\nvoid pdf_set_obj_parent(pdf_obj *obj, int num);\n\nint pdf_obj_refs(pdf_obj *ref);\n\nint pdf_obj_parent_num(pdf_obj *obj);\n\nint pdf_sprint_obj(char *s, int n, pdf_obj *obj, int tight);\nint pdf_fprint_obj(FILE *fp, pdf_obj *obj, int tight);\nint pdf_output_obj(fz_output *out, pdf_obj *obj, int tight);\n\n#ifndef NDEBUG\nvoid pdf_print_obj(pdf_obj *obj);\nvoid pdf_print_ref(pdf_obj *obj);\n#endif\n\nchar *pdf_to_utf8(pdf_document *doc, pdf_obj *src);\nunsigned short *pdf_to_ucs2(pdf_document *doc, pdf_obj *src);\npdf_obj *pdf_to_utf8_name(pdf_document *doc, pdf_obj *src);\nchar *pdf_from_ucs2(pdf_document *doc, unsigned short *str);\nvoid pdf_to_ucs2_buf(unsigned short *buffer, pdf_obj *src);\n\nfz_rect *pdf_to_rect(fz_context *ctx, pdf_obj *array, fz_rect *rect);\nfz_matrix *pdf_to_matrix(fz_context *ctx, pdf_obj *array, fz_matrix *mat);\n\npdf_document *pdf_get_indirect_document(pdf_obj *obj);\nvoid pdf_set_str_len(pdf_obj *obj, int newlen);\nvoid pdf_set_int(pdf_obj *obj, int i);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/pdf/output-pdf.h",
    "content": "#ifndef MUPDF_PDF_OUTPUT_PDF_H\n#define MUPDF_PDF_OUTPUT_PDF_H\n\n/*\n\tpdf_new_pdf_device: Create a pdf device. Rendering to the device creates\n\tnew pdf content. WARNING: this device is work in progress. It doesn't\n\tcurrently support all rendering cases.\n*/\nfz_device *pdf_new_pdf_device(pdf_document *doc, pdf_obj *contents, pdf_obj *resources, const fz_matrix *ctm);\n\n/*\n\tpdf_write_document: Write out the document to a file with all changes finalised.\n*/\nvoid pdf_write_document(pdf_document *doc, char *filename, fz_write_options *opts);\n\nvoid pdf_localise_page_resources(pdf_document *doc);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/pdf/page.h",
    "content": "#ifndef MUPDF_PDF_PAGE_H\n#define MUPDF_PDF_PAGE_H\n\nint pdf_lookup_page_number(pdf_document *doc, pdf_obj *pageobj);\nint pdf_count_pages(pdf_document *doc);\npdf_obj *pdf_lookup_page_obj(pdf_document *doc, int needle);\n/* SumatraPDF: make pdf_lookup_inherited_page_item externally available */\npdf_obj *pdf_lookup_inherited_page_item(pdf_document *doc, pdf_obj *node, const char *key);\n\n/*\n\tpdf_load_page: Load a page and its resources.\n\n\tLocates the page in the PDF document and loads the page and its\n\tresources. After pdf_load_page is it possible to retrieve the size\n\tof the page using pdf_bound_page, or to render the page using\n\tpdf_run_page_*.\n\n\tnumber: page number, where 0 is the first page of the document.\n*/\npdf_page *pdf_load_page(pdf_document *doc, int number);\n\n/* SumatraPDF: allow replacing potentially slow pdf_lookup_page_obj */\npdf_page *pdf_load_page_by_obj(pdf_document *doc, int number, pdf_obj *page_obj);\n\nfz_link *pdf_load_links(pdf_document *doc, pdf_page *page);\n\n/*\n\tpdf_bound_page: Determine the size of a page.\n\n\tDetermine the page size in user space units, taking page rotation\n\tinto account. The page size is taken to be the crop box if it\n\texists (visible area after cropping), otherwise the media box will\n\tbe used (possibly including printing marks).\n\n\tDoes not throw exceptions.\n*/\nfz_rect *pdf_bound_page(pdf_document *doc, pdf_page *page, fz_rect *);\n\n/*\n\tpdf_free_page: Frees a page and its resources.\n\n\tDoes not throw exceptions.\n*/\nvoid pdf_free_page(pdf_document *doc, pdf_page *page);\n\n/*\n\tpdf_run_page: Interpret a loaded page and render it on a device.\n\n\tpage: A page loaded by pdf_load_page.\n\n\tdev: Device used for rendering, obtained from fz_new_*_device.\n\n\tctm: A transformation matrix applied to the objects on the page,\n\te.g. to scale or rotate the page contents as desired.\n*/\nvoid pdf_run_page(pdf_document *doc, pdf_page *page, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie);\n\n/*\n\tpdf_run_page: Interpret a loaded page and render it on a device.\n\n\tpage: A page loaded by pdf_load_page.\n\n\tdev: Device used for rendering, obtained from fz_new_*_device.\n\n\tctm: A transformation matrix applied to the objects on the page,\n\te.g. to scale or rotate the page contents as desired.\n\n\tcookie: A pointer to an optional fz_cookie structure that can be used\n\tto track progress, collect errors etc.\n*/\nvoid pdf_run_page_with_usage(pdf_document *doc, pdf_page *page, fz_device *dev, const fz_matrix *ctm, char *event, fz_cookie *cookie);\n\n/*\n\tpdf_run_page_contents: Interpret a loaded page and render it on a device.\n\tJust the main page contents without the annotations\n\n\tpage: A page loaded by pdf_load_page.\n\n\tdev: Device used for rendering, obtained from fz_new_*_device.\n\n\tctm: A transformation matrix applied to the objects on the page,\n\te.g. to scale or rotate the page contents as desired.\n*/\nvoid pdf_run_page_contents(pdf_document *doc, pdf_page *page, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie);\n\n/*\n\tpdf_clean_page_contents: Clean a loaded pages rendering operations.\n\tThis involves filtering the PDF operators used to avoid (some cases\n\tof) repetition, and leaves the page in a balanced state with an\n\tunchanged top level matrix etc. Just the main page contents without\n\tthe annotations\n\n\tpage: A page loaded by pdf_load_page.\n\n\tdev: Device used for rendering, obtained from fz_new_*_device.\n\n\tcookie: A pointer to an optional fz_cookie structure that can be used\n\tto track progress, collect errors etc.\n*/\nvoid pdf_clean_page_contents(pdf_document *doc, pdf_page *page, fz_cookie *cookie);\n\n/*\n\tPresentation interface.\n*/\nfz_transition *pdf_page_presentation(pdf_document *doc, pdf_page *page, float *duration);\n\n/*\n * Page tree, pages and related objects\n */\n\nstruct pdf_page_s\n{\n\tfz_matrix ctm; /* calculated from mediabox and rotate */\n\tfz_rect mediabox;\n\tint rotate;\n\tint transparency;\n\tpdf_obj *resources;\n\tpdf_obj *contents;\n\tfz_link *links;\n\tpdf_annot *annots;\n\tpdf_annot **annot_tailp;\n\tpdf_annot *changed_annots;\n\tpdf_annot *deleted_annots;\n\tpdf_annot *tmp_annots;\n\tpdf_obj *me;\n\tfloat duration;\n\tint transition_present;\n\tfz_transition transition;\n\tint incomplete;\n};\n\nenum\n{\n\tPDF_PAGE_INCOMPLETE_CONTENTS = 1,\n\tPDF_PAGE_INCOMPLETE_ANNOTS = 2\n};\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/pdf/parse.h",
    "content": "#ifndef MUPDF_PDF_PARSE_H\n#define MUPDF_PDF_PARSE_H\n\n/*\n * tokenizer and low-level object parser\n */\n\ntypedef enum\n{\n\tPDF_TOK_ERROR, PDF_TOK_EOF,\n\tPDF_TOK_OPEN_ARRAY, PDF_TOK_CLOSE_ARRAY,\n\tPDF_TOK_OPEN_DICT, PDF_TOK_CLOSE_DICT,\n\tPDF_TOK_OPEN_BRACE, PDF_TOK_CLOSE_BRACE,\n\tPDF_TOK_NAME, PDF_TOK_INT, PDF_TOK_REAL, PDF_TOK_STRING, PDF_TOK_KEYWORD,\n\tPDF_TOK_R, PDF_TOK_TRUE, PDF_TOK_FALSE, PDF_TOK_NULL,\n\tPDF_TOK_OBJ, PDF_TOK_ENDOBJ,\n\tPDF_TOK_STREAM, PDF_TOK_ENDSTREAM,\n\tPDF_TOK_XREF, PDF_TOK_TRAILER, PDF_TOK_STARTXREF,\n\tPDF_NUM_TOKENS\n} pdf_token;\n\nvoid pdf_lexbuf_init(fz_context *ctx, pdf_lexbuf *lexbuf, int size);\nvoid pdf_lexbuf_fin(pdf_lexbuf *lexbuf);\nptrdiff_t pdf_lexbuf_grow(pdf_lexbuf *lexbuf);\n\npdf_token pdf_lex(fz_stream *f, pdf_lexbuf *lexbuf);\npdf_token pdf_lex_no_string(fz_stream *f, pdf_lexbuf *lexbuf);\n\npdf_obj *pdf_parse_array(pdf_document *doc, fz_stream *f, pdf_lexbuf *buf);\npdf_obj *pdf_parse_dict(pdf_document *doc, fz_stream *f, pdf_lexbuf *buf);\npdf_obj *pdf_parse_stm_obj(pdf_document *doc, fz_stream *f, pdf_lexbuf *buf);\npdf_obj *pdf_parse_ind_obj(pdf_document *doc, fz_stream *f, pdf_lexbuf *buf, int *num, int *gen, int *stm_ofs, int *try_repair);\n\n/*\n\tpdf_print_token: print a lexed token to a buffer, growing if necessary\n*/\nvoid pdf_print_token(fz_context *ctx, fz_buffer *buf, int tok, pdf_lexbuf *lex);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/pdf/resource.h",
    "content": "#ifndef MUPDF_PDF_RESOURCE_H\n#define MUPDF_PDF_RESOURCE_H\n\n/*\n * PDF interface to store\n */\nvoid pdf_store_item(fz_context *ctx, pdf_obj *key, void *val, unsigned int itemsize);\nvoid *pdf_find_item(fz_context *ctx, fz_store_free_fn *free, pdf_obj *key);\nvoid pdf_remove_item(fz_context *ctx, fz_store_free_fn *free, pdf_obj *key);\n\n/*\n * Functions, Colorspaces, Shadings and Images\n */\n\nfz_function *pdf_load_function(pdf_document *doc, pdf_obj *ref, int in, int out);\n\nfz_colorspace *pdf_load_colorspace(pdf_document *doc, pdf_obj *obj);\nint pdf_is_tint_colorspace(fz_colorspace *cs);\n\nfz_shade *pdf_load_shading(pdf_document *doc, pdf_obj *obj);\n\nfz_image *pdf_load_inline_image(pdf_document *doc, pdf_obj *rdb, pdf_obj *dict, fz_stream *file);\nint pdf_is_jpx_image(fz_context *ctx, pdf_obj *dict);\n\nfz_image *pdf_load_image(pdf_document *doc, pdf_obj *obj);\n\n/*\n * Pattern\n */\n\ntypedef struct pdf_pattern_s pdf_pattern;\n\nstruct pdf_pattern_s\n{\n\tfz_storable storable;\n\tint ismask;\n\tfloat xstep;\n\tfloat ystep;\n\tfz_matrix matrix;\n\tfz_rect bbox;\n\tpdf_obj *resources;\n\tpdf_obj *contents;\n};\n\npdf_pattern *pdf_load_pattern(pdf_document *doc, pdf_obj *obj);\npdf_pattern *pdf_keep_pattern(fz_context *ctx, pdf_pattern *pat);\nvoid pdf_drop_pattern(fz_context *ctx, pdf_pattern *pat);\n\n/*\n * XObject\n */\n\ntypedef struct pdf_xobject_s pdf_xobject;\n\nstruct pdf_xobject_s\n{\n\tfz_storable storable;\n\tfz_matrix matrix;\n\tfz_rect bbox;\n\tint isolated;\n\tint knockout;\n\tint transparency;\n\tfz_colorspace *colorspace;\n\tpdf_obj *resources;\n\tpdf_obj *contents;\n\tpdf_obj *me;\n\tint iteration;\n};\n\npdf_xobject *pdf_load_xobject(pdf_document *doc, pdf_obj *obj);\npdf_obj *pdf_new_xobject(pdf_document *doc, const fz_rect *bbox, const fz_matrix *mat);\npdf_xobject *pdf_keep_xobject(fz_context *ctx, pdf_xobject *xobj);\nvoid pdf_drop_xobject(fz_context *ctx, pdf_xobject *xobj);\nvoid pdf_update_xobject_contents(pdf_document *doc, pdf_xobject *form, fz_buffer *buffer);\n\nvoid pdf_update_appearance(pdf_document *doc, pdf_annot *annot);\n\n/* SumatraPDF: allow to synthesize XObjects (cf. pdf_create_annot_ex) */\npdf_xobject *pdf_create_xobject(fz_context *ctx, pdf_obj *dict);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/pdf/widget.h",
    "content": "#ifndef MUPDF_PDF_WIDGET_H\n#define MUPDF_PDF_WIDGET_H\n\n/* Types of widget */\nenum\n{\n\tPDF_WIDGET_TYPE_NOT_WIDGET = -1,\n\tPDF_WIDGET_TYPE_PUSHBUTTON,\n\tPDF_WIDGET_TYPE_CHECKBOX,\n\tPDF_WIDGET_TYPE_RADIOBUTTON,\n\tPDF_WIDGET_TYPE_TEXT,\n\tPDF_WIDGET_TYPE_LISTBOX,\n\tPDF_WIDGET_TYPE_COMBOBOX,\n\tPDF_WIDGET_TYPE_SIGNATURE\n};\n\n/* Types of text widget content */\nenum\n{\n\tPDF_WIDGET_CONTENT_UNRESTRAINED,\n\tPDF_WIDGET_CONTENT_NUMBER,\n\tPDF_WIDGET_CONTENT_SPECIAL,\n\tPDF_WIDGET_CONTENT_DATE,\n\tPDF_WIDGET_CONTENT_TIME\n};\n\n/*\n\tWidgets that may appear in PDF forms\n*/\n\n/*\n\tpdf_focused_widget: returns the currently focussed widget\n\n\tWidgets can become focussed as a result of passing in ui events.\n\tNULL is returned if there is no currently focussed widget. An\n\tapp may wish to create a native representative of the focussed\n\twidget, e.g., to collect the text for a text widget, rather than\n\trouting key strokes through pdf_pass_event.\n*/\npdf_widget *pdf_focused_widget(pdf_document *doc);\n\n/*\n\tpdf_first_widget: get first widget when enumerating\n*/\npdf_widget *pdf_first_widget(pdf_document *doc, pdf_page *page);\n\n/*\n\tpdf_next_widget: get next widget when enumerating\n*/\npdf_widget *pdf_next_widget(pdf_widget *previous);\n\n/*\n\tpdf_create_widget: create a new widget of a specific type\n*/\npdf_widget *pdf_create_widget(pdf_document *doc, pdf_page *page, int type, char *fieldname);\n\n/*\n\tpdf_widget_get_type: find out the type of a widget.\n\n\tThe type determines what widget subclass the widget\n\tcan safely be cast to.\n*/\nint pdf_widget_get_type(pdf_widget *widget);\n\n/*\n\tpdf_bound_widget: get the bounding box of a widget.\n*/\nfz_rect *pdf_bound_widget(pdf_widget *widget, fz_rect *);\n\n/*\n\tpdf_text_widget_text: Get the text currently displayed in\n\ta text widget.\n*/\nchar *pdf_text_widget_text(pdf_document *doc, pdf_widget *tw);\n\n/*\n\tpdf_widget_text_max_len: get the maximum number of\n\tcharacters permitted in a text widget\n*/\nint pdf_text_widget_max_len(pdf_document *doc, pdf_widget *tw);\n\n/*\n\tpdf_text_widget_content_type: get the type of content\n\trequired by a text widget\n*/\nint pdf_text_widget_content_type(pdf_document *doc, pdf_widget *tw);\n\n/*\n\tpdf_text_widget_set_text: Update the text of a text widget.\n\tThe text is first validated and accepted only if it passes. The\n\tfunction returns whether validation passed.\n*/\nint pdf_text_widget_set_text(pdf_document *doc, pdf_widget *tw, char *text);\n\n/*\n\tpdf_choice_widget_options: get the list of options for a list\n\tbox or combo box. Returns the number of options and fills in their\n\tnames within the supplied array. Should first be called with a\n\tNULL array to find out how big the array should be.\n*/\nint pdf_choice_widget_options(pdf_document *doc, pdf_widget *tw, char *opts[]);\n\n/*\n\tpdf_choice_widget_is_multiselect: returns whether a list box or\n\tcombo box supports selection of multiple options\n*/\nint pdf_choice_widget_is_multiselect(pdf_document *doc, pdf_widget *tw);\n\n/*\n\tpdf_choice_widget_value: get the value of a choice widget.\n\tReturns the number of options curently selected and fills in\n\tthe supplied array with their strings. Should first be called\n\twith NULL as the array to find out how big the array need to\n\tbe. The filled in elements should not be freed by the caller.\n*/\nint pdf_choice_widget_value(pdf_document *doc, pdf_widget *tw, char *opts[]);\n\n/*\n\tpdf_widget_set_value: set the value of a choice widget. The\n\tcaller should pass the number of options selected and an\n\tarray of their names\n*/\nvoid pdf_choice_widget_set_value(pdf_document *doc, pdf_widget *tw, int n, char *opts[]);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/pdf/xref.h",
    "content": "#ifndef MUPDF_PDF_XREF_H\n#define MUPDF_PDF_XREF_H\n\n/*\n\tpdf_create_object: Allocate a slot in the xref table and return a fresh unused object number.\n*/\nint pdf_create_object(pdf_document *doc);\n\n/*\n\tpdf_delete_object: Remove object from xref table, marking the slot as free.\n*/\nvoid pdf_delete_object(pdf_document *doc, int num);\n\n/*\n\tpdf_update_object: Replace object in xref table with the passed in object.\n*/\nvoid pdf_update_object(pdf_document *doc, int num, pdf_obj *obj);\n\n/*\n\tpdf_update_stream: Replace stream contents for object in xref table with the passed in buffer.\n\n\tThe buffer contents must match the /Filter setting.\n\tIf storing uncompressed data, make sure to delete the /Filter key from\n\tthe stream dictionary. If storing deflated data, make sure to set the\n\t/Filter value to /FlateDecode.\n*/\nvoid pdf_update_stream(pdf_document *doc, int num, fz_buffer *buf);\n\n/*\n * xref and object / stream api\n */\n\ntypedef struct pdf_xref_entry_s pdf_xref_entry;\n\nstruct pdf_xref_entry_s\n{\n\tchar type;\t/* 0=unset (f)ree i(n)use (o)bjstm */\n\tunsigned char flags; /* bit 0 = marked */\n\tunsigned short gen;\t/* generation / objstm index */\n\tint ofs;\t/* file offset / objstm object number */\n\tint stm_ofs;\t/* on-disk stream */\n\tfz_buffer *stm_buf; /* in-memory stream (for updated objects) */\n\tpdf_obj *obj;\t/* stored/cached object */\n};\n\nenum\n{\n\tPDF_OBJ_FLAG_MARK = 1,\n};\n\ntypedef struct pdf_xref_subsec_s pdf_xref_subsec;\n\nstruct pdf_xref_subsec_s\n{\n\tpdf_xref_subsec *next;\n\tint len;\n\tint start;\n\tpdf_xref_entry *table;\n};\n\nstruct pdf_xref_s\n{\n\tint num_objects;\n\tpdf_xref_subsec *subsec;\n\tpdf_obj *trailer;\n\tpdf_obj *pre_repair_trailer;\n};\n\npdf_xref_entry *pdf_cache_object(pdf_document *doc, int num, int gen);\n\nint pdf_count_objects(pdf_document *doc);\npdf_obj *pdf_resolve_indirect(pdf_obj *ref);\npdf_obj *pdf_load_object(pdf_document *doc, int num, int gen);\n\nfz_buffer *pdf_load_raw_stream(pdf_document *doc, int num, int gen);\nfz_buffer *pdf_load_stream(pdf_document *doc, int num, int gen);\nfz_stream *pdf_open_raw_stream(pdf_document *doc, int num, int gen);\nfz_stream *pdf_open_stream(pdf_document *doc, int num, int gen);\n\nfz_stream *pdf_open_inline_stream(pdf_document *doc, pdf_obj *stmobj, int length, fz_stream *chain, fz_compression_params *params);\nfz_compressed_buffer *pdf_load_compressed_stream(pdf_document *doc, int num, int gen);\nvoid pdf_load_compressed_inline_image(pdf_document *doc, pdf_obj *dict, int length, fz_stream *cstm, int indexed, fz_image *image);\nfz_stream *pdf_open_stream_with_offset(pdf_document *doc, int num, int gen, pdf_obj *dict, int stm_ofs);\nfz_stream *pdf_open_compressed_stream(fz_context *ctx, fz_compressed_buffer *);\nfz_stream *pdf_open_contents_stream(pdf_document *doc, pdf_obj *obj);\nfz_buffer *pdf_load_raw_renumbered_stream(pdf_document *doc, int num, int gen, int orig_num, int orig_gen);\nfz_buffer *pdf_load_renumbered_stream(pdf_document *doc, int num, int gen, int orig_num, int orig_gen, int *truncated);\nfz_stream *pdf_open_raw_renumbered_stream(pdf_document *doc, int num, int gen, int orig_num, int orig_gen);\n\npdf_obj *pdf_trailer(pdf_document *doc);\nvoid pdf_set_populating_xref_trailer(pdf_document *doc, pdf_obj *trailer);\nint pdf_xref_len(pdf_document *doc);\npdf_xref_entry *pdf_get_populating_xref_entry(pdf_document *doc, int i);\npdf_xref_entry *pdf_get_xref_entry(pdf_document *doc, int i);\nvoid pdf_replace_xref(pdf_document *doc, pdf_xref_entry *entries, int n);\nvoid pdf_xref_ensure_incremental_object(pdf_document *doc, int num);\nint pdf_xref_is_incremental(pdf_document *doc, int num);\n\nvoid pdf_repair_xref(pdf_document *doc);\nvoid pdf_repair_obj_stms(pdf_document *doc);\npdf_obj *pdf_new_ref(pdf_document *doc, pdf_obj *obj);\nvoid pdf_ensure_solid_xref(pdf_document *doc, int num);\nvoid pdf_mark_xref(pdf_document *doc);\nvoid pdf_clear_xref(pdf_document *doc);\nvoid pdf_clear_xref_to_mark(pdf_document *doc);\n\nint pdf_repair_obj(pdf_document *doc, pdf_lexbuf *buf, int *stmofsp, int *stmlenp, pdf_obj **encrypt, pdf_obj **id, pdf_obj **page, int *tmpofs);\n\npdf_obj *pdf_progressive_advance(pdf_document *doc, int pagenum);\n\nvoid pdf_print_xref(pdf_document *);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/pdf-tools.h",
    "content": "#ifndef MUPDF_PDF_TOOLS_PDF_H\n#define MUPDF_PDF_TOOLS_PDF_H\n\nint pdfclean_main(int argc, char **argv);\n\n#endif"
  },
  {
    "path": "mupdf/include/mupdf/pdf.h",
    "content": "#ifndef MUPDF_PDF_H\n#define MUPDF_PDF_H\n\n#include \"mupdf/fitz.h\"\n\n#include \"mupdf/pdf/object.h\"\n#include \"mupdf/pdf/document.h\"\n#include \"mupdf/pdf/parse.h\"\n#include \"mupdf/pdf/xref.h\"\n#include \"mupdf/pdf/crypt.h\"\n\n#include \"mupdf/pdf/page.h\"\n#include \"mupdf/pdf/resource.h\"\n#include \"mupdf/pdf/cmap.h\"\n#include \"mupdf/pdf/font.h\"\n\n#include \"mupdf/pdf/annot.h\"\n#include \"mupdf/pdf/field.h\"\n#include \"mupdf/pdf/widget.h\"\n#include \"mupdf/pdf/appearance.h\"\n#include \"mupdf/pdf/event.h\"\n#include \"mupdf/pdf/javascript.h\"\n\n#include \"mupdf/pdf/output-pdf.h\"\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/tiff.h",
    "content": "#ifndef MUPDF_TIFF_H\n#define MUPDF_TIFF_H\n\n#include \"mupdf/fitz.h\"\n\ntypedef struct tiff_document_s tiff_document;\ntypedef struct tiff_page_s tiff_page;\n\n/*\n\ttiff_open_document: Open a document.\n\n\tOpen a document for reading so the library is able to locate\n\tobjects and pages inside the file.\n\n\tThe returned tiff_document should be used when calling most\n\tother functions. Note that it wraps the context, so those\n\tfunctions implicitly get access to the global state in\n\tcontext.\n\n\tfilename: a path to a file as it would be given to open(2).\n*/\ntiff_document *tiff_open_document(fz_context *ctx, const char *filename);\n\n/*\n\ttiff_open_document_with_stream: Opens a document.\n\n\tSame as tiff_open_document, but takes a stream instead of a\n\tfilename to locate the document to open. Increments the\n\treference count of the stream. See fz_open_file,\n\tfz_open_file_w or fz_open_fd for opening a stream, and\n\tfz_close for closing an open stream.\n*/\ntiff_document *tiff_open_document_with_stream(fz_context *ctx, fz_stream *file);\n\n/*\n\ttiff_close_document: Closes and frees an opened document.\n\n\tThe resource store in the context associated with tiff_document\n\tis emptied.\n\n\tDoes not throw exceptions.\n*/\nvoid tiff_close_document(tiff_document *doc);\n\nint tiff_count_pages(tiff_document *doc);\ntiff_page *tiff_load_page(tiff_document *doc, int number);\nfz_rect *tiff_bound_page(tiff_document *doc, tiff_page *page, fz_rect *rect);\nvoid tiff_free_page(tiff_document *doc, tiff_page *page);\nvoid tiff_run_page(tiff_document *doc, tiff_page *page, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie);\n\n#endif\n"
  },
  {
    "path": "mupdf/include/mupdf/xps.h",
    "content": "#ifndef MUPDF_XPS_H\n#define MUPDF_XPS_H\n\n#include \"mupdf/fitz.h\"\n\ntypedef struct xps_document_s xps_document;\ntypedef struct xps_page_s xps_page;\n\n/*\n\txps_open_document: Open a document.\n\n\tOpen a document for reading so the library is able to locate\n\tobjects and pages inside the file.\n\n\tThe returned xps_document should be used when calling most\n\tother functions. Note that it wraps the context, so those\n\tfunctions implicitly get access to the global state in\n\tcontext.\n\n\tfilename: a path to a file as it would be given to open(2).\n*/\nxps_document *xps_open_document(fz_context *ctx, const char *filename);\n\n/*\n\txps_open_document_with_stream: Opens a document.\n\n\tSame as xps_open_document, but takes a stream instead of a\n\tfilename to locate the document to open. Increments the\n\treference count of the stream. See fz_open_file,\n\tfz_open_file_w or fz_open_fd for opening a stream, and\n\tfz_close for closing an open stream.\n*/\nxps_document *xps_open_document_with_stream(fz_context *ctx, fz_stream *file);\n\n/*\n\txps_close_document: Closes and frees an opened document.\n\n\tThe resource store in the context associated with xps_document\n\tis emptied.\n\n\tDoes not throw exceptions.\n*/\nvoid xps_close_document(xps_document *doc);\n\nint xps_count_pages(xps_document *doc);\nxps_page *xps_load_page(xps_document *doc, int number);\nfz_rect *xps_bound_page(xps_document *doc, xps_page *page, fz_rect *rect);\nvoid xps_run_page(xps_document *doc, xps_page *page, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie);\nfz_link *xps_load_links(xps_document *doc, xps_page *page);\nvoid xps_free_page(xps_document *doc, xps_page *page);\n\nfz_outline *xps_load_outline(xps_document *doc);\n\n/* xps-internal.h */\n\n/*\n * Memory, and string functions.\n */\n\nint xps_strcasecmp(char *a, char *b);\nvoid xps_resolve_url(char *output, char *base_uri, char *path, int output_size);\nint xps_url_is_remote(char *path);\nchar *xps_parse_point(char *s_in, float *x, float *y);\n\n/*\n * Container parts.\n */\n\ntypedef struct xps_part_s xps_part;\n\nstruct xps_part_s\n{\n\tchar *name;\n\tint size;\n\tunsigned char *data;\n};\n\nint xps_has_part(xps_document *doc, char *partname);\nxps_part *xps_read_part(xps_document *doc, char *partname);\nvoid xps_free_part(xps_document *doc, xps_part *part);\n\n/*\n * Document structure.\n */\n\ntypedef struct xps_fixdoc_s xps_fixdoc;\ntypedef struct xps_target_s xps_target;\n\nstruct xps_fixdoc_s\n{\n\tchar *name;\n\tchar *outline;\n\txps_fixdoc *next;\n};\n\nstruct xps_page_s\n{\n\tchar *name;\n\tint number;\n\tint width;\n\tint height;\n\tfz_xml *root;\n\tint links_resolved;\n\tfz_link *links;\n\txps_page *next;\n};\n\nstruct xps_target_s\n{\n\tchar *name;\n\tint page;\n\txps_target *next;\n\tfz_rect rect; /* SumatraPDF: extended link support */\n};\n\nvoid xps_read_page_list(xps_document *doc);\nvoid xps_print_page_list(xps_document *doc);\nvoid xps_free_page_list(xps_document *doc);\n\nint xps_lookup_link_target(xps_document *doc, char *target_uri);\nvoid xps_add_link(xps_document *doc, const fz_rect *area, char *base_uri, char *target_uri);\n\n/* SumatraPDF: extended link support */\nxps_target *xps_lookup_link_target_obj(xps_document *doc, char *target_uri);\n\n/*\n * Images, fonts, and colorspaces.\n */\n\ntypedef struct xps_font_cache_s xps_font_cache;\n\nstruct xps_font_cache_s\n{\n\tchar *name;\n\tfz_font *font;\n\txps_font_cache *next;\n};\n\ntypedef struct xps_glyph_metrics_s xps_glyph_metrics;\n\nstruct xps_glyph_metrics_s\n{\n\tfloat hadv, vadv, vorg;\n};\n\nint xps_count_font_encodings(fz_font *font);\nvoid xps_identify_font_encoding(fz_font *font, int idx, int *pid, int *eid);\nvoid xps_select_font_encoding(fz_font *font, int idx);\nint xps_encode_font_char(fz_font *font, int key);\n\nvoid xps_measure_font_glyph(xps_document *doc, fz_font *font, int gid, xps_glyph_metrics *mtx);\n\nvoid xps_print_path(xps_document *doc);\n\nvoid xps_parse_color(xps_document *doc, char *base_uri, char *hexstring, fz_colorspace **csp, float *samples);\nvoid xps_set_color(xps_document *doc, fz_colorspace *colorspace, float *samples);\n\n/*\n * Resource dictionaries.\n */\n\ntypedef struct xps_resource_s xps_resource;\n\nstruct xps_resource_s\n{\n\tchar *name;\n\tchar *base_uri; /* only used in the head nodes */\n\tfz_xml *base_xml; /* only used in the head nodes, to free the xml document */\n\tfz_xml *data;\n\txps_resource *next;\n\txps_resource *parent; /* up to the previous dict in the stack */\n};\n\nxps_resource * xps_parse_resource_dictionary(xps_document *doc, char *base_uri, fz_xml *root);\nvoid xps_free_resource_dictionary(xps_document *doc, xps_resource *dict);\nvoid xps_resolve_resource_reference(xps_document *doc, xps_resource *dict, char **attp, fz_xml **tagp, char **urip);\n\nvoid xps_print_resource_dictionary(xps_resource *dict);\n\n/*\n * Fixed page/graphics parsing.\n */\n\nvoid xps_parse_fixed_page(xps_document *doc, const fz_matrix *ctm, xps_page *page);\nvoid xps_parse_canvas(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, char *base_uri, xps_resource *dict, fz_xml *node);\nvoid xps_parse_path(xps_document *doc, const fz_matrix *ctm, char *base_uri, xps_resource *dict, fz_xml *node);\nvoid xps_parse_glyphs(xps_document *doc, const fz_matrix *ctm, char *base_uri, xps_resource *dict, fz_xml *node);\nvoid xps_parse_solid_color_brush(xps_document *doc, const fz_matrix *ctm, char *base_uri, xps_resource *dict, fz_xml *node);\nvoid xps_parse_image_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, char *base_uri, xps_resource *dict, fz_xml *node);\nvoid xps_parse_visual_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, char *base_uri, xps_resource *dict, fz_xml *node);\nvoid xps_parse_linear_gradient_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, char *base_uri, xps_resource *dict, fz_xml *node);\nvoid xps_parse_radial_gradient_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, char *base_uri, xps_resource *dict, fz_xml *node);\n\nvoid xps_parse_tiling_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, char *base_uri, xps_resource *dict, fz_xml *root, void(*func)(xps_document*, const fz_matrix *, const fz_rect *, char*, xps_resource*, fz_xml*, void*), void *user);\n\nvoid xps_parse_matrix_transform(xps_document *doc, fz_xml *root, fz_matrix *matrix);\nvoid xps_parse_render_transform(xps_document *doc, char *text, fz_matrix *matrix);\nvoid xps_parse_rectangle(xps_document *doc, char *text, fz_rect *rect);\n\nvoid xps_begin_opacity(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, char *base_uri, xps_resource *dict, char *opacity_att, fz_xml *opacity_mask_tag);\nvoid xps_end_opacity(xps_document *doc, char *base_uri, xps_resource *dict, char *opacity_att, fz_xml *opacity_mask_tag);\n\nvoid xps_parse_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, char *base_uri, xps_resource *dict, fz_xml *node);\nvoid xps_parse_element(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, char *base_uri, xps_resource *dict, fz_xml *node);\n\nvoid xps_clip(xps_document *doc, const fz_matrix *ctm, xps_resource *dict, char *clip_att, fz_xml *clip_tag);\n\nfz_xml *xps_lookup_alternate_content(fz_xml *node);\n\n/*\n * The interpreter context.\n */\n\ntypedef struct xps_entry_s xps_entry;\n\nstruct xps_entry_s\n{\n\tchar *name;\n\tint offset;\n\tint csize;\n\tint usize;\n};\n\nstruct xps_document_s\n{\n\tfz_document super;\n\tfz_context *ctx;\n\tfz_archive *zip;\n\n\tchar *start_part; /* fixed document sequence */\n\txps_fixdoc *first_fixdoc; /* first fixed document */\n\txps_fixdoc *last_fixdoc; /* last fixed document */\n\txps_page *first_page; /* first page of document */\n\txps_page *last_page; /* last page of document */\n\tint page_count;\n\n\txps_target *target; /* link targets */\n\n\tchar *base_uri; /* base uri for parsing XML and resolving relative paths */\n\tchar *part_uri; /* part uri for parsing metadata relations */\n\n\t/* We cache font resources */\n\txps_font_cache *font_table;\n\n\t/* Opacity attribute stack */\n\tfloat opacity[64];\n\tint opacity_top;\n\n\t/* Current color */\n\tfz_colorspace *colorspace;\n\tfloat color[8];\n\tfloat alpha;\n\n\t/* Current device */\n\tfz_cookie *cookie;\n\tfz_device *dev;\n\n\t/* Current page we are loading */\n\txps_page *current_page;\n\n\t/* SumatraPDF: better canvas bounds estimates for links/targets */\n\tstruct {\n\t\tfz_link *link;\n\t\tfz_rect rect;\n\t} _clinks[10];\n\tint _clinks_len;\n};\n\n/* SumatraPDF: extended link support */\nvoid xps_extract_anchor_info(xps_document *doc, const fz_rect *rect, char *target_uri, char *anchor_name, int step);\n\n#endif\n"
  },
  {
    "path": "mupdf/makefile.msvc",
    "content": "# nmake -f makefile.msvc\n# Arguments:\n# CFG=dbg|rel (default: dbg)\n# EXTDIR=<directory where zlib/freetype/jpeg lib live> (default: ..\\ext)\n#  e.g. ..\\sumatrapdf\\ext\n# NASM=<path to nasm.exe> (default: ..\\bin\\nasm.exe)\n# PLATFORM=X86\n#  the PLATFORM var is usually set in the x64 and x64 cross tools Visual Studio command prompt\n#  note: building on X64 isn't officially supported and might unintentionally be broken\n\n# Set default configuration\n!if \"$(CFG)\"==\"\"\nCFG=dbg\n!endif\n!if \"$(PLATFORM)\"==\"\"\nPLATFORM=X86\n!elseif \"$(PLATFORM)\"==\"x64\" || \"$(TARGET_CPU)\"==\"x64\"\nPLATFORM = X64\n!endif\n\n# O is directory where object and binary files go\n!if \"$(O)\"==\"\"\nO = obj-$(CFG)-win\n!if \"$(PLATFORM)\"==\"X64\"\nO = $(O)64\n!endif\n!endif\n\nOZ  = $(O)\\zlib\nOFT = $(O)\\freetype\nOT  = $(O)\\jpegturbo\nOOJ = $(O)\\openjpeg\nOJB = $(O)\\jbig2\nOFZ = $(O)\\fitz\nOP  = $(O)\\mupdf\nOX  = $(O)\\muxps\nOA  = $(O)\\muapps\n\n# To over-ride location of fitz/mupdf sources, define MUPDF_DIR\n# e.g.:\n#MUPDF_DIR=..\\mupdf\n\n!if \"$(MUPDF_DIR)\"==\"\"\nMUPDF_DIR=.\n!endif\n\n!if \"$(EXTDIR)\"==\"\"\nEXTDIR=..\\ext\n!endif\n\nZLIB_DIR=$(EXTDIR)\\zlib\nFREETYPE_DIR=$(EXTDIR)\\freetype2\nJPEG_TURBO_DIR=$(EXTDIR)\\libjpeg-turbo\nOPENJPEG_DIR=$(EXTDIR)\\openjpeg\nJBIG2_DIR=$(EXTDIR)\\jbig2dec\nMUPDF_GEN_DIR = $(MUPDF_DIR)\\generated\n\n# by default, the included NASM is used\n# (path relative to EXTDIR for when an external MuPDF is built)\n# TODO: does NASM have to be replaceable at all?\n!if \"$(NASM)\"==\"\"\nNASM=$(EXTDIR)\\..\\bin\\nasm.exe\n!endif\n\nCC = cl.exe\nLD = link.exe\n\n# CFLAGSB - CFLAGS base (use CFLAGS or CFLAGSOPT later on)\nCFLAGSB = $(CFLAGSB) /nologo /c\n\n# standard windows defines\n!if \"$(PLATFORM)\"==\"X64\"\nCFLAGSB = $(CFLAGSB) /D \"WIN64\" /D \"_WIN64\"\n!endif\n# WIN32 means any Windows, not just 32-bit Windows\nCFLAGSB = $(CFLAGSB) /D \"WIN32\" /D \"_WIN32\"\n\n# /WX  : treat warnings as errors\n# /GR- : disable RTTI\n# /Zi  : enable debug information\n# /GS  : enable security checks\n# /Gy  : separate functions for linker\n# /GF  : enable read-only string pooling\n# /MP  : use muliple processors to speed up compilation\n# Note: /MP not used as it might be causing extreme flakiness on EC2 buildbot\nCFLAGSB = $(CFLAGSB) /WX /GR- /Zi /GS /Gy /GF\n\n# disable the default /arch:SSE2 for 32-bit builds\n!if \"$(PLATFORM)\"!=\"X64\"\nCFLAGSB = $(CFLAGSB) /arch:IA32\n!endif\n\n# /EHs-c- : disable C++ exceptions (generates smaller binaries, requires _HAS_EXCEPTIONS to be 0)\nCFLAGSB = $(CFLAGSB) /EHs-c- /D \"_HAS_EXCEPTIONS=0\"\n\n# /W4  : bump warnings level from 1 to 4\nCFLAGSB = $(CFLAGSB) /W4\n# warnings that might not make sense to fix:\n# 4324 : structure was padded due to __declspec(align())\nCFLAGSB = $(CFLAGSB) /wd4100 /wd4324\n# warnings that happen only in VS2015 (and later)\n# 4458 : declaration of '*' hides class member\n#        (happens rather often all over the place)\n# 4838 : 'conversion from '*' to '*' requires a narrowing conversion\n#        (QITABENT triggers this)\nCFLAGSB = $(CFLAGSB) /wd4458 /wd4838\n\n!if \"$(PLATFORM)$(STRICT_X64)\"==\"X64\"\n# disable warnings-as-errors for x64 builds (unless STRICT_X64 is set)\nCFLAGSB = $(CFLAGSB: /WX = )\n!endif\n\n# /Ox  : maximum optimizations\n# /O2  : maximize speed\n# docs say /Ox better, my tests say /O2 better\nCFLAGSOPT = $(CFLAGSB) /O2 /D \"NDEBUG\"\n\nLDFLAGS = $(LDFLAGS) /nologo /DEBUG /RELEASE /opt:ref /opt:icf /MACHINE:$(PLATFORM)\n\n!if \"$(CFG)\"!=\"dbg\"\n# /GL  : enable link-time code generation\nCFLAGS  = $(CFLAGSOPT) /GL\nLDFLAGS = $(LDFLAGS) /LTCG\n# /DYNAMICBASE and /NXCOMPAT for better protection against stack overflows\n# http://blogs.msdn.com/vcblog/archive/2009/05/21/dynamicbase-and-nxcompat.aspx\n# We don't use /NXCOMPAT because we need to turn it on/off at runtime\nLDFLAGS = $(LDFLAGS) /DYNAMICBASE /FIXED:NO\n!else\n# /MTd  : statically link debug crt (libcmtd.lib)\nCFLAGSB = $(CFLAGSB) /MTd\n# /RTCs : stack frame runtime checking\n# /RTCu : ununitialized local usage checks\n# /Od   : disable optimizations\nCFLAGS = $(CFLAGSB) /Od /RTCs /RTCu\n!endif\n\n!if \"$(PLATFORM)\"==\"X64\"\nLDFLAGS=$(LDFLAGS) /SUBSYSTEM:WINDOWS,5.2\n!else\nLDFLAGS=$(LDFLAGS) /SUBSYSTEM:WINDOWS,5.1\n!endif\n\nZLIB_CFLAGS = $(CFLAGSOPT) /TC /wd4127 /wd4131 /wd4244 /wd4996 /I$(ZLIB_DIR)\n\nFREETYPE_CFLAGS = $(CFLAGSOPT) /TC /I$(FREETYPE_DIR)/config /I$(FREETYPE_DIR)/include \\\n\t/D \"FT2_BUILD_LIBRARY\" /D \"FT_OPTION_AUTOFIT2\" /wd4127 /wd4244 /wd4703 /wd4996\n\nJBIG2_CFLAGS = $(CFLAGS) /TC /D \"HAVE_STRING_H=1\" /D \"JBIG_NO_MEMENTO\" /I$(JBIG2_DIR)\nJBIG2_CFLAGS = $(JBIG2_CFLAGS) /wd4018 /wd4100 /wd4127 /wd4244 /wd4701 /wd4996\n\nOPENJPEG_CFLAGS = $(CFLAGS) /TC /I$(OPENJPEG_DIR) /wd4127 /wd4244 /wd4819 /wd4996\n\nJPEG_TURBO_CFLAGS = $(CFLAGS) /TC /I$(JPEG_TURBO_DIR) /I$(JPEG_TURBO_DIR)\\simd\nJPEG_TURBO_CFLAGS = $(JPEG_TURBO_CFLAGS) /wd4018 /wd4100 /wd4101 /wd4127 /wd4244 /wd4245 /wd4996\n!if \"$(PLATFORM)\"==\"X64\"\nJPEG_TURBO_NASM_FLAGS = -D__x86_64__ -DWIN64 -DMSVC -I $(JPEG_TURBO_DIR)\\simd\\ -I $(JPEG_TURBO_DIR)\\win\\ -f win64\n!else\nJPEG_TURBO_NASM_FLAGS = -I $(JPEG_TURBO_DIR)\\simd\\ -I $(JPEG_TURBO_DIR)\\win\\ -f win32\n!endif\n\n!if \"$(PLATFORM)\"==\"X64\"\nMUPDF_NASM_FLAGS = -D__x86_64__ -DWIN64 -DMSVC -I $(MUPDF_DIR)\\ -f win64\n!else\nMUPDF_NASM_FLAGS = -I $(MUPDF_DIR)\\ -f win32\n!endif\n\nMUPDF_CFLAGS = $(CFLAGS) /TC /I$(MUPDF_DIR)/include /I$(MUPDF_DIR)/generated \\\n\t/I$(FREETYPE_DIR)/config /I$(FREETYPE_DIR)/include /I$(ZLIB_DIR) \\\n\t/I$(JBIG2_DIR) /I$(JPEG_TURBO_DIR) /D \"SHARE_JPEG\" /I$(OPENJPEG_DIR)\n\n!if \"$(CFG)\"==\"dbg\"\nMUPDF_CFLAGS = $(MUPDF_CFLAGS) /D \"DEBUG\"\n!endif\n\n# Make it easy to compile in a CJK fallback font\n!if \"$(WITHCJKFONT)\"==\"\"\nMUPDF_CFLAGS = $(MUPDF_CFLAGS) /D \"NOCJKFONT\"\n!else\nMUPDF_CFLAGS = $(MUPDF_CFLAGS) /D \"NOCJKFULL\"\n!endif\n\n!if \"$(PLATFORM)\"==\"X64\"\n# disable warning C4244: conversion from 'type1' to 'type2', possible loss of data\n#     and warning C4267: conversion from 'size_t' to 'type', possible loss of data\nFREETYPE_CFLAGS = $(FREETYPE_CFLAGS) /wd4244 /wd4267\nJBIG2_CFLAGS = $(JBIG2_CFLAGS) /wd4267\nOPENJPEG_CFLAGS = $(OPENJPEG_CFLAGS) /wd4267\nJPEG_TURBO_CFLAGS = $(JPEG_TURBO_CFLAGS) /wd4267\nMUPDF_CFLAGS  = $(MUPDF_CFLAGS) /wd4267\n!endif\n\nLIBS = $(LIBS) advapi32.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib shell32.lib ole32.lib WindowsCodecs.lib\n\nFT_OBJS = \\\n\t$(OFT)\\ftbase.obj $(OFT)\\ftbbox.obj $(OFT)\\ftbitmap.obj $(OFT)\\ftgasp.obj \\\n\t$(OFT)\\ftglyph.obj $(OFT)\\ftinit.obj $(OFT)\\ftstroke.obj $(OFT)\\ftsynth.obj \\\n\t$(OFT)\\ftsystem.obj $(OFT)\\fttype1.obj $(OFT)\\ftxf86.obj $(OFT)\\cff.obj \\\n\t$(OFT)\\type1cid.obj $(OFT)\\psaux.obj $(OFT)\\psnames.obj $(OFT)\\smooth.obj \\\n\t$(OFT)\\sfnt.obj $(OFT)\\truetype.obj $(OFT)\\type1.obj $(OFT)\\raster.obj \\\n\t$(OFT)\\otvalid.obj $(OFT)\\ftotval.obj $(OFT)\\pshinter.obj $(OFT)\\ftgzip.obj\n!if \"$(CFG)\"==\"dbg\"\nFT_OBJS = $(FT_OBJS) $(OFT)\\ftdebug.obj\n!endif\n\nZLIB_OBJS = \\\n\t$(OZ)\\adler32.obj $(OZ)\\compress.obj $(OZ)\\crc32.obj $(OZ)\\deflate.obj \\\n\t$(OZ)\\inffast.obj $(OZ)\\inflate.obj $(OZ)\\inftrees.obj $(OZ)\\trees.obj \\\n\t$(OZ)\\zutil.obj \\\n\t$(OZ)\\gzlib.obj $(OZ)\\gzread.obj $(OZ)\\gzwrite.obj $(OZ)\\gzclose.obj\n\nJPEG_TURBO_OBJS = \\\n\t$(OT)\\jcomapi.obj $(OT)\\jdapimin.obj $(OT)\\jdapistd.obj \\\n\t$(OT)\\jdatadst.obj $(OT)\\jdatasrc.obj $(OT)\\jdcoefct.obj $(OT)\\jdcolor.obj $(OT)\\jddctmgr.obj \\\n\t$(OT)\\jdhuff.obj $(OT)\\jdinput.obj $(OT)\\jdmainct.obj $(OT)\\jdmarker.obj $(OT)\\jdmaster.obj \\\n\t$(OT)\\jdmerge.obj $(OT)\\jdpostct.obj $(OT)\\jdsample.obj $(OT)\\jdtrans.obj $(OT)\\jerror.obj \\\n\t$(OT)\\jfdctflt.obj $(OT)\\jfdctint.obj $(OT)\\jidctflt.obj $(OT)\\jidctfst.obj $(OT)\\jidctint.obj \\\n\t$(OT)\\jquant1.obj $(OT)\\jquant2.obj $(OT)\\jutils.obj $(OT)\\jmemmgr.obj $(OT)\\jmemnobs.obj \\\n\t$(OT)\\jaricom.obj $(OT)\\jdarith.obj $(OT)\\jfdctfst.obj $(OT)\\jdphuff.obj $(OT)\\jidctred.obj\n\n!if \"$(PLATFORM)\"==\"X64\"\nJPEG_TURBO_OBJS = $(JPEG_TURBO_OBJS) \\\n\t$(OT)\\jfsseflt-64.obj $(OT)\\jccolss2-64.obj $(OT)\\jdcolss2-64.obj $(OT)\\jcgrass2-64.obj \\\n\t$(OT)\\jcsamss2-64.obj $(OT)\\jdsamss2-64.obj $(OT)\\jdmerss2-64.obj $(OT)\\jcqnts2i-64.obj  \\\n\t$(OT)\\jfss2fst-64.obj $(OT)\\jfss2int-64.obj $(OT)\\jiss2red-64.obj $(OT)\\jiss2int-64.obj \\\n\t$(OT)\\jiss2fst-64.obj $(OT)\\jcqnts2f-64.obj $(OT)\\jiss2flt-64.obj $(OT)\\jsimd_x86_64.obj\n!else\nJPEG_TURBO_OBJS = $(JPEG_TURBO_OBJS) \\\n\t$(OT)\\jsimdcpu.obj $(OT)\\jccolmmx.obj $(OT)\\jcgrammx.obj $(OT)\\jdcolmmx.obj \\\n\t$(OT)\\jcsammmx.obj $(OT)\\jdsammmx.obj $(OT)\\jdmermmx.obj $(OT)\\jcqntmmx.obj \\\n\t$(OT)\\jfmmxfst.obj $(OT)\\jfmmxint.obj $(OT)\\jimmxred.obj $(OT)\\jimmxint.obj \\\n\t$(OT)\\jimmxfst.obj $(OT)\\jcqnt3dn.obj $(OT)\\jf3dnflt.obj $(OT)\\ji3dnflt.obj \\\n\t$(OT)\\jcqntsse.obj $(OT)\\jfsseflt.obj $(OT)\\jisseflt.obj $(OT)\\jccolss2.obj \\\n\t$(OT)\\jcgrass2.obj $(OT)\\jdcolss2.obj $(OT)\\jcsamss2.obj $(OT)\\jdsamss2.obj \\\n\t$(OT)\\jdmerss2.obj $(OT)\\jcqnts2i.obj $(OT)\\jfss2fst.obj $(OT)\\jfss2int.obj \\\n\t$(OT)\\jiss2red.obj $(OT)\\jiss2int.obj $(OT)\\jiss2fst.obj $(OT)\\jcqnts2f.obj \\\n\t$(OT)\\jiss2flt.obj $(OT)\\jsimd_i386.obj\n!endif\n\nJBIG2_OBJS = \\\n\t$(OJB)\\jbig2.obj $(OJB)\\jbig2_arith.obj $(OJB)\\jbig2_arith_int.obj \\\n\t$(OJB)\\jbig2_arith_iaid.obj $(OJB)\\jbig2_huffman.obj $(OJB)\\jbig2_segment.obj \\\n\t$(OJB)\\jbig2_page.obj $(OJB)\\jbig2_symbol_dict.obj $(OJB)\\jbig2_text.obj \\\n\t$(OJB)\\jbig2_generic.obj $(OJB)\\jbig2_refinement.obj $(OJB)\\jbig2_mmr.obj \\\n\t$(OJB)\\jbig2_image.obj $(OJB)\\jbig2_metadata.obj $(OJB)\\jbig2_halftone.obj\n\nOPENJPEG_OBJS = \\\n\t$(OOJ)\\bio.obj $(OOJ)\\cio.obj $(OOJ)\\dwt.obj $(OOJ)\\event.obj $(OOJ)\\function_list.obj \\\n\t$(OOJ)\\image.obj $(OOJ)\\invert.obj $(OOJ)\\j2k.obj $(OOJ)\\jp2.obj $(OOJ)\\mct.obj \\\n\t$(OOJ)\\mqc.obj $(OOJ)\\openjpeg.obj $(OOJ)\\pi.obj $(OOJ)\\raw.obj $(OOJ)\\t1.obj \\\n\t$(OOJ)\\t2.obj $(OOJ)\\tcd.obj $(OOJ)\\tgt.obj $(OOJ)\\cidx_manager.obj $(OOJ)\\phix_manager.obj \\\n\t$(OOJ)\\ppix_manager.obj $(OOJ)\\thix_manager.obj $(OOJ)\\tpix_manager.obj $(OOJ)\\opj_clock.obj\n\nDRAW_OBJS = \\\n\t$(OFZ)\\draw-affine.obj $(OFZ)\\draw-blend.obj $(OFZ)\\draw-device.obj $(OFZ)\\draw-edge.obj \\\n\t$(OFZ)\\draw-glyph.obj $(OFZ)\\draw-mesh.obj $(OFZ)\\draw-paint.obj $(OFZ)\\draw-path.obj \\\n\t$(OFZ)\\draw-scale-simple.obj $(OFZ)\\draw-unpack.obj\n\nFITZ_OBJS = \\\n\t$(OFZ)\\bbox-device.obj $(OFZ)\\bitmap.obj $(OFZ)\\buffer.obj $(OFZ)\\colorspace.obj \\\n\t$(OFZ)\\compressed-buffer.obj $(OFZ)\\context.obj $(OFZ)\\crypt-aes.obj $(OFZ)\\crypt-arc4.obj \\\n\t$(OFZ)\\crypt-md5.obj $(OFZ)\\crypt-sha2.obj $(OFZ)\\device.obj $(OFZ)\\error.obj \\\n\t$(OFZ)\\filter-basic.obj $(OFZ)\\filter-dct.obj $(OFZ)\\filter-fax.obj $(OFZ)\\filter-flate.obj \\\n\t$(OFZ)\\filter-jbig2.obj $(OFZ)\\filter-lzw.obj $(OFZ)\\filter-predict.obj $(OFZ)\\font.obj \\\n\t$(OFZ)\\function.obj $(OFZ)\\geometry.obj $(OFZ)\\getopt.obj $(OFZ)\\halftone.obj \\\n\t$(OFZ)\\hash.obj $(OFZ)\\image.obj $(OFZ)\\link.obj $(OFZ)\\list-device.obj \\\n\t$(OFZ)\\load-jpeg.obj $(OFZ)\\load-jpx.obj $(OFZ)\\load-jxr.obj $(OFZ)\\load-png.obj \\\n\t$(OFZ)\\load-tiff.obj $(OFZ)\\memory.obj $(OFZ)\\outline.obj \\\n\t$(OFZ)\\output.obj $(OFZ)\\path.obj $(OFZ)\\pixmap.obj \\\n\t$(OFZ)\\shade.obj $(OFZ)\\stext-device.obj $(OFZ)\\stext-output.obj $(OFZ)\\stext-paragraph.obj \\\n\t$(OFZ)\\stext-search.obj $(OFZ)\\store.obj $(OFZ)\\stream-open.obj $(OFZ)\\stream-read.obj \\\n\t$(OFZ)\\string.obj $(OFZ)\\text.obj $(OFZ)\\time.obj \\\n\t$(OFZ)\\trace-device.obj $(OFZ)\\transition.obj $(OFZ)\\ucdn.obj $(OFZ)\\xml.obj \\\n\t$(OFZ)\\glyph.obj $(OFZ)\\tree.obj $(OFZ)\\document.obj $(OFZ)\\filter-leech.obj \\\n\t$(OFZ)\\printf.obj $(OFZ)\\strtod.obj $(OFZ)\\ftoa.obj $(OFZ)\\unzip.obj\n\nMUPDF_OBJS = \\\n\t$(OP)\\pdf-annot.obj $(OP)\\pdf-cmap-load.obj $(OP)\\pdf-cmap-parse.obj $(OP)\\pdf-cmap-table.obj \\\n\t$(OP)\\pdf-cmap.obj $(OP)\\pdf-colorspace.obj $(OP)\\pdf-crypt.obj $(OP)\\pdf-device.obj \\\n\t$(OP)\\pdf-encoding.obj $(OP)\\pdf-event.obj $(OP)\\pdf-field.obj $(OP)\\pdf-font.obj \\\n\t$(OP)\\pdf-fontfile.obj $(OP)\\pdf-form.obj $(OP)\\pdf-ft-tools.obj $(OP)\\pdf-function.obj \\\n\t$(OP)\\pdf-image.obj $(OP)\\pdf-interpret.obj $(OP)\\pdf-lex.obj $(OP)\\pdf-metrics.obj \\\n\t$(OP)\\pdf-nametree.obj $(OP)\\pdf-object.obj $(OP)\\pdf-outline.obj $(OP)\\pdf-page.obj \\\n\t$(OP)\\pdf-parse.obj $(OP)\\pdf-pattern.obj $(OP)\\pdf-pkcs7.obj $(OP)\\pdf-repair.obj \\\n\t$(OP)\\pdf-shade.obj $(OP)\\pdf-store.obj $(OP)\\pdf-stream.obj $(OP)\\pdf-type3.obj \\\n\t$(OP)\\pdf-unicode.obj $(OP)\\pdf-write.obj $(OP)\\pdf-xobject.obj $(OP)\\pdf-xref-aux.obj \\\n\t$(OP)\\pdf-xref.obj $(OP)\\pdf-js-none.obj $(OP)\\pdf-appearance.obj \\\n\t$(OP)\\pdf-run.obj $(OP)\\pdf-op-run.obj $(OP)\\pdf-op-buffer.obj $(OP)\\pdf-op-filter.obj \\\n\t$(OP)\\pdf-clean.obj $(OP)\\pdf-annot-edit.obj \\\n\t$(OP)\\font_base14.obj\n\nMUXPS_OBJS = \\\n\t$(OX)\\xps-common.obj $(OX)\\xps-doc.obj $(OX)\\xps-glyphs.obj $(OX)\\xps-gradient.obj \\\n\t$(OX)\\xps-image.obj $(OX)\\xps-outline.obj $(OX)\\xps-path.obj $(OX)\\xps-resource.obj \\\n\t$(OX)\\xps-tile.obj $(OX)\\xps-util.obj $(OX)\\xps-zip.obj\n\nMUPDF_ALL_OBJS = \\\n\t$(ZLIB_OBJS) $(FT_OBJS) $(JPEG_TURBO_OBJS) $(JBIG2_OBJS) $(OPENJPEG_OBJS) \\\n\t$(FITZ_OBJS) $(DRAW_OBJS) $(MUPDF_OBJS) $(MUXPS_OBJS)\n\nMUDOC_OBJS = \\\n\t$(OX)\\mucbz.obj $(OX)\\muimage.obj $(OX)\\mutiff.obj $(OFZ)\\document-all.obj $(OFZ)\\document-no-run.obj \\\n\t$(OFZ)\\svg-device.obj $(OFZ)\\output-pcl.obj $(OFZ)\\output-pwg.obj \\\n\t$(OFZ)\\stream-prog.obj $(OFZ)\\test-device.obj\n\nMUTOOLS_OBJS = \\\n\t$(OA)\\mudraw.obj $(OA)\\mutool.obj $(OA)\\pdfclean.obj $(OA)\\pdfextract.obj \\\n\t$(OA)\\pdfinfo.obj $(OA)\\pdfposter.obj $(OA)\\pdfshow.obj\n\nMUTOOL_OBJS = $(MUPDF_ALL_OBJS) $(MUDOC_OBJS) $(OA)\\mutool.obj $(OA)\\pdfshow.obj \\\n\t$(OA)\\pdfclean.obj $(OA)\\pdfinfo.obj $(OA)\\pdfextract.obj $(OA)\\pdfposter.obj\nMUTOOL_APP = $(O)\\mutool.exe\n\nMUDRAW_OBJS = $(MUPDF_ALL_OBJS) $(MUDOC_OBJS) $(OA)\\mudraw.obj\nMUDRAW_APP = $(O)\\mudraw.exe\n\nall: $(O) $(MUDRAW_APP) $(MUTOOL_APP)\n\nclean: force\n\t-rmdir /S /Q $(O) $(MUPDF_GEN_DIR)\n\ncleanall: force\n\t-rmdir /S /Q obj-dbg-win obj-rel-win $(MUPDF_GEN_DIR)\n\n$(O): force\n\t@if not exist $(O) mkdir $(O)\n\t@if not exist $(OZ) mkdir $(OZ)\n\t@if not exist $(OFT) mkdir $(OFT)\n\t@if not exist $(OT) mkdir $(OT)\n\t@if not exist $(OOJ) mkdir $(OOJ)\n\t@if not exist $(OJB) mkdir $(OJB)\n\t@if not exist $(OFZ) mkdir $(OFZ)\n\t@if not exist $(OP) mkdir $(OP)\n\t@if not exist $(OX) mkdir $(OX)\n\t@if not exist $(OA) mkdir $(OA)\n\n$(MUTOOL_APP): $(MUTOOL_OBJS)\n\t$(LD) $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@ /SUBSYSTEM:CONSOLE\n\n$(MUDRAW_APP): $(MUDRAW_OBJS)\n\t$(LD) $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@ /SUBSYSTEM:CONSOLE\n\n# freetype directories\n{$(FREETYPE_DIR)\\src\\base}.c{$(OFT)}.obj::\n\t$(CC) $(FREETYPE_CFLAGS) /Fo$(OFT)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(FREETYPE_DIR)\\src\\cff}.c{$(OFT)}.obj::\n\t$(CC) $(FREETYPE_CFLAGS) /Fo$(OFT)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(FREETYPE_DIR)\\src\\cid}.c{$(OFT)}.obj::\n\t$(CC) $(FREETYPE_CFLAGS) /Fo$(OFT)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(FREETYPE_DIR)\\src\\gzip}.c{$(OFT)}.obj::\n\t$(CC) $(FREETYPE_CFLAGS) /Fo$(OFT)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(FREETYPE_DIR)\\src\\otvalid}.c{$(OFT)}.obj::\n\t$(CC) $(FREETYPE_CFLAGS) /Fo$(OFT)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(FREETYPE_DIR)\\src\\psaux}.c{$(OFT)}.obj::\n\t$(CC) $(FREETYPE_CFLAGS) /Fo$(OFT)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(FREETYPE_DIR)\\src\\pshinter}.c{$(OFT)}.obj::\n\t$(CC) $(FREETYPE_CFLAGS) /Fo$(OFT)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(FREETYPE_DIR)\\src\\psnames}.c{$(OFT)}.obj::\n\t$(CC) $(FREETYPE_CFLAGS) /Fo$(OFT)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(FREETYPE_DIR)\\src\\raster}.c{$(OFT)}.obj::\n\t$(CC) $(FREETYPE_CFLAGS) /Fo$(OFT)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(FREETYPE_DIR)\\src\\sfnt}.c{$(OFT)}.obj::\n\t$(CC) $(FREETYPE_CFLAGS) /Fo$(OFT)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(FREETYPE_DIR)\\src\\smooth}.c{$(OFT)}.obj::\n\t$(CC) $(FREETYPE_CFLAGS) /Fo$(OFT)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(FREETYPE_DIR)\\src\\truetype}.c{$(OFT)}.obj::\n\t$(CC) $(FREETYPE_CFLAGS) /Fo$(OFT)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(FREETYPE_DIR)\\src\\type1}.c{$(OFT)}.obj::\n\t$(CC) $(FREETYPE_CFLAGS) /Fo$(OFT)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(ZLIB_DIR)}.c{$(OZ)}.obj::\n\t$(CC) $(ZLIB_CFLAGS) /Fo$(OZ)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(JPEG_TURBO_DIR)}.c{$(OT)}.obj::\n\t$(CC) $(JPEG_TURBO_CFLAGS) /Fo$(OT)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(JPEG_TURBO_DIR)\\simd}.c{$(OT)}.obj::\n\t$(CC) $(JPEG_TURBO_CFLAGS) /Fo$(OT)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(JPEG_TURBO_DIR)\\simd}.asm{$(OT)}.obj:\n\t$(NASM) $(JPEG_TURBO_NASM_FLAGS) -o $@ $<\n\n{$(OPENJPEG_DIR)}.c{$(OOJ)}.obj::\n\t$(CC) $(OPENJPEG_CFLAGS) /Fo$(OOJ)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(JBIG2_DIR)}.c{$(OJB)}.obj::\n\t$(CC) $(JBIG2_CFLAGS) /Fo$(OJB)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(MUPDF_DIR)\\source\\fitz}.c{$(OFZ)}.obj::\n\t$(CC) $(MUPDF_CFLAGS) /Fo$(OFZ)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(MUPDF_DIR)\\source\\pdf}.c{$(OP)}.obj::\n\t$(CC) $(MUPDF_CFLAGS) /Fo$(OP)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(MUPDF_DIR)\\source\\pdf\\js}.c{$(OP)}.obj::\n\t$(CC) $(MUPDF_CFLAGS) /Fo$(OP)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(MUPDF_DIR)\\source\\xps}.c{$(OX)}.obj::\n\t$(CC) $(MUPDF_CFLAGS) /Fo$(OX)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(MUPDF_DIR)\\source\\tools}.c{$(OA)}.obj::\n\t$(CC) $(MUPDF_CFLAGS) /Fo$(OA)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(MUPDF_DIR)\\source\\cbz}.c{$(OX)}.obj::\n\t$(CC) $(MUPDF_CFLAGS) /Fo$(OX)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(MUPDF_DIR)\\source\\img}.c{$(OX)}.obj::\n\t$(CC) $(MUPDF_CFLAGS) /Fo$(OX)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(MUPDF_DIR)\\source\\tiff}.c{$(OX)}.obj::\n\t$(CC) $(MUPDF_CFLAGS) /Fo$(OX)\\ /Fd$(O)\\vc80.pdb $<\n\n{$(MUPDF_DIR)}.asm{$(OP)}.obj:\n\t$(NASM) $(MUPDF_NASM_FLAGS) -o $@ $<\n\n# files that might have to be generated first:\n\nMUPDF_CMAP_TABLES = $(MUPDF_GEN_DIR)\\gen_cmap_cns.h $(MUPDF_GEN_DIR)\\gen_cmap_gb.h \\\n\t$(MUPDF_GEN_DIR)\\gen_cmap_japan.h $(MUPDF_GEN_DIR)\\gen_cmap_korea.h\n\nMUPDF_FONT_FILES = $(MUPDF_GEN_DIR)\\gen_font_base14.h \\\n\t$(MUPDF_GEN_DIR)\\gen_font_cjk.h $(MUPDF_GEN_DIR)\\gen_font_cjk_full.h\n\nMUPDF_GENERATED =  $(MUPDF_CMAP_TABLES) $(MUPDF_FONT_FILES) $(MUPDF_GEN_DIR)\\js_util.h\n\n$(MUPDF_GENERATED):\n\tcd $(MUPDF_DIR) && platform\\win32\\generate.bat\n\n$(OP)\\pdf-cmap-table.obj: $(MUPDF_CMAP_TABLES)\n$(OP)\\pdf-fontfile.obj: $(MUPDF_FONT_FILES)\n\n# header dependencies\n\nINC_DIR = $(MUPDF_DIR)\\include\\mupdf\n\nFITZ_H  = $(INC_DIR)\\fitz.h \\\n\t$(INC_DIR)\\fitz\\annotation.h $(INC_DIR)\\fitz\\bitmap.h $(INC_DIR)\\fitz\\buffer.h \\\n\t$(INC_DIR)\\fitz\\colorspace.h $(INC_DIR)\\fitz\\compressed-buffer.h $(INC_DIR)\\fitz\\context.h \\\n\t$(INC_DIR)\\fitz\\crypt.h $(INC_DIR)\\fitz\\device.h $(INC_DIR)\\fitz\\display-list.h \\\n\t$(INC_DIR)\\fitz\\document.h $(INC_DIR)\\fitz\\filter.h $(INC_DIR)\\fitz\\font.h \\\n\t$(INC_DIR)\\fitz\\function.h $(INC_DIR)\\fitz\\getopt.h $(INC_DIR)\\fitz\\glyph-cache.h \\\n\t$(INC_DIR)\\fitz\\hash.h $(INC_DIR)\\fitz\\image.h $(INC_DIR)\\fitz\\link.h \\\n\t$(INC_DIR)\\fitz\\math.h $(INC_DIR)\\fitz\\meta.h $(INC_DIR)\\fitz\\outline.h \\\n\t$(INC_DIR)\\fitz\\output-pcl.h $(INC_DIR)\\fitz\\output-png.h $(INC_DIR)\\fitz\\output-pnm.h \\\n\t$(INC_DIR)\\fitz\\output-pwg.h $(INC_DIR)\\fitz\\output-svg.h $(INC_DIR)\\fitz\\output-tga.h \\\n\t$(INC_DIR)\\fitz\\output.h $(INC_DIR)\\fitz\\path.h $(INC_DIR)\\fitz\\pixmap.h \\\n\t$(INC_DIR)\\fitz\\shade.h $(INC_DIR)\\fitz\\store.h $(INC_DIR)\\fitz\\stream.h \\\n\t$(INC_DIR)\\fitz\\string.h $(INC_DIR)\\fitz\\structured-text.h $(INC_DIR)\\fitz\\system.h \\\n\t$(INC_DIR)\\fitz\\text.h $(INC_DIR)\\fitz\\transition.h $(INC_DIR)\\fitz\\write-document.h \\\n\t$(INC_DIR)\\fitz\\xml.h $(INC_DIR)\\fitz\\glyph.h $(INC_DIR)\\fitz\\version.h \\\n\t$(INC_DIR)\\fitz\\tree.h\n\nMUPDF_H = $(INC_DIR)\\pdf.h \\\n\t$(INC_DIR)\\pdf\\annot.h $(INC_DIR)\\pdf\\cmap.h $(INC_DIR)\\pdf\\crypt.h \\\n\t$(INC_DIR)\\pdf\\document.h $(INC_DIR)\\pdf\\event.h $(INC_DIR)\\pdf\\field.h \\\n\t$(INC_DIR)\\pdf\\font.h $(INC_DIR)\\pdf\\javascript.h $(INC_DIR)\\pdf\\object.h \\\n\t$(INC_DIR)\\pdf\\output-pdf.h $(INC_DIR)\\pdf\\page.h $(INC_DIR)\\pdf\\parse.h \\\n\t$(INC_DIR)\\pdf\\resource.h $(INC_DIR)\\pdf\\widget.h $(INC_DIR)\\pdf\\xref.h \\\n\t$(INC_DIR)\\pdf\\appearance.h\n\nMUXPS_H = $(INC_DIR)\\xps.h\nMUOTH_H = $(INC_DIR)\\cbz.h $(INC_DIR)\\img.h $(INC_DIR)\\tiff.h\n\n$(FITZ_OBJS) $(MUDOC_OBJS): $(FITZ_H)\n$(MUPDF_OBJS): $(FITZ_H) $(MUPDF_H) $(MUPDF_DIR)\\source\\pdf\\pdf-interpret-imp.h\n$(MUXPS_OBJS): $(FITZ_H) $(MUXPS_H)\n$(MUTOOLS_OBJS): $(FITZ_H) $(MUPDF_H) $(MUXPS_H) $(MUOTH_H)\n$(DRAW_OBJS): $(MUPDF_DIR)\\source\\fitz\\draw-imp.h\n$(OP)\\pdf-encoding.obj: $(MUPDF_DIR)\\source\\pdf\\pdf-encodings.h $(MUPDF_DIR)\\source\\pdf\\pdf-glyphlist.h\n\nforce: ;\n"
  },
  {
    "path": "mupdf/platform/win32/README.txt",
    "content": "This MSVC project needs the thirdparty sources to be in place.\n"
  },
  {
    "path": "mupdf/platform/win32/generate.bat",
    "content": "@echo off\n\nif not exist scripts/fontdump.c cd ../..\nif not exist scripts/fontdump.c goto usage\nif not exist generated mkdir generated\n\ncl /nologo -Iinclude scripts/fontdump.c setargv.obj\ncl /nologo -Iinclude scripts/cmapdump.c setargv.obj\ncl /nologo -Iinclude scripts/cquote.c setargv.obj\ncl /nologo -Iinclude scripts/bin2hex.c setargv.obj\n\nif not exist fontdump.exe goto usage\nif not exist cmapdump.exe goto usage\nif not exist cquote.exe goto usage\nif not exist bin2hex.exe goto usage\n\nif not exist generated/gen_font_base14.h fontdump.exe generated/gen_font_base14.h resources/fonts/urw/*.cff\nif not exist generated/gen_font_cjk.h fontdump.exe generated/gen_font_cjk.h resources/fonts/droid/DroidSansFallback.ttc\nif not exist generated/gen_font_cjk_full.h fontdump.exe generated/gen_font_cjk_full.h resources/fonts/droid/DroidSansFallbackFull.ttc\n\nif not exist generated/gen_cmap_cns.h cmapdump.exe generated/gen_cmap_cns.h resources\\cmaps\\cns\\*\nif not exist generated/gen_cmap_gb.h cmapdump.exe generated/gen_cmap_gb.h resources\\cmaps\\gb\\*\nif not exist generated/gen_cmap_japan.h cmapdump.exe generated/gen_cmap_japan.h resources\\cmaps\\japan\\*\nif not exist generated/gen_cmap_korea.h cmapdump.exe generated/gen_cmap_korea.h resources\\cmaps\\korea\\*\n\nif not exist generated/gen_adobe_ca.h bin2hex.exe generated/gen_adobe_ca.h resources/certs/AdobeCA.p7c\nif not exist generated/gen_js_util.h cquote.exe generated/gen_js_util.h source/pdf/js/pdf-util.js\n\ndel cmapdump.obj fontdump.obj cquote.obj bin2hex.obj cmapdump.exe fontdump.exe cquote.exe bin2hex.exe\n\ngoto fin\n\n:usage\necho ERROR: Run this script in the mupdf directory.\necho ERROR: Run this script in a Visual Studio command prompt.\npause\n\n:fin\n"
  },
  {
    "path": "mupdf/platform/win32/libmupdf.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"8.00\"\n\tName=\"libmupdf\"\n\tProjectGUID=\"{5F615F91-DFF8-4F05-BF48-6222B7D86519}\"\n\tRootNamespace=\"mupdf\"\n\t>\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"Win32\"\n\t\t/>\n\t</Platforms>\n\t<ToolFiles>\n\t</ToolFiles>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Debug|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\\$(ProjectName)\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t\tCommandLine=\"\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\scripts\\freetype;..\\..\\scripts\\jpeg;..\\..\\scripts\\openjpeg;..\\..\\include;..\\..\\ucdn;..\\..\\generated;..\\..\\thirdparty\\jbig2dec;..\\..\\thirdparty\\jpeg;..\\..\\thirdparty\\openjpeg\\libopenjpeg;..\\..\\thirdparty\\zlib;..\\..\\thirdparty\\freetype\\include;..\\..\\thirdparty\\mujs\"\n\t\t\t\tPreprocessorDefinitions=\"DEBUG=1;USE_OUTPUT_DEBUG_STRING\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"1\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\\$(ProjectName)\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t\tDescription=\"Generate CMap and Font source files\"\n\t\t\t\tCommandLine=\"generate.bat\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"2\"\n\t\t\t\tEnableIntrinsicFunctions=\"true\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\scripts\\freetype;..\\..\\scripts\\jpeg;..\\..\\scripts\\openjpeg;..\\..\\include;..\\..\\ucdn;..\\..\\generated;..\\..\\thirdparty\\jbig2dec;..\\..\\thirdparty\\jpeg;..\\..\\thirdparty\\openjpeg\\libopenjpeg;..\\..\\thirdparty\\zlib;..\\..\\thirdparty\\freetype\\include;..\\..\\thirdparty\\mujs\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tEnableFunctionLevelLinking=\"true\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Memento|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\\$(ProjectName)\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t\tCommandLine=\"\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\scripts\\freetype;..\\..\\scripts\\jpeg;..\\..\\scripts\\openjpeg;..\\..\\include;..\\..\\ucdn;..\\..\\generated;..\\..\\thirdparty\\jbig2dec;..\\..\\thirdparty\\jpeg;..\\..\\thirdparty\\openjpeg\\libopenjpeg;..\\..\\thirdparty\\zlib;..\\..\\thirdparty\\freetype\\include;..\\..\\thirdparty\\mujs\"\n\t\t\t\tPreprocessorDefinitions=\"MEMENTO=1;DEBUG=1;USE_OUTPUT_DEBUG_STRING\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"1\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"DebugOpenssl|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t\tCommandLine=\"\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\scripts\\freetype;..\\..\\scripts\\jpeg;..\\..\\scripts\\openjpeg;..\\..\\include;..\\..\\ucdn;..\\..\\generated;..\\..\\thirdparty\\jbig2dec;..\\..\\thirdparty\\jpeg;..\\..\\thirdparty\\openjpeg\\libopenjpeg;..\\..\\thirdparty\\zlib;..\\..\\thirdparty\\freetype\\include;..\\..\\thirdparty\\openssl\\include;..\\..\\thirdparty\\mujs\"\n\t\t\t\tPreprocessorDefinitions=\"DEBUG=1;HAVE_OPENSSL;USE_OUTPUT_DEBUG_STRING\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"1\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"ReleaseOpenssl|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"4\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t\tDescription=\"Generate CMap and Font source files\"\n\t\t\t\tCommandLine=\"generate.bat\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"2\"\n\t\t\t\tEnableIntrinsicFunctions=\"true\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\scripts\\freetype;..\\..\\scripts\\jpeg;..\\..\\scripts\\openjpeg;..\\..\\include;..\\..\\ucdn;..\\..\\generated;..\\..\\thirdparty\\jbig2dec;..\\..\\thirdparty\\jpeg;..\\..\\thirdparty\\openjpeg\\libopenjpeg;..\\..\\thirdparty\\zlib;..\\..\\thirdparty\\freetype\\include;..\\..\\thirdparty\\mujs\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tEnableFunctionLevelLinking=\"true\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLibrarianTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t</Configurations>\n\t<References>\n\t</References>\n\t<Files>\n\t\t<Filter\n\t\t\tName=\"cbz\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\cbz\\mucbz.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"xps\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\xps\\xps-common.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\xps\\xps-doc.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\xps\\xps-glyphs.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\xps\\xps-gradient.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\xps\\xps-image.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\xps\\xps-outline.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\xps\\xps-path.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\xps\\xps-resource.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\xps\\xps-tile.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\xps\\xps-util.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\xps\\xps-zip.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"fitz\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\bbox-device.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\bitmap.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\buffer.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\colorspace.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\compressed-buffer.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\context.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\crypt-aes.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\crypt-arc4.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\crypt-md5.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\crypt-sha2.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\device.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\document-all.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\document.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\draw-affine.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\draw-blend.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\draw-device.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\draw-edge.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\draw-glyph.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\draw-imp.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\draw-mesh.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\draw-paint.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\draw-path.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\draw-scale-simple.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\draw-unpack.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\error.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\filter-basic.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\filter-dct.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\filter-fax.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\filter-flate.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\filter-jbig2.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\filter-leech.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\filter-lzw.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\filter-predict.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\font.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\ftoa.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\function.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\geometry.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\getopt.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\glyph.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\halftone.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\hash.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\image.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\jmemcust.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\jmemcust.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\link.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\list-device.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\load-jpeg.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\load-jpx.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\load-jxr.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\load-png.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\load-tiff.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\memento.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\memory.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\outline.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\output-pcl.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\output-pwg.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\output.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\path.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\pixmap.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\printf.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\shade.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\stext-device.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\stext-output.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\stext-paragraph.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\stext-search.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\store.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\stream-open.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\stream-prog.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\stream-read.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\string.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\strtod.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\svg-device.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\test-device.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\text.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\time.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\trace-device.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\transition.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\tree.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\ucdn.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\ucdn.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\unicodedata_db.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\unzip.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\xml.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"img\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\img\\muimage.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"pdf\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-annot-edit.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-annot.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-appearance.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-clean.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-cmap-load.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-cmap-parse.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-cmap-table.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-cmap.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-colorspace.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-crypt.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-device.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-encoding.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-encodings.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-event.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-field.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-font.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-fontfile.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-form.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-function.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-glyphlist.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-image.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-interpret-imp.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-interpret.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-lex.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-metrics.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-nametree.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-object.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-op-buffer.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-op-filter.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-op-run.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-outline.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-page.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-parse.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-pattern.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-pkcs7.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-repair.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-run.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-shade.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-store.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-stream.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-type3.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-unicode.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-write.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-xobject.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-xref-aux.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\pdf-xref.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<Filter\n\t\t\t\tName=\"js\"\n\t\t\t\t>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\js\\pdf-js.c\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\js\\pdf-jsimp-mu.c\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\source\\pdf\\js\\pdf-util.js\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t</Filter>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"!include\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\cbz.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\img.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\memento.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\pdf.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\xps.h\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t\t<Filter\n\t\t\t\tName=\"pdf\"\n\t\t\t\t>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\pdf\\annot.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\pdf\\appearance.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\pdf\\cmap.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\pdf\\crypt.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\pdf\\document.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\pdf\\event.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\pdf\\field.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\pdf\\font.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\pdf\\javascript.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\pdf\\object.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\pdf\\output-pdf.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\pdf\\page.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\pdf\\parse.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\pdf\\resource.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\pdf\\widget.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\pdf\\xref.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t</Filter>\n\t\t\t<Filter\n\t\t\t\tName=\"fitz\"\n\t\t\t\t>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\annotation.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\bitmap.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\buffer.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\colorspace.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\compressed-buffer.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\context.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\crypt.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\device.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\display-list.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\source\\fitz\\document-no-run.c\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\document.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\filter.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\font.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\function.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\getopt.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\glyph-cache.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\glyph.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\hash.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\image.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\link.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\math.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\meta.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\outline.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\output-pcl.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\output-png.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\output-pnm.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\output-pwg.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\output-svg.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\output.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\path.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\pixmap.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\shade.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\store.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\stream.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\string.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\structured-text.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\system.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\text.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\transition.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\unzip.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\write-document.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t\t<File\n\t\t\t\t\tRelativePath=\"..\\..\\include\\mupdf\\fitz\\xml.h\"\n\t\t\t\t\t>\n\t\t\t\t</File>\n\t\t\t</Filter>\n\t\t</Filter>\n\t\t<Filter\n\t\t\tName=\"tiff\"\n\t\t\t>\n\t\t\t<File\n\t\t\t\tRelativePath=\"..\\..\\source\\tiff\\mutiff.c\"\n\t\t\t\t>\n\t\t\t</File>\n\t\t</Filter>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "mupdf/platform/win32/mudraw.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"8.00\"\n\tName=\"mudraw\"\n\tProjectGUID=\"{0B51171B-B10E-4EAC-8FFA-19226A1828A3}\"\n\tRootNamespace=\"mupdf\"\n\t>\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"Win32\"\n\t\t/>\n\t</Platforms>\n\t<ToolFiles>\n\t</ToolFiles>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Debug|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\include\"\n\t\t\t\tPreprocessorDefinitions=\"DEBUG=1;USE_OUTPUT_DEBUG_STRING\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"1\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"2\"\n\t\t\t\tEnableIntrinsicFunctions=\"true\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\include\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tEnableFunctionLevelLinking=\"true\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Memento|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\include\"\n\t\t\t\tPreprocessorDefinitions=\"MEMENTO=1;DEBUG=1;USE_OUTPUT_DEBUG_STRING\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"1\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t</Configurations>\n\t<References>\n\t</References>\n\t<Files>\n\t\t<File\n\t\t\tRelativePath=\"..\\..\\source\\tools\\mudraw.c\"\n\t\t\t>\n\t\t</File>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "mupdf/platform/win32/mujstest.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"8.00\"\n\tName=\"mujstest\"\n\tProjectGUID=\"{21E28758-E4D2-4B84-8EC5-B631CEE66B30}\"\n\tRootNamespace=\"mupdf\"\n\t>\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"Win32\"\n\t\t/>\n\t</Platforms>\n\t<ToolFiles>\n\t</ToolFiles>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Debug|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\include\"\n\t\t\t\tPreprocessorDefinitions=\"FT2_BUILD_LIBRARY;OPJ_STATIC;DEBUG=1;USE_OUTPUT_DEBUG_STRING\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"1\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalOptions=\"/FORCE\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"2\"\n\t\t\t\tEnableIntrinsicFunctions=\"true\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\include\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tEnableFunctionLevelLinking=\"true\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Memento|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\include\"\n\t\t\t\tPreprocessorDefinitions=\"FT2_BUILD_LIBRARY;OPJ_STATIC;MEMENTO=1;DEBUG=1;USE_OUTPUT_DEBUG_STRING\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"1\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"DebugOpenssl|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\include\"\n\t\t\t\tPreprocessorDefinitions=\"FT2_BUILD_LIBRARY;OPJ_STATIC;DEBUG=1;HAVE_OPENSSL;USE_OUTPUT_DEBUG_STRING\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"1\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalOptions=\"/FORCE\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"ReleaseOpenssl|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"2\"\n\t\t\t\tEnableIntrinsicFunctions=\"true\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\include\"\n\t\t\t\tPreprocessorDefinitions=\"HAVE_OPENSSL\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tEnableFunctionLevelLinking=\"true\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t</Configurations>\n\t<References>\n\t</References>\n\t<Files>\n\t\t<File\n\t\t\tRelativePath=\"..\\..\\platform\\x11\\jstest_main.c\"\n\t\t\t>\n\t\t</File>\n\t\t<File\n\t\t\tRelativePath=\"..\\..\\platform\\x11\\pdfapp.c\"\n\t\t\t>\n\t\t</File>\n\t\t<File\n\t\t\tRelativePath=\"..\\..\\platform\\x11\\pdfapp.h\"\n\t\t\t>\n\t\t</File>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "mupdf/platform/win32/mupdf-curl.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"8.00\"\n\tName=\"mupdf-curl\"\n\tProjectGUID=\"{27B53E5C-ACAB-423C-854E-BECE56D73544}\"\n\tRootNamespace=\"mupdf\"\n\t>\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"Win32\"\n\t\t/>\n\t</Platforms>\n\t<ToolFiles>\n\t</ToolFiles>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Debug|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\include,..\\..\\thirdparty\\curl\\include\"\n\t\t\t\tPreprocessorDefinitions=\"FT2_BUILD_LIBRARY;OPJ_STATIC;DEBUG=1;HAVE_CURL=1;USE_OUTPUT_DEBUG_STRING\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"1\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalDependencies=\"ws2_32.lib\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"2\"\n\t\t\t\tEnableIntrinsicFunctions=\"true\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\include,..\\..\\thirdparty\\curl\\include\"\n\t\t\t\tPreprocessorDefinitions=\"HAVE_CURL=1\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tEnableFunctionLevelLinking=\"true\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalDependencies=\"ws2_32.lib\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Memento|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\include,..\\..\\thirdparty\\curl\\include\"\n\t\t\t\tPreprocessorDefinitions=\"FT2_BUILD_LIBRARY;OPJ_STATIC;MEMENTO=1;DEBUG=1;HAVE_CURL=1;USE_OUTPUT_DEBUG_STRING\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"1\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalDependencies=\"ws2_32.lib\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"DebugOpenssl|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\include,..\\..\\thirdparty\\curl\\include\"\n\t\t\t\tPreprocessorDefinitions=\"FT2_BUILD_LIBRARY;OPJ_STATIC;DEBUG=1;HAVE_OPENSSL;HAVE_CURL=1;USE_OUTPUT_DEBUG_STRING\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"1\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalDependencies=\"libeay32.lib ws2_32.lib\"\n\t\t\t\tAdditionalLibraryDirectories=\"..\\..\\thirdparty\\openssl\\lib\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"ReleaseOpenssl|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"2\"\n\t\t\t\tEnableIntrinsicFunctions=\"true\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\include,..\\..\\thirdparty\\curl\\include\"\n\t\t\t\tPreprocessorDefinitions=\"HAVE_OPENSSL;HAVE_CURL=1\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tEnableFunctionLevelLinking=\"true\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalDependencies=\"ws2_32.lib\"\n\t\t\t\tAdditionalLibraryDirectories=\"..\\..\\thirdparty\\openssl\\lib\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t</Configurations>\n\t<References>\n\t</References>\n\t<Files>\n\t\t<File\n\t\t\tRelativePath=\"..\\x11\\curl_stream.c\"\n\t\t\t>\n\t\t</File>\n\t\t<File\n\t\t\tRelativePath=\"..\\x11\\curl_stream.h\"\n\t\t\t>\n\t\t</File>\n\t\t<File\n\t\t\tRelativePath=\"..\\..\\platform\\x11\\pdfapp.c\"\n\t\t\t>\n\t\t</File>\n\t\t<File\n\t\t\tRelativePath=\"..\\..\\platform\\x11\\pdfapp.h\"\n\t\t\t>\n\t\t</File>\n\t\t<File\n\t\t\tRelativePath=\"..\\..\\platform\\x11\\win_main.c\"\n\t\t\t>\n\t\t</File>\n\t\t<File\n\t\t\tRelativePath=\"..\\..\\platform\\x11\\win_res.rc\"\n\t\t\t>\n\t\t</File>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "mupdf/platform/win32/mupdf.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 9.00\n# Visual Studio 2005\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"mupdf\", \"mupdf.vcproj\", \"{E74F29F0-FA43-4ADC-B92C-6AFA08E4A417}\"\n\tProjectSection(ProjectDependencies) = postProject\n\t\t{5F615F91-DFF8-4F05-BF48-6222B7D86519} = {5F615F91-DFF8-4F05-BF48-6222B7D86519}\n\t\t{5EDCF4FD-0291-4FB9-8D96-D58957CA5E3C} = {5EDCF4FD-0291-4FB9-8D96-D58957CA5E3C}\n\tEndProjectSection\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libthirdparty\", \"libthirdparty.vcproj\", \"{5EDCF4FD-0291-4FB9-8D96-D58957CA5E3C}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libmupdf\", \"libmupdf.vcproj\", \"{5F615F91-DFF8-4F05-BF48-6222B7D86519}\"\n\tProjectSection(ProjectDependencies) = postProject\n\t\t{A5053AA7-02E5-4903-B596-04F17AEB1526} = {A5053AA7-02E5-4903-B596-04F17AEB1526}\n\tEndProjectSection\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"mudraw\", \"mudraw.vcproj\", \"{0B51171B-B10E-4EAC-8FFA-19226A1828A3}\"\n\tProjectSection(ProjectDependencies) = postProject\n\t\t{5EDCF4FD-0291-4FB9-8D96-D58957CA5E3C} = {5EDCF4FD-0291-4FB9-8D96-D58957CA5E3C}\n\t\t{5F615F91-DFF8-4F05-BF48-6222B7D86519} = {5F615F91-DFF8-4F05-BF48-6222B7D86519}\n\tEndProjectSection\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"mutool\", \"mutool.vcproj\", \"{00811970-815B-4F64-BC9D-219078B1F3AA}\"\n\tProjectSection(ProjectDependencies) = postProject\n\t\t{5EDCF4FD-0291-4FB9-8D96-D58957CA5E3C} = {5EDCF4FD-0291-4FB9-8D96-D58957CA5E3C}\n\t\t{5F615F91-DFF8-4F05-BF48-6222B7D86519} = {5F615F91-DFF8-4F05-BF48-6222B7D86519}\n\tEndProjectSection\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"generated\", \"generated.vcproj\", \"{A5053AA7-02E5-4903-B596-04F17AEB1526}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libcurl\", \"..\\..\\thirdparty\\curl\\vs\\vc8\\lib\\vc8libcurl.vcproj\", \"{87EE9DA4-DE1E-4448-8324-183C98DCA588}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"mupdf-curl\", \"mupdf-curl.vcproj\", \"{27B53E5C-ACAB-423C-854E-BECE56D73544}\"\n\tProjectSection(ProjectDependencies) = postProject\n\t\t{5F615F91-DFF8-4F05-BF48-6222B7D86519} = {5F615F91-DFF8-4F05-BF48-6222B7D86519}\n\t\t{87EE9DA4-DE1E-4448-8324-183C98DCA588} = {87EE9DA4-DE1E-4448-8324-183C98DCA588}\n\t\t{5EDCF4FD-0291-4FB9-8D96-D58957CA5E3C} = {5EDCF4FD-0291-4FB9-8D96-D58957CA5E3C}\n\tEndProjectSection\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"mujstest\", \"mujstest.vcproj\", \"{21E28758-E4D2-4B84-8EC5-B631CEE66B30}\"\n\tProjectSection(ProjectDependencies) = postProject\n\t\t{5F615F91-DFF8-4F05-BF48-6222B7D86519} = {5F615F91-DFF8-4F05-BF48-6222B7D86519}\n\t\t{5EDCF4FD-0291-4FB9-8D96-D58957CA5E3C} = {5EDCF4FD-0291-4FB9-8D96-D58957CA5E3C}\n\tEndProjectSection\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Win32 = Debug|Win32\n\t\tDebugOpenssl|Win32 = DebugOpenssl|Win32\n\t\tMemento|Win32 = Memento|Win32\n\t\tRelease|Win32 = Release|Win32\n\t\tReleaseOpenssl|Win32 = ReleaseOpenssl|Win32\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{E74F29F0-FA43-4ADC-B92C-6AFA08E4A417}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{E74F29F0-FA43-4ADC-B92C-6AFA08E4A417}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{E74F29F0-FA43-4ADC-B92C-6AFA08E4A417}.DebugOpenssl|Win32.ActiveCfg = DebugOpenssl|Win32\n\t\t{E74F29F0-FA43-4ADC-B92C-6AFA08E4A417}.DebugOpenssl|Win32.Build.0 = DebugOpenssl|Win32\n\t\t{E74F29F0-FA43-4ADC-B92C-6AFA08E4A417}.Memento|Win32.ActiveCfg = Memento|Win32\n\t\t{E74F29F0-FA43-4ADC-B92C-6AFA08E4A417}.Memento|Win32.Build.0 = Memento|Win32\n\t\t{E74F29F0-FA43-4ADC-B92C-6AFA08E4A417}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{E74F29F0-FA43-4ADC-B92C-6AFA08E4A417}.Release|Win32.Build.0 = Release|Win32\n\t\t{E74F29F0-FA43-4ADC-B92C-6AFA08E4A417}.ReleaseOpenssl|Win32.ActiveCfg = ReleaseOpenssl|Win32\n\t\t{E74F29F0-FA43-4ADC-B92C-6AFA08E4A417}.ReleaseOpenssl|Win32.Build.0 = ReleaseOpenssl|Win32\n\t\t{5EDCF4FD-0291-4FB9-8D96-D58957CA5E3C}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{5EDCF4FD-0291-4FB9-8D96-D58957CA5E3C}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{5EDCF4FD-0291-4FB9-8D96-D58957CA5E3C}.DebugOpenssl|Win32.ActiveCfg = Debug|Win32\n\t\t{5EDCF4FD-0291-4FB9-8D96-D58957CA5E3C}.DebugOpenssl|Win32.Build.0 = Debug|Win32\n\t\t{5EDCF4FD-0291-4FB9-8D96-D58957CA5E3C}.Memento|Win32.ActiveCfg = Memento|Win32\n\t\t{5EDCF4FD-0291-4FB9-8D96-D58957CA5E3C}.Memento|Win32.Build.0 = Memento|Win32\n\t\t{5EDCF4FD-0291-4FB9-8D96-D58957CA5E3C}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{5EDCF4FD-0291-4FB9-8D96-D58957CA5E3C}.Release|Win32.Build.0 = Release|Win32\n\t\t{5EDCF4FD-0291-4FB9-8D96-D58957CA5E3C}.ReleaseOpenssl|Win32.ActiveCfg = Release|Win32\n\t\t{5EDCF4FD-0291-4FB9-8D96-D58957CA5E3C}.ReleaseOpenssl|Win32.Build.0 = Release|Win32\n\t\t{5F615F91-DFF8-4F05-BF48-6222B7D86519}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{5F615F91-DFF8-4F05-BF48-6222B7D86519}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{5F615F91-DFF8-4F05-BF48-6222B7D86519}.DebugOpenssl|Win32.ActiveCfg = DebugOpenssl|Win32\n\t\t{5F615F91-DFF8-4F05-BF48-6222B7D86519}.DebugOpenssl|Win32.Build.0 = DebugOpenssl|Win32\n\t\t{5F615F91-DFF8-4F05-BF48-6222B7D86519}.Memento|Win32.ActiveCfg = Memento|Win32\n\t\t{5F615F91-DFF8-4F05-BF48-6222B7D86519}.Memento|Win32.Build.0 = Memento|Win32\n\t\t{5F615F91-DFF8-4F05-BF48-6222B7D86519}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{5F615F91-DFF8-4F05-BF48-6222B7D86519}.Release|Win32.Build.0 = Release|Win32\n\t\t{5F615F91-DFF8-4F05-BF48-6222B7D86519}.ReleaseOpenssl|Win32.ActiveCfg = ReleaseOpenssl|Win32\n\t\t{5F615F91-DFF8-4F05-BF48-6222B7D86519}.ReleaseOpenssl|Win32.Build.0 = ReleaseOpenssl|Win32\n\t\t{0B51171B-B10E-4EAC-8FFA-19226A1828A3}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{0B51171B-B10E-4EAC-8FFA-19226A1828A3}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{0B51171B-B10E-4EAC-8FFA-19226A1828A3}.DebugOpenssl|Win32.ActiveCfg = Debug|Win32\n\t\t{0B51171B-B10E-4EAC-8FFA-19226A1828A3}.DebugOpenssl|Win32.Build.0 = Debug|Win32\n\t\t{0B51171B-B10E-4EAC-8FFA-19226A1828A3}.Memento|Win32.ActiveCfg = Memento|Win32\n\t\t{0B51171B-B10E-4EAC-8FFA-19226A1828A3}.Memento|Win32.Build.0 = Memento|Win32\n\t\t{0B51171B-B10E-4EAC-8FFA-19226A1828A3}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{0B51171B-B10E-4EAC-8FFA-19226A1828A3}.Release|Win32.Build.0 = Release|Win32\n\t\t{0B51171B-B10E-4EAC-8FFA-19226A1828A3}.ReleaseOpenssl|Win32.ActiveCfg = Release|Win32\n\t\t{0B51171B-B10E-4EAC-8FFA-19226A1828A3}.ReleaseOpenssl|Win32.Build.0 = Release|Win32\n\t\t{00811970-815B-4F64-BC9D-219078B1F3AA}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{00811970-815B-4F64-BC9D-219078B1F3AA}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{00811970-815B-4F64-BC9D-219078B1F3AA}.DebugOpenssl|Win32.ActiveCfg = Debug|Win32\n\t\t{00811970-815B-4F64-BC9D-219078B1F3AA}.DebugOpenssl|Win32.Build.0 = Debug|Win32\n\t\t{00811970-815B-4F64-BC9D-219078B1F3AA}.Memento|Win32.ActiveCfg = Memento|Win32\n\t\t{00811970-815B-4F64-BC9D-219078B1F3AA}.Memento|Win32.Build.0 = Memento|Win32\n\t\t{00811970-815B-4F64-BC9D-219078B1F3AA}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{00811970-815B-4F64-BC9D-219078B1F3AA}.Release|Win32.Build.0 = Release|Win32\n\t\t{00811970-815B-4F64-BC9D-219078B1F3AA}.ReleaseOpenssl|Win32.ActiveCfg = Release|Win32\n\t\t{00811970-815B-4F64-BC9D-219078B1F3AA}.ReleaseOpenssl|Win32.Build.0 = Release|Win32\n\t\t{A5053AA7-02E5-4903-B596-04F17AEB1526}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{A5053AA7-02E5-4903-B596-04F17AEB1526}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{A5053AA7-02E5-4903-B596-04F17AEB1526}.DebugOpenssl|Win32.ActiveCfg = Debug|Win32\n\t\t{A5053AA7-02E5-4903-B596-04F17AEB1526}.DebugOpenssl|Win32.Build.0 = Debug|Win32\n\t\t{A5053AA7-02E5-4903-B596-04F17AEB1526}.Memento|Win32.ActiveCfg = Memento|Win32\n\t\t{A5053AA7-02E5-4903-B596-04F17AEB1526}.Memento|Win32.Build.0 = Memento|Win32\n\t\t{A5053AA7-02E5-4903-B596-04F17AEB1526}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{A5053AA7-02E5-4903-B596-04F17AEB1526}.Release|Win32.Build.0 = Release|Win32\n\t\t{A5053AA7-02E5-4903-B596-04F17AEB1526}.ReleaseOpenssl|Win32.ActiveCfg = Release|Win32\n\t\t{A5053AA7-02E5-4903-B596-04F17AEB1526}.ReleaseOpenssl|Win32.Build.0 = Release|Win32\n\t\t{87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{87EE9DA4-DE1E-4448-8324-183C98DCA588}.DebugOpenssl|Win32.ActiveCfg = Debug|Win32\n\t\t{87EE9DA4-DE1E-4448-8324-183C98DCA588}.DebugOpenssl|Win32.Build.0 = Debug|Win32\n\t\t{87EE9DA4-DE1E-4448-8324-183C98DCA588}.Memento|Win32.ActiveCfg = Memento|Win32\n\t\t{87EE9DA4-DE1E-4448-8324-183C98DCA588}.Memento|Win32.Build.0 = Memento|Win32\n\t\t{87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|Win32.Build.0 = Release|Win32\n\t\t{87EE9DA4-DE1E-4448-8324-183C98DCA588}.ReleaseOpenssl|Win32.ActiveCfg = Release|Win32\n\t\t{87EE9DA4-DE1E-4448-8324-183C98DCA588}.ReleaseOpenssl|Win32.Build.0 = Release|Win32\n\t\t{27B53E5C-ACAB-423C-854E-BECE56D73544}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{27B53E5C-ACAB-423C-854E-BECE56D73544}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{27B53E5C-ACAB-423C-854E-BECE56D73544}.DebugOpenssl|Win32.ActiveCfg = DebugOpenssl|Win32\n\t\t{27B53E5C-ACAB-423C-854E-BECE56D73544}.DebugOpenssl|Win32.Build.0 = DebugOpenssl|Win32\n\t\t{27B53E5C-ACAB-423C-854E-BECE56D73544}.Memento|Win32.ActiveCfg = Memento|Win32\n\t\t{27B53E5C-ACAB-423C-854E-BECE56D73544}.Memento|Win32.Build.0 = Memento|Win32\n\t\t{27B53E5C-ACAB-423C-854E-BECE56D73544}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{27B53E5C-ACAB-423C-854E-BECE56D73544}.Release|Win32.Build.0 = Release|Win32\n\t\t{27B53E5C-ACAB-423C-854E-BECE56D73544}.ReleaseOpenssl|Win32.ActiveCfg = ReleaseOpenssl|Win32\n\t\t{27B53E5C-ACAB-423C-854E-BECE56D73544}.ReleaseOpenssl|Win32.Build.0 = ReleaseOpenssl|Win32\n\t\t{21E28758-E4D2-4B84-8EC5-B631CEE66B30}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{21E28758-E4D2-4B84-8EC5-B631CEE66B30}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{21E28758-E4D2-4B84-8EC5-B631CEE66B30}.DebugOpenssl|Win32.ActiveCfg = DebugOpenssl|Win32\n\t\t{21E28758-E4D2-4B84-8EC5-B631CEE66B30}.DebugOpenssl|Win32.Build.0 = DebugOpenssl|Win32\n\t\t{21E28758-E4D2-4B84-8EC5-B631CEE66B30}.Memento|Win32.ActiveCfg = Memento|Win32\n\t\t{21E28758-E4D2-4B84-8EC5-B631CEE66B30}.Memento|Win32.Build.0 = Memento|Win32\n\t\t{21E28758-E4D2-4B84-8EC5-B631CEE66B30}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{21E28758-E4D2-4B84-8EC5-B631CEE66B30}.Release|Win32.Build.0 = Release|Win32\n\t\t{21E28758-E4D2-4B84-8EC5-B631CEE66B30}.ReleaseOpenssl|Win32.ActiveCfg = ReleaseOpenssl|Win32\n\t\t{21E28758-E4D2-4B84-8EC5-B631CEE66B30}.ReleaseOpenssl|Win32.Build.0 = ReleaseOpenssl|Win32\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "mupdf/platform/win32/mupdf.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"8.00\"\n\tName=\"mupdf\"\n\tProjectGUID=\"{E74F29F0-FA43-4ADC-B92C-6AFA08E4A417}\"\n\tRootNamespace=\"mupdf\"\n\t>\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"Win32\"\n\t\t/>\n\t</Platforms>\n\t<ToolFiles>\n\t</ToolFiles>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Debug|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\include\"\n\t\t\t\tPreprocessorDefinitions=\"FT2_BUILD_LIBRARY;OPJ_STATIC;DEBUG=1;USE_OUTPUT_DEBUG_STRING\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"1\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"2\"\n\t\t\t\tEnableIntrinsicFunctions=\"true\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\include\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tEnableFunctionLevelLinking=\"true\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Memento|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\include\"\n\t\t\t\tPreprocessorDefinitions=\"FT2_BUILD_LIBRARY;OPJ_STATIC;MEMENTO=1;DEBUG=1;USE_OUTPUT_DEBUG_STRING\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"1\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"DebugOpenssl|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\include\"\n\t\t\t\tPreprocessorDefinitions=\"FT2_BUILD_LIBRARY;OPJ_STATIC;DEBUG=1;HAVE_OPENSSL;USE_OUTPUT_DEBUG_STRING\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"1\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalDependencies=\"libeay32.lib\"\n\t\t\t\tAdditionalLibraryDirectories=\"..\\..\\thirdparty\\openssl\\lib\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"ReleaseOpenssl|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"2\"\n\t\t\t\tEnableIntrinsicFunctions=\"true\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\include\"\n\t\t\t\tPreprocessorDefinitions=\"HAVE_OPENSSL\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tEnableFunctionLevelLinking=\"true\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tAdditionalDependencies=\"libeay32.lib\"\n\t\t\t\tAdditionalLibraryDirectories=\"..\\..\\thirdparty\\openssl\\lib\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t</Configurations>\n\t<References>\n\t</References>\n\t<Files>\n\t\t<File\n\t\t\tRelativePath=\"..\\..\\platform\\x11\\pdfapp.c\"\n\t\t\t>\n\t\t</File>\n\t\t<File\n\t\t\tRelativePath=\"..\\..\\platform\\x11\\pdfapp.h\"\n\t\t\t>\n\t\t</File>\n\t\t<File\n\t\t\tRelativePath=\"..\\..\\platform\\x11\\win_main.c\"\n\t\t\t>\n\t\t</File>\n\t\t<File\n\t\t\tRelativePath=\"..\\..\\platform\\x11\\win_res.rc\"\n\t\t\t>\n\t\t</File>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "mupdf/platform/win32/mutool.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n<VisualStudioProject\n\tProjectType=\"Visual C++\"\n\tVersion=\"8.00\"\n\tName=\"mutool\"\n\tProjectGUID=\"{00811970-815B-4F64-BC9D-219078B1F3AA}\"\n\tRootNamespace=\"mupdf\"\n\t>\n\t<Platforms>\n\t\t<Platform\n\t\t\tName=\"Win32\"\n\t\t/>\n\t</Platforms>\n\t<ToolFiles>\n\t</ToolFiles>\n\t<Configurations>\n\t\t<Configuration\n\t\t\tName=\"Debug|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\include\"\n\t\t\t\tPreprocessorDefinitions=\"DEBUG=1;USE_OUTPUT_DEBUG_STRING\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"1\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Release|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\tWholeProgramOptimization=\"1\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"2\"\n\t\t\t\tEnableIntrinsicFunctions=\"true\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\include\"\n\t\t\t\tRuntimeLibrary=\"0\"\n\t\t\t\tEnableFunctionLevelLinking=\"true\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"3\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tOptimizeReferences=\"2\"\n\t\t\t\tEnableCOMDATFolding=\"2\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t\t<Configuration\n\t\t\tName=\"Memento|Win32\"\n\t\t\tOutputDirectory=\"$(ConfigurationName)\"\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\\$(ProjectName)\"\n\t\t\tConfigurationType=\"1\"\n\t\t\tCharacterSet=\"2\"\n\t\t\t>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCCLCompilerTool\"\n\t\t\t\tOptimization=\"0\"\n\t\t\t\tAdditionalIncludeDirectories=\"..\\..\\include\"\n\t\t\t\tPreprocessorDefinitions=\"MEMENTO=1;DEBUG=1;USE_OUTPUT_DEBUG_STRING\"\n\t\t\t\tMinimalRebuild=\"true\"\n\t\t\t\tBasicRuntimeChecks=\"3\"\n\t\t\t\tRuntimeLibrary=\"1\"\n\t\t\t\tWarningLevel=\"3\"\n\t\t\t\tDebugInformationFormat=\"4\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCResourceCompilerTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPreLinkEventTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCLinkerTool\"\n\t\t\t\tGenerateDebugInformation=\"true\"\n\t\t\t\tTargetMachine=\"1\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCALinkTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCManifestTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCXDCMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCBscMakeTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCFxCopTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCAppVerifierTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCWebDeploymentTool\"\n\t\t\t/>\n\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"\n\t\t\t/>\n\t\t</Configuration>\n\t</Configurations>\n\t<References>\n\t</References>\n\t<Files>\n\t\t<File\n\t\t\tRelativePath=\"..\\..\\source\\tools\\mutool.c\"\n\t\t\t>\n\t\t</File>\n\t\t<File\n\t\t\tRelativePath=\"..\\..\\source\\tools\\pdfclean.c\"\n\t\t\t>\n\t\t</File>\n\t\t<File\n\t\t\tRelativePath=\"..\\..\\source\\tools\\pdfextract.c\"\n\t\t\t>\n\t\t</File>\n\t\t<File\n\t\t\tRelativePath=\"..\\..\\source\\tools\\pdfinfo.c\"\n\t\t\t>\n\t\t</File>\n\t\t<File\n\t\t\tRelativePath=\"..\\..\\source\\tools\\pdfposter.c\"\n\t\t\t>\n\t\t</File>\n\t\t<File\n\t\t\tRelativePath=\"..\\..\\source\\tools\\pdfshow.c\"\n\t\t\t>\n\t\t</File>\n\t</Files>\n\t<Globals>\n\t</Globals>\n</VisualStudioProject>\n"
  },
  {
    "path": "mupdf/resources/cmaps/README",
    "content": "These resources are from Adobe and are covered by their\nown copyright and license.\n\nhttp://sourceforge.net/adobe/cmap/wiki/Home/\nhttp://sourceforge.net/adobe/mapping-for-pdf/wiki/Home/\n\nFormerly located at:\n\nhttp://opensource.adobe.com/wiki/display/cmap/CMap+Resources\nhttp://opensource.adobe.com/wiki/display/pdfmapping/Mapping+Resources+for+PDF\n\n\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/Adobe-CNS1-0",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe CNS1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 0 def\nend def\n\n/CMapName /Adobe-CNS1-0 def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 960 def\n/XUID [1 10 25394] def\n\n/WMode 0 def\n\n/CIDCount 14099 def\n\n1 begincodespacerange\n  <0000> <37FF>\nendcodespacerange\n\n56 begincidrange\n<0000> <00ff>     0\n<0100> <01ff>   256\n<0200> <02ff>   512\n<0300> <03ff>   768\n<0400> <04ff>  1024\n<0500> <05ff>  1280\n<0600> <06ff>  1536\n<0700> <07ff>  1792\n<0800> <08ff>  2048\n<0900> <09ff>  2304\n<0a00> <0aff>  2560\n<0b00> <0bff>  2816\n<0c00> <0cff>  3072\n<0d00> <0dff>  3328\n<0e00> <0eff>  3584\n<0f00> <0fff>  3840\n<1000> <10ff>  4096\n<1100> <11ff>  4352\n<1200> <12ff>  4608\n<1300> <13ff>  4864\n<1400> <14ff>  5120\n<1500> <15ff>  5376\n<1600> <16ff>  5632\n<1700> <17ff>  5888\n<1800> <18ff>  6144\n<1900> <19ff>  6400\n<1a00> <1aff>  6656\n<1b00> <1bff>  6912\n<1c00> <1cff>  7168\n<1d00> <1dff>  7424\n<1e00> <1eff>  7680\n<1f00> <1fff>  7936\n<2000> <20ff>  8192\n<2100> <21ff>  8448\n<2200> <22ff>  8704\n<2300> <23ff>  8960\n<2400> <24ff>  9216\n<2500> <25ff>  9472\n<2600> <26ff>  9728\n<2700> <27ff>  9984\n<2800> <28ff> 10240\n<2900> <29ff> 10496\n<2a00> <2aff> 10752\n<2b00> <2bff> 11008\n<2c00> <2cff> 11264\n<2d00> <2dff> 11520\n<2e00> <2eff> 11776\n<2f00> <2fff> 12032\n<3000> <30ff> 12288\n<3100> <31ff> 12544\n<3200> <32ff> 12800\n<3300> <33ff> 13056\n<3400> <34ff> 13312\n<3500> <35ff> 13568\n<3600> <36ff> 13824\n<3700> <3712> 14080\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/Adobe-CNS1-1",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe CNS1 1)\n%%Version: 1.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 1 def\nend def\n\n/CMapName /Adobe-CNS1-1 def\n/CMapVersion 1.002 def\n/CMapType 1 def\n\n/XUID [1 10 25590] def\n\n/WMode 0 def\n\n/CIDCount 17408 def\n\n1 begincodespacerange\n  <0000> <43FF>\nendcodespacerange\n\n68 begincidrange\n<0000> <00ff> 0\n<0100> <01ff> 256\n<0200> <02ff> 512\n<0300> <03ff> 768\n<0400> <04ff> 1024\n<0500> <05ff> 1280\n<0600> <06ff> 1536\n<0700> <07ff> 1792\n<0800> <08ff> 2048\n<0900> <09ff> 2304\n<0a00> <0aff> 2560\n<0b00> <0bff> 2816\n<0c00> <0cff> 3072\n<0d00> <0dff> 3328\n<0e00> <0eff> 3584\n<0f00> <0fff> 3840\n<1000> <10ff> 4096\n<1100> <11ff> 4352\n<1200> <12ff> 4608\n<1300> <13ff> 4864\n<1400> <14ff> 5120\n<1500> <15ff> 5376\n<1600> <16ff> 5632\n<1700> <17ff> 5888\n<1800> <18ff> 6144\n<1900> <19ff> 6400\n<1a00> <1aff> 6656\n<1b00> <1bff> 6912\n<1c00> <1cff> 7168\n<1d00> <1dff> 7424\n<1e00> <1eff> 7680\n<1f00> <1fff> 7936\n<2000> <20ff> 8192\n<2100> <21ff> 8448\n<2200> <22ff> 8704\n<2300> <23ff> 8960\n<2400> <24ff> 9216\n<2500> <25ff> 9472\n<2600> <26ff> 9728\n<2700> <27ff> 9984\n<2800> <28ff> 10240\n<2900> <29ff> 10496\n<2a00> <2aff> 10752\n<2b00> <2bff> 11008\n<2c00> <2cff> 11264\n<2d00> <2dff> 11520\n<2e00> <2eff> 11776\n<2f00> <2fff> 12032\n<3000> <30ff> 12288\n<3100> <31ff> 12544\n<3200> <32ff> 12800\n<3300> <33ff> 13056\n<3400> <34ff> 13312\n<3500> <35ff> 13568\n<3600> <36ff> 13824\n<3700> <37ff> 14080\n<3800> <38ff> 14336\n<3900> <39ff> 14592\n<3a00> <3aff> 14848\n<3b00> <3bff> 15104\n<3c00> <3cff> 15360\n<3d00> <3dff> 15616\n<3e00> <3eff> 15872\n<3f00> <3fff> 16128\n<4000> <40ff> 16384\n<4100> <41ff> 16640\n<4200> <42ff> 16896\n<4300> <43ff> 17152\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/Adobe-CNS1-2",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe CNS1 2)\n%%Version: 1.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 2 def\nend def\n\n/CMapName /Adobe-CNS1-2 def\n/CMapVersion 1.002 def\n/CMapType 1 def\n\n/XUID [1 10 25586] def\n\n/WMode 0 def\n\n/CIDCount 17601 def\n\n1 begincodespacerange\n  <0000> <44FF>\nendcodespacerange\n\n69 begincidrange\n<0000> <00ff> 0\n<0100> <01ff> 256\n<0200> <02ff> 512\n<0300> <03ff> 768\n<0400> <04ff> 1024\n<0500> <05ff> 1280\n<0600> <06ff> 1536\n<0700> <07ff> 1792\n<0800> <08ff> 2048\n<0900> <09ff> 2304\n<0a00> <0aff> 2560\n<0b00> <0bff> 2816\n<0c00> <0cff> 3072\n<0d00> <0dff> 3328\n<0e00> <0eff> 3584\n<0f00> <0fff> 3840\n<1000> <10ff> 4096\n<1100> <11ff> 4352\n<1200> <12ff> 4608\n<1300> <13ff> 4864\n<1400> <14ff> 5120\n<1500> <15ff> 5376\n<1600> <16ff> 5632\n<1700> <17ff> 5888\n<1800> <18ff> 6144\n<1900> <19ff> 6400\n<1a00> <1aff> 6656\n<1b00> <1bff> 6912\n<1c00> <1cff> 7168\n<1d00> <1dff> 7424\n<1e00> <1eff> 7680\n<1f00> <1fff> 7936\n<2000> <20ff> 8192\n<2100> <21ff> 8448\n<2200> <22ff> 8704\n<2300> <23ff> 8960\n<2400> <24ff> 9216\n<2500> <25ff> 9472\n<2600> <26ff> 9728\n<2700> <27ff> 9984\n<2800> <28ff> 10240\n<2900> <29ff> 10496\n<2a00> <2aff> 10752\n<2b00> <2bff> 11008\n<2c00> <2cff> 11264\n<2d00> <2dff> 11520\n<2e00> <2eff> 11776\n<2f00> <2fff> 12032\n<3000> <30ff> 12288\n<3100> <31ff> 12544\n<3200> <32ff> 12800\n<3300> <33ff> 13056\n<3400> <34ff> 13312\n<3500> <35ff> 13568\n<3600> <36ff> 13824\n<3700> <37ff> 14080\n<3800> <38ff> 14336\n<3900> <39ff> 14592\n<3a00> <3aff> 14848\n<3b00> <3bff> 15104\n<3c00> <3cff> 15360\n<3d00> <3dff> 15616\n<3e00> <3eff> 15872\n<3f00> <3fff> 16128\n<4000> <40ff> 16384\n<4100> <41ff> 16640\n<4200> <42ff> 16896\n<4300> <43ff> 17152\n<4400> <44c0> 17408\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/Adobe-CNS1-3",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe CNS1 3)\n%%Version: 1.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 3 def\nend def\n\n/CMapName /Adobe-CNS1-3 def\n/CMapVersion 1.002 def\n/CMapType 1 def\n\n/XUID [1 10 25587] def\n\n/WMode 0 def\n\n/CIDCount 18846 def\n\n1 begincodespacerange\n  <0000> <49FF>\nendcodespacerange\n\n74 begincidrange\n<0000> <00ff> 0\n<0100> <01ff> 256\n<0200> <02ff> 512\n<0300> <03ff> 768\n<0400> <04ff> 1024\n<0500> <05ff> 1280\n<0600> <06ff> 1536\n<0700> <07ff> 1792\n<0800> <08ff> 2048\n<0900> <09ff> 2304\n<0a00> <0aff> 2560\n<0b00> <0bff> 2816\n<0c00> <0cff> 3072\n<0d00> <0dff> 3328\n<0e00> <0eff> 3584\n<0f00> <0fff> 3840\n<1000> <10ff> 4096\n<1100> <11ff> 4352\n<1200> <12ff> 4608\n<1300> <13ff> 4864\n<1400> <14ff> 5120\n<1500> <15ff> 5376\n<1600> <16ff> 5632\n<1700> <17ff> 5888\n<1800> <18ff> 6144\n<1900> <19ff> 6400\n<1a00> <1aff> 6656\n<1b00> <1bff> 6912\n<1c00> <1cff> 7168\n<1d00> <1dff> 7424\n<1e00> <1eff> 7680\n<1f00> <1fff> 7936\n<2000> <20ff> 8192\n<2100> <21ff> 8448\n<2200> <22ff> 8704\n<2300> <23ff> 8960\n<2400> <24ff> 9216\n<2500> <25ff> 9472\n<2600> <26ff> 9728\n<2700> <27ff> 9984\n<2800> <28ff> 10240\n<2900> <29ff> 10496\n<2a00> <2aff> 10752\n<2b00> <2bff> 11008\n<2c00> <2cff> 11264\n<2d00> <2dff> 11520\n<2e00> <2eff> 11776\n<2f00> <2fff> 12032\n<3000> <30ff> 12288\n<3100> <31ff> 12544\n<3200> <32ff> 12800\n<3300> <33ff> 13056\n<3400> <34ff> 13312\n<3500> <35ff> 13568\n<3600> <36ff> 13824\n<3700> <37ff> 14080\n<3800> <38ff> 14336\n<3900> <39ff> 14592\n<3a00> <3aff> 14848\n<3b00> <3bff> 15104\n<3c00> <3cff> 15360\n<3d00> <3dff> 15616\n<3e00> <3eff> 15872\n<3f00> <3fff> 16128\n<4000> <40ff> 16384\n<4100> <41ff> 16640\n<4200> <42ff> 16896\n<4300> <43ff> 17152\n<4400> <44ff> 17408\n<4500> <45ff> 17664\n<4600> <46ff> 17920\n<4700> <47ff> 18176\n<4800> <48ff> 18432\n<4900> <499d> 18688\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/Adobe-CNS1-4",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe CNS1 4)\n%%Version: 1.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 4 def\nend def\n\n/CMapName /Adobe-CNS1-4 def\n/CMapVersion 1.003 def\n/CMapType 1 def\n\n/XUID [1 10 25595] def\n\n/WMode 0 def\n\n/CIDCount 18965 def\n\n1 begincodespacerange\n  <0000> <4AFF>\nendcodespacerange\n\n75 begincidrange\n<0000> <00ff> 0\n<0100> <01ff> 256\n<0200> <02ff> 512\n<0300> <03ff> 768\n<0400> <04ff> 1024\n<0500> <05ff> 1280\n<0600> <06ff> 1536\n<0700> <07ff> 1792\n<0800> <08ff> 2048\n<0900> <09ff> 2304\n<0a00> <0aff> 2560\n<0b00> <0bff> 2816\n<0c00> <0cff> 3072\n<0d00> <0dff> 3328\n<0e00> <0eff> 3584\n<0f00> <0fff> 3840\n<1000> <10ff> 4096\n<1100> <11ff> 4352\n<1200> <12ff> 4608\n<1300> <13ff> 4864\n<1400> <14ff> 5120\n<1500> <15ff> 5376\n<1600> <16ff> 5632\n<1700> <17ff> 5888\n<1800> <18ff> 6144\n<1900> <19ff> 6400\n<1a00> <1aff> 6656\n<1b00> <1bff> 6912\n<1c00> <1cff> 7168\n<1d00> <1dff> 7424\n<1e00> <1eff> 7680\n<1f00> <1fff> 7936\n<2000> <20ff> 8192\n<2100> <21ff> 8448\n<2200> <22ff> 8704\n<2300> <23ff> 8960\n<2400> <24ff> 9216\n<2500> <25ff> 9472\n<2600> <26ff> 9728\n<2700> <27ff> 9984\n<2800> <28ff> 10240\n<2900> <29ff> 10496\n<2a00> <2aff> 10752\n<2b00> <2bff> 11008\n<2c00> <2cff> 11264\n<2d00> <2dff> 11520\n<2e00> <2eff> 11776\n<2f00> <2fff> 12032\n<3000> <30ff> 12288\n<3100> <31ff> 12544\n<3200> <32ff> 12800\n<3300> <33ff> 13056\n<3400> <34ff> 13312\n<3500> <35ff> 13568\n<3600> <36ff> 13824\n<3700> <37ff> 14080\n<3800> <38ff> 14336\n<3900> <39ff> 14592\n<3a00> <3aff> 14848\n<3b00> <3bff> 15104\n<3c00> <3cff> 15360\n<3d00> <3dff> 15616\n<3e00> <3eff> 15872\n<3f00> <3fff> 16128\n<4000> <40ff> 16384\n<4100> <41ff> 16640\n<4200> <42ff> 16896\n<4300> <43ff> 17152\n<4400> <44ff> 17408\n<4500> <45ff> 17664\n<4600> <46ff> 17920\n<4700> <47ff> 18176\n<4800> <48ff> 18432\n<4900> <49ff> 18688\n<4a00> <4a14> 18944\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/Adobe-CNS1-5",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe CNS1 5)\n%%Version: 1.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 5 def\nend def\n\n/CMapName /Adobe-CNS1-5 def\n/CMapVersion 1.002 def\n/CMapType 1 def\n\n/XUID [1 10 25598] def\n\n/WMode 0 def\n\n/CIDCount 19088 def\n\n1 begincodespacerange\n  <0000> <4AFF>\nendcodespacerange\n\n75 begincidrange\n<0000> <00ff> 0\n<0100> <01ff> 256\n<0200> <02ff> 512\n<0300> <03ff> 768\n<0400> <04ff> 1024\n<0500> <05ff> 1280\n<0600> <06ff> 1536\n<0700> <07ff> 1792\n<0800> <08ff> 2048\n<0900> <09ff> 2304\n<0a00> <0aff> 2560\n<0b00> <0bff> 2816\n<0c00> <0cff> 3072\n<0d00> <0dff> 3328\n<0e00> <0eff> 3584\n<0f00> <0fff> 3840\n<1000> <10ff> 4096\n<1100> <11ff> 4352\n<1200> <12ff> 4608\n<1300> <13ff> 4864\n<1400> <14ff> 5120\n<1500> <15ff> 5376\n<1600> <16ff> 5632\n<1700> <17ff> 5888\n<1800> <18ff> 6144\n<1900> <19ff> 6400\n<1a00> <1aff> 6656\n<1b00> <1bff> 6912\n<1c00> <1cff> 7168\n<1d00> <1dff> 7424\n<1e00> <1eff> 7680\n<1f00> <1fff> 7936\n<2000> <20ff> 8192\n<2100> <21ff> 8448\n<2200> <22ff> 8704\n<2300> <23ff> 8960\n<2400> <24ff> 9216\n<2500> <25ff> 9472\n<2600> <26ff> 9728\n<2700> <27ff> 9984\n<2800> <28ff> 10240\n<2900> <29ff> 10496\n<2a00> <2aff> 10752\n<2b00> <2bff> 11008\n<2c00> <2cff> 11264\n<2d00> <2dff> 11520\n<2e00> <2eff> 11776\n<2f00> <2fff> 12032\n<3000> <30ff> 12288\n<3100> <31ff> 12544\n<3200> <32ff> 12800\n<3300> <33ff> 13056\n<3400> <34ff> 13312\n<3500> <35ff> 13568\n<3600> <36ff> 13824\n<3700> <37ff> 14080\n<3800> <38ff> 14336\n<3900> <39ff> 14592\n<3a00> <3aff> 14848\n<3b00> <3bff> 15104\n<3c00> <3cff> 15360\n<3d00> <3dff> 15616\n<3e00> <3eff> 15872\n<3f00> <3fff> 16128\n<4000> <40ff> 16384\n<4100> <41ff> 16640\n<4200> <42ff> 16896\n<4300> <43ff> 17152\n<4400> <44ff> 17408\n<4500> <45ff> 17664\n<4600> <46ff> 17920\n<4700> <47ff> 18176\n<4800> <48ff> 18432\n<4900> <49ff> 18688\n<4a00> <4a8f> 18944\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/Adobe-CNS1-6",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe CNS1 6)\n%%Version: 1.000\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 6 def\nend def\n\n/CMapName /Adobe-CNS1-6 def\n/CMapVersion 1.000 def\n/CMapType 1 def\n\n/XUID [1 10 25599] def\n\n/WMode 0 def\n\n/CIDCount 19156 def\n\n1 begincodespacerange\n  <0000> <4AFF>\nendcodespacerange\n\n75 begincidrange\n<0000> <00ff> 0\n<0100> <01ff> 256\n<0200> <02ff> 512\n<0300> <03ff> 768\n<0400> <04ff> 1024\n<0500> <05ff> 1280\n<0600> <06ff> 1536\n<0700> <07ff> 1792\n<0800> <08ff> 2048\n<0900> <09ff> 2304\n<0a00> <0aff> 2560\n<0b00> <0bff> 2816\n<0c00> <0cff> 3072\n<0d00> <0dff> 3328\n<0e00> <0eff> 3584\n<0f00> <0fff> 3840\n<1000> <10ff> 4096\n<1100> <11ff> 4352\n<1200> <12ff> 4608\n<1300> <13ff> 4864\n<1400> <14ff> 5120\n<1500> <15ff> 5376\n<1600> <16ff> 5632\n<1700> <17ff> 5888\n<1800> <18ff> 6144\n<1900> <19ff> 6400\n<1a00> <1aff> 6656\n<1b00> <1bff> 6912\n<1c00> <1cff> 7168\n<1d00> <1dff> 7424\n<1e00> <1eff> 7680\n<1f00> <1fff> 7936\n<2000> <20ff> 8192\n<2100> <21ff> 8448\n<2200> <22ff> 8704\n<2300> <23ff> 8960\n<2400> <24ff> 9216\n<2500> <25ff> 9472\n<2600> <26ff> 9728\n<2700> <27ff> 9984\n<2800> <28ff> 10240\n<2900> <29ff> 10496\n<2a00> <2aff> 10752\n<2b00> <2bff> 11008\n<2c00> <2cff> 11264\n<2d00> <2dff> 11520\n<2e00> <2eff> 11776\n<2f00> <2fff> 12032\n<3000> <30ff> 12288\n<3100> <31ff> 12544\n<3200> <32ff> 12800\n<3300> <33ff> 13056\n<3400> <34ff> 13312\n<3500> <35ff> 13568\n<3600> <36ff> 13824\n<3700> <37ff> 14080\n<3800> <38ff> 14336\n<3900> <39ff> 14592\n<3a00> <3aff> 14848\n<3b00> <3bff> 15104\n<3c00> <3cff> 15360\n<3d00> <3dff> 15616\n<3e00> <3eff> 15872\n<3f00> <3fff> 16128\n<4000> <40ff> 16384\n<4100> <41ff> 16640\n<4200> <42ff> 16896\n<4300> <43ff> 17152\n<4400> <44ff> 17408\n<4500> <45ff> 17664\n<4600> <46ff> 17920\n<4700> <47ff> 18176\n<4800> <48ff> 18432\n<4900> <49ff> 18688\n<4a00> <4ad3> 18944\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/Adobe-CNS1-UCS2",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Adobe-CNS1-UCS2)\n%%Title: (Adobe-CNS1-UCS2 Adobe CNS1 5)\n%%Version: 13.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n/Registry (Adobe) def\n/Ordering (Adobe_CNS1_UCS2) def\n/Supplement 5 def\nend def\n\n/CMapName /Adobe-CNS1-UCS2 def\n\n/CMapVersion 13.003 def\n/CMapType 2 def\n\n/XUID [1 10 25335 1212] def\n\n/WMode 0 def\n\n1 begincodespacerange\n  <0000> <FFFF>\nendcodespacerange\n\n100 beginbfchar\n<0000> <fffd>\n<0060> <00a9>\n<0061> <2122>\n<0062> <2026>\n<0063> <3000>\n<0064> <ff0c>\n<0067> <ff0e>\n<0068> <2027>\n<0069> <ff1b>\n<006a> <ff1a>\n<006b> <ff1f>\n<006c> <ff01>\n<006d> <fe30>\n<006e> <22ef>\n<006f> <2025>\n<0073> <00b7>\n<0078> <ff5c>\n<0079> <2013>\n<007a> <fe31>\n<007b> <2014>\n<007c> <fffd>\n<007d> <fffd>\n<007e> <fffd>\n<007f> <fffd>\n<0084> <ff5b>\n<0085> <ff5d>\n<00ac> <2035>\n<00ad> <2032>\n<00ae> <ff03>\n<00af> <ff06>\n<00b0> <ff0a>\n<00b1> <203b>\n<00b2> <00a7>\n<00b3> <3003>\n<00b4> <25cb>\n<00b5> <25cf>\n<00b6> <25b3>\n<00b7> <25b2>\n<00b8> <25ce>\n<00b9> <2606>\n<00ba> <2605>\n<00bb> <25c7>\n<00bc> <25c6>\n<00bd> <25a1>\n<00be> <25a0>\n<00bf> <25bd>\n<00c0> <25bc>\n<00c1> <32a3>\n<00c2> <2105>\n<00c3> <203e>\n<00c4> <ffe3>\n<00c5> <ff3f>\n<00c6> <02cd>\n<00d0> <ff0b>\n<00d1> <ff0d>\n<00d2> <00d7>\n<00d3> <00f7>\n<00d4> <00b1>\n<00d5> <221a>\n<00d6> <ff1c>\n<00d7> <ff1e>\n<00d8> <ff1d>\n<00db> <2260>\n<00dc> <221e>\n<00dd> <2252>\n<00de> <2261>\n<00e4> <223c>\n<00e7> <22a5>\n<00e8> <2220>\n<00e9> <221f>\n<00ea> <22bf>\n<00eb> <33d2>\n<00ec> <33d1>\n<00ed> <222b>\n<00ee> <222e>\n<00ef> <2235>\n<00f0> <2234>\n<00f1> <2640>\n<00f2> <2642>\n<00f3> <2295>\n<00f4> <2609>\n<00f5> <2191>\n<00f6> <2193>\n<00f7> <2192>\n<00f8> <2190>\n<00fb> <2199>\n<00fc> <2198>\n<00fd> <2225>\n<00fe> <2223>\n<00ff> <ff0f>\n<0100> <ff3c>\n<0101> <ff0f>\n<0102> <ff3c>\n<0103> <ff04>\n<0104> <00a5>\n<0105> <3012>\n<0108> <ff05>\n<0109> <ff20>\n<010a> <2103>\n<010b> <2109>\nendbfchar\n\n100 beginbfchar\n<010f> <33d5>\n<0113> <33ce>\n<0114> <33a1>\n<0117> <33c4>\n<0118> <00b0>\n<0119> <5159>\n<011a> <515b>\n<011b> <515e>\n<011c> <515d>\n<011d> <5161>\n<011e> <5163>\n<011f> <55e7>\n<0120> <74e9>\n<0121> <7cce>\n<012a> <258f>\n<012b> <258e>\n<012c> <258d>\n<012d> <258c>\n<012e> <258b>\n<012f> <258a>\n<0130> <2589>\n<0131> <253c>\n<0132> <2534>\n<0133> <252c>\n<0134> <2524>\n<0135> <251c>\n<0136> <2594>\n<0137> <2500>\n<0138> <2502>\n<0139> <2595>\n<013a> <250c>\n<013b> <2510>\n<013c> <2514>\n<013d> <2518>\n<0140> <2570>\n<0141> <256f>\n<0142> <2550>\n<0143> <255e>\n<0144> <256a>\n<0145> <2561>\n<0148> <25e5>\n<0149> <25e4>\n<016a> <3038>\n<016b> <5344>\n<016c> <303a>\n<01f6> <02d9>\n<01f7> <02ca>\n<01f8> <02c7>\n<01f9> <02cb>\n<0218> <4e28>\n<0219> <4e36>\n<021a> <4e3f>\n<021b> <4e85>\n<021c> <4ea0>\n<021d> <5182>\n<021e> <5196>\n<021f> <51ab>\n<0220> <52f9>\n<0221> <5338>\n<0222> <5369>\n<0223> <53b6>\n<0224> <5902>\n<0225> <5b80>\n<0226> <5ddb>\n<0227> <5e7a>\n<0228> <5e7f>\n<0229> <5ef4>\n<022a> <5f50>\n<022b> <5f61>\n<022c> <6534>\n<022d> <65e0>\n<022e> <7592>\n<022f> <7676>\n<0230> <8fb5>\n<0231> <96b6>\n<0252> <2421>\n<0253> <4e00>\n<0254> <4e59>\n<0255> <4e01>\n<0256> <4e03>\n<0257> <4e43>\n<0258> <4e5d>\n<0259> <4e86>\n<025a> <4e8c>\n<025b> <4eba>\n<025c> <513f>\n<025d> <5165>\n<025e> <516b>\n<025f> <51e0>\n<0262> <529b>\n<0263> <5315>\n<0264> <5341>\n<0265> <535c>\n<0266> <53c8>\n<0267> <4e09>\n<0268> <4e0b>\n<0269> <4e08>\n<026a> <4e0a>\n<026b> <4e2b>\n<026c> <4e38>\nendbfchar\n\n100 beginbfchar\n<026d> <51e1>\n<026e> <4e45>\n<026f> <4e48>\n<0270> <4e5f>\n<0271> <4e5e>\n<0272> <4e8e>\n<0273> <4ea1>\n<0274> <5140>\n<0275> <5203>\n<0276> <52fa>\n<0277> <5343>\n<0278> <53c9>\n<0279> <53e3>\n<027a> <571f>\n<027b> <58eb>\n<027c> <5915>\n<027d> <5927>\n<027e> <5973>\n<0281> <5b53>\n<0282> <5bf8>\n<0283> <5c0f>\n<0284> <5c22>\n<0285> <5c38>\n<0286> <5c71>\n<0287> <5ddd>\n<0288> <5de5>\n<028c> <5dfe>\n<028d> <5e72>\n<028e> <5efe>\n<028f> <5f0b>\n<0290> <5f13>\n<0291> <624d>\n<0292> <4e11>\n<0293> <4e10>\n<0294> <4e0d>\n<0295> <4e2d>\n<0296> <4e30>\n<0297> <4e39>\n<0298> <4e4b>\n<0299> <5c39>\n<029a> <4e88>\n<029b> <4e91>\n<029c> <4e95>\n<029d> <4e92>\n<029e> <4e94>\n<029f> <4ea2>\n<02a0> <4ec1>\n<02a1> <4ec0>\n<02a2> <4ec3>\n<02a5> <4ecd>\n<02a8> <4ec4>\n<02a9> <5143>\n<02aa> <5141>\n<02ab> <5167>\n<02ae> <516c>\n<02af> <5197>\n<02b0> <51f6>\n<02b4> <52fb>\n<02b7> <5316>\n<02b8> <5339>\n<02b9> <5348>\n<02ba> <5347>\n<02bb> <5345>\n<02bc> <535e>\n<02bd> <5384>\n<02be> <53cb>\n<02bf> <53ca>\n<02c0> <53cd>\n<02c1> <58ec>\n<02c2> <5929>\n<02c3> <592b>\n<02c4> <592a>\n<02c5> <592d>\n<02c6> <5b54>\n<02c7> <5c11>\n<02c8> <5c24>\n<02c9> <5c3a>\n<02ca> <5c6f>\n<02cb> <5df4>\n<02cc> <5e7b>\n<02cd> <5eff>\n<02d0> <5fc3>\n<02d1> <6208>\n<02d2> <6236>\n<02d3> <624b>\n<02d4> <624e>\n<02d5> <652f>\n<02d6> <6587>\n<02d7> <6597>\n<02d8> <65a4>\n<02d9> <65b9>\n<02da> <65e5>\n<02db> <66f0>\n<02dc> <6708>\n<02dd> <6728>\n<02de> <6b20>\n<02df> <6b62>\n<02e0> <6b79>\n<02e1> <6bcb>\n<02e2> <6bd4>\nendbfchar\n\n100 beginbfchar\n<02e3> <6bdb>\n<02e4> <6c0f>\n<02e5> <6c34>\n<02e6> <706b>\n<02e7> <722a>\n<02e8> <7236>\n<02e9> <723b>\n<02ea> <7247>\n<02eb> <7259>\n<02ec> <725b>\n<02ed> <72ac>\n<02ee> <738b>\n<02ef> <4e19>\n<02f0> <4e16>\n<02f1> <4e15>\n<02f2> <4e14>\n<02f3> <4e18>\n<02f4> <4e3b>\n<02f5> <4e4d>\n<02f6> <4e4f>\n<02f7> <4e4e>\n<02f8> <4ee5>\n<02f9> <4ed8>\n<0300> <4ed9>\n<0301> <4ede>\n<0302> <5145>\n<0303> <5144>\n<0306> <51ac>\n<0309> <51f8>\n<030a> <520a>\n<030b> <52a0>\n<030c> <529f>\n<030f> <5317>\n<0310> <531d>\n<0311> <4edf>\n<0312> <534a>\n<0313> <5349>\n<0314> <5361>\n<0315> <5360>\n<0316> <536f>\n<0317> <536e>\n<0318> <53bb>\n<0319> <53ef>\n<031a> <53e4>\n<031b> <53f3>\n<031c> <53ec>\n<031d> <53ee>\n<031e> <53e9>\n<031f> <53e8>\n<0320> <53fc>\n<0321> <53f8>\n<0322> <53f5>\n<0323> <53eb>\n<0324> <53e6>\n<0325> <53ea>\n<0326> <53f2>\n<0327> <53f1>\n<0328> <53f0>\n<0329> <53e5>\n<032a> <53ed>\n<032b> <53fb>\n<032c> <56db>\n<032d> <56da>\n<032e> <5916>\n<032f> <592e>\n<0330> <5931>\n<0331> <5974>\n<0332> <5976>\n<0333> <5b55>\n<0334> <5b83>\n<0335> <5c3c>\n<0336> <5de8>\n<0337> <5de7>\n<0338> <5de6>\n<033b> <5e73>\n<033c> <5e7c>\n<033d> <5f01>\n<033e> <5f18>\n<033f> <5f17>\n<0340> <5fc5>\n<0341> <620a>\n<0344> <6252>\n<0345> <6251>\n<0346> <65a5>\n<0347> <65e6>\n<0348> <672e>\n<0349> <672c>\n<034c> <672d>\n<034d> <6b63>\n<034e> <6bcd>\n<034f> <6c11>\n<0350> <6c10>\n<0351> <6c38>\n<0352> <6c41>\n<0353> <6c40>\n<0354> <6c3e>\n<0355> <72af>\n<0356> <7384>\n<0357> <7389>\n<0358> <74dc>\nendbfchar\n\n100 beginbfchar\n<0359> <74e6>\n<035a> <7518>\n<035b> <751f>\n<0362> <758b>\n<0363> <767d>\n<0364> <76ae>\n<0365> <76bf>\n<0366> <76ee>\n<0367> <77db>\n<0368> <77e2>\n<0369> <77f3>\n<036a> <793a>\n<036b> <79be>\n<036c> <7a74>\n<036d> <7acb>\n<0372> <4e69>\n<0373> <4e99>\n<0374> <4ea4>\n<0375> <4ea6>\n<0376> <4ea5>\n<0377> <4eff>\n<0378> <4f09>\n<0379> <4f19>\n<037a> <4f0a>\n<037b> <4f15>\n<037c> <4f0d>\n<037f> <4f0f>\n<0380> <4ef2>\n<0381> <4ef6>\n<0382> <4efb>\n<0383> <4ef0>\n<0384> <4ef3>\n<0385> <4efd>\n<0386> <4f01>\n<0387> <4f0b>\n<0388> <5149>\n<0389> <5147>\n<038a> <5146>\n<038b> <5148>\n<038c> <5168>\n<038d> <5171>\n<038e> <518d>\n<038f> <51b0>\n<0390> <5217>\n<0393> <520e>\n<0394> <5216>\n<0395> <52a3>\n<0396> <5308>\n<0397> <5321>\n<0398> <5320>\n<039b> <5409>\n<039c> <540f>\n<039d> <540c>\n<039e> <540a>\n<039f> <5410>\n<03a0> <5401>\n<03a1> <540b>\n<03a2> <5404>\n<03a3> <5411>\n<03a4> <540d>\n<03a5> <5408>\n<03a6> <5403>\n<03a7> <540e>\n<03a8> <5406>\n<03a9> <5412>\n<03aa> <56e0>\n<03ab> <56de>\n<03ac> <56dd>\n<03ad> <5733>\n<03ae> <5730>\n<03af> <5728>\n<03b0> <572d>\n<03b1> <572c>\n<03b2> <572f>\n<03b3> <5729>\n<03b8> <5984>\n<03b9> <5978>\n<03ba> <5983>\n<03bb> <597d>\n<03bc> <5979>\n<03bd> <5982>\n<03be> <5981>\n<03c3> <5b85>\n<03c4> <5b89>\n<03c5> <5bfa>\n<03c6> <5c16>\n<03c7> <5c79>\n<03c8> <5dde>\n<03c9> <5e06>\n<03ca> <5e76>\n<03cb> <5e74>\n<03cc> <5f0f>\n<03cd> <5f1b>\n<03ce> <5fd9>\n<03cf> <5fd6>\n<03d0> <620e>\n<03d3> <6210>\n<03d4> <6263>\n<03d5> <625b>\n<03d6> <6258>\nendbfchar\n\n100 beginbfchar\n<03d7> <6536>\n<03d8> <65e9>\n<03d9> <65e8>\n<03de> <6709>\n<03df> <673d>\n<03e0> <6734>\n<03e1> <6731>\n<03e2> <6735>\n<03e3> <6b21>\n<03e4> <6b64>\n<03e5> <6b7b>\n<03e6> <6c16>\n<03e7> <6c5d>\n<03e8> <6c57>\n<03e9> <6c59>\n<03ec> <6c50>\n<03ed> <6c55>\n<03ee> <6c61>\n<03ef> <6c5b>\n<03f2> <7070>\n<03f3> <725f>\n<03f4> <725d>\n<03f5> <767e>\n<03f6> <7af9>\n<03f7> <7c73>\n<03f8> <7cf8>\n<03f9> <7f36>\n<03fa> <7f8a>\n<03fb> <7fbd>\n<03fc> <8001>\n<03fd> <8003>\n<03fe> <800c>\n<03ff> <8012>\n<0400> <8033>\n<0401> <807f>\n<0402> <8089>\n<0405> <81e3>\n<0406> <81ea>\n<0407> <81f3>\n<0408> <81fc>\n<0409> <820c>\n<040a> <821b>\n<040b> <821f>\n<040c> <826e>\n<040d> <8272>\n<040e> <827e>\n<040f> <866b>\n<0410> <8840>\n<0411> <884c>\n<0412> <8863>\n<0413> <897f>\n<0414> <9621>\n<0415> <4e32>\n<0416> <4ea8>\n<0417> <4f4d>\n<0418> <4f4f>\n<0419> <4f47>\n<041a> <4f57>\n<041b> <4f5e>\n<041c> <4f34>\n<041d> <4f5b>\n<041e> <4f55>\n<041f> <4f30>\n<0422> <4f3d>\n<0423> <4f3a>\n<0424> <4f38>\n<0425> <4f43>\n<0426> <4f54>\n<0427> <4f3c>\n<0428> <4f46>\n<0429> <4f63>\n<042a> <4f5c>\n<042b> <4f60>\n<042c> <4f2f>\n<042d> <4f4e>\n<042e> <4f36>\n<042f> <4f59>\n<0430> <4f5d>\n<0431> <4f48>\n<0432> <4f5a>\n<0433> <514c>\n<0434> <514b>\n<0435> <514d>\n<0436> <5175>\n<0439> <5225>\n<043a> <5224>\n<043d> <5228>\n<043e> <52ab>\n<0441> <52ac>\n<0442> <5323>\n<0443> <5373>\n<0444> <5375>\n<0445> <541d>\n<0446> <542d>\n<0447> <541e>\n<0448> <543e>\n<0449> <5426>\n<044a> <544e>\n<044b> <5427>\n<044c> <5446>\nendbfchar\n\n100 beginbfchar\n<044d> <5443>\n<044e> <5433>\n<044f> <5448>\n<0450> <5442>\n<0451> <541b>\n<0452> <5429>\n<0453> <544a>\n<0454> <5439>\n<0455> <543b>\n<0456> <5438>\n<0457> <542e>\n<045a> <5420>\n<045b> <543c>\n<045c> <5440>\n<045d> <5431>\n<045e> <542b>\n<045f> <541f>\n<0460> <542c>\n<0461> <56ea>\n<0462> <56f0>\n<0463> <56e4>\n<0464> <56eb>\n<0465> <574a>\n<0466> <5751>\n<0467> <5740>\n<0468> <574d>\n<0469> <5747>\n<046a> <574e>\n<046b> <573e>\n<046c> <5750>\n<046d> <574f>\n<046e> <573b>\n<046f> <58ef>\n<0470> <593e>\n<0471> <599d>\n<0472> <5992>\n<0473> <59a8>\n<0474> <599e>\n<0475> <59a3>\n<0476> <5999>\n<0477> <5996>\n<0478> <598d>\n<0479> <59a4>\n<047a> <5993>\n<047b> <598a>\n<047c> <59a5>\n<047d> <5b5d>\n<047e> <5b5c>\n<0481> <5b8c>\n<0482> <5b8b>\n<0483> <5b8f>\n<0484> <5c2c>\n<0487> <5c3f>\n<0488> <5c3e>\n<048b> <5c94>\n<048c> <5c8c>\n<048d> <5deb>\n<048e> <5e0c>\n<048f> <5e8f>\n<0490> <5e87>\n<0491> <5e8a>\n<0492> <5ef7>\n<0493> <5f04>\n<0494> <5f1f>\n<0495> <5f64>\n<0496> <5f62>\n<0497> <5f77>\n<0498> <5f79>\n<0499> <5fd8>\n<049a> <5fcc>\n<049b> <5fd7>\n<049c> <5fcd>\n<049d> <5ff1>\n<049e> <5feb>\n<049f> <5ff8>\n<04a0> <5fea>\n<04a1> <6212>\n<04a2> <6211>\n<04a3> <6284>\n<04a4> <6297>\n<04a5> <6296>\n<04a6> <6280>\n<04a7> <6276>\n<04a8> <6289>\n<04a9> <626d>\n<04aa> <628a>\n<04ab> <627c>\n<04ac> <627e>\n<04ad> <6279>\n<04ae> <6273>\n<04af> <6292>\n<04b0> <626f>\n<04b1> <6298>\n<04b2> <626e>\n<04b3> <6295>\n<04b4> <6293>\n<04b5> <6291>\n<04b6> <6286>\n<04b7> <6539>\n<04b8> <653b>\nendbfchar\n\n100 beginbfchar\n<04b9> <6538>\n<04ba> <65f1>\n<04bb> <66f4>\n<04bc> <675f>\n<04c1> <675c>\n<04c2> <6756>\n<04c3> <675e>\n<04c4> <6749>\n<04c5> <6746>\n<04c6> <6760>\n<04c7> <6753>\n<04c8> <6757>\n<04c9> <6b65>\n<04ca> <6bcf>\n<04cb> <6c42>\n<04cc> <6c5e>\n<04cd> <6c99>\n<04ce> <6c81>\n<04d1> <6c85>\n<04d2> <6c9b>\n<04d3> <6c6a>\n<04d4> <6c7a>\n<04d5> <6c90>\n<04d6> <6c70>\n<04d7> <6c8c>\n<04d8> <6c68>\n<04d9> <6c96>\n<04da> <6c92>\n<04db> <6c7d>\n<04dc> <6c83>\n<04dd> <6c72>\n<04de> <6c7e>\n<04df> <6c74>\n<04e0> <6c86>\n<04e1> <6c76>\n<04e2> <6c8d>\n<04e3> <6c94>\n<04e4> <6c98>\n<04e5> <6c82>\n<04e6> <7076>\n<04e9> <7078>\n<04ea> <7262>\n<04eb> <7261>\n<04ec> <7260>\n<04ed> <72c4>\n<04ee> <72c2>\n<04ef> <7396>\n<04f0> <752c>\n<04f1> <752b>\n<04f4> <7682>\n<04f5> <76ef>\n<04f6> <77e3>\n<04f7> <79c1>\n<04f8> <79c0>\n<04f9> <79bf>\n<04fa> <7a76>\n<04fb> <7cfb>\n<04fc> <7f55>\n<04fd> <8096>\n<04fe> <8093>\n<04ff> <809d>\n<0500> <8098>\n<0501> <809b>\n<0502> <809a>\n<0503> <80b2>\n<0504> <826f>\n<0505> <8292>\n<0506> <828b>\n<0507> <828d>\n<0508> <898b>\n<0509> <89d2>\n<050a> <8a00>\n<050b> <8c37>\n<050c> <8c46>\n<050d> <8c55>\n<050e> <8c9d>\n<050f> <8d64>\n<0510> <8d70>\n<0511> <8db3>\n<0512> <8eab>\n<0513> <8eca>\n<0514> <8f9b>\n<0515> <8fb0>\n<0516> <8fc2>\n<0517> <8fc6>\n<0518> <8fc5>\n<0519> <8fc4>\n<051a> <5de1>\n<051b> <9091>\n<051c> <90a2>\n<051d> <90aa>\n<051e> <90a6>\n<051f> <90a3>\n<0520> <9149>\n<0521> <91c6>\n<0522> <91cc>\n<0523> <9632>\n<0524> <962e>\n<0525> <9631>\n<0526> <962a>\nendbfchar\n\n100 beginbfchar\n<0527> <962c>\n<0528> <4e26>\n<0529> <4e56>\n<052a> <4e73>\n<052b> <4e8b>\n<052c> <4e9b>\n<052d> <4e9e>\n<0530> <4f6f>\n<0531> <4f9d>\n<0532> <4f8d>\n<0533> <4f73>\n<0534> <4f7f>\n<0535> <4f6c>\n<0536> <4f9b>\n<0537> <4f8b>\n<0538> <4f86>\n<0539> <4f83>\n<053a> <4f70>\n<053b> <4f75>\n<053c> <4f88>\n<053d> <4f69>\n<053e> <4f7b>\n<053f> <4f96>\n<0540> <4f7e>\n<0541> <4f8f>\n<0542> <4f91>\n<0543> <4f7a>\n<0544> <5154>\n<0545> <5152>\n<0546> <5155>\n<0547> <5169>\n<0548> <5177>\n<0549> <5176>\n<054a> <5178>\n<054b> <51bd>\n<054c> <51fd>\n<054d> <523b>\n<054e> <5238>\n<054f> <5237>\n<0550> <523a>\n<0551> <5230>\n<0552> <522e>\n<0553> <5236>\n<0554> <5241>\n<0555> <52be>\n<0556> <52bb>\n<0557> <5352>\n<0558> <5354>\n<0559> <5353>\n<055a> <5351>\n<055b> <5366>\n<055f> <53d6>\n<0560> <53d4>\n<0561> <53d7>\n<0562> <5473>\n<0563> <5475>\n<0564> <5496>\n<0565> <5478>\n<0566> <5495>\n<0567> <5480>\n<0568> <547b>\n<0569> <5477>\n<056a> <5484>\n<056b> <5492>\n<056c> <5486>\n<056d> <547c>\n<056e> <5490>\n<056f> <5471>\n<0570> <5476>\n<0571> <548c>\n<0572> <549a>\n<0573> <5462>\n<0574> <5468>\n<0575> <548b>\n<0576> <547d>\n<0577> <548e>\n<0578> <56fa>\n<0579> <5783>\n<057a> <5777>\n<057b> <576a>\n<057c> <5769>\n<057d> <5761>\n<057e> <5766>\n<057f> <5764>\n<0580> <577c>\n<0581> <591c>\n<0582> <5949>\n<0585> <5944>\n<0586> <5954>\n<0587> <59be>\n<0588> <59bb>\n<0589> <59d4>\n<058a> <59b9>\n<058b> <59ae>\n<058c> <59d1>\n<058d> <59c6>\n<058e> <59d0>\n<058f> <59cd>\n<0590> <59cb>\n<0591> <59d3>\nendbfchar\n\n100 beginbfchar\n<0592> <59ca>\n<0593> <59af>\n<0594> <59b3>\n<0595> <59d2>\n<0596> <59c5>\n<0597> <5b5f>\n<0598> <5b64>\n<0599> <5b63>\n<059a> <5b97>\n<059b> <5b9a>\n<059c> <5b98>\n<059d> <5b9c>\n<059e> <5b99>\n<059f> <5b9b>\n<05a0> <5c1a>\n<05a1> <5c48>\n<05a4> <5cb7>\n<05a5> <5ca1>\n<05a6> <5cb8>\n<05a7> <5ca9>\n<05a8> <5cab>\n<05a9> <5cb1>\n<05aa> <5cb3>\n<05ab> <5e18>\n<05ac> <5e1a>\n<05ad> <5e16>\n<05ae> <5e15>\n<05af> <5e1b>\n<05b0> <5e11>\n<05b1> <5e78>\n<05b2> <5e9a>\n<05b3> <5e97>\n<05b4> <5e9c>\n<05b7> <5ef6>\n<05ba> <5f29>\n<05bd> <5f7f>\n<05be> <5f7c>\n<05bf> <5fdd>\n<05c0> <5fe0>\n<05c1> <5ffd>\n<05c2> <5ff5>\n<05c3> <5fff>\n<05c4> <600f>\n<05c5> <6014>\n<05c6> <602f>\n<05c7> <6035>\n<05c8> <6016>\n<05c9> <602a>\n<05ca> <6015>\n<05cb> <6021>\n<05cc> <6027>\n<05cd> <6029>\n<05ce> <602b>\n<05cf> <601b>\n<05d0> <6216>\n<05d1> <6215>\n<05d2> <623f>\n<05d3> <623e>\n<05d4> <6240>\n<05d5> <627f>\n<05d6> <62c9>\n<05d7> <62cc>\n<05d8> <62c4>\n<05d9> <62bf>\n<05da> <62c2>\n<05db> <62b9>\n<05dc> <62d2>\n<05dd> <62db>\n<05de> <62ab>\n<05e1> <62cb>\n<05e2> <62c8>\n<05e3> <62a8>\n<05e4> <62bd>\n<05e5> <62bc>\n<05e6> <62d0>\n<05e7> <62d9>\n<05e8> <62c7>\n<05e9> <62cd>\n<05ea> <62b5>\n<05eb> <62da>\n<05ec> <62b1>\n<05ed> <62d8>\n<05f0> <62c6>\n<05f1> <62ac>\n<05f2> <62ce>\n<05f3> <653e>\n<05f4> <65a7>\n<05f5> <65bc>\n<05f6> <65fa>\n<05f7> <6614>\n<05f8> <6613>\n<05f9> <660c>\n<05fa> <6606>\n<05fb> <6602>\n<05fc> <660e>\n<05fd> <6600>\n<05fe> <660f>\n<05ff> <6615>\n<0600> <660a>\n<0601> <6607>\nendbfchar\n\n100 beginbfchar\n<0602> <670d>\n<0603> <670b>\n<0604> <676d>\n<0605> <678b>\n<0606> <6795>\n<0607> <6771>\n<0608> <679c>\n<0609> <6773>\n<060a> <6777>\n<060b> <6787>\n<060c> <679d>\n<060d> <6797>\n<0610> <677f>\n<0611> <6789>\n<0612> <677e>\n<0613> <6790>\n<0614> <6775>\n<0615> <679a>\n<0616> <6793>\n<0617> <677c>\n<0618> <676a>\n<0619> <6772>\n<061a> <6b23>\n<061d> <6b7f>\n<061e> <6c13>\n<061f> <6c1b>\n<0620> <6ce3>\n<0621> <6ce8>\n<0622> <6cf3>\n<0623> <6cb1>\n<0624> <6ccc>\n<0625> <6ce5>\n<0626> <6cb3>\n<0629> <6cbc>\n<062a> <6ce2>\n<062b> <6cab>\n<062c> <6cd5>\n<062d> <6cd3>\n<062e> <6cb8>\n<062f> <6cc4>\n<0630> <6cb9>\n<0631> <6cc1>\n<0632> <6cae>\n<0633> <6cd7>\n<0634> <6cc5>\n<0635> <6cf1>\n<0636> <6cbf>\n<0637> <6cbb>\n<0638> <6ce1>\n<0639> <6cdb>\n<063a> <6cca>\n<063b> <6cac>\n<063c> <6cef>\n<063d> <6cdc>\n<063e> <6cd6>\n<063f> <6ce0>\n<0640> <7095>\n<0641> <708e>\n<0642> <7092>\n<0643> <708a>\n<0644> <7099>\n<0647> <7238>\n<0648> <7248>\n<0649> <7267>\n<064a> <7269>\n<064b> <72c0>\n<064c> <72ce>\n<064d> <72d9>\n<064e> <72d7>\n<064f> <72d0>\n<0650> <73a9>\n<0651> <73a8>\n<0652> <739f>\n<0653> <73ab>\n<0654> <73a5>\n<0655> <753d>\n<0656> <759d>\n<0659> <7684>\n<065a> <76c2>\n<065b> <76f2>\n<065c> <76f4>\n<065d> <77e5>\n<065e> <77fd>\n<065f> <793e>\n<0662> <79c9>\n<0663> <79c8>\n<0664> <7a7a>\n<0665> <7a79>\n<0666> <7afa>\n<0667> <7cfe>\n<0668> <7f54>\n<0669> <7f8c>\n<066a> <7f8b>\n<066b> <8005>\n<066c> <80ba>\n<066d> <80a5>\n<066e> <80a2>\n<066f> <80b1>\n<0670> <80a1>\n<0671> <80ab>\nendbfchar\n\n100 beginbfchar\n<0672> <80a9>\n<0673> <80b4>\n<0674> <80aa>\n<0675> <80af>\n<0676> <81e5>\n<0677> <81fe>\n<0678> <820d>\n<0679> <82b3>\n<067a> <829d>\n<067b> <8299>\n<067c> <82ad>\n<067d> <82bd>\n<067e> <829f>\n<067f> <82b9>\n<0680> <82b1>\n<0681> <82ac>\n<0682> <82a5>\n<0683> <82af>\n<0684> <82b8>\n<0685> <82a3>\n<0686> <82b0>\n<0687> <82be>\n<0688> <82b7>\n<0689> <864e>\n<068a> <8671>\n<068b> <521d>\n<068c> <8868>\n<068d> <8ecb>\n<068e> <8fce>\n<068f> <8fd4>\n<0690> <8fd1>\n<0691> <90b5>\n<0692> <90b8>\n<0693> <90b1>\n<0694> <90b6>\n<0695> <91c7>\n<0696> <91d1>\n<0697> <9577>\n<0698> <9580>\n<0699> <961c>\n<069a> <9640>\n<069b> <963f>\n<069c> <963b>\n<069d> <9644>\n<069e> <9642>\n<069f> <96b9>\n<06a0> <96e8>\n<06a1> <9752>\n<06a2> <975e>\n<06a3> <4e9f>\n<06a6> <4fe1>\n<06a7> <4fb5>\n<06a8> <4faf>\n<06a9> <4fbf>\n<06aa> <4fe0>\n<06ab> <4fd1>\n<06ac> <4fcf>\n<06ad> <4fdd>\n<06ae> <4fc3>\n<06af> <4fb6>\n<06b0> <4fd8>\n<06b1> <4fdf>\n<06b2> <4fca>\n<06b3> <4fd7>\n<06b4> <4fae>\n<06b5> <4fd0>\n<06b6> <4fc4>\n<06b7> <4fc2>\n<06b8> <4fda>\n<06b9> <4fce>\n<06ba> <4fde>\n<06bb> <4fb7>\n<06bc> <5157>\n<06bd> <5192>\n<06be> <5191>\n<06bf> <51a0>\n<06c0> <524e>\n<06c1> <5243>\n<06c2> <524a>\n<06c3> <524d>\n<06c4> <524c>\n<06c5> <524b>\n<06c6> <5247>\n<06c7> <52c7>\n<06c8> <52c9>\n<06c9> <52c3>\n<06ca> <52c1>\n<06cb> <530d>\n<06cc> <5357>\n<06cd> <537b>\n<06ce> <539a>\n<06cf> <53db>\n<06d0> <54ac>\n<06d1> <54c0>\n<06d2> <54a8>\n<06d3> <54ce>\n<06d4> <54c9>\n<06d5> <54b8>\n<06d6> <54a6>\n<06d7> <54b3>\nendbfchar\n\n100 beginbfchar\n<06d8> <54c7>\n<06d9> <54c2>\n<06da> <54bd>\n<06db> <54aa>\n<06dc> <54c1>\n<06dd> <54c4>\n<06de> <54c8>\n<06df> <54af>\n<06e0> <54ab>\n<06e1> <54b1>\n<06e2> <54bb>\n<06e3> <54a9>\n<06e4> <54a7>\n<06e5> <54bf>\n<06e6> <56ff>\n<06e7> <5782>\n<06e8> <578b>\n<06e9> <57a0>\n<06ea> <57a3>\n<06eb> <57a2>\n<06ec> <57ce>\n<06ed> <57ae>\n<06ee> <5793>\n<06ef> <5955>\n<06f0> <5951>\n<06f1> <594f>\n<06f2> <594e>\n<06f3> <5950>\n<06f4> <59dc>\n<06f5> <59d8>\n<06f6> <59ff>\n<06f7> <59e3>\n<06f8> <59e8>\n<06f9> <5a03>\n<06fa> <59e5>\n<06fb> <59ea>\n<06fc> <59da>\n<06fd> <59e6>\n<06fe> <5a01>\n<06ff> <59fb>\n<0700> <5b69>\n<0701> <5ba3>\n<0702> <5ba6>\n<0703> <5ba4>\n<0704> <5ba2>\n<0705> <5ba5>\n<0706> <5c01>\n<0709> <5c4d>\n<070a> <5c4b>\n<070b> <5cd9>\n<070c> <5cd2>\n<070d> <5df7>\n<070e> <5e1d>\n<070f> <5e25>\n<0710> <5e1f>\n<0711> <5e7d>\n<0712> <5ea0>\n<0713> <5ea6>\n<0714> <5efa>\n<0715> <5f08>\n<0716> <5f2d>\n<0717> <5f65>\n<0718> <5f88>\n<0719> <5f85>\n<071c> <5f87>\n<071d> <5f8c>\n<071e> <5f89>\n<071f> <6012>\n<0720> <601d>\n<0721> <6020>\n<0722> <6025>\n<0723> <600e>\n<0724> <6028>\n<0725> <604d>\n<0726> <6070>\n<0727> <6068>\n<0728> <6062>\n<0729> <6046>\n<072a> <6043>\n<072b> <606c>\n<072c> <606b>\n<072d> <606a>\n<072e> <6064>\n<072f> <6241>\n<0730> <62dc>\n<0731> <6316>\n<0732> <6309>\n<0733> <62fc>\n<0734> <62ed>\n<0735> <6301>\n<0736> <62ee>\n<0737> <62fd>\n<0738> <6307>\n<0739> <62f1>\n<073a> <62f7>\n<073b> <62ef>\n<073c> <62ec>\n<073d> <62fe>\n<073e> <62f4>\n<073f> <6311>\nendbfchar\n\n100 beginbfchar\n<0740> <6302>\n<0741> <653f>\n<0742> <6545>\n<0743> <65ab>\n<0744> <65bd>\n<0745> <65e2>\n<0746> <6625>\n<0747> <662d>\n<0748> <6620>\n<0749> <6627>\n<074a> <662f>\n<074b> <661f>\n<074c> <6628>\n<074d> <6631>\n<074e> <6624>\n<074f> <66f7>\n<0750> <67ff>\n<0751> <67d3>\n<0752> <67f1>\n<0753> <67d4>\n<0754> <67d0>\n<0755> <67ec>\n<0756> <67b6>\n<0757> <67af>\n<0758> <67f5>\n<0759> <67e9>\n<075a> <67ef>\n<075b> <67c4>\n<075c> <67d1>\n<075d> <67b4>\n<075e> <67da>\n<075f> <67e5>\n<0760> <67b8>\n<0761> <67cf>\n<0762> <67de>\n<0763> <67f3>\n<0764> <67b0>\n<0765> <67d9>\n<0766> <67e2>\n<0767> <67dd>\n<0768> <67d2>\n<0769> <6b6a>\n<076a> <6b83>\n<076b> <6b86>\n<076c> <6bb5>\n<076d> <6bd2>\n<076e> <6bd7>\n<076f> <6c1f>\n<0770> <6cc9>\n<0771> <6d0b>\n<0772> <6d32>\n<0773> <6d2a>\n<0774> <6d41>\n<0775> <6d25>\n<0776> <6d0c>\n<0777> <6d31>\n<0778> <6d1e>\n<0779> <6d17>\n<077a> <6d3b>\n<077d> <6d36>\n<077e> <6d1b>\n<077f> <6cf5>\n<0780> <6d39>\n<0781> <6d27>\n<0782> <6d38>\n<0783> <6d29>\n<0784> <6d2e>\n<0785> <6d35>\n<0786> <6d0e>\n<0787> <6d2b>\n<0788> <70ab>\n<0789> <70ba>\n<078a> <70b3>\n<078b> <70ac>\n<078c> <70af>\n<078d> <70ad>\n<078e> <70b8>\n<078f> <70ae>\n<0790> <70a4>\n<0791> <7230>\n<0792> <7272>\n<0793> <726f>\n<0794> <7274>\n<0795> <72e9>\n<0798> <73b7>\n<0799> <73ca>\n<079a> <73bb>\n<079b> <73b2>\n<079c> <73cd>\n<079d> <73c0>\n<079e> <73b3>\n<079f> <751a>\n<07a0> <752d>\n<07a1> <754f>\n<07a2> <754c>\n<07a3> <754e>\n<07a4> <754b>\n<07a5> <75ab>\n<07aa> <7678>\n<07ae> <76c8>\nendbfchar\n\n100 beginbfchar\n<07af> <76c6>\n<07b0> <76c3>\n<07b1> <76c5>\n<07b2> <7701>\n<07b3> <76f9>\n<07b4> <76f8>\n<07b5> <7709>\n<07b6> <770b>\n<07b7> <76fe>\n<07b8> <76fc>\n<07b9> <7707>\n<07ba> <77dc>\n<07bb> <7802>\n<07bc> <7814>\n<07bf> <7946>\n<07c0> <7949>\n<07c1> <7948>\n<07c2> <7947>\n<07c7> <79cb>\n<07c8> <7a7f>\n<07c9> <7a81>\n<07ca> <7aff>\n<07cb> <7afd>\n<07cc> <7c7d>\n<07cd> <7d02>\n<07ce> <7d05>\n<07cf> <7d00>\n<07d0> <7d09>\n<07d1> <7d07>\n<07d2> <7d04>\n<07d3> <7d06>\n<07d4> <7f38>\n<07d5> <7f8e>\n<07d6> <7fbf>\n<07d7> <8010>\n<07d8> <800d>\n<07d9> <8011>\n<07da> <8036>\n<07db> <80d6>\n<07dc> <80e5>\n<07dd> <80da>\n<07e0> <80cc>\n<07e1> <80e1>\n<07e2> <80db>\n<07e3> <80ce>\n<07e4> <80de>\n<07e5> <80e4>\n<07e6> <80dd>\n<07e7> <81f4>\n<07e8> <8222>\n<07e9> <82e7>\n<07ea> <8303>\n<07eb> <8305>\n<07ec> <82e3>\n<07ed> <82db>\n<07ee> <82e6>\n<07ef> <8304>\n<07f0> <82e5>\n<07f1> <8302>\n<07f2> <8309>\n<07f3> <82d2>\n<07f4> <82d7>\n<07f5> <82f1>\n<07f6> <8301>\n<07f7> <82dc>\n<07f8> <82d4>\n<07f9> <82d1>\n<07fa> <82de>\n<07fb> <82d3>\n<07fc> <82df>\n<07fd> <82ef>\n<07fe> <8306>\n<07ff> <8650>\n<0800> <8679>\n<0801> <867b>\n<0802> <867a>\n<0803> <884d>\n<0804> <886b>\n<0805> <8981>\n<0806> <89d4>\n<0807> <8a08>\n<080a> <8c9e>\n<080b> <8ca0>\n<080c> <8d74>\n<080d> <8d73>\n<080e> <8db4>\n<080f> <8ecd>\n<0810> <8ecc>\n<0811> <8ff0>\n<0812> <8fe6>\n<0813> <8fe2>\n<0814> <8fea>\n<0815> <8fe5>\n<0816> <8fed>\n<0817> <8feb>\n<0818> <8fe4>\n<0819> <8fe8>\n<081a> <90ca>\n<081b> <90ce>\n<081c> <90c1>\nendbfchar\n\n100 beginbfchar\n<081d> <90c3>\n<081e> <914b>\n<081f> <914a>\n<0820> <91cd>\n<0821> <9582>\n<0822> <9650>\n<0826> <9762>\n<0827> <9769>\n<0828> <97cb>\n<0829> <97ed>\n<082a> <97f3>\n<082b> <9801>\n<082c> <98a8>\n<082d> <98db>\n<082e> <98df>\n<082f> <9996>\n<0830> <9999>\n<0831> <4e58>\n<0832> <4eb3>\n<0835> <5023>\n<0836> <4fef>\n<0837> <5026>\n<0838> <5025>\n<0839> <4ff8>\n<083a> <5029>\n<083b> <5016>\n<083c> <5006>\n<083d> <503c>\n<083e> <501f>\n<083f> <501a>\n<0840> <5012>\n<0841> <5011>\n<0842> <4ffa>\n<0843> <5000>\n<0844> <5014>\n<0845> <5028>\n<0846> <4ff1>\n<0847> <5021>\n<0848> <500b>\n<0849> <5019>\n<084a> <5018>\n<084b> <4ff3>\n<084c> <4fee>\n<084d> <502d>\n<084e> <502a>\n<084f> <4ffe>\n<0850> <502b>\n<0851> <5009>\n<0852> <517c>\n<0855> <51a2>\n<0856> <51cd>\n<0857> <51cc>\n<0858> <51c6>\n<0859> <51cb>\n<085a> <5256>\n<085b> <525c>\n<085c> <5254>\n<085d> <525b>\n<085e> <525d>\n<085f> <532a>\n<0860> <537f>\n<0861> <539f>\n<0862> <539d>\n<0863> <53df>\n<0864> <54e8>\n<0865> <5510>\n<0866> <5501>\n<0867> <5537>\n<0868> <54fc>\n<0869> <54e5>\n<086a> <54f2>\n<086b> <5506>\n<086c> <54fa>\n<086d> <5514>\n<086e> <54e9>\n<086f> <54ed>\n<0870> <54e1>\n<0871> <5509>\n<0872> <54ee>\n<0873> <54ea>\n<0874> <54e6>\n<0875> <5527>\n<0876> <5507>\n<0877> <54fd>\n<0878> <550f>\n<087b> <57c2>\n<087c> <57d4>\n<087d> <57cb>\n<087e> <57c3>\n<087f> <5809>\n<0880> <590f>\n<0883> <595a>\n<0884> <5a11>\n<0885> <5a18>\n<0886> <5a1c>\n<0887> <5a1f>\n<0888> <5a1b>\n<0889> <5a13>\n<088a> <59ec>\n<088b> <5a20>\nendbfchar\n\n100 beginbfchar\n<088c> <5a23>\n<088d> <5a29>\n<088e> <5a25>\n<088f> <5a0c>\n<0890> <5a09>\n<0891> <5b6b>\n<0892> <5c58>\n<0893> <5bb0>\n<0894> <5bb3>\n<0895> <5bb6>\n<0896> <5bb4>\n<0897> <5bae>\n<0898> <5bb5>\n<0899> <5bb9>\n<089a> <5bb8>\n<089b> <5c04>\n<089c> <5c51>\n<089d> <5c55>\n<089e> <5c50>\n<089f> <5ced>\n<08a0> <5cfd>\n<08a1> <5cfb>\n<08a2> <5cea>\n<08a3> <5ce8>\n<08a4> <5cf0>\n<08a5> <5cf6>\n<08a6> <5d01>\n<08a7> <5cf4>\n<08a8> <5dee>\n<08a9> <5e2d>\n<08aa> <5e2b>\n<08ab> <5eab>\n<08ac> <5ead>\n<08ad> <5ea7>\n<08ae> <5f31>\n<08af> <5f92>\n<08b0> <5f91>\n<08b1> <5f90>\n<08b2> <6059>\n<08b3> <6063>\n<08b4> <6065>\n<08b5> <6050>\n<08b6> <6055>\n<08b7> <606d>\n<08b8> <6069>\n<08b9> <606f>\n<08ba> <6084>\n<08bb> <609f>\n<08bc> <609a>\n<08bd> <608d>\n<08be> <6094>\n<08bf> <608c>\n<08c0> <6085>\n<08c1> <6096>\n<08c2> <6247>\n<08c3> <62f3>\n<08c4> <6308>\n<08c5> <62ff>\n<08c6> <634e>\n<08c7> <633e>\n<08c8> <632f>\n<08c9> <6355>\n<08ca> <6342>\n<08cb> <6346>\n<08cc> <634f>\n<08cd> <6349>\n<08ce> <633a>\n<08cf> <6350>\n<08d0> <633d>\n<08d3> <6328>\n<08d4> <634d>\n<08d5> <634c>\n<08d8> <6599>\n<08d9> <65c1>\n<08da> <65c5>\n<08db> <6642>\n<08dc> <6649>\n<08dd> <664f>\n<08de> <6643>\n<08df> <6652>\n<08e0> <664c>\n<08e1> <6645>\n<08e2> <6641>\n<08e3> <66f8>\n<08e6> <6717>\n<08e7> <6821>\n<08e8> <6838>\n<08e9> <6848>\n<08ea> <6846>\n<08eb> <6853>\n<08ec> <6839>\n<08ed> <6842>\n<08ee> <6854>\n<08ef> <6829>\n<08f0> <68b3>\n<08f1> <6817>\n<08f2> <684c>\n<08f3> <6851>\n<08f4> <683d>\n<08f5> <67f4>\nendbfchar\n\n100 beginbfchar\n<08f6> <6850>\n<08f7> <6840>\n<08f8> <683c>\n<08f9> <6843>\n<08fa> <682a>\n<08fb> <6845>\n<08fc> <6813>\n<08fd> <6818>\n<08fe> <6841>\n<08ff> <6b8a>\n<0900> <6b89>\n<0901> <6bb7>\n<0902> <6c23>\n<0905> <6c26>\n<0906> <6c24>\n<0907> <6cf0>\n<0908> <6d6a>\n<0909> <6d95>\n<090a> <6d88>\n<090b> <6d87>\n<090c> <6d66>\n<090d> <6d78>\n<090e> <6d77>\n<090f> <6d59>\n<0910> <6d93>\n<0911> <6d6c>\n<0912> <6d89>\n<0913> <6d6e>\n<0914> <6d5a>\n<0915> <6d74>\n<0916> <6d69>\n<0917> <6d8c>\n<0918> <6d8a>\n<0919> <6d79>\n<091a> <6d85>\n<091b> <6d65>\n<091c> <6d94>\n<091d> <70ca>\n<091e> <70d8>\n<091f> <70e4>\n<0920> <70d9>\n<0921> <70c8>\n<0922> <70cf>\n<0923> <7239>\n<0924> <7279>\n<0925> <72fc>\n<0926> <72f9>\n<0927> <72fd>\n<0928> <72f8>\n<0929> <72f7>\n<092a> <7386>\n<092b> <73ed>\n<092c> <7409>\n<092d> <73ee>\n<092e> <73e0>\n<092f> <73ea>\n<0930> <73de>\n<0931> <7554>\n<0932> <755d>\n<0933> <755c>\n<0934> <755a>\n<0935> <7559>\n<0936> <75be>\n<0937> <75c5>\n<0938> <75c7>\n<093b> <75bd>\n<093c> <75bc>\n<093d> <75b9>\n<093e> <75c2>\n<093f> <75b8>\n<0940> <768b>\n<0941> <76b0>\n<0942> <76ca>\n<0945> <7729>\n<0948> <7728>\n<0949> <77e9>\n<094a> <7830>\n<094b> <7827>\n<094c> <7838>\n<094d> <781d>\n<094e> <7834>\n<094f> <7837>\n<0950> <7825>\n<0951> <782d>\n<0952> <7820>\n<0953> <781f>\n<0954> <7832>\n<0955> <7955>\n<0956> <7950>\n<0957> <7960>\n<0958> <795f>\n<0959> <7956>\n<095a> <795e>\n<095b> <795d>\n<095c> <7957>\n<095d> <795a>\n<095e> <79e4>\n<095f> <79e3>\n<0960> <79e7>\n<0961> <79df>\nendbfchar\n\n100 beginbfchar\n<0962> <79e6>\n<0963> <79e9>\n<0964> <79d8>\n<0965> <7a84>\n<0966> <7a88>\n<0967> <7ad9>\n<0968> <7b06>\n<0969> <7b11>\n<096a> <7c89>\n<096b> <7d21>\n<096c> <7d17>\n<096d> <7d0b>\n<096e> <7d0a>\n<096f> <7d20>\n<0970> <7d22>\n<0971> <7d14>\n<0972> <7d10>\n<0973> <7d15>\n<0974> <7d1a>\n<0975> <7d1c>\n<0976> <7d0d>\n<0977> <7d19>\n<0978> <7d1b>\n<0979> <7f3a>\n<097a> <7f5f>\n<097b> <7f94>\n<097c> <7fc5>\n<097d> <7fc1>\n<097e> <8006>\n<097f> <8004>\n<0980> <8018>\n<0981> <8015>\n<0982> <8019>\n<0983> <8017>\n<0984> <803d>\n<0985> <803f>\n<0986> <80f1>\n<0987> <8102>\n<0988> <80f0>\n<0989> <8105>\n<098a> <80ed>\n<098b> <80f4>\n<098c> <8106>\n<098d> <80f8>\n<098e> <80f3>\n<098f> <8108>\n<0990> <80fd>\n<0991> <810a>\n<0992> <80fc>\n<0993> <80ef>\n<0994> <81ed>\n<0995> <81ec>\n<0996> <8200>\n<0997> <8210>\n<099a> <8228>\n<099b> <822c>\n<099c> <82bb>\n<099d> <832b>\n<099e> <8352>\n<099f> <8354>\n<09a0> <834a>\n<09a1> <8338>\n<09a2> <8350>\n<09a3> <8349>\n<09a4> <8335>\n<09a5> <8334>\n<09a6> <834f>\n<09a7> <8332>\n<09a8> <8339>\n<09a9> <8336>\n<09aa> <8317>\n<09ab> <8340>\n<09ac> <8331>\n<09ad> <8328>\n<09ae> <8343>\n<09af> <8654>\n<09b0> <868a>\n<09b1> <86aa>\n<09b2> <8693>\n<09b3> <86a4>\n<09b4> <86a9>\n<09b5> <868c>\n<09b6> <86a3>\n<09b7> <869c>\n<09b8> <8870>\n<09b9> <8877>\n<09bc> <887d>\n<09bd> <8879>\n<09be> <8a18>\n<09bf> <8a10>\n<09c0> <8a0e>\n<09c1> <8a0c>\n<09c2> <8a15>\n<09c3> <8a0a>\n<09c4> <8a17>\n<09c5> <8a13>\n<09c6> <8a16>\n<09c7> <8a0f>\n<09c8> <8a11>\n<09c9> <8c48>\nendbfchar\n\n100 beginbfchar\n<09ca> <8c7a>\n<09cb> <8c79>\n<09ce> <8d77>\n<09cf> <8eac>\n<09d0> <8ed2>\n<09d1> <8ed4>\n<09d2> <8ecf>\n<09d3> <8fb1>\n<09d4> <9001>\n<09d5> <9006>\n<09d6> <8ff7>\n<09d7> <9000>\n<09d8> <8ffa>\n<09d9> <8ff4>\n<09da> <9003>\n<09db> <8ffd>\n<09dc> <9005>\n<09dd> <8ff8>\n<09de> <9095>\n<09df> <90e1>\n<09e0> <90dd>\n<09e1> <90e2>\n<09e2> <9152>\n<09e3> <914d>\n<09e4> <914c>\n<09e5> <91d8>\n<09e6> <91dd>\n<09e7> <91d7>\n<09e8> <91dc>\n<09e9> <91d9>\n<09ea> <9583>\n<09ed> <9661>\n<09ee> <965b>\n<09ef> <965d>\n<09f0> <9664>\n<09f1> <9658>\n<09f2> <965e>\n<09f3> <96bb>\n<09f4> <98e2>\n<09f5> <99ac>\n<09f6> <9aa8>\n<09f7> <9ad8>\n<09f8> <9b25>\n<09f9> <9b32>\n<09fa> <9b3c>\n<09fb> <4e7e>\n<09fc> <507a>\n<09fd> <507d>\n<09fe> <505c>\n<09ff> <5047>\n<0a00> <5043>\n<0a01> <504c>\n<0a02> <505a>\n<0a03> <5049>\n<0a04> <5065>\n<0a05> <5076>\n<0a06> <504e>\n<0a07> <5055>\n<0a08> <5075>\n<0a09> <5074>\n<0a0a> <5077>\n<0a0b> <504f>\n<0a0c> <500f>\n<0a0d> <506f>\n<0a0e> <506d>\n<0a0f> <515c>\n<0a10> <5195>\n<0a11> <51f0>\n<0a12> <526a>\n<0a13> <526f>\n<0a14> <52d2>\n<0a15> <52d9>\n<0a16> <52d8>\n<0a17> <52d5>\n<0a18> <5310>\n<0a19> <530f>\n<0a1a> <5319>\n<0a1d> <533e>\n<0a1e> <53c3>\n<0a1f> <66fc>\n<0a20> <5546>\n<0a21> <556a>\n<0a22> <5566>\n<0a23> <5544>\n<0a24> <555e>\n<0a25> <5561>\n<0a26> <5543>\n<0a27> <554a>\n<0a28> <5531>\n<0a29> <5556>\n<0a2a> <554f>\n<0a2b> <5555>\n<0a2c> <552f>\n<0a2d> <5564>\n<0a2e> <5538>\n<0a2f> <552e>\n<0a30> <555c>\n<0a31> <552c>\n<0a32> <5563>\n<0a33> <5533>\nendbfchar\n\n100 beginbfchar\n<0a34> <5541>\n<0a35> <5557>\n<0a36> <5708>\n<0a37> <570b>\n<0a38> <5709>\n<0a39> <57df>\n<0a3a> <5805>\n<0a3b> <580a>\n<0a3c> <5806>\n<0a3d> <57e0>\n<0a3e> <57e4>\n<0a3f> <57fa>\n<0a40> <5802>\n<0a41> <5835>\n<0a42> <57f7>\n<0a43> <57f9>\n<0a44> <5920>\n<0a45> <5962>\n<0a46> <5a36>\n<0a47> <5a41>\n<0a48> <5a49>\n<0a49> <5a66>\n<0a4a> <5a6a>\n<0a4b> <5a40>\n<0a4c> <5a3c>\n<0a4d> <5a62>\n<0a4e> <5a5a>\n<0a4f> <5a46>\n<0a50> <5a4a>\n<0a51> <5b70>\n<0a52> <5bc7>\n<0a53> <5bc5>\n<0a54> <5bc4>\n<0a55> <5bc2>\n<0a56> <5bbf>\n<0a57> <5bc6>\n<0a58> <5c09>\n<0a59> <5c08>\n<0a5a> <5c07>\n<0a5b> <5c60>\n<0a5e> <5d07>\n<0a5f> <5d06>\n<0a60> <5d0e>\n<0a61> <5d1b>\n<0a62> <5d16>\n<0a63> <5d22>\n<0a64> <5d11>\n<0a65> <5d29>\n<0a66> <5d14>\n<0a67> <5d19>\n<0a68> <5d24>\n<0a69> <5d27>\n<0a6a> <5d17>\n<0a6b> <5de2>\n<0a6c> <5e38>\n<0a6d> <5e36>\n<0a6e> <5e33>\n<0a6f> <5e37>\n<0a72> <5eb6>\n<0a73> <5eb5>\n<0a74> <5ebe>\n<0a75> <5f35>\n<0a76> <5f37>\n<0a77> <5f57>\n<0a78> <5f6c>\n<0a79> <5f69>\n<0a7a> <5f6b>\n<0a7b> <5f97>\n<0a7c> <5f99>\n<0a7d> <5f9e>\n<0a7e> <5f98>\n<0a7f> <5fa1>\n<0a80> <5fa0>\n<0a81> <5f9c>\n<0a82> <607f>\n<0a83> <60a3>\n<0a84> <6089>\n<0a85> <60a0>\n<0a86> <60a8>\n<0a87> <60cb>\n<0a88> <60b4>\n<0a89> <60e6>\n<0a8a> <60bd>\n<0a8b> <60c5>\n<0a8c> <60bb>\n<0a8d> <60b5>\n<0a8e> <60dc>\n<0a8f> <60bc>\n<0a90> <60d8>\n<0a91> <60d5>\n<0a92> <60c6>\n<0a93> <60df>\n<0a94> <60b8>\n<0a95> <60da>\n<0a96> <60c7>\n<0a99> <6248>\n<0a9a> <63a0>\n<0a9b> <63a7>\n<0a9c> <6372>\n<0a9d> <6396>\nendbfchar\n\n100 beginbfchar\n<0a9e> <63a2>\n<0a9f> <63a5>\n<0aa0> <6377>\n<0aa1> <6367>\n<0aa2> <6398>\n<0aa3> <63aa>\n<0aa4> <6371>\n<0aa5> <63a9>\n<0aa6> <6389>\n<0aa7> <6383>\n<0aa8> <639b>\n<0aa9> <636b>\n<0aaa> <63a8>\n<0aab> <6384>\n<0aac> <6388>\n<0aad> <6399>\n<0aae> <63a1>\n<0aaf> <63ac>\n<0ab0> <6392>\n<0ab1> <638f>\n<0ab2> <6380>\n<0ab3> <637b>\n<0ab4> <6369>\n<0ab5> <6368>\n<0ab6> <637a>\n<0ab7> <655d>\n<0ab8> <6556>\n<0ab9> <6551>\n<0aba> <6559>\n<0abb> <6557>\n<0abc> <555f>\n<0abd> <654f>\n<0abe> <6558>\n<0abf> <6555>\n<0ac0> <6554>\n<0ac1> <659c>\n<0ac2> <659b>\n<0ac3> <65ac>\n<0ac4> <65cf>\n<0ac7> <65ce>\n<0ac8> <665d>\n<0ac9> <665a>\n<0aca> <6664>\n<0acb> <6668>\n<0acc> <6666>\n<0acd> <665e>\n<0ace> <66f9>\n<0acf> <52d7>\n<0ad0> <671b>\n<0ad1> <6881>\n<0ad2> <68af>\n<0ad3> <68a2>\n<0ad4> <6893>\n<0ad5> <68b5>\n<0ad6> <687f>\n<0ad7> <6876>\n<0ad8> <68b1>\n<0ad9> <68a7>\n<0ada> <6897>\n<0adb> <68b0>\n<0adc> <6883>\n<0add> <68c4>\n<0ade> <68ad>\n<0adf> <6886>\n<0ae0> <6885>\n<0ae1> <6894>\n<0ae2> <689d>\n<0ae3> <68a8>\n<0ae4> <689f>\n<0ae5> <68a1>\n<0ae6> <6882>\n<0ae7> <6b32>\n<0ae8> <6bba>\n<0aeb> <6c2b>\n<0aec> <6d8e>\n<0aed> <6dbc>\n<0aee> <6df3>\n<0aef> <6dd9>\n<0af0> <6db2>\n<0af1> <6de1>\n<0af2> <6dcc>\n<0af3> <6de4>\n<0af4> <6dfb>\n<0af5> <6dfa>\n<0af6> <6e05>\n<0af7> <6dc7>\n<0af8> <6dcb>\n<0af9> <6daf>\n<0afa> <6dd1>\n<0afb> <6dae>\n<0afc> <6dde>\n<0afd> <6df9>\n<0afe> <6db8>\n<0aff> <6df7>\n<0b00> <6df5>\n<0b01> <6dc5>\n<0b02> <6dd2>\n<0b03> <6e1a>\n<0b04> <6db5>\n<0b05> <6dda>\nendbfchar\n\n100 beginbfchar\n<0b06> <6deb>\n<0b07> <6dd8>\n<0b08> <6dea>\n<0b09> <6df1>\n<0b0a> <6dee>\n<0b0b> <6de8>\n<0b0c> <6dc6>\n<0b0d> <6dc4>\n<0b0e> <6daa>\n<0b0f> <6dec>\n<0b10> <6dbf>\n<0b11> <6de6>\n<0b12> <70f9>\n<0b15> <70fd>\n<0b16> <70ef>\n<0b17> <723d>\n<0b18> <727d>\n<0b19> <7281>\n<0b1a> <731c>\n<0b1b> <731b>\n<0b1c> <7316>\n<0b1d> <7313>\n<0b1e> <7319>\n<0b1f> <7387>\n<0b20> <7405>\n<0b21> <740a>\n<0b22> <7403>\n<0b23> <7406>\n<0b24> <73fe>\n<0b25> <740d>\n<0b26> <74e0>\n<0b29> <751c>\n<0b2a> <7522>\n<0b2d> <7562>\n<0b2e> <7570>\n<0b2f> <758f>\n<0b32> <75b5>\n<0b33> <75ca>\n<0b34> <75cd>\n<0b35> <768e>\n<0b36> <76d4>\n<0b37> <76d2>\n<0b38> <76db>\n<0b39> <7737>\n<0b3a> <773e>\n<0b3b> <773c>\n<0b3c> <7736>\n<0b3d> <7738>\n<0b3e> <773a>\n<0b3f> <786b>\n<0b40> <7843>\n<0b41> <784e>\n<0b42> <7965>\n<0b43> <7968>\n<0b44> <796d>\n<0b45> <79fb>\n<0b46> <7a92>\n<0b47> <7a95>\n<0b48> <7b20>\n<0b49> <7b28>\n<0b4a> <7b1b>\n<0b4b> <7b2c>\n<0b4c> <7b26>\n<0b4d> <7b19>\n<0b4e> <7b1e>\n<0b4f> <7b2e>\n<0b50> <7c92>\n<0b51> <7c97>\n<0b52> <7c95>\n<0b53> <7d46>\n<0b54> <7d43>\n<0b55> <7d71>\n<0b56> <7d2e>\n<0b57> <7d39>\n<0b58> <7d3c>\n<0b59> <7d40>\n<0b5a> <7d30>\n<0b5b> <7d33>\n<0b5c> <7d44>\n<0b5d> <7d2f>\n<0b5e> <7d42>\n<0b5f> <7d32>\n<0b60> <7d31>\n<0b61> <7f3d>\n<0b62> <7f9e>\n<0b63> <7f9a>\n<0b64> <7fcc>\n<0b65> <7fce>\n<0b66> <7fd2>\n<0b67> <801c>\n<0b68> <804a>\n<0b69> <8046>\n<0b6a> <812f>\n<0b6b> <8116>\n<0b6c> <8123>\n<0b6d> <812b>\n<0b6e> <8129>\n<0b6f> <8130>\n<0b70> <8124>\n<0b71> <8202>\nendbfchar\n\n100 beginbfchar\n<0b72> <8235>\n<0b73> <8237>\n<0b74> <8236>\n<0b75> <8239>\n<0b76> <838e>\n<0b77> <839e>\n<0b78> <8398>\n<0b79> <8378>\n<0b7a> <83a2>\n<0b7b> <8396>\n<0b7c> <83bd>\n<0b7d> <83ab>\n<0b7e> <8392>\n<0b7f> <838a>\n<0b80> <8393>\n<0b81> <8389>\n<0b82> <83a0>\n<0b83> <8377>\n<0b86> <8386>\n<0b87> <83a7>\n<0b88> <8655>\n<0b89> <5f6a>\n<0b8a> <86c7>\n<0b8b> <86c0>\n<0b8c> <86b6>\n<0b8d> <86c4>\n<0b8e> <86b5>\n<0b8f> <86c6>\n<0b90> <86cb>\n<0b91> <86b1>\n<0b92> <86af>\n<0b93> <86c9>\n<0b94> <8853>\n<0b95> <889e>\n<0b96> <8888>\n<0b97> <88ab>\n<0b98> <8892>\n<0b99> <8896>\n<0b9a> <888d>\n<0b9b> <888b>\n<0b9c> <8993>\n<0b9d> <898f>\n<0b9e> <8a2a>\n<0b9f> <8a1d>\n<0ba0> <8a23>\n<0ba1> <8a25>\n<0ba2> <8a31>\n<0ba3> <8a2d>\n<0ba4> <8a1f>\n<0ba5> <8a1b>\n<0ba6> <8a22>\n<0ba7> <8c49>\n<0ba8> <8c5a>\n<0ba9> <8ca9>\n<0baa> <8cac>\n<0bab> <8cab>\n<0bac> <8ca8>\n<0bad> <8caa>\n<0bae> <8ca7>\n<0baf> <8d67>\n<0bb0> <8d66>\n<0bb1> <8dbe>\n<0bb2> <8dba>\n<0bb3> <8edb>\n<0bb4> <8edf>\n<0bb5> <9019>\n<0bb6> <900d>\n<0bb7> <901a>\n<0bb8> <9017>\n<0bb9> <9023>\n<0bba> <901f>\n<0bbb> <901d>\n<0bbc> <9010>\n<0bbd> <9015>\n<0bbe> <901e>\n<0bbf> <9020>\n<0bc0> <900f>\n<0bc1> <9022>\n<0bc2> <9016>\n<0bc3> <901b>\n<0bc4> <9014>\n<0bc5> <90e8>\n<0bc6> <90ed>\n<0bc7> <90fd>\n<0bc8> <9157>\n<0bc9> <91ce>\n<0bca> <91f5>\n<0bcb> <91e6>\n<0bcc> <91e3>\n<0bcd> <91e7>\n<0bce> <91ed>\n<0bcf> <91e9>\n<0bd0> <9589>\n<0bd1> <966a>\n<0bd2> <9675>\n<0bd3> <9673>\n<0bd4> <9678>\n<0bd5> <9670>\n<0bd6> <9674>\n<0bd9> <966c>\nendbfchar\n\n100 beginbfchar\n<0bda> <96c0>\n<0bdb> <96ea>\n<0bdc> <96e9>\n<0bdd> <7ae0>\n<0bde> <7adf>\n<0be1> <9b5a>\n<0be2> <9ce5>\n<0be3> <9e75>\n<0be4> <9e7f>\n<0be5> <9ea5>\n<0be6> <9ebb>\n<0be7> <50a2>\n<0be8> <508d>\n<0be9> <5085>\n<0bea> <5099>\n<0beb> <5091>\n<0bec> <5080>\n<0bed> <5096>\n<0bee> <5098>\n<0bef> <509a>\n<0bf0> <6700>\n<0bf1> <51f1>\n<0bf2> <5272>\n<0bf5> <5269>\n<0bf6> <52de>\n<0bf7> <52dd>\n<0bf8> <52db>\n<0bf9> <535a>\n<0bfa> <53a5>\n<0bfb> <557b>\n<0bfc> <5580>\n<0bfd> <55a7>\n<0bfe> <557c>\n<0bff> <558a>\n<0c00> <559d>\n<0c01> <5598>\n<0c02> <5582>\n<0c03> <559c>\n<0c04> <55aa>\n<0c05> <5594>\n<0c06> <5587>\n<0c07> <558b>\n<0c08> <5583>\n<0c09> <55b3>\n<0c0a> <55ae>\n<0c0b> <559f>\n<0c0c> <553e>\n<0c0d> <55b2>\n<0c0e> <559a>\n<0c0f> <55bb>\n<0c10> <55ac>\n<0c11> <55b1>\n<0c12> <557e>\n<0c13> <5589>\n<0c14> <55ab>\n<0c15> <5599>\n<0c16> <570d>\n<0c17> <582f>\n<0c18> <582a>\n<0c19> <5834>\n<0c1a> <5824>\n<0c1d> <5821>\n<0c1e> <581d>\n<0c1f> <5820>\n<0c22> <5960>\n<0c23> <5a77>\n<0c24> <5a9a>\n<0c25> <5a7f>\n<0c26> <5a92>\n<0c27> <5a9b>\n<0c28> <5aa7>\n<0c29> <5b73>\n<0c2a> <5b71>\n<0c2b> <5bd2>\n<0c2c> <5bcc>\n<0c2d> <5bd3>\n<0c2e> <5bd0>\n<0c31> <5c31>\n<0c32> <5d4c>\n<0c33> <5d50>\n<0c34> <5d34>\n<0c35> <5d47>\n<0c36> <5dfd>\n<0c37> <5e45>\n<0c38> <5e3d>\n<0c39> <5e40>\n<0c3a> <5e43>\n<0c3b> <5e7e>\n<0c3c> <5eca>\n<0c3f> <5ec4>\n<0c40> <5f3c>\n<0c41> <5f6d>\n<0c44> <5fa8>\n<0c45> <60d1>\n<0c46> <60e1>\n<0c47> <60b2>\n<0c48> <60b6>\n<0c49> <60e0>\n<0c4a> <611c>\n<0c4b> <6123>\nendbfchar\n\n100 beginbfchar\n<0c4c> <60fa>\n<0c4d> <6115>\n<0c4e> <60f0>\n<0c4f> <60fb>\n<0c50> <60f4>\n<0c51> <6168>\n<0c52> <60f1>\n<0c53> <610e>\n<0c54> <60f6>\n<0c55> <6109>\n<0c56> <6100>\n<0c57> <6112>\n<0c58> <621f>\n<0c59> <6249>\n<0c5a> <63a3>\n<0c5b> <638c>\n<0c5c> <63cf>\n<0c5d> <63c0>\n<0c5e> <63e9>\n<0c5f> <63c9>\n<0c60> <63c6>\n<0c61> <63cd>\n<0c62> <63d2>\n<0c63> <63e3>\n<0c64> <63d0>\n<0c65> <63e1>\n<0c66> <63d6>\n<0c69> <6376>\n<0c6a> <63f4>\n<0c6b> <63ea>\n<0c6c> <63db>\n<0c6d> <6452>\n<0c6e> <63da>\n<0c6f> <63f9>\n<0c70> <655e>\n<0c71> <6566>\n<0c74> <6591>\n<0c75> <6590>\n<0c76> <65af>\n<0c77> <666e>\n<0c78> <6670>\n<0c79> <6674>\n<0c7a> <6676>\n<0c7b> <666f>\n<0c7c> <6691>\n<0c7d> <667a>\n<0c7e> <667e>\n<0c7f> <6677>\n<0c82> <671f>\n<0c83> <671d>\n<0c84> <68fa>\n<0c85> <68d5>\n<0c86> <68e0>\n<0c87> <68d8>\n<0c88> <68d7>\n<0c89> <6905>\n<0c8a> <68df>\n<0c8b> <68f5>\n<0c8c> <68ee>\n<0c8d> <68e7>\n<0c8e> <68f9>\n<0c8f> <68d2>\n<0c90> <68f2>\n<0c91> <68e3>\n<0c92> <68cb>\n<0c93> <68cd>\n<0c94> <690d>\n<0c95> <6912>\n<0c96> <690e>\n<0c97> <68c9>\n<0c98> <68da>\n<0c99> <696e>\n<0c9a> <68fb>\n<0c9b> <6b3e>\n<0c9c> <6b3a>\n<0c9d> <6b3d>\n<0c9e> <6b98>\n<0c9f> <6b96>\n<0ca0> <6bbc>\n<0ca1> <6bef>\n<0ca4> <6c2c>\n<0ca5> <6e2f>\n<0ca6> <6e38>\n<0ca7> <6e54>\n<0ca8> <6e21>\n<0ca9> <6e32>\n<0caa> <6e67>\n<0cab> <6e4a>\n<0cac> <6e20>\n<0cad> <6e25>\n<0cae> <6e23>\n<0caf> <6e1b>\n<0cb0> <6e5b>\n<0cb1> <6e58>\n<0cb2> <6e24>\n<0cb3> <6e56>\n<0cb4> <6e6e>\n<0cb5> <6e2d>\n<0cb6> <6e26>\n<0cb7> <6e6f>\nendbfchar\n\n100 beginbfchar\n<0cb8> <6e34>\n<0cb9> <6e4d>\n<0cba> <6e3a>\n<0cbb> <6e2c>\n<0cbc> <6e43>\n<0cbd> <6e1d>\n<0cbe> <6e3e>\n<0cbf> <6ecb>\n<0cc0> <6e89>\n<0cc1> <6e19>\n<0cc2> <6e4e>\n<0cc3> <6e63>\n<0cc4> <6e44>\n<0cc5> <6e72>\n<0cc6> <6e69>\n<0cc7> <6e5f>\n<0cca> <7126>\n<0ccb> <7130>\n<0ccc> <7121>\n<0ccd> <7136>\n<0cce> <716e>\n<0ccf> <711c>\n<0cd0> <724c>\n<0cd1> <7284>\n<0cd2> <7280>\n<0cd3> <7336>\n<0cd4> <7325>\n<0cd5> <7334>\n<0cd6> <7329>\n<0cd7> <743a>\n<0cd8> <742a>\n<0cd9> <7433>\n<0cda> <7422>\n<0cdb> <7425>\n<0cde> <7434>\n<0cdf> <742f>\n<0ce0> <741b>\n<0ce1> <7426>\n<0ce2> <7428>\n<0ce5> <756b>\n<0ce6> <756a>\n<0ce7> <75e2>\n<0ce8> <75db>\n<0ce9> <75e3>\n<0cea> <75d9>\n<0ceb> <75d8>\n<0cec> <75de>\n<0ced> <75e0>\n<0cf0> <7696>\n<0cf1> <7693>\n<0cf2> <76b4>\n<0cf3> <76dc>\n<0cf4> <774f>\n<0cf5> <77ed>\n<0cf6> <785d>\n<0cf7> <786c>\n<0cf8> <786f>\n<0cf9> <7a0d>\n<0cfa> <7a08>\n<0cfb> <7a0b>\n<0cfc> <7a05>\n<0cfd> <7a00>\n<0cfe> <7a98>\n<0cff> <7a97>\n<0d00> <7a96>\n<0d01> <7ae5>\n<0d02> <7ae3>\n<0d03> <7b49>\n<0d04> <7b56>\n<0d05> <7b46>\n<0d06> <7b50>\n<0d07> <7b52>\n<0d08> <7b54>\n<0d09> <7b4d>\n<0d0a> <7b4b>\n<0d0b> <7b4f>\n<0d0c> <7b51>\n<0d0d> <7c9f>\n<0d0e> <7ca5>\n<0d0f> <7d5e>\n<0d10> <7d50>\n<0d11> <7d68>\n<0d12> <7d55>\n<0d13> <7d2b>\n<0d14> <7d6e>\n<0d15> <7d72>\n<0d16> <7d61>\n<0d17> <7d66>\n<0d18> <7d62>\n<0d19> <7d70>\n<0d1a> <7d73>\n<0d1b> <5584>\n<0d1e> <800b>\n<0d1f> <8052>\n<0d20> <8085>\n<0d21> <8155>\n<0d22> <8154>\n<0d23> <814b>\n<0d24> <8151>\n<0d25> <814e>\nendbfchar\n\n100 beginbfchar\n<0d26> <8139>\n<0d27> <8146>\n<0d28> <813e>\n<0d29> <814c>\n<0d2a> <8153>\n<0d2b> <8174>\n<0d2c> <8212>\n<0d2d> <821c>\n<0d2e> <83e9>\n<0d2f> <8403>\n<0d30> <83f8>\n<0d31> <840d>\n<0d32> <83e0>\n<0d33> <83c5>\n<0d34> <840b>\n<0d35> <83c1>\n<0d36> <83ef>\n<0d37> <83f1>\n<0d38> <83f4>\n<0d39> <8457>\n<0d3a> <840a>\n<0d3b> <83f0>\n<0d3c> <840c>\n<0d3d> <83cc>\n<0d3e> <83fd>\n<0d3f> <83f2>\n<0d40> <83ca>\n<0d41> <8438>\n<0d42> <840e>\n<0d43> <8404>\n<0d44> <83dc>\n<0d45> <8407>\n<0d46> <83d4>\n<0d47> <83df>\n<0d48> <865b>\n<0d49> <86df>\n<0d4a> <86d9>\n<0d4b> <86ed>\n<0d4c> <86d4>\n<0d4d> <86db>\n<0d4e> <86e4>\n<0d4f> <86d0>\n<0d50> <86de>\n<0d51> <8857>\n<0d54> <88b1>\n<0d55> <8983>\n<0d56> <8996>\n<0d57> <8a3b>\n<0d58> <8a60>\n<0d59> <8a55>\n<0d5a> <8a5e>\n<0d5b> <8a3c>\n<0d5c> <8a41>\n<0d5d> <8a54>\n<0d5e> <8a5b>\n<0d5f> <8a50>\n<0d60> <8a46>\n<0d61> <8a34>\n<0d62> <8a3a>\n<0d63> <8a36>\n<0d64> <8a56>\n<0d65> <8c61>\n<0d66> <8c82>\n<0d67> <8caf>\n<0d68> <8cbc>\n<0d69> <8cb3>\n<0d6a> <8cbd>\n<0d6b> <8cc1>\n<0d6c> <8cbb>\n<0d6d> <8cc0>\n<0d6e> <8cb4>\n<0d6f> <8cb7>\n<0d70> <8cb6>\n<0d71> <8cbf>\n<0d72> <8cb8>\n<0d73> <8d8a>\n<0d74> <8d85>\n<0d75> <8d81>\n<0d76> <8dce>\n<0d77> <8ddd>\n<0d78> <8dcb>\n<0d79> <8dda>\n<0d7a> <8dd1>\n<0d7b> <8dcc>\n<0d7c> <8ddb>\n<0d7d> <8dc6>\n<0d7e> <8efb>\n<0d7f> <8ef8>\n<0d80> <8efc>\n<0d81> <8f9c>\n<0d82> <902e>\n<0d83> <9035>\n<0d84> <9031>\n<0d85> <9038>\n<0d86> <9032>\n<0d87> <9036>\n<0d88> <9102>\n<0d89> <90f5>\n<0d8a> <9109>\n<0d8b> <90fe>\nendbfchar\n\n100 beginbfchar\n<0d8c> <9163>\n<0d8d> <9165>\n<0d8e> <91cf>\n<0d91> <9223>\n<0d92> <9209>\n<0d93> <921e>\n<0d94> <920d>\n<0d95> <9210>\n<0d96> <9207>\n<0d97> <9211>\n<0d98> <9594>\n<0d99> <958f>\n<0d9a> <958b>\n<0d9b> <9591>\n<0d9c> <9593>\n<0d9d> <9592>\n<0d9e> <958e>\n<0d9f> <968a>\n<0da0> <968e>\n<0da1> <968b>\n<0da2> <967d>\n<0da5> <968d>\n<0da6> <9672>\n<0da7> <9684>\n<0da8> <96c1>\n<0da9> <96c5>\n<0daa> <96c4>\n<0dad> <96ef>\n<0dae> <96f2>\n<0daf> <97cc>\n<0db2> <9808>\n<0db3> <98e7>\n<0db4> <98ea>\n<0db5> <98ef>\n<0db6> <98e9>\n<0db7> <98f2>\n<0db8> <98ed>\n<0db9> <99ae>\n<0dba> <99ad>\n<0dbb> <9ec3>\n<0dbc> <9ecd>\n<0dbd> <9ed1>\n<0dbe> <4e82>\n<0dbf> <50ad>\n<0dc0> <50b5>\n<0dc3> <50c5>\n<0dc4> <50be>\n<0dc5> <50ac>\n<0dc6> <50b7>\n<0dc7> <50bb>\n<0dc8> <50af>\n<0dc9> <50c7>\n<0dca> <527f>\n<0dcb> <5277>\n<0dcc> <527d>\n<0dcd> <52df>\n<0dce> <52e6>\n<0dcf> <52e4>\n<0dd2> <532f>\n<0dd3> <55df>\n<0dd4> <55e8>\n<0dd5> <55d3>\n<0dd6> <55e6>\n<0dd7> <55ce>\n<0dd8> <55dc>\n<0dd9> <55c7>\n<0dda> <55d1>\n<0ddd> <55ef>\n<0dde> <55da>\n<0ddf> <55e1>\n<0de2> <55e5>\n<0de3> <55c9>\n<0de6> <585e>\n<0de7> <5851>\n<0de8> <5858>\n<0de9> <5857>\n<0dea> <585a>\n<0deb> <5854>\n<0dec> <586b>\n<0ded> <584c>\n<0dee> <586d>\n<0def> <584a>\n<0df0> <5862>\n<0df1> <5852>\n<0df2> <584b>\n<0df3> <5967>\n<0df4> <5ac1>\n<0df5> <5ac9>\n<0df6> <5acc>\n<0df7> <5abe>\n<0df8> <5abd>\n<0df9> <5abc>\n<0dfa> <5ab3>\n<0dfb> <5ac2>\n<0dfc> <5ab2>\n<0dfd> <5d69>\n<0dfe> <5d6f>\n<0dff> <5e4c>\n<0e00> <5e79>\n<0e01> <5ec9>\nendbfchar\n\n100 beginbfchar\n<0e02> <5ec8>\n<0e03> <5f12>\n<0e04> <5f59>\n<0e05> <5fac>\n<0e06> <5fae>\n<0e07> <611a>\n<0e08> <610f>\n<0e09> <6148>\n<0e0a> <611f>\n<0e0b> <60f3>\n<0e0c> <611b>\n<0e0d> <60f9>\n<0e0e> <6101>\n<0e0f> <6108>\n<0e10> <614e>\n<0e11> <614c>\n<0e12> <6144>\n<0e13> <614d>\n<0e14> <613e>\n<0e15> <6134>\n<0e16> <6127>\n<0e17> <610d>\n<0e18> <6106>\n<0e19> <6137>\n<0e1c> <6413>\n<0e1d> <643e>\n<0e1e> <641e>\n<0e1f> <642a>\n<0e20> <642d>\n<0e21> <643d>\n<0e22> <642c>\n<0e23> <640f>\n<0e24> <641c>\n<0e25> <6414>\n<0e26> <640d>\n<0e27> <6436>\n<0e2a> <6406>\n<0e2b> <656c>\n<0e2c> <659f>\n<0e2d> <65b0>\n<0e2e> <6697>\n<0e2f> <6689>\n<0e32> <6696>\n<0e33> <6684>\n<0e34> <6698>\n<0e35> <668d>\n<0e36> <6703>\n<0e37> <6994>\n<0e38> <696d>\n<0e39> <695a>\n<0e3a> <6977>\n<0e3b> <6960>\n<0e3c> <6954>\n<0e3d> <6975>\n<0e3e> <6930>\n<0e3f> <6982>\n<0e40> <694a>\n<0e41> <6968>\n<0e42> <696b>\n<0e43> <695e>\n<0e44> <6953>\n<0e45> <6979>\n<0e46> <6986>\n<0e47> <695d>\n<0e48> <6963>\n<0e49> <695b>\n<0e4a> <6b47>\n<0e4b> <6b72>\n<0e4c> <6bc0>\n<0e4d> <6bbf>\n<0e4e> <6bd3>\n<0e4f> <6bfd>\n<0e50> <6ea2>\n<0e51> <6eaf>\n<0e52> <6ed3>\n<0e53> <6eb6>\n<0e54> <6ec2>\n<0e55> <6e90>\n<0e56> <6e9d>\n<0e57> <6ec7>\n<0e58> <6ec5>\n<0e59> <6ea5>\n<0e5a> <6e98>\n<0e5b> <6ebc>\n<0e5c> <6eba>\n<0e5d> <6eab>\n<0e5e> <6ed1>\n<0e5f> <6e96>\n<0e60> <6e9c>\n<0e61> <6ec4>\n<0e62> <6ed4>\n<0e63> <6eaa>\n<0e64> <6ea7>\n<0e65> <6eb4>\n<0e66> <714e>\n<0e67> <7159>\n<0e68> <7169>\n<0e69> <7164>\n<0e6a> <7149>\n<0e6b> <7167>\nendbfchar\n\n100 beginbfchar\n<0e6c> <715c>\n<0e6d> <716c>\n<0e6e> <7166>\n<0e6f> <714c>\n<0e70> <7165>\n<0e71> <715e>\n<0e72> <7146>\n<0e73> <7168>\n<0e74> <7156>\n<0e75> <723a>\n<0e76> <7252>\n<0e77> <7337>\n<0e78> <7345>\n<0e79> <733f>\n<0e7a> <733e>\n<0e7b> <746f>\n<0e7c> <745a>\n<0e7d> <7455>\n<0e7e> <745f>\n<0e7f> <745e>\n<0e80> <7441>\n<0e81> <743f>\n<0e82> <7459>\n<0e85> <7576>\n<0e86> <7578>\n<0e87> <7600>\n<0e88> <75f0>\n<0e89> <7601>\n<0e8a> <75f2>\n<0e8b> <75f1>\n<0e8c> <75fa>\n<0e8d> <75ff>\n<0e8e> <75f4>\n<0e8f> <75f3>\n<0e92> <775b>\n<0e93> <776b>\n<0e94> <7766>\n<0e95> <775e>\n<0e96> <7763>\n<0e97> <7779>\n<0e98> <776a>\n<0e99> <776c>\n<0e9a> <775c>\n<0e9b> <7765>\n<0e9c> <7768>\n<0e9d> <7762>\n<0e9e> <77ee>\n<0e9f> <788e>\n<0ea0> <78b0>\n<0ea3> <788c>\n<0ea4> <7889>\n<0ea5> <787c>\n<0ea6> <7891>\n<0ea7> <7893>\n<0ea8> <787f>\n<0ea9> <797a>\n<0eaa> <797f>\n<0eab> <7981>\n<0eac> <842c>\n<0ead> <79bd>\n<0eae> <7a1c>\n<0eaf> <7a1a>\n<0eb0> <7a20>\n<0eb1> <7a14>\n<0eb2> <7a1f>\n<0eb3> <7a1e>\n<0eb6> <7b77>\n<0eb7> <7bc0>\n<0eb8> <7b60>\n<0eb9> <7b6e>\n<0eba> <7b67>\n<0ebb> <7cb1>\n<0ebc> <7cb3>\n<0ebd> <7cb5>\n<0ebe> <7d93>\n<0ebf> <7d79>\n<0ec0> <7d91>\n<0ec1> <7d81>\n<0ec2> <7d8f>\n<0ec3> <7d5b>\n<0ec4> <7f6e>\n<0ec7> <7f72>\n<0ec8> <7fa9>\n<0ec9> <7fa8>\n<0eca> <7fa4>\n<0ecb> <8056>\n<0ecc> <8058>\n<0ecd> <8086>\n<0ece> <8084>\n<0ecf> <8171>\n<0ed0> <8170>\n<0ed1> <8178>\n<0ed2> <8165>\n<0ed3> <816e>\n<0ed4> <8173>\n<0ed5> <816b>\n<0ed8> <8166>\n<0ed9> <8205>\n<0eda> <8247>\n<0edb> <8482>\nendbfchar\n\n100 beginbfchar\n<0edc> <8477>\n<0edd> <843d>\n<0ede> <8431>\n<0edf> <8475>\n<0ee0> <8466>\n<0ee1> <846b>\n<0ee2> <8449>\n<0ee3> <846c>\n<0ee4> <845b>\n<0ee5> <843c>\n<0ee6> <8435>\n<0ee7> <8461>\n<0ee8> <8463>\n<0ee9> <8469>\n<0eea> <846d>\n<0eeb> <8446>\n<0eec> <865e>\n<0eed> <865c>\n<0eee> <865f>\n<0eef> <86f9>\n<0ef0> <8713>\n<0ef1> <8708>\n<0ef2> <8707>\n<0ef3> <8700>\n<0ef4> <86fe>\n<0ef5> <86fb>\n<0ef8> <8706>\n<0ef9> <870a>\n<0efa> <8859>\n<0efb> <88df>\n<0efc> <88d4>\n<0efd> <88d9>\n<0efe> <88dc>\n<0eff> <88d8>\n<0f00> <88dd>\n<0f01> <88e1>\n<0f02> <88ca>\n<0f03> <88d5>\n<0f04> <88d2>\n<0f05> <899c>\n<0f06> <89e3>\n<0f07> <8a6b>\n<0f0a> <8a66>\n<0f0b> <8a69>\n<0f0c> <8a70>\n<0f0d> <8a87>\n<0f0e> <8a7c>\n<0f0f> <8a63>\n<0f10> <8aa0>\n<0f11> <8a71>\n<0f12> <8a85>\n<0f13> <8a6d>\n<0f14> <8a62>\n<0f15> <8a6e>\n<0f16> <8a6c>\n<0f17> <8a79>\n<0f18> <8a7b>\n<0f19> <8a3e>\n<0f1a> <8a68>\n<0f1b> <8c62>\n<0f1c> <8c8a>\n<0f1d> <8c89>\n<0f1e> <8cca>\n<0f21> <8cc4>\n<0f22> <8cb2>\n<0f23> <8cc3>\n<0f24> <8cc2>\n<0f25> <8cc5>\n<0f26> <8de1>\n<0f27> <8ddf>\n<0f28> <8de8>\n<0f29> <8def>\n<0f2a> <8df3>\n<0f2b> <8dfa>\n<0f2c> <8dea>\n<0f2d> <8de4>\n<0f2e> <8de6>\n<0f2f> <8eb2>\n<0f30> <8f03>\n<0f31> <8f09>\n<0f32> <8efe>\n<0f33> <8f0a>\n<0f34> <8f9f>\n<0f35> <8fb2>\n<0f36> <904b>\n<0f37> <904a>\n<0f38> <9053>\n<0f39> <9042>\n<0f3a> <9054>\n<0f3b> <903c>\n<0f3c> <9055>\n<0f3d> <9050>\n<0f3e> <9047>\n<0f3f> <904f>\n<0f40> <904e>\n<0f41> <904d>\n<0f42> <9051>\n<0f43> <903e>\n<0f44> <9041>\n<0f45> <9112>\nendbfchar\n\n100 beginbfchar\n<0f46> <9117>\n<0f47> <916c>\n<0f48> <916a>\n<0f49> <9169>\n<0f4a> <91c9>\n<0f4b> <9237>\n<0f4c> <9257>\n<0f4d> <9238>\n<0f4e> <923d>\n<0f4f> <9240>\n<0f50> <923e>\n<0f51> <925b>\n<0f52> <924b>\n<0f53> <9264>\n<0f54> <9251>\n<0f55> <9234>\n<0f56> <9249>\n<0f57> <924d>\n<0f58> <9245>\n<0f59> <9239>\n<0f5a> <923f>\n<0f5b> <925a>\n<0f5c> <9598>\n<0f5d> <9698>\n<0f60> <96cd>\n<0f61> <96cb>\n<0f64> <96f7>\n<0f65> <96fb>\n<0f66> <96f9>\n<0f67> <96f6>\n<0f68> <9756>\n<0f69> <9774>\n<0f6a> <9776>\n<0f6d> <9813>\n<0f6e> <980a>\n<0f6f> <9812>\n<0f70> <980c>\n<0f71> <98fc>\n<0f72> <98f4>\n<0f75> <99b3>\n<0f76> <99b1>\n<0f77> <99b4>\n<0f78> <9ae1>\n<0f79> <9ce9>\n<0f7a> <9e82>\n<0f7b> <9f0e>\n<0f7c> <9f13>\n<0f7d> <9f20>\n<0f7e> <50e7>\n<0f7f> <50ee>\n<0f80> <50e5>\n<0f81> <50d6>\n<0f82> <50ed>\n<0f83> <50da>\n<0f84> <50d5>\n<0f85> <50cf>\n<0f86> <50d1>\n<0f87> <50f1>\n<0f88> <50ce>\n<0f89> <50e9>\n<0f8a> <5162>\n<0f8b> <51f3>\n<0f8c> <5283>\n<0f8d> <5282>\n<0f8e> <5331>\n<0f8f> <53ad>\n<0f90> <55fe>\n<0f91> <5600>\n<0f92> <561b>\n<0f93> <5617>\n<0f94> <55fd>\n<0f95> <5614>\n<0f96> <5606>\n<0f97> <5609>\n<0f9a> <55f7>\n<0f9b> <5616>\n<0f9c> <561f>\n<0f9d> <5608>\n<0f9e> <5610>\n<0f9f> <55f6>\n<0fa0> <5718>\n<0fa1> <5716>\n<0fa2> <5875>\n<0fa3> <587e>\n<0fa4> <5883>\n<0fa5> <5893>\n<0fa6> <588a>\n<0fa7> <5879>\n<0fa8> <5885>\n<0fa9> <587d>\n<0faa> <58fd>\n<0fab> <5925>\n<0fac> <5922>\n<0fad> <5924>\n<0fae> <596a>\n<0faf> <5969>\n<0fb0> <5ae1>\n<0fb1> <5ae6>\n<0fb2> <5ae9>\n<0fb3> <5ad7>\nendbfchar\n\n100 beginbfchar\n<0fb4> <5ad6>\n<0fb5> <5ad8>\n<0fb6> <5ae3>\n<0fb7> <5b75>\n<0fb8> <5bde>\n<0fb9> <5be7>\n<0fba> <5be1>\n<0fbd> <5be8>\n<0fbe> <5be2>\n<0fbf> <5be4>\n<0fc0> <5bdf>\n<0fc1> <5c0d>\n<0fc2> <5c62>\n<0fc3> <5d84>\n<0fc4> <5d87>\n<0fc5> <5e5b>\n<0fc6> <5e63>\n<0fc7> <5e55>\n<0fc8> <5e57>\n<0fc9> <5e54>\n<0fca> <5ed3>\n<0fcb> <5ed6>\n<0fcc> <5f0a>\n<0fcd> <5f46>\n<0fce> <5f70>\n<0fcf> <5fb9>\n<0fd0> <6147>\n<0fd1> <613f>\n<0fd2> <614b>\n<0fd3> <6177>\n<0fd6> <615f>\n<0fd7> <615a>\n<0fd8> <6158>\n<0fd9> <6175>\n<0fda> <622a>\n<0fdb> <6487>\n<0fdc> <6458>\n<0fdd> <6454>\n<0fde> <64a4>\n<0fdf> <6478>\n<0fe0> <645f>\n<0fe1> <647a>\n<0fe2> <6451>\n<0fe3> <6467>\n<0fe4> <6434>\n<0fe5> <646d>\n<0fe6> <647b>\n<0fe7> <6572>\n<0fe8> <65a1>\n<0fe9> <65d7>\n<0fea> <65d6>\n<0feb> <66a2>\n<0fec> <66a8>\n<0fed> <669d>\n<0fee> <699c>\n<0fef> <69a8>\n<0ff0> <6995>\n<0ff1> <69c1>\n<0ff2> <69ae>\n<0ff3> <69d3>\n<0ff4> <69cb>\n<0ff5> <699b>\n<0ff6> <69b7>\n<0ff7> <69bb>\n<0ff8> <69ab>\n<0ff9> <69b4>\n<0ffa> <69d0>\n<0ffb> <69cd>\n<0ffc> <69ad>\n<0ffd> <69cc>\n<0ffe> <69a6>\n<0fff> <69c3>\n<1000> <69a3>\n<1001> <6b49>\n<1002> <6b4c>\n<1003> <6c33>\n<1004> <6f33>\n<1005> <6f14>\n<1006> <6efe>\n<1007> <6f13>\n<1008> <6ef4>\n<1009> <6f29>\n<100a> <6f3e>\n<100b> <6f20>\n<100c> <6f2c>\n<100d> <6f0f>\n<100e> <6f02>\n<100f> <6f22>\n<1010> <6eff>\n<1011> <6eef>\n<1012> <6f06>\n<1013> <6f31>\n<1014> <6f38>\n<1015> <6f32>\n<1016> <6f23>\n<1017> <6f15>\n<1018> <6f2b>\n<1019> <6f2f>\n<101a> <6f88>\n<101b> <6f2a>\nendbfchar\n\n100 beginbfchar\n<101c> <6eec>\n<101d> <6f01>\n<101e> <6ef2>\n<101f> <6ecc>\n<1020> <6ef7>\n<1021> <7194>\n<1022> <7199>\n<1023> <717d>\n<1024> <718a>\n<1025> <7184>\n<1026> <7192>\n<1027> <723e>\n<1028> <7292>\n<1029> <7296>\n<102a> <7344>\n<102b> <7350>\n<102c> <7464>\n<102d> <7463>\n<102e> <746a>\n<102f> <7470>\n<1030> <746d>\n<1031> <7504>\n<1032> <7591>\n<1033> <7627>\n<1034> <760d>\n<1035> <760b>\n<1036> <7609>\n<1037> <7613>\n<1038> <76e1>\n<1039> <76e3>\n<103a> <7784>\n<103b> <777d>\n<103c> <777f>\n<103d> <7761>\n<103e> <78c1>\n<103f> <789f>\n<1040> <78a7>\n<1041> <78b3>\n<1042> <78a9>\n<1043> <78a3>\n<1046> <798d>\n<1047> <7a2e>\n<1048> <7a31>\n<1049> <7aaa>\n<104a> <7aa9>\n<104b> <7aed>\n<104c> <7aef>\n<104d> <7ba1>\n<104e> <7b95>\n<104f> <7b8b>\n<1050> <7b75>\n<1051> <7b97>\n<1052> <7b9d>\n<1053> <7b94>\n<1054> <7b8f>\n<1055> <7bb8>\n<1056> <7b87>\n<1057> <7b84>\n<1058> <7cb9>\n<105b> <7dbb>\n<105c> <7db0>\n<105d> <7d9c>\n<1060> <7da0>\n<1061> <7dca>\n<1062> <7db4>\n<1063> <7db2>\n<1064> <7db1>\n<1065> <7dba>\n<1066> <7da2>\n<1067> <7dbf>\n<1068> <7db5>\n<1069> <7db8>\n<106a> <7dad>\n<106b> <7dd2>\n<106c> <7dc7>\n<106d> <7dac>\n<106e> <7f70>\n<1071> <7fdf>\n<1072> <805e>\n<1073> <805a>\n<1074> <8087>\n<1075> <8150>\n<1076> <8180>\n<1077> <818f>\n<1078> <8188>\n<1079> <818a>\n<107a> <817f>\n<107b> <8182>\n<107c> <81e7>\n<107d> <81fa>\n<107e> <8207>\n<107f> <8214>\n<1080> <821e>\n<1081> <824b>\n<1082> <84c9>\n<1083> <84bf>\n<1084> <84c6>\n<1085> <84c4>\n<1086> <8499>\n<1087> <849e>\nendbfchar\n\n100 beginbfchar\n<1088> <84b2>\n<1089> <849c>\n<108a> <84cb>\n<108b> <84b8>\n<108c> <84c0>\n<108d> <84d3>\n<108e> <8490>\n<108f> <84bc>\n<1090> <84d1>\n<1091> <84ca>\n<1092> <873f>\n<1093> <871c>\n<1094> <873b>\n<1095> <8722>\n<1096> <8725>\n<1097> <8734>\n<1098> <8718>\n<1099> <8755>\n<109a> <8737>\n<109b> <8729>\n<109c> <88f3>\n<109d> <8902>\n<109e> <88f4>\n<109f> <88f9>\n<10a0> <88f8>\n<10a1> <88fd>\n<10a2> <88e8>\n<10a3> <891a>\n<10a4> <88ef>\n<10a5> <8aa6>\n<10a6> <8a8c>\n<10a7> <8a9e>\n<10a8> <8aa3>\n<10a9> <8a8d>\n<10aa> <8aa1>\n<10ab> <8a93>\n<10ac> <8aa4>\n<10ad> <8aaa>\n<10ae> <8aa5>\n<10af> <8aa8>\n<10b0> <8a98>\n<10b1> <8a91>\n<10b2> <8a9a>\n<10b3> <8aa7>\n<10b4> <8c6a>\n<10b5> <8c8d>\n<10b6> <8c8c>\n<10b7> <8cd3>\n<10ba> <8d6b>\n<10bb> <8d99>\n<10bc> <8d95>\n<10bd> <8dfc>\n<10be> <8f14>\n<10bf> <8f12>\n<10c0> <8f15>\n<10c1> <8f13>\n<10c2> <8fa3>\n<10c3> <9060>\n<10c4> <9058>\n<10c5> <905c>\n<10c6> <9063>\n<10c7> <9059>\n<10c8> <905e>\n<10c9> <9062>\n<10ca> <905d>\n<10cb> <905b>\n<10cc> <9119>\n<10cd> <9118>\n<10ce> <911e>\n<10cf> <9175>\n<10d0> <9178>\n<10d1> <9177>\n<10d2> <9174>\n<10d3> <9278>\n<10d4> <92ac>\n<10d5> <9280>\n<10d6> <9285>\n<10d7> <9298>\n<10d8> <9296>\n<10d9> <927b>\n<10da> <9293>\n<10db> <929c>\n<10dc> <92a8>\n<10dd> <927c>\n<10de> <9291>\n<10df> <95a1>\n<10e2> <95a3>\n<10e3> <95a5>\n<10e4> <95a4>\n<10e5> <9699>\n<10e6> <969c>\n<10e7> <969b>\n<10e8> <96cc>\n<10e9> <96d2>\n<10ea> <9700>\n<10eb> <977c>\n<10ec> <9785>\n<10ed> <97f6>\n<10f0> <98af>\n<10f1> <98b1>\nendbfchar\n\n100 beginbfchar\n<10f2> <9903>\n<10f3> <9905>\n<10f4> <990c>\n<10f5> <9909>\n<10f6> <99c1>\n<10f9> <9ae6>\n<10fc> <9cf4>\n<10fd> <9cf6>\n<10fe> <9cf3>\n<10ff> <9ebc>\n<1100> <9f3b>\n<1101> <9f4a>\n<1102> <5104>\n<1103> <5100>\n<1104> <50fb>\n<1105> <50f5>\n<1106> <50f9>\n<1107> <5102>\n<110a> <5105>\n<110b> <51dc>\n<110f> <528d>\n<1110> <528a>\n<1111> <52f0>\n<1112> <53b2>\n<1113> <562e>\n<1114> <563b>\n<1115> <5639>\n<1116> <5632>\n<1117> <563f>\n<1118> <5634>\n<1119> <5629>\n<111a> <5653>\n<111b> <564e>\n<111c> <5657>\n<111d> <5674>\n<111e> <5636>\n<1121> <5880>\n<1122> <589f>\n<1123> <589e>\n<1124> <58b3>\n<1125> <589c>\n<1126> <58ae>\n<1127> <58a9>\n<1128> <58a6>\n<1129> <596d>\n<112a> <5b09>\n<112b> <5afb>\n<112c> <5b0b>\n<112d> <5af5>\n<112e> <5b0c>\n<112f> <5b08>\n<1130> <5bee>\n<1131> <5bec>\n<1132> <5be9>\n<1133> <5beb>\n<1136> <5d9d>\n<1137> <5d94>\n<1138> <5e62>\n<1139> <5e5f>\n<113a> <5e61>\n<113b> <5ee2>\n<113c> <5eda>\n<113d> <5edf>\n<113e> <5edd>\n<113f> <5ee3>\n<1140> <5ee0>\n<1141> <5f48>\n<1142> <5f71>\n<1143> <5fb7>\n<1144> <5fb5>\n<1145> <6176>\n<1146> <6167>\n<1147> <616e>\n<1148> <615d>\n<1149> <6155>\n<114a> <6182>\n<114b> <617c>\n<114c> <6170>\n<114d> <616b>\n<114e> <617e>\n<114f> <61a7>\n<1150> <6190>\n<1151> <61ab>\n<1152> <618e>\n<1153> <61ac>\n<1154> <619a>\n<1155> <61a4>\n<1156> <6194>\n<1157> <61ae>\n<1158> <622e>\n<1159> <6469>\n<115a> <646f>\n<115b> <6479>\n<115c> <649e>\n<115d> <64b2>\n<115e> <6488>\n<115f> <6490>\n<1160> <64b0>\n<1161> <64a5>\n<1162> <6493>\nendbfchar\n\n100 beginbfchar\n<1163> <6495>\n<1164> <64a9>\n<1165> <6492>\n<1166> <64ae>\n<1167> <64ad>\n<1168> <64ab>\n<1169> <649a>\n<116a> <64ac>\n<116b> <6499>\n<116c> <64a2>\n<116d> <64b3>\n<116e> <6575>\n<1171> <66ae>\n<1172> <66ab>\n<1173> <66b4>\n<1174> <66b1>\n<1175> <6a23>\n<1176> <6a1f>\n<1177> <69e8>\n<1178> <6a01>\n<1179> <6a1e>\n<117a> <6a19>\n<117b> <69fd>\n<117c> <6a21>\n<117d> <6a13>\n<117e> <6a0a>\n<117f> <69f3>\n<1180> <6a02>\n<1181> <6a05>\n<1182> <69ed>\n<1183> <6a11>\n<1184> <6b50>\n<1185> <6b4e>\n<1186> <6ba4>\n<1189> <6f3f>\n<118a> <6f7c>\n<118b> <6f84>\n<118c> <6f51>\n<118d> <6f66>\n<118e> <6f54>\n<118f> <6f86>\n<1190> <6f6d>\n<1191> <6f5b>\n<1192> <6f78>\n<1193> <6f6e>\n<1194> <6f8e>\n<1195> <6f7a>\n<1196> <6f70>\n<1197> <6f64>\n<1198> <6f97>\n<1199> <6f58>\n<119a> <6ed5>\n<119b> <6f6f>\n<119c> <6f60>\n<119d> <6f5f>\n<119e> <719f>\n<119f> <71ac>\n<11a0> <71b1>\n<11a1> <71a8>\n<11a2> <7256>\n<11a3> <729b>\n<11a4> <734e>\n<11a5> <7357>\n<11a6> <7469>\n<11a7> <748b>\n<11a8> <7483>\n<11a9> <747e>\n<11aa> <7480>\n<11ab> <757f>\n<11ac> <7620>\n<11ad> <7629>\n<11ae> <761f>\n<11af> <7624>\n<11b0> <7626>\n<11b3> <769a>\n<11b4> <76ba>\n<11b5> <76e4>\n<11b6> <778e>\n<11b7> <7787>\n<11b8> <778c>\n<11b9> <7791>\n<11ba> <778b>\n<11bb> <78cb>\n<11bc> <78c5>\n<11bd> <78ba>\n<11be> <78ca>\n<11bf> <78be>\n<11c0> <78d5>\n<11c1> <78bc>\n<11c2> <78d0>\n<11c3> <7a3f>\n<11c4> <7a3c>\n<11c5> <7a40>\n<11c6> <7a3d>\n<11c7> <7a37>\n<11c8> <7a3b>\n<11c9> <7aaf>\n<11ca> <7aae>\n<11cb> <7bad>\n<11cc> <7bb1>\nendbfchar\n\n100 beginbfchar\n<11cd> <7bc4>\n<11ce> <7bb4>\n<11d1> <7bc1>\n<11d2> <7ba0>\n<11d3> <7bcc>\n<11d4> <7cca>\n<11d5> <7de0>\n<11d6> <7df4>\n<11d7> <7def>\n<11d8> <7dfb>\n<11d9> <7dd8>\n<11da> <7dec>\n<11db> <7ddd>\n<11dc> <7de8>\n<11dd> <7de3>\n<11de> <7dda>\n<11df> <7dde>\n<11e0> <7de9>\n<11e1> <7d9e>\n<11e2> <7dd9>\n<11e3> <7df2>\n<11e4> <7df9>\n<11e5> <7f75>\n<11e6> <7f77>\n<11e7> <7faf>\n<11e8> <7fe9>\n<11e9> <8026>\n<11ed> <81a0>\n<11ee> <819a>\n<11ef> <8198>\n<11f0> <8517>\n<11f1> <853d>\n<11f2> <851a>\n<11f3> <84ee>\n<11f6> <8513>\n<11f7> <8511>\n<11f8> <8523>\n<11f9> <8521>\n<11fa> <8514>\n<11fb> <84ec>\n<11fc> <8525>\n<11fd> <84ff>\n<11fe> <8506>\n<11ff> <8782>\n<1200> <8774>\n<1201> <8776>\n<1202> <8760>\n<1203> <8766>\n<1204> <8778>\n<1205> <8768>\n<1206> <8759>\n<1207> <8757>\n<1208> <874c>\n<1209> <8753>\n<120a> <885b>\n<120b> <885d>\n<120c> <8910>\n<120d> <8907>\n<1210> <8915>\n<1211> <890a>\n<1212> <8abc>\n<1213> <8ad2>\n<1214> <8ac7>\n<1215> <8ac4>\n<1216> <8a95>\n<1217> <8acb>\n<1218> <8af8>\n<1219> <8ab2>\n<121a> <8ac9>\n<121b> <8ac2>\n<121c> <8abf>\n<121d> <8ab0>\n<121e> <8ad6>\n<121f> <8acd>\n<1220> <8ab6>\n<1221> <8ab9>\n<1222> <8adb>\n<1223> <8c4c>\n<1224> <8c4e>\n<1225> <8c6c>\n<1226> <8ce0>\n<1227> <8cde>\n<1228> <8ce6>\n<1229> <8ce4>\n<122e> <8cdc>\n<122f> <8cea>\n<1230> <8ce1>\n<1231> <8d6d>\n<1232> <8d9f>\n<1233> <8da3>\n<1234> <8e2b>\n<1235> <8e10>\n<1236> <8e1d>\n<1237> <8e22>\n<1238> <8e0f>\n<1239> <8e29>\n<123a> <8e1f>\n<123b> <8e21>\n<123c> <8e1e>\n<123d> <8eba>\nendbfchar\n\n100 beginbfchar\n<123e> <8f1d>\n<123f> <8f1b>\n<1240> <8f1f>\n<1241> <8f29>\n<1242> <8f26>\n<1243> <8f2a>\n<1244> <8f1c>\n<1245> <8f1e>\n<1246> <8f25>\n<1247> <9069>\n<1248> <906e>\n<1249> <9068>\n<124a> <906d>\n<124b> <9077>\n<124c> <9130>\n<124d> <912d>\n<124e> <9127>\n<124f> <9131>\n<1250> <9187>\n<1251> <9189>\n<1252> <918b>\n<1253> <9183>\n<1254> <92c5>\n<1255> <92bb>\n<1256> <92b7>\n<1257> <92ea>\n<1258> <92e4>\n<1259> <92c1>\n<125a> <92b3>\n<125b> <92bc>\n<125c> <92d2>\n<125d> <92c7>\n<125e> <92f0>\n<125f> <92b2>\n<1260> <95ad>\n<1261> <95b1>\n<1262> <9704>\n<1265> <9709>\n<1266> <9760>\n<1267> <978d>\n<1268> <978b>\n<1269> <978f>\n<126a> <9821>\n<126b> <982b>\n<126c> <981c>\n<126d> <98b3>\n<126e> <990a>\n<126f> <9913>\n<1270> <9912>\n<1271> <9918>\n<1272> <99dd>\n<1273> <99d0>\n<1274> <99df>\n<1275> <99db>\n<1276> <99d1>\n<1277> <99d5>\n<1278> <99d2>\n<1279> <99d9>\n<127a> <9ab7>\n<127d> <9b27>\n<127e> <9b45>\n<127f> <9b44>\n<1280> <9b77>\n<1281> <9b6f>\n<1282> <9d06>\n<1283> <9d09>\n<1284> <9d03>\n<1285> <9ea9>\n<1286> <9ebe>\n<1287> <9ece>\n<1288> <58a8>\n<1289> <9f52>\n<128a> <5112>\n<128b> <5118>\n<128c> <5114>\n<128d> <5110>\n<128e> <5115>\n<128f> <5180>\n<1290> <51aa>\n<1291> <51dd>\n<1292> <5291>\n<1293> <5293>\n<1294> <52f3>\n<1295> <5659>\n<1296> <566b>\n<1297> <5679>\n<1298> <5669>\n<1299> <5664>\n<129a> <5678>\n<129b> <566a>\n<129c> <5668>\n<129d> <5665>\n<129e> <5671>\n<129f> <566f>\n<12a0> <566c>\n<12a1> <5662>\n<12a2> <5676>\n<12a3> <58c1>\n<12a4> <58be>\n<12a5> <58c7>\nendbfchar\n\n100 beginbfchar\n<12a6> <58c5>\n<12a7> <596e>\n<12a8> <5b1d>\n<12a9> <5b34>\n<12aa> <5b78>\n<12ab> <5bf0>\n<12ac> <5c0e>\n<12ad> <5f4a>\n<12ae> <61b2>\n<12af> <6191>\n<12b0> <61a9>\n<12b1> <618a>\n<12b2> <61cd>\n<12b3> <61b6>\n<12b4> <61be>\n<12b5> <61ca>\n<12b6> <61c8>\n<12b7> <6230>\n<12b8> <64c5>\n<12b9> <64c1>\n<12ba> <64cb>\n<12bd> <64da>\n<12be> <64c4>\n<12bf> <64c7>\n<12c0> <64c2>\n<12c1> <64cd>\n<12c2> <64bf>\n<12c3> <64d2>\n<12c4> <64d4>\n<12c5> <64be>\n<12c6> <6574>\n<12c7> <66c6>\n<12c8> <66c9>\n<12c9> <66b9>\n<12ca> <66c4>\n<12cb> <66c7>\n<12cc> <66b8>\n<12cd> <6a3d>\n<12ce> <6a38>\n<12cf> <6a3a>\n<12d0> <6a59>\n<12d1> <6a6b>\n<12d2> <6a58>\n<12d3> <6a39>\n<12d4> <6a44>\n<12d5> <6a62>\n<12d6> <6a61>\n<12d7> <6a4b>\n<12d8> <6a47>\n<12d9> <6a35>\n<12da> <6a5f>\n<12db> <6a48>\n<12dc> <6b59>\n<12dd> <6b77>\n<12de> <6c05>\n<12df> <6fc2>\n<12e0> <6fb1>\n<12e1> <6fa1>\n<12e2> <6fc3>\n<12e3> <6fa4>\n<12e4> <6fc1>\n<12e5> <6fa7>\n<12e6> <6fb3>\n<12e7> <6fc0>\n<12e8> <6fb9>\n<12e9> <6fb6>\n<12ea> <6fa6>\n<12eb> <6fa0>\n<12ec> <6fb4>\n<12ed> <71be>\n<12ee> <71c9>\n<12ef> <71d0>\n<12f0> <71d2>\n<12f1> <71c8>\n<12f2> <71d5>\n<12f3> <71b9>\n<12f4> <71ce>\n<12f5> <71d9>\n<12f6> <71dc>\n<12f9> <7368>\n<12fa> <749c>\n<12fb> <74a3>\n<12fc> <7498>\n<12fd> <749f>\n<12fe> <749e>\n<12ff> <74e2>\n<1302> <7634>\n<1303> <7638>\n<1304> <763a>\n<1305> <76e7>\n<1306> <76e5>\n<1307> <77a0>\n<130a> <77a5>\n<130b> <78e8>\n<130c> <78da>\n<130d> <78ec>\n<130e> <78e7>\n<130f> <79a6>\n<1312> <7a46>\n<1313> <7a4c>\nendbfchar\n\n100 beginbfchar\n<1314> <7a4b>\n<1315> <7aba>\n<1316> <7bd9>\n<1317> <7c11>\n<1318> <7bc9>\n<1319> <7be4>\n<131a> <7bdb>\n<131b> <7be1>\n<131c> <7be9>\n<131d> <7be6>\n<1320> <7e0a>\n<1321> <7e11>\n<1322> <7e08>\n<1323> <7e1b>\n<1324> <7e23>\n<1325> <7e1e>\n<1326> <7e1d>\n<1327> <7e09>\n<1328> <7e10>\n<1329> <7f79>\n<132a> <7fb2>\n<132d> <7fee>\n<132e> <8028>\n<132f> <81b3>\n<1330> <81a9>\n<1331> <81a8>\n<1332> <81fb>\n<1333> <8208>\n<1336> <854a>\n<1337> <8559>\n<1338> <8548>\n<133b> <8543>\n<133c> <8549>\n<133d> <856d>\n<133e> <856a>\n<133f> <855e>\n<1340> <8783>\n<1341> <879f>\n<1342> <879e>\n<1343> <87a2>\n<1344> <878d>\n<1345> <8861>\n<1346> <892a>\n<1347> <8932>\n<1348> <8925>\n<1349> <892b>\n<134a> <8921>\n<134b> <89aa>\n<134c> <89a6>\n<134d> <8ae6>\n<134e> <8afa>\n<134f> <8aeb>\n<1350> <8af1>\n<1351> <8b00>\n<1352> <8adc>\n<1353> <8ae7>\n<1354> <8aee>\n<1355> <8afe>\n<1358> <8af7>\n<1359> <8aed>\n<135a> <8af3>\n<135b> <8af6>\n<135c> <8afc>\n<135d> <8c6b>\n<135e> <8c6d>\n<135f> <8c93>\n<1360> <8cf4>\n<1361> <8e44>\n<1362> <8e31>\n<1363> <8e34>\n<1364> <8e42>\n<1365> <8e39>\n<1366> <8e35>\n<1367> <8f3b>\n<1368> <8f2f>\n<1369> <8f38>\n<136a> <8f33>\n<136b> <8fa8>\n<136c> <8fa6>\n<136d> <9075>\n<136e> <9074>\n<136f> <9078>\n<1370> <9072>\n<1371> <907c>\n<1372> <907a>\n<1373> <9134>\n<1374> <9192>\n<1375> <9320>\n<1376> <9336>\n<1377> <92f8>\n<1378> <9333>\n<1379> <932f>\n<137a> <9322>\n<137b> <92fc>\n<137c> <932b>\n<137d> <9304>\n<137e> <931a>\n<137f> <9310>\n<1380> <9326>\n<1381> <9321>\nendbfchar\n\n100 beginbfchar\n<1382> <9315>\n<1383> <932e>\n<1384> <9319>\n<1385> <95bb>\n<1388> <96aa>\n<1389> <96d5>\n<138a> <970e>\n<138b> <9711>\n<138c> <9716>\n<138d> <970d>\n<138e> <9713>\n<138f> <970f>\n<1392> <9766>\n<1393> <9798>\n<1394> <9830>\n<1395> <9838>\n<1396> <983b>\n<1397> <9837>\n<1398> <982d>\n<1399> <9839>\n<139a> <9824>\n<139b> <9910>\n<139c> <9928>\n<139d> <991e>\n<139e> <991b>\n<139f> <9921>\n<13a0> <991a>\n<13a1> <99ed>\n<13a2> <99e2>\n<13a3> <99f1>\n<13a4> <9ab8>\n<13a5> <9abc>\n<13a6> <9afb>\n<13a7> <9aed>\n<13a8> <9b28>\n<13a9> <9b91>\n<13aa> <9d15>\n<13ab> <9d23>\n<13ac> <9d26>\n<13ad> <9d28>\n<13ae> <9d12>\n<13af> <9d1b>\n<13b0> <9ed8>\n<13b1> <9ed4>\n<13b2> <9f8d>\n<13b3> <9f9c>\n<13b4> <512a>\n<13b5> <511f>\n<13b6> <5121>\n<13b7> <5132>\n<13b8> <52f5>\n<13b9> <568e>\n<13ba> <5680>\n<13bb> <5690>\n<13bc> <5685>\n<13bd> <5687>\n<13be> <568f>\n<13bf> <58d5>\n<13c0> <58d3>\n<13c1> <58d1>\n<13c2> <58ce>\n<13c3> <5b30>\n<13c4> <5b2a>\n<13c5> <5b24>\n<13c6> <5b7a>\n<13c7> <5c37>\n<13c8> <5c68>\n<13c9> <5dbc>\n<13ca> <5dba>\n<13cb> <5dbd>\n<13cc> <5db8>\n<13cd> <5e6b>\n<13ce> <5f4c>\n<13cf> <5fbd>\n<13d0> <61c9>\n<13d1> <61c2>\n<13d2> <61c7>\n<13d3> <61e6>\n<13d4> <61cb>\n<13d5> <6232>\n<13d6> <6234>\n<13d7> <64ce>\n<13d8> <64ca>\n<13d9> <64d8>\n<13da> <64e0>\n<13db> <64f0>\n<13dc> <64e6>\n<13dd> <64ec>\n<13de> <64f1>\n<13df> <64e2>\n<13e0> <64ed>\n<13e3> <66d9>\n<13e4> <66d6>\n<13e5> <6a80>\n<13e6> <6a94>\n<13e7> <6a84>\n<13e8> <6aa2>\n<13e9> <6a9c>\n<13ea> <6adb>\n<13eb> <6aa3>\nendbfchar\n\n100 beginbfchar\n<13ec> <6a7e>\n<13ed> <6a97>\n<13ee> <6a90>\n<13ef> <6aa0>\n<13f0> <6b5c>\n<13f1> <6bae>\n<13f2> <6bda>\n<13f3> <6c08>\n<13f4> <6fd8>\n<13f5> <6ff1>\n<13f8> <6fdb>\n<13f9> <6fe4>\n<13fa> <6feb>\n<13fb> <6fef>\n<13fc> <6f80>\n<13fd> <6fec>\n<13fe> <6fe1>\n<13ff> <6fe9>\n<1400> <6fd5>\n<1401> <6fee>\n<1402> <6ff0>\n<1403> <71e7>\n<1404> <71df>\n<1405> <71ee>\n<1406> <71e6>\n<1407> <71e5>\n<1408> <71ed>\n<1409> <71ec>\n<140a> <71f4>\n<140b> <71e0>\n<140c> <7235>\n<140d> <7246>\n<140e> <7370>\n<140f> <7372>\n<1410> <74a9>\n<1411> <74b0>\n<1412> <74a6>\n<1413> <74a8>\n<1414> <7646>\n<1415> <7642>\n<1416> <764c>\n<1417> <76ea>\n<1418> <77b3>\n<1419> <77aa>\n<141a> <77b0>\n<141b> <77ac>\n<141c> <77a7>\n<141d> <77ad>\n<141e> <77ef>\n<141f> <78f7>\n<1420> <78fa>\n<1421> <78f4>\n<1422> <78ef>\n<1423> <7901>\n<1424> <79a7>\n<1425> <79aa>\n<1426> <7a57>\n<1427> <7abf>\n<1428> <7c07>\n<1429> <7c0d>\n<142a> <7bfe>\n<142b> <7bf7>\n<142c> <7c0c>\n<142d> <7be0>\n<142e> <7ce0>\n<142f> <7cdc>\n<1430> <7cde>\n<1431> <7ce2>\n<1432> <7cdf>\n<1433> <7cd9>\n<1434> <7cdd>\n<1435> <7e2e>\n<1436> <7e3e>\n<1437> <7e46>\n<1438> <7e37>\n<1439> <7e32>\n<143a> <7e43>\n<143b> <7e2b>\n<143c> <7e3d>\n<143d> <7e31>\n<143e> <7e45>\n<143f> <7e41>\n<1440> <7e34>\n<1441> <7e39>\n<1442> <7e48>\n<1443> <7e35>\n<1444> <7e3f>\n<1445> <7e2f>\n<1446> <7f44>\n<1447> <7ff3>\n<1448> <7ffc>\n<144b> <8070>\n<144c> <806f>\n<144d> <8073>\n<144e> <81c6>\n<144f> <81c3>\n<1450> <81ba>\n<1451> <81c2>\n<1452> <81c0>\n<1453> <81bf>\nendbfchar\n\n100 beginbfchar\n<1454> <81bd>\n<1455> <81c9>\n<1456> <81be>\n<1457> <81e8>\n<1458> <8209>\n<1459> <8271>\n<145a> <85aa>\n<145b> <8584>\n<145c> <857e>\n<145d> <859c>\n<145e> <8591>\n<145f> <8594>\n<1460> <85af>\n<1461> <859b>\n<1462> <8587>\n<1463> <85a8>\n<1464> <858a>\n<1465> <85a6>\n<1466> <8667>\n<1467> <87c0>\n<1468> <87d1>\n<1469> <87b3>\n<146a> <87d2>\n<146b> <87c6>\n<146c> <87ab>\n<146d> <87bb>\n<146e> <87ba>\n<146f> <87c8>\n<1470> <87cb>\n<1471> <893b>\n<1472> <8936>\n<1473> <8944>\n<1474> <8938>\n<1475> <893d>\n<1476> <89ac>\n<1477> <8b0e>\n<1478> <8b17>\n<1479> <8b19>\n<147a> <8b1b>\n<147b> <8b0a>\n<147c> <8b20>\n<147d> <8b1d>\n<147e> <8b04>\n<147f> <8b10>\n<1480> <8c41>\n<1481> <8c3f>\n<1482> <8c73>\n<1483> <8cfa>\n<1484> <8cfd>\n<1485> <8cfc>\n<1486> <8cf8>\n<1487> <8cfb>\n<1488> <8da8>\n<1489> <8e49>\n<148a> <8e4b>\n<148b> <8e48>\n<148c> <8e4a>\n<148d> <8f44>\n<148e> <8f3e>\n<148f> <8f42>\n<1490> <8f45>\n<1491> <8f3f>\n<1492> <907f>\n<1493> <907d>\n<1494> <9084>\n<1497> <9080>\n<1498> <9139>\n<1499> <91a3>\n<149a> <919e>\n<149b> <919c>\n<149c> <934d>\n<149d> <9382>\n<149e> <9328>\n<149f> <9375>\n<14a0> <934a>\n<14a1> <9365>\n<14a2> <934b>\n<14a3> <9318>\n<14a4> <937e>\n<14a5> <936c>\n<14a6> <935b>\n<14a7> <9370>\n<14a8> <935a>\n<14a9> <9354>\n<14ad> <95c8>\n<14ae> <95c6>\n<14af> <96b1>\n<14b0> <96b8>\n<14b1> <96d6>\n<14b2> <971c>\n<14b3> <971e>\n<14b4> <97a0>\n<14b5> <97d3>\n<14b6> <9846>\n<14b7> <98b6>\n<14b8> <9935>\n<14b9> <9a01>\n<14ba> <99ff>\n<14bb> <9bae>\n<14bc> <9bab>\nendbfchar\n\n100 beginbfchar\n<14bd> <9baa>\n<14be> <9bad>\n<14bf> <9d3b>\n<14c0> <9d3f>\n<14c1> <9e8b>\n<14c2> <9ecf>\n<14c3> <9ede>\n<14c6> <9edb>\n<14c7> <9f3e>\n<14c8> <9f4b>\n<14c9> <53e2>\n<14ca> <5695>\n<14cb> <56ae>\n<14cc> <58d9>\n<14cd> <58d8>\n<14ce> <5b38>\n<14cf> <5f5d>\n<14d0> <61e3>\n<14d1> <6233>\n<14d2> <64f4>\n<14d3> <64f2>\n<14d4> <64fe>\n<14d5> <6506>\n<14d8> <64f7>\n<14d9> <65b7>\n<14da> <66dc>\n<14db> <6726>\n<14dc> <6ab3>\n<14dd> <6aac>\n<14de> <6ac3>\n<14df> <6abb>\n<14e0> <6ab8>\n<14e1> <6ac2>\n<14e4> <6b5f>\n<14e5> <6b78>\n<14e6> <6baf>\n<14e7> <7009>\n<14e8> <700b>\n<14e9> <6ffe>\n<14ea> <7006>\n<14eb> <6ffa>\n<14ec> <7011>\n<14ed> <700f>\n<14f0> <71fe>\n<14f1> <71f8>\n<14f2> <7377>\n<14f3> <7375>\n<14f4> <74a7>\n<14f5> <74bf>\n<14f6> <7515>\n<14f7> <7656>\n<14f8> <7658>\n<14f9> <7652>\n<14fa> <77bd>\n<14fb> <77bf>\n<14fe> <790e>\n<14ff> <79ae>\n<1502> <7a60>\n<1505> <7c2b>\n<1506> <7c27>\n<1507> <7c2a>\n<1508> <7c1e>\n<1509> <7c23>\n<150a> <7c21>\n<150b> <7ce7>\n<150e> <7e5e>\n<150f> <7e5a>\n<1510> <7e61>\n<1511> <7e52>\n<1512> <7e59>\n<1513> <7f48>\n<1514> <7ff9>\n<1515> <7ffb>\n<1516> <8077>\n<1517> <8076>\n<1518> <81cd>\n<1519> <81cf>\n<151a> <820a>\n<151b> <85cf>\n<151c> <85a9>\n<151d> <85cd>\n<151e> <85d0>\n<151f> <85c9>\n<1520> <85b0>\n<1521> <85ba>\n<1522> <85b9>\n<1523> <87ef>\n<1524> <87ec>\n<1525> <87f2>\n<1526> <87e0>\n<1527> <8986>\n<1528> <89b2>\n<1529> <89f4>\n<152a> <8b28>\n<152b> <8b39>\n<152c> <8b2c>\n<152d> <8b2b>\n<152e> <8c50>\n<152f> <8d05>\n<1530> <8e59>\nendbfchar\n\n100 beginbfchar\n<1531> <8e63>\n<1532> <8e66>\n<1533> <8e64>\n<1534> <8e5f>\n<1535> <8e55>\n<1536> <8ec0>\n<1537> <8f49>\n<1538> <8f4d>\n<1539> <9087>\n<153a> <9083>\n<153b> <9088>\n<153e> <91d0>\n<153f> <9394>\n<1540> <938a>\n<1541> <9396>\n<1542> <93a2>\n<1543> <93b3>\n<1544> <93ae>\n<1545> <93ac>\n<1546> <93b0>\n<1547> <9398>\n<1548> <939a>\n<1549> <9397>\n<154a> <95d4>\n<154b> <95d6>\n<154c> <95d0>\n<154d> <95d5>\n<154e> <96e2>\n<154f> <96dc>\n<1550> <96d9>\n<1551> <96db>\n<1552> <96de>\n<1553> <9724>\n<1554> <97a3>\n<1555> <97a6>\n<1556> <97ad>\n<1557> <97f9>\n<1558> <984d>\n<1559> <984f>\n<155a> <984c>\n<155b> <984e>\n<155c> <9853>\n<155d> <98ba>\n<1560> <993d>\n<1561> <992e>\n<1562> <99a5>\n<1563> <9a0e>\n<1564> <9ac1>\n<1565> <9b03>\n<1566> <9b06>\n<1567> <9b4f>\n<1568> <9b4e>\n<1569> <9b4d>\n<156a> <9bca>\n<156b> <9bc9>\n<156c> <9bfd>\n<156d> <9bc8>\n<156e> <9bc0>\n<156f> <9d51>\n<1570> <9d5d>\n<1571> <9d60>\n<1572> <9ee0>\n<1573> <9f15>\n<1574> <9f2c>\n<1575> <5133>\n<1576> <56a5>\n<1577> <56a8>\n<157a> <58e2>\n<157b> <5bf5>\n<157c> <9f90>\n<157d> <5eec>\n<157e> <61f2>\n<157f> <61f7>\n<1580> <61f6>\n<1581> <61f5>\n<1582> <6500>\n<1583> <650f>\n<1584> <66e0>\n<1585> <66dd>\n<1586> <6ae5>\n<1587> <6add>\n<1588> <6ada>\n<1589> <6ad3>\n<158a> <701b>\n<158b> <701f>\n<158c> <7028>\n<158d> <701a>\n<158e> <701d>\n<158f> <7015>\n<1590> <7018>\n<1591> <7206>\n<1592> <720d>\n<1593> <7258>\n<1594> <72a2>\n<1595> <7378>\n<1596> <737a>\n<1597> <74bd>\n<1598> <74ca>\n<1599> <74e3>\n<159a> <7587>\nendbfchar\n\n100 beginbfchar\n<159b> <7586>\n<159c> <765f>\n<159d> <7661>\n<159e> <77c7>\n<159f> <7919>\n<15a0> <79b1>\n<15a1> <7a6b>\n<15a2> <7a69>\n<15a5> <7c38>\n<15a6> <7c3d>\n<15a7> <7c37>\n<15a8> <7c40>\n<15a9> <7e6b>\n<15aa> <7e6d>\n<15ab> <7e79>\n<15ae> <7e73>\n<15af> <7f85>\n<15b0> <7fb6>\n<15b1> <7fb9>\n<15b2> <7fb8>\n<15b3> <81d8>\n<15b4> <85e9>\n<15b5> <85dd>\n<15b6> <85ea>\n<15b7> <85d5>\n<15ba> <85f7>\n<15bb> <87fb>\n<15bc> <8805>\n<15bd> <880d>\n<15be> <87f9>\n<15bf> <87fe>\n<15c0> <8960>\n<15c1> <895f>\n<15c2> <8956>\n<15c3> <895e>\n<15c4> <8b41>\n<15c5> <8b5c>\n<15c6> <8b58>\n<15c7> <8b49>\n<15c8> <8b5a>\n<15cb> <8b46>\n<15cc> <8b59>\n<15cd> <8d08>\n<15ce> <8d0a>\n<15cf> <8e7c>\n<15d0> <8e72>\n<15d1> <8e87>\n<15d2> <8e76>\n<15d3> <8e6c>\n<15d4> <8e7a>\n<15d5> <8e74>\n<15d6> <8f54>\n<15d7> <8f4e>\n<15d8> <8fad>\n<15db> <91b1>\n<15dc> <91ae>\n<15dd> <93e1>\n<15de> <93d1>\n<15df> <93df>\n<15e0> <93c3>\n<15e1> <93c8>\n<15e4> <93d6>\n<15e5> <93e2>\n<15e6> <93cd>\n<15e7> <93d8>\n<15e8> <93e4>\n<15e9> <93d7>\n<15ea> <93e8>\n<15eb> <95dc>\n<15ec> <96b4>\n<15ed> <96e3>\n<15ee> <972a>\n<15ef> <9727>\n<15f0> <9761>\n<15f1> <97dc>\n<15f2> <97fb>\n<15f3> <985e>\n<15f4> <9858>\n<15f5> <985b>\n<15f6> <98bc>\n<15f7> <9945>\n<15f8> <9949>\n<15f9> <9a16>\n<15fa> <9a19>\n<15fb> <9b0d>\n<15fc> <9be8>\n<15fd> <9be7>\n<15fe> <9bd6>\n<15ff> <9bdb>\n<1600> <9d89>\n<1601> <9d61>\n<1602> <9d72>\n<1603> <9d6a>\n<1604> <9d6c>\n<1605> <9e92>\n<1606> <9e97>\n<1607> <9e93>\n<1608> <9eb4>\n<1609> <52f8>\n<160a> <56b7>\nendbfchar\n\n100 beginbfchar\n<160b> <56b6>\n<160c> <56b4>\n<160d> <56bc>\n<160e> <58e4>\n<160f> <5b40>\n<1610> <5b43>\n<1611> <5b7d>\n<1612> <5bf6>\n<1613> <5dc9>\n<1614> <61f8>\n<1615> <61fa>\n<1616> <6518>\n<1617> <6514>\n<1618> <6519>\n<1619> <66e6>\n<161a> <6727>\n<161b> <6aec>\n<161c> <703e>\n<161d> <7030>\n<161e> <7032>\n<161f> <7210>\n<1620> <737b>\n<1621> <74cf>\n<1622> <7662>\n<1623> <7665>\n<1624> <7926>\n<1625> <792a>\n<1626> <792c>\n<1627> <792b>\n<1628> <7ac7>\n<1629> <7af6>\n<162a> <7c4c>\n<162b> <7c43>\n<162c> <7c4d>\n<162f> <8fae>\n<1630> <7e7d>\n<1631> <7e7c>\n<1632> <7e82>\n<1633> <7f4c>\n<1634> <8000>\n<1635> <81da>\n<1636> <8266>\n<1637> <85fb>\n<1638> <85f9>\n<1639> <8611>\n<163a> <85fa>\n<163b> <8606>\n<163c> <860b>\n<163d> <8607>\n<163e> <860a>\n<1641> <8964>\n<1642> <89ba>\n<1643> <89f8>\n<1644> <8b70>\n<1645> <8b6c>\n<1646> <8b66>\n<1647> <8b6f>\n<1648> <8b5f>\n<1649> <8b6b>\n<164a> <8d0f>\n<164b> <8d0d>\n<164c> <8e89>\n<164d> <8e81>\n<164e> <8e85>\n<164f> <8e82>\n<1650> <91b4>\n<1651> <91cb>\n<1652> <9418>\n<1653> <9403>\n<1654> <93fd>\n<1655> <95e1>\n<1656> <9730>\n<1657> <98c4>\n<1658> <9952>\n<1659> <9951>\n<165a> <99a8>\n<165b> <9a2b>\n<165c> <9a30>\n<165d> <9a37>\n<165e> <9a35>\n<165f> <9c13>\n<1660> <9c0d>\n<1661> <9e79>\n<1662> <9eb5>\n<1663> <9ee8>\n<1664> <9f2f>\n<1665> <9f5f>\n<1666> <9f63>\n<1667> <9f61>\n<166a> <56c1>\n<166b> <56c0>\n<166c> <56c2>\n<166d> <5914>\n<166e> <5c6c>\n<166f> <5dcd>\n<1670> <61fc>\n<1671> <61fe>\n<1672> <651d>\n<1673> <651c>\n<1674> <6595>\nendbfchar\n\n100 beginbfchar\n<1675> <66e9>\n<1676> <6afb>\n<1677> <6b04>\n<1678> <6afa>\n<1679> <6bb2>\n<167a> <704c>\n<167b> <721b>\n<167c> <72a7>\n<167d> <74d6>\n<167e> <74d4>\n<167f> <7669>\n<1680> <77d3>\n<1681> <7c50>\n<1682> <7e8f>\n<1683> <7e8c>\n<1684> <7fbc>\n<1685> <8617>\n<1686> <862d>\n<1687> <861a>\n<1688> <8823>\n<1689> <8822>\n<168a> <8821>\n<168b> <881f>\n<168c> <896a>\n<168d> <896c>\n<168e> <89bd>\n<168f> <8b74>\n<1690> <8b77>\n<1691> <8b7d>\n<1692> <8d13>\n<1693> <8e8a>\n<1694> <8e8d>\n<1695> <8e8b>\n<1696> <8f5f>\n<1697> <8faf>\n<1698> <91ba>\n<1699> <942e>\n<169a> <9433>\n<169b> <9435>\n<169c> <943a>\n<169d> <9438>\n<169e> <9432>\n<169f> <942b>\n<16a0> <95e2>\n<16a3> <9732>\n<16a4> <97ff>\n<16a5> <9867>\n<16a6> <9865>\n<16a7> <9957>\n<16a8> <9a45>\n<16a9> <9a43>\n<16aa> <9a40>\n<16ab> <9a3e>\n<16ac> <9acf>\n<16ad> <9b54>\n<16ae> <9b51>\n<16af> <9c2d>\n<16b0> <9c25>\n<16b1> <9daf>\n<16b2> <9db4>\n<16b3> <9dc2>\n<16b4> <9db8>\n<16b5> <9e9d>\n<16b6> <9eef>\n<16b7> <9f19>\n<16b8> <9f5c>\n<16bb> <513c>\n<16bc> <513b>\n<16bd> <56c8>\n<16be> <56ca>\n<16bf> <56c9>\n<16c0> <5b7f>\n<16c1> <5dd4>\n<16c2> <5dd2>\n<16c3> <5f4e>\n<16c4> <61ff>\n<16c5> <6524>\n<16c6> <6b0a>\n<16c7> <6b61>\n<16c8> <7051>\n<16c9> <7058>\n<16ca> <7380>\n<16cb> <74e4>\n<16cc> <758a>\n<16cd> <766e>\n<16ce> <766c>\n<16cf> <79b3>\n<16d0> <7c60>\n<16d1> <7c5f>\n<16d2> <807e>\n<16d3> <807d>\n<16d4> <81df>\n<16d5> <8972>\n<16d6> <896f>\n<16d7> <89fc>\n<16d8> <8b80>\n<16db> <8e91>\n<16dc> <8e93>\n<16dd> <8f61>\n<16de> <9148>\nendbfchar\n\n100 beginbfchar\n<16df> <9444>\n<16e4> <97c3>\n<16e5> <97c1>\n<16e6> <986b>\n<16e7> <9955>\n<16e8> <9a55>\n<16e9> <9a4d>\n<16ea> <9ad2>\n<16eb> <9b1a>\n<16ec> <9c49>\n<16ed> <9c31>\n<16ee> <9c3e>\n<16ef> <9c3b>\n<16f0> <9dd3>\n<16f1> <9dd7>\n<16f2> <9f34>\n<16f3> <9f6c>\n<16f4> <9f6a>\n<16f5> <9f94>\n<16f6> <56cc>\n<16f7> <5dd6>\n<16f8> <6200>\n<16f9> <6523>\n<16fa> <652b>\n<16fb> <652a>\n<16fc> <66ec>\n<16fd> <6b10>\n<16fe> <74da>\n<16ff> <7aca>\n<1700> <7c64>\n<1701> <7c63>\n<1702> <7c65>\n<1703> <7e93>\n<1704> <7e96>\n<1705> <7e94>\n<1706> <81e2>\n<1707> <8638>\n<1708> <863f>\n<1709> <8831>\n<170a> <8b8a>\n<170b> <9090>\n<170c> <908f>\n<170d> <9463>\n<170e> <9460>\n<170f> <9464>\n<1710> <9768>\n<1711> <986f>\n<1712> <995c>\n<1715> <9a57>\n<1718> <9ad1>\n<1719> <9c54>\n<171a> <9c57>\n<171b> <9c56>\n<171c> <9de5>\n<171d> <9e9f>\n<171e> <9ef4>\n<171f> <56d1>\n<1720> <58e9>\n<1721> <652c>\n<1722> <705e>\n<1725> <77d7>\n<1726> <7f50>\n<1727> <7f88>\n<1728> <8836>\n<1729> <8839>\n<172a> <8862>\n<172b> <8b93>\n<172c> <8b92>\n<172d> <8b96>\n<172e> <8277>\n<172f> <8d1b>\n<1730> <91c0>\n<1731> <946a>\n<1732> <9742>\n<1733> <9748>\n<1734> <9744>\n<1735> <97c6>\n<1736> <9870>\n<1737> <9a5f>\n<1738> <9b22>\n<1739> <9b58>\n<173a> <9c5f>\n<173f> <9f07>\n<1740> <9f77>\n<1741> <9f72>\n<1742> <5ef3>\n<1743> <6b16>\n<1744> <7063>\n<1745> <7c6c>\n<1746> <7c6e>\n<1747> <883b>\n<1748> <89c0>\n<1749> <8ea1>\n<174a> <91c1>\n<174b> <9472>\n<174c> <9470>\n<174d> <9871>\n<174e> <995e>\n<174f> <9ad6>\n<1750> <9b23>\nendbfchar\n\n100 beginbfchar\n<1751> <9ecc>\n<1752> <7064>\n<1753> <77da>\n<1754> <8b9a>\n<1755> <9477>\n<1756> <97c9>\n<1757> <9a62>\n<1758> <9a65>\n<1759> <7e9c>\n<175a> <8b9c>\n<175b> <8eaa>\n<175c> <91c5>\n<175f> <947c>\n<1762> <9ef7>\n<1763> <8c54>\n<1764> <947f>\n<1765> <9e1a>\n<1766> <7228>\n<1767> <9a6a>\n<1768> <9b31>\n<1769> <9e1b>\n<176a> <9e1e>\n<176b> <7c72>\n<176c> <4e42>\n<176d> <4e5c>\n<176e> <51f5>\n<176f> <531a>\n<1770> <5382>\n<1771> <4e07>\n<1772> <4e0c>\n<1773> <4e47>\n<1774> <4e8d>\n<1775> <56d7>\n<1776> <5c6e>\n<1777> <5f73>\n<1778> <4e0f>\n<1779> <5187>\n<177a> <4e0e>\n<177b> <4e2e>\n<177c> <4e93>\n<177d> <4ec2>\n<177e> <4ec9>\n<177f> <4ec8>\n<1780> <5198>\n<1781> <52fc>\n<1782> <536c>\n<1783> <53b9>\n<1784> <5720>\n<1785> <5903>\n<1786> <592c>\n<1787> <5c10>\n<1788> <5dff>\n<1789> <65e1>\n<178a> <6bb3>\n<178b> <6bcc>\n<178c> <6c14>\n<178d> <723f>\n<178e> <4e31>\n<178f> <4e3c>\n<1790> <4ee8>\n<1791> <4edc>\n<1792> <4ee9>\n<1793> <4ee1>\n<1794> <4edd>\n<1795> <4eda>\n<1796> <520c>\n<1797> <5209>\n<1798> <531c>\n<1799> <534c>\n<179c> <5917>\n<179d> <592f>\n<179e> <5b81>\n<179f> <5b84>\n<17a0> <5c12>\n<17a1> <5c3b>\n<17a2> <5c74>\n<17a3> <5c73>\n<17a4> <5e04>\n<17a5> <5e80>\n<17a6> <5e82>\n<17a7> <5fc9>\n<17a8> <6209>\n<17a9> <6250>\n<17aa> <6c15>\n<17ab> <6c36>\n<17ac> <6c43>\n<17ad> <6c3f>\n<17ae> <6c3b>\n<17af> <72ae>\n<17b0> <72b0>\n<17b1> <738a>\n<17b2> <79b8>\n<17b3> <808a>\n<17b4> <961e>\n<17b5> <4f0e>\n<17b6> <4f18>\n<17b7> <4f2c>\n<17b8> <4ef5>\n<17b9> <4f14>\n<17ba> <4ef1>\nendbfchar\n\n100 beginbfchar\n<17bb> <4f00>\n<17bc> <4ef7>\n<17bd> <4f08>\n<17be> <4f1d>\n<17bf> <4f02>\n<17c0> <4f05>\n<17c1> <4f22>\n<17c2> <4f13>\n<17c3> <4f04>\n<17c4> <4ef4>\n<17c5> <4f12>\n<17c6> <51b1>\n<17c7> <5213>\n<17c8> <5210>\n<17c9> <52a6>\n<17ca> <5322>\n<17cb> <531f>\n<17cc> <534d>\n<17cd> <538a>\n<17ce> <5407>\n<17cf> <56e1>\n<17d0> <56df>\n<17d1> <572e>\n<17d2> <572a>\n<17d3> <5734>\n<17d4> <593c>\n<17d5> <5980>\n<17d6> <597c>\n<17d7> <5985>\n<17d8> <597b>\n<17d9> <597e>\n<17da> <5977>\n<17db> <597f>\n<17dc> <5b56>\n<17dd> <5c15>\n<17de> <5c25>\n<17df> <5c7c>\n<17e2> <5c7e>\n<17e3> <5ddf>\n<17e4> <5e75>\n<17e5> <5e84>\n<17e6> <5f02>\n<17e7> <5f1a>\n<17e8> <5f74>\n<17e9> <5fd5>\n<17ea> <5fd4>\n<17eb> <5fcf>\n<17ec> <625c>\n<17ed> <625e>\n<17ee> <6264>\n<17ef> <6261>\n<17f0> <6266>\n<17f1> <6262>\n<17f2> <6259>\n<17f3> <6260>\n<17f4> <625a>\n<17f5> <6265>\n<17f6> <6537>\n<17f7> <65ef>\n<17f8> <65ee>\n<17f9> <673e>\n<17fa> <6739>\n<17fb> <6738>\n<17fc> <673b>\n<17fd> <673a>\n<17fe> <673f>\n<17ff> <673c>\n<1800> <6733>\n<1801> <6c18>\n<1802> <6c46>\n<1803> <6c52>\n<1804> <6c5c>\n<1805> <6c4f>\n<1806> <6c4a>\n<1807> <6c54>\n<180a> <7071>\n<180b> <725e>\n<180e> <738e>\n<180f> <752a>\n<1810> <767f>\n<1811> <7a75>\n<1812> <7f51>\n<1813> <8278>\n<1814> <827c>\n<1815> <8280>\n<1816> <827d>\n<1817> <827f>\n<1818> <864d>\n<1819> <897e>\n<181a> <9099>\n<181d> <909b>\n<181e> <9094>\n<181f> <9622>\n<1820> <9624>\n<1821> <9620>\n<1822> <9623>\n<1823> <4f56>\n<1824> <4f3b>\n<1825> <4f62>\n<1826> <4f49>\nendbfchar\n\n100 beginbfchar\n<1827> <4f53>\n<1828> <4f64>\n<1829> <4f3e>\n<182a> <4f67>\n<182b> <4f52>\n<182c> <4f5f>\n<182d> <4f41>\n<182e> <4f58>\n<182f> <4f2d>\n<1830> <4f33>\n<1831> <4f3f>\n<1832> <4f61>\n<1833> <518f>\n<1834> <51b9>\n<1835> <521c>\n<1836> <521e>\n<1837> <5221>\n<183a> <5309>\n<183b> <5363>\n<183c> <5372>\n<183f> <5430>\n<1840> <5437>\n<1841> <542a>\n<1842> <5454>\n<1843> <5445>\n<1844> <5419>\n<1845> <541c>\n<1846> <5425>\n<1847> <5418>\n<1848> <543d>\n<1849> <544f>\n<184a> <5441>\n<184b> <5428>\n<184c> <5424>\n<184d> <5447>\n<184e> <56ee>\n<184f> <56e7>\n<1850> <56e5>\n<1851> <5741>\n<1852> <5745>\n<1853> <574c>\n<1854> <5749>\n<1855> <574b>\n<1856> <5752>\n<1857> <5906>\n<1858> <5940>\n<1859> <59a6>\n<185a> <5998>\n<185b> <59a0>\n<185c> <5997>\n<185d> <598e>\n<185e> <59a2>\n<185f> <5990>\n<1860> <598f>\n<1861> <59a7>\n<1862> <59a1>\n<1863> <5b8e>\n<1864> <5b92>\n<1865> <5c28>\n<1866> <5c2a>\n<1867> <5c8d>\n<1868> <5c8f>\n<1869> <5c88>\n<186a> <5c8b>\n<186b> <5c89>\n<186c> <5c92>\n<186d> <5c8a>\n<186e> <5c86>\n<186f> <5c93>\n<1870> <5c95>\n<1871> <5de0>\n<1872> <5e0a>\n<1873> <5e0e>\n<1874> <5e8b>\n<1875> <5e89>\n<1876> <5e8c>\n<1877> <5e88>\n<1878> <5e8d>\n<1879> <5f05>\n<187a> <5f1d>\n<187b> <5f78>\n<187c> <5f76>\n<187d> <5fd2>\n<187e> <5fd1>\n<187f> <5fd0>\n<1880> <5fed>\n<1881> <5fe8>\n<1882> <5fee>\n<1883> <5ff3>\n<1884> <5fe1>\n<1885> <5fe4>\n<1886> <5fe3>\n<1887> <5ffa>\n<1888> <5fef>\n<1889> <5ff7>\n<188a> <5ffb>\n<188b> <6000>\n<188c> <5ff4>\n<188d> <623a>\n<188e> <6283>\nendbfchar\n\n100 beginbfchar\n<188f> <628c>\n<1892> <6294>\n<1893> <6287>\n<1894> <6271>\n<1895> <627b>\n<1896> <627a>\n<1897> <6270>\n<1898> <6281>\n<1899> <6288>\n<189a> <6277>\n<189b> <627d>\n<189c> <6272>\n<189d> <6274>\n<189e> <65f0>\n<189f> <65f4>\n<18a0> <65f3>\n<18a1> <65f2>\n<18a2> <65f5>\n<18a3> <6745>\n<18a4> <6747>\n<18a5> <6759>\n<18a6> <6755>\n<18a7> <674c>\n<18a8> <6748>\n<18a9> <675d>\n<18aa> <674d>\n<18ab> <675a>\n<18ac> <674b>\n<18ad> <6bd0>\n<18b0> <6c78>\n<18b1> <6c67>\n<18b2> <6c6b>\n<18b3> <6c84>\n<18b4> <6c8b>\n<18b5> <6c8f>\n<18b6> <6c71>\n<18b7> <6c6f>\n<18b8> <6c69>\n<18b9> <6c9a>\n<18ba> <6c6d>\n<18bb> <6c87>\n<18bc> <6c95>\n<18bd> <6c9c>\n<18be> <6c66>\n<18bf> <6c73>\n<18c0> <6c65>\n<18c1> <6c7b>\n<18c2> <6c8e>\n<18c3> <7074>\n<18c4> <707a>\n<18c5> <7263>\n<18c6> <72bf>\n<18c7> <72bd>\n<18c8> <72c3>\n<18c9> <72c6>\n<18ca> <72c1>\n<18cb> <72ba>\n<18cc> <72c5>\n<18cd> <7395>\n<18ce> <7397>\n<18d1> <7392>\n<18d2> <753a>\n<18d3> <7539>\n<18d6> <7681>\n<18d7> <793d>\n<18d8> <8034>\n<18d9> <8095>\n<18da> <8099>\n<18db> <8090>\n<18dc> <8092>\n<18dd> <809c>\n<18de> <8290>\n<18df> <828f>\n<18e0> <8285>\n<18e1> <828e>\n<18e2> <8291>\n<18e3> <8293>\n<18e4> <828a>\n<18e7> <8c78>\n<18e8> <8fc9>\n<18e9> <8fbf>\n<18ea> <909f>\n<18eb> <90a1>\n<18ec> <90a5>\n<18ed> <909e>\n<18ee> <90a7>\n<18ef> <90a0>\n<18f0> <9630>\n<18f1> <9628>\n<18f2> <962f>\n<18f3> <962d>\n<18f4> <4e33>\n<18f5> <4f98>\n<18f6> <4f7c>\n<18f7> <4f85>\n<18f8> <4f7d>\n<18f9> <4f80>\n<18fa> <4f87>\n<18fb> <4f76>\n<18fc> <4f74>\nendbfchar\n\n100 beginbfchar\n<18fd> <4f89>\n<18fe> <4f84>\n<18ff> <4f77>\n<1900> <4f4c>\n<1901> <4f97>\n<1902> <4f6a>\n<1903> <4f9a>\n<1904> <4f79>\n<1905> <4f81>\n<1906> <4f78>\n<1907> <4f90>\n<1908> <4f9c>\n<1909> <4f94>\n<190a> <4f9e>\n<190b> <4f92>\n<190c> <4f82>\n<190d> <4f95>\n<190e> <4f6b>\n<190f> <4f6e>\n<1910> <519e>\n<1911> <51bc>\n<1912> <51be>\n<1913> <5235>\n<1916> <5246>\n<1917> <5231>\n<1918> <52bc>\n<191b> <533c>\n<191c> <5392>\n<191d> <5394>\n<191e> <5487>\n<191f> <547f>\n<1920> <5481>\n<1921> <5491>\n<1922> <5482>\n<1923> <5488>\n<1924> <546b>\n<1925> <547a>\n<1926> <547e>\n<1927> <5465>\n<1928> <546c>\n<1929> <5474>\n<192a> <5466>\n<192b> <548d>\n<192c> <546f>\n<192d> <5461>\n<192e> <5460>\n<192f> <5498>\n<1930> <5463>\n<1931> <5467>\n<1932> <5464>\n<1933> <56f7>\n<1934> <56f9>\n<1935> <576f>\n<1936> <5772>\n<1937> <576d>\n<1938> <576b>\n<1939> <5771>\n<193a> <5770>\n<193b> <5776>\n<193c> <5780>\n<193d> <5775>\n<193e> <577b>\n<1941> <5762>\n<1942> <5768>\n<1943> <577d>\n<1944> <590c>\n<1945> <5945>\n<1946> <59b5>\n<1947> <59ba>\n<1948> <59cf>\n<1949> <59ce>\n<194a> <59b2>\n<194b> <59cc>\n<194c> <59c1>\n<194d> <59b6>\n<194e> <59bc>\n<194f> <59c3>\n<1950> <59d6>\n<1951> <59b1>\n<1952> <59bd>\n<1953> <59c0>\n<1954> <59c8>\n<1955> <59b4>\n<1956> <59c7>\n<1957> <5b62>\n<1958> <5b65>\n<1959> <5b93>\n<195a> <5b95>\n<195b> <5c44>\n<195c> <5c47>\n<195d> <5cae>\n<195e> <5ca4>\n<195f> <5ca0>\n<1960> <5cb5>\n<1961> <5caf>\n<1962> <5ca8>\n<1963> <5cac>\n<1964> <5c9f>\n<1965> <5ca3>\n<1966> <5cad>\nendbfchar\n\n100 beginbfchar\n<1967> <5ca2>\n<1968> <5caa>\n<1969> <5ca7>\n<196a> <5c9d>\n<196b> <5ca5>\n<196c> <5cb6>\n<196d> <5cb0>\n<196e> <5ca6>\n<196f> <5e17>\n<1970> <5e14>\n<1971> <5e19>\n<1972> <5f28>\n<1976> <5f54>\n<1977> <5f82>\n<1978> <5f7e>\n<1979> <5f7d>\n<197a> <5fde>\n<197b> <5fe5>\n<197c> <602d>\n<197d> <6026>\n<197e> <6019>\n<197f> <6032>\n<1980> <600b>\n<1981> <6034>\n<1982> <600a>\n<1983> <6017>\n<1984> <6033>\n<1985> <601a>\n<1986> <601e>\n<1987> <602c>\n<1988> <6022>\n<1989> <600d>\n<198a> <6010>\n<198b> <602e>\n<198c> <6013>\n<198d> <6011>\n<198e> <600c>\n<198f> <6009>\n<1990> <601c>\n<1991> <6214>\n<1992> <623d>\n<1993> <62ad>\n<1994> <62b4>\n<1995> <62d1>\n<1996> <62be>\n<1997> <62aa>\n<1998> <62b6>\n<1999> <62ca>\n<199a> <62ae>\n<199b> <62b3>\n<199c> <62af>\n<199d> <62bb>\n<199e> <62a9>\n<199f> <62b0>\n<19a0> <62b8>\n<19a1> <653d>\n<19a2> <65a8>\n<19a3> <65bb>\n<19a4> <6609>\n<19a5> <65fc>\n<19a6> <6604>\n<19a7> <6612>\n<19a8> <6608>\n<19a9> <65fb>\n<19aa> <6603>\n<19ab> <660b>\n<19ac> <660d>\n<19ad> <6605>\n<19ae> <65fd>\n<19af> <6611>\n<19b0> <6610>\n<19b1> <66f6>\n<19b2> <670a>\n<19b3> <6785>\n<19b4> <676c>\n<19b5> <678e>\n<19b6> <6792>\n<19b7> <6776>\n<19b8> <677b>\n<19b9> <6798>\n<19ba> <6786>\n<19bb> <6784>\n<19bc> <6774>\n<19bd> <678d>\n<19be> <678c>\n<19bf> <677a>\n<19c0> <679f>\n<19c1> <6791>\n<19c2> <6799>\n<19c3> <6783>\n<19c4> <677d>\n<19c5> <6781>\n<19c8> <6794>\n<19c9> <6b25>\n<19ca> <6b80>\n<19cb> <6b7e>\n<19cc> <6bde>\n<19cd> <6c1d>\n<19ce> <6c93>\n<19cf> <6cec>\nendbfchar\n\n100 beginbfchar\n<19d0> <6ceb>\n<19d1> <6cee>\n<19d2> <6cd9>\n<19d3> <6cb6>\n<19d4> <6cd4>\n<19d5> <6cad>\n<19d6> <6ce7>\n<19d7> <6cb7>\n<19d8> <6cd0>\n<19d9> <6cc2>\n<19da> <6cba>\n<19db> <6cc3>\n<19dc> <6cc6>\n<19dd> <6ced>\n<19de> <6cf2>\n<19df> <6cd2>\n<19e0> <6cdd>\n<19e1> <6cb4>\n<19e2> <6c8a>\n<19e3> <6c9d>\n<19e4> <6c80>\n<19e5> <6cde>\n<19e6> <6cc0>\n<19e7> <6d30>\n<19e8> <6ccd>\n<19e9> <6cc7>\n<19ea> <6cb0>\n<19eb> <6cf9>\n<19ec> <6ccf>\n<19ed> <6ce9>\n<19ee> <6cd1>\n<19ef> <7094>\n<19f0> <7098>\n<19f1> <7085>\n<19f2> <7093>\n<19f3> <7086>\n<19f4> <7084>\n<19f5> <7091>\n<19f6> <7096>\n<19f7> <7082>\n<19f8> <709a>\n<19f9> <7083>\n<19fa> <726a>\n<19fb> <72d6>\n<19fc> <72cb>\n<19fd> <72d8>\n<19fe> <72c9>\n<19ff> <72dc>\n<1a00> <72d2>\n<1a01> <72d4>\n<1a02> <72da>\n<1a03> <72cc>\n<1a04> <72d1>\n<1a05> <73a4>\n<1a06> <73a1>\n<1a07> <73ad>\n<1a08> <73a6>\n<1a09> <73a2>\n<1a0a> <73a0>\n<1a0b> <73ac>\n<1a0c> <739d>\n<1a0d> <74dd>\n<1a0e> <74e8>\n<1a11> <753e>\n<1a12> <758c>\n<1a13> <7598>\n<1a14> <76af>\n<1a15> <76f3>\n<1a16> <76f1>\n<1a17> <76f0>\n<1a18> <76f5>\n<1a19> <77f8>\n<1a1a> <77fc>\n<1a1b> <77f9>\n<1a1c> <77fb>\n<1a1d> <77fa>\n<1a1e> <77f7>\n<1a1f> <7942>\n<1a20> <793f>\n<1a21> <79c5>\n<1a22> <7a78>\n<1a23> <7a7b>\n<1a24> <7afb>\n<1a25> <7c75>\n<1a26> <7cfd>\n<1a27> <8035>\n<1a28> <808f>\n<1a29> <80ae>\n<1a2a> <80a3>\n<1a2b> <80b8>\n<1a2c> <80b5>\n<1a2d> <80ad>\n<1a2e> <8220>\n<1a2f> <82a0>\n<1a30> <82c0>\n<1a31> <82ab>\n<1a32> <829a>\n<1a33> <8298>\n<1a34> <829b>\n<1a35> <82b5>\nendbfchar\n\n100 beginbfchar\n<1a36> <82a7>\n<1a37> <82ae>\n<1a38> <82bc>\n<1a39> <829e>\n<1a3a> <82ba>\n<1a3b> <82b4>\n<1a3c> <82a8>\n<1a3d> <82a1>\n<1a3e> <82a9>\n<1a3f> <82c2>\n<1a40> <82a4>\n<1a41> <82c3>\n<1a42> <82b6>\n<1a43> <82a2>\n<1a44> <8670>\n<1a45> <866f>\n<1a48> <8c56>\n<1a49> <8fd2>\n<1a4a> <8fcb>\n<1a4b> <8fd3>\n<1a4c> <8fcd>\n<1a4d> <8fd6>\n<1a4e> <8fd5>\n<1a4f> <8fd7>\n<1a50> <90b2>\n<1a51> <90b4>\n<1a52> <90af>\n<1a53> <90b3>\n<1a54> <90b0>\n<1a55> <9639>\n<1a56> <963d>\n<1a57> <963c>\n<1a58> <963a>\n<1a59> <9643>\n<1a5a> <4fcd>\n<1a5b> <4fc5>\n<1a5c> <4fd3>\n<1a5d> <4fb2>\n<1a5e> <4fc9>\n<1a5f> <4fcb>\n<1a60> <4fc1>\n<1a61> <4fd4>\n<1a62> <4fdc>\n<1a63> <4fd9>\n<1a64> <4fbb>\n<1a65> <4fb3>\n<1a66> <4fdb>\n<1a67> <4fc7>\n<1a68> <4fd6>\n<1a69> <4fba>\n<1a6a> <4fc0>\n<1a6b> <4fb9>\n<1a6c> <4fec>\n<1a6d> <5244>\n<1a6e> <5249>\n<1a6f> <52c0>\n<1a70> <52c2>\n<1a71> <533d>\n<1a72> <537c>\n<1a73> <5397>\n<1a74> <5396>\n<1a75> <5399>\n<1a76> <5398>\n<1a77> <54ba>\n<1a78> <54a1>\n<1a79> <54ad>\n<1a7a> <54a5>\n<1a7b> <54cf>\n<1a7c> <54c3>\n<1a7d> <830d>\n<1a7e> <54b7>\n<1a7f> <54ae>\n<1a80> <54d6>\n<1a81> <54b6>\n<1a84> <54a0>\n<1a85> <5470>\n<1a86> <54bc>\n<1a87> <54a2>\n<1a88> <54be>\n<1a89> <5472>\n<1a8a> <54de>\n<1a8b> <54b0>\n<1a8c> <57b5>\n<1a8f> <57a4>\n<1a90> <578c>\n<1a91> <5797>\n<1a92> <579d>\n<1a93> <579b>\n<1a94> <5794>\n<1a95> <5798>\n<1a96> <578f>\n<1a97> <5799>\n<1a98> <57a5>\n<1a99> <579a>\n<1a9a> <5795>\n<1a9b> <58f4>\n<1a9c> <590d>\n<1a9d> <5953>\n<1a9e> <59e1>\n<1a9f> <59de>\nendbfchar\n\n100 beginbfchar\n<1aa0> <59ee>\n<1aa1> <5a00>\n<1aa2> <59f1>\n<1aa3> <59dd>\n<1aa4> <59fa>\n<1aa5> <59fd>\n<1aa6> <59fc>\n<1aa7> <59f6>\n<1aa8> <59e4>\n<1aa9> <59f2>\n<1aaa> <59f7>\n<1aab> <59db>\n<1aac> <59e9>\n<1aad> <59f3>\n<1aae> <59f5>\n<1aaf> <59e0>\n<1ab0> <59fe>\n<1ab1> <59f4>\n<1ab2> <59ed>\n<1ab3> <5ba8>\n<1ab4> <5c4c>\n<1ab5> <5cd0>\n<1ab6> <5cd8>\n<1ab7> <5ccc>\n<1ab8> <5cd7>\n<1ab9> <5ccb>\n<1aba> <5cdb>\n<1abb> <5cde>\n<1abc> <5cda>\n<1abd> <5cc9>\n<1abe> <5cc7>\n<1abf> <5cca>\n<1ac0> <5cd6>\n<1ac3> <5ccf>\n<1ac4> <5cc8>\n<1ac5> <5cc6>\n<1ac6> <5cce>\n<1ac7> <5cdf>\n<1ac8> <5cf8>\n<1ac9> <5df9>\n<1acd> <5e20>\n<1ace> <5e24>\n<1acf> <5eb0>\n<1ad0> <5ea4>\n<1ad1> <5ea2>\n<1ad2> <5e9b>\n<1ad3> <5ea3>\n<1ad4> <5ea5>\n<1ad5> <5f07>\n<1ad6> <5f2e>\n<1ad7> <5f56>\n<1ad8> <5f86>\n<1ad9> <6037>\n<1ada> <6039>\n<1adb> <6054>\n<1adc> <6072>\n<1add> <605e>\n<1ade> <6045>\n<1adf> <6053>\n<1ae0> <6047>\n<1ae1> <6049>\n<1ae2> <605b>\n<1ae3> <604c>\n<1ae4> <6040>\n<1ae5> <6042>\n<1ae6> <605f>\n<1ae7> <6024>\n<1ae8> <6044>\n<1ae9> <6058>\n<1aea> <6066>\n<1aeb> <606e>\n<1aee> <62cf>\n<1aef> <630d>\n<1af0> <630b>\n<1af1> <62f5>\n<1af2> <630e>\n<1af3> <6303>\n<1af4> <62eb>\n<1af5> <62f9>\n<1af6> <630f>\n<1af7> <630c>\n<1af8> <62f8>\n<1af9> <62f6>\n<1afa> <6300>\n<1afd> <62fa>\n<1afe> <6315>\n<1aff> <62fb>\n<1b00> <62f0>\n<1b01> <6541>\n<1b02> <6543>\n<1b03> <65aa>\n<1b04> <65bf>\n<1b05> <6636>\n<1b06> <6621>\n<1b07> <6632>\n<1b08> <6635>\n<1b09> <661c>\n<1b0a> <6626>\n<1b0b> <6622>\n<1b0c> <6633>\nendbfchar\n\n100 beginbfchar\n<1b0d> <662b>\n<1b0e> <663a>\n<1b0f> <661d>\n<1b10> <6634>\n<1b11> <6639>\n<1b12> <662e>\n<1b15> <67c1>\n<1b16> <67f2>\n<1b17> <67c8>\n<1b18> <67ba>\n<1b19> <67dc>\n<1b1a> <67bb>\n<1b1b> <67f8>\n<1b1c> <67d8>\n<1b1d> <67c0>\n<1b1e> <67b7>\n<1b1f> <67c5>\n<1b20> <67eb>\n<1b21> <67e4>\n<1b22> <67df>\n<1b23> <67b5>\n<1b24> <67cd>\n<1b25> <67b3>\n<1b26> <67f7>\n<1b27> <67f6>\n<1b28> <67ee>\n<1b29> <67e3>\n<1b2a> <67c2>\n<1b2b> <67b9>\n<1b2c> <67ce>\n<1b2d> <67e7>\n<1b2e> <67f0>\n<1b2f> <67b2>\n<1b30> <67fc>\n<1b31> <67c6>\n<1b32> <67ed>\n<1b33> <67cc>\n<1b34> <67ae>\n<1b35> <67e6>\n<1b36> <67db>\n<1b37> <67fa>\n<1b3a> <67c3>\n<1b3b> <67ea>\n<1b3c> <67cb>\n<1b3d> <6b28>\n<1b3e> <6b82>\n<1b3f> <6b84>\n<1b40> <6bb6>\n<1b41> <6bd6>\n<1b42> <6bd8>\n<1b43> <6be0>\n<1b46> <6d28>\n<1b47> <6d34>\n<1b48> <6d2d>\n<1b49> <6d1f>\n<1b4a> <6d3c>\n<1b4b> <6d3f>\n<1b4c> <6d12>\n<1b4d> <6d0a>\n<1b4e> <6cda>\n<1b4f> <6d33>\n<1b50> <6d04>\n<1b51> <6d19>\n<1b52> <6d3a>\n<1b53> <6d1a>\n<1b54> <6d11>\n<1b55> <6d00>\n<1b56> <6d1d>\n<1b57> <6d42>\n<1b58> <6d01>\n<1b59> <6d18>\n<1b5a> <6d37>\n<1b5b> <6d03>\n<1b5c> <6d0f>\n<1b5d> <6d40>\n<1b5e> <6d07>\n<1b5f> <6d20>\n<1b60> <6d2c>\n<1b61> <6d08>\n<1b62> <6d22>\n<1b63> <6d09>\n<1b64> <6d10>\n<1b65> <70b7>\n<1b66> <709f>\n<1b67> <70be>\n<1b68> <70b1>\n<1b69> <70b0>\n<1b6a> <70a1>\n<1b6d> <70a9>\n<1b6e> <7241>\n<1b71> <726c>\n<1b72> <7270>\n<1b73> <7273>\n<1b74> <726e>\n<1b75> <72ca>\n<1b76> <72e4>\n<1b77> <72e8>\n<1b78> <72eb>\n<1b79> <72df>\n<1b7a> <72ea>\nendbfchar\n\n100 beginbfchar\n<1b7b> <72e6>\n<1b7c> <72e3>\n<1b7d> <7385>\n<1b7e> <73cc>\n<1b7f> <73c2>\n<1b80> <73c8>\n<1b81> <73c5>\n<1b82> <73b9>\n<1b83> <73b6>\n<1b84> <73b5>\n<1b85> <73b4>\n<1b86> <73eb>\n<1b87> <73bf>\n<1b88> <73c7>\n<1b89> <73be>\n<1b8a> <73c3>\n<1b8b> <73c6>\n<1b8c> <73b8>\n<1b8d> <73cb>\n<1b8e> <74ec>\n<1b8f> <74ee>\n<1b90> <752e>\n<1b93> <75a7>\n<1b94> <75aa>\n<1b95> <7679>\n<1b96> <76c4>\n<1b97> <7708>\n<1b9b> <770a>\n<1b9c> <76f7>\n<1b9d> <76fb>\n<1b9e> <76fa>\n<1ba1> <7806>\n<1ba4> <7805>\n<1ba5> <7810>\n<1ba6> <780f>\n<1ba7> <780e>\n<1ba8> <7809>\n<1ba9> <7803>\n<1baa> <7813>\n<1bab> <794a>\n<1bac> <794c>\n<1bad> <794b>\n<1bae> <7945>\n<1baf> <7944>\n<1bb0> <79d5>\n<1bb1> <79cd>\n<1bb2> <79cf>\n<1bb3> <79d6>\n<1bb4> <79ce>\n<1bb5> <7a80>\n<1bb6> <7a7e>\n<1bb7> <7ad1>\n<1bba> <7c7a>\n<1bc0> <7d03>\n<1bc1> <7d08>\n<1bc2> <7d01>\n<1bc3> <7f58>\n<1bc4> <7f91>\n<1bc5> <7f8d>\n<1bc6> <7fbe>\n<1bc7> <8007>\n<1bca> <8014>\n<1bcb> <8037>\n<1bcc> <80d8>\n<1bcd> <80c7>\n<1bce> <80e0>\n<1bcf> <80d1>\n<1bd0> <80c8>\n<1bd1> <80c2>\n<1bd2> <80d0>\n<1bd3> <80c5>\n<1bd4> <80e3>\n<1bd5> <80d9>\n<1bd6> <80dc>\n<1bd7> <80ca>\n<1bd8> <80d5>\n<1bd9> <80c9>\n<1bda> <80cf>\n<1bdb> <80d7>\n<1bdc> <80e6>\n<1bdd> <80cd>\n<1bde> <81ff>\n<1bdf> <8221>\n<1be0> <8294>\n<1be1> <82d9>\n<1be2> <82fe>\n<1be3> <82f9>\n<1be4> <8307>\n<1be5> <82e8>\n<1be6> <8300>\n<1be7> <82d5>\n<1be8> <833a>\n<1be9> <82eb>\n<1bea> <82d6>\n<1beb> <82f4>\n<1bec> <82ec>\n<1bed> <82e1>\n<1bee> <82f2>\n<1bef> <82f5>\n<1bf0> <830c>\nendbfchar\n\n100 beginbfchar\n<1bf1> <82fb>\n<1bf2> <82f6>\n<1bf3> <82f0>\n<1bf4> <82ea>\n<1bf5> <82e4>\n<1bf6> <82e0>\n<1bf7> <82fa>\n<1bf8> <82f3>\n<1bf9> <82ed>\n<1bfa> <8677>\n<1bfb> <8674>\n<1bfc> <867c>\n<1bfd> <8673>\n<1bfe> <8841>\n<1bff> <884e>\n<1c00> <8867>\n<1c01> <886a>\n<1c02> <8869>\n<1c03> <89d3>\n<1c04> <8a04>\n<1c05> <8a07>\n<1c06> <8d72>\n<1c07> <8fe3>\n<1c08> <8fe1>\n<1c09> <8fee>\n<1c0a> <8fe0>\n<1c0b> <90f1>\n<1c0c> <90bd>\n<1c0d> <90bf>\n<1c0e> <90d5>\n<1c0f> <90c5>\n<1c10> <90be>\n<1c11> <90c7>\n<1c12> <90cb>\n<1c13> <90c8>\n<1c14> <91d4>\n<1c15> <91d3>\n<1c16> <9654>\n<1c17> <964f>\n<1c18> <9651>\n<1c19> <9653>\n<1c1a> <964a>\n<1c1b> <964e>\n<1c1c> <501e>\n<1c1d> <5005>\n<1c1e> <5007>\n<1c1f> <5013>\n<1c20> <5022>\n<1c21> <5030>\n<1c22> <501b>\n<1c23> <4ff5>\n<1c24> <4ff4>\n<1c25> <5033>\n<1c26> <5037>\n<1c27> <502c>\n<1c2a> <5017>\n<1c2b> <501c>\n<1c2c> <5020>\n<1c2d> <5027>\n<1c2e> <5035>\n<1c2f> <502f>\n<1c30> <5031>\n<1c31> <500e>\n<1c32> <515a>\n<1c33> <5194>\n<1c34> <5193>\n<1c35> <51ca>\n<1c38> <51c8>\n<1c39> <51ce>\n<1c3a> <5261>\n<1c3b> <525a>\n<1c3c> <5252>\n<1c3f> <5255>\n<1c40> <5262>\n<1c41> <52cd>\n<1c42> <530e>\n<1c43> <539e>\n<1c44> <5526>\n<1c45> <54e2>\n<1c46> <5517>\n<1c47> <5512>\n<1c48> <54e7>\n<1c49> <54f3>\n<1c4a> <54e4>\n<1c4b> <551a>\n<1c4c> <54ff>\n<1c4d> <5504>\n<1c4e> <5508>\n<1c4f> <54eb>\n<1c50> <5511>\n<1c51> <5505>\n<1c52> <54f1>\n<1c53> <550a>\n<1c54> <54fb>\n<1c57> <54e0>\n<1c58> <550e>\n<1c59> <5503>\n<1c5a> <550b>\n<1c5d> <57cc>\n<1c5e> <5832>\nendbfchar\n\n100 beginbfchar\n<1c5f> <57d5>\n<1c60> <57d2>\n<1c61> <57ba>\n<1c62> <57c6>\n<1c63> <57bd>\n<1c64> <57bc>\n<1c65> <57b8>\n<1c66> <57b6>\n<1c67> <57bf>\n<1c68> <57c7>\n<1c69> <57d0>\n<1c6a> <57b9>\n<1c6b> <57c1>\n<1c6c> <590e>\n<1c6d> <594a>\n<1c6e> <5a19>\n<1c6f> <5a16>\n<1c72> <5a15>\n<1c73> <5a0f>\n<1c74> <5a17>\n<1c75> <5a0a>\n<1c76> <5a1e>\n<1c77> <5a33>\n<1c78> <5b6c>\n<1c79> <5ba7>\n<1c7a> <5bad>\n<1c7b> <5bac>\n<1c7c> <5c03>\n<1c7d> <5c56>\n<1c7e> <5c54>\n<1c7f> <5cec>\n<1c80> <5cff>\n<1c81> <5cee>\n<1c82> <5cf1>\n<1c83> <5cf7>\n<1c84> <5d00>\n<1c85> <5cf9>\n<1c86> <5e29>\n<1c87> <5e28>\n<1c88> <5ea8>\n<1c89> <5eae>\n<1c8a> <5eaa>\n<1c8b> <5eac>\n<1c8c> <5f33>\n<1c8d> <5f30>\n<1c8e> <5f67>\n<1c8f> <605d>\n<1c90> <605a>\n<1c91> <6067>\n<1c92> <6041>\n<1c93> <60a2>\n<1c94> <6088>\n<1c95> <6080>\n<1c96> <6092>\n<1c97> <6081>\n<1c98> <609d>\n<1c99> <6083>\n<1c9a> <6095>\n<1c9b> <609b>\n<1c9c> <6097>\n<1c9d> <6087>\n<1c9e> <609c>\n<1c9f> <608e>\n<1ca0> <6219>\n<1ca1> <6246>\n<1ca2> <62f2>\n<1ca3> <6310>\n<1ca4> <6356>\n<1ca5> <632c>\n<1ca8> <6336>\n<1ca9> <6343>\n<1caa> <63e4>\n<1cab> <6339>\n<1cac> <634b>\n<1cad> <634a>\n<1cae> <633c>\n<1caf> <6329>\n<1cb0> <6341>\n<1cb1> <6334>\n<1cb2> <6358>\n<1cb3> <6354>\n<1cb4> <6359>\n<1cb5> <632d>\n<1cb6> <6347>\n<1cb7> <6333>\n<1cb8> <635a>\n<1cb9> <6351>\n<1cba> <6338>\n<1cbb> <6357>\n<1cbc> <6340>\n<1cbd> <6348>\n<1cbe> <654a>\n<1cbf> <6546>\n<1cc0> <65c6>\n<1cc3> <65c2>\n<1cc4> <664a>\n<1cc5> <665f>\n<1cc6> <6647>\n<1cc7> <6651>\n<1cca> <681f>\nendbfchar\n\n100 beginbfchar\n<1ccb> <681a>\n<1ccc> <6849>\n<1ccf> <683b>\n<1cd0> <684b>\n<1cd1> <684f>\n<1cd2> <6816>\n<1cd3> <6831>\n<1cd4> <681c>\n<1cd5> <6835>\n<1cd6> <682b>\n<1cd7> <682d>\n<1cd8> <682f>\n<1cd9> <684e>\n<1cda> <6844>\n<1cdb> <6834>\n<1cdc> <681d>\n<1cdd> <6812>\n<1cde> <6814>\n<1cdf> <6826>\n<1ce0> <6828>\n<1ce1> <682e>\n<1ce2> <684d>\n<1ce3> <683a>\n<1ce4> <6825>\n<1ce5> <6820>\n<1ce6> <6b2c>\n<1ce7> <6b2f>\n<1ce8> <6b2d>\n<1ce9> <6b31>\n<1cea> <6b34>\n<1ceb> <6b6d>\n<1cec> <8082>\n<1ced> <6b88>\n<1cee> <6be6>\n<1cef> <6be4>\n<1cf0> <6be8>\n<1cf1> <6be3>\n<1cf2> <6be2>\n<1cf3> <6be7>\n<1cf4> <6c25>\n<1cf5> <6d7a>\n<1cf8> <6d76>\n<1cf9> <6d0d>\n<1cfa> <6d61>\n<1cfb> <6d92>\n<1cfc> <6d58>\n<1cfd> <6d62>\n<1cfe> <6d6d>\n<1cff> <6d6f>\n<1d00> <6d91>\n<1d01> <6d8d>\n<1d02> <6def>\n<1d03> <6d7f>\n<1d04> <6d86>\n<1d05> <6d5e>\n<1d06> <6d67>\n<1d07> <6d60>\n<1d08> <6d97>\n<1d09> <6d70>\n<1d0a> <6d7c>\n<1d0b> <6d5f>\n<1d0c> <6d82>\n<1d0d> <6d98>\n<1d0e> <6d2f>\n<1d0f> <6d68>\n<1d10> <6d8b>\n<1d11> <6d7e>\n<1d12> <6d80>\n<1d13> <6d84>\n<1d14> <6d16>\n<1d15> <6d83>\n<1d16> <6d7b>\n<1d17> <6d7d>\n<1d18> <6d75>\n<1d19> <6d90>\n<1d1a> <70dc>\n<1d1b> <70d3>\n<1d1c> <70d1>\n<1d1d> <70dd>\n<1d1e> <70cb>\n<1d1f> <7f39>\n<1d20> <70e2>\n<1d21> <70d7>\n<1d22> <70d2>\n<1d23> <70de>\n<1d24> <70e0>\n<1d25> <70d4>\n<1d26> <70cd>\n<1d2a> <70da>\n<1d2b> <70ce>\n<1d2c> <70e1>\n<1d2d> <7242>\n<1d2e> <7278>\n<1d2f> <7277>\n<1d30> <7276>\n<1d31> <7300>\n<1d32> <72fa>\n<1d33> <72f4>\n<1d34> <72fe>\n<1d35> <72f6>\nendbfchar\n\n100 beginbfchar\n<1d36> <72f3>\n<1d37> <72fb>\n<1d38> <7301>\n<1d39> <73d3>\n<1d3a> <73d9>\n<1d3b> <73e5>\n<1d3c> <73d6>\n<1d3d> <73bc>\n<1d3e> <73e7>\n<1d3f> <73e3>\n<1d40> <73e9>\n<1d41> <73dc>\n<1d42> <73d2>\n<1d43> <73db>\n<1d44> <73d4>\n<1d45> <73dd>\n<1d46> <73da>\n<1d49> <73e8>\n<1d4e> <7521>\n<1d4f> <755b>\n<1d50> <755f>\n<1d51> <75b0>\n<1d52> <75c1>\n<1d53> <75bb>\n<1d54> <75c4>\n<1d55> <75c0>\n<1d56> <75bf>\n<1d57> <75b6>\n<1d58> <75ba>\n<1d59> <768a>\n<1d5a> <76c9>\n<1d5b> <771d>\n<1d5c> <771b>\n<1d5d> <7710>\n<1d5e> <7713>\n<1d5f> <7712>\n<1d60> <7723>\n<1d61> <7711>\n<1d62> <7715>\n<1d65> <7722>\n<1d66> <7727>\n<1d67> <7823>\n<1d68> <782c>\n<1d69> <7822>\n<1d6a> <7835>\n<1d6b> <782f>\n<1d6c> <7828>\n<1d6d> <782e>\n<1d6e> <782b>\n<1d6f> <7821>\n<1d70> <7829>\n<1d71> <7833>\n<1d72> <782a>\n<1d73> <7831>\n<1d74> <7954>\n<1d75> <795b>\n<1d76> <794f>\n<1d77> <795c>\n<1d78> <7953>\n<1d79> <7952>\n<1d7a> <7951>\n<1d7d> <79e0>\n<1d7e> <79ee>\n<1d7f> <79ed>\n<1d80> <79ea>\n<1d81> <79dc>\n<1d82> <79de>\n<1d83> <79dd>\n<1d84> <7a86>\n<1d85> <7a89>\n<1d86> <7a85>\n<1d89> <7a8a>\n<1d8a> <7a87>\n<1d8b> <7ad8>\n<1d8c> <7b10>\n<1d8d> <7b04>\n<1d8e> <7b13>\n<1d8f> <7b05>\n<1d90> <7b0f>\n<1d91> <7b08>\n<1d92> <7b0a>\n<1d93> <7b0e>\n<1d94> <7b09>\n<1d95> <7b12>\n<1d96> <7c84>\n<1d97> <7c91>\n<1d98> <7c8a>\n<1d99> <7c8c>\n<1d9a> <7c88>\n<1d9b> <7c8d>\n<1d9c> <7c85>\n<1d9d> <7d1e>\n<1d9e> <7d1d>\n<1d9f> <7d11>\n<1da0> <7d0e>\n<1da1> <7d18>\n<1da2> <7d16>\n<1da3> <7d13>\n<1da4> <7d1f>\n<1da5> <7d12>\nendbfchar\n\n100 beginbfchar\n<1da6> <7d0f>\n<1da7> <7d0c>\n<1da8> <7f5c>\n<1da9> <7f61>\n<1daa> <7f5e>\n<1dab> <7f60>\n<1dac> <7f5d>\n<1dad> <7f5b>\n<1dae> <7f96>\n<1daf> <7f92>\n<1db0> <7fc3>\n<1db1> <7fc2>\n<1db2> <7fc0>\n<1db3> <8016>\n<1db4> <803e>\n<1db5> <8039>\n<1db6> <80fa>\n<1db7> <80f2>\n<1db8> <80f9>\n<1db9> <80f5>\n<1dba> <8101>\n<1dbb> <80fb>\n<1dbc> <8100>\n<1dbd> <8201>\n<1dbe> <822f>\n<1dbf> <8225>\n<1dc0> <8333>\n<1dc1> <832d>\n<1dc2> <8344>\n<1dc3> <8319>\n<1dc4> <8351>\n<1dc5> <8325>\n<1dc6> <8356>\n<1dc7> <833f>\n<1dc8> <8341>\n<1dc9> <8326>\n<1dca> <831c>\n<1dcb> <8322>\n<1dcc> <8342>\n<1dcd> <834e>\n<1dce> <831b>\n<1dcf> <832a>\n<1dd0> <8308>\n<1dd1> <833c>\n<1dd2> <834d>\n<1dd3> <8316>\n<1dd4> <8324>\n<1dd5> <8320>\n<1dd6> <8337>\n<1dd7> <832f>\n<1dd8> <8329>\n<1dd9> <8347>\n<1dda> <8345>\n<1ddb> <834c>\n<1ddc> <8353>\n<1ddd> <831e>\n<1dde> <832c>\n<1ddf> <834b>\n<1de0> <8327>\n<1de1> <8348>\n<1de2> <8653>\n<1de3> <8652>\n<1de4> <86a2>\n<1de5> <86a8>\n<1de6> <8696>\n<1de7> <868d>\n<1de8> <8691>\n<1de9> <869e>\n<1dea> <8687>\n<1deb> <8697>\n<1dec> <8686>\n<1ded> <868b>\n<1dee> <869a>\n<1def> <8685>\n<1df0> <86a5>\n<1df1> <8699>\n<1df2> <86a1>\n<1df3> <86a7>\n<1df4> <8695>\n<1df5> <8698>\n<1df6> <868e>\n<1df7> <869d>\n<1df8> <8690>\n<1df9> <8694>\n<1dfc> <886d>\n<1dff> <8872>\n<1e00> <8880>\n<1e01> <8871>\n<1e02> <887f>\n<1e03> <886f>\n<1e04> <8883>\n<1e05> <887e>\n<1e06> <8874>\n<1e07> <887c>\n<1e08> <8a12>\n<1e09> <8c47>\n<1e0a> <8c57>\n<1e0b> <8c7b>\n<1e0c> <8ca4>\n<1e0d> <8ca3>\nendbfchar\n\n100 beginbfchar\n<1e0e> <8d76>\n<1e0f> <8d78>\n<1e10> <8db5>\n<1e11> <8db7>\n<1e12> <8db6>\n<1e13> <8ed1>\n<1e14> <8ed3>\n<1e15> <8ffe>\n<1e16> <8ff5>\n<1e17> <9002>\n<1e18> <8fff>\n<1e19> <8ffb>\n<1e1a> <9004>\n<1e1b> <8ffc>\n<1e1c> <8ff6>\n<1e1d> <90d6>\n<1e1e> <90e0>\n<1e21> <90e3>\n<1e22> <90df>\n<1e23> <90e5>\n<1e24> <90d8>\n<1e25> <90db>\n<1e26> <90d7>\n<1e27> <90dc>\n<1e28> <90e4>\n<1e29> <9150>\n<1e2c> <91d5>\n<1e2d> <91e2>\n<1e2e> <91da>\n<1e2f> <965c>\n<1e30> <965f>\n<1e31> <96bc>\n<1e32> <98e3>\n<1e33> <9adf>\n<1e34> <9b2f>\n<1e35> <4e7f>\n<1e36> <5070>\n<1e37> <506a>\n<1e38> <5061>\n<1e39> <505e>\n<1e3a> <5060>\n<1e3b> <5053>\n<1e3c> <504b>\n<1e3d> <505d>\n<1e3e> <5072>\n<1e3f> <5048>\n<1e40> <504d>\n<1e41> <5041>\n<1e42> <505b>\n<1e43> <504a>\n<1e44> <5062>\n<1e45> <5015>\n<1e46> <5045>\n<1e47> <505f>\n<1e48> <5069>\n<1e49> <506b>\n<1e4c> <5046>\n<1e4d> <5040>\n<1e4e> <506e>\n<1e4f> <5073>\n<1e50> <5057>\n<1e51> <5051>\n<1e52> <51d0>\n<1e53> <526b>\n<1e54> <526d>\n<1e55> <526c>\n<1e56> <526e>\n<1e57> <52d6>\n<1e58> <52d3>\n<1e59> <532d>\n<1e5a> <539c>\n<1e5d> <553c>\n<1e5e> <554d>\n<1e5f> <5550>\n<1e60> <5534>\n<1e61> <552a>\n<1e62> <5551>\n<1e63> <5562>\n<1e64> <5536>\n<1e65> <5535>\n<1e66> <5530>\n<1e67> <5552>\n<1e68> <5545>\n<1e69> <550c>\n<1e6a> <5532>\n<1e6b> <5565>\n<1e6c> <554e>\n<1e6d> <5539>\n<1e6e> <5548>\n<1e6f> <552d>\n<1e70> <553b>\n<1e71> <5540>\n<1e72> <554b>\n<1e73> <570a>\n<1e74> <5707>\n<1e75> <57fb>\n<1e76> <5814>\n<1e77> <57e2>\n<1e78> <57f6>\n<1e79> <57dc>\nendbfchar\n\n100 beginbfchar\n<1e7a> <57f4>\n<1e7b> <5800>\n<1e7c> <57ed>\n<1e7d> <57fd>\n<1e7e> <5808>\n<1e7f> <57f8>\n<1e80> <580b>\n<1e81> <57f3>\n<1e82> <57cf>\n<1e83> <5807>\n<1e84> <57ee>\n<1e85> <57e3>\n<1e86> <57f2>\n<1e87> <57e5>\n<1e88> <57ec>\n<1e89> <57e1>\n<1e8a> <580e>\n<1e8b> <57fc>\n<1e8c> <5810>\n<1e8d> <57e7>\n<1e8e> <5801>\n<1e8f> <580c>\n<1e90> <57f1>\n<1e91> <57e9>\n<1e92> <57f0>\n<1e93> <580d>\n<1e94> <5804>\n<1e95> <595c>\n<1e96> <5a60>\n<1e97> <5a58>\n<1e98> <5a55>\n<1e99> <5a67>\n<1e9a> <5a5e>\n<1e9b> <5a38>\n<1e9c> <5a35>\n<1e9d> <5a6d>\n<1e9e> <5a50>\n<1e9f> <5a5f>\n<1ea0> <5a65>\n<1ea1> <5a6c>\n<1ea2> <5a53>\n<1ea3> <5a64>\n<1ea4> <5a57>\n<1ea5> <5a43>\n<1ea6> <5a5d>\n<1ea7> <5a52>\n<1ea8> <5a44>\n<1ea9> <5a5b>\n<1eaa> <5a48>\n<1eab> <5a8e>\n<1eac> <5a3e>\n<1ead> <5a4d>\n<1eae> <5a39>\n<1eaf> <5a4c>\n<1eb0> <5a70>\n<1eb1> <5a69>\n<1eb2> <5a47>\n<1eb3> <5a51>\n<1eb4> <5a56>\n<1eb5> <5a42>\n<1eb6> <5a5c>\n<1eb7> <5b72>\n<1eb8> <5b6e>\n<1eb9> <5bc1>\n<1eba> <5bc0>\n<1ebb> <5c59>\n<1ebc> <5d1e>\n<1ebd> <5d0b>\n<1ebe> <5d1d>\n<1ebf> <5d1a>\n<1ec0> <5d20>\n<1ec1> <5d0c>\n<1ec2> <5d28>\n<1ec3> <5d0d>\n<1ec4> <5d26>\n<1ec5> <5d25>\n<1ec6> <5d0f>\n<1ec7> <5d30>\n<1ec8> <5d12>\n<1ec9> <5d23>\n<1eca> <5d1f>\n<1ecb> <5d2e>\n<1ecc> <5e3e>\n<1ecd> <5e34>\n<1ece> <5eb1>\n<1ecf> <5eb4>\n<1ed0> <5eb9>\n<1ed3> <5f36>\n<1ed4> <5f38>\n<1ed5> <5f9b>\n<1ed6> <5f96>\n<1ed7> <5f9f>\n<1ed8> <608a>\n<1ed9> <6090>\n<1eda> <6086>\n<1edb> <60be>\n<1edc> <60b0>\n<1edd> <60ba>\n<1ee0> <60cf>\n<1ee1> <60e4>\nendbfchar\n\n100 beginbfchar\n<1ee2> <60d9>\n<1ee3> <60dd>\n<1ee4> <60c8>\n<1ee5> <60b1>\n<1ee6> <60db>\n<1ee7> <60b7>\n<1ee8> <60ca>\n<1ee9> <60bf>\n<1eea> <60c3>\n<1eeb> <60cd>\n<1eec> <60c0>\n<1eed> <6332>\n<1eee> <6365>\n<1eef> <638a>\n<1ef0> <6382>\n<1ef1> <637d>\n<1ef2> <63bd>\n<1ef3> <639e>\n<1ef4> <63ad>\n<1ef5> <639d>\n<1ef6> <6397>\n<1ef7> <63ab>\n<1ef8> <638e>\n<1ef9> <636f>\n<1efa> <6387>\n<1efb> <6390>\n<1efc> <636e>\n<1efd> <63af>\n<1efe> <6375>\n<1eff> <639c>\n<1f00> <636d>\n<1f01> <63ae>\n<1f02> <637c>\n<1f03> <63a4>\n<1f04> <633b>\n<1f05> <639f>\n<1f06> <6378>\n<1f07> <6385>\n<1f08> <6381>\n<1f09> <6391>\n<1f0a> <638d>\n<1f0b> <6370>\n<1f0c> <6553>\n<1f0d> <65cd>\n<1f0e> <6665>\n<1f0f> <6661>\n<1f10> <665b>\n<1f11> <6659>\n<1f12> <665c>\n<1f13> <6662>\n<1f14> <6718>\n<1f15> <6879>\n<1f16> <6887>\n<1f17> <6890>\n<1f18> <689c>\n<1f1b> <68ae>\n<1f1c> <68ab>\n<1f1d> <6956>\n<1f1e> <686f>\n<1f1f> <68a3>\n<1f20> <68ac>\n<1f21> <68a9>\n<1f22> <6875>\n<1f23> <6874>\n<1f24> <68b2>\n<1f25> <688f>\n<1f26> <6877>\n<1f27> <6892>\n<1f28> <687c>\n<1f29> <686b>\n<1f2a> <6872>\n<1f2b> <68aa>\n<1f2c> <6880>\n<1f2d> <6871>\n<1f2e> <687e>\n<1f2f> <689b>\n<1f30> <6896>\n<1f31> <688b>\n<1f32> <68a0>\n<1f33> <6889>\n<1f34> <68a4>\n<1f35> <6878>\n<1f36> <687b>\n<1f37> <6891>\n<1f38> <688c>\n<1f39> <688a>\n<1f3a> <687d>\n<1f3b> <6b36>\n<1f3c> <6b33>\n<1f3f> <6b91>\n<1f40> <6b8f>\n<1f43> <6b8c>\n<1f44> <6c2a>\n<1f45> <6dc0>\n<1f46> <6dab>\n<1f47> <6db4>\n<1f48> <6db3>\n<1f49> <6e74>\n<1f4a> <6dac>\n<1f4b> <6de9>\nendbfchar\n\n100 beginbfchar\n<1f4c> <6de2>\n<1f4d> <6db7>\n<1f4e> <6df6>\n<1f4f> <6dd4>\n<1f50> <6e00>\n<1f51> <6dc8>\n<1f52> <6de0>\n<1f53> <6ddf>\n<1f54> <6dd6>\n<1f55> <6dbe>\n<1f56> <6de5>\n<1f59> <6ddb>\n<1f5a> <6df4>\n<1f5b> <6dca>\n<1f5c> <6dbd>\n<1f5d> <6ded>\n<1f5e> <6df0>\n<1f5f> <6dba>\n<1f60> <6dd5>\n<1f61> <6dc2>\n<1f62> <6dcf>\n<1f63> <6dc9>\n<1f64> <6dd0>\n<1f65> <6df2>\n<1f66> <6dd3>\n<1f67> <6dfd>\n<1f68> <6dd7>\n<1f69> <6dcd>\n<1f6a> <6de3>\n<1f6b> <6dbb>\n<1f6c> <70fa>\n<1f6d> <710d>\n<1f6e> <70f7>\n<1f6f> <7117>\n<1f70> <70f4>\n<1f71> <710c>\n<1f72> <70f0>\n<1f73> <7104>\n<1f74> <70f3>\n<1f75> <7110>\n<1f76> <70fc>\n<1f77> <70ff>\n<1f78> <7106>\n<1f79> <7113>\n<1f7a> <7100>\n<1f7b> <70f8>\n<1f7c> <70f6>\n<1f7d> <710b>\n<1f7e> <7102>\n<1f7f> <710e>\n<1f80> <727e>\n<1f83> <727f>\n<1f84> <731d>\n<1f85> <7317>\n<1f86> <7307>\n<1f87> <7311>\n<1f88> <7318>\n<1f89> <730a>\n<1f8a> <7308>\n<1f8b> <72ff>\n<1f8c> <730f>\n<1f8d> <731e>\n<1f8e> <7388>\n<1f8f> <73f6>\n<1f90> <73f8>\n<1f91> <73f5>\n<1f92> <7404>\n<1f93> <7401>\n<1f94> <73fd>\n<1f95> <7407>\n<1f96> <7400>\n<1f97> <73fa>\n<1f98> <73fc>\n<1f99> <73ff>\n<1f9a> <740c>\n<1f9b> <740b>\n<1f9c> <73f4>\n<1f9d> <7408>\n<1f9e> <7564>\n<1f9f> <7563>\n<1fa0> <75ce>\n<1fa1> <75d2>\n<1fa2> <75cf>\n<1fa5> <75d1>\n<1fa6> <75d0>\n<1fa7> <768f>\n<1fa8> <7689>\n<1fa9> <76d3>\n<1faa> <7739>\n<1fab> <772f>\n<1fac> <772d>\n<1faf> <7734>\n<1fb0> <7733>\n<1fb1> <773d>\n<1fb2> <7725>\n<1fb3> <773b>\n<1fb4> <7735>\n<1fb5> <7848>\n<1fb6> <7852>\n<1fb7> <7849>\nendbfchar\n\n100 beginbfchar\n<1fb8> <784d>\n<1fb9> <784a>\n<1fba> <784c>\n<1fbb> <7826>\n<1fbc> <7845>\n<1fbd> <7850>\n<1fbe> <7964>\n<1fbf> <7967>\n<1fc2> <7963>\n<1fc3> <796b>\n<1fc4> <7961>\n<1fc5> <79bb>\n<1fc6> <79fa>\n<1fc7> <79f8>\n<1fca> <7a8f>\n<1fcb> <7a94>\n<1fcc> <7a90>\n<1fcd> <7b35>\n<1fce> <7b3b>\n<1fcf> <7b34>\n<1fd0> <7b25>\n<1fd1> <7b30>\n<1fd2> <7b22>\n<1fd3> <7b24>\n<1fd4> <7b33>\n<1fd5> <7b18>\n<1fd6> <7b2a>\n<1fd7> <7b1d>\n<1fd8> <7b31>\n<1fd9> <7b2b>\n<1fda> <7b2d>\n<1fdb> <7b2f>\n<1fdc> <7b32>\n<1fdd> <7b38>\n<1fde> <7b1a>\n<1fdf> <7b23>\n<1fe0> <7c94>\n<1fe1> <7c98>\n<1fe2> <7c96>\n<1fe3> <7ca3>\n<1fe4> <7d35>\n<1fe5> <7d3d>\n<1fe6> <7d38>\n<1fe7> <7d36>\n<1fe8> <7d3a>\n<1fe9> <7d45>\n<1fea> <7d2c>\n<1feb> <7d29>\n<1fec> <7d41>\n<1fed> <7d47>\n<1ff0> <7d4a>\n<1ff1> <7d3b>\n<1ff2> <7d28>\n<1ff3> <7f63>\n<1ff4> <7f95>\n<1ff7> <7f9b>\n<1ffa> <7fcd>\n<1ffd> <7fc7>\n<1ffe> <7fcf>\n<1fff> <7fc9>\n<2000> <801f>\n<2001> <801e>\n<2002> <801b>\n<2003> <8047>\n<2004> <8043>\n<2005> <8048>\n<2006> <8118>\n<2007> <8125>\n<2008> <8119>\n<2009> <811b>\n<200a> <812d>\n<200b> <811f>\n<200c> <812c>\n<200d> <811e>\n<200e> <8121>\n<200f> <8115>\n<2010> <8127>\n<2011> <811d>\n<2012> <8122>\n<2013> <8211>\n<2014> <8238>\n<2015> <8233>\n<2016> <823a>\n<2017> <8234>\n<2018> <8232>\n<2019> <8274>\n<201a> <8390>\n<201b> <83a3>\n<201c> <83a8>\n<201d> <838d>\n<201e> <837a>\n<201f> <8373>\n<2020> <83a4>\n<2021> <8374>\n<2022> <838f>\n<2023> <8381>\n<2024> <8395>\n<2025> <8399>\n<2026> <8375>\n<2027> <8394>\nendbfchar\n\n100 beginbfchar\n<2028> <83a9>\n<2029> <837d>\n<202a> <8383>\n<202b> <838c>\n<202c> <839d>\n<202d> <839b>\n<202e> <83aa>\n<202f> <838b>\n<2030> <837e>\n<2031> <83a5>\n<2032> <83af>\n<2033> <8388>\n<2034> <8397>\n<2035> <83b0>\n<2036> <837f>\n<2037> <83a6>\n<2038> <8387>\n<2039> <83ae>\n<203a> <8376>\n<203b> <8659>\n<203c> <8656>\n<203d> <86bf>\n<203e> <86b7>\n<203f> <86c2>\n<2040> <86c1>\n<2041> <86c5>\n<2042> <86ba>\n<2043> <86b0>\n<2044> <86c8>\n<2045> <86b9>\n<2046> <86b3>\n<2047> <86b8>\n<2048> <86cc>\n<2049> <86b4>\n<204c> <86c3>\n<204f> <8852>\n<2050> <8889>\n<2051> <8895>\n<2052> <88a8>\n<2053> <88a2>\n<2054> <88aa>\n<2055> <889a>\n<2056> <8891>\n<2057> <88a1>\n<2058> <889f>\n<2059> <8898>\n<205a> <88a7>\n<205b> <8899>\n<205c> <889b>\n<205d> <8897>\n<205e> <88a4>\n<205f> <88ac>\n<2060> <888c>\n<2061> <8893>\n<2062> <888e>\n<2063> <8982>\n<2064> <89d6>\n<2065> <89d9>\n<2066> <89d5>\n<2067> <8a30>\n<2068> <8a27>\n<2069> <8a2c>\n<206a> <8a1e>\n<206b> <8c39>\n<206c> <8c3b>\n<206f> <8c7d>\n<2070> <8ca5>\n<2071> <8d7d>\n<2072> <8d7b>\n<2073> <8d79>\n<2074> <8dbc>\n<2075> <8dc2>\n<2076> <8db9>\n<2077> <8dbf>\n<2078> <8dc1>\n<2079> <8ed8>\n<207a> <8ede>\n<207b> <8edd>\n<207c> <8edc>\n<207d> <8ed7>\n<2080> <9024>\n<2081> <900b>\n<2082> <9011>\n<2083> <901c>\n<2084> <900c>\n<2085> <9021>\n<2086> <90ef>\n<2087> <90ea>\n<2088> <90f0>\n<2089> <90f4>\n<208c> <90d4>\n<208f> <90e9>\n<2090> <9156>\n<2091> <9158>\n<2092> <915a>\n<2093> <9153>\n<2094> <9155>\n<2095> <91ec>\n<2096> <91f4>\n<2097> <91f1>\nendbfchar\n\n100 beginbfchar\n<2098> <91f3>\n<2099> <91f8>\n<209a> <91e4>\n<209b> <91f9>\n<209e> <91f7>\n<209f> <91e8>\n<20a0> <91ee>\n<20a1> <957a>\n<20a2> <9586>\n<20a3> <9588>\n<20a4> <967c>\n<20a5> <966d>\n<20a6> <966b>\n<20a7> <9671>\n<20a8> <966f>\n<20a9> <96bf>\n<20aa> <976a>\n<20ab> <9804>\n<20ac> <98e5>\n<20ad> <9997>\n<20ae> <509b>\n<20af> <5095>\n<20b0> <5094>\n<20b1> <509e>\n<20b2> <508b>\n<20b3> <50a3>\n<20b4> <5083>\n<20b5> <508c>\n<20b6> <508e>\n<20b7> <509d>\n<20b8> <5068>\n<20b9> <509c>\n<20ba> <5092>\n<20bb> <5082>\n<20bc> <5087>\n<20bd> <515f>\n<20be> <51d4>\n<20bf> <5312>\n<20c0> <5311>\n<20c1> <53a4>\n<20c2> <53a7>\n<20c3> <5591>\n<20c4> <55a8>\n<20c5> <55a5>\n<20c6> <55ad>\n<20c7> <5577>\n<20c8> <5645>\n<20c9> <55a2>\n<20ca> <5593>\n<20cb> <5588>\n<20cc> <558f>\n<20cd> <55b5>\n<20ce> <5581>\n<20cf> <55a3>\n<20d0> <5592>\n<20d1> <55a4>\n<20d2> <557d>\n<20d3> <558c>\n<20d4> <55a6>\n<20d5> <557f>\n<20d6> <5595>\n<20d7> <55a1>\n<20d8> <558e>\n<20d9> <570c>\n<20da> <5829>\n<20db> <5837>\n<20dc> <5819>\n<20dd> <581e>\n<20de> <5827>\n<20df> <5823>\n<20e0> <5828>\n<20e1> <57f5>\n<20e2> <5848>\n<20e3> <5825>\n<20e4> <581c>\n<20e5> <581b>\n<20e6> <5833>\n<20e7> <583f>\n<20e8> <5836>\n<20e9> <582e>\n<20ea> <5839>\n<20eb> <5838>\n<20ec> <582d>\n<20ed> <582c>\n<20ee> <583b>\n<20ef> <5961>\n<20f0> <5aaf>\n<20f1> <5a94>\n<20f2> <5a9f>\n<20f3> <5a7a>\n<20f4> <5aa2>\n<20f5> <5a9e>\n<20f6> <5a78>\n<20f7> <5aa6>\n<20f8> <5a7c>\n<20f9> <5aa5>\n<20fa> <5aac>\n<20fb> <5a95>\n<20fc> <5aae>\n<20fd> <5a37>\nendbfchar\n\n100 beginbfchar\n<20fe> <5a84>\n<20ff> <5a8a>\n<2100> <5a97>\n<2101> <5a83>\n<2102> <5a8b>\n<2103> <5aa9>\n<2104> <5a7b>\n<2105> <5a7d>\n<2106> <5a8c>\n<2107> <5a9c>\n<2108> <5a8f>\n<2109> <5a93>\n<210a> <5a9d>\n<210b> <5bea>\n<210c> <5bcd>\n<210d> <5bcb>\n<210e> <5bd4>\n<210f> <5bd1>\n<2110> <5bca>\n<2111> <5bce>\n<2112> <5c0c>\n<2113> <5c30>\n<2114> <5d37>\n<2115> <5d43>\n<2116> <5d6b>\n<2117> <5d41>\n<2118> <5d4b>\n<2119> <5d3f>\n<211a> <5d35>\n<211b> <5d51>\n<211c> <5d4e>\n<211d> <5d55>\n<211e> <5d33>\n<211f> <5d3a>\n<2120> <5d52>\n<2121> <5d3d>\n<2122> <5d31>\n<2123> <5d59>\n<2124> <5d42>\n<2125> <5d39>\n<2126> <5d49>\n<2127> <5d38>\n<2128> <5d3c>\n<2129> <5d32>\n<212a> <5d36>\n<212b> <5d40>\n<212c> <5d45>\n<212d> <5e44>\n<212e> <5e41>\n<212f> <5f58>\n<2130> <5fa6>\n<2131> <5fa5>\n<2132> <5fab>\n<2133> <60c9>\n<2134> <60b9>\n<2135> <60cc>\n<2136> <60e2>\n<2137> <60ce>\n<2138> <60c4>\n<2139> <6114>\n<213a> <60f2>\n<213b> <610a>\n<213c> <6116>\n<213d> <6105>\n<213e> <60f5>\n<213f> <6113>\n<2140> <60f8>\n<2141> <60fc>\n<2142> <60fe>\n<2143> <60c1>\n<2144> <6103>\n<2145> <6118>\n<2146> <611d>\n<2147> <6110>\n<2148> <60ff>\n<2149> <6104>\n<214a> <610b>\n<214b> <624a>\n<214c> <6394>\n<214d> <63b1>\n<214e> <63b0>\n<214f> <63ce>\n<2150> <63e5>\n<2151> <63e8>\n<2152> <63ef>\n<2153> <63c3>\n<2154> <649d>\n<2155> <63f3>\n<2156> <63ca>\n<2157> <63e0>\n<2158> <63f6>\n<2159> <63d5>\n<215a> <63f2>\n<215b> <63f5>\n<215c> <6461>\n<215d> <63df>\n<215e> <63be>\n<215f> <63dd>\n<2160> <63dc>\n<2161> <63c4>\nendbfchar\n\n100 beginbfchar\n<2162> <63d8>\n<2163> <63d3>\n<2164> <63c2>\n<2165> <63c7>\n<2166> <63cc>\n<2167> <63cb>\n<2168> <63c8>\n<2169> <63f0>\n<216a> <63d7>\n<216b> <63d9>\n<216c> <6532>\n<216d> <6567>\n<216e> <656a>\n<216f> <6564>\n<2170> <655c>\n<2171> <6568>\n<2172> <6565>\n<2173> <658c>\n<2176> <65ae>\n<2177> <65d0>\n<2178> <65d2>\n<2179> <667c>\n<217a> <666c>\n<217b> <667b>\n<217c> <6680>\n<217d> <6671>\n<217e> <6679>\n<217f> <666a>\n<2180> <6672>\n<2181> <6701>\n<2182> <690c>\n<2183> <68d3>\n<2184> <6904>\n<2185> <68dc>\n<2186> <692a>\n<2187> <68ec>\n<2188> <68ea>\n<2189> <68f1>\n<218a> <690f>\n<218b> <68d6>\n<218c> <68f7>\n<218d> <68eb>\n<218e> <68e4>\n<218f> <68f6>\n<2190> <6913>\n<2191> <6910>\n<2192> <68f3>\n<2193> <68e1>\n<2194> <6907>\n<2195> <68cc>\n<2196> <6908>\n<2197> <6970>\n<2198> <68b4>\n<2199> <6911>\n<219a> <68ef>\n<219b> <68c6>\n<219c> <6914>\n<219d> <68f8>\n<219e> <68d0>\n<219f> <68fd>\n<21a0> <68fc>\n<21a1> <68e8>\n<21a2> <690b>\n<21a3> <690a>\n<21a4> <6917>\n<21a5> <68ce>\n<21a6> <68c8>\n<21a9> <68e6>\n<21aa> <68f4>\n<21ab> <68d1>\n<21ac> <6906>\n<21ad> <68d4>\n<21ae> <68e9>\n<21af> <6915>\n<21b0> <6925>\n<21b1> <68c7>\n<21b2> <6b39>\n<21b3> <6b3b>\n<21b4> <6b3f>\n<21b5> <6b3c>\n<21b6> <6b94>\n<21b7> <6b97>\n<21b8> <6b99>\n<21b9> <6b95>\n<21ba> <6bbd>\n<21bb> <6bf0>\n<21be> <6c30>\n<21bf> <6dfc>\n<21c2> <6e1f>\n<21c3> <6e49>\n<21c4> <6e88>\n<21c7> <6e45>\n<21c8> <6e62>\n<21c9> <6e2b>\n<21ca> <6e3f>\n<21cb> <6e41>\n<21cc> <6e5d>\n<21cd> <6e73>\n<21ce> <6e1c>\n<21cf> <6e33>\nendbfchar\n\n100 beginbfchar\n<21d0> <6e4b>\n<21d1> <6e40>\n<21d2> <6e51>\n<21d3> <6e3b>\n<21d4> <6e03>\n<21d5> <6e2e>\n<21d6> <6e5e>\n<21d7> <6e68>\n<21d8> <6e5c>\n<21d9> <6e61>\n<21da> <6e31>\n<21db> <6e28>\n<21dc> <6e60>\n<21dd> <6e71>\n<21de> <6e6b>\n<21df> <6e39>\n<21e0> <6e22>\n<21e1> <6e30>\n<21e2> <6e53>\n<21e3> <6e65>\n<21e4> <6e27>\n<21e5> <6e78>\n<21e6> <6e64>\n<21e7> <6e77>\n<21e8> <6e55>\n<21e9> <6e79>\n<21ea> <6e52>\n<21eb> <6e66>\n<21ee> <6e5a>\n<21ef> <7120>\n<21f0> <711e>\n<21f1> <712f>\n<21f2> <70fb>\n<21f3> <712e>\n<21f4> <7131>\n<21f5> <7123>\n<21f6> <7125>\n<21f7> <7122>\n<21f8> <7132>\n<21f9> <711f>\n<21fa> <7128>\n<21fb> <713a>\n<21fc> <711b>\n<21fd> <724b>\n<21fe> <725a>\n<21ff> <7288>\n<2200> <7289>\n<2201> <7286>\n<2202> <7285>\n<2203> <728b>\n<2204> <7312>\n<2205> <730b>\n<2206> <7330>\n<2207> <7322>\n<2208> <7331>\n<2209> <7333>\n<220a> <7327>\n<220b> <7332>\n<220c> <732d>\n<220d> <7326>\n<220e> <7323>\n<220f> <7335>\n<2210> <730c>\n<2211> <742e>\n<2212> <742c>\n<2213> <7430>\n<2214> <742b>\n<2215> <7416>\n<2216> <741a>\n<2217> <7421>\n<2218> <742d>\n<2219> <7431>\n<221a> <7424>\n<221b> <7423>\n<221c> <741d>\n<221d> <7429>\n<221e> <7420>\n<221f> <7432>\n<2220> <74fb>\n<2221> <752f>\n<2222> <756f>\n<2223> <756c>\n<2224> <75e7>\n<2225> <75da>\n<2226> <75e1>\n<2227> <75e6>\n<2228> <75dd>\n<2229> <75df>\n<222a> <75e4>\n<222b> <75d7>\n<222c> <7695>\n<222d> <7692>\n<222e> <76da>\n<2231> <7744>\n<2232> <774d>\n<2233> <7745>\n<2234> <774a>\n<2235> <774e>\n<2238> <77de>\n<2239> <77ec>\nendbfchar\n\n100 beginbfchar\n<223a> <7860>\n<223d> <785c>\n<223e> <786d>\n<223f> <7871>\n<2240> <786a>\n<2241> <786e>\n<2242> <7870>\n<2243> <7869>\n<2244> <7868>\n<2245> <785e>\n<2246> <7862>\n<2247> <7974>\n<2248> <7973>\n<2249> <7972>\n<224a> <7970>\n<224b> <7a02>\n<224c> <7a0a>\n<224d> <7a03>\n<224e> <7a0c>\n<224f> <7a04>\n<2250> <7a99>\n<2251> <7ae6>\n<2252> <7ae4>\n<2253> <7b4a>\n<2254> <7b47>\n<2255> <7b44>\n<2256> <7b48>\n<2257> <7b4c>\n<2258> <7b4e>\n<2259> <7b40>\n<225a> <7b58>\n<225b> <7b45>\n<225c> <7ca2>\n<225d> <7c9e>\n<225e> <7ca8>\n<225f> <7ca1>\n<2260> <7d58>\n<2261> <7d6f>\n<2262> <7d63>\n<2263> <7d53>\n<2264> <7d56>\n<2265> <7d67>\n<2266> <7d6a>\n<2267> <7d4f>\n<2268> <7d6d>\n<2269> <7d5c>\n<226a> <7d6b>\n<226b> <7d52>\n<226c> <7d54>\n<226d> <7d69>\n<226e> <7d51>\n<226f> <7d5f>\n<2270> <7d4e>\n<2275> <7fa2>\n<2278> <7fd7>\n<2279> <8051>\n<227c> <80fe>\n<227d> <80d4>\n<227e> <8143>\n<227f> <814a>\n<2280> <8152>\n<2281> <814f>\n<2282> <8147>\n<2283> <813d>\n<2284> <814d>\n<2285> <813a>\n<2286> <81e6>\n<2287> <81ee>\n<228b> <8204>\n<228e> <823f>\n<228f> <8275>\n<2290> <833b>\n<2291> <83cf>\n<2292> <83f9>\n<2293> <8423>\n<2294> <83c0>\n<2295> <83e8>\n<2296> <8412>\n<2297> <83e7>\n<2298> <83e4>\n<2299> <83fc>\n<229a> <83f6>\n<229b> <8410>\n<229c> <83c6>\n<229d> <83c8>\n<229e> <83eb>\n<229f> <83e3>\n<22a0> <83bf>\n<22a1> <8401>\n<22a2> <83dd>\n<22a3> <83e5>\n<22a4> <83d8>\n<22a5> <83ff>\n<22a6> <83e1>\n<22a7> <83cb>\n<22a8> <83ce>\n<22a9> <83d6>\n<22aa> <83f5>\n<22ab> <83c9>\n<22ac> <8409>\nendbfchar\n\n100 beginbfchar\n<22ad> <840f>\n<22ae> <83de>\n<22af> <8411>\n<22b0> <8406>\n<22b1> <83c2>\n<22b2> <83f3>\n<22b3> <83d5>\n<22b4> <83fa>\n<22b5> <83c7>\n<22b6> <83d1>\n<22b7> <83ea>\n<22b8> <8413>\n<22b9> <839a>\n<22ba> <83c3>\n<22bb> <83ec>\n<22bc> <83ee>\n<22bd> <83c4>\n<22be> <83fb>\n<22bf> <83d7>\n<22c0> <83e2>\n<22c1> <841b>\n<22c2> <83db>\n<22c3> <83fe>\n<22c4> <86d8>\n<22c5> <86e2>\n<22c6> <86e6>\n<22c7> <86d3>\n<22c8> <86e3>\n<22c9> <86da>\n<22ca> <86ea>\n<22cb> <86dd>\n<22cc> <86eb>\n<22cd> <86dc>\n<22ce> <86ec>\n<22cf> <86e9>\n<22d0> <86d7>\n<22d1> <86e8>\n<22d2> <86d1>\n<22d3> <8848>\n<22d4> <8856>\n<22d5> <8855>\n<22d6> <88ba>\n<22d7> <88d7>\n<22d8> <88b9>\n<22d9> <88b8>\n<22da> <88c0>\n<22db> <88be>\n<22dc> <88b6>\n<22dd> <88bc>\n<22de> <88b7>\n<22df> <88bd>\n<22e0> <88b2>\n<22e1> <8901>\n<22e2> <88c9>\n<22e3> <8995>\n<22e4> <8998>\n<22e5> <8997>\n<22e6> <89dd>\n<22e9> <8a4e>\n<22ea> <8a4d>\n<22eb> <8a39>\n<22ec> <8a59>\n<22ed> <8a40>\n<22f2> <8a52>\n<22f3> <8a48>\n<22f4> <8a51>\n<22f5> <8a4a>\n<22f6> <8a4c>\n<22f7> <8a4f>\n<22f8> <8c5f>\n<22f9> <8c81>\n<22fa> <8c80>\n<22fb> <8cba>\n<22fc> <8cbe>\n<22fd> <8cb0>\n<22fe> <8cb9>\n<22ff> <8cb5>\n<2300> <8d84>\n<2301> <8d80>\n<2302> <8d89>\n<2303> <8dd8>\n<2304> <8dd3>\n<2305> <8dcd>\n<2306> <8dc7>\n<2307> <8dd6>\n<2308> <8ddc>\n<2309> <8dcf>\n<230a> <8dd5>\n<230b> <8dd9>\n<230c> <8dc8>\n<230d> <8dd7>\n<230e> <8dc5>\n<230f> <8eef>\n<2310> <8ef7>\n<2311> <8efa>\n<2312> <8ef9>\n<2313> <8ee6>\n<2314> <8eee>\n<2315> <8ee5>\n<2316> <8ef5>\nendbfchar\n\n100 beginbfchar\n<2319> <8ef6>\n<231a> <8eeb>\n<231b> <8ef1>\n<231c> <8eec>\n<231d> <8ef4>\n<231e> <8ee9>\n<231f> <902d>\n<2320> <9034>\n<2321> <902f>\n<2322> <9106>\n<2323> <912c>\n<2324> <9104>\n<2325> <90ff>\n<2326> <90fc>\n<2327> <9108>\n<2328> <90f9>\n<2329> <90fb>\n<232a> <9101>\n<232b> <9100>\n<232c> <9107>\n<232d> <9105>\n<232e> <9103>\n<232f> <9161>\n<2330> <9164>\n<2331> <915f>\n<2332> <9162>\n<2333> <9160>\n<2334> <9201>\n<2335> <920a>\n<2336> <9225>\n<2337> <9203>\n<2338> <921a>\n<2339> <9226>\n<233a> <920f>\n<233b> <920c>\n<233c> <9200>\n<233d> <9212>\n<233e> <91ff>\n<233f> <91fd>\n<2340> <9206>\n<2341> <9204>\n<2342> <9227>\n<2343> <9202>\n<2344> <921c>\n<2345> <9224>\n<2346> <9219>\n<2347> <9217>\n<2348> <9205>\n<2349> <9216>\n<234a> <957b>\n<234b> <958d>\n<234c> <958c>\n<234d> <9590>\n<234e> <9687>\n<234f> <967e>\n<2352> <9683>\n<2353> <9680>\n<2354> <96c2>\n<2355> <96c8>\n<2356> <96c3>\n<2357> <96f1>\n<2358> <96f0>\n<2359> <976c>\n<235a> <9770>\n<235b> <976e>\n<235c> <9807>\n<235d> <98a9>\n<235e> <98eb>\n<235f> <9ce6>\n<2360> <9ef9>\n<2363> <4eb6>\n<2364> <50bd>\n<2365> <50bf>\n<2366> <50c6>\n<2367> <50ae>\n<2368> <50c4>\n<2369> <50ca>\n<236a> <50b4>\n<236b> <50c8>\n<236c> <50c2>\n<236d> <50b0>\n<236e> <50c1>\n<236f> <50ba>\n<2370> <50b1>\n<2371> <50cb>\n<2372> <50c9>\n<2373> <50b6>\n<2374> <50b8>\n<2375> <51d7>\n<2376> <527a>\n<2377> <5278>\n<237a> <55c3>\n<237b> <55db>\n<237c> <55cc>\n<237d> <55d0>\n<237e> <55cb>\n<237f> <55ca>\n<2380> <55dd>\n<2381> <55c0>\n<2382> <55d4>\nendbfchar\n\n100 beginbfchar\n<2383> <55c4>\n<2384> <55e9>\n<2385> <55bf>\n<2386> <55d2>\n<2387> <558d>\n<2388> <55cf>\n<2389> <55d5>\n<238a> <55e2>\n<238b> <55d6>\n<238c> <55c8>\n<238d> <55f2>\n<238e> <55cd>\n<238f> <55d9>\n<2390> <55c2>\n<2391> <5714>\n<2392> <5853>\n<2393> <5868>\n<2394> <5864>\n<2395> <584f>\n<2396> <584d>\n<2397> <5849>\n<2398> <586f>\n<2399> <5855>\n<239a> <584e>\n<239b> <585d>\n<239c> <5859>\n<239d> <5865>\n<239e> <585b>\n<239f> <583d>\n<23a0> <5863>\n<23a1> <5871>\n<23a2> <58fc>\n<23a3> <5ac7>\n<23a4> <5ac4>\n<23a5> <5acb>\n<23a6> <5aba>\n<23a7> <5ab8>\n<23a8> <5ab1>\n<23a9> <5ab5>\n<23aa> <5ab0>\n<23ab> <5abf>\n<23ac> <5ac8>\n<23ad> <5abb>\n<23ae> <5ac6>\n<23af> <5ab7>\n<23b0> <5ac0>\n<23b1> <5aca>\n<23b2> <5ab4>\n<23b3> <5ab6>\n<23b4> <5acd>\n<23b5> <5ab9>\n<23b6> <5a90>\n<23b7> <5bd6>\n<23ba> <5c1f>\n<23bb> <5c33>\n<23bc> <5d71>\n<23bd> <5d63>\n<23be> <5d4a>\n<23bf> <5d65>\n<23c0> <5d72>\n<23c1> <5d6c>\n<23c2> <5d5e>\n<23c3> <5d68>\n<23c4> <5d67>\n<23c5> <5d62>\n<23c6> <5df0>\n<23c7> <5e4f>\n<23c8> <5e4e>\n<23c9> <5e4a>\n<23ca> <5e4d>\n<23cb> <5e4b>\n<23cc> <5ec5>\n<23cd> <5ecc>\n<23ce> <5ec6>\n<23cf> <5ecb>\n<23d0> <5ec7>\n<23d1> <5f40>\n<23d2> <5faf>\n<23d3> <5fad>\n<23d4> <60f7>\n<23d7> <612b>\n<23d8> <6145>\n<23d9> <6136>\n<23da> <6132>\n<23db> <612e>\n<23dc> <6146>\n<23dd> <612f>\n<23de> <614f>\n<23df> <6129>\n<23e0> <6140>\n<23e1> <6220>\n<23e2> <9168>\n<23e3> <6223>\n<23e4> <6225>\n<23e5> <6224>\n<23e6> <63c5>\n<23e7> <63f1>\n<23e8> <63eb>\n<23e9> <6410>\n<23ea> <6412>\nendbfchar\n\n100 beginbfchar\n<23eb> <6409>\n<23ec> <6420>\n<23ed> <6424>\n<23ee> <6433>\n<23ef> <6443>\n<23f0> <641f>\n<23f1> <6415>\n<23f2> <6418>\n<23f3> <6439>\n<23f4> <6437>\n<23f7> <640c>\n<23f8> <6426>\n<23f9> <6430>\n<23fa> <6428>\n<23fb> <6441>\n<23fc> <6435>\n<23fd> <642f>\n<23fe> <640a>\n<23ff> <641a>\n<2400> <6440>\n<2401> <6425>\n<2402> <6427>\n<2403> <640b>\n<2404> <63e7>\n<2405> <641b>\n<2406> <642e>\n<2407> <6421>\n<2408> <640e>\n<2409> <656f>\n<240a> <6592>\n<240b> <65d3>\n<240c> <6686>\n<240d> <668c>\n<240e> <6695>\n<240f> <6690>\n<2410> <668b>\n<2411> <668a>\n<2412> <6699>\n<2413> <6694>\n<2414> <6678>\n<2415> <6720>\n<2416> <6966>\n<2417> <695f>\n<2418> <6938>\n<2419> <694e>\n<241a> <6962>\n<241b> <6971>\n<241c> <693f>\n<241d> <6945>\n<241e> <696a>\n<241f> <6939>\n<2420> <6942>\n<2421> <6957>\n<2422> <6959>\n<2423> <697a>\n<2426> <6935>\n<2427> <696c>\n<2428> <6933>\n<2429> <693d>\n<242a> <6965>\n<242b> <68f0>\n<242c> <6978>\n<242d> <6934>\n<242e> <6969>\n<242f> <6940>\n<2430> <696f>\n<2431> <6944>\n<2432> <6976>\n<2433> <6958>\n<2434> <6941>\n<2435> <6974>\n<2436> <694c>\n<2437> <693b>\n<2438> <694b>\n<2439> <6937>\n<243a> <695c>\n<243b> <694f>\n<243c> <6951>\n<243d> <6932>\n<243e> <6952>\n<243f> <692f>\n<2440> <697b>\n<2441> <693c>\n<2442> <6b46>\n<2443> <6b45>\n<2444> <6b43>\n<2445> <6b42>\n<2446> <6b48>\n<2447> <6b41>\n<2448> <6b9b>\n<244b> <6bf9>\n<244e> <6e9b>\n<244f> <6ed6>\n<2450> <6ec8>\n<2451> <6e8f>\n<2452> <6ec0>\n<2453> <6e9f>\n<2456> <6ea0>\n<2457> <6eb1>\n<2458> <6eb9>\nendbfchar\n\n100 beginbfchar\n<2459> <6ec6>\n<245a> <6ed2>\n<245b> <6ebd>\n<245c> <6ec1>\n<245d> <6e9e>\n<245e> <6ec9>\n<245f> <6eb7>\n<2460> <6eb0>\n<2461> <6ecd>\n<2462> <6ea6>\n<2463> <6ecf>\n<2464> <6eb2>\n<2465> <6ebe>\n<2466> <6ec3>\n<2467> <6edc>\n<2468> <6ed8>\n<2469> <6e99>\n<246a> <6e92>\n<246b> <6e8e>\n<246c> <6e8d>\n<246d> <6ea4>\n<246e> <6ea1>\n<246f> <6ebf>\n<2470> <6eb3>\n<2471> <6ed0>\n<2472> <6eca>\n<2473> <6e97>\n<2474> <6eae>\n<2475> <6ea3>\n<2476> <7147>\n<2477> <7154>\n<2478> <7152>\n<2479> <7163>\n<247a> <7160>\n<247b> <7141>\n<247c> <715d>\n<247d> <7162>\n<247e> <7172>\n<247f> <7178>\n<2480> <716a>\n<2481> <7161>\n<2482> <7142>\n<2483> <7158>\n<2484> <7143>\n<2485> <714b>\n<2486> <7170>\n<2487> <715f>\n<2488> <7150>\n<2489> <7153>\n<248a> <7144>\n<248b> <714d>\n<248c> <715a>\n<248d> <724f>\n<248e> <728d>\n<248f> <728c>\n<2490> <7291>\n<2491> <7290>\n<2492> <728e>\n<2493> <733c>\n<2494> <7342>\n<2495> <733b>\n<2496> <733a>\n<2497> <7340>\n<2498> <734a>\n<2499> <7349>\n<249a> <7444>\n<249d> <7452>\n<249e> <7451>\n<249f> <7457>\n<24a0> <7440>\n<24a3> <744e>\n<24a4> <7442>\n<24a5> <7446>\n<24a6> <744d>\n<24a7> <7454>\n<24a8> <74e1>\n<24a9> <74ff>\n<24aa> <74fe>\n<24ab> <74fd>\n<24ac> <751d>\n<24ad> <7579>\n<24ae> <7577>\n<24af> <6983>\n<24b0> <75ef>\n<24b1> <760f>\n<24b2> <7603>\n<24b3> <75f7>\n<24b4> <75fe>\n<24b5> <75fc>\n<24b6> <75f9>\n<24b7> <75f8>\n<24b8> <7610>\n<24b9> <75fb>\n<24ba> <75f6>\n<24bb> <75ed>\n<24bc> <75f5>\n<24bd> <75fd>\n<24be> <7699>\n<24bf> <76b5>\n<24c0> <76dd>\nendbfchar\n\n100 beginbfchar\n<24c1> <7755>\n<24c4> <7752>\n<24c5> <7756>\n<24c6> <775a>\n<24c7> <7769>\n<24c8> <7767>\n<24c9> <7754>\n<24ca> <7759>\n<24cb> <776d>\n<24cc> <77e0>\n<24cd> <7887>\n<24ce> <789a>\n<24cf> <7894>\n<24d0> <788f>\n<24d1> <7884>\n<24d2> <7895>\n<24d5> <78a1>\n<24d6> <7883>\n<24d7> <7879>\n<24d8> <7899>\n<24d9> <7880>\n<24da> <7896>\n<24db> <787b>\n<24dc> <797c>\n<24dd> <7982>\n<24de> <797d>\n<24df> <7979>\n<24e0> <7a11>\n<24e3> <7a12>\n<24e4> <7a17>\n<24e5> <7a15>\n<24e6> <7a22>\n<24e7> <7a13>\n<24e8> <7a1b>\n<24e9> <7a10>\n<24ea> <7aa3>\n<24eb> <7aa2>\n<24ec> <7a9e>\n<24ed> <7aeb>\n<24ee> <7b66>\n<24ef> <7b64>\n<24f0> <7b6d>\n<24f1> <7b74>\n<24f2> <7b69>\n<24f3> <7b72>\n<24f4> <7b65>\n<24f5> <7b73>\n<24f6> <7b71>\n<24f7> <7b70>\n<24f8> <7b61>\n<24f9> <7b78>\n<24fa> <7b76>\n<24fb> <7b63>\n<24fc> <7cb2>\n<24fd> <7cb4>\n<24fe> <7caf>\n<24ff> <7d88>\n<2500> <7d86>\n<2501> <7d80>\n<2502> <7d8d>\n<2503> <7d7f>\n<2504> <7d85>\n<2505> <7d7a>\n<2506> <7d8e>\n<2507> <7d7b>\n<2508> <7d83>\n<2509> <7d7c>\n<250a> <7d8c>\n<250b> <7d94>\n<250c> <7d84>\n<250d> <7d7d>\n<250e> <7d92>\n<250f> <7f6d>\n<2510> <7f6b>\n<2513> <7f6c>\n<2514> <7fa6>\n<2515> <7fa5>\n<2516> <7fa7>\n<2519> <8021>\n<251a> <8164>\n<251b> <8160>\n<251c> <8177>\n<251d> <815c>\n<251e> <8169>\n<251f> <815b>\n<2520> <8162>\n<2521> <8172>\n<2522> <6721>\n<2523> <815e>\n<2524> <8176>\n<2525> <8167>\n<2526> <816f>\n<2527> <8144>\n<2528> <8161>\n<2529> <821d>\n<252a> <8249>\n<252b> <8244>\n<252c> <8240>\n<252d> <8242>\n<252e> <8245>\nendbfchar\n\n100 beginbfchar\n<252f> <84f1>\n<2530> <843f>\n<2531> <8456>\n<2532> <8476>\n<2533> <8479>\n<2534> <848f>\n<2535> <848d>\n<2536> <8465>\n<2537> <8451>\n<2538> <8440>\n<2539> <8486>\n<253a> <8467>\n<253b> <8430>\n<253c> <844d>\n<253d> <847d>\n<253e> <845a>\n<253f> <8459>\n<2540> <8474>\n<2541> <8473>\n<2542> <845d>\n<2543> <8507>\n<2544> <845e>\n<2545> <8437>\n<2546> <843a>\n<2547> <8434>\n<2548> <847a>\n<2549> <8443>\n<254a> <8478>\n<254b> <8432>\n<254c> <8445>\n<254d> <8429>\n<254e> <83d9>\n<254f> <844b>\n<2550> <842f>\n<2551> <8442>\n<2552> <842d>\n<2553> <845f>\n<2554> <8470>\n<2555> <8439>\n<2556> <844e>\n<2557> <844c>\n<2558> <8452>\n<2559> <846f>\n<255a> <84c5>\n<255b> <848e>\n<255c> <843b>\n<255d> <8447>\n<255e> <8436>\n<255f> <8433>\n<2560> <8468>\n<2561> <847e>\n<2562> <8444>\n<2563> <842b>\n<2564> <8460>\n<2565> <8454>\n<2566> <846e>\n<2567> <8450>\n<2568> <870b>\n<2569> <8704>\n<256a> <86f7>\n<256b> <870c>\n<256c> <86fa>\n<256d> <86d6>\n<256e> <86f5>\n<256f> <874d>\n<2570> <86f8>\n<2571> <870e>\n<2572> <8709>\n<2573> <8701>\n<2574> <86f6>\n<2575> <870d>\n<2576> <8705>\n<2577> <88d6>\n<2578> <88cb>\n<257b> <88de>\n<257c> <88db>\n<257d> <88da>\n<257e> <88cc>\n<257f> <88d0>\n<2580> <8985>\n<2581> <899b>\n<2582> <89df>\n<2583> <89e5>\n<2584> <89e4>\n<2585> <89e1>\n<2586> <89e0>\n<2587> <89e2>\n<2588> <89dc>\n<2589> <89e6>\n<258a> <8a76>\n<258b> <8a86>\n<258c> <8a7f>\n<258d> <8a61>\n<258e> <8a3f>\n<258f> <8a77>\n<2590> <8a82>\n<2591> <8a84>\n<2592> <8a75>\n<2593> <8a83>\n<2594> <8a81>\nendbfchar\n\n100 beginbfchar\n<2595> <8a74>\n<2596> <8a7a>\n<2597> <8c3c>\n<2598> <8c4b>\n<2599> <8c4a>\n<259a> <8c65>\n<259b> <8c64>\n<259c> <8c66>\n<259d> <8c86>\n<25a0> <8ccc>\n<25a3> <8d91>\n<25a4> <8d8c>\n<25a7> <8d8d>\n<25aa> <8d90>\n<25ab> <8d92>\n<25ac> <8df0>\n<25ad> <8de0>\n<25ae> <8dec>\n<25af> <8df1>\n<25b0> <8dee>\n<25b1> <8dd0>\n<25b2> <8de9>\n<25b3> <8de3>\n<25b4> <8de2>\n<25b5> <8de7>\n<25b6> <8df2>\n<25b7> <8deb>\n<25b8> <8df4>\n<25b9> <8f06>\n<25ba> <8eff>\n<25bb> <8f01>\n<25bc> <8f00>\n<25bd> <8f05>\n<25c0> <8f02>\n<25c1> <8f0b>\n<25c2> <9052>\n<25c3> <903f>\n<25c4> <9044>\n<25c5> <9049>\n<25c6> <903d>\n<25c7> <9110>\n<25c8> <910d>\n<25c9> <910f>\n<25ca> <9111>\n<25cb> <9116>\n<25cc> <9114>\n<25cd> <910b>\n<25ce> <910e>\n<25d1> <9248>\n<25d2> <9252>\n<25d3> <9230>\n<25d4> <923a>\n<25d5> <9266>\n<25d6> <9233>\n<25d7> <9265>\n<25d8> <925e>\n<25d9> <9283>\n<25da> <922e>\n<25db> <924a>\n<25dc> <9246>\n<25dd> <926d>\n<25de> <926c>\n<25df> <924f>\n<25e0> <9260>\n<25e1> <9267>\n<25e2> <926f>\n<25e3> <9236>\n<25e4> <9261>\n<25e5> <9270>\n<25e6> <9231>\n<25e7> <9254>\n<25e8> <9263>\n<25e9> <9250>\n<25ea> <9272>\n<25eb> <924e>\n<25ec> <9253>\n<25ed> <924c>\n<25ee> <9256>\n<25ef> <9232>\n<25f0> <959f>\n<25f1> <959c>\n<25f2> <959e>\n<25f3> <959b>\n<25f6> <9691>\n<25f7> <9697>\n<25f8> <96ce>\n<25f9> <96fa>\n<25fa> <96fd>\n<25fb> <96f8>\n<25fc> <96f5>\n<25fd> <9773>\n<2600> <9772>\n<2601> <980f>\n<2604> <98ac>\n<2605> <98f6>\n<2606> <98f9>\n<2607> <99af>\n<2608> <99b2>\n<2609> <99b0>\n<260a> <99b5>\nendbfchar\n\n100 beginbfchar\n<260b> <9aad>\n<260c> <9aab>\n<260d> <9b5b>\n<260e> <9cea>\n<260f> <9ced>\n<2610> <9ce7>\n<2611> <9e80>\n<2612> <9efd>\n<2613> <50e6>\n<2614> <50d4>\n<2615> <50d7>\n<2616> <50e8>\n<2617> <50f3>\n<2618> <50db>\n<2619> <50ea>\n<261a> <50dd>\n<261b> <50e4>\n<261c> <50d3>\n<261d> <50ec>\n<261e> <50f0>\n<261f> <50ef>\n<2620> <50e3>\n<2621> <50e0>\n<2622> <51d8>\n<2625> <52e9>\n<2626> <52eb>\n<2627> <5330>\n<2628> <53ac>\n<2629> <5627>\n<262a> <5615>\n<262b> <560c>\n<262c> <5612>\n<262d> <55fc>\n<262e> <560f>\n<262f> <561c>\n<2630> <5601>\n<2631> <5613>\n<2632> <5602>\n<2633> <55fa>\n<2634> <561d>\n<2635> <5604>\n<2636> <55ff>\n<2637> <55f9>\n<2638> <5889>\n<2639> <587c>\n<263a> <5890>\n<263b> <5898>\n<263c> <5886>\n<263d> <5881>\n<263e> <587f>\n<263f> <5874>\n<2640> <588b>\n<2641> <587a>\n<2642> <5887>\n<2643> <5891>\n<2644> <588e>\n<2645> <5876>\n<2646> <5882>\n<2647> <5888>\n<2648> <587b>\n<2649> <5894>\n<264a> <588f>\n<264b> <58fe>\n<264c> <596b>\n<264d> <5adc>\n<264e> <5aee>\n<264f> <5ae5>\n<2650> <5ad5>\n<2651> <5aea>\n<2652> <5ada>\n<2653> <5aed>\n<2654> <5aeb>\n<2655> <5af3>\n<2656> <5ae2>\n<2657> <5ae0>\n<2658> <5adb>\n<2659> <5aec>\n<265a> <5ade>\n<265b> <5add>\n<265c> <5ad9>\n<265d> <5ae8>\n<265e> <5adf>\n<265f> <5b77>\n<2660> <5be0>\n<2661> <5be3>\n<2662> <5c63>\n<2663> <5d82>\n<2664> <5d80>\n<2665> <5d7d>\n<2666> <5d86>\n<2667> <5d7a>\n<2668> <5d81>\n<2669> <5d77>\n<266a> <5d8a>\n<266b> <5d89>\n<266c> <5d88>\n<266d> <5d7e>\n<266e> <5d7c>\n<266f> <5d8d>\n<2670> <5d79>\nendbfchar\n\n100 beginbfchar\n<2671> <5d7f>\n<2674> <5e53>\n<2675> <5ed8>\n<2676> <5ed1>\n<2677> <5ed7>\n<2678> <5ece>\n<2679> <5edc>\n<267a> <5ed5>\n<267b> <5ed9>\n<267c> <5ed2>\n<267d> <5ed4>\n<267e> <5f44>\n<267f> <5f43>\n<2680> <5f6f>\n<2681> <5fb6>\n<2682> <612c>\n<2683> <6128>\n<2684> <6141>\n<2685> <615e>\n<2686> <6171>\n<2687> <6173>\n<268a> <6172>\n<268b> <616c>\n<268c> <6180>\n<268d> <6174>\n<268e> <6154>\n<268f> <617a>\n<2690> <615b>\n<2691> <6165>\n<2692> <613b>\n<2693> <616a>\n<2694> <6161>\n<2695> <6156>\n<2696> <6229>\n<2697> <6227>\n<2698> <622b>\n<2699> <642b>\n<269a> <644d>\n<269b> <645b>\n<269c> <645d>\n<269d> <6474>\n<269e> <6476>\n<26a1> <647d>\n<26a2> <6475>\n<26a3> <6466>\n<26a4> <64a6>\n<26a5> <644e>\n<26a6> <6482>\n<26a7> <645e>\n<26a8> <645c>\n<26a9> <644b>\n<26aa> <6453>\n<26ab> <6460>\n<26ac> <6450>\n<26ad> <647f>\n<26ae> <643f>\n<26af> <646c>\n<26b0> <646b>\n<26b1> <6459>\n<26b2> <6465>\n<26b3> <6477>\n<26b4> <6573>\n<26b5> <65a0>\n<26b6> <66a1>\n<26b7> <66a0>\n<26b8> <669f>\n<26b9> <6705>\n<26ba> <6704>\n<26bb> <6722>\n<26bc> <69b1>\n<26bd> <69b6>\n<26be> <69c9>\n<26bf> <69a0>\n<26c0> <69ce>\n<26c1> <6996>\n<26c2> <69b0>\n<26c3> <69ac>\n<26c4> <69bc>\n<26c5> <6991>\n<26c6> <6999>\n<26c7> <698e>\n<26c8> <69a7>\n<26c9> <698d>\n<26ca> <69a9>\n<26cb> <69be>\n<26cc> <69af>\n<26cd> <69bf>\n<26ce> <69c4>\n<26cf> <69bd>\n<26d0> <69a4>\n<26d1> <69d4>\n<26d2> <69b9>\n<26d3> <69ca>\n<26d4> <699a>\n<26d5> <69cf>\n<26d6> <69b3>\n<26d7> <6993>\n<26d8> <69aa>\n<26d9> <69a1>\n<26da> <699e>\nendbfchar\n\n100 beginbfchar\n<26db> <69d9>\n<26dc> <6997>\n<26dd> <6990>\n<26de> <69c2>\n<26df> <69b5>\n<26e0> <69a5>\n<26e1> <69c6>\n<26e2> <6b4a>\n<26e3> <6b4d>\n<26e4> <6b4b>\n<26ea> <6bfe>\n<26eb> <6ece>\n<26ec> <6ef5>\n<26ed> <6ef1>\n<26ee> <6f03>\n<26ef> <6f25>\n<26f0> <6ef8>\n<26f1> <6f37>\n<26f2> <6efb>\n<26f3> <6f2e>\n<26f4> <6f09>\n<26f5> <6f4e>\n<26f8> <6f27>\n<26f9> <6f18>\n<26fa> <6f3b>\n<26fb> <6f12>\n<26fc> <6eed>\n<26fd> <6f0a>\n<26fe> <6f36>\n<26ff> <6f73>\n<2700> <6ef9>\n<2701> <6eee>\n<2702> <6f2d>\n<2703> <6f40>\n<2704> <6f30>\n<2705> <6f3c>\n<2706> <6f35>\n<2707> <6eeb>\n<2708> <6f07>\n<2709> <6f0e>\n<270a> <6f43>\n<270b> <6f05>\n<270c> <6efd>\n<270d> <6ef6>\n<270e> <6f39>\n<270f> <6f1c>\n<2710> <6efc>\n<2711> <6f3a>\n<2712> <6f1f>\n<2713> <6f0d>\n<2714> <6f1e>\n<2715> <6f08>\n<2716> <6f21>\n<2717> <7187>\n<2718> <7190>\n<2719> <7189>\n<271a> <7180>\n<271b> <7185>\n<271c> <7182>\n<271d> <718f>\n<271e> <717b>\n<271f> <7186>\n<2720> <7181>\n<2721> <7197>\n<2722> <7244>\n<2723> <7253>\n<2724> <7297>\n<2725> <7295>\n<2726> <7293>\n<2727> <7343>\n<2728> <734d>\n<2729> <7351>\n<272a> <734c>\n<272b> <7462>\n<272c> <7473>\n<272d> <7471>\n<272e> <7475>\n<272f> <7472>\n<2730> <7467>\n<2731> <746e>\n<2732> <7500>\n<2735> <757d>\n<2736> <7590>\n<2737> <7616>\n<2738> <7608>\n<2739> <760c>\n<273a> <7615>\n<273b> <7611>\n<273c> <760a>\n<273d> <7614>\n<273e> <76b8>\n<273f> <7781>\n<2740> <777c>\n<2741> <7785>\n<2742> <7782>\n<2743> <776e>\n<2744> <7780>\n<2745> <776f>\n<2746> <777e>\n<2747> <7783>\nendbfchar\n\n100 beginbfchar\n<2748> <78b2>\n<2749> <78aa>\n<274a> <78b4>\n<274b> <78ad>\n<274c> <78a8>\n<274d> <787e>\n<274e> <78ab>\n<274f> <789e>\n<2750> <78a5>\n<2751> <78a0>\n<2752> <78ac>\n<2753> <78a2>\n<2754> <78a4>\n<2755> <7998>\n<2758> <7996>\n<2759> <7995>\n<275a> <7994>\n<275b> <7993>\n<275c> <7997>\n<275d> <7988>\n<275e> <7992>\n<275f> <7990>\n<2760> <7a2b>\n<2761> <7a4a>\n<2762> <7a30>\n<2763> <7a2f>\n<2764> <7a28>\n<2765> <7a26>\n<2766> <7aa8>\n<2769> <7aee>\n<276a> <7b88>\n<276b> <7b9c>\n<276c> <7b8a>\n<276d> <7b91>\n<276e> <7b90>\n<276f> <7b96>\n<2770> <7b8d>\n<2771> <7b8c>\n<2772> <7b9b>\n<2773> <7b8e>\n<2774> <7b85>\n<2775> <7b98>\n<2776> <5284>\n<2777> <7b99>\n<2778> <7ba4>\n<2779> <7b82>\n<277a> <7cbb>\n<277b> <7cbf>\n<277c> <7cbc>\n<277d> <7cba>\n<277e> <7da7>\n<277f> <7db7>\n<2780> <7dc2>\n<2781> <7da3>\n<2782> <7daa>\n<2783> <7dc1>\n<2784> <7dc0>\n<2785> <7dc5>\n<2786> <7d9d>\n<2787> <7dce>\n<2788> <7dc4>\n<2789> <7dc6>\n<278c> <7daf>\n<278d> <7db9>\n<278e> <7d96>\n<278f> <7dbc>\n<2790> <7d9f>\n<2791> <7da6>\n<2792> <7dae>\n<2793> <7da9>\n<2794> <7da1>\n<2795> <7dc9>\n<2796> <7f73>\n<2799> <7fe5>\n<279a> <7fde>\n<279b> <8024>\n<279c> <805d>\n<279d> <805c>\n<279e> <8189>\n<279f> <8186>\n<27a0> <8183>\n<27a1> <8187>\n<27a2> <818d>\n<27a3> <818c>\n<27a4> <818b>\n<27a5> <8215>\n<27a6> <8497>\n<27a7> <84a4>\n<27a8> <84a1>\n<27a9> <849f>\n<27aa> <84ba>\n<27ab> <84ce>\n<27ac> <84c2>\n<27ad> <84ac>\n<27ae> <84ae>\n<27af> <84ab>\n<27b0> <84b9>\n<27b1> <84b4>\n<27b2> <84c1>\n<27b3> <84cd>\nendbfchar\n\n100 beginbfchar\n<27b4> <84aa>\n<27b5> <849a>\n<27b6> <84b1>\n<27b7> <84d0>\n<27b8> <849d>\n<27b9> <84a7>\n<27ba> <84bb>\n<27bb> <84a2>\n<27bc> <8494>\n<27bd> <84c7>\n<27be> <84cc>\n<27bf> <849b>\n<27c0> <84a9>\n<27c1> <84af>\n<27c2> <84a8>\n<27c3> <84d6>\n<27c4> <8498>\n<27c5> <84b6>\n<27c6> <84cf>\n<27c7> <84a0>\n<27c8> <84d7>\n<27c9> <84d4>\n<27ca> <84d2>\n<27cb> <84db>\n<27cc> <84b0>\n<27cd> <8491>\n<27ce> <8661>\n<27cf> <8733>\n<27d0> <8723>\n<27d1> <8728>\n<27d2> <876b>\n<27d3> <8740>\n<27d4> <872e>\n<27d5> <871e>\n<27d6> <8721>\n<27d7> <8719>\n<27d8> <871b>\n<27d9> <8743>\n<27da> <872c>\n<27db> <8741>\n<27dc> <873e>\n<27dd> <8746>\n<27de> <8720>\n<27df> <8732>\n<27e0> <872a>\n<27e1> <872d>\n<27e2> <873c>\n<27e3> <8712>\n<27e4> <873a>\n<27e5> <8731>\n<27e6> <8735>\n<27e7> <8742>\n<27ea> <8738>\n<27eb> <8724>\n<27ec> <871a>\n<27ed> <8730>\n<27ee> <8711>\n<27ef> <88f7>\n<27f0> <88e7>\n<27f3> <88fa>\n<27f4> <88fe>\n<27f5> <88ee>\n<27f6> <88fc>\n<27f7> <88f6>\n<27f8> <88fb>\n<27f9> <88f0>\n<27fa> <88ec>\n<27fb> <88eb>\n<27fc> <899d>\n<27fd> <89a1>\n<27fe> <899f>\n<27ff> <899e>\n<2800> <89e9>\n<2801> <89eb>\n<2802> <89e8>\n<2803> <8aab>\n<2804> <8a99>\n<2805> <8a8b>\n<2806> <8a92>\n<2807> <8a8f>\n<2808> <8a96>\n<2809> <8c3d>\n<280c> <8cd5>\n<280d> <8ccf>\n<280e> <8cd7>\n<280f> <8d96>\n<2810> <8e09>\n<2811> <8e02>\n<2812> <8dff>\n<2813> <8e0d>\n<2814> <8dfd>\n<2815> <8e0a>\n<2816> <8e03>\n<2817> <8e07>\n<2818> <8e06>\n<2819> <8e05>\n<281a> <8dfe>\n<281b> <8e00>\n<281c> <8e04>\n<281f> <8f0e>\nendbfchar\n\n100 beginbfchar\n<2820> <8f0d>\n<2821> <9123>\n<2822> <911c>\n<2823> <9120>\n<2824> <9122>\n<2825> <911f>\n<2826> <911d>\n<2827> <911a>\n<2828> <9124>\n<2829> <9121>\n<282a> <911b>\n<282b> <917a>\n<282c> <9172>\n<282d> <9179>\n<282e> <9173>\n<282f> <92a5>\n<2830> <92a4>\n<2831> <9276>\n<2832> <929b>\n<2833> <927a>\n<2834> <92a0>\n<2835> <9294>\n<2836> <92aa>\n<2837> <928d>\n<2838> <92a6>\n<2839> <929a>\n<283a> <92ab>\n<283b> <9279>\n<283c> <9297>\n<283d> <927f>\n<283e> <92a3>\n<283f> <92ee>\n<2840> <928e>\n<2841> <9282>\n<2842> <9295>\n<2843> <92a2>\n<2844> <927d>\n<2845> <9288>\n<2846> <92a1>\n<2847> <928a>\n<2848> <9286>\n<2849> <928c>\n<284a> <9299>\n<284b> <92a7>\n<284c> <927e>\n<284d> <9287>\n<284e> <92a9>\n<284f> <929d>\n<2850> <928b>\n<2851> <922d>\n<2852> <969e>\n<2853> <96a1>\n<2854> <96ff>\n<2855> <9758>\n<2856> <977d>\n<2857> <977a>\n<2858> <977e>\n<2859> <9783>\n<285a> <9780>\n<285b> <9782>\n<285c> <977b>\n<285d> <9784>\n<285e> <9781>\n<285f> <977f>\n<2860> <97ce>\n<2861> <97cd>\n<2862> <9816>\n<2865> <9902>\n<2866> <9900>\n<2867> <9907>\n<2868> <999d>\n<2869> <999c>\n<286a> <99c3>\n<286b> <99b9>\n<286c> <99bb>\n<286d> <99ba>\n<286e> <99c2>\n<286f> <99bd>\n<2870> <99c7>\n<2871> <9ab1>\n<2872> <9ae3>\n<2873> <9ae7>\n<2878> <9b5f>\n<287b> <9cf5>\n<287c> <9ea7>\n<287d> <50ff>\n<287e> <5103>\n<287f> <5130>\n<2880> <50f8>\n<2883> <50f6>\n<2884> <50fe>\n<2887> <50fd>\n<2888> <510a>\n<288b> <52f1>\n<288c> <52ef>\n<288d> <5648>\n<288e> <5642>\n<288f> <564c>\n<2890> <5635>\n<2891> <5641>\nendbfchar\n\n100 beginbfchar\n<2892> <564a>\n<2893> <5649>\n<2894> <5646>\n<2895> <5658>\n<2896> <565a>\n<2897> <5640>\n<2898> <5633>\n<2899> <563d>\n<289a> <562c>\n<289b> <563e>\n<289c> <5638>\n<289d> <562a>\n<289e> <563a>\n<289f> <571a>\n<28a0> <58ab>\n<28a1> <589d>\n<28a2> <58b1>\n<28a3> <58a0>\n<28a4> <58a3>\n<28a5> <58af>\n<28a6> <58ac>\n<28a7> <58a5>\n<28a8> <58a1>\n<28a9> <58ff>\n<28aa> <5aff>\n<28ab> <5af4>\n<28ac> <5afd>\n<28ad> <5af7>\n<28ae> <5af6>\n<28af> <5b03>\n<28b0> <5af8>\n<28b1> <5b02>\n<28b2> <5af9>\n<28b3> <5b01>\n<28b4> <5b07>\n<28b5> <5b05>\n<28b6> <5b0f>\n<28b7> <5c67>\n<28b8> <5d99>\n<28b9> <5d97>\n<28ba> <5d9f>\n<28bb> <5d92>\n<28bc> <5da2>\n<28bd> <5d93>\n<28be> <5d95>\n<28bf> <5da0>\n<28c0> <5d9c>\n<28c1> <5da1>\n<28c2> <5d9a>\n<28c3> <5d9e>\n<28c4> <5e69>\n<28c5> <5e5d>\n<28c6> <5e60>\n<28c7> <5e5c>\n<28c8> <7df3>\n<28c9> <5edb>\n<28ca> <5ede>\n<28cb> <5ee1>\n<28cc> <5f49>\n<28cd> <5fb2>\n<28ce> <618b>\n<28cf> <6183>\n<28d0> <6179>\n<28d1> <61b1>\n<28d2> <61b0>\n<28d3> <61a2>\n<28d4> <6189>\n<28d5> <619b>\n<28d6> <6193>\n<28d7> <61af>\n<28d8> <61ad>\n<28d9> <619f>\n<28da> <6192>\n<28db> <61aa>\n<28dc> <61a1>\n<28dd> <618d>\n<28de> <6166>\n<28df> <61b3>\n<28e0> <622d>\n<28e1> <646e>\n<28e2> <6470>\n<28e3> <6496>\n<28e4> <64a0>\n<28e5> <6485>\n<28e6> <6497>\n<28e7> <649c>\n<28e8> <648f>\n<28e9> <648b>\n<28ea> <648a>\n<28eb> <648c>\n<28ec> <64a3>\n<28ed> <649f>\n<28ee> <6468>\n<28ef> <64b1>\n<28f0> <6498>\n<28f1> <6576>\n<28f2> <657a>\n<28f3> <6579>\n<28f4> <657b>\n<28f7> <66b5>\nendbfchar\n\n100 beginbfchar\n<28f8> <66b0>\n<28f9> <66a9>\n<28fa> <66b2>\n<28fb> <66b7>\n<28fc> <66aa>\n<28fd> <66af>\n<28fe> <6a00>\n<28ff> <6a06>\n<2900> <6a17>\n<2901> <69e5>\n<2902> <69f8>\n<2903> <6a15>\n<2904> <69f1>\n<2905> <69e4>\n<2906> <6a20>\n<2907> <69ff>\n<2908> <69ec>\n<2909> <69e2>\n<290a> <6a1b>\n<290b> <6a1d>\n<290c> <69fe>\n<290d> <6a27>\n<290e> <69f2>\n<290f> <69ee>\n<2910> <6a14>\n<2911> <69f7>\n<2912> <69e7>\n<2913> <6a40>\n<2914> <6a08>\n<2915> <69e6>\n<2916> <69fb>\n<2917> <6a0d>\n<2918> <69fc>\n<2919> <69eb>\n<291a> <6a09>\n<291b> <6a04>\n<291c> <6a18>\n<291d> <6a25>\n<291e> <6a0f>\n<291f> <69f6>\n<2920> <6a26>\n<2921> <6a07>\n<2922> <69f4>\n<2923> <6a16>\n<2924> <6b51>\n<2925> <6ba5>\n<2926> <6ba3>\n<2927> <6ba2>\n<2928> <6ba6>\n<2929> <6c01>\n<292a> <6c00>\n<292b> <6bff>\n<292c> <6c02>\n<292d> <6f41>\n<292e> <6f26>\n<292f> <6f7e>\n<2930> <6f87>\n<2931> <6fc6>\n<2932> <6f92>\n<2933> <6f8d>\n<2934> <6f89>\n<2935> <6f8c>\n<2936> <6f62>\n<2937> <6f4f>\n<2938> <6f85>\n<2939> <6f5a>\n<293a> <6f96>\n<293b> <6f76>\n<293c> <6f6c>\n<293d> <6f82>\n<293e> <6f55>\n<293f> <6f72>\n<2940> <6f52>\n<2941> <6f50>\n<2942> <6f57>\n<2943> <6f94>\n<2944> <6f93>\n<2945> <6f5d>\n<2946> <6f00>\n<2947> <6f61>\n<2948> <6f6b>\n<2949> <6f7d>\n<294a> <6f67>\n<294b> <6f90>\n<294c> <6f53>\n<294d> <6f8b>\n<294e> <6f69>\n<294f> <6f7f>\n<2950> <6f95>\n<2951> <6f63>\n<2952> <6f77>\n<2953> <6f6a>\n<2954> <6f7b>\n<2955> <71b2>\n<2956> <71af>\n<2957> <719b>\n<2958> <71b0>\n<2959> <71a0>\n<295a> <719a>\n<295b> <71a9>\nendbfchar\n\n100 beginbfchar\n<295c> <71b5>\n<295d> <719d>\n<295e> <71a5>\n<295f> <719e>\n<2960> <71a4>\n<2961> <71a1>\n<2962> <71aa>\n<2963> <719c>\n<2964> <71a7>\n<2965> <71b3>\n<2966> <7298>\n<2967> <729a>\n<2968> <7358>\n<2969> <7352>\n<296d> <735d>\n<296e> <735b>\n<296f> <7361>\n<2970> <735a>\n<2971> <7359>\n<2972> <7362>\n<2973> <7487>\n<2976> <7486>\n<2977> <7481>\n<2978> <747d>\n<2979> <7485>\n<297a> <7488>\n<297b> <747c>\n<297c> <7479>\n<297d> <7508>\n<297e> <7507>\n<297f> <757e>\n<2980> <7625>\n<2981> <761e>\n<2982> <7619>\n<2983> <761d>\n<2984> <761c>\n<2985> <7623>\n<2986> <761a>\n<2987> <7628>\n<2988> <761b>\n<298c> <769b>\n<298d> <778d>\n<298e> <778f>\n<298f> <7789>\n<2990> <7788>\n<2991> <78cd>\n<2992> <78bb>\n<2993> <78cf>\n<2994> <78cc>\n<2995> <78d1>\n<2996> <78ce>\n<2997> <78d4>\n<2998> <78c8>\n<299b> <78c9>\n<299c> <799a>\n<299d> <79a1>\n<299e> <79a0>\n<299f> <799c>\n<29a0> <79a2>\n<29a1> <799b>\n<29a2> <6b76>\n<29a3> <7a39>\n<29a4> <7ab2>\n<29a5> <7ab4>\n<29a6> <7ab3>\n<29a7> <7bb7>\n<29a8> <7bcb>\n<29a9> <7bbe>\n<29aa> <7bac>\n<29ab> <7bce>\n<29ac> <7baf>\n<29ad> <7bb9>\n<29ae> <7bca>\n<29af> <7bb5>\n<29b0> <7cc5>\n<29b1> <7cc8>\n<29b2> <7ccc>\n<29b3> <7ccb>\n<29b4> <7df7>\n<29b5> <7ddb>\n<29b6> <7dea>\n<29b7> <7de7>\n<29b8> <7dd7>\n<29b9> <7de1>\n<29ba> <7e03>\n<29bb> <7dfa>\n<29bc> <7de6>\n<29bd> <7df6>\n<29be> <7df1>\n<29bf> <7df0>\n<29c0> <7dee>\n<29c1> <7ddf>\n<29c2> <7f76>\n<29c3> <7fac>\n<29c4> <7fb0>\n<29c5> <7fad>\n<29c6> <7fed>\n<29c7> <7feb>\n<29c8> <7fea>\n<29c9> <7fec>\nendbfchar\n\n100 beginbfchar\n<29ca> <7fe6>\n<29cb> <7fe8>\n<29cc> <8064>\n<29cd> <8067>\n<29ce> <81a3>\n<29cf> <819f>\n<29d0> <819e>\n<29d1> <8195>\n<29d2> <81a2>\n<29d3> <8199>\n<29d4> <8197>\n<29d5> <8216>\n<29d6> <824f>\n<29d7> <8253>\n<29d8> <8252>\n<29d9> <8250>\n<29da> <824e>\n<29db> <8251>\n<29dc> <8524>\n<29dd> <853b>\n<29de> <850f>\n<29df> <8500>\n<29e0> <8529>\n<29e1> <850e>\n<29e2> <8509>\n<29e3> <850d>\n<29e4> <851f>\n<29e5> <850a>\n<29e6> <8527>\n<29e7> <851c>\n<29e8> <84fb>\n<29e9> <852b>\n<29ea> <84fa>\n<29eb> <8508>\n<29ec> <850c>\n<29ed> <84f4>\n<29ee> <852a>\n<29ef> <84f2>\n<29f0> <8515>\n<29f1> <84f7>\n<29f2> <84eb>\n<29f3> <84f3>\n<29f4> <84fc>\n<29f5> <8512>\n<29f6> <84ea>\n<29f7> <84e9>\n<29f8> <8516>\n<29f9> <84fe>\n<29fa> <8528>\n<29fb> <851d>\n<29fc> <852e>\n<29fd> <8502>\n<29fe> <84fd>\n<29ff> <851e>\n<2a00> <84f6>\n<2a01> <8531>\n<2a02> <8526>\n<2a05> <84f0>\n<2a06> <84ef>\n<2a07> <84f9>\n<2a08> <8518>\n<2a09> <8520>\n<2a0a> <8530>\n<2a0b> <850b>\n<2a0c> <8519>\n<2a0d> <852f>\n<2a0e> <8662>\n<2a0f> <8756>\n<2a12> <8777>\n<2a13> <87e1>\n<2a14> <8773>\n<2a15> <8758>\n<2a16> <8754>\n<2a17> <875b>\n<2a18> <8752>\n<2a19> <8761>\n<2a1a> <875a>\n<2a1b> <8751>\n<2a1c> <875e>\n<2a1d> <876d>\n<2a1e> <876a>\n<2a1f> <8750>\n<2a20> <874e>\n<2a21> <875f>\n<2a22> <875d>\n<2a23> <876f>\n<2a24> <876c>\n<2a25> <877a>\n<2a26> <876e>\n<2a27> <875c>\n<2a28> <8765>\n<2a29> <874f>\n<2a2a> <877b>\n<2a2b> <8775>\n<2a2c> <8762>\n<2a2d> <8767>\n<2a2e> <8769>\n<2a2f> <885a>\n<2a30> <8905>\n<2a31> <890c>\nendbfchar\n\n100 beginbfchar\n<2a32> <8914>\n<2a33> <890b>\n<2a37> <8906>\n<2a38> <8916>\n<2a39> <8911>\n<2a3a> <890e>\n<2a3b> <8909>\n<2a3c> <89a2>\n<2a3d> <89a4>\n<2a3e> <89a3>\n<2a3f> <89ed>\n<2a40> <89f0>\n<2a41> <89ec>\n<2a42> <8acf>\n<2a43> <8ac6>\n<2a44> <8ab8>\n<2a45> <8ad3>\n<2a46> <8ad1>\n<2a49> <8abb>\n<2a4a> <8ad7>\n<2a4b> <8abe>\n<2a4c> <8ac0>\n<2a4d> <8ac5>\n<2a4e> <8ad8>\n<2a4f> <8ac3>\n<2a50> <8aba>\n<2a51> <8abd>\n<2a52> <8ad9>\n<2a53> <8c3e>\n<2a54> <8c4d>\n<2a55> <8c8f>\n<2a56> <8ce5>\n<2a57> <8cdf>\n<2a58> <8cd9>\n<2a59> <8ce8>\n<2a5a> <8cda>\n<2a5b> <8cdd>\n<2a5c> <8ce7>\n<2a5d> <8da0>\n<2a5e> <8d9c>\n<2a5f> <8da1>\n<2a60> <8d9b>\n<2a61> <8e20>\n<2a62> <8e23>\n<2a63> <8e25>\n<2a64> <8e24>\n<2a65> <8e2e>\n<2a66> <8e15>\n<2a67> <8e1b>\n<2a68> <8e16>\n<2a69> <8e11>\n<2a6a> <8e19>\n<2a6d> <8e14>\n<2a6e> <8e12>\n<2a6f> <8e18>\n<2a70> <8e13>\n<2a71> <8e1c>\n<2a72> <8e17>\n<2a73> <8e1a>\n<2a74> <8f2c>\n<2a75> <8f24>\n<2a76> <8f18>\n<2a77> <8f1a>\n<2a78> <8f20>\n<2a79> <8f23>\n<2a7c> <9073>\n<2a7d> <9070>\n<2a7e> <906f>\n<2a7f> <9067>\n<2a80> <906b>\n<2a81> <912f>\n<2a82> <912b>\n<2a85> <9132>\n<2a86> <9126>\n<2a87> <912e>\n<2a8a> <918a>\n<2a8d> <9184>\n<2a8e> <9180>\n<2a8f> <92d0>\n<2a92> <92c0>\n<2a93> <92d9>\n<2a94> <92b6>\n<2a95> <92cf>\n<2a96> <92f1>\n<2a97> <92df>\n<2a98> <92d8>\n<2a99> <92e9>\n<2a9a> <92d7>\n<2a9b> <92dd>\n<2a9c> <92cc>\n<2a9d> <92ef>\n<2a9e> <92c2>\n<2a9f> <92e8>\n<2aa0> <92ca>\n<2aa1> <92c8>\n<2aa2> <92ce>\n<2aa3> <92e6>\n<2aa4> <92cd>\n<2aa5> <92d5>\n<2aa6> <92c9>\nendbfchar\n\n100 beginbfchar\n<2aa7> <92e0>\n<2aa8> <92de>\n<2aa9> <92e7>\n<2aaa> <92d1>\n<2aab> <92d3>\n<2aac> <92b5>\n<2aad> <92e1>\n<2aae> <9325>\n<2aaf> <92c6>\n<2ab0> <92b4>\n<2ab1> <957c>\n<2ab2> <95ac>\n<2ab3> <95ab>\n<2ab4> <95ae>\n<2ab5> <95b0>\n<2ab6> <96a4>\n<2ab7> <96a2>\n<2ab8> <96d3>\n<2ab9> <9705>\n<2aba> <9708>\n<2abb> <9702>\n<2abc> <975a>\n<2abd> <978a>\n<2abe> <978e>\n<2abf> <9788>\n<2ac0> <97d0>\n<2ac1> <97cf>\n<2ac2> <981e>\n<2ac3> <981d>\n<2ac4> <9826>\n<2ac5> <9829>\n<2ac6> <9828>\n<2ac7> <9820>\n<2ac8> <981b>\n<2ac9> <9827>\n<2aca> <98b2>\n<2acb> <9908>\n<2acc> <98fa>\n<2acd> <9911>\n<2ace> <9914>\n<2ad1> <9915>\n<2ad2> <99dc>\n<2ad3> <99cd>\n<2ad4> <99cf>\n<2ad7> <99ce>\n<2ad8> <99c9>\n<2ad9> <99d6>\n<2ada> <99d8>\n<2adb> <99cb>\n<2adc> <99d7>\n<2add> <99cc>\n<2ade> <9ab3>\n<2adf> <9aec>\n<2ae0> <9aeb>\n<2ae1> <9af3>\n<2ae2> <9af2>\n<2ae3> <9af1>\n<2ae4> <9b46>\n<2ae5> <9b43>\n<2ae6> <9b67>\n<2ae7> <9b74>\n<2ae8> <9b71>\n<2ae9> <9b66>\n<2aea> <9b76>\n<2aeb> <9b75>\n<2aec> <9b70>\n<2aed> <9b68>\n<2aee> <9b64>\n<2aef> <9b6c>\n<2af0> <9cfc>\n<2af1> <9cfa>\n<2af2> <9cfd>\n<2af3> <9cff>\n<2af4> <9cf7>\n<2af5> <9d07>\n<2af6> <9d00>\n<2af7> <9cf9>\n<2af8> <9cfb>\n<2af9> <9d08>\n<2afa> <9d05>\n<2afb> <9d04>\n<2afc> <9e83>\n<2afd> <9ed3>\n<2b00> <511c>\n<2b01> <5113>\n<2b02> <5117>\n<2b03> <511a>\n<2b04> <5111>\n<2b05> <51de>\n<2b06> <5334>\n<2b07> <53e1>\n<2b08> <5670>\n<2b09> <5660>\n<2b0a> <566e>\n<2b0b> <5673>\n<2b0c> <5666>\n<2b0d> <5663>\n<2b0e> <566d>\n<2b0f> <5672>\n<2b10> <565e>\nendbfchar\n\n100 beginbfchar\n<2b11> <5677>\n<2b12> <571c>\n<2b13> <571b>\n<2b14> <58c8>\n<2b15> <58bd>\n<2b16> <58c9>\n<2b17> <58bf>\n<2b18> <58ba>\n<2b19> <58c2>\n<2b1a> <58bc>\n<2b1b> <58c6>\n<2b1c> <5b17>\n<2b1d> <5b19>\n<2b1e> <5b1b>\n<2b1f> <5b21>\n<2b20> <5b14>\n<2b21> <5b13>\n<2b22> <5b10>\n<2b23> <5b16>\n<2b24> <5b28>\n<2b25> <5b1a>\n<2b26> <5b20>\n<2b27> <5b1e>\n<2b28> <5bef>\n<2b29> <5dac>\n<2b2a> <5db1>\n<2b2b> <5da9>\n<2b2c> <5da7>\n<2b2d> <5db5>\n<2b2e> <5db0>\n<2b2f> <5dae>\n<2b30> <5daa>\n<2b31> <5da8>\n<2b32> <5db2>\n<2b33> <5dad>\n<2b34> <5daf>\n<2b35> <5db4>\n<2b38> <5e66>\n<2b39> <5e6f>\n<2b3a> <5ee9>\n<2b3b> <5ee7>\n<2b3c> <5ee6>\n<2b3d> <5ee8>\n<2b3e> <5ee5>\n<2b3f> <5f4b>\n<2b40> <5fbc>\n<2b41> <5fbb>\n<2b42> <619d>\n<2b43> <61a8>\n<2b44> <6196>\n<2b45> <61c5>\n<2b46> <61b4>\n<2b47> <61c6>\n<2b48> <61c1>\n<2b49> <61cc>\n<2b4a> <61ba>\n<2b4b> <61bf>\n<2b4c> <61b8>\n<2b4d> <618c>\n<2b4e> <64d7>\n<2b4f> <64d6>\n<2b50> <64d0>\n<2b51> <64cf>\n<2b52> <64c9>\n<2b53> <64bd>\n<2b54> <6489>\n<2b55> <64c3>\n<2b56> <64db>\n<2b57> <64f3>\n<2b58> <64d9>\n<2b59> <6533>\n<2b5a> <657f>\n<2b5b> <657c>\n<2b5c> <65a2>\n<2b5d> <66c8>\n<2b5e> <66be>\n<2b5f> <66c0>\n<2b62> <66cf>\n<2b63> <66bd>\n<2b64> <66bb>\n<2b65> <66ba>\n<2b66> <66cc>\n<2b67> <6723>\n<2b68> <6a34>\n<2b69> <6a66>\n<2b6a> <6a49>\n<2b6b> <6a67>\n<2b6c> <6a32>\n<2b6d> <6a68>\n<2b6e> <6a3e>\n<2b6f> <6a5d>\n<2b70> <6a6d>\n<2b71> <6a76>\n<2b72> <6a5b>\n<2b73> <6a51>\n<2b74> <6a28>\n<2b75> <6a5a>\n<2b76> <6a3b>\n<2b77> <6a3f>\n<2b78> <6a41>\nendbfchar\n\n100 beginbfchar\n<2b79> <6a6a>\n<2b7a> <6a64>\n<2b7b> <6a50>\n<2b7c> <6a4f>\n<2b7d> <6a54>\n<2b7e> <6a6f>\n<2b7f> <6a69>\n<2b80> <6a60>\n<2b81> <6a3c>\n<2b82> <6a5e>\n<2b83> <6a56>\n<2b84> <6a55>\n<2b87> <6a46>\n<2b88> <6b55>\n<2b89> <6b54>\n<2b8a> <6b56>\n<2b8b> <6ba7>\n<2b8e> <6bc8>\n<2b8f> <6bc7>\n<2b90> <6c04>\n<2b91> <6c03>\n<2b92> <6c06>\n<2b93> <6fad>\n<2b94> <6fcb>\n<2b95> <6fa3>\n<2b96> <6fc7>\n<2b97> <6fbc>\n<2b98> <6fce>\n<2b99> <6fc8>\n<2b9a> <6f5e>\n<2b9b> <6fc4>\n<2b9c> <6fbd>\n<2b9d> <6f9e>\n<2b9e> <6fca>\n<2b9f> <6fa8>\n<2ba0> <7004>\n<2ba1> <6fa5>\n<2ba2> <6fae>\n<2ba3> <6fba>\n<2ba4> <6fac>\n<2ba5> <6faa>\n<2ba6> <6fcf>\n<2ba7> <6fbf>\n<2ba8> <6fb8>\n<2ba9> <6fa2>\n<2baa> <6fc9>\n<2bab> <6fab>\n<2bac> <6fcd>\n<2bad> <6faf>\n<2bae> <6fb2>\n<2baf> <6fb0>\n<2bb0> <71c5>\n<2bb1> <71c2>\n<2bb2> <71bf>\n<2bb3> <71b8>\n<2bb4> <71d6>\n<2bb7> <71cb>\n<2bb8> <71d4>\n<2bb9> <71ca>\n<2bba> <71c7>\n<2bbb> <71cf>\n<2bbc> <71bd>\n<2bbd> <71d8>\n<2bbe> <71bc>\n<2bbf> <71c6>\n<2bc4> <7369>\n<2bc7> <736c>\n<2bc8> <7365>\n<2bc9> <736b>\n<2bca> <736a>\n<2bcb> <747f>\n<2bcc> <749a>\n<2bcd> <74a0>\n<2bce> <7494>\n<2bcf> <7492>\n<2bd0> <7495>\n<2bd1> <74a1>\n<2bd2> <750b>\n<2bd3> <7580>\n<2bd4> <762f>\n<2bd5> <762d>\n<2bd6> <7631>\n<2bd7> <763d>\n<2bd8> <7633>\n<2bd9> <763c>\n<2bda> <7635>\n<2bdb> <7632>\n<2bdc> <7630>\n<2bdd> <76bb>\n<2bde> <76e6>\n<2bdf> <779a>\n<2be0> <779d>\n<2be1> <77a1>\n<2be2> <779c>\n<2be3> <779b>\n<2be6> <7795>\n<2be7> <7799>\n<2be8> <7797>\n<2be9> <78dd>\n<2bea> <78e9>\nendbfchar\n\n100 beginbfchar\n<2beb> <78e5>\n<2bec> <78ea>\n<2bed> <78de>\n<2bee> <78e3>\n<2bef> <78db>\n<2bf2> <78ed>\n<2bf5> <79a4>\n<2bf6> <7a44>\n<2bf7> <7a48>\n<2bf8> <7a47>\n<2bf9> <7ab6>\n<2bfa> <7ab8>\n<2bfb> <7ab5>\n<2bfc> <7ab1>\n<2bfd> <7ab7>\n<2bfe> <7bde>\n<2bff> <7be3>\n<2c00> <7be7>\n<2c01> <7bdd>\n<2c02> <7bd5>\n<2c03> <7be5>\n<2c04> <7bda>\n<2c05> <7be8>\n<2c06> <7bf9>\n<2c07> <7bd4>\n<2c08> <7bea>\n<2c09> <7be2>\n<2c0a> <7bdc>\n<2c0b> <7beb>\n<2c0c> <7bd8>\n<2c0d> <7bdf>\n<2c0e> <7cd2>\n<2c0f> <7cd4>\n<2c10> <7cd7>\n<2c13> <7e12>\n<2c14> <7e21>\n<2c15> <7e17>\n<2c16> <7e0c>\n<2c19> <7e13>\n<2c1a> <7e0e>\n<2c1b> <7e1c>\n<2c1c> <7e15>\n<2c1d> <7e1a>\n<2c1e> <7e22>\n<2c1f> <7e0b>\n<2c20> <7e0f>\n<2c21> <7e16>\n<2c22> <7e0d>\n<2c23> <7e14>\n<2c24> <7e25>\n<2c25> <7e24>\n<2c26> <7f43>\n<2c29> <7f7a>\n<2c2a> <7fb1>\n<2c2b> <7fef>\n<2c2c> <802a>\n<2c2d> <8029>\n<2c2e> <806c>\n<2c2f> <81b1>\n<2c30> <81a6>\n<2c31> <81ae>\n<2c32> <81b9>\n<2c33> <81b5>\n<2c34> <81ab>\n<2c35> <81b0>\n<2c36> <81ac>\n<2c37> <81b4>\n<2c38> <81b2>\n<2c39> <81b7>\n<2c3a> <81a7>\n<2c3b> <81f2>\n<2c3f> <8556>\n<2c40> <8545>\n<2c41> <856b>\n<2c42> <854d>\n<2c43> <8553>\n<2c44> <8561>\n<2c45> <8558>\n<2c46> <8540>\n<2c47> <8546>\n<2c48> <8564>\n<2c49> <8541>\n<2c4a> <8562>\n<2c4b> <8544>\n<2c4c> <8551>\n<2c4d> <8547>\n<2c4e> <8563>\n<2c4f> <853e>\n<2c50> <855b>\n<2c51> <8571>\n<2c52> <854e>\n<2c53> <856e>\n<2c54> <8575>\n<2c55> <8555>\n<2c56> <8567>\n<2c57> <8560>\n<2c58> <858c>\n<2c59> <8566>\n<2c5a> <855d>\n<2c5b> <8554>\nendbfchar\n\n100 beginbfchar\n<2c5c> <8565>\n<2c5d> <856c>\n<2c5e> <8663>\n<2c5f> <8665>\n<2c60> <8664>\n<2c61> <87a4>\n<2c62> <879b>\n<2c63> <878f>\n<2c64> <8797>\n<2c65> <8793>\n<2c66> <8792>\n<2c67> <8788>\n<2c68> <8781>\n<2c69> <8796>\n<2c6a> <8798>\n<2c6b> <8779>\n<2c6c> <8787>\n<2c6d> <87a3>\n<2c6e> <8785>\n<2c71> <879d>\n<2c72> <8784>\n<2c73> <8794>\n<2c74> <879c>\n<2c75> <879a>\n<2c76> <8789>\n<2c77> <891e>\n<2c78> <8926>\n<2c79> <8930>\n<2c7c> <8927>\n<2c7d> <8931>\n<2c7e> <8922>\n<2c7f> <8929>\n<2c80> <8923>\n<2c81> <892f>\n<2c82> <892c>\n<2c83> <891f>\n<2c84> <89f1>\n<2c85> <8ae0>\n<2c86> <8ae2>\n<2c87> <8af2>\n<2c8a> <8add>\n<2c8b> <8b14>\n<2c8c> <8ae4>\n<2c8d> <8adf>\n<2c8e> <8af0>\n<2c8f> <8ac8>\n<2c90> <8ade>\n<2c91> <8ae1>\n<2c92> <8ae8>\n<2c93> <8aff>\n<2c94> <8aef>\n<2c95> <8afb>\n<2c98> <8c90>\n<2c99> <8cf5>\n<2c9a> <8cee>\n<2c9b> <8cf1>\n<2c9c> <8cf0>\n<2c9d> <8cf3>\n<2c9e> <8d6c>\n<2c9f> <8d6e>\n<2ca0> <8da5>\n<2ca1> <8da7>\n<2ca2> <8e33>\n<2ca3> <8e3e>\n<2ca4> <8e38>\n<2ca5> <8e40>\n<2ca6> <8e45>\n<2ca7> <8e36>\n<2caa> <8e41>\n<2cab> <8e30>\n<2cac> <8e3f>\n<2cad> <8ebd>\n<2cae> <8f36>\n<2caf> <8f2e>\n<2cb0> <8f35>\n<2cb1> <8f32>\n<2cb2> <8f39>\n<2cb3> <8f37>\n<2cb4> <8f34>\n<2cb5> <9076>\n<2cb6> <9079>\n<2cb7> <907b>\n<2cb8> <9086>\n<2cb9> <90fa>\n<2cba> <9133>\n<2cbd> <9193>\n<2cc0> <918d>\n<2cc1> <918f>\n<2cc2> <9327>\n<2cc3> <931e>\n<2cc4> <9308>\n<2cc5> <931f>\n<2cc6> <9306>\n<2cc7> <930f>\n<2cc8> <937a>\n<2cc9> <9338>\n<2cca> <933c>\n<2ccb> <931b>\n<2ccc> <9323>\n<2ccd> <9312>\nendbfchar\n\n100 beginbfchar\n<2cce> <9301>\n<2ccf> <9346>\n<2cd0> <932d>\n<2cd1> <930e>\n<2cd2> <930d>\n<2cd3> <92cb>\n<2cd4> <931d>\n<2cd5> <92fa>\n<2cd6> <9313>\n<2cd7> <92f9>\n<2cd8> <92f7>\n<2cd9> <9334>\n<2cda> <9302>\n<2cdb> <9324>\n<2cdc> <92ff>\n<2cdd> <9329>\n<2cde> <9339>\n<2cdf> <9335>\n<2ce0> <932a>\n<2ce1> <9314>\n<2ce2> <930c>\n<2ce3> <930b>\n<2ce4> <92fe>\n<2ce5> <9309>\n<2ce6> <9300>\n<2ce7> <92fb>\n<2ce8> <9316>\n<2ce9> <95bc>\n<2cea> <95cd>\n<2ceb> <95be>\n<2cee> <95b6>\n<2cef> <95bf>\n<2cf0> <95b5>\n<2cf1> <95bd>\n<2cf2> <96a9>\n<2cf3> <96d4>\n<2cf4> <970b>\n<2cf5> <9712>\n<2cf6> <9710>\n<2cf7> <9799>\n<2cf8> <9797>\n<2cf9> <9794>\n<2cfa> <97f0>\n<2cfb> <97f8>\n<2cfc> <9835>\n<2cfd> <982f>\n<2cfe> <9832>\n<2cff> <9924>\n<2d00> <991f>\n<2d01> <9927>\n<2d02> <9929>\n<2d03> <999e>\n<2d04> <99ee>\n<2d05> <99ec>\n<2d06> <99e5>\n<2d07> <99e4>\n<2d08> <99f0>\n<2d09> <99e3>\n<2d0a> <99ea>\n<2d0b> <99e9>\n<2d0c> <99e7>\n<2d0d> <9ab9>\n<2d0e> <9abf>\n<2d0f> <9ab4>\n<2d10> <9abb>\n<2d11> <9af6>\n<2d12> <9afa>\n<2d13> <9af9>\n<2d14> <9af7>\n<2d15> <9b33>\n<2d16> <9b80>\n<2d17> <9b85>\n<2d18> <9b87>\n<2d19> <9b7c>\n<2d1a> <9b7e>\n<2d1b> <9b7b>\n<2d1c> <9b82>\n<2d1d> <9b93>\n<2d1e> <9b92>\n<2d1f> <9b90>\n<2d20> <9b7a>\n<2d21> <9b95>\n<2d22> <9b7d>\n<2d23> <9b88>\n<2d24> <9d25>\n<2d25> <9d17>\n<2d26> <9d20>\n<2d27> <9d1e>\n<2d28> <9d14>\n<2d29> <9d29>\n<2d2a> <9d1d>\n<2d2b> <9d18>\n<2d2c> <9d22>\n<2d2d> <9d10>\n<2d2e> <9d19>\n<2d2f> <9d1f>\n<2d30> <9e88>\n<2d33> <9eae>\n<2d34> <9ead>\n<2d37> <9efa>\nendbfchar\n\n100 beginbfchar\n<2d38> <9f12>\n<2d39> <9f3d>\n<2d3a> <5126>\n<2d3b> <5125>\n<2d3c> <5122>\n<2d3d> <5124>\n<2d3e> <5120>\n<2d3f> <5129>\n<2d40> <52f4>\n<2d41> <5693>\n<2d44> <5686>\n<2d45> <5684>\n<2d46> <5683>\n<2d47> <567e>\n<2d48> <5682>\n<2d49> <567f>\n<2d4a> <5681>\n<2d4b> <58d6>\n<2d4c> <58d4>\n<2d4d> <58cf>\n<2d4e> <58d2>\n<2d4f> <5b2d>\n<2d50> <5b25>\n<2d51> <5b32>\n<2d52> <5b23>\n<2d53> <5b2c>\n<2d54> <5b27>\n<2d55> <5b26>\n<2d56> <5b2f>\n<2d57> <5b2e>\n<2d58> <5b7b>\n<2d5b> <5db7>\n<2d5c> <5e6c>\n<2d5d> <5e6a>\n<2d5e> <5fbe>\n<2d5f> <61c3>\n<2d60> <61b5>\n<2d61> <61bc>\n<2d62> <61e7>\n<2d63> <61e0>\n<2d64> <61e5>\n<2d65> <61e4>\n<2d66> <61e8>\n<2d67> <61de>\n<2d68> <64ef>\n<2d69> <64e9>\n<2d6a> <64e3>\n<2d6b> <64eb>\n<2d6c> <64e4>\n<2d6d> <64e8>\n<2d6e> <6581>\n<2d6f> <6580>\n<2d70> <65b6>\n<2d71> <65da>\n<2d72> <66d2>\n<2d73> <6a8d>\n<2d74> <6a96>\n<2d75> <6a81>\n<2d76> <6aa5>\n<2d77> <6a89>\n<2d78> <6a9f>\n<2d79> <6a9b>\n<2d7a> <6aa1>\n<2d7b> <6a9e>\n<2d7c> <6a87>\n<2d7d> <6a93>\n<2d7e> <6a8e>\n<2d7f> <6a95>\n<2d80> <6a83>\n<2d81> <6aa8>\n<2d82> <6aa4>\n<2d83> <6a91>\n<2d84> <6a7f>\n<2d85> <6aa6>\n<2d86> <6a9a>\n<2d87> <6a85>\n<2d88> <6a8c>\n<2d89> <6a92>\n<2d8a> <6b5b>\n<2d8b> <6bad>\n<2d8c> <6c09>\n<2d8d> <6fcc>\n<2d8e> <6fa9>\n<2d8f> <6ff4>\n<2d90> <6fd4>\n<2d91> <6fe3>\n<2d92> <6fdc>\n<2d93> <6fed>\n<2d94> <6fe7>\n<2d95> <6fe6>\n<2d96> <6fde>\n<2d97> <6ff2>\n<2d98> <6fdd>\n<2d99> <6fe2>\n<2d9a> <6fe8>\n<2d9b> <71e1>\n<2d9c> <71f1>\n<2d9d> <71e8>\n<2d9e> <71f2>\n<2d9f> <71e4>\nendbfchar\n\n100 beginbfchar\n<2da0> <71f0>\n<2da1> <71e2>\n<2da2> <7373>\n<2da5> <7497>\n<2da6> <74b2>\n<2da7> <74ab>\n<2da8> <7490>\n<2da9> <74aa>\n<2daa> <74ad>\n<2dab> <74b1>\n<2dac> <74a5>\n<2dad> <74af>\n<2db1> <750f>\n<2db2> <7584>\n<2db3> <7643>\n<2db6> <7647>\n<2db7> <76a4>\n<2db8> <76e9>\n<2db9> <77b5>\n<2dba> <77ab>\n<2dbb> <77b2>\n<2dbc> <77b7>\n<2dbd> <77b6>\n<2dbe> <77b4>\n<2dbf> <77b1>\n<2dc0> <77a8>\n<2dc1> <77f0>\n<2dc2> <78f3>\n<2dc3> <78fd>\n<2dc4> <7902>\n<2dc7> <78ff>\n<2dc8> <78f2>\n<2dc9> <7905>\n<2dca> <78f9>\n<2dcb> <78fe>\n<2dcc> <7904>\n<2dcd> <79ab>\n<2dce> <79a8>\n<2dcf> <7a5c>\n<2dd0> <7a5b>\n<2dd1> <7a56>\n<2dd2> <7a58>\n<2dd3> <7a54>\n<2dd4> <7a5a>\n<2dd5> <7abe>\n<2dd8> <7c05>\n<2dd9> <7c0f>\n<2dda> <7bf2>\n<2ddb> <7c00>\n<2ddc> <7bff>\n<2ddd> <7bfb>\n<2dde> <7c0e>\n<2ddf> <7bf4>\n<2de0> <7c0b>\n<2de1> <7bf3>\n<2de2> <7c02>\n<2de3> <7c09>\n<2de4> <7c03>\n<2de5> <7c01>\n<2de6> <7bf8>\n<2de7> <7bfd>\n<2de8> <7c06>\n<2deb> <7c10>\n<2dec> <7c0a>\n<2ded> <7ce8>\n<2dee> <7e2d>\n<2def> <7e3c>\n<2df0> <7e42>\n<2df1> <7e33>\n<2df2> <9848>\n<2df3> <7e38>\n<2df4> <7e2a>\n<2df5> <7e49>\n<2df6> <7e40>\n<2df7> <7e47>\n<2df8> <7e29>\n<2df9> <7e4c>\n<2dfa> <7e30>\n<2dfb> <7e3b>\n<2dfc> <7e36>\n<2dfd> <7e44>\n<2dfe> <7e3a>\n<2dff> <7f45>\n<2e00> <7f7f>\n<2e01> <7f7e>\n<2e02> <7f7d>\n<2e03> <7ff4>\n<2e04> <7ff2>\n<2e05> <802c>\n<2e06> <81bb>\n<2e07> <81c4>\n<2e08> <81cc>\n<2e09> <81ca>\n<2e0a> <81c5>\n<2e0b> <81c7>\n<2e0c> <81bc>\n<2e0d> <81e9>\n<2e0e> <825b>\n<2e0f> <825a>\n<2e10> <825c>\nendbfchar\n\n100 beginbfchar\n<2e11> <8583>\n<2e12> <8580>\n<2e13> <858f>\n<2e14> <85a7>\n<2e15> <8595>\n<2e16> <85a0>\n<2e17> <858b>\n<2e18> <85a3>\n<2e19> <857b>\n<2e1a> <85a4>\n<2e1b> <859a>\n<2e1c> <859e>\n<2e1d> <8577>\n<2e1e> <857c>\n<2e1f> <8589>\n<2e20> <85a1>\n<2e21> <857a>\n<2e22> <8578>\n<2e23> <8557>\n<2e24> <858e>\n<2e25> <8596>\n<2e26> <8586>\n<2e27> <858d>\n<2e28> <8599>\n<2e29> <859d>\n<2e2a> <8581>\n<2e2b> <85a2>\n<2e2c> <8582>\n<2e2d> <8588>\n<2e2e> <8585>\n<2e2f> <8579>\n<2e30> <8576>\n<2e31> <8598>\n<2e32> <8590>\n<2e33> <859f>\n<2e34> <8668>\n<2e35> <87be>\n<2e36> <87aa>\n<2e37> <87ad>\n<2e38> <87c5>\n<2e39> <87b0>\n<2e3a> <87ac>\n<2e3b> <87b9>\n<2e3c> <87b5>\n<2e3d> <87bc>\n<2e3e> <87ae>\n<2e3f> <87c9>\n<2e40> <87c3>\n<2e41> <87c2>\n<2e42> <87cc>\n<2e43> <87b7>\n<2e44> <87af>\n<2e45> <87c4>\n<2e46> <87ca>\n<2e47> <87b4>\n<2e48> <87b6>\n<2e49> <87bf>\n<2e4a> <87b8>\n<2e4b> <87bd>\n<2e4c> <87de>\n<2e4d> <87b2>\n<2e4e> <8935>\n<2e4f> <8933>\n<2e50> <893c>\n<2e51> <893e>\n<2e52> <8941>\n<2e53> <8952>\n<2e54> <8937>\n<2e55> <8942>\n<2e56> <89ad>\n<2e57> <89af>\n<2e58> <89ae>\n<2e5b> <8b1e>\n<2e5c> <8b18>\n<2e5d> <8b16>\n<2e5e> <8b11>\n<2e5f> <8b05>\n<2e60> <8b0b>\n<2e61> <8b22>\n<2e62> <8b0f>\n<2e63> <8b12>\n<2e64> <8b15>\n<2e65> <8b07>\n<2e66> <8b0d>\n<2e67> <8b08>\n<2e68> <8b06>\n<2e69> <8b1c>\n<2e6a> <8b13>\n<2e6b> <8b1a>\n<2e6c> <8c4f>\n<2e6d> <8c70>\n<2e6e> <8c72>\n<2e6f> <8c71>\n<2e70> <8c6f>\n<2e71> <8c95>\n<2e72> <8c94>\n<2e73> <8cf9>\n<2e74> <8d6f>\n<2e75> <8e4e>\n<2e76> <8e4d>\nendbfchar\n\n100 beginbfchar\n<2e77> <8e53>\n<2e78> <8e50>\n<2e79> <8e4c>\n<2e7a> <8e47>\n<2e7b> <8f43>\n<2e7c> <8f40>\n<2e7d> <9085>\n<2e7e> <907e>\n<2e7f> <9138>\n<2e80> <919a>\n<2e81> <91a2>\n<2e82> <919b>\n<2e83> <9199>\n<2e84> <919f>\n<2e85> <91a1>\n<2e86> <919d>\n<2e87> <91a0>\n<2e88> <93a1>\n<2e89> <9383>\n<2e8a> <93af>\n<2e8b> <9364>\n<2e8c> <9356>\n<2e8d> <9347>\n<2e8e> <937c>\n<2e8f> <9358>\n<2e90> <935c>\n<2e91> <9376>\n<2e92> <9349>\n<2e95> <9360>\n<2e96> <936d>\n<2e97> <938f>\n<2e98> <934c>\n<2e99> <936a>\n<2e9a> <9379>\n<2e9b> <9357>\n<2e9c> <9355>\n<2e9d> <9352>\n<2e9e> <934f>\n<2e9f> <9371>\n<2ea0> <9377>\n<2ea1> <937b>\n<2ea2> <9361>\n<2ea3> <935e>\n<2ea4> <9363>\n<2ea5> <9367>\n<2ea6> <934e>\n<2ea7> <9359>\n<2ea8> <95c7>\n<2ea9> <95c0>\n<2eaa> <95c9>\n<2eab> <95c3>\n<2eac> <95c5>\n<2ead> <95b7>\n<2eae> <96ae>\n<2eaf> <96b0>\n<2eb0> <96ac>\n<2eb1> <9720>\n<2eb2> <971f>\n<2eb3> <9718>\n<2eb4> <971d>\n<2eb5> <9719>\n<2eb6> <979a>\n<2eb7> <97a1>\n<2eb8> <979c>\n<2eb9> <979e>\n<2eba> <979d>\n<2ebb> <97d5>\n<2ebc> <97d4>\n<2ebd> <97f1>\n<2ebe> <9841>\n<2ebf> <9844>\n<2ec0> <984a>\n<2ec1> <9849>\n<2ec2> <9845>\n<2ec3> <9843>\n<2ec4> <9925>\n<2ec7> <992a>\n<2ec8> <9933>\n<2ec9> <9932>\n<2eca> <992f>\n<2ecb> <992d>\n<2ecc> <9931>\n<2ecd> <9930>\n<2ece> <9998>\n<2ecf> <99a3>\n<2ed0> <99a1>\n<2ed1> <9a02>\n<2ed2> <99fa>\n<2ed3> <99f4>\n<2ed4> <99f7>\n<2ed5> <99f9>\n<2ed6> <99f8>\n<2ed7> <99f6>\n<2ed8> <99fb>\n<2edb> <99fc>\n<2edc> <9a03>\n<2edd> <9abe>\n<2ede> <9afe>\n<2edf> <9afd>\n<2ee0> <9b01>\nendbfchar\n\n100 beginbfchar\n<2ee1> <9afc>\n<2ee2> <9b48>\n<2ee3> <9b9a>\n<2ee4> <9ba8>\n<2ee5> <9b9e>\n<2ee6> <9b9b>\n<2ee7> <9ba6>\n<2ee8> <9ba1>\n<2ee9> <9ba5>\n<2eea> <9ba4>\n<2eeb> <9b86>\n<2eec> <9ba2>\n<2eed> <9ba0>\n<2eee> <9baf>\n<2eef> <9d33>\n<2ef0> <9d41>\n<2ef1> <9d67>\n<2ef2> <9d36>\n<2ef5> <9d31>\n<2ef6> <9d38>\n<2ef7> <9d30>\n<2ef8> <9d45>\n<2efb> <9d3e>\n<2efc> <9d37>\n<2efd> <9d40>\n<2efe> <9d3d>\n<2eff> <7ff5>\n<2f00> <9d2d>\n<2f01> <9e8a>\n<2f02> <9e89>\n<2f03> <9e8d>\n<2f04> <9eb0>\n<2f05> <9ec8>\n<2f06> <9eda>\n<2f07> <9efb>\n<2f08> <9eff>\n<2f09> <9f24>\n<2f0a> <9f23>\n<2f0b> <9f22>\n<2f0c> <9f54>\n<2f0d> <9fa0>\n<2f0e> <5131>\n<2f11> <5698>\n<2f12> <569c>\n<2f13> <5697>\n<2f14> <569a>\n<2f15> <569d>\n<2f16> <5699>\n<2f17> <5970>\n<2f18> <5b3c>\n<2f1b> <5dc0>\n<2f1e> <61d8>\n<2f1f> <61df>\n<2f22> <61f1>\n<2f23> <61ea>\n<2f24> <61f0>\n<2f25> <61eb>\n<2f26> <61d6>\n<2f27> <61e9>\n<2f28> <64ff>\n<2f29> <6504>\n<2f2a> <64fd>\n<2f2b> <64f8>\n<2f2c> <6501>\n<2f2d> <6503>\n<2f2e> <64fc>\n<2f2f> <6594>\n<2f30> <65db>\n<2f33> <66d8>\n<2f34> <6ac5>\n<2f35> <6ab9>\n<2f36> <6abd>\n<2f37> <6ae1>\n<2f38> <6ac6>\n<2f39> <6aba>\n<2f3c> <6ac7>\n<2f3d> <6ab4>\n<2f3e> <6aad>\n<2f3f> <6b5e>\n<2f40> <6bc9>\n<2f41> <6c0b>\n<2f42> <7007>\n<2f45> <7001>\n<2f46> <7005>\n<2f47> <7014>\n<2f48> <700e>\n<2f4b> <6ffb>\n<2f4c> <7026>\n<2f4d> <6ffc>\n<2f4e> <6ff7>\n<2f4f> <700a>\n<2f50> <7201>\n<2f51> <71ff>\n<2f52> <71f9>\n<2f53> <7203>\n<2f54> <71fd>\n<2f55> <7376>\n<2f56> <74b8>\n<2f57> <74c0>\n<2f58> <74b5>\nendbfchar\n\n100 beginbfchar\n<2f59> <74c1>\n<2f5a> <74be>\n<2f5b> <74b6>\n<2f5c> <74bb>\n<2f5d> <74c2>\n<2f5e> <7514>\n<2f5f> <7513>\n<2f60> <765c>\n<2f61> <7664>\n<2f62> <7659>\n<2f63> <7650>\n<2f64> <7653>\n<2f65> <7657>\n<2f66> <765a>\n<2f67> <76a6>\n<2f68> <76bd>\n<2f69> <76ec>\n<2f6a> <77c2>\n<2f6b> <77ba>\n<2f6c> <790c>\n<2f6f> <7909>\n<2f70> <7910>\n<2f71> <7912>\n<2f72> <7911>\n<2f73> <79ad>\n<2f74> <79ac>\n<2f75> <7a5f>\n<2f76> <7c1c>\n<2f77> <7c29>\n<2f78> <7c19>\n<2f79> <7c20>\n<2f7a> <7c1f>\n<2f7b> <7c2d>\n<2f7c> <7c1d>\n<2f7d> <7c26>\n<2f7e> <7c28>\n<2f7f> <7c22>\n<2f80> <7c25>\n<2f81> <7c30>\n<2f82> <7e5c>\n<2f83> <7e50>\n<2f84> <7e56>\n<2f85> <7e63>\n<2f86> <7e58>\n<2f87> <7e62>\n<2f88> <7e5f>\n<2f89> <7e51>\n<2f8a> <7e60>\n<2f8b> <7e57>\n<2f8c> <7e53>\n<2f8d> <7fb5>\n<2f8e> <7fb3>\n<2f91> <8075>\n<2f94> <81d0>\n<2f95> <825f>\n<2f96> <825e>\n<2f97> <85b4>\n<2f98> <85c6>\n<2f99> <85c0>\n<2f9a> <85c3>\n<2f9b> <85c2>\n<2f9c> <85b3>\n<2f9d> <85b5>\n<2f9e> <85bd>\n<2f9f> <85c7>\n<2fa0> <85c4>\n<2fa1> <85bf>\n<2fa2> <85cb>\n<2fa3> <85ce>\n<2fa4> <85c8>\n<2fa5> <85c5>\n<2fa6> <85b1>\n<2fa7> <85b6>\n<2fa8> <85d2>\n<2fa9> <8624>\n<2faa> <85b8>\n<2fab> <85b7>\n<2fac> <85be>\n<2fad> <8669>\n<2fae> <87e7>\n<2faf> <87e6>\n<2fb0> <87e2>\n<2fb1> <87db>\n<2fb2> <87eb>\n<2fb3> <87ea>\n<2fb4> <87e5>\n<2fb5> <87df>\n<2fb6> <87f3>\n<2fb7> <87e4>\n<2fb8> <87d4>\n<2fb9> <87dc>\n<2fba> <87d3>\n<2fbb> <87ed>\n<2fbc> <87d8>\n<2fbd> <87e3>\n<2fbe> <87d7>\n<2fbf> <87d9>\n<2fc0> <8801>\n<2fc1> <87f4>\n<2fc2> <87e8>\nendbfchar\n\n100 beginbfchar\n<2fc3> <87dd>\n<2fc4> <8953>\n<2fc5> <894b>\n<2fc6> <894f>\n<2fc7> <894c>\n<2fc8> <8946>\n<2fcb> <8949>\n<2fcc> <8b2a>\n<2fcd> <8b27>\n<2fce> <8b23>\n<2fcf> <8b33>\n<2fd0> <8b30>\n<2fd1> <8b35>\n<2fd2> <8b47>\n<2fd3> <8b2f>\n<2fd4> <8b3c>\n<2fd5> <8b3e>\n<2fd6> <8b31>\n<2fd7> <8b25>\n<2fd8> <8b37>\n<2fd9> <8b26>\n<2fda> <8b36>\n<2fdb> <8b2e>\n<2fdc> <8b24>\n<2fdd> <8b3b>\n<2fde> <8b3d>\n<2fdf> <8b3a>\n<2fe0> <8c42>\n<2fe1> <8c75>\n<2fe2> <8c99>\n<2fe3> <8c98>\n<2fe4> <8c97>\n<2fe5> <8cfe>\n<2fe6> <8d04>\n<2fe7> <8d02>\n<2fe8> <8d00>\n<2fe9> <8e5c>\n<2fea> <8e62>\n<2feb> <8e60>\n<2fec> <8e57>\n<2fed> <8e56>\n<2fee> <8e5e>\n<2fef> <8e65>\n<2ff0> <8e67>\n<2ff1> <8e5b>\n<2ff2> <8e5a>\n<2ff3> <8e61>\n<2ff4> <8e5d>\n<2ff5> <8e69>\n<2ff6> <8e54>\n<2ffa> <8f4b>\n<2ffb> <9128>\n<2ffe> <913e>\n<2fff> <91a8>\n<3000> <91a5>\n<3001> <91a7>\n<3002> <91af>\n<3003> <91aa>\n<3004> <93b5>\n<3005> <938c>\n<3006> <9392>\n<3007> <93b7>\n<3008> <939b>\n<3009> <939d>\n<300a> <9389>\n<300b> <93a7>\n<300c> <938e>\n<300d> <93aa>\n<300e> <939e>\n<300f> <93a6>\n<3010> <9395>\n<3011> <9388>\n<3012> <9399>\n<3013> <939f>\n<3014> <9380>\n<3015> <938d>\n<3016> <93b1>\n<3017> <9391>\n<3018> <93b2>\n<3019> <93a4>\n<301a> <93a8>\n<301b> <93b4>\n<301c> <93a3>\n<301f> <95d1>\n<3020> <96b3>\n<3021> <96d7>\n<3022> <96da>\n<3023> <5dc2>\n<3024> <96df>\n<3025> <96d8>\n<3026> <96dd>\n<3027> <9723>\n<3028> <9722>\n<3029> <9725>\n<302a> <97ac>\n<302b> <97ae>\n<302c> <97a8>\n<302d> <97ab>\n<302e> <97a4>\n<302f> <97aa>\nendbfchar\n\n100 beginbfchar\n<3030> <97a2>\n<3031> <97a5>\n<3032> <97d7>\n<3033> <97d9>\n<3034> <97d6>\n<3035> <97d8>\n<3036> <97fa>\n<303a> <98b8>\n<303b> <9941>\n<303c> <993c>\n<303d> <993a>\n<303e> <9a0f>\n<303f> <9a0b>\n<3040> <9a09>\n<3041> <9a0d>\n<3042> <9a04>\n<3043> <9a11>\n<3044> <9a0a>\n<3045> <9a05>\n<3046> <9a07>\n<3047> <9a06>\n<3048> <9ac0>\n<3049> <9adc>\n<304a> <9b08>\n<304d> <9b29>\n<304e> <9b35>\n<304f> <9b4a>\n<3050> <9b4c>\n<3051> <9b4b>\n<3052> <9bc7>\n<3053> <9bc6>\n<3054> <9bc3>\n<3055> <9bbf>\n<3056> <9bc1>\n<3057> <9bb5>\n<3058> <9bb8>\n<3059> <9bd3>\n<305a> <9bb6>\n<305b> <9bc4>\n<305c> <9bb9>\n<305d> <9bbd>\n<305e> <9d5c>\n<305f> <9d53>\n<3060> <9d4f>\n<3061> <9d4a>\n<3062> <9d5b>\n<3063> <9d4b>\n<3064> <9d59>\n<3065> <9d56>\n<3066> <9d4c>\n<3067> <9d57>\n<3068> <9d52>\n<3069> <9d54>\n<306a> <9d5f>\n<306b> <9d58>\n<306c> <9d5a>\n<306d> <9e8e>\n<306e> <9e8c>\n<306f> <9edf>\n<3070> <9f01>\n<3071> <9f00>\n<3072> <9f16>\n<3073> <9f25>\n<3074> <9f2b>\n<3075> <9f2a>\n<3076> <9f29>\n<3077> <9f28>\n<3078> <9f4c>\n<3079> <9f55>\n<307c> <5296>\n<307d> <52f7>\n<307e> <53b4>\n<307f> <56ab>\n<3080> <56ad>\n<3083> <56aa>\n<3084> <56ac>\n<3085> <58da>\n<3086> <58dd>\n<3087> <58db>\n<3088> <5912>\n<308c> <5dc3>\n<308d> <5e70>\n<308e> <5fbf>\n<308f> <61fb>\n<3090> <6507>\n<3091> <6510>\n<3092> <650d>\n<3093> <6509>\n<3094> <650c>\n<3095> <650e>\n<3096> <6584>\n<3097> <65de>\n<3098> <65dd>\n<3099> <66de>\n<309a> <6ae7>\n<309b> <6ae0>\n<309c> <6acc>\n<309d> <6ad1>\n<309e> <6ad9>\n<309f> <6acb>\nendbfchar\n\n100 beginbfchar\n<30a0> <6adf>\n<30a1> <6adc>\n<30a2> <6ad0>\n<30a3> <6aeb>\n<30a4> <6acf>\n<30a5> <6acd>\n<30a6> <6ade>\n<30a7> <6b60>\n<30a8> <6bb0>\n<30a9> <6c0c>\n<30aa> <7019>\n<30ab> <7027>\n<30ac> <7020>\n<30ad> <7016>\n<30ae> <702b>\n<30b2> <7029>\n<30b3> <7017>\n<30b4> <7024>\n<30b5> <701c>\n<30b6> <720c>\n<30b7> <720a>\n<30b8> <7207>\n<30b9> <7202>\n<30ba> <7205>\n<30bd> <72a4>\n<30be> <72a3>\n<30bf> <72a1>\n<30c0> <74cb>\n<30c1> <74c5>\n<30c2> <74b7>\n<30c3> <74c3>\n<30c4> <7516>\n<30c5> <7660>\n<30c8> <77c4>\n<30c9> <77f1>\n<30ca> <791d>\n<30cb> <791b>\n<30cc> <7921>\n<30cd> <791c>\n<30ce> <7917>\n<30cf> <791e>\n<30d0> <79b0>\n<30d3> <7c33>\n<30d4> <7c3c>\n<30d5> <7c39>\n<30d6> <7c2c>\n<30d7> <7c3b>\n<30d8> <7cec>\n<30d9> <7cea>\n<30da> <7e76>\n<30db> <7e75>\n<30dc> <7e78>\n<30dd> <7e70>\n<30de> <7e77>\n<30df> <7e6f>\n<30e0> <7e7a>\n<30e1> <7e72>\n<30e2> <7e74>\n<30e3> <7e68>\n<30e4> <7f4b>\n<30e5> <7f4a>\n<30e6> <7f83>\n<30e7> <7f86>\n<30e8> <7fb7>\n<30eb> <8078>\n<30ec> <81d7>\n<30ed> <81d5>\n<30ee> <820b>\n<30ef> <8264>\n<30f0> <8261>\n<30f1> <8263>\n<30f2> <85eb>\n<30f3> <85f1>\n<30f4> <85ed>\n<30f5> <85d9>\n<30f6> <85e1>\n<30f7> <85e8>\n<30f8> <85da>\n<30f9> <85d7>\n<30fa> <85ec>\n<30fb> <85f2>\n<30fc> <85f8>\n<30fd> <85d8>\n<30fe> <85df>\n<30ff> <85e3>\n<3100> <85dc>\n<3101> <85d1>\n<3102> <85f0>\n<3103> <85e6>\n<3104> <85ef>\n<3105> <85de>\n<3106> <85e2>\n<3107> <8800>\n<3108> <87fa>\n<3109> <8803>\n<310c> <8809>\n<310d> <880c>\n<310e> <880b>\n<310f> <8806>\n<3110> <87fc>\nendbfchar\n\n100 beginbfchar\n<3111> <8808>\n<3112> <87ff>\n<3113> <880a>\n<3114> <8802>\n<3115> <8962>\n<3118> <8957>\n<3119> <8961>\n<311a> <895c>\n<311b> <8958>\n<311c> <895d>\n<311d> <8959>\n<311e> <8988>\n<311f> <89b7>\n<3120> <89b6>\n<3121> <89f6>\n<3122> <8b50>\n<3123> <8b48>\n<3124> <8b4a>\n<3125> <8b40>\n<3126> <8b53>\n<3127> <8b56>\n<3128> <8b54>\n<3129> <8b4b>\n<312a> <8b55>\n<312b> <8b51>\n<312c> <8b42>\n<312d> <8b52>\n<312e> <8b57>\n<312f> <8c43>\n<3130> <8c77>\n<3131> <8c76>\n<3132> <8c9a>\n<3135> <8d09>\n<3136> <8dac>\n<3137> <8daa>\n<3138> <8dad>\n<3139> <8dab>\n<313a> <8e6d>\n<313b> <8e78>\n<313c> <8e73>\n<313d> <8e6a>\n<313e> <8e6f>\n<313f> <8e7b>\n<3140> <8ec2>\n<3141> <8f52>\n<3142> <8f51>\n<3145> <8f53>\n<3146> <8fb4>\n<3147> <9140>\n<3148> <913f>\n<3149> <91b0>\n<314a> <91ad>\n<314b> <93de>\n<314c> <93c7>\n<314d> <93cf>\n<314e> <93c2>\n<314f> <93da>\n<3150> <93d0>\n<3151> <93f9>\n<3152> <93ec>\n<3153> <93cc>\n<3154> <93d9>\n<3155> <93a9>\n<3156> <93e6>\n<3157> <93ca>\n<3158> <93d4>\n<3159> <93ee>\n<315a> <93e3>\n<315b> <93d5>\n<315c> <93c4>\n<315d> <93ce>\n<315e> <93c0>\n<315f> <93d2>\n<3160> <93a5>\n<3161> <93e7>\n<3162> <957d>\n<3165> <96e1>\n<3166> <9729>\n<3169> <9728>\n<316a> <9726>\n<316b> <97b3>\n<316c> <97b7>\n<316d> <97b6>\n<3171> <985c>\n<3172> <9859>\n<3173> <985d>\n<3174> <9857>\n<3175> <98bf>\n<3176> <98bd>\n<3177> <98bb>\n<3178> <98be>\n<3179> <9948>\n<317a> <9947>\n<317b> <9943>\n<317e> <9a1a>\n<317f> <9a15>\n<3180> <9a25>\n<3181> <9a1d>\n<3182> <9a24>\n<3183> <9a1b>\nendbfchar\n\n100 beginbfchar\n<3184> <9a22>\n<3185> <9a20>\n<3186> <9a27>\n<3187> <9a23>\n<3188> <9a1e>\n<3189> <9a1c>\n<318a> <9a14>\n<318b> <9ac2>\n<318c> <9b0b>\n<318d> <9b0a>\n<318e> <9b0e>\n<318f> <9b0c>\n<3190> <9b37>\n<3193> <9be0>\n<3194> <9bde>\n<3195> <9be4>\n<3196> <9be6>\n<3197> <9be2>\n<3198> <9bf0>\n<3199> <9bd4>\n<319a> <9bd7>\n<319b> <9bec>\n<319c> <9bdc>\n<319d> <9bd9>\n<319e> <9be5>\n<319f> <9bd5>\n<31a0> <9be1>\n<31a1> <9bda>\n<31a2> <9d77>\n<31a3> <9d81>\n<31a4> <9d8a>\n<31a5> <9d84>\n<31a6> <9d88>\n<31a7> <9d71>\n<31a8> <9d80>\n<31a9> <9d78>\n<31aa> <9d86>\n<31ad> <9d7d>\n<31ae> <9d6b>\n<31b1> <9d70>\n<31b2> <9d69>\n<31b3> <9d85>\n<31b4> <9d73>\n<31b5> <9d7b>\n<31b6> <9d82>\n<31b7> <9d6f>\n<31b8> <9d79>\n<31b9> <9d7f>\n<31ba> <9d87>\n<31bb> <9d68>\n<31bc> <9e94>\n<31bd> <9e91>\n<31be> <9ec0>\n<31bf> <9efc>\n<31c0> <9f2d>\n<31c3> <9f4d>\n<31c7> <5337>\n<31c8> <56b2>\n<31c9> <56b5>\n<31ca> <56b3>\n<31cb> <58e3>\n<31cc> <5b45>\n<31d3> <61f9>\n<31d4> <6517>\n<31d5> <6516>\n<31d6> <6515>\n<31d7> <6513>\n<31d8> <65df>\n<31d9> <66e8>\n<31dc> <6af3>\n<31dd> <6af0>\n<31de> <6aea>\n<31df> <6ae8>\n<31e0> <6af9>\n<31e1> <6af1>\n<31e4> <703c>\n<31e5> <7035>\n<31e6> <702f>\n<31e7> <7037>\n<31e8> <7034>\n<31e9> <7031>\n<31ea> <7042>\n<31eb> <7038>\n<31ec> <703f>\n<31ed> <703a>\n<31ee> <7039>\n<31ef> <702a>\n<31f0> <7040>\n<31f1> <703b>\n<31f2> <7033>\n<31f3> <7041>\n<31f6> <72a8>\n<31f7> <737d>\n<31f8> <737c>\n<31f9> <74ba>\n<31fa> <76ab>\n<31fb> <76aa>\n<31fc> <76be>\n<31fd> <76ed>\n<31fe> <77cc>\nendbfchar\n\n100 beginbfchar\n<31ff> <77ce>\n<3200> <77cf>\n<3201> <77cd>\n<3202> <77f2>\n<3203> <7925>\n<3204> <7923>\n<3207> <7924>\n<3208> <7929>\n<3209> <79b2>\n<320a> <7a6e>\n<320d> <7af7>\n<320e> <7c49>\n<320f> <7c48>\n<3210> <7c4a>\n<3211> <7c47>\n<3212> <7c45>\n<3213> <7cee>\n<3214> <7e7b>\n<3215> <7e7e>\n<3216> <7e81>\n<3217> <7e80>\n<3218> <7fba>\n<3219> <7fff>\n<321a> <8079>\n<321b> <81db>\n<321c> <81d9>\n<321f> <8622>\n<3220> <85ff>\n<3221> <8601>\n<3222> <85fe>\n<3223> <861b>\n<3224> <8600>\n<3225> <85f6>\n<3226> <8604>\n<3227> <8609>\n<3228> <8605>\n<3229> <860c>\n<322a> <85fd>\n<322b> <8819>\n<322e> <8817>\n<322f> <8813>\n<3230> <8816>\n<3231> <8963>\n<3232> <8966>\n<3233> <89b9>\n<3234> <89f7>\n<3235> <8b60>\n<3236> <8b6a>\n<3237> <8b5d>\n<3238> <8b68>\n<3239> <8b63>\n<323a> <8b65>\n<323b> <8b67>\n<323c> <8b6d>\n<323d> <8dae>\n<323e> <8e86>\n<323f> <8e88>\n<3240> <8e84>\n<3241> <8f59>\n<3244> <8f55>\n<3245> <8f58>\n<3246> <8f5a>\n<3247> <908d>\n<3248> <9143>\n<3249> <9141>\n<324a> <91b7>\n<324b> <91b5>\n<324e> <940b>\n<324f> <9413>\n<3250> <93fb>\n<3251> <9420>\n<3252> <940f>\n<3253> <9414>\n<3254> <93fe>\n<3255> <9415>\n<3256> <9410>\n<3257> <9428>\n<3258> <9419>\n<3259> <940d>\n<325a> <93f5>\n<325b> <9400>\n<325c> <93f7>\n<325d> <9407>\n<325e> <940e>\n<325f> <9416>\n<3260> <9412>\n<3261> <93fa>\n<3262> <9409>\n<3263> <93f8>\n<3264> <943c>\n<3265> <940a>\n<3266> <93ff>\n<3267> <93fc>\n<3268> <940c>\n<3269> <93f6>\n<326a> <9411>\n<326b> <9406>\n<326c> <95de>\n<326d> <95e0>\n<326e> <95df>\nendbfchar\n\n100 beginbfchar\n<3271> <97b9>\n<3272> <97bb>\n<3275> <9860>\n<3278> <985f>\n<327b> <9950>\n<327c> <994e>\n<327d> <9959>\n<327e> <994c>\n<327f> <994b>\n<3280> <9953>\n<3281> <9a32>\n<3282> <9a34>\n<3283> <9a31>\n<3284> <9a2c>\n<3285> <9a2a>\n<3286> <9a36>\n<3287> <9a29>\n<3288> <9a2e>\n<3289> <9a38>\n<328a> <9a2d>\n<328b> <9ac7>\n<328c> <9aca>\n<328d> <9ac6>\n<328e> <9b10>\n<328f> <9b12>\n<3290> <9b11>\n<3291> <9c0b>\n<3292> <9c08>\n<3293> <9bf7>\n<3294> <9c05>\n<3295> <9c12>\n<3296> <9bf8>\n<3297> <9c40>\n<3298> <9c07>\n<3299> <9c0e>\n<329a> <9c06>\n<329b> <9c17>\n<329c> <9c14>\n<329d> <9c09>\n<329e> <9d9f>\n<329f> <9d99>\n<32a0> <9da4>\n<32a1> <9d9d>\n<32a2> <9d92>\n<32a3> <9d98>\n<32a4> <9d90>\n<32a5> <9d9b>\n<32a6> <9da0>\n<32a7> <9d94>\n<32a8> <9d9c>\n<32a9> <9daa>\n<32aa> <9d97>\n<32ab> <9da1>\n<32ac> <9d9a>\n<32ad> <9da2>\n<32ae> <9da8>\n<32af> <9d9e>\n<32b0> <9da3>\n<32b1> <9dbf>\n<32b2> <9da9>\n<32b3> <9d96>\n<32b6> <9e99>\n<32b7> <9e9b>\n<32b8> <9e9a>\n<32b9> <9ee5>\n<32ba> <9ee4>\n<32bb> <9ee7>\n<32bc> <9ee6>\n<32bd> <9f30>\n<32be> <9f2e>\n<32bf> <9f5b>\n<32c0> <9f60>\n<32c1> <9f5e>\n<32c2> <9f5d>\n<32c3> <9f59>\n<32c4> <9f91>\n<32c5> <513a>\n<32c6> <5139>\n<32c7> <5298>\n<32c8> <5297>\n<32c9> <56c3>\n<32cc> <5b48>\n<32cd> <5b47>\n<32ce> <5dcb>\n<32cf> <5dcf>\n<32d0> <5ef1>\n<32d1> <61fd>\n<32d2> <651b>\n<32d3> <6b02>\n<32d4> <6afc>\n<32d5> <6b03>\n<32d6> <6af8>\n<32d7> <6b00>\n<32da> <704a>\n<32df> <721d>\n<32e0> <721a>\n<32e1> <7219>\n<32e2> <737e>\n<32e3> <7517>\n<32e4> <766a>\nendbfchar\n\n100 beginbfchar\n<32e5> <77d0>\n<32e6> <792d>\n<32e7> <7931>\n<32e8> <792f>\n<32e9> <7c54>\n<32ea> <7c53>\n<32eb> <7cf2>\n<32ec> <7e8a>\n<32ef> <7e8b>\n<32f0> <7e86>\n<32f1> <7e8d>\n<32f2> <7f4d>\n<32f3> <7fbb>\n<32f4> <8030>\n<32f5> <81dd>\n<32f6> <8618>\n<32f7> <862a>\n<32f8> <8626>\n<32f9> <861f>\n<32fa> <8623>\n<32fb> <861c>\n<32fc> <8619>\n<32fd> <8627>\n<32fe> <862e>\n<32ff> <8621>\n<3300> <8620>\n<3301> <8629>\n<3302> <861e>\n<3303> <8625>\n<3304> <8829>\n<3305> <881d>\n<3306> <881b>\n<3307> <8820>\n<3308> <8824>\n<3309> <881c>\n<330a> <882b>\n<330b> <884a>\n<330c> <896d>\n<330d> <8969>\n<330e> <896e>\n<330f> <896b>\n<3310> <89fa>\n<3311> <8b79>\n<3312> <8b78>\n<3313> <8b45>\n<3316> <8d10>\n<3317> <8d14>\n<3318> <8daf>\n<3319> <8e8e>\n<331a> <8e8c>\n<331b> <8f5e>\n<331c> <8f5b>\n<331d> <8f5d>\n<331e> <9146>\n<3321> <91b9>\n<3322> <943f>\n<3323> <943b>\n<3324> <9436>\n<3325> <9429>\n<3326> <943d>\n<3327> <9430>\n<3328> <9439>\n<3329> <942a>\n<332a> <9437>\n<332b> <942c>\n<332c> <9440>\n<332d> <9431>\n<332e> <95e5>\n<332f> <95e4>\n<3330> <95e3>\n<3331> <9735>\n<3332> <973a>\n<3333> <97bf>\n<3334> <97e1>\n<3335> <9864>\n<3336> <98c9>\n<3337> <98c6>\n<3338> <98c0>\n<3339> <9958>\n<333a> <9956>\n<333b> <9a39>\n<333c> <9a3d>\n<333d> <9a46>\n<333e> <9a44>\n<333f> <9a42>\n<3340> <9a41>\n<3341> <9a3a>\n<3342> <9a3f>\n<3343> <9acd>\n<3344> <9b15>\n<3347> <9b16>\n<3348> <9b3a>\n<3349> <9b52>\n<334a> <9c2b>\n<334b> <9c1d>\n<334c> <9c1c>\n<334d> <9c2c>\n<334e> <9c23>\n<3351> <9c24>\n<3352> <9c21>\nendbfchar\n\n100 beginbfchar\n<3353> <9db7>\n<3354> <9db6>\n<3355> <9dbc>\n<3356> <9dc1>\n<3357> <9dc7>\n<3358> <9dca>\n<3359> <9dcf>\n<335a> <9dbe>\n<335b> <9dc5>\n<335c> <9dc3>\n<335d> <9dbb>\n<335e> <9db5>\n<335f> <9dce>\n<3362> <9dac>\n<3363> <9dc8>\n<3364> <9db1>\n<3365> <9dad>\n<3366> <9dcc>\n<3367> <9db3>\n<3368> <9dcd>\n<3369> <9db2>\n<336a> <9e7a>\n<336b> <9e9c>\n<336c> <9eeb>\n<336d> <9eee>\n<336e> <9eed>\n<336f> <9f1b>\n<3370> <9f18>\n<3371> <9f1a>\n<3372> <9f31>\n<3373> <9f4e>\n<3374> <9f65>\n<3375> <9f64>\n<3376> <9f92>\n<3377> <4eb9>\n<3378> <56c6>\n<3379> <56c5>\n<337a> <56cb>\n<337b> <5971>\n<337e> <5dd5>\n<337f> <5dd1>\n<3380> <5ef2>\n<3381> <6521>\n<3382> <6520>\n<3383> <6526>\n<3384> <6522>\n<3385> <6b0b>\n<3388> <6c0d>\n<338c> <7052>\n<338f> <72a9>\n<3390> <737f>\n<3391> <74d8>\n<3392> <74d5>\n<3393> <74d9>\n<3394> <74d7>\n<3395> <766d>\n<3396> <76ad>\n<3397> <7935>\n<3398> <79b4>\n<339b> <7c57>\n<339c> <7c5c>\n<339d> <7c59>\n<339e> <7c5b>\n<339f> <7c5a>\n<33a0> <7cf4>\n<33a1> <7cf1>\n<33a2> <7e91>\n<33a3> <7f4f>\n<33a4> <7f87>\n<33a5> <81de>\n<33a6> <826b>\n<33a9> <8633>\n<33aa> <862c>\n<33ab> <8632>\n<33ac> <8636>\n<33ad> <882c>\n<33ae> <8828>\n<33af> <8826>\n<33b0> <882a>\n<33b1> <8825>\n<33b2> <8971>\n<33b3> <89bf>\n<33b4> <89be>\n<33b5> <89fb>\n<33b6> <8b7e>\n<33b7> <8b84>\n<33b8> <8b82>\n<33b9> <8b86>\n<33ba> <8b85>\n<33bb> <8b7f>\n<33bc> <8d15>\n<33bd> <8e95>\n<33be> <8e94>\n<33bf> <8e9a>\n<33c0> <8e92>\n<33c1> <8e90>\n<33c4> <8f60>\n<33c5> <8f62>\n<33c6> <9147>\n<33c7> <944c>\nendbfchar\n\n100 beginbfchar\n<33c8> <9450>\n<33cb> <944f>\n<33cc> <9447>\n<33cd> <9445>\n<33d0> <9446>\n<33d1> <973f>\n<33d2> <97e3>\n<33d3> <986a>\n<33d4> <9869>\n<33d5> <98cb>\n<33d6> <9954>\n<33d7> <995b>\n<33d8> <9a4e>\n<33db> <9a4c>\n<33dc> <9a4f>\n<33dd> <9a48>\n<33de> <9a4a>\n<33df> <9a49>\n<33e0> <9a52>\n<33e1> <9a50>\n<33e2> <9ad0>\n<33e3> <9b19>\n<33e4> <9b2b>\n<33e5> <9b3b>\n<33e6> <9b56>\n<33e7> <9b55>\n<33e8> <9c46>\n<33e9> <9c48>\n<33ea> <9c3f>\n<33eb> <9c44>\n<33ec> <9c39>\n<33ed> <9c33>\n<33ee> <9c41>\n<33ef> <9c3c>\n<33f0> <9c37>\n<33f1> <9c34>\n<33f2> <9c32>\n<33f3> <9c3d>\n<33f4> <9c36>\n<33f5> <9ddb>\n<33f6> <9dd2>\n<33f7> <9dde>\n<33f8> <9dda>\n<33f9> <9dcb>\n<33fa> <9dd0>\n<33fb> <9ddc>\n<33fc> <9dd1>\n<33fd> <9ddf>\n<33fe> <9de9>\n<33ff> <9dd9>\n<3400> <9dd8>\n<3401> <9dd6>\n<3402> <9df5>\n<3403> <9dd5>\n<3404> <9ddd>\n<3405> <9eb6>\n<3406> <9ef0>\n<3407> <9f35>\n<3408> <9f33>\n<3409> <9f32>\n<340a> <9f42>\n<340b> <9f6b>\n<340c> <9f95>\n<340d> <9fa2>\n<340e> <513d>\n<340f> <5299>\n<3410> <58e8>\n<3411> <58e7>\n<3412> <5972>\n<3413> <5b4d>\n<3414> <5dd8>\n<3415> <882f>\n<3416> <5f4f>\n<3417> <6201>\n<341a> <6529>\n<341b> <6525>\n<341c> <6596>\n<341d> <66eb>\n<3420> <6b0f>\n<3421> <6bca>\n<3422> <705b>\n<3423> <705a>\n<3424> <7222>\n<3425> <7382>\n<3426> <7381>\n<3427> <7383>\n<3428> <7670>\n<3429> <77d4>\n<342a> <7c67>\n<342b> <7c66>\n<342c> <7e95>\n<342d> <826c>\n<342e> <863a>\n<342f> <8640>\n<3430> <8639>\n<3431> <863c>\n<3432> <8631>\n<3433> <863b>\n<3434> <863e>\n<3435> <8830>\nendbfchar\n\n100 beginbfchar\n<3436> <8832>\n<3437> <882e>\n<3438> <8833>\n<3439> <8976>\n<343a> <8974>\n<343b> <8973>\n<343c> <89fe>\n<343d> <8b8c>\n<343e> <8b8e>\n<343f> <8b8b>\n<3440> <8b88>\n<3441> <8c45>\n<3442> <8d19>\n<3443> <8e98>\n<3444> <8f64>\n<3445> <8f63>\n<3446> <91bc>\n<3447> <9462>\n<3448> <9455>\n<3449> <945d>\n<344a> <9457>\n<344b> <945e>\n<344e> <9800>\n<344f> <9a56>\n<3450> <9a59>\n<3454> <9c52>\n<3455> <9c58>\n<3456> <9c50>\n<3457> <9c4a>\n<3458> <9c4d>\n<3459> <9c4b>\n<345a> <9c55>\n<345b> <9c59>\n<345c> <9c4c>\n<345d> <9c4e>\n<345e> <9dfb>\n<345f> <9df7>\n<3460> <9def>\n<3461> <9de3>\n<3462> <9deb>\n<3463> <9df8>\n<3464> <9de4>\n<3465> <9df6>\n<3466> <9de1>\n<3467> <9dee>\n<3468> <9de6>\n<3469> <9df2>\n<346a> <9df0>\n<346b> <9de2>\n<346c> <9dec>\n<346d> <9df4>\n<346e> <9df3>\n<346f> <9de8>\n<3470> <9ded>\n<3471> <9ec2>\n<3472> <9ed0>\n<3475> <9f06>\n<3476> <9f1c>\n<3477> <9f38>\n<3478> <9f37>\n<3479> <9f36>\n<347a> <9f43>\n<347b> <9f4f>\n<347c> <9f71>\n<347d> <9f70>\n<3480> <56d3>\n<3481> <56cd>\n<3482> <5b4e>\n<3483> <5c6d>\n<3484> <652d>\n<3487> <6b13>\n<3488> <705f>\n<3489> <7061>\n<348a> <705d>\n<348b> <7060>\n<348c> <7223>\n<348d> <74db>\n<348e> <74e5>\n<348f> <77d5>\n<3490> <7938>\n<3491> <79b7>\n<3492> <79b6>\n<3493> <7c6a>\n<3494> <7e97>\n<3495> <7f89>\n<3496> <826d>\n<3497> <8643>\n<3498> <8838>\n<3499> <8837>\n<349a> <8835>\n<349b> <884b>\n<34a1> <8e9d>\n<34a2> <91be>\n<34a3> <91bd>\n<34a4> <91c2>\n<34a5> <946b>\n<34a8> <96e5>\n<34a9> <9746>\n<34aa> <9743>\n<34ab> <9747>\nendbfchar\n\n100 beginbfchar\n<34ac> <97c7>\n<34ad> <97e5>\n<34ae> <9a5e>\n<34af> <9ad5>\n<34b0> <9b59>\n<34b1> <9c63>\n<34b2> <9c67>\n<34b3> <9c66>\n<34b4> <9c62>\n<34b5> <9c5e>\n<34b6> <9c60>\n<34b7> <9e02>\n<34b8> <9dfe>\n<34b9> <9e07>\n<34ba> <9e03>\n<34bb> <9e06>\n<34bc> <9e05>\n<34bf> <9e09>\n<34c0> <9dff>\n<34c1> <9dfd>\n<34c2> <9e04>\n<34c3> <9ea0>\n<34c4> <9f1e>\n<34c5> <9f46>\n<34c9> <56d4>\n<34ca> <652e>\n<34cb> <65b8>\n<34ce> <6b17>\n<34cf> <6b1a>\n<34d0> <7062>\n<34d1> <7226>\n<34d2> <72aa>\n<34d5> <7939>\n<34d6> <7c69>\n<34d7> <7c6b>\n<34d8> <7cf6>\n<34d9> <7e9a>\n<34da> <7e98>\n<34db> <7e9b>\n<34dc> <7e99>\n<34e4> <897c>\n<34e5> <897b>\n<34e6> <89ff>\n<34e9> <8ea5>\n<34ea> <8ea4>\n<34eb> <8ea3>\n<34ec> <946e>\n<34ed> <946d>\n<34ee> <946f>\n<34ef> <9471>\n<34f0> <9473>\n<34f1> <9749>\n<34f2> <9872>\n<34f3> <995f>\n<34f4> <9c68>\n<34f5> <9c6e>\n<34f6> <9c6d>\n<34f7> <9e0b>\n<34f8> <9e0d>\n<34f9> <9e10>\n<34fa> <9e0f>\n<34fb> <9e12>\n<34fc> <9e11>\n<34fd> <9ea1>\n<34fe> <9ef5>\n<34ff> <9f09>\n<3500> <9f47>\n<3501> <9f78>\n<3502> <9f7b>\n<3503> <9f7a>\n<3504> <9f79>\n<3505> <571e>\n<3506> <7066>\n<3507> <7c6f>\n<3508> <883c>\n<3509> <8db2>\n<350a> <8ea6>\n<350b> <91c3>\n<350c> <9474>\n<350d> <9478>\n<350e> <9476>\n<350f> <9475>\n<3510> <9a60>\n<3511> <9b2e>\n<3512> <9c74>\n<3513> <9c73>\n<3514> <9c71>\n<3515> <9c75>\n<3516> <9e14>\n<3517> <9e13>\n<3518> <9ef6>\n<3519> <9f0a>\n<351a> <9fa4>\n<351b> <7068>\n<351c> <7065>\n<351d> <7cf7>\n<351e> <866a>\n<351f> <883e>\n<3520> <883d>\n<3521> <883f>\nendbfchar\n\n100 beginbfchar\n<3522> <8b9e>\n<3523> <8c9c>\n<3524> <8ea9>\n<3525> <8ec9>\n<3526> <974b>\n<3529> <98cc>\n<352a> <9961>\n<352b> <99ab>\n<352c> <9a64>\n<352f> <9b24>\n<3530> <9e15>\n<3531> <9e17>\n<3532> <9f48>\n<3533> <6207>\n<3534> <6b1e>\n<3535> <7227>\n<3536> <864c>\n<3537> <8ea8>\n<3538> <9482>\n<353b> <9a69>\n<353c> <9a68>\n<353d> <9e19>\n<353e> <864b>\n<353f> <8b9f>\n<3540> <9483>\n<3541> <9c79>\n<3542> <9eb7>\n<3543> <7675>\n<3544> <9a6b>\n<3545> <9c7a>\n<3546> <9e1d>\n<3549> <7229>\n<354a> <9ea4>\n<354b> <9f7e>\n<354c> <9f49>\n<354d> <9f98>\n<354e> <fe19>\n<354f> <223c>\n<35af> <fe33>\n<35b0> <2574>\n<35b1> <fe34>\n<35b2> <fe4f>\n<35b3> <0308>\n<35b4> <ff3e>\n<35b9> <fffd>\n<35bd> <30fc>\n<35be> <ff3b>\n<35bf> <ff3d>\n<35c0> <273d>\n<3670> <0401>\n<3691> <0451>\n<36ac> <21e7>\n<36af> <4e41>\n<36b0> <d840dccc>\n<36b1> <4e5a>\n<36b2> <d840dc8a>\n<36b3> <5202>\n<36b4> <4491>\n<36b5> <9fb0>\n<36b6> <5188>\n<36b7> <9fb1>\n<36b8> <d85dde07>\n<36b9> <fffd>\n<36ba> <fffd>\n<36bb> <fffd>\n<36bc> <fffd>\n<36bd> <fffd>\n<36be> <fffd>\n<36bf> <fffd>\n<36c0> <fffd>\n<36c1> <fffd>\n<36c2> <fffd>\n<36c3> <fffd>\n<36c4> <fffd>\n<36c5> <fffd>\n<36c6> <fffd>\n<36c7> <fffd>\n<36c8> <fffd>\n<36c9> <fffd>\n<36ca> <fffd>\n<36cb> <fffd>\n<36cc> <fffd>\n<36cd> <fffd>\n<36ce> <fffd>\n<36cf> <fffd>\n<36d0> <fffd>\n<36d1> <fffd>\n<36d2> <fffd>\n<36d3> <fffd>\n<36d4> <fffd>\n<36d5> <fffd>\n<36d6> <fffd>\n<36d7> <fffd>\n<36d8> <fffd>\n<36d9> <fffd>\n<36da> <fffd>\n<36db> <fffd>\n<36dc> <fffd>\n<36dd> <fffd>\n<36de> <fffd>\nendbfchar\n\n100 beginbfchar\n<36df> <fffd>\n<36e0> <fffd>\n<36e1> <00ac>\n<36e2> <ffe4>\n<36e3> <ff07>\n<36e4> <ff02>\n<36e5> <3231>\n<36e6> <2116>\n<36e7> <2121>\n<36e8> <7881>\n<36e9> <92b9>\n<36ea> <88cf>\n<36eb> <58bb>\n<36ec> <6052>\n<36ed> <7ca7>\n<36ee> <5afa>\n<36ef> <2554>\n<36f0> <2566>\n<36f1> <2557>\n<36f2> <2560>\n<36f3> <256c>\n<36f4> <2563>\n<36f5> <255a>\n<36f6> <2569>\n<36f7> <255d>\n<36f8> <2552>\n<36f9> <2564>\n<36fa> <2555>\n<36fb> <fffd>\n<36fc> <fffd>\n<36fd> <fffd>\n<36fe> <2558>\n<36ff> <2567>\n<3700> <255b>\n<3701> <2553>\n<3702> <2565>\n<3703> <2556>\n<3704> <255f>\n<3705> <256b>\n<3706> <2562>\n<3707> <2559>\n<3708> <2568>\n<3709> <255c>\n<370a> <2551>\n<370b> <fffd>\n<370c> <fffd>\n<370d> <fffd>\n<370e> <fffd>\n<370f> <fffd>\n<3710> <2593>\n<3711> <fffd>\n<3712> <fffd>\n<3716> <fffd>\n<3717> <fe14>\n<3718> <fe13>\n<3719> <fe16>\n<371a> <fe15>\n<371b> <fffd>\n<371c> <fffd>\n<371d> <fffd>\n<371e> <fffd>\n<371f> <fffd>\n<3720> <fffd>\n<3721> <fffd>\n<3722> <fffd>\n<3723> <fffd>\n<3724> <fffd>\n<3725> <fffd>\n<3726> <fffd>\n<3727> <fffd>\n<3728> <fffd>\n<3729> <fffd>\n<372a> <fffd>\n<372b> <d84fded7>\n<372c> <57be>\n<372d> <d85bded3>\n<372e> <713e>\n<372f> <d855dfe0>\n<3730> <69a2>\n<3731> <d862dfe9>\n<3732> <5b74>\n<3733> <7a49>\n<3734> <d856dce1>\n<3735> <d865dcd9>\n<3736> <7a65>\n<3737> <7a7d>\n<3738> <d856ddac>\n<3739> <7abb>\n<373a> <7ab0>\n<373d> <71d1>\n<373e> <d859dc8d>\n<373f> <41ca>\n<3740> <7ada>\n<3741> <7add>\n<3742> <7aea>\n<3743> <41ef>\n<3744> <54b2>\n<3745> <d857dc01>\n<3746> <7b0b>\n<3747> <7b55>\nendbfchar\n\n100 beginbfchar\n<3748> <7b29>\n<3749> <d854df0e>\n<374a> <d857dcfe>\n<374b> <7ba2>\n<374c> <7b6f>\n<374d> <839c>\n<374e> <d856dfb4>\n<374f> <d85bdc7f>\n<3750> <7bd0>\n<3751> <8421>\n<3752> <7b92>\n<3753> <fffd>\n<3754> <d857dd20>\n<3755> <fffd>\n<3756> <8492>\n<3757> <7bfa>\n<3758> <fffd>\n<3759> <7c35>\n<375a> <d857dcc1>\n<375b> <7c44>\n<375c> <7c83>\n<375d> <d852dc82>\n<375e> <7ca6>\n<375f> <d851dd78>\n<3760> <7cc9>\n<3761> <7cc7>\n<3762> <7ce6>\n<3763> <fffd>\n<3764> <7cf3>\n<3765> <7cf5>\n<3766> <7e67>\n<3767> <451d>\n<3768> <d85bde44>\n<3769> <7d5d>\n<376a> <d85bded6>\n<376b> <7d89>\n<376c> <7dab>\n<376d> <7135>\n<376e> <7db3>\n<376f> <7dd6>\n<3770> <d850dc57>\n<3771> <d858dc29>\n<3772> <7de4>\n<3773> <3d13>\n<3774> <7df5>\n<3775> <d845dff9>\n<3776> <7de5>\n<3777> <d860df6d>\n<3778> <fffd>\n<3779> <d858dd21>\n<377a> <d858dd5a>\n<377b> <7e6e>\n<377c> <fffd>\n<377d> <432b>\n<377e> <946c>\n<377f> <7e27>\n<3782> <7f47>\n<3783> <7936>\n<3784> <d858ded0>\n<3785> <99e1>\n<3786> <7f97>\n<3787> <d858df51>\n<3788> <7fa3>\n<3789> <d845de61>\n<378a> <d840dc68>\n<378b> <455c>\n<378c> <d84ddf66>\n<378d> <d860df3a>\n<378e> <7ffa>\n<378f> <d859dc89>\n<3790> <fa5b>\n<3791> <8008>\n<3792> <801d>\n<3793> <fffd>\n<3794> <802f>\n<3795> <d868dc87>\n<3796> <d85bdcc3>\n<3799> <8061>\n<379a> <d849df14>\n<379b> <4989>\n<379c> <d859de26>\n<379d> <d84fdde3>\n<379e> <d859dee8>\n<379f> <6725>\n<37a0> <80a7>\n<37a1> <d862de48>\n<37a2> <8107>\n<37a3> <811a>\n<37a4> <58b0>\n<37a5> <d849def6>\n<37a6> <6c7f>\n<37a7> <d859dc98>\n<37a8> <64e7>\n<37a9> <d845dc8a>\n<37aa> <8218>\n<37ab> <d846dc5e>\n<37ac> <6a53>\n<37ad> <d852de65>\n<37ae> <d852de95>\n<37af> <447a>\nendbfchar\n\n100 beginbfchar\n<37b0> <8229>\n<37b1> <d85ade52>\n<37b2> <d84fdd7e>\n<37b3> <4ff9>\n<37b4> <d845dcfd>\n<37b5> <84e2>\n<37b6> <8362>\n<37b7> <d87edd8f>\n<37b8> <d852dda7>\n<37b9> <d84ddd30>\n<37ba> <d845df73>\n<37bb> <d84fddf8>\n<37bc> <82aa>\n<37bd> <691b>\n<37be> <d87edd94>\n<37bf> <41db>\n<37c0> <854b>\n<37c1> <82d0>\n<37c2> <831a>\n<37c3> <d843de16>\n<37c4> <d845dfb4>\n<37c5> <36c1>\n<37c6> <d84cdd7d>\n<37c7> <d84ddd5a>\n<37c8> <827b>\n<37c9> <82e2>\n<37ca> <8318>\n<37cb> <d84fde8b>\n<37cc> <d85bdda3>\n<37cd> <d85adf05>\n<37ce> <d85adf97>\n<37cf> <d84dddce>\n<37d0> <3dbf>\n<37d1> <831d>\n<37d2> <55ec>\n<37d3> <8385>\n<37d4> <450b>\n<37d5> <d85bdda5>\n<37d6> <83ac>\n<37d7> <fffd>\n<37d8> <83d3>\n<37d9> <d85bded4>\n<37da> <6a57>\n<37db> <855a>\n<37dc> <3496>\n<37dd> <d85bde42>\n<37de> <8458>\n<37df> <d856dfe4>\n<37e0> <8471>\n<37e1> <3dd3>\n<37e2> <44e4>\n<37e3> <6aa7>\n<37e4> <844a>\n<37e5> <7958>\n<37e6> <fffd>\n<37e7> <d85adf96>\n<37e8> <d85bde77>\n<37e9> <d85bde43>\n<37ea> <84de>\n<37eb> <fffd>\n<37ec> <8391>\n<37ed> <44a0>\n<37ee> <8493>\n<37ef> <84e4>\n<37f0> <d857dc91>\n<37f1> <4240>\n<37f2> <d857dcc0>\n<37f3> <4543>\n<37f4> <8534>\n<37f5> <5af2>\n<37f6> <4523>\n<37f7> <4527>\n<37f8> <8573>\n<37f9> <4516>\n<37fa> <67bf>\n<37fb> <8616>\n<37fc> <d861de25>\n<37fd> <d861de3b>\n<37fe> <85c1>\n<37ff> <d85cdc88>\n<3800> <8602>\n<3801> <d845dd82>\n<3802> <d85cdccd>\n<3803> <d87eddb2>\n<3804> <456a>\n<3805> <8628>\n<3806> <3648>\n<3807> <d846dca2>\n<3808> <53f7>\n<3809> <d85cdf9a>\n<380a> <867e>\n<380b> <fffd>\n<380c> <d868dcf8>\n<380d> <87ee>\n<380e> <d84bdc27>\n<380f> <87b1>\n<3810> <87da>\n<3811> <880f>\n<3812> <5661>\n<3813> <866c>\nendbfchar\n\n100 beginbfchar\n<3814> <6856>\n<3815> <460f>\n<3818> <d85ddde0>\n<3819> <d84fddb9>\n<381a> <d85ddde4>\n<381b> <885e>\n<381c> <889c>\n<381d> <465b>\n<3820> <88c5>\n<3821> <d85ddf0f>\n<3822> <8987>\n<3823> <fffd>\n<3824> <fffd>\n<3825> <fffd>\n<3826> <89a7>\n<3827> <89bc>\n<3828> <d862de25>\n<3829> <89e7>\n<382a> <d85edd24>\n<382b> <d85edebd>\n<382c> <8a9c>\n<382d> <7793>\n<382e> <91fe>\n<382f> <8a90>\n<3830> <d85ede59>\n<3831> <7ae9>\n<3832> <d85edf3a>\n<3833> <4713>\n<3834> <d85edf38>\n<3835> <717c>\n<3836> <8b0c>\n<3837> <8b1f>\n<3838> <d855dc30>\n<3839> <d855dd65>\n<383a> <8b3f>\n<383b> <fffd>\n<383c> <8b4d>\n<383d> <8aa9>\n<383e> <d852de7a>\n<383f> <8b90>\n<3840> <8b9b>\n<3841> <8aaf>\n<3842> <d845dedf>\n<3843> <4615>\n<3844> <884f>\n<3845> <8c9b>\n<3846> <d85fdd54>\n<3847> <d85fdd8f>\n<3848> <d87eddd4>\n<3849> <3725>\n<384a> <d85fdd53>\n<384b> <8cd6>\n<384c> <d85fdd98>\n<384d> <d85fddbd>\n<384e> <8d12>\n<384f> <8d03>\n<3850> <d846dd10>\n<3851> <8cdb>\n<3852> <705c>\n<3853> <8d11>\n<3854> <3ed0>\n<3855> <d87eddd7>\n<3856> <8da9>\n<3857> <d860dc02>\n<3858> <d844dc14>\n<3859> <d852dd8a>\n<385a> <3b7c>\n<385b> <d860ddbc>\n<385c> <d85cdd0c>\n<385d> <7ae7>\n<385e> <8ead>\n<385f> <8eb6>\n<3860> <8ec3>\n<3861> <92d4>\n<3862> <8f19>\n<3863> <8f2d>\n<3864> <d860df65>\n<3865> <d861dc12>\n<3866> <8fa5>\n<3867> <9303>\n<3868> <d868de9f>\n<3869> <d842de50>\n<386a> <8fb3>\n<386b> <fffd>\n<386c> <d862ddde>\n<386d> <d861dd3d>\n<386e> <d84fddbb>\n<386f> <5ef8>\n<3870> <d84cde62>\n<3871> <8ff9>\n<3872> <fffd>\n<3873> <d848df25>\n<3874> <3980>\n<3875> <d85bded7>\n<3876> <9037>\n<3877> <d861dd3c>\n<3878> <d85edebe>\n<3879> <9061>\n<387a> <d861dd6c>\n<387b> <d861de0b>\nendbfchar\n\n100 beginbfchar\n<387c> <90a8>\n<387d> <d861df13>\n<387e> <90c4>\n<387f> <d861dee6>\n<3880> <90ae>\n<3881> <fa26>\n<3882> <9167>\n<3883> <91a9>\n<3884> <91c4>\n<3885> <7cac>\n<3886> <d862dd33>\n<3887> <d847de89>\n<3888> <920e>\n<3889> <6c9f>\n<388a> <9241>\n<388b> <9262>\n<388c> <d855ddb9>\n<388d> <d862dec6>\n<388e> <d84fdc9b>\n<388f> <d862df0c>\n<3890> <d855dddb>\n<3891> <d843dd31>\n<3892> <932c>\n<3893> <936b>\n<3894> <d862dee1>\n<3895> <d862dfeb>\n<3896> <5ac3>\n<3897> <d862dee2>\n<3898> <d862dee5>\n<3899> <4965>\n<389a> <9244>\n<389b> <d862dfec>\n<389c> <d863dc39>\n<389d> <d862dfff>\n<389e> <9373>\n<389f> <945b>\n<38a0> <8ebc>\n<38a1> <9585>\n<38a2> <95a6>\n<38a3> <9426>\n<38a4> <95a0>\n<38a5> <6ff6>\n<38a6> <42b9>\n<38a7> <d861ded8>\n<38a8> <d844de7c>\n<38a9> <d84fde2e>\n<38aa> <49df>\n<38ab> <6c1c>\n<38ac> <967b>\n<38ad> <9696>\n<38ae> <416c>\n<38af> <96a3>\n<38b0> <d85bded5>\n<38b1> <61da>\n<38b2> <e4ad>\n<38b3> <78f5>\n<38b4> <d862dee0>\n<38b5> <96bd>\n<38b6> <53cc>\n<38b7> <49a1>\n<38b8> <d85bdcb8>\n<38b9> <d840de74>\n<38ba> <d859dc10>\n<38bb> <d864dcaf>\n<38bc> <d864dce5>\n<38bd> <d852ded1>\n<38be> <d846dd15>\n<38bf> <d84cdf0a>\n<38c0> <9731>\n<38c1> <8642>\n<38c2> <9736>\n<38c3> <4a0f>\n<38c4> <453d>\n<38c5> <4585>\n<38c6> <d852dee9>\n<38c7> <7075>\n<38c8> <5b41>\n<38c9> <971b>\n<38ca> <fffd>\n<38cb> <d864ddd5>\n<38cc> <9757>\n<38cd> <5b4a>\n<38ce> <d864ddeb>\n<38cf> <975f>\n<38d0> <9425>\n<38d1> <50d0>\n<38d2> <d84cdcb7>\n<38d3> <d84cdcbc>\n<38d4> <9789>\n<38d5> <979f>\n<38d6> <97b1>\n<38d7> <97be>\n<38d8> <97c0>\n<38d9> <97d2>\n<38da> <97e0>\n<38db> <d855dc6c>\n<38dc> <97ee>\n<38dd> <741c>\n<38de> <d865dc33>\n<38df> <fffd>\nendbfchar\n\n100 beginbfchar\n<38e0> <97f5>\n<38e1> <d865dc1d>\n<38e2> <d85edd7a>\n<38e3> <4ad1>\n<38e4> <9834>\n<38e5> <9833>\n<38e6> <984b>\n<38e7> <9866>\n<38e8> <3b0e>\n<38e9> <d85cdd75>\n<38ea> <3d51>\n<38eb> <d841de30>\n<38ec> <d850dd5c>\n<38ed> <d855df06>\n<38ee> <98ca>\n<38ef> <98b7>\n<38f0> <98c8>\n<38f1> <98c7>\n<38f2> <4aff>\n<38f3> <d85bdd27>\n<38f4> <d845ded3>\n<38f5> <55b0>\n<38f6> <98e1>\n<38f7> <98e6>\n<38f8> <98ec>\n<38f9> <9378>\n<38fa> <9939>\n<38fb> <d852de29>\n<38fc> <4b72>\n<38fd> <d866dc57>\n<38fe> <d866dd05>\n<38ff> <99f5>\n<3900> <9a0c>\n<3901> <9a3b>\n<3902> <9a10>\n<3903> <9a58>\n<3904> <d855df25>\n<3905> <36c4>\n<3906> <d864dcb1>\n<3907> <d866dfd5>\n<3908> <9ae0>\n<3909> <9ae2>\n<390a> <d866df05>\n<390b> <9af4>\n<390c> <4c0e>\n<390d> <9b14>\n<390e> <9b2d>\n<390f> <d861de00>\n<3910> <5034>\n<3911> <9b34>\n<3912> <38c3>\n<3913> <d84cdc7d>\n<3914> <9b50>\n<3915> <9b40>\n<3916> <d867dd3e>\n<3917> <5a45>\n<3918> <d846dc63>\n<3919> <9b8e>\n<391a> <9c02>\n<391b> <9bff>\n<391c> <9c0c>\n<391d> <d867de68>\n<391e> <9dd4>\n<391f> <d867dfb7>\n<3920> <d868dd92>\n<3921> <d868ddab>\n<3922> <d868dce1>\n<3923> <d868dd23>\n<3924> <d868dddf>\n<3925> <9d7e>\n<3926> <9d83>\n<3927> <d868dd34>\n<3928> <9e0e>\n<3929> <9dc4>\n<392a> <d868dd93>\n<392b> <d868de20>\n<392c> <d846dd3b>\n<392d> <d868de33>\n<392e> <9d39>\n<392f> <d868dcb9>\n<3930> <d868deb4>\n<3931> <9e90>\n<3932> <9e95>\n<3933> <9e9e>\n<3934> <9ea2>\n<3935> <4d34>\n<3936> <9eaa>\n<3937> <9eaf>\n<3938> <d850df64>\n<3939> <9ec1>\n<393a> <3b60>\n<393b> <39e5>\n<393c> <3d1d>\n<393d> <4f32>\n<393e> <37be>\n<393f> <d863dc2b>\n<3940> <9f02>\n<3941> <9f08>\n<3942> <4b96>\n<3943> <9424>\nendbfchar\n\n100 beginbfchar\n<3944> <d85bdda2>\n<3945> <9f17>\n<3946> <d87ede1b>\n<3947> <9f39>\n<3948> <569f>\n<3949> <568a>\n<394a> <9f45>\n<394b> <99b8>\n<394c> <d864dc8b>\n<394d> <97f2>\n<394e> <847f>\n<394f> <fffd>\n<3950> <9f69>\n<3951> <7adc>\n<3952> <9f8e>\n<3953> <7216>\n<3954> <4bbe>\n<3955> <d852dd75>\n<3956> <d852ddbb>\n<3957> <7177>\n<3958> <d852ddf8>\n<3959> <d850df48>\n<395a> <d852de51>\n<395b> <739e>\n<395c> <d862dfda>\n<395d> <d846dcfa>\n<395e> <799f>\n<395f> <d862dd7e>\n<3960> <d863de36>\n<3961> <9369>\n<3962> <93f3>\n<3963> <d862de44>\n<3964> <92ec>\n<3965> <9381>\n<3966> <93cb>\n<3967> <d862dd6c>\n<3968> <d851dcb9>\n<3969> <7217>\n<396a> <3eeb>\n<396b> <7772>\n<396c> <7a43>\n<396d> <70d0>\n<396e> <d851dc73>\n<396f> <d850dff8>\n<3970> <717e>\n<3971> <d845dfef>\n<3972> <70a3>\n<3973> <d846dcbe>\n<3974> <d84ddd99>\n<3975> <3ec7>\n<3976> <d846dc85>\n<3977> <d855dc2f>\n<3978> <d845dff8>\n<3979> <3722>\n<397a> <d845defb>\n<397b> <d846dc39>\n<397c> <36e1>\n<397d> <d845df74>\n<397e> <d846dcd1>\n<397f> <d857df4b>\n<3980> <3723>\n<3981> <d845dec0>\n<3982> <575b>\n<3983> <d852de25>\n<3984> <d844dffe>\n<3985> <d844dea8>\n<3986> <d844dfc6>\n<3987> <d845dcb6>\n<3988> <8503>\n<3989> <d84ddea6>\n<398a> <fffd>\n<398b> <8455>\n<398c> <d852dd94>\n<398d> <d85cdd65>\n<398e> <d84fde31>\n<398f> <d855dd5c>\n<3990> <d84fdefb>\n<3991> <d85cdc52>\n<3992> <44f4>\n<3993> <d84ddeee>\n<3994> <d866dd9d>\n<3995> <d85bdf26>\n<3996> <67f9>\n<3997> <3733>\n<3998> <3c15>\n<3999> <3de7>\n<399a> <586c>\n<399b> <d846dd22>\n<399c> <6810>\n<399d> <4057>\n<399e> <d84ddf3f>\n<399f> <d850dce1>\n<39a0> <d850dc8b>\n<39a1> <d850dd0f>\n<39a2> <d85bdc21>\n<39a3> <54cb>\n<39a4> <569e>\n<39a5> <d859deb1>\n<39a6> <5692>\n<39a7> <d843dfdf>\nendbfchar\n\n100 beginbfchar\n<39a8> <d842dfa8>\n<39a9> <d843de0d>\n<39aa> <fffd>\n<39ab> <d862df13>\n<39ac> <939c>\n<39ad> <4ef8>\n<39ae> <512b>\n<39af> <3819>\n<39b0> <d851dc36>\n<39b1> <4ebc>\n<39b2> <d841dc65>\n<39b3> <fffd>\n<39b4> <4f4b>\n<39b5> <4f8a>\n<39b6> <d855de51>\n<39b7> <5a68>\n<39b8> <d840ddab>\n<39b9> <d840dfcb>\n<39ba> <3999>\n<39bb> <d840df0a>\n<39bc> <d841dc14>\n<39bd> <3435>\n<39be> <4f29>\n<39bf> <d840dec0>\n<39c0> <d863deb3>\n<39c1> <d840de75>\n<39c2> <8ada>\n<39c3> <d840de0c>\n<39c4> <4e98>\n<39c5> <50cd>\n<39c6> <510d>\n<39c7> <4fa2>\n<39c8> <4f03>\n<39c9> <d852de0e>\n<39ca> <d84fde8a>\n<39cb> <4f42>\n<39cc> <502e>\n<39cd> <506c>\n<39ce> <5081>\n<39cf> <4fcc>\n<39d0> <4fe5>\n<39d1> <5058>\n<39d2> <50fc>\n<39d3> <6e76>\n<39d4> <d84ddd95>\n<39d5> <d84fde39>\n<39d6> <d84fdebf>\n<39d7> <6d72>\n<39d8> <d846dc84>\n<39d9> <d84fde89>\n<39da> <51a8>\n<39db> <51c3>\n<39dc> <d841dde0>\n<39dd> <44dd>\n<39de> <d841dca3>\n<39df> <d841dc92>\n<39e0> <d841dc91>\n<39e1> <8d7a>\n<39e2> <d862de9c>\n<39e3> <d841df0e>\n<39e4> <5259>\n<39e5> <52a4>\n<39e6> <d842dc73>\n<39e7> <52e1>\n<39e8> <fffd>\n<39e9> <467a>\n<39ea> <718c>\n<39eb> <d850df8c>\n<39ec> <d843dc20>\n<39ed> <d852ddac>\n<39ee> <d844dce4>\n<39ef> <69d1>\n<39f0> <d843de1d>\n<39f1> <fffd>\n<39f2> <3ede>\n<39f3> <7499>\n<39f4> <7414>\n<39f5> <7456>\n<39f6> <7398>\n<39f7> <4b8e>\n<39f8> <d852debc>\n<39f9> <d850dc8d>\n<39fa> <53d0>\n<39fb> <3584>\n<39fc> <720f>\n<39fd> <d850dcc9>\n<39fe> <55b4>\n<39ff> <d840df45>\n<3a00> <54cd>\n<3a01> <d842dfc6>\n<3a02> <571d>\n<3a03> <925d>\n<3a04> <96f4>\n<3a05> <57dd>\n<3a06> <578d>\n<3a07> <577f>\n<3a08> <363e>\n<3a09> <58cb>\n<3a0a> <5a99>\n<3a0b> <d862de46>\nendbfchar\n\n100 beginbfchar\n<3a0c> <d845defa>\n<3a0d> <d845df6f>\n<3a0e> <d845df10>\n<3a0f> <5a2c>\n<3a10> <59b8>\n<3a11> <5a7e>\n<3a12> <5acf>\n<3a13> <5a12>\n<3a14> <d856dd46>\n<3a15> <d846ddf3>\n<3a16> <d846dc61>\n<3a17> <d850de95>\n<3a18> <36f5>\n<3a19> <6d05>\n<3a1a> <7443>\n<3a1b> <5a21>\n<3a1c> <d857de83>\n<3a1d> <5a81>\n<3a1e> <d862dfd7>\n<3a1f> <d841dc13>\n<3a20> <93e0>\n<3a21> <748c>\n<3a22> <d844df03>\n<3a23> <7105>\n<3a24> <4972>\n<3a25> <9408>\n<3a26> <d862ddfb>\n<3a27> <93bd>\n<3a28> <37a0>\n<3a29> <5c1e>\n<3a2a> <5c9e>\n<3a2b> <5e5e>\n<3a2c> <5e48>\n<3a2d> <d846dd96>\n<3a2e> <d846dd7c>\n<3a2f> <d84edeee>\n<3a30> <5ecd>\n<3a31> <5b4f>\n<3a34> <3701>\n<3a35> <d846dca0>\n<3a36> <36dd>\n<3a37> <d845defe>\n<3a38> <36d3>\n<3a39> <812a>\n<3a3a> <d862de47>\n<3a3b> <d847ddba>\n<3a3c> <d84ddc72>\n<3a3d> <d862dda8>\n<3a3e> <5f0c>\n<3a3f> <5f0e>\n<3a40> <d846dd27>\n<3a41> <d845dfab>\n<3a42> <5a6b>\n<3a43> <d845df3b>\n<3a44> <5b44>\n<3a45> <d85dddfd>\n<3a46> <8860>\n<3a47> <607e>\n<3a48> <d84adc60>\n<3a49> <d849de2b>\n<3a4a> <5fdb>\n<3a4b> <3eb8>\n<3a4c> <d849ddaf>\n<3a4d> <d849ddbe>\n<3a4e> <d864dc88>\n<3a4f> <d85bdf73>\n<3a50> <61c0>\n<3a51> <d840dc3e>\n<3a52> <d840dc46>\n<3a53> <d849de1b>\n<3a54> <6199>\n<3a55> <6198>\n<3a56> <6075>\n<3a57> <d84bdc9b>\n<3a58> <d84bdd07>\n<3a59> <d851ded4>\n<3a5a> <d864dd4d>\n<3a5b> <6471>\n<3a5c> <d851de65>\n<3a5d> <d84adf6a>\n<3a5e> <3a29>\n<3a5f> <d84adf22>\n<3a60> <d84ddc50>\n<3a61> <d866dcea>\n<3a62> <d84bde78>\n<3a63> <6337>\n<3a64> <64b6>\n<3a65> <6331>\n<3a66> <63d1>\n<3a67> <d852dde3>\n<3a68> <d84bdd67>\n<3a69> <62a4>\n<3a6a> <d84bdca1>\n<3a6b> <643b>\n<3a6c> <656b>\n<3a6d> <6972>\n<3a6e> <3bf4>\n<3a6f> <d84cdc8e>\n<3a70> <d84cdead>\n<3a71> <d852dd89>\nendbfchar\n\n100 beginbfchar\n<3a72> <d84cdeab>\n<3a73> <550d>\n<3a74> <d84cdee0>\n<3a75> <d846dcd9>\n<3a76> <d865dc3f>\n<3a77> <66ce>\n<3a78> <d84cde89>\n<3a79> <d84cddb3>\n<3a7a> <3ae0>\n<3a7b> <d855dd84>\n<3a7c> <d862df22>\n<3a7d> <d855dd8f>\n<3a7e> <d845defc>\n<3a7f> <d855dd5b>\n<3a80> <d855dc25>\n<3a81> <78ee>\n<3a82> <d84cdd03>\n<3a83> <d846dc2a>\n<3a84> <d84cde34>\n<3a85> <3464>\n<3a86> <d84cde0f>\n<3a87> <d84cdd82>\n<3a88> <d850dec9>\n<3a89> <668e>\n<3a8a> <d85bdd24>\n<3a8b> <666b>\n<3a8c> <4b93>\n<3a8d> <6630>\n<3a8e> <d85edc70>\n<3a8f> <d847ddeb>\n<3a90> <6663>\n<3a91> <d84cded2>\n<3a92> <d84cdee1>\n<3a93> <661e>\n<3a94> <d856dc72>\n<3a95> <38d1>\n<3a96> <d84edc3a>\n<3a97> <d84ddfbc>\n<3a98> <3b99>\n<3a99> <d84ddfa2>\n<3a9a> <d84cdffe>\n<3a9b> <74d0>\n<3a9c> <3b96>\n<3a9d> <d851de2a>\n<3a9e> <68b6>\n<3a9f> <fffd>\n<3aa0> <3bc4>\n<3aa1> <6abe>\n<3aa2> <d84ddfd5>\n<3aa3> <d851dc87>\n<3aa4> <6a33>\n<3aa5> <6a52>\n<3aa6> <6ac9>\n<3aa7> <6b05>\n<3aa8> <d846dd12>\n<3aa9> <6511>\n<3aaa> <6898>\n<3aab> <6a4c>\n<3aac> <3bd7>\n<3aad> <6a7a>\n<3aae> <6b57>\n<3aaf> <d84fdfc0>\n<3ab0> <d84fdc9a>\n<3ab1> <93a0>\n<3ab2> <92f2>\n<3ab3> <d862dfea>\n<3ab4> <d862decb>\n<3ab5> <9289>\n<3ab6> <d860dc1e>\n<3ab7> <d862dddc>\n<3ab8> <9467>\n<3ab9> <6da5>\n<3aba> <6f0b>\n<3abb> <fffd>\n<3abc> <d84fdf7f>\n<3abd> <3d8f>\n<3abe> <6e04>\n<3abf> <d850dc3c>\n<3ac0> <5a3d>\n<3ac1> <6e0a>\n<3ac2> <5847>\n<3ac3> <6d24>\n<3ac4> <7842>\n<3ac5> <713b>\n<3ac6> <d850df1a>\n<3ac7> <d850de76>\n<3ac8> <70f1>\n<3ac9> <7250>\n<3aca> <7287>\n<3acb> <7294>\n<3acc> <d851df8f>\n<3acd> <d851df25>\n<3ace> <5179>\n<3acf> <d852dea4>\n<3ad0> <d841ddeb>\n<3ad1> <747a>\n<3ad2> <d84fdef8>\n<3ad3> <d84dde5f>\n<3ad4> <d852de4a>\n<3ad5> <d852dd17>\nendbfchar\n\n100 beginbfchar\n<3ad6> <d857dfe1>\n<3ad7> <3f06>\n<3ad8> <3eb1>\n<3ad9> <d852dedf>\n<3ada> <d863dc23>\n<3adb> <d84fdf35>\n<3adc> <60a7>\n<3add> <3ef3>\n<3ade> <74cc>\n<3adf> <743c>\n<3ae0> <9387>\n<3ae1> <7437>\n<3ae2> <449f>\n<3ae3> <d85bddea>\n<3ae4> <4551>\n<3ae5> <7583>\n<3ae6> <3f63>\n<3ae7> <d853dcd9>\n<3ae8> <d853dd06>\n<3ae9> <3f58>\n<3aea> <7555>\n<3aeb> <7673>\n<3aec> <d869ddc6>\n<3aed> <fffd>\n<3aee> <7468>\n<3aef> <d862decc>\n<3af0> <d852ddab>\n<3af1> <d852dd8e>\n<3af2> <3afb>\n<3af3> <3dcd>\n<3af4> <d852de4e>\n<3af5> <3eff>\n<3af6> <d852ddc5>\n<3af7> <d852dcf3>\n<3af8> <91fa>\n<3af9> <5732>\n<3afa> <9342>\n<3afb> <d862dee3>\n<3afc> <d846dc64>\n<3afd> <50df>\n<3afe> <d854de21>\n<3aff> <d854dde7>\n<3b00> <7778>\n<3b01> <d84cde32>\n<3b04> <777b>\n<3b05> <d851de97>\n<3b06> <d84ddf81>\n<3b07> <3a5e>\n<3b08> <d852dcf0>\n<3b09> <7438>\n<3b0a> <749b>\n<3b0b> <3ebf>\n<3b0c> <d852deba>\n<3b0d> <d852dec7>\n<3b0e> <40c8>\n<3b0f> <d852de96>\n<3b10> <d858ddae>\n<3b11> <9307>\n<3b12> <d855dd81>\n<3b13> <781e>\n<3b14> <788d>\n<3b15> <7888>\n<3b16> <78d2>\n<3b17> <73d0>\n<3b18> <7959>\n<3b19> <d85ddf41>\n<3b1a> <d855dee3>\n<3b1b> <410e>\n<3b1c> <fffd>\n<3b1d> <fffd>\n<3b1e> <79a5>\n<3b1f> <6a2d>\n<3b20> <d84fdefa>\n<3b21> <7a3a>\n<3b22> <79f4>\n<3b23> <416e>\n<3b24> <d845dee6>\n<3b25> <4132>\n<3b26> <9235>\n<3b27> <79f1>\n<3b28> <d843dd4c>\n<3b29> <d852dd8c>\n<3b2a> <d840de99>\n<3b2b> <d84fddba>\n<3b2c> <d845df6e>\n<3b2d> <3597>\n<3b2e> <556b>\n<3b2f> <3570>\n<3b30> <36aa>\n<3b31> <d840ddd4>\n<3b32> <d843dc0d>\n<3b33> <7ae2>\n<3b34> <5a59>\n<3b35> <d849def5>\n<3b36> <d856deaf>\n<3b37> <d856de9c>\n<3b38> <5a0d>\n<3b39> <d840de5b>\n<3b3a> <78f0>\n<3b3b> <5a2a>\nendbfchar\n\n100 beginbfchar\n<3b3c> <d856dfc6>\n<3b3d> <7afe>\n<3b3e> <41f9>\n<3b3f> <7c5d>\n<3b40> <7c6d>\n<3b41> <4211>\n<3b42> <d856dfb3>\n<3b43> <d857debc>\n<3b44> <d857dea6>\n<3b45> <7ccd>\n<3b46> <d852ddf9>\n<3b47> <d845dfb0>\n<3b48> <7c8e>\n<3b49> <7c7c>\n<3b4a> <7cae>\n<3b4b> <6ab2>\n<3b4c> <7ddc>\n<3b4d> <7e07>\n<3b4e> <7dd3>\n<3b4f> <7f4e>\n<3b50> <d858de61>\n<3b51> <d858dd5c>\n<3b52> <d85edf48>\n<3b53> <7d97>\n<3b54> <d857de82>\n<3b55> <426a>\n<3b56> <d85adf75>\n<3b57> <d842dd16>\n<3b58> <67d6>\n<3b59> <d840dc4e>\n<3b5a> <d84dddcf>\n<3b5b> <57c4>\n<3b5c> <d859dc12>\n<3b5d> <d858dff8>\n<3b5e> <7fdd>\n<3b5f> <7b27>\n<3b60> <d842dc2c>\n<3b61> <d856dee9>\n<3b62> <d857dd43>\n<3b63> <7b0c>\n<3b64> <d857de0e>\n<3b65> <99e6>\n<3b66> <8645>\n<3b67> <9a63>\n<3b68> <6a1c>\n<3b69> <d84ddc3f>\n<3b6a> <d852ddf7>\n<3b6b> <d859ddad>\n<3b6c> <9a1f>\n<3b6d> <d859dda0>\n<3b6e> <8495>\n<3b6f> <d85cdd27>\n<3b70> <d85bdcd1>\n<3b71> <44ea>\n<3b72> <8137>\n<3b73> <4402>\n<3b74> <80c6>\n<3b75> <8109>\n<3b76> <8142>\n<3b77> <d859dfb4>\n<3b78> <98c3>\n<3b79> <d85ade42>\n<3b7a> <8262>\n<3b7b> <8265>\n<3b7c> <d85ade51>\n<3b7d> <8453>\n<3b7e> <d85bdda7>\n<3b7f> <8610>\n<3b80> <d85cde1b>\n<3b81> <5a86>\n<3b82> <417f>\n<3b83> <d846dc40>\n<3b84> <5b2b>\n<3b85> <d846dca1>\n<3b86> <5ae4>\n<3b87> <d846dcd8>\n<3b88> <86a0>\n<3b89> <d87eddbc>\n<3b8a> <d84fdd8f>\n<3b8b> <882d>\n<3b8c> <d85ddc22>\n<3b8d> <5a02>\n<3b8e> <886e>\n<3b8f> <4f45>\n<3b90> <8887>\n<3b91> <88bf>\n<3b92> <88e6>\n<3b93> <8965>\n<3b94> <894d>\n<3b95> <d855de83>\n<3b96> <8954>\n<3b97> <d85ddf85>\n<3b98> <d85ddf84>\n<3b99> <d862dff5>\n<3b9a> <d862dfd9>\n<3b9b> <d862df9c>\n<3b9c> <d862ddf9>\n<3b9d> <3ead>\n<3b9e> <84a3>\n<3b9f> <46f5>\nendbfchar\n\n100 beginbfchar\n<3ba0> <46cf>\n<3ba1> <37f2>\n<3ba2> <8a3d>\n<3ba3> <8a1c>\n<3ba4> <d865dc48>\n<3ba5> <5f4d>\n<3ba6> <922b>\n<3ba7> <d850de84>\n<3ba8> <65d4>\n<3ba9> <7129>\n<3baa> <70c4>\n<3bab> <d846dc45>\n<3bac> <9d6d>\n<3bad> <8c9f>\n<3bae> <8ce9>\n<3baf> <d85fdddc>\n<3bb0> <599a>\n<3bb1> <77c3>\n<3bb2> <59f0>\n<3bb3> <36d4>\n<3bb4> <8e2a>\n<3bb5> <8ea7>\n<3bb6> <d853dc09>\n<3bb7> <8f30>\n<3bb8> <8f4a>\n<3bb9> <42f4>\n<3bba> <6c58>\n<3bbb> <6fbb>\n<3bbc> <d848df21>\n<3bbd> <489b>\n<3bbe> <6f79>\n<3bbf> <6e8b>\n<3bc0> <d845dfda>\n<3bc1> <9be9>\n<3bc2> <36b5>\n<3bc3> <d852dd2f>\n<3bc4> <90bb>\n<3bc5> <48b4>\n<3bc6> <5571>\n<3bc7> <4906>\n<3bc8> <91bb>\n<3bc9> <9404>\n<3bca> <d862de4b>\n<3bcb> <4062>\n<3bcc> <d862defc>\n<3bcd> <9427>\n<3bce> <d863dc1d>\n<3bcf> <d863dc3b>\n<3bd0> <84e5>\n<3bd1> <8a2b>\n<3bd2> <9599>\n<3bd3> <95a7>\n<3bd4> <9597>\n<3bd5> <9596>\n<3bd6> <d863dd34>\n<3bd7> <7445>\n<3bd8> <3ec2>\n<3bd9> <d852dcff>\n<3bda> <d852de42>\n<3bdb> <d850dfea>\n<3bdc> <3ee7>\n<3bdd> <d84cde25>\n<3bde> <968f>\n<3bdf> <d863dee7>\n<3be0> <d863de66>\n<3be1> <d863de65>\n<3be2> <3ecc>\n<3be3> <d852dded>\n<3be4> <d852de78>\n<3be5> <d84fdfee>\n<3be6> <7412>\n<3be7> <746b>\n<3be8> <3efc>\n<3be9> <9741>\n<3bea> <d864dcb0>\n<3beb> <6847>\n<3bec> <4a1d>\n<3bed> <d864dc93>\n<3bee> <d855dfdf>\n<3bef> <fffd>\n<3bf0> <9368>\n<3bf1> <d862dd89>\n<3bf2> <d863dc26>\n<3bf3> <d862df2f>\n<3bf4> <d858dfbe>\n<3bf5> <92ba>\n<3bf6> <5b11>\n<3bf7> <8b69>\n<3bf8> <493c>\n<3bf9> <73f9>\n<3bfa> <d850de1b>\n<3bfb> <979b>\n<3bfc> <fffd>\n<3bfd> <9938>\n<3bfe> <d843df26>\n<3bff> <5dc1>\n<3c00> <d862dfc5>\n<3c01> <d852deb2>\n<3c02> <981f>\n<3c03> <d865dcda>\nendbfchar\n\n100 beginbfchar\n<3c04> <92f6>\n<3c05> <d865ddd7>\n<3c06> <91e5>\n<3c07> <44c0>\n<3c08> <d862df50>\n<3c09> <d852de67>\n<3c0a> <d862df64>\n<3c0b> <98dc>\n<3c0c> <d862de45>\n<3c0d> <3f00>\n<3c0e> <922a>\n<3c0f> <4925>\n<3c10> <8414>\n<3c11> <993b>\n<3c12> <994d>\n<3c13> <d85edf06>\n<3c14> <3dfd>\n<3c15> <fffd>\n<3c16> <4b6f>\n<3c17> <99aa>\n<3c18> <9a5c>\n<3c19> <d862df65>\n<3c1a> <d856dcc8>\n<3c1b> <6a8f>\n<3c1c> <9a21>\n<3c1d> <5afe>\n<3c1e> <9a2f>\n<3c1f> <d866dcf1>\n<3c20> <4b90>\n<3c21> <d866dd48>\n<3c22> <99bc>\n<3c23> <4bbd>\n<3c24> <4b97>\n<3c25> <937d>\n<3c26> <5872>\n<3c27> <d844df02>\n<3c28> <5822>\n<3c29> <d852ddb8>\n<3c2a> <d845dce8>\n<3c2b> <7844>\n<3c2c> <d849df1f>\n<3c2d> <d84fddb8>\n<3c2e> <68c5>\n<3c2f> <3d7d>\n<3c30> <9458>\n<3c31> <3927>\n<3c32> <6150>\n<3c33> <d849df81>\n<3c34> <d84add6b>\n<3c35> <6107>\n<3c36> <9c4f>\n<3c37> <9c53>\n<3c38> <9c7b>\n<3c39> <9c35>\n<3c3a> <9c10>\n<3c3b> <9b7f>\n<3c3c> <9bcf>\n<3c3d> <d867de2d>\n<3c3e> <9b9f>\n<3c3f> <d868ddf5>\n<3c40> <d868dcfe>\n<3c41> <9d21>\n<3c42> <4cae>\n<3c43> <d850dd04>\n<3c44> <9e18>\n<3c45> <4cb0>\n<3c46> <9d0c>\n<3c47> <d868ddb4>\n<3c48> <d868dced>\n<3c49> <d868dcf3>\n<3c4a> <d866dd2f>\n<3c4b> <9da5>\n<3c4c> <84bd>\n<3c4d> <d85bde12>\n<3c4e> <d85bdfdf>\n<3c4f> <d85adf82>\n<3c50> <85fc>\n<3c51> <4533>\n<3c52> <d85bdda4>\n<3c53> <d85bde84>\n<3c54> <d85bddf0>\n<3c55> <8420>\n<3c56> <85ee>\n<3c57> <d85bde00>\n<3c58> <d84ddfd7>\n<3c59> <d858dc64>\n<3c5a> <79e2>\n<3c5b> <d84ddd9c>\n<3c5c> <d84dde40>\n<3c5d> <d852ddde>\n<3c5e> <3d62>\n<3c5f> <93db>\n<3c60> <92be>\n<3c61> <9348>\n<3c62> <d840debf>\n<3c63> <78b9>\n<3c64> <9277>\n<3c65> <944d>\n<3c66> <4fe4>\n<3c67> <3440>\nendbfchar\n\n100 beginbfchar\n<3c68> <9064>\n<3c69> <d855dd5d>\n<3c6a> <783d>\n<3c6b> <7854>\n<3c6c> <78b6>\n<3c6d> <784b>\n<3c6e> <d845df57>\n<3c6f> <d84cddc9>\n<3c70> <d852dd41>\n<3c71> <369a>\n<3c72> <4f72>\n<3c73> <6fda>\n<3c74> <6fd9>\n<3c75> <fffd>\n<3c76> <701e>\n<3c77> <5414>\n<3c78> <d850ddb5>\n<3c79> <57bb>\n<3c7a> <58f3>\n<3c7b> <578a>\n<3c7c> <9d16>\n<3c7d> <57d7>\n<3c7e> <7134>\n<3c7f> <34af>\n<3c80> <d850ddac>\n<3c81> <71eb>\n<3c82> <d85bdc40>\n<3c83> <d853df97>\n<3c84> <fffd>\n<3c85> <d845dfb5>\n<3c86> <d862de49>\n<3c87> <610c>\n<3c88> <5ace>\n<3c89> <5a0b>\n<3c8a> <42bc>\n<3c8b> <d851dc88>\n<3c8c> <372c>\n<3c8d> <4b7b>\n<3c8e> <d862ddfc>\n<3c8f> <93bb>\n<3c90> <93b8>\n<3c91> <d846dcd6>\n<3c92> <d843df1d>\n<3c93> <8472>\n<3c94> <d85bdcc0>\n<3c95> <d845dc13>\n<3c96> <d850defa>\n<3c97> <d84bdc26>\n<3c98> <d850dfc1>\n<3c99> <5994>\n<3c9a> <d84fddb7>\n<3c9b> <d859df41>\n<3c9c> <7da8>\n<3c9d> <d858dd5b>\n<3c9e> <d858dca4>\n<3c9f> <d852ddb9>\n<3ca0> <d852dd8b>\n<3ca1> <d862ddfa>\n<3ca2> <92e5>\n<3ca3> <73e2>\n<3ca4> <3ee9>\n<3ca5> <74b4>\n<3ca6> <d862df63>\n<3ca7> <d846dc9f>\n<3ca8> <3ee1>\n<3ca9> <d852deb3>\n<3caa> <6ad8>\n<3cab> <73f3>\n<3cac> <73fb>\n<3cad> <3ed6>\n<3cae> <d852de3e>\n<3caf> <d852de94>\n<3cb0> <d845dfd9>\n<3cb1> <d852de66>\n<3cb2> <d840dfa7>\n<3cb3> <d845dc24>\n<3cb4> <d852dde5>\n<3cb5> <7448>\n<3cb6> <d852dd16>\n<3cb7> <70a5>\n<3cb8> <d852dd76>\n<3cb9> <9284>\n<3cba> <73e6>\n<3cbb> <935f>\n<3cbc> <d841dcfe>\n<3cbd> <9331>\n<3cbe> <d862dece>\n<3cbf> <d862de16>\n<3cc0> <9386>\n<3cc1> <d862dfe7>\n<3cc2> <d855ddd5>\n<3cc3> <4935>\n<3cc4> <d862de82>\n<3cc5> <716b>\n<3cc6> <d852dd43>\n<3cc7> <d843dcff>\n<3cc8> <56a4>\n<3cc9> <d841de1a>\n<3cca> <d842dfeb>\n<3ccb> <d843dcb8>\nendbfchar\n\n100 beginbfchar\n<3ccc> <5502>\n<3ccd> <79c4>\n<3cce> <d845dffa>\n<3ccf> <7dfe>\n<3cd0> <d845dec2>\n<3cd1> <d852de50>\n<3cd2> <d846dc52>\n<3cd3> <452e>\n<3cd4> <9401>\n<3cd5> <370a>\n<3cd6> <d862dec0>\n<3cd7> <d852ddad>\n<3cd8> <59b0>\n<3cd9> <d846dcbf>\n<3cda> <d846dc83>\n<3cdb> <d85ddc84>\n<3cdc> <5aa1>\n<3cdd> <36e2>\n<3cde> <d84fdd5b>\n<3cdf> <36b0>\n<3ce0> <925f>\n<3ce1> <5a79>\n<3ce2> <d862de81>\n<3ce3> <d846dc62>\n<3ce4> <9374>\n<3ce5> <3ccd>\n<3ce6> <d842deb4>\n<3ce7> <4a96>\n<3ce8> <398a>\n<3ce9> <50f4>\n<3cea> <3d69>\n<3ceb> <3d4c>\n<3cec> <d844df9c>\n<3ced> <7175>\n<3cee> <42fb>\n<3cef> <d860de18>\n<3cf0> <6e0f>\n<3cf1> <d864dce4>\n<3cf2> <44eb>\n<3cf3> <6d57>\n<3cf4> <d85fde4f>\n<3cf5> <7067>\n<3cf6> <6caf>\n<3cf7> <3cd6>\n<3cf8> <d84fdfed>\n<3cf9> <d84fde2d>\n<3cfa> <6e02>\n<3cfb> <6f0c>\n<3cfc> <3d6f>\n<3cfd> <d840dff5>\n<3cfe> <7551>\n<3cff> <36bc>\n<3d00> <34c8>\n<3d01> <4680>\n<3d02> <3eda>\n<3d03> <4871>\n<3d04> <59c4>\n<3d05> <926e>\n<3d06> <493e>\n<3d07> <8f41>\n<3d08> <d863dc1c>\n<3d09> <d85adfc0>\n<3d0a> <5812>\n<3d0b> <57c8>\n<3d0c> <36d6>\n<3d0d> <d845dc52>\n<3d0e> <70fe>\n<3d0f> <d850df62>\n<3d10> <d852de71>\n<3d11> <d84bdfe3>\n<3d12> <d844deb0>\n<3d13> <d848dfbd>\n<3d14> <68b9>\n<3d15> <6967>\n<3d16> <d844df98>\n<3d17> <d84ddce5>\n<3d18> <d85edff4>\n<3d19> <d84ddedf>\n<3d1a> <d862de83>\n<3d1b> <d84ddfd6>\n<3d1c> <d84cdffa>\n<3d1d> <d853dc9f>\n<3d1e> <6a1a>\n<3d1f> <d84ddead>\n<3d20> <d85bdcb7>\n<3d21> <843e>\n<3d22> <44df>\n<3d23> <44ce>\n<3d24> <d85bdd26>\n<3d25> <d85bdd51>\n<3d26> <d85bdc82>\n<3d27> <d85bdfde>\n<3d28> <fffd>\n<3d29> <fffd>\n<3d2a> <833d>\n<3d2b> <d845df3a>\n<3d2c> <83ed>\n<3d2d> <d85bdc80>\n<3d2e> <d85cdc53>\n<3d2f> <d845dfdb>\nendbfchar\n\n100 beginbfchar\n<3d30> <5989>\n<3d31> <5a82>\n<3d32> <d845dfb3>\n<3d33> <5a61>\n<3d34> <5a71>\n<3d35> <d846dd05>\n<3d36> <d850ddfc>\n<3d37> <372d>\n<3d38> <59ef>\n<3d39> <d845df3c>\n<3d3a> <36c7>\n<3d3b> <718e>\n<3d3c> <9390>\n<3d3d> <669a>\n<3d3e> <d850dea5>\n<3d3f> <5a6e>\n<3d40> <5a2b>\n<3d41> <d850de93>\n<3d42> <6a2b>\n<3d43> <d84fdef9>\n<3d44> <d85ddf36>\n<3d45> <d851dc5b>\n<3d46> <d850deca>\n<3d47> <711d>\n<3d48> <d850de59>\n<3d49> <d862dde1>\n<3d4a> <4fb0>\n<3d4b> <d85bdd28>\n<3d4c> <5cc2>\n<3d4d> <d851dcce>\n<3d4e> <d85fde4d>\n<3d4f> <d850dfbd>\n<3d50> <6a0c>\n<3d51> <d850de56>\n<3d52> <d844df04>\n<3d53> <fffd>\n<3d54> <7133>\n<3d55> <d850dfe9>\n<3d56> <3da5>\n<3d57> <6cdf>\n<3d58> <d87edc25>\n<3d59> <59eb>\n<3d5a> <5f5c>\n<3d5b> <d84cdf00>\n<3d5c> <7cd3>\n<3d5d> <d85edef4>\n<3d5e> <d855def6>\n<3d5f> <d85edf18>\n<3d60> <906c>\n<3d61> <81f6>\n<3d62> <770c>\n<3d63> <6ca2>\n<3d64> <56fd>\n<3d65> <5869>\n<3d66> <6761>\n<3d67> <5c5e>\n<3d68> <58f2>\n<3d69> <70b9>\n<3d6a> <6803>\n<3d6d> <4e21>\n<3d6e> <7b39>\n<3d6f> <3dcc>\n<3d70> <732a>\n<3d71> <7560>\n<3d72> <583a>\n<3d73> <82a6>\n<3d74> <698a>\n<3d75> <60e3>\n<3d76> <4eee>\n<3d77> <99c4>\n<3d78> <9ebf>\n<3d79> <5301>\n<3d7a> <67a0>\n<3d7b> <60e8>\n<3d7c> <51b4>\n<3d7d> <7a83>\n<3d7e> <9c3a>\n<3d7f> <7ac8>\n<3d80> <691a>\n<3d81> <59ac>\n<3d82> <5840>\n<3d83> <546a>\n<3d84> <60e7>\n<3d85> <567a>\n<3d86> <6955>\n<3d87> <9c2f>\n<3d88> <87a5>\n<3d89> <5c20>\n<3d8a> <5e0b>\n<3d8b> <671e>\n<3d8c> <84ad>\n<3d8d> <8b81>\n<3d8e> <4e78>\n<3d8f> <62c3>\n<3d90> <6855>\n<3d91> <fffd>\n<3d92> <82fd>\n<3d93> <89a5>\n<3d94> <8fa0>\n<3d95> <97b8>\nendbfchar\n\n100 beginbfchar\n<3d96> <9847>\n<3d97> <9abd>\n<3d98> <5fb1>\n<3d99> <6648>\n<3d9a> <66bf>\n<3d9b> <d85ede79>\n<3d9c> <fffd>\n<3d9d> <d852ddba>\n<3d9e> <fffd>\n<3d9f> <fffd>\n<3da0> <d840df46>\n<3da1> <670e>\n<3da2> <6918>\n<3da3> <d85dde57>\n<3da4> <d857dfe2>\n<3da5> <d85dddfe>\n<3da6> <d848dc9a>\n<3da7> <48d0>\n<3da8> <4ab8>\n<3da9> <d862de9a>\n<3daa> <d850dc3b>\n<3dab> <d852de45>\n<3dac> <d841ddca>\n<3dad> <51d2>\n<3dae> <d841de11>\n<3daf> <599f>\n<3db0> <d847dea8>\n<3db1> <3bbe>\n<3db2> <d84fdcff>\n<3db3> <399b>\n<3db4> <d861dde8>\n<3db5> <d866ddc9>\n<3db6> <3762>\n<3db7> <d848ddc3>\n<3db8> <8b5e>\n<3db9> <d862df4e>\n<3dba> <fffd>\n<3dbb> <7209>\n<3dbc> <d843dc78>\n<3dbd> <d841df79>\n<3dbe> <8eda>\n<3dbf> <528f>\n<3dc0> <7171>\n<3dc1> <d84fdf4a>\n<3dc2> <d852dea7>\n<3dc3> <55bc>\n<3dc4> <d85adf52>\n<3dc5> <3473>\n<3dc6> <d85dde32>\n<3dc7> <4718>\n<3dc8> <d852dd3f>\n<3dc9> <5066>\n<3dca> <34fb>\n<3dcb> <d84cdfcc>\n<3dcc> <fffd>\n<3dcd> <477c>\n<3dce> <d862dd48>\n<3dcf> <d847dd90>\n<3dd0> <fffd>\n<3dd1> <d85fdc12>\n<3dd2> <9056>\n<3dd3> <d853df9a>\n<3dd4> <8b62>\n<3dd5> <5d5b>\n<3dd6> <d85adff7>\n<3dd7> <fffd>\n<3dd8> <d846dd1c>\n<3dd9> <8aea>\n<3dda> <d852ddf6>\n<3ddb> <d84fdfef>\n<3ddc> <4bc0>\n<3ddd> <d849df1b>\n<3dde> <9465>\n<3ddf> <d855dfe1>\n<3de0> <6195>\n<3de1> <5a27>\n<3de2> <d87edccd>\n<3de3> <d87edc06>\n<3de4> <d851dd21>\n<3de5> <4e6a>\n<3de6> <d852dd34>\n<3de7> <9656>\n<3de8> <6d8f>\n<3de9> <d85bdcbd>\n<3dea> <8977>\n<3deb> <d859dc11>\n<3dec> <fffd>\n<3ded> <7b42>\n<3dee> <d864dcc0>\n<3def> <d842de11>\n<3df0> <fffd>\n<3df1> <7a45>\n<3df2> <9a26>\n<3df3> <365f>\n<3df4> <d859dc69>\n<3df5> <d840dc21>\n<3df6> <7983>\n<3df7> <5d2c>\n<3df8> <d84ddd19>\n<3df9> <fffd>\nendbfchar\n\n100 beginbfchar\n<3dfa> <46d0>\n<3dfb> <753b>\n<3dfc> <8865>\n<3dfd> <58b6>\n<3dfe> <371c>\n<3dff> <d849dd8d>\n<3e00> <3c54>\n<3e01> <9281>\n<3e02> <d848dd7a>\n<3e03> <9330>\n<3e04> <d852ddd0>\n<3e05> <6c39>\n<3e06> <d843def8>\n<3e07> <8827>\n<3e08> <88f5>\n<3e09> <d84add26>\n<3e0a> <d861dc73>\n<3e0b> <d845dfb1>\n<3e0c> <6eb8>\n<3e0d> <d852de2a>\n<3e0e> <d846dc20>\n<3e0f> <39a4>\n<3e10> <fffd>\n<3e11> <fffd>\n<3e12> <453f>\n<3e13> <66b6>\n<3e14> <d867dcad>\n<3e15> <d866dca4>\n<3e16> <8943>\n<3e17> <40df>\n<3e18> <d845de0a>\n<3e19> <39a1>\n<3e1a> <d84ddf2f>\n<3e1b> <d860dce8>\n<3e1c> <d844dfc5>\n<3e1d> <71ad>\n<3e1e> <8366>\n<3e1f> <d864dda8>\n<3e20> <fffd>\n<3e21> <4cb7>\n<3e22> <d85cdcaf>\n<3e23> <d862ddab>\n<3e24> <d850dd7a>\n<3e25> <7b43>\n<3e26> <797e>\n<3e27> <6fb5>\n<3e28> <d868dedf>\n<3e29> <6a03>\n<3e2a> <d860df18>\n<3e2b> <53a2>\n<3e2c> <d85bde07>\n<3e2d> <93bf>\n<3e2e> <6836>\n<3e2f> <975d>\n<3e30> <d860dd6f>\n<3e31> <d85addb5>\n<3e32> <d844dfed>\n<3e33> <d84cde2f>\n<3e34> <5d85>\n<3e35> <d863dc30>\n<3e36> <5715>\n<3e37> <9823>\n<3e38> <d862dd49>\n<3e39> <5dab>\n<3e3a> <d852dd88>\n<3e3b> <65be>\n<3e3c> <69d5>\n<3e3d> <53d2>\n<3e3e> <d852dea5>\n<3e3f> <d84fdf81>\n<3e40> <3c11>\n<3e41> <6736>\n<3e42> <d847dfa1>\n<3e43> <35ca>\n<3e44> <48fa>\n<3e45> <fffd>\n<3e46> <7808>\n<3e47> <9255>\n<3e48> <43f2>\n<3e49> <43df>\n<3e4a> <59f8>\n<3e4b> <fffd>\n<3e4c> <568b>\n<3e4d> <d865dde9>\n<3e4e> <9012>\n<3e4f> <55c1>\n<3e50> <4509>\n<3e51> <7e7f>\n<3e52> <6f56>\n<3e53> <6ab1>\n<3e54> <34e4>\n<3e55> <d85edc9d>\n<3e56> <373a>\n<3e57> <fffd>\n<3e58> <d860dc24>\n<3e59> <d85ede3e>\n<3e5a> <3deb>\n<3e5b> <d84fdcb7>\n<3e5c> <d858de58>\n<3e5d> <56bf>\nendbfchar\n\n100 beginbfchar\n<3e5e> <8e0e>\n<3e5f> <5b6d>\n<3e60> <63de>\n<3e61> <fffd>\n<3e62> <6530>\n<3e63> <562d>\n<3e64> <541a>\n<3e65> <d867dd98>\n<3e66> <4c7d>\n<3e67> <5622>\n<3e68> <561e>\n<3e69> <7f49>\n<3e6a> <5975>\n<3e6b> <d84fdd40>\n<3e6c> <8770>\n<3e6d> <8117>\n<3e6e> <9d5e>\n<3e6f> <8d18>\n<3e70> <763b>\n<3e71> <9c45>\n<3e72> <764e>\n<3e73> <77b9>\n<3e74> <9345>\n<3e75> <5432>\n<3e76> <8148>\n<3e77> <82f7>\n<3e78> <5625>\n<3e79> <8132>\n<3e7a> <8418>\n<3e7b> <80bd>\n<3e7c> <55ea>\n<3e7d> <7962>\n<3e7e> <5643>\n<3e7f> <5416>\n<3e80> <d843de9d>\n<3e81> <35ce>\n<3e82> <5605>\n<3e83> <55f1>\n<3e84> <66f1>\n<3e85> <d860dee2>\n<3e86> <362d>\n<3e87> <7534>\n<3e88> <55f0>\n<3e89> <55ba>\n<3e8a> <5497>\n<3e8b> <5572>\n<3e8c> <d843dc41>\n<3e8d> <d843dc96>\n<3e8e> <5ed0>\n<3e8f> <d843de76>\n<3e90> <d84bdc62>\n<3e91> <d843dea2>\n<3e92> <9eab>\n<3e93> <7d5a>\n<3e94> <fffd>\n<3e95> <d844dc75>\n<3e96> <629d>\n<3e97> <976d>\n<3e98> <5494>\n<3e99> <8ccd>\n<3e9a> <71f6>\n<3e9b> <9176>\n<3e9c> <63fc>\n<3e9d> <63b9>\n<3e9e> <63fe>\n<3e9f> <5569>\n<3ea0> <d84adf43>\n<3ea1> <9c72>\n<3ea2> <d84bdeb3>\n<3ea3> <519a>\n<3ea4> <34df>\n<3ea5> <d843dda7>\n<3ea6> <51a7>\n<3ea7> <544d>\n<3ea8> <551e>\n<3ea9> <5513>\n<3eaa> <7666>\n<3eab> <8e2d>\n<3eac> <d85adc8a>\n<3ead> <75b1>\n<3eae> <80b6>\n<3eaf> <8804>\n<3eb0> <fffd>\n<3eb1> <88c7>\n<3eb2> <81b6>\n<3eb3> <841c>\n<3eb4> <44ec>\n<3eb5> <7304>\n<3eb6> <830b>\n<3eb7> <567b>\n<3eb8> <9170>\n<3eb9> <9208>\n<3eba> <d843def9>\n<3ebb> <7266>\n<3ebc> <474e>\n<3ebd> <d85fdff9>\n<3ebe> <40fa>\n<3ebf> <9c5d>\n<3ec0> <651f>\n<3ec1> <48f3>\nendbfchar\n\n100 beginbfchar\n<3ec2> <d851dfe0>\n<3ec3> <d867dd7c>\n<3ec4> <fffd>\n<3ec5> <d85ddda3>\n<3ec6> <ed2b>\n<3ec7> <d858dc48>\n<3ec8> <71a3>\n<3ec9> <7e8e>\n<3eca> <9d50>\n<3ecb> <3577>\n<3ecc> <6cb2>\n<3ecd> <5367>\n<3ece> <39dc>\n<3ecf> <d851de18>\n<3ed0> <822d>\n<3ed1> <544b>\n<3ed2> <ed43>\n<3ed3> <3a52>\n<3ed4> <7374>\n<3ed5> <d867deac>\n<3ed6> <4d09>\n<3ed7> <9bed>\n<3ed8> <fffd>\n<3ed9> <4c5b>\n<3eda> <d867dfde>\n<3edb> <845c>\n<3edc> <d85cdeb2>\n<3edd> <632e>\n<3ede> <7d25>\n<3edf> <3a2a>\n<3ee0> <9008>\n<3ee1> <52cc>\n<3ee2> <3e74>\n<3ee3> <367a>\n<3ee4> <45e9>\n<3ee5> <d841dc8e>\n<3ee6> <7640>\n<3ee7> <5af0>\n<3ee8> <d843deb6>\n<3ee9> <787a>\n<3eea> <d85fdf2e>\n<3eeb> <58a7>\n<3eec> <40bf>\n<3eed> <567c>\n<3eee> <9b8b>\n<3eef> <5d74>\n<3ef0> <7654>\n<3ef1> <d869dc34>\n<3ef2> <9e85>\n<3ef3> <4ce1>\n<3ef4> <fffd>\n<3ef5> <37fb>\n<3ef6> <6119>\n<3ef7> <d850dff2>\n<3ef8> <ed73>\n<3ef9> <565d>\n<3efa> <d867de06>\n<3efb> <5234>\n<3efc> <35ad>\n<3efd> <fffd>\n<3efe> <9d7c>\n<3eff> <7c56>\n<3f00> <9b39>\n<3f01> <57de>\n<3f02> <5c53>\n<3f03> <64d3>\n<3f04> <d865dcd0>\n<3f05> <d858df35>\n<3f06> <86ad>\n<3f07> <d843dd28>\n<3f08> <d843dd71>\n<3f09> <ed8c>\n<3f0a> <51fe>\n<3f0b> <d847df0f>\n<3f0c> <5d8e>\n<3f0d> <9703>\n<3f0e> <d847ddd1>\n<3f0f> <9e81>\n<3f10> <904c>\n<3f11> <7b1f>\n<3f12> <9b02>\n<3f13> <5cd1>\n<3f14> <7ba3>\n<3f15> <6268>\n<3f16> <6335>\n<3f17> <9aff>\n<3f18> <7bcf>\n<3f19> <9b2a>\n<3f1a> <7c7e>\n<3f1b> <fffd>\n<3f1c> <7c42>\n<3f1d> <7c86>\n<3f1e> <9c15>\n<3f1f> <7bfc>\n<3f20> <9b09>\n<3f21> <fffd>\n<3f22> <9c2e>\n<3f23> <9f5a>\n<3f24> <5573>\n<3f25> <5bc3>\nendbfchar\n\n100 beginbfchar\n<3f26> <4ffd>\n<3f27> <9e98>\n<3f28> <4ff2>\n<3f29> <5260>\n<3f2a> <52d1>\n<3f2b> <5767>\n<3f2c> <5056>\n<3f2d> <59b7>\n<3f2e> <5e12>\n<3f2f> <97c8>\n<3f30> <9dab>\n<3f31> <8f5c>\n<3f32> <5469>\n<3f33> <97b4>\n<3f34> <9940>\n<3f35> <97ba>\n<3f36> <532c>\n<3f37> <6130>\n<3f38> <692c>\n<3f39> <53da>\n<3f3a> <9c0a>\n<3f3b> <9d02>\n<3f3c> <4c3b>\n<3f3d> <9641>\n<3f3e> <6980>\n<3f3f> <50a6>\n<3f40> <7546>\n<3f41> <d845df6d>\n<3f42> <99da>\n<3f43> <5273>\n<3f44> <edc9>\n<3f45> <9159>\n<3f46> <9681>\n<3f47> <915c>\n<3f48> <edcd>\n<3f49> <9151>\n<3f4a> <d863de97>\n<3f4b> <637f>\n<3f4c> <6aca>\n<3f4d> <5611>\n<3f4e> <918e>\n<3f4f> <757a>\n<3f50> <6285>\n<3f51> <734f>\n<3f52> <7c70>\n<3f53> <d857dc21>\n<3f54> <eddc>\n<3f55> <76d6>\n<3f56> <9b9d>\n<3f57> <4e2a>\n<3f58> <d843dcd4>\n<3f59> <83be>\n<3f5a> <8842>\n<3f5b> <ede4>\n<3f5c> <5c4a>\n<3f5d> <69c0>\n<3f5e> <fffd>\n<3f5f> <fffd>\n<3f60> <521f>\n<3f61> <5df5>\n<3f62> <4ece>\n<3f63> <6c31>\n<3f64> <d840ddf2>\n<3f65> <4f39>\n<3f66> <549c>\n<3f67> <fffd>\n<3f68> <529a>\n<3f69> <8d82>\n<3f6a> <35fe>\n<3f6b> <fffd>\n<3f6c> <35f3>\n<3f6d> <edf6>\n<3f6e> <6b52>\n<3f6f> <917c>\n<3f70> <9fa5>\n<3f71> <9b97>\n<3f72> <982e>\n<3f73> <98b4>\n<3f74> <9aba>\n<3f75> <9ea8>\n<3f76> <9e84>\n<3f77> <7b14>\n<3f78> <ee02>\n<3f79> <6bfa>\n<3f7a> <8818>\n<3f7b> <7f78>\n<3f7c> <ee06>\n<3f7d> <5620>\n<3f7e> <d869de4a>\n<3f7f> <8e77>\n<3f80> <9f53>\n<3f81> <ee0b>\n<3f82> <8dd4>\n<3f83> <8e4f>\n<3f84> <9e1c>\n<3f85> <8e01>\n<3f86> <6282>\n<3f87> <d860df7d>\n<3f88> <8e28>\n<3f89> <8e75>\nendbfchar\n\n100 beginbfchar\n<3f8a> <7ad3>\n<3f8b> <7a3e>\n<3f8c> <78d8>\n<3f8d> <6cea>\n<3f8e> <8a67>\n<3f8f> <7607>\n<3f90> <9f26>\n<3f91> <6cce>\n<3f92> <87d6>\n<3f93> <75c3>\n<3f94> <d868deb2>\n<3f95> <7853>\n<3f96> <8d0c>\n<3f97> <72e2>\n<3f98> <7371>\n<3f99> <8b2d>\n<3f9a> <7302>\n<3f9b> <74f1>\n<3f9c> <8ceb>\n<3f9d> <d852debb>\n<3f9e> <862f>\n<3f9f> <5fba>\n<3fa0> <88a0>\n<3fa1> <44b7>\n<3fa2> <ee2f>\n<3fa3> <d85bde05>\n<3fa4> <ee32>\n<3fa5> <8a7e>\n<3fa6> <d849dd1b>\n<3fa7> <ee35>\n<3fa8> <60fd>\n<3fa9> <7667>\n<3faa> <9ad7>\n<3fab> <9d44>\n<3fac> <936e>\n<3fad> <9b8f>\n<3fae> <87f5>\n<3faf> <ee3d>\n<3fb0> <fffd>\n<3fb1> <8cf7>\n<3fb2> <732c>\n<3fb3> <9721>\n<3fb4> <9bb0>\n<3fb5> <35d6>\n<3fb6> <72b2>\n<3fb7> <4c07>\n<3fb8> <7c51>\n<3fb9> <994a>\n<3fba> <6159>\n<3fbb> <4c04>\n<3fbc> <9e96>\n<3fbd> <617d>\n<3fbe> <ee4d>\n<3fbf> <575f>\n<3fc0> <616f>\n<3fc1> <62a6>\n<3fc2> <6239>\n<3fc3> <fffd>\n<3fc4> <3a5c>\n<3fc5> <61e2>\n<3fc6> <53aa>\n<3fc7> <6364>\n<3fc8> <6802>\n<3fc9> <35d2>\n<3fca> <5d57>\n<3fcb> <8fda>\n<3fcc> <d863de39>\n<3fcd> <ee5e>\n<3fce> <50d9>\n<3fcf> <7906>\n<3fd0> <5332>\n<3fd1> <9638>\n<3fd2> <d843df3b>\n<3fd3> <4065>\n<3fd4> <ee66>\n<3fd5> <77fe>\n<3fd6> <ee68>\n<3fd7> <7cc2>\n<3fd8> <d857df1a>\n<3fd9> <7cda>\n<3fda> <7a2d>\n<3fdb> <8066>\n<3fdc> <8063>\n<3fdd> <7d4d>\n<3fde> <7505>\n<3fdf> <74f2>\n<3fe0> <8994>\n<3fe1> <821a>\n<3fe2> <670c>\n<3fe3> <8062>\n<3fe4> <d85ddc86>\n<3fe5> <805b>\n<3fe6> <74f0>\n<3fe7> <8103>\n<3fe8> <7724>\n<3fe9> <8989>\n<3fea> <d859dfcc>\n<3feb> <7553>\n<3fec> <87a9>\n<3fed> <87ce>\nendbfchar\n\n100 beginbfchar\n<3fee> <81c8>\n<3fef> <878c>\n<3ff0> <8a49>\n<3ff1> <8cad>\n<3ff2> <8b43>\n<3ff3> <772b>\n<3ff4> <74f8>\n<3ff5> <84da>\n<3ff6> <69b2>\n<3ff7> <8da6>\n<3ff8> <ee8c>\n<3ff9> <89a9>\n<3ffa> <fffd>\n<3ffb> <6db9>\n<3ffc> <87c1>\n<3ffd> <d850dc11>\n<3ffe> <74e7>\n<3fff> <3ddb>\n<4000> <7176>\n<4001> <60a4>\n<4002> <619c>\n<4003> <3cd1>\n<4004> <fffd>\n<4005> <6077>\n<4006> <ee9a>\n<4007> <7f71>\n<4008> <d87edd22>\n<4009> <60e9>\n<400a> <4b7e>\n<400b> <d841dd47>\n<400c> <92db>\n<400d> <d841dddf>\n<400e> <d84fdfc5>\n<400f> <854c>\n<4010> <42b5>\n<4011> <73ef>\n<4012> <51b5>\n<4013> <3649>\n<4014> <d852dd42>\n<4015> <d862dde4>\n<4016> <9344>\n<4017> <d846dddb>\n<4018> <82ee>\n<4019> <d84fdcc8>\n<401a> <783c>\n<401b> <6744>\n<401c> <62df>\n<401d> <d852dd33>\n<401e> <d862ddaa>\n<401f> <d840dea0>\n<4020> <d85adfb3>\n<4021> <d844df05>\n<4022> <4fab>\n<4023> <d849dced>\n<4024> <5008>\n<4025> <d85bdd29>\n<4026> <d85ede84>\n<4027> <d84dde00>\n<4028> <d852deb1>\n<4029> <d849dd13>\n<402a> <fffd>\n<402b> <d840df7e>\n<402c> <5fa4>\n<402d> <d840df80>\n<402e> <d840df47>\n<402f> <6edb>\n<4030> <d841dc1f>\n<4031> <50de>\n<4032> <5101>\n<4033> <347a>\n<4034> <510e>\n<4035> <986c>\n<4036> <3743>\n<4037> <8416>\n<4038> <d852dda4>\n<4039> <d841dc87>\n<403a> <5160>\n<403b> <d84cdfb4>\n<403c> <516a>\n<403d> <d842dfff>\n<403e> <d848dcfc>\n<403f> <d840dee5>\n<4040> <d849dd30>\n<4041> <d841dd8e>\n<4042> <d84cde33>\n<4043> <d846dd83>\n<4044> <5b82>\n<4045> <877d>\n<4046> <d841ddb3>\n<4047> <d84fdc99>\n<4048> <51b2>\n<4049> <51b8>\n<404a> <9d34>\n<404b> <51c9>\n<404c> <51cf>\n<404d> <51d1>\n<404e> <3cdc>\n<404f> <51d3>\n<4050> <d852dea6>\n<4051> <51b3>\nendbfchar\n\n100 beginbfchar\n<4052> <fffd>\n<4053> <fffd>\n<4054> <51ed>\n<4055> <83cd>\n<4056> <693e>\n<4057> <d84ddf2d>\n<4058> <5f7b>\n<4059> <520b>\n<405a> <5226>\n<405b> <523c>\n<405c> <52b5>\n<405d> <5257>\n<405e> <5294>\n<405f> <52b9>\n<4060> <52c5>\n<4061> <7c15>\n<4062> <8542>\n<4063> <52e0>\n<4064> <860d>\n<4065> <d85adf13>\n<4066> <d87edc29>\n<4067> <d862dede>\n<4068> <5549>\n<4069> <6ed9>\n<406a> <d84fdf80>\n<406b> <d842dd54>\n<406c> <d84fdfec>\n<406d> <5333>\n<406e> <fffd>\n<406f> <d842dfe2>\n<4070> <6ccb>\n<4071> <d845df26>\n<4072> <681b>\n<4073> <73d5>\n<4074> <604a>\n<4075> <3eaa>\n<4076> <38cc>\n<4077> <d845dee8>\n<4078> <71dd>\n<4079> <44a2>\n<407a> <536d>\n<407b> <5374>\n<407c> <d861deab>\n<407d> <537e>\n<407e> <d87edc32>\n<407f> <d845dd96>\n<4080> <d845de13>\n<4081> <77e6>\n<4082> <5393>\n<4083> <d862de9b>\n<4084> <53a0>\n<4085> <53ab>\n<4086> <53ae>\n<4087> <73a7>\n<4088> <d855df72>\n<4089> <3f59>\n<408a> <739c>\n<408b> <53c1>\n<408c> <53c5>\n<408d> <6c49>\n<408e> <4e49>\n<408f> <57fe>\n<4090> <53d9>\n<4091> <3aab>\n<4092> <d842df8f>\n<4093> <53e0>\n<4094> <d84fdfeb>\n<4095> <d84bdda3>\n<4096> <53f6>\n<4097> <d843dc77>\n<4098> <5413>\n<4099> <7079>\n<409a> <552b>\n<409b> <6657>\n<409c> <6d5b>\n<409d> <546d>\n<409e> <d85adf53>\n<409f> <d843dd74>\n<40a0> <555d>\n<40a1> <548f>\n<40a2> <54a4>\n<40a3> <47a6>\n<40a4> <d845df0d>\n<40a5> <d843dedd>\n<40a6> <3db4>\n<40a7> <d843dd4d>\n<40a8> <d862ddbc>\n<40a9> <d849de98>\n<40aa> <5547>\n<40ab> <4ced>\n<40ac> <542f>\n<40ad> <7417>\n<40ae> <5586>\n<40af> <55a9>\n<40b0> <fffd>\n<40b1> <d846dcd7>\n<40b2> <d850dc3a>\n<40b3> <4552>\n<40b4> <d851dc35>\n<40b5> <66b3>\nendbfchar\n\n100 beginbfchar\n<40b6> <d844dcb4>\n<40b7> <5637>\n<40b8> <66cd>\n<40b9> <d84cde8a>\n<40ba> <66a4>\n<40bb> <fffd>\n<40bc> <564d>\n<40bd> <564f>\n<40be> <78f1>\n<40bf> <56f1>\n<40c0> <9787>\n<40c1> <53fe>\n<40c2> <5700>\n<40c3> <56ef>\n<40c4> <56ed>\n<40c5> <d862df66>\n<40c6> <3623>\n<40c7> <d844de4f>\n<40c8> <5746>\n<40c9> <d850dda5>\n<40ca> <6c6e>\n<40cb> <708b>\n<40cc> <5742>\n<40cd> <36b1>\n<40ce> <d85bdc7e>\n<40cf> <57e6>\n<40d0> <d845dc16>\n<40d1> <5803>\n<40d2> <d845dc54>\n<40d3> <d850df63>\n<40d4> <5826>\n<40d5> <d852dff5>\n<40d6> <581f>\n<40d7> <58aa>\n<40d8> <3561>\n<40d9> <58e0>\n<40da> <58dc>\n<40db> <d844de3c>\n<40dc> <58fb>\n<40dd> <5bff>\n<40de> <5743>\n<40df> <d868dd50>\n<40e0> <d850de78>\n<40e1> <93d3>\n<40e2> <35a1>\n<40e3> <591f>\n<40e4> <68a6>\n<40e5> <36c3>\n<40e6> <6e59>\n<40e7> <d845de3e>\n<40e8> <5a24>\n<40e9> <fffd>\n<40ea> <d845de92>\n<40eb> <8505>\n<40ec> <59c9>\n<40ed> <d843dd4e>\n<40ee> <d85bdc81>\n<40ef> <d85bdd2a>\n<40f0> <d845dfdc>\n<40f1> <59d9>\n<40f2> <d845dffb>\n<40f3> <d845dfb2>\n<40f4> <d85bdda6>\n<40f5> <6d71>\n<40f6> <d846dc28>\n<40f7> <d845ded5>\n<40f8> <59f9>\n<40f9> <d85bde45>\n<40fa> <5aab>\n<40fb> <5a63>\n<40fc> <36e6>\n<40fd> <d852dda9>\n<40fe> <fffd>\n<40ff> <3708>\n<4100> <5a96>\n<4101> <7465>\n<4102> <5ad3>\n<4103> <d85bdfa1>\n<4104> <d849dd54>\n<4105> <d846dd11>\n<4106> <3732>\n<4107> <d845deb8>\n<4108> <5e83>\n<4109> <52d0>\n<410a> <5b76>\n<410b> <6588>\n<410c> <5b7c>\n<410d> <d85ede0e>\n<410e> <4004>\n<410f> <485d>\n<4110> <d840de04>\n<4111> <5bd5>\n<4112> <d846de34>\n<4113> <d856ddcc>\n<4114> <d841dda5>\n<4115> <5bf3>\n<4116> <5b9d>\n<4117> <4d10>\n<4118> <5c05>\n<4119> <d846df44>\nendbfchar\n\n100 beginbfchar\n<411a> <5c13>\n<411b> <73ce>\n<411c> <5c14>\n<411d> <d847dca5>\n<411e> <d85adf28>\n<411f> <5c49>\n<4120> <48dd>\n<4121> <5c85>\n<4122> <5ce9>\n<4123> <5cef>\n<4124> <5d8b>\n<4125> <d847ddf9>\n<4126> <d847de37>\n<4127> <5d10>\n<4128> <5d18>\n<4129> <5d46>\n<412a> <d847dea4>\n<412b> <5cba>\n<412c> <5dd7>\n<412d> <82fc>\n<412e> <382d>\n<412f> <d852dd01>\n<4130> <d848dc49>\n<4131> <d848dd73>\n<4132> <8287>\n<4133> <3836>\n<4134> <3bc2>\n<4135> <5e2e>\n<4136> <6a8a>\n<4137> <fffd>\n<4138> <e12f>\n<4139> <d851dcbc>\n<413a> <d843dcd3>\n<413b> <53a6>\n<413c> <4eb7>\n<413d> <fffd>\n<413e> <53a8>\n<413f> <d845df71>\n<4140> <5e09>\n<4141> <e138>\n<4142> <d861dc82>\n<4143> <5ef9>\n<4144> <5efb>\n<4145> <38a0>\n<4146> <5efc>\n<4147> <683e>\n<4148> <941b>\n<4149> <5f0d>\n<414a> <d840ddc1>\n<414b> <d87edc94>\n<414c> <3ade>\n<414d> <d844df3a>\n<414e> <5f3a>\n<414f> <d85adc88>\n<4150> <d848dfd0>\n<4151> <d849dc71>\n<4152> <5f63>\n<4153> <d85bde6e>\n<4154> <5f72>\n<4155> <9340>\n<4156> <d862de36>\n<4157> <5fa7>\n<4158> <5db6>\n<4159> <3d5f>\n<415a> <d854de50>\n<415b> <d847df6a>\n<415c> <d85cdcf8>\n<415d> <d849de68>\n<415e> <91d6>\n<415f> <d840de9e>\n<4160> <d862de29>\n<4161> <6031>\n<4162> <6685>\n<4163> <3963>\n<4164> <3dc7>\n<4165> <3639>\n<4166> <5790>\n<4167> <d849dfb4>\n<4168> <7971>\n<4169> <3e40>\n<416a> <609e>\n<416b> <fffd>\n<416c> <60ea>\n<416d> <d852dd82>\n<416e> <d852dd8f>\n<416f> <d85ede53>\n<4170> <74a4>\n<4171> <50e1>\n<4172> <5aa0>\n<4173> <6164>\n<4174> <6142>\n<4175> <d87edca6>\n<4176> <d85bded2>\n<4177> <6181>\n<4178> <51f4>\n<4179> <d841de56>\n<417a> <6187>\n<417b> <5baa>\n<417c> <d84fdfb7>\n<417d> <d84adc5f>\nendbfchar\n\n100 beginbfchar\n<417e> <61d3>\n<417f> <d862df9d>\n<4180> <d866dd5d>\n<4181> <61d0>\n<4182> <3932>\n<4183> <d84add80>\n<4184> <d84adcc1>\n<4185> <6023>\n<4186> <615c>\n<4187> <651e>\n<4188> <638b>\n<4189> <d840dd18>\n<418a> <62c5>\n<418b> <d845df70>\n<418c> <62d5>\n<418d> <d84bde0d>\n<418e> <636c>\n<418f> <d852dddf>\n<4190> <3a17>\n<4191> <6438>\n<4192> <63f8>\n<4193> <d844df8e>\n<4194> <d845dffc>\n<4195> <6f8a>\n<4196> <d84bde36>\n<4197> <fffd>\n<4198> <d855df1d>\n<4199> <64e1>\n<419a> <64e5>\n<419b> <947b>\n<419c> <3a66>\n<419d> <643a>\n<419e> <3a57>\n<419f> <654d>\n<41a0> <6f16>\n<41a1> <d852de28>\n<41a2> <d852de23>\n<41a3> <6585>\n<41a4> <656d>\n<41a5> <655f>\n<41a6> <fffd>\n<41a7> <65b5>\n<41a8> <d852dd40>\n<41a9> <4b37>\n<41aa> <65d1>\n<41ab> <40d8>\n<41ac> <d846dc29>\n<41ad> <e1ab>\n<41ae> <65e3>\n<41af> <5fdf>\n<41b0> <d84ddc00>\n<41b1> <6618>\n<41b4> <6644>\n<41b7> <664b>\n<41b8> <d843de75>\n<41b9> <6667>\n<41ba> <d854dde6>\n<41bb> <6673>\n<41bc> <fa12>\n<41bd> <d84cde31>\n<41be> <d861ddf4>\n<41bf> <d84cddc8>\n<41c0> <d854df13>\n<41c1> <77c5>\n<41c2> <d84adcf7>\n<41c3> <99a4>\n<41c4> <6702>\n<41c5> <d850df9c>\n<41c6> <d852de21>\n<41c7> <69fa>\n<41c8> <d84ddfc2>\n<41c9> <d87edcdb>\n<41ca> <6767>\n<41cb> <6762>\n<41cc> <d850ddcd>\n<41cd> <d864dced>\n<41ce> <67d7>\n<41cf> <44e9>\n<41d0> <6822>\n<41d1> <6e50>\n<41d2> <923c>\n<41d3> <6801>\n<41d4> <d84cdfe6>\n<41d5> <d85bdda0>\n<41d6> <685d>\n<41d7> <d84ddc6f>\n<41d8> <69e1>\n<41d9> <6a0b>\n<41da> <d862dedf>\n<41db> <6973>\n<41dc> <68c3>\n<41dd> <d84dddcd>\n<41de> <6901>\n<41df> <6900>\n<41e0> <3a01>\n<41e1> <d84dde3c>\n<41e2> <3b80>\n<41e3> <67ac>\n<41e4> <6961>\n<41e5> <d862de4a>\nendbfchar\n\n100 beginbfchar\n<41e6> <42fc>\n<41e7> <6936>\n<41e8> <6998>\n<41e9> <3ba1>\n<41ea> <d840dfc9>\n<41eb> <8363>\n<41ec> <5090>\n<41ed> <69f9>\n<41ee> <d84dde59>\n<41ef> <d848dd2a>\n<41f0> <6a45>\n<41f1> <d84ddf03>\n<41f2> <6a9d>\n<41f3> <3bf3>\n<41f4> <67b1>\n<41f5> <6ac8>\n<41f6> <d864dd9c>\n<41f7> <3c0d>\n<41f8> <6b1d>\n<41f9> <d842dd23>\n<41fa> <60de>\n<41fb> <6b35>\n<41fc> <6b74>\n<41fd> <d849dfcd>\n<41fe> <6eb5>\n<41ff> <d84ededb>\n<4200> <fffd>\n<4201> <d846dd58>\n<4202> <3740>\n<4203> <5421>\n<4204> <d84edf5a>\n<4205> <6be1>\n<4206> <d84fdefc>\n<4207> <6bdc>\n<4208> <6c37>\n<4209> <d849dc8b>\n<420a> <d852dcf1>\n<420b> <d85adf51>\n<420c> <6c5a>\n<420d> <8226>\n<420e> <6c79>\n<420f> <d84fddbc>\n<4210> <44c5>\n<4211> <d84fddbd>\n<4212> <d850dda4>\n<4213> <d852dd0c>\n<4214> <d852dd00>\n<4215> <d84fdcc9>\n<4216> <36e5>\n<4217> <3ceb>\n<4218> <d843dd32>\n<4219> <9b83>\n<421a> <d84cddf9>\n<421b> <d849dc91>\n<421c> <7f8f>\n<421d> <6837>\n<421e> <d85bdd25>\n<421f> <d85bdda1>\n<4220> <d85bddeb>\n<4221> <6d96>\n<4222> <6d5c>\n<4223> <6e7c>\n<4224> <6f04>\n<4225> <d852dd7f>\n<4226> <d850dc85>\n<4227> <d85bde72>\n<4228> <8533>\n<4229> <d85bdf74>\n<422a> <51c7>\n<422b> <fffd>\n<422c> <fffd>\n<422d> <842e>\n<422e> <d862df21>\n<422f> <d87edd08>\n<4230> <d84fde2f>\n<4231> <7453>\n<4232> <d84fdf82>\n<4233> <79cc>\n<4234> <6e4f>\n<4235> <5a91>\n<4236> <d84cdc4b>\n<4237> <6ff8>\n<4238> <370d>\n<4239> <6f9d>\n<423a> <d84fde30>\n<423b> <6efa>\n<423c> <d845dc97>\n<423d> <d850dc3d>\n<423e> <4555>\n<423f> <93f0>\n<4240> <6f44>\n<4241> <6f5c>\n<4242> <3d4e>\n<4243> <6f74>\n<4244> <d864dd70>\n<4245> <3d3b>\n<4246> <6f9f>\n<4247> <d850dd44>\n<4248> <6fd3>\n<4249> <d850dc91>\nendbfchar\n\n100 beginbfchar\n<424a> <d850dd55>\n<424b> <d850dc39>\n<424c> <d84fdff0>\n<424d> <d84fdfb4>\n<424e> <d850dd3f>\n<424f> <51df>\n<4252> <d850dd40>\n<4253> <d858dddd>\n<4254> <704b>\n<4255> <707e>\n<4256> <70a7>\n<4257> <fffd>\n<4258> <70cc>\n<425b> <70df>\n<425c> <4104>\n<425d> <3de8>\n<425e> <71b4>\n<425f> <7196>\n<4260> <d850de77>\n<4261> <712b>\n<4262> <7145>\n<4263> <5a88>\n<4264> <714a>\n<4265> <fa48>\n<4266> <d850df65>\n<4267> <714f>\n<4268> <9362>\n<4269> <d850dec1>\n<426a> <712c>\n<426b> <d851dc5a>\n<426c> <d852de27>\n<426d> <d852de22>\n<426e> <71ba>\n<426f> <d862dfe8>\n<4270> <70bd>\n<4271> <720e>\n<4272> <9442>\n<4273> <7215>\n<4274> <5911>\n<4275> <9443>\n<4276> <7224>\n<4277> <9341>\n<4278> <d855de05>\n<4279> <722e>\n<427a> <7240>\n<427b> <d852dd74>\n<427c> <68bd>\n<427d> <7255>\n<427e> <7257>\n<427f> <3e55>\n<4280> <d84cdc44>\n<4281> <680d>\n<4282> <6f3d>\n<4283> <7282>\n<4284> <fffd>\n<4285> <732b>\n<4286> <d852dc23>\n<4287> <d862dc2b>\n<4288> <48ed>\n<4289> <d862dc04>\n<428a> <7328>\n<428b> <732e>\n<428c> <73cf>\n<428d> <73aa>\n<428e> <d843dc3a>\n<428f> <d85ade2e>\n<4290> <73c9>\n<4291> <7449>\n<4292> <d850dde2>\n<4293> <d845dee7>\n<4294> <d852de24>\n<4295> <6623>\n<4296> <36c5>\n<4297> <d852ddb7>\n<4298> <d852dd8d>\n<4299> <d852ddfb>\n<429a> <73f7>\n<429b> <7415>\n<429c> <6903>\n<429d> <d852de26>\n<429e> <7439>\n<429f> <3ed7>\n<42a0> <d87edd2f>\n<42a1> <d84adcad>\n<42a2> <7460>\n<42a3> <d863deb2>\n<42a4> <7447>\n<42a5> <73e4>\n<42a6> <7476>\n<42a7> <83b9>\n<42a8> <746c>\n<42a9> <7474>\n<42aa> <93f1>\n<42ab> <6a2c>\n<42ac> <7482>\n<42ad> <4953>\n<42ae> <d852de8c>\n<42af> <d850dd5f>\n<42b0> <d852de79>\n<42b1> <d862df8f>\nendbfchar\n\n100 beginbfchar\n<42b2> <5b46>\n<42b3> <d863dc03>\n<42b4> <d846dc9e>\n<42b5> <74c8>\n<42b6> <d846dd88>\n<42b7> <750e>\n<42b8> <751e>\n<42b9> <d863ded9>\n<42ba> <d846de4b>\n<42bb> <5bd7>\n<42bc> <d863deac>\n<42bd> <9385>\n<42be> <754d>\n<42bf> <754a>\n<42c0> <7567>\n<42c1> <756e>\n<42c2> <d853df82>\n<42c3> <3f04>\n<42c4> <d853dd13>\n<42c5> <758e>\n<42c6> <745d>\n<42c7> <759e>\n<42c8> <75b4>\n<42c9> <7602>\n<42ca> <762c>\n<42cb> <7651>\n<42cc> <764f>\n<42cd> <766f>\n<42ce> <e2d3>\n<42cf> <d858dff5>\n<42d0> <7690>\n<42d1> <81ef>\n<42d2> <37f8>\n<42d3> <d85add11>\n<42d4> <d85add0e>\n<42d5> <76a1>\n<42d6> <76a5>\n<42d7> <76b7>\n<42d8> <76cc>\n<42d9> <d85bdf9f>\n<42da> <8462>\n<42db> <d854dc9d>\n<42dc> <d854dd7d>\n<42dd> <d847de1c>\n<42de> <771e>\n<42df> <7726>\n<42e0> <7740>\n<42e1> <64af>\n<42e2> <d854de20>\n<42e3> <7758>\n<42e4> <d84cdeac>\n<42e5> <77af>\n<42e6> <d862dd64>\n<42e7> <d862dd68>\n<42e8> <d845dec1>\n<42e9> <77f4>\n<42ea> <fffd>\n<42eb> <68ca>\n<42ec> <78af>\n<42ed> <78c7>\n<42ee> <78d3>\n<42ef> <96a5>\n<42f0> <792e>\n<42f1> <d855dde0>\n<42f2> <78d7>\n<42f3> <7934>\n<42f4> <78b1>\n<42f5> <d85dde0c>\n<42f6> <8fb8>\n<42f7> <8884>\n<42f8> <d849de1c>\n<42f9> <7986>\n<42fa> <8900>\n<42fb> <6902>\n<42fc> <7980>\n<42fd> <d856dc57>\n<42fe> <799d>\n<42ff> <d85edf39>\n<4300> <793c>\n<4301> <79a9>\n<4302> <6e2a>\n<4303> <d85cdd26>\n<4304> <3ea8>\n<4305> <79c6>\n<4306> <d864dd0d>\n<4307> <79d4>\n<4308> <fffd>\n<4309> <5525>\n<430a> <fffd>\n<430b> <d843dc42>\n<430c> <d843dd15>\n<430d> <d854dd2b>\n<430e> <5590>\n<430f> <d84bdcc6>\n<4310> <39ec>\n<4311> <d840df41>\n<4312> <8e46>\n<4313> <d853ddb8>\n<4314> <d865dce5>\n<4315> <fffd>\nendbfchar\n\n100 beginbfchar\n<4316> <d860dcbe>\n<4317> <777a>\n<4318> <d84bdc38>\n<4319> <3a34>\n<431a> <47d5>\n<431b> <d860dd5d>\n<431c> <d85addf2>\n<431d> <d853ddea>\n<431e> <64dd>\n<431f> <d843dd7c>\n<4320> <d843dfb4>\n<4321> <d843dcd5>\n<4322> <fffd>\n<4323> <648d>\n<4324> <8e7e>\n<4325> <d843de96>\n<4326> <fffd>\n<4327> <d843df64>\n<4328> <d84bdca9>\n<4329> <d860de56>\n<432a> <d851dcd3>\n<432b> <fffd>\n<432c> <d843dd46>\n<432d> <d866de4d>\n<432e> <d860dce9>\n<432f> <47f4>\n<4330> <d853dea7>\n<4331> <d84bdcc2>\n<4332> <9ab2>\n<4333> <3a67>\n<4334> <d865ddf4>\n<4335> <3fed>\n<4336> <3506>\n<4337> <d854dec7>\n<4338> <d865dfd4>\n<4339> <fffd>\n<433a> <d84bdd44>\n<433b> <9d6e>\n<433c> <9815>\n<433d> <fffd>\n<433e> <43d9>\n<433f> <fffd>\n<4340> <64b4>\n<4341> <54e3>\n<4342> <fffd>\n<4343> <d84adfca>\n<4344> <fffd>\n<4345> <39fb>\n<4346> <fffd>\n<4347> <d859deda>\n<4348> <d859df16>\n<4349> <d85edda0>\n<434a> <64ea>\n<434b> <d854dc52>\n<434c> <d843dc43>\n<434d> <8e68>\n<434e> <fffd>\n<434f> <d862df4c>\n<4350> <d841df31>\n<4351> <fffd>\n<4352> <480b>\n<4353> <d840dda9>\n<4354> <3ffa>\n<4355> <5873>\n<4356> <d84bdd8d>\n<4357> <fffd>\n<4358> <d851ddc8>\n<4359> <d841dcfc>\n<435a> <d858dc97>\n<435b> <d843df4c>\n<435c> <fffd>\n<435d> <5579>\n<435e> <fffd>\n<435f> <43ba>\n<4360> <fffd>\n<4361> <4ab4>\n<4362> <d84ade66>\n<4363> <d844dc9d>\n<4364> <81aa>\n<4365> <98f5>\n<4366> <d843dd9c>\n<4367> <6379>\n<4368> <39fe>\n<4369> <d849df75>\n<436a> <8dc0>\n<436b> <56a1>\n<436c> <647c>\n<436d> <3e43>\n<436e> <fffd>\n<436f> <d869de01>\n<4370> <d843de09>\n<4371> <d84adecf>\n<4372> <fffd>\n<4373> <fffd>\n<4374> <d844dcc8>\n<4375> <d84eddc2>\n<4376> <3992>\n<4377> <3a06>\n<4378> <d860de9b>\n<4379> <3578>\nendbfchar\n\n100 beginbfchar\n<437a> <d857de49>\n<437b> <d848dcc7>\n<437c> <fffd>\n<437d> <fffd>\n<437e> <d84bdcb2>\n<437f> <d865df20>\n<4380> <34bc>\n<4381> <6c3d>\n<4382> <d853de3b>\n<4383> <fffd>\n<4384> <fffd>\n<4385> <d85ddd74>\n<4386> <d84bde8b>\n<4387> <d848de08>\n<4388> <d869de5b>\n<4389> <d863dccd>\n<438a> <d843de7a>\n<438b> <d843dc34>\n<438c> <d85dde39>\n<438d> <d84adfce>\n<438e> <d84bdc51>\n<438f> <3a18>\n<4390> <d844dcc7>\n<4391> <d869de32>\n<4392> <d863dcd2>\n<4393> <d863dd99>\n<4394> <d863dcca>\n<4395> <95aa>\n<4396> <fffd>\n<4397> <d85ddf5e>\n<4398> <7140>\n<4399> <fffd>\n<439a> <5156>\n<439b> <4efe>\n<439c> <5088>\n<439d> <fffd>\n<439e> <3493>\n<439f> <5186>\n<43a0> <5e42>\n<43a1> <5205>\n<43a2> <5227>\n<43a3> <5279>\n<43a4> <d87edc28>\n<43a5> <3553>\n<43a6> <53c2>\n<43a7> <535f>\n<43a8> <fffd>\n<43a9> <553f>\n<43aa> <fffd>\n<43ab> <55d8>\n<43ac> <35dd>\n<43ad> <5621>\n<43ae> <fffd>\n<43af> <5654>\n<43b0> <d844dc7b>\n<43b1> <fffd>\n<43b2> <d844dcd3>\n<43b3> <fffd>\n<43b4> <d844defe>\n<43b5> <fffd>\n<43b6> <fffd>\n<43b7> <37b9>\n<43b8> <5cc1>\n<43b9> <5d15>\n<43ba> <5d56>\n<43bb> <3838>\n<43bc> <4e81>\n<43bd> <5ebd>\n<43be> <3914>\n<43bf> <61b9>\n<43c0> <6290>\n<43c1> <6318>\n<43c2> <645a>\n<43c3> <6491>\n<43c4> <816d>\n<43c5> <8184>\n<43c6> <8193>\n<43c7> <6800>\n<43c8> <3bbc>\n<43c9> <728f>\n<43ca> <72cd>\n<43cb> <d851dfef>\n<43cc> <7339>\n<43cd> <7542>\n<43ce> <75dc>\n<43cf> <3fc0>\n<43d0> <d853dea5>\n<43d1> <3fd7>\n<43d2> <fffd>\n<43d3> <7680>\n<43d4> <768c>\n<43d5> <40a8>\n<43d6> <7839>\n<43d7> <4103>\n<43d8> <7a91>\n<43d9> <7c1b>\n<43da> <7ced>\n<43db> <7f93>\n<43dc> <7fae>\n<43dd> <fffd>\nendbfchar\n\n100 beginbfchar\n<43de> <82ff>\n<43df> <585f>\n<43e0> <86b2>\n<43e1> <45ac>\n<43e2> <878b>\n<43e3> <8947>\n<43e4> <fffd>\n<43e5> <8a29>\n<43e6> <fffd>\n<43e7> <8e71>\n<43e8> <d860dd89>\n<43e9> <8eb0>\n<43ea> <fffd>\n<43eb> <915e>\n<43ec> <918c>\n<43ed> <990e>\n<43ee> <991c>\n<43ef> <fffd>\n<43f0> <fffd>\n<43f1> <9b81>\n<43f2> <9dc0>\n<43f3> <9d93>\n<43f4> <9eac>\n<43f5> <4d91>\n<43f6> <fffd>\n<43f7> <93ba>\n<43f8> <9e7b>\n<43f9> <7089>\n<43fa> <7348>\n<43fb> <fffd>\n<43fc> <7999>\n<43fd> <8fb7>\n<43fe> <fffd>\n<43ff> <9942>\n<445f> <00a9>\n<4460> <2122>\n<4461> <2026>\n<44c1> <20ac>\n<44c2> <20ac>\n<44c3> <2110>\n<44c4> <20ac>\n<44c5> <20ac>\n<44c8> <2e80>\n<44ce> <d840dd0c>\n<44cf> <31c5>\n<44d0> <d840dcd1>\n<44d1> <d840dccd>\n<44d4> <d840dccb>\n<44d5> <d847dfe8>\n<44d6> <31c8>\n<44d7> <d840dcca>\n<44dc> <d840dd0e>\n<44e1> <d846dfc1>\n<44e2> <d87edc78>\n<44e3> <9751>\n<44e4> <d840dc86>\n<44e5> <4e5b>\n<44e6> <4ebb>\n<44e7> <353e>\n<44e8> <5c23>\n<44e9> <5f51>\n<44ea> <5fc4>\n<44eb> <38fa>\n<44ec> <624c>\n<44ed> <6535>\n<44ee> <6b7a>\n<44ef> <6c35>\n<44f0> <6c3a>\n<44f1> <706c>\n<44f2> <722b>\n<44f3> <4e2c>\n<44f4> <72ad>\n<44f5> <d852dce9>\n<44f6> <7f52>\n<44f7> <793b>\n<44f8> <7cf9>\n<44f9> <7f53>\n<44fa> <d858de6a>\n<44fb> <34c1>\n<44fc> <d858df4b>\n<44fd> <8002>\n<44fe> <8080>\n<44ff> <d859de12>\n<4500> <d85add51>\n<4501> <535d>\n<4502> <8864>\n<4503> <89c1>\n<4504> <d85edcb2>\n<4505> <8ba0>\n<4506> <8d1d>\n<4507> <9485>\n<4508> <9578>\n<4509> <957f>\n<450a> <95e8>\n<450b> <d863de0f>\n<450c> <97e6>\n<450d> <9875>\n<450e> <98ce>\n<450f> <98de>\n<4510> <9963>\nendbfchar\n\n100 beginbfchar\n<4511> <d866dc10>\n<4512> <9c7c>\n<4513> <9e1f>\n<4514> <9ec4>\n<4515> <6b6f>\n<4516> <f907>\n<4517> <4e37>\n<4518> <d840dc87>\n<4519> <961d>\n<451a> <6237>\n<451b> <94a2>\n<451c> <2e84>\n<4520> <2e8a>\n<4523> <2e95>\n<4524> <2e9c>\n<4525> <2ea5>\n<4526> <2ea7>\n<4527> <2eaa>\n<4528> <2eac>\n<4529> <2eae>\n<452a> <2eb6>\n<452b> <2ebc>\n<452c> <2ebe>\n<452d> <2eca>\n<4530> <2ecf>\n<4533> <2ede>\n<4534> <d868dfa9>\n<4535> <d844dd45>\n<4536> <650a>\n<4537> <4e3d>\n<4538> <6edd>\n<4539> <9d4e>\n<453a> <91df>\n<453b> <d85ddf35>\n<453c> <4f1a>\n<453d> <4f28>\n<453e> <4fa8>\n<453f> <5174>\n<4540> <519c>\n<4541> <51e4>\n<4542> <52a1>\n<4543> <52a8>\n<4544> <533b>\n<4545> <534e>\n<4546> <53d1>\n<4547> <53d8>\n<4548> <56e2>\n<4549> <58f0>\n<454a> <5904>\n<454b> <5907>\n<454c> <5932>\n<454d> <5934>\n<454e> <5b66>\n<4551> <5c9a>\n<4552> <5e86>\n<4553> <603b>\n<4554> <6589>\n<4555> <67fe>\n<4556> <6804>\n<4557> <6865>\n<4558> <6d4e>\n<4559> <70bc>\n<455a> <7535>\n<455b> <7ea4>\n<455c> <7eac>\n<455d> <7eba>\n<455e> <7ec7>\n<455f> <7ecf>\n<4560> <7edf>\n<4561> <7f06>\n<4562> <7f37>\n<4563> <827a>\n<4564> <82cf>\n<4565> <836f>\n<4566> <89c6>\n<4567> <8bbe>\n<4568> <8be2>\n<456b> <8f6e>\n<456c> <7411>\n<456d> <7cfc>\n<456e> <7dcd>\n<456f> <6946>\n<4570> <7ac9>\n<4571> <78b8>\n<4572> <80bc>\n<4573> <8d0b>\n<4574> <80f6>\n<4575> <d842dde7>\n<4576> <809f>\n<4577> <9ec7>\n<4578> <4ccd>\n<4579> <9dc9>\n<457a> <9e0c>\n<457b> <4c3e>\n<457c> <d867ddf6>\n<457d> <d85cdc0e>\n<457e> <9e0a>\n<457f> <d868dd33>\n<4580> <35c1>\n<4581> <6e9a>\nendbfchar\n\n100 beginbfchar\n<4582> <823e>\n<4583> <7519>\n<4584> <4911>\n<4585> <9a6c>\n<4586> <9a8f>\n<4587> <9f99>\n<4588> <7987>\n<4589> <d861dc6c>\n<458a> <d847ddca>\n<458b> <d841ddd0>\n<458c> <d84adee6>\n<458d> <4e24>\n<458e> <4e80>\n<458f> <4e87>\n<4590> <4ebf>\n<4591> <4eeb>\n<4592> <4f37>\n<4593> <344c>\n<4594> <4fbd>\n<4595> <3e48>\n<4596> <5003>\n<4597> <347d>\n<4598> <34a5>\n<4599> <5905>\n<459a> <51db>\n<459b> <51fc>\n<459c> <4e89>\n<459d> <5290>\n<459e> <5327>\n<459f> <35c7>\n<45a0> <53a9>\n<45a1> <3551>\n<45a2> <53b0>\n<45a3> <5423>\n<45a4> <356d>\n<45a5> <3572>\n<45a6> <3681>\n<45a7> <5493>\n<45a8> <54a3>\n<45a9> <54b4>\n<45aa> <54b9>\n<45ab> <54d0>\n<45ac> <54ef>\n<45ad> <5518>\n<45ae> <5523>\n<45af> <5528>\n<45b0> <3598>\n<45b1> <35a5>\n<45b2> <35bf>\n<45b3> <55d7>\n<45b4> <35c5>\n<45b5> <d85fdd84>\n<45b6> <4053>\n<45b7> <d844dcf4>\n<45b8> <d843dc0b>\n<45b9> <d85edcc8>\n<45ba> <d858dca5>\n<45bb> <d84bdd4c>\n<45bc> <d844dc77>\n<45bd> <d844dc6f>\n<45be> <d848dda1>\n<45bf> <d843dd96>\n<45c0> <40bb>\n<45c1> <d84bdcc9>\n<45c2> <5652>\n<45c3> <d843df31>\n<45c4> <d85adc1c>\n<45c5> <d844dccf>\n<45c6> <d84adc03>\n<45c7> <d84add39>\n<45c8> <35fb>\n<45c9> <d854dde3>\n<45ca> <d843de8c>\n<45cb> <d843df8d>\n<45cc> <d843deaa>\n<45cd> <3f93>\n<45ce> <d843df30>\n<45cf> <d843dd47>\n<45d0> <d844dd4f>\n<45d1> <d843de4c>\n<45d2> <d843deab>\n<45d3> <d842dfa9>\n<45d4> <d843dd48>\n<45d5> <d844dcc0>\n<45d6> <d844dd3d>\n<45d7> <3ff9>\n<45d8> <d849de96>\n<45d9> <6432>\n<45da> <d843dfad>\n<45db> <d84cdff4>\n<45de> <d84bdc55>\n<45df> <d843de98>\n<45e0> <d843df2e>\n<45e1> <d85adf50>\n<45e2> <54cc>\n<45e3> <82c4>\n<45e4> <55b9>\n<45e5> <d867dec3>\n<45e6> <9c26>\n<45e7> <9ab6>\nendbfchar\n\n100 beginbfchar\n<45e8> <d84bddee>\n<45e9> <80ec>\n<45ea> <5c1c>\n<45eb> <d859dd72>\n<45ec> <8134>\n<45ed> <3797>\n<45ee> <d860dcbd>\n<45ef> <91b6>\n<45f0> <d843defa>\n<45f1> <d843de0f>\n<45f2> <d843de77>\n<45f3> <d843defb>\n<45f4> <d853ddeb>\n<45f5> <3609>\n<45f6> <d843dcd6>\n<45f7> <56af>\n<45f8> <d849dfb5>\n<45f9> <d844dcc9>\n<45fa> <d843de10>\n<45fb> <d843de78>\n<45fc> <d844dc78>\n<45fd> <d844dd48>\n<45fe> <d860de07>\n<45ff> <d845dc55>\n<4600> <d843de79>\n<4601> <d853de50>\n<4602> <d84bdda4>\n<4603> <5a54>\n<4608> <579c>\n<4609> <d843de11>\n<460a> <d85dde94>\n<460b> <d860decd>\n<460c> <d843dfb5>\n<460d> <d843de7b>\n<460e> <d854dd7e>\n<460f> <3703>\n<4610> <d843dfb6>\n<4611> <d844dd80>\n<4612> <d854ded8>\n<4613> <d868debd>\n<4614> <d852ddda>\n<4615> <d846dc3a>\n<4616> <d850dd77>\n<4617> <d860de7c>\n<4618> <5899>\n<4619> <5268>\n<461a> <361a>\n<461b> <d855df3d>\n<461c> <7bb2>\n<461d> <5b68>\n<461e> <4800>\n<461f> <4b2c>\n<4620> <9f27>\n<4621> <49e7>\n<4622> <9c1f>\n<4623> <9b8d>\n<4624> <d856df74>\n<4625> <d84cdd3d>\n<4626> <55fb>\n<4627> <35f2>\n<4628> <5689>\n<4629> <5d3e>\n<462a> <5d48>\n<462b> <3dfc>\n<462c> <380f>\n<462d> <5da4>\n<462e> <5db9>\n<462f> <3820>\n<4630> <5f25>\n<4631> <5f83>\n<4632> <3908>\n<4633> <393f>\n<4634> <394d>\n<4635> <60d7>\n<4636> <613d>\n<4637> <5ce5>\n<4638> <3989>\n<4639> <61b7>\n<463a> <61cf>\n<463b> <39b8>\n<463c> <622c>\n<463d> <62e5>\n<463e> <39f8>\n<463f> <56b1>\n<4640> <3a03>\n<4641> <63e2>\n<4642> <63fb>\n<4643> <6407>\n<4644> <3a4b>\n<4645> <64c0>\n<4646> <9f9f>\n<4647> <3a97>\n<4648> <6586>\n<4649> <3abd>\n<464a> <65ff>\n<464b> <6653>\n<464c> <3af2>\n<464d> <6692>\n<464e> <3b22>\n<464f> <6716>\nendbfchar\n\n100 beginbfchar\n<4650> <3b42>\n<4651> <67a4>\n<4652> <3b58>\n<4653> <684a>\n<4654> <6884>\n<4655> <3b72>\n<4656> <3b71>\n<4657> <3b7b>\n<4658> <6909>\n<4659> <6943>\n<465a> <725c>\n<465b> <6964>\n<465c> <699f>\n<465d> <6985>\n<465e> <69d6>\n<465f> <3bdd>\n<4660> <6a65>\n<4661> <6a74>\n<4662> <6a71>\n<4663> <6a82>\n<4664> <3bec>\n<4665> <6a99>\n<4666> <3bf2>\n<4667> <6aab>\n<4668> <6ab5>\n<4669> <6ad4>\n<466a> <6af6>\n<466b> <6b81>\n<466c> <6bc1>\n<466d> <6bea>\n<466e> <6c75>\n<466f> <6caa>\n<4670> <3ccb>\n<4671> <6d02>\n<4672> <6d06>\n<4673> <6d26>\n<4674> <6d81>\n<4675> <3cef>\n<4676> <6da4>\n<4677> <6db1>\n<4678> <6e15>\n<4679> <6e18>\n<467a> <6e29>\n<467b> <6e86>\n<467c> <d862ddc0>\n<467d> <6ebb>\n<467e> <6ee2>\n<467f> <6eda>\n<4680> <9f7f>\n<4683> <6f24>\n<4684> <6f34>\n<4685> <3d46>\n<4686> <d84fdf41>\n<4687> <6f81>\n<4688> <6fbe>\n<4689> <3d6a>\n<468a> <3d75>\n<468b> <71b7>\n<468c> <5c99>\n<468d> <3d8a>\n<468e> <702c>\n<468f> <3d91>\n<4690> <7050>\n<4691> <7054>\n<4692> <706f>\n<4693> <707f>\n<4694> <d840df25>\n<4695> <43c1>\n<4696> <35f1>\n<4697> <d843ded8>\n<4698> <364e>\n<4699> <3dad>\n<469a> <d857dc65>\n<469b> <667d>\n<469c> <7c74>\n<469d> <748d>\n<469e> <7e92>\n<469f> <4503>\n<46a0> <d853dfb8>\n<46a1> <d842df0d>\n<46a2> <d85adf0a>\n<46a3> <347e>\n<46a4> <d84bdeef>\n<46a5> <d84fdcb5>\n<46a6> <d85bde99>\n<46a7> <8771>\n<46a8> <63c1>\n<46a9> <7777>\n<46aa> <898a>\n<46ab> <d84fdf8f>\n<46ac> <8b4c>\n<46ad> <d853dcc9>\n<46ae> <492a>\n<46af> <d868dc14>\n<46b0> <d861debc>\n<46b1> <d861dd01>\n<46b2> <3af0>\n<46b3> <708f>\n<46b4> <d849de7a>\n<46b5> <d85adda8>\nendbfchar\n\n100 beginbfchar\n<46b6> <d850de4b>\n<46b7> <6888>\n<46b8> <d848dd5b>\n<46b9> <9f62>\n<46ba> <93c6>\n<46bb> <d840df7f>\n<46bc> <9366>\n<46bd> <928f>\n<46be> <8614>\n<46bf> <d869dc5b>\n<46c0> <4190>\n<46c1> <678f>\n<46c2> <681e>\n<46c3> <3863>\n<46c4> <d852ddec>\n<46c5> <3b19>\n<46c6> <8496>\n<46c7> <d852dd62>\n<46c8> <39e2>\n<46c9> <8480>\n<46ca> <436e>\n<46cb> <9771>\n<46cc> <999b>\n<46cd> <492d>\n<46ce> <6f17>\n<46cf> <d85cdd09>\n<46d0> <70a6>\n<46d1> <d852de4f>\n<46d2> <7e65>\n<46d3> <5d2f>\n<46d4> <3df3>\n<46d5> <d852de5d>\n<46d6> <d845dfdf>\n<46d7> <7da4>\n<46d8> <8426>\n<46d9> <5485>\n<46da> <d84edefa>\n<46db> <d840de14>\n<46dc> <577e>\n<46dd> <d842dcd5>\n<46de> <d841de19>\n<46df> <3fe5>\n<46e0> <d847df9e>\n<46e1> <d868deb6>\n<46e2> <7003>\n<46e3> <d864dd5b>\n<46e4> <5d70>\n<46e5> <738f>\n<46e6> <d862de59>\n<46e7> <d865dc20>\n<46e8> <4fc8>\n<46e9> <7fe7>\n<46ea> <7310>\n<46eb> <7338>\n<46ec> <7341>\n<46ed> <3ea9>\n<46ee> <71f5>\n<46ef> <d852dcf2>\n<46f0> <73e1>\n<46f1> <3eca>\n<46f2> <3ed1>\n<46f3> <7419>\n<46f6> <3ee2>\n<46f7> <3ef0>\n<46f8> <3ef4>\n<46f9> <3efa>\n<46fa> <74d3>\n<46fb> <3f0e>\n<46fc> <3f53>\n<46fd> <756d>\n<46fe> <7572>\n<46ff> <758d>\n<4700> <3f7c>\n<4701> <75c8>\n<4702> <764d>\n<4703> <7674>\n<4704> <3fdc>\n<4705> <767a>\n<4706> <7188>\n<4707> <5623>\n<4708> <8980>\n<4709> <401d>\n<470a> <7743>\n<470b> <4039>\n<470c> <4045>\n<470d> <35db>\n<470e> <7798>\n<470f> <406a>\n<4710> <406f>\n<4711> <77be>\n<4712> <77cb>\n<4713> <7818>\n<4714> <781c>\n<4715> <7847>\n<4716> <7851>\n<4717> <7866>\n<4718> <8448>\n<4719> <d855dd35>\n<471a> <7933>\n<471b> <7932>\nendbfchar\n\n100 beginbfchar\n<471c> <4109>\n<471d> <7991>\n<471e> <7a06>\n<471f> <4167>\n<4720> <41b2>\n<4721> <7abc>\n<4722> <8279>\n<4723> <41c4>\n<4724> <7acf>\n<4725> <7adb>\n<4726> <41cf>\n<4727> <7b62>\n<4728> <7b6c>\n<4729> <7b7b>\n<472a> <7c12>\n<472b> <4260>\n<472c> <427a>\n<472d> <7c7b>\n<472e> <7c9c>\n<472f> <428c>\n<4730> <7cb8>\n<4731> <4294>\n<4732> <8f93>\n<4733> <70c0>\n<4734> <d843dccf>\n<4735> <7dcf>\n<4736> <7dd4>\n<4737> <7dd0>\n<4738> <7dfd>\n<4739> <7fb4>\n<473a> <729f>\n<473b> <4397>\n<473c> <8020>\n<473d> <8025>\n<473e> <802e>\n<473f> <8031>\n<4740> <8054>\n<4741> <57b4>\n<4742> <70a0>\n<4743> <80b7>\n<4744> <80e9>\n<4745> <43ed>\n<4746> <810c>\n<4747> <810e>\n<4748> <8112>\n<4749> <8114>\n<474a> <4401>\n<474b> <3b39>\n<474c> <8156>\n<474f> <4413>\n<4750> <817c>\n<4751> <4425>\n<4752> <442d>\n<4753> <81a5>\n<4754> <57ef>\n<4755> <81c1>\n<4756> <81e4>\n<4757> <8254>\n<4758> <448f>\n<4759> <8276>\n<475a> <82ca>\n<475b> <82d8>\n<475c> <44b0>\n<475d> <8357>\n<475e> <9669>\n<475f> <8405>\n<4760> <70f5>\n<4761> <8464>\n<4762> <8488>\n<4763> <4504>\n<4764> <84be>\n<4765> <84e1>\n<4766> <84f8>\n<4767> <8510>\n<4768> <8538>\n<4769> <8552>\n<476a> <453b>\n<476d> <85e0>\n<476e> <4577>\n<476f> <8672>\n<4770> <8692>\n<4771> <86ef>\n<4772> <9645>\n<4773> <4606>\n<4774> <4617>\n<4775> <88ae>\n<4776> <88ff>\n<4777> <8924>\n<4778> <8991>\n<4779> <d85edd67>\n<477a> <8a38>\n<477b> <8a94>\n<477c> <8ab4>\n<477d> <8c51>\n<477e> <8cd4>\n<477f> <8cf2>\n<4780> <8d1c>\n<4781> <4798>\n<4782> <8dc3>\n<4783> <47ed>\nendbfchar\n\n100 beginbfchar\n<4784> <8e3a>\n<4785> <5754>\n<4786> <55f5>\n<4787> <4837>\n<4788> <8ece>\n<4789> <8ee2>\n<478a> <8ee4>\n<478b> <8eed>\n<478c> <8ef2>\n<478d> <8fc1>\n<478e> <8fca>\n<478f> <8fcc>\n<4790> <9033>\n<4791> <48ad>\n<4792> <98e0>\n<4793> <9213>\n<4794> <491e>\n<4795> <9228>\n<4796> <9258>\n<4797> <926b>\n<4798> <92b1>\n<4799> <92ae>\n<479a> <92bf>\n<479b> <92e3>\n<479c> <92eb>\n<479f> <92fd>\n<47a0> <9343>\n<47a1> <9384>\n<47a2> <93ad>\n<47a3> <4945>\n<47a4> <4951>\n<47a5> <9417>\n<47a6> <941d>\n<47a7> <942d>\n<47a8> <943e>\n<47a9> <496a>\n<47aa> <9454>\n<47ab> <9479>\n<47ac> <952d>\n<47ad> <95a2>\n<47ae> <49a7>\n<47af> <95f4>\n<47b0> <9633>\n<47b1> <49e5>\n<47b2> <4a24>\n<47b3> <9740>\n<47b4> <4a35>\n<47b5> <97b2>\n<47b6> <97c2>\n<47b7> <4ae4>\n<47b8> <98b9>\n<47b9> <4b19>\n<47ba> <98f1>\n<47bb> <5844>\n<47bc> <9919>\n<47bd> <9937>\n<47be> <995d>\n<47bf> <9962>\n<47c0> <4b70>\n<47c1> <99c5>\n<47c2> <4b9d>\n<47c3> <9a3c>\n<47c4> <9b0f>\n<47c5> <9b69>\n<47c6> <9bdd>\n<47c7> <9bf1>\n<47c8> <9bf4>\n<47c9> <4c6d>\n<47ca> <9c20>\n<47cb> <376f>\n<47cc> <d846dfc2>\n<47cd> <9d49>\n<47ce> <9efe>\n<47cf> <5650>\n<47d0> <9dbd>\n<47d1> <9dfc>\n<47d2> <94f6>\n<47d3> <8fb6>\n<47d4> <9eb1>\n<47d5> <9ebd>\n<47d6> <9ec6>\n<47d7> <94dc>\n<47d8> <9ee2>\n<47d9> <9ef1>\n<47da> <9ef8>\n<47db> <9f44>\n<47dc> <d840dc94>\n<47dd> <d840deb7>\n<47de> <d840dfa0>\n<47df> <94c3>\n<47e0> <d841dcd7>\n<47e1> <94c1>\n<47e2> <d841ddd5>\n<47e3> <d841de15>\n<47e4> <d841de76>\n<47e5> <d845deba>\n<47e6> <5757>\n<47e7> <7173>\n<47e8> <d842dec2>\n<47e9> <d842decd>\nendbfchar\n\n100 beginbfchar\n<47ea> <d842dfbf>\n<47eb> <d87edc3b>\n<47ec> <d842dfcb>\n<47ed> <549e>\n<47ee> <d842dffb>\n<47ef> <d843dc3b>\n<47f0> <d843dc53>\n<47f1> <d843dc65>\n<47f2> <d843dc7c>\n<47f3> <d843dc8d>\n<47f4> <d843dcb5>\n<47f5> <d843dcdd>\n<47f6> <d843dced>\n<47f7> <d843dd6f>\n<47f8> <d843ddb2>\n<47f9> <d843ddc8>\n<47fa> <d843de04>\n<47fb> <d843de0e>\n<47fc> <d843ded7>\n<47fd> <d843df90>\n<47fe> <d843df2d>\n<47ff> <d843de73>\n<4800> <d843dfbc>\n<4801> <d844dc5c>\n<4802> <d844dc4f>\n<4803> <d844dc76>\n<4804> <d844dc88>\n<4805> <d844dc96>\n<4806> <3647>\n<4807> <d844dcbf>\n<4808> <d844dd2f>\n<4809> <d844dd3b>\n<480a> <5364>\n<480b> <d844dee3>\n<480c> <d844df75>\n<480d> <d844df36>\n<480e> <d845dd77>\n<480f> <d845de19>\n<4810> <d845dfc3>\n<4811> <d845dfc7>\n<4812> <70bb>\n<4813> <d846dc2d>\n<4814> <d846dd6a>\n<4815> <d846de2d>\n<4816> <d846de45>\n<4817> <d847dc2a>\n<4818> <d847dc70>\n<4819> <d847dcac>\n<481a> <d847dec8>\n<481b> <d847ded5>\n<481c> <d847df15>\n<481d> <7198>\n<481e> <d848dc45>\n<481f> <69e9>\n<4820> <36c8>\n<4821> <d848de7c>\n<4822> <d848dfd7>\n<4823> <d848dffa>\n<4824> <d849df2a>\n<4825> <d84adc71>\n<4826> <d84add4f>\n<4827> <d84add67>\n<4828> <d84add93>\n<4829> <d84aded5>\n<482a> <d84adee8>\n<482b> <d84adf0e>\n<482c> <d84adf3f>\n<482d> <d84bdc4c>\n<482e> <d84bdc88>\n<482f> <d84bdcb7>\n<4830> <d856dfe8>\n<4831> <d84bdd08>\n<4832> <d84bdd12>\n<4833> <d84bddb7>\n<4834> <d84bdd95>\n<4835> <d84bde42>\n<4836> <d84bdf74>\n<4837> <d84bdfcc>\n<4838> <d84cdc33>\n<4839> <d84cdc66>\n<483a> <d84cdf1f>\n<483b> <d84cdfde>\n<483c> <d84ddd67>\n<483d> <d84dddf3>\n<483e> <d84dde1a>\n<483f> <d84ddf16>\n<4840> <58b5>\n<4841> <d84edea7>\n<4842> <d84fde11>\n<4843> <d84fdeb9>\n<4844> <d850dd19>\n<4845> <d850deee>\n<4846> <d850df0d>\n<4847> <d850df34>\n<4848> <d850df96>\n<4849> <d851dc04>\n<484a> <d851dcd6>\n<484b> <5788>\n<484c> <d851de74>\n<484d> <d851df2f>\nendbfchar\n\n100 beginbfchar\n<484e> <d852dc12>\n<484f> <d852dcfb>\n<4850> <d852de15>\n<4851> <d852dec0>\n<4852> <5965>\n<4853> <d853df86>\n<4854> <d854dc2c>\n<4855> <573f>\n<4856> <d854de99>\n<4857> <d855dc19>\n<4858> <d855dc46>\n<4859> <d855dc6e>\n<485a> <d855dd3f>\n<485b> <d855dd5e>\n<485c> <d855dd62>\n<485d> <d855dd66>\n<485e> <d855dfc7>\n<485f> <d856dc5d>\n<4860> <d856dd03>\n<4861> <d856deae>\n<4862> <d856df89>\n<4863> <d857dc06>\n<4864> <57a1>\n<4865> <7151>\n<4866> <d858dd02>\n<4867> <d858ddb2>\n<4868> <d859dc02>\n<4869> <d859dc4a>\n<486a> <d859dc84>\n<486b> <d859dc88>\n<486c> <d859dd12>\n<486d> <d859ddbf>\n<486e> <d859deb5>\n<486f> <56b9>\n<4870> <d859defc>\n<4871> <3618>\n<4872> <d859df99>\n<4873> <d85adc6e>\n<4874> <d85adc5e>\n<4875> <d85adcc7>\n<4876> <d85add26>\n<4877> <d85add39>\n<4878> <d85addfa>\n<4879> <d85ade2d>\n<487a> <d85ade34>\n<487b> <d85adf5b>\n<487c> <d85adf9d>\n<487d> <d85bdca4>\n<487e> <d85bddae>\n<487f> <d85cdc4b>\n<4880> <d85cddcd>\n<4881> <d85cde80>\n<4882> <d85cde85>\n<4883> <d85cde8b>\n<4884> <d85cdee6>\n<4885> <949f>\n<4886> <d85ddc50>\n<4887> <36b9>\n<4888> <d85ddfcc>\n<4889> <d85edc58>\n<488a> <56d6>\n<488b> <d85edddd>\n<488c> <d85eddfd>\n<488d> <d85ede0a>\n<488e> <d85edf0b>\n<488f> <d85fdd66>\n<4890> <d860dc09>\n<4891> <d860dc23>\n<4892> <d860dc48>\n<4893> <d860dc83>\n<4894> <d860dc90>\n<4895> <d860dcf4>\n<4896> <d860dd2e>\n<4897> <d860dd4f>\n<4898> <d860ddaf>\n<4899> <d860de1a>\n<489a> <d860df06>\n<489b> <d860df2f>\n<489c> <d860df8a>\n<489d> <d861dc68>\n<489e> <d861deaa>\n<489f> <63e6>\n<48a0> <d862dd56>\n<48a1> <d862ddb8>\n<48a4> <d862df46>\n<48a5> <d862dfd4>\n<48a6> <d863dc09>\n<48a7> <d863dfc5>\n<48a8> <d864dcec>\n<48a9> <d864dd10>\n<48aa> <d864dd3c>\n<48ab> <3df7>\n<48ac> <d864dd5e>\n<48ad> <d852deca>\n<48ae> <8fd0>\n<48af> <d865dce7>\n<48b0> <d865ddb0>\n<48b1> <d865ddb8>\n<48b2> <d865df32>\n<48b3> <d866dcd1>\nendbfchar\n\n100 beginbfchar\n<48b4> <d866dd49>\n<48b5> <d866dd6a>\n<48b6> <d866ddc3>\n<48b7> <d866de28>\n<48b8> <d866df0e>\n<48b9> <d867dd5a>\n<48ba> <d867dd9b>\n<48bb> <7e9f>\n<48bc> <d867def8>\n<48bd> <d867df23>\n<48be> <4ca4>\n<48bf> <9547>\n<48c0> <d868de93>\n<48c1> <71a2>\n<48c2> <d868deff>\n<48c3> <d869ddcb>\n<48c4> <4d9c>\n<48c5> <d843dc9c>\n<48c6> <8fbe>\n<48c7> <8fba>\n<48c8> <d849dcb0>\n<48c9> <8fb9>\n<48ca> <d852de93>\n<48cb> <4eea>\n<48cc> <d862df2c>\n<48cd> <8e80>\n<48ce> <d845dff5>\n<48cf> <d862df6c>\n<48d0> <d862df99>\n<48d1> <d859deaf>\n<48d2> <d85dde55>\n<48d3> <d855de35>\n<48d4> <d856dd56>\n<48d5> <4e9a>\n<48d6> <d857de81>\n<48d7> <d843de6d>\n<48d8> <d84fde88>\n<48d9> <d853dc9e>\n<48da> <d845dff6>\n<48db> <d846dc7b>\n<48dc> <d857dc4a>\n<48dd> <d854df11>\n<48de> <3dc6>\n<48df> <d857ded8>\n<48e0> <4e1c>\n<48e1> <d843dfea>\n<48e2> <d843dd49>\n<48e3> <d84ddeba>\n<48e4> <d854dd48>\n<48e5> <55de>\n<48e6> <8786>\n<48e7> <d844dcc1>\n<48e8> <d851df06>\n<48e9> <5b90>\n<48ea> <d85adc93>\n<48eb> <d849def4>\n<48ec> <d85fdd2f>\n<48ed> <d850dda3>\n<48ee> <d85fdd73>\n<48ef> <d85bded0>\n<48f0> <d85cdeb6>\n<48f1> <d844ddd9>\n<48f2> <d84fdcfc>\n<48f3> <d869dea9>\n<48f4> <d843deac>\n<48f5> <d847dca2>\n<48f6> <d853dfc2>\n<48f7> <d843dfeb>\n<48f8> <d84bdda0>\n<48f9> <d843dfec>\n<48fa> <d843de0a>\n<48fb> <d843dfed>\n<48fc> <d844dd87>\n<48fd> <4e1a>\n<48fe> <4e04>\n<48ff> <5b0d>\n<4900> <36ac>\n<4901> <537d>\n<4902> <36a5>\n<4903> <589a>\n<4904> <d852df6e>\n<4905> <57aa>\n<4906> <d856de95>\n<4907> <d842dd79>\n<4908> <d849dc65>\n<4909> <d84fdcfe>\n<490a> <d867df30>\n<490b> <d853dfa9>\n<490c> <d865dd9e>\n<490d> <d84fddb6>\n<490e> <d859dfb3>\n<490f> <d84ddf20>\n<4910> <d84fdef7>\n<4911> <d84fde2c>\n<4912> <d84cdcda>\n<4913> <d844dea9>\n<4914> <57a7>\n<4915> <d852dd63>\n<4916> <d85cdcae>\n<4917> <d845df6c>\nendbfchar\n\n100 beginbfchar\n<4918> <d85cdd64>\n<4919> <d85bdd22>\n<491a> <d852dee2>\n<491b> <9c1b>\n<491c> <d852dd3e>\n<491d> <3e06>\n<491e> <d85bdd23>\n<491f> <d840dffc>\n<4920> <d84fdcfd>\n<4921> <d852dd19>\n<4922> <577a>\n<4923> <54da>\n<4924> <717a>\n<4925> <d852de77>\n<4926> <d862de5a>\n<4927> <d87edc40>\n<4928> <d846dc3b>\n<4929> <d858dd59>\n<492a> <d84cdff5>\n<492b> <d862dfc2>\n<492c> <d847dd46>\n<492d> <d85bded1>\n<492e> <3635>\n<492f> <d862df2d>\n<4930> <5220>\n<4931> <3c18>\n<4932> <d84fdcc7>\n<4933> <d857ded7>\n<4934> <d85dde56>\n<4935> <d855dd31>\n<4936> <d846dd44>\n<4937> <d866dd03>\n<4938> <d85bdddc>\n<4939> <d85cdcad>\n<493a> <d858ddad>\n<493b> <d862de0f>\n<493c> <d84dde77>\n<493d> <d840dcee>\n<493e> <d85adc46>\n<493f> <d853df0e>\n<4940> <4562>\n<4941> <5b1f>\n<4942> <d858df4c>\n<4943> <9f50>\n<4944> <9ea6>\n<4945> <d858de6b>\n<4946> <51e2>\n<4947> <5342>\n<4948> <66ad>\n<4949> <585c>\n<494a> <5553>\n<494b> <3d85>\n<494c> <6160>\n<494d> <48ae>\n<494e> <97bd>\n<494f> <d846dc77>\n<4950> <60b3>\n<4951> <8424>\n<4952> <9814>\n<4953> <d850dc8c>\n<4954> <d84cdc7e>\n<4955> <d847de3d>\n<4956> <3b2b>\n<4957> <3d32>\n<4958> <d840dfb5>\n<4959> <7081>\n<495a> <5c9c>\n<495b> <d841ddc3>\n<495c> <3730>\n<495d> <d844df76>\n<495e> <d852de12>\n<495f> <d862df2b>\n<4960> <d858dc83>\n<4961> <0100>\n<4962> <00c1>\n<4963> <01cd>\n<4964> <00c0>\n<4965> <0112>\n<4966> <00c9>\n<4967> <011a>\n<4968> <00c8>\n<4969> <014c>\n<496a> <00d3>\n<496b> <01d1>\n<496c> <00d2>\n<496d> <f325>\n<496e> <1ebe>\n<496f> <f327>\n<4970> <1ec0>\n<4971> <00ca>\n<4972> <0101>\n<4973> <00e1>\n<4974> <01ce>\n<4975> <00e0>\n<4976> <0251>\n<4977> <0113>\n<4978> <00e9>\n<4979> <011b>\n<497a> <00e8>\n<497b> <012b>\nendbfchar\n\n100 beginbfchar\n<497c> <00ed>\n<497d> <01d0>\n<497e> <00ec>\n<497f> <014d>\n<4980> <00f3>\n<4981> <01d2>\n<4982> <00f2>\n<4983> <016b>\n<4984> <00fa>\n<4985> <01d4>\n<4986> <00f9>\n<4987> <01d6>\n<4988> <01d8>\n<4989> <01da>\n<498a> <01dc>\n<498b> <00fc>\n<498c> <f344>\n<498d> <1ebf>\n<498e> <f346>\n<498f> <1ec1>\n<4990> <00ea>\n<4991> <0261>\n<4992> <0283>\n<4993> <0250>\n<4994> <025b>\n<4995> <0254>\n<4996> <0275>\n<4997> <0153>\n<4998> <00f8>\n<4999> <014b>\n<499a> <028a>\n<499b> <026a>\n<499e> <2e9d>\n<499f> <2ec6>\n<49a0> <2ee3>\n<49a1> <503b>\n<49a2> <6dfe>\n<49a3> <d867dc73>\n<49a4> <9fa6>\n<49a5> <3dc9>\n<49a6> <888f>\n<49a7> <d850dd4e>\n<49a8> <7077>\n<49a9> <5cf5>\n<49aa> <4b20>\n<49ab> <d854ddcd>\n<49ac> <3559>\n<49ad> <d857dd30>\n<49ae> <6122>\n<49af> <d862de32>\n<49b0> <8fa7>\n<49b1> <91f6>\n<49b2> <7191>\n<49b3> <6719>\n<49b4> <73ba>\n<49b5> <d84cde81>\n<49b6> <d868dd07>\n<49b7> <3c8b>\n<49b8> <d846dd80>\n<49b9> <4b10>\n<49ba> <78e4>\n<49bb> <7402>\n<49bc> <51ae>\n<49bd> <d861df0f>\n<49be> <4009>\n<49bf> <6a63>\n<49c0> <d868deba>\n<49c1> <4223>\n<49c2> <860f>\n<49c3> <7a2a>\n<49c4> <d866dd47>\n<49c5> <d862deea>\n<49c6> <9755>\n<49c7> <704d>\n<49c8> <5324>\n<49c9> <d848dc7e>\n<49ca> <93f4>\n<49cb> <76d9>\n<49cc> <d862dde3>\n<49cd> <9fa7>\n<49ce> <77dd>\n<49cf> <4ea3>\n<49d0> <4ff0>\n<49d1> <50bc>\n<49d2> <4e2f>\n<49d3> <4f17>\n<49d4> <9fa8>\n<49d5> <5434>\n<49d6> <7d8b>\n<49d7> <5892>\n<49d8> <58d0>\n<49d9> <d847ddb6>\n<49da> <5e92>\n<49db> <5e99>\n<49dc> <5fc2>\n<49dd> <d849df12>\n<49de> <658b>\n<49df> <d84cdff9>\n<49e0> <6919>\n<49e1> <6a43>\nendbfchar\n\n100 beginbfchar\n<49e2> <d84fdc63>\n<49e3> <6cff>\n<49e4> <7200>\n<49e5> <d851dd05>\n<49e6> <738c>\n<49e7> <3edb>\n<49e8> <d852de13>\n<49e9> <5b15>\n<49ea> <74b9>\n<49eb> <8b83>\n<49ec> <d857dca4>\n<49ed> <d855de95>\n<49ee> <7a93>\n<49ef> <7bec>\n<49f0> <7cc3>\n<49f1> <7e6c>\n<49f2> <82f8>\n<49f3> <8597>\n<49f4> <9fa9>\n<49f5> <8890>\n<49f6> <9faa>\n<49f7> <8eb9>\n<49f8> <9fab>\n<49f9> <8fcf>\n<49fa> <855f>\n<49fb> <99e0>\n<49fc> <9221>\n<49fd> <9fac>\n<49fe> <d863ddb9>\n<49ff> <d845dc3f>\n<4a00> <4071>\n<4a01> <42a2>\n<4a02> <5a1a>\n<4a03> <9868>\n<4a04> <676b>\n<4a05> <4276>\n<4a06> <573d>\n<4a07> <85d6>\n<4a08> <d852dd7b>\n<4a09> <82bf>\n<4a0a> <d85cdd0d>\n<4a0b> <4c81>\n<4a0c> <d85bdd74>\n<4a0d> <5d7b>\n<4a0e> <d85adf15>\n<4a0f> <d85bdfbe>\n<4a12> <5b96>\n<4a13> <9faf>\n<4a14> <7e5b>\n<4a15> <43f0>\n<4a16> <4c32>\n<4a17> <4603>\n<4a18> <45a6>\n<4a19> <4578>\n<4a1a> <d85cde67>\n<4a1b> <4d77>\n<4a1c> <45b3>\n<4a1d> <d85fdcb1>\n<4a1e> <4ce2>\n<4a1f> <d85fdcc5>\n<4a20> <3b95>\n<4a21> <4736>\n<4a22> <4744>\n<4a23> <4c47>\n<4a24> <4c40>\n<4a25> <d850debf>\n<4a26> <d84dde17>\n<4a27> <d85cdf52>\n<4a28> <d85bde8b>\n<4a29> <d85cdcd2>\n<4a2a> <4c57>\n<4a2b> <d868df51>\n<4a2c> <474f>\n<4a2d> <45da>\n<4a2e> <4c85>\n<4a2f> <d85fdc6c>\n<4a30> <4d07>\n<4a31> <4aa4>\n<4a32> <46a1>\n<4a33> <d85adf23>\n<4a34> <7225>\n<4a35> <d856de54>\n<4a36> <d846de63>\n<4a37> <d84fde06>\n<4a38> <d84fdf61>\n<4a39> <664d>\n<4a3a> <56fb>\n<4a3b> <7d95>\n<4a3c> <591d>\n<4a3d> <d862dfb9>\n<4a3e> <3df4>\n<4a3f> <9734>\n<4a40> <d85edfef>\n<4a41> <5bdb>\n<4a42> <d847dd5e>\n<4a43> <5aa4>\n<4a44> <3625>\n<4a45> <d867deb0>\n<4a46> <5ad1>\n<4a47> <5bb7>\nendbfchar\n\n72 beginbfchar\n<4a48> <5cfc>\n<4a49> <676e>\n<4a4a> <8593>\n<4a4b> <d866dd45>\n<4a4c> <7461>\n<4a4d> <749d>\n<4a4e> <d842de6f>\n<4a4f> <66e7>\n<4a50> <6e57>\n<4a51> <79ca>\n<4a52> <3d88>\n<4a53> <44c3>\n<4a54> <d84cde56>\n<4a55> <d849df96>\n<4a56> <439a>\n<4a57> <4536>\n<4a58> <5cd5>\n<4a59> <d84edf1a>\n<4a5a> <8af9>\n<4a5b> <5c78>\n<4a5c> <3d12>\n<4a5d> <d84ddd51>\n<4a5e> <5d78>\n<4a5f> <9fb2>\n<4a60> <7157>\n<4a61> <4558>\n<4a62> <d850dcec>\n<4a63> <d847de23>\n<4a64> <4c77>\n<4a65> <3978>\n<4a66> <344a>\n<4a67> <d840dda4>\n<4a68> <d85bdc41>\n<4a69> <8acc>\n<4a6a> <4fb4>\n<4a6b> <d840de39>\n<4a6c> <59bf>\n<4a6d> <816c>\n<4a6e> <9856>\n<4a6f> <d866dcfa>\n<4a70> <5f3b>\n<4a71> <d842df9f>\n<4a72> <d848ddc1>\n<4a73> <d862dd6d>\n<4a74> <4102>\n<4a75> <46bb>\n<4a76> <d864dc79>\n<4a77> <3f07>\n<4a78> <9fb3>\n<4a79> <d868ddb5>\n<4a7a> <40f8>\n<4a7b> <37d6>\n<4a7c> <46f7>\n<4a7d> <d85bdc46>\n<4a7e> <417c>\n<4a7f> <d861deb2>\n<4a80> <d85cdfff>\n<4a81> <456d>\n<4a82> <38d4>\n<4a83> <d855dc9a>\n<4a84> <4561>\n<4a85> <451b>\n<4a86> <4d89>\n<4a87> <4c7b>\n<4a88> <4d76>\n<4a89> <45ea>\n<4a8a> <3fc8>\n<4a8b> <d852df0f>\n<4a8c> <3661>\n<4a8d> <44de>\n<4a8e> <44bd>\n<4a8f> <41ed>\nendbfchar\n\n100 beginbfrange\n<0001> <005f> <0020>\n<0065> <0066> <3001>\n<0070> <0072> <fe50>\n<0074> <0077> <fe54>\n<0080> <0081> <ff08>\n<0082> <0083> <fe35>\n<0086> <0087> <fe37>\n<0088> <0089> <3014>\n<008a> <008b> <fe39>\n<008c> <008d> <3010>\n<008e> <008f> <fe3b>\n<0090> <0091> <300a>\n<0092> <0093> <fe3d>\n<0094> <0095> <3008>\n<0096> <0097> <fe3f>\n<0098> <0099> <300c>\n<009a> <009b> <fe41>\n<009c> <009d> <300e>\n<009e> <009f> <fe43>\n<00a0> <00a5> <fe59>\n<00a6> <00a7> <2018>\n<00a8> <00a9> <201c>\n<00aa> <00ab> <301d>\n<00c7> <00c8> <fe49>\n<00c9> <00ca> <fe4d>\n<00cb> <00cc> <fe4b>\n<00cd> <00cf> <fe5f>\n<00d9> <00da> <2266>\n<00df> <00e3> <fe62>\n<00e5> <00e6> <2229>\n<00f9> <00fa> <2196>\n<0106> <0107> <00a2>\n<010c> <010e> <fe69>\n<0110> <0112> <339c>\n<0115> <0116> <338e>\n<0122> <0129> <2581>\n<013e> <013f> <256d>\n<0146> <0147> <25e2>\n<014a> <014c> <2571>\n<014d> <0156> <ff10>\n<0157> <0160> <2160>\n<0161> <0169> <3021>\n<016d> <0186> <ff21>\n<0187> <01a0> <ff41>\n<01a1> <01b1> <0391>\n<01b2> <01b8> <03a3>\n<01b9> <01c9> <03b1>\n<01ca> <01d0> <03c3>\n<01d1> <01f5> <3105>\n<01fa> <01ff> <2460>\n<0200> <0203> <2466>\n<0204> <020d> <2474>\n<020e> <0217> <2170>\n<0232> <0251> <2400>\n<0260> <0261> <5200>\n<027f> <0280> <5b50>\n<0289> <028b> <5df1>\n<02a3> <02a4> <4ec6>\n<02a6> <02a7> <4eca>\n<02ac> <02ad> <516d>\n<02b1> <02b3> <5206>\n<02b5> <02b6> <52fe>\n<02ce> <02cf> <5f14>\n<02fa> <02fd> <4ed4>\n<02fe> <02ff> <4ee3>\n<0304> <0305> <5189>\n<0307> <0308> <51f9>\n<030d> <030e> <5305>\n<0339> <033a> <5e02>\n<0342> <0343> <6253>\n<034a> <034b> <672a>\n<035c> <035d> <7528>\n<035e> <0361> <7530>\n<036e> <036f> <4e1e>\n<0370> <0371> <4e52>\n<037d> <037e> <4f10>\n<0391> <0392> <5211>\n<0399> <039a> <5370>\n<03b4> <03b5> <5919>\n<03b6> <03b7> <5937>\n<03bf> <03c0> <5b57>\n<03c1> <03c2> <5b87>\n<03d1> <03d2> <620c>\n<03da> <03db> <65ec>\n<03dc> <03dd> <66f2>\n<03ea> <03eb> <6c5f>\n<03f0> <03f1> <6c4d>\n<0403> <0404> <808b>\n<0420> <0421> <4f50>\n<0437> <0438> <51b6>\n<043b> <043c> <5229>\n<043f> <0440> <52a9>\n<0458> <0459> <5435>\n<047f> <0480> <5b5a>\n<0485> <0486> <5c40>\n<0489> <048a> <5c90>\n<04bd> <04c0> <674e>\n<04cf> <04d0> <6c88>\n<04e7> <04e8> <707c>\n<04f2> <04f3> <7537>\nendbfrange\n\n100 beginbfrange\n<052e> <052f> <4eab>\n<055c> <055e> <5377>\n<0583> <0584> <5947>\n<05a2> <05a3> <5c45>\n<05b5> <05b6> <5e95>\n<05b8> <05b9> <5f26>\n<05bb> <05bc> <5f80>\n<05df> <05e0> <62d3>\n<05ee> <05ef> <62d6>\n<060e> <060f> <676f>\n<061b> <061c> <6b66>\n<0627> <0628> <6cbd>\n<0645> <0646> <722c>\n<0657> <0658> <7599>\n<0660> <0661> <7940>\n<06a4> <06a5> <4ead>\n<0707> <0708> <5c4e>\n<071a> <071b> <5f8a>\n<077b> <077c> <6d3d>\n<0796> <0797> <72e0>\n<07a6> <07a7> <75a4>\n<07a8> <07a9> <75a2>\n<07ab> <07ad> <7686>\n<07bd> <07be> <780c>\n<07c3> <07c4> <79b9>\n<07c5> <07c6> <79d1>\n<07de> <07df> <80c3>\n<0808> <0809> <8a02>\n<0823> <0825> <964b>\n<0833> <0834> <500c>\n<0853> <0854> <51a4>\n<0879> <087a> <5703>\n<0881> <0882> <5957>\n<08d1> <08d2> <632a>\n<08d6> <08d7> <6548>\n<08e4> <08e5> <6714>\n<0903> <0904> <6c27>\n<0939> <093a> <75b2>\n<0943> <0944> <76cd>\n<0946> <0947> <771f>\n<0998> <0999> <822a>\n<09ba> <09bb> <8881>\n<09cc> <09cd> <8ca1>\n<09eb> <09ec> <9662>\n<0a1b> <0a1c> <533f>\n<0a5c> <0a5d> <5c5c>\n<0a70> <0a71> <5eb7>\n<0a97> <0a98> <621a>\n<0ac5> <0ac6> <65cb>\n<0ae9> <0aea> <6beb>\n<0b13> <0b14> <7109>\n<0b27> <0b28> <74f6>\n<0b2b> <0b2c> <7565>\n<0b30> <0b31> <75d4>\n<0b84> <0b85> <837b>\n<0bd7> <0bd8> <9676>\n<0bdf> <0be0> <9802>\n<0bf3> <0bf4> <5274>\n<0c1b> <0c1c> <5830>\n<0c20> <0c21> <58f9>\n<0c2f> <0c30> <5c0a>\n<0c3d> <0c3e> <5ec1>\n<0c42> <0c43> <5fa9>\n<0c67> <0c68> <63ed>\n<0c72> <0c73> <6562>\n<0c80> <0c81> <66fe>\n<0ca2> <0ca3> <6c2e>\n<0cc8> <0cc9> <7119>\n<0cdc> <0cdd> <7435>\n<0ce3> <0ce4> <7525>\n<0cee> <0cef> <767b>\n<0d1c> <0d1d> <7fd4>\n<0d52> <0d53> <88c1>\n<0d8f> <0d90> <9214>\n<0da3> <0da4> <9685>\n<0dab> <0dac> <96c6>\n<0db0> <0db1> <9805>\n<0dc1> <0dc2> <50b2>\n<0dd0> <0dd1> <52e2>\n<0ddb> <0ddc> <55e3>\n<0de0> <0de1> <55c5>\n<0de4> <0de5> <5712>\n<0e1a> <0e1b> <6221>\n<0e28> <0e29> <6416>\n<0e30> <0e31> <6687>\n<0e83> <0e84> <745b>\n<0e90> <0e91> <76de>\n<0ea1> <0ea2> <7897>\n<0eb4> <0eb5> <7a9f>\n<0ec5> <0ec6> <7f69>\n<0ed6> <0ed7> <8179>\n<0ef6> <0ef7> <8702>\n<0f08> <0f09> <8a72>\n<0f1f> <0f20> <8cc7>\n<0f5e> <0f5f> <9694>\n<0f62> <0f63> <96c9>\n<0f6b> <0f6c> <9810>\n<0f73> <0f74> <98fd>\n<0f98> <0f99> <560d>\n<0fbb> <0fbc> <5be5>\nendbfrange\n\n100 beginbfrange\n<0fd4> <0fd5> <6162>\n<1044> <1045> <798e>\n<1059> <105a> <7cbd>\n<105e> <105f> <7dbd>\n<106f> <1070> <7fe0>\n<10b8> <10b9> <8cd1>\n<10e0> <10e1> <95a8>\n<10ee> <10ef> <9817>\n<10f7> <10f8> <9aaf>\n<10fa> <10fb> <9b41>\n<1108> <1109> <5108>\n<110c> <110e> <5287>\n<111f> <1120> <562f>\n<1134> <1135> <5c64>\n<116f> <1170> <6577>\n<1187> <1188> <6bc5>\n<11b1> <11b2> <7621>\n<11cf> <11d0> <7bc6>\n<11ea> <11ec> <819b>\n<11f4> <11f5> <852c>\n<120e> <120f> <8912>\n<122a> <122b> <8cec>\n<122c> <122d> <8ce2>\n<1263> <1264> <9706>\n<127b> <127c> <9aee>\n<12bb> <12bc> <64bb>\n<12f7> <12f8> <71c3>\n<1300> <1301> <750c>\n<1308> <1309> <779e>\n<1310> <1311> <7a4d>\n<131e> <131f> <7cd5>\n<132b> <132c> <7ff0>\n<1334> <1335> <8258>\n<1339> <133a> <8568>\n<1356> <1357> <8b01>\n<1386> <1387> <96a7>\n<1390> <1391> <975b>\n<13e1> <13e2> <6582>\n<13f6> <13f7> <6fdf>\n<1449> <144a> <8071>\n<1495> <1496> <9081>\n<14aa> <14ac> <95ca>\n<14c4> <14c5> <9edc>\n<14d6> <14d7> <64fa>\n<14e2> <14e3> <6aae>\n<14ee> <14ef> <71fb>\n<14fc> <14fd> <77bb>\n<1500> <1501> <7a61>\n<1503> <1504> <7ac4>\n<150c> <150d> <7e54>\n<153c> <153d> <91ab>\n<155e> <155f> <993e>\n<1578> <1579> <58de>\n<15a3> <15a4> <7c3e>\n<15ac> <15ad> <7e69>\n<15b8> <15b9> <85e4>\n<15c9> <15ca> <8b4e>\n<15d9> <15da> <908a>\n<15e2> <15e3> <93dc>\n<162d> <162e> <7cef>\n<163f> <1640> <8814>\n<1668> <1669> <5137>\n<16a1> <16a2> <9738>\n<16b9> <16ba> <9f66>\n<16d9> <16da> <8d16>\n<16e0> <16e1> <9451>\n<16e2> <16e3> <973d>\n<1713> <1714> <9a5a>\n<1716> <1717> <9ad3>\n<1723> <1724> <7671>\n<173b> <173c> <9df9>\n<173d> <173e> <9e7c>\n<175d> <175e> <947d>\n<1760> <1761> <9c77>\n<179a> <179b> <5722>\n<17e0> <17e1> <5c7a>\n<1808> <1809> <6c4b>\n<180c> <180d> <72b4>\n<181b> <181c> <9097>\n<1838> <1839> <52ad>\n<183d> <183e> <538e>\n<1890> <1891> <628e>\n<18ae> <18af> <6c19>\n<18cf> <18d0> <7393>\n<18d4> <18d5> <7594>\n<18e5> <18e6> <8283>\n<1914> <1915> <5232>\n<1919> <191a> <530a>\n<193f> <1940> <5773>\n<1973> <1975> <5f22>\n<19c6> <19c7> <6778>\n<1a0f> <1a10> <753f>\n<1a46> <1a47> <866d>\n<1a82> <1a83> <54c5>\n<1a8d> <1a8e> <579e>\n<1ac1> <1ac2> <5cd3>\n<1aca> <1acc> <5e21>\n<1aec> <1aed> <6242>\n<1afb> <1afc> <6313>\n<1b13> <1b14> <670f>\nendbfrange\n\n100 beginbfrange\n<1b38> <1b39> <67c9>\n<1b44> <1b45> <6c20>\n<1b6b> <1b6c> <70b4>\n<1b6f> <1b70> <7249>\n<1b91> <1b92> <7547>\n<1b98> <1b9a> <7703>\n<1b9f> <1ba0> <77e7>\n<1ba2> <1ba3> <7811>\n<1bb8> <1bb9> <7b00>\n<1bbb> <1bbc> <7c78>\n<1bbd> <1bbf> <7c7f>\n<1bc8> <1bc9> <800e>\n<1c28> <1c29> <4ff6>\n<1c36> <1c37> <51c4>\n<1c3d> <1c3e> <525e>\n<1c55> <1c56> <54f7>\n<1c5b> <1c5c> <5701>\n<1c70> <1c71> <5a2d>\n<1ca6> <1ca7> <6344>\n<1cc1> <1cc2> <65c3>\n<1cc8> <1cc9> <6712>\n<1ccd> <1cce> <6832>\n<1cf6> <1cf7> <6d63>\n<1d27> <1d29> <70c5>\n<1d47> <1d48> <73d7>\n<1d4a> <1d4b> <74de>\n<1d4c> <1d4d> <74f4>\n<1d63> <1d64> <7719>\n<1d7b> <1d7c> <79eb>\n<1d87> <1d88> <7a8b>\n<1dfa> <1dfb> <8843>\n<1dfd> <1dfe> <8875>\n<1e1f> <1e20> <90d9>\n<1e2a> <1e2b> <914e>\n<1e4a> <1e4b> <5063>\n<1e5b> <1e5c> <5575>\n<1ed1> <1ed2> <5eb2>\n<1ede> <1edf> <60d3>\n<1f19> <1f1a> <686d>\n<1f3d> <1f3e> <6b37>\n<1f41> <1f42> <6b8d>\n<1f57> <1f58> <6ddc>\n<1f81> <1f82> <727b>\n<1fa3> <1fa4> <75cb>\n<1fad> <1fae> <7731>\n<1fc0> <1fc1> <7969>\n<1fc8> <1fc9> <79f6>\n<1fee> <1fef> <7d3e>\n<1ff5> <1ff6> <7f9c>\n<1ff8> <1ff9> <7fca>\n<1ffb> <1ffc> <7fd0>\n<204a> <204b> <86bb>\n<204d> <204e> <86bd>\n<206d> <206e> <8c5c>\n<207e> <207f> <8ee0>\n<208a> <208b> <90f2>\n<208d> <208e> <90eb>\n<209c> <209d> <91ea>\n<2174> <2175> <659d>\n<21a7> <21a8> <68dd>\n<21bc> <21bd> <6bf2>\n<21c0> <21c1> <6e46>\n<21c5> <21c6> <6e3c>\n<21ec> <21ed> <6e35>\n<222f> <2230> <7746>\n<2236> <2237> <774b>\n<223b> <223c> <7864>\n<2271> <2272> <7f3e>\n<2273> <2274> <7f65>\n<2276> <2277> <7fa0>\n<227a> <227b> <804f>\n<2288> <228a> <81f7>\n<228c> <228d> <823c>\n<22e7> <22e8> <89da>\n<22ee> <22ef> <8a57>\n<22f0> <22f1> <8a44>\n<2317> <2318> <8ee7>\n<2350> <2351> <9688>\n<2361> <2362> <4e83>\n<2378> <2379> <527b>\n<23b8> <23b9> <5bd8>\n<23d5> <23d6> <6149>\n<23f5> <23f6> <6422>\n<2424> <2425> <6948>\n<2449> <244a> <6bfb>\n<244c> <244d> <6bf7>\n<2454> <2455> <6e93>\n<249b> <249c> <744a>\n<24a1> <24a2> <744f>\n<24c2> <24c3> <775f>\n<24d3> <24d4> <7885>\n<24e1> <24e2> <7a18>\n<2511> <2512> <7f67>\n<2517> <2518> <7fdb>\n<2579> <257a> <88cd>\n<259e> <259f> <8c84>\n<25a1> <25a2> <8d68>\n<25a5> <25a6> <8d8e>\n<25a8> <25a9> <8d93>\n<25be> <25bf> <8f07>\nendbfrange\n\n100 beginbfrange\n<25cf> <25d0> <916e>\n<25f4> <25f5> <9692>\n<25fe> <25ff> <9777>\n<2602> <2603> <980d>\n<2623> <2624> <5280>\n<2672> <2673> <5e58>\n<2688> <2689> <6152>\n<269f> <26a0> <6472>\n<26e5> <26e7> <6b9e>\n<26e8> <26e9> <6bc3>\n<26f6> <26f7> <6f19>\n<2733> <2734> <7502>\n<2756> <2757> <798a>\n<2767> <2768> <7aab>\n<278a> <278b> <7dcb>\n<2797> <2798> <7fe2>\n<27e8> <27e9> <8726>\n<27f1> <27f2> <88f1>\n<280a> <280b> <8c68>\n<281d> <281e> <8f10>\n<2863> <2864> <98ad>\n<2874> <2875> <9b3e>\n<2876> <2877> <9b60>\n<2879> <287a> <9cf1>\n<2881> <2882> <5106>\n<2885> <2886> <510b>\n<2889> <288a> <528b>\n<28f5> <28f6> <65b2>\n<296a> <296c> <735e>\n<2974> <2975> <7489>\n<2989> <298b> <769c>\n<2999> <299a> <78c3>\n<2a03> <2a04> <84e7>\n<2a10> <2a11> <8763>\n<2a34> <2a36> <8917>\n<2a47> <2a48> <8ad4>\n<2a6b> <2a6c> <8e26>\n<2a7a> <2a7b> <8f16>\n<2a83> <2a84> <9129>\n<2a88> <2a89> <9185>\n<2a8b> <2a8c> <9181>\n<2a90> <2a91> <92c3>\n<2acf> <2ad0> <9916>\n<2ad5> <2ad6> <99d3>\n<2afe> <2aff> <9f0f>\n<2b36> <2b37> <5e67>\n<2b60> <2b61> <66ca>\n<2b85> <2b86> <6a4d>\n<2b8c> <2b8d> <6baa>\n<2bb5> <2bb6> <71c0>\n<2bc0> <2bc1> <71da>\n<2bc2> <2bc3> <729d>\n<2bc5> <2bc6> <7366>\n<2be4> <2be5> <77a2>\n<2bf0> <2bf1> <78e1>\n<2bf3> <2bf4> <78df>\n<2c11> <2c12> <7cd0>\n<2c17> <2c18> <7e1f>\n<2c27> <2c28> <7f7b>\n<2c3c> <2c3e> <8255>\n<2c6f> <2c70> <8790>\n<2c7a> <2c7b> <892d>\n<2c88> <2c89> <8af4>\n<2c96> <2c97> <8c91>\n<2ca8> <2ca9> <8e3c>\n<2cbb> <2cbc> <9135>\n<2cbe> <2cbf> <9190>\n<2cec> <2ced> <95b9>\n<2d31> <2d32> <9e86>\n<2d35> <2d36> <9ed5>\n<2d42> <2d43> <568c>\n<2d59> <2d5a> <5bf1>\n<2da3> <2da4> <736e>\n<2dae> <2db0> <7510>\n<2db4> <2db5> <7648>\n<2dc5> <2dc6> <78fb>\n<2dd6> <2dd7> <7ac0>\n<2de9> <2dea> <7bf0>\n<2e59> <2e5a> <89f2>\n<2e93> <2e94> <9350>\n<2ec5> <2ec6> <992b>\n<2ed9> <2eda> <99fd>\n<2ef3> <2ef4> <9d2e>\n<2ef9> <2efa> <9d42>\n<2f0f> <2f10> <512d>\n<2f19> <2f1a> <5c69>\n<2f1c> <2f1d> <5e6d>\n<2f20> <2f21> <61ed>\n<2f31> <2f32> <66da>\n<2f3a> <2f3b> <6ab6>\n<2f43> <2f44> <700c>\n<2f49> <2f4a> <6fff>\n<2f6d> <2f6e> <7913>\n<2f8f> <2f90> <7ff7>\n<2f92> <2f93> <81d1>\n<2fc9> <2fca> <8950>\n<2ff7> <2ff9> <8f46>\n<2ffc> <2ffd> <913a>\n<301d> <301e> <95d2>\n<3037> <3039> <9850>\nendbfrange\n\n100 beginbfrange\n<304b> <304c> <9b04>\n<307a> <307b> <5134>\n<3081> <3082> <56a6>\n<3089> <308b> <5b3d>\n<30af> <30b1> <7021>\n<30bb> <30bc> <72a5>\n<30c6> <30c7> <77c9>\n<30d1> <30d2> <7a67>\n<30e9> <30ea> <7ffd>\n<310a> <310b> <87f6>\n<3116> <3117> <895a>\n<3133> <3134> <8d06>\n<3143> <3144> <8f4f>\n<3163> <3164> <95da>\n<3167> <3168> <972b>\n<316e> <3170> <97dd>\n<317c> <317d> <99a6>\n<3191> <3192> <9bea>\n<31ab> <31ac> <9d8b>\n<31af> <31b0> <9d74>\n<31c1> <31c2> <9f40>\n<31c4> <31c6> <9f56>\n<31cd> <31ce> <5dc6>\n<31cf> <31d0> <5eee>\n<31d1> <31d2> <5fc0>\n<31da> <31db> <66e3>\n<31e2> <31e3> <6aee>\n<31f4> <31f5> <7213>\n<3205> <3206> <7927>\n<320b> <320c> <7a6c>\n<321d> <321e> <8268>\n<322c> <322d> <8810>\n<3242> <3243> <8f56>\n<324c> <324d> <91b2>\n<326f> <3270> <972e>\n<3273> <3274> <97fd>\n<3276> <3277> <9862>\n<3279> <327a> <98c1>\n<32b4> <32b5> <9da6>\n<32ca> <32cb> <56bd>\n<32d8> <32d9> <7043>\n<32db> <32dc> <7048>\n<32dd> <32de> <7045>\n<32ed> <32ee> <7e87>\n<3314> <3315> <8b7a>\n<331f> <3320> <9144>\n<3345> <3346> <9b17>\n<334f> <3350> <9c28>\n<3360> <3361> <9db9>\n<337c> <337d> <5b4b>\n<3386> <3387> <6b08>\n<3389> <338b> <7055>\n<338d> <338e> <721e>\n<3399> <339a> <7a70>\n<33a7> <33a8> <8634>\n<33c2> <33c3> <8e96>\n<33c9> <33ca> <944a>\n<33ce> <33cf> <9448>\n<33d9> <33da> <9a53>\n<3418> <3419> <6203>\n<341e> <341f> <6b11>\n<344c> <344d> <97c4>\n<3451> <3453> <9b1e>\n<3473> <3474> <9ef2>\n<347e> <347f> <9f6e>\n<3485> <3486> <66ed>\n<349c> <349d> <8b94>\n<349e> <34a0> <8e9e>\n<34a6> <34a7> <9468>\n<34bd> <34be> <9e00>\n<34c6> <34c8> <9f74>\n<34cc> <34cd> <6b18>\n<34d3> <34d4> <77d8>\n<34dd> <34de> <81e0>\n<34df> <34e1> <8646>\n<34e2> <34e3> <8979>\n<34e7> <34e8> <8b98>\n<3527> <3528> <9873>\n<352d> <352e> <9a66>\n<3539> <353a> <9480>\n<3547> <3548> <7069>\n<3550> <35ae> <0020>\n<35b5> <35b6> <30fd>\n<35b7> <35b8> <309d>\n<35ba> <35bc> <3005>\n<35c1> <35ff> <3041>\n<3600> <3613> <3080>\n<3614> <3669> <30a1>\n<366a> <366f> <0410>\n<3671> <3690> <0416>\n<3692> <36ab> <0436>\n<36ad> <36ae> <21b8>\n<3713> <3715> <fe10>\n<373b> <373c> <7ac2>\n<3780> <3781> <7f40>\n<3797> <3798> <803b>\n<3816> <3817> <8845>\n<381e> <381f> <88b4>\n<3a32> <3a33> <d846dd03>\n<3b02> <3b03> <770e>\nendbfrange\n\n30 beginbfrange\n<3d6b> <3d6c> <8fbb>\n<41b2> <41b3> <d84cddf7>\n<41b5> <41b6> <d84cdda4>\n<4250> <4251> <e251>\n<4259> <425a> <70d5>\n<4400> <445e> <0020>\n<4462> <44c0> <0020>\n<44c6> <44c7> <309b>\n<44c9> <44cd> <31c0>\n<44d2> <44d3> <31c6>\n<44d8> <44db> <31c9>\n<44dd> <44de> <31cd>\n<44df> <44e0> <f538>\n<451d> <451f> <2e86>\n<4521> <4522> <2e8c>\n<452e> <452f> <2ecc>\n<4531> <4532> <2ed6>\n<454f> <4550> <5b9e>\n<4569> <456a> <8f66>\n<45dc> <45dd> <d843dd7e>\n<4604> <4605> <d844dc1d>\n<4606> <4607> <d844dcf5>\n<4681> <4682> <6ee8>\n<46f4> <46f5> <741e>\n<474d> <474e> <8159>\n<476b> <476c> <856f>\n<479d> <479e> <92f3>\n<48a2> <48a3> <d862dde7>\n<499c> <499d> <23da>\n<4a10> <4a11> <9fad>\nendbfrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/B5-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (B5-H)\n%%Title: (B5-H Adobe CNS1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 0 def\nend def\n\n/CMapName /B5-H def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 100 def\n/XUID [1 10 25380] def\n\n/WMode 0 def\n\n2 begincodespacerange\n  <00>   <80>\n  <A140> <FEFE>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 13648\nendnotdefrange\n\n100 begincidrange\n<20> <7e> 13648\n<a140> <a158> 99\n<a159> <a15c> 13743\n<a15d> <a17e> 128\n<a1a1> <a1f5> 162\n<a1f6> <a1f6> 248\n<a1f7> <a1f7> 247\n<a1f8> <a1fe> 249\n<a240> <a27e> 256\n<a2a1> <a2fe> 319\n<a340> <a37e> 413\n<a3a1> <a3bb> 476\n<a3bd> <a3bf> 503\n<a440> <a47e> 595\n<a4a1> <a4fe> 658\n<a540> <a57e> 752\n<a5a1> <a5fe> 815\n<a640> <a67e> 909\n<a6a1> <a6fe> 972\n<a740> <a77e> 1066\n<a7a1> <a7fe> 1129\n<a840> <a87e> 1223\n<a8a1> <a8fe> 1286\n<a940> <a97e> 1380\n<a9a1> <a9fe> 1443\n<aa40> <aa7e> 1537\n<aaa1> <aafe> 1600\n<ab40> <ab7e> 1694\n<aba1> <abfe> 1757\n<ac40> <ac7e> 1851\n<aca1> <acfd> 1914\n<acfe> <acfe> 2431\n<ad40> <ad7e> 2007\n<ada1> <adfe> 2070\n<ae40> <ae7e> 2164\n<aea1> <aefe> 2227\n<af40> <af7e> 2321\n<afa1> <afcf> 2384\n<afd0> <affe> 2432\n<b040> <b07e> 2479\n<b0a1> <b0fe> 2542\n<b140> <b17e> 2636\n<b1a1> <b1fe> 2699\n<b240> <b27e> 2793\n<b2a1> <b2fe> 2856\n<b340> <b37e> 2950\n<b3a1> <b3fe> 3013\n<b440> <b47e> 3107\n<b4a1> <b4fe> 3170\n<b540> <b57e> 3264\n<b5a1> <b5fe> 3327\n<b640> <b67e> 3421\n<b6a1> <b6fe> 3484\n<b740> <b77e> 3578\n<b7a1> <b7fe> 3641\n<b840> <b87e> 3735\n<b8a1> <b8fe> 3798\n<b940> <b97e> 3892\n<b9a1> <b9fe> 3955\n<ba40> <ba7e> 4049\n<baa1> <bafe> 4112\n<bb40> <bb7e> 4206\n<bba1> <bbc7> 4269\n<bbc8> <bbfe> 4309\n<bc40> <bc7e> 4364\n<bca1> <bcfe> 4427\n<bd40> <bd7e> 4521\n<bda1> <bdfe> 4584\n<be40> <be51> 4678\n<be52> <be52> 4308\n<be53> <be7e> 4696\n<bea1> <befe> 4740\n<bf40> <bf7e> 4834\n<bfa1> <bffe> 4897\n<c040> <c07e> 4991\n<c0a1> <c0fe> 5054\n<c140> <c17e> 5148\n<c1a1> <c1aa> 5211\n<c1ab> <c1fe> 5222\n<c240> <c27e> 5306\n<c2a1> <c2ca> 5369\n<c2cb> <c2cb> 5221\n<c2cc> <c2fe> 5411\n<c340> <c360> 5462\n<c361> <c37e> 5496\n<c3a1> <c3b8> 5526\n<c3b9> <c3b9> 5551\n<c3ba> <c3ba> 5550\n<c3bb> <c3fe> 5552\n<c440> <c455> 5620\n<c456> <c456> 5495\n<c457> <c47e> 5642\n<c4a1> <c4fe> 5682\n<c540> <c57e> 5776\n<c5a1> <c5fe> 5839\n<c640> <c67e> 5933\n<c940> <c949> 5996\n<c94a> <c94a> 628\n<c94b> <c96b> 6006\n<c96c> <c97e> 6040\nendcidrange\n\n100 begincidrange\n<c9a1> <c9bd> 6059\n<c9be> <c9be> 6039\n<c9bf> <c9ec> 6088\n<c9ed> <c9fe> 6135\n<ca40> <ca7e> 6153\n<caa1> <caf6> 6216\n<caf7> <caf7> 6134\n<caf8> <cafe> 6302\n<cb40> <cb7e> 6309\n<cba1> <cbfe> 6372\n<cc40> <cc7e> 6466\n<cca1> <ccfe> 6529\n<cd40> <cd7e> 6623\n<cda1> <cdfe> 6686\n<ce40> <ce7e> 6780\n<cea1> <cefe> 6843\n<cf40> <cf7e> 6937\n<cfa1> <cffe> 7000\n<d040> <d07e> 7094\n<d0a1> <d0fe> 7157\n<d140> <d17e> 7251\n<d1a1> <d1fe> 7314\n<d240> <d27e> 7408\n<d2a1> <d2fe> 7471\n<d340> <d37e> 7565\n<d3a1> <d3fe> 7628\n<d440> <d47e> 7722\n<d4a1> <d4fe> 7785\n<d540> <d57e> 7879\n<d5a1> <d5fe> 7942\n<d640> <d67e> 8036\n<d6a1> <d6cb> 8099\n<d6cc> <d6cc> 8788\n<d6cd> <d6fe> 8143\n<d740> <d779> 8193\n<d77a> <d77a> 8889\n<d77b> <d77e> 8251\n<d7a1> <d7fe> 8255\n<d840> <d87e> 8349\n<d8a1> <d8fe> 8412\n<d940> <d97e> 8506\n<d9a1> <d9fe> 8569\n<da40> <da7e> 8663\n<daa1> <dade> 8726\n<dadf> <dadf> 8142\n<dae0> <dafe> 8789\n<db40> <db7e> 8820\n<dba1> <dba6> 8883\n<dba7> <dbfe> 8890\n<dc40> <dc7e> 8978\n<dca1> <dcfe> 9041\n<dd40> <dd7e> 9135\n<dda1> <ddfb> 9198\n<ddfc> <ddfc> 9089\n<ddfd> <ddfe> 9289\n<de40> <de7e> 9291\n<dea1> <defe> 9354\n<df40> <df7e> 9448\n<dfa1> <dffe> 9511\n<e040> <e07e> 9605\n<e0a1> <e0fe> 9668\n<e140> <e17e> 9762\n<e1a1> <e1fe> 9825\n<e240> <e27e> 9919\n<e2a1> <e2fe> 9982\n<e340> <e37e> 10076\n<e3a1> <e3fe> 10139\n<e440> <e47e> 10233\n<e4a1> <e4fe> 10296\n<e540> <e57e> 10390\n<e5a1> <e5fe> 10453\n<e640> <e67e> 10547\n<e6a1> <e6fe> 10610\n<e740> <e77e> 10704\n<e7a1> <e7fe> 10767\n<e840> <e87e> 10861\n<e8a1> <e8a2> 10924\n<e8a3> <e8fe> 10927\n<e940> <e975> 11019\n<e976> <e97e> 11074\n<e9a1> <e9fe> 11083\n<ea40> <ea7e> 11177\n<eaa1> <eafe> 11240\n<eb40> <eb5a> 11334\n<eb5b> <eb7e> 11362\n<eba1> <ebf0> 11398\n<ebf1> <ebf1> 10926\n<ebf2> <ebfe> 11478\n<ec40> <ec7e> 11491\n<eca1> <ecdd> 11554\n<ecde> <ecde> 11073\n<ecdf> <ecfe> 11615\n<ed40> <ed7e> 11647\n<eda1> <eda9> 11710\n<edaa> <edfe> 11720\n<ee40> <ee7e> 11805\n<eea1> <eeea> 11868\n<eeeb> <eeeb> 12308\n<eeec> <eefe> 11942\n<ef40> <ef7e> 11961\nendcidrange\n\n44 begincidrange\n<efa1> <effe> 12024\n<f040> <f055> 12118\n<f056> <f056> 11719\n<f057> <f07e> 12140\n<f0a1> <f0ca> 12180\n<f0cb> <f0cb> 11361\n<f0cc> <f0fe> 12222\n<f140> <f162> 12273\n<f163> <f16a> 12309\n<f16b> <f16b> 12640\n<f16c> <f17e> 12317\n<f1a1> <f1fe> 12336\n<f240> <f267> 12430\n<f268> <f268> 12783\n<f269> <f27e> 12470\n<f2a1> <f2c2> 12492\n<f2c3> <f2fe> 12527\n<f340> <f374> 12587\n<f375> <f37e> 12641\n<f3a1> <f3fe> 12651\n<f440> <f465> 12745\n<f466> <f47e> 12784\n<f4a1> <f4b4> 12809\n<f4b5> <f4b5> 12526\n<f4b6> <f4fc> 12829\n<f4fd> <f4fe> 12901\n<f540> <f57e> 12903\n<f5a1> <f5fe> 12966\n<f640> <f662> 13060\n<f663> <f663> 12900\n<f664> <f67e> 13095\n<f6a1> <f6fe> 13122\n<f740> <f77e> 13216\n<f7a1> <f7fe> 13279\n<f840> <f87e> 13373\n<f8a1> <f8fe> 13436\n<f940> <f976> 13530\n<f977> <f97e> 13586\n<f9a1> <f9c3> 13594\n<f9c4> <f9c4> 13585\n<f9c5> <f9c5> 13629\n<f9c6> <f9c6> 13641\n<f9c7> <f9d1> 13630\n<f9d2> <f9d5> 13642\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/B5-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (B5-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (B5-H)\n%%BeginResource: CMap (B5-V)\n%%Title: (B5-V Adobe CNS1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/B5-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 0 def\nend def\n\n/CMapName /B5-V def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 910 def\n/XUID [1 10 25381] def\n\n/WMode 1 def\n\n12 begincidrange\n<a14b> <a14b> 13646\n<a15a> <a15a> 13743\n<a15c> <a15c> 13745\n<a15d> <a15e> 130\n<a161> <a162> 134\n<a165> <a166> 138\n<a169> <a16a> 142\n<a16d> <a16e> 146\n<a171> <a172> 150\n<a175> <a176> 154\n<a179> <a17a> 158\n<a1e3> <a1e3> 13647\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/B5pc-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (B5pc-H)\n%%Title: (B5pc-H Adobe CNS1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 0 def\nend def\n\n/CMapName /B5pc-H def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 0 def\n/XUID [1 10 25382] def\n\n/WMode 0 def\n\n3 begincodespacerange\n  <00>   <80>\n  <A140> <FCFE>\n  <FD>   <FF>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 1\nendnotdefrange\n\n100 begincidrange\n<20> <7e> 1\n<80> <80> 61\n<a140> <a158> 99\n<a159> <a15c> 13743\n<a15d> <a17e> 128\n<a1a1> <a1f5> 162\n<a1f6> <a1f6> 248\n<a1f7> <a1f7> 247\n<a1f8> <a1fe> 249\n<a240> <a27e> 256\n<a2a1> <a2fe> 319\n<a340> <a37e> 413\n<a3a1> <a3bb> 476\n<a3bd> <a3bf> 503\n<a3c0> <a3e0> 562\n<a440> <a47e> 595\n<a4a1> <a4fe> 658\n<a540> <a57e> 752\n<a5a1> <a5fe> 815\n<a640> <a67e> 909\n<a6a1> <a6fe> 972\n<a740> <a77e> 1066\n<a7a1> <a7fe> 1129\n<a840> <a87e> 1223\n<a8a1> <a8fe> 1286\n<a940> <a97e> 1380\n<a9a1> <a9fe> 1443\n<aa40> <aa7e> 1537\n<aaa1> <aafe> 1600\n<ab40> <ab7e> 1694\n<aba1> <abfe> 1757\n<ac40> <ac7e> 1851\n<aca1> <acfd> 1914\n<acfe> <acfe> 2431\n<ad40> <ad7e> 2007\n<ada1> <adfe> 2070\n<ae40> <ae7e> 2164\n<aea1> <aefe> 2227\n<af40> <af7e> 2321\n<afa1> <afcf> 2384\n<afd0> <affe> 2432\n<b040> <b07e> 2479\n<b0a1> <b0fe> 2542\n<b140> <b17e> 2636\n<b1a1> <b1fe> 2699\n<b240> <b27e> 2793\n<b2a1> <b2fe> 2856\n<b340> <b37e> 2950\n<b3a1> <b3fe> 3013\n<b440> <b47e> 3107\n<b4a1> <b4fe> 3170\n<b540> <b57e> 3264\n<b5a1> <b5fe> 3327\n<b640> <b67e> 3421\n<b6a1> <b6fe> 3484\n<b740> <b77e> 3578\n<b7a1> <b7fe> 3641\n<b840> <b87e> 3735\n<b8a1> <b8fe> 3798\n<b940> <b97e> 3892\n<b9a1> <b9fe> 3955\n<ba40> <ba7e> 4049\n<baa1> <bafe> 4112\n<bb40> <bb7e> 4206\n<bba1> <bbc7> 4269\n<bbc8> <bbfe> 4309\n<bc40> <bc7e> 4364\n<bca1> <bcfe> 4427\n<bd40> <bd7e> 4521\n<bda1> <bdfe> 4584\n<be40> <be51> 4678\n<be52> <be52> 4308\n<be53> <be7e> 4696\n<bea1> <befe> 4740\n<bf40> <bf7e> 4834\n<bfa1> <bffe> 4897\n<c040> <c07e> 4991\n<c0a1> <c0fe> 5054\n<c140> <c17e> 5148\n<c1a1> <c1aa> 5211\n<c1ab> <c1fe> 5222\n<c240> <c27e> 5306\n<c2a1> <c2ca> 5369\n<c2cb> <c2cb> 5221\n<c2cc> <c2fe> 5411\n<c340> <c360> 5462\n<c361> <c37e> 5496\n<c3a1> <c3b8> 5526\n<c3b9> <c3b9> 5551\n<c3ba> <c3ba> 5550\n<c3bb> <c3fe> 5552\n<c440> <c455> 5620\n<c456> <c456> 5495\n<c457> <c47e> 5642\n<c4a1> <c4fe> 5682\n<c540> <c57e> 5776\n<c5a1> <c5fe> 5839\n<c640> <c67e> 5933\n<c940> <c949> 5996\n<c94a> <c94a> 628\nendcidrange\n\n100 begincidrange\n<c94b> <c96b> 6006\n<c96c> <c97e> 6040\n<c9a1> <c9bd> 6059\n<c9be> <c9be> 6039\n<c9bf> <c9ec> 6088\n<c9ed> <c9fe> 6135\n<ca40> <ca7e> 6153\n<caa1> <caf6> 6216\n<caf7> <caf7> 6134\n<caf8> <cafe> 6302\n<cb40> <cb7e> 6309\n<cba1> <cbfe> 6372\n<cc40> <cc7e> 6466\n<cca1> <ccfe> 6529\n<cd40> <cd7e> 6623\n<cda1> <cdfe> 6686\n<ce40> <ce7e> 6780\n<cea1> <cefe> 6843\n<cf40> <cf7e> 6937\n<cfa1> <cffe> 7000\n<d040> <d07e> 7094\n<d0a1> <d0fe> 7157\n<d140> <d17e> 7251\n<d1a1> <d1fe> 7314\n<d240> <d27e> 7408\n<d2a1> <d2fe> 7471\n<d340> <d37e> 7565\n<d3a1> <d3fe> 7628\n<d440> <d47e> 7722\n<d4a1> <d4fe> 7785\n<d540> <d57e> 7879\n<d5a1> <d5fe> 7942\n<d640> <d67e> 8036\n<d6a1> <d6cb> 8099\n<d6cc> <d6cc> 8788\n<d6cd> <d6fe> 8143\n<d740> <d779> 8193\n<d77a> <d77a> 8889\n<d77b> <d77e> 8251\n<d7a1> <d7fe> 8255\n<d840> <d87e> 8349\n<d8a1> <d8fe> 8412\n<d940> <d97e> 8506\n<d9a1> <d9fe> 8569\n<da40> <da7e> 8663\n<daa1> <dade> 8726\n<dadf> <dadf> 8142\n<dae0> <dafe> 8789\n<db40> <db7e> 8820\n<dba1> <dba6> 8883\n<dba7> <dbfe> 8890\n<dc40> <dc7e> 8978\n<dca1> <dcfe> 9041\n<dd40> <dd7e> 9135\n<dda1> <ddfb> 9198\n<ddfc> <ddfc> 9089\n<ddfd> <ddfe> 9289\n<de40> <de7e> 9291\n<dea1> <defe> 9354\n<df40> <df7e> 9448\n<dfa1> <dffe> 9511\n<e040> <e07e> 9605\n<e0a1> <e0fe> 9668\n<e140> <e17e> 9762\n<e1a1> <e1fe> 9825\n<e240> <e27e> 9919\n<e2a1> <e2fe> 9982\n<e340> <e37e> 10076\n<e3a1> <e3fe> 10139\n<e440> <e47e> 10233\n<e4a1> <e4fe> 10296\n<e540> <e57e> 10390\n<e5a1> <e5fe> 10453\n<e640> <e67e> 10547\n<e6a1> <e6fe> 10610\n<e740> <e77e> 10704\n<e7a1> <e7fe> 10767\n<e840> <e87e> 10861\n<e8a1> <e8a2> 10924\n<e8a3> <e8fe> 10927\n<e940> <e975> 11019\n<e976> <e97e> 11074\n<e9a1> <e9fe> 11083\n<ea40> <ea7e> 11177\n<eaa1> <eafe> 11240\n<eb40> <eb5a> 11334\n<eb5b> <eb7e> 11362\n<eba1> <ebf0> 11398\n<ebf1> <ebf1> 10926\n<ebf2> <ebfe> 11478\n<ec40> <ec7e> 11491\n<eca1> <ecdd> 11554\n<ecde> <ecde> 11073\n<ecdf> <ecfe> 11615\n<ed40> <ed7e> 11647\n<eda1> <eda9> 11710\n<edaa> <edfe> 11720\n<ee40> <ee7e> 11805\n<eea1> <eeea> 11868\n<eeeb> <eeeb> 12308\nendcidrange\n\n47 begincidrange\n<eeec> <eefe> 11942\n<ef40> <ef7e> 11961\n<efa1> <effe> 12024\n<f040> <f055> 12118\n<f056> <f056> 11719\n<f057> <f07e> 12140\n<f0a1> <f0ca> 12180\n<f0cb> <f0cb> 11361\n<f0cc> <f0fe> 12222\n<f140> <f162> 12273\n<f163> <f16a> 12309\n<f16b> <f16b> 12640\n<f16c> <f17e> 12317\n<f1a1> <f1fe> 12336\n<f240> <f267> 12430\n<f268> <f268> 12783\n<f269> <f27e> 12470\n<f2a1> <f2c2> 12492\n<f2c3> <f2fe> 12527\n<f340> <f374> 12587\n<f375> <f37e> 12641\n<f3a1> <f3fe> 12651\n<f440> <f465> 12745\n<f466> <f47e> 12784\n<f4a1> <f4b4> 12809\n<f4b5> <f4b5> 12526\n<f4b6> <f4fc> 12829\n<f4fd> <f4fe> 12901\n<f540> <f57e> 12903\n<f5a1> <f5fe> 12966\n<f640> <f662> 13060\n<f663> <f663> 12900\n<f664> <f67e> 13095\n<f6a1> <f6fe> 13122\n<f740> <f77e> 13216\n<f7a1> <f7fe> 13279\n<f840> <f87e> 13373\n<f8a1> <f8fe> 13436\n<f940> <f976> 13530\n<f977> <f97e> 13586\n<f9a1> <f9c3> 13594\n<f9c4> <f9c4> 13585\n<f9c5> <f9c5> 13629\n<f9c6> <f9c6> 13641\n<f9c7> <f9d1> 13630\n<f9d2> <f9d5> 13642\n<fd> <ff> 96\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/B5pc-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (B5pc-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (B5pc-H)\n%%BeginResource: CMap (B5pc-V)\n%%Title: (B5pc-V Adobe CNS1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/B5pc-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 0 def\nend def\n\n/CMapName /B5pc-V def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 900 def\n/XUID [1 10 25383] def\n\n/WMode 1 def\n\n12 begincidrange\n<a14b> <a14b> 13646\n<a15a> <a15a> 13743\n<a15c> <a15c> 13745\n<a15d> <a15e> 130\n<a161> <a162> 134\n<a165> <a166> 138\n<a169> <a16a> 142\n<a16d> <a16e> 146\n<a171> <a172> 150\n<a175> <a176> 154\n<a179> <a17a> 158\n<a1e3> <a1e3> 13647\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/CNS-EUC-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (CNS-EUC-H)\n%%Title: (CNS-EUC-H Adobe CNS1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 0 def\nend def\n\n/CMapName /CNS-EUC-H def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 300 def\n/XUID [1 10 25388] def\n\n/WMode 0 def\n\n5 begincodespacerange\n  <00>       <80>\n  <8EA1A1A1> <8EA1FEFE>\n  <8EA2A1A1> <8EA2FEFE>\n  <8EA3A1A1> <8EA3FEFE>\n  <A1A1>     <FEFE>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 13648\nendnotdefrange\n\n100 begincidrange\n<20> <7e> 13648\n<8ea1a1a1> <8ea1a1fe> 99\n<8ea1a2a1> <8ea1a2fe> 193\n<8ea1a3a1> <8ea1a3ce> 287\n<8ea1a4a1> <8ea1a4fe> 333\n<8ea1a5a1> <8ea1a5ec> 427\n<8ea1a5ee> <8ea1a5f0> 503\n<8ea1a6a1> <8ea1a6be> 506\n<8ea1a7a1> <8ea1a7a1> 595\n<8ea1a7a2> <8ea1a7a4> 536\n<8ea1a7a5> <8ea1a7a5> 596\n<8ea1a7a6> <8ea1a7a6> 539\n<8ea1a7a7> <8ea1a7a7> 602\n<8ea1a7a8> <8ea1a7a8> 540\n<8ea1a7a9> <8ea1a7ac> 603\n<8ea1a7ad> <8ea1a7af> 541\n<8ea1a7b0> <8ea1a7b0> 607\n<8ea1a7b1> <8ea1a7b1> 5998\n<8ea1a7b2> <8ea1a7b2> 608\n<8ea1a7b3> <8ea1a7b3> 610\n<8ea1a7b4> <8ea1a7b4> 544\n<8ea1a7b5> <8ea1a7b5> 611\n<8ea1a7b6> <8ea1a7b6> 5999\n<8ea1a7b7> <8ea1a7b7> 545\n<8ea1a7b8> <8ea1a7b9> 612\n<8ea1a7ba> <8ea1a7ba> 546\n<8ea1a7bb> <8ea1a7bb> 6000\n<8ea1a7bc> <8ea1a7bc> 547\n<8ea1a7bd> <8ea1a7bd> 614\n<8ea1a7be> <8ea1a7be> 633\n<8ea1a7bf> <8ea1a7bf> 6005\n<8ea1a7c0> <8ea1a7c1> 634\n<8ea1a7c2> <8ea1a7c2> 548\n<8ea1a7c3> <8ea1a7c6> 636\n<8ea1a7c7> <8ea1a7c7> 549\n<8ea1a7c8> <8ea1a7cb> 642\n<8ea1a7cc> <8ea1a7cc> 6006\n<8ea1a7cd> <8ea1a7cd> 646\n<8ea1a7ce> <8ea1a7ce> 550\n<8ea1a7cf> <8ea1a7d0> 648\n<8ea1a7d1> <8ea1a7d2> 652\n<8ea1a7d3> <8ea1a7d5> 551\n<8ea1a7d6> <8ea1a7d8> 654\n<8ea1a7d9> <8ea1a7da> 554\n<8ea1a7db> <8ea1a7db> 6007\n<8ea1a7dc> <8ea1a7df> 720\n<8ea1a7e0> <8ea1a7e0> 725\n<8ea1a7e1> <8ea1a7e1> 556\n<8ea1a7e2> <8ea1a7e5> 726\n<8ea1a7e6> <8ea1a7e6> 557\n<8ea1a7e7> <8ea1a7ed> 730\n<8ea1a7ee> <8ea1a7ee> 6026\n<8ea1a7ef> <8ea1a7f2> 737\n<8ea1a7f3> <8ea1a7f3> 6028\n<8ea1a7f4> <8ea1a7f8> 741\n<8ea1a7f9> <8ea1a7f9> 6029\n<8ea1a7fa> <8ea1a7fd> 746\n<8ea1a7fe> <8ea1a7fe> 854\n<8ea1a8a1> <8ea1a8a6> 855\n<8ea1a8a7> <8ea1a8a7> 862\n<8ea1a8a8> <8ea1a8a8> 866\n<8ea1a8a9> <8ea1a8aa> 558\n<8ea1a8ab> <8ea1a8b2> 867\n<8ea1a8b3> <8ea1a8b3> 6066\n<8ea1a8b4> <8ea1a8b6> 875\n<8ea1a8b7> <8ea1a8ba> 1014\n<8ea1a8bb> <8ea1a8bb> 6162\n<8ea1a8bc> <8ea1a8be> 1018\n<8ea1a8bf> <8ea1a8c3> 1022\n<8ea1a8c4> <8ea1a8cc> 1029\n<8ea1a8cd> <8ea1a8cd> 6163\n<8ea1a8ce> <8ea1a8ce> 6168\n<8ea1a8cf> <8ea1a8d2> 1039\n<8ea1a8d3> <8ea1a8d3> 6169\n<8ea1a8d4> <8ea1a8d9> 1288\n<8ea1a8da> <8ea1a8da> 6375\n<8ea1a8db> <8ea1a8e2> 1294\n<8ea1a8e3> <8ea1a8e3> 560\n<8ea1a8e4> <8ea1a8e4> 1307\n<8ea1a8e5> <8ea1a8e7> 1312\n<8ea1a8e8> <8ea1a8eb> 1686\n<8ea1a8ec> <8ea1a8ec> 561\n<8ea1a8ed> <8ea1a8f0> 1695\n<8ea1a8f1> <8ea1a8fb> 2086\n<8ea1a8fc> <8ea1a8fe> 2549\n<8ea1a9a1> <8ea1a9a1> 7731\n<8ea1a9a2> <8ea1a9a2> 2552\n<8ea1a9a3> <8ea1a9a3> 7732\n<8ea1a9a4> <8ea1a9a5> 2553\n<8ea1a9a6> <8ea1a9ab> 3041\n<8ea1a9ac> <8ea1a9ae> 3515\n<8ea1a9af> <8ea1a9af> 9056\n<8ea1a9b0> <8ea1a9b0> 9746\n<8ea1a9b1> <8ea1a9b3> 3963\n<8ea1a9b4> <8ea1a9b5> 4352\n<8ea1a9b6> <8ea1a9b6> 4745\n<8ea1a9b7> <8ea1a9b8> 5042\n<8ea1a9b9> <8ea1a9b9> 12045\n<8ea1c2a1> <8ea1c2c1> 562\n<8ea1c4a1> <8ea1c4fe> 595\nendcidrange\n\n100 begincidrange\n<8ea1c5a1> <8ea1c5fe> 689\n<8ea1c6a1> <8ea1c6fe> 783\n<8ea1c7a1> <8ea1c7fe> 877\n<8ea1c8a1> <8ea1c8fe> 971\n<8ea1c9a1> <8ea1c9fe> 1065\n<8ea1caa1> <8ea1cafe> 1159\n<8ea1cba1> <8ea1cbfe> 1253\n<8ea1cca1> <8ea1ccfe> 1347\n<8ea1cda1> <8ea1cdfe> 1441\n<8ea1cea1> <8ea1cefe> 1535\n<8ea1cfa1> <8ea1cffe> 1629\n<8ea1d0a1> <8ea1d0fe> 1723\n<8ea1d1a1> <8ea1d1fe> 1817\n<8ea1d2a1> <8ea1d2fe> 1911\n<8ea1d3a1> <8ea1d3fe> 2005\n<8ea1d4a1> <8ea1d4fe> 2099\n<8ea1d5a1> <8ea1d5fe> 2193\n<8ea1d6a1> <8ea1d6fe> 2287\n<8ea1d7a1> <8ea1d7fe> 2381\n<8ea1d8a1> <8ea1d8fe> 2475\n<8ea1d9a1> <8ea1d9fe> 2569\n<8ea1daa1> <8ea1dafe> 2663\n<8ea1dba1> <8ea1dbfe> 2757\n<8ea1dca1> <8ea1dcfe> 2851\n<8ea1dda1> <8ea1ddfe> 2945\n<8ea1dea1> <8ea1defe> 3039\n<8ea1dfa1> <8ea1dffe> 3133\n<8ea1e0a1> <8ea1e0fe> 3227\n<8ea1e1a1> <8ea1e1fe> 3321\n<8ea1e2a1> <8ea1e2fe> 3415\n<8ea1e3a1> <8ea1e3fe> 3509\n<8ea1e4a1> <8ea1e4fe> 3603\n<8ea1e5a1> <8ea1e5fe> 3697\n<8ea1e6a1> <8ea1e6fe> 3791\n<8ea1e7a1> <8ea1e7fe> 3885\n<8ea1e8a1> <8ea1e8fe> 3979\n<8ea1e9a1> <8ea1e9fe> 4073\n<8ea1eaa1> <8ea1eafe> 4167\n<8ea1eba1> <8ea1ebfe> 4261\n<8ea1eca1> <8ea1ecfe> 4355\n<8ea1eda1> <8ea1edfe> 4449\n<8ea1eea1> <8ea1eefe> 4543\n<8ea1efa1> <8ea1effe> 4637\n<8ea1f0a1> <8ea1f0fe> 4731\n<8ea1f1a1> <8ea1f1fe> 4825\n<8ea1f2a1> <8ea1f2fe> 4919\n<8ea1f3a1> <8ea1f3fe> 5013\n<8ea1f4a1> <8ea1f4fe> 5107\n<8ea1f5a1> <8ea1f5fe> 5201\n<8ea1f6a1> <8ea1f6fe> 5295\n<8ea1f7a1> <8ea1f7fe> 5389\n<8ea1f8a1> <8ea1f8fe> 5483\n<8ea1f9a1> <8ea1f9fe> 5577\n<8ea1faa1> <8ea1fafe> 5671\n<8ea1fba1> <8ea1fbfe> 5765\n<8ea1fca1> <8ea1fcfe> 5859\n<8ea1fda1> <8ea1fdcb> 5953\n<8ea2a1a1> <8ea2a1fe> 5996\n<8ea2a2a1> <8ea2a2fe> 6090\n<8ea2a3a1> <8ea2a3fe> 6184\n<8ea2a4a1> <8ea2a4fe> 6278\n<8ea2a5a1> <8ea2a5fe> 6372\n<8ea2a6a1> <8ea2a6fe> 6466\n<8ea2a7a1> <8ea2a7fe> 6560\n<8ea2a8a1> <8ea2a8fe> 6654\n<8ea2a9a1> <8ea2a9fe> 6748\n<8ea2aaa1> <8ea2aafe> 6842\n<8ea2aba1> <8ea2abfe> 6936\n<8ea2aca1> <8ea2acfe> 7030\n<8ea2ada1> <8ea2adfe> 7124\n<8ea2aea1> <8ea2aefe> 7218\n<8ea2afa1> <8ea2affe> 7312\n<8ea2b0a1> <8ea2b0fe> 7406\n<8ea2b1a1> <8ea2b1fe> 7500\n<8ea2b2a1> <8ea2b2fe> 7594\n<8ea2b3a1> <8ea2b3fe> 7688\n<8ea2b4a1> <8ea2b4fe> 7782\n<8ea2b5a1> <8ea2b5fe> 7876\n<8ea2b6a1> <8ea2b6fe> 7970\n<8ea2b7a1> <8ea2b7fe> 8064\n<8ea2b8a1> <8ea2b8fe> 8158\n<8ea2b9a1> <8ea2b9fe> 8252\n<8ea2baa1> <8ea2bafe> 8346\n<8ea2bba1> <8ea2bbfe> 8440\n<8ea2bca1> <8ea2bcfe> 8534\n<8ea2bda1> <8ea2bdfe> 8628\n<8ea2bea1> <8ea2befe> 8722\n<8ea2bfa1> <8ea2bffe> 8816\n<8ea2c0a1> <8ea2c0fe> 8910\n<8ea2c1a1> <8ea2c1fe> 9004\n<8ea2c2a1> <8ea2c2fe> 9098\n<8ea2c3a1> <8ea2c3fe> 9192\n<8ea2c4a1> <8ea2c4fe> 9286\n<8ea2c5a1> <8ea2c5fe> 9380\n<8ea2c6a1> <8ea2c6fe> 9474\n<8ea2c7a1> <8ea2c7fe> 9568\n<8ea2c8a1> <8ea2c8fe> 9662\n<8ea2c9a1> <8ea2c9fe> 9756\n<8ea2caa1> <8ea2cafe> 9850\n<8ea2cba1> <8ea2cbfe> 9944\nendcidrange\n\n100 begincidrange\n<8ea2cca1> <8ea2ccfe> 10038\n<8ea2cda1> <8ea2cdfe> 10132\n<8ea2cea1> <8ea2cefe> 10226\n<8ea2cfa1> <8ea2cffe> 10320\n<8ea2d0a1> <8ea2d0fe> 10414\n<8ea2d1a1> <8ea2d1fe> 10508\n<8ea2d2a1> <8ea2d2fe> 10602\n<8ea2d3a1> <8ea2d3fe> 10696\n<8ea2d4a1> <8ea2d4fe> 10790\n<8ea2d5a1> <8ea2d5fe> 10884\n<8ea2d6a1> <8ea2d6fe> 10978\n<8ea2d7a1> <8ea2d7fe> 11072\n<8ea2d8a1> <8ea2d8fe> 11166\n<8ea2d9a1> <8ea2d9fe> 11260\n<8ea2daa1> <8ea2dafe> 11354\n<8ea2dba1> <8ea2dbfe> 11448\n<8ea2dca1> <8ea2dcfe> 11542\n<8ea2dda1> <8ea2ddfe> 11636\n<8ea2dea1> <8ea2defe> 11730\n<8ea2dfa1> <8ea2dffe> 11824\n<8ea2e0a1> <8ea2e0fe> 11918\n<8ea2e1a1> <8ea2e1fe> 12012\n<8ea2e2a1> <8ea2e2fe> 12106\n<8ea2e3a1> <8ea2e3fe> 12200\n<8ea2e4a1> <8ea2e4fe> 12294\n<8ea2e5a1> <8ea2e5fe> 12388\n<8ea2e6a1> <8ea2e6fe> 12482\n<8ea2e7a1> <8ea2e7fe> 12576\n<8ea2e8a1> <8ea2e8fe> 12670\n<8ea2e9a1> <8ea2e9fe> 12764\n<8ea2eaa1> <8ea2eafe> 12858\n<8ea2eba1> <8ea2ebfe> 12952\n<8ea2eca1> <8ea2ecfe> 13046\n<8ea2eda1> <8ea2edfe> 13140\n<8ea2eea1> <8ea2eefe> 13234\n<8ea2efa1> <8ea2effe> 13328\n<8ea2f0a1> <8ea2f0fe> 13422\n<8ea2f1a1> <8ea2f1fe> 13516\n<8ea2f2a1> <8ea2f2c4> 13610\n<a1a1> <a1fe> 99\n<a2a1> <a2fe> 193\n<a3a1> <a3ce> 287\n<a4a1> <a4fe> 333\n<a5a1> <a5ec> 427\n<a5ee> <a5f0> 503\n<a6a1> <a6be> 506\n<a7a1> <a7a1> 595\n<a7a2> <a7a4> 536\n<a7a5> <a7a5> 596\n<a7a6> <a7a6> 539\n<a7a7> <a7a7> 602\n<a7a8> <a7a8> 540\n<a7a9> <a7ac> 603\n<a7ad> <a7af> 541\n<a7b0> <a7b0> 607\n<a7b1> <a7b1> 5998\n<a7b2> <a7b2> 608\n<a7b3> <a7b3> 610\n<a7b4> <a7b4> 544\n<a7b5> <a7b5> 611\n<a7b6> <a7b6> 5999\n<a7b7> <a7b7> 545\n<a7b8> <a7b9> 612\n<a7ba> <a7ba> 546\n<a7bb> <a7bb> 6000\n<a7bc> <a7bc> 547\n<a7bd> <a7bd> 614\n<a7be> <a7be> 633\n<a7bf> <a7bf> 6005\n<a7c0> <a7c1> 634\n<a7c2> <a7c2> 548\n<a7c3> <a7c6> 636\n<a7c7> <a7c7> 549\n<a7c8> <a7cb> 642\n<a7cc> <a7cc> 6006\n<a7cd> <a7cd> 646\n<a7ce> <a7ce> 550\n<a7cf> <a7d0> 648\n<a7d1> <a7d2> 652\n<a7d3> <a7d5> 551\n<a7d6> <a7d8> 654\n<a7d9> <a7da> 554\n<a7db> <a7db> 6007\n<a7dc> <a7df> 720\n<a7e0> <a7e0> 725\n<a7e1> <a7e1> 556\n<a7e2> <a7e5> 726\n<a7e6> <a7e6> 557\n<a7e7> <a7ed> 730\n<a7ee> <a7ee> 6026\n<a7ef> <a7f2> 737\n<a7f3> <a7f3> 6028\n<a7f4> <a7f8> 741\n<a7f9> <a7f9> 6029\n<a7fa> <a7fd> 746\n<a7fe> <a7fe> 854\n<a8a1> <a8a6> 855\n<a8a7> <a8a7> 862\n<a8a8> <a8a8> 866\n<a8a9> <a8aa> 558\nendcidrange\n\n95 begincidrange\n<a8ab> <a8b2> 867\n<a8b3> <a8b3> 6066\n<a8b4> <a8b6> 875\n<a8b7> <a8ba> 1014\n<a8bb> <a8bb> 6162\n<a8bc> <a8be> 1018\n<a8bf> <a8c3> 1022\n<a8c4> <a8cc> 1029\n<a8cd> <a8cd> 6163\n<a8ce> <a8ce> 6168\n<a8cf> <a8d2> 1039\n<a8d3> <a8d3> 6169\n<a8d4> <a8d9> 1288\n<a8da> <a8da> 6375\n<a8db> <a8e2> 1294\n<a8e3> <a8e3> 560\n<a8e4> <a8e4> 1307\n<a8e5> <a8e7> 1312\n<a8e8> <a8eb> 1686\n<a8ec> <a8ec> 561\n<a8ed> <a8f0> 1695\n<a8f1> <a8fb> 2086\n<a8fc> <a8fe> 2549\n<a9a1> <a9a1> 7731\n<a9a2> <a9a2> 2552\n<a9a3> <a9a3> 7732\n<a9a4> <a9a5> 2553\n<a9a6> <a9ab> 3041\n<a9ac> <a9ae> 3515\n<a9af> <a9af> 9056\n<a9b0> <a9b0> 9746\n<a9b1> <a9b3> 3963\n<a9b4> <a9b5> 4352\n<a9b6> <a9b6> 4745\n<a9b7> <a9b8> 5042\n<a9b9> <a9b9> 12045\n<c2a1> <c2c1> 562\n<c4a1> <c4fe> 595\n<c5a1> <c5fe> 689\n<c6a1> <c6fe> 783\n<c7a1> <c7fe> 877\n<c8a1> <c8fe> 971\n<c9a1> <c9fe> 1065\n<caa1> <cafe> 1159\n<cba1> <cbfe> 1253\n<cca1> <ccfe> 1347\n<cda1> <cdfe> 1441\n<cea1> <cefe> 1535\n<cfa1> <cffe> 1629\n<d0a1> <d0fe> 1723\n<d1a1> <d1fe> 1817\n<d2a1> <d2fe> 1911\n<d3a1> <d3fe> 2005\n<d4a1> <d4fe> 2099\n<d5a1> <d5fe> 2193\n<d6a1> <d6fe> 2287\n<d7a1> <d7fe> 2381\n<d8a1> <d8fe> 2475\n<d9a1> <d9fe> 2569\n<daa1> <dafe> 2663\n<dba1> <dbfe> 2757\n<dca1> <dcfe> 2851\n<dda1> <ddfe> 2945\n<dea1> <defe> 3039\n<dfa1> <dffe> 3133\n<e0a1> <e0fe> 3227\n<e1a1> <e1fe> 3321\n<e2a1> <e2fe> 3415\n<e3a1> <e3fe> 3509\n<e4a1> <e4fe> 3603\n<e5a1> <e5fe> 3697\n<e6a1> <e6fe> 3791\n<e7a1> <e7fe> 3885\n<e8a1> <e8fe> 3979\n<e9a1> <e9fe> 4073\n<eaa1> <eafe> 4167\n<eba1> <ebfe> 4261\n<eca1> <ecfe> 4355\n<eda1> <edfe> 4449\n<eea1> <eefe> 4543\n<efa1> <effe> 4637\n<f0a1> <f0fe> 4731\n<f1a1> <f1fe> 4825\n<f2a1> <f2fe> 4919\n<f3a1> <f3fe> 5013\n<f4a1> <f4fe> 5107\n<f5a1> <f5fe> 5201\n<f6a1> <f6fe> 5295\n<f7a1> <f7fe> 5389\n<f8a1> <f8fe> 5483\n<f9a1> <f9fe> 5577\n<faa1> <fafe> 5671\n<fba1> <fbfe> 5765\n<fca1> <fcfe> 5859\n<fda1> <fdcb> 5953\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/CNS-EUC-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (CNS-EUC-V)\n%%Title: (CNS-EUC-V Adobe CNS1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 0 def\nend def\n\n/CMapName /CNS-EUC-V def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/XUID [1 10 25389] def\n\n/WMode 1 def\n\n5 begincodespacerange\n  <00>       <80>\n  <8EA1A1A1> <8EA1FEFE>\n  <8EA2A1A1> <8EA2FEFE>\n  <8EA3A1A1> <8EA3FEFE>\n  <A1A1>     <FEFE>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 13648\nendnotdefrange\n\n100 begincidrange\n<20> <7e> 13648\n<8ea1a1a1> <8ea1a1ab> 99\n<8ea1a1ac> <8ea1a1ac> 13646\n<8ea1a1ad> <8ea1a1ba> 111\n<8ea1a1bb> <8ea1a1bb> 124\n<8ea1a1bc> <8ea1a1bc> 126\n<8ea1a1bd> <8ea1a1bd> 126\n<8ea1a1be> <8ea1a1bf> 130\n<8ea1a1c0> <8ea1a1c1> 130\n<8ea1a1c2> <8ea1a1c3> 134\n<8ea1a1c4> <8ea1a1c5> 134\n<8ea1a1c6> <8ea1a1c7> 138\n<8ea1a1c8> <8ea1a1c9> 138\n<8ea1a1ca> <8ea1a1cb> 142\n<8ea1a1cc> <8ea1a1cd> 142\n<8ea1a1ce> <8ea1a1cf> 146\n<8ea1a1d0> <8ea1a1d1> 146\n<8ea1a1d2> <8ea1a1d3> 150\n<8ea1a1d4> <8ea1a1d5> 150\n<8ea1a1d6> <8ea1a1d7> 154\n<8ea1a1d8> <8ea1a1d9> 154\n<8ea1a1da> <8ea1a1db> 158\n<8ea1a1dc> <8ea1a1fe> 158\n<8ea1a2a1> <8ea1a2c3> 193\n<8ea1a2c4> <8ea1a2c4> 13647\n<8ea1a2c5> <8ea1a2fe> 229\n<8ea1a3a1> <8ea1a3ce> 287\n<8ea1a4a1> <8ea1a4fe> 333\n<8ea1a5a1> <8ea1a5ec> 427\n<8ea1a5ee> <8ea1a5f0> 503\n<8ea1a6a1> <8ea1a6be> 506\n<8ea1a7a1> <8ea1a7a1> 595\n<8ea1a7a2> <8ea1a7a4> 536\n<8ea1a7a5> <8ea1a7a5> 596\n<8ea1a7a6> <8ea1a7a6> 539\n<8ea1a7a7> <8ea1a7a7> 602\n<8ea1a7a8> <8ea1a7a8> 540\n<8ea1a7a9> <8ea1a7ac> 603\n<8ea1a7ad> <8ea1a7af> 541\n<8ea1a7b0> <8ea1a7b0> 607\n<8ea1a7b1> <8ea1a7b1> 5998\n<8ea1a7b2> <8ea1a7b2> 608\n<8ea1a7b3> <8ea1a7b3> 610\n<8ea1a7b4> <8ea1a7b4> 544\n<8ea1a7b5> <8ea1a7b5> 611\n<8ea1a7b6> <8ea1a7b6> 5999\n<8ea1a7b7> <8ea1a7b7> 545\n<8ea1a7b8> <8ea1a7b9> 612\n<8ea1a7ba> <8ea1a7ba> 546\n<8ea1a7bb> <8ea1a7bb> 6000\n<8ea1a7bc> <8ea1a7bc> 547\n<8ea1a7bd> <8ea1a7bd> 614\n<8ea1a7be> <8ea1a7be> 633\n<8ea1a7bf> <8ea1a7bf> 6005\n<8ea1a7c0> <8ea1a7c1> 634\n<8ea1a7c2> <8ea1a7c2> 548\n<8ea1a7c3> <8ea1a7c6> 636\n<8ea1a7c7> <8ea1a7c7> 549\n<8ea1a7c8> <8ea1a7cb> 642\n<8ea1a7cc> <8ea1a7cc> 6006\n<8ea1a7cd> <8ea1a7cd> 646\n<8ea1a7ce> <8ea1a7ce> 550\n<8ea1a7cf> <8ea1a7d0> 648\n<8ea1a7d1> <8ea1a7d2> 652\n<8ea1a7d3> <8ea1a7d5> 551\n<8ea1a7d6> <8ea1a7d8> 654\n<8ea1a7d9> <8ea1a7da> 554\n<8ea1a7db> <8ea1a7db> 6007\n<8ea1a7dc> <8ea1a7df> 720\n<8ea1a7e0> <8ea1a7e0> 725\n<8ea1a7e1> <8ea1a7e1> 556\n<8ea1a7e2> <8ea1a7e5> 726\n<8ea1a7e6> <8ea1a7e6> 557\n<8ea1a7e7> <8ea1a7ed> 730\n<8ea1a7ee> <8ea1a7ee> 6026\n<8ea1a7ef> <8ea1a7f2> 737\n<8ea1a7f3> <8ea1a7f3> 6028\n<8ea1a7f4> <8ea1a7f8> 741\n<8ea1a7f9> <8ea1a7f9> 6029\n<8ea1a7fa> <8ea1a7fd> 746\n<8ea1a7fe> <8ea1a7fe> 854\n<8ea1a8a1> <8ea1a8a6> 855\n<8ea1a8a7> <8ea1a8a7> 862\n<8ea1a8a8> <8ea1a8a8> 866\n<8ea1a8a9> <8ea1a8aa> 558\n<8ea1a8ab> <8ea1a8b2> 867\n<8ea1a8b3> <8ea1a8b3> 6066\n<8ea1a8b4> <8ea1a8b6> 875\n<8ea1a8b7> <8ea1a8ba> 1014\n<8ea1a8bb> <8ea1a8bb> 6162\n<8ea1a8bc> <8ea1a8be> 1018\n<8ea1a8bf> <8ea1a8c3> 1022\n<8ea1a8c4> <8ea1a8cc> 1029\n<8ea1a8cd> <8ea1a8cd> 6163\n<8ea1a8ce> <8ea1a8ce> 6168\n<8ea1a8cf> <8ea1a8d2> 1039\n<8ea1a8d3> <8ea1a8d3> 6169\n<8ea1a8d4> <8ea1a8d9> 1288\n<8ea1a8da> <8ea1a8da> 6375\n<8ea1a8db> <8ea1a8e2> 1294\nendcidrange\n\n100 begincidrange\n<8ea1a8e3> <8ea1a8e3> 560\n<8ea1a8e4> <8ea1a8e4> 1307\n<8ea1a8e5> <8ea1a8e7> 1312\n<8ea1a8e8> <8ea1a8eb> 1686\n<8ea1a8ec> <8ea1a8ec> 561\n<8ea1a8ed> <8ea1a8f0> 1695\n<8ea1a8f1> <8ea1a8fb> 2086\n<8ea1a8fc> <8ea1a8fe> 2549\n<8ea1a9a1> <8ea1a9a1> 7731\n<8ea1a9a2> <8ea1a9a2> 2552\n<8ea1a9a3> <8ea1a9a3> 7732\n<8ea1a9a4> <8ea1a9a5> 2553\n<8ea1a9a6> <8ea1a9ab> 3041\n<8ea1a9ac> <8ea1a9ae> 3515\n<8ea1a9af> <8ea1a9af> 9056\n<8ea1a9b0> <8ea1a9b0> 9746\n<8ea1a9b1> <8ea1a9b3> 3963\n<8ea1a9b4> <8ea1a9b5> 4352\n<8ea1a9b6> <8ea1a9b6> 4745\n<8ea1a9b7> <8ea1a9b8> 5042\n<8ea1a9b9> <8ea1a9b9> 12045\n<8ea1c2a1> <8ea1c2c1> 562\n<8ea1c4a1> <8ea1c4fe> 595\n<8ea1c5a1> <8ea1c5fe> 689\n<8ea1c6a1> <8ea1c6fe> 783\n<8ea1c7a1> <8ea1c7fe> 877\n<8ea1c8a1> <8ea1c8fe> 971\n<8ea1c9a1> <8ea1c9fe> 1065\n<8ea1caa1> <8ea1cafe> 1159\n<8ea1cba1> <8ea1cbfe> 1253\n<8ea1cca1> <8ea1ccfe> 1347\n<8ea1cda1> <8ea1cdfe> 1441\n<8ea1cea1> <8ea1cefe> 1535\n<8ea1cfa1> <8ea1cffe> 1629\n<8ea1d0a1> <8ea1d0fe> 1723\n<8ea1d1a1> <8ea1d1fe> 1817\n<8ea1d2a1> <8ea1d2fe> 1911\n<8ea1d3a1> <8ea1d3fe> 2005\n<8ea1d4a1> <8ea1d4fe> 2099\n<8ea1d5a1> <8ea1d5fe> 2193\n<8ea1d6a1> <8ea1d6fe> 2287\n<8ea1d7a1> <8ea1d7fe> 2381\n<8ea1d8a1> <8ea1d8fe> 2475\n<8ea1d9a1> <8ea1d9fe> 2569\n<8ea1daa1> <8ea1dafe> 2663\n<8ea1dba1> <8ea1dbfe> 2757\n<8ea1dca1> <8ea1dcfe> 2851\n<8ea1dda1> <8ea1ddfe> 2945\n<8ea1dea1> <8ea1defe> 3039\n<8ea1dfa1> <8ea1dffe> 3133\n<8ea1e0a1> <8ea1e0fe> 3227\n<8ea1e1a1> <8ea1e1fe> 3321\n<8ea1e2a1> <8ea1e2fe> 3415\n<8ea1e3a1> <8ea1e3fe> 3509\n<8ea1e4a1> <8ea1e4fe> 3603\n<8ea1e5a1> <8ea1e5fe> 3697\n<8ea1e6a1> <8ea1e6fe> 3791\n<8ea1e7a1> <8ea1e7fe> 3885\n<8ea1e8a1> <8ea1e8fe> 3979\n<8ea1e9a1> <8ea1e9fe> 4073\n<8ea1eaa1> <8ea1eafe> 4167\n<8ea1eba1> <8ea1ebfe> 4261\n<8ea1eca1> <8ea1ecfe> 4355\n<8ea1eda1> <8ea1edfe> 4449\n<8ea1eea1> <8ea1eefe> 4543\n<8ea1efa1> <8ea1effe> 4637\n<8ea1f0a1> <8ea1f0fe> 4731\n<8ea1f1a1> <8ea1f1fe> 4825\n<8ea1f2a1> <8ea1f2fe> 4919\n<8ea1f3a1> <8ea1f3fe> 5013\n<8ea1f4a1> <8ea1f4fe> 5107\n<8ea1f5a1> <8ea1f5fe> 5201\n<8ea1f6a1> <8ea1f6fe> 5295\n<8ea1f7a1> <8ea1f7fe> 5389\n<8ea1f8a1> <8ea1f8fe> 5483\n<8ea1f9a1> <8ea1f9fe> 5577\n<8ea1faa1> <8ea1fafe> 5671\n<8ea1fba1> <8ea1fbfe> 5765\n<8ea1fca1> <8ea1fcfe> 5859\n<8ea1fda1> <8ea1fdcb> 5953\n<8ea2a1a1> <8ea2a1fe> 5996\n<8ea2a2a1> <8ea2a2fe> 6090\n<8ea2a3a1> <8ea2a3fe> 6184\n<8ea2a4a1> <8ea2a4fe> 6278\n<8ea2a5a1> <8ea2a5fe> 6372\n<8ea2a6a1> <8ea2a6fe> 6466\n<8ea2a7a1> <8ea2a7fe> 6560\n<8ea2a8a1> <8ea2a8fe> 6654\n<8ea2a9a1> <8ea2a9fe> 6748\n<8ea2aaa1> <8ea2aafe> 6842\n<8ea2aba1> <8ea2abfe> 6936\n<8ea2aca1> <8ea2acfe> 7030\n<8ea2ada1> <8ea2adfe> 7124\n<8ea2aea1> <8ea2aefe> 7218\n<8ea2afa1> <8ea2affe> 7312\n<8ea2b0a1> <8ea2b0fe> 7406\n<8ea2b1a1> <8ea2b1fe> 7500\n<8ea2b2a1> <8ea2b2fe> 7594\n<8ea2b3a1> <8ea2b3fe> 7688\n<8ea2b4a1> <8ea2b4fe> 7782\nendcidrange\n\n100 begincidrange\n<8ea2b5a1> <8ea2b5fe> 7876\n<8ea2b6a1> <8ea2b6fe> 7970\n<8ea2b7a1> <8ea2b7fe> 8064\n<8ea2b8a1> <8ea2b8fe> 8158\n<8ea2b9a1> <8ea2b9fe> 8252\n<8ea2baa1> <8ea2bafe> 8346\n<8ea2bba1> <8ea2bbfe> 8440\n<8ea2bca1> <8ea2bcfe> 8534\n<8ea2bda1> <8ea2bdfe> 8628\n<8ea2bea1> <8ea2befe> 8722\n<8ea2bfa1> <8ea2bffe> 8816\n<8ea2c0a1> <8ea2c0fe> 8910\n<8ea2c1a1> <8ea2c1fe> 9004\n<8ea2c2a1> <8ea2c2fe> 9098\n<8ea2c3a1> <8ea2c3fe> 9192\n<8ea2c4a1> <8ea2c4fe> 9286\n<8ea2c5a1> <8ea2c5fe> 9380\n<8ea2c6a1> <8ea2c6fe> 9474\n<8ea2c7a1> <8ea2c7fe> 9568\n<8ea2c8a1> <8ea2c8fe> 9662\n<8ea2c9a1> <8ea2c9fe> 9756\n<8ea2caa1> <8ea2cafe> 9850\n<8ea2cba1> <8ea2cbfe> 9944\n<8ea2cca1> <8ea2ccfe> 10038\n<8ea2cda1> <8ea2cdfe> 10132\n<8ea2cea1> <8ea2cefe> 10226\n<8ea2cfa1> <8ea2cffe> 10320\n<8ea2d0a1> <8ea2d0fe> 10414\n<8ea2d1a1> <8ea2d1fe> 10508\n<8ea2d2a1> <8ea2d2fe> 10602\n<8ea2d3a1> <8ea2d3fe> 10696\n<8ea2d4a1> <8ea2d4fe> 10790\n<8ea2d5a1> <8ea2d5fe> 10884\n<8ea2d6a1> <8ea2d6fe> 10978\n<8ea2d7a1> <8ea2d7fe> 11072\n<8ea2d8a1> <8ea2d8fe> 11166\n<8ea2d9a1> <8ea2d9fe> 11260\n<8ea2daa1> <8ea2dafe> 11354\n<8ea2dba1> <8ea2dbfe> 11448\n<8ea2dca1> <8ea2dcfe> 11542\n<8ea2dda1> <8ea2ddfe> 11636\n<8ea2dea1> <8ea2defe> 11730\n<8ea2dfa1> <8ea2dffe> 11824\n<8ea2e0a1> <8ea2e0fe> 11918\n<8ea2e1a1> <8ea2e1fe> 12012\n<8ea2e2a1> <8ea2e2fe> 12106\n<8ea2e3a1> <8ea2e3fe> 12200\n<8ea2e4a1> <8ea2e4fe> 12294\n<8ea2e5a1> <8ea2e5fe> 12388\n<8ea2e6a1> <8ea2e6fe> 12482\n<8ea2e7a1> <8ea2e7fe> 12576\n<8ea2e8a1> <8ea2e8fe> 12670\n<8ea2e9a1> <8ea2e9fe> 12764\n<8ea2eaa1> <8ea2eafe> 12858\n<8ea2eba1> <8ea2ebfe> 12952\n<8ea2eca1> <8ea2ecfe> 13046\n<8ea2eda1> <8ea2edfe> 13140\n<8ea2eea1> <8ea2eefe> 13234\n<8ea2efa1> <8ea2effe> 13328\n<8ea2f0a1> <8ea2f0fe> 13422\n<8ea2f1a1> <8ea2f1fe> 13516\n<8ea2f2a1> <8ea2f2c4> 13610\n<a1a1> <a1ab> 99\n<a1ac> <a1ac> 13646\n<a1ad> <a1ba> 111\n<a1bb> <a1bb> 124\n<a1bc> <a1bc> 126\n<a1bd> <a1bd> 126\n<a1be> <a1bf> 130\n<a1c0> <a1c1> 130\n<a1c2> <a1c3> 134\n<a1c4> <a1c5> 134\n<a1c6> <a1c7> 138\n<a1c8> <a1c9> 138\n<a1ca> <a1cb> 142\n<a1cc> <a1cd> 142\n<a1ce> <a1cf> 146\n<a1d0> <a1d1> 146\n<a1d2> <a1d3> 150\n<a1d4> <a1d5> 150\n<a1d6> <a1d7> 154\n<a1d8> <a1d9> 154\n<a1da> <a1db> 158\n<a1dc> <a1fe> 158\n<a2a1> <a2c3> 193\n<a2c4> <a2c4> 13647\n<a2c5> <a2fe> 229\n<a3a1> <a3ce> 287\n<a4a1> <a4fe> 333\n<a5a1> <a5ec> 427\n<a5ee> <a5f0> 503\n<a6a1> <a6be> 506\n<a7a1> <a7a1> 595\n<a7a2> <a7a4> 536\n<a7a5> <a7a5> 596\n<a7a6> <a7a6> 539\n<a7a7> <a7a7> 602\n<a7a8> <a7a8> 540\n<a7a9> <a7ac> 603\n<a7ad> <a7af> 541\nendcidrange\n\n100 begincidrange\n<a7b0> <a7b0> 607\n<a7b1> <a7b1> 5998\n<a7b2> <a7b2> 608\n<a7b3> <a7b3> 610\n<a7b4> <a7b4> 544\n<a7b5> <a7b5> 611\n<a7b6> <a7b6> 5999\n<a7b7> <a7b7> 545\n<a7b8> <a7b9> 612\n<a7ba> <a7ba> 546\n<a7bb> <a7bb> 6000\n<a7bc> <a7bc> 547\n<a7bd> <a7bd> 614\n<a7be> <a7be> 633\n<a7bf> <a7bf> 6005\n<a7c0> <a7c1> 634\n<a7c2> <a7c2> 548\n<a7c3> <a7c6> 636\n<a7c7> <a7c7> 549\n<a7c8> <a7cb> 642\n<a7cc> <a7cc> 6006\n<a7cd> <a7cd> 646\n<a7ce> <a7ce> 550\n<a7cf> <a7d0> 648\n<a7d1> <a7d2> 652\n<a7d3> <a7d5> 551\n<a7d6> <a7d8> 654\n<a7d9> <a7da> 554\n<a7db> <a7db> 6007\n<a7dc> <a7df> 720\n<a7e0> <a7e0> 725\n<a7e1> <a7e1> 556\n<a7e2> <a7e5> 726\n<a7e6> <a7e6> 557\n<a7e7> <a7ed> 730\n<a7ee> <a7ee> 6026\n<a7ef> <a7f2> 737\n<a7f3> <a7f3> 6028\n<a7f4> <a7f8> 741\n<a7f9> <a7f9> 6029\n<a7fa> <a7fd> 746\n<a7fe> <a7fe> 854\n<a8a1> <a8a6> 855\n<a8a7> <a8a7> 862\n<a8a8> <a8a8> 866\n<a8a9> <a8aa> 558\n<a8ab> <a8b2> 867\n<a8b3> <a8b3> 6066\n<a8b4> <a8b6> 875\n<a8b7> <a8ba> 1014\n<a8bb> <a8bb> 6162\n<a8bc> <a8be> 1018\n<a8bf> <a8c3> 1022\n<a8c4> <a8cc> 1029\n<a8cd> <a8cd> 6163\n<a8ce> <a8ce> 6168\n<a8cf> <a8d2> 1039\n<a8d3> <a8d3> 6169\n<a8d4> <a8d9> 1288\n<a8da> <a8da> 6375\n<a8db> <a8e2> 1294\n<a8e3> <a8e3> 560\n<a8e4> <a8e4> 1307\n<a8e5> <a8e7> 1312\n<a8e8> <a8eb> 1686\n<a8ec> <a8ec> 561\n<a8ed> <a8f0> 1695\n<a8f1> <a8fb> 2086\n<a8fc> <a8fe> 2549\n<a9a1> <a9a1> 7731\n<a9a2> <a9a2> 2552\n<a9a3> <a9a3> 7732\n<a9a4> <a9a5> 2553\n<a9a6> <a9ab> 3041\n<a9ac> <a9ae> 3515\n<a9af> <a9af> 9056\n<a9b0> <a9b0> 9746\n<a9b1> <a9b3> 3963\n<a9b4> <a9b5> 4352\n<a9b6> <a9b6> 4745\n<a9b7> <a9b8> 5042\n<a9b9> <a9b9> 12045\n<c2a1> <c2c1> 562\n<c4a1> <c4fe> 595\n<c5a1> <c5fe> 689\n<c6a1> <c6fe> 783\n<c7a1> <c7fe> 877\n<c8a1> <c8fe> 971\n<c9a1> <c9fe> 1065\n<caa1> <cafe> 1159\n<cba1> <cbfe> 1253\n<cca1> <ccfe> 1347\n<cda1> <cdfe> 1441\n<cea1> <cefe> 1535\n<cfa1> <cffe> 1629\n<d0a1> <d0fe> 1723\n<d1a1> <d1fe> 1817\n<d2a1> <d2fe> 1911\n<d3a1> <d3fe> 2005\n<d4a1> <d4fe> 2099\nendcidrange\n\n41 begincidrange\n<d5a1> <d5fe> 2193\n<d6a1> <d6fe> 2287\n<d7a1> <d7fe> 2381\n<d8a1> <d8fe> 2475\n<d9a1> <d9fe> 2569\n<daa1> <dafe> 2663\n<dba1> <dbfe> 2757\n<dca1> <dcfe> 2851\n<dda1> <ddfe> 2945\n<dea1> <defe> 3039\n<dfa1> <dffe> 3133\n<e0a1> <e0fe> 3227\n<e1a1> <e1fe> 3321\n<e2a1> <e2fe> 3415\n<e3a1> <e3fe> 3509\n<e4a1> <e4fe> 3603\n<e5a1> <e5fe> 3697\n<e6a1> <e6fe> 3791\n<e7a1> <e7fe> 3885\n<e8a1> <e8fe> 3979\n<e9a1> <e9fe> 4073\n<eaa1> <eafe> 4167\n<eba1> <ebfe> 4261\n<eca1> <ecfe> 4355\n<eda1> <edfe> 4449\n<eea1> <eefe> 4543\n<efa1> <effe> 4637\n<f0a1> <f0fe> 4731\n<f1a1> <f1fe> 4825\n<f2a1> <f2fe> 4919\n<f3a1> <f3fe> 5013\n<f4a1> <f4fe> 5107\n<f5a1> <f5fe> 5201\n<f6a1> <f6fe> 5295\n<f7a1> <f7fe> 5389\n<f8a1> <f8fe> 5483\n<f9a1> <f9fe> 5577\n<faa1> <fafe> 5671\n<fba1> <fbfe> 5765\n<fca1> <fcfe> 5859\n<fda1> <fdcb> 5953\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/CNS1-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (CNS1-H)\n%%Title: (CNS1-H Adobe CNS1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 0 def\nend def\n\n/CMapName /CNS1-H def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 700 def\n/XUID [1 10 25384] def\n\n/WMode 0 def\n\n1 begincodespacerange\n  <2121> <7E7E>\nendcodespacerange\n\n100 begincidrange\n<2121> <217e> 99\n<2221> <227e> 193\n<2321> <234e> 287\n<2421> <247e> 333\n<2521> <256c> 427\n<256e> <2570> 503\n<2621> <263e> 506\n<2721> <2721> 595\n<2722> <2724> 536\n<2725> <2725> 596\n<2726> <2726> 539\n<2727> <2727> 602\n<2728> <2728> 540\n<2729> <272c> 603\n<272d> <272f> 541\n<2730> <2730> 607\n<2731> <2731> 5998\n<2732> <2732> 608\n<2733> <2733> 610\n<2734> <2734> 544\n<2735> <2735> 611\n<2736> <2736> 5999\n<2737> <2737> 545\n<2738> <2739> 612\n<273a> <273a> 546\n<273b> <273b> 6000\n<273c> <273c> 547\n<273d> <273d> 614\n<273e> <273e> 633\n<273f> <273f> 6005\n<2740> <2741> 634\n<2742> <2742> 548\n<2743> <2746> 636\n<2747> <2747> 549\n<2748> <274b> 642\n<274c> <274c> 6006\n<274d> <274d> 646\n<274e> <274e> 550\n<274f> <2750> 648\n<2751> <2752> 652\n<2753> <2755> 551\n<2756> <2758> 654\n<2759> <275a> 554\n<275b> <275b> 6007\n<275c> <275f> 720\n<2760> <2760> 725\n<2761> <2761> 556\n<2762> <2765> 726\n<2766> <2766> 557\n<2767> <276d> 730\n<276e> <276e> 6026\n<276f> <2772> 737\n<2773> <2773> 6028\n<2774> <2778> 741\n<2779> <2779> 6029\n<277a> <277d> 746\n<277e> <277e> 854\n<2821> <2826> 855\n<2827> <2827> 862\n<2828> <2828> 866\n<2829> <282a> 558\n<282b> <2832> 867\n<2833> <2833> 6066\n<2834> <2836> 875\n<2837> <283a> 1014\n<283b> <283b> 6162\n<283c> <283e> 1018\n<283f> <2843> 1022\n<2844> <284c> 1029\n<284d> <284d> 6163\n<284e> <284e> 6168\n<284f> <2852> 1039\n<2853> <2853> 6169\n<2854> <2859> 1288\n<285a> <285a> 6375\n<285b> <2862> 1294\n<2863> <2863> 560\n<2864> <2864> 1307\n<2865> <2867> 1312\n<2868> <286b> 1686\n<286c> <286c> 561\n<286d> <2870> 1695\n<2871> <287b> 2086\n<287c> <287e> 2549\n<2921> <2921> 7731\n<2922> <2922> 2552\n<2923> <2923> 7732\n<2924> <2925> 2553\n<2926> <292b> 3041\n<292c> <292e> 3515\n<292f> <292f> 9056\n<2930> <2930> 9746\n<2931> <2933> 3963\n<2934> <2935> 4352\n<2936> <2936> 4745\n<2937> <2938> 5042\n<2939> <2939> 12045\n<4221> <4241> 562\n<4421> <447e> 595\n<4521> <457e> 689\nendcidrange\n\n56 begincidrange\n<4621> <467e> 783\n<4721> <477e> 877\n<4821> <487e> 971\n<4921> <497e> 1065\n<4a21> <4a7e> 1159\n<4b21> <4b7e> 1253\n<4c21> <4c7e> 1347\n<4d21> <4d7e> 1441\n<4e21> <4e7e> 1535\n<4f21> <4f7e> 1629\n<5021> <507e> 1723\n<5121> <517e> 1817\n<5221> <527e> 1911\n<5321> <537e> 2005\n<5421> <547e> 2099\n<5521> <557e> 2193\n<5621> <567e> 2287\n<5721> <577e> 2381\n<5821> <587e> 2475\n<5921> <597e> 2569\n<5a21> <5a7e> 2663\n<5b21> <5b7e> 2757\n<5c21> <5c7e> 2851\n<5d21> <5d7e> 2945\n<5e21> <5e7e> 3039\n<5f21> <5f7e> 3133\n<6021> <607e> 3227\n<6121> <617e> 3321\n<6221> <627e> 3415\n<6321> <637e> 3509\n<6421> <647e> 3603\n<6521> <657e> 3697\n<6621> <667e> 3791\n<6721> <677e> 3885\n<6821> <687e> 3979\n<6921> <697e> 4073\n<6a21> <6a7e> 4167\n<6b21> <6b7e> 4261\n<6c21> <6c7e> 4355\n<6d21> <6d7e> 4449\n<6e21> <6e7e> 4543\n<6f21> <6f7e> 4637\n<7021> <707e> 4731\n<7121> <717e> 4825\n<7221> <727e> 4919\n<7321> <737e> 5013\n<7421> <747e> 5107\n<7521> <757e> 5201\n<7621> <767e> 5295\n<7721> <777e> 5389\n<7821> <787e> 5483\n<7921> <797e> 5577\n<7a21> <7a7e> 5671\n<7b21> <7b7e> 5765\n<7c21> <7c7e> 5859\n<7d21> <7d4b> 5953\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/CNS1-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (CNS1-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (CNS1-H)\n%%BeginResource: CMap (CNS1-V)\n%%Title: (CNS1-V Adobe CNS1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CNS1-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 0 def\nend def\n\n/CMapName /CNS1-V def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 940 def\n/XUID [1 10 25385] def\n\n/WMode 1 def\n\n12 begincidrange\n<212c> <212c> 13646\n<213b> <213b> 124\n<213d> <213d> 126\n<213e> <213f> 130\n<2142> <2143> 134\n<2146> <2147> 138\n<214a> <214b> 142\n<214e> <214f> 146\n<2152> <2153> 150\n<2156> <2157> 154\n<215a> <215b> 158\n<2244> <2244> 13647\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/CNS2-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (CNS2-H)\n%%Title: (CNS2-H Adobe CNS1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 0 def\nend def\n\n/CMapName /CNS2-H def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 800 def\n/XUID [1 10 25386] def\n\n/WMode 0 def\n\n1 begincodespacerange\n  <2121> <7E7E>\nendcodespacerange\n\n82 begincidrange\n<2121> <217e> 5996\n<2221> <227e> 6090\n<2321> <237e> 6184\n<2421> <247e> 6278\n<2521> <257e> 6372\n<2621> <267e> 6466\n<2721> <277e> 6560\n<2821> <287e> 6654\n<2921> <297e> 6748\n<2a21> <2a7e> 6842\n<2b21> <2b7e> 6936\n<2c21> <2c7e> 7030\n<2d21> <2d7e> 7124\n<2e21> <2e7e> 7218\n<2f21> <2f7e> 7312\n<3021> <307e> 7406\n<3121> <317e> 7500\n<3221> <327e> 7594\n<3321> <337e> 7688\n<3421> <347e> 7782\n<3521> <357e> 7876\n<3621> <367e> 7970\n<3721> <377e> 8064\n<3821> <387e> 8158\n<3921> <397e> 8252\n<3a21> <3a7e> 8346\n<3b21> <3b7e> 8440\n<3c21> <3c7e> 8534\n<3d21> <3d7e> 8628\n<3e21> <3e7e> 8722\n<3f21> <3f7e> 8816\n<4021> <407e> 8910\n<4121> <417e> 9004\n<4221> <427e> 9098\n<4321> <437e> 9192\n<4421> <447e> 9286\n<4521> <457e> 9380\n<4621> <467e> 9474\n<4721> <477e> 9568\n<4821> <487e> 9662\n<4921> <497e> 9756\n<4a21> <4a7e> 9850\n<4b21> <4b7e> 9944\n<4c21> <4c7e> 10038\n<4d21> <4d7e> 10132\n<4e21> <4e7e> 10226\n<4f21> <4f7e> 10320\n<5021> <507e> 10414\n<5121> <517e> 10508\n<5221> <527e> 10602\n<5321> <537e> 10696\n<5421> <547e> 10790\n<5521> <557e> 10884\n<5621> <567e> 10978\n<5721> <577e> 11072\n<5821> <587e> 11166\n<5921> <597e> 11260\n<5a21> <5a7e> 11354\n<5b21> <5b7e> 11448\n<5c21> <5c7e> 11542\n<5d21> <5d7e> 11636\n<5e21> <5e7e> 11730\n<5f21> <5f7e> 11824\n<6021> <607e> 11918\n<6121> <617e> 12012\n<6221> <627e> 12106\n<6321> <637e> 12200\n<6421> <647e> 12294\n<6521> <657e> 12388\n<6621> <667e> 12482\n<6721> <677e> 12576\n<6821> <687e> 12670\n<6921> <697e> 12764\n<6a21> <6a7e> 12858\n<6b21> <6b7e> 12952\n<6c21> <6c7e> 13046\n<6d21> <6d7e> 13140\n<6e21> <6e7e> 13234\n<6f21> <6f7e> 13328\n<7021> <707e> 13422\n<7121> <717e> 13516\n<7221> <7244> 13610\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/CNS2-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (CNS2-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (CNS2-H)\n%%BeginResource: CMap (CNS2-V)\n%%Title: (CNS2-V Adobe CNS1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CNS2-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 0 def\nend def\n\n/CMapName /CNS2-V def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 950 def\n/XUID [1 10 25387] def\n\n/WMode 1 def\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/ETHK-B5-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (ETHK-B5-H)\n%%Title: (ETHK-B5-H Adobe CNS1 6)\n%%Version: 2.006\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 6 def\nend def\n\n/CMapName /ETHK-B5-H def\n/CMapVersion 2.006 def\n/CMapType 1 def\n\n/XUID [1 10 25582] def\n\n/WMode 0 def\n\n2 begincodespacerange\n  <00>   <80>\n  <8740> <FEFE>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 1\nendnotdefrange\n\n100 begincidchar\n<8943> 17718\n<894c> 17723\n<894d> 17347\n<8951> 17306\n<89a6> 17314\n<89ab> 17388\n<89ac> 17777\n<89ad> 17387\n<89ae> 17778\n<89cf> 17340\n<89d9> 17308\n<89da> 17815\n<89db> 17310\n<89dc> 17816\n<89dd> 17311\n<89e1> 17313\n<89e2> 17820\n<89e3> 17315\n<89fa> 17321\n<8a40> 17845\n<8a41> 17161\n<8a4d> 17846\n<8a5a> 17847\n<8a5e> 17848\n<8a71> 17849\n<8a76> 17214\n<8a77> 17850\n<8a7a> 17851\n<8a7b> 17219\n<8a7c> 17852\n<8a7d> 17221\n<8a7e> 17853\n<8aa8> 17854\n<8ab6> 17855\n<8ab7> 17245\n<8ab8> 17856\n<8ab9> 17247\n<8acc> 17857\n<8ae6> 17860\n<8ae7> 17371\n<8b40> 17883\n<8b45> 17294\n<8b46> 17886\n<8b47> 17295\n<8b48> 17887\n<8b49> 17296\n<8b4a> 17888\n<8b4b> 17297\n<8b4c> 17889\n<8b58> 17303\n<8b59> 17896\n<8b5a> 17304\n<8b5b> 17348\n<8b61> 17319\n<8b68> 17324\n<8c62> 19022\n<8cdb> 19023\n<8cdc> 18964\n<8d40> 19057\n<8d62> 17338\n<8d68> 17339\n<8d69> 17312\n<8d6a> 17341\n<8d6e> 17342\n<8d76> 17343\n<8d7a> 17344\n<8d7b> 17981\n<8d7c> 17345\n<8da5> 17346\n<8da8> 17337\n<8da9> 17325\n<8db6> 17351\n<8dc3> 17352\n<8dfa> 17401\n<8e45> 18072\n<8e69> 4181\n<8e6a> 14164\n<8e6f> 11752\n<8e76> 18075\n<8e7b> 18076\n<8e7e> 289\n<8ea6> 18077\n<8eab> 4203\n<8eb4> 4902\n<8eb8> 18078\n<8ec9> 18079\n<8ecd> 1643\n<8ed0> 4910\n<8ee5> 18080\n<8eef> 18081\n<8ef6> 18082\n<8f57> 3381\n<8f58> 14296\n<8f59> 18083\n<8f5f> 18084\n<8f67> 18085\n<8f68> 14309\n<8f69> 10178\n<8f6e> 8877\n<8f79> 18086\nendcidchar\n\n100 begincidchar\n<8fb0> 18087\n<8fc5> 18088\n<8fc6> 14368\n<8fc7> 18089\n<8fca> 18090\n<8fcb> 4940\n<8fcc> 16377\n<8fda> 18091\n<8fe3> 18092\n<8ffc> 18093\n<8ffd> 14420\n<8ffe> 2510\n<9055> 18094\n<906d> 3015\n<906e> 14466\n<906f> 18098\n<907a> 14057\n<90a6> 18099\n<90b8> 18100\n<90dc> 5009\n<90f1> 5796\n<9165> 18101\n<916e> 18102\n<917e> 18103\n<91a1> 14633\n<91a2> 18104\n<91bf> 12402\n<91c8> 18105\n<9244> 14728\n<9264> 18106\n<926d> 18107\n<92b1> 284\n<92b2> 283\n<92c8> 16300\n<92d1> 10620\n<92e5> 18108\n<92f2> 18109\n<9368> 18110\n<93aa> 18111\n<93c2> 18112\n<93e5> 18113\n<93e8> 18114\n<93eb> 18115\n<9446> 18116\n<9447> 7430\n<9479> 18117\n<94ca> 10657\n<94cb> 18118\n<954d> 18119\n<955a> 18120\n<955f> 18121\n<95c6> 18122\n<95d9> 6171\n<9644> 15919\n<9651> 18123\n<966a> 18124\n<96d4> 18125\n<96ed> 15478\n<96fc> 11044\n<986f> 18128\n<9877> 15705\n<987a> 15706\n<98a3> 15707\n<98af> 15708\n<98b4> 17354\n<98b5> 18154\n<98b6> 15709\n<98b7> 18155\n<98b8> 17356\n<98b9> 15710\n<98ba> 18156\n<98bb> 17402\n<98bc> 18157\n<98c2> 15713\n<98c3> 18161\n<98c4> 15714\n<98c5> 18162\n<98d2> 17357\n<98da> 18178\n<98db> 17361\n<98df> 17364\n<98e3> 15717\n<98e7> 15718\n<98ed> 15719\n<98f0> 15720\n<98f1> 18195\n<98f2> 15721\n<98f3> 18196\n<98fc> 15722\n<98fd> 18203\n<98fe> 17367\n<9942> 17404\n<9943> 15723\n<9944> 18206\n<9945> 15724\n<9946> 18207\n<9947> 17368\n<994f> 15725\n<9954> 17369\n<995c> 17370\nendcidchar\n\n100 begincidchar\n<9964> 17372\n<996a> 15726\n<996e> 15727\n<9975> 15728\n<9978> 15729\n<99a1> 18255\n<99a2> 15730\n<99a3> 18256\n<99a4> 17349\n<99a5> 18257\n<99a6> 17350\n<99ae> 15731\n<99b2> 17374\n<99b6> 15732\n<99ba> 15733\n<99ca> 17376\n<99cd> 17378\n<99d3> 17379\n<99d6> 17381\n<99df> 17375\n<99e2> 15734\n<99e3> 18308\n<99e4> 17323\n<99e5> 18309\n<99e6> 17383\n<99e7> 18310\n<99e8> 17385\n<99ef> 17405\n<99f4> 15735\n<9a4a> 15736\n<9a4b> 18341\n<9a4c> 15737\n<9a59> 15738\n<9a5f> 17327\n<9a60> 18359\n<9a61> 15739\n<9a66> 17389\n<9a67> 18364\n<9a68> 15740\n<9a69> 17390\n<9a6a> 18365\n<9a6b> 17407\n<9a73> 15741\n<9a74> 18373\n<9a75> 17393\n<9a7e> 15742\n<9aa3> 17395\n<9aa4> 18384\n<9aa5> 17394\n<9aa9> 17400\n<9aaa> 17396\n<9ab2> 15743\n<9ab7> 15744\n<9ab8> 18399\n<9ab9> 15745\n<9aba> 18400\n<9abb> 15746\n<9abc> 18401\n<9abd> 17335\n<9ac7> 15747\n<9ad0> 15748\n<9ad1> 18419\n<9ad2> 15749\n<9ae2> 15753\n<9ae3> 18432\n<9ae4> 15754\n<9ae8> 15755\n<9ae9> 17328\n<9aee> 17330\n<9af2> 15756\n<9af6> 15757\n<9afb> 15758\n<9b46> 15759\n<9b4a> 15760\n<9b54> 15762\n<9b58> 15763\n<9b59> 18474\n<9b5a> 15764\n<9b5b> 18475\n<9b5c> 15765\n<9b5d> 18476\n<9b60> 18477\n<9b76> 12112\n<9b77> 15773\n<9b78> 5925\n<9b7b> 13037\n<9b7c> 15776\n<9b7d> 18496\n<9b7e> 15777\n<9ba1> 15778\n<9ba2> 18497\n<9bab> 18500\n<9bac> 15785\n<9baf> 15786\n<9bbe> 15795\n<9bbf> 18509\n<9bc6> 10969\n<9bca> 15803\n<9bcb> 18513\n<9bcc> 15804\nendcidchar\n\n100 begincidchar\n<9bcd> 18514\n<9bce> 17360\n<9bcf> 18515\n<9bd2> 18516\n<9bd3> 15807\n<9bd4> 18517\n<9bd5> 15808\n<9bdd> 15812\n<9bde> 7188\n<9bdf> 15813\n<9be0> 18522\n<9be1> 15814\n<9be2> 18523\n<9be3> 15815\n<9be7> 15816\n<9be8> 18527\n<9bec> 16890\n<9bed> 18528\n<9bf3> 15823\n<9bf6> 4841\n<9bf7> 18534\n<9bfa> 18535\n<9c42> 11438\n<9c43> 18538\n<9c47> 18539\n<9c48> 15835\n<9c49> 18540\n<9c4a> 15836\n<9c53> 6756\n<9c54> 18543\n<9c55> 15844\n<9c56> 18544\n<9c5c> 18545\n<9c5d> 15850\n<9c60> 15851\n<9c61> 18548\n<9c62> 5124\n<9c63> 18549\n<9c67> 18550\n<9c68> 8996\n<9c69> 18551\n<9c6a> 15857\n<9c6b> 13418\n<9c6c> 18552\n<9c6d> 15858\n<9c6e> 18553\n<9c77> 8849\n<9c78> 18556\n<9c79> 15866\n<9c7a> 18557\n<9c7d> 18558\n<9c7e> 15869\n<9ca5> 15872\n<9caa> 18563\n<9cab> 15875\n<9cac> 18564\n<9cbb> 18567\n<9cbc> 6023\n<9cbd> 2399\n<9cce> 18571\n<9ccf> 15903\n<9cd0> 7833\n<9cdb> 18576\n<9ce6> 18577\n<9cea> 18578\n<9ced> 18579\n<9cfd> 15938\n<9cfe> 18583\n<9d40> 17384\n<9d46> 15939\n<9d49> 15940\n<9d4e> 18593\n<9d4f> 15944\n<9d50> 18594\n<9d51> 15945\n<9d55> 15946\n<9d56> 18598\n<9d57> 9665\n<9d5a> 3340\n<9d61> 17353\n<9d62> 15948\n<9d63> 18607\n<9d64> 15949\n<9d78> 17397\n<9d79> 15950\n<9d7e> 15951\n<9da9> 18635\n<9daa> 15956\n<9dab> 18636\n<9db0> 15960\n<9db3> 15961\n<9db4> 18641\n<9db5> 15962\n<9db6> 18642\n<9db7> 15963\n<9dbe> 18647\n<9dc3> 15968\n<9dc4> 1510\n<9dc9> 18652\n<9dca> 15972\nendcidchar\n\n100 begincidchar\n<9dd2> 18655\n<9dfc> 18660\n<9e43> 18661\n<9e5f> 18662\n<9e63> 18663\n<9e68> 16054\n<9e69> 18666\n<9e6a> 16055\n<9e71> 16056\n<9e72> 18673\n<9e73> 16057\n<9e79> 18677\n<9e7a> 16060\n<9e7b> 18678\n<9e7c> 16061\n<9e7d> 18679\n<9e7e> 16062\n<9ea3> 18680\n<9ea9> 1832\n<9eaa> 16069\n<9eab> 18683\n<9eae> 18684\n<9eb4> 16075\n<9eb5> 18687\n<9eb8> 18688\n<9eb9> 16078\n<9ebc> 16079\n<9ec6> 18696\n<9ecd> 16089\n<9ed2> 18701\n<9ed3> 16092\n<9eef> 9398\n<9ef2> 18706\n<9efb> 18710\n<9efc> 16124\n<9efd> 6150\n<9efe> 16126\n<9f43> 18711\n<9f48> 18712\n<9f60> 13585\n<9f66> 14661\n<9f70> 18717\n<9fb5> 18718\n<9fbb> 18719\n<9fbf> 18720\n<9fc0> 16212\n<9fc1> 18721\n<9fcb> 3970\n<9fcc> 18722\n<9fd4> 18723\n<9fd8> 14910\n<9fe4> 18724\n<9ff9> 18725\n<a040> 18726\n<a047> 18727\n<a055> 18728\n<a063> 14353\n<a06d> 18729\n<a077> 1522\n<a07b> 18730\n<a0a1> 16330\n<a0a2> 18731\n<a0a7> 18732\n<a0c5> 18733\n<a0d0> 18734\n<a0d5> 15086\n<a0df> 9341\n<a0e3> 18735\n<a0e4> 15049\n<a0ee> 17332\n<a0f2> 17336\n<a1f6> 248\n<a1f7> 247\n<acfe> 2431\n<be52> 4308\n<c2cb> 5221\n<c3b9> 5551\n<c3ba> 5550\n<c456> 5495\n<c6df> 6036\n<c8e0> 18846\n<c8e9> 18847\n<c8f1> 18848\n<c94a> 628\n<c9be> 6039\n<caf7> 6134\n<d6cc> 8788\n<d77a> 8889\n<dadf> 8142\n<ddfc> 9089\n<ebf1> 10926\n<ecde> 11073\n<eeeb> 12308\n<f056> 11719\n<f0cb> 11361\n<f16b> 12640\n<f268> 12783\n<f4b5> 12526\n<f663> 12900\n<f9c4> 13585\nendcidchar\n\n44 begincidchar\n<f9c5> 13629\n<f9c6> 13641\n<fa5f> 2106\n<fa66> 2557\n<fabd> 781\n<fac5> 363\n<fad5> 2144\n<fb48> 16002\n<fb53> 18760\n<fb6e> 18761\n<fba3> 18762\n<fbb8> 3107\n<fbbf> 18763\n<fbcd> 18764\n<fbf3> 6116\n<fbf9> 16014\n<fc4a> 18765\n<fc4f> 8495\n<fc52> 18766\n<fc63> 18767\n<fc6c> 16385\n<fc6d> 18768\n<fc75> 18769\n<fcb9> 4447\n<fccc> 18772\n<fce2> 3193\n<fce3> 18773\n<fcee> 18774\n<fcf1> 1219\n<fd49> 18775\n<fd6a> 18776\n<fdb7> 6333\n<fdb8> 3261\n<fdbb> 3237\n<fde3> 18777\n<fdf1> 3278\n<fdf2> 18778\n<fe52> 15728\n<fe6d> 18779\n<fe6e> 17055\n<fe6f> 3716\n<fe78> 18780\n<feaa> 288\n<fedd> 7080\nendcidchar\n\n100 begincidrange\n<20> <7e> 1\n<8740> <8765> 18965\n<8767> <8779> 19003\n<877a> <877e> 19088\n<87a1> <87df> 19093\n<8840> <8855> 17609\n<8856> <887e> 18785\n<88a1> <88a8> 18826\n<88a9> <88aa> 18844\n<8940> <8941> 17716\n<8946> <8949> 17719\n<894e> <8950> 17724\n<8952> <897e> 17727\n<89a1> <89a5> 17772\n<89b0> <89b2> 17779\n<89b5> <89bf> 17782\n<89c1> <89c3> 17793\n<89c5> <89ce> 17796\n<89d0> <89d8> 17806\n<89de> <89e0> 17817\n<89e4> <89e9> 17821\n<89ea> <89eb> 17317\n<89ec> <89f9> 17827\n<89fb> <89fe> 17841\n<8a43> <8a4c> 17163\n<8a4e> <8a59> 17174\n<8a5b> <8a5d> 17187\n<8a5f> <8a62> 17191\n<8a64> <8a70> 17196\n<8a72> <8a74> 17210\n<8a78> <8a79> 17216\n<8aa1> <8aa7> 17223\n<8aa9> <8aaa> 17231\n<8aac> <8ab0> 17234\n<8ab2> <8ab5> 17240\n<8abb> <8ac7> 17249\n<8ac9> <8acb> 17263\n<8ace> <8ad5> 17268\n<8ad6> <8ad7> 17858\n<8ad8> <8adc> 17278\n<8adf> <8ae5> 17285\n<8ae8> <8af4> 17861\n<8af6> <8afe> 17874\n<8b41> <8b42> 17292\n<8b43> <8b44> 17884\n<8b4d> <8b50> 17298\n<8b51> <8b53> 17890\n<8b55> <8b57> 17893\n<8b5c> <8b60> 17897\n<8b62> <8b67> 17902\n<8b69> <8b7e> 17908\n<8ba1> <8bbf> 17930\n<8bc0> <8bdc> 17631\n<8bde> <8bfd> 17660\n<8c40> <8c61> 18849\n<8c63> <8c7e> 18883\n<8ca1> <8ca5> 18911\n<8ca7> <8cc5> 18916\n<8cc9> <8ccc> 18947\n<8cce> <8cda> 18951\n<8cdd> <8ce4> 19024\n<8ce6> <8cfe> 19032\n<8d42> <8d5f> 19058\n<8d60> <8d61> 17961\n<8d63> <8d67> 17963\n<8d6b> <8d6d> 17968\n<8d6f> <8d75> 17971\n<8d77> <8d79> 17978\n<8d7d> <8d7e> 17982\n<8da1> <8da4> 17984\n<8da6> <8da7> 17988\n<8daa> <8db5> 17990\n<8db7> <8dc2> 18002\n<8dc4> <8df9> 18014\n<8dfb> <8dfe> 18068\n<8e40> <8e44> 14123\n<8e46> <8e68> 14128\n<8e6b> <8e6c> 18073\n<8e6d> <8e6e> 14166\n<8e70> <8e75> 14169\n<8e77> <8e7a> 14175\n<8e7c> <8e7d> 14180\n<8ea1> <8ea5> 14182\n<8ea7> <8eaa> 14187\n<8eac> <8eb3> 14192\n<8eb5> <8eb7> 14201\n<8eb9> <8ec8> 14205\n<8eca> <8ecc> 14221\n<8ece> <8ecf> 14225\n<8ed1> <8ee4> 14228\n<8ee6> <8eee> 14248\n<8ef0> <8ef5> 14257\n<8ef7> <8efe> 14264\n<8f40> <8f56> 14272\n<8f5a> <8f5e> 14297\n<8f60> <8f66> 14302\n<8f6a> <8f6d> 14311\n<8f6f> <8f78> 14316\n<8f7a> <8f7e> 14327\n<8fa1> <8faf> 14332\nendcidrange\n\n100 begincidrange\n<8fb1> <8fc4> 14348\n<8fc8> <8fc9> 14369\n<8fcd> <8fd9> 14374\n<8fdb> <8fe2> 14387\n<8fe4> <8ffb> 14396\n<9040> <9054> 14422\n<9056> <905b> 14444\n<905c> <905e> 18095\n<905f> <906c> 14451\n<9070> <9079> 14467\n<907b> <907e> 14477\n<90a1> <90a5> 14481\n<90a7> <90b7> 14486\n<90b9> <90db> 14503\n<90dd> <90f0> 14539\n<90f2> <90fe> 14560\n<9140> <9164> 14573\n<9166> <916d> 14610\n<916f> <917d> 14618\n<91a3> <91be> 14634\n<91c0> <91c7> 14663\n<91c9> <91fe> 14672\n<9240> <9243> 14726\n<9245> <9263> 14731\n<9265> <926c> 14763\n<926e> <927e> 14772\n<92a1> <92ae> 14789\n<92af> <92b0> 281\n<92b3> <92c7> 14803\n<92c9> <92d0> 14825\n<92d2> <92e4> 14834\n<92e6> <92f1> 14853\n<92f3> <92fe> 14865\n<9340> <9367> 14877\n<9369> <937e> 14917\n<93a1> <93a9> 14939\n<93ab> <93c1> 14948\n<93c3> <93e4> 14971\n<93e6> <93e7> 15005\n<93e9> <93ea> 15008\n<93ec> <93fe> 15010\n<9440> <9445> 15029\n<9448> <9478> 15036\n<947a> <947e> 15086\n<94a1> <94c9> 15091\n<94cc> <94fe> 15134\n<9540> <954c> 15185\n<954e> <9559> 15198\n<955b> <955e> 15210\n<9560> <957e> 15215\n<95a1> <95c5> 15246\n<95c7> <95d8> 15283\n<95da> <95fe> 15302\n<9640> <9643> 15339\n<9645> <9650> 15344\n<9652> <9669> 15357\n<966b> <967e> 15382\n<96a1> <96d3> 15402\n<96d5> <96ec> 15453\n<96ee> <96fb> 15478\n<96fd> <96fe> 15493\n<9740> <977e> 15495\n<97a1> <97fe> 15558\n<9840> <9843> 15652\n<9844> <9845> 18126\n<9846> <986e> 15658\n<9870> <9874> 15700\n<9875> <9876> 18129\n<9878> <9879> 18131\n<987b> <987e> 18133\n<98a1> <98a2> 18137\n<98a4> <98ae> 18139\n<98b0> <98b3> 18150\n<98bd> <98be> 15711\n<98bf> <98c1> 18158\n<98c6> <98c7> 15715\n<98c8> <98d1> 18163\n<98d3> <98d7> 18173\n<98d8> <98d9> 17358\n<98dc> <98de> 18179\n<98e0> <98e2> 18182\n<98e4> <98e6> 18185\n<98e8> <98ec> 18188\n<98ee> <98ef> 18193\n<98f4> <98f5> 17365\n<98f6> <98fb> 18197\n<9940> <9941> 18204\n<9948> <994e> 18208\n<9950> <9953> 18215\n<9955> <995b> 18219\n<995d> <9963> 18226\n<9965> <9969> 18233\n<996b> <996d> 18238\n<996f> <9974> 18241\n<9976> <9977> 18247\n<9979> <997e> 18249\n<99a7> <99ad> 18258\n<99af> <99b1> 18265\n<99b3> <99b5> 18268\n<99b7> <99b9> 18271\nendcidrange\n\n100 begincidrange\n<99bb> <99c9> 18274\n<99cb> <99cc> 18289\n<99ce> <99d2> 18291\n<99d4> <99d5> 18296\n<99d7> <99de> 18298\n<99e0> <99e1> 18306\n<99e9> <99ee> 18311\n<99f0> <99f3> 18317\n<99f5> <99fe> 18321\n<9a40> <9a49> 18331\n<9a4d> <9a58> 18342\n<9a5a> <9a5e> 18354\n<9a62> <9a65> 18360\n<9a6c> <9a72> 18366\n<9a76> <9a7d> 18374\n<9aa1> <9aa2> 18382\n<9aa6> <9aa8> 18385\n<9aab> <9ab1> 18388\n<9ab3> <9ab6> 18395\n<9abe> <9ac6> 18402\n<9ac8> <9acf> 18411\n<9ad3> <9ad8> 18420\n<9ad9> <9adb> 15750\n<9adc> <9ae1> 18426\n<9ae5> <9ae7> 18433\n<9aea> <9aed> 18436\n<9aef> <9af1> 18440\n<9af3> <9af5> 18443\n<9af7> <9afa> 18446\n<9afc> <9afe> 18450\n<9b40> <9b45> 18453\n<9b47> <9b49> 18459\n<9b4b> <9b53> 18462\n<9b55> <9b57> 18471\n<9b5e> <9b5f> 15766\n<9b62> <9b6f> 18478\n<9b70> <9b73> 15768\n<9b74> <9b75> 18492\n<9b79> <9b7a> 18494\n<9ba3> <9ba4> 15779\n<9ba5> <9ba6> 18498\n<9ba7> <9baa> 15781\n<9bad> <9bae> 18501\n<9bb0> <9bb1> 18503\n<9bb2> <9bb9> 15787\n<9bba> <9bbd> 18505\n<9bc0> <9bc5> 15796\n<9bc7> <9bc9> 18510\n<9bd0> <9bd1> 15805\n<9bd6> <9bd7> 18518\n<9bd8> <9bda> 15809\n<9bdb> <9bdc> 18520\n<9be4> <9be6> 18524\n<9be9> <9beb> 15817\n<9bee> <9bef> 15821\n<9bf0> <9bf2> 18529\n<9bf4> <9bf5> 18532\n<9bf8> <9bf9> 15825\n<9bfb> <9bfc> 15827\n<9bfd> <9bfe> 18536\n<9c40> <9c41> 15829\n<9c44> <9c46> 15832\n<9c4b> <9c4c> 18541\n<9c4d> <9c52> 15837\n<9c57> <9c5b> 15845\n<9c5e> <9c5f> 18546\n<9c64> <9c66> 15853\n<9c6f> <9c72> 15859\n<9c73> <9c74> 18554\n<9c75> <9c76> 15863\n<9c7b> <9c7c> 15867\n<9ca1> <9ca2> 15870\n<9ca3> <9ca4> 18559\n<9ca6> <9ca7> 18561\n<9ca8> <9ca9> 15873\n<9cad> <9cae> 15876\n<9caf> <9cb0> 18565\n<9cb1> <9cba> 15878\n<9cbe> <9cc2> 15890\n<9cc3> <9cc5> 18568\n<9cc6> <9ccd> 15895\n<9cd1> <9cd3> 15905\n<9cd4> <9cd7> 18572\n<9cd8> <9cda> 15908\n<9cdc> <9ce5> 15911\n<9ce7> <9ce9> 15921\n<9ceb> <9cec> 15924\n<9cee> <9cf9> 15926\n<9cfa> <9cfc> 18580\n<9d41> <9d45> 18584\n<9d47> <9d48> 18589\n<9d4a> <9d4b> 18591\n<9d4c> <9d4d> 15942\n<9d52> <9d54> 18595\n<9d58> <9d59> 18599\n<9d5b> <9d60> 18601\n<9d65> <9d77> 18608\n<9d7a> <9d7d> 18627\n<9da1> <9da4> 18631\n<9da5> <9da8> 15952\nendcidrange\n\n100 begincidrange\n<9dac> <9dad> 15957\n<9dae> <9daf> 18637\n<9db1> <9db2> 18639\n<9db8> <9dbb> 18643\n<9dbc> <9dbd> 15964\n<9dbf> <9dc0> 15966\n<9dc1> <9dc2> 18648\n<9dc5> <9dc6> 18650\n<9dc7> <9dc8> 15970\n<9dcb> <9dcc> 18653\n<9dcd> <9dd1> 15973\n<9dd3> <9dd5> 15978\n<9dd6> <9dd9> 18656\n<9dda> <9dfb> 15981\n<9dfd> <9dfe> 16015\n<9e40> <9e42> 16017\n<9e44> <9e5e> 16021\n<9e60> <9e62> 16049\n<9e64> <9e65> 16052\n<9e66> <9e67> 18664\n<9e6b> <9e70> 18667\n<9e74> <9e76> 18674\n<9e77> <9e78> 16058\n<9ea1> <9ea2> 16063\n<9ea4> <9ea6> 16065\n<9ea7> <9ea8> 18681\n<9eac> <9ead> 16070\n<9eaf> <9eb1> 16072\n<9eb2> <9eb3> 18685\n<9eb6> <9eb7> 16076\n<9eba> <9ebb> 18689\n<9ebd> <9ebe> 18691\n<9ebf> <9ec0> 16080\n<9ec1> <9ec3> 18693\n<9ec4> <9ec5> 16082\n<9ec7> <9eca> 16084\n<9ecb> <9ecc> 18697\n<9ece> <9ecf> 18699\n<9ed0> <9ed1> 16090\n<9ed4> <9ed5> 18702\n<9ed6> <9ed7> 16093\n<9ed8> <9ed9> 18704\n<9eda> <9eee> 16095\n<9ef0> <9ef1> 16117\n<9ef3> <9ef5> 16119\n<9ef6> <9ef8> 18707\n<9ef9> <9efa> 16122\n<9f40> <9f42> 16127\n<9f44> <9f47> 16130\n<9f49> <9f4a> 16134\n<9f4b> <9f4c> 18713\n<9f4d> <9f5f> 16136\n<9f61> <9f65> 16156\n<9f67> <9f68> 18715\n<9f69> <9f6f> 16163\n<9f71> <9f7e> 16170\n<9fa1> <9fb4> 16184\n<9fb6> <9fba> 16204\n<9fbc> <9fbe> 16209\n<9fc2> <9fca> 16213\n<9fcd> <9fd3> 16224\n<9fd5> <9fd7> 16232\n<9fd9> <9fe3> 16236\n<9fe5> <9ff8> 16247\n<9ffa> <9ffe> 16267\n<a041> <a046> 16272\n<a048> <a054> 16278\n<a056> <a062> 16291\n<a064> <a06c> 16305\n<a06e> <a076> 16314\n<a078> <a07a> 16324\n<a07c> <a07e> 16327\n<a0a3> <a0a6> 16331\n<a0a8> <a0c4> 16335\n<a0c6> <a0cf> 16364\n<a0d1> <a0d4> 16374\n<a0d6> <a0de> 16379\n<a0e0> <a0e2> 16389\n<a0e5> <a0e6> 16393\n<a0e7> <a0ed> 18736\n<a0ef> <a0f1> 18743\n<a0f3> <a0fe> 18746\n<a140> <a158> 99\n<a159> <a15c> 13743\n<a15d> <a17e> 128\n<a1a1> <a1f5> 162\n<a1f8> <a1fe> 249\n<a240> <a27e> 256\n<a2a1> <a2fe> 319\n<a340> <a37e> 413\n<a3a1> <a3bb> 476\n<a3bd> <a3bf> 503\n<a440> <a47e> 595\n<a4a1> <a4fe> 658\n<a540> <a57e> 752\n<a5a1> <a5fe> 815\n<a640> <a67e> 909\n<a6a1> <a6fe> 972\n<a740> <a77e> 1066\n<a7a1> <a7fe> 1129\nendcidrange\n\n100 begincidrange\n<a840> <a87e> 1223\n<a8a1> <a8fe> 1286\n<a940> <a97e> 1380\n<a9a1> <a9fe> 1443\n<aa40> <aa7e> 1537\n<aaa1> <aafe> 1600\n<ab40> <ab7e> 1694\n<aba1> <abfe> 1757\n<ac40> <ac7e> 1851\n<aca1> <acfd> 1914\n<ad40> <ad7e> 2007\n<ada1> <adfe> 2070\n<ae40> <ae7e> 2164\n<aea1> <aefe> 2227\n<af40> <af7e> 2321\n<afa1> <afcf> 2384\n<afd0> <affe> 2432\n<b040> <b07e> 2479\n<b0a1> <b0fe> 2542\n<b140> <b17e> 2636\n<b1a1> <b1fe> 2699\n<b240> <b27e> 2793\n<b2a1> <b2fe> 2856\n<b340> <b37e> 2950\n<b3a1> <b3fe> 3013\n<b440> <b47e> 3107\n<b4a1> <b4fe> 3170\n<b540> <b57e> 3264\n<b5a1> <b5fe> 3327\n<b640> <b67e> 3421\n<b6a1> <b6fe> 3484\n<b740> <b77e> 3578\n<b7a1> <b7fe> 3641\n<b840> <b87e> 3735\n<b8a1> <b8fe> 3798\n<b940> <b97e> 3892\n<b9a1> <b9fe> 3955\n<ba40> <ba7e> 4049\n<baa1> <bafe> 4112\n<bb40> <bb7e> 4206\n<bba1> <bbc7> 4269\n<bbc8> <bbfe> 4309\n<bc40> <bc7e> 4364\n<bca1> <bcfe> 4427\n<bd40> <bd7e> 4521\n<bda1> <bdfe> 4584\n<be40> <be51> 4678\n<be53> <be7e> 4696\n<bea1> <befe> 4740\n<bf40> <bf7e> 4834\n<bfa1> <bffe> 4897\n<c040> <c07e> 4991\n<c0a1> <c0fe> 5054\n<c140> <c17e> 5148\n<c1a1> <c1aa> 5211\n<c1ab> <c1fe> 5222\n<c240> <c27e> 5306\n<c2a1> <c2ca> 5369\n<c2cc> <c2fe> 5411\n<c340> <c360> 5462\n<c361> <c37e> 5496\n<c3a1> <c3b8> 5526\n<c3bb> <c3fe> 5552\n<c440> <c455> 5620\n<c457> <c47e> 5642\n<c4a1> <c4fe> 5682\n<c540> <c57e> 5776\n<c5a1> <c5fe> 5839\n<c640> <c67e> 5933\n<c6a1> <c6be> 506\n<c6bf> <c6d7> 537\n<c6d8> <c6de> 13747\n<c6e0> <c6fe> 13754\n<c740> <c77e> 13785\n<c7a1> <c7fe> 13848\n<c840> <c87e> 13942\n<c8a1> <c8d3> 14005\n<c8d4> <c8d6> 17606\n<c8d7> <c8df> 17692\n<c8e1> <c8e8> 17701\n<c8ea> <c8f0> 17709\n<c8f5> <c8fe> 18834\n<c940> <c949> 5996\n<c94b> <c96b> 6006\n<c96c> <c97e> 6040\n<c9a1> <c9bd> 6059\n<c9bf> <c9ec> 6088\n<c9ed> <c9fe> 6135\n<ca40> <ca7e> 6153\n<caa1> <caf6> 6216\n<caf8> <cafe> 6302\n<cb40> <cb7e> 6309\n<cba1> <cbfe> 6372\n<cc40> <cc7e> 6466\n<cca1> <ccfe> 6529\n<cd40> <cd7e> 6623\n<cda1> <cdfe> 6686\n<ce40> <ce7e> 6780\n<cea1> <cefe> 6843\n<cf40> <cf7e> 6937\nendcidrange\n\n100 begincidrange\n<cfa1> <cffe> 7000\n<d040> <d07e> 7094\n<d0a1> <d0fe> 7157\n<d140> <d17e> 7251\n<d1a1> <d1fe> 7314\n<d240> <d27e> 7408\n<d2a1> <d2fe> 7471\n<d340> <d37e> 7565\n<d3a1> <d3fe> 7628\n<d440> <d47e> 7722\n<d4a1> <d4fe> 7785\n<d540> <d57e> 7879\n<d5a1> <d5fe> 7942\n<d640> <d67e> 8036\n<d6a1> <d6cb> 8099\n<d6cd> <d6fe> 8143\n<d740> <d779> 8193\n<d77b> <d77e> 8251\n<d7a1> <d7fe> 8255\n<d840> <d87e> 8349\n<d8a1> <d8fe> 8412\n<d940> <d97e> 8506\n<d9a1> <d9fe> 8569\n<da40> <da7e> 8663\n<daa1> <dade> 8726\n<dae0> <dafe> 8789\n<db40> <db7e> 8820\n<dba1> <dba6> 8883\n<dba7> <dbfe> 8890\n<dc40> <dc7e> 8978\n<dca1> <dcfe> 9041\n<dd40> <dd7e> 9135\n<dda1> <ddfb> 9198\n<ddfd> <ddfe> 9289\n<de40> <de7e> 9291\n<dea1> <defe> 9354\n<df40> <df7e> 9448\n<dfa1> <dffe> 9511\n<e040> <e07e> 9605\n<e0a1> <e0fe> 9668\n<e140> <e17e> 9762\n<e1a1> <e1fe> 9825\n<e240> <e27e> 9919\n<e2a1> <e2fe> 9982\n<e340> <e37e> 10076\n<e3a1> <e3fe> 10139\n<e440> <e47e> 10233\n<e4a1> <e4fe> 10296\n<e540> <e57e> 10390\n<e5a1> <e5fe> 10453\n<e640> <e67e> 10547\n<e6a1> <e6fe> 10610\n<e740> <e77e> 10704\n<e7a1> <e7fe> 10767\n<e840> <e87e> 10861\n<e8a1> <e8a2> 10924\n<e8a3> <e8fe> 10927\n<e940> <e975> 11019\n<e976> <e97e> 11074\n<e9a1> <e9fe> 11083\n<ea40> <ea7e> 11177\n<eaa1> <eafe> 11240\n<eb40> <eb5a> 11334\n<eb5b> <eb7e> 11362\n<eba1> <ebf0> 11398\n<ebf2> <ebfe> 11478\n<ec40> <ec7e> 11491\n<eca1> <ecdd> 11554\n<ecdf> <ecfe> 11615\n<ed40> <ed7e> 11647\n<eda1> <eda9> 11710\n<edaa> <edfe> 11720\n<ee40> <ee7e> 11805\n<eea1> <eeea> 11868\n<eeec> <eefe> 11942\n<ef40> <ef7e> 11961\n<efa1> <effe> 12024\n<f040> <f055> 12118\n<f057> <f07e> 12140\n<f0a1> <f0ca> 12180\n<f0cc> <f0fe> 12222\n<f140> <f162> 12273\n<f163> <f16a> 12309\n<f16c> <f17e> 12317\n<f1a1> <f1fe> 12336\n<f240> <f267> 12430\n<f269> <f27e> 12470\n<f2a1> <f2c2> 12492\n<f2c3> <f2fe> 12527\n<f340> <f374> 12587\n<f375> <f37e> 12641\n<f3a1> <f3fe> 12651\n<f440> <f465> 12745\n<f466> <f47e> 12784\n<f4a1> <f4b4> 12809\n<f4b6> <f4fc> 12829\n<f4fd> <f4fe> 12901\n<f540> <f57e> 12903\n<f5a1> <f5fe> 12966\n<f640> <f662> 13060\nendcidrange\n\n65 begincidrange\n<f664> <f67e> 13095\n<f6a1> <f6fe> 13122\n<f740> <f77e> 13216\n<f7a1> <f7fe> 13279\n<f840> <f87e> 13373\n<f8a1> <f8fe> 13436\n<f940> <f976> 13530\n<f977> <f97e> 13586\n<f9a1> <f9c3> 13594\n<f9c7> <f9d1> 13630\n<f9d2> <f9d5> 13642\n<f9d6> <f9fe> 14056\n<fa40> <fa5e> 16395\n<fa60> <fa65> 16427\n<fa67> <fa7e> 16434\n<faa1> <faa8> 16458\n<faa9> <faaa> 18758\n<faab> <fabc> 16468\n<fabe> <fac4> 16487\n<fac6> <fad4> 16495\n<fad6> <fafe> 16511\n<fb40> <fb47> 16552\n<fb49> <fb52> 16561\n<fb54> <fb6d> 16572\n<fb6f> <fb7e> 16599\n<fba1> <fba2> 16615\n<fba4> <fbb7> 16618\n<fbb9> <fbbe> 16639\n<fbc0> <fbcc> 16645\n<fbce> <fbf2> 16658\n<fbf4> <fbf8> 16696\n<fbfa> <fbfe> 16702\n<fc40> <fc49> 16707\n<fc4b> <fc4e> 16717\n<fc50> <fc51> 16721\n<fc53> <fc62> 16723\n<fc64> <fc6b> 16739\n<fc6e> <fc74> 16749\n<fc76> <fc7e> 16756\n<fca1> <fcb8> 16765\n<fcba> <fcbb> 16789\n<fcbc> <fcbd> 18770\n<fcbe> <fccb> 16792\n<fccd> <fce1> 16807\n<fce4> <fced> 16829\n<fcef> <fcf0> 16839\n<fcf2> <fcfe> 16842\n<fd40> <fd48> 16855\n<fd4a> <fd69> 16864\n<fd6b> <fd7e> 16897\n<fda1> <fdb6> 16917\n<fdb9> <fdba> 16941\n<fdbc> <fde2> 16944\n<fde4> <fdf0> 16984\n<fdf3> <fdfe> 16998\n<fe40> <fe51> 17010\n<fe53> <fe6c> 17029\n<fe70> <fe77> 17057\n<fe79> <fe7e> 17065\n<fea1> <fea9> 17071\n<feab> <fedc> 17080\n<fede> <fedf> 18781\n<fee0> <feec> 17131\n<feed> <feee> 18783\n<feef> <fefe> 17144\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/ETHK-B5-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (ETHK-B5-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (ETHK-B5-H)\n%%BeginResource: CMap (ETHK-B5-V)\n%%Title: (ETHK-B5-V Adobe CNS1 6)\n%%Version: 13.004\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/ETHK-B5-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 6 def\nend def\n\n/CMapName /ETHK-B5-V def\n/CMapVersion 13.004 def\n/CMapType 1 def\n\n/XUID [1 10 25583] def\n\n/WMode 1 def\n\n13 begincidrange\n<a14b> <a14b> 13646\n<a15a> <a15a> 13743\n<a15c> <a15c> 13745\n<a15d> <a15e> 130\n<a161> <a162> 134\n<a165> <a166> 138\n<a169> <a16a> 142\n<a16d> <a16e> 146\n<a171> <a172> 150\n<a175> <a176> 154\n<a179> <a17a> 158\n<a1e3> <a1e3> 13647\n<c6e4> <c6e5> 14097\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/ETen-B5-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (ETen-B5-H)\n%%Title: (ETen-B5-H Adobe CNS1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 0 def\nend def\n\n/CMapName /ETen-B5-H def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 200 def\n/XUID [1 10 25390] def\n\n/WMode 0 def\n\n2 begincodespacerange\n  <00>   <80>\n  <A140> <FEFE>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 13648\nendnotdefrange\n\n100 begincidrange\n<20> <7e> 13648\n<a140> <a158> 99\n<a159> <a15c> 13743\n<a15d> <a17e> 128\n<a1a1> <a1f5> 162\n<a1f6> <a1f6> 248\n<a1f7> <a1f7> 247\n<a1f8> <a1fe> 249\n<a240> <a27e> 256\n<a2a1> <a2fe> 319\n<a340> <a37e> 413\n<a3a1> <a3bb> 476\n<a3bd> <a3bf> 503\n<a440> <a47e> 595\n<a4a1> <a4fe> 658\n<a540> <a57e> 752\n<a5a1> <a5fe> 815\n<a640> <a67e> 909\n<a6a1> <a6fe> 972\n<a740> <a77e> 1066\n<a7a1> <a7fe> 1129\n<a840> <a87e> 1223\n<a8a1> <a8fe> 1286\n<a940> <a97e> 1380\n<a9a1> <a9fe> 1443\n<aa40> <aa7e> 1537\n<aaa1> <aafe> 1600\n<ab40> <ab7e> 1694\n<aba1> <abfe> 1757\n<ac40> <ac7e> 1851\n<aca1> <acfd> 1914\n<acfe> <acfe> 2431\n<ad40> <ad7e> 2007\n<ada1> <adfe> 2070\n<ae40> <ae7e> 2164\n<aea1> <aefe> 2227\n<af40> <af7e> 2321\n<afa1> <afcf> 2384\n<afd0> <affe> 2432\n<b040> <b07e> 2479\n<b0a1> <b0fe> 2542\n<b140> <b17e> 2636\n<b1a1> <b1fe> 2699\n<b240> <b27e> 2793\n<b2a1> <b2fe> 2856\n<b340> <b37e> 2950\n<b3a1> <b3fe> 3013\n<b440> <b47e> 3107\n<b4a1> <b4fe> 3170\n<b540> <b57e> 3264\n<b5a1> <b5fe> 3327\n<b640> <b67e> 3421\n<b6a1> <b6fe> 3484\n<b740> <b77e> 3578\n<b7a1> <b7fe> 3641\n<b840> <b87e> 3735\n<b8a1> <b8fe> 3798\n<b940> <b97e> 3892\n<b9a1> <b9fe> 3955\n<ba40> <ba7e> 4049\n<baa1> <bafe> 4112\n<bb40> <bb7e> 4206\n<bba1> <bbc7> 4269\n<bbc8> <bbfe> 4309\n<bc40> <bc7e> 4364\n<bca1> <bcfe> 4427\n<bd40> <bd7e> 4521\n<bda1> <bdfe> 4584\n<be40> <be51> 4678\n<be52> <be52> 4308\n<be53> <be7e> 4696\n<bea1> <befe> 4740\n<bf40> <bf7e> 4834\n<bfa1> <bffe> 4897\n<c040> <c07e> 4991\n<c0a1> <c0fe> 5054\n<c140> <c17e> 5148\n<c1a1> <c1aa> 5211\n<c1ab> <c1fe> 5222\n<c240> <c27e> 5306\n<c2a1> <c2ca> 5369\n<c2cb> <c2cb> 5221\n<c2cc> <c2fe> 5411\n<c340> <c360> 5462\n<c361> <c37e> 5496\n<c3a1> <c3b8> 5526\n<c3b9> <c3b9> 5551\n<c3ba> <c3ba> 5550\n<c3bb> <c3fe> 5552\n<c440> <c455> 5620\n<c456> <c456> 5495\n<c457> <c47e> 5642\n<c4a1> <c4fe> 5682\n<c540> <c57e> 5776\n<c5a1> <c5fe> 5839\n<c640> <c67e> 5933\n<c6a1> <c6be> 506\n<c6bf> <c6d7> 537\n<c6d8> <c6de> 13747\n<c6df> <c6df> 6036\nendcidrange\n\n100 begincidrange\n<c6e0> <c6fe> 13754\n<c740> <c77e> 13785\n<c7a1> <c7fe> 13848\n<c840> <c87e> 13942\n<c8a1> <c8d3> 14005\n<c940> <c949> 5996\n<c94a> <c94a> 628\n<c94b> <c96b> 6006\n<c96c> <c97e> 6040\n<c9a1> <c9bd> 6059\n<c9be> <c9be> 6039\n<c9bf> <c9ec> 6088\n<c9ed> <c9fe> 6135\n<ca40> <ca7e> 6153\n<caa1> <caf6> 6216\n<caf7> <caf7> 6134\n<caf8> <cafe> 6302\n<cb40> <cb7e> 6309\n<cba1> <cbfe> 6372\n<cc40> <cc7e> 6466\n<cca1> <ccfe> 6529\n<cd40> <cd7e> 6623\n<cda1> <cdfe> 6686\n<ce40> <ce7e> 6780\n<cea1> <cefe> 6843\n<cf40> <cf7e> 6937\n<cfa1> <cffe> 7000\n<d040> <d07e> 7094\n<d0a1> <d0fe> 7157\n<d140> <d17e> 7251\n<d1a1> <d1fe> 7314\n<d240> <d27e> 7408\n<d2a1> <d2fe> 7471\n<d340> <d37e> 7565\n<d3a1> <d3fe> 7628\n<d440> <d47e> 7722\n<d4a1> <d4fe> 7785\n<d540> <d57e> 7879\n<d5a1> <d5fe> 7942\n<d640> <d67e> 8036\n<d6a1> <d6cb> 8099\n<d6cc> <d6cc> 8788\n<d6cd> <d6fe> 8143\n<d740> <d779> 8193\n<d77a> <d77a> 8889\n<d77b> <d77e> 8251\n<d7a1> <d7fe> 8255\n<d840> <d87e> 8349\n<d8a1> <d8fe> 8412\n<d940> <d97e> 8506\n<d9a1> <d9fe> 8569\n<da40> <da7e> 8663\n<daa1> <dade> 8726\n<dadf> <dadf> 8142\n<dae0> <dafe> 8789\n<db40> <db7e> 8820\n<dba1> <dba6> 8883\n<dba7> <dbfe> 8890\n<dc40> <dc7e> 8978\n<dca1> <dcfe> 9041\n<dd40> <dd7e> 9135\n<dda1> <ddfb> 9198\n<ddfc> <ddfc> 9089\n<ddfd> <ddfe> 9289\n<de40> <de7e> 9291\n<dea1> <defe> 9354\n<df40> <df7e> 9448\n<dfa1> <dffe> 9511\n<e040> <e07e> 9605\n<e0a1> <e0fe> 9668\n<e140> <e17e> 9762\n<e1a1> <e1fe> 9825\n<e240> <e27e> 9919\n<e2a1> <e2fe> 9982\n<e340> <e37e> 10076\n<e3a1> <e3fe> 10139\n<e440> <e47e> 10233\n<e4a1> <e4fe> 10296\n<e540> <e57e> 10390\n<e5a1> <e5fe> 10453\n<e640> <e67e> 10547\n<e6a1> <e6fe> 10610\n<e740> <e77e> 10704\n<e7a1> <e7fe> 10767\n<e840> <e87e> 10861\n<e8a1> <e8a2> 10924\n<e8a3> <e8fe> 10927\n<e940> <e975> 11019\n<e976> <e97e> 11074\n<e9a1> <e9fe> 11083\n<ea40> <ea7e> 11177\n<eaa1> <eafe> 11240\n<eb40> <eb5a> 11334\n<eb5b> <eb7e> 11362\n<eba1> <ebf0> 11398\n<ebf1> <ebf1> 10926\n<ebf2> <ebfe> 11478\n<ec40> <ec7e> 11491\n<eca1> <ecdd> 11554\n<ecde> <ecde> 11073\nendcidrange\n\n54 begincidrange\n<ecdf> <ecfe> 11615\n<ed40> <ed7e> 11647\n<eda1> <eda9> 11710\n<edaa> <edfe> 11720\n<ee40> <ee7e> 11805\n<eea1> <eeea> 11868\n<eeeb> <eeeb> 12308\n<eeec> <eefe> 11942\n<ef40> <ef7e> 11961\n<efa1> <effe> 12024\n<f040> <f055> 12118\n<f056> <f056> 11719\n<f057> <f07e> 12140\n<f0a1> <f0ca> 12180\n<f0cb> <f0cb> 11361\n<f0cc> <f0fe> 12222\n<f140> <f162> 12273\n<f163> <f16a> 12309\n<f16b> <f16b> 12640\n<f16c> <f17e> 12317\n<f1a1> <f1fe> 12336\n<f240> <f267> 12430\n<f268> <f268> 12783\n<f269> <f27e> 12470\n<f2a1> <f2c2> 12492\n<f2c3> <f2fe> 12527\n<f340> <f374> 12587\n<f375> <f37e> 12641\n<f3a1> <f3fe> 12651\n<f440> <f465> 12745\n<f466> <f47e> 12784\n<f4a1> <f4b4> 12809\n<f4b5> <f4b5> 12526\n<f4b6> <f4fc> 12829\n<f4fd> <f4fe> 12901\n<f540> <f57e> 12903\n<f5a1> <f5fe> 12966\n<f640> <f662> 13060\n<f663> <f663> 12900\n<f664> <f67e> 13095\n<f6a1> <f6fe> 13122\n<f740> <f77e> 13216\n<f7a1> <f7fe> 13279\n<f840> <f87e> 13373\n<f8a1> <f8fe> 13436\n<f940> <f976> 13530\n<f977> <f97e> 13586\n<f9a1> <f9c3> 13594\n<f9c4> <f9c4> 13585\n<f9c5> <f9c5> 13629\n<f9c6> <f9c6> 13641\n<f9c7> <f9d1> 13630\n<f9d2> <f9d5> 13642\n<f9d6> <f9fe> 14056\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/ETen-B5-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (ETen-B5-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (ETen-B5-H)\n%%BeginResource: CMap (ETen-B5-V)\n%%Title: (ETen-B5-V Adobe CNS1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/ETen-B5-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 0 def\nend def\n\n/CMapName /ETen-B5-V def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 920 def\n/XUID [1 10 25391] def\n\n/WMode 1 def\n\n13 begincidrange\n<a14b> <a14b> 13646\n<a15a> <a15a> 13743\n<a15c> <a15c> 13745\n<a15d> <a15e> 130\n<a161> <a162> 134\n<a165> <a166> 138\n<a169> <a16a> 142\n<a16d> <a16e> 146\n<a171> <a172> 150\n<a175> <a176> 154\n<a179> <a17a> 158\n<a1e3> <a1e3> 13647\n<c6e4> <c6e5> 14097\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/ETenms-B5-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (ETen-B5-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (ETen-B5-H)\n%%BeginResource: CMap (ETenms-B5-H)\n%%Title: (ETenms-B5-H Adobe CNS1 0)\n%%Version: 10.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/ETen-B5-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 0 def\nend def\n\n/CMapName /ETenms-B5-H def\n/CMapVersion 10.002 def\n/CMapType 1 def\n\n/XUID [1 10 25596] def\n\n/WMode 0 def\n\n1 begincidrange\n<20> <7e> 1\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/ETenms-B5-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (ETenms-B5-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (ETenms-B5-H)\n%%BeginResource: CMap (ETenms-B5-V)\n%%Title: (ETenms-B5-V Adobe CNS1 0)\n%%Version: 10.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/ETenms-B5-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 0 def\nend def\n\n/CMapName /ETenms-B5-V def\n/CMapVersion 10.002 def\n/CMapType 1 def\n\n/XUID [1 10 25597] def\n\n/WMode 1 def\n\n6 begincidchar\n<a14b> 13646\n<a14c> 109\n<a156> 312\n<a158> 122\n<a15a> 13743\n<a15c> 13745\nendcidchar\n\n12 begincidrange\n<a15d> <a15e> 130\n<a161> <a162> 134\n<a165> <a166> 138\n<a169> <a16a> 142\n<a16d> <a16e> 146\n<a171> <a172> 150\n<a175> <a176> 154\n<a179> <a17a> 158\n<a17d> <a17e> 130\n<a1a1> <a1a2> 134\n<a1a3> <a1a4> 138\n<c6e4> <c6e5> 14097\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/HKdla-B5-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (HKdla-B5-H)\n%%Title: (HKdla-B5-H Adobe CNS1 1)\n%%Version: 1.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 1 def\nend def\n\n/CMapName /HKdla-B5-H def\n/CMapVersion 1.003 def\n/CMapType 1 def\n\n/XUID [1 10 25521] def\n\n/WMode 0 def\n\n2 begincodespacerange\n  <00>   <80>\n  <A140> <FEFE>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 1\nendnotdefrange\n\n100 begincidrange\n<20> <7e> 1\n<a140> <a158> 99\n<a159> <a15c> 13743\n<a15d> <a17e> 128\n<a1a1> <a1f5> 162\n<a1f6> <a1f6> 248\n<a1f7> <a1f7> 247\n<a1f8> <a1fe> 249\n<a240> <a27e> 256\n<a2a1> <a2fe> 319\n<a340> <a37e> 413\n<a3a1> <a3bb> 476\n<a3bd> <a3bf> 503\n<a440> <a47e> 595\n<a4a1> <a4fe> 658\n<a540> <a57e> 752\n<a5a1> <a5fe> 815\n<a640> <a67e> 909\n<a6a1> <a6fe> 972\n<a740> <a77e> 1066\n<a7a1> <a7fe> 1129\n<a840> <a87e> 1223\n<a8a1> <a8fe> 1286\n<a940> <a97e> 1380\n<a9a1> <a9fe> 1443\n<aa40> <aa7e> 1537\n<aaa1> <aafe> 1600\n<ab40> <ab7e> 1694\n<aba1> <abfe> 1757\n<ac40> <ac7e> 1851\n<aca1> <acfd> 1914\n<acfe> <acfe> 2431\n<ad40> <ad7e> 2007\n<ada1> <adfe> 2070\n<ae40> <ae7e> 2164\n<aea1> <aefe> 2227\n<af40> <af7e> 2321\n<afa1> <afcf> 2384\n<afd0> <affe> 2432\n<b040> <b07e> 2479\n<b0a1> <b0fe> 2542\n<b140> <b17e> 2636\n<b1a1> <b1fe> 2699\n<b240> <b27e> 2793\n<b2a1> <b2fe> 2856\n<b340> <b37e> 2950\n<b3a1> <b3fe> 3013\n<b440> <b47e> 3107\n<b4a1> <b4fe> 3170\n<b540> <b57e> 3264\n<b5a1> <b5fe> 3327\n<b640> <b67e> 3421\n<b6a1> <b6fe> 3484\n<b740> <b77e> 3578\n<b7a1> <b7fe> 3641\n<b840> <b87e> 3735\n<b8a1> <b8fe> 3798\n<b940> <b97e> 3892\n<b9a1> <b9fe> 3955\n<ba40> <ba7e> 4049\n<baa1> <bafe> 4112\n<bb40> <bb7e> 4206\n<bba1> <bbc7> 4269\n<bbc8> <bbfe> 4309\n<bc40> <bc7e> 4364\n<bca1> <bcfe> 4427\n<bd40> <bd7e> 4521\n<bda1> <bdfe> 4584\n<be40> <be51> 4678\n<be52> <be52> 4308\n<be53> <be7e> 4696\n<bea1> <befe> 4740\n<bf40> <bf7e> 4834\n<bfa1> <bffe> 4897\n<c040> <c07e> 4991\n<c0a1> <c0fe> 5054\n<c140> <c17e> 5148\n<c1a1> <c1aa> 5211\n<c1ab> <c1fe> 5222\n<c240> <c27e> 5306\n<c2a1> <c2ca> 5369\n<c2cb> <c2cb> 5221\n<c2cc> <c2fe> 5411\n<c340> <c360> 5462\n<c361> <c37e> 5496\n<c3a1> <c3b8> 5526\n<c3b9> <c3b9> 5551\n<c3ba> <c3ba> 5550\n<c3bb> <c3fe> 5552\n<c440> <c455> 5620\n<c456> <c456> 5495\n<c457> <c47e> 5642\n<c4a1> <c4fe> 5682\n<c540> <c57e> 5776\n<c5a1> <c5fe> 5839\n<c640> <c67e> 5933\n<c940> <c949> 5996\n<c94a> <c94a> 628\n<c94b> <c96b> 6006\n<c96c> <c97e> 6040\nendcidrange\n\n100 begincidrange\n<c9a1> <c9bd> 6059\n<c9be> <c9be> 6039\n<c9bf> <c9ec> 6088\n<c9ed> <c9fe> 6135\n<ca40> <ca7e> 6153\n<caa1> <caf6> 6216\n<caf7> <caf7> 6134\n<caf8> <cafe> 6302\n<cb40> <cb7e> 6309\n<cba1> <cbfe> 6372\n<cc40> <cc7e> 6466\n<cca1> <ccfe> 6529\n<cd40> <cd7e> 6623\n<cda1> <cdfe> 6686\n<ce40> <ce7e> 6780\n<cea1> <cefe> 6843\n<cf40> <cf7e> 6937\n<cfa1> <cffe> 7000\n<d040> <d07e> 7094\n<d0a1> <d0fe> 7157\n<d140> <d17e> 7251\n<d1a1> <d1fe> 7314\n<d240> <d27e> 7408\n<d2a1> <d2fe> 7471\n<d340> <d37e> 7565\n<d3a1> <d3fe> 7628\n<d440> <d47e> 7722\n<d4a1> <d4fe> 7785\n<d540> <d57e> 7879\n<d5a1> <d5fe> 7942\n<d640> <d67e> 8036\n<d6a1> <d6cb> 8099\n<d6cc> <d6cc> 8788\n<d6cd> <d6fe> 8143\n<d740> <d779> 8193\n<d77a> <d77a> 8889\n<d77b> <d77e> 8251\n<d7a1> <d7fe> 8255\n<d840> <d87e> 8349\n<d8a1> <d8fe> 8412\n<d940> <d97e> 8506\n<d9a1> <d9fe> 8569\n<da40> <da7e> 8663\n<daa1> <dade> 8726\n<dadf> <dadf> 8142\n<dae0> <dafe> 8789\n<db40> <db7e> 8820\n<dba1> <dba6> 8883\n<dba7> <dbfe> 8890\n<dc40> <dc7e> 8978\n<dca1> <dcfe> 9041\n<dd40> <dd7e> 9135\n<dda1> <ddfb> 9198\n<ddfc> <ddfc> 9089\n<ddfd> <ddfe> 9289\n<de40> <de7e> 9291\n<dea1> <defe> 9354\n<df40> <df7e> 9448\n<dfa1> <dffe> 9511\n<e040> <e07e> 9605\n<e0a1> <e0fe> 9668\n<e140> <e17e> 9762\n<e1a1> <e1fe> 9825\n<e240> <e27e> 9919\n<e2a1> <e2fe> 9982\n<e340> <e37e> 10076\n<e3a1> <e3fe> 10139\n<e440> <e47e> 10233\n<e4a1> <e4fe> 10296\n<e540> <e57e> 10390\n<e5a1> <e5fe> 10453\n<e640> <e67e> 10547\n<e6a1> <e6fe> 10610\n<e740> <e77e> 10704\n<e7a1> <e7fe> 10767\n<e840> <e87e> 10861\n<e8a1> <e8a2> 10924\n<e8a3> <e8fe> 10927\n<e940> <e975> 11019\n<e976> <e97e> 11074\n<e9a1> <e9fe> 11083\n<ea40> <ea7e> 11177\n<eaa1> <eafe> 11240\n<eb40> <eb5a> 11334\n<eb5b> <eb7e> 11362\n<eba1> <ebf0> 11398\n<ebf1> <ebf1> 10926\n<ebf2> <ebfe> 11478\n<ec40> <ec7e> 11491\n<eca1> <ecdd> 11554\n<ecde> <ecde> 11073\n<ecdf> <ecfe> 11615\n<ed40> <ed7e> 11647\n<eda1> <eda9> 11710\n<edaa> <edfe> 11720\n<ee40> <ee7e> 11805\n<eea1> <eeea> 11868\n<eeeb> <eeeb> 12308\n<eeec> <eefe> 11942\n<ef40> <ef7e> 11961\nendcidrange\n\n100 begincidrange\n<efa1> <effe> 12024\n<f040> <f055> 12118\n<f056> <f056> 11719\n<f057> <f07e> 12140\n<f0a1> <f0ca> 12180\n<f0cb> <f0cb> 11361\n<f0cc> <f0fe> 12222\n<f140> <f162> 12273\n<f163> <f16a> 12309\n<f16b> <f16b> 12640\n<f16c> <f17e> 12317\n<f1a1> <f1fe> 12336\n<f240> <f267> 12430\n<f268> <f268> 12783\n<f269> <f27e> 12470\n<f2a1> <f2c2> 12492\n<f2c3> <f2fe> 12527\n<f340> <f374> 12587\n<f375> <f37e> 12641\n<f3a1> <f3fe> 12651\n<f440> <f465> 12745\n<f466> <f47e> 12784\n<f4a1> <f4b4> 12809\n<f4b5> <f4b5> 12526\n<f4b6> <f4fc> 12829\n<f4fd> <f4fe> 12901\n<f540> <f57e> 12903\n<f5a1> <f5fe> 12966\n<f640> <f662> 13060\n<f663> <f663> 12900\n<f664> <f67e> 13095\n<f6a1> <f6fe> 13122\n<f740> <f77e> 13216\n<f7a1> <f7fe> 13279\n<f840> <f87e> 13373\n<f8a1> <f8fe> 13436\n<f940> <f976> 13530\n<f977> <f97e> 13586\n<f9a1> <f9c3> 13594\n<f9c4> <f9c4> 13585\n<f9c5> <f9c5> 13629\n<f9c6> <f9c6> 13641\n<f9c7> <f9d1> 13630\n<f9d2> <f9d5> 13642\n<fa41> <fa41> 16713\n<fa42> <fa42> 16035\n<fa43> <fa43> 16004\n<fa44> <fa44> 16007\n<fa45> <fa45> 15877\n<fa46> <fa46> 16534\n<fa47> <fa47> 14788\n<fa48> <fa48> 15725\n<fa49> <fa49> 15999\n<fa4a> <fa4a> 15479\n<fa4b> <fa4b> 16006\n<fa4c> <fa4c> 14460\n<fa4d> <fa4d> 16039\n<fa4e> <fa4e> 16910\n<fa4f> <fa4f> 16036\n<fa50> <fa50> 16778\n<fa51> <fa51> 16479\n<fa52> <fa52> 16662\n<fa53> <fa53> 16523\n<fa54> <fa54> 15974\n<fa55> <fa55> 15973\n<fa56> <fa56> 15759\n<fa57> <fa57> 16798\n<fa58> <fa58> 14950\n<fa59> <fa59> 16737\n<fa5a> <fa5a> 16010\n<fa5b> <fa5b> 15758\n<fa5c> <fa5c> 16013\n<fa5d> <fa5d> 15804\n<fa5e> <fa5e> 16021\n<fa5f> <fa5f> 14755\n<fa60> <fa60> 16884\n<fa61> <fa61> 16017\n<fa62> <fa62> 15302\n<fa63> <fa63> 15811\n<fa64> <fa64> 16046\n<fa65> <fa65> 14150\n<fa66> <fa66> 14449\n<fa67> <fa67> 14848\n<fa68> <fa68> 17036\n<fa69> <fa69> 16987\n<fa6a> <fa6a> 16045\n<fa6b> <fa6b> 16675\n<fa6c> <fa6c> 16038\n<fa6d> <fa6d> 16032\n<fa6e> <fa6e> 15150\n<fa6f> <fa6f> 15805\n<fa70> <fa70> 14436\n<fa71> <fa71> 15485\n<fa72> <fa72> 16041\n<fa73> <fa73> 16909\n<fa74> <fa74> 16216\n<fa75> <fa75> 16024\n<fa76> <fa76> 15728\n<fa77> <fa77> 16040\n<fa78> <fa78> 16020\nendcidrange\n\n100 begincidrange\n<fa79> <fa79> 16029\n<fa7a> <fa7a> 15018\n<fa7b> <fa7b> 16037\n<fa7c> <fa7c> 15564\n<fa7d> <fa7d> 16536\n<fa7e> <fa7e> 16031\n<faa1> <faa1> 16885\n<faa2> <faa2> 16011\n<faa3> <faa3> 15218\n<faa4> <faa4> 14304\n<faa5> <faa5> 15071\n<faa6> <faa6> 17120\n<faa7> <faa7> 16023\n<faa8> <faa8> 16786\n<faa9> <faa9> 14472\n<faaa> <faaa> 17096\n<faab> <faab> 16016\n<faac> <faac> 14447\n<faad> <faad> 16028\n<faae> <faae> 16708\n<faaf> <faaf> 16710\n<fab0> <fab0> 16030\n<fab1> <fab1> 16009\n<fab2> <fab2> 16531\n<fab3> <fab4> 16001\n<fab5> <fab5> 15374\n<fab6> <fab6> 16005\n<fab7> <fab7> 14556\n<fab8> <fab8> 16489\n<fab9> <fab9> 14296\n<faba> <faba> 16025\n<fabb> <fabb> 16003\n<fabc> <fabc> 16008\n<fabd> <fabd> 16000\n<fabe> <fabe> 16049\n<fabf> <fabf> 16746\n<fac0> <fac0> 14187\n<fac1> <fac1> 15975\n<fac2> <fac2> 15992\n<fac3> <fac3> 16994\n<fac4> <fac4> 14325\n<fac5> <fac5> 14324\n<fac6> <fac6> 15173\n<fac7> <fac7> 15961\n<fac8> <fac8> 10940\n<fac9> <fac9> 15807\n<faca> <faca> 16573\n<facb> <facb> 15998\n<facc> <facc> 14381\n<facd> <facd> 16048\n<face> <face> 16043\n<facf> <facf> 16050\n<fad0> <fad0> 16929\n<fad1> <fad1> 16234\n<fad2> <fad2> 14363\n<fad3> <fad3> 16026\n<fad4> <fad4> 16931\n<fad5> <fad5> 16014\n<fad6> <fad6> 15357\n<fad7> <fad7> 16474\n<fad8> <fad8> 16047\n<fad9> <fad9> 15560\n<fada> <fada> 14664\n<fadb> <fadb> 17085\n<fadc> <fadc> 16588\n<fadd> <fadd> 15964\n<fade> <fade> 16044\n<fadf> <fadf> 14618\n<fae0> <fae0> 16042\n<fae1> <fae1> 17305\n<fae2> <fae2> 14490\n<fae3> <fae3> 16012\n<fae4> <fae4> 14495\n<fae5> <fae5> 16033\n<fae6> <fae6> 16775\n<fae7> <fae7> 16015\n<fae8> <fae8> 16323\n<fae9> <fae9> 16034\n<faea> <faea> 16027\n<faeb> <faeb> 15997\n<faec> <faec> 16465\n<faed> <faed> 16316\n<faee> <faee> 16341\n<faef> <faef> 15124\n<faf0> <faf0> 16930\n<faf1> <faf1> 14235\n<faf2> <faf2> 16507\n<faf3> <faf3> 14216\n<faf4> <faf4> 15284\n<faf5> <faf5> 16848\n<faf6> <faf6> 16996\n<faf7> <faf7> 14430\n<faf8> <faf8> 14188\n<faf9> <faf9> 15806\n<fafa> <fafa> 14355\n<fafb> <fafb> 16383\n<fafc> <fafc> 15715\n<fafd> <fafd> 14214\n<fafe> <fafe> 15178\n<fb40> <fb40> 14138\nendcidrange\n\n100 begincidrange\n<fb41> <fb41> 17018\n<fb42> <fb42> 15482\n<fb43> <fb43> 16901\n<fb44> <fb44> 15398\n<fb45> <fb45> 14511\n<fb46> <fb46> 14646\n<fb47> <fb47> 14248\n<fb48> <fb48> 15220\n<fb49> <fb49> 16237\n<fb4a> <fb4a> 16022\n<fb4b> <fb4b> 14268\n<fb4c> <fb4c> 15995\n<fb4d> <fb4d> 16362\n<fb4e> <fb4e> 16842\n<fb4f> <fb4f> 14807\n<fb50> <fb50> 16593\n<fb51> <fb51> 15217\n<fb52> <fb52> 16335\n<fb53> <fb53> 1986\n<fb54> <fb54> 17150\n<fb55> <fb55> 15565\n<fb56> <fb56> 15984\n<fb57> <fb57> 15986\n<fb58> <fb58> 14156\n<fb59> <fb59> 14185\n<fb5a> <fb5a> 15183\n<fb5b> <fb5b> 14239\n<fb5c> <fb5c> 11845\n<fb5d> <fb5d> 14349\n<fb5e> <fb5e> 16290\n<fb5f> <fb5f> 14364\n<fb60> <fb60> 16252\n<fb61> <fb61> 16217\n<fb62> <fb62> 16286\n<fb63> <fb63> 15763\n<fb64> <fb64> 14357\n<fb65> <fb65> 14475\n<fb66> <fb66> 15456\n<fb67> <fb67> 14576\n<fb68> <fb68> 14250\n<fb69> <fb69> 16180\n<fb6a> <fb6a> 15378\n<fb6b> <fb6b> 14592\n<fb6c> <fb6c> 16298\n<fb6d> <fb6d> 14603\n<fb6e> <fb6e> 14633\n<fb6f> <fb6f> 16167\n<fb70> <fb70> 16272\n<fb71> <fb71> 16215\n<fb72> <fb72> 16219\n<fb73> <fb73> 16226\n<fb74> <fb74> 15734\n<fb75> <fb75> 14792\n<fb76> <fb77> 16228\n<fb78> <fb78> 14653\n<fb79> <fb79> 15462\n<fb7a> <fb7a> 14800\n<fb7b> <fb7b> 16418\n<fb7c> <fb7c> 16172\n<fb7d> <fb7d> 16168\n<fb7e> <fb7e> 14796\n<fba1> <fba1> 16166\n<fba2> <fba2> 14797\n<fba3> <fba3> 16191\n<fba4> <fba4> 14789\n<fba5> <fba5> 16334\n<fba6> <fba6> 16436\n<fba7> <fba7> 16222\n<fba8> <fba8> 16434\n<fba9> <fba9> 16468\n<fbaa> <fbaa> 16760\n<fbab> <fbab> 16224\n<fbac> <fbac> 16169\n<fbad> <fbad> 16477\n<fbae> <fbae> 16195\n<fbaf> <fbaf> 16232\n<fbb0> <fbb0> 16480\n<fbb1> <fbb1> 16170\n<fbb2> <fbb2> 16483\n<fbb3> <fbb3> 14823\n<fbb4> <fbb4> 14518\n<fbb5> <fbb5> 16528\n<fbb6> <fbb6> 16456\n<fbb7> <fbb7> 16402\n<fbb8> <fbb8> 15740\n<fbb9> <fbb9> 16459\n<fbba> <fbba> 16461\n<fbbb> <fbbb> 16463\n<fbbc> <fbbc> 16975\n<fbbd> <fbbd> 15737\n<fbbe> <fbbe> 16192\n<fbbf> <fbbf> 16138\n<fbc0> <fbc0> 16336\n<fbc1> <fbc1> 16182\n<fbc2> <fbc2> 16493\n<fbc3> <fbc3> 16517\n<fbc4> <fbc4> 16516\n<fbc5> <fbc5> 16702\n<fbc6> <fbc6> 16699\n<fbc7> <fbc7> 16326\nendcidrange\n\n100 begincidrange\n<fbc8> <fbc8> 16518\n<fbc9> <fbc9> 14674\n<fbca> <fbca> 16545\n<fbcb> <fbcb> 16178\n<fbcc> <fbcc> 16899\n<fbcd> <fbcd> 16230\n<fbce> <fbce> 15747\n<fbcf> <fbcf> 15989\n<fbd0> <fbd0> 16546\n<fbd1> <fbd1> 1392\n<fbd2> <fbd2> 16185\n<fbd3> <fbd3> 2161\n<fbd4> <fbd4> 16164\n<fbd5> <fbd5> 16558\n<fbd6> <fbd6> 16196\n<fbd7> <fbd7> 14581\n<fbd8> <fbd8> 16329\n<fbd9> <fbd9> 16333\n<fbda> <fbda> 16309\n<fbdb> <fbdb> 15996\n<fbdc> <fbdc> 16338\n<fbdd> <fbdd> 16205\n<fbde> <fbde> 16572\n<fbdf> <fbdf> 16567\n<fbe0> <fbe0> 14424\n<fbe1> <fbe1> 17327\n<fbe2> <fbe2> 16236\n<fbe3> <fbe3> 15749\n<fbe4> <fbe4> 17302\n<fbe5> <fbe5> 14758\n<fbe6> <fbe6> 16253\n<fbe7> <fbe7> 16319\n<fbe8> <fbe8> 16584\n<fbe9> <fbe9> 16223\n<fbea> <fbea> 16171\n<fbeb> <fbeb> 15730\n<fbec> <fbec> 16591\n<fbed> <fbed> 14853\n<fbee> <fbee> 15746\n<fbef> <fbef> 16604\n<fbf0> <fbf0> 15717\n<fbf1> <fbf1> 16596\n<fbf2> <fbf2> 16602\n<fbf3> <fbf3> 16173\n<fbf4> <fbf4> 1429\n<fbf5> <fbf5> 15745\n<fbf6> <fbf6> 16625\n<fbf7> <fbf7> 1781\n<fbf8> <fbf8> 16632\n<fbf9> <fbf9> 16635\n<fbfa> <fbfa> 16193\n<fbfb> <fbfb> 16664\n<fbfc> <fbfc> 15753\n<fbfd> <fbfd> 16220\n<fbfe> <fbfe> 15719\n<fc40> <fc40> 16142\n<fc41> <fc41> 16147\n<fc42> <fc42> 16674\n<fc43> <fc43> 16330\n<fc44> <fc44> 16681\n<fc45> <fc45> 16140\n<fc46> <fc46> 16139\n<fc47> <fc47> 16225\n<fc48> <fc48> 15754\n<fc49> <fc49> 16174\n<fc4a> <fc4a> 6513\n<fc4b> <fc4b> 16693\n<fc4c> <fc4c> 14891\n<fc4d> <fc4d> 16235\n<fc4e> <fc4e> 15269\n<fc4f> <fc4f> 16452\n<fc50> <fc50> 16981\n<fc51> <fc51> 14135\n<fc52> <fc52> 16165\n<fc53> <fc53> 14137\n<fc54> <fc54> 14896\n<fc55> <fc55> 16707\n<fc56> <fc56> 16580\n<fc57> <fc57> 15716\n<fc58> <fc58> 16318\n<fc59> <fc59> 16294\n<fc5a> <fc5a> 16428\n<fc5b> <fc5b> 16727\n<fc5c> <fc5c> 16287\n<fc5d> <fc5d> 11072\n<fc5e> <fc5e> 16295\n<fc5f> <fc5f> 16389\n<fc60> <fc60> 16385\n<fc61> <fc61> 7323\n<fc62> <fc62> 15748\n<fc63> <fc63> 2709\n<fc64> <fc64> 16748\n<fc65> <fc65> 16393\n<fc66> <fc66> 15733\n<fc67> <fc67> 15068\n<fc68> <fc68> 16296\n<fc69> <fc69> 16183\n<fc6a> <fc6a> 16756\n<fc6b> <fc6b> 16390\n<fc6c> <fc6c> 16386\nendcidrange\n\n100 begincidrange\n<fc6d> <fc6d> 16314\n<fc6e> <fc6e> 16320\n<fc6f> <fc6f> 4784\n<fc70> <fc70> 16317\n<fc71> <fc71> 16755\n<fc72> <fc72> 16774\n<fc73> <fc73> 14932\n<fc74> <fc74> 16325\n<fc75> <fc75> 16985\n<fc76> <fc76> 16322\n<fc77> <fc77> 16149\n<fc78> <fc78> 16208\n<fc79> <fc79> 16262\n<fc7a> <fc7a> 16321\n<fc7b> <fc7b> 16780\n<fc7c> <fc7c> 16327\n<fc7d> <fc7d> 16150\n<fc7e> <fc7e> 16782\n<fca1> <fca1> 16203\n<fca2> <fca2> 16797\n<fca3> <fca3> 4447\n<fca4> <fca4> 16324\n<fca5> <fca5> 13188\n<fca6> <fca6> 15769\n<fca7> <fca7> 16825\n<fca8> <fca8> 14985\n<fca9> <fca9> 16823\n<fcaa> <fcaa> 15755\n<fcab> <fcab> 15718\n<fcac> <fcac> 994\n<fcad> <fcad> 15722\n<fcae> <fcae> 15738\n<fcaf> <fcaf> 16867\n<fcb0> <fcb0> 1561\n<fcb1> <fcb1> 14742\n<fcb2> <fcb2> 16328\n<fcb3> <fcb3> 15006\n<fcb4> <fcb4> 16184\n<fcb5> <fcb5> 15744\n<fcb6> <fcb7> 16862\n<fcb8> <fcb8> 17131\n<fcb9> <fcb9> 15750\n<fcba> <fcba> 16859\n<fcbb> <fcbb> 16190\n<fcbc> <fcbc> 16470\n<fcbd> <fcbd> 16857\n<fcbe> <fcbe> 16374\n<fcbf> <fcbf> 16221\n<fcc0> <fcc0> 15732\n<fcc1> <fcc1> 16872\n<fcc2> <fcc2> 16839\n<fcc3> <fcc3> 15761\n<fcc4> <fcc4> 15179\n<fcc5> <fcc5> 15682\n<fcc6> <fcc6> 15021\n<fcc7> <fcc7> 15013\n<fcc8> <fcc8> 16882\n<fcc9> <fcc9> 16204\n<fcca> <fcca> 16888\n<fccb> <fccb> 16238\n<fccc> <fccc> 16249\n<fccd> <fccd> 16269\n<fcce> <fcce> 16387\n<fccf> <fccf> 16273\n<fcd0> <fcd0> 15043\n<fcd1> <fcd1> 2330\n<fcd2> <fcd2> 16948\n<fcd3> <fcd3> 16379\n<fcd4> <fcd5> 16960\n<fcd6> <fcd6> 16381\n<fcd7> <fcd7> 16248\n<fcd8> <fcd8> 15477\n<fcd9> <fcd9> 15475\n<fcda> <fcda> 14501\n<fcdb> <fcdb> 17401\n<fcdc> <fcdc> 15614\n<fcdd> <fcdd> 16983\n<fcde> <fcde> 16947\n<fcdf> <fcdf> 15721\n<fce0> <fce0> 15486\n<fce1> <fce1> 15727\n<fce2> <fce2> 16384\n<fce3> <fce3> 15808\n<fce4> <fce4> 16388\n<fce5> <fce5> 3698\n<fce6> <fce6> 14648\n<fce7> <fce7> 16292\n<fce8> <fce8> 10586\n<fce9> <fce9> 17011\n<fcea> <fcea> 15049\n<fceb> <fceb> 17021\n<fcec> <fcec> 15050\n<fced> <fced> 16306\n<fcee> <fcee> 16310\n<fcef> <fcef> 16279\n<fcf0> <fcf0> 16282\n<fcf1> <fcf1> 17035\n<fcf2> <fcf2> 17402\n<fcf3> <fcf3> 17034\n<fcf4> <fcf4> 16209\nendcidrange\n\n100 begincidrange\n<fcf5> <fcf5> 16280\n<fcf6> <fcf6> 16803\n<fcf7> <fcf7> 15708\n<fcf8> <fcf8> 16227\n<fcf9> <fcf9> 17040\n<fcfa> <fcfa> 8084\n<fcfb> <fcfb> 17094\n<fcfc> <fcfc> 17058\n<fcfd> <fcfd> 16378\n<fcfe> <fcfe> 16285\n<fd40> <fd40> 16382\n<fd41> <fd41> 16283\n<fd42> <fd42> 16351\n<fd43> <fd43> 16358\n<fd44> <fd44> 16350\n<fd45> <fd45> 17079\n<fd46> <fd46> 16372\n<fd47> <fd47> 17080\n<fd48> <fd48> 16363\n<fd49> <fd49> 17087\n<fd4a> <fd4a> 15729\n<fd4b> <fd4b> 16207\n<fd4c> <fd4c> 17093\n<fd4d> <fd4d> 17109\n<fd4e> <fd4e> 17104\n<fd4f> <fd4f> 17112\n<fd50> <fd50> 16213\n<fd51> <fd51> 16360\n<fd52> <fd52> 16371\n<fd53> <fd53> 17119\n<fd54> <fd54> 16339\n<fd55> <fd55> 15987\n<fd56> <fd56> 16277\n<fd57> <fd57> 17134\n<fd58> <fd58> 17140\n<fd59> <fd59> 16268\n<fd5a> <fd5a> 16335\n<fd5b> <fd5b> 17132\n<fd5c> <fd5c> 16340\n<fd5d> <fd5d> 17136\n<fd5e> <fd5e> 1986\n<fd5f> <fd5f> 2389\n<fd60> <fd60> 17150\n<fd61> <fd61> 17153\n<fd62> <fd62> 15565\n<fd63> <fd63> 17159\n<fd64> <fd64> 17403\n<fd65> <fd65> 16346\n<fd66> <fd66> 16267\n<fd67> <fd67> 14131\n<fd68> <fd68> 16266\n<fd69> <fd69> 14145\n<fd6a> <fd6a> 14144\n<fd6b> <fd6b> 14146\n<fd6c> <fd6c> 16275\n<fd6d> <fd6d> 16271\n<fd6e> <fd6e> 15984\n<fd6f> <fd6f> 17097\n<fd70> <fd70> 15986\n<fd71> <fd71> 16297\n<fd72> <fd72> 17101\n<fd73> <fd73> 17362\n<fd74> <fd74> 16270\n<fd75> <fd75> 16247\n<fd76> <fd76> 15726\n<fd77> <fd77> 3338\n<fd78> <fd78> 16145\n<fd79> <fd79> 14162\n<fd7a> <fd7a> 16148\n<fd7b> <fd7b> 16152\n<fd7c> <fd7c> 16211\n<fd7d> <fd7d> 16159\n<fd7e> <fd7e> 16156\n<fda1> <fda1> 16312\n<fda2> <fda2> 13213\n<fda3> <fda3> 15167\n<fda4> <fda4> 16210\n<fda5> <fda5> 16154\n<fda6> <fda6> 16157\n<fda7> <fda7> 14172\n<fda8> <fda8> 14469\n<fda9> <fda9> 14177\n<fdaa> <fdaa> 16343\n<fdab> <fdab> 16342\n<fdac> <fdac> 16345\n<fdad> <fdad> 16344\n<fdae> <fdae> 16349\n<fdaf> <fdaf> 16019\n<fdb0> <fdb0> 14185\n<fdb1> <fdb1> 14190\n<fdb2> <fdb2> 15180\n<fdb3> <fdb3> 14196\n<fdb4> <fdb4> 14207\n<fdb5> <fdb5> 14203\n<fdb6> <fdb6> 14210\n<fdb7> <fdb7> 15183\n<fdb8> <fdb8> 14226\n<fdb9> <fdb9> 16355\n<fdba> <fdba> 16348\n<fdbb> <fdbb> 16347\nendcidrange\n\n100 begincidrange\n<fdbc> <fdbc> 16357\n<fdbd> <fdbd> 15221\n<fdbe> <fdbe> 14242\n<fdbf> <fdbf> 16354\n<fdc0> <fdc0> 16359\n<fdc1> <fdc1> 15981\n<fdc2> <fdc2> 3370\n<fdc3> <fdc3> 15993\n<fdc4> <fdc4> 15990\n<fdc5> <fdc5> 14239\n<fdc6> <fdc6> 16366\n<fdc7> <fdc7> 17108\n<fdc8> <fdc8> 15764\n<fdc9> <fdc9> 15713\n<fdca> <fdca> 16353\n<fdcb> <fdcb> 14174\n<fdcc> <fdcc> 15226\n<fdcd> <fdcd> 14347\n<fdce> <fdce> 16364\n<fdcf> <fdcf> 16367\n<fdd0> <fdd0> 11845\n<fdd1> <fdd1> 16380\n<fdd2> <fdd2> 16365\n<fdd3> <fdd3> 14349\n<fdd4> <fdd4> 16356\n<fdd5> <fdd5> 16274\n<fdd6> <fdd6> 16302\n<fdd7> <fdd7> 14353\n<fdd8> <fdd8> 16250\n<fdd9> <fdd9> 15243\n<fdda> <fdda> 16218\n<fddb> <fddb> 14358\n<fddc> <fddc> 16290\n<fddd> <fddd> 15246\n<fdde> <fdde> 14364\n<fddf> <fddf> 8276\n<fde0> <fde0> 14367\n<fde1> <fde1> 16288\n<fde2> <fde2> 17404\n<fde3> <fde3> 15894\n<fde4> <fde4> 15252\n<fde5> <fde5> 16252\n<fde6> <fde6> 16391\n<fde7> <fde7> 16251\n<fde8> <fde8> 15731\n<fde9> <fde9> 15991\n<fdea> <fdea> 15762\n<fdeb> <fdeb> 16289\n<fdec> <fdec> 14273\n<fded> <fded> 14291\n<fdee> <fdee> 15994\n<fdef> <fdef> 16217\n<fdf0> <fdf0> 15445\n<fdf1> <fdf1> 16376\n<fdf2> <fdf2> 16373\n<fdf3> <fdf3> 15436\n<fdf4> <fdf4> 15756\n<fdf5> <fdf5> 16291\n<fdf6> <fdf6> 14272\n<fdf7> <fdf7> 16212\n<fdf8> <fdf8> 14336\n<fdf9> <fdf9> 15231\n<fdfa> <fdfa> 16286\n<fdfb> <fdfb> 14370\n<fdfc> <fdfc> 16361\n<fdfd> <fdfd> 14371\n<fdfe> <fdfe> 16352\n<fe40> <fe40> 15763\n<fe41> <fe41> 16377\n<fe42> <fe42> 14375\n<fe43> <fe43> 16293\n<fe44> <fe44> 16368\n<fe45> <fe45> 14390\n<fe46> <fe46> 16281\n<fe47> <fe47> 16370\n<fe48> <fe48> 15757\n<fe49> <fe49> 17382\n<fe4a> <fe4a> 13602\n<fe4b> <fe4b> 16369\n<fe4c> <fe4c> 16284\n<fe4d> <fe4d> 16305\n<fe4e> <fe4e> 16278\n<fe4f> <fe4f> 15983\n<fe50> <fe50> 16233\n<fe51> <fe51> 16375\n<fe52> <fe52> 16258\n<fe53> <fe53> 16264\n<fe54> <fe54> 16261\n<fe55> <fe55> 16259\n<fe56> <fe56> 16255\n<fe57> <fe57> 16265\n<fe58> <fe58> 15285\n<fe59> <fe59> 14434\n<fe5a> <fe5a> 16263\n<fe5b> <fe5b> 16177\n<fe5c> <fe5c> 14357\n<fe5d> <fe5d> 14462\n<fe5e> <fe5e> 16201\n<fe5f> <fe5f> 16200\n<fe60> <fe60> 16199\nendcidrange\n\n100 begincidrange\n<fe61> <fe61> 16197\n<fe62> <fe62> 17387\n<fe63> <fe63> 14466\n<fe64> <fe64> 16239\n<fe65> <fe65> 16206\n<fe66> <fe66> 15304\n<fe67> <fe67> 17405\n<fe68> <fe69> 15723\n<fe6a> <fe6a> 17406\n<fe6b> <fe6b> 16331\n<fe6c> <fe6c> 15826\n<fe6d> <fe6d> 14457\n<fe6e> <fe6e> 16144\n<fe6f> <fe6f> 14382\n<fe70> <fe70> 14475\n<fe71> <fe71> 15456\n<fe72> <fe72> 10911\n<fe73> <fe73> 15457\n<fe74> <fe74> 14483\n<fe75> <fe75> 15988\n<fe76> <fe76> 16300\n<fe77> <fe77> 16257\n<fe78> <fe78> 15309\n<fe79> <fe79> 15316\n<fe7a> <fe7a> 15315\n<fe7b> <fe7b> 16332\n<fe7c> <fe7c> 16337\n<fe7d> <fe7d> 16189\n<fe7e> <fe7e> 16202\n<fea1> <fea1> 9042\n<fea2> <fea2> 14509\n<fea3> <fea3> 16198\n<fea4> <fea4> 14517\n<fea5> <fea5> 16141\n<fea6> <fea6> 16307\n<fea7> <fea7> 14528\n<fea8> <fea8> 15919\n<fea9> <fea9> 14543\n<feaa> <feaa> 14549\n<feab> <feab> 16179\n<feac> <feac> 15765\n<fead> <fead> 16181\n<feae> <feae> 14551\n<feaf> <feaf> 16175\n<feb0> <feb0> 14560\n<feb1> <feb1> 15362\n<feb2> <feb2> 16242\n<feb3> <feb3> 16240\n<feb4> <feb4> 15766\n<feb5> <feb6> 14566\n<feb7> <feb7> 16437\n<feb8> <feb8> 16243\n<feb9> <feb9> 14576\n<feba> <feba> 15371\n<febb> <febb> 14583\n<febc> <febc> 14250\n<febd> <febd> 17407\n<febe> <febe> 14586\n<febf> <febf> 15377\n<fec0> <fec0> 16180\n<fec1> <fec1> 16313\n<fec2> <fec2> 15378\n<fec3> <fec3> 16394\n<fec4> <fec4> 15735\n<fec5> <fec5> 16194\n<fec6> <fec6> 14592\n<fec7> <fec7> 14594\n<fec8> <fec8> 16244\n<fec9> <fec9> 15767\n<feca> <feca> 16298\n<fecb> <fecb> 16153\n<fecc> <fecc> 16155\n<fecd> <fecd> 14606\n<fece> <fece> 14601\n<fecf> <fecf> 14603\n<fed0> <fed0> 16146\n<fed1> <fed1> 16151\n<fed2> <fed2> 16311\n<fed3> <fed3> 16160\n<fed4> <fed4> 16315\n<fed5> <fed5> 16188\n<fed6> <fed6> 16301\n<fed7> <fed7> 14617\n<fed8> <fed8> 16214\n<fed9> <fed9> 16241\n<feda> <feda> 16308\n<fedb> <fedb> 14620\n<fedc> <fedc> 16158\n<fedd> <fedd> 16186\n<fede> <fede> 14619\n<fedf> <fedf> 15751\n<fee0> <fee0> 15418\n<fee1> <fee1> 16162\n<fee2> <fee2> 15985\n<fee3> <fee3> 15417\n<fee4> <fee4> 15742\n<fee5> <fee5> 16676\n<fee6> <fee6> 16187\n<fee7> <fee7> 15982\n<fee8> <fee8> 16299\nendcidrange\n\n22 begincidrange\n<fee9> <fee9> 14629\n<feea> <feea> 16176\n<feeb> <feeb> 14633\n<feec> <feec> 16260\n<feed> <feed> 16143\n<feee> <feee> 16246\n<feef> <feef> 16276\n<fef0> <fef0> 14642\n<fef1> <fef1> 16167\n<fef2> <fef2> 14643\n<fef3> <fef3> 16245\n<fef4> <fef4> 14647\n<fef5> <fef5> 15736\n<fef6> <fef6> 16161\n<fef7> <fef7> 16272\n<fef8> <fef8> 14656\n<fef9> <fef9> 15743\n<fefa> <fefa> 14666\n<fefb> <fefb> 16256\n<fefc> <fefc> 16163\n<fefd> <fefd> 14672\n<fefe> <fefe> 16254\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/HKdla-B5-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (HKdla-B5-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (HKdla-B5-H)\n%%BeginResource: CMap (HKdla-B5-V)\n%%Title: (HKdla-B5-V Adobe CNS1 1)\n%%Version: 12.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/HKdla-B5-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 1 def\nend def\n\n/CMapName /HKdla-B5-V def\n/CMapVersion 12.002 def\n/CMapType 1 def\n\n/XUID [1 10 25522] def\n\n/WMode 1 def\n\n12 begincidrange\n<a14b> <a14b> 13646\n<a15a> <a15a> 13743\n<a15c> <a15c> 13745\n<a15d> <a15e> 130\n<a161> <a162> 134\n<a165> <a166> 138\n<a169> <a16a> 142\n<a16d> <a16e> 146\n<a171> <a172> 150\n<a175> <a176> 154\n<a179> <a17a> 158\n<a1e3> <a1e3> 13647\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/HKdlb-B5-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (HKdlb-B5-H)\n%%Title: (HKdlb-B5-H Adobe CNS1 1)\n%%Version: 1.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 1 def\nend def\n\n/CMapName /HKdlb-B5-H def\n/CMapVersion 1.003 def\n/CMapType 1 def\n\n/XUID [1 10 25523] def\n\n/WMode 0 def\n\n2 begincodespacerange\n  <00>   <80>\n  <8E40> <FEFE>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 1\nendnotdefrange\n\n100 begincidrange\n<20> <7e> 1\n<8e40> <8e40> 15735\n<8e41> <8e41> 15724\n<8e42> <8e42> 16217\n<8e43> <8e43> 14617\n<8e44> <8e44> 15984\n<8e45> <8e45> 14162\n<8e46> <8e46> 14511\n<8e47> <8e47> 14214\n<8e48> <8e48> 16155\n<8e49> <8e49> 15708\n<8e4a> <8e4a> 16281\n<8e4b> <8e4b> 16360\n<8e4c> <8e4c> 14475\n<8e4d> <8e4d> 14556\n<8e4e> <8e4e> 16298\n<8e4f> <8e4f> 17096\n<8e50> <8e50> 14145\n<8e51> <8e51> 15743\n<8e52> <8e52> 17132\n<8e53> <8e53> 16275\n<8e54> <8e54> 14490\n<8e55> <8e55> 14457\n<8e56> <8e56> 14138\n<8e57> <8e57> 17104\n<8e58> <8e58> 15983\n<8e59> <8e59> 16152\n<8e5a> <8e5a> 14056\n<8e5b> <8e5b> 14137\n<8e5c> <8e5c> 16025\n<8e5d> <8e5d> 15180\n<8e5e> <8e5e> 15826\n<8e5f> <8e5f> 16297\n<8e60> <8e60> 16300\n<8e61> <8e61> 16331\n<8e62> <8e62> 14131\n<8e63> <8e63> 16287\n<8e64> <8e64> 16602\n<8e65> <8e65> 16169\n<8e66> <8e66> 15462\n<8e67> <8e67> 16930\n<8e68> <8e68> 16558\n<8e69> <8e69> 15738\n<8e6a> <8e6a> 16269\n<8e6b> <8e6b> 14800\n<8e6c> <8e6c> 16996\n<8e6d> <8e6d> 15746\n<8e6e> <8e6e> 16899\n<8e6f> <8e6f> 16859\n<8e70> <8e70> 16350\n<8e71> <8e71> 16372\n<8e72> <8e72> 16388\n<8e73> <8e73> 16230\n<8e74> <8e74> 16283\n<8e75> <8e75> 15718\n<8e76> <8e76> 16459\n<8e77> <8e77> 16351\n<8e78> <8e78> 16635\n<8e79> <8e79> 16402\n<8e7a> <8e7a> 16358\n<8e7b> <8e7b> 17131\n<8e7c> <8e7c> 16676\n<8e7d> <8e7d> 15740\n<8e7e> <8e7e> 15721\n<8ea1> <8ea1> 16382\n<8ea2> <8ea2> 15730\n<8ea3> <8ea3> 16326\n<8ea4> <8ea4> 15614\n<8ea5> <8ea5> 17401\n<8ea6> <8ea6> 15682\n<8ea7> <8ea7> 16149\n<8ea8> <8ea8> 16334\n<8ea9> <8ea9> 17035\n<8eaa> <8eaa> 16591\n<8eab> <8eab> 17398\n<8eac> <8eac> 16389\n<8ead> <8ead> 16173\n<8eae> <8eae> 16737\n<8eaf> <8eaf> 16172\n<8eb0> <8eb0> 15050\n<8eb1> <8eb1> 15722\n<8eb2> <8eb2> 16483\n<8eb3> <8eb3> 16325\n<8eb4> <8eb4> 14823\n<8eb5> <8eb5> 16170\n<8eb6> <8eb6> 16480\n<8eb7> <8eb7> 17011\n<8eb8> <8eb8> 16929\n<8eb9> <8eb9> 16546\n<8eba> <8eba> 16232\n<8ebb> <8ebb> 16545\n<8ebc> <8ebc> 16215\n<8ebd> <8ebd> 16240\n<8ebe> <8ebe> 16311\n<8ebf> <8ebf> 14150\n<8ec0> <8ec0> 16299\n<8ec1> <8ec1> 16370\n<8ec2> <8ec2> 16268\n<8ec3> <8ec3> 16264\n<8ec4> <8ec4> 14291\nendcidrange\n\n100 begincidrange\n<8ec5> <8ec6> 15220\n<8ec7> <8ec7> 17140\n<8ec8> <8ec8> 15436\n<8ec9> <8ec9> 15226\n<8eca> <8eca> 14469\n<8ecb> <8ecb> 14135\n<8ecc> <8ecc> 16347\n<8ecd> <8ecd> 16157\n<8ece> <8ece> 16364\n<8ecf> <8ecf> 16357\n<8ed0> <8ed0> 14174\n<8ed1> <8ed1> 16375\n<8ed2> <8ed2> 14355\n<8ed3> <8ed3> 16355\n<8ed4> <8ed4> 16154\n<8ed5> <8ed5> 14566\n<8ed6> <8ed6> 16348\n<8ed7> <8ed7> 14207\n<8ed8> <8ed8> 15751\n<8ed9> <8ed9> 15315\n<8eda> <8eda> 15736\n<8edb> <8edb> 15316\n<8edc> <8edc> 16278\n<8edd> <8edd> 16277\n<8ede> <8ede> 15756\n<8edf> <8edf> 14647\n<8ee0> <8ee0> 16156\n<8ee1> <8ee1> 14642\n<8ee2> <8ee2> 15723\n<8ee3> <8ee3> 14336\n<8ee4> <8ee4> 16376\n<8ee5> <8ee5> 15418\n<8ee6> <8ee6> 16194\n<8ee7> <8ee7> 17405\n<8ee8> <8ee8> 16305\n<8ee9> <8ee9> 14226\n<8eea> <8eea> 16276\n<8eeb> <8eeb> 16158\n<8eec> <8eec> 16394\n<8eed> <8eed> 14466\n<8eee> <8eee> 16284\n<8eef> <8eef> 15713\n<8ef0> <8ef0> 16162\n<8ef1> <8ef1> 16361\n<8ef2> <8ef2> 15762\n<8ef3> <8ef3> 14207\n<8ef4> <8ef4> 15252\n<8ef5> <8ef5> 14190\n<8ef6> <8ef6> 17153\n<8ef7> <8ef7> 16186\n<8ef8> <8ef8> 14435\n<8ef9> <8ef9> 16369\n<8efa> <8efa> 17150\n<8efb> <8efb> 15356\n<8efc> <8efc> 16197\n<8efd> <8efd> 14239\n<8efe> <8efe> 14187\n<8f40> <8f40> 16148\n<8f41> <8f41> 16199\n<8f42> <8f42> 14434\n<8f43> <8f43> 14185\n<8f44> <8f44> 15378\n<8f45> <8f45> 16201\n<8f46> <8f46> 14367\n<8f47> <8f47> 14633\n<8f48> <8f48> 16214\n<8f49> <8f49> 16180\n<8f4a> <8f4a> 16349\n<8f4b> <8f4b> 14586\n<8f4c> <8f4c> 16251\n<8f4d> <8f4d> 15377\n<8f4e> <8f4e> 16252\n<8f4f> <8f4f> 17407\n<8f50> <8f50> 15987\n<8f51> <8f51> 16241\n<8f52> <8f52> 14629\n<8f53> <8f53> 15445\n<8f54> <8f54> 14517\n<8f55> <8f55> 16218\n<8f56> <8f56> 14358\n<8f57> <8f57> 15981\n<8f58> <8f58> 14210\n<8f59> <8f59> 16145\n<8f5a> <8f5a> 15243\n<8f5b> <8f5b> 14272\n<8f5c> <8f5c> 14357\n<8f5d> <8f5d> 14395\n<8f5e> <8f5e> 15731\n<8f5f> <8f5f> 15726\n<8f60> <8f60> 16266\n<8f61> <8f61> 16190\n<8f62> <8f62> 16948\n<8f63> <8f63> 16867\n<8f64> <8f64> 16327\n<8f65> <8f65> 16371\n<8f66> <8f66> 16387\n<8f67> <8f67> 16434\n<8f68> <8f68> 16238\n<8f69> <8f69> 16803\n<8f6a> <8f6a> 16390\nendcidrange\n\n100 begincidrange\n<8f6b> <8f6b> 16171\n<8f6c> <8f6c> 16253\n<8f6d> <8f6d> 15475\n<8f6e> <8f6e> 16150\n<8f6f> <8f6f> 16386\n<8f70> <8f70> 16470\n<8f71> <8f71> 16314\n<8f72> <8f72> 16235\n<8f73> <8f73> 16273\n<8f74> <8f74> 16318\n<8f75> <8f75> 16474\n<8f76> <8f76> 15071\n<8f77> <8f77> 15937\n<8f78> <8f78> 15719\n<8f79> <8f79> 16224\n<8f7a> <8f7a> 16872\n<8f7b> <8f7b> 16320\n<8f7c> <8f7c> 15747\n<8f7d> <8f7d> 16755\n<8f7e> <8f7e> 16220\n<8fa1> <8fa1> 16178\n<8fa2> <8fa2> 16191\n<8fa3> <8fa3> 15715\n<8fa4> <8fa4> 16710\n<8fa5> <8fa5> 16333\n<8fa6> <8fa6> 15737\n<8fa7> <8fa7> 16168\n<8fa8> <8fa8> 16321\n<8fa9> <8fa9> 16572\n<8faa> <8faa> 15729\n<8fab> <8fab> 16183\n<8fac> <8fac> 17112\n<8fad> <8fad> 16363\n<8fae> <8fae> 16961\n<8faf> <8faf> 14896\n<8fb0> <8fb0> 14797\n<8fb1> <8fb1> 17087\n<8fb2> <8fb2> 16910\n<8fb3> <8fb3> 16138\n<8fb4> <8fb4> 14796\n<8fb5> <8fb5> 16452\n<8fb6> <8fb6> 16536\n<8fb7> <8fb7> 16780\n<8fb8> <8fb8> 15716\n<8fb9> <8fb9> 16196\n<8fba> <8fba> 16463\n<8fbb> <8fbb> 17109\n<8fbc> <8fbc> 17040\n<8fbd> <8fbd> 16384\n<8fbe> <8fbe> 14985\n<8fbf> <8fbf> 16748\n<8fc0> <8fc0> 16580\n<8fc1> <8fc1> 16461\n<8fc2> <8fc2> 15808\n<8fc3> <8fc3> 16208\n<8fc4> <8fc4> 16393\n<8fc5> <8fc5> 16303\n<8fc6> <8fc6> 16262\n<8fc7> <8fc7> 16531\n<8fc8> <8fc8> 15021\n<8fc9> <8fc9> 16184\n<8fca> <8fca> 15733\n<8fcb> <8fcb> 16185\n<8fcc> <8fcc> 17101\n<8fcd> <8fcd> 16248\n<8fce> <8fce> 16285\n<8fcf> <8fcf> 16528\n<8fd0> <8fd0> 15744\n<8fd1> <8fd1> 16174\n<8fd2> <8fd2> 14518\n<8fd3> <8fd3> 16825\n<8fd4> <8fd4> 15754\n<8fd5> <8fd5> 16164\n<8fd6> <8fd6> 15006\n<8fd7> <8fd7> 15068\n<8fd8> <8fd8> 15717\n<8fd9> <8fd9> 16517\n<8fda> <8fda> 16209\n<8fdb> <8fdb> 17402\n<8fdc> <8fdc> 16227\n<8fdd> <8fdd> 16760\n<8fde> <8fde> 16823\n<8fdf> <8fdf> 15986\n<8fe0> <8fe0> 16857\n<8fe1> <8fe1> 16782\n<8fe2> <8fe2> 15734\n<8fe3> <8fe3> 17108\n<8fe4> <8fe4> 17058\n<8fe5> <8fe5> 16983\n<8fe6> <8fe6> 16140\n<8fe7> <8fe7> 14742\n<8fe8> <8fe8> 16981\n<8fe9> <8fe9> 16567\n<8fea> <8fea> 16282\n<8feb> <8feb> 16330\n<8fec> <8fec> 16222\n<8fed> <8fed> 15749\n<8fee> <8fee> 16378\n<8fef> <8fef> 16310\n<8ff0> <8ff0> 15043\nendcidrange\n\n100 begincidrange\n<8ff1> <8ff1> 16328\n<8ff2> <8ff2> 16203\n<8ff3> <8ff3> 16625\n<8ff4> <8ff4> 16436\n<8ff5> <8ff5> 16219\n<8ff6> <8ff6> 17097\n<8ff7> <8ff7> 15477\n<8ff8> <8ff8> 16249\n<8ff9> <8ff9> 17094\n<8ffa> <8ffa> 14543\n<8ffb> <8ffb> 16884\n<8ffc> <8ffc> 16193\n<8ffd> <8ffd> 14603\n<8ffe> <8ffe> 14560\n<9040> <9040> 17021\n<9041> <9041> 17136\n<9042> <9042> 16167\n<9043> <9043> 14370\n<9044> <9044> 14296\n<9045> <9045> 14242\n<9046> <9046> 16243\n<9047> <9047> 17080\n<9048> <9048> 16153\n<9049> <9049> 17079\n<904a> <904a> 15755\n<904b> <904b> 16681\n<904c> <904c> 16596\n<904d> <904d> 14581\n<904e> <904e> 16707\n<904f> <904f> 16418\n<9050> <9050> 16848\n<9051> <9051> 16885\n<9052> <9052> 16195\n<9053> <9053> 16584\n<9054> <9054> 16534\n<9055> <9055> 16477\n<9056> <9056> 16756\n<9057> <9057> 16702\n<9058> <9058> 16699\n<9059> <9059> 14788\n<905a> <905a> 15753\n<905b> <905b> 16901\n<905c> <905c> 14059\n<905d> <905d> 14789\n<905e> <905e> 15748\n<905f> <905f> 16468\n<9060> <9060> 6463\n<9061> <9061> 1561\n<9062> <9062> 2161\n<9063> <9063> 4447\n<9064> <9064> 16211\n<9065> <9065> 16159\n<9066> <9066> 13213\n<9067> <9067> 16312\n<9068> <9068> 15167\n<9069> <9069> 16210\n<906a> <906a> 14177\n<906b> <906b> 14172\n<906c> <906c> 16345\n<906d> <906d> 16343\n<906e> <906e> 16342\n<906f> <906f> 16019\n<9070> <9070> 14196\n<9071> <9071> 14203\n<9072> <9072> 15183\n<9073> <9073> 16391\n<9074> <9074> 16354\n<9075> <9075> 15993\n<9076> <9076> 15990\n<9077> <9077> 16359\n<9078> <9078> 3370\n<9079> <9079> 16366\n<907a> <907a> 16353\n<907b> <907b> 15991\n<907c> <907c> 16291\n<907d> <907d> 16212\n<907e> <907e> 14268\n<90a1> <90a1> 15994\n<90a2> <90a2> 16289\n<90a3> <90a3> 14273\n<90a4> <90a4> 16373\n<90a5> <90a5> 16286\n<90a6> <90a6> 15231\n<90a7> <90a7> 14347\n<90a8> <90a8> 16367\n<90a9> <90a9> 16380\n<90aa> <90aa> 14349\n<90ab> <90ab> 16365\n<90ac> <90ac> 16356\n<90ad> <90ad> 14353\n<90ae> <90ae> 16250\n<90af> <90af> 16290\n<90b0> <90b0> 15246\n<90b1> <90b1> 14364\n<90b2> <90b2> 16288\n<90b3> <90b3> 16352\n<90b4> <90b4> 15763\n<90b5> <90b5> 14375\n<90b6> <90b6> 16368\n<90b7> <90b7> 16293\nendcidrange\n\n100 begincidrange\n<90b8> <90b8> 14390\n<90b9> <90b9> 15757\n<90ba> <90ba> 16233\n<90bb> <90bb> 16258\n<90bc> <90bc> 16261\n<90bd> <90bd> 16259\n<90be> <90be> 16265\n<90bf> <90bf> 16255\n<90c0> <90c0> 15285\n<90c1> <90c1> 16263\n<90c2> <90c2> 16177\n<90c3> <90c3> 15764\n<90c4> <90c4> 560\n<90c5> <90c5> 17406\n<90c6> <90c6> 16144\n<90c7> <90c7> 14462\n<90c8> <90c8> 17387\n<90c9> <90c9> 16239\n<90ca> <90ca> 16027\n<90cb> <90cb> 16206\n<90cc> <90cc> 15304\n<90cd> <90cd> 7721\n<90ce> <90ce> 16200\n<90cf> <90cf> 14382\n<90d0> <90d0> 15456\n<90d1> <90d1> 10911\n<90d2> <90d2> 14483\n<90d3> <90d3> 17399\n<90d4> <90d4> 15988\n<90d5> <90d5> 15309\n<90d6> <90d6> 15049\n<90d7> <90d7> 16332\n<90d8> <90d8> 16337\n<90d9> <90d9> 16189\n<90da> <90da> 16202\n<90db> <90db> 14509\n<90dc> <90dc> 9042\n<90dd> <90dd> 16198\n<90de> <90de> 14514\n<90df> <90df> 16307\n<90e0> <90e0> 16141\n<90e1> <90e1> 14528\n<90e2> <90e2> 15919\n<90e3> <90e3> 14549\n<90e4> <90e4> 16181\n<90e5> <90e5> 14551\n<90e6> <90e6> 16175\n<90e7> <90e7> 16179\n<90e8> <90e8> 15765\n<90e9> <90e9> 15362\n<90ea> <90ea> 16242\n<90eb> <90eb> 15766\n<90ec> <90ec> 14567\n<90ed> <90ed> 16437\n<90ee> <90ee> 15371\n<90ef> <90ef> 14576\n<90f0> <90f0> 14583\n<90f1> <90f1> 16313\n<90f2> <90f2> 14592\n<90f3> <90f3> 16244\n<90f4> <90f4> 14601\n<90f5> <90f5> 16146\n<90f6> <90f6> 16151\n<90f7> <90f7> 16160\n<90f8> <90f8> 16315\n<90f9> <90f9> 16188\n<90fa> <90fa> 16308\n<90fb> <90fb> 16301\n<90fc> <90fc> 14618\n<90fd> <90fd> 14620\n<90fe> <90fe> 14619\n<9140> <9140> 15417\n<9141> <9141> 15985\n<9142> <9142> 15742\n<9143> <9143> 16187\n<9144> <9144> 16176\n<9145> <9145> 16260\n<9146> <9146> 17400\n<9147> <9147> 16143\n<9148> <9148> 16246\n<9149> <9149> 14643\n<914a> <914a> 16245\n<914b> <914b> 14656\n<914c> <914c> 16161\n<914d> <914d> 16272\n<914e> <914e> 14666\n<914f> <914f> 16256\n<9150> <9150> 16163\n<9151> <9151> 14672\n<9152> <9152> 15767\n<9153> <9153> 11845\n<9154> <9154> 1392\n<9155> <9155> 16045\n<9156> <9156> 13602\n<9157> <9157> 3043\n<9158> <9158> 1429\n<9159> <9159> 552\n<915a> <915a> 2709\n<915b> <915b> 4784\n<915c> <915c> 2330\nendcidrange\n\n100 begincidrange\n<915d> <915d> 17404\n<915e> <915e> 16274\n<915f> <915f> 16302\n<9160> <9160> 1986\n<9161> <9161> 2389\n<9162> <9162> 14213\n<9163> <9163> 15982\n<9164> <9164> 15725\n<9165> <9165> 16226\n<9166> <9166> 14792\n<9167> <9167> 16229\n<9168> <9168> 14653\n<9169> <9169> 16166\n<916a> <916a> 16493\n<916b> <916b> 16336\n<916c> <916c> 16182\n<916d> <916d> 16518\n<916e> <916e> 14674\n<916f> <916f> 16338\n<9170> <9170> 14424\n<9171> <9171> 16379\n<9172> <9172> 16231\n<9173> <9173> 16001\n<9174> <9174> 16329\n<9175> <9175> 16309\n<9176> <9176> 15996\n<9177> <9177> 15989\n<9178> <9178> 15479\n<9179> <9179> 15150\n<917a> <917a> 16205\n<917b> <917b> 17327\n<917c> <917c> 15975\n<917d> <917d> 16573\n<917e> <917e> 16236\n<91a1> <91a1> 14758\n<91a2> <91a2> 14664\n<91a3> <91a3> 16319\n<91a4> <91a4> 16223\n<91a5> <91a5> 14853\n<91a6> <91a6> 1781\n<91a7> <91a7> 16632\n<91a8> <91a8> 16813\n<91a9> <91a9> 16142\n<91aa> <91aa> 16674\n<91ab> <91ab> 16147\n<91ac> <91ac> 16139\n<91ad> <91ad> 16693\n<91ae> <91ae> 14891\n<91af> <91af> 16696\n<91b0> <91b0> 550\n<91b1> <91b1> 16713\n<91b2> <91b2> 15269\n<91b3> <91b3> 16385\n<91b4> <91b4> 16317\n<91b5> <91b5> 16296\n<91b6> <91b6> 16774\n<91b7> <91b7> 14932\n<91b8> <91b8> 16322\n<91b9> <91b9> 16786\n<91ba> <91ba> 16775\n<91bb> <91bb> 13188\n<91bc> <91bc> 16324\n<91bd> <91bd> 15769\n<91be> <91be> 15018\n<91bf> <91c0> 16862\n<91c1> <91c1> 16374\n<91c2> <91c2> 16221\n<91c3> <91c3> 16839\n<91c4> <91c4> 15761\n<91c5> <91c5> 15732\n<91c6> <91c6> 16204\n<91c7> <91c7> 16882\n<91c8> <91c8> 15013\n<91c9> <91c9> 15179\n<91ca> <91ca> 15750\n<91cb> <91cb> 16888\n<91cc> <91cc> 16960\n<91cd> <91cd> 16381\n<91ce> <91ce> 16295\n<91cf> <91cf> 16985\n<91d0> <91d0> 3698\n<91d1> <91d1> 16994\n<91d2> <91d2> 15486\n<91d3> <91d3> 14648\n<91d4> <91d4> 16947\n<91d5> <91d5> 10586\n<91d7> <91d7> 16279\n<91d8> <91d8> 16306\n<91d9> <91d9> 17034\n<91da> <91da> 16280\n<91db> <91db> 8084\n<91dc> <91dc> 16192\n<91dd> <91dd> 16207\n<91de> <91de> 16271\n<91df> <91df> 15727\n<91e0> <91e0> 17119\n<91e1> <91e1> 16213\n<91e2> <91e2> 16339\n<91e3> <91e3> 17134\n<91e4> <91e4> 16335\nendcidrange\n\n100 begincidrange\n<91e5> <91e5> 16340\n<91e6> <91e6> 15997\n<91e7> <91e7> 17159\n<91e8> <91e8> 17403\n<91e9> <91e9> 16346\n<91ea> <91ea> 3338\n<91eb> <91eb> 16247\n<91ec> <91ec> 15807\n<91ed> <91ed> 16428\n<91ee> <91ee> 16292\n<91ef> <91ef> 15727\n<91f0> <91f0> 15565\n<91f1> <91f1> 16228\n<91f2> <91f2> 16267\n<91f3> <91f3> 14447\n<91f4> <91f4> 6513\n<91f5> <91f5> 7323\n<91f6> <91f6> 1861\n<91f7> <91f7> 7541\n<91f8> <91f8> 14472\n<91f9> <91f9> 14146\n<91fa> <91fa> 11072\n<91fb> <91fb> 14057\n<91fc> <91fc> 14304\n<91fd> <91fd> 15894\n<91fe> <91fe> 14460\n<9240> <9240> 14250\n<9241> <9241> 16270\n<9242> <9242> 16604\n<9243> <9243> 15482\n<9244> <9244> 16294\n<9245> <9245> 16479\n<9246> <9246> 15398\n<9247> <9247> 14430\n<9248> <9248> 16165\n<9249> <9249> 16456\n<924a> <924a> 15745\n<924b> <924b> 14606\n<924c> <924c> 16516\n<924d> <924d> 16664\n<924e> <924e> 16727\n<924f> <924f> 14594\n<9250> <9250> 14495\n<9251> <9251> 16377\n<9252> <9252> 14371\n<9253> <9253> 14449\n<9254> <9254> 14058\n<9255> <9255> 14188\n<9256> <9256> 14144\n<9257> <9257> 14324\n<9258> <9258> 17120\n<9259> <9259> 16987\n<925a> <925a> 14061\n<925b> <925b> 15124\n<925c> <925c> 17093\n<925d> <925d> 16523\n<925e> <925e> 14501\n<925f> <925f> 16746\n<9260> <9260> 16797\n<9261> <9261> 16708\n<9262> <9262> 16975\n<9263> <9263> 16225\n<9264> <9264> 16344\n<9265> <9265> 1564\n<a140> <a158> 99\n<a159> <a15c> 13743\n<a15d> <a17e> 128\n<a1a1> <a1f5> 162\n<a1f6> <a1f6> 248\n<a1f7> <a1f7> 247\n<a1f8> <a1fe> 249\n<a240> <a27e> 256\n<a2a1> <a2fe> 319\n<a340> <a37e> 413\n<a3a1> <a3bb> 476\n<a3bd> <a3bf> 503\n<a440> <a47e> 595\n<a4a1> <a4fe> 658\n<a540> <a57e> 752\n<a5a1> <a5fe> 815\n<a640> <a67e> 909\n<a6a1> <a6fe> 972\n<a740> <a77e> 1066\n<a7a1> <a7fe> 1129\n<a840> <a87e> 1223\n<a8a1> <a8fe> 1286\n<a940> <a97e> 1380\n<a9a1> <a9fe> 1443\n<aa40> <aa7e> 1537\n<aaa1> <aafe> 1600\n<ab40> <ab7e> 1694\n<aba1> <abfe> 1757\n<ac40> <ac7e> 1851\n<aca1> <acfd> 1914\n<acfe> <acfe> 2431\n<ad40> <ad7e> 2007\n<ada1> <adfe> 2070\n<ae40> <ae7e> 2164\n<aea1> <aefe> 2227\n<af40> <af7e> 2321\nendcidrange\n\n100 begincidrange\n<afa1> <afcf> 2384\n<afd0> <affe> 2432\n<b040> <b07e> 2479\n<b0a1> <b0fe> 2542\n<b140> <b17e> 2636\n<b1a1> <b1fe> 2699\n<b240> <b27e> 2793\n<b2a1> <b2fe> 2856\n<b340> <b37e> 2950\n<b3a1> <b3fe> 3013\n<b440> <b47e> 3107\n<b4a1> <b4fe> 3170\n<b540> <b57e> 3264\n<b5a1> <b5fe> 3327\n<b640> <b67e> 3421\n<b6a1> <b6fe> 3484\n<b740> <b77e> 3578\n<b7a1> <b7fe> 3641\n<b840> <b87e> 3735\n<b8a1> <b8fe> 3798\n<b940> <b97e> 3892\n<b9a1> <b9fe> 3955\n<ba40> <ba7e> 4049\n<baa1> <bafe> 4112\n<bb40> <bb7e> 4206\n<bba1> <bbc7> 4269\n<bbc8> <bbfe> 4309\n<bc40> <bc7e> 4364\n<bca1> <bcfe> 4427\n<bd40> <bd7e> 4521\n<bda1> <bdfe> 4584\n<be40> <be51> 4678\n<be52> <be52> 4308\n<be53> <be7e> 4696\n<bea1> <befe> 4740\n<bf40> <bf7e> 4834\n<bfa1> <bffe> 4897\n<c040> <c07e> 4991\n<c0a1> <c0fe> 5054\n<c140> <c17e> 5148\n<c1a1> <c1aa> 5211\n<c1ab> <c1fe> 5222\n<c240> <c27e> 5306\n<c2a1> <c2ca> 5369\n<c2cb> <c2cb> 5221\n<c2cc> <c2fe> 5411\n<c340> <c360> 5462\n<c361> <c37e> 5496\n<c3a1> <c3b8> 5526\n<c3b9> <c3b9> 5551\n<c3ba> <c3ba> 5550\n<c3bb> <c3fe> 5552\n<c440> <c455> 5620\n<c456> <c456> 5495\n<c457> <c47e> 5642\n<c4a1> <c4fe> 5682\n<c540> <c57e> 5776\n<c5a1> <c5fe> 5839\n<c640> <c67e> 5933\n<c940> <c949> 5996\n<c94a> <c94a> 628\n<c94b> <c96b> 6006\n<c96c> <c97e> 6040\n<c9a1> <c9bd> 6059\n<c9be> <c9be> 6039\n<c9bf> <c9ec> 6088\n<c9ed> <c9fe> 6135\n<ca40> <ca7e> 6153\n<caa1> <caf6> 6216\n<caf7> <caf7> 6134\n<caf8> <cafe> 6302\n<cb40> <cb7e> 6309\n<cba1> <cbfe> 6372\n<cc40> <cc7e> 6466\n<cca1> <ccfe> 6529\n<cd40> <cd7e> 6623\n<cda1> <cdfe> 6686\n<ce40> <ce7e> 6780\n<cea1> <cefe> 6843\n<cf40> <cf7e> 6937\n<cfa1> <cffe> 7000\n<d040> <d07e> 7094\n<d0a1> <d0fe> 7157\n<d140> <d17e> 7251\n<d1a1> <d1fe> 7314\n<d240> <d27e> 7408\n<d2a1> <d2fe> 7471\n<d340> <d37e> 7565\n<d3a1> <d3fe> 7628\n<d440> <d47e> 7722\n<d4a1> <d4fe> 7785\n<d540> <d57e> 7879\n<d5a1> <d5fe> 7942\n<d640> <d67e> 8036\n<d6a1> <d6cb> 8099\n<d6cc> <d6cc> 8788\n<d6cd> <d6fe> 8143\n<d740> <d779> 8193\n<d77a> <d77a> 8889\n<d77b> <d77e> 8251\nendcidrange\n\n100 begincidrange\n<d7a1> <d7fe> 8255\n<d840> <d87e> 8349\n<d8a1> <d8fe> 8412\n<d940> <d97e> 8506\n<d9a1> <d9fe> 8569\n<da40> <da7e> 8663\n<daa1> <dade> 8726\n<dadf> <dadf> 8142\n<dae0> <dafe> 8789\n<db40> <db7e> 8820\n<dba1> <dba6> 8883\n<dba7> <dbfe> 8890\n<dc40> <dc7e> 8978\n<dca1> <dcfe> 9041\n<dd40> <dd7e> 9135\n<dda1> <ddfb> 9198\n<ddfc> <ddfc> 9089\n<ddfd> <ddfe> 9289\n<de40> <de7e> 9291\n<dea1> <defe> 9354\n<df40> <df7e> 9448\n<dfa1> <dffe> 9511\n<e040> <e07e> 9605\n<e0a1> <e0fe> 9668\n<e140> <e17e> 9762\n<e1a1> <e1fe> 9825\n<e240> <e27e> 9919\n<e2a1> <e2fe> 9982\n<e340> <e37e> 10076\n<e3a1> <e3fe> 10139\n<e440> <e47e> 10233\n<e4a1> <e4fe> 10296\n<e540> <e57e> 10390\n<e5a1> <e5fe> 10453\n<e640> <e67e> 10547\n<e6a1> <e6fe> 10610\n<e740> <e77e> 10704\n<e7a1> <e7fe> 10767\n<e840> <e87e> 10861\n<e8a1> <e8a2> 10924\n<e8a3> <e8fe> 10927\n<e940> <e975> 11019\n<e976> <e97e> 11074\n<e9a1> <e9fe> 11083\n<ea40> <ea7e> 11177\n<eaa1> <eafe> 11240\n<eb40> <eb5a> 11334\n<eb5b> <eb7e> 11362\n<eba1> <ebf0> 11398\n<ebf1> <ebf1> 10926\n<ebf2> <ebfe> 11478\n<ec40> <ec7e> 11491\n<eca1> <ecdd> 11554\n<ecde> <ecde> 11073\n<ecdf> <ecfe> 11615\n<ed40> <ed7e> 11647\n<eda1> <eda9> 11710\n<edaa> <edfe> 11720\n<ee40> <ee7e> 11805\n<eea1> <eeea> 11868\n<eeeb> <eeeb> 12308\n<eeec> <eefe> 11942\n<ef40> <ef7e> 11961\n<efa1> <effe> 12024\n<f040> <f055> 12118\n<f056> <f056> 11719\n<f057> <f07e> 12140\n<f0a1> <f0ca> 12180\n<f0cb> <f0cb> 11361\n<f0cc> <f0fe> 12222\n<f140> <f162> 12273\n<f163> <f16a> 12309\n<f16b> <f16b> 12640\n<f16c> <f17e> 12317\n<f1a1> <f1fe> 12336\n<f240> <f267> 12430\n<f268> <f268> 12783\n<f269> <f27e> 12470\n<f2a1> <f2c2> 12492\n<f2c3> <f2fe> 12527\n<f340> <f374> 12587\n<f375> <f37e> 12641\n<f3a1> <f3fe> 12651\n<f440> <f465> 12745\n<f466> <f47e> 12784\n<f4a1> <f4b4> 12809\n<f4b5> <f4b5> 12526\n<f4b6> <f4fc> 12829\n<f4fd> <f4fe> 12901\n<f540> <f57e> 12903\n<f5a1> <f5fe> 12966\n<f640> <f662> 13060\n<f663> <f663> 12900\n<f664> <f67e> 13095\n<f6a1> <f6fe> 13122\n<f740> <f77e> 13216\n<f7a1> <f7fe> 13279\n<f840> <f87e> 13373\n<f8a1> <f8fe> 13436\n<f940> <f976> 13530\nendcidrange\n\n7 begincidrange\n<f977> <f97e> 13586\n<f9a1> <f9c3> 13594\n<f9c4> <f9c4> 13585\n<f9c5> <f9c5> 13629\n<f9c6> <f9c6> 13641\n<f9c7> <f9d1> 13630\n<f9d2> <f9d5> 13642\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/HKdlb-B5-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (HKdlb-B5-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (HKdlb-B5-H)\n%%BeginResource: CMap (HKdlb-B5-V)\n%%Title: (HKdlb-B5-V Adobe CNS1 1)\n%%Version: 12.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/HKdlb-B5-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 1 def\nend def\n\n/CMapName /HKdlb-B5-V def\n/CMapVersion 12.002 def\n/CMapType 1 def\n\n/XUID [1 10 25524] def\n\n/WMode 1 def\n\n12 begincidrange\n<a14b> <a14b> 13646\n<a15a> <a15a> 13743\n<a15c> <a15c> 13745\n<a15d> <a15e> 130\n<a161> <a162> 134\n<a165> <a166> 138\n<a169> <a16a> 142\n<a16d> <a16e> 146\n<a171> <a172> 150\n<a175> <a176> 154\n<a179> <a17a> 158\n<a1e3> <a1e3> 13647\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/HKgccs-B5-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (HKgccs-B5-H)\n%%Title: (HKgccs-B5-H Adobe CNS1 1)\n%%Version: 1.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 1 def\nend def\n\n/CMapName /HKgccs-B5-H def\n/CMapVersion 1.003 def\n/CMapType 1 def\n\n/XUID [1 10 25399] def\n\n/WMode 0 def\n\n2 begincodespacerange\n  <00>   <80>\n  <8A40> <FEFE>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 1\nendnotdefrange\n\n100 begincidrange\n<20> <7e> 1\n<8a40> <8a7e> 17160\n<8aa1> <8ae5> 17223\n<8b41> <8b42> 17292\n<8b45> <8b45> 17294\n<8b47> <8b47> 17295\n<8b49> <8b49> 17296\n<8b4b> <8b4b> 17297\n<8b4d> <8b50> 17298\n<8b54> <8b54> 17302\n<8b58> <8b58> 17303\n<8b5a> <8b5a> 17304\n<8e40> <8e44> 14123\n<8e46> <8e6a> 14128\n<8e6c> <8e75> 14165\n<8e77> <8e7d> 14175\n<8e7e> <8e7e> 289\n<8ea1> <8ea5> 14182\n<8ea7> <8ec8> 14187\n<8eca> <8ee4> 14221\n<8ee6> <8eee> 14248\n<8ef0> <8efe> 14257\n<8f40> <8f58> 14272\n<8f5a> <8f5e> 14297\n<8f60> <8f66> 14302\n<8f68> <8f7e> 14309\n<8fa1> <8fc4> 14332\n<8fc6> <8fc6> 14368\n<8fc8> <8fd9> 14369\n<8fdb> <8ffb> 14387\n<8ffd> <8ffe> 14420\n<9040> <905b> 14422\n<905e> <906e> 14450\n<9070> <9079> 14467\n<907a> <907a> 14057\n<907b> <907e> 14477\n<90a1> <90a5> 14481\n<90a7> <90b7> 14486\n<90b9> <90fe> 14503\n<9140> <9164> 14573\n<9166> <916d> 14610\n<916f> <917d> 14618\n<91a1> <91a1> 14633\n<91a3> <91fe> 14634\n<9240> <927e> 14726\n<92a1> <92ae> 14789\n<92af> <92b0> 281\n<92b1> <92b1> 284\n<92b2> <92b2> 283\n<92b3> <92e4> 14803\n<92e6> <92f1> 14853\n<92f3> <92fe> 14865\n<9340> <9367> 14877\n<9369> <937e> 14917\n<93a1> <93a9> 14939\n<93ab> <93c1> 14948\n<93c3> <93e4> 14971\n<93e6> <93ea> 15005\n<93ec> <93fe> 15010\n<9440> <9445> 15029\n<9447> <947e> 15035\n<94a1> <94fe> 15091\n<9540> <954c> 15185\n<954e> <9559> 15198\n<955b> <957e> 15210\n<95a1> <95c5> 15246\n<95c7> <95fe> 15283\n<9640> <967e> 15339\n<96a1> <96d3> 15402\n<96d5> <96fe> 15453\n<9740> <977e> 15495\n<97a1> <97fe> 15558\n<9840> <9874> 15652\n<9877> <9877> 15705\n<987a> <987a> 15706\n<98a3> <98a3> 15707\n<98af> <98af> 15708\n<98b6> <98b6> 15709\n<98b9> <98b9> 15710\n<98bd> <98be> 15711\n<98c2> <98c2> 15713\n<98c4> <98c4> 15714\n<98c6> <98c7> 15715\n<98e3> <98e3> 15717\n<98e7> <98e7> 15718\n<98ed> <98ed> 15719\n<98f0> <98f0> 15720\n<98f2> <98f2> 15721\n<98fc> <98fc> 15722\n<9943> <9943> 15723\n<9945> <9945> 15724\n<994f> <994f> 15725\n<996a> <996a> 15726\n<996e> <996e> 15727\n<9975> <9975> 15728\n<9978> <9978> 15729\n<99a2> <99a2> 15730\n<99ae> <99ae> 15731\n<99b6> <99b6> 15732\n<99ba> <99ba> 15733\nendcidrange\n\n100 begincidrange\n<99e2> <99e2> 15734\n<99f4> <99f4> 15735\n<9a4a> <9a4a> 15736\n<9a4c> <9a4c> 15737\n<9a59> <9a59> 15738\n<9a61> <9a61> 15739\n<9a68> <9a68> 15740\n<9a73> <9a73> 15741\n<9a7e> <9a7e> 15742\n<9ab2> <9ab2> 15743\n<9ab7> <9ab7> 15744\n<9ab9> <9ab9> 15745\n<9abb> <9abb> 15746\n<9ac7> <9ac7> 15747\n<9ad0> <9ad0> 15748\n<9ad2> <9ad2> 15749\n<9ad9> <9adb> 15750\n<9ae2> <9ae2> 15753\n<9ae4> <9ae4> 15754\n<9ae8> <9ae8> 15755\n<9af2> <9af2> 15756\n<9af6> <9af6> 15757\n<9afb> <9afb> 15758\n<9b46> <9b46> 15759\n<9b4a> <9b4a> 15760\n<9b4c> <9b4c> 15761\n<9b54> <9b54> 15762\n<9b58> <9b58> 15763\n<9b5a> <9b5a> 15764\n<9b5c> <9b5c> 15765\n<9b5e> <9b5f> 15766\n<9b70> <9b73> 15768\n<9b76> <9b78> 15772\n<9b7b> <9b7c> 15775\n<9b7e> <9b7e> 15777\n<9ba1> <9ba1> 15778\n<9ba3> <9ba4> 15779\n<9ba7> <9baa> 15781\n<9bac> <9bac> 15785\n<9baf> <9baf> 15786\n<9bb2> <9bb9> 15787\n<9bbe> <9bbe> 15795\n<9bc0> <9bc6> 15796\n<9bca> <9bca> 15803\n<9bcc> <9bcc> 15804\n<9bd0> <9bd1> 15805\n<9bd3> <9bd3> 15807\n<9bd5> <9bd5> 15808\n<9bd8> <9bda> 15809\n<9bdd> <9bdd> 15812\n<9bde> <9bde> 7188\n<9bdf> <9bdf> 15813\n<9be1> <9be1> 15814\n<9be3> <9be3> 15815\n<9be7> <9be7> 15816\n<9be9> <9bec> 15817\n<9bee> <9bef> 15821\n<9bf3> <9bf3> 15823\n<9bf6> <9bf6> 15824\n<9bf8> <9bf9> 15825\n<9bfb> <9bfc> 15827\n<9c40> <9c42> 15829\n<9c44> <9c46> 15832\n<9c48> <9c48> 15835\n<9c4a> <9c4a> 15836\n<9c4d> <9c53> 15837\n<9c55> <9c55> 15844\n<9c57> <9c5b> 15845\n<9c5d> <9c5d> 15850\n<9c60> <9c60> 15851\n<9c62> <9c62> 15852\n<9c64> <9c66> 15853\n<9c68> <9c68> 15856\n<9c6a> <9c6a> 15857\n<9c6b> <9c6b> 13418\n<9c6d> <9c6d> 15858\n<9c6f> <9c72> 15859\n<9c75> <9c77> 15863\n<9c79> <9c79> 15866\n<9c7b> <9c7c> 15867\n<9c7e> <9c7e> 15869\n<9ca1> <9ca2> 15870\n<9ca5> <9ca5> 15872\n<9ca8> <9ca9> 15873\n<9cab> <9cab> 15875\n<9cad> <9cae> 15876\n<9cb1> <9cba> 15878\n<9cbc> <9cc2> 15888\n<9cc6> <9ccd> 15895\n<9ccf> <9cd3> 15903\n<9cd8> <9cda> 15908\n<9cdc> <9ce5> 15911\n<9ce7> <9ce9> 15921\n<9ceb> <9cec> 15924\n<9cee> <9cf9> 15926\n<9cfd> <9cfd> 15938\n<9d46> <9d46> 15939\n<9d49> <9d4a> 15940\n<9d4c> <9d4d> 15942\n<9d4f> <9d4f> 15944\nendcidrange\n\n100 begincidrange\n<9d51> <9d51> 15945\n<9d55> <9d55> 15946\n<9d57> <9d57> 9665\n<9d5a> <9d5a> 15947\n<9d62> <9d62> 15948\n<9d64> <9d64> 15949\n<9d79> <9d79> 15950\n<9d7e> <9d7e> 15951\n<9da5> <9da8> 15952\n<9daa> <9daa> 15956\n<9dac> <9dae> 15957\n<9db0> <9db0> 15960\n<9db3> <9db3> 15961\n<9db5> <9db5> 15962\n<9db7> <9db7> 15963\n<9dbc> <9dbd> 15964\n<9dbf> <9dc0> 15966\n<9dc3> <9dc4> 15968\n<9dc7> <9dc8> 15970\n<9dca> <9dca> 15972\n<9dcd> <9dd1> 15973\n<9dd3> <9dd5> 15978\n<9dda> <9dfb> 15981\n<9dfd> <9dfe> 16015\n<9e40> <9e62> 16017\n<9e64> <9e65> 16052\n<9e68> <9e68> 16054\n<9e6a> <9e6a> 16055\n<9e71> <9e71> 16056\n<9e73> <9e73> 16057\n<9e77> <9e78> 16058\n<9e7a> <9e7a> 16060\n<9e7c> <9e7c> 16061\n<9e7e> <9e7e> 16062\n<9ea1> <9ea2> 16063\n<9ea4> <9ea6> 16065\n<9ea9> <9eaa> 16068\n<9eac> <9ead> 16070\n<9eaf> <9eb1> 16072\n<9eb4> <9eb4> 16075\n<9eb6> <9eb7> 16076\n<9eb9> <9eb9> 16078\n<9ebc> <9ebc> 16079\n<9ebf> <9ec0> 16080\n<9ec4> <9ec5> 16082\n<9ec7> <9eca> 16084\n<9ecc> <9ecd> 16088\n<9ed0> <9ed1> 16090\n<9ed3> <9ed3> 16092\n<9ed6> <9ed7> 16093\n<9eda> <9ef1> 16095\n<9ef3> <9ef5> 16119\n<9ef9> <9efa> 16122\n<9efc> <9efe> 16124\n<9f40> <9f42> 16127\n<9f44> <9f47> 16130\n<9f49> <9f4a> 16134\n<9f4d> <9f67> 16136\n<9f69> <9f6f> 16163\n<9f71> <9f7e> 16170\n<9fa1> <9fb4> 16184\n<9fb6> <9fba> 16204\n<9fbc> <9fbe> 16209\n<9fc0> <9fc0> 16212\n<9fc2> <9fe3> 16213\n<9fe5> <9ff8> 16247\n<9ffa> <9ffe> 16267\n<a041> <a046> 16272\n<a048> <a054> 16278\n<a056> <a06c> 16291\n<a06e> <a07a> 16314\n<a07c> <a07e> 16327\n<a0a1> <a0a1> 16330\n<a0a3> <a0a6> 16331\n<a0a8> <a0c4> 16335\n<a0c6> <a0cf> 16364\n<a0d1> <a0e2> 16374\n<a0e4> <a0e6> 16392\n<a140> <a158> 99\n<a159> <a15c> 13743\n<a15d> <a17e> 128\n<a1a1> <a1f5> 162\n<a1f6> <a1f6> 248\n<a1f7> <a1f7> 247\n<a1f8> <a1fe> 249\n<a240> <a27e> 256\n<a2a1> <a2fe> 319\n<a340> <a37e> 413\n<a3a1> <a3bb> 476\n<a3bd> <a3bf> 503\n<a440> <a47e> 595\n<a4a1> <a4fe> 658\n<a540> <a57e> 752\n<a5a1> <a5fe> 815\n<a640> <a67e> 909\n<a6a1> <a6fe> 972\n<a740> <a77e> 1066\n<a7a1> <a7fe> 1129\n<a840> <a87e> 1223\n<a8a1> <a8fe> 1286\nendcidrange\n\n100 begincidrange\n<a940> <a97e> 1380\n<a9a1> <a9fe> 1443\n<aa40> <aa7e> 1537\n<aaa1> <aafe> 1600\n<ab40> <ab7e> 1694\n<aba1> <abfe> 1757\n<ac40> <ac7e> 1851\n<aca1> <acfd> 1914\n<acfe> <acfe> 2431\n<ad40> <ad7e> 2007\n<ada1> <adfe> 2070\n<ae40> <ae7e> 2164\n<aea1> <aefe> 2227\n<af40> <af7e> 2321\n<afa1> <afcf> 2384\n<afd0> <affe> 2432\n<b040> <b07e> 2479\n<b0a1> <b0fe> 2542\n<b140> <b17e> 2636\n<b1a1> <b1fe> 2699\n<b240> <b27e> 2793\n<b2a1> <b2fe> 2856\n<b340> <b37e> 2950\n<b3a1> <b3fe> 3013\n<b440> <b47e> 3107\n<b4a1> <b4fe> 3170\n<b540> <b57e> 3264\n<b5a1> <b5fe> 3327\n<b640> <b67e> 3421\n<b6a1> <b6fe> 3484\n<b740> <b77e> 3578\n<b7a1> <b7fe> 3641\n<b840> <b87e> 3735\n<b8a1> <b8fe> 3798\n<b940> <b97e> 3892\n<b9a1> <b9fe> 3955\n<ba40> <ba7e> 4049\n<baa1> <bafe> 4112\n<bb40> <bb7e> 4206\n<bba1> <bbc7> 4269\n<bbc8> <bbfe> 4309\n<bc40> <bc7e> 4364\n<bca1> <bcfe> 4427\n<bd40> <bd7e> 4521\n<bda1> <bdfe> 4584\n<be40> <be51> 4678\n<be52> <be52> 4308\n<be53> <be7e> 4696\n<bea1> <befe> 4740\n<bf40> <bf7e> 4834\n<bfa1> <bffe> 4897\n<c040> <c07e> 4991\n<c0a1> <c0fe> 5054\n<c140> <c17e> 5148\n<c1a1> <c1aa> 5211\n<c1ab> <c1fe> 5222\n<c240> <c27e> 5306\n<c2a1> <c2ca> 5369\n<c2cb> <c2cb> 5221\n<c2cc> <c2fe> 5411\n<c340> <c360> 5462\n<c361> <c37e> 5496\n<c3a1> <c3b8> 5526\n<c3b9> <c3b9> 5551\n<c3ba> <c3ba> 5550\n<c3bb> <c3fe> 5552\n<c440> <c455> 5620\n<c456> <c456> 5495\n<c457> <c47e> 5642\n<c4a1> <c4fe> 5682\n<c540> <c57e> 5776\n<c5a1> <c5fe> 5839\n<c640> <c67e> 5933\n<c940> <c949> 5996\n<c94a> <c94a> 628\n<c94b> <c96b> 6006\n<c96c> <c97e> 6040\n<c9a1> <c9bd> 6059\n<c9be> <c9be> 6039\n<c9bf> <c9ec> 6088\n<c9ed> <c9fe> 6135\n<ca40> <ca7e> 6153\n<caa1> <caf6> 6216\n<caf7> <caf7> 6134\n<caf8> <cafe> 6302\n<cb40> <cb7e> 6309\n<cba1> <cbfe> 6372\n<cc40> <cc7e> 6466\n<cca1> <ccfe> 6529\n<cd40> <cd7e> 6623\n<cda1> <cdfe> 6686\n<ce40> <ce7e> 6780\n<cea1> <cefe> 6843\n<cf40> <cf7e> 6937\n<cfa1> <cffe> 7000\n<d040> <d07e> 7094\n<d0a1> <d0fe> 7157\n<d140> <d17e> 7251\n<d1a1> <d1fe> 7314\n<d240> <d27e> 7408\nendcidrange\n\n100 begincidrange\n<d2a1> <d2fe> 7471\n<d340> <d37e> 7565\n<d3a1> <d3fe> 7628\n<d440> <d47e> 7722\n<d4a1> <d4fe> 7785\n<d540> <d57e> 7879\n<d5a1> <d5fe> 7942\n<d640> <d67e> 8036\n<d6a1> <d6cb> 8099\n<d6cc> <d6cc> 8788\n<d6cd> <d6fe> 8143\n<d740> <d779> 8193\n<d77a> <d77a> 8889\n<d77b> <d77e> 8251\n<d7a1> <d7fe> 8255\n<d840> <d87e> 8349\n<d8a1> <d8fe> 8412\n<d940> <d97e> 8506\n<d9a1> <d9fe> 8569\n<da40> <da7e> 8663\n<daa1> <dade> 8726\n<dadf> <dadf> 8142\n<dae0> <dafe> 8789\n<db40> <db7e> 8820\n<dba1> <dba6> 8883\n<dba7> <dbfe> 8890\n<dc40> <dc7e> 8978\n<dca1> <dcfe> 9041\n<dd40> <dd7e> 9135\n<dda1> <ddfb> 9198\n<ddfc> <ddfc> 9089\n<ddfd> <ddfe> 9289\n<de40> <de7e> 9291\n<dea1> <defe> 9354\n<df40> <df7e> 9448\n<dfa1> <dffe> 9511\n<e040> <e07e> 9605\n<e0a1> <e0fe> 9668\n<e140> <e17e> 9762\n<e1a1> <e1fe> 9825\n<e240> <e27e> 9919\n<e2a1> <e2fe> 9982\n<e340> <e37e> 10076\n<e3a1> <e3fe> 10139\n<e440> <e47e> 10233\n<e4a1> <e4fe> 10296\n<e540> <e57e> 10390\n<e5a1> <e5fe> 10453\n<e640> <e67e> 10547\n<e6a1> <e6fe> 10610\n<e740> <e77e> 10704\n<e7a1> <e7fe> 10767\n<e840> <e87e> 10861\n<e8a1> <e8a2> 10924\n<e8a3> <e8fe> 10927\n<e940> <e975> 11019\n<e976> <e97e> 11074\n<e9a1> <e9fe> 11083\n<ea40> <ea7e> 11177\n<eaa1> <eafe> 11240\n<eb40> <eb5a> 11334\n<eb5b> <eb7e> 11362\n<eba1> <ebf0> 11398\n<ebf1> <ebf1> 10926\n<ebf2> <ebfe> 11478\n<ec40> <ec7e> 11491\n<eca1> <ecdd> 11554\n<ecde> <ecde> 11073\n<ecdf> <ecfe> 11615\n<ed40> <ed7e> 11647\n<eda1> <eda9> 11710\n<edaa> <edfe> 11720\n<ee40> <ee7e> 11805\n<eea1> <eeea> 11868\n<eeeb> <eeeb> 12308\n<eeec> <eefe> 11942\n<ef40> <ef7e> 11961\n<efa1> <effe> 12024\n<f040> <f055> 12118\n<f056> <f056> 11719\n<f057> <f07e> 12140\n<f0a1> <f0ca> 12180\n<f0cb> <f0cb> 11361\n<f0cc> <f0fe> 12222\n<f140> <f162> 12273\n<f163> <f16a> 12309\n<f16b> <f16b> 12640\n<f16c> <f17e> 12317\n<f1a1> <f1fe> 12336\n<f240> <f267> 12430\n<f268> <f268> 12783\n<f269> <f27e> 12470\n<f2a1> <f2c2> 12492\n<f2c3> <f2fe> 12527\n<f340> <f374> 12587\n<f375> <f37e> 12641\n<f3a1> <f3fe> 12651\n<f440> <f465> 12745\n<f466> <f47e> 12784\n<f4a1> <f4b4> 12809\nendcidrange\n\n52 begincidrange\n<f4b5> <f4b5> 12526\n<f4b6> <f4fc> 12829\n<f4fd> <f4fe> 12901\n<f540> <f57e> 12903\n<f5a1> <f5fe> 12966\n<f640> <f662> 13060\n<f663> <f663> 12900\n<f664> <f67e> 13095\n<f6a1> <f6fe> 13122\n<f740> <f77e> 13216\n<f7a1> <f7fe> 13279\n<f840> <f87e> 13373\n<f8a1> <f8fe> 13436\n<f940> <f976> 13530\n<f977> <f97e> 13586\n<f9a1> <f9c3> 13594\n<f9c4> <f9c4> 13585\n<f9c5> <f9c5> 13629\n<f9c6> <f9c6> 13641\n<f9c7> <f9d1> 13630\n<f9d2> <f9d5> 13642\n<fa40> <fa7e> 16395\n<faa1> <fafe> 16458\n<fb40> <fb7e> 16552\n<fba1> <fbbe> 16615\n<fbc0> <fbcc> 16645\n<fbce> <fbfe> 16658\n<fc40> <fc49> 16707\n<fc4b> <fc4e> 16717\n<fc4f> <fc4f> 8495\n<fc50> <fc51> 16721\n<fc53> <fc62> 16723\n<fc64> <fc74> 16739\n<fc76> <fc7e> 16756\n<fca1> <fcb8> 16765\n<fcb9> <fcb9> 4447\n<fcba> <fcbb> 16789\n<fcbd> <fce2> 16791\n<fce4> <fced> 16829\n<fcef> <fcfe> 16839\n<fd40> <fd48> 16855\n<fd4a> <fd7e> 16864\n<fda1> <fdf1> 16917\n<fdf3> <fdfe> 16998\n<fe40> <fe6c> 17010\n<fe6e> <fe77> 17055\n<fe79> <fe7e> 17065\n<fea1> <fea9> 17071\n<feaa> <feaa> 288\n<feab> <fedd> 17080\n<fee0> <feec> 17131\n<feef> <fefe> 17144\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/HKgccs-B5-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (HKgccs-B5-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (HKgccs-B5-H)\n%%BeginResource: CMap (HKgccs-B5-V)\n%%Title: (HKgccs-B5-V Adobe CNS1 1)\n%%Version: 12.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/HKgccs-B5-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 1 def\nend def\n\n/CMapName /HKgccs-B5-V def\n/CMapVersion 12.002 def\n/CMapType 1 def\n\n/XUID [1 10 25520] def\n\n/WMode 1 def\n\n12 begincidrange\n<a14b> <a14b> 13646\n<a15a> <a15a> 13743\n<a15c> <a15c> 13745\n<a15d> <a15e> 130\n<a161> <a162> 134\n<a165> <a166> 138\n<a169> <a16a> 142\n<a16d> <a16e> 146\n<a171> <a172> 150\n<a175> <a176> 154\n<a179> <a17a> 158\n<a1e3> <a1e3> 13647\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/HKm314-B5-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (HKm314-B5-H)\n%%Title: (HKm314-B5-H Adobe CNS1 1)\n%%Version: 1.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 1 def\nend def\n\n/CMapName /HKm314-B5-H def\n/CMapVersion 1.003 def\n/CMapType 1 def\n\n/XUID [1 10 25527] def\n\n/WMode 0 def\n\n2 begincodespacerange\n  <00>   <80>\n  <A140> <FEFE>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 1\nendnotdefrange\n\n100 begincidrange\n<20> <7e> 1\n<a140> <a158> 99\n<a159> <a15c> 13743\n<a15d> <a17e> 128\n<a1a1> <a1f5> 162\n<a1f6> <a1f6> 248\n<a1f7> <a1f7> 247\n<a1f8> <a1fe> 249\n<a240> <a27e> 256\n<a2a1> <a2fe> 319\n<a340> <a37e> 413\n<a3a1> <a3bb> 476\n<a3bd> <a3bf> 503\n<a440> <a47e> 595\n<a4a1> <a4fe> 658\n<a540> <a57e> 752\n<a5a1> <a5fe> 815\n<a640> <a67e> 909\n<a6a1> <a6fe> 972\n<a740> <a77e> 1066\n<a7a1> <a7fe> 1129\n<a840> <a87e> 1223\n<a8a1> <a8fe> 1286\n<a940> <a97e> 1380\n<a9a1> <a9fe> 1443\n<aa40> <aa7e> 1537\n<aaa1> <aafe> 1600\n<ab40> <ab7e> 1694\n<aba1> <abfe> 1757\n<ac40> <ac7e> 1851\n<aca1> <acfd> 1914\n<acfe> <acfe> 2431\n<ad40> <ad7e> 2007\n<ada1> <adfe> 2070\n<ae40> <ae7e> 2164\n<aea1> <aefe> 2227\n<af40> <af7e> 2321\n<afa1> <afcf> 2384\n<afd0> <affe> 2432\n<b040> <b07e> 2479\n<b0a1> <b0fe> 2542\n<b140> <b17e> 2636\n<b1a1> <b1fe> 2699\n<b240> <b27e> 2793\n<b2a1> <b2fe> 2856\n<b340> <b37e> 2950\n<b3a1> <b3fe> 3013\n<b440> <b47e> 3107\n<b4a1> <b4fe> 3170\n<b540> <b57e> 3264\n<b5a1> <b5fe> 3327\n<b640> <b67e> 3421\n<b6a1> <b6fe> 3484\n<b740> <b77e> 3578\n<b7a1> <b7fe> 3641\n<b840> <b87e> 3735\n<b8a1> <b8fe> 3798\n<b940> <b97e> 3892\n<b9a1> <b9fe> 3955\n<ba40> <ba7e> 4049\n<baa1> <bafe> 4112\n<bb40> <bb7e> 4206\n<bba1> <bbc7> 4269\n<bbc8> <bbfe> 4309\n<bc40> <bc7e> 4364\n<bca1> <bcfe> 4427\n<bd40> <bd7e> 4521\n<bda1> <bdfe> 4584\n<be40> <be51> 4678\n<be52> <be52> 4308\n<be53> <be7e> 4696\n<bea1> <befe> 4740\n<bf40> <bf7e> 4834\n<bfa1> <bffe> 4897\n<c040> <c07e> 4991\n<c0a1> <c0fe> 5054\n<c140> <c17e> 5148\n<c1a1> <c1aa> 5211\n<c1ab> <c1fe> 5222\n<c240> <c27e> 5306\n<c2a1> <c2ca> 5369\n<c2cb> <c2cb> 5221\n<c2cc> <c2fe> 5411\n<c340> <c360> 5462\n<c361> <c37e> 5496\n<c3a1> <c3b8> 5526\n<c3b9> <c3b9> 5551\n<c3ba> <c3ba> 5550\n<c3bb> <c3fe> 5552\n<c440> <c455> 5620\n<c456> <c456> 5495\n<c457> <c47e> 5642\n<c4a1> <c4fe> 5682\n<c540> <c57e> 5776\n<c5a1> <c5fe> 5839\n<c640> <c67e> 5933\n<c740> <c740> 15725\n<c741> <c741> 14788\n<c742> <c742> 17305\n<c743> <c743> 15877\nendcidrange\n\n100 begincidrange\n<c744> <c744> 14058\n<c745> <c745> 14792\n<c746> <c746> 14653\n<c747> <c747> 17307\n<c748> <c748> 16418\n<c749> <c749> 17309\n<c74a> <c74a> 16436\n<c74b> <c74b> 17311\n<c74c> <c74c> 16035\n<c74d> <c74d> 16038\n<c74e> <c74e> 16465\n<c74f> <c750> 16456\n<c751> <c751> 16459\n<c752> <c752> 16463\n<c753> <c753> 17314\n<c754> <c754> 16474\n<c755> <c755> 16036\n<c756> <c756> 15805\n<c757> <c757> 15807\n<c758> <c758> 16476\n<c759> <c759> 16479\n<c75a> <c75a> 17316\n<c75b> <c75b> 16507\n<c75c> <c75c> 16514\n<c75d> <c75d> 16237\n<c75e> <c75e> 16523\n<c75f> <c75f> 17318\n<c760> <c760> 16531\n<c761> <c761> 16534\n<c762> <c762> 17319\n<c763> <c763> 16536\n<c764> <c764> 15999\n<c765> <c765> 15479\n<c766> <c766> 16039\n<c767> <c767> 16010\n<c768> <c768> 16024\n<c769> <c769> 16012\n<c76a> <c76a> 16545\n<c76b> <c76b> 14848\n<c76c> <c76c> 14755\n<c76d> <c76d> 16013\n<c76e> <c76e> 17320\n<c76f> <c76f> 16216\n<c770> <c770> 15804\n<c771> <c771> 15564\n<c772> <c773> 16040\n<c774> <c774> 15150\n<c775> <c775> 15302\n<c776> <c776> 16011\n<c777> <c777> 16031\n<c778> <c778> 17196\n<c779> <c779> 17321\n<c77a> <c77a> 16136\n<c77b> <c77b> 16037\n<c77c> <c77c> 16009\n<c77d> <c77d> 15811\n<c77e> <c77e> 16002\n<c7a1> <c7a1> 16001\n<c7a2> <c7a2> 16020\n<c7a3> <c7a3> 16003\n<c7a4> <c7a4> 16008\n<c7a5> <c7a5> 17323\n<c7a6> <c7a6> 16017\n<c7a7> <c7a7> 17324\n<c7a8> <c7a8> 15996\n<c7a9> <c7a9> 16000\n<c7aa> <c7aa> 16015\n<c7ab> <c7ab> 15975\n<c7ac> <c7ac> 15992\n<c7ad> <c7ad> 15976\n<c7ae> <c7ae> 17325\n<c7af> <c7af> 14290\n<c7b0> <c7b0> 16205\n<c7b1> <c7b1> 17326\n<c7b2> <c7b2> 15998\n<c7b3> <c7b3> 16572\n<c7b4> <c7b4> 15971\n<c7b5> <c7b5> 16573\n<c7b6> <c7b6> 17327\n<c7b7> <c7b7> 16567\n<c7b8> <c7b8> 16055\n<c7b9> <c7b9> 16109\n<c7ba> <c7ba> 16234\n<c7bb> <c7bb> 16021\n<c7bc> <c7bc> 14664\n<c7bd> <c7bd> 15560\n<c7be> <c7bf> 17329\n<c7c0> <c7c0> 16588\n<c7c1> <c7c1> 16006\n<c7c2> <c7c2> 15482\n<c7c3> <c7c3> 15485\n<c7c4> <c7c4> 17332\n<c7c5> <c7c5> 16593\n<c7c6> <c7c6> 15730\n<c7c7> <c7c7> 15398\n<c7c8> <c7c8> 14059\n<c7c9> <c7c9> 16575\n<c7ca> <c7ca> 16640\n<c7cb> <c7cb> 15493\n<c7cc> <c7cc> 17333\nendcidrange\n\n100 begincidrange\n<c7cd> <c7cd> 14877\n<c7ce> <c7ce> 14325\n<c7cf> <c7cf> 14062\n<c7d0> <c7d0> 15967\n<c7d1> <c7d1> 16662\n<c7d2> <c7d2> 16671\n<c7d3> <c7d3> 16664\n<c7d4> <c7d4> 16675\n<c7d5> <c7d5> 16679\n<c7d6> <c7d6> 16681\n<c7d7> <c7d8> 17340\n<c7d9> <c7d9> 16014\n<c7da> <c7da> 14447\n<c7db> <c7db> 16707\n<c7dc> <c7dc> 16710\n<c7dd> <c7dd> 16708\n<c7de> <c7de> 16713\n<c7df> <c7df> 15269\n<c7e0> <c7e0> 16727\n<c7e1> <c7e1> 16737\n<c7e2> <c7e2> 14060\n<c7e3> <c7e3> 16746\n<c7e4> <c7e4> 16386\n<c7e5> <c7e5> 16774\n<c7e6> <c7e6> 16314\n<c7e7> <c7e7> 16208\n<c7e8> <c7e8> 16022\n<c7e9> <c7e9> 16778\n<c7ea> <c7ea> 16321\n<c7eb> <c7eb> 15759\n<c7ec> <c7ec> 17345\n<c7ed> <c7ed> 16032\n<c7ee> <c7ee> 16150\n<c7ef> <c7ef> 16029\n<c7f0> <c7f0> 16786\n<c7f1> <c7f1> 14950\n<c7f2> <c7f2> 16028\n<c7f3> <c7f3> 16016\n<c7f4> <c7f4> 16797\n<c7f5> <c7f6> 17346\n<c7f7> <c7f7> 14248\n<c7f8> <c7f8> 16798\n<c7f9> <c7f9> 16775\n<c7fa> <c7fa> 16034\n<c7fb> <c7fb> 16007\n<c7fc> <c7fc> 16004\n<c7fd> <c7fd> 16046\n<c7fe> <c7fe> 15220\n<c840> <c840> 15221\n<c841> <c841> 15218\n<c842> <c842> 16050\n<c843> <c843> 16044\n<c844> <c844> 16842\n<c845> <c845> 16884\n<c846> <c846> 16848\n<c847> <c847> 15018\n<c848> <c848> 16885\n<c849> <c849> 16888\n<c84a> <c84a> 16891\n<c84b> <c84b> 16901\n<c84c> <c84c> 15758\n<c84d> <c84d> 16910\n<c84e> <c84e> 15715\n<c84f> <c84f> 16930\n<c850> <c850> 16929\n<c851> <c851> 16931\n<c852> <c852> 16489\n<c853> <c853> 16431\n<c854> <c854> 14501\n<c855> <c855> 15605\n<c856> <c856> 15721\n<c857> <c857> 16987\n<c858> <c858> 15048\n<c859> <c859> 15808\n<c85a> <c85a> 14826\n<c85b> <c85b> 16384\n<c85c> <c85c> 16996\n<c85d> <c85d> 16994\n<c85e> <c85e> 16383\n<c85f> <c85f> 16026\n<c860> <c860> 17011\n<c861> <c861> 14697\n<c862> <c862> 17018\n<c863> <c863> 17354\n<c864> <c864> 16282\n<c865> <c865> 16053\n<c866> <c867> 17355\n<c868> <c868> 16306\n<c869> <c86b> 17034\n<c86c> <c86c> 15071\n<c86d> <c86d> 17096\n<c86e> <c86e> 16045\n<c86f> <c86f> 17358\n<c870> <c870> 16271\n<c871> <c871> 17359\n<c872> <c872> 15986\n<c873> <c873> 16042\n<c874> <c874> 17363\n<c875> <c875> 17120\n<c876> <c876> 14381\nendcidrange\n\n100 begincidrange\n<c877> <c877> 16341\n<c878> <c878> 15124\n<c879> <c879> 14056\n<c87a> <c87a> 17136\n<c87b> <c87b> 15997\n<c87c> <c87c> 17150\n<c87d> <c87d> 17157\n<c87e> <c87e> 14138\n<c8a1> <c8a1> 14150\n<c8a2> <c8a2> 14162\n<c8a3> <c8a3> 14061\n<c8a4> <c8a4> 15178\n<c8a5> <c8a5> 15173\n<c8a6> <c8a6> 17370\n<c8a7> <c8a7> 16094\n<c8a8> <c8a8> 14188\n<c8a9> <c8a9> 14187\n<c8aa> <c8aa> 14210\n<c8ab> <c8ab> 15977\n<c8ac> <c8ac> 15183\n<c8ad> <c8ad> 14214\n<c8ae> <c8ae> 17371\n<c8af> <c8af> 14216\n<c8b0> <c8b0> 17372\n<c8b1> <c8b1> 16077\n<c8b2> <c8b2> 14231\n<c8b3> <c8b3> 16909\n<c8b4> <c8b4> 14296\n<c8b5> <c8b5> 15217\n<c8b6> <c8b6> 14556\n<c8b7> <c8b7> 14304\n<c8b8> <c8b8> 14324\n<c8b9> <c8b9> 14355\n<c8ba> <c8ba> 16048\n<c8bb> <c8bb> 14349\n<c8bc> <c8bc> 16047\n<c8bd> <c8be> 14363\n<c8bf> <c8c0> 14366\n<c8c1> <c8c1> 16049\n<c8c2> <c8c2> 16361\n<c8c3> <c8c3> 17380\n<c8c4> <c8c4> 16377\n<c8c5> <c8c5> 15961\n<c8c6> <c8c6> 16025\n<c8c7> <c8c7> 15966\n<c8c8> <c8c8> 15284\n<c8c9> <c8c9> 16043\n<c8ca> <c8cb> 17383\n<c8cc> <c8cc> 14430\n<c8cd> <c8cd> 17385\n<c8ce> <c8ce> 15806\n<c8cf> <c8cf> 16005\n<c8d0> <c8d1> 14435\n<c8d2> <c8d2> 15724\n<c8d3> <c8d3> 14449\n<c8d4> <c8d4> 14460\n<c8d5> <c8d5> 14466\n<c8d6> <c8d6> 16027\n<c8d7> <c8d7> 14472\n<c8d8> <c8d8> 15374\n<c8d9> <c8d9> 14382\n<c8da> <c8da> 14490\n<c8db> <c8db> 14475\n<c8dc> <c8dc> 15364\n<c8dd> <c8dd> 14057\n<c8de> <c8de> 17085\n<c8df> <c8df> 15309\n<c8e0> <c8e0> 14495\n<c8e1> <c8e1> 14235\n<c8e2> <c8e2> 14511\n<c8e3> <c8e3> 16023\n<c8e4> <c8e4> 14576\n<c8e5> <c8e5> 15357\n<c8e6> <c8e7> 15377\n<c8e8> <c8e8> 17391\n<c8e9> <c8e9> 14213\n<c8ea> <c8ea> 14594\n<c8eb> <c8eb> 16298\n<c8ec> <c8ec> 16153\n<c8ed> <c8ed> 14617\n<c8ee> <c8ee> 17393\n<c8ef> <c8f0> 14618\n<c8f1> <c8f1> 15974\n<c8f2> <c8f2> 16162\n<c8f3> <c8f3> 15742\n<c8f4> <c8f4> 15417\n<c8f5> <c8f5> 16033\n<c8f6> <c8f7> 17394\n<c8f8> <c8f8> 16176\n<c8f9> <c8f9> 14633\n<c8fa> <c8fa> 16316\n<c8fb> <c8fc> 14646\n<c8fd> <c8fd> 16272\n<c8fe> <c8fe> 2746\n<c940> <c949> 5996\n<c94a> <c94a> 628\n<c94b> <c96b> 6006\n<c96c> <c97e> 6040\n<c9a1> <c9bd> 6059\n<c9be> <c9be> 6039\nendcidrange\n\n100 begincidrange\n<c9bf> <c9ec> 6088\n<c9ed> <c9fe> 6135\n<ca40> <ca7e> 6153\n<caa1> <caf6> 6216\n<caf7> <caf7> 6134\n<caf8> <cafe> 6302\n<cb40> <cb7e> 6309\n<cba1> <cbfe> 6372\n<cc40> <cc7e> 6466\n<cca1> <ccfe> 6529\n<cd40> <cd7e> 6623\n<cda1> <cdfe> 6686\n<ce40> <ce7e> 6780\n<cea1> <cefe> 6843\n<cf40> <cf7e> 6937\n<cfa1> <cffe> 7000\n<d040> <d07e> 7094\n<d0a1> <d0fe> 7157\n<d140> <d17e> 7251\n<d1a1> <d1fe> 7314\n<d240> <d27e> 7408\n<d2a1> <d2fe> 7471\n<d340> <d37e> 7565\n<d3a1> <d3fe> 7628\n<d440> <d47e> 7722\n<d4a1> <d4fe> 7785\n<d540> <d57e> 7879\n<d5a1> <d5fe> 7942\n<d640> <d67e> 8036\n<d6a1> <d6cb> 8099\n<d6cc> <d6cc> 8788\n<d6cd> <d6fe> 8143\n<d740> <d779> 8193\n<d77a> <d77a> 8889\n<d77b> <d77e> 8251\n<d7a1> <d7fe> 8255\n<d840> <d87e> 8349\n<d8a1> <d8fe> 8412\n<d940> <d97e> 8506\n<d9a1> <d9fe> 8569\n<da40> <da7e> 8663\n<daa1> <dade> 8726\n<dadf> <dadf> 8142\n<dae0> <dafe> 8789\n<db40> <db7e> 8820\n<dba1> <dba6> 8883\n<dba7> <dbfe> 8890\n<dc40> <dc7e> 8978\n<dca1> <dcfe> 9041\n<dd40> <dd7e> 9135\n<dda1> <ddfb> 9198\n<ddfc> <ddfc> 9089\n<ddfd> <ddfe> 9289\n<de40> <de7e> 9291\n<dea1> <defe> 9354\n<df40> <df7e> 9448\n<dfa1> <dffe> 9511\n<e040> <e07e> 9605\n<e0a1> <e0fe> 9668\n<e140> <e17e> 9762\n<e1a1> <e1fe> 9825\n<e240> <e27e> 9919\n<e2a1> <e2fe> 9982\n<e340> <e37e> 10076\n<e3a1> <e3fe> 10139\n<e440> <e47e> 10233\n<e4a1> <e4fe> 10296\n<e540> <e57e> 10390\n<e5a1> <e5fe> 10453\n<e640> <e67e> 10547\n<e6a1> <e6fe> 10610\n<e740> <e77e> 10704\n<e7a1> <e7fe> 10767\n<e840> <e87e> 10861\n<e8a1> <e8a2> 10924\n<e8a3> <e8fe> 10927\n<e940> <e975> 11019\n<e976> <e97e> 11074\n<e9a1> <e9fe> 11083\n<ea40> <ea7e> 11177\n<eaa1> <eafe> 11240\n<eb40> <eb5a> 11334\n<eb5b> <eb7e> 11362\n<eba1> <ebf0> 11398\n<ebf1> <ebf1> 10926\n<ebf2> <ebfe> 11478\n<ec40> <ec7e> 11491\n<eca1> <ecdd> 11554\n<ecde> <ecde> 11073\n<ecdf> <ecfe> 11615\n<ed40> <ed7e> 11647\n<eda1> <eda9> 11710\n<edaa> <edfe> 11720\n<ee40> <ee7e> 11805\n<eea1> <eeea> 11868\n<eeeb> <eeeb> 12308\n<eeec> <eefe> 11942\n<ef40> <ef7e> 11961\n<efa1> <effe> 12024\n<f040> <f055> 12118\nendcidrange\n\n42 begincidrange\n<f056> <f056> 11719\n<f057> <f07e> 12140\n<f0a1> <f0ca> 12180\n<f0cb> <f0cb> 11361\n<f0cc> <f0fe> 12222\n<f140> <f162> 12273\n<f163> <f16a> 12309\n<f16b> <f16b> 12640\n<f16c> <f17e> 12317\n<f1a1> <f1fe> 12336\n<f240> <f267> 12430\n<f268> <f268> 12783\n<f269> <f27e> 12470\n<f2a1> <f2c2> 12492\n<f2c3> <f2fe> 12527\n<f340> <f374> 12587\n<f375> <f37e> 12641\n<f3a1> <f3fe> 12651\n<f440> <f465> 12745\n<f466> <f47e> 12784\n<f4a1> <f4b4> 12809\n<f4b5> <f4b5> 12526\n<f4b6> <f4fc> 12829\n<f4fd> <f4fe> 12901\n<f540> <f57e> 12903\n<f5a1> <f5fe> 12966\n<f640> <f662> 13060\n<f663> <f663> 12900\n<f664> <f67e> 13095\n<f6a1> <f6fe> 13122\n<f740> <f77e> 13216\n<f7a1> <f7fe> 13279\n<f840> <f87e> 13373\n<f8a1> <f8fe> 13436\n<f940> <f976> 13530\n<f977> <f97e> 13586\n<f9a1> <f9c3> 13594\n<f9c4> <f9c4> 13585\n<f9c5> <f9c5> 13629\n<f9c6> <f9c6> 13641\n<f9c7> <f9d1> 13630\n<f9d2> <f9d5> 13642\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/HKm314-B5-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (HKm314-B5-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (HKm314-B5-H)\n%%BeginResource: CMap (HKm314-B5-V)\n%%Title: (HKm314-B5-V Adobe CNS1 1)\n%%Version: 12.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/HKm314-B5-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 1 def\nend def\n\n/CMapName /HKm314-B5-V def\n/CMapVersion 12.002 def\n/CMapType 1 def\n\n/XUID [1 10 25528] def\n\n/WMode 1 def\n\n12 begincidrange\n<a14b> <a14b> 13646\n<a15a> <a15a> 13743\n<a15c> <a15c> 13745\n<a15d> <a15e> 130\n<a161> <a162> 134\n<a165> <a166> 138\n<a169> <a16a> 142\n<a16d> <a16e> 146\n<a171> <a172> 150\n<a175> <a176> 154\n<a179> <a17a> 158\n<a1e3> <a1e3> 13647\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/HKm471-B5-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (HKm471-B5-H)\n%%Title: (HKm471-B5-H Adobe CNS1 1)\n%%Version: 1.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 1 def\nend def\n\n/CMapName /HKm471-B5-H def\n/CMapVersion 1.003 def\n/CMapType 1 def\n\n/XUID [1 10 25525] def\n\n/WMode 0 def\n\n2 begincodespacerange\n  <00>   <80>\n  <A140> <FEFE>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 1\nendnotdefrange\n\n100 begincidrange\n<20> <7e> 1\n<a140> <a158> 99\n<a159> <a15c> 13743\n<a15d> <a17e> 128\n<a1a1> <a1f5> 162\n<a1f6> <a1f6> 248\n<a1f7> <a1f7> 247\n<a1f8> <a1fe> 249\n<a240> <a27e> 256\n<a2a1> <a2fe> 319\n<a340> <a37e> 413\n<a3a1> <a3bb> 476\n<a3bd> <a3bf> 503\n<a440> <a47e> 595\n<a4a1> <a4fe> 658\n<a540> <a57e> 752\n<a5a1> <a5fe> 815\n<a640> <a67e> 909\n<a6a1> <a6fe> 972\n<a740> <a77e> 1066\n<a7a1> <a7fe> 1129\n<a840> <a87e> 1223\n<a8a1> <a8fe> 1286\n<a940> <a97e> 1380\n<a9a1> <a9fe> 1443\n<aa40> <aa7e> 1537\n<aaa1> <aafe> 1600\n<ab40> <ab7e> 1694\n<aba1> <abfe> 1757\n<ac40> <ac7e> 1851\n<aca1> <acfd> 1914\n<acfe> <acfe> 2431\n<ad40> <ad7e> 2007\n<ada1> <adfe> 2070\n<ae40> <ae7e> 2164\n<aea1> <aefe> 2227\n<af40> <af7e> 2321\n<afa1> <afcf> 2384\n<afd0> <affe> 2432\n<b040> <b07e> 2479\n<b0a1> <b0fe> 2542\n<b140> <b17e> 2636\n<b1a1> <b1fe> 2699\n<b240> <b27e> 2793\n<b2a1> <b2fe> 2856\n<b340> <b37e> 2950\n<b3a1> <b3fe> 3013\n<b440> <b47e> 3107\n<b4a1> <b4fe> 3170\n<b540> <b57e> 3264\n<b5a1> <b5fe> 3327\n<b640> <b67e> 3421\n<b6a1> <b6fe> 3484\n<b740> <b77e> 3578\n<b7a1> <b7fe> 3641\n<b840> <b87e> 3735\n<b8a1> <b8fe> 3798\n<b940> <b97e> 3892\n<b9a1> <b9fe> 3955\n<ba40> <ba7e> 4049\n<baa1> <bafe> 4112\n<bb40> <bb7e> 4206\n<bba1> <bbc7> 4269\n<bbc8> <bbfe> 4309\n<bc40> <bc7e> 4364\n<bca1> <bcfe> 4427\n<bd40> <bd7e> 4521\n<bda1> <bdfe> 4584\n<be40> <be51> 4678\n<be52> <be52> 4308\n<be53> <be7e> 4696\n<bea1> <befe> 4740\n<bf40> <bf7e> 4834\n<bfa1> <bffe> 4897\n<c040> <c07e> 4991\n<c0a1> <c0fe> 5054\n<c140> <c17e> 5148\n<c1a1> <c1aa> 5211\n<c1ab> <c1fe> 5222\n<c240> <c27e> 5306\n<c2a1> <c2ca> 5369\n<c2cb> <c2cb> 5221\n<c2cc> <c2fe> 5411\n<c340> <c360> 5462\n<c361> <c37e> 5496\n<c3a1> <c3b8> 5526\n<c3b9> <c3b9> 5551\n<c3ba> <c3ba> 5550\n<c3bb> <c3fe> 5552\n<c440> <c455> 5620\n<c456> <c456> 5495\n<c457> <c47e> 5642\n<c4a1> <c4fe> 5682\n<c540> <c57e> 5776\n<c5a1> <c5fe> 5839\n<c640> <c67e> 5933\n<c940> <c949> 5996\n<c94a> <c94a> 628\n<c94b> <c96b> 6006\n<c96c> <c97e> 6040\nendcidrange\n\n100 begincidrange\n<c9a1> <c9bd> 6059\n<c9be> <c9be> 6039\n<c9bf> <c9ec> 6088\n<c9ed> <c9fe> 6135\n<ca40> <ca7e> 6153\n<caa1> <caf6> 6216\n<caf7> <caf7> 6134\n<caf8> <cafe> 6302\n<cb40> <cb7e> 6309\n<cba1> <cbfe> 6372\n<cc40> <cc7e> 6466\n<cca1> <ccfe> 6529\n<cd40> <cd7e> 6623\n<cda1> <cdfe> 6686\n<ce40> <ce7e> 6780\n<cea1> <cefe> 6843\n<cf40> <cf7e> 6937\n<cfa1> <cffe> 7000\n<d040> <d07e> 7094\n<d0a1> <d0fe> 7157\n<d140> <d17e> 7251\n<d1a1> <d1fe> 7314\n<d240> <d27e> 7408\n<d2a1> <d2fe> 7471\n<d340> <d37e> 7565\n<d3a1> <d3fe> 7628\n<d440> <d47e> 7722\n<d4a1> <d4fe> 7785\n<d540> <d57e> 7879\n<d5a1> <d5fe> 7942\n<d640> <d67e> 8036\n<d6a1> <d6cb> 8099\n<d6cc> <d6cc> 8788\n<d6cd> <d6fe> 8143\n<d740> <d779> 8193\n<d77a> <d77a> 8889\n<d77b> <d77e> 8251\n<d7a1> <d7fe> 8255\n<d840> <d87e> 8349\n<d8a1> <d8fe> 8412\n<d940> <d97e> 8506\n<d9a1> <d9fe> 8569\n<da40> <da7e> 8663\n<daa1> <dade> 8726\n<dadf> <dadf> 8142\n<dae0> <dafe> 8789\n<db40> <db7e> 8820\n<dba1> <dba6> 8883\n<dba7> <dbfe> 8890\n<dc40> <dc7e> 8978\n<dca1> <dcfe> 9041\n<dd40> <dd7e> 9135\n<dda1> <ddfb> 9198\n<ddfc> <ddfc> 9089\n<ddfd> <ddfe> 9289\n<de40> <de7e> 9291\n<dea1> <defe> 9354\n<df40> <df7e> 9448\n<dfa1> <dffe> 9511\n<e040> <e07e> 9605\n<e0a1> <e0fe> 9668\n<e140> <e17e> 9762\n<e1a1> <e1fe> 9825\n<e240> <e27e> 9919\n<e2a1> <e2fe> 9982\n<e340> <e37e> 10076\n<e3a1> <e3fe> 10139\n<e440> <e47e> 10233\n<e4a1> <e4fe> 10296\n<e540> <e57e> 10390\n<e5a1> <e5fe> 10453\n<e640> <e67e> 10547\n<e6a1> <e6fe> 10610\n<e740> <e77e> 10704\n<e7a1> <e7fe> 10767\n<e840> <e87e> 10861\n<e8a1> <e8a2> 10924\n<e8a3> <e8fe> 10927\n<e940> <e975> 11019\n<e976> <e97e> 11074\n<e9a1> <e9fe> 11083\n<ea40> <ea7e> 11177\n<eaa1> <eafe> 11240\n<eb40> <eb5a> 11334\n<eb5b> <eb7e> 11362\n<eba1> <ebf0> 11398\n<ebf1> <ebf1> 10926\n<ebf2> <ebfe> 11478\n<ec40> <ec7e> 11491\n<eca1> <ecdd> 11554\n<ecde> <ecde> 11073\n<ecdf> <ecfe> 11615\n<ed40> <ed7e> 11647\n<eda1> <eda9> 11710\n<edaa> <edfe> 11720\n<ee40> <ee7e> 11805\n<eea1> <eeea> 11868\n<eeeb> <eeeb> 12308\n<eeec> <eefe> 11942\n<ef40> <ef7e> 11961\nendcidrange\n\n100 begincidrange\n<efa1> <effe> 12024\n<f040> <f055> 12118\n<f056> <f056> 11719\n<f057> <f07e> 12140\n<f0a1> <f0ca> 12180\n<f0cb> <f0cb> 11361\n<f0cc> <f0fe> 12222\n<f140> <f162> 12273\n<f163> <f16a> 12309\n<f16b> <f16b> 12640\n<f16c> <f17e> 12317\n<f1a1> <f1fe> 12336\n<f240> <f267> 12430\n<f268> <f268> 12783\n<f269> <f27e> 12470\n<f2a1> <f2c2> 12492\n<f2c3> <f2fe> 12527\n<f340> <f374> 12587\n<f375> <f37e> 12641\n<f3a1> <f3fe> 12651\n<f440> <f465> 12745\n<f466> <f47e> 12784\n<f4a1> <f4b4> 12809\n<f4b5> <f4b5> 12526\n<f4b6> <f4fc> 12829\n<f4fd> <f4fe> 12901\n<f540> <f57e> 12903\n<f5a1> <f5fe> 12966\n<f640> <f662> 13060\n<f663> <f663> 12900\n<f664> <f67e> 13095\n<f6a1> <f6fe> 13122\n<f740> <f77e> 13216\n<f7a1> <f7fe> 13279\n<f840> <f87e> 13373\n<f8a1> <f8fe> 13436\n<f940> <f976> 13530\n<f977> <f97e> 13586\n<f9a1> <f9c3> 13594\n<f9c4> <f9c4> 13585\n<f9c5> <f9c5> 13629\n<f9c6> <f9c6> 13641\n<f9c7> <f9d1> 13630\n<f9d2> <f9d5> 13642\n<fa40> <fa40> 15725\n<fa41> <fa41> 14788\n<fa42> <fa42> 17305\n<fa43> <fa43> 16207\n<fa44> <fa44> 15877\n<fa45> <fa45> 17306\n<fa46> <fa46> 15246\n<fa47> <fa47> 14058\n<fa48> <fa48> 14792\n<fa49> <fa49> 14653\n<fa4a> <fa4a> 17307\n<fa4b> <fa4b> 16418\n<fa4c> <fa4d> 14796\n<fa4e> <fa4e> 17308\n<fa4f> <fa4f> 14789\n<fa50> <fa50> 17309\n<fa51> <fa51> 16436\n<fa52> <fa53> 17310\n<fa54> <fa54> 16035\n<fa55> <fa55> 16038\n<fa56> <fa56> 17312\n<fa57> <fa57> 16465\n<fa58> <fa59> 16456\n<fa5a> <fa5a> 16459\n<fa5b> <fa5b> 16463\n<fa5c> <fa5c> 16468\n<fa5d> <fa5d> 16760\n<fa5e> <fa5e> 16138\n<fa5f> <fa60> 17313\n<fa61> <fa61> 16474\n<fa62> <fa62> 16036\n<fa63> <fa63> 15805\n<fa64> <fa64> 17315\n<fa65> <fa65> 15807\n<fa66> <fa66> 16476\n<fa67> <fa68> 16479\n<fa69> <fa69> 16483\n<fa6a> <fa6a> 17316\n<fa6b> <fa6c> 16506\n<fa6d> <fa6d> 16509\n<fa6e> <fa6e> 16514\n<fa6f> <fa6f> 16237\n<fa70> <fa70> 17317\n<fa71> <fa71> 16523\n<fa72> <fa72> 17318\n<fa73> <fa73> 16185\n<fa74> <fa74> 16531\n<fa75> <fa75> 16534\n<fa76> <fa76> 17319\n<fa77> <fa77> 16536\n<fa78> <fa78> 15999\n<fa79> <fa79> 15479\n<fa7a> <fa7a> 16039\n<fa7b> <fa7b> 16899\n<fa7c> <fa7c> 16081\n<fa7d> <fa7d> 16010\nendcidrange\n\n100 begincidrange\n<fa7e> <fa7e> 16024\n<faa1> <faa1> 16012\n<faa2> <faa2> 16545\n<faa3> <faa3> 15747\n<faa4> <faa4> 14848\n<faa5> <faa5> 14755\n<faa6> <faa6> 16013\n<faa7> <faa7> 17320\n<faa8> <faa8> 16216\n<faa9> <faa9> 15804\n<faaa> <faaa> 16546\n<faab> <faab> 15564\n<faac> <faad> 16040\n<faae> <faae> 15150\n<faaf> <faaf> 15302\n<fab0> <fab0> 16011\n<fab1> <fab1> 16031\n<fab2> <fab2> 17196\n<fab3> <fab3> 17321\n<fab4> <fab4> 16136\n<fab5> <fab5> 16037\n<fab6> <fab6> 16009\n<fab7> <fab7> 15811\n<fab8> <fab8> 16002\n<fab9> <fab9> 16001\n<faba> <faba> 16020\n<fabb> <fabb> 17322\n<fabc> <fabc> 16003\n<fabd> <fabd> 16008\n<fabe> <fabe> 17323\n<fabf> <fabf> 16017\n<fac0> <fac0> 17324\n<fac1> <fac1> 15996\n<fac2> <fac2> 16000\n<fac3> <fac3> 16015\n<fac4> <fac4> 17189\n<fac5> <fac5> 15975\n<fac6> <fac6> 15992\n<fac7> <fac7> 15976\n<fac8> <fac8> 17325\n<fac9> <fac9> 14290\n<faca> <faca> 16205\n<facb> <facb> 17326\n<facc> <facc> 15998\n<facd> <facd> 16572\n<face> <face> 15971\n<facf> <facf> 16573\n<fad0> <fad0> 17327\n<fad1> <fad1> 16236\n<fad2> <fad2> 16121\n<fad3> <fad3> 16567\n<fad4> <fad4> 16055\n<fad5> <fad5> 16109\n<fad6> <fad6> 16234\n<fad7> <fad7> 14758\n<fad8> <fad8> 17328\n<fad9> <fad9> 16021\n<fada> <fada> 14664\n<fadb> <fadb> 15560\n<fadc> <fade> 17329\n<fadf> <fadf> 16588\n<fae0> <fae0> 16006\n<fae1> <fae1> 16584\n<fae2> <fae2> 15482\n<fae3> <fae3> 15485\n<fae4> <fae4> 17332\n<fae5> <fae5> 16593\n<fae6> <fae6> 15730\n<fae7> <fae7> 16596\n<fae8> <fae8> 15398\n<fae9> <fae9> 14059\n<faea> <faea> 16602\n<faeb> <faeb> 16601\n<faec> <faec> 16575\n<faed> <faed> 15745\n<faee> <faee> 16625\n<faef> <faef> 16640\n<faf0> <faf0> 15493\n<faf1> <faf1> 17333\n<faf2> <faf2> 14877\n<faf3> <faf3> 14325\n<faf4> <faf4> 14062\n<faf5> <faf5> 15967\n<faf6> <faf6> 16662\n<faf7> <faf7> 17083\n<faf8> <faf8> 16671\n<faf9> <faf9> 17334\n<fafa> <fafa> 16664\n<fafb> <fafc> 17335\n<fafd> <fafd> 16675\n<fafe> <fafe> 16674\n<fb40> <fb40> 16679\n<fb41> <fb41> 17337\n<fb42> <fb42> 16681\n<fb43> <fb43> 17338\n<fb44> <fb44> 15829\n<fb45> <fb45> 16111\n<fb46> <fb46> 15754\n<fb47> <fb47> 17339\n<fb48> <fb48> 14891\nendcidrange\n\n100 begincidrange\n<fb49> <fb49> 17340\n<fb4a> <fb4a> 16696\n<fb4b> <fb4b> 17341\n<fb4c> <fb4c> 16014\n<fb4d> <fb4d> 14896\n<fb4e> <fb4e> 14447\n<fb4f> <fb4f> 16707\n<fb50> <fb50> 16710\n<fb51> <fb51> 16708\n<fb52> <fb52> 16713\n<fb53> <fb53> 15269\n<fb54> <fb54> 16727\n<fb55> <fb55> 17342\n<fb56> <fb56> 16737\n<fb57> <fb57> 14060\n<fb58> <fb58> 16746\n<fb59> <fb59> 15748\n<fb5a> <fb5a> 16386\n<fb5b> <fb5b> 16774\n<fb5c> <fb5c> 16314\n<fb5d> <fb5d> 17343\n<fb5e> <fb5e> 16325\n<fb5f> <fb5f> 16208\n<fb60> <fb60> 16022\n<fb61> <fb61> 17344\n<fb62> <fb62> 16778\n<fb63> <fb63> 16321\n<fb64> <fb64> 15759\n<fb65> <fb65> 17345\n<fb66> <fb66> 16032\n<fb67> <fb67> 16150\n<fb68> <fb68> 16029\n<fb69> <fb69> 16782\n<fb6a> <fb6a> 16786\n<fb6b> <fb6b> 14950\n<fb6c> <fb6c> 16028\n<fb6d> <fb6d> 17295\n<fb6e> <fb6e> 16016\n<fb6f> <fb6f> 16797\n<fb70> <fb71> 17346\n<fb72> <fb72> 17238\n<fb73> <fb73> 14248\n<fb74> <fb74> 16798\n<fb75> <fb75> 16793\n<fb76> <fb76> 16775\n<fb77> <fb77> 16034\n<fb78> <fb78> 16799\n<fb79> <fb79> 16007\n<fb7a> <fb7a> 16004\n<fb7b> <fb7b> 16046\n<fb7c> <fb7d> 15220\n<fb7e> <fb7e> 14242\n<fba1> <fba1> 15218\n<fba2> <fba2> 15993\n<fba3> <fba3> 15981\n<fba4> <fba5> 17348\n<fba6> <fba6> 16050\n<fba7> <fba7> 17350\n<fba8> <fba8> 16044\n<fba9> <fba9> 16842\n<fbaa> <fbaa> 16884\n<fbab> <fbab> 17351\n<fbac> <fbac> 16848\n<fbad> <fbad> 15018\n<fbae> <fbae> 16862\n<fbaf> <fbaf> 16859\n<fbb0> <fbb0> 16872\n<fbb1> <fbb1> 17352\n<fbb2> <fbb2> 16374\n<fbb3> <fbb3> 16857\n<fbb4> <fbb4> 15682\n<fbb5> <fbb5> 16885\n<fbb6> <fbb6> 16888\n<fbb7> <fbb7> 16891\n<fbb8> <fbb8> 16901\n<fbb9> <fbb9> 15758\n<fbba> <fbba> 16910\n<fbbb> <fbbb> 15715\n<fbbc> <fbbc> 16930\n<fbbd> <fbbd> 16929\n<fbbe> <fbbe> 16931\n<fbbf> <fbbf> 16489\n<fbc0> <fbc0> 16431\n<fbc1> <fbc1> 16962\n<fbc2> <fbc2> 14501\n<fbc3> <fbc3> 16966\n<fbc4> <fbc4> 15605\n<fbc5> <fbc5> 15721\n<fbc6> <fbc6> 15614\n<fbc7> <fbc7> 16987\n<fbc8> <fbc8> 15048\n<fbc9> <fbc9> 15808\n<fbca> <fbca> 14826\n<fbcb> <fbcb> 16384\n<fbcc> <fbcc> 16996\n<fbcd> <fbcd> 16994\n<fbce> <fbce> 16383\n<fbcf> <fbcf> 16026\n<fbd0> <fbd0> 17011\n<fbd1> <fbd1> 14697\nendcidrange\n\n100 begincidrange\n<fbd2> <fbd2> 17018\n<fbd3> <fbd3> 17027\n<fbd4> <fbd5> 17353\n<fbd6> <fbd6> 16282\n<fbd7> <fbd7> 16053\n<fbd8> <fbd9> 17355\n<fbda> <fbda> 16306\n<fbdb> <fbdc> 17034\n<fbdd> <fbdd> 15127\n<fbde> <fbde> 17036\n<fbdf> <fbdf> 17040\n<fbe0> <fbe0> 15071\n<fbe1> <fbe1> 17357\n<fbe2> <fbe2> 17093\n<fbe3> <fbe3> 17096\n<fbe4> <fbe4> 16045\n<fbe5> <fbe5> 17358\n<fbe6> <fbe6> 16271\n<fbe7> <fbe7> 17359\n<fbe8> <fbe8> 15986\n<fbe9> <fbe9> 15984\n<fbea> <fbea> 17360\n<fbeb> <fbeb> 16042\n<fbec> <fbec> 17361\n<fbed> <fbed> 16297\n<fbee> <fbf0> 17362\n<fbf1> <fbf1> 17112\n<fbf2> <fbf2> 16371\n<fbf3> <fbf3> 17120\n<fbf4> <fbf4> 15104\n<fbf5> <fbf5> 17175\n<fbf6> <fbf6> 14381\n<fbf7> <fbf7> 15987\n<fbf8> <fbf8> 16341\n<fbf9> <fbfa> 17365\n<fbfb> <fbfb> 15124\n<fbfc> <fbfc> 14056\n<fbfd> <fbfd> 17140\n<fbfe> <fbfe> 15118\n<fc40> <fc40> 17132\n<fc41> <fc41> 17136\n<fc42> <fc42> 15997\n<fc43> <fc43> 17367\n<fc44> <fc44> 17150\n<fc45> <fc45> 17157\n<fc46> <fc46> 16346\n<fc47> <fc47> 15857\n<fc48> <fc48> 14131\n<fc49> <fc49> 15741\n<fc4a> <fc4a> 17368\n<fc4b> <fc4b> 14138\n<fc4c> <fc4c> 14144\n<fc4d> <fc4d> 14146\n<fc4e> <fc4e> 14150\n<fc4f> <fc4f> 14162\n<fc50> <fc50> 16159\n<fc51> <fc51> 17369\n<fc52> <fc52> 14061\n<fc53> <fc53> 15178\n<fc54> <fc54> 14174\n<fc55> <fc55> 15173\n<fc56> <fc56> 17370\n<fc57> <fc57> 16094\n<fc58> <fc58> 14185\n<fc59> <fc59> 14188\n<fc5a> <fc5a> 14187\n<fc5b> <fc5b> 14190\n<fc5c> <fc5c> 14207\n<fc5d> <fc5d> 14203\n<fc5e> <fc5e> 14210\n<fc5f> <fc5f> 15977\n<fc60> <fc60> 15183\n<fc61> <fc61> 14214\n<fc62> <fc62> 17371\n<fc63> <fc63> 14216\n<fc64> <fc64> 17372\n<fc65> <fc65> 16077\n<fc66> <fc66> 14231\n<fc67> <fc67> 16909\n<fc68> <fc68> 17373\n<fc69> <fc69> 14268\n<fc6a> <fc6a> 17374\n<fc6b> <fc6b> 14296\n<fc6c> <fc6c> 15217\n<fc6d> <fc6d> 15994\n<fc6e> <fc6e> 17375\n<fc6f> <fc6f> 14556\n<fc70> <fc70> 14304\n<fc71> <fc71> 14318\n<fc72> <fc72> 14324\n<fc73> <fc73> 14355\n<fc74> <fc75> 17376\n<fc76> <fc76> 16048\n<fc77> <fc77> 17378\n<fc78> <fc78> 16365\n<fc79> <fc79> 14349\n<fc7a> <fc7a> 16047\n<fc7b> <fc7b> 16274\n<fc7c> <fc7c> 14358\n<fc7d> <fc7d> 14363\nendcidrange\n\n89 begincidrange\n<fc7e> <fc7e> 16290\n<fca1> <fca1> 14364\n<fca2> <fca3> 14366\n<fca4> <fca4> 16049\n<fca5> <fca5> 4938\n<fca6> <fca6> 17379\n<fca7> <fca7> 16361\n<fca8> <fca8> 17380\n<fca9> <fca9> 16377\n<fcaa> <fcaa> 15763\n<fcab> <fcab> 17381\n<fcac> <fcac> 15961\n<fcad> <fcad> 17382\n<fcae> <fcae> 14391\n<fcaf> <fcaf> 16281\n<fcb0> <fcb0> 16025\n<fcb1> <fcb1> 15966\n<fcb2> <fcb2> 15284\n<fcb3> <fcb3> 16043\n<fcb4> <fcb5> 17383\n<fcb6> <fcb6> 14430\n<fcb7> <fcb7> 17385\n<fcb8> <fcb8> 15806\n<fcb9> <fcb9> 16005\n<fcba> <fcbb> 14435\n<fcbc> <fcbc> 15724\n<fcbd> <fcbd> 14449\n<fcbe> <fcbe> 16096\n<fcbf> <fcbf> 17386\n<fcc0> <fcc0> 14460\n<fcc1> <fcc1> 17387\n<fcc2> <fcc2> 16056\n<fcc3> <fcc3> 14466\n<fcc4> <fcc4> 16027\n<fcc5> <fcc5> 17388\n<fcc6> <fcc6> 14472\n<fcc7> <fcc7> 15374\n<fcc8> <fcc8> 14382\n<fcc9> <fcc9> 14490\n<fcca> <fcca> 14475\n<fccb> <fccb> 15364\n<fccc> <fccc> 14057\n<fccd> <fccd> 17085\n<fcce> <fcce> 15309\n<fccf> <fccf> 14495\n<fcd0> <fcd0> 15838\n<fcd1> <fcd1> 14235\n<fcd2> <fcd2> 15315\n<fcd3> <fcd3> 14511\n<fcd4> <fcd4> 16023\n<fcd5> <fcd5> 14550\n<fcd6> <fcd6> 16181\n<fcd7> <fcd7> 14560\n<fcd8> <fcd8> 16437\n<fcd9> <fcd9> 14576\n<fcda> <fcdb> 17389\n<fcdc> <fcdc> 15357\n<fcdd> <fcde> 15377\n<fcdf> <fcdf> 17391\n<fce0> <fce0> 14213\n<fce1> <fce1> 14594\n<fce2> <fce2> 15836\n<fce3> <fce3> 17392\n<fce4> <fce4> 16298\n<fce5> <fce5> 14603\n<fce6> <fce6> 16153\n<fce7> <fce7> 14606\n<fce8> <fce8> 14617\n<fce9> <fce9> 17393\n<fcea> <fcea> 15420\n<fceb> <fceb> 14618\n<fcec> <fcec> 15418\n<fced> <fced> 14619\n<fcee> <fcee> 15974\n<fcef> <fcef> 16162\n<fcf0> <fcf0> 15742\n<fcf1> <fcf1> 15985\n<fcf2> <fcf2> 15417\n<fcf3> <fcf3> 16033\n<fcf4> <fcf5> 17394\n<fcf6> <fcf6> 16176\n<fcf7> <fcf7> 14633\n<fcf8> <fcf8> 16316\n<fcf9> <fcf9> 14646\n<fcfa> <fcfa> 17396\n<fcfb> <fcfb> 14647\n<fcfc> <fcfc> 16272\n<fcfd> <fcfd> 17397\n<fcfe> <fcfe> 2746\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/HKm471-B5-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (HKm471-B5-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (HKm471-B5-H)\n%%BeginResource: CMap (HKm471-B5-V)\n%%Title: (HKm471-B5-V Adobe CNS1 1)\n%%Version: 12.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/HKm471-B5-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 1 def\nend def\n\n/CMapName /HKm471-B5-V def\n/CMapVersion 12.002 def\n/CMapType 1 def\n\n/XUID [1 10 25526] def\n\n/WMode 1 def\n\n12 begincidrange\n<a14b> <a14b> 13646\n<a15a> <a15a> 13743\n<a15c> <a15c> 13745\n<a15d> <a15e> 130\n<a161> <a162> 134\n<a165> <a166> 138\n<a169> <a16a> 142\n<a16d> <a16e> 146\n<a171> <a172> 150\n<a175> <a176> 154\n<a179> <a17a> 158\n<a1e3> <a1e3> 13647\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/HKscs-B5-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (HKscs-B5-H)\n%%Title: (HKscs-B5-H Adobe CNS1 6)\n%%Version: 2.006\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 6 def\nend def\n\n/CMapName /HKscs-B5-H def\n/CMapVersion 2.006 def\n/CMapType 1 def\n\n/XUID [1 10 25580] def\n\n/WMode 0 def\n\n2 begincodespacerange\n  <00>   <80>\n  <8740> <FEFE>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 1\nendnotdefrange\n\n100 begincidchar\n<8943> 17718\n<894c> 17723\n<894d> 17347\n<8951> 17306\n<89a6> 17314\n<89ab> 17388\n<89ac> 17777\n<89ad> 17387\n<89ae> 17778\n<89cf> 17340\n<89d9> 17308\n<89da> 17815\n<89db> 17310\n<89dc> 17816\n<89dd> 17311\n<89e1> 17313\n<89e2> 17820\n<89e3> 17315\n<89fa> 17321\n<8a40> 17845\n<8a41> 17161\n<8a4d> 17846\n<8a5a> 17847\n<8a5e> 17848\n<8a71> 17849\n<8a76> 17214\n<8a77> 17850\n<8a7a> 17851\n<8a7b> 17219\n<8a7c> 17852\n<8a7d> 17221\n<8a7e> 17853\n<8aa8> 17854\n<8ab6> 17855\n<8ab7> 17245\n<8ab8> 17856\n<8ab9> 17247\n<8acc> 17857\n<8ae6> 17860\n<8ae7> 17371\n<8b40> 17883\n<8b45> 17294\n<8b46> 17886\n<8b47> 17295\n<8b48> 17887\n<8b49> 17296\n<8b4a> 17888\n<8b4b> 17297\n<8b4c> 17889\n<8b58> 17303\n<8b59> 17896\n<8b5a> 17304\n<8b5b> 17348\n<8b61> 17319\n<8b68> 17324\n<8c62> 19022\n<8cdb> 19023\n<8cdc> 18964\n<8d40> 19057\n<8d62> 17338\n<8d68> 17339\n<8d69> 17312\n<8d6a> 17341\n<8d6e> 17342\n<8d76> 17343\n<8d7a> 17344\n<8d7b> 17981\n<8d7c> 17345\n<8da5> 17346\n<8da8> 17337\n<8da9> 17325\n<8db6> 17351\n<8dc3> 17352\n<8dfa> 17401\n<8e45> 18072\n<8e69> 4181\n<8e6a> 14164\n<8e6f> 11752\n<8e76> 18075\n<8e7b> 18076\n<8e7e> 289\n<8ea6> 18077\n<8eab> 4203\n<8eb4> 4902\n<8eb8> 18078\n<8ec9> 18079\n<8ecd> 1643\n<8ed0> 4910\n<8ee5> 18080\n<8eef> 18081\n<8ef6> 18082\n<8f57> 3381\n<8f58> 14296\n<8f59> 18083\n<8f5f> 18084\n<8f67> 18085\n<8f68> 14309\n<8f69> 10178\n<8f6e> 8877\n<8f79> 18086\nendcidchar\n\n100 begincidchar\n<8fb0> 18087\n<8fc5> 18088\n<8fc6> 14368\n<8fc7> 18089\n<8fca> 18090\n<8fcb> 4940\n<8fcc> 16377\n<8fda> 18091\n<8fe3> 18092\n<8ffc> 18093\n<8ffd> 14420\n<8ffe> 2510\n<9055> 18094\n<906d> 3015\n<906e> 14466\n<906f> 18098\n<907a> 14057\n<90a6> 18099\n<90b8> 18100\n<90dc> 5009\n<90f1> 5796\n<9165> 18101\n<916e> 18102\n<917e> 18103\n<91a1> 14633\n<91a2> 18104\n<91bf> 12402\n<91c8> 18105\n<9244> 14728\n<9264> 18106\n<926d> 18107\n<92b1> 284\n<92b2> 283\n<92c8> 16300\n<92d1> 10620\n<92e5> 18108\n<92f2> 18109\n<9368> 18110\n<93aa> 18111\n<93c2> 18112\n<93e5> 18113\n<93e8> 18114\n<93eb> 18115\n<9446> 18116\n<9447> 7430\n<9479> 18117\n<94ca> 10657\n<94cb> 18118\n<954d> 18119\n<955a> 18120\n<955f> 18121\n<95c6> 18122\n<95d9> 6171\n<9644> 15919\n<9651> 18123\n<966a> 18124\n<96d4> 18125\n<96ed> 15478\n<96fc> 11044\n<986f> 18128\n<9877> 15705\n<987a> 15706\n<98a3> 15707\n<98af> 15708\n<98b4> 17354\n<98b5> 18154\n<98b6> 15709\n<98b7> 18155\n<98b8> 17356\n<98b9> 15710\n<98ba> 18156\n<98bb> 17402\n<98bc> 18157\n<98c2> 15713\n<98c3> 18161\n<98c4> 15714\n<98c5> 18162\n<98d2> 17357\n<98da> 18178\n<98db> 17361\n<98df> 17364\n<98e3> 15717\n<98e7> 15718\n<98ed> 15719\n<98f0> 15720\n<98f1> 18195\n<98f2> 15721\n<98f3> 18196\n<98fc> 15722\n<98fd> 18203\n<98fe> 17367\n<9942> 17404\n<9943> 15723\n<9944> 18206\n<9945> 15724\n<9946> 18207\n<9947> 17368\n<994f> 15725\n<9954> 17369\n<995c> 17370\nendcidchar\n\n100 begincidchar\n<9964> 17372\n<996a> 15726\n<996e> 15727\n<9975> 15728\n<9978> 15729\n<99a1> 18255\n<99a2> 15730\n<99a3> 18256\n<99a4> 17349\n<99a5> 18257\n<99a6> 17350\n<99ae> 15731\n<99b2> 17374\n<99b6> 15732\n<99ba> 15733\n<99ca> 17376\n<99cd> 17378\n<99d3> 17379\n<99d6> 17381\n<99df> 17375\n<99e2> 15734\n<99e3> 18308\n<99e4> 17323\n<99e5> 18309\n<99e6> 17383\n<99e7> 18310\n<99e8> 17385\n<99ef> 17405\n<99f4> 15735\n<9a4a> 15736\n<9a4b> 18341\n<9a4c> 15737\n<9a59> 15738\n<9a5f> 17327\n<9a60> 18359\n<9a61> 15739\n<9a66> 17389\n<9a67> 18364\n<9a68> 15740\n<9a69> 17390\n<9a6a> 18365\n<9a6b> 17407\n<9a73> 15741\n<9a74> 18373\n<9a75> 17393\n<9a7e> 15742\n<9aa3> 17395\n<9aa4> 18384\n<9aa5> 17394\n<9aa9> 17400\n<9aaa> 17396\n<9ab2> 15743\n<9ab7> 15744\n<9ab8> 18399\n<9ab9> 15745\n<9aba> 18400\n<9abb> 15746\n<9abc> 18401\n<9abd> 17335\n<9ac7> 15747\n<9ad0> 15748\n<9ad1> 18419\n<9ad2> 15749\n<9ae2> 15753\n<9ae3> 18432\n<9ae4> 15754\n<9ae8> 15755\n<9ae9> 17328\n<9aee> 17330\n<9af2> 15756\n<9af6> 15757\n<9afb> 15758\n<9b46> 15759\n<9b4a> 15760\n<9b54> 15762\n<9b58> 15763\n<9b59> 18474\n<9b5a> 15764\n<9b5b> 18475\n<9b5c> 15765\n<9b5d> 18476\n<9b60> 18477\n<9b76> 12112\n<9b77> 15773\n<9b78> 5925\n<9b7b> 13037\n<9b7c> 15776\n<9b7d> 18496\n<9b7e> 15777\n<9ba1> 15778\n<9ba2> 18497\n<9bab> 18500\n<9bac> 15785\n<9baf> 15786\n<9bbe> 15795\n<9bbf> 18509\n<9bc6> 10969\n<9bca> 15803\n<9bcb> 18513\n<9bcc> 15804\nendcidchar\n\n100 begincidchar\n<9bcd> 18514\n<9bce> 17360\n<9bcf> 18515\n<9bd2> 18516\n<9bd3> 15807\n<9bd4> 18517\n<9bd5> 15808\n<9bdd> 15812\n<9bde> 7188\n<9bdf> 15813\n<9be0> 18522\n<9be1> 15814\n<9be2> 18523\n<9be3> 15815\n<9be7> 15816\n<9be8> 18527\n<9bec> 16890\n<9bed> 18528\n<9bf3> 15823\n<9bf6> 4841\n<9bf7> 18534\n<9bfa> 18535\n<9c42> 11438\n<9c43> 18538\n<9c47> 18539\n<9c48> 15835\n<9c49> 18540\n<9c4a> 15836\n<9c53> 6756\n<9c54> 18543\n<9c55> 15844\n<9c56> 18544\n<9c5c> 18545\n<9c5d> 15850\n<9c60> 15851\n<9c61> 18548\n<9c62> 5124\n<9c63> 18549\n<9c67> 18550\n<9c68> 8996\n<9c69> 18551\n<9c6a> 15857\n<9c6b> 13418\n<9c6c> 18552\n<9c6d> 15858\n<9c6e> 18553\n<9c77> 8849\n<9c78> 18556\n<9c79> 15866\n<9c7a> 18557\n<9c7d> 18558\n<9c7e> 15869\n<9ca5> 15872\n<9caa> 18563\n<9cab> 15875\n<9cac> 18564\n<9cbb> 18567\n<9cbc> 6023\n<9cbd> 2399\n<9cce> 18571\n<9ccf> 15903\n<9cd0> 7833\n<9cdb> 18576\n<9ce6> 18577\n<9cea> 18578\n<9ced> 18579\n<9cfd> 15938\n<9cfe> 18583\n<9d40> 17384\n<9d46> 15939\n<9d49> 15940\n<9d4e> 18593\n<9d4f> 15944\n<9d50> 18594\n<9d51> 15945\n<9d55> 15946\n<9d56> 18598\n<9d57> 9665\n<9d5a> 3340\n<9d61> 17353\n<9d62> 15948\n<9d63> 18607\n<9d64> 15949\n<9d78> 17397\n<9d79> 15950\n<9d7e> 15951\n<9da9> 18635\n<9daa> 15956\n<9dab> 18636\n<9db0> 15960\n<9db3> 15961\n<9db4> 18641\n<9db5> 15962\n<9db6> 18642\n<9db7> 15963\n<9dbe> 18647\n<9dc3> 15968\n<9dc4> 1510\n<9dc9> 18652\n<9dca> 15972\nendcidchar\n\n100 begincidchar\n<9dd2> 18655\n<9dfc> 18660\n<9e43> 18661\n<9e5f> 18662\n<9e63> 18663\n<9e68> 16054\n<9e69> 18666\n<9e6a> 16055\n<9e71> 16056\n<9e72> 18673\n<9e73> 16057\n<9e79> 18677\n<9e7a> 16060\n<9e7b> 18678\n<9e7c> 16061\n<9e7d> 18679\n<9e7e> 16062\n<9ea3> 18680\n<9ea9> 1832\n<9eaa> 16069\n<9eab> 18683\n<9eae> 18684\n<9eb4> 16075\n<9eb5> 18687\n<9eb8> 18688\n<9eb9> 16078\n<9ebc> 16079\n<9ec6> 18696\n<9ecd> 16089\n<9ed2> 18701\n<9ed3> 16092\n<9eef> 9398\n<9ef2> 18706\n<9efb> 18710\n<9efc> 16124\n<9efd> 6150\n<9efe> 16126\n<9f43> 18711\n<9f48> 18712\n<9f60> 13585\n<9f66> 14661\n<9f70> 18717\n<9fb5> 18718\n<9fbb> 18719\n<9fbf> 18720\n<9fc0> 16212\n<9fc1> 18721\n<9fcb> 3970\n<9fcc> 18722\n<9fd4> 18723\n<9fd8> 14910\n<9fe4> 18724\n<9ff9> 18725\n<a040> 18726\n<a047> 18727\n<a055> 18728\n<a063> 14353\n<a06d> 18729\n<a077> 1522\n<a07b> 18730\n<a0a1> 16330\n<a0a2> 18731\n<a0a7> 18732\n<a0c5> 18733\n<a0d0> 18734\n<a0d5> 15086\n<a0df> 9341\n<a0e3> 18735\n<a0e4> 15049\n<a0ee> 17332\n<a0f2> 17336\n<a1f6> 248\n<a1f7> 247\n<acfe> 2431\n<be52> 4308\n<c2cb> 5221\n<c3b9> 5551\n<c3ba> 5550\n<c456> 5495\n<c6d4> 558\n<c6d6> 560\n<c8e0> 18846\n<c8e9> 18847\n<c8f1> 18848\n<c94a> 628\n<c9be> 6039\n<caf7> 6134\n<d6cc> 8788\n<d77a> 8889\n<dadf> 8142\n<ddfc> 9089\n<ebf1> 10926\n<ecde> 11073\n<eeeb> 12308\n<f056> 11719\n<f0cb> 11361\n<f16b> 12640\n<f268> 12783\n<f4b5> 12526\n<f663> 12900\nendcidchar\n\n45 begincidchar\n<f9c4> 13585\n<f9c5> 13629\n<f9c6> 13641\n<fa5f> 2106\n<fa66> 2557\n<fabd> 781\n<fac5> 363\n<fad5> 2144\n<fb48> 16002\n<fb53> 18760\n<fb6e> 18761\n<fba3> 18762\n<fbb8> 3107\n<fbbf> 18763\n<fbcd> 18764\n<fbf3> 6116\n<fbf9> 16014\n<fc4a> 18765\n<fc4f> 8495\n<fc52> 18766\n<fc63> 18767\n<fc6c> 16385\n<fc6d> 18768\n<fc75> 18769\n<fcb9> 4447\n<fccc> 18772\n<fce2> 3193\n<fce3> 18773\n<fcee> 18774\n<fcf1> 1219\n<fd49> 18775\n<fd6a> 18776\n<fdb7> 6333\n<fdb8> 3261\n<fdbb> 3237\n<fde3> 18777\n<fdf1> 3278\n<fdf2> 18778\n<fe52> 15728\n<fe6d> 18779\n<fe6e> 17055\n<fe6f> 3716\n<fe78> 18780\n<feaa> 288\n<fedd> 7080\nendcidchar\n\n100 begincidrange\n<20> <7e> 1\n<8740> <8765> 18965\n<8767> <8779> 19003\n<877a> <877e> 19088\n<87a1> <87df> 19093\n<8840> <8855> 17609\n<8856> <887e> 18785\n<88a1> <88a8> 18826\n<88a9> <88aa> 18844\n<8940> <8941> 17716\n<8946> <8949> 17719\n<894e> <8950> 17724\n<8952> <897e> 17727\n<89a1> <89a5> 17772\n<89b0> <89b2> 17779\n<89b5> <89bf> 17782\n<89c1> <89c3> 17793\n<89c5> <89ce> 17796\n<89d0> <89d8> 17806\n<89de> <89e0> 17817\n<89e4> <89e9> 17821\n<89ea> <89eb> 17317\n<89ec> <89f9> 17827\n<89fb> <89fe> 17841\n<8a43> <8a4c> 17163\n<8a4e> <8a59> 17174\n<8a5b> <8a5d> 17187\n<8a5f> <8a62> 17191\n<8a64> <8a70> 17196\n<8a72> <8a74> 17210\n<8a78> <8a79> 17216\n<8aa1> <8aa7> 17223\n<8aa9> <8aaa> 17231\n<8aac> <8ab0> 17234\n<8ab2> <8ab5> 17240\n<8abb> <8ac7> 17249\n<8ac9> <8acb> 17263\n<8ace> <8ad5> 17268\n<8ad6> <8ad7> 17858\n<8ad8> <8adc> 17278\n<8adf> <8ae5> 17285\n<8ae8> <8af4> 17861\n<8af6> <8afe> 17874\n<8b41> <8b42> 17292\n<8b43> <8b44> 17884\n<8b4d> <8b50> 17298\n<8b51> <8b53> 17890\n<8b55> <8b57> 17893\n<8b5c> <8b60> 17897\n<8b62> <8b67> 17902\n<8b69> <8b7e> 17908\n<8ba1> <8bbf> 17930\n<8bc0> <8bdc> 17631\n<8bde> <8bfd> 17660\n<8c40> <8c61> 18849\n<8c63> <8c7e> 18883\n<8ca1> <8ca5> 18911\n<8ca7> <8cc5> 18916\n<8cc9> <8ccc> 18947\n<8cce> <8cda> 18951\n<8cdd> <8ce4> 19024\n<8ce6> <8cfe> 19032\n<8d42> <8d5f> 19058\n<8d60> <8d61> 17961\n<8d63> <8d67> 17963\n<8d6b> <8d6d> 17968\n<8d6f> <8d75> 17971\n<8d77> <8d79> 17978\n<8d7d> <8d7e> 17982\n<8da1> <8da4> 17984\n<8da6> <8da7> 17988\n<8daa> <8db5> 17990\n<8db7> <8dc2> 18002\n<8dc4> <8df9> 18014\n<8dfb> <8dfe> 18068\n<8e40> <8e44> 14123\n<8e46> <8e68> 14128\n<8e6b> <8e6c> 18073\n<8e6d> <8e6e> 14166\n<8e70> <8e75> 14169\n<8e77> <8e7a> 14175\n<8e7c> <8e7d> 14180\n<8ea1> <8ea5> 14182\n<8ea7> <8eaa> 14187\n<8eac> <8eb3> 14192\n<8eb5> <8eb7> 14201\n<8eb9> <8ec8> 14205\n<8eca> <8ecc> 14221\n<8ece> <8ecf> 14225\n<8ed1> <8ee4> 14228\n<8ee6> <8eee> 14248\n<8ef0> <8ef5> 14257\n<8ef7> <8efe> 14264\n<8f40> <8f56> 14272\n<8f5a> <8f5e> 14297\n<8f60> <8f66> 14302\n<8f6a> <8f6d> 14311\n<8f6f> <8f78> 14316\n<8f7a> <8f7e> 14327\n<8fa1> <8faf> 14332\nendcidrange\n\n100 begincidrange\n<8fb1> <8fc4> 14348\n<8fc8> <8fc9> 14369\n<8fcd> <8fd9> 14374\n<8fdb> <8fe2> 14387\n<8fe4> <8ffb> 14396\n<9040> <9054> 14422\n<9056> <905b> 14444\n<905c> <905e> 18095\n<905f> <906c> 14451\n<9070> <9079> 14467\n<907b> <907e> 14477\n<90a1> <90a5> 14481\n<90a7> <90b7> 14486\n<90b9> <90db> 14503\n<90dd> <90f0> 14539\n<90f2> <90fe> 14560\n<9140> <9164> 14573\n<9166> <916d> 14610\n<916f> <917d> 14618\n<91a3> <91be> 14634\n<91c0> <91c7> 14663\n<91c9> <91fe> 14672\n<9240> <9243> 14726\n<9245> <9263> 14731\n<9265> <926c> 14763\n<926e> <927e> 14772\n<92a1> <92ae> 14789\n<92af> <92b0> 281\n<92b3> <92c7> 14803\n<92c9> <92d0> 14825\n<92d2> <92e4> 14834\n<92e6> <92f1> 14853\n<92f3> <92fe> 14865\n<9340> <9367> 14877\n<9369> <937e> 14917\n<93a1> <93a9> 14939\n<93ab> <93c1> 14948\n<93c3> <93e4> 14971\n<93e6> <93e7> 15005\n<93e9> <93ea> 15008\n<93ec> <93fe> 15010\n<9440> <9445> 15029\n<9448> <9478> 15036\n<947a> <947e> 15086\n<94a1> <94c9> 15091\n<94cc> <94fe> 15134\n<9540> <954c> 15185\n<954e> <9559> 15198\n<955b> <955e> 15210\n<9560> <957e> 15215\n<95a1> <95c5> 15246\n<95c7> <95d8> 15283\n<95da> <95fe> 15302\n<9640> <9643> 15339\n<9645> <9650> 15344\n<9652> <9669> 15357\n<966b> <967e> 15382\n<96a1> <96d3> 15402\n<96d5> <96ec> 15453\n<96ee> <96fb> 15478\n<96fd> <96fe> 15493\n<9740> <977e> 15495\n<97a1> <97fe> 15558\n<9840> <9843> 15652\n<9844> <9845> 18126\n<9846> <986e> 15658\n<9870> <9874> 15700\n<9875> <9876> 18129\n<9878> <9879> 18131\n<987b> <987e> 18133\n<98a1> <98a2> 18137\n<98a4> <98ae> 18139\n<98b0> <98b3> 18150\n<98bd> <98be> 15711\n<98bf> <98c1> 18158\n<98c6> <98c7> 15715\n<98c8> <98d1> 18163\n<98d3> <98d7> 18173\n<98d8> <98d9> 17358\n<98dc> <98de> 18179\n<98e0> <98e2> 18182\n<98e4> <98e6> 18185\n<98e8> <98ec> 18188\n<98ee> <98ef> 18193\n<98f4> <98f5> 17365\n<98f6> <98fb> 18197\n<9940> <9941> 18204\n<9948> <994e> 18208\n<9950> <9953> 18215\n<9955> <995b> 18219\n<995d> <9963> 18226\n<9965> <9969> 18233\n<996b> <996d> 18238\n<996f> <9974> 18241\n<9976> <9977> 18247\n<9979> <997e> 18249\n<99a7> <99ad> 18258\n<99af> <99b1> 18265\n<99b3> <99b5> 18268\n<99b7> <99b9> 18271\nendcidrange\n\n100 begincidrange\n<99bb> <99c9> 18274\n<99cb> <99cc> 18289\n<99ce> <99d2> 18291\n<99d4> <99d5> 18296\n<99d7> <99de> 18298\n<99e0> <99e1> 18306\n<99e9> <99ee> 18311\n<99f0> <99f3> 18317\n<99f5> <99fe> 18321\n<9a40> <9a49> 18331\n<9a4d> <9a58> 18342\n<9a5a> <9a5e> 18354\n<9a62> <9a65> 18360\n<9a6c> <9a72> 18366\n<9a76> <9a7d> 18374\n<9aa1> <9aa2> 18382\n<9aa6> <9aa8> 18385\n<9aab> <9ab1> 18388\n<9ab3> <9ab6> 18395\n<9abe> <9ac6> 18402\n<9ac8> <9acf> 18411\n<9ad3> <9ad8> 18420\n<9ad9> <9adb> 15750\n<9adc> <9ae1> 18426\n<9ae5> <9ae7> 18433\n<9aea> <9aed> 18436\n<9aef> <9af1> 18440\n<9af3> <9af5> 18443\n<9af7> <9afa> 18446\n<9afc> <9afe> 18450\n<9b40> <9b45> 18453\n<9b47> <9b49> 18459\n<9b4b> <9b53> 18462\n<9b55> <9b57> 18471\n<9b5e> <9b5f> 15766\n<9b62> <9b6f> 18478\n<9b70> <9b73> 15768\n<9b74> <9b75> 18492\n<9b79> <9b7a> 18494\n<9ba3> <9ba4> 15779\n<9ba5> <9ba6> 18498\n<9ba7> <9baa> 15781\n<9bad> <9bae> 18501\n<9bb0> <9bb1> 18503\n<9bb2> <9bb9> 15787\n<9bba> <9bbd> 18505\n<9bc0> <9bc5> 15796\n<9bc7> <9bc9> 18510\n<9bd0> <9bd1> 15805\n<9bd6> <9bd7> 18518\n<9bd8> <9bda> 15809\n<9bdb> <9bdc> 18520\n<9be4> <9be6> 18524\n<9be9> <9beb> 15817\n<9bee> <9bef> 15821\n<9bf0> <9bf2> 18529\n<9bf4> <9bf5> 18532\n<9bf8> <9bf9> 15825\n<9bfb> <9bfc> 15827\n<9bfd> <9bfe> 18536\n<9c40> <9c41> 15829\n<9c44> <9c46> 15832\n<9c4b> <9c4c> 18541\n<9c4d> <9c52> 15837\n<9c57> <9c5b> 15845\n<9c5e> <9c5f> 18546\n<9c64> <9c66> 15853\n<9c6f> <9c72> 15859\n<9c73> <9c74> 18554\n<9c75> <9c76> 15863\n<9c7b> <9c7c> 15867\n<9ca1> <9ca2> 15870\n<9ca3> <9ca4> 18559\n<9ca6> <9ca7> 18561\n<9ca8> <9ca9> 15873\n<9cad> <9cae> 15876\n<9caf> <9cb0> 18565\n<9cb1> <9cba> 15878\n<9cbe> <9cc2> 15890\n<9cc3> <9cc5> 18568\n<9cc6> <9ccd> 15895\n<9cd1> <9cd3> 15905\n<9cd4> <9cd7> 18572\n<9cd8> <9cda> 15908\n<9cdc> <9ce5> 15911\n<9ce7> <9ce9> 15921\n<9ceb> <9cec> 15924\n<9cee> <9cf9> 15926\n<9cfa> <9cfc> 18580\n<9d41> <9d45> 18584\n<9d47> <9d48> 18589\n<9d4a> <9d4b> 18591\n<9d4c> <9d4d> 15942\n<9d52> <9d54> 18595\n<9d58> <9d59> 18599\n<9d5b> <9d60> 18601\n<9d65> <9d77> 18608\n<9d7a> <9d7d> 18627\n<9da1> <9da4> 18631\n<9da5> <9da8> 15952\nendcidrange\n\n100 begincidrange\n<9dac> <9dad> 15957\n<9dae> <9daf> 18637\n<9db1> <9db2> 18639\n<9db8> <9dbb> 18643\n<9dbc> <9dbd> 15964\n<9dbf> <9dc0> 15966\n<9dc1> <9dc2> 18648\n<9dc5> <9dc6> 18650\n<9dc7> <9dc8> 15970\n<9dcb> <9dcc> 18653\n<9dcd> <9dd1> 15973\n<9dd3> <9dd5> 15978\n<9dd6> <9dd9> 18656\n<9dda> <9dfb> 15981\n<9dfd> <9dfe> 16015\n<9e40> <9e42> 16017\n<9e44> <9e5e> 16021\n<9e60> <9e62> 16049\n<9e64> <9e65> 16052\n<9e66> <9e67> 18664\n<9e6b> <9e70> 18667\n<9e74> <9e76> 18674\n<9e77> <9e78> 16058\n<9ea1> <9ea2> 16063\n<9ea4> <9ea6> 16065\n<9ea7> <9ea8> 18681\n<9eac> <9ead> 16070\n<9eaf> <9eb1> 16072\n<9eb2> <9eb3> 18685\n<9eb6> <9eb7> 16076\n<9eba> <9ebb> 18689\n<9ebd> <9ebe> 18691\n<9ebf> <9ec0> 16080\n<9ec1> <9ec3> 18693\n<9ec4> <9ec5> 16082\n<9ec7> <9eca> 16084\n<9ecb> <9ecc> 18697\n<9ece> <9ecf> 18699\n<9ed0> <9ed1> 16090\n<9ed4> <9ed5> 18702\n<9ed6> <9ed7> 16093\n<9ed8> <9ed9> 18704\n<9eda> <9eee> 16095\n<9ef0> <9ef1> 16117\n<9ef3> <9ef5> 16119\n<9ef6> <9ef8> 18707\n<9ef9> <9efa> 16122\n<9f40> <9f42> 16127\n<9f44> <9f47> 16130\n<9f49> <9f4a> 16134\n<9f4b> <9f4c> 18713\n<9f4d> <9f5f> 16136\n<9f61> <9f65> 16156\n<9f67> <9f68> 18715\n<9f69> <9f6f> 16163\n<9f71> <9f7e> 16170\n<9fa1> <9fb4> 16184\n<9fb6> <9fba> 16204\n<9fbc> <9fbe> 16209\n<9fc2> <9fca> 16213\n<9fcd> <9fd3> 16224\n<9fd5> <9fd7> 16232\n<9fd9> <9fe3> 16236\n<9fe5> <9ff8> 16247\n<9ffa> <9ffe> 16267\n<a041> <a046> 16272\n<a048> <a054> 16278\n<a056> <a062> 16291\n<a064> <a06c> 16305\n<a06e> <a076> 16314\n<a078> <a07a> 16324\n<a07c> <a07e> 16327\n<a0a3> <a0a6> 16331\n<a0a8> <a0c4> 16335\n<a0c6> <a0cf> 16364\n<a0d1> <a0d4> 16374\n<a0d6> <a0de> 16379\n<a0e0> <a0e2> 16389\n<a0e5> <a0e6> 16393\n<a0e7> <a0ed> 18736\n<a0ef> <a0f1> 18743\n<a0f3> <a0fe> 18746\n<a140> <a158> 99\n<a159> <a15c> 13743\n<a15d> <a17e> 128\n<a1a1> <a1f5> 162\n<a1f8> <a1fe> 249\n<a240> <a27e> 256\n<a2a1> <a2fe> 319\n<a340> <a37e> 413\n<a3a1> <a3bb> 476\n<a3bd> <a3bf> 503\n<a440> <a47e> 595\n<a4a1> <a4fe> 658\n<a540> <a57e> 752\n<a5a1> <a5fe> 815\n<a640> <a67e> 909\n<a6a1> <a6fe> 972\n<a740> <a77e> 1066\n<a7a1> <a7fe> 1129\nendcidrange\n\n100 begincidrange\n<a840> <a87e> 1223\n<a8a1> <a8fe> 1286\n<a940> <a97e> 1380\n<a9a1> <a9fe> 1443\n<aa40> <aa7e> 1537\n<aaa1> <aafe> 1600\n<ab40> <ab7e> 1694\n<aba1> <abfe> 1757\n<ac40> <ac7e> 1851\n<aca1> <acfd> 1914\n<ad40> <ad7e> 2007\n<ada1> <adfe> 2070\n<ae40> <ae7e> 2164\n<aea1> <aefe> 2227\n<af40> <af7e> 2321\n<afa1> <afcf> 2384\n<afd0> <affe> 2432\n<b040> <b07e> 2479\n<b0a1> <b0fe> 2542\n<b140> <b17e> 2636\n<b1a1> <b1fe> 2699\n<b240> <b27e> 2793\n<b2a1> <b2fe> 2856\n<b340> <b37e> 2950\n<b3a1> <b3fe> 3013\n<b440> <b47e> 3107\n<b4a1> <b4fe> 3170\n<b540> <b57e> 3264\n<b5a1> <b5fe> 3327\n<b640> <b67e> 3421\n<b6a1> <b6fe> 3484\n<b740> <b77e> 3578\n<b7a1> <b7fe> 3641\n<b840> <b87e> 3735\n<b8a1> <b8fe> 3798\n<b940> <b97e> 3892\n<b9a1> <b9fe> 3955\n<ba40> <ba7e> 4049\n<baa1> <bafe> 4112\n<bb40> <bb7e> 4206\n<bba1> <bbc7> 4269\n<bbc8> <bbfe> 4309\n<bc40> <bc7e> 4364\n<bca1> <bcfe> 4427\n<bd40> <bd7e> 4521\n<bda1> <bdfe> 4584\n<be40> <be51> 4678\n<be53> <be7e> 4696\n<bea1> <befe> 4740\n<bf40> <bf7e> 4834\n<bfa1> <bffe> 4897\n<c040> <c07e> 4991\n<c0a1> <c0fe> 5054\n<c140> <c17e> 5148\n<c1a1> <c1aa> 5211\n<c1ab> <c1fe> 5222\n<c240> <c27e> 5306\n<c2a1> <c2ca> 5369\n<c2cc> <c2fe> 5411\n<c340> <c360> 5462\n<c361> <c37e> 5496\n<c3a1> <c3b8> 5526\n<c3bb> <c3fe> 5552\n<c440> <c455> 5620\n<c457> <c47e> 5642\n<c4a1> <c4fe> 5682\n<c540> <c57e> 5776\n<c5a1> <c5fe> 5839\n<c640> <c67e> 5933\n<c6a1> <c6be> 506\n<c6bf> <c6ce> 537\n<c6d0> <c6d2> 554\n<c6d8> <c6dd> 13747\n<c6e0> <c6fe> 13754\n<c740> <c77e> 13785\n<c7a1> <c7fe> 13848\n<c840> <c87e> 13942\n<c8a1> <c8a4> 14005\n<c8cd> <c8d3> 14049\n<c8d4> <c8d6> 17606\n<c8d7> <c8df> 17692\n<c8e1> <c8e8> 17701\n<c8ea> <c8f0> 17709\n<c8f5> <c8fe> 18834\n<c940> <c949> 5996\n<c94b> <c96b> 6006\n<c96c> <c97e> 6040\n<c9a1> <c9bd> 6059\n<c9bf> <c9ec> 6088\n<c9ed> <c9fe> 6135\n<ca40> <ca7e> 6153\n<caa1> <caf6> 6216\n<caf8> <cafe> 6302\n<cb40> <cb7e> 6309\n<cba1> <cbfe> 6372\n<cc40> <cc7e> 6466\n<cca1> <ccfe> 6529\n<cd40> <cd7e> 6623\n<cda1> <cdfe> 6686\n<ce40> <ce7e> 6780\nendcidrange\n\n100 begincidrange\n<cea1> <cefe> 6843\n<cf40> <cf7e> 6937\n<cfa1> <cffe> 7000\n<d040> <d07e> 7094\n<d0a1> <d0fe> 7157\n<d140> <d17e> 7251\n<d1a1> <d1fe> 7314\n<d240> <d27e> 7408\n<d2a1> <d2fe> 7471\n<d340> <d37e> 7565\n<d3a1> <d3fe> 7628\n<d440> <d47e> 7722\n<d4a1> <d4fe> 7785\n<d540> <d57e> 7879\n<d5a1> <d5fe> 7942\n<d640> <d67e> 8036\n<d6a1> <d6cb> 8099\n<d6cd> <d6fe> 8143\n<d740> <d779> 8193\n<d77b> <d77e> 8251\n<d7a1> <d7fe> 8255\n<d840> <d87e> 8349\n<d8a1> <d8fe> 8412\n<d940> <d97e> 8506\n<d9a1> <d9fe> 8569\n<da40> <da7e> 8663\n<daa1> <dade> 8726\n<dae0> <dafe> 8789\n<db40> <db7e> 8820\n<dba1> <dba6> 8883\n<dba7> <dbfe> 8890\n<dc40> <dc7e> 8978\n<dca1> <dcfe> 9041\n<dd40> <dd7e> 9135\n<dda1> <ddfb> 9198\n<ddfd> <ddfe> 9289\n<de40> <de7e> 9291\n<dea1> <defe> 9354\n<df40> <df7e> 9448\n<dfa1> <dffe> 9511\n<e040> <e07e> 9605\n<e0a1> <e0fe> 9668\n<e140> <e17e> 9762\n<e1a1> <e1fe> 9825\n<e240> <e27e> 9919\n<e2a1> <e2fe> 9982\n<e340> <e37e> 10076\n<e3a1> <e3fe> 10139\n<e440> <e47e> 10233\n<e4a1> <e4fe> 10296\n<e540> <e57e> 10390\n<e5a1> <e5fe> 10453\n<e640> <e67e> 10547\n<e6a1> <e6fe> 10610\n<e740> <e77e> 10704\n<e7a1> <e7fe> 10767\n<e840> <e87e> 10861\n<e8a1> <e8a2> 10924\n<e8a3> <e8fe> 10927\n<e940> <e975> 11019\n<e976> <e97e> 11074\n<e9a1> <e9fe> 11083\n<ea40> <ea7e> 11177\n<eaa1> <eafe> 11240\n<eb40> <eb5a> 11334\n<eb5b> <eb7e> 11362\n<eba1> <ebf0> 11398\n<ebf2> <ebfe> 11478\n<ec40> <ec7e> 11491\n<eca1> <ecdd> 11554\n<ecdf> <ecfe> 11615\n<ed40> <ed7e> 11647\n<eda1> <eda9> 11710\n<edaa> <edfe> 11720\n<ee40> <ee7e> 11805\n<eea1> <eeea> 11868\n<eeec> <eefe> 11942\n<ef40> <ef7e> 11961\n<efa1> <effe> 12024\n<f040> <f055> 12118\n<f057> <f07e> 12140\n<f0a1> <f0ca> 12180\n<f0cc> <f0fe> 12222\n<f140> <f162> 12273\n<f163> <f16a> 12309\n<f16c> <f17e> 12317\n<f1a1> <f1fe> 12336\n<f240> <f267> 12430\n<f269> <f27e> 12470\n<f2a1> <f2c2> 12492\n<f2c3> <f2fe> 12527\n<f340> <f374> 12587\n<f375> <f37e> 12641\n<f3a1> <f3fe> 12651\n<f440> <f465> 12745\n<f466> <f47e> 12784\n<f4a1> <f4b4> 12809\n<f4b6> <f4fc> 12829\n<f4fd> <f4fe> 12901\n<f540> <f57e> 12903\nendcidrange\n\n67 begincidrange\n<f5a1> <f5fe> 12966\n<f640> <f662> 13060\n<f664> <f67e> 13095\n<f6a1> <f6fe> 13122\n<f740> <f77e> 13216\n<f7a1> <f7fe> 13279\n<f840> <f87e> 13373\n<f8a1> <f8fe> 13436\n<f940> <f976> 13530\n<f977> <f97e> 13586\n<f9a1> <f9c3> 13594\n<f9c7> <f9d1> 13630\n<f9d2> <f9d5> 13642\n<f9d6> <f9fe> 14056\n<fa40> <fa5e> 16395\n<fa60> <fa65> 16427\n<fa67> <fa7e> 16434\n<faa1> <faa8> 16458\n<faa9> <faaa> 18758\n<faab> <fabc> 16468\n<fabe> <fac4> 16487\n<fac6> <fad4> 16495\n<fad6> <fafe> 16511\n<fb40> <fb47> 16552\n<fb49> <fb52> 16561\n<fb54> <fb6d> 16572\n<fb6f> <fb7e> 16599\n<fba1> <fba2> 16615\n<fba4> <fbb7> 16618\n<fbb9> <fbbe> 16639\n<fbc0> <fbcc> 16645\n<fbce> <fbf2> 16658\n<fbf4> <fbf8> 16696\n<fbfa> <fbfe> 16702\n<fc40> <fc49> 16707\n<fc4b> <fc4e> 16717\n<fc50> <fc51> 16721\n<fc53> <fc62> 16723\n<fc64> <fc6b> 16739\n<fc6e> <fc74> 16749\n<fc76> <fc7e> 16756\n<fca1> <fcb8> 16765\n<fcba> <fcbb> 16789\n<fcbc> <fcbd> 18770\n<fcbe> <fccb> 16792\n<fccd> <fce1> 16807\n<fce4> <fced> 16829\n<fcef> <fcf0> 16839\n<fcf2> <fcfe> 16842\n<fd40> <fd48> 16855\n<fd4a> <fd69> 16864\n<fd6b> <fd7e> 16897\n<fda1> <fdb6> 16917\n<fdb9> <fdba> 16941\n<fdbc> <fde2> 16944\n<fde4> <fdf0> 16984\n<fdf3> <fdfe> 16998\n<fe40> <fe51> 17010\n<fe53> <fe6c> 17029\n<fe70> <fe77> 17057\n<fe79> <fe7e> 17065\n<fea1> <fea9> 17071\n<feab> <fedc> 17080\n<fede> <fedf> 18781\n<fee0> <feec> 17131\n<feed> <feee> 18783\n<feef> <fefe> 17144\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/HKscs-B5-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (HKscs-B5-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (HKscs-B5-H)\n%%BeginResource: CMap (HKscs-B5-V)\n%%Title: (HKscs-B5-V Adobe CNS1 6)\n%%Version: 13.005\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/HKscs-B5-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 6 def\nend def\n\n/CMapName /HKscs-B5-V def\n/CMapVersion 13.005 def\n/CMapType 1 def\n\n/XUID [1 10 25581] def\n\n/WMode 1 def\n\n13 begincidrange\n<a14b> <a14b> 13646\n<a15a> <a15a> 13743\n<a15c> <a15c> 13745\n<a15d> <a15e> 130\n<a161> <a162> 134\n<a165> <a166> 138\n<a169> <a16a> 142\n<a16d> <a16e> 146\n<a171> <a172> 150\n<a175> <a176> 154\n<a179> <a17a> 158\n<a1e3> <a1e3> 13647\n<c6e4> <c6e5> 14097\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/UniCNS-UCS2-H",
    "content": "begincmap\n/CMapName /UniCNS-UCS2-H def\n/WMode 0 def\n/UniCNS-X usecmap\nbegincodespacerange\n<0000><d7ff>\n<e000><ffff>\nendcodespacerange\nbegincidchar\n<2e9d>732\n<2ec6>1289\n<2ee3>2550\n<51e2>16466\n<54cc>17320\n<5553>17326\n<55b9>17322\n<55de>16020\n<577a>16223\n<5acf>17333\n<5ed0>16701\n<60b3>16748\n<60de>15820\n<69e9>15761\n<70a6>15699\n<8480>15214\n<8496>15133\n<8503>14730\n<8771>14347\n<8786>16048\n<898a>14371\n<89a9>14373\n<8b4c>14395\n<8e80>15959\n<936e>14824\n<93c6>14762\n<975d>15343\n<9771>15356\n<9962>17391\n<999b>15381\n<9ab6>17392\n<9f62>14671\nendcidchar\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/UniCNS-UCS2-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniCNS-UCS2-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniCNS-UCS2-H)\n%%BeginResource: CMap (UniCNS-UCS2-V)\n%%Title: (UniCNS-UCS2-V Adobe CNS1 3)\n%%Version: 12.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniCNS-UCS2-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 3 def\nend def\n\n/CMapName /UniCNS-UCS2-V def\n/CMapVersion 12.003 def\n/CMapType 1 def\n\n/XUID [1 10 25393] def\n\n/WMode 1 def\n\n13 begincidrange\n<2013> <2013> 120\n<2014> <2014> 122\n<2025> <2025> 109\n<3008> <3009> 150\n<300a> <300b> 146\n<300c> <300d> 154\n<300e> <300f> 158\n<3010> <3011> 142\n<3014> <3015> 138\n<fe4f> <fe4f> 13745\n<ff08> <ff09> 130\n<ff5b> <ff5b> 134\n<ff5d> <ff5d> 135\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/UniCNS-UTF16-H",
    "content": "begincmap\n/CMapName /UniCNS-UTF16-H def\n/WMode 0 def\n/UniCNS-X usecmap\nbegincodespacerange\n<0000><d7ff>\n<d800dc00><dbffdfff>\n<e000><ffff>\nendcodespacerange\nbegincidchar\n<a0>1\n<a9>96\n<af>195\n<02cd>198\n<0304>195\n<030c>504\n<2027>104\n<2122>97\n<2215>257\n<2295>243\n<2299>244\n<22ef>110\n<2574>13744\n<2e9d>18846\n<2ec6>18847\n<2ee3>18848\n<2f00>595\n<2f04>596\n<2f05>539\n<2f06>602\n<2f07>540\n<2f0f>607\n<2f10>5998\n<2f11>608\n<2f12>610\n<2f13>544\n<2f14>611\n<2f15>5999\n<2f16>545\n<2f19>546\n<2f1a>6000\n<2f1b>547\n<2f1c>614\n<2f1d>633\n<2f1e>6005\n<2f21>548\n<2f22>548\n<2f27>549\n<2f2c>6006\n<2f2d>646\n<2f2e>550\n<2f3b>6007\n<2f40>725\n<2f41>556\n<2f46>557\n<2f4e>6026\n<2f53>6028\n<2f59>6029\n<2f65>862\n<2f66>866\n<2f71>6066\n<2f79>6162\n<2f8b>6163\n<2f8c>6168\n<2f91>6169\n<2f98>6375\n<2fa1>560\n<2fa2>1307\n<2faa>561\n<2fad>17635\n<2fae>1698\n<2fbd>7731\n<2fbe>2552\n<2fbf>7732\n<2fcb>9056\n<2fcc>9746\n<2fd2>4745\n<2fd5>12045\n<31c5>17615\n<31c8>17622\n<31cf>13999\n<344a>19046\n<34e6>19122\n<3559>18860\n<361d>14007\n<3625>19012\n<3661>19084\n<37d6>19067\n<3875>19088\n<38d4>19074\n<3978>19045\n<3af5>19094\n<3b95>18976\n<3c18>18737\n<3c8b>18871\n<3d12>19036\n<3d88>19026\n<3dc9>18853\n<3df4>19006\n<3edb>18919\n<3eec>19092\n<3f07>19063\n<3fc8>19082\n<4009>18878\n<4071>18944\n<40b4>19149\n<40f8>19066\n<4102>19060\n<4131>19130\n<417c>19070\n<4181>19138\n<41ed>19087\n<4223>18881\n<4276>18949\n<42a2>18945\n<430a>19102\n<439a>19030\n<43f0>18965\n<4491>14004\n<44bd>19086\n<44c3>19027\n<44de>19085\n<44e1>19151\n<451b>19077\n<4523>14326\n<4536>19031\n<4558>19041\n<4561>19076\n<456d>19073\n<4578>18969\n<45a6>18968\n<45ac>17377\n<45b3>18972\n<45da>18989\n<45ea>19081\n<4603>18967\n<46a1>18994\n<46ae>19136\n<46bb>19061\n<46f7>19068\n<4736>18977\n<4744>18978\n<474f>18988\n<48b4>15301\n<492f>19128\n<4930>19106\n<4aa4>18993\n<4b10>18873\n<4b20>18858\n<4c32>18966\n<4c40>18980\n<4c47>18979\n<4c57>18986\n<4c77>19044\n<4c7b>19079\n<4c81>18955\n<4c85>18990\n<4ce2>18974\n<4d07>18992\n<4d76>19080\n<4d77>18971\n<4d89>19078\n<4e2f>18898\n<4ea3>18895\n<4efe>17307\n<4f17>18899\n<4fb4>19050\n<4ff0>18896\n<503b>18849\n<50bc>18897\n<51ae>18876\n<51e2>18758\n<524f>19120\n<5324>18888\n<5434>18901\n<544c>19129\n<54cc>17890\n<5553>18762\n<55b9>17892\n<55de>18661\n<56fb>19002\n<573d>18950\n<577a>18722\n<57b3>19127\n<5818>19132\n<581f>16598\n<5892>18903\n<5896>19108\n<58d0>18904\n<591d>19004\n<59bf>19052\n<5a1a>18946\n<5aa4>19011\n<5acf>14866\n<5ad1>19014\n<5b15>18921\n<5b96>18962\n<5bb7>19015\n<5bdb>19009\n<5c78>19035\n<5cd5>19032\n<5cf5>18857\n<5cfc>19016\n<5d78>19038\n<5d7b>18957\n<5e92>18906\n<5e99>18907\n<5ed0>16014\n<5f3b>19056\n<5fc2>18908\n<60b3>18768\n<60de>16890\n<60ea>16748\n<6122>18862\n<62c1>19153\n<658b>18910\n<664d>19001\n<6660>19113\n<66e7>19023\n<6719>18867\n<676b>18948\n<676e>19017\n<6782>19118\n<6919>18912\n<69e9>18463\n<6a29>19114\n<6a43>18913\n<6a63>18879\n<6cff>18915\n<6dfe>18850\n<6e57>19024\n<704d>18887\n<706e>19154\n<7077>18856\n<70a6>18128\n<7157>19040\n<7191>18866\n<7200>18916\n<7225>18996\n<738c>18918\n<73ba>18868\n<73c4>19123\n<7402>18875\n<744c>19116\n<7461>19020\n<749d>19021\n<74b9>18922\n<74c6>19125\n<76d9>18891\n<77dd>18894\n<78e4>18874\n<79ca>19025\n<79d0>19111\n<7a2a>18883\n<7a2c>19119\n<7a32>19112\n<7a72>19133\n<7a93>18926\n<7afc>19095\n<7bae>19140\n<7bc5>19117\n<7bec>18927\n<7cc3>18928\n<7d8b>18902\n<7d95>19003\n<7e5b>18964\n<7e6c>18929\n<816c>19053\n<82bf>18953\n<82f8>18930\n<8480>18121\n<8484>19103\n<8495>15214\n<8496>18118\n<8503>14728\n<8504>19147\n<855f>18938\n<8593>19018\n<8597>18931\n<85d6>18951\n<860f>18882\n<8613>19107\n<8771>18087\n<8786>18662\n<888f>18854\n<8890>18933\n<889d>19115\n<898a>18090\n<89a9>16377\n<8acc>19049\n<8af9>19034\n<8b4c>18092\n<8b83>18923\n<8b8f>19135\n<8e80>18637\n<8eb9>18935\n<8fa7>18864\n<8fcf>18937\n<9046>19121\n<91f6>18865\n<9218>19110\n<9221>18940\n<936e>16300\n<93c6>18106\n<93f4>18890\n<942f>19105\n<9734>19007\n<974a>19109\n<9755>18886\n<975d>15919\n<9771>18123\n<9856>19054\n<9868>18947\n<9962>18367\n<999b>18124\n<99e0>18939\n<9ab6>17895\n<9f62>18105\n<9f96>19104\n<9f97>19096\n<9fa6>18852\n<9fa7>18893\n<9fa8>18900\n<9fa9>18932\n<9faa>18934\n<9fab>18936\n<9fac>18941\n<9faf>18963\n<9fb0>14005\n<9fb1>14007\n<9fb2>19039\n<9fb3>19064\n<9fc7>19126\n<9fc8>19142\n<9fc9>19146\n<9fca>19150\n<9fcb>19155\n<e001>16396\n<e00b>16406\n<e00d>16408\n<e017>16418\n<e019>16420\n<e01f>2106\n<e021>16428\n<e024>16431\n<e026>2557\n<e02f>16442\n<e031>16444\n<e046>16465\n<e05b>781\n<e062>16493\n<e063>363\n<e065>16496\n<e072>16509\n<e073>2144\n<e088>16531\n<e08b>16534\n<e09b>16550\n<e0a5>16002\n<e0a8>16563\n<e0aa>16565\n<e0af>16570\n<e0b0>18760\n<e0bb>16582\n<e0bd>16584\n<e0c4>16591\n<e0c6>16593\n<e0c9>16596\n<e0cb>18761\n<e0dd>16616\n<e0de>18762\n<e0e6>16625\n<e0ea>16629\n<e0ed>16632\n<e0f3>3107\n<e0fa>18763\n<e0fc>16646\n<e107>16657\n<e108>18764\n<e12e>6116\n<e12f>16696\n<e134>16014\n<e135>16702\n<e143>16716\n<e144>18765\n<e146>16718\n<e149>8495\n<e14b>16722\n<e14c>18766\n<e158>16734\n<e166>16385\n<e167>18768\n<e16f>18769\n<e170>16756\n<e17a>16766\n<e186>16778\n<e188>16780\n<e18a>16782\n<e191>4447\n<e192>16789\n<e194>18770\n<e1a5>16807\n<e1af>16817\n<e1b2>16820\n<e1b5>16823\n<e1b7>16825\n<e1b9>16827\n<e1ba>3193\n<e1c0>16833\n<e1c6>18774\n<e1c7>16839\n<e1c9>1219\n<e1d6>16854\n<e1e0>18775\n<e1e1>16864\n<e1f1>16880\n<e1ff>16894\n<e206>16901\n<e211>16912\n<e21a>16921\n<e229>16936\n<e22b>16938\n<e22c>6333\n<e22d>3261\n<e22e>16941\n<e230>3237\n<e232>16945\n<e23c>16955\n<e249>16968\n<e250>16975\n<e258>18777\n<e266>3278\n<e267>18778\n<e26c>17002\n<e270>17006\n<e286>15728\n<e287>17029\n<e28a>17032\n<e2a0>17054\n<e2a2>17055\n<e2a3>3716\n<e2a5>17058\n<e2ac>18780\n<e2b6>17074\n<e2b9>17077\n<e2bb>17079\n<e2bc>288\n<e2bd>17080\n<e2c0>17083\n<e2c8>17091\n<e2df>17114\n<e2e8>17123\n<e2ea>17125\n<e2ee>17129\n<e2ef>7080\n<e307>17150\n<e310>17159\n<e312>14124\n<e314>14126\n<e316>18072\n<e317>14128\n<e33a>4181\n<e33c>18073\n<e340>11752\n<e341>14169\n<e346>14174\n<e347>18075\n<e34c>18076\n<e34f>289\n<e353>14185\n<e355>18077\n<e35a>4203\n<e361>14198\n<e363>4902\n<e366>14203\n<e367>18078\n<e373>14216\n<e376>14219\n<e378>18079\n<e37a>14222\n<e37c>1643\n<e37f>4910\n<e380>14228\n<e387>14235\n<e392>14246\n<e395>14248\n<e397>14250\n<e399>14252\n<e3a1>14259\n<e3b3>14277\n<e3c4>14294\n<e3c5>3381\n<e3c6>14296\n<e3c7>18083\n<e3ce>14302\n<e3d6>14309\n<e3d7>10178\n<e3db>14314\n<e3dc>8877\n<e3e2>14321\n<e3ef>14334\n<e3f1>14336\n<e3f9>14344\n<e3fb>14346\n<e3fc>18087\n<e3fe>14349\n<e411>18088\n<e412>14368\n<e413>18089\n<e415>14370\n<e416>18090\n<e417>4940\n<e418>16377\n<e41c>14377\n<e424>14385\n<e427>14387\n<e42e>14394\n<e42f>18092\n<e43d>14409\n<e43f>14411\n<e449>14420\n<e44a>2510\n<e44b>14422\n<e44f>14426\n<e45f>14442\n<e460>18094\n<e464>14447\n<e466>14449\n<e46b>14452\n<e46d>14454\n<e470>14457\n<e473>14460\n<e475>14462\n<e477>14464\n<e478>3015\n<e479>14466\n<e47a>18098\n<e485>14057\n<e48f>18099\n<e490>14486\n<e4c5>5009\n<e4da>5796\n<e4db>14560\n<e4e5>14570\n<e4f7>14588\n<e500>14597\n<e50e>14610\n<e513>14615\n<e515>14617\n<e51b>14622\n<e525>14632\n<e526>18103\n<e527>14633\n<e52d>14638\n<e544>14661\n<e545>12402\n<e54e>18105\n<e556>14679\n<e55a>14683\n<e55d>14686\n<e56f>14704\n<e571>14706\n<e574>14709\n<e578>14713\n<e57b>14716\n<e57f>14720\n<e581>14722\n<e587>14728\n<e589>14728\n<e58a>14731\n<e591>14738\n<e5a5>14758\n<e5a9>18106\n<e5b0>14769\n<e5b6>14775\n<e5b9>14778\n<e5c1>14786\n<e5d4>284\n<e5d5>283\n<e5d6>14803\n<e5da>14807\n<e5e0>14813\n<e5e4>14817\n<e5ea>14823\n<e5eb>16300\n<e5f2>14831\n<e5f4>10620\n<e601>14846\n<e603>14848\n<e608>18108\n<e615>18109\n<e622>14877\n<e639>14900\n<e63b>14902\n<e647>14914\n<e649>14916\n<e64a>18110\n<e656>14928\n<e661>14939\n<e664>14942\n<e669>14947\n<e670>14953\n<e67a>14963\n<e67e>14967\n<e681>14970\n<e682>18112\n<e689>14977\n<e68d>14981\n<e691>14985\n<e698>14992\n<e69b>14995\n<e69d>14997\n<e6a0>15000\n<e6a5>18113\n<e6a7>15006\n<e6a8>18114\n<e6ab>18115\n<e6bf>15029\n<e6c6>7430\n<e6d9>15054\n<e6dc>15057\n<e6f8>18117\n<e6f9>15086\n<e700>15093\n<e708>15101\n<e70b>15104\n<e712>15111\n<e719>15118\n<e71c>15121\n<e726>15131\n<e727>10657\n<e728>18118\n<e743>15160\n<e750>15173\n<e75e>15187\n<e760>15189\n<e763>15192\n<e766>15195\n<e76f>15203\n<e776>18120\n<e779>15212\n<e77b>18121\n<e785>15224\n<e78a>15229\n<e78c>15231\n<e791>15236\n<e793>15238\n<e795>15240\n<e798>15243\n<e7a3>15254\n<e7c0>18122\n<e7d2>15300\n<e7d3>6171\n<e7d9>15307\n<e7db>15309\n<e7ea>15324\n<e7ec>15326\n<e7f0>15330\n<e7fd>15919\n<e7fe>15344\n<e809>15355\n<e80a>18123\n<e80b>15357\n<e80d>15359\n<e810>15362\n<e812>15364\n<e819>15371\n<e822>15380\n<e823>18124\n<e82e>15392\n<e836>15400\n<e839>15403\n<e84c>15422\n<e868>15450\n<e86b>18125\n<e884>15478\n<e890>15489\n<e893>11044\n<e8a2>15507\n<e8a8>15513\n<e8ab>15516\n<e8b7>15528\n<e8c4>15541\n<e8c6>15543\n<e8cc>15549\n<e8cf>15552\n<e8d2>15555\n<e8d4>15557\n<e8d7>15560\n<e8de>15567\n<e8e7>15576\n<e8ff>15600\n<e91d>15630\n<e92d>15646\n<e937>18126\n<e939>15658\n<e93b>15660\n<e951>15682\n<e956>15687\n<e959>15690\n<e95b>15692\n<e95f>15696\n<e962>18128\n<e963>15700\n<e969>18130\n<e96a>15705\n<e96d>15706\n<e976>18140\n<e979>18143\n<e97c>18146\n<e980>15708\n<e985>17354\n<e986>18154\n<e988>18155\n<e989>17356\n<e98b>18156\n<e98c>17402\n<e98d>18157\n<e98f>15712\n<e990>18158\n<e992>18160\n<e993>15713\n<e994>18161\n<e995>15714\n<e996>18162\n<e9a3>17357\n<e9ab>18178\n<e9ac>17361\n<e9b4>15717\n<e9b8>15718\n<e9be>15719\n<e9c1>15720\n<e9c2>18195\n<e9c3>15721\n<e9c4>18196\n<e9cc>18202\n<e9cd>15722\n<e9ce>18203\n<e9cf>17367\n<e9d2>17404\n<e9d3>15723\n<e9d4>18206\n<e9d5>15724\n<e9d6>18207\n<e9d7>17368\n<e9df>15725\n<e9e4>17369\n<e9ec>17370\n<e9f4>17372\n<e9fa>15726\n<e9fe>15727\n<ea05>15728\n<ea08>15729\n<ea10>15730\n<ea11>18256\n<ea12>17349\n<ea13>18257\n<ea14>17350\n<ea1c>15731\n<ea20>17374\n<ea24>15732\n<ea28>15733\n<ea38>17376\n<ea3b>17378\n<ea41>17379\n<ea42>18296\n<ea44>17381\n<ea4d>17375\n<ea50>15734\n<ea51>18308\n<ea52>17323\n<ea53>18309\n<ea54>17383\n<ea55>18310\n<ea56>17385\n<ea5d>17405\n<ea62>15735\n<ea77>15736\n<ea78>18341\n<ea79>15737\n<ea86>15738\n<ea8c>17327\n<ea8d>18359\n<ea8e>15739\n<ea93>17389\n<ea94>18364\n<ea95>15740\n<ea96>17390\n<ea97>18365\n<ea98>17407\n<eaa0>15741\n<eaa1>18373\n<eaa2>17393\n<eaaa>18381\n<eaab>15742\n<eaae>17395\n<eaaf>18384\n<eab0>17394\n<eab4>17400\n<eab5>17396\n<eabd>15743\n<eabe>18395\n<eac2>15744\n<eac3>18399\n<eac4>15745\n<eac6>15746\n<eac7>18401\n<eac8>17335\n<ead2>15747\n<ead5>18413\n<eadb>15748\n<eadd>15749\n<eaed>15753\n<eaef>15754\n<eaf3>15755\n<eaf7>18438\n<eafc>18442\n<eafd>15756\n<eb01>15757\n<eb06>15758\n<eb07>18450\n<eb10>15759\n<eb13>18461\n<eb14>15760\n<eb1e>15762\n<eb22>15763\n<eb24>15764\n<eb26>15765\n<eb40>12112\n<eb42>5925\n<eb45>13037\n<eb47>18496\n<eb5c>15789\n<eb5e>15791\n<eb60>15793\n<eb64>18507\n<eb66>15795\n<eb6a>15798\n<eb6c>15800\n<eb6e>10969\n<eb72>15803\n<eb75>18514\n<eb79>15806\n<eb7b>15807\n<eb7c>18517\n<eb7d>15808\n<eb82>15811\n<eb86>7188\n<eb87>15813\n<eb8b>15815\n<eb94>16890\n<eb96>15821\n<eb9e>4841\n<eba1>15826\n<eba4>15828\n<eba7>15829\n<eba9>11438\n<ebac>15833\n<ebb1>15836\n<ebb5>15838\n<ebba>6756\n<ebbb>18543\n<ebbe>15845\n<ebc3>18545\n<ebc4>15850\n<ebc9>5124\n<ebcb>15853\n<ebcf>8996\n<ebd1>15857\n<ebd2>13418\n<ebd4>15858\n<ebd6>15859\n<ebd9>15862\n<ebdc>15863\n<ebde>8849\n<ebe0>15866\n<ebea>15872\n<ebed>15873\n<ebf0>15875\n<ebf3>15877\n<ebf4>18565\n<ebfc>15884\n<ebff>15887\n<ec00>18567\n<ec01>6023\n<ec02>2399\n<ec07>15894\n<ec0a>18570\n<ec0b>15895\n<ec0d>15897\n<ec15>7833\n<ec16>15905\n<ec21>15911\n<ec23>15913\n<ec25>15915\n<ec30>15924\n<ec36>15929\n<ec4a>15939\n<ec4d>15940\n<ec4e>18591\n<ec53>15944\n<ec55>15945\n<ec59>15946\n<ec5b>9665\n<ec5e>3340\n<ec61>18603\n<ec64>18606\n<ec65>17353\n<ec66>15948\n<ec74>18619\n<ec7a>18625\n<ec7c>17397\n<ec7d>15950\n<ec7f>18628\n<ec81>18630\n<ec82>15951\n<ec83>18631\n<ec85>18633\n<ec8b>18635\n<ec8c>15956\n<ec8f>15958\n<ec90>18637\n<ec97>15962\n<ec9c>18645\n<ec9f>15965\n<eca5>15968\n<eca6>1510\n<ecac>15972\n<ecae>18654\n<ecb5>15978\n<ecb7>15980\n<ecb8>18656\n<ecdd>16014\n<ece4>18661\n<ecf1>16033\n<ed00>18662\n<ed08>18665\n<ed09>16054\n<ed0b>16055\n<ed12>16056\n<ed14>16057\n<ed19>16059\n<ed1b>16060\n<ed23>16065\n<ed28>1832\n<ed2b>16070\n<ed33>16075\n<ed34>18687\n<ed37>18688\n<ed38>16078\n<ed3c>18691\n<ed40>18693\n<ed46>16084\n<ed4c>16089\n<ed50>16091\n<ed6e>9398\n<ed76>18708\n<ed79>16123\n<ed7b>16124\n<ed7c>6150\n<ed87>16134\n<ed9e>13585\n<eda4>14661\n<eda5>18715\n<edae>18717\n<edd0>16203\n<eddc>16212\n<ede7>3970\n<ede8>18722\n<edf0>18723\n<edf4>14910\n<ee00>18724\n<ee21>16277\n<ee3e>14353\n<ee52>1522\n<ee5c>16331\n<ee7d>16363\n<ee89>18734\n<ee8e>15086\n<ee98>9341\n<ee9d>15049\n<eea0>18736\n<eeab>17336\n<f326>18798\n<f345>18829\n<f3a3>17718\n<f3ad>17347\n<f3b1>17306\n<f3e4>17314\n<f3e9>17388\n<f3ea>17777\n<f3eb>17387\n<f3ec>17778\n<f3fb>17790\n<f3fd>17792\n<f40c>17805\n<f40d>17340\n<f417>17308\n<f418>17815\n<f419>17310\n<f41a>17816\n<f41b>17311\n<f41f>17313\n<f420>17820\n<f421>17315\n<f438>17321\n<f43e>17161\n<f443>17166\n<f445>17168\n<f447>17170\n<f44a>17846\n<f44c>17175\n<f453>17182\n<f464>17199\n<f473>17214\n<f47a>17221\n<f47f>17226\n<f482>17229\n<f487>17234\n<f492>17245\n<f493>17856\n<f494>17247\n<f496>17249\n<f4ae>17273\n<f4b1>17858\n<f4c2>17371\n<f4c6>17864\n<f4cb>17869\n<f4d6>17879\n<f4d8>17881\n<f4e1>17295\n<f4ea>17301\n<f4f4>17304\n<f4f5>17348\n<f4fb>17319\n<f4fd>17903\n<f502>17324\n<f504>17909\n<f506>17911\n<f512>17923\n<f517>17928\n<f51e>17935\n<f53c>17635\n<f554>17659\n<f57d>18855\n<f585>18863\n<f5a0>18889\n<f5ab>18900\n<f5b0>18905\n<f5b4>18909\n<f5b6>18911\n<f5b9>18914\n<f5bd>18917\n<f5cc>18932\n<f5ce>18934\n<f5d0>18936\n<f5e0>18949\n<f5e4>18952\n<f5ef>18963\n<f636>17338\n<f63c>17339\n<f63d>17312\n<f63e>17341\n<f642>17342\n<f64a>17343\n<f64e>17344\n<f64f>17981\n<f650>17345\n<f657>17346\n<f65a>17337\n<f65b>17325\n<f668>17351\n<f675>17352\n<f6ac>17401\n<f6e4>558\n<f6e6>560\n<f7e7>14001\n<f7e9>14003\n<f7ec>14006\n<f82a>18846\n<f833>18847\n<f83b>18848\n<f907>17686\n<fa12>16828\n<fa26>14465\n<fa48>16997\n<fa5b>14224\n<fe13>14104\n<fe14>14103\n<fe15>14106\n<fe16>14105\n<fe19>13646\n<fe51>113\n<fe68>258\n<ff5e>228\n<ffe3>196\n<ffe5>260\n<ffed>14096\nendcidchar\nbegincidrange\n<23da><23db>18844\n<2f01><2f03>536\n<2f08><2f0b>603\n<2f0c><2f0e>541\n<2f17><2f18>612\n<2f1f><2f20>634\n<2f23><2f26>636\n<2f28><2f2b>642\n<2f2f><2f30>648\n<2f31><2f32>652\n<2f34><2f35>552\n<2f36><2f38>654\n<2f39><2f3a>554\n<2f3c><2f3f>720\n<2f42><2f45>726\n<2f47><2f4d>730\n<2f4f><2f52>737\n<2f54><2f58>741\n<2f5a><2f5d>746\n<2f5e><2f64>854\n<2f67><2f68>558\n<2f69><2f70>867\n<2f72><2f74>875\n<2f75><2f78>1014\n<2f7a><2f7c>1018\n<2f7d><2f81>1022\n<2f82><2f8a>1029\n<2f8d><2f90>1039\n<2f92><2f97>1288\n<2f99><2fa0>1294\n<2fa3><2fa5>1312\n<2fa6><2fa9>1686\n<2fab><2fac>1695\n<2faf><2fb9>2086\n<2fba><2fbc>2549\n<2fc0><2fc1>2553\n<2fc2><2fc7>3041\n<2fc8><2fca>3515\n<2fcd><2fcf>3963\n<2fd0><2fd1>4352\n<2fd3><2fd4>5042\n<3038><303a>362\n<31c0><31c4>17609\n<31c6><31c7>17618\n<31c9><31cc>17624\n<31cd><31ce>17629\n<9fad><9fae>18960\n<e004><e008>16399\n<e00f><e011>16410\n<e027><e02c>16434\n<e039><e03a>16452\n<e03d><e044>16456\n<e047><e048>18758\n<e049><e04b>16468\n<e04d><e059>16472\n<e05d><e05e>16488\n<e067><e06b>16498\n<e06d><e070>16504\n<e076><e077>16513\n<e079><e07c>16516\n<e07e><e086>16521\n<e08d><e092>16536\n<e095><e098>16544\n<e09f><e0a4>16554\n<e0ac><e0ad>16567\n<e0b1><e0b9>16572\n<e0bf><e0c2>16586\n<e0cc><e0cf>16599\n<e0d1><e0d3>16604\n<e0d6><e0db>16609\n<e0e0><e0e1>16619\n<e0ef><e0f1>16634\n<e0f4><e0f7>16639\n<e0fe><e102>16648\n<e104><e105>16654\n<e10c><e10f>16661\n<e111><e113>16666\n<e116><e11b>16671\n<e11e><e120>16679\n<e122><e125>16683\n<e129><e12d>16690\n<e132><e133>16699\n<e137><e138>16704\n<e13a><e140>16707\n<e14e><e14f>16724\n<e151><e153>16727\n<e15b><e15c>16737\n<e15e><e161>16739\n<e163><e165>16744\n<e16b><e16e>16752\n<e173><e174>16759\n<e176><e177>16762\n<e17d><e17e>16769\n<e181><e184>16773\n<e18c><e18e>16784\n<e197><e19e>16793\n<e1a1><e1a3>16803\n<e1a7><e1a9>16809\n<e1ab><e1ad>16813\n<e1c2><e1c3>16835\n<e1ca><e1cb>16842\n<e1ce><e1d3>16846\n<e1d8><e1d9>16856\n<e1db><e1dc>16859\n<e1de><e1df>16862\n<e1e3><e1e5>16866\n<e1e7><e1ea>16870\n<e1ec><e1ee>16875\n<e1f3><e1f6>16882\n<e1f8><e1f9>16887\n<e1fb><e1fd>16890\n<e203><e204>16898\n<e208><e209>16903\n<e20d><e20f>16908\n<e217><e218>16918\n<e21d><e21e>16924\n<e222><e225>16929\n<e234><e236>16947\n<e238><e23a>16951\n<e23f><e244>16958\n<e246><e247>16965\n<e255><e257>16980\n<e259><e260>16984\n<e262><e265>16993\n<e269><e26a>16999\n<e272><e279>17008\n<e27b><e27c>17017\n<e27e><e281>17020\n<e283><e285>17025\n<e28c><e28f>17034\n<e292><e293>17040\n<e297><e298>17045\n<e29c><e29e>17050\n<e2a7><e2ab>17060\n<e2ad><e2b1>17065\n<e2c2><e2c6>17085\n<e2ca><e2d3>17093\n<e2d5><e2d7>17104\n<e2da><e2dd>17109\n<e2e3><e2e6>17118\n<e2f2><e2f7>17131\n<e2f9><e2fb>17138\n<e2fd><e2fe>17142\n<e302><e305>17145\n<e309><e30b>17152\n<e30d><e30e>17156\n<e319><e31a>14130\n<e31d><e31e>14134\n<e320><e324>14137\n<e326><e32b>14143\n<e32d><e32f>14150\n<e332><e334>14155\n<e337><e339>14160\n<e33e><e33f>14166\n<e343><e344>14171\n<e349><e34b>14176\n<e34d><e34e>14180\n<e350><e351>14182\n<e356><e359>14187\n<e35d><e35f>14194\n<e368><e36e>14205\n<e370><e371>14213\n<e37d><e37e>14225\n<e383><e385>14231\n<e38b><e38c>14239\n<e38e><e390>14242\n<e39c><e39d>14255\n<e3a3><e3a4>14261\n<e3aa><e3ab>14268\n<e3ad><e3b0>14271\n<e3b6><e3b8>14280\n<e3be><e3c2>14288\n<e3c9><e3cb>14298\n<e3d0><e3d4>14304\n<e3dd><e3e0>14316\n<e3e4><e3e6>14323\n<e3e8><e3ec>14327\n<e3f5><e3f7>14340\n<e400><e408>14351\n<e40c><e410>14363\n<e419><e41a>14374\n<e41f><e422>14380\n<e429><e42b>14389\n<e430><e431>14396\n<e433><e435>14399\n<e437><e439>14403\n<e442><e443>14414\n<e445><e447>14417\n<e452><e458>14429\n<e45b><e45c>14438\n<e47b><e47d>14467\n<e480><e483>14472\n<e48b><e48c>14482\n<e493><e494>14489\n<e498><e4a0>14494\n<e4a5><e4aa>14506\n<e4ac><e4ae>14513\n<e4b0><e4b2>14517\n<e4bb><e4c0>14528\n<e4c2><e4c4>14535\n<e4c7><e4c8>14540\n<e4ca><e4cc>14543\n<e4cf><e4d5>14548\n<e4d7><e4d8>14556\n<e4de><e4e3>14563\n<e4e9><e4ed>14574\n<e4f0><e4f5>14581\n<e4fa><e4fe>14591\n<e503><e504>14600\n<e506><e509>14603\n<e50b><e50c>14608\n<e510><e511>14612\n<e517><e519>14618\n<e522><e523>14629\n<e530><e536>14641\n<e538><e53d>14649\n<e53f><e542>14656\n<e546><e54a>14663\n<e54c><e54d>14669\n<e54f><e553>14672\n<e560><e561>14689\n<e563><e565>14692\n<e568><e56c>14697\n<e595><e599>14742\n<e59b><e59c>14748\n<e5a2><e5a3>14755\n<e5ab><e5ae>14764\n<e5b3><e5b4>14772\n<e5bc><e5bd>14781\n<e5c3><e5c7>14788\n<e5ca><e5d1>14795\n<e5d2><e5d3>281\n<e5dd><e5de>14810\n<e5e7><e5e8>14820\n<e5ec><e5ed>14825\n<e5f5><e5fa>14834\n<e5fd><e5ff>14842\n<e605><e607>14850\n<e609><e60e>14853\n<e613><e614>14863\n<e616><e618>14865\n<e61d><e620>14872\n<e625><e626>14880\n<e628><e62a>14883\n<e62c><e631>14887\n<e635><e636>14896\n<e63d><e63e>14904\n<e643><e644>14910\n<e64c><e64d>14918\n<e650><e651>14922\n<e65a><e65c>14932\n<e66b><e66d>14948\n<e672><e675>14955\n<e693><e695>14987\n<e6a3><e6a4>15003\n<e6a9><e6aa>15008\n<e6ae><e6b1>15012\n<e6b3><e6b8>15017\n<e6bb><e6bc>15025\n<e6c2><e6c4>15032\n<e6c8><e6c9>15037\n<e6cb><e6d0>15040\n<e6d3><e6d6>15048\n<e6e2><e6e3>15063\n<e6e7><e6ed>15068\n<e6ef><e6f1>15076\n<e6f4><e6f6>15081\n<e6fd><e6fe>15090\n<e703><e705>15096\n<e70d><e70f>15106\n<e714><e716>15113\n<e71e><e723>15123\n<e729><e72a>15134\n<e72c><e72e>15137\n<e730><e732>15141\n<e738><e73b>15149\n<e73e><e73f>15155\n<e745><e746>15162\n<e748><e74c>15165\n<e753><e75a>15176\n<e76a><e76b>15198\n<e771><e774>15205\n<e77e><e783>15217\n<e787><e788>15226\n<e78e><e78f>15233\n<e79a><e7a1>15245\n<e7aa><e7b0>15261\n<e7b2><e7b3>15269\n<e7b5><e7b7>15272\n<e7b9><e7bb>15276\n<e7bd><e7bf>15280\n<e7c1><e7c3>15283\n<e7c5><e7c9>15287\n<e7cb><e7cd>15293\n<e7cf><e7d0>15297\n<e7d4><e7d7>15302\n<e7de><e7e3>15312\n<e7e5><e7e6>15319\n<e7f4><e7f7>15334\n<e7f9><e7fa>15339\n<e803><e807>15349\n<e814><e815>15366\n<e81b><e820>15373\n<e824><e826>15382\n<e829><e82c>15387\n<e830><e834>15394\n<e83c><e840>15406\n<e843><e84a>15413\n<e84f><e850>15425\n<e852><e854>15428\n<e859><e85a>15435\n<e85e><e85f>15440\n<e863><e864>15445\n<e86d><e870>15454\n<e872><e877>15459\n<e879><e87c>15466\n<e880><e883>15473\n<e885><e886>15478\n<e888><e88e>15481\n<e896><e899>15495\n<e89b><e89c>15500\n<e89e><e89f>15503\n<e8b1><e8b4>15522\n<e8b9><e8bc>15530\n<e8c8><e8ca>15545\n<e8db><e8dc>15564\n<e8e2><e8e4>15571\n<e8eb><e8ec>15580\n<e8ee><e8f0>15583\n<e8f3><e8f4>15588\n<e8f6><e8fa>15591\n<e8fc><e8fd>15597\n<e901><e902>15602\n<e904><e906>15605\n<e909><e90b>15610\n<e90d><e916>15614\n<e919><e91b>15626\n<e923><e924>15636\n<e930><e932>15649\n<e93f><e940>15664\n<e942><e943>15667\n<e946><e947>15671\n<e949><e94c>15674\n<e94e><e94f>15679\n<e965><e966>15702\n<e96b><e96c>18131\n<e970><e972>18135\n<e97e><e97f>18148\n<e983><e984>18152\n<e997><e998>15715\n<e999><e9a2>18163\n<e9a4><e9a8>18173\n<e9a9><e9aa>17358\n<e9ad><e9af>18179\n<e9b1><e9b3>18182\n<e9b5><e9b7>18185\n<e9b9><e9bd>18188\n<e9bf><e9c0>18193\n<e9c5><e9c6>17365\n<e9c7><e9ca>18197\n<e9d0><e9d1>18204\n<e9d8><e9de>18208\n<e9e0><e9e3>18215\n<e9e5><e9eb>18219\n<e9ed><e9ee>18226\n<e9f0><e9f3>18229\n<e9f5><e9f9>18233\n<e9fb><e9fd>18238\n<e9ff><ea04>18241\n<ea06><ea07>18247\n<ea09><ea0f>18249\n<ea15><ea1b>18258\n<ea1d><ea1f>18265\n<ea21><ea23>18268\n<ea25><ea27>18271\n<ea29><ea37>18274\n<ea39><ea3a>18289\n<ea3c><ea40>18291\n<ea45><ea4c>18298\n<ea4e><ea4f>18306\n<ea57><ea5c>18311\n<ea5e><ea61>18317\n<ea63><ea76>18321\n<ea7a><ea85>18342\n<ea87><ea8b>18354\n<ea8f><ea92>18360\n<ea99><ea9f>18366\n<eaa3><eaa8>18374\n<eaac><eaad>18382\n<eab1><eab3>18385\n<eab6><eabc>18388\n<eacd><eace>18406\n<eae4><eae6>15750\n<eb16><eb17>18463\n<eb28><eb29>15766\n<eb3a><eb3c>15768\n<eb48><eb49>15777\n<eb51><eb52>15783\n<eb91><eb92>15817\n<eb9c><eb9d>18532\n<ebb7><ebb8>15840\n<ebc0><ebc1>15847\n<ebe2><ebe3>15867\n<ebe5><ebe6>15869\n<ebf7><ebf8>15879\n<ec03><ec04>15890\n<ec11><ec12>15901\n<ec1e><ec1f>15909\n<ec27><ec29>15917\n<ec33><ec34>15926\n<ec38><ec3a>15931\n<ec3d><ec3e>15936\n<ec50><ec51>15942\n<ec77><ec78>18622\n<ec87><ec8a>15952\n<eca1><eca2>15966\n<eca9><ecaa>15970\n<ecb0><ecb3>15974\n<ecbc><ecce>15981\n<ecd0><ecd3>16001\n<ecd5><ecda>16006\n<ece2><ece3>16018\n<ece6><ecef>16022\n<ecf3><ecf4>16035\n<ecf6><ecfb>16038\n<ecfd><ecff>16045\n<ed01><ed03>16049\n<ed05><ed06>16052\n<ed1f><ed21>16062\n<ed2e><ed30>16072\n<ed31><ed32>18685\n<ed35><ed36>16076\n<ed39><ed3a>18689\n<ed3e><ed3f>16080\n<ed43><ed44>16082\n<ed48><ed49>16086\n<ed55><ed56>16093\n<ed59><ed5e>16095\n<ed60><ed61>16102\n<ed63><ed6a>16105\n<ed6c><ed6d>16114\n<ed6f><ed70>16117\n<ed73><ed74>16120\n<ed7d><ed80>16126\n<ed82><ed83>16130\n<ed8c><ed8d>16137\n<ed8f><ed90>16140\n<ed92><ed9d>16143\n<ed9f><eda3>16156\n<eda7><edad>16163\n<edaf><edc5>16170\n<edc7><edce>16194\n<edd2><edd6>16204\n<edd8><edd9>16209\n<edde><ede0>16213\n<ede2><ede6>16217\n<ede9><edec>16224\n<edee><edef>16229\n<edf1><edf3>16232\n<edf5><edff>16236\n<ee01><ee07>16247\n<ee09><ee10>16255\n<ee12><ee14>16264\n<ee16><ee1a>16267\n<ee1c><ee1f>16272\n<ee23><ee29>16278\n<ee2b><ee2f>16286\n<ee32><ee33>16292\n<ee35><ee3d>16295\n<ee3f><ee47>16305\n<ee49><ee51>16314\n<ee53><ee55>16324\n<ee57><ee5a>16327\n<ee5e><ee5f>16333\n<ee61><ee63>16335\n<ee65><ee69>16339\n<ee6b><ee75>16345\n<ee77><ee7b>16357\n<ee7f><ee88>16364\n<ee8a><ee8d>16374\n<ee8f><ee90>16379\n<ee92><ee97>16382\n<ee99><ee9b>16389\n<ee9e><ee9f>16393\n<eeb2><eeb3>18752\n<eeb5><eeb6>18755\n<f319><f324>18785\n<f328><f343>18800\n<f347><f349>18831\n<f3a6><f3a9>17719\n<f3ae><f3b0>17724\n<f3b2><f3e3>17727\n<f3ee><f3ef>17779\n<f3f3><f3f8>17782\n<f3ff><f401>17793\n<f403><f407>17796\n<f40e><f416>17806\n<f41c><f41e>17817\n<f422><f427>17821\n<f428><f429>17317\n<f42a><f437>17827\n<f439><f43c>17841\n<f44e><f44f>17177\n<f458><f459>17187\n<f467><f468>17202\n<f46a><f46b>17205\n<f470><f471>17211\n<f475><f476>17216\n<f489><f48a>17236\n<f499><f49a>17252\n<f49c><f49d>17255\n<f49f><f4a2>17258\n<f4ab><f4ac>17270\n<f4b5><f4b6>17280\n<f4eb><f4ed>17890\n<f4f0><f4f1>17894\n<f4f6><f4f7>17897\n<f4f9><f4fa>17900\n<f527><f529>17944\n<f52b><f532>17948\n<f535><f537>17958\n<f538><f539>17631\n<f53e><f54d>17637\n<f54f><f552>17654\n<f557><f558>17661\n<f55b><f55d>17665\n<f55f><f564>17669\n<f566><f56a>17676\n<f56c><f571>17682\n<f573><f575>17689\n<f579><f57b>18851\n<f580><f583>18858\n<f58b><f58f>18869\n<f593><f594>18877\n<f596><f597>18880\n<f59b><f59c>18884\n<f5a3><f5a4>18892\n<f5bf><f5c0>18919\n<f5c4><f5c5>18924\n<f5d5><f5d9>18941\n<f5e6><f5e8>18954\n<f5ea><f5ed>18958\n<f634><f635>17961\n<f637><f63b>17963\n<f63f><f641>17968\n<f643><f649>17971\n<f64b><f64d>17978\n<f651><f656>17982\n<f658><f659>17988\n<f65c><f667>17990\n<f669><f674>18002\n<f676><f693>18014\n<f695><f69d>18045\n<f69f><f6ab>18055\n<f6ae><f6af>18069\n<f6b1><f6ce>506\n<f6cf><f6de>537\n<f6e0><f6e2>554\n<f6e8><f6ed>13747\n<f6f0><f7e4>13754\n<f817><f81d>14049\n<f81e><f820>17606\n<f821><f829>17692\n<f82b><f832>17701\n<f834><f83a>17709\n<f83f><f848>18834\n<fe10><fe12>14099\n<ffe0><ffe1>262\nendcidrange\nbegincidchar\n<d840dc21>15861\n<d840dc3e>14929\n<d840dc46>14930\n<d840dc4e>15193\n<d840dc68>14218\n<d840dc86>17636\n<d840dc87>17688\n<d840dc8a>14002\n<d840dc94>18396\n<d840dcca>17623\n<d840dccb>17620\n<d840dccc>14000\n<d840dccd>17617\n<d840dcd1>17616\n<d840dcee>18749\n<d840dd0c>17614\n<d840dd0e>17628\n<d840dd18>16777\n<d840dda4>19047\n<d840dda9>17235\n<d840ddab>14776\n<d840ddc1>16714\n<d840ddd4>15153\n<d840ddf2>16228\n<d840de04>16656\n<d840de0c>14787\n<d840de14>18139\n<d840de39>19051\n<d840de5b>15161\n<d840de74>14521\n<d840de75>14785\n<d840de99>15146\n<d840de9e>16735\n<d840dea0>16415\n<d840deb7>18397\n<d840debf>15458\n<d840dec0>14783\n<d840dee5>16447\n<d840df0a>14779\n<d840df25>18068\n<d840df41>17169\n<d840df45>14847\n<d840df46>15776\n<d840df47>16430\n<d840df7e>16427\n<d840df7f>18107\n<d840df80>16429\n<d840dfa0>18398\n<d840dfa7>15538\n<d840dfb5>18776\n<d840dfc9>16874\n<d840dfcb>14777\n<d840dff5>15613\n<d840dffc>18719\n<d841dc13>14879\n<d841dc14>14780\n<d841dc1f>16432\n<d841dc65>14770\n<d841dc87>16441\n<d841dc8e>16101\n<d841dc91>14816\n<d841dc92>14815\n<d841dca3>14814\n<d841dcd7>18400\n<d841dcfc>17241\n<d841dcfe>15548\n<d841dd47>16395\n<d841dd8e>16449\n<d841dda5>16660\n<d841ddb3>16454\n<d841ddc3>18779\n<d841ddca>15788\n<d841ddd0>17803\n<d841ddd5>18402\n<d841dddf>16397\n<d841dde0>14812\n<d841ddeb>15056\n<d841de11>15790\n<d841de15>18403\n<d841de19>18142\n<d841de1a>15561\n<d841de30>14571\n<d841de56>16761\n<d841de76>18404\n<d841df0e>14819\n<d841df31>17232\n<d841df79>15805\n<d842dc2c>15200\n<d842dc73>14822\n<d842dcd5>18141\n<d842dd16>15191\n<d842dd23>16889\n<d842dd54>16491\n<d842dd79>18695\n<d842dde7>17781\n<d842de11>15855\n<d842de50>14441\n<d842de6f>19022\n<d842de8a>19100\n<d842deb4>15590\n<d842dec2>18408\n<d842decd>18409\n<d842df0d>18081\n<d842df8f>16530\n<d842df9f>19057\n<d842dfa8>14760\n<d842dfa9>17875\n<d842dfbf>18410\n<d842dfc6>14849\n<d842dfcb>18412\n<d842dfe2>16495\n<d842dfeb>15562\n<d842dffb>18414\n<d842dfff>16445\n<d843dc0b>17848\n<d843dc0d>15154\n<d843dc20>14828\n<d843dc34>17291\n<d843dc3a>17038\n<d843dc3b>18415\n<d843dc41>16012\n<d843dc42>17163\n<d843dc43>17228\n<d843dc53>18416\n<d843dc65>18417\n<d843dc77>16535\n<d843dc78>15804\n<d843dc7c>18418\n<d843dc8d>18419\n<d843dc96>16013\n<d843dc9c>18629\n<d843dcb5>18420\n<d843dcb8>15563\n<d843dccf>18228\n<d843dcd3>16698\n<d843dcd4>16216\n<d843dcd5>17185\n<d843dcd6>17910\n<d843dcdd>18421\n<d843dced>18422\n<d843dcff>15559\n<d843dd15>17164\n<d843dd28>16135\n<d843dd31>14481\n<d843dd32>16920\n<d843dd46>17196\n<d843dd47>17871\n<d843dd48>17876\n<d843dd49>18658\n<d843dd4c>15144\n<d843dd4d>16551\n<d843dd4e>16621\n<d843dd6f>18423\n<d843dd71>16136\n<d843dd74>16543\n<d843dd7c>17183\n<d843dd96>17855\n<d843dd9c>17254\n<d843dda7>16037\n<d843ddb2>18424\n<d843ddc8>18425\n<d843de04>18426\n<d843de09>17264\n<d843de0a>18682\n<d843de0d>14761\n<d843de0e>18427\n<d843de0f>17905\n<d843de10>17914\n<d843de11>17929\n<d843de16>14275\n<d843de1d>14832\n<d843de4c>17873\n<d843de6d>18647\n<d843de73>18431\n<d843de75>16824\n<d843de76>16015\n<d843de77>17906\n<d843de78>17915\n<d843de79>17920\n<d843de7a>17290\n<d843de7b>17933\n<d843de8c>17866\n<d843de96>17189\n<d843de98>17887\n<d843de9d>16000\n<d843dea2>16017\n<d843deaa>17868\n<d843deab>17874\n<d843deac>18676\n<d843deb6>16104\n<d843ded7>18428\n<d843ded8>18071\n<d843dedd>16549\n<d843def8>15878\n<d843def9>16058\n<d843defa>17904\n<d843defb>17907\n<d843df1d>15506\n<d843df26>15358\n<d843df2d>18430\n<d843df2e>17888\n<d843df30>17870\n<d843df31>17859\n<d843df3b>16338\n<d843df4c>17243\n<d843df64>17191\n<d843df8d>17867\n<d843df90>18429\n<d843dfad>17882\n<d843dfb4>17184\n<d843dfb5>17932\n<d843dfb6>17936\n<d843dfbc>18432\n<d843dfdf>14759\n<d843dfea>18657\n<d843dfeb>18679\n<d843dfec>18681\n<d843dfed>18683\n<d844dc14>14424\n<d844dc4f>18434\n<d844dc5c>18433\n<d844dc6f>17853\n<d844dc75>16021\n<d844dc76>18435\n<d844dc77>17852\n<d844dc78>17916\n<d844dc7b>17328\n<d844dc88>18436\n<d844dc96>18437\n<d844dc9d>17251\n<d844dcb4>16566\n<d844dcbf>18439\n<d844dcc0>17877\n<d844dcc1>18663\n<d844dcc7>17296\n<d844dcc8>17268\n<d844dcc9>17913\n<d844dccf>17861\n<d844dcd3>17330\n<d844dce4>14830\n<d844dcf4>17847\n<d844dd2f>18440\n<d844dd3b>18441\n<d844dd3d>17878\n<d844dd45>17717\n<d844dd48>17917\n<d844dd4f>17872\n<d844dd80>17937\n<d844dd87>18684\n<d844ddd9>18673\n<d844de3c>16603\n<d844de4f>16583\n<d844de7c>14504\n<d844dea8>14725\n<d844dea9>18707\n<d844deb0>15634\n<d844dee3>18443\n<d844defe>17332\n<d844df02>15399\n<d844df03>14882\n<d844df04>15698\n<d844df05>16417\n<d844df36>18445\n<d844df3a>16717\n<d844df75>18444\n<d844df76>18781\n<d844df8e>16787\n<d844df98>15638\n<d844df9c>15596\n<d844dfc5>15900\n<d844dfc6>14726\n<d844dfed>15922\n<d844dffe>14724\n<d845dc13>15509\n<d845dc16>16592\n<d845dc24>15539\n<d845dc3f>18943\n<d845dc52>15629\n<d845dc54>16594\n<d845dc55>17919\n<d845dc8a>14249\n<d845dc97>16956\n<d845dcb6>14727\n<d845dce8>15402\n<d845dcfd>14260\n<d845dd77>18446\n<d845dd82>14337\n<d845dd96>16511\n<d845de0a>15896\n<d845de13>16512\n<d845de19>18447\n<d845de3e>16615\n<d845de61>14217\n<d845de92>16618\n<d845deb8>16647\n<d845deba>18405\n<d845dec0>14721\n<d845dec1>17128\n<d845dec2>15568\n<d845ded3>14580\n<d845ded5>16631\n<d845dedf>14402\n<d845dee6>15140\n<d845dee7>17043\n<d845dee8>16503\n<d845defa>14860\n<d845defb>14714\n<d845defc>14974\n<d845defe>14903\n<d845df0d>16548\n<d845df10>14862\n<d845df26>16497\n<d845df3a>15659\n<d845df3b>14915\n<d845df3c>15673\n<d845df57>15470\n<d845df6c>18711\n<d845df6d>16193\n<d845df6e>15148\n<d845df6f>14861\n<d845df70>16779\n<d845df71>16703\n<d845df73>14266\n<d845df74>14717\n<d845dfab>14913\n<d845dfb0>15175\n<d845dfb1>15883\n<d845dfb2>16627\n<d845dfb3>15666\n<d845dfb4>14276\n<d845dfb5>15493\n<d845dfc3>18448\n<d845dfc7>18449\n<d845dfd9>15536\n<d845dfda>15296\n<d845dfdb>15663\n<d845dfdc>16624\n<d845dfdf>18134\n<d845dfef>14705\n<d845dff5>18638\n<d845dff6>18650\n<d845dff8>14712\n<d845dff9>14197\n<d845dffa>15566\n<d845dffb>16626\n<d845dffc>16788\n<d846dc20>15886\n<d846dc28>16630\n<d846dc29>16812\n<d846dc2a>14979\n<d846dc2d>18451\n<d846dc39>14715\n<d846dc3a>17941\n<d846dc3b>18728\n<d846dc40>15235\n<d846dc45>15275\n<d846dc52>15570\n<d846dc5e>14251\n<d846dc61>14870\n<d846dc62>15587\n<d846dc63>14616\n<d846dc64>15100\n<d846dc77>18767\n<d846dc7b>18651\n<d846dc83>15578\n<d846dc84>14808\n<d846dc85>14710\n<d846dc9e>17076\n<d846dc9f>15527\n<d846dca0>14901\n<d846dca1>15237\n<d846dca2>14343\n<d846dcbe>14707\n<d846dcbf>15577\n<d846dcd1>14718\n<d846dcd6>15505\n<d846dcd7>16561\n<d846dcd8>15239\n<d846dcd9>14965\n<d846dcfa>14685\n<d846dd05>15669\n<d846dd10>14416\n<d846dd11>16645\n<d846dd12>15016\n<d846dd15>14526\n<d846dd1c>15832\n<d846dd22>14747\n<d846dd27>14912\n<d846dd3b>14636\n<d846dd44>18742\n<d846dd58>16897\n<d846dd6a>18452\n<d846dd7c>14894\n<d846dd80>18872\n<d846dd83>16451\n<d846dd88>17078\n<d846dd96>14893\n<d846dddb>16407\n<d846ddf3>14869\n<d846de2d>18453\n<d846de34>16658\n<d846de45>18454\n<d846de4b>17082\n<d846de63>18998\n<d846df44>16665\n<d846dfc1>17633\n<d846dfc2>18380\n<d847dc2a>18455\n<d847dc70>18456\n<d847dca2>18677\n<d847dca5>16669\n<d847dcac>18457\n<d847dd46>18732\n<d847dd53>19089\n<d847dd5e>19010\n<d847dd90>15823\n<d847ddb6>18905\n<d847ddba>14907\n<d847ddca>17802\n<d847ddd1>16142\n<d847ddeb>14991\n<d847ddf9>16677\n<d847de1c>17117\n<d847de23>19043\n<d847de37>16678\n<d847de3d>18773\n<d847de89>14471\n<d847dea4>16682\n<d847dea8>15792\n<d847dec8>18458\n<d847ded5>18459\n<d847df0f>16139\n<d847df15>18460\n<d847df6a>16731\n<d847df9e>18144\n<d847dfa1>15938\n<d847dfe8>17621\n<d848dc45>18462\n<d848dc49>16688\n<d848dc7e>18889\n<d848dc9a>15782\n<d848dcc7>17275\n<d848dcfc>16446\n<d848dd2a>16879\n<d848dd5b>18104\n<d848dd73>16689\n<d848dd7a>15874\n<d848dda1>17854\n<d848ddc1>19058\n<d848ddc3>15799\n<d848de08>17287\n<d848de7c>18465\n<d848df21>15292\n<d848df25>14451\n<d848dfbd>15635\n<d848dfd0>16720\n<d848dfd7>18466\n<d848dffa>18467\n<d849dc65>18696\n<d849dc71>16721\n<d849dc8b>16905\n<d849dc91>16923\n<d849dcb0>18632\n<d849dcbc>19141\n<d849dcc1>19143\n<d849dcc9>19144\n<d849dccc>19145\n<d849dced>16419\n<d849dd13>16425\n<d849dd1b>16294\n<d849dd30>16448\n<d849dd54>16644\n<d849dd8d>15871\n<d849ddaf>14924\n<d849ddbe>14925\n<d849de1b>14931\n<d849de1c>17144\n<d849de2b>14921\n<d849de68>16733\n<d849de7a>18100\n<d849de96>17880\n<d849de98>16553\n<d849def4>18667\n<d849def5>15157\n<d849def6>14245\n<d849df12>18909\n<d849df14>14234\n<d849df1b>15837\n<d849df1f>15404\n<d849df2a>18468\n<d849df75>17257\n<d849df81>15411\n<d849df96>19029\n<d849dfb4>16743\n<d849dfb5>17912\n<d849dfcd>16893\n<d84adc03>17862\n<d84adc5f>16765\n<d84adc60>14920\n<d84adc71>18469\n<d84adcad>17057\n<d84adcc1>16772\n<d84adcf7>16834\n<d84add26>15881\n<d84add39>17863\n<d84add4f>18470\n<d84add67>18471\n<d84add6b>15412\n<d84add80>16771\n<d84add93>18472\n<d84ade66>17250\n<d84adecf>17265\n<d84aded5>18473\n<d84adee6>17804\n<d84adee8>18474\n<d84adf0e>18475\n<d84adf22>14943\n<d84adf3f>18476\n<d84adf43>16032\n<d84adf6a>14941\n<d84adfca>17219\n<d84adfce>17293\n<d84bdc26>15511\n<d84bdc27>14350\n<d84bdc38>17176\n<d84bdc4c>18477\n<d84bdc51>17294\n<d84bdc55>17886\n<d84bdc62>16016\n<d84bdc88>18478\n<d84bdc9b>14935\n<d84bdca1>14954\n<d84bdca9>17192\n<d84bdcb2>17278\n<d84bdcb7>18479\n<d84bdcc2>17201\n<d84bdcc6>17167\n<d84bdcc9>17857\n<d84bdd07>14936\n<d84bdd08>18481\n<d84bdd12>18482\n<d84bdd44>17210\n<d84bdd4c>17851\n<d84bdd67>14952\n<d84bdd8d>17238\n<d84bdd95>18484\n<d84bdda0>18680\n<d84bdda3>16533\n<d84bdda4>17922\n<d84bddb7>18483\n<d84bddee>17896\n<d84bde0d>16781\n<d84bde36>16790\n<d84bde42>18485\n<d84bde78>14946\n<d84bde8b>17286\n<d84bdeb3>16034\n<d84bdeef>18084\n<d84bdf74>18486\n<d84bdfcc>18487\n<d84bdfe3>15633\n<d84cdc33>18488\n<d84cdc44>17024\n<d84cdc4b>16950\n<d84cdc66>18489\n<d84cdc7d>14611\n<d84cdc7e>18772\n<d84cdc8e>14959\n<d84cdcb7>14546\n<d84cdcbc>14547\n<d84cdcda>18706\n<d84cdd03>14978\n<d84cdd3d>17957\n<d84cdd7d>14278\n<d84cdd82>14983\n<d84cddb3>14969\n<d84cddc8>16831\n<d84cddc9>15471\n<d84cddea>19099\n<d84cddf9>16922\n<d84cde0f>14982\n<d84cde25>15325\n<d84cde2f>15923\n<d84cde31>16829\n<d84cde32>15105\n<d84cde33>16450\n<d84cde34>14980\n<d84cde56>19028\n<d84cde5e>19101\n<d84cde62>14448\n<d84cde81>18869\n<d84cde89>14968\n<d84cde8a>16569\n<d84cdeab>14962\n<d84cdeac>17124\n<d84cdead>14960\n<d84cded2>14993\n<d84cdee0>14964\n<d84cdee1>14994\n<d84cdf00>15707\n<d84cdf0a>14527\n<d84cdf1f>18490\n<d84cdfb4>16443\n<d84cdfcc>15819\n<d84cdfde>18491\n<d84cdfe6>16852\n<d84cdff4>17883\n<d84cdff5>18730\n<d84cdff9>18911\n<d84cdffa>15644\n<d84cdffe>15002\n<d84ddc00>16816\n<d84ddc3f>15209\n<d84ddc50>14944\n<d84ddc6f>16855\n<d84ddc72>14908\n<d84ddce5>15639\n<d84ddd19>15864\n<d84ddd30>14265\n<d84ddd51>19037\n<d84ddd5a>14279\n<d84ddd67>18492\n<d84ddd95>14804\n<d84ddd99>14708\n<d84ddd9c>15451\n<d84dddbb>19148\n<d84dddcd>16861\n<d84dddce>14287\n<d84dddcf>15194\n<d84dddf3>18493\n<d84dde00>16423\n<d84dde17>18982\n<d84dde1a>18494\n<d84dde3c>16865\n<d84dde40>15452\n<d84dde59>16878\n<d84dde5f>15059\n<d84dde77>18748\n<d84dde8e>19131\n<d84dde9e>19090\n<d84ddea6>14729\n<d84ddead>15647\n<d84ddeba>18659\n<d84ddedf>15641\n<d84ddeee>14739\n<d84ddf03>16881\n<d84ddf16>18495\n<d84ddf20>18703\n<d84ddf2d>16471\n<d84ddf2f>15898\n<d84ddf3f>14750\n<d84ddf66>14220\n<d84ddf81>15110\n<d84ddfa2>15001\n<d84ddfbc>14999\n<d84ddfc2>16840\n<d84ddfd5>15010\n<d84ddfd6>15643\n<d84ddfd7>15448\n<d84edc3a>14998\n<d84eddc2>17269\n<d84edea7>18497\n<d84ededb>16895\n<d84edeee>14895\n<d84edefa>18138\n<d84edf1a>19033\n<d84edf5a>16900\n<d84fdc63>18914\n<d84fdc99>16455\n<d84fdc9a>15024\n<d84fdc9b>14478\n<d84fdcb5>18085\n<d84fdcb7>15963\n<d84fdcc7>18738\n<d84fdcc8>16409\n<d84fdcc9>16917\n<d84fdcfc>18674\n<d84fdcfd>18720\n<d84fdcfe>18697\n<d84fdcff>15794\n<d84fdd40>15979\n<d84fdd5b>15582\n<d84fdd7e>14258\n<d84fdd8f>15242\n<d84fddb6>18701\n<d84fddb7>15514\n<d84fddb8>15405\n<d84fddb9>14361\n<d84fddba>15147\n<d84fddbb>14446\n<d84fddbc>16911\n<d84fddbd>16913\n<d84fdde3>14237\n<d84fddf8>14267\n<d84fde06>18999\n<d84fde11>18498\n<d84fde2c>18705\n<d84fde2d>15609\n<d84fde2e>14505\n<d84fde2f>16944\n<d84fde30>16954\n<d84fde31>14734\n<d84fde39>14805\n<d84fde88>18648\n<d84fde89>14809\n<d84fde8a>14794\n<d84fde8b>14283\n<d84fdeb9>18499\n<d84fdebf>14806\n<d84fded7>14123\n<d84fdef7>18704\n<d84fdef8>15058\n<d84fdef9>15683\n<d84fdefa>15136\n<d84fdefb>14736\n<d84fdefc>16902\n<d84fdf35>15067\n<d84fdf41>18054\n<d84fdf4a>15809\n<d84fdf61>19000\n<d84fdf7f>15036\n<d84fdf80>16490\n<d84fdf81>15935\n<d84fdf82>16946\n<d84fdf8f>18091\n<d84fdfb4>16973\n<d84fdfb7>16764\n<d84fdfc0>15023\n<d84fdfc5>16398\n<d84fdfeb>16532\n<d84fdfec>16492\n<d84fdfed>15608\n<d84fdfee>15333\n<d84fdfef>15835\n<d84fdff0>16972\n<d850dc11>16381\n<d850dc39>16971\n<d850dc3a>16562\n<d850dc3b>15786\n<d850dc3c>15039\n<d850dc3d>16957\n<d850dc57>14192\n<d850dc85>16934\n<d850dc8b>14752\n<d850dc8c>18771\n<d850dc8d>14841\n<d850dc91>16969\n<d850dcc9>14845\n<d850dce1>14751\n<d850dcec>19042\n<d850dd04>15427\n<d850dd0f>14753\n<d850dd19>18500\n<d850dd3f>16974\n<d850dd40>16978\n<d850dd44>16967\n<d850dd4e>18855\n<d850dd55>16970\n<d850dd5c>14572\n<d850dd5f>17071\n<d850dd61>19097\n<d850dd77>17942\n<d850dd7a>15908\n<d850dda3>18669\n<d850dda4>16914\n<d850dda5>16585\n<d850ddac>15488\n<d850ddb5>15480\n<d850ddcd>16844\n<d850dde2>17042\n<d850ddfc>15670\n<d850de1b>15354\n<d850de4b>18102\n<d850de56>15697\n<d850de59>15688\n<d850de76>15047\n<d850de77>16992\n<d850de78>16608\n<d850de84>15271\n<d850de93>15681\n<d850de95>14871\n<d850dea5>15678\n<d850debf>18981\n<d850dec1>17001\n<d850dec9>14984\n<d850deca>15686\n<d850deee>18501\n<d850defa>15510\n<d850df0d>18502\n<d850df1a>15046\n<d850df34>18503\n<d850df48>14681\n<d850df62>15631\n<d850df63>16595\n<d850df64>14648\n<d850df65>16998\n<d850df8c>14827\n<d850df96>18504\n<d850df9c>16837\n<d850dfbd>15695\n<d850dfc1>15512\n<d850dfe9>15701\n<d850dfea>15323\n<d850dff2>16119\n<d850dff8>14703\n<d851dc04>18505\n<d851dc35>16564\n<d851dc36>14768\n<d851dc5a>17003\n<d851dc5b>15685\n<d851dc73>14702\n<d851dc87>15011\n<d851dc88>15499\n<d851dcb9>14696\n<d851dcbc>16697\n<d851dcce>15693\n<d851dcd3>17194\n<d851dcd6>18506\n<d851dd05>18917\n<d851dd21>15844\n<d851dd78>14175\n<d851ddc8>17240\n<d851de18>16079\n<d851de2a>15005\n<d851de65>14940\n<d851de74>18508\n<d851de97>15109\n<d851ded4>14937\n<d851df06>18664\n<d851df25>15053\n<d851df2f>18509\n<d851df8f>15052\n<d851dfe0>16066\n<d851dfef>17355\n<d852dc12>18510\n<d852dc23>17030\n<d852dc82>14173\n<d852dce9>17653\n<d852dcf0>15112\n<d852dcf1>16906\n<d852dcf2>18159\n<d852dcf3>15095\n<d852dcfb>18511\n<d852dcff>15321\n<d852dd00>16916\n<d852dd01>16687\n<d852dd0c>16915\n<d852dd16>15542\n<d852dd17>15061\n<d852dd19>18721\n<d852dd2f>15299\n<d852dd33>16413\n<d852dd34>15846\n<d852dd3e>18716\n<d852dd3f>15816\n<d852dd40>16808\n<d852dd41>15472\n<d852dd42>16404\n<d852dd43>15558\n<d852dd62>18119\n<d852dd63>18709\n<d852dd74>17019\n<d852dd75>14677\n<d852dd76>15544\n<d852dd7b>18952\n<d852dd7f>16933\n<d852dd82>16749\n<d852dd88>15930\n<d852dd89>14961\n<d852dd8a>14425\n<d852dd8b>15520\n<d852dd8c>15145\n<d852dd8d>17048\n<d852dd8e>15089\n<d852dd8f>16750\n<d852dd94>14732\n<d852dda4>16440\n<d852dda7>14264\n<d852dda9>16637\n<d852ddab>15088\n<d852ddac>14829\n<d852ddad>15575\n<d852ddb7>17047\n<d852ddb8>15401\n<d852ddb9>15519\n<d852ddba>15773\n<d852ddbb>14678\n<d852ddc5>15094\n<d852ddd0>15876\n<d852ddda>17940\n<d852ddde>15453\n<d852dddf>16783\n<d852dde3>14951\n<d852dde5>15540\n<d852ddec>18116\n<d852dded>15331\n<d852ddf6>15834\n<d852ddf7>15210\n<d852ddf8>14680\n<d852ddf9>15174\n<d852ddfb>17049\n<d852de0e>14793\n<d852de12>18782\n<d852de13>18920\n<d852de15>18512\n<d852de21>16838\n<d852de22>17005\n<d852de23>16802\n<d852de24>17044\n<d852de25>14723\n<d852de26>17053\n<d852de27>17004\n<d852de28>16801\n<d852de29>14587\n<d852de2a>15885\n<d852de3e>15534\n<d852de42>15322\n<d852de45>15787\n<d852de4a>15060\n<d852de4e>15092\n<d852de4f>18129\n<d852de50>15569\n<d852de51>14682\n<d852de5d>18133\n<d852de65>14253\n<d852de66>15537\n<d852de67>15369\n<d852de71>15632\n<d852de77>18725\n<d852de78>15332\n<d852de79>17072\n<d852de7a>14398\n<d852de8c>17070\n<d852de93>18634\n<d852de94>15535\n<d852de95>14254\n<d852de96>15119\n<d852dea4>15055\n<d852dea5>15934\n<d852dea6>16464\n<d852dea7>15810\n<d852deb1>16424\n<d852deb2>15361\n<d852deb3>15529\n<d852deba>15116\n<d852debb>16285\n<d852debc>14840\n<d852dec0>18513\n<d852dec7>15117\n<d852deca>18605\n<d852ded1>14525\n<d852dedf>15065\n<d852dee2>18714\n<d852dee9>14534\n<d852df0f>19083\n<d852df6e>18692\n<d852dff5>16597\n<d853dc09>15286\n<d853dc9e>18649\n<d853dc9f>15645\n<d853dcc9>18093\n<d853dcd9>15079\n<d853dd06>15080\n<d853dd13>17092\n<d853ddb8>17171\n<d853ddea>17181\n<d853ddeb>17908\n<d853de3b>17282\n<d853de50>17921\n<d853dea5>17360\n<d853dea7>17200\n<d853df0e>18751\n<d853df5c>17364\n<d853df82>17090\n<d853df86>18515\n<d853df97>15491\n<d853df9a>15827\n<d853dfa9>18699\n<d853dfb8>18080\n<d853dfc2>18678\n<d854dc2c>18516\n<d854dc52>17227\n<d854dc9d>17115\n<d854dd2b>17165\n<d854dd48>18660\n<d854dd7d>17116\n<d854dd7e>17934\n<d854ddcd>18859\n<d854dde3>17865\n<d854dde6>16826\n<d854dde7>15103\n<d854de20>17122\n<d854de21>15102\n<d854de50>16730\n<d854de99>18518\n<d854dec7>17207\n<d854ded8>17938\n<d854df0e>14153\n<d854df11>18653\n<d854df13>16832\n<d855dc19>18519\n<d855dc25>14976\n<d855dc2f>14711\n<d855dc30>14392\n<d855dc46>18520\n<d855dc6c>14555\n<d855dc6e>18521\n<d855dc9a>19075\n<d855dd31>18741\n<d855dd35>18201\n<d855dd3f>18522\n<d855dd5b>14975\n<d855dd5c>14735\n<d855dd5d>15465\n<d855dd5e>18523\n<d855dd62>18524\n<d855dd65>14393\n<d855dd66>18525\n<d855dd81>15122\n<d855dd84>14971\n<d855dd8f>14973\n<d855ddb9>14476\n<d855ddd5>15554\n<d855dddb>14480\n<d855dde0>17137\n<d855de05>17016\n<d855de35>18643\n<d855de51>14774\n<d855de83>15253\n<d855de95>18925\n<d855dee3>15130\n<d855def6>15710\n<d855df06>14573\n<d855df1d>16792\n<d855df25>14596\n<d855df3d>17947\n<d855df72>16520\n<d855dfc7>18526\n<d855dfdf>15342\n<d855dfe0>14127\n<d855dfe1>15839\n<d856dc57>17149\n<d856dc5d>18527\n<d856dc72>14996\n<d856dcc8>15386\n<d856dcde>19093\n<d856dce1>14132\n<d856dd03>18528\n<d856dd46>14868\n<d856dd56>18644\n<d856ddac>14136\n<d856ddcc>16659\n<d856de54>18997\n<d856de95>18694\n<d856de9c>15159\n<d856deae>18529\n<d856deaf>15158\n<d856dee9>15201\n<d856df74>17956\n<d856df89>18530\n<d856dfb3>15170\n<d856dfb4>14158\n<d856dfc6>15164\n<d856dfe4>14303\n<d856dfe8>18480\n<d857dc01>14149\n<d857dc06>18531\n<d857dc21>16211\n<d857dc4a>18652\n<d857dc65>18074\n<d857dc91>14320\n<d857dca4>18924\n<d857dcc0>14322\n<d857dcc1>14170\n<d857dcfe>14154\n<d857dd20>14164\n<d857dd30>18861\n<d857dd43>15202\n<d857dd99>19139\n<d857ddb9>19124\n<d857de0e>15204\n<d857de49>17274\n<d857de81>18646\n<d857de82>15188\n<d857de83>14876\n<d857dea6>15172\n<d857debc>15171\n<d857ded7>18739\n<d857ded8>18655\n<d857df1a>16344\n<d857df4b>14719\n<d857dfe1>15062\n<d857dfe2>15780\n<d858dc21>19091\n<d858dc29>14193\n<d858dc48>16071\n<d858dc64>15449\n<d858dc83>18784\n<d858dc97>17242\n<d858dca4>15518\n<d858dca5>17850\n<d858dd02>18534\n<d858dd21>14201\n<d858dd59>18729\n<d858dd5a>14202\n<d858dd5b>15517\n<d858dd5c>15185\n<d858ddad>18746\n<d858ddae>15120\n<d858ddb2>18535\n<d858dddd>16979\n<d858de58>15964\n<d858de61>15184\n<d858de6a>17658\n<d858de6b>18757\n<d858ded0>14212\n<d858df35>16133\n<d858df4b>17660\n<d858df4c>18754\n<d858df51>14215\n<d858dfbe>15348\n<d858dff5>17103\n<d858dff8>15197\n<d859dc02>18536\n<d859dc10>14522\n<d859dc11>15851\n<d859dc12>15196\n<d859dc4a>18537\n<d859dc69>15860\n<d859dc84>18538\n<d859dc88>18539\n<d859dc89>14223\n<d859dc8d>14142\n<d859dc98>14247\n<d859dd12>18540\n<d859dd72>17899\n<d859dda0>15213\n<d859ddad>15211\n<d859ddbf>18541\n<d859de12>17663\n<d859de26>14236\n<d859deaf>18641\n<d859deb1>14757\n<d859deb5>18542\n<d859deda>17223\n<d859dee8>14238\n<d859defc>18544\n<d859df16>17224\n<d859df41>15515\n<d859df99>18546\n<d859dfb3>18702\n<d859dfb4>15223\n<d859dfcc>16362\n<d85adc1c>17860\n<d85adc46>18750\n<d85adc5e>18548\n<d85adc6e>18547\n<d85adc88>16719\n<d85adc8a>16044\n<d85adc93>18666\n<d85adcc7>18549\n<d85add0e>17108\n<d85add11>17107\n<d85add26>18550\n<d85add39>18551\n<d85add51>17664\n<d85adda8>18101\n<d85addb5>15921\n<d85addf2>17180\n<d85addfa>18552\n<d85ade2d>18553\n<d85ade2e>17039\n<d85ade34>18554\n<d85ade42>15225\n<d85ade51>15228\n<d85ade52>14257\n<d85adf05>14285\n<d85adf0a>18082\n<d85adf13>16485\n<d85adf15>18958\n<d85adf23>18995\n<d85adf28>16670\n<d85adf50>17889\n<d85adf51>16907\n<d85adf52>15812\n<d85adf53>16542\n<d85adf5b>18555\n<d85adf75>15190\n<d85adf82>15439\n<d85adf96>14311\n<d85adf97>14286\n<d85adf9d>18556\n<d85adfb3>16416\n<d85adfc0>15625\n<d85adff7>15830\n<d85bdc21>14754\n<d85bdc40>15490\n<d85bdc41>19048\n<d85bdc46>19069\n<d85bdc7e>16590\n<d85bdc7f>14159\n<d85bdc80>15661\n<d85bdc81>16622\n<d85bdc82>15654\n<d85bdca4>18557\n<d85bdcb7>15648\n<d85bdcb8>14520\n<d85bdcbd>15849\n<d85bdcc0>15508\n<d85bdcc3>14230\n<d85bdcd1>15216\n<d85bdd22>18713\n<d85bdd23>18718\n<d85bdd24>14986\n<d85bdd25>16926\n<d85bdd26>15652\n<d85bdd27>14579\n<d85bdd28>15691\n<d85bdd29>16421\n<d85bdd2a>16623\n<d85bdd51>15653\n<d85bdd74>18956\n<d85bdda0>16853\n<d85bdda1>16927\n<d85bdda2>14660\n<d85bdda3>14284\n<d85bdda4>15442\n<d85bdda5>14293\n<d85bdda6>16628\n<d85bdda7>15230\n<d85bddae>18558\n<d85bdddc>18744\n<d85bddea>15075\n<d85bddeb>16928\n<d85bddf0>15444\n<d85bde00>15447\n<d85bde05>16291\n<d85bde07>15916\n<d85bde12>15437\n<d85bde42>14301\n<d85bde43>14313\n<d85bde44>14184\n<d85bde45>16633\n<d85bde6e>16723\n<d85bde72>16935\n<d85bde77>14312\n<d85bde84>15443\n<d85bde88>19137\n<d85bde8b>18984\n<d85bde99>18086\n<d85bded0>18671\n<d85bded1>18733\n<d85bded2>16758\n<d85bded3>14125\n<d85bded4>14297\n<d85bded5>14512\n<d85bded6>14186\n<d85bded7>14453\n<d85bdf26>14741\n<d85bdf73>14927\n<d85bdf74>16937\n<d85bdf9f>17113\n<d85bdfa1>16643\n<d85bdfbe>18959\n<d85bdfde>15655\n<d85bdfdf>15438\n<d85cdc0e>17789\n<d85cdc4b>18559\n<d85cdc52>14737\n<d85cdc53>15662\n<d85cdc88>14335\n<d85cdcad>18745\n<d85cdcae>18710\n<d85cdcaf>15906\n<d85cdccd>14338\n<d85cdcd2>18985\n<d85cdcf8>16732\n<d85cdd09>18127\n<d85cdd0c>14428\n<d85cdd0d>18954\n<d85cdd26>17155\n<d85cdd27>15215\n<d85cdd64>18712\n<d85cdd65>14733\n<d85cdd75>14569\n<d85cddcd>18560\n<d85cde1b>15232\n<d85cde67>18970\n<d85cde80>18561\n<d85cde85>18562\n<d85cde8b>18563\n<d85cdeb2>16092\n<d85cdeb6>18672\n<d85cdee6>18564\n<d85cdf52>18983\n<d85cdf9a>14345\n<d85cdfff>19072\n<d85ddc22>15244\n<d85ddc50>18566\n<d85ddc84>15579\n<d85ddc86>16356\n<d85ddd74>17285\n<d85ddda3>16069\n<d85ddde0>14360\n<d85ddde4>14362\n<d85dddfd>14917\n<d85dddfe>15781\n<d85dde07>14008\n<d85dde0c>17141\n<d85dde32>15814\n<d85dde39>17292\n<d85dde55>18642\n<d85dde56>18740\n<d85dde57>15779\n<d85dde94>17930\n<d85ddf0f>14369\n<d85ddf35>17723\n<d85ddf36>15684\n<d85ddf41>15129\n<d85ddf5e>17303\n<d85ddf84>15256\n<d85ddf85>15255\n<d85ddfcc>18568\n<d85edc58>18569\n<d85edc70>14990\n<d85edc9d>15957\n<d85edcb2>17668\n<d85edcc8>17849\n<d85edd24>14378\n<d85edd67>18297\n<d85edd7a>14562\n<d85edda0>17225\n<d85edddd>18571\n<d85eddfd>18572\n<d85ede0a>18573\n<d85ede0e>16653\n<d85ede3e>15961\n<d85ede53>16751\n<d85ede59>14384\n<d85ede79>15771\n<d85ede84>16422\n<d85edebd>14379\n<d85edebe>14456\n<d85edef4>15709\n<d85edf06>15379\n<d85edf0b>18574\n<d85edf18>15711\n<d85edf38>14388\n<d85edf39>17151\n<d85edf3a>14386\n<d85edf48>15186\n<d85edf65>19134\n<d85edfef>19008\n<d85edff4>15640\n<d85fdc12>15825\n<d85fdc6c>18991\n<d85fdcb1>18973\n<d85fdcc5>18975\n<d85fdd2f>18668\n<d85fdd53>14410\n<d85fdd54>14406\n<d85fdd66>18575\n<d85fdd73>18670\n<d85fdd84>17845\n<d85fdd8f>14407\n<d85fdd98>14412\n<d85fddbd>14413\n<d85fdddc>15279\n<d85fde4d>15694\n<d85fde4f>15604\n<d85fdf2e>16106\n<d85fdff9>16061\n<d860dc02>14423\n<d860dc09>18576\n<d860dc1e>15030\n<d860dc23>18577\n<d860dc24>15960\n<d860dc48>18578\n<d860dc83>18579\n<d860dc90>18580\n<d860dcbd>17902\n<d860dcbe>17174\n<d860dce8>15899\n<d860dce9>17198\n<d860dcf4>18581\n<d860dd2e>18582\n<d860dd4f>18583\n<d860dd5d>17179\n<d860dd6f>15920\n<d860dd89>17384\n<d860ddaf>18584\n<d860ddbc>14427\n<d860de07>17918\n<d860de18>15599\n<d860de1a>18585\n<d860de56>17193\n<d860de7c>17943\n<d860de9b>17272\n<d860decd>17931\n<d860dee2>16005\n<d860df06>18586\n<d860df18>15914\n<d860df2f>18587\n<d860df3a>14221\n<d860df65>14436\n<d860df6d>14199\n<d860df7d>16263\n<d860df8a>18588\n<d861dc12>14437\n<d861dc68>18589\n<d861dc6c>17801\n<d861dc73>15882\n<d861dc82>16706\n<d861dd01>18097\n<d861dd3c>14455\n<d861dd3d>14445\n<d861dd6c>14458\n<d861dde8>15796\n<d861ddf4>16830\n<d861de00>14607\n<d861de0b>14459\n<d861de25>14332\n<d861de3b>14333\n<d861deaa>18590\n<d861deab>16508\n<d861deb2>19071\n<d861debc>18096\n<d861ded8>14503\n<d861dee6>14463\n<d861df0f>18877\n<d861df13>14461\n<d862dc04>17033\n<d862dc2b>17031\n<d862dd0d>19098\n<d862dd33>14470\n<d862dd48>15822\n<d862dd49>15928\n<d862dd56>18592\n<d862dd64>17126\n<d862dd68>17127\n<d862dd6c>14695\n<d862dd6d>19059\n<d862dd7e>14687\n<d862dd89>15345\n<d862dda8>14909\n<d862ddaa>16414\n<d862ddab>15907\n<d862ddb8>18593\n<d862ddbc>16552\n<d862ddc0>18044\n<d862dddc>15031\n<d862ddde>14444\n<d862dde1>15689\n<d862dde3>18892\n<d862dde4>16405\n<d862ddf9>15260\n<d862ddfa>15521\n<d862ddfb>14886\n<d862ddfc>15502\n<d862de0f>18747\n<d862de16>15551\n<d862de25>14376\n<d862de29>16736\n<d862de32>18863\n<d862de36>16726\n<d862de44>14691\n<d862de45>15372\n<d862de46>14859\n<d862de47>14906\n<d862de48>14241\n<d862de49>15494\n<d862de4a>16869\n<d862de4b>15306\n<d862de59>18150\n<d862de5a>18726\n<d862de81>15586\n<d862de82>15556\n<d862de83>15642\n<d862de9a>15785\n<d862de9b>16515\n<d862de9c>14818\n<d862dec0>15574\n<d862dec6>14477\n<d862decb>15028\n<d862decc>15087\n<d862dece>15550\n<d862dede>16487\n<d862dedf>16858\n<d862dee0>14516\n<d862dee1>14484\n<d862dee2>14487\n<d862dee3>15099\n<d862dee5>14488\n<d862deea>18885\n<d862defc>15308\n<d862df0c>14479\n<d862df13>14763\n<d862df21>16942\n<d862df22>14972\n<d862df2b>18783\n<d862df2c>18636\n<d862df2d>18735\n<d862df2f>15347\n<d862df46>18596\n<d862df4c>17231\n<d862df4e>15801\n<d862df50>15368\n<d862df63>15526\n<d862df64>15370\n<d862df65>15385\n<d862df66>16581\n<d862df6c>18639\n<d862df8f>17073\n<d862df99>18640\n<d862df9c>15259\n<d862df9d>16767\n<d862dfb9>19005\n<d862dfc2>18731\n<d862dfc5>15360\n<d862dfd4>18597\n<d862dfd7>14878\n<d862dfd9>15258\n<d862dfda>14684\n<d862dfe7>15553\n<d862dfe8>17007\n<d862dfe9>14129\n<d862dfea>15027\n<d862dfeb>14485\n<d862dfec>14491\n<d862dff5>15257\n<d862dfff>14493\n<d863dc03>17075\n<d863dc09>18598\n<d863dc1c>15624\n<d863dc1d>15310\n<d863dc23>15066\n<d863dc26>15346\n<d863dc2b>14655\n<d863dc30>15925\n<d863dc39>14492\n<d863dc3b>15311\n<d863dcca>17300\n<d863dccd>17289\n<d863dcd2>17298\n<d863dd34>15318\n<d863dd99>17299\n<d863ddb9>18942\n<d863de0f>17675\n<d863de36>14688\n<d863de39>16332\n<d863de65>15329\n<d863de66>15328\n<d863de97>16202\n<d863deac>17084\n<d863deb2>17059\n<d863deb3>14784\n<d863ded9>17081\n<d863dee7>15327\n<d863dfc5>18599\n<d864dc79>19062\n<d864dc88>14926\n<d864dc8b>14668\n<d864dc93>15341\n<d864dcaf>14523\n<d864dcb0>15338\n<d864dcb1>14598\n<d864dcc0>15854\n<d864dce4>15601\n<d864dce5>14524\n<d864dcec>18600\n<d864dced>16845\n<d864dd0d>17158\n<d864dd10>18601\n<d864dd3c>18602\n<d864dd4d>14938\n<d864dd5b>18147\n<d864dd5e>18604\n<d864dd70>16964\n<d864dd9c>16886\n<d864dda8>15903\n<d864ddd5>14539\n<d864ddeb>14542\n<d865dc1d>14561\n<d865dc20>18151\n<d865dc33>14558\n<d865dc3f>14966\n<d865dc48>15268\n<d865dcd0>16132\n<d865dcd9>14133\n<d865dcda>15363\n<d865dce5>17172\n<d865dce7>18607\n<d865dd9e>18700\n<d865ddb0>18608\n<d865ddb8>18609\n<d865ddd7>15365\n<d865dde9>15949\n<d865ddf4>17204\n<d865df20>17279\n<d865df32>18610\n<d865dfd4>17208\n<d866dc10>17681\n<d866dc57>14589\n<d866dca4>15893\n<d866dcd1>18611\n<d866dcea>14945\n<d866dcf1>15391\n<d866dcfa>19055\n<d866dd03>18743\n<d866dd05>14590\n<d866dd2f>15434\n<d866dd45>19019\n<d866dd47>18884\n<d866dd48>15393\n<d866dd49>18612\n<d866dd5d>16768\n<d866dd6a>18613\n<d866dd9d>14740\n<d866ddc3>18614\n<d866ddc9>15797\n<d866de28>18615\n<d866de4d>17197\n<d866df05>14602\n<d866df0e>18616\n<d866dfd5>14599\n<d867dc73>18851\n<d867dcad>15892\n<d867dd3e>14614\n<d867dd5a>18617\n<d867dd7c>16067\n<d867dd98>15973\n<d867dd9b>18618\n<d867ddf6>17788\n<d867de06>16122\n<d867de2d>15421\n<d867de68>14621\n<d867deac>16085\n<d867deb0>19013\n<d867dec3>17893\n<d867def8>18620\n<d867df23>18621\n<d867df30>18698\n<d867dfb7>14623\n<d867dfde>16090\n<d868dc14>18095\n<d868dc87>14229\n<d868dcb9>14639\n<d868dce1>14626\n<d868dced>15432\n<d868dcf3>15433\n<d868dcf8>14348\n<d868dcfe>15424\n<d868dd07>18870\n<d868dd23>14627\n<d868dd33>17791\n<d868dd34>14631\n<d868dd50>16607\n<d868dd92>14624\n<d868dd93>14634\n<d868ddab>14625\n<d868ddb4>15431\n<d868ddb5>19065\n<d868dddf>14628\n<d868ddf5>15423\n<d868de20>14635\n<d868de33>14637\n<d868de93>18624\n<d868de9f>14440\n<d868deb2>16276\n<d868deb4>14640\n<d868deb6>18145\n<d868deba>18880\n<d868debd>17939\n<d868dedf>15912\n<d868deff>18626\n<d868df51>18987\n<d868dfa9>17716\n<d869dc34>16113\n<d869dc5b>18111\n<d869ddc6>15084\n<d869ddcb>18627\n<d869de01>17263\n<d869de32>17297\n<d869de4a>16254\n<d869de5b>17288\n<d869dea9>18675\n<d86bddff>19152\n<d87edc06>15843\n<d87edc25>15704\n<d87edc28>17316\n<d87edc29>16486\n<d87edc32>16510\n<d87edc3b>18411\n<d87edc40>18727\n<d87edc78>17634\n<d87edc94>16715\n<d87edca6>16757\n<d87edccd>15842\n<d87edcdb>16841\n<d87edd08>16943\n<d87edd22>16392\n<d87edd2f>17056\n<d87edd8f>14263\n<d87edd94>14270\n<d87eddb2>14339\n<d87eddbc>15241\n<d87eddd4>14408\n<d87eddd7>14421\n<d87ede1b>14662\nendcidchar\nbegincidrange\n<d843dd7e><d843dd7f>17884\n<d844dc1d><d844dc1e>17924\n<d844dcf5><d844dcf6>17926\n<d846dd03><d846dd04>14898\n<d84cdda4><d84cdda5>16821\n<d84cddf7><d84cddf8>16818\n<d850dd56><d850dd57>16976\n<d862dde7><d862dde8>18594\nendcidrange\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/UniCNS-UTF16-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniCNS-UTF16-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniCNS-UTF16-H)\n%%BeginResource: CMap (UniCNS-UTF16-V)\n%%Title: (UniCNS-UTF16-V Adobe CNS1 6)\n%%Version: 1.005\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniCNS-UTF16-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 6 def\nend def\n\n/CMapName /UniCNS-UTF16-V def\n/CMapVersion 1.005 def\n/CMapType 1 def\n\n/XUID [1 10 25592] def\n\n/WMode 1 def\n\n6 begincidchar\n<2013> 120\n<2014> 122\n<2025> 109\n<fe4f> 13745\n<ff5b> 134\n<ff5d> 135\nendcidchar\n\n7 begincidrange\n<3008> <3009> 150\n<300a> <300b> 146\n<300c> <300d> 154\n<300e> <300f> 158\n<3010> <3011> 142\n<3014> <3015> 138\n<ff08> <ff09> 130\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/UniCNS-UTF32-H",
    "content": "begincmap\n/CMapName /UniCNS-UTF32-H def\n/WMode 0 def\n/UniCNS-X usecmap\nbegincodespacerange\n<00000000><0010ffff>\nendcodespacerange\nbegincidchar\n<a0>1\n<a9>96\n<af>195\n<02cd>198\n<0304>195\n<030c>504\n<2027>104\n<2122>97\n<2215>257\n<2295>243\n<2299>244\n<22ef>110\n<2574>13744\n<2e9d>18846\n<2ec6>18847\n<2ee3>18848\n<2f00>595\n<2f04>596\n<2f05>539\n<2f06>602\n<2f07>540\n<2f0f>607\n<2f10>5998\n<2f11>608\n<2f12>610\n<2f13>544\n<2f14>611\n<2f15>5999\n<2f16>545\n<2f19>546\n<2f1a>6000\n<2f1b>547\n<2f1c>614\n<2f1d>633\n<2f1e>6005\n<2f21>548\n<2f22>548\n<2f27>549\n<2f2c>6006\n<2f2d>646\n<2f2e>550\n<2f3b>6007\n<2f40>725\n<2f41>556\n<2f46>557\n<2f4e>6026\n<2f53>6028\n<2f59>6029\n<2f65>862\n<2f66>866\n<2f71>6066\n<2f79>6162\n<2f8b>6163\n<2f8c>6168\n<2f91>6169\n<2f98>6375\n<2fa1>560\n<2fa2>1307\n<2faa>561\n<2fad>17635\n<2fae>1698\n<2fbd>7731\n<2fbe>2552\n<2fbf>7732\n<2fcb>9056\n<2fcc>9746\n<2fd2>4745\n<2fd5>12045\n<31c5>17615\n<31c8>17622\n<31cf>13999\n<344a>19046\n<34e6>19122\n<3559>18860\n<361d>14007\n<3625>19012\n<3661>19084\n<37d6>19067\n<3875>19088\n<38d4>19074\n<3978>19045\n<3af5>19094\n<3b95>18976\n<3c18>18737\n<3c8b>18871\n<3d12>19036\n<3d88>19026\n<3dc9>18853\n<3df4>19006\n<3edb>18919\n<3eec>19092\n<3f07>19063\n<3fc8>19082\n<4009>18878\n<4071>18944\n<40b4>19149\n<40f8>19066\n<4102>19060\n<4131>19130\n<417c>19070\n<4181>19138\n<41ed>19087\n<4223>18881\n<4276>18949\n<42a2>18945\n<430a>19102\n<439a>19030\n<43f0>18965\n<4491>14004\n<44bd>19086\n<44c3>19027\n<44de>19085\n<44e1>19151\n<451b>19077\n<4523>14326\n<4536>19031\n<4558>19041\n<4561>19076\n<456d>19073\n<4578>18969\n<45a6>18968\n<45ac>17377\n<45b3>18972\n<45da>18989\n<45ea>19081\n<4603>18967\n<46a1>18994\n<46ae>19136\n<46bb>19061\n<46f7>19068\n<4736>18977\n<4744>18978\n<474f>18988\n<48b4>15301\n<492f>19128\n<4930>19106\n<4aa4>18993\n<4b10>18873\n<4b20>18858\n<4c32>18966\n<4c40>18980\n<4c47>18979\n<4c57>18986\n<4c77>19044\n<4c7b>19079\n<4c81>18955\n<4c85>18990\n<4ce2>18974\n<4d07>18992\n<4d76>19080\n<4d77>18971\n<4d89>19078\n<4e2f>18898\n<4ea3>18895\n<4efe>17307\n<4f17>18899\n<4fb4>19050\n<4ff0>18896\n<503b>18849\n<50bc>18897\n<51ae>18876\n<51e2>18758\n<524f>19120\n<5324>18888\n<5434>18901\n<544c>19129\n<54cc>17890\n<5553>18762\n<55b9>17892\n<55de>18661\n<56fb>19002\n<573d>18950\n<577a>18722\n<57b3>19127\n<5818>19132\n<581f>16598\n<5892>18903\n<5896>19108\n<58d0>18904\n<591d>19004\n<59bf>19052\n<5a1a>18946\n<5aa4>19011\n<5acf>14866\n<5ad1>19014\n<5b15>18921\n<5b96>18962\n<5bb7>19015\n<5bdb>19009\n<5c78>19035\n<5cd5>19032\n<5cf5>18857\n<5cfc>19016\n<5d78>19038\n<5d7b>18957\n<5e92>18906\n<5e99>18907\n<5ed0>16014\n<5f3b>19056\n<5fc2>18908\n<60b3>18768\n<60de>16890\n<60ea>16748\n<6122>18862\n<62c1>19153\n<658b>18910\n<664d>19001\n<6660>19113\n<66e7>19023\n<6719>18867\n<676b>18948\n<676e>19017\n<6782>19118\n<6919>18912\n<69e9>18463\n<6a29>19114\n<6a43>18913\n<6a63>18879\n<6cff>18915\n<6dfe>18850\n<6e57>19024\n<704d>18887\n<706e>19154\n<7077>18856\n<70a6>18128\n<7157>19040\n<7191>18866\n<7200>18916\n<7225>18996\n<738c>18918\n<73ba>18868\n<73c4>19123\n<7402>18875\n<744c>19116\n<7461>19020\n<749d>19021\n<74b9>18922\n<74c6>19125\n<76d9>18891\n<77dd>18894\n<78e4>18874\n<79ca>19025\n<79d0>19111\n<7a2a>18883\n<7a2c>19119\n<7a32>19112\n<7a72>19133\n<7a93>18926\n<7afc>19095\n<7bae>19140\n<7bc5>19117\n<7bec>18927\n<7cc3>18928\n<7d8b>18902\n<7d95>19003\n<7e5b>18964\n<7e6c>18929\n<816c>19053\n<82bf>18953\n<82f8>18930\n<8480>18121\n<8484>19103\n<8495>15214\n<8496>18118\n<8503>14728\n<8504>19147\n<855f>18938\n<8593>19018\n<8597>18931\n<85d6>18951\n<860f>18882\n<8613>19107\n<8771>18087\n<8786>18662\n<888f>18854\n<8890>18933\n<889d>19115\n<898a>18090\n<89a9>16377\n<8acc>19049\n<8af9>19034\n<8b4c>18092\n<8b83>18923\n<8b8f>19135\n<8e80>18637\n<8eb9>18935\n<8fa7>18864\n<8fcf>18937\n<9046>19121\n<91f6>18865\n<9218>19110\n<9221>18940\n<936e>16300\n<93c6>18106\n<93f4>18890\n<942f>19105\n<9734>19007\n<974a>19109\n<9755>18886\n<975d>15919\n<9771>18123\n<9856>19054\n<9868>18947\n<9962>18367\n<999b>18124\n<99e0>18939\n<9ab6>17895\n<9f62>18105\n<9f96>19104\n<9f97>19096\n<9fa6>18852\n<9fa7>18893\n<9fa8>18900\n<9fa9>18932\n<9faa>18934\n<9fab>18936\n<9fac>18941\n<9faf>18963\n<9fb0>14005\n<9fb1>14007\n<9fb2>19039\n<9fb3>19064\n<9fc7>19126\n<9fc8>19142\n<9fc9>19146\n<9fca>19150\n<9fcb>19155\n<e001>16396\n<e00b>16406\n<e00d>16408\n<e017>16418\n<e019>16420\n<e01f>2106\n<e021>16428\n<e024>16431\n<e026>2557\n<e02f>16442\n<e031>16444\n<e046>16465\n<e05b>781\n<e062>16493\n<e063>363\n<e065>16496\n<e072>16509\n<e073>2144\n<e088>16531\n<e08b>16534\n<e09b>16550\n<e0a5>16002\n<e0a8>16563\n<e0aa>16565\n<e0af>16570\n<e0b0>18760\n<e0bb>16582\n<e0bd>16584\n<e0c4>16591\n<e0c6>16593\n<e0c9>16596\n<e0cb>18761\n<e0dd>16616\n<e0de>18762\n<e0e6>16625\n<e0ea>16629\n<e0ed>16632\n<e0f3>3107\n<e0fa>18763\n<e0fc>16646\n<e107>16657\n<e108>18764\n<e12e>6116\n<e12f>16696\n<e134>16014\n<e135>16702\n<e143>16716\n<e144>18765\n<e146>16718\n<e149>8495\n<e14b>16722\n<e14c>18766\n<e158>16734\n<e166>16385\n<e167>18768\n<e16f>18769\n<e170>16756\n<e17a>16766\n<e186>16778\n<e188>16780\n<e18a>16782\n<e191>4447\n<e192>16789\n<e194>18770\n<e1a5>16807\n<e1af>16817\n<e1b2>16820\n<e1b5>16823\n<e1b7>16825\n<e1b9>16827\n<e1ba>3193\n<e1c0>16833\n<e1c6>18774\n<e1c7>16839\n<e1c9>1219\n<e1d6>16854\n<e1e0>18775\n<e1e1>16864\n<e1f1>16880\n<e1ff>16894\n<e206>16901\n<e211>16912\n<e21a>16921\n<e229>16936\n<e22b>16938\n<e22c>6333\n<e22d>3261\n<e22e>16941\n<e230>3237\n<e232>16945\n<e23c>16955\n<e249>16968\n<e250>16975\n<e258>18777\n<e266>3278\n<e267>18778\n<e26c>17002\n<e270>17006\n<e286>15728\n<e287>17029\n<e28a>17032\n<e2a0>17054\n<e2a2>17055\n<e2a3>3716\n<e2a5>17058\n<e2ac>18780\n<e2b6>17074\n<e2b9>17077\n<e2bb>17079\n<e2bc>288\n<e2bd>17080\n<e2c0>17083\n<e2c8>17091\n<e2df>17114\n<e2e8>17123\n<e2ea>17125\n<e2ee>17129\n<e2ef>7080\n<e307>17150\n<e310>17159\n<e312>14124\n<e314>14126\n<e316>18072\n<e317>14128\n<e33a>4181\n<e33c>18073\n<e340>11752\n<e341>14169\n<e346>14174\n<e347>18075\n<e34c>18076\n<e34f>289\n<e353>14185\n<e355>18077\n<e35a>4203\n<e361>14198\n<e363>4902\n<e366>14203\n<e367>18078\n<e373>14216\n<e376>14219\n<e378>18079\n<e37a>14222\n<e37c>1643\n<e37f>4910\n<e380>14228\n<e387>14235\n<e392>14246\n<e395>14248\n<e397>14250\n<e399>14252\n<e3a1>14259\n<e3b3>14277\n<e3c4>14294\n<e3c5>3381\n<e3c6>14296\n<e3c7>18083\n<e3ce>14302\n<e3d6>14309\n<e3d7>10178\n<e3db>14314\n<e3dc>8877\n<e3e2>14321\n<e3ef>14334\n<e3f1>14336\n<e3f9>14344\n<e3fb>14346\n<e3fc>18087\n<e3fe>14349\n<e411>18088\n<e412>14368\n<e413>18089\n<e415>14370\n<e416>18090\n<e417>4940\n<e418>16377\n<e41c>14377\n<e424>14385\n<e427>14387\n<e42e>14394\n<e42f>18092\n<e43d>14409\n<e43f>14411\n<e449>14420\n<e44a>2510\n<e44b>14422\n<e44f>14426\n<e45f>14442\n<e460>18094\n<e464>14447\n<e466>14449\n<e46b>14452\n<e46d>14454\n<e470>14457\n<e473>14460\n<e475>14462\n<e477>14464\n<e478>3015\n<e479>14466\n<e47a>18098\n<e485>14057\n<e48f>18099\n<e490>14486\n<e4c5>5009\n<e4da>5796\n<e4db>14560\n<e4e5>14570\n<e4f7>14588\n<e500>14597\n<e50e>14610\n<e513>14615\n<e515>14617\n<e51b>14622\n<e525>14632\n<e526>18103\n<e527>14633\n<e52d>14638\n<e544>14661\n<e545>12402\n<e54e>18105\n<e556>14679\n<e55a>14683\n<e55d>14686\n<e56f>14704\n<e571>14706\n<e574>14709\n<e578>14713\n<e57b>14716\n<e57f>14720\n<e581>14722\n<e587>14728\n<e589>14728\n<e58a>14731\n<e591>14738\n<e5a5>14758\n<e5a9>18106\n<e5b0>14769\n<e5b6>14775\n<e5b9>14778\n<e5c1>14786\n<e5d4>284\n<e5d5>283\n<e5d6>14803\n<e5da>14807\n<e5e0>14813\n<e5e4>14817\n<e5ea>14823\n<e5eb>16300\n<e5f2>14831\n<e5f4>10620\n<e601>14846\n<e603>14848\n<e608>18108\n<e615>18109\n<e622>14877\n<e639>14900\n<e63b>14902\n<e647>14914\n<e649>14916\n<e64a>18110\n<e656>14928\n<e661>14939\n<e664>14942\n<e669>14947\n<e670>14953\n<e67a>14963\n<e67e>14967\n<e681>14970\n<e682>18112\n<e689>14977\n<e68d>14981\n<e691>14985\n<e698>14992\n<e69b>14995\n<e69d>14997\n<e6a0>15000\n<e6a5>18113\n<e6a7>15006\n<e6a8>18114\n<e6ab>18115\n<e6bf>15029\n<e6c6>7430\n<e6d9>15054\n<e6dc>15057\n<e6f8>18117\n<e6f9>15086\n<e700>15093\n<e708>15101\n<e70b>15104\n<e712>15111\n<e719>15118\n<e71c>15121\n<e726>15131\n<e727>10657\n<e728>18118\n<e743>15160\n<e750>15173\n<e75e>15187\n<e760>15189\n<e763>15192\n<e766>15195\n<e76f>15203\n<e776>18120\n<e779>15212\n<e77b>18121\n<e785>15224\n<e78a>15229\n<e78c>15231\n<e791>15236\n<e793>15238\n<e795>15240\n<e798>15243\n<e7a3>15254\n<e7c0>18122\n<e7d2>15300\n<e7d3>6171\n<e7d9>15307\n<e7db>15309\n<e7ea>15324\n<e7ec>15326\n<e7f0>15330\n<e7fd>15919\n<e7fe>15344\n<e809>15355\n<e80a>18123\n<e80b>15357\n<e80d>15359\n<e810>15362\n<e812>15364\n<e819>15371\n<e822>15380\n<e823>18124\n<e82e>15392\n<e836>15400\n<e839>15403\n<e84c>15422\n<e868>15450\n<e86b>18125\n<e884>15478\n<e890>15489\n<e893>11044\n<e8a2>15507\n<e8a8>15513\n<e8ab>15516\n<e8b7>15528\n<e8c4>15541\n<e8c6>15543\n<e8cc>15549\n<e8cf>15552\n<e8d2>15555\n<e8d4>15557\n<e8d7>15560\n<e8de>15567\n<e8e7>15576\n<e8ff>15600\n<e91d>15630\n<e92d>15646\n<e937>18126\n<e939>15658\n<e93b>15660\n<e951>15682\n<e956>15687\n<e959>15690\n<e95b>15692\n<e95f>15696\n<e962>18128\n<e963>15700\n<e969>18130\n<e96a>15705\n<e96d>15706\n<e976>18140\n<e979>18143\n<e97c>18146\n<e980>15708\n<e985>17354\n<e986>18154\n<e988>18155\n<e989>17356\n<e98b>18156\n<e98c>17402\n<e98d>18157\n<e98f>15712\n<e990>18158\n<e992>18160\n<e993>15713\n<e994>18161\n<e995>15714\n<e996>18162\n<e9a3>17357\n<e9ab>18178\n<e9ac>17361\n<e9b4>15717\n<e9b8>15718\n<e9be>15719\n<e9c1>15720\n<e9c2>18195\n<e9c3>15721\n<e9c4>18196\n<e9cc>18202\n<e9cd>15722\n<e9ce>18203\n<e9cf>17367\n<e9d2>17404\n<e9d3>15723\n<e9d4>18206\n<e9d5>15724\n<e9d6>18207\n<e9d7>17368\n<e9df>15725\n<e9e4>17369\n<e9ec>17370\n<e9f4>17372\n<e9fa>15726\n<e9fe>15727\n<ea05>15728\n<ea08>15729\n<ea10>15730\n<ea11>18256\n<ea12>17349\n<ea13>18257\n<ea14>17350\n<ea1c>15731\n<ea20>17374\n<ea24>15732\n<ea28>15733\n<ea38>17376\n<ea3b>17378\n<ea41>17379\n<ea42>18296\n<ea44>17381\n<ea4d>17375\n<ea50>15734\n<ea51>18308\n<ea52>17323\n<ea53>18309\n<ea54>17383\n<ea55>18310\n<ea56>17385\n<ea5d>17405\n<ea62>15735\n<ea77>15736\n<ea78>18341\n<ea79>15737\n<ea86>15738\n<ea8c>17327\n<ea8d>18359\n<ea8e>15739\n<ea93>17389\n<ea94>18364\n<ea95>15740\n<ea96>17390\n<ea97>18365\n<ea98>17407\n<eaa0>15741\n<eaa1>18373\n<eaa2>17393\n<eaaa>18381\n<eaab>15742\n<eaae>17395\n<eaaf>18384\n<eab0>17394\n<eab4>17400\n<eab5>17396\n<eabd>15743\n<eabe>18395\n<eac2>15744\n<eac3>18399\n<eac4>15745\n<eac6>15746\n<eac7>18401\n<eac8>17335\n<ead2>15747\n<ead5>18413\n<eadb>15748\n<eadd>15749\n<eaed>15753\n<eaef>15754\n<eaf3>15755\n<eaf7>18438\n<eafc>18442\n<eafd>15756\n<eb01>15757\n<eb06>15758\n<eb07>18450\n<eb10>15759\n<eb13>18461\n<eb14>15760\n<eb1e>15762\n<eb22>15763\n<eb24>15764\n<eb26>15765\n<eb40>12112\n<eb42>5925\n<eb45>13037\n<eb47>18496\n<eb5c>15789\n<eb5e>15791\n<eb60>15793\n<eb64>18507\n<eb66>15795\n<eb6a>15798\n<eb6c>15800\n<eb6e>10969\n<eb72>15803\n<eb75>18514\n<eb79>15806\n<eb7b>15807\n<eb7c>18517\n<eb7d>15808\n<eb82>15811\n<eb86>7188\n<eb87>15813\n<eb8b>15815\n<eb94>16890\n<eb96>15821\n<eb9e>4841\n<eba1>15826\n<eba4>15828\n<eba7>15829\n<eba9>11438\n<ebac>15833\n<ebb1>15836\n<ebb5>15838\n<ebba>6756\n<ebbb>18543\n<ebbe>15845\n<ebc3>18545\n<ebc4>15850\n<ebc9>5124\n<ebcb>15853\n<ebcf>8996\n<ebd1>15857\n<ebd2>13418\n<ebd4>15858\n<ebd6>15859\n<ebd9>15862\n<ebdc>15863\n<ebde>8849\n<ebe0>15866\n<ebea>15872\n<ebed>15873\n<ebf0>15875\n<ebf3>15877\n<ebf4>18565\n<ebfc>15884\n<ebff>15887\n<ec00>18567\n<ec01>6023\n<ec02>2399\n<ec07>15894\n<ec0a>18570\n<ec0b>15895\n<ec0d>15897\n<ec15>7833\n<ec16>15905\n<ec21>15911\n<ec23>15913\n<ec25>15915\n<ec30>15924\n<ec36>15929\n<ec4a>15939\n<ec4d>15940\n<ec4e>18591\n<ec53>15944\n<ec55>15945\n<ec59>15946\n<ec5b>9665\n<ec5e>3340\n<ec61>18603\n<ec64>18606\n<ec65>17353\n<ec66>15948\n<ec74>18619\n<ec7a>18625\n<ec7c>17397\n<ec7d>15950\n<ec7f>18628\n<ec81>18630\n<ec82>15951\n<ec83>18631\n<ec85>18633\n<ec8b>18635\n<ec8c>15956\n<ec8f>15958\n<ec90>18637\n<ec97>15962\n<ec9c>18645\n<ec9f>15965\n<eca5>15968\n<eca6>1510\n<ecac>15972\n<ecae>18654\n<ecb5>15978\n<ecb7>15980\n<ecb8>18656\n<ecdd>16014\n<ece4>18661\n<ecf1>16033\n<ed00>18662\n<ed08>18665\n<ed09>16054\n<ed0b>16055\n<ed12>16056\n<ed14>16057\n<ed19>16059\n<ed1b>16060\n<ed23>16065\n<ed28>1832\n<ed2b>16070\n<ed33>16075\n<ed34>18687\n<ed37>18688\n<ed38>16078\n<ed3c>18691\n<ed40>18693\n<ed46>16084\n<ed4c>16089\n<ed50>16091\n<ed6e>9398\n<ed76>18708\n<ed79>16123\n<ed7b>16124\n<ed7c>6150\n<ed87>16134\n<ed9e>13585\n<eda4>14661\n<eda5>18715\n<edae>18717\n<edd0>16203\n<eddc>16212\n<ede7>3970\n<ede8>18722\n<edf0>18723\n<edf4>14910\n<ee00>18724\n<ee21>16277\n<ee3e>14353\n<ee52>1522\n<ee5c>16331\n<ee7d>16363\n<ee89>18734\n<ee8e>15086\n<ee98>9341\n<ee9d>15049\n<eea0>18736\n<eeab>17336\n<f326>18798\n<f345>18829\n<f3a3>17718\n<f3ad>17347\n<f3b1>17306\n<f3e4>17314\n<f3e9>17388\n<f3ea>17777\n<f3eb>17387\n<f3ec>17778\n<f3fb>17790\n<f3fd>17792\n<f40c>17805\n<f40d>17340\n<f417>17308\n<f418>17815\n<f419>17310\n<f41a>17816\n<f41b>17311\n<f41f>17313\n<f420>17820\n<f421>17315\n<f438>17321\n<f43e>17161\n<f443>17166\n<f445>17168\n<f447>17170\n<f44a>17846\n<f44c>17175\n<f453>17182\n<f464>17199\n<f473>17214\n<f47a>17221\n<f47f>17226\n<f482>17229\n<f487>17234\n<f492>17245\n<f493>17856\n<f494>17247\n<f496>17249\n<f4ae>17273\n<f4b1>17858\n<f4c2>17371\n<f4c6>17864\n<f4cb>17869\n<f4d6>17879\n<f4d8>17881\n<f4e1>17295\n<f4ea>17301\n<f4f4>17304\n<f4f5>17348\n<f4fb>17319\n<f4fd>17903\n<f502>17324\n<f504>17909\n<f506>17911\n<f512>17923\n<f517>17928\n<f51e>17935\n<f53c>17635\n<f554>17659\n<f57d>18855\n<f585>18863\n<f5a0>18889\n<f5ab>18900\n<f5b0>18905\n<f5b4>18909\n<f5b6>18911\n<f5b9>18914\n<f5bd>18917\n<f5cc>18932\n<f5ce>18934\n<f5d0>18936\n<f5e0>18949\n<f5e4>18952\n<f5ef>18963\n<f636>17338\n<f63c>17339\n<f63d>17312\n<f63e>17341\n<f642>17342\n<f64a>17343\n<f64e>17344\n<f64f>17981\n<f650>17345\n<f657>17346\n<f65a>17337\n<f65b>17325\n<f668>17351\n<f675>17352\n<f6ac>17401\n<f6e4>558\n<f6e6>560\n<f7e7>14001\n<f7e9>14003\n<f7ec>14006\n<f82a>18846\n<f833>18847\n<f83b>18848\n<f907>17686\n<fa12>16828\n<fa26>14465\n<fa48>16997\n<fa5b>14224\n<fe13>14104\n<fe14>14103\n<fe15>14106\n<fe16>14105\n<fe19>13646\n<fe51>113\n<fe68>258\n<ff5e>228\n<ffe3>196\n<ffe5>260\n<ffed>14096\nendcidchar\nbegincidrange\n<23da><23db>18844\n<2f01><2f03>536\n<2f08><2f0b>603\n<2f0c><2f0e>541\n<2f17><2f18>612\n<2f1f><2f20>634\n<2f23><2f26>636\n<2f28><2f2b>642\n<2f2f><2f30>648\n<2f31><2f32>652\n<2f34><2f35>552\n<2f36><2f38>654\n<2f39><2f3a>554\n<2f3c><2f3f>720\n<2f42><2f45>726\n<2f47><2f4d>730\n<2f4f><2f52>737\n<2f54><2f58>741\n<2f5a><2f5d>746\n<2f5e><2f64>854\n<2f67><2f68>558\n<2f69><2f70>867\n<2f72><2f74>875\n<2f75><2f78>1014\n<2f7a><2f7c>1018\n<2f7d><2f81>1022\n<2f82><2f8a>1029\n<2f8d><2f90>1039\n<2f92><2f97>1288\n<2f99><2fa0>1294\n<2fa3><2fa5>1312\n<2fa6><2fa9>1686\n<2fab><2fac>1695\n<2faf><2fb9>2086\n<2fba><2fbc>2549\n<2fc0><2fc1>2553\n<2fc2><2fc7>3041\n<2fc8><2fca>3515\n<2fcd><2fcf>3963\n<2fd0><2fd1>4352\n<2fd3><2fd4>5042\n<3038><303a>362\n<31c0><31c4>17609\n<31c6><31c7>17618\n<31c9><31cc>17624\n<31cd><31ce>17629\n<9fad><9fae>18960\n<e004><e008>16399\n<e00f><e011>16410\n<e027><e02c>16434\n<e039><e03a>16452\n<e03d><e044>16456\n<e047><e048>18758\n<e049><e04b>16468\n<e04d><e059>16472\n<e05d><e05e>16488\n<e067><e06b>16498\n<e06d><e070>16504\n<e076><e077>16513\n<e079><e07c>16516\n<e07e><e086>16521\n<e08d><e092>16536\n<e095><e098>16544\n<e09f><e0a4>16554\n<e0ac><e0ad>16567\n<e0b1><e0b9>16572\n<e0bf><e0c2>16586\n<e0cc><e0cf>16599\n<e0d1><e0d3>16604\n<e0d6><e0db>16609\n<e0e0><e0e1>16619\n<e0ef><e0f1>16634\n<e0f4><e0f7>16639\n<e0fe><e102>16648\n<e104><e105>16654\n<e10c><e10f>16661\n<e111><e113>16666\n<e116><e11b>16671\n<e11e><e120>16679\n<e122><e125>16683\n<e129><e12d>16690\n<e132><e133>16699\n<e137><e138>16704\n<e13a><e140>16707\n<e14e><e14f>16724\n<e151><e153>16727\n<e15b><e15c>16737\n<e15e><e161>16739\n<e163><e165>16744\n<e16b><e16e>16752\n<e173><e174>16759\n<e176><e177>16762\n<e17d><e17e>16769\n<e181><e184>16773\n<e18c><e18e>16784\n<e197><e19e>16793\n<e1a1><e1a3>16803\n<e1a7><e1a9>16809\n<e1ab><e1ad>16813\n<e1c2><e1c3>16835\n<e1ca><e1cb>16842\n<e1ce><e1d3>16846\n<e1d8><e1d9>16856\n<e1db><e1dc>16859\n<e1de><e1df>16862\n<e1e3><e1e5>16866\n<e1e7><e1ea>16870\n<e1ec><e1ee>16875\n<e1f3><e1f6>16882\n<e1f8><e1f9>16887\n<e1fb><e1fd>16890\n<e203><e204>16898\n<e208><e209>16903\n<e20d><e20f>16908\n<e217><e218>16918\n<e21d><e21e>16924\n<e222><e225>16929\n<e234><e236>16947\n<e238><e23a>16951\n<e23f><e244>16958\n<e246><e247>16965\n<e255><e257>16980\n<e259><e260>16984\n<e262><e265>16993\n<e269><e26a>16999\n<e272><e279>17008\n<e27b><e27c>17017\n<e27e><e281>17020\n<e283><e285>17025\n<e28c><e28f>17034\n<e292><e293>17040\n<e297><e298>17045\n<e29c><e29e>17050\n<e2a7><e2ab>17060\n<e2ad><e2b1>17065\n<e2c2><e2c6>17085\n<e2ca><e2d3>17093\n<e2d5><e2d7>17104\n<e2da><e2dd>17109\n<e2e3><e2e6>17118\n<e2f2><e2f7>17131\n<e2f9><e2fb>17138\n<e2fd><e2fe>17142\n<e302><e305>17145\n<e309><e30b>17152\n<e30d><e30e>17156\n<e319><e31a>14130\n<e31d><e31e>14134\n<e320><e324>14137\n<e326><e32b>14143\n<e32d><e32f>14150\n<e332><e334>14155\n<e337><e339>14160\n<e33e><e33f>14166\n<e343><e344>14171\n<e349><e34b>14176\n<e34d><e34e>14180\n<e350><e351>14182\n<e356><e359>14187\n<e35d><e35f>14194\n<e368><e36e>14205\n<e370><e371>14213\n<e37d><e37e>14225\n<e383><e385>14231\n<e38b><e38c>14239\n<e38e><e390>14242\n<e39c><e39d>14255\n<e3a3><e3a4>14261\n<e3aa><e3ab>14268\n<e3ad><e3b0>14271\n<e3b6><e3b8>14280\n<e3be><e3c2>14288\n<e3c9><e3cb>14298\n<e3d0><e3d4>14304\n<e3dd><e3e0>14316\n<e3e4><e3e6>14323\n<e3e8><e3ec>14327\n<e3f5><e3f7>14340\n<e400><e408>14351\n<e40c><e410>14363\n<e419><e41a>14374\n<e41f><e422>14380\n<e429><e42b>14389\n<e430><e431>14396\n<e433><e435>14399\n<e437><e439>14403\n<e442><e443>14414\n<e445><e447>14417\n<e452><e458>14429\n<e45b><e45c>14438\n<e47b><e47d>14467\n<e480><e483>14472\n<e48b><e48c>14482\n<e493><e494>14489\n<e498><e4a0>14494\n<e4a5><e4aa>14506\n<e4ac><e4ae>14513\n<e4b0><e4b2>14517\n<e4bb><e4c0>14528\n<e4c2><e4c4>14535\n<e4c7><e4c8>14540\n<e4ca><e4cc>14543\n<e4cf><e4d5>14548\n<e4d7><e4d8>14556\n<e4de><e4e3>14563\n<e4e9><e4ed>14574\n<e4f0><e4f5>14581\n<e4fa><e4fe>14591\n<e503><e504>14600\n<e506><e509>14603\n<e50b><e50c>14608\n<e510><e511>14612\n<e517><e519>14618\n<e522><e523>14629\n<e530><e536>14641\n<e538><e53d>14649\n<e53f><e542>14656\n<e546><e54a>14663\n<e54c><e54d>14669\n<e54f><e553>14672\n<e560><e561>14689\n<e563><e565>14692\n<e568><e56c>14697\n<e595><e599>14742\n<e59b><e59c>14748\n<e5a2><e5a3>14755\n<e5ab><e5ae>14764\n<e5b3><e5b4>14772\n<e5bc><e5bd>14781\n<e5c3><e5c7>14788\n<e5ca><e5d1>14795\n<e5d2><e5d3>281\n<e5dd><e5de>14810\n<e5e7><e5e8>14820\n<e5ec><e5ed>14825\n<e5f5><e5fa>14834\n<e5fd><e5ff>14842\n<e605><e607>14850\n<e609><e60e>14853\n<e613><e614>14863\n<e616><e618>14865\n<e61d><e620>14872\n<e625><e626>14880\n<e628><e62a>14883\n<e62c><e631>14887\n<e635><e636>14896\n<e63d><e63e>14904\n<e643><e644>14910\n<e64c><e64d>14918\n<e650><e651>14922\n<e65a><e65c>14932\n<e66b><e66d>14948\n<e672><e675>14955\n<e693><e695>14987\n<e6a3><e6a4>15003\n<e6a9><e6aa>15008\n<e6ae><e6b1>15012\n<e6b3><e6b8>15017\n<e6bb><e6bc>15025\n<e6c2><e6c4>15032\n<e6c8><e6c9>15037\n<e6cb><e6d0>15040\n<e6d3><e6d6>15048\n<e6e2><e6e3>15063\n<e6e7><e6ed>15068\n<e6ef><e6f1>15076\n<e6f4><e6f6>15081\n<e6fd><e6fe>15090\n<e703><e705>15096\n<e70d><e70f>15106\n<e714><e716>15113\n<e71e><e723>15123\n<e729><e72a>15134\n<e72c><e72e>15137\n<e730><e732>15141\n<e738><e73b>15149\n<e73e><e73f>15155\n<e745><e746>15162\n<e748><e74c>15165\n<e753><e75a>15176\n<e76a><e76b>15198\n<e771><e774>15205\n<e77e><e783>15217\n<e787><e788>15226\n<e78e><e78f>15233\n<e79a><e7a1>15245\n<e7aa><e7b0>15261\n<e7b2><e7b3>15269\n<e7b5><e7b7>15272\n<e7b9><e7bb>15276\n<e7bd><e7bf>15280\n<e7c1><e7c3>15283\n<e7c5><e7c9>15287\n<e7cb><e7cd>15293\n<e7cf><e7d0>15297\n<e7d4><e7d7>15302\n<e7de><e7e3>15312\n<e7e5><e7e6>15319\n<e7f4><e7f7>15334\n<e7f9><e7fa>15339\n<e803><e807>15349\n<e814><e815>15366\n<e81b><e820>15373\n<e824><e826>15382\n<e829><e82c>15387\n<e830><e834>15394\n<e83c><e840>15406\n<e843><e84a>15413\n<e84f><e850>15425\n<e852><e854>15428\n<e859><e85a>15435\n<e85e><e85f>15440\n<e863><e864>15445\n<e86d><e870>15454\n<e872><e877>15459\n<e879><e87c>15466\n<e880><e883>15473\n<e885><e886>15478\n<e888><e88e>15481\n<e896><e899>15495\n<e89b><e89c>15500\n<e89e><e89f>15503\n<e8b1><e8b4>15522\n<e8b9><e8bc>15530\n<e8c8><e8ca>15545\n<e8db><e8dc>15564\n<e8e2><e8e4>15571\n<e8eb><e8ec>15580\n<e8ee><e8f0>15583\n<e8f3><e8f4>15588\n<e8f6><e8fa>15591\n<e8fc><e8fd>15597\n<e901><e902>15602\n<e904><e906>15605\n<e909><e90b>15610\n<e90d><e916>15614\n<e919><e91b>15626\n<e923><e924>15636\n<e930><e932>15649\n<e93f><e940>15664\n<e942><e943>15667\n<e946><e947>15671\n<e949><e94c>15674\n<e94e><e94f>15679\n<e965><e966>15702\n<e96b><e96c>18131\n<e970><e972>18135\n<e97e><e97f>18148\n<e983><e984>18152\n<e997><e998>15715\n<e999><e9a2>18163\n<e9a4><e9a8>18173\n<e9a9><e9aa>17358\n<e9ad><e9af>18179\n<e9b1><e9b3>18182\n<e9b5><e9b7>18185\n<e9b9><e9bd>18188\n<e9bf><e9c0>18193\n<e9c5><e9c6>17365\n<e9c7><e9ca>18197\n<e9d0><e9d1>18204\n<e9d8><e9de>18208\n<e9e0><e9e3>18215\n<e9e5><e9eb>18219\n<e9ed><e9ee>18226\n<e9f0><e9f3>18229\n<e9f5><e9f9>18233\n<e9fb><e9fd>18238\n<e9ff><ea04>18241\n<ea06><ea07>18247\n<ea09><ea0f>18249\n<ea15><ea1b>18258\n<ea1d><ea1f>18265\n<ea21><ea23>18268\n<ea25><ea27>18271\n<ea29><ea37>18274\n<ea39><ea3a>18289\n<ea3c><ea40>18291\n<ea45><ea4c>18298\n<ea4e><ea4f>18306\n<ea57><ea5c>18311\n<ea5e><ea61>18317\n<ea63><ea76>18321\n<ea7a><ea85>18342\n<ea87><ea8b>18354\n<ea8f><ea92>18360\n<ea99><ea9f>18366\n<eaa3><eaa8>18374\n<eaac><eaad>18382\n<eab1><eab3>18385\n<eab6><eabc>18388\n<eacd><eace>18406\n<eae4><eae6>15750\n<eb16><eb17>18463\n<eb28><eb29>15766\n<eb3a><eb3c>15768\n<eb48><eb49>15777\n<eb51><eb52>15783\n<eb91><eb92>15817\n<eb9c><eb9d>18532\n<ebb7><ebb8>15840\n<ebc0><ebc1>15847\n<ebe2><ebe3>15867\n<ebe5><ebe6>15869\n<ebf7><ebf8>15879\n<ec03><ec04>15890\n<ec11><ec12>15901\n<ec1e><ec1f>15909\n<ec27><ec29>15917\n<ec33><ec34>15926\n<ec38><ec3a>15931\n<ec3d><ec3e>15936\n<ec50><ec51>15942\n<ec77><ec78>18622\n<ec87><ec8a>15952\n<eca1><eca2>15966\n<eca9><ecaa>15970\n<ecb0><ecb3>15974\n<ecbc><ecce>15981\n<ecd0><ecd3>16001\n<ecd5><ecda>16006\n<ece2><ece3>16018\n<ece6><ecef>16022\n<ecf3><ecf4>16035\n<ecf6><ecfb>16038\n<ecfd><ecff>16045\n<ed01><ed03>16049\n<ed05><ed06>16052\n<ed1f><ed21>16062\n<ed2e><ed30>16072\n<ed31><ed32>18685\n<ed35><ed36>16076\n<ed39><ed3a>18689\n<ed3e><ed3f>16080\n<ed43><ed44>16082\n<ed48><ed49>16086\n<ed55><ed56>16093\n<ed59><ed5e>16095\n<ed60><ed61>16102\n<ed63><ed6a>16105\n<ed6c><ed6d>16114\n<ed6f><ed70>16117\n<ed73><ed74>16120\n<ed7d><ed80>16126\n<ed82><ed83>16130\n<ed8c><ed8d>16137\n<ed8f><ed90>16140\n<ed92><ed9d>16143\n<ed9f><eda3>16156\n<eda7><edad>16163\n<edaf><edc5>16170\n<edc7><edce>16194\n<edd2><edd6>16204\n<edd8><edd9>16209\n<edde><ede0>16213\n<ede2><ede6>16217\n<ede9><edec>16224\n<edee><edef>16229\n<edf1><edf3>16232\n<edf5><edff>16236\n<ee01><ee07>16247\n<ee09><ee10>16255\n<ee12><ee14>16264\n<ee16><ee1a>16267\n<ee1c><ee1f>16272\n<ee23><ee29>16278\n<ee2b><ee2f>16286\n<ee32><ee33>16292\n<ee35><ee3d>16295\n<ee3f><ee47>16305\n<ee49><ee51>16314\n<ee53><ee55>16324\n<ee57><ee5a>16327\n<ee5e><ee5f>16333\n<ee61><ee63>16335\n<ee65><ee69>16339\n<ee6b><ee75>16345\n<ee77><ee7b>16357\n<ee7f><ee88>16364\n<ee8a><ee8d>16374\n<ee8f><ee90>16379\n<ee92><ee97>16382\n<ee99><ee9b>16389\n<ee9e><ee9f>16393\n<eeb2><eeb3>18752\n<eeb5><eeb6>18755\n<f319><f324>18785\n<f328><f343>18800\n<f347><f349>18831\n<f3a6><f3a9>17719\n<f3ae><f3b0>17724\n<f3b2><f3e3>17727\n<f3ee><f3ef>17779\n<f3f3><f3f8>17782\n<f3ff><f401>17793\n<f403><f407>17796\n<f40e><f416>17806\n<f41c><f41e>17817\n<f422><f427>17821\n<f428><f429>17317\n<f42a><f437>17827\n<f439><f43c>17841\n<f44e><f44f>17177\n<f458><f459>17187\n<f467><f468>17202\n<f46a><f46b>17205\n<f470><f471>17211\n<f475><f476>17216\n<f489><f48a>17236\n<f499><f49a>17252\n<f49c><f49d>17255\n<f49f><f4a2>17258\n<f4ab><f4ac>17270\n<f4b5><f4b6>17280\n<f4eb><f4ed>17890\n<f4f0><f4f1>17894\n<f4f6><f4f7>17897\n<f4f9><f4fa>17900\n<f527><f529>17944\n<f52b><f532>17948\n<f535><f537>17958\n<f538><f539>17631\n<f53e><f54d>17637\n<f54f><f552>17654\n<f557><f558>17661\n<f55b><f55d>17665\n<f55f><f564>17669\n<f566><f56a>17676\n<f56c><f571>17682\n<f573><f575>17689\n<f579><f57b>18851\n<f580><f583>18858\n<f58b><f58f>18869\n<f593><f594>18877\n<f596><f597>18880\n<f59b><f59c>18884\n<f5a3><f5a4>18892\n<f5bf><f5c0>18919\n<f5c4><f5c5>18924\n<f5d5><f5d9>18941\n<f5e6><f5e8>18954\n<f5ea><f5ed>18958\n<f634><f635>17961\n<f637><f63b>17963\n<f63f><f641>17968\n<f643><f649>17971\n<f64b><f64d>17978\n<f651><f656>17982\n<f658><f659>17988\n<f65c><f667>17990\n<f669><f674>18002\n<f676><f693>18014\n<f695><f69d>18045\n<f69f><f6ab>18055\n<f6ae><f6af>18069\n<f6b1><f6ce>506\n<f6cf><f6de>537\n<f6e0><f6e2>554\n<f6e8><f6ed>13747\n<f6f0><f7e4>13754\n<f817><f81d>14049\n<f81e><f820>17606\n<f821><f829>17692\n<f82b><f832>17701\n<f834><f83a>17709\n<f83f><f848>18834\n<fe10><fe12>14099\n<ffe0><ffe1>262\nendcidrange\nbegincidchar\n<020021>15861\n<02003e>14929\n<020046>14930\n<02004e>15193\n<020068>14218\n<020086>17636\n<020087>17688\n<02008a>14002\n<020094>18396\n<0200ca>17623\n<0200cb>17620\n<0200cc>14000\n<0200cd>17617\n<0200d1>17616\n<0200ee>18749\n<02010c>17614\n<02010e>17628\n<020118>16777\n<0201a4>19047\n<0201a9>17235\n<0201ab>14776\n<0201c1>16714\n<0201d4>15153\n<0201f2>16228\n<020204>16656\n<02020c>14787\n<020214>18139\n<020239>19051\n<02025b>15161\n<020274>14521\n<020275>14785\n<020299>15146\n<02029e>16735\n<0202a0>16415\n<0202b7>18397\n<0202bf>15458\n<0202c0>14783\n<0202e5>16447\n<02030a>14779\n<020325>18068\n<020341>17169\n<020345>14847\n<020346>15776\n<020347>16430\n<02037e>16427\n<02037f>18107\n<020380>16429\n<0203a0>18398\n<0203a7>15538\n<0203b5>18776\n<0203c9>16874\n<0203cb>14777\n<0203f5>15613\n<0203fc>18719\n<020413>14879\n<020414>14780\n<02041f>16432\n<020465>14770\n<020487>16441\n<02048e>16101\n<020491>14816\n<020492>14815\n<0204a3>14814\n<0204d7>18400\n<0204fc>17241\n<0204fe>15548\n<020547>16395\n<02058e>16449\n<0205a5>16660\n<0205b3>16454\n<0205c3>18779\n<0205ca>15788\n<0205d0>17803\n<0205d5>18402\n<0205df>16397\n<0205e0>14812\n<0205eb>15056\n<020611>15790\n<020615>18403\n<020619>18142\n<02061a>15561\n<020630>14571\n<020656>16761\n<020676>18404\n<02070e>14819\n<020731>17232\n<020779>15805\n<02082c>15200\n<020873>14822\n<0208d5>18141\n<020916>15191\n<020923>16889\n<020954>16491\n<020979>18695\n<0209e7>17781\n<020a11>15855\n<020a50>14441\n<020a6f>19022\n<020a8a>19100\n<020ab4>15590\n<020ac2>18408\n<020acd>18409\n<020b0d>18081\n<020b8f>16530\n<020b9f>19057\n<020ba8>14760\n<020ba9>17875\n<020bbf>18410\n<020bc6>14849\n<020bcb>18412\n<020be2>16495\n<020beb>15562\n<020bfb>18414\n<020bff>16445\n<020c0b>17848\n<020c0d>15154\n<020c20>14828\n<020c34>17291\n<020c3a>17038\n<020c3b>18415\n<020c41>16012\n<020c42>17163\n<020c43>17228\n<020c53>18416\n<020c65>18417\n<020c77>16535\n<020c78>15804\n<020c7c>18418\n<020c8d>18419\n<020c96>16013\n<020c9c>18629\n<020cb5>18420\n<020cb8>15563\n<020ccf>18228\n<020cd3>16698\n<020cd4>16216\n<020cd5>17185\n<020cd6>17910\n<020cdd>18421\n<020ced>18422\n<020cff>15559\n<020d15>17164\n<020d28>16135\n<020d31>14481\n<020d32>16920\n<020d46>17196\n<020d47>17871\n<020d48>17876\n<020d49>18658\n<020d4c>15144\n<020d4d>16551\n<020d4e>16621\n<020d6f>18423\n<020d71>16136\n<020d74>16543\n<020d7c>17183\n<020d96>17855\n<020d9c>17254\n<020da7>16037\n<020db2>18424\n<020dc8>18425\n<020e04>18426\n<020e09>17264\n<020e0a>18682\n<020e0d>14761\n<020e0e>18427\n<020e0f>17905\n<020e10>17914\n<020e11>17929\n<020e16>14275\n<020e1d>14832\n<020e4c>17873\n<020e6d>18647\n<020e73>18431\n<020e75>16824\n<020e76>16015\n<020e77>17906\n<020e78>17915\n<020e79>17920\n<020e7a>17290\n<020e7b>17933\n<020e8c>17866\n<020e96>17189\n<020e98>17887\n<020e9d>16000\n<020ea2>16017\n<020eaa>17868\n<020eab>17874\n<020eac>18676\n<020eb6>16104\n<020ed7>18428\n<020ed8>18071\n<020edd>16549\n<020ef8>15878\n<020ef9>16058\n<020efa>17904\n<020efb>17907\n<020f1d>15506\n<020f26>15358\n<020f2d>18430\n<020f2e>17888\n<020f30>17870\n<020f31>17859\n<020f3b>16338\n<020f4c>17243\n<020f64>17191\n<020f8d>17867\n<020f90>18429\n<020fad>17882\n<020fb4>17184\n<020fb5>17932\n<020fb6>17936\n<020fbc>18432\n<020fdf>14759\n<020fea>18657\n<020feb>18679\n<020fec>18681\n<020fed>18683\n<021014>14424\n<02104f>18434\n<02105c>18433\n<02106f>17853\n<021075>16021\n<021076>18435\n<021077>17852\n<021078>17916\n<02107b>17328\n<021088>18436\n<021096>18437\n<02109d>17251\n<0210b4>16566\n<0210bf>18439\n<0210c0>17877\n<0210c1>18663\n<0210c7>17296\n<0210c8>17268\n<0210c9>17913\n<0210cf>17861\n<0210d3>17330\n<0210e4>14830\n<0210f4>17847\n<02112f>18440\n<02113b>18441\n<02113d>17878\n<021145>17717\n<021148>17917\n<02114f>17872\n<021180>17937\n<021187>18684\n<0211d9>18673\n<02123c>16603\n<02124f>16583\n<02127c>14504\n<0212a8>14725\n<0212a9>18707\n<0212b0>15634\n<0212e3>18443\n<0212fe>17332\n<021302>15399\n<021303>14882\n<021304>15698\n<021305>16417\n<021336>18445\n<02133a>16717\n<021375>18444\n<021376>18781\n<02138e>16787\n<021398>15638\n<02139c>15596\n<0213c5>15900\n<0213c6>14726\n<0213ed>15922\n<0213fe>14724\n<021413>15509\n<021416>16592\n<021424>15539\n<02143f>18943\n<021452>15629\n<021454>16594\n<021455>17919\n<02148a>14249\n<021497>16956\n<0214b6>14727\n<0214e8>15402\n<0214fd>14260\n<021577>18446\n<021582>14337\n<021596>16511\n<02160a>15896\n<021613>16512\n<021619>18447\n<02163e>16615\n<021661>14217\n<021692>16618\n<0216b8>16647\n<0216ba>18405\n<0216c0>14721\n<0216c1>17128\n<0216c2>15568\n<0216d3>14580\n<0216d5>16631\n<0216df>14402\n<0216e6>15140\n<0216e7>17043\n<0216e8>16503\n<0216fa>14860\n<0216fb>14714\n<0216fc>14974\n<0216fe>14903\n<02170d>16548\n<021710>14862\n<021726>16497\n<02173a>15659\n<02173b>14915\n<02173c>15673\n<021757>15470\n<02176c>18711\n<02176d>16193\n<02176e>15148\n<02176f>14861\n<021770>16779\n<021771>16703\n<021773>14266\n<021774>14717\n<0217ab>14913\n<0217b0>15175\n<0217b1>15883\n<0217b2>16627\n<0217b3>15666\n<0217b4>14276\n<0217b5>15493\n<0217c3>18448\n<0217c7>18449\n<0217d9>15536\n<0217da>15296\n<0217db>15663\n<0217dc>16624\n<0217df>18134\n<0217ef>14705\n<0217f5>18638\n<0217f6>18650\n<0217f8>14712\n<0217f9>14197\n<0217fa>15566\n<0217fb>16626\n<0217fc>16788\n<021820>15886\n<021828>16630\n<021829>16812\n<02182a>14979\n<02182d>18451\n<021839>14715\n<02183a>17941\n<02183b>18728\n<021840>15235\n<021845>15275\n<021852>15570\n<02185e>14251\n<021861>14870\n<021862>15587\n<021863>14616\n<021864>15100\n<021877>18767\n<02187b>18651\n<021883>15578\n<021884>14808\n<021885>14710\n<02189e>17076\n<02189f>15527\n<0218a0>14901\n<0218a1>15237\n<0218a2>14343\n<0218be>14707\n<0218bf>15577\n<0218d1>14718\n<0218d6>15505\n<0218d7>16561\n<0218d8>15239\n<0218d9>14965\n<0218fa>14685\n<021905>15669\n<021910>14416\n<021911>16645\n<021912>15016\n<021915>14526\n<02191c>15832\n<021922>14747\n<021927>14912\n<02193b>14636\n<021944>18742\n<021958>16897\n<02196a>18452\n<02197c>14894\n<021980>18872\n<021983>16451\n<021988>17078\n<021996>14893\n<0219db>16407\n<0219f3>14869\n<021a2d>18453\n<021a34>16658\n<021a45>18454\n<021a4b>17082\n<021a63>18998\n<021b44>16665\n<021bc1>17633\n<021bc2>18380\n<021c2a>18455\n<021c70>18456\n<021ca2>18677\n<021ca5>16669\n<021cac>18457\n<021d46>18732\n<021d53>19089\n<021d5e>19010\n<021d90>15823\n<021db6>18905\n<021dba>14907\n<021dca>17802\n<021dd1>16142\n<021deb>14991\n<021df9>16677\n<021e1c>17117\n<021e23>19043\n<021e37>16678\n<021e3d>18773\n<021e89>14471\n<021ea4>16682\n<021ea8>15792\n<021ec8>18458\n<021ed5>18459\n<021f0f>16139\n<021f15>18460\n<021f6a>16731\n<021f9e>18144\n<021fa1>15938\n<021fe8>17621\n<022045>18462\n<022049>16688\n<02207e>18889\n<02209a>15782\n<0220c7>17275\n<0220fc>16446\n<02212a>16879\n<02215b>18104\n<022173>16689\n<02217a>15874\n<0221a1>17854\n<0221c1>19058\n<0221c3>15799\n<022208>17287\n<02227c>18465\n<022321>15292\n<022325>14451\n<0223bd>15635\n<0223d0>16720\n<0223d7>18466\n<0223fa>18467\n<022465>18696\n<022471>16721\n<02248b>16905\n<022491>16923\n<0224b0>18632\n<0224bc>19141\n<0224c1>19143\n<0224c9>19144\n<0224cc>19145\n<0224ed>16419\n<022513>16425\n<02251b>16294\n<022530>16448\n<022554>16644\n<02258d>15871\n<0225af>14924\n<0225be>14925\n<02261b>14931\n<02261c>17144\n<02262b>14921\n<022668>16733\n<02267a>18100\n<022696>17880\n<022698>16553\n<0226f4>18667\n<0226f5>15157\n<0226f6>14245\n<022712>18909\n<022714>14234\n<02271b>15837\n<02271f>15404\n<02272a>18468\n<022775>17257\n<022781>15411\n<022796>19029\n<0227b4>16743\n<0227b5>17912\n<0227cd>16893\n<022803>17862\n<02285f>16765\n<022860>14920\n<022871>18469\n<0228ad>17057\n<0228c1>16772\n<0228f7>16834\n<022926>15881\n<022939>17863\n<02294f>18470\n<022967>18471\n<02296b>15412\n<022980>16771\n<022993>18472\n<022a66>17250\n<022acf>17265\n<022ad5>18473\n<022ae6>17804\n<022ae8>18474\n<022b0e>18475\n<022b22>14943\n<022b3f>18476\n<022b43>16032\n<022b6a>14941\n<022bca>17219\n<022bce>17293\n<022c26>15511\n<022c27>14350\n<022c38>17176\n<022c4c>18477\n<022c51>17294\n<022c55>17886\n<022c62>16016\n<022c88>18478\n<022c9b>14935\n<022ca1>14954\n<022ca9>17192\n<022cb2>17278\n<022cb7>18479\n<022cc2>17201\n<022cc6>17167\n<022cc9>17857\n<022d07>14936\n<022d08>18481\n<022d12>18482\n<022d44>17210\n<022d4c>17851\n<022d67>14952\n<022d8d>17238\n<022d95>18484\n<022da0>18680\n<022da3>16533\n<022da4>17922\n<022db7>18483\n<022dee>17896\n<022e0d>16781\n<022e36>16790\n<022e42>18485\n<022e78>14946\n<022e8b>17286\n<022eb3>16034\n<022eef>18084\n<022f74>18486\n<022fcc>18487\n<022fe3>15633\n<023033>18488\n<023044>17024\n<02304b>16950\n<023066>18489\n<02307d>14611\n<02307e>18772\n<02308e>14959\n<0230b7>14546\n<0230bc>14547\n<0230da>18706\n<023103>14978\n<02313d>17957\n<02317d>14278\n<023182>14983\n<0231b3>14969\n<0231c8>16831\n<0231c9>15471\n<0231ea>19099\n<0231f9>16922\n<02320f>14982\n<023225>15325\n<02322f>15923\n<023231>16829\n<023232>15105\n<023233>16450\n<023234>14980\n<023256>19028\n<02325e>19101\n<023262>14448\n<023281>18869\n<023289>14968\n<02328a>16569\n<0232ab>14962\n<0232ac>17124\n<0232ad>14960\n<0232d2>14993\n<0232e0>14964\n<0232e1>14994\n<023300>15707\n<02330a>14527\n<02331f>18490\n<0233b4>16443\n<0233cc>15819\n<0233de>18491\n<0233e6>16852\n<0233f4>17883\n<0233f5>18730\n<0233f9>18911\n<0233fa>15644\n<0233fe>15002\n<023400>16816\n<02343f>15209\n<023450>14944\n<02346f>16855\n<023472>14908\n<0234e5>15639\n<023519>15864\n<023530>14265\n<023551>19037\n<02355a>14279\n<023567>18492\n<023595>14804\n<023599>14708\n<02359c>15451\n<0235bb>19148\n<0235cd>16861\n<0235ce>14287\n<0235cf>15194\n<0235f3>18493\n<023600>16423\n<023617>18982\n<02361a>18494\n<02363c>16865\n<023640>15452\n<023659>16878\n<02365f>15059\n<023677>18748\n<02368e>19131\n<02369e>19090\n<0236a6>14729\n<0236ad>15647\n<0236ba>18659\n<0236df>15641\n<0236ee>14739\n<023703>16881\n<023716>18495\n<023720>18703\n<02372d>16471\n<02372f>15898\n<02373f>14750\n<023766>14220\n<023781>15110\n<0237a2>15001\n<0237bc>14999\n<0237c2>16840\n<0237d5>15010\n<0237d6>15643\n<0237d7>15448\n<02383a>14998\n<0239c2>17269\n<023aa7>18497\n<023adb>16895\n<023aee>14895\n<023afa>18138\n<023b1a>19033\n<023b5a>16900\n<023c63>18914\n<023c99>16455\n<023c9a>15024\n<023c9b>14478\n<023cb5>18085\n<023cb7>15963\n<023cc7>18738\n<023cc8>16409\n<023cc9>16917\n<023cfc>18674\n<023cfd>18720\n<023cfe>18697\n<023cff>15794\n<023d40>15979\n<023d5b>15582\n<023d7e>14258\n<023d8f>15242\n<023db6>18701\n<023db7>15514\n<023db8>15405\n<023db9>14361\n<023dba>15147\n<023dbb>14446\n<023dbc>16911\n<023dbd>16913\n<023de3>14237\n<023df8>14267\n<023e06>18999\n<023e11>18498\n<023e2c>18705\n<023e2d>15609\n<023e2e>14505\n<023e2f>16944\n<023e30>16954\n<023e31>14734\n<023e39>14805\n<023e88>18648\n<023e89>14809\n<023e8a>14794\n<023e8b>14283\n<023eb9>18499\n<023ebf>14806\n<023ed7>14123\n<023ef7>18704\n<023ef8>15058\n<023ef9>15683\n<023efa>15136\n<023efb>14736\n<023efc>16902\n<023f35>15067\n<023f41>18054\n<023f4a>15809\n<023f61>19000\n<023f7f>15036\n<023f80>16490\n<023f81>15935\n<023f82>16946\n<023f8f>18091\n<023fb4>16973\n<023fb7>16764\n<023fc0>15023\n<023fc5>16398\n<023feb>16532\n<023fec>16492\n<023fed>15608\n<023fee>15333\n<023fef>15835\n<023ff0>16972\n<024011>16381\n<024039>16971\n<02403a>16562\n<02403b>15786\n<02403c>15039\n<02403d>16957\n<024057>14192\n<024085>16934\n<02408b>14752\n<02408c>18771\n<02408d>14841\n<024091>16969\n<0240c9>14845\n<0240e1>14751\n<0240ec>19042\n<024104>15427\n<02410f>14753\n<024119>18500\n<02413f>16974\n<024140>16978\n<024144>16967\n<02414e>18855\n<024155>16970\n<02415c>14572\n<02415f>17071\n<024161>19097\n<024177>17942\n<02417a>15908\n<0241a3>18669\n<0241a4>16914\n<0241a5>16585\n<0241ac>15488\n<0241b5>15480\n<0241cd>16844\n<0241e2>17042\n<0241fc>15670\n<02421b>15354\n<02424b>18102\n<024256>15697\n<024259>15688\n<024276>15047\n<024277>16992\n<024278>16608\n<024284>15271\n<024293>15681\n<024295>14871\n<0242a5>15678\n<0242bf>18981\n<0242c1>17001\n<0242c9>14984\n<0242ca>15686\n<0242ee>18501\n<0242fa>15510\n<02430d>18502\n<02431a>15046\n<024334>18503\n<024348>14681\n<024362>15631\n<024363>16595\n<024364>14648\n<024365>16998\n<02438c>14827\n<024396>18504\n<02439c>16837\n<0243bd>15695\n<0243c1>15512\n<0243e9>15701\n<0243ea>15323\n<0243f2>16119\n<0243f8>14703\n<024404>18505\n<024435>16564\n<024436>14768\n<02445a>17003\n<02445b>15685\n<024473>14702\n<024487>15011\n<024488>15499\n<0244b9>14696\n<0244bc>16697\n<0244ce>15693\n<0244d3>17194\n<0244d6>18506\n<024505>18917\n<024521>15844\n<024578>14175\n<0245c8>17240\n<024618>16079\n<02462a>15005\n<024665>14940\n<024674>18508\n<024697>15109\n<0246d4>14937\n<024706>18664\n<024725>15053\n<02472f>18509\n<02478f>15052\n<0247e0>16066\n<0247ef>17355\n<024812>18510\n<024823>17030\n<024882>14173\n<0248e9>17653\n<0248f0>15112\n<0248f1>16906\n<0248f2>18159\n<0248f3>15095\n<0248fb>18511\n<0248ff>15321\n<024900>16916\n<024901>16687\n<02490c>16915\n<024916>15542\n<024917>15061\n<024919>18721\n<02492f>15299\n<024933>16413\n<024934>15846\n<02493e>18716\n<02493f>15816\n<024940>16808\n<024941>15472\n<024942>16404\n<024943>15558\n<024962>18119\n<024963>18709\n<024974>17019\n<024975>14677\n<024976>15544\n<02497b>18952\n<02497f>16933\n<024982>16749\n<024988>15930\n<024989>14961\n<02498a>14425\n<02498b>15520\n<02498c>15145\n<02498d>17048\n<02498e>15089\n<02498f>16750\n<024994>14732\n<0249a4>16440\n<0249a7>14264\n<0249a9>16637\n<0249ab>15088\n<0249ac>14829\n<0249ad>15575\n<0249b7>17047\n<0249b8>15401\n<0249b9>15519\n<0249ba>15773\n<0249bb>14678\n<0249c5>15094\n<0249d0>15876\n<0249da>17940\n<0249de>15453\n<0249df>16783\n<0249e3>14951\n<0249e5>15540\n<0249ec>18116\n<0249ed>15331\n<0249f6>15834\n<0249f7>15210\n<0249f8>14680\n<0249f9>15174\n<0249fb>17049\n<024a0e>14793\n<024a12>18782\n<024a13>18920\n<024a15>18512\n<024a21>16838\n<024a22>17005\n<024a23>16802\n<024a24>17044\n<024a25>14723\n<024a26>17053\n<024a27>17004\n<024a28>16801\n<024a29>14587\n<024a2a>15885\n<024a3e>15534\n<024a42>15322\n<024a45>15787\n<024a4a>15060\n<024a4e>15092\n<024a4f>18129\n<024a50>15569\n<024a51>14682\n<024a5d>18133\n<024a65>14253\n<024a66>15537\n<024a67>15369\n<024a71>15632\n<024a77>18725\n<024a78>15332\n<024a79>17072\n<024a7a>14398\n<024a8c>17070\n<024a93>18634\n<024a94>15535\n<024a95>14254\n<024a96>15119\n<024aa4>15055\n<024aa5>15934\n<024aa6>16464\n<024aa7>15810\n<024ab1>16424\n<024ab2>15361\n<024ab3>15529\n<024aba>15116\n<024abb>16285\n<024abc>14840\n<024ac0>18513\n<024ac7>15117\n<024aca>18605\n<024ad1>14525\n<024adf>15065\n<024ae2>18714\n<024ae9>14534\n<024b0f>19083\n<024b6e>18692\n<024bf5>16597\n<024c09>15286\n<024c9e>18649\n<024c9f>15645\n<024cc9>18093\n<024cd9>15079\n<024d06>15080\n<024d13>17092\n<024db8>17171\n<024dea>17181\n<024deb>17908\n<024e3b>17282\n<024e50>17921\n<024ea5>17360\n<024ea7>17200\n<024f0e>18751\n<024f5c>17364\n<024f82>17090\n<024f86>18515\n<024f97>15491\n<024f9a>15827\n<024fa9>18699\n<024fb8>18080\n<024fc2>18678\n<02502c>18516\n<025052>17227\n<02509d>17115\n<02512b>17165\n<025148>18660\n<02517d>17116\n<02517e>17934\n<0251cd>18859\n<0251e3>17865\n<0251e6>16826\n<0251e7>15103\n<025220>17122\n<025221>15102\n<025250>16730\n<025299>18518\n<0252c7>17207\n<0252d8>17938\n<02530e>14153\n<025311>18653\n<025313>16832\n<025419>18519\n<025425>14976\n<02542f>14711\n<025430>14392\n<025446>18520\n<02546c>14555\n<02546e>18521\n<02549a>19075\n<025531>18741\n<025535>18201\n<02553f>18522\n<02555b>14975\n<02555c>14735\n<02555d>15465\n<02555e>18523\n<025562>18524\n<025565>14393\n<025566>18525\n<025581>15122\n<025584>14971\n<02558f>14973\n<0255b9>14476\n<0255d5>15554\n<0255db>14480\n<0255e0>17137\n<025605>17016\n<025635>18643\n<025651>14774\n<025683>15253\n<025695>18925\n<0256e3>15130\n<0256f6>15710\n<025706>14573\n<02571d>16792\n<025725>14596\n<02573d>17947\n<025772>16520\n<0257c7>18526\n<0257df>15342\n<0257e0>14127\n<0257e1>15839\n<025857>17149\n<02585d>18527\n<025872>14996\n<0258c8>15386\n<0258de>19093\n<0258e1>14132\n<025903>18528\n<025946>14868\n<025956>18644\n<0259ac>14136\n<0259cc>16659\n<025a54>18997\n<025a95>18694\n<025a9c>15159\n<025aae>18529\n<025aaf>15158\n<025ae9>15201\n<025b74>17956\n<025b89>18530\n<025bb3>15170\n<025bb4>14158\n<025bc6>15164\n<025be4>14303\n<025be8>18480\n<025c01>14149\n<025c06>18531\n<025c21>16211\n<025c4a>18652\n<025c65>18074\n<025c91>14320\n<025ca4>18924\n<025cc0>14322\n<025cc1>14170\n<025cfe>14154\n<025d20>14164\n<025d30>18861\n<025d43>15202\n<025d99>19139\n<025db9>19124\n<025e0e>15204\n<025e49>17274\n<025e81>18646\n<025e82>15188\n<025e83>14876\n<025ea6>15172\n<025ebc>15171\n<025ed7>18739\n<025ed8>18655\n<025f1a>16344\n<025f4b>14719\n<025fe1>15062\n<025fe2>15780\n<026021>19091\n<026029>14193\n<026048>16071\n<026064>15449\n<026083>18784\n<026097>17242\n<0260a4>15518\n<0260a5>17850\n<026102>18534\n<026121>14201\n<026159>18729\n<02615a>14202\n<02615b>15517\n<02615c>15185\n<0261ad>18746\n<0261ae>15120\n<0261b2>18535\n<0261dd>16979\n<026258>15964\n<026261>15184\n<02626a>17658\n<02626b>18757\n<0262d0>14212\n<026335>16133\n<02634b>17660\n<02634c>18754\n<026351>14215\n<0263be>15348\n<0263f5>17103\n<0263f8>15197\n<026402>18536\n<026410>14522\n<026411>15851\n<026412>15196\n<02644a>18537\n<026469>15860\n<026484>18538\n<026488>18539\n<026489>14223\n<02648d>14142\n<026498>14247\n<026512>18540\n<026572>17899\n<0265a0>15213\n<0265ad>15211\n<0265bf>18541\n<026612>17663\n<026626>14236\n<0266af>18641\n<0266b1>14757\n<0266b5>18542\n<0266da>17223\n<0266e8>14238\n<0266fc>18544\n<026716>17224\n<026741>15515\n<026799>18546\n<0267b3>18702\n<0267b4>15223\n<0267cc>16362\n<02681c>17860\n<026846>18750\n<02685e>18548\n<02686e>18547\n<026888>16719\n<02688a>16044\n<026893>18666\n<0268c7>18549\n<02690e>17108\n<026911>17107\n<026926>18550\n<026939>18551\n<026951>17664\n<0269a8>18101\n<0269b5>15921\n<0269f2>17180\n<0269fa>18552\n<026a2d>18553\n<026a2e>17039\n<026a34>18554\n<026a42>15225\n<026a51>15228\n<026a52>14257\n<026b05>14285\n<026b0a>18082\n<026b13>16485\n<026b15>18958\n<026b23>18995\n<026b28>16670\n<026b50>17889\n<026b51>16907\n<026b52>15812\n<026b53>16542\n<026b5b>18555\n<026b75>15190\n<026b82>15439\n<026b96>14311\n<026b97>14286\n<026b9d>18556\n<026bb3>16416\n<026bc0>15625\n<026bf7>15830\n<026c21>14754\n<026c40>15490\n<026c41>19048\n<026c46>19069\n<026c7e>16590\n<026c7f>14159\n<026c80>15661\n<026c81>16622\n<026c82>15654\n<026ca4>18557\n<026cb7>15648\n<026cb8>14520\n<026cbd>15849\n<026cc0>15508\n<026cc3>14230\n<026cd1>15216\n<026d22>18713\n<026d23>18718\n<026d24>14986\n<026d25>16926\n<026d26>15652\n<026d27>14579\n<026d28>15691\n<026d29>16421\n<026d2a>16623\n<026d51>15653\n<026d74>18956\n<026da0>16853\n<026da1>16927\n<026da2>14660\n<026da3>14284\n<026da4>15442\n<026da5>14293\n<026da6>16628\n<026da7>15230\n<026dae>18558\n<026ddc>18744\n<026dea>15075\n<026deb>16928\n<026df0>15444\n<026e00>15447\n<026e05>16291\n<026e07>15916\n<026e12>15437\n<026e42>14301\n<026e43>14313\n<026e44>14184\n<026e45>16633\n<026e6e>16723\n<026e72>16935\n<026e77>14312\n<026e84>15443\n<026e88>19137\n<026e8b>18984\n<026e99>18086\n<026ed0>18671\n<026ed1>18733\n<026ed2>16758\n<026ed3>14125\n<026ed4>14297\n<026ed5>14512\n<026ed6>14186\n<026ed7>14453\n<026f26>14741\n<026f73>14927\n<026f74>16937\n<026f9f>17113\n<026fa1>16643\n<026fbe>18959\n<026fde>15655\n<026fdf>15438\n<02700e>17789\n<02704b>18559\n<027052>14737\n<027053>15662\n<027088>14335\n<0270ad>18745\n<0270ae>18710\n<0270af>15906\n<0270cd>14338\n<0270d2>18985\n<0270f8>16732\n<027109>18127\n<02710c>14428\n<02710d>18954\n<027126>17155\n<027127>15215\n<027164>18712\n<027165>14733\n<027175>14569\n<0271cd>18560\n<02721b>15232\n<027267>18970\n<027280>18561\n<027285>18562\n<02728b>18563\n<0272b2>16092\n<0272b6>18672\n<0272e6>18564\n<027352>18983\n<02739a>14345\n<0273ff>19072\n<027422>15244\n<027450>18566\n<027484>15579\n<027486>16356\n<027574>17285\n<0275a3>16069\n<0275e0>14360\n<0275e4>14362\n<0275fd>14917\n<0275fe>15781\n<027607>14008\n<02760c>17141\n<027632>15814\n<027639>17292\n<027655>18642\n<027656>18740\n<027657>15779\n<027694>17930\n<02770f>14369\n<027735>17723\n<027736>15684\n<027741>15129\n<02775e>17303\n<027784>15256\n<027785>15255\n<0277cc>18568\n<027858>18569\n<027870>14990\n<02789d>15957\n<0278b2>17668\n<0278c8>17849\n<027924>14378\n<027967>18297\n<02797a>14562\n<0279a0>17225\n<0279dd>18571\n<0279fd>18572\n<027a0a>18573\n<027a0e>16653\n<027a3e>15961\n<027a53>16751\n<027a59>14384\n<027a79>15771\n<027a84>16422\n<027abd>14379\n<027abe>14456\n<027af4>15709\n<027b06>15379\n<027b0b>18574\n<027b18>15711\n<027b38>14388\n<027b39>17151\n<027b3a>14386\n<027b48>15186\n<027b65>19134\n<027bef>19008\n<027bf4>15640\n<027c12>15825\n<027c6c>18991\n<027cb1>18973\n<027cc5>18975\n<027d2f>18668\n<027d53>14410\n<027d54>14406\n<027d66>18575\n<027d73>18670\n<027d84>17845\n<027d8f>14407\n<027d98>14412\n<027dbd>14413\n<027ddc>15279\n<027e4d>15694\n<027e4f>15604\n<027f2e>16106\n<027ff9>16061\n<028002>14423\n<028009>18576\n<02801e>15030\n<028023>18577\n<028024>15960\n<028048>18578\n<028083>18579\n<028090>18580\n<0280bd>17902\n<0280be>17174\n<0280e8>15899\n<0280e9>17198\n<0280f4>18581\n<02812e>18582\n<02814f>18583\n<02815d>17179\n<02816f>15920\n<028189>17384\n<0281af>18584\n<0281bc>14427\n<028207>17918\n<028218>15599\n<02821a>18585\n<028256>17193\n<02827c>17943\n<02829b>17272\n<0282cd>17931\n<0282e2>16005\n<028306>18586\n<028318>15914\n<02832f>18587\n<02833a>14221\n<028365>14436\n<02836d>14199\n<02837d>16263\n<02838a>18588\n<028412>14437\n<028468>18589\n<02846c>17801\n<028473>15882\n<028482>16706\n<028501>18097\n<02853c>14455\n<02853d>14445\n<02856c>14458\n<0285e8>15796\n<0285f4>16830\n<028600>14607\n<02860b>14459\n<028625>14332\n<02863b>14333\n<0286aa>18590\n<0286ab>16508\n<0286b2>19071\n<0286bc>18096\n<0286d8>14503\n<0286e6>14463\n<02870f>18877\n<028713>14461\n<028804>17033\n<02882b>17031\n<02890d>19098\n<028933>14470\n<028948>15822\n<028949>15928\n<028956>18592\n<028964>17126\n<028968>17127\n<02896c>14695\n<02896d>19059\n<02897e>14687\n<028989>15345\n<0289a8>14909\n<0289aa>16414\n<0289ab>15907\n<0289b8>18593\n<0289bc>16552\n<0289c0>18044\n<0289dc>15031\n<0289de>14444\n<0289e1>15689\n<0289e3>18892\n<0289e4>16405\n<0289f9>15260\n<0289fa>15521\n<0289fb>14886\n<0289fc>15502\n<028a0f>18747\n<028a16>15551\n<028a25>14376\n<028a29>16736\n<028a32>18863\n<028a36>16726\n<028a44>14691\n<028a45>15372\n<028a46>14859\n<028a47>14906\n<028a48>14241\n<028a49>15494\n<028a4a>16869\n<028a4b>15306\n<028a59>18150\n<028a5a>18726\n<028a81>15586\n<028a82>15556\n<028a83>15642\n<028a9a>15785\n<028a9b>16515\n<028a9c>14818\n<028ac0>15574\n<028ac6>14477\n<028acb>15028\n<028acc>15087\n<028ace>15550\n<028ade>16487\n<028adf>16858\n<028ae0>14516\n<028ae1>14484\n<028ae2>14487\n<028ae3>15099\n<028ae5>14488\n<028aea>18885\n<028afc>15308\n<028b0c>14479\n<028b13>14763\n<028b21>16942\n<028b22>14972\n<028b2b>18783\n<028b2c>18636\n<028b2d>18735\n<028b2f>15347\n<028b46>18596\n<028b4c>17231\n<028b4e>15801\n<028b50>15368\n<028b63>15526\n<028b64>15370\n<028b65>15385\n<028b66>16581\n<028b6c>18639\n<028b8f>17073\n<028b99>18640\n<028b9c>15259\n<028b9d>16767\n<028bb9>19005\n<028bc2>18731\n<028bc5>15360\n<028bd4>18597\n<028bd7>14878\n<028bd9>15258\n<028bda>14684\n<028be7>15553\n<028be8>17007\n<028be9>14129\n<028bea>15027\n<028beb>14485\n<028bec>14491\n<028bf5>15257\n<028bff>14493\n<028c03>17075\n<028c09>18598\n<028c1c>15624\n<028c1d>15310\n<028c23>15066\n<028c26>15346\n<028c2b>14655\n<028c30>15925\n<028c39>14492\n<028c3b>15311\n<028cca>17300\n<028ccd>17289\n<028cd2>17298\n<028d34>15318\n<028d99>17299\n<028db9>18942\n<028e0f>17675\n<028e36>14688\n<028e39>16332\n<028e65>15329\n<028e66>15328\n<028e97>16202\n<028eac>17084\n<028eb2>17059\n<028eb3>14784\n<028ed9>17081\n<028ee7>15327\n<028fc5>18599\n<029079>19062\n<029088>14926\n<02908b>14668\n<029093>15341\n<0290af>14523\n<0290b0>15338\n<0290b1>14598\n<0290c0>15854\n<0290e4>15601\n<0290e5>14524\n<0290ec>18600\n<0290ed>16845\n<02910d>17158\n<029110>18601\n<02913c>18602\n<02914d>14938\n<02915b>18147\n<02915e>18604\n<029170>16964\n<02919c>16886\n<0291a8>15903\n<0291d5>14539\n<0291eb>14542\n<02941d>14561\n<029420>18151\n<029433>14558\n<02943f>14966\n<029448>15268\n<0294d0>16132\n<0294d9>14133\n<0294da>15363\n<0294e5>17172\n<0294e7>18607\n<02959e>18700\n<0295b0>18608\n<0295b8>18609\n<0295d7>15365\n<0295e9>15949\n<0295f4>17204\n<029720>17279\n<029732>18610\n<0297d4>17208\n<029810>17681\n<029857>14589\n<0298a4>15893\n<0298d1>18611\n<0298ea>14945\n<0298f1>15391\n<0298fa>19055\n<029903>18743\n<029905>14590\n<02992f>15434\n<029945>19019\n<029947>18884\n<029948>15393\n<029949>18612\n<02995d>16768\n<02996a>18613\n<02999d>14740\n<0299c3>18614\n<0299c9>15797\n<029a28>18615\n<029a4d>17197\n<029b05>14602\n<029b0e>18616\n<029bd5>14599\n<029c73>18851\n<029cad>15892\n<029d3e>14614\n<029d5a>18617\n<029d7c>16067\n<029d98>15973\n<029d9b>18618\n<029df6>17788\n<029e06>16122\n<029e2d>15421\n<029e68>14621\n<029eac>16085\n<029eb0>19013\n<029ec3>17893\n<029ef8>18620\n<029f23>18621\n<029f30>18698\n<029fb7>14623\n<029fde>16090\n<02a014>18095\n<02a087>14229\n<02a0b9>14639\n<02a0e1>14626\n<02a0ed>15432\n<02a0f3>15433\n<02a0f8>14348\n<02a0fe>15424\n<02a107>18870\n<02a123>14627\n<02a133>17791\n<02a134>14631\n<02a150>16607\n<02a192>14624\n<02a193>14634\n<02a1ab>14625\n<02a1b4>15431\n<02a1b5>19065\n<02a1df>14628\n<02a1f5>15423\n<02a220>14635\n<02a233>14637\n<02a293>18624\n<02a29f>14440\n<02a2b2>16276\n<02a2b4>14640\n<02a2b6>18145\n<02a2ba>18880\n<02a2bd>17939\n<02a2df>15912\n<02a2ff>18626\n<02a351>18987\n<02a3a9>17716\n<02a434>16113\n<02a45b>18111\n<02a5c6>15084\n<02a5cb>18627\n<02a601>17263\n<02a632>17297\n<02a64a>16254\n<02a65b>17288\n<02a6a9>18675\n<02adff>19152\n<02f806>15843\n<02f825>15704\n<02f828>17316\n<02f829>16486\n<02f832>16510\n<02f83b>18411\n<02f840>18727\n<02f878>17634\n<02f894>16715\n<02f8a6>16757\n<02f8cd>15842\n<02f8db>16841\n<02f908>16943\n<02f922>16392\n<02f92f>17056\n<02f98f>14263\n<02f994>14270\n<02f9b2>14339\n<02f9bc>15241\n<02f9d4>14408\n<02f9d7>14421\n<02fa1b>14662\nendcidchar\nbegincidrange\n<020d7e><020d7f>17884\n<02101d><02101e>17924\n<0210f5><0210f6>17926\n<021903><021904>14898\n<0231a4><0231a5>16821\n<0231f7><0231f8>16818\n<024156><024157>16976\n<0289e7><0289e8>18594\nendcidrange\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/UniCNS-UTF32-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniCNS-UTF32-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniCNS-UTF32-H)\n%%BeginResource: CMap (UniCNS-UTF32-V)\n%%Title: (UniCNS-UTF32-V Adobe CNS1 6)\n%%Version: 1.005\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution.\n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission.\n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniCNS-UTF32-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 6 def\nend def\n\n/CMapName /UniCNS-UTF32-V def\n/CMapVersion 1.005 def\n/CMapType 1 def\n\n/XUID [1 10 25594] def\n\n/WMode 1 def\n\n6 begincidchar\n<00002013> 120\n<00002014> 122\n<00002025> 109\n<0000fe4f> 13745\n<0000ff5b> 134\n<0000ff5d> 135\nendcidchar\n\n7 begincidrange\n<00003008> <00003009> 150\n<0000300a> <0000300b> 146\n<0000300c> <0000300d> 154\n<0000300e> <0000300f> 158\n<00003010> <00003011> 142\n<00003014> <00003015> 138\n<0000ff08> <0000ff09> 130\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/UniCNS-UTF8-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (UniCNS-UTF8-H)\n%%Title: (UniCNS-UTF8-H Adobe CNS1 6)\n%%Version: 13.011\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2010 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution.\n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission.\n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 6 def\nend def\n\n/CMapName /UniCNS-UTF8-H def\n/CMapVersion 13.011 def\n/CMapType 1 def\n\n/XUID [1 10 25397] def\n\n/WMode 0 def\n\n4 begincodespacerange\n  <00>       <7F>\n  <C080>     <DFBF>\n  <E08080>   <EFBFBF>\n  <F0808080> <F7BFBFBF>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 1\nendnotdefrange\n\n100 begincidchar\n<c2a0> 1\n<c2a5> 260\n<c2a7> 178\n<c2a8> 13747\n<c2a9> 96\n<c2ac> 14049\n<c2af> 195\n<c2b0> 280\n<c2b1> 212\n<c2b7> 115\n<c380> 18788\n<c381> 18786\n<c388> 18792\n<c389> 18790\n<c38a> 18801\n<c392> 18796\n<c393> 18794\n<c397> 210\n<c3a0> 18805\n<c3a1> 18803\n<c3a8> 18810\n<c3a9> 18808\n<c3aa> 18832\n<c3ac> 18814\n<c3ad> 18812\n<c3b2> 18818\n<c3b3> 18816\n<c3b7> 211\n<c3b8> 18840\n<c3b9> 18822\n<c3ba> 18820\n<c3bc> 18827\n<c480> 18785\n<c481> 18802\n<c492> 18789\n<c493> 18807\n<c49a> 18791\n<c49b> 18809\n<c4ab> 18811\n<c58b> 18841\n<c58c> 18793\n<c58d> 18815\n<c593> 18839\n<c5ab> 18819\n<c78d> 18787\n<c78e> 18804\n<c790> 18813\n<c791> 18795\n<c792> 18817\n<c794> 18821\n<c796> 18823\n<c798> 18824\n<c79a> 18825\n<c79c> 18826\n<c990> 18835\n<c991> 18806\n<c994> 18837\n<c99b> 18836\n<c9a1> 18833\n<c9aa> 18843\n<c9b5> 18838\n<ca83> 18834\n<ca8a> 18842\n<cb86> 13748\n<cb87> 504\n<cb8a> 503\n<cb8b> 505\n<cb8d> 198\n<cb99> 502\n<cc84> 195\n<cc88> 13747\n<cc8c> 504\n<d081> 13936\n<d191> 13969\n<e1babe> 18798\n<e1babf> 18829\n<e1bb80> 18800\n<e1bb81> 18831\n<e28093> 121\n<e28094> 123\n<e280a2> 104\n<e280a5> 111\n<e280a6> 110\n<e280a7> 104\n<e280b2> 173\n<e280b5> 172\n<e280bb> 177\n<e280be> 195\n<e282ac> 17601\n<e28483> 266\n<e28485> 194\n<e28489> 267\n<e28496> 14054\n<e284a1> 14055\n<e284a2> 97\n<e28690> 248\n<e28691> 245\n<e28692> 247\n<e28693> 246\n<e28698> 252\nendcidchar\n\n100 begincidchar\n<e28699> 251\n<e287a7> 13996\n<e28895> 257\n<e2889a> 213\n<e2889e> 220\n<e2889f> 233\n<e288a0> 232\n<e288a3> 254\n<e288a5> 253\n<e288ab> 237\n<e288ae> 238\n<e288b4> 240\n<e288b5> 239\n<e288bc> 228\n<e28992> 221\n<e289a0> 219\n<e289a1> 222\n<e28a95> 243\n<e28a99> 244\n<e28aa5> 231\n<e28abf> 234\n<e28baf> 110\n<e290a1> 594\n<e29480> 311\n<e29482> 312\n<e2948c> 314\n<e29490> 315\n<e29494> 316\n<e29498> 317\n<e2949c> 309\n<e294a4> 308\n<e294ac> 307\n<e294b4> 306\n<e294bc> 305\n<e29590> 322\n<e29591> 14090\n<e29592> 14072\n<e29593> 14081\n<e29594> 14063\n<e29595> 14074\n<e29596> 14083\n<e29597> 14065\n<e29598> 14078\n<e29599> 14087\n<e2959a> 14069\n<e2959b> 14080\n<e2959c> 14089\n<e2959d> 14071\n<e2959e> 323\n<e2959f> 14084\n<e295a0> 14066\n<e295a1> 325\n<e295a2> 14086\n<e295a3> 14068\n<e295a4> 14073\n<e295a5> 14082\n<e295a6> 14064\n<e295a7> 14079\n<e295a8> 14088\n<e295a9> 14070\n<e295aa> 324\n<e295ab> 14085\n<e295ac> 14067\n<e295af> 321\n<e295b0> 320\n<e295b4> 13744\n<e29689> 304\n<e2968a> 303\n<e2968b> 302\n<e2968c> 301\n<e2968d> 300\n<e2968e> 299\n<e2968f> 298\n<e29693> 14096\n<e29694> 310\n<e29695> 313\n<e296a0> 190\n<e296a1> 189\n<e296b2> 183\n<e296b3> 182\n<e296bc> 192\n<e296bd> 191\n<e29786> 188\n<e29787> 187\n<e2978b> 180\n<e2978e> 184\n<e2978f> 181\n<e297a4> 329\n<e297a5> 328\n<e29885> 186\n<e29886> 185\n<e29889> 244\n<e29980> 241\n<e29981> 243\n<e29982> 242\n<e29cbd> 13760\n<e2ba80> 17608\n<e2ba84> 17692\n<e2ba8a> 17696\n<e2ba95> 17699\nendcidchar\n\n100 begincidchar\n<e2ba9c> 17700\n<e2ba9d> 18846\n<e2baa5> 17701\n<e2baa7> 17702\n<e2baaa> 17703\n<e2baac> 17704\n<e2baae> 17705\n<e2bab6> 17706\n<e2babc> 17707\n<e2babe> 17708\n<e2bb86> 18847\n<e2bb8a> 17709\n<e2bb8f> 17712\n<e2bb9e> 17715\n<e2bba3> 18848\n<e2bc80> 595\n<e2bc84> 596\n<e2bc85> 539\n<e2bc86> 602\n<e2bc87> 540\n<e2bc8f> 607\n<e2bc90> 5998\n<e2bc91> 608\n<e2bc92> 610\n<e2bc93> 544\n<e2bc94> 611\n<e2bc95> 5999\n<e2bc96> 545\n<e2bc99> 546\n<e2bc9a> 6000\n<e2bc9b> 547\n<e2bc9c> 614\n<e2bc9d> 633\n<e2bc9e> 6005\n<e2bca1> 548\n<e2bca2> 548\n<e2bca7> 549\n<e2bcac> 6006\n<e2bcad> 646\n<e2bcae> 550\n<e2bcbb> 6007\n<e2bd80> 725\n<e2bd81> 556\n<e2bd86> 557\n<e2bd8e> 6026\n<e2bd93> 6028\n<e2bd99> 6029\n<e2bda5> 862\n<e2bda6> 866\n<e2bdb1> 6066\n<e2bdb9> 6162\n<e2be8b> 6163\n<e2be8c> 6168\n<e2be91> 6169\n<e2be98> 6375\n<e2bea1> 560\n<e2bea2> 1307\n<e2beaa> 561\n<e2bead> 17635\n<e2beae> 1698\n<e2bebd> 7731\n<e2bebe> 2552\n<e2bebf> 7732\n<e2bf8b> 9056\n<e2bf8c> 9746\n<e2bf92> 4745\n<e2bf95> 12045\n<e38080> 99\n<e38083> 179\n<e38092> 261\n<e383bc> 13757\n<e38785> 17615\n<e38788> 17622\n<e3878f> 13999\n<e388b1> 14053\n<e38aa3> 193\n<e38ea1> 276\n<e38f84> 279\n<e38f8e> 275\n<e38f91> 236\n<e38f92> 235\n<e38f95> 271\n<e390b5> 14781\n<e39180> 15463\n<e3918a> 19046\n<e3918c> 17811\n<e391a4> 14981\n<e391b3> 15813\n<e391ba> 16435\n<e391bd> 17815\n<e391be> 18083\n<e39293> 17310\n<e39296> 14300\n<e392a5> 17816\n<e392af> 15487\n<e392bc> 17280\n<e39381> 17659\n<e39388> 15616\n<e3939f> 16036\n<e393a4> 15956\nendcidchar\n\n100 begincidchar\n<e393a6> 19122\n<e393bb> 15818\n<e39486> 17206\n<e394be> 17639\n<e39591> 17825\n<e39593> 17317\n<e39599> 18860\n<e395a1> 16600\n<e395ad> 17828\n<e395b0> 15151\n<e395b2> 17829\n<e395b7> 16075\n<e395b8> 17273\n<e39684> 14843\n<e39697> 15149\n<e39698> 17840\n<e396a1> 16610\n<e396a5> 17841\n<e396ad> 16124\n<e396bf> 17842\n<e39781> 17792\n<e39785> 17844\n<e39787> 17823\n<e3978a> 15939\n<e3978e> 16001\n<e39792> 16329\n<e39796> 16309\n<e3979b> 18189\n<e3979d> 17324\n<e397b1> 18070\n<e397b2> 17959\n<e397b3> 16236\n<e397bb> 17864\n<e397be> 16234\n<e39889> 17909\n<e39898> 18545\n<e3989a> 17946\n<e3989d> 14007\n<e398a3> 16582\n<e398a5> 19012\n<e398ad> 16006\n<e398b5> 18734\n<e398b9> 16741\n<e398be> 14856\n<e39987> 18438\n<e39988> 14342\n<e39989> 16403\n<e3998e> 18072\n<e3999f> 15859\n<e399a1> 19084\n<e399ba> 16099\n<e39a81> 17830\n<e39a9a> 15473\n<e39aa5> 18690\n<e39aaa> 15152\n<e39aac> 18688\n<e39ab0> 15583\n<e39ab1> 16589\n<e39ab5> 15298\n<e39ab9> 18567\n<e39abc> 15615\n<e39b81> 14277\n<e39b83> 16613\n<e39b84> 14597\n<e39b85> 17046\n<e39b87> 15674\n<e39b88> 18464\n<e39b93> 14904\n<e39b94> 15283\n<e39b96> 15628\n<e39b9d> 14902\n<e39ba1> 14716\n<e39ba2> 15581\n<e39ba5> 16918\n<e39ba6> 16636\n<e39bb5> 14872\n<e39c81> 14900\n<e39c83> 17935\n<e39c88> 16639\n<e39c8a> 15573\n<e39c8d> 16952\n<e39c9c> 15870\n<e39ca2> 14713\n<e39ca3> 14720\n<e39ca5> 14409\n<e39cac> 15500\n<e39cad> 15671\n<e39cb0> 18780\n<e39cb2> 16646\n<e39cb3> 14743\n<e39cba> 15958\n<e39d80> 16898\n<e39d83> 16438\n<e39da2> 15798\n<e39daf> 18379\n<e39e97> 17901\n<e39ea0> 14888\n<e39eb9> 17335\n<e39ebe> 14654\n<e39f96> 19067\nendcidchar\n\n100 begincidchar\n<e39fb2> 15265\n<e39fb8> 17106\n<e39fbb> 16117\n<e3a08f> 17964\n<e3a099> 14767\n<e3a0a0> 17967\n<e3a0ad> 16686\n<e3a0b6> 16691\n<e3a0b8> 17339\n<e3a1a3> 18115\n<e3a1b5> 19088\n<e3a2a0> 16709\n<e3a383> 14610\n<e3a38c> 16502\n<e3a391> 14997\n<e3a394> 19074\n<e3a3ba> 17643\n<e3a488> 17970\n<e3a494> 17342\n<e3a4a7> 15409\n<e3a4b2> 16770\n<e3a4bf> 17971\n<e3a58d> 17972\n<e3a5a3> 16739\n<e3a5b8> 19045\n<e3a680> 14452\n<e3a689> 17976\n<e3a68a> 15592\n<e3a692> 17270\n<e3a699> 14778\n<e3a69b> 15795\n<e3a6a1> 15897\n<e3a6a4> 15887\n<e3a6b8> 17979\n<e3a79c> 16078\n<e3a7a2> 18120\n<e3a7a5> 14651\n<e3a7ac> 17168\n<e3a7b8> 17982\n<e3a7bb> 17221\n<e3a7be> 17256\n<e3a881> 16864\n<e3a883> 17984\n<e3a886> 17271\n<e3a897> 16784\n<e3a898> 17295\n<e3a8a9> 14942\n<e3a8aa> 16095\n<e3a8b4> 17177\n<e3a98b> 17988\n<e3a992> 16083\n<e3a997> 16798\n<e3a99c> 16324\n<e3a99e> 15111\n<e3a9a6> 16796\n<e3a9a7> 17203\n<e3aa97> 17991\n<e3aaab> 16529\n<e3aabd> 17993\n<e3ab9e> 16716\n<e3aba0> 14970\n<e3abb0> 18098\n<e3abb2> 17996\n<e3abb5> 19094\n<e3abbb> 15090\n<e3ac8e> 14568\n<e3ac99> 18117\n<e3aca2> 17998\n<e3acab> 18774\n<e3acb9> 18251\n<e3ad82> 18000\n<e3ad98> 18002\n<e3ada0> 14650\n<e3adb1> 18006\n<e3adb2> 18005\n<e3adbb> 18007\n<e3adbc> 14426\n<e3ae80> 16866\n<e3ae95> 18976\n<e3ae96> 15004\n<e3ae99> 15000\n<e3aea1> 16873\n<e3aebc> 17352\n<e3aebe> 15793\n<e3af82> 16692\n<e3af84> 15008\n<e3af97> 15020\n<e3af9d> 18015\n<e3afac> 18020\n<e3afb2> 18022\n<e3afb3> 16883\n<e3afb4> 14958\n<e3b08d> 16887\n<e3b091> 15936\n<e3b095> 14744\n<e3b098> 18737\n<e3b194> 15872\n<e3b28b> 18871\n<e3b38b> 18032\n<e3b38d> 15589\nendcidchar\n\n100 begincidchar\n<e3b391> 16387\n<e3b396> 15607\n<e3b39c> 16462\n<e3b3ab> 16919\n<e3b3af> 18037\n<e3b492> 19036\n<e3b493> 14195\n<e3b49d> 14652\n<e3b4b2> 18775\n<e3b4bb> 16965\n<e3b586> 18053\n<e3b58c> 15595\n<e3b58e> 16962\n<e3b591> 14570\n<e3b59f> 16729\n<e3b5a2> 15454\n<e3b5a9> 15594\n<e3b5aa> 18057\n<e3b5af> 15612\n<e3b5b5> 18058\n<e3b5bd> 15407\n<e3b685> 18763\n<e3b688> 19026\n<e3b68a> 18061\n<e3b68f> 15037\n<e3b691> 18063\n<e3b6a5> 15702\n<e3b6ad> 18073\n<e3b6b4> 16550\n<e3b6bf> 14288\n<e3b786> 18654\n<e3b787> 16740\n<e3b789> 18853\n<e3b78c> 15727\n<e3b78d> 15091\n<e3b793> 14305\n<e3b79b> 16383\n<e3b7a7> 14745\n<e3b7a8> 16989\n<e3b7ab> 15962\n<e3b7b3> 18132\n<e3b7b4> 19006\n<e3b7b7> 18603\n<e3b7bc> 17963\n<e3b7bd> 15380\n<e3b886> 18717\n<e3b980> 16745\n<e3b983> 17261\n<e3b988> 17813\n<e3b995> 17023\n<e3b9b4> 16098\n<e3baa8> 17156\n<e3baa9> 18157\n<e3baaa> 16501\n<e3baad> 15261\n<e3bab1> 15064\n<e3bab8> 14923\n<e3babf> 15115\n<e3bb82> 15320\n<e3bb87> 14709\n<e3bb8a> 18161\n<e3bb8c> 15330\n<e3bb90> 14420\n<e3bb91> 18162\n<e3bb96> 15533\n<e3bb97> 17055\n<e3bb9a> 15618\n<e3bb9b> 18919\n<e3bb9e> 14834\n<e3bba1> 15528\n<e3bba2> 18166\n<e3bba7> 15324\n<e3bba9> 15524\n<e3bbab> 14698\n<e3bbac> 19092\n<e3bbb0> 18167\n<e3bbb3> 15069\n<e3bbb4> 18168\n<e3bbba> 18169\n<e3bbbc> 15336\n<e3bbbf> 15093\n<e3bc80> 15373\n<e3bc84> 17091\n<e3bc86> 15063\n<e3bc87> 19063\n<e3bc8e> 18171\n<e3bd93> 18172\n<e3bd98> 15081\n<e3bd99> 16521\n<e3bda3> 15078\n<e3bdbc> 18176\n<e3be93> 17869\n<e3bf80> 17359\n<e3bf88> 19082\n<e3bf97> 17361\n<e3bf9c> 18180\n<e3bfa5> 18143\n<e3bfad> 17205\n<e3bfb9> 17879\n<e3bfba> 17236\nendcidchar\n\n100 begincidchar\n<e48084> 16654\n<e48089> 18878\n<e4809d> 18185\n<e480b9> 18187\n<e48185> 18188\n<e48193> 17846\n<e48197> 14749\n<e481a2> 15307\n<e481a5> 16339\n<e481aa> 18191\n<e481af> 18192\n<e481b1> 18944\n<e482a8> 17365\n<e482b4> 19149\n<e482bb> 17856\n<e482bf> 16108\n<e48388> 15118\n<e48398> 16811\n<e4839f> 15895\n<e483b8> 19066\n<e483ba> 16062\n<e48482> 19060\n<e48483> 17367\n<e48484> 16988\n<e48489> 18204\n<e4848e> 15131\n<e484b1> 19130\n<e484b2> 15141\n<e485a7> 18207\n<e485ac> 14510\n<e485ae> 15139\n<e485bc> 19070\n<e485bf> 15234\n<e48681> 19138\n<e48690> 18112\n<e486b2> 18208\n<e48784> 18211\n<e4878a> 14143\n<e4878f> 18214\n<e4879b> 14271\n<e487ad> 19087\n<e487af> 14147\n<e487b9> 15166\n<e48891> 15169\n<e488a3> 18881\n<e48980> 14321\n<e489a0> 18219\n<e489aa> 15189\n<e489b6> 18949\n<e489ba> 18220\n<e48a8c> 18223\n<e48a94> 18225\n<e48aa2> 18945\n<e48ab5> 16400\n<e48ab9> 14502\n<e48abc> 15498\n<e48bb4> 15289\n<e48bbb> 15598\n<e48bbc> 16870\n<e48c8a> 19102\n<e48cab> 14205\n<e48dae> 18122\n<e48e97> 18235\n<e48e9a> 19030\n<e48eba> 17247\n<e48f81> 18069\n<e48f99> 17214\n<e48f9f> 15945\n<e48fad> 18245\n<e48fb0> 18965\n<e48fb2> 15944\n<e49081> 18250\n<e49082> 15219\n<e49093> 18255\n<e490a5> 18257\n<e490ad> 18258\n<e491ba> 14255\n<e4928f> 18264\n<e49291> 14004\n<e4929f> 15074\n<e492a0> 14317\n<e492a2> 16505\n<e492b0> 18268\n<e492b7> 16289\n<e492bd> 19086\n<e49380> 15367\n<e49383> 19027\n<e49385> 16912\n<e4938e> 15651\n<e4939d> 14813\n<e4939e> 19085\n<e4939f> 15650\n<e493a1> 19151\n<e493a4> 14306\n<e493a9> 16847\n<e493aa> 15217\n<e493ab> 15602\n<e493ac> 16052\n<e493b4> 14738\n<e49483> 18079\nendcidchar\n\n100 begincidchar\n<e49484> 18275\n<e49489> 15952\n<e4948b> 14292\n<e49496> 14329\n<e4949b> 19077\n<e4949d> 14183\n<e494a3> 14326\n<e494a7> 14327\n<e494ae> 15571\n<e494b3> 15441\n<e494b6> 19031\n<e494bb> 18282\n<e494bd> 14532\n<e494bf> 15890\n<e49583> 14323\n<e49591> 15076\n<e49592> 16563\n<e49595> 16958\n<e49598> 19041\n<e4959c> 14219\n<e495a1> 19076\n<e495a2> 18752\n<e495aa> 14340\n<e495ad> 19073\n<e495b7> 18286\n<e495b8> 18969\n<e49685> 14533\n<e496a6> 18968\n<e496ac> 17377\n<e496b3> 18972\n<e4979a> 18989\n<e497a9> 16100\n<e497aa> 19081\n<e49883> 18967\n<e49886> 18291\n<e4988f> 14357\n<e49895> 14403\n<e49897> 18292\n<e4999b> 14365\n<e499ba> 14825\n<e49a80> 15617\n<e49aa1> 18994\n<e49aae> 19136\n<e49abb> 19061\n<e49b8f> 15264\n<e49b90> 15866\n<e49bb5> 15263\n<e49bb7> 19068\n<e49c93> 14387\n<e49c98> 15815\n<e49cb6> 18977\n<e49d84> 18978\n<e49d8e> 16060\n<e49d8f> 18988\n<e49dbc> 15821\n<e49e98> 18305\n<e49ea6> 16547\n<e49eb6> 16106\n<e49f95> 17178\n<e49fad> 18307\n<e49fb4> 17199\n<e4a080> 17950\n<e4a08b> 17234\n<e4a0b7> 18311\n<e4a19d> 16655\n<e4a1b1> 15619\n<e4a29b> 15293\n<e4a2ad> 18321\n<e4a2ae> 18765\n<e4a2b4> 15301\n<e4a390> 15783\n<e4a39d> 16672\n<e4a3ad> 17032\n<e4a3b3> 16065\n<e4a3ba> 15940\n<e4a486> 15303\n<e4a491> 17796\n<e4a49e> 18324\n<e4a4a5> 15375\n<e4a4aa> 18094\n<e4a4ad> 18125\n<e4a4af> 19128\n<e4a4b0> 19106\n<e4a4b5> 15555\n<e4a4bc> 15352\n<e4a4be> 15622\n<e4a585> 18339\n<e4a591> 18340\n<e4a593> 17069\n<e4a5a5> 14489\n<e4a5aa> 18345\n<e4a5b2> 14884\n<e4a689> 14235\n<e4a6a1> 14519\n<e4a6a7> 18350\n<e4a79f> 14506\n<e4a7a5> 18353\n<e4a7a7> 17953\n<e4a88f> 14531\n<e4a89d> 15340\nendcidchar\n\n100 begincidchar\n<e4a8a4> 18354\n<e4a8b5> 18356\n<e4aa96> 15591\n<e4aaa4> 18993\n<e4aab4> 17249\n<e4aab8> 15784\n<e4ab91> 14563\n<e4aba4> 18359\n<e4abbf> 14578\n<e4ac90> 18873\n<e4ac99> 18361\n<e4aca0> 18858\n<e4acac> 17951\n<e4acb7> 16809\n<e4adaf> 15382\n<e4adb0> 18368\n<e4adb2> 14588\n<e4adbb> 15501\n<e4adbe> 16394\n<e4ae8e> 14839\n<e4ae90> 15392\n<e4ae93> 14988\n<e4ae96> 14658\n<e4ae97> 15396\n<e4ae9d> 18370\n<e4aebd> 15395\n<e4aebe> 14676\n<e4af80> 15836\n<e4b084> 16315\n<e4b087> 16311\n<e4b08e> 14604\n<e4b0b2> 18966\n<e4b0bb> 16188\n<e4b0be> 17787\n<e4b180> 18980\n<e4b187> 18979\n<e4b197> 18986\n<e4b19b> 16089\n<e4b1ad> 18377\n<e4b1b7> 19044\n<e4b1bb> 19079\n<e4b1bd> 15974\n<e4b281> 18955\n<e4b285> 18990\n<e4b2a4> 18622\n<e4b2ae> 15426\n<e4b2b0> 15429\n<e4b2b7> 15905\n<e4b38d> 17784\n<e4b3a1> 16115\n<e4b3a2> 18974\n<e4b3ad> 16555\n<e4b487> 18992\n<e4b489> 16086\n<e4b490> 16663\n<e4b4b4> 14645\n<e4b5b6> 19080\n<e4b5b7> 18971\n<e4b689> 19078\n<e4b691> 17397\n<e4b69c> 18628\n<e4b880> 595\n<e4b881> 597\n<e4b883> 598\n<e4b884> 18686\n<e4b887> 6001\n<e4b888> 617\n<e4b889> 615\n<e4b88a> 618\n<e4b88b> 616\n<e4b88c> 6002\n<e4b88d> 660\n<e4b88e> 6010\n<e4b88f> 6008\n<e4b890> 659\n<e4b891> 658\n<e4b894> 754\n<e4b895> 753\n<e4b896> 752\n<e4b898> 755\n<e4b899> 751\n<e4b89a> 18685\n<e4b89c> 18656\n<e4b8a1> 15725\n<e4b8a4> 17805\n<e4b8a6> 1320\n<e4b8a8> 536\n<e4b8aa> 16215\n<e4b8ab> 619\n<e4b8ac> 17651\n<e4b8ad> 661\n<e4b8ae> 6011\n<e4b8af> 18898\n<e4b8b0> 662\n<e4b8b1> 6030\n<e4b8b2> 1045\n<e4b8b3> 6388\n<e4b8b6> 537\n<e4b8b7> 17687\n<e4b8b8> 620\nendcidchar\n\n100 begincidchar\n<e4b8b9> 663\n<e4b8bb> 756\n<e4b8bc> 6031\n<e4b8bd> 17719\n<e4b8bf> 538\n<e4b981> 13999\n<e4b982> 5996\n<e4b983> 599\n<e4b985> 622\n<e4b987> 6003\n<e4b988> 623\n<e4b989> 16526\n<e4b98b> 664\n<e4b98d> 757\n<e4b98e> 759\n<e4b98f> 758\n<e4b996> 1321\n<e4b998> 2097\n<e4b999> 596\n<e4b99a> 14001\n<e4b99b> 17637\n<e4b99c> 5997\n<e4b99d> 600\n<e4b99e> 625\n<e4b99f> 624\n<e4b9a9> 882\n<e4b9aa> 15845\n<e4b9b3> 1322\n<e4b9b8> 15758\n<e4b9be> 2555\n<e4b9bf> 7733\n<e4ba80> 17806\n<e4ba81> 17340\n<e4ba82> 3518\n<e4ba85> 539\n<e4ba86> 601\n<e4ba87> 17807\n<e4ba88> 666\n<e4ba89> 17820\n<e4ba8b> 1323\n<e4ba8c> 602\n<e4ba8d> 6004\n<e4ba8e> 626\n<e4ba91> 667\n<e4ba92> 669\n<e4ba93> 6012\n<e4ba94> 670\n<e4ba95> 668\n<e4ba98> 14788\n<e4ba99> 883\n<e4ba9a> 18645\n<e4ba9b> 1324\n<e4ba9e> 1325\n<e4ba9f> 1699\n<e4baa0> 540\n<e4baa1> 627\n<e4baa2> 671\n<e4baa3> 18895\n<e4baa4> 884\n<e4baa5> 886\n<e4baa6> 885\n<e4baa8> 1046\n<e4bab3> 2098\n<e4bab6> 9059\n<e4bab7> 16700\n<e4bab9> 13175\n<e4baba> 603\n<e4babb> 17638\n<e4babc> 14769\n<e4babf> 17808\n<e4bb80> 673\n<e4bb81> 672\n<e4bb82> 6013\n<e4bb83> 674\n<e4bb84> 680\n<e4bb88> 6015\n<e4bb89> 6014\n<e4bb8d> 677\n<e4bb8e> 16226\n<e4bb98> 761\n<e4bb99> 768\n<e4bb9a> 6037\n<e4bb9c> 6033\n<e4bb9d> 6036\n<e4bb9e> 769\n<e4bb9f> 785\n<e4bba1> 6035\n<e4bba5> 760\n<e4bba8> 6032\n<e4bba9> 6034\n<e4bbaa> 18635\n<e4bbab> 17809\n<e4bbae> 15734\n<e4bbb0> 899\n<e4bbb1> 6074\n<e4bbb2> 896\n<e4bbb3> 900\n<e4bbb4> 6084\n<e4bbb5> 6072\n<e4bbb6> 897\nendcidchar\n\n100 begincidchar\n<e4bbb7> 6076\n<e4bbb8> 14765\n<e4bbbb> 898\n<e4bbbd> 901\n<e4bbbe> 17307\n<e4bbbf> 887\n<e4bc80> 6075\n<e4bc81> 902\n<e4bc82> 6079\n<e4bc83> 14792\n<e4bc84> 6083\n<e4bc85> 6080\n<e4bc88> 6077\n<e4bc89> 888\n<e4bc8a> 890\n<e4bc8b> 903\n<e4bc8d> 892\n<e4bc8e> 6069\n<e4bc8f> 895\n<e4bc92> 6085\n<e4bc93> 6082\n<e4bc94> 6073\n<e4bc95> 891\n<e4bc97> 18899\n<e4bc98> 6070\n<e4bc99> 889\n<e4bc9a> 17724\n<e4bc9d> 6078\n<e4bca2> 6081\n<e4bca8> 17725\n<e4bca9> 14782\n<e4bcac> 6071\n<e4bcad> 6191\n<e4bcaf> 1068\n<e4bcb0> 1055\n<e4bcb2> 14653\n<e4bcb3> 6192\n<e4bcb4> 1052\n<e4bcb6> 1070\n<e4bcb7> 17810\n<e4bcb8> 1060\n<e4bcb9> 16229\n<e4bcba> 1059\n<e4bcbb> 6180\n<e4bcbc> 1063\n<e4bcbd> 1058\n<e4bcbe> 6185\n<e4bcbf> 6193\n<e4bd81> 6189\n<e4bd82> 14795\n<e4bd83> 1061\n<e4bd85> 15247\n<e4bd86> 1064\n<e4bd87> 1049\n<e4bd88> 1073\n<e4bd89> 6182\n<e4bd8b> 14772\n<e4bd8c> 6400\n<e4bd8d> 1047\n<e4bd8e> 1069\n<e4bd8f> 1048\n<e4bd92> 6187\n<e4bd93> 6183\n<e4bd94> 1062\n<e4bd95> 1054\n<e4bd96> 6179\n<e4bd97> 1050\n<e4bd98> 6190\n<e4bd99> 1071\n<e4bd9a> 1074\n<e4bd9b> 1053\n<e4bd9c> 1066\n<e4bd9d> 1072\n<e4bd9e> 1051\n<e4bd9f> 6188\n<e4bda0> 1067\n<e4bda1> 6194\n<e4bda2> 6181\n<e4bda3> 1065\n<e4bda4> 6184\n<e4bda7> 6186\n<e4bda9> 1341\n<e4bdaa> 6402\n<e4bdab> 6414\n<e4bdac> 1333\n<e4bdae> 6415\n<e4bdaf> 1328\n<e4bdb0> 1338\n<e4bdb2> 15474\n<e4bdb3> 1331\n<e4bdb4> 6396\n<e4bdb5> 1339\n<e4bdb6> 6395\n<e4bdb7> 6399\n<e4bdb8> 6406\n<e4bdb9> 6404\n<e4bdba> 1347\n<e4bdbb> 1342\n<e4bdbc> 6390\n<e4bdbd> 6392\nendcidchar\n\n100 begincidchar\n<e4bdbe> 1344\n<e4bdbf> 1332\n<e4be80> 6393\n<e4be81> 6405\n<e4be82> 6412\n<e4be83> 1337\n<e4be84> 6398\n<e4be85> 6391\n<e4be86> 1336\n<e4be87> 6394\n<e4be88> 1340\n<e4be89> 6397\n<e4be8a> 14773\n<e4be8b> 1335\n<e4be8d> 1330\n<e4be8f> 1345\n<e4be90> 6407\n<e4be91> 1346\n<e4be92> 6411\n<e4be94> 6409\n<e4be95> 6413\n<e4be96> 1343\n<e4be97> 6401\n<e4be98> 6389\n<e4be9a> 6403\n<e4be9b> 1334\n<e4be9c> 6408\n<e4be9d> 1329\n<e4be9e> 6410\n<e4bea2> 14791\n<e4bea8> 17726\n<e4beab> 16418\n<e4beae> 1716\n<e4beaf> 1704\n<e4beb0> 15690\n<e4beb2> 6749\n<e4beb3> 6757\n<e4beb4> 19050\n<e4beb5> 1703\n<e4beb6> 1711\n<e4beb7> 1723\n<e4beb9> 6763\n<e4beba> 6761\n<e4bebb> 6756\n<e4bebd> 17812\n<e4bebf> 1705\n<e4bf80> 6762\n<e4bf81> 6752\n<e4bf82> 1719\n<e4bf83> 1710\n<e4bf84> 1718\n<e4bf85> 6747\n<e4bf87> 6759\n<e4bf88> 18152\n<e4bf89> 6750\n<e4bf8a> 1714\n<e4bf8b> 6751\n<e4bf8c> 14799\n<e4bf8d> 6746\n<e4bf8e> 1721\n<e4bf8f> 1708\n<e4bf90> 1717\n<e4bf91> 1707\n<e4bf93> 6748\n<e4bf94> 6753\n<e4bf96> 6760\n<e4bf97> 1715\n<e4bf98> 1712\n<e4bf99> 6755\n<e4bf9a> 1720\n<e4bf9b> 6758\n<e4bf9c> 6754\n<e4bf9d> 1709\n<e4bf9e> 1722\n<e4bf9f> 1713\n<e4bfa0> 1706\n<e4bfa1> 1702\n<e4bfa4> 15462\n<e4bfa5> 14800\n<e4bfac> 6764\n<e4bfae> 2124\n<e4bfaf> 2102\n<e4bfb0> 18896\n<e4bfb1> 2118\n<e4bfb2> 16168\n<e4bfb3> 2123\n<e4bfb4> 7204\n<e4bfb5> 7203\n<e4bfb8> 2105\n<e4bfb9> 14259\n<e4bfba> 2114\n<e4bfbd> 16166\n<e4bfbe> 2127\n<e58080> 2115\n<e58083> 17814\n<e58085> 7197\n<e58086> 2108\n<e58087> 7198\n<e58088> 16420\n<e58089> 2129\nendcidchar\n\n100 begincidchar\n<e5808b> 2120\n<e5808e> 7217\n<e5808f> 2572\n<e58091> 2113\n<e58092> 2112\n<e58093> 7199\n<e58094> 2116\n<e58095> 7749\n<e58096> 2107\n<e58097> 7210\n<e58098> 2122\n<e58099> 2121\n<e5809a> 2111\n<e5809b> 7202\n<e5809c> 7211\n<e5809e> 7196\n<e5809f> 2110\n<e580a0> 7212\n<e580a1> 2119\n<e580a2> 7200\n<e580a3> 2101\n<e580a5> 2104\n<e580a6> 2103\n<e580a7> 7213\n<e580a8> 2117\n<e580a9> 2106\n<e580aa> 2126\n<e580ab> 2128\n<e580ac> 7207\n<e580ad> 2125\n<e580ae> 14796\n<e580af> 7215\n<e580b0> 7201\n<e580b1> 7216\n<e580b3> 7205\n<e580b4> 14608\n<e580b5> 7214\n<e580b7> 7206\n<e580bb> 18849\n<e580bc> 2109\n<e58180> 7757\n<e58181> 7745\n<e58183> 2560\n<e58185> 7750\n<e58186> 7756\n<e58187> 2559\n<e58188> 7743\n<e58189> 2563\n<e5818a> 7747\n<e5818b> 7740\n<e5818c> 2561\n<e5818d> 7744\n<e5818e> 2566\n<e5818f> 2571\n<e58191> 7761\n<e58193> 7739\n<e58195> 2567\n<e58196> 16172\n<e58197> 7760\n<e58198> 14801\n<e5819a> 2562\n<e5819b> 7746\n<e5819c> 2558\n<e5819d> 7741\n<e5819e> 7737\n<e5819f> 7751\n<e581a0> 7738\n<e581a1> 7736\n<e581a2> 7748\n<e581a5> 2564\n<e581a6> 15817\n<e581a8> 8376\n<e581a9> 7752\n<e581aa> 7735\n<e581ab> 7753\n<e581ac> 14797\n<e581ad> 2574\n<e581ae> 7758\n<e581af> 2573\n<e581b0> 7734\n<e581b2> 7742\n<e581b3> 7759\n<e581b4> 2569\n<e581b5> 2568\n<e581b6> 2565\n<e581b7> 2570\n<e581ba> 2556\n<e581bd> 2557\n<e58280> 3052\n<e58281> 14798\n<e58282> 8379\n<e58283> 8372\n<e58285> 3049\n<e58287> 8380\n<e58288> 17308\n<e5828b> 8370\n<e5828c> 8373\n<e5828d> 3048\n<e5828e> 8374\n<e58290> 16876\nendcidchar\n\n100 begincidchar\n<e58291> 3051\n<e58292> 8378\n<e58294> 8368\n<e58295> 8367\n<e58296> 3053\n<e58298> 3054\n<e58299> 3050\n<e5829a> 3055\n<e5829b> 8366\n<e5829c> 8377\n<e5829d> 8375\n<e5829e> 8369\n<e582a2> 3047\n<e582a3> 8371\n<e582a6> 16191\n<e582ac> 3525\n<e582ad> 3519\n<e582ae> 9063\n<e582af> 3528\n<e582b0> 9069\n<e582b1> 9072\n<e582b4> 9066\n<e582b5> 3520\n<e582b6> 9075\n<e582b7> 3526\n<e582b8> 9076\n<e582ba> 9071\n<e582bb> 3527\n<e582bc> 18897\n<e582bd> 9060\n<e582be> 3524\n<e582bf> 9061\n<e58381> 9070\n<e58382> 9068\n<e58384> 9064\n<e58385> 3523\n<e58386> 9062\n<e58387> 3529\n<e58388> 9067\n<e58389> 9074\n<e5838a> 9065\n<e5838b> 9073\n<e5838d> 14789\n<e5838e> 3976\n<e5838f> 3973\n<e58390> 14545\n<e58391> 3974\n<e58393> 9756\n<e58394> 9748\n<e58395> 3972\n<e58396> 3969\n<e58397> 9749\n<e58399> 16334\n<e5839a> 3971\n<e5839b> 9752\n<e5839d> 9754\n<e5839e> 16433\n<e5839f> 15101\n<e583a0> 9761\n<e583a1> 16753\n<e583a3> 9760\n<e583a4> 9755\n<e583a5> 3968\n<e583a6> 9747\n<e583a7> 3966\n<e583a8> 9750\n<e583a9> 3977\n<e583aa> 9753\n<e583ac> 9757\n<e583ad> 3970\n<e583ae> 3967\n<e583af> 9759\n<e583b0> 9758\n<e583b1> 3975\n<e583b3> 9751\n<e583b4> 15593\n<e583b5> 4357\n<e583b6> 10371\n<e583b8> 10368\n<e583b9> 4358\n<e583bb> 4356\n<e583bc> 14802\n<e583bd> 10375\n<e583be> 10372\n<e583bf> 10365\n<e58480> 4355\n<e58481> 16434\n<e58482> 4359\n<e58483> 10366\n<e58484> 4354\n<e58485> 4362\n<e5848a> 10376\n<e5848d> 14790\n<e5848e> 16436\n<e58490> 4749\n<e58491> 11012\n<e58492> 4746\n<e58493> 11009\n<e58494> 4748\n<e58495> 4750\nendcidchar\n\n100 begincidchar\n<e58497> 11010\n<e58498> 4747\n<e5849a> 11011\n<e5849c> 11008\n<e5849f> 5045\n<e584a0> 11582\n<e584a1> 5046\n<e584a2> 11580\n<e584a4> 11581\n<e584a5> 11579\n<e584a6> 11578\n<e584a9> 11583\n<e584aa> 5044\n<e584ab> 14766\n<e584b0> 10367\n<e584b1> 12046\n<e584b2> 5047\n<e584b3> 5493\n<e584b9> 12998\n<e584ba> 12997\n<e584bb> 5820\n<e584bc> 5819\n<e584bd> 13326\n<e584bf> 604\n<e58580> 628\n<e58581> 682\n<e58583> 681\n<e58584> 771\n<e58585> 770\n<e58586> 906\n<e58587> 905\n<e58588> 907\n<e58589> 904\n<e5858b> 1076\n<e5858c> 1075\n<e5858d> 1077\n<e58592> 1349\n<e58594> 1348\n<e58595> 1350\n<e58596> 17306\n<e58597> 1724\n<e58599> 281\n<e5859a> 7218\n<e5859b> 282\n<e5859c> 2575\n<e5859d> 284\n<e5859e> 283\n<e5859f> 8381\n<e585a0> 16442\n<e585a1> 285\n<e585a2> 3978\n<e585a3> 286\n<e585a5> 605\n<e585a7> 683\n<e585a8> 908\n<e585a9> 1351\n<e585aa> 16444\n<e585ab> 606\n<e585ac> 686\n<e585b1> 909\n<e585b4> 17727\n<e585b5> 1078\n<e585b6> 1353\n<e585b7> 1352\n<e585b8> 1354\n<e585b9> 15054\n<e585bc> 2130\n<e58680> 4751\n<e58682> 541\n<e58686> 17311\n<e58687> 6009\n<e58688> 14006\n<e5868d> 910\n<e5868f> 6195\n<e58691> 1726\n<e58692> 1725\n<e58693> 7220\n<e58694> 7219\n<e58695> 2576\n<e58696> 542\n<e58697> 687\n<e58698> 6016\n<e5869a> 16035\n<e5869c> 17728\n<e5869e> 6416\n<e586a0> 1727\n<e586a2> 2133\n<e586a7> 16038\n<e586a8> 14810\n<e586aa> 4752\n<e586ab> 543\n<e586ac> 774\n<e586ae> 18876\n<e586b0> 911\n<e586b1> 6086\n<e586b2> 16456\n<e586b3> 16465\n<e586b4> 15740\n<e586b5> 16402\n<e586b8> 16457\nendcidchar\n\n100 begincidchar\n<e586b9> 6196\n<e586bc> 6417\n<e586bd> 1355\n<e586be> 6418\n<e58783> 14811\n<e58786> 2136\n<e58787> 16938\n<e58788> 7224\n<e58789> 16459\n<e5878a> 7221\n<e5878b> 2137\n<e5878c> 2135\n<e5878d> 2134\n<e5878e> 7225\n<e5878f> 16460\n<e58790> 7762\n<e58791> 16461\n<e58792> 15789\n<e58793> 16463\n<e58794> 8382\n<e58797> 9077\n<e58798> 9762\n<e5879b> 17818\n<e5879c> 4363\n<e5879d> 4753\n<e5879e> 11013\n<e5879f> 16975\n<e587a0> 607\n<e587a1> 621\n<e587a2> 18758\n<e587a4> 17729\n<e587ad> 16468\n<e587b0> 2577\n<e587b1> 3057\n<e587b3> 3979\n<e587b4> 16760\n<e587b5> 5998\n<e587b6> 688\n<e587b8> 777\n<e587bc> 17819\n<e587bd> 1356\n<e587be> 16138\n<e58882> 14003\n<e58883> 629\n<e58885> 17313\n<e58889> 6039\n<e5888a> 778\n<e5888b> 16473\n<e5888c> 6038\n<e5888e> 915\n<e58890> 6088\n<e58893> 6087\n<e58896> 916\n<e58897> 912\n<e5889c> 6197\n<e5889d> 1675\n<e5889e> 6198\n<e5889f> 16224\n<e588a0> 18736\n<e588a1> 6199\n<e588a4> 1082\n<e588a5> 1081\n<e588a6> 16474\n<e588a7> 17314\n<e588a8> 1085\n<e588ae> 1362\n<e588b0> 1361\n<e588b1> 6423\n<e588b4> 16123\n<e588b5> 6419\n<e588b6> 1363\n<e588b7> 1359\n<e588b8> 1358\n<e588ba> 1360\n<e588bb> 1357\n<e588bc> 16475\n<e58981> 1364\n<e58983> 1729\n<e58984> 6765\n<e58986> 6422\n<e58987> 1734\n<e58989> 6766\n<e5898a> 1730\n<e5898b> 1733\n<e5898c> 1732\n<e5898d> 1731\n<e5898e> 1728\n<e5898f> 19120\n<e58992> 7228\n<e58994> 2140\n<e58995> 7231\n<e58996> 2138\n<e58997> 16477\n<e58999> 14820\n<e5899a> 7227\n<e5899b> 2141\n<e5899c> 2139\n<e5899d> 2142\n<e589a0> 16169\n<e589a1> 7226\nendcidchar\n\n100 begincidchar\n<e589a2> 7232\n<e589a8> 17945\n<e589a9> 3061\n<e589aa> 2578\n<e589ab> 7763\n<e589ac> 7765\n<e589ad> 7764\n<e589ae> 7766\n<e589af> 2579\n<e589b2> 3058\n<e589b3> 16195\n<e589b7> 3531\n<e589b8> 9079\n<e589b9> 17315\n<e589ba> 9078\n<e589bd> 3532\n<e589bf> 3530\n<e58a82> 3981\n<e58a83> 3980\n<e58a84> 10102\n<e58a8a> 4368\n<e58a8d> 4367\n<e58a8f> 15807\n<e58a90> 17821\n<e58a91> 4754\n<e58a93> 4755\n<e58a94> 16478\n<e58a96> 12412\n<e58a97> 13000\n<e58a98> 12999\n<e58a99> 13327\n<e58a9a> 16232\n<e58a9b> 610\n<e58a9f> 780\n<e58aa0> 779\n<e58aa1> 17730\n<e58aa3> 917\n<e58aa4> 14821\n<e58aa6> 6089\n<e58aa8> 17731\n<e58aab> 1086\n<e58aac> 1089\n<e58ab5> 16476\n<e58ab9> 16479\n<e58abb> 1366\n<e58abc> 6424\n<e58abe> 1365\n<e58b80> 6767\n<e58b81> 1738\n<e58b82> 6768\n<e58b83> 1737\n<e58b85> 16480\n<e58b87> 1735\n<e58b89> 1736\n<e58b8c> 16097\n<e58b8d> 7233\n<e58b90> 16649\n<e58b91> 16170\n<e58b92> 2580\n<e58b93> 7768\n<e58b95> 2583\n<e58b96> 7767\n<e58b97> 2767\n<e58b98> 2582\n<e58b99> 2581\n<e58b9b> 3064\n<e58b9d> 3063\n<e58b9e> 3062\n<e58b9f> 3533\n<e58ba0> 16483\n<e58ba1> 14823\n<e58ba4> 3535\n<e58ba6> 3534\n<e58ba9> 9765\n<e58bab> 9766\n<e58baf> 10380\n<e58bb0> 4369\n<e58bb1> 10379\n<e58bb3> 4756\n<e58bb4> 11584\n<e58bb5> 5048\n<e58bb7> 12413\n<e58bb8> 5641\n<e58bb9> 544\n<e58bba> 630\n<e58bbb> 692\n<e58bbc> 6017\n<e58c81> 15737\n<e58c88> 918\n<e58c89> 6202\n<e58c8d> 1739\n<e58c8e> 7234\n<e58c8f> 2585\n<e58c90> 2584\n<e58c91> 8384\n<e58c92> 8383\n<e58c95> 611\n<e58c96> 695\n<e58c97> 783\n<e58c99> 2586\nendcidchar\n\n100 begincidchar\n<e58c9a> 5999\n<e58c9c> 6040\n<e58c9d> 784\n<e58c9f> 6091\n<e58ca0> 920\n<e58ca1> 919\n<e58ca2> 6090\n<e58ca3> 1090\n<e58ca4> 18888\n<e58ca7> 17822\n<e58caa> 2143\n<e58cac> 16182\n<e58cad> 7769\n<e58caf> 3538\n<e58cb0> 9767\n<e58cb1> 3982\n<e58cb2> 16336\n<e58cb3> 16493\n<e58cb4> 11014\n<e58cb7> 12743\n<e58cb8> 545\n<e58cb9> 696\n<e58cbb> 17732\n<e58cbc> 6427\n<e58cbd> 6769\n<e58cbe> 2589\n<e58cbf> 2587\n<e58d80> 2588\n<e58d81> 612\n<e58d82> 18759\n<e58d83> 631\n<e58d84> 363\n<e58d85> 699\n<e58d87> 698\n<e58d88> 697\n<e58d89> 787\n<e58d8a> 786\n<e58d8c> 6041\n<e58d8d> 6092\n<e58d8e> 17733\n<e58d91> 1370\n<e58d92> 1367\n<e58d93> 1369\n<e58d94> 1368\n<e58d97> 1740\n<e58d9a> 3065\n<e58d9c> 613\n<e58d9d> 17665\n<e58d9e> 700\n<e58d9f> 17319\n<e58da0> 789\n<e58da1> 788\n<e58da3> 6203\n<e58da4> 18442\n<e58da6> 1371\n<e58da7> 16077\n<e58da9> 546\n<e58dac> 6018\n<e58dad> 16506\n<e58dae> 791\n<e58daf> 790\n<e58db2> 6204\n<e58db3> 1091\n<e58db4> 16507\n<e58db5> 1092\n<e58dbb> 1741\n<e58dbc> 6770\n<e58dbd> 18689\n<e58dbe> 16509\n<e58dbf> 2144\n<e58e82> 6000\n<e58e84> 701\n<e58e8a> 6093\n<e58e92> 6428\n<e58e93> 16514\n<e58e94> 6429\n<e58e96> 6772\n<e58e97> 6771\n<e58e98> 6774\n<e58e99> 6773\n<e58e9a> 1742\n<e58e9c> 7770\n<e58e9d> 2146\n<e58e9e> 7235\n<e58e9f> 2145\n<e58ea0> 16516\n<e58ea2> 15915\n<e58ea4> 8385\n<e58ea5> 3066\n<e58ea6> 16699\n<e58ea7> 8386\n<e58ea8> 16702\n<e58ea9> 17824\n<e58eaa> 16326\n<e58eab> 16517\n<e58eac> 9768\n<e58ead> 3983\n<e58eae> 16518\n<e58eb0> 17826\n<e58eb2> 4370\nendcidchar\n\n100 begincidchar\n<e58eb4> 12414\n<e58eb6> 547\n<e58eb9> 6019\n<e58ebb> 792\n<e58f81> 16523\n<e58f82> 17318\n<e58f83> 2590\n<e58f85> 16524\n<e58f88> 614\n<e58f89> 632\n<e58f8a> 703\n<e58f8b> 702\n<e58f8c> 14518\n<e58f8d> 704\n<e58f90> 14842\n<e58f91> 17734\n<e58f92> 15933\n<e58f94> 1376\n<e58f96> 1375\n<e58f97> 1377\n<e58f98> 17735\n<e58f99> 16528\n<e58f9a> 16185\n<e58f9b> 1743\n<e58f9f> 2147\n<e58fa0> 16531\n<e58fa1> 11015\n<e58fa2> 5321\n<e58fa3> 633\n<e58fa4> 794\n<e58fa5> 809\n<e58fa6> 804\n<e58fa8> 799\n<e58fa9> 798\n<e58faa> 805\n<e58fab> 803\n<e58fac> 796\n<e58fad> 810\n<e58fae> 797\n<e58faf> 793\n<e58fb0> 808\n<e58fb1> 807\n<e58fb2> 806\n<e58fb3> 795\n<e58fb5> 802\n<e58fb6> 16534\n<e58fb7> 14344\n<e58fb8> 801\n<e58fbb> 811\n<e58fbc> 800\n<e58fbe> 16577\n<e59081> 928\n<e59083> 934\n<e59084> 930\n<e59086> 936\n<e59087> 6094\n<e59088> 933\n<e59089> 923\n<e5908a> 926\n<e5908b> 929\n<e5908c> 925\n<e5908d> 932\n<e5908e> 935\n<e5908f> 924\n<e59090> 927\n<e59091> 931\n<e59092> 937\n<e59093> 16536\n<e59094> 15479\n<e59096> 15999\n<e59098> 6215\n<e59099> 6212\n<e5909a> 15972\n<e5909b> 1105\n<e5909c> 6213\n<e5909d> 1093\n<e5909e> 1095\n<e5909f> 1119\n<e590a0> 1114\n<e590a1> 16899\n<e590a3> 17827\n<e590a4> 6220\n<e590a5> 6214\n<e590a6> 1097\n<e590a7> 1099\n<e590a8> 6219\n<e590a9> 1106\n<e590aa> 6209\n<e590ab> 1118\n<e590ac> 1120\n<e590ad> 1094\n<e590ae> 1111\n<e590af> 16556\n<e590b0> 6207\n<e590b1> 1117\n<e590b2> 15989\n<e590b3> 1102\n<e590b4> 18901\n<e590b7> 6208\n<e590b8> 1110\nendcidchar\n\n100 begincidchar\n<e590b9> 1108\n<e590bb> 1109\n<e590bc> 1115\n<e590bd> 6216\n<e590be> 1096\n<e59180> 1116\n<e59181> 6218\n<e59182> 1104\n<e59183> 1101\n<e59185> 6211\n<e59186> 1100\n<e59187> 6221\n<e59188> 1103\n<e5918a> 1107\n<e5918b> 16081\n<e5918c> 19129\n<e5918d> 16039\n<e5918e> 1098\n<e5918f> 6217\n<e59194> 6210\n<e591a0> 6446\n<e591a1> 6445\n<e591a2> 1395\n<e591a3> 6448\n<e591a4> 6450\n<e591a5> 6439\n<e591a6> 6442\n<e591a7> 6449\n<e591a8> 1396\n<e591a9> 16178\n<e591aa> 15747\n<e591ab> 6436\n<e591ac> 6440\n<e591ad> 16541\n<e591af> 6444\n<e591b0> 6789\n<e591b1> 1391\n<e591b2> 6793\n<e591b3> 1378\n<e591b4> 6441\n<e591b5> 1379\n<e591b6> 1392\n<e591b7> 1385\n<e591b8> 1381\n<e591ba> 6437\n<e591bb> 1384\n<e591bc> 1389\n<e591bd> 1398\n<e591be> 6438\n<e591bf> 6431\n<e59280> 1383\n<e59281> 6432\n<e59282> 6434\n<e59284> 1386\n<e59285> 18137\n<e59286> 1388\n<e59287> 6430\n<e59288> 6435\n<e5928b> 1397\n<e5928c> 1393\n<e5928d> 6443\n<e5928e> 1399\n<e5928f> 16545\n<e59290> 1390\n<e59291> 6433\n<e59292> 1387\n<e59293> 17831\n<e59294> 16024\n<e59295> 1382\n<e59296> 1380\n<e59297> 16010\n<e59298> 6447\n<e5929a> 1394\n<e5929c> 16230\n<e5929e> 18413\n<e592a0> 6788\n<e592a1> 6776\n<e592a2> 6791\n<e592a3> 17832\n<e592a4> 16546\n<e592a5> 6778\n<e592a6> 1750\n<e592a7> 1764\n<e592a8> 1746\n<e592a9> 1763\n<e592aa> 1755\n<e592ab> 1760\n<e592ac> 1744\n<e592ad> 6777\n<e592ae> 6783\n<e592af> 1759\n<e592b0> 6795\n<e592b1> 1761\n<e592b2> 14148\n<e592b3> 1751\n<e592b4> 17833\n<e592b6> 6785\n<e592b7> 6782\n<e592b8> 1749\n<e592b9> 17834\nendcidchar\n\n100 begincidchar\n<e592ba> 6775\n<e592bb> 1762\n<e592bc> 6790\n<e592bd> 1754\n<e592be> 6792\n<e592bf> 1765\n<e59380> 1745\n<e59381> 1756\n<e59382> 1753\n<e59383> 6780\n<e59384> 1757\n<e59387> 1752\n<e59388> 1758\n<e59389> 1748\n<e5938b> 14755\n<e5938c> 17890\n<e5938d> 14848\n<e5938e> 1747\n<e5938f> 6779\n<e59390> 17835\n<e59396> 6784\n<e5939a> 18723\n<e5939e> 6794\n<e593a0> 7255\n<e593a1> 2160\n<e593a2> 7237\n<e593a3> 17217\n<e593a4> 7242\n<e593a5> 2153\n<e593a6> 2164\n<e593a7> 7240\n<e593a8> 2148\n<e593a9> 2158\n<e593aa> 2163\n<e593ab> 7247\n<e593ad> 2159\n<e593ae> 2162\n<e593af> 17836\n<e593b1> 7250\n<e593b2> 2154\n<e593b3> 7241\n<e593ba> 2156\n<e593bb> 7252\n<e593bc> 2152\n<e593bd> 2167\n<e593bf> 7244\n<e59481> 2150\n<e59482> 15564\n<e59483> 7257\n<e59484> 7245\n<e59485> 7249\n<e59486> 2155\n<e59487> 2166\n<e59488> 7246\n<e59489> 2161\n<e5948a> 7251\n<e5948b> 7258\n<e5948c> 7785\n<e5948d> 14963\n<e5948e> 7256\n<e5948f> 2168\n<e59490> 2149\n<e59491> 7248\n<e59492> 7239\n<e59493> 16041\n<e59494> 2157\n<e59497> 7238\n<e59498> 17837\n<e5949a> 7243\n<e5949e> 16040\n<e594a3> 17838\n<e594a5> 17161\n<e594a6> 7236\n<e594a7> 2165\n<e594a8> 17839\n<e594aa> 7777\n<e594ab> 16538\n<e594ac> 2609\n<e594ad> 7791\n<e594ae> 2607\n<e594af> 2604\n<e594b0> 7782\n<e594b1> 2600\n<e594b2> 7786\n<e594b3> 2611\n<e594b4> 7776\n<e594b5> 7781\n<e594b6> 7780\n<e594b7> 2151\n<e594b8> 2606\n<e594b9> 7789\n<e594bb> 7792\n<e594bc> 7773\n<e594be> 3084\n<e594bf> 17321\n<e59580> 7793\n<e59581> 2612\n<e59583> 2598\n<e59584> 2595\n<e59585> 7784\nendcidchar\n\n100 begincidchar\n<e59586> 2592\n<e59587> 16554\n<e59588> 7790\n<e59589> 16488\n<e5958a> 2599\n<e5958b> 7794\n<e5958d> 7774\n<e5958e> 7788\n<e5958f> 2602\n<e59590> 7775\n<e59591> 7778\n<e59592> 7783\n<e59593> 18762\n<e59595> 2603\n<e59596> 2601\n<e59597> 2613\n<e5959c> 2608\n<e5959d> 16544\n<e5959e> 2596\n<e5959f> 2748\n<e595a1> 2597\n<e595a2> 7779\n<e595a3> 2610\n<e595a4> 2605\n<e595a5> 7787\n<e595a6> 2594\n<e595a9> 16031\n<e595aa> 2593\n<e595ab> 15150\n<e595b1> 15302\n<e595b2> 16011\n<e595b3> 16164\n<e595b7> 8391\n<e595b9> 17245\n<e595bb> 3067\n<e595bc> 3070\n<e595bd> 8402\n<e595be> 3090\n<e595bf> 8405\n<e59680> 3068\n<e59681> 8398\n<e59682> 3074\n<e59683> 3080\n<e59684> 3355\n<e59686> 16558\n<e59687> 3078\n<e59688> 8395\n<e59689> 3091\n<e5968a> 3071\n<e5968b> 3079\n<e5968c> 8403\n<e5968d> 9095\n<e5968e> 8408\n<e5968f> 8396\n<e59690> 17166\n<e59691> 8387\n<e59692> 8400\n<e59693> 8394\n<e59694> 3077\n<e59695> 8406\n<e59698> 3073\n<e59699> 3093\n<e5969a> 3086\n<e5969c> 3075\n<e5969d> 3072\n<e5969f> 3083\n<e596a1> 8407\n<e596a2> 8393\n<e596a3> 8399\n<e596a4> 8401\n<e596a5> 8389\n<e596a6> 8404\n<e596a7> 3069\n<e596a8> 8388\n<e596a9> 16559\n<e596aa> 3076\n<e596ab> 3092\n<e596ac> 3088\n<e596ad> 8390\n<e596ae> 3082\n<e596b0> 14581\n<e596b1> 3089\n<e596b2> 3085\n<e596b3> 3081\n<e596b4> 14846\n<e596b5> 8397\n<e596b9> 17892\n<e596ba> 16009\n<e596bb> 3087\n<e596bc> 15811\n<e596bf> 9093\n<e59780> 9089\n<e59781> 15951\n<e59782> 9104\n<e59783> 9082\n<e59784> 9091\n<e59787> 3545\n<e59788> 9100\n<e59789> 3555\n<e5978a> 9087\nendcidchar\n\n100 begincidchar\n<e5978b> 9086\n<e5978c> 9084\n<e5978d> 9102\n<e5978e> 3543\n<e5978f> 9096\n<e59790> 9085\n<e59791> 3546\n<e59792> 9094\n<e59793> 3541\n<e59794> 9090\n<e59795> 9097\n<e59796> 9099\n<e59797> 17843\n<e59798> 17323\n<e59799> 9103\n<e5979a> 3550\n<e5979b> 9083\n<e5979c> 3544\n<e5979d> 9088\n<e5979e> 18661\n<e5979f> 3539\n<e597a1> 3551\n<e597a2> 9098\n<e597a5> 3554\n<e597a6> 3542\n<e597a7> 287\n<e597a8> 3540\n<e597a9> 9092\n<e597aa> 15996\n<e597ac> 14290\n<e597af> 3549\n<e597b0> 16008\n<e597b1> 16003\n<e597b2> 9101\n<e597b5> 18310\n<e597b6> 3999\n<e597b7> 3994\n<e597b9> 9783\n<e597ba> 9779\n<e597bb> 17958\n<e597bc> 9773\n<e597bd> 3988\n<e597be> 3984\n<e597bf> 9782\n<e59880> 3985\n<e59881> 9776\n<e59882> 9778\n<e59884> 9781\n<e59885> 16002\n<e59886> 3990\n<e59888> 3997\n<e59889> 3991\n<e5988c> 9771\n<e5988f> 9774\n<e59890> 3998\n<e59891> 16205\n<e59892> 9772\n<e59893> 9777\n<e59894> 3989\n<e59895> 9770\n<e59896> 3995\n<e59897> 3987\n<e5989b> 3986\n<e5989c> 9775\n<e5989d> 9780\n<e5989e> 15976\n<e5989f> 3996\n<e598a0> 16253\n<e598a1> 17325\n<e598a2> 15975\n<e598a3> 18183\n<e598a5> 15992\n<e598a7> 9769\n<e598a9> 4377\n<e598aa> 10397\n<e598ac> 10394\n<e598ad> 15971\n<e598ae> 4371\n<e598b2> 4374\n<e598b3> 10392\n<e598b4> 4376\n<e598b5> 10384\n<e598b6> 4382\n<e598b7> 16567\n<e598b8> 10396\n<e598b9> 4373\n<e598ba> 10398\n<e598bb> 4372\n<e598bd> 10393\n<e598be> 10395\n<e598bf> 4375\n<e59980> 10391\n<e59981> 10385\n<e59982> 10382\n<e59983> 15998\n<e59985> 8392\n<e59986> 10388\n<e59988> 10381\n<e59989> 10387\n<e5998a> 10386\nendcidchar\n\n100 begincidchar\n<e5998c> 10383\n<e5998d> 16572\n<e5998e> 4379\n<e5998f> 16573\n<e59990> 18383\n<e59992> 17858\n<e59993> 4378\n<e59994> 17327\n<e59997> 4380\n<e59998> 10389\n<e59999> 4757\n<e5999a> 10390\n<e5999d> 16121\n<e5999e> 11024\n<e599a0> 11017\n<e599a1> 14354\n<e599a2> 4769\n<e599a3> 11021\n<e599a4> 4761\n<e599a5> 4765\n<e599a6> 11020\n<e599a8> 4764\n<e599a9> 4760\n<e599aa> 4763\n<e599ab> 4758\n<e599ac> 4768\n<e599ad> 11022\n<e599ae> 11018\n<e599af> 4767\n<e599b0> 11016\n<e599b1> 4766\n<e599b2> 11023\n<e599b3> 11019\n<e599b4> 4381\n<e599b6> 4770\n<e599b7> 11025\n<e599b8> 4762\n<e599b9> 4759\n<e599ba> 15749\n<e599bb> 16055\n<e599bc> 16109\n<e599be> 11591\n<e599bf> 11593\n<e59a80> 5050\n<e59a81> 11594\n<e59a82> 11592\n<e59a83> 11590\n<e59a84> 11589\n<e59a85> 5052\n<e59a86> 11588\n<e59a87> 5053\n<e59a89> 17960\n<e59a8a> 14665\n<e59a8b> 15948\n<e59a8e> 5049\n<e59a8f> 5054\n<e59a90> 5051\n<e59a92> 14758\n<e59a93> 11585\n<e59a95> 5322\n<e59a97> 12051\n<e59a98> 12049\n<e59a99> 12054\n<e59a9a> 12052\n<e59a9c> 12050\n<e59a9d> 12053\n<e59a9e> 14756\n<e59a9f> 14664\n<e59aa1> 17259\n<e59aa4> 15560\n<e59aa5> 5494\n<e59aa8> 5495\n<e59aaa> 12419\n<e59aab> 12415\n<e59aac> 12420\n<e59aad> 12416\n<e59aae> 5323\n<e59aaf> 17911\n<e59ab1> 17983\n<e59ab2> 12744\n<e59ab3> 12746\n<e59ab4> 5644\n<e59ab5> 12745\n<e59ab6> 5643\n<e59ab7> 5642\n<e59ab9> 18543\n<e59abc> 5645\n<e59abf> 15965\n<e59b80> 5739\n<e59b81> 5738\n<e59b82> 5740\n<e59b83> 13001\n<e59b85> 13177\n<e59b86> 13176\n<e59b88> 5821\n<e59b89> 5823\n<e59b8a> 5822\n<e59b8b> 13178\n<e59b8c> 5878\n<e59b8d> 13441\nendcidchar\n\n100 begincidchar\n<e59b91> 5919\n<e59b93> 13440\n<e59b94> 13513\n<e59b96> 18570\n<e59b97> 6005\n<e59b9a> 813\n<e59b9b> 812\n<e59b9d> 940\n<e59b9e> 939\n<e59b9f> 6096\n<e59ba0> 938\n<e59ba1> 6095\n<e59ba2> 17736\n<e59ba4> 1123\n<e59ba5> 6224\n<e59ba7> 6223\n<e59baa> 1121\n<e59bab> 1124\n<e59bad> 16580\n<e59bae> 6222\n<e59baf> 16579\n<e59bb0> 1122\n<e59bb1> 16575\n<e59bb7> 6451\n<e59bb9> 6452\n<e59bba> 1400\n<e59bbb> 19002\n<e59bbd> 15716\n<e59bbf> 1766\n<e59c80> 16578\n<e59c87> 7796\n<e59c88> 2614\n<e59c89> 2616\n<e59c8a> 7795\n<e59c8b> 2615\n<e59c8c> 8409\n<e59c8d> 3094\n<e59c94> 9105\n<e59c95> 15926\n<e59c96> 4001\n<e59c98> 4000\n<e59c9a> 10399\n<e59c9b> 11027\n<e59c9c> 11026\n<e59c9d> 14850\n<e59c9e> 13573\n<e59c9f> 634\n<e59ca0> 6020\n<e59ca8> 943\n<e59ca9> 947\n<e59caa> 6098\n<e59cac> 945\n<e59cad> 944\n<e59cae> 6097\n<e59caf> 946\n<e59cb0> 942\n<e59cb2> 15097\n<e59cb3> 941\n<e59cb4> 6099\n<e59cbb> 1134\n<e59cbd> 18950\n<e59cbe> 1131\n<e59cbf> 18517\n<e59d80> 1127\n<e59d81> 6225\n<e59d82> 16588\n<e59d83> 16606\n<e59d85> 6226\n<e59d86> 16584\n<e59d87> 1129\n<e59d89> 6228\n<e59d8a> 1125\n<e59d8b> 6229\n<e59d8c> 6227\n<e59d8d> 1128\n<e59d8e> 1130\n<e59d8f> 1133\n<e59d90> 1132\n<e59d91> 1126\n<e59d92> 6230\n<e59d94> 18309\n<e59d97> 18406\n<e59d9b> 14722\n<e59d9f> 16319\n<e59da1> 1405\n<e59da2> 6465\n<e59da4> 1407\n<e59da6> 1406\n<e59da7> 16171\n<e59da8> 6466\n<e59da9> 1404\n<e59daa> 1403\n<e59dab> 6456\n<e59dad> 6455\n<e59daf> 6453\n<e59db0> 6458\n<e59db1> 6457\n<e59db2> 6454\n<e59db5> 6461\n<e59db6> 6459\nendcidchar\n\n100 begincidchar\n<e59db7> 1402\n<e59dba> 18722\n<e59dbb> 6462\n<e59dbc> 1408\n<e59dbd> 6467\n<e59dbe> 18140\n<e59dbf> 14855\n<e59e80> 6460\n<e59e82> 1767\n<e59e83> 1401\n<e59e88> 18507\n<e59e8a> 15483\n<e59e8b> 1768\n<e59e8c> 6800\n<e59e8d> 14854\n<e59e8f> 6806\n<e59e90> 16742\n<e59e93> 1774\n<e59e94> 6804\n<e59e95> 6810\n<e59e97> 6801\n<e59e98> 6805\n<e59e99> 6807\n<e59e9a> 6809\n<e59e9b> 6803\n<e59e9c> 17928\n<e59e9d> 6802\n<e59ea0> 1769\n<e59ea1> 18532\n<e59ea2> 1771\n<e59ea3> 1770\n<e59ea4> 6799\n<e59ea5> 6808\n<e59ea7> 18708\n<e59eaa> 18693\n<e59eae> 1773\n<e59eb3> 19127\n<e59eb4> 18241\n<e59eb5> 6796\n<e59eb6> 7270\n<e59eb8> 7269\n<e59eb9> 7274\n<e59eba> 7265\n<e59ebb> 15481\n<e59ebc> 7268\n<e59ebd> 7267\n<e59ebe> 14124\n<e59ebf> 7271\n<e59f81> 7275\n<e59f82> 2171\n<e59f83> 2174\n<e59f84> 15195\n<e59f86> 7266\n<e59f87> 7272\n<e59f88> 15627\n<e59f8b> 2173\n<e59f8c> 7261\n<e59f8e> 1772\n<e59f8f> 7810\n<e59f90> 7273\n<e59f92> 7264\n<e59f94> 2172\n<e59f95> 7263\n<e59f97> 15485\n<e59f9c> 7801\n<e59f9d> 14853\n<e59f9e> 16129\n<e59f9f> 2617\n<e59fa0> 2621\n<e59fa1> 7817\n<e59fa2> 7799\n<e59fa3> 7813\n<e59fa4> 2622\n<e59fa5> 7815\n<e59fa6> 16591\n<e59fa7> 7821\n<e59fa9> 7825\n<e59fac> 7816\n<e59fad> 7804\n<e59fae> 7812\n<e59faf> 18260\n<e59fb0> 7826\n<e59fb1> 7824\n<e59fb2> 7814\n<e59fb3> 7809\n<e59fb4> 7802\n<e59fb5> 8417\n<e59fb6> 7800\n<e59fb7> 2626\n<e59fb8> 7807\n<e59fb9> 2627\n<e59fba> 2623\n<e59fbb> 7797\n<e59fbc> 7819\n<e59fbd> 7805\n<e59fbe> 16527\n<e5a080> 7803\n<e5a081> 7822\n<e5a082> 2624\n<e5a083> 16593\nendcidchar\n\n100 begincidchar\n<e5a084> 7828\n<e5a085> 2618\n<e5a086> 2620\n<e5a087> 7811\n<e5a088> 7806\n<e5a089> 2175\n<e5a08a> 2619\n<e5a08b> 7808\n<e5a08c> 7823\n<e5a08d> 7827\n<e5a08e> 7818\n<e5a090> 7820\n<e5a092> 15626\n<e5a094> 7798\n<e5a098> 19132\n<e5a099> 8412\n<e5a09b> 8421\n<e5a09c> 8420\n<e5a09d> 3102\n<e5a09e> 8413\n<e5a09f> 16598\n<e5a0a0> 3103\n<e5a0a1> 3101\n<e5a0a2> 15400\n<e5a0a3> 8415\n<e5a0a4> 3098\n<e5a0a5> 8419\n<e5a0a6> 16596\n<e5a0a7> 8414\n<e5a0a8> 8416\n<e5a0a9> 8410\n<e5a0aa> 3096\n<e5a0ac> 8429\n<e5a0ad> 8428\n<e5a0ae> 8425\n<e5a0af> 3095\n<e5a0b2> 7262\n<e5a0b3> 8422\n<e5a0b4> 3097\n<e5a0b5> 2625\n<e5a0b6> 8424\n<e5a0b7> 8411\n<e5a0b8> 8427\n<e5a0b9> 8426\n<e5a0ba> 15730\n<e5a0bb> 8430\n<e5a0bd> 9119\n<e5a0bf> 8423\n<e5a180> 15746\n<e5a184> 18363\n<e5a187> 15042\n<e5a188> 8418\n<e5a189> 9111\n<e5a18a> 3567\n<e5a18b> 3570\n<e5a18c> 3565\n<e5a18d> 9110\n<e5a18e> 9114\n<e5a18f> 9109\n<e5a191> 3559\n<e5a192> 3569\n<e5a193> 9106\n<e5a194> 3563\n<e5a195> 9113\n<e5a197> 3561\n<e5a198> 3560\n<e5a199> 9116\n<e5a19a> 3562\n<e5a19b> 9118\n<e5a19c> 18761\n<e5a19d> 9115\n<e5a19e> 3558\n<e5a19f> 17375\n<e5a1a2> 3568\n<e5a1a3> 9120\n<e5a1a4> 9108\n<e5a1a5> 9117\n<e5a1a8> 9107\n<e5a1a9> 15717\n<e5a1ab> 3564\n<e5a1ac> 14746\n<e5a1ad> 3566\n<e5a1af> 9112\n<e5a1b1> 9121\n<e5a1b2> 15398\n<e5a1b3> 17237\n<e5a1b4> 9791\n<e5a1b5> 4002\n<e5a1b6> 9797\n<e5a1b9> 4007\n<e5a1ba> 9793\n<e5a1bb> 9800\n<e5a1bc> 9785\n<e5a1bd> 4009\n<e5a1be> 4003\n<e5a1bf> 9790\n<e5a280> 4385\n<e5a281> 9789\n<e5a282> 9798\n<e5a283> 4004\nendcidchar\n\n100 begincidchar\n<e5a285> 4008\n<e5a286> 9788\n<e5a287> 9794\n<e5a288> 9799\n<e5a289> 9784\n<e5a28a> 4006\n<e5a28b> 9792\n<e5a28e> 9796\n<e5a28f> 9802\n<e5a290> 9786\n<e5a291> 9795\n<e5a292> 18903\n<e5a293> 4005\n<e5a294> 9801\n<e5a296> 19108\n<e5a298> 9787\n<e5a299> 17944\n<e5a29a> 18691\n<e5a29c> 4389\n<e5a29d> 10401\n<e5a29e> 4387\n<e5a29f> 4386\n<e5a2a0> 10403\n<e5a2a1> 10408\n<e5a2a3> 10404\n<e5a2a5> 10407\n<e5a2a6> 4392\n<e5a2a7> 16107\n<e5a2a8> 4744\n<e5a2a9> 4391\n<e5a2aa> 16599\n<e5a2ab> 10400\n<e5a2ac> 10406\n<e5a2ae> 4390\n<e5a2af> 10405\n<e5a2b0> 14244\n<e5a2b1> 10402\n<e5a2b3> 4388\n<e5a2b5> 18496\n<e5a2b6> 15869\n<e5a2ba> 11032\n<e5a2bb> 14059\n<e5a2bc> 11034\n<e5a2bd> 11029\n<e5a2be> 4772\n<e5a2bf> 11031\n<e5a381> 4771\n<e5a382> 11033\n<e5a385> 4774\n<e5a386> 11035\n<e5a387> 4773\n<e5a388> 11028\n<e5a389> 11030\n<e5a38b> 14857\n<e5a38e> 5058\n<e5a38f> 11597\n<e5a390> 18904\n<e5a391> 5057\n<e5a392> 11598\n<e5a393> 5056\n<e5a394> 11596\n<e5a395> 5055\n<e5a396> 11595\n<e5a398> 5325\n<e5a399> 5324\n<e5a39a> 12421\n<e5a39b> 12423\n<e5a39c> 16602\n<e5a39d> 12422\n<e5a3a0> 16601\n<e5a3a2> 5498\n<e5a3a3> 12747\n<e5a3a4> 5646\n<e5a3a7> 13329\n<e5a3a8> 13328\n<e5a3a9> 5920\n<e5a3ab> 635\n<e5a3ac> 705\n<e5a3af> 1135\n<e5a3b0> 17737\n<e5a3b2> 15720\n<e5a3b3> 15482\n<e5a3b4> 6811\n<e5a3bb> 16604\n<e5a3bc> 9122\n<e5a3bd> 4010\n<e5a3be> 9803\n<e5a3bf> 10409\n<e5a482> 548\n<e5a483> 6021\n<e5a484> 17738\n<e5a485> 17817\n<e5a486> 6231\n<e5a487> 17739\n<e5a48a> 548\n<e5a48c> 6468\n<e5a48d> 6812\n<e5a48e> 7276\n<e5a48f> 2176\n<e5a491> 17012\nendcidchar\n\n100 begincidchar\n<e5a492> 12424\n<e5a494> 5741\n<e5a495> 636\n<e5a496> 814\n<e5a497> 6044\n<e5a49c> 1409\n<e5a49d> 19004\n<e5a49f> 16611\n<e5a4a0> 2628\n<e5a4a2> 4012\n<e5a4a4> 4013\n<e5a4a5> 4011\n<e5a4a7> 637\n<e5a4a9> 706\n<e5a4aa> 708\n<e5a4ab> 707\n<e5a4ac> 6022\n<e5a4ad> 709\n<e5a4ae> 815\n<e5a4af> 6045\n<e5a4b1> 816\n<e5a4b2> 17740\n<e5a4b4> 17741\n<e5a4bc> 6100\n<e5a4be> 1136\n<e5a580> 6232\n<e5a584> 1413\n<e5a585> 6469\n<e5a589> 1410\n<e5a58a> 7277\n<e5a58e> 1778\n<e5a58f> 1777\n<e5a590> 1779\n<e5a591> 1776\n<e5a593> 6813\n<e5a594> 1414\n<e5a595> 1775\n<e5a59a> 2179\n<e5a59c> 7829\n<e5a5a0> 3106\n<e5a5a1> 8431\n<e5a5a2> 2629\n<e5a5a5> 18514\n<e5a5a7> 3571\n<e5a5a9> 4015\n<e5a5aa> 4014\n<e5a5ab> 9804\n<e5a5ad> 4393\n<e5a5ae> 4775\n<e5a5b0> 12055\n<e5a5b1> 13179\n<e5a5b2> 13330\n<e5a5b3> 638\n<e5a5b4> 817\n<e5a5b5> 15978\n<e5a5b6> 818\n<e5a5b7> 6106\n<e5a5b8> 953\n<e5a5b9> 956\n<e5a5bb> 6104\n<e5a5bc> 6102\n<e5a5bd> 955\n<e5a5be> 6105\n<e5a5bf> 6107\n<e5a680> 6101\n<e5a681> 958\n<e5a682> 957\n<e5a683> 954\n<e5a684> 952\n<e5a685> 6103\n<e5a689> 15664\n<e5a68a> 1147\n<e5a68d> 1144\n<e5a68e> 6237\n<e5a68f> 6240\n<e5a690> 6239\n<e5a692> 1138\n<e5a693> 1146\n<e5a694> 15513\n<e5a696> 1143\n<e5a697> 6236\n<e5a698> 6234\n<e5a699> 1142\n<e5a69a> 15280\n<e5a69d> 1137\n<e5a69e> 1140\n<e5a69f> 15791\n<e5a6a0> 6235\n<e5a6a1> 6242\n<e5a6a2> 6238\n<e5a6a3> 1141\n<e5a6a4> 1145\n<e5a6a5> 1148\n<e5a6a6> 6233\n<e5a6a7> 6241\n<e5a6a8> 1139\n<e5a6ac> 15745\n<e5a6ae> 1419\n<e5a6af> 1427\n<e5a6b0> 15576\nendcidchar\n\n100 begincidchar\n<e5a6b1> 6481\n<e5a6b2> 6474\n<e5a6b3> 1428\n<e5a6b4> 6485\n<e5a6b5> 6470\n<e5a6b6> 6477\n<e5a6b7> 16173\n<e5a6b8> 14864\n<e5a6b9> 1418\n<e5a6ba> 6471\n<e5a6bb> 1416\n<e5a6bc> 6478\n<e5a6bd> 6482\n<e5a6be> 1415\n<e5a6bf> 19052\n<e5a780> 6483\n<e5a781> 6476\n<e5a783> 6479\n<e5a784> 15620\n<e5a785> 1430\n<e5a786> 1421\n<e5a787> 6486\n<e5a788> 6484\n<e5a789> 16620\n<e5a78a> 1426\n<e5a78b> 1424\n<e5a78c> 6475\n<e5a78d> 1423\n<e5a78e> 6473\n<e5a78f> 6472\n<e5a790> 1422\n<e5a791> 1420\n<e5a792> 1429\n<e5a793> 1425\n<e5a794> 1417\n<e5a796> 6480\n<e5a798> 1781\n<e5a799> 16625\n<e5a79a> 1788\n<e5a79b> 6827\n<e5a79c> 1780\n<e5a79d> 6819\n<e5a79e> 6815\n<e5a7a0> 6831\n<e5a7a1> 6814\n<e5a7a3> 1783\n<e5a7a4> 6824\n<e5a7a5> 1786\n<e5a7a6> 1789\n<e5a7a8> 1784\n<e5a7a9> 6828\n<e5a7aa> 1787\n<e5a7ab> 15705\n<e5a7ac> 2186\n<e5a7ad> 6834\n<e5a7ae> 6816\n<e5a7af> 15672\n<e5a7b0> 15282\n<e5a7b1> 6818\n<e5a7b2> 6825\n<e5a7b3> 6829\n<e5a7b4> 6833\n<e5a7b5> 6830\n<e5a7b6> 6823\n<e5a7b7> 6826\n<e5a7b8> 15946\n<e5a7b9> 16632\n<e5a7ba> 6820\n<e5a7bb> 1791\n<e5a7bc> 6822\n<e5a7bd> 6821\n<e5a7be> 6832\n<e5a7bf> 1782\n<e5a880> 6817\n<e5a881> 1790\n<e5a882> 15245\n<e5a883> 1785\n<e5a889> 2192\n<e5a88a> 7285\n<e5a88b> 15497\n<e5a88c> 2191\n<e5a88d> 15160\n<e5a88f> 7283\n<e5a891> 2180\n<e5a892> 14867\n<e5a893> 2185\n<e5a895> 7282\n<e5a896> 7279\n<e5a897> 7284\n<e5a898> 2181\n<e5a899> 7278\n<e5a89a> 18946\n<e5a89b> 2184\n<e5a89c> 2182\n<e5a89e> 7286\n<e5a89f> 2183\n<e5a8a0> 2187\n<e5a8a1> 14875\n<e5a8a3> 2188\n<e5a8a4> 16616\nendcidchar\n\n100 begincidchar\n<e5a8a5> 2190\n<e5a8a7> 15841\n<e5a8a9> 2189\n<e5a8aa> 15163\n<e5a8ab> 15680\n<e5a8ac> 14863\n<e5a8b3> 7287\n<e5a8b5> 7836\n<e5a8b6> 2630\n<e5a8b7> 8445\n<e5a8b8> 7835\n<e5a8b9> 7854\n<e5a8bc> 2636\n<e5a8bd> 15040\n<e5a8be> 7852\n<e5a980> 2635\n<e5a981> 2631\n<e5a982> 7861\n<e5a983> 7845\n<e5a984> 7848\n<e5a985> 14615\n<e5a986> 2639\n<e5a987> 7858\n<e5a988> 7850\n<e5a989> 2632\n<e5a98a> 2640\n<e5a98c> 7855\n<e5a98d> 7853\n<e5a990> 7838\n<e5a991> 7859\n<e5a992> 7847\n<e5a993> 7842\n<e5a994> 17923\n<e5a995> 7832\n<e5a996> 7860\n<e5a997> 7844\n<e5a998> 7831\n<e5a999> 15156\n<e5a99a> 2638\n<e5a99b> 7849\n<e5a99c> 7862\n<e5a99d> 7846\n<e5a99e> 7834\n<e5a99f> 7839\n<e5a9a0> 7830\n<e5a9a1> 15667\n<e5a9a2> 2637\n<e5a9a3> 16635\n<e5a9a4> 7843\n<e5a9a5> 7840\n<e5a9a6> 2633\n<e5a9a7> 7833\n<e5a9a8> 14775\n<e5a9a9> 7857\n<e5a9aa> 2634\n<e5a9ab> 14914\n<e5a9ac> 7841\n<e5a9ad> 7837\n<e5a9ae> 15679\n<e5a9b0> 7856\n<e5a9b1> 15668\n<e5a9b7> 3107\n<e5a9b8> 8438\n<e5a9b9> 15585\n<e5a9ba> 8435\n<e5a9bb> 8452\n<e5a9bc> 8440\n<e5a9bd> 8453\n<e5a9be> 14865\n<e5a9bf> 3109\n<e5aa81> 14877\n<e5aa82> 15665\n<e5aa83> 8449\n<e5aa84> 8446\n<e5aa86> 15233\n<e5aa88> 16995\n<e5aa8a> 8447\n<e5aa8b> 8450\n<e5aa8c> 8454\n<e5aa8e> 7851\n<e5aa8f> 8456\n<e5aa90> 9142\n<e5aa91> 16949\n<e5aa92> 3110\n<e5aa93> 8457\n<e5aa94> 8433\n<e5aa95> 8443\n<e5aa96> 16640\n<e5aa97> 8448\n<e5aa99> 14858\n<e5aa9a> 3108\n<e5aa9b> 3111\n<e5aa9c> 8455\n<e5aa9d> 8458\n<e5aa9e> 8437\n<e5aa9f> 8434\n<e5aaa0> 16754\n<e5aaa1> 15580\n<e5aaa2> 8436\n<e5aaa4> 19011\nendcidchar\n\n100 begincidchar\n<e5aaa5> 8441\n<e5aaa6> 8439\n<e5aaa7> 3112\n<e5aaa9> 8451\n<e5aaab> 16634\n<e5aaac> 8442\n<e5aaae> 8444\n<e5aaaf> 8432\n<e5aab0> 9130\n<e5aab1> 9128\n<e5aab2> 3580\n<e5aab3> 3578\n<e5aab4> 9138\n<e5aab5> 9129\n<e5aab6> 9139\n<e5aab7> 9135\n<e5aab8> 9127\n<e5aab9> 9141\n<e5aaba> 9126\n<e5aabb> 9133\n<e5aabc> 3577\n<e5aabd> 3576\n<e5aabe> 3575\n<e5aabf> 9131\n<e5ab80> 9136\n<e5ab81> 3572\n<e5ab82> 3579\n<e5ab83> 14486\n<e5ab84> 9124\n<e5ab86> 9134\n<e5ab87> 9123\n<e5ab88> 9132\n<e5ab89> 3573\n<e5ab8a> 9137\n<e5ab8b> 9125\n<e5ab8c> 3574\n<e5ab8d> 9140\n<e5ab8e> 15496\n<e5ab8f> 14866\n<e5ab91> 19014\n<e5ab93> 16642\n<e5ab95> 9808\n<e5ab96> 4020\n<e5ab97> 4019\n<e5ab98> 4021\n<e5ab99> 9820\n<e5ab9a> 9810\n<e5ab9b> 9816\n<e5ab9c> 9805\n<e5ab9d> 9819\n<e5ab9e> 9818\n<e5ab9f> 9822\n<e5aba0> 9815\n<e5aba1> 4016\n<e5aba2> 9814\n<e5aba3> 4022\n<e5aba4> 15238\n<e5aba5> 9807\n<e5aba6> 4017\n<e5aba8> 9821\n<e5aba9> 4018\n<e5abaa> 9809\n<e5abab> 9812\n<e5abac> 9817\n<e5abad> 9811\n<e5abae> 9806\n<e5abb0> 16103\n<e5abb2> 14325\n<e5abb3> 9813\n<e5abb4> 10411\n<e5abb5> 4397\n<e5abb6> 10414\n<e5abb7> 10413\n<e5abb8> 10416\n<e5abb9> 10418\n<e5abba> 14062\n<e5abbb> 4395\n<e5abbd> 10412\n<e5abbe> 15389\n<e5abbf> 10410\n<e5ac81> 10419\n<e5ac82> 10417\n<e5ac83> 10415\n<e5ac85> 10421\n<e5ac87> 10420\n<e5ac88> 4399\n<e5ac89> 4394\n<e5ac8b> 4396\n<e5ac8c> 4398\n<e5ac8d> 18687\n<e5ac8f> 10422\n<e5ac90> 11042\n<e5ac91> 15350\n<e5ac93> 11041\n<e5ac94> 11040\n<e5ac95> 18921\n<e5ac96> 11043\n<e5ac97> 11036\n<e5ac99> 11037\n<e5ac9a> 11045\nendcidchar\n\n100 begincidchar\n<e5ac9b> 11038\n<e5ac9d> 4776\n<e5ac9e> 11047\n<e5ac9f> 18753\n<e5aca0> 11046\n<e5aca1> 11039\n<e5aca3> 11602\n<e5aca4> 5061\n<e5aca5> 11600\n<e5aca6> 11605\n<e5aca7> 11604\n<e5aca8> 11044\n<e5acaa> 5060\n<e5acab> 15236\n<e5acac> 11603\n<e5acad> 11599\n<e5acae> 11607\n<e5acaf> 11606\n<e5acb0> 5059\n<e5acb2> 11601\n<e5acb4> 4777\n<e5acb8> 5326\n<e5acbc> 12056\n<e5ad80> 5647\n<e5ad81> 14536\n<e5ad83> 5648\n<e5ad84> 14916\n<e5ad85> 12748\n<e5ad86> 17074\n<e5ad87> 13005\n<e5ad88> 13004\n<e5ad8a> 14541\n<e5ad8d> 13331\n<e5ad8e> 13442\n<e5ad8f> 14897\n<e5ad93> 641\n<e5ad94> 710\n<e5ad95> 819\n<e5ad96> 6108\n<e5ad9c> 1150\n<e5ad9d> 1149\n<e5ad9f> 1431\n<e5ada2> 6487\n<e5ada3> 1433\n<e5ada4> 1432\n<e5ada5> 6488\n<e5ada6> 17742\n<e5ada8> 17949\n<e5ada9> 1792\n<e5adab> 2193\n<e5adac> 7288\n<e5adad> 15967\n<e5adae> 7864\n<e5adb0> 2641\n<e5adb1> 3114\n<e5adb2> 7863\n<e5adb3> 3113\n<e5adb4> 14130\n<e5adb5> 4023\n<e5adb6> 16650\n<e5adb7> 9823\n<e5adb8> 4778\n<e5adba> 5062\n<e5adbb> 11608\n<e5adbc> 16652\n<e5adbd> 5649\n<e5adbf> 5824\n<e5ae80> 549\n<e5ae81> 6046\n<e5ae82> 16452\n<e5ae83> 820\n<e5ae84> 6047\n<e5ae85> 963\n<e5ae89> 964\n<e5ae8b> 1154\n<e5ae8c> 1153\n<e5ae8e> 6243\n<e5ae8f> 1155\n<e5ae90> 18665\n<e5ae92> 6244\n<e5ae93> 6489\n<e5ae95> 6490\n<e5ae96> 18962\n<e5ae97> 1434\n<e5ae98> 1436\n<e5ae99> 1438\n<e5ae9a> 1435\n<e5ae9b> 1439\n<e5ae9c> 1437\n<e5ae9d> 16662\n<e5aea2> 1796\n<e5aea3> 1793\n<e5aea4> 1795\n<e5aea5> 1797\n<e5aea6> 1794\n<e5aea7> 7289\n<e5aea8> 6835\n<e5aeaa> 16763\n<e5aeac> 7291\n<e5aead> 7290\nendcidchar\n\n100 begincidchar\n<e5aeae> 2199\n<e5aeb0> 2195\n<e5aeb3> 2196\n<e5aeb4> 2198\n<e5aeb5> 2200\n<e5aeb6> 2197\n<e5aeb7> 19015\n<e5aeb8> 2202\n<e5aeb9> 2201\n<e5aebf> 2646\n<e5af80> 7866\n<e5af81> 7865\n<e5af82> 2645\n<e5af83> 16165\n<e5af84> 2644\n<e5af85> 2643\n<e5af86> 2647\n<e5af87> 2642\n<e5af8a> 8464\n<e5af8b> 8461\n<e5af8c> 3116\n<e5af8d> 8460\n<e5af8e> 8465\n<e5af90> 3118\n<e5af91> 8463\n<e5af92> 3115\n<e5af93> 3117\n<e5af94> 8462\n<e5af95> 16657\n<e5af96> 9143\n<e5af97> 17083\n<e5af9b> 19009\n<e5af9e> 4024\n<e5af9f> 4032\n<e5afa0> 9824\n<e5afa1> 4026\n<e5afa2> 4030\n<e5afa3> 9825\n<e5afa4> 4031\n<e5afa7> 4025\n<e5afa8> 4029\n<e5afa9> 4402\n<e5afaa> 8459\n<e5afab> 4403\n<e5afac> 4401\n<e5afae> 4400\n<e5afaf> 11048\n<e5afb0> 4779\n<e5afb3> 16661\n<e5afb5> 5499\n<e5afb6> 5650\n<e5afb8> 642\n<e5afba> 965\n<e5afbf> 16605\n<e5b081> 1798\n<e5b083> 7292\n<e5b084> 2203\n<e5b085> 16664\n<e5b087> 2650\n<e5b088> 2649\n<e5b089> 2648\n<e5b08c> 8466\n<e5b08d> 4033\n<e5b08e> 4780\n<e5b08f> 643\n<e5b090> 6023\n<e5b091> 711\n<e5b092> 6048\n<e5b093> 16666\n<e5b094> 16668\n<e5b095> 6109\n<e5b096> 966\n<e5b09a> 1440\n<e5b09c> 17898\n<e5b09e> 14889\n<e5b09f> 9146\n<e5b0a0> 15753\n<e5b0a2> 644\n<e5b0a3> 17640\n<e5b0a4> 712\n<e5b0a5> 6110\n<e5b0a8> 6245\n<e5b0aa> 6246\n<e5b0ac> 1156\n<e5b0b0> 8467\n<e5b0b1> 3121\n<e5b0b3> 9147\n<e5b0b7> 5063\n<e5b0b8> 645\n<e5b0b9> 665\n<e5b0ba> 713\n<e5b0bb> 6049\n<e5b0bc> 821\n<e5b0be> 1160\n<e5b0bf> 1159\n<e5b184> 6491\n<e5b187> 6492\n<e5b188> 1441\n<e5b189> 16671\n<e5b18a> 16220\nendcidchar\n\n100 begincidchar\n<e5b18b> 1802\n<e5b18c> 6836\n<e5b18d> 1801\n<e5b190> 2206\n<e5b191> 2204\n<e5b193> 16130\n<e5b194> 7294\n<e5b195> 2205\n<e5b196> 7293\n<e5b198> 2194\n<e5b199> 7867\n<e5b19e> 15719\n<e5b1a0> 2651\n<e5b1a2> 4034\n<e5b1a3> 9826\n<e5b1a7> 10423\n<e5b1a8> 5064\n<e5b1ac> 5742\n<e5b1ad> 13443\n<e5b1ae> 6006\n<e5b1af> 714\n<e5b1b1> 646\n<e5b1b3> 6051\n<e5b1b4> 6050\n<e5b1b8> 19035\n<e5b1b9> 967\n<e5b1bc> 6111\n<e5b1be> 6114\n<e5b285> 16673\n<e5b286> 6254\n<e5b288> 6249\n<e5b289> 6251\n<e5b28a> 6253\n<e5b28b> 6250\n<e5b28c> 1164\n<e5b28d> 6247\n<e5b28f> 6248\n<e5b292> 6252\n<e5b293> 6255\n<e5b294> 1163\n<e5b295> 6256\n<e5b299> 18060\n<e5b29a> 17745\n<e5b29c> 18778\n<e5b29d> 6506\n<e5b29e> 14890\n<e5b29f> 6500\n<e5b2a0> 6495\n<e5b2a1> 1445\n<e5b2a2> 6503\n<e5b2a3> 6501\n<e5b2a4> 6494\n<e5b2a5> 6507\n<e5b2a6> 6510\n<e5b2a7> 6505\n<e5b2a8> 6498\n<e5b2a9> 1447\n<e5b2aa> 6504\n<e5b2ab> 1448\n<e5b2ac> 6499\n<e5b2ad> 6502\n<e5b2ae> 6493\n<e5b2af> 6497\n<e5b2b0> 6509\n<e5b2b1> 1449\n<e5b2b3> 1450\n<e5b2b5> 6496\n<e5b2b6> 6508\n<e5b2b7> 1444\n<e5b2b8> 1446\n<e5b2ba> 16683\n<e5b381> 17336\n<e5b382> 15692\n<e5b386> 6853\n<e5b387> 6846\n<e5b388> 6852\n<e5b389> 6845\n<e5b38a> 6847\n<e5b38b> 6841\n<e5b38c> 6839\n<e5b38e> 6854\n<e5b38f> 6851\n<e5b390> 6837\n<e5b391> 16147\n<e5b392> 1804\n<e5b395> 19032\n<e5b396> 6848\n<e5b397> 6840\n<e5b398> 6838\n<e5b399> 1803\n<e5b39a> 6844\n<e5b39b> 6842\n<e5b39e> 6843\n<e5b39f> 6855\n<e5b3a5> 17975\n<e5b3a8> 2211\n<e5b3a9> 16674\n<e5b3aa> 2210\n<e5b3ac> 7295\n<e5b3ad> 2207\nendcidchar\n\n100 begincidchar\n<e5b3ae> 7297\n<e5b3af> 16675\n<e5b3b0> 2212\n<e5b3b1> 7298\n<e5b3b4> 2215\n<e5b3b5> 18857\n<e5b3b6> 2213\n<e5b3b7> 7299\n<e5b3b8> 6856\n<e5b3b9> 7301\n<e5b3bb> 2209\n<e5b3bc> 19016\n<e5b3bd> 2208\n<e5b3bf> 7296\n<e5b480> 7300\n<e5b481> 2214\n<e5b486> 2655\n<e5b487> 2654\n<e5b48b> 7869\n<e5b48c> 7873\n<e5b48d> 7875\n<e5b48e> 2656\n<e5b48f> 7878\n<e5b490> 16679\n<e5b491> 2660\n<e5b492> 7880\n<e5b494> 2662\n<e5b495> 17337\n<e5b496> 2658\n<e5b497> 2666\n<e5b498> 16680\n<e5b499> 2663\n<e5b49a> 7871\n<e5b49b> 2657\n<e5b49d> 7870\n<e5b49e> 7868\n<e5b49f> 7882\n<e5b4a0> 7872\n<e5b4a2> 2659\n<e5b4a3> 7881\n<e5b4a4> 2664\n<e5b4a5> 7877\n<e5b4a6> 7876\n<e5b4a7> 2665\n<e5b4a8> 7874\n<e5b4a9> 2661\n<e5b4ac> 15863\n<e5b4ae> 7883\n<e5b4af> 18131\n<e5b4b0> 7879\n<e5b4b1> 8482\n<e5b4b2> 8489\n<e5b4b3> 8478\n<e5b4b4> 3124\n<e5b4b5> 8474\n<e5b4b6> 8490\n<e5b4b7> 8468\n<e5b4b8> 8487\n<e5b4b9> 8485\n<e5b4ba> 8479\n<e5b4bc> 8488\n<e5b4bd> 8481\n<e5b4be> 17961\n<e5b4bf> 8473\n<e5b580> 8491\n<e5b581> 8471\n<e5b582> 8484\n<e5b583> 8469\n<e5b585> 8492\n<e5b586> 16681\n<e5b587> 3125\n<e5b588> 17962\n<e5b589> 8486\n<e5b58a> 9150\n<e5b58b> 8472\n<e5b58c> 3122\n<e5b58e> 8476\n<e5b590> 3123\n<e5b591> 8475\n<e5b592> 8480\n<e5b595> 8477\n<e5b596> 17338\n<e5b597> 16330\n<e5b599> 8483\n<e5b59b> 15829\n<e5b59e> 9154\n<e5b5a2> 9157\n<e5b5a3> 9149\n<e5b5a5> 9151\n<e5b5a7> 9156\n<e5b5a8> 9155\n<e5b5a9> 3581\n<e5b5ab> 8470\n<e5b5ac> 9153\n<e5b5af> 3582\n<e5b5b0> 18148\n<e5b5b1> 9148\n<e5b5b2> 9152\n<e5b5b4> 16111\n<e5b5b7> 9833\nendcidchar\n\n100 begincidchar\n<e5b5b8> 19038\n<e5b5b9> 9840\n<e5b5ba> 9831\n<e5b5bb> 18957\n<e5b5bc> 9838\n<e5b5bd> 9829\n<e5b5be> 9837\n<e5b5bf> 9841\n<e5b680> 9828\n<e5b681> 9832\n<e5b682> 9827\n<e5b684> 4035\n<e5b685> 15924\n<e5b686> 9830\n<e5b687> 4036\n<e5b688> 9836\n<e5b689> 9835\n<e5b68a> 9834\n<e5b68b> 16676\n<e5b68d> 9839\n<e5b68e> 16140\n<e5b692> 10427\n<e5b693> 10429\n<e5b694> 4407\n<e5b695> 10430\n<e5b697> 10425\n<e5b699> 10424\n<e5b69a> 10434\n<e5b69c> 10432\n<e5b69d> 4406\n<e5b69e> 10435\n<e5b69f> 10426\n<e5b6a0> 10431\n<e5b6a1> 10433\n<e5b6a2> 10428\n<e5b6a4> 17965\n<e5b6a7> 11052\n<e5b6a8> 11057\n<e5b6a9> 11051\n<e5b6aa> 11056\n<e5b6ab> 15929\n<e5b6ac> 11049\n<e5b6ad> 11059\n<e5b6ae> 11055\n<e5b6af> 11060\n<e5b6b0> 11054\n<e5b6b1> 11050\n<e5b6b2> 11058\n<e5b6b4> 11061\n<e5b6b5> 11053\n<e5b6b6> 16728\n<e5b6b7> 11611\n<e5b6b8> 5068\n<e5b6b9> 17966\n<e5b6ba> 5066\n<e5b6bc> 5065\n<e5b6bd> 5067\n<e5b780> 12059\n<e5b781> 15359\n<e5b782> 12323\n<e5b783> 12428\n<e5b789> 5651\n<e5b78b> 13006\n<e5b78d> 5743\n<e5b78f> 13007\n<e5b791> 13183\n<e5b792> 5826\n<e5b794> 5825\n<e5b795> 13182\n<e5b796> 5879\n<e5b797> 16684\n<e5b798> 13332\n<e5b79b> 550\n<e5b79d> 647\n<e5b79e> 968\n<e5b79f> 6115\n<e5b7a0> 6257\n<e5b7a1> 1306\n<e5b7a2> 2667\n<e5b7a5> 648\n<e5b7a6> 824\n<e5b7a7> 823\n<e5b7a8> 822\n<e5b7ab> 1165\n<e5b7ae> 2216\n<e5b7b0> 9158\n<e5b7b4> 715\n<e5b7b5> 16225\n<e5b7b7> 1805\n<e5b7b9> 6857\n<e5b7bd> 3126\n<e5b7be> 652\n<e5b7bf> 6024\n<e5b884> 6052\n<e5b886> 969\n<e5b889> 16704\n<e5b88a> 6258\n<e5b88b> 15754\n<e5b88c> 1166\n<e5b88e> 6259\nendcidchar\n\n100 begincidchar\n<e5b891> 1456\n<e5b892> 16174\n<e5b894> 6512\n<e5b895> 1454\n<e5b896> 1453\n<e5b897> 6511\n<e5b898> 1451\n<e5b899> 6513\n<e5b89a> 1452\n<e5b89b> 1455\n<e5b89d> 1806\n<e5b89f> 1808\n<e5b8a0> 6861\n<e5b8a4> 6862\n<e5b8a5> 1807\n<e5b8a8> 7303\n<e5b8a9> 7302\n<e5b8ab> 2218\n<e5b8ad> 2217\n<e5b8ae> 16693\n<e5b8b3> 2670\n<e5b8b4> 7885\n<e5b8b6> 2669\n<e5b8b7> 2671\n<e5b8b8> 2668\n<e5b8bd> 3128\n<e5b8be> 7884\n<e5b980> 3129\n<e5b981> 8494\n<e5b982> 17312\n<e5b983> 3130\n<e5b984> 8493\n<e5b985> 3127\n<e5b988> 14892\n<e5b98a> 9161\n<e5b98b> 9163\n<e5b98c> 3583\n<e5b98d> 9162\n<e5b98e> 9160\n<e5b98f> 9159\n<e5b993> 9844\n<e5b994> 4041\n<e5b995> 4039\n<e5b997> 4040\n<e5b99b> 4037\n<e5b99c> 10439\n<e5b99d> 10437\n<e5b99e> 14891\n<e5b99f> 4409\n<e5b9a0> 10438\n<e5b9a1> 4410\n<e5b9a2> 4408\n<e5b9a3> 4038\n<e5b9a6> 11064\n<e5b9a9> 10436\n<e5b9aa> 11613\n<e5b9ab> 5069\n<e5b9ac> 11612\n<e5b9af> 11065\n<e5b9b0> 12429\n<e5b9b2> 653\n<e5b9b3> 827\n<e5b9b4> 971\n<e5b9b5> 6116\n<e5b9b6> 970\n<e5b9b8> 1457\n<e5b9b9> 3584\n<e5b9ba> 551\n<e5b9bb> 716\n<e5b9bc> 828\n<e5b9bd> 1809\n<e5b9be> 3131\n<e5b9bf> 552\n<e5ba80> 6053\n<e5ba82> 6054\n<e5ba83> 16648\n<e5ba84> 6117\n<e5ba86> 17746\n<e5ba87> 1168\n<e5ba88> 6263\n<e5ba89> 6261\n<e5ba8a> 1169\n<e5ba8b> 6260\n<e5ba8c> 6262\n<e5ba8d> 6264\n<e5ba8f> 1167\n<e5ba92> 18906\n<e5ba97> 1459\n<e5ba99> 18907\n<e5ba9a> 1458\n<e5ba9b> 6866\n<e5ba9c> 1460\n<e5baa0> 1810\n<e5baa2> 6865\n<e5baa3> 6867\n<e5baa4> 6864\n<e5baa5> 6868\n<e5baa6> 1811\n<e5baa7> 2221\n<e5baa8> 7304\nendcidchar\n\n100 begincidchar\n<e5baaa> 7306\n<e5baab> 2219\n<e5baac> 7307\n<e5baad> 2220\n<e5baae> 7305\n<e5bab0> 6863\n<e5bab1> 7886\n<e5bab4> 7887\n<e5bab5> 2675\n<e5bab6> 2674\n<e5bab9> 7888\n<e5babd> 17341\n<e5babe> 2676\n<e5bb84> 3135\n<e5bb85> 9164\n<e5bb86> 9166\n<e5bb87> 9168\n<e5bb88> 3586\n<e5bb89> 3585\n<e5bb8a> 3132\n<e5bb8b> 9167\n<e5bb8c> 9165\n<e5bb8d> 14896\n<e5bb8e> 9848\n<e5bb90> 16014\n<e5bb91> 9846\n<e5bb92> 9852\n<e5bb93> 4042\n<e5bb94> 9853\n<e5bb95> 9850\n<e5bb96> 4043\n<e5bb97> 9847\n<e5bb98> 9845\n<e5bb99> 9851\n<e5bb9a> 4412\n<e5bb9b> 10441\n<e5bb9c> 9849\n<e5bb9d> 4414\n<e5bb9e> 10442\n<e5bb9f> 4413\n<e5bba0> 4416\n<e5bba1> 10443\n<e5bba2> 4411\n<e5bba3> 4415\n<e5bba5> 11070\n<e5bba6> 11068\n<e5bba7> 11067\n<e5bba8> 11069\n<e5bba9> 11066\n<e5bbac> 5501\n<e5bbb1> 13008\n<e5bbb2> 13184\n<e5bbb3> 5954\n<e5bbb4> 553\n<e5bbb6> 1463\n<e5bbb7> 1170\n<e5bbb8> 14447\n<e5bbb9> 16707\n<e5bbba> 1812\n<e5bbbb> 16708\n<e5bbbc> 16710\n<e5bbbe> 654\n<e5bbbf> 717\n<e5bc81> 829\n<e5bc82> 6118\n<e5bc84> 1171\n<e5bc85> 6265\n<e5bc87> 6869\n<e5bc88> 1813\n<e5bc8a> 4044\n<e5bc8b> 655\n<e5bc8c> 14910\n<e5bc8d> 16713\n<e5bc8e> 14911\n<e5bc8f> 972\n<e5bc92> 3587\n<e5bc93> 656\n<e5bc97> 831\n<e5bc98> 830\n<e5bc9a> 6119\n<e5bc9b> 973\n<e5bc9d> 6266\n<e5bc9f> 1172\n<e5bca5> 17968\n<e5bca8> 6514\n<e5bca9> 1466\n<e5bcad> 1814\n<e5bcae> 6870\n<e5bcb0> 7309\n<e5bcb1> 2222\n<e5bcb3> 7308\n<e5bcb5> 2677\n<e5bcb6> 7891\n<e5bcb7> 2678\n<e5bcb8> 7892\n<e5bcba> 16718\n<e5bcbb> 19056\n<e5bcbc> 3136\n<e5bd80> 9169\n<e5bd83> 9855\nendcidchar\n\n100 begincidchar\n<e5bd84> 9854\n<e5bd86> 4045\n<e5bd88> 4417\n<e5bd89> 10444\n<e5bd8a> 4781\n<e5bd8b> 11071\n<e5bd8c> 5070\n<e5bd8d> 15269\n<e5bd8e> 5827\n<e5bd8f> 13334\n<e5bd90> 554\n<e5bd91> 17641\n<e5bd94> 6518\n<e5bd96> 6871\n<e5bd97> 2679\n<e5bd98> 8495\n<e5bd99> 3588\n<e5bd9c> 15706\n<e5bd9d> 5327\n<e5bda1> 555\n<e5bda2> 1174\n<e5bda3> 16722\n<e5bda4> 1173\n<e5bda5> 1815\n<e5bda7> 7310\n<e5bda9> 2681\n<e5bdaa> 2953\n<e5bdab> 2682\n<e5bdac> 2680\n<e5bdad> 3137\n<e5bdaf> 9856\n<e5bdb0> 4046\n<e5bdb1> 4418\n<e5bdb2> 16724\n<e5bdb3> 6007\n<e5bdb4> 6120\n<e5bdb6> 6268\n<e5bdb7> 1175\n<e5bdb8> 6267\n<e5bdb9> 1176\n<e5bdbb> 16472\n<e5bdbc> 1470\n<e5bdbd> 6521\n<e5bdbe> 6520\n<e5bdbf> 1469\n<e5be82> 6519\n<e5be83> 17969\n<e5be85> 1817\n<e5be86> 6872\n<e5be87> 1820\n<e5be88> 1816\n<e5be89> 1822\n<e5be8c> 1821\n<e5be90> 2225\n<e5be91> 2224\n<e5be92> 2223\n<e5be96> 7894\n<e5be97> 2683\n<e5be98> 2686\n<e5be99> 2684\n<e5be9b> 7893\n<e5be9c> 2689\n<e5be9e> 2685\n<e5be9f> 7895\n<e5bea0> 2688\n<e5bea1> 2687\n<e5bea4> 16428\n<e5bea5> 8497\n<e5bea6> 8496\n<e5bea7> 16727\n<e5bea8> 3140\n<e5beab> 8498\n<e5beac> 3589\n<e5bead> 9171\n<e5beae> 3590\n<e5beaf> 9170\n<e5beb1> 15768\n<e5beb2> 10445\n<e5beb5> 4420\n<e5beb6> 9857\n<e5beb7> 4419\n<e5beb9> 4047\n<e5beba> 16287\n<e5bebb> 11073\n<e5bebc> 11072\n<e5bebd> 5071\n<e5bebe> 11614\n<e5bebf> 12430\n<e5bf82> 18908\n<e5bf83> 720\n<e5bf84> 17642\n<e5bf85> 832\n<e5bf89> 6055\n<e5bf8c> 1178\n<e5bf8d> 1180\n<e5bf8f> 6123\n<e5bf90> 6271\n<e5bf91> 6270\n<e5bf92> 6269\n<e5bf94> 6122\nendcidchar\n\n100 begincidchar\n<e5bf95> 6121\n<e5bf96> 975\n<e5bf97> 1179\n<e5bf98> 1177\n<e5bf99> 974\n<e5bf9b> 14922\n<e5bf9d> 1471\n<e5bf9e> 6522\n<e5bf9f> 16815\n<e5bfa0> 1472\n<e5bfa1> 6276\n<e5bfa3> 6278\n<e5bfa4> 6277\n<e5bfa5> 6523\n<e5bfa8> 6273\n<e5bfaa> 1184\n<e5bfab> 1182\n<e5bfad> 6272\n<e5bfae> 6274\n<e5bfaf> 6280\n<e5bfb1> 1181\n<e5bfb3> 6275\n<e5bfb4> 6284\n<e5bfb5> 1474\n<e5bfb7> 6281\n<e5bfb8> 1183\n<e5bfba> 6279\n<e5bfbb> 6282\n<e5bfbd> 1473\n<e5bfbf> 1475\n<e68080> 6283\n<e68089> 6543\n<e6808a> 6530\n<e6808b> 6528\n<e6808c> 6542\n<e6808d> 6537\n<e6808e> 1827\n<e6808f> 1476\n<e68090> 6538\n<e68091> 6541\n<e68092> 1823\n<e68093> 6540\n<e68094> 1477\n<e68095> 1482\n<e68096> 1480\n<e68097> 6531\n<e68099> 6526\n<e6809a> 6533\n<e6809b> 1487\n<e6809c> 6544\n<e6809d> 1824\n<e6809e> 6534\n<e680a0> 1825\n<e680a1> 1483\n<e680a2> 6536\n<e680a3> 16773\n<e680a4> 6887\n<e680a5> 1826\n<e680a6> 6525\n<e680a7> 1484\n<e680a8> 1828\n<e680a9> 1485\n<e680aa> 1481\n<e680ab> 1486\n<e680ac> 6535\n<e680ad> 6524\n<e680ae> 6539\n<e680af> 1478\n<e680b1> 16737\n<e680b2> 6527\n<e680b3> 6532\n<e680b4> 6529\n<e680b5> 1479\n<e680b7> 6873\n<e680b9> 6874\n<e680bb> 17747\n<e68180> 6884\n<e68181> 7314\n<e68182> 6885\n<e68183> 1834\n<e68184> 6888\n<e68185> 6878\n<e68186> 1833\n<e68187> 6880\n<e68189> 6881\n<e6818a> 16500\n<e6818c> 6883\n<e6818d> 1829\n<e68190> 2229\n<e68192> 14060\n<e68193> 6879\n<e68194> 6875\n<e68195> 2230\n<e68198> 6889\n<e68199> 2226\n<e6819a> 7312\n<e6819b> 6882\n<e6819d> 7311\n<e6819e> 6877\n<e6819f> 6886\nendcidchar\n\n100 begincidchar\n<e681a2> 1832\n<e681a3> 2227\n<e681a4> 1838\n<e681a5> 2228\n<e681a6> 6890\n<e681a7> 7313\n<e681a8> 1831\n<e681a9> 2232\n<e681aa> 1837\n<e681ab> 1836\n<e681ac> 1835\n<e681ad> 2231\n<e681ae> 6891\n<e681af> 2233\n<e681b0> 1830\n<e681b2> 6876\n<e681b5> 14934\n<e681b7> 16389\n<e681be> 14919\n<e681bf> 2690\n<e68280> 7317\n<e68281> 7319\n<e68283> 7321\n<e68284> 2234\n<e68285> 2240\n<e68286> 7898\n<e68287> 7325\n<e68288> 7316\n<e68289> 2692\n<e6828a> 7896\n<e6828c> 2239\n<e6828d> 2237\n<e6828e> 7327\n<e68290> 7897\n<e68292> 7318\n<e68294> 2238\n<e68295> 7322\n<e68296> 2241\n<e68297> 7324\n<e6829a> 2236\n<e6829b> 7323\n<e6829c> 7326\n<e6829d> 7320\n<e6829e> 16746\n<e6829f> 2235\n<e682a0> 2693\n<e682a2> 7315\n<e682a3> 2691\n<e682a4> 16385\n<e682a7> 15068\n<e682a8> 2694\n<e682b0> 7900\n<e682b1> 7909\n<e682b2> 3143\n<e682b3> 18768\n<e682b4> 2696\n<e682b5> 2701\n<e682b6> 3144\n<e682b7> 7911\n<e682b8> 2708\n<e682b9> 8500\n<e682ba> 7901\n<e682bb> 2700\n<e682bc> 2703\n<e682bd> 2698\n<e682be> 7899\n<e682bf> 7913\n<e68380> 7916\n<e68381> 8515\n<e68383> 7914\n<e68384> 8504\n<e68385> 2699\n<e68386> 2706\n<e68387> 2710\n<e68388> 7908\n<e68389> 8499\n<e6838a> 7912\n<e6838b> 2695\n<e6838c> 8501\n<e6838d> 7915\n<e6838e> 8503\n<e6838f> 7904\n<e68391> 3141\n<e68395> 2705\n<e68397> 17973\n<e68398> 2704\n<e68399> 7906\n<e6839a> 2709\n<e6839b> 7910\n<e6839c> 2702\n<e6839d> 7907\n<e6839e> 16890\n<e6839f> 2707\n<e683a0> 3145\n<e683a1> 3142\n<e683a2> 8502\n<e683a3> 15733\n<e683a4> 7905\n<e683a6> 2697\n<e683a7> 15748\nendcidchar\n\n100 begincidchar\n<e683a8> 15739\n<e683a9> 16393\n<e683aa> 16748\n<e683b0> 3150\n<e683b1> 3154\n<e683b2> 8506\n<e683b3> 3595\n<e683b4> 3152\n<e683b5> 8510\n<e683b6> 3156\n<e683b7> 9172\n<e683b8> 8512\n<e683b9> 3597\n<e683ba> 3148\n<e683bb> 3151\n<e683bc> 8513\n<e683bd> 16296\n<e683be> 8514\n<e683bf> 8520\n<e68480> 3158\n<e68481> 3598\n<e68483> 8516\n<e68484> 8521\n<e68485> 8509\n<e68486> 3608\n<e68487> 15413\n<e68488> 3599\n<e68489> 3157\n<e6848a> 8507\n<e6848b> 8522\n<e6848c> 15495\n<e6848d> 3607\n<e6848e> 3155\n<e6848f> 3592\n<e68490> 8519\n<e68492> 3159\n<e68493> 8511\n<e68494> 8505\n<e68495> 3149\n<e68496> 8508\n<e68498> 8517\n<e68499> 16118\n<e6849a> 3591\n<e6849b> 3596\n<e6849c> 3146\n<e6849d> 8518\n<e6849f> 3594\n<e684a2> 18862\n<e684a3> 3147\n<e684a7> 3606\n<e684a8> 9859\n<e684a9> 9183\n<e684ab> 9175\n<e684ac> 9858\n<e684ae> 9179\n<e684af> 9181\n<e684b0> 16183\n<e684b2> 9178\n<e684b4> 3605\n<e684b6> 9177\n<e684b7> 3609\n<e684bb> 9874\n<e684bd> 17974\n<e684be> 3604\n<e684bf> 4049\n<e68580> 9184\n<e68581> 9860\n<e68582> 16756\n<e68584> 3602\n<e68585> 9176\n<e68586> 9180\n<e68587> 4048\n<e68588> 3593\n<e6858b> 4050\n<e6858c> 3601\n<e6858d> 3603\n<e6858e> 3600\n<e6858f> 9182\n<e68590> 15410\n<e68594> 9870\n<e68595> 4425\n<e68596> 9877\n<e68598> 4056\n<e68599> 16314\n<e6859a> 4055\n<e6859b> 9872\n<e6859c> 16774\n<e6859d> 4424\n<e6859e> 9861\n<e6859f> 4054\n<e685a0> 18764\n<e685a1> 9876\n<e685a4> 16755\n<e685a5> 9873\n<e685a6> 10462\n<e685a7> 4422\n<e685a8> 3153\n<e685aa> 9875\n<e685ab> 4429\n<e685ac> 9867\nendcidchar\n\n100 begincidchar\n<e685ae> 4423\n<e685af> 16320\n<e685b0> 4428\n<e685b1> 9862\n<e685b2> 9866\n<e685b3> 9863\n<e685b4> 9869\n<e685b5> 4057\n<e685b6> 4421\n<e685b7> 4051\n<e685b9> 10448\n<e685ba> 9871\n<e685bc> 4427\n<e685bd> 16317\n<e685be> 4430\n<e68680> 9868\n<e68681> 16759\n<e68682> 4426\n<e68683> 10447\n<e68687> 16762\n<e68689> 10452\n<e6868a> 4785\n<e6868b> 10446\n<e6868c> 11085\n<e6868d> 10461\n<e6868e> 4434\n<e68690> 4432\n<e68691> 4783\n<e68692> 10458\n<e68693> 10454\n<e68694> 4438\n<e68695> 15840\n<e68696> 11076\n<e68698> 14933\n<e68699> 14932\n<e6869a> 4436\n<e6869b> 10453\n<e6869c> 16386\n<e6869d> 11074\n<e6869f> 10457\n<e686a1> 10460\n<e686a2> 10451\n<e686a4> 4437\n<e686a7> 4431\n<e686a8> 11075\n<e686a9> 4784\n<e686aa> 10459\n<e686ab> 4433\n<e686ac> 4435\n<e686ad> 10456\n<e686ae> 4439\n<e686af> 10455\n<e686b0> 10450\n<e686b1> 10449\n<e686b2> 4782\n<e686b3> 10463\n<e686b4> 11078\n<e686b5> 11616\n<e686b6> 4787\n<e686b7> 17977\n<e686b8> 11084\n<e686b9> 17343\n<e686ba> 11082\n<e686bc> 11617\n<e686be> 4788\n<e686bf> 11083\n<e68780> 14928\n<e68781> 11080\n<e68782> 5073\n<e68783> 11615\n<e68785> 11077\n<e68786> 11079\n<e68787> 5074\n<e68788> 4790\n<e68789> 5072\n<e6878a> 4789\n<e6878b> 5076\n<e6878c> 11081\n<e6878d> 4786\n<e6878f> 17978\n<e68790> 16769\n<e68793> 16766\n<e68796> 12070\n<e68798> 12062\n<e6879a> 14513\n<e6879e> 11623\n<e6879f> 12063\n<e687a0> 11619\n<e687a2> 16325\n<e687a3> 5328\n<e687a4> 11621\n<e687a5> 11620\n<e687a6> 5075\n<e687a7> 11618\n<e687a8> 11622\n<e687a9> 12071\n<e687aa> 12067\n<e687ab> 12069\n<e687b0> 12068\n<e687b1> 12066\nendcidchar\n\n100 begincidchar\n<e687b2> 5502\n<e687b5> 5505\n<e687b6> 5504\n<e687b7> 5503\n<e687b8> 5652\n<e687b9> 12755\n<e687ba> 5653\n<e687bb> 12431\n<e687bc> 5744\n<e687bd> 13009\n<e687be> 5745\n<e687bf> 5828\n<e68880> 5880\n<e68881> 13335\n<e68887> 13619\n<e68888> 721\n<e68889> 6056\n<e6888a> 833\n<e6888e> 976\n<e68890> 979\n<e68891> 1186\n<e68892> 1185\n<e68894> 6545\n<e68895> 1489\n<e68896> 1488\n<e68899> 7328\n<e6889f> 3160\n<e688a0> 9185\n<e688a3> 9187\n<e688a4> 9189\n<e688a5> 9188\n<e688a7> 9879\n<e688a9> 9878\n<e688aa> 4058\n<e688ab> 9880\n<e688ac> 17980\n<e688ad> 10464\n<e688ae> 4440\n<e688b0> 4791\n<e688b2> 5077\n<e688b3> 5329\n<e688b4> 5078\n<e688b6> 722\n<e688b7> 17690\n<e688b9> 16322\n<e688ba> 6285\n<e688bd> 6546\n<e688be> 1491\n<e688bf> 1490\n<e68980> 1492\n<e68981> 1839\n<e68986> 7329\n<e68987> 2242\n<e68988> 2713\n<e68989> 3161\n<e6898a> 8523\n<e6898b> 723\n<e6898c> 17644\n<e6898d> 657\n<e6898e> 724\n<e68990> 6057\n<e68991> 837\n<e68992> 836\n<e68998> 982\n<e68999> 6130\n<e6899a> 6132\n<e6899b> 981\n<e6899c> 6124\n<e6899e> 6125\n<e689a0> 6131\n<e689a1> 6127\n<e689a2> 6129\n<e689a3> 980\n<e689a4> 6126\n<e689a5> 6133\n<e689a6> 6128\n<e689a8> 16149\n<e689ad> 1193\n<e689ae> 1202\n<e689af> 1200\n<e689b0> 6295\n<e689b1> 6292\n<e689b2> 6300\n<e689b3> 1198\n<e689b4> 6301\n<e689b6> 1191\n<e689b7> 6298\n<e689b9> 1197\n<e689ba> 6294\n<e689bb> 6293\n<e689bc> 1195\n<e689bd> 6299\n<e689be> 1196\n<e689bf> 1493\n<e68a80> 1190\n<e68a81> 6296\n<e68a82> 16262\n<e68a83> 6286\n<e68a84> 1187\n<e68a85> 16208\nendcidchar\n\n100 begincidchar\n<e68a86> 1206\n<e68a87> 6291\n<e68a88> 6297\n<e68a89> 1192\n<e68a8a> 1194\n<e68a8c> 6287\n<e68a90> 17344\n<e68a91> 1205\n<e68a92> 1199\n<e68a93> 1204\n<e68a94> 6290\n<e68a95> 1203\n<e68a96> 1189\n<e68a97> 1188\n<e68a98> 1201\n<e68a9d> 16022\n<e68aa4> 14953\n<e68aa6> 16321\n<e68aa8> 1507\n<e68aa9> 6558\n<e68aaa> 6551\n<e68aab> 1502\n<e68aac> 1521\n<e68aad> 6547\n<e68aae> 6554\n<e68aaf> 6556\n<e68ab0> 6559\n<e68ab1> 1516\n<e68ab3> 6555\n<e68ab4> 6548\n<e68ab5> 1514\n<e68ab6> 6552\n<e68ab8> 6560\n<e68ab9> 1499\n<e68abb> 6557\n<e68abc> 1509\n<e68abd> 1508\n<e68abe> 6550\n<e68abf> 1497\n<e68b81> 19153\n<e68b82> 1498\n<e68b83> 15759\n<e68b84> 1496\n<e68b85> 16778\n<e68b86> 1520\n<e68b87> 1512\n<e68b88> 1506\n<e68b89> 1494\n<e68b8a> 6553\n<e68b8b> 1505\n<e68b8c> 1495\n<e68b8d> 1513\n<e68b8e> 1522\n<e68b8f> 6894\n<e68b90> 1510\n<e68b91> 6549\n<e68b92> 1500\n<e68b95> 16780\n<e68b98> 1517\n<e68b99> 1511\n<e68b9a> 1515\n<e68b9b> 1501\n<e68b9c> 1840\n<e68b9f> 16412\n<e68ba5> 17981\n<e68bab> 6900\n<e68bac> 1852\n<e68bad> 1844\n<e68bae> 1846\n<e68baf> 1851\n<e68bb0> 6912\n<e68bb1> 1849\n<e68bb2> 7330\n<e68bb3> 2243\n<e68bb4> 1854\n<e68bb5> 6897\n<e68bb6> 6905\n<e68bb7> 1850\n<e68bb8> 6904\n<e68bb9> 6901\n<e68bba> 6909\n<e68bbb> 6911\n<e68bbc> 1843\n<e68bbd> 1847\n<e68bbe> 1853\n<e68bbf> 2245\n<e68c80> 6906\n<e68c81> 1845\n<e68c82> 1856\n<e68c83> 6899\n<e68c87> 1848\n<e68c88> 2244\n<e68c89> 1842\n<e68c8b> 6896\n<e68c8c> 6903\n<e68c8d> 6895\n<e68c8e> 6898\n<e68c8f> 6902\n<e68c90> 7331\n<e68c91> 1855\nendcidchar\n\n100 begincidchar\n<e68c95> 6910\n<e68c96> 1841\n<e68c98> 17345\n<e68ca8> 2259\n<e68ca9> 7343\n<e68cac> 7333\n<e68cad> 7349\n<e68cae> 16093\n<e68caf> 2248\n<e68cb1> 14949\n<e68cb2> 7917\n<e68cb3> 7351\n<e68cb4> 7345\n<e68cb5> 16150\n<e68cb6> 7336\n<e68cb7> 14947\n<e68cb8> 7354\n<e68cb9> 7339\n<e68cba> 2254\n<e68cbb> 7940\n<e68cbc> 7342\n<e68cbd> 2256\n<e68cbe> 2247\n<e68d80> 7356\n<e68d81> 7344\n<e68d82> 2250\n<e68d83> 7337\n<e68d86> 2251\n<e68d87> 7350\n<e68d88> 7357\n<e68d89> 2253\n<e68d8a> 7341\n<e68d8b> 7340\n<e68d8c> 2261\n<e68d8d> 2260\n<e68d8e> 2246\n<e68d8f> 2252\n<e68d90> 2255\n<e68d91> 7353\n<e68d94> 7347\n<e68d95> 2249\n<e68d96> 7332\n<e68d97> 7355\n<e68d98> 7346\n<e68d99> 7348\n<e68d9a> 7352\n<e68da4> 16327\n<e68da5> 7918\n<e68da7> 2721\n<e68da8> 2741\n<e68da9> 2740\n<e68dab> 2729\n<e68dac> 16782\n<e68dad> 7936\n<e68dae> 7932\n<e68daf> 7929\n<e68db0> 7947\n<e68db1> 2724\n<e68db2> 2716\n<e68db5> 7934\n<e68db6> 3177\n<e68db7> 2720\n<e68db8> 7942\n<e68db9> 17255\n<e68dba> 2742\n<e68dbb> 2739\n<e68dbc> 7938\n<e68dbd> 7921\n<e68dbf> 16203\n<e68e80> 2738\n<e68e81> 7944\n<e68e82> 7920\n<e68e83> 2727\n<e68e84> 2731\n<e68e85> 7943\n<e68e87> 7930\n<e68e88> 2732\n<e68e89> 2726\n<e68e8a> 7919\n<e68e8b> 16776\n<e68e8c> 3163\n<e68e8d> 7946\n<e68e8e> 7928\n<e68e8f> 2737\n<e68e90> 7931\n<e68e91> 7945\n<e68e92> 2736\n<e68e94> 8524\n<e68e96> 2717\n<e68e97> 7926\n<e68e98> 2722\n<e68e99> 2733\n<e68e9b> 2728\n<e68e9c> 7935\n<e68e9d> 7925\n<e68e9e> 7923\n<e68e9f> 7941\n<e68ea0> 2714\n<e68ea1> 2734\n<e68ea2> 2718\nendcidchar\n\n100 begincidchar\n<e68ea3> 3162\n<e68ea4> 7939\n<e68ea5> 2719\n<e68ea7> 2715\n<e68ea8> 2730\n<e68ea9> 2725\n<e68eaa> 2723\n<e68eab> 7927\n<e68eac> 2735\n<e68ead> 7924\n<e68eae> 7937\n<e68eaf> 7933\n<e68eb0> 8526\n<e68eb1> 8525\n<e68eb9> 16029\n<e68ebd> 7922\n<e68ebe> 8542\n<e68f80> 3165\n<e68f81> 18088\n<e68f82> 8548\n<e68f83> 8531\n<e68f84> 8545\n<e68f85> 9190\n<e68f86> 3168\n<e68f87> 8549\n<e68f88> 8552\n<e68f89> 3167\n<e68f8a> 8534\n<e68f8b> 8551\n<e68f8c> 8550\n<e68f8d> 3169\n<e68f8e> 8527\n<e68f8f> 3164\n<e68f90> 3172\n<e68f91> 14950\n<e68f92> 3170\n<e68f93> 8547\n<e68f95> 8537\n<e68f96> 3174\n<e68f97> 8554\n<e68f98> 8546\n<e68f99> 8555\n<e68f9a> 3182\n<e68f9b> 3180\n<e68f9c> 8544\n<e68f9d> 8543\n<e68f9e> 15968\n<e68f9f> 8541\n<e68fa0> 8535\n<e68fa1> 3173\n<e68fa2> 17985\n<e68fa3> 3171\n<e68fa4> 7338\n<e68fa5> 8528\n<e68fa6> 18591\n<e68fa7> 9220\n<e68fa8> 8529\n<e68fa9> 3166\n<e68faa> 3179\n<e68fab> 9192\n<e68faf> 8530\n<e68fb0> 8553\n<e68fb1> 9191\n<e68fb2> 8538\n<e68fb3> 8533\n<e68fb4> 3178\n<e68fb5> 8539\n<e68fb6> 8536\n<e68fb8> 16786\n<e68fb9> 3183\n<e68fbb> 17986\n<e68fbc> 16028\n<e68fbe> 16030\n<e69086> 3626\n<e69087> 17987\n<e69089> 9195\n<e6908a> 9214\n<e6908b> 9219\n<e6908c> 9207\n<e6908d> 3622\n<e6908e> 9224\n<e6908f> 3619\n<e69090> 9193\n<e69092> 9194\n<e69093> 3612\n<e69094> 3621\n<e69095> 9201\n<e69098> 9202\n<e6909a> 9215\n<e6909b> 9221\n<e6909c> 3620\n<e6909e> 3614\n<e6909f> 9200\n<e690a0> 9196\n<e690a1> 9223\n<e690a4> 9197\n<e690a5> 9217\n<e690a6> 9208\n<e690a7> 9218\n<e690a8> 9210\nendcidchar\n\n100 begincidchar\n<e690aa> 3615\n<e690ab> 9881\n<e690ac> 3618\n<e690ad> 3616\n<e690ae> 9222\n<e690af> 9213\n<e690b0> 9209\n<e690b2> 17881\n<e690b3> 9198\n<e690b4> 4068\n<e690b5> 9212\n<e690b6> 3623\n<e690b7> 9204\n<e690b8> 16785\n<e690b9> 9203\n<e690ba> 16797\n<e690bb> 14955\n<e690bd> 3617\n<e690be> 3613\n<e690bf> 9902\n<e69180> 9216\n<e69181> 9211\n<e69183> 9199\n<e6918b> 9897\n<e6918d> 9882\n<e6918e> 9893\n<e69190> 9900\n<e69191> 4066\n<e69192> 3181\n<e69193> 9898\n<e69194> 4061\n<e69198> 4060\n<e69199> 9905\n<e6919a> 17346\n<e6919b> 9883\n<e6919c> 9896\n<e6919d> 9884\n<e6919e> 9895\n<e6919f> 4064\n<e691a0> 9899\n<e691a1> 8540\n<e691a5> 9906\n<e691a6> 9891\n<e691a7> 4067\n<e691a8> 10478\n<e691a9> 4441\n<e691ab> 9904\n<e691ac> 9903\n<e691ad> 4069\n<e691ae> 10465\n<e691af> 4442\n<e691b0> 10466\n<e691b1> 14939\n<e691b4> 9885\n<e691b5> 9890\n<e691b6> 9886\n<e691b7> 9907\n<e691b8> 4063\n<e691b9> 4443\n<e691ba> 4065\n<e691bb> 4070\n<e691bc> 17260\n<e691bd> 9889\n<e691bf> 9901\n<e69282> 9894\n<e69285> 10469\n<e69287> 4059\n<e69288> 4446\n<e69289> 11092\n<e6928a> 10474\n<e6928b> 10473\n<e6928c> 10475\n<e6928d> 17187\n<e6928f> 10472\n<e69290> 4447\n<e69291> 17347\n<e69292> 4453\n<e69293> 4450\n<e69295> 4451\n<e69296> 10467\n<e69297> 10470\n<e69298> 10480\n<e69299> 4459\n<e6929a> 4457\n<e6929c> 10471\n<e6929d> 8532\n<e6929e> 4444\n<e6929f> 10477\n<e692a0> 10468\n<e692a2> 4460\n<e692a3> 10476\n<e692a4> 4062\n<e692a5> 4449\n<e692a6> 9892\n<e692a9> 4452\n<e692ab> 4456\n<e692ac> 4458\n<e692ad> 4455\n<e692ae> 4454\n<e692af> 17121\nendcidchar\n\n100 begincidchar\n<e692b0> 4448\n<e692b1> 10479\n<e692b2> 4445\n<e692b3> 4461\n<e692b4> 17216\n<e692b6> 14948\n<e692bd> 11091\n<e692be> 4805\n<e692bf> 4802\n<e69380> 17989\n<e69381> 4793\n<e69382> 4800\n<e69383> 11093\n<e69384> 4798\n<e69385> 4792\n<e69387> 4799\n<e69389> 11090\n<e6938a> 5080\n<e6938b> 4794\n<e6938d> 4801\n<e6938e> 5079\n<e6938f> 11089\n<e69390> 11088\n<e69392> 4803\n<e69393> 16131\n<e69394> 4804\n<e69396> 11087\n<e69397> 11086\n<e69398> 5081\n<e69399> 11096\n<e6939a> 4797\n<e6939b> 11094\n<e6939d> 17182\n<e693a0> 5082\n<e693a1> 16793\n<e693a2> 5087\n<e693a3> 11626\n<e693a4> 11628\n<e693a5> 16794\n<e693a6> 5084\n<e693a7> 14248\n<e693a8> 11629\n<e693a9> 11625\n<e693aa> 17226\n<e693ab> 11627\n<e693ac> 5085\n<e693ad> 5088\n<e693af> 11624\n<e693b0> 5083\n<e693b1> 5086\n<e693b2> 5331\n<e693b3> 11095\n<e693b4> 5330\n<e693b7> 5336\n<e693b8> 12075\n<e693bc> 12078\n<e693bd> 12074\n<e693be> 5332\n<e693bf> 12072\n<e69480> 5506\n<e69481> 12076\n<e69483> 12077\n<e69484> 12073\n<e69486> 5333\n<e69487> 12432\n<e69489> 12435\n<e6948a> 17718\n<e6948c> 12436\n<e6948d> 12434\n<e6948e> 12437\n<e6948f> 5507\n<e69490> 12433\n<e69491> 15017\n<e69493> 12759\n<e69494> 5655\n<e69495> 12758\n<e69496> 12757\n<e69497> 12756\n<e69498> 5654\n<e69499> 5656\n<e6949b> 13010\n<e6949c> 5747\n<e6949d> 5746\n<e6949e> 16775\n<e6949f> 16064\n<e694a0> 13186\n<e694a1> 13185\n<e694a2> 13188\n<e694a3> 5881\n<e694a4> 5829\n<e694a5> 13339\n<e694a6> 13187\n<e694a9> 13338\n<e694aa> 5883\n<e694ab> 5882\n<e694ac> 5921\n<e694ad> 13444\n<e694ae> 13514\n<e694af> 725\n<e694b0> 15970\nendcidchar\n\n100 begincidchar\n<e694b2> 8556\n<e694b3> 11097\n<e694b4> 556\n<e694b5> 17645\n<e694b6> 983\n<e694b7> 6134\n<e694b8> 1209\n<e694b9> 1207\n<e694bb> 1208\n<e694bd> 6561\n<e694be> 1523\n<e694bf> 1857\n<e69581> 6913\n<e69583> 6914\n<e69585> 1858\n<e69586> 7359\n<e6958a> 7358\n<e6958d> 16799\n<e6958f> 2749\n<e69591> 2745\n<e69593> 7948\n<e69594> 2752\n<e69595> 2751\n<e69596> 2744\n<e69597> 2747\n<e69598> 2750\n<e69599> 2746\n<e6959c> 8560\n<e6959d> 2743\n<e6959e> 3184\n<e6959f> 16805\n<e695a4> 8559\n<e695a5> 8562\n<e695a6> 3185\n<e695a7> 8557\n<e695a8> 8561\n<e695aa> 8558\n<e695ab> 14956\n<e695ac> 3627\n<e695ad> 16804\n<e695af> 9225\n<e695b2> 4071\n<e695b3> 9908\n<e695b4> 4806\n<e695b5> 4462\n<e695b6> 10481\n<e695b9> 10483\n<e695ba> 10482\n<e695bb> 10484\n<e695bc> 11099\n<e695bf> 11098\n<e69680> 11631\n<e69681> 11630\n<e69684> 12438\n<e69685> 16803\n<e69686> 17992\n<e69687> 726\n<e69688> 16651\n<e69689> 17748\n<e6968b> 18910\n<e6968c> 8563\n<e69690> 3189\n<e69691> 3188\n<e69692> 9226\n<e69694> 12079\n<e69695> 5748\n<e69696> 13340\n<e69697> 727\n<e69699> 2264\n<e6969b> 2754\n<e6969c> 2753\n<e6969f> 3628\n<e696a0> 9909\n<e696a1> 4072\n<e696a2> 11100\n<e696a4> 728\n<e696a5> 838\n<e696a7> 1524\n<e696a8> 6562\n<e696aa> 6915\n<e696ab> 1859\n<e696ac> 2755\n<e696ae> 8566\n<e696af> 3190\n<e696b0> 3629\n<e696b5> 16807\n<e696b6> 11632\n<e696b7> 5337\n<e696b8> 13515\n<e696b9> 729\n<e696bb> 6563\n<e696bc> 1525\n<e696bd> 1860\n<e696be> 15931\n<e696bf> 6916\n<e69781> 2265\n<e69782> 7363\n<e69785> 2266\n<e69786> 7360\n<e6978d> 7949\nendcidchar\n\n100 begincidchar\n<e6978e> 2759\n<e6978f> 2756\n<e69790> 8567\n<e69791> 16810\n<e69792> 8568\n<e69793> 9227\n<e69794> 15272\n<e69796> 4074\n<e69797> 4073\n<e6979a> 11633\n<e6979b> 12080\n<e6979d> 12440\n<e6979e> 12439\n<e6979f> 12760\n<e697a0> 557\n<e697a1> 6025\n<e697a2> 1861\n<e697a3> 16814\n<e697a5> 730\n<e697a6> 839\n<e697a8> 985\n<e697a9> 984\n<e697ae> 6136\n<e697af> 6135\n<e697b0> 6302\n<e697b1> 1210\n<e697b2> 6305\n<e697b3> 6304\n<e697b4> 6303\n<e697b5> 6306\n<e697ba> 1526\n<e697bb> 6569\n<e697bc> 6565\n<e697bd> 6574\n<e697bf> 17994\n<e69880> 1533\n<e69882> 1531\n<e69883> 6570\n<e69884> 6566\n<e69885> 6573\n<e69886> 1530\n<e69887> 1537\n<e69888> 6568\n<e69889> 6564\n<e6988a> 1536\n<e6988b> 6571\n<e6988c> 1529\n<e6988d> 6572\n<e6988e> 1532\n<e6988f> 1534\n<e69890> 6576\n<e69891> 6575\n<e69892> 6567\n<e69893> 1528\n<e69894> 1527\n<e69895> 1535\n<e69898> 16817\n<e6989c> 6921\n<e6989d> 6927\n<e6989e> 14995\n<e6989f> 1867\n<e698a0> 1864\n<e698a1> 6918\n<e698a2> 6923\n<e698a3> 17045\n<e698a4> 1870\n<e698a5> 1862\n<e698a6> 6922\n<e698a7> 1865\n<e698a8> 1868\n<e698ab> 6925\n<e698ad> 1863\n<e698ae> 6930\n<e698af> 1866\n<e698b0> 14989\n<e698b1> 1869\n<e698b2> 6919\n<e698b3> 6924\n<e698b4> 6928\n<e698b5> 6920\n<e698b6> 6917\n<e698b9> 6929\n<e698ba> 6926\n<e69981> 2274\n<e69982> 2267\n<e69983> 2270\n<e69984> 16820\n<e69985> 2273\n<e69987> 7366\n<e69988> 15769\n<e69989> 2268\n<e6998a> 7364\n<e6998b> 16823\n<e6998c> 2272\n<e6998d> 19001\n<e6998f> 2269\n<e69991> 7367\n<e69992> 2271\n<e69993> 17995\n<e69997> 16539\nendcidchar\n\n100 begincidchar\n<e69999> 7953\n<e6999a> 2761\n<e6999b> 7952\n<e6999c> 7954\n<e6999d> 2760\n<e6999e> 2765\n<e6999f> 7365\n<e699a0> 19113\n<e699a1> 7951\n<e699a2> 7955\n<e699a3> 14992\n<e699a4> 2762\n<e699a5> 7950\n<e699a6> 2764\n<e699a7> 16825\n<e699a8> 2763\n<e699aa> 8575\n<e699ab> 14987\n<e699ac> 8570\n<e699ae> 3191\n<e699af> 3195\n<e699b0> 3192\n<e699b1> 8573\n<e699b2> 8576\n<e699b3> 16827\n<e699b4> 3193\n<e699b6> 3194\n<e699b7> 3199\n<e699b8> 9236\n<e699b9> 8574\n<e699ba> 3197\n<e699bb> 8571\n<e699bc> 8569\n<e699bd> 18075\n<e699be> 3198\n<e69a80> 8572\n<e69a84> 3635\n<e69a85> 16738\n<e69a86> 9228\n<e69a89> 3631\n<e69a8a> 9233\n<e69a8b> 9232\n<e69a8c> 9229\n<e69a8d> 3637\n<e69a8e> 14985\n<e69a90> 9231\n<e69a91> 3196\n<e69a92> 17997\n<e69a94> 9235\n<e69a95> 9230\n<e69a96> 3634\n<e69a97> 3630\n<e69a98> 3636\n<e69a99> 9234\n<e69a9a> 15677\n<e69a9d> 4077\n<e69a9f> 9912\n<e69aa0> 9911\n<e69aa1> 9910\n<e69aa2> 4075\n<e69aa4> 16570\n<e69aa8> 4076\n<e69aa9> 10489\n<e69aaa> 10492\n<e69aab> 4466\n<e69aad> 18760\n<e69aae> 4465\n<e69aaf> 10493\n<e69ab0> 10488\n<e69ab1> 4468\n<e69ab2> 10490\n<e69ab3> 16565\n<e69ab4> 4467\n<e69ab5> 10487\n<e69ab6> 15891\n<e69ab7> 10491\n<e69ab8> 4812\n<e69ab9> 4809\n<e69aba> 11109\n<e69abb> 11108\n<e69abd> 11107\n<e69abe> 11102\n<e69abf> 15770\n<e69b80> 11103\n<e69b84> 4810\n<e69b86> 4807\n<e69b87> 4811\n<e69b88> 11101\n<e69b89> 4808\n<e69b8c> 11110\n<e69b8d> 16568\n<e69b8e> 14967\n<e69b8f> 11106\n<e69b92> 11634\n<e69b96> 5092\n<e69b98> 12083\n<e69b99> 5091\n<e69b9c> 5338\n<e69b9d> 5509\n<e69b9e> 12441\nendcidchar\n\n100 begincidchar\n<e69ba0> 5508\n<e69ba6> 5657\n<e69ba7> 19023\n<e69ba8> 12761\n<e69ba9> 5749\n<e69bab> 13341\n<e69bac> 5884\n<e69bb0> 731\n<e69bb1> 16004\n<e69bb4> 1211\n<e69bb6> 6577\n<e69bb7> 1871\n<e69bb8> 2275\n<e69bb9> 2766\n<e69bbc> 2591\n<e69c80> 3056\n<e69c81> 8577\n<e69c82> 16836\n<e69c83> 3638\n<e69c84> 9914\n<e69c85> 9913\n<e69c88> 732\n<e69c89> 990\n<e69c8a> 6578\n<e69c8b> 1539\n<e69c8c> 16354\n<e69c8d> 1538\n<e69c8e> 15777\n<e69c96> 17999\n<e69c97> 2278\n<e69c98> 7956\n<e69c99> 18867\n<e69c9b> 2768\n<e69c9d> 3203\n<e69c9e> 15755\n<e69c9f> 3202\n<e69ca0> 9237\n<e69ca1> 9506\n<e69ca2> 9915\n<e69ca3> 11111\n<e69ca5> 14239\n<e69ca6> 5339\n<e69ca7> 5658\n<e69ca8> 733\n<e69cac> 841\n<e69cad> 844\n<e69cae> 840\n<e69cb1> 993\n<e69cb3> 6144\n<e69cb4> 992\n<e69cb5> 994\n<e69cb6> 15937\n<e69cb8> 6139\n<e69cb9> 6138\n<e69cba> 6141\n<e69cbb> 6140\n<e69cbc> 6143\n<e69cbd> 991\n<e69cbe> 6137\n<e69cbf> 6142\n<e69d84> 16411\n<e69d85> 6307\n<e69d86> 1221\n<e69d87> 6308\n<e69d88> 6312\n<e69d89> 1220\n<e69d8b> 6316\n<e69d8c> 6311\n<e69d8d> 6314\n<e69d93> 1223\n<e69d95> 6310\n<e69d96> 1218\n<e69d97> 1224\n<e69d99> 6309\n<e69d9a> 6315\n<e69d9c> 1217\n<e69d9d> 6313\n<e69d9e> 1219\n<e69d9f> 1212\n<e69da0> 1222\n<e69da1> 15718\n<e69da2> 16843\n<e69da7> 16842\n<e69daa> 1560\n<e69dab> 18948\n<e69dac> 6580\n<e69dad> 1540\n<e69dae> 19017\n<e69db1> 1543\n<e69db2> 1561\n<e69db3> 1545\n<e69db4> 6588\n<e69db5> 1556\n<e69db6> 6583\n<e69db7> 1546\n<e69dba> 6591\n<e69dbb> 6584\n<e69dbc> 1559\n<e69dbd> 6596\n<e69dbe> 1554\nendcidchar\n\n100 begincidchar\n<e69dbf> 1552\n<e69e81> 6597\n<e69e82> 19118\n<e69e83> 6595\n<e69e84> 6587\n<e69e85> 6579\n<e69e86> 6586\n<e69e87> 1547\n<e69e89> 1553\n<e69e8b> 1541\n<e69e8c> 6590\n<e69e8d> 6589\n<e69e8e> 6581\n<e69e8f> 18113\n<e69e90> 1555\n<e69e91> 6593\n<e69e92> 6582\n<e69e93> 1558\n<e69e94> 6600\n<e69e95> 1542\n<e69e97> 1549\n<e69e98> 6585\n<e69e99> 6594\n<e69e9a> 1557\n<e69e9c> 1544\n<e69e9d> 1548\n<e69e9f> 6592\n<e69ea0> 15738\n<e69ea4> 18001\n<e69eac> 16867\n<e69eae> 6964\n<e69eaf> 1879\n<e69eb0> 1892\n<e69eb1> 16884\n<e69eb2> 6959\n<e69eb3> 6949\n<e69eb4> 1885\n<e69eb5> 6947\n<e69eb6> 1878\n<e69eb7> 6942\n<e69eb8> 1888\n<e69eb9> 6955\n<e69eba> 6936\n<e69ebb> 6938\n<e69ebf> 14330\n<e69f80> 6941\n<e69f81> 6933\n<e69f82> 6954\n<e69f83> 6970\n<e69f84> 1883\n<e69f85> 6943\n<e69f86> 6961\n<e69f88> 6935\n<e69f8b> 6972\n<e69f8c> 6963\n<e69f8d> 6948\n<e69f8e> 6956\n<e69f8f> 1889\n<e69f90> 1876\n<e69f91> 1884\n<e69f92> 1896\n<e69f93> 1873\n<e69f94> 1875\n<e69f96> 15192\n<e69f97> 16846\n<e69f98> 6940\n<e69f99> 1893\n<e69f9a> 1886\n<e69f9b> 6966\n<e69f9c> 6937\n<e69f9d> 1895\n<e69f9e> 1890\n<e69f9f> 6946\n<e69fa2> 1894\n<e69fa3> 6953\n<e69fa4> 6945\n<e69fa5> 1887\n<e69fa6> 6965\n<e69fa7> 6957\n<e69fa9> 1881\n<e69faa> 6971\n<e69fab> 6944\n<e69fac> 1877\n<e69fad> 6962\n<e69fae> 6952\n<e69faf> 1882\n<e69fb0> 6958\n<e69fb1> 1874\n<e69fb2> 6934\n<e69fb3> 1891\n<e69fb4> 2293\n<e69fb5> 1880\n<e69fb6> 6951\n<e69fb7> 6950\n<e69fb8> 6939\n<e69fb9> 14742\n<e69fba> 6967\n<e69fbc> 6960\n<e69fbe> 17749\n<e69fbf> 1872\nendcidchar\n\n100 begincidchar\n<e6a080> 17351\n<e6a081> 16851\n<e6a082> 16328\n<e6a083> 15722\n<e6a084> 17750\n<e6a08d> 17025\n<e6a090> 14748\n<e6a092> 7389\n<e6a093> 2300\n<e6a094> 7390\n<e6a096> 7378\n<e6a097> 2289\n<e6a098> 2301\n<e6a09a> 7371\n<e6a09b> 16498\n<e6a09c> 7380\n<e6a09d> 7388\n<e6a09e> 18114\n<e6a09f> 7370\n<e6a0a0> 7397\n<e6a0a1> 2279\n<e6a0a2> 16848\n<e6a0a5> 7396\n<e6a0a6> 7391\n<e6a0a8> 7392\n<e6a0a9> 2287\n<e6a0aa> 2298\n<e6a0ab> 7382\n<e6a0ad> 7383\n<e6a0ae> 7393\n<e6a0af> 7384\n<e6a0b1> 7379\n<e6a0b4> 7387\n<e6a0b5> 7381\n<e6a0b6> 15918\n<e6a0b7> 16925\n<e6a0b8> 2280\n<e6a0b9> 2284\n<e6a0ba> 7395\n<e6a0bb> 7375\n<e6a0bc> 2296\n<e6a0bd> 2292\n<e6a0be> 16711\n<e6a180> 2295\n<e6a181> 2302\n<e6a182> 2285\n<e6a183> 2297\n<e6a184> 7386\n<e6a185> 2299\n<e6a186> 2282\n<e6a187> 15339\n<e6a188> 2281\n<e6a189> 7372\n<e6a18a> 18003\n<e6a18b> 7376\n<e6a18c> 2290\n<e6a18d> 7394\n<e6a18e> 7385\n<e6a18f> 7377\n<e6a190> 2294\n<e6a191> 2291\n<e6a193> 2283\n<e6a194> 2286\n<e6a195> 15760\n<e6a196> 14356\n<e6a19d> 16854\n<e6a1a5> 17751\n<e6a1ab> 7977\n<e6a1af> 7966\n<e6a1b1> 7981\n<e6a1b2> 7978\n<e6a1b4> 7971\n<e6a1b5> 7970\n<e6a1b6> 2775\n<e6a1b7> 7974\n<e6a1b8> 7989\n<e6a1b9> 7957\n<e6a1bb> 7990\n<e6a1bc> 7976\n<e6a1bd> 7994\n<e6a1be> 7982\n<e6a1bf> 2774\n<e6a280> 7980\n<e6a281> 2769\n<e6a282> 2790\n<e6a283> 2780\n<e6a284> 18004\n<e6a285> 2784\n<e6a286> 2783\n<e6a287> 7958\n<e6a288> 18103\n<e6a289> 7987\n<e6a28a> 7993\n<e6a28b> 7985\n<e6a28c> 7992\n<e6a28f> 7973\n<e6a290> 7959\n<e6a291> 7991\n<e6a292> 7975\n<e6a293> 2772\nendcidchar\n\n100 begincidchar\n<e6a294> 2785\n<e6a296> 7984\n<e6a297> 2778\n<e6a298> 15018\n<e6a29b> 7983\n<e6a29c> 7960\n<e6a29d> 2786\n<e6a29f> 2788\n<e6a2a0> 7986\n<e6a2a1> 2789\n<e6a2a2> 2771\n<e6a2a3> 7967\n<e6a2a4> 7988\n<e6a2a6> 16612\n<e6a2a7> 2777\n<e6a2a8> 2787\n<e6a2a9> 7969\n<e6a2aa> 7979\n<e6a2ab> 7964\n<e6a2ac> 7968\n<e6a2ad> 2782\n<e6a2ae> 7963\n<e6a2af> 2770\n<e6a2b0> 2779\n<e6a2b1> 2776\n<e6a2b2> 7972\n<e6a2b3> 2288\n<e6a2b4> 8600\n<e6a2b5> 2773\n<e6a2b6> 15006\n<e6a2b9> 15636\n<e6a2bd> 17020\n<e6a383> 16860\n<e6a384> 2781\n<e6a385> 15406\n<e6a386> 8603\n<e6a387> 8625\n<e6a388> 8614\n<e6a389> 3223\n<e6a38a> 17131\n<e6a38b> 3218\n<e6a38c> 8597\n<e6a38d> 3219\n<e6a38e> 8613\n<e6a390> 8606\n<e6a391> 8619\n<e6a392> 3215\n<e6a393> 8579\n<e6a394> 8621\n<e6a395> 3205\n<e6a396> 8587\n<e6a397> 3208\n<e6a398> 3207\n<e6a39a> 3224\n<e6a39c> 8581\n<e6a39f> 3210\n<e6a3a0> 3206\n<e6a3a1> 8595\n<e6a3a3> 3217\n<e6a3a4> 8590\n<e6a3a6> 8617\n<e6a3a7> 3213\n<e6a3a8> 8609\n<e6a3a9> 8622\n<e6a3aa> 8584\n<e6a3ab> 8589\n<e6a3ac> 8583\n<e6a3ae> 3212\n<e6a3af> 8602\n<e6a3b0> 9259\n<e6a3b1> 8585\n<e6a3b2> 3216\n<e6a3b3> 8594\n<e6a3b4> 8618\n<e6a3b5> 3211\n<e6a3b6> 8591\n<e6a3b7> 8588\n<e6a3b8> 8605\n<e6a3b9> 3214\n<e6a3ba> 3204\n<e6a3bb> 3226\n<e6a3bc> 8608\n<e6a3bd> 8607\n<e6a480> 16863\n<e6a481> 16862\n<e6a482> 17147\n<e6a483> 17052\n<e6a484> 8580\n<e6a485> 3209\n<e6a486> 8620\n<e6a487> 8596\n<e6a488> 8598\n<e6a489> 18008\n<e6a48a> 8611\n<e6a48b> 8610\n<e6a48c> 8578\n<e6a48d> 3220\n<e6a48e> 3222\n<e6a48f> 8586\n<e6a490> 8593\nendcidchar\n\n100 begincidchar\n<e6a491> 8601\n<e6a492> 3221\n<e6a493> 8592\n<e6a494> 8604\n<e6a495> 8623\n<e6a497> 8612\n<e6a498> 15778\n<e6a499> 18912\n<e6a49a> 15744\n<e6a49b> 14269\n<e6a4a5> 8624\n<e6a4aa> 8582\n<e6a4ac> 16184\n<e6a4af> 9279\n<e6a4b0> 3646\n<e6a4b2> 9277\n<e6a4b3> 9256\n<e6a4b4> 9261\n<e6a4b5> 9254\n<e6a4b6> 16871\n<e6a4b7> 9273\n<e6a4b8> 9240\n<e6a4b9> 9247\n<e6a4bb> 9271\n<e6a4bc> 9281\n<e6a4bd> 9257\n<e6a4be> 16470\n<e6a4bf> 9244\n<e6a580> 9263\n<e6a581> 9268\n<e6a582> 9248\n<e6a583> 18009\n<e6a584> 9265\n<e6a585> 9245\n<e6a586> 17775\n<e6a58a> 3648\n<e6a58b> 9272\n<e6a58c> 9270\n<e6a58e> 9241\n<e6a58f> 9275\n<e6a591> 9276\n<e6a592> 9278\n<e6a593> 3652\n<e6a594> 3644\n<e6a595> 15750\n<e6a596> 7965\n<e6a597> 9249\n<e6a598> 9267\n<e6a599> 9250\n<e6a59a> 3641\n<e6a59b> 3657\n<e6a59c> 9274\n<e6a59d> 3655\n<e6a59e> 3651\n<e6a59f> 9239\n<e6a5a0> 3643\n<e6a5a1> 16868\n<e6a5a2> 9242\n<e6a5a3> 3656\n<e6a5a4> 18011\n<e6a5a5> 9258\n<e6a5a6> 9238\n<e6a5a7> 15637\n<e6a5a8> 3649\n<e6a5a9> 9262\n<e6a5aa> 9246\n<e6a5ab> 3650\n<e6a5ac> 9255\n<e6a5ad> 3640\n<e6a5ae> 3225\n<e6a5af> 9264\n<e6a5b0> 8599\n<e6a5b1> 9243\n<e6a5b2> 14957\n<e6a5b3> 16859\n<e6a5b4> 9269\n<e6a5b5> 3645\n<e6a5b6> 9266\n<e6a5b7> 3642\n<e6a5b8> 9260\n<e6a5b9> 3653\n<e6a5ba> 9251\n<e6a5bb> 9280\n<e6a680> 16190\n<e6a682> 3647\n<e6a683> 9391\n<e6a685> 18013\n<e6a686> 3654\n<e6a68a> 15732\n<e6a68d> 9929\n<e6a68e> 9927\n<e6a690> 9949\n<e6a691> 9925\n<e6a693> 9943\n<e6a694> 3639\n<e6a695> 4080\n<e6a696> 9921\n<e6a697> 9948\n<e6a698> 16872\n<e6a699> 9926\nendcidchar\n\n100 begincidchar\n<e6a69a> 9940\n<e6a69b> 4085\n<e6a69c> 4078\n<e6a69e> 9946\n<e6a69f> 18012\n<e6a6a0> 9919\n<e6a6a1> 9945\n<e6a6a2> 14128\n<e6a6a3> 4096\n<e6a6a4> 9936\n<e6a6a5> 9952\n<e6a6a6> 4094\n<e6a6a7> 9928\n<e6a6a8> 4079\n<e6a6a9> 9930\n<e6a6aa> 9944\n<e6a6ab> 4088\n<e6a6ac> 9923\n<e6a6ad> 4092\n<e6a6ae> 4082\n<e6a6af> 9932\n<e6a6b0> 9922\n<e6a6b1> 9916\n<e6a6b2> 16374\n<e6a6b3> 9942\n<e6a6b4> 4089\n<e6a6b5> 9951\n<e6a6b6> 9917\n<e6a6b7> 4086\n<e6a6b9> 9938\n<e6a6bb> 4087\n<e6a6bc> 9924\n<e6a6bd> 9935\n<e6a6be> 9931\n<e6a6bf> 9933\n<e6a780> 16221\n<e6a781> 4081\n<e6a782> 9950\n<e6a783> 4095\n<e6a784> 9934\n<e6a786> 9953\n<e6a789> 9918\n<e6a78a> 9939\n<e6a78b> 4084\n<e6a78c> 4093\n<e6a78d> 4091\n<e6a78e> 9920\n<e6a78f> 9941\n<e6a790> 4090\n<e6a791> 14831\n<e6a793> 4083\n<e6a794> 9937\n<e6a795> 15932\n<e6a796> 18014\n<e6a799> 9947\n<e6a7a1> 16856\n<e6a7a2> 10505\n<e6a7a4> 10501\n<e6a7a5> 10497\n<e6a7a6> 10517\n<e6a7a7> 10514\n<e6a7a8> 4471\n<e6a7a9> 18463\n<e6a7ab> 10521\n<e6a7ac> 10504\n<e6a7ad> 4482\n<e6a7ae> 10511\n<e6a7b1> 10500\n<e6a7b2> 10510\n<e6a7b3> 4479\n<e6a7b4> 10530\n<e6a7b6> 10527\n<e6a7b7> 10513\n<e6a7b8> 10498\n<e6a7b9> 16877\n<e6a7ba> 16839\n<e6a7bb> 10518\n<e6a7bc> 10520\n<e6a7bd> 4475\n<e6a7be> 10508\n<e6a7bf> 10503\n<e6a880> 10494\n<e6a881> 4472\n<e6a882> 4480\n<e6a883> 15913\n<e6a884> 10523\n<e6a885> 4481\n<e6a886> 10495\n<e6a887> 10529\n<e6a888> 10516\n<e6a889> 10522\n<e6a88a> 4478\n<e6a88b> 16857\n<e6a88c> 15696\n<e6a88d> 10519\n<e6a88f> 10526\n<e6a891> 4483\n<e6a893> 4477\n<e6a894> 10512\n<e6a895> 10499\nendcidchar\n\n100 begincidchar\n<e6a896> 10531\n<e6a897> 10496\n<e6a898> 10524\n<e6a899> 4474\n<e6a89a> 15646\n<e6a89b> 10506\n<e6a89c> 15208\n<e6a89d> 10507\n<e6a89e> 4473\n<e6a89f> 4470\n<e6a8a0> 10502\n<e6a8a1> 4476\n<e6a8a3> 4469\n<e6a8a5> 10525\n<e6a8a6> 10528\n<e6a8a7> 10509\n<e6a8a8> 11124\n<e6a8a9> 19114\n<e6a8ab> 15682\n<e6a8ac> 17067\n<e6a8ad> 15135\n<e6a8b2> 11116\n<e6a8b3> 15012\n<e6a8b4> 11112\n<e6a8b5> 4825\n<e6a8b8> 4814\n<e6a8b9> 4819\n<e6a8ba> 4815\n<e6a8bb> 11126\n<e6a8bc> 11137\n<e6a8bd> 4813\n<e6a8be> 11118\n<e6a8bf> 11127\n<e6a980> 10515\n<e6a981> 11128\n<e6a983> 18913\n<e6a984> 4820\n<e6a985> 16880\n<e6a986> 11143\n<e6a987> 4824\n<e6a988> 4827\n<e6a989> 11114\n<e6a98b> 4823\n<e6a98c> 15019\n<e6a98f> 11132\n<e6a990> 11131\n<e6a991> 11123\n<e6a992> 15013\n<e6a993> 14252\n<e6a994> 11133\n<e6a995> 11140\n<e6a996> 11139\n<e6a997> 14298\n<e6a998> 4818\n<e6a999> 4816\n<e6a99a> 11125\n<e6a99b> 11122\n<e6a99d> 11119\n<e6a99e> 11138\n<e6a99f> 4826\n<e6a9a0> 11136\n<e6a9a1> 4822\n<e6a9a2> 4821\n<e6a9a3> 18879\n<e6a9a4> 11130\n<e6a9a5> 18016\n<e6a9a6> 11113\n<e6a9a7> 11115\n<e6a9a8> 11117\n<e6a9a9> 11135\n<e6a9aa> 11129\n<e6a9ab> 4817\n<e6a9ad> 11120\n<e6a9af> 11134\n<e6a9b1> 18018\n<e6a9b4> 18017\n<e6a9b6> 11121\n<e6a9ba> 15021\n<e6a9be> 5100\n<e6a9bf> 11652\n<e6aa80> 5093\n<e6aa81> 11637\n<e6aa82> 18019\n<e6aa83> 11648\n<e6aa84> 5095\n<e6aa85> 11655\n<e6aa87> 11644\n<e6aa89> 11639\n<e6aa8a> 16694\n<e6aa8c> 11656\n<e6aa8d> 11635\n<e6aa8e> 11646\n<e6aa8f> 15387\n<e6aa90> 5102\n<e6aa91> 11651\n<e6aa92> 11657\n<e6aa93> 11645\n<e6aa94> 5094\n<e6aa95> 11647\n<e6aa96> 11636\nendcidchar\n\n100 begincidchar\n<e6aa97> 5101\n<e6aa99> 18021\n<e6aa9a> 11654\n<e6aa9b> 11641\n<e6aa9c> 5097\n<e6aa9d> 16882\n<e6aa9e> 11643\n<e6aa9f> 11640\n<e6aaa0> 5103\n<e6aaa1> 11642\n<e6aaa2> 5096\n<e6aaa3> 5099\n<e6aaa4> 11650\n<e6aaa5> 11638\n<e6aaa6> 11653\n<e6aaa7> 14307\n<e6aaa8> 11649\n<e6aaab> 18023\n<e6aaac> 5341\n<e6aaad> 12094\n<e6aab1> 15955\n<e6aab2> 15179\n<e6aab3> 5340\n<e6aab4> 12093\n<e6aab5> 18024\n<e6aab8> 5344\n<e6aab9> 12085\n<e6aaba> 12089\n<e6aabb> 5343\n<e6aabd> 12086\n<e6aabe> 15009\n<e6ab82> 5345\n<e6ab83> 5342\n<e6ab85> 12084\n<e6ab86> 12088\n<e6ab87> 12092\n<e6ab88> 16885\n<e6ab89> 15014\n<e6ab8a> 16204\n<e6ab8b> 12447\n<e6ab8c> 12444\n<e6ab8d> 12453\n<e6ab8f> 12452\n<e6ab90> 12450\n<e6ab91> 12445\n<e6ab93> 5513\n<e6ab94> 18025\n<e6ab98> 15530\n<e6ab99> 12446\n<e6ab9a> 5512\n<e6ab9b> 5098\n<e6ab9c> 12449\n<e6ab9d> 5511\n<e6ab9e> 12454\n<e6ab9f> 12448\n<e6aba0> 12443\n<e6aba1> 12087\n<e6aba5> 5510\n<e6aba7> 12442\n<e6aba8> 12767\n<e6abaa> 12766\n<e6abab> 12451\n<e6abac> 5659\n<e6abb0> 12765\n<e6abb1> 12769\n<e6abb3> 12764\n<e6abb6> 18026\n<e6abb8> 13014\n<e6abb9> 12768\n<e6abba> 5752\n<e6abbb> 5750\n<e6abbc> 13012\n<e6ac80> 13015\n<e6ac82> 13011\n<e6ac83> 13013\n<e6ac84> 5751\n<e6ac85> 15015\n<e6ac8a> 5830\n<e6ac8b> 13189\n<e6ac8f> 13344\n<e6ac90> 5885\n<e6ac93> 13447\n<e6ac96> 5955\n<e6ac97> 13518\n<e6ac9a> 13519\n<e6ac9d> 16888\n<e6ac9e> 13620\n<e6aca0> 734\n<e6aca1> 995\n<e6aca3> 1562\n<e6aca5> 6601\n<e6aca8> 6973\n<e6acac> 7398\n<e6acad> 7400\n<e6acaf> 7399\n<e6acb1> 7401\n<e6acb2> 2791\n<e6acb3> 7996\n<e6acb4> 7402\n<e6acb5> 16891\nendcidchar\n\n100 begincidchar\n<e6acb6> 7995\n<e6acb9> 8626\n<e6acba> 3228\n<e6acbb> 8627\n<e6acbc> 8629\n<e6acbd> 3229\n<e6acbe> 3227\n<e6acbf> 8628\n<e6ad81> 9287\n<e6ad82> 9285\n<e6ad83> 9284\n<e6ad85> 9283\n<e6ad86> 9282\n<e6ad87> 3658\n<e6ad88> 9286\n<e6ad89> 4097\n<e6ad8a> 9954\n<e6ad8b> 9956\n<e6ad8c> 4098\n<e6ad8d> 9955\n<e6ad8e> 4485\n<e6ad90> 4484\n<e6ad91> 10532\n<e6ad92> 16238\n<e6ad94> 11145\n<e6ad95> 11144\n<e6ad96> 11146\n<e6ad97> 15022\n<e6ad99> 4828\n<e6ad9b> 11658\n<e6ad9c> 5104\n<e6ad9e> 12095\n<e6ad9f> 5348\n<e6ada0> 12455\n<e6ada1> 5831\n<e6ada2> 735\n<e6ada3> 845\n<e6ada4> 996\n<e6ada5> 1225\n<e6adaa> 1897\n<e6adad> 7403\n<e6adaf> 17685\n<e6adb2> 3659\n<e6adb4> 16892\n<e6adb6> 10658\n<e6adb7> 4829\n<e6adb8> 5349\n<e6adb9> 736\n<e6adba> 17646\n<e6adbb> 997\n<e6adbe> 6603\n<e6adbf> 1565\n<e6ae80> 6602\n<e6ae81> 18027\n<e6ae82> 6974\n<e6ae83> 1898\n<e6ae84> 6975\n<e6ae86> 1899\n<e6ae88> 7405\n<e6ae89> 2304\n<e6ae8a> 2303\n<e6ae8c> 8003\n<e6ae8f> 8000\n<e6ae91> 7999\n<e6ae94> 8630\n<e6ae95> 8633\n<e6ae96> 3231\n<e6ae97> 8631\n<e6ae98> 3230\n<e6ae99> 8632\n<e6ae9b> 9288\n<e6aea2> 10535\n<e6aea3> 10534\n<e6aea4> 4486\n<e6aea5> 10533\n<e6aea6> 10536\n<e6aea7> 11147\n<e6aead> 11659\n<e6aeae> 5105\n<e6aeaf> 5350\n<e6aeb0> 12456\n<e6aeb2> 5753\n<e6aeb3> 6026\n<e6aeb5> 1900\n<e6aeb6> 6976\n<e6aeb7> 2305\n<e6aeba> 2792\n<e6aebc> 3232\n<e6aebd> 8634\n<e6aebf> 3661\n<e6af80> 3660\n<e6af81> 18028\n<e6af87> 11151\n<e6af88> 11150\n<e6af89> 12096\n<e6af8a> 13345\n<e6af8b> 737\n<e6af8c> 6027\n<e6af8d> 846\n<e6af8f> 1226\nendcidchar\n\n100 begincidchar\n<e6af90> 6317\n<e6af92> 1901\n<e6af93> 3662\n<e6af94> 738\n<e6af96> 6977\n<e6af97> 1902\n<e6af98> 6978\n<e6af9a> 5106\n<e6af9b> 739\n<e6af9c> 16903\n<e6af9e> 6604\n<e6afa0> 6979\n<e6afa1> 16901\n<e6afa2> 7410\n<e6afa3> 7409\n<e6afa4> 7407\n<e6afa6> 7406\n<e6afa7> 7411\n<e6afa8> 7408\n<e6afaa> 18029\n<e6afaf> 3233\n<e6afb0> 8635\n<e6afb9> 9291\n<e6afba> 16249\n<e6afbd> 3663\n<e6afbe> 9962\n<e6afbf> 10539\n<e6b080> 10538\n<e6b081> 10537\n<e6b082> 10540\n<e6b083> 11153\n<e6b084> 11152\n<e6b085> 4830\n<e6b086> 11154\n<e6b088> 5107\n<e6b089> 11660\n<e6b08b> 12097\n<e6b08c> 12457\n<e6b08d> 13192\n<e6b08f> 740\n<e6b090> 848\n<e6b091> 847\n<e6b093> 1566\n<e6b094> 6028\n<e6b095> 6058\n<e6b096> 998\n<e6b098> 6145\n<e6b09b> 1567\n<e6b09c> 14507\n<e6b09d> 6605\n<e6b09f> 1903\n<e6b0a3> 2306\n<e6b0a4> 2310\n<e6b0a5> 7412\n<e6b0a6> 2309\n<e6b0aa> 8004\n<e6b0ab> 2795\n<e6b0ac> 3236\n<e6b0b0> 8638\n<e6b0b1> 16227\n<e6b0b3> 4099\n<e6b0b4> 741\n<e6b0b5> 17647\n<e6b0b6> 6059\n<e6b0b7> 16904\n<e6b0b8> 849\n<e6b0b9> 15877\n<e6b0ba> 17648\n<e6b0bb> 6062\n<e6b0bd> 17281\n<e6b0be> 852\n<e6b0bf> 6061\n<e6b180> 851\n<e6b181> 850\n<e6b182> 1227\n<e6b183> 6060\n<e6b186> 6146\n<e6b189> 16525\n<e6b18a> 6150\n<e6b18f> 6149\n<e6b190> 1004\n<e6b192> 6147\n<e6b194> 6151\n<e6b195> 1005\n<e6b197> 1000\n<e6b198> 15290\n<e6b199> 1001\n<e6b19a> 16908\n<e6b19b> 1007\n<e6b19c> 6148\n<e6b19d> 999\n<e6b19e> 1228\n<e6b1a1> 1006\n<e6b1a5> 6336\n<e6b1a6> 6334\n<e6b1a7> 6321\n<e6b1a8> 1240\n<e6b1a9> 6328\n<e6b1aa> 1235\n<e6b1ab> 6322\nendcidchar\n\n100 begincidchar\n<e6b1ad> 6330\n<e6b1ae> 16586\n<e6b1af> 6327\n<e6b1b0> 1238\n<e6b1b1> 6326\n<e6b1b2> 1245\n<e6b1b3> 6335\n<e6b1b4> 1247\n<e6b1b5> 18030\n<e6b1b6> 1249\n<e6b1b8> 6320\n<e6b1b9> 16910\n<e6b1ba> 1236\n<e6b1bb> 6337\n<e6b1bd> 1243\n<e6b1be> 1246\n<e6b1bf> 14246\n<e6b280> 6628\n<e6b281> 1230\n<e6b282> 1253\n<e6b283> 1244\n<e6b284> 6323\n<e6b285> 1233\n<e6b286> 1248\n<e6b287> 6331\n<e6b28a> 6626\n<e6b28b> 6324\n<e6b28c> 1239\n<e6b28d> 1250\n<e6b28e> 6338\n<e6b28f> 6325\n<e6b290> 1237\n<e6b292> 1242\n<e6b293> 6606\n<e6b294> 1251\n<e6b295> 6332\n<e6b296> 1241\n<e6b298> 1252\n<e6b299> 1229\n<e6b29a> 6329\n<e6b29b> 1234\n<e6b29c> 6333\n<e6b29d> 6627\n<e6b29f> 14473\n<e6b2a2> 15715\n<e6b2aa> 18031\n<e6b2ab> 1579\n<e6b2ac> 1595\n<e6b2ad> 6613\n<e6b2ae> 1586\n<e6b2af> 15606\n<e6b2b0> 6634\n<e6b2b1> 1571\n<e6b2b2> 16076\n<e6b2b3> 1574\n<e6b2b4> 6625\n<e6b2b6> 6611\n<e6b2b7> 6615\n<e6b2b8> 1582\n<e6b2b9> 1584\n<e6b2ba> 6618\n<e6b2bb> 1591\n<e6b2bc> 1577\n<e6b2bf> 1590\n<e6b380> 6630\n<e6b381> 1585\n<e6b382> 6617\n<e6b383> 6619\n<e6b384> 1583\n<e6b385> 1588\n<e6b386> 6620\n<e6b387> 6633\n<e6b389> 1904\n<e6b38a> 1594\n<e6b38b> 16496\n<e6b38c> 1572\n<e6b38d> 6632\n<e6b38e> 16273\n<e6b38f> 6636\n<e6b390> 6616\n<e6b391> 6638\n<e6b392> 6623\n<e6b393> 1581\n<e6b394> 6612\n<e6b395> 1580\n<e6b396> 1598\n<e6b397> 1587\n<e6b399> 6610\n<e6b39a> 6990\n<e6b39b> 1593\n<e6b39c> 1597\n<e6b39d> 6624\n<e6b39e> 6629\n<e6b39f> 15703\n<e6b3a0> 1599\n<e6b3a1> 1592\n<e6b3a2> 1578\n<e6b3a3> 1568\n<e6b3a5> 1573\n<e6b3a7> 6614\nendcidchar\n\n100 begincidchar\n<e6b3a8> 1569\n<e6b3a9> 6637\n<e6b3aa> 16269\n<e6b3ab> 6608\n<e6b3ac> 6607\n<e6b3ad> 6621\n<e6b3ae> 6609\n<e6b3af> 1596\n<e6b3b0> 2311\n<e6b3b1> 1589\n<e6b3b2> 6622\n<e6b3b3> 1570\n<e6b3b5> 1919\n<e6b3b9> 6635\n<e6b3bf> 18915\n<e6b480> 6997\n<e6b481> 7000\n<e6b482> 18033\n<e6b483> 7003\n<e6b484> 6992\n<e6b485> 14873\n<e6b486> 18034\n<e6b487> 7006\n<e6b488> 7009\n<e6b489> 7011\n<e6b48a> 6989\n<e6b48b> 1905\n<e6b48c> 1910\n<e6b48d> 7417\n<e6b48e> 1926\n<e6b48f> 7004\n<e6b490> 7012\n<e6b491> 6996\n<e6b492> 6988\n<e6b496> 7444\n<e6b497> 1913\n<e6b498> 7001\n<e6b499> 6993\n<e6b49a> 6995\n<e6b49b> 1918\n<e6b49d> 6998\n<e6b49e> 1912\n<e6b49f> 6985\n<e6b4a0> 7007\n<e6b4a2> 7010\n<e6b4a4> 15043\n<e6b4a5> 1909\n<e6b4a6> 18035\n<e6b4a7> 1921\n<e6b4a8> 6982\n<e6b4a9> 1923\n<e6b4aa> 1907\n<e6b4ab> 1927\n<e6b4ac> 7008\n<e6b4ad> 6984\n<e6b4ae> 1924\n<e6b4af> 7438\n<e6b4b0> 6631\n<e6b4b1> 1911\n<e6b4b2> 1906\n<e6b4b3> 6991\n<e6b4b4> 6983\n<e6b4b5> 1925\n<e6b4b6> 1917\n<e6b4b7> 7002\n<e6b4b8> 1922\n<e6b4b9> 1920\n<e6b4ba> 6994\n<e6b4bb> 1914\n<e6b4bc> 6986\n<e6b4bf> 6987\n<e6b580> 7005\n<e6b581> 1908\n<e6b582> 6999\n<e6b58e> 17752\n<e6b597> 15603\n<e6b598> 7420\n<e6b599> 2319\n<e6b59a> 2324\n<e6b59b> 16540\n<e6b59c> 16930\n<e6b59e> 7429\n<e6b59f> 7435\n<e6b5a0> 7431\n<e6b5a1> 7418\n<e6b5a2> 7421\n<e6b5a5> 2331\n<e6b5a6> 2316\n<e6b5a7> 7430\n<e6b5a8> 7439\n<e6b5a9> 2326\n<e6b5aa> 2312\n<e6b5ac> 2321\n<e6b5ad> 7422\n<e6b5ae> 2323\n<e6b5af> 7423\n<e6b5b0> 7433\n<e6b5b1> 16629\n<e6b5b2> 14807\n<e6b5b4> 2325\nendcidchar\n\n100 begincidchar\n<e6b5b5> 7448\n<e6b5b6> 7416\n<e6b5b7> 2318\n<e6b5b8> 2317\n<e6b5b9> 2329\n<e6b5ba> 7413\n<e6b5bb> 7446\n<e6b5bc> 7434\n<e6b5bd> 7447\n<e6b5be> 7441\n<e6b5bf> 7427\n<e6b680> 7442\n<e6b681> 18036\n<e6b682> 7436\n<e6b683> 7445\n<e6b684> 7443\n<e6b685> 2330\n<e6b686> 7428\n<e6b687> 2315\n<e6b688> 2314\n<e6b689> 2322\n<e6b68a> 2328\n<e6b68b> 7440\n<e6b68c> 2327\n<e6b68d> 7425\n<e6b68e> 2796\n<e6b68f> 15848\n<e6b690> 7449\n<e6b691> 7424\n<e6b692> 7419\n<e6b693> 2320\n<e6b694> 2332\n<e6b695> 2313\n<e6b696> 16929\n<e6b697> 7432\n<e6b698> 7437\n<e6b6a4> 18038\n<e6b6a5> 15033\n<e6b6aa> 2830\n<e6b6ab> 8006\n<e6b6ac> 8010\n<e6b6ae> 2811\n<e6b6af> 2809\n<e6b6b1> 18039\n<e6b6b2> 2800\n<e6b6b3> 8008\n<e6b6b4> 8007\n<e6b6b5> 2820\n<e6b6b7> 8013\n<e6b6b8> 2814\n<e6b6b9> 16379\n<e6b6ba> 8031\n<e6b6bb> 8043\n<e6b6bc> 2797\n<e6b6bd> 8028\n<e6b6be> 8021\n<e6b6bf> 2832\n<e6b780> 8005\n<e6b782> 8033\n<e6b784> 2829\n<e6b785> 2817\n<e6b786> 2828\n<e6b787> 2807\n<e6b788> 8017\n<e6b789> 8035\n<e6b78a> 8027\n<e6b78b> 2808\n<e6b78c> 2802\n<e6b78d> 8041\n<e6b78f> 8034\n<e6b790> 8036\n<e6b791> 2810\n<e6b792> 2818\n<e6b793> 8038\n<e6b794> 8015\n<e6b795> 8032\n<e6b796> 8020\n<e6b797> 8040\n<e6b798> 2823\n<e6b799> 2799\n<e6b79a> 2821\n<e6b79b> 8025\n<e6b79e> 2812\n<e6b79f> 8019\n<e6b7a0> 8018\n<e6b7a1> 2801\n<e6b7a2> 8012\n<e6b7a3> 8042\n<e6b7a4> 2803\n<e6b7a5> 8022\n<e6b7a6> 2833\n<e6b7a8> 2827\n<e6b7a9> 8011\n<e6b7aa> 2824\n<e6b7ab> 2822\n<e6b7ac> 2831\n<e6b7ad> 8029\n<e6b7ae> 2826\n<e6b7af> 7426\n<e6b7b0> 8030\nendcidchar\n\n100 begincidchar\n<e6b7b1> 2825\n<e6b7b2> 8037\n<e6b7b3> 2798\n<e6b7b4> 8026\n<e6b7b5> 2816\n<e6b7b6> 8014\n<e6b7b7> 2815\n<e6b7b9> 2813\n<e6b7ba> 2805\n<e6b7bb> 2804\n<e6b7bc> 8639\n<e6b7bd> 8039\n<e6b7be> 18850\n<e6b880> 8016\n<e6b882> 15610\n<e6b883> 8660\n<e6b884> 15038\n<e6b885> 2806\n<e6b88a> 15041\n<e6b88f> 15600\n<e6b895> 18040\n<e6b898> 18041\n<e6b899> 3265\n<e6b89a> 2819\n<e6b89b> 3247\n<e6b89c> 8654\n<e6b89d> 3261\n<e6b89f> 8642\n<e6b8a0> 3244\n<e6b8a1> 3240\n<e6b8a2> 8672\n<e6b8a3> 3246\n<e6b8a4> 3250\n<e6b8a5> 3245\n<e6b8a6> 3254\n<e6b8a7> 8676\n<e6b8a8> 8667\n<e6b8a9> 18042\n<e6b8aa> 17154\n<e6b8ab> 8649\n<e6b8ac> 3259\n<e6b8ad> 3253\n<e6b8ae> 8661\n<e6b8af> 3237\n<e6b8b0> 8673\n<e6b8b1> 8666\n<e6b8b2> 3241\n<e6b8b3> 8655\n<e6b8b4> 3256\n<e6b8b8> 3238\n<e6b8b9> 8671\n<e6b8ba> 3258\n<e6b8bb> 8659\n<e6b8be> 3262\n<e6b8bf> 8650\n<e6b980> 8657\n<e6b981> 8651\n<e6b983> 3260\n<e6b984> 3268\n<e6b985> 8647\n<e6b989> 8643\n<e6b98a> 3243\n<e6b98b> 8656\n<e6b98d> 3257\n<e6b98e> 3266\n<e6b98f> 16948\n<e6b990> 16849\n<e6b991> 8658\n<e6b992> 8682\n<e6b993> 8674\n<e6b994> 3239\n<e6b995> 8680\n<e6b996> 3251\n<e6b997> 19024\n<e6b998> 3249\n<e6b999> 16614\n<e6b99a> 8686\n<e6b99b> 3248\n<e6b99c> 8664\n<e6b99d> 8652\n<e6b99e> 8662\n<e6b99f> 3271\n<e6b9a0> 8668\n<e6b9a1> 8665\n<e6b9a2> 8648\n<e6b9a3> 3267\n<e6b9a4> 8678\n<e6b9a5> 8675\n<e6b9a6> 8683\n<e6b9a7> 3242\n<e6b9a8> 8663\n<e6b9a9> 3270\n<e6b9ab> 8670\n<e6b9ae> 3252\n<e6b9af> 3255\n<e6b9b1> 8669\n<e6b9b2> 3269\n<e6b9b3> 8653\n<e6b9b4> 8009\n<e6b9b6> 14803\nendcidchar\n\n100 begincidchar\n<e6b9b7> 8679\n<e6b9b8> 8677\n<e6b9b9> 8681\n<e6b9bc> 16931\n<e6ba86> 18043\n<e6ba88> 8644\n<e6ba89> 3264\n<e6ba8b> 15295\n<e6ba8d> 9324\n<e6ba8e> 9323\n<e6ba8f> 9297\n<e6ba90> 3669\n<e6ba92> 9322\n<e6ba96> 3679\n<e6ba97> 9331\n<e6ba98> 3674\n<e6ba99> 9321\n<e6ba9a> 17793\n<e6ba9b> 9294\n<e6ba9c> 3680\n<e6ba9d> 3670\n<e6ba9e> 9309\n<e6ba9f> 9299\n<e6baa0> 9302\n<e6baa1> 9326\n<e6baa2> 3664\n<e6baa3> 9333\n<e6baa4> 9325\n<e6baa5> 3673\n<e6baa6> 9314\n<e6baa7> 3684\n<e6baaa> 3683\n<e6baab> 3677\n<e6baae> 9332\n<e6baaf> 3665\n<e6bab0> 9312\n<e6bab1> 9303\n<e6bab2> 9316\n<e6bab3> 9328\n<e6bab4> 3685\n<e6bab5> 16894\n<e6bab6> 3667\n<e6bab7> 9311\n<e6bab8> 15884\n<e6bab9> 9304\n<e6baba> 3676\n<e6babb> 18045\n<e6babc> 3675\n<e6babd> 9307\n<e6babe> 9317\n<e6babf> 9327\n<e6bb80> 9298\n<e6bb81> 9308\n<e6bb82> 3668\n<e6bb83> 9318\n<e6bb84> 3681\n<e6bb85> 3672\n<e6bb86> 9305\n<e6bb87> 3671\n<e6bb88> 9296\n<e6bb89> 9310\n<e6bb8a> 9330\n<e6bb8b> 3263\n<e6bb8c> 4127\n<e6bb8d> 9313\n<e6bb8e> 9963\n<e6bb8f> 9315\n<e6bb90> 9329\n<e6bb91> 3678\n<e6bb92> 9306\n<e6bb93> 3666\n<e6bb94> 3682\n<e6bb95> 4506\n<e6bb96> 9295\n<e6bb98> 9320\n<e6bb99> 16489\n<e6bb9a> 18047\n<e6bb9b> 16431\n<e6bb9c> 9319\n<e6bb9d> 17720\n<e6bba2> 18046\n<e6bbab> 9991\n<e6bbac> 4124\n<e6bbad> 9980\n<e6bbae> 9985\n<e6bbaf> 4113\n<e6bbb1> 9965\n<e6bbb2> 4126\n<e6bbb4> 4104\n<e6bbb5> 9964\n<e6bbb6> 9997\n<e6bbb7> 4128\n<e6bbb8> 9968\n<e6bbb9> 9984\n<e6bbba> 16955\n<e6bbbb> 9970\n<e6bbbc> 10000\n<e6bbbd> 9996\n<e6bbbe> 4102\n<e6bbbf> 4112\nendcidchar\n\n100 begincidchar\n<e6bc80> 10566\n<e6bc81> 4125\n<e6bc82> 4110\n<e6bc83> 9966\n<e6bc84> 16932\n<e6bc85> 9995\n<e6bc86> 4114\n<e6bc87> 9992\n<e6bc88> 10005\n<e6bc89> 9972\n<e6bc8a> 9981\n<e6bc8b> 15034\n<e6bc8c> 15611\n<e6bc8d> 10003\n<e6bc8e> 9993\n<e6bc8f> 4109\n<e6bc92> 9979\n<e6bc93> 4103\n<e6bc94> 4101\n<e6bc95> 4119\n<e6bc96> 16800\n<e6bc97> 18126\n<e6bc98> 9977\n<e6bc9c> 9999\n<e6bc9e> 10004\n<e6bc9f> 10002\n<e6bca0> 4107\n<e6bca1> 10006\n<e6bca2> 4111\n<e6bca3> 4118\n<e6bca4> 18051\n<e6bca5> 9967\n<e6bca6> 10542\n<e6bca7> 9976\n<e6bca9> 4105\n<e6bcaa> 4123\n<e6bcab> 4120\n<e6bcac> 4108\n<e6bcad> 9986\n<e6bcae> 9971\n<e6bcaf> 4121\n<e6bcb0> 9988\n<e6bcb1> 4115\n<e6bcb2> 4117\n<e6bcb3> 4100\n<e6bcb4> 18052\n<e6bcb5> 9990\n<e6bcb6> 9982\n<e6bcb7> 9969\n<e6bcb8> 4116\n<e6bcb9> 9998\n<e6bcba> 10001\n<e6bcbb> 9978\n<e6bcbc> 9989\n<e6bcbd> 17026\n<e6bcbe> 4106\n<e6bcbf> 4489\n<e6bd80> 9987\n<e6bd81> 10541\n<e6bd83> 9994\n<e6bd84> 16960\n<e6bd8e> 9973\n<e6bd8f> 10551\n<e6bd90> 10561\n<e6bd91> 4492\n<e6bd92> 10560\n<e6bd93> 10572\n<e6bd94> 4494\n<e6bd95> 10558\n<e6bd96> 15954\n<e6bd97> 10562\n<e6bd98> 4505\n<e6bd9a> 10553\n<e6bd9b> 4497\n<e6bd9c> 16961\n<e6bd9d> 10565\n<e6bd9e> 11162\n<e6bd9f> 4509\n<e6bda0> 4508\n<e6bda1> 10567\n<e6bda2> 10550\n<e6bda3> 10577\n<e6bda4> 4503\n<e6bda6> 4493\n<e6bda7> 10570\n<e6bda9> 10574\n<e6bdaa> 10579\n<e6bdab> 10568\n<e6bdac> 10556\n<e6bdad> 4496\n<e6bdae> 4499\n<e6bdaf> 4507\n<e6bdb0> 4502\n<e6bdb2> 10559\n<e6bdb3> 9983\n<e6bdb4> 16963\n<e6bdb6> 10555\n<e6bdb7> 10578\n<e6bdb8> 4498\n<e6bdb9> 15294\nendcidchar\n\n100 begincidchar\n<e6bdba> 4501\n<e6bdbb> 10580\n<e6bdbc> 4490\n<e6bdbd> 10569\n<e6bdbe> 10543\n<e6bdbf> 10575\n<e6be80> 5116\n<e6be81> 18055\n<e6be82> 10557\n<e6be84> 4491\n<e6be85> 10552\n<e6be86> 4495\n<e6be87> 10544\n<e6be88> 4122\n<e6be89> 10548\n<e6be8a> 16789\n<e6be8b> 10573\n<e6be8c> 10549\n<e6be8d> 10547\n<e6be8e> 4500\n<e6be90> 10571\n<e6be92> 10546\n<e6be93> 10564\n<e6be94> 10563\n<e6be95> 10576\n<e6be96> 10554\n<e6be97> 4504\n<e6be9d> 16953\n<e6be9e> 11165\n<e6be9f> 16966\n<e6bea0> 4843\n<e6bea1> 4833\n<e6bea2> 11177\n<e6bea3> 11157\n<e6bea4> 4835\n<e6bea5> 11169\n<e6bea6> 4842\n<e6bea7> 4837\n<e6bea8> 11167\n<e6bea9> 11662\n<e6beaa> 11173\n<e6beab> 11179\n<e6beac> 11172\n<e6bead> 11155\n<e6beae> 11170\n<e6beaf> 11181\n<e6beb0> 11183\n<e6beb1> 4832\n<e6beb2> 11182\n<e6beb3> 4838\n<e6beb4> 4844\n<e6beb5> 15911\n<e6beb6> 4841\n<e6beb8> 11176\n<e6beb9> 4840\n<e6beba> 11171\n<e6bebb> 15291\n<e6bebc> 11159\n<e6bebd> 11164\n<e6bebe> 18056\n<e6bebf> 11175\n<e6bf80> 4839\n<e6bf81> 4836\n<e6bf82> 4831\n<e6bf83> 4834\n<e6bf84> 11163\n<e6bf86> 10545\n<e6bf87> 11158\n<e6bf88> 11161\n<e6bf89> 11178\n<e6bf8a> 11166\n<e6bf8b> 11156\n<e6bf8c> 11661\n<e6bf8d> 11180\n<e6bf8e> 11160\n<e6bf8f> 11174\n<e6bf93> 16968\n<e6bf94> 11664\n<e6bf95> 5120\n<e6bf98> 5108\n<e6bf99> 15476\n<e6bf9a> 15475\n<e6bf9b> 5112\n<e6bf9c> 11666\n<e6bf9d> 11672\n<e6bf9e> 11670\n<e6bfa1> 5118\n<e6bfa2> 11673\n<e6bfa3> 11665\n<e6bfa4> 5113\n<e6bfa6> 11669\n<e6bfa7> 11668\n<e6bfa8> 11674\n<e6bfa9> 5119\n<e6bfab> 5114\n<e6bfac> 5117\n<e6bfad> 11667\n<e6bfae> 5121\n<e6bfaf> 5115\n<e6bfb0> 5122\nendcidchar\n\n100 begincidchar\n<e6bfb1> 5109\n<e6bfb2> 11671\n<e6bfb4> 11663\n<e6bfb6> 14501\n<e6bfb7> 12110\n<e6bfb8> 16951\n<e6bfba> 5355\n<e6bfbb> 12107\n<e6bfbc> 12109\n<e6bfbe> 5353\n<e6bfbf> 12105\n<e78080> 12106\n<e78081> 12101\n<e78083> 18146\n<e78084> 11168\n<e78085> 12102\n<e78086> 5354\n<e78087> 12098\n<e78089> 5351\n<e7808a> 12111\n<e7808b> 5352\n<e7808e> 12104\n<e7808f> 5357\n<e78091> 5356\n<e78094> 12103\n<e78095> 5519\n<e78096> 12461\n<e78097> 12467\n<e78098> 5520\n<e78099> 12458\n<e7809a> 5517\n<e7809b> 5514\n<e7809c> 12469\n<e7809d> 5518\n<e7809e> 15478\n<e7809f> 5515\n<e780a0> 12460\n<e780a4> 12468\n<e780a6> 12108\n<e780a7> 12459\n<e780a8> 5516\n<e780a9> 12466\n<e780aa> 12783\n<e780ab> 12462\n<e780ac> 18062\n<e780af> 12774\n<e780b0> 5661\n<e780b1> 12777\n<e780b2> 5662\n<e780b3> 12786\n<e780b4> 12776\n<e780b5> 12773\n<e780b7> 12775\n<e780b8> 12779\n<e780b9> 12782\n<e780ba> 12781\n<e780bb> 12785\n<e780bc> 12772\n<e780be> 5660\n<e780bf> 12780\n<e78180> 12784\n<e78181> 12787\n<e78182> 12778\n<e7818a> 13018\n<e7818b> 16980\n<e7818c> 5754\n<e7818d> 18887\n<e78190> 18064\n<e78191> 5832\n<e78192> 13196\n<e78194> 18065\n<e78198> 5833\n<e7819a> 13347\n<e7819b> 13346\n<e7819c> 14418\n<e7819d> 13450\n<e7819e> 5922\n<e7819f> 13448\n<e781a0> 13451\n<e781a1> 13449\n<e781a2> 13520\n<e781a3> 5956\n<e781a4> 5970\n<e781a5> 13596\n<e781a6> 13574\n<e781a7> 15605\n<e781a8> 13595\n<e781ab> 742\n<e781ac> 17649\n<e781ae> 19154\n<e781af> 18066\n<e781b0> 1010\n<e781b1> 6154\n<e781b4> 6339\n<e781b5> 14535\n<e781b6> 1254\n<e781b7> 18856\n<e781b8> 1257\n<e781b9> 16537\n<e781ba> 6340\nendcidchar\n\n100 begincidchar\n<e781be> 16981\n<e781bf> 18067\n<e78281> 18777\n<e78282> 6647\n<e78283> 6649\n<e78284> 6644\n<e78285> 6641\n<e78286> 6643\n<e78289> 17401\n<e7828a> 1603\n<e7828b> 16587\n<e7828e> 1601\n<e7828f> 18099\n<e78291> 6645\n<e78292> 1602\n<e78293> 6642\n<e78294> 6639\n<e78295> 1600\n<e78296> 6646\n<e78298> 6640\n<e78299> 1604\n<e7829a> 6648\n<e7829f> 7014\n<e782a0> 18242\n<e782a1> 7018\n<e782a3> 14706\n<e782a4> 1936\n<e782a5> 15543\n<e782a6> 18128\n<e782a7> 16982\n<e782a9> 7021\n<e782ab> 1928\n<e782ac> 1931\n<e782ad> 1933\n<e782ae> 1935\n<e782af> 1932\n<e782b0> 7017\n<e782b1> 7016\n<e782b3> 1930\n<e782b7> 7013\n<e782b8> 1934\n<e782b9> 15721\n<e782ba> 1929\n<e782bb> 18450\n<e782bc> 17753\n<e782bd> 17008\n<e782be> 7015\n<e78380> 18227\n<e78384> 15274\n<e78388> 2337\n<e7838a> 2333\n<e7838b> 7454\n<e7838c> 16984\n<e7838d> 7462\n<e7838e> 7467\n<e7838f> 2338\n<e78390> 14701\n<e78391> 7452\n<e78392> 7458\n<e78393> 7451\n<e78394> 7461\n<e78397> 7457\n<e78398> 2334\n<e78399> 2336\n<e7839a> 7466\n<e7839c> 7450\n<e7839d> 7453\n<e7839e> 7459\n<e7839f> 16987\n<e783a0> 7460\n<e783a1> 7468\n<e783a2> 7456\n<e783a4> 2335\n<e783af> 2838\n<e783b0> 8050\n<e783b1> 15048\n<e783b3> 8052\n<e783b4> 8048\n<e783b5> 18272\n<e783b6> 8060\n<e783b7> 8046\n<e783b8> 8059\n<e783b9> 2834\n<e783ba> 8044\n<e783bb> 8690\n<e783bc> 8054\n<e783bd> 2837\n<e783be> 15630\n<e783bf> 8055\n<e78480> 8058\n<e78482> 8062\n<e78484> 8051\n<e78485> 14883\n<e78486> 8056\n<e7848b> 8061\n<e7848c> 8049\n<e7848d> 8045\n<e7848e> 8063\n<e78490> 8053\n<e78493> 8057\nendcidchar\n\n100 begincidchar\n<e78497> 8047\n<e7849b> 8700\n<e7849c> 3279\n<e7849d> 15687\n<e7849e> 8688\n<e7849f> 8697\n<e784a0> 8687\n<e784a1> 3276\n<e784a2> 8695\n<e784a3> 8693\n<e784a5> 8694\n<e784a6> 3274\n<e784a8> 8698\n<e784a9> 15273\n<e784ab> 16993\n<e784ac> 17002\n<e784ae> 8691\n<e784af> 8689\n<e784b0> 3275\n<e784b1> 8692\n<e784b2> 8696\n<e784b3> 15700\n<e784b4> 15486\n<e784b5> 14189\n<e784b6> 3277\n<e784ba> 8699\n<e784bb> 15045\n<e784be> 14126\n<e78580> 17304\n<e78581> 9339\n<e78582> 9346\n<e78583> 9348\n<e78584> 9354\n<e78585> 16994\n<e78586> 3698\n<e78587> 9334\n<e78589> 3690\n<e7858a> 16996\n<e7858b> 9349\n<e7858c> 3695\n<e7858d> 9355\n<e7858e> 3686\n<e7858f> 16999\n<e78590> 9352\n<e78591> 18533\n<e78592> 9336\n<e78593> 9353\n<e78594> 9335\n<e78596> 3700\n<e78597> 19040\n<e78598> 9347\n<e78599> 3687\n<e7859a> 9356\n<e7859c> 3692\n<e7859d> 9340\n<e7859e> 3697\n<e7859f> 9351\n<e785a0> 9338\n<e785a1> 9345\n<e785a2> 9341\n<e785a3> 9337\n<e785a4> 3689\n<e785a5> 3696\n<e785a6> 3694\n<e785a7> 3691\n<e785a8> 3699\n<e785a9> 3688\n<e785aa> 9344\n<e785ab> 15557\n<e785ac> 3693\n<e785ae> 3278\n<e785b0> 9350\n<e785b1> 15808\n<e785b2> 9342\n<e785b3> 18407\n<e785b5> 15597\n<e785b6> 16384\n<e785b7> 14679\n<e785b8> 9343\n<e785ba> 18724\n<e785bb> 10014\n<e785bc> 14389\n<e785bd> 4131\n<e785be> 14704\n<e78680> 10010\n<e78681> 10016\n<e78682> 10012\n<e78684> 4133\n<e78685> 10011\n<e78686> 10015\n<e78687> 10007\n<e78688> 18182\n<e78689> 10009\n<e7868a> 4132\n<e7868c> 14826\n<e7868e> 15675\n<e7868f> 10013\n<e78690> 10008\n<e78691> 18866\n<e78692> 4134\nendcidchar\n\n100 begincidchar\n<e78694> 4129\n<e78696> 16991\n<e78697> 10017\n<e78698> 18461\n<e78699> 4130\n<e7869a> 10586\n<e7869b> 10583\n<e7869c> 10595\n<e7869d> 10589\n<e7869e> 10591\n<e7869f> 4510\n<e786a0> 10585\n<e786a1> 10593\n<e786a2> 18625\n<e786a3> 16072\n<e786a4> 10592\n<e786a5> 10590\n<e786a7> 10596\n<e786a8> 4513\n<e786a9> 10587\n<e786aa> 10594\n<e786ac> 4511\n<e786ad> 15901\n<e786af> 10582\n<e786b0> 10584\n<e786b1> 4512\n<e786b2> 10581\n<e786b3> 10597\n<e786b4> 16990\n<e786b5> 10588\n<e786b7> 18059\n<e786b8> 11187\n<e786b9> 4851\n<e786ba> 17006\n<e786bc> 11198\n<e786bd> 11196\n<e786be> 4845\n<e786bf> 11186\n<e78782> 11185\n<e78785> 11184\n<e78786> 11199\n<e78787> 11194\n<e78788> 4849\n<e78789> 4846\n<e7878a> 11193\n<e7878b> 11191\n<e7878e> 4852\n<e7878f> 11195\n<e78790> 4847\n<e78791> 14141\n<e78792> 4848\n<e78794> 11192\n<e78795> 4850\n<e78796> 11188\n<e78798> 11197\n<e78799> 4853\n<e7879c> 4854\n<e7879d> 16504\n<e7879f> 5124\n<e787a0> 5131\n<e787a1> 11675\n<e787a2> 11681\n<e787a4> 11679\n<e787a5> 5127\n<e787a6> 5126\n<e787a7> 5123\n<e787a8> 11677\n<e787ab> 15489\n<e787ac> 5129\n<e787ad> 5128\n<e787ae> 5125\n<e787b0> 11680\n<e787b1> 11676\n<e787b2> 11678\n<e787b4> 5130\n<e787b5> 18158\n<e787b6> 16026\n<e787b8> 5361\n<e787b9> 12114\n<e787bd> 12116\n<e787be> 5360\n<e787bf> 12113\n<e78880> 18916\n<e78881> 12112\n<e78882> 12473\n<e78883> 12115\n<e78885> 12474\n<e78886> 5521\n<e78887> 12472\n<e78889> 15803\n<e7888a> 12471\n<e7888c> 12470\n<e7888d> 5522\n<e7888e> 17009\n<e7888f> 14844\n<e78890> 5663\n<e78895> 17011\n<e78896> 14675\n<e78897> 14697\n<e78899> 13025\nendcidchar\n\n100 begincidchar\n<e7889a> 13024\n<e7889b> 5755\n<e7889d> 13023\n<e788a2> 13348\n<e788a3> 13452\n<e788a4> 17014\n<e788a5> 18996\n<e788a6> 13521\n<e788a7> 13621\n<e788a8> 5990\n<e788a9> 13641\n<e788aa> 743\n<e788ab> 17650\n<e788ae> 17017\n<e788b0> 1937\n<e788b5> 5132\n<e788b6> 744\n<e788b8> 1607\n<e788b9> 2339\n<e788ba> 3701\n<e788bb> 745\n<e788bd> 2839\n<e788be> 4135\n<e788bf> 6029\n<e78980> 17018\n<e78981> 7022\n<e78982> 7469\n<e78984> 10018\n<e78986> 5133\n<e78987> 746\n<e78988> 1608\n<e7898b> 8701\n<e7898c> 3280\n<e7898f> 9357\n<e78990> 15049\n<e78992> 3702\n<e78993> 10019\n<e78995> 17021\n<e78996> 4514\n<e78997> 17022\n<e78998> 5523\n<e78999> 747\n<e7899a> 8702\n<e7899b> 748\n<e7899c> 18010\n<e7899d> 1012\n<e7899e> 6155\n<e7899f> 1011\n<e789a0> 1260\n<e789a1> 1259\n<e789a2> 1258\n<e789a3> 6341\n<e789a6> 16059\n<e789a7> 1609\n<e789a9> 1610\n<e789aa> 6650\n<e789ac> 7025\n<e789ae> 7028\n<e789af> 1939\n<e789b0> 7026\n<e789b2> 1938\n<e789b3> 7027\n<e789b4> 1940\n<e789b6> 7472\n<e789b7> 7471\n<e789b8> 7470\n<e789b9> 2340\n<e789bd> 2840\n<e789be> 8064\n<e789bf> 8067\n<e78a80> 3282\n<e78a81> 2841\n<e78a82> 17027\n<e78a84> 3281\n<e78a85> 8706\n<e78a86> 8705\n<e78a87> 15050\n<e78a8b> 8707\n<e78a8c> 9359\n<e78a8d> 9358\n<e78a8e> 9362\n<e78a8f> 17353\n<e78a90> 9361\n<e78a91> 9360\n<e78a92> 4136\n<e78a93> 10022\n<e78a94> 15051\n<e78a95> 10021\n<e78a96> 4137\n<e78a97> 10020\n<e78a98> 10598\n<e78a9a> 10599\n<e78a9b> 4515\n<e78a9f> 18234\n<e78aa1> 12479\n<e78aa2> 5524\n<e78aa3> 12478\n<e78aa4> 12477\n<e78aa7> 5756\n<e78aa8> 12790\nendcidchar\n\n100 begincidchar\n<e78aa9> 13199\n<e78aaa> 13522\n<e78aac> 749\n<e78aad> 17652\n<e78aae> 6063\n<e78aaf> 853\n<e78ab0> 6064\n<e78ab2> 16310\n<e78aba> 6347\n<e78abd> 6343\n<e78abf> 6342\n<e78b80> 1611\n<e78b81> 6346\n<e78b82> 1262\n<e78b83> 6344\n<e78b84> 1261\n<e78b85> 6348\n<e78b86> 6345\n<e78b89> 6654\n<e78b8a> 7029\n<e78b8b> 6652\n<e78b8c> 6659\n<e78b8d> 17354\n<e78b8e> 1612\n<e78b90> 1615\n<e78b91> 6660\n<e78b92> 6656\n<e78b94> 6657\n<e78b96> 6651\n<e78b97> 1614\n<e78b98> 6653\n<e78b99> 1613\n<e78b9a> 6658\n<e78b9c> 6655\n<e78b9f> 7033\n<e78ba2> 16279\n<e78ba3> 7036\n<e78ba4> 7030\n<e78ba6> 7035\n<e78ba8> 7031\n<e78ba9> 1941\n<e78baa> 7034\n<e78bab> 7032\n<e78bb3> 7478\n<e78bb4> 7475\n<e78bb6> 7477\n<e78bb7> 2345\n<e78bb8> 2344\n<e78bb9> 2342\n<e78bba> 7474\n<e78bbb> 7479\n<e78bbc> 2341\n<e78bbd> 2343\n<e78bbe> 7476\n<e78bbf> 8075\n<e78c80> 7473\n<e78c81> 7480\n<e78c82> 16282\n<e78c84> 16053\n<e78c87> 8070\n<e78c88> 8074\n<e78c8a> 8073\n<e78c8b> 8709\n<e78c8c> 8720\n<e78c8f> 8076\n<e78c90> 18154\n<e78c91> 8071\n<e78c92> 8708\n<e78c93> 2845\n<e78c96> 2844\n<e78c97> 8069\n<e78c98> 8072\n<e78c99> 2846\n<e78c9b> 2843\n<e78c9c> 2842\n<e78c9d> 8068\n<e78c9e> 8077\n<e78ca2> 8711\n<e78ca3> 8718\n<e78ca5> 3284\n<e78ca6> 8717\n<e78ca7> 8714\n<e78ca8> 17034\n<e78ca9> 3286\n<e78caa> 15728\n<e78cab> 17029\n<e78cac> 16306\n<e78cad> 8716\n<e78cae> 17035\n<e78cb0> 8710\n<e78cb1> 8712\n<e78cb2> 8715\n<e78cb3> 8713\n<e78cb4> 3285\n<e78cb5> 8719\n<e78cb6> 3283\n<e78cb7> 3703\n<e78cb8> 18155\n<e78cb9> 17356\n<e78cba> 9366\nendcidchar\n\n100 begincidchar\n<e78cbb> 9365\n<e78cbc> 9363\n<e78cbe> 3706\n<e78cbf> 3705\n<e78d80> 9367\n<e78d81> 18156\n<e78d82> 9364\n<e78d83> 10023\n<e78d84> 4138\n<e78d85> 3704\n<e78d88> 17402\n<e78d89> 9369\n<e78d8a> 9368\n<e78d8c> 10026\n<e78d8d> 10024\n<e78d8e> 4516\n<e78d8f> 16209\n<e78d90> 4139\n<e78d91> 10025\n<e78d92> 10601\n<e78d97> 4517\n<e78d98> 10600\n<e78d99> 10609\n<e78d9a> 10608\n<e78d9b> 10606\n<e78d9d> 10605\n<e78da1> 10607\n<e78da2> 10610\n<e78da5> 11208\n<e78da8> 4857\n<e78da9> 11204\n<e78daa> 11210\n<e78dab> 11209\n<e78dac> 11207\n<e78db0> 5134\n<e78db1> 16280\n<e78db2> 5135\n<e78db3> 11682\n<e78db4> 16084\n<e78db5> 5363\n<e78db6> 12117\n<e78db7> 5362\n<e78db8> 5525\n<e78dba> 5526\n<e78dbb> 5664\n<e78dbc> 12792\n<e78dbd> 12791\n<e78dbe> 13026\n<e78dbf> 13200\n<e78e80> 5834\n<e78e81> 13350\n<e78e82> 13349\n<e78e83> 13351\n<e78e84> 854\n<e78e85> 7037\n<e78e86> 2346\n<e78e87> 2847\n<e78e88> 8078\n<e78e89> 855\n<e78e8a> 6065\n<e78e8b> 750\n<e78e8c> 18918\n<e78e8e> 6158\n<e78e8f> 18149\n<e78e92> 6353\n<e78e95> 6349\n<e78e96> 1263\n<e78e97> 6350\n<e78e98> 14838\n<e78e9c> 16522\n<e78e9d> 6668\n<e78e9e> 14683\n<e78e9f> 1618\n<e78ea0> 6666\n<e78ea1> 6662\n<e78ea2> 6665\n<e78ea4> 6661\n<e78ea5> 1620\n<e78ea6> 6664\n<e78ea7> 16519\n<e78ea8> 1617\n<e78ea9> 1616\n<e78eaa> 17037\n<e78eab> 1619\n<e78eac> 6667\n<e78ead> 6663\n<e78eb2> 1947\n<e78eb3> 1950\n<e78eb4> 7045\n<e78eb5> 7044\n<e78eb6> 7043\n<e78eb7> 1944\n<e78eb8> 7052\n<e78eb9> 7042\n<e78eba> 18868\n<e78ebb> 1946\n<e78ebc> 7485\n<e78ebe> 7049\n<e78ebf> 7047\n<e78f80> 1949\nendcidchar\n\n100 begincidchar\n<e78f82> 7039\n<e78f83> 7050\n<e78f84> 19123\n<e78f85> 7041\n<e78f86> 7051\n<e78f87> 7048\n<e78f88> 7040\n<e78f89> 17040\n<e78f8a> 1945\n<e78f8b> 7053\n<e78f8c> 7038\n<e78f8d> 1948\n<e78f8e> 16667\n<e78f8f> 17036\n<e78f90> 15127\n<e78f92> 7490\n<e78f93> 7481\n<e78f94> 7492\n<e78f95> 16499\n<e78f96> 7484\n<e78f99> 7482\n<e78f9a> 7494\n<e78f9b> 7491\n<e78f9c> 7489\n<e78f9d> 7493\n<e78f9e> 2352\n<e78fa0> 2350\n<e78fa1> 18160\n<e78fa2> 15523\n<e78fa3> 7487\n<e78fa4> 17061\n<e78fa5> 7483\n<e78fa6> 15546\n<e78fa7> 7486\n<e78fa8> 7497\n<e78fa9> 7488\n<e78faa> 2351\n<e78fab> 7046\n<e78fad> 2347\n<e78fae> 2349\n<e78faf> 16401\n<e78fb3> 15531\n<e78fb4> 8092\n<e78fb5> 8081\n<e78fb6> 8079\n<e78fb7> 17050\n<e78fb8> 8080\n<e78fb9> 15353\n<e78fba> 8087\n<e78fbb> 15532\n<e78fbc> 8088\n<e78fbd> 8084\n<e78fbe> 2852\n<e78fbf> 8089\n<e79080> 8086\n<e79081> 8083\n<e79082> 18875\n<e79083> 2850\n<e79084> 8082\n<e79085> 2848\n<e79086> 2851\n<e79087> 8085\n<e79088> 8093\n<e79089> 2348\n<e7908a> 2849\n<e7908b> 8091\n<e7908c> 8090\n<e7908d> 2853\n<e79091> 17772\n<e79092> 15334\n<e79094> 14836\n<e79095> 17051\n<e79096> 8725\n<e79097> 16557\n<e79099> 18163\n<e7909a> 8726\n<e7909b> 3296\n<e7909c> 14557\n<e7909d> 8732\n<e790a0> 8734\n<e790a1> 8727\n<e790a2> 3290\n<e790a3> 8731\n<e790a4> 8730\n<e790a5> 3291\n<e790a6> 3297\n<e790a8> 3298\n<e790a9> 8733\n<e790aa> 3288\n<e790ab> 8724\n<e790ac> 8722\n<e790ad> 8728\n<e790ae> 8721\n<e790af> 3295\n<e790b0> 8723\n<e790b1> 8729\n<e790b2> 8735\n<e790b3> 3289\n<e790b4> 3294\n<e790b7> 15073\nendcidchar\n\n100 begincidchar\n<e790b8> 15113\n<e790b9> 17054\n<e790ba> 3287\n<e790bc> 15071\n<e790bf> 3713\n<e79180> 9376\n<e79181> 3712\n<e79182> 9380\n<e79183> 14874\n<e79184> 9370\n<e79185> 15319\n<e79186> 9381\n<e79187> 17060\n<e79188> 15541\n<e79189> 17041\n<e7918c> 19116\n<e7918d> 9382\n<e7918e> 9379\n<e79191> 9374\n<e79192> 9373\n<e79193> 16945\n<e79194> 9383\n<e79195> 3709\n<e79196> 14837\n<e79197> 9375\n<e79199> 3714\n<e7919a> 3708\n<e7919d> 17094\n<e7919e> 3711\n<e7919f> 3710\n<e791a0> 17058\n<e791a1> 19020\n<e791a2> 10027\n<e791a3> 4141\n<e791a4> 4140\n<e791a5> 16641\n<e791a7> 10032\n<e791a8> 15086\n<e791a9> 4518\n<e791aa> 4142\n<e791ab> 15335\n<e791ac> 17064\n<e791ad> 4144\n<e791ae> 10033\n<e791af> 3707\n<e791b0> 4143\n<e791b1> 10029\n<e791b2> 10031\n<e791b3> 10028\n<e791b4> 17065\n<e791b5> 10030\n<e791b6> 17062\n<e791b9> 10620\n<e791ba> 15057\n<e791bc> 10619\n<e791bd> 10616\n<e791be> 4521\n<e791bf> 11211\n<e79280> 4522\n<e79281> 10615\n<e79282> 17068\n<e79283> 4520\n<e79285> 10617\n<e79286> 10614\n<e79287> 10611\n<e79288> 10618\n<e7928b> 4519\n<e7928c> 14881\n<e7928d> 18077\n<e79290> 11688\n<e79292> 11215\n<e79294> 11214\n<e79295> 11216\n<e79297> 11685\n<e79298> 4860\n<e79299> 14835\n<e7929a> 11212\n<e7929b> 15114\n<e7929c> 4858\n<e7929d> 19021\n<e7929e> 4862\n<e7929f> 4861\n<e792a0> 11213\n<e792a1> 11217\n<e792a3> 4859\n<e792a4> 16752\n<e792a5> 11692\n<e792a6> 5138\n<e792a7> 5364\n<e792a8> 5139\n<e792a9> 5136\n<e792aa> 11689\n<e792ab> 11687\n<e792ad> 11690\n<e792af> 11693\n<e792b0> 5137\n<e792b1> 11691\n<e792b2> 11686\n<e792b4> 15525\n<e792b5> 12120\nendcidchar\n\n100 begincidchar\n<e792b6> 12123\n<e792b7> 12482\n<e792b8> 12118\n<e792b9> 18922\n<e792ba> 12793\n<e792bb> 12124\n<e792bd> 5527\n<e792be> 12122\n<e792bf> 5365\n<e79380> 12119\n<e79381> 12121\n<e79382> 12125\n<e79383> 12483\n<e79385> 12481\n<e79386> 19125\n<e79388> 17077\n<e7938a> 5528\n<e7938b> 12480\n<e7938c> 15070\n<e7938f> 5665\n<e79390> 15003\n<e79393> 18170\n<e79394> 5758\n<e79395> 13202\n<e79396> 5757\n<e79397> 13204\n<e79398> 13201\n<e79399> 13203\n<e7939a> 5886\n<e7939b> 13453\n<e7939c> 856\n<e7939d> 6669\n<e793a0> 2854\n<e793a1> 9384\n<e793a2> 4863\n<e793a3> 5529\n<e793a4> 5835\n<e793a5> 13454\n<e793a6> 857\n<e793a7> 16382\n<e793a8> 6670\n<e793a9> 288\n<e793ac> 7054\n<e793ae> 7055\n<e793b0> 16358\n<e793b1> 16283\n<e793b2> 16351\n<e793b8> 16372\n<e793bb> 8736\n<e793bd> 9387\n<e793be> 9386\n<e793bf> 9385\n<e79480> 10034\n<e79484> 4145\n<e79485> 16350\n<e79487> 10622\n<e79488> 10621\n<e7948b> 11218\n<e7948e> 17079\n<e7948f> 11697\n<e79493> 12127\n<e79494> 12126\n<e79495> 5366\n<e79496> 12484\n<e79497> 13027\n<e79498> 858\n<e79499> 17795\n<e7949a> 1951\n<e7949c> 2857\n<e7949d> 9388\n<e7949e> 17080\n<e7949f> 859\n<e794a1> 7502\n<e794a2> 2858\n<e794aa> 6159\n<e794ab> 1265\n<e794ac> 1264\n<e794ad> 1952\n<e794ae> 7056\n<e794af> 8737\n<e794b4> 16007\n<e794b5> 17754\n<e794b9> 6355\n<e794ba> 6354\n<e794bb> 15867\n<e794bd> 1621\n<e794be> 6673\n<e794bf> 6671\n<e79580> 6672\n<e79582> 17357\n<e79586> 16192\n<e7958a> 17087\n<e7958b> 1956\n<e7958c> 1954\n<e7958d> 17086\n<e7958e> 1955\n<e7958f> 1953\n<e79591> 15614\n<e79593> 16363\n<e79594> 2353\nendcidchar\n\n100 begincidchar\n<e79595> 15082\n<e79599> 2357\n<e7959a> 2356\n<e7959b> 7503\n<e7959c> 2355\n<e7959d> 2354\n<e7959f> 7504\n<e795a0> 15729\n<e795a2> 2861\n<e795a3> 8095\n<e795a4> 8094\n<e795a7> 17088\n<e795aa> 3302\n<e795ab> 3301\n<e795ac> 8739\n<e795ad> 18173\n<e795ae> 17089\n<e795af> 8738\n<e795b0> 2862\n<e795b2> 18174\n<e795b6> 3717\n<e795b7> 9390\n<e795b8> 3718\n<e795b9> 9389\n<e795ba> 16207\n<e795bd> 10037\n<e795be> 10623\n<e795bf> 4523\n<e79680> 11219\n<e79683> 15077\n<e79684> 11698\n<e79686> 5531\n<e79687> 5530\n<e7968a> 5836\n<e7968b> 866\n<e7968c> 6674\n<e7968d> 18175\n<e7968e> 17093\n<e7968f> 2863\n<e79690> 10038\n<e79691> 4146\n<e79692> 558\n<e79698> 6675\n<e7969d> 1622\n<e7969e> 17095\n<e796a7> 7059\n<e796aa> 7060\n<e796ab> 1957\n<e796b0> 7505\n<e796b1> 16045\n<e796b4> 17096\n<e796b5> 2866\n<e796b6> 7511\n<e796b8> 2367\n<e796b9> 2365\n<e796ba> 7512\n<e796bb> 7507\n<e796bc> 2364\n<e796bd> 2363\n<e796be> 2358\n<e796bf> 7510\n<e79780> 7509\n<e79781> 7506\n<e79782> 2366\n<e79783> 16275\n<e79784> 7508\n<e79785> 2359\n<e79787> 2360\n<e79788> 18177\n<e7978a> 2867\n<e7978d> 2868\n<e7978e> 8096\n<e7978f> 8098\n<e79790> 8102\n<e79791> 8101\n<e79792> 8097\n<e79797> 8747\n<e79798> 3307\n<e79799> 3306\n<e7979a> 8741\n<e7979b> 3304\n<e7979c> 17358\n<e7979d> 8744\n<e7979e> 3308\n<e7979f> 8745\n<e797a0> 3309\n<e797a1> 8742\n<e797a2> 3303\n<e797a3> 3305\n<e797a4> 8746\n<e797a6> 8743\n<e797a7> 8740\n<e797ad> 9403\n<e797af> 9392\n<e797b0> 3720\n<e797b1> 3723\n<e797b2> 3722\n<e797b3> 3727\n<e797b4> 3726\n<e797b5> 9404\nendcidchar\n\n100 begincidchar\n<e797b6> 9402\n<e797b7> 9395\n<e797b8> 9399\n<e797b9> 9398\n<e797ba> 3724\n<e797bb> 9401\n<e797bc> 9397\n<e797bd> 9405\n<e797be> 9396\n<e797bf> 3725\n<e79880> 3719\n<e79881> 3721\n<e79882> 17097\n<e79883> 9394\n<e79887> 16271\n<e79888> 10040\n<e79889> 4150\n<e7988a> 10044\n<e7988b> 4149\n<e7988c> 10041\n<e7988d> 4148\n<e7988f> 9393\n<e79890> 9400\n<e79891> 10043\n<e79893> 4151\n<e79894> 10045\n<e79895> 10042\n<e79896> 10039\n<e79899> 10626\n<e7989a> 10630\n<e7989b> 10632\n<e7989c> 10628\n<e7989d> 10627\n<e7989e> 10625\n<e7989f> 4526\n<e798a0> 4524\n<e798a3> 10629\n<e798a4> 4527\n<e798a5> 10624\n<e798a6> 4528\n<e798a7> 4147\n<e798a8> 10631\n<e798a9> 4525\n<e798ac> 17098\n<e798ad> 11221\n<e798af> 11220\n<e798b0> 11228\n<e798b1> 11222\n<e798b2> 11227\n<e798b3> 11224\n<e798b4> 4866\n<e798b5> 11226\n<e798b8> 4867\n<e798ba> 4868\n<e798bb> 15984\n<e798bc> 11225\n<e798bd> 11223\n<e79980> 16102\n<e79982> 5141\n<e79983> 11699\n<e79986> 5140\n<e79987> 11702\n<e7998c> 5142\n<e7998d> 18178\n<e7998e> 15986\n<e7998f> 17100\n<e79990> 12131\n<e79991> 17099\n<e79992> 5369\n<e79993> 12132\n<e79994> 16112\n<e79996> 5367\n<e79997> 12133\n<e79998> 5368\n<e79999> 12130\n<e7999a> 12134\n<e7999c> 12128\n<e7999f> 5532\n<e799a0> 12485\n<e799a1> 5533\n<e799a2> 5666\n<e799a4> 12129\n<e799a5> 5667\n<e799a6> 16042\n<e799a7> 16297\n<e799a9> 5759\n<e799aa> 13028\n<e799ac> 5838\n<e799ad> 13205\n<e799ae> 5837\n<e799af> 17101\n<e799b0> 13352\n<e799b3> 15083\n<e799b4> 18179\n<e799b5> 13635\n<e799b6> 559\n<e799b8> 1962\n<e799b9> 7061\n<e799ba> 18181\n<e799bd> 867\nendcidchar\n\n100 begincidchar\n<e799be> 1013\n<e799bf> 6160\n<e79a80> 17363\n<e79a81> 6358\n<e79a82> 1268\n<e79a84> 1625\n<e79a89> 8104\n<e79a8a> 7513\n<e79a8b> 2368\n<e79a8c> 17364\n<e79a8e> 2869\n<e79a8f> 8103\n<e79a90> 17104\n<e79a92> 8749\n<e79a93> 3313\n<e79a95> 8748\n<e79a96> 3312\n<e79a99> 9406\n<e79a9a> 4531\n<e79a9b> 10636\n<e79aa1> 17109\n<e79aa4> 11703\n<e79aa5> 17110\n<e79aa6> 12135\n<e79aaa> 12795\n<e79aab> 12794\n<e79aad> 13206\n<e79aae> 868\n<e79aaf> 6676\n<e79ab0> 2369\n<e79ab4> 3314\n<e79ab5> 9407\n<e79ab7> 17111\n<e79ab8> 10046\n<e79aba> 4532\n<e79abb> 11229\n<e79abd> 12136\n<e79abe> 12796\n<e79abf> 869\n<e79b82> 1626\n<e79b83> 1968\n<e79b84> 7062\n<e79b85> 1969\n<e79b86> 1967\n<e79b88> 1966\n<e79b89> 7514\n<e79b8a> 2370\n<e79b8c> 17112\n<e79b92> 2871\n<e79b93> 8105\n<e79b94> 2870\n<e79b96> 16213\n<e79b99> 18891\n<e79b9a> 8750\n<e79b9b> 2872\n<e79b9c> 3315\n<e79b9d> 9408\n<e79ba1> 4152\n<e79ba3> 4153\n<e79ba4> 4533\n<e79ba5> 4870\n<e79ba6> 11230\n<e79ba7> 4869\n<e79ba9> 11704\n<e79baa> 5143\n<e79bac> 12137\n<e79bad> 12797\n<e79bae> 870\n<e79baf> 1269\n<e79bb0> 6679\n<e79bb1> 6678\n<e79bb2> 1627\n<e79bb3> 6677\n<e79bb4> 1628\n<e79bb5> 6680\n<e79bb7> 7068\n<e79bb8> 1972\n<e79bb9> 1971\n<e79bba> 7070\n<e79bbb> 7069\n<e79bbc> 1976\n<e79bbe> 1975\n<e79c81> 1970\n<e79c87> 1977\n<e79c88> 7063\n<e79c89> 1973\n<e79c8a> 7067\n<e79c8b> 1974\n<e79c8c> 15714\n<e79c90> 7517\n<e79c91> 7521\n<e79c92> 7519\n<e79c93> 7518\n<e79c95> 7522\n<e79c9b> 7516\n<e79c9d> 7515\n<e79c9e> 17118\n<e79ca2> 7525\n<e79ca3> 7520\n<e79ca4> 16360\nendcidchar\n\n100 begincidchar\n<e79ca5> 8114\n<e79ca6> 17119\n<e79ca7> 7526\n<e79ca8> 2376\n<e79ca9> 2373\n<e79cab> 16371\n<e79cad> 8108\n<e79caf> 8107\n<e79cb3> 8112\n<e79cb4> 8111\n<e79cb5> 8116\n<e79cb6> 2876\n<e79cb7> 2873\n<e79cb8> 2877\n<e79cb9> 8106\n<e79cba> 2878\n<e79cbb> 8115\n<e79cbc> 2875\n<e79cbd> 8113\n<e79cbe> 2874\n<e79d80> 17120\n<e79d83> 18186\n<e79d84> 8753\n<e79d85> 8755\n<e79d8a> 8756\n<e79d8d> 8754\n<e79d8e> 8757\n<e79d8f> 3316\n<e79d92> 9412\n<e79d94> 9417\n<e79d95> 9409\n<e79d96> 9413\n<e79d98> 17123\n<e79d99> 9418\n<e79d9a> 9414\n<e79d9b> 3730\n<e79d9c> 3738\n<e79d9e> 3733\n<e79da1> 4157\n<e79da2> 3741\n<e79da3> 3734\n<e79da5> 3739\n<e79da6> 3732\n<e79da7> 9416\n<e79da8> 3740\n<e79da9> 9415\n<e79daa> 3736\n<e79dab> 3731\n<e79dac> 3737\n<e79dad> 9419\n<e79dae> 10051\n<e79daf> 10053\n<e79db2> 14699\n<e79db7> 18089\n<e79db8> 15104\n<e79db9> 3735\n<e79dba> 17175\n<e79dbb> 15108\n<e79dbc> 10048\n<e79dbd> 4155\n<e79dbe> 10054\n<e79dbf> 4156\n<e79e80> 10052\n<e79e81> 10047\n<e79e82> 10050\n<e79e83> 10055\n<e79e84> 4154\n<e79e85> 10049\n<e79e87> 4535\n<e79e88> 10640\n<e79e89> 10639\n<e79e8b> 4538\n<e79e8c> 4536\n<e79e8d> 10637\n<e79e8e> 4534\n<e79e8f> 10638\n<e79e91> 4537\n<e79e93> 14381\n<e79e95> 11238\n<e79e97> 11240\n<e79e98> 18190\n<e79e99> 11239\n<e79e9a> 11231\n<e79e9b> 11235\n<e79e9c> 11234\n<e79e9d> 11232\n<e79ea0> 4871\n<e79ea1> 11233\n<e79ea5> 4874\n<e79ea7> 5148\n<e79ea8> 11712\n<e79eaa> 5145\n<e79eab> 11706\n<e79eac> 5147\n<e79ead> 5149\n<e79eaf> 17125\n<e79eb0> 5146\n<e79eb1> 11711\n<e79eb2> 11707\n<e79eb3> 5144\nendcidchar\n\n100 begincidchar\n<e79eb4> 11710\n<e79eb5> 11705\n<e79eb6> 11709\n<e79eb7> 11708\n<e79eb9> 15987\n<e79eba> 12139\n<e79ebd> 5370\n<e79ebe> 18193\n<e79ebf> 5371\n<e79f82> 12138\n<e79f83> 15281\n<e79f84> 12488\n<e79f85> 16833\n<e79f87> 5534\n<e79f8b> 18194\n<e79f8c> 12798\n<e79f8d> 12801\n<e79f90> 13029\n<e79f93> 5760\n<e79f94> 13353\n<e79f95> 13455\n<e79f97> 5925\n<e79f9a> 5971\n<e79f9b> 871\n<e79f9c> 1978\n<e79f9d> 18894\n<e79f9e> 8760\n<e79fa0> 9420\n<e79fa2> 872\n<e79fa3> 1270\n<e79fa5> 1629\n<e79fa6> 16513\n<e79fa9> 2377\n<e79fac> 8761\n<e79fad> 3317\n<e79fae> 3742\n<e79faf> 5150\n<e79fb0> 11713\n<e79fb1> 12489\n<e79fb2> 12802\n<e79fb3> 873\n<e79fb4> 17129\n<e79fb7> 6686\n<e79fb8> 6681\n<e79fb9> 6683\n<e79fba> 6685\n<e79fbb> 6684\n<e79fbc> 6682\n<e79fbd> 1630\n<e79fbe> 16341\n<e7a082> 1979\n<e7a083> 7081\n<e7a085> 7076\n<e7a086> 7073\n<e7a088> 15942\n<e7a089> 7080\n<e7a08e> 7079\n<e7a08f> 7078\n<e7a090> 7077\n<e7a093> 7082\n<e7a094> 1980\n<e7a098> 18195\n<e7a09c> 18196\n<e7a09d> 2381\n<e7a09e> 15123\n<e7a09f> 2387\n<e7a0a0> 2386\n<e7a0a1> 7535\n<e7a0a2> 7529\n<e7a0a3> 7527\n<e7a0a5> 2384\n<e7a0a6> 8123\n<e7a0a7> 2379\n<e7a0a8> 7532\n<e7a0a9> 7536\n<e7a0aa> 7538\n<e7a0ab> 7534\n<e7a0ac> 7528\n<e7a0ad> 2385\n<e7a0ae> 7533\n<e7a0af> 7531\n<e7a0b0> 2378\n<e7a0b1> 7539\n<e7a0b2> 2388\n<e7a0b3> 7537\n<e7a0b4> 2382\n<e7a0b5> 7530\n<e7a0b7> 2383\n<e7a0b8> 2380\n<e7a0b9> 17366\n<e7a0bc> 16410\n<e7a0bd> 15466\n<e7a182> 15044\n<e7a183> 2880\n<e7a184> 15403\n<e7a185> 8124\n<e7a187> 18197\n<e7a188> 8117\n<e7a189> 8119\n<e7a18a> 8121\nendcidchar\n\n100 begincidchar\n<e7a18b> 15469\n<e7a18c> 8122\n<e7a18d> 8120\n<e7a18e> 2881\n<e7a190> 8125\n<e7a191> 18198\n<e7a192> 8118\n<e7a193> 16277\n<e7a194> 15467\n<e7a19c> 8765\n<e7a19d> 3318\n<e7a19e> 8773\n<e7a1a0> 8762\n<e7a1a2> 8774\n<e7a1a6> 18199\n<e7a1a8> 8772\n<e7a1a9> 8771\n<e7a1aa> 8768\n<e7a1ab> 2879\n<e7a1ac> 3319\n<e7a1ad> 8766\n<e7a1ae> 8769\n<e7a1af> 3320\n<e7a1b0> 8770\n<e7a1b1> 8767\n<e7a1b9> 9431\n<e7a1ba> 16105\n<e7a1bb> 9435\n<e7a1bc> 3749\n<e7a1be> 10061\n<e7a1bf> 3752\n<e7a280> 9433\n<e7a281> 14056\n<e7a283> 9430\n<e7a284> 9425\n<e7a287> 9421\n<e7a288> 15125\n<e7a289> 3748\n<e7a28c> 3747\n<e7a28d> 15124\n<e7a28e> 3743\n<e7a28f> 9424\n<e7a291> 3750\n<e7a293> 3751\n<e7a294> 9423\n<e7a295> 9426\n<e7a296> 9434\n<e7a299> 9432\n<e7a29a> 9422\n<e7a29e> 10063\n<e7a29f> 4159\n<e7a2a0> 10065\n<e7a2a1> 9429\n<e7a2a2> 10067\n<e7a2a3> 4163\n<e7a2a4> 10068\n<e7a2a5> 10064\n<e7a2a7> 4160\n<e7a2a8> 10060\n<e7a2a9> 4162\n<e7a2aa> 10057\n<e7a2ab> 10062\n<e7a2ac> 10066\n<e7a2ad> 10059\n<e7a2af> 17132\n<e7a2b0> 3744\n<e7a2b1> 17140\n<e7a2b2> 10056\n<e7a2b3> 4161\n<e7a2b4> 10058\n<e7a2b6> 15468\n<e7a2b8> 17777\n<e7a2b9> 15459\n<e7a2ba> 4541\n<e7a2bb> 10642\n<e7a2bc> 4545\n<e7a2be> 4543\n<e7a381> 4158\n<e7a385> 4540\n<e7a387> 17133\n<e7a388> 10648\n<e7a389> 10651\n<e7a38a> 4542\n<e7a38b> 4539\n<e7a38c> 10644\n<e7a38d> 10641\n<e7a38e> 10646\n<e7a38f> 10643\n<e7a390> 4546\n<e7a391> 10645\n<e7a392> 15126\n<e7a393> 17134\n<e7a394> 10647\n<e7a395> 4544\n<e7a397> 17138\n<e7a398> 16268\n<e7a39a> 4876\n<e7a39b> 11247\n<e7a39d> 11241\n<e7a39e> 11245\nendcidchar\n\n100 begincidchar\n<e7a3a3> 11246\n<e7a3a4> 18874\n<e7a3a5> 11243\n<e7a3a7> 4878\n<e7a3a8> 4875\n<e7a3a9> 11242\n<e7a3aa> 11244\n<e7a3ac> 4877\n<e7a3ad> 11250\n<e7a3ae> 14977\n<e7a3af> 5154\n<e7a3b0> 15162\n<e7a3b1> 16574\n<e7a3b2> 11720\n<e7a3b3> 11714\n<e7a3b4> 5153\n<e7a3b5> 14515\n<e7a3b7> 5151\n<e7a3b9> 11722\n<e7a3ba> 5152\n<e7a3bd> 11715\n<e7a3be> 11723\n<e7a3bf> 11719\n<e7a481> 5155\n<e7a482> 11716\n<e7a484> 11724\n<e7a485> 11721\n<e7a486> 16335\n<e7a489> 12143\n<e7a48c> 12140\n<e7a48e> 5374\n<e7a490> 12144\n<e7a491> 12146\n<e7a492> 12145\n<e7a497> 12494\n<e7a499> 5535\n<e7a49b> 12491\n<e7a49c> 12493\n<e7a49d> 12490\n<e7a49e> 12495\n<e7a4a1> 12492\n<e7a4a3> 12804\n<e7a4a4> 12807\n<e7a4a5> 12803\n<e7a4a6> 5668\n<e7a4a9> 12808\n<e7a4aa> 5669\n<e7a4ab> 5671\n<e7a4ac> 5670\n<e7a4ad> 13030\n<e7a4ae> 17136\n<e7a4af> 13032\n<e7a4b1> 13031\n<e7a4b2> 18203\n<e7a4b3> 18202\n<e7a4b4> 17139\n<e7a4b5> 13207\n<e7a4b6> 14211\n<e7a4b8> 13456\n<e7a4b9> 13525\n<e7a4ba> 874\n<e7a4bb> 17655\n<e7a4bc> 17152\n<e7a4bd> 6359\n<e7a4be> 1631\n<e7a4bf> 6688\n<e7a582> 6687\n<e7a584> 7087\n<e7a585> 7086\n<e7a586> 1983\n<e7a587> 1986\n<e7a588> 1985\n<e7a589> 1984\n<e7a58a> 7083\n<e7a58b> 7085\n<e7a58c> 7084\n<e7a58f> 7542\n<e7a590> 2390\n<e7a591> 7546\n<e7a592> 7545\n<e7a593> 7544\n<e7a594> 7540\n<e7a595> 2389\n<e7a596> 2393\n<e7a597> 2396\n<e7a598> 14309\n<e7a599> 15128\n<e7a59a> 2397\n<e7a59b> 7541\n<e7a59c> 7543\n<e7a59d> 2395\n<e7a59e> 2394\n<e7a59f> 2392\n<e7a5a0> 2391\n<e7a5a1> 8132\n<e7a5a2> 15997\n<e7a5a3> 8130\n<e7a5a4> 8126\n<e7a5a5> 2882\n<e7a5a7> 8127\nendcidchar\n\n100 begincidchar\n<e7a5a8> 2883\n<e7a5ab> 8131\n<e7a5ad> 2884\n<e7a5b0> 8778\n<e7a5b1> 16744\n<e7a5b2> 8777\n<e7a5b3> 8776\n<e7a5b4> 8775\n<e7a5b9> 9439\n<e7a5ba> 3753\n<e7a5bc> 9436\n<e7a5bd> 9438\n<e7a5be> 15910\n<e7a5bf> 3754\n<e7a680> 17148\n<e7a681> 3755\n<e7a682> 9437\n<e7a683> 15862\n<e7a686> 17145\n<e7a687> 17800\n<e7a688> 10077\n<e7a68d> 4166\n<e7a690> 10079\n<e7a691> 18205\n<e7a692> 10078\n<e7a693> 10075\n<e7a694> 10074\n<e7a695> 10073\n<e7a696> 10072\n<e7a697> 10076\n<e7a698> 10069\n<e7a699> 17404\n<e7a69a> 10652\n<e7a69b> 10657\n<e7a69c> 10655\n<e7a69d> 17150\n<e7a69f> 14686\n<e7a6a0> 10654\n<e7a6a1> 10653\n<e7a6a2> 10656\n<e7a6a4> 11253\n<e7a6a5> 15134\n<e7a6a6> 4879\n<e7a6a7> 5156\n<e7a6a8> 11726\n<e7a6a9> 17153\n<e7a6aa> 5157\n<e7a6ab> 11725\n<e7a6ac> 12148\n<e7a6ad> 12147\n<e7a6ae> 5375\n<e7a6b0> 12496\n<e7a6b1> 5536\n<e7a6b2> 12809\n<e7a6b3> 5839\n<e7a6b4> 13208\n<e7a6b6> 13458\n<e7a6b7> 13457\n<e7a6b8> 6066\n<e7a6bb> 8133\n<e7a6bd> 3757\n<e7a6be> 875\n<e7a6bf> 1273\n<e7a780> 1272\n<e7a781> 1271\n<e7a784> 15565\n<e7a785> 6689\n<e7a786> 17157\n<e7a788> 1635\n<e7a789> 1634\n<e7a78a> 19025\n<e7a78b> 1991\n<e7a78c> 16947\n<e7a78d> 7089\n<e7a78e> 7092\n<e7a78f> 7090\n<e7a790> 19111\n<e7a794> 17159\n<e7a795> 7088\n<e7a796> 7091\n<e7a798> 2404\n<e7a79c> 7553\n<e7a79d> 7555\n<e7a79e> 7554\n<e7a79f> 2401\n<e7a7a0> 7549\n<e7a7a2> 15450\n<e7a7a3> 2399\n<e7a7a4> 2398\n<e7a7a6> 2402\n<e7a7a7> 2400\n<e7a7a9> 2403\n<e7a7aa> 7552\n<e7a7ad> 7551\n<e7a7ae> 7550\n<e7a7b1> 15143\n<e7a7b4> 15138\n<e7a7b8> 8135\n<e7a7ba> 8134\n<e7a7bb> 2885\nendcidchar\n\n100 begincidchar\n<e7a880> 3325\n<e7a882> 8779\n<e7a883> 8781\n<e7a884> 8783\n<e7a885> 3324\n<e7a886> 18206\n<e7a888> 3322\n<e7a88a> 8780\n<e7a88b> 3323\n<e7a88c> 8782\n<e7a88d> 3321\n<e7a890> 9449\n<e7a891> 9440\n<e7a892> 9443\n<e7a893> 9447\n<e7a894> 3761\n<e7a895> 9445\n<e7a897> 9444\n<e7a89a> 3759\n<e7a89b> 9448\n<e7a89c> 3758\n<e7a89e> 3763\n<e7a89f> 3762\n<e7a8a0> 3760\n<e7a8a2> 9446\n<e7a8a6> 10085\n<e7a8a8> 10084\n<e7a8aa> 18883\n<e7a8ab> 10080\n<e7a8ac> 19119\n<e7a8ad> 16346\n<e7a8ae> 4167\n<e7a8af> 10083\n<e7a8b0> 10082\n<e7a8b1> 4168\n<e7a8b2> 19112\n<e7a8b7> 4551\n<e7a8b9> 10659\n<e7a8ba> 15137\n<e7a8bb> 4552\n<e7a8bc> 4548\n<e7a8bd> 4550\n<e7a8be> 16267\n<e7a8bf> 4547\n<e7a980> 4549\n<e7a983> 14700\n<e7a984> 11254\n<e7a985> 15857\n<e7a986> 4882\n<e7a987> 11256\n<e7a988> 11255\n<e7a989> 14131\n<e7a98a> 10081\n<e7a98b> 4884\n<e7a98c> 4883\n<e7a994> 11731\n<e7a996> 11729\n<e7a997> 5158\n<e7a998> 11730\n<e7a99a> 11732\n<e7a99b> 11728\n<e7a99c> 11727\n<e7a99f> 12149\n<e7a9a0> 5378\n<e7a9a5> 14134\n<e7a9a9> 5538\n<e7a9ab> 5537\n<e7a9ae> 12810\n<e7a9b2> 19133\n<e7a9b4> 876\n<e7a9b5> 6161\n<e7a9b6> 1274\n<e7a9b8> 6690\n<e7a9b9> 1637\n<e7a9ba> 1636\n<e7a9bb> 6691\n<e7a9bd> 14135\n<e7a9be> 7094\n<e7a9bf> 1992\n<e7aa80> 7093\n<e7aa81> 1993\n<e7aa83> 15741\n<e7aa84> 2405\n<e7aa85> 7558\n<e7aa86> 7556\n<e7aa87> 7562\n<e7aa88> 2406\n<e7aa89> 7557\n<e7aa8a> 7561\n<e7aa8f> 8138\n<e7aa90> 8140\n<e7aa91> 17368\n<e7aa92> 2886\n<e7aa93> 18926\n<e7aa94> 8139\n<e7aa95> 2887\n<e7aa96> 3328\n<e7aa97> 3327\n<e7aa98> 3326\n<e7aa99> 8784\nendcidchar\n\n100 begincidchar\n<e7aa9e> 9452\n<e7aaa2> 9451\n<e7aaa3> 9450\n<e7aaa8> 10086\n<e7aaa9> 4170\n<e7aaaa> 4169\n<e7aaae> 4554\n<e7aaaf> 4553\n<e7aab0> 14138\n<e7aab1> 11260\n<e7aab2> 10660\n<e7aab3> 10662\n<e7aab4> 10661\n<e7aab5> 11259\n<e7aab6> 11257\n<e7aab7> 11261\n<e7aab8> 11258\n<e7aaba> 4885\n<e7aabb> 14137\n<e7aabc> 18209\n<e7aabe> 11733\n<e7aabf> 5159\n<e7ab87> 5672\n<e7ab88> 15743\n<e7ab89> 17776\n<e7ab8a> 5887\n<e7ab8b> 877\n<e7ab8f> 18212\n<e7ab91> 7095\n<e7ab93> 16266\n<e7ab98> 7563\n<e7ab99> 2407\n<e7ab9a> 14144\n<e7ab9b> 18213\n<e7ab9c> 14673\n<e7ab9d> 14145\n<e7ab9f> 3038\n<e7aba0> 3037\n<e7aba2> 15155\n<e7aba3> 3330\n<e7aba4> 8786\n<e7aba5> 3329\n<e7aba6> 8785\n<e7aba7> 14429\n<e7aba9> 14385\n<e7abaa> 14146\n<e7abab> 9453\n<e7abad> 4171\n<e7abae> 10089\n<e7abaf> 4172\n<e7abb6> 5673\n<e7abb7> 12813\n<e7abb9> 1014\n<e7abba> 1638\n<e7abbb> 6692\n<e7abbc> 19095\n<e7abbd> 1995\n<e7abbe> 15165\n<e7abbf> 1994\n<e7ac84> 7565\n<e7ac85> 7567\n<e7ac86> 2408\n<e7ac88> 7569\n<e7ac89> 7572\n<e7ac8a> 7570\n<e7ac8b> 14150\n<e7ac8c> 15203\n<e7ac8e> 7571\n<e7ac8f> 7568\n<e7ac90> 7564\n<e7ac91> 2409\n<e7ac92> 7573\n<e7ac93> 7566\n<e7ac94> 16247\n<e7ac98> 8149\n<e7ac99> 2893\n<e7ac9a> 8158\n<e7ac9b> 2890\n<e7ac9d> 8151\n<e7ac9e> 2894\n<e7ac9f> 16145\n<e7aca0> 2888\n<e7aca2> 8146\n<e7aca3> 8159\n<e7aca4> 8147\n<e7aca5> 8144\n<e7aca6> 2892\n<e7aca7> 15199\n<e7aca8> 2889\n<e7aca9> 14152\n<e7acaa> 8150\n<e7acab> 8153\n<e7acac> 2891\n<e7acad> 8154\n<e7acae> 2895\n<e7acaf> 8155\n<e7acb0> 8145\n<e7acb1> 8152\n<e7acb2> 8156\n<e7acb3> 8148\nendcidchar\n\n100 begincidchar\n<e7acb4> 8143\n<e7acb5> 8141\n<e7acb8> 8157\n<e7acb9> 15726\n<e7acbb> 8142\n<e7ad80> 8793\n<e7ad82> 15853\n<e7ad83> 15909\n<e7ad84> 8789\n<e7ad85> 8795\n<e7ad86> 3333\n<e7ad87> 8788\n<e7ad88> 8790\n<e7ad89> 3331\n<e7ad8a> 8787\n<e7ad8b> 3338\n<e7ad8c> 8791\n<e7ad8d> 3337\n<e7ad8e> 8792\n<e7ad8f> 3339\n<e7ad90> 3334\n<e7ad91> 3340\n<e7ad92> 3335\n<e7ad94> 3336\n<e7ad95> 14151\n<e7ad96> 3332\n<e7ad98> 8794\n<e7ada0> 3768\n<e7ada1> 9464\n<e7ada2> 18215\n<e7ada3> 9467\n<e7ada4> 9455\n<e7ada5> 9460\n<e7ada6> 9454\n<e7ada7> 3770\n<e7ada9> 9458\n<e7adac> 18216\n<e7adad> 9456\n<e7adae> 3769\n<e7adaf> 14156\n<e7adb0> 9463\n<e7adb1> 9462\n<e7adb2> 9459\n<e7adb3> 9461\n<e7adb4> 9457\n<e7adb5> 4176\n<e7adb6> 9466\n<e7adb7> 3766\n<e7adb8> 9465\n<e7adbb> 18217\n<e7ae82> 10105\n<e7ae84> 4183\n<e7ae85> 10100\n<e7ae87> 4182\n<e7ae88> 10090\n<e7ae8a> 10092\n<e7ae8b> 4175\n<e7ae8c> 10097\n<e7ae8d> 10096\n<e7ae8e> 10099\n<e7ae8f> 4180\n<e7ae90> 10094\n<e7ae91> 10093\n<e7ae92> 14162\n<e7ae94> 4179\n<e7ae95> 4174\n<e7ae96> 10095\n<e7ae97> 4177\n<e7ae98> 10101\n<e7ae99> 10103\n<e7ae9b> 10098\n<e7ae9c> 10091\n<e7ae9d> 4178\n<e7aea0> 4562\n<e7aea1> 4173\n<e7aea2> 14155\n<e7aea3> 16148\n<e7aea4> 10104\n<e7aeac> 10666\n<e7aead> 4555\n<e7aeae> 19140\n<e7aeaf> 10668\n<e7aeb1> 4556\n<e7aeb2> 17948\n<e7aeb4> 4558\n<e7aeb5> 10671\n<e7aeb7> 10663\n<e7aeb8> 4181\n<e7aeb9> 10669\n<e7aebe> 10665\n<e7af80> 3767\n<e7af81> 4561\n<e7af84> 4557\n<e7af85> 19117\n<e7af89> 4888\n<e7af8a> 10670\n<e7af8b> 10664\n<e7af8c> 4563\n<e7af8e> 10667\n<e7af8f> 16152\nendcidchar\n\n100 begincidchar\n<e7af90> 14160\n<e7af94> 11271\n<e7af95> 11266\n<e7af98> 11276\n<e7af99> 4886\n<e7af9a> 11268\n<e7af9b> 4890\n<e7af9c> 11274\n<e7af9d> 11265\n<e7af9e> 11262\n<e7af9f> 11277\n<e7afa0> 5165\n<e7afa1> 4891\n<e7afa2> 11273\n<e7afa3> 11263\n<e7afa4> 4889\n<e7afa5> 11267\n<e7afa6> 4893\n<e7afa7> 11264\n<e7afa8> 11269\n<e7afa9> 4892\n<e7afaa> 11272\n<e7afab> 11275\n<e7afac> 18927\n<e7afb2> 11738\n<e7afb3> 11745\n<e7afb4> 11743\n<e7afb7> 5163\n<e7afb8> 11750\n<e7afb9> 11270\n<e7afba> 14167\n<e7afbb> 11741\n<e7afbc> 16159\n<e7afbd> 11751\n<e7afbe> 5162\n<e7afbf> 11740\n<e7b080> 11739\n<e7b081> 11749\n<e7b082> 11746\n<e7b083> 11748\n<e7b085> 11736\n<e7b086> 11752\n<e7b087> 5160\n<e7b089> 11747\n<e7b08a> 11756\n<e7b08b> 11744\n<e7b08c> 5164\n<e7b08d> 5161\n<e7b08e> 11742\n<e7b08f> 11737\n<e7b090> 11755\n<e7b091> 4887\n<e7b092> 18218\n<e7b095> 16481\n<e7b099> 12152\n<e7b09b> 17369\n<e7b09c> 12150\n<e7b09d> 12156\n<e7b09e> 5384\n<e7b09f> 12154\n<e7b0a0> 12153\n<e7b0a1> 5386\n<e7b0a2> 12159\n<e7b0a3> 5385\n<e7b0a5> 12160\n<e7b0a6> 12157\n<e7b0a7> 5382\n<e7b0a8> 12158\n<e7b0a9> 12151\n<e7b0aa> 5383\n<e7b0ab> 5381\n<e7b0ac> 12502\n<e7b0ad> 12155\n<e7b0b0> 12161\n<e7b0b3> 12499\n<e7b0b5> 14169\n<e7b0b7> 5543\n<e7b0b8> 5541\n<e7b0b9> 12501\n<e7b0bb> 12503\n<e7b0bc> 12500\n<e7b0bd> 5542\n<e7b180> 5544\n<e7b182> 16156\n<e7b183> 5675\n<e7b184> 14171\n<e7b185> 12818\n<e7b187> 12817\n<e7b188> 12815\n<e7b189> 12814\n<e7b18a> 12816\n<e7b18c> 5674\n<e7b18d> 5676\n<e7b190> 5761\n<e7b191> 16312\n<e7b193> 13034\n<e7b194> 13033\n<e7b196> 16127\n<e7b197> 13211\n<e7b199> 13213\nendcidchar\n\n100 begincidchar\n<e7b19a> 13215\n<e7b19b> 13214\n<e7b19c> 13212\n<e7b19d> 15167\n<e7b19f> 5841\n<e7b1a0> 5840\n<e7b1a3> 5889\n<e7b1a4> 5888\n<e7b1a5> 5890\n<e7b1a6> 13355\n<e7b1a7> 13354\n<e7b1a9> 13526\n<e7b1aa> 13459\n<e7b1ab> 13527\n<e7b1ac> 5957\n<e7b1ad> 15168\n<e7b1ae> 5958\n<e7b1af> 13575\n<e7b1b0> 16210\n<e7b1b2> 5995\n<e7b1b3> 1015\n<e7b1b4> 18076\n<e7b1b5> 6693\n<e7b1ba> 7098\n<e7b1bb> 18221\n<e7b1bc> 15177\n<e7b1bd> 1996\n<e7b1be> 16154\n<e7b1bf> 7101\n<e7b283> 14172\n<e7b284> 7574\n<e7b285> 7580\n<e7b286> 16157\n<e7b288> 7578\n<e7b289> 2410\n<e7b28a> 7576\n<e7b28c> 7577\n<e7b28d> 7579\n<e7b28e> 15176\n<e7b291> 7575\n<e7b292> 2896\n<e7b294> 8160\n<e7b295> 2898\n<e7b296> 8162\n<e7b297> 2897\n<e7b298> 8161\n<e7b29c> 18222\n<e7b29e> 8797\n<e7b29f> 3341\n<e7b2a1> 8799\n<e7b2a2> 8796\n<e7b2a3> 8163\n<e7b2a5> 3342\n<e7b2a6> 14174\n<e7b2a7> 14061\n<e7b2a8> 8798\n<e7b2ac> 14469\n<e7b2ae> 15178\n<e7b2af> 9470\n<e7b2b1> 3771\n<e7b2b2> 9468\n<e7b2b3> 3772\n<e7b2b4> 9469\n<e7b2b5> 3773\n<e7b2b8> 18224\n<e7b2b9> 4184\n<e7b2ba> 10109\n<e7b2bb> 10106\n<e7b2bc> 10108\n<e7b2bf> 10107\n<e7b382> 16343\n<e7b383> 18928\n<e7b385> 10672\n<e7b387> 14177\n<e7b388> 10673\n<e7b389> 14176\n<e7b38a> 4564\n<e7b38b> 10675\n<e7b38c> 10674\n<e7b38d> 15173\n<e7b38e> 289\n<e7b392> 11278\n<e7b393> 15708\n<e7b394> 11279\n<e7b397> 11280\n<e7b399> 5171\n<e7b39a> 16345\n<e7b39c> 5167\n<e7b39d> 5172\n<e7b39e> 5168\n<e7b39f> 5170\n<e7b3a0> 5166\n<e7b3a2> 5169\n<e7b3a6> 14178\n<e7b3a7> 5387\n<e7b3a8> 11757\n<e7b3aa> 12505\n<e7b3ac> 12504\n<e7b3ad> 17370\n<e7b3ae> 12819\nendcidchar\n\n100 begincidchar\n<e7b3b1> 13217\n<e7b3b2> 13035\n<e7b3b3> 14180\n<e7b3b4> 13216\n<e7b3b5> 14181\n<e7b3b6> 13528\n<e7b3b7> 13597\n<e7b3b8> 1016\n<e7b3b9> 17656\n<e7b3bb> 1275\n<e7b3bc> 17773\n<e7b3bd> 6694\n<e7b3be> 1639\n<e7b480> 1999\n<e7b481> 7106\n<e7b482> 1997\n<e7b483> 7104\n<e7b484> 2002\n<e7b485> 1998\n<e7b486> 2003\n<e7b487> 2001\n<e7b488> 7105\n<e7b489> 2000\n<e7b48a> 2414\n<e7b48b> 2413\n<e7b48c> 7591\n<e7b48d> 2422\n<e7b48e> 7584\n<e7b48f> 7590\n<e7b490> 2418\n<e7b491> 7583\n<e7b492> 7589\n<e7b493> 7587\n<e7b494> 2417\n<e7b495> 2419\n<e7b496> 7586\n<e7b497> 2412\n<e7b498> 7585\n<e7b499> 2423\n<e7b49a> 2420\n<e7b49b> 2424\n<e7b49c> 2421\n<e7b49d> 7582\n<e7b49e> 7581\n<e7b49f> 7588\n<e7b4a0> 2415\n<e7b4a1> 2411\n<e7b4a2> 2416\n<e7b4a5> 16094\n<e7b4a8> 8178\n<e7b4a9> 8171\n<e7b4ab> 3347\n<e7b4ac> 8170\n<e7b4ae> 2902\n<e7b4af> 2909\n<e7b4b0> 2906\n<e7b4b1> 2912\n<e7b4b2> 2911\n<e7b4b3> 2907\n<e7b4b5> 8164\n<e7b4b6> 8167\n<e7b4b8> 8166\n<e7b4b9> 2903\n<e7b4ba> 8168\n<e7b4bb> 8177\n<e7b4bc> 2904\n<e7b4bd> 8165\n<e7b580> 2905\n<e7b581> 8172\n<e7b582> 2910\n<e7b583> 2900\n<e7b584> 2908\n<e7b585> 8169\n<e7b586> 2899\n<e7b587> 8173\n<e7b58a> 8176\n<e7b58d> 16349\n<e7b58e> 8816\n<e7b58f> 8807\n<e7b590> 3344\n<e7b591> 8814\n<e7b592> 8811\n<e7b593> 8803\n<e7b594> 8812\n<e7b595> 3346\n<e7b596> 8804\n<e7b598> 8800\n<e7b59a> 16019\n<e7b59b> 3779\n<e7b59c> 8809\n<e7b59d> 14185\n<e7b59e> 3343\n<e7b59f> 8815\n<e7b5a1> 3350\n<e7b5a2> 3352\n<e7b5a3> 8802\n<e7b5a6> 3351\n<e7b5a7> 8805\n<e7b5a8> 3345\n<e7b5a9> 8813\nendcidchar\n\n100 begincidchar\n<e7b5aa> 8806\n<e7b5ab> 8810\n<e7b5ad> 8808\n<e7b5ae> 3348\n<e7b5af> 8801\n<e7b5b0> 3353\n<e7b5b1> 2901\n<e7b5b2> 3349\n<e7b5b3> 3354\n<e7b5b9> 3775\n<e7b5ba> 9477\n<e7b5bb> 9479\n<e7b5bc> 9481\n<e7b5bd> 9485\n<e7b5bf> 9475\n<e7b680> 9473\n<e7b681> 3777\n<e7b683> 9480\n<e7b684> 9484\n<e7b685> 9476\n<e7b686> 9472\n<e7b688> 9471\n<e7b689> 14187\n<e7b68b> 18902\n<e7b68c> 9482\n<e7b68d> 9474\n<e7b68e> 9478\n<e7b68f> 3778\n<e7b691> 3776\n<e7b692> 9486\n<e7b693> 3774\n<e7b694> 9483\n<e7b695> 19003\n<e7b696> 10126\n<e7b697> 15187\n<e7b69c> 4189\n<e7b69d> 10118\n<e7b69e> 4577\n<e7b69f> 10128\n<e7b6a0> 4192\n<e7b6a1> 10132\n<e7b6a2> 4198\n<e7b6a3> 10113\n<e7b6a4> 18135\n<e7b6a6> 10129\n<e7b6a7> 10110\n<e7b6a8> 15516\n<e7b6a9> 10131\n<e7b6aa> 10114\n<e7b6ab> 14188\n<e7b6ac> 4205\n<e7b6ad> 4202\n<e7b6ae> 10130\n<e7b6af> 10124\n<e7b6b0> 4188\n<e7b6b1> 4196\n<e7b6b2> 4195\n<e7b6b3> 14190\n<e7b6b4> 4194\n<e7b6b5> 4200\n<e7b6b7> 10111\n<e7b6b8> 4201\n<e7b6b9> 10125\n<e7b6ba> 4197\n<e7b6bb> 4187\n<e7b6bc> 10127\n<e7b6bf> 4199\n<e7b780> 10116\n<e7b781> 10115\n<e7b782> 10112\n<e7b784> 10120\n<e7b785> 10117\n<e7b786> 10121\n<e7b787> 4204\n<e7b789> 10133\n<e7b78a> 4193\n<e7b78d> 17774\n<e7b78e> 10119\n<e7b78f> 18229\n<e7b790> 18231\n<e7b792> 4203\n<e7b793> 15182\n<e7b794> 18230\n<e7b796> 14191\n<e7b797> 10680\n<e7b798> 4569\n<e7b799> 4578\n<e7b79a> 4574\n<e7b79b> 10677\n<e7b79c> 15180\n<e7b79d> 4571\n<e7b79e> 4575\n<e7b79f> 10689\n<e7b7a0> 4565\n<e7b7a1> 10681\n<e7b7a3> 4573\n<e7b7a4> 14194\n<e7b7a5> 14198\n<e7b7a6> 10684\n<e7b7a7> 10679\nendcidchar\n\n100 begincidchar\n<e7b7a8> 4572\n<e7b7a9> 4576\n<e7b7aa> 10678\n<e7b7ac> 4570\n<e7b7ae> 10688\n<e7b7af> 4567\n<e7b7b0> 10687\n<e7b7b1> 10686\n<e7b7b2> 4579\n<e7b7b3> 10440\n<e7b7b4> 4566\n<e7b7b5> 14196\n<e7b7b6> 10685\n<e7b7b7> 10676\n<e7b7b9> 4580\n<e7b7ba> 10683\n<e7b7bb> 4568\n<e7b7bd> 18232\n<e7b7be> 15567\n<e7b883> 10682\n<e7b887> 15181\n<e7b888> 4898\n<e7b889> 4903\n<e7b88a> 4896\n<e7b88b> 11295\n<e7b88c> 11286\n<e7b88d> 11298\n<e7b88e> 11290\n<e7b88f> 11296\n<e7b890> 4904\n<e7b891> 4897\n<e7b892> 11283\n<e7b893> 11289\n<e7b894> 11299\n<e7b895> 11292\n<e7b896> 11297\n<e7b897> 11285\n<e7b89a> 11293\n<e7b89b> 4899\n<e7b89c> 11291\n<e7b89d> 4902\n<e7b89e> 4901\n<e7b8a1> 11284\n<e7b8a2> 11294\n<e7b8a3> 4900\n<e7b8a4> 11301\n<e7b8a5> 11300\n<e7b8a7> 14207\n<e7b8a9> 11768\n<e7b8aa> 11764\n<e7b8ab> 5179\n<e7b8ad> 11758\n<e7b8ae> 5173\n<e7b8af> 5189\n<e7b8b0> 11770\n<e7b8b1> 5181\n<e7b8b2> 5177\n<e7b8b3> 11761\n<e7b8b4> 5184\n<e7b8b5> 5187\n<e7b8b6> 11772\n<e7b8b7> 5176\n<e7b8b8> 11763\n<e7b8b9> 5185\n<e7b8ba> 11774\n<e7b8bb> 11771\n<e7b8bc> 11759\n<e7b8bd> 5180\n<e7b8be> 5174\n<e7b8bf> 5188\n<e7b980> 11766\n<e7b981> 5183\n<e7b982> 11760\n<e7b983> 5178\n<e7b984> 11773\n<e7b985> 5182\n<e7b986> 5175\n<e7b987> 11767\n<e7b988> 5186\n<e7b989> 11765\n<e7b98c> 11769\n<e7b990> 12163\n<e7b991> 12169\n<e7b992> 5393\n<e7b993> 12172\n<e7b996> 12164\n<e7b997> 12171\n<e7b998> 12166\n<e7b999> 5394\n<e7b99a> 5391\n<e7b99b> 18964\n<e7b99c> 12162\n<e7b99e> 5390\n<e7b99f> 12168\n<e7b9a0> 12170\n<e7b9a1> 5392\n<e7b9a2> 12167\n<e7b9a3> 12165\n<e7b9a5> 18130\n<e7b9a7> 14182\nendcidchar\n\n100 begincidchar\n<e7b9a8> 12515\n<e7b9ab> 5545\n<e7b9ac> 18929\n<e7b9ad> 5546\n<e7b9ae> 14203\n<e7b9af> 12511\n<e7b9b0> 12509\n<e7b9b2> 12513\n<e7b9b3> 5550\n<e7b9b4> 12514\n<e7b9b5> 12507\n<e7b9b6> 12506\n<e7b9b7> 12510\n<e7b9b8> 12508\n<e7b9b9> 5547\n<e7b9ba> 12512\n<e7b9bb> 12820\n<e7b9bc> 5681\n<e7b9bd> 5680\n<e7b9be> 12821\n<e7b9bf> 15953\n<e7ba80> 12823\n<e7ba81> 12822\n<e7ba82> 5682\n<e7ba86> 13040\n<e7ba8a> 13036\n<e7ba8b> 13039\n<e7ba8c> 5763\n<e7ba8d> 13041\n<e7ba8e> 16073\n<e7ba8f> 5762\n<e7ba91> 13218\n<e7ba92> 18078\n<e7ba93> 5891\n<e7ba94> 5893\n<e7ba95> 13356\n<e7ba96> 5892\n<e7ba97> 13460\n<e7ba98> 13530\n<e7ba99> 13532\n<e7ba9a> 13529\n<e7ba9b> 13531\n<e7ba9c> 5977\n<e7ba9f> 18619\n<e7baa4> 17755\n<e7baac> 17756\n<e7baba> 17757\n<e7bb87> 17758\n<e7bb8f> 17759\n<e7bb9f> 17760\n<e7bc86> 17761\n<e7bcb6> 1017\n<e7bcb7> 17762\n<e7bcb8> 2004\n<e7bcb9> 7455\n<e7bcba> 2425\n<e7bcbd> 2913\n<e7bd83> 11302\n<e7bd84> 5190\n<e7bd85> 11775\n<e7bd87> 14210\n<e7bd88> 5395\n<e7bd89> 15977\n<e7bd8a> 12517\n<e7bd8b> 12516\n<e7bd8c> 5683\n<e7bd8d> 13042\n<e7bd8e> 15183\n<e7bd8f> 13219\n<e7bd90> 5926\n<e7bd91> 6162\n<e7bd92> 17654\n<e7bd93> 17657\n<e7bd94> 1640\n<e7bd95> 1276\n<e7bd98> 7107\n<e7bd9b> 7597\n<e7bd9c> 7592\n<e7bd9d> 7596\n<e7bd9e> 7594\n<e7bd9f> 2426\n<e7bda0> 7595\n<e7bda1> 7593\n<e7bda3> 8179\n<e7bdab> 9488\n<e7bdac> 9491\n<e7bdad> 9487\n<e7bdae> 3780\n<e7bdb0> 4206\n<e7bdb1> 16391\n<e7bdb2> 3783\n<e7bdb3> 10134\n<e7bdb5> 4581\n<e7bdb6> 10690\n<e7bdb7> 4582\n<e7bdb8> 16251\n<e7bdb9> 4905\n<e7bdba> 11305\n<e7bdbd> 11778\n<e7bdbe> 11777\nendcidchar\n\n100 begincidchar\n<e7bdbf> 11776\n<e7be83> 12518\n<e7be85> 5551\n<e7be86> 12519\n<e7be87> 13220\n<e7be88> 5927\n<e7be89> 13461\n<e7be8a> 1018\n<e7be8b> 1642\n<e7be8c> 1641\n<e7be8d> 7109\n<e7be8e> 2005\n<e7be8f> 16924\n<e7be91> 7108\n<e7be92> 7599\n<e7be93> 17371\n<e7be94> 2427\n<e7be95> 8180\n<e7be96> 7598\n<e7be97> 14214\n<e7be9a> 2915\n<e7be9b> 8183\n<e7be9e> 2914\n<e7bea2> 8821\n<e7bea3> 14216\n<e7bea4> 3786\n<e7bea5> 9493\n<e7bea6> 9492\n<e7bea7> 9494\n<e7bea8> 3785\n<e7bea9> 3784\n<e7beac> 10691\n<e7bead> 10693\n<e7beae> 17372\n<e7beaf> 4583\n<e7beb0> 10692\n<e7beb1> 11306\n<e7beb2> 4906\n<e7beb3> 12174\n<e7beb4> 18233\n<e7beb5> 12173\n<e7beb6> 5552\n<e7beb7> 12520\n<e7beb8> 5554\n<e7beb9> 5553\n<e7beba> 12824\n<e7bebb> 13043\n<e7bebc> 5764\n<e7bebd> 1019\n<e7bebe> 7110\n<e7bebf> 2006\n<e7bf80> 7602\n<e7bf81> 2429\n<e7bf82> 7601\n<e7bf83> 7600\n<e7bf85> 2428\n<e7bf87> 8189\n<e7bf89> 8191\n<e7bf8c> 2916\n<e7bf8d> 8186\n<e7bf8e> 2917\n<e7bf8f> 8190\n<e7bf92> 2918\n<e7bf97> 8824\n<e7bf9d> 15198\n<e7bf9e> 10138\n<e7bf9f> 4209\n<e7bfa5> 10137\n<e7bfa6> 10698\n<e7bfa7> 18153\n<e7bfa8> 10699\n<e7bfa9> 4584\n<e7bfaa> 10696\n<e7bfab> 10695\n<e7bfac> 10697\n<e7bfad> 10694\n<e7bfae> 4909\n<e7bfaf> 11307\n<e7bfb2> 11780\n<e7bfb3> 5191\n<e7bfb4> 11779\n<e7bfb5> 12031\n<e7bfb9> 5396\n<e7bfba> 14222\n<e7bfbb> 5397\n<e7bfbc> 5192\n<e7bfbf> 12825\n<e88080> 5684\n<e88081> 1020\n<e88082> 17661\n<e88083> 1021\n<e88084> 2431\n<e88085> 1643\n<e88086> 2430\n<e88087> 7111\n<e88088> 14225\n<e8808b> 3358\n<e8808c> 1022\n<e8808d> 2008\n<e88090> 2007\nendcidchar\n\n100 begincidchar\n<e88091> 2009\n<e88092> 1023\n<e88094> 7114\n<e88095> 2433\n<e88096> 7603\n<e88097> 2435\n<e88098> 2432\n<e88099> 2434\n<e8809b> 8194\n<e8809c> 2919\n<e8809d> 14226\n<e8809e> 8193\n<e8809f> 8192\n<e880a0> 18236\n<e880a1> 9497\n<e880a4> 10139\n<e880a5> 18237\n<e880a6> 4585\n<e880a8> 4910\n<e880a9> 11309\n<e880aa> 11308\n<e880ac> 11781\n<e880ae> 18238\n<e880af> 14228\n<e880b0> 13044\n<e880b1> 18239\n<e880b3> 1024\n<e880b4> 6360\n<e880b5> 6695\n<e880b6> 2010\n<e880b7> 7115\n<e880b9> 7605\n<e880bd> 2436\n<e880be> 7604\n<e880bf> 2437\n<e88183> 8196\n<e88186> 2921\n<e88187> 8195\n<e88188> 8197\n<e8818a> 2920\n<e88191> 8825\n<e88192> 3359\n<e88194> 18240\n<e88196> 3787\n<e88198> 3788\n<e8819a> 4211\n<e8819b> 16357\n<e8819c> 10141\n<e8819d> 10140\n<e8819e> 4210\n<e881a1> 14233\n<e881a2> 16355\n<e881a3> 16348\n<e881a4> 10700\n<e881a6> 16347\n<e881a7> 10701\n<e881ac> 11310\n<e881af> 5196\n<e881b0> 5195\n<e881b3> 5197\n<e881b5> 12177\n<e881b6> 5399\n<e881b7> 5398\n<e881b8> 12523\n<e881b9> 12826\n<e881bd> 5843\n<e881be> 5842\n<e881bf> 1025\n<e88280> 17662\n<e88282> 7404\n<e88284> 3790\n<e88285> 3360\n<e88286> 3789\n<e88287> 4212\n<e88289> 1026\n<e8828a> 6067\n<e8828f> 6696\n<e88290> 6363\n<e88292> 6364\n<e88293> 1278\n<e88295> 6361\n<e88296> 1277\n<e88298> 1280\n<e88299> 6362\n<e8829a> 1282\n<e8829b> 1281\n<e8829c> 6365\n<e8829d> 1279\n<e8829f> 17782\n<e882a1> 1648\n<e882a2> 1646\n<e882a3> 6698\n<e882a5> 1645\n<e882a7> 14240\n<e882a9> 1650\n<e882aa> 1652\n<e882ab> 1649\n<e882ad> 6701\n<e882ae> 6697\n<e882af> 1653\nendcidchar\n\n100 begincidchar\n<e882b1> 1647\n<e882b2> 1283\n<e882b4> 1651\n<e882b5> 6700\n<e882b6> 16046\n<e882b7> 18243\n<e882b8> 6699\n<e882ba> 1644\n<e882bc> 17778\n<e882bd> 15995\n<e88382> 7121\n<e88385> 7123\n<e88386> 15220\n<e88387> 7117\n<e88388> 7120\n<e88389> 7129\n<e8838a> 7127\n<e8838c> 2016\n<e8838d> 7133\n<e8838e> 2019\n<e8838f> 7130\n<e88390> 7122\n<e88391> 7119\n<e88394> 8829\n<e88395> 7128\n<e88396> 2011\n<e88397> 7131\n<e88398> 7116\n<e88399> 7125\n<e8839a> 2013\n<e8839b> 2018\n<e8839c> 7126\n<e8839d> 2022\n<e8839e> 2020\n<e883a0> 7118\n<e883a1> 2017\n<e883a3> 7124\n<e883a4> 2021\n<e883a5> 2012\n<e883a6> 7132\n<e883a9> 18244\n<e883ac> 17897\n<e883ad> 2442\n<e883af> 2451\n<e883b0> 2440\n<e883b1> 2438\n<e883b2> 7607\n<e883b3> 2446\n<e883b4> 2443\n<e883b5> 7609\n<e883b6> 17780\n<e883b8> 2445\n<e883b9> 7608\n<e883ba> 7606\n<e883bb> 7611\n<e883bc> 2450\n<e883bd> 2448\n<e883be> 8828\n<e88480> 7612\n<e88481> 7610\n<e88482> 2439\n<e88483> 16359\n<e88485> 2441\n<e88486> 2444\n<e88487> 14242\n<e88488> 2447\n<e88489> 15221\n<e8848a> 2449\n<e8848c> 18246\n<e8848e> 18247\n<e88492> 18248\n<e88494> 18249\n<e88495> 8207\n<e88496> 2923\n<e88497> 15981\n<e88498> 8198\n<e88499> 8200\n<e8849a> 14243\n<e8849b> 8201\n<e8849d> 8209\n<e8849e> 8205\n<e8849f> 8203\n<e884a1> 8206\n<e884a2> 8210\n<e884a3> 2924\n<e884a4> 2928\n<e884a5> 8199\n<e884a7> 8208\n<e884a9> 2926\n<e884aa> 14905\n<e884ab> 2925\n<e884ac> 8204\n<e884ad> 8202\n<e884af> 2922\n<e884b0> 2927\n<e884b2> 15993\n<e884b4> 17900\n<e884b7> 15218\n<e884b9> 3366\n<e884ba> 8837\nendcidchar\n\n100 begincidchar\n<e884bd> 8835\n<e884be> 3368\n<e88582> 15222\n<e88583> 8830\n<e88584> 9511\n<e88586> 3367\n<e88587> 8834\n<e88588> 15990\n<e8858a> 8831\n<e8858b> 3363\n<e8858c> 3369\n<e8858d> 8836\n<e8858e> 3365\n<e8858f> 8833\n<e88590> 4213\n<e88591> 3364\n<e88592> 8832\n<e88593> 3370\n<e88594> 3362\n<e88595> 3361\n<e88596> 18252\n<e8859b> 9503\n<e8859c> 9501\n<e8859e> 9507\n<e885a0> 9499\n<e885a1> 9512\n<e885a2> 9504\n<e885a4> 9498\n<e885a5> 3794\n<e885a6> 3800\n<e885a7> 9509\n<e885a9> 9502\n<e885ab> 3797\n<e885ac> 19053\n<e885ad> 17348\n<e885ae> 3795\n<e885af> 9510\n<e885b0> 3792\n<e885b1> 3791\n<e885b2> 9505\n<e885b3> 3796\n<e885b4> 3371\n<e885b6> 9508\n<e885b7> 9500\n<e885b8> 3793\n<e885bc> 18256\n<e885bf> 4218\n<e88680> 4214\n<e88682> 4219\n<e88683> 10144\n<e88684> 17349\n<e88686> 10143\n<e88687> 10145\n<e88688> 4216\n<e88689> 10142\n<e8868a> 4217\n<e8868b> 10148\n<e8868c> 10147\n<e8868d> 10146\n<e8868f> 4215\n<e88693> 17350\n<e88695> 10705\n<e88697> 10708\n<e88698> 4591\n<e88699> 10707\n<e8869a> 4590\n<e8869e> 10704\n<e8869f> 10703\n<e886a0> 4589\n<e886a2> 10706\n<e886a3> 10702\n<e886a5> 18259\n<e886a6> 11312\n<e886a7> 11322\n<e886a8> 4913\n<e886a9> 4912\n<e886aa> 17252\n<e886ab> 11316\n<e886ac> 11318\n<e886ae> 11313\n<e886b0> 11317\n<e886b1> 11311\n<e886b2> 11320\n<e886b3> 4911\n<e886b4> 11319\n<e886b5> 11315\n<e886b6> 16050\n<e886b7> 11321\n<e886b9> 11314\n<e886ba> 5200\n<e886bb> 11782\n<e886bc> 11788\n<e886bd> 5204\n<e886be> 5206\n<e886bf> 5203\n<e88780> 5202\n<e88781> 18261\n<e88782> 5201\n<e88783> 5199\n<e88784> 11783\nendcidchar\n\n100 begincidchar\n<e88785> 11786\n<e88786> 5198\n<e88787> 11787\n<e88788> 16366\n<e88789> 5205\n<e8878a> 11785\n<e8878c> 11784\n<e8878d> 5400\n<e8878f> 5401\n<e88790> 12180\n<e88795> 12525\n<e88797> 12524\n<e88798> 5555\n<e88799> 12828\n<e8879a> 5685\n<e8879b> 12827\n<e8879d> 13045\n<e8879e> 13221\n<e8879f> 5844\n<e887a2> 5894\n<e887a3> 1029\n<e887a4> 18262\n<e887a5> 1654\n<e887a6> 8838\n<e887a7> 4220\n<e887a8> 5207\n<e887a9> 11789\n<e887aa> 1030\n<e887ac> 2453\n<e887ad> 2452\n<e887ae> 8839\n<e887af> 17105\n<e887b2> 11323\n<e887b3> 1031\n<e887b4> 2023\n<e887b6> 15713\n<e887ba> 4221\n<e887bb> 4914\n<e887bc> 1032\n<e887be> 1655\n<e887bf> 7134\n<e88880> 2454\n<e88881> 7613\n<e88882> 2929\n<e88884> 8843\n<e88885> 3801\n<e88887> 4222\n<e88888> 4915\n<e88889> 5208\n<e8888a> 5402\n<e8888b> 12526\n<e8888c> 1033\n<e8888d> 1656\n<e88890> 2455\n<e88891> 8211\n<e88892> 3372\n<e88894> 4223\n<e88895> 10149\n<e88896> 10709\n<e88898> 14250\n<e8889a> 16353\n<e8889b> 1034\n<e8889c> 3373\n<e8889d> 9513\n<e8889e> 4224\n<e8889f> 1035\n<e888a0> 6702\n<e888a1> 7135\n<e888a2> 2024\n<e888a5> 7615\n<e888a6> 16909\n<e888a8> 2458\n<e888a9> 14256\n<e888ac> 2459\n<e888ad> 16080\n<e888af> 7614\n<e888b2> 8216\n<e888b3> 8213\n<e888b4> 8215\n<e888b5> 2930\n<e888b6> 2932\n<e888b7> 2931\n<e888b8> 8212\n<e888b9> 2933\n<e888ba> 8214\n<e888be> 17794\n<e888bf> 8846\n<e88980> 9516\n<e88982> 9517\n<e88984> 9515\n<e88985> 9518\n<e88987> 3802\n<e88989> 9514\n<e8898b> 4225\n<e8898e> 10714\n<e8898f> 10710\n<e88990> 10713\n<e88991> 10715\n<e88992> 10712\n<e88993> 10711\nendcidchar\n\n100 begincidchar\n<e88994> 18263\n<e8899a> 11791\n<e8899b> 11790\n<e8899c> 11792\n<e8899e> 12182\n<e8899f> 12181\n<e889a1> 12528\n<e889a2> 15226\n<e889a3> 12529\n<e889a4> 12527\n<e889a5> 15227\n<e889a6> 5686\n<e889ab> 13222\n<e889ac> 13357\n<e889ad> 13462\n<e889ae> 1036\n<e889af> 1284\n<e889b1> 5209\n<e889b2> 1037\n<e889b4> 8217\n<e889b5> 8847\n<e889b6> 18265\n<e889b7> 5934\n<e889b8> 6163\n<e889b9> 18210\n<e889ba> 17763\n<e889bb> 14280\n<e889bc> 6164\n<e889bd> 6166\n<e889be> 1038\n<e889bf> 6167\n<e88a80> 6165\n<e88a85> 6368\n<e88a87> 16690\n<e88a8a> 6372\n<e88a8b> 1286\n<e88a8d> 1287\n<e88a8e> 6369\n<e88a8f> 6367\n<e88a90> 6366\n<e88a91> 6370\n<e88a92> 1285\n<e88a93> 6371\n<e88a94> 7136\n<e88a98> 6707\n<e88a99> 1659\n<e88a9a> 6706\n<e88a9b> 6708\n<e88a9d> 1658\n<e88a9e> 6713\n<e88a9f> 1662\n<e88aa0> 6703\n<e88aa1> 6717\n<e88aa2> 6723\n<e88aa3> 1669\n<e88aa4> 6720\n<e88aa5> 1666\n<e88aa6> 15731\n<e88aa7> 6710\n<e88aa8> 6716\n<e88aa9> 6718\n<e88aaa> 14268\n<e88aab> 6705\n<e88aac> 1665\n<e88aad> 1660\n<e88aae> 6711\n<e88aaf> 1667\n<e88ab0> 1670\n<e88ab1> 1664\n<e88ab3> 1657\n<e88ab4> 6715\n<e88ab5> 6709\n<e88ab6> 6722\n<e88ab7> 1672\n<e88ab8> 1668\n<e88ab9> 1663\n<e88aba> 6714\n<e88abb> 2460\n<e88abc> 6712\n<e88abd> 1661\n<e88abe> 1671\n<e88abf> 18953\n<e88b80> 6704\n<e88b82> 6719\n<e88b83> 6721\n<e88b84> 17891\n<e88b8a> 18266\n<e88b8f> 17764\n<e88b90> 14273\n<e88b91> 2041\n<e88b92> 2035\n<e88b93> 2043\n<e88b94> 2040\n<e88b95> 7143\n<e88b96> 7146\n<e88b97> 2036\n<e88b98> 18267\n<e88b99> 7137\n<e88b9b> 2029\n<e88b9c> 2039\nendcidchar\n\n100 begincidchar\n<e88b9e> 2042\n<e88b9f> 2044\n<e88ba0> 7158\n<e88ba1> 7149\n<e88ba2> 14281\n<e88ba3> 2028\n<e88ba4> 7157\n<e88ba5> 2032\n<e88ba6> 2030\n<e88ba7> 2025\n<e88ba8> 7141\n<e88baa> 7156\n<e88bab> 7145\n<e88bac> 7148\n<e88bad> 7161\n<e88bae> 16408\n<e88baf> 2045\n<e88bb0> 7155\n<e88bb1> 2037\n<e88bb2> 7150\n<e88bb3> 7160\n<e88bb4> 7147\n<e88bb5> 7151\n<e88bb6> 7154\n<e88bb7> 15991\n<e88bb8> 18930\n<e88bb9> 7139\n<e88bba> 7159\n<e88bbb> 7153\n<e88bbc> 16685\n<e88bbd> 15762\n<e88bbe> 7138\n<e88bbf> 17374\n<e88c80> 7142\n<e88c81> 2038\n<e88c82> 2033\n<e88c83> 2026\n<e88c84> 2031\n<e88c85> 2027\n<e88c86> 2046\n<e88c87> 7140\n<e88c88> 7632\n<e88c89> 2034\n<e88c8b> 16054\n<e88c8c> 7152\n<e88c8d> 6781\n<e88c96> 7635\n<e88c97> 2474\n<e88c98> 14282\n<e88c99> 7619\n<e88c9a> 14274\n<e88c9b> 7630\n<e88c9c> 7626\n<e88c9d> 14289\n<e88c9e> 7645\n<e88ca0> 7637\n<e88ca2> 7627\n<e88ca4> 7636\n<e88ca5> 7621\n<e88ca6> 7625\n<e88ca7> 7648\n<e88ca8> 2477\n<e88ca9> 7640\n<e88caa> 7631\n<e88cab> 2461\n<e88cac> 7646\n<e88cad> 7617\n<e88caf> 7639\n<e88cb1> 2476\n<e88cb2> 2471\n<e88cb3> 7616\n<e88cb4> 2469\n<e88cb5> 2468\n<e88cb6> 2473\n<e88cb7> 7638\n<e88cb8> 2465\n<e88cb9> 2472\n<e88cba> 7144\n<e88cbb> 8848\n<e88cbc> 7633\n<e88cbd> 15658\n<e88cbf> 7623\n<e88d80> 2475\n<e88d81> 7624\n<e88d82> 7628\n<e88d83> 2478\n<e88d84> 7618\n<e88d85> 7642\n<e88d87> 7641\n<e88d88> 7649\n<e88d89> 2467\n<e88d8a> 2464\n<e88d8b> 7647\n<e88d8c> 7643\n<e88d8d> 7634\n<e88d8e> 7629\n<e88d8f> 2470\n<e88d90> 2466\n<e88d91> 7620\n<e88d92> 2462\nendcidchar\n\n100 begincidchar\n<e88d93> 7644\n<e88d94> 2463\n<e88d96> 7622\n<e88d97> 18269\n<e88da2> 14262\n<e88da3> 16875\n<e88da6> 15902\n<e88daf> 17765\n<e88db3> 8223\n<e88db4> 8225\n<e88db5> 8230\n<e88db6> 8250\n<e88db7> 2947\n<e88db8> 2937\n<e88dba> 8222\n<e88dbd> 8233\n<e88dbe> 8240\n<e88dbf> 8246\n<e88e81> 8227\n<e88e83> 8234\n<e88e85> 14291\n<e88e86> 2950\n<e88e87> 8248\n<e88e88> 8243\n<e88e89> 2945\n<e88e8a> 2943\n<e88e8b> 8239\n<e88e8c> 8235\n<e88e8d> 8221\n<e88e8e> 2934\n<e88e8f> 8226\n<e88e90> 8218\n<e88e91> 14316\n<e88e92> 2942\n<e88e93> 2944\n<e88e94> 8231\n<e88e95> 8228\n<e88e96> 2939\n<e88e97> 8244\n<e88e98> 2936\n<e88e99> 8229\n<e88e9a> 8889\n<e88e9b> 8237\n<e88e9c> 14157\n<e88e9d> 8236\n<e88e9e> 2935\n<e88ea0> 2946\n<e88ea2> 2938\n<e88ea3> 8219\n<e88ea4> 8224\n<e88ea5> 8241\n<e88ea6> 8247\n<e88ea7> 2951\n<e88ea8> 8220\n<e88ea9> 8232\n<e88eaa> 8238\n<e88eab> 2941\n<e88eac> 14294\n<e88eae> 8249\n<e88eaf> 8242\n<e88eb0> 8245\n<e88eb9> 17063\n<e88ebd> 2940\n<e88ebe> 16217\n<e88ebf> 8864\n<e88f80> 8852\n<e88f81> 3381\n<e88f82> 8881\n<e88f83> 8890\n<e88f84> 8893\n<e88f85> 3379\n<e88f86> 8860\n<e88f87> 8885\n<e88f88> 8861\n<e88f89> 8875\n<e88f8a> 3392\n<e88f8b> 8871\n<e88f8c> 3389\n<e88f8d> 16469\n<e88f8e> 8872\n<e88f8f> 8849\n<e88f91> 8886\n<e88f93> 14296\n<e88f94> 3398\n<e88f95> 8883\n<e88f96> 8873\n<e88f97> 8895\n<e88f98> 8868\n<e88f99> 9550\n<e88f9b> 8898\n<e88f9c> 3396\n<e88f9d> 8866\n<e88f9e> 8878\n<e88f9f> 3399\n<e88fa0> 3378\n<e88fa1> 8870\n<e88fa2> 8896\n<e88fa3> 8863\n<e88fa4> 8856\n<e88fa5> 8867\nendcidchar\n\n100 begincidchar\n<e88fa7> 8855\n<e88fa8> 8853\n<e88fa9> 3374\n<e88faa> 8887\n<e88fab> 8862\n<e88fac> 8891\n<e88fad> 15660\n<e88fae> 8892\n<e88faf> 3382\n<e88fb0> 3387\n<e88fb1> 3383\n<e88fb2> 3391\n<e88fb3> 8882\n<e88fb4> 3384\n<e88fb5> 8874\n<e88fb6> 8858\n<e88fb8> 3376\n<e88fb9> 8850\n<e88fba> 8884\n<e88fbb> 8894\n<e88fbc> 8857\n<e88fbd> 3390\n<e88fbe> 8899\n<e88fbf> 8869\n<e89081> 8865\n<e89083> 3375\n<e89084> 3395\n<e89085> 18271\n<e89086> 8880\n<e89087> 3397\n<e89089> 8876\n<e8908a> 3386\n<e8908b> 3380\n<e8908c> 3388\n<e8908d> 3377\n<e8908e> 3394\n<e8908f> 8877\n<e89090> 8859\n<e89091> 8879\n<e89092> 8854\n<e89093> 8888\n<e89094> 15376\n<e89096> 16439\n<e89098> 15994\n<e8909b> 8897\n<e8909c> 16051\n<e890a0> 15445\n<e890a1> 14161\n<e890a3> 8851\n<e890a4> 18769\n<e890a6> 18136\n<e890a9> 9549\n<e890ab> 9571\n<e890ac> 3756\n<e890ad> 9554\n<e890ae> 16941\n<e890af> 9552\n<e890b0> 9531\n<e890b1> 3806\n<e890b2> 9547\n<e890b3> 9567\n<e890b4> 9543\n<e890b5> 3814\n<e890b6> 9566\n<e890b7> 9541\n<e890b8> 3393\n<e890b9> 9557\n<e890ba> 9542\n<e890bb> 9564\n<e890bc> 3813\n<e890bd> 3805\n<e890be> 15649\n<e890bf> 9520\n<e89180> 9528\n<e89182> 9553\n<e89183> 9545\n<e89184> 9570\n<e89185> 9548\n<e89186> 3819\n<e89187> 9565\n<e89188> 18200\n<e89189> 3810\n<e8918a> 14308\n<e8918b> 9551\n<e8918c> 9559\n<e8918d> 9532\n<e8918e> 9558\n<e89190> 9575\n<e89191> 9527\n<e89192> 9560\n<e89193> 15229\n<e89194> 9573\n<e89195> 14731\n<e89196> 9521\n<e89197> 3385\n<e89198> 14302\n<e89199> 9535\n<e8919a> 9534\n<e8919b> 3812\n<e8919c> 16091\nendcidchar\n\n100 begincidchar\n<e8919d> 9538\n<e8919e> 9540\n<e8919f> 9555\n<e891a0> 9572\n<e891a1> 3815\n<e891a2> 17114\n<e891a3> 3816\n<e891a4> 18273\n<e891a5> 9526\n<e891a6> 3808\n<e891a7> 9530\n<e891a8> 9568\n<e891a9> 3817\n<e891ab> 3809\n<e891ac> 3811\n<e891ad> 3818\n<e891ae> 9574\n<e891af> 9561\n<e891b0> 9556\n<e891b1> 14304\n<e891b2> 15507\n<e891b3> 9537\n<e891b4> 9536\n<e891b5> 3807\n<e891b6> 9522\n<e891b7> 3804\n<e891b8> 9546\n<e891b9> 9523\n<e891ba> 9544\n<e891bd> 9533\n<e891be> 9569\n<e891bf> 14670\n<e89280> 18121\n<e89282> 3803\n<e89284> 19103\n<e89286> 9529\n<e89288> 18274\n<e8928d> 9525\n<e8928e> 9563\n<e8928f> 9524\n<e89290> 4238\n<e89291> 10189\n<e89292> 14166\n<e89293> 14318\n<e89294> 10172\n<e89295> 15214\n<e89296> 18118\n<e89297> 10150\n<e89298> 10180\n<e89299> 4230\n<e8929a> 10165\n<e8929b> 10175\n<e8929c> 4233\n<e8929d> 10168\n<e8929e> 4231\n<e8929f> 10153\n<e892a0> 10183\n<e892a1> 10152\n<e892a2> 10171\n<e892a3> 15262\n<e892a4> 10151\n<e892a7> 10169\n<e892a8> 10178\n<e892a9> 10176\n<e892aa> 10164\n<e892ab> 10159\n<e892ac> 10157\n<e892ad> 15756\n<e892ae> 10158\n<e892af> 10177\n<e892b0> 10188\n<e892b1> 10166\n<e892b2> 4232\n<e892b4> 10161\n<e892b6> 10181\n<e892b8> 4235\n<e892b9> 10160\n<e892ba> 10154\n<e892bb> 10170\n<e892bc> 4239\n<e892bd> 15436\n<e892be> 18276\n<e892bf> 4227\n<e89380> 4236\n<e89381> 10162\n<e89382> 10156\n<e89384> 4229\n<e89385> 9562\n<e89386> 4228\n<e89387> 10173\n<e89389> 4226\n<e8938a> 4241\n<e8938b> 4234\n<e8938c> 10174\n<e8938d> 10163\n<e8938e> 10155\n<e8938f> 10182\n<e89390> 10167\n<e89391> 4240\n<e89392> 10186\nendcidchar\n\n100 begincidchar\n<e89393> 4237\n<e89394> 10185\n<e89396> 10179\n<e89397> 10184\n<e8939a> 16373\n<e8939b> 10187\n<e8939e> 14314\n<e893a1> 18277\n<e893a2> 14261\n<e893a4> 14319\n<e893a5> 15312\n<e893a9> 10743\n<e893aa> 10742\n<e893ab> 10738\n<e893ac> 4603\n<e893ae> 4595\n<e893af> 10758\n<e893b0> 10757\n<e893b1> 9519\n<e893b2> 10735\n<e893b3> 10739\n<e893b4> 10733\n<e893b6> 10752\n<e893b7> 10737\n<e893b8> 18278\n<e893b9> 10759\n<e893ba> 10730\n<e893bb> 10728\n<e893bc> 10740\n<e893bd> 10750\n<e893be> 10745\n<e893bf> 4605\n<e89480> 10719\n<e89482> 10749\n<e89483> 14728\n<e89484> 19147\n<e89485> 16619\n<e89486> 4606\n<e89487> 9539\n<e89488> 10731\n<e89489> 10722\n<e8948a> 10725\n<e8948b> 10763\n<e8948c> 10732\n<e8948d> 10723\n<e8948e> 10721\n<e8948f> 10718\n<e89490> 18279\n<e89491> 4599\n<e89492> 10741\n<e89493> 4598\n<e89494> 4602\n<e89495> 10736\n<e89496> 10744\n<e89497> 4592\n<e89498> 10760\n<e89499> 10764\n<e8949a> 4594\n<e8949c> 10727\n<e8949d> 10747\n<e8949e> 10751\n<e8949f> 10724\n<e894a0> 10761\n<e894a1> 4601\n<e894a3> 4600\n<e894a4> 10716\n<e894a5> 4604\n<e894a6> 10754\n<e894a7> 10726\n<e894a8> 10746\n<e894a9> 10720\n<e894aa> 10734\n<e894ab> 10729\n<e894ae> 10748\n<e894af> 10765\n<e894b0> 10762\n<e894b1> 10753\n<e894b3> 16936\n<e894b4> 14324\n<e894b8> 18280\n<e894bb> 10717\n<e894bd> 4593\n<e894be> 11343\n<e89580> 11334\n<e89581> 11337\n<e89582> 16482\n<e89583> 4923\n<e89584> 11339\n<e89585> 11328\n<e89586> 11335\n<e89587> 11341\n<e89588> 4920\n<e89589> 4924\n<e8958a> 4918\n<e8958b> 14272\n<e8958c> 16399\n<e8958d> 11330\n<e8958e> 11346\n<e89591> 11340\n<e89592> 18281\nendcidchar\n\n100 begincidchar\n<e89593> 11331\n<e89594> 11355\n<e89595> 11349\n<e89596> 11327\n<e89597> 11811\n<e89598> 11333\n<e89599> 4919\n<e8959a> 14299\n<e8959b> 11344\n<e8959d> 11354\n<e8959e> 4927\n<e8959f> 18938\n<e895a0> 11351\n<e895a1> 11332\n<e895a2> 11338\n<e895a3> 11342\n<e895a4> 11336\n<e895a5> 11356\n<e895a6> 11353\n<e895a7> 11350\n<e895aa> 4926\n<e895ab> 11329\n<e895ac> 11357\n<e895ad> 4925\n<e895ae> 11347\n<e895b1> 11345\n<e895b3> 14328\n<e895b5> 11348\n<e895b6> 11824\n<e895b7> 11805\n<e895b8> 11810\n<e895b9> 11823\n<e895ba> 11809\n<e895bb> 11801\n<e895bc> 11806\n<e895be> 5212\n<e89680> 11794\n<e89681> 11818\n<e89682> 11820\n<e89683> 11793\n<e89684> 5211\n<e89685> 11822\n<e89686> 11814\n<e89687> 5218\n<e89688> 11821\n<e89689> 11807\n<e8968a> 5220\n<e8968b> 11799\n<e8968c> 11352\n<e8968d> 11815\n<e8968e> 11812\n<e8968f> 11795\n<e89690> 11826\n<e89691> 5214\n<e89693> 19018\n<e89694> 5215\n<e89695> 11797\n<e89696> 11813\n<e89697> 18931\n<e89698> 11825\n<e89699> 11816\n<e8969a> 11803\n<e8969b> 5217\n<e8969c> 5213\n<e8969d> 11817\n<e8969e> 11804\n<e8969f> 11827\n<e896a0> 11798\n<e896a1> 11808\n<e896a2> 11819\n<e896a3> 11800\n<e896a4> 11802\n<e896a6> 5221\n<e896a7> 11796\n<e896a8> 5219\n<e896a9> 5404\n<e896aa> 5210\n<e896af> 5216\n<e896b0> 5408\n<e896b1> 12198\n<e896b3> 12188\n<e896b4> 12183\n<e896b5> 12189\n<e896b6> 12199\n<e896b7> 12203\n<e896b8> 12202\n<e896b9> 5410\n<e896ba> 5409\n<e896bd> 12190\n<e896be> 12204\n<e896bf> 12193\n<e89780> 12185\n<e89781> 14334\n<e89782> 12187\n<e89783> 12186\n<e89784> 12192\n<e89785> 12197\n<e89786> 12184\n<e89787> 12191\n<e89788> 12196\nendcidchar\n\n100 begincidchar\n<e89789> 5407\n<e8978b> 12194\n<e8978d> 5405\n<e8978e> 12195\n<e8978f> 5403\n<e89790> 5406\n<e89791> 12545\n<e89792> 12200\n<e89795> 5559\n<e89796> 18951\n<e89797> 12537\n<e89798> 12541\n<e89799> 12533\n<e8979a> 12536\n<e8979c> 12544\n<e8979d> 5557\n<e8979e> 12549\n<e8979f> 12542\n<e897a0> 18285\n<e897a1> 12534\n<e897a2> 12550\n<e897a3> 12543\n<e897a6> 12547\n<e897a8> 12535\n<e897a9> 5556\n<e897aa> 5558\n<e897ab> 12530\n<e897ac> 12538\n<e897ad> 12532\n<e897ae> 15446\n<e897af> 12548\n<e897b0> 12546\n<e897b1> 12531\n<e897b2> 12539\n<e897b6> 12837\n<e897b7> 5562\n<e897b8> 12540\n<e897b9> 5688\n<e897ba> 5690\n<e897bb> 5687\n<e897bc> 15440\n<e897bd> 12842\n<e897be> 12834\n<e897bf> 12832\n<e89880> 12836\n<e89881> 12833\n<e89882> 14336\n<e89884> 12838\n<e89885> 12840\n<e89886> 5691\n<e89887> 5693\n<e89889> 12839\n<e8988a> 5694\n<e8988b> 5692\n<e8988c> 12841\n<e8988d> 16484\n<e8988f> 18882\n<e89890> 15231\n<e89891> 5689\n<e89893> 19107\n<e89894> 18110\n<e89896> 14331\n<e89897> 5765\n<e89898> 13046\n<e89899> 13052\n<e8989a> 5767\n<e8989b> 12835\n<e8989c> 13051\n<e8989e> 13058\n<e8989f> 13049\n<e898a0> 13056\n<e898a1> 13055\n<e898a2> 12831\n<e898a3> 13050\n<e898a4> 12201\n<e898a5> 13059\n<e898a6> 13048\n<e898a7> 13053\n<e898a8> 14341\n<e898a9> 13057\n<e898aa> 13047\n<e898ac> 13226\n<e898ad> 5766\n<e898ae> 13054\n<e898af> 16286\n<e898b1> 13362\n<e898b2> 13227\n<e898b3> 13225\n<e898b6> 13228\n<e898b8> 5895\n<e898b9> 13360\n<e898ba> 13358\n<e898bb> 13363\n<e898bc> 13361\n<e898be> 13364\n<e898bf> 5896\n<e89980> 13359\n<e89982> 14529\n<e89983> 13463\n<e89985> 15206\nendcidchar\n\n100 begincidchar\n<e8998b> 13630\n<e8998c> 13622\n<e8998d> 6168\n<e8998e> 1673\n<e89990> 2047\n<e89992> 7651\n<e89993> 7650\n<e89994> 2479\n<e89995> 2952\n<e89996> 8252\n<e89999> 8251\n<e8999b> 3400\n<e8999c> 3821\n<e8999e> 3820\n<e8999f> 3822\n<e899a1> 10190\n<e899a2> 10766\n<e899a3> 11358\n<e899a4> 11360\n<e899a5> 11359\n<e899a7> 5222\n<e899a8> 11828\n<e899a9> 12205\n<e899aa> 13598\n<e899ab> 1039\n<e899ac> 14355\n<e899af> 6725\n<e899b0> 6724\n<e899b1> 1674\n<e899b2> 18287\n<e899b3> 7165\n<e899b4> 7163\n<e899b7> 7162\n<e899b9> 2048\n<e899ba> 2050\n<e899bb> 2049\n<e899bc> 7164\n<e899be> 14346\n<e89a85> 7663\n<e89a86> 7660\n<e89a87> 7658\n<e89a8a> 2480\n<e89a8b> 7661\n<e89a8c> 2485\n<e89a8d> 7655\n<e89a8e> 7670\n<e89a90> 7672\n<e89a91> 7656\n<e89a92> 18288\n<e89a93> 2482\n<e89a94> 7673\n<e89a95> 7668\n<e89a96> 7654\n<e89a97> 7659\n<e89a98> 7669\n<e89a99> 7665\n<e89a9a> 7662\n<e89a9c> 2487\n<e89a9d> 7671\n<e89a9e> 7657\n<e89aa0> 15240\n<e89aa1> 7666\n<e89aa2> 7652\n<e89aa3> 2486\n<e89aa4> 2483\n<e89aa5> 7664\n<e89aa7> 7667\n<e89aa8> 7653\n<e89aa9> 2484\n<e89aaa> 2481\n<e89aad> 16134\n<e89aaf> 2962\n<e89ab0> 8259\n<e89ab1> 2961\n<e89ab2> 17376\n<e89ab3> 8262\n<e89ab4> 8265\n<e89ab5> 2958\n<e89ab6> 2956\n<e89ab7> 8254\n<e89ab8> 8263\n<e89ab9> 8261\n<e89aba> 8258\n<e89abf> 8253\n<e89b80> 2955\n<e89b81> 8256\n<e89b82> 8255\n<e89b83> 8268\n<e89b84> 2957\n<e89b85> 8257\n<e89b86> 2959\n<e89b87> 2954\n<e89b88> 8260\n<e89b89> 2963\n<e89b8b> 2960\n<e89b8c> 8264\n<e89b90> 3407\n<e89b91> 8914\n<e89b93> 8903\n<e89b94> 3404\nendcidchar\n\n100 begincidchar\n<e89b96> 9581\n<e89b97> 8912\n<e89b98> 8900\n<e89b99> 3402\n<e89b9a> 8905\n<e89b9b> 3405\n<e89b9c> 8909\n<e89b9d> 8907\n<e89b9e> 3408\n<e89b9f> 3401\n<e89ba2> 8901\n<e89ba3> 8904\n<e89ba4> 3406\n<e89ba6> 8902\n<e89ba8> 8913\n<e89ba9> 8911\n<e89baa> 8906\n<e89bab> 8908\n<e89bac> 8910\n<e89bad> 3403\n<e89baf> 18289\n<e89bb5> 9582\n<e89bb6> 9588\n<e89bb7> 9578\n<e89bb8> 9584\n<e89bb9> 3823\n<e89bba> 9580\n<e89bbb> 3829\n<e89bbe> 3828\n<e89c80> 3827\n<e89c81> 9587\n<e89c84> 9577\n<e89c85> 9590\n<e89c86> 3832\n<e89c87> 3826\n<e89c88> 3825\n<e89c89> 9586\n<e89c8a> 3833\n<e89c8b> 9576\n<e89c8c> 9579\n<e89c8d> 9589\n<e89c8e> 9585\n<e89c91> 10222\n<e89c92> 10211\n<e89c93> 3824\n<e89c98> 4248\n<e89c99> 10199\n<e89c9a> 10220\n<e89c9b> 10200\n<e89c9c> 4243\n<e89c9e> 10197\n<e89ca0> 10206\n<e89ca1> 10198\n<e89ca2> 4245\n<e89ca3> 10192\n<e89ca4> 10219\n<e89ca5> 4246\n<e89ca8> 10193\n<e89ca9> 4251\n<e89caa> 10208\n<e89cac> 10202\n<e89cad> 10209\n<e89cae> 10196\n<e89cb0> 10221\n<e89cb1> 10213\n<e89cb2> 10207\n<e89cb3> 10191\n<e89cb4> 4247\n<e89cb5> 10214\n<e89cb7> 4250\n<e89cb8> 10218\n<e89cba> 10212\n<e89cbb> 4244\n<e89cbc> 10210\n<e89cbe> 10204\n<e89cbf> 4242\n<e89d80> 10195\n<e89d81> 10203\n<e89d82> 10215\n<e89d83> 10201\n<e89d86> 10205\n<e89d8c> 4616\n<e89d8d> 9583\n<e89d8e> 10784\n<e89d8f> 10793\n<e89d90> 10783\n<e89d91> 10779\n<e89d92> 10776\n<e89d93> 4617\n<e89d94> 10774\n<e89d95> 4249\n<e89d96> 10767\n<e89d97> 4615\n<e89d98> 10773\n<e89d99> 4614\n<e89d9a> 10778\n<e89d9b> 10775\n<e89d9c> 10791\n<e89d9d> 10786\n<e89d9e> 10780\nendcidchar\n\n100 begincidchar\n<e89d9f> 10785\n<e89da0> 4610\n<e89da1> 10777\n<e89da2> 10796\n<e89da5> 10792\n<e89da6> 4611\n<e89da7> 10797\n<e89da8> 4613\n<e89da9> 10798\n<e89daa> 10782\n<e89dab> 10194\n<e89dac> 10788\n<e89dad> 10781\n<e89dae> 10790\n<e89daf> 10787\n<e89db0> 15980\n<e89db1> 18087\n<e89db3> 10772\n<e89db4> 4608\n<e89db5> 10795\n<e89db6> 4609\n<e89db7> 10770\n<e89db8> 4612\n<e89db9> 11371\n<e89dba> 10789\n<e89dbb> 10794\n<e89dbd> 16453\n<e89e81> 11368\n<e89e82> 4607\n<e89e83> 4928\n<e89e84> 11378\n<e89e85> 11374\n<e89e86> 18662\n<e89e87> 11372\n<e89e88> 11367\n<e89e89> 11382\n<e89e8b> 17378\n<e89e8c> 16367\n<e89e8d> 4932\n<e89e8f> 11363\n<e89e92> 11366\n<e89e93> 11365\n<e89e94> 11379\n<e89e96> 11369\n<e89e97> 11364\n<e89e98> 11370\n<e89e9a> 11381\n<e89e9b> 11362\n<e89e9c> 11380\n<e89e9d> 11377\n<e89e9e> 4930\n<e89e9f> 4929\n<e89ea2> 4931\n<e89ea3> 11373\n<e89ea4> 11361\n<e89ea5> 15752\n<e89ea9> 16364\n<e89eaa> 11830\n<e89eab> 5228\n<e89eac> 11834\n<e89ead> 11831\n<e89eae> 11838\n<e89eaf> 11844\n<e89eb0> 11833\n<e89eb1> 14351\n<e89eb2> 11853\n<e89eb3> 5225\n<e89eb4> 11847\n<e89eb5> 11836\n<e89eb6> 11848\n<e89eb7> 11843\n<e89eb8> 11850\n<e89eb9> 11835\n<e89eba> 5230\n<e89ebb> 5229\n<e89ebc> 11837\n<e89ebd> 11851\n<e89ebe> 11829\n<e89ebf> 11849\n<e89f80> 5223\n<e89f81> 16380\n<e89f82> 11841\n<e89f83> 11840\n<e89f84> 11845\n<e89f85> 11832\n<e89f86> 5227\n<e89f88> 5231\n<e89f89> 11839\n<e89f8a> 11846\n<e89f8b> 5232\n<e89f8c> 11842\n<e89f8e> 16365\n<e89f91> 5224\n<e89f92> 5226\n<e89f93> 12218\n<e89f94> 12216\n<e89f96> 16274\n<e89f97> 12222\n<e89f98> 12220\n<e89f99> 12223\nendcidchar\n\n100 begincidchar\n<e89f9a> 14352\n<e89f9b> 12209\n<e89f9c> 12217\n<e89f9d> 12227\n<e89f9e> 11852\n<e89f9f> 12213\n<e89fa0> 5414\n<e89fa1> 10771\n<e89fa2> 12208\n<e89fa3> 12221\n<e89fa4> 12215\n<e89fa5> 12212\n<e89fa6> 12207\n<e89fa7> 12206\n<e89fa8> 12226\n<e89faa> 12211\n<e89fab> 12210\n<e89fac> 5412\n<e89fad> 12219\n<e89fae> 14349\n<e89faf> 5411\n<e89fb2> 5413\n<e89fb3> 12214\n<e89fb4> 12225\n<e89fb5> 16302\n<e89fb9> 5566\n<e89fba> 12552\n<e89fbb> 5563\n<e89fbc> 12560\n<e89fbe> 5567\n<e89fbf> 12562\n<e8a080> 12551\n<e8a081> 12224\n<e8a082> 12564\n<e8a083> 12553\n<e8a084> 16047\n<e8a085> 5564\n<e8a086> 12559\n<e8a088> 12561\n<e8a089> 12556\n<e8a08a> 12563\n<e8a08b> 12558\n<e8a08c> 12557\n<e8a08d> 5565\n<e8a08f> 14353\n<e8a093> 12847\n<e8a096> 12848\n<e8a097> 12846\n<e8a098> 16250\n<e8a099> 12843\n<e8a09b> 13062\n<e8a09c> 13065\n<e8a09d> 13061\n<e8a09f> 5771\n<e8a0a0> 13063\n<e8a0a1> 5770\n<e8a0a2> 5769\n<e8a0a3> 5768\n<e8a0a4> 13064\n<e8a0a5> 13233\n<e8a0a6> 13231\n<e8a0a7> 15879\n<e8a0a8> 13230\n<e8a0a9> 13060\n<e8a0aa> 13232\n<e8a0ab> 13066\n<e8a0ac> 13229\n<e8a0ad> 15243\n<e8a0ae> 13367\n<e8a0af> 13333\n<e8a0b0> 13365\n<e8a0b1> 5897\n<e8a0b2> 13366\n<e8a0b3> 13368\n<e8a0b5> 13466\n<e8a0b6> 5928\n<e8a0b7> 13465\n<e8a0b8> 13464\n<e8a0b9> 5929\n<e8a0bb> 5959\n<e8a0bc> 13576\n<e8a0bd> 13600\n<e8a0be> 13599\n<e8a0bf> 13601\n<e8a180> 1040\n<e8a181> 7166\n<e8a182> 16218\n<e8a188> 8915\n<e8a18a> 13067\n<e8a18b> 13467\n<e8a18c> 1041\n<e8a18d> 2051\n<e8a18e> 7167\n<e8a18f> 14404\n<e8a192> 8271\n<e8a193> 2964\n<e8a195> 8917\n<e8a196> 8916\n<e8a197> 3409\n<e8a199> 3834\nendcidchar\n\n100 begincidchar\n<e8a19a> 10799\n<e8a19b> 4618\n<e8a19d> 4619\n<e8a19e> 14363\n<e8a1a0> 14918\n<e8a1a1> 4933\n<e8a1a2> 5930\n<e8a1a3> 1042\n<e8a1a4> 17666\n<e8a1a5> 15868\n<e8a1a7> 7168\n<e8a1a8> 1676\n<e8a1a9> 7170\n<e8a1aa> 7169\n<e8a1ab> 2052\n<e8a1ad> 7676\n<e8a1ae> 15246\n<e8a1af> 7683\n<e8a1b0> 2488\n<e8a1b1> 7681\n<e8a1b2> 7679\n<e8a1b4> 7686\n<e8a1b7> 2489\n<e8a1b9> 2493\n<e8a1bc> 7687\n<e8a1bd> 2492\n<e8a1be> 7685\n<e8a1bf> 7682\n<e8a280> 7680\n<e8a283> 7684\n<e8a284> 17143\n<e8a287> 15248\n<e8a288> 2966\n<e8a289> 8272\n<e8a28b> 2971\n<e8a28c> 8288\n<e8a28d> 2970\n<e8a28e> 8290\n<e8a28f> 18854\n<e8a290> 18933\n<e8a291> 8278\n<e8a292> 2968\n<e8a293> 8289\n<e8a295> 8273\n<e8a296> 2969\n<e8a297> 8285\n<e8a298> 8281\n<e8a299> 8283\n<e8a29a> 8277\n<e8a29b> 8284\n<e8a29c> 14364\n<e8a29d> 19115\n<e8a29e> 2965\n<e8a29f> 8280\n<e8a2a0> 16288\n<e8a2a1> 8279\n<e8a2a2> 8275\n<e8a2a4> 8286\n<e8a2a7> 8282\n<e8a2a8> 8274\n<e8a2aa> 8276\n<e8a2ab> 2967\n<e8a2ac> 8287\n<e8a2ae> 18293\n<e8a2b1> 3412\n<e8a2b2> 8928\n<e8a2b6> 8924\n<e8a2b7> 8926\n<e8a2b8> 8921\n<e8a2b9> 8920\n<e8a2ba> 8918\n<e8a2bc> 8925\n<e8a2bd> 8927\n<e8a2be> 8923\n<e8a2bf> 15249\n<e8a380> 8922\n<e8a385> 14368\n<e8a387> 16049\n<e8a389> 8930\n<e8a38a> 3842\n<e8a38b> 9592\n<e8a38c> 9598\n<e8a38f> 14058\n<e8a390> 9599\n<e8a392> 3844\n<e8a394> 3836\n<e8a395> 3843\n<e8a396> 9591\n<e8a397> 8919\n<e8a398> 3839\n<e8a399> 3837\n<e8a39a> 9597\n<e8a39b> 9596\n<e8a39c> 3838\n<e8a39d> 3840\n<e8a39e> 9595\n<e8a39f> 3835\n<e8a3a1> 3841\n<e8a3a6> 15250\n<e8a3a7> 10224\nendcidchar\n\n100 begincidchar\n<e8a3a8> 4258\n<e8a3ab> 10235\n<e8a3ac> 10234\n<e8a3ae> 10229\n<e8a3af> 4260\n<e8a3b0> 10233\n<e8a3b3> 4252\n<e8a3b4> 4254\n<e8a3b5> 15880\n<e8a3b6> 10231\n<e8a3b7> 10223\n<e8a3b8> 4256\n<e8a3b9> 4255\n<e8a3ba> 10227\n<e8a3bb> 10232\n<e8a3bc> 10230\n<e8a3bd> 4257\n<e8a3be> 10228\n<e8a3bf> 18294\n<e8a480> 17146\n<e8a481> 8929\n<e8a482> 4253\n<e8a485> 10800\n<e8a486> 10807\n<e8a487> 4621\n<e8a489> 10811\n<e8a48a> 4625\n<e8a48b> 10803\n<e8a48c> 10801\n<e8a48e> 10810\n<e8a490> 4620\n<e8a491> 10809\n<e8a494> 10802\n<e8a495> 4624\n<e8a496> 10808\n<e8a49a> 4259\n<e8a49e> 11383\n<e8a49f> 11395\n<e8a4a1> 4938\n<e8a4a2> 11390\n<e8a4a3> 11392\n<e8a4a4> 18295\n<e8a4a5> 4936\n<e8a4a6> 11384\n<e8a4a7> 11388\n<e8a4a9> 11391\n<e8a4aa> 4934\n<e8a4ab> 4937\n<e8a4ac> 11394\n<e8a4af> 11393\n<e8a4b0> 11385\n<e8a4b1> 11389\n<e8a4b2> 4935\n<e8a4b3> 11855\n<e8a4b5> 11854\n<e8a4b6> 5234\n<e8a4b7> 11860\n<e8a4b8> 5236\n<e8a4bb> 5233\n<e8a4bc> 11856\n<e8a4bd> 5237\n<e8a4be> 11857\n<e8a581> 11858\n<e8a582> 11861\n<e8a583> 15894\n<e8a584> 5235\n<e8a586> 12232\n<e8a587> 17379\n<e8a589> 12235\n<e8a58b> 12229\n<e8a58c> 12231\n<e8a58d> 15252\n<e8a58f> 12230\n<e8a592> 11859\n<e8a593> 12228\n<e8a594> 15254\n<e8a596> 5570\n<e8a597> 12568\n<e8a598> 12571\n<e8a599> 12573\n<e8a59c> 12570\n<e8a59d> 12572\n<e8a59e> 5571\n<e8a59f> 5569\n<e8a5a0> 5568\n<e8a5a1> 12569\n<e8a5a2> 12565\n<e8a5a3> 12849\n<e8a5a4> 5697\n<e8a5a5> 15251\n<e8a5a6> 12850\n<e8a5a9> 13069\n<e8a5aa> 5772\n<e8a5ab> 13071\n<e8a5ac> 5773\n<e8a5ad> 13068\n<e8a5ae> 13070\n<e8a5af> 5846\n<e8a5b1> 13234\n<e8a5b2> 5845\nendcidchar\n\n100 begincidchar\n<e8a5b3> 13371\n<e8a5b4> 13370\n<e8a5b6> 13369\n<e8a5b7> 15850\n<e8a5bb> 13541\n<e8a5bc> 13540\n<e8a5be> 6169\n<e8a5bf> 1043\n<e8a680> 18184\n<e8a681> 2053\n<e8a682> 8291\n<e8a683> 3413\n<e8a685> 9600\n<e8a686> 5415\n<e8a687> 14370\n<e8a688> 12574\n<e8a689> 16361\n<e8a68a> 18090\n<e8a68b> 1288\n<e8a68f> 2973\n<e8a691> 18296\n<e8a693> 2972\n<e8a694> 16352\n<e8a695> 8931\n<e8a696> 3414\n<e8a697> 8933\n<e8a698> 8932\n<e8a69b> 9601\n<e8a69c> 3845\n<e8a69d> 10236\n<e8a69e> 10239\n<e8a69f> 10238\n<e8a6a1> 10237\n<e8a6a2> 10812\n<e8a6a3> 10814\n<e8a6a4> 10813\n<e8a6a5> 15763\n<e8a6a6> 4940\n<e8a6a7> 14374\n<e8a6a9> 16377\n<e8a6aa> 4939\n<e8a6ac> 5238\n<e8a6ad> 11862\n<e8a6ae> 11864\n<e8a6af> 11863\n<e8a6b2> 5416\n<e8a6b6> 12576\n<e8a6b7> 12575\n<e8a6b9> 12851\n<e8a6ba> 5698\n<e8a6bc> 14375\n<e8a6bd> 5774\n<e8a6be> 13236\n<e8a6bf> 13235\n<e8a780> 5960\n<e8a781> 17667\n<e8a786> 17766\n<e8a792> 1289\n<e8a793> 7171\n<e8a794> 2054\n<e8a795> 8294\n<e8a796> 8292\n<e8a799> 8293\n<e8a79c> 9608\n<e8a79d> 8934\n<e8a79f> 9602\n<e8a7a0> 9606\n<e8a7a1> 9605\n<e8a7a2> 9607\n<e8a7a3> 3846\n<e8a7a4> 9604\n<e8a7a5> 9603\n<e8a7a6> 9609\n<e8a7a7> 14377\n<e8a7a8> 10242\n<e8a7a9> 10240\n<e8a7ab> 10241\n<e8a7ac> 10817\n<e8a7ad> 10815\n<e8a7b0> 10816\n<e8a7b1> 11396\n<e8a7b4> 5417\n<e8a7b6> 12577\n<e8a7b7> 12852\n<e8a7b8> 5699\n<e8a7ba> 13072\n<e8a7bb> 13237\n<e8a7bc> 5847\n<e8a7be> 13372\n<e8a7bf> 13542\n<e8a880> 1290\n<e8a884> 7172\n<e8a887> 7173\n<e8a888> 2055\n<e8a88a> 2499\n<e8a88c> 2497\n<e8a88e> 2496\n<e8a88f> 2503\n<e8a890> 2495\n<e8a891> 2504\nendcidchar\n\n100 begincidchar\n<e8a892> 7688\n<e8a893> 2501\n<e8a895> 2498\n<e8a896> 2502\n<e8a897> 2500\n<e8a898> 2494\n<e8a89b> 2981\n<e8a89c> 15267\n<e8a89d> 2975\n<e8a89e> 8298\n<e8a89f> 2980\n<e8a8a2> 2982\n<e8a8a3> 2976\n<e8a8a5> 2977\n<e8a8a7> 8296\n<e8a8a9> 17381\n<e8a8aa> 2974\n<e8a8ab> 15313\n<e8a8ac> 8297\n<e8a8ad> 2979\n<e8a8b0> 8295\n<e8a8b1> 2978\n<e8a8b4> 3425\n<e8a8b6> 3427\n<e8a8b8> 18298\n<e8a8b9> 8939\n<e8a8ba> 3426\n<e8a8bb> 3415\n<e8a8bc> 3419\n<e8a8bd> 15266\n<e8a8be> 3865\n<e8a8bf> 9614\n<e8a980> 8941\n<e8a981> 3420\n<e8a986> 3424\n<e8a988> 8947\n<e8a989> 16368\n<e8a98a> 8949\n<e8a98c> 8950\n<e8a98d> 8938\n<e8a98e> 8937\n<e8a98f> 8951\n<e8a990> 3423\n<e8a991> 8948\n<e8a992> 8946\n<e8a994> 3421\n<e8a995> 3417\n<e8a996> 3428\n<e8a999> 8940\n<e8a99b> 3422\n<e8a99e> 3418\n<e8a9a0> 3416\n<e8a9a1> 9613\n<e8a9a2> 3860\n<e8a9a3> 3855\n<e8a9a6> 3850\n<e8a9a7> 16270\n<e8a9a8> 3866\n<e8a9a9> 3851\n<e8a9ab> 3847\n<e8a9ac> 3862\n<e8a9ad> 3859\n<e8a9ae> 3861\n<e8a9b0> 3852\n<e8a9b1> 3857\n<e8a9b4> 9621\n<e8a9b5> 9618\n<e8a9b6> 9610\n<e8a9b7> 9615\n<e8a9b9> 3863\n<e8a9ba> 9622\n<e8a9bb> 3864\n<e8a9bc> 3854\n<e8a9be> 16293\n<e8a9bf> 9612\n<e8aa81> 9620\n<e8aa82> 9616\n<e8aa83> 9619\n<e8aa84> 9617\n<e8aa85> 3858\n<e8aa86> 9611\n<e8aa87> 3853\n<e8aa8b> 10245\n<e8aa8c> 4262\n<e8aa8d> 4265\n<e8aa8f> 10247\n<e8aa90> 14383\n<e8aa91> 4273\n<e8aa92> 10246\n<e8aa93> 4267\n<e8aa94> 18299\n<e8aa95> 4630\n<e8aa96> 10248\n<e8aa98> 4272\n<e8aa99> 10244\n<e8aa9a> 4274\n<e8aa9c> 14380\n<e8aa9e> 4263\n<e8aaa0> 3856\n<e8aaa1> 4266\nendcidchar\n\n100 begincidchar\n<e8aaa3> 4264\n<e8aaa4> 4268\n<e8aaa5> 4270\n<e8aaa6> 4261\n<e8aaa7> 4275\n<e8aaa8> 4271\n<e8aaa9> 14397\n<e8aaaa> 4269\n<e8aaab> 10243\n<e8aaaf> 14401\n<e8aab0> 4637\n<e8aab2> 4633\n<e8aab4> 18300\n<e8aab6> 4640\n<e8aab8> 10820\n<e8aab9> 4641\n<e8aaba> 10832\n<e8aabb> 10825\n<e8aabc> 4626\n<e8aabd> 10833\n<e8aabe> 10827\n<e8aabf> 4636\n<e8ab80> 10828\n<e8ab82> 4635\n<e8ab83> 10831\n<e8ab84> 4629\n<e8ab85> 10829\n<e8ab86> 10819\n<e8ab87> 4628\n<e8ab88> 11407\n<e8ab89> 4634\n<e8ab8b> 4631\n<e8ab8c> 19049\n<e8ab8d> 4639\n<e8ab8f> 10818\n<e8ab91> 10822\n<e8ab92> 4627\n<e8ab93> 10821\n<e8ab96> 4638\n<e8ab97> 10826\n<e8ab98> 10830\n<e8ab99> 10834\n<e8ab9a> 14786\n<e8ab9b> 4642\n<e8ab9c> 4946\n<e8ab9d> 11402\n<e8ab9e> 11408\n<e8ab9f> 11405\n<e8aba0> 11397\n<e8aba1> 11409\n<e8aba2> 11398\n<e8aba4> 11404\n<e8aba6> 4941\n<e8aba7> 4947\n<e8aba8> 11410\n<e8abaa> 15833\n<e8abab> 4943\n<e8abad> 4953\n<e8abae> 4948\n<e8abaf> 11412\n<e8abb0> 11406\n<e8abb1> 4944\n<e8abb2> 11399\n<e8abb3> 4954\n<e8abb6> 4955\n<e8abb7> 4952\n<e8abb8> 4632\n<e8abb9> 19034\n<e8abba> 4942\n<e8abbb> 11413\n<e8abbc> 4956\n<e8abbe> 4949\n<e8abbf> 11411\n<e8ac80> 4945\n<e8ac84> 5246\n<e8ac85> 11871\n<e8ac86> 11880\n<e8ac87> 11877\n<e8ac88> 11879\n<e8ac8a> 5243\n<e8ac8b> 11872\n<e8ac8c> 14390\n<e8ac8d> 11878\n<e8ac8e> 5239\n<e8ac8f> 11874\n<e8ac90> 5247\n<e8ac91> 11870\n<e8ac92> 11875\n<e8ac93> 11882\n<e8ac94> 11403\n<e8ac95> 11876\n<e8ac96> 11869\n<e8ac97> 5240\n<e8ac98> 11868\n<e8ac99> 5241\n<e8ac9a> 11883\n<e8ac9b> 5242\n<e8ac9c> 11881\n<e8ac9d> 5245\n<e8ac9e> 11867\nendcidchar\n\n100 begincidchar\n<e8ac9f> 14391\n<e8aca0> 5244\n<e8aca2> 11873\n<e8aca3> 12238\n<e8aca4> 12252\n<e8aca5> 12247\n<e8aca6> 12249\n<e8aca7> 12237\n<e8aca8> 5418\n<e8acaa> 12236\n<e8acab> 5421\n<e8acac> 5420\n<e8acad> 16281\n<e8acae> 12251\n<e8acaf> 12243\n<e8acb0> 12240\n<e8acb1> 12246\n<e8acb3> 12239\n<e8acb5> 12241\n<e8acb6> 12250\n<e8acb7> 12248\n<e8acb9> 5419\n<e8acba> 12255\n<e8acbb> 12253\n<e8acbc> 12244\n<e8acbd> 12254\n<e8acbe> 12245\n<e8acbf> 14394\n<e8ad80> 12581\n<e8ad81> 5572\n<e8ad82> 12588\n<e8ad83> 16370\n<e8ad85> 13075\n<e8ad86> 5579\n<e8ad87> 12242\n<e8ad88> 12579\n<e8ad89> 5575\n<e8ad8a> 12580\n<e8ad8b> 12585\n<e8ad8c> 18092\n<e8ad8d> 14396\n<e8ad90> 12578\n<e8ad91> 12587\n<e8ad92> 12589\n<e8ad93> 12582\n<e8ad94> 12584\n<e8ad95> 12586\n<e8ad96> 12583\n<e8ad97> 12590\n<e8ad98> 5574\n<e8ad99> 5580\n<e8ad9a> 5576\n<e8ad9c> 5573\n<e8ad9d> 12855\n<e8ad9e> 15800\n<e8ad9f> 5704\n<e8ada0> 12853\n<e8ada2> 15828\n<e8ada3> 12857\n<e8ada5> 12858\n<e8ada6> 5702\n<e8ada7> 12859\n<e8ada8> 12856\n<e8ada9> 15351\n<e8adaa> 12854\n<e8adab> 5705\n<e8adac> 5701\n<e8adad> 12860\n<e8adaf> 5703\n<e8adb0> 5700\n<e8adb4> 5775\n<e8adb7> 5776\n<e8adb8> 13074\n<e8adb9> 13073\n<e8adbd> 5777\n<e8adbe> 13238\n<e8adbf> 13243\n<e8ae80> 5848\n<e8ae81> 15757\n<e8ae82> 13240\n<e8ae83> 18923\n<e8ae84> 13239\n<e8ae85> 13242\n<e8ae86> 13241\n<e8ae88> 13376\n<e8ae8a> 5898\n<e8ae8b> 13375\n<e8ae8c> 13373\n<e8ae8e> 13374\n<e8ae8f> 19135\n<e8ae90> 14399\n<e8ae92> 5932\n<e8ae93> 5931\n<e8ae96> 5933\n<e8ae9a> 5972\n<e8ae9b> 14400\n<e8ae9c> 5978\n<e8ae9e> 13602\n<e8ae9f> 13631\n<e8aea0> 17669\nendcidchar\n\n100 begincidchar\n<e8aebe> 17767\n<e8afa2> 17768\n<e8b0b7> 1291\n<e8b0b9> 8299\n<e8b0bb> 8300\n<e8b0bc> 9623\n<e8b0bd> 10249\n<e8b0be> 10835\n<e8b0bf> 5249\n<e8b181> 5248\n<e8b182> 12256\n<e8b183> 12591\n<e8b185> 13377\n<e8b186> 1292\n<e8b187> 7689\n<e8b188> 2505\n<e8b189> 2983\n<e8b18a> 9625\n<e8b18b> 9624\n<e8b18c> 4643\n<e8b18d> 10836\n<e8b18e> 4644\n<e8b18f> 11884\n<e8b190> 5422\n<e8b191> 18301\n<e8b194> 5987\n<e8b195> 1293\n<e8b196> 6728\n<e8b197> 7690\n<e8b19a> 2984\n<e8b19f> 8952\n<e8b1a1> 3429\n<e8b1a2> 3867\n<e8b1a4> 9627\n<e8b1a5> 9626\n<e8b1a6> 9628\n<e8b1aa> 4276\n<e8b1ab> 4957\n<e8b1ac> 4645\n<e8b1ad> 4958\n<e8b1af> 11888\n<e8b1b0> 11885\n<e8b1b1> 11887\n<e8b1b2> 11886\n<e8b1b3> 5250\n<e8b1b5> 12257\n<e8b1b6> 12593\n<e8b1b7> 12592\n<e8b1b8> 6375\n<e8b1b9> 2507\n<e8b1ba> 2506\n<e8b1bb> 7691\n<e8b1bd> 8303\n<e8b280> 8954\n<e8b281> 8953\n<e8b282> 3430\n<e8b286> 9629\n<e8b289> 3869\n<e8b28a> 3868\n<e8b28c> 4278\n<e8b28d> 4277\n<e8b28f> 10837\n<e8b290> 11416\n<e8b293> 4959\n<e8b294> 11890\n<e8b295> 11889\n<e8b297> 12260\n<e8b298> 12259\n<e8b299> 12258\n<e8b29a> 12594\n<e8b29b> 14405\n<e8b29c> 13603\n<e8b29d> 1294\n<e8b29e> 2058\n<e8b29f> 15277\n<e8b2a0> 2059\n<e8b2a3> 7693\n<e8b2a4> 7692\n<e8b2a5> 8304\n<e8b2a7> 2990\n<e8b2a8> 2988\n<e8b2a9> 2985\n<e8b2aa> 2989\n<e8b2ab> 2987\n<e8b2ac> 2986\n<e8b2ad> 16369\n<e8b2af> 3431\n<e8b2b0> 8957\n<e8b2b2> 3874\n<e8b2b3> 3433\n<e8b2b4> 3438\n<e8b2b5> 8959\n<e8b2b6> 3440\n<e8b2b7> 3439\n<e8b2b8> 3442\n<e8b2b9> 8958\n<e8b2ba> 8955\n<e8b2bb> 3436\n<e8b2bc> 3432\n<e8b2bd> 3434\nendcidchar\n\n100 begincidchar\n<e8b2be> 8956\n<e8b2bf> 3441\n<e8b380> 3437\n<e8b381> 3435\n<e8b382> 3876\n<e8b383> 3875\n<e8b384> 3873\n<e8b385> 3877\n<e8b38a> 3870\n<e8b38c> 9632\n<e8b38d> 16025\n<e8b38f> 10253\n<e8b393> 4279\n<e8b394> 18302\n<e8b395> 10252\n<e8b396> 14411\n<e8b397> 10254\n<e8b399> 10840\n<e8b39a> 10842\n<e8b39b> 14417\n<e8b39c> 4654\n<e8b39d> 10843\n<e8b39e> 4647\n<e8b39f> 10839\n<e8b3a0> 4646\n<e8b3a1> 4656\n<e8b3a4> 4649\n<e8b3a5> 10838\n<e8b3a6> 4648\n<e8b3a7> 10844\n<e8b3a8> 10841\n<e8b3a9> 15278\n<e8b3aa> 4655\n<e8b3ab> 16284\n<e8b3ae> 11418\n<e8b3b0> 11420\n<e8b3b1> 11419\n<e8b3b2> 18303\n<e8b3b3> 11421\n<e8b3b4> 4960\n<e8b3b5> 11417\n<e8b3b7> 16305\n<e8b3b8> 5254\n<e8b3b9> 11891\n<e8b3ba> 5251\n<e8b3bb> 5255\n<e8b3bc> 5253\n<e8b3bd> 5252\n<e8b3be> 12261\n<e8b480> 12264\n<e8b482> 12263\n<e8b483> 14415\n<e8b484> 12262\n<e8b485> 5423\n<e8b488> 5581\n<e8b489> 12597\n<e8b48a> 5582\n<e8b48b> 17779\n<e8b48c> 16278\n<e8b48d> 5707\n<e8b48f> 5706\n<e8b490> 13078\n<e8b491> 14419\n<e8b492> 14414\n<e8b493> 5778\n<e8b494> 13079\n<e8b495> 13244\n<e8b498> 15983\n<e8b499> 13378\n<e8b49b> 5935\n<e8b49c> 18304\n<e8b49d> 17670\n<e8b5a4> 1295\n<e8b5a6> 2992\n<e8b5a7> 2991\n<e8b5ab> 4282\n<e8b5ac> 11422\n<e8b5ad> 4657\n<e8b5ae> 11423\n<e8b5af> 11892\n<e8b5b0> 1296\n<e8b5b2> 7174\n<e8b5b3> 2061\n<e8b5b4> 2060\n<e8b5b6> 7694\n<e8b5b7> 2510\n<e8b5b8> 7695\n<e8b5b9> 8307\n<e8b5ba> 14817\n<e8b5bb> 8306\n<e8b5bd> 8305\n<e8b680> 8961\n<e8b681> 3445\n<e8b682> 16233\n<e8b684> 8960\n<e8b685> 3444\n<e8b689> 8962\n<e8b68a> 3443\n<e8b68c> 9636\n<e8b68d> 9639\nendcidchar\n\n100 begincidchar\n<e8b690> 9642\n<e8b691> 9635\n<e8b692> 9643\n<e8b695> 4284\n<e8b696> 10255\n<e8b699> 4283\n<e8b69b> 10848\n<e8b69c> 10846\n<e8b69f> 4658\n<e8b6a0> 10845\n<e8b6a1> 10847\n<e8b6a3> 4659\n<e8b6a5> 11424\n<e8b6a6> 16375\n<e8b6a7> 11425\n<e8b6a8> 5256\n<e8b6a9> 14422\n<e8b6aa> 12599\n<e8b6ab> 12601\n<e8b6ac> 12598\n<e8b6ad> 12600\n<e8b6ae> 12861\n<e8b6af> 13080\n<e8b6b2> 13577\n<e8b6b3> 1297\n<e8b6b4> 2062\n<e8b6b5> 7696\n<e8b6b6> 7698\n<e8b6b7> 7697\n<e8b6b9> 8310\n<e8b6ba> 2994\n<e8b6bc> 8308\n<e8b6be> 2993\n<e8b6bf> 8311\n<e8b780> 17258\n<e8b781> 8312\n<e8b782> 8309\n<e8b783> 18306\n<e8b785> 8974\n<e8b786> 3453\n<e8b787> 8966\n<e8b788> 8972\n<e8b78b> 3448\n<e8b78c> 3451\n<e8b78d> 8965\n<e8b78e> 3446\n<e8b78f> 8969\n<e8b790> 9649\n<e8b791> 3450\n<e8b793> 8964\n<e8b794> 16258\n<e8b795> 8970\n<e8b796> 8967\n<e8b797> 8973\n<e8b798> 8963\n<e8b799> 8971\n<e8b79a> 3449\n<e8b79b> 3452\n<e8b79c> 8968\n<e8b79d> 3447\n<e8b79f> 3879\n<e8b7a0> 9645\n<e8b7a1> 3878\n<e8b7a2> 9652\n<e8b7a3> 9651\n<e8b7a4> 3885\n<e8b7a6> 3886\n<e8b7a7> 9653\n<e8b7a8> 3880\n<e8b7a9> 9650\n<e8b7aa> 3884\n<e8b7ab> 9655\n<e8b7ac> 9646\n<e8b7ae> 9648\n<e8b7af> 3881\n<e8b7b0> 9644\n<e8b7b1> 9647\n<e8b7b2> 9654\n<e8b7b3> 3882\n<e8b7b4> 9656\n<e8b7ba> 3883\n<e8b7bc> 4285\n<e8b7bd> 10260\n<e8b7be> 10266\n<e8b7bf> 10258\n<e8b880> 10267\n<e8b881> 16261\n<e8b882> 10257\n<e8b883> 10262\n<e8b884> 10268\n<e8b885> 10265\n<e8b886> 10264\n<e8b887> 10263\n<e8b889> 10256\n<e8b88a> 10261\n<e8b88d> 10259\n<e8b88e> 15966\n<e8b88f> 4664\n<e8b890> 4661\n<e8b891> 10857\nendcidchar\n\n100 begincidchar\n<e8b892> 10862\n<e8b893> 10864\n<e8b894> 10861\n<e8b895> 10854\n<e8b896> 10856\n<e8b897> 10866\n<e8b898> 10863\n<e8b899> 10858\n<e8b89a> 10867\n<e8b89b> 10855\n<e8b89c> 10865\n<e8b89d> 4662\n<e8b89e> 4668\n<e8b89f> 4666\n<e8b8a0> 10849\n<e8b8a1> 4667\n<e8b8a2> 4663\n<e8b8a3> 10850\n<e8b8a4> 10852\n<e8b8a5> 10851\n<e8b8a8> 16264\n<e8b8a9> 4665\n<e8b8aa> 15284\n<e8b8ab> 4660\n<e8b8ad> 16043\n<e8b8ae> 10853\n<e8b8b0> 11435\n<e8b8b1> 4962\n<e8b8b3> 11426\n<e8b8b4> 4963\n<e8b8b5> 4966\n<e8b8b6> 11431\n<e8b8b8> 11428\n<e8b8b9> 4965\n<e8b8ba> 18308\n<e8b8be> 11427\n<e8b8bf> 11436\n<e8b980> 11429\n<e8b981> 11434\n<e8b982> 4964\n<e8b984> 4961\n<e8b985> 11430\n<e8b986> 17170\n<e8b987> 11898\n<e8b988> 5259\n<e8b989> 5257\n<e8b98a> 5260\n<e8b98b> 5258\n<e8b98c> 11897\n<e8b98d> 11894\n<e8b98e> 11893\n<e8b98f> 16259\n<e8b990> 11896\n<e8b993> 11895\n<e8b994> 12278\n<e8b995> 5429\n<e8b996> 12269\n<e8b997> 12268\n<e8b999> 5424\n<e8b99a> 12274\n<e8b99b> 12273\n<e8b99c> 12265\n<e8b99d> 12276\n<e8b99e> 12270\n<e8b99f> 5428\n<e8b9a0> 12267\n<e8b9a1> 12275\n<e8b9a2> 12266\n<e8b9a3> 5425\n<e8b9a4> 5427\n<e8b9a5> 12271\n<e8b9a6> 5426\n<e8b9a7> 12272\n<e8b9a8> 17229\n<e8b9a9> 12277\n<e8b9aa> 12605\n<e8b9ac> 5587\n<e8b9ad> 12602\n<e8b9af> 12606\n<e8b9b1> 17383\n<e8b9b2> 5584\n<e8b9b3> 12604\n<e8b9b4> 5589\n<e8b9b5> 16265\n<e8b9b6> 5586\n<e8b9b7> 16255\n<e8b9b8> 12603\n<e8b9ba> 5588\n<e8b9bb> 12607\n<e8b9bc> 5583\n<e8b9be> 17188\n<e8ba80> 18637\n<e8ba81> 5709\n<e8ba82> 5711\n<e8ba84> 12864\n<e8ba85> 5710\n<e8ba86> 12862\n<e8ba87> 5585\n<e8ba88> 12863\n<e8ba89> 5708\nendcidchar\n\n100 begincidchar\n<e8ba8a> 5779\n<e8ba8b> 5781\n<e8ba8c> 13082\n<e8ba8d> 5780\n<e8ba8e> 13081\n<e8ba90> 13249\n<e8ba91> 5851\n<e8ba92> 13248\n<e8ba93> 5852\n<e8ba94> 13246\n<e8ba95> 13245\n<e8ba98> 13379\n<e8ba9a> 13247\n<e8ba9d> 13473\n<e8baa1> 5961\n<e8baa3> 13547\n<e8baa4> 13546\n<e8baa5> 13545\n<e8baa6> 13578\n<e8baa7> 15285\n<e8baa8> 13623\n<e8baa9> 13604\n<e8baaa> 5979\n<e8baab> 1298\n<e8baac> 2511\n<e8baad> 14430\n<e8bab0> 17385\n<e8bab2> 3887\n<e8bab6> 14431\n<e8bab9> 18935\n<e8baba> 4669\n<e8babc> 14496\n<e8babd> 11437\n<e8bb80> 5430\n<e8bb82> 12608\n<e8bb83> 14432\n<e8bb89> 13605\n<e8bb8a> 1299\n<e8bb8b> 1677\n<e8bb8c> 2064\n<e8bb8d> 2063\n<e8bb8e> 18312\n<e8bb8f> 2514\n<e8bb91> 7699\n<e8bb92> 2512\n<e8bb93> 7700\n<e8bb94> 2513\n<e8bb97> 8317\n<e8bb98> 8313\n<e8bb9a> 15806\n<e8bb9b> 2995\n<e8bb9c> 8316\n<e8bb9d> 8315\n<e8bb9e> 8314\n<e8bb9f> 2996\n<e8bba2> 18313\n<e8bba4> 18314\n<e8bba5> 8981\n<e8bba6> 8979\n<e8bba9> 8990\n<e8bbab> 8986\n<e8bbac> 8988\n<e8bbad> 18315\n<e8bbae> 8980\n<e8bbaf> 8975\n<e8bbb1> 8987\n<e8bbb2> 18316\n<e8bbb4> 8989\n<e8bbb5> 8982\n<e8bbb6> 8985\n<e8bbb7> 8976\n<e8bbb8> 3455\n<e8bbb9> 8978\n<e8bbba> 8977\n<e8bbbb> 3454\n<e8bbbc> 3456\n<e8bbbe> 3890\n<e8bbbf> 9658\n<e8bc80> 9660\n<e8bc81> 9659\n<e8bc82> 9664\n<e8bc83> 3888\n<e8bc85> 9661\n<e8bc86> 9657\n<e8bc89> 3889\n<e8bc8a> 3891\n<e8bc8b> 9665\n<e8bc8d> 10272\n<e8bc8e> 10271\n<e8bc92> 4287\n<e8bc93> 4289\n<e8bc94> 4286\n<e8bc95> 4288\n<e8bc98> 10870\n<e8bc99> 14434\n<e8bc9a> 10871\n<e8bc9b> 4671\n<e8bc9c> 4676\n<e8bc9d> 4670\n<e8bc9e> 4677\nendcidchar\n\n100 begincidchar\n<e8bc9f> 4672\n<e8bca0> 10872\n<e8bca3> 10873\n<e8bca4> 10869\n<e8bca5> 4678\n<e8bca6> 4674\n<e8bca9> 4673\n<e8bcaa> 4675\n<e8bcac> 10868\n<e8bcad> 14435\n<e8bcae> 11439\n<e8bcaf> 4968\n<e8bcb0> 15287\n<e8bcb2> 11441\n<e8bcb3> 4970\n<e8bcb4> 11444\n<e8bcb5> 11440\n<e8bcb6> 11438\n<e8bcb7> 11443\n<e8bcb8> 4969\n<e8bcb9> 11442\n<e8bcbb> 4967\n<e8bcbe> 5262\n<e8bcbf> 5265\n<e8bd80> 11900\n<e8bd81> 15623\n<e8bd82> 5263\n<e8bd83> 11899\n<e8bd84> 5261\n<e8bd85> 5264\n<e8bd89> 5431\n<e8bd8a> 15288\n<e8bd8b> 12282\n<e8bd8d> 5432\n<e8bd8e> 5591\n<e8bd91> 12610\n<e8bd92> 12609\n<e8bd93> 12613\n<e8bd94> 5590\n<e8bd95> 12868\n<e8bd98> 12869\n<e8bd99> 12865\n<e8bd9a> 12870\n<e8bd9b> 13084\n<e8bd9c> 16177\n<e8bd9d> 13085\n<e8bd9e> 13083\n<e8bd9f> 5782\n<e8bda0> 13252\n<e8bda1> 5853\n<e8bda2> 13253\n<e8bda3> 13381\n<e8bda4> 13380\n<e8bdae> 17771\n<e8be93> 18226\n<e8be9b> 1300\n<e8be9c> 3457\n<e8be9f> 3892\n<e8bea0> 15764\n<e8bea3> 4290\n<e8bea5> 14438\n<e8bea6> 4972\n<e8bea7> 18864\n<e8bea8> 4971\n<e8bead> 5592\n<e8beae> 5679\n<e8beaf> 5783\n<e8beb0> 1301\n<e8beb1> 2515\n<e8beb2> 3893\n<e8beb3> 14442\n<e8beb4> 12614\n<e8beb5> 560\n<e8beb6> 18387\n<e8beb7> 17405\n<e8beb8> 17142\n<e8beb9> 18633\n<e8beba> 18631\n<e8bebe> 18630\n<e8bebf> 6377\n<e8bf81> 18317\n<e8bf82> 1302\n<e8bf84> 1305\n<e8bf85> 1304\n<e8bf86> 1303\n<e8bf89> 6376\n<e8bf8a> 18318\n<e8bf8b> 6730\n<e8bf8c> 18319\n<e8bf8d> 6732\n<e8bf8e> 1678\n<e8bf8f> 18937\n<e8bf90> 18606\n<e8bf91> 1680\n<e8bf92> 6729\n<e8bf93> 6731\n<e8bf94> 1679\n<e8bf95> 6734\n<e8bf96> 6733\n<e8bf97> 6735\nendcidchar\n\n100 begincidchar\n<e8bf9a> 16331\n<e8bfa0> 7178\n<e8bfa1> 7176\n<e8bfa2> 2067\n<e8bfa3> 7175\n<e8bfa4> 2072\n<e8bfa5> 2069\n<e8bfa6> 2066\n<e8bfa8> 2073\n<e8bfaa> 2068\n<e8bfab> 2071\n<e8bfad> 2070\n<e8bfae> 7177\n<e8bfb0> 2065\n<e8bfb4> 2521\n<e8bfb5> 7702\n<e8bfb6> 7708\n<e8bfb7> 2518\n<e8bfb8> 2525\n<e8bfb9> 14449\n<e8bfba> 2520\n<e8bfbb> 7705\n<e8bfbc> 7707\n<e8bfbd> 2523\n<e8bfbe> 7701\n<e8bfbf> 7704\n<e98080> 2519\n<e98081> 2516\n<e98082> 7703\n<e98083> 2522\n<e98084> 7706\n<e98085> 2524\n<e98086> 2517\n<e98088> 16096\n<e9808b> 8321\n<e9808c> 8324\n<e9808d> 2998\n<e9808f> 3008\n<e98090> 3004\n<e98091> 8322\n<e98092> 15950\n<e98094> 3012\n<e98095> 3005\n<e98096> 3010\n<e98097> 3000\n<e98099> 2997\n<e9809a> 2999\n<e9809b> 3011\n<e9809c> 8323\n<e9809d> 3003\n<e9809e> 3006\n<e9809f> 3002\n<e980a0> 3007\n<e980a1> 8325\n<e980a2> 3009\n<e980a3> 3001\n<e980a4> 8320\n<e980ad> 8991\n<e980ae> 3458\n<e980af> 8993\n<e980b1> 3460\n<e980b2> 3462\n<e980b3> 18320\n<e980b4> 8992\n<e980b5> 3459\n<e980b6> 3463\n<e980b7> 14454\n<e980b8> 3461\n<e980bc> 3899\n<e980bd> 9670\n<e980be> 3907\n<e980bf> 9667\n<e98181> 3908\n<e98182> 3897\n<e98184> 9668\n<e98186> 19121\n<e98187> 3902\n<e98189> 9669\n<e9818a> 3895\n<e9818b> 3894\n<e9818c> 16144\n<e9818d> 3905\n<e9818e> 3904\n<e9818f> 3903\n<e98190> 3901\n<e98191> 3906\n<e98192> 9666\n<e98193> 3896\n<e98194> 3898\n<e98195> 3900\n<e98196> 15826\n<e98198> 4292\n<e98199> 4295\n<e9819b> 4299\n<e9819c> 4293\n<e9819d> 4298\n<e9819e> 4296\n<e981a0> 4291\n<e981a1> 14457\n<e981a2> 4297\nendcidchar\n\n100 begincidchar\n<e981a3> 4294\n<e981a4> 15464\n<e981a7> 10879\n<e981a8> 4681\n<e981a9> 4679\n<e981ab> 10880\n<e981ac> 15712\n<e981ad> 4682\n<e981ae> 4680\n<e981af> 10878\n<e981b0> 10877\n<e981b2> 4976\n<e981b3> 10876\n<e981b4> 4974\n<e981b5> 4973\n<e981b6> 11445\n<e981b7> 4683\n<e981b8> 4975\n<e981b9> 11446\n<e981ba> 4978\n<e981bb> 11447\n<e981bc> 4977\n<e981bd> 5267\n<e981be> 11902\n<e981bf> 5266\n<e98280> 5271\n<e98283> 5434\n<e98284> 5268\n<e98285> 11901\n<e98286> 11448\n<e98287> 5433\n<e98288> 5435\n<e9828d> 12871\n<e9828f> 5900\n<e98290> 5899\n<e98291> 1307\n<e98294> 6174\n<e98295> 2526\n<e98299> 6170\n<e9829b> 6173\n<e9829e> 6381\n<e9829f> 6378\n<e982a0> 6383\n<e982a1> 6379\n<e982a2> 1308\n<e982a3> 1311\n<e982a5> 6380\n<e982a6> 1310\n<e982a7> 6382\n<e982a8> 14460\n<e982aa> 1309\n<e982ae> 14464\n<e982af> 6738\n<e982b0> 6740\n<e982b1> 1683\n<e982b2> 6736\n<e982b3> 6739\n<e982b4> 6737\n<e982b5> 1681\n<e982b6> 1684\n<e982b8> 1682\n<e982bb> 15300\n<e982bd> 7180\n<e982be> 7184\n<e982bf> 7181\n<e98381> 2076\n<e98383> 2077\n<e98384> 14462\n<e98385> 7183\n<e98387> 7185\n<e98388> 7187\n<e9838a> 2074\n<e9838b> 7186\n<e9838e> 2075\n<e98394> 8332\n<e98395> 7182\n<e98396> 7709\n<e98397> 7718\n<e98398> 7716\n<e9839b> 7717\n<e9839c> 7719\n<e9839d> 2528\n<e9839f> 7714\n<e983a0> 7710\n<e983a1> 2527\n<e983a2> 2529\n<e983a3> 7713\n<e983a4> 7720\n<e983a5> 7715\n<e983a8> 3013\n<e983a9> 8335\n<e983aa> 8327\n<e983ad> 3014\n<e983af> 8326\n<e983b0> 8328\n<e983b1> 7179\n<e983b4> 8329\n<e983b5> 3465\n<e983b9> 9000\n<e983ba> 11449\nendcidchar\n\n100 begincidchar\n<e983bb> 9001\n<e983bc> 8998\n<e983bd> 3015\n<e983be> 3467\n<e983bf> 8997\n<e98480> 9003\n<e98481> 9002\n<e98482> 3464\n<e98483> 9006\n<e98484> 8996\n<e98485> 9005\n<e98486> 8994\n<e98487> 9004\n<e98488> 8999\n<e98489> 3466\n<e9848b> 9677\n<e9848d> 9672\n<e9848e> 9678\n<e9848f> 9673\n<e98490> 9671\n<e98491> 9674\n<e98492> 3909\n<e98494> 9676\n<e98496> 9675\n<e98497> 3910\n<e98498> 4301\n<e98499> 4300\n<e9849a> 10279\n<e9849b> 10282\n<e9849c> 10274\n<e9849d> 10278\n<e9849e> 4302\n<e9849f> 10277\n<e984a0> 10275\n<e984a1> 10281\n<e984a2> 10276\n<e984a3> 10273\n<e984a4> 10280\n<e984a6> 10886\n<e984a7> 4686\n<e984a8> 12283\n<e984ab> 10882\n<e984ac> 8995\n<e984ad> 4685\n<e984ae> 10887\n<e984af> 10881\n<e984b0> 4684\n<e984b1> 4687\n<e984b2> 10885\n<e984b3> 11450\n<e984b4> 4979\n<e984b8> 11903\n<e984b9> 5272\n<e984be> 12286\n<e984bf> 12616\n<e98580> 12615\n<e98581> 12873\n<e98583> 12872\n<e98586> 13086\n<e98587> 13254\n<e98588> 5854\n<e98589> 1312\n<e9858a> 2079\n<e9858b> 2078\n<e9858c> 2532\n<e9858d> 2531\n<e98590> 7721\n<e98591> 16201\n<e98592> 2530\n<e98593> 8339\n<e98595> 8340\n<e98596> 8336\n<e98597> 3016\n<e98598> 8337\n<e98599> 16197\n<e9859a> 8338\n<e9859c> 16199\n<e9859e> 17387\n<e9859f> 9009\n<e985a0> 9011\n<e985a1> 9007\n<e985a2> 9010\n<e985a3> 3468\n<e985a4> 9008\n<e985a5> 3469\n<e985a7> 14466\n<e985a8> 9186\n<e985a9> 3913\n<e985aa> 3912\n<e985ac> 3911\n<e985b0> 16056\n<e985b2> 10284\n<e985b3> 10286\n<e985b4> 4306\n<e985b5> 4303\n<e985b6> 16027\n<e985b7> 4305\n<e985b8> 4304\n<e985b9> 10285\n<e985ba> 10283\nendcidchar\n\n100 begincidchar\n<e985bc> 16239\n<e98680> 10894\n<e98683> 4691\n<e98684> 10893\n<e98687> 4688\n<e98689> 4689\n<e9868a> 10890\n<e9868b> 4690\n<e9868c> 17388\n<e9868d> 11456\n<e9868e> 16206\n<e9868f> 11457\n<e98692> 4980\n<e98693> 11453\n<e98699> 11907\n<e9869a> 11904\n<e9869b> 11906\n<e9869c> 5275\n<e9869d> 11910\n<e9869e> 5274\n<e9869f> 11908\n<e986a0> 11911\n<e986a1> 11909\n<e986a2> 11905\n<e986a3> 5273\n<e986a5> 12288\n<e986a7> 12289\n<e986a8> 12287\n<e986a9> 14467\n<e986aa> 12291\n<e986ad> 12618\n<e986ae> 5596\n<e986af> 12290\n<e986b0> 12617\n<e986b1> 5595\n<e986b4> 5712\n<e986b5> 12875\n<e986b6> 17903\n<e986b7> 12874\n<e986b9> 13089\n<e986ba> 5784\n<e986bb> 15304\n<e986bc> 13382\n<e986bd> 13475\n<e986be> 13474\n<e98780> 5936\n<e98781> 5962\n<e98782> 13476\n<e98783> 13579\n<e98784> 14468\n<e98785> 5980\n<e98786> 1313\n<e98787> 1685\n<e98789> 3914\n<e9878b> 5713\n<e9878c> 1314\n<e9878d> 2080\n<e9878e> 3017\n<e9878f> 3470\n<e98790> 5438\n<e98791> 1686\n<e98793> 7189\n<e98794> 7188\n<e98795> 7724\n<e98796> 16734\n<e98797> 2535\n<e98798> 2533\n<e98799> 2537\n<e9879a> 7726\n<e9879c> 2536\n<e9879d> 2534\n<e9879f> 17722\n<e987a2> 7725\n<e987a3> 3020\n<e987a4> 8346\n<e987a5> 15366\n<e987a6> 3019\n<e987a7> 3021\n<e987a8> 8351\n<e987a9> 3023\n<e987ac> 8341\n<e987ad> 3022\n<e987ae> 8352\n<e987b1> 8343\n<e987b3> 8344\n<e987b4> 8342\n<e987b5> 3018\n<e987b6> 18865\n<e987b7> 8350\n<e987b8> 8345\n<e987b9> 8347\n<e987ba> 15096\n<e987bd> 9023\n<e987be> 14382\n<e987bf> 9022\n<e98880> 9020\n<e98881> 9012\n<e98882> 9027\n<e98883> 9015\n<e98884> 9025\nendcidchar\n\n100 begincidchar\n<e98885> 9032\n<e98886> 9024\n<e98887> 3478\n<e98888> 16057\n<e98889> 3474\n<e9888a> 9013\n<e9888c> 9019\n<e9888d> 3476\n<e9888e> 14472\n<e9888f> 9018\n<e98890> 3477\n<e98891> 3479\n<e98892> 9021\n<e98893> 18323\n<e98896> 9033\n<e98897> 9031\n<e98898> 19110\n<e98899> 9030\n<e9889a> 9016\n<e9889c> 9028\n<e9889e> 3475\n<e988a1> 18940\n<e988a3> 3473\n<e988a4> 9029\n<e988a5> 9014\n<e988a6> 9017\n<e988a7> 9026\n<e988a8> 18325\n<e988aa> 15374\n<e988ab> 15270\n<e988ad> 10321\n<e988ae> 9690\n<e988b0> 9683\n<e988b1> 9702\n<e988b2> 9711\n<e988b3> 9686\n<e988b4> 3925\n<e988b5> 15142\n<e988b6> 9699\n<e988b7> 3915\n<e988b8> 3917\n<e988b9> 3929\n<e988ba> 9684\n<e988bc> 16850\n<e988bd> 3918\n<e988be> 3920\n<e988bf> 3930\n<e98980> 3919\n<e98981> 14474\n<e98984> 14490\n<e98985> 3928\n<e98986> 9692\n<e98988> 9681\n<e98989> 3926\n<e9898a> 9691\n<e9898b> 3922\n<e9898c> 9709\n<e9898d> 3927\n<e9898e> 9707\n<e9898f> 9695\n<e98990> 9705\n<e98991> 3924\n<e98992> 9682\n<e98993> 9708\n<e98994> 9703\n<e98995> 15943\n<e98996> 9710\n<e98997> 3916\n<e98998> 18326\n<e9899a> 3931\n<e9899b> 3921\n<e9899d> 14851\n<e9899e> 9688\n<e9899f> 15584\n<e989a0> 9696\n<e989a1> 9700\n<e989a2> 14475\n<e989a3> 9704\n<e989a4> 3923\n<e989a5> 9687\n<e989a6> 9685\n<e989a7> 9697\n<e989ab> 18327\n<e989ac> 9694\n<e989ad> 9693\n<e989ae> 15621\n<e989af> 9698\n<e989b0> 9701\n<e989b2> 9706\n<e989b6> 10289\n<e989b7> 15460\n<e989b8> 4307\n<e989b9> 10299\n<e989ba> 10291\n<e989bb> 4313\n<e989bc> 4317\n<e989bd> 10308\n<e989be> 10316\n<e989bf> 10301\n<e98a80> 4309\nendcidchar\n\n100 begincidchar\n<e98a81> 15873\n<e98a82> 10305\n<e98a83> 9689\n<e98a84> 15545\n<e98a85> 4310\n<e98a86> 10312\n<e98a87> 10317\n<e98a88> 10309\n<e98a89> 15029\n<e98a8a> 10311\n<e98a8b> 10320\n<e98a8c> 10313\n<e98a8d> 10295\n<e98a8e> 10304\n<e98a8f> 18109\n<e98a91> 4318\n<e98a93> 4314\n<e98a94> 10293\n<e98a95> 10306\n<e98a96> 4312\n<e98a97> 10300\n<e98a98> 4311\n<e98a99> 10314\n<e98a9a> 10297\n<e98a9b> 10290\n<e98a9c> 4315\n<e98a9d> 10319\n<e98aa0> 10292\n<e98aa1> 10310\n<e98aa2> 10307\n<e98aa3> 10302\n<e98aa4> 10288\n<e98aa5> 10287\n<e98aa6> 10296\n<e98aa7> 10315\n<e98aa8> 4316\n<e98aa9> 10318\n<e98aaa> 10294\n<e98aab> 10298\n<e98aac> 4308\n<e98aae> 18329\n<e98ab1> 18328\n<e98ab2> 4703\n<e98ab3> 4698\n<e98ab4> 10928\n<e98ab5> 10924\n<e98ab6> 10900\n<e98ab7> 4694\n<e98ab9> 14057\n<e98aba> 15349\n<e98abb> 4693\n<e98abc> 4699\n<e98abe> 15456\n<e98abf> 18330\n<e98b80> 10898\n<e98b81> 4697\n<e98b82> 10910\n<e98b85> 4692\n<e98b86> 10927\n<e98b87> 4701\n<e98b88> 10913\n<e98b89> 10918\n<e98b8a> 10912\n<e98b8b> 11475\n<e98b8c> 10908\n<e98b8d> 10916\n<e98b8e> 10914\n<e98b8f> 10901\n<e98b90> 10895\n<e98b91> 10922\n<e98b92> 4700\n<e98b93> 10923\n<e98b94> 14433\n<e98b95> 10917\n<e98b97> 10906\n<e98b98> 10904\n<e98b99> 10899\n<e98b9b> 16396\n<e98b9d> 10907\n<e98b9e> 10920\n<e98b9f> 10903\n<e98ba0> 10919\n<e98ba1> 10925\n<e98ba3> 18331\n<e98ba4> 4696\n<e98ba5> 15522\n<e98ba6> 10915\n<e98ba7> 10921\n<e98ba8> 10911\n<e98ba9> 10905\n<e98baa> 4695\n<e98bab> 18332\n<e98bac> 14692\n<e98bae> 10303\n<e98baf> 10909\n<e98bb0> 4702\n<e98bb1> 10902\n<e98bb2> 15026\n<e98bb6> 15364\n<e98bb7> 11480\nendcidchar\n\n100 begincidchar\n<e98bb8> 4983\n<e98bb9> 11479\n<e98bba> 11477\n<e98bbb> 11495\n<e98bbc> 4987\n<e98bbd> 18335\n<e98bbe> 11492\n<e98bbf> 11484\n<e98c80> 11494\n<e98c81> 11470\n<e98c82> 11482\n<e98c83> 14439\n<e98c84> 4989\n<e98c86> 11462\n<e98c87> 15121\n<e98c88> 11460\n<e98c89> 11493\n<e98c8b> 11491\n<e98c8c> 11490\n<e98c8d> 11474\n<e98c8e> 11473\n<e98c8f> 11463\n<e98c90> 4991\n<e98c92> 11469\n<e98c93> 11478\n<e98c94> 11489\n<e98c95> 4994\n<e98c96> 11496\n<e98c98> 5283\n<e98c99> 4996\n<e98c9a> 4990\n<e98c9b> 11467\n<e98c9d> 11476\n<e98c9e> 11459\n<e98c9f> 11461\n<e98ca0> 4981\n<e98ca1> 4993\n<e98ca2> 4986\n<e98ca3> 11468\n<e98ca4> 11483\n<e98ca5> 10926\n<e98ca6> 4992\n<e98ca7> 11458\n<e98ca8> 5278\n<e98ca9> 11485\n<e98caa> 11488\n<e98cab> 4988\n<e98cac> 14482\n<e98cad> 11472\n<e98cae> 4995\n<e98caf> 4985\n<e98cb0> 15875\n<e98cb1> 15549\n<e98cb3> 4984\n<e98cb4> 11481\n<e98cb5> 11487\n<e98cb6> 4982\n<e98cb8> 11465\n<e98cb9> 11486\n<e98cbc> 11466\n<e98d80> 16725\n<e98d81> 17015\n<e98d82> 15098\n<e98d83> 18336\n<e98d84> 16406\n<e98d85> 15988\n<e98d86> 11471\n<e98d87> 11917\n<e98d88> 15457\n<e98d89> 11922\n<e98d8a> 5280\n<e98d8b> 5282\n<e98d8c> 11928\n<e98d8d> 5276\n<e98d8e> 11942\n<e98d8f> 11934\n<e98d92> 11933\n<e98d94> 5289\n<e98d95> 11932\n<e98d96> 11916\n<e98d97> 11931\n<e98d98> 11919\n<e98d99> 11943\n<e98d9a> 5288\n<e98d9b> 5286\n<e98d9c> 11920\n<e98d9e> 11939\n<e98d9f> 15547\n<e98da0> 11925\n<e98da1> 11938\n<e98da2> 17000\n<e98da3> 11940\n<e98da4> 11915\n<e98da5> 5281\n<e98da6> 18108\n<e98da7> 11941\n<e98da8> 15344\n<e98da9> 14689\n<e98daa> 11929\n<e98dab> 14483\nendcidchar\n\n100 begincidchar\n<e98dac> 5285\n<e98dad> 11926\n<e98dae> 16300\n<e98db0> 5287\n<e98db1> 11935\n<e98db3> 14494\n<e98db4> 15588\n<e98db5> 5279\n<e98db6> 11921\n<e98db7> 11936\n<e98db8> 14585\n<e98db9> 11930\n<e98dba> 11464\n<e98dbb> 11937\n<e98dbc> 11918\n<e98dbd> 15397\n<e98dbe> 5284\n<e98e80> 12308\n<e98e81> 14693\n<e98e82> 5277\n<e98e83> 11913\n<e98e84> 18337\n<e98e85> 17085\n<e98e86> 15552\n<e98e87> 15072\n<e98e88> 12305\n<e98e89> 12298\n<e98e8a> 5440\n<e98e8c> 12293\n<e98e8d> 12309\n<e98e8e> 12300\n<e98e8f> 11927\n<e98e90> 15676\n<e98e91> 12311\n<e98e92> 12294\n<e98e94> 5439\n<e98e95> 12304\n<e98e96> 5441\n<e98e97> 5449\n<e98e98> 5447\n<e98e99> 12306\n<e98e9a> 5448\n<e98e9b> 12296\n<e98e9c> 14764\n<e98e9d> 12297\n<e98e9e> 12302\n<e98e9f> 12307\n<e98ea0> 15025\n<e98ea1> 11912\n<e98ea2> 5442\n<e98ea3> 12316\n<e98ea4> 12313\n<e98ea5> 12640\n<e98ea6> 12303\n<e98ea7> 12299\n<e98ea8> 12314\n<e98ea9> 12629\n<e98eaa> 12301\n<e98eac> 5445\n<e98ead> 18338\n<e98eae> 5444\n<e98eaf> 11914\n<e98eb0> 5446\n<e98eb1> 12310\n<e98eb2> 12312\n<e98eb3> 5443\n<e98eb4> 12315\n<e98eb5> 12292\n<e98eb7> 12295\n<e98eb8> 15504\n<e98eba> 17399\n<e98ebb> 15503\n<e98ebd> 14887\n<e98ebf> 15917\n<e98f80> 12638\n<e98f82> 12622\n<e98f83> 5600\n<e98f84> 12636\n<e98f86> 18106\n<e98f87> 12620\n<e98f88> 5601\n<e98f8a> 12631\n<e98f8b> 14694\n<e98f8c> 12627\n<e98f8d> 5606\n<e98f8e> 12637\n<e98f8f> 12621\n<e98f90> 12624\n<e98f91> 5598\n<e98f92> 12639\n<e98f93> 16609\n<e98f94> 12632\n<e98f95> 12635\n<e98f96> 5604\n<e98f97> 5609\n<e98f98> 5607\n<e98f99> 12628\n<e98f9a> 12623\n<e98f9b> 15455\n<e98f9e> 12619\nendcidchar\n\n100 begincidchar\n<e98f9f> 5599\n<e98fa0> 14880\n<e98fa1> 5597\n<e98fa2> 5605\n<e98fa3> 12634\n<e98fa4> 5608\n<e98fa6> 12630\n<e98fa7> 12641\n<e98fa8> 5610\n<e98fac> 12626\n<e98fae> 12633\n<e98fb0> 16959\n<e98fb1> 17066\n<e98fb3> 14690\n<e98fb4> 18890\n<e98fb5> 12890\n<e98fb6> 12905\n<e98fb7> 12892\n<e98fb8> 12899\n<e98fb9> 12625\n<e98fba> 12897\n<e98fbb> 12880\n<e98fbc> 12903\n<e98fbd> 5716\n<e98fbe> 12884\n<e98fbf> 12902\n<e99080> 12891\n<e99081> 15572\n<e99083> 5715\n<e99084> 15305\n<e99086> 12907\n<e99087> 12893\n<e99088> 14885\n<e99089> 12898\n<e9908a> 12901\n<e9908b> 12878\n<e9908c> 12904\n<e9908d> 12889\n<e9908e> 12894\n<e9908f> 12882\n<e99090> 12886\n<e99091> 12906\n<e99092> 12896\n<e99093> 12879\n<e99094> 12883\n<e99095> 12885\n<e99096> 12895\n<e99097> 18341\n<e99098> 5714\n<e99099> 12888\n<e9909b> 16712\n<e9909d> 18342\n<e990a0> 12881\n<e990a4> 14659\n<e990a5> 14544\n<e990a6> 14499\n<e990a7> 15309\n<e990a8> 12887\n<e990a9> 13093\n<e990aa> 13097\n<e990ab> 5791\n<e990ac> 13099\n<e990ad> 18343\n<e990ae> 5785\n<e990af> 19105\n<e990b0> 13095\n<e990b1> 13101\n<e990b2> 5790\n<e990b3> 5786\n<e990b5> 5787\n<e990b6> 13092\n<e990b7> 13098\n<e990b8> 5789\n<e990b9> 13096\n<e990ba> 5788\n<e990bb> 13091\n<e990bc> 12900\n<e990bd> 13094\n<e990be> 18344\n<e990bf> 13090\n<e99180> 13100\n<e99182> 17010\n<e99183> 17013\n<e99184> 5855\n<e99185> 13261\n<e99186> 13264\n<e99187> 13260\n<e9918c> 13255\n<e9918d> 15461\n<e9918f> 13259\n<e99190> 13256\n<e99194> 18346\n<e99195> 13384\n<e99197> 13386\n<e99198> 15408\n<e9919b> 14495\n<e9919d> 13385\n<e9919e> 13387\n<e991a0> 5902\n<e991a2> 13383\nendcidchar\n\n100 begincidchar\n<e991a3> 5901\n<e991a4> 5903\n<e991a5> 15838\n<e991a7> 15032\n<e991aa> 5937\n<e991ab> 13477\n<e991ac> 14206\n<e991ad> 13549\n<e991ae> 13548\n<e991af> 13550\n<e991b0> 5964\n<e991b1> 13551\n<e991b2> 5963\n<e991b3> 13552\n<e991b4> 13580\n<e991b5> 13583\n<e991b6> 13582\n<e991b7> 5973\n<e991b8> 13581\n<e991b9> 18347\n<e991bb> 16795\n<e991bc> 5983\n<e991bf> 5988\n<e99282> 13624\n<e99283> 13632\n<e99285> 17671\n<e9929f> 18565\n<e992a2> 17691\n<e99381> 18401\n<e99383> 18399\n<e9939c> 18391\n<e993b6> 18386\n<e994ad> 18348\n<e99587> 18623\n<e995b7> 1687\n<e995b8> 17672\n<e995ba> 8353\n<e995bb> 9034\n<e995bc> 10929\n<e995bd> 12642\n<e995bf> 17673\n<e99680> 1688\n<e99682> 2081\n<e99683> 2538\n<e99685> 14497\n<e99686> 8354\n<e99688> 8355\n<e99689> 3024\n<e9968b> 3482\n<e9968c> 9036\n<e9968d> 9035\n<e9968e> 3486\n<e9968f> 3481\n<e99690> 9037\n<e99691> 3483\n<e99692> 3485\n<e99693> 3484\n<e99694> 3480\n<e99696> 15317\n<e99697> 15316\n<e99698> 3932\n<e99699> 15314\n<e9969b> 9715\n<e9969c> 9713\n<e9969e> 9714\n<e9969f> 9712\n<e996a0> 14500\n<e996a1> 4319\n<e996a2> 18349\n<e996a3> 4322\n<e996a4> 4324\n<e996a5> 4323\n<e996a6> 14498\n<e996a7> 15315\n<e996aa> 17301\n<e996ab> 10931\n<e996ac> 10930\n<e996ad> 4704\n<e996ae> 10932\n<e996b0> 10933\n<e996b1> 4705\n<e996b5> 11504\n<e996b6> 11502\n<e996b7> 11949\n<e996bb> 4997\n<e996bc> 11497\n<e996bd> 11505\n<e996be> 11499\n<e996bf> 11503\n<e99780> 11945\n<e99783> 11947\n<e99785> 11948\n<e99786> 5294\n<e99787> 11944\n<e99788> 5293\n<e99789> 11946\n<e9978d> 11498\n<e99790> 5452\n<e99791> 12319\n<e99794> 5450\nendcidchar\n\n100 begincidchar\n<e99795> 5453\n<e99796> 5451\n<e9979c> 5611\n<e9979e> 12908\n<e9979f> 12910\n<e997a0> 12909\n<e997a1> 5717\n<e997a2> 5792\n<e997a3> 13104\n<e997a4> 13103\n<e997a5> 13102\n<e997a8> 17674\n<e997b4> 18351\n<e9989c> 1689\n<e9989d> 17689\n<e9989e> 6068\n<e998a0> 6177\n<e998a1> 1044\n<e998a2> 6175\n<e998a3> 6178\n<e998a4> 6176\n<e998a8> 6385\n<e998aa> 1318\n<e998ac> 1319\n<e998ad> 6387\n<e998ae> 1316\n<e998af> 6386\n<e998b0> 6384\n<e998b1> 1317\n<e998b2> 1315\n<e998b3> 18352\n<e998b8> 16337\n<e998b9> 6741\n<e998ba> 6744\n<e998bb> 1692\n<e998bc> 6743\n<e998bd> 6742\n<e998bf> 1691\n<e99980> 1690\n<e99981> 16189\n<e99982> 1694\n<e99983> 6745\n<e99984> 1693\n<e99985> 18290\n<e9998a> 7194\n<e9998e> 7195\n<e9998f> 7191\n<e99990> 2082\n<e99991> 7192\n<e99993> 7193\n<e99994> 7190\n<e99996> 15847\n<e99998> 2545\n<e9999b> 2542\n<e9999c> 7727\n<e9999d> 2543\n<e9999e> 2546\n<e9999f> 7728\n<e999a1> 2541\n<e999a4> 2544\n<e999a9> 18270\n<e999aa> 3025\n<e999ab> 8358\n<e999ac> 3033\n<e999ad> 8357\n<e999af> 8360\n<e999b0> 3029\n<e999b1> 8359\n<e999b2> 3494\n<e999b3> 3027\n<e999b4> 3030\n<e999b5> 3026\n<e999b8> 3028\n<e999bb> 14508\n<e999bc> 8356\n<e999bd> 3490\n<e999be> 9039\n<e99a80> 9043\n<e99a81> 16198\n<e99a83> 9042\n<e99a84> 3495\n<e99a87> 9038\n<e99a8a> 3487\n<e99a8b> 3489\n<e99a8d> 3493\n<e99a8e> 3488\n<e99a8f> 15326\n<e99a91> 9718\n<e99a96> 14509\n<e99a97> 9719\n<e99a98> 3933\n<e99a99> 4325\n<e99a9b> 4327\n<e99a9c> 4326\n<e99a9e> 10322\n<e99aa1> 10323\n<e99aa2> 10935\n<e99aa3> 14511\n<e99aa4> 10934\n<e99aa5> 17135\nendcidchar\n\n100 begincidchar\n<e99aa9> 11506\n<e99aaa> 5000\n<e99aac> 11952\n<e99aae> 11950\n<e99ab0> 11951\n<e99ab1> 5295\n<e99ab3> 12320\n<e99ab4> 5612\n<e99ab6> 561\n<e99ab8> 5296\n<e99ab9> 1695\n<e99abb> 2547\n<e99abc> 7729\n<e99abd> 14517\n<e99abf> 8361\n<e99b80> 3034\n<e99b81> 3496\n<e99b82> 9044\n<e99b83> 9046\n<e99b84> 3498\n<e99b85> 3497\n<e99b88> 9045\n<e99b8b> 3937\n<e99b8c> 4328\n<e99b8d> 3936\n<e99b8e> 9720\n<e99b92> 4329\n<e99b93> 10936\n<e99b94> 11507\n<e99b95> 5001\n<e99b96> 5297\n<e99b97> 12321\n<e99b98> 12325\n<e99b99> 5456\n<e99b9a> 12322\n<e99b9b> 5457\n<e99b9c> 5455\n<e99b9d> 12326\n<e99b9e> 5458\n<e99b9f> 12324\n<e99ba1> 12645\n<e99ba2> 5454\n<e99ba3> 5613\n<e99ba5> 13480\n<e99ba8> 1696\n<e99ba9> 3036\n<e99baa> 3035\n<e99baf> 3501\n<e99bb0> 9048\n<e99bb1> 9047\n<e99bb2> 3502\n<e99bb4> 14852\n<e99bb5> 9724\n<e99bb6> 3943\n<e99bb7> 3940\n<e99bb8> 9723\n<e99bb9> 3942\n<e99bba> 9721\n<e99bbb> 3941\n<e99bbd> 9722\n<e99bbf> 10324\n<e99c80> 4330\n<e99c82> 10939\n<e99c83> 16141\n<e99c84> 4706\n<e99c85> 10937\n<e99c88> 10938\n<e99c89> 4709\n<e99c8b> 11508\n<e99c8d> 5005\n<e99c8e> 5002\n<e99c8f> 5007\n<e99c90> 11510\n<e99c91> 5003\n<e99c92> 11509\n<e99c93> 5006\n<e99c96> 5004\n<e99c98> 11955\n<e99c99> 11957\n<e99c9b> 14537\n<e99c9c> 5298\n<e99c9d> 11956\n<e99c9e> 5299\n<e99c9f> 11954\n<e99ca0> 11953\n<e99ca1> 16307\n<e99ca2> 12328\n<e99ca3> 12327\n<e99ca4> 5459\n<e99ca5> 12329\n<e99ca6> 12650\n<e99ca7> 5615\n<e99ca8> 12649\n<e99ca9> 12646\n<e99caa> 5614\n<e99cb0> 5718\n<e99cb1> 14528\n<e99cb2> 5795\n<e99cb4> 19007\n<e99cb5> 13105\nendcidchar\n\n100 begincidchar\n<e99cb6> 14530\n<e99cba> 13106\n<e99cbf> 13265\n<e99d80> 18355\n<e99d81> 15337\n<e99d82> 5938\n<e99d83> 13482\n<e99d84> 5940\n<e99d86> 13481\n<e99d87> 13483\n<e99d88> 5939\n<e99d89> 13553\n<e99d8a> 19109\n<e99d8b> 13606\n<e99d91> 17635\n<e99d92> 1697\n<e99d95> 18886\n<e99d96> 3944\n<e99d97> 14540\n<e99d98> 10325\n<e99d9a> 10940\n<e99d9d> 15919\n<e99d9e> 1698\n<e99d9f> 14543\n<e99da0> 4710\n<e99da1> 5616\n<e99da2> 2086\n<e99da6> 5010\n<e99da8> 5904\n<e99da9> 2087\n<e99daa> 8362\n<e99dac> 9049\n<e99dad> 16023\n<e99dae> 9051\n<e99db0> 9050\n<e99db1> 18123\n<e99db2> 9728\n<e99db3> 9725\n<e99db4> 3945\n<e99db6> 3946\n<e99dba> 10327\n<e99dbb> 10332\n<e99dbc> 4331\n<e99dbd> 10326\n<e99dbe> 10328\n<e99dbf> 10335\n<e99e80> 10330\n<e99e81> 10334\n<e99e82> 10331\n<e99e83> 10329\n<e99e84> 10333\n<e99e85> 4332\n<e99e87> 16576\n<e99e88> 10943\n<e99e89> 14548\n<e99e8a> 10941\n<e99e8b> 4712\n<e99e8d> 4711\n<e99e8e> 10942\n<e99e8f> 4713\n<e99e94> 11513\n<e99e97> 11512\n<e99e98> 5011\n<e99e99> 11511\n<e99e9a> 11958\n<e99e9b> 15355\n<e99e9c> 11960\n<e99e9d> 11962\n<e99e9e> 11961\n<e99e9f> 14549\n<e99ea0> 5300\n<e99ea1> 11959\n<e99ea2> 12336\n<e99ea3> 5460\n<e99ea4> 12334\n<e99ea5> 12337\n<e99ea6> 5461\n<e99ea8> 12332\n<e99eaa> 12335\n<e99eab> 12333\n<e99eac> 12330\n<e99ead> 5462\n<e99eae> 12331\n<e99eb1> 14550\n<e99eb2> 18357\n<e99eb3> 12651\n<e99eb4> 16179\n<e99eb6> 12653\n<e99eb7> 12652\n<e99eb8> 15765\n<e99eb9> 12913\n<e99eba> 16181\n<e99ebb> 12914\n<e99ebd> 18766\n<e99ebe> 14551\n<e99ebf> 13107\n<e99f80> 14552\n<e99f81> 5861\n<e99f82> 18358\n<e99f83> 5860\nendcidchar\n\n100 begincidchar\n<e99f86> 5941\n<e99f87> 13484\n<e99f88> 16175\n<e99f89> 5974\n<e99f8b> 2088\n<e99f8c> 3503\n<e99f8d> 10337\n<e99f8e> 10336\n<e99f8f> 10945\n<e99f90> 10944\n<e99f92> 14553\n<e99f93> 5301\n<e99f94> 11964\n<e99f95> 11963\n<e99f96> 12340\n<e99f97> 12338\n<e99f98> 12341\n<e99f99> 12339\n<e99f9c> 5617\n<e99fa0> 14554\n<e99fa1> 13108\n<e99fa3> 13266\n<e99fa5> 13485\n<e99fa6> 17676\n<e99fad> 2089\n<e99fae> 14556\n<e99fb0> 11514\n<e99fb1> 11965\n<e99fb2> 14669\n<e99fb3> 2090\n<e99fb5> 14560\n<e99fb6> 4333\n<e99fb8> 11515\n<e99fb9> 5463\n<e99fba> 12342\n<e99fbb> 5618\n<e99fbf> 5796\n<e9a080> 13390\n<e9a081> 2091\n<e9a084> 8363\n<e9a087> 9052\n<e9a088> 3506\n<e9a08a> 3950\n<e9a08c> 3952\n<e9a08f> 9729\n<e9a092> 3951\n<e9a093> 3949\n<e9a094> 18770\n<e9a095> 17212\n<e9a096> 10338\n<e9a09b> 10952\n<e9a09c> 4716\n<e9a09d> 10947\n<e9a09e> 10946\n<e9a09f> 15362\n<e9a0a0> 10951\n<e9a0a1> 4714\n<e9a0a3> 15927\n<e9a0a4> 5018\n<e9a0a6> 10948\n<e9a0a7> 10953\n<e9a0a8> 10950\n<e9a0a9> 10949\n<e9a0ab> 4715\n<e9a0ad> 5016\n<e9a0ae> 16242\n<e9a0af> 11517\n<e9a0b0> 5012\n<e9a0b2> 11518\n<e9a0b3> 14565\n<e9a0b4> 14564\n<e9a0b5> 11516\n<e9a0b7> 5015\n<e9a0b8> 5013\n<e9a0b9> 5017\n<e9a0bb> 5014\n<e9a181> 11966\n<e9a183> 11971\n<e9a184> 11967\n<e9a185> 11970\n<e9a186> 5302\n<e9a187> 15766\n<e9a188> 11762\n<e9a189> 11969\n<e9a18a> 11968\n<e9a18b> 14566\n<e9a18c> 5466\n<e9a18d> 5464\n<e9a18e> 5467\n<e9a18f> 5465\n<e9a193> 5468\n<e9a196> 19054\n<e9a197> 12660\n<e9a198> 5620\n<e9a199> 12658\n<e9a19b> 5621\n<e9a19c> 12657\n<e9a19d> 12659\n<e9a19e> 5619\n<e9a19f> 12920\nendcidchar\n\n100 begincidchar\n<e9a1a0> 12917\n<e9a1a4> 13109\n<e9a1a5> 5798\n<e9a1a6> 14567\n<e9a1a7> 5797\n<e9a1a8> 18947\n<e9a1a9> 13268\n<e9a1aa> 13267\n<e9a1ab> 5862\n<e9a1ac> 16437\n<e9a1af> 5905\n<e9a1b0> 5942\n<e9a1b1> 5965\n<e9a1b2> 13554\n<e9a1b5> 17677\n<e9a2a8> 2092\n<e9a2a9> 9053\n<e9a2ac> 9732\n<e9a2af> 4336\n<e9a2b1> 4337\n<e9a2b2> 10954\n<e9a2b3> 4717\n<e9a2b4> 16243\n<e9a2b6> 5303\n<e9a2b7> 14575\n<e9a2b8> 12346\n<e9a2b9> 18360\n<e9a2ba> 5469\n<e9a2bb> 12663\n<e9a2bc> 5622\n<e9a2bd> 12662\n<e9a2be> 12664\n<e9a2bf> 12661\n<e9a380> 13112\n<e9a383> 15224\n<e9a384> 5719\n<e9a386> 13111\n<e9a387> 14577\n<e9a388> 14576\n<e9a389> 13110\n<e9a38a> 14574\n<e9a38b> 13269\n<e9a38c> 13609\n<e9a38e> 17678\n<e9a39b> 2093\n<e9a39c> 15371\n<e9a39e> 17679\n<e9a39f> 2094\n<e9a3a0> 18322\n<e9a3a1> 14582\n<e9a3a2> 2548\n<e9a3a3> 7730\n<e9a3a5> 8364\n<e9a3a6> 14583\n<e9a3a7> 3507\n<e9a3a9> 3510\n<e9a3aa> 3508\n<e9a3ab> 9054\n<e9a3ac> 14584\n<e9a3ad> 3512\n<e9a3af> 3509\n<e9a3b1> 18362\n<e9a3b2> 3511\n<e9a3b4> 3954\n<e9a3b5> 17253\n<e9a3b6> 9733\n<e9a3b9> 9734\n<e9a3ba> 10956\n<e9a3bc> 3953\n<e9a480> 10342\n<e9a482> 10341\n<e9a483> 4338\n<e9a485> 4339\n<e9a487> 10343\n<e9a488> 10955\n<e9a489> 4341\n<e9a48a> 4718\n<e9a48c> 4340\n<e9a48e> 17389\n<e9a490> 5019\n<e9a491> 10957\n<e9a492> 4720\n<e9a493> 4719\n<e9a494> 10958\n<e9a495> 10961\n<e9a498> 4721\n<e9a499> 18364\n<e9a49a> 5024\n<e9a49b> 5022\n<e9a49c> 17390\n<e9a49e> 5021\n<e9a49f> 11520\n<e9a4a1> 5023\n<e9a4a4> 11519\n<e9a4a5> 11972\n<e9a4a7> 11521\n<e9a4a8> 5020\n<e9a4a9> 11522\n<e9a4aa> 11975\n<e9a4ad> 11979\nendcidchar\n\n100 begincidchar\n<e9a4ae> 5473\n<e9a4af> 11978\n<e9a4b0> 11981\n<e9a4b1> 11980\n<e9a4b2> 11977\n<e9a4b3> 11976\n<e9a4b5> 5304\n<e9a4b7> 18365\n<e9a4b8> 15357\n<e9a4b9> 14586\n<e9a4ba> 12349\n<e9a4bb> 15377\n<e9a4bc> 12348\n<e9a4bd> 5472\n<e9a580> 16180\n<e9a581> 12347\n<e9a582> 17407\n<e9a583> 12667\n<e9a585> 5623\n<e9a587> 12666\n<e9a588> 12665\n<e9a589> 5624\n<e9a58a> 16313\n<e9a58b> 12927\n<e9a58c> 12926\n<e9a58d> 15378\n<e9a58e> 12924\n<e9a590> 12923\n<e9a591> 5721\n<e9a592> 5720\n<e9a593> 12928\n<e9a594> 13270\n<e9a595> 5863\n<e9a596> 13114\n<e9a597> 5799\n<e9a598> 13113\n<e9a599> 12925\n<e9a59b> 13271\n<e9a59c> 5906\n<e9a59d> 18366\n<e9a59e> 5966\n<e9a59f> 13555\n<e9a5a1> 13610\n<e9a5a2> 18367\n<e9a5a3> 17680\n<e9a696> 2095\n<e9a697> 8365\n<e9a698> 11982\n<e9a699> 2096\n<e9a69b> 18124\n<e9a69c> 10345\n<e9a69d> 10344\n<e9a69e> 11523\n<e9a6a1> 11984\n<e9a6a3> 11983\n<e9a6a4> 16835\n<e9a6a5> 5474\n<e9a6a8> 5722\n<e9a6aa> 15383\n<e9a6ab> 13611\n<e9a6ac> 2549\n<e9a6ad> 3514\n<e9a6ae> 3513\n<e9a6af> 9735\n<e9a6b0> 9737\n<e9a6b1> 3958\n<e9a6b2> 9736\n<e9a6b3> 3957\n<e9a6b4> 3959\n<e9a6b5> 9738\n<e9a6b8> 14667\n<e9a6b9> 10347\n<e9a6ba> 10349\n<e9a6bb> 10348\n<e9a6bc> 15394\n<e9a6bd> 10351\n<e9a781> 4342\n<e9a782> 10350\n<e9a783> 10346\n<e9a784> 15735\n<e9a785> 18369\n<e9a787> 10352\n<e9a789> 10968\n<e9a78b> 10971\n<e9a78c> 10973\n<e9a78d> 10963\n<e9a78e> 10967\n<e9a78f> 10964\n<e9a790> 4723\n<e9a791> 4726\n<e9a792> 4728\n<e9a795> 4727\n<e9a796> 10969\n<e9a797> 10972\n<e9a798> 10970\n<e9a799> 4729\n<e9a79a> 16194\n<e9a79b> 4725\n<e9a79c> 10962\n<e9a79d> 4722\nendcidchar\n\n100 begincidchar\n<e9a79f> 4724\n<e9a7a0> 18939\n<e9a7a1> 14213\n<e9a7a2> 5026\n<e9a7a3> 11529\n<e9a7a4> 11527\n<e9a7a5> 11526\n<e9a7a6> 15205\n<e9a7a7> 11532\n<e9a7a9> 11531\n<e9a7aa> 11530\n<e9a7ac> 11525\n<e9a7ad> 5025\n<e9a7ae> 11524\n<e9a7b0> 11528\n<e9a7b1> 5027\n<e9a7b4> 11987\n<e9a7b5> 14591\n<e9a7b6> 11991\n<e9a7b7> 11988\n<e9a7b8> 11990\n<e9a7b9> 11989\n<e9a7ba> 11986\n<e9a7bb> 11992\n<e9a7bc> 11995\n<e9a7bf> 5306\n<e9a881> 5305\n<e9a882> 11985\n<e9a883> 11996\n<e9a884> 12354\n<e9a885> 12357\n<e9a886> 12359\n<e9a887> 12358\n<e9a889> 12352\n<e9a88a> 12356\n<e9a88b> 12351\n<e9a88c> 14592\n<e9a88d> 12353\n<e9a88e> 5475\n<e9a88f> 12350\n<e9a890> 14594\n<e9a891> 12355\n<e9a894> 12682\n<e9a895> 12671\n<e9a896> 5625\n<e9a899> 5626\n<e9a89a> 12670\n<e9a89b> 12675\n<e9a89c> 12681\n<e9a89d> 12673\n<e9a89e> 12680\n<e9a89f> 15212\n<e9a8a0> 12677\n<e9a8a1> 15388\n<e9a8a2> 12676\n<e9a8a3> 12679\n<e9a8a4> 12674\n<e9a8a5> 12672\n<e9a8a6> 15858\n<e9a8a7> 12678\n<e9a8a9> 12935\n<e9a8aa> 12933\n<e9a8ab> 5723\n<e9a8ac> 12932\n<e9a8ad> 12938\n<e9a8ae> 12936\n<e9a8af> 15390\n<e9a8b0> 5724\n<e9a8b1> 12931\n<e9a8b2> 12929\n<e9a8b4> 12930\n<e9a8b5> 5726\n<e9a8b6> 12934\n<e9a8b7> 5725\n<e9a8b8> 12937\n<e9a8b9> 13115\n<e9a8ba> 13121\n<e9a8bb> 14593\n<e9a8bc> 18371\n<e9a8bd> 13116\n<e9a8be> 5803\n<e9a8bf> 13122\n<e9a980> 5802\n<e9a981> 13120\n<e9a982> 13119\n<e9a983> 5801\n<e9a984> 13118\n<e9a985> 5800\n<e9a986> 13117\n<e9a988> 13277\n<e9a989> 13279\n<e9a98a> 13278\n<e9a98c> 13275\n<e9a98d> 5865\n<e9a98e> 13272\n<e9a98f> 13276\n<e9a990> 13281\n<e9a992> 13280\n<e9a995> 5864\n<e9a996> 13391\nendcidchar\n\n100 begincidchar\n<e9a997> 5909\n<e9a998> 14595\n<e9a999> 13392\n<e9a99c> 15384\n<e9a99e> 13486\n<e9a99f> 5943\n<e9a9a0> 13584\n<e9a9a2> 5975\n<e9a9a3> 15207\n<e9a9a4> 13612\n<e9a9a5> 5976\n<e9a9a8> 13628\n<e9a9a9> 13627\n<e9a9aa> 5991\n<e9a9ab> 13636\n<e9a9ac> 17797\n<e9aa8f> 17798\n<e9aaa8> 2550\n<e9aaab> 9740\n<e9aaad> 9739\n<e9aab1> 10353\n<e9aab2> 17202\n<e9aab3> 10974\n<e9aab4> 11535\n<e9aab6> 17895\n<e9aab7> 4730\n<e9aab8> 5028\n<e9aab9> 11533\n<e9aaba> 16244\n<e9aabb> 11536\n<e9aabc> 5029\n<e9aabd> 15767\n<e9aabe> 11997\n<e9aabf> 11534\n<e9ab80> 12360\n<e9ab81> 5476\n<e9ab82> 12683\n<e9ab86> 12941\n<e9ab87> 12939\n<e9ab8a> 12940\n<e9ab8d> 13123\n<e9ab8f> 5804\n<e9ab90> 13282\n<e9ab91> 5912\n<e9ab92> 5866\n<e9ab95> 13487\n<e9ab96> 5967\n<e9ab97> 16298\n<e9ab98> 2551\n<e9ab9c> 12361\n<e9ab9f> 7731\n<e9aba0> 14600\n<e9aba1> 3960\n<e9aba2> 14601\n<e9aba3> 10354\n<e9aba6> 4345\n<e9aba7> 10355\n<e9abab> 10976\n<e9abac> 10975\n<e9abad> 5031\n<e9abb1> 10979\n<e9abb2> 10978\n<e9abb3> 10977\n<e9abb4> 14603\n<e9abb6> 11537\n<e9abb7> 11540\n<e9abb9> 11539\n<e9abba> 11538\n<e9abbb> 5030\n<e9abbc> 12001\n<e9abbd> 11999\n<e9abbe> 11998\n<e9abbf> 16151\n<e9ac81> 12000\n<e9ac82> 16146\n<e9ac83> 5477\n<e9ac86> 5478\n<e9ac88> 12362\n<e9ac89> 16160\n<e9ac8a> 12685\n<e9ac8b> 12684\n<e9ac8c> 12687\n<e9ac8d> 5627\n<e9ac8e> 12686\n<e9ac8f> 18372\n<e9ac90> 12942\n<e9ac91> 12944\n<e9ac92> 12943\n<e9ac94> 14605\n<e9ac95> 13124\n<e9ac96> 13127\n<e9ac99> 13283\n<e9ac9a> 5867\n<e9aca2> 5944\n<e9aca3> 5968\n<e9aca4> 13615\n<e9aca5> 2552\n<e9aca7> 4733\n<e9aca8> 5032\n<e9aca9> 12365\nendcidchar\n\n100 begincidchar\n<e9acaa> 16153\n<e9acab> 13284\n<e9acad> 14606\n<e9acae> 13585\n<e9acaf> 7732\n<e9acb1> 5992\n<e9acb2> 2553\n<e9acb3> 11541\n<e9acb4> 14609\n<e9acb5> 12366\n<e9acb7> 12688\n<e9acb9> 16128\n<e9acba> 13128\n<e9acbb> 13285\n<e9acbc> 2554\n<e9ad80> 14613\n<e9ad83> 10981\n<e9ad84> 4735\n<e9ad85> 4734\n<e9ad86> 10980\n<e9ad88> 12002\n<e9ad8a> 12367\n<e9ad8b> 12369\n<e9ad8c> 12368\n<e9ad8d> 5481\n<e9ad8e> 5480\n<e9ad8f> 5479\n<e9ad90> 14612\n<e9ad91> 5806\n<e9ad92> 13129\n<e9ad94> 5805\n<e9ad95> 13287\n<e9ad96> 13286\n<e9ad98> 5945\n<e9ad99> 13488\n<e9ad9a> 3041\n<e9ad9b> 9741\n<e9ad9f> 10360\n<e9ada4> 10990\n<e9ada6> 10985\n<e9ada7> 10982\n<e9ada8> 10989\n<e9ada9> 18373\n<e9adac> 10991\n<e9adaf> 4737\n<e9adb0> 10988\n<e9adb1> 10984\n<e9adb4> 10983\n<e9adb5> 10987\n<e9adb6> 10986\n<e9adb7> 4736\n<e9adba> 11552\n<e9adbb> 11547\n<e9adbc> 11545\n<e9adbd> 11554\n<e9adbe> 11546\n<e9adbf> 15419\n<e9ae80> 11542\n<e9ae81> 17393\n<e9ae82> 11548\n<e9ae83> 16921\n<e9ae85> 11543\n<e9ae86> 12011\n<e9ae87> 11544\n<e9ae88> 11555\n<e9ae8b> 16110\n<e9ae8d> 17955\n<e9ae8e> 14617\n<e9ae8f> 16301\n<e9ae90> 11551\n<e9ae91> 5033\n<e9ae92> 11550\n<e9ae93> 11549\n<e9ae95> 11553\n<e9ae97> 16241\n<e9ae9a> 12003\n<e9ae9b> 12006\n<e9ae9d> 16214\n<e9ae9e> 12005\n<e9ae9f> 15422\n<e9aea0> 12013\n<e9aea1> 12008\n<e9aea2> 12012\n<e9aea4> 12010\n<e9aea5> 12009\n<e9aea6> 12007\n<e9aea8> 12004\n<e9aeaa> 5309\n<e9aeab> 5308\n<e9aead> 5310\n<e9aeae> 5307\n<e9aeaf> 12014\n<e9aeb0> 16308\n<e9aeb5> 12375\n<e9aeb6> 12378\n<e9aeb8> 12376\n<e9aeb9> 12380\n<e9aebd> 12381\n<e9aebf> 12373\n<e9af80> 5486\nendcidchar\n\n100 begincidchar\n<e9af81> 12374\n<e9af83> 12372\n<e9af84> 12379\n<e9af86> 12371\n<e9af87> 12370\n<e9af88> 5485\n<e9af89> 5483\n<e9af8a> 5482\n<e9af8f> 15420\n<e9af93> 12377\n<e9af94> 12697\n<e9af95> 12703\n<e9af96> 5630\n<e9af97> 12698\n<e9af99> 12701\n<e9af9a> 12705\n<e9af9b> 5631\n<e9af9c> 12700\n<e9af9d> 18374\n<e9af9e> 12692\n<e9afa0> 12691\n<e9afa1> 12704\n<e9afa2> 12695\n<e9afa4> 12693\n<e9afa5> 12702\n<e9afa6> 12694\n<e9afa7> 5629\n<e9afa8> 5628\n<e9afa9> 15297\n<e9afac> 12699\n<e9afad> 16087\n<e9afb0> 12696\n<e9afb1> 18375\n<e9afb4> 18376\n<e9afb7> 12947\n<e9afb8> 12950\n<e9afbd> 5484\n<e9afbf> 14619\n<e9b082> 14618\n<e9b085> 12948\n<e9b086> 12954\n<e9b087> 12952\n<e9b088> 12946\n<e9b089> 12957\n<e9b08a> 16186\n<e9b08b> 12945\n<e9b08c> 14620\n<e9b08d> 5728\n<e9b08e> 12953\n<e9b090> 15418\n<e9b092> 12949\n<e9b093> 5727\n<e9b094> 12956\n<e9b095> 16158\n<e9b097> 12955\n<e9b09b> 18715\n<e9b09c> 13132\n<e9b09d> 13131\n<e9b09f> 17954\n<e9b0a0> 18378\n<e9b0a1> 13138\n<e9b0a3> 13134\n<e9b0a4> 13137\n<e9b0a5> 5808\n<e9b0a6> 17894\n<e9b0ab> 13130\n<e9b0ac> 13133\n<e9b0ad> 5807\n<e9b0ae> 16162\n<e9b0af> 15751\n<e9b0b1> 5869\n<e9b0b2> 13298\n<e9b0b3> 13293\n<e9b0b4> 13297\n<e9b0b5> 15417\n<e9b0b6> 13300\n<e9b0b7> 13296\n<e9b0b9> 13292\n<e9b0ba> 15742\n<e9b0bb> 5871\n<e9b0bc> 13295\n<e9b0bd> 13299\n<e9b0be> 5870\n<e9b0bf> 13290\n<e9b180> 12951\n<e9b181> 13294\n<e9b184> 13291\n<e9b185> 15985\n<e9b186> 13288\n<e9b188> 13289\n<e9b189> 5868\n<e9b18a> 13399\n<e9b18b> 13401\n<e9b18c> 13404\n<e9b18d> 13400\n<e9b18e> 13405\n<e9b18f> 15414\n<e9b190> 13398\n<e9b192> 13396\n<e9b193> 15415\nendcidchar\n\n100 begincidchar\n<e9b194> 5913\n<e9b195> 13402\n<e9b196> 5915\n<e9b197> 5914\n<e9b198> 13397\n<e9b199> 13403\n<e9b19d> 16063\n<e9b19e> 13493\n<e9b19f> 5946\n<e9b1a0> 13494\n<e9b1a2> 13492\n<e9b1a3> 13489\n<e9b1a6> 13491\n<e9b1a7> 13490\n<e9b1a8> 13556\n<e9b1ad> 13558\n<e9b1ae> 13557\n<e9b1b1> 13588\n<e9b1b2> 16033\n<e9b1b3> 13587\n<e9b1b4> 13586\n<e9b1b5> 13589\n<e9b1b9> 13633\n<e9b1ba> 13637\n<e9b1bb> 15416\n<e9b1bc> 17682\n<e9b3a5> 3042\n<e9b3a6> 9055\n<e9b3a7> 9744\n<e9b3a9> 3961\n<e9b3aa> 9742\n<e9b3ad> 9743\n<e9b3b3> 4350\n<e9b3b4> 4348\n<e9b3b5> 10363\n<e9b3b6> 4349\n<e9b3b7> 10996\n<e9b3b9> 10999\n<e9b3ba> 10993\n<e9b3bb> 11000\n<e9b3bc> 10992\n<e9b3bd> 10994\n<e9b3bf> 10995\n<e9b480> 10998\n<e9b482> 16187\n<e9b483> 4740\n<e9b484> 11003\n<e9b485> 11002\n<e9b486> 4738\n<e9b487> 10997\n<e9b488> 11001\n<e9b489> 4739\n<e9b48c> 15430\n<e9b490> 11565\n<e9b492> 5038\n<e9b494> 11560\n<e9b495> 5034\n<e9b496> 15484\n<e9b497> 11557\n<e9b498> 11563\n<e9b499> 11566\n<e9b49b> 5039\n<e9b49d> 11562\n<e9b49e> 11559\n<e9b49f> 11567\n<e9b4a0> 11558\n<e9b4a1> 15425\n<e9b4a2> 11564\n<e9b4a3> 5035\n<e9b4a5> 11556\n<e9b4a6> 5036\n<e9b4a8> 5037\n<e9b4a9> 11561\n<e9b4ad> 12032\n<e9b4b0> 12023\n<e9b4b1> 12021\n<e9b4b3> 12015\n<e9b4b4> 16458\n<e9b4b6> 12018\n<e9b4b7> 12028\n<e9b4b8> 12022\n<e9b4b9> 14638\n<e9b4bb> 5311\n<e9b4bd> 12030\n<e9b4be> 12027\n<e9b4bf> 5312\n<e9b580> 12029\n<e9b581> 12016\n<e9b584> 16299\n<e9b585> 12024\n<e9b589> 18381\n<e9b58a> 12385\n<e9b58b> 12387\n<e9b58c> 12390\n<e9b58e> 17721\n<e9b58f> 12384\n<e9b590> 16074\n<e9b591> 5487\n<e9b592> 12392\n<e9b593> 12383\nendcidchar\n\n100 begincidchar\n<e9b594> 12393\n<e9b596> 12389\n<e9b597> 12391\n<e9b598> 12395\n<e9b599> 12388\n<e9b59a> 12396\n<e9b59b> 12386\n<e9b59c> 12382\n<e9b59d> 5488\n<e9b59e> 15982\n<e9b59f> 12394\n<e9b5a0> 5489\n<e9b5a1> 5633\n<e9b5a7> 12017\n<e9b5a8> 12731\n<e9b5a9> 12722\n<e9b5aa> 5635\n<e9b5ab> 12718\n<e9b5ac> 5636\n<e9b5ad> 15276\n<e9b5ae> 17211\n<e9b5af> 12727\n<e9b5b0> 12721\n<e9b5b1> 12711\n<e9b5b2> 5634\n<e9b5b3> 12724\n<e9b5b7> 12706\n<e9b5b8> 12713\n<e9b5b9> 12728\n<e9b5bb> 12725\n<e9b5bc> 16126\n<e9b5bd> 12717\n<e9b5be> 14629\n<e9b5bf> 12729\n<e9b680> 12712\n<e9b681> 12707\n<e9b682> 12726\n<e9b683> 14630\n<e9b684> 12709\n<e9b685> 12723\n<e9b686> 12714\n<e9b687> 12730\n<e9b688> 12710\n<e9b689> 5632\n<e9b68a> 12708\n<e9b690> 12964\n<e9b692> 12962\n<e9b693> 17395\n<e9b694> 12967\n<e9b696> 12979\n<e9b697> 12970\n<e9b698> 12963\n<e9b699> 12959\n<e9b69a> 12972\n<e9b69b> 12965\n<e9b69c> 12968\n<e9b69d> 12961\n<e9b69e> 12975\n<e9b69f> 12958\n<e9b6a0> 12966\n<e9b6a1> 12971\n<e9b6a2> 12973\n<e9b6a3> 12976\n<e9b6a4> 12960\n<e9b6a5> 15435\n<e9b6a8> 12974\n<e9b6a9> 12978\n<e9b6aa> 12969\n<e9b6ab> 16176\n<e9b6ac> 13154\n<e9b6ad> 13157\n<e9b6af> 5809\n<e9b6b1> 13156\n<e9b6b2> 13161\n<e9b6b3> 13159\n<e9b6b4> 5810\n<e9b6b5> 13150\n<e9b6b6> 13140\n<e9b6b7> 13139\n<e9b6b8> 5812\n<e9b6bb> 13149\n<e9b6bc> 13141\n<e9b6bd> 18384\n<e9b6be> 13146\n<e9b6bf> 12977\n<e9b780> 17394\n<e9b781> 13142\n<e9b782> 5811\n<e9b783> 13148\n<e9b784> 14633\n<e9b785> 13147\n<e9b787> 13143\n<e9b788> 13155\n<e9b789> 17785\n<e9b78a> 13144\n<e9b78b> 13305\n<e9b78c> 13158\n<e9b78d> 13160\n<e9b78e> 13151\n<e9b78f> 13145\nendcidchar\n\n100 begincidchar\n<e9b790> 13306\n<e9b791> 13308\n<e9b792> 13302\n<e9b793> 5872\n<e9b794> 14622\n<e9b795> 13315\n<e9b796> 13313\n<e9b797> 5873\n<e9b798> 13312\n<e9b799> 13311\n<e9b79a> 13304\n<e9b79b> 13301\n<e9b79c> 13307\n<e9b79d> 13316\n<e9b79e> 13303\n<e9b79f> 13309\n<e9b7a1> 13414\n<e9b7a2> 13419\n<e9b7a3> 13409\n<e9b7a4> 13412\n<e9b7a5> 5916\n<e9b7a6> 13416\n<e9b7a8> 13423\n<e9b7a9> 13310\n<e9b7ab> 13410\n<e9b7ac> 13420\n<e9b7ad> 13424\n<e9b7ae> 13415\n<e9b7af> 13408\n<e9b7b0> 13418\n<e9b7b2> 13417\n<e9b7b3> 13422\n<e9b7b4> 13421\n<e9b7b5> 13314\n<e9b7b6> 13413\n<e9b7b7> 13407\n<e9b7b8> 13411\n<e9b7bb> 13406\n<e9b7bc> 18385\n<e9b7bd> 13505\n<e9b7be> 13496\n<e9b7bf> 13504\n<e9b882> 13495\n<e9b883> 13498\n<e9b884> 13506\n<e9b885> 13500\n<e9b886> 13499\n<e9b887> 13497\n<e9b889> 13503\n<e9b88a> 17790\n<e9b88b> 13559\n<e9b88c> 17786\n<e9b88d> 13560\n<e9b88e> 14632\n<e9b88f> 13562\n<e9b890> 13561\n<e9b891> 13564\n<e9b892> 13563\n<e9b893> 13591\n<e9b894> 13590\n<e9b895> 13616\n<e9b897> 13617\n<e9b898> 15428\n<e9b899> 13629\n<e9b89a> 5989\n<e9b89b> 5993\n<e9b89c> 16260\n<e9b89d> 13638\n<e9b89e> 5994\n<e9b89f> 17683\n<e9b9b5> 3043\n<e9b9b9> 5729\n<e9b9ba> 13162\n<e9b9bb> 17400\n<e9b9bf> 3044\n<e9ba80> 9745\n<e9ba81> 16143\n<e9ba82> 3962\n<e9ba83> 11004\n<e9ba84> 16246\n<e9ba85> 16114\n<e9ba88> 11568\n<e9ba89> 12034\n<e9ba8a> 12033\n<e9ba8b> 5313\n<e9ba8c> 12398\n<e9ba8d> 12035\n<e9ba8e> 12397\n<e9ba90> 14641\n<e9ba91> 12733\n<e9ba92> 5637\n<e9ba93> 5639\n<e9ba94> 12732\n<e9ba95> 14642\n<e9ba96> 16316\n<e9ba97> 5638\n<e9ba98> 16167\n<e9ba99> 12982\n<e9ba9a> 12984\n<e9ba9b> 12983\nendcidchar\n\n100 begincidchar\n<e9ba9c> 13163\n<e9ba9d> 5813\n<e9ba9e> 14643\n<e9ba9f> 5917\n<e9baa0> 13507\n<e9baa1> 13565\n<e9baa2> 14644\n<e9baa4> 13642\n<e9baa5> 3045\n<e9baa6> 18756\n<e9baa7> 10364\n<e9baa8> 16245\n<e9baa9> 4741\n<e9baaa> 14646\n<e9baab> 16018\n<e9baac> 17396\n<e9baad> 11572\n<e9baae> 11571\n<e9baaf> 14647\n<e9bab0> 12036\n<e9bab1> 18388\n<e9bab4> 5640\n<e9bab5> 5730\n<e9bab6> 13317\n<e9bab7> 13634\n<e9babb> 3046\n<e9babc> 4351\n<e9babd> 18389\n<e9babe> 4742\n<e9babf> 15736\n<e9bb80> 12734\n<e9bb81> 14649\n<e9bb82> 13425\n<e9bb83> 3515\n<e9bb84> 17684\n<e9bb86> 18390\n<e9bb87> 17783\n<e9bb88> 12037\n<e9bb8c> 5969\n<e9bb8d> 3516\n<e9bb8e> 4743\n<e9bb8f> 5314\n<e9bb90> 13426\n<e9bb91> 3517\n<e9bb93> 11005\n<e9bb94> 5041\n<e9bb98> 5040\n<e9bb9a> 12038\n<e9bb9b> 5318\n<e9bb9e> 5315\n<e9bb9f> 12399\n<e9bba0> 5490\n<e9bba2> 18392\n<e9bba4> 12986\n<e9bba5> 12985\n<e9bba6> 12988\n<e9bba7> 12987\n<e9bba8> 5731\n<e9bbab> 13164\n<e9bbad> 13166\n<e9bbae> 13165\n<e9bbaf> 5814\n<e9bbb0> 13318\n<e9bbb1> 18393\n<e9bbb4> 5918\n<e9bbb5> 13566\n<e9bbb6> 13592\n<e9bbb7> 5986\n<e9bbb8> 18394\n<e9bbb9> 9056\n<e9bbba> 11575\n<e9bbbb> 12039\n<e9bbbc> 12735\n<e9bbbd> 9746\n<e9bbbe> 18382\n<e9bbbf> 12040\n<e9bc80> 12401\n<e9bc81> 12400\n<e9bc82> 14656\n<e9bc86> 13429\n<e9bc87> 5951\n<e9bc88> 14657\n<e9bc89> 13567\n<e9bc8a> 13593\n<e9bc8e> 3963\n<e9bc92> 11576\n<e9bc93> 3964\n<e9bc95> 5491\n<e9bc96> 12402\n<e9bc97> 14661\n<e9bc98> 13168\n<e9bc99> 5815\n<e9bc9a> 13169\n<e9bc9b> 13167\n<e9bc9c> 13430\n<e9bc9e> 13508\n<e9bca0> 3965\n<e9bca2> 12043\n<e9bca3> 12042\n<e9bca4> 12041\nendcidchar\n\n100 begincidchar\n<e9bca5> 12403\n<e9bca6> 16272\n<e9bca7> 17952\n<e9bca8> 12407\n<e9bca9> 12406\n<e9bcaa> 12405\n<e9bcab> 12404\n<e9bcac> 5492\n<e9bcad> 12736\n<e9bcae> 12990\n<e9bcaf> 5732\n<e9bcb0> 12989\n<e9bcb1> 13170\n<e9bcb2> 13321\n<e9bcb3> 13320\n<e9bcb4> 5874\n<e9bcb5> 13319\n<e9bcb6> 13433\n<e9bcb7> 13432\n<e9bcb8> 13431\n<e9bcb9> 14663\n<e9bcbb> 4352\n<e9bcbd> 11577\n<e9bcbe> 5319\n<e9bd82> 13322\n<e9bd83> 13434\n<e9bd84> 18395\n<e9bd85> 14666\n<e9bd86> 13509\n<e9bd87> 13568\n<e9bd88> 13618\n<e9bd89> 13644\n<e9bd8a> 4353\n<e9bd8b> 5320\n<e9bd8c> 12408\n<e9bd8d> 12739\n<e9bd8e> 13171\n<e9bd8f> 13435\n<e9bd90> 18755\n<e9bd92> 4745\n<e9bd93> 16256\n<e9bd94> 12044\n<e9bd95> 12409\n<e9bd99> 12995\n<e9bd9a> 16163\n<e9bd9b> 12991\n<e9bd9c> 5816\n<e9bd9d> 12994\n<e9bd9e> 12993\n<e9bd9f> 5733\n<e9bda0> 12992\n<e9bda1> 5735\n<e9bda2> 18105\n<e9bda3> 5734\n<e9bda4> 13173\n<e9bda5> 13172\n<e9bda9> 14672\n<e9bdaa> 5876\n<e9bdab> 13323\n<e9bdac> 5875\n<e9bdb0> 13437\n<e9bdb1> 13436\n<e9bdb2> 5953\n<e9bdb7> 5952\n<e9bdb8> 13569\n<e9bdb9> 13572\n<e9bdba> 13571\n<e9bdbb> 13570\n<e9bdbe> 13643\n<e9bdbf> 18048\n<e9be8d> 5042\n<e9be8e> 14674\n<e9be90> 5500\n<e9be91> 12996\n<e9be92> 13174\n<e9be94> 5877\n<e9be95> 13324\n<e9be96> 19104\n<e9be97> 19096\n<e9be98> 13645\n<e9be99> 17799\n<e9be9c> 5043\n<e9be9f> 17990\n<e9bea0> 12045\n<e9bea2> 13325\n<e9bea4> 13594\n<e9bea5> 16240\n<e9bea6> 18852\n<e9bea7> 18893\n<e9bea8> 18900\n<e9bea9> 18932\n<e9beaa> 18934\n<e9beab> 18936\n<e9beac> 18941\n<e9beaf> 18963\n<e9beb0> 14005\n<e9beb1> 14007\n<e9beb2> 19039\n<e9beb3> 19064\n<e9bf87> 19126\nendcidchar\n\n100 begincidchar\n<e9bf88> 19142\n<e9bf89> 19146\n<e9bf8a> 19150\n<e9bf8b> 19155\n<ee809f> 2106\n<ee80a6> 2557\n<ee819b> 781\n<ee81a3> 363\n<ee81b3> 2144\n<ee82a5> 16002\n<ee82b0> 18760\n<ee838b> 18761\n<ee839e> 18762\n<ee83b3> 3107\n<ee83ba> 18763\n<ee8488> 18764\n<ee84ae> 6116\n<ee84b4> 16014\n<ee8584> 18765\n<ee8589> 8495\n<ee858c> 18766\n<ee859d> 18767\n<ee85a6> 16385\n<ee85a7> 18768\n<ee85af> 18769\n<ee8691> 4447\n<ee86a4> 18772\n<ee86ba> 3193\n<ee86bb> 18773\n<ee8786> 18774\n<ee8789> 1219\n<ee87a0> 18775\n<ee8880> 16895\n<ee8881> 18776\n<ee88ac> 6333\n<ee88ad> 3261\n<ee88b0> 3237\n<ee8998> 18777\n<ee89a6> 3278\n<ee89a7> 18778\n<ee8a86> 15728\n<ee8aa1> 18779\n<ee8aa2> 17055\n<ee8aa3> 3716\n<ee8aac> 18780\n<ee8abc> 288\n<ee8baf> 7080\n<ee8bbf> 18783\n<ee8c80> 18784\n<ee8c96> 18072\n<ee8cba> 4181\n<ee8cbb> 14164\n<ee8d80> 11752\n<ee8d87> 18075\n<ee8d8c> 18076\n<ee8d8f> 289\n<ee8d95> 18077\n<ee8d9a> 4203\n<ee8da3> 4902\n<ee8da7> 18078\n<ee8db8> 18079\n<ee8dbc> 1643\n<ee8dbf> 4910\n<ee8e94> 18080\n<ee8e9e> 18081\n<ee8ea5> 18082\n<ee8f85> 3381\n<ee8f86> 14296\n<ee8f87> 18083\n<ee8f8d> 18084\n<ee8f95> 18085\n<ee8f96> 14309\n<ee8f97> 10178\n<ee8f9c> 8877\n<ee8fa7> 18086\n<ee8fbc> 18087\n<ee9091> 18088\n<ee9092> 14368\n<ee9093> 18089\n<ee9096> 18090\n<ee9097> 4940\n<ee9098> 16377\n<ee90a6> 18091\n<ee90af> 18092\n<ee9188> 18093\n<ee9189> 14420\n<ee918a> 2510\n<ee91a0> 18094\n<ee91b8> 3015\n<ee91b9> 14466\n<ee91ba> 18098\n<ee9285> 14057\n<ee928f> 18099\n<ee92a1> 18100\n<ee9385> 5009\n<ee939a> 5796\n<ee948d> 18101\n<ee9496> 18102\n<ee94a6> 18103\n<ee94a7> 14633\nendcidchar\n\n100 begincidchar\n<ee94a8> 18104\n<ee9585> 12402\n<ee958e> 18105\n<ee9689> 14728\n<ee96a9> 18106\n<ee96b2> 18107\n<ee9794> 284\n<ee9795> 283\n<ee97ab> 16300\n<ee97b4> 10620\n<ee9888> 18108\n<ee9895> 18109\n<ee998a> 18110\n<ee99aa> 18111\n<ee9a82> 18112\n<ee9aa5> 18113\n<ee9aa8> 18114\n<ee9aab> 18115\n<ee9b85> 18116\n<ee9b86> 7430\n<ee9bb8> 18117\n<ee9ca7> 10657\n<ee9ca8> 18118\n<ee9da9> 18119\n<ee9db6> 18120\n<ee9dbb> 18121\n<ee9f80> 18122\n<ee9f93> 6171\n<ee9fbd> 15919\n<eea08a> 18123\n<eea0a3> 18124\n<eea1ab> 18125\n<eea284> 15478\n<eea293> 11044\n<eea5a2> 18128\n<eea5aa> 15705\n<eea5ad> 15706\n<eea5b4> 15707\n<eea680> 15708\n<eea685> 17354\n<eea686> 18154\n<eea687> 15709\n<eea688> 18155\n<eea689> 17356\n<eea68a> 15710\n<eea68b> 18156\n<eea68c> 17402\n<eea68d> 18157\n<eea693> 15713\n<eea694> 18161\n<eea695> 15714\n<eea696> 18162\n<eea6a3> 17357\n<eea6ab> 18178\n<eea6ac> 17361\n<eea6b0> 17364\n<eea6b4> 15717\n<eea6b8> 15718\n<eea6be> 15719\n<eea6bf> 18193\n<eea780> 18194\n<eea781> 15720\n<eea782> 18195\n<eea783> 15721\n<eea784> 18196\n<eea78d> 15722\n<eea78e> 18203\n<eea78f> 17367\n<eea792> 17404\n<eea793> 15723\n<eea794> 18206\n<eea795> 15724\n<eea796> 18207\n<eea797> 17368\n<eea79f> 15725\n<eea7a4> 17369\n<eea7ac> 17370\n<eea7b4> 17372\n<eea7ba> 15726\n<eea7be> 15727\n<eea7bf> 18241\n<eea885> 15728\n<eea888> 15729\n<eea890> 15730\n<eea891> 18256\n<eea892> 17349\n<eea893> 18257\n<eea894> 17350\n<eea89c> 15731\n<eea8a0> 17374\n<eea8a4> 15732\n<eea8a8> 15733\n<eea8b8> 17376\n<eea8bb> 17378\n<eea980> 18295\n<eea981> 17379\n<eea984> 17381\n<eea98d> 17375\n<eea990> 15734\n<eea991> 18308\nendcidchar\n\n100 begincidchar\n<eea992> 17323\n<eea993> 18309\n<eea994> 17383\n<eea995> 18310\n<eea996> 17385\n<eea99d> 17405\n<eea9a2> 15735\n<eea9b7> 15736\n<eea9b8> 18341\n<eea9b9> 15737\n<eeaa86> 15738\n<eeaa8c> 17327\n<eeaa8d> 18359\n<eeaa8e> 15739\n<eeaa93> 17389\n<eeaa94> 18364\n<eeaa95> 15740\n<eeaa96> 17390\n<eeaa97> 18365\n<eeaa98> 17407\n<eeaaa0> 15741\n<eeaaa1> 18373\n<eeaaa2> 17393\n<eeaaab> 15742\n<eeaaae> 17395\n<eeaaaf> 18384\n<eeaab0> 17394\n<eeaab4> 17400\n<eeaab5> 17396\n<eeaabd> 15743\n<eeab82> 15744\n<eeab83> 18399\n<eeab84> 15745\n<eeab85> 18400\n<eeab86> 15746\n<eeab87> 18401\n<eeab88> 17335\n<eeab92> 15747\n<eeab9b> 15748\n<eeab9c> 18419\n<eeab9d> 15749\n<eeabad> 15753\n<eeabae> 18432\n<eeabaf> 15754\n<eeabb3> 15755\n<eeabb4> 17328\n<eeabb9> 17330\n<eeabbd> 15756\n<eeac80> 18445\n<eeac81> 15757\n<eeac86> 15758\n<eeac90> 15759\n<eeac94> 15760\n<eeac9e> 15762\n<eeaca2> 15763\n<eeaca3> 18474\n<eeaca4> 15764\n<eeaca5> 18475\n<eeaca6> 15765\n<eeaca7> 18476\n<eeacaa> 18477\n<eead80> 12112\n<eead81> 15773\n<eead82> 5925\n<eead85> 13037\n<eead86> 15776\n<eead87> 18496\n<eead8a> 18497\n<eead93> 18500\n<eead94> 15785\n<eead97> 15786\n<eeada6> 15795\n<eeada7> 18509\n<eeadae> 10969\n<eeadb2> 15803\n<eeadb3> 18513\n<eeadb4> 15804\n<eeadb5> 18514\n<eeadb6> 17360\n<eeadb7> 18515\n<eeadba> 18516\n<eeadbb> 15807\n<eeadbc> 18517\n<eeadbd> 15808\n<eeae85> 15812\n<eeae86> 7188\n<eeae87> 15813\n<eeae88> 18522\n<eeae89> 15814\n<eeae8a> 18523\n<eeae8b> 15815\n<eeae8f> 15816\n<eeae90> 18527\n<eeae94> 16890\n<eeae95> 18528\n<eeae9b> 15823\n<eeae9e> 4841\n<eeae9f> 18534\n<eeaea2> 18535\n<eeaea9> 11438\nendcidchar\n\n100 begincidchar\n<eeaeaa> 18538\n<eeaeae> 18539\n<eeaeaf> 15835\n<eeaeb0> 18540\n<eeaeb1> 15836\n<eeaeba> 6756\n<eeaebb> 18543\n<eeaebc> 15844\n<eeaebd> 18544\n<eeaf83> 18545\n<eeaf84> 15850\n<eeaf87> 15851\n<eeaf88> 18548\n<eeaf89> 5124\n<eeaf8a> 18549\n<eeaf8e> 18550\n<eeaf8f> 8996\n<eeaf90> 18551\n<eeaf91> 15857\n<eeaf92> 13418\n<eeaf93> 18552\n<eeaf94> 15858\n<eeaf95> 18553\n<eeaf9e> 8849\n<eeaf9f> 18556\n<eeafa0> 15866\n<eeafa1> 18557\n<eeafa4> 18558\n<eeafaa> 15872\n<eeafaf> 18563\n<eeafb0> 15875\n<eeafb1> 18564\n<eeb080> 18567\n<eeb081> 6023\n<eeb082> 2399\n<eeb093> 18571\n<eeb094> 15903\n<eeb095> 7833\n<eeb0a0> 18576\n<eeb0ab> 18577\n<eeb0af> 18578\n<eeb0b2> 18579\n<eeb0bf> 18580\n<eeb182> 15938\n<eeb183> 18583\n<eeb184> 17384\n<eeb18a> 15939\n<eeb18d> 15940\n<eeb192> 18593\n<eeb193> 15944\n<eeb194> 18594\n<eeb195> 15945\n<eeb199> 15946\n<eeb19a> 18598\n<eeb19b> 9665\n<eeb19e> 3340\n<eeb1a5> 17353\n<eeb1a6> 15948\n<eeb1a7> 18607\n<eeb1a8> 15949\n<eeb1bc> 17397\n<eeb1bd> 15950\n<eeb282> 15951\n<eeb28b> 18635\n<eeb28c> 15956\n<eeb28d> 18636\n<eeb292> 15960\n<eeb295> 15961\n<eeb296> 18641\n<eeb297> 15962\n<eeb298> 18642\n<eeb299> 15963\n<eeb2a0> 18647\n<eeb2a5> 15968\n<eeb2a6> 1510\n<eeb2ab> 18652\n<eeb2ac> 15972\n<eeb2b4> 18655\n<eeb39e> 18660\n<eeb3a4> 18661\n<eeb480> 18662\n<eeb484> 18663\n<eeb489> 16054\n<eeb48a> 18666\n<eeb48b> 16055\n<eeb492> 16056\n<eeb493> 18673\n<eeb494> 16057\n<eeb49a> 18677\n<eeb49b> 16060\n<eeb49c> 18678\n<eeb49d> 16061\n<eeb49e> 18679\n<eeb4a2> 18680\n<eeb4a8> 1832\n<eeb4a9> 16069\n<eeb4aa> 18683\n<eeb4ad> 18684\n<eeb4b3> 16075\n<eeb4b4> 18687\nendcidchar\n\n100 begincidchar\n<eeb4b7> 18688\n<eeb4b8> 16078\n<eeb4bb> 16079\n<eeb585> 18696\n<eeb58c> 16089\n<eeb591> 18701\n<eeb592> 16092\n<eeb5ae> 9398\n<eeb5b1> 18706\n<eeb5ba> 18710\n<eeb5bb> 16124\n<eeb5bc> 6150\n<eeb680> 16129\n<eeb681> 18711\n<eeb686> 18712\n<eeb69e> 13585\n<eeb6a4> 14661\n<eeb6ae> 18717\n<eeb791> 18718\n<eeb797> 18719\n<eeb79b> 18720\n<eeb79c> 16212\n<eeb79d> 18721\n<eeb7a7> 3970\n<eeb7a8> 18722\n<eeb7b0> 18723\n<eeb7b4> 14910\n<eeb880> 18724\n<eeb895> 18725\n<eeb89b> 18726\n<eeb8a2> 18727\n<eeb8b0> 18728\n<eeb8be> 14353\n<eeb8bf> 16305\n<eeb988> 18729\n<eeb992> 1522\n<eeb996> 18730\n<eeb99b> 18731\n<eeb9a0> 18732\n<eeb9be> 18733\n<eeb9bf> 16364\n<eeba89> 18734\n<eeba8e> 15086\n<eeba98> 9341\n<eeba9c> 18735\n<eeba9d> 15049\n<eebaa7> 17332\n<eebaab> 17336\n<ef8ea3> 17718\n<ef8eac> 17723\n<ef8ead> 17347\n<ef8eb1> 17306\n<ef8fa4> 17314\n<ef8fa9> 17388\n<ef8faa> 17777\n<ef8fab> 17387\n<ef8fac> 17778\n<ef8fbf> 17793\n<ef908d> 17340\n<ef9097> 17308\n<ef9098> 17815\n<ef9099> 17310\n<ef909a> 17816\n<ef909b> 17311\n<ef909f> 17313\n<ef90a0> 17820\n<ef90a1> 17315\n<ef90b8> 17321\n<ef90be> 17161\n<ef918a> 17846\n<ef9197> 17847\n<ef919b> 17848\n<ef91ae> 17849\n<ef91b3> 17214\n<ef91b4> 17850\n<ef91b7> 17851\n<ef91b8> 17219\n<ef91b9> 17852\n<ef91ba> 17221\n<ef91bb> 17853\n<ef9283> 17854\n<ef9291> 17855\n<ef9292> 17245\n<ef9293> 17856\n<ef9294> 17247\n<ef92a7> 17857\n<ef9380> 17291\n<ef9381> 17860\n<ef9382> 17371\n<ef939f> 17294\n<ef93a0> 17886\n<ef93a1> 17295\n<ef93a2> 17887\n<ef93a3> 17296\n<ef93a4> 17888\n<ef93a5> 17297\n<ef93a6> 17889\n<ef93b2> 17303\n<ef93b3> 17896\n<ef93b4> 17304\nendcidchar\n\n100 begincidchar\n<ef93b5> 17348\n<ef93bb> 17319\n<ef9482> 17324\n<ef95bd> 18855\n<ef9685> 18863\n<ef96a0> 18889\n<ef96ab> 18900\n<ef96b0> 18905\n<ef96b4> 18909\n<ef96b6> 18911\n<ef96b9> 18914\n<ef96bd> 18917\n<ef96bf> 18919\n<ef9780> 18920\n<ef978c> 18932\n<ef978e> 18934\n<ef9790> 18936\n<ef97a0> 18949\n<ef97a4> 18952\n<ef97af> 18963\n<ef98b6> 17338\n<ef98bc> 17339\n<ef98bd> 17312\n<ef98be> 17341\n<ef98bf> 17968\n<ef9982> 17342\n<ef998a> 17343\n<ef998e> 17344\n<ef998f> 17981\n<ef9990> 17345\n<ef9997> 17346\n<ef999a> 17337\n<ef999b> 17325\n<ef99a8> 17351\n<ef99b5> 17352\n<ef9aac> 17401\n<ef9ba4> 558\n<ef9ba6> 560\n<efa0aa> 18846\n<efa0b3> 18847\n<efa0bb> 18848\n<efa0bf> 18834\n<efa487> 17686\n<efa88c> 628\n<efa88d> 9089\n<efa892> 16828\n<efa8a6> 14465\n<efa988> 16997\n<efa99b> 14224\n<efb893> 14104\n<efb894> 14103\n<efb895> 14106\n<efb896> 14105\n<efb899> 13646\n<efb8b0> 109\n<efb8b1> 122\n<efb8b3> 13743\n<efb8b4> 13745\n<efb8bf> 150\n<efb980> 151\n<efb98f> 13746\n<efb9a8> 258\n<efbc81> 108\n<efbc82> 14052\n<efbc83> 174\n<efbc84> 259\n<efbc85> 264\n<efbc86> 175\n<efbc87> 14051\n<efbc8a> 176\n<efbc8b> 208\n<efbc8c> 100\n<efbc8d> 209\n<efbc8e> 103\n<efbc8f> 257\n<efbc9a> 106\n<efbc9b> 105\n<efbc9c> 214\n<efbc9d> 216\n<efbc9e> 215\n<efbc9f> 107\n<efbca0> 265\n<efbcbb> 13758\n<efbcbc> 258\n<efbcbd> 13759\n<efbcbe> 13748\n<efbcbf> 197\n<efbd9b> 132\n<efbd9c> 120\n<efbd9d> 133\n<efbd9e> 228\n<efbda4> 113\n<efbfa2> 14049\n<efbfa3> 196\n<efbfa4> 14050\n<efbfa5> 260\n<efbfad> 14096\n<f0a080a1> 15861\n<f0a080be> 14929\n<f0a08186> 14930\nendcidchar\n\n100 begincidchar\n<f0a0818e> 15193\n<f0a081a8> 14218\n<f0a08286> 17636\n<f0a08287> 17688\n<f0a0828a> 14002\n<f0a08294> 18396\n<f0a0838a> 17623\n<f0a0838b> 17620\n<f0a0838c> 14000\n<f0a0838d> 17617\n<f0a08391> 17616\n<f0a083ae> 18749\n<f0a0848c> 17614\n<f0a0848e> 17628\n<f0a08498> 16777\n<f0a086a4> 19047\n<f0a086a9> 17235\n<f0a086ab> 14776\n<f0a08781> 16714\n<f0a08794> 15153\n<f0a087b2> 16228\n<f0a08884> 16656\n<f0a0888c> 14787\n<f0a08894> 18139\n<f0a088b9> 19051\n<f0a0899b> 15161\n<f0a089b4> 14521\n<f0a089b5> 14785\n<f0a08a99> 15146\n<f0a08a9e> 16735\n<f0a08aa0> 16415\n<f0a08ab7> 18397\n<f0a08abf> 15458\n<f0a08b80> 14783\n<f0a08ba5> 16447\n<f0a08c8a> 14779\n<f0a08ca5> 18068\n<f0a08d81> 17169\n<f0a08d85> 14847\n<f0a08d86> 15776\n<f0a08d87> 16430\n<f0a08dbe> 16427\n<f0a08dbf> 18107\n<f0a08e80> 16429\n<f0a08ea0> 18398\n<f0a08ea7> 15538\n<f0a08eb5> 18776\n<f0a08f89> 16874\n<f0a08f8b> 14777\n<f0a08fb5> 15613\n<f0a08fbc> 18719\n<f0a09093> 14879\n<f0a09094> 14780\n<f0a0909f> 16432\n<f0a091a5> 14770\n<f0a09287> 16441\n<f0a0928e> 16101\n<f0a09291> 14816\n<f0a09292> 14815\n<f0a092a3> 14814\n<f0a09397> 18400\n<f0a093bc> 17241\n<f0a093be> 15548\n<f0a09587> 16395\n<f0a0968e> 16449\n<f0a096a5> 16660\n<f0a096b3> 16454\n<f0a09783> 18779\n<f0a0978a> 15788\n<f0a09790> 17803\n<f0a09795> 18402\n<f0a0979f> 16397\n<f0a097a0> 14812\n<f0a097ab> 15056\n<f0a09891> 15790\n<f0a09895> 18403\n<f0a09899> 18142\n<f0a0989a> 15561\n<f0a098b0> 14571\n<f0a09996> 16761\n<f0a099b6> 18404\n<f0a09c8e> 14819\n<f0a09cb1> 17232\n<f0a09db9> 15805\n<f0a0a0ac> 15200\n<f0a0a1b3> 14822\n<f0a0a395> 18141\n<f0a0a496> 15191\n<f0a0a4a3> 16889\n<f0a0a594> 16491\n<f0a0a5b9> 18695\n<f0a0a7a7> 17781\n<f0a0a891> 15855\n<f0a0a990> 14441\n<f0a0a9af> 19022\n<f0a0aa8a> 19100\n<f0a0aab4> 15590\n<f0a0ab82> 18408\n<f0a0ab8d> 18409\n<f0a0ac8d> 18081\nendcidchar\n\n100 begincidchar\n<f0a0ae8f> 16530\n<f0a0ae9f> 19057\n<f0a0aea8> 14760\n<f0a0aea9> 17875\n<f0a0aebf> 18410\n<f0a0af86> 14849\n<f0a0af8b> 18412\n<f0a0afa2> 16495\n<f0a0afab> 15562\n<f0a0afbb> 18414\n<f0a0afbf> 16445\n<f0a0b08b> 17848\n<f0a0b08d> 15154\n<f0a0b0a0> 14828\n<f0a0b0b4> 17291\n<f0a0b0ba> 17038\n<f0a0b0bb> 18415\n<f0a0b181> 16012\n<f0a0b182> 17163\n<f0a0b183> 17228\n<f0a0b193> 18416\n<f0a0b1a5> 18417\n<f0a0b1b7> 16535\n<f0a0b1b8> 15804\n<f0a0b1bc> 18418\n<f0a0b28d> 18419\n<f0a0b296> 16013\n<f0a0b29c> 18629\n<f0a0b2b5> 18420\n<f0a0b2b8> 15563\n<f0a0b38f> 18228\n<f0a0b393> 16698\n<f0a0b394> 16216\n<f0a0b395> 17185\n<f0a0b396> 17910\n<f0a0b39d> 18421\n<f0a0b3ad> 18422\n<f0a0b3bf> 15559\n<f0a0b495> 17164\n<f0a0b4a8> 16135\n<f0a0b4b1> 14481\n<f0a0b4b2> 16920\n<f0a0b586> 17196\n<f0a0b587> 17871\n<f0a0b588> 17876\n<f0a0b589> 18658\n<f0a0b58c> 15144\n<f0a0b58d> 16551\n<f0a0b58e> 16621\n<f0a0b5af> 18423\n<f0a0b5b1> 16136\n<f0a0b5b4> 16543\n<f0a0b5bc> 17183\n<f0a0b696> 17855\n<f0a0b69c> 17254\n<f0a0b6a7> 16037\n<f0a0b6b2> 18424\n<f0a0b788> 18425\n<f0a0b884> 18426\n<f0a0b889> 17264\n<f0a0b88a> 18682\n<f0a0b88d> 14761\n<f0a0b88e> 18427\n<f0a0b88f> 17905\n<f0a0b890> 17914\n<f0a0b891> 17929\n<f0a0b896> 14275\n<f0a0b89d> 14832\n<f0a0b98c> 17873\n<f0a0b9ad> 18647\n<f0a0b9b3> 18431\n<f0a0b9b5> 16824\n<f0a0b9b6> 16015\n<f0a0b9b7> 17906\n<f0a0b9b8> 17915\n<f0a0b9b9> 17920\n<f0a0b9ba> 17290\n<f0a0b9bb> 17933\n<f0a0ba8c> 17866\n<f0a0ba96> 17189\n<f0a0ba98> 17887\n<f0a0ba9d> 16000\n<f0a0baa2> 16017\n<f0a0baaa> 17868\n<f0a0baab> 17874\n<f0a0baac> 18676\n<f0a0bab6> 16104\n<f0a0bb97> 18428\n<f0a0bb98> 18071\n<f0a0bb9d> 16549\n<f0a0bbb8> 15878\n<f0a0bbb9> 16058\n<f0a0bbba> 17904\n<f0a0bbbb> 17907\n<f0a0bc9d> 15506\n<f0a0bca6> 15358\n<f0a0bcad> 18430\n<f0a0bcae> 17888\n<f0a0bcb0> 17870\n<f0a0bcb1> 17859\nendcidchar\n\n100 begincidchar\n<f0a0bcbb> 16338\n<f0a0bd8c> 17243\n<f0a0bda4> 17191\n<f0a0be8d> 17867\n<f0a0be90> 18429\n<f0a0bead> 17882\n<f0a0beb4> 17184\n<f0a0beb5> 17932\n<f0a0beb6> 17936\n<f0a0bebc> 18432\n<f0a0bf9f> 14759\n<f0a0bfaa> 18657\n<f0a0bfab> 18679\n<f0a0bfac> 18681\n<f0a0bfad> 18683\n<f0a18094> 14424\n<f0a1818f> 18434\n<f0a1819c> 18433\n<f0a181af> 17853\n<f0a181b5> 16021\n<f0a181b6> 18435\n<f0a181b7> 17852\n<f0a181b8> 17916\n<f0a181bb> 17328\n<f0a18288> 18436\n<f0a18296> 18437\n<f0a1829d> 17251\n<f0a182b4> 16566\n<f0a182bf> 18439\n<f0a18380> 17877\n<f0a18381> 18663\n<f0a18387> 17296\n<f0a18388> 17268\n<f0a18389> 17913\n<f0a1838f> 17861\n<f0a18393> 17330\n<f0a183a4> 14830\n<f0a183b4> 17847\n<f0a184af> 18440\n<f0a184bb> 18441\n<f0a184bd> 17878\n<f0a18585> 17717\n<f0a18588> 17917\n<f0a1858f> 17872\n<f0a18680> 17937\n<f0a18687> 18684\n<f0a18799> 18673\n<f0a188bc> 16603\n<f0a1898f> 16583\n<f0a189bc> 14504\n<f0a18aa8> 14725\n<f0a18aa9> 18707\n<f0a18ab0> 15634\n<f0a18ba3> 18443\n<f0a18bbe> 17332\n<f0a18c82> 15399\n<f0a18c83> 14882\n<f0a18c84> 15698\n<f0a18c85> 16417\n<f0a18cb6> 18445\n<f0a18cba> 16717\n<f0a18db5> 18444\n<f0a18db6> 18781\n<f0a18e8e> 16787\n<f0a18e98> 15638\n<f0a18e9c> 15596\n<f0a18f85> 15900\n<f0a18f86> 14726\n<f0a18fad> 15922\n<f0a18fbe> 14724\n<f0a19093> 15509\n<f0a19096> 16592\n<f0a190a4> 15539\n<f0a190bf> 18943\n<f0a19192> 15629\n<f0a19194> 16594\n<f0a19195> 17919\n<f0a1928a> 14249\n<f0a19297> 16956\n<f0a192b6> 14727\n<f0a193a8> 15402\n<f0a193bd> 14260\n<f0a195b7> 18446\n<f0a19682> 14337\n<f0a19696> 16511\n<f0a1988a> 15896\n<f0a19893> 16512\n<f0a19899> 18447\n<f0a198be> 16615\n<f0a199a1> 14217\n<f0a19a92> 16618\n<f0a19ab8> 16647\n<f0a19aba> 18405\n<f0a19b80> 14721\n<f0a19b81> 17128\n<f0a19b82> 15568\n<f0a19b93> 14580\n<f0a19b95> 16631\n<f0a19b9f> 14402\n<f0a19ba6> 15140\nendcidchar\n\n100 begincidchar\n<f0a19ba7> 17043\n<f0a19ba8> 16503\n<f0a19bba> 14860\n<f0a19bbb> 14714\n<f0a19bbc> 14974\n<f0a19bbe> 14903\n<f0a19c8d> 16548\n<f0a19c90> 14862\n<f0a19ca6> 16497\n<f0a19cba> 15659\n<f0a19cbb> 14915\n<f0a19cbc> 15673\n<f0a19d97> 15470\n<f0a19dac> 18711\n<f0a19dad> 16193\n<f0a19dae> 15148\n<f0a19daf> 14861\n<f0a19db0> 16779\n<f0a19db1> 16703\n<f0a19db3> 14266\n<f0a19db4> 14717\n<f0a19eab> 14913\n<f0a19eb0> 15175\n<f0a19eb1> 15883\n<f0a19eb2> 16627\n<f0a19eb3> 15666\n<f0a19eb4> 14276\n<f0a19eb5> 15493\n<f0a19f83> 18448\n<f0a19f87> 18449\n<f0a19f99> 15536\n<f0a19f9a> 15296\n<f0a19f9b> 15663\n<f0a19f9c> 16624\n<f0a19f9f> 18134\n<f0a19faf> 14705\n<f0a19fb5> 18638\n<f0a19fb6> 18650\n<f0a19fb8> 14712\n<f0a19fb9> 14197\n<f0a19fba> 15566\n<f0a19fbb> 16626\n<f0a19fbc> 16788\n<f0a1a0a0> 15886\n<f0a1a0a8> 16630\n<f0a1a0a9> 16812\n<f0a1a0aa> 14979\n<f0a1a0ad> 18451\n<f0a1a0b9> 14715\n<f0a1a0ba> 17941\n<f0a1a0bb> 18728\n<f0a1a180> 15235\n<f0a1a185> 15275\n<f0a1a192> 15570\n<f0a1a19e> 14251\n<f0a1a1a1> 14870\n<f0a1a1a2> 15587\n<f0a1a1a3> 14616\n<f0a1a1a4> 15100\n<f0a1a1b7> 18767\n<f0a1a1bb> 18651\n<f0a1a283> 15578\n<f0a1a284> 14808\n<f0a1a285> 14710\n<f0a1a29e> 17076\n<f0a1a29f> 15527\n<f0a1a2a0> 14901\n<f0a1a2a1> 15237\n<f0a1a2a2> 14343\n<f0a1a2be> 14707\n<f0a1a2bf> 15577\n<f0a1a391> 14718\n<f0a1a396> 15505\n<f0a1a397> 16561\n<f0a1a398> 15239\n<f0a1a399> 14965\n<f0a1a3ba> 14685\n<f0a1a485> 15669\n<f0a1a490> 14416\n<f0a1a491> 16645\n<f0a1a492> 15016\n<f0a1a495> 14526\n<f0a1a49c> 15832\n<f0a1a4a2> 14747\n<f0a1a4a7> 14912\n<f0a1a4bb> 14636\n<f0a1a584> 18742\n<f0a1a598> 16897\n<f0a1a5aa> 18452\n<f0a1a5bc> 14894\n<f0a1a680> 18872\n<f0a1a683> 16451\n<f0a1a688> 17078\n<f0a1a696> 14893\n<f0a1a79b> 16407\n<f0a1a7b3> 14869\n<f0a1a8ad> 18453\n<f0a1a8b4> 16658\n<f0a1a985> 18454\n<f0a1a98b> 17082\nendcidchar\n\n100 begincidchar\n<f0a1a9a3> 18998\n<f0a1ad84> 16665\n<f0a1af81> 17633\n<f0a1af82> 18380\n<f0a1b0aa> 18455\n<f0a1b1b0> 18456\n<f0a1b2a2> 18677\n<f0a1b2a5> 16669\n<f0a1b2ac> 18457\n<f0a1b586> 18732\n<f0a1b593> 19089\n<f0a1b59e> 19010\n<f0a1b690> 15823\n<f0a1b6b6> 18905\n<f0a1b6ba> 14907\n<f0a1b78a> 17802\n<f0a1b791> 16142\n<f0a1b7ab> 14991\n<f0a1b7b9> 16677\n<f0a1b89c> 17117\n<f0a1b8a3> 19043\n<f0a1b8b7> 16678\n<f0a1b8bd> 18773\n<f0a1ba89> 14471\n<f0a1baa4> 16682\n<f0a1baa8> 15792\n<f0a1bb88> 18458\n<f0a1bb95> 18459\n<f0a1bc8f> 16139\n<f0a1bc95> 18460\n<f0a1bdaa> 16731\n<f0a1be9e> 18144\n<f0a1bea1> 15938\n<f0a1bfa8> 17621\n<f0a28185> 18462\n<f0a28189> 16688\n<f0a281be> 18889\n<f0a2829a> 15782\n<f0a28387> 17275\n<f0a283bc> 16446\n<f0a284aa> 16879\n<f0a2859b> 18104\n<f0a285b3> 16689\n<f0a285ba> 15874\n<f0a286a1> 17854\n<f0a28781> 19058\n<f0a28783> 15799\n<f0a28888> 17287\n<f0a289bc> 18465\n<f0a28ca1> 15292\n<f0a28ca5> 14451\n<f0a28ebd> 15635\n<f0a28f90> 16720\n<f0a28f97> 18466\n<f0a28fba> 18467\n<f0a291a5> 18696\n<f0a291b1> 16721\n<f0a2928b> 16905\n<f0a29291> 16923\n<f0a292b0> 18632\n<f0a292bc> 19141\n<f0a29381> 19143\n<f0a29389> 19144\n<f0a2938c> 19145\n<f0a293ad> 16419\n<f0a29493> 16425\n<f0a2949b> 16294\n<f0a294b0> 16448\n<f0a29594> 16644\n<f0a2968d> 15871\n<f0a296af> 14924\n<f0a296be> 14925\n<f0a2989b> 14931\n<f0a2989c> 17144\n<f0a298ab> 14921\n<f0a299a8> 16733\n<f0a299ba> 18100\n<f0a29a96> 17880\n<f0a29a98> 16553\n<f0a29bb4> 18667\n<f0a29bb5> 15157\n<f0a29bb6> 14245\n<f0a29c92> 18909\n<f0a29c94> 14234\n<f0a29c9b> 15837\n<f0a29c9f> 15404\n<f0a29caa> 18468\n<f0a29db5> 17257\n<f0a29e81> 15411\n<f0a29e96> 19029\n<f0a29eb4> 16743\n<f0a29eb5> 17912\n<f0a29f8d> 16893\n<f0a2a083> 17862\n<f0a2a19f> 16765\n<f0a2a1a0> 14920\n<f0a2a1b1> 18469\n<f0a2a2ad> 17057\n<f0a2a381> 16772\n<f0a2a3b7> 16834\nendcidchar\n\n100 begincidchar\n<f0a2a4a6> 15881\n<f0a2a4b9> 17863\n<f0a2a58f> 18470\n<f0a2a5a7> 18471\n<f0a2a5ab> 15412\n<f0a2a680> 16771\n<f0a2a693> 18472\n<f0a2a9a6> 17250\n<f0a2ab8f> 17265\n<f0a2ab95> 18473\n<f0a2aba6> 17804\n<f0a2aba8> 18474\n<f0a2ac8e> 18475\n<f0a2aca2> 14943\n<f0a2acbf> 18476\n<f0a2ad83> 16032\n<f0a2adaa> 14941\n<f0a2af8a> 17219\n<f0a2af8e> 17293\n<f0a2b0a6> 15511\n<f0a2b0a7> 14350\n<f0a2b0b8> 17176\n<f0a2b18c> 18477\n<f0a2b191> 17294\n<f0a2b195> 17886\n<f0a2b1a2> 16016\n<f0a2b288> 18478\n<f0a2b29b> 14935\n<f0a2b2a1> 14954\n<f0a2b2a9> 17192\n<f0a2b2b2> 17278\n<f0a2b2b7> 18479\n<f0a2b382> 17201\n<f0a2b386> 17167\n<f0a2b389> 17857\n<f0a2b487> 14936\n<f0a2b488> 18481\n<f0a2b492> 18482\n<f0a2b584> 17210\n<f0a2b58c> 17851\n<f0a2b5a7> 14952\n<f0a2b68d> 17238\n<f0a2b695> 18484\n<f0a2b6a0> 18680\n<f0a2b6a3> 16533\n<f0a2b6a4> 17922\n<f0a2b6b7> 18483\n<f0a2b7ae> 17896\n<f0a2b88d> 16781\n<f0a2b8b6> 16790\n<f0a2b982> 18485\n<f0a2b9b8> 14946\n<f0a2ba8b> 17286\n<f0a2bab3> 16034\n<f0a2bbaf> 18084\n<f0a2bdb4> 18486\n<f0a2bf8c> 18487\n<f0a2bfa3> 15633\n<f0a380b3> 18488\n<f0a38184> 17024\n<f0a3818b> 16950\n<f0a381a6> 18489\n<f0a381bd> 14611\n<f0a381be> 18772\n<f0a3828e> 14959\n<f0a382b7> 14546\n<f0a382bc> 14547\n<f0a3839a> 18706\n<f0a38483> 14978\n<f0a384bd> 17957\n<f0a385bd> 14278\n<f0a38682> 14983\n<f0a386b3> 14969\n<f0a38788> 16831\n<f0a38789> 15471\n<f0a387aa> 19099\n<f0a387b9> 16922\n<f0a3888f> 14982\n<f0a388a5> 15325\n<f0a388af> 15923\n<f0a388b1> 16829\n<f0a388b2> 15105\n<f0a388b3> 16450\n<f0a388b4> 14980\n<f0a38996> 19028\n<f0a3899e> 19101\n<f0a389a2> 14448\n<f0a38a81> 18869\n<f0a38a89> 14968\n<f0a38a8a> 16569\n<f0a38aab> 14962\n<f0a38aac> 17124\n<f0a38aad> 14960\n<f0a38b92> 14993\n<f0a38ba0> 14964\n<f0a38ba1> 14994\n<f0a38c80> 15707\n<f0a38c8a> 14527\n<f0a38c9f> 18490\n<f0a38eb4> 16443\nendcidchar\n\n100 begincidchar\n<f0a38f8c> 15819\n<f0a38f9e> 18491\n<f0a38fa6> 16852\n<f0a38fb4> 17883\n<f0a38fb5> 18730\n<f0a38fb9> 18911\n<f0a38fba> 15644\n<f0a38fbe> 15002\n<f0a39080> 16816\n<f0a390bf> 15209\n<f0a39190> 14944\n<f0a391af> 16855\n<f0a391b2> 14908\n<f0a393a5> 15639\n<f0a39499> 15864\n<f0a394b0> 14265\n<f0a39591> 19037\n<f0a3959a> 14279\n<f0a395a7> 18492\n<f0a39695> 14804\n<f0a39699> 14708\n<f0a3969c> 15451\n<f0a396bb> 19148\n<f0a3978d> 16861\n<f0a3978e> 14287\n<f0a3978f> 15194\n<f0a397b3> 18493\n<f0a39880> 16423\n<f0a39897> 18982\n<f0a3989a> 18494\n<f0a398bc> 16865\n<f0a39980> 15452\n<f0a39999> 16878\n<f0a3999f> 15059\n<f0a399b7> 18748\n<f0a39a8e> 19131\n<f0a39a9e> 19090\n<f0a39aa6> 14729\n<f0a39aad> 15647\n<f0a39aba> 18659\n<f0a39b9f> 15641\n<f0a39bae> 14739\n<f0a39c83> 16881\n<f0a39c96> 18495\n<f0a39ca0> 18703\n<f0a39cad> 16471\n<f0a39caf> 15898\n<f0a39cbf> 14750\n<f0a39da6> 14220\n<f0a39e81> 15110\n<f0a39ea2> 15001\n<f0a39ebc> 14999\n<f0a39f82> 16840\n<f0a39f95> 15010\n<f0a39f96> 15643\n<f0a39f97> 15448\n<f0a3a0ba> 14998\n<f0a3a782> 17269\n<f0a3aaa7> 18497\n<f0a3ab9b> 16895\n<f0a3abae> 14895\n<f0a3abba> 18138\n<f0a3ac9a> 19033\n<f0a3ad9a> 16900\n<f0a3b1a3> 18914\n<f0a3b299> 16455\n<f0a3b29a> 15024\n<f0a3b29b> 14478\n<f0a3b2b5> 18085\n<f0a3b2b7> 15963\n<f0a3b387> 18738\n<f0a3b388> 16409\n<f0a3b389> 16917\n<f0a3b3bc> 18674\n<f0a3b3bd> 18720\n<f0a3b3be> 18697\n<f0a3b3bf> 15794\n<f0a3b580> 15979\n<f0a3b59b> 15582\n<f0a3b5be> 14258\n<f0a3b68f> 15242\n<f0a3b6b6> 18701\n<f0a3b6b7> 15514\n<f0a3b6b8> 15405\n<f0a3b6b9> 14361\n<f0a3b6ba> 15147\n<f0a3b6bb> 14446\n<f0a3b6bc> 16911\n<f0a3b6bd> 16913\n<f0a3b7a3> 14237\n<f0a3b7b8> 14267\n<f0a3b886> 18999\n<f0a3b891> 18498\n<f0a3b8ac> 18705\n<f0a3b8ad> 15609\n<f0a3b8ae> 14505\n<f0a3b8af> 16944\n<f0a3b8b0> 16954\n<f0a3b8b1> 14734\n<f0a3b8b9> 14805\nendcidchar\n\n100 begincidchar\n<f0a3ba88> 18648\n<f0a3ba89> 14809\n<f0a3ba8a> 14794\n<f0a3ba8b> 14283\n<f0a3bab9> 18499\n<f0a3babf> 14806\n<f0a3bb97> 14123\n<f0a3bbb7> 18704\n<f0a3bbb8> 15058\n<f0a3bbb9> 15683\n<f0a3bbba> 15136\n<f0a3bbbb> 14736\n<f0a3bbbc> 16902\n<f0a3bcb5> 15067\n<f0a3bd81> 18054\n<f0a3bd8a> 15809\n<f0a3bda1> 19000\n<f0a3bdbf> 15036\n<f0a3be80> 16490\n<f0a3be81> 15935\n<f0a3be82> 16946\n<f0a3be8f> 18091\n<f0a3beb4> 16973\n<f0a3beb7> 16764\n<f0a3bf80> 15023\n<f0a3bf85> 16398\n<f0a3bfab> 16532\n<f0a3bfac> 16492\n<f0a3bfad> 15608\n<f0a3bfae> 15333\n<f0a3bfaf> 15835\n<f0a3bfb0> 16972\n<f0a48091> 16381\n<f0a480b9> 16971\n<f0a480ba> 16562\n<f0a480bb> 15786\n<f0a480bc> 15039\n<f0a480bd> 16957\n<f0a48197> 14192\n<f0a48285> 16934\n<f0a4828b> 14752\n<f0a4828c> 18771\n<f0a4828d> 14841\n<f0a48291> 16969\n<f0a48389> 14845\n<f0a483a1> 14751\n<f0a483ac> 19042\n<f0a48484> 15427\n<f0a4848f> 14753\n<f0a48499> 18500\n<f0a484bf> 16974\n<f0a48580> 16978\n<f0a48584> 16967\n<f0a4858e> 18855\n<f0a48595> 16970\n<f0a4859c> 14572\n<f0a4859f> 17071\n<f0a485a1> 19097\n<f0a485b7> 17942\n<f0a485ba> 15908\n<f0a486a3> 18669\n<f0a486a4> 16914\n<f0a486a5> 16585\n<f0a486ac> 15488\n<f0a486b5> 15480\n<f0a4878d> 16844\n<f0a487a2> 17042\n<f0a487bc> 15670\n<f0a4889b> 15354\n<f0a4898b> 18102\n<f0a48996> 15697\n<f0a48999> 15688\n<f0a489b6> 15047\n<f0a489b7> 16992\n<f0a489b8> 16608\n<f0a48a84> 15271\n<f0a48a93> 15681\n<f0a48a95> 14871\n<f0a48aa5> 15678\n<f0a48abf> 18981\n<f0a48b81> 17001\n<f0a48b89> 14984\n<f0a48b8a> 15686\n<f0a48bae> 18501\n<f0a48bba> 15510\n<f0a48c8d> 18502\n<f0a48c9a> 15046\n<f0a48cb4> 18503\n<f0a48d88> 14681\n<f0a48da2> 15631\n<f0a48da3> 16595\n<f0a48da4> 14648\n<f0a48da5> 16998\n<f0a48e8c> 14827\n<f0a48e96> 18504\n<f0a48e9c> 16837\n<f0a48ebd> 15695\n<f0a48f81> 15512\n<f0a48fa9> 15701\n<f0a48faa> 15323\nendcidchar\n\n100 begincidchar\n<f0a48fb2> 16119\n<f0a48fb8> 14703\n<f0a49084> 18505\n<f0a490b5> 16564\n<f0a490b6> 14768\n<f0a4919a> 17003\n<f0a4919b> 15685\n<f0a491b3> 14702\n<f0a49287> 15011\n<f0a49288> 15499\n<f0a492b9> 14696\n<f0a492bc> 16697\n<f0a4938e> 15693\n<f0a49393> 17194\n<f0a49396> 18506\n<f0a49485> 18917\n<f0a494a1> 15844\n<f0a495b8> 14175\n<f0a49788> 17240\n<f0a49898> 16079\n<f0a498aa> 15005\n<f0a499a5> 14940\n<f0a499b4> 18508\n<f0a49a97> 15109\n<f0a49b94> 14937\n<f0a49c86> 18664\n<f0a49ca5> 15053\n<f0a49caf> 18509\n<f0a49e8f> 15052\n<f0a49fa0> 16066\n<f0a49faf> 17355\n<f0a4a092> 18510\n<f0a4a0a3> 17030\n<f0a4a282> 14173\n<f0a4a3a9> 17653\n<f0a4a3b0> 15112\n<f0a4a3b1> 16906\n<f0a4a3b2> 18159\n<f0a4a3b3> 15095\n<f0a4a3bb> 18511\n<f0a4a3bf> 15321\n<f0a4a480> 16916\n<f0a4a481> 16687\n<f0a4a48c> 16915\n<f0a4a496> 15542\n<f0a4a497> 15061\n<f0a4a499> 18721\n<f0a4a4af> 15299\n<f0a4a4b3> 16413\n<f0a4a4b4> 15846\n<f0a4a4be> 18716\n<f0a4a4bf> 15816\n<f0a4a580> 16808\n<f0a4a581> 15472\n<f0a4a582> 16404\n<f0a4a583> 15558\n<f0a4a5a2> 18119\n<f0a4a5a3> 18709\n<f0a4a5b4> 17019\n<f0a4a5b5> 14677\n<f0a4a5b6> 15544\n<f0a4a5bb> 18952\n<f0a4a5bf> 16933\n<f0a4a682> 16749\n<f0a4a688> 15930\n<f0a4a689> 14961\n<f0a4a68a> 14425\n<f0a4a68b> 15520\n<f0a4a68c> 15145\n<f0a4a68d> 17048\n<f0a4a68e> 15089\n<f0a4a68f> 16750\n<f0a4a694> 14732\n<f0a4a6a4> 16440\n<f0a4a6a7> 14264\n<f0a4a6a9> 16637\n<f0a4a6ab> 15088\n<f0a4a6ac> 14829\n<f0a4a6ad> 15575\n<f0a4a6b7> 17047\n<f0a4a6b8> 15401\n<f0a4a6b9> 15519\n<f0a4a6ba> 15773\n<f0a4a6bb> 14678\n<f0a4a785> 15094\n<f0a4a790> 15876\n<f0a4a79a> 17940\n<f0a4a79e> 15453\n<f0a4a79f> 16783\n<f0a4a7a3> 14951\n<f0a4a7a5> 15540\n<f0a4a7ac> 18116\n<f0a4a7ad> 15331\n<f0a4a7b6> 15834\n<f0a4a7b7> 15210\n<f0a4a7b8> 14680\n<f0a4a7b9> 15174\n<f0a4a7bb> 17049\n<f0a4a88e> 14793\n<f0a4a892> 18782\nendcidchar\n\n100 begincidchar\n<f0a4a893> 18920\n<f0a4a895> 18512\n<f0a4a8a1> 16838\n<f0a4a8a2> 17005\n<f0a4a8a3> 16802\n<f0a4a8a4> 17044\n<f0a4a8a5> 14723\n<f0a4a8a6> 17053\n<f0a4a8a7> 17004\n<f0a4a8a8> 16801\n<f0a4a8a9> 14587\n<f0a4a8aa> 15885\n<f0a4a8be> 15534\n<f0a4a982> 15322\n<f0a4a985> 15787\n<f0a4a98a> 15060\n<f0a4a98e> 15092\n<f0a4a98f> 18129\n<f0a4a990> 15569\n<f0a4a991> 14682\n<f0a4a99d> 18133\n<f0a4a9a5> 14253\n<f0a4a9a6> 15537\n<f0a4a9a7> 15369\n<f0a4a9b1> 15632\n<f0a4a9b7> 18725\n<f0a4a9b8> 15332\n<f0a4a9b9> 17072\n<f0a4a9ba> 14398\n<f0a4aa8c> 17070\n<f0a4aa93> 18634\n<f0a4aa94> 15535\n<f0a4aa95> 14254\n<f0a4aa96> 15119\n<f0a4aaa4> 15055\n<f0a4aaa5> 15934\n<f0a4aaa6> 16464\n<f0a4aaa7> 15810\n<f0a4aab1> 16424\n<f0a4aab2> 15361\n<f0a4aab3> 15529\n<f0a4aaba> 15116\n<f0a4aabb> 16285\n<f0a4aabc> 14840\n<f0a4ab80> 18513\n<f0a4ab87> 15117\n<f0a4ab8a> 18605\n<f0a4ab91> 14525\n<f0a4ab9f> 15065\n<f0a4aba2> 18714\n<f0a4aba9> 14534\n<f0a4ac8f> 19083\n<f0a4adae> 18692\n<f0a4afb5> 16597\n<f0a4b089> 15286\n<f0a4b29e> 18649\n<f0a4b29f> 15645\n<f0a4b389> 18093\n<f0a4b399> 15079\n<f0a4b486> 15080\n<f0a4b493> 17092\n<f0a4b6b8> 17171\n<f0a4b7aa> 17181\n<f0a4b7ab> 17908\n<f0a4b8bb> 17282\n<f0a4b990> 17921\n<f0a4baa5> 17360\n<f0a4baa7> 17200\n<f0a4bc8e> 18751\n<f0a4bd9c> 17364\n<f0a4be82> 17090\n<f0a4be86> 18515\n<f0a4be97> 15491\n<f0a4be9a> 15827\n<f0a4bea9> 18699\n<f0a4beb8> 18080\n<f0a4bf82> 18678\n<f0a580ac> 18516\n<f0a58192> 17227\n<f0a5829d> 17115\n<f0a584ab> 17165\n<f0a58588> 18660\n<f0a585bd> 17116\n<f0a585be> 17934\n<f0a5878d> 18859\n<f0a587a3> 17865\n<f0a587a6> 16826\n<f0a587a7> 15103\n<f0a588a0> 17122\n<f0a588a1> 15102\n<f0a58990> 16730\n<f0a58a99> 18518\n<f0a58b87> 17207\n<f0a58b98> 17938\n<f0a58c8e> 14153\n<f0a58c91> 18653\n<f0a58c93> 16832\n<f0a59099> 18519\n<f0a590a5> 14976\n<f0a590af> 14711\nendcidchar\n\n100 begincidchar\n<f0a590b0> 14392\n<f0a59186> 18520\n<f0a591ac> 14555\n<f0a591ae> 18521\n<f0a5929a> 19075\n<f0a594b1> 18741\n<f0a594b5> 18201\n<f0a594bf> 18522\n<f0a5959b> 14975\n<f0a5959c> 14735\n<f0a5959d> 15465\n<f0a5959e> 18523\n<f0a595a2> 18524\n<f0a595a5> 14393\n<f0a595a6> 18525\n<f0a59681> 15122\n<f0a59684> 14971\n<f0a5968f> 14973\n<f0a596b9> 14476\n<f0a59795> 15554\n<f0a5979b> 14480\n<f0a597a0> 17137\n<f0a59885> 17016\n<f0a598b5> 18643\n<f0a59991> 14774\n<f0a59a83> 15253\n<f0a59a95> 18925\n<f0a59ba3> 15130\n<f0a59bb6> 15710\n<f0a59c86> 14573\n<f0a59c9d> 16792\n<f0a59ca5> 14596\n<f0a59cbd> 17947\n<f0a59db2> 16520\n<f0a59f87> 18526\n<f0a59f9f> 15342\n<f0a59fa0> 14127\n<f0a59fa1> 15839\n<f0a5a197> 17149\n<f0a5a19d> 18527\n<f0a5a1b2> 14996\n<f0a5a388> 15386\n<f0a5a39e> 19093\n<f0a5a3a1> 14132\n<f0a5a483> 18528\n<f0a5a586> 14868\n<f0a5a596> 18644\n<f0a5a6ac> 14136\n<f0a5a78c> 16659\n<f0a5a994> 18997\n<f0a5aa95> 18694\n<f0a5aa9c> 15159\n<f0a5aaae> 18529\n<f0a5aaaf> 15158\n<f0a5aba9> 15201\n<f0a5adb4> 17956\n<f0a5ae89> 18530\n<f0a5aeb3> 15170\n<f0a5aeb4> 14158\n<f0a5af86> 15164\n<f0a5afa4> 14303\n<f0a5afa8> 18480\n<f0a5b081> 14149\n<f0a5b086> 18531\n<f0a5b0a1> 16211\n<f0a5b18a> 18652\n<f0a5b1a5> 18074\n<f0a5b291> 14320\n<f0a5b2a4> 18924\n<f0a5b380> 14322\n<f0a5b381> 14170\n<f0a5b3be> 14154\n<f0a5b4a0> 14164\n<f0a5b4b0> 18861\n<f0a5b583> 15202\n<f0a5b699> 19139\n<f0a5b6b9> 19124\n<f0a5b88e> 15204\n<f0a5b989> 17274\n<f0a5ba81> 18646\n<f0a5ba82> 15188\n<f0a5ba83> 14876\n<f0a5baa6> 15172\n<f0a5babc> 15171\n<f0a5bb97> 18739\n<f0a5bb98> 18655\n<f0a5bc9a> 16344\n<f0a5bd8b> 14719\n<f0a5bfa1> 15062\n<f0a5bfa2> 15780\n<f0a680a1> 19091\n<f0a680a9> 14193\n<f0a68188> 16071\n<f0a681a4> 15449\n<f0a68283> 18784\n<f0a68297> 17242\n<f0a682a4> 15518\n<f0a682a5> 17850\n<f0a68482> 18534\n<f0a684a1> 14201\nendcidchar\n\n100 begincidchar\n<f0a68599> 18729\n<f0a6859a> 14202\n<f0a6859b> 15517\n<f0a6859c> 15185\n<f0a686ad> 18746\n<f0a686ae> 15120\n<f0a686b2> 18535\n<f0a6879d> 16979\n<f0a68998> 15964\n<f0a689a1> 15184\n<f0a689aa> 17658\n<f0a689ab> 18757\n<f0a68b90> 14212\n<f0a68cb5> 16133\n<f0a68d8b> 17660\n<f0a68d8c> 18754\n<f0a68d91> 14215\n<f0a68ebe> 15348\n<f0a68fb5> 17103\n<f0a68fb8> 15197\n<f0a69082> 18536\n<f0a69090> 14522\n<f0a69091> 15851\n<f0a69092> 15196\n<f0a6918a> 18537\n<f0a691a9> 15860\n<f0a69284> 18538\n<f0a69288> 18539\n<f0a69289> 14223\n<f0a6928d> 14142\n<f0a69298> 14247\n<f0a69492> 18540\n<f0a695b2> 17899\n<f0a696a0> 15213\n<f0a696ad> 15211\n<f0a696bf> 18541\n<f0a69892> 17663\n<f0a698a6> 14236\n<f0a69aaf> 18641\n<f0a69ab1> 14757\n<f0a69ab5> 18542\n<f0a69b9a> 17223\n<f0a69ba8> 14238\n<f0a69bbc> 18544\n<f0a69c96> 17224\n<f0a69d81> 15515\n<f0a69e99> 18546\n<f0a69eb3> 18702\n<f0a69eb4> 15223\n<f0a69f8c> 16362\n<f0a6a09c> 17860\n<f0a6a186> 18750\n<f0a6a19e> 18548\n<f0a6a1ae> 18547\n<f0a6a288> 16719\n<f0a6a28a> 16044\n<f0a6a293> 18666\n<f0a6a387> 18549\n<f0a6a48e> 17108\n<f0a6a491> 17107\n<f0a6a4a6> 18550\n<f0a6a4b9> 18551\n<f0a6a591> 17664\n<f0a6a6a8> 18101\n<f0a6a6b5> 15921\n<f0a6a7b2> 17180\n<f0a6a7ba> 18552\n<f0a6a8ad> 18553\n<f0a6a8ae> 17039\n<f0a6a8b4> 18554\n<f0a6a982> 15225\n<f0a6a991> 15228\n<f0a6a992> 14257\n<f0a6ac85> 14285\n<f0a6ac8a> 18082\n<f0a6ac93> 16485\n<f0a6ac95> 18958\n<f0a6aca3> 18995\n<f0a6aca8> 16670\n<f0a6ad90> 17889\n<f0a6ad91> 16907\n<f0a6ad92> 15812\n<f0a6ad93> 16542\n<f0a6ad9b> 18555\n<f0a6adb5> 15190\n<f0a6ae82> 15439\n<f0a6ae96> 14311\n<f0a6ae97> 14286\n<f0a6ae9d> 18556\n<f0a6aeb3> 16416\n<f0a6af80> 15625\n<f0a6afb7> 15830\n<f0a6b0a1> 14754\n<f0a6b180> 15490\n<f0a6b181> 19048\n<f0a6b186> 19069\n<f0a6b1be> 16590\n<f0a6b1bf> 14159\n<f0a6b280> 15661\n<f0a6b281> 16622\nendcidchar\n\n100 begincidchar\n<f0a6b282> 15654\n<f0a6b2a4> 18557\n<f0a6b2b7> 15648\n<f0a6b2b8> 14520\n<f0a6b2bd> 15849\n<f0a6b380> 15508\n<f0a6b383> 14230\n<f0a6b391> 15216\n<f0a6b4a2> 18713\n<f0a6b4a3> 18718\n<f0a6b4a4> 14986\n<f0a6b4a5> 16926\n<f0a6b4a6> 15652\n<f0a6b4a7> 14579\n<f0a6b4a8> 15691\n<f0a6b4a9> 16421\n<f0a6b4aa> 16623\n<f0a6b591> 15653\n<f0a6b5b4> 18956\n<f0a6b6a0> 16853\n<f0a6b6a1> 16927\n<f0a6b6a2> 14660\n<f0a6b6a3> 14284\n<f0a6b6a4> 15442\n<f0a6b6a5> 14293\n<f0a6b6a6> 16628\n<f0a6b6a7> 15230\n<f0a6b6ae> 18558\n<f0a6b79c> 18744\n<f0a6b7aa> 15075\n<f0a6b7ab> 16928\n<f0a6b7b0> 15444\n<f0a6b880> 15447\n<f0a6b885> 16291\n<f0a6b887> 15916\n<f0a6b892> 15437\n<f0a6b982> 14301\n<f0a6b983> 14313\n<f0a6b984> 14184\n<f0a6b985> 16633\n<f0a6b9ae> 16723\n<f0a6b9b2> 16935\n<f0a6b9b7> 14312\n<f0a6ba84> 15443\n<f0a6ba88> 19137\n<f0a6ba8b> 18984\n<f0a6ba99> 18086\n<f0a6bb90> 18671\n<f0a6bb91> 18733\n<f0a6bb92> 16758\n<f0a6bb93> 14125\n<f0a6bb94> 14297\n<f0a6bb95> 14512\n<f0a6bb96> 14186\n<f0a6bb97> 14453\n<f0a6bca6> 14741\n<f0a6bdb3> 14927\n<f0a6bdb4> 16937\n<f0a6be9f> 17113\n<f0a6bea1> 16643\n<f0a6bebe> 18959\n<f0a6bf9e> 15655\n<f0a6bf9f> 15438\n<f0a7808e> 17789\n<f0a7818b> 18559\n<f0a78192> 14737\n<f0a78193> 15662\n<f0a78288> 14335\n<f0a782ad> 18745\n<f0a782ae> 18710\n<f0a782af> 15906\n<f0a7838d> 14338\n<f0a78392> 18985\n<f0a783b8> 16732\n<f0a78489> 18127\n<f0a7848c> 14428\n<f0a7848d> 18954\n<f0a784a6> 17155\n<f0a784a7> 15215\n<f0a785a4> 18712\n<f0a785a5> 14733\n<f0a785b5> 14569\n<f0a7878d> 18560\n<f0a7889b> 15232\n<f0a789a7> 18970\n<f0a78a80> 18561\n<f0a78a85> 18562\n<f0a78a8b> 18563\n<f0a78ab2> 16092\n<f0a78ab6> 18672\n<f0a78ba6> 18564\n<f0a78d92> 18983\n<f0a78e9a> 14345\n<f0a78fbf> 19072\n<f0a790a2> 15244\n<f0a79190> 18566\n<f0a79284> 15579\n<f0a79286> 16356\n<f0a795b4> 17285\n<f0a796a3> 16069\nendcidchar\n\n100 begincidchar\n<f0a797a0> 14360\n<f0a797a4> 14362\n<f0a797bd> 14917\n<f0a797be> 15781\n<f0a79887> 14008\n<f0a7988c> 17141\n<f0a798b2> 15814\n<f0a798b9> 17292\n<f0a79995> 18642\n<f0a79996> 18740\n<f0a79997> 15779\n<f0a79a94> 17930\n<f0a79c8f> 14369\n<f0a79cb5> 17723\n<f0a79cb6> 15684\n<f0a79d81> 15129\n<f0a79d9e> 17303\n<f0a79e84> 15256\n<f0a79e85> 15255\n<f0a79f8c> 18568\n<f0a7a198> 18569\n<f0a7a1b0> 14990\n<f0a7a29d> 15957\n<f0a7a2b2> 17668\n<f0a7a388> 17849\n<f0a7a4a4> 14378\n<f0a7a5a7> 18297\n<f0a7a5ba> 14562\n<f0a7a6a0> 17225\n<f0a7a79d> 18571\n<f0a7a7bd> 18572\n<f0a7a88a> 18573\n<f0a7a88e> 16653\n<f0a7a8be> 15961\n<f0a7a993> 16751\n<f0a7a999> 14384\n<f0a7a9b9> 15771\n<f0a7aa84> 16422\n<f0a7aabd> 14379\n<f0a7aabe> 14456\n<f0a7abb4> 15709\n<f0a7ac86> 15379\n<f0a7ac8b> 18574\n<f0a7ac98> 15711\n<f0a7acb8> 14388\n<f0a7acb9> 17151\n<f0a7acba> 14386\n<f0a7ad88> 15186\n<f0a7ada5> 19134\n<f0a7afaf> 19008\n<f0a7afb4> 15640\n<f0a7b092> 15825\n<f0a7b1ac> 18991\n<f0a7b2b1> 18973\n<f0a7b385> 18975\n<f0a7b4af> 18668\n<f0a7b593> 14410\n<f0a7b594> 14406\n<f0a7b5a6> 18575\n<f0a7b5b3> 18670\n<f0a7b684> 17845\n<f0a7b68f> 14407\n<f0a7b698> 14412\n<f0a7b6bd> 14413\n<f0a7b79c> 15279\n<f0a7b98d> 15694\n<f0a7b98f> 15604\n<f0a7bcae> 16106\n<f0a7bfb9> 16061\n<f0a88082> 14423\n<f0a88089> 18576\n<f0a8809e> 15030\n<f0a880a3> 18577\n<f0a880a4> 15960\n<f0a88188> 18578\n<f0a88283> 18579\n<f0a88290> 18580\n<f0a882bd> 17902\n<f0a882be> 17174\n<f0a883a8> 15899\n<f0a883a9> 17198\n<f0a883b4> 18581\n<f0a884ae> 18582\n<f0a8858f> 18583\n<f0a8859d> 17179\n<f0a885af> 15920\n<f0a88689> 17384\n<f0a886af> 18584\n<f0a886bc> 14427\n<f0a88887> 17918\n<f0a88898> 15599\n<f0a8889a> 18585\n<f0a88996> 17193\n<f0a889bc> 17943\n<f0a88a9b> 17272\n<f0a88b8d> 17931\n<f0a88ba2> 16005\n<f0a88c86> 18586\n<f0a88c98> 15914\n<f0a88caf> 18587\nendcidchar\n\n100 begincidchar\n<f0a88cba> 14221\n<f0a88da5> 14436\n<f0a88dad> 14199\n<f0a88dbd> 16263\n<f0a88e8a> 18588\n<f0a89092> 14437\n<f0a891a8> 18589\n<f0a891ac> 17801\n<f0a891b3> 15882\n<f0a89282> 16706\n<f0a89481> 18097\n<f0a894bc> 14455\n<f0a894bd> 14445\n<f0a895ac> 14458\n<f0a897a8> 15796\n<f0a897b4> 16830\n<f0a89880> 14607\n<f0a8988b> 14459\n<f0a898a5> 14332\n<f0a898bb> 14333\n<f0a89aaa> 18590\n<f0a89aab> 16508\n<f0a89ab2> 19071\n<f0a89abc> 18096\n<f0a89b98> 14503\n<f0a89ba6> 14463\n<f0a89c8f> 18877\n<f0a89c93> 14461\n<f0a8a084> 17033\n<f0a8a0ab> 17031\n<f0a8a48d> 19098\n<f0a8a4b3> 14470\n<f0a8a588> 15822\n<f0a8a589> 15928\n<f0a8a596> 18592\n<f0a8a5a4> 17126\n<f0a8a5a8> 17127\n<f0a8a5ac> 14695\n<f0a8a5ad> 19059\n<f0a8a5be> 14687\n<f0a8a689> 15345\n<f0a8a6a8> 14909\n<f0a8a6aa> 16414\n<f0a8a6ab> 15907\n<f0a8a6b8> 18593\n<f0a8a6bc> 16552\n<f0a8a780> 18044\n<f0a8a79c> 15031\n<f0a8a79e> 14444\n<f0a8a7a1> 15689\n<f0a8a7a3> 18892\n<f0a8a7a4> 16405\n<f0a8a7b9> 15260\n<f0a8a7ba> 15521\n<f0a8a7bb> 14886\n<f0a8a7bc> 15502\n<f0a8a88f> 18747\n<f0a8a896> 15551\n<f0a8a8a5> 14376\n<f0a8a8a9> 16736\n<f0a8a8b2> 18863\n<f0a8a8b6> 16726\n<f0a8a984> 14691\n<f0a8a985> 15372\n<f0a8a986> 14859\n<f0a8a987> 14906\n<f0a8a988> 14241\n<f0a8a989> 15494\n<f0a8a98a> 16869\n<f0a8a98b> 15306\n<f0a8a999> 18150\n<f0a8a99a> 18726\n<f0a8aa81> 15586\n<f0a8aa82> 15556\n<f0a8aa83> 15642\n<f0a8aa9a> 15785\n<f0a8aa9b> 16515\n<f0a8aa9c> 14818\n<f0a8ab80> 15574\n<f0a8ab86> 14477\n<f0a8ab8b> 15028\n<f0a8ab8c> 15087\n<f0a8ab8e> 15550\n<f0a8ab9e> 16487\n<f0a8ab9f> 16858\n<f0a8aba0> 14516\n<f0a8aba1> 14484\n<f0a8aba2> 14487\n<f0a8aba3> 15099\n<f0a8aba5> 14488\n<f0a8abaa> 18885\n<f0a8abbc> 15308\n<f0a8ac8c> 14479\n<f0a8ac93> 14763\n<f0a8aca1> 16942\n<f0a8aca2> 14972\n<f0a8acab> 18783\n<f0a8acac> 18636\n<f0a8acad> 18735\n<f0a8acaf> 15347\nendcidchar\n\n100 begincidchar\n<f0a8ad86> 18596\n<f0a8ad8c> 17231\n<f0a8ad8e> 15801\n<f0a8ad90> 15368\n<f0a8ada3> 15526\n<f0a8ada4> 15370\n<f0a8ada5> 15385\n<f0a8ada6> 16581\n<f0a8adac> 18639\n<f0a8ae8f> 17073\n<f0a8ae99> 18640\n<f0a8ae9c> 15259\n<f0a8ae9d> 16767\n<f0a8aeb9> 19005\n<f0a8af82> 18731\n<f0a8af85> 15360\n<f0a8af94> 18597\n<f0a8af97> 14878\n<f0a8af99> 15258\n<f0a8af9a> 14684\n<f0a8afa7> 15553\n<f0a8afa8> 17007\n<f0a8afa9> 14129\n<f0a8afaa> 15027\n<f0a8afab> 14485\n<f0a8afac> 14491\n<f0a8afb5> 15257\n<f0a8afbf> 14493\n<f0a8b083> 17075\n<f0a8b089> 18598\n<f0a8b09c> 15624\n<f0a8b09d> 15310\n<f0a8b0a3> 15066\n<f0a8b0a6> 15346\n<f0a8b0ab> 14655\n<f0a8b0b0> 15925\n<f0a8b0b9> 14492\n<f0a8b0bb> 15311\n<f0a8b38a> 17300\n<f0a8b38d> 17289\n<f0a8b392> 17298\n<f0a8b4b4> 15318\n<f0a8b699> 17299\n<f0a8b6b9> 18942\n<f0a8b88f> 17675\n<f0a8b8b6> 14688\n<f0a8b8b9> 16332\n<f0a8b9a5> 15329\n<f0a8b9a6> 15328\n<f0a8ba97> 16202\n<f0a8baac> 17084\n<f0a8bab2> 17059\n<f0a8bab3> 14784\n<f0a8bb99> 17081\n<f0a8bba7> 15327\n<f0a8bf85> 18599\n<f0a981b9> 19062\n<f0a98288> 14926\n<f0a9828b> 14668\n<f0a98293> 15341\n<f0a982af> 14523\n<f0a982b0> 15338\n<f0a982b1> 14598\n<f0a98380> 15854\n<f0a983a4> 15601\n<f0a983a5> 14524\n<f0a983ac> 18600\n<f0a983ad> 16845\n<f0a9848d> 17158\n<f0a98490> 18601\n<f0a984bc> 18602\n<f0a9858d> 14938\n<f0a9859b> 18147\n<f0a9859e> 18604\n<f0a985b0> 16964\n<f0a9869c> 16886\n<f0a986a8> 15903\n<f0a98795> 14539\n<f0a987ab> 14542\n<f0a9909d> 14561\n<f0a990a0> 18151\n<f0a990b3> 14558\n<f0a990bf> 14966\n<f0a99188> 15268\n<f0a99390> 16132\n<f0a99399> 14133\n<f0a9939a> 15363\n<f0a993a5> 17172\n<f0a993a7> 18607\n<f0a9969e> 18700\n<f0a996b0> 18608\n<f0a996b8> 18609\n<f0a99797> 15365\n<f0a997a9> 15949\n<f0a997b4> 17204\n<f0a99ca0> 17279\n<f0a99cb2> 18610\n<f0a99f94> 17208\n<f0a9a090> 17681\n<f0a9a197> 14589\nendcidchar\n\n100 begincidchar\n<f0a9a2a4> 15893\n<f0a9a391> 18611\n<f0a9a3aa> 14945\n<f0a9a3b1> 15391\n<f0a9a3ba> 19055\n<f0a9a483> 18743\n<f0a9a485> 14590\n<f0a9a4af> 15434\n<f0a9a585> 19019\n<f0a9a587> 18884\n<f0a9a588> 15393\n<f0a9a589> 18612\n<f0a9a59d> 16768\n<f0a9a5aa> 18613\n<f0a9a69d> 14740\n<f0a9a783> 18614\n<f0a9a789> 15797\n<f0a9a8a8> 18615\n<f0a9a98d> 17197\n<f0a9ac85> 14602\n<f0a9ac8e> 18616\n<f0a9af95> 14599\n<f0a9b1b3> 18851\n<f0a9b2ad> 15892\n<f0a9b4be> 14614\n<f0a9b59a> 18617\n<f0a9b5bc> 16067\n<f0a9b698> 15973\n<f0a9b69b> 18618\n<f0a9b7b6> 17788\n<f0a9b886> 16122\n<f0a9b8ad> 15421\n<f0a9b9a8> 14621\n<f0a9baac> 16085\n<f0a9bab0> 19013\n<f0a9bb83> 17893\n<f0a9bbb8> 18620\n<f0a9bca3> 18621\n<f0a9bcb0> 18698\n<f0a9beb7> 14623\n<f0a9bf9e> 16090\n<f0aa8094> 18095\n<f0aa8287> 14229\n<f0aa82b9> 14639\n<f0aa83a1> 14626\n<f0aa83ad> 15432\n<f0aa83b3> 15433\n<f0aa83b8> 14348\n<f0aa83be> 15424\n<f0aa8487> 18870\n<f0aa84a3> 14627\n<f0aa84b3> 17791\n<f0aa84b4> 14631\n<f0aa8590> 16607\n<f0aa8692> 14624\n<f0aa8693> 14634\n<f0aa86ab> 14625\n<f0aa86b4> 15431\n<f0aa86b5> 19065\n<f0aa879f> 14628\n<f0aa87b5> 15423\n<f0aa88a0> 14635\n<f0aa88b3> 14637\n<f0aa8a93> 18624\n<f0aa8a9f> 14440\n<f0aa8ab2> 16276\n<f0aa8ab4> 14640\n<f0aa8ab6> 18145\n<f0aa8aba> 18880\n<f0aa8abd> 17939\n<f0aa8b9f> 15912\n<f0aa8bbf> 18626\n<f0aa8d91> 18987\n<f0aa8ea9> 17716\n<f0aa90b4> 16113\n<f0aa919b> 18111\n<f0aa9786> 15084\n<f0aa978b> 18627\n<f0aa9881> 17263\n<f0aa98b2> 17297\n<f0aa998a> 16254\n<f0aa999b> 17288\n<f0aa9aa9> 18675\n<f0aab7bf> 19152\n<f0afa086> 15843\n<f0afa0a5> 15704\n<f0afa0a8> 17316\n<f0afa0a9> 16486\n<f0afa0b2> 16510\n<f0afa0bb> 18411\n<f0afa180> 18727\n<f0afa1b8> 17634\n<f0afa294> 16715\n<f0afa2a6> 16757\n<f0afa38d> 15842\n<f0afa39b> 16841\n<f0afa488> 16943\n<f0afa4a2> 16392\n<f0afa4af> 17056\n<f0afa68f> 14263\nendcidchar\n\n6 begincidchar\n<f0afa694> 14270\n<f0afa6b2> 14339\n<f0afa6bc> 15241\n<f0afa794> 14408\n<f0afa797> 14421\n<f0afa89b> 14662\nendcidchar\n\n100 begincidrange\n<20> <7e> 1\n<c2a2> <c2a3> 262\n<ce91> <cea1> 417\n<cea3> <cea9> 434\n<ceb1> <cebf> 441\n<cf80> <cf81> 456\n<cf83> <cf89> 458\n<d090> <d095> 13930\n<d096> <d0b5> 13937\n<d0b6> <d0bf> 13970\n<d180> <d18f> 13980\n<e28098> <e28099> 166\n<e2809c> <e2809d> 168\n<e285a0> <e285a9> 343\n<e285b0> <e285b9> 526\n<e28696> <e28697> 249\n<e286b8> <e286b9> 13997\n<e288a9> <e288aa> 229\n<e289a6> <e289a7> 217\n<e28f9a> <e28f9b> 18844\n<e29080> <e2909f> 562\n<e291a0> <e291a9> 506\n<e291b4> <e291bd> 516\n<e295ad> <e295ae> 318\n<e295b1> <e295b3> 330\n<e29681> <e29688> 290\n<e297a2> <e297a3> 326\n<e2ba86> <e2ba88> 17693\n<e2ba8c> <e2ba8d> 17697\n<e2bb8c> <e2bb8d> 17710\n<e2bb96> <e2bb97> 17713\n<e2bc81> <e2bc83> 536\n<e2bc88> <e2bc8b> 603\n<e2bc8c> <e2bc8e> 541\n<e2bc97> <e2bc98> 612\n<e2bc9f> <e2bca0> 634\n<e2bca3> <e2bca6> 636\n<e2bca8> <e2bcab> 642\n<e2bcaf> <e2bcb0> 648\n<e2bcb1> <e2bcb2> 652\n<e2bcb3> <e2bcb5> 551\n<e2bcb6> <e2bcb8> 654\n<e2bcb9> <e2bcba> 554\n<e2bcbc> <e2bcbf> 720\n<e2bd82> <e2bd85> 726\n<e2bd87> <e2bd8d> 730\n<e2bd8f> <e2bd92> 737\n<e2bd94> <e2bd98> 741\n<e2bd9a> <e2bd9d> 746\n<e2bd9e> <e2bda4> 854\n<e2bda7> <e2bda8> 558\n<e2bda9> <e2bdb0> 867\n<e2bdb2> <e2bdb4> 875\n<e2bdb5> <e2bdb8> 1014\n<e2bdba> <e2bdbc> 1018\n<e2bdbd> <e2bdbf> 1022\n<e2be80> <e2be81> 1025\n<e2be82> <e2be8a> 1029\n<e2be8d> <e2be90> 1039\n<e2be92> <e2be97> 1288\n<e2be99> <e2bea0> 1294\n<e2bea3> <e2bea5> 1312\n<e2bea6> <e2bea9> 1686\n<e2beab> <e2beac> 1695\n<e2beaf> <e2beb9> 2086\n<e2beba> <e2bebc> 2549\n<e2bf80> <e2bf81> 2553\n<e2bf82> <e2bf87> 3041\n<e2bf88> <e2bf8a> 3515\n<e2bf8d> <e2bf8f> 3963\n<e2bf90> <e2bf91> 4352\n<e2bf93> <e2bf94> 5042\n<e38081> <e38082> 101\n<e38085> <e38087> 13754\n<e38088> <e38089> 148\n<e3808a> <e3808b> 144\n<e3808c> <e3808d> 152\n<e3808e> <e3808f> 156\n<e38090> <e38091> 140\n<e38094> <e38095> 136\n<e3809d> <e3809e> 170\n<e380a1> <e380a9> 353\n<e380b8> <e380ba> 362\n<e38181> <e381bf> 13761\n<e38280> <e38293> 13824\n<e3829b> <e3829c> 17606\n<e3829d> <e3829e> 13751\n<e382a1> <e382bf> 13844\n<e38380> <e383b6> 13875\n<e383bd> <e383be> 13749\n<e38485> <e384a9> 465\n<e38780> <e38784> 17609\n<e38786> <e38787> 17618\n<e38789> <e3878c> 17624\n<e3878d> <e3878e> 17629\n<e38e8e> <e38e8f> 277\n<e38e9c> <e38e9e> 272\n<e4b89e> <e4b89f> 878\n<e4b992> <e4b993> 880\n<e4ba83> <e4ba84> 9057\nendcidrange\n\n100 begincidrange\n<e4baab> <e4baac> 1326\n<e4baad> <e4baae> 1700\n<e4bb86> <e4bb87> 675\n<e4bb8a> <e4bb8b> 678\n<e4bb94> <e4bb97> 762\n<e4bba3> <e4bba4> 766\n<e4bc90> <e4bc91> 893\n<e4bd90> <e4bd91> 1056\n<e4bfb6> <e4bfb7> 7208\n<e5808c> <e5808d> 2099\n<e581a3> <e581a4> 7754\n<e582b2> <e582b3> 3521\n<e58486> <e58487> 10369\n<e58488> <e58489> 4360\n<e5848b> <e5848c> 10373\n<e584ad> <e584ae> 12047\n<e584b4> <e584b5> 12410\n<e584b7> <e584b8> 5736\n<e585ad> <e585ae> 684\n<e58689> <e5868a> 772\n<e586a4> <e586a5> 2131\n<e586b6> <e586b7> 1079\n<e58784> <e58785> 7222\n<e587b9> <e587ba> 775\n<e58880> <e58881> 608\n<e58886> <e58888> 689\n<e58891> <e58892> 913\n<e588a9> <e588aa> 1083\n<e588b2> <e588b3> 6420\n<e5899e> <e5899f> 7229\n<e589b4> <e589b5> 3059\n<e589bb> <e589bc> 9080\n<e58a80> <e58a81> 9763\n<e58a87> <e58a89> 4364\n<e58a8b> <e58a8c> 10377\n<e58aa9> <e58aaa> 1087\n<e58aad> <e58aae> 6200\n<e58ba2> <e58ba3> 3536\n<e58bbe> <e58bbf> 693\n<e58c85> <e58c86> 781\n<e58c8a> <e58c8b> 6425\n<e58db0> <e58db1> 921\n<e58db7> <e58db9> 1372\n<e58e8e> <e58e8f> 6205\n<e590b5> <e590b6> 1112\n<e59385> <e59386> 6786\n<e593b7> <e593b8> 7253\n<e595b5> <e595b6> 7771\n<e59785> <e59786> 3552\n<e597a3> <e597a4> 3547\n<e5988d> <e5988e> 3992\n<e598af> <e598b0> 4383\n<e59a8c> <e59a8d> 11586\n<e59aa6> <e59aa7> 12417\n<e59abd> <e59abe> 13002\n<e59c81> <e59c82> 7259\n<e59c83> <e59c84> 2169\n<e59c92> <e59c93> 3556\n<e59ca2> <e59ca3> 6042\n<e59db3> <e59db4> 6463\n<e59e9e> <e59e9f> 6797\n<e5a0b0> <e5a0b1> 3099\n<e5a39e> <e5a39f> 5496\n<e5a3b9> <e5a3ba> 3104\n<e5a499> <e5a49a> 948\n<e5a4b7> <e5a4b8> 950\n<e5a587> <e5a588> 1411\n<e5a597> <e5a598> 2177\n<e5a8ad> <e5a8ae> 7280\n<e5acbd> <e5acbf> 12425\n<e5ad8b> <e5ad8c> 13180\n<e5ad90> <e5ad91> 639\n<e5ad97> <e5ad98> 959\n<e5ad9a> <e5ad9b> 1151\n<e5ae87> <e5ae88> 961\n<e5ae9e> <e5ae9f> 17743\n<e5af98> <e5af99> 9144\n<e5afa5> <e5afa6> 4027\n<e5afb1> <e5afb2> 11609\n<e5b08a> <e5b08b> 3119\n<e5b180> <e5b181> 1157\n<e5b185> <e5b186> 1442\n<e5b18e> <e5b18f> 1799\n<e5b19c> <e5b19d> 2652\n<e5b1a4> <e5b1a5> 4404\n<e5b1a9> <e5b1aa> 12057\n<e5b1ba> <e5b1bb> 6112\n<e5b290> <e5b291> 1161\n<e5b393> <e5b394> 6849\n<e5b786> <e5b787> 12749\n<e5b7b1> <e5b7b3> 649\n<e5b882> <e5b883> 825\n<e5b8a1> <e5b8a3> 6858\n<e5b998> <e5b999> 9842\n<e5b9a7> <e5b9a8> 11062\n<e5b9ad> <e5b9ae> 12060\n<e5ba95> <e5ba96> 1461\n<e5bab2> <e5bab3> 7889\n<e5bab7> <e5bab8> 2672\n<e5bb81> <e5bb82> 3133\nendcidrange\n\n100 begincidrange\n<e5bbae> <e5bbaf> 12751\n<e5bc94> <e5bc95> 718\n<e5bca2> <e5bca4> 6515\n<e5bca6> <e5bca7> 1464\n<e5be80> <e5be81> 1467\n<e5be8a> <e5be8b> 1818\n<e5bea9> <e5beaa> 3138\n<e5bf80> <e5bf81> 12753\n<e68393> <e68394> 7902\n<e68589> <e6858a> 9173\n<e68592> <e68593> 9864\n<e685a2> <e685a3> 4052\n<e687ad> <e687ae> 12064\n<e68883> <e68884> 13336\n<e6888c> <e6888d> 977\n<e6889a> <e6889b> 2711\n<e688a1> <e688a2> 3610\n<e68982> <e68983> 6892\n<e68993> <e68994> 834\n<e68a8e> <e68a8f> 6288\n<e68b93> <e68b94> 1503\n<e68b96> <e68b97> 1518\n<e68c93> <e68c94> 6907\n<e68caa> <e68cab> 2257\n<e68d84> <e68d85> 7334\n<e68fad> <e68fae> 3175\n<e69096> <e69097> 3624\n<e690a2> <e690a3> 9205\n<e691b2> <e691b3> 9887\n<e692bb> <e692bc> 4795\n<e693ba> <e693bb> 5334\n<e69588> <e69589> 2262\n<e695a2> <e695a3> 3186\n<e695b7> <e695b8> 4463\n<e69682> <e69683> 5089\n<e6969d> <e6969e> 8564\n<e696b2> <e696b3> 10485\n<e69783> <e69784> 7361\n<e6978b> <e6978c> 2757\n<e697ac> <e697ad> 986\n<e69a87> <e69a88> 3632\n<e69b8a> <e69b8b> 11104\n<e69b9a> <e69b9b> 12081\n<e69ba3> <e69ba4> 12762\n<e69bad> <e69bae> 13445\n<e69bb2> <e69bb3> 988\n<e69bbe> <e69bbf> 3200\n<e69c8f> <e69c90> 6931\n<e69c92> <e69c93> 7368\n<e69c94> <e69c95> 2276\n<e69caa> <e69cab> 842\n<e69d8e> <e69d91> 1213\n<e69daf> <e69db0> 1550\n<e69db8> <e69db9> 6598\n<e69f89> <e69f8a> 6968\n<e6a0b2> <e6a0b3> 7373\n<e6a1ad> <e6a1ae> 7961\n<e6a39d> <e6a39e> 8615\n<e6a588> <e6a589> 9252\n<e6a98d> <e6a98e> 11141\n<e6aaae> <e6aaaf> 5346\n<e6aab6> <e6aab7> 12090\n<e6abae> <e6abaf> 12770\n<e6ac88> <e6ac89> 13190\n<e6ac91> <e6ac92> 13342\n<e6ac98> <e6ac99> 13516\n<e6acb7> <e6acb8> 7997\n<e6ada6> <e6ada7> 1563\n<e6ae8d> <e6ae8e> 8001\n<e6ae9e> <e6aea0> 9957\n<e6aeaa> <e6aeab> 11148\n<e6af83> <e6af84> 9960\n<e6af85> <e6af86> 4487\n<e6afab> <e6afac> 2793\n<e6afb2> <e6afb3> 8636\n<e6afb7> <e6afb8> 9292\n<e6afbb> <e6afbc> 9289\n<e6b099> <e6b09a> 6318\n<e6b0a0> <e6b0a1> 6980\n<e6b0a7> <e6b0a8> 2307\n<e6b0ae> <e6b0af> 3234\n<e6b18b> <e6b18c> 6152\n<e6b18d> <e6b18e> 1008\n<e6b19f> <e6b1a0> 1002\n<e6b288> <e6b289> 1231\n<e6b2bd> <e6b2be> 1575\n<e6b4bd> <e6b4be> 1915\n<e6b5a3> <e6b5a4> 7414\n<e6b79c> <e6b79d> 8023\n<e6b8b5> <e6b8b6> 8684\n<e6b8bc> <e6b8bd> 8645\n<e6b986> <e6b987> 8640\n<e6ba93> <e6ba94> 9300\n<e6bba8> <e6bba9> 18049\n<e6bc99> <e6bc9a> 9974\n<e6bf9f> <e6bfa0> 5110\n<e7808c> <e7808d> 12099\n<e780a1> <e780a3> 12463\n<e78183> <e78184> 13016\n<e78185> <e78186> 13021\nendcidrange\n\n100 begincidrange\n<e78188> <e78189> 13019\n<e78195> <e78197> 13193\n<e781a9> <e781aa> 13639\n<e781bc> <e781bd> 1255\n<e782b4> <e782b5> 7019\n<e78385> <e78387> 7463\n<e78395> <e78396> 16985\n<e78489> <e7848a> 2835\n<e78499> <e7849a> 3272\n<e78780> <e78781> 11189\n<e78783> <e78784> 4855\n<e7879a> <e7879b> 11200\n<e787bb> <e787bc> 5358\n<e78893> <e78894> 12788\n<e7889e> <e7889f> 13197\n<e788ac> <e788ad> 1605\n<e78989> <e7898a> 7023\n<e789bb> <e789bc> 8065\n<e78a88> <e78a89> 8703\n<e78a9d> <e78a9e> 11202\n<e78aa5> <e78aa6> 12475\n<e78ab4> <e78ab5> 6156\n<e78ba0> <e78ba1> 1942\n<e78d9e> <e78da0> 10602\n<e78da6> <e78da7> 11205\n<e78dae> <e78daf> 11683\n<e78e93> <e78e94> 6351\n<e78f97> <e78f98> 7495\n<e7909e> <e7909f> 18164\n<e790b5> <e790b6> 3292\n<e7918a> <e7918b> 9371\n<e7918f> <e79190> 9377\n<e7919b> <e7919c> 3715\n<e79289> <e7928a> 10612\n<e7939e> <e7939f> 7498\n<e793b4> <e793b5> 7500\n<e793b6> <e793b7> 2855\n<e79482> <e79483> 10035\n<e7948c> <e7948d> 4864\n<e79490> <e79492> 11694\n<e794a5> <e794a6> 3299\n<e794a8> <e794a9> 860\n<e794b0> <e794b3> 862\n<e794b7> <e794b8> 1266\n<e79587> <e79588> 7057\n<e795a5> <e795a6> 2859\n<e79694> <e79695> 6356\n<e79699> <e7969a> 1623\n<e796a2> <e796a3> 1960\n<e796a4> <e796a5> 1958\n<e796b2> <e796b3> 2361\n<e7978b> <e7978c> 8099\n<e79794> <e79795> 2864\n<e798a1> <e798a2> 4529\n<e79988> <e79989> 11700\n<e799b1> <e799b2> 5923\n<e799bb> <e799bc> 3310\n<e79a86> <e79a88> 1963\n<e79a9c> <e79a9e> 10633\n<e79b8d> <e79b8e> 2371\n<e79b9e> <e79b9f> 3728\n<e79c83> <e79c85> 7064\n<e79c8e> <e79c8f> 15106\n<e79c99> <e79c9a> 7523\n<e79c9f> <e79ca0> 2374\n<e79cb1> <e79cb2> 8109\n<e79d86> <e79d87> 8751\n<e79d8b> <e79d8c> 8758\n<e79d9f> <e79da0> 9410\n<e79e9e> <e79e9f> 4872\n<e79ea2> <e79ea3> 11236\n<e79ebb> <e79ebc> 5372\n<e79f89> <e79f8a> 12486\n<e79f8e> <e79f8f> 12799\n<e79f98> <e79f99> 13523\n<e79fa7> <e79fa8> 7071\n<e7a08c> <e7a08d> 1981\n<e7a091> <e7a092> 7074\n<e7a1a4> <e7a1a5> 8763\n<e7a285> <e7a286> 9427\n<e7a297> <e7a298> 3745\n<e7a383> <e7a384> 10649\n<e7a39f> <e7a3a0> 11251\n<e7a3a1> <e7a3a2> 11248\n<e7a3bb> <e7a3bc> 11717\n<e7a493> <e7a494> 12141\n<e7a4a7> <e7a4a8> 12805\n<e7a580> <e7a581> 1632\n<e7a5a9> <e7a5aa> 8128\n<e7a68a> <e7a68b> 10070\n<e7a68e> <e7a68f> 4164\n<e7a6b9> <e7a6ba> 1987\n<e7a791> <e7a792> 1989\n<e7a7ab> <e7a7ac> 7547\n<e7a7b6> <e7a7b7> 8136\n<e7a898> <e7a899> 9441\n<e7a98d> <e7a98e> 4880\n<e7a9a1> <e7a9a2> 5376\n<e7a9a7> <e7a9a8> 12497\n<e7a9ac> <e7a9ad> 12811\nendcidrange\n\n100 begincidrange\n<e7a9b0> <e7a9b1> 13209\n<e7aa8b> <e7aa8c> 7559\n<e7aa9f> <e7aaa0> 3764\n<e7aaab> <e7aaac> 10087\n<e7ab80> <e7ab81> 11734\n<e7ab82> <e7ab83> 14139\n<e7ab84> <e7ab85> 5379\n<e7ac80> <e7ac81> 7096\n<e7af86> <e7af87> 4559\n<e7afb0> <e7afb1> 11753\n<e7b0be> <e7b0bf> 5539\n<e7b1b8> <e7b1b9> 7099\n<e7b280> <e7b281> 7102\n<e7b2bd> <e7b2be> 4185\n<e7b390> <e7b391> 11281\n<e7b395> <e7b396> 4894\n<e7b3af> <e7b3b0> 5677\n<e7b4be> <e7b4bf> 8174\n<e7b6bd> <e7b6be> 4190\n<e7b78b> <e7b78c> 10122\n<e7b89f> <e7b8a0> 11287\n<e7b994> <e7b995> 5388\n<e7b9a9> <e7b9aa> 5548\n<e7ba87> <e7ba88> 13037\n<e7bcbe> <e7bcbf> 8817\n<e7bd80> <e7bd81> 14208\n<e7bda5> <e7bda6> 8819\n<e7bda7> <e7bda8> 9489\n<e7bda9> <e7bdaa> 3781\n<e7bdbb> <e7bdbc> 11303\n<e7be9c> <e7be9d> 8181\n<e7bea0> <e7bea1> 8822\n<e7bf8a> <e7bf8b> 8184\n<e7bf90> <e7bf91> 8187\n<e7bf94> <e7bf95> 3356\n<e7bf9b> <e7bf9c> 9495\n<e7bfa0> <e7bfa1> 4207\n<e7bfa2> <e7bfa3> 10135\n<e7bfb0> <e7bfb1> 4907\n<e7bfb7> <e7bfb8> 12175\n<e7bfbd> <e7bfbe> 12521\n<e8808e> <e8808f> 7112\n<e880bb> <e880bc> 14231\n<e8818f> <e88190> 8826\n<e881b1> <e881b2> 5193\n<e8828b> <e8828c> 1027\n<e88383> <e88384> 2014\n<e88599> <e8859a> 18253\n<e885b9> <e885ba> 3798\n<e8869b> <e8869d> 4586\n<e88791> <e88792> 12178\n<e887a0> <e887a1> 13533\n<e887b7> <e887b9> 8840\n<e888aa> <e888ab> 2456\n<e888bc> <e888bd> 8844\n<e88995> <e88997> 11324\n<e88998> <e88999> 4916\n<e889a8> <e889a9> 12829\n<e88a83> <e88a84> 6373\n<e88dbb> <e88dbc> 2948\n<e893a7> <e893a8> 10755\n<e894ac> <e894ad> 4596\n<e895a8> <e895a9> 4921\n<e895af> <e895b0> 18283\n<e897a4> <e897a5> 5560\n<e898b4> <e898b5> 13223\n<e89986> <e89988> 13535\n<e899ad> <e899ae> 6726\n<e89abb> <e89abc> 8266\n<e89abd> <e89abe> 8269\n<e89c82> <e89c83> 3830\n<e89ca6> <e89ca7> 10216\n<e89da3> <e89da4> 10768\n<e89e90> <e89e91> 11375\n<e89fb6> <e89fb7> 12554\n<e8a090> <e8a091> 12844\n<e8a094> <e8a095> 5695\n<e8a183> <e8a184> 7674\n<e8a185> <e8a186> 14358\n<e8a1b5> <e8a1b6> 7677\n<e8a281> <e8a282> 2490\n<e8a2b4> <e8a2b5> 14366\n<e8a381> <e8a382> 3410\n<e8a38d> <e8a38e> 9593\n<e8a3b1> <e8a3b2> 10225\n<e8a492> <e8a493> 4622\n<e8a497> <e8a499> 10804\n<e8a4ad> <e8a4ae> 11386\n<e8a590> <e8a591> 12233\n<e8a59a> <e8a59b> 12566\n<e8a5b9> <e8a5ba> 13538\n<e8a79a> <e8a79b> 8935\n<e8a7b2> <e8a7b3> 11865\n<e8a882> <e8a883> 2056\n<e8a984> <e8a985> 8944\n<e8a997> <e8a998> 8942\n<e8a9b2> <e8a9b3> 3848\n<e8ab94> <e8ab95> 10823\n<e8abb4> <e8abb5> 11400\n<e8ac81> <e8ac82> 4950\nendcidrange\n\n100 begincidrange\n<e8ad8e> <e8ad8f> 5577\n<e8adba> <e8adbb> 13076\n<e8ae94> <e8ae95> 13468\n<e8ae98> <e8ae99> 13543\n<e8b19c> <e8b19d> 8301\n<e8b1a8> <e8b1a9> 10250\n<e8b284> <e8b285> 9630\n<e8b291> <e8b292> 11414\n<e8b2a1> <e8b2a2> 2508\n<e8b387> <e8b388> 3871\n<e8b391> <e8b392> 4280\n<e8b3a2> <e8b3a3> 4652\n<e8b3ac> <e8b3ad> 4650\n<e8b486> <e8b487> 12595\n<e8b496> <e8b497> 5849\n<e8b5a8> <e8b5a9> 9633\n<e8b68e> <e8b68f> 9637\n<e8b693> <e8b694> 9640\n<e8b8a6> <e8b8a7> 10859\n<e8b8bc> <e8b8bd> 11432\n<e8ba96> <e8ba97> 13250\n<e8ba9e> <e8baa0> 13470\n<e8bba0> <e8bba1> 8318\n<e8bba7> <e8bba8> 8983\n<e8bc87> <e8bc88> 9662\n<e8bc90> <e8bc91> 10269\n<e8bc96> <e8bc97> 10874\n<e8bd86> <e8bd88> 12279\n<e8bd8f> <e8bd90> 12611\n<e8bd96> <e8bd97> 12866\n<e8bda6> <e8bda7> 17769\n<e8bebb> <e8bebc> 15723\n<e98281> <e98282> 5269\n<e9828a> <e9828b> 5593\n<e98297> <e98298> 6171\n<e98399> <e9839a> 7711\n<e983ab> <e983ac> 8333\n<e983b2> <e983b3> 8330\n<e984a9> <e984aa> 10883\n<e984b5> <e984b6> 11451\n<e984ba> <e984bb> 12284\n<e98584> <e98585> 13087\n<e9858e> <e9858f> 7722\n<e985ae> <e985af> 9679\n<e98681> <e98682> 10891\n<e98685> <e98686> 10888\n<e98690> <e98691> 11454\n<e986ab> <e986ac> 5436\n<e986b2> <e986b3> 12876\n<e987aa> <e987ab> 8348\n<e98894> <e98895> 3471\n<e98b83> <e98b84> 10896\n<e98bb3> <e98bb4> 18333\n<e98d90> <e98d91> 11923\n<e98f9c> <e98f9d> 5602\n<e99188> <e99189> 13262\n<e9918a> <e9918b> 13257\n<e99191> <e99192> 5856\n<e991a8> <e991a9> 13478\n<e991bd> <e991be> 5981\n<e99280> <e99281> 13625\n<e996a8> <e996a9> 4320\n<e996b9> <e996ba> 11500\n<e9978a> <e9978c> 5290\n<e99792> <e99793> 12317\n<e9979a> <e9979b> 12643\n<e9998b> <e9998d> 2083\n<e999a2> <e999a3> 2539\n<e999b6> <e999b7> 3031\n<e99a85> <e99a86> 3491\n<e99a88> <e99a89> 9040\n<e99a92> <e99a93> 9716\n<e99a94> <e99a95> 3934\n<e99aa7> <e99aa8> 4998\n<e99b86> <e99b87> 3499\n<e99b89> <e99b8a> 3938\n<e99c86> <e99c87> 4707\n<e99cab> <e99cac> 12647\n<e99cae> <e99caf> 12911\n<e99cb8> <e99cb9> 5793\n<e99cbd> <e99cbe> 5858\n<e99d9b> <e99d9c> 5008\n<e99db7> <e99db8> 9726\n<e99f84> <e99f85> 13388\n<e99f9d> <e99f9f> 12654\n<e99fbd> <e99fbe> 12915\n<e9a082> <e9a083> 3039\n<e9a085> <e9a086> 3504\n<e9a08d> <e9a08e> 9730\n<e9a090> <e9a091> 3947\n<e9a097> <e9a098> 4334\n<e9a190> <e9a192> 12343\n<e9a1a2> <e9a1a3> 12918\n<e9a1b3> <e9a1b4> 13607\n<e9a2ad> <e9a2ae> 10339\n<e9a381> <e9a382> 12921\n<e9a3bd> <e9a3be> 3955\n<e9a496> <e9a497> 10959\n<e9a4ab> <e9a4ac> 11973\n<e9a4be> <e9a4bf> 5470\nendcidrange\n\n100 begincidrange\n<e9a6a6> <e9a6a7> 12668\n<e9a793> <e9a794> 10965\n<e9a7bd> <e9a7be> 11993\n<e9a993> <e9a994> 13273\n<e9a99a> <e9a99b> 5907\n<e9a9a6> <e9a9a7> 13613\n<e9aaaf> <e9aab0> 4343\n<e9ab93> <e9ab94> 5910\n<e9abae> <e9abaf> 4731\n<e9ac84> <e9ac85> 12363\n<e9ac97> <e9ac98> 13125\n<e9ac9e> <e9aca0> 13393\n<e9acbe> <e9acbf> 10356\n<e9ad81> <e9ad82> 4346\n<e9ada0> <e9ada1> 10358\n<e9afaa> <e9afab> 12689\n<e9b0a8> <e9b0a9> 13135\n<e9b1b7> <e9b1b8> 5984\n<e9b3b1> <e9b3b2> 10361\n<e9b4ae> <e9b4af> 12019\n<e9b582> <e9b583> 12025\n<e9b5b4> <e9b5b5> 12719\n<e9b68b> <e9b68c> 12715\n<e9b6a6> <e9b6a7> 12980\n<e9b6b9> <e9b6ba> 13152\n<e9b7b9> <e9b7ba> 5947\n<e9b880> <e9b881> 13501\n<e9b9bc> <e9b9bd> 5949\n<e9ba86> <e9ba87> 11569\n<e9bb95> <e9bb96> 11573\n<e9bb9c> <e9bb9d> 5316\n<e9bbb2> <e9bbb3> 13427\n<e9bc8f> <e9bc90> 11006\n<e9bd80> <e9bd81> 12737\n<e9bd96> <e9bd98> 12740\n<e9bda6> <e9bda7> 5817\n<e9bdae> <e9bdaf> 13438\n<e9bdb4> <e9bdb6> 13510\n<e9bead> <e9beae> 18960\n<ee8080> <ee809e> 16395\n<ee80a0> <ee80a5> 16427\n<ee80a7> <ee80bf> 16434\n<ee8180> <ee8186> 16459\n<ee8187> <ee8188> 18758\n<ee8189> <ee819a> 16468\n<ee819c> <ee81a2> 16487\n<ee81a4> <ee81b2> 16495\n<ee81b4> <ee81bf> 16511\n<ee8280> <ee82a4> 16523\n<ee82a6> <ee82af> 16561\n<ee82b1> <ee82bf> 16572\n<ee8380> <ee838a> 16587\n<ee838c> <ee839d> 16599\n<ee839f> <ee83b2> 16618\n<ee83b4> <ee83b9> 16639\n<ee83bb> <ee83bf> 16645\n<ee8480> <ee8487> 16650\n<ee8489> <ee84ad> 16658\n<ee84af> <ee84b3> 16696\n<ee84b5> <ee84bf> 16702\n<ee8580> <ee8583> 16713\n<ee8585> <ee8588> 16717\n<ee858a> <ee858b> 16721\n<ee858d> <ee859c> 16723\n<ee859e> <ee85a5> 16739\n<ee85a8> <ee85ae> 16749\n<ee85b0> <ee85bf> 16756\n<ee8680> <ee8690> 16772\n<ee8692> <ee8693> 16789\n<ee8694> <ee8695> 18770\n<ee8696> <ee86a3> 16792\n<ee86a5> <ee86b9> 16807\n<ee86bc> <ee86bf> 16829\n<ee8780> <ee8785> 16833\n<ee8787> <ee8788> 16839\n<ee878a> <ee879f> 16842\n<ee87a1> <ee87bf> 16864\n<ee8882> <ee88ab> 16897\n<ee88ae> <ee88af> 16941\n<ee88b1> <ee88bf> 16944\n<ee8980> <ee8997> 16959\n<ee8999> <ee89a5> 16984\n<ee89a8> <ee89bf> 16998\n<ee8a80> <ee8a85> 17022\n<ee8a87> <ee8aa0> 17029\n<ee8aa4> <ee8aab> 17057\n<ee8aad> <ee8abb> 17065\n<ee8abd> <ee8abf> 17080\n<ee8b80> <ee8bae> 17083\n<ee8bb0> <ee8bb1> 18781\n<ee8bb2> <ee8bbe> 17131\n<ee8c81> <ee8c90> 17144\n<ee8c91> <ee8c95> 14123\n<ee8c97> <ee8cb9> 14128\n<ee8cbc> <ee8cbd> 18073\n<ee8cbe> <ee8cbf> 14166\n<ee8d81> <ee8d86> 14169\n<ee8d88> <ee8d8b> 14175\n<ee8d8d> <ee8d8e> 14180\n<ee8d90> <ee8d94> 14182\nendcidrange\n\n100 begincidrange\n<ee8d96> <ee8d99> 14187\n<ee8d9b> <ee8da2> 14192\n<ee8da4> <ee8da6> 14201\n<ee8da8> <ee8db7> 14205\n<ee8db9> <ee8dbb> 14221\n<ee8dbd> <ee8dbe> 14225\n<ee8e80> <ee8e93> 14228\n<ee8e95> <ee8e9d> 14248\n<ee8e9f> <ee8ea4> 14257\n<ee8ea6> <ee8ebf> 14264\n<ee8f80> <ee8f84> 14290\n<ee8f88> <ee8f8c> 14297\n<ee8f8e> <ee8f94> 14302\n<ee8f98> <ee8f9b> 14311\n<ee8f9d> <ee8fa6> 14316\n<ee8fa8> <ee8fbb> 14327\n<ee8fbd> <ee8fbf> 14348\n<ee9080> <ee9090> 14351\n<ee9094> <ee9095> 14369\n<ee9099> <ee90a5> 14374\n<ee90a7> <ee90ae> 14387\n<ee90b0> <ee90bf> 14396\n<ee9180> <ee9187> 14412\n<ee918b> <ee919f> 14422\n<ee91a1> <ee91a6> 14444\n<ee91a7> <ee91a9> 18095\n<ee91aa> <ee91b7> 14451\n<ee91bb> <ee91bf> 14467\n<ee9280> <ee9284> 14472\n<ee9286> <ee928e> 14477\n<ee9290> <ee92a0> 14486\n<ee92a2> <ee92bf> 14503\n<ee9380> <ee9384> 14533\n<ee9386> <ee9399> 14539\n<ee939b> <ee93bf> 14560\n<ee9480> <ee948c> 14597\n<ee948e> <ee9495> 14610\n<ee9497> <ee94a5> 14618\n<ee94a9> <ee94bf> 14634\n<ee9580> <ee9584> 14657\n<ee9586> <ee958d> 14663\n<ee958f> <ee95bf> 14672\n<ee9680> <ee9688> 14721\n<ee968a> <ee96a8> 14731\n<ee96aa> <ee96b1> 14763\n<ee96b3> <ee96bf> 14772\n<ee9780> <ee9791> 14785\n<ee9792> <ee9793> 281\n<ee9796> <ee97aa> 14803\n<ee97ac> <ee97b3> 14825\n<ee97b5> <ee97bf> 14834\n<ee9880> <ee9887> 14845\n<ee9889> <ee9894> 14853\n<ee9896> <ee98bf> 14865\n<ee9980> <ee9989> 14907\n<ee998b> <ee99a9> 14917\n<ee99ab> <ee99bf> 14948\n<ee9a80> <ee9a81> 14969\n<ee9a83> <ee9aa4> 14971\n<ee9aa6> <ee9aa7> 15005\n<ee9aa9> <ee9aaa> 15008\n<ee9aac> <ee9abf> 15010\n<ee9b80> <ee9b84> 15030\n<ee9b87> <ee9bb7> 15036\n<ee9bb9> <ee9bbf> 15086\n<ee9c80> <ee9ca6> 15093\n<ee9ca9> <ee9cbf> 15134\n<ee9d80> <ee9da8> 15157\n<ee9daa> <ee9db5> 15198\n<ee9db7> <ee9dba> 15210\n<ee9dbc> <ee9dbf> 15215\n<ee9e80> <ee9ebf> 15219\n<ee9f81> <ee9f92> 15283\n<ee9f94> <ee9fbc> 15302\n<ee9fbe> <ee9fbf> 15344\n<eea080> <eea089> 15346\n<eea08b> <eea0a2> 15357\n<eea0a4> <eea0bf> 15382\n<eea180> <eea1aa> 15410\n<eea1ac> <eea1bf> 15453\n<eea280> <eea283> 15473\n<eea285> <eea292> 15478\n<eea294> <eea2bf> 15493\n<eea380> <eea3bf> 15537\n<eea480> <eea4b6> 15601\n<eea4b7> <eea4b8> 18126\n<eea4b9> <eea4bf> 15658\n<eea580> <eea5a1> 15665\n<eea5a3> <eea5a7> 15700\n<eea5a8> <eea5a9> 18129\n<eea5ab> <eea5ac> 18131\n<eea5ae> <eea5b3> 18133\n<eea5b5> <eea5bf> 18139\n<eea681> <eea684> 18150\n<eea68e> <eea68f> 15711\n<eea690> <eea692> 18158\n<eea697> <eea698> 15715\n<eea699> <eea6a2> 18163\n<eea6a4> <eea6a8> 18173\n<eea6a9> <eea6aa> 17358\nendcidrange\n\n100 begincidrange\n<eea6ad> <eea6af> 18179\n<eea6b1> <eea6b3> 18182\n<eea6b5> <eea6b7> 18185\n<eea6b9> <eea6bd> 18188\n<eea785> <eea786> 17365\n<eea787> <eea78c> 18197\n<eea790> <eea791> 18204\n<eea798> <eea79e> 18208\n<eea7a0> <eea7a3> 18215\n<eea7a5> <eea7ab> 18219\n<eea7ad> <eea7b3> 18226\n<eea7b5> <eea7b9> 18233\n<eea7bb> <eea7bd> 18238\n<eea880> <eea884> 18242\n<eea886> <eea887> 18247\n<eea889> <eea88f> 18249\n<eea895> <eea89b> 18258\n<eea89d> <eea89f> 18265\n<eea8a1> <eea8a3> 18268\n<eea8a5> <eea8a7> 18271\n<eea8a9> <eea8b7> 18274\n<eea8b9> <eea8ba> 18289\n<eea8bc> <eea8bf> 18291\n<eea982> <eea983> 18296\n<eea985> <eea98c> 18298\n<eea98e> <eea98f> 18306\n<eea997> <eea99c> 18311\n<eea99e> <eea9a1> 18317\n<eea9a3> <eea9b6> 18321\n<eea9ba> <eea9bf> 18342\n<eeaa80> <eeaa85> 18348\n<eeaa87> <eeaa8b> 18354\n<eeaa8f> <eeaa92> 18360\n<eeaa99> <eeaa9f> 18366\n<eeaaa3> <eeaaaa> 18374\n<eeaaac> <eeaaad> 18382\n<eeaab1> <eeaab3> 18385\n<eeaab6> <eeaabc> 18388\n<eeaabe> <eeaabf> 18395\n<eeab80> <eeab81> 18397\n<eeab89> <eeab91> 18402\n<eeab93> <eeab9a> 18411\n<eeab9e> <eeaba3> 18420\n<eeaba4> <eeaba6> 15750\n<eeaba7> <eeabac> 18426\n<eeabb0> <eeabb2> 18433\n<eeabb5> <eeabb8> 18436\n<eeabba> <eeabbc> 18440\n<eeabbe> <eeabbf> 18443\n<eeac82> <eeac85> 18446\n<eeac87> <eeac8f> 18450\n<eeac91> <eeac93> 18459\n<eeac95> <eeac9d> 18462\n<eeac9f> <eeaca1> 18471\n<eeaca8> <eeaca9> 15766\n<eeacac> <eeacb9> 18478\n<eeacba> <eeacbd> 15768\n<eeacbe> <eeacbf> 18492\n<eead83> <eead84> 18494\n<eead88> <eead89> 15777\n<eead8b> <eead8c> 15779\n<eead8d> <eead8e> 18498\n<eead8f> <eead92> 15781\n<eead95> <eead96> 18501\n<eead98> <eead99> 18503\n<eead9a> <eeada1> 15787\n<eeada2> <eeada5> 18505\n<eeada8> <eeadad> 15796\n<eeadaf> <eeadb1> 18510\n<eeadb8> <eeadb9> 15805\n<eeadbe> <eeadbf> 18518\n<eeae80> <eeae82> 15809\n<eeae83> <eeae84> 18520\n<eeae8c> <eeae8e> 18524\n<eeae91> <eeae93> 15817\n<eeae96> <eeae97> 15821\n<eeae98> <eeae9a> 18529\n<eeae9c> <eeae9d> 18532\n<eeaea0> <eeaea1> 15825\n<eeaea3> <eeaea4> 15827\n<eeaea5> <eeaea6> 18536\n<eeaea7> <eeaea8> 15829\n<eeaeab> <eeaead> 15832\n<eeaeb2> <eeaeb3> 18541\n<eeaeb4> <eeaeb9> 15837\n<eeaebe> <eeaebf> 15845\n<eeaf80> <eeaf82> 15847\n<eeaf85> <eeaf86> 18546\n<eeaf8b> <eeaf8d> 15853\n<eeaf96> <eeaf99> 15859\n<eeaf9a> <eeaf9b> 18554\n<eeaf9c> <eeaf9d> 15863\n<eeafa2> <eeafa3> 15867\n<eeafa5> <eeafa7> 15869\n<eeafa8> <eeafa9> 18559\n<eeafab> <eeafac> 18561\n<eeafad> <eeafae> 15873\n<eeafb2> <eeafb3> 15876\n<eeafb4> <eeafb5> 18565\n<eeafb6> <eeafbf> 15878\nendcidrange\n\n100 begincidrange\n<eeb083> <eeb087> 15890\n<eeb088> <eeb08a> 18568\n<eeb08b> <eeb092> 15895\n<eeb096> <eeb098> 15905\n<eeb099> <eeb09c> 18572\n<eeb09d> <eeb09f> 15908\n<eeb0a1> <eeb0aa> 15911\n<eeb0ac> <eeb0ae> 15921\n<eeb0b0> <eeb0b1> 15924\n<eeb0b3> <eeb0be> 15926\n<eeb180> <eeb181> 18581\n<eeb185> <eeb189> 18584\n<eeb18b> <eeb18c> 18589\n<eeb18e> <eeb18f> 18591\n<eeb190> <eeb191> 15942\n<eeb196> <eeb198> 18595\n<eeb19c> <eeb19d> 18599\n<eeb19f> <eeb1a4> 18601\n<eeb1a9> <eeb1bb> 18608\n<eeb1be> <eeb1bf> 18627\n<eeb280> <eeb281> 18629\n<eeb283> <eeb286> 18631\n<eeb287> <eeb28a> 15952\n<eeb28e> <eeb28f> 15957\n<eeb290> <eeb291> 18637\n<eeb293> <eeb294> 18639\n<eeb29a> <eeb29d> 18643\n<eeb29e> <eeb29f> 15964\n<eeb2a1> <eeb2a2> 15966\n<eeb2a3> <eeb2a4> 18648\n<eeb2a7> <eeb2a8> 18650\n<eeb2a9> <eeb2aa> 15970\n<eeb2ad> <eeb2ae> 18653\n<eeb2af> <eeb2b3> 15973\n<eeb2b5> <eeb2b7> 15978\n<eeb2b8> <eeb2bb> 18656\n<eeb2bc> <eeb2bf> 15981\n<eeb380> <eeb39d> 15985\n<eeb39f> <eeb3a3> 16015\n<eeb3a5> <eeb3bf> 16021\n<eeb481> <eeb483> 16049\n<eeb485> <eeb486> 16052\n<eeb487> <eeb488> 18664\n<eeb48c> <eeb491> 18667\n<eeb495> <eeb497> 18674\n<eeb498> <eeb499> 16058\n<eeb49f> <eeb4a1> 16062\n<eeb4a3> <eeb4a5> 16065\n<eeb4a6> <eeb4a7> 18681\n<eeb4ab> <eeb4ac> 16070\n<eeb4ae> <eeb4b0> 16072\n<eeb4b1> <eeb4b2> 18685\n<eeb4b5> <eeb4b6> 16076\n<eeb4b9> <eeb4ba> 18689\n<eeb4bc> <eeb4bd> 18691\n<eeb4be> <eeb4bf> 16080\n<eeb580> <eeb582> 18693\n<eeb583> <eeb584> 16082\n<eeb586> <eeb589> 16084\n<eeb58a> <eeb58b> 18697\n<eeb58d> <eeb58e> 18699\n<eeb58f> <eeb590> 16090\n<eeb593> <eeb594> 18702\n<eeb595> <eeb596> 16093\n<eeb597> <eeb598> 18704\n<eeb599> <eeb5ad> 16095\n<eeb5af> <eeb5b0> 16117\n<eeb5b2> <eeb5b4> 16119\n<eeb5b5> <eeb5b7> 18707\n<eeb5b8> <eeb5b9> 16122\n<eeb5bd> <eeb5bf> 16126\n<eeb682> <eeb685> 16130\n<eeb687> <eeb688> 16134\n<eeb689> <eeb68a> 18713\n<eeb68b> <eeb69d> 16136\n<eeb69f> <eeb6a3> 16156\n<eeb6a5> <eeb6a6> 18715\n<eeb6a7> <eeb6ad> 16163\n<eeb6af> <eeb6bf> 16170\n<eeb780> <eeb790> 16187\n<eeb792> <eeb796> 16204\n<eeb798> <eeb79a> 16209\n<eeb79e> <eeb7a6> 16213\n<eeb7a9> <eeb7af> 16224\n<eeb7b1> <eeb7b3> 16232\n<eeb7b5> <eeb7bf> 16236\n<eeb881> <eeb894> 16247\n<eeb896> <eeb89a> 16267\n<eeb89c> <eeb8a1> 16272\n<eeb8a3> <eeb8af> 16278\n<eeb8b1> <eeb8bd> 16291\n<eeb980> <eeb987> 16306\n<eeb989> <eeb991> 16314\n<eeb993> <eeb995> 16324\n<eeb997> <eeb99a> 16327\n<eeb99c> <eeb99f> 16331\n<eeb9a1> <eeb9bd> 16335\n<eeba80> <eeba88> 16365\n<eeba8a> <eeba8d> 16374\n<eeba8f> <eeba97> 16379\nendcidrange\n\n100 begincidrange\n<eeba99> <eeba9b> 16389\n<eeba9e> <eeba9f> 16393\n<eebaa0> <eebaa6> 18736\n<eebaa8> <eebaaa> 18743\n<eebaac> <eebab7> 18746\n<ef8c83> <ef8c98> 17609\n<ef8c99> <ef8cbf> 18785\n<ef8d80> <ef8d89> 18824\n<ef8d8a> <ef8d8b> 18844\n<ef8ea0> <ef8ea1> 17716\n<ef8ea6> <ef8ea9> 17719\n<ef8eae> <ef8eb0> 17724\n<ef8eb2> <ef8ebf> 17727\n<ef8f80> <ef8fa3> 17741\n<ef8fae> <ef8fb0> 17779\n<ef8fb3> <ef8fbd> 17782\n<ef9080> <ef9081> 17794\n<ef9083> <ef908c> 17796\n<ef908e> <ef9096> 17806\n<ef909c> <ef909e> 17817\n<ef90a2> <ef90a7> 17821\n<ef90a8> <ef90a9> 17317\n<ef90aa> <ef90b7> 17827\n<ef90b9> <ef90bd> 17841\n<ef9180> <ef9189> 17163\n<ef918b> <ef9196> 17174\n<ef9198> <ef919a> 17187\n<ef919c> <ef919f> 17191\n<ef91a1> <ef91ad> 17196\n<ef91af> <ef91b1> 17210\n<ef91b5> <ef91b6> 17216\n<ef91bc> <ef91bf> 17223\n<ef9280> <ef9282> 17227\n<ef9284> <ef9285> 17231\n<ef9287> <ef928b> 17234\n<ef928d> <ef9290> 17240\n<ef9296> <ef92a2> 17249\n<ef92a4> <ef92a6> 17263\n<ef92a9> <ef92b0> 17268\n<ef92b1> <ef92b2> 17858\n<ef92b3> <ef92b7> 17278\n<ef92ba> <ef92bf> 17285\n<ef9383> <ef938f> 17861\n<ef9391> <ef939a> 17874\n<ef939b> <ef939c> 17292\n<ef939d> <ef939e> 17884\n<ef93a7> <ef93aa> 17298\n<ef93ab> <ef93ad> 17890\n<ef93af> <ef93b1> 17893\n<ef93b6> <ef93ba> 17897\n<ef93bc> <ef93bf> 17902\n<ef9480> <ef9481> 17906\n<ef9483> <ef94b7> 17908\n<ef94b8> <ef94bf> 17631\n<ef9580> <ef9594> 17639\n<ef9596> <ef95b5> 17660\n<ef95b9> <ef95bb> 18851\n<ef9680> <ef9683> 18858\n<ef968b> <ef968f> 18869\n<ef9693> <ef9694> 18877\n<ef9696> <ef9697> 18880\n<ef969b> <ef969c> 18884\n<ef96a3> <ef96a4> 18892\n<ef9784> <ef9785> 18924\n<ef9795> <ef9799> 18941\n<ef97a6> <ef97a8> 18954\n<ef97aa> <ef97ad> 18958\n<ef98b4> <ef98b5> 17961\n<ef98b7> <ef98bb> 17963\n<ef9980> <ef9981> 17969\n<ef9983> <ef9989> 17971\n<ef998b> <ef998d> 17978\n<ef9991> <ef9996> 17982\n<ef9998> <ef9999> 17988\n<ef999c> <ef99a7> 17990\n<ef99a9> <ef99b4> 18002\n<ef99b6> <ef99bf> 18014\n<ef9a80> <ef9aab> 18024\n<ef9aad> <ef9ab0> 18068\n<ef9ab1> <ef9abf> 506\n<ef9b80> <ef9b8e> 521\n<ef9b8f> <ef9b9e> 537\n<ef9ba0> <ef9ba2> 554\n<ef9ba8> <ef9bad> 13747\n<ef9bb0> <ef9bbf> 13754\n<ef9c80> <ef9cbf> 13770\n<ef9d80> <ef9dbf> 13834\n<ef9e80> <ef9ebf> 13898\n<ef9f80> <ef9fae> 13962\n<efa097> <efa09d> 14049\n<efa09e> <efa0a0> 17606\n<efa0a1> <efa0a9> 17692\n<efa0ab> <efa0b2> 17701\n<efa0b4> <efa0ba> 17709\n<efa180> <efa188> 18835\n<efb890> <efb892> 14099\n<efb8b5> <efb8b6> 130\n<efb8b7> <efb8b8> 134\n<efb8b9> <efb8ba> 138\n<efb8bb> <efb8bc> 142\nendcidrange\n\n25 begincidrange\n<efb8bd> <efb8be> 146\n<efb981> <efb982> 154\n<efb983> <efb984> 158\n<efb989> <efb98a> 199\n<efb98b> <efb98c> 203\n<efb98d> <efb98e> 201\n<efb990> <efb992> 112\n<efb994> <efb997> 116\n<efb999> <efb99e> 160\n<efb99f> <efb9a1> 205\n<efb9a2> <efb9a6> 223\n<efb9a9> <efb9ab> 268\n<efbc88> <efbc89> 128\n<efbc90> <efbc99> 333\n<efbca1> <efbcba> 365\n<efbd81> <efbd9a> 391\n<efbfa0> <efbfa1> 262\n<f0a0b5be> <f0a0b5bf> 17884\n<f0a1809d> <f0a1809e> 17924\n<f0a183b5> <f0a183b6> 17926\n<f0a1a483> <f0a1a484> 14898\n<f0a386a4> <f0a386a5> 16821\n<f0a387b7> <f0a387b8> 16818\n<f0a48596> <f0a48597> 16976\n<f0a8a7a7> <f0a8a7a8> 18594\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/UniCNS-UTF8-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniCNS-UTF8-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniCNS-UTF8-H)\n%%BeginResource: CMap (UniCNS-UTF8-V)\n%%Title: (UniCNS-UTF8-V Adobe CNS1 6)\n%%Version: 13.005\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution.\n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission.\n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniCNS-UTF8-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (CNS1) def\n  /Supplement 6 def\nend def\n\n/CMapName /UniCNS-UTF8-V def\n/CMapVersion 13.005 def\n/CMapType 1 def\n\n/XUID [1 10 25398] def\n\n/WMode 1 def\n\n6 begincidchar\n<e28093> 120\n<e28094> 122\n<e280a5> 109\n<efb98f> 13745\n<efbd9b> 134\n<efbd9d> 135\nendcidchar\n\n7 begincidrange\n<e38088> <e38089> 150\n<e3808a> <e3808b> 146\n<e3808c> <e3808d> 154\n<e3808e> <e3808f> 158\n<e38090> <e38091> 142\n<e38094> <e38095> 138\n<efbc88> <efbc89> 130\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/cns/UniCNS-X",
    "content": "begincmap\n/CMapName /UniCNS-X def\n/WMode 0 def\nbegincidchar\n<a5>260\n<a7>178\n<a8>13747\n<ac>14049\n<b0>280\n<b1>212\n<b7>115\n<c0>18788\n<c1>18786\n<c8>18792\n<c9>18790\n<ca>18801\n<d2>18796\n<d3>18794\n<d7>210\n<e0>18805\n<e1>18803\n<e8>18810\n<e9>18808\n<ea>18832\n<ec>18814\n<ed>18812\n<f2>18818\n<f3>18816\n<f7>211\n<f8>18840\n<f9>18822\n<fa>18820\n<fc>18827\n<0100>18785\n<0101>18802\n<0112>18789\n<0113>18807\n<011a>18791\n<011b>18809\n<012b>18811\n<014b>18841\n<014c>18793\n<014d>18815\n<0153>18839\n<016b>18819\n<01cd>18787\n<01ce>18804\n<01d0>18813\n<01d1>18795\n<01d2>18817\n<01d4>18821\n<01d6>18823\n<01d8>18824\n<01da>18825\n<01dc>18826\n<0250>18835\n<0251>18806\n<0254>18837\n<025b>18836\n<0261>18833\n<026a>18843\n<0275>18838\n<0283>18834\n<028a>18842\n<02c6>13748\n<02c7>504\n<02ca>503\n<02cb>505\n<02d9>502\n<0308>13747\n<0401>13936\n<0451>13969\n<1ebe>18798\n<1ebf>18829\n<1ec0>18800\n<1ec1>18831\n<2013>121\n<2014>123\n<2022>104\n<2025>111\n<2026>110\n<2032>173\n<2035>172\n<203b>177\n<203e>195\n<20ac>17601\n<2103>266\n<2105>194\n<2109>267\n<2116>14054\n<2121>14055\n<2190>248\n<2191>245\n<2192>247\n<2193>246\n<2198>252\n<2199>251\n<21e7>13996\n<221a>213\n<221e>220\n<221f>233\n<2220>232\n<2223>254\n<2225>253\n<222b>237\n<222e>238\n<2234>240\n<2235>239\n<223c>228\n<2252>221\n<2260>219\n<2261>222\n<22a5>231\n<22bf>234\n<2421>594\n<2500>311\n<2502>312\n<250c>314\n<2510>315\n<2514>316\n<2518>317\n<251c>309\n<2524>308\n<252c>307\n<2534>306\n<253c>305\n<2550>322\n<2551>14090\n<2552>14072\n<2553>14081\n<2554>14063\n<2555>14074\n<2556>14083\n<2557>14065\n<2558>14078\n<2559>14087\n<255a>14069\n<255b>14080\n<255c>14089\n<255d>14071\n<255e>323\n<255f>14084\n<2560>14066\n<2561>325\n<2562>14086\n<2563>14068\n<2564>14073\n<2565>14082\n<2566>14064\n<2567>14079\n<2568>14088\n<2569>14070\n<256a>324\n<256b>14085\n<256c>14067\n<256f>321\n<2570>320\n<2589>304\n<258a>303\n<258b>302\n<258c>301\n<258d>300\n<258e>299\n<258f>298\n<2593>14096\n<2594>310\n<2595>313\n<25a0>190\n<25a1>189\n<25b2>183\n<25b3>182\n<25bc>192\n<25bd>191\n<25c6>188\n<25c7>187\n<25cb>180\n<25ce>184\n<25cf>181\n<25e4>329\n<25e5>328\n<2605>186\n<2606>185\n<2609>244\n<2640>241\n<2641>243\n<2642>242\n<273d>13760\n<2e80>17608\n<2e84>17692\n<2e8a>17696\n<2e95>17699\n<2e9c>17700\n<2ea5>17701\n<2ea7>17702\n<2eaa>17703\n<2eac>17704\n<2eae>17705\n<2eb6>17706\n<2ebc>17707\n<2ebe>17708\n<2eca>17709\n<2ecf>17712\n<2ede>17715\n<2f33>551\n<3000>99\n<3003>179\n<3012>261\n<30fc>13757\n<3231>14053\n<32a3>193\n<33a1>276\n<33c4>279\n<33ce>275\n<33d1>236\n<33d2>235\n<33d5>271\n<3435>14781\n<3440>15463\n<344c>17811\n<3464>14981\n<3473>15813\n<347a>16435\n<347d>17815\n<347e>18083\n<3493>17310\n<3496>14300\n<34a5>17816\n<34af>15487\n<34bc>17280\n<34c1>17659\n<34c8>15616\n<34df>16036\n<34e4>15956\n<34fb>15818\n<3506>17206\n<353e>17639\n<3551>17825\n<3553>17317\n<3561>16600\n<356d>17828\n<3570>15151\n<3572>17829\n<3577>16075\n<3578>17273\n<3584>14843\n<3597>15149\n<3598>17840\n<35a1>16610\n<35a5>17841\n<35ad>16124\n<35bf>17842\n<35c1>17792\n<35c5>17844\n<35c7>17823\n<35ca>15939\n<35ce>16001\n<35d2>16329\n<35d6>16309\n<35db>18189\n<35dd>17324\n<35f1>18070\n<35f2>17959\n<35f3>16236\n<35fb>17864\n<35fe>16234\n<3609>17909\n<3618>18545\n<361a>17946\n<3623>16582\n<362d>16006\n<3635>18734\n<3639>16741\n<363e>14856\n<3647>18438\n<3648>14342\n<3649>16403\n<364e>18072\n<365f>15859\n<367a>16099\n<3681>17830\n<369a>15473\n<36a5>18690\n<36aa>15152\n<36ac>18688\n<36b0>15583\n<36b1>16589\n<36b5>15298\n<36b9>18567\n<36bc>15615\n<36c1>14277\n<36c3>16613\n<36c4>14597\n<36c5>17046\n<36c7>15674\n<36c8>18464\n<36d3>14904\n<36d4>15283\n<36d6>15628\n<36dd>14902\n<36e1>14716\n<36e2>15581\n<36e5>16918\n<36e6>16636\n<36f5>14872\n<3701>14900\n<3703>17935\n<3708>16639\n<370a>15573\n<370d>16952\n<371c>15870\n<3722>14713\n<3723>14720\n<3725>14409\n<372c>15500\n<372d>15671\n<3730>18780\n<3732>16646\n<3733>14743\n<373a>15958\n<3740>16898\n<3743>16438\n<3762>15798\n<376f>18379\n<3797>17901\n<37a0>14888\n<37b9>17335\n<37be>14654\n<37f2>15265\n<37f8>17106\n<37fb>16117\n<380f>17964\n<3819>14767\n<3820>17967\n<382d>16686\n<3836>16691\n<3838>17339\n<3863>18115\n<38a0>16709\n<38c3>14610\n<38cc>16502\n<38d1>14997\n<38fa>17643\n<3908>17970\n<3914>17342\n<3927>15409\n<3932>16770\n<393f>17971\n<394d>17972\n<3963>16739\n<3980>14452\n<3989>17976\n<398a>15592\n<3992>17270\n<3999>14778\n<399b>15795\n<39a1>15897\n<39a4>15887\n<39b8>17979\n<39dc>16078\n<39e2>18120\n<39e5>14651\n<39ec>17168\n<39f8>17982\n<39fb>17221\n<39fe>17256\n<3a01>16864\n<3a03>17984\n<3a06>17271\n<3a17>16784\n<3a18>17295\n<3a29>14942\n<3a2a>16095\n<3a34>17177\n<3a4b>17988\n<3a52>16083\n<3a57>16798\n<3a5c>16324\n<3a5e>15111\n<3a66>16796\n<3a67>17203\n<3a97>17991\n<3aab>16529\n<3abd>17993\n<3ade>16716\n<3ae0>14970\n<3af0>18098\n<3af2>17996\n<3afb>15090\n<3b0e>14568\n<3b19>18117\n<3b22>17998\n<3b2b>18774\n<3b39>18251\n<3b42>18000\n<3b58>18002\n<3b60>14650\n<3b71>18006\n<3b72>18005\n<3b7b>18007\n<3b7c>14426\n<3b80>16866\n<3b96>15004\n<3b99>15000\n<3ba1>16873\n<3bbc>17352\n<3bbe>15793\n<3bc2>16692\n<3bc4>15008\n<3bd7>15020\n<3bdd>18015\n<3bec>18020\n<3bf2>18022\n<3bf3>16883\n<3bf4>14958\n<3c0d>16887\n<3c11>15936\n<3c15>14744\n<3c54>15872\n<3ccb>18032\n<3ccd>15589\n<3cd1>16387\n<3cd6>15607\n<3cdc>16462\n<3ceb>16919\n<3cef>18037\n<3d13>14195\n<3d1d>14652\n<3d32>18775\n<3d3b>16965\n<3d46>18053\n<3d4c>15595\n<3d4e>16962\n<3d51>14570\n<3d5f>16729\n<3d62>15454\n<3d69>15594\n<3d6a>18057\n<3d6f>15612\n<3d75>18058\n<3d7d>15407\n<3d85>18763\n<3d8a>18061\n<3d8f>15037\n<3d91>18063\n<3da5>15702\n<3dad>18073\n<3db4>16550\n<3dbf>14288\n<3dc6>18654\n<3dc7>16740\n<3dcc>15727\n<3dcd>15091\n<3dd3>14305\n<3ddb>16383\n<3de7>14745\n<3de8>16989\n<3deb>15962\n<3df3>18132\n<3df7>18603\n<3dfc>17963\n<3dfd>15380\n<3e06>18717\n<3e40>16745\n<3e43>17261\n<3e48>17813\n<3e55>17023\n<3e74>16098\n<3ea8>17156\n<3ea9>18157\n<3eaa>16501\n<3ead>15261\n<3eb1>15064\n<3eb8>14923\n<3ebf>15115\n<3ec2>15320\n<3ec7>14709\n<3eca>18161\n<3ecc>15330\n<3ed0>14420\n<3ed1>18162\n<3ed6>15533\n<3ed7>17055\n<3eda>15618\n<3ede>14834\n<3ee1>15528\n<3ee2>18166\n<3ee7>15324\n<3ee9>15524\n<3eeb>14698\n<3ef0>18167\n<3ef3>15069\n<3ef4>18168\n<3efa>18169\n<3efc>15336\n<3eff>15093\n<3f00>15373\n<3f04>17091\n<3f06>15063\n<3f0e>18171\n<3f53>18172\n<3f58>15081\n<3f59>16521\n<3f63>15078\n<3f7c>18176\n<3f93>17869\n<3fc0>17359\n<3fd7>17361\n<3fdc>18180\n<3fe5>18143\n<3fed>17205\n<3ff9>17879\n<3ffa>17236\n<4004>16654\n<401d>18185\n<4039>18187\n<4045>18188\n<4053>17846\n<4057>14749\n<4062>15307\n<4065>16339\n<406a>18191\n<406f>18192\n<40a8>17365\n<40bb>17856\n<40bf>16108\n<40c8>15118\n<40d8>16811\n<40df>15895\n<40fa>16062\n<4103>17367\n<4104>16988\n<4109>18204\n<410e>15131\n<4132>15141\n<4167>18207\n<416c>14510\n<416e>15139\n<417f>15234\n<4190>18112\n<41b2>18208\n<41c4>18211\n<41ca>14143\n<41cf>18214\n<41db>14271\n<41ef>14147\n<41f9>15166\n<4211>15169\n<4240>14321\n<4260>18219\n<426a>15189\n<427a>18220\n<428c>18223\n<4294>18225\n<42b5>16400\n<42b9>14502\n<42bc>15498\n<42f4>15289\n<42fb>15598\n<42fc>16870\n<432b>14205\n<436e>18122\n<4397>18235\n<43ba>17247\n<43c1>18069\n<43d9>17214\n<43df>15945\n<43ed>18245\n<43f2>15944\n<4401>18250\n<4402>15219\n<4413>18255\n<4425>18257\n<442d>18258\n<447a>14255\n<448f>18264\n<449f>15074\n<44a0>14317\n<44a2>16505\n<44b0>18268\n<44b7>16289\n<44c0>15367\n<44c5>16912\n<44ce>15651\n<44dd>14813\n<44df>15650\n<44e4>14306\n<44e9>16847\n<44ea>15217\n<44eb>15602\n<44ec>16052\n<44f4>14738\n<4503>18079\n<4504>18275\n<4509>15952\n<450b>14292\n<4516>14329\n<451d>14183\n<4527>14327\n<452e>15571\n<4533>15441\n<453b>18282\n<453d>14532\n<453f>15890\n<4543>14323\n<4551>15076\n<4552>16563\n<4555>16958\n<455c>14219\n<4562>18752\n<456a>14340\n<4577>18286\n<4585>14533\n<45e9>16100\n<4606>18291\n<460f>14357\n<4615>14403\n<4617>18292\n<465b>14365\n<467a>14825\n<4680>15617\n<46cf>15264\n<46d0>15866\n<46f5>15263\n<4713>14387\n<4718>15815\n<474e>16060\n<477c>15821\n<4798>18305\n<47a6>16547\n<47b6>16106\n<47d5>17178\n<47ed>18307\n<47f4>17199\n<4800>17950\n<480b>17234\n<4837>18311\n<485d>16655\n<4871>15619\n<489b>15293\n<48ad>18321\n<48ae>18765\n<48d0>15783\n<48dd>16672\n<48ed>17032\n<48f3>16065\n<48fa>15940\n<4906>15303\n<4911>17796\n<491e>18324\n<4925>15375\n<492a>18094\n<492d>18125\n<4935>15555\n<493c>15352\n<493e>15622\n<4945>18339\n<4951>18340\n<4953>17069\n<4965>14489\n<496a>18345\n<4972>14884\n<4989>14235\n<49a1>14519\n<49a7>18350\n<49df>14506\n<49e5>18353\n<49e7>17953\n<4a0f>14531\n<4a1d>15340\n<4a24>18354\n<4a35>18356\n<4a96>15591\n<4ab4>17249\n<4ab8>15784\n<4ad1>14563\n<4ae4>18359\n<4aff>14578\n<4b19>18361\n<4b2c>17951\n<4b37>16809\n<4b6f>15382\n<4b70>18368\n<4b72>14588\n<4b7b>15501\n<4b7e>16394\n<4b8e>14839\n<4b90>15392\n<4b93>14988\n<4b96>14658\n<4b97>15396\n<4b9d>18370\n<4bbd>15395\n<4bbe>14676\n<4bc0>15836\n<4c04>16315\n<4c07>16311\n<4c0e>14604\n<4c3b>16188\n<4c3e>17787\n<4c5b>16089\n<4c6d>18377\n<4c7d>15974\n<4ca4>18622\n<4cae>15426\n<4cb0>15429\n<4cb7>15905\n<4ccd>17784\n<4ce1>16115\n<4ced>16555\n<4d09>16086\n<4d10>16663\n<4d34>14645\n<4d91>17397\n<4d9c>18628\n<4e00>595\n<4e01>597\n<4e03>598\n<4e04>18686\n<4e07>6001\n<4e08>617\n<4e09>615\n<4e0a>618\n<4e0b>616\n<4e0c>6002\n<4e0d>660\n<4e0e>6010\n<4e0f>6008\n<4e10>659\n<4e11>658\n<4e14>754\n<4e15>753\n<4e16>752\n<4e18>755\n<4e19>751\n<4e1a>18685\n<4e1c>18656\n<4e21>15725\n<4e24>17805\n<4e26>1320\n<4e28>536\n<4e2a>16215\n<4e2b>619\n<4e2c>17651\n<4e2d>661\n<4e2e>6011\n<4e30>662\n<4e31>6030\n<4e32>1045\n<4e33>6388\n<4e36>537\n<4e37>17687\n<4e38>620\n<4e39>663\n<4e3b>756\n<4e3c>6031\n<4e3d>17719\n<4e3f>538\n<4e41>13999\n<4e42>5996\n<4e43>599\n<4e45>622\n<4e47>6003\n<4e48>623\n<4e49>16526\n<4e4b>664\n<4e4d>757\n<4e4e>759\n<4e4f>758\n<4e56>1321\n<4e58>2097\n<4e59>596\n<4e5a>14001\n<4e5b>17637\n<4e5c>5997\n<4e5d>600\n<4e5e>625\n<4e5f>624\n<4e69>882\n<4e6a>15845\n<4e73>1322\n<4e78>15758\n<4e7e>2555\n<4e7f>7733\n<4e80>17806\n<4e81>17340\n<4e82>3518\n<4e85>539\n<4e86>601\n<4e87>17807\n<4e88>666\n<4e89>17820\n<4e8b>1323\n<4e8c>602\n<4e8d>6004\n<4e8e>626\n<4e91>667\n<4e92>669\n<4e93>6012\n<4e94>670\n<4e95>668\n<4e98>14788\n<4e99>883\n<4e9a>18645\n<4e9b>1324\n<4e9e>1325\n<4e9f>1699\n<4ea0>540\n<4ea1>627\n<4ea2>671\n<4ea4>884\n<4ea5>886\n<4ea6>885\n<4ea8>1046\n<4eb3>2098\n<4eb6>9059\n<4eb7>16700\n<4eb9>13175\n<4eba>603\n<4ebb>17638\n<4ebc>14769\n<4ebf>17808\n<4ec0>673\n<4ec1>672\n<4ec2>6013\n<4ec3>674\n<4ec4>680\n<4ec8>6015\n<4ec9>6014\n<4ecd>677\n<4ece>16226\n<4ed8>761\n<4ed9>768\n<4eda>6037\n<4edc>6033\n<4edd>6036\n<4ede>769\n<4edf>785\n<4ee1>6035\n<4ee5>760\n<4ee8>6032\n<4ee9>6034\n<4eea>18635\n<4eeb>17809\n<4eee>15734\n<4ef0>899\n<4ef1>6074\n<4ef2>896\n<4ef3>900\n<4ef4>6084\n<4ef5>6072\n<4ef6>897\n<4ef7>6076\n<4ef8>14765\n<4efb>898\n<4efd>901\n<4eff>887\n<4f00>6075\n<4f01>902\n<4f02>6079\n<4f03>14792\n<4f04>6083\n<4f05>6080\n<4f08>6077\n<4f09>888\n<4f0a>890\n<4f0b>903\n<4f0d>892\n<4f0e>6069\n<4f0f>895\n<4f12>6085\n<4f13>6082\n<4f14>6073\n<4f15>891\n<4f18>6070\n<4f19>889\n<4f1a>17724\n<4f1d>6078\n<4f22>6081\n<4f28>17725\n<4f29>14782\n<4f2c>6071\n<4f2d>6191\n<4f2f>1068\n<4f30>1055\n<4f32>14653\n<4f33>6192\n<4f34>1052\n<4f36>1070\n<4f37>17810\n<4f38>1060\n<4f39>16229\n<4f3a>1059\n<4f3b>6180\n<4f3c>1063\n<4f3d>1058\n<4f3e>6185\n<4f3f>6193\n<4f41>6189\n<4f42>14795\n<4f43>1061\n<4f45>15247\n<4f46>1064\n<4f47>1049\n<4f48>1073\n<4f49>6182\n<4f4b>14772\n<4f4c>6400\n<4f4d>1047\n<4f4e>1069\n<4f4f>1048\n<4f52>6187\n<4f53>6183\n<4f54>1062\n<4f55>1054\n<4f56>6179\n<4f57>1050\n<4f58>6190\n<4f59>1071\n<4f5a>1074\n<4f5b>1053\n<4f5c>1066\n<4f5d>1072\n<4f5e>1051\n<4f5f>6188\n<4f60>1067\n<4f61>6194\n<4f62>6181\n<4f63>1065\n<4f64>6184\n<4f67>6186\n<4f69>1341\n<4f6a>6402\n<4f6b>6414\n<4f6c>1333\n<4f6e>6415\n<4f6f>1328\n<4f70>1338\n<4f72>15474\n<4f73>1331\n<4f74>6396\n<4f75>1339\n<4f76>6395\n<4f77>6399\n<4f78>6406\n<4f79>6404\n<4f7a>1347\n<4f7b>1342\n<4f7c>6390\n<4f7d>6392\n<4f7e>1344\n<4f7f>1332\n<4f80>6393\n<4f81>6405\n<4f82>6412\n<4f83>1337\n<4f84>6398\n<4f85>6391\n<4f86>1336\n<4f87>6394\n<4f88>1340\n<4f89>6397\n<4f8a>14773\n<4f8b>1335\n<4f8d>1330\n<4f8f>1345\n<4f90>6407\n<4f91>1346\n<4f92>6411\n<4f94>6409\n<4f95>6413\n<4f96>1343\n<4f97>6401\n<4f98>6389\n<4f9a>6403\n<4f9b>1334\n<4f9c>6408\n<4f9d>1329\n<4f9e>6410\n<4fa2>14791\n<4fa8>17726\n<4fab>16418\n<4fae>1716\n<4faf>1704\n<4fb0>15690\n<4fb2>6749\n<4fb3>6757\n<4fb5>1703\n<4fb6>1711\n<4fb7>1723\n<4fb9>6763\n<4fba>6761\n<4fbb>6756\n<4fbd>17812\n<4fbf>1705\n<4fc0>6762\n<4fc1>6752\n<4fc2>1719\n<4fc3>1710\n<4fc4>1718\n<4fc5>6747\n<4fc7>6759\n<4fc8>18152\n<4fc9>6750\n<4fca>1714\n<4fcb>6751\n<4fcc>14799\n<4fcd>6746\n<4fce>1721\n<4fcf>1708\n<4fd0>1717\n<4fd1>1707\n<4fd3>6748\n<4fd4>6753\n<4fd6>6760\n<4fd7>1715\n<4fd8>1712\n<4fd9>6755\n<4fda>1720\n<4fdb>6758\n<4fdc>6754\n<4fdd>1709\n<4fde>1722\n<4fdf>1713\n<4fe0>1706\n<4fe1>1702\n<4fe4>15462\n<4fe5>14800\n<4fec>6764\n<4fee>2124\n<4fef>2102\n<4ff1>2118\n<4ff2>16168\n<4ff3>2123\n<4ff4>7204\n<4ff5>7203\n<4ff8>2105\n<4ff9>14259\n<4ffa>2114\n<4ffd>16166\n<4ffe>2127\n<5000>2115\n<5003>17814\n<5005>7197\n<5006>2108\n<5007>7198\n<5008>16420\n<5009>2129\n<500b>2120\n<500e>7217\n<500f>2572\n<5011>2113\n<5012>2112\n<5013>7199\n<5014>2116\n<5015>7749\n<5016>2107\n<5017>7210\n<5018>2122\n<5019>2121\n<501a>2111\n<501b>7202\n<501c>7211\n<501e>7196\n<501f>2110\n<5020>7212\n<5021>2119\n<5022>7200\n<5023>2101\n<5025>2104\n<5026>2103\n<5027>7213\n<5028>2117\n<5029>2106\n<502a>2126\n<502b>2128\n<502c>7207\n<502d>2125\n<502e>14796\n<502f>7215\n<5030>7201\n<5031>7216\n<5033>7205\n<5034>14608\n<5035>7214\n<5037>7206\n<503c>2109\n<5040>7757\n<5041>7745\n<5043>2560\n<5045>7750\n<5046>7756\n<5047>2559\n<5048>7743\n<5049>2563\n<504a>7747\n<504b>7740\n<504c>2561\n<504d>7744\n<504e>2566\n<504f>2571\n<5051>7761\n<5053>7739\n<5055>2567\n<5056>16172\n<5057>7760\n<5058>14801\n<505a>2562\n<505b>7746\n<505c>2558\n<505d>7741\n<505e>7737\n<505f>7751\n<5060>7738\n<5061>7736\n<5062>7748\n<5065>2564\n<5066>15817\n<5068>8376\n<5069>7752\n<506a>7735\n<506b>7753\n<506c>14797\n<506d>2574\n<506e>7758\n<506f>2573\n<5070>7734\n<5072>7742\n<5073>7759\n<5074>2569\n<5075>2568\n<5076>2565\n<5077>2570\n<507a>2556\n<507d>2557\n<5080>3052\n<5081>14798\n<5082>8379\n<5083>8372\n<5085>3049\n<5087>8380\n<5088>17308\n<508b>8370\n<508c>8373\n<508d>3048\n<508e>8374\n<5090>16876\n<5091>3051\n<5092>8378\n<5094>8368\n<5095>8367\n<5096>3053\n<5098>3054\n<5099>3050\n<509a>3055\n<509b>8366\n<509c>8377\n<509d>8375\n<509e>8369\n<50a2>3047\n<50a3>8371\n<50a6>16191\n<50ac>3525\n<50ad>3519\n<50ae>9063\n<50af>3528\n<50b0>9069\n<50b1>9072\n<50b4>9066\n<50b5>3520\n<50b6>9075\n<50b7>3526\n<50b8>9076\n<50ba>9071\n<50bb>3527\n<50bd>9060\n<50be>3524\n<50bf>9061\n<50c1>9070\n<50c2>9068\n<50c4>9064\n<50c5>3523\n<50c6>9062\n<50c7>3529\n<50c8>9067\n<50c9>9074\n<50ca>9065\n<50cb>9073\n<50cd>14789\n<50ce>3976\n<50cf>3973\n<50d0>14545\n<50d1>3974\n<50d3>9756\n<50d4>9748\n<50d5>3972\n<50d6>3969\n<50d7>9749\n<50d9>16334\n<50da>3971\n<50db>9752\n<50dd>9754\n<50de>16433\n<50df>15101\n<50e0>9761\n<50e1>16753\n<50e3>9760\n<50e4>9755\n<50e5>3968\n<50e6>9747\n<50e7>3966\n<50e8>9750\n<50e9>3977\n<50ea>9753\n<50ec>9757\n<50ed>3970\n<50ee>3967\n<50ef>9759\n<50f0>9758\n<50f1>3975\n<50f3>9751\n<50f4>15593\n<50f5>4357\n<50f6>10371\n<50f8>10368\n<50f9>4358\n<50fb>4356\n<50fc>14802\n<50fd>10375\n<50fe>10372\n<50ff>10365\n<5100>4355\n<5101>16434\n<5102>4359\n<5103>10366\n<5104>4354\n<5105>4362\n<510a>10376\n<510d>14790\n<510e>16436\n<5110>4749\n<5111>11012\n<5112>4746\n<5113>11009\n<5114>4748\n<5115>4750\n<5117>11010\n<5118>4747\n<511a>11011\n<511c>11008\n<511f>5045\n<5120>11582\n<5121>5046\n<5122>11580\n<5124>11581\n<5125>11579\n<5126>11578\n<5129>11583\n<512a>5044\n<512b>14766\n<5130>10367\n<5131>12046\n<5132>5047\n<5133>5493\n<5139>12998\n<513a>12997\n<513b>5820\n<513c>5819\n<513d>13326\n<513f>604\n<5140>628\n<5141>682\n<5143>681\n<5144>771\n<5145>770\n<5146>906\n<5147>905\n<5148>907\n<5149>904\n<514b>1076\n<514c>1075\n<514d>1077\n<5152>1349\n<5154>1348\n<5155>1350\n<5156>17306\n<5157>1724\n<5159>281\n<515a>7218\n<515b>282\n<515c>2575\n<515d>284\n<515e>283\n<515f>8381\n<5160>16442\n<5161>285\n<5162>3978\n<5163>286\n<5165>605\n<5167>683\n<5168>908\n<5169>1351\n<516a>16444\n<516b>606\n<516c>686\n<5171>909\n<5174>17727\n<5175>1078\n<5176>1353\n<5177>1352\n<5178>1354\n<5179>15054\n<517c>2130\n<5180>4751\n<5182>541\n<5186>17311\n<5187>6009\n<5188>14006\n<518d>910\n<518f>6195\n<5191>1726\n<5192>1725\n<5193>7220\n<5194>7219\n<5195>2576\n<5196>542\n<5197>687\n<5198>6016\n<519a>16035\n<519c>17728\n<519e>6416\n<51a0>1727\n<51a2>2133\n<51a7>16038\n<51a8>14810\n<51aa>4752\n<51ab>543\n<51ac>774\n<51b0>911\n<51b1>6086\n<51b2>16456\n<51b3>16465\n<51b4>15740\n<51b5>16402\n<51b8>16457\n<51b9>6196\n<51bc>6417\n<51bd>1355\n<51be>6418\n<51c3>14811\n<51c6>2136\n<51c7>16938\n<51c8>7224\n<51c9>16459\n<51ca>7221\n<51cb>2137\n<51cc>2135\n<51cd>2134\n<51ce>7225\n<51cf>16460\n<51d0>7762\n<51d1>16461\n<51d2>15789\n<51d3>16463\n<51d4>8382\n<51d7>9077\n<51d8>9762\n<51db>17818\n<51dc>4363\n<51dd>4753\n<51de>11013\n<51df>16975\n<51e0>607\n<51e1>621\n<51e4>17729\n<51ed>16468\n<51f0>2577\n<51f1>3057\n<51f3>3979\n<51f4>16760\n<51f5>5998\n<51f6>688\n<51f8>777\n<51fc>17819\n<51fd>1356\n<51fe>16138\n<5202>14003\n<5203>629\n<5205>17313\n<5209>6039\n<520a>778\n<520b>16473\n<520c>6038\n<520e>915\n<5210>6088\n<5213>6087\n<5216>916\n<5217>912\n<521c>6197\n<521d>1675\n<521e>6198\n<521f>16224\n<5220>18736\n<5221>6199\n<5224>1082\n<5225>1081\n<5226>16474\n<5227>17314\n<5228>1085\n<522e>1362\n<5230>1361\n<5231>6423\n<5234>16123\n<5235>6419\n<5236>1363\n<5237>1359\n<5238>1358\n<523a>1360\n<523b>1357\n<523c>16475\n<5241>1364\n<5243>1729\n<5244>6765\n<5246>6422\n<5247>1734\n<5249>6766\n<524a>1730\n<524b>1733\n<524c>1732\n<524d>1731\n<524e>1728\n<5252>7228\n<5254>2140\n<5255>7231\n<5256>2138\n<5257>16477\n<5259>14820\n<525a>7227\n<525b>2141\n<525c>2139\n<525d>2142\n<5260>16169\n<5261>7226\n<5262>7232\n<5268>17945\n<5269>3061\n<526a>2578\n<526b>7763\n<526c>7765\n<526d>7764\n<526e>7766\n<526f>2579\n<5272>3058\n<5273>16195\n<5277>3531\n<5278>9079\n<5279>17315\n<527a>9078\n<527d>3532\n<527f>3530\n<5282>3981\n<5283>3980\n<5284>10102\n<528a>4368\n<528d>4367\n<528f>15807\n<5290>17821\n<5291>4754\n<5293>4755\n<5294>16478\n<5296>12412\n<5297>13000\n<5298>12999\n<5299>13327\n<529a>16232\n<529b>610\n<529f>780\n<52a0>779\n<52a1>17730\n<52a3>917\n<52a4>14821\n<52a6>6089\n<52a8>17731\n<52ab>1086\n<52ac>1089\n<52b5>16476\n<52b9>16479\n<52bb>1366\n<52bc>6424\n<52be>1365\n<52c0>6767\n<52c1>1738\n<52c2>6768\n<52c3>1737\n<52c5>16480\n<52c7>1735\n<52c9>1736\n<52cc>16097\n<52cd>7233\n<52d0>16649\n<52d1>16170\n<52d2>2580\n<52d3>7768\n<52d5>2583\n<52d6>7767\n<52d7>2767\n<52d8>2582\n<52d9>2581\n<52db>3064\n<52dd>3063\n<52de>3062\n<52df>3533\n<52e0>16483\n<52e1>14823\n<52e4>3535\n<52e6>3534\n<52e9>9765\n<52eb>9766\n<52ef>10380\n<52f0>4369\n<52f1>10379\n<52f3>4756\n<52f4>11584\n<52f5>5048\n<52f7>12413\n<52f8>5641\n<52f9>544\n<52fa>630\n<52fb>692\n<52fc>6017\n<5301>15737\n<5308>918\n<5309>6202\n<530d>1739\n<530e>7234\n<530f>2585\n<5310>2584\n<5311>8384\n<5312>8383\n<5315>611\n<5316>695\n<5317>783\n<5319>2586\n<531a>5999\n<531c>6040\n<531d>784\n<531f>6091\n<5320>920\n<5321>919\n<5322>6090\n<5323>1090\n<5327>17822\n<532a>2143\n<532c>16182\n<532d>7769\n<532f>3538\n<5330>9767\n<5331>3982\n<5332>16336\n<5333>16493\n<5334>11014\n<5337>12743\n<5338>545\n<5339>696\n<533b>17732\n<533c>6427\n<533d>6769\n<533e>2589\n<5341>612\n<5342>18759\n<5343>631\n<5344>363\n<5345>699\n<5347>698\n<5348>697\n<5349>787\n<534a>786\n<534c>6041\n<534d>6092\n<534e>17733\n<5351>1370\n<5352>1367\n<5353>1369\n<5354>1368\n<5357>1740\n<535a>3065\n<535c>613\n<535d>17665\n<535e>700\n<535f>17319\n<5360>789\n<5361>788\n<5363>6203\n<5364>18442\n<5366>1371\n<5367>16077\n<5369>546\n<536c>6018\n<536d>16506\n<536e>791\n<536f>790\n<5372>6204\n<5373>1091\n<5374>16507\n<5375>1092\n<537b>1741\n<537c>6770\n<537d>18689\n<537e>16509\n<537f>2144\n<5382>6000\n<5384>701\n<538a>6093\n<5392>6428\n<5393>16514\n<5394>6429\n<5396>6772\n<5397>6771\n<5398>6774\n<5399>6773\n<539a>1742\n<539c>7770\n<539d>2146\n<539e>7235\n<539f>2145\n<53a0>16516\n<53a2>15915\n<53a4>8385\n<53a5>3066\n<53a6>16699\n<53a7>8386\n<53a8>16702\n<53a9>17824\n<53aa>16326\n<53ab>16517\n<53ac>9768\n<53ad>3983\n<53ae>16518\n<53b0>17826\n<53b2>4370\n<53b4>12414\n<53b6>547\n<53b9>6019\n<53bb>792\n<53c1>16523\n<53c2>17318\n<53c3>2590\n<53c5>16524\n<53c8>614\n<53c9>632\n<53ca>703\n<53cb>702\n<53cc>14518\n<53cd>704\n<53d0>14842\n<53d1>17734\n<53d2>15933\n<53d4>1376\n<53d6>1375\n<53d7>1377\n<53d8>17735\n<53d9>16528\n<53da>16185\n<53db>1743\n<53df>2147\n<53e0>16531\n<53e1>11015\n<53e2>5321\n<53e3>633\n<53e4>794\n<53e5>809\n<53e6>804\n<53e8>799\n<53e9>798\n<53ea>805\n<53eb>803\n<53ec>796\n<53ed>810\n<53ee>797\n<53ef>793\n<53f0>808\n<53f1>807\n<53f2>806\n<53f3>795\n<53f5>802\n<53f6>16534\n<53f7>14344\n<53f8>801\n<53fb>811\n<53fc>800\n<53fe>16577\n<5401>928\n<5403>934\n<5404>930\n<5406>936\n<5407>6094\n<5408>933\n<5409>923\n<540a>926\n<540b>929\n<540c>925\n<540d>932\n<540e>935\n<540f>924\n<5410>927\n<5411>931\n<5412>937\n<5413>16536\n<5414>15479\n<5416>15999\n<5418>6215\n<5419>6212\n<541a>15972\n<541b>1105\n<541c>6213\n<541d>1093\n<541e>1095\n<541f>1119\n<5420>1114\n<5421>16899\n<5423>17827\n<5424>6220\n<5425>6214\n<5426>1097\n<5427>1099\n<5428>6219\n<5429>1106\n<542a>6209\n<542b>1118\n<542c>1120\n<542d>1094\n<542e>1111\n<542f>16556\n<5430>6207\n<5431>1117\n<5432>15989\n<5433>1102\n<5437>6208\n<5438>1110\n<5439>1108\n<543b>1109\n<543c>1115\n<543d>6216\n<543e>1096\n<5440>1116\n<5441>6218\n<5442>1104\n<5443>1101\n<5445>6211\n<5446>1100\n<5447>6221\n<5448>1103\n<544a>1107\n<544b>16081\n<544d>16039\n<544e>1098\n<544f>6217\n<5454>6210\n<5460>6446\n<5461>6445\n<5462>1395\n<5463>6448\n<5464>6450\n<5465>6439\n<5466>6442\n<5467>6449\n<5468>1396\n<5469>16178\n<546a>15747\n<546b>6436\n<546c>6440\n<546d>16541\n<546f>6444\n<5470>6789\n<5471>1391\n<5472>6793\n<5473>1378\n<5474>6441\n<5475>1379\n<5476>1392\n<5477>1385\n<5478>1381\n<547a>6437\n<547b>1384\n<547c>1389\n<547d>1398\n<547e>6438\n<547f>6431\n<5480>1383\n<5481>6432\n<5482>6434\n<5484>1386\n<5485>18137\n<5486>1388\n<5487>6430\n<5488>6435\n<548b>1397\n<548c>1393\n<548d>6443\n<548e>1399\n<548f>16545\n<5490>1390\n<5491>6433\n<5492>1387\n<5493>17831\n<5494>16024\n<5495>1382\n<5496>1380\n<5497>16010\n<5498>6447\n<549a>1394\n<549c>16230\n<549e>18413\n<54a0>6788\n<54a1>6776\n<54a2>6791\n<54a3>17832\n<54a4>16546\n<54a5>6778\n<54a6>1750\n<54a7>1764\n<54a8>1746\n<54a9>1763\n<54aa>1755\n<54ab>1760\n<54ac>1744\n<54ad>6777\n<54ae>6783\n<54af>1759\n<54b0>6795\n<54b1>1761\n<54b2>14148\n<54b3>1751\n<54b4>17833\n<54b6>6785\n<54b7>6782\n<54b8>1749\n<54b9>17834\n<54ba>6775\n<54bb>1762\n<54bc>6790\n<54bd>1754\n<54be>6792\n<54bf>1765\n<54c0>1745\n<54c1>1756\n<54c2>1753\n<54c3>6780\n<54c4>1757\n<54c7>1752\n<54c8>1758\n<54c9>1748\n<54cb>14755\n<54cd>14848\n<54ce>1747\n<54cf>6779\n<54d0>17835\n<54d6>6784\n<54da>18723\n<54de>6794\n<54e0>7255\n<54e1>2160\n<54e2>7237\n<54e3>17217\n<54e4>7242\n<54e5>2153\n<54e6>2164\n<54e7>7240\n<54e8>2148\n<54e9>2158\n<54ea>2163\n<54eb>7247\n<54ed>2159\n<54ee>2162\n<54ef>17836\n<54f1>7250\n<54f2>2154\n<54f3>7241\n<54fa>2156\n<54fb>7252\n<54fc>2152\n<54fd>2167\n<54ff>7244\n<5501>2150\n<5502>15564\n<5503>7257\n<5504>7245\n<5505>7249\n<5506>2155\n<5507>2166\n<5508>7246\n<5509>2161\n<550a>7251\n<550b>7258\n<550c>7785\n<550d>14963\n<550e>7256\n<550f>2168\n<5510>2149\n<5511>7248\n<5512>7239\n<5513>16041\n<5514>2157\n<5517>7238\n<5518>17837\n<551a>7243\n<551e>16040\n<5523>17838\n<5525>17161\n<5526>7236\n<5527>2165\n<5528>17839\n<552a>7777\n<552b>16538\n<552c>2609\n<552d>7791\n<552e>2607\n<552f>2604\n<5530>7782\n<5531>2600\n<5532>7786\n<5533>2611\n<5534>7776\n<5535>7781\n<5536>7780\n<5537>2151\n<5538>2606\n<5539>7789\n<553b>7792\n<553c>7773\n<553e>3084\n<553f>17321\n<5540>7793\n<5541>2612\n<5543>2598\n<5544>2595\n<5545>7784\n<5546>2592\n<5547>16554\n<5548>7790\n<5549>16488\n<554a>2599\n<554b>7794\n<554d>7774\n<554e>7788\n<554f>2602\n<5550>7775\n<5551>7778\n<5552>7783\n<5555>2603\n<5556>2601\n<5557>2613\n<555c>2608\n<555d>16544\n<555e>2596\n<555f>2748\n<5561>2597\n<5562>7779\n<5563>2610\n<5564>2605\n<5565>7787\n<5566>2594\n<5569>16031\n<556a>2593\n<556b>15150\n<5571>15302\n<5572>16011\n<5573>16164\n<5577>8391\n<5579>17245\n<557b>3067\n<557c>3070\n<557d>8402\n<557e>3090\n<557f>8405\n<5580>3068\n<5581>8398\n<5582>3074\n<5583>3080\n<5584>3355\n<5586>16558\n<5587>3078\n<5588>8395\n<5589>3091\n<558a>3071\n<558b>3079\n<558c>8403\n<558d>9095\n<558e>8408\n<558f>8396\n<5590>17166\n<5591>8387\n<5592>8400\n<5593>8394\n<5594>3077\n<5595>8406\n<5598>3073\n<5599>3093\n<559a>3086\n<559c>3075\n<559d>3072\n<559f>3083\n<55a1>8407\n<55a2>8393\n<55a3>8399\n<55a4>8401\n<55a5>8389\n<55a6>8404\n<55a7>3069\n<55a8>8388\n<55a9>16559\n<55aa>3076\n<55ab>3092\n<55ac>3088\n<55ad>8390\n<55ae>3082\n<55b0>14581\n<55b1>3089\n<55b2>3085\n<55b3>3081\n<55b4>14846\n<55b5>8397\n<55ba>16009\n<55bb>3087\n<55bc>15811\n<55bf>9093\n<55c0>9089\n<55c1>15951\n<55c2>9104\n<55c3>9082\n<55c4>9091\n<55c7>3545\n<55c8>9100\n<55c9>3555\n<55ca>9087\n<55cb>9086\n<55cc>9084\n<55cd>9102\n<55ce>3543\n<55cf>9096\n<55d0>9085\n<55d1>3546\n<55d2>9094\n<55d3>3541\n<55d4>9090\n<55d5>9097\n<55d6>9099\n<55d7>17843\n<55d8>17323\n<55d9>9103\n<55da>3550\n<55db>9083\n<55dc>3544\n<55dd>9088\n<55df>3539\n<55e1>3551\n<55e2>9098\n<55e5>3554\n<55e6>3542\n<55e7>287\n<55e8>3540\n<55e9>9092\n<55ea>15996\n<55ec>14290\n<55ef>3549\n<55f0>16008\n<55f1>16003\n<55f2>9101\n<55f5>18310\n<55f6>3999\n<55f7>3994\n<55f9>9783\n<55fa>9779\n<55fb>17958\n<55fc>9773\n<55fd>3988\n<55fe>3984\n<55ff>9782\n<5600>3985\n<5601>9776\n<5602>9778\n<5604>9781\n<5605>16002\n<5606>3990\n<5608>3997\n<5609>3991\n<560c>9771\n<560f>9774\n<5610>3998\n<5611>16205\n<5612>9772\n<5613>9777\n<5614>3989\n<5615>9770\n<5616>3995\n<5617>3987\n<561b>3986\n<561c>9775\n<561d>9780\n<561e>15976\n<561f>3996\n<5620>16253\n<5621>17325\n<5622>15975\n<5623>18183\n<5625>15992\n<5627>9769\n<5629>4377\n<562a>10397\n<562c>10394\n<562d>15971\n<562e>4371\n<5632>4374\n<5633>10392\n<5634>4376\n<5635>10384\n<5636>4382\n<5637>16567\n<5638>10396\n<5639>4373\n<563a>10398\n<563b>4372\n<563d>10393\n<563e>10395\n<563f>4375\n<5640>10391\n<5641>10385\n<5642>10382\n<5643>15998\n<5645>8392\n<5646>10388\n<5648>10381\n<5649>10387\n<564a>10386\n<564c>10383\n<564d>16572\n<564e>4379\n<564f>16573\n<5650>18383\n<5652>17858\n<5653>4378\n<5654>17327\n<5657>4380\n<5658>10389\n<5659>4757\n<565a>10390\n<565d>16121\n<565e>11024\n<5660>11017\n<5661>14354\n<5662>4769\n<5663>11021\n<5664>4761\n<5665>4765\n<5666>11020\n<5668>4764\n<5669>4760\n<566a>4763\n<566b>4758\n<566c>4768\n<566d>11022\n<566e>11018\n<566f>4767\n<5670>11016\n<5671>4766\n<5672>11023\n<5673>11019\n<5674>4381\n<5676>4770\n<5677>11025\n<5678>4762\n<5679>4759\n<567a>15749\n<567b>16055\n<567c>16109\n<567e>11591\n<567f>11593\n<5680>5050\n<5681>11594\n<5682>11592\n<5683>11590\n<5684>11589\n<5685>5052\n<5686>11588\n<5687>5053\n<5689>17960\n<568a>14665\n<568b>15948\n<568e>5049\n<568f>5054\n<5690>5051\n<5692>14758\n<5693>11585\n<5695>5322\n<5697>12051\n<5698>12049\n<5699>12054\n<569a>12052\n<569c>12050\n<569d>12053\n<569e>14756\n<569f>14664\n<56a1>17259\n<56a4>15560\n<56a5>5494\n<56a8>5495\n<56aa>12419\n<56ab>12415\n<56ac>12420\n<56ad>12416\n<56ae>5323\n<56af>17911\n<56b1>17983\n<56b2>12744\n<56b3>12746\n<56b4>5644\n<56b5>12745\n<56b6>5643\n<56b7>5642\n<56b9>18543\n<56bc>5645\n<56bf>15965\n<56c0>5739\n<56c1>5738\n<56c2>5740\n<56c3>13001\n<56c5>13177\n<56c6>13176\n<56c8>5821\n<56c9>5823\n<56ca>5822\n<56cb>13178\n<56cc>5878\n<56cd>13441\n<56d1>5919\n<56d3>13440\n<56d4>13513\n<56d6>18570\n<56d7>6005\n<56da>813\n<56db>812\n<56dd>940\n<56de>939\n<56df>6096\n<56e0>938\n<56e1>6095\n<56e2>17736\n<56e4>1123\n<56e5>6224\n<56e7>6223\n<56ea>1121\n<56eb>1124\n<56ed>16580\n<56ee>6222\n<56ef>16579\n<56f0>1122\n<56f1>16575\n<56f7>6451\n<56f9>6452\n<56fa>1400\n<56fd>15716\n<56ff>1766\n<5700>16578\n<5707>7796\n<5708>2614\n<5709>2616\n<570a>7795\n<570b>2615\n<570c>8409\n<570d>3094\n<5714>9105\n<5715>15926\n<5716>4001\n<5718>4000\n<571a>10399\n<571b>11027\n<571c>11026\n<571d>14850\n<571e>13573\n<571f>634\n<5720>6020\n<5728>943\n<5729>947\n<572a>6098\n<572c>945\n<572d>944\n<572e>6097\n<572f>946\n<5730>942\n<5732>15097\n<5733>941\n<5734>6099\n<573b>1134\n<573e>1131\n<573f>18517\n<5740>1127\n<5741>6225\n<5742>16588\n<5743>16606\n<5745>6226\n<5746>16584\n<5747>1129\n<5749>6228\n<574a>1125\n<574b>6229\n<574c>6227\n<574d>1128\n<574e>1130\n<574f>1133\n<5750>1132\n<5751>1126\n<5752>6230\n<5754>18309\n<5757>18406\n<575b>14722\n<575f>16319\n<5761>1405\n<5762>6465\n<5764>1407\n<5766>1406\n<5767>16171\n<5768>6466\n<5769>1404\n<576a>1403\n<576b>6456\n<576d>6455\n<576f>6453\n<5770>6458\n<5771>6457\n<5772>6454\n<5775>6461\n<5776>6459\n<5777>1402\n<577b>6462\n<577c>1408\n<577d>6467\n<577e>18140\n<577f>14855\n<5780>6460\n<5782>1767\n<5783>1401\n<5788>18507\n<578a>15483\n<578b>1768\n<578c>6800\n<578d>14854\n<578f>6806\n<5790>16742\n<5793>1774\n<5794>6804\n<5795>6810\n<5797>6801\n<5798>6805\n<5799>6807\n<579a>6809\n<579b>6803\n<579c>17928\n<579d>6802\n<57a0>1769\n<57a1>18532\n<57a2>1771\n<57a3>1770\n<57a4>6799\n<57a5>6808\n<57a7>18708\n<57aa>18693\n<57ae>1773\n<57b4>18241\n<57b5>6796\n<57b6>7270\n<57b8>7269\n<57b9>7274\n<57ba>7265\n<57bb>15481\n<57bc>7268\n<57bd>7267\n<57be>14124\n<57bf>7271\n<57c1>7275\n<57c2>2171\n<57c3>2174\n<57c4>15195\n<57c6>7266\n<57c7>7272\n<57c8>15627\n<57cb>2173\n<57cc>7261\n<57ce>1772\n<57cf>7810\n<57d0>7273\n<57d2>7264\n<57d4>2172\n<57d5>7263\n<57d7>15485\n<57dc>7801\n<57dd>14853\n<57de>16129\n<57df>2617\n<57e0>2621\n<57e1>7817\n<57e2>7799\n<57e3>7813\n<57e4>2622\n<57e5>7815\n<57e6>16591\n<57e7>7821\n<57e9>7825\n<57ec>7816\n<57ed>7804\n<57ee>7812\n<57ef>18260\n<57f0>7826\n<57f1>7824\n<57f2>7814\n<57f3>7809\n<57f4>7802\n<57f5>8417\n<57f6>7800\n<57f7>2626\n<57f8>7807\n<57f9>2627\n<57fa>2623\n<57fb>7797\n<57fc>7819\n<57fd>7805\n<57fe>16527\n<5800>7803\n<5801>7822\n<5802>2624\n<5803>16593\n<5804>7828\n<5805>2618\n<5806>2620\n<5807>7811\n<5808>7806\n<5809>2175\n<580a>2619\n<580b>7808\n<580c>7823\n<580d>7827\n<580e>7818\n<5810>7820\n<5812>15626\n<5814>7798\n<5819>8412\n<581b>8421\n<581c>8420\n<581d>3102\n<581e>8413\n<5820>3103\n<5821>3101\n<5822>15400\n<5823>8415\n<5824>3098\n<5825>8419\n<5826>16596\n<5827>8414\n<5828>8416\n<5829>8410\n<582a>3096\n<582c>8429\n<582d>8428\n<582e>8425\n<582f>3095\n<5832>7262\n<5833>8422\n<5834>3097\n<5835>2625\n<5836>8424\n<5837>8411\n<5838>8427\n<5839>8426\n<583a>15730\n<583b>8430\n<583d>9119\n<583f>8423\n<5840>15746\n<5844>18363\n<5847>15042\n<5848>8418\n<5849>9111\n<584a>3567\n<584b>3570\n<584c>3565\n<584d>9110\n<584e>9114\n<584f>9109\n<5851>3559\n<5852>3569\n<5853>9106\n<5854>3563\n<5855>9113\n<5857>3561\n<5858>3560\n<5859>9116\n<585a>3562\n<585b>9118\n<585c>18761\n<585d>9115\n<585e>3558\n<585f>17375\n<5862>3568\n<5863>9120\n<5864>9108\n<5865>9117\n<5868>9107\n<5869>15717\n<586b>3564\n<586c>14746\n<586d>3566\n<586f>9112\n<5871>9121\n<5872>15398\n<5873>17237\n<5874>9791\n<5875>4002\n<5876>9797\n<5879>4007\n<587a>9793\n<587b>9800\n<587c>9785\n<587d>4009\n<587e>4003\n<587f>9790\n<5880>4385\n<5881>9789\n<5882>9798\n<5883>4004\n<5885>4008\n<5886>9788\n<5887>9794\n<5888>9799\n<5889>9784\n<588a>4006\n<588b>9792\n<588e>9796\n<588f>9802\n<5890>9786\n<5891>9795\n<5893>4005\n<5894>9801\n<5898>9787\n<5899>17944\n<589a>18691\n<589c>4389\n<589d>10401\n<589e>4387\n<589f>4386\n<58a0>10403\n<58a1>10408\n<58a3>10404\n<58a5>10407\n<58a6>4392\n<58a7>16107\n<58a8>4744\n<58a9>4391\n<58aa>16599\n<58ab>10400\n<58ac>10406\n<58ae>4390\n<58af>10405\n<58b0>14244\n<58b1>10402\n<58b3>4388\n<58b5>18496\n<58b6>15869\n<58ba>11032\n<58bb>14059\n<58bc>11034\n<58bd>11029\n<58be>4772\n<58bf>11031\n<58c1>4771\n<58c2>11033\n<58c5>4774\n<58c6>11035\n<58c7>4773\n<58c8>11028\n<58c9>11030\n<58cb>14857\n<58ce>5058\n<58cf>11597\n<58d1>5057\n<58d2>11598\n<58d3>5056\n<58d4>11596\n<58d5>5055\n<58d6>11595\n<58d8>5325\n<58d9>5324\n<58da>12421\n<58db>12423\n<58dc>16602\n<58dd>12422\n<58e0>16601\n<58e2>5498\n<58e3>12747\n<58e4>5646\n<58e7>13329\n<58e8>13328\n<58e9>5920\n<58eb>635\n<58ec>705\n<58ef>1135\n<58f0>17737\n<58f2>15720\n<58f3>15482\n<58f4>6811\n<58fb>16604\n<58fc>9122\n<58fd>4010\n<58fe>9803\n<58ff>10409\n<5902>548\n<5903>6021\n<5904>17738\n<5905>17817\n<5906>6231\n<5907>17739\n<590a>548\n<590c>6468\n<590d>6812\n<590e>7276\n<590f>2176\n<5911>17012\n<5912>12424\n<5914>5741\n<5915>636\n<5916>814\n<5917>6044\n<591c>1409\n<591f>16611\n<5920>2628\n<5922>4012\n<5924>4013\n<5925>4011\n<5927>637\n<5929>706\n<592a>708\n<592b>707\n<592c>6022\n<592d>709\n<592e>815\n<592f>6045\n<5931>816\n<5932>17740\n<5934>17741\n<593c>6100\n<593e>1136\n<5940>6232\n<5944>1413\n<5945>6469\n<5949>1410\n<594a>7277\n<594e>1778\n<594f>1777\n<5950>1779\n<5951>1776\n<5953>6813\n<5954>1414\n<5955>1775\n<595a>2179\n<595c>7829\n<5960>3106\n<5961>8431\n<5962>2629\n<5965>18514\n<5967>3571\n<5969>4015\n<596a>4014\n<596b>9804\n<596d>4393\n<596e>4775\n<5970>12055\n<5971>13179\n<5972>13330\n<5973>638\n<5974>817\n<5975>15978\n<5976>818\n<5977>6106\n<5978>953\n<5979>956\n<597b>6104\n<597c>6102\n<597d>955\n<597e>6105\n<597f>6107\n<5980>6101\n<5981>958\n<5982>957\n<5983>954\n<5984>952\n<5985>6103\n<5989>15664\n<598a>1147\n<598d>1144\n<598e>6237\n<598f>6240\n<5990>6239\n<5992>1138\n<5993>1146\n<5994>15513\n<5996>1143\n<5997>6236\n<5998>6234\n<5999>1142\n<599a>15280\n<599d>1137\n<599e>1140\n<599f>15791\n<59a0>6235\n<59a1>6242\n<59a2>6238\n<59a3>1141\n<59a4>1145\n<59a5>1148\n<59a6>6233\n<59a7>6241\n<59a8>1139\n<59ac>15745\n<59ae>1419\n<59af>1427\n<59b0>15576\n<59b1>6481\n<59b2>6474\n<59b3>1428\n<59b4>6485\n<59b5>6470\n<59b6>6477\n<59b7>16173\n<59b8>14864\n<59b9>1418\n<59ba>6471\n<59bb>1416\n<59bc>6478\n<59bd>6482\n<59be>1415\n<59c0>6483\n<59c1>6476\n<59c3>6479\n<59c4>15620\n<59c5>1430\n<59c6>1421\n<59c7>6486\n<59c8>6484\n<59c9>16620\n<59ca>1426\n<59cb>1424\n<59cc>6475\n<59cd>1423\n<59ce>6473\n<59cf>6472\n<59d0>1422\n<59d1>1420\n<59d2>1429\n<59d3>1425\n<59d4>1417\n<59d6>6480\n<59d8>1781\n<59d9>16625\n<59da>1788\n<59db>6827\n<59dc>1780\n<59dd>6819\n<59de>6815\n<59e0>6831\n<59e1>6814\n<59e3>1783\n<59e4>6824\n<59e5>1786\n<59e6>1789\n<59e8>1784\n<59e9>6828\n<59ea>1787\n<59eb>15705\n<59ec>2186\n<59ed>6834\n<59ee>6816\n<59ef>15672\n<59f0>15282\n<59f1>6818\n<59f2>6825\n<59f3>6829\n<59f4>6833\n<59f5>6830\n<59f6>6823\n<59f7>6826\n<59f8>15946\n<59f9>16632\n<59fa>6820\n<59fb>1791\n<59fc>6822\n<59fd>6821\n<59fe>6832\n<59ff>1782\n<5a00>6817\n<5a01>1790\n<5a02>15245\n<5a03>1785\n<5a09>2192\n<5a0a>7285\n<5a0b>15497\n<5a0c>2191\n<5a0d>15160\n<5a0f>7283\n<5a11>2180\n<5a12>14867\n<5a13>2185\n<5a15>7282\n<5a16>7279\n<5a17>7284\n<5a18>2181\n<5a19>7278\n<5a1b>2184\n<5a1c>2182\n<5a1e>7286\n<5a1f>2183\n<5a20>2187\n<5a21>14875\n<5a23>2188\n<5a24>16616\n<5a25>2190\n<5a27>15841\n<5a29>2189\n<5a2a>15163\n<5a2b>15680\n<5a2c>14863\n<5a33>7287\n<5a35>7836\n<5a36>2630\n<5a37>8445\n<5a38>7835\n<5a39>7854\n<5a3c>2636\n<5a3d>15040\n<5a3e>7852\n<5a40>2635\n<5a41>2631\n<5a42>7861\n<5a43>7845\n<5a44>7848\n<5a45>14615\n<5a46>2639\n<5a47>7858\n<5a48>7850\n<5a49>2632\n<5a4a>2640\n<5a4c>7855\n<5a4d>7853\n<5a50>7838\n<5a51>7859\n<5a52>7847\n<5a53>7842\n<5a54>17923\n<5a55>7832\n<5a56>7860\n<5a57>7844\n<5a58>7831\n<5a59>15156\n<5a5a>2638\n<5a5b>7849\n<5a5c>7862\n<5a5d>7846\n<5a5e>7834\n<5a5f>7839\n<5a60>7830\n<5a61>15667\n<5a62>2637\n<5a63>16635\n<5a64>7843\n<5a65>7840\n<5a66>2633\n<5a67>7833\n<5a68>14775\n<5a69>7857\n<5a6a>2634\n<5a6b>14914\n<5a6c>7841\n<5a6d>7837\n<5a6e>15679\n<5a70>7856\n<5a71>15668\n<5a77>3107\n<5a78>8438\n<5a79>15585\n<5a7a>8435\n<5a7b>8452\n<5a7c>8440\n<5a7d>8453\n<5a7e>14865\n<5a7f>3109\n<5a81>14877\n<5a82>15665\n<5a83>8449\n<5a84>8446\n<5a86>15233\n<5a88>16995\n<5a8a>8447\n<5a8b>8450\n<5a8c>8454\n<5a8e>7851\n<5a8f>8456\n<5a90>9142\n<5a91>16949\n<5a92>3110\n<5a93>8457\n<5a94>8433\n<5a95>8443\n<5a96>16640\n<5a97>8448\n<5a99>14858\n<5a9a>3108\n<5a9b>3111\n<5a9c>8455\n<5a9d>8458\n<5a9e>8437\n<5a9f>8434\n<5aa0>16754\n<5aa1>15580\n<5aa2>8436\n<5aa5>8441\n<5aa6>8439\n<5aa7>3112\n<5aa9>8451\n<5aab>16634\n<5aac>8442\n<5aae>8444\n<5aaf>8432\n<5ab0>9130\n<5ab1>9128\n<5ab2>3580\n<5ab3>3578\n<5ab4>9138\n<5ab5>9129\n<5ab6>9139\n<5ab7>9135\n<5ab8>9127\n<5ab9>9141\n<5aba>9126\n<5abb>9133\n<5abc>3577\n<5abd>3576\n<5abe>3575\n<5abf>9131\n<5ac0>9136\n<5ac1>3572\n<5ac2>3579\n<5ac3>14486\n<5ac4>9124\n<5ac6>9134\n<5ac7>9123\n<5ac8>9132\n<5ac9>3573\n<5aca>9137\n<5acb>9125\n<5acc>3574\n<5acd>9140\n<5ace>15496\n<5ad3>16642\n<5ad5>9808\n<5ad6>4020\n<5ad7>4019\n<5ad8>4021\n<5ad9>9820\n<5ada>9810\n<5adb>9816\n<5adc>9805\n<5add>9819\n<5ade>9818\n<5adf>9822\n<5ae0>9815\n<5ae1>4016\n<5ae2>9814\n<5ae3>4022\n<5ae4>15238\n<5ae5>9807\n<5ae6>4017\n<5ae8>9821\n<5ae9>4018\n<5aea>9809\n<5aeb>9812\n<5aec>9817\n<5aed>9811\n<5aee>9806\n<5af0>16103\n<5af2>14325\n<5af3>9813\n<5af4>10411\n<5af5>4397\n<5af6>10414\n<5af7>10413\n<5af8>10416\n<5af9>10418\n<5afa>14062\n<5afb>4395\n<5afd>10412\n<5afe>15389\n<5aff>10410\n<5b01>10419\n<5b02>10417\n<5b03>10415\n<5b05>10421\n<5b07>10420\n<5b08>4399\n<5b09>4394\n<5b0b>4396\n<5b0c>4398\n<5b0d>18687\n<5b0f>10422\n<5b10>11042\n<5b11>15350\n<5b13>11041\n<5b14>11040\n<5b16>11043\n<5b17>11036\n<5b19>11037\n<5b1a>11045\n<5b1b>11038\n<5b1d>4776\n<5b1e>11047\n<5b1f>18753\n<5b20>11046\n<5b21>11039\n<5b23>11602\n<5b24>5061\n<5b25>11600\n<5b26>11605\n<5b27>11604\n<5b28>11044\n<5b2a>5060\n<5b2b>15236\n<5b2c>11603\n<5b2d>11599\n<5b2e>11607\n<5b2f>11606\n<5b30>5059\n<5b32>11601\n<5b34>4777\n<5b38>5326\n<5b3c>12056\n<5b40>5647\n<5b41>14536\n<5b43>5648\n<5b44>14916\n<5b45>12748\n<5b46>17074\n<5b47>13005\n<5b48>13004\n<5b4a>14541\n<5b4d>13331\n<5b4e>13442\n<5b4f>14897\n<5b53>641\n<5b54>710\n<5b55>819\n<5b56>6108\n<5b5c>1150\n<5b5d>1149\n<5b5f>1431\n<5b62>6487\n<5b63>1433\n<5b64>1432\n<5b65>6488\n<5b66>17742\n<5b68>17949\n<5b69>1792\n<5b6b>2193\n<5b6c>7288\n<5b6d>15967\n<5b6e>7864\n<5b70>2641\n<5b71>3114\n<5b72>7863\n<5b73>3113\n<5b74>14130\n<5b75>4023\n<5b76>16650\n<5b77>9823\n<5b78>4778\n<5b7a>5062\n<5b7b>11608\n<5b7c>16652\n<5b7d>5649\n<5b7f>5824\n<5b80>549\n<5b81>6046\n<5b82>16452\n<5b83>820\n<5b84>6047\n<5b85>963\n<5b89>964\n<5b8b>1154\n<5b8c>1153\n<5b8e>6243\n<5b8f>1155\n<5b90>18665\n<5b92>6244\n<5b93>6489\n<5b95>6490\n<5b97>1434\n<5b98>1436\n<5b99>1438\n<5b9a>1435\n<5b9b>1439\n<5b9c>1437\n<5b9d>16662\n<5ba2>1796\n<5ba3>1793\n<5ba4>1795\n<5ba5>1797\n<5ba6>1794\n<5ba7>7289\n<5ba8>6835\n<5baa>16763\n<5bac>7291\n<5bad>7290\n<5bae>2199\n<5bb0>2195\n<5bb3>2196\n<5bb4>2198\n<5bb5>2200\n<5bb6>2197\n<5bb8>2202\n<5bb9>2201\n<5bbf>2646\n<5bc0>7866\n<5bc1>7865\n<5bc2>2645\n<5bc3>16165\n<5bc4>2644\n<5bc5>2643\n<5bc6>2647\n<5bc7>2642\n<5bca>8464\n<5bcb>8461\n<5bcc>3116\n<5bcd>8460\n<5bce>8465\n<5bd0>3118\n<5bd1>8463\n<5bd2>3115\n<5bd3>3117\n<5bd4>8462\n<5bd5>16657\n<5bd6>9143\n<5bd7>17083\n<5bde>4024\n<5bdf>4032\n<5be0>9824\n<5be1>4026\n<5be2>4030\n<5be3>9825\n<5be4>4031\n<5be7>4025\n<5be8>4029\n<5be9>4402\n<5bea>8459\n<5beb>4403\n<5bec>4401\n<5bee>4400\n<5bef>11048\n<5bf0>4779\n<5bf3>16661\n<5bf5>5499\n<5bf6>5650\n<5bf8>642\n<5bfa>965\n<5bff>16605\n<5c01>1798\n<5c03>7292\n<5c04>2203\n<5c05>16664\n<5c07>2650\n<5c08>2649\n<5c09>2648\n<5c0c>8466\n<5c0d>4033\n<5c0e>4780\n<5c0f>643\n<5c10>6023\n<5c11>711\n<5c12>6048\n<5c13>16666\n<5c14>16668\n<5c15>6109\n<5c16>966\n<5c1a>1440\n<5c1c>17898\n<5c1e>14889\n<5c1f>9146\n<5c20>15753\n<5c22>644\n<5c23>17640\n<5c24>712\n<5c25>6110\n<5c28>6245\n<5c2a>6246\n<5c2c>1156\n<5c30>8467\n<5c31>3121\n<5c33>9147\n<5c37>5063\n<5c38>645\n<5c39>665\n<5c3a>713\n<5c3b>6049\n<5c3c>821\n<5c3e>1160\n<5c3f>1159\n<5c44>6491\n<5c47>6492\n<5c48>1441\n<5c49>16671\n<5c4a>16220\n<5c4b>1802\n<5c4c>6836\n<5c4d>1801\n<5c50>2206\n<5c51>2204\n<5c53>16130\n<5c54>7294\n<5c55>2205\n<5c56>7293\n<5c58>2194\n<5c59>7867\n<5c5e>15719\n<5c60>2651\n<5c62>4034\n<5c63>9826\n<5c67>10423\n<5c68>5064\n<5c6c>5742\n<5c6d>13443\n<5c6e>6006\n<5c6f>714\n<5c71>646\n<5c73>6051\n<5c74>6050\n<5c79>967\n<5c7c>6111\n<5c7e>6114\n<5c85>16673\n<5c86>6254\n<5c88>6249\n<5c89>6251\n<5c8a>6253\n<5c8b>6250\n<5c8c>1164\n<5c8d>6247\n<5c8f>6248\n<5c92>6252\n<5c93>6255\n<5c94>1163\n<5c95>6256\n<5c99>18060\n<5c9a>17745\n<5c9c>18778\n<5c9d>6506\n<5c9e>14890\n<5c9f>6500\n<5ca0>6495\n<5ca1>1445\n<5ca2>6503\n<5ca3>6501\n<5ca4>6494\n<5ca5>6507\n<5ca6>6510\n<5ca7>6505\n<5ca8>6498\n<5ca9>1447\n<5caa>6504\n<5cab>1448\n<5cac>6499\n<5cad>6502\n<5cae>6493\n<5caf>6497\n<5cb0>6509\n<5cb1>1449\n<5cb3>1450\n<5cb5>6496\n<5cb6>6508\n<5cb7>1444\n<5cb8>1446\n<5cba>16683\n<5cc1>17336\n<5cc2>15692\n<5cc6>6853\n<5cc7>6846\n<5cc8>6852\n<5cc9>6845\n<5cca>6847\n<5ccb>6841\n<5ccc>6839\n<5cce>6854\n<5ccf>6851\n<5cd0>6837\n<5cd1>16147\n<5cd2>1804\n<5cd6>6848\n<5cd7>6840\n<5cd8>6838\n<5cd9>1803\n<5cda>6844\n<5cdb>6842\n<5cde>6843\n<5cdf>6855\n<5ce5>17975\n<5ce8>2211\n<5ce9>16674\n<5cea>2210\n<5cec>7295\n<5ced>2207\n<5cee>7297\n<5cef>16675\n<5cf0>2212\n<5cf1>7298\n<5cf4>2215\n<5cf6>2213\n<5cf7>7299\n<5cf8>6856\n<5cf9>7301\n<5cfb>2209\n<5cfd>2208\n<5cff>7296\n<5d00>7300\n<5d01>2214\n<5d06>2655\n<5d07>2654\n<5d0b>7869\n<5d0c>7873\n<5d0d>7875\n<5d0e>2656\n<5d0f>7878\n<5d10>16679\n<5d11>2660\n<5d12>7880\n<5d14>2662\n<5d15>17337\n<5d16>2658\n<5d17>2666\n<5d18>16680\n<5d19>2663\n<5d1a>7871\n<5d1b>2657\n<5d1d>7870\n<5d1e>7868\n<5d1f>7882\n<5d20>7872\n<5d22>2659\n<5d23>7881\n<5d24>2664\n<5d25>7877\n<5d26>7876\n<5d27>2665\n<5d28>7874\n<5d29>2661\n<5d2c>15863\n<5d2e>7883\n<5d2f>18131\n<5d30>7879\n<5d31>8482\n<5d32>8489\n<5d33>8478\n<5d34>3124\n<5d35>8474\n<5d36>8490\n<5d37>8468\n<5d38>8487\n<5d39>8485\n<5d3a>8479\n<5d3c>8488\n<5d3d>8481\n<5d3e>17961\n<5d3f>8473\n<5d40>8491\n<5d41>8471\n<5d42>8484\n<5d43>8469\n<5d45>8492\n<5d46>16681\n<5d47>3125\n<5d48>17962\n<5d49>8486\n<5d4a>9150\n<5d4b>8472\n<5d4c>3122\n<5d4e>8476\n<5d50>3123\n<5d51>8475\n<5d52>8480\n<5d55>8477\n<5d56>17338\n<5d57>16330\n<5d59>8483\n<5d5b>15829\n<5d5e>9154\n<5d62>9157\n<5d63>9149\n<5d65>9151\n<5d67>9156\n<5d68>9155\n<5d69>3581\n<5d6b>8470\n<5d6c>9153\n<5d6f>3582\n<5d70>18148\n<5d71>9148\n<5d72>9152\n<5d74>16111\n<5d77>9833\n<5d79>9840\n<5d7a>9831\n<5d7c>9838\n<5d7d>9829\n<5d7e>9837\n<5d7f>9841\n<5d80>9828\n<5d81>9832\n<5d82>9827\n<5d84>4035\n<5d85>15924\n<5d86>9830\n<5d87>4036\n<5d88>9836\n<5d89>9835\n<5d8a>9834\n<5d8b>16676\n<5d8d>9839\n<5d8e>16140\n<5d92>10427\n<5d93>10429\n<5d94>4407\n<5d95>10430\n<5d97>10425\n<5d99>10424\n<5d9a>10434\n<5d9c>10432\n<5d9d>4406\n<5d9e>10435\n<5d9f>10426\n<5da0>10431\n<5da1>10433\n<5da2>10428\n<5da4>17965\n<5da7>11052\n<5da8>11057\n<5da9>11051\n<5daa>11056\n<5dab>15929\n<5dac>11049\n<5dad>11059\n<5dae>11055\n<5daf>11060\n<5db0>11054\n<5db1>11050\n<5db2>11058\n<5db4>11061\n<5db5>11053\n<5db6>16728\n<5db7>11611\n<5db8>5068\n<5db9>17966\n<5dba>5066\n<5dbc>5065\n<5dbd>5067\n<5dc0>12059\n<5dc1>15359\n<5dc2>12323\n<5dc3>12428\n<5dc9>5651\n<5dcb>13006\n<5dcd>5743\n<5dcf>13007\n<5dd1>13183\n<5dd2>5826\n<5dd4>5825\n<5dd5>13182\n<5dd6>5879\n<5dd7>16684\n<5dd8>13332\n<5ddb>550\n<5ddd>647\n<5dde>968\n<5ddf>6115\n<5de0>6257\n<5de1>1306\n<5de2>2667\n<5de5>648\n<5de6>824\n<5de7>823\n<5de8>822\n<5deb>1165\n<5dee>2216\n<5df0>9158\n<5df4>715\n<5df5>16225\n<5df7>1805\n<5df9>6857\n<5dfd>3126\n<5dfe>652\n<5dff>6024\n<5e04>6052\n<5e06>969\n<5e09>16704\n<5e0a>6258\n<5e0b>15754\n<5e0c>1166\n<5e0e>6259\n<5e11>1456\n<5e12>16174\n<5e14>6512\n<5e15>1454\n<5e16>1453\n<5e17>6511\n<5e18>1451\n<5e19>6513\n<5e1a>1452\n<5e1b>1455\n<5e1d>1806\n<5e1f>1808\n<5e20>6861\n<5e24>6862\n<5e25>1807\n<5e28>7303\n<5e29>7302\n<5e2b>2218\n<5e2d>2217\n<5e2e>16693\n<5e33>2670\n<5e34>7885\n<5e36>2669\n<5e37>2671\n<5e38>2668\n<5e3d>3128\n<5e3e>7884\n<5e40>3129\n<5e41>8494\n<5e42>17312\n<5e43>3130\n<5e44>8493\n<5e45>3127\n<5e48>14892\n<5e4a>9161\n<5e4b>9163\n<5e4c>3583\n<5e4d>9162\n<5e4e>9160\n<5e4f>9159\n<5e53>9844\n<5e54>4041\n<5e55>4039\n<5e57>4040\n<5e5b>4037\n<5e5c>10439\n<5e5d>10437\n<5e5e>14891\n<5e5f>4409\n<5e60>10438\n<5e61>4410\n<5e62>4408\n<5e63>4038\n<5e66>11064\n<5e69>10436\n<5e6a>11613\n<5e6b>5069\n<5e6c>11612\n<5e6f>11065\n<5e70>12429\n<5e72>653\n<5e73>827\n<5e74>971\n<5e75>6116\n<5e76>970\n<5e78>1457\n<5e79>3584\n<5e7a>551\n<5e7b>716\n<5e7c>828\n<5e7d>1809\n<5e7e>3131\n<5e7f>552\n<5e80>6053\n<5e82>6054\n<5e83>16648\n<5e84>6117\n<5e86>17746\n<5e87>1168\n<5e88>6263\n<5e89>6261\n<5e8a>1169\n<5e8b>6260\n<5e8c>6262\n<5e8d>6264\n<5e8f>1167\n<5e97>1459\n<5e9a>1458\n<5e9b>6866\n<5e9c>1460\n<5ea0>1810\n<5ea2>6865\n<5ea3>6867\n<5ea4>6864\n<5ea5>6868\n<5ea6>1811\n<5ea7>2221\n<5ea8>7304\n<5eaa>7306\n<5eab>2219\n<5eac>7307\n<5ead>2220\n<5eae>7305\n<5eb0>6863\n<5eb1>7886\n<5eb4>7887\n<5eb5>2675\n<5eb6>2674\n<5eb9>7888\n<5ebd>17341\n<5ebe>2676\n<5ec4>3135\n<5ec5>9164\n<5ec6>9166\n<5ec7>9168\n<5ec8>3586\n<5ec9>3585\n<5eca>3132\n<5ecb>9167\n<5ecc>9165\n<5ecd>14896\n<5ece>9848\n<5ed1>9846\n<5ed2>9852\n<5ed3>4042\n<5ed4>9853\n<5ed5>9850\n<5ed6>4043\n<5ed7>9847\n<5ed8>9845\n<5ed9>9851\n<5eda>4412\n<5edb>10441\n<5edc>9849\n<5edd>4414\n<5ede>10442\n<5edf>4413\n<5ee0>4416\n<5ee1>10443\n<5ee2>4411\n<5ee3>4415\n<5ee5>11070\n<5ee6>11068\n<5ee7>11067\n<5ee8>11069\n<5ee9>11066\n<5eec>5501\n<5ef1>13008\n<5ef2>13184\n<5ef3>5954\n<5ef4>553\n<5ef6>1463\n<5ef7>1170\n<5ef8>14447\n<5ef9>16707\n<5efa>1812\n<5efb>16708\n<5efc>16710\n<5efe>654\n<5eff>717\n<5f01>829\n<5f02>6118\n<5f04>1171\n<5f05>6265\n<5f07>6869\n<5f08>1813\n<5f0a>4044\n<5f0b>655\n<5f0c>14910\n<5f0d>16713\n<5f0e>14911\n<5f0f>972\n<5f12>3587\n<5f13>656\n<5f17>831\n<5f18>830\n<5f1a>6119\n<5f1b>973\n<5f1d>6266\n<5f1f>1172\n<5f25>17968\n<5f28>6514\n<5f29>1466\n<5f2d>1814\n<5f2e>6870\n<5f30>7309\n<5f31>2222\n<5f33>7308\n<5f35>2677\n<5f36>7891\n<5f37>2678\n<5f38>7892\n<5f3a>16718\n<5f3c>3136\n<5f40>9169\n<5f43>9855\n<5f44>9854\n<5f46>4045\n<5f48>4417\n<5f49>10444\n<5f4a>4781\n<5f4b>11071\n<5f4c>5070\n<5f4d>15269\n<5f4e>5827\n<5f4f>13334\n<5f50>554\n<5f51>17641\n<5f54>6518\n<5f56>6871\n<5f57>2679\n<5f58>8495\n<5f59>3588\n<5f5c>15706\n<5f5d>5327\n<5f61>555\n<5f62>1174\n<5f63>16722\n<5f64>1173\n<5f65>1815\n<5f67>7310\n<5f69>2681\n<5f6a>2953\n<5f6b>2682\n<5f6c>2680\n<5f6d>3137\n<5f6f>9856\n<5f70>4046\n<5f71>4418\n<5f72>16724\n<5f73>6007\n<5f74>6120\n<5f76>6268\n<5f77>1175\n<5f78>6267\n<5f79>1176\n<5f7b>16472\n<5f7c>1470\n<5f7d>6521\n<5f7e>6520\n<5f7f>1469\n<5f82>6519\n<5f83>17969\n<5f85>1817\n<5f86>6872\n<5f87>1820\n<5f88>1816\n<5f89>1822\n<5f8c>1821\n<5f90>2225\n<5f91>2224\n<5f92>2223\n<5f96>7894\n<5f97>2683\n<5f98>2686\n<5f99>2684\n<5f9b>7893\n<5f9c>2689\n<5f9e>2685\n<5f9f>7895\n<5fa0>2688\n<5fa1>2687\n<5fa4>16428\n<5fa5>8497\n<5fa6>8496\n<5fa7>16727\n<5fa8>3140\n<5fab>8498\n<5fac>3589\n<5fad>9171\n<5fae>3590\n<5faf>9170\n<5fb1>15768\n<5fb2>10445\n<5fb5>4420\n<5fb6>9857\n<5fb7>4419\n<5fb9>4047\n<5fba>16287\n<5fbb>11073\n<5fbc>11072\n<5fbd>5071\n<5fbe>11614\n<5fbf>12430\n<5fc3>720\n<5fc4>17642\n<5fc5>832\n<5fc9>6055\n<5fcc>1178\n<5fcd>1180\n<5fcf>6123\n<5fd0>6271\n<5fd1>6270\n<5fd2>6269\n<5fd4>6122\n<5fd5>6121\n<5fd6>975\n<5fd7>1179\n<5fd8>1177\n<5fd9>974\n<5fdb>14922\n<5fdd>1471\n<5fde>6522\n<5fdf>16815\n<5fe0>1472\n<5fe1>6276\n<5fe3>6278\n<5fe4>6277\n<5fe5>6523\n<5fe8>6273\n<5fea>1184\n<5feb>1182\n<5fed>6272\n<5fee>6274\n<5fef>6280\n<5ff1>1181\n<5ff3>6275\n<5ff4>6284\n<5ff5>1474\n<5ff7>6281\n<5ff8>1183\n<5ffa>6279\n<5ffb>6282\n<5ffd>1473\n<5fff>1475\n<6000>6283\n<6009>6543\n<600a>6530\n<600b>6528\n<600c>6542\n<600d>6537\n<600e>1827\n<600f>1476\n<6010>6538\n<6011>6541\n<6012>1823\n<6013>6540\n<6014>1477\n<6015>1482\n<6016>1480\n<6017>6531\n<6019>6526\n<601a>6533\n<601b>1487\n<601c>6544\n<601d>1824\n<601e>6534\n<6020>1825\n<6021>1483\n<6022>6536\n<6023>16773\n<6024>6887\n<6025>1826\n<6026>6525\n<6027>1484\n<6028>1828\n<6029>1485\n<602a>1481\n<602b>1486\n<602c>6535\n<602d>6524\n<602e>6539\n<602f>1478\n<6031>16737\n<6032>6527\n<6033>6532\n<6034>6529\n<6035>1479\n<6037>6873\n<6039>6874\n<603b>17747\n<6040>6884\n<6041>7314\n<6042>6885\n<6043>1834\n<6044>6888\n<6045>6878\n<6046>1833\n<6047>6880\n<6049>6881\n<604a>16500\n<604c>6883\n<604d>1829\n<6050>2229\n<6052>14060\n<6053>6879\n<6054>6875\n<6055>2230\n<6058>6889\n<6059>2226\n<605a>7312\n<605b>6882\n<605d>7311\n<605e>6877\n<605f>6886\n<6062>1832\n<6063>2227\n<6064>1838\n<6065>2228\n<6066>6890\n<6067>7313\n<6068>1831\n<6069>2232\n<606a>1837\n<606b>1836\n<606c>1835\n<606d>2231\n<606e>6891\n<606f>2233\n<6070>1830\n<6072>6876\n<6075>14934\n<6077>16389\n<607e>14919\n<607f>2690\n<6080>7317\n<6081>7319\n<6083>7321\n<6084>2234\n<6085>2240\n<6086>7898\n<6087>7325\n<6088>7316\n<6089>2692\n<608a>7896\n<608c>2239\n<608d>2237\n<608e>7327\n<6090>7897\n<6092>7318\n<6094>2238\n<6095>7322\n<6096>2241\n<6097>7324\n<609a>2236\n<609b>7323\n<609c>7326\n<609d>7320\n<609e>16746\n<609f>2235\n<60a0>2693\n<60a2>7315\n<60a3>2691\n<60a4>16385\n<60a7>15068\n<60a8>2694\n<60b0>7900\n<60b1>7909\n<60b2>3143\n<60b4>2696\n<60b5>2701\n<60b6>3144\n<60b7>7911\n<60b8>2708\n<60b9>8500\n<60ba>7901\n<60bb>2700\n<60bc>2703\n<60bd>2698\n<60be>7899\n<60bf>7913\n<60c0>7916\n<60c1>8515\n<60c3>7914\n<60c4>8504\n<60c5>2699\n<60c6>2706\n<60c7>2710\n<60c8>7908\n<60c9>8499\n<60ca>7912\n<60cb>2695\n<60cc>8501\n<60cd>7915\n<60ce>8503\n<60cf>7904\n<60d1>3141\n<60d5>2705\n<60d7>17973\n<60d8>2704\n<60d9>7906\n<60da>2709\n<60db>7910\n<60dc>2702\n<60dd>7907\n<60df>2707\n<60e0>3145\n<60e1>3142\n<60e2>8502\n<60e3>15733\n<60e4>7905\n<60e6>2697\n<60e7>15748\n<60e8>15739\n<60e9>16393\n<60f0>3150\n<60f1>3154\n<60f2>8506\n<60f3>3595\n<60f4>3152\n<60f5>8510\n<60f6>3156\n<60f7>9172\n<60f8>8512\n<60f9>3597\n<60fa>3148\n<60fb>3151\n<60fc>8513\n<60fd>16296\n<60fe>8514\n<60ff>8520\n<6100>3158\n<6101>3598\n<6103>8516\n<6104>8521\n<6105>8509\n<6106>3608\n<6107>15413\n<6108>3599\n<6109>3157\n<610a>8507\n<610b>8522\n<610c>15495\n<610d>3607\n<610e>3155\n<610f>3592\n<6110>8519\n<6112>3159\n<6113>8511\n<6114>8505\n<6115>3149\n<6116>8508\n<6118>8517\n<6119>16118\n<611a>3591\n<611b>3596\n<611c>3146\n<611d>8518\n<611f>3594\n<6123>3147\n<6127>3606\n<6128>9859\n<6129>9183\n<612b>9175\n<612c>9858\n<612e>9179\n<612f>9181\n<6130>16183\n<6132>9178\n<6134>3605\n<6136>9177\n<6137>3609\n<613b>9874\n<613d>17974\n<613e>3604\n<613f>4049\n<6140>9184\n<6141>9860\n<6142>16756\n<6144>3602\n<6145>9176\n<6146>9180\n<6147>4048\n<6148>3593\n<614b>4050\n<614c>3601\n<614d>3603\n<614e>3600\n<614f>9182\n<6150>15410\n<6154>9870\n<6155>4425\n<6156>9877\n<6158>4056\n<6159>16314\n<615a>4055\n<615b>9872\n<615c>16774\n<615d>4424\n<615e>9861\n<615f>4054\n<6160>18764\n<6161>9876\n<6164>16755\n<6165>9873\n<6166>10462\n<6167>4422\n<6168>3153\n<616a>9875\n<616b>4429\n<616c>9867\n<616e>4423\n<616f>16320\n<6170>4428\n<6171>9862\n<6172>9866\n<6173>9863\n<6174>9869\n<6175>4057\n<6176>4421\n<6177>4051\n<6179>10448\n<617a>9871\n<617c>4427\n<617d>16317\n<617e>4430\n<6180>9868\n<6181>16759\n<6182>4426\n<6183>10447\n<6187>16762\n<6189>10452\n<618a>4785\n<618b>10446\n<618c>11085\n<618d>10461\n<618e>4434\n<6190>4432\n<6191>4783\n<6192>10458\n<6193>10454\n<6194>4438\n<6195>15840\n<6196>11076\n<6198>14933\n<6199>14932\n<619a>4436\n<619b>10453\n<619c>16386\n<619d>11074\n<619f>10457\n<61a1>10460\n<61a2>10451\n<61a4>4437\n<61a7>4431\n<61a8>11075\n<61a9>4784\n<61aa>10459\n<61ab>4433\n<61ac>4435\n<61ad>10456\n<61ae>4439\n<61af>10455\n<61b0>10450\n<61b1>10449\n<61b2>4782\n<61b3>10463\n<61b4>11078\n<61b5>11616\n<61b6>4787\n<61b7>17977\n<61b8>11084\n<61b9>17343\n<61ba>11082\n<61bc>11617\n<61be>4788\n<61bf>11083\n<61c0>14928\n<61c1>11080\n<61c2>5073\n<61c3>11615\n<61c5>11077\n<61c6>11079\n<61c7>5074\n<61c8>4790\n<61c9>5072\n<61ca>4789\n<61cb>5076\n<61cc>11081\n<61cd>4786\n<61cf>17978\n<61d0>16769\n<61d3>16766\n<61d6>12070\n<61d8>12062\n<61da>14513\n<61de>11623\n<61df>12063\n<61e0>11619\n<61e2>16325\n<61e3>5328\n<61e4>11621\n<61e5>11620\n<61e6>5075\n<61e7>11618\n<61e8>11622\n<61e9>12071\n<61ea>12067\n<61eb>12069\n<61f0>12068\n<61f1>12066\n<61f2>5502\n<61f5>5505\n<61f6>5504\n<61f7>5503\n<61f8>5652\n<61f9>12755\n<61fa>5653\n<61fb>12431\n<61fc>5744\n<61fd>13009\n<61fe>5745\n<61ff>5828\n<6200>5880\n<6201>13335\n<6207>13619\n<6208>721\n<6209>6056\n<620a>833\n<620e>976\n<6210>979\n<6211>1186\n<6212>1185\n<6214>6545\n<6215>1489\n<6216>1488\n<6219>7328\n<621f>3160\n<6220>9185\n<6223>9187\n<6224>9189\n<6225>9188\n<6227>9879\n<6229>9878\n<622a>4058\n<622b>9880\n<622c>17980\n<622d>10464\n<622e>4440\n<6230>4791\n<6232>5077\n<6233>5329\n<6234>5078\n<6236>722\n<6237>17690\n<6239>16322\n<623a>6285\n<623d>6546\n<623e>1491\n<623f>1490\n<6240>1492\n<6241>1839\n<6246>7329\n<6247>2242\n<6248>2713\n<6249>3161\n<624a>8523\n<624b>723\n<624c>17644\n<624d>657\n<624e>724\n<6250>6057\n<6251>837\n<6252>836\n<6258>982\n<6259>6130\n<625a>6132\n<625b>981\n<625c>6124\n<625e>6125\n<6260>6131\n<6261>6127\n<6262>6129\n<6263>980\n<6264>6126\n<6265>6133\n<6266>6128\n<6268>16149\n<626d>1193\n<626e>1202\n<626f>1200\n<6270>6295\n<6271>6292\n<6272>6300\n<6273>1198\n<6274>6301\n<6276>1191\n<6277>6298\n<6279>1197\n<627a>6294\n<627b>6293\n<627c>1195\n<627d>6299\n<627e>1196\n<627f>1493\n<6280>1190\n<6281>6296\n<6282>16262\n<6283>6286\n<6284>1187\n<6285>16208\n<6286>1206\n<6287>6291\n<6288>6297\n<6289>1192\n<628a>1194\n<628c>6287\n<6290>17344\n<6291>1205\n<6292>1199\n<6293>1204\n<6294>6290\n<6295>1203\n<6296>1189\n<6297>1188\n<6298>1201\n<629d>16022\n<62a4>14953\n<62a6>16321\n<62a8>1507\n<62a9>6558\n<62aa>6551\n<62ab>1502\n<62ac>1521\n<62ad>6547\n<62ae>6554\n<62af>6556\n<62b0>6559\n<62b1>1516\n<62b3>6555\n<62b4>6548\n<62b5>1514\n<62b6>6552\n<62b8>6560\n<62b9>1499\n<62bb>6557\n<62bc>1509\n<62bd>1508\n<62be>6550\n<62bf>1497\n<62c2>1498\n<62c3>15759\n<62c4>1496\n<62c5>16778\n<62c6>1520\n<62c7>1512\n<62c8>1506\n<62c9>1494\n<62ca>6553\n<62cb>1505\n<62cc>1495\n<62cd>1513\n<62ce>1522\n<62cf>6894\n<62d0>1510\n<62d1>6549\n<62d2>1500\n<62d5>16780\n<62d8>1517\n<62d9>1511\n<62da>1515\n<62db>1501\n<62dc>1840\n<62df>16412\n<62e5>17981\n<62eb>6900\n<62ec>1852\n<62ed>1844\n<62ee>1846\n<62ef>1851\n<62f0>6912\n<62f1>1849\n<62f2>7330\n<62f3>2243\n<62f4>1854\n<62f5>6897\n<62f6>6905\n<62f7>1850\n<62f8>6904\n<62f9>6901\n<62fa>6909\n<62fb>6911\n<62fc>1843\n<62fd>1847\n<62fe>1853\n<62ff>2245\n<6300>6906\n<6301>1845\n<6302>1856\n<6303>6899\n<6307>1848\n<6308>2244\n<6309>1842\n<630b>6896\n<630c>6903\n<630d>6895\n<630e>6898\n<630f>6902\n<6310>7331\n<6311>1855\n<6315>6910\n<6316>1841\n<6318>17345\n<6328>2259\n<6329>7343\n<632c>7333\n<632d>7349\n<632e>16093\n<632f>2248\n<6331>14949\n<6332>7917\n<6333>7351\n<6334>7345\n<6335>16150\n<6336>7336\n<6337>14947\n<6338>7354\n<6339>7339\n<633a>2254\n<633b>7940\n<633c>7342\n<633d>2256\n<633e>2247\n<6340>7356\n<6341>7344\n<6342>2250\n<6343>7337\n<6346>2251\n<6347>7350\n<6348>7357\n<6349>2253\n<634a>7341\n<634b>7340\n<634c>2261\n<634d>2260\n<634e>2246\n<634f>2252\n<6350>2255\n<6351>7353\n<6354>7347\n<6355>2249\n<6356>7332\n<6357>7355\n<6358>7346\n<6359>7348\n<635a>7352\n<6364>16327\n<6365>7918\n<6367>2721\n<6368>2741\n<6369>2740\n<636b>2729\n<636c>16782\n<636d>7936\n<636e>7932\n<636f>7929\n<6370>7947\n<6371>2724\n<6372>2716\n<6375>7934\n<6376>3177\n<6377>2720\n<6378>7942\n<6379>17255\n<637a>2742\n<637b>2739\n<637c>7938\n<637d>7921\n<637f>16203\n<6380>2738\n<6381>7944\n<6382>7920\n<6383>2727\n<6384>2731\n<6385>7943\n<6387>7930\n<6388>2732\n<6389>2726\n<638a>7919\n<638b>16776\n<638c>3163\n<638d>7946\n<638e>7928\n<638f>2737\n<6390>7931\n<6391>7945\n<6392>2736\n<6394>8524\n<6396>2717\n<6397>7926\n<6398>2722\n<6399>2733\n<639b>2728\n<639c>7935\n<639d>7925\n<639e>7923\n<639f>7941\n<63a0>2714\n<63a1>2734\n<63a2>2718\n<63a3>3162\n<63a4>7939\n<63a5>2719\n<63a7>2715\n<63a8>2730\n<63a9>2725\n<63aa>2723\n<63ab>7927\n<63ac>2735\n<63ad>7924\n<63ae>7937\n<63af>7933\n<63b0>8526\n<63b1>8525\n<63b9>16029\n<63bd>7922\n<63be>8542\n<63c0>3165\n<63c1>18088\n<63c2>8548\n<63c3>8531\n<63c4>8545\n<63c5>9190\n<63c6>3168\n<63c7>8549\n<63c8>8552\n<63c9>3167\n<63ca>8534\n<63cb>8551\n<63cc>8550\n<63cd>3169\n<63ce>8527\n<63cf>3164\n<63d0>3172\n<63d1>14950\n<63d2>3170\n<63d3>8547\n<63d5>8537\n<63d6>3174\n<63d7>8554\n<63d8>8546\n<63d9>8555\n<63da>3182\n<63db>3180\n<63dc>8544\n<63dd>8543\n<63de>15968\n<63df>8541\n<63e0>8535\n<63e1>3173\n<63e2>17985\n<63e3>3171\n<63e4>7338\n<63e5>8528\n<63e6>18591\n<63e7>9220\n<63e8>8529\n<63e9>3166\n<63ea>3179\n<63eb>9192\n<63ef>8530\n<63f0>8553\n<63f1>9191\n<63f2>8538\n<63f3>8533\n<63f4>3178\n<63f5>8539\n<63f6>8536\n<63f8>16786\n<63f9>3183\n<63fb>17986\n<63fc>16028\n<63fe>16030\n<6406>3626\n<6407>17987\n<6409>9195\n<640a>9214\n<640b>9219\n<640c>9207\n<640d>3622\n<640e>9224\n<640f>3619\n<6410>9193\n<6412>9194\n<6413>3612\n<6414>3621\n<6415>9201\n<6418>9202\n<641a>9215\n<641b>9221\n<641c>3620\n<641e>3614\n<641f>9200\n<6420>9196\n<6421>9223\n<6424>9197\n<6425>9217\n<6426>9208\n<6427>9218\n<6428>9210\n<642a>3615\n<642b>9881\n<642c>3618\n<642d>3616\n<642e>9222\n<642f>9213\n<6430>9209\n<6432>17881\n<6433>9198\n<6434>4068\n<6435>9212\n<6436>3623\n<6437>9204\n<6438>16785\n<6439>9203\n<643a>16797\n<643b>14955\n<643d>3617\n<643e>3613\n<643f>9902\n<6440>9216\n<6441>9211\n<6443>9199\n<644b>9897\n<644d>9882\n<644e>9893\n<6450>9900\n<6451>4066\n<6452>3181\n<6453>9898\n<6454>4061\n<6458>4060\n<6459>9905\n<645a>17346\n<645b>9883\n<645c>9896\n<645d>9884\n<645e>9895\n<645f>4064\n<6460>9899\n<6461>8540\n<6465>9906\n<6466>9891\n<6467>4067\n<6468>10478\n<6469>4441\n<646b>9904\n<646c>9903\n<646d>4069\n<646e>10465\n<646f>4442\n<6470>10466\n<6471>14939\n<6474>9885\n<6475>9890\n<6476>9886\n<6477>9907\n<6478>4063\n<6479>4443\n<647a>4065\n<647b>4070\n<647c>17260\n<647d>9889\n<647f>9901\n<6482>9894\n<6485>10469\n<6487>4059\n<6488>4446\n<6489>11092\n<648a>10474\n<648b>10473\n<648c>10475\n<648d>17187\n<648f>10472\n<6490>4447\n<6491>17347\n<6492>4453\n<6493>4450\n<6495>4451\n<6496>10467\n<6497>10470\n<6498>10480\n<6499>4459\n<649a>4457\n<649c>10471\n<649d>8532\n<649e>4444\n<649f>10477\n<64a0>10468\n<64a2>4460\n<64a3>10476\n<64a4>4062\n<64a5>4449\n<64a6>9892\n<64a9>4452\n<64ab>4456\n<64ac>4458\n<64ad>4455\n<64ae>4454\n<64af>17121\n<64b0>4448\n<64b1>10479\n<64b2>4445\n<64b3>4461\n<64b4>17216\n<64b6>14948\n<64bd>11091\n<64be>4805\n<64bf>4802\n<64c0>17989\n<64c1>4793\n<64c2>4800\n<64c3>11093\n<64c4>4798\n<64c5>4792\n<64c7>4799\n<64c9>11090\n<64ca>5080\n<64cb>4794\n<64cd>4801\n<64ce>5079\n<64cf>11089\n<64d0>11088\n<64d2>4803\n<64d3>16131\n<64d4>4804\n<64d6>11087\n<64d7>11086\n<64d8>5081\n<64d9>11096\n<64da>4797\n<64db>11094\n<64dd>17182\n<64e0>5082\n<64e1>16793\n<64e2>5087\n<64e3>11626\n<64e4>11628\n<64e5>16794\n<64e6>5084\n<64e7>14248\n<64e8>11629\n<64e9>11625\n<64ea>17226\n<64eb>11627\n<64ec>5085\n<64ed>5088\n<64ef>11624\n<64f0>5083\n<64f1>5086\n<64f2>5331\n<64f3>11095\n<64f4>5330\n<64f7>5336\n<64f8>12075\n<64fc>12078\n<64fd>12074\n<64fe>5332\n<64ff>12072\n<6500>5506\n<6501>12076\n<6503>12077\n<6504>12073\n<6506>5333\n<6507>12432\n<6509>12435\n<650a>17718\n<650c>12436\n<650d>12434\n<650e>12437\n<650f>5507\n<6510>12433\n<6511>15017\n<6513>12759\n<6514>5655\n<6515>12758\n<6516>12757\n<6517>12756\n<6518>5654\n<6519>5656\n<651b>13010\n<651c>5747\n<651d>5746\n<651e>16775\n<651f>16064\n<6520>13186\n<6521>13185\n<6522>13188\n<6523>5881\n<6524>5829\n<6525>13339\n<6526>13187\n<6529>13338\n<652a>5883\n<652b>5882\n<652c>5921\n<652d>13444\n<652e>13514\n<652f>725\n<6530>15970\n<6532>8556\n<6533>11097\n<6534>556\n<6535>17645\n<6536>983\n<6537>6134\n<6538>1209\n<6539>1207\n<653b>1208\n<653d>6561\n<653e>1523\n<653f>1857\n<6541>6913\n<6543>6914\n<6545>1858\n<6546>7359\n<654a>7358\n<654d>16799\n<654f>2749\n<6551>2745\n<6553>7948\n<6554>2752\n<6555>2751\n<6556>2744\n<6557>2747\n<6558>2750\n<6559>2746\n<655c>8560\n<655d>2743\n<655e>3184\n<655f>16805\n<6564>8559\n<6565>8562\n<6566>3185\n<6567>8557\n<6568>8561\n<656a>8558\n<656b>14956\n<656c>3627\n<656d>16804\n<656f>9225\n<6572>4071\n<6573>9908\n<6574>4806\n<6575>4462\n<6576>10481\n<6579>10483\n<657a>10482\n<657b>10484\n<657c>11099\n<657f>11098\n<6580>11631\n<6581>11630\n<6584>12438\n<6585>16803\n<6586>17992\n<6587>726\n<6588>16651\n<6589>17748\n<658c>8563\n<6590>3189\n<6591>3188\n<6592>9226\n<6594>12079\n<6595>5748\n<6596>13340\n<6597>727\n<6599>2264\n<659b>2754\n<659c>2753\n<659f>3628\n<65a0>9909\n<65a1>4072\n<65a2>11100\n<65a4>728\n<65a5>838\n<65a7>1524\n<65a8>6562\n<65aa>6915\n<65ab>1859\n<65ac>2755\n<65ae>8566\n<65af>3190\n<65b0>3629\n<65b5>16807\n<65b6>11632\n<65b7>5337\n<65b8>13515\n<65b9>729\n<65bb>6563\n<65bc>1525\n<65bd>1860\n<65be>15931\n<65bf>6916\n<65c1>2265\n<65c2>7363\n<65c5>2266\n<65c6>7360\n<65cd>7949\n<65ce>2759\n<65cf>2756\n<65d0>8567\n<65d1>16810\n<65d2>8568\n<65d3>9227\n<65d4>15272\n<65d6>4074\n<65d7>4073\n<65da>11633\n<65db>12080\n<65dd>12440\n<65de>12439\n<65df>12760\n<65e0>557\n<65e1>6025\n<65e2>1861\n<65e3>16814\n<65e5>730\n<65e6>839\n<65e8>985\n<65e9>984\n<65ee>6136\n<65ef>6135\n<65f0>6302\n<65f1>1210\n<65f2>6305\n<65f3>6304\n<65f4>6303\n<65f5>6306\n<65fa>1526\n<65fb>6569\n<65fc>6565\n<65fd>6574\n<65ff>17994\n<6600>1533\n<6602>1531\n<6603>6570\n<6604>6566\n<6605>6573\n<6606>1530\n<6607>1537\n<6608>6568\n<6609>6564\n<660a>1536\n<660b>6571\n<660c>1529\n<660d>6572\n<660e>1532\n<660f>1534\n<6610>6576\n<6611>6575\n<6612>6567\n<6613>1528\n<6614>1527\n<6615>1535\n<6618>16817\n<661c>6921\n<661d>6927\n<661e>14995\n<661f>1867\n<6620>1864\n<6621>6918\n<6622>6923\n<6623>17045\n<6624>1870\n<6625>1862\n<6626>6922\n<6627>1865\n<6628>1868\n<662b>6925\n<662d>1863\n<662e>6930\n<662f>1866\n<6630>14989\n<6631>1869\n<6632>6919\n<6633>6924\n<6634>6928\n<6635>6920\n<6636>6917\n<6639>6929\n<663a>6926\n<6641>2274\n<6642>2267\n<6643>2270\n<6644>16820\n<6645>2273\n<6647>7366\n<6648>15769\n<6649>2268\n<664a>7364\n<664b>16823\n<664c>2272\n<664f>2269\n<6651>7367\n<6652>2271\n<6653>17995\n<6657>16539\n<6659>7953\n<665a>2761\n<665b>7952\n<665c>7954\n<665d>2760\n<665e>2765\n<665f>7365\n<6661>7951\n<6662>7955\n<6663>14992\n<6664>2762\n<6665>7950\n<6666>2764\n<6667>16825\n<6668>2763\n<666a>8575\n<666b>14987\n<666c>8570\n<666e>3191\n<666f>3195\n<6670>3192\n<6671>8573\n<6672>8576\n<6673>16827\n<6674>3193\n<6676>3194\n<6677>3199\n<6678>9236\n<6679>8574\n<667a>3197\n<667b>8571\n<667c>8569\n<667d>18075\n<667e>3198\n<6680>8572\n<6684>3635\n<6685>16738\n<6686>9228\n<6689>3631\n<668a>9233\n<668b>9232\n<668c>9229\n<668d>3637\n<668e>14985\n<6690>9231\n<6691>3196\n<6692>17997\n<6694>9235\n<6695>9230\n<6696>3634\n<6697>3630\n<6698>3636\n<6699>9234\n<669a>15677\n<669d>4077\n<669f>9912\n<66a0>9911\n<66a1>9910\n<66a2>4075\n<66a4>16570\n<66a8>4076\n<66a9>10489\n<66aa>10492\n<66ab>4466\n<66ad>18760\n<66ae>4465\n<66af>10493\n<66b0>10488\n<66b1>4468\n<66b2>10490\n<66b3>16565\n<66b4>4467\n<66b5>10487\n<66b6>15891\n<66b7>10491\n<66b8>4812\n<66b9>4809\n<66ba>11109\n<66bb>11108\n<66bd>11107\n<66be>11102\n<66bf>15770\n<66c0>11103\n<66c4>4810\n<66c6>4807\n<66c7>4811\n<66c8>11101\n<66c9>4808\n<66cc>11110\n<66cd>16568\n<66ce>14967\n<66cf>11106\n<66d2>11634\n<66d6>5092\n<66d8>12083\n<66d9>5091\n<66dc>5338\n<66dd>5509\n<66de>12441\n<66e0>5508\n<66e6>5657\n<66e8>12761\n<66e9>5749\n<66eb>13341\n<66ec>5884\n<66f0>731\n<66f1>16004\n<66f4>1211\n<66f6>6577\n<66f7>1871\n<66f8>2275\n<66f9>2766\n<66fc>2591\n<6700>3056\n<6701>8577\n<6702>16836\n<6703>3638\n<6704>9914\n<6705>9913\n<6708>732\n<6709>990\n<670a>6578\n<670b>1539\n<670c>16354\n<670d>1538\n<670e>15777\n<6716>17999\n<6717>2278\n<6718>7956\n<671b>2768\n<671d>3203\n<671e>15755\n<671f>3202\n<6720>9237\n<6721>9506\n<6722>9915\n<6723>11111\n<6725>14239\n<6726>5339\n<6727>5658\n<6728>733\n<672c>841\n<672d>844\n<672e>840\n<6731>993\n<6733>6144\n<6734>992\n<6735>994\n<6736>15937\n<6738>6139\n<6739>6138\n<673a>6141\n<673b>6140\n<673c>6143\n<673d>991\n<673e>6137\n<673f>6142\n<6744>16411\n<6745>6307\n<6746>1221\n<6747>6308\n<6748>6312\n<6749>1220\n<674b>6316\n<674c>6311\n<674d>6314\n<6753>1223\n<6755>6310\n<6756>1218\n<6757>1224\n<6759>6309\n<675a>6315\n<675c>1217\n<675d>6313\n<675e>1219\n<675f>1212\n<6760>1222\n<6761>15718\n<6762>16843\n<6767>16842\n<676a>1560\n<676c>6580\n<676d>1540\n<6771>1543\n<6772>1561\n<6773>1545\n<6774>6588\n<6775>1556\n<6776>6583\n<6777>1546\n<677a>6591\n<677b>6584\n<677c>1559\n<677d>6596\n<677e>1554\n<677f>1552\n<6781>6597\n<6783>6595\n<6784>6587\n<6785>6579\n<6786>6586\n<6787>1547\n<6789>1553\n<678b>1541\n<678c>6590\n<678d>6589\n<678e>6581\n<678f>18113\n<6790>1555\n<6791>6593\n<6792>6582\n<6793>1558\n<6794>6600\n<6795>1542\n<6797>1549\n<6798>6585\n<6799>6594\n<679a>1557\n<679c>1544\n<679d>1548\n<679f>6592\n<67a0>15738\n<67a4>18001\n<67ac>16867\n<67ae>6964\n<67af>1879\n<67b0>1892\n<67b1>16884\n<67b2>6959\n<67b3>6949\n<67b4>1885\n<67b5>6947\n<67b6>1878\n<67b7>6942\n<67b8>1888\n<67b9>6955\n<67ba>6936\n<67bb>6938\n<67bf>14330\n<67c0>6941\n<67c1>6933\n<67c2>6954\n<67c3>6970\n<67c4>1883\n<67c5>6943\n<67c6>6961\n<67c8>6935\n<67cb>6972\n<67cc>6963\n<67cd>6948\n<67ce>6956\n<67cf>1889\n<67d0>1876\n<67d1>1884\n<67d2>1896\n<67d3>1873\n<67d4>1875\n<67d6>15192\n<67d7>16846\n<67d8>6940\n<67d9>1893\n<67da>1886\n<67db>6966\n<67dc>6937\n<67dd>1895\n<67de>1890\n<67df>6946\n<67e2>1894\n<67e3>6953\n<67e4>6945\n<67e5>1887\n<67e6>6965\n<67e7>6957\n<67e9>1881\n<67ea>6971\n<67eb>6944\n<67ec>1877\n<67ed>6962\n<67ee>6952\n<67ef>1882\n<67f0>6958\n<67f1>1874\n<67f2>6934\n<67f3>1891\n<67f4>2293\n<67f5>1880\n<67f6>6951\n<67f7>6950\n<67f8>6939\n<67f9>14742\n<67fa>6967\n<67fc>6960\n<67fe>17749\n<67ff>1872\n<6800>17351\n<6801>16851\n<6802>16328\n<6803>15722\n<6804>17750\n<680d>17025\n<6810>14748\n<6812>7389\n<6813>2300\n<6814>7390\n<6816>7378\n<6817>2289\n<6818>2301\n<681a>7371\n<681b>16498\n<681c>7380\n<681d>7388\n<681e>18114\n<681f>7370\n<6820>7397\n<6821>2279\n<6822>16848\n<6825>7396\n<6826>7391\n<6828>7392\n<6829>2287\n<682a>2298\n<682b>7382\n<682d>7383\n<682e>7393\n<682f>7384\n<6831>7379\n<6834>7387\n<6835>7381\n<6836>15918\n<6837>16925\n<6838>2280\n<6839>2284\n<683a>7395\n<683b>7375\n<683c>2296\n<683d>2292\n<683e>16711\n<6840>2295\n<6841>2302\n<6842>2285\n<6843>2297\n<6844>7386\n<6845>2299\n<6846>2282\n<6847>15339\n<6848>2281\n<6849>7372\n<684a>18003\n<684b>7376\n<684c>2290\n<684d>7394\n<684e>7385\n<684f>7377\n<6850>2294\n<6851>2291\n<6853>2283\n<6854>2286\n<6855>15760\n<6856>14356\n<685d>16854\n<6865>17751\n<686b>7977\n<686f>7966\n<6871>7981\n<6872>7978\n<6874>7971\n<6875>7970\n<6876>2775\n<6877>7974\n<6878>7989\n<6879>7957\n<687b>7990\n<687c>7976\n<687d>7994\n<687e>7982\n<687f>2774\n<6880>7980\n<6881>2769\n<6882>2790\n<6883>2780\n<6884>18004\n<6885>2784\n<6886>2783\n<6887>7958\n<6888>18103\n<6889>7987\n<688a>7993\n<688b>7985\n<688c>7992\n<688f>7973\n<6890>7959\n<6891>7991\n<6892>7975\n<6893>2772\n<6894>2785\n<6896>7984\n<6897>2778\n<6898>15018\n<689b>7983\n<689c>7960\n<689d>2786\n<689f>2788\n<68a0>7986\n<68a1>2789\n<68a2>2771\n<68a3>7967\n<68a4>7988\n<68a6>16612\n<68a7>2777\n<68a8>2787\n<68a9>7969\n<68aa>7979\n<68ab>7964\n<68ac>7968\n<68ad>2782\n<68ae>7963\n<68af>2770\n<68b0>2779\n<68b1>2776\n<68b2>7972\n<68b3>2288\n<68b4>8600\n<68b5>2773\n<68b6>15006\n<68b9>15636\n<68bd>17020\n<68c3>16860\n<68c4>2781\n<68c5>15406\n<68c6>8603\n<68c7>8625\n<68c8>8614\n<68c9>3223\n<68ca>17131\n<68cb>3218\n<68cc>8597\n<68cd>3219\n<68ce>8613\n<68d0>8606\n<68d1>8619\n<68d2>3215\n<68d3>8579\n<68d4>8621\n<68d5>3205\n<68d6>8587\n<68d7>3208\n<68d8>3207\n<68da>3224\n<68dc>8581\n<68df>3210\n<68e0>3206\n<68e1>8595\n<68e3>3217\n<68e4>8590\n<68e6>8617\n<68e7>3213\n<68e8>8609\n<68e9>8622\n<68ea>8584\n<68eb>8589\n<68ec>8583\n<68ee>3212\n<68ef>8602\n<68f0>9259\n<68f1>8585\n<68f2>3216\n<68f3>8594\n<68f4>8618\n<68f5>3211\n<68f6>8591\n<68f7>8588\n<68f8>8605\n<68f9>3214\n<68fa>3204\n<68fb>3226\n<68fc>8608\n<68fd>8607\n<6900>16863\n<6901>16862\n<6902>17147\n<6903>17052\n<6904>8580\n<6905>3209\n<6906>8620\n<6907>8596\n<6908>8598\n<6909>18008\n<690a>8611\n<690b>8610\n<690c>8578\n<690d>3220\n<690e>3222\n<690f>8586\n<6910>8593\n<6911>8601\n<6912>3221\n<6913>8592\n<6914>8604\n<6915>8623\n<6917>8612\n<6918>15778\n<691a>15744\n<691b>14269\n<6925>8624\n<692a>8582\n<692c>16184\n<692f>9279\n<6930>3646\n<6932>9277\n<6933>9256\n<6934>9261\n<6935>9254\n<6936>16871\n<6937>9273\n<6938>9240\n<6939>9247\n<693b>9271\n<693c>9281\n<693d>9257\n<693e>16470\n<693f>9244\n<6940>9263\n<6941>9268\n<6942>9248\n<6943>18009\n<6944>9265\n<6945>9245\n<6946>17775\n<694a>3648\n<694b>9272\n<694c>9270\n<694e>9241\n<694f>9275\n<6951>9276\n<6952>9278\n<6953>3652\n<6954>3644\n<6955>15750\n<6956>7965\n<6957>9249\n<6958>9267\n<6959>9250\n<695a>3641\n<695b>3657\n<695c>9274\n<695d>3655\n<695e>3651\n<695f>9239\n<6960>3643\n<6961>16868\n<6962>9242\n<6963>3656\n<6964>18011\n<6965>9258\n<6966>9238\n<6967>15637\n<6968>3649\n<6969>9262\n<696a>9246\n<696b>3650\n<696c>9255\n<696d>3640\n<696e>3225\n<696f>9264\n<6970>8599\n<6971>9243\n<6972>14957\n<6973>16859\n<6974>9269\n<6975>3645\n<6976>9266\n<6977>3642\n<6978>9260\n<6979>3653\n<697a>9251\n<697b>9280\n<6980>16190\n<6982>3647\n<6983>9391\n<6985>18013\n<6986>3654\n<698a>15732\n<698d>9929\n<698e>9927\n<6990>9949\n<6991>9925\n<6993>9943\n<6994>3639\n<6995>4080\n<6996>9921\n<6997>9948\n<6998>16872\n<6999>9926\n<699a>9940\n<699b>4085\n<699c>4078\n<699e>9946\n<699f>18012\n<69a0>9919\n<69a1>9945\n<69a2>14128\n<69a3>4096\n<69a4>9936\n<69a5>9952\n<69a6>4094\n<69a7>9928\n<69a8>4079\n<69a9>9930\n<69aa>9944\n<69ab>4088\n<69ac>9923\n<69ad>4092\n<69ae>4082\n<69af>9932\n<69b0>9922\n<69b1>9916\n<69b2>16374\n<69b3>9942\n<69b4>4089\n<69b5>9951\n<69b6>9917\n<69b7>4086\n<69b9>9938\n<69bb>4087\n<69bc>9924\n<69bd>9935\n<69be>9931\n<69bf>9933\n<69c0>16221\n<69c1>4081\n<69c2>9950\n<69c3>4095\n<69c4>9934\n<69c6>9953\n<69c9>9918\n<69ca>9939\n<69cb>4084\n<69cc>4093\n<69cd>4091\n<69ce>9920\n<69cf>9941\n<69d0>4090\n<69d1>14831\n<69d3>4083\n<69d4>9937\n<69d5>15932\n<69d6>18014\n<69d9>9947\n<69e1>16856\n<69e2>10505\n<69e4>10501\n<69e5>10497\n<69e6>10517\n<69e7>10514\n<69e8>4471\n<69eb>10521\n<69ec>10504\n<69ed>4482\n<69ee>10511\n<69f1>10500\n<69f2>10510\n<69f3>4479\n<69f4>10530\n<69f6>10527\n<69f7>10513\n<69f8>10498\n<69f9>16877\n<69fa>16839\n<69fb>10518\n<69fc>10520\n<69fd>4475\n<69fe>10508\n<69ff>10503\n<6a00>10494\n<6a01>4472\n<6a02>4480\n<6a03>15913\n<6a04>10523\n<6a05>4481\n<6a06>10495\n<6a07>10529\n<6a08>10516\n<6a09>10522\n<6a0a>4478\n<6a0b>16857\n<6a0c>15696\n<6a0d>10519\n<6a0f>10526\n<6a11>4483\n<6a13>4477\n<6a14>10512\n<6a15>10499\n<6a16>10531\n<6a17>10496\n<6a18>10524\n<6a19>4474\n<6a1a>15646\n<6a1b>10506\n<6a1c>15208\n<6a1d>10507\n<6a1e>4473\n<6a1f>4470\n<6a20>10502\n<6a21>4476\n<6a23>4469\n<6a25>10525\n<6a26>10528\n<6a27>10509\n<6a28>11124\n<6a2b>15682\n<6a2c>17067\n<6a2d>15135\n<6a32>11116\n<6a33>15012\n<6a34>11112\n<6a35>4825\n<6a38>4814\n<6a39>4819\n<6a3a>4815\n<6a3b>11126\n<6a3c>11137\n<6a3d>4813\n<6a3e>11118\n<6a3f>11127\n<6a40>10515\n<6a41>11128\n<6a44>4820\n<6a45>16880\n<6a46>11143\n<6a47>4824\n<6a48>4827\n<6a49>11114\n<6a4b>4823\n<6a4c>15019\n<6a4f>11132\n<6a50>11131\n<6a51>11123\n<6a52>15013\n<6a53>14252\n<6a54>11133\n<6a55>11140\n<6a56>11139\n<6a57>14298\n<6a58>4818\n<6a59>4816\n<6a5a>11125\n<6a5b>11122\n<6a5d>11119\n<6a5e>11138\n<6a5f>4826\n<6a60>11136\n<6a61>4822\n<6a62>4821\n<6a64>11130\n<6a65>18016\n<6a66>11113\n<6a67>11115\n<6a68>11117\n<6a69>11135\n<6a6a>11129\n<6a6b>4817\n<6a6d>11120\n<6a6f>11134\n<6a71>18018\n<6a74>18017\n<6a76>11121\n<6a7a>15021\n<6a7e>5100\n<6a7f>11652\n<6a80>5093\n<6a81>11637\n<6a82>18019\n<6a83>11648\n<6a84>5095\n<6a85>11655\n<6a87>11644\n<6a89>11639\n<6a8a>16694\n<6a8c>11656\n<6a8d>11635\n<6a8e>11646\n<6a8f>15387\n<6a90>5102\n<6a91>11651\n<6a92>11657\n<6a93>11645\n<6a94>5094\n<6a95>11647\n<6a96>11636\n<6a97>5101\n<6a99>18021\n<6a9a>11654\n<6a9b>11641\n<6a9c>5097\n<6a9d>16882\n<6a9e>11643\n<6a9f>11640\n<6aa0>5103\n<6aa1>11642\n<6aa2>5096\n<6aa3>5099\n<6aa4>11650\n<6aa5>11638\n<6aa6>11653\n<6aa7>14307\n<6aa8>11649\n<6aab>18023\n<6aac>5341\n<6aad>12094\n<6ab1>15955\n<6ab2>15179\n<6ab3>5340\n<6ab4>12093\n<6ab5>18024\n<6ab8>5344\n<6ab9>12085\n<6aba>12089\n<6abb>5343\n<6abd>12086\n<6abe>15009\n<6ac2>5345\n<6ac3>5342\n<6ac5>12084\n<6ac6>12088\n<6ac7>12092\n<6ac8>16885\n<6ac9>15014\n<6aca>16204\n<6acb>12447\n<6acc>12444\n<6acd>12453\n<6acf>12452\n<6ad0>12450\n<6ad1>12445\n<6ad3>5513\n<6ad4>18025\n<6ad8>15530\n<6ad9>12446\n<6ada>5512\n<6adb>5098\n<6adc>12449\n<6add>5511\n<6ade>12454\n<6adf>12448\n<6ae0>12443\n<6ae1>12087\n<6ae5>5510\n<6ae7>12442\n<6ae8>12767\n<6aea>12766\n<6aeb>12451\n<6aec>5659\n<6af0>12765\n<6af1>12769\n<6af3>12764\n<6af6>18026\n<6af8>13014\n<6af9>12768\n<6afa>5752\n<6afb>5750\n<6afc>13012\n<6b00>13015\n<6b02>13011\n<6b03>13013\n<6b04>5751\n<6b05>15015\n<6b0a>5830\n<6b0b>13189\n<6b0f>13344\n<6b10>5885\n<6b13>13447\n<6b16>5955\n<6b17>13518\n<6b1a>13519\n<6b1d>16888\n<6b1e>13620\n<6b20>734\n<6b21>995\n<6b23>1562\n<6b25>6601\n<6b28>6973\n<6b2c>7398\n<6b2d>7400\n<6b2f>7399\n<6b31>7401\n<6b32>2791\n<6b33>7996\n<6b34>7402\n<6b35>16891\n<6b36>7995\n<6b39>8626\n<6b3a>3228\n<6b3b>8627\n<6b3c>8629\n<6b3d>3229\n<6b3e>3227\n<6b3f>8628\n<6b41>9287\n<6b42>9285\n<6b43>9284\n<6b45>9283\n<6b46>9282\n<6b47>3658\n<6b48>9286\n<6b49>4097\n<6b4a>9954\n<6b4b>9956\n<6b4c>4098\n<6b4d>9955\n<6b4e>4485\n<6b50>4484\n<6b51>10532\n<6b52>16238\n<6b54>11145\n<6b55>11144\n<6b56>11146\n<6b57>15022\n<6b59>4828\n<6b5b>11658\n<6b5c>5104\n<6b5e>12095\n<6b5f>5348\n<6b60>12455\n<6b61>5831\n<6b62>735\n<6b63>845\n<6b64>996\n<6b65>1225\n<6b6a>1897\n<6b6d>7403\n<6b6f>17685\n<6b72>3659\n<6b74>16892\n<6b76>10658\n<6b77>4829\n<6b78>5349\n<6b79>736\n<6b7a>17646\n<6b7b>997\n<6b7e>6603\n<6b7f>1565\n<6b80>6602\n<6b81>18027\n<6b82>6974\n<6b83>1898\n<6b84>6975\n<6b86>1899\n<6b88>7405\n<6b89>2304\n<6b8a>2303\n<6b8c>8003\n<6b8f>8000\n<6b91>7999\n<6b94>8630\n<6b95>8633\n<6b96>3231\n<6b97>8631\n<6b98>3230\n<6b99>8632\n<6b9b>9288\n<6ba2>10535\n<6ba3>10534\n<6ba4>4486\n<6ba5>10533\n<6ba6>10536\n<6ba7>11147\n<6bad>11659\n<6bae>5105\n<6baf>5350\n<6bb0>12456\n<6bb2>5753\n<6bb3>6026\n<6bb5>1900\n<6bb6>6976\n<6bb7>2305\n<6bba>2792\n<6bbc>3232\n<6bbd>8634\n<6bbf>3661\n<6bc0>3660\n<6bc1>18028\n<6bc7>11151\n<6bc8>11150\n<6bc9>12096\n<6bca>13345\n<6bcb>737\n<6bcc>6027\n<6bcd>846\n<6bcf>1226\n<6bd0>6317\n<6bd2>1901\n<6bd3>3662\n<6bd4>738\n<6bd6>6977\n<6bd7>1902\n<6bd8>6978\n<6bda>5106\n<6bdb>739\n<6bdc>16903\n<6bde>6604\n<6be0>6979\n<6be1>16901\n<6be2>7410\n<6be3>7409\n<6be4>7407\n<6be6>7406\n<6be7>7411\n<6be8>7408\n<6bea>18029\n<6bef>3233\n<6bf0>8635\n<6bf9>9291\n<6bfa>16249\n<6bfd>3663\n<6bfe>9962\n<6bff>10539\n<6c00>10538\n<6c01>10537\n<6c02>10540\n<6c03>11153\n<6c04>11152\n<6c05>4830\n<6c06>11154\n<6c08>5107\n<6c09>11660\n<6c0b>12097\n<6c0c>12457\n<6c0d>13192\n<6c0f>740\n<6c10>848\n<6c11>847\n<6c13>1566\n<6c14>6028\n<6c15>6058\n<6c16>998\n<6c18>6145\n<6c1b>1567\n<6c1c>14507\n<6c1d>6605\n<6c1f>1903\n<6c23>2306\n<6c24>2310\n<6c25>7412\n<6c26>2309\n<6c2a>8004\n<6c2b>2795\n<6c2c>3236\n<6c30>8638\n<6c31>16227\n<6c33>4099\n<6c34>741\n<6c35>17647\n<6c36>6059\n<6c37>16904\n<6c38>849\n<6c39>15877\n<6c3a>17648\n<6c3b>6062\n<6c3d>17281\n<6c3e>852\n<6c3f>6061\n<6c40>851\n<6c41>850\n<6c42>1227\n<6c43>6060\n<6c46>6146\n<6c49>16525\n<6c4a>6150\n<6c4f>6149\n<6c50>1004\n<6c52>6147\n<6c54>6151\n<6c55>1005\n<6c57>1000\n<6c58>15290\n<6c59>1001\n<6c5a>16908\n<6c5b>1007\n<6c5c>6148\n<6c5d>999\n<6c5e>1228\n<6c61>1006\n<6c65>6336\n<6c66>6334\n<6c67>6321\n<6c68>1240\n<6c69>6328\n<6c6a>1235\n<6c6b>6322\n<6c6d>6330\n<6c6e>16586\n<6c6f>6327\n<6c70>1238\n<6c71>6326\n<6c72>1245\n<6c73>6335\n<6c74>1247\n<6c75>18030\n<6c76>1249\n<6c78>6320\n<6c79>16910\n<6c7a>1236\n<6c7b>6337\n<6c7d>1243\n<6c7e>1246\n<6c7f>14246\n<6c80>6628\n<6c81>1230\n<6c82>1253\n<6c83>1244\n<6c84>6323\n<6c85>1233\n<6c86>1248\n<6c87>6331\n<6c8a>6626\n<6c8b>6324\n<6c8c>1239\n<6c8d>1250\n<6c8e>6338\n<6c8f>6325\n<6c90>1237\n<6c92>1242\n<6c93>6606\n<6c94>1251\n<6c95>6332\n<6c96>1241\n<6c98>1252\n<6c99>1229\n<6c9a>6329\n<6c9b>1234\n<6c9c>6333\n<6c9d>6627\n<6c9f>14473\n<6ca2>15715\n<6caa>18031\n<6cab>1579\n<6cac>1595\n<6cad>6613\n<6cae>1586\n<6caf>15606\n<6cb0>6634\n<6cb1>1571\n<6cb2>16076\n<6cb3>1574\n<6cb4>6625\n<6cb6>6611\n<6cb7>6615\n<6cb8>1582\n<6cb9>1584\n<6cba>6618\n<6cbb>1591\n<6cbc>1577\n<6cbf>1590\n<6cc0>6630\n<6cc1>1585\n<6cc2>6617\n<6cc3>6619\n<6cc4>1583\n<6cc5>1588\n<6cc6>6620\n<6cc7>6633\n<6cc9>1904\n<6cca>1594\n<6ccb>16496\n<6ccc>1572\n<6ccd>6632\n<6cce>16273\n<6ccf>6636\n<6cd0>6616\n<6cd1>6638\n<6cd2>6623\n<6cd3>1581\n<6cd4>6612\n<6cd5>1580\n<6cd6>1598\n<6cd7>1587\n<6cd9>6610\n<6cda>6990\n<6cdb>1593\n<6cdc>1597\n<6cdd>6624\n<6cde>6629\n<6cdf>15703\n<6ce0>1599\n<6ce1>1592\n<6ce2>1578\n<6ce3>1568\n<6ce5>1573\n<6ce7>6614\n<6ce8>1569\n<6ce9>6637\n<6cea>16269\n<6ceb>6608\n<6cec>6607\n<6ced>6621\n<6cee>6609\n<6cef>1596\n<6cf0>2311\n<6cf1>1589\n<6cf2>6622\n<6cf3>1570\n<6cf5>1919\n<6cf9>6635\n<6d00>6997\n<6d01>7000\n<6d02>18033\n<6d03>7003\n<6d04>6992\n<6d05>14873\n<6d06>18034\n<6d07>7006\n<6d08>7009\n<6d09>7011\n<6d0a>6989\n<6d0b>1905\n<6d0c>1910\n<6d0d>7417\n<6d0e>1926\n<6d0f>7004\n<6d10>7012\n<6d11>6996\n<6d12>6988\n<6d16>7444\n<6d17>1913\n<6d18>7001\n<6d19>6993\n<6d1a>6995\n<6d1b>1918\n<6d1d>6998\n<6d1e>1912\n<6d1f>6985\n<6d20>7007\n<6d22>7010\n<6d24>15043\n<6d25>1909\n<6d26>18035\n<6d27>1921\n<6d28>6982\n<6d29>1923\n<6d2a>1907\n<6d2b>1927\n<6d2c>7008\n<6d2d>6984\n<6d2e>1924\n<6d2f>7438\n<6d30>6631\n<6d31>1911\n<6d32>1906\n<6d33>6991\n<6d34>6983\n<6d35>1925\n<6d36>1917\n<6d37>7002\n<6d38>1922\n<6d39>1920\n<6d3a>6994\n<6d3b>1914\n<6d3c>6986\n<6d3f>6987\n<6d40>7005\n<6d41>1908\n<6d42>6999\n<6d4e>17752\n<6d57>15603\n<6d58>7420\n<6d59>2319\n<6d5a>2324\n<6d5b>16540\n<6d5c>16930\n<6d5e>7429\n<6d5f>7435\n<6d60>7431\n<6d61>7418\n<6d62>7421\n<6d65>2331\n<6d66>2316\n<6d67>7430\n<6d68>7439\n<6d69>2326\n<6d6a>2312\n<6d6c>2321\n<6d6d>7422\n<6d6e>2323\n<6d6f>7423\n<6d70>7433\n<6d71>16629\n<6d72>14807\n<6d74>2325\n<6d75>7448\n<6d76>7416\n<6d77>2318\n<6d78>2317\n<6d79>2329\n<6d7a>7413\n<6d7b>7446\n<6d7c>7434\n<6d7d>7447\n<6d7e>7441\n<6d7f>7427\n<6d80>7442\n<6d81>18036\n<6d82>7436\n<6d83>7445\n<6d84>7443\n<6d85>2330\n<6d86>7428\n<6d87>2315\n<6d88>2314\n<6d89>2322\n<6d8a>2328\n<6d8b>7440\n<6d8c>2327\n<6d8d>7425\n<6d8e>2796\n<6d8f>15848\n<6d90>7449\n<6d91>7424\n<6d92>7419\n<6d93>2320\n<6d94>2332\n<6d95>2313\n<6d96>16929\n<6d97>7432\n<6d98>7437\n<6da4>18038\n<6da5>15033\n<6daa>2830\n<6dab>8006\n<6dac>8010\n<6dae>2811\n<6daf>2809\n<6db1>18039\n<6db2>2800\n<6db3>8008\n<6db4>8007\n<6db5>2820\n<6db7>8013\n<6db8>2814\n<6db9>16379\n<6dba>8031\n<6dbb>8043\n<6dbc>2797\n<6dbd>8028\n<6dbe>8021\n<6dbf>2832\n<6dc0>8005\n<6dc2>8033\n<6dc4>2829\n<6dc5>2817\n<6dc6>2828\n<6dc7>2807\n<6dc8>8017\n<6dc9>8035\n<6dca>8027\n<6dcb>2808\n<6dcc>2802\n<6dcd>8041\n<6dcf>8034\n<6dd0>8036\n<6dd1>2810\n<6dd2>2818\n<6dd3>8038\n<6dd4>8015\n<6dd5>8032\n<6dd6>8020\n<6dd7>8040\n<6dd8>2823\n<6dd9>2799\n<6dda>2821\n<6ddb>8025\n<6dde>2812\n<6ddf>8019\n<6de0>8018\n<6de1>2801\n<6de2>8012\n<6de3>8042\n<6de4>2803\n<6de5>8022\n<6de6>2833\n<6de8>2827\n<6de9>8011\n<6dea>2824\n<6deb>2822\n<6dec>2831\n<6ded>8029\n<6dee>2826\n<6def>7426\n<6df0>8030\n<6df1>2825\n<6df2>8037\n<6df3>2798\n<6df4>8026\n<6df5>2816\n<6df6>8014\n<6df7>2815\n<6df9>2813\n<6dfa>2805\n<6dfb>2804\n<6dfc>8639\n<6dfd>8039\n<6e00>8016\n<6e02>15610\n<6e03>8660\n<6e04>15038\n<6e05>2806\n<6e0a>15041\n<6e0f>15600\n<6e15>18040\n<6e18>18041\n<6e19>3265\n<6e1a>2819\n<6e1b>3247\n<6e1c>8654\n<6e1d>3261\n<6e1f>8642\n<6e20>3244\n<6e21>3240\n<6e22>8672\n<6e23>3246\n<6e24>3250\n<6e25>3245\n<6e26>3254\n<6e27>8676\n<6e28>8667\n<6e29>18042\n<6e2a>17154\n<6e2b>8649\n<6e2c>3259\n<6e2d>3253\n<6e2e>8661\n<6e2f>3237\n<6e30>8673\n<6e31>8666\n<6e32>3241\n<6e33>8655\n<6e34>3256\n<6e38>3238\n<6e39>8671\n<6e3a>3258\n<6e3b>8659\n<6e3e>3262\n<6e3f>8650\n<6e40>8657\n<6e41>8651\n<6e43>3260\n<6e44>3268\n<6e45>8647\n<6e49>8643\n<6e4a>3243\n<6e4b>8656\n<6e4d>3257\n<6e4e>3266\n<6e4f>16948\n<6e50>16849\n<6e51>8658\n<6e52>8682\n<6e53>8674\n<6e54>3239\n<6e55>8680\n<6e56>3251\n<6e58>3249\n<6e59>16614\n<6e5a>8686\n<6e5b>3248\n<6e5c>8664\n<6e5d>8652\n<6e5e>8662\n<6e5f>3271\n<6e60>8668\n<6e61>8665\n<6e62>8648\n<6e63>3267\n<6e64>8678\n<6e65>8675\n<6e66>8683\n<6e67>3242\n<6e68>8663\n<6e69>3270\n<6e6b>8670\n<6e6e>3252\n<6e6f>3255\n<6e71>8669\n<6e72>3269\n<6e73>8653\n<6e74>8009\n<6e76>14803\n<6e77>8679\n<6e78>8677\n<6e79>8681\n<6e7c>16931\n<6e86>18043\n<6e88>8644\n<6e89>3264\n<6e8b>15295\n<6e8d>9324\n<6e8e>9323\n<6e8f>9297\n<6e90>3669\n<6e92>9322\n<6e96>3679\n<6e97>9331\n<6e98>3674\n<6e99>9321\n<6e9a>17793\n<6e9b>9294\n<6e9c>3680\n<6e9d>3670\n<6e9e>9309\n<6e9f>9299\n<6ea0>9302\n<6ea1>9326\n<6ea2>3664\n<6ea3>9333\n<6ea4>9325\n<6ea5>3673\n<6ea6>9314\n<6ea7>3684\n<6eaa>3683\n<6eab>3677\n<6eae>9332\n<6eaf>3665\n<6eb0>9312\n<6eb1>9303\n<6eb2>9316\n<6eb3>9328\n<6eb4>3685\n<6eb5>16894\n<6eb6>3667\n<6eb7>9311\n<6eb8>15884\n<6eb9>9304\n<6eba>3676\n<6ebb>18045\n<6ebc>3675\n<6ebd>9307\n<6ebe>9317\n<6ebf>9327\n<6ec0>9298\n<6ec1>9308\n<6ec2>3668\n<6ec3>9318\n<6ec4>3681\n<6ec5>3672\n<6ec6>9305\n<6ec7>3671\n<6ec8>9296\n<6ec9>9310\n<6eca>9330\n<6ecb>3263\n<6ecc>4127\n<6ecd>9313\n<6ece>9963\n<6ecf>9315\n<6ed0>9329\n<6ed1>3678\n<6ed2>9306\n<6ed3>3666\n<6ed4>3682\n<6ed5>4506\n<6ed6>9295\n<6ed8>9320\n<6ed9>16489\n<6eda>18047\n<6edb>16431\n<6edc>9319\n<6edd>17720\n<6ee2>18046\n<6eeb>9991\n<6eec>4124\n<6eed>9980\n<6eee>9985\n<6eef>4113\n<6ef1>9965\n<6ef2>4126\n<6ef4>4104\n<6ef5>9964\n<6ef6>9997\n<6ef7>4128\n<6ef8>9968\n<6ef9>9984\n<6efa>16955\n<6efb>9970\n<6efc>10000\n<6efd>9996\n<6efe>4102\n<6eff>4112\n<6f00>10566\n<6f01>4125\n<6f02>4110\n<6f03>9966\n<6f04>16932\n<6f05>9995\n<6f06>4114\n<6f07>9992\n<6f08>10005\n<6f09>9972\n<6f0a>9981\n<6f0b>15034\n<6f0c>15611\n<6f0d>10003\n<6f0e>9993\n<6f0f>4109\n<6f12>9979\n<6f13>4103\n<6f14>4101\n<6f15>4119\n<6f16>16800\n<6f17>18126\n<6f18>9977\n<6f1c>9999\n<6f1e>10004\n<6f1f>10002\n<6f20>4107\n<6f21>10006\n<6f22>4111\n<6f23>4118\n<6f24>18051\n<6f25>9967\n<6f26>10542\n<6f27>9976\n<6f29>4105\n<6f2a>4123\n<6f2b>4120\n<6f2c>4108\n<6f2d>9986\n<6f2e>9971\n<6f2f>4121\n<6f30>9988\n<6f31>4115\n<6f32>4117\n<6f33>4100\n<6f34>18052\n<6f35>9990\n<6f36>9982\n<6f37>9969\n<6f38>4116\n<6f39>9998\n<6f3a>10001\n<6f3b>9978\n<6f3c>9989\n<6f3d>17026\n<6f3e>4106\n<6f3f>4489\n<6f40>9987\n<6f41>10541\n<6f43>9994\n<6f44>16960\n<6f4e>9973\n<6f4f>10551\n<6f50>10561\n<6f51>4492\n<6f52>10560\n<6f53>10572\n<6f54>4494\n<6f55>10558\n<6f56>15954\n<6f57>10562\n<6f58>4505\n<6f5a>10553\n<6f5b>4497\n<6f5c>16961\n<6f5d>10565\n<6f5e>11162\n<6f5f>4509\n<6f60>4508\n<6f61>10567\n<6f62>10550\n<6f63>10577\n<6f64>4503\n<6f66>4493\n<6f67>10570\n<6f69>10574\n<6f6a>10579\n<6f6b>10568\n<6f6c>10556\n<6f6d>4496\n<6f6e>4499\n<6f6f>4507\n<6f70>4502\n<6f72>10559\n<6f73>9983\n<6f74>16963\n<6f76>10555\n<6f77>10578\n<6f78>4498\n<6f79>15294\n<6f7a>4501\n<6f7b>10580\n<6f7c>4490\n<6f7d>10569\n<6f7e>10543\n<6f7f>10575\n<6f80>5116\n<6f81>18055\n<6f82>10557\n<6f84>4491\n<6f85>10552\n<6f86>4495\n<6f87>10544\n<6f88>4122\n<6f89>10548\n<6f8a>16789\n<6f8b>10573\n<6f8c>10549\n<6f8d>10547\n<6f8e>4500\n<6f90>10571\n<6f92>10546\n<6f93>10564\n<6f94>10563\n<6f95>10576\n<6f96>10554\n<6f97>4504\n<6f9d>16953\n<6f9e>11165\n<6f9f>16966\n<6fa0>4843\n<6fa1>4833\n<6fa2>11177\n<6fa3>11157\n<6fa4>4835\n<6fa5>11169\n<6fa6>4842\n<6fa7>4837\n<6fa8>11167\n<6fa9>11662\n<6faa>11173\n<6fab>11179\n<6fac>11172\n<6fad>11155\n<6fae>11170\n<6faf>11181\n<6fb0>11183\n<6fb1>4832\n<6fb2>11182\n<6fb3>4838\n<6fb4>4844\n<6fb5>15911\n<6fb6>4841\n<6fb8>11176\n<6fb9>4840\n<6fba>11171\n<6fbb>15291\n<6fbc>11159\n<6fbd>11164\n<6fbe>18056\n<6fbf>11175\n<6fc0>4839\n<6fc1>4836\n<6fc2>4831\n<6fc3>4834\n<6fc4>11163\n<6fc6>10545\n<6fc7>11158\n<6fc8>11161\n<6fc9>11178\n<6fca>11166\n<6fcb>11156\n<6fcc>11661\n<6fcd>11180\n<6fce>11160\n<6fcf>11174\n<6fd3>16968\n<6fd4>11664\n<6fd5>5120\n<6fd8>5108\n<6fd9>15476\n<6fda>15475\n<6fdb>5112\n<6fdc>11666\n<6fdd>11672\n<6fde>11670\n<6fe1>5118\n<6fe2>11673\n<6fe3>11665\n<6fe4>5113\n<6fe6>11669\n<6fe7>11668\n<6fe8>11674\n<6fe9>5119\n<6feb>5114\n<6fec>5117\n<6fed>11667\n<6fee>5121\n<6fef>5115\n<6ff0>5122\n<6ff1>5109\n<6ff2>11671\n<6ff4>11663\n<6ff6>14501\n<6ff7>12110\n<6ff8>16951\n<6ffa>5355\n<6ffb>12107\n<6ffc>12109\n<6ffe>5353\n<7001>12101\n<7003>18146\n<7004>11168\n<7005>12102\n<7006>5354\n<7007>12098\n<7009>5351\n<700a>12111\n<700b>5352\n<700e>12104\n<700f>5357\n<7011>5356\n<7014>12103\n<7015>5519\n<7016>12461\n<7017>12467\n<7018>5520\n<7019>12458\n<701a>5517\n<701b>5514\n<701c>12469\n<701d>5518\n<701e>15478\n<701f>5515\n<7020>12460\n<7024>12468\n<7026>12108\n<7027>12459\n<7028>5516\n<7029>12466\n<702a>12783\n<702b>12462\n<702c>18062\n<702f>12774\n<7030>5661\n<7031>12777\n<7032>5662\n<7033>12786\n<7034>12776\n<7035>12773\n<7037>12775\n<7038>12779\n<7039>12782\n<703a>12781\n<703b>12785\n<703c>12772\n<703e>5660\n<703f>12780\n<7040>12784\n<7041>12787\n<7042>12778\n<704a>13018\n<704b>16980\n<704c>5754\n<7050>18064\n<7051>5832\n<7052>13196\n<7054>18065\n<7058>5833\n<705a>13347\n<705b>13346\n<705c>14418\n<705d>13450\n<705e>5922\n<705f>13448\n<7060>13451\n<7061>13449\n<7062>13520\n<7063>5956\n<7064>5970\n<7065>13596\n<7066>13574\n<7067>15605\n<7068>13595\n<706b>742\n<706c>17649\n<706f>18066\n<7070>1010\n<7071>6154\n<7074>6339\n<7075>14535\n<7076>1254\n<7078>1257\n<7079>16537\n<707a>6340\n<707e>16981\n<707f>18067\n<7081>18777\n<7082>6647\n<7083>6649\n<7084>6644\n<7085>6641\n<7086>6643\n<7089>17401\n<708a>1603\n<708b>16587\n<708e>1601\n<708f>18099\n<7091>6645\n<7092>1602\n<7093>6642\n<7094>6639\n<7095>1600\n<7096>6646\n<7098>6640\n<7099>1604\n<709a>6648\n<709f>7014\n<70a0>18242\n<70a1>7018\n<70a3>14706\n<70a4>1936\n<70a5>15543\n<70a7>16982\n<70a9>7021\n<70ab>1928\n<70ac>1931\n<70ad>1933\n<70ae>1935\n<70af>1932\n<70b0>7017\n<70b1>7016\n<70b3>1930\n<70b7>7013\n<70b8>1934\n<70b9>15721\n<70ba>1929\n<70bb>18450\n<70bc>17753\n<70bd>17008\n<70be>7015\n<70c0>18227\n<70c4>15274\n<70c8>2337\n<70ca>2333\n<70cb>7454\n<70cc>16984\n<70cd>7462\n<70ce>7467\n<70cf>2338\n<70d0>14701\n<70d1>7452\n<70d2>7458\n<70d3>7451\n<70d4>7461\n<70d7>7457\n<70d8>2334\n<70d9>2336\n<70da>7466\n<70dc>7450\n<70dd>7453\n<70de>7459\n<70df>16987\n<70e0>7460\n<70e1>7468\n<70e2>7456\n<70e4>2335\n<70ef>2838\n<70f0>8050\n<70f1>15048\n<70f3>8052\n<70f4>8048\n<70f5>18272\n<70f6>8060\n<70f7>8046\n<70f8>8059\n<70f9>2834\n<70fa>8044\n<70fb>8690\n<70fc>8054\n<70fd>2837\n<70fe>15630\n<70ff>8055\n<7100>8058\n<7102>8062\n<7104>8051\n<7105>14883\n<7106>8056\n<710b>8061\n<710c>8049\n<710d>8045\n<710e>8063\n<7110>8053\n<7113>8057\n<7117>8047\n<711b>8700\n<711c>3279\n<711d>15687\n<711e>8688\n<711f>8697\n<7120>8687\n<7121>3276\n<7122>8695\n<7123>8693\n<7125>8694\n<7126>3274\n<7128>8698\n<7129>15273\n<712b>16993\n<712c>17002\n<712e>8691\n<712f>8689\n<7130>3275\n<7131>8692\n<7132>8696\n<7133>15700\n<7134>15486\n<7135>14189\n<7136>3277\n<713a>8699\n<713b>15045\n<713e>14126\n<7140>17304\n<7141>9339\n<7142>9346\n<7143>9348\n<7144>9354\n<7145>16994\n<7146>3698\n<7147>9334\n<7149>3690\n<714a>16996\n<714b>9349\n<714c>3695\n<714d>9355\n<714e>3686\n<714f>16999\n<7150>9352\n<7151>18533\n<7152>9336\n<7153>9353\n<7154>9335\n<7156>3700\n<7158>9347\n<7159>3687\n<715a>9356\n<715c>3692\n<715d>9340\n<715e>3697\n<715f>9351\n<7160>9338\n<7161>9345\n<7162>9341\n<7163>9337\n<7164>3689\n<7165>3696\n<7166>3694\n<7167>3691\n<7168>3699\n<7169>3688\n<716a>9344\n<716b>15557\n<716c>3693\n<716e>3278\n<7170>9350\n<7171>15808\n<7172>9342\n<7173>18407\n<7175>15597\n<7176>16384\n<7177>14679\n<7178>9343\n<717a>18724\n<717b>10014\n<717c>14389\n<717d>4131\n<717e>14704\n<7180>10010\n<7181>10016\n<7182>10012\n<7184>4133\n<7185>10011\n<7186>10015\n<7187>10007\n<7188>18182\n<7189>10009\n<718a>4132\n<718c>14826\n<718e>15675\n<718f>10013\n<7190>10008\n<7192>4134\n<7194>4129\n<7196>16991\n<7197>10017\n<7198>18461\n<7199>4130\n<719a>10586\n<719b>10583\n<719c>10595\n<719d>10589\n<719e>10591\n<719f>4510\n<71a0>10585\n<71a1>10593\n<71a2>18625\n<71a3>16072\n<71a4>10592\n<71a5>10590\n<71a7>10596\n<71a8>4513\n<71a9>10587\n<71aa>10594\n<71ac>4511\n<71ad>15901\n<71af>10582\n<71b0>10584\n<71b1>4512\n<71b2>10581\n<71b3>10597\n<71b4>16990\n<71b5>10588\n<71b7>18059\n<71b8>11187\n<71b9>4851\n<71ba>17006\n<71bc>11198\n<71bd>11196\n<71be>4845\n<71bf>11186\n<71c2>11185\n<71c5>11184\n<71c6>11199\n<71c7>11194\n<71c8>4849\n<71c9>4846\n<71ca>11193\n<71cb>11191\n<71ce>4852\n<71cf>11195\n<71d0>4847\n<71d1>14141\n<71d2>4848\n<71d4>11192\n<71d5>4850\n<71d6>11188\n<71d8>11197\n<71d9>4853\n<71dc>4854\n<71dd>16504\n<71df>5124\n<71e0>5131\n<71e1>11675\n<71e2>11681\n<71e4>11679\n<71e5>5127\n<71e6>5126\n<71e7>5123\n<71e8>11677\n<71eb>15489\n<71ec>5129\n<71ed>5128\n<71ee>5125\n<71f0>11680\n<71f1>11676\n<71f2>11678\n<71f4>5130\n<71f5>18158\n<71f6>16026\n<71f8>5361\n<71f9>12114\n<71fd>12116\n<71fe>5360\n<71ff>12113\n<7201>12112\n<7202>12473\n<7203>12115\n<7205>12474\n<7206>5521\n<7207>12472\n<7209>15803\n<720a>12471\n<720c>12470\n<720d>5522\n<720e>17009\n<720f>14844\n<7210>5663\n<7215>17011\n<7216>14675\n<7217>14697\n<7219>13025\n<721a>13024\n<721b>5755\n<721d>13023\n<7222>13348\n<7223>13452\n<7224>17014\n<7226>13521\n<7227>13621\n<7228>5990\n<7229>13641\n<722a>743\n<722b>17650\n<722e>17017\n<7230>1937\n<7235>5132\n<7236>744\n<7238>1607\n<7239>2339\n<723a>3701\n<723b>745\n<723d>2839\n<723e>4135\n<723f>6029\n<7240>17018\n<7241>7022\n<7242>7469\n<7244>10018\n<7246>5133\n<7247>746\n<7248>1608\n<724b>8701\n<724c>3280\n<724f>9357\n<7250>15049\n<7252>3702\n<7253>10019\n<7255>17021\n<7256>4514\n<7257>17022\n<7258>5523\n<7259>747\n<725a>8702\n<725b>748\n<725c>18010\n<725d>1012\n<725e>6155\n<725f>1011\n<7260>1260\n<7261>1259\n<7262>1258\n<7263>6341\n<7266>16059\n<7267>1609\n<7269>1610\n<726a>6650\n<726c>7025\n<726e>7028\n<726f>1939\n<7270>7026\n<7272>1938\n<7273>7027\n<7274>1940\n<7276>7472\n<7277>7471\n<7278>7470\n<7279>2340\n<727d>2840\n<727e>8064\n<727f>8067\n<7280>3282\n<7281>2841\n<7282>17027\n<7284>3281\n<7285>8706\n<7286>8705\n<7287>15050\n<728b>8707\n<728c>9359\n<728d>9358\n<728e>9362\n<728f>17353\n<7290>9361\n<7291>9360\n<7292>4136\n<7293>10022\n<7294>15051\n<7295>10021\n<7296>4137\n<7297>10020\n<7298>10598\n<729a>10599\n<729b>4515\n<729f>18234\n<72a1>12479\n<72a2>5524\n<72a3>12478\n<72a4>12477\n<72a7>5756\n<72a8>12790\n<72a9>13199\n<72aa>13522\n<72ac>749\n<72ad>17652\n<72ae>6063\n<72af>853\n<72b0>6064\n<72b2>16310\n<72ba>6347\n<72bd>6343\n<72bf>6342\n<72c0>1611\n<72c1>6346\n<72c2>1262\n<72c3>6344\n<72c4>1261\n<72c5>6348\n<72c6>6345\n<72c9>6654\n<72ca>7029\n<72cb>6652\n<72cc>6659\n<72cd>17354\n<72ce>1612\n<72d0>1615\n<72d1>6660\n<72d2>6656\n<72d4>6657\n<72d6>6651\n<72d7>1614\n<72d8>6653\n<72d9>1613\n<72da>6658\n<72dc>6655\n<72df>7033\n<72e2>16279\n<72e3>7036\n<72e4>7030\n<72e6>7035\n<72e8>7031\n<72e9>1941\n<72ea>7034\n<72eb>7032\n<72f3>7478\n<72f4>7475\n<72f6>7477\n<72f7>2345\n<72f8>2344\n<72f9>2342\n<72fa>7474\n<72fb>7479\n<72fc>2341\n<72fd>2343\n<72fe>7476\n<72ff>8075\n<7300>7473\n<7301>7480\n<7302>16282\n<7304>16053\n<7307>8070\n<7308>8074\n<730a>8073\n<730b>8709\n<730c>8720\n<730f>8076\n<7310>18154\n<7311>8071\n<7312>8708\n<7313>2845\n<7316>2844\n<7317>8069\n<7318>8072\n<7319>2846\n<731b>2843\n<731c>2842\n<731d>8068\n<731e>8077\n<7322>8711\n<7323>8718\n<7325>3284\n<7326>8717\n<7327>8714\n<7328>17034\n<7329>3286\n<732a>15728\n<732b>17029\n<732c>16306\n<732d>8716\n<732e>17035\n<7330>8710\n<7331>8712\n<7332>8715\n<7333>8713\n<7334>3285\n<7335>8719\n<7336>3283\n<7337>3703\n<7338>18155\n<7339>17356\n<733a>9366\n<733b>9365\n<733c>9363\n<733e>3706\n<733f>3705\n<7340>9367\n<7341>18156\n<7342>9364\n<7343>10023\n<7344>4138\n<7345>3704\n<7348>17402\n<7349>9369\n<734a>9368\n<734c>10026\n<734d>10024\n<734e>4516\n<734f>16209\n<7350>4139\n<7351>10025\n<7352>10601\n<7357>4517\n<7358>10600\n<7359>10609\n<735a>10608\n<735b>10606\n<735d>10605\n<7361>10607\n<7362>10610\n<7365>11208\n<7368>4857\n<7369>11204\n<736a>11210\n<736b>11209\n<736c>11207\n<7370>5134\n<7371>16280\n<7372>5135\n<7373>11682\n<7374>16084\n<7375>5363\n<7376>12117\n<7377>5362\n<7378>5525\n<737a>5526\n<737b>5664\n<737c>12792\n<737d>12791\n<737e>13026\n<737f>13200\n<7380>5834\n<7381>13350\n<7382>13349\n<7383>13351\n<7384>854\n<7385>7037\n<7386>2346\n<7387>2847\n<7388>8078\n<7389>855\n<738a>6065\n<738b>750\n<738e>6158\n<738f>18149\n<7392>6353\n<7395>6349\n<7396>1263\n<7397>6350\n<7398>14838\n<739c>16522\n<739d>6668\n<739e>14683\n<739f>1618\n<73a0>6666\n<73a1>6662\n<73a2>6665\n<73a4>6661\n<73a5>1620\n<73a6>6664\n<73a7>16519\n<73a8>1617\n<73a9>1616\n<73aa>17037\n<73ab>1619\n<73ac>6667\n<73ad>6663\n<73b2>1947\n<73b3>1950\n<73b4>7045\n<73b5>7044\n<73b6>7043\n<73b7>1944\n<73b8>7052\n<73b9>7042\n<73bb>1946\n<73bc>7485\n<73be>7049\n<73bf>7047\n<73c0>1949\n<73c2>7039\n<73c3>7050\n<73c5>7041\n<73c6>7051\n<73c7>7048\n<73c8>7040\n<73c9>17040\n<73ca>1945\n<73cb>7053\n<73cc>7038\n<73cd>1948\n<73ce>16667\n<73cf>17036\n<73d0>15127\n<73d2>7490\n<73d3>7481\n<73d4>7492\n<73d5>16499\n<73d6>7484\n<73d9>7482\n<73da>7494\n<73db>7491\n<73dc>7489\n<73dd>7493\n<73de>2352\n<73e0>2350\n<73e1>18160\n<73e2>15523\n<73e3>7487\n<73e4>17061\n<73e5>7483\n<73e6>15546\n<73e7>7486\n<73e8>7497\n<73e9>7488\n<73ea>2351\n<73eb>7046\n<73ed>2347\n<73ee>2349\n<73ef>16401\n<73f3>15531\n<73f4>8092\n<73f5>8081\n<73f6>8079\n<73f7>17050\n<73f8>8080\n<73f9>15353\n<73fa>8087\n<73fb>15532\n<73fc>8088\n<73fd>8084\n<73fe>2852\n<73ff>8089\n<7400>8086\n<7401>8083\n<7403>2850\n<7404>8082\n<7405>2848\n<7406>2851\n<7407>8085\n<7408>8093\n<7409>2348\n<740a>2849\n<740b>8091\n<740c>8090\n<740d>2853\n<7411>17772\n<7412>15334\n<7414>14836\n<7415>17051\n<7416>8725\n<7417>16557\n<7419>18163\n<741a>8726\n<741b>3296\n<741c>14557\n<741d>8732\n<7420>8734\n<7421>8727\n<7422>3290\n<7423>8731\n<7424>8730\n<7425>3291\n<7426>3297\n<7428>3298\n<7429>8733\n<742a>3288\n<742b>8724\n<742c>8722\n<742d>8728\n<742e>8721\n<742f>3295\n<7430>8723\n<7431>8729\n<7432>8735\n<7433>3289\n<7434>3294\n<7437>15073\n<7438>15113\n<7439>17054\n<743a>3287\n<743c>15071\n<743f>3713\n<7440>9376\n<7441>3712\n<7442>9380\n<7443>14874\n<7444>9370\n<7445>15319\n<7446>9381\n<7447>17060\n<7448>15541\n<7449>17041\n<744d>9382\n<744e>9379\n<7451>9374\n<7452>9373\n<7453>16945\n<7454>9383\n<7455>3709\n<7456>14837\n<7457>9375\n<7459>3714\n<745a>3708\n<745d>17094\n<745e>3711\n<745f>3710\n<7460>17058\n<7462>10027\n<7463>4141\n<7464>4140\n<7465>16641\n<7467>10032\n<7468>15086\n<7469>4518\n<746a>4142\n<746b>15335\n<746c>17064\n<746d>4144\n<746e>10033\n<746f>3707\n<7470>4143\n<7471>10029\n<7472>10031\n<7473>10028\n<7474>17065\n<7475>10030\n<7476>17062\n<7479>10620\n<747a>15057\n<747c>10619\n<747d>10616\n<747e>4521\n<747f>11211\n<7480>4522\n<7481>10615\n<7482>17068\n<7483>4520\n<7485>10617\n<7486>10614\n<7487>10611\n<7488>10618\n<748b>4519\n<748c>14881\n<748d>18077\n<7490>11688\n<7492>11215\n<7494>11214\n<7495>11216\n<7497>11685\n<7498>4860\n<7499>14835\n<749a>11212\n<749b>15114\n<749c>4858\n<749e>4862\n<749f>4861\n<74a0>11213\n<74a1>11217\n<74a3>4859\n<74a4>16752\n<74a5>11692\n<74a6>5138\n<74a7>5364\n<74a8>5139\n<74a9>5136\n<74aa>11689\n<74ab>11687\n<74ad>11690\n<74af>11693\n<74b0>5137\n<74b1>11691\n<74b2>11686\n<74b4>15525\n<74b5>12120\n<74b6>12123\n<74b7>12482\n<74b8>12118\n<74ba>12793\n<74bb>12124\n<74bd>5527\n<74be>12122\n<74bf>5365\n<74c0>12119\n<74c1>12121\n<74c2>12125\n<74c3>12483\n<74c5>12481\n<74c8>17077\n<74ca>5528\n<74cb>12480\n<74cc>15070\n<74cf>5665\n<74d0>15003\n<74d3>18170\n<74d4>5758\n<74d5>13202\n<74d6>5757\n<74d7>13204\n<74d8>13201\n<74d9>13203\n<74da>5886\n<74db>13453\n<74dc>856\n<74dd>6669\n<74e0>2854\n<74e1>9384\n<74e2>4863\n<74e3>5529\n<74e4>5835\n<74e5>13454\n<74e6>857\n<74e7>16382\n<74e8>6670\n<74e9>288\n<74ec>7054\n<74ee>7055\n<74f0>16358\n<74f1>16283\n<74f2>16351\n<74f8>16372\n<74fb>8736\n<74fd>9387\n<74fe>9386\n<74ff>9385\n<7500>10034\n<7504>4145\n<7505>16350\n<7507>10622\n<7508>10621\n<750b>11218\n<750e>17079\n<750f>11697\n<7513>12127\n<7514>12126\n<7515>5366\n<7516>12484\n<7517>13027\n<7518>858\n<7519>17795\n<751a>1951\n<751c>2857\n<751d>9388\n<751e>17080\n<751f>859\n<7521>7502\n<7522>2858\n<752a>6159\n<752b>1265\n<752c>1264\n<752d>1952\n<752e>7056\n<752f>8737\n<7534>16007\n<7535>17754\n<7539>6355\n<753a>6354\n<753b>15867\n<753d>1621\n<753e>6673\n<7542>17357\n<7546>16192\n<754a>17087\n<754b>1956\n<754c>1954\n<754d>17086\n<754e>1955\n<754f>1953\n<7551>15614\n<7553>16363\n<7554>2353\n<7555>15082\n<7559>2357\n<755a>2356\n<755b>7503\n<755c>2355\n<755d>2354\n<755f>7504\n<7560>15729\n<7562>2861\n<7563>8095\n<7564>8094\n<7567>17088\n<756a>3302\n<756b>3301\n<756c>8739\n<756d>18173\n<756e>17089\n<756f>8738\n<7570>2862\n<7572>18174\n<7576>3717\n<7577>9390\n<7578>3718\n<7579>9389\n<757a>16207\n<757d>10037\n<757e>10623\n<757f>4523\n<7580>11219\n<7583>15077\n<7584>11698\n<7586>5531\n<7587>5530\n<758a>5836\n<758b>866\n<758c>6674\n<758d>18175\n<758e>17093\n<758f>2863\n<7590>10038\n<7591>4146\n<7592>558\n<7598>6675\n<759d>1622\n<759e>17095\n<75a7>7059\n<75aa>7060\n<75ab>1957\n<75b0>7505\n<75b1>16045\n<75b4>17096\n<75b5>2866\n<75b6>7511\n<75b8>2367\n<75b9>2365\n<75ba>7512\n<75bb>7507\n<75bc>2364\n<75bd>2363\n<75be>2358\n<75bf>7510\n<75c0>7509\n<75c1>7506\n<75c2>2366\n<75c3>16275\n<75c4>7508\n<75c5>2359\n<75c7>2360\n<75c8>18177\n<75ca>2867\n<75cd>2868\n<75ce>8096\n<75cf>8098\n<75d0>8102\n<75d1>8101\n<75d2>8097\n<75d7>8747\n<75d8>3307\n<75d9>3306\n<75da>8741\n<75db>3304\n<75dc>17358\n<75dd>8744\n<75de>3308\n<75df>8745\n<75e0>3309\n<75e1>8742\n<75e2>3303\n<75e3>3305\n<75e4>8746\n<75e6>8743\n<75e7>8740\n<75ed>9403\n<75ef>9392\n<75f0>3720\n<75f1>3723\n<75f2>3722\n<75f3>3727\n<75f4>3726\n<75f5>9404\n<75f6>9402\n<75f7>9395\n<75f8>9399\n<75f9>9398\n<75fa>3724\n<75fb>9401\n<75fc>9397\n<75fd>9405\n<75fe>9396\n<75ff>3725\n<7600>3719\n<7601>3721\n<7602>17097\n<7603>9394\n<7607>16271\n<7608>10040\n<7609>4150\n<760a>10044\n<760b>4149\n<760c>10041\n<760d>4148\n<760f>9393\n<7610>9400\n<7611>10043\n<7613>4151\n<7614>10045\n<7615>10042\n<7616>10039\n<7619>10626\n<761a>10630\n<761b>10632\n<761c>10628\n<761d>10627\n<761e>10625\n<761f>4526\n<7620>4524\n<7623>10629\n<7624>4527\n<7625>10624\n<7626>4528\n<7627>4147\n<7628>10631\n<7629>4525\n<762c>17098\n<762d>11221\n<762f>11220\n<7630>11228\n<7631>11222\n<7632>11227\n<7633>11224\n<7634>4866\n<7635>11226\n<7638>4867\n<763a>4868\n<763b>15984\n<763c>11225\n<763d>11223\n<7640>16102\n<7642>5141\n<7643>11699\n<7646>5140\n<7647>11702\n<764c>5142\n<764d>18178\n<764e>15986\n<764f>17100\n<7650>12131\n<7651>17099\n<7652>5369\n<7653>12132\n<7654>16112\n<7656>5367\n<7657>12133\n<7658>5368\n<7659>12130\n<765a>12134\n<765c>12128\n<765f>5532\n<7660>12485\n<7661>5533\n<7662>5666\n<7664>12129\n<7665>5667\n<7666>16042\n<7667>16297\n<7669>5759\n<766a>13028\n<766c>5838\n<766d>13205\n<766e>5837\n<766f>17101\n<7670>13352\n<7673>15083\n<7674>18179\n<7675>13635\n<7676>559\n<7678>1962\n<7679>7061\n<767a>18181\n<767d>867\n<767e>1013\n<767f>6160\n<7680>17363\n<7681>6358\n<7682>1268\n<7684>1625\n<7689>8104\n<768a>7513\n<768b>2368\n<768c>17364\n<768e>2869\n<768f>8103\n<7690>17104\n<7692>8749\n<7693>3313\n<7695>8748\n<7696>3312\n<7699>9406\n<769a>4531\n<769b>10636\n<76a1>17109\n<76a4>11703\n<76a5>17110\n<76a6>12135\n<76aa>12795\n<76ab>12794\n<76ad>13206\n<76ae>868\n<76af>6676\n<76b0>2369\n<76b4>3314\n<76b5>9407\n<76b7>17111\n<76b8>10046\n<76ba>4532\n<76bb>11229\n<76bd>12136\n<76be>12796\n<76bf>869\n<76c2>1626\n<76c3>1968\n<76c4>7062\n<76c5>1969\n<76c6>1967\n<76c8>1966\n<76c9>7514\n<76ca>2370\n<76cc>17112\n<76d2>2871\n<76d3>8105\n<76d4>2870\n<76d6>16213\n<76da>8750\n<76db>2872\n<76dc>3315\n<76dd>9408\n<76e1>4152\n<76e3>4153\n<76e4>4533\n<76e5>4870\n<76e6>11230\n<76e7>4869\n<76e9>11704\n<76ea>5143\n<76ec>12137\n<76ed>12797\n<76ee>870\n<76ef>1269\n<76f0>6679\n<76f1>6678\n<76f2>1627\n<76f3>6677\n<76f4>1628\n<76f5>6680\n<76f7>7068\n<76f8>1972\n<76f9>1971\n<76fa>7070\n<76fb>7069\n<76fc>1976\n<76fe>1975\n<7701>1970\n<7707>1977\n<7708>7063\n<7709>1973\n<770a>7067\n<770b>1974\n<770c>15714\n<7710>7517\n<7711>7521\n<7712>7519\n<7713>7518\n<7715>7522\n<771b>7516\n<771d>7515\n<771e>17118\n<7722>7525\n<7723>7520\n<7724>16360\n<7725>8114\n<7726>17119\n<7727>7526\n<7728>2376\n<7729>2373\n<772b>16371\n<772d>8108\n<772f>8107\n<7733>8112\n<7734>8111\n<7735>8116\n<7736>2876\n<7737>2873\n<7738>2877\n<7739>8106\n<773a>2878\n<773b>8115\n<773c>2875\n<773d>8113\n<773e>2874\n<7740>17120\n<7743>18186\n<7744>8753\n<7745>8755\n<774a>8756\n<774d>8754\n<774e>8757\n<774f>3316\n<7752>9412\n<7754>9417\n<7755>9409\n<7756>9413\n<7758>17123\n<7759>9418\n<775a>9414\n<775b>3730\n<775c>3738\n<775e>3733\n<7761>4157\n<7762>3741\n<7763>3734\n<7765>3739\n<7766>3732\n<7767>9416\n<7768>3740\n<7769>9415\n<776a>3736\n<776b>3731\n<776c>3737\n<776d>9419\n<776e>10051\n<776f>10053\n<7772>14699\n<7777>18089\n<7778>15104\n<7779>3735\n<777a>17175\n<777b>15108\n<777c>10048\n<777d>4155\n<777e>10054\n<777f>4156\n<7780>10052\n<7781>10047\n<7782>10050\n<7783>10055\n<7784>4154\n<7785>10049\n<7787>4535\n<7788>10640\n<7789>10639\n<778b>4538\n<778c>4536\n<778d>10637\n<778e>4534\n<778f>10638\n<7791>4537\n<7793>14381\n<7795>11238\n<7797>11240\n<7798>18190\n<7799>11239\n<779a>11231\n<779b>11235\n<779c>11234\n<779d>11232\n<77a0>4871\n<77a1>11233\n<77a5>4874\n<77a7>5148\n<77a8>11712\n<77aa>5145\n<77ab>11706\n<77ac>5147\n<77ad>5149\n<77af>17125\n<77b0>5146\n<77b1>11711\n<77b2>11707\n<77b3>5144\n<77b4>11710\n<77b5>11705\n<77b6>11709\n<77b7>11708\n<77b9>15987\n<77ba>12139\n<77bd>5370\n<77be>18193\n<77bf>5371\n<77c2>12138\n<77c3>15281\n<77c4>12488\n<77c5>16833\n<77c7>5534\n<77cb>18194\n<77cc>12798\n<77cd>12801\n<77d0>13029\n<77d3>5760\n<77d4>13353\n<77d5>13455\n<77d7>5925\n<77da>5971\n<77db>871\n<77dc>1978\n<77de>8760\n<77e0>9420\n<77e2>872\n<77e3>1270\n<77e5>1629\n<77e6>16513\n<77e9>2377\n<77ec>8761\n<77ed>3317\n<77ee>3742\n<77ef>5150\n<77f0>11713\n<77f1>12489\n<77f2>12802\n<77f3>873\n<77f4>17129\n<77f7>6686\n<77f8>6681\n<77f9>6683\n<77fa>6685\n<77fb>6684\n<77fc>6682\n<77fd>1630\n<77fe>16341\n<7802>1979\n<7803>7081\n<7805>7076\n<7806>7073\n<7808>15942\n<7809>7080\n<780e>7079\n<780f>7078\n<7810>7077\n<7813>7082\n<7814>1980\n<7818>18195\n<781c>18196\n<781d>2381\n<781e>15123\n<781f>2387\n<7820>2386\n<7821>7535\n<7822>7529\n<7823>7527\n<7825>2384\n<7826>8123\n<7827>2379\n<7828>7532\n<7829>7536\n<782a>7538\n<782b>7534\n<782c>7528\n<782d>2385\n<782e>7533\n<782f>7531\n<7830>2378\n<7831>7539\n<7832>2388\n<7833>7537\n<7834>2382\n<7835>7530\n<7837>2383\n<7838>2380\n<7839>17366\n<783c>16410\n<783d>15466\n<7842>15044\n<7843>2880\n<7844>15403\n<7845>8124\n<7847>18197\n<7848>8117\n<7849>8119\n<784a>8121\n<784b>15469\n<784c>8122\n<784d>8120\n<784e>2881\n<7850>8125\n<7851>18198\n<7852>8118\n<7853>16277\n<7854>15467\n<785c>8765\n<785d>3318\n<785e>8773\n<7860>8762\n<7862>8774\n<7866>18199\n<7868>8772\n<7869>8771\n<786a>8768\n<786b>2879\n<786c>3319\n<786d>8766\n<786e>8769\n<786f>3320\n<7870>8770\n<7871>8767\n<7879>9431\n<787a>16105\n<787b>9435\n<787c>3749\n<787e>10061\n<787f>3752\n<7880>9433\n<7881>14056\n<7883>9430\n<7884>9425\n<7887>9421\n<7888>15125\n<7889>3748\n<788c>3747\n<788d>15124\n<788e>3743\n<788f>9424\n<7891>3750\n<7893>3751\n<7894>9423\n<7895>9426\n<7896>9434\n<7899>9432\n<789a>9422\n<789e>10063\n<789f>4159\n<78a0>10065\n<78a1>9429\n<78a2>10067\n<78a3>4163\n<78a4>10068\n<78a5>10064\n<78a7>4160\n<78a8>10060\n<78a9>4162\n<78aa>10057\n<78ab>10062\n<78ac>10066\n<78ad>10059\n<78af>17132\n<78b0>3744\n<78b1>17140\n<78b2>10056\n<78b3>4161\n<78b4>10058\n<78b6>15468\n<78b8>17777\n<78b9>15459\n<78ba>4541\n<78bb>10642\n<78bc>4545\n<78be>4543\n<78c1>4158\n<78c5>4540\n<78c7>17133\n<78c8>10648\n<78c9>10651\n<78ca>4542\n<78cb>4539\n<78cc>10644\n<78cd>10641\n<78ce>10646\n<78cf>10643\n<78d0>4546\n<78d1>10645\n<78d2>15126\n<78d3>17134\n<78d4>10647\n<78d5>4544\n<78d7>17138\n<78d8>16268\n<78da>4876\n<78db>11247\n<78dd>11241\n<78de>11245\n<78e3>11246\n<78e5>11243\n<78e7>4878\n<78e8>4875\n<78e9>11242\n<78ea>11244\n<78ec>4877\n<78ed>11250\n<78ee>14977\n<78ef>5154\n<78f0>15162\n<78f1>16574\n<78f2>11720\n<78f3>11714\n<78f4>5153\n<78f5>14515\n<78f7>5151\n<78f9>11722\n<78fa>5152\n<78fd>11715\n<78fe>11723\n<78ff>11719\n<7901>5155\n<7902>11716\n<7904>11724\n<7905>11721\n<7906>16335\n<7909>12143\n<790c>12140\n<790e>5374\n<7910>12144\n<7911>12146\n<7912>12145\n<7917>12494\n<7919>5535\n<791b>12491\n<791c>12493\n<791d>12490\n<791e>12495\n<7921>12492\n<7923>12804\n<7924>12807\n<7925>12803\n<7926>5668\n<7929>12808\n<792a>5669\n<792b>5671\n<792c>5670\n<792d>13030\n<792e>17136\n<792f>13032\n<7931>13031\n<7932>18203\n<7933>18202\n<7934>17139\n<7935>13207\n<7936>14211\n<7938>13456\n<7939>13525\n<793a>874\n<793b>17655\n<793c>17152\n<793d>6359\n<793e>1631\n<793f>6688\n<7942>6687\n<7944>7087\n<7945>7086\n<7946>1983\n<7947>1986\n<7948>1985\n<7949>1984\n<794a>7083\n<794b>7085\n<794c>7084\n<794f>7542\n<7950>2390\n<7951>7546\n<7952>7545\n<7953>7544\n<7954>7540\n<7955>2389\n<7956>2393\n<7957>2396\n<7958>14309\n<7959>15128\n<795a>2397\n<795b>7541\n<795c>7543\n<795d>2395\n<795e>2394\n<795f>2392\n<7960>2391\n<7961>8132\n<7962>15997\n<7963>8130\n<7964>8126\n<7965>2882\n<7967>8127\n<7968>2883\n<796b>8131\n<796d>2884\n<7970>8778\n<7971>16744\n<7972>8777\n<7973>8776\n<7974>8775\n<7979>9439\n<797a>3753\n<797c>9436\n<797d>9438\n<797e>15910\n<797f>3754\n<7980>17148\n<7981>3755\n<7982>9437\n<7983>15862\n<7986>17145\n<7987>17800\n<7988>10077\n<798d>4166\n<7990>10079\n<7991>18205\n<7992>10078\n<7993>10075\n<7994>10074\n<7995>10073\n<7996>10072\n<7997>10076\n<7998>10069\n<7999>17404\n<799a>10652\n<799b>10657\n<799c>10655\n<799d>17150\n<799f>14686\n<79a0>10654\n<79a1>10653\n<79a2>10656\n<79a4>11253\n<79a5>15134\n<79a6>4879\n<79a7>5156\n<79a8>11726\n<79a9>17153\n<79aa>5157\n<79ab>11725\n<79ac>12148\n<79ad>12147\n<79ae>5375\n<79b0>12496\n<79b1>5536\n<79b2>12809\n<79b3>5839\n<79b4>13208\n<79b6>13458\n<79b7>13457\n<79b8>6066\n<79bb>8133\n<79bd>3757\n<79be>875\n<79bf>1273\n<79c0>1272\n<79c1>1271\n<79c4>15565\n<79c5>6689\n<79c6>17157\n<79c8>1635\n<79c9>1634\n<79cb>1991\n<79cc>16947\n<79cd>7089\n<79ce>7092\n<79cf>7090\n<79d4>17159\n<79d5>7088\n<79d6>7091\n<79d8>2404\n<79dc>7553\n<79dd>7555\n<79de>7554\n<79df>2401\n<79e0>7549\n<79e2>15450\n<79e3>2399\n<79e4>2398\n<79e6>2402\n<79e7>2400\n<79e9>2403\n<79ea>7552\n<79ed>7551\n<79ee>7550\n<79f1>15143\n<79f4>15138\n<79f8>8135\n<79fa>8134\n<79fb>2885\n<7a00>3325\n<7a02>8779\n<7a03>8781\n<7a04>8783\n<7a05>3324\n<7a06>18206\n<7a08>3322\n<7a0a>8780\n<7a0b>3323\n<7a0c>8782\n<7a0d>3321\n<7a10>9449\n<7a11>9440\n<7a12>9443\n<7a13>9447\n<7a14>3761\n<7a15>9445\n<7a17>9444\n<7a1a>3759\n<7a1b>9448\n<7a1c>3758\n<7a1e>3763\n<7a1f>3762\n<7a20>3760\n<7a22>9446\n<7a26>10085\n<7a28>10084\n<7a2b>10080\n<7a2d>16346\n<7a2e>4167\n<7a2f>10083\n<7a30>10082\n<7a31>4168\n<7a37>4551\n<7a39>10659\n<7a3a>15137\n<7a3b>4552\n<7a3c>4548\n<7a3d>4550\n<7a3e>16267\n<7a3f>4547\n<7a40>4549\n<7a43>14700\n<7a44>11254\n<7a45>15857\n<7a46>4882\n<7a47>11256\n<7a48>11255\n<7a49>14131\n<7a4a>10081\n<7a4b>4884\n<7a4c>4883\n<7a54>11731\n<7a56>11729\n<7a57>5158\n<7a58>11730\n<7a5a>11732\n<7a5b>11728\n<7a5c>11727\n<7a5f>12149\n<7a60>5378\n<7a65>14134\n<7a69>5538\n<7a6b>5537\n<7a6e>12810\n<7a74>876\n<7a75>6161\n<7a76>1274\n<7a78>6690\n<7a79>1637\n<7a7a>1636\n<7a7b>6691\n<7a7d>14135\n<7a7e>7094\n<7a7f>1992\n<7a80>7093\n<7a81>1993\n<7a83>15741\n<7a84>2405\n<7a85>7558\n<7a86>7556\n<7a87>7562\n<7a88>2406\n<7a89>7557\n<7a8a>7561\n<7a8f>8138\n<7a90>8140\n<7a91>17368\n<7a92>2886\n<7a94>8139\n<7a95>2887\n<7a96>3328\n<7a97>3327\n<7a98>3326\n<7a99>8784\n<7a9e>9452\n<7aa2>9451\n<7aa3>9450\n<7aa8>10086\n<7aa9>4170\n<7aaa>4169\n<7aae>4554\n<7aaf>4553\n<7ab0>14138\n<7ab1>11260\n<7ab2>10660\n<7ab3>10662\n<7ab4>10661\n<7ab5>11259\n<7ab6>11257\n<7ab7>11261\n<7ab8>11258\n<7aba>4885\n<7abb>14137\n<7abc>18209\n<7abe>11733\n<7abf>5159\n<7ac7>5672\n<7ac8>15743\n<7ac9>17776\n<7aca>5887\n<7acb>877\n<7acf>18212\n<7ad1>7095\n<7ad3>16266\n<7ad8>7563\n<7ad9>2407\n<7ada>14144\n<7adb>18213\n<7adc>14673\n<7add>14145\n<7adf>3038\n<7ae0>3037\n<7ae2>15155\n<7ae3>3330\n<7ae4>8786\n<7ae5>3329\n<7ae6>8785\n<7ae7>14429\n<7ae9>14385\n<7aea>14146\n<7aeb>9453\n<7aed>4171\n<7aee>10089\n<7aef>4172\n<7af6>5673\n<7af7>12813\n<7af9>1014\n<7afa>1638\n<7afb>6692\n<7afd>1995\n<7afe>15165\n<7aff>1994\n<7b04>7565\n<7b05>7567\n<7b06>2408\n<7b08>7569\n<7b09>7572\n<7b0a>7570\n<7b0b>14150\n<7b0c>15203\n<7b0e>7571\n<7b0f>7568\n<7b10>7564\n<7b11>2409\n<7b12>7573\n<7b13>7566\n<7b14>16247\n<7b18>8149\n<7b19>2893\n<7b1a>8158\n<7b1b>2890\n<7b1d>8151\n<7b1e>2894\n<7b1f>16145\n<7b20>2888\n<7b22>8146\n<7b23>8159\n<7b24>8147\n<7b25>8144\n<7b26>2892\n<7b27>15199\n<7b28>2889\n<7b29>14152\n<7b2a>8150\n<7b2b>8153\n<7b2c>2891\n<7b2d>8154\n<7b2e>2895\n<7b2f>8155\n<7b30>8145\n<7b31>8152\n<7b32>8156\n<7b33>8148\n<7b34>8143\n<7b35>8141\n<7b38>8157\n<7b39>15726\n<7b3b>8142\n<7b40>8793\n<7b42>15853\n<7b43>15909\n<7b44>8789\n<7b45>8795\n<7b46>3333\n<7b47>8788\n<7b48>8790\n<7b49>3331\n<7b4a>8787\n<7b4b>3338\n<7b4c>8791\n<7b4d>3337\n<7b4e>8792\n<7b4f>3339\n<7b50>3334\n<7b51>3340\n<7b52>3335\n<7b54>3336\n<7b55>14151\n<7b56>3332\n<7b58>8794\n<7b60>3768\n<7b61>9464\n<7b62>18215\n<7b63>9467\n<7b64>9455\n<7b65>9460\n<7b66>9454\n<7b67>3770\n<7b69>9458\n<7b6c>18216\n<7b6d>9456\n<7b6e>3769\n<7b6f>14156\n<7b70>9463\n<7b71>9462\n<7b72>9459\n<7b73>9461\n<7b74>9457\n<7b75>4176\n<7b76>9466\n<7b77>3766\n<7b78>9465\n<7b7b>18217\n<7b82>10105\n<7b84>4183\n<7b85>10100\n<7b87>4182\n<7b88>10090\n<7b8a>10092\n<7b8b>4175\n<7b8c>10097\n<7b8d>10096\n<7b8e>10099\n<7b8f>4180\n<7b90>10094\n<7b91>10093\n<7b92>14162\n<7b94>4179\n<7b95>4174\n<7b96>10095\n<7b97>4177\n<7b98>10101\n<7b99>10103\n<7b9b>10098\n<7b9c>10091\n<7b9d>4178\n<7ba0>4562\n<7ba1>4173\n<7ba2>14155\n<7ba3>16148\n<7ba4>10104\n<7bac>10666\n<7bad>4555\n<7baf>10668\n<7bb1>4556\n<7bb2>17948\n<7bb4>4558\n<7bb5>10671\n<7bb7>10663\n<7bb8>4181\n<7bb9>10669\n<7bbe>10665\n<7bc0>3767\n<7bc1>4561\n<7bc4>4557\n<7bc9>4888\n<7bca>10670\n<7bcb>10664\n<7bcc>4563\n<7bce>10667\n<7bcf>16152\n<7bd0>14160\n<7bd4>11271\n<7bd5>11266\n<7bd8>11276\n<7bd9>4886\n<7bda>11268\n<7bdb>4890\n<7bdc>11274\n<7bdd>11265\n<7bde>11262\n<7bdf>11277\n<7be0>5165\n<7be1>4891\n<7be2>11273\n<7be3>11263\n<7be4>4889\n<7be5>11267\n<7be6>4893\n<7be7>11264\n<7be8>11269\n<7be9>4892\n<7bea>11272\n<7beb>11275\n<7bf2>11738\n<7bf3>11745\n<7bf4>11743\n<7bf7>5163\n<7bf8>11750\n<7bf9>11270\n<7bfa>14167\n<7bfb>11741\n<7bfc>16159\n<7bfd>11751\n<7bfe>5162\n<7bff>11740\n<7c00>11739\n<7c01>11749\n<7c02>11746\n<7c03>11748\n<7c05>11736\n<7c06>11752\n<7c07>5160\n<7c09>11747\n<7c0a>11756\n<7c0b>11744\n<7c0c>5164\n<7c0d>5161\n<7c0e>11742\n<7c0f>11737\n<7c10>11755\n<7c11>4887\n<7c12>18218\n<7c15>16481\n<7c19>12152\n<7c1b>17369\n<7c1c>12150\n<7c1d>12156\n<7c1e>5384\n<7c1f>12154\n<7c20>12153\n<7c21>5386\n<7c22>12159\n<7c23>5385\n<7c25>12160\n<7c26>12157\n<7c27>5382\n<7c28>12158\n<7c29>12151\n<7c2a>5383\n<7c2b>5381\n<7c2c>12502\n<7c2d>12155\n<7c30>12161\n<7c33>12499\n<7c35>14169\n<7c37>5543\n<7c38>5541\n<7c39>12501\n<7c3b>12503\n<7c3c>12500\n<7c3d>5542\n<7c40>5544\n<7c42>16156\n<7c43>5675\n<7c44>14171\n<7c45>12818\n<7c47>12817\n<7c48>12815\n<7c49>12814\n<7c4a>12816\n<7c4c>5674\n<7c4d>5676\n<7c50>5761\n<7c51>16312\n<7c53>13034\n<7c54>13033\n<7c56>16127\n<7c57>13211\n<7c59>13213\n<7c5a>13215\n<7c5b>13214\n<7c5c>13212\n<7c5d>15167\n<7c5f>5841\n<7c60>5840\n<7c63>5889\n<7c64>5888\n<7c65>5890\n<7c66>13355\n<7c67>13354\n<7c69>13526\n<7c6a>13459\n<7c6b>13527\n<7c6c>5957\n<7c6d>15168\n<7c6e>5958\n<7c6f>13575\n<7c70>16210\n<7c72>5995\n<7c73>1015\n<7c74>18076\n<7c75>6693\n<7c7a>7098\n<7c7b>18221\n<7c7c>15177\n<7c7d>1996\n<7c7e>16154\n<7c83>14172\n<7c84>7574\n<7c85>7580\n<7c86>16157\n<7c88>7578\n<7c89>2410\n<7c8a>7576\n<7c8c>7577\n<7c8d>7579\n<7c8e>15176\n<7c91>7575\n<7c92>2896\n<7c94>8160\n<7c95>2898\n<7c96>8162\n<7c97>2897\n<7c98>8161\n<7c9c>18222\n<7c9e>8797\n<7c9f>3341\n<7ca1>8799\n<7ca2>8796\n<7ca3>8163\n<7ca5>3342\n<7ca6>14174\n<7ca7>14061\n<7ca8>8798\n<7cac>14469\n<7cae>15178\n<7caf>9470\n<7cb1>3771\n<7cb2>9468\n<7cb3>3772\n<7cb4>9469\n<7cb5>3773\n<7cb8>18224\n<7cb9>4184\n<7cba>10109\n<7cbb>10106\n<7cbc>10108\n<7cbf>10107\n<7cc2>16343\n<7cc5>10672\n<7cc7>14177\n<7cc8>10673\n<7cc9>14176\n<7cca>4564\n<7ccb>10675\n<7ccc>10674\n<7ccd>15173\n<7cce>289\n<7cd2>11278\n<7cd3>15708\n<7cd4>11279\n<7cd7>11280\n<7cd9>5171\n<7cda>16345\n<7cdc>5167\n<7cdd>5172\n<7cde>5168\n<7cdf>5170\n<7ce0>5166\n<7ce2>5169\n<7ce6>14178\n<7ce7>5387\n<7ce8>11757\n<7cea>12505\n<7cec>12504\n<7ced>17370\n<7cee>12819\n<7cf1>13217\n<7cf2>13035\n<7cf3>14180\n<7cf4>13216\n<7cf5>14181\n<7cf6>13528\n<7cf7>13597\n<7cf8>1016\n<7cf9>17656\n<7cfb>1275\n<7cfc>17773\n<7cfd>6694\n<7cfe>1639\n<7d00>1999\n<7d01>7106\n<7d02>1997\n<7d03>7104\n<7d04>2002\n<7d05>1998\n<7d06>2003\n<7d07>2001\n<7d08>7105\n<7d09>2000\n<7d0a>2414\n<7d0b>2413\n<7d0c>7591\n<7d0d>2422\n<7d0e>7584\n<7d0f>7590\n<7d10>2418\n<7d11>7583\n<7d12>7589\n<7d13>7587\n<7d14>2417\n<7d15>2419\n<7d16>7586\n<7d17>2412\n<7d18>7585\n<7d19>2423\n<7d1a>2420\n<7d1b>2424\n<7d1c>2421\n<7d1d>7582\n<7d1e>7581\n<7d1f>7588\n<7d20>2415\n<7d21>2411\n<7d22>2416\n<7d25>16094\n<7d28>8178\n<7d29>8171\n<7d2b>3347\n<7d2c>8170\n<7d2e>2902\n<7d2f>2909\n<7d30>2906\n<7d31>2912\n<7d32>2911\n<7d33>2907\n<7d35>8164\n<7d36>8167\n<7d38>8166\n<7d39>2903\n<7d3a>8168\n<7d3b>8177\n<7d3c>2904\n<7d3d>8165\n<7d40>2905\n<7d41>8172\n<7d42>2910\n<7d43>2900\n<7d44>2908\n<7d45>8169\n<7d46>2899\n<7d47>8173\n<7d4a>8176\n<7d4d>16349\n<7d4e>8816\n<7d4f>8807\n<7d50>3344\n<7d51>8814\n<7d52>8811\n<7d53>8803\n<7d54>8812\n<7d55>3346\n<7d56>8804\n<7d58>8800\n<7d5a>16019\n<7d5b>3779\n<7d5c>8809\n<7d5d>14185\n<7d5e>3343\n<7d5f>8815\n<7d61>3350\n<7d62>3352\n<7d63>8802\n<7d66>3351\n<7d67>8805\n<7d68>3345\n<7d69>8813\n<7d6a>8806\n<7d6b>8810\n<7d6d>8808\n<7d6e>3348\n<7d6f>8801\n<7d70>3353\n<7d71>2901\n<7d72>3349\n<7d73>3354\n<7d79>3775\n<7d7a>9477\n<7d7b>9479\n<7d7c>9481\n<7d7d>9485\n<7d7f>9475\n<7d80>9473\n<7d81>3777\n<7d83>9480\n<7d84>9484\n<7d85>9476\n<7d86>9472\n<7d88>9471\n<7d89>14187\n<7d8c>9482\n<7d8d>9474\n<7d8e>9478\n<7d8f>3778\n<7d91>3776\n<7d92>9486\n<7d93>3774\n<7d94>9483\n<7d96>10126\n<7d97>15187\n<7d9c>4189\n<7d9d>10118\n<7d9e>4577\n<7d9f>10128\n<7da0>4192\n<7da1>10132\n<7da2>4198\n<7da3>10113\n<7da4>18135\n<7da6>10129\n<7da7>10110\n<7da8>15516\n<7da9>10131\n<7daa>10114\n<7dab>14188\n<7dac>4205\n<7dad>4202\n<7dae>10130\n<7daf>10124\n<7db0>4188\n<7db1>4196\n<7db2>4195\n<7db3>14190\n<7db4>4194\n<7db5>4200\n<7db7>10111\n<7db8>4201\n<7db9>10125\n<7dba>4197\n<7dbb>4187\n<7dbc>10127\n<7dbf>4199\n<7dc0>10116\n<7dc1>10115\n<7dc2>10112\n<7dc4>10120\n<7dc5>10117\n<7dc6>10121\n<7dc7>4204\n<7dc9>10133\n<7dca>4193\n<7dcd>17774\n<7dce>10119\n<7dcf>18229\n<7dd0>18231\n<7dd2>4203\n<7dd3>15182\n<7dd4>18230\n<7dd6>14191\n<7dd7>10680\n<7dd8>4569\n<7dd9>4578\n<7dda>4574\n<7ddb>10677\n<7ddc>15180\n<7ddd>4571\n<7dde>4575\n<7ddf>10689\n<7de0>4565\n<7de1>10681\n<7de3>4573\n<7de4>14194\n<7de5>14198\n<7de6>10684\n<7de7>10679\n<7de8>4572\n<7de9>4576\n<7dea>10678\n<7dec>4570\n<7dee>10688\n<7def>4567\n<7df0>10687\n<7df1>10686\n<7df2>4579\n<7df3>10440\n<7df4>4566\n<7df5>14196\n<7df6>10685\n<7df7>10676\n<7df9>4580\n<7dfa>10683\n<7dfb>4568\n<7dfd>18232\n<7dfe>15567\n<7e03>10682\n<7e07>15181\n<7e08>4898\n<7e09>4903\n<7e0a>4896\n<7e0b>11295\n<7e0c>11286\n<7e0d>11298\n<7e0e>11290\n<7e0f>11296\n<7e10>4904\n<7e11>4897\n<7e12>11283\n<7e13>11289\n<7e14>11299\n<7e15>11292\n<7e16>11297\n<7e17>11285\n<7e1a>11293\n<7e1b>4899\n<7e1c>11291\n<7e1d>4902\n<7e1e>4901\n<7e21>11284\n<7e22>11294\n<7e23>4900\n<7e24>11301\n<7e25>11300\n<7e27>14207\n<7e29>11768\n<7e2a>11764\n<7e2b>5179\n<7e2d>11758\n<7e2e>5173\n<7e2f>5189\n<7e30>11770\n<7e31>5181\n<7e32>5177\n<7e33>11761\n<7e34>5184\n<7e35>5187\n<7e36>11772\n<7e37>5176\n<7e38>11763\n<7e39>5185\n<7e3a>11774\n<7e3b>11771\n<7e3c>11759\n<7e3d>5180\n<7e3e>5174\n<7e3f>5188\n<7e40>11766\n<7e41>5183\n<7e42>11760\n<7e43>5178\n<7e44>11773\n<7e45>5182\n<7e46>5175\n<7e47>11767\n<7e48>5186\n<7e49>11765\n<7e4c>11769\n<7e50>12163\n<7e51>12169\n<7e52>5393\n<7e53>12172\n<7e56>12164\n<7e57>12171\n<7e58>12166\n<7e59>5394\n<7e5a>5391\n<7e5c>12162\n<7e5e>5390\n<7e5f>12168\n<7e60>12170\n<7e61>5392\n<7e62>12167\n<7e63>12165\n<7e65>18130\n<7e67>14182\n<7e68>12515\n<7e6b>5545\n<7e6d>5546\n<7e6e>14203\n<7e6f>12511\n<7e70>12509\n<7e72>12513\n<7e73>5550\n<7e74>12514\n<7e75>12507\n<7e76>12506\n<7e77>12510\n<7e78>12508\n<7e79>5547\n<7e7a>12512\n<7e7b>12820\n<7e7c>5681\n<7e7d>5680\n<7e7e>12821\n<7e7f>15953\n<7e80>12823\n<7e81>12822\n<7e82>5682\n<7e86>13040\n<7e8a>13036\n<7e8b>13039\n<7e8c>5763\n<7e8d>13041\n<7e8e>16073\n<7e8f>5762\n<7e91>13218\n<7e92>18078\n<7e93>5891\n<7e94>5893\n<7e95>13356\n<7e96>5892\n<7e97>13460\n<7e98>13530\n<7e99>13532\n<7e9a>13529\n<7e9b>13531\n<7e9c>5977\n<7e9f>18619\n<7ea4>17755\n<7eac>17756\n<7eba>17757\n<7ec7>17758\n<7ecf>17759\n<7edf>17760\n<7f06>17761\n<7f36>1017\n<7f37>17762\n<7f38>2004\n<7f39>7455\n<7f3a>2425\n<7f3d>2913\n<7f43>11302\n<7f44>5190\n<7f45>11775\n<7f47>14210\n<7f48>5395\n<7f49>15977\n<7f4a>12517\n<7f4b>12516\n<7f4c>5683\n<7f4d>13042\n<7f4e>15183\n<7f4f>13219\n<7f50>5926\n<7f51>6162\n<7f52>17654\n<7f53>17657\n<7f54>1640\n<7f55>1276\n<7f58>7107\n<7f5b>7597\n<7f5c>7592\n<7f5d>7596\n<7f5e>7594\n<7f5f>2426\n<7f60>7595\n<7f61>7593\n<7f63>8179\n<7f6b>9488\n<7f6c>9491\n<7f6d>9487\n<7f6e>3780\n<7f70>4206\n<7f71>16391\n<7f72>3783\n<7f73>10134\n<7f75>4581\n<7f76>10690\n<7f77>4582\n<7f78>16251\n<7f79>4905\n<7f7a>11305\n<7f7d>11778\n<7f7e>11777\n<7f7f>11776\n<7f83>12518\n<7f85>5551\n<7f86>12519\n<7f87>13220\n<7f88>5927\n<7f89>13461\n<7f8a>1018\n<7f8b>1642\n<7f8c>1641\n<7f8d>7109\n<7f8e>2005\n<7f8f>16924\n<7f91>7108\n<7f92>7599\n<7f93>17371\n<7f94>2427\n<7f95>8180\n<7f96>7598\n<7f97>14214\n<7f9a>2915\n<7f9b>8183\n<7f9e>2914\n<7fa2>8821\n<7fa3>14216\n<7fa4>3786\n<7fa5>9493\n<7fa6>9492\n<7fa7>9494\n<7fa8>3785\n<7fa9>3784\n<7fac>10691\n<7fad>10693\n<7fae>17372\n<7faf>4583\n<7fb0>10692\n<7fb1>11306\n<7fb2>4906\n<7fb3>12174\n<7fb4>18233\n<7fb5>12173\n<7fb6>5552\n<7fb7>12520\n<7fb8>5554\n<7fb9>5553\n<7fba>12824\n<7fbb>13043\n<7fbc>5764\n<7fbd>1019\n<7fbe>7110\n<7fbf>2006\n<7fc0>7602\n<7fc1>2429\n<7fc2>7601\n<7fc3>7600\n<7fc5>2428\n<7fc7>8189\n<7fc9>8191\n<7fcc>2916\n<7fcd>8186\n<7fce>2917\n<7fcf>8190\n<7fd2>2918\n<7fd7>8824\n<7fdd>15198\n<7fde>10138\n<7fdf>4209\n<7fe5>10137\n<7fe6>10698\n<7fe7>18153\n<7fe8>10699\n<7fe9>4584\n<7fea>10696\n<7feb>10695\n<7fec>10697\n<7fed>10694\n<7fee>4909\n<7fef>11307\n<7ff2>11780\n<7ff3>5191\n<7ff4>11779\n<7ff5>12031\n<7ff9>5396\n<7ffa>14222\n<7ffb>5397\n<7ffc>5192\n<7fff>12825\n<8000>5684\n<8001>1020\n<8002>17661\n<8003>1021\n<8004>2431\n<8005>1643\n<8006>2430\n<8007>7111\n<8008>14225\n<800b>3358\n<800c>1022\n<800d>2008\n<8010>2007\n<8011>2009\n<8012>1023\n<8014>7114\n<8015>2433\n<8016>7603\n<8017>2435\n<8018>2432\n<8019>2434\n<801b>8194\n<801c>2919\n<801d>14226\n<801e>8193\n<801f>8192\n<8020>18236\n<8021>9497\n<8024>10139\n<8025>18237\n<8026>4585\n<8028>4910\n<8029>11309\n<802a>11308\n<802c>11781\n<802e>18238\n<802f>14228\n<8030>13044\n<8031>18239\n<8033>1024\n<8034>6360\n<8035>6695\n<8036>2010\n<8037>7115\n<8039>7605\n<803d>2436\n<803e>7604\n<803f>2437\n<8043>8196\n<8046>2921\n<8047>8195\n<8048>8197\n<804a>2920\n<8051>8825\n<8052>3359\n<8054>18240\n<8056>3787\n<8058>3788\n<805a>4211\n<805b>16357\n<805c>10141\n<805d>10140\n<805e>4210\n<8061>14233\n<8062>16355\n<8063>16348\n<8064>10700\n<8066>16347\n<8067>10701\n<806c>11310\n<806f>5196\n<8070>5195\n<8073>5197\n<8075>12177\n<8076>5399\n<8077>5398\n<8078>12523\n<8079>12826\n<807d>5843\n<807e>5842\n<807f>1025\n<8080>17662\n<8082>7404\n<8084>3790\n<8085>3360\n<8086>3789\n<8087>4212\n<8089>1026\n<808a>6067\n<808f>6696\n<8090>6363\n<8092>6364\n<8093>1278\n<8095>6361\n<8096>1277\n<8098>1280\n<8099>6362\n<809a>1282\n<809b>1281\n<809c>6365\n<809d>1279\n<809f>17782\n<80a1>1648\n<80a2>1646\n<80a3>6698\n<80a5>1645\n<80a7>14240\n<80a9>1650\n<80aa>1652\n<80ab>1649\n<80ad>6701\n<80ae>6697\n<80af>1653\n<80b1>1647\n<80b2>1283\n<80b4>1651\n<80b5>6700\n<80b6>16046\n<80b7>18243\n<80b8>6699\n<80ba>1644\n<80bc>17778\n<80bd>15995\n<80c2>7121\n<80c5>7123\n<80c6>15220\n<80c7>7117\n<80c8>7120\n<80c9>7129\n<80ca>7127\n<80cc>2016\n<80cd>7133\n<80ce>2019\n<80cf>7130\n<80d0>7122\n<80d1>7119\n<80d4>8829\n<80d5>7128\n<80d6>2011\n<80d7>7131\n<80d8>7116\n<80d9>7125\n<80da>2013\n<80db>2018\n<80dc>7126\n<80dd>2022\n<80de>2020\n<80e0>7118\n<80e1>2017\n<80e3>7124\n<80e4>2021\n<80e5>2012\n<80e6>7132\n<80e9>18244\n<80ec>17897\n<80ed>2442\n<80ef>2451\n<80f0>2440\n<80f1>2438\n<80f2>7607\n<80f3>2446\n<80f4>2443\n<80f5>7609\n<80f6>17780\n<80f8>2445\n<80f9>7608\n<80fa>7606\n<80fb>7611\n<80fc>2450\n<80fd>2448\n<80fe>8828\n<8100>7612\n<8101>7610\n<8102>2439\n<8103>16359\n<8105>2441\n<8106>2444\n<8107>14242\n<8108>2447\n<8109>15221\n<810a>2449\n<810c>18246\n<810e>18247\n<8112>18248\n<8114>18249\n<8115>8207\n<8116>2923\n<8117>15981\n<8118>8198\n<8119>8200\n<811a>14243\n<811b>8201\n<811d>8209\n<811e>8205\n<811f>8203\n<8121>8206\n<8122>8210\n<8123>2924\n<8124>2928\n<8125>8199\n<8127>8208\n<8129>2926\n<812a>14905\n<812b>2925\n<812c>8204\n<812d>8202\n<812f>2922\n<8130>2927\n<8132>15993\n<8134>17900\n<8137>15218\n<8139>3366\n<813a>8837\n<813d>8835\n<813e>3368\n<8142>15222\n<8143>8830\n<8144>9511\n<8146>3367\n<8147>8834\n<8148>15990\n<814a>8831\n<814b>3363\n<814c>3369\n<814d>8836\n<814e>3365\n<814f>8833\n<8150>4213\n<8151>3364\n<8152>8832\n<8153>3370\n<8154>3362\n<8155>3361\n<8156>18252\n<815b>9503\n<815c>9501\n<815e>9507\n<8160>9499\n<8161>9512\n<8162>9504\n<8164>9498\n<8165>3794\n<8166>3800\n<8167>9509\n<8169>9502\n<816b>3797\n<816d>17348\n<816e>3795\n<816f>9510\n<8170>3792\n<8171>3791\n<8172>9505\n<8173>3796\n<8174>3371\n<8176>9508\n<8177>9500\n<8178>3793\n<817c>18256\n<817f>4218\n<8180>4214\n<8182>4219\n<8183>10144\n<8184>17349\n<8186>10143\n<8187>10145\n<8188>4216\n<8189>10142\n<818a>4217\n<818b>10148\n<818c>10147\n<818d>10146\n<818f>4215\n<8193>17350\n<8195>10705\n<8197>10708\n<8198>4591\n<8199>10707\n<819a>4590\n<819e>10704\n<819f>10703\n<81a0>4589\n<81a2>10706\n<81a3>10702\n<81a5>18259\n<81a6>11312\n<81a7>11322\n<81a8>4913\n<81a9>4912\n<81aa>17252\n<81ab>11316\n<81ac>11318\n<81ae>11313\n<81b0>11317\n<81b1>11311\n<81b2>11320\n<81b3>4911\n<81b4>11319\n<81b5>11315\n<81b6>16050\n<81b7>11321\n<81b9>11314\n<81ba>5200\n<81bb>11782\n<81bc>11788\n<81bd>5204\n<81be>5206\n<81bf>5203\n<81c0>5202\n<81c1>18261\n<81c2>5201\n<81c3>5199\n<81c4>11783\n<81c5>11786\n<81c6>5198\n<81c7>11787\n<81c8>16366\n<81c9>5205\n<81ca>11785\n<81cc>11784\n<81cd>5400\n<81cf>5401\n<81d0>12180\n<81d5>12525\n<81d7>12524\n<81d8>5555\n<81d9>12828\n<81da>5685\n<81db>12827\n<81dd>13045\n<81de>13221\n<81df>5844\n<81e2>5894\n<81e3>1029\n<81e4>18262\n<81e5>1654\n<81e6>8838\n<81e7>4220\n<81e8>5207\n<81e9>11789\n<81ea>1030\n<81ec>2453\n<81ed>2452\n<81ee>8839\n<81ef>17105\n<81f2>11323\n<81f3>1031\n<81f4>2023\n<81f6>15713\n<81fa>4221\n<81fb>4914\n<81fc>1032\n<81fe>1655\n<81ff>7134\n<8200>2454\n<8201>7613\n<8202>2929\n<8204>8843\n<8205>3801\n<8207>4222\n<8208>4915\n<8209>5208\n<820a>5402\n<820b>12526\n<820c>1033\n<820d>1656\n<8210>2455\n<8211>8211\n<8212>3372\n<8214>4223\n<8215>10149\n<8216>10709\n<8218>14250\n<821a>16353\n<821b>1034\n<821c>3373\n<821d>9513\n<821e>4224\n<821f>1035\n<8220>6702\n<8221>7135\n<8222>2024\n<8225>7615\n<8226>16909\n<8228>2458\n<8229>14256\n<822c>2459\n<822d>16080\n<822f>7614\n<8232>8216\n<8233>8213\n<8234>8215\n<8235>2930\n<8236>2932\n<8237>2931\n<8238>8212\n<8239>2933\n<823a>8214\n<823e>17794\n<823f>8846\n<8240>9516\n<8242>9517\n<8244>9515\n<8245>9518\n<8247>3802\n<8249>9514\n<824b>4225\n<824e>10714\n<824f>10710\n<8250>10713\n<8251>10715\n<8252>10712\n<8253>10711\n<8254>18263\n<825a>11791\n<825b>11790\n<825c>11792\n<825e>12182\n<825f>12181\n<8261>12528\n<8262>15226\n<8263>12529\n<8264>12527\n<8265>15227\n<8266>5686\n<826b>13222\n<826c>13357\n<826d>13462\n<826e>1036\n<826f>1284\n<8271>5209\n<8272>1037\n<8274>8217\n<8275>8847\n<8276>18265\n<8277>5934\n<8278>6163\n<8279>18210\n<827a>17763\n<827b>14280\n<827c>6164\n<827d>6166\n<827e>1038\n<827f>6167\n<8280>6165\n<8285>6368\n<8287>16690\n<828a>6372\n<828b>1286\n<828d>1287\n<828e>6369\n<828f>6367\n<8290>6366\n<8291>6370\n<8292>1285\n<8293>6371\n<8294>7136\n<8298>6707\n<8299>1659\n<829a>6706\n<829b>6708\n<829d>1658\n<829e>6713\n<829f>1662\n<82a0>6703\n<82a1>6717\n<82a2>6723\n<82a3>1669\n<82a4>6720\n<82a5>1666\n<82a6>15731\n<82a7>6710\n<82a8>6716\n<82a9>6718\n<82aa>14268\n<82ab>6705\n<82ac>1665\n<82ad>1660\n<82ae>6711\n<82af>1667\n<82b0>1670\n<82b1>1664\n<82b3>1657\n<82b4>6715\n<82b5>6709\n<82b6>6722\n<82b7>1672\n<82b8>1668\n<82b9>1663\n<82ba>6714\n<82bb>2460\n<82bc>6712\n<82bd>1661\n<82be>1671\n<82c0>6704\n<82c2>6719\n<82c3>6721\n<82c4>17891\n<82ca>18266\n<82cf>17764\n<82d0>14273\n<82d1>2041\n<82d2>2035\n<82d3>2043\n<82d4>2040\n<82d5>7143\n<82d6>7146\n<82d7>2036\n<82d8>18267\n<82d9>7137\n<82db>2029\n<82dc>2039\n<82de>2042\n<82df>2044\n<82e0>7158\n<82e1>7149\n<82e2>14281\n<82e3>2028\n<82e4>7157\n<82e5>2032\n<82e6>2030\n<82e7>2025\n<82e8>7141\n<82ea>7156\n<82eb>7145\n<82ec>7148\n<82ed>7161\n<82ee>16408\n<82ef>2045\n<82f0>7155\n<82f1>2037\n<82f2>7150\n<82f3>7160\n<82f4>7147\n<82f5>7151\n<82f6>7154\n<82f7>15991\n<82f9>7139\n<82fa>7159\n<82fb>7153\n<82fc>16685\n<82fd>15762\n<82fe>7138\n<82ff>17374\n<8300>7142\n<8301>2038\n<8302>2033\n<8303>2026\n<8304>2031\n<8305>2027\n<8306>2046\n<8307>7140\n<8308>7632\n<8309>2034\n<830b>16054\n<830c>7152\n<830d>6781\n<8316>7635\n<8317>2474\n<8318>14282\n<8319>7619\n<831a>14274\n<831b>7630\n<831c>7626\n<831d>14289\n<831e>7645\n<8320>7637\n<8322>7627\n<8324>7636\n<8325>7621\n<8326>7625\n<8327>7648\n<8328>2477\n<8329>7640\n<832a>7631\n<832b>2461\n<832c>7646\n<832d>7617\n<832f>7639\n<8331>2476\n<8332>2471\n<8333>7616\n<8334>2469\n<8335>2468\n<8336>2473\n<8337>7638\n<8338>2465\n<8339>2472\n<833a>7144\n<833b>8848\n<833c>7633\n<833d>15658\n<833f>7623\n<8340>2475\n<8341>7624\n<8342>7628\n<8343>2478\n<8344>7618\n<8345>7642\n<8347>7641\n<8348>7649\n<8349>2467\n<834a>2464\n<834b>7647\n<834c>7643\n<834d>7634\n<834e>7629\n<834f>2470\n<8350>2466\n<8351>7620\n<8352>2462\n<8353>7644\n<8354>2463\n<8356>7622\n<8357>18269\n<8362>14262\n<8363>16875\n<8366>15902\n<836f>17765\n<8373>8223\n<8374>8225\n<8375>8230\n<8376>8250\n<8377>2947\n<8378>2937\n<837a>8222\n<837d>8233\n<837e>8240\n<837f>8246\n<8381>8227\n<8383>8234\n<8385>14291\n<8386>2950\n<8387>8248\n<8388>8243\n<8389>2945\n<838a>2943\n<838b>8239\n<838c>8235\n<838d>8221\n<838e>2934\n<838f>8226\n<8390>8218\n<8391>14316\n<8392>2942\n<8393>2944\n<8394>8231\n<8395>8228\n<8396>2939\n<8397>8244\n<8398>2936\n<8399>8229\n<839a>8889\n<839b>8237\n<839c>14157\n<839d>8236\n<839e>2935\n<83a0>2946\n<83a2>2938\n<83a3>8219\n<83a4>8224\n<83a5>8241\n<83a6>8247\n<83a7>2951\n<83a8>8220\n<83a9>8232\n<83aa>8238\n<83ab>2941\n<83ac>14294\n<83ae>8249\n<83af>8242\n<83b0>8245\n<83b9>17063\n<83bd>2940\n<83be>16217\n<83bf>8864\n<83c0>8852\n<83c1>3381\n<83c2>8881\n<83c3>8890\n<83c4>8893\n<83c5>3379\n<83c6>8860\n<83c7>8885\n<83c8>8861\n<83c9>8875\n<83ca>3392\n<83cb>8871\n<83cc>3389\n<83cd>16469\n<83ce>8872\n<83cf>8849\n<83d1>8886\n<83d3>14296\n<83d4>3398\n<83d5>8883\n<83d6>8873\n<83d7>8895\n<83d8>8868\n<83d9>9550\n<83db>8898\n<83dc>3396\n<83dd>8866\n<83de>8878\n<83df>3399\n<83e0>3378\n<83e1>8870\n<83e2>8896\n<83e3>8863\n<83e4>8856\n<83e5>8867\n<83e7>8855\n<83e8>8853\n<83e9>3374\n<83ea>8887\n<83eb>8862\n<83ec>8891\n<83ed>15660\n<83ee>8892\n<83ef>3382\n<83f0>3387\n<83f1>3383\n<83f2>3391\n<83f3>8882\n<83f4>3384\n<83f5>8874\n<83f6>8858\n<83f8>3376\n<83f9>8850\n<83fa>8884\n<83fb>8894\n<83fc>8857\n<83fd>3390\n<83fe>8899\n<83ff>8869\n<8401>8865\n<8403>3375\n<8404>3395\n<8405>18271\n<8406>8880\n<8407>3397\n<8409>8876\n<840a>3386\n<840b>3380\n<840c>3388\n<840d>3377\n<840e>3394\n<840f>8877\n<8410>8859\n<8411>8879\n<8412>8854\n<8413>8888\n<8414>15376\n<8416>16439\n<8418>15994\n<841b>8897\n<841c>16051\n<8420>15445\n<8421>14161\n<8423>8851\n<8424>18769\n<8426>18136\n<8429>9549\n<842b>9571\n<842c>3756\n<842d>9554\n<842e>16941\n<842f>9552\n<8430>9531\n<8431>3806\n<8432>9547\n<8433>9567\n<8434>9543\n<8435>3814\n<8436>9566\n<8437>9541\n<8438>3393\n<8439>9557\n<843a>9542\n<843b>9564\n<843c>3813\n<843d>3805\n<843e>15649\n<843f>9520\n<8440>9528\n<8442>9553\n<8443>9545\n<8444>9570\n<8445>9548\n<8446>3819\n<8447>9565\n<8448>18200\n<8449>3810\n<844a>14308\n<844b>9551\n<844c>9559\n<844d>9532\n<844e>9558\n<8450>9575\n<8451>9527\n<8452>9560\n<8453>15229\n<8454>9573\n<8455>14731\n<8456>9521\n<8457>3385\n<8458>14302\n<8459>9535\n<845a>9534\n<845b>3812\n<845c>16091\n<845d>9538\n<845e>9540\n<845f>9555\n<8460>9572\n<8461>3815\n<8462>17114\n<8463>3816\n<8464>18273\n<8465>9526\n<8466>3808\n<8467>9530\n<8468>9568\n<8469>3817\n<846b>3809\n<846c>3811\n<846d>3818\n<846e>9574\n<846f>9561\n<8470>9556\n<8471>14304\n<8472>15507\n<8473>9537\n<8474>9536\n<8475>3807\n<8476>9522\n<8477>3804\n<8478>9546\n<8479>9523\n<847a>9544\n<847d>9533\n<847e>9569\n<847f>14670\n<8482>3803\n<8486>9529\n<8488>18274\n<848d>9525\n<848e>9563\n<848f>9524\n<8490>4238\n<8491>10189\n<8492>14166\n<8493>14318\n<8494>10172\n<8497>10150\n<8498>10180\n<8499>4230\n<849a>10165\n<849b>10175\n<849c>4233\n<849d>10168\n<849e>4231\n<849f>10153\n<84a0>10183\n<84a1>10152\n<84a2>10171\n<84a3>15262\n<84a4>10151\n<84a7>10169\n<84a8>10178\n<84a9>10176\n<84aa>10164\n<84ab>10159\n<84ac>10157\n<84ad>15756\n<84ae>10158\n<84af>10177\n<84b0>10188\n<84b1>10166\n<84b2>4232\n<84b4>10161\n<84b6>10181\n<84b8>4235\n<84b9>10160\n<84ba>10154\n<84bb>10170\n<84bc>4239\n<84bd>15436\n<84be>18276\n<84bf>4227\n<84c0>4236\n<84c1>10162\n<84c2>10156\n<84c4>4229\n<84c5>9562\n<84c6>4228\n<84c7>10173\n<84c9>4226\n<84ca>4241\n<84cb>4234\n<84cc>10174\n<84cd>10163\n<84ce>10155\n<84cf>10182\n<84d0>10167\n<84d1>4240\n<84d2>10186\n<84d3>4237\n<84d4>10185\n<84d6>10179\n<84d7>10184\n<84da>16373\n<84db>10187\n<84de>14314\n<84e1>18277\n<84e2>14261\n<84e4>14319\n<84e5>15312\n<84e9>10743\n<84ea>10742\n<84eb>10738\n<84ec>4603\n<84ee>4595\n<84ef>10758\n<84f0>10757\n<84f1>9519\n<84f2>10735\n<84f3>10739\n<84f4>10733\n<84f6>10752\n<84f7>10737\n<84f8>18278\n<84f9>10759\n<84fa>10730\n<84fb>10728\n<84fc>10740\n<84fd>10750\n<84fe>10745\n<84ff>4605\n<8500>10719\n<8502>10749\n<8505>16619\n<8506>4606\n<8507>9539\n<8508>10731\n<8509>10722\n<850a>10725\n<850b>10763\n<850c>10732\n<850d>10723\n<850e>10721\n<850f>10718\n<8510>18279\n<8511>4599\n<8512>10741\n<8513>4598\n<8514>4602\n<8515>10736\n<8516>10744\n<8517>4592\n<8518>10760\n<8519>10764\n<851a>4594\n<851c>10727\n<851d>10747\n<851e>10751\n<851f>10724\n<8520>10761\n<8521>4601\n<8523>4600\n<8524>10716\n<8525>4604\n<8526>10754\n<8527>10726\n<8528>10746\n<8529>10720\n<852a>10734\n<852b>10729\n<852e>10748\n<852f>10765\n<8530>10762\n<8531>10753\n<8533>16936\n<8534>14324\n<8538>18280\n<853b>10717\n<853d>4593\n<853e>11343\n<8540>11334\n<8541>11337\n<8542>16482\n<8543>4923\n<8544>11339\n<8545>11328\n<8546>11335\n<8547>11341\n<8548>4920\n<8549>4924\n<854a>4918\n<854b>14272\n<854c>16399\n<854d>11330\n<854e>11346\n<8551>11340\n<8552>18281\n<8553>11331\n<8554>11355\n<8555>11349\n<8556>11327\n<8557>11811\n<8558>11333\n<8559>4919\n<855a>14299\n<855b>11344\n<855d>11354\n<855e>4927\n<8560>11351\n<8561>11332\n<8562>11338\n<8563>11342\n<8564>11336\n<8565>11356\n<8566>11353\n<8567>11350\n<856a>4926\n<856b>11329\n<856c>11357\n<856d>4925\n<856e>11347\n<8571>11345\n<8573>14328\n<8575>11348\n<8576>11824\n<8577>11805\n<8578>11810\n<8579>11823\n<857a>11809\n<857b>11801\n<857c>11806\n<857e>5212\n<8580>11794\n<8581>11818\n<8582>11820\n<8583>11793\n<8584>5211\n<8585>11822\n<8586>11814\n<8587>5218\n<8588>11821\n<8589>11807\n<858a>5220\n<858b>11799\n<858c>11352\n<858d>11815\n<858e>11812\n<858f>11795\n<8590>11826\n<8591>5214\n<8594>5215\n<8595>11797\n<8596>11813\n<8598>11825\n<8599>11816\n<859a>11803\n<859b>5217\n<859c>5213\n<859d>11817\n<859e>11804\n<859f>11827\n<85a0>11798\n<85a1>11808\n<85a2>11819\n<85a3>11800\n<85a4>11802\n<85a6>5221\n<85a7>11796\n<85a8>5219\n<85a9>5404\n<85aa>5210\n<85af>5216\n<85b0>5408\n<85b1>12198\n<85b3>12188\n<85b4>12183\n<85b5>12189\n<85b6>12199\n<85b7>12203\n<85b8>12202\n<85b9>5410\n<85ba>5409\n<85bd>12190\n<85be>12204\n<85bf>12193\n<85c0>12185\n<85c1>14334\n<85c2>12187\n<85c3>12186\n<85c4>12192\n<85c5>12197\n<85c6>12184\n<85c7>12191\n<85c8>12196\n<85c9>5407\n<85cb>12194\n<85cd>5405\n<85ce>12195\n<85cf>5403\n<85d0>5406\n<85d1>12545\n<85d2>12200\n<85d5>5559\n<85d7>12537\n<85d8>12541\n<85d9>12533\n<85da>12536\n<85dc>12544\n<85dd>5557\n<85de>12549\n<85df>12542\n<85e0>18285\n<85e1>12534\n<85e2>12550\n<85e3>12543\n<85e6>12547\n<85e8>12535\n<85e9>5556\n<85ea>5558\n<85eb>12530\n<85ec>12538\n<85ed>12532\n<85ee>15446\n<85ef>12548\n<85f0>12546\n<85f1>12531\n<85f2>12539\n<85f6>12837\n<85f7>5562\n<85f8>12540\n<85f9>5688\n<85fa>5690\n<85fb>5687\n<85fc>15440\n<85fd>12842\n<85fe>12834\n<85ff>12832\n<8600>12836\n<8601>12833\n<8602>14336\n<8604>12838\n<8605>12840\n<8606>5691\n<8607>5693\n<8609>12839\n<860a>5694\n<860b>5692\n<860c>12841\n<860d>16484\n<8610>15231\n<8611>5689\n<8614>18110\n<8616>14331\n<8617>5765\n<8618>13046\n<8619>13052\n<861a>5767\n<861b>12835\n<861c>13051\n<861e>13058\n<861f>13049\n<8620>13056\n<8621>13055\n<8622>12831\n<8623>13050\n<8624>12201\n<8625>13059\n<8626>13048\n<8627>13053\n<8628>14341\n<8629>13057\n<862a>13047\n<862c>13226\n<862d>5766\n<862e>13054\n<862f>16286\n<8631>13362\n<8632>13227\n<8633>13225\n<8636>13228\n<8638>5895\n<8639>13360\n<863a>13358\n<863b>13363\n<863c>13361\n<863e>13364\n<863f>5896\n<8640>13359\n<8642>14529\n<8643>13463\n<8645>15206\n<864b>13630\n<864c>13622\n<864d>6168\n<864e>1673\n<8650>2047\n<8652>7651\n<8653>7650\n<8654>2479\n<8655>2952\n<8656>8252\n<8659>8251\n<865b>3400\n<865c>3821\n<865e>3820\n<865f>3822\n<8661>10190\n<8662>10766\n<8663>11358\n<8664>11360\n<8665>11359\n<8667>5222\n<8668>11828\n<8669>12205\n<866a>13598\n<866b>1039\n<866c>14355\n<866f>6725\n<8670>6724\n<8671>1674\n<8672>18287\n<8673>7165\n<8674>7163\n<8677>7162\n<8679>2048\n<867a>2050\n<867b>2049\n<867c>7164\n<867e>14346\n<8685>7663\n<8686>7660\n<8687>7658\n<868a>2480\n<868b>7661\n<868c>2485\n<868d>7655\n<868e>7670\n<8690>7672\n<8691>7656\n<8692>18288\n<8693>2482\n<8694>7673\n<8695>7668\n<8696>7654\n<8697>7659\n<8698>7669\n<8699>7665\n<869a>7662\n<869c>2487\n<869d>7671\n<869e>7657\n<86a0>15240\n<86a1>7666\n<86a2>7652\n<86a3>2486\n<86a4>2483\n<86a5>7664\n<86a7>7667\n<86a8>7653\n<86a9>2484\n<86aa>2481\n<86ad>16134\n<86af>2962\n<86b0>8259\n<86b1>2961\n<86b2>17376\n<86b3>8262\n<86b4>8265\n<86b5>2958\n<86b6>2956\n<86b7>8254\n<86b8>8263\n<86b9>8261\n<86ba>8258\n<86bf>8253\n<86c0>2955\n<86c1>8256\n<86c2>8255\n<86c3>8268\n<86c4>2957\n<86c5>8257\n<86c6>2959\n<86c7>2954\n<86c8>8260\n<86c9>2963\n<86cb>2960\n<86cc>8264\n<86d0>3407\n<86d1>8914\n<86d3>8903\n<86d4>3404\n<86d6>9581\n<86d7>8912\n<86d8>8900\n<86d9>3402\n<86da>8905\n<86db>3405\n<86dc>8909\n<86dd>8907\n<86de>3408\n<86df>3401\n<86e2>8901\n<86e3>8904\n<86e4>3406\n<86e6>8902\n<86e8>8913\n<86e9>8911\n<86ea>8906\n<86eb>8908\n<86ec>8910\n<86ed>3403\n<86ef>18289\n<86f5>9582\n<86f6>9588\n<86f7>9578\n<86f8>9584\n<86f9>3823\n<86fa>9580\n<86fb>3829\n<86fe>3828\n<8700>3827\n<8701>9587\n<8704>9577\n<8705>9590\n<8706>3832\n<8707>3826\n<8708>3825\n<8709>9586\n<870a>3833\n<870b>9576\n<870c>9579\n<870d>9589\n<870e>9585\n<8711>10222\n<8712>10211\n<8713>3824\n<8718>4248\n<8719>10199\n<871a>10220\n<871b>10200\n<871c>4243\n<871e>10197\n<8720>10206\n<8721>10198\n<8722>4245\n<8723>10192\n<8724>10219\n<8725>4246\n<8728>10193\n<8729>4251\n<872a>10208\n<872c>10202\n<872d>10209\n<872e>10196\n<8730>10221\n<8731>10213\n<8732>10207\n<8733>10191\n<8734>4247\n<8735>10214\n<8737>4250\n<8738>10218\n<873a>10212\n<873b>4244\n<873c>10210\n<873e>10204\n<873f>4242\n<8740>10195\n<8741>10203\n<8742>10215\n<8743>10201\n<8746>10205\n<874c>4616\n<874d>9583\n<874e>10784\n<874f>10793\n<8750>10783\n<8751>10779\n<8752>10776\n<8753>4617\n<8754>10774\n<8755>4249\n<8756>10767\n<8757>4615\n<8758>10773\n<8759>4614\n<875a>10778\n<875b>10775\n<875c>10791\n<875d>10786\n<875e>10780\n<875f>10785\n<8760>4610\n<8761>10777\n<8762>10796\n<8765>10792\n<8766>4611\n<8767>10797\n<8768>4613\n<8769>10798\n<876a>10782\n<876b>10194\n<876c>10788\n<876d>10781\n<876e>10790\n<876f>10787\n<8770>15980\n<8773>10772\n<8774>4608\n<8775>10795\n<8776>4609\n<8777>10770\n<8778>4612\n<8779>11371\n<877a>10789\n<877b>10794\n<877d>16453\n<8781>11368\n<8782>4607\n<8783>4928\n<8784>11378\n<8785>11374\n<8787>11372\n<8788>11367\n<8789>11382\n<878b>17378\n<878c>16367\n<878d>4932\n<878f>11363\n<8792>11366\n<8793>11365\n<8794>11379\n<8796>11369\n<8797>11364\n<8798>11370\n<879a>11381\n<879b>11362\n<879c>11380\n<879d>11377\n<879e>4930\n<879f>4929\n<87a2>4931\n<87a3>11373\n<87a4>11361\n<87a5>15752\n<87a9>16364\n<87aa>11830\n<87ab>5228\n<87ac>11834\n<87ad>11831\n<87ae>11838\n<87af>11844\n<87b0>11833\n<87b1>14351\n<87b2>11853\n<87b3>5225\n<87b4>11847\n<87b5>11836\n<87b6>11848\n<87b7>11843\n<87b8>11850\n<87b9>11835\n<87ba>5230\n<87bb>5229\n<87bc>11837\n<87bd>11851\n<87be>11829\n<87bf>11849\n<87c0>5223\n<87c1>16380\n<87c2>11841\n<87c3>11840\n<87c4>11845\n<87c5>11832\n<87c6>5227\n<87c8>5231\n<87c9>11839\n<87ca>11846\n<87cb>5232\n<87cc>11842\n<87ce>16365\n<87d1>5224\n<87d2>5226\n<87d3>12218\n<87d4>12216\n<87d6>16274\n<87d7>12222\n<87d8>12220\n<87d9>12223\n<87da>14352\n<87db>12209\n<87dc>12217\n<87dd>12227\n<87de>11852\n<87df>12213\n<87e0>5414\n<87e1>10771\n<87e2>12208\n<87e3>12221\n<87e4>12215\n<87e5>12212\n<87e6>12207\n<87e7>12206\n<87e8>12226\n<87ea>12211\n<87eb>12210\n<87ec>5412\n<87ed>12219\n<87ee>14349\n<87ef>5411\n<87f2>5413\n<87f3>12214\n<87f4>12225\n<87f5>16302\n<87f9>5566\n<87fa>12552\n<87fb>5563\n<87fc>12560\n<87fe>5567\n<87ff>12562\n<8800>12551\n<8801>12224\n<8802>12564\n<8803>12553\n<8804>16047\n<8805>5564\n<8806>12559\n<8808>12561\n<8809>12556\n<880a>12563\n<880b>12558\n<880c>12557\n<880d>5565\n<880f>14353\n<8813>12847\n<8816>12848\n<8817>12846\n<8818>16250\n<8819>12843\n<881b>13062\n<881c>13065\n<881d>13061\n<881f>5771\n<8820>13063\n<8821>5770\n<8822>5769\n<8823>5768\n<8824>13064\n<8825>13233\n<8826>13231\n<8827>15879\n<8828>13230\n<8829>13060\n<882a>13232\n<882b>13066\n<882c>13229\n<882d>15243\n<882e>13367\n<882f>13333\n<8830>13365\n<8831>5897\n<8832>13366\n<8833>13368\n<8835>13466\n<8836>5928\n<8837>13465\n<8838>13464\n<8839>5929\n<883b>5959\n<883c>13576\n<883d>13600\n<883e>13599\n<883f>13601\n<8840>1040\n<8841>7166\n<8842>16218\n<8848>8915\n<884a>13067\n<884b>13467\n<884c>1041\n<884d>2051\n<884e>7167\n<884f>14404\n<8852>8271\n<8853>2964\n<8855>8917\n<8856>8916\n<8857>3409\n<8859>3834\n<885a>10799\n<885b>4618\n<885d>4619\n<885e>14363\n<8860>14918\n<8861>4933\n<8862>5930\n<8863>1042\n<8864>17666\n<8865>15868\n<8867>7168\n<8868>1676\n<8869>7170\n<886a>7169\n<886b>2052\n<886d>7676\n<886e>15246\n<886f>7683\n<8870>2488\n<8871>7681\n<8872>7679\n<8874>7686\n<8877>2489\n<8879>2493\n<887c>7687\n<887d>2492\n<887e>7685\n<887f>7682\n<8880>7680\n<8883>7684\n<8884>17143\n<8887>15248\n<8888>2966\n<8889>8272\n<888b>2971\n<888c>8288\n<888d>2970\n<888e>8290\n<8891>8278\n<8892>2968\n<8893>8289\n<8895>8273\n<8896>2969\n<8897>8285\n<8898>8281\n<8899>8283\n<889a>8277\n<889b>8284\n<889c>14364\n<889e>2965\n<889f>8280\n<88a0>16288\n<88a1>8279\n<88a2>8275\n<88a4>8286\n<88a7>8282\n<88a8>8274\n<88aa>8276\n<88ab>2967\n<88ac>8287\n<88ae>18293\n<88b1>3412\n<88b2>8928\n<88b6>8924\n<88b7>8926\n<88b8>8921\n<88b9>8920\n<88ba>8918\n<88bc>8925\n<88bd>8927\n<88be>8923\n<88bf>15249\n<88c0>8922\n<88c5>14368\n<88c7>16049\n<88c9>8930\n<88ca>3842\n<88cb>9592\n<88cc>9598\n<88cf>14058\n<88d0>9599\n<88d2>3844\n<88d4>3836\n<88d5>3843\n<88d6>9591\n<88d7>8919\n<88d8>3839\n<88d9>3837\n<88da>9597\n<88db>9596\n<88dc>3838\n<88dd>3840\n<88de>9595\n<88df>3835\n<88e1>3841\n<88e6>15250\n<88e7>10224\n<88e8>4258\n<88eb>10235\n<88ec>10234\n<88ee>10229\n<88ef>4260\n<88f0>10233\n<88f3>4252\n<88f4>4254\n<88f5>15880\n<88f6>10231\n<88f7>10223\n<88f8>4256\n<88f9>4255\n<88fa>10227\n<88fb>10232\n<88fc>10230\n<88fd>4257\n<88fe>10228\n<88ff>18294\n<8900>17146\n<8901>8929\n<8902>4253\n<8905>10800\n<8906>10807\n<8907>4621\n<8909>10811\n<890a>4625\n<890b>10803\n<890c>10801\n<890e>10810\n<8910>4620\n<8911>10809\n<8914>10802\n<8915>4624\n<8916>10808\n<891a>4259\n<891e>11383\n<891f>11395\n<8921>4938\n<8922>11390\n<8923>11392\n<8924>18295\n<8925>4936\n<8926>11384\n<8927>11388\n<8929>11391\n<892a>4934\n<892b>4937\n<892c>11394\n<892f>11393\n<8930>11385\n<8931>11389\n<8932>4935\n<8933>11855\n<8935>11854\n<8936>5234\n<8937>11860\n<8938>5236\n<893b>5233\n<893c>11856\n<893d>5237\n<893e>11857\n<8941>11858\n<8942>11861\n<8943>15894\n<8944>5235\n<8946>12232\n<8947>17379\n<8949>12235\n<894b>12229\n<894c>12231\n<894d>15252\n<894f>12230\n<8952>11859\n<8953>12228\n<8954>15254\n<8956>5570\n<8957>12568\n<8958>12571\n<8959>12573\n<895c>12570\n<895d>12572\n<895e>5571\n<895f>5569\n<8960>5568\n<8961>12569\n<8962>12565\n<8963>12849\n<8964>5697\n<8965>15251\n<8966>12850\n<8969>13069\n<896a>5772\n<896b>13071\n<896c>5773\n<896d>13068\n<896e>13070\n<896f>5846\n<8971>13234\n<8972>5845\n<8973>13371\n<8974>13370\n<8976>13369\n<8977>15850\n<897b>13541\n<897c>13540\n<897e>6169\n<897f>1043\n<8980>18184\n<8981>2053\n<8982>8291\n<8983>3413\n<8985>9600\n<8986>5415\n<8987>14370\n<8988>12574\n<8989>16361\n<898b>1288\n<898f>2973\n<8991>18296\n<8993>2972\n<8994>16352\n<8995>8931\n<8996>3414\n<8997>8933\n<8998>8932\n<899b>9601\n<899c>3845\n<899d>10236\n<899e>10239\n<899f>10238\n<89a1>10237\n<89a2>10812\n<89a3>10814\n<89a4>10813\n<89a5>15763\n<89a6>4940\n<89a7>14374\n<89aa>4939\n<89ac>5238\n<89ad>11862\n<89ae>11864\n<89af>11863\n<89b2>5416\n<89b6>12576\n<89b7>12575\n<89b9>12851\n<89ba>5698\n<89bc>14375\n<89bd>5774\n<89be>13236\n<89bf>13235\n<89c0>5960\n<89c1>17667\n<89c6>17766\n<89d2>1289\n<89d3>7171\n<89d4>2054\n<89d5>8294\n<89d6>8292\n<89d9>8293\n<89dc>9608\n<89dd>8934\n<89df>9602\n<89e0>9606\n<89e1>9605\n<89e2>9607\n<89e3>3846\n<89e4>9604\n<89e5>9603\n<89e6>9609\n<89e7>14377\n<89e8>10242\n<89e9>10240\n<89eb>10241\n<89ec>10817\n<89ed>10815\n<89f0>10816\n<89f1>11396\n<89f4>5417\n<89f6>12577\n<89f7>12852\n<89f8>5699\n<89fa>13072\n<89fb>13237\n<89fc>5847\n<89fe>13372\n<89ff>13542\n<8a00>1290\n<8a04>7172\n<8a07>7173\n<8a08>2055\n<8a0a>2499\n<8a0c>2497\n<8a0e>2496\n<8a0f>2503\n<8a10>2495\n<8a11>2504\n<8a12>7688\n<8a13>2501\n<8a15>2498\n<8a16>2502\n<8a17>2500\n<8a18>2494\n<8a1b>2981\n<8a1c>15267\n<8a1d>2975\n<8a1e>8298\n<8a1f>2980\n<8a22>2982\n<8a23>2976\n<8a25>2977\n<8a27>8296\n<8a29>17381\n<8a2a>2974\n<8a2b>15313\n<8a2c>8297\n<8a2d>2979\n<8a30>8295\n<8a31>2978\n<8a34>3425\n<8a36>3427\n<8a38>18298\n<8a39>8939\n<8a3a>3426\n<8a3b>3415\n<8a3c>3419\n<8a3d>15266\n<8a3e>3865\n<8a3f>9614\n<8a40>8941\n<8a41>3420\n<8a46>3424\n<8a48>8947\n<8a49>16368\n<8a4a>8949\n<8a4c>8950\n<8a4d>8938\n<8a4e>8937\n<8a4f>8951\n<8a50>3423\n<8a51>8948\n<8a52>8946\n<8a54>3421\n<8a55>3417\n<8a56>3428\n<8a59>8940\n<8a5b>3422\n<8a5e>3418\n<8a60>3416\n<8a61>9613\n<8a62>3860\n<8a63>3855\n<8a66>3850\n<8a67>16270\n<8a68>3866\n<8a69>3851\n<8a6b>3847\n<8a6c>3862\n<8a6d>3859\n<8a6e>3861\n<8a70>3852\n<8a71>3857\n<8a74>9621\n<8a75>9618\n<8a76>9610\n<8a77>9615\n<8a79>3863\n<8a7a>9622\n<8a7b>3864\n<8a7c>3854\n<8a7e>16293\n<8a7f>9612\n<8a81>9620\n<8a82>9616\n<8a83>9619\n<8a84>9617\n<8a85>3858\n<8a86>9611\n<8a87>3853\n<8a8b>10245\n<8a8c>4262\n<8a8d>4265\n<8a8f>10247\n<8a90>14383\n<8a91>4273\n<8a92>10246\n<8a93>4267\n<8a94>18299\n<8a95>4630\n<8a96>10248\n<8a98>4272\n<8a99>10244\n<8a9a>4274\n<8a9c>14380\n<8a9e>4263\n<8aa0>3856\n<8aa1>4266\n<8aa3>4264\n<8aa4>4268\n<8aa5>4270\n<8aa6>4261\n<8aa7>4275\n<8aa8>4271\n<8aa9>14397\n<8aaa>4269\n<8aab>10243\n<8aaf>14401\n<8ab0>4637\n<8ab2>4633\n<8ab4>18300\n<8ab6>4640\n<8ab8>10820\n<8ab9>4641\n<8aba>10832\n<8abb>10825\n<8abc>4626\n<8abd>10833\n<8abe>10827\n<8abf>4636\n<8ac0>10828\n<8ac2>4635\n<8ac3>10831\n<8ac4>4629\n<8ac5>10829\n<8ac6>10819\n<8ac7>4628\n<8ac8>11407\n<8ac9>4634\n<8acb>4631\n<8acd>4639\n<8acf>10818\n<8ad1>10822\n<8ad2>4627\n<8ad3>10821\n<8ad6>4638\n<8ad7>10826\n<8ad8>10830\n<8ad9>10834\n<8ada>14786\n<8adb>4642\n<8adc>4946\n<8add>11402\n<8ade>11408\n<8adf>11405\n<8ae0>11397\n<8ae1>11409\n<8ae2>11398\n<8ae4>11404\n<8ae6>4941\n<8ae7>4947\n<8ae8>11410\n<8aea>15833\n<8aeb>4943\n<8aed>4953\n<8aee>4948\n<8aef>11412\n<8af0>11406\n<8af1>4944\n<8af2>11399\n<8af3>4954\n<8af6>4955\n<8af7>4952\n<8af8>4632\n<8afa>4942\n<8afb>11413\n<8afc>4956\n<8afe>4949\n<8aff>11411\n<8b00>4945\n<8b04>5246\n<8b05>11871\n<8b06>11880\n<8b07>11877\n<8b08>11879\n<8b0a>5243\n<8b0b>11872\n<8b0c>14390\n<8b0d>11878\n<8b0e>5239\n<8b0f>11874\n<8b10>5247\n<8b11>11870\n<8b12>11875\n<8b13>11882\n<8b14>11403\n<8b15>11876\n<8b16>11869\n<8b17>5240\n<8b18>11868\n<8b19>5241\n<8b1a>11883\n<8b1b>5242\n<8b1c>11881\n<8b1d>5245\n<8b1e>11867\n<8b1f>14391\n<8b20>5244\n<8b22>11873\n<8b23>12238\n<8b24>12252\n<8b25>12247\n<8b26>12249\n<8b27>12237\n<8b28>5418\n<8b2a>12236\n<8b2b>5421\n<8b2c>5420\n<8b2d>16281\n<8b2e>12251\n<8b2f>12243\n<8b30>12240\n<8b31>12246\n<8b33>12239\n<8b35>12241\n<8b36>12250\n<8b37>12248\n<8b39>5419\n<8b3a>12255\n<8b3b>12253\n<8b3c>12244\n<8b3d>12254\n<8b3e>12245\n<8b3f>14394\n<8b40>12581\n<8b41>5572\n<8b42>12588\n<8b43>16370\n<8b45>13075\n<8b46>5579\n<8b47>12242\n<8b48>12579\n<8b49>5575\n<8b4a>12580\n<8b4b>12585\n<8b4d>14396\n<8b50>12578\n<8b51>12587\n<8b52>12589\n<8b53>12582\n<8b54>12584\n<8b55>12586\n<8b56>12583\n<8b57>12590\n<8b58>5574\n<8b59>5580\n<8b5a>5576\n<8b5c>5573\n<8b5d>12855\n<8b5e>15800\n<8b5f>5704\n<8b60>12853\n<8b62>15828\n<8b63>12857\n<8b65>12858\n<8b66>5702\n<8b67>12859\n<8b68>12856\n<8b69>15351\n<8b6a>12854\n<8b6b>5705\n<8b6c>5701\n<8b6d>12860\n<8b6f>5703\n<8b70>5700\n<8b74>5775\n<8b77>5776\n<8b78>13074\n<8b79>13073\n<8b7d>5777\n<8b7e>13238\n<8b7f>13243\n<8b80>5848\n<8b81>15757\n<8b82>13240\n<8b84>13239\n<8b85>13242\n<8b86>13241\n<8b88>13376\n<8b8a>5898\n<8b8b>13375\n<8b8c>13373\n<8b8e>13374\n<8b90>14399\n<8b92>5932\n<8b93>5931\n<8b96>5933\n<8b9a>5972\n<8b9b>14400\n<8b9c>5978\n<8b9e>13602\n<8b9f>13631\n<8ba0>17669\n<8bbe>17767\n<8be2>17768\n<8c37>1291\n<8c39>8299\n<8c3b>8300\n<8c3c>9623\n<8c3d>10249\n<8c3e>10835\n<8c3f>5249\n<8c41>5248\n<8c42>12256\n<8c43>12591\n<8c45>13377\n<8c46>1292\n<8c47>7689\n<8c48>2505\n<8c49>2983\n<8c4a>9625\n<8c4b>9624\n<8c4c>4643\n<8c4d>10836\n<8c4e>4644\n<8c4f>11884\n<8c50>5422\n<8c51>18301\n<8c54>5987\n<8c55>1293\n<8c56>6728\n<8c57>7690\n<8c5a>2984\n<8c5f>8952\n<8c61>3429\n<8c62>3867\n<8c64>9627\n<8c65>9626\n<8c66>9628\n<8c6a>4276\n<8c6b>4957\n<8c6c>4645\n<8c6d>4958\n<8c6f>11888\n<8c70>11885\n<8c71>11887\n<8c72>11886\n<8c73>5250\n<8c75>12257\n<8c76>12593\n<8c77>12592\n<8c78>6375\n<8c79>2507\n<8c7a>2506\n<8c7b>7691\n<8c7d>8303\n<8c80>8954\n<8c81>8953\n<8c82>3430\n<8c86>9629\n<8c89>3869\n<8c8a>3868\n<8c8c>4278\n<8c8d>4277\n<8c8f>10837\n<8c90>11416\n<8c93>4959\n<8c94>11890\n<8c95>11889\n<8c97>12260\n<8c98>12259\n<8c99>12258\n<8c9a>12594\n<8c9b>14405\n<8c9c>13603\n<8c9d>1294\n<8c9e>2058\n<8c9f>15277\n<8ca0>2059\n<8ca3>7693\n<8ca4>7692\n<8ca5>8304\n<8ca7>2990\n<8ca8>2988\n<8ca9>2985\n<8caa>2989\n<8cab>2987\n<8cac>2986\n<8cad>16369\n<8caf>3431\n<8cb0>8957\n<8cb2>3874\n<8cb3>3433\n<8cb4>3438\n<8cb5>8959\n<8cb6>3440\n<8cb7>3439\n<8cb8>3442\n<8cb9>8958\n<8cba>8955\n<8cbb>3436\n<8cbc>3432\n<8cbd>3434\n<8cbe>8956\n<8cbf>3441\n<8cc0>3437\n<8cc1>3435\n<8cc2>3876\n<8cc3>3875\n<8cc4>3873\n<8cc5>3877\n<8cca>3870\n<8ccc>9632\n<8ccd>16025\n<8ccf>10253\n<8cd3>4279\n<8cd4>18302\n<8cd5>10252\n<8cd6>14411\n<8cd7>10254\n<8cd9>10840\n<8cda>10842\n<8cdb>14417\n<8cdc>4654\n<8cdd>10843\n<8cde>4647\n<8cdf>10839\n<8ce0>4646\n<8ce1>4656\n<8ce4>4649\n<8ce5>10838\n<8ce6>4648\n<8ce7>10844\n<8ce8>10841\n<8ce9>15278\n<8cea>4655\n<8ceb>16284\n<8cee>11418\n<8cf0>11420\n<8cf1>11419\n<8cf2>18303\n<8cf3>11421\n<8cf4>4960\n<8cf5>11417\n<8cf7>16305\n<8cf8>5254\n<8cf9>11891\n<8cfa>5251\n<8cfb>5255\n<8cfc>5253\n<8cfd>5252\n<8cfe>12261\n<8d00>12264\n<8d02>12263\n<8d03>14415\n<8d04>12262\n<8d05>5423\n<8d08>5581\n<8d09>12597\n<8d0a>5582\n<8d0b>17779\n<8d0c>16278\n<8d0d>5707\n<8d0f>5706\n<8d10>13078\n<8d11>14419\n<8d12>14414\n<8d13>5778\n<8d14>13079\n<8d15>13244\n<8d18>15983\n<8d19>13378\n<8d1b>5935\n<8d1c>18304\n<8d1d>17670\n<8d64>1295\n<8d66>2992\n<8d67>2991\n<8d6b>4282\n<8d6c>11422\n<8d6d>4657\n<8d6e>11423\n<8d6f>11892\n<8d70>1296\n<8d72>7174\n<8d73>2061\n<8d74>2060\n<8d76>7694\n<8d77>2510\n<8d78>7695\n<8d79>8307\n<8d7a>14817\n<8d7b>8306\n<8d7d>8305\n<8d80>8961\n<8d81>3445\n<8d82>16233\n<8d84>8960\n<8d85>3444\n<8d89>8962\n<8d8a>3443\n<8d8c>9636\n<8d8d>9639\n<8d90>9642\n<8d91>9635\n<8d92>9643\n<8d95>4284\n<8d96>10255\n<8d99>4283\n<8d9b>10848\n<8d9c>10846\n<8d9f>4658\n<8da0>10845\n<8da1>10847\n<8da3>4659\n<8da5>11424\n<8da6>16375\n<8da7>11425\n<8da8>5256\n<8da9>14422\n<8daa>12599\n<8dab>12601\n<8dac>12598\n<8dad>12600\n<8dae>12861\n<8daf>13080\n<8db2>13577\n<8db3>1297\n<8db4>2062\n<8db5>7696\n<8db6>7698\n<8db7>7697\n<8db9>8310\n<8dba>2994\n<8dbc>8308\n<8dbe>2993\n<8dbf>8311\n<8dc0>17258\n<8dc1>8312\n<8dc2>8309\n<8dc3>18306\n<8dc5>8974\n<8dc6>3453\n<8dc7>8966\n<8dc8>8972\n<8dcb>3448\n<8dcc>3451\n<8dcd>8965\n<8dce>3446\n<8dcf>8969\n<8dd0>9649\n<8dd1>3450\n<8dd3>8964\n<8dd4>16258\n<8dd5>8970\n<8dd6>8967\n<8dd7>8973\n<8dd8>8963\n<8dd9>8971\n<8dda>3449\n<8ddb>3452\n<8ddc>8968\n<8ddd>3447\n<8ddf>3879\n<8de0>9645\n<8de1>3878\n<8de2>9652\n<8de3>9651\n<8de4>3885\n<8de6>3886\n<8de7>9653\n<8de8>3880\n<8de9>9650\n<8dea>3884\n<8deb>9655\n<8dec>9646\n<8dee>9648\n<8def>3881\n<8df0>9644\n<8df1>9647\n<8df2>9654\n<8df3>3882\n<8df4>9656\n<8dfa>3883\n<8dfc>4285\n<8dfd>10260\n<8dfe>10266\n<8dff>10258\n<8e00>10267\n<8e01>16261\n<8e02>10257\n<8e03>10262\n<8e04>10268\n<8e05>10265\n<8e06>10264\n<8e07>10263\n<8e09>10256\n<8e0a>10261\n<8e0d>10259\n<8e0e>15966\n<8e0f>4664\n<8e10>4661\n<8e11>10857\n<8e12>10862\n<8e13>10864\n<8e14>10861\n<8e15>10854\n<8e16>10856\n<8e17>10866\n<8e18>10863\n<8e19>10858\n<8e1a>10867\n<8e1b>10855\n<8e1c>10865\n<8e1d>4662\n<8e1e>4668\n<8e1f>4666\n<8e20>10849\n<8e21>4667\n<8e22>4663\n<8e23>10850\n<8e24>10852\n<8e25>10851\n<8e28>16264\n<8e29>4665\n<8e2a>15284\n<8e2b>4660\n<8e2d>16043\n<8e2e>10853\n<8e30>11435\n<8e31>4962\n<8e33>11426\n<8e34>4963\n<8e35>4966\n<8e36>11431\n<8e38>11428\n<8e39>4965\n<8e3a>18308\n<8e3e>11427\n<8e3f>11436\n<8e40>11429\n<8e41>11434\n<8e42>4964\n<8e44>4961\n<8e45>11430\n<8e46>17170\n<8e47>11898\n<8e48>5259\n<8e49>5257\n<8e4a>5260\n<8e4b>5258\n<8e4c>11897\n<8e4d>11894\n<8e4e>11893\n<8e4f>16259\n<8e50>11896\n<8e53>11895\n<8e54>12278\n<8e55>5429\n<8e56>12269\n<8e57>12268\n<8e59>5424\n<8e5a>12274\n<8e5b>12273\n<8e5c>12265\n<8e5d>12276\n<8e5e>12270\n<8e5f>5428\n<8e60>12267\n<8e61>12275\n<8e62>12266\n<8e63>5425\n<8e64>5427\n<8e65>12271\n<8e66>5426\n<8e67>12272\n<8e68>17229\n<8e69>12277\n<8e6a>12605\n<8e6c>5587\n<8e6d>12602\n<8e6f>12606\n<8e71>17383\n<8e72>5584\n<8e73>12604\n<8e74>5589\n<8e75>16265\n<8e76>5586\n<8e77>16255\n<8e78>12603\n<8e7a>5588\n<8e7b>12607\n<8e7c>5583\n<8e7e>17188\n<8e81>5709\n<8e82>5711\n<8e84>12864\n<8e85>5710\n<8e86>12862\n<8e87>5585\n<8e88>12863\n<8e89>5708\n<8e8a>5779\n<8e8b>5781\n<8e8c>13082\n<8e8d>5780\n<8e8e>13081\n<8e90>13249\n<8e91>5851\n<8e92>13248\n<8e93>5852\n<8e94>13246\n<8e95>13245\n<8e98>13379\n<8e9a>13247\n<8e9d>13473\n<8ea1>5961\n<8ea3>13547\n<8ea4>13546\n<8ea5>13545\n<8ea6>13578\n<8ea7>15285\n<8ea8>13623\n<8ea9>13604\n<8eaa>5979\n<8eab>1298\n<8eac>2511\n<8ead>14430\n<8eb0>17385\n<8eb2>3887\n<8eb6>14431\n<8eba>4669\n<8ebc>14496\n<8ebd>11437\n<8ec0>5430\n<8ec2>12608\n<8ec3>14432\n<8ec9>13605\n<8eca>1299\n<8ecb>1677\n<8ecc>2064\n<8ecd>2063\n<8ece>18312\n<8ecf>2514\n<8ed1>7699\n<8ed2>2512\n<8ed3>7700\n<8ed4>2513\n<8ed7>8317\n<8ed8>8313\n<8eda>15806\n<8edb>2995\n<8edc>8316\n<8edd>8315\n<8ede>8314\n<8edf>2996\n<8ee2>18313\n<8ee4>18314\n<8ee5>8981\n<8ee6>8979\n<8ee9>8990\n<8eeb>8986\n<8eec>8988\n<8eed>18315\n<8eee>8980\n<8eef>8975\n<8ef1>8987\n<8ef2>18316\n<8ef4>8989\n<8ef5>8982\n<8ef6>8985\n<8ef7>8976\n<8ef8>3455\n<8ef9>8978\n<8efa>8977\n<8efb>3454\n<8efc>3456\n<8efe>3890\n<8eff>9658\n<8f00>9660\n<8f01>9659\n<8f02>9664\n<8f03>3888\n<8f05>9661\n<8f06>9657\n<8f09>3889\n<8f0a>3891\n<8f0b>9665\n<8f0d>10272\n<8f0e>10271\n<8f12>4287\n<8f13>4289\n<8f14>4286\n<8f15>4288\n<8f18>10870\n<8f19>14434\n<8f1a>10871\n<8f1b>4671\n<8f1c>4676\n<8f1d>4670\n<8f1e>4677\n<8f1f>4672\n<8f20>10872\n<8f23>10873\n<8f24>10869\n<8f25>4678\n<8f26>4674\n<8f29>4673\n<8f2a>4675\n<8f2c>10868\n<8f2d>14435\n<8f2e>11439\n<8f2f>4968\n<8f30>15287\n<8f32>11441\n<8f33>4970\n<8f34>11444\n<8f35>11440\n<8f36>11438\n<8f37>11443\n<8f38>4969\n<8f39>11442\n<8f3b>4967\n<8f3e>5262\n<8f3f>5265\n<8f40>11900\n<8f41>15623\n<8f42>5263\n<8f43>11899\n<8f44>5261\n<8f45>5264\n<8f49>5431\n<8f4a>15288\n<8f4b>12282\n<8f4d>5432\n<8f4e>5591\n<8f51>12610\n<8f52>12609\n<8f53>12613\n<8f54>5590\n<8f55>12868\n<8f58>12869\n<8f59>12865\n<8f5a>12870\n<8f5b>13084\n<8f5c>16177\n<8f5d>13085\n<8f5e>13083\n<8f5f>5782\n<8f60>13252\n<8f61>5853\n<8f62>13253\n<8f63>13381\n<8f64>13380\n<8f6e>17771\n<8f93>18226\n<8f9b>1300\n<8f9c>3457\n<8f9f>3892\n<8fa0>15764\n<8fa3>4290\n<8fa5>14438\n<8fa6>4972\n<8fa8>4971\n<8fad>5592\n<8fae>5679\n<8faf>5783\n<8fb0>1301\n<8fb1>2515\n<8fb2>3893\n<8fb3>14442\n<8fb4>12614\n<8fb5>560\n<8fb6>18387\n<8fb7>17405\n<8fb8>17142\n<8fb9>18633\n<8fba>18631\n<8fbe>18630\n<8fbf>6377\n<8fc1>18317\n<8fc2>1302\n<8fc4>1305\n<8fc5>1304\n<8fc6>1303\n<8fc9>6376\n<8fca>18318\n<8fcb>6730\n<8fcc>18319\n<8fcd>6732\n<8fce>1678\n<8fd0>18606\n<8fd1>1680\n<8fd2>6729\n<8fd3>6731\n<8fd4>1679\n<8fd5>6734\n<8fd6>6733\n<8fd7>6735\n<8fda>16331\n<8fe0>7178\n<8fe1>7176\n<8fe2>2067\n<8fe3>7175\n<8fe4>2072\n<8fe5>2069\n<8fe6>2066\n<8fe8>2073\n<8fea>2068\n<8feb>2071\n<8fed>2070\n<8fee>7177\n<8ff0>2065\n<8ff4>2521\n<8ff5>7702\n<8ff6>7708\n<8ff7>2518\n<8ff8>2525\n<8ff9>14449\n<8ffa>2520\n<8ffb>7705\n<8ffc>7707\n<8ffd>2523\n<8ffe>7701\n<8fff>7704\n<9000>2519\n<9001>2516\n<9002>7703\n<9003>2522\n<9004>7706\n<9005>2524\n<9006>2517\n<9008>16096\n<900b>8321\n<900c>8324\n<900d>2998\n<900f>3008\n<9010>3004\n<9011>8322\n<9012>15950\n<9014>3012\n<9015>3005\n<9016>3010\n<9017>3000\n<9019>2997\n<901a>2999\n<901b>3011\n<901c>8323\n<901d>3003\n<901e>3006\n<901f>3002\n<9020>3007\n<9021>8325\n<9022>3009\n<9023>3001\n<9024>8320\n<902d>8991\n<902e>3458\n<902f>8993\n<9031>3460\n<9032>3462\n<9033>18320\n<9034>8992\n<9035>3459\n<9036>3463\n<9037>14454\n<9038>3461\n<903c>3899\n<903d>9670\n<903e>3907\n<903f>9667\n<9041>3908\n<9042>3897\n<9044>9668\n<9047>3902\n<9049>9669\n<904a>3895\n<904b>3894\n<904c>16144\n<904d>3905\n<904e>3904\n<904f>3903\n<9050>3901\n<9051>3906\n<9052>9666\n<9053>3896\n<9054>3898\n<9055>3900\n<9056>15826\n<9058>4292\n<9059>4295\n<905b>4299\n<905c>4293\n<905d>4298\n<905e>4296\n<9060>4291\n<9061>14457\n<9062>4297\n<9063>4294\n<9064>15464\n<9067>10879\n<9068>4681\n<9069>4679\n<906b>10880\n<906c>15712\n<906d>4682\n<906e>4680\n<906f>10878\n<9070>10877\n<9072>4976\n<9073>10876\n<9074>4974\n<9075>4973\n<9076>11445\n<9077>4683\n<9078>4975\n<9079>11446\n<907a>4978\n<907b>11447\n<907c>4977\n<907d>5267\n<907e>11902\n<907f>5266\n<9080>5271\n<9083>5434\n<9084>5268\n<9085>11901\n<9086>11448\n<9087>5433\n<9088>5435\n<908d>12871\n<908f>5900\n<9090>5899\n<9091>1307\n<9094>6174\n<9095>2526\n<9099>6170\n<909b>6173\n<909e>6381\n<909f>6378\n<90a0>6383\n<90a1>6379\n<90a2>1308\n<90a3>1311\n<90a5>6380\n<90a6>1310\n<90a7>6382\n<90a8>14460\n<90aa>1309\n<90ae>14464\n<90af>6738\n<90b0>6740\n<90b1>1683\n<90b2>6736\n<90b3>6739\n<90b4>6737\n<90b5>1681\n<90b6>1684\n<90b8>1682\n<90bb>15300\n<90bd>7180\n<90be>7184\n<90bf>7181\n<90c1>2076\n<90c3>2077\n<90c4>14462\n<90c5>7183\n<90c7>7185\n<90c8>7187\n<90ca>2074\n<90cb>7186\n<90ce>2075\n<90d4>8332\n<90d5>7182\n<90d6>7709\n<90d7>7718\n<90d8>7716\n<90db>7717\n<90dc>7719\n<90dd>2528\n<90df>7714\n<90e0>7710\n<90e1>2527\n<90e2>2529\n<90e3>7713\n<90e4>7720\n<90e5>7715\n<90e8>3013\n<90e9>8335\n<90ea>8327\n<90ed>3014\n<90ef>8326\n<90f0>8328\n<90f1>7179\n<90f4>8329\n<90f5>3465\n<90f9>9000\n<90fa>11449\n<90fb>9001\n<90fc>8998\n<90fd>3015\n<90fe>3467\n<90ff>8997\n<9100>9003\n<9101>9002\n<9102>3464\n<9103>9006\n<9104>8996\n<9105>9005\n<9106>8994\n<9107>9004\n<9108>8999\n<9109>3466\n<910b>9677\n<910d>9672\n<910e>9678\n<910f>9673\n<9110>9671\n<9111>9674\n<9112>3909\n<9114>9676\n<9116>9675\n<9117>3910\n<9118>4301\n<9119>4300\n<911a>10279\n<911b>10282\n<911c>10274\n<911d>10278\n<911e>4302\n<911f>10277\n<9120>10275\n<9121>10281\n<9122>10276\n<9123>10273\n<9124>10280\n<9126>10886\n<9127>4686\n<9128>12283\n<912b>10882\n<912c>8995\n<912d>4685\n<912e>10887\n<912f>10881\n<9130>4684\n<9131>4687\n<9132>10885\n<9133>11450\n<9134>4979\n<9138>11903\n<9139>5272\n<913e>12286\n<913f>12616\n<9140>12615\n<9141>12873\n<9143>12872\n<9146>13086\n<9147>13254\n<9148>5854\n<9149>1312\n<914a>2079\n<914b>2078\n<914c>2532\n<914d>2531\n<9150>7721\n<9151>16201\n<9152>2530\n<9153>8339\n<9155>8340\n<9156>8336\n<9157>3016\n<9158>8337\n<9159>16197\n<915a>8338\n<915c>16199\n<915e>17387\n<915f>9009\n<9160>9011\n<9161>9007\n<9162>9010\n<9163>3468\n<9164>9008\n<9165>3469\n<9167>14466\n<9168>9186\n<9169>3913\n<916a>3912\n<916c>3911\n<9170>16056\n<9172>10284\n<9173>10286\n<9174>4306\n<9175>4303\n<9176>16027\n<9177>4305\n<9178>4304\n<9179>10285\n<917a>10283\n<917c>16239\n<9180>10894\n<9183>4691\n<9184>10893\n<9187>4688\n<9189>4689\n<918a>10890\n<918b>4690\n<918c>17388\n<918d>11456\n<918e>16206\n<918f>11457\n<9192>4980\n<9193>11453\n<9199>11907\n<919a>11904\n<919b>11906\n<919c>5275\n<919d>11910\n<919e>5274\n<919f>11908\n<91a0>11911\n<91a1>11909\n<91a2>11905\n<91a3>5273\n<91a5>12288\n<91a7>12289\n<91a8>12287\n<91a9>14467\n<91aa>12291\n<91ad>12618\n<91ae>5596\n<91af>12290\n<91b0>12617\n<91b1>5595\n<91b4>5712\n<91b5>12875\n<91b6>17903\n<91b7>12874\n<91b9>13089\n<91ba>5784\n<91bb>15304\n<91bc>13382\n<91bd>13475\n<91be>13474\n<91c0>5936\n<91c1>5962\n<91c2>13476\n<91c3>13579\n<91c4>14468\n<91c5>5980\n<91c6>1313\n<91c7>1685\n<91c9>3914\n<91cb>5713\n<91cc>1314\n<91cd>2080\n<91ce>3017\n<91cf>3470\n<91d0>5438\n<91d1>1686\n<91d3>7189\n<91d4>7188\n<91d5>7724\n<91d6>16734\n<91d7>2535\n<91d8>2533\n<91d9>2537\n<91da>7726\n<91dc>2536\n<91dd>2534\n<91df>17722\n<91e2>7725\n<91e3>3020\n<91e4>8346\n<91e5>15366\n<91e6>3019\n<91e7>3021\n<91e8>8351\n<91e9>3023\n<91ec>8341\n<91ed>3022\n<91ee>8352\n<91f1>8343\n<91f3>8344\n<91f4>8342\n<91f5>3018\n<91f7>8350\n<91f8>8345\n<91f9>8347\n<91fa>15096\n<91fd>9023\n<91fe>14382\n<91ff>9022\n<9200>9020\n<9201>9012\n<9202>9027\n<9203>9015\n<9204>9025\n<9205>9032\n<9206>9024\n<9207>3478\n<9208>16057\n<9209>3474\n<920a>9013\n<920c>9019\n<920d>3476\n<920e>14472\n<920f>9018\n<9210>3477\n<9211>3479\n<9212>9021\n<9213>18323\n<9216>9033\n<9217>9031\n<9219>9030\n<921a>9016\n<921c>9028\n<921e>3475\n<9223>3473\n<9224>9029\n<9225>9014\n<9226>9017\n<9227>9026\n<9228>18325\n<922a>15374\n<922b>15270\n<922d>10321\n<922e>9690\n<9230>9683\n<9231>9702\n<9232>9711\n<9233>9686\n<9234>3925\n<9235>15142\n<9236>9699\n<9237>3915\n<9238>3917\n<9239>3929\n<923a>9684\n<923c>16850\n<923d>3918\n<923e>3920\n<923f>3930\n<9240>3919\n<9241>14474\n<9244>14490\n<9245>3928\n<9246>9692\n<9248>9681\n<9249>3926\n<924a>9691\n<924b>3922\n<924c>9709\n<924d>3927\n<924e>9707\n<924f>9695\n<9250>9705\n<9251>3924\n<9252>9682\n<9253>9708\n<9254>9703\n<9255>15943\n<9256>9710\n<9257>3916\n<9258>18326\n<925a>3931\n<925b>3921\n<925d>14851\n<925e>9688\n<925f>15584\n<9260>9696\n<9261>9700\n<9262>14475\n<9263>9704\n<9264>3923\n<9265>9687\n<9266>9685\n<9267>9697\n<926b>18327\n<926c>9694\n<926d>9693\n<926e>15621\n<926f>9698\n<9270>9701\n<9272>9706\n<9276>10289\n<9277>15460\n<9278>4307\n<9279>10299\n<927a>10291\n<927b>4313\n<927c>4317\n<927d>10308\n<927e>10316\n<927f>10301\n<9280>4309\n<9281>15873\n<9282>10305\n<9283>9689\n<9284>15545\n<9285>4310\n<9286>10312\n<9287>10317\n<9288>10309\n<9289>15029\n<928a>10311\n<928b>10320\n<928c>10313\n<928d>10295\n<928e>10304\n<928f>18109\n<9291>4318\n<9293>4314\n<9294>10293\n<9295>10306\n<9296>4312\n<9297>10300\n<9298>4311\n<9299>10314\n<929a>10297\n<929b>10290\n<929c>4315\n<929d>10319\n<92a0>10292\n<92a1>10310\n<92a2>10307\n<92a3>10302\n<92a4>10288\n<92a5>10287\n<92a6>10296\n<92a7>10315\n<92a8>4316\n<92a9>10318\n<92aa>10294\n<92ab>10298\n<92ac>4308\n<92ae>18329\n<92b1>18328\n<92b2>4703\n<92b3>4698\n<92b4>10928\n<92b5>10924\n<92b6>10900\n<92b7>4694\n<92b9>14057\n<92ba>15349\n<92bb>4693\n<92bc>4699\n<92be>15456\n<92bf>18330\n<92c0>10898\n<92c1>4697\n<92c2>10910\n<92c5>4692\n<92c6>10927\n<92c7>4701\n<92c8>10913\n<92c9>10918\n<92ca>10912\n<92cb>11475\n<92cc>10908\n<92cd>10916\n<92ce>10914\n<92cf>10901\n<92d0>10895\n<92d1>10922\n<92d2>4700\n<92d3>10923\n<92d4>14433\n<92d5>10917\n<92d7>10906\n<92d8>10904\n<92d9>10899\n<92db>16396\n<92dd>10907\n<92de>10920\n<92df>10903\n<92e0>10919\n<92e1>10925\n<92e3>18331\n<92e4>4696\n<92e5>15522\n<92e6>10915\n<92e7>10921\n<92e8>10911\n<92e9>10905\n<92ea>4695\n<92eb>18332\n<92ec>14692\n<92ee>10303\n<92ef>10909\n<92f0>4702\n<92f1>10902\n<92f2>15026\n<92f6>15364\n<92f7>11480\n<92f8>4983\n<92f9>11479\n<92fa>11477\n<92fb>11495\n<92fc>4987\n<92fd>18335\n<92fe>11492\n<92ff>11484\n<9300>11494\n<9301>11470\n<9302>11482\n<9303>14439\n<9304>4989\n<9306>11462\n<9307>15121\n<9308>11460\n<9309>11493\n<930b>11491\n<930c>11490\n<930d>11474\n<930e>11473\n<930f>11463\n<9310>4991\n<9312>11469\n<9313>11478\n<9314>11489\n<9315>4994\n<9316>11496\n<9318>5283\n<9319>4996\n<931a>4990\n<931b>11467\n<931d>11476\n<931e>11459\n<931f>11461\n<9320>4981\n<9321>4993\n<9322>4986\n<9323>11468\n<9324>11483\n<9325>10926\n<9326>4992\n<9327>11458\n<9328>5278\n<9329>11485\n<932a>11488\n<932b>4988\n<932c>14482\n<932d>11472\n<932e>4995\n<932f>4985\n<9330>15875\n<9331>15549\n<9333>4984\n<9334>11481\n<9335>11487\n<9336>4982\n<9338>11465\n<9339>11486\n<933c>11466\n<9340>16725\n<9341>17015\n<9342>15098\n<9343>18336\n<9344>16406\n<9345>15988\n<9346>11471\n<9347>11917\n<9348>15457\n<9349>11922\n<934a>5280\n<934b>5282\n<934c>11928\n<934d>5276\n<934e>11942\n<934f>11934\n<9352>11933\n<9354>5289\n<9355>11932\n<9356>11916\n<9357>11931\n<9358>11919\n<9359>11943\n<935a>5288\n<935b>5286\n<935c>11920\n<935e>11939\n<935f>15547\n<9360>11925\n<9361>11938\n<9362>17000\n<9363>11940\n<9364>11915\n<9365>5281\n<9366>18108\n<9367>11941\n<9368>15344\n<9369>14689\n<936a>11929\n<936b>14483\n<936c>5285\n<936d>11926\n<9370>5287\n<9371>11935\n<9373>14494\n<9374>15588\n<9375>5279\n<9376>11921\n<9377>11936\n<9378>14585\n<9379>11930\n<937a>11464\n<937b>11937\n<937c>11918\n<937d>15397\n<937e>5284\n<9380>12308\n<9381>14693\n<9382>5277\n<9383>11913\n<9384>18337\n<9385>17085\n<9386>15552\n<9387>15072\n<9388>12305\n<9389>12298\n<938a>5440\n<938c>12293\n<938d>12309\n<938e>12300\n<938f>11927\n<9390>15676\n<9391>12311\n<9392>12294\n<9394>5439\n<9395>12304\n<9396>5441\n<9397>5449\n<9398>5447\n<9399>12306\n<939a>5448\n<939b>12296\n<939c>14764\n<939d>12297\n<939e>12302\n<939f>12307\n<93a0>15025\n<93a1>11912\n<93a2>5442\n<93a3>12316\n<93a4>12313\n<93a5>12640\n<93a6>12303\n<93a7>12299\n<93a8>12314\n<93a9>12629\n<93aa>12301\n<93ac>5445\n<93ad>18338\n<93ae>5444\n<93af>11914\n<93b0>5446\n<93b1>12310\n<93b2>12312\n<93b3>5443\n<93b4>12315\n<93b5>12292\n<93b7>12295\n<93b8>15504\n<93ba>17399\n<93bb>15503\n<93bd>14887\n<93bf>15917\n<93c0>12638\n<93c2>12622\n<93c3>5600\n<93c4>12636\n<93c7>12620\n<93c8>5601\n<93ca>12631\n<93cb>14694\n<93cc>12627\n<93cd>5606\n<93ce>12637\n<93cf>12621\n<93d0>12624\n<93d1>5598\n<93d2>12639\n<93d3>16609\n<93d4>12632\n<93d5>12635\n<93d6>5604\n<93d7>5609\n<93d8>5607\n<93d9>12628\n<93da>12623\n<93db>15455\n<93de>12619\n<93df>5599\n<93e0>14880\n<93e1>5597\n<93e2>5605\n<93e3>12634\n<93e4>5608\n<93e6>12630\n<93e7>12641\n<93e8>5610\n<93ec>12626\n<93ee>12633\n<93f0>16959\n<93f1>17066\n<93f3>14690\n<93f5>12890\n<93f6>12905\n<93f7>12892\n<93f8>12899\n<93f9>12625\n<93fa>12897\n<93fb>12880\n<93fc>12903\n<93fd>5716\n<93fe>12884\n<93ff>12902\n<9400>12891\n<9401>15572\n<9403>5715\n<9404>15305\n<9406>12907\n<9407>12893\n<9408>14885\n<9409>12898\n<940a>12901\n<940b>12878\n<940c>12904\n<940d>12889\n<940e>12894\n<940f>12882\n<9410>12886\n<9411>12906\n<9412>12896\n<9413>12879\n<9414>12883\n<9415>12885\n<9416>12895\n<9417>18341\n<9418>5714\n<9419>12888\n<941b>16712\n<941d>18342\n<9420>12881\n<9424>14659\n<9425>14544\n<9426>14499\n<9427>15309\n<9428>12887\n<9429>13093\n<942a>13097\n<942b>5791\n<942c>13099\n<942d>18343\n<942e>5785\n<9430>13095\n<9431>13101\n<9432>5790\n<9433>5786\n<9435>5787\n<9436>13092\n<9437>13098\n<9438>5789\n<9439>13096\n<943a>5788\n<943b>13091\n<943c>12900\n<943d>13094\n<943e>18344\n<943f>13090\n<9440>13100\n<9442>17010\n<9443>17013\n<9444>5855\n<9445>13261\n<9446>13264\n<9447>13260\n<944c>13255\n<944d>15461\n<944f>13259\n<9450>13256\n<9454>18346\n<9455>13384\n<9457>13386\n<9458>15408\n<945b>14495\n<945d>13385\n<945e>13387\n<9460>5902\n<9462>13383\n<9463>5901\n<9464>5903\n<9465>15838\n<9467>15032\n<946a>5937\n<946b>13477\n<946c>14206\n<946d>13549\n<946e>13548\n<946f>13550\n<9470>5964\n<9471>13551\n<9472>5963\n<9473>13552\n<9474>13580\n<9475>13583\n<9476>13582\n<9477>5973\n<9478>13581\n<9479>18347\n<947b>16795\n<947c>5983\n<947f>5988\n<9482>13624\n<9483>13632\n<9485>17671\n<949f>18565\n<94a2>17691\n<94c1>18401\n<94c3>18399\n<94dc>18391\n<94f6>18386\n<952d>18348\n<9547>18623\n<9577>1687\n<9578>17672\n<957a>8353\n<957b>9034\n<957c>10929\n<957d>12642\n<957f>17673\n<9580>1688\n<9582>2081\n<9583>2538\n<9585>14497\n<9586>8354\n<9588>8355\n<9589>3024\n<958b>3482\n<958c>9036\n<958d>9035\n<958e>3486\n<958f>3481\n<9590>9037\n<9591>3483\n<9592>3485\n<9593>3484\n<9594>3480\n<9596>15317\n<9597>15316\n<9598>3932\n<9599>15314\n<959b>9715\n<959c>9713\n<959e>9714\n<959f>9712\n<95a0>14500\n<95a1>4319\n<95a2>18349\n<95a3>4322\n<95a4>4324\n<95a5>4323\n<95a6>14498\n<95a7>15315\n<95aa>17301\n<95ab>10931\n<95ac>10930\n<95ad>4704\n<95ae>10932\n<95b0>10933\n<95b1>4705\n<95b5>11504\n<95b6>11502\n<95b7>11949\n<95bb>4997\n<95bc>11497\n<95bd>11505\n<95be>11499\n<95bf>11503\n<95c0>11945\n<95c3>11947\n<95c5>11948\n<95c6>5294\n<95c7>11944\n<95c8>5293\n<95c9>11946\n<95cd>11498\n<95d0>5452\n<95d1>12319\n<95d4>5450\n<95d5>5453\n<95d6>5451\n<95dc>5611\n<95de>12908\n<95df>12910\n<95e0>12909\n<95e1>5717\n<95e2>5792\n<95e3>13104\n<95e4>13103\n<95e5>13102\n<95e8>17674\n<95f4>18351\n<961c>1689\n<961d>17689\n<961e>6068\n<9620>6177\n<9621>1044\n<9622>6175\n<9623>6178\n<9624>6176\n<9628>6385\n<962a>1318\n<962c>1319\n<962d>6387\n<962e>1316\n<962f>6386\n<9630>6384\n<9631>1317\n<9632>1315\n<9633>18352\n<9638>16337\n<9639>6741\n<963a>6744\n<963b>1692\n<963c>6743\n<963d>6742\n<963f>1691\n<9640>1690\n<9641>16189\n<9642>1694\n<9643>6745\n<9644>1693\n<9645>18290\n<964a>7194\n<964e>7195\n<964f>7191\n<9650>2082\n<9651>7192\n<9653>7193\n<9654>7190\n<9656>15847\n<9658>2545\n<965b>2542\n<965c>7727\n<965d>2543\n<965e>2546\n<965f>7728\n<9661>2541\n<9664>2544\n<9669>18270\n<966a>3025\n<966b>8358\n<966c>3033\n<966d>8357\n<966f>8360\n<9670>3029\n<9671>8359\n<9672>3494\n<9673>3027\n<9674>3030\n<9675>3026\n<9678>3028\n<967b>14508\n<967c>8356\n<967d>3490\n<967e>9039\n<9680>9043\n<9681>16198\n<9683>9042\n<9684>3495\n<9687>9038\n<968a>3487\n<968b>3489\n<968d>3493\n<968e>3488\n<968f>15326\n<9691>9718\n<9696>14509\n<9697>9719\n<9698>3933\n<9699>4325\n<969b>4327\n<969c>4326\n<969e>10322\n<96a1>10323\n<96a2>10935\n<96a3>14511\n<96a4>10934\n<96a5>17135\n<96a9>11506\n<96aa>5000\n<96ac>11952\n<96ae>11950\n<96b0>11951\n<96b1>5295\n<96b3>12320\n<96b4>5612\n<96b6>561\n<96b8>5296\n<96b9>1695\n<96bb>2547\n<96bc>7729\n<96bd>14517\n<96bf>8361\n<96c0>3034\n<96c1>3496\n<96c2>9044\n<96c3>9046\n<96c4>3498\n<96c5>3497\n<96c8>9045\n<96cb>3937\n<96cc>4328\n<96cd>3936\n<96ce>9720\n<96d2>4329\n<96d3>10936\n<96d4>11507\n<96d5>5001\n<96d6>5297\n<96d7>12321\n<96d8>12325\n<96d9>5456\n<96da>12322\n<96db>5457\n<96dc>5455\n<96dd>12326\n<96de>5458\n<96df>12324\n<96e1>12645\n<96e2>5454\n<96e3>5613\n<96e5>13480\n<96e8>1696\n<96e9>3036\n<96ea>3035\n<96ef>3501\n<96f0>9048\n<96f1>9047\n<96f2>3502\n<96f4>14852\n<96f5>9724\n<96f6>3943\n<96f7>3940\n<96f8>9723\n<96f9>3942\n<96fa>9721\n<96fb>3941\n<96fd>9722\n<96ff>10324\n<9700>4330\n<9702>10939\n<9703>16141\n<9704>4706\n<9705>10937\n<9708>10938\n<9709>4709\n<970b>11508\n<970d>5005\n<970e>5002\n<970f>5007\n<9710>11510\n<9711>5003\n<9712>11509\n<9713>5006\n<9716>5004\n<9718>11955\n<9719>11957\n<971b>14537\n<971c>5298\n<971d>11956\n<971e>5299\n<971f>11954\n<9720>11953\n<9721>16307\n<9722>12328\n<9723>12327\n<9724>5459\n<9725>12329\n<9726>12650\n<9727>5615\n<9728>12649\n<9729>12646\n<972a>5614\n<9730>5718\n<9731>14528\n<9732>5795\n<9735>13105\n<9736>14530\n<973a>13106\n<973f>13265\n<9740>18355\n<9741>15337\n<9742>5938\n<9743>13482\n<9744>5940\n<9746>13481\n<9747>13483\n<9748>5939\n<9749>13553\n<974b>13606\n<9751>17635\n<9752>1697\n<9756>3944\n<9757>14540\n<9758>10325\n<975a>10940\n<975e>1698\n<975f>14543\n<9760>4710\n<9761>5616\n<9762>2086\n<9766>5010\n<9768>5904\n<9769>2087\n<976a>8362\n<976c>9049\n<976d>16023\n<976e>9051\n<9770>9050\n<9772>9728\n<9773>9725\n<9774>3945\n<9776>3946\n<977a>10327\n<977b>10332\n<977c>4331\n<977d>10326\n<977e>10328\n<977f>10335\n<9780>10330\n<9781>10334\n<9782>10331\n<9783>10329\n<9784>10333\n<9785>4332\n<9787>16576\n<9788>10943\n<9789>14548\n<978a>10941\n<978b>4712\n<978d>4711\n<978e>10942\n<978f>4713\n<9794>11513\n<9797>11512\n<9798>5011\n<9799>11511\n<979a>11958\n<979b>15355\n<979c>11960\n<979d>11962\n<979e>11961\n<979f>14549\n<97a0>5300\n<97a1>11959\n<97a2>12336\n<97a3>5460\n<97a4>12334\n<97a5>12337\n<97a6>5461\n<97a8>12332\n<97aa>12335\n<97ab>12333\n<97ac>12330\n<97ad>5462\n<97ae>12331\n<97b1>14550\n<97b2>18357\n<97b3>12651\n<97b4>16179\n<97b6>12653\n<97b7>12652\n<97b8>15765\n<97b9>12913\n<97ba>16181\n<97bb>12914\n<97bd>18766\n<97be>14551\n<97bf>13107\n<97c0>14552\n<97c1>5861\n<97c2>18358\n<97c3>5860\n<97c6>5941\n<97c7>13484\n<97c8>16175\n<97c9>5974\n<97cb>2088\n<97cc>3503\n<97cd>10337\n<97ce>10336\n<97cf>10945\n<97d0>10944\n<97d2>14553\n<97d3>5301\n<97d4>11964\n<97d5>11963\n<97d6>12340\n<97d7>12338\n<97d8>12341\n<97d9>12339\n<97dc>5617\n<97e0>14554\n<97e1>13108\n<97e3>13266\n<97e5>13485\n<97e6>17676\n<97ed>2089\n<97ee>14556\n<97f0>11514\n<97f1>11965\n<97f2>14669\n<97f3>2090\n<97f5>14560\n<97f6>4333\n<97f8>11515\n<97f9>5463\n<97fa>12342\n<97fb>5618\n<97ff>5796\n<9800>13390\n<9801>2091\n<9804>8363\n<9807>9052\n<9808>3506\n<980a>3950\n<980c>3952\n<980f>9729\n<9812>3951\n<9813>3949\n<9814>18770\n<9815>17212\n<9816>10338\n<981b>10952\n<981c>4716\n<981d>10947\n<981e>10946\n<981f>15362\n<9820>10951\n<9821>4714\n<9823>15927\n<9824>5018\n<9826>10948\n<9827>10953\n<9828>10950\n<9829>10949\n<982b>4715\n<982d>5016\n<982e>16242\n<982f>11517\n<9830>5012\n<9832>11518\n<9833>14565\n<9834>14564\n<9835>11516\n<9837>5015\n<9838>5013\n<9839>5017\n<983b>5014\n<9841>11966\n<9843>11971\n<9844>11967\n<9845>11970\n<9846>5302\n<9847>15766\n<9848>11762\n<9849>11969\n<984a>11968\n<984b>14566\n<984c>5466\n<984d>5464\n<984e>5467\n<984f>5465\n<9853>5468\n<9857>12660\n<9858>5620\n<9859>12658\n<985b>5621\n<985c>12657\n<985d>12659\n<985e>5619\n<985f>12920\n<9860>12917\n<9864>13109\n<9865>5798\n<9866>14567\n<9867>5797\n<9869>13268\n<986a>13267\n<986b>5862\n<986c>16437\n<986f>5905\n<9870>5942\n<9871>5965\n<9872>13554\n<9875>17677\n<98a8>2092\n<98a9>9053\n<98ac>9732\n<98af>4336\n<98b1>4337\n<98b2>10954\n<98b3>4717\n<98b4>16243\n<98b6>5303\n<98b7>14575\n<98b8>12346\n<98b9>18360\n<98ba>5469\n<98bb>12663\n<98bc>5622\n<98bd>12662\n<98be>12664\n<98bf>12661\n<98c0>13112\n<98c3>15224\n<98c4>5719\n<98c6>13111\n<98c7>14577\n<98c8>14576\n<98c9>13110\n<98ca>14574\n<98cb>13269\n<98cc>13609\n<98ce>17678\n<98db>2093\n<98dc>15371\n<98de>17679\n<98df>2094\n<98e0>18322\n<98e1>14582\n<98e2>2548\n<98e3>7730\n<98e5>8364\n<98e6>14583\n<98e7>3507\n<98e9>3510\n<98ea>3508\n<98eb>9054\n<98ec>14584\n<98ed>3512\n<98ef>3509\n<98f1>18362\n<98f2>3511\n<98f4>3954\n<98f5>17253\n<98f6>9733\n<98f9>9734\n<98fa>10956\n<98fc>3953\n<9900>10342\n<9902>10341\n<9903>4338\n<9905>4339\n<9907>10343\n<9908>10955\n<9909>4341\n<990a>4718\n<990c>4340\n<990e>17389\n<9910>5019\n<9911>10957\n<9912>4720\n<9913>4719\n<9914>10958\n<9915>10961\n<9918>4721\n<9919>18364\n<991a>5024\n<991b>5022\n<991c>17390\n<991e>5021\n<991f>11520\n<9921>5023\n<9924>11519\n<9925>11972\n<9927>11521\n<9928>5020\n<9929>11522\n<992a>11975\n<992d>11979\n<992e>5473\n<992f>11978\n<9930>11981\n<9931>11980\n<9932>11977\n<9933>11976\n<9935>5304\n<9937>18365\n<9938>15357\n<9939>14586\n<993a>12349\n<993b>15377\n<993c>12348\n<993d>5472\n<9940>16180\n<9941>12347\n<9942>17407\n<9943>12667\n<9945>5623\n<9947>12666\n<9948>12665\n<9949>5624\n<994a>16313\n<994b>12927\n<994c>12926\n<994d>15378\n<994e>12924\n<9950>12923\n<9951>5721\n<9952>5720\n<9953>12928\n<9954>13270\n<9955>5863\n<9956>13114\n<9957>5799\n<9958>13113\n<9959>12925\n<995b>13271\n<995c>5906\n<995d>18366\n<995e>5966\n<995f>13555\n<9961>13610\n<9963>17680\n<9996>2095\n<9997>8365\n<9998>11982\n<9999>2096\n<999c>10345\n<999d>10344\n<999e>11523\n<99a1>11984\n<99a3>11983\n<99a4>16835\n<99a5>5474\n<99a8>5722\n<99aa>15383\n<99ab>13611\n<99ac>2549\n<99ad>3514\n<99ae>3513\n<99af>9735\n<99b0>9737\n<99b1>3958\n<99b2>9736\n<99b3>3957\n<99b4>3959\n<99b5>9738\n<99b8>14667\n<99b9>10347\n<99ba>10349\n<99bb>10348\n<99bc>15394\n<99bd>10351\n<99c1>4342\n<99c2>10350\n<99c3>10346\n<99c4>15735\n<99c5>18369\n<99c7>10352\n<99c9>10968\n<99cb>10971\n<99cc>10973\n<99cd>10963\n<99ce>10967\n<99cf>10964\n<99d0>4723\n<99d1>4726\n<99d2>4728\n<99d5>4727\n<99d6>10969\n<99d7>10972\n<99d8>10970\n<99d9>4729\n<99da>16194\n<99db>4725\n<99dc>10962\n<99dd>4722\n<99df>4724\n<99e1>14213\n<99e2>5026\n<99e3>11529\n<99e4>11527\n<99e5>11526\n<99e6>15205\n<99e7>11532\n<99e9>11531\n<99ea>11530\n<99ec>11525\n<99ed>5025\n<99ee>11524\n<99f0>11528\n<99f1>5027\n<99f4>11987\n<99f5>14591\n<99f6>11991\n<99f7>11988\n<99f8>11990\n<99f9>11989\n<99fa>11986\n<99fb>11992\n<99fc>11995\n<99ff>5306\n<9a01>5305\n<9a02>11985\n<9a03>11996\n<9a04>12354\n<9a05>12357\n<9a06>12359\n<9a07>12358\n<9a09>12352\n<9a0a>12356\n<9a0b>12351\n<9a0c>14592\n<9a0d>12353\n<9a0e>5475\n<9a0f>12350\n<9a10>14594\n<9a11>12355\n<9a14>12682\n<9a15>12671\n<9a16>5625\n<9a19>5626\n<9a1a>12670\n<9a1b>12675\n<9a1c>12681\n<9a1d>12673\n<9a1e>12680\n<9a1f>15212\n<9a20>12677\n<9a21>15388\n<9a22>12676\n<9a23>12679\n<9a24>12674\n<9a25>12672\n<9a26>15858\n<9a27>12678\n<9a29>12935\n<9a2a>12933\n<9a2b>5723\n<9a2c>12932\n<9a2d>12938\n<9a2e>12936\n<9a2f>15390\n<9a30>5724\n<9a31>12931\n<9a32>12929\n<9a34>12930\n<9a35>5726\n<9a36>12934\n<9a37>5725\n<9a38>12937\n<9a39>13115\n<9a3a>13121\n<9a3b>14593\n<9a3c>18371\n<9a3d>13116\n<9a3e>5803\n<9a3f>13122\n<9a40>5802\n<9a41>13120\n<9a42>13119\n<9a43>5801\n<9a44>13118\n<9a45>5800\n<9a46>13117\n<9a48>13277\n<9a49>13279\n<9a4a>13278\n<9a4c>13275\n<9a4d>5865\n<9a4e>13272\n<9a4f>13276\n<9a50>13281\n<9a52>13280\n<9a55>5864\n<9a56>13391\n<9a57>5909\n<9a58>14595\n<9a59>13392\n<9a5c>15384\n<9a5e>13486\n<9a5f>5943\n<9a60>13584\n<9a62>5975\n<9a63>15207\n<9a64>13612\n<9a65>5976\n<9a68>13628\n<9a69>13627\n<9a6a>5991\n<9a6b>13636\n<9a6c>17797\n<9a8f>17798\n<9aa8>2550\n<9aab>9740\n<9aad>9739\n<9ab1>10353\n<9ab2>17202\n<9ab3>10974\n<9ab4>11535\n<9ab7>4730\n<9ab8>5028\n<9ab9>11533\n<9aba>16244\n<9abb>11536\n<9abc>5029\n<9abd>15767\n<9abe>11997\n<9abf>11534\n<9ac0>12360\n<9ac1>5476\n<9ac2>12683\n<9ac6>12941\n<9ac7>12939\n<9aca>12940\n<9acd>13123\n<9acf>5804\n<9ad0>13282\n<9ad1>5912\n<9ad2>5866\n<9ad5>13487\n<9ad6>5967\n<9ad7>16298\n<9ad8>2551\n<9adc>12361\n<9adf>7731\n<9ae0>14600\n<9ae1>3960\n<9ae2>14601\n<9ae3>10354\n<9ae6>4345\n<9ae7>10355\n<9aeb>10976\n<9aec>10975\n<9aed>5031\n<9af1>10979\n<9af2>10978\n<9af3>10977\n<9af4>14603\n<9af6>11537\n<9af7>11540\n<9af9>11539\n<9afa>11538\n<9afb>5030\n<9afc>12001\n<9afd>11999\n<9afe>11998\n<9aff>16151\n<9b01>12000\n<9b02>16146\n<9b03>5477\n<9b06>5478\n<9b08>12362\n<9b09>16160\n<9b0a>12685\n<9b0b>12684\n<9b0c>12687\n<9b0d>5627\n<9b0e>12686\n<9b0f>18372\n<9b10>12942\n<9b11>12944\n<9b12>12943\n<9b14>14605\n<9b15>13124\n<9b16>13127\n<9b19>13283\n<9b1a>5867\n<9b22>5944\n<9b23>5968\n<9b24>13615\n<9b25>2552\n<9b27>4733\n<9b28>5032\n<9b29>12365\n<9b2a>16153\n<9b2b>13284\n<9b2d>14606\n<9b2e>13585\n<9b2f>7732\n<9b31>5992\n<9b32>2553\n<9b33>11541\n<9b34>14609\n<9b35>12366\n<9b37>12688\n<9b39>16128\n<9b3a>13128\n<9b3b>13285\n<9b3c>2554\n<9b40>14613\n<9b43>10981\n<9b44>4735\n<9b45>4734\n<9b46>10980\n<9b48>12002\n<9b4a>12367\n<9b4b>12369\n<9b4c>12368\n<9b4d>5481\n<9b4e>5480\n<9b4f>5479\n<9b50>14612\n<9b51>5806\n<9b52>13129\n<9b54>5805\n<9b55>13287\n<9b56>13286\n<9b58>5945\n<9b59>13488\n<9b5a>3041\n<9b5b>9741\n<9b5f>10360\n<9b64>10990\n<9b66>10985\n<9b67>10982\n<9b68>10989\n<9b69>18373\n<9b6c>10991\n<9b6f>4737\n<9b70>10988\n<9b71>10984\n<9b74>10983\n<9b75>10987\n<9b76>10986\n<9b77>4736\n<9b7a>11552\n<9b7b>11547\n<9b7c>11545\n<9b7d>11554\n<9b7e>11546\n<9b7f>15419\n<9b80>11542\n<9b81>17393\n<9b82>11548\n<9b83>16921\n<9b85>11543\n<9b86>12011\n<9b87>11544\n<9b88>11555\n<9b8b>16110\n<9b8d>17955\n<9b8e>14617\n<9b8f>16301\n<9b90>11551\n<9b91>5033\n<9b92>11550\n<9b93>11549\n<9b95>11553\n<9b97>16241\n<9b9a>12003\n<9b9b>12006\n<9b9d>16214\n<9b9e>12005\n<9b9f>15422\n<9ba0>12013\n<9ba1>12008\n<9ba2>12012\n<9ba4>12010\n<9ba5>12009\n<9ba6>12007\n<9ba8>12004\n<9baa>5309\n<9bab>5308\n<9bad>5310\n<9bae>5307\n<9baf>12014\n<9bb0>16308\n<9bb5>12375\n<9bb6>12378\n<9bb8>12376\n<9bb9>12380\n<9bbd>12381\n<9bbf>12373\n<9bc0>5486\n<9bc1>12374\n<9bc3>12372\n<9bc4>12379\n<9bc6>12371\n<9bc7>12370\n<9bc8>5485\n<9bc9>5483\n<9bca>5482\n<9bcf>15420\n<9bd3>12377\n<9bd4>12697\n<9bd5>12703\n<9bd6>5630\n<9bd7>12698\n<9bd9>12701\n<9bda>12705\n<9bdb>5631\n<9bdc>12700\n<9bdd>18374\n<9bde>12692\n<9be0>12691\n<9be1>12704\n<9be2>12695\n<9be4>12693\n<9be5>12702\n<9be6>12694\n<9be7>5629\n<9be8>5628\n<9be9>15297\n<9bec>12699\n<9bed>16087\n<9bf0>12696\n<9bf1>18375\n<9bf4>18376\n<9bf7>12947\n<9bf8>12950\n<9bfd>5484\n<9bff>14619\n<9c02>14618\n<9c05>12948\n<9c06>12954\n<9c07>12952\n<9c08>12946\n<9c09>12957\n<9c0a>16186\n<9c0b>12945\n<9c0c>14620\n<9c0d>5728\n<9c0e>12953\n<9c10>15418\n<9c12>12949\n<9c13>5727\n<9c14>12956\n<9c15>16158\n<9c17>12955\n<9c1b>18715\n<9c1c>13132\n<9c1d>13131\n<9c1f>17954\n<9c20>18378\n<9c21>13138\n<9c23>13134\n<9c24>13137\n<9c25>5808\n<9c26>17894\n<9c2b>13130\n<9c2c>13133\n<9c2d>5807\n<9c2e>16162\n<9c2f>15751\n<9c31>5869\n<9c32>13298\n<9c33>13293\n<9c34>13297\n<9c35>15417\n<9c36>13300\n<9c37>13296\n<9c39>13292\n<9c3a>15742\n<9c3b>5871\n<9c3c>13295\n<9c3d>13299\n<9c3e>5870\n<9c3f>13290\n<9c40>12951\n<9c41>13294\n<9c44>13291\n<9c45>15985\n<9c46>13288\n<9c48>13289\n<9c49>5868\n<9c4a>13399\n<9c4b>13401\n<9c4c>13404\n<9c4d>13400\n<9c4e>13405\n<9c4f>15414\n<9c50>13398\n<9c52>13396\n<9c53>15415\n<9c54>5913\n<9c55>13402\n<9c56>5915\n<9c57>5914\n<9c58>13397\n<9c59>13403\n<9c5d>16063\n<9c5e>13493\n<9c5f>5946\n<9c60>13494\n<9c62>13492\n<9c63>13489\n<9c66>13491\n<9c67>13490\n<9c68>13556\n<9c6d>13558\n<9c6e>13557\n<9c71>13588\n<9c72>16033\n<9c73>13587\n<9c74>13586\n<9c75>13589\n<9c79>13633\n<9c7a>13637\n<9c7b>15416\n<9c7c>17682\n<9ce5>3042\n<9ce6>9055\n<9ce7>9744\n<9ce9>3961\n<9cea>9742\n<9ced>9743\n<9cf3>4350\n<9cf4>4348\n<9cf5>10363\n<9cf6>4349\n<9cf7>10996\n<9cf9>10999\n<9cfa>10993\n<9cfb>11000\n<9cfc>10992\n<9cfd>10994\n<9cff>10995\n<9d00>10998\n<9d02>16187\n<9d03>4740\n<9d04>11003\n<9d05>11002\n<9d06>4738\n<9d07>10997\n<9d08>11001\n<9d09>4739\n<9d0c>15430\n<9d10>11565\n<9d12>5038\n<9d14>11560\n<9d15>5034\n<9d16>15484\n<9d17>11557\n<9d18>11563\n<9d19>11566\n<9d1b>5039\n<9d1d>11562\n<9d1e>11559\n<9d1f>11567\n<9d20>11558\n<9d21>15425\n<9d22>11564\n<9d23>5035\n<9d25>11556\n<9d26>5036\n<9d28>5037\n<9d29>11561\n<9d2d>12032\n<9d30>12023\n<9d31>12021\n<9d33>12015\n<9d34>16458\n<9d36>12018\n<9d37>12028\n<9d38>12022\n<9d39>14638\n<9d3b>5311\n<9d3d>12030\n<9d3e>12027\n<9d3f>5312\n<9d40>12029\n<9d41>12016\n<9d44>16299\n<9d45>12024\n<9d49>18381\n<9d4a>12385\n<9d4b>12387\n<9d4c>12390\n<9d4e>17721\n<9d4f>12384\n<9d50>16074\n<9d51>5487\n<9d52>12392\n<9d53>12383\n<9d54>12393\n<9d56>12389\n<9d57>12391\n<9d58>12395\n<9d59>12388\n<9d5a>12396\n<9d5b>12386\n<9d5c>12382\n<9d5d>5488\n<9d5e>15982\n<9d5f>12394\n<9d60>5489\n<9d61>5633\n<9d67>12017\n<9d68>12731\n<9d69>12722\n<9d6a>5635\n<9d6b>12718\n<9d6c>5636\n<9d6d>15276\n<9d6e>17211\n<9d6f>12727\n<9d70>12721\n<9d71>12711\n<9d72>5634\n<9d73>12724\n<9d77>12706\n<9d78>12713\n<9d79>12728\n<9d7b>12725\n<9d7c>16126\n<9d7d>12717\n<9d7e>14629\n<9d7f>12729\n<9d80>12712\n<9d81>12707\n<9d82>12726\n<9d83>14630\n<9d84>12709\n<9d85>12723\n<9d86>12714\n<9d87>12730\n<9d88>12710\n<9d89>5632\n<9d8a>12708\n<9d90>12964\n<9d92>12962\n<9d93>17395\n<9d94>12967\n<9d96>12979\n<9d97>12970\n<9d98>12963\n<9d99>12959\n<9d9a>12972\n<9d9b>12965\n<9d9c>12968\n<9d9d>12961\n<9d9e>12975\n<9d9f>12958\n<9da0>12966\n<9da1>12971\n<9da2>12973\n<9da3>12976\n<9da4>12960\n<9da5>15435\n<9da8>12974\n<9da9>12978\n<9daa>12969\n<9dab>16176\n<9dac>13154\n<9dad>13157\n<9daf>5809\n<9db1>13156\n<9db2>13161\n<9db3>13159\n<9db4>5810\n<9db5>13150\n<9db6>13140\n<9db7>13139\n<9db8>5812\n<9dbb>13149\n<9dbc>13141\n<9dbd>18384\n<9dbe>13146\n<9dbf>12977\n<9dc0>17394\n<9dc1>13142\n<9dc2>5811\n<9dc3>13148\n<9dc4>14633\n<9dc5>13147\n<9dc7>13143\n<9dc8>13155\n<9dc9>17785\n<9dca>13144\n<9dcb>13305\n<9dcc>13158\n<9dcd>13160\n<9dce>13151\n<9dcf>13145\n<9dd0>13306\n<9dd1>13308\n<9dd2>13302\n<9dd3>5872\n<9dd4>14622\n<9dd5>13315\n<9dd6>13313\n<9dd7>5873\n<9dd8>13312\n<9dd9>13311\n<9dda>13304\n<9ddb>13301\n<9ddc>13307\n<9ddd>13316\n<9dde>13303\n<9ddf>13309\n<9de1>13414\n<9de2>13419\n<9de3>13409\n<9de4>13412\n<9de5>5916\n<9de6>13416\n<9de8>13423\n<9de9>13310\n<9deb>13410\n<9dec>13420\n<9ded>13424\n<9dee>13415\n<9def>13408\n<9df0>13418\n<9df2>13417\n<9df3>13422\n<9df4>13421\n<9df5>13314\n<9df6>13413\n<9df7>13407\n<9df8>13411\n<9dfb>13406\n<9dfc>18385\n<9dfd>13505\n<9dfe>13496\n<9dff>13504\n<9e02>13495\n<9e03>13498\n<9e04>13506\n<9e05>13500\n<9e06>13499\n<9e07>13497\n<9e09>13503\n<9e0a>17790\n<9e0b>13559\n<9e0c>17786\n<9e0d>13560\n<9e0e>14632\n<9e0f>13562\n<9e10>13561\n<9e11>13564\n<9e12>13563\n<9e13>13591\n<9e14>13590\n<9e15>13616\n<9e17>13617\n<9e18>15428\n<9e19>13629\n<9e1a>5989\n<9e1b>5993\n<9e1c>16260\n<9e1d>13638\n<9e1e>5994\n<9e1f>17683\n<9e75>3043\n<9e79>5729\n<9e7a>13162\n<9e7b>17400\n<9e7f>3044\n<9e80>9745\n<9e81>16143\n<9e82>3962\n<9e83>11004\n<9e84>16246\n<9e85>16114\n<9e88>11568\n<9e89>12034\n<9e8a>12033\n<9e8b>5313\n<9e8c>12398\n<9e8d>12035\n<9e8e>12397\n<9e90>14641\n<9e91>12733\n<9e92>5637\n<9e93>5639\n<9e94>12732\n<9e95>14642\n<9e96>16316\n<9e97>5638\n<9e98>16167\n<9e99>12982\n<9e9a>12984\n<9e9b>12983\n<9e9c>13163\n<9e9d>5813\n<9e9e>14643\n<9e9f>5917\n<9ea0>13507\n<9ea1>13565\n<9ea2>14644\n<9ea4>13642\n<9ea5>3045\n<9ea6>18756\n<9ea7>10364\n<9ea8>16245\n<9ea9>4741\n<9eaa>14646\n<9eab>16018\n<9eac>17396\n<9ead>11572\n<9eae>11571\n<9eaf>14647\n<9eb0>12036\n<9eb1>18388\n<9eb4>5640\n<9eb5>5730\n<9eb6>13317\n<9eb7>13634\n<9ebb>3046\n<9ebc>4351\n<9ebd>18389\n<9ebe>4742\n<9ebf>15736\n<9ec0>12734\n<9ec1>14649\n<9ec2>13425\n<9ec3>3515\n<9ec4>17684\n<9ec6>18390\n<9ec7>17783\n<9ec8>12037\n<9ecc>5969\n<9ecd>3516\n<9ece>4743\n<9ecf>5314\n<9ed0>13426\n<9ed1>3517\n<9ed3>11005\n<9ed4>5041\n<9ed8>5040\n<9eda>12038\n<9edb>5318\n<9ede>5315\n<9edf>12399\n<9ee0>5490\n<9ee2>18392\n<9ee4>12986\n<9ee5>12985\n<9ee6>12988\n<9ee7>12987\n<9ee8>5731\n<9eeb>13164\n<9eed>13166\n<9eee>13165\n<9eef>5814\n<9ef0>13318\n<9ef1>18393\n<9ef4>5918\n<9ef5>13566\n<9ef6>13592\n<9ef7>5986\n<9ef8>18394\n<9ef9>9056\n<9efa>11575\n<9efb>12039\n<9efc>12735\n<9efd>9746\n<9efe>18382\n<9eff>12040\n<9f00>12401\n<9f01>12400\n<9f02>14656\n<9f06>13429\n<9f07>5951\n<9f08>14657\n<9f09>13567\n<9f0a>13593\n<9f0e>3963\n<9f12>11576\n<9f13>3964\n<9f15>5491\n<9f16>12402\n<9f17>14661\n<9f18>13168\n<9f19>5815\n<9f1a>13169\n<9f1b>13167\n<9f1c>13430\n<9f1e>13508\n<9f20>3965\n<9f22>12043\n<9f23>12042\n<9f24>12041\n<9f25>12403\n<9f26>16272\n<9f27>17952\n<9f28>12407\n<9f29>12406\n<9f2a>12405\n<9f2b>12404\n<9f2c>5492\n<9f2d>12736\n<9f2e>12990\n<9f2f>5732\n<9f30>12989\n<9f31>13170\n<9f32>13321\n<9f33>13320\n<9f34>5874\n<9f35>13319\n<9f36>13433\n<9f37>13432\n<9f38>13431\n<9f39>14663\n<9f3b>4352\n<9f3d>11577\n<9f3e>5319\n<9f42>13322\n<9f43>13434\n<9f44>18395\n<9f45>14666\n<9f46>13509\n<9f47>13568\n<9f48>13618\n<9f49>13644\n<9f4a>4353\n<9f4b>5320\n<9f4c>12408\n<9f4d>12739\n<9f4e>13171\n<9f4f>13435\n<9f50>18755\n<9f52>4745\n<9f53>16256\n<9f54>12044\n<9f55>12409\n<9f59>12995\n<9f5a>16163\n<9f5b>12991\n<9f5c>5816\n<9f5d>12994\n<9f5e>12993\n<9f5f>5733\n<9f60>12992\n<9f61>5735\n<9f63>5734\n<9f64>13173\n<9f65>13172\n<9f69>14672\n<9f6a>5876\n<9f6b>13323\n<9f6c>5875\n<9f70>13437\n<9f71>13436\n<9f72>5953\n<9f77>5952\n<9f78>13569\n<9f79>13572\n<9f7a>13571\n<9f7b>13570\n<9f7e>13643\n<9f7f>18048\n<9f8d>5042\n<9f8e>14674\n<9f90>5500\n<9f91>12996\n<9f92>13174\n<9f94>5877\n<9f95>13324\n<9f98>13645\n<9f99>17799\n<9f9c>5043\n<9f9f>17990\n<9fa0>12045\n<9fa2>13325\n<9fa4>13594\n<9fa5>16240\n<e000>16395\n<e00c>16407\n<e00e>16409\n<e018>16419\n<e020>16427\n<e025>16432\n<e030>16443\n<e045>16464\n<e04c>16471\n<e05a>16485\n<e05c>16487\n<e064>16495\n<e066>16497\n<e06c>16503\n<e071>16508\n<e078>16515\n<e07d>16520\n<e087>16530\n<e08c>16535\n<e0a9>16564\n<e0ab>16566\n<e0ae>16569\n<e0ba>16581\n<e0bc>16583\n<e0be>16585\n<e0c3>16590\n<e0c5>16592\n<e0ca>16597\n<e0d0>16603\n<e0dc>16615\n<e0df>16618\n<e0ee>16633\n<e0f2>16637\n<e0fb>16645\n<e0fd>16647\n<e103>16653\n<e106>16656\n<e110>16665\n<e121>16682\n<e136>16703\n<e139>16706\n<e145>16717\n<e14a>16721\n<e14d>16723\n<e150>16726\n<e15d>18767\n<e162>16743\n<e175>16761\n<e185>16777\n<e187>16779\n<e189>16781\n<e18b>16783\n<e193>16790\n<e195>18771\n<e196>16792\n<e1a4>18772\n<e1a6>16808\n<e1aa>16812\n<e1ae>16816\n<e1b6>16824\n<e1b8>16826\n<e1bb>18773\n<e1c1>16834\n<e1c8>16840\n<e1d7>16855\n<e1da>16858\n<e1dd>16861\n<e1e2>16865\n<e1e6>16869\n<e1eb>16874\n<e1f2>16881\n<e1f7>16886\n<e1fa>16889\n<e1fe>16893\n<e200>16895\n<e201>18776\n<e202>16897\n<e205>16900\n<e207>16902\n<e210>16911\n<e219>16920\n<e22a>16937\n<e22f>16942\n<e231>16944\n<e233>16946\n<e237>16950\n<e23b>16954\n<e245>16964\n<e248>16967\n<e261>16992\n<e268>16998\n<e26b>17001\n<e271>17007\n<e27a>17016\n<e27d>17019\n<e282>17024\n<e28b>17033\n<e29f>17053\n<e2a1>18779\n<e2a4>17057\n<e2a6>17059\n<e2ba>17078\n<e2c1>17084\n<e2c7>17090\n<e2c9>17092\n<e2d4>17103\n<e2de>17113\n<e2e7>17122\n<e2e9>17124\n<e2f8>17137\n<e2fc>17141\n<e301>17144\n<e306>17149\n<e308>17151\n<e30c>17155\n<e30f>17158\n<e311>14123\n<e313>14125\n<e315>14127\n<e318>14129\n<e31f>14136\n<e325>14142\n<e32c>14149\n<e33b>14164\n<e33d>18074\n<e342>14170\n<e345>14173\n<e348>14175\n<e352>14184\n<e354>14186\n<e360>14197\n<e362>14199\n<e36f>14212\n<e372>14215\n<e377>14220\n<e379>14221\n<e37b>14223\n<e386>14234\n<e38d>14241\n<e391>14245\n<e393>14247\n<e394>18080\n<e396>14249\n<e398>14251\n<e39e>18081\n<e3a2>14260\n<e3a5>18082\n<e3ac>14270\n<e3c3>14293\n<e3c8>14297\n<e3cc>14301\n<e3cd>18084\n<e3cf>14303\n<e3d5>18085\n<e3e1>14320\n<e3e3>14322\n<e3e7>18086\n<e3f0>14335\n<e3f8>14343\n<e3fa>14345\n<e3fd>14348\n<e3ff>14350\n<e414>14369\n<e41b>14376\n<e423>14384\n<e425>14386\n<e426>18091\n<e428>14388\n<e432>14398\n<e436>14402\n<e43e>14410\n<e444>14416\n<e448>18093\n<e465>14448\n<e46a>14451\n<e46c>14453\n<e474>14461\n<e476>14463\n<e484>14476\n<e4a1>18100\n<e4ab>14512\n<e4af>14516\n<e4c1>14534\n<e4c6>14539\n<e4c9>14542\n<e4d6>14555\n<e4d9>14558\n<e4e4>14569\n<e4f6>14587\n<e4ff>14596\n<e505>14602\n<e50a>14607\n<e50d>18101\n<e50f>14611\n<e512>14614\n<e514>14616\n<e516>18102\n<e51a>14621\n<e524>14631\n<e528>18104\n<e537>14648\n<e53e>14655\n<e543>14660\n<e54b>14668\n<e562>14691\n<e570>14705\n<e580>14721\n<e588>14729\n<e59a>14747\n<e5a4>14757\n<e5aa>14763\n<e5af>14768\n<e5b1>14770\n<e5b2>18107\n<e5b5>14774\n<e5c2>14787\n<e5df>14812\n<e5e9>14822\n<e5f3>14832\n<e600>14845\n<e602>14847\n<e604>14849\n<e621>14876\n<e627>14882\n<e62b>14886\n<e63a>14901\n<e63c>14903\n<e648>14915\n<e64b>14917\n<e66a>18111\n<e671>14954\n<e692>14986\n<e69c>14996\n<e6a6>15005\n<e6b2>15016\n<e6c5>18116\n<e6c7>15036\n<e6ca>15039\n<e6ee>15075\n<e6f7>15084\n<e6ff>15092\n<e70c>15105\n<e713>15112\n<e71d>15122\n<e72b>15136\n<e72f>15140\n<e744>15161\n<e747>15164\n<e75f>15188\n<e769>18119\n<e770>15204\n<e775>15209\n<e77a>15213\n<e784>15223\n<e786>15225\n<e789>15228\n<e78b>15230\n<e78d>15232\n<e790>15235\n<e792>15237\n<e794>15239\n<e799>15244\n<e7a2>15253\n<e7b1>15268\n<e7b4>15271\n<e7b8>15275\n<e7bc>15279\n<e7c4>15286\n<e7ca>15292\n<e7ce>15296\n<e7d1>15299\n<e7d8>15306\n<e7da>15308\n<e7e4>15318\n<e7eb>15325\n<e7f8>15338\n<e808>15354\n<e80c>15358\n<e811>15363\n<e813>15365\n<e81a>15372\n<e821>15379\n<e82d>15391\n<e82f>15393\n<e835>15399\n<e84b>15421\n<e851>15427\n<e86c>15453\n<e871>15458\n<e878>15465\n<e887>15480\n<e88f>15488\n<e89a>15499\n<e89d>15502\n<e8b8>15529\n<e8c5>15542\n<e8c7>15544\n<e8cb>15548\n<e8d3>15556\n<e8dd>15566\n<e8ed>15582\n<e8f5>15590\n<e8fb>15596\n<e8fe>15599\n<e900>15601\n<e903>15604\n<e90c>15613\n<e91c>15629\n<e938>18127\n<e93a>15659\n<e941>15666\n<e948>15673\n<e94d>15678\n<e950>15681\n<e95a>15691\n<e964>15701\n<e967>15704\n<e968>18129\n<e973>18138\n<e974>15707\n<e975>18139\n<e97d>18147\n<e987>15709\n<e98a>15710\n<e98e>15711\n<e991>18159\n<e9b0>17364\n<e9cb>18201\n<e9ef>18228\n<ea43>18297\n<eaa9>18380\n<eac5>18400\n<eadc>18419\n<eaee>18432\n<eaf4>17328\n<eaf8>18439\n<eaf9>17330\n<eb15>18462\n<eb23>18474\n<eb25>18475\n<eb27>18476\n<eb2a>18477\n<eb3d>15771\n<eb41>15773\n<eb46>15776\n<eb4a>18497\n<eb53>18500\n<eb54>15785\n<eb57>15786\n<eb5d>15790\n<eb5f>15792\n<eb61>15794\n<eb65>18508\n<eb67>18509\n<eb6b>15799\n<eb6d>15801\n<eb73>18513\n<eb74>15804\n<eb76>17360\n<eb77>18515\n<eb78>15805\n<eb7a>18516\n<eb85>15812\n<eb88>18522\n<eb89>15814\n<eb8a>18523\n<eb8f>15816\n<eb90>18527\n<eb93>15819\n<eb95>18528\n<eb97>15822\n<eb9b>15823\n<eb9f>18534\n<eba0>15825\n<eba2>18535\n<eba3>15827\n<eba8>15830\n<ebaa>18538\n<ebab>15832\n<ebad>15834\n<ebae>18539\n<ebaf>15835\n<ebb0>18540\n<ebb4>15837\n<ebb6>15839\n<ebb9>15842\n<ebbc>15844\n<ebbd>18544\n<ebbf>15846\n<ebc2>15849\n<ebc7>15851\n<ebc8>18548\n<ebca>18549\n<ebce>18550\n<ebd0>18551\n<ebd3>18552\n<ebd5>18553\n<ebdd>15864\n<ebdf>18556\n<ebe1>18557\n<ebe4>18558\n<ebe7>15871\n<ebee>15874\n<ebef>18563\n<ebf1>18564\n<ebf2>15876\n<ebf5>18566\n<ebf6>15878\n<ec0c>15896\n<ec13>18571\n<ec14>15903\n<ec1d>15908\n<ec20>18576\n<ec22>15912\n<ec24>15914\n<ec26>15916\n<ec2a>15920\n<ec2b>18577\n<ec2f>18578\n<ec31>15925\n<ec32>18579\n<ec35>15928\n<ec37>15930\n<ec42>15938\n<ec43>18583\n<ec44>17384\n<ec4f>18592\n<ec52>18593\n<ec54>18594\n<ec5a>18598\n<ec67>18607\n<ec68>15949\n<ec79>18624\n<ec7b>18626\n<ec7e>18627\n<ec80>18629\n<ec84>18632\n<ec86>18634\n<ec8d>18636\n<ec8e>15957\n<ec91>18638\n<ec92>15960\n<ec95>15961\n<ec96>18641\n<ec98>18642\n<ec99>15963\n<ec9d>18646\n<ec9e>15964\n<eca0>18647\n<ecab>18652\n<ecad>18653\n<ecaf>15973\n<ecb4>18655\n<ecb6>15979\n<eccf>16000\n<ecd4>16005\n<ecde>18660\n<ece5>16021\n<ecf0>16032\n<ecf2>16034\n<ecf5>16037\n<ecfc>16044\n<ed04>18663\n<ed07>18664\n<ed0a>18666\n<ed13>18673\n<ed18>16058\n<ed1a>18677\n<ed1c>18678\n<ed1d>16061\n<ed1e>18679\n<ed22>18680\n<ed29>16069\n<ed2a>18683\n<ed2c>16071\n<ed2d>18684\n<ed3b>16079\n<ed3d>18692\n<ed45>18696\n<ed47>16085\n<ed4f>16090\n<ed51>18701\n<ed52>16092\n<ed5f>16101\n<ed62>16104\n<ed6b>16113\n<ed71>18706\n<ed72>16119\n<ed75>18707\n<ed77>18709\n<ed78>16122\n<ed7a>18710\n<ed81>18711\n<ed86>18712\n<ed88>16135\n<ed8b>16136\n<ed8e>16139\n<ed91>16142\n<eda6>18716\n<edc6>16193\n<edcf>16202\n<edd1>18718\n<edd7>18719\n<edda>16211\n<eddb>18720\n<eddd>18721\n<ede1>16216\n<eded>16228\n<ee08>16254\n<ee11>16263\n<ee15>18725\n<ee1b>18726\n<ee20>16276\n<ee22>18727\n<ee2a>16285\n<ee30>18728\n<ee31>16291\n<ee34>16294\n<ee48>18729\n<ee56>18730\n<ee5b>18731\n<ee5d>16332\n<ee60>18732\n<ee64>16338\n<ee6a>16344\n<ee76>16356\n<ee7c>16362\n<ee7e>18733\n<ee91>16381\n<ee9c>18735\n<eea7>17332\n<eeb4>18754\n<eeb7>18757\n<f325>18797\n<f327>18799\n<f344>18828\n<f346>18830\n<f3ac>17723\n<f3f0>17781\n<f3fc>17791\n<f43d>17845\n<f444>17167\n<f446>17169\n<f44b>17174\n<f44d>17176\n<f457>17847\n<f45a>17189\n<f45b>17848\n<f469>17204\n<f46e>17849\n<f46f>17210\n<f474>17850\n<f477>17851\n<f478>17219\n<f479>17852\n<f47b>17853\n<f483>17854\n<f488>17235\n<f48b>17238\n<f491>17855\n<f49b>17254\n<f49e>17257\n<f4a7>17857\n<f4ad>17272\n<f4b2>17859\n<f4b7>17282\n<f4c1>17860\n<f4d7>17880\n<f4df>17294\n<f4e0>17886\n<f4e2>17887\n<f4e3>17296\n<f4e4>17888\n<f4e5>17297\n<f4e6>17889\n<f4ef>17893\n<f4f2>17303\n<f4f3>17896\n<f4f8>17899\n<f4fc>17902\n<f503>17908\n<f505>17910\n<f52a>17947\n<f53d>17636\n<f54e>17653\n<f553>17658\n<f556>17660\n<f55e>17668\n<f565>17675\n<f56b>17681\n<f572>17688\n<f694>18044\n<f69e>18054\n<f6ad>18068\n<f6b0>18071\n<f7e8>14002\n<fa0c>628\n<fa0d>9089\n<fe30>109\n<fe31>122\n<fe33>13743\n<fe34>13745\n<fe4f>13746\n<fe50>112\n<fe52>114\n<ff01>108\n<ff02>14052\n<ff03>174\n<ff04>259\n<ff05>264\n<ff06>175\n<ff07>14051\n<ff0a>176\n<ff0b>208\n<ff0c>100\n<ff0d>209\n<ff0e>103\n<ff0f>257\n<ff1a>106\n<ff1b>105\n<ff1c>214\n<ff1d>216\n<ff1e>215\n<ff1f>107\n<ff20>265\n<ff3b>13758\n<ff3c>258\n<ff3d>13759\n<ff3e>13748\n<ff3f>197\n<ff5b>132\n<ff5c>120\n<ff5d>133\n<ff64>113\n<ffe2>14049\n<ffe4>14050\nendcidchar\nbegincidrange\n<20><7e>1\n<a2><a3>262\n<0391><03a1>417\n<03a3><03a9>434\n<03b1><03c1>441\n<03c3><03c9>458\n<0410><0415>13930\n<0416><0435>13937\n<0436><044f>13970\n<2018><2019>166\n<201c><201d>168\n<2160><2169>343\n<2170><2179>526\n<2196><2197>249\n<21b8><21b9>13997\n<2229><222a>229\n<2266><2267>217\n<2400><241f>562\n<2460><2469>506\n<2474><247d>516\n<256d><256e>318\n<2571><2573>330\n<2581><2588>290\n<25e2><25e3>326\n<2e86><2e88>17693\n<2e8c><2e8d>17697\n<2ecc><2ecd>17710\n<2ed6><2ed7>17713\n<3001><3002>101\n<3005><3007>13754\n<3008><3009>148\n<300a><300b>144\n<300c><300d>152\n<300e><300f>156\n<3010><3011>140\n<3014><3015>136\n<301d><301e>170\n<3021><3029>353\n<3041><3093>13761\n<309b><309c>17606\n<309d><309e>13751\n<30a1><30f6>13844\n<30fd><30fe>13749\n<3105><3129>465\n<338e><338f>277\n<339c><339e>272\n<4e1e><4e1f>878\n<4e52><4e53>880\n<4e83><4e84>9057\n<4eab><4eac>1326\n<4ead><4eae>1700\n<4ec6><4ec7>675\n<4eca><4ecb>678\n<4ed4><4ed7>762\n<4ee3><4ee4>766\n<4f10><4f11>893\n<4f50><4f51>1056\n<4ff6><4ff7>7208\n<500c><500d>2099\n<5063><5064>7754\n<50b2><50b3>3521\n<5106><5107>10369\n<5108><5109>4360\n<510b><510c>10373\n<512d><512e>12047\n<5134><5135>12410\n<5137><5138>5736\n<516d><516e>684\n<5189><518a>772\n<51a4><51a5>2131\n<51b6><51b7>1079\n<51c4><51c5>7222\n<51f9><51fa>775\n<5200><5201>608\n<5206><5208>689\n<5211><5212>913\n<5229><522a>1083\n<5232><5233>6420\n<525e><525f>7229\n<5274><5275>3059\n<527b><527c>9080\n<5280><5281>9763\n<5287><5289>4364\n<528b><528c>10377\n<52a9><52aa>1087\n<52ad><52ae>6200\n<52e2><52e3>3536\n<52fe><52ff>693\n<5305><5306>781\n<530a><530b>6425\n<533f><5340>2587\n<5370><5371>921\n<5377><5379>1372\n<538e><538f>6205\n<5435><5436>1112\n<54c5><54c6>6786\n<54f7><54f8>7253\n<5575><5576>7771\n<55c5><55c6>3552\n<55e3><55e4>3547\n<560d><560e>3992\n<562f><5630>4383\n<568c><568d>11586\n<56a6><56a7>12417\n<56bd><56be>13002\n<5701><5702>7259\n<5703><5704>2169\n<5712><5713>3556\n<5722><5723>6042\n<5773><5774>6463\n<579e><579f>6797\n<5830><5831>3099\n<58de><58df>5496\n<58f9><58fa>3104\n<5919><591a>948\n<5937><5938>950\n<5947><5948>1411\n<5957><5958>2177\n<5a2d><5a2e>7280\n<5b3d><5b3f>12425\n<5b4b><5b4c>13180\n<5b50><5b51>639\n<5b57><5b58>959\n<5b5a><5b5b>1151\n<5b87><5b88>961\n<5b9e><5b9f>17743\n<5bd8><5bd9>9144\n<5be5><5be6>4027\n<5bf1><5bf2>11609\n<5c0a><5c0b>3119\n<5c40><5c41>1157\n<5c45><5c46>1442\n<5c4e><5c4f>1799\n<5c5c><5c5d>2652\n<5c64><5c65>4404\n<5c69><5c6a>12057\n<5c7a><5c7b>6112\n<5c90><5c91>1161\n<5cd3><5cd4>6849\n<5dc6><5dc7>12749\n<5df1><5df3>649\n<5e02><5e03>825\n<5e21><5e23>6858\n<5e58><5e59>9842\n<5e67><5e68>11062\n<5e6d><5e6e>12060\n<5e95><5e96>1461\n<5eb2><5eb3>7889\n<5eb7><5eb8>2672\n<5ec1><5ec2>3133\n<5eee><5eef>12751\n<5f14><5f15>718\n<5f22><5f24>6515\n<5f26><5f27>1464\n<5f80><5f81>1467\n<5f8a><5f8b>1818\n<5fa9><5faa>3138\n<5fc0><5fc1>12753\n<60d3><60d4>7902\n<6149><614a>9173\n<6152><6153>9864\n<6162><6163>4052\n<61ed><61ee>12064\n<6203><6204>13336\n<620c><620d>977\n<621a><621b>2711\n<6221><6222>3610\n<6242><6243>6892\n<6253><6254>834\n<628e><628f>6288\n<62d3><62d4>1503\n<62d6><62d7>1518\n<6313><6314>6907\n<632a><632b>2257\n<6344><6345>7334\n<63ed><63ee>3175\n<6416><6417>3624\n<6422><6423>9205\n<6472><6473>9887\n<64bb><64bc>4795\n<64fa><64fb>5334\n<6548><6549>2262\n<6562><6563>3186\n<6577><6578>4463\n<6582><6583>5089\n<659d><659e>8564\n<65b2><65b3>10485\n<65c3><65c4>7361\n<65cb><65cc>2757\n<65ec><65ed>986\n<6687><6688>3632\n<66ca><66cb>11104\n<66da><66db>12081\n<66e3><66e4>12762\n<66ed><66ee>13445\n<66f2><66f3>988\n<66fe><66ff>3200\n<670f><6710>6931\n<6712><6713>7368\n<6714><6715>2276\n<672a><672b>842\n<674e><6751>1213\n<676f><6770>1550\n<6778><6779>6598\n<67c9><67ca>6968\n<6832><6833>7373\n<686d><686e>7961\n<68dd><68de>8615\n<6948><6949>9252\n<6a4d><6a4e>11141\n<6aae><6aaf>5346\n<6ab6><6ab7>12090\n<6aee><6aef>12770\n<6b08><6b09>13190\n<6b11><6b12>13342\n<6b18><6b19>13516\n<6b37><6b38>7997\n<6b66><6b67>1563\n<6b8d><6b8e>8001\n<6b9e><6ba0>9957\n<6baa><6bab>11148\n<6bc3><6bc4>9960\n<6bc5><6bc6>4487\n<6beb><6bec>2793\n<6bf2><6bf3>8636\n<6bf7><6bf8>9292\n<6bfb><6bfc>9289\n<6c19><6c1a>6318\n<6c20><6c21>6980\n<6c27><6c28>2307\n<6c2e><6c2f>3234\n<6c4b><6c4c>6152\n<6c4d><6c4e>1008\n<6c5f><6c60>1002\n<6c88><6c89>1231\n<6cbd><6cbe>1575\n<6d3d><6d3e>1915\n<6d63><6d64>7414\n<6ddc><6ddd>8023\n<6e35><6e36>8684\n<6e3c><6e3d>8645\n<6e46><6e47>8640\n<6e93><6e94>9300\n<6ee8><6ee9>18049\n<6f19><6f1a>9974\n<6fdf><6fe0>5110\n<6fff><7000>12105\n<700c><700d>12099\n<7021><7023>12463\n<7043><7044>13016\n<7045><7046>13021\n<7048><7049>13019\n<7055><7057>13193\n<7069><706a>13639\n<707c><707d>1255\n<70b4><70b5>7019\n<70c5><70c7>7463\n<70d5><70d6>16985\n<7109><710a>2835\n<7119><711a>3272\n<71c0><71c1>11189\n<71c3><71c4>4855\n<71da><71db>11200\n<71fb><71fc>5358\n<7213><7214>12788\n<721e><721f>13197\n<722c><722d>1605\n<7249><724a>7023\n<727b><727c>8065\n<7288><7289>8703\n<729d><729e>11202\n<72a5><72a6>12475\n<72b4><72b5>6156\n<72e0><72e1>1942\n<735e><7360>10602\n<7366><7367>11205\n<736e><736f>11683\n<7393><7394>6351\n<73d7><73d8>7495\n<741e><741f>18164\n<7435><7436>3292\n<744a><744b>9371\n<744f><7450>9377\n<745b><745c>3715\n<7489><748a>10612\n<74de><74df>7498\n<74f4><74f5>7500\n<74f6><74f7>2855\n<7502><7503>10035\n<750c><750d>4864\n<7510><7512>11694\n<7525><7526>3299\n<7528><7529>860\n<7530><7533>862\n<7537><7538>1266\n<753f><7540>6671\n<7547><7548>7057\n<7565><7566>2859\n<7594><7595>6356\n<7599><759a>1623\n<75a2><75a3>1960\n<75a4><75a5>1958\n<75b2><75b3>2361\n<75cb><75cc>8099\n<75d4><75d5>2864\n<7621><7622>4529\n<7648><7649>11700\n<7671><7672>5923\n<767b><767c>3310\n<7686><7688>1963\n<769c><769e>10633\n<76cd><76ce>2371\n<76de><76df>3728\n<7703><7705>7064\n<770e><770f>15106\n<7719><771a>7523\n<771f><7720>2374\n<7731><7732>8109\n<7746><7747>8751\n<774b><774c>8758\n<775f><7760>9410\n<779e><779f>4872\n<77a2><77a3>11236\n<77bb><77bc>5372\n<77c9><77ca>12486\n<77ce><77cf>12799\n<77d8><77d9>13523\n<77e7><77e8>7071\n<780c><780d>1981\n<7811><7812>7074\n<7864><7865>8763\n<7885><7886>9427\n<7897><7898>3745\n<78c3><78c4>10649\n<78df><78e0>11251\n<78e1><78e2>11248\n<78fb><78fc>11717\n<7913><7914>12141\n<7927><7928>12805\n<7940><7941>1632\n<7969><796a>8128\n<798a><798b>10070\n<798e><798f>4164\n<79b9><79ba>1987\n<79d1><79d2>1989\n<79eb><79ec>7547\n<79f6><79f7>8136\n<7a18><7a19>9441\n<7a4d><7a4e>4880\n<7a61><7a62>5376\n<7a67><7a68>12497\n<7a6c><7a6d>12811\n<7a70><7a71>13209\n<7a8b><7a8c>7559\n<7a9f><7aa0>3764\n<7aab><7aac>10087\n<7ac0><7ac1>11734\n<7ac2><7ac3>14139\n<7ac4><7ac5>5379\n<7b00><7b01>7096\n<7bc6><7bc7>4559\n<7bf0><7bf1>11753\n<7c3e><7c3f>5539\n<7c78><7c79>7099\n<7c7f><7c81>7101\n<7cbd><7cbe>4185\n<7cd0><7cd1>11281\n<7cd5><7cd6>4894\n<7cef><7cf0>5677\n<7d3e><7d3f>8174\n<7dbd><7dbe>4190\n<7dcb><7dcc>10122\n<7e1f><7e20>11287\n<7e54><7e55>5388\n<7e69><7e6a>5548\n<7e87><7e88>13037\n<7f3e><7f3f>8817\n<7f40><7f41>14208\n<7f65><7f66>8819\n<7f67><7f68>9489\n<7f69><7f6a>3781\n<7f7b><7f7c>11303\n<7f9c><7f9d>8181\n<7fa0><7fa1>8822\n<7fca><7fcb>8184\n<7fd0><7fd1>8187\n<7fd4><7fd5>3356\n<7fdb><7fdc>9495\n<7fe0><7fe1>4207\n<7fe2><7fe3>10135\n<7ff0><7ff1>4907\n<7ff7><7ff8>12175\n<7ffd><7ffe>12521\n<800e><800f>7112\n<803b><803c>14231\n<804f><8050>8826\n<8071><8072>5193\n<808b><808c>1027\n<80c3><80c4>2014\n<8159><815a>18253\n<8179><817a>3798\n<819b><819d>4586\n<81d1><81d2>12178\n<81e0><81e1>13533\n<81f7><81f9>8840\n<822a><822b>2456\n<823c><823d>8844\n<8255><8257>11324\n<8258><8259>4916\n<8268><8269>12829\n<8283><8284>6373\n<837b><837c>2948\n<84e7><84e8>10755\n<852c><852d>4596\n<8568><8569>4921\n<856f><8570>18283\n<85e4><85e5>5560\n<8634><8635>13223\n<8646><8648>13535\n<866d><866e>6726\n<86bb><86bc>8266\n<86bd><86be>8269\n<8702><8703>3830\n<8726><8727>10216\n<8763><8764>10768\n<8790><8791>11375\n<87f6><87f7>12554\n<8810><8811>12844\n<8814><8815>5695\n<8843><8844>7674\n<8845><8846>14358\n<8875><8876>7677\n<8881><8882>2490\n<88b4><88b5>14366\n<88c1><88c2>3410\n<88cd><88ce>9593\n<88f1><88f2>10225\n<8912><8913>4622\n<8917><8919>10804\n<892d><892e>11386\n<8950><8951>12233\n<895a><895b>12566\n<8979><897a>13538\n<89da><89db>8935\n<89f2><89f3>11865\n<8a02><8a03>2056\n<8a44><8a45>8944\n<8a57><8a58>8942\n<8a72><8a73>3848\n<8ad4><8ad5>10823\n<8af4><8af5>11400\n<8b01><8b02>4950\n<8b4e><8b4f>5577\n<8b7a><8b7b>13076\n<8b94><8b95>13468\n<8b98><8b99>13543\n<8c5c><8c5d>8301\n<8c68><8c69>10250\n<8c84><8c85>9630\n<8c91><8c92>11414\n<8ca1><8ca2>2508\n<8cc7><8cc8>3871\n<8cd1><8cd2>4280\n<8ce2><8ce3>4652\n<8cec><8ced>4650\n<8d06><8d07>12595\n<8d16><8d17>5849\n<8d68><8d69>9633\n<8d8e><8d8f>9637\n<8d93><8d94>9640\n<8e26><8e27>10859\n<8e3c><8e3d>11432\n<8e96><8e97>13250\n<8e9e><8ea0>13470\n<8ee0><8ee1>8318\n<8ee7><8ee8>8983\n<8f07><8f08>9662\n<8f10><8f11>10269\n<8f16><8f17>10874\n<8f46><8f48>12279\n<8f4f><8f50>12611\n<8f56><8f57>12866\n<8f66><8f67>17769\n<8fbb><8fbc>15723\n<9081><9082>5269\n<908a><908b>5593\n<9097><9098>6171\n<90d9><90da>7711\n<90eb><90ec>8333\n<90f2><90f3>8330\n<9129><912a>10883\n<9135><9136>11451\n<913a><913b>12284\n<9144><9145>13087\n<914e><914f>7722\n<916e><916f>9679\n<9181><9182>10891\n<9185><9186>10888\n<9190><9191>11454\n<91ab><91ac>5436\n<91b2><91b3>12876\n<91ea><91eb>8348\n<9214><9215>3471\n<92c3><92c4>10896\n<92f3><92f4>18333\n<9350><9351>11923\n<93dc><93dd>5602\n<9448><9449>13262\n<944a><944b>13257\n<9451><9452>5856\n<9468><9469>13478\n<947d><947e>5981\n<9480><9481>13625\n<95a8><95a9>4320\n<95b9><95ba>11500\n<95ca><95cc>5290\n<95d2><95d3>12317\n<95da><95db>12643\n<964b><964d>2083\n<9662><9663>2539\n<9676><9677>3031\n<9685><9686>3491\n<9688><9689>9040\n<9692><9693>9716\n<9694><9695>3934\n<96a7><96a8>4998\n<96c6><96c7>3499\n<96c9><96ca>3938\n<9706><9707>4707\n<972b><972c>12647\n<972e><972f>12911\n<9738><9739>5793\n<973d><973e>5858\n<975b><975c>5008\n<9777><9778>9726\n<97c4><97c5>13388\n<97dd><97df>12654\n<97fd><97fe>12915\n<9802><9803>3039\n<9805><9806>3504\n<980d><980e>9730\n<9810><9811>3947\n<9817><9818>4334\n<9850><9852>12343\n<9862><9863>12918\n<9873><9874>13607\n<98ad><98ae>10339\n<98c1><98c2>12921\n<98fd><98fe>3955\n<9916><9917>10959\n<992b><992c>11973\n<993e><993f>5470\n<99a6><99a7>12668\n<99d3><99d4>10965\n<99fd><99fe>11993\n<9a53><9a54>13273\n<9a5a><9a5b>5907\n<9a66><9a67>13613\n<9aaf><9ab0>4343\n<9ad3><9ad4>5910\n<9aee><9aef>4731\n<9b04><9b05>12363\n<9b17><9b18>13125\n<9b1e><9b20>13393\n<9b3e><9b3f>10356\n<9b41><9b42>4346\n<9b60><9b61>10358\n<9bea><9beb>12689\n<9c28><9c29>13135\n<9c77><9c78>5984\n<9cf1><9cf2>10361\n<9d2e><9d2f>12019\n<9d42><9d43>12025\n<9d74><9d75>12719\n<9d8b><9d8c>12715\n<9da6><9da7>12980\n<9db9><9dba>13152\n<9df9><9dfa>5947\n<9e00><9e01>13501\n<9e7c><9e7d>5949\n<9e86><9e87>11569\n<9ed5><9ed6>11573\n<9edc><9edd>5316\n<9ef2><9ef3>13427\n<9f0f><9f10>11006\n<9f40><9f41>12737\n<9f56><9f58>12740\n<9f66><9f67>5817\n<9f6e><9f6f>13438\n<9f74><9f76>13510\n<e002><e003>16397\n<e009><e00a>16404\n<e012><e016>16413\n<e01a><e01e>16421\n<e022><e023>16429\n<e02d><e02e>16440\n<e032><e038>16445\n<e03b><e03c>16454\n<e05f><e061>16490\n<e074><e075>16511\n<e089><e08a>16532\n<e093><e094>16542\n<e099><e09a>16548\n<e09c><e09e>16551\n<e0a6><e0a7>16561\n<e0c7><e0c8>16594\n<e0d4><e0d5>16607\n<e0e2><e0e5>16621\n<e0e7><e0e9>16626\n<e0eb><e0ec>16630\n<e0f8><e0f9>16643\n<e109><e10b>16658\n<e114><e115>16669\n<e11c><e11d>16677\n<e126><e128>16687\n<e130><e131>16697\n<e141><e142>16714\n<e147><e148>16719\n<e154><e157>16730\n<e159><e15a>16735\n<e168><e16a>16749\n<e171><e172>16757\n<e178><e179>16764\n<e17b><e17c>16767\n<e17f><e180>16771\n<e18f><e190>16787\n<e19f><e1a0>16801\n<e1b0><e1b1>16818\n<e1b3><e1b4>16821\n<e1bc><e1bf>16829\n<e1c4><e1c5>16837\n<e1cc><e1cd>16844\n<e1d4><e1d5>16852\n<e1ef><e1f0>16878\n<e20a><e20c>16905\n<e212><e216>16913\n<e21b><e21c>16922\n<e21f><e221>16926\n<e226><e228>16933\n<e23d><e23e>16956\n<e24a><e24f>16969\n<e251><e254>16976\n<e26d><e26f>17003\n<e288><e289>17030\n<e290><e291>17038\n<e294><e296>17042\n<e299><e29b>17047\n<e2b2><e2b5>17070\n<e2b7><e2b8>17075\n<e2be><e2bf>17081\n<e2d8><e2d9>17107\n<e2e0><e2e2>17115\n<e2eb><e2ed>17126\n<e2f0><e2f1>18781\n<e2ff><e300>18783\n<e31b><e31c>14132\n<e330><e331>14153\n<e335><e336>14158\n<e35b><e35c>14192\n<e364><e365>14201\n<e374><e375>14217\n<e381><e382>14229\n<e388><e38a>14236\n<e39a><e39b>14253\n<e39f><e3a0>14257\n<e3a6><e3a9>14264\n<e3b1><e3b2>14275\n<e3b4><e3b5>14278\n<e3b9><e3bd>14283\n<e3d8><e3da>14311\n<e3ed><e3ee>14332\n<e3f2><e3f4>14337\n<e409><e40b>14360\n<e41d><e41e>14378\n<e42c><e42d>14392\n<e43a><e43c>14406\n<e440><e441>14412\n<e44c><e44e>14423\n<e450><e451>14427\n<e459><e45a>14436\n<e45d><e45e>14440\n<e461><e463>14444\n<e467><e469>18095\n<e46e><e46f>14455\n<e471><e472>14458\n<e47e><e47f>14470\n<e486><e48a>14477\n<e48d><e48e>14484\n<e491><e492>14487\n<e495><e497>14491\n<e4a2><e4a4>14503\n<e4b3><e4ba>14520\n<e4cd><e4ce>14546\n<e4dc><e4dd>14561\n<e4e6><e4e8>14571\n<e4ee><e4ef>14579\n<e4f8><e4f9>14589\n<e501><e502>14598\n<e51c><e521>14623\n<e529><e52c>14634\n<e52e><e52f>14639\n<e554><e555>14677\n<e557><e559>14680\n<e55b><e55c>14684\n<e55e><e55f>14687\n<e566><e567>14695\n<e56d><e56e>14702\n<e572><e573>14707\n<e575><e577>14710\n<e579><e57a>14714\n<e57c><e57e>14717\n<e582><e586>14723\n<e58b><e590>14732\n<e592><e594>14739\n<e59d><e5a1>14750\n<e5a6><e5a8>14759\n<e5b7><e5b8>14776\n<e5ba><e5bb>14779\n<e5be><e5c0>14783\n<e5c8><e5c9>14793\n<e5d7><e5d9>14804\n<e5db><e5dc>14808\n<e5e1><e5e3>14814\n<e5e5><e5e6>14818\n<e5ee><e5f1>14827\n<e5fb><e5fc>14840\n<e60f><e612>14859\n<e619><e61c>14868\n<e623><e624>14878\n<e632><e634>14893\n<e637><e638>14898\n<e63f><e642>14906\n<e645><e646>14912\n<e64e><e64f>14920\n<e652><e655>14924\n<e657><e659>14929\n<e65d><e660>14935\n<e662><e663>14940\n<e665><e668>14943\n<e66e><e66f>14951\n<e676><e679>14959\n<e67b><e67d>14964\n<e67f><e680>14968\n<e683><e688>14971\n<e68a><e68c>14978\n<e68e><e690>14982\n<e696><e697>14990\n<e699><e69a>14993\n<e69e><e69f>14998\n<e6a1><e6a2>15001\n<e6ac><e6ad>15010\n<e6b9><e6ba>15023\n<e6bd><e6be>15027\n<e6c0><e6c1>15030\n<e6d1><e6d2>15046\n<e6d7><e6d8>15052\n<e6da><e6db>15055\n<e6dd><e6e1>15058\n<e6e4><e6e6>15065\n<e6f2><e6f3>15079\n<e6fa><e6fc>15087\n<e701><e702>15094\n<e706><e707>15099\n<e709><e70a>15102\n<e710><e711>15109\n<e717><e718>15116\n<e71a><e71b>15119\n<e724><e725>15129\n<e733><e737>15144\n<e73c><e73d>15153\n<e740><e742>15157\n<e74d><e74f>15170\n<e751><e752>15174\n<e75b><e75d>15184\n<e761><e762>15190\n<e764><e765>15193\n<e767><e768>15196\n<e76c><e76e>15200\n<e777><e778>15210\n<e77c><e77d>15215\n<e796><e797>15241\n<e7a4><e7a9>15255\n<e7dc><e7dd>15310\n<e7e7><e7e9>15321\n<e7ed><e7ef>15327\n<e7f1><e7f3>15331\n<e7fb><e7fc>15341\n<e7ff><e802>15345\n<e80e><e80f>15360\n<e816><e818>15368\n<e827><e828>15385\n<e837><e838>15401\n<e83a><e83b>15404\n<e841><e842>15411\n<e84d><e84e>15423\n<e855><e858>15431\n<e85b><e85d>15437\n<e860><e862>15442\n<e865><e867>15447\n<e869><e86a>15451\n<e87d><e87f>15470\n<e891><e892>15490\n<e894><e895>15493\n<e8a0><e8a1>15505\n<e8a3><e8a7>15508\n<e8a9><e8aa>15514\n<e8ac><e8b0>15517\n<e8b5><e8b6>15526\n<e8bd><e8c3>15534\n<e8cd><e8ce>15550\n<e8d0><e8d1>15553\n<e8d5><e8d6>15558\n<e8d8><e8da>15561\n<e8df><e8e1>15568\n<e8e5><e8e6>15574\n<e8e8><e8ea>15577\n<e8f1><e8f2>15586\n<e907><e908>15608\n<e917><e918>15624\n<e91e><e922>15631\n<e925><e92c>15638\n<e92e><e92f>15647\n<e933><e936>15652\n<e93c><e93e>15661\n<e944><e945>15669\n<e952><e955>15683\n<e957><e958>15688\n<e95c><e95e>15693\n<e960><e961>15697\n<e96e><e96f>18133\n<e977><e978>18141\n<e97a><e97b>18144\n<e981><e982>18150\n<eabf><eac1>18396\n<eac9><eacc>18402\n<eacf><ead1>18408\n<ead3><ead4>18411\n<ead6><eada>18414\n<eade><eae3>18420\n<eae7><eaec>18426\n<eaf0><eaf2>18433\n<eaf5><eaf6>18436\n<eafa><eafb>18440\n<eafe><eb00>18443\n<eb02><eb05>18446\n<eb08><eb0f>18451\n<eb11><eb12>18459\n<eb18><eb1d>18465\n<eb1f><eb21>18471\n<eb2c><eb39>18478\n<eb3e><eb3f>18492\n<eb43><eb44>18494\n<eb4b><eb4c>15779\n<eb4d><eb4e>18498\n<eb4f><eb50>15781\n<eb55><eb56>18501\n<eb58><eb59>18503\n<eb5a><eb5b>15787\n<eb62><eb63>18505\n<eb68><eb69>15796\n<eb6f><eb71>18510\n<eb7e><eb7f>18518\n<eb80><eb81>15809\n<eb83><eb84>18520\n<eb8c><eb8e>18524\n<eb98><eb9a>18529\n<eba5><eba6>18536\n<ebb2><ebb3>18541\n<ebc5><ebc6>18546\n<ebcc><ebcd>15854\n<ebd7><ebd8>15860\n<ebda><ebdb>18554\n<ebe8><ebe9>18559\n<ebeb><ebec>18561\n<ebf9><ebfb>15881\n<ebfd><ebfe>15885\n<ec05><ec06>15892\n<ec08><ec09>18568\n<ec0e><ec10>15898\n<ec17><ec18>15906\n<ec19><ec1c>18572\n<ec2c><ec2e>15921\n<ec3b><ec3c>15934\n<ec3f><ec41>18580\n<ec45><ec49>18584\n<ec4b><ec4c>18589\n<ec56><ec58>18595\n<ec5c><ec5d>18599\n<ec5f><ec60>18601\n<ec62><ec63>18604\n<ec69><ec73>18608\n<ec75><ec76>18620\n<ec93><ec94>18639\n<ec9a><ec9b>18643\n<eca3><eca4>18648\n<eca7><eca8>18650\n<ecb9><ecbb>18657\n<ecdb><ecdc>16012\n<ecdf><ece1>16015\n<ed0c><ed11>18667\n<ed15><ed17>18674\n<ed24><ed25>16066\n<ed26><ed27>18681\n<ed41><ed42>18694\n<ed4a><ed4b>18697\n<ed4d><ed4e>18699\n<ed53><ed54>18702\n<ed57><ed58>18704\n<ed84><ed85>16132\n<ed89><ed8a>18713\n<eea1><eea6>18737\n<eea8><eeaa>18743\n<eeac><eeb1>18746\n<f303><f318>17609\n<f34a><f34b>18844\n<f3a0><f3a1>17716\n<f3f9><f3fa>17788\n<f408><f40b>17801\n<f440><f442>17163\n<f448><f449>17171\n<f450><f452>17179\n<f454><f456>17183\n<f45c><f45f>17191\n<f461><f463>17196\n<f465><f466>17200\n<f46c><f46d>17207\n<f47c><f47e>17223\n<f480><f481>17227\n<f484><f485>17231\n<f48d><f490>17240\n<f497><f498>17250\n<f4a4><f4a6>17263\n<f4a9><f4aa>17268\n<f4af><f4b0>17274\n<f4b3><f4b4>17278\n<f4ba><f4c0>17285\n<f4c3><f4c5>17861\n<f4c7><f4ca>17865\n<f4cc><f4cf>17870\n<f4d1><f4d5>17874\n<f4d9><f4da>17882\n<f4db><f4dc>17292\n<f4dd><f4de>17884\n<f4e7><f4e9>17298\n<f4fe><f501>17904\n<f507><f511>17912\n<f513><f516>17924\n<f518><f51d>17929\n<f51f><f526>17936\n<f533><f534>17956\n<f53a><f53b>17633\n<f559><f55a>17663\n<f7e5><f7e6>13999\n<f7ea><f7eb>14004\n<f7ed><f7ee>14007\n<fe35><fe36>130\n<fe37><fe38>134\n<fe39><fe3a>138\n<fe3b><fe3c>142\n<fe3d><fe3e>146\n<fe3f><fe40>150\n<fe41><fe42>154\n<fe43><fe44>158\n<fe49><fe4a>199\n<fe4b><fe4c>203\n<fe4d><fe4e>201\n<fe54><fe57>116\n<fe59><fe5e>160\n<fe5f><fe61>205\n<fe62><fe66>223\n<fe69><fe6b>268\n<ff08><ff09>128\n<ff10><ff19>333\n<ff21><ff3a>365\n<ff41><ff5a>391\nendcidrange\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/Adobe-GB1-0",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe GB1 0)\n%%Version: 9.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 0 def\nend def\n\n/CMapName /Adobe-GB1-0 def\n/CMapVersion 9.003 def\n/CMapType 1 def\n\n/UIDOffset 330 def\n/XUID [1 10 25368] def\n\n/WMode 0 def\n\n/CIDCount 7717 def\n\n1 begincodespacerange\n  <0000> <1EFF>\nendcodespacerange\n\n31 begincidrange\n<0000> <00ff>    0\n<0100> <01ff>  256\n<0200> <02ff>  512\n<0300> <03ff>  768\n<0400> <04ff> 1024\n<0500> <05ff> 1280\n<0600> <06ff> 1536\n<0700> <07ff> 1792\n<0800> <08ff> 2048\n<0900> <09ff> 2304\n<0a00> <0aff> 2560\n<0b00> <0bff> 2816\n<0c00> <0cff> 3072\n<0d00> <0dff> 3328\n<0e00> <0eff> 3584\n<0f00> <0fff> 3840\n<1000> <10ff> 4096\n<1100> <11ff> 4352\n<1200> <12ff> 4608\n<1300> <13ff> 4864\n<1400> <14ff> 5120\n<1500> <15ff> 5376\n<1600> <16ff> 5632\n<1700> <17ff> 5888\n<1800> <18ff> 6144\n<1900> <19ff> 6400\n<1a00> <1aff> 6656\n<1b00> <1bff> 6912\n<1c00> <1cff> 7168\n<1d00> <1dff> 7424\n<1e00> <1e24> 7680\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/Adobe-GB1-1",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe GB1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 1 def\nend def\n\n/CMapName /Adobe-GB1-1 def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 710 def\n/XUID [1 10 25453] def\n\n/WMode 0 def\n\n/CIDCount 9897 def\n\n1 begincodespacerange\n  <0000> <26FF>\nendcodespacerange\n\n39 begincidrange\n<0000> <00ff>    0\n<0100> <01ff>  256\n<0200> <02ff>  512\n<0300> <03ff>  768\n<0400> <04ff> 1024\n<0500> <05ff> 1280\n<0600> <06ff> 1536\n<0700> <07ff> 1792\n<0800> <08ff> 2048\n<0900> <09ff> 2304\n<0a00> <0aff> 2560\n<0b00> <0bff> 2816\n<0c00> <0cff> 3072\n<0d00> <0dff> 3328\n<0e00> <0eff> 3584\n<0f00> <0fff> 3840\n<1000> <10ff> 4096\n<1100> <11ff> 4352\n<1200> <12ff> 4608\n<1300> <13ff> 4864\n<1400> <14ff> 5120\n<1500> <15ff> 5376\n<1600> <16ff> 5632\n<1700> <17ff> 5888\n<1800> <18ff> 6144\n<1900> <19ff> 6400\n<1a00> <1aff> 6656\n<1b00> <1bff> 6912\n<1c00> <1cff> 7168\n<1d00> <1dff> 7424\n<1e00> <1eff> 7680\n<1f00> <1fff> 7936\n<2000> <20ff> 8192\n<2100> <21ff> 8448\n<2200> <22ff> 8704\n<2300> <23ff> 8960\n<2400> <24ff> 9216\n<2500> <25ff> 9472\n<2600> <26a8> 9728\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/Adobe-GB1-2",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe GB1 2)\n%%Version: 11.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 2 def\nend def\n\n/CMapName /Adobe-GB1-2 def\n/CMapVersion 11.003 def\n/CMapType 1 def\n\n/UIDOffset 750 def\n/XUID [1 10 25454] def\n\n/WMode 0 def\n\n/CIDCount 22127 def\n\n1 begincodespacerange\n  <0000> <56FF>\nendcodespacerange\n\n87 begincidrange\n<0000> <00ff> 0\n<0100> <01ff> 256\n<0200> <02ff> 512\n<0300> <03ff> 768\n<0400> <04ff> 1024\n<0500> <05ff> 1280\n<0600> <06ff> 1536\n<0700> <07ff> 1792\n<0800> <08ff> 2048\n<0900> <09ff> 2304\n<0a00> <0aff> 2560\n<0b00> <0bff> 2816\n<0c00> <0cff> 3072\n<0d00> <0dff> 3328\n<0e00> <0eff> 3584\n<0f00> <0fff> 3840\n<1000> <10ff> 4096\n<1100> <11ff> 4352\n<1200> <12ff> 4608\n<1300> <13ff> 4864\n<1400> <14ff> 5120\n<1500> <15ff> 5376\n<1600> <16ff> 5632\n<1700> <17ff> 5888\n<1800> <18ff> 6144\n<1900> <19ff> 6400\n<1a00> <1aff> 6656\n<1b00> <1bff> 6912\n<1c00> <1cff> 7168\n<1d00> <1dff> 7424\n<1e00> <1eff> 7680\n<1f00> <1fff> 7936\n<2000> <20ff> 8192\n<2100> <21ff> 8448\n<2200> <22ff> 8704\n<2300> <23ff> 8960\n<2400> <24ff> 9216\n<2500> <25ff> 9472\n<2600> <26ff> 9728\n<2700> <27ff> 9984\n<2800> <28ff> 10240\n<2900> <29ff> 10496\n<2a00> <2aff> 10752\n<2b00> <2bff> 11008\n<2c00> <2cff> 11264\n<2d00> <2dff> 11520\n<2e00> <2eff> 11776\n<2f00> <2fff> 12032\n<3000> <30ff> 12288\n<3100> <31ff> 12544\n<3200> <32ff> 12800\n<3300> <33ff> 13056\n<3400> <34ff> 13312\n<3500> <35ff> 13568\n<3600> <36ff> 13824\n<3700> <37ff> 14080\n<3800> <38ff> 14336\n<3900> <39ff> 14592\n<3a00> <3aff> 14848\n<3b00> <3bff> 15104\n<3c00> <3cff> 15360\n<3d00> <3dff> 15616\n<3e00> <3eff> 15872\n<3f00> <3fff> 16128\n<4000> <40ff> 16384\n<4100> <41ff> 16640\n<4200> <42ff> 16896\n<4300> <43ff> 17152\n<4400> <44ff> 17408\n<4500> <45ff> 17664\n<4600> <46ff> 17920\n<4700> <47ff> 18176\n<4800> <48ff> 18432\n<4900> <49ff> 18688\n<4a00> <4aff> 18944\n<4b00> <4bff> 19200\n<4c00> <4cff> 19456\n<4d00> <4dff> 19712\n<4e00> <4eff> 19968\n<4f00> <4fff> 20224\n<5000> <50ff> 20480\n<5100> <51ff> 20736\n<5200> <52ff> 20992\n<5300> <53ff> 21248\n<5400> <54ff> 21504\n<5500> <55ff> 21760\n<5600> <566e> 22016\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/Adobe-GB1-3",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe GB1 3)\n%%Version: 1.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 3 def\nend def\n\n/CMapName /Adobe-GB1-3 def\n/CMapVersion 1.002 def\n/CMapType 1 def\n\n/XUID [1 10 25457] def\n\n/WMode 0 def\n\n/CIDCount 22353 def\n\n1 begincodespacerange\n  <0000> <57FF>\nendcodespacerange\n\n88 begincidrange\n<0000> <00ff> 0\n<0100> <01ff> 256\n<0200> <02ff> 512\n<0300> <03ff> 768\n<0400> <04ff> 1024\n<0500> <05ff> 1280\n<0600> <06ff> 1536\n<0700> <07ff> 1792\n<0800> <08ff> 2048\n<0900> <09ff> 2304\n<0a00> <0aff> 2560\n<0b00> <0bff> 2816\n<0c00> <0cff> 3072\n<0d00> <0dff> 3328\n<0e00> <0eff> 3584\n<0f00> <0fff> 3840\n<1000> <10ff> 4096\n<1100> <11ff> 4352\n<1200> <12ff> 4608\n<1300> <13ff> 4864\n<1400> <14ff> 5120\n<1500> <15ff> 5376\n<1600> <16ff> 5632\n<1700> <17ff> 5888\n<1800> <18ff> 6144\n<1900> <19ff> 6400\n<1a00> <1aff> 6656\n<1b00> <1bff> 6912\n<1c00> <1cff> 7168\n<1d00> <1dff> 7424\n<1e00> <1eff> 7680\n<1f00> <1fff> 7936\n<2000> <20ff> 8192\n<2100> <21ff> 8448\n<2200> <22ff> 8704\n<2300> <23ff> 8960\n<2400> <24ff> 9216\n<2500> <25ff> 9472\n<2600> <26ff> 9728\n<2700> <27ff> 9984\n<2800> <28ff> 10240\n<2900> <29ff> 10496\n<2a00> <2aff> 10752\n<2b00> <2bff> 11008\n<2c00> <2cff> 11264\n<2d00> <2dff> 11520\n<2e00> <2eff> 11776\n<2f00> <2fff> 12032\n<3000> <30ff> 12288\n<3100> <31ff> 12544\n<3200> <32ff> 12800\n<3300> <33ff> 13056\n<3400> <34ff> 13312\n<3500> <35ff> 13568\n<3600> <36ff> 13824\n<3700> <37ff> 14080\n<3800> <38ff> 14336\n<3900> <39ff> 14592\n<3a00> <3aff> 14848\n<3b00> <3bff> 15104\n<3c00> <3cff> 15360\n<3d00> <3dff> 15616\n<3e00> <3eff> 15872\n<3f00> <3fff> 16128\n<4000> <40ff> 16384\n<4100> <41ff> 16640\n<4200> <42ff> 16896\n<4300> <43ff> 17152\n<4400> <44ff> 17408\n<4500> <45ff> 17664\n<4600> <46ff> 17920\n<4700> <47ff> 18176\n<4800> <48ff> 18432\n<4900> <49ff> 18688\n<4a00> <4aff> 18944\n<4b00> <4bff> 19200\n<4c00> <4cff> 19456\n<4d00> <4dff> 19712\n<4e00> <4eff> 19968\n<4f00> <4fff> 20224\n<5000> <50ff> 20480\n<5100> <51ff> 20736\n<5200> <52ff> 20992\n<5300> <53ff> 21248\n<5400> <54ff> 21504\n<5500> <55ff> 21760\n<5600> <56ff> 22016\n<5700> <5750> 22272\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/Adobe-GB1-4",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe GB1 4)\n%%Version: 1.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 4 def\nend def\n\n/CMapName /Adobe-GB1-4 def\n/CMapVersion 1.003 def\n/CMapType 1 def\n\n/XUID [1 10 25458] def\n\n/WMode 0 def\n\n/CIDCount 29064 def\n\n1 begincodespacerange\n  <0000> <71FF>\nendcodespacerange\n\n100 begincidrange\n<0000> <00ff> 0\n<0100> <01ff> 256\n<0200> <02ff> 512\n<0300> <03ff> 768\n<0400> <04ff> 1024\n<0500> <05ff> 1280\n<0600> <06ff> 1536\n<0700> <07ff> 1792\n<0800> <08ff> 2048\n<0900> <09ff> 2304\n<0a00> <0aff> 2560\n<0b00> <0bff> 2816\n<0c00> <0cff> 3072\n<0d00> <0dff> 3328\n<0e00> <0eff> 3584\n<0f00> <0fff> 3840\n<1000> <10ff> 4096\n<1100> <11ff> 4352\n<1200> <12ff> 4608\n<1300> <13ff> 4864\n<1400> <14ff> 5120\n<1500> <15ff> 5376\n<1600> <16ff> 5632\n<1700> <17ff> 5888\n<1800> <18ff> 6144\n<1900> <19ff> 6400\n<1a00> <1aff> 6656\n<1b00> <1bff> 6912\n<1c00> <1cff> 7168\n<1d00> <1dff> 7424\n<1e00> <1eff> 7680\n<1f00> <1fff> 7936\n<2000> <20ff> 8192\n<2100> <21ff> 8448\n<2200> <22ff> 8704\n<2300> <23ff> 8960\n<2400> <24ff> 9216\n<2500> <25ff> 9472\n<2600> <26ff> 9728\n<2700> <27ff> 9984\n<2800> <28ff> 10240\n<2900> <29ff> 10496\n<2a00> <2aff> 10752\n<2b00> <2bff> 11008\n<2c00> <2cff> 11264\n<2d00> <2dff> 11520\n<2e00> <2eff> 11776\n<2f00> <2fff> 12032\n<3000> <30ff> 12288\n<3100> <31ff> 12544\n<3200> <32ff> 12800\n<3300> <33ff> 13056\n<3400> <34ff> 13312\n<3500> <35ff> 13568\n<3600> <36ff> 13824\n<3700> <37ff> 14080\n<3800> <38ff> 14336\n<3900> <39ff> 14592\n<3a00> <3aff> 14848\n<3b00> <3bff> 15104\n<3c00> <3cff> 15360\n<3d00> <3dff> 15616\n<3e00> <3eff> 15872\n<3f00> <3fff> 16128\n<4000> <40ff> 16384\n<4100> <41ff> 16640\n<4200> <42ff> 16896\n<4300> <43ff> 17152\n<4400> <44ff> 17408\n<4500> <45ff> 17664\n<4600> <46ff> 17920\n<4700> <47ff> 18176\n<4800> <48ff> 18432\n<4900> <49ff> 18688\n<4a00> <4aff> 18944\n<4b00> <4bff> 19200\n<4c00> <4cff> 19456\n<4d00> <4dff> 19712\n<4e00> <4eff> 19968\n<4f00> <4fff> 20224\n<5000> <50ff> 20480\n<5100> <51ff> 20736\n<5200> <52ff> 20992\n<5300> <53ff> 21248\n<5400> <54ff> 21504\n<5500> <55ff> 21760\n<5600> <56ff> 22016\n<5700> <57ff> 22272\n<5800> <58ff> 22528\n<5900> <59ff> 22784\n<5a00> <5aff> 23040\n<5b00> <5bff> 23296\n<5c00> <5cff> 23552\n<5d00> <5dff> 23808\n<5e00> <5eff> 24064\n<5f00> <5fff> 24320\n<6000> <60ff> 24576\n<6100> <61ff> 24832\n<6200> <62ff> 25088\n<6300> <63ff> 25344\nendcidrange\n\n14 begincidrange\n<6400> <64ff> 25600\n<6500> <65ff> 25856\n<6600> <66ff> 26112\n<6700> <67ff> 26368\n<6800> <68ff> 26624\n<6900> <69ff> 26880\n<6a00> <6aff> 27136\n<6b00> <6bff> 27392\n<6c00> <6cff> 27648\n<6d00> <6dff> 27904\n<6e00> <6eff> 28160\n<6f00> <6fff> 28416\n<7000> <70ff> 28672\n<7100> <7187> 28928\nendcidrange\nendcmap\n\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/Adobe-GB1-5",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe GB1 5)\n%%Version: 1.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 5 def\nend def\n\n/CMapName /Adobe-GB1-5 def\n/CMapVersion 1.002 def\n/CMapType 1 def\n\n/XUID [1 10 25605] def\n\n/WMode 0 def\n\n/CIDCount 30284 def\n\n1 begincodespacerange\n  <0000> <76FF>\nendcodespacerange\n\n100 begincidrange\n<0000> <00ff> 0\n<0100> <01ff> 256\n<0200> <02ff> 512\n<0300> <03ff> 768\n<0400> <04ff> 1024\n<0500> <05ff> 1280\n<0600> <06ff> 1536\n<0700> <07ff> 1792\n<0800> <08ff> 2048\n<0900> <09ff> 2304\n<0a00> <0aff> 2560\n<0b00> <0bff> 2816\n<0c00> <0cff> 3072\n<0d00> <0dff> 3328\n<0e00> <0eff> 3584\n<0f00> <0fff> 3840\n<1000> <10ff> 4096\n<1100> <11ff> 4352\n<1200> <12ff> 4608\n<1300> <13ff> 4864\n<1400> <14ff> 5120\n<1500> <15ff> 5376\n<1600> <16ff> 5632\n<1700> <17ff> 5888\n<1800> <18ff> 6144\n<1900> <19ff> 6400\n<1a00> <1aff> 6656\n<1b00> <1bff> 6912\n<1c00> <1cff> 7168\n<1d00> <1dff> 7424\n<1e00> <1eff> 7680\n<1f00> <1fff> 7936\n<2000> <20ff> 8192\n<2100> <21ff> 8448\n<2200> <22ff> 8704\n<2300> <23ff> 8960\n<2400> <24ff> 9216\n<2500> <25ff> 9472\n<2600> <26ff> 9728\n<2700> <27ff> 9984\n<2800> <28ff> 10240\n<2900> <29ff> 10496\n<2a00> <2aff> 10752\n<2b00> <2bff> 11008\n<2c00> <2cff> 11264\n<2d00> <2dff> 11520\n<2e00> <2eff> 11776\n<2f00> <2fff> 12032\n<3000> <30ff> 12288\n<3100> <31ff> 12544\n<3200> <32ff> 12800\n<3300> <33ff> 13056\n<3400> <34ff> 13312\n<3500> <35ff> 13568\n<3600> <36ff> 13824\n<3700> <37ff> 14080\n<3800> <38ff> 14336\n<3900> <39ff> 14592\n<3a00> <3aff> 14848\n<3b00> <3bff> 15104\n<3c00> <3cff> 15360\n<3d00> <3dff> 15616\n<3e00> <3eff> 15872\n<3f00> <3fff> 16128\n<4000> <40ff> 16384\n<4100> <41ff> 16640\n<4200> <42ff> 16896\n<4300> <43ff> 17152\n<4400> <44ff> 17408\n<4500> <45ff> 17664\n<4600> <46ff> 17920\n<4700> <47ff> 18176\n<4800> <48ff> 18432\n<4900> <49ff> 18688\n<4a00> <4aff> 18944\n<4b00> <4bff> 19200\n<4c00> <4cff> 19456\n<4d00> <4dff> 19712\n<4e00> <4eff> 19968\n<4f00> <4fff> 20224\n<5000> <50ff> 20480\n<5100> <51ff> 20736\n<5200> <52ff> 20992\n<5300> <53ff> 21248\n<5400> <54ff> 21504\n<5500> <55ff> 21760\n<5600> <56ff> 22016\n<5700> <57ff> 22272\n<5800> <58ff> 22528\n<5900> <59ff> 22784\n<5a00> <5aff> 23040\n<5b00> <5bff> 23296\n<5c00> <5cff> 23552\n<5d00> <5dff> 23808\n<5e00> <5eff> 24064\n<5f00> <5fff> 24320\n<6000> <60ff> 24576\n<6100> <61ff> 24832\n<6200> <62ff> 25088\n<6300> <63ff> 25344\nendcidrange\n\n19 begincidrange\n<6400> <64ff> 25600\n<6500> <65ff> 25856\n<6600> <66ff> 26112\n<6700> <67ff> 26368\n<6800> <68ff> 26624\n<6900> <69ff> 26880\n<6a00> <6aff> 27136\n<6b00> <6bff> 27392\n<6c00> <6cff> 27648\n<6d00> <6dff> 27904\n<6e00> <6eff> 28160\n<6f00> <6fff> 28416\n<7000> <70ff> 28672\n<7100> <71ff> 28928\n<7200> <72ff> 29184\n<7300> <73ff> 29440\n<7400> <74ff> 29696\n<7500> <75ff> 29952\n<7600> <764b> 30208\nendcidrange\nendcmap\n\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/Adobe-GB1-UCS2",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Adobe-GB1-UCS2)\n%%Title: (Adobe-GB1-UCS2 Adobe GB1 5)\n%%Version: 8.001\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Adobe_GB1_UCS2) def\n  /Supplement 5 def\nend def\n\n/CMapName /Adobe-GB1-UCS2 def\n/CMapVersion 8.001 def\n/CMapType 2 def\n\n/XUID [1 10 25335 1212] def\n\n/WMode 0 def\n\n1 begincodespacerange\n  <0000> <FFFF>\nendcodespacerange\n\n100 beginbfchar\n<0000>  <fffd>\n<0063>  <00b7>\n<0064>  <02c9>\n<0065>  <02c7>\n<0066>  <00a8>\n<0067>  <3003>\n<0068>  <3005>\n<0069>  <2014>\n<006a>  <ff5e>\n<006b>  <2016>\n<006c>  <22ef>\n<007f>  <00b1>\n<0080>  <00d7>\n<0081>  <00f7>\n<0082>  <2236>\n<0085>  <2211>\n<0086>  <220f>\n<0087>  <222a>\n<0088>  <2229>\n<0089>  <2208>\n<008a>  <2237>\n<008b>  <221a>\n<008c>  <22a5>\n<008d>  <2225>\n<008e>  <2220>\n<008f>  <2312>\n<0090>  <2299>\n<0091>  <222b>\n<0092>  <222e>\n<0093>  <2261>\n<0094>  <224c>\n<0095>  <2248>\n<0096>  <223d>\n<0097>  <221d>\n<0098>  <2260>\n<009d>  <221e>\n<009e>  <2235>\n<009f>  <2234>\n<00a0>  <2642>\n<00a1>  <2640>\n<00a2>  <00b0>\n<00a5>  <2103>\n<00a6>  <ff04>\n<00a7>  <00a4>\n<00aa>  <2030>\n<00ab>  <00a7>\n<00ac>  <2116>\n<00ad>  <2606>\n<00ae>  <2605>\n<00af>  <25cb>\n<00b0>  <25cf>\n<00b1>  <25ce>\n<00b2>  <25c7>\n<00b3>  <25c6>\n<00b4>  <25a1>\n<00b5>  <25a0>\n<00b6>  <25b3>\n<00b7>  <25b2>\n<00b8>  <203b>\n<00b9>  <2192>\n<00bc>  <2193>\n<00bd>  <3013>\n<0109>  <ffe5>\n<0163>  <ffe3>\n<023d>  <ff0c>\n<023e>  <3002>\n<023f>  <3001>\n<0242>  <ff01>\n<0243>  <ff1f>\n<0256>  <fe31>\n<0257>  <2026>\n<0260>  <0401>\n<0281>  <0451>\n<029c>  <0101>\n<029d>  <00e1>\n<029e>  <01ce>\n<029f>  <00e0>\n<02a0>  <0113>\n<02a1>  <00e9>\n<02a2>  <011b>\n<02a3>  <00e8>\n<02a4>  <012b>\n<02a5>  <00ed>\n<02a6>  <01d0>\n<02a7>  <00ec>\n<02a8>  <014d>\n<02a9>  <00f3>\n<02aa>  <01d2>\n<02ab>  <00f2>\n<02ac>  <016b>\n<02ad>  <00fa>\n<02ae>  <01d4>\n<02af>  <00f9>\n<02b0>  <01d6>\n<02b1>  <01d8>\n<02b2>  <01da>\n<02b3>  <01dc>\n<02b4>  <00fc>\n<02b5>  <00ea>\n<02b6>  <0251>\nendbfchar\n\n100 beginbfchar\n<02b7>  <1e3f>\n<02b8>  <0144>\n<02b9>  <0148>\n<02ba>  <01f9>\n<02bb>  <0261>\n<02e1>  <e7cd>\n<038c>  <0101>\n<038d>  <00e1>\n<038e>  <01ce>\n<038f>  <00e0>\n<0390>  <0113>\n<0391>  <00e9>\n<0392>  <011b>\n<0393>  <00e8>\n<0394>  <012b>\n<0395>  <00ed>\n<0396>  <01d0>\n<0397>  <00ec>\n<0398>  <014d>\n<0399>  <00f3>\n<039a>  <01d2>\n<039b>  <00f2>\n<039c>  <016b>\n<039d>  <00fa>\n<039e>  <01d4>\n<039f>  <00f9>\n<03a0>  <01d6>\n<03a1>  <01d8>\n<03a2>  <01da>\n<03a3>  <01dc>\n<03a4>  <00fc>\n<03a5>  <00ea>\n<03a6>  <0251>\n<03a7>  <1e3f>\n<03a8>  <0144>\n<03a9>  <0148>\n<03aa>  <01f9>\n<03ab>  <0261>\n<03ac>  <554a>\n<03ad>  <963f>\n<03ae>  <57c3>\n<03af>  <6328>\n<03b0>  <54ce>\n<03b1>  <5509>\n<03b2>  <54c0>\n<03b3>  <7691>\n<03b4>  <764c>\n<03b5>  <853c>\n<03b6>  <77ee>\n<03b7>  <827e>\n<03b8>  <788d>\n<03b9>  <7231>\n<03ba>  <9698>\n<03bb>  <978d>\n<03bc>  <6c28>\n<03bd>  <5b89>\n<03be>  <4ffa>\n<03bf>  <6309>\n<03c0>  <6697>\n<03c1>  <5cb8>\n<03c2>  <80fa>\n<03c3>  <6848>\n<03c4>  <80ae>\n<03c5>  <6602>\n<03c6>  <76ce>\n<03c7>  <51f9>\n<03c8>  <6556>\n<03c9>  <71ac>\n<03ca>  <7ff1>\n<03cb>  <8884>\n<03cc>  <50b2>\n<03cd>  <5965>\n<03ce>  <61ca>\n<03cf>  <6fb3>\n<03d0>  <82ad>\n<03d1>  <634c>\n<03d2>  <6252>\n<03d3>  <53ed>\n<03d4>  <5427>\n<03d5>  <7b06>\n<03d6>  <516b>\n<03d7>  <75a4>\n<03d8>  <5df4>\n<03d9>  <62d4>\n<03da>  <8dcb>\n<03db>  <9776>\n<03dc>  <628a>\n<03dd>  <8019>\n<03de>  <575d>\n<03df>  <9738>\n<03e0>  <7f62>\n<03e1>  <7238>\n<03e2>  <767d>\n<03e3>  <67cf>\n<03e4>  <767e>\n<03e5>  <6446>\n<03e6>  <4f70>\n<03e7>  <8d25>\n<03e8>  <62dc>\n<03e9>  <7a17>\nendbfchar\n\n100 beginbfchar\n<03ea>  <6591>\n<03eb>  <73ed>\n<03ec>  <642c>\n<03ed>  <6273>\n<03ee>  <822c>\n<03ef>  <9881>\n<03f0>  <677f>\n<03f1>  <7248>\n<03f2>  <626e>\n<03f3>  <62cc>\n<03f4>  <4f34>\n<03f5>  <74e3>\n<03f6>  <534a>\n<03f7>  <529e>\n<03f8>  <7eca>\n<03f9>  <90a6>\n<03fa>  <5e2e>\n<03fb>  <6886>\n<03fc>  <699c>\n<03fd>  <8180>\n<03fe>  <7ed1>\n<03ff>  <68d2>\n<0400>  <78c5>\n<0401>  <868c>\n<0402>  <9551>\n<0403>  <508d>\n<0404>  <8c24>\n<0405>  <82de>\n<0406>  <80de>\n<0407>  <5305>\n<0408>  <8912>\n<0409>  <5265>\n<040a>  <8584>\n<040b>  <96f9>\n<040c>  <4fdd>\n<040d>  <5821>\n<040e>  <9971>\n<040f>  <5b9d>\n<0410>  <62b1>\n<0411>  <62a5>\n<0412>  <66b4>\n<0413>  <8c79>\n<0414>  <9c8d>\n<0415>  <7206>\n<0416>  <676f>\n<0417>  <7891>\n<0418>  <60b2>\n<0419>  <5351>\n<041a>  <5317>\n<041b>  <8f88>\n<041c>  <80cc>\n<041d>  <8d1d>\n<041e>  <94a1>\n<041f>  <500d>\n<0420>  <72c8>\n<0421>  <5907>\n<0422>  <60eb>\n<0423>  <7119>\n<0424>  <88ab>\n<0425>  <5954>\n<0426>  <82ef>\n<0427>  <672c>\n<0428>  <7b28>\n<0429>  <5d29>\n<042a>  <7ef7>\n<042b>  <752d>\n<042c>  <6cf5>\n<042d>  <8e66>\n<042e>  <8ff8>\n<042f>  <903c>\n<0430>  <9f3b>\n<0431>  <6bd4>\n<0432>  <9119>\n<0433>  <7b14>\n<0434>  <5f7c>\n<0435>  <78a7>\n<0436>  <84d6>\n<0437>  <853d>\n<0438>  <6bd5>\n<0439>  <6bd9>\n<043a>  <6bd6>\n<043b>  <5e01>\n<043c>  <5e87>\n<043d>  <75f9>\n<043e>  <95ed>\n<043f>  <655d>\n<0440>  <5f0a>\n<0441>  <5fc5>\n<0442>  <8f9f>\n<0443>  <58c1>\n<0444>  <81c2>\n<0445>  <907f>\n<0446>  <965b>\n<0447>  <97ad>\n<0448>  <8fb9>\n<0449>  <7f16>\n<044a>  <8d2c>\n<044b>  <6241>\n<044c>  <4fbf>\n<044d>  <53d8>\nendbfchar\n\n100 beginbfchar\n<044e>  <535e>\n<0451>  <8fab>\n<0452>  <904d>\n<0453>  <6807>\n<0454>  <5f6a>\n<0455>  <8198>\n<0456>  <8868>\n<0457>  <9cd6>\n<0458>  <618b>\n<0459>  <522b>\n<045a>  <762a>\n<045b>  <5f6c>\n<045c>  <658c>\n<045d>  <6fd2>\n<045e>  <6ee8>\n<045f>  <5bbe>\n<0460>  <6448>\n<0461>  <5175>\n<0462>  <51b0>\n<0463>  <67c4>\n<0464>  <4e19>\n<0465>  <79c9>\n<0466>  <997c>\n<0467>  <70b3>\n<0468>  <75c5>\n<0469>  <5e76>\n<046a>  <73bb>\n<046b>  <83e0>\n<046c>  <64ad>\n<046d>  <62e8>\n<046e>  <94b5>\n<046f>  <6ce2>\n<0470>  <535a>\n<0471>  <52c3>\n<0472>  <640f>\n<0473>  <94c2>\n<0474>  <7b94>\n<0475>  <4f2f>\n<0476>  <5e1b>\n<0477>  <8236>\n<0478>  <8116>\n<0479>  <818a>\n<047a>  <6e24>\n<047b>  <6cca>\n<047c>  <9a73>\n<047d>  <6355>\n<047e>  <535c>\n<047f>  <54fa>\n<0480>  <8865>\n<0481>  <57e0>\n<0482>  <4e0d>\n<0483>  <5e03>\n<0484>  <6b65>\n<0485>  <7c3f>\n<0486>  <90e8>\n<0487>  <6016>\n<0488>  <64e6>\n<0489>  <731c>\n<048a>  <88c1>\n<048b>  <6750>\n<048c>  <624d>\n<048d>  <8d22>\n<048e>  <776c>\n<048f>  <8e29>\n<0490>  <91c7>\n<0491>  <5f69>\n<0492>  <83dc>\n<0493>  <8521>\n<0494>  <9910>\n<0495>  <53c2>\n<0496>  <8695>\n<0497>  <6b8b>\n<0498>  <60ed>\n<0499>  <60e8>\n<049a>  <707f>\n<049b>  <82cd>\n<049c>  <8231>\n<049d>  <4ed3>\n<049e>  <6ca7>\n<049f>  <85cf>\n<04a0>  <64cd>\n<04a1>  <7cd9>\n<04a2>  <69fd>\n<04a3>  <66f9>\n<04a4>  <8349>\n<04a5>  <5395>\n<04a6>  <7b56>\n<04a7>  <4fa7>\n<04a8>  <518c>\n<04a9>  <6d4b>\n<04aa>  <5c42>\n<04ab>  <8e6d>\n<04ac>  <63d2>\n<04ad>  <53c9>\n<04ae>  <832c>\n<04af>  <8336>\n<04b0>  <67e5>\n<04b1>  <78b4>\n<04b2>  <643d>\n<04b3>  <5bdf>\nendbfchar\n\n100 beginbfchar\n<04b4>  <5c94>\n<04b5>  <5dee>\n<04b6>  <8be7>\n<04b7>  <62c6>\n<04b8>  <67f4>\n<04b9>  <8c7a>\n<04ba>  <6400>\n<04bb>  <63ba>\n<04bc>  <8749>\n<04bd>  <998b>\n<04be>  <8c17>\n<04bf>  <7f20>\n<04c0>  <94f2>\n<04c1>  <4ea7>\n<04c2>  <9610>\n<04c3>  <98a4>\n<04c4>  <660c>\n<04c5>  <7316>\n<04c6>  <573a>\n<04c7>  <5c1d>\n<04c8>  <5e38>\n<04c9>  <957f>\n<04ca>  <507f>\n<04cb>  <80a0>\n<04cc>  <5382>\n<04cd>  <655e>\n<04ce>  <7545>\n<04cf>  <5531>\n<04d0>  <5021>\n<04d1>  <8d85>\n<04d2>  <6284>\n<04d3>  <949e>\n<04d4>  <671d>\n<04d5>  <5632>\n<04d6>  <6f6e>\n<04d7>  <5de2>\n<04d8>  <5435>\n<04d9>  <7092>\n<04da>  <8f66>\n<04db>  <626f>\n<04dc>  <64a4>\n<04dd>  <63a3>\n<04de>  <5f7b>\n<04df>  <6f88>\n<04e0>  <90f4>\n<04e1>  <81e3>\n<04e2>  <8fb0>\n<04e3>  <5c18>\n<04e4>  <6668>\n<04e5>  <5ff1>\n<04e6>  <6c89>\n<04e7>  <9648>\n<04e8>  <8d81>\n<04e9>  <886c>\n<04ea>  <6491>\n<04eb>  <79f0>\n<04ec>  <57ce>\n<04ed>  <6a59>\n<04ee>  <6210>\n<04ef>  <5448>\n<04f0>  <4e58>\n<04f1>  <7a0b>\n<04f2>  <60e9>\n<04f3>  <6f84>\n<04f4>  <8bda>\n<04f5>  <627f>\n<04f6>  <901e>\n<04f7>  <9a8b>\n<04f8>  <79e4>\n<04f9>  <5403>\n<04fa>  <75f4>\n<04fb>  <6301>\n<04fc>  <5319>\n<04fd>  <6c60>\n<04fe>  <8fdf>\n<04ff>  <5f1b>\n<0500>  <9a70>\n<0501>  <803b>\n<0502>  <9f7f>\n<0503>  <4f88>\n<0504>  <5c3a>\n<0505>  <8d64>\n<0506>  <7fc5>\n<0507>  <65a5>\n<0508>  <70bd>\n<0509>  <5145>\n<050a>  <51b2>\n<050b>  <866b>\n<050c>  <5d07>\n<050d>  <5ba0>\n<050e>  <62bd>\n<050f>  <916c>\n<0510>  <7574>\n<0511>  <8e0c>\n<0512>  <7a20>\n<0513>  <6101>\n<0514>  <7b79>\n<0515>  <4ec7>\n<0516>  <7ef8>\n<0517>  <7785>\nendbfchar\n\n100 beginbfchar\n<0518>  <4e11>\n<0519>  <81ed>\n<051a>  <521d>\n<051b>  <51fa>\n<051c>  <6a71>\n<051d>  <53a8>\n<051e>  <8e87>\n<051f>  <9504>\n<0520>  <96cf>\n<0521>  <6ec1>\n<0522>  <9664>\n<0523>  <695a>\n<0524>  <7840>\n<0525>  <50a8>\n<0526>  <77d7>\n<0527>  <6410>\n<0528>  <89e6>\n<0529>  <5904>\n<052a>  <63e3>\n<052b>  <5ddd>\n<052c>  <7a7f>\n<052d>  <693d>\n<052e>  <4f20>\n<052f>  <8239>\n<0530>  <5598>\n<0531>  <4e32>\n<0532>  <75ae>\n<0533>  <7a97>\n<0534>  <5e62>\n<0535>  <5e8a>\n<0536>  <95ef>\n<0537>  <521b>\n<0538>  <5439>\n<0539>  <708a>\n<053a>  <6376>\n<053b>  <9524>\n<053c>  <5782>\n<053d>  <6625>\n<053e>  <693f>\n<053f>  <9187>\n<0540>  <5507>\n<0541>  <6df3>\n<0542>  <7eaf>\n<0543>  <8822>\n<0544>  <6233>\n<0545>  <7ef0>\n<0546>  <75b5>\n<0547>  <8328>\n<0548>  <78c1>\n<0549>  <96cc>\n<054a>  <8f9e>\n<054b>  <6148>\n<054c>  <74f7>\n<054d>  <8bcd>\n<054e>  <6b64>\n<054f>  <523a>\n<0550>  <8d50>\n<0551>  <6b21>\n<0552>  <806a>\n<0553>  <8471>\n<0554>  <56f1>\n<0555>  <5306>\n<0556>  <4ece>\n<0557>  <4e1b>\n<0558>  <51d1>\n<0559>  <7c97>\n<055a>  <918b>\n<055b>  <7c07>\n<055c>  <4fc3>\n<055d>  <8e7f>\n<055e>  <7be1>\n<055f>  <7a9c>\n<0560>  <6467>\n<0561>  <5d14>\n<0562>  <50ac>\n<0563>  <8106>\n<0564>  <7601>\n<0565>  <7cb9>\n<0566>  <6dec>\n<0567>  <7fe0>\n<0568>  <6751>\n<0569>  <5b58>\n<056a>  <5bf8>\n<056b>  <78cb>\n<056c>  <64ae>\n<056d>  <6413>\n<056e>  <63aa>\n<056f>  <632b>\n<0570>  <9519>\n<0571>  <642d>\n<0572>  <8fbe>\n<0573>  <7b54>\n<0574>  <7629>\n<0575>  <6253>\n<0576>  <5927>\n<0577>  <5446>\n<0578>  <6b79>\n<0579>  <50a3>\n<057a>  <6234>\n<057b>  <5e26>\nendbfchar\n\n100 beginbfchar\n<057c>  <6b86>\n<057d>  <4ee3>\n<057e>  <8d37>\n<057f>  <888b>\n<0580>  <5f85>\n<0581>  <902e>\n<0582>  <6020>\n<0583>  <803d>\n<0584>  <62c5>\n<0585>  <4e39>\n<0586>  <5355>\n<0587>  <90f8>\n<0588>  <63b8>\n<0589>  <80c6>\n<058a>  <65e6>\n<058b>  <6c2e>\n<058c>  <4f46>\n<058d>  <60ee>\n<058e>  <6de1>\n<058f>  <8bde>\n<0590>  <5f39>\n<0591>  <86cb>\n<0592>  <5f53>\n<0593>  <6321>\n<0594>  <515a>\n<0595>  <8361>\n<0596>  <6863>\n<0597>  <5200>\n<0598>  <6363>\n<0599>  <8e48>\n<059a>  <5012>\n<059b>  <5c9b>\n<059c>  <7977>\n<059d>  <5bfc>\n<059e>  <5230>\n<059f>  <7a3b>\n<05a0>  <60bc>\n<05a1>  <9053>\n<05a2>  <76d7>\n<05a3>  <5fb7>\n<05a4>  <5f97>\n<05a5>  <7684>\n<05a6>  <8e6c>\n<05a7>  <706f>\n<05a8>  <767b>\n<05a9>  <7b49>\n<05aa>  <77aa>\n<05ab>  <51f3>\n<05ac>  <9093>\n<05ad>  <5824>\n<05ae>  <4f4e>\n<05af>  <6ef4>\n<05b0>  <8fea>\n<05b1>  <654c>\n<05b2>  <7b1b>\n<05b3>  <72c4>\n<05b4>  <6da4>\n<05b5>  <7fdf>\n<05b6>  <5ae1>\n<05b7>  <62b5>\n<05b8>  <5e95>\n<05b9>  <5730>\n<05ba>  <8482>\n<05bb>  <7b2c>\n<05bc>  <5e1d>\n<05bd>  <5f1f>\n<05be>  <9012>\n<05bf>  <7f14>\n<05c0>  <98a0>\n<05c1>  <6382>\n<05c2>  <6ec7>\n<05c3>  <7898>\n<05c4>  <70b9>\n<05c5>  <5178>\n<05c6>  <975b>\n<05c7>  <57ab>\n<05c8>  <7535>\n<05c9>  <4f43>\n<05ca>  <7538>\n<05cb>  <5e97>\n<05cc>  <60e6>\n<05cd>  <5960>\n<05ce>  <6dc0>\n<05cf>  <6bbf>\n<05d0>  <7889>\n<05d1>  <53fc>\n<05d2>  <96d5>\n<05d3>  <51cb>\n<05d4>  <5201>\n<05d5>  <6389>\n<05d6>  <540a>\n<05d7>  <9493>\n<05d8>  <8c03>\n<05d9>  <8dcc>\n<05da>  <7239>\n<05db>  <789f>\n<05dc>  <8776>\n<05dd>  <8fed>\n<05de>  <8c0d>\n<05df>  <53e0>\nendbfchar\n\n100 beginbfchar\n<05e0>  <4e01>\n<05e1>  <76ef>\n<05e2>  <53ee>\n<05e3>  <9489>\n<05e4>  <9876>\n<05e5>  <9f0e>\n<05e6>  <952d>\n<05e7>  <5b9a>\n<05e8>  <8ba2>\n<05e9>  <4e22>\n<05ea>  <4e1c>\n<05eb>  <51ac>\n<05ec>  <8463>\n<05ed>  <61c2>\n<05ee>  <52a8>\n<05ef>  <680b>\n<05f0>  <4f97>\n<05f1>  <606b>\n<05f2>  <51bb>\n<05f3>  <6d1e>\n<05f4>  <515c>\n<05f5>  <6296>\n<05f6>  <6597>\n<05f7>  <9661>\n<05f8>  <8c46>\n<05f9>  <9017>\n<05fa>  <75d8>\n<05fb>  <90fd>\n<05fc>  <7763>\n<05fd>  <6bd2>\n<05fe>  <728a>\n<05ff>  <72ec>\n<0600>  <8bfb>\n<0601>  <5835>\n<0602>  <7779>\n<0603>  <8d4c>\n<0604>  <675c>\n<0605>  <9540>\n<0606>  <809a>\n<0607>  <5ea6>\n<0608>  <6e21>\n<0609>  <5992>\n<060a>  <7aef>\n<060b>  <77ed>\n<060c>  <953b>\n<060d>  <6bb5>\n<060e>  <65ad>\n<060f>  <7f0e>\n<0610>  <5806>\n<0611>  <5151>\n<0612>  <961f>\n<0613>  <5bf9>\n<0614>  <58a9>\n<0615>  <5428>\n<0616>  <8e72>\n<0617>  <6566>\n<0618>  <987f>\n<0619>  <56e4>\n<061a>  <949d>\n<061b>  <76fe>\n<061c>  <9041>\n<061d>  <6387>\n<061e>  <54c6>\n<061f>  <591a>\n<0620>  <593a>\n<0621>  <579b>\n<0622>  <8eb2>\n<0623>  <6735>\n<0624>  <8dfa>\n<0625>  <8235>\n<0626>  <5241>\n<0627>  <60f0>\n<0628>  <5815>\n<0629>  <86fe>\n<062a>  <5ce8>\n<062b>  <9e45>\n<062c>  <4fc4>\n<062d>  <989d>\n<062e>  <8bb9>\n<062f>  <5a25>\n<0630>  <6076>\n<0631>  <5384>\n<0632>  <627c>\n<0633>  <904f>\n<0634>  <9102>\n<0635>  <997f>\n<0636>  <6069>\n<0637>  <800c>\n<0638>  <513f>\n<0639>  <8033>\n<063a>  <5c14>\n<063b>  <9975>\n<063c>  <6d31>\n<063d>  <4e8c>\n<063e>  <8d30>\n<063f>  <53d1>\n<0640>  <7f5a>\n<0641>  <7b4f>\n<0642>  <4f10>\n<0643>  <4e4f>\nendbfchar\n\n100 beginbfchar\n<0644>  <9600>\n<0645>  <6cd5>\n<0646>  <73d0>\n<0647>  <85e9>\n<0648>  <5e06>\n<0649>  <756a>\n<064a>  <7ffb>\n<064b>  <6a0a>\n<064c>  <77fe>\n<064d>  <9492>\n<064e>  <7e41>\n<064f>  <51e1>\n<0650>  <70e6>\n<0651>  <53cd>\n<0652>  <8fd4>\n<0653>  <8303>\n<0654>  <8d29>\n<0655>  <72af>\n<0656>  <996d>\n<0657>  <6cdb>\n<0658>  <574a>\n<0659>  <82b3>\n<065a>  <65b9>\n<065b>  <80aa>\n<065c>  <623f>\n<065d>  <9632>\n<065e>  <59a8>\n<065f>  <4eff>\n<0660>  <8bbf>\n<0661>  <7eba>\n<0662>  <653e>\n<0663>  <83f2>\n<0664>  <975e>\n<0665>  <5561>\n<0666>  <98de>\n<0667>  <80a5>\n<0668>  <532a>\n<0669>  <8bfd>\n<066a>  <5420>\n<066b>  <80ba>\n<066c>  <5e9f>\n<066d>  <6cb8>\n<066e>  <8d39>\n<066f>  <82ac>\n<0670>  <915a>\n<0671>  <5429>\n<0672>  <6c1b>\n<0673>  <5206>\n<0674>  <7eb7>\n<0675>  <575f>\n<0676>  <711a>\n<0677>  <6c7e>\n<0678>  <7c89>\n<0679>  <594b>\n<067a>  <4efd>\n<067b>  <5fff>\n<067c>  <6124>\n<067d>  <7caa>\n<067e>  <4e30>\n<067f>  <5c01>\n<0680>  <67ab>\n<0681>  <8702>\n<0682>  <5cf0>\n<0683>  <950b>\n<0684>  <98ce>\n<0685>  <75af>\n<0686>  <70fd>\n<0687>  <9022>\n<0688>  <51af>\n<0689>  <7f1d>\n<068a>  <8bbd>\n<068b>  <5949>\n<068c>  <51e4>\n<068d>  <4f5b>\n<068e>  <5426>\n<068f>  <592b>\n<0690>  <6577>\n<0691>  <80a4>\n<0692>  <5b75>\n<0693>  <6276>\n<0694>  <62c2>\n<0695>  <8f90>\n<0696>  <5e45>\n<0697>  <6c1f>\n<0698>  <7b26>\n<0699>  <4f0f>\n<069a>  <4fd8>\n<069b>  <670d>\n<069c>  <6d6e>\n<069d>  <6daa>\n<069e>  <798f>\n<069f>  <88b1>\n<06a0>  <5f17>\n<06a1>  <752b>\n<06a2>  <629a>\n<06a3>  <8f85>\n<06a4>  <4fef>\n<06a5>  <91dc>\n<06a6>  <65a7>\n<06a7>  <812f>\nendbfchar\n\n100 beginbfchar\n<06a8>  <8151>\n<06a9>  <5e9c>\n<06aa>  <8150>\n<06ab>  <8d74>\n<06ac>  <526f>\n<06ad>  <8986>\n<06ae>  <8d4b>\n<06af>  <590d>\n<06b0>  <5085>\n<06b1>  <4ed8>\n<06b2>  <961c>\n<06b3>  <7236>\n<06b4>  <8179>\n<06b5>  <8d1f>\n<06b6>  <5bcc>\n<06b7>  <8ba3>\n<06b8>  <9644>\n<06b9>  <5987>\n<06ba>  <7f1a>\n<06bb>  <5490>\n<06bc>  <5676>\n<06bd>  <560e>\n<06be>  <8be5>\n<06bf>  <6539>\n<06c0>  <6982>\n<06c1>  <9499>\n<06c2>  <76d6>\n<06c3>  <6e89>\n<06c4>  <5e72>\n<06c5>  <7518>\n<06c6>  <6746>\n<06c7>  <67d1>\n<06c8>  <7aff>\n<06c9>  <809d>\n<06ca>  <8d76>\n<06cb>  <611f>\n<06cc>  <79c6>\n<06cd>  <6562>\n<06ce>  <8d63>\n<06cf>  <5188>\n<06d0>  <521a>\n<06d1>  <94a2>\n<06d2>  <7f38>\n<06d3>  <809b>\n<06d4>  <7eb2>\n<06d5>  <5c97>\n<06d6>  <6e2f>\n<06d7>  <6760>\n<06d8>  <7bd9>\n<06d9>  <768b>\n<06da>  <9ad8>\n<06db>  <818f>\n<06dc>  <7f94>\n<06dd>  <7cd5>\n<06de>  <641e>\n<06df>  <9550>\n<06e0>  <7a3f>\n<06e1>  <544a>\n<06e2>  <54e5>\n<06e3>  <6b4c>\n<06e4>  <6401>\n<06e5>  <6208>\n<06e6>  <9e3d>\n<06e7>  <80f3>\n<06e8>  <7599>\n<06e9>  <5272>\n<06ea>  <9769>\n<06eb>  <845b>\n<06ec>  <683c>\n<06ed>  <86e4>\n<06ee>  <9601>\n<06ef>  <9694>\n<06f0>  <94ec>\n<06f1>  <4e2a>\n<06f2>  <5404>\n<06f3>  <7ed9>\n<06f4>  <6839>\n<06f5>  <8ddf>\n<06f6>  <8015>\n<06f7>  <66f4>\n<06f8>  <5e9a>\n<06f9>  <7fb9>\n<06fa>  <57c2>\n<06fb>  <803f>\n<06fc>  <6897>\n<06fd>  <5de5>\n<06fe>  <653b>\n<06ff>  <529f>\n<0700>  <606d>\n<0701>  <9f9a>\n<0702>  <4f9b>\n<0703>  <8eac>\n<0704>  <516c>\n<0705>  <5bab>\n<0706>  <5f13>\n<0707>  <5de9>\n<0708>  <6c5e>\n<0709>  <62f1>\n<070a>  <8d21>\n<070b>  <5171>\nendbfchar\n\n100 beginbfchar\n<070c>  <94a9>\n<070d>  <52fe>\n<070e>  <6c9f>\n<070f>  <82df>\n<0710>  <72d7>\n<0711>  <57a2>\n<0712>  <6784>\n<0713>  <8d2d>\n<0714>  <591f>\n<0715>  <8f9c>\n<0716>  <83c7>\n<0717>  <5495>\n<0718>  <7b8d>\n<0719>  <4f30>\n<071a>  <6cbd>\n<071b>  <5b64>\n<071c>  <59d1>\n<071d>  <9f13>\n<071e>  <53e4>\n<071f>  <86ca>\n<0720>  <9aa8>\n<0721>  <8c37>\n<0722>  <80a1>\n<0723>  <6545>\n<0724>  <987e>\n<0725>  <56fa>\n<0726>  <96c7>\n<0727>  <522e>\n<0728>  <74dc>\n<0729>  <5250>\n<072a>  <5be1>\n<072b>  <6302>\n<072c>  <8902>\n<072d>  <4e56>\n<072e>  <62d0>\n<072f>  <602a>\n<0730>  <68fa>\n<0731>  <5173>\n<0732>  <5b98>\n<0733>  <51a0>\n<0734>  <89c2>\n<0735>  <7ba1>\n<0736>  <9986>\n<0737>  <7f50>\n<0738>  <60ef>\n<0739>  <704c>\n<073a>  <8d2f>\n<073b>  <5149>\n<073c>  <5e7f>\n<073d>  <901b>\n<073e>  <7470>\n<073f>  <89c4>\n<0740>  <572d>\n<0741>  <7845>\n<0742>  <5f52>\n<0743>  <9f9f>\n<0744>  <95fa>\n<0745>  <8f68>\n<0746>  <9b3c>\n<0747>  <8be1>\n<0748>  <7678>\n<0749>  <6842>\n<074a>  <67dc>\n<074b>  <8dea>\n<074c>  <8d35>\n<074d>  <523d>\n<074e>  <8f8a>\n<074f>  <6eda>\n<0750>  <68cd>\n<0751>  <9505>\n<0752>  <90ed>\n<0753>  <56fd>\n<0754>  <679c>\n<0755>  <88f9>\n<0756>  <8fc7>\n<0757>  <54c8>\n<0758>  <9ab8>\n<0759>  <5b69>\n<075a>  <6d77>\n<075b>  <6c26>\n<075c>  <4ea5>\n<075d>  <5bb3>\n<075e>  <9a87>\n<075f>  <9163>\n<0760>  <61a8>\n<0761>  <90af>\n<0762>  <97e9>\n<0763>  <542b>\n<0764>  <6db5>\n<0765>  <5bd2>\n<0766>  <51fd>\n<0767>  <558a>\n<0768>  <7f55>\n<0769>  <7ff0>\n<076a>  <64bc>\n<076b>  <634d>\n<076c>  <65f1>\n<076d>  <61be>\n<076e>  <608d>\n<076f>  <710a>\nendbfchar\n\n100 beginbfchar\n<0770>  <6c57>\n<0771>  <6c49>\n<0772>  <592f>\n<0773>  <676d>\n<0774>  <822a>\n<0775>  <58d5>\n<0776>  <568e>\n<0777>  <8c6a>\n<0778>  <6beb>\n<0779>  <90dd>\n<077a>  <597d>\n<077b>  <8017>\n<077c>  <53f7>\n<077d>  <6d69>\n<077e>  <5475>\n<077f>  <559d>\n<0780>  <8377>\n<0781>  <83cf>\n<0782>  <6838>\n<0783>  <79be>\n<0784>  <548c>\n<0785>  <4f55>\n<0786>  <5408>\n<0787>  <76d2>\n<0788>  <8c89>\n<0789>  <9602>\n<078a>  <6cb3>\n<078b>  <6db8>\n<078c>  <8d6b>\n<078d>  <8910>\n<078e>  <9e64>\n<078f>  <8d3a>\n<0790>  <563f>\n<0791>  <9ed1>\n<0792>  <75d5>\n<0793>  <5f88>\n<0794>  <72e0>\n<0795>  <6068>\n<0796>  <54fc>\n<0797>  <4ea8>\n<0798>  <6a2a>\n<0799>  <8861>\n<079a>  <6052>\n<079b>  <8f70>\n<079c>  <54c4>\n<079d>  <70d8>\n<079e>  <8679>\n<079f>  <9e3f>\n<07a0>  <6d2a>\n<07a1>  <5b8f>\n<07a2>  <5f18>\n<07a3>  <7ea2>\n<07a4>  <5589>\n<07a5>  <4faf>\n<07a6>  <7334>\n<07a7>  <543c>\n<07a8>  <539a>\n<07a9>  <5019>\n<07aa>  <540e>\n<07ab>  <547c>\n<07ac>  <4e4e>\n<07ad>  <5ffd>\n<07ae>  <745a>\n<07af>  <58f6>\n<07b0>  <846b>\n<07b1>  <80e1>\n<07b2>  <8774>\n<07b3>  <72d0>\n<07b4>  <7cca>\n<07b5>  <6e56>\n<07b6>  <5f27>\n<07b7>  <864e>\n<07b8>  <552c>\n<07b9>  <62a4>\n<07ba>  <4e92>\n<07bb>  <6caa>\n<07bc>  <6237>\n<07bd>  <82b1>\n<07be>  <54d7>\n<07bf>  <534e>\n<07c0>  <733e>\n<07c1>  <6ed1>\n<07c2>  <753b>\n<07c3>  <5212>\n<07c4>  <5316>\n<07c5>  <8bdd>\n<07c6>  <69d0>\n<07c7>  <5f8a>\n<07c8>  <6000>\n<07c9>  <6dee>\n<07ca>  <574f>\n<07cb>  <6b22>\n<07cc>  <73af>\n<07cd>  <6853>\n<07ce>  <8fd8>\n<07cf>  <7f13>\n<07d0>  <6362>\n<07d1>  <60a3>\n<07d2>  <5524>\n<07d3>  <75ea>\nendbfchar\n\n100 beginbfchar\n<07d4>  <8c62>\n<07d5>  <7115>\n<07d6>  <6da3>\n<07d7>  <5ba6>\n<07d8>  <5e7b>\n<07d9>  <8352>\n<07da>  <614c>\n<07db>  <9ec4>\n<07dc>  <78fa>\n<07dd>  <8757>\n<07de>  <7c27>\n<07df>  <7687>\n<07e0>  <51f0>\n<07e1>  <60f6>\n<07e2>  <714c>\n<07e3>  <6643>\n<07e4>  <5e4c>\n<07e5>  <604d>\n<07e6>  <8c0e>\n<07e7>  <7070>\n<07e8>  <6325>\n<07e9>  <8f89>\n<07ea>  <5fbd>\n<07eb>  <6062>\n<07ec>  <86d4>\n<07ed>  <56de>\n<07ee>  <6bc1>\n<07ef>  <6094>\n<07f0>  <6167>\n<07f1>  <5349>\n<07f2>  <60e0>\n<07f3>  <6666>\n<07f4>  <8d3f>\n<07f5>  <79fd>\n<07f6>  <4f1a>\n<07f7>  <70e9>\n<07f8>  <6c47>\n<07f9>  <8bb3>\n<07fa>  <8bf2>\n<07fb>  <7ed8>\n<07fc>  <8364>\n<07fd>  <660f>\n<07fe>  <5a5a>\n<07ff>  <9b42>\n<0800>  <6d51>\n<0801>  <6df7>\n<0802>  <8c41>\n<0803>  <6d3b>\n<0804>  <4f19>\n<0805>  <706b>\n<0806>  <83b7>\n<0807>  <6216>\n<0808>  <60d1>\n<0809>  <970d>\n<080a>  <8d27>\n<080b>  <7978>\n<080c>  <51fb>\n<080d>  <573e>\n<080e>  <57fa>\n<080f>  <673a>\n<0810>  <7578>\n<0811>  <7a3d>\n<0812>  <79ef>\n<0813>  <7b95>\n<0814>  <808c>\n<0815>  <9965>\n<0816>  <8ff9>\n<0817>  <6fc0>\n<0818>  <8ba5>\n<0819>  <9e21>\n<081a>  <59ec>\n<081b>  <7ee9>\n<081c>  <7f09>\n<081d>  <5409>\n<081e>  <6781>\n<081f>  <68d8>\n<0820>  <8f91>\n<0821>  <7c4d>\n<0822>  <96c6>\n<0823>  <53ca>\n<0824>  <6025>\n<0825>  <75be>\n<0826>  <6c72>\n<0827>  <5373>\n<0828>  <5ac9>\n<0829>  <7ea7>\n<082a>  <6324>\n<082b>  <51e0>\n<082c>  <810a>\n<082d>  <5df1>\n<082e>  <84df>\n<082f>  <6280>\n<0830>  <5180>\n<0831>  <5b63>\n<0832>  <4f0e>\n<0833>  <796d>\n<0834>  <5242>\n<0835>  <60b8>\n<0836>  <6d4e>\n<0837>  <5bc4>\nendbfchar\n\n100 beginbfchar\n<0838>  <5bc2>\n<0839>  <8ba1>\n<083a>  <8bb0>\n<083b>  <65e2>\n<083c>  <5fcc>\n<083d>  <9645>\n<083e>  <5993>\n<083f>  <7ee7>\n<0840>  <7eaa>\n<0841>  <5609>\n<0842>  <67b7>\n<0843>  <5939>\n<0844>  <4f73>\n<0845>  <5bb6>\n<0846>  <52a0>\n<0847>  <835a>\n<0848>  <988a>\n<0849>  <8d3e>\n<084a>  <7532>\n<084b>  <94be>\n<084c>  <5047>\n<084d>  <7a3c>\n<084e>  <4ef7>\n<084f>  <67b6>\n<0850>  <9a7e>\n<0851>  <5ac1>\n<0852>  <6b7c>\n<0853>  <76d1>\n<0854>  <575a>\n<0855>  <5c16>\n<0856>  <7b3a>\n<0857>  <95f4>\n<0858>  <714e>\n<0859>  <517c>\n<085a>  <80a9>\n<085b>  <8270>\n<085c>  <5978>\n<085d>  <7f04>\n<085e>  <8327>\n<085f>  <68c0>\n<0860>  <67ec>\n<0861>  <78b1>\n<0862>  <7877>\n<0863>  <62e3>\n<0864>  <6361>\n<0865>  <7b80>\n<0866>  <4fed>\n<0867>  <526a>\n<0868>  <51cf>\n<0869>  <8350>\n<086a>  <69db>\n<086b>  <9274>\n<086c>  <8df5>\n<086d>  <8d31>\n<086e>  <89c1>\n<086f>  <952e>\n<0870>  <7bad>\n<0871>  <4ef6>\n<0872>  <5065>\n<0873>  <8230>\n<0874>  <5251>\n<0875>  <996f>\n<0876>  <6e10>\n<0877>  <6e85>\n<0878>  <6da7>\n<0879>  <5efa>\n<087a>  <50f5>\n<087b>  <59dc>\n<087c>  <5c06>\n<087d>  <6d46>\n<087e>  <6c5f>\n<087f>  <7586>\n<0880>  <848b>\n<0881>  <6868>\n<0882>  <5956>\n<0883>  <8bb2>\n<0884>  <5320>\n<0885>  <9171>\n<0886>  <964d>\n<0887>  <8549>\n<0888>  <6912>\n<0889>  <7901>\n<088a>  <7126>\n<088b>  <80f6>\n<088c>  <4ea4>\n<088d>  <90ca>\n<088e>  <6d47>\n<088f>  <9a84>\n<0890>  <5a07>\n<0891>  <56bc>\n<0892>  <6405>\n<0893>  <94f0>\n<0894>  <77eb>\n<0895>  <4fa5>\n<0896>  <811a>\n<0897>  <72e1>\n<0898>  <89d2>\n<0899>  <997a>\n<089a>  <7f34>\n<089b>  <7ede>\nendbfchar\n\n100 beginbfchar\n<089c>  <527f>\n<089d>  <6559>\n<089e>  <9175>\n<089f>  <8f7f>\n<08a0>  <8f83>\n<08a1>  <53eb>\n<08a2>  <7a96>\n<08a3>  <63ed>\n<08a4>  <63a5>\n<08a5>  <7686>\n<08a6>  <79f8>\n<08a7>  <8857>\n<08a8>  <9636>\n<08a9>  <622a>\n<08aa>  <52ab>\n<08ab>  <8282>\n<08ac>  <6854>\n<08ad>  <6770>\n<08ae>  <6377>\n<08af>  <776b>\n<08b0>  <7aed>\n<08b1>  <6d01>\n<08b2>  <7ed3>\n<08b3>  <89e3>\n<08b4>  <59d0>\n<08b5>  <6212>\n<08b6>  <85c9>\n<08b7>  <82a5>\n<08b8>  <754c>\n<08b9>  <501f>\n<08ba>  <4ecb>\n<08bb>  <75a5>\n<08bc>  <8beb>\n<08bd>  <5c4a>\n<08be>  <5dfe>\n<08bf>  <7b4b>\n<08c0>  <65a4>\n<08c1>  <91d1>\n<08c2>  <4eca>\n<08c3>  <6d25>\n<08c4>  <895f>\n<08c5>  <7d27>\n<08c6>  <9526>\n<08c7>  <4ec5>\n<08c8>  <8c28>\n<08c9>  <8fdb>\n<08ca>  <9773>\n<08cb>  <664b>\n<08cc>  <7981>\n<08cd>  <8fd1>\n<08ce>  <70ec>\n<08cf>  <6d78>\n<08d0>  <5c3d>\n<08d1>  <52b2>\n<08d2>  <8346>\n<08d3>  <5162>\n<08d4>  <830e>\n<08d5>  <775b>\n<08d6>  <6676>\n<08d7>  <9cb8>\n<08d8>  <4eac>\n<08d9>  <60ca>\n<08da>  <7cbe>\n<08db>  <7cb3>\n<08dc>  <7ecf>\n<08dd>  <4e95>\n<08de>  <8b66>\n<08df>  <666f>\n<08e0>  <9888>\n<08e1>  <9759>\n<08e2>  <5883>\n<08e3>  <656c>\n<08e4>  <955c>\n<08e5>  <5f84>\n<08e6>  <75c9>\n<08e7>  <9756>\n<08e8>  <7adf>\n<08e9>  <7ade>\n<08ea>  <51c0>\n<08eb>  <70af>\n<08ec>  <7a98>\n<08ed>  <63ea>\n<08ee>  <7a76>\n<08ef>  <7ea0>\n<08f0>  <7396>\n<08f1>  <97ed>\n<08f2>  <4e45>\n<08f3>  <7078>\n<08f4>  <4e5d>\n<08f5>  <9152>\n<08f6>  <53a9>\n<08f7>  <6551>\n<08f8>  <65e7>\n<08f9>  <81fc>\n<08fa>  <8205>\n<08fb>  <548e>\n<08fc>  <5c31>\n<08fd>  <759a>\n<08fe>  <97a0>\n<08ff>  <62d8>\nendbfchar\n\n100 beginbfchar\n<0900>  <72d9>\n<0901>  <75bd>\n<0902>  <5c45>\n<0903>  <9a79>\n<0904>  <83ca>\n<0905>  <5c40>\n<0906>  <5480>\n<0907>  <77e9>\n<0908>  <4e3e>\n<0909>  <6cae>\n<090a>  <805a>\n<090b>  <62d2>\n<090c>  <636e>\n<090d>  <5de8>\n<090e>  <5177>\n<090f>  <8ddd>\n<0910>  <8e1e>\n<0911>  <952f>\n<0912>  <4ff1>\n<0913>  <53e5>\n<0914>  <60e7>\n<0915>  <70ac>\n<0916>  <5267>\n<0917>  <6350>\n<0918>  <9e43>\n<0919>  <5a1f>\n<091a>  <5026>\n<091b>  <7737>\n<091c>  <5377>\n<091d>  <7ee2>\n<091e>  <6485>\n<091f>  <652b>\n<0920>  <6289>\n<0921>  <6398>\n<0922>  <5014>\n<0923>  <7235>\n<0924>  <89c9>\n<0925>  <51b3>\n<0926>  <8bc0>\n<0927>  <7edd>\n<0928>  <5747>\n<0929>  <83cc>\n<092a>  <94a7>\n<092b>  <519b>\n<092c>  <541b>\n<092d>  <5cfb>\n<092e>  <4fca>\n<092f>  <7ae3>\n<0930>  <6d5a>\n<0931>  <90e1>\n<0932>  <9a8f>\n<0933>  <5580>\n<0934>  <5496>\n<0935>  <5361>\n<0936>  <54af>\n<0937>  <5f00>\n<0938>  <63e9>\n<0939>  <6977>\n<093a>  <51ef>\n<093b>  <6168>\n<093c>  <520a>\n<093d>  <582a>\n<093e>  <52d8>\n<093f>  <574e>\n<0940>  <780d>\n<0941>  <770b>\n<0942>  <5eb7>\n<0943>  <6177>\n<0944>  <7ce0>\n<0945>  <625b>\n<0946>  <6297>\n<0947>  <4ea2>\n<0948>  <7095>\n<0949>  <8003>\n<094a>  <62f7>\n<094b>  <70e4>\n<094c>  <9760>\n<094d>  <5777>\n<094e>  <82db>\n<094f>  <67ef>\n<0950>  <68f5>\n<0951>  <78d5>\n<0952>  <9897>\n<0953>  <79d1>\n<0954>  <58f3>\n<0955>  <54b3>\n<0956>  <53ef>\n<0957>  <6e34>\n<0958>  <514b>\n<0959>  <523b>\n<095a>  <5ba2>\n<095b>  <8bfe>\n<095c>  <80af>\n<095d>  <5543>\n<095e>  <57a6>\n<095f>  <6073>\n<0960>  <5751>\n<0961>  <542d>\n<0962>  <7a7a>\n<0963>  <6050>\nendbfchar\n\n100 beginbfchar\n<0964>  <5b54>\n<0965>  <63a7>\n<0966>  <62a0>\n<0967>  <53e3>\n<0968>  <6263>\n<0969>  <5bc7>\n<096a>  <67af>\n<096b>  <54ed>\n<096c>  <7a9f>\n<096d>  <82e6>\n<096e>  <9177>\n<096f>  <5e93>\n<0970>  <88e4>\n<0971>  <5938>\n<0972>  <57ae>\n<0973>  <630e>\n<0974>  <8de8>\n<0975>  <80ef>\n<0976>  <5757>\n<0977>  <7b77>\n<0978>  <4fa9>\n<0979>  <5feb>\n<097a>  <5bbd>\n<097b>  <6b3e>\n<097c>  <5321>\n<097d>  <7b50>\n<097e>  <72c2>\n<097f>  <6846>\n<0980>  <77ff>\n<0981>  <7736>\n<0982>  <65f7>\n<0983>  <51b5>\n<0984>  <4e8f>\n<0985>  <76d4>\n<0986>  <5cbf>\n<0987>  <7aa5>\n<0988>  <8475>\n<0989>  <594e>\n<098a>  <9b41>\n<098b>  <5080>\n<098c>  <9988>\n<098d>  <6127>\n<098e>  <6e83>\n<098f>  <5764>\n<0990>  <6606>\n<0991>  <6346>\n<0992>  <56f0>\n<0993>  <62ec>\n<0994>  <6269>\n<0995>  <5ed3>\n<0996>  <9614>\n<0997>  <5783>\n<0998>  <62c9>\n<0999>  <5587>\n<099a>  <8721>\n<099b>  <814a>\n<099c>  <8fa3>\n<099d>  <5566>\n<099e>  <83b1>\n<099f>  <6765>\n<09a0>  <8d56>\n<09a1>  <84dd>\n<09a2>  <5a6a>\n<09a3>  <680f>\n<09a4>  <62e6>\n<09a5>  <7bee>\n<09a6>  <9611>\n<09a7>  <5170>\n<09a8>  <6f9c>\n<09a9>  <8c30>\n<09aa>  <63fd>\n<09ab>  <89c8>\n<09ac>  <61d2>\n<09ad>  <7f06>\n<09ae>  <70c2>\n<09af>  <6ee5>\n<09b0>  <7405>\n<09b1>  <6994>\n<09b2>  <72fc>\n<09b3>  <5eca>\n<09b4>  <90ce>\n<09b5>  <6717>\n<09b6>  <6d6a>\n<09b7>  <635e>\n<09b8>  <52b3>\n<09b9>  <7262>\n<09ba>  <8001>\n<09bb>  <4f6c>\n<09bc>  <59e5>\n<09bd>  <916a>\n<09be>  <70d9>\n<09bf>  <6d9d>\n<09c0>  <52d2>\n<09c1>  <4e50>\n<09c2>  <96f7>\n<09c3>  <956d>\n<09c4>  <857e>\n<09c5>  <78ca>\n<09c6>  <7d2f>\n<09c7>  <5121>\nendbfchar\n\n100 beginbfchar\n<09c8>  <5792>\n<09c9>  <64c2>\n<09ca>  <808b>\n<09cb>  <7c7b>\n<09cc>  <6cea>\n<09cd>  <68f1>\n<09ce>  <695e>\n<09cf>  <51b7>\n<09d0>  <5398>\n<09d1>  <68a8>\n<09d2>  <7281>\n<09d3>  <9ece>\n<09d4>  <7bf1>\n<09d5>  <72f8>\n<09d6>  <79bb>\n<09d7>  <6f13>\n<09d8>  <7406>\n<09d9>  <674e>\n<09da>  <91cc>\n<09db>  <9ca4>\n<09dc>  <793c>\n<09dd>  <8389>\n<09de>  <8354>\n<09df>  <540f>\n<09e0>  <6817>\n<09e1>  <4e3d>\n<09e2>  <5389>\n<09e3>  <52b1>\n<09e4>  <783e>\n<09e5>  <5386>\n<09e6>  <5229>\n<09e7>  <5088>\n<09e8>  <4f8b>\n<09e9>  <4fd0>\n<09ea>  <75e2>\n<09eb>  <7acb>\n<09ec>  <7c92>\n<09ed>  <6ca5>\n<09ee>  <96b6>\n<09ef>  <529b>\n<09f0>  <7483>\n<09f1>  <54e9>\n<09f2>  <4fe9>\n<09f3>  <8054>\n<09f4>  <83b2>\n<09f5>  <8fde>\n<09f6>  <9570>\n<09f7>  <5ec9>\n<09f8>  <601c>\n<09f9>  <6d9f>\n<09fa>  <5e18>\n<09fb>  <655b>\n<09fc>  <8138>\n<09fd>  <94fe>\n<09fe>  <604b>\n<09ff>  <70bc>\n<0a00>  <7ec3>\n<0a01>  <7cae>\n<0a02>  <51c9>\n<0a03>  <6881>\n<0a04>  <7cb1>\n<0a05>  <826f>\n<0a06>  <4e24>\n<0a07>  <8f86>\n<0a08>  <91cf>\n<0a09>  <667e>\n<0a0a>  <4eae>\n<0a0b>  <8c05>\n<0a0c>  <64a9>\n<0a0d>  <804a>\n<0a0e>  <50da>\n<0a0f>  <7597>\n<0a10>  <71ce>\n<0a11>  <5be5>\n<0a12>  <8fbd>\n<0a13>  <6f66>\n<0a14>  <4e86>\n<0a15>  <6482>\n<0a16>  <9563>\n<0a17>  <5ed6>\n<0a18>  <6599>\n<0a19>  <5217>\n<0a1a>  <88c2>\n<0a1b>  <70c8>\n<0a1c>  <52a3>\n<0a1d>  <730e>\n<0a1e>  <7433>\n<0a1f>  <6797>\n<0a20>  <78f7>\n<0a21>  <9716>\n<0a22>  <4e34>\n<0a23>  <90bb>\n<0a24>  <9cde>\n<0a25>  <6dcb>\n<0a26>  <51db>\n<0a27>  <8d41>\n<0a28>  <541d>\n<0a29>  <62ce>\n<0a2a>  <73b2>\n<0a2b>  <83f1>\nendbfchar\n\n100 beginbfchar\n<0a2c>  <96f6>\n<0a2d>  <9f84>\n<0a2e>  <94c3>\n<0a2f>  <4f36>\n<0a30>  <7f9a>\n<0a31>  <51cc>\n<0a32>  <7075>\n<0a33>  <9675>\n<0a34>  <5cad>\n<0a35>  <9886>\n<0a36>  <53e6>\n<0a37>  <4ee4>\n<0a38>  <6e9c>\n<0a39>  <7409>\n<0a3a>  <69b4>\n<0a3b>  <786b>\n<0a3c>  <998f>\n<0a3d>  <7559>\n<0a3e>  <5218>\n<0a3f>  <7624>\n<0a40>  <6d41>\n<0a41>  <67f3>\n<0a42>  <516d>\n<0a43>  <9f99>\n<0a44>  <804b>\n<0a45>  <5499>\n<0a46>  <7b3c>\n<0a47>  <7abf>\n<0a48>  <9686>\n<0a49>  <5784>\n<0a4a>  <62e2>\n<0a4b>  <9647>\n<0a4c>  <697c>\n<0a4d>  <5a04>\n<0a4e>  <6402>\n<0a4f>  <7bd3>\n<0a50>  <6f0f>\n<0a51>  <964b>\n<0a52>  <82a6>\n<0a53>  <5362>\n<0a54>  <9885>\n<0a55>  <5e90>\n<0a56>  <7089>\n<0a57>  <63b3>\n<0a58>  <5364>\n<0a59>  <864f>\n<0a5a>  <9c81>\n<0a5b>  <9e93>\n<0a5c>  <788c>\n<0a5d>  <9732>\n<0a5e>  <8def>\n<0a5f>  <8d42>\n<0a60>  <9e7f>\n<0a61>  <6f5e>\n<0a62>  <7984>\n<0a63>  <5f55>\n<0a64>  <9646>\n<0a65>  <622e>\n<0a66>  <9a74>\n<0a67>  <5415>\n<0a68>  <94dd>\n<0a69>  <4fa3>\n<0a6a>  <65c5>\n<0a6b>  <5c65>\n<0a6c>  <5c61>\n<0a6d>  <7f15>\n<0a6e>  <8651>\n<0a6f>  <6c2f>\n<0a70>  <5f8b>\n<0a71>  <7387>\n<0a72>  <6ee4>\n<0a73>  <7eff>\n<0a74>  <5ce6>\n<0a75>  <631b>\n<0a76>  <5b6a>\n<0a77>  <6ee6>\n<0a78>  <5375>\n<0a79>  <4e71>\n<0a7a>  <63a0>\n<0a7b>  <7565>\n<0a7c>  <62a1>\n<0a7d>  <8f6e>\n<0a7e>  <4f26>\n<0a7f>  <4ed1>\n<0a80>  <6ca6>\n<0a81>  <7eb6>\n<0a82>  <8bba>\n<0a83>  <841d>\n<0a84>  <87ba>\n<0a85>  <7f57>\n<0a86>  <903b>\n<0a87>  <9523>\n<0a88>  <7ba9>\n<0a89>  <9aa1>\n<0a8a>  <88f8>\n<0a8b>  <843d>\n<0a8c>  <6d1b>\n<0a8d>  <9a86>\n<0a8e>  <7edc>\n<0a8f>  <5988>\nendbfchar\n\n100 beginbfchar\n<0a90>  <9ebb>\n<0a91>  <739b>\n<0a92>  <7801>\n<0a93>  <8682>\n<0a94>  <9a6c>\n<0a95>  <9a82>\n<0a96>  <561b>\n<0a97>  <5417>\n<0a98>  <57cb>\n<0a99>  <4e70>\n<0a9a>  <9ea6>\n<0a9b>  <5356>\n<0a9c>  <8fc8>\n<0a9d>  <8109>\n<0a9e>  <7792>\n<0a9f>  <9992>\n<0aa0>  <86ee>\n<0aa1>  <6ee1>\n<0aa2>  <8513>\n<0aa3>  <66fc>\n<0aa4>  <6162>\n<0aa5>  <6f2b>\n<0aa6>  <8c29>\n<0aa7>  <8292>\n<0aa8>  <832b>\n<0aa9>  <76f2>\n<0aaa>  <6c13>\n<0aab>  <5fd9>\n<0aac>  <83bd>\n<0aad>  <732b>\n<0aae>  <8305>\n<0aaf>  <951a>\n<0ab0>  <6bdb>\n<0ab1>  <77db>\n<0ab2>  <94c6>\n<0ab3>  <536f>\n<0ab4>  <8302>\n<0ab5>  <5192>\n<0ab6>  <5e3d>\n<0ab7>  <8c8c>\n<0ab8>  <8d38>\n<0ab9>  <4e48>\n<0aba>  <73ab>\n<0abb>  <679a>\n<0abc>  <6885>\n<0abd>  <9176>\n<0abe>  <9709>\n<0abf>  <7164>\n<0ac0>  <6ca1>\n<0ac1>  <7709>\n<0ac2>  <5a92>\n<0ac3>  <9541>\n<0ac4>  <6bcf>\n<0ac5>  <7f8e>\n<0ac6>  <6627>\n<0ac7>  <5bd0>\n<0ac8>  <59b9>\n<0ac9>  <5a9a>\n<0aca>  <95e8>\n<0acb>  <95f7>\n<0acc>  <4eec>\n<0acd>  <840c>\n<0ace>  <8499>\n<0acf>  <6aac>\n<0ad0>  <76df>\n<0ad1>  <9530>\n<0ad2>  <731b>\n<0ad3>  <68a6>\n<0ad4>  <5b5f>\n<0ad5>  <772f>\n<0ad6>  <919a>\n<0ad7>  <9761>\n<0ad8>  <7cdc>\n<0ad9>  <8ff7>\n<0ada>  <8c1c>\n<0adb>  <5f25>\n<0adc>  <7c73>\n<0add>  <79d8>\n<0ade>  <89c5>\n<0adf>  <6ccc>\n<0ae0>  <871c>\n<0ae1>  <5bc6>\n<0ae2>  <5e42>\n<0ae3>  <68c9>\n<0ae4>  <7720>\n<0ae5>  <7ef5>\n<0ae6>  <5195>\n<0ae7>  <514d>\n<0ae8>  <52c9>\n<0ae9>  <5a29>\n<0aea>  <7f05>\n<0aeb>  <9762>\n<0aec>  <82d7>\n<0aed>  <63cf>\n<0aee>  <7784>\n<0aef>  <85d0>\n<0af0>  <79d2>\n<0af1>  <6e3a>\n<0af2>  <5e99>\n<0af3>  <5999>\nendbfchar\n\n100 beginbfchar\n<0af4>  <8511>\n<0af5>  <706d>\n<0af6>  <6c11>\n<0af7>  <62bf>\n<0af8>  <76bf>\n<0af9>  <654f>\n<0afa>  <60af>\n<0afb>  <95fd>\n<0afc>  <660e>\n<0afd>  <879f>\n<0afe>  <9e23>\n<0aff>  <94ed>\n<0b00>  <540d>\n<0b01>  <547d>\n<0b02>  <8c2c>\n<0b05>  <8611>\n<0b06>  <6a21>\n<0b07>  <819c>\n<0b08>  <78e8>\n<0b09>  <6469>\n<0b0a>  <9b54>\n<0b0b>  <62b9>\n<0b0c>  <672b>\n<0b0d>  <83ab>\n<0b0e>  <58a8>\n<0b0f>  <9ed8>\n<0b10>  <6cab>\n<0b11>  <6f20>\n<0b12>  <5bde>\n<0b13>  <964c>\n<0b14>  <8c0b>\n<0b15>  <725f>\n<0b16>  <67d0>\n<0b17>  <62c7>\n<0b18>  <7261>\n<0b19>  <4ea9>\n<0b1a>  <59c6>\n<0b1b>  <6bcd>\n<0b1c>  <5893>\n<0b1d>  <66ae>\n<0b1e>  <5e55>\n<0b1f>  <52df>\n<0b20>  <6155>\n<0b21>  <6728>\n<0b22>  <76ee>\n<0b23>  <7766>\n<0b24>  <7267>\n<0b25>  <7a46>\n<0b26>  <62ff>\n<0b27>  <54ea>\n<0b28>  <5450>\n<0b29>  <94a0>\n<0b2a>  <90a3>\n<0b2b>  <5a1c>\n<0b2c>  <7eb3>\n<0b2d>  <6c16>\n<0b2e>  <4e43>\n<0b2f>  <5976>\n<0b30>  <8010>\n<0b31>  <5948>\n<0b32>  <5357>\n<0b33>  <7537>\n<0b34>  <96be>\n<0b35>  <56ca>\n<0b36>  <6320>\n<0b37>  <8111>\n<0b38>  <607c>\n<0b39>  <95f9>\n<0b3a>  <6dd6>\n<0b3b>  <5462>\n<0b3c>  <9981>\n<0b3d>  <5185>\n<0b3e>  <5ae9>\n<0b3f>  <80fd>\n<0b40>  <59ae>\n<0b41>  <9713>\n<0b42>  <502a>\n<0b43>  <6ce5>\n<0b44>  <5c3c>\n<0b45>  <62df>\n<0b46>  <4f60>\n<0b47>  <533f>\n<0b48>  <817b>\n<0b49>  <9006>\n<0b4a>  <6eba>\n<0b4b>  <852b>\n<0b4c>  <62c8>\n<0b4d>  <5e74>\n<0b4e>  <78be>\n<0b4f>  <64b5>\n<0b50>  <637b>\n<0b51>  <5ff5>\n<0b52>  <5a18>\n<0b53>  <917f>\n<0b54>  <9e1f>\n<0b55>  <5c3f>\n<0b56>  <634f>\n<0b57>  <8042>\n<0b58>  <5b7d>\n<0b59>  <556e>\nendbfchar\n\n100 beginbfchar\n<0b5a>  <954a>\n<0b5b>  <954d>\n<0b5c>  <6d85>\n<0b5d>  <60a8>\n<0b5e>  <67e0>\n<0b5f>  <72de>\n<0b60>  <51dd>\n<0b61>  <5b81>\n<0b62>  <62e7>\n<0b63>  <6cde>\n<0b64>  <725b>\n<0b65>  <626d>\n<0b66>  <94ae>\n<0b67>  <7ebd>\n<0b68>  <8113>\n<0b69>  <6d53>\n<0b6a>  <519c>\n<0b6b>  <5f04>\n<0b6c>  <5974>\n<0b6d>  <52aa>\n<0b6e>  <6012>\n<0b6f>  <5973>\n<0b70>  <6696>\n<0b71>  <8650>\n<0b72>  <759f>\n<0b73>  <632a>\n<0b74>  <61e6>\n<0b75>  <7cef>\n<0b76>  <8bfa>\n<0b77>  <54e6>\n<0b78>  <6b27>\n<0b79>  <9e25>\n<0b7a>  <6bb4>\n<0b7b>  <85d5>\n<0b7c>  <5455>\n<0b7d>  <5076>\n<0b7e>  <6ca4>\n<0b7f>  <556a>\n<0b80>  <8db4>\n<0b81>  <722c>\n<0b82>  <5e15>\n<0b83>  <6015>\n<0b84>  <7436>\n<0b85>  <62cd>\n<0b86>  <6392>\n<0b87>  <724c>\n<0b88>  <5f98>\n<0b89>  <6e43>\n<0b8a>  <6d3e>\n<0b8b>  <6500>\n<0b8c>  <6f58>\n<0b8d>  <76d8>\n<0b8e>  <78d0>\n<0b8f>  <76fc>\n<0b90>  <7554>\n<0b91>  <5224>\n<0b92>  <53db>\n<0b93>  <4e53>\n<0b94>  <5e9e>\n<0b95>  <65c1>\n<0b96>  <802a>\n<0b97>  <80d6>\n<0b98>  <629b>\n<0b99>  <5486>\n<0b9a>  <5228>\n<0b9b>  <70ae>\n<0b9c>  <888d>\n<0b9d>  <8dd1>\n<0b9e>  <6ce1>\n<0b9f>  <5478>\n<0ba0>  <80da>\n<0ba1>  <57f9>\n<0ba2>  <88f4>\n<0ba3>  <8d54>\n<0ba4>  <966a>\n<0ba5>  <914d>\n<0ba6>  <4f69>\n<0ba7>  <6c9b>\n<0ba8>  <55b7>\n<0ba9>  <76c6>\n<0baa>  <7830>\n<0bab>  <62a8>\n<0bac>  <70f9>\n<0bad>  <6f8e>\n<0bae>  <5f6d>\n<0baf>  <84ec>\n<0bb0>  <68da>\n<0bb1>  <787c>\n<0bb2>  <7bf7>\n<0bb3>  <81a8>\n<0bb4>  <670b>\n<0bb5>  <9e4f>\n<0bb6>  <6367>\n<0bb7>  <78b0>\n<0bb8>  <576f>\n<0bb9>  <7812>\n<0bba>  <9739>\n<0bbb>  <6279>\n<0bbc>  <62ab>\n<0bbd>  <5288>\nendbfchar\n\n100 beginbfchar\n<0bbe>  <7435>\n<0bbf>  <6bd7>\n<0bc0>  <5564>\n<0bc1>  <813e>\n<0bc2>  <75b2>\n<0bc3>  <76ae>\n<0bc4>  <5339>\n<0bc5>  <75de>\n<0bc6>  <50fb>\n<0bc7>  <5c41>\n<0bc8>  <8b6c>\n<0bc9>  <7bc7>\n<0bca>  <504f>\n<0bcb>  <7247>\n<0bcc>  <9a97>\n<0bcd>  <98d8>\n<0bce>  <6f02>\n<0bcf>  <74e2>\n<0bd0>  <7968>\n<0bd1>  <6487>\n<0bd2>  <77a5>\n<0bd3>  <62fc>\n<0bd4>  <9891>\n<0bd5>  <8d2b>\n<0bd6>  <54c1>\n<0bd7>  <8058>\n<0bd8>  <4e52>\n<0bd9>  <576a>\n<0bda>  <82f9>\n<0bdb>  <840d>\n<0bdc>  <5e73>\n<0bdd>  <51ed>\n<0bde>  <74f6>\n<0bdf>  <8bc4>\n<0be0>  <5c4f>\n<0be1>  <5761>\n<0be2>  <6cfc>\n<0be3>  <9887>\n<0be4>  <5a46>\n<0be5>  <7834>\n<0be6>  <9b44>\n<0be7>  <8feb>\n<0be8>  <7c95>\n<0be9>  <5256>\n<0bea>  <6251>\n<0beb>  <94fa>\n<0bec>  <4ec6>\n<0bed>  <8386>\n<0bee>  <8461>\n<0bef>  <83e9>\n<0bf0>  <84b2>\n<0bf1>  <57d4>\n<0bf2>  <6734>\n<0bf3>  <5703>\n<0bf4>  <666e>\n<0bf5>  <6d66>\n<0bf6>  <8c31>\n<0bf7>  <66dd>\n<0bf8>  <7011>\n<0bf9>  <671f>\n<0bfa>  <6b3a>\n<0bfb>  <6816>\n<0bfc>  <621a>\n<0bfd>  <59bb>\n<0bfe>  <4e03>\n<0bff>  <51c4>\n<0c00>  <6f06>\n<0c01>  <67d2>\n<0c02>  <6c8f>\n<0c03>  <5176>\n<0c04>  <68cb>\n<0c05>  <5947>\n<0c06>  <6b67>\n<0c07>  <7566>\n<0c08>  <5d0e>\n<0c09>  <8110>\n<0c0a>  <9f50>\n<0c0b>  <65d7>\n<0c0c>  <7948>\n<0c0d>  <7941>\n<0c0e>  <9a91>\n<0c0f>  <8d77>\n<0c10>  <5c82>\n<0c11>  <4e5e>\n<0c12>  <4f01>\n<0c13>  <542f>\n<0c14>  <5951>\n<0c15>  <780c>\n<0c16>  <5668>\n<0c17>  <6c14>\n<0c18>  <8fc4>\n<0c19>  <5f03>\n<0c1a>  <6c7d>\n<0c1b>  <6ce3>\n<0c1c>  <8bab>\n<0c1d>  <6390>\n<0c1e>  <6070>\n<0c1f>  <6d3d>\n<0c20>  <7275>\n<0c21>  <6266>\nendbfchar\n\n100 beginbfchar\n<0c22>  <948e>\n<0c23>  <94c5>\n<0c24>  <5343>\n<0c25>  <8fc1>\n<0c26>  <7b7e>\n<0c27>  <4edf>\n<0c28>  <8c26>\n<0c29>  <4e7e>\n<0c2a>  <9ed4>\n<0c2b>  <94b1>\n<0c2c>  <94b3>\n<0c2d>  <524d>\n<0c2e>  <6f5c>\n<0c2f>  <9063>\n<0c30>  <6d45>\n<0c31>  <8c34>\n<0c32>  <5811>\n<0c33>  <5d4c>\n<0c34>  <6b20>\n<0c35>  <6b49>\n<0c36>  <67aa>\n<0c37>  <545b>\n<0c38>  <8154>\n<0c39>  <7f8c>\n<0c3a>  <5899>\n<0c3b>  <8537>\n<0c3c>  <5f3a>\n<0c3d>  <62a2>\n<0c3e>  <6a47>\n<0c3f>  <9539>\n<0c40>  <6572>\n<0c41>  <6084>\n<0c42>  <6865>\n<0c43>  <77a7>\n<0c44>  <4e54>\n<0c45>  <4fa8>\n<0c46>  <5de7>\n<0c47>  <9798>\n<0c48>  <64ac>\n<0c49>  <7fd8>\n<0c4a>  <5ced>\n<0c4b>  <4fcf>\n<0c4c>  <7a8d>\n<0c4d>  <5207>\n<0c4e>  <8304>\n<0c4f>  <4e14>\n<0c50>  <602f>\n<0c51>  <7a83>\n<0c52>  <94a6>\n<0c53>  <4fb5>\n<0c54>  <4eb2>\n<0c55>  <79e6>\n<0c56>  <7434>\n<0c57>  <52e4>\n<0c58>  <82b9>\n<0c59>  <64d2>\n<0c5a>  <79bd>\n<0c5b>  <5bdd>\n<0c5c>  <6c81>\n<0c5d>  <9752>\n<0c5e>  <8f7b>\n<0c5f>  <6c22>\n<0c60>  <503e>\n<0c61>  <537f>\n<0c62>  <6e05>\n<0c63>  <64ce>\n<0c64>  <6674>\n<0c65>  <6c30>\n<0c66>  <60c5>\n<0c67>  <9877>\n<0c68>  <8bf7>\n<0c69>  <5e86>\n<0c6a>  <743c>\n<0c6b>  <7a77>\n<0c6c>  <79cb>\n<0c6d>  <4e18>\n<0c6e>  <90b1>\n<0c6f>  <7403>\n<0c70>  <6c42>\n<0c71>  <56da>\n<0c72>  <914b>\n<0c73>  <6cc5>\n<0c74>  <8d8b>\n<0c75>  <533a>\n<0c76>  <86c6>\n<0c77>  <66f2>\n<0c78>  <8eaf>\n<0c79>  <5c48>\n<0c7a>  <9a71>\n<0c7b>  <6e20>\n<0c7c>  <53d6>\n<0c7d>  <5a36>\n<0c7e>  <9f8b>\n<0c7f>  <8da3>\n<0c80>  <53bb>\n<0c81>  <5708>\n<0c82>  <98a7>\n<0c83>  <6743>\n<0c84>  <919b>\n<0c85>  <6cc9>\nendbfchar\n\n100 beginbfchar\n<0c86>  <5168>\n<0c87>  <75ca>\n<0c88>  <62f3>\n<0c89>  <72ac>\n<0c8a>  <5238>\n<0c8b>  <529d>\n<0c8c>  <7f3a>\n<0c8d>  <7094>\n<0c8e>  <7638>\n<0c8f>  <5374>\n<0c90>  <9e4a>\n<0c91>  <69b7>\n<0c92>  <786e>\n<0c93>  <96c0>\n<0c94>  <88d9>\n<0c95>  <7fa4>\n<0c96>  <7136>\n<0c97>  <71c3>\n<0c98>  <5189>\n<0c99>  <67d3>\n<0c9a>  <74e4>\n<0c9b>  <58e4>\n<0c9c>  <6518>\n<0c9d>  <56b7>\n<0c9e>  <8ba9>\n<0c9f>  <9976>\n<0ca0>  <6270>\n<0ca1>  <7ed5>\n<0ca2>  <60f9>\n<0ca3>  <70ed>\n<0ca4>  <58ec>\n<0ca5>  <4ec1>\n<0ca6>  <4eba>\n<0ca7>  <5fcd>\n<0ca8>  <97e7>\n<0ca9>  <4efb>\n<0caa>  <8ba4>\n<0cab>  <5203>\n<0cac>  <598a>\n<0cad>  <7eab>\n<0cae>  <6254>\n<0caf>  <4ecd>\n<0cb0>  <65e5>\n<0cb1>  <620e>\n<0cb2>  <8338>\n<0cb3>  <84c9>\n<0cb4>  <8363>\n<0cb5>  <878d>\n<0cb6>  <7194>\n<0cb7>  <6eb6>\n<0cb8>  <5bb9>\n<0cb9>  <7ed2>\n<0cba>  <5197>\n<0cbb>  <63c9>\n<0cbc>  <67d4>\n<0cbd>  <8089>\n<0cbe>  <8339>\n<0cbf>  <8815>\n<0cc0>  <5112>\n<0cc1>  <5b7a>\n<0cc2>  <5982>\n<0cc3>  <8fb1>\n<0cc4>  <4e73>\n<0cc5>  <6c5d>\n<0cc6>  <5165>\n<0cc7>  <8925>\n<0cc8>  <8f6f>\n<0cc9>  <962e>\n<0cca>  <854a>\n<0ccb>  <745e>\n<0ccc>  <9510>\n<0ccd>  <95f0>\n<0cce>  <6da6>\n<0ccf>  <82e5>\n<0cd0>  <5f31>\n<0cd1>  <6492>\n<0cd2>  <6d12>\n<0cd3>  <8428>\n<0cd4>  <816e>\n<0cd5>  <9cc3>\n<0cd6>  <585e>\n<0cd7>  <8d5b>\n<0cd8>  <4e09>\n<0cd9>  <53c1>\n<0cda>  <4f1e>\n<0cdb>  <6563>\n<0cdc>  <6851>\n<0cdd>  <55d3>\n<0cde>  <4e27>\n<0cdf>  <6414>\n<0ce0>  <9a9a>\n<0ce1>  <626b>\n<0ce2>  <5ac2>\n<0ce3>  <745f>\n<0ce4>  <8272>\n<0ce5>  <6da9>\n<0ce6>  <68ee>\n<0ce7>  <50e7>\n<0ce8>  <838e>\n<0ce9>  <7802>\nendbfchar\n\n100 beginbfchar\n<0cea>  <6740>\n<0ceb>  <5239>\n<0cec>  <6c99>\n<0ced>  <7eb1>\n<0cee>  <50bb>\n<0cef>  <5565>\n<0cf0>  <715e>\n<0cf1>  <7b5b>\n<0cf2>  <6652>\n<0cf3>  <73ca>\n<0cf4>  <82eb>\n<0cf5>  <6749>\n<0cf6>  <5c71>\n<0cf7>  <5220>\n<0cf8>  <717d>\n<0cf9>  <886b>\n<0cfa>  <95ea>\n<0cfb>  <9655>\n<0cfc>  <64c5>\n<0cfd>  <8d61>\n<0cfe>  <81b3>\n<0cff>  <5584>\n<0d00>  <6c55>\n<0d01>  <6247>\n<0d02>  <7f2e>\n<0d03>  <5892>\n<0d04>  <4f24>\n<0d05>  <5546>\n<0d06>  <8d4f>\n<0d07>  <664c>\n<0d08>  <4e0a>\n<0d09>  <5c1a>\n<0d0a>  <88f3>\n<0d0b>  <68a2>\n<0d0c>  <634e>\n<0d0d>  <7a0d>\n<0d0e>  <70e7>\n<0d0f>  <828d>\n<0d10>  <52fa>\n<0d11>  <97f6>\n<0d12>  <5c11>\n<0d13>  <54e8>\n<0d14>  <90b5>\n<0d15>  <7ecd>\n<0d16>  <5962>\n<0d17>  <8d4a>\n<0d18>  <86c7>\n<0d1b>  <8d66>\n<0d1c>  <6444>\n<0d1d>  <5c04>\n<0d1e>  <6151>\n<0d1f>  <6d89>\n<0d20>  <793e>\n<0d21>  <8bbe>\n<0d22>  <7837>\n<0d23>  <7533>\n<0d24>  <547b>\n<0d25>  <4f38>\n<0d26>  <8eab>\n<0d27>  <6df1>\n<0d28>  <5a20>\n<0d29>  <7ec5>\n<0d2a>  <795e>\n<0d2b>  <6c88>\n<0d2c>  <5ba1>\n<0d2d>  <5a76>\n<0d2e>  <751a>\n<0d2f>  <80be>\n<0d30>  <614e>\n<0d31>  <6e17>\n<0d32>  <58f0>\n<0d33>  <751f>\n<0d34>  <7525>\n<0d35>  <7272>\n<0d36>  <5347>\n<0d37>  <7ef3>\n<0d38>  <7701>\n<0d39>  <76db>\n<0d3a>  <5269>\n<0d3b>  <80dc>\n<0d3c>  <5723>\n<0d3d>  <5e08>\n<0d3e>  <5931>\n<0d3f>  <72ee>\n<0d40>  <65bd>\n<0d41>  <6e7f>\n<0d42>  <8bd7>\n<0d43>  <5c38>\n<0d44>  <8671>\n<0d45>  <5341>\n<0d46>  <77f3>\n<0d47>  <62fe>\n<0d48>  <65f6>\n<0d49>  <4ec0>\n<0d4a>  <98df>\n<0d4b>  <8680>\n<0d4c>  <5b9e>\n<0d4d>  <8bc6>\n<0d4e>  <53f2>\n<0d4f>  <77e2>\nendbfchar\n\n100 beginbfchar\n<0d50>  <4f7f>\n<0d51>  <5c4e>\n<0d52>  <9a76>\n<0d53>  <59cb>\n<0d54>  <5f0f>\n<0d55>  <793a>\n<0d56>  <58eb>\n<0d57>  <4e16>\n<0d58>  <67ff>\n<0d59>  <4e8b>\n<0d5a>  <62ed>\n<0d5b>  <8a93>\n<0d5c>  <901d>\n<0d5d>  <52bf>\n<0d5e>  <662f>\n<0d5f>  <55dc>\n<0d60>  <566c>\n<0d61>  <9002>\n<0d62>  <4ed5>\n<0d63>  <4f8d>\n<0d64>  <91ca>\n<0d65>  <9970>\n<0d66>  <6c0f>\n<0d67>  <5e02>\n<0d68>  <6043>\n<0d69>  <5ba4>\n<0d6a>  <89c6>\n<0d6b>  <8bd5>\n<0d6c>  <6536>\n<0d6d>  <624b>\n<0d6e>  <9996>\n<0d6f>  <5b88>\n<0d70>  <5bff>\n<0d71>  <6388>\n<0d72>  <552e>\n<0d73>  <53d7>\n<0d74>  <7626>\n<0d75>  <517d>\n<0d76>  <852c>\n<0d77>  <67a2>\n<0d78>  <68b3>\n<0d79>  <6b8a>\n<0d7a>  <6292>\n<0d7b>  <8f93>\n<0d7c>  <53d4>\n<0d7d>  <8212>\n<0d7e>  <6dd1>\n<0d7f>  <758f>\n<0d80>  <4e66>\n<0d81>  <8d4e>\n<0d82>  <5b70>\n<0d83>  <719f>\n<0d84>  <85af>\n<0d85>  <6691>\n<0d86>  <66d9>\n<0d87>  <7f72>\n<0d88>  <8700>\n<0d89>  <9ecd>\n<0d8a>  <9f20>\n<0d8b>  <5c5e>\n<0d8c>  <672f>\n<0d8d>  <8ff0>\n<0d8e>  <6811>\n<0d8f>  <675f>\n<0d90>  <620d>\n<0d91>  <7ad6>\n<0d92>  <5885>\n<0d93>  <5eb6>\n<0d94>  <6570>\n<0d95>  <6f31>\n<0d96>  <6055>\n<0d97>  <5237>\n<0d98>  <800d>\n<0d99>  <6454>\n<0d9a>  <8870>\n<0d9b>  <7529>\n<0d9c>  <5e05>\n<0d9d>  <6813>\n<0d9e>  <62f4>\n<0d9f>  <971c>\n<0da0>  <53cc>\n<0da1>  <723d>\n<0da2>  <8c01>\n<0da3>  <6c34>\n<0da4>  <7761>\n<0da5>  <7a0e>\n<0da6>  <542e>\n<0da7>  <77ac>\n<0da8>  <987a>\n<0da9>  <821c>\n<0daa>  <8bf4>\n<0dab>  <7855>\n<0dac>  <6714>\n<0dad>  <70c1>\n<0dae>  <65af>\n<0daf>  <6495>\n<0db0>  <5636>\n<0db1>  <601d>\n<0db2>  <79c1>\n<0db3>  <53f8>\nendbfchar\n\n100 beginbfchar\n<0db4>  <4e1d>\n<0db5>  <6b7b>\n<0db6>  <8086>\n<0db7>  <5bfa>\n<0db8>  <55e3>\n<0db9>  <56db>\n<0dba>  <4f3a>\n<0dbb>  <4f3c>\n<0dbc>  <9972>\n<0dbd>  <5df3>\n<0dbe>  <677e>\n<0dbf>  <8038>\n<0dc0>  <6002>\n<0dc1>  <9882>\n<0dc2>  <9001>\n<0dc3>  <5b8b>\n<0dc4>  <8bbc>\n<0dc5>  <8bf5>\n<0dc6>  <641c>\n<0dc7>  <8258>\n<0dc8>  <64de>\n<0dc9>  <55fd>\n<0dca>  <82cf>\n<0dcb>  <9165>\n<0dcc>  <4fd7>\n<0dcd>  <7d20>\n<0dce>  <901f>\n<0dcf>  <7c9f>\n<0dd0>  <50f3>\n<0dd1>  <5851>\n<0dd2>  <6eaf>\n<0dd3>  <5bbf>\n<0dd4>  <8bc9>\n<0dd5>  <8083>\n<0dd6>  <9178>\n<0dd7>  <849c>\n<0dd8>  <7b97>\n<0dd9>  <867d>\n<0dda>  <968b>\n<0ddb>  <968f>\n<0ddc>  <7ee5>\n<0ddd>  <9ad3>\n<0dde>  <788e>\n<0ddf>  <5c81>\n<0de0>  <7a57>\n<0de1>  <9042>\n<0de2>  <96a7>\n<0de3>  <795f>\n<0de4>  <5b59>\n<0de5>  <635f>\n<0de6>  <7b0b>\n<0de7>  <84d1>\n<0de8>  <68ad>\n<0de9>  <5506>\n<0dea>  <7f29>\n<0deb>  <7410>\n<0dec>  <7d22>\n<0ded>  <9501>\n<0dee>  <6240>\n<0def>  <584c>\n<0df0>  <4ed6>\n<0df1>  <5b83>\n<0df2>  <5979>\n<0df3>  <5854>\n<0df4>  <736d>\n<0df5>  <631e>\n<0df6>  <8e4b>\n<0df7>  <8e0f>\n<0df8>  <80ce>\n<0df9>  <82d4>\n<0dfa>  <62ac>\n<0dfb>  <53f0>\n<0dfc>  <6cf0>\n<0dfd>  <915e>\n<0dfe>  <592a>\n<0dff>  <6001>\n<0e00>  <6c70>\n<0e01>  <574d>\n<0e02>  <644a>\n<0e03>  <8d2a>\n<0e04>  <762b>\n<0e05>  <6ee9>\n<0e06>  <575b>\n<0e07>  <6a80>\n<0e08>  <75f0>\n<0e09>  <6f6d>\n<0e0a>  <8c2d>\n<0e0b>  <8c08>\n<0e0c>  <5766>\n<0e0d>  <6bef>\n<0e0e>  <8892>\n<0e0f>  <78b3>\n<0e10>  <63a2>\n<0e11>  <53f9>\n<0e12>  <70ad>\n<0e13>  <6c64>\n<0e14>  <5858>\n<0e15>  <642a>\n<0e16>  <5802>\n<0e17>  <68e0>\nendbfchar\n\n100 beginbfchar\n<0e18>  <819b>\n<0e19>  <5510>\n<0e1a>  <7cd6>\n<0e1b>  <5018>\n<0e1c>  <8eba>\n<0e1d>  <6dcc>\n<0e1e>  <8d9f>\n<0e1f>  <70eb>\n<0e20>  <638f>\n<0e21>  <6d9b>\n<0e22>  <6ed4>\n<0e23>  <7ee6>\n<0e24>  <8404>\n<0e25>  <6843>\n<0e26>  <9003>\n<0e27>  <6dd8>\n<0e28>  <9676>\n<0e29>  <8ba8>\n<0e2a>  <5957>\n<0e2b>  <7279>\n<0e2c>  <85e4>\n<0e2d>  <817e>\n<0e2e>  <75bc>\n<0e2f>  <8a8a>\n<0e30>  <68af>\n<0e31>  <5254>\n<0e32>  <8e22>\n<0e33>  <9511>\n<0e34>  <63d0>\n<0e35>  <9898>\n<0e36>  <8e44>\n<0e37>  <557c>\n<0e38>  <4f53>\n<0e39>  <66ff>\n<0e3a>  <568f>\n<0e3b>  <60d5>\n<0e3c>  <6d95>\n<0e3d>  <5243>\n<0e3e>  <5c49>\n<0e3f>  <5929>\n<0e40>  <6dfb>\n<0e41>  <586b>\n<0e42>  <7530>\n<0e43>  <751c>\n<0e44>  <606c>\n<0e45>  <8214>\n<0e46>  <8146>\n<0e47>  <6311>\n<0e48>  <6761>\n<0e49>  <8fe2>\n<0e4a>  <773a>\n<0e4b>  <8df3>\n<0e4c>  <8d34>\n<0e4d>  <94c1>\n<0e4e>  <5e16>\n<0e4f>  <5385>\n<0e50>  <542c>\n<0e51>  <70c3>\n<0e52>  <6c40>\n<0e53>  <5ef7>\n<0e54>  <505c>\n<0e55>  <4ead>\n<0e56>  <5ead>\n<0e57>  <633a>\n<0e58>  <8247>\n<0e59>  <901a>\n<0e5a>  <6850>\n<0e5b>  <916e>\n<0e5c>  <77b3>\n<0e5d>  <540c>\n<0e5e>  <94dc>\n<0e5f>  <5f64>\n<0e60>  <7ae5>\n<0e61>  <6876>\n<0e62>  <6345>\n<0e63>  <7b52>\n<0e64>  <7edf>\n<0e65>  <75db>\n<0e66>  <5077>\n<0e67>  <6295>\n<0e68>  <5934>\n<0e69>  <900f>\n<0e6a>  <51f8>\n<0e6b>  <79c3>\n<0e6c>  <7a81>\n<0e6d>  <56fe>\n<0e6e>  <5f92>\n<0e6f>  <9014>\n<0e70>  <6d82>\n<0e71>  <5c60>\n<0e72>  <571f>\n<0e73>  <5410>\n<0e74>  <5154>\n<0e75>  <6e4d>\n<0e76>  <56e2>\n<0e77>  <63a8>\n<0e78>  <9893>\n<0e79>  <817f>\n<0e7a>  <8715>\n<0e7b>  <892a>\nendbfchar\n\n100 beginbfchar\n<0e7c>  <9000>\n<0e7d>  <541e>\n<0e7e>  <5c6f>\n<0e7f>  <81c0>\n<0e80>  <62d6>\n<0e81>  <6258>\n<0e82>  <8131>\n<0e83>  <9e35>\n<0e84>  <9640>\n<0e85>  <9a6e>\n<0e86>  <9a7c>\n<0e87>  <692d>\n<0e88>  <59a5>\n<0e89>  <62d3>\n<0e8a>  <553e>\n<0e8b>  <6316>\n<0e8c>  <54c7>\n<0e8d>  <86d9>\n<0e8e>  <6d3c>\n<0e8f>  <5a03>\n<0e90>  <74e6>\n<0e91>  <889c>\n<0e92>  <6b6a>\n<0e93>  <5916>\n<0e94>  <8c4c>\n<0e95>  <5f2f>\n<0e96>  <6e7e>\n<0e97>  <73a9>\n<0e98>  <987d>\n<0e99>  <4e38>\n<0e9a>  <70f7>\n<0e9b>  <5b8c>\n<0e9c>  <7897>\n<0e9d>  <633d>\n<0e9e>  <665a>\n<0e9f>  <7696>\n<0ea0>  <60cb>\n<0ea1>  <5b9b>\n<0ea2>  <5a49>\n<0ea3>  <4e07>\n<0ea4>  <8155>\n<0ea5>  <6c6a>\n<0ea6>  <738b>\n<0ea7>  <4ea1>\n<0ea8>  <6789>\n<0ea9>  <7f51>\n<0eaa>  <5f80>\n<0eab>  <65fa>\n<0eac>  <671b>\n<0ead>  <5fd8>\n<0eae>  <5984>\n<0eaf>  <5a01>\n<0eb0>  <5dcd>\n<0eb1>  <5fae>\n<0eb2>  <5371>\n<0eb3>  <97e6>\n<0eb4>  <8fdd>\n<0eb5>  <6845>\n<0eb6>  <56f4>\n<0eb7>  <552f>\n<0eb8>  <60df>\n<0eb9>  <4e3a>\n<0eba>  <6f4d>\n<0ebb>  <7ef4>\n<0ebc>  <82c7>\n<0ebd>  <840e>\n<0ebe>  <59d4>\n<0ebf>  <4f1f>\n<0ec0>  <4f2a>\n<0ec1>  <5c3e>\n<0ec2>  <7eac>\n<0ec3>  <672a>\n<0ec4>  <851a>\n<0ec5>  <5473>\n<0ec6>  <754f>\n<0ec7>  <80c3>\n<0ec8>  <5582>\n<0ec9>  <9b4f>\n<0eca>  <4f4d>\n<0ecb>  <6e2d>\n<0ecc>  <8c13>\n<0ecd>  <5c09>\n<0ece>  <6170>\n<0ecf>  <536b>\n<0ed0>  <761f>\n<0ed1>  <6e29>\n<0ed2>  <868a>\n<0ed3>  <6587>\n<0ed4>  <95fb>\n<0ed5>  <7eb9>\n<0ed6>  <543b>\n<0ed7>  <7a33>\n<0ed8>  <7d0a>\n<0ed9>  <95ee>\n<0eda>  <55e1>\n<0edb>  <7fc1>\n<0edc>  <74ee>\n<0edd>  <631d>\n<0ede>  <8717>\n<0edf>  <6da1>\nendbfchar\n\n100 beginbfchar\n<0ee0>  <7a9d>\n<0ee1>  <6211>\n<0ee2>  <65a1>\n<0ee3>  <5367>\n<0ee4>  <63e1>\n<0ee5>  <6c83>\n<0ee6>  <5deb>\n<0ee7>  <545c>\n<0ee8>  <94a8>\n<0ee9>  <4e4c>\n<0eea>  <6c61>\n<0eeb>  <8bec>\n<0eec>  <5c4b>\n<0eed>  <65e0>\n<0eee>  <829c>\n<0eef>  <68a7>\n<0ef0>  <543e>\n<0ef1>  <5434>\n<0ef2>  <6bcb>\n<0ef3>  <6b66>\n<0ef4>  <4e94>\n<0ef5>  <6342>\n<0ef6>  <5348>\n<0ef7>  <821e>\n<0ef8>  <4f0d>\n<0ef9>  <4fae>\n<0efa>  <575e>\n<0efb>  <620a>\n<0efc>  <96fe>\n<0efd>  <6664>\n<0efe>  <7269>\n<0eff>  <52ff>\n<0f00>  <52a1>\n<0f01>  <609f>\n<0f02>  <8bef>\n<0f03>  <6614>\n<0f04>  <7199>\n<0f05>  <6790>\n<0f06>  <897f>\n<0f07>  <7852>\n<0f08>  <77fd>\n<0f09>  <6670>\n<0f0a>  <563b>\n<0f0b>  <5438>\n<0f0c>  <9521>\n<0f0d>  <727a>\n<0f0e>  <7a00>\n<0f0f>  <606f>\n<0f10>  <5e0c>\n<0f11>  <6089>\n<0f12>  <819d>\n<0f13>  <5915>\n<0f14>  <60dc>\n<0f15>  <7184>\n<0f16>  <70ef>\n<0f17>  <6eaa>\n<0f18>  <6c50>\n<0f19>  <7280>\n<0f1a>  <6a84>\n<0f1b>  <88ad>\n<0f1c>  <5e2d>\n<0f1d>  <4e60>\n<0f1e>  <5ab3>\n<0f1f>  <559c>\n<0f20>  <94e3>\n<0f21>  <6d17>\n<0f22>  <7cfb>\n<0f23>  <9699>\n<0f24>  <620f>\n<0f25>  <7ec6>\n<0f26>  <778e>\n<0f27>  <867e>\n<0f28>  <5323>\n<0f29>  <971e>\n<0f2a>  <8f96>\n<0f2b>  <6687>\n<0f2c>  <5ce1>\n<0f2d>  <4fa0>\n<0f2e>  <72ed>\n<0f2f>  <4e0b>\n<0f30>  <53a6>\n<0f31>  <590f>\n<0f32>  <5413>\n<0f33>  <6380>\n<0f34>  <9528>\n<0f35>  <5148>\n<0f36>  <4ed9>\n<0f37>  <9c9c>\n<0f38>  <7ea4>\n<0f39>  <54b8>\n<0f3a>  <8d24>\n<0f3b>  <8854>\n<0f3c>  <8237>\n<0f3d>  <95f2>\n<0f3e>  <6d8e>\n<0f3f>  <5f26>\n<0f40>  <5acc>\n<0f41>  <663e>\n<0f42>  <9669>\n<0f43>  <73b0>\nendbfchar\n\n100 beginbfchar\n<0f44>  <732e>\n<0f45>  <53bf>\n<0f46>  <817a>\n<0f47>  <9985>\n<0f48>  <7fa1>\n<0f49>  <5baa>\n<0f4a>  <9677>\n<0f4b>  <9650>\n<0f4c>  <7ebf>\n<0f4d>  <76f8>\n<0f4e>  <53a2>\n<0f4f>  <9576>\n<0f50>  <9999>\n<0f51>  <7bb1>\n<0f52>  <8944>\n<0f53>  <6e58>\n<0f54>  <4e61>\n<0f55>  <7fd4>\n<0f56>  <7965>\n<0f57>  <8be6>\n<0f58>  <60f3>\n<0f59>  <54cd>\n<0f5a>  <4eab>\n<0f5b>  <9879>\n<0f5c>  <5df7>\n<0f5d>  <6a61>\n<0f5e>  <50cf>\n<0f5f>  <5411>\n<0f60>  <8c61>\n<0f61>  <8427>\n<0f62>  <785d>\n<0f63>  <9704>\n<0f64>  <524a>\n<0f65>  <54ee>\n<0f66>  <56a3>\n<0f67>  <9500>\n<0f68>  <6d88>\n<0f69>  <5bb5>\n<0f6a>  <6dc6>\n<0f6b>  <6653>\n<0f6c>  <5c0f>\n<0f6d>  <5b5d>\n<0f6e>  <6821>\n<0f6f>  <8096>\n<0f70>  <5578>\n<0f71>  <7b11>\n<0f72>  <6548>\n<0f73>  <6954>\n<0f74>  <4e9b>\n<0f75>  <6b47>\n<0f76>  <874e>\n<0f77>  <978b>\n<0f78>  <534f>\n<0f79>  <631f>\n<0f7a>  <643a>\n<0f7b>  <90aa>\n<0f7c>  <659c>\n<0f7d>  <80c1>\n<0f7e>  <8c10>\n<0f7f>  <5199>\n<0f80>  <68b0>\n<0f81>  <5378>\n<0f82>  <87f9>\n<0f83>  <61c8>\n<0f84>  <6cc4>\n<0f85>  <6cfb>\n<0f86>  <8c22>\n<0f87>  <5c51>\n<0f88>  <85aa>\n<0f89>  <82af>\n<0f8a>  <950c>\n<0f8b>  <6b23>\n<0f8c>  <8f9b>\n<0f8d>  <65b0>\n<0f8e>  <5ffb>\n<0f8f>  <5fc3>\n<0f90>  <4fe1>\n<0f91>  <8845>\n<0f92>  <661f>\n<0f93>  <8165>\n<0f94>  <7329>\n<0f95>  <60fa>\n<0f96>  <5174>\n<0f97>  <5211>\n<0f98>  <578b>\n<0f99>  <5f62>\n<0f9a>  <90a2>\n<0f9b>  <884c>\n<0f9c>  <9192>\n<0f9d>  <5e78>\n<0f9e>  <674f>\n<0f9f>  <6027>\n<0fa0>  <59d3>\n<0fa1>  <5144>\n<0fa2>  <51f6>\n<0fa3>  <80f8>\n<0fa4>  <5308>\n<0fa5>  <6c79>\n<0fa6>  <96c4>\n<0fa7>  <718a>\nendbfchar\n\n100 beginbfchar\n<0fa8>  <4f11>\n<0fa9>  <4fee>\n<0faa>  <7f9e>\n<0fab>  <673d>\n<0fac>  <55c5>\n<0fad>  <9508>\n<0fae>  <79c0>\n<0faf>  <8896>\n<0fb0>  <7ee3>\n<0fb1>  <589f>\n<0fb2>  <620c>\n<0fb3>  <9700>\n<0fb4>  <865a>\n<0fb5>  <5618>\n<0fb6>  <987b>\n<0fb7>  <5f90>\n<0fb8>  <8bb8>\n<0fb9>  <84c4>\n<0fba>  <9157>\n<0fbb>  <53d9>\n<0fbc>  <65ed>\n<0fbd>  <5e8f>\n<0fbe>  <755c>\n<0fbf>  <6064>\n<0fc0>  <7d6e>\n<0fc1>  <5a7f>\n<0fc2>  <7eea>\n<0fc3>  <7eed>\n<0fc4>  <8f69>\n<0fc5>  <55a7>\n<0fc6>  <5ba3>\n<0fc7>  <60ac>\n<0fc8>  <65cb>\n<0fc9>  <7384>\n<0fca>  <9009>\n<0fcb>  <7663>\n<0fcc>  <7729>\n<0fcd>  <7eda>\n<0fce>  <9774>\n<0fcf>  <859b>\n<0fd0>  <5b66>\n<0fd1>  <7a74>\n<0fd2>  <96ea>\n<0fd3>  <8840>\n<0fd4>  <52cb>\n<0fd5>  <718f>\n<0fd6>  <5faa>\n<0fd7>  <65ec>\n<0fd8>  <8be2>\n<0fd9>  <5bfb>\n<0fda>  <9a6f>\n<0fdb>  <5de1>\n<0fdc>  <6b89>\n<0fdd>  <6c5b>\n<0fde>  <8bad>\n<0fdf>  <8baf>\n<0fe0>  <900a>\n<0fe1>  <8fc5>\n<0fe2>  <538b>\n<0fe3>  <62bc>\n<0fe4>  <9e26>\n<0fe5>  <9e2d>\n<0fe6>  <5440>\n<0fe7>  <4e2b>\n<0fe8>  <82bd>\n<0fe9>  <7259>\n<0fea>  <869c>\n<0feb>  <5d16>\n<0fec>  <8859>\n<0fed>  <6daf>\n<0fee>  <96c5>\n<0fef>  <54d1>\n<0ff0>  <4e9a>\n<0ff1>  <8bb6>\n<0ff2>  <7109>\n<0ff3>  <54bd>\n<0ff4>  <9609>\n<0ff5>  <70df>\n<0ff6>  <6df9>\n<0ff7>  <76d0>\n<0ff8>  <4e25>\n<0ff9>  <7814>\n<0ffa>  <8712>\n<0ffb>  <5ca9>\n<0ffc>  <5ef6>\n<0ffd>  <8a00>\n<0ffe>  <989c>\n<0fff>  <960e>\n<1000>  <708e>\n<1001>  <6cbf>\n<1002>  <5944>\n<1003>  <63a9>\n<1004>  <773c>\n<1005>  <884d>\n<1006>  <6f14>\n<1007>  <8273>\n<1008>  <5830>\n<1009>  <71d5>\n<100a>  <538c>\n<100b>  <781a>\nendbfchar\n\n100 beginbfchar\n<100c>  <96c1>\n<100d>  <5501>\n<100e>  <5f66>\n<100f>  <7130>\n<1010>  <5bb4>\n<1011>  <8c1a>\n<1012>  <9a8c>\n<1013>  <6b83>\n<1014>  <592e>\n<1015>  <9e2f>\n<1016>  <79e7>\n<1017>  <6768>\n<1018>  <626c>\n<1019>  <4f6f>\n<101a>  <75a1>\n<101b>  <7f8a>\n<101c>  <6d0b>\n<101d>  <9633>\n<101e>  <6c27>\n<101f>  <4ef0>\n<1020>  <75d2>\n<1021>  <517b>\n<1022>  <6837>\n<1023>  <6f3e>\n<1024>  <9080>\n<1025>  <8170>\n<1026>  <5996>\n<1027>  <7476>\n<1028>  <6447>\n<1029>  <5c27>\n<102a>  <9065>\n<102b>  <7a91>\n<102c>  <8c23>\n<102d>  <59da>\n<102e>  <54ac>\n<102f>  <8200>\n<1030>  <836f>\n<1031>  <8981>\n<1032>  <8000>\n<1033>  <6930>\n<1034>  <564e>\n<1035>  <8036>\n<1036>  <7237>\n<1037>  <91ce>\n<1038>  <51b6>\n<1039>  <4e5f>\n<103a>  <9875>\n<103b>  <6396>\n<103c>  <4e1a>\n<103d>  <53f6>\n<103e>  <66f3>\n<103f>  <814b>\n<1040>  <591c>\n<1041>  <6db2>\n<1042>  <4e00>\n<1043>  <58f9>\n<1044>  <533b>\n<1045>  <63d6>\n<1046>  <94f1>\n<1047>  <4f9d>\n<1048>  <4f0a>\n<1049>  <8863>\n<104a>  <9890>\n<104b>  <5937>\n<104c>  <9057>\n<104d>  <79fb>\n<104e>  <4eea>\n<104f>  <80f0>\n<1050>  <7591>\n<1051>  <6c82>\n<1052>  <5b9c>\n<1053>  <59e8>\n<1054>  <5f5d>\n<1055>  <6905>\n<1056>  <8681>\n<1057>  <501a>\n<1058>  <5df2>\n<1059>  <4e59>\n<105a>  <77e3>\n<105b>  <4ee5>\n<105c>  <827a>\n<105d>  <6291>\n<105e>  <6613>\n<105f>  <9091>\n<1060>  <5c79>\n<1061>  <4ebf>\n<1062>  <5f79>\n<1063>  <81c6>\n<1064>  <9038>\n<1065>  <8084>\n<1066>  <75ab>\n<1067>  <4ea6>\n<1068>  <88d4>\n<1069>  <610f>\n<106a>  <6bc5>\n<106b>  <5fc6>\n<106c>  <4e49>\n<106d>  <76ca>\n<106e>  <6ea2>\n<106f>  <8be3>\nendbfchar\n\n100 beginbfchar\n<1070>  <8bae>\n<1071>  <8c0a>\n<1072>  <8bd1>\n<1073>  <5f02>\n<1074>  <7ffc>\n<1075>  <7fcc>\n<1076>  <7ece>\n<1077>  <8335>\n<1078>  <836b>\n<1079>  <56e0>\n<107a>  <6bb7>\n<107b>  <97f3>\n<107c>  <9634>\n<107d>  <59fb>\n<107e>  <541f>\n<107f>  <94f6>\n<1080>  <6deb>\n<1081>  <5bc5>\n<1082>  <996e>\n<1083>  <5c39>\n<1084>  <5f15>\n<1085>  <9690>\n<1086>  <5370>\n<1087>  <82f1>\n<1088>  <6a31>\n<1089>  <5a74>\n<108a>  <9e70>\n<108b>  <5e94>\n<108c>  <7f28>\n<108d>  <83b9>\n<1090>  <8367>\n<1091>  <8747>\n<1092>  <8fce>\n<1093>  <8d62>\n<1094>  <76c8>\n<1095>  <5f71>\n<1096>  <9896>\n<1097>  <786c>\n<1098>  <6620>\n<1099>  <54df>\n<109a>  <62e5>\n<109b>  <4f63>\n<109c>  <81c3>\n<109d>  <75c8>\n<109e>  <5eb8>\n<109f>  <96cd>\n<10a0>  <8e0a>\n<10a1>  <86f9>\n<10a2>  <548f>\n<10a3>  <6cf3>\n<10a4>  <6d8c>\n<10a5>  <6c38>\n<10a6>  <607f>\n<10a7>  <52c7>\n<10a8>  <7528>\n<10a9>  <5e7d>\n<10aa>  <4f18>\n<10ab>  <60a0>\n<10ac>  <5fe7>\n<10ad>  <5c24>\n<10ae>  <7531>\n<10af>  <90ae>\n<10b0>  <94c0>\n<10b1>  <72b9>\n<10b2>  <6cb9>\n<10b3>  <6e38>\n<10b4>  <9149>\n<10b5>  <6709>\n<10b6>  <53cb>\n<10b7>  <53f3>\n<10b8>  <4f51>\n<10b9>  <91c9>\n<10ba>  <8bf1>\n<10bb>  <53c8>\n<10bc>  <5e7c>\n<10bd>  <8fc2>\n<10be>  <6de4>\n<10bf>  <4e8e>\n<10c0>  <76c2>\n<10c1>  <6986>\n<10c2>  <865e>\n<10c3>  <611a>\n<10c4>  <8206>\n<10c5>  <4f59>\n<10c6>  <4fde>\n<10c7>  <903e>\n<10c8>  <9c7c>\n<10c9>  <6109>\n<10ca>  <6e1d>\n<10cb>  <6e14>\n<10cc>  <9685>\n<10cd>  <4e88>\n<10ce>  <5a31>\n<10cf>  <96e8>\n<10d0>  <4e0e>\n<10d1>  <5c7f>\n<10d2>  <79b9>\n<10d3>  <5b87>\n<10d4>  <8bed>\n<10d5>  <7fbd>\nendbfchar\n\n100 beginbfchar\n<10d6>  <7389>\n<10d7>  <57df>\n<10d8>  <828b>\n<10d9>  <90c1>\n<10da>  <5401>\n<10db>  <9047>\n<10dc>  <55bb>\n<10dd>  <5cea>\n<10de>  <5fa1>\n<10df>  <6108>\n<10e0>  <6b32>\n<10e1>  <72f1>\n<10e2>  <80b2>\n<10e3>  <8a89>\n<10e4>  <6d74>\n<10e5>  <5bd3>\n<10e6>  <88d5>\n<10e7>  <9884>\n<10e8>  <8c6b>\n<10e9>  <9a6d>\n<10ea>  <9e33>\n<10eb>  <6e0a>\n<10ec>  <51a4>\n<10ed>  <5143>\n<10ee>  <57a3>\n<10ef>  <8881>\n<10f0>  <539f>\n<10f1>  <63f4>\n<10f2>  <8f95>\n<10f3>  <56ed>\n<10f4>  <5458>\n<10f5>  <5706>\n<10f6>  <733f>\n<10f7>  <6e90>\n<10f8>  <7f18>\n<10f9>  <8fdc>\n<10fa>  <82d1>\n<10fb>  <613f>\n<10fc>  <6028>\n<10fd>  <9662>\n<10fe>  <66f0>\n<10ff>  <7ea6>\n<1100>  <8d8a>\n<1101>  <8dc3>\n<1102>  <94a5>\n<1103>  <5cb3>\n<1104>  <7ca4>\n<1105>  <6708>\n<1106>  <60a6>\n<1107>  <9605>\n<1108>  <8018>\n<1109>  <4e91>\n<110a>  <90e7>\n<110b>  <5300>\n<110c>  <9668>\n<110d>  <5141>\n<110e>  <8fd0>\n<110f>  <8574>\n<1110>  <915d>\n<1111>  <6655>\n<1112>  <97f5>\n<1113>  <5b55>\n<1114>  <531d>\n<1115>  <7838>\n<1116>  <6742>\n<1117>  <683d>\n<1118>  <54c9>\n<1119>  <707e>\n<111a>  <5bb0>\n<111b>  <8f7d>\n<111c>  <518d>\n<111d>  <5728>\n<111e>  <54b1>\n<111f>  <6512>\n<1120>  <6682>\n<1121>  <8d5e>\n<1122>  <8d43>\n<1123>  <810f>\n<1124>  <846c>\n<1125>  <906d>\n<1126>  <7cdf>\n<1127>  <51ff>\n<1128>  <85fb>\n<1129>  <67a3>\n<112a>  <65e9>\n<112b>  <6fa1>\n<112c>  <86a4>\n<112d>  <8e81>\n<112e>  <566a>\n<112f>  <9020>\n<1130>  <7682>\n<1131>  <7076>\n<1132>  <71e5>\n<1133>  <8d23>\n<1134>  <62e9>\n<1135>  <5219>\n<1136>  <6cfd>\n<1137>  <8d3c>\n<1138>  <600e>\n<1139>  <589e>\nendbfchar\n\n100 beginbfchar\n<113a>  <618e>\n<113b>  <66fe>\n<113c>  <8d60>\n<113d>  <624e>\n<113e>  <55b3>\n<113f>  <6e23>\n<1140>  <672d>\n<1141>  <8f67>\n<1142>  <94e1>\n<1143>  <95f8>\n<1144>  <7728>\n<1145>  <6805>\n<1146>  <69a8>\n<1147>  <548b>\n<1148>  <4e4d>\n<1149>  <70b8>\n<114a>  <8bc8>\n<114b>  <6458>\n<114c>  <658b>\n<114d>  <5b85>\n<114e>  <7a84>\n<114f>  <503a>\n<1150>  <5be8>\n<1151>  <77bb>\n<1152>  <6be1>\n<1153>  <8a79>\n<1154>  <7c98>\n<1155>  <6cbe>\n<1156>  <76cf>\n<1157>  <65a9>\n<1158>  <8f97>\n<1159>  <5d2d>\n<115a>  <5c55>\n<115b>  <8638>\n<115c>  <6808>\n<115d>  <5360>\n<115e>  <6218>\n<115f>  <7ad9>\n<1160>  <6e5b>\n<1161>  <7efd>\n<1162>  <6a1f>\n<1163>  <7ae0>\n<1164>  <5f70>\n<1165>  <6f33>\n<1166>  <5f20>\n<1167>  <638c>\n<1168>  <6da8>\n<1169>  <6756>\n<116a>  <4e08>\n<116b>  <5e10>\n<116c>  <8d26>\n<116d>  <4ed7>\n<116e>  <80c0>\n<116f>  <7634>\n<1170>  <969c>\n<1171>  <62db>\n<1172>  <662d>\n<1173>  <627e>\n<1174>  <6cbc>\n<1175>  <8d75>\n<1176>  <7167>\n<1177>  <7f69>\n<1178>  <5146>\n<1179>  <8087>\n<117a>  <53ec>\n<117b>  <906e>\n<117c>  <6298>\n<117d>  <54f2>\n<117e>  <86f0>\n<117f>  <8f99>\n<1180>  <8005>\n<1181>  <9517>\n<1182>  <8517>\n<1183>  <8fd9>\n<1184>  <6d59>\n<1185>  <73cd>\n<1186>  <659f>\n<1187>  <771f>\n<1188>  <7504>\n<1189>  <7827>\n<118a>  <81fb>\n<118b>  <8d1e>\n<118c>  <9488>\n<118d>  <4fa6>\n<118e>  <6795>\n<118f>  <75b9>\n<1190>  <8bca>\n<1191>  <9707>\n<1192>  <632f>\n<1193>  <9547>\n<1194>  <9635>\n<1195>  <84b8>\n<1196>  <6323>\n<1197>  <7741>\n<1198>  <5f81>\n<1199>  <72f0>\n<119a>  <4e89>\n<119b>  <6014>\n<119c>  <6574>\n<119d>  <62ef>\nendbfchar\n\n100 beginbfchar\n<119e>  <6b63>\n<119f>  <653f>\n<11a0>  <5e27>\n<11a1>  <75c7>\n<11a2>  <90d1>\n<11a3>  <8bc1>\n<11a4>  <829d>\n<11a5>  <679d>\n<11a6>  <652f>\n<11a7>  <5431>\n<11a8>  <8718>\n<11a9>  <77e5>\n<11aa>  <80a2>\n<11ab>  <8102>\n<11ac>  <6c41>\n<11ad>  <4e4b>\n<11ae>  <7ec7>\n<11af>  <804c>\n<11b0>  <76f4>\n<11b1>  <690d>\n<11b2>  <6b96>\n<11b3>  <6267>\n<11b4>  <503c>\n<11b5>  <4f84>\n<11b6>  <5740>\n<11b7>  <6307>\n<11b8>  <6b62>\n<11b9>  <8dbe>\n<11ba>  <53ea>\n<11bb>  <65e8>\n<11bc>  <7eb8>\n<11bd>  <5fd7>\n<11be>  <631a>\n<11bf>  <63b7>\n<11c2>  <7f6e>\n<11c3>  <5e1c>\n<11c4>  <5cd9>\n<11c5>  <5236>\n<11c6>  <667a>\n<11c7>  <79e9>\n<11c8>  <7a1a>\n<11c9>  <8d28>\n<11ca>  <7099>\n<11cb>  <75d4>\n<11cc>  <6ede>\n<11cd>  <6cbb>\n<11ce>  <7a92>\n<11cf>  <4e2d>\n<11d0>  <76c5>\n<11d1>  <5fe0>\n<11d2>  <949f>\n<11d3>  <8877>\n<11d4>  <7ec8>\n<11d5>  <79cd>\n<11d6>  <80bf>\n<11d7>  <91cd>\n<11d8>  <4ef2>\n<11d9>  <4f17>\n<11da>  <821f>\n<11db>  <5468>\n<11dc>  <5dde>\n<11dd>  <6d32>\n<11de>  <8bcc>\n<11df>  <7ca5>\n<11e0>  <8f74>\n<11e1>  <8098>\n<11e2>  <5e1a>\n<11e3>  <5492>\n<11e4>  <76b1>\n<11e5>  <5b99>\n<11e6>  <663c>\n<11e7>  <9aa4>\n<11e8>  <73e0>\n<11e9>  <682a>\n<11ea>  <86db>\n<11eb>  <6731>\n<11ec>  <732a>\n<11ed>  <8bf8>\n<11ee>  <8bdb>\n<11ef>  <9010>\n<11f0>  <7af9>\n<11f1>  <70db>\n<11f2>  <716e>\n<11f3>  <62c4>\n<11f4>  <77a9>\n<11f5>  <5631>\n<11f6>  <4e3b>\n<11f7>  <8457>\n<11f8>  <67f1>\n<11f9>  <52a9>\n<11fa>  <86c0>\n<11fb>  <8d2e>\n<11fc>  <94f8>\n<11fd>  <7b51>\n<11fe>  <4f4f>\n<11ff>  <6ce8>\n<1200>  <795d>\n<1201>  <9a7b>\n<1202>  <6293>\n<1203>  <722a>\nendbfchar\n\n100 beginbfchar\n<1204>  <62fd>\n<1205>  <4e13>\n<1206>  <7816>\n<1207>  <8f6c>\n<1208>  <64b0>\n<1209>  <8d5a>\n<120a>  <7bc6>\n<120b>  <6869>\n<120c>  <5e84>\n<120d>  <88c5>\n<120e>  <5986>\n<120f>  <649e>\n<1210>  <58ee>\n<1211>  <72b6>\n<1212>  <690e>\n<1213>  <9525>\n<1214>  <8ffd>\n<1215>  <8d58>\n<1216>  <5760>\n<1217>  <7f00>\n<1218>  <8c06>\n<1219>  <51c6>\n<121a>  <6349>\n<121b>  <62d9>\n<121c>  <5353>\n<121d>  <684c>\n<121e>  <7422>\n<121f>  <8301>\n<1220>  <914c>\n<1221>  <5544>\n<1222>  <7740>\n<1223>  <707c>\n<1224>  <6d4a>\n<1225>  <5179>\n<1226>  <54a8>\n<1227>  <8d44>\n<1228>  <59ff>\n<1229>  <6ecb>\n<122a>  <6dc4>\n<122b>  <5b5c>\n<122c>  <7d2b>\n<122d>  <4ed4>\n<122e>  <7c7d>\n<122f>  <6ed3>\n<1230>  <5b50>\n<1231>  <81ea>\n<1232>  <6e0d>\n<1233>  <5b57>\n<1234>  <9b03>\n<1235>  <68d5>\n<1236>  <8e2a>\n<1237>  <5b97>\n<1238>  <7efc>\n<1239>  <603b>\n<123a>  <7eb5>\n<123b>  <90b9>\n<123c>  <8d70>\n<123d>  <594f>\n<123e>  <63cd>\n<123f>  <79df>\n<1240>  <8db3>\n<1241>  <5352>\n<1242>  <65cf>\n<1243>  <7956>\n<1244>  <8bc5>\n<1245>  <963b>\n<1246>  <7ec4>\n<1247>  <94bb>\n<1248>  <7e82>\n<1249>  <5634>\n<124a>  <9189>\n<124b>  <6700>\n<124c>  <7f6a>\n<124d>  <5c0a>\n<124e>  <9075>\n<124f>  <6628>\n<1250>  <5de6>\n<1251>  <4f50>\n<1252>  <67de>\n<1253>  <505a>\n<1254>  <4f5c>\n<1255>  <5750>\n<1256>  <5ea7>\n<1257>  <4e8d>\n<1258>  <4e0c>\n<1259>  <5140>\n<125a>  <4e10>\n<125b>  <5eff>\n<125c>  <5345>\n<125d>  <4e15>\n<125e>  <4e98>\n<125f>  <4e1e>\n<1260>  <9b32>\n<1261>  <5b6c>\n<1262>  <5669>\n<1263>  <4e28>\n<1264>  <79ba>\n<1265>  <4e3f>\n<1266>  <5315>\n<1267>  <4e47>\nendbfchar\n\n100 beginbfchar\n<1268>  <592d>\n<1269>  <723b>\n<126a>  <536e>\n<126b>  <6c10>\n<126c>  <56df>\n<126d>  <80e4>\n<126e>  <9997>\n<126f>  <6bd3>\n<1270>  <777e>\n<1271>  <9f17>\n<1272>  <4e36>\n<1273>  <4e9f>\n<1274>  <9f10>\n<1275>  <4e5c>\n<1276>  <4e69>\n<1277>  <4e93>\n<1278>  <8288>\n<1279>  <5b5b>\n<127a>  <556c>\n<127b>  <560f>\n<127c>  <4ec4>\n<127d>  <538d>\n<127e>  <539d>\n<127f>  <53a3>\n<1280>  <53a5>\n<1281>  <53ae>\n<1282>  <9765>\n<1283>  <8d5d>\n<1284>  <531a>\n<1285>  <53f5>\n<1286>  <5326>\n<1287>  <532e>\n<1288>  <533e>\n<1289>  <8d5c>\n<128a>  <5366>\n<128b>  <5363>\n<128c>  <5202>\n<128d>  <5208>\n<128e>  <520e>\n<128f>  <522d>\n<1290>  <5233>\n<1293>  <524c>\n<1294>  <525e>\n<1295>  <5261>\n<1296>  <525c>\n<1297>  <84af>\n<1298>  <527d>\n<1299>  <5282>\n<129a>  <5281>\n<129b>  <5290>\n<129c>  <5293>\n<129d>  <5182>\n<129e>  <7f54>\n<129f>  <4ebb>\n<12a0>  <4ec3>\n<12a1>  <4ec9>\n<12a2>  <4ec2>\n<12a3>  <4ee8>\n<12a4>  <4ee1>\n<12a5>  <4eeb>\n<12a6>  <4ede>\n<12a7>  <4f1b>\n<12a8>  <4ef3>\n<12a9>  <4f22>\n<12aa>  <4f64>\n<12ab>  <4ef5>\n<12ac>  <4f25>\n<12ad>  <4f27>\n<12ae>  <4f09>\n<12af>  <4f2b>\n<12b0>  <4f5e>\n<12b1>  <4f67>\n<12b2>  <6538>\n<12b3>  <4f5a>\n<12b4>  <4f5d>\n<12b5>  <4f5f>\n<12b6>  <4f57>\n<12b7>  <4f32>\n<12b8>  <4f3d>\n<12b9>  <4f76>\n<12ba>  <4f74>\n<12bb>  <4f91>\n<12bc>  <4f89>\n<12bd>  <4f83>\n<12be>  <4f8f>\n<12bf>  <4f7e>\n<12c0>  <4f7b>\n<12c1>  <4faa>\n<12c2>  <4f7c>\n<12c3>  <4fac>\n<12c4>  <4f94>\n<12c5>  <4fe6>\n<12c6>  <4fe8>\n<12c7>  <4fea>\n<12c8>  <4fc5>\n<12c9>  <4fda>\n<12ca>  <4fe3>\n<12cb>  <4fdc>\n<12cc>  <4fd1>\n<12cd>  <4fdf>\nendbfchar\n\n100 beginbfchar\n<12ce>  <4ff8>\n<12cf>  <5029>\n<12d0>  <504c>\n<12d1>  <4ff3>\n<12d2>  <502c>\n<12d3>  <500f>\n<12d4>  <502e>\n<12d5>  <502d>\n<12d6>  <4ffe>\n<12d7>  <501c>\n<12d8>  <500c>\n<12d9>  <5025>\n<12da>  <5028>\n<12db>  <507e>\n<12dc>  <5043>\n<12dd>  <5055>\n<12de>  <5048>\n<12df>  <504e>\n<12e0>  <506c>\n<12e1>  <507b>\n<12e2>  <50a5>\n<12e3>  <50a7>\n<12e4>  <50a9>\n<12e5>  <50ba>\n<12e6>  <50d6>\n<12e7>  <5106>\n<12e8>  <50ed>\n<12e9>  <50ec>\n<12ea>  <50e6>\n<12eb>  <50ee>\n<12ec>  <5107>\n<12ed>  <510b>\n<12ee>  <4edd>\n<12ef>  <6c3d>\n<12f0>  <4f58>\n<12f1>  <4f65>\n<12f2>  <4fce>\n<12f3>  <9fa0>\n<12f4>  <6c46>\n<12f5>  <7c74>\n<12f6>  <516e>\n<12f7>  <5dfd>\n<12f8>  <9ec9>\n<12f9>  <9998>\n<12fa>  <5181>\n<12fb>  <5914>\n<12fc>  <52f9>\n<12fd>  <530d>\n<12fe>  <8a07>\n<12ff>  <5310>\n<1300>  <51eb>\n<1301>  <5919>\n<1302>  <5155>\n<1303>  <4ea0>\n<1304>  <5156>\n<1305>  <4eb3>\n<1306>  <886e>\n<1307>  <88a4>\n<1308>  <4eb5>\n<1309>  <8114>\n<130a>  <88d2>\n<130b>  <7980>\n<130c>  <5b34>\n<130d>  <8803>\n<130e>  <7fb8>\n<130f>  <51ab>\n<1310>  <51b1>\n<1311>  <51bd>\n<1312>  <51bc>\n<1313>  <51c7>\n<1314>  <5196>\n<1315>  <51a2>\n<1316>  <51a5>\n<1317>  <8ba0>\n<131a>  <8baa>\n<131d>  <8bb7>\n<1320>  <8bcb>\n<1321>  <8bcf>\n<1322>  <8bce>\n<1326>  <8bd6>\n<1329>  <8bdc>\n<132c>  <8be4>\n<132f>  <8bee>\n<1330>  <8bf0>\n<1331>  <8bf3>\n<1332>  <8bf6>\n<1333>  <8bf9>\n<1334>  <8bfc>\n<1337>  <8c02>\n<1338>  <8c04>\n<1339>  <8c07>\n<133a>  <8c0c>\n<133b>  <8c0f>\n<1341>  <8c19>\n<1342>  <8c1b>\n<1343>  <8c18>\n<1344>  <8c1d>\n<1348>  <8c25>\n<1349>  <8c27>\n<1352>  <5369>\nendbfchar\n\n100 beginbfchar\n<1353>  <537a>\n<1354>  <961d>\n<1355>  <9622>\n<1356>  <9621>\n<1357>  <9631>\n<1358>  <962a>\n<1359>  <963d>\n<135a>  <963c>\n<135b>  <9642>\n<135c>  <9649>\n<135d>  <9654>\n<135e>  <965f>\n<135f>  <9667>\n<1360>  <966c>\n<1361>  <9672>\n<1362>  <9674>\n<1363>  <9688>\n<1364>  <968d>\n<1365>  <9697>\n<1366>  <96b0>\n<1367>  <9097>\n<1368>  <909b>\n<1369>  <909d>\n<136a>  <9099>\n<136b>  <90ac>\n<136c>  <90a1>\n<136d>  <90b4>\n<136e>  <90b3>\n<136f>  <90b6>\n<1370>  <90ba>\n<1371>  <90b8>\n<1372>  <90b0>\n<1373>  <90cf>\n<1374>  <90c5>\n<1375>  <90be>\n<1376>  <90d0>\n<1377>  <90c4>\n<1378>  <90c7>\n<1379>  <90d3>\n<137a>  <90e6>\n<137b>  <90e2>\n<137c>  <90dc>\n<137d>  <90d7>\n<137e>  <90db>\n<137f>  <90eb>\n<1380>  <90ef>\n<1381>  <90fe>\n<1382>  <9104>\n<1383>  <9122>\n<1384>  <911e>\n<1385>  <9123>\n<1386>  <9131>\n<1387>  <912f>\n<1388>  <9139>\n<1389>  <9143>\n<138a>  <9146>\n<138b>  <520d>\n<138c>  <5942>\n<138d>  <52a2>\n<1390>  <52be>\n<1391>  <54ff>\n<1392>  <52d0>\n<1393>  <52d6>\n<1394>  <52f0>\n<1395>  <53df>\n<1396>  <71ee>\n<1397>  <77cd>\n<1398>  <5ef4>\n<1399>  <51f5>\n<139a>  <51fc>\n<139b>  <9b2f>\n<139c>  <53b6>\n<139d>  <5f01>\n<139e>  <755a>\n<139f>  <5def>\n<13a0>  <574c>\n<13a1>  <57a9>\n<13a2>  <57a1>\n<13a3>  <587e>\n<13a4>  <58bc>\n<13a5>  <58c5>\n<13a6>  <58d1>\n<13a7>  <5729>\n<13a8>  <572c>\n<13a9>  <572a>\n<13aa>  <5733>\n<13ab>  <5739>\n<13ae>  <575c>\n<13af>  <573b>\n<13b0>  <5742>\n<13b1>  <5769>\n<13b2>  <5785>\n<13b3>  <576b>\n<13b4>  <5786>\n<13b5>  <577c>\n<13b6>  <577b>\n<13b7>  <5768>\n<13b8>  <576d>\n<13b9>  <5776>\n<13ba>  <5773>\nendbfchar\n\n100 beginbfchar\n<13bb>  <57ad>\n<13bc>  <57a4>\n<13bd>  <578c>\n<13be>  <57b2>\n<13bf>  <57cf>\n<13c0>  <57a7>\n<13c1>  <57b4>\n<13c2>  <5793>\n<13c3>  <57a0>\n<13c4>  <57d5>\n<13c5>  <57d8>\n<13c6>  <57da>\n<13c7>  <57d9>\n<13c8>  <57d2>\n<13c9>  <57b8>\n<13ca>  <57f4>\n<13cb>  <57ef>\n<13cc>  <57f8>\n<13cd>  <57e4>\n<13ce>  <57dd>\n<13cf>  <580b>\n<13d0>  <580d>\n<13d1>  <57fd>\n<13d2>  <57ed>\n<13d3>  <5800>\n<13d4>  <581e>\n<13d5>  <5819>\n<13d6>  <5844>\n<13d7>  <5820>\n<13d8>  <5865>\n<13d9>  <586c>\n<13da>  <5881>\n<13db>  <5889>\n<13dc>  <589a>\n<13dd>  <5880>\n<13de>  <99a8>\n<13df>  <9f19>\n<13e0>  <61ff>\n<13e1>  <8279>\n<13e2>  <827d>\n<13e3>  <827f>\n<13e4>  <828f>\n<13e5>  <828a>\n<13e6>  <82a8>\n<13e7>  <8284>\n<13e8>  <828e>\n<13e9>  <8291>\n<13ea>  <8297>\n<13eb>  <8299>\n<13ec>  <82ab>\n<13ed>  <82b8>\n<13ee>  <82be>\n<13ef>  <82b0>\n<13f0>  <82c8>\n<13f1>  <82ca>\n<13f2>  <82e3>\n<13f3>  <8298>\n<13f4>  <82b7>\n<13f5>  <82ae>\n<13f8>  <82c1>\n<13f9>  <82a9>\n<13fa>  <82b4>\n<13fb>  <82a1>\n<13fc>  <82aa>\n<13fd>  <829f>\n<13fe>  <82c4>\n<13ff>  <82ce>\n<1400>  <82a4>\n<1401>  <82e1>\n<1402>  <8309>\n<1403>  <82f7>\n<1404>  <82e4>\n<1405>  <830f>\n<1406>  <8307>\n<1407>  <82dc>\n<1408>  <82f4>\n<1409>  <82d2>\n<140a>  <82d8>\n<140b>  <830c>\n<140c>  <82fb>\n<140d>  <82d3>\n<140e>  <8311>\n<140f>  <831a>\n<1410>  <8306>\n<1413>  <82e0>\n<1414>  <82d5>\n<1415>  <831c>\n<1416>  <8351>\n<1419>  <8308>\n<141a>  <8392>\n<141b>  <833c>\n<141c>  <8334>\n<141d>  <8331>\n<141e>  <839b>\n<141f>  <835e>\n<1420>  <832f>\n<1421>  <834f>\n<1422>  <8347>\n<1423>  <8343>\n<1424>  <835f>\nendbfchar\n\n100 beginbfchar\n<1425>  <8340>\n<1426>  <8317>\n<1427>  <8360>\n<1428>  <832d>\n<1429>  <833a>\n<142a>  <8333>\n<142b>  <8366>\n<142c>  <8365>\n<142d>  <8368>\n<142e>  <831b>\n<142f>  <8369>\n<1430>  <836c>\n<1431>  <836a>\n<1434>  <83b0>\n<1435>  <8378>\n<1438>  <83a0>\n<1439>  <83aa>\n<143a>  <8393>\n<143b>  <839c>\n<143c>  <8385>\n<143d>  <837c>\n<143e>  <83b6>\n<143f>  <83a9>\n<1440>  <837d>\n<1441>  <83b8>\n<1442>  <837b>\n<1443>  <8398>\n<1444>  <839e>\n<1445>  <83a8>\n<1446>  <83ba>\n<1447>  <83bc>\n<1448>  <83c1>\n<1449>  <8401>\n<144a>  <83e5>\n<144b>  <83d8>\n<144c>  <5807>\n<144d>  <8418>\n<144e>  <840b>\n<144f>  <83dd>\n<1450>  <83fd>\n<1451>  <83d6>\n<1452>  <841c>\n<1453>  <8438>\n<1454>  <8411>\n<1455>  <8406>\n<1456>  <83d4>\n<1457>  <83df>\n<1458>  <840f>\n<1459>  <8403>\n<145c>  <83ea>\n<145d>  <83c5>\n<145e>  <83c0>\n<145f>  <8426>\n<1460>  <83f0>\n<1461>  <83e1>\n<1462>  <845c>\n<1463>  <8451>\n<1464>  <845a>\n<1465>  <8459>\n<1466>  <8473>\n<1469>  <847a>\n<146a>  <8489>\n<146b>  <8478>\n<146c>  <843c>\n<146d>  <8446>\n<146e>  <8469>\n<146f>  <8476>\n<1470>  <848c>\n<1471>  <848e>\n<1472>  <8431>\n<1473>  <846d>\n<1474>  <84c1>\n<1475>  <84cd>\n<1476>  <84d0>\n<1477>  <84e6>\n<1478>  <84bd>\n<1479>  <84d3>\n<147a>  <84ca>\n<147b>  <84bf>\n<147c>  <84ba>\n<147d>  <84e0>\n<147e>  <84a1>\n<147f>  <84b9>\n<1480>  <84b4>\n<1481>  <8497>\n<1482>  <84e5>\n<1483>  <84e3>\n<1484>  <850c>\n<1485>  <750d>\n<1486>  <8538>\n<1487>  <84f0>\n<1488>  <8539>\n<1489>  <851f>\n<148a>  <853a>\n<148b>  <8556>\n<148c>  <853b>\n<148d>  <84ff>\n<148e>  <84fc>\n<148f>  <8559>\n<1490>  <8548>\nendbfchar\n\n100 beginbfchar\n<1491>  <8568>\n<1492>  <8564>\n<1493>  <855e>\n<1494>  <857a>\n<1495>  <77a2>\n<1496>  <8543>\n<1497>  <8572>\n<1498>  <857b>\n<1499>  <85a4>\n<149a>  <85a8>\n<149b>  <8587>\n<149c>  <858f>\n<149d>  <8579>\n<149e>  <85ae>\n<149f>  <859c>\n<14a0>  <8585>\n<14a1>  <85b9>\n<14a2>  <85b7>\n<14a3>  <85b0>\n<14a4>  <85d3>\n<14a5>  <85c1>\n<14a6>  <85dc>\n<14a7>  <85ff>\n<14a8>  <8627>\n<14a9>  <8605>\n<14aa>  <8629>\n<14ab>  <8616>\n<14ac>  <863c>\n<14ad>  <5efe>\n<14ae>  <5f08>\n<14af>  <593c>\n<14b0>  <5941>\n<14b1>  <8037>\n<14b2>  <5955>\n<14b3>  <595a>\n<14b4>  <5958>\n<14b5>  <530f>\n<14b6>  <5c22>\n<14b7>  <5c25>\n<14b8>  <5c2c>\n<14b9>  <5c34>\n<14ba>  <624c>\n<14bb>  <626a>\n<14bc>  <629f>\n<14bd>  <62bb>\n<14be>  <62ca>\n<14bf>  <62da>\n<14c0>  <62d7>\n<14c1>  <62ee>\n<14c2>  <6322>\n<14c3>  <62f6>\n<14c4>  <6339>\n<14c5>  <634b>\n<14c6>  <6343>\n<14c7>  <63ad>\n<14c8>  <63f6>\n<14c9>  <6371>\n<14ca>  <637a>\n<14cb>  <638e>\n<14cc>  <63b4>\n<14cd>  <636d>\n<14ce>  <63ac>\n<14cf>  <638a>\n<14d0>  <6369>\n<14d1>  <63ae>\n<14d2>  <63bc>\n<14d3>  <63f2>\n<14d4>  <63f8>\n<14d5>  <63e0>\n<14d6>  <63ff>\n<14d7>  <63c4>\n<14d8>  <63de>\n<14d9>  <63ce>\n<14da>  <6452>\n<14db>  <63c6>\n<14dc>  <63be>\n<14dd>  <6445>\n<14de>  <6441>\n<14df>  <640b>\n<14e0>  <641b>\n<14e1>  <6420>\n<14e2>  <640c>\n<14e3>  <6426>\n<14e4>  <6421>\n<14e5>  <645e>\n<14e6>  <6484>\n<14e7>  <646d>\n<14e8>  <6496>\n<14e9>  <647a>\n<14ec>  <6499>\n<14ed>  <64ba>\n<14ee>  <64c0>\n<14ef>  <64d0>\n<14f0>  <64d7>\n<14f1>  <64e4>\n<14f2>  <64e2>\n<14f3>  <6509>\n<14f4>  <6525>\n<14f5>  <652e>\n<14f6>  <5f0b>\nendbfchar\n\n100 beginbfchar\n<14f7>  <5fd2>\n<14f8>  <7519>\n<14f9>  <5f11>\n<14fa>  <535f>\n<14fb>  <53f1>\n<14fc>  <53fd>\n<14fd>  <53e9>\n<14fe>  <53e8>\n<14ff>  <53fb>\n<1500>  <5412>\n<1501>  <5416>\n<1502>  <5406>\n<1503>  <544b>\n<1507>  <5456>\n<1508>  <5443>\n<1509>  <5421>\n<150a>  <5457>\n<150b>  <5459>\n<150c>  <5423>\n<150d>  <5432>\n<150e>  <5482>\n<150f>  <5494>\n<1510>  <5477>\n<1511>  <5471>\n<1512>  <5464>\n<1515>  <5484>\n<1516>  <5476>\n<1517>  <5466>\n<1518>  <549d>\n<1519>  <54d0>\n<151a>  <54ad>\n<151b>  <54c2>\n<151c>  <54b4>\n<151d>  <54d2>\n<151e>  <54a7>\n<151f>  <54a6>\n<1522>  <5472>\n<1523>  <54a3>\n<1524>  <54d5>\n<1525>  <54bb>\n<1526>  <54bf>\n<1527>  <54cc>\n<152a>  <54dc>\n<152d>  <54a4>\n<152e>  <54dd>\n<152f>  <54cf>\n<1530>  <54de>\n<1531>  <551b>\n<1532>  <54e7>\n<1533>  <5520>\n<1534>  <54fd>\n<1535>  <5514>\n<1536>  <54f3>\n<1539>  <550f>\n<153a>  <5511>\n<153b>  <5527>\n<153c>  <552a>\n<153d>  <5567>\n<153e>  <558f>\n<153f>  <55b5>\n<1540>  <5549>\n<1541>  <556d>\n<1542>  <5541>\n<1543>  <5555>\n<1544>  <553f>\n<1545>  <5550>\n<1546>  <553c>\n<1547>  <5537>\n<1548>  <5556>\n<154c>  <5533>\n<154d>  <5530>\n<154e>  <555c>\n<154f>  <558b>\n<1550>  <55d2>\n<1551>  <5583>\n<1552>  <55b1>\n<1553>  <55b9>\n<1554>  <5588>\n<1555>  <5581>\n<1556>  <559f>\n<1557>  <557e>\n<1558>  <55d6>\n<1559>  <5591>\n<155a>  <557b>\n<155b>  <55df>\n<155e>  <5594>\n<155f>  <5599>\n<1560>  <55ea>\n<1561>  <55f7>\n<1562>  <55c9>\n<1563>  <561f>\n<1564>  <55d1>\n<1567>  <55d4>\n<1568>  <55e6>\n<1569>  <55dd>\n<156a>  <55c4>\n<156b>  <55ef>\n<156c>  <55e5>\n<1571>  <55e8>\n<1572>  <55f5>\nendbfchar\n\n100 beginbfchar\n<1573>  <55e4>\n<1574>  <8f94>\n<1575>  <561e>\n<1576>  <5608>\n<1577>  <560c>\n<1578>  <5601>\n<1579>  <5624>\n<157a>  <5623>\n<157b>  <55fe>\n<157c>  <5600>\n<157d>  <5627>\n<157e>  <562d>\n<157f>  <5658>\n<1580>  <5639>\n<1581>  <5657>\n<1582>  <562c>\n<1583>  <564d>\n<1584>  <5662>\n<1585>  <5659>\n<1586>  <565c>\n<1587>  <564c>\n<1588>  <5654>\n<1589>  <5686>\n<158a>  <5664>\n<158b>  <5671>\n<158c>  <566b>\n<158f>  <5685>\n<1590>  <5693>\n<1591>  <56af>\n<1592>  <56d4>\n<1593>  <56d7>\n<1594>  <56dd>\n<1595>  <56e1>\n<1596>  <56f5>\n<1597>  <56eb>\n<1598>  <56f9>\n<1599>  <56ff>\n<159a>  <5704>\n<159b>  <570a>\n<159c>  <5709>\n<159d>  <571c>\n<159e>  <5e0f>\n<159f>  <5e19>\n<15a0>  <5e14>\n<15a1>  <5e11>\n<15a2>  <5e31>\n<15a5>  <5e37>\n<15a6>  <5e44>\n<15a7>  <5e54>\n<15a8>  <5e5b>\n<15a9>  <5e5e>\n<15aa>  <5e61>\n<15ab>  <5c8c>\n<15ac>  <5c7a>\n<15ad>  <5c8d>\n<15ae>  <5c90>\n<15af>  <5c96>\n<15b0>  <5c88>\n<15b3>  <5c91>\n<15b4>  <5c9a>\n<15b5>  <5c9c>\n<15b6>  <5cb5>\n<15b7>  <5ca2>\n<15b8>  <5cbd>\n<15b9>  <5cac>\n<15ba>  <5cab>\n<15bb>  <5cb1>\n<15bc>  <5ca3>\n<15bd>  <5cc1>\n<15be>  <5cb7>\n<15bf>  <5cc4>\n<15c0>  <5cd2>\n<15c1>  <5ce4>\n<15c2>  <5ccb>\n<15c3>  <5ce5>\n<15c6>  <5d27>\n<15c7>  <5d26>\n<15c8>  <5d2e>\n<15c9>  <5d24>\n<15ca>  <5d1e>\n<15cb>  <5d06>\n<15cc>  <5d1b>\n<15cd>  <5d58>\n<15ce>  <5d3e>\n<15cf>  <5d34>\n<15d0>  <5d3d>\n<15d1>  <5d6c>\n<15d2>  <5d5b>\n<15d3>  <5d6f>\n<15d4>  <5d5d>\n<15d5>  <5d6b>\n<15d6>  <5d4b>\n<15d7>  <5d4a>\n<15d8>  <5d69>\n<15d9>  <5d74>\n<15da>  <5d82>\n<15db>  <5d99>\n<15dc>  <5d9d>\n<15dd>  <8c73>\n<15de>  <5db7>\nendbfchar\n\n100 beginbfchar\n<15df>  <5dc5>\n<15e0>  <5f73>\n<15e1>  <5f77>\n<15e2>  <5f82>\n<15e3>  <5f87>\n<15e4>  <5f89>\n<15e5>  <5f8c>\n<15e6>  <5f95>\n<15e7>  <5f99>\n<15e8>  <5f9c>\n<15e9>  <5fa8>\n<15ea>  <5fad>\n<15eb>  <5fb5>\n<15ec>  <5fbc>\n<15ed>  <8862>\n<15ee>  <5f61>\n<15ef>  <72ad>\n<15f0>  <72b0>\n<15f1>  <72b4>\n<15f4>  <72c3>\n<15f5>  <72c1>\n<15f6>  <72ce>\n<15f7>  <72cd>\n<15f8>  <72d2>\n<15f9>  <72e8>\n<15fa>  <72ef>\n<15fb>  <72e9>\n<15fc>  <72f2>\n<15fd>  <72f4>\n<15fe>  <72f7>\n<15ff>  <7301>\n<1600>  <72f3>\n<1601>  <7303>\n<1604>  <7317>\n<1605>  <7313>\n<1606>  <7321>\n<1607>  <730a>\n<1608>  <731e>\n<1609>  <731d>\n<160a>  <7315>\n<160b>  <7322>\n<160c>  <7339>\n<160d>  <7325>\n<160e>  <732c>\n<160f>  <7338>\n<1610>  <7331>\n<1611>  <7350>\n<1612>  <734d>\n<1613>  <7357>\n<1614>  <7360>\n<1615>  <736c>\n<1616>  <736f>\n<1617>  <737e>\n<1618>  <821b>\n<1619>  <5925>\n<161a>  <98e7>\n<161b>  <5924>\n<161c>  <5902>\n<161d>  <9963>\n<1624>  <9974>\n<1625>  <9977>\n<1626>  <997d>\n<1627>  <9980>\n<1628>  <9984>\n<1629>  <9987>\n<162a>  <998a>\n<162b>  <998d>\n<1631>  <5e80>\n<1632>  <5e91>\n<1633>  <5e8b>\n<1634>  <5e96>\n<1635>  <5ea5>\n<1636>  <5ea0>\n<1637>  <5eb9>\n<1638>  <5eb5>\n<1639>  <5ebe>\n<163a>  <5eb3>\n<163b>  <8d53>\n<163c>  <5ed2>\n<163d>  <5ed1>\n<163e>  <5edb>\n<163f>  <5ee8>\n<1640>  <5eea>\n<1641>  <81ba>\n<1642>  <5fc4>\n<1643>  <5fc9>\n<1644>  <5fd6>\n<1645>  <5fcf>\n<1646>  <6003>\n<1647>  <5fee>\n<1648>  <6004>\n<1649>  <5fe1>\n<164a>  <5fe4>\n<164b>  <5ffe>\n<164e>  <5fea>\n<164f>  <5fed>\n<1650>  <5ff8>\n<1651>  <6019>\n<1652>  <6035>\n<1653>  <6026>\nendbfchar\n\n100 beginbfchar\n<1654>  <601b>\n<1655>  <600f>\n<1656>  <600d>\n<1657>  <6029>\n<1658>  <602b>\n<1659>  <600a>\n<165a>  <603f>\n<165b>  <6021>\n<165e>  <607b>\n<165f>  <607a>\n<1660>  <6042>\n<1661>  <606a>\n<1662>  <607d>\n<1663>  <6096>\n<1664>  <609a>\n<1665>  <60ad>\n<1666>  <609d>\n<1667>  <6083>\n<1668>  <6092>\n<1669>  <608c>\n<166a>  <609b>\n<166b>  <60ec>\n<166c>  <60bb>\n<166d>  <60b1>\n<166e>  <60dd>\n<166f>  <60d8>\n<1670>  <60c6>\n<1671>  <60da>\n<1672>  <60b4>\n<1673>  <6120>\n<1674>  <6126>\n<1675>  <6115>\n<1676>  <6123>\n<1677>  <60f4>\n<1678>  <6100>\n<1679>  <610e>\n<167a>  <612b>\n<167b>  <614a>\n<167c>  <6175>\n<167d>  <61ac>\n<167e>  <6194>\n<167f>  <61a7>\n<1680>  <61b7>\n<1681>  <61d4>\n<1682>  <61f5>\n<1683>  <5fdd>\n<1684>  <96b3>\n<1685>  <95e9>\n<1686>  <95eb>\n<1687>  <95f1>\n<1688>  <95f3>\n<168b>  <95fc>\n<168c>  <95fe>\n<168f>  <9606>\n<1690>  <9608>\n<1695>  <960f>\n<1696>  <9612>\n<169c>  <4e2c>\n<169d>  <723f>\n<169e>  <6215>\n<169f>  <6c35>\n<16a0>  <6c54>\n<16a1>  <6c5c>\n<16a2>  <6c4a>\n<16a3>  <6ca3>\n<16a4>  <6c85>\n<16a5>  <6c90>\n<16a6>  <6c94>\n<16a7>  <6c8c>\n<16aa>  <6c74>\n<16ab>  <6c76>\n<16ac>  <6c86>\n<16ad>  <6ca9>\n<16ae>  <6cd0>\n<16af>  <6cd4>\n<16b0>  <6cad>\n<16b3>  <6cf1>\n<16b4>  <6cd7>\n<16b5>  <6cb2>\n<16b6>  <6ce0>\n<16b7>  <6cd6>\n<16b8>  <6cfa>\n<16b9>  <6ceb>\n<16ba>  <6cee>\n<16bb>  <6cb1>\n<16bc>  <6cd3>\n<16bd>  <6cef>\n<16be>  <6cfe>\n<16bf>  <6d39>\n<16c0>  <6d27>\n<16c1>  <6d0c>\n<16c2>  <6d43>\n<16c3>  <6d48>\n<16c4>  <6d07>\n<16c5>  <6d04>\n<16c6>  <6d19>\n<16c7>  <6d0e>\n<16c8>  <6d2b>\n<16c9>  <6d4d>\n<16ca>  <6d2e>\nendbfchar\n\n100 beginbfchar\n<16cb>  <6d35>\n<16cc>  <6d1a>\n<16cd>  <6d4f>\n<16ce>  <6d52>\n<16cf>  <6d54>\n<16d0>  <6d33>\n<16d1>  <6d91>\n<16d2>  <6d6f>\n<16d3>  <6d9e>\n<16d4>  <6da0>\n<16d5>  <6d5e>\n<16d8>  <6d5c>\n<16d9>  <6d60>\n<16da>  <6d7c>\n<16db>  <6d63>\n<16dc>  <6e1a>\n<16dd>  <6dc7>\n<16de>  <6dc5>\n<16df>  <6dde>\n<16e0>  <6e0e>\n<16e1>  <6dbf>\n<16e2>  <6de0>\n<16e3>  <6e11>\n<16e4>  <6de6>\n<16e5>  <6ddd>\n<16e6>  <6dd9>\n<16e7>  <6e16>\n<16e8>  <6dab>\n<16e9>  <6e0c>\n<16ea>  <6dae>\n<16eb>  <6e2b>\n<16ec>  <6e6e>\n<16ed>  <6e4e>\n<16ee>  <6e6b>\n<16ef>  <6eb2>\n<16f0>  <6e5f>\n<16f1>  <6e86>\n<16f4>  <6e32>\n<16f5>  <6e25>\n<16f6>  <6e44>\n<16f7>  <6edf>\n<16f8>  <6eb1>\n<16f9>  <6e98>\n<16fa>  <6ee0>\n<16fb>  <6f2d>\n<16fc>  <6ee2>\n<16fd>  <6ea5>\n<16fe>  <6ea7>\n<16ff>  <6ebd>\n<1700>  <6ebb>\n<1701>  <6eb7>\n<1702>  <6ed7>\n<1703>  <6eb4>\n<1704>  <6ecf>\n<1705>  <6e8f>\n<1706>  <6ec2>\n<1707>  <6e9f>\n<1708>  <6f62>\n<170b>  <6f24>\n<170c>  <6f15>\n<170d>  <6ef9>\n<170e>  <6f2f>\n<170f>  <6f36>\n<1710>  <6f4b>\n<1711>  <6f74>\n<1712>  <6f2a>\n<1713>  <6f09>\n<1714>  <6f29>\n<1715>  <6f89>\n<1716>  <6f8d>\n<1717>  <6f8c>\n<1718>  <6f78>\n<1719>  <6f72>\n<171a>  <6f7c>\n<171b>  <6f7a>\n<171c>  <6fd1>\n<171d>  <6fc9>\n<171e>  <6fa7>\n<171f>  <6fb9>\n<1720>  <6fb6>\n<1721>  <6fc2>\n<1722>  <6fe1>\n<1723>  <6fee>\n<1724>  <6fde>\n<1725>  <6fe0>\n<1726>  <6fef>\n<1727>  <701a>\n<1728>  <7023>\n<1729>  <701b>\n<172a>  <7039>\n<172b>  <7035>\n<172c>  <704f>\n<172d>  <705e>\n<172e>  <5b80>\n<172f>  <5b84>\n<1730>  <5b95>\n<1731>  <5b93>\n<1732>  <5ba5>\n<1733>  <5bb8>\n<1734>  <752f>\nendbfchar\n\n100 beginbfchar\n<1735>  <9a9e>\n<1736>  <6434>\n<1737>  <5be4>\n<1738>  <5bee>\n<1739>  <8930>\n<173a>  <5bf0>\n<173b>  <8e47>\n<173c>  <8b07>\n<173d>  <8fb6>\n<173e>  <8fd3>\n<173f>  <8fd5>\n<1740>  <8fe5>\n<1741>  <8fee>\n<1742>  <8fe4>\n<1743>  <8fe9>\n<1744>  <8fe6>\n<1745>  <8ff3>\n<1746>  <8fe8>\n<1747>  <9005>\n<1748>  <9004>\n<1749>  <900b>\n<174a>  <9026>\n<174b>  <9011>\n<174c>  <900d>\n<174d>  <9016>\n<174e>  <9021>\n<1751>  <902d>\n<1752>  <902f>\n<1753>  <9044>\n<1756>  <9050>\n<1757>  <9068>\n<1758>  <9058>\n<1759>  <9062>\n<175a>  <905b>\n<175b>  <66b9>\n<175c>  <9074>\n<175d>  <907d>\n<175e>  <9082>\n<175f>  <9088>\n<1760>  <9083>\n<1761>  <908b>\n<1762>  <5f50>\n<1763>  <5f57>\n<1764>  <5f56>\n<1765>  <5f58>\n<1766>  <5c3b>\n<1767>  <54ab>\n<1768>  <5c50>\n<1769>  <5c59>\n<176a>  <5b71>\n<176b>  <5c63>\n<176c>  <5c66>\n<176d>  <7fbc>\n<176e>  <5f2a>\n<176f>  <5f29>\n<1770>  <5f2d>\n<1771>  <8274>\n<1772>  <5f3c>\n<1773>  <9b3b>\n<1774>  <5c6e>\n<1775>  <5981>\n<1776>  <5983>\n<1777>  <598d>\n<177a>  <59a3>\n<177b>  <5997>\n<177c>  <59ca>\n<177d>  <59ab>\n<177e>  <599e>\n<177f>  <59a4>\n<1780>  <59d2>\n<1781>  <59b2>\n<1782>  <59af>\n<1783>  <59d7>\n<1784>  <59be>\n<1787>  <59dd>\n<1788>  <5a08>\n<1789>  <59e3>\n<178a>  <59d8>\n<178b>  <59f9>\n<178c>  <5a0c>\n<178d>  <5a09>\n<178e>  <5a32>\n<178f>  <5a34>\n<1790>  <5a11>\n<1791>  <5a23>\n<1792>  <5a13>\n<1793>  <5a40>\n<1794>  <5a67>\n<1795>  <5a4a>\n<1796>  <5a55>\n<1797>  <5a3c>\n<1798>  <5a62>\n<1799>  <5a75>\n<179a>  <80ec>\n<179b>  <5aaa>\n<179c>  <5a9b>\n<179d>  <5a77>\n<179e>  <5a7a>\n<179f>  <5abe>\n<17a0>  <5aeb>\nendbfchar\n\n100 beginbfchar\n<17a1>  <5ab2>\n<17a2>  <5ad2>\n<17a3>  <5ad4>\n<17a4>  <5ab8>\n<17a5>  <5ae0>\n<17a6>  <5ae3>\n<17a7>  <5af1>\n<17a8>  <5ad6>\n<17a9>  <5ae6>\n<17aa>  <5ad8>\n<17ab>  <5adc>\n<17ac>  <5b09>\n<17ad>  <5b17>\n<17ae>  <5b16>\n<17af>  <5b32>\n<17b0>  <5b37>\n<17b1>  <5b40>\n<17b2>  <5c15>\n<17b3>  <5c1c>\n<17b4>  <5b5a>\n<17b5>  <5b65>\n<17b6>  <5b73>\n<17b7>  <5b51>\n<17b8>  <5b53>\n<17b9>  <5b62>\n<17ba>  <9a75>\n<17bd>  <9a7a>\n<17be>  <9a7f>\n<17bf>  <9a7d>\n<17c2>  <9a85>\n<17c3>  <9a88>\n<17c4>  <9a8a>\n<17c5>  <9a90>\n<17c8>  <9a96>\n<17c9>  <9a98>\n<17d1>  <9aa5>\n<17d2>  <9aa7>\n<17d3>  <7e9f>\n<17d4>  <7ea1>\n<17d5>  <7ea3>\n<17d6>  <7ea5>\n<17d9>  <7ead>\n<17da>  <7eb0>\n<17db>  <7ebe>\n<17df>  <7ec9>\n<17e2>  <7ed0>\n<17e3>  <7ed4>\n<17e4>  <7ed7>\n<17e5>  <7edb>\n<17e8>  <7ee8>\n<17e9>  <7eeb>\n<17ee>  <7f0d>\n<17ef>  <7ef6>\n<17f2>  <7efe>\n<17fa>  <7f0f>\n<17fd>  <7f17>\n<17fe>  <7f19>\n<17ff>  <7f1c>\n<1800>  <7f1b>\n<1801>  <7f1f>\n<1812>  <7f35>\n<1813>  <5e7a>\n<1814>  <757f>\n<1815>  <5ddb>\n<1816>  <753e>\n<1817>  <9095>\n<1818>  <738e>\n<1819>  <7391>\n<181a>  <73ae>\n<181b>  <73a2>\n<181c>  <739f>\n<181d>  <73cf>\n<181e>  <73c2>\n<181f>  <73d1>\n<1820>  <73b7>\n<1821>  <73b3>\n<1822>  <73c0>\n<1823>  <73c9>\n<1824>  <73c8>\n<1825>  <73e5>\n<1826>  <73d9>\n<1827>  <987c>\n<1828>  <740a>\n<1829>  <73e9>\n<182a>  <73e7>\n<182b>  <73de>\n<182c>  <73ba>\n<182d>  <73f2>\n<182e>  <740f>\n<182f>  <742a>\n<1830>  <745b>\n<1831>  <7426>\n<1832>  <7425>\n<1833>  <7428>\n<1834>  <7430>\n<1835>  <742e>\n<1836>  <742c>\n<1837>  <741b>\n<1838>  <741a>\n<1839>  <7441>\nendbfchar\n\n100 beginbfchar\n<183a>  <745c>\n<183b>  <7457>\n<183c>  <7455>\n<183d>  <7459>\n<183e>  <7477>\n<183f>  <746d>\n<1840>  <747e>\n<1841>  <749c>\n<1842>  <748e>\n<1845>  <7487>\n<1846>  <748b>\n<1847>  <749e>\n<184a>  <7490>\n<184b>  <74a7>\n<184c>  <74d2>\n<184d>  <74ba>\n<1851>  <674c>\n<1852>  <6753>\n<1853>  <675e>\n<1854>  <6748>\n<1855>  <6769>\n<1856>  <67a5>\n<1857>  <6787>\n<1858>  <676a>\n<1859>  <6773>\n<185a>  <6798>\n<185b>  <67a7>\n<185c>  <6775>\n<185d>  <67a8>\n<185e>  <679e>\n<185f>  <67ad>\n<1860>  <678b>\n<1861>  <6777>\n<1862>  <677c>\n<1863>  <67f0>\n<1864>  <6809>\n<1865>  <67d8>\n<1866>  <680a>\n<1867>  <67e9>\n<1868>  <67b0>\n<1869>  <680c>\n<186a>  <67d9>\n<186b>  <67b5>\n<186c>  <67da>\n<186d>  <67b3>\n<186e>  <67dd>\n<186f>  <6800>\n<1870>  <67c3>\n<1871>  <67b8>\n<1872>  <67e2>\n<1873>  <680e>\n<1874>  <67c1>\n<1875>  <67fd>\n<187a>  <684e>\n<187b>  <6862>\n<187c>  <6844>\n<187d>  <6864>\n<187e>  <6883>\n<187f>  <681d>\n<1880>  <6855>\n<1881>  <6866>\n<1882>  <6841>\n<1883>  <6867>\n<1884>  <6840>\n<1885>  <683e>\n<1886>  <684a>\n<1887>  <6849>\n<1888>  <6829>\n<1889>  <68b5>\n<188a>  <688f>\n<188b>  <6874>\n<188c>  <6877>\n<188d>  <6893>\n<188e>  <686b>\n<188f>  <68c2>\n<1890>  <696e>\n<1891>  <68fc>\n<1894>  <68f9>\n<1895>  <6924>\n<1896>  <68f0>\n<1897>  <690b>\n<1898>  <6901>\n<1899>  <6957>\n<189a>  <68e3>\n<189b>  <6910>\n<189c>  <6971>\n<189d>  <6939>\n<189e>  <6960>\n<189f>  <6942>\n<18a0>  <695d>\n<18a1>  <6984>\n<18a2>  <696b>\n<18a3>  <6980>\n<18a4>  <6998>\n<18a5>  <6978>\n<18a6>  <6934>\n<18a7>  <69cc>\n<18aa>  <69ce>\n<18ab>  <6989>\n<18ac>  <6966>\nendbfchar\n\n100 beginbfchar\n<18ad>  <6963>\n<18ae>  <6979>\n<18af>  <699b>\n<18b0>  <69a7>\n<18b1>  <69bb>\n<18b2>  <69ab>\n<18b3>  <69ad>\n<18b4>  <69d4>\n<18b5>  <69b1>\n<18b6>  <69c1>\n<18b7>  <69ca>\n<18b8>  <69df>\n<18b9>  <6995>\n<18ba>  <69e0>\n<18bb>  <698d>\n<18bc>  <69ff>\n<18bd>  <6a2f>\n<18be>  <69ed>\n<18c1>  <6a65>\n<18c2>  <69f2>\n<18c3>  <6a44>\n<18c4>  <6a3e>\n<18c5>  <6aa0>\n<18c6>  <6a50>\n<18c7>  <6a5b>\n<18c8>  <6a35>\n<18c9>  <6a8e>\n<18ca>  <6a79>\n<18cb>  <6a3d>\n<18cc>  <6a28>\n<18cd>  <6a58>\n<18ce>  <6a7c>\n<18cf>  <6a91>\n<18d0>  <6a90>\n<18d1>  <6aa9>\n<18d2>  <6a97>\n<18d3>  <6aab>\n<18d4>  <7337>\n<18d5>  <7352>\n<18d8>  <6b87>\n<18d9>  <6b84>\n<18dc>  <6b8d>\n<18df>  <6ba1>\n<18e0>  <6baa>\n<18e1>  <8f6b>\n<18e2>  <8f6d>\n<18e8>  <8f78>\n<18e9>  <8f77>\n<18ec>  <8f7c>\n<18ed>  <8f7e>\n<18f0>  <8f84>\n<18f1>  <8f87>\n<18f2>  <8f8b>\n<18f6>  <8f98>\n<18f7>  <8f9a>\n<18f8>  <8ece>\n<18f9>  <620b>\n<18fa>  <6217>\n<18fb>  <621b>\n<18fc>  <621f>\n<18fd>  <6222>\n<18fe>  <6221>\n<18ff>  <6225>\n<1900>  <6224>\n<1901>  <622c>\n<1902>  <81e7>\n<1903>  <74ef>\n<1904>  <74f4>\n<1905>  <74ff>\n<1906>  <750f>\n<1907>  <7511>\n<1908>  <7513>\n<1909>  <6534>\n<190d>  <660a>\n<190e>  <6619>\n<190f>  <6772>\n<1910>  <6603>\n<1911>  <6615>\n<1912>  <6600>\n<1913>  <7085>\n<1914>  <66f7>\n<1915>  <661d>\n<1916>  <6634>\n<1917>  <6631>\n<1918>  <6636>\n<1919>  <6635>\n<191a>  <8006>\n<191b>  <665f>\n<191c>  <6654>\n<191d>  <6641>\n<191e>  <664f>\n<191f>  <6656>\n<1920>  <6661>\n<1921>  <6657>\n<1922>  <6677>\n<1923>  <6684>\n<1924>  <668c>\n<1925>  <66a7>\n<1926>  <669d>\n<1927>  <66be>\nendbfchar\n\n100 beginbfchar\n<192a>  <66e6>\n<192b>  <66e9>\n<192e>  <8d36>\n<192f>  <8d3b>\n<1930>  <8d3d>\n<1931>  <8d40>\n<1936>  <8d47>\n<1937>  <8d4d>\n<1938>  <8d55>\n<1939>  <8d59>\n<193a>  <89c7>\n<1942>  <726e>\n<1943>  <729f>\n<1944>  <725d>\n<1945>  <7266>\n<1946>  <726f>\n<1949>  <7284>\n<194a>  <728b>\n<194b>  <728d>\n<194c>  <728f>\n<194d>  <7292>\n<194e>  <6308>\n<194f>  <6332>\n<1950>  <63b0>\n<1951>  <643f>\n<1952>  <64d8>\n<1953>  <8004>\n<1954>  <6bea>\n<1955>  <6bf3>\n<1956>  <6bfd>\n<1957>  <6bf5>\n<1958>  <6bf9>\n<1959>  <6c05>\n<195a>  <6c07>\n<195b>  <6c06>\n<195c>  <6c0d>\n<195d>  <6c15>\n<1961>  <6c21>\n<1962>  <6c29>\n<1963>  <6c24>\n<1964>  <6c2a>\n<1965>  <6c32>\n<1966>  <6535>\n<1967>  <6555>\n<1968>  <656b>\n<1969>  <724d>\n<196a>  <7252>\n<196b>  <7256>\n<196c>  <7230>\n<196d>  <8662>\n<196e>  <5216>\n<196f>  <809f>\n<1970>  <809c>\n<1971>  <8093>\n<1972>  <80bc>\n<1973>  <670a>\n<1974>  <80bd>\n<1975>  <80b1>\n<1976>  <80ab>\n<1977>  <80ad>\n<1978>  <80b4>\n<1979>  <80b7>\n<197e>  <80db>\n<197f>  <80c2>\n<1980>  <80c4>\n<1981>  <80d9>\n<1982>  <80cd>\n<1983>  <80d7>\n<1984>  <6710>\n<1985>  <80dd>\n<1986>  <80eb>\n<1987>  <80f1>\n<1988>  <80f4>\n<1989>  <80ed>\n<198c>  <80f2>\n<198d>  <80fc>\n<198e>  <6715>\n<198f>  <8112>\n<1990>  <8c5a>\n<1991>  <8136>\n<1992>  <811e>\n<1993>  <812c>\n<1994>  <8118>\n<1995>  <8132>\n<1996>  <8148>\n<1997>  <814c>\n<1998>  <8153>\n<1999>  <8174>\n<199c>  <8171>\n<199d>  <8160>\n<199e>  <8169>\n<19a1>  <816d>\n<19a2>  <8167>\n<19a3>  <584d>\n<19a4>  <5ab5>\n<19a5>  <8188>\n<19a6>  <8182>\n<19a7>  <8191>\n<19a8>  <6ed5>\n<19a9>  <81a3>\nendbfchar\n\n100 beginbfchar\n<19aa>  <81aa>\n<19ab>  <81cc>\n<19ac>  <6726>\n<19ad>  <81ca>\n<19ae>  <81bb>\n<19af>  <81c1>\n<19b0>  <81a6>\n<19b1>  <6b24>\n<19b2>  <6b37>\n<19b3>  <6b39>\n<19b4>  <6b43>\n<19b5>  <6b46>\n<19b6>  <6b59>\n<19ba>  <98d5>\n<19bd>  <6bb3>\n<19be>  <5f40>\n<19bf>  <6bc2>\n<19c0>  <89f3>\n<19c1>  <6590>\n<19c2>  <9f51>\n<19c3>  <6593>\n<19c4>  <65bc>\n<19c5>  <65c6>\n<19c6>  <65c4>\n<19c7>  <65c3>\n<19c8>  <65cc>\n<19c9>  <65ce>\n<19ca>  <65d2>\n<19cb>  <65d6>\n<19cc>  <7080>\n<19cd>  <709c>\n<19ce>  <7096>\n<19cf>  <709d>\n<19d0>  <70bb>\n<19d1>  <70c0>\n<19d2>  <70b7>\n<19d3>  <70ab>\n<19d4>  <70b1>\n<19d5>  <70e8>\n<19d6>  <70ca>\n<19d7>  <7110>\n<19d8>  <7113>\n<19d9>  <7116>\n<19da>  <712f>\n<19db>  <7131>\n<19dc>  <7173>\n<19dd>  <715c>\n<19de>  <7168>\n<19df>  <7145>\n<19e0>  <7172>\n<19e1>  <714a>\n<19e2>  <7178>\n<19e3>  <717a>\n<19e4>  <7198>\n<19e5>  <71b3>\n<19e6>  <71b5>\n<19e7>  <71a8>\n<19e8>  <71a0>\n<19e9>  <71e0>\n<19ea>  <71d4>\n<19eb>  <71e7>\n<19ec>  <71f9>\n<19ed>  <721d>\n<19ee>  <7228>\n<19ef>  <706c>\n<19f0>  <7118>\n<19f1>  <7166>\n<19f2>  <71b9>\n<19f3>  <623e>\n<19f4>  <623d>\n<19f5>  <6243>\n<19f8>  <793b>\n<19f9>  <7940>\n<19fa>  <7946>\n<19fb>  <7949>\n<19fe>  <7953>\n<19ff>  <795a>\n<1a00>  <7962>\n<1a01>  <7957>\n<1a02>  <7960>\n<1a03>  <796f>\n<1a04>  <7967>\n<1a05>  <797a>\n<1a06>  <7985>\n<1a07>  <798a>\n<1a08>  <799a>\n<1a09>  <79a7>\n<1a0a>  <79b3>\n<1a0b>  <5fd1>\n<1a0c>  <5fd0>\n<1a0d>  <603c>\n<1a0e>  <605d>\n<1a0f>  <605a>\n<1a10>  <6067>\n<1a11>  <6041>\n<1a12>  <6059>\n<1a13>  <6063>\n<1a14>  <60ab>\n<1a15>  <6106>\n<1a16>  <610d>\nendbfchar\n\n100 beginbfchar\n<1a17>  <615d>\n<1a18>  <61a9>\n<1a19>  <619d>\n<1a1a>  <61cb>\n<1a1b>  <61d1>\n<1a1c>  <6206>\n<1a1d>  <8080>\n<1a1e>  <807f>\n<1a1f>  <6c93>\n<1a20>  <6cf6>\n<1a21>  <6dfc>\n<1a22>  <77f6>\n<1a23>  <77f8>\n<1a24>  <7800>\n<1a25>  <7809>\n<1a28>  <7811>\n<1a29>  <65ab>\n<1a2a>  <782d>\n<1a30>  <781f>\n<1a31>  <783c>\n<1a32>  <7825>\n<1a33>  <782c>\n<1a34>  <7823>\n<1a35>  <7829>\n<1a36>  <784e>\n<1a37>  <786d>\n<1a3a>  <7826>\n<1a3b>  <7850>\n<1a3c>  <7847>\n<1a3d>  <784c>\n<1a3e>  <786a>\n<1a3f>  <789b>\n<1a40>  <7893>\n<1a41>  <789a>\n<1a42>  <7887>\n<1a43>  <789c>\n<1a44>  <78a1>\n<1a45>  <78a3>\n<1a46>  <78b2>\n<1a47>  <78b9>\n<1a48>  <78a5>\n<1a49>  <78d4>\n<1a4a>  <78d9>\n<1a4b>  <78c9>\n<1a4c>  <78ec>\n<1a4d>  <78f2>\n<1a4e>  <7905>\n<1a4f>  <78f4>\n<1a50>  <7913>\n<1a51>  <7924>\n<1a52>  <791e>\n<1a53>  <7934>\n<1a54>  <9f9b>\n<1a55>  <9ef9>\n<1a58>  <76f1>\n<1a59>  <7704>\n<1a5a>  <770d>\n<1a5b>  <76f9>\n<1a5e>  <771a>\n<1a5f>  <7722>\n<1a60>  <7719>\n<1a61>  <772d>\n<1a62>  <7726>\n<1a63>  <7735>\n<1a64>  <7738>\n<1a67>  <7747>\n<1a68>  <7743>\n<1a69>  <775a>\n<1a6a>  <7768>\n<1a6b>  <7762>\n<1a6c>  <7765>\n<1a6d>  <777f>\n<1a6e>  <778d>\n<1a6f>  <777d>\n<1a70>  <7780>\n<1a71>  <778c>\n<1a72>  <7791>\n<1a75>  <77b0>\n<1a76>  <77b5>\n<1a77>  <77bd>\n<1a78>  <753a>\n<1a79>  <7540>\n<1a7a>  <754e>\n<1a7b>  <754b>\n<1a7c>  <7548>\n<1a7d>  <755b>\n<1a7e>  <7572>\n<1a7f>  <7579>\n<1a80>  <7583>\n<1a81>  <7f58>\n<1a82>  <7f61>\n<1a83>  <7f5f>\n<1a84>  <8a48>\n<1a85>  <7f68>\n<1a86>  <7f74>\n<1a87>  <7f71>\n<1a88>  <7f79>\n<1a89>  <7f81>\n<1a8a>  <7f7e>\n<1a8b>  <76cd>\nendbfchar\n\n100 beginbfchar\n<1a8c>  <76e5>\n<1a8d>  <8832>\n<1a91>  <948b>\n<1a92>  <948a>\n<1a97>  <9494>\n<1a98>  <9497>\n<1a99>  <9495>\n<1a9f>  <94ab>\n<1aa0>  <94aa>\n<1aa1>  <94ad>\n<1aa2>  <94ac>\n<1aa5>  <94b2>\n<1aa6>  <94b4>\n<1aae>  <94bf>\n<1aaf>  <94c4>\n<1abd>  <94d9>\n<1abe>  <94d8>\n<1abf>  <94db>\n<1ac3>  <94e2>\n<1ac8>  <94ea>\n<1ac9>  <94e9>\n<1aca>  <94eb>\n<1ad0>  <94f7>\n<1ad1>  <94f9>\n<1ad4>  <94ff>\n<1ad5>  <9503>\n<1ad6>  <9502>\n<1ae3>  <9518>\n<1ae4>  <951b>\n<1ae8>  <9522>\n<1aeb>  <9529>\n<1aec>  <952c>\n<1aef>  <9534>\n<1af3>  <953c>\n<1af6>  <9542>\n<1af7>  <9535>\n<1afb>  <9549>\n<1afc>  <954c>\n<1aff>  <9552>\n<1b06>  <955b>\n<1b09>  <955d>\n<1b15>  <956f>\n<1b19>  <953a>\n<1b1a>  <77e7>\n<1b1b>  <77ec>\n<1b1c>  <96c9>\n<1b1d>  <79d5>\n<1b1e>  <79ed>\n<1b1f>  <79e3>\n<1b20>  <79eb>\n<1b21>  <7a06>\n<1b22>  <5d47>\n<1b23>  <7a03>\n<1b24>  <7a02>\n<1b25>  <7a1e>\n<1b26>  <7a14>\n<1b27>  <7a39>\n<1b28>  <7a37>\n<1b29>  <7a51>\n<1b2a>  <9ecf>\n<1b2b>  <99a5>\n<1b2c>  <7a70>\n<1b2d>  <7688>\n<1b2e>  <768e>\n<1b2f>  <7693>\n<1b30>  <7699>\n<1b31>  <76a4>\n<1b32>  <74de>\n<1b33>  <74e0>\n<1b34>  <752c>\n<1b35>  <9e20>\n<1b36>  <9e22>\n<1b3c>  <9e32>\n<1b3d>  <9e31>\n<1b3e>  <9e36>\n<1b3f>  <9e38>\n<1b40>  <9e37>\n<1b43>  <9e3e>\n<1b46>  <9e44>\n<1b4d>  <9e4e>\n<1b4e>  <9e51>\n<1b4f>  <9e55>\n<1b50>  <9e57>\n<1b54>  <9e5e>\n<1b55>  <9e63>\n<1b5d>  <9e71>\n<1b5e>  <9e6d>\n<1b5f>  <9e73>\n<1b60>  <7592>\n<1b61>  <7594>\n<1b62>  <7596>\n<1b63>  <75a0>\n<1b64>  <759d>\n<1b65>  <75ac>\n<1b66>  <75a3>\n<1b69>  <75b8>\n<1b6a>  <75c4>\n<1b6b>  <75b1>\n<1b6c>  <75b0>\n<1b6d>  <75c3>\nendbfchar\n\n100 beginbfchar\n<1b6e>  <75c2>\n<1b6f>  <75d6>\n<1b70>  <75cd>\n<1b71>  <75e3>\n<1b72>  <75e8>\n<1b73>  <75e6>\n<1b74>  <75e4>\n<1b75>  <75eb>\n<1b76>  <75e7>\n<1b77>  <7603>\n<1b78>  <75f1>\n<1b79>  <75fc>\n<1b7a>  <75ff>\n<1b7b>  <7610>\n<1b7c>  <7600>\n<1b7d>  <7605>\n<1b7e>  <760c>\n<1b7f>  <7617>\n<1b80>  <760a>\n<1b81>  <7625>\n<1b82>  <7618>\n<1b83>  <7615>\n<1b84>  <7619>\n<1b85>  <761b>\n<1b86>  <763c>\n<1b87>  <7622>\n<1b88>  <7620>\n<1b89>  <7640>\n<1b8a>  <762d>\n<1b8b>  <7630>\n<1b8c>  <763f>\n<1b8d>  <7635>\n<1b8e>  <7643>\n<1b8f>  <763e>\n<1b90>  <7633>\n<1b91>  <764d>\n<1b92>  <765e>\n<1b93>  <7654>\n<1b94>  <765c>\n<1b95>  <7656>\n<1b96>  <766b>\n<1b97>  <766f>\n<1b98>  <7fca>\n<1b99>  <7ae6>\n<1b9c>  <7a80>\n<1b9d>  <7a86>\n<1b9e>  <7a88>\n<1b9f>  <7a95>\n<1ba0>  <7aa6>\n<1ba1>  <7aa0>\n<1ba2>  <7aac>\n<1ba3>  <7aa8>\n<1ba4>  <7aad>\n<1ba5>  <7ab3>\n<1ba6>  <8864>\n<1ba7>  <8869>\n<1ba8>  <8872>\n<1ba9>  <887d>\n<1baa>  <887f>\n<1bab>  <8882>\n<1bac>  <88a2>\n<1bad>  <88c6>\n<1bae>  <88b7>\n<1baf>  <88bc>\n<1bb0>  <88c9>\n<1bb1>  <88e2>\n<1bb2>  <88ce>\n<1bb3>  <88e3>\n<1bb4>  <88e5>\n<1bb5>  <88f1>\n<1bb6>  <891a>\n<1bb7>  <88fc>\n<1bb8>  <88e8>\n<1bb9>  <88fe>\n<1bba>  <88f0>\n<1bbb>  <8921>\n<1bbc>  <8919>\n<1bbd>  <8913>\n<1bbe>  <891b>\n<1bbf>  <890a>\n<1bc0>  <8934>\n<1bc1>  <892b>\n<1bc2>  <8936>\n<1bc3>  <8941>\n<1bc4>  <8966>\n<1bc5>  <897b>\n<1bc6>  <758b>\n<1bc7>  <80e5>\n<1bc8>  <76b2>\n<1bc9>  <76b4>\n<1bca>  <77dc>\n<1bcb>  <8012>\n<1bcc>  <8014>\n<1bcd>  <8016>\n<1bce>  <801c>\n<1bcf>  <8020>\n<1bd0>  <8022>\n<1bd4>  <8029>\n<1bd5>  <8028>\n<1bd6>  <8031>\nendbfchar\n\n100 beginbfchar\n<1bd7>  <800b>\n<1bd8>  <8035>\n<1bd9>  <8043>\n<1bda>  <8046>\n<1bdb>  <804d>\n<1bdc>  <8052>\n<1bdd>  <8069>\n<1bde>  <8071>\n<1bdf>  <8983>\n<1be0>  <9878>\n<1be1>  <9880>\n<1be2>  <9883>\n<1be3>  <9889>\n<1be6>  <988f>\n<1be7>  <9894>\n<1bf0>  <864d>\n<1bf1>  <8654>\n<1bf2>  <866c>\n<1bf3>  <866e>\n<1bf4>  <867f>\n<1bf5>  <867a>\n<1bf6>  <867c>\n<1bf7>  <867b>\n<1bf8>  <86a8>\n<1bf9>  <868d>\n<1bfa>  <868b>\n<1bfb>  <86ac>\n<1bfc>  <869d>\n<1bfd>  <86a7>\n<1bfe>  <86a3>\n<1bff>  <86aa>\n<1c00>  <8693>\n<1c01>  <86a9>\n<1c02>  <86b6>\n<1c03>  <86c4>\n<1c04>  <86b5>\n<1c05>  <86ce>\n<1c06>  <86b0>\n<1c07>  <86ba>\n<1c08>  <86b1>\n<1c09>  <86af>\n<1c0a>  <86c9>\n<1c0b>  <86cf>\n<1c0c>  <86b4>\n<1c0d>  <86e9>\n<1c10>  <86ed>\n<1c11>  <86f3>\n<1c12>  <86d0>\n<1c13>  <8713>\n<1c14>  <86de>\n<1c15>  <86f4>\n<1c16>  <86df>\n<1c17>  <86d8>\n<1c18>  <86d1>\n<1c19>  <8703>\n<1c1a>  <8707>\n<1c1b>  <86f8>\n<1c1c>  <8708>\n<1c1d>  <870a>\n<1c1e>  <870d>\n<1c1f>  <8709>\n<1c20>  <8723>\n<1c21>  <873b>\n<1c22>  <871e>\n<1c23>  <8725>\n<1c24>  <872e>\n<1c25>  <871a>\n<1c26>  <873e>\n<1c27>  <8748>\n<1c28>  <8734>\n<1c29>  <8731>\n<1c2a>  <8729>\n<1c2b>  <8737>\n<1c2c>  <873f>\n<1c2d>  <8782>\n<1c2e>  <8722>\n<1c31>  <877b>\n<1c32>  <8760>\n<1c33>  <8770>\n<1c34>  <874c>\n<1c35>  <876e>\n<1c36>  <878b>\n<1c37>  <8753>\n<1c38>  <8763>\n<1c39>  <877c>\n<1c3a>  <8764>\n<1c3b>  <8759>\n<1c3c>  <8765>\n<1c3d>  <8793>\n<1c3e>  <87af>\n<1c3f>  <87a8>\n<1c40>  <87d2>\n<1c41>  <87c6>\n<1c42>  <8788>\n<1c43>  <8785>\n<1c44>  <87ad>\n<1c45>  <8797>\n<1c46>  <8783>\n<1c47>  <87ab>\n<1c48>  <87e5>\nendbfchar\n\n100 beginbfchar\n<1c49>  <87ac>\n<1c4a>  <87b5>\n<1c4b>  <87b3>\n<1c4c>  <87cb>\n<1c4d>  <87d3>\n<1c4e>  <87bd>\n<1c4f>  <87d1>\n<1c50>  <87c0>\n<1c51>  <87ca>\n<1c52>  <87db>\n<1c53>  <87ea>\n<1c54>  <87e0>\n<1c55>  <87ee>\n<1c56>  <8816>\n<1c57>  <8813>\n<1c58>  <87fe>\n<1c59>  <880a>\n<1c5a>  <881b>\n<1c5b>  <8821>\n<1c5c>  <8839>\n<1c5d>  <883c>\n<1c5e>  <7f36>\n<1c5f>  <7f42>\n<1c62>  <8210>\n<1c63>  <7afa>\n<1c64>  <7afd>\n<1c65>  <7b08>\n<1c68>  <7b15>\n<1c69>  <7b0a>\n<1c6a>  <7b2b>\n<1c6b>  <7b0f>\n<1c6c>  <7b47>\n<1c6d>  <7b38>\n<1c6e>  <7b2a>\n<1c6f>  <7b19>\n<1c70>  <7b2e>\n<1c71>  <7b31>\n<1c72>  <7b20>\n<1c73>  <7b25>\n<1c74>  <7b24>\n<1c75>  <7b33>\n<1c76>  <7b3e>\n<1c77>  <7b1e>\n<1c78>  <7b58>\n<1c79>  <7b5a>\n<1c7a>  <7b45>\n<1c7b>  <7b75>\n<1c7c>  <7b4c>\n<1c7d>  <7b5d>\n<1c7e>  <7b60>\n<1c7f>  <7b6e>\n<1c80>  <7b7b>\n<1c81>  <7b62>\n<1c82>  <7b72>\n<1c83>  <7b71>\n<1c84>  <7b90>\n<1c87>  <7bb8>\n<1c88>  <7bac>\n<1c89>  <7b9d>\n<1c8a>  <7ba8>\n<1c8b>  <7b85>\n<1c8c>  <7baa>\n<1c8d>  <7b9c>\n<1c8e>  <7ba2>\n<1c8f>  <7bab>\n<1c90>  <7bb4>\n<1c91>  <7bd1>\n<1c92>  <7bc1>\n<1c93>  <7bcc>\n<1c94>  <7bdd>\n<1c95>  <7bda>\n<1c98>  <7bea>\n<1c99>  <7c0c>\n<1c9a>  <7bfe>\n<1c9b>  <7bfc>\n<1c9c>  <7c0f>\n<1c9d>  <7c16>\n<1c9e>  <7c0b>\n<1c9f>  <7c1f>\n<1ca0>  <7c2a>\n<1ca1>  <7c26>\n<1ca2>  <7c38>\n<1ca3>  <7c41>\n<1ca4>  <7c40>\n<1ca5>  <81fe>\n<1ca8>  <8204>\n<1ca9>  <81ec>\n<1caa>  <8844>\n<1cae>  <822d>\n<1caf>  <822f>\n<1cb0>  <8228>\n<1cb1>  <822b>\n<1cb2>  <8238>\n<1cb3>  <823b>\n<1cb6>  <823e>\n<1cb7>  <8244>\n<1cb8>  <8249>\n<1cb9>  <824b>\n<1cba>  <824f>\n<1cbb>  <825a>\nendbfchar\n\n100 beginbfchar\n<1cbc>  <825f>\n<1cbd>  <8268>\n<1cbe>  <887e>\n<1cbf>  <8885>\n<1cc0>  <8888>\n<1cc1>  <88d8>\n<1cc2>  <88df>\n<1cc3>  <895e>\n<1cc4>  <7f9d>\n<1cc5>  <7f9f>\n<1cc6>  <7fa7>\n<1cc9>  <7fb2>\n<1cca>  <7c7c>\n<1ccb>  <6549>\n<1ccc>  <7c91>\n<1ccd>  <7c9d>\n<1cce>  <7c9c>\n<1ccf>  <7c9e>\n<1cd0>  <7ca2>\n<1cd1>  <7cb2>\n<1cd4>  <7cc1>\n<1cd5>  <7cc7>\n<1cd8>  <7cc8>\n<1cd9>  <7cc5>\n<1cda>  <7cd7>\n<1cdb>  <7ce8>\n<1cdc>  <826e>\n<1cdd>  <66a8>\n<1cde>  <7fbf>\n<1cdf>  <7fce>\n<1ce0>  <7fd5>\n<1ce1>  <7fe5>\n<1ce2>  <7fe1>\n<1ce3>  <7fe6>\n<1ce4>  <7fe9>\n<1ce5>  <7fee>\n<1ce6>  <7ff3>\n<1ce7>  <7cf8>\n<1ce8>  <7d77>\n<1ce9>  <7da6>\n<1cea>  <7dae>\n<1ceb>  <7e47>\n<1cec>  <7e9b>\n<1ced>  <9eb8>\n<1cee>  <9eb4>\n<1cef>  <8d73>\n<1cf0>  <8d84>\n<1cf1>  <8d94>\n<1cf2>  <8d91>\n<1cf3>  <8db1>\n<1cf4>  <8d67>\n<1cf5>  <8d6d>\n<1cf6>  <8c47>\n<1cf7>  <8c49>\n<1cf8>  <914a>\n<1cf9>  <9150>\n<1cfc>  <9164>\n<1cfd>  <9162>\n<1cfe>  <9161>\n<1cff>  <9170>\n<1d00>  <9169>\n<1d01>  <916f>\n<1d04>  <9172>\n<1d05>  <9174>\n<1d06>  <9179>\n<1d07>  <918c>\n<1d08>  <9185>\n<1d09>  <9190>\n<1d0a>  <918d>\n<1d0b>  <9191>\n<1d0e>  <91aa>\n<1d12>  <91b5>\n<1d13>  <91b4>\n<1d14>  <91ba>\n<1d15>  <8c55>\n<1d16>  <9e7e>\n<1d17>  <8db8>\n<1d18>  <8deb>\n<1d19>  <8e05>\n<1d1a>  <8e59>\n<1d1b>  <8e69>\n<1d1c>  <8db5>\n<1d1d>  <8dbf>\n<1d1e>  <8dbc>\n<1d1f>  <8dba>\n<1d20>  <8dc4>\n<1d23>  <8dda>\n<1d24>  <8dde>\n<1d27>  <8ddb>\n<1d28>  <8dc6>\n<1d29>  <8dec>\n<1d2c>  <8de3>\n<1d2d>  <8df9>\n<1d2e>  <8dfb>\n<1d2f>  <8de4>\n<1d30>  <8e09>\n<1d31>  <8dfd>\n<1d32>  <8e14>\n<1d33>  <8e1d>\n<1d34>  <8e1f>\nendbfchar\n\n100 beginbfchar\n<1d35>  <8e2c>\n<1d36>  <8e2e>\n<1d37>  <8e23>\n<1d38>  <8e2f>\n<1d39>  <8e3a>\n<1d3a>  <8e40>\n<1d3b>  <8e39>\n<1d3c>  <8e35>\n<1d3d>  <8e3d>\n<1d3e>  <8e31>\n<1d3f>  <8e49>\n<1d44>  <8e4a>\n<1d45>  <8e70>\n<1d46>  <8e76>\n<1d47>  <8e7c>\n<1d48>  <8e6f>\n<1d49>  <8e74>\n<1d4a>  <8e85>\n<1d4b>  <8e8f>\n<1d4c>  <8e94>\n<1d4d>  <8e90>\n<1d4e>  <8e9c>\n<1d4f>  <8e9e>\n<1d50>  <8c78>\n<1d51>  <8c82>\n<1d52>  <8c8a>\n<1d53>  <8c85>\n<1d54>  <8c98>\n<1d55>  <8c94>\n<1d56>  <659b>\n<1d57>  <89d6>\n<1d58>  <89de>\n<1d59>  <89da>\n<1d5a>  <89dc>\n<1d5b>  <89e5>\n<1d5c>  <89eb>\n<1d5d>  <89ef>\n<1d5e>  <8a3e>\n<1d5f>  <8b26>\n<1d60>  <9753>\n<1d61>  <96e9>\n<1d62>  <96f3>\n<1d63>  <96ef>\n<1d64>  <9706>\n<1d65>  <9701>\n<1d66>  <9708>\n<1d67>  <970f>\n<1d68>  <970e>\n<1d69>  <972a>\n<1d6a>  <972d>\n<1d6b>  <9730>\n<1d6c>  <973e>\n<1d6d>  <9f80>\n<1d6e>  <9f83>\n<1d75>  <9f8c>\n<1d76>  <9efe>\n<1d77>  <9f0b>\n<1d78>  <9f0d>\n<1d79>  <96b9>\n<1d7c>  <96ce>\n<1d7d>  <96d2>\n<1d7e>  <77bf>\n<1d7f>  <96e0>\n<1d80>  <928e>\n<1d81>  <92ae>\n<1d82>  <92c8>\n<1d83>  <933e>\n<1d84>  <936a>\n<1d85>  <93ca>\n<1d86>  <938f>\n<1d87>  <943e>\n<1d88>  <946b>\n<1d89>  <9c7f>\n<1d8a>  <9c82>\n<1d8f>  <7a23>\n<1d90>  <9c8b>\n<1d91>  <9c8e>\n<1da4>  <9cab>\n<1dc6>  <9cdf>\n<1dc7>  <9ce2>\n<1dc8>  <977c>\n<1dc9>  <9785>\n<1dcc>  <9794>\n<1dcd>  <97af>\n<1dce>  <97ab>\n<1dcf>  <97a3>\n<1dd0>  <97b2>\n<1dd1>  <97b4>\n<1dd2>  <9ab1>\n<1dd3>  <9ab0>\n<1dd4>  <9ab7>\n<1dd5>  <9e58>\n<1dd6>  <9ab6>\n<1dd7>  <9aba>\n<1dd8>  <9abc>\n<1dd9>  <9ac1>\n<1dda>  <9ac0>\n<1ddb>  <9ac5>\n<1ddc>  <9ac2>\n<1ddf>  <9ad1>\nendbfchar\n\n100 beginbfchar\n<1de0>  <9b45>\n<1de1>  <9b43>\n<1de2>  <9b47>\n<1de3>  <9b49>\n<1de4>  <9b48>\n<1de5>  <9b4d>\n<1de6>  <9b51>\n<1de7>  <98e8>\n<1de8>  <990d>\n<1de9>  <992e>\n<1dea>  <9955>\n<1deb>  <9954>\n<1dec>  <9adf>\n<1ded>  <9ae1>\n<1dee>  <9ae6>\n<1def>  <9aef>\n<1df0>  <9aeb>\n<1df1>  <9afb>\n<1df2>  <9aed>\n<1df3>  <9af9>\n<1df4>  <9b08>\n<1df5>  <9b0f>\n<1df6>  <9b13>\n<1df7>  <9b1f>\n<1df8>  <9b23>\n<1dfb>  <7e3b>\n<1dfc>  <9e82>\n<1dff>  <9e8b>\n<1e00>  <9e92>\n<1e01>  <93d6>\n<1e02>  <9e9d>\n<1e03>  <9e9f>\n<1e07>  <9ee0>\n<1e08>  <9edf>\n<1e09>  <9ee2>\n<1e0a>  <9ee9>\n<1e0b>  <9ee7>\n<1e0c>  <9ee5>\n<1e0d>  <9eea>\n<1e0e>  <9eef>\n<1e0f>  <9f22>\n<1e10>  <9f2c>\n<1e11>  <9f2f>\n<1e12>  <9f39>\n<1e13>  <9f37>\n<1e16>  <9f44>\n<1e17>  <3007>\n<1e18>  <ff5e>\n<1e19>  <2016>\n<1e1a>  <3013>\n<1e1b>  <ff0e>\n<1e1c>  <ff1d>\n<1e1d>  <ff3b>\n<1e1e>  <ff3d>\n<1e1f>  <ffe3>\n<1e20>  <00fc>\n<1e21>  <00a9>\n<1e22>  <2122>\n<1e23>  <2026>\n<1e24>  <0020>\n<1e25>  <769a>\n<1e26>  <85f9>\n<1e27>  <7919>\n<1e28>  <611b>\n<1e29>  <9aaf>\n<1e2a>  <8956>\n<1e2b>  <58e9>\n<1e2c>  <7f77>\n<1e2d>  <64fa>\n<1e2e>  <6557>\n<1e2f>  <9812>\n<1e30>  <8fa6>\n<1e31>  <7d46>\n<1e32>  <5e6b>\n<1e33>  <7d81>\n<1e34>  <938a>\n<1e35>  <8b17>\n<1e36>  <98fd>\n<1e37>  <5bf6>\n<1e38>  <5831>\n<1e39>  <9b91>\n<1e3a>  <8f29>\n<1e3b>  <8c9d>\n<1e3c>  <92c7>\n<1e3d>  <72fd>\n<1e3e>  <5099>\n<1e3f>  <618a>\n<1e40>  <7db3>\n<1e41>  <7b46>\n<1e42>  <7562>\n<1e43>  <6583>\n<1e44>  <5e63>\n<1e45>  <9589>\n<1e46>  <908a>\n<1e47>  <7de8>\n<1e48>  <8cb6>\n<1e49>  <8b8a>\n<1e4a>  <8faf>\n<1e4b>  <8fae>\n<1e4c>  <6a19>\nendbfchar\n\n100 beginbfchar\n<1e4d>  <9c49>\n<1e4e>  <765f>\n<1e4f>  <7015>\n<1e50>  <6ff1>\n<1e51>  <8cd3>\n<1e52>  <64ef>\n<1e53>  <9905>\n<1e54>  <64a5>\n<1e55>  <9262>\n<1e56>  <9251>\n<1e57>  <99c1>\n<1e58>  <88dc>\n<1e59>  <8ca1>\n<1e5a>  <53c3>\n<1e5b>  <8836>\n<1e5c>  <6b98>\n<1e5d>  <615a>\n<1e5e>  <6158>\n<1e5f>  <71e6>\n<1e60>  <84bc>\n<1e61>  <8259>\n<1e62>  <5009>\n<1e63>  <6ec4>\n<1e64>  <53a0>\n<1e65>  <5074>\n<1e66>  <6e2c>\n<1e67>  <5c64>\n<1e68>  <8a6b>\n<1e69>  <6519>\n<1e6a>  <647b>\n<1e6b>  <87ec>\n<1e6c>  <995e>\n<1e6d>  <8b92>\n<1e6e>  <7e8f>\n<1e6f>  <93df>\n<1e70>  <7523>\n<1e71>  <95e1>\n<1e72>  <986b>\n<1e73>  <5834>\n<1e74>  <5617>\n<1e75>  <9577>\n<1e76>  <511f>\n<1e77>  <8178>\n<1e78>  <5ee0>\n<1e79>  <66a2>\n<1e7a>  <9214>\n<1e7b>  <8eca>\n<1e7c>  <5fb9>\n<1e7d>  <5875>\n<1e7e>  <9673>\n<1e7f>  <896f>\n<1e80>  <7a31>\n<1e81>  <61f2>\n<1e82>  <8aa0>\n<1e83>  <9a01>\n<1e84>  <9072>\n<1e85>  <99b3>\n<1e86>  <9f52>\n<1e87>  <71be>\n<1e88>  <885d>\n<1e89>  <87f2>\n<1e8a>  <5bf5>\n<1e8b>  <7587>\n<1e8c>  <8e8a>\n<1e8d>  <7c4c>\n<1e8e>  <7da2>\n<1e8f>  <919c>\n<1e90>  <92e4>\n<1e91>  <96db>\n<1e92>  <790e>\n<1e93>  <5132>\n<1e94>  <89f8>\n<1e95>  <8655>\n<1e96>  <50b3>\n<1e97>  <7621>\n<1e98>  <95d6>\n<1e99>  <5275>\n<1e9a>  <9318>\n<1e9b>  <7d14>\n<1e9c>  <7dbd>\n<1e9d>  <8fad>\n<1e9e>  <8a5e>\n<1e9f>  <8cdc>\n<1ea0>  <8070>\n<1ea1>  <5f9e>\n<1ea2>  <53e2>\n<1ea3>  <8ea5>\n<1ea4>  <7ac4>\n<1ea5>  <932f>\n<1ea6>  <9054>\n<1ea7>  <5e36>\n<1ea8>  <8cb8>\n<1ea9>  <64d4>\n<1eaa>  <55ae>\n<1eab>  <9132>\n<1eac>  <64a3>\n<1ead>  <81bd>\n<1eae>  <619a>\n<1eaf>  <8a95>\n<1eb0>  <5f48>\nendbfchar\n\n100 beginbfchar\n<1eb1>  <7576>\n<1eb2>  <64cb>\n<1eb3>  <9ee8>\n<1eb4>  <8569>\n<1eb5>  <6a94>\n<1eb6>  <6417>\n<1eb7>  <5cf6>\n<1eb8>  <79b1>\n<1eb9>  <5c0e>\n<1eba>  <71c8>\n<1ebb>  <9127>\n<1ebc>  <6575>\n<1ebd>  <6ecc>\n<1ebe>  <905e>\n<1ebf>  <7de0>\n<1ec0>  <985b>\n<1ec1>  <9ede>\n<1ec2>  <588a>\n<1ec3>  <96fb>\n<1ec4>  <6fb1>\n<1ec5>  <91e3>\n<1ec6>  <8abf>\n<1ec7>  <8adc>\n<1ec8>  <91d8>\n<1ec9>  <9802>\n<1eca>  <9320>\n<1ecb>  <8a02>\n<1ecc>  <6771>\n<1ecd>  <52d5>\n<1ece>  <68df>\n<1ecf>  <51cd>\n<1ed0>  <9b25>\n<1ed1>  <72a2>\n<1ed2>  <7368>\n<1ed3>  <8b80>\n<1ed4>  <8ced>\n<1ed5>  <934d>\n<1ed6>  <935b>\n<1ed7>  <65b7>\n<1ed8>  <7dde>\n<1ed9>  <968a>\n<1eda>  <5c0d>\n<1edb>  <5678>\n<1edc>  <9813>\n<1edd>  <920d>\n<1ede>  <596a>\n<1edf>  <58ae>\n<1ee0>  <9d5d>\n<1ee1>  <984d>\n<1ee2>  <8a1b>\n<1ee3>  <60e1>\n<1ee4>  <9913>\n<1ee5>  <5152>\n<1ee6>  <723e>\n<1ee7>  <990c>\n<1ee8>  <8cb3>\n<1ee9>  <767c>\n<1eea>  <7f70>\n<1eeb>  <95a5>\n<1eec>  <792c>\n<1eed>  <91e9>\n<1eee>  <7169>\n<1eef>  <7bc4>\n<1ef0>  <8ca9>\n<1ef1>  <98ef>\n<1ef2>  <8a2a>\n<1ef3>  <7d21>\n<1ef4>  <98db>\n<1ef5>  <8ab9>\n<1ef6>  <5ee2>\n<1ef7>  <8cbb>\n<1ef8>  <7d1b>\n<1ef9>  <58b3>\n<1efa>  <596e>\n<1efb>  <61a4>\n<1efc>  <7cde>\n<1efd>  <8c50>\n<1efe>  <6953>\n<1eff>  <92d2>\n<1f00>  <98a8>\n<1f01>  <760b>\n<1f02>  <99ae>\n<1f03>  <7e2b>\n<1f04>  <8af7>\n<1f05>  <9cf3>\n<1f06>  <819a>\n<1f07>  <8f3b>\n<1f08>  <64ab>\n<1f09>  <8f14>\n<1f0a>  <8ce6>\n<1f0b>  <5fa9>\n<1f0c>  <8ca0>\n<1f0d>  <8a03>\n<1f0e>  <5a66>\n<1f0f>  <7e1b>\n<1f10>  <8a72>\n<1f11>  <9223>\n<1f12>  <84cb>\n<1f13>  <5e79>\n<1f14>  <8d95>\nendbfchar\n\n100 beginbfchar\n<1f15>  <8d1b>\n<1f16>  <5ca1>\n<1f17>  <525b>\n<1f18>  <92fc>\n<1f19>  <7db1>\n<1f1a>  <5d17>\n<1f1b>  <93ac>\n<1f1c>  <64f1>\n<1f1d>  <9d3f>\n<1f1e>  <95a3>\n<1f1f>  <927b>\n<1f20>  <500b>\n<1f21>  <7d66>\n<1f22>  <9f94>\n<1f23>  <978f>\n<1f24>  <8ca2>\n<1f25>  <920e>\n<1f26>  <6e9d>\n<1f27>  <69cb>\n<1f28>  <8cfc>\n<1f29>  <8831>\n<1f2a>  <9867>\n<1f2b>  <526e>\n<1f2c>  <95dc>\n<1f2d>  <89c0>\n<1f2e>  <9928>\n<1f2f>  <6163>\n<1f30>  <8cab>\n<1f31>  <5ee3>\n<1f32>  <898f>\n<1f33>  <6b78>\n<1f34>  <9f9c>\n<1f35>  <95a8>\n<1f36>  <8ecc>\n<1f37>  <8a6d>\n<1f38>  <6ac3>\n<1f39>  <8cb4>\n<1f3a>  <528a>\n<1f3b>  <8f25>\n<1f3c>  <934b>\n<1f3d>  <570b>\n<1f3e>  <904e>\n<1f3f>  <99ed>\n<1f40>  <97d3>\n<1f41>  <6f22>\n<1f42>  <865f>\n<1f43>  <95a1>\n<1f44>  <9db4>\n<1f45>  <8cc0>\n<1f46>  <8f5f>\n<1f47>  <9d3b>\n<1f48>  <7d05>\n<1f49>  <58fa>\n<1f4a>  <8b77>\n<1f4b>  <6eec>\n<1f4c>  <5629>\n<1f4d>  <83ef>\n<1f4e>  <756b>\n<1f4f>  <5283>\n<1f50>  <8a71>\n<1f51>  <61f7>\n<1f52>  <58de>\n<1f53>  <6b61>\n<1f54>  <74b0>\n<1f55>  <9084>\n<1f56>  <7de9>\n<1f57>  <8b0a>\n<1f58>  <63ee>\n<1f59>  <8f1d>\n<1f5a>  <8cc4>\n<1f5b>  <7a62>\n<1f5c>  <6703>\n<1f5d>  <71f4>\n<1f5e>  <532f>\n<1f5f>  <8af1>\n<1f60>  <8aa8>\n<1f61>  <7e6a>\n<1f62>  <8477>\n<1f63>  <6e3e>\n<1f64>  <7372>\n<1f65>  <8ca8>\n<1f66>  <798d>\n<1f67>  <64ca>\n<1f68>  <6a5f>\n<1f69>  <7a4d>\n<1f6a>  <9951>\n<1f6b>  <8b4f>\n<1f6c>  <9dc4>\n<1f6d>  <7e3e>\n<1f6e>  <7ddd>\n<1f6f>  <6975>\n<1f70>  <8f2f>\n<1f71>  <7d1a>\n<1f72>  <64e0>\n<1f73>  <5e7e>\n<1f74>  <858a>\n<1f75>  <5291>\n<1f76>  <6fdf>\n<1f77>  <8a08>\n<1f78>  <8a18>\nendbfchar\n\n100 beginbfchar\n<1f79>  <969b>\n<1f7a>  <7e7c>\n<1f7b>  <7d00>\n<1f7c>  <593e>\n<1f7d>  <83a2>\n<1f7e>  <9830>\n<1f7f>  <8cc8>\n<1f80>  <9240>\n<1f81>  <50f9>\n<1f82>  <99d5>\n<1f83>  <6bb2>\n<1f84>  <76e3>\n<1f85>  <5805>\n<1f86>  <7b8b>\n<1f87>  <9593>\n<1f88>  <8271>\n<1f89>  <7dd8>\n<1f8a>  <7e6d>\n<1f8b>  <6aa2>\n<1f8c>  <9e7c>\n<1f8d>  <63c0>\n<1f8e>  <64bf>\n<1f8f>  <7c21>\n<1f90>  <5109>\n<1f91>  <85a6>\n<1f92>  <6abb>\n<1f93>  <9452>\n<1f94>  <8e10>\n<1f95>  <8ce4>\n<1f96>  <898b>\n<1f97>  <9375>\n<1f98>  <8266>\n<1f99>  <528d>\n<1f9a>  <991e>\n<1f9b>  <6f38>\n<1f9c>  <6ffa>\n<1f9d>  <6f97>\n<1f9e>  <5c07>\n<1f9f>  <6f3f>\n<1fa0>  <8523>\n<1fa1>  <69f3>\n<1fa2>  <596c>\n<1fa3>  <8b1b>\n<1fa4>  <91ac>\n<1fa5>  <81a0>\n<1fa6>  <6f86>\n<1fa7>  <9a55>\n<1fa8>  <5b0c>\n<1fa9>  <652a>\n<1faa>  <9278>\n<1fab>  <77ef>\n<1fac>  <50e5>\n<1fad>  <9903>\n<1fae>  <7e73>\n<1faf>  <7d5e>\n<1fb0>  <8f4e>\n<1fb1>  <8f03>\n<1fb2>  <968e>\n<1fb3>  <7bc0>\n<1fb4>  <6f54>\n<1fb5>  <7d50>\n<1fb6>  <8aa1>\n<1fb7>  <7dca>\n<1fb8>  <9326>\n<1fb9>  <50c5>\n<1fba>  <8b39>\n<1fbb>  <9032>\n<1fbc>  <71fc>\n<1fbd>  <76e1>\n<1fbe>  <52c1>\n<1fbf>  <8396>\n<1fc0>  <9be8>\n<1fc1>  <9a5a>\n<1fc2>  <7d93>\n<1fc3>  <9838>\n<1fc4>  <93e1>\n<1fc5>  <5f91>\n<1fc6>  <75d9>\n<1fc7>  <7af6>\n<1fc8>  <7cfe>\n<1fc9>  <820a>\n<1fca>  <99d2>\n<1fcb>  <8209>\n<1fcc>  <64da>\n<1fcd>  <92f8>\n<1fce>  <61fc>\n<1fcf>  <5287>\n<1fd0>  <9d51>\n<1fd1>  <7d79>\n<1fd2>  <89ba>\n<1fd3>  <8a23>\n<1fd4>  <7d76>\n<1fd5>  <921e>\n<1fd6>  <8ecd>\n<1fd7>  <99ff>\n<1fd8>  <958b>\n<1fd9>  <51f1>\n<1fda>  <9846>\n<1fdb>  <6bbb>\n<1fdc>  <8ab2>\nendbfchar\n\n100 beginbfchar\n<1fdd>  <58be>\n<1fde>  <61c7>\n<1fdf>  <6473>\n<1fe0>  <5eab>\n<1fe1>  <8932>\n<1fe2>  <8a87>\n<1fe3>  <584a>\n<1fe4>  <5108>\n<1fe5>  <5bec>\n<1fe6>  <7926>\n<1fe7>  <66e0>\n<1fe8>  <8667>\n<1fe9>  <5dcb>\n<1fea>  <7aba>\n<1feb>  <994b>\n<1fec>  <6f70>\n<1fed>  <64f4>\n<1fee>  <95ca>\n<1fef>  <881f>\n<1ff0>  <81d8>\n<1ff1>  <840a>\n<1ff2>  <4f86>\n<1ff3>  <8cf4>\n<1ff4>  <85cd>\n<1ff5>  <6b04>\n<1ff6>  <6514>\n<1ff7>  <7c43>\n<1ff8>  <95cc>\n<1ff9>  <862d>\n<1ffa>  <703e>\n<1ffb>  <8b95>\n<1ffc>  <652c>\n<1ffd>  <89bd>\n<1ffe>  <61f6>\n<1fff>  <7e9c>\n<2000>  <721b>\n<2001>  <6feb>\n<2002>  <6488>\n<2003>  <52de>\n<2004>  <6f87>\n<2005>  <6a02>\n<2006>  <9433>\n<2007>  <58d8>\n<2008>  <985e>\n<2009>  <7c6c>\n<200a>  <96e2>\n<200b>  <7055>\n<200c>  <88cf>\n<200d>  <9bc9>\n<200e>  <79ae>\n<200f>  <9e97>\n<2010>  <53b2>\n<2011>  <52f5>\n<2012>  <792b>\n<2013>  <6b77>\n<2014>  <701d>\n<2015>  <96b8>\n<2016>  <5006>\n<2017>  <806f>\n<2018>  <84ee>\n<2019>  <9023>\n<201a>  <942e>\n<201b>  <6190>\n<201c>  <6f23>\n<201d>  <7c3e>\n<201e>  <6582>\n<201f>  <81c9>\n<2020>  <93c8>\n<2021>  <6200>\n<2022>  <7149>\n<2023>  <7df4>\n<2024>  <7ce7>\n<2025>  <5169>\n<2026>  <8f1b>\n<2027>  <8ad2>\n<2028>  <7642>\n<2029>  <907c>\n<202a>  <9410>\n<202b>  <7375>\n<202c>  <81e8>\n<202d>  <9130>\n<202e>  <9c57>\n<202f>  <8cc3>\n<2030>  <9f61>\n<2031>  <9234>\n<2032>  <9748>\n<2033>  <5dba>\n<2034>  <9818>\n<2035>  <993e>\n<2036>  <5289>\n<2037>  <9f8d>\n<2038>  <807e>\n<2039>  <56a8>\n<203a>  <7c60>\n<203b>  <58df>\n<203c>  <650f>\n<203d>  <96b4>\n<203e>  <6a13>\n<203f>  <5a41>\n<2040>  <645f>\nendbfchar\n\n100 beginbfchar\n<2041>  <7c0d>\n<2042>  <8606>\n<2043>  <76e7>\n<2044>  <9871>\n<2045>  <5eec>\n<2046>  <7210>\n<2047>  <64c4>\n<2048>  <6ef7>\n<2049>  <865c>\n<204a>  <9b6f>\n<204b>  <8cc2>\n<204c>  <9332>\n<204d>  <9678>\n<204e>  <9a62>\n<204f>  <92c1>\n<2050>  <5c62>\n<2051>  <7e37>\n<2052>  <616e>\n<2053>  <6ffe>\n<2054>  <7dd1>\n<2055>  <5dd2>\n<2056>  <6523>\n<2057>  <5b7f>\n<2058>  <7064>\n<2059>  <4e82>\n<205a>  <6384>\n<205b>  <8f2a>\n<205c>  <502b>\n<205d>  <4f96>\n<205e>  <6dea>\n<205f>  <7db8>\n<2060>  <8ad6>\n<2061>  <863f>\n<2062>  <7f85>\n<2063>  <908f>\n<2064>  <947c>\n<2065>  <7c6e>\n<2066>  <9a3e>\n<2067>  <99f1>\n<2068>  <7d61>\n<2069>  <5abd>\n<206a>  <746a>\n<206b>  <78bc>\n<206c>  <879e>\n<206d>  <99ac>\n<206e>  <99e1>\n<206f>  <55ce>\n<2070>  <8cb7>\n<2071>  <9ea5>\n<2072>  <8ce3>\n<2073>  <9081>\n<2074>  <779e>\n<2075>  <9945>\n<2076>  <883b>\n<2077>  <6eff>\n<2078>  <8b3e>\n<2079>  <9328>\n<207a>  <925a>\n<207b>  <8cbf>\n<207c>  <9382>\n<207d>  <9580>\n<207e>  <60b6>\n<207f>  <5011>\n<2080>  <9333>\n<2081>  <5922>\n<2082>  <8b0e>\n<2083>  <5f4c>\n<2084>  <8993>\n<2085>  <7dbf>\n<2086>  <7dec>\n<2087>  <5edf>\n<2088>  <6ec5>\n<2089>  <61ab>\n<208a>  <95a9>\n<208b>  <9cf4>\n<208c>  <9298>\n<208d>  <8b2c>\n<208e>  <8b00>\n<208f>  <755d>\n<2090>  <9209>\n<2091>  <7d0d>\n<2092>  <96e3>\n<2093>  <6493>\n<2094>  <8166>\n<2095>  <60f1>\n<2096>  <9b27>\n<2097>  <9912>\n<2098>  <64ec>\n<2099>  <81a9>\n<209a>  <6506>\n<209b>  <91c0>\n<209c>  <9ce5>\n<209d>  <8076>\n<209e>  <5699>\n<209f>  <9477>\n<20a0>  <93b3>\n<20a1>  <6ab8>\n<20a2>  <7370>\n<20a3>  <5be7>\n<20a4>  <64f0>\nendbfchar\n\n100 beginbfchar\n<20a5>  <6fd8>\n<20a6>  <9215>\n<20a7>  <7d10>\n<20a8>  <81bf>\n<20a9>  <6fc3>\n<20aa>  <8fb2>\n<20ab>  <7627>\n<20ac>  <8afe>\n<20ad>  <6b50>\n<20ae>  <9dd7>\n<20af>  <6bc6>\n<20b0>  <5614>\n<20b1>  <6f1a>\n<20b2>  <76e4>\n<20b3>  <9f90>\n<20b4>  <8ce0>\n<20b5>  <5674>\n<20b6>  <9d6c>\n<20b7>  <9a19>\n<20b8>  <98c4>\n<20b9>  <983b>\n<20ba>  <8ca7>\n<20bb>  <860b>\n<20bc>  <6191>\n<20bd>  <8a55>\n<20be>  <6f51>\n<20bf>  <9817>\n<20c0>  <64b2>\n<20c1>  <92ea>\n<20c2>  <50d5>\n<20c3>  <6a38>\n<20c4>  <8b5c>\n<20c5>  <81cd>\n<20c6>  <9f4a>\n<20c7>  <9a0e>\n<20c8>  <8c48>\n<20c9>  <5553>\n<20ca>  <6c23>\n<20cb>  <8a16>\n<20cc>  <727d>\n<20cd>  <91fa>\n<20ce>  <925b>\n<20cf>  <9077>\n<20d0>  <7c3d>\n<20d1>  <8b19>\n<20d2>  <9322>\n<20d3>  <9257>\n<20d4>  <6dfa>\n<20d5>  <8b74>\n<20d6>  <5879>\n<20d7>  <69cd>\n<20d8>  <55c6>\n<20d9>  <58bb>\n<20da>  <8594>\n<20db>  <6436>\n<20dc>  <936c>\n<20dd>  <6a4b>\n<20de>  <55ac>\n<20df>  <50d1>\n<20e0>  <7ff9>\n<20e1>  <7ac5>\n<20e2>  <7aca>\n<20e3>  <6b3d>\n<20e4>  <89aa>\n<20e5>  <5be2>\n<20e6>  <8f15>\n<20e7>  <6c2b>\n<20e8>  <50be>\n<20e9>  <9803>\n<20ea>  <8acb>\n<20eb>  <6176>\n<20ec>  <74ca>\n<20ed>  <7aae>\n<20ee>  <8da8>\n<20ef>  <5340>\n<20f0>  <8ec0>\n<20f1>  <9a45>\n<20f2>  <9f72>\n<20f3>  <9874>\n<20f4>  <6b0a>\n<20f5>  <52f8>\n<20f6>  <9d72>\n<20f7>  <78ba>\n<20f8>  <8b93>\n<20f9>  <9952>\n<20fa>  <64fe>\n<20fb>  <7e5e>\n<20fc>  <71b1>\n<20fd>  <97cc>\n<20fe>  <8a8d>\n<20ff>  <7d09>\n<2100>  <69ae>\n<2101>  <7d68>\n<2102>  <8edf>\n<2103>  <92ed>\n<2104>  <958f>\n<2105>  <6f64>\n<2106>  <7051>\n<2107>  <85a9>\n<2108>  <9c13>\nendbfchar\n\n100 beginbfchar\n<2109>  <8cfd>\n<210a>  <5098>\n<210b>  <55aa>\n<210c>  <9a37>\n<210d>  <6383>\n<210e>  <6f80>\n<210f>  <6bba>\n<2110>  <7d17>\n<2111>  <7be9>\n<2112>  <66ec>\n<2113>  <9583>\n<2114>  <965d>\n<2115>  <8d0d>\n<2116>  <7e55>\n<2117>  <50b7>\n<2118>  <8cde>\n<2119>  <71d2>\n<211a>  <7d39>\n<211b>  <8cd2>\n<211c>  <6368>\n<211d>  <651d>\n<211e>  <61fe>\n<211f>  <8a2d>\n<2120>  <7d33>\n<2121>  <5be9>\n<2122>  <5b38>\n<2123>  <814e>\n<2124>  <6ef2>\n<2125>  <8072>\n<2126>  <7e69>\n<2127>  <52dd>\n<2128>  <8056>\n<2129>  <5e2b>\n<212a>  <7345>\n<212b>  <6fd5>\n<212c>  <8a69>\n<212d>  <6642>\n<212e>  <8755>\n<212f>  <5be6>\n<2130>  <8b58>\n<2131>  <99db>\n<2132>  <52e2>\n<2133>  <9069>\n<2134>  <91cb>\n<2135>  <98fe>\n<2136>  <8996>\n<2137>  <8a66>\n<2138>  <58fd>\n<2139>  <7378>\n<213a>  <6a1e>\n<213b>  <8f38>\n<213c>  <66f8>\n<213d>  <8d16>\n<213e>  <5c6c>\n<213f>  <8853>\n<2140>  <6a39>\n<2141>  <7aea>\n<2142>  <6578>\n<2143>  <5e25>\n<2144>  <96d9>\n<2145>  <8ab0>\n<2146>  <9806>\n<2147>  <8aac>\n<2148>  <78a9>\n<2149>  <720d>\n<214a>  <7d72>\n<214b>  <98fc>\n<214c>  <9b06>\n<214d>  <8073>\n<214e>  <616b>\n<214f>  <980c>\n<2150>  <8a1f>\n<2151>  <8aa6>\n<2152>  <64fb>\n<2153>  <8607>\n<2154>  <8a34>\n<2155>  <8085>\n<2156>  <96d6>\n<2157>  <96a8>\n<2158>  <7d8f>\n<2159>  <6b72>\n<215a>  <5b6b>\n<215b>  <640d>\n<215c>  <7e2e>\n<215d>  <7463>\n<215e>  <9396>\n<215f>  <737a>\n<2160>  <64bb>\n<2161>  <81fa>\n<2162>  <614b>\n<2163>  <6524>\n<2164>  <8caa>\n<2165>  <7671>\n<2166>  <7058>\n<2167>  <58c7>\n<2168>  <8b5a>\n<2169>  <8ac7>\n<216a>  <5606>\n<216b>  <6e6f>\n<216c>  <71d9>\nendbfchar\n\n100 beginbfchar\n<216d>  <6fe4>\n<216e>  <7e27>\n<216f>  <8a0e>\n<2170>  <9a30>\n<2171>  <8b04>\n<2172>  <92bb>\n<2173>  <984c>\n<2174>  <9ad4>\n<2175>  <689d>\n<2176>  <8cbc>\n<2177>  <9435>\n<2178>  <5ef3>\n<2179>  <807d>\n<217a>  <70f4>\n<217b>  <9285>\n<217c>  <7d71>\n<217d>  <982d>\n<217e>  <5716>\n<217f>  <5857>\n<2180>  <5718>\n<2181>  <983d>\n<2182>  <9d15>\n<2183>  <99b1>\n<2184>  <99dd>\n<2185>  <6a62>\n<2186>  <7aaa>\n<2187>  <896a>\n<2188>  <5f4e>\n<2189>  <7063>\n<218a>  <9811>\n<218b>  <842c>\n<218c>  <7db2>\n<218d>  <97cb>\n<218e>  <9055>\n<218f>  <570d>\n<2190>  <7232>\n<2191>  <6ff0>\n<2192>  <7dad>\n<2193>  <8466>\n<2194>  <5049>\n<2195>  <50de>\n<2196>  <7def>\n<2197>  <8b02>\n<2198>  <885b>\n<2199>  <805e>\n<219a>  <7d0b>\n<219b>  <7a69>\n<219c>  <554f>\n<219d>  <64be>\n<219e>  <8778>\n<219f>  <6e26>\n<21a0>  <7aa9>\n<21a1>  <55da>\n<21a2>  <93a2>\n<21a3>  <70cf>\n<21a4>  <8aa3>\n<21a5>  <7121>\n<21a6>  <856a>\n<21a7>  <5862>\n<21a8>  <9727>\n<21a9>  <52d9>\n<21aa>  <8aa4>\n<21ab>  <932b>\n<21ac>  <72a7>\n<21ad>  <8972>\n<21ae>  <7fd2>\n<21af>  <9291>\n<21b0>  <6232>\n<21b1>  <7d30>\n<21b2>  <8766>\n<21b3>  <8f44>\n<21b4>  <5cfd>\n<21b5>  <4fe0>\n<21b6>  <72f9>\n<21b7>  <5687>\n<21b8>  <9341>\n<21b9>  <9bae>\n<21ba>  <7e96>\n<21bb>  <8ce2>\n<21bc>  <929c>\n<21bd>  <9591>\n<21be>  <986f>\n<21bf>  <96aa>\n<21c0>  <73fe>\n<21c1>  <737b>\n<21c2>  <7e23>\n<21c3>  <9921>\n<21c4>  <61b2>\n<21c5>  <7dab>\n<21c6>  <9472>\n<21c7>  <9109>\n<21c8>  <8a73>\n<21c9>  <97ff>\n<21ca>  <9805>\n<21cb>  <856d>\n<21cc>  <56c2>\n<21cd>  <92b7>\n<21ce>  <66c9>\n<21cf>  <562f>\n<21d0>  <5354>\nendbfchar\n\n100 beginbfchar\n<21d1>  <633e>\n<21d2>  <8105>\n<21d3>  <8ae7>\n<21d4>  <5beb>\n<21d5>  <7009>\n<21d6>  <8b1d>\n<21d7>  <92c5>\n<21d8>  <91c1>\n<21d9>  <8208>\n<21da>  <92b9>\n<21db>  <7d89>\n<21dc>  <9808>\n<21dd>  <8a31>\n<21de>  <7dd2>\n<21df>  <7e8c>\n<21e0>  <8ed2>\n<21e1>  <61f8>\n<21e2>  <9078>\n<21e3>  <766c>\n<21e4>  <7d62>\n<21e5>  <5b78>\n<21e6>  <52db>\n<21e7>  <8a62>\n<21e8>  <5c0b>\n<21e9>  <99b4>\n<21ea>  <8a13>\n<21eb>  <8a0a>\n<21ec>  <905c>\n<21ed>  <58d3>\n<21ee>  <9d09>\n<21ef>  <9d28>\n<21f0>  <555e>\n<21f1>  <4e9e>\n<21f2>  <8a1d>\n<21f3>  <95b9>\n<21f4>  <9e7d>\n<21f5>  <56b4>\n<21f6>  <9854>\n<21f7>  <95bb>\n<21f8>  <8277>\n<21f9>  <53ad>\n<21fa>  <786f>\n<21fb>  <8afa>\n<21fc>  <9a57>\n<21fd>  <9d26>\n<21fe>  <694a>\n<21ff>  <63da>\n<2200>  <760d>\n<2201>  <967d>\n<2202>  <7662>\n<2203>  <990a>\n<2204>  <6a23>\n<2205>  <582f>\n<2206>  <8b21>\n<2207>  <85e5>\n<2208>  <723a>\n<2209>  <9801>\n<220a>  <696d>\n<220b>  <8449>\n<220c>  <91ab>\n<220d>  <92a5>\n<220e>  <9824>\n<220f>  <907a>\n<2210>  <5100>\n<2211>  <87fb>\n<2212>  <85dd>\n<2213>  <5104>\n<2214>  <61b6>\n<2215>  <7fa9>\n<2216>  <8a63>\n<2217>  <8b70>\n<2218>  <8abc>\n<2219>  <8b6f>\n<221a>  <7e79>\n<221b>  <852d>\n<221c>  <9670>\n<221d>  <9280>\n<221e>  <98f2>\n<221f>  <96b1>\n<2220>  <6afb>\n<2221>  <5b30>\n<2222>  <9df9>\n<2223>  <61c9>\n<2224>  <7e93>\n<2225>  <7469>\n<2226>  <87a2>\n<2227>  <71df>\n<2228>  <7192>\n<2229>  <8805>\n<222a>  <8d0f>\n<222b>  <7a4e>\n<222c>  <55b2>\n<222d>  <64c1>\n<222e>  <50ad>\n<222f>  <7670>\n<2230>  <8e34>\n<2231>  <512a>\n<2232>  <6182>\n<2233>  <90f5>\n<2234>  <923e>\nendbfchar\n\n100 beginbfchar\n<2235>  <7336>\n<2236>  <8a98>\n<2237>  <8f3f>\n<2238>  <9918>\n<2239>  <9b5a>\n<223a>  <6f01>\n<223b>  <8207>\n<223c>  <5dbc>\n<223d>  <8a9e>\n<223e>  <9b31>\n<223f>  <7344>\n<2240>  <8b7d>\n<2241>  <9810>\n<2242>  <99ad>\n<2243>  <9d1b>\n<2244>  <6df5>\n<2245>  <8f45>\n<2246>  <5712>\n<2247>  <54e1>\n<2248>  <5713>\n<2249>  <7de3>\n<224a>  <9060>\n<224b>  <9858>\n<224c>  <7d04>\n<224d>  <8e8d>\n<224e>  <9470>\n<224f>  <95b2>\n<2250>  <96f2>\n<2251>  <9116>\n<2252>  <9695>\n<2253>  <904b>\n<2254>  <85f4>\n<2255>  <9196>\n<2256>  <6688>\n<2257>  <96dc>\n<2258>  <8f09>\n<2259>  <6522>\n<225a>  <66ab>\n<225b>  <8d0a>\n<225c>  <8d1c>\n<225d>  <81df>\n<225e>  <947f>\n<225f>  <68d7>\n<2260>  <7ac8>\n<2261>  <8cac>\n<2262>  <64c7>\n<2263>  <5247>\n<2264>  <6fa4>\n<2265>  <8cca>\n<2266>  <8d08>\n<2267>  <8ecb>\n<2268>  <9358>\n<2269>  <9598>\n<226a>  <8a50>\n<226b>  <9f4b>\n<226c>  <50b5>\n<226d>  <6c08>\n<226e>  <76de>\n<226f>  <65ac>\n<2270>  <8f3e>\n<2271>  <5d84>\n<2272>  <68e7>\n<2273>  <6230>\n<2274>  <7dbb>\n<2275>  <5f35>\n<2276>  <6f32>\n<2277>  <5e33>\n<2278>  <8cec>\n<2279>  <8139>\n<227a>  <8d99>\n<227b>  <87c4>\n<227c>  <8f4d>\n<227d>  <937a>\n<227e>  <9019>\n<227f>  <8c9e>\n<2280>  <91dd>\n<2281>  <5075>\n<2282>  <8a3a>\n<2283>  <93ae>\n<2284>  <9663>\n<2285>  <5e40>\n<2286>  <7665>\n<2287>  <912d>\n<2288>  <8b49>\n<2289>  <7e54>\n<228a>  <8077>\n<228b>  <57f7>\n<228c>  <8879>\n<228d>  <7d19>\n<228e>  <646f>\n<228f>  <64f2>\n<2290>  <5e5f>\n<2291>  <8cea>\n<2292>  <6eef>\n<2293>  <9418>\n<2294>  <7d42>\n<2295>  <7a2e>\n<2296>  <816b>\n<2297>  <8846>\n<2298>  <8b05>\nendbfchar\n\n100 beginbfchar\n<2299>  <8ef8>\n<229a>  <76ba>\n<229b>  <665d>\n<229c>  <9a5f>\n<229d>  <8af8>\n<229e>  <8a85>\n<229f>  <71ed>\n<22a0>  <77da>\n<22a1>  <56d1>\n<22a2>  <8caf>\n<22a3>  <9444>\n<22a4>  <7bc9>\n<22a5>  <99d0>\n<22a6>  <5c08>\n<22a7>  <78da>\n<22a8>  <8f49>\n<22a9>  <8cfa>\n<22aa>  <6a01>\n<22ab>  <838a>\n<22ac>  <88dd>\n<22ad>  <599d>\n<22ae>  <58ef>\n<22af>  <72c0>\n<22b0>  <9310>\n<22b1>  <8d05>\n<22b2>  <589c>\n<22b3>  <7db4>\n<22b4>  <8ac4>\n<22b5>  <6e96>\n<22b6>  <6fc1>\n<22b7>  <8cc7>\n<22b8>  <6f2c>\n<22b9>  <7d9c>\n<22ba>  <7e3d>\n<22bb>  <7e31>\n<22bc>  <9112>\n<22bd>  <8a5b>\n<22be>  <7d44>\n<22bf>  <947d>\n<22c0>  <55c7>\n<22c1>  <5399>\n<22c2>  <53b4>\n<22c3>  <9768>\n<22c4>  <8d0b>\n<22c5>  <532d>\n<22c6>  <5331>\n<22c7>  <8cfe>\n<22c8>  <5244>\n<22c9>  <528c>\n<22ca>  <5274>\n<22cb>  <50b4>\n<22cc>  <5000>\n<22cd>  <5096>\n<22ce>  <5115>\n<22cf>  <5102>\n<22d0>  <5114>\n<22d1>  <513c>\n<22d2>  <5137>\n<22d3>  <50e8>\n<22d4>  <50c2>\n<22d5>  <513b>\n<22d6>  <5110>\n<22d7>  <513a>\n<22d8>  <50c9>\n<22d9>  <7cf4>\n<22da>  <9ecc>\n<22db>  <56c5>\n<22dc>  <9cec>\n<22dd>  <893b>\n<22de>  <81e0>\n<22df>  <8a01>\n<22e0>  <8a10>\n<22e1>  <8a0c>\n<22e2>  <8a15>\n<22e3>  <8b33>\n<22e4>  <8a4e>\n<22e5>  <8a25>\n<22e6>  <8a41>\n<22e7>  <8a36>\n<22e8>  <8a46>\n<22e9>  <8a54>\n<22ea>  <8a58>\n<22eb>  <8a52>\n<22ec>  <8a86>\n<22ed>  <8a84>\n<22ee>  <8a7f>\n<22ef>  <8a70>\n<22f0>  <8a7c>\n<22f1>  <8a75>\n<22f2>  <8a6c>\n<22f3>  <8a6e>\n<22f4>  <8acd>\n<22f5>  <8ae2>\n<22f6>  <8a61>\n<22f7>  <8a9a>\n<22f8>  <8aa5>\n<22fb>  <8acf>\n<22fc>  <8ad1>\n<22fd>  <8ac9>\n<22fe>  <8adb>\nendbfchar\n\n100 beginbfchar\n<22ff>  <8ad7>\n<2300>  <8ac2>\n<2301>  <8ab6>\n<2302>  <8af6>\n<2303>  <8aeb>\n<2304>  <8b14>\n<2305>  <8b01>\n<2306>  <8ae4>\n<2307>  <8aed>\n<2308>  <8afc>\n<2309>  <8af3>\n<230a>  <8ae6>\n<230b>  <8aee>\n<230c>  <8ade>\n<230d>  <8b28>\n<230e>  <8b9c>\n<230f>  <8b16>\n<2310>  <8b1a>\n<2311>  <8b10>\n<2312>  <8b2b>\n<2313>  <8b2d>\n<2314>  <8b56>\n<2315>  <8b59>\n<2316>  <8b4e>\n<2317>  <8b9e>\n<2318>  <8b6b>\n<2319>  <8b96>\n<231a>  <9658>\n<231b>  <913a>\n<231c>  <9114>\n<231d>  <9134>\n<231e>  <90df>\n<231f>  <9136>\n<2320>  <9106>\n<2321>  <9148>\n<2322>  <82bb>\n<2323>  <52f1>\n<2324>  <5df0>\n<2325>  <580a>\n<2326>  <58d9>\n<2327>  <58e2>\n<2328>  <58e0>\n<2329>  <58da>\n<232a>  <57e1>\n<232b>  <584f>\n<232c>  <5816>\n<232d>  <5852>\n<232e>  <581d>\n<232f>  <5864>\n<2330>  <858c>\n<2331>  <8553>\n<2332>  <85f6>\n<2333>  <83a7>\n<2334>  <8407>\n<2335>  <84ef>\n<2336>  <82e7>\n<2337>  <8622>\n<2338>  <8526>\n<2339>  <584b>\n<233a>  <7162>\n<233b>  <8558>\n<233c>  <84fd>\n<233d>  <854e>\n<233e>  <8588>\n<233f>  <85ba>\n<2340>  <7296>\n<2341>  <6ece>\n<2342>  <8541>\n<2343>  <85ce>\n<2344>  <8552>\n<2345>  <84c0>\n<2346>  <8452>\n<2347>  <8464>\n<2348>  <8494>\n<2349>  <8435>\n<234a>  <859f>\n<234b>  <8555>\n<234c>  <9daf>\n<234d>  <8493>\n<234e>  <7e08>\n<234f>  <8546>\n<2350>  <8562>\n<2351>  <851e>\n<2352>  <9a40>\n<2353>  <863a>\n<2354>  <93a3>\n<2355>  <8577>\n<2356>  <861e>\n<2357>  <85fa>\n<2358>  <8604>\n<2359>  <85ea>\n<235a>  <861a>\n<235b>  <5969>\n<235c>  <5c37>\n<235d>  <636b>\n<235e>  <6476>\n<235f>  <649f>\n<2360>  <6451>\n<2361>  <645c>\n<2362>  <64b3>\nendbfchar\n\n100 beginbfchar\n<2363>  <6504>\n<2364>  <6516>\n<2365>  <64f7>\n<2366>  <64fc>\n<2367>  <651b>\n<2368>  <5630>\n<2369>  <5638>\n<236a>  <56c8>\n<236b>  <56a6>\n<236c>  <5504>\n<236d>  <54bc>\n<236e>  <5680>\n<236f>  <565d>\n<2370>  <5660>\n<2371>  <5635>\n<2372>  <55f6>\n<2373>  <5666>\n<2374>  <5672>\n<2375>  <568c>\n<2376>  <5665>\n<2377>  <561c>\n<2378>  <562e>\n<2379>  <55e9>\n<237a>  <5616>\n<237b>  <56c0>\n<237c>  <560d>\n<237d>  <56b3>\n<237e>  <56c1>\n<237f>  <566f>\n<2380>  <8f61>\n<2381>  <56b6>\n<2382>  <5695>\n<2383>  <5707>\n<2384>  <5e43>\n<2385>  <5e6c>\n<2386>  <5e58>\n<2387>  <5e57>\n<2388>  <5d87>\n<2389>  <5cf4>\n<238a>  <5d50>\n<238b>  <5d2c>\n<238c>  <5da7>\n<238d>  <5da0>\n<238e>  <5d97>\n<238f>  <5d0d>\n<2390>  <5db8>\n<2391>  <5d81>\n<2392>  <5dd4>\n<2393>  <5fa0>\n<2394>  <7377>\n<2395>  <7341>\n<2396>  <736a>\n<2397>  <733b>\n<2398>  <736b>\n<2399>  <7380>\n<239a>  <737c>\n<239b>  <98e0>\n<239c>  <9933>\n<239d>  <98e9>\n<239e>  <993c>\n<23a1>  <98ed>\n<23a2>  <98f4>\n<23a3>  <9909>\n<23a4>  <9911>\n<23a5>  <991b>\n<23a6>  <9937>\n<23a7>  <993f>\n<23a8>  <9943>\n<23ac>  <994c>\n<23ad>  <9962>\n<23ae>  <5ee1>\n<23af>  <8ce1>\n<23b0>  <61fa>\n<23b1>  <61ae>\n<23b2>  <616a>\n<23b3>  <613e>\n<23b4>  <60b5>\n<23b5>  <6134>\n<23b6>  <61cc>\n<23b7>  <615f>\n<23b8>  <61e8>\n<23b9>  <60fb>\n<23ba>  <6137>\n<23bb>  <60f2>\n<23bc>  <6173>\n<23bd>  <611c>\n<23be>  <6192>\n<23bf>  <9582>\n<23c0>  <9586>\n<23c1>  <95c8>\n<23c2>  <958e>\n<23c3>  <9594>\n<23c4>  <958c>\n<23c5>  <95e5>\n<23c6>  <95ad>\n<23c7>  <95ab>\n<23c8>  <9b2e>\n<23c9>  <95ac>\n<23ca>  <95be>\n<23cb>  <95b6>\nendbfchar\n\n100 beginbfchar\n<23cc>  <9b29>\n<23cd>  <95bf>\n<23ce>  <95bd>\n<23cf>  <95bc>\n<23d0>  <95c3>\n<23d1>  <95cb>\n<23d2>  <95d4>\n<23d3>  <95d0>\n<23d4>  <95d5>\n<23d5>  <95de>\n<23d6>  <7043>\n<23d7>  <6f59>\n<23d8>  <7027>\n<23d9>  <7018>\n<23da>  <6ffc>\n<23db>  <6d87>\n<23dc>  <6d79>\n<23dd>  <6e5e>\n<23de>  <6fae>\n<23df>  <700f>\n<23e0>  <6ef8>\n<23e1>  <6f6f>\n<23e2>  <6df6>\n<23e3>  <6f7f>\n<23e4>  <7006>\n<23e5>  <6fa0>\n<23e6>  <700b>\n<23e7>  <7067>\n<23e8>  <7044>\n<23e9>  <7005>\n<23ea>  <6f77>\n<23eb>  <7020>\n<23ec>  <701f>\n<23ed>  <7032>\n<23ee>  <7028>\n<23ef>  <705d>\n<23f0>  <9a2b>\n<23f1>  <9087>\n<23f2>  <9015>\n<23f3>  <9090>\n<23f4>  <5c68>\n<23f5>  <5f33>\n<23f6>  <5af5>\n<23f7>  <5ad7>\n<23f8>  <5b00>\n<23f9>  <5a6d>\n<23fa>  <5b08>\n<23fb>  <5b4c>\n<23fc>  <5aa7>\n<23fd>  <5afb>\n<23fe>  <5b0b>\n<23ff>  <5b21>\n<2400>  <5b2a>\n<2401>  <5b19>\n<2402>  <99d4>\n<2403>  <99df>\n<2404>  <99d9>\n<2405>  <9a36>\n<2406>  <9a5b>\n<2407>  <99d1>\n<2408>  <99d8>\n<2409>  <9a4d>\n<240a>  <9a4a>\n<240b>  <99e2>\n<240c>  <9a6a>\n<240d>  <9a0f>\n<240e>  <9a0d>\n<240f>  <9a05>\n<2410>  <9a42>\n<2411>  <9a2d>\n<2412>  <9a16>\n<2413>  <9a41>\n<2414>  <9a2e>\n<2415>  <9a38>\n<2418>  <9a4f>\n<2419>  <9a65>\n<241a>  <9a64>\n<241b>  <7cf9>\n<241c>  <7d06>\n<241d>  <7d02>\n<2420>  <7e8a>\n<2421>  <7d1c>\n<2422>  <7d15>\n<2423>  <7d13>\n<2424>  <7d3a>\n<2425>  <7d32>\n<2426>  <7d31>\n<2427>  <7e10>\n<2428>  <7d3c>\n<2429>  <7d40>\n<242a>  <7d3f>\n<242b>  <7d5d>\n<242c>  <7d4e>\n<242d>  <7d73>\n<242e>  <7d86>\n<242f>  <7d83>\n<2430>  <7d88>\n<2431>  <7dbe>\n<2432>  <7dba>\n<2433>  <7dcb>\nendbfchar\n\n100 beginbfchar\n<2434>  <7dd4>\n<2435>  <7dc4>\n<2436>  <7d9e>\n<2437>  <7dac>\n<2438>  <7db9>\n<2439>  <7da3>\n<243a>  <7db0>\n<243b>  <7dc7>\n<243c>  <7dd9>\n<243d>  <7dd7>\n<243e>  <7df9>\n<243f>  <7df2>\n<2440>  <7e62>\n<2441>  <7de6>\n<2442>  <7df6>\n<2443>  <7df1>\n<2444>  <7e0b>\n<2445>  <7de1>\n<2446>  <7e09>\n<2447>  <7e1d>\n<2448>  <7e1f>\n<2449>  <7e1e>\n<244a>  <7e2d>\n<244b>  <7e0a>\n<244c>  <7e11>\n<244d>  <7e7d>\n<244e>  <7e39>\n<244f>  <7e35>\n<2450>  <7e32>\n<2451>  <7e46>\n<2452>  <7e45>\n<2453>  <7e88>\n<2454>  <7e5a>\n<2455>  <7e52>\n<2456>  <7e6e>\n<2457>  <7e7e>\n<2458>  <7e70>\n<2459>  <7e6f>\n<245a>  <7e98>\n<245b>  <74a3>\n<245c>  <744b>\n<245d>  <74cf>\n<245e>  <980a>\n<245f>  <74bd>\n<2460>  <743f>\n<2461>  <7489>\n<2462>  <74a6>\n<2463>  <74d4>\n<2464>  <74da>\n<2465>  <97d9>\n<2466>  <97de>\n<2467>  <97dc>\n<2468>  <69aa>\n<2469>  <6aea>\n<246a>  <6898>\n<246b>  <68d6>\n<246c>  <6a05>\n<246d>  <689f>\n<246e>  <6adb>\n<246f>  <6af3>\n<2470>  <6ae8>\n<2471>  <6adf>\n<2472>  <6a89>\n<2473>  <690f>\n<2474>  <6a48>\n<2475>  <6968>\n<2476>  <69bf>\n<2477>  <6a3a>\n<2478>  <6a9c>\n<2479>  <6b12>\n<247a>  <6b1e>\n<247b>  <6add>\n<247c>  <69e7>\n<247d>  <6b0f>\n<247e>  <6b16>\n<247f>  <6aec>\n<2480>  <6ada>\n<2481>  <6af8>\n<2482>  <6ab3>\n<2483>  <6ae7>\n<2484>  <6aa3>\n<2485>  <6ad3>\n<2486>  <6ade>\n<2487>  <6ba4>\n<2488>  <6b9e>\n<2489>  <6bae>\n<248a>  <6bab>\n<248b>  <6baf>\n<248c>  <8ed4>\n<248d>  <8edb>\n<248e>  <8ef2>\n<248f>  <8efb>\n<2490>  <8f64>\n<2491>  <8ef9>\n<2492>  <8efc>\n<2493>  <8eeb>\n<2494>  <8ee4>\n<2495>  <8f62>\n<2496>  <8efa>\n<2497>  <8efe>\nendbfchar\n\n100 beginbfchar\n<2498>  <8f0a>\n<2499>  <8f07>\n<249a>  <8f05>\n<249b>  <8f12>\n<249c>  <8f26>\n<249f>  <8f1c>\n<24a0>  <8f33>\n<24a1>  <8f46>\n<24a2>  <8f54>\n<24a3>  <6214>\n<24a4>  <6227>\n<24a5>  <750c>\n<24a6>  <66c7>\n<24a7>  <66c4>\n<24a8>  <6689>\n<24a9>  <66d6>\n<24aa>  <8cc1>\n<24ab>  <8cb0>\n<24ac>  <8cba>\n<24ad>  <8cbd>\n<24ae>  <8d04>\n<24af>  <8cb2>\n<24b0>  <8cc5>\n<24b1>  <8d10>\n<24b2>  <8cd1>\n<24b3>  <8cda>\n<24b4>  <8cd5>\n<24b5>  <8ceb>\n<24b6>  <8ce7>\n<24b7>  <8cfb>\n<24b8>  <8998>\n<24b9>  <89ac>\n<24ba>  <89a1>\n<24bb>  <89bf>\n<24bc>  <89a6>\n<24bd>  <89af>\n<24be>  <89b2>\n<24bf>  <89b7>\n<24c0>  <6bff>\n<24c1>  <6c0c>\n<24c2>  <6c2c>\n<24c3>  <7258>\n<24c4>  <6727>\n<24c5>  <8156>\n<24c6>  <81da>\n<24c7>  <811b>\n<24c8>  <81be>\n<24c9>  <8161>\n<24ca>  <81cf>\n<24cb>  <6b5f>\n<24ce>  <98b6>\n<24cf>  <98bc>\n<24d0>  <98c6>\n<24d1>  <98c8>\n<24d2>  <8f42>\n<24d3>  <9f4f>\n<24d4>  <6595>\n<24d5>  <716c>\n<24d6>  <7152>\n<24d7>  <7197>\n<24d8>  <71c1>\n<24d9>  <71dc>\n<24da>  <71fe>\n<24db>  <79b0>\n<24dc>  <798e>\n<24dd>  <79aa>\n<24de>  <61df>\n<24df>  <6164>\n<24e0>  <61e3>\n<24e1>  <6207>\n<24e2>  <6fa9>\n<24e3>  <78ef>\n<24e4>  <78ad>\n<24e5>  <7868>\n<24e6>  <78b8>\n<24e7>  <792a>\n<24e8>  <7931>\n<24e9>  <7864>\n<24ea>  <78fd>\n<24eb>  <78e7>\n<24ec>  <78e3>\n<24ed>  <9f95>\n<24ee>  <7798>\n<24ef>  <775e>\n<24f0>  <77bc>\n<24f1>  <7f86>\n<24f2>  <7f88>\n<24f6>  <91d9>\n<24f7>  <91d7>\n<24f8>  <91d5>\n<24f9>  <91f7>\n<24fa>  <91e7>\n<24fb>  <91e4>\n<24fc>  <9346>\n<24fd>  <91f5>\n<24fe>  <91f9>\n<24ff>  <9208>\n<2500>  <9226>\n<2501>  <9245>\n<2502>  <9211>\nendbfchar\n\n100 beginbfchar\n<2503>  <9210>\n<2504>  <9201>\n<2505>  <9227>\n<2506>  <9204>\n<2507>  <9225>\n<2508>  <9200>\n<2509>  <923a>\n<250a>  <9266>\n<250b>  <9237>\n<250c>  <9233>\n<250d>  <9255>\n<250e>  <923d>\n<250f>  <9238>\n<2510>  <925e>\n<2513>  <923f>\n<2514>  <9460>\n<2515>  <9230>\n<2516>  <9249>\n<2517>  <9248>\n<2518>  <924d>\n<2519>  <922e>\n<251a>  <9239>\n<251b>  <9438>\n<251c>  <92ac>\n<251d>  <92a0>\n<251e>  <927a>\n<251f>  <92aa>\n<2520>  <92ee>\n<2521>  <92cf>\n<2522>  <9403>\n<2523>  <92e3>\n<2524>  <943a>\n<2525>  <92b1>\n<2526>  <92a6>\n<2527>  <93a7>\n<2528>  <9296>\n<2529>  <92cc>\n<252a>  <92a9>\n<252b>  <93f5>\n<252c>  <9293>\n<252d>  <927f>\n<252e>  <93a9>\n<252f>  <929a>\n<2530>  <931a>\n<2531>  <92ab>\n<2532>  <9283>\n<2533>  <940b>\n<2534>  <92a8>\n<2535>  <92a3>\n<2536>  <9412>\n<2537>  <9338>\n<2538>  <92f1>\n<2539>  <93d7>\n<253a>  <92e5>\n<253b>  <92f0>\n<253c>  <92ef>\n<253d>  <92e8>\n<253e>  <92bc>\n<253f>  <92dd>\n<2540>  <92f6>\n<2543>  <92c3>\n<2544>  <92df>\n<2545>  <92e6>\n<2546>  <9312>\n<2547>  <9306>\n<2548>  <9369>\n<2549>  <931b>\n<254a>  <9340>\n<254b>  <9301>\n<254c>  <9315>\n<254d>  <932e>\n<254e>  <9343>\n<2551>  <931f>\n<2552>  <9319>\n<2553>  <9365>\n<2554>  <9347>\n<2555>  <9376>\n<2556>  <9354>\n<2557>  <9364>\n<2558>  <93aa>\n<2559>  <9370>\n<255a>  <9384>\n<255b>  <93e4>\n<255c>  <93d8>\n<255d>  <9428>\n<255e>  <9387>\n<255f>  <93cc>\n<2560>  <9398>\n<2561>  <93b8>\n<2562>  <93bf>\n<2563>  <93a6>\n<2564>  <93b0>\n<2565>  <93b5>\n<2566>  <944c>\n<2567>  <93e2>\n<256a>  <93cd>\n<256b>  <93de>\n<256c>  <93c3>\n<256d>  <93c7>\n<256e>  <93d1>\nendbfchar\n\n100 beginbfchar\n<256f>  <9414>\n<2570>  <941d>\n<2571>  <93f7>\n<2572>  <9465>\n<2573>  <9413>\n<2574>  <946d>\n<2575>  <9420>\n<2576>  <9479>\n<2577>  <93f9>\n<2578>  <9419>\n<2579>  <944a>\n<257a>  <9432>\n<257b>  <943f>\n<257c>  <9454>\n<257d>  <9463>\n<257e>  <937e>\n<257f>  <7a61>\n<2580>  <9ce9>\n<2581>  <9cf6>\n<2582>  <9d07>\n<2583>  <9d06>\n<2584>  <9d23>\n<2585>  <9d87>\n<2586>  <9e15>\n<2587>  <9d1d>\n<2588>  <9d1f>\n<2589>  <9de5>\n<258a>  <9d2f>\n<258b>  <9dd9>\n<258c>  <9d30>\n<258d>  <9d42>\n<258e>  <9e1e>\n<258f>  <9d53>\n<2590>  <9e1d>\n<2591>  <9d60>\n<2592>  <9d52>\n<2593>  <9df3>\n<2594>  <9d5c>\n<2595>  <9d61>\n<2596>  <9d93>\n<2597>  <9d6a>\n<2598>  <9d6f>\n<2599>  <9d89>\n<259a>  <9d98>\n<259b>  <9d9a>\n<259c>  <9dc0>\n<259d>  <9da5>\n<259e>  <9da9>\n<259f>  <9dc2>\n<25a0>  <9dbc>\n<25a1>  <9e1a>\n<25a2>  <9dd3>\n<25a3>  <9dda>\n<25a4>  <9def>\n<25a5>  <9de6>\n<25a6>  <9df2>\n<25a7>  <9df8>\n<25a8>  <9e0c>\n<25a9>  <9dfa>\n<25aa>  <9e1b>\n<25ab>  <7664>\n<25ac>  <7658>\n<25ad>  <7667>\n<25ae>  <7602>\n<25b1>  <7649>\n<25b2>  <761e>\n<25b3>  <763b>\n<25b6>  <7669>\n<25b7>  <7672>\n<25b8>  <7ac7>\n<25b9>  <7ab6>\n<25ba>  <8960>\n<25bb>  <8933>\n<25bc>  <895d>\n<25bd>  <8947>\n<25be>  <8938>\n<25bf>  <8964>\n<25c0>  <76b8>\n<25c1>  <802e>\n<25c2>  <802c>\n<25c3>  <8079>\n<25c4>  <8075>\n<25c5>  <9807>\n<25c8>  <9821>\n<25c9>  <981c>\n<25ca>  <6f41>\n<25cb>  <9826>\n<25cc>  <9837>\n<25cd>  <984e>\n<25ce>  <9853>\n<25cf>  <9873>\n<25d0>  <9862>\n<25d1>  <9859>\n<25d2>  <9865>\n<25d3>  <986c>\n<25d4>  <9870>\n<25d5>  <87e3>\n<25d6>  <8806>\n<25d7>  <8706>\n<25d8>  <8823>\nendbfchar\n\n100 beginbfchar\n<25d9>  <87f6>\n<25da>  <86fa>\n<25db>  <87ef>\n<25dc>  <8784>\n<25dd>  <8810>\n<25de>  <87c8>\n<25df>  <8811>\n<25e0>  <87bb>\n<25e1>  <87ce>\n<25e2>  <7f4c>\n<25e3>  <7be4>\n<25e4>  <7b67>\n<25e5>  <7c69>\n<25e6>  <7bf3>\n<25e7>  <7c00>\n<25e8>  <7bcb>\n<25e9>  <7c5c>\n<25ea>  <7c1e>\n<25eb>  <7c2b>\n<25ec>  <7c23>\n<25ed>  <7c6a>\n<25ee>  <7c5f>\n<25ef>  <8264>\n<25f0>  <826b>\n<25f1>  <88ca>\n<25f2>  <7fa5>\n<25f3>  <7cf2>\n<25f4>  <7cf6>\n<25f5>  <7cdd>\n<25f6>  <7e36>\n<25f7>  <9ea9>\n<25f8>  <8db2>\n<25f9>  <91c5>\n<25fa>  <91c3>\n<25fb>  <9e7a>\n<25fc>  <8e89>\n<25fd>  <8e4c>\n<25fe>  <8e92>\n<25ff>  <8e7a>\n<2600>  <8e55>\n<2601>  <8e9a>\n<2602>  <8e8b>\n<2603>  <8e93>\n<2604>  <8e91>\n<2605>  <8ea1>\n<2606>  <8e63>\n<2607>  <8eaa>\n<2608>  <8ea6>\n<2609>  <89f4>\n<260a>  <89f6>\n<260b>  <975a>\n<260c>  <9742>\n<260d>  <973d>\n<260e>  <9744>\n<260f>  <9f54>\n<2610>  <9f5f>\n<2611>  <9f59>\n<2612>  <9f60>\n<2613>  <9f5c>\n<2614>  <9f66>\n<2615>  <9f6c>\n<2616>  <9f6a>\n<2617>  <9f77>\n<2618>  <9efd>\n<2619>  <9eff>\n<261a>  <9f09>\n<261b>  <8b8e>\n<261c>  <947e>\n<261d>  <93e8>\n<261e>  <9b77>\n<261f>  <9b74>\n<2620>  <9b81>\n<2621>  <9b83>\n<2622>  <9b8e>\n<2623>  <9c78>\n<2624>  <7a4c>\n<2625>  <9b92>\n<2626>  <9c5f>\n<2627>  <9b90>\n<2628>  <9bad>\n<2629>  <9b9a>\n<262a>  <9baa>\n<262b>  <9b9e>\n<262c>  <9c6d>\n<262d>  <9bab>\n<262e>  <9b9d>\n<262f>  <9c58>\n<2630>  <9bc1>\n<2631>  <9c7a>\n<2632>  <9c31>\n<2633>  <9c39>\n<2634>  <9c23>\n<2635>  <9c37>\n<2636>  <9bc0>\n<2637>  <9bca>\n<2638>  <9bc7>\n<2639>  <9bfd>\n<263a>  <9bd6>\n<263d>  <9be1>\n<263e>  <9be4>\nendbfchar\n\n100 beginbfchar\n<263f>  <9be7>\n<2640>  <9bdd>\n<2641>  <9be2>\n<2642>  <9bf0>\n<2643>  <9bdb>\n<2644>  <9bf4>\n<2645>  <9bd4>\n<2646>  <9c5d>\n<2647>  <9c08>\n<2648>  <9c10>\n<2649>  <9c0d>\n<264a>  <9c12>\n<264b>  <9c09>\n<264c>  <9bff>\n<264d>  <9c20>\n<264e>  <9c32>\n<264f>  <9c2d>\n<2650>  <9c28>\n<2651>  <9c25>\n<2652>  <9c29>\n<2653>  <9c33>\n<2654>  <9c3e>\n<2655>  <9c48>\n<2656>  <9c3b>\n<2657>  <9c35>\n<2658>  <9c45>\n<2659>  <9c56>\n<265a>  <9c54>\n<265b>  <9c52>\n<265c>  <9c67>\n<265d>  <97c3>\n<265e>  <97bd>\n<265f>  <97c9>\n<2660>  <9dbb>\n<2661>  <9acf>\n<2662>  <9ad6>\n<2663>  <9ad5>\n<2664>  <9b58>\n<2665>  <9b4e>\n<2666>  <9957>\n<2667>  <995c>\n<2668>  <9b22>\n<2669>  <9ef7>\n<266a>  <9ef2>\n<266b>  <896c>\n<266c>  <95c6>\n<266d>  <9336>\n<266e>  <5f46>\n<266f>  <8514>\n<2670>  <7e94>\n<2671>  <9f63>\n<2672>  <5679>\n<2673>  <9f15>\n<2674>  <5641>\n<2675>  <9aee>\n<2676>  <8907>\n<2677>  <7a40>\n<2678>  <98b3>\n<2679>  <95a4>\n<267a>  <9b0d>\n<267b>  <8ff4>\n<267c>  <5f59>\n<267d>  <7a6b>\n<267e>  <98e2>\n<267f>  <50a2>\n<2680>  <8591>\n<2681>  <5118>\n<2682>  <6372>\n<2683>  <524b>\n<2684>  <774f>\n<2685>  <7e8d>\n<2686>  <66c6>\n<2687>  <77ad>\n<2688>  <9e75>\n<2689>  <56c9>\n<268a>  <9ef4>\n<268b>  <6fdb>\n<268c>  <61de>\n<268d>  <77c7>\n<268e>  <7030>\n<268f>  <9eb5>\n<2690>  <884a>\n<2691>  <95e2>\n<2692>  <97c6>\n<2693>  <7c64>\n<2694>  <7e34>\n<2695>  <97a6>\n<2696>  <9eaf>\n<2697>  <56cc>\n<2698>  <98b1>\n<2699>  <6aaf>\n<269a>  <7f4e>\n<269b>  <7cf0>\n<269c>  <4fc2>\n<269d>  <7e6b>\n<269e>  <9e79>\n<269f>  <56ae>\n<26a0>  <9b1a>\n<26a1>  <846f>\n<26a2>  <79a6>\nendbfchar\n\n100 beginbfchar\n<26a3>  <7c72>\n<26a4>  <9ad2>\n<26a5>  <96bb>\n<26a6>  <7dfb>\n<26a7>  <88fd>\n<26a8>  <7843>\n<26b5>  <02d9>\n<26b6>  <2013>\n<26b7>  <2015>\n<26b8>  <2025>\n<26b9>  <2035>\n<26ba>  <2105>\n<26bb>  <2109>\n<26c0>  <2215>\n<26c1>  <221f>\n<26c2>  <2223>\n<26c3>  <2252>\n<26c6>  <22bf>\n<26ff>  <25e2>\n<2703>  <2609>\n<2704>  <2295>\n<2705>  <3012>\n<2711>  <32a3>\n<2717>  <33a1>\n<2718>  <33c4>\n<2719>  <33ce>\n<271c>  <33d5>\n<271d>  <fe30>\n<271e>  <ffe2>\n<271f>  <ffe4>\n<2720>  <2121>\n<2721>  <3231>\n<2722>  <2010>\n<2723>  <30fc>\n<2728>  <3006>\n<274b>  <303e>\n<2758>  <4e02>\n<275c>  <4e0f>\n<275d>  <4e12>\n<275e>  <4e17>\n<2762>  <4e23>\n<2763>  <4e26>\n<2764>  <4e29>\n<2767>  <4e31>\n<2768>  <4e33>\n<2769>  <4e35>\n<276a>  <4e37>\n<276b>  <4e3c>\n<276f>  <4e44>\n<2770>  <4e46>\n<2771>  <4e4a>\n<2772>  <4e51>\n<2773>  <4e55>\n<2774>  <4e57>\n<2783>  <4e72>\n<2794>  <4e87>\n<2795>  <4e8a>\n<2796>  <4e90>\n<2799>  <4e99>\n<279c>  <4ea3>\n<279d>  <4eaa>\n<27a1>  <4eb4>\n<27a9>  <4ec8>\n<27aa>  <4ecc>\n<27ad>  <4ed2>\n<27b1>  <4ee0>\n<27b2>  <4ee2>\n<27b5>  <4ee9>\n<27b9>  <4ef1>\n<27ba>  <4ef4>\n<27be>  <4efc>\n<27bf>  <4efe>\n<27c0>  <4f00>\n<27d1>  <4f21>\n<27d2>  <4f23>\n<27d8>  <4f31>\n<27d9>  <4f33>\n<27da>  <4f35>\n<27db>  <4f37>\n<27dc>  <4f39>\n<27dd>  <4f3b>\n<27eb>  <4f52>\n<27ec>  <4f54>\n<27ed>  <4f56>\n<27f0>  <4f66>\n<27f1>  <4f68>\n<27f8>  <4f75>\n<27fd>  <4f7d>\n<2800>  <4f82>\n<2801>  <4f85>\n<2802>  <4f87>\n<2803>  <4f8a>\n<2804>  <4f8c>\n<2805>  <4f8e>\n<2806>  <4f90>\n<2809>  <4f95>\n<280d>  <4f9c>\n<2812>  <4fa4>\n<2813>  <4fab>\n<2814>  <4fad>\nendbfchar\n\n100 beginbfchar\n<2831>  <4fd9>\n<2832>  <4fdb>\n<2833>  <4fe2>\n<2836>  <4fe7>\n<2839>  <4ff0>\n<283a>  <4ff2>\n<283f>  <4ff9>\n<2843>  <4fff>\n<284b>  <500a>\n<284c>  <500e>\n<284d>  <5010>\n<284e>  <5013>\n<2852>  <501b>\n<2855>  <5020>\n<2859>  <5027>\n<2865>  <503b>\n<2866>  <503d>\n<2870>  <504d>\n<287a>  <505b>\n<28a7>  <5097>\n<28b0>  <50a4>\n<28b1>  <50a6>\n<28b8>  <50b6>\n<28ca>  <50d0>\n<28e1>  <50f4>\n<28e5>  <50fa>\n<28ea>  <5101>\n<28eb>  <5103>\n<28ec>  <5105>\n<28ed>  <510a>\n<28f2>  <5111>\n<28f3>  <5113>\n<28fc>  <5120>\n<2914>  <5142>\n<2915>  <5147>\n<2916>  <514a>\n<2917>  <514c>\n<291b>  <5153>\n<291f>  <515b>\n<2929>  <516a>\n<292a>  <516f>\n<292b>  <5172>\n<292c>  <517a>\n<293b>  <5198>\n<293c>  <519a>\n<2940>  <51a1>\n<2941>  <51a3>\n<2949>  <51b4>\n<2952>  <51c5>\n<2953>  <51c8>\n<2954>  <51ca>\n<2955>  <51ce>\n<2956>  <51d0>\n<2960>  <51dc>\n<296b>  <51ec>\n<296c>  <51ee>\n<296d>  <51f2>\n<296e>  <51f4>\n<296f>  <51f7>\n<2970>  <51fe>\n<2973>  <5209>\n<297b>  <521c>\n<2984>  <522a>\n<2985>  <522c>\n<2986>  <522f>\n<298b>  <523c>\n<298c>  <523e>\n<2995>  <5255>\n<299a>  <525d>\n<29a0>  <5266>\n<29a1>  <5268>\n<29a7>  <5273>\n<29af>  <527e>\n<29b0>  <5280>\n<29b4>  <528b>\n<29b7>  <5292>\n<29bf>  <529c>\n<29d1>  <52c0>\n<29d2>  <52c2>\n<29d6>  <52c8>\n<29d7>  <52ca>\n<29dc>  <52d1>\n<29df>  <52d7>\n<29e0>  <52da>\n<29e1>  <52dc>\n<29e4>  <52e3>\n<29fc>  <5307>\n<2a00>  <530c>\n<2a01>  <530e>\n<2a06>  <5318>\n<2a0b>  <5322>\n<2a13>  <5330>\n<2a1d>  <5342>\n<2a1e>  <5344>\n<2a1f>  <5346>\n<2a23>  <5350>\n<2a26>  <535b>\n<2a27>  <535d>\n<2a28>  <5365>\n<2a29>  <5368>\nendbfchar\n\n100 beginbfchar\n<2a2a>  <536a>\n<2a2d>  <5372>\n<2a2e>  <5376>\n<2a2f>  <5379>\n<2a36>  <5383>\n<2a39>  <538a>\n<2a45>  <539e>\n<2a46>  <53a1>\n<2a47>  <53a4>\n<2a48>  <53a7>\n<2a4f>  <53b3>\n<2a50>  <53b5>\n<2a58>  <53c0>\n<2a62>  <53d5>\n<2a63>  <53da>\n<2a67>  <53e1>\n<2a68>  <53e7>\n<2a69>  <53f4>\n<2a6a>  <53fa>\n<2a6e>  <5402>\n<2a6f>  <5405>\n<2a70>  <5407>\n<2a71>  <540b>\n<2a72>  <5414>\n<2a76>  <541c>\n<2a77>  <5422>\n<2a7a>  <542a>\n<2a7b>  <5430>\n<2a7c>  <5433>\n<2a7f>  <543a>\n<2a80>  <543d>\n<2a81>  <543f>\n<2a86>  <5447>\n<2a87>  <5449>\n<2a8c>  <5451>\n<2a8d>  <545a>\n<2a93>  <5463>\n<2a94>  <5465>\n<2a95>  <5467>\n<2a9e>  <5474>\n<2aa3>  <5481>\n<2aa4>  <5483>\n<2aa5>  <5485>\n<2aaa>  <548d>\n<2aab>  <5491>\n<2aac>  <5493>\n<2aaf>  <549c>\n<2ab5>  <54a5>\n<2ab6>  <54ae>\n<2ab7>  <54b0>\n<2ab8>  <54b2>\n<2abe>  <54be>\n<2abf>  <54c3>\n<2ac0>  <54c5>\n<2ac3>  <54d6>\n<2ac4>  <54d8>\n<2ac5>  <54db>\n<2ac6>  <54e0>\n<2ad5>  <54fb>\n<2ad6>  <54fe>\n<2ad7>  <5500>\n<2ada>  <5505>\n<2adb>  <5508>\n<2aed>  <5521>\n<2af2>  <552b>\n<2af3>  <552d>\n<2af4>  <5532>\n<2afc>  <553d>\n<2afd>  <5540>\n<2afe>  <5542>\n<2aff>  <5545>\n<2b08>  <5554>\n<2b0e>  <555d>\n<2b15>  <556b>\n<2b1e>  <557d>\n<2b1f>  <557f>\n<2b25>  <5590>\n<2b2d>  <559e>\n<2b37>  <55ab>\n<2b38>  <55ad>\n<2b3b>  <55b4>\n<2b3c>  <55b6>\n<2b3d>  <55b8>\n<2b3e>  <55ba>\n<2b3f>  <55bc>\n<2b45>  <55c8>\n<2b4a>  <55d5>\n<2b4e>  <55db>\n<2b4f>  <55de>\n<2b50>  <55e0>\n<2b51>  <55e2>\n<2b52>  <55e7>\n<2b57>  <55f4>\n<2b5d>  <55ff>\n<2b62>  <5607>\n<2b69>  <5615>\n<2b6c>  <561d>\n<2b72>  <5628>\n<2b75>  <5633>\n<2b76>  <5637>\nendbfchar\n\n100 beginbfchar\n<2b77>  <563a>\n<2b7b>  <5640>\n<2b91>  <5661>\n<2b92>  <5663>\n<2b93>  <5667>\n<2b96>  <5670>\n<2b97>  <5673>\n<2b98>  <5675>\n<2b99>  <5677>\n<2b9a>  <567a>\n<2ba6>  <568d>\n<2baa>  <5694>\n<2bb9>  <56a7>\n<2bc2>  <56b5>\n<2bce>  <56cb>\n<2bd9>  <56dc>\n<2bda>  <56e3>\n<2be1>  <56ec>\n<2bee>  <5705>\n<2bef>  <570c>\n<2bf6>  <5717>\n<2bff>  <5724>\n<2c03>  <572b>\n<2c0d>  <573f>\n<2c0e>  <5741>\n<2c15>  <574b>\n<2c1f>  <5765>\n<2c20>  <5767>\n<2c21>  <576c>\n<2c22>  <576e>\n<2c44>  <57a5>\n<2c45>  <57a8>\n<2c46>  <57aa>\n<2c47>  <57ac>\n<2c4b>  <57b3>\n<2c63>  <57d3>\n<2c68>  <57de>\n<2c73>  <57ee>\n<2c7e>  <5801>\n<2c83>  <580c>\n<2c8f>  <581f>\n<2cb0>  <584e>\n<2cb1>  <5850>\n<2cb2>  <5853>\n<2cbd>  <5863>\n<2cd2>  <587f>\n<2cd3>  <5882>\n<2cd4>  <5884>\n<2ce4>  <589b>\n<2ce5>  <589d>\n<2cfd>  <58bd>\n<2d03>  <58c6>\n<2d0d>  <58d2>\n<2d0e>  <58d4>\n<2d14>  <58e1>\n<2d15>  <58e3>\n<2d1a>  <58ea>\n<2d1b>  <58ed>\n<2d28>  <5903>\n<2d30>  <590e>\n<2d37>  <591b>\n<2d3c>  <5923>\n<2d3d>  <5926>\n<2d3e>  <5928>\n<2d3f>  <592c>\n<2d40>  <5930>\n<2d45>  <593b>\n<2d46>  <593d>\n<2d49>  <5943>\n<2d4c>  <594a>\n<2d4f>  <5950>\n<2d52>  <5959>\n<2d58>  <5961>\n<2d5e>  <596b>\n<2d5f>  <596d>\n<2d64>  <5975>\n<2d65>  <5977>\n<2d6c>  <5985>\n<2d6d>  <5989>\n<2d76>  <5998>\n<2d8a>  <59ba>\n<2d9d>  <59d9>\n<2d9e>  <59db>\n<2da4>  <59e4>\n<2db6>  <59fa>\n<2dba>  <5a00>\n<2dbb>  <5a02>\n<2dc2>  <5a12>\n<2dce>  <5a24>\n<2dd9>  <5a33>\n<2dda>  <5a35>\n<2e00>  <5a65>\n<2e3e>  <5ab4>\n<2e54>  <5ad3>\n<2e55>  <5ad5>\n<2e5c>  <5ae2>\n<2e61>  <5aea>\n<2e7a>  <5b0a>\n<2e84>  <5b18>\n<2e99>  <5b31>\nendbfchar\n\n100 beginbfchar\n<2e9a>  <5b33>\n<2eb2>  <5b52>\n<2eb3>  <5b56>\n<2eb4>  <5b5e>\n<2ebc>  <5b72>\n<2ebd>  <5b74>\n<2ec0>  <5b79>\n<2ec3>  <5b7e>\n<2ec4>  <5b82>\n<2ec5>  <5b86>\n<2ec6>  <5b8a>\n<2ecc>  <5b94>\n<2ecd>  <5b96>\n<2ece>  <5b9f>\n<2ed8>  <5bb7>\n<2ede>  <5bc3>\n<2ee6>  <5bd1>\n<2ef0>  <5be0>\n<2ef1>  <5be3>\n<2ef2>  <5bea>\n<2ef3>  <5bed>\n<2ef4>  <5bef>\n<2ef9>  <5bf7>\n<2efc>  <5c00>\n<2eff>  <5c05>\n<2f00>  <5c0c>\n<2f01>  <5c10>\n<2f04>  <5c17>\n<2f05>  <5c19>\n<2f06>  <5c1b>\n<2f0b>  <5c23>\n<2f0c>  <5c26>\n<2f29>  <5c5f>\n<2f2a>  <5c67>\n<2f2e>  <5c6d>\n<2f2f>  <5c70>\n<2f3b>  <5c80>\n<2f48>  <5c95>\n<2f52>  <5caa>\n<2f56>  <5cb2>\n<2f57>  <5cb4>\n<2f58>  <5cb6>\n<2f5d>  <5cbe>\n<2f5e>  <5cc0>\n<2f7c>  <5ce7>\n<2f7d>  <5ce9>\n<2f85>  <5cf5>\n<2f8a>  <5cfc>\n<2f9b>  <5d15>\n<2fa6>  <5d25>\n<2fa7>  <5d28>\n<2fcd>  <5d5c>\n<2fd9>  <5d6a>\n<2fec>  <5d83>\n<2ffe>  <5d98>\n<2fff>  <5d9a>\n<3019>  <5db9>\n<301a>  <5dbb>\n<3028>  <5dcc>\n<302d>  <5dd3>\n<3034>  <5ddc>\n<3039>  <5dea>\n<3045>  <5e04>\n<3046>  <5e07>\n<304e>  <5e17>\n<3059>  <5e2c>\n<305c>  <5e32>\n<3063>  <5e41>\n<3071>  <5e56>\n<3076>  <5e60>\n<3083>  <5e75>\n<3084>  <5e77>\n<3088>  <5e85>\n<308e>  <5e92>\n<308f>  <5e98>\n<3090>  <5e9b>\n<3091>  <5e9d>\n<3099>  <5eac>\n<309f>  <5eb4>\n<30c1>  <5ee9>\n<30c2>  <5eeb>\n<30c9>  <5ef5>\n<30d2>  <5f09>\n<30d6>  <5f10>\n<30d7>  <5f12>\n<30d8>  <5f14>\n<30d9>  <5f16>\n<30e3>  <5f28>\n<30e6>  <5f2e>\n<30e7>  <5f30>\n<30e8>  <5f32>\n<30e9>  <5f34>\n<30ed>  <5f3b>\n<30f6>  <5f47>\n<30fa>  <5f4d>\n<30fb>  <5f4f>\n<30fc>  <5f51>\n<30fd>  <5f54>\n<3100>  <5f5c>\n<3104>  <5f63>\nendbfchar\n\n100 beginbfchar\n<3105>  <5f65>\n<3108>  <5f6b>\n<310b>  <5f72>\n<310f>  <5f78>\n<3110>  <5f7a>\n<3114>  <5f83>\n<3115>  <5f86>\n<311b>  <5f96>\n<311e>  <5f9d>\n<311f>  <5f9f>\n<312e>  <5fb6>\n<312f>  <5fb8>\n<313b>  <5fce>\n<314a>  <5fec>\n<3154>  <5ffc>\n<315c>  <6013>\n<315f>  <601a>\n<3174>  <6040>\n<317c>  <604c>\n<317f>  <6051>\n<318d>  <606e>\n<3192>  <6077>\n<3193>  <607e>\n<31a1>  <6093>\n<31a2>  <6095>\n<31a6>  <609c>\n<31a7>  <609e>\n<31ac>  <60a7>\n<31af>  <60ae>\n<31b0>  <60b0>\n<31b1>  <60b3>\n<31b2>  <60b7>\n<31ca>  <60d9>\n<31cb>  <60db>\n<31cc>  <60de>\n<31d1>  <60ea>\n<31d2>  <60f5>\n<31dd>  <6107>\n<31ee>  <6125>\n<320a>  <6149>\n<320b>  <614d>\n<3213>  <6159>\n<3216>  <615e>\n<321b>  <6169>\n<321e>  <616f>\n<3221>  <6174>\n<3235>  <618f>\n<3236>  <6193>\n<3246>  <61aa>\n<3247>  <61ad>\n<325f>  <61d3>\n<326e>  <61e7>\n<327a>  <61f9>\n<327b>  <61fb>\n<327c>  <61fd>\n<3282>  <6209>\n<3283>  <6213>\n<3284>  <6219>\n<3288>  <6220>\n<3289>  <6223>\n<328a>  <6226>\n<328d>  <622b>\n<328e>  <622d>\n<328f>  <622f>\n<3290>  <6231>\n<3298>  <6242>\n<329c>  <624a>\n<32ad>  <6268>\n<32b6>  <627d>\n<32c4>  <6294>\n<32c5>  <6299>\n<32c9>  <62a3>\n<32d8>  <62ba>\n<32d9>  <62be>\n<32dc>  <62c3>\n<32dd>  <62cb>\n<32de>  <62cf>\n<32df>  <62d1>\n<32e0>  <62d5>\n<32e5>  <62e4>\n<32e8>  <62f0>\n<32e9>  <62f2>\n<32ea>  <62f5>\n<32ef>  <6300>\n<3300>  <6319>\n<3301>  <631c>\n<3304>  <6329>\n<3315>  <6344>\n<3318>  <634a>\n<3325>  <6360>\n<3329>  <636a>\n<332a>  <636c>\n<3336>  <6381>\n<3339>  <638b>\n<333a>  <638d>\n<333b>  <6391>\n<333f>  <6397>\n<3347>  <63a1>\n<3348>  <63a4>\n<3349>  <63a6>\nendbfchar\n\n100 beginbfchar\n<334a>  <63ab>\n<334b>  <63af>\n<3350>  <63b9>\n<3351>  <63bb>\n<3352>  <63bd>\n<3353>  <63bf>\n<3357>  <63c5>\n<335d>  <63d1>\n<3367>  <63df>\n<3368>  <63e2>\n<3373>  <63f3>\n<3374>  <63f5>\n<3375>  <63f7>\n<337a>  <63fe>\n<3382>  <640e>\n<338a>  <641d>\n<338b>  <641f>\n<3393>  <642b>\n<339a>  <6435>\n<33a0>  <643e>\n<33a1>  <6440>\n<33a4>  <6449>\n<33ab>  <6453>\n<33b2>  <645d>\n<33ba>  <6468>\n<33be>  <646e>\n<33c4>  <6477>\n<33cb>  <6483>\n<33cc>  <6486>\n<33d5>  <6494>\n<33e2>  <64aa>\n<33e3>  <64af>\n<33e4>  <64b1>\n<33e5>  <64b4>\n<33e6>  <64b6>\n<33e7>  <64b9>\n<33e8>  <64bd>\n<33e9>  <64c3>\n<33ea>  <64c6>\n<33ed>  <64cc>\n<33ee>  <64cf>\n<33ef>  <64d1>\n<33f0>  <64d3>\n<33f3>  <64d9>\n<33f7>  <64df>\n<33f8>  <64e1>\n<33f9>  <64e3>\n<33fa>  <64e5>\n<3402>  <64f3>\n<3407>  <64fd>\n<3408>  <64ff>\n<340c>  <6505>\n<3416>  <6513>\n<3417>  <6515>\n<3418>  <6517>\n<3419>  <651a>\n<341a>  <651c>\n<3423>  <652d>\n<3428>  <6537>\n<3429>  <653a>\n<3437>  <6550>\n<343b>  <6558>\n<343c>  <655a>\n<343d>  <655c>\n<344a>  <6571>\n<344b>  <6573>\n<344c>  <6576>\n<345f>  <6592>\n<3460>  <6594>\n<3461>  <6596>\n<3462>  <6598>\n<3463>  <659a>\n<3466>  <65a0>\n<3469>  <65a6>\n<346a>  <65a8>\n<346b>  <65aa>\n<346c>  <65ae>\n<3473>  <65b8>\n<3479>  <65c2>\n<347e>  <65cd>\n<348c>  <65e1>\n<349c>  <6601>\n<34a2>  <660b>\n<34a3>  <660d>\n<34ad>  <661e>\n<34b2>  <6626>\n<34b7>  <662e>\n<34b8>  <6630>\n<34c0>  <663d>\n<34d2>  <665e>\n<34d3>  <6660>\n<34d6>  <6665>\n<34d7>  <6667>\n<34e0>  <6675>\n<34e9>  <6683>\n<34ff>  <66a3>\n<3519>  <66c5>\n<351a>  <66c8>\n<3529>  <66da>\n<3538>  <66f1>\nendbfchar\n\n100 beginbfchar\n<353d>  <66fd>\n<3544>  <670c>\n<354a>  <6716>\n<354e>  <671c>\n<354f>  <671e>\n<3556>  <6729>\n<3557>  <672e>\n<3558>  <6730>\n<3563>  <6741>\n<3566>  <6747>\n<3569>  <674d>\n<356a>  <6752>\n<3572>  <675d>\n<357a>  <676e>\n<357b>  <6774>\n<357c>  <6776>\n<3581>  <677d>\n<3582>  <6780>\n<3587>  <6788>\n<3588>  <678a>\n<3591>  <6796>\n<3592>  <6799>\n<3593>  <679b>\n<3597>  <67a4>\n<3598>  <67a6>\n<3599>  <67a9>\n<359a>  <67ac>\n<359b>  <67ae>\n<359e>  <67b4>\n<35a7>  <67c2>\n<35b5>  <67db>\n<35b6>  <67df>\n<35b7>  <67e1>\n<35c1>  <67f2>\n<35ca>  <67fe>\n<35cf>  <6806>\n<35d0>  <680d>\n<35d1>  <6810>\n<35d2>  <6812>\n<35f0>  <683f>\n<35f1>  <6847>\n<35f2>  <684b>\n<35f3>  <684d>\n<35f4>  <684f>\n<35f5>  <6852>\n<3600>  <686a>\n<3609>  <6875>\n<3613>  <6882>\n<3614>  <6884>\n<3627>  <689e>\n<3631>  <68ae>\n<3634>  <68b4>\n<363f>  <68c1>\n<3646>  <68ca>\n<3647>  <68cc>\n<364e>  <68d9>\n<365e>  <68ef>\n<3665>  <68fb>\n<3672>  <690c>\n<3673>  <6911>\n<3697>  <693e>\n<36af>  <695f>\n<36b4>  <6967>\n<36b7>  <696c>\n<36bd>  <6976>\n<36c3>  <6981>\n<36c4>  <6983>\n<36c5>  <6985>\n<36dd>  <69a9>\n<36de>  <69ac>\n<36eb>  <69c0>\n<36f4>  <69cf>\n<3700>  <69de>\n<3719>  <69fe>\n<371a>  <6a00>\n<3730>  <6a20>\n<3731>  <6a22>\n<3736>  <6a29>\n<373b>  <6a30>\n<3757>  <6a5a>\n<375b>  <6a60>\n<3780>  <6a8f>\n<378c>  <6aa1>\n<3792>  <6aaa>\n<37ba>  <6adc>\n<37c2>  <6ae9>\n<37c3>  <6aeb>\n<37ed>  <6b1f>\n<37fe>  <6b38>\n<37ff>  <6b3b>\n<3800>  <6b3c>\n<3807>  <6b48>\n<381a>  <6b60>\n<3828>  <6b7a>\n<382d>  <6b85>\n<382e>  <6b88>\n<382f>  <6b8c>\n<3836>  <6b97>\n<3837>  <6b99>\n<3847>  <6bb6>\nendbfchar\n\n100 beginbfchar\n<384d>  <6bc0>\n<3854>  <6bcc>\n<3855>  <6bce>\n<3858>  <6bd8>\n<3859>  <6bda>\n<386d>  <6bf4>\n<3874>  <6bfe>\n<387d>  <6c0e>\n<387e>  <6c12>\n<387f>  <6c17>\n<3883>  <6c20>\n<3884>  <6c25>\n<3885>  <6c2d>\n<3886>  <6c31>\n<3887>  <6c33>\n<3893>  <6c48>\n<389c>  <6c56>\n<38aa>  <6c71>\n<38ab>  <6c73>\n<38ac>  <6c75>\n<38b4>  <6c84>\n<38b5>  <6c87>\n<38c0>  <6c9a>\n<38c4>  <6ca0>\n<38c5>  <6ca2>\n<38c6>  <6ca8>\n<38c7>  <6cac>\n<38ce>  <6cba>\n<38d6>  <6ccb>\n<38e1>  <6cdf>\n<38e2>  <6ce4>\n<38e5>  <6ce9>\n<38e8>  <6cf2>\n<38e9>  <6cf4>\n<38ea>  <6cf9>\n<38f4>  <6d0d>\n<38fc>  <6d18>\n<38ff>  <6d1f>\n<3905>  <6d26>\n<390c>  <6d34>\n<3910>  <6d3a>\n<3913>  <6d42>\n<3914>  <6d44>\n<3915>  <6d49>\n<3916>  <6d4c>\n<3917>  <6d50>\n<391c>  <6d5b>\n<391d>  <6d5d>\n<391e>  <6d5f>\n<3937>  <6d86>\n<393a>  <6d8d>\n<393d>  <6d92>\n<3943>  <6d9c>\n<3944>  <6da2>\n<3945>  <6da5>\n<3962>  <6dd7>\n<3966>  <6ddf>\n<3969>  <6de5>\n<396d>  <6ded>\n<3970>  <6df2>\n<3971>  <6df4>\n<3972>  <6df8>\n<397f>  <6e0b>\n<3980>  <6e0f>\n<3983>  <6e15>\n<398a>  <6e22>\n<398d>  <6e2a>\n<398e>  <6e2e>\n<3991>  <6e33>\n<3995>  <6e39>\n<39a9>  <6e55>\n<39aa>  <6e57>\n<39cd>  <6e84>\n<39da>  <6e97>\n<39de>  <6e9e>\n<39e3>  <6ea6>\n<39ea>  <6eb0>\n<39eb>  <6eb3>\n<39ec>  <6eb5>\n<39ef>  <6ebc>\n<39f3>  <6ec3>\n<39f4>  <6ec6>\n<39f8>  <6ecd>\n<39f9>  <6ed0>\n<39fa>  <6ed2>\n<39fb>  <6ed6>\n<3a00>  <6edd>\n<3a01>  <6ee3>\n<3a02>  <6ee7>\n<3a09>  <6ef3>\n<3a11>  <6f00>\n<3a28>  <6f21>\n<3a2d>  <6f2e>\n<3a2e>  <6f30>\n<3a31>  <6f37>\n<3a37>  <6f40>\n<3a3f>  <6f4c>\n<3a4a>  <6f5d>\n<3a4e>  <6f63>\n<3a4f>  <6f65>\nendbfchar\n\n100 beginbfchar\n<3a56>  <6f71>\n<3a57>  <6f73>\n<3a5a>  <6f79>\n<3a5b>  <6f7b>\n<3a61>  <6f85>\n<3a77>  <6fa8>\n<3a7e>  <6fb2>\n<3aaf>  <6ffb>\n<3ab0>  <6ffd>\n<3ab9>  <700a>\n<3abd>  <7010>\n<3ac3>  <7019>\n<3ac4>  <701c>\n<3ac5>  <701e>\n<3ad2>  <7031>\n<3ae9>  <7050>\n<3afc>  <706e>\n<3b00>  <7074>\n<3b01>  <7077>\n<3b05>  <707d>\n<3b13>  <7093>\n<3b25>  <70b0>\n<3b26>  <70b2>\n<3b2a>  <70ba>\n<3b31>  <70c9>\n<3b3e>  <70da>\n<3b46>  <70e5>\n<3b47>  <70ea>\n<3b48>  <70ee>\n<3b4f>  <70f8>\n<3b65>  <7114>\n<3b66>  <7117>\n<3b8e>  <714b>\n<3b8f>  <714d>\n<3b9c>  <715d>\n<3ba0>  <7163>\n<3ba1>  <7165>\n<3ba4>  <716d>\n<3bac>  <7179>\n<3bc0>  <7193>\n<3bd6>  <71b2>\n<3bd7>  <71b4>\n<3be1>  <71c2>\n<3bee>  <71d3>\n<3bff>  <71ef>\n<3c0a>  <71fd>\n<3c24>  <721c>\n<3c2f>  <7229>\n<3c30>  <722b>\n<3c36>  <723c>\n<3c48>  <7257>\n<3c49>  <725a>\n<3c4a>  <725c>\n<3c4b>  <725e>\n<3c4c>  <7260>\n<3c50>  <7268>\n<3c65>  <728c>\n<3c66>  <728e>\n<3c7e>  <72ae>\n<3c82>  <72b5>\n<3c90>  <72cf>\n<3c91>  <72d1>\n<3c96>  <72d8>\n<3c9b>  <72df>\n<3ca9>  <7302>\n<3cb7>  <7314>\n<3cc2>  <732d>\n<3cc7>  <7335>\n<3cc8>  <733a>\n<3ccb>  <7340>\n<3cd7>  <7351>\n<3ceb>  <7369>\n<3cec>  <736e>\n<3ced>  <7371>\n<3cf0>  <7376>\n<3cf1>  <7379>\n<3cf2>  <737d>\n<3cf3>  <737f>\n<3cf9>  <7388>\n<3cfa>  <738a>\n<3cff>  <7392>\n<3d12>  <73aa>\n<3d15>  <73b1>\n<3d1f>  <73c1>\n<3d27>  <73ce>\n<3d33>  <73df>\n<3d38>  <73e6>\n<3d39>  <73e8>\n<3d50>  <7404>\n<3d68>  <7427>\n<3d69>  <7429>\n<3d6a>  <742b>\n<3d6b>  <742d>\n<3d6c>  <742f>\n<3d76>  <7440>\n<3d89>  <7456>\n<3d8a>  <7458>\n<3d8b>  <745d>\n<3da3>  <747f>\n<3da4>  <7482>\nendbfchar\n\n100 beginbfchar\n<3da8>  <7488>\n<3da9>  <748a>\n<3dac>  <748f>\n<3db8>  <749d>\n<3de2>  <74d3>\n<3de8>  <74db>\n<3de9>  <74dd>\n<3dea>  <74df>\n<3deb>  <74e1>\n<3dec>  <74e5>\n<3df8>  <74f5>\n<3e0b>  <750e>\n<3e0c>  <7510>\n<3e0d>  <7512>\n<3e12>  <751b>\n<3e18>  <7524>\n<3e1b>  <752a>\n<3e1c>  <752e>\n<3e1d>  <7534>\n<3e1e>  <7536>\n<3e1f>  <7539>\n<3e22>  <753f>\n<3e2b>  <754d>\n<3e43>  <7573>\n<3e44>  <7575>\n<3e45>  <7577>\n<3e56>  <7590>\n<3e57>  <7593>\n<3e58>  <7595>\n<3e59>  <7598>\n<3e5c>  <759e>\n<3e5d>  <75a2>\n<3e63>  <75ad>\n<3e6b>  <75c6>\n<3e72>  <75d3>\n<3e73>  <75d7>\n<3e74>  <75da>\n<3e7a>  <75e5>\n<3e7b>  <75e9>\n<3e8a>  <7604>\n<3e95>  <7616>\n<3e96>  <761a>\n<3e99>  <7623>\n<3e9a>  <7628>\n<3e9b>  <762c>\n<3ea4>  <763d>\n<3ea5>  <7641>\n<3ea8>  <7648>\n<3eb1>  <7655>\n<3eb2>  <7657>\n<3eb6>  <765d>\n<3eb9>  <7666>\n<3eba>  <7668>\n<3ebb>  <766a>\n<3ec6>  <7683>\n<3ec7>  <7685>\n<3ece>  <7692>\n<3ee7>  <76b3>\n<3eeb>  <76b9>\n<3ef4>  <76c7>\n<3ef5>  <76c9>\n<3ef8>  <76d3>\n<3ef9>  <76d5>\n<3efe>  <76e0>\n<3eff>  <76e2>\n<3f00>  <76e6>\n<3f07>  <76f0>\n<3f08>  <76f3>\n<3f0e>  <76fd>\n<3f15>  <770a>\n<3f16>  <770c>\n<3f26>  <7721>\n<3f2a>  <7727>\n<3f2e>  <772e>\n<3f34>  <7739>\n<3f35>  <773b>\n<3f39>  <7742>\n<3f50>  <7764>\n<3f51>  <7767>\n<3f78>  <77a1>\n<3f7b>  <77a6>\n<3f7c>  <77a8>\n<3f7d>  <77ab>\n<3f82>  <77b4>\n<3f88>  <77be>\n<3fa5>  <77e4>\n<3fa6>  <77e6>\n<3fa7>  <77e8>\n<3fa8>  <77ea>\n<3fae>  <77f7>\n<3fbe>  <7813>\n<3fbf>  <7815>\n<3fc0>  <7819>\n<3fc1>  <781b>\n<3fc2>  <781e>\n<3fc6>  <7824>\n<3fc7>  <7828>\n<3fd1>  <783d>\n<3fd2>  <783f>\n<3fd5>  <7844>\nendbfchar\n\n100 beginbfchar\n<3fd6>  <7846>\n<3fdb>  <784d>\n<3fdc>  <784f>\n<3fdd>  <7851>\n<3fee>  <7869>\n<4004>  <7888>\n<4009>  <7892>\n<400d>  <7899>\n<4010>  <78a0>\n<4011>  <78a2>\n<4012>  <78a4>\n<4013>  <78a6>\n<4014>  <78a8>\n<401d>  <78bb>\n<401e>  <78bd>\n<4043>  <78f3>\n<406a>  <7925>\n<4079>  <793d>\n<407a>  <793f>\n<407f>  <7947>\n<408d>  <7961>\n<4090>  <7966>\n<4095>  <796e>\n<409d>  <7979>\n<40c5>  <79af>\n<40c6>  <79b2>\n<40cc>  <79bc>\n<40cd>  <79bf>\n<40ce>  <79c2>\n<40d3>  <79ca>\n<40d4>  <79cc>\n<40e5>  <79e5>\n<40e6>  <79e8>\n<40e7>  <79ea>\n<40e8>  <79ec>\n<40e9>  <79ee>\n<40f3>  <79fc>\n<40f6>  <7a01>\n<40fd>  <7a0c>\n<410a>  <7a1f>\n<4119>  <7a32>\n<411d>  <7a38>\n<411e>  <7a3a>\n<411f>  <7a3e>\n<4140>  <7a6a>\n<4148>  <7a75>\n<414d>  <7a82>\n<414e>  <7a85>\n<414f>  <7a87>\n<415c>  <7a9e>\n<4161>  <7aa7>\n<4162>  <7aab>\n<4174>  <7ac6>\n<4175>  <7ac9>\n<4188>  <7ae4>\n<418e>  <7aee>\n<4199>  <7afe>\n<419d>  <7b05>\n<419e>  <7b07>\n<419f>  <7b09>\n<41a3>  <7b10>\n<41a9>  <7b1a>\n<41ac>  <7b1f>\n<41b0>  <7b27>\n<41b1>  <7b29>\n<41b2>  <7b2d>\n<41b5>  <7b32>\n<41ba>  <7b39>\n<41bb>  <7b3b>\n<41bc>  <7b3d>\n<41c3>  <7b48>\n<41c4>  <7b4a>\n<41c7>  <7b53>\n<41c8>  <7b55>\n<41c9>  <7b57>\n<41ca>  <7b59>\n<41cb>  <7b5c>\n<41ce>  <7b61>\n<41dd>  <7b76>\n<41de>  <7b78>\n<41df>  <7b7a>\n<41e2>  <7b7f>\n<41ec>  <7b8c>\n<41f2>  <7b96>\n<420e>  <7bc5>\n<420f>  <7bc8>\n<4210>  <7bca>\n<4215>  <7bd2>\n<4229>  <7bf2>\n<4231>  <7bfd>\n<4232>  <7bff>\n<423c>  <7c0e>\n<424a>  <7c20>\n<424b>  <7c22>\n<4260>  <7c42>\n<4280>  <7c6b>\n<4281>  <7c6d>\n<429f>  <7c96>\n<42a5>  <7ca3>\n<42bb>  <7cc6>\nendbfchar\n\n100 beginbfchar\n<42bc>  <7cc9>\n<42bd>  <7ccb>\n<42c5>  <7cd8>\n<42d4>  <7cf1>\n<42d5>  <7cf3>\n<42d6>  <7cf5>\n<42d7>  <7cf7>\n<42d8>  <7cfa>\n<42db>  <7cff>\n<42dc>  <7d01>\n<42dd>  <7d03>\n<42de>  <7d0c>\n<42e3>  <7d16>\n<42e4>  <7d18>\n<42f7>  <7d3b>\n<42fa>  <7d41>\n<42fb>  <7d43>\n<42fc>  <7d45>\n<4304>  <7d4f>\n<4316>  <7d67>\n<4320>  <7d78>\n<4328>  <7d82>\n<432b>  <7d87>\n<433c>  <7d9d>\n<4346>  <7daf>\n<434a>  <7dbc>\n<4358>  <7dd3>\n<435e>  <7ddf>\n<435f>  <7de2>\n<4362>  <7de7>\n<4367>  <7df0>\n<4368>  <7df3>\n<4369>  <7df5>\n<436c>  <7dfa>\n<4386>  <7e1c>\n<4390>  <7e2c>\n<4393>  <7e33>\n<4394>  <7e38>\n<4395>  <7e3a>\n<4396>  <7e3c>\n<43a6>  <7e53>\n<43b7>  <7e6c>\n<43c9>  <7e89>\n<43ca>  <7e8b>\n<43cb>  <7e8e>\n<43cf>  <7e95>\n<43d0>  <7e97>\n<43d5>  <7eae>\n<43d6>  <7eb4>\n<43d9>  <7ed6>\n<43da>  <7ee4>\n<43db>  <7eec>\n<43dc>  <7ef9>\n<43dd>  <7f0a>\n<43de>  <7f10>\n<43df>  <7f1e>\n<43e0>  <7f37>\n<43e1>  <7f39>\n<43e9>  <7f43>\n<43f0>  <7f4d>\n<43f1>  <7f4f>\n<43f4>  <7f56>\n<43f5>  <7f59>\n<43fa>  <7f60>\n<4403>  <7f6f>\n<4404>  <7f73>\n<4407>  <7f78>\n<4411>  <7f87>\n<4412>  <7f89>\n<4413>  <7f8b>\n<4414>  <7f8d>\n<4421>  <7fa0>\n<4424>  <7fa6>\n<4425>  <7fa8>\n<442b>  <7fb1>\n<4433>  <7fbe>\n<4434>  <7fc0>\n<443c>  <7fcb>\n<443d>  <7fcd>\n<4441>  <7fd3>\n<4453>  <7fef>\n<4454>  <7ff2>\n<445a>  <7ffa>\n<445e>  <8002>\n<4465>  <8011>\n<4466>  <8013>\n<446c>  <8021>\n<446f>  <802b>\n<4470>  <802d>\n<4473>  <8032>\n<4474>  <8034>\n<4477>  <803c>\n<4478>  <803e>\n<4484>  <8053>\n<4485>  <8055>\n<4486>  <8057>\n<4487>  <8059>\n<4499>  <8074>\n<449a>  <8078>\n<44a0>  <8088>\nendbfchar\n\n100 beginbfchar\n<44a1>  <808a>\n<44aa>  <8097>\n<44ab>  <8099>\n<44ac>  <809e>\n<44ad>  <80a3>\n<44b1>  <80ac>\n<44b2>  <80b0>\n<44b3>  <80b3>\n<44b8>  <80bb>\n<44b9>  <80c5>\n<44c6>  <80d8>\n<44cb>  <80e6>\n<44cc>  <80ee>\n<44cd>  <80f5>\n<44ce>  <80f7>\n<44cf>  <80f9>\n<44d0>  <80fb>\n<44db>  <8115>\n<44dc>  <8117>\n<44dd>  <8119>\n<44ef>  <8130>\n<44f3>  <8137>\n<44ff>  <8147>\n<4500>  <8149>\n<4501>  <814d>\n<4502>  <814f>\n<4503>  <8152>\n<450e>  <8168>\n<450f>  <816a>\n<4510>  <816c>\n<4511>  <816f>\n<4517>  <8181>\n<451d>  <8189>\n<4522>  <8190>\n<4529>  <8199>\n<4530>  <81a7>\n<453f>  <81bc>\n<4544>  <81cb>\n<4545>  <81ce>\n<454e>  <81d9>\n<4558>  <81e9>\n<4559>  <81eb>\n<4564>  <81fd>\n<4565>  <81ff>\n<4566>  <8203>\n<4567>  <820b>\n<456a>  <8211>\n<456b>  <8213>\n<4572>  <821d>\n<4573>  <8220>\n<4578>  <8229>\n<4579>  <822e>\n<457a>  <8232>\n<457b>  <823a>\n<4585>  <8248>\n<4586>  <824a>\n<459a>  <8265>\n<459b>  <8267>\n<45a2>  <8278>\n<45a7>  <8283>\n<45ab>  <8289>\n<45ac>  <828c>\n<45ad>  <8290>\n<45b4>  <829e>\n<45b5>  <82a0>\n<45b8>  <82a7>\n<45b9>  <82b2>\n<45bc>  <82ba>\n<45bd>  <82bc>\n<45c4>  <82c9>\n<45c5>  <82d0>\n<45c6>  <82d6>\n<45c9>  <82dd>\n<45ca>  <82e2>\n<45d1>  <82f0>\n<45d6>  <82f8>\n<45d7>  <82fa>\n<45df>  <830d>\n<45e0>  <8310>\n<45e3>  <8316>\n<45f2>  <832e>\n<45f3>  <8330>\n<45f4>  <8332>\n<45f5>  <8337>\n<45f6>  <833b>\n<45fe>  <8348>\n<45ff>  <834a>\n<4604>  <8353>\n<460a>  <835d>\n<460b>  <8362>\n<4626>  <8397>\n<4629>  <839d>\n<462a>  <839f>\n<462b>  <83a1>\n<4634>  <83b5>\n<4635>  <83bb>\n<463b>  <83c6>\n<463e>  <83cb>\n<4645>  <83d5>\n<4646>  <83d7>\nendbfchar\n\n100 beginbfchar\n<464a>  <83de>\n<4660>  <8402>\n<4661>  <8405>\n<4664>  <8410>\n<4698>  <8458>\n<469d>  <8462>\n<469e>  <8465>\n<46a1>  <846a>\n<46a2>  <846e>\n<46a3>  <8470>\n<46a4>  <8472>\n<46a5>  <8474>\n<46a6>  <8479>\n<46b2>  <848a>\n<46b3>  <848d>\n<46ba>  <8498>\n<46d0>  <84b3>\n<46d4>  <84bb>\n<46d5>  <84be>\n<46dc>  <84cc>\n<46df>  <84d2>\n<46e8>  <84de>\n<46eb>  <84e4>\n<46f1>  <84ed>\n<46fd>  <84fe>\n<470e>  <8512>\n<4716>  <8520>\n<4717>  <8522>\n<472a>  <8542>\n<472d>  <8547>\n<4734>  <8554>\n<4735>  <8557>\n<473d>  <8563>\n<4747>  <8573>\n<474a>  <8578>\n<4752>  <8586>\n<4753>  <8589>\n<4754>  <858b>\n<4757>  <8590>\n<4766>  <85a5>\n<4767>  <85a7>\n<4771>  <85b8>\n<4784>  <85d4>\n<479d>  <85f5>\n<47c0>  <8628>\n<47ce>  <8639>\n<47cf>  <863b>\n<47e5>  <865b>\n<47e6>  <865d>\n<47f0>  <866d>\n<4800>  <8689>\n<4806>  <8694>\n<4814>  <86ab>\n<4824>  <86c5>\n<4825>  <86c8>\n<482d>  <86da>\n<483b>  <86ef>\n<4842>  <86ff>\n<4843>  <8701>\n<484c>  <8714>\n<484d>  <8716>\n<484e>  <8719>\n<484f>  <871b>\n<4850>  <871d>\n<4853>  <8724>\n<486f>  <874d>\n<4874>  <8754>\n<4875>  <8756>\n<4876>  <8758>\n<4886>  <876f>\n<488a>  <8775>\n<488b>  <8777>\n<4895>  <878c>\n<48ad>  <87ae>\n<48b1>  <87b4>\n<48b6>  <87bc>\n<48bc>  <87c5>\n<48bd>  <87c7>\n<48be>  <87c9>\n<48d0>  <87e4>\n<48d5>  <87eb>\n<48d6>  <87ed>\n<48de>  <87fa>\n<48e5>  <8804>\n<48ee>  <8812>\n<48ef>  <8814>\n<48f7>  <8820>\n<490a>  <883a>\n<4914>  <884b>\n<491c>  <8858>\n<491d>  <885a>\n<491e>  <885c>\n<4924>  <886a>\n<4925>  <886d>\n<4926>  <886f>\n<4927>  <8871>\n<492c>  <8878>\n<4930>  <8880>\n<4931>  <8883>\n<4936>  <888c>\nendbfchar\n\n100 beginbfchar\n<4948>  <88a3>\n<494f>  <88ac>\n<4969>  <88d3>\n<496e>  <88de>\n<497a>  <88f2>\n<498e>  <8911>\n<49a4>  <8931>\n<49a5>  <8935>\n<49a6>  <8937>\n<49c9>  <8965>\n<49cd>  <896b>\n<49dd>  <8980>\n<49de>  <8982>\n<49ed>  <8997>\n<49fd>  <89ab>\n<4a0a>  <89be>\n<4a0b>  <89c3>\n<4a0c>  <89cd>\n<4a13>  <89db>\n<4a14>  <89dd>\n<4a19>  <89e4>\n<4a24>  <89f5>\n<4a25>  <89f7>\n<4a30>  <8a09>\n<4a31>  <8a0b>\n<4a32>  <8a0d>\n<4a33>  <8a0f>\n<4a36>  <8a14>\n<4a37>  <8a17>\n<4a3a>  <8a1c>\n<4a3b>  <8a1e>\n<4a3f>  <8a24>\n<4a4b>  <8a35>\n<4a58>  <8a47>\n<4a5e>  <8a4f>\n<4a5f>  <8a51>\n<4a60>  <8a53>\n<4a6d>  <8a6a>\n<4a6e>  <8a6f>\n<4a6f>  <8a74>\n<4a7b>  <8a88>\n<4a81>  <8a94>\n<4a84>  <8a99>\n<4a88>  <8a9f>\n<4a89>  <8aa2>\n<4a8a>  <8aa7>\n<4a91>  <8ab1>\n<4a9d>  <8ac3>\n<4aa0>  <8ac8>\n<4aa1>  <8aca>\n<4aa2>  <8acc>\n<4aa3>  <8ace>\n<4aa4>  <8ad0>\n<4aab>  <8add>\n<4aaf>  <8ae3>\n<4ab0>  <8ae5>\n<4ab4>  <8aec>\n<4ab7>  <8af2>\n<4aba>  <8af9>\n<4abb>  <8afb>\n<4abc>  <8afd>\n<4abd>  <8aff>\n<4abe>  <8b03>\n<4abf>  <8b06>\n<4ac5>  <8b0f>\n<4ac9>  <8b15>\n<4aca>  <8b18>\n<4acb>  <8b1c>\n<4ad3>  <8b27>\n<4af8>  <8b57>\n<4af9>  <8b5b>\n<4b24>  <8b94>\n<4b2a>  <8b9d>\n<4b2b>  <8b9f>\n<4b2c>  <8bac>\n<4b2d>  <8bb1>\n<4b2e>  <8bbb>\n<4b2f>  <8bc7>\n<4b30>  <8bd0>\n<4b31>  <8bea>\n<4b32>  <8c09>\n<4b33>  <8c1e>\n<4b72>  <8c8b>\n<4b81>  <8c9f>\n<4b88>  <8cb1>\n<4b89>  <8cb5>\n<4b8a>  <8cb9>\n<4b8b>  <8cbe>\n<4b8c>  <8cc6>\n<4b8d>  <8cc9>\n<4b94>  <8cd4>\n<4b99>  <8cdb>\n<4b9a>  <8cdd>\n<4b9b>  <8cdf>\n<4b9c>  <8ce5>\n<4bb1>  <8d09>\n<4bb2>  <8d0c>\n<4bb3>  <8d0e>\n<4bbd>  <8d20>\n<4bc0>  <8d57>\nendbfchar\n\n100 beginbfchar\n<4bc1>  <8d5f>\n<4bc2>  <8d65>\n<4bc6>  <8d6c>\n<4bfa>  <8db9>\n<4bfb>  <8dbb>\n<4bfc>  <8dbd>\n<4c00>  <8dc5>\n<4c05>  <8dcd>\n<4c06>  <8dd0>\n<4c0d>  <8ddc>\n<4c14>  <8de9>\n<4c1a>  <8df4>\n<4c1b>  <8df6>\n<4c1c>  <8dfc>\n<4c27>  <8e0b>\n<4c3c>  <8e2b>\n<4c3d>  <8e2d>\n<4c3e>  <8e30>\n<4c48>  <8e43>\n<4c63>  <8e6e>\n<4c64>  <8e71>\n<4c65>  <8e73>\n<4c66>  <8e75>\n<4c6a>  <8e7b>\n<4c6d>  <8e80>\n<4c71>  <8e86>\n<4c72>  <8e88>\n<4c73>  <8e8c>\n<4c74>  <8e8e>\n<4c7a>  <8e9b>\n<4c7b>  <8e9d>\n<4ca0>  <8ed3>\n<4cbf>  <8efd>\n<4cc4>  <8f04>\n<4cc5>  <8f06>\n<4cc6>  <8f08>\n<4cce>  <8f13>\n<4cec>  <8f43>\n<4d00>  <8f5e>\n<4d01>  <8f60>\n<4d02>  <8f63>\n<4d03>  <8f65>\n<4d04>  <8f6a>\n<4d05>  <8f80>\n<4d06>  <8f8c>\n<4d07>  <8f92>\n<4d08>  <8f9d>\n<4d0e>  <8fa7>\n<4d0f>  <8faa>\n<4d10>  <8fac>\n<4d1b>  <8fc3>\n<4d1c>  <8fc6>\n<4d22>  <8fcf>\n<4d23>  <8fd2>\n<4d26>  <8fda>\n<4d29>  <8fe3>\n<4d2a>  <8fe7>\n<4d2b>  <8fec>\n<4d2c>  <8fef>\n<4d38>  <900c>\n<4d39>  <900e>\n<4d3a>  <9013>\n<4d3b>  <9018>\n<4d3c>  <901c>\n<4d49>  <9037>\n<4d4c>  <903d>\n<4d4f>  <9043>\n<4d55>  <904c>\n<4d56>  <9056>\n<4d59>  <905d>\n<4d5a>  <905f>\n<4d5b>  <9061>\n<4d5c>  <9064>\n<4d65>  <9073>\n<4d66>  <9076>\n<4d67>  <9079>\n<4d68>  <907b>\n<4d69>  <907e>\n<4d6c>  <9089>\n<4d70>  <9092>\n<4d71>  <9094>\n<4d72>  <9096>\n<4d73>  <9098>\n<4d74>  <909a>\n<4d75>  <909c>\n<4d7e>  <90ab>\n<4d7f>  <90ad>\n<4d80>  <90b2>\n<4d81>  <90b7>\n<4d88>  <90c6>\n<4d8e>  <90d2>\n<4d95>  <90de>\n<4d96>  <90e0>\n<4d9c>  <90ec>\n<4d9d>  <90ee>\n<4dab>  <9103>\n<4dac>  <9105>\n<4db7>  <9113>\n<4db8>  <9115>\n<4dca>  <912e>\nendbfchar\n\n100 beginbfchar\n<4dcb>  <9133>\n<4dcc>  <9135>\n<4dd9>  <9147>\n<4dda>  <9151>\n<4de8>  <916b>\n<4de9>  <916d>\n<4dea>  <9173>\n<4df3>  <9186>\n<4df4>  <9188>\n<4df5>  <918a>\n<4e16>  <91c2>\n<4e17>  <91c4>\n<4e18>  <91c6>\n<4e19>  <91c8>\n<4e1a>  <91d0>\n<4e1b>  <91d6>\n<4e25>  <91e8>\n<4e31>  <91f6>\n<4e32>  <91f8>\n<4e40>  <920f>\n<4e4f>  <9224>\n<4e56>  <922f>\n<4e6c>  <9256>\n<4e85>  <9279>\n<4e8b>  <9284>\n<4e96>  <9292>\n<4e99>  <9297>\n<4e9a>  <9299>\n<4e9b>  <929b>\n<4ea1>  <92a4>\n<4ea2>  <92a7>\n<4ea3>  <92ad>\n<4eab>  <92b8>\n<4eac>  <92ba>\n<4eb1>  <92c2>\n<4eb2>  <92c4>\n<4eb3>  <92c6>\n<4ec5>  <92de>\n<4ec9>  <92e7>\n<4eca>  <92e9>\n<4ed1>  <92f7>\n<4ee4>  <9311>\n<4eec>  <9321>\n<4ef0>  <9327>\n<4ef9>  <9337>\n<4eff>  <933f>\n<4f00>  <9342>\n<4f06>  <934c>\n<4f1d>  <936b>\n<4f2e>  <9383>\n<4f3d>  <9397>\n<4f49>  <93a8>\n<4f4a>  <93ab>\n<4f4b>  <93ad>\n<4f4c>  <93af>\n<4f4f>  <93b4>\n<4f5e>  <93c9>\n<4f5f>  <93cb>\n<4f6a>  <93e0>\n<4f6b>  <93e3>\n<4f7b>  <93f6>\n<4f7c>  <93f8>\n<4f91>  <9411>\n<4fa7>  <9434>\n<4faa>  <9439>\n<4fb7>  <944b>\n<4fbd>  <9453>\n<4fcb>  <9464>\n<4fd1>  <946c>\n<4fd4>  <9471>\n<4fd9>  <9478>\n<4fe1>  <9491>\n<4fe2>  <9496>\n<4fe3>  <9498>\n<4fe4>  <94c7>\n<4fe5>  <94cf>\n<4fe8>  <94da>\n<4fe9>  <94e6>\n<4fea>  <94fb>\n<4feb>  <951c>\n<4fec>  <9520>\n<4fed>  <9527>\n<4fee>  <9533>\n<4fef>  <953d>\n<4ff0>  <9543>\n<4ff1>  <9548>\n<4ff2>  <954b>\n<4ff3>  <9555>\n<4ff4>  <955a>\n<4ff5>  <9560>\n<4ff6>  <956e>\n<5000>  <9581>\n<5005>  <958a>\n<5006>  <958d>\n<5007>  <9590>\n<5008>  <9592>\n<5014>  <95a2>\n<5017>  <95aa>\n<5021>  <95ba>\n<5027>  <95c7>\nendbfchar\n\n100 beginbfchar\n<5028>  <95c9>\n<5034>  <95dd>\n<503b>  <95ec>\n<503c>  <95ff>\n<503d>  <9607>\n<503e>  <9613>\n<503f>  <9618>\n<5040>  <961b>\n<5041>  <961e>\n<5042>  <9620>\n<5053>  <963e>\n<5054>  <9641>\n<5055>  <9643>\n<5056>  <964a>\n<5060>  <965c>\n<5061>  <965e>\n<5062>  <9660>\n<5065>  <966b>\n<5069>  <9671>\n<5075>  <9687>\n<5076>  <9689>\n<5077>  <968c>\n<507b>  <9696>\n<507c>  <969a>\n<5087>  <96a9>\n<508d>  <96b2>\n<508e>  <96b5>\n<508f>  <96b7>\n<5090>  <96ba>\n<5091>  <96bf>\n<5094>  <96c8>\n<509d>  <96da>\n<50a1>  <96e1>\n<50ae>  <96f8>\n<50af>  <96fa>\n<50b2>  <96ff>\n<50b5>  <9705>\n<50c3>  <971d>\n<50d2>  <9731>\n<50de>  <9743>\n<50f1>  <975f>\n<50ff>  <9775>\n<5112>  <978c>\n<5113>  <978e>\n<5114>  <9790>\n<5115>  <9793>\n<5128>  <97ac>\n<5129>  <97ae>\n<512c>  <97b3>\n<513e>  <97ca>\n<514c>  <97dd>\n<5154>  <97e8>\n<515a>  <97f4>\n<5163>  <9800>\n<5164>  <9804>\n<5165>  <9809>\n<5166>  <980b>\n<5167>  <980d>\n<5174>  <9825>\n<5185>  <983c>\n<519a>  <985a>\n<51a2>  <9866>\n<51a8>  <9872>\n<51a9>  <988b>\n<51aa>  <988e>\n<51ab>  <9892>\n<51ac>  <9895>\n<51ad>  <9899>\n<51ae>  <98a3>\n<51b4>  <98b0>\n<51b5>  <98b2>\n<51c4>  <98c5>\n<51c5>  <98c7>\n<51cd>  <98d4>\n<51d2>  <98e1>\n<51d7>  <98ec>\n<51d8>  <98ee>\n<51db>  <98f3>\n<51e7>  <9904>\n<51eb>  <990b>\n<520e>  <993d>\n<5212>  <9944>\n<5219>  <9953>\n<521a>  <9956>\n<521f>  <995d>\n<5223>  <9964>\n<5224>  <9966>\n<5225>  <9973>\n<5228>  <997b>\n<5229>  <997e>\n<522c>  <9989>\n<522d>  <998c>\n<522e>  <998e>\n<5241>  <99b2>\n<525c>  <99d3>\n<525f>  <99da>\n<5260>  <99dc>\n<5261>  <99de>\n<5262>  <99e0>\n<527d>  <9a00>\nendbfchar\n\n100 beginbfchar\n<52a1>  <9a2c>\n<52a2>  <9a2f>\n<52ad>  <9a3f>\n<52b4>  <9a4e>\n<52ba>  <9a56>\n<52c2>  <9a63>\n<52c7>  <9a6b>\n<52c8>  <9a72>\n<52c9>  <9a83>\n<52ca>  <9a89>\n<52cf>  <9a99>\n<52d0>  <9aa6>\n<52db>  <9ab9>\n<52dc>  <9abb>\n<52e9>  <9ad0>\n<52ea>  <9ad7>\n<52f1>  <9ae0>\n<52fa>  <9aec>\n<5304>  <9afa>\n<530e>  <9b07>\n<5313>  <9b0e>\n<5323>  <9b24>\n<5324>  <9b26>\n<5325>  <9b28>\n<532a>  <9b30>\n<5337>  <9b46>\n<533b>  <9b50>\n<5341>  <9b59>\n<5365>  <9b82>\n<5370>  <9b8f>\n<5385>  <9bac>\n<539c>  <9bc8>\n<53a6>  <9bd5>\n<53ab>  <9bdc>\n<53af>  <9be3>\n<53b2>  <9be9>\n<53c2>  <9bfe>\n<53d0>  <9c11>\n<53df>  <9c24>\n<53e8>  <9c34>\n<53e9>  <9c36>\n<53ea>  <9c38>\n<53eb>  <9c3a>\n<53fe>  <9c53>\n<53ff>  <9c55>\n<5404>  <9c5e>\n<541b>  <9c79>\n<541c>  <9c7b>\n<541f>  <9c80>\n<5424>  <9c8c>\n<5425>  <9c8f>\n<5426>  <9c93>\n<542b>  <9c9d>\n<542c>  <9caa>\n<542d>  <9cac>\n<542e>  <9caf>\n<542f>  <9cb9>\n<544a>  <9cf5>\n<545a>  <9d08>\n<546b>  <9d1c>\n<546c>  <9d1e>\n<5472>  <9d27>\n<54a8>  <9d6b>\n<54c1>  <9d88>\n<54cf>  <9d99>\n<54ef>  <9dc1>\n<54f0>  <9dc3>\n<54ff>  <9dd4>\n<5502>  <9dd8>\n<5538>  <9e1c>\n<5539>  <9e24>\n<553a>  <9e27>\n<553b>  <9e2e>\n<553c>  <9e30>\n<553d>  <9e34>\n<5540>  <9e40>\n<5541>  <9e4d>\n<5542>  <9e50>\n<5546>  <9e56>\n<5547>  <9e59>\n<5548>  <9e5d>\n<554d>  <9e65>\n<5550>  <9e72>\n<5551>  <9e74>\n<5555>  <9e7b>\n<556c>  <9e9e>\n<5581>  <9ebc>\n<558d>  <9ed0>\n<5595>  <9ee1>\n<5598>  <9ee6>\n<559f>  <9ef3>\n<55a2>  <9ef8>\n<55a3>  <9efa>\n<55ad>  <9f0a>\n<55ae>  <9f0c>\n<55af>  <9f0f>\n<55b2>  <9f14>\n<55b3>  <9f16>\n<55b4>  <9f18>\n<55bb>  <9f21>\nendbfchar\n\n100 beginbfchar\n<55ce>  <9f38>\n<55cf>  <9f3a>\n<55d0>  <9f3c>\n<55de>  <9f53>\n<55e7>  <9f62>\n<55ed>  <9f6b>\n<560f>  <f92c>\n<5613>  <fa11>\n<5616>  <fa18>\n<561f>  <2e81>\n<5620>  <d840dc87>\n<5621>  <d840dc89>\n<5622>  <d840dccc>\n<5623>  <2e84>\n<5624>  <3473>\n<5625>  <3447>\n<5626>  <2e88>\n<5627>  <2e8b>\n<5628>  <9fb4>\n<5629>  <359e>\n<562a>  <361a>\n<562b>  <360e>\n<562c>  <2e8c>\n<562d>  <2e97>\n<562e>  <396e>\n<562f>  <3918>\n<5630>  <9fb5>\n<5631>  <39cf>\n<5632>  <39df>\n<5633>  <3a73>\n<5634>  <39d0>\n<5637>  <3b4e>\n<5638>  <3c6e>\n<5639>  <3ce0>\n<563a>  <2ea7>\n<563b>  <d845ddd7>\n<563c>  <9fb8>\n<563d>  <2eaa>\n<563e>  <4056>\n<563f>  <415f>\n<5640>  <2eae>\n<5641>  <4337>\n<5642>  <2eb3>\n<5645>  <d84add8f>\n<5646>  <43b1>\n<5647>  <43ac>\n<5648>  <2ebb>\n<5649>  <43dd>\n<564a>  <44d6>\n<564b>  <4661>\n<564c>  <464c>\n<564d>  <9fb9>\n<564e>  <4723>\n<564f>  <4729>\n<5650>  <477c>\n<5651>  <478d>\n<5652>  <2eca>\n<5653>  <4947>\n<5654>  <497a>\n<5655>  <497d>\n<565a>  <499f>\n<565b>  <499b>\n<565c>  <49b7>\n<565d>  <49b6>\n<565e>  <9fba>\n<565f>  <d850ddfe>\n<5660>  <4ca3>\n<5664>  <4c77>\n<5665>  <4ca2>\n<566d>  <4dae>\n<566e>  <9fbb>\n<56ce>  <00fc>\n<56cf>  <00a9>\n<56d0>  <2122>\n<56d1>  <2026>\n<5730>  <0101>\n<5731>  <00e1>\n<5732>  <01ce>\n<5733>  <00e0>\n<5734>  <0113>\n<5735>  <00e9>\n<5736>  <011b>\n<5737>  <00e8>\n<5738>  <012b>\n<5739>  <00ed>\n<573a>  <01d0>\n<573b>  <00ec>\n<573c>  <014d>\n<573d>  <00f3>\n<573e>  <01d2>\n<573f>  <00f2>\n<5740>  <016b>\n<5741>  <00fa>\n<5742>  <01d4>\n<5743>  <00f9>\n<5744>  <01d6>\n<5745>  <01d8>\n<5746>  <01da>\n<5747>  <01dc>\n<5748>  <00fc>\nendbfchar\n\n56 beginbfchar\n<5749>  <00ea>\n<574a>  <0251>\n<574b>  <1e3f>\n<574c>  <0144>\n<574d>  <0148>\n<574e>  <01f9>\n<574f>  <0261>\n<5750>  <0020>\n<5751>  <20ac>\n<5752>  <00a5>\n<5753>  <20ac>\n<5754>  <0024>\n<5755>  <303f>\n<5756>  <20ac>\n<5757>  <3041>\n<5758>  <3047>\n<5759>  <3043>\n<575a>  <304b>\n<575b>  <304b>\n<575c>  <3051>\n<575d>  <3051>\n<575e>  <3053>\n<575f>  <3053>\n<5760>  <3049>\n<5761>  <3064>\n<5762>  <3045>\n<5763>  <308e>\n<5764>  <3083>\n<5765>  <3087>\n<5766>  <3085>\n<5767>  <3094>\n<5768>  <30a1>\n<5769>  <30a7>\n<576a>  <30a3>\n<576d>  <30b3>\n<576e>  <30b3>\n<576f>  <30a9>\n<5770>  <30c3>\n<5771>  <30a5>\n<5772>  <30ee>\n<5773>  <30e3>\n<5774>  <30e7>\n<5775>  <30e5>\n<5776>  <30f7>\n<5777>  <30f9>\n<5778>  <30f8>\n<5779>  <30fa>\n<577a>  <30fc>\n<579c>  <2e80>\n<5800>  <2ef3>\n<6d65>  <4984>\n<7183>  <20ac>\n<7184>  <00a5>\n<7185>  <20ac>\n<7186>  <0024>\n<7187>  <303f>\nendbfchar\n\n100 beginbfrange\n<0001> <005f> <0020>\n<0060> <0062> <3000>\n<006d> <006e> <2018>\n<006f> <0070> <201c>\n<0071> <0072> <3014>\n<0073> <007a> <3008>\n<007b> <007c> <3016>\n<007d> <007e> <3010>\n<0083> <0084> <2227>\n<0099> <009a> <226e>\n<009b> <009c> <2264>\n<00a3> <00a4> <2032>\n<00a8> <00a9> <ffe0>\n<00ba> <00bb> <2190>\n<00be> <00d1> <2488>\n<00d2> <00e5> <2474>\n<00e6> <00ef> <2460>\n<00f0> <00f9> <3220>\n<00fa> <00ff> <2160>\n<0100> <0105> <2166>\n<0106> <0108> <ff01>\n<010a> <0162> <ff05>\n<0164> <01b6> <3041>\n<01b7> <01ff> <30a1>\n<0200> <020c> <30ea>\n<020d> <021d> <0391>\n<021e> <0224> <03a3>\n<0225> <0235> <03b1>\n<0236> <023c> <03c3>\n<0240> <0241> <ff1a>\n<0244> <0245> <fe35>\n<0246> <0247> <fe39>\n<0248> <0249> <fe3f>\n<024a> <024b> <fe3d>\n<024c> <024f> <fe41>\n<0250> <0251> <3016>\n<0252> <0253> <fe3b>\n<0254> <0255> <fe37>\n<0258> <0259> <fe33>\n<025a> <025f> <0410>\n<0261> <0280> <0416>\n<0282> <029b> <0436>\n<02bc> <02e0> <3105>\n<02e2> <02ff> <2500>\n<0300> <032d> <251e>\n<032e> <038b> <0021>\n<044f> <0450> <8fa8>\n<0b03> <0b04> <6478>\n<0d19> <0d1a> <820c>\n<108e> <108f> <8424>\n<11c0> <11c1> <81f3>\n<1291> <1292> <523f>\n<1318> <1319> <8ba6>\n<131b> <131c> <8bb4>\n<131e> <131f> <8bc2>\n<1323> <1325> <8bd2>\n<1327> <1328> <8bd8>\n<132a> <132b> <8bdf>\n<132d> <132e> <8be8>\n<1335> <1336> <8bff>\n<133c> <133d> <8c11>\n<133e> <1340> <8c14>\n<1345> <1347> <8c1f>\n<134a> <134b> <8c2a>\n<134c> <134d> <8c2e>\n<134e> <134f> <8c32>\n<1350> <1351> <8c35>\n<138e> <138f> <52ac>\n<13ac> <13ad> <572e>\n<13f6> <13f7> <82cb>\n<1411> <1412> <8314>\n<1417> <1418> <835b>\n<1432> <1433> <836d>\n<1436> <1437> <83b3>\n<145a> <145b> <83f8>\n<1467> <1468> <8487>\n<14ea> <14eb> <64b7>\n<1504> <1506> <5452>\n<1513> <1514> <549a>\n<1520> <1521> <54d3>\n<1528> <1529> <54d9>\n<152b> <152c> <54a9>\n<1537> <1538> <5522>\n<1549> <154b> <5575>\n<155c> <155d> <55bd>\n<1565> <1566> <55eb>\n<156d> <156e> <55f2>\n<156f> <1570> <55cc>\n<158d> <158e> <567b>\n<15a3> <15a4> <5e3b>\n<15b1> <15b2> <5c98>\n<15c4> <15c5> <5d02>\n<15f2> <15f3> <72b7>\n<1602> <1603> <72fa>\n<161e> <1623> <9967>\n<162c> <162d> <9990>\n<162e> <1630> <9993>\n<164c> <164d> <6005>\n<165c> <165d> <6078>\n<1689> <168a> <95f5>\nendbfrange\n\n100 beginbfrange\n<168d> <168e> <9603>\n<1691> <1694> <960a>\n<1697> <1699> <9615>\n<169a> <169b> <9619>\n<16a8> <16a9> <6c68>\n<16b1> <16b2> <6cf7>\n<16d6> <16d7> <6d93>\n<16f2> <16f3> <6e53>\n<1709> <170a> <6f46>\n<174f> <1750> <9035>\n<1754> <1755> <9051>\n<1778> <1779> <59a9>\n<1785> <1786> <5a05>\n<17bb> <17bc> <9a77>\n<17c0> <17c1> <9a80>\n<17c6> <17c7> <9a92>\n<17ca> <17cc> <9a9b>\n<17cd> <17ce> <9a9f>\n<17cf> <17d0> <9aa2>\n<17d7> <17d8> <7ea8>\n<17dc> <17de> <7ec0>\n<17e0> <17e1> <7ecb>\n<17e6> <17e7> <7ee0>\n<17ea> <17eb> <7eee>\n<17ec> <17ed> <7ef1>\n<17f0> <17f1> <7efa>\n<17f3> <17f5> <7f01>\n<17f6> <17f7> <7f07>\n<17f8> <17f9> <7f0b>\n<17fb> <17fc> <7f11>\n<1802> <1808> <7f21>\n<1809> <180c> <7f2a>\n<180d> <1811> <7f2f>\n<1843> <1844> <7480>\n<1848> <1849> <74a8>\n<184e> <1850> <97ea>\n<1876> <1877> <6832>\n<1878> <1879> <6860>\n<1892> <1893> <691f>\n<18a8> <18a9> <6987>\n<18bf> <18c0> <6a17>\n<18d6> <18d7> <6b81>\n<18da> <18db> <6b92>\n<18dd> <18de> <6b9a>\n<18e3> <18e5> <8f71>\n<18e6> <18e7> <8f75>\n<18ea> <18eb> <8f79>\n<18ee> <18ef> <8f81>\n<18f3> <18f5> <8f8d>\n<190a> <190c> <65ee>\n<1928> <1929> <66db>\n<192c> <192d> <8d32>\n<1932> <1933> <8d45>\n<1934> <1935> <8d48>\n<193b> <193d> <89ca>\n<193e> <1941> <89ce>\n<1947> <1948> <727e>\n<195e> <1960> <6c18>\n<197a> <197d> <80e7>\n<198a> <198b> <810d>\n<199a> <199b> <8159>\n<199f> <19a0> <817c>\n<19b7> <19b9> <98d1>\n<19bb> <19bc> <98d9>\n<19f6> <19f7> <6248>\n<19fc> <19fd> <795b>\n<1a26> <1a27> <7817>\n<1a2b> <1a2c> <781c>\n<1a2d> <1a2f> <7839>\n<1a38> <1a39> <7856>\n<1a56> <1a57> <9efb>\n<1a5c> <1a5d> <7707>\n<1a65> <1a66> <7750>\n<1a73> <1a74> <779f>\n<1a8e> <1a90> <9485>\n<1a93> <1a94> <948c>\n<1a95> <1a96> <948f>\n<1a9a> <1a9c> <949a>\n<1a9d> <1a9e> <94a3>\n<1aa3> <1aa4> <94af>\n<1aa7> <1aab> <94b6>\n<1aac> <1aad> <94bc>\n<1ab0> <1ab6> <94c8>\n<1ab7> <1ab9> <94d0>\n<1aba> <1abc> <94d5>\n<1ac0> <1ac2> <94de>\n<1ac4> <1ac5> <94e4>\n<1ac6> <1ac7> <94e7>\n<1acb> <1acc> <94ee>\n<1acd> <1acf> <94f3>\n<1ad2> <1ad3> <94fc>\n<1ad7> <1ad8> <9506>\n<1ad9> <1ada> <9509>\n<1adb> <1add> <950d>\n<1ade> <1ae2> <9512>\n<1ae5> <1ae7> <951d>\n<1ae9> <1aea> <952a>\n<1aed> <1aee> <9531>\n<1af0> <1af2> <9536>\n<1af4> <1af5> <953e>\nendbfrange\n\n100 beginbfrange\n<1af8> <1afa> <9544>\n<1afd> <1afe> <954e>\n<1b00> <1b01> <9553>\n<1b02> <1b05> <9556>\n<1b07> <1b08> <955e>\n<1b0a> <1b0b> <9561>\n<1b0c> <1b14> <9564>\n<1b16> <1b18> <9571>\n<1b37> <1b3b> <9e28>\n<1b41> <1b42> <9e39>\n<1b44> <1b45> <9e41>\n<1b47> <1b4a> <9e46>\n<1b4b> <1b4c> <9e4b>\n<1b51> <1b53> <9e5a>\n<1b56> <1b5c> <9e66>\n<1b67> <1b68> <75b3>\n<1b9a> <1b9b> <7a78>\n<1bd1> <1bd3> <8025>\n<1be4> <1be5> <988c>\n<1be8> <1be9> <989a>\n<1bea> <1beb> <989e>\n<1bec> <1bed> <98a1>\n<1bee> <1bef> <98a5>\n<1c0e> <1c0f> <86f1>\n<1c2f> <1c30> <877d>\n<1c60> <1c61> <7f44>\n<1c66> <1c67> <7b03>\n<1c85> <1c86> <7ba6>\n<1c96> <1c97> <7be5>\n<1ca6> <1ca7> <8201>\n<1cab> <1cad> <8221>\n<1cb4> <1cb5> <8233>\n<1cc7> <1cc8> <7faf>\n<1cd2> <1cd3> <7cbc>\n<1cd6> <1cd7> <7ccc>\n<1cfa> <1cfb> <914e>\n<1d02> <1d03> <917d>\n<1d0c> <1d0d> <91a2>\n<1d0f> <1d11> <91ad>\n<1d21> <1d22> <8dd6>\n<1d25> <1d26> <8dce>\n<1d2a> <1d2b> <8df7>\n<1d40> <1d41> <8e41>\n<1d42> <1d43> <8e51>\n<1d6f> <1d74> <9f85>\n<1d7a> <1d7b> <96bc>\n<1d8b> <1d8e> <9c85>\n<1d92> <1d94> <9c90>\n<1d95> <1d96> <9c94>\n<1d97> <1d98> <9c9a>\n<1d99> <1d9e> <9c9e>\n<1d9f> <1da3> <9ca5>\n<1da5> <1da6> <9cad>\n<1da7> <1dae> <9cb0>\n<1daf> <1db2> <9cba>\n<1db3> <1db6> <9cc4>\n<1db7> <1dbd> <9cca>\n<1dbe> <1dc0> <9cd3>\n<1dc1> <1dc3> <9cd7>\n<1dc4> <1dc5> <9cdc>\n<1dca> <1dcb> <9791>\n<1ddd> <1dde> <9acb>\n<1df9> <1dfa> <9ebd>\n<1dfd> <1dfe> <9e87>\n<1e04> <1e06> <9edb>\n<1e14> <1e15> <9f3d>\n<22f9> <22fa> <8a91>\n<239f> <23a0> <98ea>\n<23a9> <23ab> <9948>\n<2416> <2417> <9a43>\n<241e> <241f> <7d07>\n<249d> <249e> <8f1e>\n<24cc> <24cd> <98ae>\n<24f3> <24f5> <91d2>\n<2511> <2512> <926c>\n<2541> <2542> <9426>\n<254f> <2550> <9307>\n<2568> <2569> <93dc>\n<25af> <25b0> <7646>\n<25b4> <25b5> <766d>\n<25c6> <25c7> <980e>\n<263b> <263c> <9bea>\n<26a9> <26b2> <2170>\n<26b3> <26b4> <02ca>\n<26bc> <26bf> <2196>\n<26c4> <26c5> <2266>\n<26c7> <26ea> <2550>\n<26eb> <26f9> <2581>\n<26fa> <26fc> <2593>\n<26fd> <26fe> <25bc>\n<2700> <2702> <25e3>\n<2706> <2707> <301d>\n<2708> <2710> <3021>\n<2712> <2713> <338e>\n<2714> <2716> <339c>\n<271a> <271b> <33d1>\n<2724> <2725> <309b>\n<2726> <2727> <30fd>\n<2729> <272a> <309d>\n<272b> <2734> <fe49>\nendbfrange\n\n100 beginbfrange\n<2735> <2738> <fe54>\n<2739> <2746> <fe59>\n<2747> <274a> <fe68>\n<274c> <2757> <2ff0>\n<2759> <275b> <4e04>\n<275f> <2761> <4e1f>\n<2765> <2766> <4e2e>\n<276c> <276e> <4e40>\n<2775> <2776> <4e5a>\n<2777> <277a> <4e62>\n<277b> <277c> <4e67>\n<277d> <2782> <4e6a>\n<2784> <278d> <4e74>\n<278e> <2790> <4e7f>\n<2791> <2793> <4e83>\n<2797> <2798> <4e96>\n<279a> <279b> <4e9c>\n<279e> <27a0> <4eaf>\n<27a2> <27a5> <4eb6>\n<27a6> <27a8> <4ebc>\n<27ab> <27ac> <4ecf>\n<27ae> <27b0> <4eda>\n<27b3> <27b4> <4ee6>\n<27b6> <27b8> <4eed>\n<27bb> <27bd> <4ef8>\n<27c1> <27c7> <4f02>\n<27c8> <27c9> <4f0b>\n<27ca> <27ce> <4f12>\n<27cf> <27d0> <4f1c>\n<27d3> <27d4> <4f28>\n<27d5> <27d7> <4f2c>\n<27de> <27e2> <4f3e>\n<27e3> <27e4> <4f44>\n<27e5> <27ea> <4f47>\n<27ee> <27ef> <4f61>\n<27f2> <27f3> <4f6a>\n<27f4> <27f5> <4f6d>\n<27f6> <27f7> <4f71>\n<27f9> <27fc> <4f77>\n<27fe> <27ff> <4f80>\n<2807> <2808> <4f92>\n<280a> <280c> <4f98>\n<280e> <280f> <4f9e>\n<2810> <2811> <4fa1>\n<2815> <2819> <4fb0>\n<281a> <2822> <4fb6>\n<2823> <2824> <4fc0>\n<2825> <2828> <4fc6>\n<2829> <282b> <4fcb>\n<282c> <2830> <4fd2>\n<2834> <2835> <4fe4>\n<2837> <2838> <4feb>\n<283b> <283e> <4ff4>\n<2840> <2842> <4ffb>\n<2844> <2848> <5001>\n<2849> <284a> <5007>\n<284f> <2851> <5015>\n<2853> <2854> <501d>\n<2856> <2858> <5022>\n<285a> <2864> <502f>\n<2867> <286a> <503f>\n<286b> <286d> <5044>\n<286e> <286f> <504a>\n<2871> <2875> <5050>\n<2876> <2879> <5056>\n<287b> <2882> <505d>\n<2883> <2888> <5066>\n<2889> <288f> <506d>\n<2890> <2892> <5078>\n<2893> <2894> <507c>\n<2895> <2898> <5081>\n<2899> <289a> <5086>\n<289b> <289e> <5089>\n<289f> <28a6> <508e>\n<28a8> <28af> <509a>\n<28b2> <28b3> <50aa>\n<28b4> <28b7> <50ae>\n<28b9> <28ba> <50b8>\n<28bb> <28bc> <50bc>\n<28bd> <28bf> <50bf>\n<28c0> <28c1> <50c3>\n<28c2> <28c4> <50c6>\n<28c5> <28c9> <50ca>\n<28cb> <28cd> <50d2>\n<28ce> <28d0> <50d7>\n<28d1> <28d3> <50db>\n<28d4> <28d9> <50df>\n<28da> <28dc> <50e9>\n<28dd> <28e0> <50ef>\n<28e2> <28e4> <50f6>\n<28e6> <28e9> <50fc>\n<28ee> <28f1> <510c>\n<28f4> <28f5> <5116>\n<28f6> <28fb> <5119>\n<28fd> <28ff> <5122>\n<2900> <2904> <5125>\n<2905> <290b> <512b>\n<290c> <290f> <5133>\n<2910> <2911> <5138>\n<2912> <2913> <513d>\nendbfrange\n\n100 beginbfrange\n<2918> <291a> <514e>\n<291c> <291e> <5157>\n<2920> <2924> <515d>\n<2925> <2926> <5163>\n<2927> <2928> <5166>\n<292d> <292e> <517e>\n<292f> <2930> <5183>\n<2931> <2932> <5186>\n<2933> <2934> <518a>\n<2935> <2938> <518e>\n<2939> <293a> <5193>\n<293d> <293f> <519d>\n<2942> <2946> <51a6>\n<2947> <2948> <51ad>\n<294a> <294c> <51b8>\n<294d> <294e> <51be>\n<294f> <2951> <51c1>\n<2957> <295f> <51d2>\n<2961> <2962> <51de>\n<2963> <2964> <51e2>\n<2965> <296a> <51e5>\n<2971> <2972> <5204>\n<2974> <2975> <520b>\n<2976> <2977> <520f>\n<2978> <297a> <5213>\n<297c> <297d> <521e>\n<297e> <2980> <5221>\n<2981> <2983> <5225>\n<2987> <2988> <5231>\n<2989> <298a> <5234>\n<298d> <298e> <5245>\n<298f> <2990> <5248>\n<2991> <2992> <524e>\n<2993> <2994> <5252>\n<2996> <2999> <5257>\n<299b> <299c> <525f>\n<299d> <299f> <5262>\n<29a2> <29a4> <526b>\n<29a5> <29a6> <5270>\n<29a8> <29ae> <5276>\n<29b1> <29b3> <5284>\n<29b5> <29b6> <528e>\n<29b8> <29be> <5294>\n<29c0> <29c3> <52a4>\n<29c4> <29c6> <52ae>\n<29c7> <29d0> <52b4>\n<29d3> <29d5> <52c4>\n<29d8> <29db> <52cc>\n<29dd> <29de> <52d3>\n<29e2> <29e3> <52e0>\n<29e5> <29ef> <52e5>\n<29f0> <29f2> <52f2>\n<29f3> <29f4> <52f6>\n<29f5> <29f7> <52fb>\n<29f8> <29fb> <5301>\n<29fd> <29ff> <5309>\n<2a02> <2a05> <5311>\n<2a07> <2a08> <531b>\n<2a09> <2a0a> <531e>\n<2a0c> <2a0d> <5324>\n<2a0e> <2a10> <5327>\n<2a11> <2a12> <532b>\n<2a14> <2a1a> <5332>\n<2a1b> <2a1c> <533c>\n<2a20> <2a22> <534b>\n<2a24> <2a25> <5358>\n<2a2b> <2a2c> <536c>\n<2a30> <2a33> <537b>\n<2a34> <2a35> <5380>\n<2a37> <2a38> <5387>\n<2a3a> <2a40> <538e>\n<2a41> <2a42> <5396>\n<2a43> <2a44> <539b>\n<2a49> <2a4b> <53aa>\n<2a4c> <2a4e> <53af>\n<2a51> <2a54> <53b7>\n<2a55> <2a57> <53bc>\n<2a59> <2a5c> <53c4>\n<2a5d> <2a5f> <53ce>\n<2a60> <2a61> <53d2>\n<2a64> <2a66> <53dc>\n<2a6b> <2a6d> <53fe>\n<2a73> <2a75> <5418>\n<2a78> <2a79> <5424>\n<2a7d> <2a7e> <5436>\n<2a82> <2a83> <5441>\n<2a84> <2a85> <5444>\n<2a88> <2a8b> <544c>\n<2a8e> <2a92> <545d>\n<2a96> <2a9d> <5469>\n<2a9f> <2aa0> <5479>\n<2aa1> <2aa2> <547e>\n<2aa6> <2aa9> <5487>\n<2aad> <2aae> <5497>\n<2ab0> <2ab4> <549e>\n<2ab9> <2abb> <54b5>\n<2abc> <2abd> <54b9>\n<2ac1> <2ac2> <54ca>\n<2ac7> <2ac9> <54e2>\n<2aca> <2acb> <54eb>\nendbfrange\n\n100 beginbfrange\n<2acc> <2ace> <54ef>\n<2acf> <2ad4> <54f4>\n<2ad8> <2ad9> <5502>\n<2adc> <2ae0> <550a>\n<2ae1> <2ae2> <5512>\n<2ae3> <2ae8> <5515>\n<2ae9> <2aec> <551c>\n<2aee> <2aef> <5525>\n<2af0> <2af1> <5528>\n<2af5> <2af7> <5534>\n<2af8> <2afb> <5538>\n<2b00> <2b01> <5547>\n<2b02> <2b05> <554b>\n<2b06> <2b07> <5551>\n<2b09> <2b0d> <5557>\n<2b0f> <2b10> <555f>\n<2b11> <2b12> <5562>\n<2b13> <2b14> <5568>\n<2b16> <2b1b> <556f>\n<2b1c> <2b1d> <5579>\n<2b20> <2b21> <5585>\n<2b22> <2b24> <558c>\n<2b26> <2b27> <5592>\n<2b28> <2b2a> <5595>\n<2b2b> <2b2c> <559a>\n<2b2e> <2b34> <55a0>\n<2b35> <2b36> <55a8>\n<2b39> <2b3a> <55af>\n<2b40> <2b44> <55bf>\n<2b46> <2b47> <55ca>\n<2b48> <2b49> <55cf>\n<2b4b> <2b4d> <55d7>\n<2b53> <2b54> <55ed>\n<2b55> <2b56> <55f0>\n<2b58> <2b5c> <55f8>\n<2b5e> <2b61> <5602>\n<2b63> <2b64> <560a>\n<2b65> <2b68> <5610>\n<2b6a> <2b6b> <5619>\n<2b6d> <2b6f> <5620>\n<2b70> <2b71> <5625>\n<2b73> <2b74> <562a>\n<2b78> <2b7a> <563c>\n<2b7c> <2b85> <5642>\n<2b86> <2b8a> <564f>\n<2b8b> <2b8c> <5655>\n<2b8d> <2b8e> <565a>\n<2b8f> <2b90> <565e>\n<2b94> <2b95> <566d>\n<2b9b> <2b9d> <567d>\n<2b9e> <2ba1> <5681>\n<2ba2> <2ba5> <5688>\n<2ba7> <2ba9> <5690>\n<2bab> <2bad> <5696>\n<2bae> <2bb6> <569a>\n<2bb7> <2bb8> <56a4>\n<2bba> <2bbe> <56a9>\n<2bbf> <2bc1> <56b0>\n<2bc3> <2bc6> <56b8>\n<2bc7> <2bc9> <56bd>\n<2bca> <2bcb> <56c3>\n<2bcc> <2bcd> <56c6>\n<2bcf> <2bd2> <56cd>\n<2bd3> <2bd4> <56d2>\n<2bd5> <2bd6> <56d5>\n<2bd7> <2bd8> <56d8>\n<2bdb> <2be0> <56e5>\n<2be2> <2be3> <56ee>\n<2be4> <2be5> <56f2>\n<2be6> <2be8> <56f6>\n<2be9> <2bea> <56fb>\n<2beb> <2bed> <5700>\n<2bf0> <2bf3> <570e>\n<2bf4> <2bf5> <5714>\n<2bf7> <2bf9> <5719>\n<2bfa> <2bfb> <571d>\n<2bfc> <2bfe> <5720>\n<2c00> <2c02> <5725>\n<2c04> <2c05> <5731>\n<2c06> <2c0a> <5734>\n<2c0b> <2c0c> <573c>\n<2c0f> <2c12> <5743>\n<2c13> <2c14> <5748>\n<2c16> <2c1a> <5752>\n<2c1b> <2c1c> <5758>\n<2c1d> <2c1e> <5762>\n<2c23> <2c25> <5770>\n<2c26> <2c27> <5774>\n<2c28> <2c2a> <5778>\n<2c2b> <2c2f> <577d>\n<2c30> <2c33> <5787>\n<2c34> <2c38> <578d>\n<2c39> <2c3f> <5794>\n<2c40> <2c43> <579c>\n<2c48> <2c4a> <57af>\n<2c4c> <2c4e> <57b5>\n<2c4f> <2c57> <57b9>\n<2c58> <2c5e> <57c4>\n<2c5f> <2c60> <57cc>\n<2c61> <2c62> <57d0>\nendbfrange\n\n100 beginbfrange\n<2c64> <2c65> <57d6>\n<2c66> <2c67> <57db>\n<2c69> <2c6a> <57e2>\n<2c6b> <2c72> <57e5>\n<2c74> <2c77> <57f0>\n<2c78> <2c79> <57f5>\n<2c7a> <2c7b> <57fb>\n<2c7c> <2c7d> <57fe>\n<2c7f> <2c80> <5803>\n<2c81> <2c82> <5808>\n<2c84> <2c86> <580e>\n<2c87> <2c89> <5812>\n<2c8a> <2c8b> <5817>\n<2c8c> <2c8e> <581a>\n<2c90> <2c91> <5822>\n<2c92> <2c96> <5825>\n<2c97> <2c9a> <582b>\n<2c9b> <2c9c> <5832>\n<2c9d> <2caa> <5836>\n<2cab> <2caf> <5845>\n<2cb3> <2cb4> <5855>\n<2cb5> <2cb9> <5859>\n<2cba> <2cbc> <585f>\n<2cbe> <2cc2> <5866>\n<2cc3> <2cca> <586d>\n<2ccb> <2ccd> <5876>\n<2cce> <2cd1> <587a>\n<2cd5> <2cd7> <5886>\n<2cd8> <2cde> <588b>\n<2cdf> <2ce3> <5894>\n<2ce6> <2ced> <58a0>\n<2cee> <2cf1> <58aa>\n<2cf2> <2cf5> <58af>\n<2cf6> <2cfc> <58b4>\n<2cfe> <2cff> <58bf>\n<2d00> <2d02> <58c2>\n<2d04> <2d0c> <58c8>\n<2d0f> <2d10> <58d6>\n<2d11> <2d13> <58db>\n<2d16> <2d19> <58e5>\n<2d1c> <2d1d> <58f1>\n<2d1e> <2d1f> <58f4>\n<2d20> <2d21> <58f7>\n<2d22> <2d23> <58fb>\n<2d24> <2d27> <58fe>\n<2d29> <2d2a> <5905>\n<2d2b> <2d2f> <5908>\n<2d31> <2d34> <5910>\n<2d35> <2d36> <5917>\n<2d38> <2d39> <591d>\n<2d3a> <2d3b> <5920>\n<2d41> <2d42> <5932>\n<2d43> <2d44> <5935>\n<2d47> <2d48> <593f>\n<2d4a> <2d4b> <5945>\n<2d4d> <2d4e> <594c>\n<2d50> <2d51> <5952>\n<2d53> <2d57> <595b>\n<2d59> <2d5a> <5963>\n<2d5b> <2d5d> <5966>\n<2d60> <2d63> <596f>\n<2d66> <2d68> <597a>\n<2d69> <2d6b> <597e>\n<2d6e> <2d6f> <598b>\n<2d70> <2d73> <598e>\n<2d74> <2d75> <5994>\n<2d77> <2d79> <599a>\n<2d7a> <2d7d> <599f>\n<2d7e> <2d7f> <59a6>\n<2d80> <2d81> <59ac>\n<2d82> <2d83> <59b0>\n<2d84> <2d89> <59b3>\n<2d8b> <2d8c> <59bc>\n<2d8d> <2d93> <59bf>\n<2d94> <2d96> <59c7>\n<2d97> <2d9a> <59cc>\n<2d9b> <2d9c> <59d5>\n<2d9f> <2da3> <59de>\n<2da5> <2da6> <59e6>\n<2da7> <2da9> <59e9>\n<2daa> <2db5> <59ed>\n<2db7> <2db9> <59fc>\n<2dbc> <2dbd> <5a0a>\n<2dbe> <2dc1> <5a0d>\n<2dc3> <2dc6> <5a14>\n<2dc7> <2dc9> <5a19>\n<2dca> <2dcb> <5a1d>\n<2dcc> <2dcd> <5a21>\n<2dcf> <2dd1> <5a26>\n<2dd2> <2dd8> <5a2a>\n<2ddb> <2ddf> <5a37>\n<2de0> <2de2> <5a3d>\n<2de3> <2de6> <5a42>\n<2de7> <2de8> <5a47>\n<2de9> <2df2> <5a4b>\n<2df3> <2df6> <5a56>\n<2df7> <2dfd> <5a5b>\n<2dfe> <2dff> <5a63>\n<2e01> <2e02> <5a68>\n<2e03> <2e04> <5a6b>\nendbfrange\n\n100 beginbfrange\n<2e05> <2e0a> <5a6e>\n<2e0b> <2e0c> <5a78>\n<2e0d> <2e10> <5a7b>\n<2e11> <2e22> <5a80>\n<2e23> <2e29> <5a93>\n<2e2a> <2e34> <5a9c>\n<2e35> <2e36> <5aa8>\n<2e37> <2e3d> <5aab>\n<2e3f> <2e40> <5ab6>\n<2e41> <2e44> <5ab9>\n<2e45> <2e46> <5abf>\n<2e47> <2e4c> <5ac3>\n<2e4d> <2e4e> <5aca>\n<2e4f> <2e53> <5acd>\n<2e56> <2e58> <5ad9>\n<2e59> <2e5b> <5add>\n<2e5d> <2e5e> <5ae4>\n<2e5f> <2e60> <5ae7>\n<2e62> <2e66> <5aec>\n<2e67> <2e69> <5af2>\n<2e6a> <2e6e> <5af6>\n<2e6f> <2e72> <5afc>\n<2e73> <2e79> <5b01>\n<2e7b> <2e83> <5b0d>\n<2e85> <2e8b> <5b1a>\n<2e8c> <2e93> <5b22>\n<2e94> <2e98> <5b2b>\n<2e9b> <2e9c> <5b35>\n<2e9d> <2ea3> <5b39>\n<2ea4> <2eae> <5b41>\n<2eaf> <2eb1> <5b4d>\n<2eb5> <2eb6> <5b60>\n<2eb7> <2eb8> <5b67>\n<2eb9> <2ebb> <5b6d>\n<2ebe> <2ebf> <5b76>\n<2ec1> <2ec2> <5b7b>\n<2ec7> <2ec8> <5b8d>\n<2ec9> <2ecb> <5b90>\n<2ecf> <2ed1> <5ba7>\n<2ed2> <2ed5> <5bac>\n<2ed6> <2ed7> <5bb1>\n<2ed9> <2edb> <5bba>\n<2edc> <2edd> <5bc0>\n<2edf> <2ee2> <5bc8>\n<2ee3> <2ee5> <5bcd>\n<2ee7> <2eef> <5bd4>\n<2ef5> <2ef8> <5bf1>\n<2efa> <2efb> <5bfd>\n<2efd> <2efe> <5c02>\n<2f02> <2f03> <5c12>\n<2f07> <2f0a> <5c1e>\n<2f0d> <2f10> <5c28>\n<2f11> <2f14> <5c2d>\n<2f15> <2f16> <5c32>\n<2f17> <2f18> <5c35>\n<2f19> <2f1a> <5c43>\n<2f1b> <2f1c> <5c46>\n<2f1d> <2f1e> <5c4c>\n<2f1f> <2f21> <5c52>\n<2f22> <2f24> <5c56>\n<2f25> <2f28> <5c5a>\n<2f2b> <2f2d> <5c69>\n<2f30> <2f36> <5c72>\n<2f37> <2f3a> <5c7b>\n<2f3c> <2f40> <5c83>\n<2f41> <2f43> <5c89>\n<2f44> <2f45> <5c8e>\n<2f46> <2f47> <5c92>\n<2f49> <2f4c> <5c9d>\n<2f4d> <2f51> <5ca4>\n<2f53> <2f55> <5cae>\n<2f59> <2f5c> <5cb9>\n<2f5f> <2f60> <5cc2>\n<2f61> <2f66> <5cc5>\n<2f67> <2f6c> <5ccc>\n<2f6d> <2f72> <5cd3>\n<2f73> <2f79> <5cda>\n<2f7a> <2f7b> <5ce2>\n<2f7e> <2f7f> <5ceb>\n<2f80> <2f81> <5cee>\n<2f82> <2f84> <5cf1>\n<2f86> <2f89> <5cf7>\n<2f8b> <2f8e> <5cfe>\n<2f8f> <2f90> <5d04>\n<2f91> <2f95> <5d08>\n<2f96> <2f9a> <5d0f>\n<2f9c> <2f9e> <5d18>\n<2f9f> <2fa0> <5d1c>\n<2fa1> <2fa5> <5d1f>\n<2fa8> <2fa9> <5d2a>\n<2faa> <2fae> <5d2f>\n<2faf> <2fb6> <5d35>\n<2fb7> <2fbe> <5d3f>\n<2fbf> <2fc0> <5d48>\n<2fc1> <2fc3> <5d4d>\n<2fc4> <2fca> <5d51>\n<2fcb> <2fcc> <5d59>\n<2fce> <2fd8> <5d5e>\n<2fda> <2fdb> <5d6d>\n<2fdc> <2fdf> <5d70>\nendbfrange\n\n100 beginbfrange\n<2fe0> <2feb> <5d75>\n<2fed> <2fee> <5d85>\n<2fef> <2ffd> <5d88>\n<3000> <3001> <5d9b>\n<3002> <3003> <5d9e>\n<3004> <3009> <5da1>\n<300a> <3018> <5da8>\n<301b> <3022> <5dbd>\n<3023> <3027> <5dc6>\n<3029> <302c> <5dce>\n<302e> <3033> <5dd5>\n<3035> <3036> <5ddf>\n<3037> <3038> <5de3>\n<303a> <303b> <5dec>\n<303c> <303d> <5df5>\n<303e> <3042> <5df8>\n<3043> <3044> <5dff>\n<3047> <3049> <5e09>\n<304a> <304b> <5e0d>\n<304c> <304d> <5e12>\n<304f> <3055> <5e1e>\n<3056> <3058> <5e28>\n<305a> <305b> <5e2f>\n<305d> <305e> <5e34>\n<305f> <3060> <5e39>\n<3061> <3062> <5e3e>\n<3064> <3069> <5e46>\n<306a> <3070> <5e4d>\n<3072> <3073> <5e59>\n<3074> <3075> <5e5c>\n<3077> <307d> <5e64>\n<307e> <3082> <5e6d>\n<3085> <3087> <5e81>\n<3089> <308a> <5e88>\n<308b> <308d> <5e8c>\n<3092> <3095> <5ea1>\n<3096> <3098> <5ea8>\n<309a> <309e> <5eae>\n<30a0> <30a3> <5eba>\n<30a4> <30ad> <5ebf>\n<30ae> <30b3> <5ecb>\n<30b4> <30b5> <5ed4>\n<30b6> <30b9> <5ed7>\n<30ba> <30bc> <5edc>\n<30bd> <30c0> <5ee4>\n<30c3> <30c8> <5eed>\n<30ca> <30cb> <5ef8>\n<30cc> <30ce> <5efb>\n<30cf> <30d1> <5f05>\n<30d3> <30d5> <5f0c>\n<30da> <30db> <5f19>\n<30dc> <30de> <5f1c>\n<30df> <30e2> <5f21>\n<30e4> <30e5> <5f2b>\n<30ea> <30ec> <5f36>\n<30ee> <30f0> <5f3d>\n<30f1> <30f5> <5f41>\n<30f7> <30f9> <5f49>\n<30fe> <30ff> <5f5a>\n<3101> <3103> <5f5e>\n<3106> <3107> <5f67>\n<3109> <310a> <5f6e>\n<310c> <310e> <5f74>\n<3111> <3113> <5f7d>\n<3116> <3118> <5f8d>\n<3119> <311a> <5f93>\n<311c> <311d> <5f9a>\n<3120> <3125> <5fa2>\n<3126> <3127> <5fab>\n<3128> <312d> <5faf>\n<3130> <3131> <5fba>\n<3132> <3136> <5fbe>\n<3137> <3138> <5fc7>\n<3139> <313a> <5fca>\n<313c> <313e> <5fd3>\n<313f> <3141> <5fda>\n<3142> <3143> <5fde>\n<3144> <3145> <5fe2>\n<3146> <3147> <5fe5>\n<3148> <3149> <5fe8>\n<314b> <314c> <5fef>\n<314d> <314f> <5ff2>\n<3150> <3151> <5ff6>\n<3152> <3153> <5ff9>\n<3155> <3157> <6007>\n<3158> <3159> <600b>\n<315a> <315b> <6010>\n<315d> <315e> <6017>\n<3160> <3161> <601e>\n<3162> <3164> <6022>\n<3165> <3167> <602c>\n<3168> <316c> <6030>\n<316d> <3171> <6036>\n<3172> <3173> <603d>\n<3175> <317b> <6044>\n<317d> <317e> <604e>\n<3180> <3181> <6053>\n<3182> <3184> <6056>\n<3185> <3186> <605b>\n<3187> <318a> <605e>\nendbfrange\n\n100 beginbfrange\n<318b> <318c> <6065>\n<318e> <318f> <6071>\n<3190> <3191> <6074>\n<3194> <3196> <6080>\n<3197> <319a> <6085>\n<319b> <319c> <608a>\n<319d> <31a0> <608e>\n<31a3> <31a5> <6097>\n<31a8> <31a9> <60a1>\n<31aa> <31ab> <60a4>\n<31ad> <31ae> <60a9>\n<31b3> <31b4> <60b9>\n<31b5> <31bc> <60bd>\n<31bd> <31bf> <60c7>\n<31c0> <31c4> <60cc>\n<31c5> <31c7> <60d2>\n<31c8> <31c9> <60d6>\n<31cd> <31d0> <60e2>\n<31d3> <31d4> <60f7>\n<31d5> <31d8> <60fc>\n<31d9> <31dc> <6102>\n<31de> <31e0> <610a>\n<31e1> <31e5> <6110>\n<31e6> <31e9> <6116>\n<31ea> <31eb> <611d>\n<31ec> <31ed> <6121>\n<31ef> <31f1> <6128>\n<31f2> <31f9> <612c>\n<31fa> <31fb> <6135>\n<31fc> <31ff> <6138>\n<3200> <3201> <613c>\n<3202> <3209> <6140>\n<320c> <320d> <614f>\n<320e> <3210> <6152>\n<3211> <3212> <6156>\n<3214> <3215> <615b>\n<3217> <3218> <6160>\n<3219> <321a> <6165>\n<321c> <321d> <616c>\n<321f> <3220> <6171>\n<3222> <322b> <6178>\n<322c> <3232> <6183>\n<3233> <3234> <618c>\n<3237> <323b> <6195>\n<323c> <323d> <619b>\n<323e> <3243> <619e>\n<3244> <3245> <61a5>\n<3248> <324a> <61af>\n<324b> <324d> <61b3>\n<324e> <3253> <61b8>\n<3254> <3256> <61bf>\n<3257> <325a> <61c3>\n<325b> <325e> <61cd>\n<3260> <3268> <61d5>\n<3269> <326b> <61e0>\n<326c> <326d> <61e4>\n<326f> <3277> <61e9>\n<3278> <3279> <61f3>\n<327d> <3281> <6201>\n<3285> <3287> <621c>\n<328b> <328c> <6228>\n<3291> <3292> <6235>\n<3293> <3297> <6238>\n<3299> <329b> <6244>\n<329d> <329e> <624f>\n<329f> <32a1> <6255>\n<32a2> <32a3> <6259>\n<32a4> <32aa> <625c>\n<32ab> <32ac> <6264>\n<32ae> <32af> <6271>\n<32b0> <32b1> <6274>\n<32b2> <32b3> <6277>\n<32b4> <32b5> <627a>\n<32b7> <32b9> <6281>\n<32ba> <32bd> <6285>\n<32be> <32c3> <628b>\n<32c6> <32c8> <629c>\n<32ca> <32cb> <62a6>\n<32cc> <32cd> <62a9>\n<32ce> <32d1> <62ad>\n<32d2> <32d4> <62b2>\n<32d5> <32d7> <62b6>\n<32da> <32db> <62c0>\n<32e1> <32e2> <62dd>\n<32e3> <32e4> <62e0>\n<32e6> <32e7> <62ea>\n<32eb> <32ee> <62f8>\n<32f0> <32f3> <6303>\n<32f4> <32f7> <630a>\n<32f8> <32f9> <630f>\n<32fa> <32fd> <6312>\n<32fe> <32ff> <6317>\n<3302> <3303> <6326>\n<3305> <3307> <632c>\n<3308> <3309> <6330>\n<330a> <330f> <6333>\n<3310> <3311> <633b>\n<3312> <3314> <633f>\n<3316> <3317> <6347>\n<3319> <331c> <6351>\nendbfrange\n\n100 beginbfrange\n<331d> <3324> <6356>\n<3326> <3328> <6364>\n<332b> <332c> <636f>\n<332d> <332f> <6373>\n<3330> <3331> <6378>\n<3332> <3335> <637c>\n<3337> <3338> <6385>\n<333c> <333e> <6393>\n<3340> <3346> <6399>\n<334c> <334d> <63b1>\n<334e> <334f> <63b5>\n<3354> <3356> <63c1>\n<3358> <3359> <63c7>\n<335a> <335c> <63ca>\n<335e> <3360> <63d3>\n<3361> <3363> <63d7>\n<3364> <3366> <63db>\n<3369> <336d> <63e4>\n<336e> <336f> <63eb>\n<3370> <3372> <63ef>\n<3376> <3379> <63f9>\n<337b> <337c> <6403>\n<337d> <3381> <6406>\n<3383> <3384> <6411>\n<3385> <3386> <6415>\n<3387> <3389> <6418>\n<338c> <338f> <6422>\n<3390> <3392> <6427>\n<3394> <3399> <642e>\n<339b> <339d> <6437>\n<339e> <339f> <643b>\n<33a2> <33a3> <6442>\n<33a5> <33aa> <644b>\n<33ac> <33ae> <6455>\n<33af> <33b1> <6459>\n<33b3> <33b9> <6460>\n<33bb> <33bd> <646a>\n<33bf> <33c1> <6470>\n<33c2> <33c3> <6474>\n<33c5> <33ca> <647c>\n<33cd> <33d4> <6489>\n<33d6> <33d7> <6497>\n<33d8> <33db> <649a>\n<33dc> <33de> <64a0>\n<33df> <33e1> <64a6>\n<33eb> <33ec> <64c8>\n<33f1> <33f2> <64d5>\n<33f4> <33f6> <64db>\n<33fb> <33ff> <64e7>\n<3400> <3401> <64ed>\n<3403> <3404> <64f5>\n<3405> <3406> <64f8>\n<3409> <340b> <6501>\n<340d> <340e> <6507>\n<340f> <3413> <650a>\n<3414> <3415> <6510>\n<341b> <341e> <651e>\n<341f> <3422> <6526>\n<3424> <3427> <6530>\n<342a> <342b> <653c>\n<342c> <3430> <6540>\n<3431> <3432> <6546>\n<3433> <3434> <654a>\n<3435> <3436> <654d>\n<3438> <343a> <6552>\n<343e> <3440> <655f>\n<3441> <3442> <6564>\n<3443> <3446> <6567>\n<3447> <3449> <656d>\n<344d> <3455> <6579>\n<3456> <3458> <6584>\n<3459> <345b> <6588>\n<345c> <345e> <658d>\n<3464> <3465> <659d>\n<3467> <3468> <65a2>\n<346d> <3472> <65b1>\n<3474> <3475> <65ba>\n<3476> <3478> <65be>\n<347a> <347d> <65c7>\n<347f> <3480> <65d0>\n<3481> <3483> <65d3>\n<3484> <348b> <65d8>\n<348d> <348e> <65e3>\n<348f> <3490> <65ea>\n<3491> <3494> <65f2>\n<3495> <3496> <65f8>\n<3497> <349b> <65fb>\n<349d> <349e> <6604>\n<349f> <34a1> <6607>\n<34a4> <34a6> <6610>\n<34a7> <34a9> <6616>\n<34aa> <34ac> <661a>\n<34ae> <34b1> <6621>\n<34b3> <34b6> <6629>\n<34b9> <34ba> <6632>\n<34bb> <34bf> <6637>\n<34c1> <34c2> <663f>\n<34c3> <34c9> <6644>\n<34ca> <34cb> <664d>\n<34cc> <34cd> <6650>\nendbfrange\n\n100 beginbfrange\n<34ce> <34cf> <6658>\n<34d0> <34d1> <665b>\n<34d4> <34d5> <6662>\n<34d8> <34dc> <6669>\n<34dd> <34df> <6671>\n<34e1> <34e2> <6678>\n<34e3> <34e5> <667b>\n<34e6> <34e8> <667f>\n<34ea> <34eb> <6685>\n<34ec> <34ed> <668a>\n<34ee> <34f1> <668d>\n<34f2> <34f5> <6692>\n<34f6> <34fa> <6698>\n<34fb> <34fe> <669e>\n<3500> <3502> <66a4>\n<3503> <3504> <66a9>\n<3505> <3506> <66ac>\n<3507> <350b> <66af>\n<350c> <350f> <66b5>\n<3510> <3513> <66ba>\n<3514> <3518> <66bf>\n<351b> <3526> <66ca>\n<3527> <3528> <66d7>\n<352a> <352b> <66de>\n<352c> <3530> <66e1>\n<3531> <3532> <66e7>\n<3533> <3534> <66ea>\n<3535> <3537> <66ed>\n<3539> <353a> <66f5>\n<353b> <353c> <66fa>\n<353e> <353f> <6701>\n<3540> <3543> <6704>\n<3545> <3546> <670e>\n<3547> <3549> <6711>\n<354b> <354d> <6718>\n<3550> <3555> <6720>\n<3559> <355a> <6732>\n<355b> <355e> <6736>\n<355f> <3560> <673b>\n<3561> <3562> <673e>\n<3564> <3565> <6744>\n<3567> <3568> <674a>\n<356b> <356c> <6754>\n<356d> <3571> <6757>\n<3573> <3575> <6762>\n<3576> <3577> <6766>\n<3578> <3579> <676b>\n<357d> <3580> <6778>\n<3583> <3584> <6782>\n<3585> <3586> <6785>\n<3589> <358c> <678c>\n<358d> <3590> <6791>\n<3594> <3596> <679f>\n<359c> <359d> <67b1>\n<359f> <35a6> <67b9>\n<35a8> <35b1> <67c5>\n<35b2> <35b4> <67d5>\n<35b8> <35b9> <67e3>\n<35ba> <35bc> <67e6>\n<35bd> <35be> <67ea>\n<35bf> <35c0> <67ed>\n<35c2> <35c9> <67f5>\n<35cb> <35ce> <6801>\n<35d3> <35d4> <6814>\n<35d5> <35d9> <6818>\n<35da> <35dc> <681e>\n<35dd> <35e3> <6822>\n<35e4> <35ea> <682b>\n<35eb> <35ed> <6834>\n<35ee> <35ef> <683a>\n<35f6> <35ff> <6856>\n<3601> <3608> <686c>\n<360a> <3612> <6878>\n<3615> <361c> <6887>\n<361d> <361f> <6890>\n<3620> <3622> <6894>\n<3623> <3626> <6899>\n<3628> <3629> <68a0>\n<362a> <362c> <68a3>\n<362d> <3630> <68a9>\n<3632> <3633> <68b1>\n<3635> <363e> <68b6>\n<3640> <3645> <68c3>\n<3648> <364b> <68ce>\n<364c> <364d> <68d3>\n<364f> <3652> <68db>\n<3653> <3654> <68e1>\n<3655> <3657> <68e4>\n<3658> <365d> <68e8>\n<365f> <3661> <68f2>\n<3662> <3664> <68f6>\n<3666> <3669> <68fd>\n<366a> <366c> <6902>\n<366d> <3671> <6906>\n<3674> <367f> <6913>\n<3680> <3682> <6921>\n<3683> <368a> <6925>\n<368b> <368c> <692e>\n<368d> <368f> <6931>\n<3690> <3693> <6935>\nendbfrange\n\n100 beginbfrange\n<3694> <3696> <693a>\n<3698> <3699> <6940>\n<369a> <36a0> <6943>\n<36a1> <36a8> <694b>\n<36a9> <36aa> <6955>\n<36ab> <36ac> <6958>\n<36ad> <36ae> <695b>\n<36b0> <36b1> <6961>\n<36b2> <36b3> <6964>\n<36b5> <36b6> <6969>\n<36b8> <36b9> <696f>\n<36ba> <36bc> <6972>\n<36be> <36bf> <697a>\n<36c0> <36c2> <697d>\n<36c6> <36c8> <698a>\n<36c9> <36ce> <698e>\n<36cf> <36d0> <6996>\n<36d1> <36d2> <6999>\n<36d3> <36dc> <699d>\n<36df> <36e0> <69af>\n<36e1> <36e2> <69b2>\n<36e3> <36e4> <69b5>\n<36e5> <36e7> <69b8>\n<36e8> <36ea> <69bc>\n<36ec> <36f3> <69c2>\n<36f5> <36f7> <69d1>\n<36f8> <36fd> <69d5>\n<36fe> <36ff> <69dc>\n<3701> <3706> <69e1>\n<3707> <370b> <69e8>\n<370c> <370f> <69ee>\n<3710> <3718> <69f4>\n<371b> <371c> <6a03>\n<371d> <3720> <6a06>\n<3721> <3728> <6a0b>\n<3729> <372b> <6a14>\n<372c> <372f> <6a1a>\n<3732> <3735> <6a24>\n<3737> <373a> <6a2b>\n<373c> <373e> <6a32>\n<373f> <3740> <6a36>\n<3741> <3742> <6a3b>\n<3743> <3747> <6a3f>\n<3748> <3749> <6a45>\n<374a> <374b> <6a49>\n<374c> <374f> <6a4c>\n<3750> <3756> <6a51>\n<3758> <375a> <6a5c>\n<375c> <375d> <6a63>\n<375e> <3768> <6a66>\n<3769> <376f> <6a72>\n<3770> <3771> <6a7a>\n<3772> <3774> <6a7d>\n<3775> <3777> <6a81>\n<3778> <377b> <6a85>\n<377c> <377f> <6a8a>\n<3781> <3782> <6a92>\n<3783> <3784> <6a95>\n<3785> <3788> <6a98>\n<3789> <378b> <6a9d>\n<378d> <3791> <6aa4>\n<3793> <3794> <6aad>\n<3795> <3797> <6ab0>\n<3798> <379b> <6ab4>\n<379c> <379d> <6ab9>\n<379e> <37a4> <6abc>\n<37a5> <37b3> <6ac4>\n<37b4> <37b9> <6ad4>\n<37bb> <37c1> <6ae0>\n<37c4> <37c9> <6aed>\n<37ca> <37cd> <6af4>\n<37ce> <37cf> <6af9>\n<37d0> <37d7> <6afc>\n<37d8> <37dc> <6b05>\n<37dd> <37e0> <6b0b>\n<37e1> <37e2> <6b10>\n<37e3> <37e5> <6b13>\n<37e6> <37ec> <6b17>\n<37ee> <37ef> <6b25>\n<37f0> <37f9> <6b28>\n<37fa> <37fd> <6b33>\n<3801> <3804> <6b3f>\n<3805> <3806> <6b44>\n<3808> <3809> <6b4a>\n<380a> <380c> <6b4d>\n<380d> <3814> <6b51>\n<3815> <3819> <6b5a>\n<381b> <381c> <6b68>\n<381d> <3823> <6b6b>\n<3824> <3827> <6b73>\n<3829> <382c> <6b7d>\n<3830> <3833> <6b8e>\n<3834> <3835> <6b94>\n<3838> <3839> <6b9c>\n<383a> <383b> <6b9f>\n<383c> <383d> <6ba2>\n<383e> <3842> <6ba5>\n<3843> <3844> <6bac>\n<3845> <3846> <6bb0>\n<3848> <3849> <6bb8>\nendbfrange\n\n100 beginbfrange\n<384a> <384c> <6bbc>\n<384e> <384f> <6bc3>\n<3850> <3853> <6bc7>\n<3856> <3857> <6bd0>\n<385a> <385e> <6bdc>\n<385f> <3866> <6be2>\n<3867> <3869> <6bec>\n<386a> <386c> <6bf0>\n<386e> <3870> <6bf6>\n<3871> <3873> <6bfa>\n<3875> <3879> <6c00>\n<387a> <387c> <6c09>\n<3880> <3882> <6c1c>\n<3888> <3889> <6c36>\n<388a> <388d> <6c39>\n<388e> <388f> <6c3e>\n<3890> <3892> <6c43>\n<3894> <3898> <6c4b>\n<3899> <389b> <6c51>\n<389d> <389f> <6c58>\n<38a0> <38a1> <6c62>\n<38a2> <38a4> <6c65>\n<38a5> <38a9> <6c6b>\n<38ad> <38ae> <6c77>\n<38af> <38b1> <6c7a>\n<38b2> <38b3> <6c7f>\n<38b6> <38b7> <6c8a>\n<38b8> <38b9> <6c8d>\n<38ba> <38bb> <6c91>\n<38bc> <38bf> <6c95>\n<38c1> <38c3> <6c9c>\n<38c8> <38c9> <6caf>\n<38ca> <38cd> <6cb4>\n<38cf> <38d2> <6cc0>\n<38d3> <38d5> <6cc6>\n<38d7> <38d9> <6ccd>\n<38da> <38db> <6cd1>\n<38dc> <38de> <6cd8>\n<38df> <38e0> <6cdc>\n<38e3> <38e4> <6ce6>\n<38e6> <38e7> <6cec>\n<38eb> <38ec> <6cff>\n<38ed> <38ee> <6d02>\n<38ef> <38f0> <6d05>\n<38f1> <38f3> <6d08>\n<38f5> <38f7> <6d0f>\n<38f8> <38fb> <6d13>\n<38fd> <38fe> <6d1c>\n<3900> <3904> <6d20>\n<3906> <3907> <6d28>\n<3908> <3909> <6d2c>\n<390a> <390b> <6d2f>\n<390d> <390f> <6d36>\n<3911> <3912> <6d3f>\n<3918> <391b> <6d55>\n<391f> <3920> <6d61>\n<3921> <3922> <6d64>\n<3923> <3924> <6d67>\n<3925> <3927> <6d6b>\n<3928> <392b> <6d70>\n<392c> <392d> <6d75>\n<392e> <392f> <6d7a>\n<3930> <3934> <6d7d>\n<3935> <3936> <6d83>\n<3938> <3939> <6d8a>\n<393b> <393c> <6d8f>\n<393e> <3942> <6d96>\n<3946> <3947> <6dac>\n<3948> <3949> <6db0>\n<394a> <394b> <6db3>\n<394c> <394d> <6db6>\n<394e> <3953> <6db9>\n<3954> <3956> <6dc1>\n<3957> <3959> <6dc8>\n<395a> <395d> <6dcd>\n<395e> <3961> <6dd2>\n<3963> <3965> <6dda>\n<3967> <3968> <6de2>\n<396a> <396c> <6de7>\n<396e> <396f> <6def>\n<3973> <397a> <6dfd>\n<397b> <397e> <6e06>\n<3981> <3982> <6e12>\n<3984> <3985> <6e18>\n<3986> <3987> <6e1b>\n<3988> <3989> <6e1e>\n<398b> <398c> <6e27>\n<398f> <3990> <6e30>\n<3992> <3994> <6e35>\n<3996> <3998> <6e3b>\n<3999> <399c> <6e3f>\n<399d> <39a4> <6e45>\n<39a5> <39a8> <6e4f>\n<39ab> <39ac> <6e59>\n<39ad> <39ae> <6e5c>\n<39af> <39b9> <6e60>\n<39ba> <39bb> <6e6c>\n<39bc> <39c9> <6e70>\n<39ca> <39cc> <6e80>\n<39ce> <39cf> <6e87>\nendbfrange\n\n100 beginbfrange\n<39d0> <39d4> <6e8a>\n<39d5> <39d9> <6e91>\n<39db> <39dd> <6e99>\n<39df> <39e0> <6ea0>\n<39e1> <39e2> <6ea3>\n<39e4> <39e5> <6ea8>\n<39e6> <39e9> <6eab>\n<39ed> <39ee> <6eb8>\n<39f0> <39f2> <6ebe>\n<39f5> <39f7> <6ec8>\n<39fc> <39fd> <6ed8>\n<39fe> <39ff> <6edb>\n<3a03> <3a04> <6eea>\n<3a05> <3a06> <6eed>\n<3a07> <3a08> <6ef0>\n<3a0a> <3a0b> <6ef5>\n<3a0c> <3a10> <6efa>\n<3a12> <3a14> <6f03>\n<3a15> <3a16> <6f07>\n<3a17> <3a1b> <6f0a>\n<3a1c> <3a1e> <6f10>\n<3a1f> <3a22> <6f16>\n<3a23> <3a27> <6f1b>\n<3a29> <3a2c> <6f25>\n<3a2f> <3a30> <6f34>\n<3a32> <3a36> <6f39>\n<3a38> <3a3b> <6f42>\n<3a3c> <3a3e> <6f48>\n<3a40> <3a42> <6f4e>\n<3a43> <3a44> <6f52>\n<3a45> <3a47> <6f55>\n<3a48> <3a49> <6f5a>\n<3a4b> <3a4d> <6f5f>\n<3a50> <3a55> <6f67>\n<3a58> <3a59> <6f75>\n<3a5c> <3a5d> <6f7d>\n<3a5e> <3a60> <6f81>\n<3a62> <3a63> <6f8a>\n<3a64> <3a6b> <6f8f>\n<3a6c> <3a6f> <6f98>\n<3a70> <3a72> <6f9d>\n<3a73> <3a74> <6fa2>\n<3a75> <3a76> <6fa5>\n<3a78> <3a7b> <6faa>\n<3a7c> <3a7d> <6faf>\n<3a7f> <3a80> <6fb4>\n<3a81> <3a82> <6fb7>\n<3a83> <3a88> <6fba>\n<3a89> <3a8d> <6fc4>\n<3a8e> <3a94> <6fca>\n<3a95> <3a96> <6fd3>\n<3a97> <3a98> <6fd6>\n<3a99> <3a9a> <6fd9>\n<3a9b> <3a9c> <6fdc>\n<3a9d> <3a9e> <6fe2>\n<3a9f> <3aa4> <6fe5>\n<3aa5> <3aa6> <6fec>\n<3aa7> <3aae> <6ff2>\n<3ab1> <3ab6> <6fff>\n<3ab7> <3ab8> <7007>\n<3aba> <3abc> <700c>\n<3abe> <3ac0> <7012>\n<3ac1> <3ac2> <7016>\n<3ac6> <3ac7> <7021>\n<3ac8> <3aca> <7024>\n<3acb> <3ad1> <7029>\n<3ad3> <3ad4> <7033>\n<3ad5> <3ad7> <7036>\n<3ad8> <3adb> <703a>\n<3adc> <3adf> <703f>\n<3ae0> <3ae6> <7045>\n<3ae7> <3ae8> <704d>\n<3aea> <3aec> <7052>\n<3aed> <3aee> <7056>\n<3aef> <3af2> <7059>\n<3af3> <3af6> <705f>\n<3af7> <3af8> <7065>\n<3af9> <3afb> <7068>\n<3afd> <3aff> <7071>\n<3b02> <3b04> <7079>\n<3b06> <3b09> <7081>\n<3b0a> <3b0c> <7086>\n<3b0d> <3b0f> <708b>\n<3b10> <3b12> <708f>\n<3b14> <3b15> <7097>\n<3b16> <3b17> <709a>\n<3b18> <3b24> <709e>\n<3b27> <3b29> <70b4>\n<3b2b> <3b2c> <70be>\n<3b2d> <3b30> <70c4>\n<3b32> <3b35> <70cb>\n<3b36> <3b3d> <70d0>\n<3b3f> <3b41> <70dc>\n<3b42> <3b45> <70e0>\n<3b49> <3b4c> <70f0>\n<3b4d> <3b4e> <70f5>\n<3b50> <3b52> <70fa>\n<3b53> <3b5d> <70fe>\n<3b5e> <3b62> <710b>\n<3b63> <3b64> <7111>\nendbfrange\n\n100 beginbfrange\n<3b67> <3b6c> <711b>\n<3b6d> <3b70> <7122>\n<3b71> <3b78> <7127>\n<3b79> <3b7c> <7132>\n<3b7d> <3b8a> <7137>\n<3b8b> <3b8d> <7146>\n<3b90> <3b92> <714f>\n<3b93> <3b9b> <7153>\n<3b9d> <3b9f> <715f>\n<3ba2> <3ba3> <716a>\n<3ba5> <3ba7> <716f>\n<3ba8> <3bab> <7174>\n<3bad> <3bae> <717b>\n<3baf> <3bb4> <717e>\n<3bb5> <3bb9> <7185>\n<3bba> <3bbd> <718b>\n<3bbe> <3bbf> <7190>\n<3bc1> <3bc2> <7195>\n<3bc3> <3bc7> <719a>\n<3bc8> <3bce> <71a1>\n<3bcf> <3bd1> <71a9>\n<3bd2> <3bd5> <71ad>\n<3bd8> <3bda> <71b6>\n<3bdb> <3bde> <71ba>\n<3bdf> <3be0> <71bf>\n<3be2> <3be5> <71c4>\n<3be6> <3bea> <71c9>\n<3beb> <3bed> <71cf>\n<3bef> <3bf1> <71d6>\n<3bf2> <3bf3> <71da>\n<3bf4> <3bf5> <71dd>\n<3bf6> <3bf9> <71e1>\n<3bfa> <3bfe> <71e8>\n<3c00> <3c03> <71f0>\n<3c04> <3c07> <71f5>\n<3c08> <3c09> <71fa>\n<3c0b> <3c11> <71ff>\n<3c12> <3c17> <7207>\n<3c18> <3c19> <720e>\n<3c1a> <3c23> <7211>\n<3c25> <3c2e> <721e>\n<3c31> <3c33> <722d>\n<3c34> <3c35> <7233>\n<3c37> <3c3d> <7240>\n<3c3e> <3c40> <7249>\n<3c41> <3c44> <724e>\n<3c45> <3c47> <7253>\n<3c4d> <3c4f> <7263>\n<3c51> <3c54> <726a>\n<3c55> <3c56> <7270>\n<3c57> <3c58> <7273>\n<3c59> <3c5b> <7276>\n<3c5c> <3c5d> <727b>\n<3c5e> <3c5f> <7282>\n<3c60> <3c64> <7285>\n<3c67> <3c68> <7290>\n<3c69> <3c6b> <7293>\n<3c6c> <3c73> <7297>\n<3c74> <3c75> <72a0>\n<3c76> <3c79> <72a3>\n<3c7a> <3c7d> <72a8>\n<3c7f> <3c81> <72b1>\n<3c83> <3c88> <72ba>\n<3c89> <3c8b> <72c5>\n<3c8c> <3c8f> <72c9>\n<3c92> <3c95> <72d3>\n<3c97> <3c9a> <72da>\n<3c9c> <3ca1> <72e2>\n<3ca2> <3ca3> <72ea>\n<3ca4> <3ca5> <72f5>\n<3ca6> <3ca8> <72fe>\n<3caa> <3caf> <7304>\n<3cb0> <3cb2> <730b>\n<3cb3> <3cb6> <730f>\n<3cb8> <3cba> <7318>\n<3cbb> <3cbc> <731f>\n<3cbd> <3cbe> <7323>\n<3cbf> <3cc1> <7326>\n<3cc3> <3cc4> <732f>\n<3cc5> <3cc6> <7332>\n<3cc9> <3cca> <733c>\n<3ccc> <3ccd> <7342>\n<3cce> <3cd4> <7346>\n<3cd5> <3cd6> <734e>\n<3cd8> <3cdb> <7353>\n<3cdc> <3ce3> <7358>\n<3ce4> <3cea> <7361>\n<3cee> <3cef> <7373>\n<3cf4> <3cf6> <7381>\n<3cf7> <3cf8> <7385>\n<3cfb> <3cfc> <738c>\n<3cfd> <3cfe> <738f>\n<3d00> <3d02> <7393>\n<3d03> <3d06> <7397>\n<3d07> <3d09> <739c>\n<3d0a> <3d0b> <73a0>\n<3d0c> <3d11> <73a3>\n<3d13> <3d14> <73ac>\n<3d16> <3d18> <73b4>\n<3d19> <3d1a> <73b8>\nendbfrange\n\n100 beginbfrange\n<3d1b> <3d1e> <73bc>\n<3d20> <3d24> <73c3>\n<3d25> <3d26> <73cb>\n<3d28> <3d2e> <73d2>\n<3d2f> <3d32> <73da>\n<3d34> <3d37> <73e1>\n<3d3a> <3d3c> <73ea>\n<3d3d> <3d40> <73ee>\n<3d41> <3d4b> <73f3>\n<3d4c> <3d4f> <73ff>\n<3d51> <3d52> <7407>\n<3d53> <3d56> <740b>\n<3d57> <3d5f> <7411>\n<3d60> <3d65> <741c>\n<3d66> <3d67> <7423>\n<3d6d> <3d6e> <7431>\n<3d6f> <3d73> <7437>\n<3d74> <3d75> <743d>\n<3d77> <3d7f> <7442>\n<3d80> <3d88> <744c>\n<3d8c> <3d8e> <7460>\n<3d8f> <3d93> <7464>\n<3d94> <3d95> <746b>\n<3d96> <3d97> <746e>\n<3d98> <3d9c> <7471>\n<3d9d> <3da2> <7478>\n<3da5> <3da7> <7484>\n<3daa> <3dab> <748c>\n<3dad> <3db7> <7491>\n<3db9> <3dbc> <749f>\n<3dbd> <3dbe> <74a4>\n<3dbf> <3dc4> <74aa>\n<3dc5> <3dcd> <74b1>\n<3dce> <3dcf> <74bb>\n<3dd0> <3ddb> <74be>\n<3ddc> <3ddf> <74cb>\n<3de0> <3de1> <74d0>\n<3de3> <3de7> <74d5>\n<3ded> <3df3> <74e7>\n<3df4> <3df7> <74f0>\n<3df9> <3dff> <74f8>\n<3e00> <3e03> <7500>\n<3e04> <3e0a> <7505>\n<3e0e> <3e11> <7514>\n<3e13> <3e14> <751d>\n<3e15> <3e17> <7520>\n<3e19> <3e1a> <7526>\n<3e20> <3e21> <753c>\n<3e23> <3e26> <7541>\n<3e27> <3e28> <7546>\n<3e29> <3e2a> <7549>\n<3e2c> <3e2f> <7550>\n<3e30> <3e33> <7555>\n<3e34> <3e37> <755e>\n<3e38> <3e39> <7563>\n<3e3a> <3e3c> <7567>\n<3e3d> <3e42> <756c>\n<3e46> <3e4a> <757a>\n<3e4b> <3e4d> <7580>\n<3e4e> <3e4f> <7584>\n<3e50> <3e52> <7588>\n<3e53> <3e55> <758c>\n<3e5a> <3e5b> <759b>\n<3e5e> <3e62> <75a6>\n<3e64> <3e65> <75b6>\n<3e66> <3e67> <75ba>\n<3e68> <3e6a> <75bf>\n<3e6c> <3e6d> <75cb>\n<3e6e> <3e71> <75ce>\n<3e75> <3e76> <75dc>\n<3e77> <3e79> <75df>\n<3e7c> <3e7f> <75ec>\n<3e80> <3e81> <75f2>\n<3e82> <3e85> <75f5>\n<3e86> <3e87> <75fa>\n<3e88> <3e89> <75fd>\n<3e8b> <3e8e> <7606>\n<3e8f> <3e90> <760e>\n<3e91> <3e94> <7611>\n<3e97> <3e98> <761c>\n<3e9c> <3e9d> <762e>\n<3e9e> <3e9f> <7631>\n<3ea0> <3ea1> <7636>\n<3ea2> <3ea3> <7639>\n<3ea6> <3ea7> <7644>\n<3ea9> <3eaa> <764a>\n<3eab> <3eb0> <764e>\n<3eb3> <3eb5> <7659>\n<3eb7> <3eb8> <7660>\n<3ebc> <3ec0> <7673>\n<3ec1> <3ec2> <7679>\n<3ec3> <3ec5> <767f>\n<3ec8> <3ec9> <7689>\n<3eca> <3ecb> <768c>\n<3ecc> <3ecd> <768f>\n<3ecf> <3ed0> <7694>\n<3ed1> <3ed2> <7697>\n<3ed3> <3edb> <769b>\n<3edc> <3ee4> <76a5>\n<3ee5> <3ee6> <76af>\nendbfrange\n\n100 beginbfrange\n<3ee8> <3eea> <76b5>\n<3eec> <3eef> <76bb>\n<3ef0> <3ef1> <76c0>\n<3ef2> <3ef3> <76c3>\n<3ef6> <3ef7> <76cb>\n<3efa> <3efb> <76d9>\n<3efc> <3efd> <76dc>\n<3f01> <3f06> <76e8>\n<3f09> <3f0b> <76f5>\n<3f0c> <3f0d> <76fa>\n<3f0f> <3f10> <76ff>\n<3f11> <3f12> <7702>\n<3f13> <3f14> <7705>\n<3f17> <3f21> <770e>\n<3f22> <3f25> <771b>\n<3f27> <3f29> <7723>\n<3f2b> <3f2d> <772a>\n<3f2f> <3f33> <7730>\n<3f36> <3f38> <773d>\n<3f3a> <3f3c> <7744>\n<3f3d> <3f43> <7748>\n<3f44> <3f4b> <7752>\n<3f4c> <3f4d> <775c>\n<3f4e> <3f4f> <775f>\n<3f52> <3f53> <7769>\n<3f54> <3f5f> <776d>\n<3f60> <3f62> <777a>\n<3f63> <3f65> <7781>\n<3f66> <3f6b> <7786>\n<3f6c> <3f6d> <778f>\n<3f6e> <3f72> <7793>\n<3f73> <3f77> <7799>\n<3f79> <3f7a> <77a3>\n<3f7e> <3f7f> <77ae>\n<3f80> <3f81> <77b1>\n<3f83> <3f87> <77b6>\n<3f89> <3f8f> <77c0>\n<3f90> <3f94> <77c8>\n<3f95> <3f9d> <77ce>\n<3f9e> <3f9f> <77d8>\n<3fa0> <3fa4> <77dd>\n<3fa9> <3fab> <77f0>\n<3fac> <3fad> <77f4>\n<3faf> <3fb2> <77f9>\n<3fb3> <3fb8> <7803>\n<3fb9> <3fba> <780a>\n<3fbb> <3fbd> <780e>\n<3fc3> <3fc5> <7820>\n<3fc8> <3fc9> <782a>\n<3fca> <3fcb> <782e>\n<3fcc> <3fce> <7831>\n<3fcf> <3fd0> <7835>\n<3fd3> <3fd4> <7841>\n<3fd7> <3fda> <7848>\n<3fde> <3fdf> <7853>\n<3fe0> <3fe4> <7858>\n<3fe5> <3fea> <785e>\n<3feb> <3fed> <7865>\n<3fef> <3ff5> <7870>\n<3ff6> <3ff9> <7878>\n<3ffa> <3fff> <787d>\n<4000> <4003> <7883>\n<4005> <4006> <788a>\n<4007> <4008> <788f>\n<400a> <400c> <7894>\n<400e> <400f> <789d>\n<4015> <4017> <78aa>\n<4018> <4019> <78ae>\n<401a> <401c> <78b5>\n<401f> <4020> <78bf>\n<4021> <4023> <78c2>\n<4024> <4026> <78c6>\n<4027> <402a> <78cc>\n<402b> <402d> <78d1>\n<402e> <4030> <78d6>\n<4031> <4038> <78db>\n<4039> <403b> <78e4>\n<403c> <403e> <78e9>\n<403f> <4040> <78ed>\n<4041> <4042> <78f0>\n<4044> <4045> <78f5>\n<4046> <4047> <78f8>\n<4048> <4049> <78fb>\n<404a> <404c> <78fe>\n<404d> <404f> <7902>\n<4050> <4057> <7906>\n<4058> <405b> <790f>\n<405c> <4060> <7914>\n<4061> <4064> <791a>\n<4065> <4069> <791f>\n<406b> <406d> <7927>\n<406e> <4071> <792d>\n<4072> <4073> <7932>\n<4074> <4078> <7935>\n<407b> <407e> <7942>\n<4080> <4088> <794a>\n<4089> <408a> <7954>\n<408b> <408c> <7958>\n<408e> <408f> <7963>\n<4091> <4094> <7969>\nendbfrange\n\n100 beginbfrange\n<4096> <409c> <7970>\n<409e> <40a2> <797b>\n<40a3> <40a4> <7982>\n<40a5> <40a8> <7986>\n<40a9> <40aa> <798b>\n<40ab> <40b4> <7990>\n<40b5> <40bf> <799b>\n<40c0> <40c1> <79a8>\n<40c2> <40c4> <79ab>\n<40c7> <40cb> <79b4>\n<40cf> <40d0> <79c4>\n<40d1> <40d2> <79c7>\n<40d5> <40d7> <79ce>\n<40d8> <40d9> <79d3>\n<40da> <40db> <79d6>\n<40dc> <40e1> <79d9>\n<40e2> <40e4> <79e0>\n<40ea> <40f0> <79f1>\n<40f1> <40f2> <79f9>\n<40f4> <40f5> <79fe>\n<40f7> <40f8> <7a04>\n<40f9> <40fc> <7a07>\n<40fe> <40ff> <7a0f>\n<4100> <4102> <7a11>\n<4103> <4104> <7a15>\n<4105> <4106> <7a18>\n<4107> <4109> <7a1b>\n<410b> <410c> <7a21>\n<410d> <4116> <7a24>\n<4117> <4118> <7a2f>\n<411a> <411c> <7a34>\n<4120> <4124> <7a41>\n<4125> <4129> <7a47>\n<412a> <412b> <7a4f>\n<412c> <4130> <7a52>\n<4131> <4139> <7a58>\n<413a> <413f> <7a63>\n<4141> <4144> <7a6c>\n<4145> <4147> <7a71>\n<4149> <414c> <7a7b>\n<4150> <4153> <7a89>\n<4154> <4156> <7a8e>\n<4157> <4158> <7a93>\n<4159> <415b> <7a99>\n<415d> <4160> <7aa1>\n<4163> <4166> <7aaf>\n<4167> <4168> <7ab4>\n<4169> <416b> <7ab7>\n<416c> <416f> <7abb>\n<4170> <4173> <7ac0>\n<4176> <417f> <7acc>\n<4180> <4181> <7ad7>\n<4182> <4185> <7ada>\n<4186> <4187> <7ae1>\n<4189> <418b> <7ae7>\n<418c> <418d> <7aeb>\n<418f> <4194> <7af0>\n<4195> <4196> <7af7>\n<4197> <4198> <7afb>\n<419a> <419c> <7b00>\n<41a0> <41a2> <7b0c>\n<41a4> <41a5> <7b12>\n<41a6> <41a8> <7b16>\n<41aa> <41ab> <7b1c>\n<41ad> <41af> <7b21>\n<41b3> <41b4> <7b2f>\n<41b6> <41b9> <7b34>\n<41bd> <41c2> <7b3f>\n<41c5> <41c6> <7b4d>\n<41cc> <41cd> <7b5e>\n<41cf> <41d2> <7b63>\n<41d3> <41d8> <7b68>\n<41d9> <41da> <7b6f>\n<41db> <41dc> <7b73>\n<41e0> <41e1> <7b7c>\n<41e3> <41e6> <7b81>\n<41e7> <41eb> <7b86>\n<41ed> <41ee> <7b8e>\n<41ef> <41f1> <7b91>\n<41f3> <41f6> <7b98>\n<41f7> <41f9> <7b9e>\n<41fa> <41fc> <7ba3>\n<41fd> <41ff> <7bae>\n<4200> <4201> <7bb2>\n<4202> <4204> <7bb5>\n<4205> <420b> <7bb9>\n<420c> <420d> <7bc2>\n<4211> <4214> <7bcd>\n<4216> <421a> <7bd4>\n<421b> <421c> <7bdb>\n<421d> <421f> <7bde>\n<4220> <4221> <7be2>\n<4222> <4223> <7be7>\n<4224> <4226> <7beb>\n<4227> <4228> <7bef>\n<422a> <422c> <7bf4>\n<422d> <4230> <7bf8>\n<4233> <4238> <7c01>\n<4239> <423b> <7c08>\n<423d> <4242> <7c10>\nendbfrange\n\n100 beginbfrange\n<4243> <4249> <7c17>\n<424c> <424d> <7c24>\n<424e> <424f> <7c28>\n<4250> <425b> <7c2c>\n<425c> <425f> <7c39>\n<4261> <4268> <7c44>\n<4269> <4276> <7c4e>\n<4277> <4278> <7c5d>\n<4279> <427b> <7c61>\n<427c> <427f> <7c65>\n<4282> <4284> <7c6f>\n<4285> <428a> <7c75>\n<428b> <4295> <7c7e>\n<4296> <429c> <7c8a>\n<429d> <429e> <7c93>\n<42a0> <42a2> <7c99>\n<42a3> <42a4> <7ca0>\n<42a6> <42a9> <7ca6>\n<42aa> <42ac> <7cab>\n<42ad> <42ae> <7caf>\n<42af> <42b3> <7cb4>\n<42b4> <42b5> <7cba>\n<42b6> <42b7> <7cbf>\n<42b8> <42ba> <7cc2>\n<42be> <42c4> <7cce>\n<42c6> <42c7> <7cda>\n<42c8> <42cd> <7ce1>\n<42ce> <42d3> <7ce9>\n<42d9> <42da> <7cfc>\n<42df> <42e0> <7d0e>\n<42e1> <42e2> <7d11>\n<42e5> <42e7> <7d1d>\n<42e8> <42eb> <7d23>\n<42ec> <42ee> <7d28>\n<42ef> <42f1> <7d2c>\n<42f2> <42f6> <7d34>\n<42f8> <42f9> <7d3d>\n<42fd> <42ff> <7d47>\n<4300> <4303> <7d4a>\n<4305> <4310> <7d51>\n<4311> <4312> <7d5f>\n<4313> <4315> <7d63>\n<4317> <431b> <7d69>\n<431c> <431d> <7d6f>\n<431e> <431f> <7d74>\n<4321> <4327> <7d7a>\n<4329> <432a> <7d84>\n<432c> <4330> <7d8a>\n<4331> <4333> <7d90>\n<4334> <433b> <7d94>\n<433d> <433f> <7d9f>\n<4340> <4341> <7da4>\n<4342> <4345> <7da7>\n<4347> <4349> <7db5>\n<434b> <434e> <7dc0>\n<434f> <4350> <7dc5>\n<4351> <4352> <7dc8>\n<4353> <4357> <7dcc>\n<4359> <435a> <7dd5>\n<435b> <435d> <7dda>\n<4360> <4361> <7de4>\n<4363> <4364> <7dea>\n<4365> <4366> <7ded>\n<436a> <436b> <7df7>\n<436d> <4378> <7dfc>\n<4379> <437c> <7e0c>\n<437d> <4385> <7e12>\n<4387> <4389> <7e20>\n<438a> <438c> <7e24>\n<438d> <438f> <7e28>\n<4391> <4392> <7e2f>\n<4397> <4398> <7e3f>\n<4399> <439b> <7e42>\n<439c> <43a5> <7e48>\n<43a7> <43aa> <7e56>\n<43ab> <43ad> <7e5b>\n<43ae> <43b0> <7e5f>\n<43b1> <43b6> <7e63>\n<43b8> <43b9> <7e71>\n<43ba> <43be> <7e74>\n<43bf> <43c0> <7e7a>\n<43c1> <43c3> <7e7f>\n<43c4> <43c8> <7e83>\n<43cc> <43ce> <7e90>\n<43d1> <43d2> <7e99>\n<43d3> <43d4> <7e9d>\n<43d7> <43d8> <7ebb>\n<43e2> <43e8> <7f3b>\n<43ea> <43ef> <7f46>\n<43f2> <43f3> <7f52>\n<43f6> <43f9> <7f5b>\n<43fb> <43ff> <7f63>\n<4400> <4402> <7f6b>\n<4405> <4406> <7f75>\n<4408> <440b> <7f7a>\n<440c> <440d> <7f7f>\n<440e> <4410> <7f82>\n<4415> <4419> <7f8f>\n<441a> <441e> <7f95>\n<441f> <4420> <7f9b>\nendbfrange\n\n100 beginbfrange\n<4422> <4423> <7fa2>\n<4426> <442a> <7faa>\n<442c> <4430> <7fb3>\n<4431> <4432> <7fba>\n<4435> <4437> <7fc2>\n<4438> <443b> <7fc6>\n<443e> <4440> <7fcf>\n<4442> <4443> <7fd6>\n<4444> <4449> <7fd9>\n<444a> <444c> <7fe2>\n<444d> <444e> <7fe7>\n<444f> <4452> <7fea>\n<4455> <4459> <7ff4>\n<445b> <445d> <7ffd>\n<445f> <4462> <8007>\n<4463> <4464> <800e>\n<4467> <4468> <801a>\n<4469> <446b> <801d>\n<446d> <446e> <8023>\n<4471> <4472> <802f>\n<4475> <4476> <8039>\n<4479> <447a> <8040>\n<447b> <447c> <8044>\n<447d> <447f> <8047>\n<4480> <4483> <804e>\n<4488> <448a> <805b>\n<448b> <4494> <805f>\n<4495> <4498> <806b>\n<449b> <449d> <807a>\n<449e> <449f> <8081>\n<44a2> <44a7> <808d>\n<44a8> <44a9> <8094>\n<44ae> <44b0> <80a6>\n<44b4> <44b5> <80b5>\n<44b6> <44b7> <80b8>\n<44ba> <44be> <80c7>\n<44bf> <44c5> <80cf>\n<44c7> <44c8> <80df>\n<44c9> <44ca> <80e2>\n<44d1> <44d4> <80fe>\n<44d5> <44d6> <8103>\n<44d7> <44d8> <8107>\n<44d9> <44da> <810b>\n<44de> <44df> <811c>\n<44e0> <44ec> <811f>\n<44ed> <44ee> <812d>\n<44f0> <44f2> <8133>\n<44f4> <44f7> <813a>\n<44f8> <44fe> <813f>\n<4504> <4505> <8157>\n<4506> <450a> <815b>\n<450b> <450d> <8162>\n<4512> <4513> <8172>\n<4514> <4516> <8175>\n<4518> <451c> <8183>\n<451e> <4521> <818b>\n<4523> <4528> <8192>\n<452a> <452b> <819e>\n<452c> <452d> <81a1>\n<452e> <452f> <81a4>\n<4531> <4538> <81ab>\n<4539> <453e> <81b4>\n<4540> <4541> <81c4>\n<4542> <4543> <81c7>\n<4546> <454d> <81d0>\n<454f> <4552> <81db>\n<4553> <4554> <81e1>\n<4555> <4557> <81e4>\n<455a> <455e> <81ee>\n<455f> <4563> <81f5>\n<4568> <4569> <820e>\n<456c> <4571> <8215>\n<4574> <4577> <8224>\n<457c> <457d> <823c>\n<457e> <4582> <823f>\n<4583> <4584> <8245>\n<4587> <4589> <824c>\n<458a> <4591> <8250>\n<4592> <4595> <825b>\n<4596> <4599> <8260>\n<459c> <459d> <8269>\n<459e> <459f> <826c>\n<45a0> <45a1> <8275>\n<45a3> <45a4> <827b>\n<45a5> <45a6> <8280>\n<45a8> <45aa> <8285>\n<45ae> <45b1> <8293>\n<45b2> <45b3> <829a>\n<45b6> <45b7> <82a2>\n<45ba> <45bb> <82b5>\n<45be> <45bf> <82bf>\n<45c0> <45c1> <82c2>\n<45c2> <45c3> <82c5>\n<45c7> <45c8> <82d9>\n<45cb> <45cd> <82e8>\n<45ce> <45d0> <82ec>\n<45d2> <45d3> <82f2>\n<45d4> <45d5> <82f5>\n<45d8> <45dc> <82fc>\n<45dd> <45de> <830a>\nendbfrange\n\n100 beginbfrange\n<45e1> <45e2> <8312>\n<45e4> <45e5> <8318>\n<45e6> <45ef> <831d>\n<45f0> <45f1> <8329>\n<45f7> <45f9> <833d>\n<45fa> <45fb> <8341>\n<45fc> <45fd> <8344>\n<4600> <4603> <834b>\n<4605> <4609> <8355>\n<460c> <4612> <8370>\n<4613> <4614> <8379>\n<4615> <461b> <837e>\n<461c> <461d> <8387>\n<461e> <4620> <838b>\n<4621> <4623> <838f>\n<4624> <4625> <8394>\n<4627> <4628> <8399>\n<462c> <462f> <83a3>\n<4630> <4633> <83ac>\n<4636> <4637> <83be>\n<4638> <463a> <83c2>\n<463c> <463d> <83c8>\n<463f> <4640> <83cd>\n<4641> <4644> <83d0>\n<4647> <4649> <83d9>\n<464b> <464d> <83e2>\n<464e> <4650> <83e6>\n<4651> <4654> <83eb>\n<4655> <4659> <83f3>\n<465a> <465c> <83fa>\n<465d> <465f> <83fe>\n<4662> <4663> <8408>\n<4665> <466a> <8412>\n<466b> <466d> <8419>\n<466e> <4673> <841e>\n<4674> <4676> <8429>\n<4677> <467a> <842d>\n<467b> <467d> <8432>\n<467e> <467f> <8436>\n<4680> <4682> <8439>\n<4683> <468a> <843e>\n<468b> <468c> <8447>\n<468d> <4693> <844a>\n<4694> <4697> <8453>\n<4699> <469c> <845d>\n<469f> <46a0> <8467>\n<46a7> <46ad> <847b>\n<46ae> <46b1> <8483>\n<46b4> <46b7> <848f>\n<46b8> <46b9> <8495>\n<46bb> <46bc> <849a>\n<46bd> <46c0> <849d>\n<46c1> <46cd> <84a2>\n<46ce> <46cf> <84b0>\n<46d1> <46d3> <84b5>\n<46d6> <46d7> <84c2>\n<46d8> <46db> <84c5>\n<46dd> <46de> <84ce>\n<46e0> <46e1> <84d4>\n<46e2> <46e7> <84d7>\n<46e9> <46ea> <84e1>\n<46ec> <46f0> <84e7>\n<46f2> <46fc> <84f1>\n<46fe> <46ff> <8500>\n<4700> <4709> <8502>\n<470a> <470d> <850d>\n<470f> <4710> <8515>\n<4711> <4712> <8518>\n<4713> <4715> <851b>\n<4718> <4719> <8524>\n<471a> <471d> <8527>\n<471e> <4726> <852e>\n<4727> <4729> <853e>\n<472b> <472c> <8544>\n<472e> <4730> <854b>\n<4731> <4733> <854f>\n<4736> <4739> <855a>\n<473a> <473c> <855f>\n<473e> <4740> <8565>\n<4741> <4742> <856b>\n<4743> <4746> <856e>\n<4748> <4749> <8575>\n<474b> <474c> <857c>\n<474d> <4751> <857f>\n<4755> <4756> <858d>\n<4758> <4759> <8592>\n<475a> <475f> <8595>\n<4760> <4761> <859d>\n<4762> <4765> <85a0>\n<4768> <476a> <85ab>\n<476b> <4770> <85b1>\n<4772> <4777> <85bb>\n<4778> <477e> <85c2>\n<477f> <4781> <85ca>\n<4782> <4783> <85d1>\n<4785> <478a> <85d6>\n<478b> <4790> <85de>\n<4791> <4793> <85e6>\n<4794> <479c> <85eb>\n<479e> <479f> <85f7>\nendbfrange\n\n100 beginbfrange\n<47a0> <47a2> <85fc>\n<47a3> <47a6> <8600>\n<47a7> <47a9> <8608>\n<47aa> <47ae> <860c>\n<47af> <47b2> <8612>\n<47b3> <47b5> <8617>\n<47b6> <47b8> <861b>\n<47b9> <47bb> <861f>\n<47bc> <47bf> <8623>\n<47c1> <47c3> <862a>\n<47c4> <47cd> <862e>\n<47d0> <47d1> <863d>\n<47d2> <47de> <8640>\n<47df> <47e0> <8652>\n<47e1> <47e4> <8656>\n<47e7> <47e8> <8660>\n<47e9> <47ec> <8663>\n<47ed> <47ef> <8668>\n<47f1> <47f2> <866f>\n<47f3> <47f9> <8672>\n<47fa> <47ff> <8683>\n<4801> <4805> <868e>\n<4807> <480c> <8696>\n<480d> <4811> <869e>\n<4812> <4813> <86a5>\n<4815> <4816> <86ad>\n<4817> <4818> <86b2>\n<4819> <481b> <86b7>\n<481c> <4820> <86bb>\n<4821> <4823> <86c1>\n<4826> <4827> <86cc>\n<4828> <4829> <86d2>\n<482a> <482c> <86d5>\n<482e> <482f> <86dc>\n<4830> <4833> <86e0>\n<4834> <4837> <86e5>\n<4838> <483a> <86ea>\n<483c> <483e> <86f5>\n<483f> <4841> <86fb>\n<4844> <4845> <8704>\n<4846> <4847> <870b>\n<4848> <484b> <870e>\n<4851> <4852> <871f>\n<4854> <4856> <8726>\n<4857> <485a> <872a>\n<485b> <485c> <872f>\n<485d> <485e> <8732>\n<485f> <4860> <8735>\n<4861> <4863> <8738>\n<4864> <4865> <873c>\n<4866> <486c> <8740>\n<486d> <486e> <874a>\n<4870> <4873> <874f>\n<4877> <487c> <875a>\n<487d> <487e> <8761>\n<487f> <4885> <8767>\n<4887> <4889> <8771>\n<488c> <488d> <8779>\n<488e> <4890> <877f>\n<4891> <4892> <8786>\n<4893> <4894> <8789>\n<4896> <489a> <878e>\n<489b> <489d> <8794>\n<489e> <48a3> <8798>\n<48a4> <48a5> <87a0>\n<48a6> <48aa> <87a3>\n<48ab> <48ac> <87a9>\n<48ae> <48b0> <87b0>\n<48b2> <48b5> <87b6>\n<48b7> <48b8> <87be>\n<48b9> <48bb> <87c1>\n<48bf> <48c0> <87cc>\n<48c1> <48c2> <87cf>\n<48c3> <48c9> <87d4>\n<48ca> <48cd> <87dc>\n<48ce> <48cf> <87e1>\n<48d1> <48d4> <87e6>\n<48d7> <48d8> <87f0>\n<48d9> <48db> <87f3>\n<48dc> <48dd> <87f7>\n<48df> <48e0> <87fc>\n<48e1> <48e4> <87ff>\n<48e6> <48e8> <8807>\n<48e9> <48ed> <880b>\n<48f0> <48f3> <8817>\n<48f4> <48f6> <881c>\n<48f8> <48ff> <8824>\n<4900> <4904> <882c>\n<4905> <4907> <8833>\n<4908> <4909> <8837>\n<490b> <490d> <883d>\n<490e> <4910> <8841>\n<4911> <4913> <8847>\n<4915> <4919> <884e>\n<491a> <491b> <8855>\n<491f> <4921> <885e>\n<4922> <4923> <8866>\n<4928> <492b> <8873>\n<492d> <492f> <887a>\n<4932> <4933> <8886>\nendbfrange\n\n100 beginbfrange\n<4934> <4935> <8889>\n<4937> <493a> <888e>\n<493b> <493d> <8893>\n<493e> <4942> <8897>\n<4943> <4947> <889d>\n<4949> <494e> <88a5>\n<4950> <4952> <88ae>\n<4953> <4957> <88b2>\n<4958> <495b> <88b8>\n<495c> <495f> <88bd>\n<4960> <4961> <88c3>\n<4962> <4963> <88c7>\n<4964> <4966> <88cb>\n<4967> <4968> <88d0>\n<496a> <496b> <88d6>\n<496c> <496d> <88da>\n<496f> <4970> <88e0>\n<4971> <4972> <88e6>\n<4973> <4979> <88e9>\n<497b> <497d> <88f5>\n<497e> <497f> <88fa>\n<4980> <4982> <88ff>\n<4983> <4986> <8903>\n<4987> <4988> <8908>\n<4989> <498d> <890b>\n<498f> <4993> <8914>\n<4994> <4998> <891c>\n<4999> <499b> <8922>\n<499c> <499f> <8926>\n<49a0> <49a3> <892c>\n<49a7> <49a8> <8939>\n<49a9> <49ad> <893c>\n<49ae> <49af> <8942>\n<49b0> <49b1> <8945>\n<49b2> <49bf> <8948>\n<49c0> <49c5> <8957>\n<49c6> <49c8> <8961>\n<49ca> <49cc> <8967>\n<49ce> <49cf> <896d>\n<49d0> <49d1> <8970>\n<49d2> <49d9> <8973>\n<49da> <49dc> <897c>\n<49df> <49e0> <8984>\n<49e1> <49e4> <8987>\n<49e5> <49e7> <898c>\n<49e8> <49ea> <8990>\n<49eb> <49ec> <8994>\n<49ee> <49f5> <8999>\n<49f6> <49f9> <89a2>\n<49fa> <49fc> <89a7>\n<49fe> <49ff> <89ad>\n<4a00> <4a01> <89b0>\n<4a02> <4a05> <89b3>\n<4a06> <4a07> <89b8>\n<4a08> <4a09> <89bb>\n<4a0d> <4a0f> <89d3>\n<4a10> <4a12> <89d7>\n<4a15> <4a18> <89df>\n<4a1a> <4a1d> <89e7>\n<4a1e> <4a20> <89ec>\n<4a21> <4a23> <89f0>\n<4a26> <4a2c> <89f9>\n<4a2d> <4a2f> <8a04>\n<4a34> <4a35> <8a11>\n<4a38> <4a39> <8a19>\n<4a3c> <4a3e> <8a20>\n<4a40> <4a43> <8a26>\n<4a44> <4a45> <8a2b>\n<4a46> <4a48> <8a2e>\n<4a49> <4a4a> <8a32>\n<4a4c> <4a4e> <8a37>\n<4a4f> <4a51> <8a3b>\n<4a52> <4a53> <8a3f>\n<4a54> <4a57> <8a42>\n<4a59> <4a5d> <8a49>\n<4a61> <4a62> <8a56>\n<4a63> <4a64> <8a59>\n<4a65> <4a66> <8a5c>\n<4a67> <4a68> <8a5f>\n<4a69> <4a6a> <8a64>\n<4a6b> <4a6c> <8a67>\n<4a70> <4a72> <8a76>\n<4a73> <4a74> <8a7a>\n<4a75> <4a76> <8a7d>\n<4a77> <4a7a> <8a80>\n<4a7c> <4a7d> <8a8b>\n<4a7e> <4a80> <8a8e>\n<4a82> <4a83> <8a96>\n<4a85> <4a87> <8a9b>\n<4a8b> <4a8d> <8aa9>\n<4a8e> <4a90> <8aad>\n<4a92> <4a94> <8ab3>\n<4a95> <4a96> <8ab7>\n<4a97> <4a98> <8aba>\n<4a99> <4a9a> <8abd>\n<4a9b> <4a9c> <8ac0>\n<4a9e> <4a9f> <8ac5>\n<4aa5> <4aa7> <8ad3>\n<4aa8> <4aaa> <8ad8>\n<4aac> <4aae> <8adf>\nendbfrange\n\n100 beginbfrange\n<4ab1> <4ab3> <8ae8>\n<4ab5> <4ab6> <8aef>\n<4ab8> <4ab9> <8af4>\n<4ac0> <4ac1> <8b08>\n<4ac2> <4ac4> <8b0b>\n<4ac6> <4ac8> <8b11>\n<4acc> <4ace> <8b1e>\n<4acf> <4ad2> <8b22>\n<4ad4> <4ad5> <8b29>\n<4ad6> <4ada> <8b2e>\n<4adb> <4adf> <8b34>\n<4ae0> <4ae3> <8b3a>\n<4ae4> <4aed> <8b3f>\n<4aee> <4af1> <8b4a>\n<4af2> <4af7> <8b50>\n<4afa> <4aff> <8b5d>\n<4b00> <4b02> <8b63>\n<4b03> <4b06> <8b67>\n<4b07> <4b08> <8b6d>\n<4b09> <4b0b> <8b71>\n<4b0c> <4b0d> <8b75>\n<4b0e> <4b12> <8b78>\n<4b13> <4b14> <8b7e>\n<4b15> <4b1d> <8b81>\n<4b1e> <4b20> <8b8b>\n<4b21> <4b23> <8b8f>\n<4b25> <4b29> <8b97>\n<4b34> <4b3c> <8c38>\n<4b3d> <4b40> <8c42>\n<4b41> <4b42> <8c4a>\n<4b43> <4b45> <8c4d>\n<4b46> <4b49> <8c51>\n<4b4a> <4b4d> <8c56>\n<4b4e> <4b53> <8c5b>\n<4b54> <4b5a> <8c63>\n<4b5b> <4b61> <8c6c>\n<4b62> <4b65> <8c74>\n<4b66> <4b6c> <8c7b>\n<4b6d> <4b6e> <8c83>\n<4b6f> <4b71> <8c86>\n<4b73> <4b79> <8c8d>\n<4b7a> <4b7c> <8c95>\n<4b7d> <4b80> <8c99>\n<4b82> <4b85> <8ca3>\n<4b86> <4b87> <8cad>\n<4b8e> <4b93> <8ccb>\n<4b95> <4b98> <8cd6>\n<4b9d> <4b9e> <8ce8>\n<4b9f> <4ba4> <8cee>\n<4ba5> <4ba9> <8cf5>\n<4baa> <4bae> <8cff>\n<4baf> <4bb0> <8d06>\n<4bb4> <4bb8> <8d11>\n<4bb9> <4bbc> <8d17>\n<4bbe> <4bbf> <8d51>\n<4bc3> <4bc5> <8d68>\n<4bc7> <4bc8> <8d6e>\n<4bc9> <4bca> <8d71>\n<4bcb> <4bd3> <8d78>\n<4bd4> <4bd5> <8d82>\n<4bd6> <4bd9> <8d86>\n<4bda> <4bde> <8d8c>\n<4bdf> <4be0> <8d92>\n<4be1> <4be3> <8d96>\n<4be4> <4be8> <8d9a>\n<4be9> <4beb> <8da0>\n<4bec> <4bef> <8da4>\n<4bf0> <4bf7> <8da9>\n<4bf8> <4bf9> <8db6>\n<4bfd> <4bff> <8dc0>\n<4c01> <4c04> <8dc7>\n<4c07> <4c0a> <8dd2>\n<4c0b> <4c0c> <8dd8>\n<4c0e> <4c10> <8de0>\n<4c11> <4c13> <8de5>\n<4c15> <4c16> <8ded>\n<4c17> <4c19> <8df0>\n<4c1d> <4c23> <8dfe>\n<4c24> <4c26> <8e06>\n<4c28> <4c29> <8e0d>\n<4c2a> <4c2c> <8e11>\n<4c2d> <4c34> <8e15>\n<4c35> <4c36> <8e20>\n<4c37> <4c3b> <8e24>\n<4c3f> <4c40> <8e32>\n<4c41> <4c43> <8e36>\n<4c44> <4c45> <8e3b>\n<4c46> <4c47> <8e3e>\n<4c49> <4c4a> <8e45>\n<4c4b> <4c4e> <8e4d>\n<4c4f> <4c50> <8e53>\n<4c51> <4c53> <8e56>\n<4c54> <4c5c> <8e5a>\n<4c5d> <4c5e> <8e64>\n<4c5f> <4c60> <8e67>\n<4c61> <4c62> <8e6a>\n<4c67> <4c69> <8e77>\n<4c6b> <4c6c> <8e7d>\n<4c6e> <4c70> <8e82>\n<4c75> <4c79> <8e95>\nendbfrange\n\n100 beginbfrange\n<4c7c> <4c7d> <8e9f>\n<4c7e> <4c80> <8ea2>\n<4c81> <4c83> <8ea7>\n<4c84> <4c85> <8ead>\n<4c86> <4c87> <8eb0>\n<4c88> <4c8e> <8eb3>\n<4c8f> <4c93> <8ebb>\n<4c94> <4c9c> <8ec1>\n<4c9d> <4c9f> <8ecf>\n<4ca1> <4ca6> <8ed5>\n<4ca7> <4ca9> <8edc>\n<4caa> <4cad> <8ee0>\n<4cae> <4cb3> <8ee5>\n<4cb4> <4cb9> <8eec>\n<4cba> <4cbe> <8ef3>\n<4cc0> <4cc3> <8eff>\n<4cc7> <4ccd> <8f0b>\n<4ccf> <4cd3> <8f16>\n<4cd4> <4cd8> <8f20>\n<4cd9> <4cda> <8f27>\n<4cdb> <4cde> <8f2b>\n<4cdf> <4ce1> <8f30>\n<4ce2> <4ce5> <8f34>\n<4ce6> <4ce7> <8f39>\n<4ce8> <4ce9> <8f3c>\n<4cea> <4ceb> <8f40>\n<4ced> <4cee> <8f47>\n<4cef> <4cf1> <8f4a>\n<4cf2> <4cf6> <8f4f>\n<4cf7> <4cff> <8f55>\n<4d09> <4d0b> <8fa0>\n<4d0c> <4d0d> <8fa4>\n<4d11> <4d13> <8fb3>\n<4d14> <4d15> <8fb7>\n<4d16> <4d18> <8fba>\n<4d19> <4d1a> <8fbf>\n<4d1d> <4d21> <8fc9>\n<4d24> <4d25> <8fd6>\n<4d27> <4d28> <8fe0>\n<4d2d> <4d2e> <8ff1>\n<4d2f> <4d30> <8ff5>\n<4d31> <4d33> <8ffa>\n<4d34> <4d35> <8ffe>\n<4d36> <4d37> <9007>\n<4d3d> <4d3e> <9024>\n<4d3f> <4d44> <9027>\n<4d45> <4d46> <9030>\n<4d47> <4d48> <9033>\n<4d4a> <4d4b> <9039>\n<4d4d> <4d4e> <903f>\n<4d50> <4d51> <9045>\n<4d52> <4d54> <9048>\n<4d57> <4d58> <9059>\n<4d5d> <4d5e> <9066>\n<4d5f> <4d61> <906a>\n<4d62> <4d64> <906f>\n<4d6a> <4d6b> <9085>\n<4d6d> <4d6f> <908c>\n<4d76> <4d78> <909e>\n<4d79> <4d7a> <90a4>\n<4d7b> <4d7d> <90a7>\n<4d82> <4d83> <90bc>\n<4d84> <4d85> <90bf>\n<4d86> <4d87> <90c2>\n<4d89> <4d8a> <90c8>\n<4d8b> <4d8d> <90cb>\n<4d8f> <4d91> <90d4>\n<4d92> <4d94> <90d8>\n<4d97> <4d99> <90e3>\n<4d9a> <4d9b> <90e9>\n<4d9e> <4da1> <90f0>\n<4da2> <4da3> <90f6>\n<4da4> <4da7> <90f9>\n<4da8> <4daa> <90ff>\n<4dad> <4dae> <9107>\n<4daf> <4db6> <910a>\n<4db9> <4dba> <9117>\n<4dbb> <4dbe> <911a>\n<4dbf> <4dc1> <911f>\n<4dc2> <4dc4> <9124>\n<4dc5> <4dc9> <9128>\n<4dcd> <4dce> <9137>\n<4dcf> <4dd6> <913b>\n<4dd7> <4dd8> <9144>\n<4ddb> <4dde> <9153>\n<4ddf> <4de0> <9158>\n<4de1> <4de2> <915b>\n<4de3> <4de4> <915f>\n<4de5> <4de7> <9166>\n<4deb> <4ded> <917a>\n<4dee> <4df2> <9180>\n<4df6> <4df7> <918e>\n<4df8> <4dfa> <9193>\n<4dfb> <4dfd> <9197>\n<4dfe> <4dff> <919d>\n<4e00> <4e02> <919f>\n<4e03> <4e08> <91a4>\n<4e09> <4e0c> <91b0>\n<4e0d> <4e10> <91b6>\n<4e11> <4e15> <91bb>\nendbfrange\n\n100 beginbfrange\n<4e1c> <4e1d> <91da>\n<4e1e> <4e22> <91de>\n<4e23> <4e24> <91e5>\n<4e26> <4e30> <91ea>\n<4e33> <4e37> <91fb>\n<4e38> <4e39> <9202>\n<4e3a> <4e3c> <9205>\n<4e3d> <4e3f> <920a>\n<4e41> <4e42> <9212>\n<4e43> <4e4a> <9216>\n<4e4b> <4e4e> <921f>\n<4e50> <4e55> <9228>\n<4e57> <4e58> <9231>\n<4e59> <4e5a> <9235>\n<4e5b> <4e5c> <923b>\n<4e5d> <4e60> <9241>\n<4e61> <4e62> <9246>\n<4e63> <4e65> <924a>\n<4e66> <4e68> <924e>\n<4e69> <4e6b> <9252>\n<4e6d> <4e6e> <9258>\n<4e6f> <4e70> <925c>\n<4e71> <4e73> <925f>\n<4e74> <4e76> <9263>\n<4e77> <4e7b> <9267>\n<4e7c> <4e81> <926e>\n<4e82> <4e84> <9275>\n<4e86> <4e88> <927c>\n<4e89> <4e8a> <9281>\n<4e8c> <4e93> <9286>\n<4e94> <4e95> <928f>\n<4e97> <4e98> <9294>\n<4e9c> <4e9e> <929d>\n<4e9f> <4ea0> <92a1>\n<4ea4> <4ea5> <92af>\n<4ea6> <4eaa> <92b2>\n<4ead> <4eb0> <92bd>\n<4eb4> <4eb6> <92c9>\n<4eb7> <4eb8> <92cd>\n<4eb9> <4eba> <92d0>\n<4ebb> <4ec4> <92d3>\n<4ec6> <4ec8> <92e0>\n<4ecb> <4ecc> <92eb>\n<4ecd> <4ed0> <92f2>\n<4ed2> <4ed4> <92f9>\n<4ed5> <4ed8> <92fd>\n<4ed9> <4edc> <9302>\n<4edd> <4ee3> <9309>\n<4ee5> <4ee6> <9313>\n<4ee7> <4ee8> <9316>\n<4ee9> <4eeb> <931c>\n<4eed> <4eef> <9323>\n<4ef1> <4ef2> <9329>\n<4ef3> <4ef4> <932c>\n<4ef5> <4ef6> <9330>\n<4ef7> <4ef8> <9334>\n<4efa> <4efe> <9339>\n<4f01> <4f02> <9344>\n<4f03> <4f05> <9348>\n<4f07> <4f0c> <934e>\n<4f0d> <4f0f> <9355>\n<4f10> <4f11> <9359>\n<4f12> <4f19> <935c>\n<4f1a> <4f1c> <9366>\n<4f1e> <4f20> <936d>\n<4f21> <4f24> <9371>\n<4f25> <4f27> <9377>\n<4f28> <4f2a> <937b>\n<4f2b> <4f2d> <937f>\n<4f2f> <4f30> <9385>\n<4f31> <4f32> <9388>\n<4f33> <4f36> <938b>\n<4f37> <4f3c> <9390>\n<4f3e> <4f46> <9399>\n<4f47> <4f48> <93a4>\n<4f4d> <4f4e> <93b1>\n<4f50> <4f51> <93b6>\n<4f52> <4f57> <93b9>\n<4f58> <4f5a> <93c0>\n<4f5b> <4f5d> <93c4>\n<4f60> <4f62> <93ce>\n<4f63> <4f66> <93d2>\n<4f67> <4f69> <93d9>\n<4f6c> <4f6e> <93e5>\n<4f6f> <4f7a> <93e9>\n<4f7d> <4f85> <93fa>\n<4f86> <4f8c> <9404>\n<4f8d> <4f90> <940c>\n<4f92> <4f94> <9415>\n<4f95> <4f97> <941a>\n<4f98> <4f99> <941e>\n<4f9a> <4f9e> <9421>\n<4f9f> <4fa3> <9429>\n<4fa4> <4fa6> <942f>\n<4fa8> <4fa9> <9436>\n<4fab> <4fad> <943b>\n<4fae> <4fb1> <9440>\n<4fb2> <4fb6> <9445>\n<4fb8> <4fbc> <944d>\n<4fbe> <4fc8> <9455>\nendbfrange\n\n100 beginbfrange\n<4fc9> <4fca> <9461>\n<4fcc> <4fd0> <9466>\n<4fd2> <4fd3> <946e>\n<4fd5> <4fd8> <9473>\n<4fda> <4fdb> <947a>\n<4fdc> <4fe0> <9480>\n<4fe6> <4fe7> <94d3>\n<4ff7> <4ff8> <9574>\n<4ff9> <4fff> <9578>\n<5001> <5002> <9584>\n<5003> <5004> <9587>\n<5009> <500b> <9595>\n<500c> <5013> <9599>\n<5015> <5016> <95a6>\n<5018> <501b> <95ae>\n<501c> <501e> <95b3>\n<501f> <5020> <95b7>\n<5022> <5024> <95c0>\n<5025> <5026> <95c4>\n<5029> <502b> <95cd>\n<502c> <502e> <95d1>\n<502f> <5033> <95d7>\n<5035> <5036> <95df>\n<5037> <5038> <95e3>\n<5039> <503a> <95e6>\n<5043> <5049> <9623>\n<504a> <504c> <962b>\n<504d> <504e> <962f>\n<504f> <5052> <9637>\n<5057> <5058> <964e>\n<5059> <505b> <9651>\n<505c> <505d> <9656>\n<505e> <505f> <9659>\n<5063> <5064> <9665>\n<5066> <5068> <966d>\n<506a> <506d> <9679>\n<506e> <5074> <967e>\n<5078> <507a> <9691>\n<507d> <5086> <969d>\n<5088> <508c> <96ab>\n<5092> <5093> <96c2>\n<5095> <5096> <96ca>\n<5097> <5098> <96d0>\n<5099> <509a> <96d3>\n<509b> <509c> <96d7>\n<509e> <50a0> <96dd>\n<50a2> <50a5> <96e4>\n<50a6> <50a9> <96eb>\n<50aa> <50ab> <96f0>\n<50ac> <50ad> <96f4>\n<50b0> <50b1> <96fc>\n<50b3> <50b4> <9702>\n<50b6> <50b8> <970a>\n<50b9> <50bb> <9710>\n<50bc> <50bd> <9714>\n<50be> <50c2> <9717>\n<50c4> <50cb> <971f>\n<50cc> <50cd> <9728>\n<50ce> <50cf> <972b>\n<50d0> <50d1> <972e>\n<50d3> <50d7> <9733>\n<50d8> <50da> <973a>\n<50db> <50dd> <973f>\n<50df> <50e1> <9745>\n<50e2> <50ea> <9749>\n<50eb> <50ec> <9754>\n<50ed> <50ee> <9757>\n<50ef> <50f0> <975c>\n<50f2> <50f3> <9763>\n<50f4> <50f5> <9766>\n<50f6> <50fe> <976a>\n<5100> <5104> <9777>\n<5105> <510c> <977d>\n<510d> <5111> <9786>\n<5116> <5118> <9795>\n<5119> <511f> <9799>\n<5120> <5121> <97a1>\n<5122> <5123> <97a4>\n<5124> <5127> <97a7>\n<512a> <512b> <97b0>\n<512d> <5134> <97b5>\n<5135> <5139> <97be>\n<513a> <513b> <97c4>\n<513c> <513d> <97c7>\n<513f> <5144> <97cd>\n<5145> <5149> <97d4>\n<514a> <514b> <97da>\n<514d> <5153> <97df>\n<5155> <5159> <97ee>\n<515b> <5162> <97f7>\n<5168> <516a> <9814>\n<516b> <516d> <9819>\n<516e> <5171> <981d>\n<5172> <5173> <9822>\n<5175> <517a> <9827>\n<517b> <517c> <982e>\n<517d> <5182> <9831>\n<5183> <5184> <9839>\n<5186> <518d> <983e>\n<518e> <5192> <9847>\nendbfrange\n\n100 beginbfrange\n<5193> <5196> <984f>\n<5197> <5199> <9855>\n<519b> <519c> <985c>\n<519d> <519f> <985f>\n<51a0> <51a1> <9863>\n<51a3> <51a5> <9868>\n<51a6> <51a7> <986d>\n<51af> <51b3> <98a9>\n<51b6> <51b7> <98b4>\n<51b8> <51bc> <98b7>\n<51bd> <51c3> <98bd>\n<51c6> <51ca> <98c9>\n<51cb> <51cc> <98cf>\n<51ce> <51cf> <98d6>\n<51d0> <51d1> <98dc>\n<51d3> <51d6> <98e3>\n<51d9> <51da> <98f0>\n<51dc> <51e2> <98f5>\n<51e3> <51e6> <98ff>\n<51e8> <51ea> <9906>\n<51ec> <51ed> <990e>\n<51ee> <51f1> <9914>\n<51f2> <51f3> <9919>\n<51f4> <51f5> <991c>\n<51f6> <51f7> <991f>\n<51f8> <51fd> <9922>\n<51fe> <51ff> <9929>\n<5200> <5202> <992b>\n<5203> <5206> <992f>\n<5207> <5209> <9934>\n<520a> <520d> <9938>\n<520f> <5211> <9940>\n<5213> <5214> <9946>\n<5215> <5218> <994d>\n<521b> <521e> <9958>\n<5220> <5222> <995f>\n<5226> <5227> <9978>\n<522a> <522b> <9982>\n<522f> <5239> <999a>\n<523a> <523b> <99a6>\n<523c> <523e> <99a9>\n<523f> <5240> <99af>\n<5242> <524d> <99b5>\n<524e> <525b> <99c2>\n<525d> <525e> <99d6>\n<5263> <526c> <99e3>\n<526d> <526f> <99ee>\n<5270> <527c> <99f2>\n<527e> <5280> <9a02>\n<5281> <5287> <9a06>\n<5288> <528d> <9a10>\n<528e> <528f> <9a17>\n<5290> <52a0> <9a1a>\n<52a3> <52a7> <9a31>\n<52a8> <52ac> <9a39>\n<52ae> <52b1> <9a46>\n<52b2> <52b3> <9a4b>\n<52b5> <52b9> <9a50>\n<52bb> <52bc> <9a58>\n<52bd> <52bf> <9a5c>\n<52c0> <52c1> <9a60>\n<52c3> <52c6> <9a66>\n<52cb> <52cc> <9a8d>\n<52cd> <52ce> <9a94>\n<52d1> <52d6> <9aa9>\n<52d7> <52da> <9ab2>\n<52dd> <52df> <9abd>\n<52e0> <52e1> <9ac3>\n<52e2> <52e6> <9ac6>\n<52e7> <52e8> <9acd>\n<52eb> <52f0> <9ad9>\n<52f2> <52f5> <9ae2>\n<52f6> <52f9> <9ae7>\n<52fb> <52ff> <9af0>\n<5300> <5303> <9af5>\n<5305> <530b> <9afc>\n<530c> <530d> <9b04>\n<530f> <5312> <9b09>\n<5314> <5316> <9b10>\n<5317> <531c> <9b14>\n<531d> <5320> <9b1b>\n<5321> <5322> <9b20>\n<5326> <5329> <9b2a>\n<532b> <5332> <9b33>\n<5333> <5336> <9b3d>\n<5338> <533a> <9b4a>\n<533c> <533d> <9b52>\n<533e> <5340> <9b55>\n<5342> <5355> <9b5b>\n<5356> <5359> <9b70>\n<535a> <535b> <9b75>\n<535c> <5364> <9b78>\n<5366> <536f> <9b84>\n<5371> <5377> <9b93>\n<5378> <5379> <9b9b>\n<537a> <5384> <9b9f>\n<5386> <5396> <9baf>\n<5397> <539b> <9bc2>\n<539d> <53a5> <9bcb>\n<53a7> <53aa> <9bd7>\nendbfrange\n\n100 beginbfrange\n<53ac> <53ae> <9bde>\n<53b0> <53b1> <9be5>\n<53b3> <53b6> <9bec>\n<53b7> <53b9> <9bf1>\n<53ba> <53c1> <9bf5>\n<53c3> <53ca> <9c00>\n<53cb> <53cd> <9c0a>\n<53ce> <53cf> <9c0e>\n<53d1> <53dc> <9c14>\n<53dd> <53de> <9c21>\n<53e0> <53e1> <9c26>\n<53e2> <53e4> <9c2a>\n<53e5> <53e7> <9c2e>\n<53ec> <53ed> <9c3c>\n<53ee> <53f3> <9c3f>\n<53f4> <53f5> <9c46>\n<53f6> <53fd> <9c4a>\n<5400> <5403> <9c59>\n<5405> <540b> <9c60>\n<540c> <5410> <9c68>\n<5411> <541a> <9c6e>\n<541d> <541e> <9c7d>\n<5420> <5421> <9c83>\n<5422> <5423> <9c89>\n<5427> <542a> <9c96>\n<5430> <5434> <9cbe>\n<5435> <5436> <9cc8>\n<5437> <5438> <9cd1>\n<5439> <543a> <9cda>\n<543b> <543c> <9ce0>\n<543d> <543e> <9ce3>\n<543f> <5441> <9ce6>\n<5442> <5443> <9cea>\n<5444> <5449> <9ced>\n<544b> <5459> <9cf7>\n<545b> <5465> <9d0a>\n<5466> <546a> <9d16>\n<546d> <546f> <9d20>\n<5470> <5471> <9d24>\n<5473> <5478> <9d29>\n<5479> <5482> <9d31>\n<5483> <5485> <9d3c>\n<5486> <5487> <9d40>\n<5488> <5495> <9d43>\n<5496> <549d> <9d54>\n<549e> <549f> <9d5e>\n<54a0> <54a7> <9d62>\n<54a9> <54aa> <9d6d>\n<54ab> <54ac> <9d70>\n<54ad> <54c0> <9d73>\n<54c2> <54ca> <9d8a>\n<54cb> <54ce> <9d94>\n<54d0> <54d9> <9d9b>\n<54da> <54dc> <9da6>\n<54dd> <54e1> <9daa>\n<54e2> <54e5> <9db0>\n<54e6> <54eb> <9db5>\n<54ec> <54ee> <9dbd>\n<54f1> <54fe> <9dc5>\n<5500> <5501> <9dd5>\n<5503> <550c> <9ddb>\n<550d> <5514> <9de7>\n<5515> <5516> <9df0>\n<5517> <551a> <9df4>\n<551b> <552b> <9dfb>\n<552c> <5533> <9e0d>\n<5534> <5537> <9e16>\n<553e> <553f> <9e3b>\n<5543> <5545> <9e52>\n<5549> <554c> <9e5f>\n<554e> <554f> <9e6e>\n<5552> <5554> <9e76>\n<5556> <5557> <9e80>\n<5558> <555b> <9e83>\n<555c> <555d> <9e89>\n<555e> <5563> <9e8c>\n<5564> <5566> <9e94>\n<5567> <556b> <9e98>\n<556d> <5571> <9ea0>\n<5572> <5573> <9ea7>\n<5574> <5578> <9eaa>\n<5579> <557c> <9eb0>\n<557d> <557e> <9eb6>\n<557f> <5580> <9eb9>\n<5582> <5586> <9ebf>\n<5587> <558a> <9ec5>\n<558b> <558c> <9eca>\n<558e> <558f> <9ed2>\n<5590> <5592> <9ed5>\n<5593> <5594> <9ed9>\n<5596> <5597> <9ee3>\n<5599> <559c> <9eeb>\n<559d> <559e> <9ef0>\n<55a0> <55a1> <9ef5>\n<55a4> <55ac> <9f00>\n<55b0> <55b1> <9f11>\n<55b5> <55ba> <9f1a>\n<55bc> <55c4> <9f23>\n<55c5> <55c6> <9f2d>\n<55c7> <55cd> <9f30>\nendbfrange\n\n100 beginbfrange\n<55d1> <55d5> <9f3f>\n<55d6> <55da> <9f45>\n<55db> <55dd> <9f4c>\n<55df> <55e2> <9f55>\n<55e3> <55e4> <9f5a>\n<55e5> <55e6> <9f5d>\n<55e8> <55e9> <9f64>\n<55ea> <55ec> <9f67>\n<55ee> <55f2> <9f6d>\n<55f3> <55f6> <9f73>\n<55f7> <55fd> <9f78>\n<55fe> <55ff> <9f81>\n<5600> <5601> <9f8e>\n<5602> <5604> <9f91>\n<5605> <5607> <9f96>\n<5608> <5609> <9f9d>\n<560a> <560e> <9fa1>\n<5610> <5612> <fa0d>\n<5614> <5615> <fa13>\n<5617> <5619> <fa1f>\n<561a> <561b> <fa23>\n<561c> <561e> <fa27>\n<5635> <5636> <9fb6>\n<5643> <5644> <2eb6>\n<5656> <5657> <4982>\n<5658> <5659> <4985>\n<5661> <5663> <4c9f>\n<5666> <566c> <4d13>\n<566f> <56cd> <0020>\n<56d2> <56ff> <0021>\n<5700> <572f> <004f>\n<576b> <576c> <30f5>\n<577b> <577d> <3033>\n<577e> <5780> <3038>\n<5781> <5783> <312a>\n<5784> <579b> <31a0>\n<579d> <579e> <2e82>\n<579f> <57a1> <2e85>\n<57a2> <57a3> <2e89>\n<57a4> <57ad> <2e8d>\n<57ae> <57af> <2e98>\n<57b0> <57bb> <2e9b>\n<57bc> <57bd> <2ea8>\n<57be> <57c0> <2eab>\n<57c1> <57c4> <2eaf>\n<57c5> <57c6> <2eb4>\n<57c7> <57c9> <2eb8>\n<57ca> <57d7> <2ebc>\n<57d8> <57ff> <2ecb>\n<5801> <5847> <3400>\n<5848> <5872> <3448>\n<5873> <58ff> <3474>\n<5900> <599c> <3501>\n<599d> <59ff> <359f>\n<5a00> <5a0b> <3602>\n<5a0c> <5a16> <360f>\n<5a17> <5aff> <361b>\n<5b00> <5bff> <3704>\n<5c00> <5cff> <3804>\n<5d00> <5d13> <3904>\n<5d14> <5d68> <3919>\n<5d69> <5dc8> <396f>\n<5dc9> <5dd6> <39d1>\n<5dd7> <5dff> <39e0>\n<5e00> <5e69> <3a09>\n<5e6a> <5eff> <3a74>\n<5f00> <5f43> <3b0a>\n<5f44> <5fff> <3b4f>\n<6000> <6062> <3c0b>\n<6063> <60d3> <3c6f>\n<60d4> <60ff> <3ce1>\n<6100> <61ff> <3d0d>\n<6200> <62ff> <3e0d>\n<6300> <63ff> <3f0d>\n<6400> <6448> <400d>\n<6449> <64ff> <4057>\n<6500> <6550> <410e>\n<6551> <65ff> <4160>\n<6600> <66ff> <420f>\n<6700> <6727> <430f>\n<6728> <679b> <4338>\n<679c> <679f> <43ad>\n<67a0> <67ca> <43b2>\n<67cb> <67ff> <43de>\n<6800> <68c2> <4413>\n<68c3> <68ff> <44d7>\n<6900> <69ff> <4514>\n<6a00> <6a37> <4614>\n<6a38> <6a4b> <464d>\n<6a4c> <6aff> <4662>\n<6b00> <6b0c> <4716>\n<6b0d> <6b11> <4724>\n<6b12> <6b63> <472a>\n<6b64> <6b73> <477d>\n<6b74> <6bff> <478e>\n<6c00> <6cff> <481a>\n<6d00> <6d2c> <491a>\n<6d2d> <6d5e> <4948>\n<6d5f> <6d60> <497b>\n<6d61> <6d64> <497e>\nendbfrange\n\n19 beginbfrange\n<6d66> <6d79> <4987>\n<6d7a> <6d7c> <499c>\n<6d7d> <6d92> <49a0>\n<6d93> <6dff> <49b8>\n<6e00> <6eff> <4a25>\n<6f00> <6fff> <4b25>\n<7000> <7051> <4c25>\n<7052> <7078> <4c78>\n<7079> <70e7> <4ca4>\n<70e8> <70ff> <4d1a>\n<7100> <717b> <4d32>\n<717c> <7182> <4daf>\n<7188> <71ff> <a000>\n<7200> <72ff> <a078>\n<7300> <73ff> <a178>\n<7400> <74ff> <a278>\n<7500> <75ff> <a378>\n<7600> <7614> <a478>\n<7615> <764b> <a490>\nendbfrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/GB-EUC-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (GB-EUC-H)\n%%Title: (GB-EUC-H Adobe GB1 0)\n%%Version: 9.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 0 def\nend def\n\n/CMapName /GB-EUC-H def\n/CMapVersion 9.003 def\n/CMapType 1 def\n\n/UIDOffset 100 def\n/XUID [1 10 25360] def\n\n/WMode 0 def\n\n2 begincodespacerange\n  <00>   <80>\n  <A1A1> <FEFE>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 7716\nendnotdefrange\n\n90 begincidrange\n<20> <20> 7716\n<21> <7e> 814\n<a1a1> <a1fe> 96\n<a2b1> <a2e2> 190\n<a2e5> <a2ee> 240\n<a2f1> <a2fc> 250\n<a3a1> <a3fe> 262\n<a4a1> <a4f3> 356\n<a5a1> <a5f6> 439\n<a6a1> <a6b8> 525\n<a6c1> <a6f5> 549\n<a7a1> <a7c1> 602\n<a7d1> <a7f1> 635\n<a8a1> <a8c0> 668\n<a8c5> <a8ea> 700\n<a9a4> <a9ef> 738\n<aaa1> <aafe> 814\n<aba1> <abc0> 908\n<b0a1> <b0fe> 940\n<b1a1> <b1fe> 1034\n<b2a1> <b2fe> 1128\n<b3a1> <b3fe> 1222\n<b4a1> <b4fe> 1316\n<b5a1> <b5fe> 1410\n<b6a1> <b6fe> 1504\n<b7a1> <b7fe> 1598\n<b8a1> <b8fe> 1692\n<b9a1> <b9fe> 1786\n<baa1> <bafe> 1880\n<bba1> <bbfe> 1974\n<bca1> <bcfe> 2068\n<bda1> <bdfe> 2162\n<bea1> <befe> 2256\n<bfa1> <bffe> 2350\n<c0a1> <c0fe> 2444\n<c1a1> <c1fe> 2538\n<c2a1> <c2fe> 2632\n<c3a1> <c3fe> 2726\n<c4a1> <c4fe> 2820\n<c5a1> <c5fe> 2914\n<c6a1> <c6fe> 3008\n<c7a1> <c7fe> 3102\n<c8a1> <c8fe> 3196\n<c9a1> <c9fe> 3290\n<caa1> <cafe> 3384\n<cba1> <cbfe> 3478\n<cca1> <ccfe> 3572\n<cda1> <cdfe> 3666\n<cea1> <cefe> 3760\n<cfa1> <cffe> 3854\n<d0a1> <d0fe> 3948\n<d1a1> <d1fe> 4042\n<d2a1> <d2fe> 4136\n<d3a1> <d3fe> 4230\n<d4a1> <d4fe> 4324\n<d5a1> <d5fe> 4418\n<d6a1> <d6fe> 4512\n<d7a1> <d7f9> 4606\n<d8a1> <d8fe> 4695\n<d9a1> <d9fe> 4789\n<daa1> <dafe> 4883\n<dba1> <dbfe> 4977\n<dca1> <dcfe> 5071\n<dda1> <ddfe> 5165\n<dea1> <defe> 5259\n<dfa1> <dffe> 5353\n<e0a1> <e0fe> 5447\n<e1a1> <e1fe> 5541\n<e2a1> <e2fe> 5635\n<e3a1> <e3fe> 5729\n<e4a1> <e4fe> 5823\n<e5a1> <e5fe> 5917\n<e6a1> <e6fe> 6011\n<e7a1> <e7fe> 6105\n<e8a1> <e8fe> 6199\n<e9a1> <e9fe> 6293\n<eaa1> <eafe> 6387\n<eba1> <ebfe> 6481\n<eca1> <ecfe> 6575\n<eda1> <edfe> 6669\n<eea1> <eefe> 6763\n<efa1> <effe> 6857\n<f0a1> <f0fe> 6951\n<f1a1> <f1fe> 7045\n<f2a1> <f2fe> 7139\n<f3a1> <f3fe> 7233\n<f4a1> <f4fe> 7327\n<f5a1> <f5fe> 7421\n<f6a1> <f6fe> 7515\n<f7a1> <f7fe> 7609\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/GB-EUC-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (GB-EUC-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (GB-EUC-H)\n%%BeginResource: CMap (GB-EUC-V)\n%%Title: (GB-EUC-V Adobe GB1 0)\n%%Version: 9.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/GB-EUC-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 0 def\nend def\n\n/CMapName /GB-EUC-V def\n/CMapVersion 9.003 def\n/CMapType 1 def\n\n/UIDOffset 310 def\n/XUID [1 10 25361] def\n\n/WMode 1 def\n\n20 begincidrange\n<a1a2> <a1a2>  575\n<a1a3> <a1a3>  574\n<a1aa> <a1aa>  598\n<a1ab> <a1ac> 7704\n<a1ad> <a1ad>  599\n<a1b2> <a1bf>  582\n<a1fe> <a1fe> 7706\n<a3a1> <a3a1>  578\n<a3a8> <a3a9>  580\n<a3ac> <a3ac>  573\n<a3ae> <a3ae> 7707\n<a3ba> <a3bb>  576\n<a3bd> <a3bd> 7708\n<a3bf> <a3bf>  579\n<a3db> <a3db> 7709\n<a3dd> <a3dd> 7710\n<a3df> <a3df>  600\n<a3fb> <a3fb>  596\n<a3fd> <a3fd>  597\n<a3fe> <a3fe> 7711\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/GB-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (GB-H)\n%%Title: (GB-H Adobe GB1 0)\n%%Version: 9.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 0 def\nend def\n\n/CMapName /GB-H def\n/CMapVersion 9.003 def\n/CMapType 1 def\n\n/UIDOffset 200 def\n/XUID [1 10 25362] def\n\n/WMode 0 def\n\n1 begincodespacerange\n  <2121> <7E7E>\nendcodespacerange\n\n88 begincidrange\n<2121> <217e> 96\n<2231> <2262> 190\n<2265> <226e> 240\n<2271> <227c> 250\n<2321> <237e> 262\n<2421> <2473> 356\n<2521> <2576> 439\n<2621> <2638> 525\n<2641> <2675> 549\n<2721> <2741> 602\n<2751> <2771> 635\n<2821> <2840> 668\n<2845> <286a> 700\n<2924> <296f> 738\n<2a21> <2a7e> 814\n<2b21> <2b40> 908\n<3021> <307e> 940\n<3121> <317e> 1034\n<3221> <327e> 1128\n<3321> <337e> 1222\n<3421> <347e> 1316\n<3521> <357e> 1410\n<3621> <367e> 1504\n<3721> <377e> 1598\n<3821> <387e> 1692\n<3921> <397e> 1786\n<3a21> <3a7e> 1880\n<3b21> <3b7e> 1974\n<3c21> <3c7e> 2068\n<3d21> <3d7e> 2162\n<3e21> <3e7e> 2256\n<3f21> <3f7e> 2350\n<4021> <407e> 2444\n<4121> <417e> 2538\n<4221> <427e> 2632\n<4321> <437e> 2726\n<4421> <447e> 2820\n<4521> <457e> 2914\n<4621> <467e> 3008\n<4721> <477e> 3102\n<4821> <487e> 3196\n<4921> <497e> 3290\n<4a21> <4a7e> 3384\n<4b21> <4b7e> 3478\n<4c21> <4c7e> 3572\n<4d21> <4d7e> 3666\n<4e21> <4e7e> 3760\n<4f21> <4f7e> 3854\n<5021> <507e> 3948\n<5121> <517e> 4042\n<5221> <527e> 4136\n<5321> <537e> 4230\n<5421> <547e> 4324\n<5521> <557e> 4418\n<5621> <567e> 4512\n<5721> <5779> 4606\n<5821> <587e> 4695\n<5921> <597e> 4789\n<5a21> <5a7e> 4883\n<5b21> <5b7e> 4977\n<5c21> <5c7e> 5071\n<5d21> <5d7e> 5165\n<5e21> <5e7e> 5259\n<5f21> <5f7e> 5353\n<6021> <607e> 5447\n<6121> <617e> 5541\n<6221> <627e> 5635\n<6321> <637e> 5729\n<6421> <647e> 5823\n<6521> <657e> 5917\n<6621> <667e> 6011\n<6721> <677e> 6105\n<6821> <687e> 6199\n<6921> <697e> 6293\n<6a21> <6a7e> 6387\n<6b21> <6b7e> 6481\n<6c21> <6c7e> 6575\n<6d21> <6d7e> 6669\n<6e21> <6e7e> 6763\n<6f21> <6f7e> 6857\n<7021> <707e> 6951\n<7121> <717e> 7045\n<7221> <727e> 7139\n<7321> <737e> 7233\n<7421> <747e> 7327\n<7521> <757e> 7421\n<7621> <767e> 7515\n<7721> <777e> 7609\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/GB-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (GB-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (GB-H)\n%%BeginResource: CMap (GB-V)\n%%Title: (GB-V Adobe GB1 0)\n%%Version: 9.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/GB-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 0 def\nend def\n\n/CMapName /GB-V def\n/CMapVersion 9.003 def\n/CMapType 1 def\n\n/UIDOffset 320 def\n/XUID [1 10 25363] def\n\n/WMode 1 def\n\n20 begincidrange\n<2122> <2122>  575\n<2123> <2123>  574\n<212a> <212a>  598\n<212b> <212c> 7704\n<212d> <212d>  599\n<2132> <213f>  582\n<217e> <217e> 7706\n<2321> <2321>  578\n<2328> <2329>  580\n<232c> <232c>  573\n<232e> <232e> 7707\n<233a> <233b>  576\n<233d> <233d> 7708\n<233f> <233f>  579\n<235b> <235b> 7709\n<235d> <235d> 7710\n<235f> <235f>  600\n<237b> <237b>  596\n<237d> <237d>  597\n<237e> <237e> 7711\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/GBK-EUC-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (GBK-EUC-H)\n%%Title: (GBK-EUC-H Adobe GB1 2)\n%%Version: 11.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 2 def\nend def\n\n/CMapName /GBK-EUC-H def\n/CMapVersion 11.003 def\n/CMapType 1 def\n\n/XUID [1 10 25377] def\n\n/WMode 0 def\n\n2 begincodespacerange\n  <00>   <80>\n  <8140> <FEFE>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 7716\nendnotdefrange\n\n100 begincidrange\n<20> <20> 7716\n<21> <7e> 814\n<8140> <8178> 10072\n<8179> <8179> 8281\n<817a> <817e> 10129\n<8180> <8185> 10134\n<8186> <8186> 8689\n<8187> <81ec> 10140\n<81ed> <81ed> 8178\n<81ee> <81f5> 10242\n<81f6> <81f6> 8285\n<81f7> <81fe> 10250\n<8240> <8252> 10258\n<8253> <8253> 9884\n<8254> <8261> 10277\n<8262> <8262> 8629\n<8263> <8273> 10291\n<8274> <8274> 8908\n<8275> <8279> 10308\n<827a> <827a> 8214\n<827b> <827c> 10313\n<827d> <827d> 7778\n<827e> <827e> 10315\n<8280> <8280> 7968\n<8281> <8282> 10316\n<8283> <8283> 8319\n<8284> <828f> 10318\n<8290> <8290> 8284\n<8291> <82a4> 10330\n<82a5> <82a5> 8596\n<82a6> <82c7> 10350\n<82c8> <82c8> 7781\n<82c9> <82c9> 8833\n<82ca> <82e0> 10384\n<82e1> <82e1> 8909\n<82e2> <82e2> 10407\n<82e3> <82e3> 8458\n<82e4> <82e4> 7742\n<82e5> <82ec> 10408\n<82ed> <82ed> 9855\n<82ee> <82f1> 10416\n<82f2> <82f2> 8750\n<82f3> <82f6> 10420\n<82f7> <82f7> 7830\n<82f8> <82f8> 8907\n<82f9> <82f9> 8812\n<82fa> <82fa> 10424\n<82fb> <82fb> 8471\n<82fc> <82fe> 10425\n<8340> <8340> 10428\n<8341> <8341> 8424\n<8342> <8344> 10429\n<8345> <8345> 8916\n<8346> <8347> 10432\n<8348> <8348> 8121\n<8349> <834b> 10434\n<834c> <834c> 8920\n<834d> <8352> 10437\n<8353> <8353> 8415\n<8354> <8356> 10443\n<8357> <8357> 8386\n<8358> <835d> 10446\n<835e> <835e> 8597\n<835f> <8364> 10452\n<8365> <8365> 8108\n<8366> <8366> 8915\n<8367> <8371> 10458\n<8372> <8372> 8065\n<8373> <8377> 10469\n<8378> <8378> 8720\n<8379> <8379> 10474\n<837a> <837a> 8911\n<837b> <837b> 10475\n<837c> <837c> 8723\n<837d> <837d> 10476\n<837e> <837e> 8164\n<8380> <8380> 8080\n<8381> <8385> 10477\n<8386> <8386> 8918\n<8387> <8388> 10482\n<8389> <8389> 8912\n<838a> <838a> 8910\n<838b> <838c> 10484\n<838d> <838d> 9857\n<838e> <8393> 10486\n<8394> <8394> 7798\n<8395> <839d> 10492\n<839e> <839e> 8753\n<839f> <83a5> 10501\n<83a6> <83a6> 7827\n<83a7> <83aa> 10508\n<83ab> <83ab> 8914\n<83ac> <83ad> 10512\n<83ae> <83ae> 8919\n<83af> <83af> 8917\n<83b0> <83b0> 8913\n<83b1> <83b9> 10514\n<83ba> <83ba> 7909\n<83bb> <83c8> 10523\n<83c9> <83c9> 8229\nendcidrange\n\n100 begincidrange\n<83ca> <83f5> 10537\n<83f6> <83f6> 7887\n<83f7> <83fe> 10581\n<8440> <844f> 10589\n<8450> <8450> 8153\n<8451> <8470> 10605\n<8471> <8471> 8904\n<8472> <8473> 10637\n<8474> <8474> 8803\n<8475> <8476> 10639\n<8477> <8477> 9859\n<8478> <847e> 10641\n<8480> <8481> 10648\n<8482> <8482> 7959\n<8483> <848d> 10650\n<848e> <848e> 7979\n<848f> <8491> 10661\n<8492> <8492> 8906\n<8493> <8493> 7833\n<8494> <849c> 10664\n<849d> <849d> 8015\n<849e> <84a0> 10673\n<84a1> <84a1> 8143\n<84a2> <84a2> 8246\n<84a3> <84a3> 7994\n<84a4> <84a4> 10676\n<84a5> <84a5> 8905\n<84a6> <84a6> 8089\n<84a7> <84a8> 10677\n<84a9> <84a9> 8053\n<84aa> <84c4> 10679\n<84c5> <84c5> 8126\n<84c6> <84d2> 10706\n<84d3> <84d3> 7885\n<84d4> <84d4> 10719\n<84d5> <84d5> 8617\n<84d6> <84d6> 10720\n<84d7> <84d7> 8678\n<84d8> <84d8> 10721\n<84d9> <84d9> 8487\n<84da> <84da> 8195\n<84db> <84dc> 10722\n<84dd> <84dd> 8498\n<84de> <84e9> 10724\n<84ea> <84ea> 8995\n<84eb> <84ed> 10736\n<84ee> <84ee> 8209\n<84ef> <84f0> 10739\n<84f1> <84f1> 8437\n<84f2> <84fe> 10741\n<8540> <8550> 10754\n<8551> <8551> 8901\n<8552> <8552> 8030\n<8553> <8553> 10771\n<8554> <8554> 8902\n<8555> <855d> 10772\n<855e> <855e> 8431\n<855f> <8565> 10781\n<8566> <8566> 8656\n<8567> <857e> 10788\n<8580> <8586> 10812\n<8587> <8587> 8897\n<8588> <858a> 10819\n<858b> <858b> 7780\n<858c> <8591> 10822\n<8592> <8592> 8697\n<8593> <8595> 10828\n<8596> <8596> 8208\n<8597> <8597> 10831\n<8598> <8598> 8898\n<8599> <85a1> 10832\n<85a2> <85a2> 7770\n<85a3> <85b1> 10841\n<85b2> <85b2> 7842\n<85b3> <85fe> 10856\n<8640> <8649> 10932\n<864a> <864a> 9069\n<864b> <8653> 10942\n<8654> <8654> 8775\n<8655> <8667> 10951\n<8668> <8668> 9068\n<8669> <867e> 10970\n<8680> <8695> 10992\n<8696> <8696> 8604\n<8697> <8698> 11014\n<8699> <8699> 8393\n<869a> <86a0> 11016\n<86a1> <86a1> 8688\n<86a2> <86c9> 11023\n<86ca> <86ca> 8459\n<86cb> <86cb> 11063\n<86cc> <86cc> 8414\n<86cd> <86cd> 11064\n<86ce> <86ce> 7850\n<86cf> <86d0> 11065\n<86d1> <86d1> 8748\n<86d2> <86db> 11067\n<86dc> <86dc> 8408\n<86dd> <86dd> 8896\n<86de> <86e0> 11077\nendcidrange\n\n100 begincidrange\n<86e1> <86e1> 8303\n<86e2> <86e7> 11080\n<86e8> <86e8> 8609\n<86e9> <86ed> 11086\n<86ee> <86ee> 9081\n<86ef> <86f3> 11091\n<86f4> <86f4> 9074\n<86f5> <86fe> 11096\n<8740> <8740> 8554\n<8741> <8743> 11106\n<8744> <8744> 9084\n<8745> <8748> 11109\n<8749> <8749> 8368\n<874a> <874a> 11113\n<874b> <874b> 9082\n<874c> <874c> 7796\n<874d> <874e> 11114\n<874f> <874f> 9079\n<8750> <8756> 11116\n<8757> <8757> 8012\n<8758> <8759> 11123\n<875a> <875a> 9080\n<875b> <875b> 8655\n<875c> <875c> 9064\n<875d> <875d> 11125\n<875e> <875e> 9073\n<875f> <875f> 11126\n<8760> <8760> 9065\n<8761> <8765> 11127\n<8766> <8766> 9844\n<8767> <8779> 11132\n<877a> <877a> 9071\n<877b> <877c> 11151\n<877d> <877d> 9072\n<877e> <877e> 11153\n<8780> <8780> 11154\n<8781> <8781> 9078\n<8782> <8782> 9075\n<8783> <8785> 11155\n<8786> <8786> 9087\n<8787> <8787> 11158\n<8788> <8788> 9076\n<8789> <8789> 11159\n<878a> <878a> 8373\n<878b> <878c> 11160\n<878d> <878d> 7899\n<878e> <878e> 9842\n<878f> <8792> 11162\n<8793> <8793> 9070\n<8794> <8797> 11166\n<8798> <8798> 8631\n<8799> <879c> 11170\n<879d> <879d> 9077\n<879e> <87a2> 11174\n<87a3> <87a3> 9090\n<87a4> <87a6> 11179\n<87a7> <87a7> 8350\n<87a8> <87b2> 11182\n<87b3> <87b3> 9067\n<87b4> <87b4> 11193\n<87b5> <87b5> 8249\n<87b6> <87ba> 11194\n<87bb> <87bb> 9887\n<87bc> <87be> 11199\n<87bf> <87bf> 9085\n<87c0> <87c0> 8693\n<87c1> <87c1> 11202\n<87c2> <87c2> 9089\n<87c3> <87c9> 11203\n<87ca> <87ca> 9083\n<87cb> <87cb> 9086\n<87cc> <87cc> 8652\n<87cd> <87ce> 11210\n<87cf> <87cf> 8923\n<87d0> <87d1> 11212\n<87d2> <87d2> 9066\n<87d3> <87d3> 9865\n<87d4> <87d4> 11214\n<87d5> <87d5> 9879\n<87d6> <87d9> 11215\n<87da> <87da> 8865\n<87db> <87f6> 11219\n<87f7> <87f7> 9091\n<87f8> <87f8> 7997\n<87f9> <87f9> 11247\n<87fa> <87fa> 8591\n<87fb> <87fe> 11248\n<8840> <8840> 8774\n<8841> <8841> 8776\n<8842> <8843> 11252\n<8844> <8844> 8574\n<8845> <8845> 11254\n<8846> <8846> 8576\n<8847> <887e> 11255\n<8880> <88b9> 11311\n<88ba> <88ba> 9002\n<88bb> <88cb> 11369\n<88cc> <88cc> 8843\n<88cd> <88d3> 11386\n<88d4> <88d4> 8069\nendcidrange\n\n100 begincidrange\n<88d5> <88d6> 11393\n<88d7> <88d7> 8997\n<88d8> <88de> 11395\n<88df> <88df> 9004\n<88e0> <88e4> 11402\n<88e5> <88e5> 9006\n<88e6> <88f1> 11407\n<88f2> <88f2> 8709\n<88f3> <88f3> 7736\n<88f4> <88f5> 11419\n<88f6> <88f6> 7795\n<88f7> <88fe> 11421\n<8940> <894a> 11429\n<894b> <894b> 8163\n<894c> <894c> 9017\n<894d> <894d> 11440\n<894e> <894e> 9003\n<894f> <894f> 11441\n<8950> <8950> 9005\n<8951> <8953> 11442\n<8954> <8954> 8575\n<8955> <895c> 11445\n<895d> <895d> 8615\n<895e> <895e> 11453\n<895f> <895f> 9007\n<8960> <896c> 11454\n<896d> <896d> 7805\n<896e> <8970> 11467\n<8971> <8971> 8406\n<8972> <897b> 11470\n<897c> <897c> 7874\n<897d> <897e> 11480\n<8980> <898a> 11482\n<898b> <898b> 8882\n<898c> <8998> 11493\n<8999> <8999> 7903\n<899a> <899d> 11506\n<899e> <899e> 7929\n<899f> <89a5> 11510\n<89a6> <89a6> 8409\n<89a7> <89a7> 11517\n<89a8> <89a8> 8157\n<89a9> <89ae> 11518\n<89af> <89af> 8551\n<89b0> <89b9> 11524\n<89ba> <89ba> 8685\n<89bb> <89bd> 11534\n<89be> <89be> 8199\n<89bf> <89bf> 8998\n<89c0> <89c0> 9001\n<89c1> <89c3> 11537\n<89c4> <89c4> 8018\n<89c5> <89c5> 8251\n<89c6> <89c6> 9000\n<89c7> <89c7> 11540\n<89c8> <89c8> 8999\n<89c9> <89cd> 11541\n<89ce> <89ce> 7723\n<89cf> <89d0> 11546\n<89d1> <89d1> 8878\n<89d2> <89d7> 11548\n<89d8> <89d8> 8009\n<89d9> <89da> 11554\n<89db> <89db> 8504\n<89dc> <89f3> 11556\n<89f4> <89f4> 8321\n<89f5> <89fe> 11580\n<8a40> <8a40> 11590\n<8a41> <8a41> 8060\n<8a42> <8a58> 11591\n<8a59> <8a59> 9051\n<8a5a> <8a5a> 7902\n<8a5b> <8a5b> 11614\n<8a5c> <8a5c> 8098\n<8a5d> <8a5d> 11615\n<8a5e> <8a5e> 7930\n<8a5f> <8a78> 11616\n<8a79> <8a79> 8877\n<8a7a> <8a7e> 11642\n<8a80> <8ae3> 11647\n<8ae4> <8ae4> 8255\n<8ae5> <8afe> 11747\n<8b40> <8b43> 11773\n<8b44> <8b44> 7950\n<8b45> <8b48> 11777\n<8b49> <8b49> 9209\n<8b4a> <8b79> 11781\n<8b7a> <8b7a> 9212\n<8b7b> <8b7e> 11829\n<8b80> <8b8b> 11833\n<8b8c> <8b8c> 8297\n<8b8d> <8b9d> 11845\n<8b9e> <8b9e> 9207\n<8b9f> <8bb2> 11862\n<8bb3> <8bb3> 9206\n<8bb4> <8bb8> 11882\n<8bb9> <8bb9> 9213\n<8bba> <8bbd> 11887\n<8bbe> <8bbe> 9208\n<8bbf> <8bc5> 11891\nendcidrange\n\n100 begincidrange\n<8bc6> <8bc6> 9210\n<8bc7> <8bc7> 11898\n<8bc8> <8bc8> 9214\n<8bc9> <8bc9> 8104\n<8bca> <8bd3> 11899\n<8bd4> <8bd4> 9217\n<8bd5> <8bdb> 11909\n<8bdc> <8bdc> 9215\n<8bdd> <8be4> 11916\n<8be5> <8be5> 9216\n<8be6> <8bea> 11924\n<8beb> <8beb> 8737\n<8bec> <8bef> 11929\n<8bf0> <8bf0> 8482\n<8bf1> <8bfe> 11933\n<8c40> <8c43> 11947\n<8c44> <8c44> 9211\n<8c45> <8c4e> 11951\n<8c4f> <8c4f> 8538\n<8c50> <8c56> 11961\n<8c57> <8c57> 8677\n<8c58> <8c5b> 11968\n<8c5c> <8c5c> 8279\n<8c5d> <8c7e> 11972\n<8c80> <8c8a> 12006\n<8c8b> <8c8b> 8421\n<8c8c> <8c8c> 12017\n<8c8d> <8c8d> 8495\n<8c8e> <8c8e> 8355\n<8c8f> <8c8f> 8481\n<8c90> <8c90> 12018\n<8c91> <8c91> 8660\n<8c92> <8c92> 8165\n<8c93> <8c98> 12019\n<8c99> <8c99> 7818\n<8c9a> <8c9a> 7735\n<8c9b> <8ca1> 12025\n<8ca2> <8ca2> 8094\n<8ca3> <8ca3> 8870\n<8ca4> <8ca4> 8680\n<8ca5> <8ca5> 12032\n<8ca6> <8ca6> 7898\n<8ca7> <8ca7> 7865\n<8ca8> <8cbf> 12033\n<8cc0> <8cc0> 9052\n<8cc1> <8cd1> 12057\n<8cd2> <8cd2> 8272\n<8cd3> <8cd3> 7783\n<8cd4> <8cd4> 12074\n<8cd5> <8cd5> 9204\n<8cd6> <8cd8> 12075\n<8cd9> <8cd9> 8510\n<8cda> <8cf8> 12078\n<8cf9> <8cf9> 7958\n<8cfa> <8cfe> 12109\n<8d40> <8d72> 12114\n<8d73> <8d73> 9097\n<8d74> <8d74> 12165\n<8d75> <8d75> 7863\n<8d76> <8d7a> 12166\n<8d7b> <8d7b> 8628\n<8d7c> <8d7e> 12171\n<8d80> <8d87> 12174\n<8d88> <8d88> 9103\n<8d89> <8d8e> 12182\n<8d8f> <8d8f> 7962\n<8d90> <8d9d> 12188\n<8d9e> <8d9e> 9099\n<8d9f> <8db8> 12202\n<8db9> <8db9> 9098\n<8dba> <8de1> 12228\n<8de2> <8de2> 9105\n<8de3> <8de3> 12268\n<8de4> <8de4> 8817\n<8de5> <8de6> 12269\n<8de7> <8de7> 9096\n<8de8> <8df6> 12271\n<8df7> <8df7> 9102\n<8df8> <8dfd> 12286\n<8dfe> <8dfe> 9101\n<8e40> <8e45> 12292\n<8e46> <8e46> 9100\n<8e47> <8e55> 12298\n<8e56> <8e56> 9104\n<8e57> <8e57> 12313\n<8e58> <8e58> 8243\n<8e59> <8e59> 12314\n<8e5a> <8e5a> 8764\n<8e5b> <8e67> 12315\n<8e68> <8e68> 8169\n<8e69> <8e6d> 12328\n<8e6e> <8e6e> 8277\n<8e6f> <8e6f> 12333\n<8e70> <8e70> 9106\n<8e71> <8e7e> 12334\n<8e80> <8e80> 8996\n<8e81> <8e9a> 12348\n<8e9b> <8e9b> 8515\n<8e9c> <8e9e> 12374\n<8e9f> <8e9f> 8489\nendcidrange\n\n100 begincidrange\n<8ea0> <8ea3> 12377\n<8ea4> <8ea4> 8823\n<8ea5> <8ea6> 12381\n<8ea7> <8ea7> 7847\n<8ea8> <8eab> 12383\n<8eac> <8eac> 8837\n<8ead> <8ead> 12387\n<8eae> <8eae> 9092\n<8eaf> <8ebc> 12388\n<8ebd> <8ebd> 9095\n<8ebe> <8ebe> 9094\n<8ebf> <8ec2> 12402\n<8ec3> <8ec3> 8848\n<8ec4> <8ec4> 12406\n<8ec5> <8ec5> 7748\n<8ec6> <8ecc> 12407\n<8ecd> <8ecd> 7730\n<8ece> <8ece> 9093\n<8ecf> <8ed5> 12414\n<8ed6> <8ed6> 7955\n<8ed7> <8ed7> 8051\n<8ed8> <8eeb> 12421\n<8eec> <8eec> 8160\n<8eed> <8efe> 12441\n<8f40> <8f51> 12459\n<8f52> <8f52> 8327\n<8f53> <8f53> 7800\n<8f54> <8f54> 9134\n<8f55> <8f55> 7926\n<8f56> <8f56> 7985\n<8f57> <8f5c> 12477\n<8f5d> <8f5d> 8261\n<8f5e> <8f63> 12483\n<8f64> <8f64> 8568\n<8f65> <8f7e> 12489\n<8f80> <8f85> 12515\n<8f86> <8f86> 9205\n<8f87> <8f87> 12521\n<8f88> <8f88> 8821\n<8f89> <8f94> 12522\n<8f95> <8f95> 9838\n<8f96> <8f96> 12534\n<8f97> <8f97> 7856\n<8f98> <8f9a> 12535\n<8f9b> <8f9b> 8323\n<8f9c> <8f9c> 12538\n<8f9d> <8f9d> 8584\n<8f9e> <8fa0> 12539\n<8fa1> <8fa1> 9852\n<8fa2> <8fbc> 12542\n<8fbd> <8fbd> 8133\n<8fbe> <8fc3> 12569\n<8fc4> <8fc4> 7841\n<8fc5> <8fc5> 12575\n<8fc6> <8fc6> 9107\n<8fc7> <8fcc> 12576\n<8fcd> <8fcd> 7947\n<8fce> <8fd7> 12582\n<8fd8> <8fd8> 7804\n<8fd9> <8ffe> 12592\n<9040> <907e> 12630\n<9080> <909c> 12693\n<909d> <909d> 9140\n<909e> <909e> 8318\n<909f> <90b9> 12722\n<90ba> <90ba> 7907\n<90bb> <90bf> 12749\n<90c0> <90c0> 8341\n<90c1> <90c1> 9147\n<90c2> <90c4> 12754\n<90c5> <90c5> 9145\n<90c6> <90da> 12757\n<90db> <90db> 7720\n<90dc> <90dc> 9149\n<90dd> <90ec> 12778\n<90ed> <90ed> 9141\n<90ee> <90ef> 12794\n<90f0> <90f0> 9146\n<90f1> <90f6> 12796\n<90f7> <90f7> 9139\n<90f8> <90fe> 12802\n<9140> <9141> 12809\n<9142> <9142> 8546\n<9143> <914a> 12811\n<914b> <914b> 7774\n<914c> <914c> 12819\n<914d> <914d> 7773\n<914e> <9150> 12820\n<9151> <9151> 9143\n<9152> <9153> 12823\n<9154> <9154> 7983\n<9155> <9155> 9439\n<9156> <9158> 12825\n<9159> <9159> 9138\n<915a> <915a> 8526\n<915b> <915c> 12828\n<915d> <915d> 8274\n<915e> <9160> 12830\n<9161> <9161> 9148\n<9162> <9162> 12833\nendcidrange\n\n100 begincidrange\n<9163> <9163> 8427\n<9164> <916d> 12834\n<916e> <916e> 8754\n<916f> <9175> 12844\n<9176> <9176> 7743\n<9177> <9179> 12851\n<917a> <917a> 8219\n<917b> <917b> 8380\n<917c> <917c> 9150\n<917d> <917e> 12854\n<9180> <9183> 12856\n<9184> <9184> 7854\n<9185> <918c> 12860\n<918d> <918d> 7931\n<918e> <9190> 12868\n<9191> <9191> 8329\n<9192> <9192> 12871\n<9193> <9193> 9137\n<9194> <9196> 12872\n<9197> <9197> 8644\n<9198> <919a> 12875\n<919b> <919b> 8724\n<919c> <91a8> 12878\n<91a9> <91a9> 8158\n<91aa> <91aa> 8739\n<91ab> <91ab> 9142\n<91ac> <91b9> 12891\n<91ba> <91ba> 9868\n<91bb> <91bb> 9438\n<91bc> <91be> 12905\n<91bf> <91bf> 9440\n<91c0> <91c2> 12908\n<91c3> <91c3> 9144\n<91c4> <91cc> 12911\n<91cd> <91cd> 7809\n<91ce> <91cf> 12920\n<91d0> <91d0> 8190\n<91d1> <91d1> 8017\n<91d2> <91d2> 8673\n<91d3> <91d3> 12922\n<91d4> <91d4> 9136\n<91d5> <91d5> 12923\n<91d6> <91d6> 8142\n<91d7> <91d7> 12924\n<91d8> <91d8> 8478\n<91d9> <91d9> 8225\n<91da> <91de> 12925\n<91df> <91df> 9441\n<91e0> <91e1> 12930\n<91e2> <91e2> 9379\n<91e3> <91e9> 12932\n<91ea> <91ea> 9380\n<91eb> <91ef> 12939\n<91f0> <91f0> 8819\n<91f1> <91f1> 12944\n<91f2> <91f2> 8624\n<91f3> <91fe> 12945\n<9240> <927e> 12957\n<9280> <92b5> 13020\n<92b6> <92b6> 8657\n<92b7> <92cd> 13074\n<92ce> <92ce> 8476\n<92cf> <92cf> 13097\n<92d0> <92d0> 9053\n<92d1> <92d3> 13098\n<92d4> <92d4> 9858\n<92d5> <92de> 13101\n<92df> <92df> 8461\n<92e0> <92e0> 8282\n<92e1> <92fd> 13111\n<92fe> <92fe> 8077\n<9340> <934f> 13140\n<9350> <9350> 8703\n<9351> <935c> 13156\n<935d> <935d> 8024\n<935e> <936f> 13168\n<9370> <9370> 8539\n<9371> <9375> 13186\n<9376> <9376> 7862\n<9377> <937e> 13191\n<9380> <938b> 13199\n<938c> <938c> 8411\n<938d> <939c> 13211\n<939d> <939d> 9056\n<939e> <93a4> 13227\n<93a5> <93a5> 9057\n<93a6> <93a6> 13234\n<93a7> <93a7> 8256\n<93a8> <93b3> 13235\n<93b4> <93b4> 8846\n<93b5> <93b7> 13247\n<93b8> <93b8> 8159\n<93b9> <93ba> 13250\n<93bb> <93bb> 9054\n<93bc> <93bc> 13252\n<93bd> <93bd> 7786\n<93be> <93c5> 13253\n<93c6> <93c6> 8194\n<93c7> <93ce> 13261\n<93cf> <93cf> 8339\nendcidrange\n\n100 begincidrange\n<93d0> <93d6> 13269\n<93d7> <93d7> 9055\n<93d8> <93da> 13276\n<93db> <93db> 7852\n<93dc> <93dc> 7764\n<93dd> <93e0> 13279\n<93e1> <93e1> 7944\n<93e2> <93e3> 13283\n<93e4> <93e4> 8384\n<93e5> <93e5> 9058\n<93e6> <93e8> 13285\n<93e9> <93e9> 8544\n<93ea> <93ea> 13288\n<93eb> <93eb> 8605\n<93ec> <93ec> 8078\n<93ed> <93ed> 8749\n<93ee> <93ee> 13289\n<93ef> <93ef> 8263\n<93f0> <93f0> 13290\n<93f1> <93f1> 8802\n<93f2> <93f3> 13291\n<93f4> <93f4> 8039\n<93f5> <93f5> 7858\n<93f6> <93f9> 13293\n<93fa> <93fa> 7849\n<93fb> <93fd> 13297\n<93fe> <93fe> 8140\n<9440> <9443> 13300\n<9444> <9444> 8050\n<9445> <944c> 13304\n<944d> <944d> 8344\n<944e> <944f> 13312\n<9450> <9450> 7762\n<9451> <9451> 8356\n<9452> <9452> 7964\n<9453> <9453> 8847\n<9454> <9454> 13314\n<9455> <9455> 8173\n<9456> <9457> 13315\n<9458> <9458> 9061\n<9459> <945a> 13317\n<945b> <945b> 7725\n<945c> <945c> 8530\n<945d> <945d> 9062\n<945e> <945e> 13319\n<945f> <945f> 8442\n<9460> <9463> 13320\n<9464> <9464> 9059\n<9465> <9465> 13324\n<9466> <9466> 8346\n<9467> <946d> 13325\n<946e> <946e> 8252\n<946f> <9471> 13332\n<9472> <9472> 8182\n<9473> <9473> 13335\n<9474> <9474> 9060\n<9475> <9475> 13336\n<9476> <9476> 7785\n<9477> <9477> 13337\n<9478> <9478> 9063\n<9479> <9479> 13338\n<947a> <947a> 8477\n<947b> <947e> 13339\n<9480> <9480> 8793\n<9481> <9481> 8278\n<9482> <9482> 8547\n<9483> <9486> 13343\n<9487> <9487> 8105\n<9488> <9488> 8188\n<9489> <94a0> 13347\n<94a1> <94a1> 7726\n<94a2> <94b2> 13371\n<94b3> <94b3> 7868\n<94b4> <94b4> 13388\n<94b5> <94b5> 8514\n<94b6> <94be> 13389\n<94bf> <94bf> 8222\n<94c0> <94c0> 7747\n<94c1> <94cb> 13398\n<94cc> <94cc> 9428\n<94cd> <94d7> 13409\n<94d8> <94d8> 8815\n<94d9> <94df> 13420\n<94e0> <94e0> 7895\n<94e1> <94fe> 13427\n<9540> <9571> 13457\n<9572> <9572> 8493\n<9573> <957e> 13507\n<9580> <9582> 13519\n<9583> <9583> 8859\n<9584> <959d> 13522\n<959e> <959e> 8790\n<959f> <959f> 9384\n<95a0> <95b2> 13548\n<95b3> <95b3> 7801\n<95b4> <95b9> 13567\n<95ba> <95ba> 8794\n<95bb> <95ce> 13573\n<95cf> <95cf> 9383\n<95d0> <95d0> 13593\nendcidrange\n\n100 begincidrange\n<95d1> <95d1> 9862\n<95d2> <95d2> 9382\n<95d3> <95d3> 13594\n<95d4> <95d4> 8654\n<95d5> <95e0> 13595\n<95e1> <95e1> 9385\n<95e2> <95e6> 13607\n<95e7> <95e7> 8167\n<95e8> <95f0> 13612\n<95f1> <95f1> 8466\n<95f2> <95f7> 13621\n<95f8> <95f8> 8508\n<95f9> <95fd> 13627\n<95fe> <95fe> 8028\n<9640> <9655> 13632\n<9656> <9656> 9412\n<9657> <967b> 13654\n<967c> <967c> 7884\n<967d> <967e> 13691\n<9680> <96fe> 13693\n<9740> <9766> 13820\n<9767> <9767> 9322\n<9768> <976b> 13859\n<976c> <976c> 8565\n<976d> <976d> 13863\n<976e> <976e> 9325\n<976f> <977e> 13864\n<9780> <9795> 13880\n<9796> <9796> 9323\n<9797> <9797> 8799\n<9798> <979c> 13902\n<979d> <979d> 7886\n<979e> <97a2> 13907\n<97a3> <97a3> 8818\n<97a4> <97be> 13912\n<97bf> <97bf> 9331\n<97c0> <97ed> 13939\n<97ee> <97ee> 8702\n<97ef> <97f6> 13985\n<97f7> <97f7> 7934\n<97f8> <97fe> 13993\n<9840> <9844> 14000\n<9845> <9845> 9333\n<9846> <9848> 14005\n<9849> <9849> 8714\n<984a> <984e> 14008\n<984f> <984f> 8047\n<9850> <9870> 14013\n<9871> <9871> 9320\n<9872> <9872> 14046\n<9873> <9873> 8448\n<9874> <987e> 14047\n<9880> <9880> 14058\n<9881> <9881> 9334\n<9882> <988a> 14059\n<988b> <988b> 7975\n<988c> <988c> 8407\n<988d> <989f> 14068\n<98a0> <98a0> 9340\n<98a1> <98a9> 14087\n<98aa> <98aa> 8097\n<98ab> <98b5> 14096\n<98b6> <98b6> 8874\n<98b7> <98b7> 8197\n<98b8> <98b9> 14107\n<98ba> <98ba> 9324\n<98bb> <98c6> 14109\n<98c7> <98c7> 8254\n<98c8> <98ca> 14121\n<98cb> <98cb> 7756\n<98cc> <98cf> 14124\n<98d0> <98d0> 8506\n<98d1> <98d2> 14128\n<98d3> <98d3> 8708\n<98d4> <98e2> 14130\n<98e3> <98e3> 8387\n<98e4> <98e4> 8512\n<98e5> <98e5> 9335\n<98e6> <98ee> 14145\n<98ef> <98ef> 9332\n<98f0> <98f1> 14154\n<98f2> <98f2> 8413\n<98f3> <98fe> 14156\n<9940> <9942> 14168\n<9943> <9943> 8040\n<9944> <9944> 14171\n<9945> <9945> 8581\n<9946> <9965> 14172\n<9966> <9966> 9330\n<9967> <996d> 14204\n<996e> <996e> 7861\n<996f> <9974> 14211\n<9975> <9975> 9336\n<9976> <9979> 14217\n<997a> <997a> 8075\n<997b> <997b> 9348\n<997c> <997e> 14221\n<9980> <9984> 14224\n<9985> <9985> 9881\n<9986> <9988> 14229\nendcidrange\n\n100 begincidrange\n<9989> <9989> 9346\n<998a> <998d> 14232\n<998e> <998e> 8353\n<998f> <9990> 14236\n<9991> <9991> 8082\n<9992> <9998> 14238\n<9999> <9999> 7992\n<999a> <99a8> 14245\n<99a9> <99a9> 9349\n<99aa> <99af> 14260\n<99b0> <99b0> 9344\n<99b1> <99b1> 9326\n<99b2> <99b2> 14266\n<99b3> <99b3> 9339\n<99b4> <99b4> 9350\n<99b5> <99b5> 9329\n<99b6> <99bc> 14267\n<99bd> <99bd> 9347\n<99be> <99be> 9328\n<99bf> <99bf> 14274\n<99c0> <99c0> 9321\n<99c1> <99c1> 14275\n<99c2> <99c2> 9343\n<99c3> <99c8> 14276\n<99c9> <99c9> 9327\n<99ca> <99cd> 14282\n<99ce> <99ce> 9345\n<99cf> <99d0> 14286\n<99d1> <99d1> 8736\n<99d2> <99d9> 14288\n<99da> <99da> 8181\n<99db> <99df> 14296\n<99e0> <99e0> 8436\n<99e1> <99e4> 14301\n<99e5> <99e5> 9341\n<99e6> <99e7> 14305\n<99e8> <99e8> 9337\n<99e9> <99eb> 14307\n<99ec> <99ec> 9342\n<99ed> <99f3> 14310\n<99f4> <99f4> 9338\n<99f5> <99fe> 14317\n<9a40> <9a49> 14327\n<9a4a> <9a4a> 8419\n<9a4b> <9a56> 14337\n<9a57> <9a57> 8365\n<9a58> <9a64> 14349\n<9a65> <9a65> 9419\n<9a66> <9a66> 14362\n<9a67> <9a67> 8019\n<9a68> <9a70> 14363\n<9a71> <9a71> 8537\n<9a72> <9a75> 14372\n<9a76> <9a76> 8211\n<9a77> <9a77> 7987\n<9a78> <9a7e> 14376\n<9a80> <9a87> 14383\n<9a88> <9a88> 7772\n<9a89> <9a8b> 14391\n<9a8c> <9a8c> 9352\n<9a8d> <9a90> 14394\n<9a91> <9a91> 9351\n<9a92> <9a96> 14398\n<9a97> <9a97> 9354\n<9a98> <9a99> 14403\n<9a9a> <9a9a> 9353\n<9a9b> <9a9b> 9355\n<9a9c> <9a9d> 14405\n<9a9e> <9a9e> 8067\n<9a9f> <9aa1> 14407\n<9aa2> <9aa2> 8463\n<9aa3> <9aa3> 8155\n<9aa4> <9aa9> 14410\n<9aaa> <9aaa> 8367\n<9aab> <9acf> 14416\n<9ad0> <9ad0> 9408\n<9ad1> <9ad5> 14453\n<9ad6> <9ad6> 8813\n<9ad7> <9ad9> 14458\n<9ada> <9ada> 9409\n<9adb> <9ae1> 14461\n<9ae2> <9ae2> 8394\n<9ae3> <9ae3> 14468\n<9ae4> <9ae4> 8423\n<9ae5> <9ae5> 9410\n<9ae6> <9afe> 14469\n<9b40> <9b7e> 14494\n<9b80> <9bd0> 14557\n<9bd1> <9bd1> 9180\n<9bd2> <9bdb> 14638\n<9bdc> <9bdc> 9179\n<9bdd> <9bfe> 14648\n<9c40> <9c52> 14682\n<9c53> <9c53> 8286\n<9c54> <9c58> 14701\n<9c59> <9c59> 8772\n<9c5a> <9c5a> 9186\n<9c5b> <9c5b> 14706\n<9c5c> <9c5c> 8404\n<9c5d> <9c74> 14707\nendcidrange\n\n100 begincidrange\n<9c75> <9c75> 8607\n<9c76> <9c78> 14731\n<9c79> <9c79> 7782\n<9c7a> <9c7e> 14734\n<9c80> <9c85> 14739\n<9c86> <9c86> 8035\n<9c87> <9c9c> 14745\n<9c9d> <9c9d> 9181\n<9c9e> <9caa> 14767\n<9cab> <9cab> 8555\n<9cac> <9cc9> 14780\n<9cca> <9cca> 8885\n<9ccb> <9cce> 14810\n<9ccf> <9ccf> 7974\n<9cd0> <9ce5> 14814\n<9ce6> <9ce6> 7779\n<9ce7> <9ce7> 8328\n<9ce8> <9ceb> 14836\n<9cec> <9cec> 7869\n<9ced> <9ced> 14840\n<9cee> <9cee> 9025\n<9cef> <9cfa> 14841\n<9cfb> <9cfb> 8011\n<9cfc> <9cfd> 14853\n<9cfe> <9cfe> 8850\n<9d40> <9d41> 14855\n<9d42> <9d42> 8484\n<9d43> <9d45> 14857\n<9d46> <9d46> 8264\n<9d47> <9d47> 9184\n<9d48> <9d4c> 14860\n<9d4d> <9d4d> 8311\n<9d4e> <9d4e> 14865\n<9d4f> <9d4f> 8762\n<9d50> <9d60> 14866\n<9d61> <9d61> 8369\n<9d62> <9d67> 14883\n<9d68> <9d68> 8001\n<9d69> <9d69> 8220\n<9d6a> <9d6d> 14889\n<9d6e> <9d6e> 8888\n<9d6f> <9d70> 14893\n<9d71> <9d71> 8822\n<9d72> <9d74> 14895\n<9d75> <9d75> 8091\n<9d76> <9d7a> 14898\n<9d7b> <9d7b> 8095\n<9d7c> <9d7c> 14903\n<9d7d> <9d7d> 9674\n<9d7e> <9d7e> 14904\n<9d80> <9d89> 14905\n<9d8a> <9d8a> 8382\n<9d8b> <9d8c> 14915\n<9d8d> <9d8d> 8116\n<9d8e> <9d90> 14917\n<9d91> <9d91> 9175\n<9d92> <9d98> 14920\n<9d99> <9d99> 8453\n<9d9a> <9da0> 14927\n<9da1> <9da1> 9185\n<9da2> <9da2> 8172\n<9da3> <9da6> 14934\n<9da7> <9da7> 9194\n<9da8> <9dab> 14938\n<9dac> <9dac> 9187\n<9dad> <9dad> 8462\n<9dae> <9db1> 14942\n<9db2> <9db2> 8102\n<9db3> <9db3> 8196\n<9db4> <9dbd> 14946\n<9dbe> <9dbe> 8093\n<9dbf> <9dc5> 14956\n<9dc6> <9dc6> 9189\n<9dc7> <9dc8> 14963\n<9dc9> <9dc9> 8804\n<9dca> <9dcc> 14965\n<9dcd> <9dcd> 9442\n<9dce> <9dd1> 14968\n<9dd2> <9dd2> 9182\n<9dd3> <9dd4> 14972\n<9dd5> <9dd5> 7876\n<9dd6> <9de0> 14974\n<9de1> <9de1> 8886\n<9de2> <9de2> 8361\n<9de3> <9df0> 14985\n<9df1> <9df1> 8491\n<9df2> <9df3> 14999\n<9df4> <9df4> 8357\n<9df5> <9df6> 15001\n<9df7> <9df7> 9867\n<9df8> <9df9> 15003\n<9dfa> <9dfa> 8054\n<9dfb> <9dfc> 15005\n<9dfd> <9dfd> 8557\n<9dfe> <9dfe> 15007\n<9e40> <9e44> 15008\n<9e45> <9e45> 8193\n<9e46> <9e47> 15013\n<9e48> <9e48> 8593\n<9e49> <9e49> 7760\nendcidrange\n\n100 begincidrange\n<9e4a> <9e51> 15015\n<9e52> <9e52> 8092\n<9e53> <9e53> 15023\n<9e54> <9e54> 9178\n<9e55> <9e55> 15024\n<9e56> <9e56> 8275\n<9e57> <9e5c> 15025\n<9e5d> <9e5d> 9193\n<9e5e> <9e5e> 9188\n<9e5f> <9e60> 15031\n<9e61> <9e61> 8661\n<9e62> <9e62> 15033\n<9e63> <9e63> 9190\n<9e64> <9e66> 15034\n<9e67> <9e67> 9183\n<9e68> <9e6b> 15037\n<9e6c> <9e6c> 7759\n<9e6d> <9e6e> 15041\n<9e6f> <9e6f> 9177\n<9e70> <9e71> 15043\n<9e72> <9e72> 8212\n<9e73> <9e73> 15045\n<9e74> <9e74> 9196\n<9e75> <9e75> 9195\n<9e76> <9e7a> 15046\n<9e7b> <9e7b> 9176\n<9e7c> <9e7c> 9198\n<9e7d> <9e7e> 15051\n<9e80> <9e84> 15053\n<9e85> <9e85> 9870\n<9e86> <9e86> 15058\n<9e87> <9e87> 9197\n<9e88> <9e90> 15059\n<9e91> <9e91> 8186\n<9e92> <9e95> 15068\n<9e96> <9e96> 9174\n<9e97> <9e97> 9192\n<9e98> <9ea1> 15072\n<9ea2> <9ea2> 8454\n<9ea3> <9ea5> 15082\n<9ea6> <9ea6> 8203\n<9ea7> <9ea8> 15085\n<9ea9> <9ea9> 8550\n<9eaa> <9ead> 15087\n<9eae> <9eae> 9199\n<9eaf> <9eb2> 15091\n<9eb3> <9eb3> 8585\n<9eb4> <9eb4> 8280\n<9eb5> <9eb6> 15095\n<9eb7> <9eb7> 9191\n<9eb8> <9ef4> 15097\n<9ef5> <9ef5> 8611\n<9ef6> <9efe> 15158\n<9f40> <9f4d> 15167\n<9f4e> <9f4e> 8570\n<9f4f> <9f6e> 15181\n<9f6f> <9f6f> 8613\n<9f70> <9f7e> 15213\n<9f80> <9f91> 15228\n<9f92> <9f92> 8226\n<9f93> <9f97> 15246\n<9f98> <9f98> 9430\n<9f99> <9fa5> 15251\n<9fa6> <9fa6> 9018\n<9fa7> <9fa8> 15264\n<9fa9> <9fa9> 7918\n<9faa> <9fab> 15266\n<9fac> <9fac> 9429\n<9fad> <9fc8> 15268\n<9fc9> <9fc9> 8744\n<9fca> <9fcc> 15296\n<9fcd> <9fcd> 9431\n<9fce> <9fe0> 15299\n<9fe1> <9fe1> 8444\n<9fe2> <9fea> 15318\n<9feb> <9feb> 7815\n<9fec> <9fed> 15327\n<9fee> <9fee> 9432\n<9fef> <9ff3> 15329\n<9ff4> <9ff4> 7866\n<9ff5> <9ffc> 15334\n<9ffd> <9ffd> 8473\n<9ffe> <9ffe> 15342\n<a040> <a042> 15343\n<a043> <a043> 8556\n<a044> <a045> 15346\n<a046> <a046> 9433\n<a047> <a048> 15348\n<a049> <a049> 8743\n<a04a> <a04d> 15350\n<a04e> <a04e> 7775\n<a04f> <a053> 15354\n<a054> <a054> 8863\n<a055> <a059> 15359\n<a05a> <a05a> 8029\n<a05b> <a060> 15364\n<a061> <a061> 8124\n<a062> <a062> 15370\n<a063> <a063> 9434\n<a064> <a070> 15371\nendcidrange\n\n100 begincidrange\n<a071> <a071> 8521\n<a072> <a073> 15384\n<a074> <a074> 8262\n<a075> <a07e> 15386\n<a080> <a080> 8192\n<a081> <a090> 15396\n<a091> <a091> 8592\n<a092> <a093> 15412\n<a094> <a094> 8712\n<a095> <a095> 15414\n<a096> <a096> 7910\n<a097> <a0a8> 15415\n<a0a9> <a0a9> 9411\n<a0aa> <a0be> 15433\n<a0bf> <a0bf> 8396\n<a0c0> <a0cd> 15454\n<a0ce> <a0ce> 9024\n<a0cf> <a0d8> 15468\n<a0d9> <a0d9> 7889\n<a0da> <a0dd> 15478\n<a0de> <a0de> 8620\n<a0df> <a0ed> 15482\n<a0ee> <a0ee> 8879\n<a0ef> <a0fe> 15497\n<a1a1> <a1fe> 96\n<a2a1> <a2aa> 9897\n<a2b1> <a2e2> 190\n<a2e5> <a2ee> 240\n<a2f1> <a2fc> 250\n<a3a1> <a3fe> 262\n<a4a1> <a4f3> 356\n<a5a1> <a5f6> 439\n<a6a1> <a6b8> 525\n<a6c1> <a6f5> 549\n<a7a1> <a7c1> 602\n<a7d1> <a7f1> 635\n<a840> <a87e> 9907\n<a880> <a895> 9970\n<a8a1> <a8c0> 668\n<a8c5> <a8ea> 700\n<a940> <a957> 9992\n<a959> <a95a> 10016\n<a95c> <a95c> 10018\n<a960> <a97e> 10019\n<a980> <a995> 10050\n<a996> <a996> 7703\n<a9a4> <a9ef> 738\n<aa40> <aa4c> 15513\n<aa4d> <aa4d> 8630\n<aa4e> <aa4e> 7741\n<aa4f> <aa70> 15526\n<aa71> <aa71> 8757\n<aa72> <aa72> 15560\n<aa73> <aa73> 9111\n<aa74> <aa76> 15561\n<aa77> <aa77> 9109\n<aa78> <aa79> 15564\n<aa7a> <aa7a> 8767\n<aa7b> <aa7b> 8490\n<aa7c> <aa7e> 15566\n<aa80> <aa99> 15569\n<aa9a> <aa9a> 7890\n<aa9b> <aa9b> 15595\n<aa9c> <aa9c> 9110\n<aa9d> <aa9d> 9112\n<aa9e> <aa9e> 15596\n<aa9f> <aa9f> 8354\n<aaa0> <aaa0> 15597\n<aaa1> <aafe> 814\n<ab40> <ab40> 8036\n<ab41> <ab42> 15598\n<ab43> <ab43> 8235\n<ab44> <ab44> 15600\n<ab45> <ab45> 9108\n<ab46> <ab46> 8505\n<ab47> <ab47> 15601\n<ab48> <ab48> 8543\n<ab49> <ab49> 8641\n<ab4a> <ab4a> 9114\n<ab4b> <ab4c> 15602\n<ab4d> <ab4d> 9113\n<ab4e> <ab7e> 15604\n<ab80> <aba0> 15653\n<aba1> <abc0> 908\n<ac40> <ac45> 15686\n<ac46> <ac46> 8640\n<ac47> <ac70> 15692\n<ac71> <ac71> 9312\n<ac72> <ac7b> 15734\n<ac7c> <ac7c> 9308\n<ac7d> <ac7e> 15744\n<ac80> <ac8c> 15746\n<ac8d> <ac8d> 8541\n<ac8e> <ac92> 15759\n<ac93> <ac93> 8741\n<ac94> <ac94> 8298\n<ac95> <aca0> 15764\n<ad40> <ad48> 15776\n<ad49> <ad49> 9313\n<ad4a> <ad5d> 15785\nendcidrange\n\n100 begincidrange\n<ad5e> <ad5e> 9307\n<ad5f> <ad60> 15805\n<ad61> <ad61> 9314\n<ad62> <ad67> 15807\n<ad68> <ad68> 8020\n<ad69> <ad73> 15813\n<ad74> <ad74> 9311\n<ad75> <ad7e> 15824\n<ad80> <ad81> 15834\n<ad82> <ad82> 8428\n<ad83> <ad86> 15836\n<ad87> <ad87> 9309\n<ad88> <ad8a> 15840\n<ad8b> <ad8b> 9315\n<ad8c> <ad90> 15843\n<ad91> <ad91> 9316\n<ad92> <ada0> 15848\n<ae40> <ae53> 15863\n<ae54> <ae54> 9381\n<ae55> <ae61> 15883\n<ae62> <ae62> 7792\n<ae63> <ae7e> 15896\n<ae80> <ae80> 8335\n<ae81> <ae84> 15924\n<ae85> <ae85> 7746\n<ae86> <ae8a> 15928\n<ae8b> <ae8b> 8014\n<ae8c> <ae93> 15933\n<ae94> <ae94> 7857\n<ae95> <ae9f> 15941\n<aea0> <aea0> 7819\n<af40> <af63> 15952\n<af64> <af64> 8134\n<af65> <af7a> 15988\n<af7b> <af7b> 9646\n<af7c> <af7e> 16010\n<af80> <af81> 16013\n<af82> <af82> 7937\n<af83> <af83> 8704\n<af84> <af8d> 16015\n<af8e> <af8e> 9650\n<af8f> <af8f> 7831\n<af90> <af90> 16025\n<af91> <af91> 8363\n<af92> <af9b> 16026\n<af9c> <af9c> 9651\n<af9d> <af9e> 16036\n<af9f> <af9f> 8232\n<afa0> <afa0> 16038\n<b040> <b040> 16039\n<b041> <b042> 9647\n<b043> <b043> 16040\n<b044> <b044> 9649\n<b045> <b04e> 16041\n<b04f> <b04f> 9644\n<b050> <b053> 16051\n<b054> <b054> 7758\n<b055> <b056> 16055\n<b057> <b057> 8706\n<b058> <b058> 9643\n<b059> <b059> 8838\n<b05a> <b05a> 16057\n<b05b> <b05b> 9645\n<b05c> <b05c> 16058\n<b05d> <b05d> 9654\n<b05e> <b05e> 16059\n<b05f> <b05f> 8675\n<b060> <b061> 9652\n<b062> <b062> 8751\n<b063> <b063> 8549\n<b064> <b064> 9655\n<b065> <b06b> 16060\n<b06c> <b06c> 7913\n<b06d> <b07c> 16067\n<b07d> <b07d> 7717\n<b07e> <b07e> 16083\n<b080> <b096> 16084\n<b097> <b097> 9664\n<b098> <b098> 16107\n<b099> <b099> 8858\n<b09a> <b0a0> 16108\n<b0a1> <b0fe> 940\n<b140> <b14a> 16115\n<b14b> <b14b> 8814\n<b14c> <b14c> 16126\n<b14d> <b14d> 8125\n<b14e> <b14e> 16127\n<b14f> <b14f> 8068\n<b150> <b150> 8370\n<b151> <b151> 16128\n<b152> <b152> 8259\n<b153> <b17e> 16129\n<b180> <b196> 16173\n<b197> <b197> 9860\n<b198> <b1a0> 16196\n<b1a1> <b1fe> 1034\n<b240> <b240> 16205\n<b241> <b241> 9455\n<b242> <b266> 16206\n<b267> <b267> 9454\nendcidrange\n\n100 begincidrange\n<b268> <b26c> 16243\n<b26d> <b26d> 8308\n<b26e> <b273> 16248\n<b274> <b274> 9863\n<b275> <b27e> 16254\n<b280> <b280> 9456\n<b281> <b288> 16264\n<b289> <b289> 9869\n<b28a> <b299> 16272\n<b29a> <b29a> 8864\n<b29b> <b2a0> 16288\n<b2a1> <b2fe> 1128\n<b340> <b342> 16294\n<b343> <b343> 8107\n<b344> <b36f> 16297\n<b370> <b370> 9896\n<b371> <b37e> 16341\n<b380> <b387> 16355\n<b388> <b388> 9449\n<b389> <b38b> 16363\n<b38c> <b38c> 9445\n<b38d> <b38d> 16366\n<b38e> <b38e> 8698\n<b38f> <b3a0> 16367\n<b3a1> <b3fe> 1222\n<b440> <b453> 16385\n<b454> <b454> 8520\n<b455> <b457> 16405\n<b458> <b458> 9444\n<b459> <b45d> 16408\n<b45e> <b45e> 9446\n<b45f> <b45f> 8439\n<b460> <b460> 16413\n<b461> <b461> 8299\n<b462> <b474> 16414\n<b475> <b475> 8871\n<b476> <b47d> 16433\n<b47e> <b47e> 9452\n<b480> <b482> 16441\n<b483> <b483> 9451\n<b484> <b488> 16444\n<b489> <b489> 9443\n<b48a> <b492> 16449\n<b493> <b493> 9450\n<b494> <b4a0> 16458\n<b4a1> <b4fe> 1316\n<b540> <b540> 16471\n<b541> <b541> 7826\n<b542> <b54a> 16472\n<b54b> <b54b> 7719\n<b54c> <b555> 16481\n<b556> <b556> 8166\n<b557> <b559> 16491\n<b55a> <b55a> 9447\n<b55b> <b55b> 8210\n<b55c> <b55c> 7916\n<b55d> <b560> 16494\n<b561> <b561> 9448\n<b562> <b57e> 16498\n<b580> <b59b> 16527\n<b59c> <b59c> 8038\n<b59d> <b59d> 9436\n<b59e> <b5a0> 16555\n<b5a1> <b5fe> 1410\n<b640> <b651> 16558\n<b652> <b652> 9890\n<b653> <b654> 16576\n<b655> <b655> 9437\n<b656> <b658> 16578\n<b659> <b659> 8206\n<b65a> <b65a> 16581\n<b65b> <b65b> 9435\n<b65c> <b65c> 7864\n<b65d> <b67e> 16582\n<b680> <b6a0> 16616\n<b6a1> <b6fe> 1504\n<b740> <b74d> 16649\n<b74e> <b74e> 8853\n<b74f> <b750> 16663\n<b751> <b751> 7808\n<b752> <b758> 16665\n<b759> <b759> 9847\n<b75a> <b763> 16672\n<b764> <b764> 9764\n<b765> <b765> 8041\n<b766> <b766> 8747\n<b767> <b776> 16682\n<b777> <b777> 9599\n<b778> <b778> 8027\n<b779> <b77e> 16698\n<b780> <b780> 8603\n<b781> <b781> 16704\n<b782> <b782> 9853\n<b783> <b7a0> 16705\n<b7a1> <b7fe> 1598\n<b840> <b842> 16735\n<b843> <b843> 8608\n<b844> <b844> 8582\n<b845> <b845> 16738\n<b846> <b846> 8429\nendcidrange\n\n100 begincidrange\n<b847> <b84c> 16739\n<b84d> <b84d> 9657\n<b84e> <b850> 16745\n<b851> <b851> 8170\n<b852> <b859> 16748\n<b85a> <b85a> 7844\n<b85b> <b85b> 8417\n<b85c> <b85c> 16756\n<b85d> <b85d> 9656\n<b85e> <b85e> 8800\n<b85f> <b85f> 16757\n<b860> <b860> 8418\n<b861> <b876> 16758\n<b877> <b877> 8513\n<b878> <b87e> 16780\n<b880> <b881> 16787\n<b882> <b882> 8135\n<b883> <b8a0> 16789\n<b8a1> <b8fe> 1692\n<b940> <b94f> 16819\n<b950> <b950> 7745\n<b951> <b960> 16835\n<b961> <b961> 9700\n<b962> <b97a> 16851\n<b97b> <b97b> 8070\n<b97c> <b97e> 16876\n<b980> <b99c> 16879\n<b99d> <b99d> 8115\n<b99e> <b99f> 16908\n<b9a0> <b9a0> 7919\n<b9a1> <b9fe> 1786\n<ba40> <ba41> 16910\n<ba42> <ba42> 8868\n<ba43> <ba43> 16912\n<ba44> <ba44> 9704\n<ba45> <ba55> 16913\n<ba56> <ba56> 9699\n<ba57> <ba58> 16930\n<ba59> <ba59> 8465\n<ba5a> <ba5f> 16932\n<ba60> <ba60> 9702\n<ba61> <ba69> 16938\n<ba6a> <ba6a> 9703\n<ba6b> <ba73> 16947\n<ba74> <ba74> 8257\n<ba75> <ba7e> 16956\n<ba80> <ba83> 16966\n<ba84> <ba84> 9706\n<ba85> <ba85> 16970\n<ba86> <ba86> 8079\n<ba87> <ba87> 16971\n<ba88> <ba88> 9708\n<ba89> <ba8c> 16972\n<ba8d> <ba8d> 9707\n<ba8e> <ba9d> 16976\n<ba9e> <ba9e> 8400\n<ba9f> <ba9f> 8221\n<baa0> <baa0> 16992\n<baa1> <bafe> 1880\n<bb40> <bb40> 8183\n<bb41> <bb48> 16993\n<bb49> <bb49> 7821\n<bb4a> <bb57> 17001\n<bb58> <bb58> 9705\n<bb59> <bb5a> 17015\n<bb5b> <bb5b> 9710\n<bb5c> <bb5c> 8250\n<bb5d> <bb5f> 17017\n<bb60> <bb60> 9875\n<bb61> <bb64> 17020\n<bb65> <bb65> 9701\n<bb66> <bb66> 9709\n<bb67> <bb67> 17024\n<bb68> <bb68> 8201\n<bb69> <bb69> 17025\n<bb6a> <bb6a> 8293\n<bb6b> <bb6d> 17026\n<bb6e> <bb6e> 9891\n<bb6f> <bb7e> 17029\n<bb80> <bba0> 17045\n<bba1> <bbfe> 1974\n<bc40> <bc51> 17078\n<bc52> <bc52> 9717\n<bc53> <bc53> 7932\n<bc54> <bc59> 17096\n<bc5a> <bc5a> 8228\n<bc5b> <bc60> 17102\n<bc61> <bc61> 9883\n<bc62> <bc62> 17108\n<bc63> <bc63> 9715\n<bc64> <bc64> 17109\n<bc65> <bc65> 8921\n<bc66> <bc66> 17110\n<bc67> <bc67> 9716\n<bc68> <bc68> 17111\n<bc69> <bc69> 9243\n<bc6a> <bc6c> 17112\n<bc6d> <bc6d> 8136\n<bc6e> <bc6e> 17115\n<bc6f> <bc6f> 8059\nendcidrange\n\n100 begincidrange\n<bc70> <bc70> 17116\n<bc71> <bc71> 9245\n<bc72> <bc72> 17117\n<bc73> <bc73> 8780\n<bc74> <bc74> 8008\n<bc75> <bc75> 9244\n<bc76> <bc77> 9246\n<bc78> <bc78> 8447\n<bc79> <bc79> 8602\n<bc7a> <bc7a> 17118\n<bc7b> <bc7b> 8337\n<bc7c> <bc7d> 17119\n<bc7e> <bc7e> 8359\n<bc80> <bc81> 17121\n<bc82> <bc82> 9251\n<bc83> <bc83> 7835\n<bc84> <bc84> 9250\n<bc85> <bc85> 17123\n<bc86> <bc86> 8464\n<bc87> <bc87> 17124\n<bc88> <bc88> 8845\n<bc89> <bc89> 8049\n<bc8a> <bc8a> 7928\n<bc8b> <bc8b> 9249\n<bc8c> <bc8e> 17125\n<bc8f> <bc8f> 7923\n<bc90> <bc99> 17128\n<bc9a> <bc9a> 8625\n<bc9b> <bc9b> 9254\n<bc9c> <bc9c> 9253\n<bc9d> <bc9d> 8480\n<bc9e> <bca0> 17138\n<bca1> <bcfe> 2068\n<bd40> <bd41> 17141\n<bd42> <bd42> 8474\n<bd43> <bd43> 9252\n<bd44> <bd44> 17143\n<bd45> <bd45> 9256\n<bd46> <bd47> 17144\n<bd48> <bd48> 9258\n<bd49> <bd49> 9257\n<bd4a> <bd4a> 17146\n<bd4b> <bd4b> 8852\n<bd4c> <bd4c> 17147\n<bd4d> <bd4d> 8894\n<bd4e> <bd4e> 17148\n<bd4f> <bd4f> 7729\n<bd50> <bd56> 17149\n<bd57> <bd57> 9260\n<bd58> <bd58> 17156\n<bd59> <bd59> 8117\n<bd5a> <bd65> 17157\n<bd66> <bd66> 9259\n<bd67> <bd67> 8111\n<bd68> <bd69> 17169\n<bd6a> <bd6a> 8296\n<bd6b> <bd6b> 8676\n<bd6c> <bd6e> 17171\n<bd6f> <bd6f> 7969\n<bd70> <bd70> 17174\n<bd71> <bd71> 8449\n<bd72> <bd78> 17175\n<bd79> <bd79> 8572\n<bd7a> <bd7a> 8522\n<bd7b> <bd7b> 9261\n<bd7c> <bd7d> 17182\n<bd7e> <bd7e> 8148\n<bd80> <bd80> 17184\n<bd81> <bd81> 8145\n<bd82> <bd88> 17185\n<bd89> <bd89> 7731\n<bd8a> <bd8a> 17192\n<bd8b> <bd8b> 9263\n<bd8c> <bd8d> 17193\n<bd8e> <bd8e> 9262\n<bd8f> <bd8f> 17195\n<bd90> <bd90> 9264\n<bd91> <bd91> 8667\n<bd92> <bd96> 17196\n<bd97> <bd97> 8536\n<bd98> <bd9a> 17201\n<bd9b> <bd9b> 8130\n<bd9c> <bda0> 17204\n<bda1> <bdfe> 2162\n<be40> <be42> 17209\n<be43> <be43> 8889\n<be44> <be44> 17212\n<be45> <be45> 9270\n<be46> <be48> 17213\n<be49> <be49> 7822\n<be4a> <be4a> 9273\n<be4b> <be50> 17216\n<be51> <be51> 8645\n<be52> <be52> 9271\n<be53> <be53> 8594\n<be54> <be54> 17222\n<be55> <be55> 9274\n<be56> <be56> 7961\n<be57> <be57> 8588\n<be58> <be58> 7744\nendcidrange\n\n100 begincidrange\n<be59> <be59> 8883\n<be5a> <be5c> 17223\n<be5d> <be5d> 8287\n<be5e> <be5e> 9272\n<be5f> <be5f> 9266\n<be60> <be60> 8820\n<be61> <be61> 17226\n<be62> <be62> 7836\n<be63> <be63> 9265\n<be64> <be64> 8325\n<be65> <be68> 17227\n<be69> <be69> 9269\n<be6a> <be6b> 17231\n<be6c> <be6c> 9275\n<be6d> <be6e> 17233\n<be6f> <be6f> 8119\n<be70> <be70> 9267\n<be71> <be75> 17235\n<be76> <be76> 8276\n<be77> <be77> 8670\n<be78> <be78> 17240\n<be79> <be79> 9268\n<be7a> <be7b> 17241\n<be7c> <be7c> 9277\n<be7d> <be7d> 8073\n<be7e> <be7e> 9276\n<be80> <be82> 17243\n<be83> <be83> 8046\n<be84> <be84> 7896\n<be85> <be85> 17246\n<be86> <be86> 7871\n<be87> <be87> 9285\n<be88> <be88> 17247\n<be89> <be89> 8777\n<be8a> <be8b> 17248\n<be8c> <be8c> 9281\n<be8d> <be8d> 17250\n<be8e> <be8e> 7751\n<be8f> <be8f> 8022\n<be90> <be91> 17251\n<be92> <be92> 8326\n<be93> <be94> 17253\n<be95> <be95> 8598\n<be96> <be96> 17255\n<be97> <be97> 9283\n<be98> <be98> 9279\n<be99> <be99> 17256\n<be9a> <be9a> 8227\n<be9b> <be9b> 17257\n<be9c> <be9c> 9282\n<be9d> <be9e> 17258\n<be9f> <be9f> 9278\n<bea0> <bea0> 17260\n<bea1> <befe> 2256\n<bf40> <bf40> 9894\n<bf41> <bf4c> 17261\n<bf4d> <bf4d> 9038\n<bf4e> <bf4e> 9286\n<bf4f> <bf4f> 9291\n<bf50> <bf50> 9284\n<bf51> <bf54> 17273\n<bf55> <bf55> 9255\n<bf56> <bf56> 9292\n<bf57> <bf5f> 17277\n<bf60> <bf60> 7951\n<bf61> <bf61> 17286\n<bf62> <bf62> 9287\n<bf63> <bf63> 9289\n<bf64> <bf64> 9288\n<bf65> <bf67> 17287\n<bf68> <bf68> 8642\n<bf69> <bf6b> 17290\n<bf6c> <bf6c> 8558\n<bf6d> <bf6f> 17293\n<bf70> <bf70> 7939\n<bf71> <bf71> 17296\n<bf72> <bf72> 9290\n<bf73> <bf73> 8540\n<bf74> <bf75> 17297\n<bf76> <bf76> 8891\n<bf77> <bf77> 9296\n<bf78> <bf78> 17299\n<bf79> <bf79> 9876\n<bf7a> <bf7a> 9295\n<bf7b> <bf7b> 9718\n<bf7c> <bf7c> 8273\n<bf7d> <bf7d> 17300\n<bf7e> <bf7e> 9294\n<bf80> <bf81> 17301\n<bf82> <bf82> 8890\n<bf83> <bf83> 8045\n<bf84> <bf88> 17303\n<bf89> <bf89> 9298\n<bf8a> <bf8a> 9297\n<bf8b> <bf94> 17308\n<bf95> <bf95> 9301\n<bf96> <bf96> 17318\n<bf97> <bf97> 8841\n<bf98> <bf98> 8470\n<bf99> <bf9c> 17319\nendcidrange\n\n100 begincidrange\n<bf9d> <bf9d> 9300\n<bf9e> <bfa0> 17323\n<bfa1> <bffe> 2350\n<c040> <c040> 8443\n<c041> <c043> 17326\n<c044> <c044> 9280\n<c045> <c04a> 17329\n<c04b> <c04b> 8486\n<c04c> <c04c> 8033\n<c04d> <c04d> 9885\n<c04e> <c04e> 17335\n<c04f> <c04f> 8074\n<c050> <c050> 9302\n<c051> <c051> 9305\n<c052> <c052> 9304\n<c053> <c054> 17336\n<c055> <c055> 8110\n<c056> <c05a> 17338\n<c05b> <c05b> 8730\n<c05c> <c05d> 17343\n<c05e> <c05e> 8058\n<c05f> <c05f> 9293\n<c060> <c060> 9303\n<c061> <c068> 17345\n<c069> <c069> 9299\n<c06a> <c06a> 17353\n<c06b> <c06b> 9248\n<c06c> <c06c> 17354\n<c06d> <c06d> 8671\n<c06e> <c06e> 9861\n<c06f> <c06f> 17355\n<c070> <c070> 7790\n<c071> <c073> 17356\n<c074> <c074> 8740\n<c075> <c075> 9840\n<c076> <c076> 17359\n<c077> <c077> 8634\n<c078> <c078> 17360\n<c079> <c079> 9306\n<c07a> <c07b> 17361\n<c07c> <c07c> 8191\n<c07d> <c07e> 17363\n<c080> <c09a> 17365\n<c09b> <c09b> 9698\n<c09c> <c09c> 17392\n<c09d> <c09d> 9882\n<c09e> <c0a0> 17393\n<c0a1> <c0fe> 2444\n<c140> <c14f> 17396\n<c150> <c150> 7914\n<c151> <c153> 17412\n<c154> <c154> 7724\n<c155> <c15e> 17415\n<c15f> <c15f> 8290\n<c160> <c160> 9457\n<c161> <c161> 17425\n<c162> <c162> 9458\n<c163> <c174> 17426\n<c175> <c175> 9714\n<c176> <c177> 17444\n<c178> <c178> 8725\n<c179> <c17e> 17446\n<c180> <c194> 17452\n<c195> <c195> 8622\n<c196> <c1a0> 17473\n<c1a1> <c1fe> 2538\n<c240> <c24d> 17484\n<c24e> <c24e> 8416\n<c24f> <c264> 17498\n<c265> <c265> 9666\n<c266> <c266> 17520\n<c267> <c267> 9665\n<c268> <c27c> 17521\n<c27d> <c27d> 8488\n<c27e> <c27e> 17542\n<c280> <c283> 17543\n<c284> <c284> 8601\n<c285> <c292> 17547\n<c293> <c293> 8215\n<c294> <c294> 7840\n<c295> <c295> 8485\n<c296> <c296> 8525\n<c297> <c297> 17561\n<c298> <c298> 9668\n<c299> <c299> 8349\n<c29a> <c29a> 8842\n<c29b> <c29b> 17562\n<c29c> <c29c> 9667\n<c29d> <c29f> 17563\n<c2a0> <c2a0> 8569\n<c2a1> <c2fe> 2632\n<c340> <c340> 8248\n<c341> <c342> 17566\n<c343> <c343> 8533\n<c344> <c37a> 17568\n<c37b> <c37b> 8658\n<c37c> <c37e> 17623\n<c380> <c383> 17626\n<c384> <c384> 9415\n<c385> <c39a> 17630\nendcidrange\n\n100 begincidrange\n<c39b> <c39b> 8825\n<c39c> <c3a0> 17652\n<c3a1> <c3fe> 2726\n<c440> <c448> 17657\n<c449> <c449> 8483\n<c44a> <c44b> 17666\n<c44c> <c44c> 9413\n<c44d> <c453> 17668\n<c454> <c454> 9417\n<c455> <c457> 17675\n<c458> <c458> 8340\n<c459> <c45a> 17678\n<c45b> <c45b> 8854\n<c45c> <c462> 17680\n<c463> <c463> 7799\n<c464> <c476> 17687\n<c477> <c477> 7942\n<c478> <c479> 17706\n<c47a> <c47a> 8101\n<c47b> <c47e> 17708\n<c480> <c480> 17712\n<c481> <c481> 8345\n<c482> <c490> 17713\n<c491> <c491> 7853\n<c492> <c492> 9416\n<c493> <c493> 8360\n<c494> <c497> 17728\n<c498> <c498> 8223\n<c499> <c499> 17732\n<c49a> <c49a> 8389\n<c49b> <c49b> 17733\n<c49c> <c49c> 9418\n<c49d> <c4a0> 17734\n<c4a1> <c4fe> 2820\n<c540> <c543> 17738\n<c544> <c544> 8176\n<c545> <c545> 17742\n<c546> <c546> 9414\n<c547> <c54a> 17743\n<c54b> <c54b> 8797\n<c54c> <c54c> 8926\n<c54d> <c551> 17747\n<c552> <c552> 8236\n<c553> <c55e> 17752\n<c55f> <c55f> 8545\n<c560> <c562> 17764\n<c563> <c563> 8763\n<c564> <c564> 8665\n<c565> <c565> 8139\n<c566> <c566> 8137\n<c567> <c57e> 17767\n<c580> <c592> 17791\n<c593> <c593> 7777\n<c594> <c59b> 17810\n<c59c> <c59c> 9711\n<c59d> <c59d> 17818\n<c59e> <c59e> 8088\n<c59f> <c5a0> 17819\n<c5a1> <c5fe> 2914\n<c640> <c640> 17821\n<c641> <c641> 9712\n<c642> <c643> 17822\n<c644> <c644> 8072\n<c645> <c646> 17824\n<c647> <c647> 8696\n<c648> <c662> 17826\n<c663> <c663> 8994\n<c664> <c671> 17853\n<c672> <c672> 9014\n<c673> <c67e> 17867\n<c680> <c6a0> 17879\n<c6a1> <c6fe> 3008\n<c740> <c765> 17912\n<c766> <c766> 8875\n<c767> <c76e> 17950\n<c76f> <c76f> 8127\n<c770> <c775> 17958\n<c776> <c776> 8061\n<c777> <c77a> 17964\n<c77b> <c77b> 9011\n<c77c> <c77e> 17968\n<c780> <c7a0> 17971\n<c7a1> <c7fe> 3102\n<c840> <c840> 18004\n<c841> <c841> 8013\n<c842> <c84e> 18005\n<c84f> <c84f> 9012\n<c850> <c851> 18018\n<c852> <c852> 8177\n<c853> <c865> 18020\n<c866> <c866> 8587\n<c867> <c86d> 18039\n<c86e> <c86e> 9033\n<c86f> <c87d> 18046\n<c87e> <c87e> 8715\n<c880> <c886> 18061\n<c887> <c887> 9030\n<c888> <c891> 18068\n<c892> <c892> 9031\n<c893> <c893> 18078\nendcidrange\n\n100 begincidrange\n<c894> <c894> 8595\n<c895> <c898> 18079\n<c899> <c899> 9889\n<c89a> <c89c> 18083\n<c89d> <c89d> 8034\n<c89e> <c8a0> 18086\n<c8a1> <c8fe> 3196\n<c940> <c94e> 18089\n<c94f> <c94f> 9037\n<c950> <c950> 9032\n<c951> <c96d> 18104\n<c96e> <c96e> 7776\n<c96f> <c96f> 18133\n<c970> <c970> 9029\n<c971> <c976> 18134\n<c977> <c977> 7954\n<c978> <c97e> 18140\n<c980> <c98e> 18147\n<c98f> <c98f> 8216\n<c990> <c990> 9013\n<c991> <c99b> 18162\n<c99c> <c99c> 9020\n<c99d> <c9a0> 18173\n<c9a1> <c9fe> 3290\n<ca40> <ca4d> 18177\n<ca4e> <ca4e> 9839\n<ca4f> <ca55> 18191\n<ca56> <ca56> 9041\n<ca57> <ca58> 18198\n<ca59> <ca59> 8096\n<ca5a> <ca5b> 18200\n<ca5c> <ca5c> 9016\n<ca5d> <ca60> 18202\n<ca61> <ca61> 8731\n<ca62> <ca6d> 18206\n<ca6e> <ca6e> 9026\n<ca6f> <ca71> 18218\n<ca72> <ca72> 9039\n<ca73> <ca76> 18221\n<ca77> <ca77> 9021\n<ca78> <ca7a> 18225\n<ca7b> <ca7b> 9028\n<ca7c> <ca7c> 9009\n<ca7d> <ca7d> 18228\n<ca7e> <ca7e> 9035\n<ca80> <ca80> 18229\n<ca81> <ca81> 9019\n<ca82> <ca88> 18230\n<ca89> <ca89> 9040\n<ca8a> <ca8d> 18237\n<ca8e> <ca8e> 7860\n<ca8f> <ca8f> 8614\n<ca90> <ca91> 18241\n<ca92> <ca92> 8651\n<ca93> <ca99> 18243\n<ca9a> <ca9a> 9045\n<ca9b> <caa0> 18250\n<caa1> <cafe> 3384\n<cb40> <cb42> 18256\n<cb43> <cb43> 9022\n<cb44> <cb44> 18259\n<cb45> <cb45> 8052\n<cb46> <cb46> 18260\n<cb47> <cb47> 9008\n<cb48> <cb4a> 18261\n<cb4b> <cb4b> 9856\n<cb4c> <cb4d> 18264\n<cb4e> <cb4e> 8410\n<cb4f> <cb56> 18266\n<cb57> <cb57> 9034\n<cb58> <cb5c> 18274\n<cb5d> <cb5d> 8081\n<cb5e> <cb5e> 18279\n<cb5f> <cb5f> 8455\n<cb60> <cb69> 18280\n<cb6a> <cb6a> 9023\n<cb6b> <cb7a> 18290\n<cb7b> <cb7b> 8180\n<cb7c> <cb7c> 9027\n<cb7d> <cb7e> 18306\n<cb80> <cb86> 18308\n<cb87> <cb87> 8722\n<cb88> <cb8d> 18315\n<cb8e> <cb8e> 8711\n<cb8f> <cb91> 18321\n<cb92> <cb92> 9049\n<cb93> <cb9b> 18324\n<cb9c> <cb9c> 8788\n<cb9d> <cb9d> 18333\n<cb9e> <cb9e> 9010\n<cb9f> <cba0> 18334\n<cba1> <cbfe> 3478\n<cc40> <cc40> 7718\n<cc41> <cc41> 9047\n<cc42> <cc48> 18336\n<cc49> <cc49> 9048\n<cc4a> <cc4a> 8258\n<cc4b> <cc4b> 8531\n<cc4c> <cc4e> 18343\n<cc4f> <cc4f> 8379\nendcidrange\n\n100 begincidrange\n<cc50> <cc5b> 18346\n<cc5c> <cc5c> 9050\n<cc5d> <cc5f> 18358\n<cc60> <cc60> 9046\n<cc61> <cc63> 18361\n<cc64> <cc64> 9015\n<cc65> <cc6c> 18364\n<cc6d> <cc6d> 8185\n<cc6e> <cc78> 18372\n<cc79> <cc79> 9043\n<cc7a> <cc7c> 18383\n<cc7d> <cc7d> 8289\n<cc7e> <cc7e> 18386\n<cc80> <cc8d> 18387\n<cc8e> <cc8e> 7829\n<cc8f> <cc93> 18401\n<cc94> <cc94> 8265\n<cc95> <cc95> 18406\n<cc96> <cc96> 8002\n<cc97> <cc9c> 18407\n<cc9d> <cc9d> 8168\n<cc9e> <cca0> 18413\n<cca1> <ccfe> 3572\n<cd40> <cd7e> 18416\n<cd80> <cd8f> 18479\n<cd90> <cd90> 9690\n<cd91> <cd97> 18495\n<cd98> <cd98> 9687\n<cd99> <cda0> 18502\n<cda1> <cdfe> 3666\n<ce40> <ce66> 18510\n<ce67> <ce67> 8494\n<ce68> <ce71> 18549\n<ce72> <ce72> 8626\n<ce73> <ce7e> 18559\n<ce80> <ce80> 18571\n<ce81> <ce81> 8606\n<ce82> <ce86> 18572\n<ce87> <ce87> 9692\n<ce88> <ce9a> 18577\n<ce9b> <ce9b> 8300\n<ce9c> <ce9d> 18596\n<ce9e> <ce9e> 8742\n<ce9f> <cea0> 18598\n<cea1> <cefe> 3760\n<cf40> <cf4d> 18600\n<cf4e> <cf4e> 9696\n<cf4f> <cf54> 18614\n<cf55> <cf55> 8827\n<cf56> <cf57> 18620\n<cf58> <cf58> 9694\n<cf59> <cf5b> 18622\n<cf5c> <cf5c> 9697\n<cf5d> <cf6b> 18625\n<cf6c> <cf6c> 9685\n<cf6d> <cf72> 18640\n<cf73> <cf73> 7787\n<cf74> <cf74> 18646\n<cf75> <cf75> 9691\n<cf76> <cf77> 18647\n<cf78> <cf78> 7817\n<cf79> <cf7b> 18649\n<cf7c> <cf7c> 9689\n<cf7d> <cf7e> 18652\n<cf80> <cf80> 18654\n<cf81> <cf81> 8721\n<cf82> <cf88> 18655\n<cf89> <cf89> 8745\n<cf8a> <cf8a> 9686\n<cf8b> <cf92> 18662\n<cf93> <cf93> 9693\n<cf94> <cf94> 9695\n<cf95> <cf9d> 18670\n<cf9e> <cf9e> 8175\n<cf9f> <cf9f> 18679\n<cfa0> <cfa0> 9688\n<cfa1> <cffe> 3854\n<d040> <d04c> 18680\n<d04d> <d04d> 7977\n<d04e> <d050> 18693\n<d051> <d051> 7771\n<d052> <d054> 18696\n<d055> <d055> 8310\n<d056> <d05b> 18699\n<d05c> <d05c> 8855\n<d05d> <d05f> 18705\n<d060> <d060> 9872\n<d061> <d066> 18708\n<d067> <d067> 8511\n<d068> <d06b> 18714\n<d06c> <d06c> 8600\n<d06d> <d06d> 18718\n<d06e> <d06e> 7816\n<d06f> <d07c> 18719\n<d07d> <d07d> 8844\n<d07e> <d07e> 18733\n<d080> <d0a0> 18734\n<d0a1> <d0fe> 3948\n<d140> <d154> 18767\n<d155> <d155> 9713\nendcidrange\n\n100 begincidrange\n<d156> <d158> 18788\n<d159> <d159> 8204\n<d15a> <d160> 18791\n<d161> <d161> 7768\n<d162> <d162> 8876\n<d163> <d174> 18798\n<d175> <d175> 9895\n<d176> <d17c> 18816\n<d17d> <d17d> 9846\n<d17e> <d17e> 18823\n<d180> <d19c> 18824\n<d19d> <d19d> 8161\n<d19e> <d19e> 9659\n<d19f> <d1a0> 18853\n<d1a1> <d1fe> 4042\n<d240> <d240> 9662\n<d241> <d242> 18855\n<d243> <d243> 8925\n<d244> <d24c> 18857\n<d24d> <d24d> 9661\n<d24e> <d25b> 18866\n<d25c> <d25c> 7722\n<d25d> <d262> 18880\n<d263> <d263> 9660\n<d264> <d264> 9658\n<d265> <d267> 18886\n<d268> <d268> 9663\n<d269> <d26c> 18889\n<d26d> <d26d> 8583\n<d26e> <d26e> 18893\n<d26f> <d26f> 9835\n<d270> <d271> 18894\n<d272> <d272> 7807\n<d273> <d274> 18896\n<d275> <d275> 8621\n<d276> <d27e> 18898\n<d280> <d289> 18907\n<d28a> <d28a> 8086\n<d28b> <d28d> 18917\n<d28e> <d28e> 7986\n<d28f> <d291> 18920\n<d292> <d292> 8324\n<d293> <d294> 18923\n<d295> <d295> 8502\n<d296> <d296> 18925\n<d297> <d297> 9400\n<d298> <d29f> 18926\n<d2a0> <d2a0> 9402\n<d2a1> <d2fe> 4136\n<d340> <d343> 18934\n<d344> <d344> 9404\n<d345> <d347> 18938\n<d348> <d348> 8420\n<d349> <d349> 18941\n<d34a> <d34a> 9401\n<d34b> <d34c> 18942\n<d34d> <d34d> 9405\n<d34e> <d34f> 18944\n<d350> <d350> 9406\n<d351> <d354> 18946\n<d355> <d355> 9407\n<d356> <d357> 18950\n<d358> <d358> 8146\n<d359> <d35a> 18952\n<d35b> <d35b> 8189\n<d35c> <d35c> 18954\n<d35d> <d35d> 9403\n<d35e> <d35e> 7981\n<d35f> <d377> 18955\n<d378> <d378> 9737\n<d379> <d379> 18980\n<d37a> <d37a> 9738\n<d37b> <d37b> 18981\n<d37c> <d37c> 7828\n<d37d> <d37e> 18982\n<d380> <d384> 18984\n<d385> <d385> 8927\n<d386> <d386> 7883\n<d387> <d387> 7949\n<d388> <d38a> 18989\n<d38b> <d38b> 8055\n<d38c> <d38c> 18992\n<d38d> <d38d> 8683\n<d38e> <d38e> 18993\n<d38f> <d38f> 8929\n<d390> <d390> 18994\n<d391> <d391> 8559\n<d392> <d392> 18995\n<d393> <d393> 8928\n<d394> <d395> 18996\n<d396> <d396> 8682\n<d397> <d397> 18998\n<d398> <d398> 8930\n<d399> <d399> 8395\n<d39a> <d39a> 18999\n<d39b> <d39b> 8056\n<d39c> <d39d> 19000\n<d39e> <d39e> 7906\n<d39f> <d39f> 19002\n<d3a0> <d3a0> 8690\nendcidrange\n\n100 begincidrange\n<d3a1> <d3fe> 4230\n<d440> <d440> 19003\n<d441> <d441> 8528\n<d442> <d444> 19004\n<d445> <d445> 8147\n<d446> <d446> 19007\n<d447> <d447> 8933\n<d448> <d44b> 19008\n<d44c> <d44c> 7922\n<d44d> <d44e> 19012\n<d44f> <d44f> 8479\n<d450> <d452> 19014\n<d453> <d453> 8669\n<d454> <d455> 19017\n<d456> <d456> 8532\n<d457> <d457> 19019\n<d458> <d458> 8935\n<d459> <d45b> 19020\n<d45c> <d45c> 8834\n<d45d> <d461> 19023\n<d462> <d462> 8934\n<d463> <d466> 19028\n<d467> <d467> 8936\n<d468> <d46d> 19032\n<d46e> <d46e> 8932\n<d46f> <d46f> 19038\n<d470> <d470> 8810\n<d471> <d471> 19039\n<d472> <d472> 8939\n<d473> <d473> 19040\n<d474> <d474> 8937\n<d475> <d475> 8381\n<d476> <d477> 19041\n<d478> <d478> 8938\n<d479> <d47a> 19043\n<d47b> <d47b> 8893\n<d47c> <d47d> 19045\n<d47e> <d47e> 7838\n<d480> <d481> 19047\n<d482> <d482> 8950\n<d483> <d483> 8679\n<d484> <d484> 8726\n<d485> <d486> 19049\n<d487> <d487> 8503\n<d488> <d489> 19051\n<d48a> <d48a> 8492\n<d48b> <d48b> 19053\n<d48c> <d48c> 7784\n<d48d> <d48d> 8946\n<d48e> <d48e> 7991\n<d48f> <d48f> 8947\n<d490> <d490> 19054\n<d491> <d491> 8943\n<d492> <d492> 8016\n<d493> <d493> 7952\n<d494> <d494> 8648\n<d495> <d495> 19055\n<d496> <d496> 8945\n<d497> <d49b> 19056\n<d49c> <d49c> 8944\n<d49d> <d49e> 19061\n<d49f> <d49f> 8942\n<d4a0> <d4a0> 19063\n<d4a1> <d4fe> 4324\n<d540> <d542> 19064\n<d543> <d543> 8941\n<d544> <d544> 8862\n<d545> <d545> 8940\n<d546> <d546> 8162\n<d547> <d549> 19067\n<d54a> <d54a> 8446\n<d54b> <d54d> 19070\n<d54e> <d54f> 8953\n<d550> <d550> 19073\n<d551> <d551> 7855\n<d552> <d553> 19074\n<d554> <d554> 8758\n<d555> <d555> 19076\n<d556> <d556> 8951\n<d557> <d559> 19077\n<d55a> <d55a> 8765\n<d55b> <d55b> 19080\n<d55c> <d55c> 7810\n<d55d> <d55d> 8118\n<d55e> <d55e> 19081\n<d55f> <d55f> 8612\n<d560> <d560> 8618\n<d561> <d561> 8952\n<d562> <d562> 8529\n<d563> <d563> 19082\n<d564> <d564> 8032\n<d565> <d567> 19083\n<d568> <d568> 8519\n<d569> <d56b> 19086\n<d56c> <d56c> 8517\n<d56d> <d56d> 19089\n<d56e> <d56e> 8156\n<d56f> <d571> 19090\n<d572> <d572> 8961\n<d573> <d574> 19093\nendcidrange\n\n100 begincidrange\n<d575> <d575> 7925\n<d576> <d577> 19095\n<d578> <d578> 8728\n<d579> <d57a> 19097\n<d57b> <d57b> 7878\n<d57c> <d57d> 19099\n<d57e> <d57e> 8960\n<d580> <d580> 19101\n<d581> <d581> 8884\n<d582> <d583> 19102\n<d584> <d584> 8553\n<d585> <d585> 19104\n<d586> <d586> 8957\n<d587> <d587> 19105\n<d588> <d588> 8426\n<d589> <d589> 19106\n<d58a> <d58a> 8948\n<d58b> <d58b> 19107\n<d58c> <d58c> 8955\n<d58d> <d58d> 19108\n<d58e> <d58e> 8956\n<d58f> <d58f> 8231\n<d590> <d592> 19109\n<d593> <d593> 8288\n<d594> <d594> 8959\n<d595> <d597> 19112\n<d598> <d598> 8958\n<d599> <d599> 7879\n<d59a> <d59a> 19115\n<d59b> <d59b> 8972\n<d59c> <d59e> 19116\n<d59f> <d59f> 8949\n<d5a0> <d5a0> 19119\n<d5a1> <d5fe> 4418\n<d640> <d640> 8966\n<d641> <d641> 19120\n<d642> <d642> 8970\n<d643> <d643> 8659\n<d644> <d646> 19121\n<d647> <d647> 8963\n<d648> <d648> 19124\n<d649> <d649> 8967\n<d64a> <d64a> 8971\n<d64b> <d64c> 19125\n<d64d> <d64d> 8031\n<d64e> <d64e> 19127\n<d64f> <d64f> 8969\n<d650> <d651> 19128\n<d652> <d652> 8962\n<d653> <d653> 7940\n<d654> <d654> 8861\n<d655> <d655> 19130\n<d656> <d656> 8699\n<d657> <d657> 19131\n<d658> <d658> 8968\n<d659> <d659> 19132\n<d65a> <d65a> 8364\n<d65b> <d65b> 19133\n<d65c> <d65c> 8334\n<d65d> <d65d> 8965\n<d65e> <d65e> 8599\n<d65f> <d65f> 19134\n<d660> <d660> 8561\n<d661> <d661> 8856\n<d662> <d664> 19135\n<d665> <d665> 8023\n<d666> <d668> 19138\n<d669> <d669> 8322\n<d66a> <d66a> 19141\n<d66b> <d66b> 8977\n<d66c> <d66e> 19142\n<d66f> <d66f> 8964\n<d670> <d670> 19145\n<d671> <d671> 8975\n<d672> <d672> 7733\n<d673> <d673> 19146\n<d674> <d674> 8401\n<d675> <d675> 8976\n<d676> <d676> 8099\n<d677> <d677> 19147\n<d678> <d678> 8662\n<d679> <d67b> 19148\n<d67c> <d67c> 8710\n<d67d> <d67e> 19151\n<d680> <d682> 19153\n<d683> <d683> 8973\n<d684> <d685> 19156\n<d686> <d686> 8978\n<d687> <d687> 8333\n<d688> <d688> 8979\n<d689> <d68d> 19158\n<d68e> <d68e> 8931\n<d68f> <d693> 19163\n<d694> <d694> 8122\n<d695> <d698> 19168\n<d699> <d699> 8312\n<d69a> <d6a0> 19172\n<d6a1> <d6fe> 4512\n<d740> <d742> 19179\n<d743> <d743> 8840\nendcidrange\n\n100 begincidrange\n<d744> <d747> 19182\n<d748> <d748> 8982\n<d749> <d749> 8043\n<d74a> <d74f> 19186\n<d750> <d750> 8980\n<d751> <d751> 19192\n<d752> <d752> 8496\n<d753> <d753> 8981\n<d754> <d754> 8552\n<d755> <d755> 19193\n<d756> <d756> 8388\n<d757> <d763> 19194\n<d764> <d764> 8984\n<d765> <d766> 19207\n<d767> <d767> 8729\n<d768> <d768> 8727\n<d769> <d76b> 19209\n<d76c> <d76c> 8405\n<d76d> <d76e> 19212\n<d76f> <d76f> 8010\n<d770> <d774> 19214\n<d775> <d775> 8768\n<d776> <d777> 19219\n<d778> <d778> 7891\n<d779> <d77e> 19221\n<d780> <d782> 19227\n<d783> <d783> 7753\n<d784> <d786> 19230\n<d787> <d787> 9755\n<d788> <d78a> 19233\n<d78b> <d78b> 7789\n<d78c> <d78c> 8440\n<d78d> <d78d> 19236\n<d78e> <d78e> 8187\n<d78f> <d78f> 8985\n<d790> <d794> 19237\n<d795> <d795> 8974\n<d796> <d796> 19242\n<d797> <d797> 8983\n<d798> <d7a0> 19243\n<d7a1> <d7f9> 4606\n<d840> <d84c> 19252\n<d84d> <d84d> 8392\n<d84e> <d852> 19265\n<d853> <d853> 7933\n<d854> <d87e> 19270\n<d880> <d88f> 19313\n<d890> <d890> 7739\n<d891> <d891> 8831\n<d892> <d892> 19329\n<d893> <d893> 7948\n<d894> <d894> 7769\n<d895> <d895> 7972\n<d896> <d899> 19330\n<d89a> <d89a> 8378\n<d89b> <d89b> 8037\n<d89c> <d89c> 7920\n<d89d> <d89d> 8548\n<d89e> <d89e> 7984\n<d89f> <d89f> 8801\n<d8a0> <d8a0> 19334\n<d8a1> <d8fe> 4695\n<d940> <d940> 19335\n<d941> <d941> 8866\n<d942> <d942> 9387\n<d943> <d943> 19336\n<d944> <d944> 9391\n<d945> <d945> 7912\n<d946> <d946> 7993\n<d947> <d947> 19337\n<d948> <d948> 7752\n<d949> <d949> 8304\n<d94a> <d94a> 7848\n<d94b> <d94b> 19338\n<d94c> <d94c> 9388\n<d94d> <d94d> 7927\n<d94e> <d94e> 8566\n<d94f> <d94f> 9389\n<d950> <d950> 19339\n<d951> <d951> 8315\n<d952> <d952> 8005\n<d953> <d953> 9386\n<d954> <d954> 8267\n<d955> <d955> 8239\n<d956> <d956> 8026\n<d957> <d957> 9392\n<d958> <d958> 19340\n<d959> <d959> 8887\n<d95a> <d95a> 8063\n<d95b> <d95b> 19341\n<d95c> <d95c> 8805\n<d95d> <d962> 19342\n<d963> <d963> 9394\n<d964> <d964> 8475\n<d965> <d965> 7761\n<d966> <d966> 19348\n<d967> <d967> 9396\n<d968> <d96b> 19349\n<d96c> <d96c> 9395\n<d96d> <d96d> 19353\nendcidrange\n\n100 begincidrange\n<d96e> <d96e> 7839\n<d96f> <d96f> 19354\n<d970> <d970> 8472\n<d971> <d971> 19355\n<d972> <d972> 8372\n<d973> <d973> 9135\n<d974> <d974> 8635\n<d975> <d975> 8306\n<d976> <d976> 8085\n<d977> <d977> 19356\n<d978> <d978> 7946\n<d979> <d979> 9398\n<d97a> <d97b> 19357\n<d97c> <d97c> 8849\n<d97d> <d97d> 9397\n<d97e> <d97e> 8824\n<d980> <d980> 7892\n<d981> <d986> 19359\n<d987> <d987> 8179\n<d988> <d98c> 19365\n<d98d> <d98d> 8873\n<d98e> <d98e> 9399\n<d98f> <d98f> 7976\n<d990> <d990> 8457\n<d991> <d991> 8903\n<d992> <d996> 19370\n<d997> <d997> 9390\n<d998> <d998> 8881\n<d999> <d99a> 19375\n<d99b> <d99b> 8806\n<d99c> <d99c> 19377\n<d99d> <d99d> 8795\n<d99e> <d99e> 8900\n<d99f> <d99f> 19378\n<d9a0> <d9a0> 8469\n<d9a1> <d9fe> 4789\n<da40> <da40> 19379\n<da41> <da41> 8746\n<da42> <da42> 9393\n<da43> <da47> 19380\n<da48> <da48> 8509\n<da49> <da4c> 19385\n<da4d> <da4d> 7957\n<da4e> <da4e> 8796\n<da4f> <da72> 19389\n<da73> <da73> 7956\n<da74> <da76> 19425\n<da77> <da77> 8826\n<da78> <da7e> 19428\n<da80> <da84> 19435\n<da85> <da85> 8430\n<da86> <da8d> 19440\n<da8e> <da8e> 9720\n<da8f> <daa0> 19448\n<daa1> <dafe> 4883\n<db40> <db5f> 19466\n<db60> <db60> 8084\n<db61> <db77> 19498\n<db78> <db78> 8752\n<db79> <db7e> 19521\n<db80> <db83> 19527\n<db84> <db84> 9725\n<db85> <db8a> 19531\n<db8b> <db8b> 9728\n<db8c> <db97> 19537\n<db98> <db98> 9734\n<db99> <dba0> 19549\n<dba1> <dbfe> 4977\n<dc40> <dc44> 19557\n<dc45> <dc45> 9727\n<dc46> <dc4e> 19562\n<dc4f> <dc4f> 9724\n<dc50> <dc50> 7820\n<dc51> <dc51> 9730\n<dc52> <dc52> 19571\n<dc53> <dc53> 8781\n<dc54> <dc54> 19572\n<dc55> <dc55> 9732\n<dc56> <dc56> 9726\n<dc57> <dc57> 9731\n<dc58> <dc5c> 19573\n<dc5d> <dc5d> 9729\n<dc5e> <dc61> 19578\n<dc62> <dc62> 9733\n<dc63> <dc65> 19582\n<dc66> <dc66> 7843\n<dc67> <dc67> 9736\n<dc68> <dc6a> 19585\n<dc6b> <dc6b> 9735\n<dc6c> <dc7b> 19588\n<dc7c> <dc7c> 8432\n<dc7d> <dc7e> 19604\n<dc80> <dc86> 19606\n<dc87> <dc87> 7803\n<dc88> <dc88> 8807\n<dc89> <dc89> 7990\n<dc8a> <dc8a> 8150\n<dc8b> <dc8d> 19613\n<dc8e> <dc8e> 8672\n<dc8f> <dc8f> 19616\nendcidrange\n\n100 begincidrange\n<dc90> <dc90> 9356\n<dc91> <dc96> 19617\n<dc97> <dc97> 9357\n<dc98> <dc9a> 19623\n<dc9b> <dc9b> 8450\n<dc9c> <dc9f> 19626\n<dca0> <dca0> 9364\n<dca1> <dcfe> 5071\n<dd40> <dd45> 19630\n<dd46> <dd46> 9363\n<dd47> <dd4c> 19636\n<dd4d> <dd4d> 9358\n<dd4e> <dd52> 19642\n<dd53> <dd53> 8857\n<dd54> <dd54> 9361\n<dd55> <dd55> 9366\n<dd56> <dd56> 9359\n<dd57> <dd57> 9362\n<dd58> <dd58> 19647\n<dd59> <dd59> 9367\n<dd5a> <dd5d> 19648\n<dd5e> <dd5e> 8113\n<dd5f> <dd5f> 19652\n<dd60> <dd60> 9370\n<dd61> <dd61> 19653\n<dd62> <dd62> 9369\n<dd63> <dd63> 19654\n<dd64> <dd64> 8792\n<dd65> <dd65> 9368\n<dd66> <dd6c> 19655\n<dd6d> <dd6d> 9371\n<dd6e> <dd6e> 19662\n<dd6f> <dd6f> 7945\n<dd70> <dd70> 8422\n<dd71> <dd75> 19663\n<dd76> <dd76> 8230\n<dd77> <dd77> 9375\n<dd78> <dd78> 8025\n<dd79> <dd7a> 9373\n<dd7b> <dd7e> 19668\n<dd80> <dd80> 19672\n<dd81> <dd81> 7995\n<dd82> <dd82> 9372\n<dd83> <dd84> 19673\n<dd85> <dd85> 7738\n<dd86> <dd86> 8283\n<dd87> <dd8a> 19675\n<dd8b> <dd8b> 8048\n<dd8c> <dd8e> 19679\n<dd8f> <dd8f> 9376\n<dd90> <dd93> 19682\n<dd94> <dd94> 8507\n<dd95> <dd96> 19686\n<dd97> <dd97> 7943\n<dd98> <dd99> 19688\n<dd9a> <dd9a> 8816\n<dd9b> <dd9b> 8759\n<dd9c> <dd9d> 19690\n<dd9e> <dd9e> 9426\n<dd9f> <dd9f> 19692\n<dda0> <dda0> 8627\n<dda1> <ddfe> 5165\n<de40> <de40> 8773\n<de41> <de41> 9377\n<de42> <de43> 19693\n<de44> <de44> 8872\n<de45> <de47> 19695\n<de48> <de48> 8828\n<de49> <de49> 8112\n<de4a> <de4e> 19698\n<de4f> <de4f> 9378\n<de50> <de59> 19703\n<de5a> <de5a> 8006\n<de5b> <de5b> 19713\n<de5c> <de5c> 9088\n<de5d> <de5d> 9365\n<de5e> <de5e> 19714\n<de5f> <de5f> 9360\n<de60> <de6a> 19715\n<de6b> <de6b> 7728\n<de6c> <de6e> 19726\n<de6f> <de6f> 7837\n<de70> <de70> 7755\n<de71> <de71> 7754\n<de72> <de72> 8362\n<de73> <de7e> 19729\n<de80> <de91> 19741\n<de92> <de92> 9851\n<de93> <de9e> 19759\n<de9f> <de9f> 9202\n<dea0> <dea0> 19771\n<dea1> <defe> 5259\n<df40> <df40> 8830\n<df41> <df41> 19772\n<df42> <df42> 8217\n<df43> <df4c> 19773\n<df4d> <df4d> 8123\n<df4e> <df5b> 19783\n<df5c> <df5c> 8787\n<df5d> <df5d> 19797\nendcidrange\n\n100 begincidrange\n<df5e> <df5e> 7998\n<df5f> <df5f> 7846\n<df60> <df60> 8590\n<df61> <df63> 19798\n<df64> <df64> 8684\n<df65> <df65> 19801\n<df66> <df66> 7870\n<df67> <df67> 19802\n<df68> <df68> 8778\n<df69> <df6c> 19803\n<df6d> <df6d> 8499\n<df6e> <df73> 19807\n<df74> <df74> 7812\n<df75> <df76> 19813\n<df77> <df77> 8399\n<df78> <df78> 8674\n<df79> <df79> 19815\n<df7a> <df7a> 8719\n<df7b> <df7b> 19816\n<df7c> <df7c> 8233\n<df7d> <df7d> 19817\n<df7e> <df7e> 8307\n<df80> <df80> 8021\n<df81> <df82> 19818\n<df83> <df83> 9201\n<df84> <df84> 19820\n<df85> <df85> 7750\n<df86> <df88> 19821\n<df89> <df89> 8291\n<df8a> <df8a> 9203\n<df8b> <dfa0> 19824\n<dfa1> <dffe> 5353\n<e040> <e04f> 19846\n<e050> <e050> 8990\n<e051> <e05c> 19862\n<e05d> <e05d> 8755\n<e05e> <e068> 19874\n<e069> <e069> 8992\n<e06a> <e06b> 19885\n<e06c> <e06c> 8647\n<e06d> <e074> 19887\n<e075> <e075> 8892\n<e076> <e076> 19895\n<e077> <e077> 8988\n<e078> <e078> 19896\n<e079> <e079> 8785\n<e07a> <e07e> 19897\n<e080> <e086> 19902\n<e087> <e087> 7867\n<e088> <e08c> 19909\n<e08d> <e08d> 8839\n<e08e> <e08e> 19914\n<e08f> <e08f> 8237\n<e090> <e090> 7851\n<e091> <e091> 19915\n<e092> <e092> 8989\n<e093> <e093> 19916\n<e094> <e094> 8991\n<e095> <e096> 19917\n<e097> <e097> 8987\n<e098> <e0a0> 19919\n<e0a1> <e0fe> 5447\n<e140> <e141> 19928\n<e142> <e142> 8993\n<e143> <e163> 19930\n<e164> <e164> 8789\n<e165> <e167> 19963\n<e168> <e168> 7823\n<e169> <e173> 19966\n<e174> <e174> 8716\n<e175> <e175> 8100\n<e176> <e17e> 19977\n<e180> <e183> 19986\n<e184> <e184> 8347\n<e185> <e185> 8664\n<e186> <e186> 19990\n<e187> <e187> 9722\n<e188> <e188> 19991\n<e189> <e189> 9721\n<e18a> <e18b> 19992\n<e18c> <e18c> 8500\n<e18d> <e18d> 19994\n<e18e> <e190> 9459\n<e191> <e191> 9464\n<e192> <e192> 19995\n<e193> <e193> 9463\n<e194> <e194> 7880\n<e195> <e195> 9462\n<e196> <e197> 19996\n<e198> <e198> 8832\n<e199> <e19d> 19998\n<e19e> <e19e> 7877\n<e19f> <e19f> 9467\n<e1a0> <e1a0> 20003\n<e1a1> <e1fe> 5541\n<e240> <e240> 20004\n<e241> <e241> 9466\n<e242> <e242> 20005\n<e243> <e243> 7917\n<e244> <e24e> 20006\nendcidrange\n\n100 begincidrange\n<e24f> <e24f> 9469\n<e250> <e250> 20017\n<e251> <e251> 9465\n<e252> <e252> 20018\n<e253> <e253> 9470\n<e254> <e254> 8397\n<e255> <e259> 20019\n<e25a> <e25a> 9480\n<e25b> <e25b> 9476\n<e25c> <e25d> 20024\n<e25e> <e25e> 9478\n<e25f> <e261> 20026\n<e262> <e262> 9471\n<e263> <e263> 8336\n<e264> <e266> 20029\n<e267> <e267> 7901\n<e268> <e268> 7973\n<e269> <e269> 20032\n<e26a> <e26a> 9475\n<e26b> <e26b> 9474\n<e26c> <e26d> 20033\n<e26e> <e26e> 7802\n<e26f> <e26f> 8358\n<e270> <e277> 20035\n<e278> <e278> 8149\n<e279> <e27c> 20043\n<e27d> <e27d> 7953\n<e27e> <e27e> 20047\n<e280> <e280> 9479\n<e281> <e281> 9472\n<e282> <e282> 9477\n<e283> <e288> 20048\n<e289> <e289> 9497\n<e28a> <e28a> 20054\n<e28b> <e28b> 9493\n<e28c> <e28d> 20055\n<e28e> <e28e> 9484\n<e28f> <e28f> 8241\n<e290> <e291> 20057\n<e292> <e292> 9483\n<e293> <e293> 9487\n<e294> <e294> 9498\n<e295> <e295> 9481\n<e296> <e297> 20059\n<e298> <e298> 9486\n<e299> <e299> 8756\n<e29a> <e29a> 9491\n<e29b> <e29b> 8064\n<e29c> <e29f> 20061\n<e2a0> <e2a0> 9473\n<e2a1> <e2fe> 5635\n<e340> <e341> 20065\n<e342> <e342> 9495\n<e343> <e343> 9494\n<e344> <e346> 20067\n<e347> <e347> 9496\n<e348> <e34a> 20070\n<e34b> <e34b> 7766\n<e34c> <e34e> 20073\n<e34f> <e34f> 9485\n<e350> <e350> 20076\n<e351> <e351> 8403\n<e352> <e353> 20077\n<e354> <e354> 8314\n<e355> <e355> 8398\n<e356> <e357> 20079\n<e358> <e358> 9488\n<e359> <e35b> 20081\n<e35c> <e35c> 7765\n<e35d> <e35f> 20084\n<e360> <e360> 9482\n<e361> <e365> 20087\n<e366> <e367> 9489\n<e368> <e370> 20092\n<e371> <e371> 8106\n<e372> <e372> 20101\n<e373> <e373> 9502\n<e374> <e374> 7967\n<e375> <e377> 20102\n<e378> <e378> 9517\n<e379> <e379> 8733\n<e37a> <e37b> 20105\n<e37c> <e37c> 9522\n<e37d> <e37d> 20107\n<e37e> <e37e> 8571\n<e380> <e389> 20108\n<e38a> <e38a> 8623\n<e38b> <e38b> 20118\n<e38c> <e38c> 9516\n<e38d> <e38e> 20119\n<e38f> <e38f> 9512\n<e390> <e390> 20121\n<e391> <e391> 8332\n<e392> <e392> 20122\n<e393> <e393> 9519\n<e394> <e394> 20123\n<e395> <e395> 8636\n<e396> <e398> 20124\n<e399> <e399> 9501\n<e39a> <e39b> 20127\nendcidrange\n\n100 begincidrange\n<e39c> <e39c> 9525\n<e39d> <e39d> 20129\n<e39e> <e39e> 8717\n<e39f> <e39f> 9510\n<e3a0> <e3a0> 20130\n<e3a1> <e3fe> 5729\n<e440> <e440> 9524\n<e441> <e441> 9514\n<e442> <e442> 9503\n<e443> <e443> 9521\n<e444> <e444> 9500\n<e445> <e447> 20131\n<e448> <e448> 9509\n<e449> <e44d> 20134\n<e44e> <e44e> 8653\n<e44f> <e44f> 20139\n<e450> <e450> 8666\n<e451> <e451> 20140\n<e452> <e452> 8562\n<e453> <e453> 9534\n<e454> <e457> 20141\n<e458> <e458> 8271\n<e459> <e459> 20145\n<e45a> <e45a> 9539\n<e45b> <e45b> 20146\n<e45c> <e45c> 8663\n<e45d> <e45d> 20147\n<e45e> <e45e> 7740\n<e45f> <e461> 20148\n<e462> <e462> 9513\n<e463> <e464> 20151\n<e465> <e465> 9505\n<e466> <e467> 20153\n<e468> <e468> 7935\n<e469> <e472> 20155\n<e473> <e473> 9535\n<e474> <e474> 20165\n<e475> <e475> 9540\n<e476> <e478> 20166\n<e479> <e479> 9507\n<e47a> <e47a> 7824\n<e47b> <e47b> 9530\n<e47c> <e47c> 9541\n<e47d> <e47d> 20169\n<e47e> <e47e> 9533\n<e480> <e480> 20170\n<e481> <e481> 8385\n<e482> <e483> 20171\n<e484> <e484> 8451\n<e485> <e485> 9504\n<e486> <e486> 9532\n<e487> <e487> 9531\n<e488> <e488> 9528\n<e489> <e48c> 20173\n<e48d> <e48d> 9536\n<e48e> <e48e> 20177\n<e48f> <e48f> 8141\n<e490> <e492> 20178\n<e493> <e493> 7960\n<e494> <e497> 20181\n<e498> <e498> 9547\n<e499> <e49c> 20185\n<e49d> <e49d> 9543\n<e49e> <e49f> 9551\n<e4a0> <e4a0> 20189\n<e4a1> <e4fe> 5823\n<e540> <e545> 20190\n<e546> <e546> 8880\n<e547> <e547> 20196\n<e548> <e548> 9542\n<e549> <e54a> 20197\n<e54b> <e54b> 9548\n<e54c> <e54d> 20199\n<e54e> <e54e> 7834\n<e54f> <e54f> 9554\n<e550> <e550> 9520\n<e551> <e551> 9545\n<e552> <e554> 20201\n<e555> <e555> 9553\n<e556> <e556> 7882\n<e557> <e557> 20204\n<e558> <e558> 8402\n<e559> <e55b> 20205\n<e55c> <e55c> 8120\n<e55d> <e55d> 20208\n<e55e> <e55e> 8313\n<e55f> <e560> 20209\n<e561> <e561> 8619\n<e562> <e563> 20211\n<e564> <e564> 9549\n<e565> <e565> 7845\n<e566> <e567> 20213\n<e568> <e568> 8268\n<e569> <e569> 8320\n<e56a> <e56b> 20215\n<e56c> <e56c> 9837\n<e56d> <e56d> 20217\n<e56e> <e56e> 9527\n<e56f> <e574> 20218\n<e575> <e575> 9546\nendcidrange\n\n100 begincidrange\n<e576> <e576> 8632\n<e577> <e577> 20224\n<e578> <e578> 9550\n<e579> <e57a> 20225\n<e57b> <e57b> 9468\n<e57c> <e57c> 9556\n<e57d> <e57e> 20227\n<e580> <e580> 20229\n<e581> <e581> 7996\n<e582> <e582> 20230\n<e583> <e583> 7893\n<e584> <e589> 20231\n<e58a> <e58a> 9558\n<e58b> <e58d> 20237\n<e58e> <e58e> 8808\n<e58f> <e590> 20240\n<e591> <e591> 7894\n<e592> <e599> 20242\n<e59a> <e59a> 9559\n<e59b> <e59b> 9555\n<e59c> <e59e> 20250\n<e59f> <e59f> 9544\n<e5a0> <e5a0> 20253\n<e5a1> <e5fe> 5917\n<e640> <e640> 8412\n<e641> <e643> 20254\n<e644> <e644> 9561\n<e645> <e648> 20257\n<e649> <e649> 8087\n<e64a> <e64a> 9557\n<e64b> <e64d> 20261\n<e64e> <e64e> 8829\n<e64f> <e651> 20264\n<e652> <e652> 9598\n<e653> <e655> 20267\n<e656> <e656> 8316\n<e657> <e657> 20270\n<e658> <e658> 9562\n<e659> <e65a> 20271\n<e65b> <e65b> 9566\n<e65c> <e65d> 20273\n<e65e> <e65e> 7732\n<e65f> <e668> 20275\n<e669> <e669> 8542\n<e66a> <e66a> 20285\n<e66b> <e66b> 9568\n<e66c> <e674> 20286\n<e675> <e675> 8610\n<e676> <e676> 9044\n<e677> <e678> 20295\n<e679> <e679> 9571\n<e67a> <e67a> 9511\n<e67b> <e67b> 20297\n<e67c> <e67c> 9518\n<e67d> <e67d> 9560\n<e67e> <e67e> 20298\n<e680> <e680> 7963\n<e681> <e681> 20299\n<e682> <e682> 8835\n<e683> <e683> 20300\n<e684> <e684> 9572\n<e685> <e686> 20301\n<e687> <e687> 8352\n<e688> <e688> 20303\n<e689> <e689> 9573\n<e68a> <e68b> 20304\n<e68c> <e68c> 9569\n<e68d> <e692> 20306\n<e693> <e693> 9570\n<e694> <e696> 20312\n<e697> <e697> 9580\n<e698> <e69a> 20315\n<e69b> <e69b> 9581\n<e69c> <e69c> 8224\n<e69d> <e69e> 20318\n<e69f> <e69f> 9567\n<e6a0> <e6a0> 9578\n<e6a1> <e6fe> 6011\n<e740> <e742> 20320\n<e743> <e743> 9582\n<e744> <e747> 20323\n<e748> <e748> 9529\n<e749> <e749> 9564\n<e74a> <e74c> 20327\n<e74d> <e74e> 9576\n<e74f> <e74f> 9579\n<e750> <e750> 7791\n<e751> <e751> 20330\n<e752> <e752> 8132\n<e753> <e753> 9575\n<e754> <e754> 20331\n<e755> <e755> 9563\n<e756> <e758> 20332\n<e759> <e759> 9757\n<e75a> <e765> 20335\n<e766> <e766> 9515\n<e767> <e767> 20347\n<e768> <e768> 9585\n<e769> <e769> 20348\n<e76a> <e76a> 9591\nendcidrange\n\n100 begincidrange\n<e76b> <e773> 20349\n<e774> <e774> 9506\n<e775> <e77b> 20358\n<e77c> <e77c> 9523\n<e77d> <e77e> 20365\n<e780> <e781> 20367\n<e782> <e782> 8234\n<e783> <e783> 20369\n<e784> <e784> 9526\n<e785> <e785> 9587\n<e786> <e786> 9583\n<e787> <e789> 20370\n<e78a> <e78a> 8851\n<e78b> <e78b> 9592\n<e78c> <e78e> 20373\n<e78f> <e78f> 9584\n<e790> <e791> 20376\n<e792> <e792> 9589\n<e793> <e797> 20378\n<e798> <e799> 9537\n<e79a> <e79a> 9565\n<e79b> <e79f> 20383\n<e7a0> <e7a0> 8218\n<e7a1> <e7fe> 6105\n<e840> <e842> 20388\n<e843> <e843> 9594\n<e844> <e844> 8198\n<e845> <e845> 20391\n<e846> <e846> 8567\n<e847> <e848> 20392\n<e849> <e849> 9499\n<e84a> <e84a> 20394\n<e84b> <e84b> 9508\n<e84c> <e84e> 20395\n<e84f> <e84f> 9595\n<e850> <e853> 20398\n<e854> <e854> 8867\n<e855> <e859> 20402\n<e85a> <e85a> 9593\n<e85b> <e85b> 20407\n<e85c> <e85c> 9574\n<e85d> <e861> 20408\n<e862> <e862> 8083\n<e863> <e863> 20413\n<e864> <e864> 9596\n<e865> <e86f> 20414\n<e870> <e870> 9492\n<e871> <e872> 20425\n<e873> <e873> 9597\n<e874> <e874> 20427\n<e875> <e875> 9586\n<e876> <e87b> 20428\n<e87c> <e87c> 9588\n<e87d> <e87e> 20434\n<e880> <e880> 8782\n<e881> <e881> 20436\n<e882> <e882> 8646\n<e883> <e886> 20437\n<e887> <e887> 8351\n<e888> <e888> 20441\n<e889> <e889> 9590\n<e88a> <e88b> 20442\n<e88c> <e88c> 8292\n<e88d> <e88d> 8895\n<e88e> <e88e> 9756\n<e88f> <e88f> 8798\n<e890> <e8a0> 20444\n<e8a1> <e8fe> 6199\n<e940> <e94b> 20461\n<e94c> <e94c> 7797\n<e94d> <e953> 20473\n<e954> <e954> 8317\n<e955> <e955> 20480\n<e956> <e956> 9151\n<e957> <e957> 8467\n<e958> <e959> 20481\n<e95a> <e95a> 9152\n<e95b> <e95c> 20483\n<e95d> <e95d> 7749\n<e95e> <e95e> 20485\n<e95f> <e95f> 8152\n<e960> <e960> 9156\n<e961> <e961> 20486\n<e962> <e962> 9154\n<e963> <e963> 8452\n<e964> <e964> 20487\n<e965> <e965> 8637\n<e966> <e966> 20488\n<e967> <e967> 8071\n<e968> <e968> 9155\n<e969> <e96b> 20489\n<e96c> <e96c> 8809\n<e96d> <e974> 20492\n<e975> <e975> 8003\n<e976> <e976> 20500\n<e977> <e977> 7966\n<e978> <e978> 9849\n<e979> <e979> 7915\n<e97a> <e97b> 20501\n<e97c> <e97c> 7989\nendcidrange\n\n100 begincidrange\n<e97d> <e97d> 8330\n<e97e> <e97e> 20503\n<e980> <e980> 9159\n<e981> <e981> 9161\n<e982> <e982> 9158\n<e983> <e986> 20504\n<e987> <e987> 8783\n<e988> <e98a> 20508\n<e98b> <e98b> 9163\n<e98c> <e98d> 20511\n<e98e> <e98e> 8691\n<e98f> <e98f> 20513\n<e990> <e990> 8695\n<e991> <e991> 9167\n<e992> <e992> 9166\n<e993> <e993> 9162\n<e994> <e994> 9165\n<e995> <e997> 20514\n<e998> <e998> 9168\n<e999> <e99a> 20517\n<e99b> <e99b> 9836\n<e99c> <e99c> 20519\n<e99d> <e99d> 9153\n<e99e> <e99e> 20520\n<e99f> <e99f> 8174\n<e9a0> <e9a0> 9169\n<e9a1> <e9fe> 6293\n<ea40> <ea40> 8184\n<ea41> <ea43> 20521\n<ea44> <ea44> 9171\n<ea45> <ea47> 20524\n<ea48> <ea48> 9170\n<ea49> <ea49> 9172\n<ea4a> <ea4a> 7832\n<ea4b> <ea4f> 20527\n<ea50> <ea50> 7980\n<ea51> <ea51> 20532\n<ea52> <ea52> 9173\n<ea53> <ea54> 20533\n<ea55> <ea55> 7793\n<ea56> <ea56> 9873\n<ea57> <ea58> 20535\n<ea59> <ea59> 9157\n<ea5a> <ea7e> 20537\n<ea80> <ea80> 8986\n<ea81> <ea83> 20574\n<ea84> <ea84> 8468\n<ea85> <ea86> 20577\n<ea87> <ea87> 8836\n<ea88> <ea8d> 20579\n<ea8e> <ea8e> 8732\n<ea8f> <ea8f> 20585\n<ea90> <ea90> 7806\n<ea91> <ea91> 8269\n<ea92> <ea95> 20586\n<ea96> <ea96> 8705\n<ea97> <ea9f> 20590\n<eaa0> <eaa0> 7897\n<eaa1> <eafe> 6387\n<eb40> <eb40> 20599\n<eb41> <eb41> 8114\n<eb42> <eb44> 20600\n<eb45> <eb45> 8786\n<eb46> <eb47> 20603\n<eb48> <eb48> 8057\n<eb49> <eb52> 20605\n<eb53> <eb53> 8535\n<eb54> <eb54> 20615\n<eb55> <eb55> 8639\n<eb56> <eb5a> 20616\n<eb5b> <eb5b> 8735\n<eb5c> <eb5c> 20621\n<eb5d> <eb5d> 8253\n<eb5e> <eb5f> 20622\n<eb60> <eb60> 8213\n<eb61> <eb61> 20624\n<eb62> <eb62> 9893\n<eb63> <eb6c> 20625\n<eb6d> <eb6d> 8534\n<eb6e> <eb6f> 20635\n<eb70> <eb70> 8516\n<eb71> <eb71> 20637\n<eb72> <eb72> 7825\n<eb73> <eb73> 8791\n<eb74> <eb77> 20638\n<eb78> <eb78> 8202\n<eb79> <eb79> 8338\n<eb7a> <eb7e> 20642\n<eb80> <eb84> 20647\n<eb85> <eb85> 8784\n<eb86> <eb89> 20652\n<eb8a> <eb8a> 7875\n<eb8b> <eba0> 20656\n<eba1> <ebfe> 6481\n<ec40> <ec45> 20678\n<ec46> <ec46> 8616\n<ec47> <ec55> 20684\n<ec56> <ec56> 9741\n<ec57> <ec59> 20699\n<ec5a> <ec5a> 9740\nendcidrange\n\n100 begincidrange\n<ec5b> <ec5b> 20702\n<ec5c> <ec5c> 9742\n<ec5d> <ec5f> 20703\n<ec60> <ec60> 8242\n<ec61> <ec6d> 20706\n<ec6e> <ec6e> 9739\n<ec6f> <ec75> 20719\n<ec76> <ec76> 8899\n<ec77> <ec7e> 20726\n<ec80> <ec95> 20734\n<ec96> <ec96> 7971\n<ec97> <eca0> 20756\n<eca1> <ecfe> 6575\n<ed40> <ed45> 20766\n<ed46> <ed46> 9877\n<ed47> <ed57> 20772\n<ed58> <ed58> 9822\n<ed59> <ed5d> 20789\n<ed5e> <ed5e> 9821\n<ed5f> <ed60> 20794\n<ed61> <ed61> 9874\n<ed62> <ed63> 20796\n<ed64> <ed64> 9823\n<ed65> <ed65> 20798\n<ed66> <ed66> 8589\n<ed67> <ed67> 8445\n<ed68> <ed6d> 20799\n<ed6e> <ed6e> 8000\n<ed6f> <ed73> 20805\n<ed74> <ed74> 9317\n<ed75> <ed76> 20810\n<ed77> <ed77> 9319\n<ed78> <ed78> 20812\n<ed79> <ed79> 9318\n<ed7a> <ed7e> 20813\n<ed80> <ed90> 20818\n<ed91> <ed91> 8649\n<ed92> <ed92> 20835\n<ed93> <ed93> 8713\n<ed94> <ed94> 7881\n<ed95> <ed95> 8425\n<ed96> <ed96> 20836\n<ed97> <ed97> 8650\n<ed98> <ed98> 8518\n<ed99> <ed99> 9669\n<ed9a> <ed9a> 8668\n<ed9b> <ed9b> 20837\n<ed9c> <ed9c> 9310\n<ed9d> <ed9d> 20838\n<ed9e> <ed9e> 8527\n<ed9f> <ed9f> 20839\n<eda0> <eda0> 9670\n<eda1> <edfe> 6669\n<ee40> <ee40> 9671\n<ee41> <ee41> 8769\n<ee42> <ee42> 8586\n<ee43> <ee43> 7727\n<ee44> <ee44> 7900\n<ee45> <ee47> 20840\n<ee48> <ee48> 8383\n<ee49> <ee49> 8244\n<ee4a> <ee4c> 20843\n<ee4d> <ee4d> 9673\n<ee4e> <ee51> 20846\n<ee52> <ee52> 9672\n<ee53> <ee54> 20850\n<ee55> <ee55> 8718\n<ee56> <ee56> 20852\n<ee57> <ee57> 9675\n<ee58> <ee5d> 20853\n<ee5e> <ee5e> 8573\n<ee5f> <ee60> 20859\n<ee61> <ee61> 8062\n<ee62> <ee67> 20861\n<ee68> <ee68> 9676\n<ee69> <ee69> 8131\n<ee6a> <ee6b> 20867\n<ee6c> <ee6c> 8377\n<ee6d> <ee6d> 20869\n<ee6e> <ee6e> 8577\n<ee6f> <ee76> 20870\n<ee77> <ee77> 8154\n<ee78> <ee7c> 20878\n<ee7d> <ee7d> 8563\n<ee7e> <ee7e> 7905\n<ee80> <ee80> 9677\n<ee81> <ee84> 20883\n<ee85> <ee85> 9678\n<ee86> <ee86> 8694\n<ee87> <ee89> 20887\n<ee8a> <ee8a> 8779\n<ee8b> <ee8b> 9681\n<ee8c> <ee8c> 20890\n<ee8d> <ee8d> 7872\n<ee8e> <ee8f> 20891\n<ee90> <ee90> 8200\n<ee91> <ee93> 20893\n<ee94> <ee94> 9680\n<ee95> <ee96> 20896\n<ee97> <ee97> 9682\nendcidrange\n\n100 begincidrange\n<ee98> <ee98> 20898\n<ee99> <ee99> 7978\n<ee9a> <ee9c> 20899\n<ee9d> <ee9d> 7794\n<ee9e> <ee9e> 9683\n<ee9f> <eea0> 20902\n<eea1> <eefe> 6763\n<ef40> <ef40> 8638\n<ef41> <ef41> 9684\n<ef42> <ef42> 8260\n<ef43> <ef43> 20904\n<ef44> <ef44> 9679\n<ef45> <ef45> 8435\n<ef46> <ef4b> 20905\n<ef4c> <ef4c> 7936\n<ef4d> <ef51> 20911\n<ef52> <ef53> 9420\n<ef54> <ef54> 20916\n<ef55> <ef55> 9880\n<ef56> <ef56> 20917\n<ef57> <ef57> 9848\n<ef58> <ef59> 20918\n<ef5a> <ef5a> 9422\n<ef5b> <ef5f> 20920\n<ef60> <ef60> 9423\n<ef61> <ef67> 20925\n<ef68> <ef68> 8376\n<ef69> <ef69> 20932\n<ef6a> <ef6a> 9424\n<ef6b> <ef6b> 20933\n<ef6c> <ef6c> 9425\n<ef6d> <ef76> 20934\n<ef77> <ef77> 7924\n<ef78> <ef79> 20944\n<ef7a> <ef7a> 9115\n<ef7b> <ef7b> 20946\n<ef7c> <ef7c> 9854\n<ef7d> <ef7e> 20947\n<ef80> <ef81> 20949\n<ef82> <ef82> 9117\n<ef83> <ef84> 9119\n<ef85> <ef85> 20951\n<ef86> <ef86> 9121\n<ef87> <ef87> 20952\n<ef88> <ef88> 7921\n<ef89> <ef8a> 20953\n<ef8b> <ef8b> 8734\n<ef8c> <ef8c> 20955\n<ef8d> <ef8d> 9122\n<ef8e> <ef94> 20956\n<ef95> <ef95> 8523\n<ef96> <ef96> 7734\n<ef97> <ef97> 8501\n<ef98> <ef9b> 20963\n<ef9c> <ef9c> 8109\n<ef9d> <ef9d> 20967\n<ef9e> <ef9e> 7763\n<ef9f> <efa0> 20968\n<efa1> <effe> 6857\n<f040> <f040> 20970\n<f041> <f041> 9123\n<f042> <f042> 8707\n<f043> <f043> 20971\n<f044> <f044> 7911\n<f045> <f046> 20972\n<f047> <f047> 9124\n<f048> <f048> 8343\n<f049> <f049> 7908\n<f04a> <f04d> 20974\n<f04e> <f04e> 8760\n<f04f> <f050> 20978\n<f051> <f051> 9125\n<f052> <f053> 20980\n<f054> <f054> 8090\n<f055> <f056> 20982\n<f057> <f057> 8643\n<f058> <f05d> 20984\n<f05e> <f05e> 7982\n<f05f> <f067> 20990\n<f068> <f068> 9116\n<f069> <f06b> 20999\n<f06c> <f06c> 9126\n<f06d> <f070> 21002\n<f071> <f071> 9118\n<f072> <f072> 21006\n<f073> <f073> 8245\n<f074> <f074> 9127\n<f075> <f077> 21007\n<f078> <f078> 9128\n<f079> <f079> 21010\n<f07a> <f07a> 8309\n<f07b> <f07c> 21011\n<f07d> <f07e> 9129\n<f080> <f080> 9131\n<f081> <f081> 8171\n<f082> <f082> 9132\n<f083> <f086> 21013\n<f087> <f087> 8042\n<f088> <f088> 8441\n<f089> <f08a> 21017\nendcidrange\n\n100 begincidrange\n<f08b> <f08b> 9830\n<f08c> <f08f> 21019\n<f090> <f090> 9831\n<f091> <f091> 21023\n<f092> <f092> 7788\n<f093> <f095> 21024\n<f096> <f096> 9133\n<f097> <f0a0> 21027\n<f0a1> <f0fe> 6951\n<f140> <f151> 21037\n<f152> <f152> 8301\n<f153> <f153> 8770\n<f154> <f154> 7938\n<f155> <f156> 21055\n<f157> <f157> 8579\n<f158> <f158> 21057\n<f159> <f159> 7813\n<f15a> <f15a> 8681\n<f15b> <f166> 21058\n<f167> <f167> 7767\n<f168> <f175> 21070\n<f176> <f176> 8869\n<f177> <f177> 9223\n<f178> <f178> 8138\n<f179> <f179> 21084\n<f17a> <f17a> 9218\n<f17b> <f17b> 8066\n<f17c> <f17d> 21085\n<f17e> <f17e> 9224\n<f180> <f180> 9220\n<f181> <f181> 21087\n<f182> <f182> 8497\n<f183> <f183> 21088\n<f184> <f184> 8580\n<f185> <f185> 21089\n<f186> <f186> 9219\n<f187> <f187> 21090\n<f188> <f188> 8302\n<f189> <f189> 9227\n<f18a> <f193> 21091\n<f194> <f194> 7999\n<f195> <f197> 21101\n<f198> <f198> 8295\n<f199> <f1a0> 21104\n<f1a1> <f1fe> 7045\n<f240> <f244> 21112\n<f245> <f245> 8151\n<f246> <f246> 21117\n<f247> <f247> 7811\n<f248> <f24a> 21118\n<f24b> <f24b> 9231\n<f24c> <f252> 21121\n<f253> <f253> 9230\n<f254> <f254> 8391\n<f255> <f255> 9229\n<f256> <f25b> 21128\n<f25c> <f25c> 9234\n<f25d> <f25e> 21134\n<f25f> <f25f> 8375\n<f260> <f270> 21136\n<f271> <f271> 9200\n<f272> <f272> 21153\n<f273> <f273> 9233\n<f274> <f274> 9236\n<f275> <f275> 21154\n<f276> <f276> 8560\n<f277> <f27b> 21155\n<f27c> <f27c> 9221\n<f27d> <f27d> 8460\n<f27e> <f27e> 9237\n<f280> <f284> 21160\n<f285> <f285> 8294\n<f286> <f286> 21165\n<f287> <f287> 9042\n<f288> <f288> 9235\n<f289> <f289> 9232\n<f28a> <f28b> 9238\n<f28c> <f28c> 8433\n<f28d> <f290> 21166\n<f291> <f291> 9226\n<f292> <f293> 21170\n<f294> <f294> 9225\n<f295> <f295> 21172\n<f296> <f296> 9240\n<f297> <f29b> 21173\n<f29c> <f29c> 8103\n<f29d> <f29d> 21178\n<f29e> <f29e> 8700\n<f29f> <f2a0> 21179\n<f2a1> <f2fe> 7139\n<f340> <f340> 8129\n<f341> <f341> 9222\n<f342> <f344> 21181\n<f345> <f345> 8860\n<f346> <f347> 21184\n<f348> <f348> 8270\n<f349> <f349> 21186\n<f34a> <f34a> 9242\n<f34b> <f34b> 9241\n<f34c> <f34f> 21187\nendcidrange\n\n100 begincidrange\n<f350> <f350> 9228\n<f351> <f360> 21191\n<f361> <f361> 7721\n<f362> <f373> 21207\n<f374> <f374> 9825\n<f375> <f375> 21225\n<f376> <f376> 9892\n<f377> <f377> 8564\n<f378> <f378> 9827\n<f379> <f379> 9826\n<f37a> <f37e> 21226\n<f380> <f38b> 21231\n<f38c> <f38c> 9845\n<f38d> <f39f> 21243\n<f3a0> <f3a0> 8524\n<f3a1> <f3fe> 7233\n<f440> <f444> 21262\n<f445> <f445> 9850\n<f446> <f44f> 21267\n<f450> <f450> 9888\n<f451> <f456> 21277\n<f457> <f457> 9832\n<f458> <f458> 21283\n<f459> <f459> 7888\n<f45a> <f45a> 21284\n<f45b> <f45b> 8342\n<f45c> <f45c> 21285\n<f45d> <f45d> 9164\n<f45e> <f461> 21286\n<f462> <f462> 9160\n<f463> <f463> 21290\n<f464> <f464> 8766\n<f465> <f474> 21291\n<f475> <f475> 9829\n<f476> <f47b> 21307\n<f47c> <f47c> 9828\n<f47d> <f47d> 21313\n<f47e> <f47e> 8761\n<f480> <f493> 21314\n<f494> <f494> 8266\n<f495> <f498> 21334\n<f499> <f499> 9759\n<f49a> <f49b> 21338\n<f49c> <f49c> 9758\n<f49d> <f4a0> 21340\n<f4a1> <f4fe> 7327\n<f540> <f544> 21344\n<f545> <f545> 9760\n<f546> <f546> 21349\n<f547> <f547> 9761\n<f548> <f551> 21350\n<f552> <f552> 9762\n<f553> <f553> 21360\n<f554> <f554> 9767\n<f555> <f555> 7737\n<f556> <f556> 9765\n<f557> <f55d> 21361\n<f55e> <f55e> 9769\n<f55f> <f560> 21368\n<f561> <f561> 9774\n<f562> <f562> 9771\n<f563> <f56d> 21370\n<f56e> <f56e> 9770\n<f56f> <f56f> 9773\n<f570> <f570> 21381\n<f571> <f571> 9768\n<f572> <f572> 8633\n<f573> <f57e> 21382\n<f580> <f584> 21394\n<f585> <f585> 9782\n<f586> <f586> 9776\n<f587> <f58b> 21399\n<f58c> <f58c> 9784\n<f58d> <f58d> 21404\n<f58e> <f58e> 8205\n<f58f> <f58f> 9783\n<f590> <f598> 21405\n<f599> <f599> 9797\n<f59a> <f59a> 21414\n<f59b> <f59b> 9786\n<f59c> <f59f> 21415\n<f5a0> <f5a0> 9795\n<f5a1> <f5fe> 7421\n<f640> <f640> 21419\n<f641> <f641> 9792\n<f642> <f644> 21420\n<f645> <f645> 9789\n<f646> <f646> 9793\n<f647> <f647> 21423\n<f648> <f648> 9790\n<f649> <f64a> 21424\n<f64b> <f64b> 9791\n<f64c> <f64c> 8128\n<f64d> <f64d> 21426\n<f64e> <f64f> 9787\n<f650> <f653> 21427\n<f654> <f654> 9794\n<f655> <f657> 21431\n<f658> <f658> 9796\n<f659> <f660> 21434\nendcidrange\n\n100 begincidrange\n<f661> <f661> 9785\n<f662> <f662> 21442\n<f663> <f663> 9804\n<f664> <f66b> 21443\n<f66c> <f66c> 9799\n<f66d> <f66d> 9803\n<f66e> <f670> 21451\n<f671> <f671> 9801\n<f672> <f673> 21454\n<f674> <f674> 9800\n<f675> <f675> 21456\n<f676> <f676> 9802\n<f677> <f677> 8456\n<f678> <f67e> 21457\n<f680> <f684> 21464\n<f685> <f685> 9805\n<f686> <f687> 21469\n<f688> <f688> 9780\n<f689> <f689> 21471\n<f68a> <f68a> 9809\n<f68b> <f68c> 21472\n<f68d> <f68d> 9808\n<f68e> <f68e> 9810\n<f68f> <f691> 21474\n<f692> <f692> 9807\n<f693> <f695> 21477\n<f696> <f696> 9778\n<f697> <f697> 9806\n<f698> <f698> 9811\n<f699> <f699> 21480\n<f69a> <f69a> 9815\n<f69b> <f69b> 21481\n<f69c> <f69c> 9781\n<f69d> <f69d> 21482\n<f69e> <f69e> 9779\n<f69f> <f69f> 21483\n<f6a0> <f6a0> 9814\n<f6a1> <f6fe> 7515\n<f740> <f741> 21484\n<f742> <f742> 9812\n<f743> <f748> 21486\n<f749> <f749> 9816\n<f74a> <f74b> 21492\n<f74c> <f74c> 9813\n<f74d> <f74d> 7757\n<f74e> <f755> 21494\n<f756> <f756> 9819\n<f757> <f757> 21502\n<f758> <f758> 9818\n<f759> <f759> 21503\n<f75a> <f75a> 9817\n<f75b> <f75b> 8238\n<f75c> <f75c> 9775\n<f75d> <f760> 21504\n<f761> <f761> 9798\n<f762> <f762> 21508\n<f763> <f763> 9766\n<f764> <f76a> 21509\n<f76b> <f76b> 9820\n<f76c> <f770> 21516\n<f771> <f771> 9772\n<f772> <f77b> 21521\n<f77c> <f77c> 9763\n<f77d> <f77d> 21531\n<f77e> <f77e> 9777\n<f780> <f7a0> 21532\n<f7a1> <f7fe> 7609\n<f840> <f841> 21565\n<f842> <f842> 8348\n<f843> <f845> 21567\n<f846> <f846> 9600\n<f847> <f848> 21570\n<f849> <f849> 8924\n<f84a> <f84f> 21572\n<f850> <f850> 7941\n<f851> <f851> 8331\n<f852> <f852> 21578\n<f853> <f853> 9601\n<f854> <f862> 21579\n<f863> <f863> 9603\n<f864> <f864> 9602\n<f865> <f865> 21594\n<f866> <f866> 8686\n<f867> <f871> 21595\n<f872> <f872> 8578\n<f873> <f877> 21606\n<f878> <f878> 8771\n<f879> <f879> 21611\n<f87a> <f87a> 9607\n<f87b> <f87b> 21612\n<f87c> <f87c> 9608\n<f87d> <f87e> 21613\n<f880> <f880> 21615\n<f881> <f881> 9604\n<f882> <f883> 21616\n<f884> <f884> 8701\n<f885> <f885> 21618\n<f886> <f886> 8687\n<f887> <f88c> 21619\n<f88d> <f88d> 9610\nendcidrange\n\n100 begincidrange\n<f88e> <f88e> 9612\n<f88f> <f898> 21625\n<f899> <f899> 8007\n<f89a> <f89c> 21635\n<f89d> <f89d> 7965\n<f89e> <f89f> 21638\n<f8a0> <f8a0> 9613\n<f940> <f94d> 21640\n<f94e> <f94e> 8144\n<f94f> <f94f> 9618\n<f950> <f950> 9615\n<f951> <f958> 21654\n<f959> <f959> 9620\n<f95a> <f95a> 7904\n<f95b> <f95c> 21662\n<f95d> <f95d> 9617\n<f95e> <f95e> 9621\n<f95f> <f966> 21664\n<f967> <f967> 9623\n<f968> <f968> 21672\n<f969> <f969> 8374\n<f96a> <f96b> 21673\n<f96c> <f96c> 9624\n<f96d> <f96e> 21675\n<f96f> <f96f> 8438\n<f970> <f97e> 21677\n<f980> <f984> 21692\n<f985> <f985> 9605\n<f986> <f986> 21697\n<f987> <f987> 9625\n<f988> <f990> 21698\n<f991> <f991> 9622\n<f992> <f995> 21707\n<f996> <f996> 9626\n<f997> <f997> 21711\n<f998> <f998> 9627\n<f999> <f9a0> 21712\n<fa40> <fa41> 21720\n<fa42> <fa42> 9629\n<fa43> <fa45> 21722\n<fa46> <fa46> 9630\n<fa47> <fa4b> 21725\n<fa4c> <fa4c> 9036\n<fa4d> <fa50> 21730\n<fa51> <fa51> 8004\n<fa52> <fa57> 21734\n<fa58> <fa58> 9824\n<fa59> <fa59> 9632\n<fa5a> <fa5c> 21740\n<fa5d> <fa5d> 9628\n<fa5e> <fa5e> 21743\n<fa5f> <fa5f> 9631\n<fa60> <fa60> 21744\n<fa61> <fa61> 8044\n<fa62> <fa6f> 21745\n<fa70> <fa70> 9634\n<fa71> <fa73> 21759\n<fa74> <fa74> 8366\n<fa75> <fa75> 21762\n<fa76> <fa76> 9611\n<fa77> <fa77> 9635\n<fa78> <fa7e> 21763\n<fa80> <fa82> 21770\n<fa83> <fa83> 9609\n<fa84> <fa84> 9637\n<fa85> <fa8c> 21773\n<fa8d> <fa8d> 9636\n<fa8e> <fa8f> 21781\n<fa90> <fa90> 9638\n<fa91> <fa91> 9619\n<fa92> <fa95> 21783\n<fa96> <fa96> 9639\n<fa97> <fa97> 8738\n<fa98> <fa98> 9641\n<fa99> <faa0> 21787\n<fb40> <fb48> 21795\n<fb49> <fb49> 9640\n<fb4a> <fb51> 21804\n<fb52> <fb52> 9606\n<fb53> <fb56> 21812\n<fb57> <fb57> 9633\n<fb58> <fb58> 9642\n<fb59> <fb59> 21816\n<fb5a> <fb5a> 9616\n<fb5b> <fb5b> 9614\n<fb5c> <fb74> 21817\n<fb75> <fb75> 9864\n<fb76> <fb78> 21842\n<fb79> <fb79> 9886\n<fb7a> <fb7a> 9723\n<fb7b> <fb7b> 21845\n<fb7c> <fb7c> 8076\n<fb7d> <fb7d> 8692\n<fb7e> <fb7e> 21846\n<fb80> <fb8f> 21847\n<fb90> <fb90> 8207\n<fb91> <fb9b> 21863\n<fb9c> <fb9c> 8305\n<fb9d> <fb9e> 21874\n<fb9f> <fb9f> 9719\nendcidrange\n\n71 begincidrange\n<fba0> <fba0> 21876\n<fc40> <fc43> 21877\n<fc44> <fc44> 9878\n<fc45> <fc48> 21881\n<fc49> <fc49> 9871\n<fc4a> <fc59> 21885\n<fc5a> <fc5a> 8922\n<fc5b> <fc62> 21901\n<fc63> <fc63> 7873\n<fc64> <fc67> 21909\n<fc68> <fc68> 7859\n<fc69> <fc6e> 21913\n<fc6f> <fc6f> 9834\n<fc70> <fc70> 21919\n<fc71> <fc71> 9866\n<fc72> <fc73> 21920\n<fc74> <fc74> 9833\n<fc75> <fc76> 21922\n<fc77> <fc78> 9752\n<fc79> <fc7e> 21924\n<fc80> <fc82> 21930\n<fc83> <fc83> 9754\n<fc84> <fc89> 21933\n<fc8a> <fc8a> 9843\n<fc8b> <fca0> 21939\n<fd40> <fd51> 21961\n<fd52> <fd52> 8390\n<fd53> <fd53> 8811\n<fd54> <fd56> 21979\n<fd57> <fd57> 9427\n<fd58> <fd58> 7814\n<fd59> <fd59> 21982\n<fd5a> <fd5a> 9743\n<fd5b> <fd5e> 21983\n<fd5f> <fd5f> 9745\n<fd60> <fd61> 21987\n<fd62> <fd62> 9747\n<fd63> <fd64> 21989\n<fd65> <fd65> 9744\n<fd66> <fd66> 9746\n<fd67> <fd67> 8240\n<fd68> <fd68> 21991\n<fd69> <fd69> 9841\n<fd6a> <fd6b> 21992\n<fd6c> <fd6c> 9748\n<fd6d> <fd6f> 21994\n<fd70> <fd70> 9750\n<fd71> <fd71> 21997\n<fd72> <fd72> 9749\n<fd73> <fd77> 21998\n<fd78> <fd78> 8434\n<fd79> <fd7c> 22003\n<fd7d> <fd7d> 9751\n<fd7e> <fd7e> 22007\n<fd80> <fd87> 22008\n<fd88> <fd88> 8247\n<fd89> <fd8a> 22016\n<fd8b> <fd8b> 8371\n<fd8c> <fd8e> 22018\n<fd8f> <fd8f> 7970\n<fd90> <fd90> 9453\n<fd91> <fd93> 22021\n<fd94> <fd94> 7988\n<fd95> <fd9c> 22024\n<fd9d> <fd9d> 2562\n<fd9e> <fd9e> 16595\n<fd9f> <fd9f> 8204\n<fda0> <fda0> 20611\n<fe40> <fe40> 4697\n<fe41> <fe7e> 22032\n<fe80> <fea0> 22094\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/GBK-EUC-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (GBK-EUC-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (GBK-EUC-H)\n%%BeginResource: CMap (GBK-EUC-V)\n%%Title: (GBK-EUC-V Adobe GB1 2)\n%%Version: 12.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/GBK-EUC-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 2 def\nend def\n\n/CMapName /GBK-EUC-V def\n/CMapVersion 12.002 def\n/CMapType 1 def\n\n/XUID [1 10 25378] def\n\n/WMode 1 def\n\n20 begincidrange\n<a1a2> <a1a2>  575\n<a1a3> <a1a3>  574\n<a1aa> <a1aa>  598\n<a1ab> <a1ac> 7704\n<a1ad> <a1ad>  599\n<a1b2> <a1bf>  582\n<a1fe> <a1fe> 7706\n<a3a1> <a3a1>  578\n<a3a8> <a3a9>  580\n<a3ac> <a3ac>  573\n<a3ae> <a3ae> 7707\n<a3ba> <a3bb>  576\n<a3bd> <a3bd> 7708\n<a3bf> <a3bf>  579\n<a3db> <a3db> 7709\n<a3dd> <a3dd> 7710\n<a3df> <a3df>  600\n<a3fb> <a3fb>  596\n<a3fd> <a3fd>  597\n<a3fe> <a3fe> 7711\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/GBK2K-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (GBK2K-H)\n%%Title: (GBK2K-H Adobe GB1 5)\n%%Version: 1.005\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 5 def\nend def\n\n/CMapName /GBK2K-H def\n/CMapVersion 1.005 def\n/CMapType 1 def\n\n/XUID [1 10 25459] def\n\n/WMode 0 def\n\n3 begincodespacerange\n  <00>       <7F>\n  <81308130> <FE39FE39>\n  <8140>     <FEFE>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 1\nendnotdefrange\n\n100 begincidchar\n<81308436> 22354\n<81398139> 22448\n<81398b32> 4162\n<81398b33> 4707\n<81398b34> 4722\n<81398b35> 4709\n<81398b36> 4185\n<81398b37> 10131\n<81398b38> 1597\n<81398b39> 4867\n<81398c30> 3238\n<81398c31> 1592\n<81398c32> 3270\n<81398c33> 982\n<81398c34> 4765\n<81398c35> 4884\n<81398c36> 4879\n<81398c37> 2091\n<81398c38> 5017\n<81398c39> 1431\n<81398d30> 2543\n<81398d31> 4860\n<81398d32> 4710\n<81398d33> 4740\n<81398d34> 10778\n<81398d35> 3397\n<81398d36> 1150\n<81398d37> 4946\n<81398d38> 1228\n<81398d39> 5020\n<81398e30> 4283\n<81398e31> 2407\n<81398e32> 5523\n<81398e33> 3698\n<81398e34> 3414\n<81398e35> 5660\n<81398e36> 11565\n<81398e37> 3859\n<81398e38> 1398\n<81398e39> 2927\n<81398f30> 4656\n<81398f31> 5934\n<81398f32> 1386\n<81398f33> 3948\n<81398f34> 5302\n<81398f35> 3395\n<81398f36> 6004\n<81398f37> 3318\n<81398f38> 6165\n<81398f39> 1789\n<81399030> 2093\n<81399031> 2238\n<81399032> 1732\n<81399033> 6163\n<81399034> 1852\n<81399035> 5016\n<81399036> 5293\n<81399037> 5366\n<81399038> 1798\n<81399039> 5986\n<81399130> 5614\n<81399131> 5600\n<81399132> 3983\n<81399133> 1765\n<81399134> 12946\n<81399135> 3437\n<81399136> 4518\n<81399137> 6409\n<81399138> 3795\n<81399139> 1526\n<81399230> 2240\n<81399231> 1626\n<81399232> 3821\n<81399233> 3248\n<81399234> 4350\n<81399235> 4357\n<81399236> 2849\n<81399237> 3124\n<81399238> 4536\n<81399239> 1400\n<81399330> 6589\n<81399331> 3826\n<81399332> 1073\n<81399333> 2736\n<81399334> 3430\n<81399335> 3095\n<81399336> 3491\n<81399337> 2053\n<81399338> 4611\n<81399339> 1715\n<81399430> 4713\n<81399431> 5789\n<81399432> 3019\n<81399433> 4073\n<81399434> 2916\n<81399435> 3209\n<81399436> 4041\n<81399437> 4310\n<81399438> 1832\n<81399439> 3728\nendcidchar\n\n100 begincidchar\n<81399530> 1733\n<81399531> 3379\n<81399532> 4264\n<81399533> 3650\n<81399534> 7110\n<81399535> 7008\n<81399536> 16063\n<81399537> 994\n<81399538> 3011\n<81399539> 2808\n<81399630> 2850\n<81399631> 2737\n<81399632> 3407\n<81399633> 3398\n<81399634> 3413\n<81399635> 16587\n<81399636> 1923\n<81399637> 4049\n<81399638> 2539\n<81399639> 4592\n<81399730> 2780\n<81399731> 7399\n<81399732> 7262\n<81399733> 3753\n<81399734> 4123\n<81399735> 4309\n<81399736> 2490\n<81399737> 1591\n<81399738> 7115\n<81399739> 1593\n<81399830> 6686\n<81399831> 3261\n<81399832> 1249\n<81399833> 4657\n<81399834> 4544\n<81399835> 2297\n<81399836> 3353\n<81399837> 5656\n<81399838> 4570\n<81399839> 7388\n<81399930> 3300\n<81399931> 17826\n<81399932> 7152\n<81399933> 1291\n<81399934> 4051\n<81399935> 3995\n<81399936> 4169\n<81399937> 18908\n<81399938> 8086\n<81399939> 2200\n<81399a30> 4093\n<81399a31> 1825\n<81399a32> 1528\n<81399a33> 7445\n<81399a34> 7504\n<81399a35> 7739\n<81399a36> 1285\n<81399a37> 4668\n<81399a38> 4672\n<81399a39> 3366\n<81399b30> 7803\n<81399b31> 3980\n<81399b32> 1250\n<81399b33> 19731\n<81399b34> 4191\n<81399b35> 4276\n<81399b36> 19992\n<81399b37> 2522\n<81399b38> 2241\n<81399b39> 7797\n<81399c30> 8317\n<81399c31> 1714\n<81399c32> 2542\n<81399c33> 7545\n<81399c34> 4303\n<81399c35> 20714\n<81399c36> 1636\n<81399c37> 2795\n<81399c38> 1770\n<81399c39> 8589\n<81399d30> 2289\n<81399d31> 4219\n<81399d32> 8713\n<81399d33> 7936\n<81399d34> 7924\n<81399d35> 3402\n<81399d36> 3438\n<81399d37> 3920\n<81399d38> 8301\n<81399d39> 1824\n<81399e30> 1754\n<81399e31> 7660\n<81399e32> 7888\n<81399e33> 5019\n<81399e34> 4704\n<81399e35> 1862\n<81399e36> 8761\n<81399e37> 8348\n<81399e38> 9864\n<81399e39> 2656\nendcidchar\n\n100 begincidchar\n<81399f30> 8305\n<81399f31> 2704\n<81399f32> 21894\n<81399f33> 3465\n<81399f34> 1937\n<81399f35> 6741\n<81399f36> 9752\n<81399f37> 1509\n<81399f38> 1821\n<81399f39> 3466\n<8139a030> 1072\n<8139a031> 8390\n<8139a032> 7814\n<8139a033> 8247\n<8139a034> 7988\n<8139a035> 4851\n<8139a630> 22400\n<8139a634> 22357\n<8139a636> 22375\n<8139a735> 22390\n<8139a736> 22392\n<8139a737> 22391\n<8139a738> 22393\n<8139ee39> 22529\n<8179> 8281\n<8186> 8689\n<81ed> 8178\n<81f6> 8285\n<8253> 9884\n<8262> 8629\n<8274> 8908\n<827a> 8214\n<827d> 7778\n<827e> 10315\n<8280> 7968\n<8283> 8319\n<8290> 8284\n<82a5> 8596\n<82c8> 7781\n<82c9> 8833\n<82e1> 8909\n<82e2> 10407\n<82e3> 8458\n<82e4> 7742\n<82ed> 9855\n<82f2> 8750\n<82f7> 7830\n<82f8> 8907\n<82f9> 8812\n<82fa> 10424\n<82fb> 8471\n<8340> 10428\n<8341> 8424\n<8345> 8916\n<8348> 8121\n<834c> 8920\n<8353> 8415\n<8357> 8386\n<835e> 8597\n<8365> 8108\n<8366> 8915\n<8372> 8065\n<8378> 8720\n<8379> 10474\n<837a> 8911\n<837b> 10475\n<837c> 8723\n<837d> 10476\n<837e> 8164\n<8380> 8080\n<8386> 8918\n<8389> 8912\n<838a> 8910\n<838d> 9857\n<8394> 7798\n<839e> 8753\n<83a6> 7827\n<83ab> 8914\n<83ae> 8919\n<83af> 8917\n<83b0> 8913\n<83ba> 7909\n<83c9> 8229\n<83f6> 7887\n<8450> 8153\n<8471> 8904\n<8474> 8803\n<8477> 9859\n<8482> 7959\n<848e> 7979\n<8492> 8906\n<8493> 7833\n<849d> 8015\n<84a1> 8143\n<84a2> 8246\n<84a3> 7994\n<84a4> 10676\n<84a5> 8905\n<84a6> 8089\n<84a9> 8053\nendcidchar\n\n100 begincidchar\n<84c5> 8126\n<84d3> 7885\n<84d4> 10719\n<84d5> 8617\n<84d6> 10720\n<84d7> 8678\n<84d8> 10721\n<84d9> 8487\n<84da> 8195\n<84dd> 8498\n<84ea> 8995\n<84ee> 8209\n<84f1> 8437\n<8551> 8901\n<8552> 8030\n<8553> 10771\n<8554> 8902\n<855e> 8431\n<8566> 8656\n<8587> 8897\n<858b> 7780\n<8592> 8697\n<8596> 8208\n<8597> 10831\n<8598> 8898\n<85a2> 7770\n<85b2> 7842\n<864a> 9069\n<8654> 8775\n<8668> 9068\n<8696> 8604\n<8699> 8393\n<86a1> 8688\n<86ca> 8459\n<86cb> 11063\n<86cc> 8414\n<86cd> 11064\n<86ce> 7850\n<86d1> 8748\n<86dc> 8408\n<86dd> 8896\n<86e1> 8303\n<86e8> 8609\n<86ee> 9081\n<86f4> 9074\n<8740> 8554\n<8744> 9084\n<8749> 8368\n<874a> 11113\n<874b> 9082\n<874c> 7796\n<874f> 9079\n<8757> 8012\n<875a> 9080\n<875b> 8655\n<875c> 9064\n<875d> 11125\n<875e> 9073\n<875f> 11126\n<8760> 9065\n<8766> 9844\n<877a> 9071\n<877d> 9072\n<877e> 11153\n<8780> 11154\n<8781> 9078\n<8782> 9075\n<8786> 9087\n<8787> 11158\n<8788> 9076\n<8789> 11159\n<878a> 8373\n<878d> 7899\n<878e> 9842\n<8793> 9070\n<8798> 8631\n<879d> 9077\n<87a3> 9090\n<87a7> 8350\n<87b3> 9067\n<87b4> 11193\n<87b5> 8249\n<87bb> 9887\n<87bf> 9085\n<87c0> 8693\n<87c1> 11202\n<87c2> 9089\n<87ca> 9083\n<87cb> 9086\n<87cc> 8652\n<87cf> 8923\n<87d2> 9066\n<87d3> 9865\n<87d4> 11214\n<87d5> 9879\n<87da> 8865\n<87f7> 9091\n<87f8> 7997\n<87f9> 11247\n<87fa> 8591\nendcidchar\n\n100 begincidchar\n<8840> 8774\n<8841> 8776\n<8844> 8574\n<8845> 11254\n<8846> 8576\n<88ba> 9002\n<88cc> 8843\n<88d4> 8069\n<88d7> 8997\n<88df> 9004\n<88e5> 9006\n<88f2> 8709\n<88f3> 7736\n<88f6> 7795\n<894b> 8163\n<894c> 9017\n<894d> 11440\n<894e> 9003\n<894f> 11441\n<8950> 9005\n<8954> 8575\n<895d> 8615\n<895e> 11453\n<895f> 9007\n<896d> 7805\n<8971> 8406\n<897c> 7874\n<898b> 8882\n<8999> 7903\n<899e> 7929\n<89a6> 8409\n<89a7> 11517\n<89a8> 8157\n<89af> 8551\n<89ba> 8685\n<89be> 8199\n<89bf> 8998\n<89c0> 9001\n<89c4> 8018\n<89c5> 8251\n<89c6> 9000\n<89c7> 11540\n<89c8> 8999\n<89ce> 7723\n<89d1> 8878\n<89d8> 8009\n<89db> 8504\n<89f4> 8321\n<8a40> 11590\n<8a41> 8060\n<8a59> 9051\n<8a5a> 7902\n<8a5b> 11614\n<8a5c> 8098\n<8a5d> 11615\n<8a5e> 7930\n<8a79> 8877\n<8ae4> 8255\n<8b44> 7950\n<8b49> 9209\n<8b7a> 9212\n<8b8c> 8297\n<8b9e> 9207\n<8bb3> 9206\n<8bb9> 9213\n<8bbe> 9208\n<8bc6> 9210\n<8bc7> 11898\n<8bc8> 9214\n<8bc9> 8104\n<8bd4> 9217\n<8bdc> 9215\n<8be5> 9216\n<8beb> 8737\n<8bf0> 8482\n<8c44> 9211\n<8c4f> 8538\n<8c57> 8677\n<8c5c> 8279\n<8c8b> 8421\n<8c8c> 12017\n<8c8d> 8495\n<8c8e> 8355\n<8c8f> 8481\n<8c90> 12018\n<8c91> 8660\n<8c92> 8165\n<8c99> 7818\n<8c9a> 7735\n<8ca2> 8094\n<8ca3> 8870\n<8ca4> 8680\n<8ca5> 12032\n<8ca6> 7898\n<8ca7> 7865\n<8cc0> 9052\n<8cd2> 8272\n<8cd3> 7783\n<8cd4> 12074\n<8cd5> 9204\nendcidchar\n\n100 begincidchar\n<8cd9> 8510\n<8cf9> 7958\n<8d73> 9097\n<8d74> 12165\n<8d75> 7863\n<8d7b> 8628\n<8d88> 9103\n<8d8f> 7962\n<8d9e> 9099\n<8db9> 9098\n<8de2> 9105\n<8de3> 12268\n<8de4> 8817\n<8de7> 9096\n<8df7> 9102\n<8dfe> 9101\n<8e46> 9100\n<8e56> 9104\n<8e57> 12313\n<8e58> 8243\n<8e59> 12314\n<8e5a> 8764\n<8e68> 8169\n<8e6e> 8277\n<8e6f> 12333\n<8e70> 9106\n<8e80> 8996\n<8e9b> 8515\n<8e9f> 8489\n<8ea4> 8823\n<8ea7> 7847\n<8eac> 8837\n<8ead> 12387\n<8eae> 9092\n<8ebd> 9095\n<8ebe> 9094\n<8ec3> 8848\n<8ec4> 12406\n<8ec5> 7748\n<8ecd> 7730\n<8ece> 9093\n<8ed6> 7955\n<8ed7> 8051\n<8eec> 8160\n<8f52> 8327\n<8f53> 7800\n<8f54> 9134\n<8f55> 7926\n<8f56> 7985\n<8f5d> 8261\n<8f64> 8568\n<8f86> 9205\n<8f87> 12521\n<8f88> 8821\n<8f95> 9838\n<8f96> 12534\n<8f97> 7856\n<8f9b> 8323\n<8f9c> 12538\n<8f9d> 8584\n<8fa1> 9852\n<8fbd> 8133\n<8fc4> 7841\n<8fc5> 12575\n<8fc6> 9107\n<8fcd> 7947\n<8fd8> 7804\n<909d> 9140\n<909e> 8318\n<90ba> 7907\n<90c0> 8341\n<90c1> 9147\n<90c5> 9145\n<90db> 7720\n<90dc> 9149\n<90ed> 9141\n<90f0> 9146\n<90f7> 9139\n<9142> 8546\n<914b> 7774\n<914c> 12819\n<914d> 7773\n<9151> 9143\n<9154> 7983\n<9155> 9439\n<9159> 9138\n<915a> 8526\n<915d> 8274\n<9161> 9148\n<9162> 12833\n<9163> 8427\n<916e> 8754\n<9176> 7743\n<917a> 8219\n<917b> 8380\n<917c> 9150\n<9184> 7854\n<918d> 7931\n<9191> 8329\n<9192> 12871\nendcidchar\n\n100 begincidchar\n<9193> 9137\n<9197> 8644\n<919b> 8724\n<91a9> 8158\n<91aa> 8739\n<91ab> 9142\n<91ba> 9868\n<91bb> 9438\n<91bf> 9440\n<91c3> 9144\n<91cd> 7809\n<91d0> 8190\n<91d1> 8017\n<91d2> 8673\n<91d3> 12922\n<91d4> 9136\n<91d5> 12923\n<91d6> 8142\n<91d7> 12924\n<91d8> 8478\n<91d9> 8225\n<91df> 9441\n<91e2> 9379\n<91ea> 9380\n<91f0> 8819\n<91f1> 12944\n<91f2> 8624\n<92b6> 8657\n<92ce> 8476\n<92cf> 13097\n<92d0> 9053\n<92d4> 9858\n<92df> 8461\n<92e0> 8282\n<92fe> 8077\n<9350> 8703\n<935d> 8024\n<9370> 8539\n<9376> 7862\n<938c> 8411\n<939d> 9056\n<93a5> 9057\n<93a6> 13234\n<93a7> 8256\n<93b4> 8846\n<93b8> 8159\n<93bb> 9054\n<93bc> 13252\n<93bd> 7786\n<93c6> 8194\n<93cf> 8339\n<93d7> 9055\n<93db> 7852\n<93dc> 7764\n<93e1> 7944\n<93e4> 8384\n<93e5> 9058\n<93e9> 8544\n<93ea> 13288\n<93eb> 8605\n<93ec> 8078\n<93ed> 8749\n<93ee> 13289\n<93ef> 8263\n<93f0> 13290\n<93f1> 8802\n<93f4> 8039\n<93f5> 7858\n<93fa> 7849\n<93fe> 8140\n<9444> 8050\n<944d> 8344\n<9450> 7762\n<9451> 8356\n<9452> 7964\n<9453> 8847\n<9454> 13314\n<9455> 8173\n<9458> 9061\n<945b> 7725\n<945c> 8530\n<945d> 9062\n<945e> 13319\n<945f> 8442\n<9464> 9059\n<9465> 13324\n<9466> 8346\n<946e> 8252\n<9472> 8182\n<9473> 13335\n<9474> 9060\n<9475> 13336\n<9476> 7785\n<9477> 13337\n<9478> 9063\n<9479> 13338\n<947a> 8477\n<9480> 8793\n<9481> 8278\n<9482> 8547\nendcidchar\n\n100 begincidchar\n<9487> 8105\n<9488> 8188\n<94a1> 7726\n<94b3> 7868\n<94b4> 13388\n<94b5> 8514\n<94bf> 8222\n<94c0> 7747\n<94cc> 9428\n<94d8> 8815\n<94e0> 7895\n<9572> 8493\n<9583> 8859\n<959e> 8790\n<959f> 9384\n<95b3> 7801\n<95ba> 8794\n<95cf> 9383\n<95d0> 13593\n<95d1> 9862\n<95d2> 9382\n<95d3> 13594\n<95d4> 8654\n<95e1> 9385\n<95e7> 8167\n<95f1> 8466\n<95f8> 8508\n<95fe> 8028\n<9656> 9412\n<967c> 7884\n<9767> 9322\n<976c> 8565\n<976d> 13863\n<976e> 9325\n<9796> 9323\n<9797> 8799\n<979d> 7886\n<97a3> 8818\n<97bf> 9331\n<97ee> 8702\n<97f7> 7934\n<9845> 9333\n<9849> 8714\n<984f> 8047\n<9871> 9320\n<9872> 14046\n<9873> 8448\n<9880> 14058\n<9881> 9334\n<988b> 7975\n<988c> 8407\n<98a0> 9340\n<98aa> 8097\n<98b6> 8874\n<98b7> 8197\n<98ba> 9324\n<98c7> 8254\n<98cb> 7756\n<98d0> 8506\n<98d3> 8708\n<98e3> 8387\n<98e4> 8512\n<98e5> 9335\n<98ef> 9332\n<98f2> 8413\n<9943> 8040\n<9944> 14171\n<9945> 8581\n<9966> 9330\n<996e> 7861\n<9975> 9336\n<997a> 8075\n<997b> 9348\n<9985> 9881\n<9989> 9346\n<998e> 8353\n<9991> 8082\n<9999> 7992\n<99a9> 9349\n<99b0> 9344\n<99b1> 9326\n<99b2> 14266\n<99b3> 9339\n<99b4> 9350\n<99b5> 9329\n<99bd> 9347\n<99be> 9328\n<99bf> 14274\n<99c0> 9321\n<99c1> 14275\n<99c2> 9343\n<99c9> 9327\n<99ce> 9345\n<99d1> 8736\n<99da> 8181\n<99e0> 8436\n<99e5> 9341\n<99e8> 9337\n<99ec> 9342\n<99f4> 9338\nendcidchar\n\n100 begincidchar\n<9a4a> 8419\n<9a57> 8365\n<9a65> 9419\n<9a66> 14362\n<9a67> 8019\n<9a71> 8537\n<9a76> 8211\n<9a77> 7987\n<9a88> 7772\n<9a8c> 9352\n<9a91> 9351\n<9a97> 9354\n<9a9a> 9353\n<9a9b> 9355\n<9a9e> 8067\n<9aa2> 8463\n<9aa3> 8155\n<9aaa> 8367\n<9ad0> 9408\n<9ad6> 8813\n<9ada> 9409\n<9ae2> 8394\n<9ae3> 14468\n<9ae4> 8423\n<9ae5> 9410\n<9bd1> 9180\n<9bdc> 9179\n<9c53> 8286\n<9c59> 8772\n<9c5a> 9186\n<9c5b> 14706\n<9c5c> 8404\n<9c75> 8607\n<9c79> 7782\n<9c86> 8035\n<9c9d> 9181\n<9cab> 8555\n<9cca> 8885\n<9ccf> 7974\n<9ce6> 7779\n<9ce7> 8328\n<9cec> 7869\n<9ced> 14840\n<9cee> 9025\n<9cfb> 8011\n<9cfe> 8850\n<9d42> 8484\n<9d46> 8264\n<9d47> 9184\n<9d4d> 8311\n<9d4e> 14865\n<9d4f> 8762\n<9d61> 8369\n<9d68> 8001\n<9d69> 8220\n<9d6e> 8888\n<9d71> 8822\n<9d75> 8091\n<9d7b> 8095\n<9d7c> 14903\n<9d7d> 9674\n<9d7e> 14904\n<9d8a> 8382\n<9d8d> 8116\n<9d91> 9175\n<9d99> 8453\n<9da1> 9185\n<9da2> 8172\n<9da7> 9194\n<9dac> 9187\n<9dad> 8462\n<9db2> 8102\n<9db3> 8196\n<9dbe> 8093\n<9dc6> 9189\n<9dc9> 8804\n<9dcd> 9442\n<9dd2> 9182\n<9dd5> 7876\n<9de1> 8886\n<9de2> 8361\n<9df1> 8491\n<9df4> 8357\n<9df7> 9867\n<9dfa> 8054\n<9dfd> 8557\n<9dfe> 15007\n<9e45> 8193\n<9e48> 8593\n<9e49> 7760\n<9e52> 8092\n<9e53> 15023\n<9e54> 9178\n<9e55> 15024\n<9e56> 8275\n<9e5d> 9193\n<9e5e> 9188\n<9e61> 8661\n<9e62> 15033\n<9e63> 9190\nendcidchar\n\n100 begincidchar\n<9e67> 9183\n<9e6c> 7759\n<9e6f> 9177\n<9e72> 8212\n<9e73> 15045\n<9e74> 9196\n<9e75> 9195\n<9e7b> 9176\n<9e7c> 9198\n<9e85> 9870\n<9e86> 15058\n<9e87> 9197\n<9e91> 8186\n<9e96> 9174\n<9e97> 9192\n<9ea2> 8454\n<9ea6> 8203\n<9ea9> 8550\n<9eae> 9199\n<9eb3> 8585\n<9eb4> 8280\n<9eb7> 9191\n<9ef5> 8611\n<9f4e> 8570\n<9f6f> 8613\n<9f92> 8226\n<9f98> 9430\n<9fa6> 9018\n<9fa9> 7918\n<9fac> 9429\n<9fc9> 8744\n<9fcd> 9431\n<9fe1> 8444\n<9feb> 7815\n<9fee> 9432\n<9ff4> 7866\n<9ffd> 8473\n<9ffe> 15342\n<a043> 8556\n<a046> 9433\n<a049> 8743\n<a04e> 7775\n<a054> 8863\n<a05a> 8029\n<a061> 8124\n<a062> 15370\n<a063> 9434\n<a071> 8521\n<a074> 8262\n<a080> 8192\n<a091> 8592\n<a094> 8712\n<a095> 15414\n<a096> 7910\n<a0a9> 9411\n<a0bf> 8396\n<a0ce> 9024\n<a0d9> 7889\n<a0de> 8620\n<a0ee> 8879\n<a2e3> 22353\n<a95c> 10018\n<a996> 7703\n<aa4d> 8630\n<aa4e> 7741\n<aa71> 8757\n<aa72> 15560\n<aa73> 9111\n<aa77> 9109\n<aa7a> 8767\n<aa7b> 8490\n<aa9a> 7890\n<aa9b> 15595\n<aa9c> 9110\n<aa9d> 9112\n<aa9e> 15596\n<aa9f> 8354\n<aaa0> 15597\n<ab40> 8036\n<ab43> 8235\n<ab44> 15600\n<ab45> 9108\n<ab46> 8505\n<ab47> 15601\n<ab48> 8543\n<ab49> 8641\n<ab4a> 9114\n<ab4d> 9113\n<ac46> 8640\n<ac71> 9312\n<ac7c> 9308\n<ac8d> 8541\n<ac93> 8741\n<ac94> 8298\n<ad49> 9313\n<ad5e> 9307\n<ad61> 9314\n<ad68> 8020\n<ad74> 9311\n<ad82> 8428\nendcidchar\n\n100 begincidchar\n<ad87> 9309\n<ad8b> 9315\n<ad91> 9316\n<ae54> 9381\n<ae62> 7792\n<ae80> 8335\n<ae85> 7746\n<ae8b> 8014\n<ae94> 7857\n<aea0> 7819\n<af64> 8134\n<af7b> 9646\n<af82> 7937\n<af83> 8704\n<af8e> 9650\n<af8f> 7831\n<af90> 16025\n<af91> 8363\n<af9c> 9651\n<af9f> 8232\n<afa0> 16038\n<b040> 16039\n<b043> 16040\n<b044> 9649\n<b04f> 9644\n<b054> 7758\n<b057> 8706\n<b058> 9643\n<b059> 8838\n<b05a> 16057\n<b05b> 9645\n<b05c> 16058\n<b05d> 9654\n<b05e> 16059\n<b05f> 8675\n<b062> 8751\n<b063> 8549\n<b064> 9655\n<b06c> 7913\n<b07d> 7717\n<b07e> 16083\n<b097> 9664\n<b098> 16107\n<b099> 8858\n<b14b> 8814\n<b14c> 16126\n<b14d> 8125\n<b14e> 16127\n<b14f> 8068\n<b150> 8370\n<b151> 16128\n<b152> 8259\n<b197> 9860\n<b240> 16205\n<b241> 9455\n<b267> 9454\n<b26d> 8308\n<b274> 9863\n<b280> 9456\n<b289> 9869\n<b29a> 8864\n<b343> 8107\n<b370> 9896\n<b388> 9449\n<b38c> 9445\n<b38d> 16366\n<b38e> 8698\n<b454> 8520\n<b458> 9444\n<b45e> 9446\n<b45f> 8439\n<b460> 16413\n<b461> 8299\n<b475> 8871\n<b47e> 9452\n<b483> 9451\n<b489> 9443\n<b493> 9450\n<b540> 16471\n<b541> 7826\n<b54b> 7719\n<b556> 8166\n<b55a> 9447\n<b55b> 8210\n<b55c> 7916\n<b561> 9448\n<b59c> 8038\n<b59d> 9436\n<b652> 9890\n<b655> 9437\n<b659> 8206\n<b65a> 16581\n<b65b> 9435\n<b65c> 7864\n<b74e> 8853\n<b751> 7808\n<b759> 9847\n<b764> 9764\n<b765> 8041\n<b766> 8747\nendcidchar\n\n100 begincidchar\n<b777> 9599\n<b778> 8027\n<b780> 8603\n<b781> 16704\n<b782> 9853\n<b843> 8608\n<b844> 8582\n<b845> 16738\n<b846> 8429\n<b84d> 9657\n<b851> 8170\n<b85a> 7844\n<b85b> 8417\n<b85c> 16756\n<b85d> 9656\n<b85e> 8800\n<b85f> 16757\n<b860> 8418\n<b877> 8513\n<b882> 8135\n<b950> 7745\n<b961> 9700\n<b97b> 8070\n<b99d> 8115\n<b9a0> 7919\n<ba42> 8868\n<ba43> 16912\n<ba44> 9704\n<ba56> 9699\n<ba59> 8465\n<ba60> 9702\n<ba6a> 9703\n<ba74> 8257\n<ba84> 9706\n<ba85> 16970\n<ba86> 8079\n<ba87> 16971\n<ba88> 9708\n<ba8d> 9707\n<ba9e> 8400\n<ba9f> 8221\n<baa0> 16992\n<bb40> 8183\n<bb49> 7821\n<bb58> 9705\n<bb5b> 9710\n<bb5c> 8250\n<bb60> 9875\n<bb65> 9701\n<bb66> 9709\n<bb67> 17024\n<bb68> 8201\n<bb69> 17025\n<bb6a> 8293\n<bb6e> 9891\n<bc52> 9717\n<bc53> 7932\n<bc5a> 8228\n<bc61> 9883\n<bc62> 17108\n<bc63> 9715\n<bc64> 17109\n<bc65> 8921\n<bc66> 17110\n<bc67> 9716\n<bc68> 17111\n<bc69> 9243\n<bc6d> 8136\n<bc6e> 17115\n<bc6f> 8059\n<bc70> 17116\n<bc71> 9245\n<bc72> 17117\n<bc73> 8780\n<bc74> 8008\n<bc75> 9244\n<bc78> 8447\n<bc79> 8602\n<bc7a> 17118\n<bc7b> 8337\n<bc7e> 8359\n<bc82> 9251\n<bc83> 7835\n<bc84> 9250\n<bc85> 17123\n<bc86> 8464\n<bc87> 17124\n<bc88> 8845\n<bc89> 8049\n<bc8a> 7928\n<bc8b> 9249\n<bc8f> 7923\n<bc9a> 8625\n<bc9b> 9254\n<bc9c> 9253\n<bc9d> 8480\n<bd42> 8474\n<bd43> 9252\n<bd44> 17143\n<bd45> 9256\nendcidchar\n\n100 begincidchar\n<bd48> 9258\n<bd49> 9257\n<bd4a> 17146\n<bd4b> 8852\n<bd4c> 17147\n<bd4d> 8894\n<bd4e> 17148\n<bd4f> 7729\n<bd57> 9260\n<bd58> 17156\n<bd59> 8117\n<bd66> 9259\n<bd67> 8111\n<bd6a> 8296\n<bd6b> 8676\n<bd6f> 7969\n<bd70> 17174\n<bd71> 8449\n<bd79> 8572\n<bd7a> 8522\n<bd7b> 9261\n<bd7e> 8148\n<bd80> 17184\n<bd81> 8145\n<bd89> 7731\n<bd8a> 17192\n<bd8b> 9263\n<bd8e> 9262\n<bd8f> 17195\n<bd90> 9264\n<bd91> 8667\n<bd97> 8536\n<bd9b> 8130\n<be43> 8889\n<be44> 17212\n<be45> 9270\n<be49> 7822\n<be4a> 9273\n<be51> 8645\n<be52> 9271\n<be53> 8594\n<be54> 17222\n<be55> 9274\n<be56> 7961\n<be57> 8588\n<be58> 7744\n<be59> 8883\n<be5d> 8287\n<be5e> 9272\n<be5f> 9266\n<be60> 8820\n<be61> 17226\n<be62> 7836\n<be63> 9265\n<be64> 8325\n<be69> 9269\n<be6c> 9275\n<be6f> 8119\n<be70> 9267\n<be76> 8276\n<be77> 8670\n<be78> 17240\n<be79> 9268\n<be7c> 9277\n<be7d> 8073\n<be7e> 9276\n<be83> 8046\n<be84> 7896\n<be85> 17246\n<be86> 7871\n<be87> 9285\n<be88> 17247\n<be89> 8777\n<be8c> 9281\n<be8d> 17250\n<be8e> 7751\n<be8f> 8022\n<be92> 8326\n<be95> 8598\n<be96> 17255\n<be97> 9283\n<be98> 9279\n<be99> 17256\n<be9a> 8227\n<be9b> 17257\n<be9c> 9282\n<be9f> 9278\n<bea0> 17260\n<bf40> 9894\n<bf4d> 9038\n<bf4e> 9286\n<bf4f> 9291\n<bf50> 9284\n<bf55> 9255\n<bf56> 9292\n<bf60> 7951\n<bf61> 17286\n<bf62> 9287\n<bf63> 9289\n<bf64> 9288\nendcidchar\n\n100 begincidchar\n<bf68> 8642\n<bf6c> 8558\n<bf70> 7939\n<bf71> 17296\n<bf72> 9290\n<bf73> 8540\n<bf76> 8891\n<bf77> 9296\n<bf78> 17299\n<bf79> 9876\n<bf7a> 9295\n<bf7b> 9718\n<bf7c> 8273\n<bf7d> 17300\n<bf7e> 9294\n<bf82> 8890\n<bf83> 8045\n<bf89> 9298\n<bf8a> 9297\n<bf95> 9301\n<bf96> 17318\n<bf97> 8841\n<bf98> 8470\n<bf9d> 9300\n<c040> 8443\n<c044> 9280\n<c04b> 8486\n<c04c> 8033\n<c04d> 9885\n<c04e> 17335\n<c04f> 8074\n<c050> 9302\n<c051> 9305\n<c052> 9304\n<c055> 8110\n<c05b> 8730\n<c05e> 8058\n<c05f> 9293\n<c060> 9303\n<c069> 9299\n<c06a> 17353\n<c06b> 9248\n<c06c> 17354\n<c06d> 8671\n<c06e> 9861\n<c06f> 17355\n<c070> 7790\n<c074> 8740\n<c075> 9840\n<c076> 17359\n<c077> 8634\n<c078> 17360\n<c079> 9306\n<c07c> 8191\n<c09b> 9698\n<c09c> 17392\n<c09d> 9882\n<c150> 7914\n<c154> 7724\n<c15f> 8290\n<c160> 9457\n<c161> 17425\n<c162> 9458\n<c175> 9714\n<c178> 8725\n<c195> 8622\n<c24e> 8416\n<c265> 9666\n<c266> 17520\n<c267> 9665\n<c27d> 8488\n<c27e> 17542\n<c284> 8601\n<c293> 8215\n<c294> 7840\n<c295> 8485\n<c296> 8525\n<c297> 17561\n<c298> 9668\n<c299> 8349\n<c29a> 8842\n<c29b> 17562\n<c29c> 9667\n<c2a0> 8569\n<c340> 8248\n<c343> 8533\n<c37b> 8658\n<c384> 9415\n<c39b> 8825\n<c449> 8483\n<c44c> 9413\n<c454> 9417\n<c458> 8340\n<c45b> 8854\n<c463> 7799\n<c477> 7942\n<c47a> 8101\n<c480> 17712\n<c481> 8345\n<c491> 7853\nendcidchar\n\n100 begincidchar\n<c492> 9416\n<c493> 8360\n<c498> 8223\n<c499> 17732\n<c49a> 8389\n<c49b> 17733\n<c49c> 9418\n<c544> 8176\n<c545> 17742\n<c546> 9414\n<c54b> 8797\n<c54c> 8926\n<c552> 8236\n<c55f> 8545\n<c563> 8763\n<c564> 8665\n<c565> 8139\n<c566> 8137\n<c593> 7777\n<c59c> 9711\n<c59d> 17818\n<c59e> 8088\n<c640> 17821\n<c641> 9712\n<c644> 8072\n<c647> 8696\n<c663> 8994\n<c672> 9014\n<c766> 8875\n<c76f> 8127\n<c776> 8061\n<c77b> 9011\n<c840> 18004\n<c841> 8013\n<c84f> 9012\n<c852> 8177\n<c866> 8587\n<c86e> 9033\n<c87e> 8715\n<c887> 9030\n<c892> 9031\n<c893> 18078\n<c894> 8595\n<c899> 9889\n<c89d> 8034\n<c94f> 9037\n<c950> 9032\n<c96e> 7776\n<c96f> 18133\n<c970> 9029\n<c977> 7954\n<c98f> 8216\n<c990> 9013\n<c99c> 9020\n<ca4e> 9839\n<ca56> 9041\n<ca59> 8096\n<ca5c> 9016\n<ca61> 8731\n<ca6e> 9026\n<ca72> 9039\n<ca77> 9021\n<ca7b> 9028\n<ca7c> 9009\n<ca7d> 18228\n<ca7e> 9035\n<ca80> 18229\n<ca81> 9019\n<ca89> 9040\n<ca8e> 7860\n<ca8f> 8614\n<ca92> 8651\n<ca9a> 9045\n<cb43> 9022\n<cb44> 18259\n<cb45> 8052\n<cb46> 18260\n<cb47> 9008\n<cb4b> 9856\n<cb4e> 8410\n<cb57> 9034\n<cb5d> 8081\n<cb5e> 18279\n<cb5f> 8455\n<cb6a> 9023\n<cb7b> 8180\n<cb7c> 9027\n<cb87> 8722\n<cb8e> 8711\n<cb92> 9049\n<cb9c> 8788\n<cb9d> 18333\n<cb9e> 9010\n<cc40> 7718\n<cc41> 9047\n<cc49> 9048\n<cc4a> 8258\n<cc4b> 8531\n<cc4f> 8379\n<cc5c> 9050\nendcidchar\n\n100 begincidchar\n<cc60> 9046\n<cc64> 9015\n<cc6d> 8185\n<cc79> 9043\n<cc7d> 8289\n<cc7e> 18386\n<cc8e> 7829\n<cc94> 8265\n<cc95> 18406\n<cc96> 8002\n<cc9d> 8168\n<cd90> 9690\n<cd98> 9687\n<ce67> 8494\n<ce72> 8626\n<ce80> 18571\n<ce81> 8606\n<ce87> 9692\n<ce9b> 8300\n<ce9e> 8742\n<cf4e> 9696\n<cf55> 8827\n<cf58> 9694\n<cf5c> 9697\n<cf6c> 9685\n<cf73> 7787\n<cf74> 18646\n<cf75> 9691\n<cf78> 7817\n<cf7c> 9689\n<cf80> 18654\n<cf81> 8721\n<cf89> 8745\n<cf8a> 9686\n<cf93> 9693\n<cf94> 9695\n<cf9e> 8175\n<cf9f> 18679\n<cfa0> 9688\n<d04d> 7977\n<d051> 7771\n<d055> 8310\n<d05c> 8855\n<d060> 9872\n<d067> 8511\n<d06c> 8600\n<d06d> 18718\n<d06e> 7816\n<d07d> 8844\n<d07e> 18733\n<d155> 9713\n<d159> 8204\n<d161> 7768\n<d162> 8876\n<d175> 9895\n<d17d> 9846\n<d17e> 18823\n<d19d> 8161\n<d19e> 9659\n<d240> 9662\n<d243> 8925\n<d24d> 9661\n<d25c> 7722\n<d263> 9660\n<d264> 9658\n<d268> 9663\n<d26d> 8583\n<d26e> 18893\n<d26f> 9835\n<d272> 7807\n<d275> 8621\n<d28a> 8086\n<d28e> 7986\n<d292> 8324\n<d295> 8502\n<d296> 18925\n<d297> 9400\n<d2a0> 9402\n<d344> 9404\n<d348> 8420\n<d349> 18941\n<d34a> 9401\n<d34d> 9405\n<d350> 9406\n<d355> 9407\n<d358> 8146\n<d35b> 8189\n<d35c> 18954\n<d35d> 9403\n<d35e> 7981\n<d378> 9737\n<d379> 18980\n<d37a> 9738\n<d37b> 18981\n<d37c> 7828\n<d385> 8927\n<d386> 7883\n<d387> 7949\n<d38b> 8055\n<d38c> 18992\nendcidchar\n\n100 begincidchar\n<d38d> 8683\n<d38e> 18993\n<d38f> 8929\n<d390> 18994\n<d391> 8559\n<d392> 18995\n<d393> 8928\n<d396> 8682\n<d397> 18998\n<d398> 8930\n<d399> 8395\n<d39a> 18999\n<d39b> 8056\n<d39e> 7906\n<d39f> 19002\n<d3a0> 8690\n<d440> 19003\n<d441> 8528\n<d445> 8147\n<d446> 19007\n<d447> 8933\n<d44c> 7922\n<d44f> 8479\n<d453> 8669\n<d456> 8532\n<d457> 19019\n<d458> 8935\n<d45c> 8834\n<d462> 8934\n<d467> 8936\n<d46e> 8932\n<d46f> 19038\n<d470> 8810\n<d471> 19039\n<d472> 8939\n<d473> 19040\n<d474> 8937\n<d475> 8381\n<d478> 8938\n<d47b> 8893\n<d47e> 7838\n<d482> 8950\n<d483> 8679\n<d484> 8726\n<d487> 8503\n<d48a> 8492\n<d48b> 19053\n<d48c> 7784\n<d48d> 8946\n<d48e> 7991\n<d48f> 8947\n<d490> 19054\n<d491> 8943\n<d492> 8016\n<d493> 7952\n<d494> 8648\n<d495> 19055\n<d496> 8945\n<d49c> 8944\n<d49f> 8942\n<d4a0> 19063\n<d543> 8941\n<d544> 8862\n<d545> 8940\n<d546> 8162\n<d54a> 8446\n<d550> 19073\n<d551> 7855\n<d554> 8758\n<d555> 19076\n<d556> 8951\n<d55a> 8765\n<d55b> 19080\n<d55c> 7810\n<d55d> 8118\n<d55e> 19081\n<d55f> 8612\n<d560> 8618\n<d561> 8952\n<d562> 8529\n<d563> 19082\n<d564> 8032\n<d568> 8519\n<d56c> 8517\n<d56d> 19089\n<d56e> 8156\n<d572> 8961\n<d575> 7925\n<d578> 8728\n<d57b> 7878\n<d57e> 8960\n<d580> 19101\n<d581> 8884\n<d584> 8553\n<d585> 19104\n<d586> 8957\n<d587> 19105\n<d588> 8426\n<d589> 19106\n<d58a> 8948\nendcidchar\n\n100 begincidchar\n<d58b> 19107\n<d58c> 8955\n<d58d> 19108\n<d58e> 8956\n<d58f> 8231\n<d593> 8288\n<d594> 8959\n<d598> 8958\n<d599> 7879\n<d59a> 19115\n<d59b> 8972\n<d59f> 8949\n<d5a0> 19119\n<d640> 8966\n<d641> 19120\n<d642> 8970\n<d643> 8659\n<d647> 8963\n<d648> 19124\n<d649> 8967\n<d64a> 8971\n<d64d> 8031\n<d64e> 19127\n<d64f> 8969\n<d652> 8962\n<d653> 7940\n<d654> 8861\n<d655> 19130\n<d656> 8699\n<d657> 19131\n<d658> 8968\n<d659> 19132\n<d65a> 8364\n<d65b> 19133\n<d65c> 8334\n<d65d> 8965\n<d65e> 8599\n<d65f> 19134\n<d660> 8561\n<d661> 8856\n<d665> 8023\n<d669> 8322\n<d66a> 19141\n<d66b> 8977\n<d66f> 8964\n<d670> 19145\n<d671> 8975\n<d672> 7733\n<d673> 19146\n<d674> 8401\n<d675> 8976\n<d676> 8099\n<d677> 19147\n<d678> 8662\n<d67c> 8710\n<d683> 8973\n<d686> 8978\n<d687> 8333\n<d688> 8979\n<d68e> 8931\n<d694> 8122\n<d699> 8312\n<d743> 8840\n<d748> 8982\n<d749> 8043\n<d750> 8980\n<d751> 19192\n<d752> 8496\n<d753> 8981\n<d754> 8552\n<d755> 19193\n<d756> 8388\n<d764> 8984\n<d767> 8729\n<d768> 8727\n<d76c> 8405\n<d76f> 8010\n<d775> 8768\n<d778> 7891\n<d783> 7753\n<d787> 9755\n<d78b> 7789\n<d78c> 8440\n<d78d> 19236\n<d78e> 8187\n<d78f> 8985\n<d795> 8974\n<d796> 19242\n<d797> 8983\n<d84d> 8392\n<d853> 7933\n<d890> 7739\n<d891> 8831\n<d892> 19329\n<d893> 7948\n<d894> 7769\n<d895> 7972\n<d89a> 8378\n<d89b> 8037\n<d89c> 7920\nendcidchar\n\n100 begincidchar\n<d89d> 8548\n<d89e> 7984\n<d89f> 8801\n<d8a0> 19334\n<d940> 19335\n<d941> 8866\n<d942> 9387\n<d943> 19336\n<d944> 9391\n<d945> 7912\n<d946> 7993\n<d947> 19337\n<d948> 7752\n<d949> 8304\n<d94a> 7848\n<d94b> 19338\n<d94c> 9388\n<d94d> 7927\n<d94e> 8566\n<d94f> 9389\n<d950> 19339\n<d951> 8315\n<d952> 8005\n<d953> 9386\n<d954> 8267\n<d955> 8239\n<d956> 8026\n<d957> 9392\n<d958> 19340\n<d959> 8887\n<d95a> 8063\n<d95b> 19341\n<d95c> 8805\n<d963> 9394\n<d964> 8475\n<d965> 7761\n<d966> 19348\n<d967> 9396\n<d96c> 9395\n<d96d> 19353\n<d96e> 7839\n<d96f> 19354\n<d970> 8472\n<d971> 19355\n<d972> 8372\n<d973> 9135\n<d974> 8635\n<d975> 8306\n<d976> 8085\n<d977> 19356\n<d978> 7946\n<d979> 9398\n<d97c> 8849\n<d97d> 9397\n<d97e> 8824\n<d980> 7892\n<d987> 8179\n<d98d> 8873\n<d98e> 9399\n<d98f> 7976\n<d990> 8457\n<d991> 8903\n<d997> 9390\n<d998> 8881\n<d99b> 8806\n<d99c> 19377\n<d99d> 8795\n<d99e> 8900\n<d99f> 19378\n<d9a0> 8469\n<da40> 19379\n<da41> 8746\n<da42> 9393\n<da48> 8509\n<da4d> 7957\n<da4e> 8796\n<da73> 7956\n<da77> 8826\n<da85> 8430\n<da8e> 9720\n<db60> 8084\n<db78> 8752\n<db84> 9725\n<db8b> 9728\n<db98> 9734\n<dc45> 9727\n<dc4f> 9724\n<dc50> 7820\n<dc51> 9730\n<dc52> 19571\n<dc53> 8781\n<dc54> 19572\n<dc55> 9732\n<dc56> 9726\n<dc57> 9731\n<dc5d> 9729\n<dc62> 9733\n<dc66> 7843\n<dc67> 9736\n<dc6b> 9735\nendcidchar\n\n100 begincidchar\n<dc7c> 8432\n<dc87> 7803\n<dc88> 8807\n<dc89> 7990\n<dc8a> 8150\n<dc8e> 8672\n<dc8f> 19616\n<dc90> 9356\n<dc97> 9357\n<dc9b> 8450\n<dca0> 9364\n<dd46> 9363\n<dd4d> 9358\n<dd53> 8857\n<dd54> 9361\n<dd55> 9366\n<dd56> 9359\n<dd57> 9362\n<dd58> 19647\n<dd59> 9367\n<dd5e> 8113\n<dd5f> 19652\n<dd60> 9370\n<dd61> 19653\n<dd62> 9369\n<dd63> 19654\n<dd64> 8792\n<dd65> 9368\n<dd6d> 9371\n<dd6e> 19662\n<dd6f> 7945\n<dd70> 8422\n<dd76> 8230\n<dd77> 9375\n<dd78> 8025\n<dd80> 19672\n<dd81> 7995\n<dd82> 9372\n<dd85> 7738\n<dd86> 8283\n<dd8b> 8048\n<dd8f> 9376\n<dd94> 8507\n<dd97> 7943\n<dd9a> 8816\n<dd9b> 8759\n<dd9e> 9426\n<dd9f> 19692\n<dda0> 8627\n<de40> 8773\n<de41> 9377\n<de44> 8872\n<de48> 8828\n<de49> 8112\n<de4f> 9378\n<de5a> 8006\n<de5b> 19713\n<de5c> 9088\n<de5d> 9365\n<de5e> 19714\n<de5f> 9360\n<de6b> 7728\n<de6f> 7837\n<de70> 7755\n<de71> 7754\n<de72> 8362\n<de92> 9851\n<de9f> 9202\n<dea0> 19771\n<df40> 8830\n<df41> 19772\n<df42> 8217\n<df4d> 8123\n<df5c> 8787\n<df5d> 19797\n<df5e> 7998\n<df5f> 7846\n<df60> 8590\n<df64> 8684\n<df65> 19801\n<df66> 7870\n<df67> 19802\n<df68> 8778\n<df6d> 8499\n<df74> 7812\n<df77> 8399\n<df78> 8674\n<df79> 19815\n<df7a> 8719\n<df7b> 19816\n<df7c> 8233\n<df7d> 19817\n<df7e> 8307\n<df80> 8021\n<df83> 9201\n<df84> 19820\n<df85> 7750\n<df89> 8291\n<df8a> 9203\n<e050> 8990\nendcidchar\n\n100 begincidchar\n<e05d> 8755\n<e069> 8992\n<e06c> 8647\n<e075> 8892\n<e076> 19895\n<e077> 8988\n<e078> 19896\n<e079> 8785\n<e087> 7867\n<e08d> 8839\n<e08e> 19914\n<e08f> 8237\n<e090> 7851\n<e091> 19915\n<e092> 8989\n<e093> 19916\n<e094> 8991\n<e097> 8987\n<e142> 8993\n<e164> 8789\n<e168> 7823\n<e174> 8716\n<e175> 8100\n<e184> 8347\n<e185> 8664\n<e186> 19990\n<e187> 9722\n<e188> 19991\n<e189> 9721\n<e18c> 8500\n<e18d> 19994\n<e191> 9464\n<e192> 19995\n<e193> 9463\n<e194> 7880\n<e195> 9462\n<e198> 8832\n<e19e> 7877\n<e19f> 9467\n<e1a0> 20003\n<e240> 20004\n<e241> 9466\n<e242> 20005\n<e243> 7917\n<e24f> 9469\n<e250> 20017\n<e251> 9465\n<e252> 20018\n<e253> 9470\n<e254> 8397\n<e25a> 9480\n<e25b> 9476\n<e25e> 9478\n<e262> 9471\n<e263> 8336\n<e267> 7901\n<e268> 7973\n<e269> 20032\n<e26a> 9475\n<e26b> 9474\n<e26e> 7802\n<e26f> 8358\n<e278> 8149\n<e27d> 7953\n<e27e> 20047\n<e280> 9479\n<e281> 9472\n<e282> 9477\n<e289> 9497\n<e28a> 20054\n<e28b> 9493\n<e28e> 9484\n<e28f> 8241\n<e292> 9483\n<e293> 9487\n<e294> 9498\n<e295> 9481\n<e298> 9486\n<e299> 8756\n<e29a> 9491\n<e29b> 8064\n<e2a0> 9473\n<e342> 9495\n<e343> 9494\n<e347> 9496\n<e34b> 7766\n<e34f> 9485\n<e350> 20076\n<e351> 8403\n<e354> 8314\n<e355> 8398\n<e358> 9488\n<e35c> 7765\n<e360> 9482\n<e371> 8106\n<e372> 20101\n<e373> 9502\n<e374> 7967\n<e378> 9517\n<e379> 8733\nendcidchar\n\n100 begincidchar\n<e37c> 9522\n<e37d> 20107\n<e37e> 8571\n<e38a> 8623\n<e38b> 20118\n<e38c> 9516\n<e38f> 9512\n<e390> 20121\n<e391> 8332\n<e392> 20122\n<e393> 9519\n<e394> 20123\n<e395> 8636\n<e399> 9501\n<e39c> 9525\n<e39d> 20129\n<e39e> 8717\n<e39f> 9510\n<e3a0> 20130\n<e440> 9524\n<e441> 9514\n<e442> 9503\n<e443> 9521\n<e444> 9500\n<e448> 9509\n<e44e> 8653\n<e44f> 20139\n<e450> 8666\n<e451> 20140\n<e452> 8562\n<e453> 9534\n<e458> 8271\n<e459> 20145\n<e45a> 9539\n<e45b> 20146\n<e45c> 8663\n<e45d> 20147\n<e45e> 7740\n<e462> 9513\n<e465> 9505\n<e468> 7935\n<e473> 9535\n<e474> 20165\n<e475> 9540\n<e479> 9507\n<e47a> 7824\n<e47b> 9530\n<e47c> 9541\n<e47d> 20169\n<e47e> 9533\n<e480> 20170\n<e481> 8385\n<e484> 8451\n<e485> 9504\n<e486> 9532\n<e487> 9531\n<e488> 9528\n<e48d> 9536\n<e48e> 20177\n<e48f> 8141\n<e493> 7960\n<e498> 9547\n<e49d> 9543\n<e4a0> 20189\n<e546> 8880\n<e547> 20196\n<e548> 9542\n<e54b> 9548\n<e54e> 7834\n<e54f> 9554\n<e550> 9520\n<e551> 9545\n<e555> 9553\n<e556> 7882\n<e557> 20204\n<e558> 8402\n<e55c> 8120\n<e55d> 20208\n<e55e> 8313\n<e561> 8619\n<e564> 9549\n<e565> 7845\n<e568> 8268\n<e569> 8320\n<e56c> 9837\n<e56d> 20217\n<e56e> 9527\n<e575> 9546\n<e576> 8632\n<e577> 20224\n<e578> 9550\n<e57b> 9468\n<e57c> 9556\n<e580> 20229\n<e581> 7996\n<e582> 20230\n<e583> 7893\n<e58a> 9558\n<e58e> 8808\n<e591> 7894\nendcidchar\n\n100 begincidchar\n<e59a> 9559\n<e59b> 9555\n<e59f> 9544\n<e5a0> 20253\n<e640> 8412\n<e644> 9561\n<e649> 8087\n<e64a> 9557\n<e64e> 8829\n<e652> 9598\n<e656> 8316\n<e657> 20270\n<e658> 9562\n<e65b> 9566\n<e65e> 7732\n<e669> 8542\n<e66a> 20285\n<e66b> 9568\n<e675> 8610\n<e676> 9044\n<e679> 9571\n<e67a> 9511\n<e67b> 20297\n<e67c> 9518\n<e67d> 9560\n<e67e> 20298\n<e680> 7963\n<e681> 20299\n<e682> 8835\n<e683> 20300\n<e684> 9572\n<e687> 8352\n<e688> 20303\n<e689> 9573\n<e68c> 9569\n<e693> 9570\n<e697> 9580\n<e69b> 9581\n<e69c> 8224\n<e69f> 9567\n<e6a0> 9578\n<e743> 9582\n<e748> 9529\n<e749> 9564\n<e74f> 9579\n<e750> 7791\n<e751> 20330\n<e752> 8132\n<e753> 9575\n<e754> 20331\n<e755> 9563\n<e759> 9757\n<e766> 9515\n<e767> 20347\n<e768> 9585\n<e769> 20348\n<e76a> 9591\n<e774> 9506\n<e77c> 9523\n<e782> 8234\n<e783> 20369\n<e784> 9526\n<e785> 9587\n<e786> 9583\n<e78a> 8851\n<e78b> 9592\n<e78f> 9584\n<e792> 9589\n<e79a> 9565\n<e7a0> 8218\n<e843> 9594\n<e844> 8198\n<e845> 20391\n<e846> 8567\n<e849> 9499\n<e84a> 20394\n<e84b> 9508\n<e84f> 9595\n<e854> 8867\n<e85a> 9593\n<e85b> 20407\n<e85c> 9574\n<e862> 8083\n<e863> 20413\n<e864> 9596\n<e870> 9492\n<e873> 9597\n<e874> 20427\n<e875> 9586\n<e87c> 9588\n<e880> 8782\n<e881> 20436\n<e882> 8646\n<e887> 8351\n<e888> 20441\n<e889> 9590\n<e88c> 8292\n<e88d> 8895\n<e88e> 9756\n<e88f> 8798\nendcidchar\n\n100 begincidchar\n<e94c> 7797\n<e954> 8317\n<e955> 20480\n<e956> 9151\n<e957> 8467\n<e95a> 9152\n<e95d> 7749\n<e95e> 20485\n<e95f> 8152\n<e960> 9156\n<e961> 20486\n<e962> 9154\n<e963> 8452\n<e964> 20487\n<e965> 8637\n<e966> 20488\n<e967> 8071\n<e968> 9155\n<e96c> 8809\n<e975> 8003\n<e976> 20500\n<e977> 7966\n<e978> 9849\n<e979> 7915\n<e97c> 7989\n<e97d> 8330\n<e97e> 20503\n<e980> 9159\n<e981> 9161\n<e982> 9158\n<e987> 8783\n<e98b> 9163\n<e98e> 8691\n<e98f> 20513\n<e990> 8695\n<e991> 9167\n<e992> 9166\n<e993> 9162\n<e994> 9165\n<e998> 9168\n<e99b> 9836\n<e99c> 20519\n<e99d> 9153\n<e99e> 20520\n<e99f> 8174\n<e9a0> 9169\n<ea40> 8184\n<ea44> 9171\n<ea48> 9170\n<ea49> 9172\n<ea4a> 7832\n<ea50> 7980\n<ea51> 20532\n<ea52> 9173\n<ea55> 7793\n<ea56> 9873\n<ea59> 9157\n<ea80> 8986\n<ea84> 8468\n<ea87> 8836\n<ea8e> 8732\n<ea8f> 20585\n<ea90> 7806\n<ea91> 8269\n<ea96> 8705\n<eaa0> 7897\n<eb40> 20599\n<eb41> 8114\n<eb45> 8786\n<eb48> 8057\n<eb53> 8535\n<eb54> 20615\n<eb55> 8639\n<eb5b> 8735\n<eb5c> 20621\n<eb5d> 8253\n<eb60> 8213\n<eb61> 20624\n<eb62> 9893\n<eb6d> 8534\n<eb70> 8516\n<eb71> 20637\n<eb72> 7825\n<eb73> 8791\n<eb78> 8202\n<eb79> 8338\n<eb85> 8784\n<eb8a> 7875\n<ec46> 8616\n<ec56> 9741\n<ec5a> 9740\n<ec5b> 20702\n<ec5c> 9742\n<ec60> 8242\n<ec6e> 9739\n<ec76> 8899\n<ec96> 7971\n<ed46> 9877\n<ed58> 9822\n<ed5e> 9821\nendcidchar\n\n100 begincidchar\n<ed61> 9874\n<ed64> 9823\n<ed65> 20798\n<ed66> 8589\n<ed67> 8445\n<ed6e> 8000\n<ed74> 9317\n<ed77> 9319\n<ed78> 20812\n<ed79> 9318\n<ed91> 8649\n<ed92> 20835\n<ed93> 8713\n<ed94> 7881\n<ed95> 8425\n<ed96> 20836\n<ed97> 8650\n<ed98> 8518\n<ed99> 9669\n<ed9a> 8668\n<ed9b> 20837\n<ed9c> 9310\n<ed9d> 20838\n<ed9e> 8527\n<ed9f> 20839\n<eda0> 9670\n<ee40> 9671\n<ee41> 8769\n<ee42> 8586\n<ee43> 7727\n<ee44> 7900\n<ee48> 8383\n<ee49> 8244\n<ee4d> 9673\n<ee52> 9672\n<ee55> 8718\n<ee56> 20852\n<ee57> 9675\n<ee5e> 8573\n<ee61> 8062\n<ee68> 9676\n<ee69> 8131\n<ee6c> 8377\n<ee6d> 20869\n<ee6e> 8577\n<ee77> 8154\n<ee7d> 8563\n<ee7e> 7905\n<ee80> 9677\n<ee85> 9678\n<ee86> 8694\n<ee8a> 8779\n<ee8b> 9681\n<ee8c> 20890\n<ee8d> 7872\n<ee90> 8200\n<ee94> 9680\n<ee97> 9682\n<ee98> 20898\n<ee99> 7978\n<ee9d> 7794\n<ee9e> 9683\n<ef40> 8638\n<ef41> 9684\n<ef42> 8260\n<ef43> 20904\n<ef44> 9679\n<ef45> 8435\n<ef4c> 7936\n<ef54> 20916\n<ef55> 9880\n<ef56> 20917\n<ef57> 9848\n<ef5a> 9422\n<ef60> 9423\n<ef68> 8376\n<ef69> 20932\n<ef6a> 9424\n<ef6b> 20933\n<ef6c> 9425\n<ef77> 7924\n<ef7a> 9115\n<ef7b> 20946\n<ef7c> 9854\n<ef82> 9117\n<ef85> 20951\n<ef86> 9121\n<ef87> 20952\n<ef88> 7921\n<ef8b> 8734\n<ef8c> 20955\n<ef8d> 9122\n<ef95> 8523\n<ef96> 7734\n<ef97> 8501\n<ef9c> 8109\n<ef9d> 20967\n<ef9e> 7763\n<f040> 20970\n<f041> 9123\nendcidchar\n\n100 begincidchar\n<f042> 8707\n<f043> 20971\n<f044> 7911\n<f047> 9124\n<f048> 8343\n<f049> 7908\n<f04e> 8760\n<f051> 9125\n<f054> 8090\n<f057> 8643\n<f05e> 7982\n<f068> 9116\n<f06c> 9126\n<f071> 9118\n<f072> 21006\n<f073> 8245\n<f074> 9127\n<f078> 9128\n<f079> 21010\n<f07a> 8309\n<f080> 9131\n<f081> 8171\n<f082> 9132\n<f087> 8042\n<f088> 8441\n<f08b> 9830\n<f090> 9831\n<f091> 21023\n<f092> 7788\n<f096> 9133\n<f152> 8301\n<f153> 8770\n<f154> 7938\n<f157> 8579\n<f158> 21057\n<f159> 7813\n<f15a> 8681\n<f167> 7767\n<f176> 8869\n<f177> 9223\n<f178> 8138\n<f179> 21084\n<f17a> 9218\n<f17b> 8066\n<f17e> 9224\n<f180> 9220\n<f181> 21087\n<f182> 8497\n<f183> 21088\n<f184> 8580\n<f185> 21089\n<f186> 9219\n<f187> 21090\n<f188> 8302\n<f189> 9227\n<f194> 7999\n<f198> 8295\n<f245> 8151\n<f246> 21117\n<f247> 7811\n<f24b> 9231\n<f253> 9230\n<f254> 8391\n<f255> 9229\n<f25c> 9234\n<f25f> 8375\n<f271> 9200\n<f272> 21153\n<f273> 9233\n<f274> 9236\n<f275> 21154\n<f276> 8560\n<f27c> 9221\n<f27d> 8460\n<f27e> 9237\n<f285> 8294\n<f286> 21165\n<f287> 9042\n<f288> 9235\n<f289> 9232\n<f28c> 8433\n<f291> 9226\n<f294> 9225\n<f295> 21172\n<f296> 9240\n<f29c> 8103\n<f29d> 21178\n<f29e> 8700\n<f340> 8129\n<f341> 9222\n<f345> 8860\n<f348> 8270\n<f349> 21186\n<f34a> 9242\n<f34b> 9241\n<f350> 9228\n<f361> 7721\n<f374> 9825\n<f375> 21225\n<f376> 9892\nendcidchar\n\n100 begincidchar\n<f377> 8564\n<f378> 9827\n<f379> 9826\n<f38c> 9845\n<f3a0> 8524\n<f445> 9850\n<f450> 9888\n<f457> 9832\n<f458> 21283\n<f459> 7888\n<f45a> 21284\n<f45b> 8342\n<f45c> 21285\n<f45d> 9164\n<f462> 9160\n<f463> 21290\n<f464> 8766\n<f475> 9829\n<f47c> 9828\n<f47d> 21313\n<f47e> 8761\n<f494> 8266\n<f499> 9759\n<f49c> 9758\n<f545> 9760\n<f546> 21349\n<f547> 9761\n<f552> 9762\n<f553> 21360\n<f554> 9767\n<f555> 7737\n<f556> 9765\n<f55e> 9769\n<f561> 9774\n<f562> 9771\n<f56e> 9770\n<f56f> 9773\n<f570> 21381\n<f571> 9768\n<f572> 8633\n<f585> 9782\n<f586> 9776\n<f58c> 9784\n<f58d> 21404\n<f58e> 8205\n<f58f> 9783\n<f599> 9797\n<f59a> 21414\n<f59b> 9786\n<f5a0> 9795\n<f640> 21419\n<f641> 9792\n<f645> 9789\n<f646> 9793\n<f647> 21423\n<f648> 9790\n<f64b> 9791\n<f64c> 8128\n<f64d> 21426\n<f654> 9794\n<f658> 9796\n<f661> 9785\n<f662> 21442\n<f663> 9804\n<f66c> 9799\n<f66d> 9803\n<f671> 9801\n<f674> 9800\n<f675> 21456\n<f676> 9802\n<f677> 8456\n<f685> 9805\n<f688> 9780\n<f689> 21471\n<f68a> 9809\n<f68d> 9808\n<f68e> 9810\n<f692> 9807\n<f696> 9778\n<f697> 9806\n<f698> 9811\n<f699> 21480\n<f69a> 9815\n<f69b> 21481\n<f69c> 9781\n<f69d> 21482\n<f69e> 9779\n<f69f> 21483\n<f6a0> 9814\n<f742> 9812\n<f749> 9816\n<f74c> 9813\n<f74d> 7757\n<f756> 9819\n<f757> 21502\n<f758> 9818\n<f759> 21503\n<f75a> 9817\n<f75b> 8238\n<f75c> 9775\nendcidchar\n\n100 begincidchar\n<f761> 9798\n<f762> 21508\n<f763> 9766\n<f76b> 9820\n<f771> 9772\n<f77c> 9763\n<f77d> 21531\n<f77e> 9777\n<f842> 8348\n<f846> 9600\n<f849> 8924\n<f850> 7941\n<f851> 8331\n<f852> 21578\n<f853> 9601\n<f863> 9603\n<f864> 9602\n<f865> 21594\n<f866> 8686\n<f872> 8578\n<f878> 8771\n<f879> 21611\n<f87a> 9607\n<f87b> 21612\n<f87c> 9608\n<f880> 21615\n<f881> 9604\n<f884> 8701\n<f885> 21618\n<f886> 8687\n<f88d> 9610\n<f88e> 9612\n<f899> 8007\n<f89d> 7965\n<f8a0> 9613\n<f94e> 8144\n<f94f> 9618\n<f950> 9615\n<f959> 9620\n<f95a> 7904\n<f95d> 9617\n<f95e> 9621\n<f967> 9623\n<f968> 21672\n<f969> 8374\n<f96c> 9624\n<f96f> 8438\n<f985> 9605\n<f986> 21697\n<f987> 9625\n<f991> 9622\n<f996> 9626\n<f997> 21711\n<f998> 9627\n<fa42> 9629\n<fa46> 9630\n<fa4c> 9036\n<fa51> 8004\n<fa58> 9824\n<fa59> 9632\n<fa5d> 9628\n<fa5e> 21743\n<fa5f> 9631\n<fa60> 21744\n<fa61> 8044\n<fa70> 9634\n<fa74> 8366\n<fa75> 21762\n<fa76> 9611\n<fa77> 9635\n<fa83> 9609\n<fa84> 9637\n<fa8d> 9636\n<fa90> 9638\n<fa91> 9619\n<fa96> 9639\n<fa97> 8738\n<fa98> 9641\n<fb49> 9640\n<fb52> 9606\n<fb57> 9633\n<fb58> 9642\n<fb59> 21816\n<fb5a> 9616\n<fb5b> 9614\n<fb75> 9864\n<fb79> 9886\n<fb7a> 9723\n<fb7b> 21845\n<fb7c> 8076\n<fb7d> 8692\n<fb7e> 21846\n<fb90> 8207\n<fb9c> 8305\n<fb9f> 9719\n<fba0> 21876\n<fc44> 9878\n<fc49> 9871\n<fc5a> 8922\n<fc63> 7873\nendcidchar\n\n37 begincidchar\n<fc68> 7859\n<fc6f> 9834\n<fc70> 21919\n<fc71> 9866\n<fc74> 9833\n<fc83> 9754\n<fc8a> 9843\n<fd52> 8390\n<fd53> 8811\n<fd57> 9427\n<fd58> 7814\n<fd59> 21982\n<fd5a> 9743\n<fd5f> 9745\n<fd62> 9747\n<fd65> 9744\n<fd66> 9746\n<fd67> 8240\n<fd68> 21991\n<fd69> 9841\n<fd6c> 9748\n<fd70> 9750\n<fd71> 21997\n<fd72> 9749\n<fd78> 8434\n<fd7d> 9751\n<fd7e> 22007\n<fd88> 8247\n<fd8b> 8371\n<fd8f> 7970\n<fd90> 9453\n<fd94> 7988\n<fd9d> 2562\n<fd9e> 16595\n<fd9f> 8204\n<fda0> 20611\n<fe40> 4697\nendcidchar\n\n100 begincidrange\n<20> <7e> 1\n<8138fd38> <8138fd39> 22428\n<8138fe30> <8138fe39> 22430\n<81398130> <81398137> 22440\n<81398230> <81398239> 22449\n<81398330> <81398339> 22459\n<81398430> <81398439> 22469\n<81398530> <81398539> 22479\n<81398630> <81398639> 22489\n<81398730> <81398739> 22499\n<81398830> <81398839> 22509\n<81398930> <81398939> 22519\n<8139a533> <8139a535> 22395\n<8139a538> <8139a539> 22398\n<8139a836> <8139a838> 22401\n<8139b434> <8139b439> 22404\n<8139b530> <8139b539> 22410\n<8139b630> <8139b637> 22420\n<8139ef30> <8139ef39> 22530\n<8139f030> <8139f039> 22540\n<8139f130> <8139f139> 22550\n<8139f230> <8139f239> 22560\n<8139f330> <8139f339> 22570\n<8139f430> <8139f439> 22580\n<8139f530> <8139f539> 22590\n<8139f630> <8139f639> 22600\n<8139f730> <8139f739> 22610\n<8139f830> <8139f839> 22620\n<8139f930> <8139f939> 22630\n<8139fa30> <8139fa39> 22640\n<8139fb30> <8139fb39> 22650\n<8139fc30> <8139fc39> 22660\n<8139fd30> <8139fd39> 22670\n<8139fe30> <8139fe39> 22680\n<8140> <8178> 10072\n<817a> <817e> 10129\n<8180> <8185> 10134\n<8187> <81ec> 10140\n<81ee> <81f5> 10242\n<81f7> <81fe> 10250\n<82308130> <82308139> 22690\n<82308230> <82308239> 22700\n<82308330> <82308339> 22710\n<82308430> <82308439> 22720\n<82308530> <82308539> 22730\n<82308630> <82308639> 22740\n<82308730> <82308739> 22750\n<82308830> <82308839> 22760\n<82308930> <82308939> 22770\n<82308a30> <82308a39> 22780\n<82308b30> <82308b39> 22790\n<82308c30> <82308c39> 22800\n<82308d30> <82308d39> 22810\n<82308e30> <82308e39> 22820\n<82308f30> <82308f39> 22830\n<82309030> <82309039> 22840\n<82309130> <82309139> 22850\n<82309230> <82309239> 22860\n<82309330> <82309339> 22870\n<82309430> <82309439> 22880\n<82309530> <82309539> 22890\n<82309630> <82309639> 22900\n<82309730> <82309739> 22910\n<82309830> <82309839> 22920\n<82309930> <82309939> 22930\n<82309a30> <82309a39> 22940\n<82309b30> <82309b39> 22950\n<82309c30> <82309c39> 22960\n<82309d30> <82309d39> 22970\n<82309e30> <82309e39> 22980\n<82309f30> <82309f39> 22990\n<8230a030> <8230a039> 23000\n<8230a130> <8230a139> 23010\n<8230a230> <8230a239> 23020\n<8230a330> <8230a339> 23030\n<8230a430> <8230a439> 23040\n<8230a530> <8230a539> 23050\n<8230a630> <8230a639> 23060\n<8230a730> <8230a739> 23070\n<8230a830> <8230a839> 23080\n<8230a930> <8230a939> 23090\n<8230aa30> <8230aa39> 23100\n<8230ab30> <8230ab39> 23110\n<8230ac30> <8230ac39> 23120\n<8230ad30> <8230ad39> 23130\n<8230ae30> <8230ae39> 23140\n<8230af30> <8230af39> 23150\n<8230b030> <8230b039> 23160\n<8230b130> <8230b139> 23170\n<8230b230> <8230b239> 23180\n<8230b330> <8230b339> 23190\n<8230b430> <8230b439> 23200\n<8230b530> <8230b539> 23210\n<8230b630> <8230b639> 23220\n<8230b730> <8230b739> 23230\n<8230b830> <8230b839> 23240\n<8230b930> <8230b939> 23250\n<8230ba30> <8230ba39> 23260\n<8230bb30> <8230bb39> 23270\n<8230bc30> <8230bc39> 23280\nendcidrange\n\n100 begincidrange\n<8230bd30> <8230bd39> 23290\n<8230be30> <8230be39> 23300\n<8230bf30> <8230bf39> 23310\n<8230c030> <8230c039> 23320\n<8230c130> <8230c139> 23330\n<8230c230> <8230c239> 23340\n<8230c330> <8230c339> 23350\n<8230c430> <8230c439> 23360\n<8230c530> <8230c539> 23370\n<8230c630> <8230c639> 23380\n<8230c730> <8230c739> 23390\n<8230c830> <8230c839> 23400\n<8230c930> <8230c939> 23410\n<8230ca30> <8230ca39> 23420\n<8230cb30> <8230cb39> 23430\n<8230cc30> <8230cc39> 23440\n<8230cd30> <8230cd39> 23450\n<8230ce30> <8230ce39> 23460\n<8230cf30> <8230cf39> 23470\n<8230d030> <8230d039> 23480\n<8230d130> <8230d139> 23490\n<8230d230> <8230d239> 23500\n<8230d330> <8230d339> 23510\n<8230d430> <8230d439> 23520\n<8230d530> <8230d539> 23530\n<8230d630> <8230d639> 23540\n<8230d730> <8230d739> 23550\n<8230d830> <8230d839> 23560\n<8230d930> <8230d939> 23570\n<8230da30> <8230da39> 23580\n<8230db30> <8230db39> 23590\n<8230dc30> <8230dc39> 23600\n<8230dd30> <8230dd39> 23610\n<8230de30> <8230de39> 23620\n<8230df30> <8230df39> 23630\n<8230e030> <8230e039> 23640\n<8230e130> <8230e139> 23650\n<8230e230> <8230e239> 23660\n<8230e330> <8230e339> 23670\n<8230e430> <8230e439> 23680\n<8230e530> <8230e539> 23690\n<8230e630> <8230e639> 23700\n<8230e730> <8230e739> 23710\n<8230e830> <8230e839> 23720\n<8230e930> <8230e939> 23730\n<8230ea30> <8230ea39> 23740\n<8230eb30> <8230eb39> 23750\n<8230ec30> <8230ec39> 23760\n<8230ed30> <8230ed39> 23770\n<8230ee30> <8230ee39> 23780\n<8230ef30> <8230ef39> 23790\n<8230f030> <8230f039> 23800\n<8230f130> <8230f139> 23810\n<8230f230> <8230f239> 23820\n<8230f330> <8230f339> 23830\n<8230f430> <8230f439> 23840\n<8230f530> <8230f539> 23850\n<8230f630> <8230f639> 23860\n<8230f730> <8230f739> 23870\n<8230f830> <8230f839> 23880\n<8230f930> <8230f939> 23890\n<8230fa30> <8230fa39> 23900\n<8230fb30> <8230fb39> 23910\n<8230fc30> <8230fc39> 23920\n<8230fd30> <8230fd39> 23930\n<8230fe30> <8230fe39> 23940\n<82318130> <82318139> 23950\n<82318230> <82318239> 23960\n<82318330> <82318339> 23970\n<82318430> <82318439> 23980\n<82318530> <82318539> 23990\n<82318630> <82318639> 24000\n<82318730> <82318739> 24010\n<82318830> <82318839> 24020\n<82318930> <82318939> 24030\n<82318a30> <82318a39> 24040\n<82318b30> <82318b39> 24050\n<82318c30> <82318c39> 24060\n<82318d30> <82318d39> 24070\n<82318e30> <82318e39> 24080\n<82318f30> <82318f39> 24090\n<82319030> <82319039> 24100\n<82319130> <82319139> 24110\n<82319230> <82319239> 24120\n<82319330> <82319339> 24130\n<82319430> <82319439> 24140\n<82319530> <82319539> 24150\n<82319630> <82319639> 24160\n<82319730> <82319739> 24170\n<82319830> <82319839> 24180\n<82319930> <82319939> 24190\n<82319a30> <82319a39> 24200\n<82319b30> <82319b39> 24210\n<82319c30> <82319c39> 24220\n<82319d30> <82319d39> 24230\n<82319e30> <82319e39> 24240\n<82319f30> <82319f39> 24250\n<8231a030> <8231a039> 24260\n<8231a130> <8231a139> 24270\n<8231a230> <8231a239> 24280\nendcidrange\n\n100 begincidrange\n<8231a330> <8231a339> 24290\n<8231a430> <8231a439> 24300\n<8231a530> <8231a539> 24310\n<8231a630> <8231a639> 24320\n<8231a730> <8231a739> 24330\n<8231a830> <8231a839> 24340\n<8231a930> <8231a939> 24350\n<8231aa30> <8231aa39> 24360\n<8231ab30> <8231ab39> 24370\n<8231ac30> <8231ac39> 24380\n<8231ad30> <8231ad39> 24390\n<8231ae30> <8231ae39> 24400\n<8231af30> <8231af39> 24410\n<8231b030> <8231b039> 24420\n<8231b130> <8231b139> 24430\n<8231b230> <8231b239> 24440\n<8231b330> <8231b339> 24450\n<8231b430> <8231b439> 24460\n<8231b530> <8231b539> 24470\n<8231b630> <8231b639> 24480\n<8231b730> <8231b739> 24490\n<8231b830> <8231b839> 24500\n<8231b930> <8231b939> 24510\n<8231ba30> <8231ba39> 24520\n<8231bb30> <8231bb39> 24530\n<8231bc30> <8231bc39> 24540\n<8231bd30> <8231bd39> 24550\n<8231be30> <8231be39> 24560\n<8231bf30> <8231bf39> 24570\n<8231c030> <8231c039> 24580\n<8231c130> <8231c139> 24590\n<8231c230> <8231c239> 24600\n<8231c330> <8231c339> 24610\n<8231c430> <8231c439> 24620\n<8231c530> <8231c539> 24630\n<8231c630> <8231c639> 24640\n<8231c730> <8231c739> 24650\n<8231c830> <8231c839> 24660\n<8231c930> <8231c939> 24670\n<8231ca30> <8231ca39> 24680\n<8231cb30> <8231cb39> 24690\n<8231cc30> <8231cc39> 24700\n<8231cd30> <8231cd39> 24710\n<8231ce30> <8231ce39> 24720\n<8231cf30> <8231cf39> 24730\n<8231d030> <8231d039> 24740\n<8231d130> <8231d139> 24750\n<8231d230> <8231d239> 24760\n<8231d330> <8231d339> 24770\n<8231d430> <8231d439> 24780\n<8231d530> <8231d539> 24790\n<8231d630> <8231d639> 24800\n<8231d730> <8231d739> 24810\n<8231d830> <8231d839> 24820\n<8231d930> <8231d939> 24830\n<8231da30> <8231da39> 24840\n<8231db30> <8231db39> 24850\n<8231dc30> <8231dc39> 24860\n<8231dd30> <8231dd39> 24870\n<8231de30> <8231de39> 24880\n<8231df30> <8231df39> 24890\n<8231e030> <8231e039> 24900\n<8231e130> <8231e139> 24910\n<8231e230> <8231e239> 24920\n<8231e330> <8231e339> 24930\n<8231e430> <8231e439> 24940\n<8231e530> <8231e539> 24950\n<8231e630> <8231e639> 24960\n<8231e730> <8231e739> 24970\n<8231e830> <8231e839> 24980\n<8231e930> <8231e939> 24990\n<8231ea30> <8231ea39> 25000\n<8231eb30> <8231eb39> 25010\n<8231ec30> <8231ec39> 25020\n<8231ed30> <8231ed39> 25030\n<8231ee30> <8231ee39> 25040\n<8231ef30> <8231ef39> 25050\n<8231f030> <8231f039> 25060\n<8231f130> <8231f139> 25070\n<8231f230> <8231f239> 25080\n<8231f330> <8231f339> 25090\n<8231f430> <8231f439> 25100\n<8231f530> <8231f539> 25110\n<8231f630> <8231f639> 25120\n<8231f730> <8231f739> 25130\n<8231f830> <8231f839> 25140\n<8231f930> <8231f939> 25150\n<8231fa30> <8231fa39> 25160\n<8231fb30> <8231fb39> 25170\n<8231fc30> <8231fc39> 25180\n<8231fd30> <8231fd39> 25190\n<8231fe30> <8231fe39> 25200\n<82328130> <82328139> 25210\n<82328230> <82328239> 25220\n<82328330> <82328339> 25230\n<82328430> <82328439> 25240\n<82328530> <82328539> 25250\n<82328630> <82328639> 25260\n<82328730> <82328739> 25270\n<82328830> <82328839> 25280\nendcidrange\n\n100 begincidrange\n<82328930> <82328939> 25290\n<82328a30> <82328a39> 25300\n<82328b30> <82328b39> 25310\n<82328c30> <82328c39> 25320\n<82328d30> <82328d39> 25330\n<82328e30> <82328e39> 25340\n<82328f30> <82328f39> 25350\n<82329030> <82329039> 25360\n<82329130> <82329139> 25370\n<82329230> <82329239> 25380\n<82329330> <82329339> 25390\n<82329430> <82329439> 25400\n<82329530> <82329539> 25410\n<82329630> <82329639> 25420\n<82329730> <82329739> 25430\n<82329830> <82329839> 25440\n<82329930> <82329939> 25450\n<82329a30> <82329a39> 25460\n<82329b30> <82329b39> 25470\n<82329c30> <82329c39> 25480\n<82329d30> <82329d39> 25490\n<82329e30> <82329e39> 25500\n<82329f30> <82329f39> 25510\n<8232a030> <8232a039> 25520\n<8232a130> <8232a139> 25530\n<8232a230> <8232a239> 25540\n<8232a330> <8232a339> 25550\n<8232a430> <8232a439> 25560\n<8232a530> <8232a539> 25570\n<8232a630> <8232a639> 25580\n<8232a730> <8232a739> 25590\n<8232a830> <8232a839> 25600\n<8232a930> <8232a939> 25610\n<8232aa30> <8232aa39> 25620\n<8232ab30> <8232ab39> 25630\n<8232ac30> <8232ac39> 25640\n<8232ad30> <8232ad39> 25650\n<8232ae30> <8232ae39> 25660\n<8232af30> <8232af39> 25670\n<8232b030> <8232b039> 25680\n<8232b130> <8232b139> 25690\n<8232b230> <8232b239> 25700\n<8232b330> <8232b339> 25710\n<8232b430> <8232b439> 25720\n<8232b530> <8232b539> 25730\n<8232b630> <8232b639> 25740\n<8232b730> <8232b739> 25750\n<8232b830> <8232b839> 25760\n<8232b930> <8232b939> 25770\n<8232ba30> <8232ba39> 25780\n<8232bb30> <8232bb39> 25790\n<8232bc30> <8232bc39> 25800\n<8232bd30> <8232bd39> 25810\n<8232be30> <8232be39> 25820\n<8232bf30> <8232bf39> 25830\n<8232c030> <8232c039> 25840\n<8232c130> <8232c139> 25850\n<8232c230> <8232c239> 25860\n<8232c330> <8232c339> 25870\n<8232c430> <8232c439> 25880\n<8232c530> <8232c539> 25890\n<8232c630> <8232c639> 25900\n<8232c730> <8232c739> 25910\n<8232c830> <8232c839> 25920\n<8232c930> <8232c939> 25930\n<8232ca30> <8232ca39> 25940\n<8232cb30> <8232cb39> 25950\n<8232cc30> <8232cc39> 25960\n<8232cd30> <8232cd39> 25970\n<8232ce30> <8232ce39> 25980\n<8232cf30> <8232cf39> 25990\n<8232d030> <8232d039> 26000\n<8232d130> <8232d139> 26010\n<8232d230> <8232d239> 26020\n<8232d330> <8232d339> 26030\n<8232d430> <8232d439> 26040\n<8232d530> <8232d539> 26050\n<8232d630> <8232d639> 26060\n<8232d730> <8232d739> 26070\n<8232d830> <8232d839> 26080\n<8232d930> <8232d939> 26090\n<8232da30> <8232da39> 26100\n<8232db30> <8232db39> 26110\n<8232dc30> <8232dc39> 26120\n<8232dd30> <8232dd39> 26130\n<8232de30> <8232de39> 26140\n<8232df30> <8232df39> 26150\n<8232e030> <8232e039> 26160\n<8232e130> <8232e139> 26170\n<8232e230> <8232e239> 26180\n<8232e330> <8232e339> 26190\n<8232e430> <8232e439> 26200\n<8232e530> <8232e539> 26210\n<8232e630> <8232e639> 26220\n<8232e730> <8232e739> 26230\n<8232e830> <8232e839> 26240\n<8232e930> <8232e939> 26250\n<8232ea30> <8232ea39> 26260\n<8232eb30> <8232eb39> 26270\n<8232ec30> <8232ec39> 26280\nendcidrange\n\n100 begincidrange\n<8232ed30> <8232ed39> 26290\n<8232ee30> <8232ee39> 26300\n<8232ef30> <8232ef39> 26310\n<8232f030> <8232f039> 26320\n<8232f130> <8232f139> 26330\n<8232f230> <8232f239> 26340\n<8232f330> <8232f339> 26350\n<8232f430> <8232f439> 26360\n<8232f530> <8232f539> 26370\n<8232f630> <8232f639> 26380\n<8232f730> <8232f739> 26390\n<8232f830> <8232f839> 26400\n<8232f930> <8232f939> 26410\n<8232fa30> <8232fa39> 26420\n<8232fb30> <8232fb39> 26430\n<8232fc30> <8232fc39> 26440\n<8232fd30> <8232fd39> 26450\n<8232fe30> <8232fe39> 26460\n<82338130> <82338139> 26470\n<82338230> <82338239> 26480\n<82338330> <82338339> 26490\n<82338430> <82338439> 26500\n<82338530> <82338539> 26510\n<82338630> <82338639> 26520\n<82338730> <82338739> 26530\n<82338830> <82338839> 26540\n<82338930> <82338939> 26550\n<82338a30> <82338a39> 26560\n<82338b30> <82338b39> 26570\n<82338c30> <82338c39> 26580\n<82338d30> <82338d39> 26590\n<82338e30> <82338e39> 26600\n<82338f30> <82338f39> 26610\n<82339030> <82339039> 26620\n<82339130> <82339139> 26630\n<82339230> <82339239> 26640\n<82339330> <82339339> 26650\n<82339430> <82339439> 26660\n<82339530> <82339539> 26670\n<82339630> <82339639> 26680\n<82339730> <82339739> 26690\n<82339830> <82339839> 26700\n<82339930> <82339939> 26710\n<82339a30> <82339a39> 26720\n<82339b30> <82339b39> 26730\n<82339c30> <82339c39> 26740\n<82339d30> <82339d39> 26750\n<82339e30> <82339e39> 26760\n<82339f30> <82339f39> 26770\n<8233a030> <8233a039> 26780\n<8233a130> <8233a139> 26790\n<8233a230> <8233a239> 26800\n<8233a330> <8233a339> 26810\n<8233a430> <8233a439> 26820\n<8233a530> <8233a539> 26830\n<8233a630> <8233a639> 26840\n<8233a730> <8233a739> 26850\n<8233a830> <8233a839> 26860\n<8233a930> <8233a939> 26870\n<8233aa30> <8233aa39> 26880\n<8233ab30> <8233ab39> 26890\n<8233ac30> <8233ac39> 26900\n<8233ad30> <8233ad39> 26910\n<8233ae30> <8233ae39> 26920\n<8233af30> <8233af39> 26930\n<8233b030> <8233b039> 26940\n<8233b130> <8233b139> 26950\n<8233b230> <8233b239> 26960\n<8233b330> <8233b339> 26970\n<8233b430> <8233b439> 26980\n<8233b530> <8233b539> 26990\n<8233b630> <8233b639> 27000\n<8233b730> <8233b739> 27010\n<8233b830> <8233b839> 27020\n<8233b930> <8233b939> 27030\n<8233ba30> <8233ba39> 27040\n<8233bb30> <8233bb39> 27050\n<8233bc30> <8233bc39> 27060\n<8233bd30> <8233bd39> 27070\n<8233be30> <8233be39> 27080\n<8233bf30> <8233bf39> 27090\n<8233c030> <8233c039> 27100\n<8233c130> <8233c139> 27110\n<8233c230> <8233c239> 27120\n<8233c330> <8233c339> 27130\n<8233c430> <8233c439> 27140\n<8233c530> <8233c539> 27150\n<8233c630> <8233c639> 27160\n<8233c730> <8233c739> 27170\n<8233c830> <8233c839> 27180\n<8233c930> <8233c939> 27190\n<8233ca30> <8233ca39> 27200\n<8233cb30> <8233cb39> 27210\n<8233cc30> <8233cc39> 27220\n<8233cd30> <8233cd39> 27230\n<8233ce30> <8233ce39> 27240\n<8233cf30> <8233cf39> 27250\n<8233d030> <8233d039> 27260\n<8233d130> <8233d139> 27270\n<8233d230> <8233d239> 27280\nendcidrange\n\n100 begincidrange\n<8233d330> <8233d339> 27290\n<8233d430> <8233d439> 27300\n<8233d530> <8233d539> 27310\n<8233d630> <8233d639> 27320\n<8233d730> <8233d739> 27330\n<8233d830> <8233d839> 27340\n<8233d930> <8233d939> 27350\n<8233da30> <8233da39> 27360\n<8233db30> <8233db39> 27370\n<8233dc30> <8233dc39> 27380\n<8233dd30> <8233dd39> 27390\n<8233de30> <8233de39> 27400\n<8233df30> <8233df39> 27410\n<8233e030> <8233e039> 27420\n<8233e130> <8233e139> 27430\n<8233e230> <8233e239> 27440\n<8233e330> <8233e339> 27450\n<8233e430> <8233e439> 27460\n<8233e530> <8233e539> 27470\n<8233e630> <8233e639> 27480\n<8233e730> <8233e739> 27490\n<8233e830> <8233e839> 27500\n<8233e930> <8233e939> 27510\n<8233ea30> <8233ea39> 27520\n<8233eb30> <8233eb39> 27530\n<8233ec30> <8233ec39> 27540\n<8233ed30> <8233ed39> 27550\n<8233ee30> <8233ee39> 27560\n<8233ef30> <8233ef39> 27570\n<8233f030> <8233f039> 27580\n<8233f130> <8233f139> 27590\n<8233f230> <8233f239> 27600\n<8233f330> <8233f339> 27610\n<8233f430> <8233f439> 27620\n<8233f530> <8233f539> 27630\n<8233f630> <8233f639> 27640\n<8233f730> <8233f739> 27650\n<8233f830> <8233f839> 27660\n<8233f930> <8233f939> 27670\n<8233fa30> <8233fa39> 27680\n<8233fb30> <8233fb39> 27690\n<8233fc30> <8233fc39> 27700\n<8233fd30> <8233fd39> 27710\n<8233fe30> <8233fe39> 27720\n<82348130> <82348139> 27730\n<82348230> <82348239> 27740\n<82348330> <82348339> 27750\n<82348430> <82348439> 27760\n<82348530> <82348539> 27770\n<82348630> <82348639> 27780\n<82348730> <82348739> 27790\n<82348830> <82348839> 27800\n<82348930> <82348939> 27810\n<82348a30> <82348a39> 27820\n<82348b30> <82348b39> 27830\n<82348c30> <82348c39> 27840\n<82348d30> <82348d39> 27850\n<82348e30> <82348e39> 27860\n<82348f30> <82348f39> 27870\n<82349030> <82349039> 27880\n<82349130> <82349139> 27890\n<82349230> <82349239> 27900\n<82349330> <82349339> 27910\n<82349430> <82349439> 27920\n<82349530> <82349539> 27930\n<82349630> <82349639> 27940\n<82349730> <82349739> 27950\n<82349830> <82349839> 27960\n<82349930> <82349939> 27970\n<82349a30> <82349a39> 27980\n<82349b30> <82349b39> 27990\n<82349c30> <82349c39> 28000\n<82349d30> <82349d39> 28010\n<82349e30> <82349e39> 28020\n<82349f30> <82349f39> 28030\n<8234a030> <8234a039> 28040\n<8234a130> <8234a139> 28050\n<8234a230> <8234a239> 28060\n<8234a330> <8234a339> 28070\n<8234a430> <8234a439> 28080\n<8234a530> <8234a539> 28090\n<8234a630> <8234a639> 28100\n<8234a730> <8234a739> 28110\n<8234a830> <8234a839> 28120\n<8234a930> <8234a939> 28130\n<8234aa30> <8234aa39> 28140\n<8234ab30> <8234ab39> 28150\n<8234ac30> <8234ac39> 28160\n<8234ad30> <8234ad39> 28170\n<8234ae30> <8234ae39> 28180\n<8234af30> <8234af39> 28190\n<8234b030> <8234b039> 28200\n<8234b130> <8234b139> 28210\n<8234b230> <8234b239> 28220\n<8234b330> <8234b339> 28230\n<8234b430> <8234b439> 28240\n<8234b530> <8234b539> 28250\n<8234b630> <8234b639> 28260\n<8234b730> <8234b739> 28270\n<8234b830> <8234b839> 28280\nendcidrange\n\n100 begincidrange\n<8234b930> <8234b939> 28290\n<8234ba30> <8234ba39> 28300\n<8234bb30> <8234bb39> 28310\n<8234bc30> <8234bc39> 28320\n<8234bd30> <8234bd39> 28330\n<8234be30> <8234be39> 28340\n<8234bf30> <8234bf39> 28350\n<8234c030> <8234c039> 28360\n<8234c130> <8234c139> 28370\n<8234c230> <8234c239> 28380\n<8234c330> <8234c339> 28390\n<8234c430> <8234c439> 28400\n<8234c530> <8234c539> 28410\n<8234c630> <8234c639> 28420\n<8234c730> <8234c739> 28430\n<8234c830> <8234c839> 28440\n<8234c930> <8234c939> 28450\n<8234ca30> <8234ca39> 28460\n<8234cb30> <8234cb39> 28470\n<8234cc30> <8234cc39> 28480\n<8234cd30> <8234cd39> 28490\n<8234ce30> <8234ce39> 28500\n<8234cf30> <8234cf39> 28510\n<8234d030> <8234d039> 28520\n<8234d130> <8234d139> 28530\n<8234d230> <8234d239> 28540\n<8234d330> <8234d339> 28550\n<8234d430> <8234d439> 28560\n<8234d530> <8234d539> 28570\n<8234d630> <8234d639> 28580\n<8234d730> <8234d739> 28590\n<8234d830> <8234d839> 28600\n<8234d930> <8234d939> 28610\n<8234da30> <8234da39> 28620\n<8234db30> <8234db39> 28630\n<8234dc30> <8234dc39> 28640\n<8234dd30> <8234dd39> 28650\n<8234de30> <8234de39> 28660\n<8234df30> <8234df39> 28670\n<8234e030> <8234e039> 28680\n<8234e130> <8234e139> 28690\n<8234e230> <8234e239> 28700\n<8234e330> <8234e339> 28710\n<8234e430> <8234e439> 28720\n<8234e530> <8234e539> 28730\n<8234e630> <8234e639> 28740\n<8234e730> <8234e739> 28750\n<8234e830> <8234e839> 28760\n<8234e930> <8234e939> 28770\n<8234ea30> <8234ea39> 28780\n<8234eb30> <8234eb39> 28790\n<8234ec30> <8234ec39> 28800\n<8234ed30> <8234ed39> 28810\n<8234ee30> <8234ee39> 28820\n<8234ef30> <8234ef39> 28830\n<8234f030> <8234f039> 28840\n<8234f130> <8234f139> 28850\n<8234f230> <8234f239> 28860\n<8234f330> <8234f339> 28870\n<8234f430> <8234f439> 28880\n<8234f530> <8234f539> 28890\n<8234f630> <8234f639> 28900\n<8234f730> <8234f739> 28910\n<8234f830> <8234f839> 28920\n<8234f930> <8234f939> 28930\n<8234fa30> <8234fa39> 28940\n<8234fb30> <8234fb39> 28950\n<8234fc30> <8234fc39> 28960\n<8234fd30> <8234fd39> 28970\n<8234fe30> <8234fe39> 28980\n<82358130> <82358139> 28990\n<82358230> <82358239> 29000\n<82358330> <82358339> 29010\n<82358430> <82358439> 29020\n<82358530> <82358539> 29030\n<82358630> <82358639> 29040\n<82358730> <82358738> 29050\n<82359833> <82359839> 29064\n<82359930> <82359939> 29071\n<82359a30> <82359a39> 29081\n<82359b30> <82359b39> 29091\n<82359c30> <82359c39> 29101\n<82359d30> <82359d39> 29111\n<82359e30> <82359e39> 29121\n<82359f30> <82359f39> 29131\n<8235a030> <8235a039> 29141\n<8235a130> <8235a139> 29151\n<8235a230> <8235a239> 29161\n<8235a330> <8235a339> 29171\n<8235a430> <8235a439> 29181\n<8235a530> <8235a539> 29191\n<8235a630> <8235a639> 29201\n<8235a730> <8235a739> 29211\n<8235a830> <8235a839> 29221\n<8235a930> <8235a939> 29231\n<8235aa30> <8235aa39> 29241\n<8235ab30> <8235ab39> 29251\n<8235ac30> <8235ac39> 29261\n<8235ad30> <8235ad39> 29271\n<8235ae30> <8235ae39> 29281\nendcidrange\n\n100 begincidrange\n<8235af30> <8235af39> 29291\n<8235b030> <8235b039> 29301\n<8235b130> <8235b139> 29311\n<8235b230> <8235b239> 29321\n<8235b330> <8235b339> 29331\n<8235b430> <8235b439> 29341\n<8235b530> <8235b539> 29351\n<8235b630> <8235b639> 29361\n<8235b730> <8235b739> 29371\n<8235b830> <8235b839> 29381\n<8235b930> <8235b939> 29391\n<8235ba30> <8235ba39> 29401\n<8235bb30> <8235bb39> 29411\n<8235bc30> <8235bc39> 29421\n<8235bd30> <8235bd39> 29431\n<8235be30> <8235be39> 29441\n<8235bf30> <8235bf39> 29451\n<8235c030> <8235c039> 29461\n<8235c130> <8235c139> 29471\n<8235c230> <8235c239> 29481\n<8235c330> <8235c339> 29491\n<8235c430> <8235c439> 29501\n<8235c530> <8235c539> 29511\n<8235c630> <8235c639> 29521\n<8235c730> <8235c739> 29531\n<8235c830> <8235c839> 29541\n<8235c930> <8235c939> 29551\n<8235ca30> <8235ca39> 29561\n<8235cb30> <8235cb39> 29571\n<8235cc30> <8235cc39> 29581\n<8235cd30> <8235cd39> 29591\n<8235ce30> <8235ce39> 29601\n<8235cf30> <8235cf39> 29611\n<8235d030> <8235d039> 29621\n<8235d130> <8235d139> 29631\n<8235d230> <8235d239> 29641\n<8235d330> <8235d339> 29651\n<8235d430> <8235d439> 29661\n<8235d530> <8235d539> 29671\n<8235d630> <8235d639> 29681\n<8235d730> <8235d739> 29691\n<8235d830> <8235d839> 29701\n<8235d930> <8235d939> 29711\n<8235da30> <8235da39> 29721\n<8235db30> <8235db39> 29731\n<8235dc30> <8235dc39> 29741\n<8235dd30> <8235dd39> 29751\n<8235de30> <8235de39> 29761\n<8235df30> <8235df39> 29771\n<8235e030> <8235e039> 29781\n<8235e130> <8235e139> 29791\n<8235e230> <8235e239> 29801\n<8235e330> <8235e339> 29811\n<8235e430> <8235e439> 29821\n<8235e530> <8235e539> 29831\n<8235e630> <8235e639> 29841\n<8235e730> <8235e739> 29851\n<8235e830> <8235e839> 29861\n<8235e930> <8235e939> 29871\n<8235ea30> <8235ea39> 29881\n<8235eb30> <8235eb39> 29891\n<8235ec30> <8235ec39> 29901\n<8235ed30> <8235ed39> 29911\n<8235ee30> <8235ee39> 29921\n<8235ef30> <8235ef39> 29931\n<8235f030> <8235f039> 29941\n<8235f130> <8235f139> 29951\n<8235f230> <8235f239> 29961\n<8235f330> <8235f339> 29971\n<8235f430> <8235f439> 29981\n<8235f530> <8235f539> 29991\n<8235f630> <8235f639> 30001\n<8235f730> <8235f739> 30011\n<8235f830> <8235f839> 30021\n<8235f930> <8235f939> 30031\n<8235fa30> <8235fa39> 30041\n<8235fb30> <8235fb39> 30051\n<8235fc30> <8235fc39> 30061\n<8235fd30> <8235fd39> 30071\n<8235fe30> <8235fe39> 30081\n<82368130> <82368139> 30091\n<82368230> <82368239> 30101\n<82368330> <82368339> 30111\n<82368430> <82368439> 30121\n<82368530> <82368539> 30131\n<82368630> <82368639> 30141\n<82368730> <82368739> 30151\n<82368830> <82368839> 30161\n<82368930> <82368939> 30171\n<82368a30> <82368a39> 30181\n<82368b30> <82368b39> 30191\n<82368c30> <82368c39> 30201\n<82368d30> <82368d39> 30211\n<82368e30> <82368e37> 30221\n<82368f31> <82368f39> 30229\n<82369030> <82369039> 30238\n<82369130> <82369139> 30248\n<82369230> <82369239> 30258\n<82369330> <82369339> 30268\n<82369430> <82369435> 30278\nendcidrange\n\n100 begincidrange\n<8240> <8252> 10258\n<8254> <8261> 10277\n<8263> <8273> 10291\n<8275> <8279> 10308\n<827b> <827c> 10313\n<8281> <8282> 10316\n<8284> <828f> 10318\n<8291> <82a4> 10330\n<82a6> <82c7> 10350\n<82ca> <82e0> 10384\n<82e5> <82ec> 10408\n<82ee> <82f1> 10416\n<82f3> <82f6> 10420\n<82fc> <82fe> 10425\n<8342> <8344> 10429\n<8346> <8347> 10432\n<8349> <834b> 10434\n<834d> <8352> 10437\n<8354> <8356> 10443\n<8358> <835d> 10446\n<835f> <8364> 10452\n<8367> <8371> 10458\n<8373> <8377> 10469\n<8381> <8385> 10477\n<8387> <8388> 10482\n<838b> <838c> 10484\n<838e> <8393> 10486\n<8395> <839d> 10492\n<839f> <83a5> 10501\n<83a7> <83aa> 10508\n<83ac> <83ad> 10512\n<83b1> <83b9> 10514\n<83bb> <83c8> 10523\n<83ca> <83f5> 10537\n<83f7> <83fe> 10581\n<8440> <844f> 10589\n<8451> <8470> 10605\n<8472> <8473> 10637\n<8475> <8476> 10639\n<8478> <847e> 10641\n<8480> <8481> 10648\n<8483> <848d> 10650\n<848f> <8491> 10661\n<8494> <849c> 10664\n<849e> <84a0> 10673\n<84a7> <84a8> 10677\n<84aa> <84c4> 10679\n<84c6> <84d2> 10706\n<84db> <84dc> 10722\n<84de> <84e9> 10724\n<84eb> <84ed> 10736\n<84ef> <84f0> 10739\n<84f2> <84fe> 10741\n<8540> <8550> 10754\n<8555> <855d> 10772\n<855f> <8565> 10781\n<8567> <857e> 10788\n<8580> <8586> 10812\n<8588> <858a> 10819\n<858c> <8591> 10822\n<8593> <8595> 10828\n<8599> <85a1> 10832\n<85a3> <85b1> 10841\n<85b3> <85fe> 10856\n<8640> <8649> 10932\n<864b> <8653> 10942\n<8655> <8667> 10951\n<8669> <867e> 10970\n<8680> <8695> 10992\n<8697> <8698> 11014\n<869a> <86a0> 11016\n<86a2> <86c9> 11023\n<86cf> <86d0> 11065\n<86d2> <86db> 11067\n<86de> <86e0> 11077\n<86e2> <86e7> 11080\n<86e9> <86ed> 11086\n<86ef> <86f3> 11091\n<86f5> <86fe> 11096\n<8741> <8743> 11106\n<8745> <8748> 11109\n<874d> <874e> 11114\n<8750> <8756> 11116\n<8758> <8759> 11123\n<8761> <8765> 11127\n<8767> <8779> 11132\n<877b> <877c> 11151\n<8783> <8785> 11155\n<878b> <878c> 11160\n<878f> <8792> 11162\n<8794> <8797> 11166\n<8799> <879c> 11170\n<879e> <87a2> 11174\n<87a4> <87a6> 11179\n<87a8> <87b2> 11182\n<87b6> <87ba> 11194\n<87bc> <87be> 11199\n<87c3> <87c9> 11203\n<87cd> <87ce> 11210\n<87d0> <87d1> 11212\nendcidrange\n\n100 begincidrange\n<87d6> <87d9> 11215\n<87db> <87f6> 11219\n<87fb> <87fe> 11248\n<8842> <8843> 11252\n<8847> <887e> 11255\n<8880> <88b9> 11311\n<88bb> <88cb> 11369\n<88cd> <88d3> 11386\n<88d5> <88d6> 11393\n<88d8> <88de> 11395\n<88e0> <88e4> 11402\n<88e6> <88f1> 11407\n<88f4> <88f5> 11419\n<88f7> <88fe> 11421\n<8940> <894a> 11429\n<8951> <8953> 11442\n<8955> <895c> 11445\n<8960> <896c> 11454\n<896e> <8970> 11467\n<8972> <897b> 11470\n<897d> <897e> 11480\n<8980> <898a> 11482\n<898c> <8998> 11493\n<899a> <899d> 11506\n<899f> <89a5> 11510\n<89a9> <89ae> 11518\n<89b0> <89b9> 11524\n<89bb> <89bd> 11534\n<89c1> <89c3> 11537\n<89c9> <89cd> 11541\n<89cf> <89d0> 11546\n<89d2> <89d7> 11548\n<89d9> <89da> 11554\n<89dc> <89f3> 11556\n<89f5> <89fe> 11580\n<8a42> <8a58> 11591\n<8a5f> <8a78> 11616\n<8a7a> <8a7e> 11642\n<8a80> <8ae3> 11647\n<8ae5> <8afe> 11747\n<8b40> <8b43> 11773\n<8b45> <8b48> 11777\n<8b4a> <8b79> 11781\n<8b7b> <8b7e> 11829\n<8b80> <8b8b> 11833\n<8b8d> <8b9d> 11845\n<8b9f> <8bb2> 11862\n<8bb4> <8bb8> 11882\n<8bba> <8bbd> 11887\n<8bbf> <8bc5> 11891\n<8bca> <8bd3> 11899\n<8bd5> <8bdb> 11909\n<8bdd> <8be4> 11916\n<8be6> <8bea> 11924\n<8bec> <8bef> 11929\n<8bf1> <8bfe> 11933\n<8c40> <8c43> 11947\n<8c45> <8c4e> 11951\n<8c50> <8c56> 11961\n<8c58> <8c5b> 11968\n<8c5d> <8c7e> 11972\n<8c80> <8c8a> 12006\n<8c93> <8c98> 12019\n<8c9b> <8ca1> 12025\n<8ca8> <8cbf> 12033\n<8cc1> <8cd1> 12057\n<8cd6> <8cd8> 12075\n<8cda> <8cf8> 12078\n<8cfa> <8cfe> 12109\n<8d40> <8d72> 12114\n<8d76> <8d7a> 12166\n<8d7c> <8d7e> 12171\n<8d80> <8d87> 12174\n<8d89> <8d8e> 12182\n<8d90> <8d9d> 12188\n<8d9f> <8db8> 12202\n<8dba> <8de1> 12228\n<8de5> <8de6> 12269\n<8de8> <8df6> 12271\n<8df8> <8dfd> 12286\n<8e40> <8e45> 12292\n<8e47> <8e55> 12298\n<8e5b> <8e67> 12315\n<8e69> <8e6d> 12328\n<8e71> <8e7e> 12334\n<8e81> <8e9a> 12348\n<8e9c> <8e9e> 12374\n<8ea0> <8ea3> 12377\n<8ea5> <8ea6> 12381\n<8ea8> <8eab> 12383\n<8eaf> <8ebc> 12388\n<8ebf> <8ec2> 12402\n<8ec6> <8ecc> 12407\n<8ecf> <8ed5> 12414\n<8ed8> <8eeb> 12421\n<8eed> <8efe> 12441\n<8f40> <8f51> 12459\n<8f57> <8f5c> 12477\n<8f5e> <8f63> 12483\n<8f65> <8f7e> 12489\nendcidrange\n\n100 begincidrange\n<8f80> <8f85> 12515\n<8f89> <8f94> 12522\n<8f98> <8f9a> 12535\n<8f9e> <8fa0> 12539\n<8fa2> <8fbc> 12542\n<8fbe> <8fc3> 12569\n<8fc7> <8fcc> 12576\n<8fce> <8fd7> 12582\n<8fd9> <8ffe> 12592\n<9040> <907e> 12630\n<9080> <909c> 12693\n<909f> <90b9> 12722\n<90bb> <90bf> 12749\n<90c2> <90c4> 12754\n<90c6> <90da> 12757\n<90dd> <90ec> 12778\n<90ee> <90ef> 12794\n<90f1> <90f6> 12796\n<90f8> <90fe> 12802\n<9140> <9141> 12809\n<9143> <914a> 12811\n<914e> <9150> 12820\n<9152> <9153> 12823\n<9156> <9158> 12825\n<915b> <915c> 12828\n<915e> <9160> 12830\n<9164> <916d> 12834\n<916f> <9175> 12844\n<9177> <9179> 12851\n<917d> <917e> 12854\n<9180> <9183> 12856\n<9185> <918c> 12860\n<918e> <9190> 12868\n<9194> <9196> 12872\n<9198> <919a> 12875\n<919c> <91a8> 12878\n<91ac> <91b9> 12891\n<91bc> <91be> 12905\n<91c0> <91c2> 12908\n<91c4> <91cc> 12911\n<91ce> <91cf> 12920\n<91da> <91de> 12925\n<91e0> <91e1> 12930\n<91e3> <91e9> 12932\n<91eb> <91ef> 12939\n<91f3> <91fe> 12945\n<9240> <927e> 12957\n<9280> <92b5> 13020\n<92b7> <92cd> 13074\n<92d1> <92d3> 13098\n<92d5> <92de> 13101\n<92e1> <92fd> 13111\n<9340> <934f> 13140\n<9351> <935c> 13156\n<935e> <936f> 13168\n<9371> <9375> 13186\n<9377> <937e> 13191\n<9380> <938b> 13199\n<938d> <939c> 13211\n<939e> <93a4> 13227\n<93a8> <93b3> 13235\n<93b5> <93b7> 13247\n<93b9> <93ba> 13250\n<93be> <93c5> 13253\n<93c7> <93ce> 13261\n<93d0> <93d6> 13269\n<93d8> <93da> 13276\n<93dd> <93e0> 13279\n<93e2> <93e3> 13283\n<93e6> <93e8> 13285\n<93f2> <93f3> 13291\n<93f6> <93f9> 13293\n<93fb> <93fd> 13297\n<9440> <9443> 13300\n<9445> <944c> 13304\n<944e> <944f> 13312\n<9456> <9457> 13315\n<9459> <945a> 13317\n<9460> <9463> 13320\n<9467> <946d> 13325\n<946f> <9471> 13332\n<947b> <947e> 13339\n<9483> <9486> 13343\n<9489> <94a0> 13347\n<94a2> <94b2> 13371\n<94b6> <94be> 13389\n<94c1> <94cb> 13398\n<94cd> <94d7> 13409\n<94d9> <94df> 13420\n<94e1> <94fe> 13427\n<9540> <9571> 13457\n<9573> <957e> 13507\n<9580> <9582> 13519\n<9584> <959d> 13522\n<95a0> <95b2> 13548\n<95b4> <95b9> 13567\n<95bb> <95ce> 13573\n<95d5> <95e0> 13595\n<95e2> <95e6> 13607\n<95e8> <95f0> 13612\nendcidrange\n\n100 begincidrange\n<95f2> <95f7> 13621\n<95f9> <95fd> 13627\n<9640> <9655> 13632\n<9657> <967b> 13654\n<967d> <967e> 13691\n<9680> <96fe> 13693\n<9740> <9766> 13820\n<9768> <976b> 13859\n<976f> <977e> 13864\n<9780> <9795> 13880\n<9798> <979c> 13902\n<979e> <97a2> 13907\n<97a4> <97be> 13912\n<97c0> <97ed> 13939\n<97ef> <97f6> 13985\n<97f8> <97fe> 13993\n<9840> <9844> 14000\n<9846> <9848> 14005\n<984a> <984e> 14008\n<9850> <9870> 14013\n<9874> <987e> 14047\n<9882> <988a> 14059\n<988d> <989f> 14068\n<98a1> <98a9> 14087\n<98ab> <98b5> 14096\n<98b8> <98b9> 14107\n<98bb> <98c6> 14109\n<98c8> <98ca> 14121\n<98cc> <98cf> 14124\n<98d1> <98d2> 14128\n<98d4> <98e2> 14130\n<98e6> <98ee> 14145\n<98f0> <98f1> 14154\n<98f3> <98fe> 14156\n<9940> <9942> 14168\n<9946> <9965> 14172\n<9967> <996d> 14204\n<996f> <9974> 14211\n<9976> <9979> 14217\n<997c> <997e> 14221\n<9980> <9984> 14224\n<9986> <9988> 14229\n<998a> <998d> 14232\n<998f> <9990> 14236\n<9992> <9998> 14238\n<999a> <99a8> 14245\n<99aa> <99af> 14260\n<99b6> <99bc> 14267\n<99c3> <99c8> 14276\n<99ca> <99cd> 14282\n<99cf> <99d0> 14286\n<99d2> <99d9> 14288\n<99db> <99df> 14296\n<99e1> <99e4> 14301\n<99e6> <99e7> 14305\n<99e9> <99eb> 14307\n<99ed> <99f3> 14310\n<99f5> <99fe> 14317\n<9a40> <9a49> 14327\n<9a4b> <9a56> 14337\n<9a58> <9a64> 14349\n<9a68> <9a70> 14363\n<9a72> <9a75> 14372\n<9a78> <9a7e> 14376\n<9a80> <9a87> 14383\n<9a89> <9a8b> 14391\n<9a8d> <9a90> 14394\n<9a92> <9a96> 14398\n<9a98> <9a99> 14403\n<9a9c> <9a9d> 14405\n<9a9f> <9aa1> 14407\n<9aa4> <9aa9> 14410\n<9aab> <9acf> 14416\n<9ad1> <9ad5> 14453\n<9ad7> <9ad9> 14458\n<9adb> <9ae1> 14461\n<9ae6> <9afe> 14469\n<9b40> <9b7e> 14494\n<9b80> <9bd0> 14557\n<9bd2> <9bdb> 14638\n<9bdd> <9bfe> 14648\n<9c40> <9c52> 14682\n<9c54> <9c58> 14701\n<9c5d> <9c74> 14707\n<9c76> <9c78> 14731\n<9c7a> <9c7e> 14734\n<9c80> <9c85> 14739\n<9c87> <9c9c> 14745\n<9c9e> <9caa> 14767\n<9cac> <9cc9> 14780\n<9ccb> <9cce> 14810\n<9cd0> <9ce5> 14814\n<9ce8> <9ceb> 14836\n<9cef> <9cfa> 14841\n<9cfc> <9cfd> 14853\n<9d40> <9d41> 14855\n<9d43> <9d45> 14857\n<9d48> <9d4c> 14860\n<9d50> <9d60> 14866\n<9d62> <9d67> 14883\nendcidrange\n\n100 begincidrange\n<9d6a> <9d6d> 14889\n<9d6f> <9d70> 14893\n<9d72> <9d74> 14895\n<9d76> <9d7a> 14898\n<9d80> <9d89> 14905\n<9d8b> <9d8c> 14915\n<9d8e> <9d90> 14917\n<9d92> <9d98> 14920\n<9d9a> <9da0> 14927\n<9da3> <9da6> 14934\n<9da8> <9dab> 14938\n<9dae> <9db1> 14942\n<9db4> <9dbd> 14946\n<9dbf> <9dc5> 14956\n<9dc7> <9dc8> 14963\n<9dca> <9dcc> 14965\n<9dce> <9dd1> 14968\n<9dd3> <9dd4> 14972\n<9dd6> <9de0> 14974\n<9de3> <9df0> 14985\n<9df2> <9df3> 14999\n<9df5> <9df6> 15001\n<9df8> <9df9> 15003\n<9dfb> <9dfc> 15005\n<9e40> <9e44> 15008\n<9e46> <9e47> 15013\n<9e4a> <9e51> 15015\n<9e57> <9e5c> 15025\n<9e5f> <9e60> 15031\n<9e64> <9e66> 15034\n<9e68> <9e6b> 15037\n<9e6d> <9e6e> 15041\n<9e70> <9e71> 15043\n<9e76> <9e7a> 15046\n<9e7d> <9e7e> 15051\n<9e80> <9e84> 15053\n<9e88> <9e90> 15059\n<9e92> <9e95> 15068\n<9e98> <9ea1> 15072\n<9ea3> <9ea5> 15082\n<9ea7> <9ea8> 15085\n<9eaa> <9ead> 15087\n<9eaf> <9eb2> 15091\n<9eb5> <9eb6> 15095\n<9eb8> <9ef4> 15097\n<9ef6> <9efe> 15158\n<9f40> <9f4d> 15167\n<9f4f> <9f6e> 15181\n<9f70> <9f7e> 15213\n<9f80> <9f91> 15228\n<9f93> <9f97> 15246\n<9f99> <9fa5> 15251\n<9fa7> <9fa8> 15264\n<9faa> <9fab> 15266\n<9fad> <9fc8> 15268\n<9fca> <9fcc> 15296\n<9fce> <9fe0> 15299\n<9fe2> <9fea> 15318\n<9fec> <9fed> 15327\n<9fef> <9ff3> 15329\n<9ff5> <9ffc> 15334\n<a040> <a042> 15343\n<a044> <a045> 15346\n<a047> <a048> 15348\n<a04a> <a04d> 15350\n<a04f> <a053> 15354\n<a055> <a059> 15359\n<a05b> <a060> 15364\n<a064> <a070> 15371\n<a072> <a073> 15384\n<a075> <a07e> 15386\n<a081> <a090> 15396\n<a092> <a093> 15412\n<a097> <a0a8> 15415\n<a0aa> <a0be> 15433\n<a0c0> <a0cd> 15454\n<a0cf> <a0d8> 15468\n<a0da> <a0dd> 15478\n<a0df> <a0ed> 15482\n<a0ef> <a0fe> 15497\n<a1a1> <a1fe> 96\n<a2a1> <a2aa> 9897\n<a2b1> <a2e2> 190\n<a2e5> <a2ee> 240\n<a2f1> <a2fc> 250\n<a3a1> <a3fe> 262\n<a4a1> <a4f3> 356\n<a5a1> <a5f6> 439\n<a6a1> <a6b8> 525\n<a6c1> <a6f5> 549\n<a7a1> <a7c1> 602\n<a7d1> <a7f1> 635\n<a840> <a87e> 9907\n<a880> <a895> 9970\n<a8a1> <a8c0> 668\n<a8c5> <a8ea> 700\n<a940> <a957> 9992\n<a959> <a95a> 10016\n<a960> <a97e> 10019\n<a980> <a995> 10050\nendcidrange\n\n100 begincidrange\n<a9a4> <a9ef> 738\n<aa40> <aa4c> 15513\n<aa4f> <aa70> 15526\n<aa74> <aa76> 15561\n<aa78> <aa79> 15564\n<aa7c> <aa7e> 15566\n<aa80> <aa99> 15569\n<aaa1> <aafe> 814\n<ab41> <ab42> 15598\n<ab4b> <ab4c> 15602\n<ab4e> <ab7e> 15604\n<ab80> <aba0> 15653\n<aba1> <abc0> 908\n<ac40> <ac45> 15686\n<ac47> <ac70> 15692\n<ac72> <ac7b> 15734\n<ac7d> <ac7e> 15744\n<ac80> <ac8c> 15746\n<ac8e> <ac92> 15759\n<ac95> <aca0> 15764\n<ad40> <ad48> 15776\n<ad4a> <ad5d> 15785\n<ad5f> <ad60> 15805\n<ad62> <ad67> 15807\n<ad69> <ad73> 15813\n<ad75> <ad7e> 15824\n<ad80> <ad81> 15834\n<ad83> <ad86> 15836\n<ad88> <ad8a> 15840\n<ad8c> <ad90> 15843\n<ad92> <ada0> 15848\n<ae40> <ae53> 15863\n<ae55> <ae61> 15883\n<ae63> <ae7e> 15896\n<ae81> <ae84> 15924\n<ae86> <ae8a> 15928\n<ae8c> <ae93> 15933\n<ae95> <ae9f> 15941\n<af40> <af63> 15952\n<af65> <af7a> 15988\n<af7c> <af7e> 16010\n<af80> <af81> 16013\n<af84> <af8d> 16015\n<af92> <af9b> 16026\n<af9d> <af9e> 16036\n<b041> <b042> 9647\n<b045> <b04e> 16041\n<b050> <b053> 16051\n<b055> <b056> 16055\n<b060> <b061> 9652\n<b065> <b06b> 16060\n<b06d> <b07c> 16067\n<b080> <b096> 16084\n<b09a> <b0a0> 16108\n<b0a1> <b0fe> 940\n<b140> <b14a> 16115\n<b153> <b17e> 16129\n<b180> <b196> 16173\n<b198> <b1a0> 16196\n<b1a1> <b1fe> 1034\n<b242> <b266> 16206\n<b268> <b26c> 16243\n<b26e> <b273> 16248\n<b275> <b27e> 16254\n<b281> <b288> 16264\n<b28a> <b299> 16272\n<b29b> <b2a0> 16288\n<b2a1> <b2fe> 1128\n<b340> <b342> 16294\n<b344> <b36f> 16297\n<b371> <b37e> 16341\n<b380> <b387> 16355\n<b389> <b38b> 16363\n<b38f> <b3a0> 16367\n<b3a1> <b3fe> 1222\n<b440> <b453> 16385\n<b455> <b457> 16405\n<b459> <b45d> 16408\n<b462> <b474> 16414\n<b476> <b47d> 16433\n<b480> <b482> 16441\n<b484> <b488> 16444\n<b48a> <b492> 16449\n<b494> <b4a0> 16458\n<b4a1> <b4fe> 1316\n<b542> <b54a> 16472\n<b54c> <b555> 16481\n<b557> <b559> 16491\n<b55d> <b560> 16494\n<b562> <b57e> 16498\n<b580> <b59b> 16527\n<b59e> <b5a0> 16555\n<b5a1> <b5fe> 1410\n<b640> <b651> 16558\n<b653> <b654> 16576\n<b656> <b658> 16578\n<b65d> <b67e> 16582\n<b680> <b6a0> 16616\n<b6a1> <b6fe> 1504\n<b740> <b74d> 16649\nendcidrange\n\n100 begincidrange\n<b74f> <b750> 16663\n<b752> <b758> 16665\n<b75a> <b763> 16672\n<b767> <b776> 16682\n<b779> <b77e> 16698\n<b783> <b7a0> 16705\n<b7a1> <b7fe> 1598\n<b840> <b842> 16735\n<b847> <b84c> 16739\n<b84e> <b850> 16745\n<b852> <b859> 16748\n<b861> <b876> 16758\n<b878> <b87e> 16780\n<b880> <b881> 16787\n<b883> <b8a0> 16789\n<b8a1> <b8fe> 1692\n<b940> <b94f> 16819\n<b951> <b960> 16835\n<b962> <b97a> 16851\n<b97c> <b97e> 16876\n<b980> <b99c> 16879\n<b99e> <b99f> 16908\n<b9a1> <b9fe> 1786\n<ba40> <ba41> 16910\n<ba45> <ba55> 16913\n<ba57> <ba58> 16930\n<ba5a> <ba5f> 16932\n<ba61> <ba69> 16938\n<ba6b> <ba73> 16947\n<ba75> <ba7e> 16956\n<ba80> <ba83> 16966\n<ba89> <ba8c> 16972\n<ba8e> <ba9d> 16976\n<baa1> <bafe> 1880\n<bb41> <bb48> 16993\n<bb4a> <bb57> 17001\n<bb59> <bb5a> 17015\n<bb5d> <bb5f> 17017\n<bb61> <bb64> 17020\n<bb6b> <bb6d> 17026\n<bb6f> <bb7e> 17029\n<bb80> <bba0> 17045\n<bba1> <bbfe> 1974\n<bc40> <bc51> 17078\n<bc54> <bc59> 17096\n<bc5b> <bc60> 17102\n<bc6a> <bc6c> 17112\n<bc76> <bc77> 9246\n<bc7c> <bc7d> 17119\n<bc80> <bc81> 17121\n<bc8c> <bc8e> 17125\n<bc90> <bc99> 17128\n<bc9e> <bca0> 17138\n<bca1> <bcfe> 2068\n<bd40> <bd41> 17141\n<bd46> <bd47> 17144\n<bd50> <bd56> 17149\n<bd5a> <bd65> 17157\n<bd68> <bd69> 17169\n<bd6c> <bd6e> 17171\n<bd72> <bd78> 17175\n<bd7c> <bd7d> 17182\n<bd82> <bd88> 17185\n<bd8c> <bd8d> 17193\n<bd92> <bd96> 17196\n<bd98> <bd9a> 17201\n<bd9c> <bda0> 17204\n<bda1> <bdfe> 2162\n<be40> <be42> 17209\n<be46> <be48> 17213\n<be4b> <be50> 17216\n<be5a> <be5c> 17223\n<be65> <be68> 17227\n<be6a> <be6b> 17231\n<be6d> <be6e> 17233\n<be71> <be75> 17235\n<be7a> <be7b> 17241\n<be80> <be82> 17243\n<be8a> <be8b> 17248\n<be90> <be91> 17251\n<be93> <be94> 17253\n<be9d> <be9e> 17258\n<bea1> <befe> 2256\n<bf41> <bf4c> 17261\n<bf51> <bf54> 17273\n<bf57> <bf5f> 17277\n<bf65> <bf67> 17287\n<bf69> <bf6b> 17290\n<bf6d> <bf6f> 17293\n<bf74> <bf75> 17297\n<bf80> <bf81> 17301\n<bf84> <bf88> 17303\n<bf8b> <bf94> 17308\n<bf99> <bf9c> 17319\n<bf9e> <bfa0> 17323\n<bfa1> <bffe> 2350\n<c041> <c043> 17326\n<c045> <c04a> 17329\n<c053> <c054> 17336\n<c056> <c05a> 17338\nendcidrange\n\n100 begincidrange\n<c05c> <c05d> 17343\n<c061> <c068> 17345\n<c071> <c073> 17356\n<c07a> <c07b> 17361\n<c07d> <c07e> 17363\n<c080> <c09a> 17365\n<c09e> <c0a0> 17393\n<c0a1> <c0fe> 2444\n<c140> <c14f> 17396\n<c151> <c153> 17412\n<c155> <c15e> 17415\n<c163> <c174> 17426\n<c176> <c177> 17444\n<c179> <c17e> 17446\n<c180> <c194> 17452\n<c196> <c1a0> 17473\n<c1a1> <c1fe> 2538\n<c240> <c24d> 17484\n<c24f> <c264> 17498\n<c268> <c27c> 17521\n<c280> <c283> 17543\n<c285> <c292> 17547\n<c29d> <c29f> 17563\n<c2a1> <c2fe> 2632\n<c341> <c342> 17566\n<c344> <c37a> 17568\n<c37c> <c37e> 17623\n<c380> <c383> 17626\n<c385> <c39a> 17630\n<c39c> <c3a0> 17652\n<c3a1> <c3fe> 2726\n<c440> <c448> 17657\n<c44a> <c44b> 17666\n<c44d> <c453> 17668\n<c455> <c457> 17675\n<c459> <c45a> 17678\n<c45c> <c462> 17680\n<c464> <c476> 17687\n<c478> <c479> 17706\n<c47b> <c47e> 17708\n<c482> <c490> 17713\n<c494> <c497> 17728\n<c49d> <c4a0> 17734\n<c4a1> <c4fe> 2820\n<c540> <c543> 17738\n<c547> <c54a> 17743\n<c54d> <c551> 17747\n<c553> <c55e> 17752\n<c560> <c562> 17764\n<c567> <c57e> 17767\n<c580> <c592> 17791\n<c594> <c59b> 17810\n<c59f> <c5a0> 17819\n<c5a1> <c5fe> 2914\n<c642> <c643> 17822\n<c645> <c646> 17824\n<c648> <c662> 17826\n<c664> <c671> 17853\n<c673> <c67e> 17867\n<c680> <c6a0> 17879\n<c6a1> <c6fe> 3008\n<c740> <c765> 17912\n<c767> <c76e> 17950\n<c770> <c775> 17958\n<c777> <c77a> 17964\n<c77c> <c77e> 17968\n<c780> <c7a0> 17971\n<c7a1> <c7fe> 3102\n<c842> <c84e> 18005\n<c850> <c851> 18018\n<c853> <c865> 18020\n<c867> <c86d> 18039\n<c86f> <c87d> 18046\n<c880> <c886> 18061\n<c888> <c891> 18068\n<c895> <c898> 18079\n<c89a> <c89c> 18083\n<c89e> <c8a0> 18086\n<c8a1> <c8fe> 3196\n<c940> <c94e> 18089\n<c951> <c96d> 18104\n<c971> <c976> 18134\n<c978> <c97e> 18140\n<c980> <c98e> 18147\n<c991> <c99b> 18162\n<c99d> <c9a0> 18173\n<c9a1> <c9fe> 3290\n<ca40> <ca4d> 18177\n<ca4f> <ca55> 18191\n<ca57> <ca58> 18198\n<ca5a> <ca5b> 18200\n<ca5d> <ca60> 18202\n<ca62> <ca6d> 18206\n<ca6f> <ca71> 18218\n<ca73> <ca76> 18221\n<ca78> <ca7a> 18225\n<ca82> <ca88> 18230\n<ca8a> <ca8d> 18237\n<ca90> <ca91> 18241\n<ca93> <ca99> 18243\nendcidrange\n\n100 begincidrange\n<ca9b> <caa0> 18250\n<caa1> <cafe> 3384\n<cb40> <cb42> 18256\n<cb48> <cb4a> 18261\n<cb4c> <cb4d> 18264\n<cb4f> <cb56> 18266\n<cb58> <cb5c> 18274\n<cb60> <cb69> 18280\n<cb6b> <cb7a> 18290\n<cb7d> <cb7e> 18306\n<cb80> <cb86> 18308\n<cb88> <cb8d> 18315\n<cb8f> <cb91> 18321\n<cb93> <cb9b> 18324\n<cb9f> <cba0> 18334\n<cba1> <cbfe> 3478\n<cc42> <cc48> 18336\n<cc4c> <cc4e> 18343\n<cc50> <cc5b> 18346\n<cc5d> <cc5f> 18358\n<cc61> <cc63> 18361\n<cc65> <cc6c> 18364\n<cc6e> <cc78> 18372\n<cc7a> <cc7c> 18383\n<cc80> <cc8d> 18387\n<cc8f> <cc93> 18401\n<cc97> <cc9c> 18407\n<cc9e> <cca0> 18413\n<cca1> <ccfe> 3572\n<cd40> <cd7e> 18416\n<cd80> <cd8f> 18479\n<cd91> <cd97> 18495\n<cd99> <cda0> 18502\n<cda1> <cdfe> 3666\n<ce40> <ce66> 18510\n<ce68> <ce71> 18549\n<ce73> <ce7e> 18559\n<ce82> <ce86> 18572\n<ce88> <ce9a> 18577\n<ce9c> <ce9d> 18596\n<ce9f> <cea0> 18598\n<cea1> <cefe> 3760\n<cf40> <cf4d> 18600\n<cf4f> <cf54> 18614\n<cf56> <cf57> 18620\n<cf59> <cf5b> 18622\n<cf5d> <cf6b> 18625\n<cf6d> <cf72> 18640\n<cf76> <cf77> 18647\n<cf79> <cf7b> 18649\n<cf7d> <cf7e> 18652\n<cf82> <cf88> 18655\n<cf8b> <cf92> 18662\n<cf95> <cf9d> 18670\n<cfa1> <cffe> 3854\n<d040> <d04c> 18680\n<d04e> <d050> 18693\n<d052> <d054> 18696\n<d056> <d05b> 18699\n<d05d> <d05f> 18705\n<d061> <d066> 18708\n<d068> <d06b> 18714\n<d06f> <d07c> 18719\n<d080> <d0a0> 18734\n<d0a1> <d0fe> 3948\n<d140> <d154> 18767\n<d156> <d158> 18788\n<d15a> <d160> 18791\n<d163> <d174> 18798\n<d176> <d17c> 18816\n<d180> <d19c> 18824\n<d19f> <d1a0> 18853\n<d1a1> <d1fe> 4042\n<d241> <d242> 18855\n<d244> <d24c> 18857\n<d24e> <d25b> 18866\n<d25d> <d262> 18880\n<d265> <d267> 18886\n<d269> <d26c> 18889\n<d270> <d271> 18894\n<d273> <d274> 18896\n<d276> <d27e> 18898\n<d280> <d289> 18907\n<d28b> <d28d> 18917\n<d28f> <d291> 18920\n<d293> <d294> 18923\n<d298> <d29f> 18926\n<d2a1> <d2fe> 4136\n<d340> <d343> 18934\n<d345> <d347> 18938\n<d34b> <d34c> 18942\n<d34e> <d34f> 18944\n<d351> <d354> 18946\n<d356> <d357> 18950\n<d359> <d35a> 18952\n<d35f> <d377> 18955\n<d37d> <d37e> 18982\n<d380> <d384> 18984\n<d388> <d38a> 18989\n<d394> <d395> 18996\nendcidrange\n\n100 begincidrange\n<d39c> <d39d> 19000\n<d3a1> <d3fe> 4230\n<d442> <d444> 19004\n<d448> <d44b> 19008\n<d44d> <d44e> 19012\n<d450> <d452> 19014\n<d454> <d455> 19017\n<d459> <d45b> 19020\n<d45d> <d461> 19023\n<d463> <d466> 19028\n<d468> <d46d> 19032\n<d476> <d477> 19041\n<d479> <d47a> 19043\n<d47c> <d47d> 19045\n<d480> <d481> 19047\n<d485> <d486> 19049\n<d488> <d489> 19051\n<d497> <d49b> 19056\n<d49d> <d49e> 19061\n<d4a1> <d4fe> 4324\n<d540> <d542> 19064\n<d547> <d549> 19067\n<d54b> <d54d> 19070\n<d54e> <d54f> 8953\n<d552> <d553> 19074\n<d557> <d559> 19077\n<d565> <d567> 19083\n<d569> <d56b> 19086\n<d56f> <d571> 19090\n<d573> <d574> 19093\n<d576> <d577> 19095\n<d579> <d57a> 19097\n<d57c> <d57d> 19099\n<d582> <d583> 19102\n<d590> <d592> 19109\n<d595> <d597> 19112\n<d59c> <d59e> 19116\n<d5a1> <d5fe> 4418\n<d644> <d646> 19121\n<d64b> <d64c> 19125\n<d650> <d651> 19128\n<d662> <d664> 19135\n<d666> <d668> 19138\n<d66c> <d66e> 19142\n<d679> <d67b> 19148\n<d67d> <d67e> 19151\n<d680> <d682> 19153\n<d684> <d685> 19156\n<d689> <d68d> 19158\n<d68f> <d693> 19163\n<d695> <d698> 19168\n<d69a> <d6a0> 19172\n<d6a1> <d6fe> 4512\n<d740> <d742> 19179\n<d744> <d747> 19182\n<d74a> <d74f> 19186\n<d757> <d763> 19194\n<d765> <d766> 19207\n<d769> <d76b> 19209\n<d76d> <d76e> 19212\n<d770> <d774> 19214\n<d776> <d777> 19219\n<d779> <d77e> 19221\n<d780> <d782> 19227\n<d784> <d786> 19230\n<d788> <d78a> 19233\n<d790> <d794> 19237\n<d798> <d7a0> 19243\n<d7a1> <d7f9> 4606\n<d840> <d84c> 19252\n<d84e> <d852> 19265\n<d854> <d87e> 19270\n<d880> <d88f> 19313\n<d896> <d899> 19330\n<d8a1> <d8fe> 4695\n<d95d> <d962> 19342\n<d968> <d96b> 19349\n<d97a> <d97b> 19357\n<d981> <d986> 19359\n<d988> <d98c> 19365\n<d992> <d996> 19370\n<d999> <d99a> 19375\n<d9a1> <d9fe> 4789\n<da43> <da47> 19380\n<da49> <da4c> 19385\n<da4f> <da72> 19389\n<da74> <da76> 19425\n<da78> <da7e> 19428\n<da80> <da84> 19435\n<da86> <da8d> 19440\n<da8f> <daa0> 19448\n<daa1> <dafe> 4883\n<db40> <db5f> 19466\n<db61> <db77> 19498\n<db79> <db7e> 19521\n<db80> <db83> 19527\n<db85> <db8a> 19531\n<db8c> <db97> 19537\n<db99> <dba0> 19549\n<dba1> <dbfe> 4977\nendcidrange\n\n100 begincidrange\n<dc40> <dc44> 19557\n<dc46> <dc4e> 19562\n<dc58> <dc5c> 19573\n<dc5e> <dc61> 19578\n<dc63> <dc65> 19582\n<dc68> <dc6a> 19585\n<dc6c> <dc7b> 19588\n<dc7d> <dc7e> 19604\n<dc80> <dc86> 19606\n<dc8b> <dc8d> 19613\n<dc91> <dc96> 19617\n<dc98> <dc9a> 19623\n<dc9c> <dc9f> 19626\n<dca1> <dcfe> 5071\n<dd40> <dd45> 19630\n<dd47> <dd4c> 19636\n<dd4e> <dd52> 19642\n<dd5a> <dd5d> 19648\n<dd66> <dd6c> 19655\n<dd71> <dd75> 19663\n<dd79> <dd7a> 9373\n<dd7b> <dd7e> 19668\n<dd83> <dd84> 19673\n<dd87> <dd8a> 19675\n<dd8c> <dd8e> 19679\n<dd90> <dd93> 19682\n<dd95> <dd96> 19686\n<dd98> <dd99> 19688\n<dd9c> <dd9d> 19690\n<dda1> <ddfe> 5165\n<de42> <de43> 19693\n<de45> <de47> 19695\n<de4a> <de4e> 19698\n<de50> <de59> 19703\n<de60> <de6a> 19715\n<de6c> <de6e> 19726\n<de73> <de7e> 19729\n<de80> <de91> 19741\n<de93> <de9e> 19759\n<dea1> <defe> 5259\n<df43> <df4c> 19773\n<df4e> <df5b> 19783\n<df61> <df63> 19798\n<df69> <df6c> 19803\n<df6e> <df73> 19807\n<df75> <df76> 19813\n<df81> <df82> 19818\n<df86> <df88> 19821\n<df8b> <dfa0> 19824\n<dfa1> <dffe> 5353\n<e040> <e04f> 19846\n<e051> <e05c> 19862\n<e05e> <e068> 19874\n<e06a> <e06b> 19885\n<e06d> <e074> 19887\n<e07a> <e07e> 19897\n<e080> <e086> 19902\n<e088> <e08c> 19909\n<e095> <e096> 19917\n<e098> <e0a0> 19919\n<e0a1> <e0fe> 5447\n<e140> <e141> 19928\n<e143> <e163> 19930\n<e165> <e167> 19963\n<e169> <e173> 19966\n<e176> <e17e> 19977\n<e180> <e183> 19986\n<e18a> <e18b> 19992\n<e18e> <e190> 9459\n<e196> <e197> 19996\n<e199> <e19d> 19998\n<e1a1> <e1fe> 5541\n<e244> <e24e> 20006\n<e255> <e259> 20019\n<e25c> <e25d> 20024\n<e25f> <e261> 20026\n<e264> <e266> 20029\n<e26c> <e26d> 20033\n<e270> <e277> 20035\n<e279> <e27c> 20043\n<e283> <e288> 20048\n<e28c> <e28d> 20055\n<e290> <e291> 20057\n<e296> <e297> 20059\n<e29c> <e29f> 20061\n<e2a1> <e2fe> 5635\n<e340> <e341> 20065\n<e344> <e346> 20067\n<e348> <e34a> 20070\n<e34c> <e34e> 20073\n<e352> <e353> 20077\n<e356> <e357> 20079\n<e359> <e35b> 20081\n<e35d> <e35f> 20084\n<e361> <e365> 20087\n<e366> <e367> 9489\n<e368> <e370> 20092\n<e375> <e377> 20102\n<e37a> <e37b> 20105\n<e380> <e389> 20108\nendcidrange\n\n100 begincidrange\n<e38d> <e38e> 20119\n<e396> <e398> 20124\n<e39a> <e39b> 20127\n<e3a1> <e3fe> 5729\n<e445> <e447> 20131\n<e449> <e44d> 20134\n<e454> <e457> 20141\n<e45f> <e461> 20148\n<e463> <e464> 20151\n<e466> <e467> 20153\n<e469> <e472> 20155\n<e476> <e478> 20166\n<e482> <e483> 20171\n<e489> <e48c> 20173\n<e490> <e492> 20178\n<e494> <e497> 20181\n<e499> <e49c> 20185\n<e49e> <e49f> 9551\n<e4a1> <e4fe> 5823\n<e540> <e545> 20190\n<e549> <e54a> 20197\n<e54c> <e54d> 20199\n<e552> <e554> 20201\n<e559> <e55b> 20205\n<e55f> <e560> 20209\n<e562> <e563> 20211\n<e566> <e567> 20213\n<e56a> <e56b> 20215\n<e56f> <e574> 20218\n<e579> <e57a> 20225\n<e57d> <e57e> 20227\n<e584> <e589> 20231\n<e58b> <e58d> 20237\n<e58f> <e590> 20240\n<e592> <e599> 20242\n<e59c> <e59e> 20250\n<e5a1> <e5fe> 5917\n<e641> <e643> 20254\n<e645> <e648> 20257\n<e64b> <e64d> 20261\n<e64f> <e651> 20264\n<e653> <e655> 20267\n<e659> <e65a> 20271\n<e65c> <e65d> 20273\n<e65f> <e668> 20275\n<e66c> <e674> 20286\n<e677> <e678> 20295\n<e685> <e686> 20301\n<e68a> <e68b> 20304\n<e68d> <e692> 20306\n<e694> <e696> 20312\n<e698> <e69a> 20315\n<e69d> <e69e> 20318\n<e6a1> <e6fe> 6011\n<e740> <e742> 20320\n<e744> <e747> 20323\n<e74a> <e74c> 20327\n<e74d> <e74e> 9576\n<e756> <e758> 20332\n<e75a> <e765> 20335\n<e76b> <e773> 20349\n<e775> <e77b> 20358\n<e77d> <e77e> 20365\n<e780> <e781> 20367\n<e787> <e789> 20370\n<e78c> <e78e> 20373\n<e790> <e791> 20376\n<e793> <e797> 20378\n<e798> <e799> 9537\n<e79b> <e79f> 20383\n<e7a1> <e7fe> 6105\n<e840> <e842> 20388\n<e847> <e848> 20392\n<e84c> <e84e> 20395\n<e850> <e853> 20398\n<e855> <e859> 20402\n<e85d> <e861> 20408\n<e865> <e86f> 20414\n<e871> <e872> 20425\n<e876> <e87b> 20428\n<e87d> <e87e> 20434\n<e883> <e886> 20437\n<e88a> <e88b> 20442\n<e890> <e8a0> 20444\n<e8a1> <e8fe> 6199\n<e940> <e94b> 20461\n<e94d> <e953> 20473\n<e958> <e959> 20481\n<e95b> <e95c> 20483\n<e969> <e96b> 20489\n<e96d> <e974> 20492\n<e97a> <e97b> 20501\n<e983> <e986> 20504\n<e988> <e98a> 20508\n<e98c> <e98d> 20511\n<e995> <e997> 20514\n<e999> <e99a> 20517\n<e9a1> <e9fe> 6293\n<ea41> <ea43> 20521\n<ea45> <ea47> 20524\nendcidrange\n\n100 begincidrange\n<ea4b> <ea4f> 20527\n<ea53> <ea54> 20533\n<ea57> <ea58> 20535\n<ea5a> <ea7e> 20537\n<ea81> <ea83> 20574\n<ea85> <ea86> 20577\n<ea88> <ea8d> 20579\n<ea92> <ea95> 20586\n<ea97> <ea9f> 20590\n<eaa1> <eafe> 6387\n<eb42> <eb44> 20600\n<eb46> <eb47> 20603\n<eb49> <eb52> 20605\n<eb56> <eb5a> 20616\n<eb5e> <eb5f> 20622\n<eb63> <eb6c> 20625\n<eb6e> <eb6f> 20635\n<eb74> <eb77> 20638\n<eb7a> <eb7e> 20642\n<eb80> <eb84> 20647\n<eb86> <eb89> 20652\n<eb8b> <eba0> 20656\n<eba1> <ebfe> 6481\n<ec40> <ec45> 20678\n<ec47> <ec55> 20684\n<ec57> <ec59> 20699\n<ec5d> <ec5f> 20703\n<ec61> <ec6d> 20706\n<ec6f> <ec75> 20719\n<ec77> <ec7e> 20726\n<ec80> <ec95> 20734\n<ec97> <eca0> 20756\n<eca1> <ecfe> 6575\n<ed40> <ed45> 20766\n<ed47> <ed57> 20772\n<ed59> <ed5d> 20789\n<ed5f> <ed60> 20794\n<ed62> <ed63> 20796\n<ed68> <ed6d> 20799\n<ed6f> <ed73> 20805\n<ed75> <ed76> 20810\n<ed7a> <ed7e> 20813\n<ed80> <ed90> 20818\n<eda1> <edfe> 6669\n<ee45> <ee47> 20840\n<ee4a> <ee4c> 20843\n<ee4e> <ee51> 20846\n<ee53> <ee54> 20850\n<ee58> <ee5d> 20853\n<ee5f> <ee60> 20859\n<ee62> <ee67> 20861\n<ee6a> <ee6b> 20867\n<ee6f> <ee76> 20870\n<ee78> <ee7c> 20878\n<ee81> <ee84> 20883\n<ee87> <ee89> 20887\n<ee8e> <ee8f> 20891\n<ee91> <ee93> 20893\n<ee95> <ee96> 20896\n<ee9a> <ee9c> 20899\n<ee9f> <eea0> 20902\n<eea1> <eefe> 6763\n<ef46> <ef4b> 20905\n<ef4d> <ef51> 20911\n<ef52> <ef53> 9420\n<ef58> <ef59> 20918\n<ef5b> <ef5f> 20920\n<ef61> <ef67> 20925\n<ef6d> <ef76> 20934\n<ef78> <ef79> 20944\n<ef7d> <ef7e> 20947\n<ef80> <ef81> 20949\n<ef83> <ef84> 9119\n<ef89> <ef8a> 20953\n<ef8e> <ef94> 20956\n<ef98> <ef9b> 20963\n<ef9f> <efa0> 20968\n<efa1> <effe> 6857\n<f045> <f046> 20972\n<f04a> <f04d> 20974\n<f04f> <f050> 20978\n<f052> <f053> 20980\n<f055> <f056> 20982\n<f058> <f05d> 20984\n<f05f> <f067> 20990\n<f069> <f06b> 20999\n<f06d> <f070> 21002\n<f075> <f077> 21007\n<f07b> <f07c> 21011\n<f07d> <f07e> 9129\n<f083> <f086> 21013\n<f089> <f08a> 21017\n<f08c> <f08f> 21019\n<f093> <f095> 21024\n<f097> <f0a0> 21027\n<f0a1> <f0fe> 6951\n<f140> <f151> 21037\n<f155> <f156> 21055\n<f15b> <f166> 21058\n<f168> <f175> 21070\nendcidrange\n\n100 begincidrange\n<f17c> <f17d> 21085\n<f18a> <f193> 21091\n<f195> <f197> 21101\n<f199> <f1a0> 21104\n<f1a1> <f1fe> 7045\n<f240> <f244> 21112\n<f248> <f24a> 21118\n<f24c> <f252> 21121\n<f256> <f25b> 21128\n<f25d> <f25e> 21134\n<f260> <f270> 21136\n<f277> <f27b> 21155\n<f280> <f284> 21160\n<f28a> <f28b> 9238\n<f28d> <f290> 21166\n<f292> <f293> 21170\n<f297> <f29b> 21173\n<f29f> <f2a0> 21179\n<f2a1> <f2fe> 7139\n<f342> <f344> 21181\n<f346> <f347> 21184\n<f34c> <f34f> 21187\n<f351> <f360> 21191\n<f362> <f373> 21207\n<f37a> <f37e> 21226\n<f380> <f38b> 21231\n<f38d> <f39f> 21243\n<f3a1> <f3fe> 7233\n<f440> <f444> 21262\n<f446> <f44f> 21267\n<f451> <f456> 21277\n<f45e> <f461> 21286\n<f465> <f474> 21291\n<f476> <f47b> 21307\n<f480> <f493> 21314\n<f495> <f498> 21334\n<f49a> <f49b> 21338\n<f49d> <f4a0> 21340\n<f4a1> <f4fe> 7327\n<f540> <f544> 21344\n<f548> <f551> 21350\n<f557> <f55d> 21361\n<f55f> <f560> 21368\n<f563> <f56d> 21370\n<f573> <f57e> 21382\n<f580> <f584> 21394\n<f587> <f58b> 21399\n<f590> <f598> 21405\n<f59c> <f59f> 21415\n<f5a1> <f5fe> 7421\n<f642> <f644> 21420\n<f649> <f64a> 21424\n<f64e> <f64f> 9787\n<f650> <f653> 21427\n<f655> <f657> 21431\n<f659> <f660> 21434\n<f664> <f66b> 21443\n<f66e> <f670> 21451\n<f672> <f673> 21454\n<f678> <f67e> 21457\n<f680> <f684> 21464\n<f686> <f687> 21469\n<f68b> <f68c> 21472\n<f68f> <f691> 21474\n<f693> <f695> 21477\n<f6a1> <f6fe> 7515\n<f740> <f741> 21484\n<f743> <f748> 21486\n<f74a> <f74b> 21492\n<f74e> <f755> 21494\n<f75d> <f760> 21504\n<f764> <f76a> 21509\n<f76c> <f770> 21516\n<f772> <f77b> 21521\n<f780> <f7a0> 21532\n<f7a1> <f7fe> 7609\n<f840> <f841> 21565\n<f843> <f845> 21567\n<f847> <f848> 21570\n<f84a> <f84f> 21572\n<f854> <f862> 21579\n<f867> <f871> 21595\n<f873> <f877> 21606\n<f87d> <f87e> 21613\n<f882> <f883> 21616\n<f887> <f88c> 21619\n<f88f> <f898> 21625\n<f89a> <f89c> 21635\n<f89e> <f89f> 21638\n<f940> <f94d> 21640\n<f951> <f958> 21654\n<f95b> <f95c> 21662\n<f95f> <f966> 21664\n<f96a> <f96b> 21673\n<f96d> <f96e> 21675\n<f970> <f97e> 21677\n<f980> <f984> 21692\n<f988> <f990> 21698\n<f992> <f995> 21707\n<f999> <f9a0> 21712\nendcidrange\n\n51 begincidrange\n<fa40> <fa41> 21720\n<fa43> <fa45> 21722\n<fa47> <fa4b> 21725\n<fa4d> <fa50> 21730\n<fa52> <fa57> 21734\n<fa5a> <fa5c> 21740\n<fa62> <fa6f> 21745\n<fa71> <fa73> 21759\n<fa78> <fa7e> 21763\n<fa80> <fa82> 21770\n<fa85> <fa8c> 21773\n<fa8e> <fa8f> 21781\n<fa92> <fa95> 21783\n<fa99> <faa0> 21787\n<fb40> <fb48> 21795\n<fb4a> <fb51> 21804\n<fb53> <fb56> 21812\n<fb5c> <fb74> 21817\n<fb76> <fb78> 21842\n<fb80> <fb8f> 21847\n<fb91> <fb9b> 21863\n<fb9d> <fb9e> 21874\n<fc40> <fc43> 21877\n<fc45> <fc48> 21881\n<fc4a> <fc59> 21885\n<fc5b> <fc62> 21901\n<fc64> <fc67> 21909\n<fc69> <fc6e> 21913\n<fc72> <fc73> 21920\n<fc75> <fc76> 21922\n<fc77> <fc78> 9752\n<fc79> <fc7e> 21924\n<fc80> <fc82> 21930\n<fc84> <fc89> 21933\n<fc8b> <fca0> 21939\n<fd40> <fd51> 21961\n<fd54> <fd56> 21979\n<fd5b> <fd5e> 21983\n<fd60> <fd61> 21987\n<fd63> <fd64> 21989\n<fd6a> <fd6b> 21992\n<fd6d> <fd6f> 21994\n<fd73> <fd77> 21998\n<fd79> <fd7c> 22003\n<fd80> <fd87> 22008\n<fd89> <fd8a> 22016\n<fd8c> <fd8e> 22018\n<fd91> <fd93> 22021\n<fd95> <fd9c> 22024\n<fe41> <fe7e> 22032\n<fe80> <fea0> 22094\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/GBK2K-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (GBK2K-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (GBK2K-H)\n%%BeginResource: CMap (GBK2K-V)\n%%Title: (GBK2K-V Adobe GB1 5)\n%%Version: 1.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/GBK2K-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 5 def\nend def\n\n/CMapName /GBK2K-V def\n/CMapVersion 1.003 def\n/CMapType 1 def\n\n/XUID [1 10 25600] def\n\n/WMode 1 def\n\n41 begincidrange\n<a1a2> <a1a2> 575\n<a1a3> <a1a3> 574\n<a1aa> <a1aa> 598\n<a1ab> <a1ac> 7704\n<a1ad> <a1ad> 599\n<a1b2> <a1bf> 582\n<a1fe> <a1fe> 7706\n<a3a1> <a3a1> 578\n<a3a8> <a3a9> 580\n<a3ac> <a3ac> 573\n<a3ae> <a3ae> 7707\n<a3ba> <a3bb> 576\n<a3bd> <a3bd> 7708\n<a3bf> <a3bf> 579\n<a3db> <a3db> 7709\n<a3dd> <a3dd> 7710\n<a3df> <a3df> 600\n<a3fb> <a3fb> 596\n<a3fd> <a3fd> 597\n<a3fe> <a3fe> 7711\n<a4a1> <a4a1> 22359\n<a4a3> <a4a3> 22361\n<a4a5> <a4a5> 22370\n<a4a7> <a4a7> 22360\n<a4a9> <a4a9> 22368\n<a4c3> <a4c3> 22369\n<a4e3> <a4e3> 22372\n<a4e5> <a4e5> 22374\n<a4e7> <a4e7> 22373\n<a4ee> <a4ee> 22371\n<a5a1> <a5a1> 22376\n<a5a3> <a5a3> 22378\n<a5a5> <a5a5> 22385\n<a5a7> <a5a7> 22377\n<a5a9> <a5a9> 22383\n<a5c3> <a5c3> 22384\n<a5e3> <a5e3> 22387\n<a5e5> <a5e5> 22389\n<a5e7> <a5e7> 22388\n<a5ee> <a5ee> 22386\n<a960> <a960> 22394\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/GBKp-EUC-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (GBKp-EUC-H)\n%%Title: (GBKp-EUC-H Adobe GB1 2)\n%%Version: 1.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 2 def\nend def\n\n/CMapName /GBKp-EUC-H def\n/CMapVersion 1.002 def\n/CMapType 1 def\n\n/XUID [1 10 25455] def\n\n/WMode 0 def\n\n2 begincodespacerange\n  <00>   <80>\n  <8140> <FEFE>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 1\nendnotdefrange\n\n100 begincidrange\n<20> <7e> 1\n<8140> <8178> 10072\n<8179> <8179> 8281\n<817a> <817e> 10129\n<8180> <8185> 10134\n<8186> <8186> 8689\n<8187> <81ec> 10140\n<81ed> <81ed> 8178\n<81ee> <81f5> 10242\n<81f6> <81f6> 8285\n<81f7> <81fe> 10250\n<8240> <8252> 10258\n<8253> <8253> 9884\n<8254> <8261> 10277\n<8262> <8262> 8629\n<8263> <8273> 10291\n<8274> <8274> 8908\n<8275> <8279> 10308\n<827a> <827a> 8214\n<827b> <827c> 10313\n<827d> <827d> 7778\n<827e> <827e> 10315\n<8280> <8280> 7968\n<8281> <8282> 10316\n<8283> <8283> 8319\n<8284> <828f> 10318\n<8290> <8290> 8284\n<8291> <82a4> 10330\n<82a5> <82a5> 8596\n<82a6> <82c7> 10350\n<82c8> <82c8> 7781\n<82c9> <82c9> 8833\n<82ca> <82e0> 10384\n<82e1> <82e1> 8909\n<82e2> <82e2> 10407\n<82e3> <82e3> 8458\n<82e4> <82e4> 7742\n<82e5> <82ec> 10408\n<82ed> <82ed> 9855\n<82ee> <82f1> 10416\n<82f2> <82f2> 8750\n<82f3> <82f6> 10420\n<82f7> <82f7> 7830\n<82f8> <82f8> 8907\n<82f9> <82f9> 8812\n<82fa> <82fa> 10424\n<82fb> <82fb> 8471\n<82fc> <82fe> 10425\n<8340> <8340> 10428\n<8341> <8341> 8424\n<8342> <8344> 10429\n<8345> <8345> 8916\n<8346> <8347> 10432\n<8348> <8348> 8121\n<8349> <834b> 10434\n<834c> <834c> 8920\n<834d> <8352> 10437\n<8353> <8353> 8415\n<8354> <8356> 10443\n<8357> <8357> 8386\n<8358> <835d> 10446\n<835e> <835e> 8597\n<835f> <8364> 10452\n<8365> <8365> 8108\n<8366> <8366> 8915\n<8367> <8371> 10458\n<8372> <8372> 8065\n<8373> <8377> 10469\n<8378> <8378> 8720\n<8379> <8379> 10474\n<837a> <837a> 8911\n<837b> <837b> 10475\n<837c> <837c> 8723\n<837d> <837d> 10476\n<837e> <837e> 8164\n<8380> <8380> 8080\n<8381> <8385> 10477\n<8386> <8386> 8918\n<8387> <8388> 10482\n<8389> <8389> 8912\n<838a> <838a> 8910\n<838b> <838c> 10484\n<838d> <838d> 9857\n<838e> <8393> 10486\n<8394> <8394> 7798\n<8395> <839d> 10492\n<839e> <839e> 8753\n<839f> <83a5> 10501\n<83a6> <83a6> 7827\n<83a7> <83aa> 10508\n<83ab> <83ab> 8914\n<83ac> <83ad> 10512\n<83ae> <83ae> 8919\n<83af> <83af> 8917\n<83b0> <83b0> 8913\n<83b1> <83b9> 10514\n<83ba> <83ba> 7909\n<83bb> <83c8> 10523\n<83c9> <83c9> 8229\n<83ca> <83f5> 10537\nendcidrange\n\n100 begincidrange\n<83f6> <83f6> 7887\n<83f7> <83fe> 10581\n<8440> <844f> 10589\n<8450> <8450> 8153\n<8451> <8470> 10605\n<8471> <8471> 8904\n<8472> <8473> 10637\n<8474> <8474> 8803\n<8475> <8476> 10639\n<8477> <8477> 9859\n<8478> <847e> 10641\n<8480> <8481> 10648\n<8482> <8482> 7959\n<8483> <848d> 10650\n<848e> <848e> 7979\n<848f> <8491> 10661\n<8492> <8492> 8906\n<8493> <8493> 7833\n<8494> <849c> 10664\n<849d> <849d> 8015\n<849e> <84a0> 10673\n<84a1> <84a1> 8143\n<84a2> <84a2> 8246\n<84a3> <84a3> 7994\n<84a4> <84a4> 10676\n<84a5> <84a5> 8905\n<84a6> <84a6> 8089\n<84a7> <84a8> 10677\n<84a9> <84a9> 8053\n<84aa> <84c4> 10679\n<84c5> <84c5> 8126\n<84c6> <84d2> 10706\n<84d3> <84d3> 7885\n<84d4> <84d4> 10719\n<84d5> <84d5> 8617\n<84d6> <84d6> 10720\n<84d7> <84d7> 8678\n<84d8> <84d8> 10721\n<84d9> <84d9> 8487\n<84da> <84da> 8195\n<84db> <84dc> 10722\n<84dd> <84dd> 8498\n<84de> <84e9> 10724\n<84ea> <84ea> 8995\n<84eb> <84ed> 10736\n<84ee> <84ee> 8209\n<84ef> <84f0> 10739\n<84f1> <84f1> 8437\n<84f2> <84fe> 10741\n<8540> <8550> 10754\n<8551> <8551> 8901\n<8552> <8552> 8030\n<8553> <8553> 10771\n<8554> <8554> 8902\n<8555> <855d> 10772\n<855e> <855e> 8431\n<855f> <8565> 10781\n<8566> <8566> 8656\n<8567> <857e> 10788\n<8580> <8586> 10812\n<8587> <8587> 8897\n<8588> <858a> 10819\n<858b> <858b> 7780\n<858c> <8591> 10822\n<8592> <8592> 8697\n<8593> <8595> 10828\n<8596> <8596> 8208\n<8597> <8597> 10831\n<8598> <8598> 8898\n<8599> <85a1> 10832\n<85a2> <85a2> 7770\n<85a3> <85b1> 10841\n<85b2> <85b2> 7842\n<85b3> <85fe> 10856\n<8640> <8649> 10932\n<864a> <864a> 9069\n<864b> <8653> 10942\n<8654> <8654> 8775\n<8655> <8667> 10951\n<8668> <8668> 9068\n<8669> <867e> 10970\n<8680> <8695> 10992\n<8696> <8696> 8604\n<8697> <8698> 11014\n<8699> <8699> 8393\n<869a> <86a0> 11016\n<86a1> <86a1> 8688\n<86a2> <86c9> 11023\n<86ca> <86ca> 8459\n<86cb> <86cb> 11063\n<86cc> <86cc> 8414\n<86cd> <86cd> 11064\n<86ce> <86ce> 7850\n<86cf> <86d0> 11065\n<86d1> <86d1> 8748\n<86d2> <86db> 11067\n<86dc> <86dc> 8408\n<86dd> <86dd> 8896\n<86de> <86e0> 11077\n<86e1> <86e1> 8303\nendcidrange\n\n100 begincidrange\n<86e2> <86e7> 11080\n<86e8> <86e8> 8609\n<86e9> <86ed> 11086\n<86ee> <86ee> 9081\n<86ef> <86f3> 11091\n<86f4> <86f4> 9074\n<86f5> <86fe> 11096\n<8740> <8740> 8554\n<8741> <8743> 11106\n<8744> <8744> 9084\n<8745> <8748> 11109\n<8749> <8749> 8368\n<874a> <874a> 11113\n<874b> <874b> 9082\n<874c> <874c> 7796\n<874d> <874e> 11114\n<874f> <874f> 9079\n<8750> <8756> 11116\n<8757> <8757> 8012\n<8758> <8759> 11123\n<875a> <875a> 9080\n<875b> <875b> 8655\n<875c> <875c> 9064\n<875d> <875d> 11125\n<875e> <875e> 9073\n<875f> <875f> 11126\n<8760> <8760> 9065\n<8761> <8765> 11127\n<8766> <8766> 9844\n<8767> <8779> 11132\n<877a> <877a> 9071\n<877b> <877c> 11151\n<877d> <877d> 9072\n<877e> <877e> 11153\n<8780> <8780> 11154\n<8781> <8781> 9078\n<8782> <8782> 9075\n<8783> <8785> 11155\n<8786> <8786> 9087\n<8787> <8787> 11158\n<8788> <8788> 9076\n<8789> <8789> 11159\n<878a> <878a> 8373\n<878b> <878c> 11160\n<878d> <878d> 7899\n<878e> <878e> 9842\n<878f> <8792> 11162\n<8793> <8793> 9070\n<8794> <8797> 11166\n<8798> <8798> 8631\n<8799> <879c> 11170\n<879d> <879d> 9077\n<879e> <87a2> 11174\n<87a3> <87a3> 9090\n<87a4> <87a6> 11179\n<87a7> <87a7> 8350\n<87a8> <87b2> 11182\n<87b3> <87b3> 9067\n<87b4> <87b4> 11193\n<87b5> <87b5> 8249\n<87b6> <87ba> 11194\n<87bb> <87bb> 9887\n<87bc> <87be> 11199\n<87bf> <87bf> 9085\n<87c0> <87c0> 8693\n<87c1> <87c1> 11202\n<87c2> <87c2> 9089\n<87c3> <87c9> 11203\n<87ca> <87ca> 9083\n<87cb> <87cb> 9086\n<87cc> <87cc> 8652\n<87cd> <87ce> 11210\n<87cf> <87cf> 8923\n<87d0> <87d1> 11212\n<87d2> <87d2> 9066\n<87d3> <87d3> 9865\n<87d4> <87d4> 11214\n<87d5> <87d5> 9879\n<87d6> <87d9> 11215\n<87da> <87da> 8865\n<87db> <87f6> 11219\n<87f7> <87f7> 9091\n<87f8> <87f8> 7997\n<87f9> <87f9> 11247\n<87fa> <87fa> 8591\n<87fb> <87fe> 11248\n<8840> <8840> 8774\n<8841> <8841> 8776\n<8842> <8843> 11252\n<8844> <8844> 8574\n<8845> <8845> 11254\n<8846> <8846> 8576\n<8847> <887e> 11255\n<8880> <88b9> 11311\n<88ba> <88ba> 9002\n<88bb> <88cb> 11369\n<88cc> <88cc> 8843\n<88cd> <88d3> 11386\n<88d4> <88d4> 8069\n<88d5> <88d6> 11393\nendcidrange\n\n100 begincidrange\n<88d7> <88d7> 8997\n<88d8> <88de> 11395\n<88df> <88df> 9004\n<88e0> <88e4> 11402\n<88e5> <88e5> 9006\n<88e6> <88f1> 11407\n<88f2> <88f2> 8709\n<88f3> <88f3> 7736\n<88f4> <88f5> 11419\n<88f6> <88f6> 7795\n<88f7> <88fe> 11421\n<8940> <894a> 11429\n<894b> <894b> 8163\n<894c> <894c> 9017\n<894d> <894d> 11440\n<894e> <894e> 9003\n<894f> <894f> 11441\n<8950> <8950> 9005\n<8951> <8953> 11442\n<8954> <8954> 8575\n<8955> <895c> 11445\n<895d> <895d> 8615\n<895e> <895e> 11453\n<895f> <895f> 9007\n<8960> <896c> 11454\n<896d> <896d> 7805\n<896e> <8970> 11467\n<8971> <8971> 8406\n<8972> <897b> 11470\n<897c> <897c> 7874\n<897d> <897e> 11480\n<8980> <898a> 11482\n<898b> <898b> 8882\n<898c> <8998> 11493\n<8999> <8999> 7903\n<899a> <899d> 11506\n<899e> <899e> 7929\n<899f> <89a5> 11510\n<89a6> <89a6> 8409\n<89a7> <89a7> 11517\n<89a8> <89a8> 8157\n<89a9> <89ae> 11518\n<89af> <89af> 8551\n<89b0> <89b9> 11524\n<89ba> <89ba> 8685\n<89bb> <89bd> 11534\n<89be> <89be> 8199\n<89bf> <89bf> 8998\n<89c0> <89c0> 9001\n<89c1> <89c3> 11537\n<89c4> <89c4> 8018\n<89c5> <89c5> 8251\n<89c6> <89c6> 9000\n<89c7> <89c7> 11540\n<89c8> <89c8> 8999\n<89c9> <89cd> 11541\n<89ce> <89ce> 7723\n<89cf> <89d0> 11546\n<89d1> <89d1> 8878\n<89d2> <89d7> 11548\n<89d8> <89d8> 8009\n<89d9> <89da> 11554\n<89db> <89db> 8504\n<89dc> <89f3> 11556\n<89f4> <89f4> 8321\n<89f5> <89fe> 11580\n<8a40> <8a40> 11590\n<8a41> <8a41> 8060\n<8a42> <8a58> 11591\n<8a59> <8a59> 9051\n<8a5a> <8a5a> 7902\n<8a5b> <8a5b> 11614\n<8a5c> <8a5c> 8098\n<8a5d> <8a5d> 11615\n<8a5e> <8a5e> 7930\n<8a5f> <8a78> 11616\n<8a79> <8a79> 8877\n<8a7a> <8a7e> 11642\n<8a80> <8ae3> 11647\n<8ae4> <8ae4> 8255\n<8ae5> <8afe> 11747\n<8b40> <8b43> 11773\n<8b44> <8b44> 7950\n<8b45> <8b48> 11777\n<8b49> <8b49> 9209\n<8b4a> <8b79> 11781\n<8b7a> <8b7a> 9212\n<8b7b> <8b7e> 11829\n<8b80> <8b8b> 11833\n<8b8c> <8b8c> 8297\n<8b8d> <8b9d> 11845\n<8b9e> <8b9e> 9207\n<8b9f> <8bb2> 11862\n<8bb3> <8bb3> 9206\n<8bb4> <8bb8> 11882\n<8bb9> <8bb9> 9213\n<8bba> <8bbd> 11887\n<8bbe> <8bbe> 9208\n<8bbf> <8bc5> 11891\n<8bc6> <8bc6> 9210\nendcidrange\n\n100 begincidrange\n<8bc7> <8bc7> 11898\n<8bc8> <8bc8> 9214\n<8bc9> <8bc9> 8104\n<8bca> <8bd3> 11899\n<8bd4> <8bd4> 9217\n<8bd5> <8bdb> 11909\n<8bdc> <8bdc> 9215\n<8bdd> <8be4> 11916\n<8be5> <8be5> 9216\n<8be6> <8bea> 11924\n<8beb> <8beb> 8737\n<8bec> <8bef> 11929\n<8bf0> <8bf0> 8482\n<8bf1> <8bfe> 11933\n<8c40> <8c43> 11947\n<8c44> <8c44> 9211\n<8c45> <8c4e> 11951\n<8c4f> <8c4f> 8538\n<8c50> <8c56> 11961\n<8c57> <8c57> 8677\n<8c58> <8c5b> 11968\n<8c5c> <8c5c> 8279\n<8c5d> <8c7e> 11972\n<8c80> <8c8a> 12006\n<8c8b> <8c8b> 8421\n<8c8c> <8c8c> 12017\n<8c8d> <8c8d> 8495\n<8c8e> <8c8e> 8355\n<8c8f> <8c8f> 8481\n<8c90> <8c90> 12018\n<8c91> <8c91> 8660\n<8c92> <8c92> 8165\n<8c93> <8c98> 12019\n<8c99> <8c99> 7818\n<8c9a> <8c9a> 7735\n<8c9b> <8ca1> 12025\n<8ca2> <8ca2> 8094\n<8ca3> <8ca3> 8870\n<8ca4> <8ca4> 8680\n<8ca5> <8ca5> 12032\n<8ca6> <8ca6> 7898\n<8ca7> <8ca7> 7865\n<8ca8> <8cbf> 12033\n<8cc0> <8cc0> 9052\n<8cc1> <8cd1> 12057\n<8cd2> <8cd2> 8272\n<8cd3> <8cd3> 7783\n<8cd4> <8cd4> 12074\n<8cd5> <8cd5> 9204\n<8cd6> <8cd8> 12075\n<8cd9> <8cd9> 8510\n<8cda> <8cf8> 12078\n<8cf9> <8cf9> 7958\n<8cfa> <8cfe> 12109\n<8d40> <8d72> 12114\n<8d73> <8d73> 9097\n<8d74> <8d74> 12165\n<8d75> <8d75> 7863\n<8d76> <8d7a> 12166\n<8d7b> <8d7b> 8628\n<8d7c> <8d7e> 12171\n<8d80> <8d87> 12174\n<8d88> <8d88> 9103\n<8d89> <8d8e> 12182\n<8d8f> <8d8f> 7962\n<8d90> <8d9d> 12188\n<8d9e> <8d9e> 9099\n<8d9f> <8db8> 12202\n<8db9> <8db9> 9098\n<8dba> <8de1> 12228\n<8de2> <8de2> 9105\n<8de3> <8de3> 12268\n<8de4> <8de4> 8817\n<8de5> <8de6> 12269\n<8de7> <8de7> 9096\n<8de8> <8df6> 12271\n<8df7> <8df7> 9102\n<8df8> <8dfd> 12286\n<8dfe> <8dfe> 9101\n<8e40> <8e45> 12292\n<8e46> <8e46> 9100\n<8e47> <8e55> 12298\n<8e56> <8e56> 9104\n<8e57> <8e57> 12313\n<8e58> <8e58> 8243\n<8e59> <8e59> 12314\n<8e5a> <8e5a> 8764\n<8e5b> <8e67> 12315\n<8e68> <8e68> 8169\n<8e69> <8e6d> 12328\n<8e6e> <8e6e> 8277\n<8e6f> <8e6f> 12333\n<8e70> <8e70> 9106\n<8e71> <8e7e> 12334\n<8e80> <8e80> 8996\n<8e81> <8e9a> 12348\n<8e9b> <8e9b> 8515\n<8e9c> <8e9e> 12374\n<8e9f> <8e9f> 8489\n<8ea0> <8ea3> 12377\nendcidrange\n\n100 begincidrange\n<8ea4> <8ea4> 8823\n<8ea5> <8ea6> 12381\n<8ea7> <8ea7> 7847\n<8ea8> <8eab> 12383\n<8eac> <8eac> 8837\n<8ead> <8ead> 12387\n<8eae> <8eae> 9092\n<8eaf> <8ebc> 12388\n<8ebd> <8ebd> 9095\n<8ebe> <8ebe> 9094\n<8ebf> <8ec2> 12402\n<8ec3> <8ec3> 8848\n<8ec4> <8ec4> 12406\n<8ec5> <8ec5> 7748\n<8ec6> <8ecc> 12407\n<8ecd> <8ecd> 7730\n<8ece> <8ece> 9093\n<8ecf> <8ed5> 12414\n<8ed6> <8ed6> 7955\n<8ed7> <8ed7> 8051\n<8ed8> <8eeb> 12421\n<8eec> <8eec> 8160\n<8eed> <8efe> 12441\n<8f40> <8f51> 12459\n<8f52> <8f52> 8327\n<8f53> <8f53> 7800\n<8f54> <8f54> 9134\n<8f55> <8f55> 7926\n<8f56> <8f56> 7985\n<8f57> <8f5c> 12477\n<8f5d> <8f5d> 8261\n<8f5e> <8f63> 12483\n<8f64> <8f64> 8568\n<8f65> <8f7e> 12489\n<8f80> <8f85> 12515\n<8f86> <8f86> 9205\n<8f87> <8f87> 12521\n<8f88> <8f88> 8821\n<8f89> <8f94> 12522\n<8f95> <8f95> 9838\n<8f96> <8f96> 12534\n<8f97> <8f97> 7856\n<8f98> <8f9a> 12535\n<8f9b> <8f9b> 8323\n<8f9c> <8f9c> 12538\n<8f9d> <8f9d> 8584\n<8f9e> <8fa0> 12539\n<8fa1> <8fa1> 9852\n<8fa2> <8fbc> 12542\n<8fbd> <8fbd> 8133\n<8fbe> <8fc3> 12569\n<8fc4> <8fc4> 7841\n<8fc5> <8fc5> 12575\n<8fc6> <8fc6> 9107\n<8fc7> <8fcc> 12576\n<8fcd> <8fcd> 7947\n<8fce> <8fd7> 12582\n<8fd8> <8fd8> 7804\n<8fd9> <8ffe> 12592\n<9040> <907e> 12630\n<9080> <909c> 12693\n<909d> <909d> 9140\n<909e> <909e> 8318\n<909f> <90b9> 12722\n<90ba> <90ba> 7907\n<90bb> <90bf> 12749\n<90c0> <90c0> 8341\n<90c1> <90c1> 9147\n<90c2> <90c4> 12754\n<90c5> <90c5> 9145\n<90c6> <90da> 12757\n<90db> <90db> 7720\n<90dc> <90dc> 9149\n<90dd> <90ec> 12778\n<90ed> <90ed> 9141\n<90ee> <90ef> 12794\n<90f0> <90f0> 9146\n<90f1> <90f6> 12796\n<90f7> <90f7> 9139\n<90f8> <90fe> 12802\n<9140> <9141> 12809\n<9142> <9142> 8546\n<9143> <914a> 12811\n<914b> <914b> 7774\n<914c> <914c> 12819\n<914d> <914d> 7773\n<914e> <9150> 12820\n<9151> <9151> 9143\n<9152> <9153> 12823\n<9154> <9154> 7983\n<9155> <9155> 9439\n<9156> <9158> 12825\n<9159> <9159> 9138\n<915a> <915a> 8526\n<915b> <915c> 12828\n<915d> <915d> 8274\n<915e> <9160> 12830\n<9161> <9161> 9148\n<9162> <9162> 12833\n<9163> <9163> 8427\nendcidrange\n\n100 begincidrange\n<9164> <916d> 12834\n<916e> <916e> 8754\n<916f> <9175> 12844\n<9176> <9176> 7743\n<9177> <9179> 12851\n<917a> <917a> 8219\n<917b> <917b> 8380\n<917c> <917c> 9150\n<917d> <917e> 12854\n<9180> <9183> 12856\n<9184> <9184> 7854\n<9185> <918c> 12860\n<918d> <918d> 7931\n<918e> <9190> 12868\n<9191> <9191> 8329\n<9192> <9192> 12871\n<9193> <9193> 9137\n<9194> <9196> 12872\n<9197> <9197> 8644\n<9198> <919a> 12875\n<919b> <919b> 8724\n<919c> <91a8> 12878\n<91a9> <91a9> 8158\n<91aa> <91aa> 8739\n<91ab> <91ab> 9142\n<91ac> <91b9> 12891\n<91ba> <91ba> 9868\n<91bb> <91bb> 9438\n<91bc> <91be> 12905\n<91bf> <91bf> 9440\n<91c0> <91c2> 12908\n<91c3> <91c3> 9144\n<91c4> <91cc> 12911\n<91cd> <91cd> 7809\n<91ce> <91cf> 12920\n<91d0> <91d0> 8190\n<91d1> <91d1> 8017\n<91d2> <91d2> 8673\n<91d3> <91d3> 12922\n<91d4> <91d4> 9136\n<91d5> <91d5> 12923\n<91d6> <91d6> 8142\n<91d7> <91d7> 12924\n<91d8> <91d8> 8478\n<91d9> <91d9> 8225\n<91da> <91de> 12925\n<91df> <91df> 9441\n<91e0> <91e1> 12930\n<91e2> <91e2> 9379\n<91e3> <91e9> 12932\n<91ea> <91ea> 9380\n<91eb> <91ef> 12939\n<91f0> <91f0> 8819\n<91f1> <91f1> 12944\n<91f2> <91f2> 8624\n<91f3> <91fe> 12945\n<9240> <927e> 12957\n<9280> <92b5> 13020\n<92b6> <92b6> 8657\n<92b7> <92cd> 13074\n<92ce> <92ce> 8476\n<92cf> <92cf> 13097\n<92d0> <92d0> 9053\n<92d1> <92d3> 13098\n<92d4> <92d4> 9858\n<92d5> <92de> 13101\n<92df> <92df> 8461\n<92e0> <92e0> 8282\n<92e1> <92fd> 13111\n<92fe> <92fe> 8077\n<9340> <934f> 13140\n<9350> <9350> 8703\n<9351> <935c> 13156\n<935d> <935d> 8024\n<935e> <936f> 13168\n<9370> <9370> 8539\n<9371> <9375> 13186\n<9376> <9376> 7862\n<9377> <937e> 13191\n<9380> <938b> 13199\n<938c> <938c> 8411\n<938d> <939c> 13211\n<939d> <939d> 9056\n<939e> <93a4> 13227\n<93a5> <93a5> 9057\n<93a6> <93a6> 13234\n<93a7> <93a7> 8256\n<93a8> <93b3> 13235\n<93b4> <93b4> 8846\n<93b5> <93b7> 13247\n<93b8> <93b8> 8159\n<93b9> <93ba> 13250\n<93bb> <93bb> 9054\n<93bc> <93bc> 13252\n<93bd> <93bd> 7786\n<93be> <93c5> 13253\n<93c6> <93c6> 8194\n<93c7> <93ce> 13261\n<93cf> <93cf> 8339\n<93d0> <93d6> 13269\nendcidrange\n\n100 begincidrange\n<93d7> <93d7> 9055\n<93d8> <93da> 13276\n<93db> <93db> 7852\n<93dc> <93dc> 7764\n<93dd> <93e0> 13279\n<93e1> <93e1> 7944\n<93e2> <93e3> 13283\n<93e4> <93e4> 8384\n<93e5> <93e5> 9058\n<93e6> <93e8> 13285\n<93e9> <93e9> 8544\n<93ea> <93ea> 13288\n<93eb> <93eb> 8605\n<93ec> <93ec> 8078\n<93ed> <93ed> 8749\n<93ee> <93ee> 13289\n<93ef> <93ef> 8263\n<93f0> <93f0> 13290\n<93f1> <93f1> 8802\n<93f2> <93f3> 13291\n<93f4> <93f4> 8039\n<93f5> <93f5> 7858\n<93f6> <93f9> 13293\n<93fa> <93fa> 7849\n<93fb> <93fd> 13297\n<93fe> <93fe> 8140\n<9440> <9443> 13300\n<9444> <9444> 8050\n<9445> <944c> 13304\n<944d> <944d> 8344\n<944e> <944f> 13312\n<9450> <9450> 7762\n<9451> <9451> 8356\n<9452> <9452> 7964\n<9453> <9453> 8847\n<9454> <9454> 13314\n<9455> <9455> 8173\n<9456> <9457> 13315\n<9458> <9458> 9061\n<9459> <945a> 13317\n<945b> <945b> 7725\n<945c> <945c> 8530\n<945d> <945d> 9062\n<945e> <945e> 13319\n<945f> <945f> 8442\n<9460> <9463> 13320\n<9464> <9464> 9059\n<9465> <9465> 13324\n<9466> <9466> 8346\n<9467> <946d> 13325\n<946e> <946e> 8252\n<946f> <9471> 13332\n<9472> <9472> 8182\n<9473> <9473> 13335\n<9474> <9474> 9060\n<9475> <9475> 13336\n<9476> <9476> 7785\n<9477> <9477> 13337\n<9478> <9478> 9063\n<9479> <9479> 13338\n<947a> <947a> 8477\n<947b> <947e> 13339\n<9480> <9480> 8793\n<9481> <9481> 8278\n<9482> <9482> 8547\n<9483> <9486> 13343\n<9487> <9487> 8105\n<9488> <9488> 8188\n<9489> <94a0> 13347\n<94a1> <94a1> 7726\n<94a2> <94b2> 13371\n<94b3> <94b3> 7868\n<94b4> <94b4> 13388\n<94b5> <94b5> 8514\n<94b6> <94be> 13389\n<94bf> <94bf> 8222\n<94c0> <94c0> 7747\n<94c1> <94cb> 13398\n<94cc> <94cc> 9428\n<94cd> <94d7> 13409\n<94d8> <94d8> 8815\n<94d9> <94df> 13420\n<94e0> <94e0> 7895\n<94e1> <94fe> 13427\n<9540> <9571> 13457\n<9572> <9572> 8493\n<9573> <957e> 13507\n<9580> <9582> 13519\n<9583> <9583> 8859\n<9584> <959d> 13522\n<959e> <959e> 8790\n<959f> <959f> 9384\n<95a0> <95b2> 13548\n<95b3> <95b3> 7801\n<95b4> <95b9> 13567\n<95ba> <95ba> 8794\n<95bb> <95ce> 13573\n<95cf> <95cf> 9383\n<95d0> <95d0> 13593\n<95d1> <95d1> 9862\nendcidrange\n\n100 begincidrange\n<95d2> <95d2> 9382\n<95d3> <95d3> 13594\n<95d4> <95d4> 8654\n<95d5> <95e0> 13595\n<95e1> <95e1> 9385\n<95e2> <95e6> 13607\n<95e7> <95e7> 8167\n<95e8> <95f0> 13612\n<95f1> <95f1> 8466\n<95f2> <95f7> 13621\n<95f8> <95f8> 8508\n<95f9> <95fd> 13627\n<95fe> <95fe> 8028\n<9640> <9655> 13632\n<9656> <9656> 9412\n<9657> <967b> 13654\n<967c> <967c> 7884\n<967d> <967e> 13691\n<9680> <96fe> 13693\n<9740> <9766> 13820\n<9767> <9767> 9322\n<9768> <976b> 13859\n<976c> <976c> 8565\n<976d> <976d> 13863\n<976e> <976e> 9325\n<976f> <977e> 13864\n<9780> <9795> 13880\n<9796> <9796> 9323\n<9797> <9797> 8799\n<9798> <979c> 13902\n<979d> <979d> 7886\n<979e> <97a2> 13907\n<97a3> <97a3> 8818\n<97a4> <97be> 13912\n<97bf> <97bf> 9331\n<97c0> <97ed> 13939\n<97ee> <97ee> 8702\n<97ef> <97f6> 13985\n<97f7> <97f7> 7934\n<97f8> <97fe> 13993\n<9840> <9844> 14000\n<9845> <9845> 9333\n<9846> <9848> 14005\n<9849> <9849> 8714\n<984a> <984e> 14008\n<984f> <984f> 8047\n<9850> <9870> 14013\n<9871> <9871> 9320\n<9872> <9872> 14046\n<9873> <9873> 8448\n<9874> <987e> 14047\n<9880> <9880> 14058\n<9881> <9881> 9334\n<9882> <988a> 14059\n<988b> <988b> 7975\n<988c> <988c> 8407\n<988d> <989f> 14068\n<98a0> <98a0> 9340\n<98a1> <98a9> 14087\n<98aa> <98aa> 8097\n<98ab> <98b5> 14096\n<98b6> <98b6> 8874\n<98b7> <98b7> 8197\n<98b8> <98b9> 14107\n<98ba> <98ba> 9324\n<98bb> <98c6> 14109\n<98c7> <98c7> 8254\n<98c8> <98ca> 14121\n<98cb> <98cb> 7756\n<98cc> <98cf> 14124\n<98d0> <98d0> 8506\n<98d1> <98d2> 14128\n<98d3> <98d3> 8708\n<98d4> <98e2> 14130\n<98e3> <98e3> 8387\n<98e4> <98e4> 8512\n<98e5> <98e5> 9335\n<98e6> <98ee> 14145\n<98ef> <98ef> 9332\n<98f0> <98f1> 14154\n<98f2> <98f2> 8413\n<98f3> <98fe> 14156\n<9940> <9942> 14168\n<9943> <9943> 8040\n<9944> <9944> 14171\n<9945> <9945> 8581\n<9946> <9965> 14172\n<9966> <9966> 9330\n<9967> <996d> 14204\n<996e> <996e> 7861\n<996f> <9974> 14211\n<9975> <9975> 9336\n<9976> <9979> 14217\n<997a> <997a> 8075\n<997b> <997b> 9348\n<997c> <997e> 14221\n<9980> <9984> 14224\n<9985> <9985> 9881\n<9986> <9988> 14229\n<9989> <9989> 9346\nendcidrange\n\n100 begincidrange\n<998a> <998d> 14232\n<998e> <998e> 8353\n<998f> <9990> 14236\n<9991> <9991> 8082\n<9992> <9998> 14238\n<9999> <9999> 7992\n<999a> <99a8> 14245\n<99a9> <99a9> 9349\n<99aa> <99af> 14260\n<99b0> <99b0> 9344\n<99b1> <99b1> 9326\n<99b2> <99b2> 14266\n<99b3> <99b3> 9339\n<99b4> <99b4> 9350\n<99b5> <99b5> 9329\n<99b6> <99bc> 14267\n<99bd> <99bd> 9347\n<99be> <99be> 9328\n<99bf> <99bf> 14274\n<99c0> <99c0> 9321\n<99c1> <99c1> 14275\n<99c2> <99c2> 9343\n<99c3> <99c8> 14276\n<99c9> <99c9> 9327\n<99ca> <99cd> 14282\n<99ce> <99ce> 9345\n<99cf> <99d0> 14286\n<99d1> <99d1> 8736\n<99d2> <99d9> 14288\n<99da> <99da> 8181\n<99db> <99df> 14296\n<99e0> <99e0> 8436\n<99e1> <99e4> 14301\n<99e5> <99e5> 9341\n<99e6> <99e7> 14305\n<99e8> <99e8> 9337\n<99e9> <99eb> 14307\n<99ec> <99ec> 9342\n<99ed> <99f3> 14310\n<99f4> <99f4> 9338\n<99f5> <99fe> 14317\n<9a40> <9a49> 14327\n<9a4a> <9a4a> 8419\n<9a4b> <9a56> 14337\n<9a57> <9a57> 8365\n<9a58> <9a64> 14349\n<9a65> <9a65> 9419\n<9a66> <9a66> 14362\n<9a67> <9a67> 8019\n<9a68> <9a70> 14363\n<9a71> <9a71> 8537\n<9a72> <9a75> 14372\n<9a76> <9a76> 8211\n<9a77> <9a77> 7987\n<9a78> <9a7e> 14376\n<9a80> <9a87> 14383\n<9a88> <9a88> 7772\n<9a89> <9a8b> 14391\n<9a8c> <9a8c> 9352\n<9a8d> <9a90> 14394\n<9a91> <9a91> 9351\n<9a92> <9a96> 14398\n<9a97> <9a97> 9354\n<9a98> <9a99> 14403\n<9a9a> <9a9a> 9353\n<9a9b> <9a9b> 9355\n<9a9c> <9a9d> 14405\n<9a9e> <9a9e> 8067\n<9a9f> <9aa1> 14407\n<9aa2> <9aa2> 8463\n<9aa3> <9aa3> 8155\n<9aa4> <9aa9> 14410\n<9aaa> <9aaa> 8367\n<9aab> <9acf> 14416\n<9ad0> <9ad0> 9408\n<9ad1> <9ad5> 14453\n<9ad6> <9ad6> 8813\n<9ad7> <9ad9> 14458\n<9ada> <9ada> 9409\n<9adb> <9ae1> 14461\n<9ae2> <9ae2> 8394\n<9ae3> <9ae3> 14468\n<9ae4> <9ae4> 8423\n<9ae5> <9ae5> 9410\n<9ae6> <9afe> 14469\n<9b40> <9b7e> 14494\n<9b80> <9bd0> 14557\n<9bd1> <9bd1> 9180\n<9bd2> <9bdb> 14638\n<9bdc> <9bdc> 9179\n<9bdd> <9bfe> 14648\n<9c40> <9c52> 14682\n<9c53> <9c53> 8286\n<9c54> <9c58> 14701\n<9c59> <9c59> 8772\n<9c5a> <9c5a> 9186\n<9c5b> <9c5b> 14706\n<9c5c> <9c5c> 8404\n<9c5d> <9c74> 14707\n<9c75> <9c75> 8607\nendcidrange\n\n100 begincidrange\n<9c76> <9c78> 14731\n<9c79> <9c79> 7782\n<9c7a> <9c7e> 14734\n<9c80> <9c85> 14739\n<9c86> <9c86> 8035\n<9c87> <9c9c> 14745\n<9c9d> <9c9d> 9181\n<9c9e> <9caa> 14767\n<9cab> <9cab> 8555\n<9cac> <9cc9> 14780\n<9cca> <9cca> 8885\n<9ccb> <9cce> 14810\n<9ccf> <9ccf> 7974\n<9cd0> <9ce5> 14814\n<9ce6> <9ce6> 7779\n<9ce7> <9ce7> 8328\n<9ce8> <9ceb> 14836\n<9cec> <9cec> 7869\n<9ced> <9ced> 14840\n<9cee> <9cee> 9025\n<9cef> <9cfa> 14841\n<9cfb> <9cfb> 8011\n<9cfc> <9cfd> 14853\n<9cfe> <9cfe> 8850\n<9d40> <9d41> 14855\n<9d42> <9d42> 8484\n<9d43> <9d45> 14857\n<9d46> <9d46> 8264\n<9d47> <9d47> 9184\n<9d48> <9d4c> 14860\n<9d4d> <9d4d> 8311\n<9d4e> <9d4e> 14865\n<9d4f> <9d4f> 8762\n<9d50> <9d60> 14866\n<9d61> <9d61> 8369\n<9d62> <9d67> 14883\n<9d68> <9d68> 8001\n<9d69> <9d69> 8220\n<9d6a> <9d6d> 14889\n<9d6e> <9d6e> 8888\n<9d6f> <9d70> 14893\n<9d71> <9d71> 8822\n<9d72> <9d74> 14895\n<9d75> <9d75> 8091\n<9d76> <9d7a> 14898\n<9d7b> <9d7b> 8095\n<9d7c> <9d7c> 14903\n<9d7d> <9d7d> 9674\n<9d7e> <9d7e> 14904\n<9d80> <9d89> 14905\n<9d8a> <9d8a> 8382\n<9d8b> <9d8c> 14915\n<9d8d> <9d8d> 8116\n<9d8e> <9d90> 14917\n<9d91> <9d91> 9175\n<9d92> <9d98> 14920\n<9d99> <9d99> 8453\n<9d9a> <9da0> 14927\n<9da1> <9da1> 9185\n<9da2> <9da2> 8172\n<9da3> <9da6> 14934\n<9da7> <9da7> 9194\n<9da8> <9dab> 14938\n<9dac> <9dac> 9187\n<9dad> <9dad> 8462\n<9dae> <9db1> 14942\n<9db2> <9db2> 8102\n<9db3> <9db3> 8196\n<9db4> <9dbd> 14946\n<9dbe> <9dbe> 8093\n<9dbf> <9dc5> 14956\n<9dc6> <9dc6> 9189\n<9dc7> <9dc8> 14963\n<9dc9> <9dc9> 8804\n<9dca> <9dcc> 14965\n<9dcd> <9dcd> 9442\n<9dce> <9dd1> 14968\n<9dd2> <9dd2> 9182\n<9dd3> <9dd4> 14972\n<9dd5> <9dd5> 7876\n<9dd6> <9de0> 14974\n<9de1> <9de1> 8886\n<9de2> <9de2> 8361\n<9de3> <9df0> 14985\n<9df1> <9df1> 8491\n<9df2> <9df3> 14999\n<9df4> <9df4> 8357\n<9df5> <9df6> 15001\n<9df7> <9df7> 9867\n<9df8> <9df9> 15003\n<9dfa> <9dfa> 8054\n<9dfb> <9dfc> 15005\n<9dfd> <9dfd> 8557\n<9dfe> <9dfe> 15007\n<9e40> <9e44> 15008\n<9e45> <9e45> 8193\n<9e46> <9e47> 15013\n<9e48> <9e48> 8593\n<9e49> <9e49> 7760\n<9e4a> <9e51> 15015\nendcidrange\n\n100 begincidrange\n<9e52> <9e52> 8092\n<9e53> <9e53> 15023\n<9e54> <9e54> 9178\n<9e55> <9e55> 15024\n<9e56> <9e56> 8275\n<9e57> <9e5c> 15025\n<9e5d> <9e5d> 9193\n<9e5e> <9e5e> 9188\n<9e5f> <9e60> 15031\n<9e61> <9e61> 8661\n<9e62> <9e62> 15033\n<9e63> <9e63> 9190\n<9e64> <9e66> 15034\n<9e67> <9e67> 9183\n<9e68> <9e6b> 15037\n<9e6c> <9e6c> 7759\n<9e6d> <9e6e> 15041\n<9e6f> <9e6f> 9177\n<9e70> <9e71> 15043\n<9e72> <9e72> 8212\n<9e73> <9e73> 15045\n<9e74> <9e74> 9196\n<9e75> <9e75> 9195\n<9e76> <9e7a> 15046\n<9e7b> <9e7b> 9176\n<9e7c> <9e7c> 9198\n<9e7d> <9e7e> 15051\n<9e80> <9e84> 15053\n<9e85> <9e85> 9870\n<9e86> <9e86> 15058\n<9e87> <9e87> 9197\n<9e88> <9e90> 15059\n<9e91> <9e91> 8186\n<9e92> <9e95> 15068\n<9e96> <9e96> 9174\n<9e97> <9e97> 9192\n<9e98> <9ea1> 15072\n<9ea2> <9ea2> 8454\n<9ea3> <9ea5> 15082\n<9ea6> <9ea6> 8203\n<9ea7> <9ea8> 15085\n<9ea9> <9ea9> 8550\n<9eaa> <9ead> 15087\n<9eae> <9eae> 9199\n<9eaf> <9eb2> 15091\n<9eb3> <9eb3> 8585\n<9eb4> <9eb4> 8280\n<9eb5> <9eb6> 15095\n<9eb7> <9eb7> 9191\n<9eb8> <9ef4> 15097\n<9ef5> <9ef5> 8611\n<9ef6> <9efe> 15158\n<9f40> <9f4d> 15167\n<9f4e> <9f4e> 8570\n<9f4f> <9f6e> 15181\n<9f6f> <9f6f> 8613\n<9f70> <9f7e> 15213\n<9f80> <9f91> 15228\n<9f92> <9f92> 8226\n<9f93> <9f97> 15246\n<9f98> <9f98> 9430\n<9f99> <9fa5> 15251\n<9fa6> <9fa6> 9018\n<9fa7> <9fa8> 15264\n<9fa9> <9fa9> 7918\n<9faa> <9fab> 15266\n<9fac> <9fac> 9429\n<9fad> <9fc8> 15268\n<9fc9> <9fc9> 8744\n<9fca> <9fcc> 15296\n<9fcd> <9fcd> 9431\n<9fce> <9fe0> 15299\n<9fe1> <9fe1> 8444\n<9fe2> <9fea> 15318\n<9feb> <9feb> 7815\n<9fec> <9fed> 15327\n<9fee> <9fee> 9432\n<9fef> <9ff3> 15329\n<9ff4> <9ff4> 7866\n<9ff5> <9ffc> 15334\n<9ffd> <9ffd> 8473\n<9ffe> <9ffe> 15342\n<a040> <a042> 15343\n<a043> <a043> 8556\n<a044> <a045> 15346\n<a046> <a046> 9433\n<a047> <a048> 15348\n<a049> <a049> 8743\n<a04a> <a04d> 15350\n<a04e> <a04e> 7775\n<a04f> <a053> 15354\n<a054> <a054> 8863\n<a055> <a059> 15359\n<a05a> <a05a> 8029\n<a05b> <a060> 15364\n<a061> <a061> 8124\n<a062> <a062> 15370\n<a063> <a063> 9434\n<a064> <a070> 15371\n<a071> <a071> 8521\nendcidrange\n\n100 begincidrange\n<a072> <a073> 15384\n<a074> <a074> 8262\n<a075> <a07e> 15386\n<a080> <a080> 8192\n<a081> <a090> 15396\n<a091> <a091> 8592\n<a092> <a093> 15412\n<a094> <a094> 8712\n<a095> <a095> 15414\n<a096> <a096> 7910\n<a097> <a0a8> 15415\n<a0a9> <a0a9> 9411\n<a0aa> <a0be> 15433\n<a0bf> <a0bf> 8396\n<a0c0> <a0cd> 15454\n<a0ce> <a0ce> 9024\n<a0cf> <a0d8> 15468\n<a0d9> <a0d9> 7889\n<a0da> <a0dd> 15478\n<a0de> <a0de> 8620\n<a0df> <a0ed> 15482\n<a0ee> <a0ee> 8879\n<a0ef> <a0fe> 15497\n<a1a1> <a1fe> 96\n<a2a1> <a2aa> 9897\n<a2b1> <a2e2> 190\n<a2e5> <a2ee> 240\n<a2f1> <a2fc> 250\n<a3a1> <a3fe> 262\n<a4a1> <a4f3> 356\n<a5a1> <a5f6> 439\n<a6a1> <a6b8> 525\n<a6c1> <a6f5> 549\n<a7a1> <a7c1> 602\n<a7d1> <a7f1> 635\n<a840> <a87e> 9907\n<a880> <a895> 9970\n<a8a1> <a8c0> 668\n<a8c5> <a8ea> 700\n<a940> <a957> 9992\n<a959> <a95a> 10016\n<a95c> <a95c> 10018\n<a960> <a97e> 10019\n<a980> <a995> 10050\n<a996> <a996> 7703\n<a9a4> <a9ef> 738\n<aa40> <aa4c> 15513\n<aa4d> <aa4d> 8630\n<aa4e> <aa4e> 7741\n<aa4f> <aa70> 15526\n<aa71> <aa71> 8757\n<aa72> <aa72> 15560\n<aa73> <aa73> 9111\n<aa74> <aa76> 15561\n<aa77> <aa77> 9109\n<aa78> <aa79> 15564\n<aa7a> <aa7a> 8767\n<aa7b> <aa7b> 8490\n<aa7c> <aa7e> 15566\n<aa80> <aa99> 15569\n<aa9a> <aa9a> 7890\n<aa9b> <aa9b> 15595\n<aa9c> <aa9c> 9110\n<aa9d> <aa9d> 9112\n<aa9e> <aa9e> 15596\n<aa9f> <aa9f> 8354\n<aaa0> <aaa0> 15597\n<aaa1> <aafe> 814\n<ab40> <ab40> 8036\n<ab41> <ab42> 15598\n<ab43> <ab43> 8235\n<ab44> <ab44> 15600\n<ab45> <ab45> 9108\n<ab46> <ab46> 8505\n<ab47> <ab47> 15601\n<ab48> <ab48> 8543\n<ab49> <ab49> 8641\n<ab4a> <ab4a> 9114\n<ab4b> <ab4c> 15602\n<ab4d> <ab4d> 9113\n<ab4e> <ab7e> 15604\n<ab80> <aba0> 15653\n<aba1> <abc0> 908\n<ac40> <ac45> 15686\n<ac46> <ac46> 8640\n<ac47> <ac70> 15692\n<ac71> <ac71> 9312\n<ac72> <ac7b> 15734\n<ac7c> <ac7c> 9308\n<ac7d> <ac7e> 15744\n<ac80> <ac8c> 15746\n<ac8d> <ac8d> 8541\n<ac8e> <ac92> 15759\n<ac93> <ac93> 8741\n<ac94> <ac94> 8298\n<ac95> <aca0> 15764\n<ad40> <ad48> 15776\n<ad49> <ad49> 9313\n<ad4a> <ad5d> 15785\n<ad5e> <ad5e> 9307\nendcidrange\n\n100 begincidrange\n<ad5f> <ad60> 15805\n<ad61> <ad61> 9314\n<ad62> <ad67> 15807\n<ad68> <ad68> 8020\n<ad69> <ad73> 15813\n<ad74> <ad74> 9311\n<ad75> <ad7e> 15824\n<ad80> <ad81> 15834\n<ad82> <ad82> 8428\n<ad83> <ad86> 15836\n<ad87> <ad87> 9309\n<ad88> <ad8a> 15840\n<ad8b> <ad8b> 9315\n<ad8c> <ad90> 15843\n<ad91> <ad91> 9316\n<ad92> <ada0> 15848\n<ae40> <ae53> 15863\n<ae54> <ae54> 9381\n<ae55> <ae61> 15883\n<ae62> <ae62> 7792\n<ae63> <ae7e> 15896\n<ae80> <ae80> 8335\n<ae81> <ae84> 15924\n<ae85> <ae85> 7746\n<ae86> <ae8a> 15928\n<ae8b> <ae8b> 8014\n<ae8c> <ae93> 15933\n<ae94> <ae94> 7857\n<ae95> <ae9f> 15941\n<aea0> <aea0> 7819\n<af40> <af63> 15952\n<af64> <af64> 8134\n<af65> <af7a> 15988\n<af7b> <af7b> 9646\n<af7c> <af7e> 16010\n<af80> <af81> 16013\n<af82> <af82> 7937\n<af83> <af83> 8704\n<af84> <af8d> 16015\n<af8e> <af8e> 9650\n<af8f> <af8f> 7831\n<af90> <af90> 16025\n<af91> <af91> 8363\n<af92> <af9b> 16026\n<af9c> <af9c> 9651\n<af9d> <af9e> 16036\n<af9f> <af9f> 8232\n<afa0> <afa0> 16038\n<b040> <b040> 16039\n<b041> <b042> 9647\n<b043> <b043> 16040\n<b044> <b044> 9649\n<b045> <b04e> 16041\n<b04f> <b04f> 9644\n<b050> <b053> 16051\n<b054> <b054> 7758\n<b055> <b056> 16055\n<b057> <b057> 8706\n<b058> <b058> 9643\n<b059> <b059> 8838\n<b05a> <b05a> 16057\n<b05b> <b05b> 9645\n<b05c> <b05c> 16058\n<b05d> <b05d> 9654\n<b05e> <b05e> 16059\n<b05f> <b05f> 8675\n<b060> <b061> 9652\n<b062> <b062> 8751\n<b063> <b063> 8549\n<b064> <b064> 9655\n<b065> <b06b> 16060\n<b06c> <b06c> 7913\n<b06d> <b07c> 16067\n<b07d> <b07d> 7717\n<b07e> <b07e> 16083\n<b080> <b096> 16084\n<b097> <b097> 9664\n<b098> <b098> 16107\n<b099> <b099> 8858\n<b09a> <b0a0> 16108\n<b0a1> <b0fe> 940\n<b140> <b14a> 16115\n<b14b> <b14b> 8814\n<b14c> <b14c> 16126\n<b14d> <b14d> 8125\n<b14e> <b14e> 16127\n<b14f> <b14f> 8068\n<b150> <b150> 8370\n<b151> <b151> 16128\n<b152> <b152> 8259\n<b153> <b17e> 16129\n<b180> <b196> 16173\n<b197> <b197> 9860\n<b198> <b1a0> 16196\n<b1a1> <b1fe> 1034\n<b240> <b240> 16205\n<b241> <b241> 9455\n<b242> <b266> 16206\n<b267> <b267> 9454\n<b268> <b26c> 16243\nendcidrange\n\n100 begincidrange\n<b26d> <b26d> 8308\n<b26e> <b273> 16248\n<b274> <b274> 9863\n<b275> <b27e> 16254\n<b280> <b280> 9456\n<b281> <b288> 16264\n<b289> <b289> 9869\n<b28a> <b299> 16272\n<b29a> <b29a> 8864\n<b29b> <b2a0> 16288\n<b2a1> <b2fe> 1128\n<b340> <b342> 16294\n<b343> <b343> 8107\n<b344> <b36f> 16297\n<b370> <b370> 9896\n<b371> <b37e> 16341\n<b380> <b387> 16355\n<b388> <b388> 9449\n<b389> <b38b> 16363\n<b38c> <b38c> 9445\n<b38d> <b38d> 16366\n<b38e> <b38e> 8698\n<b38f> <b3a0> 16367\n<b3a1> <b3fe> 1222\n<b440> <b453> 16385\n<b454> <b454> 8520\n<b455> <b457> 16405\n<b458> <b458> 9444\n<b459> <b45d> 16408\n<b45e> <b45e> 9446\n<b45f> <b45f> 8439\n<b460> <b460> 16413\n<b461> <b461> 8299\n<b462> <b474> 16414\n<b475> <b475> 8871\n<b476> <b47d> 16433\n<b47e> <b47e> 9452\n<b480> <b482> 16441\n<b483> <b483> 9451\n<b484> <b488> 16444\n<b489> <b489> 9443\n<b48a> <b492> 16449\n<b493> <b493> 9450\n<b494> <b4a0> 16458\n<b4a1> <b4fe> 1316\n<b540> <b540> 16471\n<b541> <b541> 7826\n<b542> <b54a> 16472\n<b54b> <b54b> 7719\n<b54c> <b555> 16481\n<b556> <b556> 8166\n<b557> <b559> 16491\n<b55a> <b55a> 9447\n<b55b> <b55b> 8210\n<b55c> <b55c> 7916\n<b55d> <b560> 16494\n<b561> <b561> 9448\n<b562> <b57e> 16498\n<b580> <b59b> 16527\n<b59c> <b59c> 8038\n<b59d> <b59d> 9436\n<b59e> <b5a0> 16555\n<b5a1> <b5fe> 1410\n<b640> <b651> 16558\n<b652> <b652> 9890\n<b653> <b654> 16576\n<b655> <b655> 9437\n<b656> <b658> 16578\n<b659> <b659> 8206\n<b65a> <b65a> 16581\n<b65b> <b65b> 9435\n<b65c> <b65c> 7864\n<b65d> <b67e> 16582\n<b680> <b6a0> 16616\n<b6a1> <b6fe> 1504\n<b740> <b74d> 16649\n<b74e> <b74e> 8853\n<b74f> <b750> 16663\n<b751> <b751> 7808\n<b752> <b758> 16665\n<b759> <b759> 9847\n<b75a> <b763> 16672\n<b764> <b764> 9764\n<b765> <b765> 8041\n<b766> <b766> 8747\n<b767> <b776> 16682\n<b777> <b777> 9599\n<b778> <b778> 8027\n<b779> <b77e> 16698\n<b780> <b780> 8603\n<b781> <b781> 16704\n<b782> <b782> 9853\n<b783> <b7a0> 16705\n<b7a1> <b7fe> 1598\n<b840> <b842> 16735\n<b843> <b843> 8608\n<b844> <b844> 8582\n<b845> <b845> 16738\n<b846> <b846> 8429\n<b847> <b84c> 16739\nendcidrange\n\n100 begincidrange\n<b84d> <b84d> 9657\n<b84e> <b850> 16745\n<b851> <b851> 8170\n<b852> <b859> 16748\n<b85a> <b85a> 7844\n<b85b> <b85b> 8417\n<b85c> <b85c> 16756\n<b85d> <b85d> 9656\n<b85e> <b85e> 8800\n<b85f> <b85f> 16757\n<b860> <b860> 8418\n<b861> <b876> 16758\n<b877> <b877> 8513\n<b878> <b87e> 16780\n<b880> <b881> 16787\n<b882> <b882> 8135\n<b883> <b8a0> 16789\n<b8a1> <b8fe> 1692\n<b940> <b94f> 16819\n<b950> <b950> 7745\n<b951> <b960> 16835\n<b961> <b961> 9700\n<b962> <b97a> 16851\n<b97b> <b97b> 8070\n<b97c> <b97e> 16876\n<b980> <b99c> 16879\n<b99d> <b99d> 8115\n<b99e> <b99f> 16908\n<b9a0> <b9a0> 7919\n<b9a1> <b9fe> 1786\n<ba40> <ba41> 16910\n<ba42> <ba42> 8868\n<ba43> <ba43> 16912\n<ba44> <ba44> 9704\n<ba45> <ba55> 16913\n<ba56> <ba56> 9699\n<ba57> <ba58> 16930\n<ba59> <ba59> 8465\n<ba5a> <ba5f> 16932\n<ba60> <ba60> 9702\n<ba61> <ba69> 16938\n<ba6a> <ba6a> 9703\n<ba6b> <ba73> 16947\n<ba74> <ba74> 8257\n<ba75> <ba7e> 16956\n<ba80> <ba83> 16966\n<ba84> <ba84> 9706\n<ba85> <ba85> 16970\n<ba86> <ba86> 8079\n<ba87> <ba87> 16971\n<ba88> <ba88> 9708\n<ba89> <ba8c> 16972\n<ba8d> <ba8d> 9707\n<ba8e> <ba9d> 16976\n<ba9e> <ba9e> 8400\n<ba9f> <ba9f> 8221\n<baa0> <baa0> 16992\n<baa1> <bafe> 1880\n<bb40> <bb40> 8183\n<bb41> <bb48> 16993\n<bb49> <bb49> 7821\n<bb4a> <bb57> 17001\n<bb58> <bb58> 9705\n<bb59> <bb5a> 17015\n<bb5b> <bb5b> 9710\n<bb5c> <bb5c> 8250\n<bb5d> <bb5f> 17017\n<bb60> <bb60> 9875\n<bb61> <bb64> 17020\n<bb65> <bb65> 9701\n<bb66> <bb66> 9709\n<bb67> <bb67> 17024\n<bb68> <bb68> 8201\n<bb69> <bb69> 17025\n<bb6a> <bb6a> 8293\n<bb6b> <bb6d> 17026\n<bb6e> <bb6e> 9891\n<bb6f> <bb7e> 17029\n<bb80> <bba0> 17045\n<bba1> <bbfe> 1974\n<bc40> <bc51> 17078\n<bc52> <bc52> 9717\n<bc53> <bc53> 7932\n<bc54> <bc59> 17096\n<bc5a> <bc5a> 8228\n<bc5b> <bc60> 17102\n<bc61> <bc61> 9883\n<bc62> <bc62> 17108\n<bc63> <bc63> 9715\n<bc64> <bc64> 17109\n<bc65> <bc65> 8921\n<bc66> <bc66> 17110\n<bc67> <bc67> 9716\n<bc68> <bc68> 17111\n<bc69> <bc69> 9243\n<bc6a> <bc6c> 17112\n<bc6d> <bc6d> 8136\n<bc6e> <bc6e> 17115\n<bc6f> <bc6f> 8059\n<bc70> <bc70> 17116\nendcidrange\n\n100 begincidrange\n<bc71> <bc71> 9245\n<bc72> <bc72> 17117\n<bc73> <bc73> 8780\n<bc74> <bc74> 8008\n<bc75> <bc75> 9244\n<bc76> <bc77> 9246\n<bc78> <bc78> 8447\n<bc79> <bc79> 8602\n<bc7a> <bc7a> 17118\n<bc7b> <bc7b> 8337\n<bc7c> <bc7d> 17119\n<bc7e> <bc7e> 8359\n<bc80> <bc81> 17121\n<bc82> <bc82> 9251\n<bc83> <bc83> 7835\n<bc84> <bc84> 9250\n<bc85> <bc85> 17123\n<bc86> <bc86> 8464\n<bc87> <bc87> 17124\n<bc88> <bc88> 8845\n<bc89> <bc89> 8049\n<bc8a> <bc8a> 7928\n<bc8b> <bc8b> 9249\n<bc8c> <bc8e> 17125\n<bc8f> <bc8f> 7923\n<bc90> <bc99> 17128\n<bc9a> <bc9a> 8625\n<bc9b> <bc9b> 9254\n<bc9c> <bc9c> 9253\n<bc9d> <bc9d> 8480\n<bc9e> <bca0> 17138\n<bca1> <bcfe> 2068\n<bd40> <bd41> 17141\n<bd42> <bd42> 8474\n<bd43> <bd43> 9252\n<bd44> <bd44> 17143\n<bd45> <bd45> 9256\n<bd46> <bd47> 17144\n<bd48> <bd48> 9258\n<bd49> <bd49> 9257\n<bd4a> <bd4a> 17146\n<bd4b> <bd4b> 8852\n<bd4c> <bd4c> 17147\n<bd4d> <bd4d> 8894\n<bd4e> <bd4e> 17148\n<bd4f> <bd4f> 7729\n<bd50> <bd56> 17149\n<bd57> <bd57> 9260\n<bd58> <bd58> 17156\n<bd59> <bd59> 8117\n<bd5a> <bd65> 17157\n<bd66> <bd66> 9259\n<bd67> <bd67> 8111\n<bd68> <bd69> 17169\n<bd6a> <bd6a> 8296\n<bd6b> <bd6b> 8676\n<bd6c> <bd6e> 17171\n<bd6f> <bd6f> 7969\n<bd70> <bd70> 17174\n<bd71> <bd71> 8449\n<bd72> <bd78> 17175\n<bd79> <bd79> 8572\n<bd7a> <bd7a> 8522\n<bd7b> <bd7b> 9261\n<bd7c> <bd7d> 17182\n<bd7e> <bd7e> 8148\n<bd80> <bd80> 17184\n<bd81> <bd81> 8145\n<bd82> <bd88> 17185\n<bd89> <bd89> 7731\n<bd8a> <bd8a> 17192\n<bd8b> <bd8b> 9263\n<bd8c> <bd8d> 17193\n<bd8e> <bd8e> 9262\n<bd8f> <bd8f> 17195\n<bd90> <bd90> 9264\n<bd91> <bd91> 8667\n<bd92> <bd96> 17196\n<bd97> <bd97> 8536\n<bd98> <bd9a> 17201\n<bd9b> <bd9b> 8130\n<bd9c> <bda0> 17204\n<bda1> <bdfe> 2162\n<be40> <be42> 17209\n<be43> <be43> 8889\n<be44> <be44> 17212\n<be45> <be45> 9270\n<be46> <be48> 17213\n<be49> <be49> 7822\n<be4a> <be4a> 9273\n<be4b> <be50> 17216\n<be51> <be51> 8645\n<be52> <be52> 9271\n<be53> <be53> 8594\n<be54> <be54> 17222\n<be55> <be55> 9274\n<be56> <be56> 7961\n<be57> <be57> 8588\n<be58> <be58> 7744\n<be59> <be59> 8883\nendcidrange\n\n100 begincidrange\n<be5a> <be5c> 17223\n<be5d> <be5d> 8287\n<be5e> <be5e> 9272\n<be5f> <be5f> 9266\n<be60> <be60> 8820\n<be61> <be61> 17226\n<be62> <be62> 7836\n<be63> <be63> 9265\n<be64> <be64> 8325\n<be65> <be68> 17227\n<be69> <be69> 9269\n<be6a> <be6b> 17231\n<be6c> <be6c> 9275\n<be6d> <be6e> 17233\n<be6f> <be6f> 8119\n<be70> <be70> 9267\n<be71> <be75> 17235\n<be76> <be76> 8276\n<be77> <be77> 8670\n<be78> <be78> 17240\n<be79> <be79> 9268\n<be7a> <be7b> 17241\n<be7c> <be7c> 9277\n<be7d> <be7d> 8073\n<be7e> <be7e> 9276\n<be80> <be82> 17243\n<be83> <be83> 8046\n<be84> <be84> 7896\n<be85> <be85> 17246\n<be86> <be86> 7871\n<be87> <be87> 9285\n<be88> <be88> 17247\n<be89> <be89> 8777\n<be8a> <be8b> 17248\n<be8c> <be8c> 9281\n<be8d> <be8d> 17250\n<be8e> <be8e> 7751\n<be8f> <be8f> 8022\n<be90> <be91> 17251\n<be92> <be92> 8326\n<be93> <be94> 17253\n<be95> <be95> 8598\n<be96> <be96> 17255\n<be97> <be97> 9283\n<be98> <be98> 9279\n<be99> <be99> 17256\n<be9a> <be9a> 8227\n<be9b> <be9b> 17257\n<be9c> <be9c> 9282\n<be9d> <be9e> 17258\n<be9f> <be9f> 9278\n<bea0> <bea0> 17260\n<bea1> <befe> 2256\n<bf40> <bf40> 9894\n<bf41> <bf4c> 17261\n<bf4d> <bf4d> 9038\n<bf4e> <bf4e> 9286\n<bf4f> <bf4f> 9291\n<bf50> <bf50> 9284\n<bf51> <bf54> 17273\n<bf55> <bf55> 9255\n<bf56> <bf56> 9292\n<bf57> <bf5f> 17277\n<bf60> <bf60> 7951\n<bf61> <bf61> 17286\n<bf62> <bf62> 9287\n<bf63> <bf63> 9289\n<bf64> <bf64> 9288\n<bf65> <bf67> 17287\n<bf68> <bf68> 8642\n<bf69> <bf6b> 17290\n<bf6c> <bf6c> 8558\n<bf6d> <bf6f> 17293\n<bf70> <bf70> 7939\n<bf71> <bf71> 17296\n<bf72> <bf72> 9290\n<bf73> <bf73> 8540\n<bf74> <bf75> 17297\n<bf76> <bf76> 8891\n<bf77> <bf77> 9296\n<bf78> <bf78> 17299\n<bf79> <bf79> 9876\n<bf7a> <bf7a> 9295\n<bf7b> <bf7b> 9718\n<bf7c> <bf7c> 8273\n<bf7d> <bf7d> 17300\n<bf7e> <bf7e> 9294\n<bf80> <bf81> 17301\n<bf82> <bf82> 8890\n<bf83> <bf83> 8045\n<bf84> <bf88> 17303\n<bf89> <bf89> 9298\n<bf8a> <bf8a> 9297\n<bf8b> <bf94> 17308\n<bf95> <bf95> 9301\n<bf96> <bf96> 17318\n<bf97> <bf97> 8841\n<bf98> <bf98> 8470\n<bf99> <bf9c> 17319\n<bf9d> <bf9d> 9300\nendcidrange\n\n100 begincidrange\n<bf9e> <bfa0> 17323\n<bfa1> <bffe> 2350\n<c040> <c040> 8443\n<c041> <c043> 17326\n<c044> <c044> 9280\n<c045> <c04a> 17329\n<c04b> <c04b> 8486\n<c04c> <c04c> 8033\n<c04d> <c04d> 9885\n<c04e> <c04e> 17335\n<c04f> <c04f> 8074\n<c050> <c050> 9302\n<c051> <c051> 9305\n<c052> <c052> 9304\n<c053> <c054> 17336\n<c055> <c055> 8110\n<c056> <c05a> 17338\n<c05b> <c05b> 8730\n<c05c> <c05d> 17343\n<c05e> <c05e> 8058\n<c05f> <c05f> 9293\n<c060> <c060> 9303\n<c061> <c068> 17345\n<c069> <c069> 9299\n<c06a> <c06a> 17353\n<c06b> <c06b> 9248\n<c06c> <c06c> 17354\n<c06d> <c06d> 8671\n<c06e> <c06e> 9861\n<c06f> <c06f> 17355\n<c070> <c070> 7790\n<c071> <c073> 17356\n<c074> <c074> 8740\n<c075> <c075> 9840\n<c076> <c076> 17359\n<c077> <c077> 8634\n<c078> <c078> 17360\n<c079> <c079> 9306\n<c07a> <c07b> 17361\n<c07c> <c07c> 8191\n<c07d> <c07e> 17363\n<c080> <c09a> 17365\n<c09b> <c09b> 9698\n<c09c> <c09c> 17392\n<c09d> <c09d> 9882\n<c09e> <c0a0> 17393\n<c0a1> <c0fe> 2444\n<c140> <c14f> 17396\n<c150> <c150> 7914\n<c151> <c153> 17412\n<c154> <c154> 7724\n<c155> <c15e> 17415\n<c15f> <c15f> 8290\n<c160> <c160> 9457\n<c161> <c161> 17425\n<c162> <c162> 9458\n<c163> <c174> 17426\n<c175> <c175> 9714\n<c176> <c177> 17444\n<c178> <c178> 8725\n<c179> <c17e> 17446\n<c180> <c194> 17452\n<c195> <c195> 8622\n<c196> <c1a0> 17473\n<c1a1> <c1fe> 2538\n<c240> <c24d> 17484\n<c24e> <c24e> 8416\n<c24f> <c264> 17498\n<c265> <c265> 9666\n<c266> <c266> 17520\n<c267> <c267> 9665\n<c268> <c27c> 17521\n<c27d> <c27d> 8488\n<c27e> <c27e> 17542\n<c280> <c283> 17543\n<c284> <c284> 8601\n<c285> <c292> 17547\n<c293> <c293> 8215\n<c294> <c294> 7840\n<c295> <c295> 8485\n<c296> <c296> 8525\n<c297> <c297> 17561\n<c298> <c298> 9668\n<c299> <c299> 8349\n<c29a> <c29a> 8842\n<c29b> <c29b> 17562\n<c29c> <c29c> 9667\n<c29d> <c29f> 17563\n<c2a0> <c2a0> 8569\n<c2a1> <c2fe> 2632\n<c340> <c340> 8248\n<c341> <c342> 17566\n<c343> <c343> 8533\n<c344> <c37a> 17568\n<c37b> <c37b> 8658\n<c37c> <c37e> 17623\n<c380> <c383> 17626\n<c384> <c384> 9415\n<c385> <c39a> 17630\n<c39b> <c39b> 8825\nendcidrange\n\n100 begincidrange\n<c39c> <c3a0> 17652\n<c3a1> <c3fe> 2726\n<c440> <c448> 17657\n<c449> <c449> 8483\n<c44a> <c44b> 17666\n<c44c> <c44c> 9413\n<c44d> <c453> 17668\n<c454> <c454> 9417\n<c455> <c457> 17675\n<c458> <c458> 8340\n<c459> <c45a> 17678\n<c45b> <c45b> 8854\n<c45c> <c462> 17680\n<c463> <c463> 7799\n<c464> <c476> 17687\n<c477> <c477> 7942\n<c478> <c479> 17706\n<c47a> <c47a> 8101\n<c47b> <c47e> 17708\n<c480> <c480> 17712\n<c481> <c481> 8345\n<c482> <c490> 17713\n<c491> <c491> 7853\n<c492> <c492> 9416\n<c493> <c493> 8360\n<c494> <c497> 17728\n<c498> <c498> 8223\n<c499> <c499> 17732\n<c49a> <c49a> 8389\n<c49b> <c49b> 17733\n<c49c> <c49c> 9418\n<c49d> <c4a0> 17734\n<c4a1> <c4fe> 2820\n<c540> <c543> 17738\n<c544> <c544> 8176\n<c545> <c545> 17742\n<c546> <c546> 9414\n<c547> <c54a> 17743\n<c54b> <c54b> 8797\n<c54c> <c54c> 8926\n<c54d> <c551> 17747\n<c552> <c552> 8236\n<c553> <c55e> 17752\n<c55f> <c55f> 8545\n<c560> <c562> 17764\n<c563> <c563> 8763\n<c564> <c564> 8665\n<c565> <c565> 8139\n<c566> <c566> 8137\n<c567> <c57e> 17767\n<c580> <c592> 17791\n<c593> <c593> 7777\n<c594> <c59b> 17810\n<c59c> <c59c> 9711\n<c59d> <c59d> 17818\n<c59e> <c59e> 8088\n<c59f> <c5a0> 17819\n<c5a1> <c5fe> 2914\n<c640> <c640> 17821\n<c641> <c641> 9712\n<c642> <c643> 17822\n<c644> <c644> 8072\n<c645> <c646> 17824\n<c647> <c647> 8696\n<c648> <c662> 17826\n<c663> <c663> 8994\n<c664> <c671> 17853\n<c672> <c672> 9014\n<c673> <c67e> 17867\n<c680> <c6a0> 17879\n<c6a1> <c6fe> 3008\n<c740> <c765> 17912\n<c766> <c766> 8875\n<c767> <c76e> 17950\n<c76f> <c76f> 8127\n<c770> <c775> 17958\n<c776> <c776> 8061\n<c777> <c77a> 17964\n<c77b> <c77b> 9011\n<c77c> <c77e> 17968\n<c780> <c7a0> 17971\n<c7a1> <c7fe> 3102\n<c840> <c840> 18004\n<c841> <c841> 8013\n<c842> <c84e> 18005\n<c84f> <c84f> 9012\n<c850> <c851> 18018\n<c852> <c852> 8177\n<c853> <c865> 18020\n<c866> <c866> 8587\n<c867> <c86d> 18039\n<c86e> <c86e> 9033\n<c86f> <c87d> 18046\n<c87e> <c87e> 8715\n<c880> <c886> 18061\n<c887> <c887> 9030\n<c888> <c891> 18068\n<c892> <c892> 9031\n<c893> <c893> 18078\n<c894> <c894> 8595\nendcidrange\n\n100 begincidrange\n<c895> <c898> 18079\n<c899> <c899> 9889\n<c89a> <c89c> 18083\n<c89d> <c89d> 8034\n<c89e> <c8a0> 18086\n<c8a1> <c8fe> 3196\n<c940> <c94e> 18089\n<c94f> <c94f> 9037\n<c950> <c950> 9032\n<c951> <c96d> 18104\n<c96e> <c96e> 7776\n<c96f> <c96f> 18133\n<c970> <c970> 9029\n<c971> <c976> 18134\n<c977> <c977> 7954\n<c978> <c97e> 18140\n<c980> <c98e> 18147\n<c98f> <c98f> 8216\n<c990> <c990> 9013\n<c991> <c99b> 18162\n<c99c> <c99c> 9020\n<c99d> <c9a0> 18173\n<c9a1> <c9fe> 3290\n<ca40> <ca4d> 18177\n<ca4e> <ca4e> 9839\n<ca4f> <ca55> 18191\n<ca56> <ca56> 9041\n<ca57> <ca58> 18198\n<ca59> <ca59> 8096\n<ca5a> <ca5b> 18200\n<ca5c> <ca5c> 9016\n<ca5d> <ca60> 18202\n<ca61> <ca61> 8731\n<ca62> <ca6d> 18206\n<ca6e> <ca6e> 9026\n<ca6f> <ca71> 18218\n<ca72> <ca72> 9039\n<ca73> <ca76> 18221\n<ca77> <ca77> 9021\n<ca78> <ca7a> 18225\n<ca7b> <ca7b> 9028\n<ca7c> <ca7c> 9009\n<ca7d> <ca7d> 18228\n<ca7e> <ca7e> 9035\n<ca80> <ca80> 18229\n<ca81> <ca81> 9019\n<ca82> <ca88> 18230\n<ca89> <ca89> 9040\n<ca8a> <ca8d> 18237\n<ca8e> <ca8e> 7860\n<ca8f> <ca8f> 8614\n<ca90> <ca91> 18241\n<ca92> <ca92> 8651\n<ca93> <ca99> 18243\n<ca9a> <ca9a> 9045\n<ca9b> <caa0> 18250\n<caa1> <cafe> 3384\n<cb40> <cb42> 18256\n<cb43> <cb43> 9022\n<cb44> <cb44> 18259\n<cb45> <cb45> 8052\n<cb46> <cb46> 18260\n<cb47> <cb47> 9008\n<cb48> <cb4a> 18261\n<cb4b> <cb4b> 9856\n<cb4c> <cb4d> 18264\n<cb4e> <cb4e> 8410\n<cb4f> <cb56> 18266\n<cb57> <cb57> 9034\n<cb58> <cb5c> 18274\n<cb5d> <cb5d> 8081\n<cb5e> <cb5e> 18279\n<cb5f> <cb5f> 8455\n<cb60> <cb69> 18280\n<cb6a> <cb6a> 9023\n<cb6b> <cb7a> 18290\n<cb7b> <cb7b> 8180\n<cb7c> <cb7c> 9027\n<cb7d> <cb7e> 18306\n<cb80> <cb86> 18308\n<cb87> <cb87> 8722\n<cb88> <cb8d> 18315\n<cb8e> <cb8e> 8711\n<cb8f> <cb91> 18321\n<cb92> <cb92> 9049\n<cb93> <cb9b> 18324\n<cb9c> <cb9c> 8788\n<cb9d> <cb9d> 18333\n<cb9e> <cb9e> 9010\n<cb9f> <cba0> 18334\n<cba1> <cbfe> 3478\n<cc40> <cc40> 7718\n<cc41> <cc41> 9047\n<cc42> <cc48> 18336\n<cc49> <cc49> 9048\n<cc4a> <cc4a> 8258\n<cc4b> <cc4b> 8531\n<cc4c> <cc4e> 18343\n<cc4f> <cc4f> 8379\n<cc50> <cc5b> 18346\nendcidrange\n\n100 begincidrange\n<cc5c> <cc5c> 9050\n<cc5d> <cc5f> 18358\n<cc60> <cc60> 9046\n<cc61> <cc63> 18361\n<cc64> <cc64> 9015\n<cc65> <cc6c> 18364\n<cc6d> <cc6d> 8185\n<cc6e> <cc78> 18372\n<cc79> <cc79> 9043\n<cc7a> <cc7c> 18383\n<cc7d> <cc7d> 8289\n<cc7e> <cc7e> 18386\n<cc80> <cc8d> 18387\n<cc8e> <cc8e> 7829\n<cc8f> <cc93> 18401\n<cc94> <cc94> 8265\n<cc95> <cc95> 18406\n<cc96> <cc96> 8002\n<cc97> <cc9c> 18407\n<cc9d> <cc9d> 8168\n<cc9e> <cca0> 18413\n<cca1> <ccfe> 3572\n<cd40> <cd7e> 18416\n<cd80> <cd8f> 18479\n<cd90> <cd90> 9690\n<cd91> <cd97> 18495\n<cd98> <cd98> 9687\n<cd99> <cda0> 18502\n<cda1> <cdfe> 3666\n<ce40> <ce66> 18510\n<ce67> <ce67> 8494\n<ce68> <ce71> 18549\n<ce72> <ce72> 8626\n<ce73> <ce7e> 18559\n<ce80> <ce80> 18571\n<ce81> <ce81> 8606\n<ce82> <ce86> 18572\n<ce87> <ce87> 9692\n<ce88> <ce9a> 18577\n<ce9b> <ce9b> 8300\n<ce9c> <ce9d> 18596\n<ce9e> <ce9e> 8742\n<ce9f> <cea0> 18598\n<cea1> <cefe> 3760\n<cf40> <cf4d> 18600\n<cf4e> <cf4e> 9696\n<cf4f> <cf54> 18614\n<cf55> <cf55> 8827\n<cf56> <cf57> 18620\n<cf58> <cf58> 9694\n<cf59> <cf5b> 18622\n<cf5c> <cf5c> 9697\n<cf5d> <cf6b> 18625\n<cf6c> <cf6c> 9685\n<cf6d> <cf72> 18640\n<cf73> <cf73> 7787\n<cf74> <cf74> 18646\n<cf75> <cf75> 9691\n<cf76> <cf77> 18647\n<cf78> <cf78> 7817\n<cf79> <cf7b> 18649\n<cf7c> <cf7c> 9689\n<cf7d> <cf7e> 18652\n<cf80> <cf80> 18654\n<cf81> <cf81> 8721\n<cf82> <cf88> 18655\n<cf89> <cf89> 8745\n<cf8a> <cf8a> 9686\n<cf8b> <cf92> 18662\n<cf93> <cf93> 9693\n<cf94> <cf94> 9695\n<cf95> <cf9d> 18670\n<cf9e> <cf9e> 8175\n<cf9f> <cf9f> 18679\n<cfa0> <cfa0> 9688\n<cfa1> <cffe> 3854\n<d040> <d04c> 18680\n<d04d> <d04d> 7977\n<d04e> <d050> 18693\n<d051> <d051> 7771\n<d052> <d054> 18696\n<d055> <d055> 8310\n<d056> <d05b> 18699\n<d05c> <d05c> 8855\n<d05d> <d05f> 18705\n<d060> <d060> 9872\n<d061> <d066> 18708\n<d067> <d067> 8511\n<d068> <d06b> 18714\n<d06c> <d06c> 8600\n<d06d> <d06d> 18718\n<d06e> <d06e> 7816\n<d06f> <d07c> 18719\n<d07d> <d07d> 8844\n<d07e> <d07e> 18733\n<d080> <d0a0> 18734\n<d0a1> <d0fe> 3948\n<d140> <d154> 18767\n<d155> <d155> 9713\n<d156> <d158> 18788\nendcidrange\n\n100 begincidrange\n<d159> <d159> 8204\n<d15a> <d160> 18791\n<d161> <d161> 7768\n<d162> <d162> 8876\n<d163> <d174> 18798\n<d175> <d175> 9895\n<d176> <d17c> 18816\n<d17d> <d17d> 9846\n<d17e> <d17e> 18823\n<d180> <d19c> 18824\n<d19d> <d19d> 8161\n<d19e> <d19e> 9659\n<d19f> <d1a0> 18853\n<d1a1> <d1fe> 4042\n<d240> <d240> 9662\n<d241> <d242> 18855\n<d243> <d243> 8925\n<d244> <d24c> 18857\n<d24d> <d24d> 9661\n<d24e> <d25b> 18866\n<d25c> <d25c> 7722\n<d25d> <d262> 18880\n<d263> <d263> 9660\n<d264> <d264> 9658\n<d265> <d267> 18886\n<d268> <d268> 9663\n<d269> <d26c> 18889\n<d26d> <d26d> 8583\n<d26e> <d26e> 18893\n<d26f> <d26f> 9835\n<d270> <d271> 18894\n<d272> <d272> 7807\n<d273> <d274> 18896\n<d275> <d275> 8621\n<d276> <d27e> 18898\n<d280> <d289> 18907\n<d28a> <d28a> 8086\n<d28b> <d28d> 18917\n<d28e> <d28e> 7986\n<d28f> <d291> 18920\n<d292> <d292> 8324\n<d293> <d294> 18923\n<d295> <d295> 8502\n<d296> <d296> 18925\n<d297> <d297> 9400\n<d298> <d29f> 18926\n<d2a0> <d2a0> 9402\n<d2a1> <d2fe> 4136\n<d340> <d343> 18934\n<d344> <d344> 9404\n<d345> <d347> 18938\n<d348> <d348> 8420\n<d349> <d349> 18941\n<d34a> <d34a> 9401\n<d34b> <d34c> 18942\n<d34d> <d34d> 9405\n<d34e> <d34f> 18944\n<d350> <d350> 9406\n<d351> <d354> 18946\n<d355> <d355> 9407\n<d356> <d357> 18950\n<d358> <d358> 8146\n<d359> <d35a> 18952\n<d35b> <d35b> 8189\n<d35c> <d35c> 18954\n<d35d> <d35d> 9403\n<d35e> <d35e> 7981\n<d35f> <d377> 18955\n<d378> <d378> 9737\n<d379> <d379> 18980\n<d37a> <d37a> 9738\n<d37b> <d37b> 18981\n<d37c> <d37c> 7828\n<d37d> <d37e> 18982\n<d380> <d384> 18984\n<d385> <d385> 8927\n<d386> <d386> 7883\n<d387> <d387> 7949\n<d388> <d38a> 18989\n<d38b> <d38b> 8055\n<d38c> <d38c> 18992\n<d38d> <d38d> 8683\n<d38e> <d38e> 18993\n<d38f> <d38f> 8929\n<d390> <d390> 18994\n<d391> <d391> 8559\n<d392> <d392> 18995\n<d393> <d393> 8928\n<d394> <d395> 18996\n<d396> <d396> 8682\n<d397> <d397> 18998\n<d398> <d398> 8930\n<d399> <d399> 8395\n<d39a> <d39a> 18999\n<d39b> <d39b> 8056\n<d39c> <d39d> 19000\n<d39e> <d39e> 7906\n<d39f> <d39f> 19002\n<d3a0> <d3a0> 8690\n<d3a1> <d3fe> 4230\nendcidrange\n\n100 begincidrange\n<d440> <d440> 19003\n<d441> <d441> 8528\n<d442> <d444> 19004\n<d445> <d445> 8147\n<d446> <d446> 19007\n<d447> <d447> 8933\n<d448> <d44b> 19008\n<d44c> <d44c> 7922\n<d44d> <d44e> 19012\n<d44f> <d44f> 8479\n<d450> <d452> 19014\n<d453> <d453> 8669\n<d454> <d455> 19017\n<d456> <d456> 8532\n<d457> <d457> 19019\n<d458> <d458> 8935\n<d459> <d45b> 19020\n<d45c> <d45c> 8834\n<d45d> <d461> 19023\n<d462> <d462> 8934\n<d463> <d466> 19028\n<d467> <d467> 8936\n<d468> <d46d> 19032\n<d46e> <d46e> 8932\n<d46f> <d46f> 19038\n<d470> <d470> 8810\n<d471> <d471> 19039\n<d472> <d472> 8939\n<d473> <d473> 19040\n<d474> <d474> 8937\n<d475> <d475> 8381\n<d476> <d477> 19041\n<d478> <d478> 8938\n<d479> <d47a> 19043\n<d47b> <d47b> 8893\n<d47c> <d47d> 19045\n<d47e> <d47e> 7838\n<d480> <d481> 19047\n<d482> <d482> 8950\n<d483> <d483> 8679\n<d484> <d484> 8726\n<d485> <d486> 19049\n<d487> <d487> 8503\n<d488> <d489> 19051\n<d48a> <d48a> 8492\n<d48b> <d48b> 19053\n<d48c> <d48c> 7784\n<d48d> <d48d> 8946\n<d48e> <d48e> 7991\n<d48f> <d48f> 8947\n<d490> <d490> 19054\n<d491> <d491> 8943\n<d492> <d492> 8016\n<d493> <d493> 7952\n<d494> <d494> 8648\n<d495> <d495> 19055\n<d496> <d496> 8945\n<d497> <d49b> 19056\n<d49c> <d49c> 8944\n<d49d> <d49e> 19061\n<d49f> <d49f> 8942\n<d4a0> <d4a0> 19063\n<d4a1> <d4fe> 4324\n<d540> <d542> 19064\n<d543> <d543> 8941\n<d544> <d544> 8862\n<d545> <d545> 8940\n<d546> <d546> 8162\n<d547> <d549> 19067\n<d54a> <d54a> 8446\n<d54b> <d54d> 19070\n<d54e> <d54f> 8953\n<d550> <d550> 19073\n<d551> <d551> 7855\n<d552> <d553> 19074\n<d554> <d554> 8758\n<d555> <d555> 19076\n<d556> <d556> 8951\n<d557> <d559> 19077\n<d55a> <d55a> 8765\n<d55b> <d55b> 19080\n<d55c> <d55c> 7810\n<d55d> <d55d> 8118\n<d55e> <d55e> 19081\n<d55f> <d55f> 8612\n<d560> <d560> 8618\n<d561> <d561> 8952\n<d562> <d562> 8529\n<d563> <d563> 19082\n<d564> <d564> 8032\n<d565> <d567> 19083\n<d568> <d568> 8519\n<d569> <d56b> 19086\n<d56c> <d56c> 8517\n<d56d> <d56d> 19089\n<d56e> <d56e> 8156\n<d56f> <d571> 19090\n<d572> <d572> 8961\n<d573> <d574> 19093\n<d575> <d575> 7925\nendcidrange\n\n100 begincidrange\n<d576> <d577> 19095\n<d578> <d578> 8728\n<d579> <d57a> 19097\n<d57b> <d57b> 7878\n<d57c> <d57d> 19099\n<d57e> <d57e> 8960\n<d580> <d580> 19101\n<d581> <d581> 8884\n<d582> <d583> 19102\n<d584> <d584> 8553\n<d585> <d585> 19104\n<d586> <d586> 8957\n<d587> <d587> 19105\n<d588> <d588> 8426\n<d589> <d589> 19106\n<d58a> <d58a> 8948\n<d58b> <d58b> 19107\n<d58c> <d58c> 8955\n<d58d> <d58d> 19108\n<d58e> <d58e> 8956\n<d58f> <d58f> 8231\n<d590> <d592> 19109\n<d593> <d593> 8288\n<d594> <d594> 8959\n<d595> <d597> 19112\n<d598> <d598> 8958\n<d599> <d599> 7879\n<d59a> <d59a> 19115\n<d59b> <d59b> 8972\n<d59c> <d59e> 19116\n<d59f> <d59f> 8949\n<d5a0> <d5a0> 19119\n<d5a1> <d5fe> 4418\n<d640> <d640> 8966\n<d641> <d641> 19120\n<d642> <d642> 8970\n<d643> <d643> 8659\n<d644> <d646> 19121\n<d647> <d647> 8963\n<d648> <d648> 19124\n<d649> <d649> 8967\n<d64a> <d64a> 8971\n<d64b> <d64c> 19125\n<d64d> <d64d> 8031\n<d64e> <d64e> 19127\n<d64f> <d64f> 8969\n<d650> <d651> 19128\n<d652> <d652> 8962\n<d653> <d653> 7940\n<d654> <d654> 8861\n<d655> <d655> 19130\n<d656> <d656> 8699\n<d657> <d657> 19131\n<d658> <d658> 8968\n<d659> <d659> 19132\n<d65a> <d65a> 8364\n<d65b> <d65b> 19133\n<d65c> <d65c> 8334\n<d65d> <d65d> 8965\n<d65e> <d65e> 8599\n<d65f> <d65f> 19134\n<d660> <d660> 8561\n<d661> <d661> 8856\n<d662> <d664> 19135\n<d665> <d665> 8023\n<d666> <d668> 19138\n<d669> <d669> 8322\n<d66a> <d66a> 19141\n<d66b> <d66b> 8977\n<d66c> <d66e> 19142\n<d66f> <d66f> 8964\n<d670> <d670> 19145\n<d671> <d671> 8975\n<d672> <d672> 7733\n<d673> <d673> 19146\n<d674> <d674> 8401\n<d675> <d675> 8976\n<d676> <d676> 8099\n<d677> <d677> 19147\n<d678> <d678> 8662\n<d679> <d67b> 19148\n<d67c> <d67c> 8710\n<d67d> <d67e> 19151\n<d680> <d682> 19153\n<d683> <d683> 8973\n<d684> <d685> 19156\n<d686> <d686> 8978\n<d687> <d687> 8333\n<d688> <d688> 8979\n<d689> <d68d> 19158\n<d68e> <d68e> 8931\n<d68f> <d693> 19163\n<d694> <d694> 8122\n<d695> <d698> 19168\n<d699> <d699> 8312\n<d69a> <d6a0> 19172\n<d6a1> <d6fe> 4512\n<d740> <d742> 19179\n<d743> <d743> 8840\n<d744> <d747> 19182\nendcidrange\n\n100 begincidrange\n<d748> <d748> 8982\n<d749> <d749> 8043\n<d74a> <d74f> 19186\n<d750> <d750> 8980\n<d751> <d751> 19192\n<d752> <d752> 8496\n<d753> <d753> 8981\n<d754> <d754> 8552\n<d755> <d755> 19193\n<d756> <d756> 8388\n<d757> <d763> 19194\n<d764> <d764> 8984\n<d765> <d766> 19207\n<d767> <d767> 8729\n<d768> <d768> 8727\n<d769> <d76b> 19209\n<d76c> <d76c> 8405\n<d76d> <d76e> 19212\n<d76f> <d76f> 8010\n<d770> <d774> 19214\n<d775> <d775> 8768\n<d776> <d777> 19219\n<d778> <d778> 7891\n<d779> <d77e> 19221\n<d780> <d782> 19227\n<d783> <d783> 7753\n<d784> <d786> 19230\n<d787> <d787> 9755\n<d788> <d78a> 19233\n<d78b> <d78b> 7789\n<d78c> <d78c> 8440\n<d78d> <d78d> 19236\n<d78e> <d78e> 8187\n<d78f> <d78f> 8985\n<d790> <d794> 19237\n<d795> <d795> 8974\n<d796> <d796> 19242\n<d797> <d797> 8983\n<d798> <d7a0> 19243\n<d7a1> <d7f9> 4606\n<d840> <d84c> 19252\n<d84d> <d84d> 8392\n<d84e> <d852> 19265\n<d853> <d853> 7933\n<d854> <d87e> 19270\n<d880> <d88f> 19313\n<d890> <d890> 7739\n<d891> <d891> 8831\n<d892> <d892> 19329\n<d893> <d893> 7948\n<d894> <d894> 7769\n<d895> <d895> 7972\n<d896> <d899> 19330\n<d89a> <d89a> 8378\n<d89b> <d89b> 8037\n<d89c> <d89c> 7920\n<d89d> <d89d> 8548\n<d89e> <d89e> 7984\n<d89f> <d89f> 8801\n<d8a0> <d8a0> 19334\n<d8a1> <d8fe> 4695\n<d940> <d940> 19335\n<d941> <d941> 8866\n<d942> <d942> 9387\n<d943> <d943> 19336\n<d944> <d944> 9391\n<d945> <d945> 7912\n<d946> <d946> 7993\n<d947> <d947> 19337\n<d948> <d948> 7752\n<d949> <d949> 8304\n<d94a> <d94a> 7848\n<d94b> <d94b> 19338\n<d94c> <d94c> 9388\n<d94d> <d94d> 7927\n<d94e> <d94e> 8566\n<d94f> <d94f> 9389\n<d950> <d950> 19339\n<d951> <d951> 8315\n<d952> <d952> 8005\n<d953> <d953> 9386\n<d954> <d954> 8267\n<d955> <d955> 8239\n<d956> <d956> 8026\n<d957> <d957> 9392\n<d958> <d958> 19340\n<d959> <d959> 8887\n<d95a> <d95a> 8063\n<d95b> <d95b> 19341\n<d95c> <d95c> 8805\n<d95d> <d962> 19342\n<d963> <d963> 9394\n<d964> <d964> 8475\n<d965> <d965> 7761\n<d966> <d966> 19348\n<d967> <d967> 9396\n<d968> <d96b> 19349\n<d96c> <d96c> 9395\n<d96d> <d96d> 19353\n<d96e> <d96e> 7839\nendcidrange\n\n100 begincidrange\n<d96f> <d96f> 19354\n<d970> <d970> 8472\n<d971> <d971> 19355\n<d972> <d972> 8372\n<d973> <d973> 9135\n<d974> <d974> 8635\n<d975> <d975> 8306\n<d976> <d976> 8085\n<d977> <d977> 19356\n<d978> <d978> 7946\n<d979> <d979> 9398\n<d97a> <d97b> 19357\n<d97c> <d97c> 8849\n<d97d> <d97d> 9397\n<d97e> <d97e> 8824\n<d980> <d980> 7892\n<d981> <d986> 19359\n<d987> <d987> 8179\n<d988> <d98c> 19365\n<d98d> <d98d> 8873\n<d98e> <d98e> 9399\n<d98f> <d98f> 7976\n<d990> <d990> 8457\n<d991> <d991> 8903\n<d992> <d996> 19370\n<d997> <d997> 9390\n<d998> <d998> 8881\n<d999> <d99a> 19375\n<d99b> <d99b> 8806\n<d99c> <d99c> 19377\n<d99d> <d99d> 8795\n<d99e> <d99e> 8900\n<d99f> <d99f> 19378\n<d9a0> <d9a0> 8469\n<d9a1> <d9fe> 4789\n<da40> <da40> 19379\n<da41> <da41> 8746\n<da42> <da42> 9393\n<da43> <da47> 19380\n<da48> <da48> 8509\n<da49> <da4c> 19385\n<da4d> <da4d> 7957\n<da4e> <da4e> 8796\n<da4f> <da72> 19389\n<da73> <da73> 7956\n<da74> <da76> 19425\n<da77> <da77> 8826\n<da78> <da7e> 19428\n<da80> <da84> 19435\n<da85> <da85> 8430\n<da86> <da8d> 19440\n<da8e> <da8e> 9720\n<da8f> <daa0> 19448\n<daa1> <dafe> 4883\n<db40> <db5f> 19466\n<db60> <db60> 8084\n<db61> <db77> 19498\n<db78> <db78> 8752\n<db79> <db7e> 19521\n<db80> <db83> 19527\n<db84> <db84> 9725\n<db85> <db8a> 19531\n<db8b> <db8b> 9728\n<db8c> <db97> 19537\n<db98> <db98> 9734\n<db99> <dba0> 19549\n<dba1> <dbfe> 4977\n<dc40> <dc44> 19557\n<dc45> <dc45> 9727\n<dc46> <dc4e> 19562\n<dc4f> <dc4f> 9724\n<dc50> <dc50> 7820\n<dc51> <dc51> 9730\n<dc52> <dc52> 19571\n<dc53> <dc53> 8781\n<dc54> <dc54> 19572\n<dc55> <dc55> 9732\n<dc56> <dc56> 9726\n<dc57> <dc57> 9731\n<dc58> <dc5c> 19573\n<dc5d> <dc5d> 9729\n<dc5e> <dc61> 19578\n<dc62> <dc62> 9733\n<dc63> <dc65> 19582\n<dc66> <dc66> 7843\n<dc67> <dc67> 9736\n<dc68> <dc6a> 19585\n<dc6b> <dc6b> 9735\n<dc6c> <dc7b> 19588\n<dc7c> <dc7c> 8432\n<dc7d> <dc7e> 19604\n<dc80> <dc86> 19606\n<dc87> <dc87> 7803\n<dc88> <dc88> 8807\n<dc89> <dc89> 7990\n<dc8a> <dc8a> 8150\n<dc8b> <dc8d> 19613\n<dc8e> <dc8e> 8672\n<dc8f> <dc8f> 19616\n<dc90> <dc90> 9356\nendcidrange\n\n100 begincidrange\n<dc91> <dc96> 19617\n<dc97> <dc97> 9357\n<dc98> <dc9a> 19623\n<dc9b> <dc9b> 8450\n<dc9c> <dc9f> 19626\n<dca0> <dca0> 9364\n<dca1> <dcfe> 5071\n<dd40> <dd45> 19630\n<dd46> <dd46> 9363\n<dd47> <dd4c> 19636\n<dd4d> <dd4d> 9358\n<dd4e> <dd52> 19642\n<dd53> <dd53> 8857\n<dd54> <dd54> 9361\n<dd55> <dd55> 9366\n<dd56> <dd56> 9359\n<dd57> <dd57> 9362\n<dd58> <dd58> 19647\n<dd59> <dd59> 9367\n<dd5a> <dd5d> 19648\n<dd5e> <dd5e> 8113\n<dd5f> <dd5f> 19652\n<dd60> <dd60> 9370\n<dd61> <dd61> 19653\n<dd62> <dd62> 9369\n<dd63> <dd63> 19654\n<dd64> <dd64> 8792\n<dd65> <dd65> 9368\n<dd66> <dd6c> 19655\n<dd6d> <dd6d> 9371\n<dd6e> <dd6e> 19662\n<dd6f> <dd6f> 7945\n<dd70> <dd70> 8422\n<dd71> <dd75> 19663\n<dd76> <dd76> 8230\n<dd77> <dd77> 9375\n<dd78> <dd78> 8025\n<dd79> <dd7a> 9373\n<dd7b> <dd7e> 19668\n<dd80> <dd80> 19672\n<dd81> <dd81> 7995\n<dd82> <dd82> 9372\n<dd83> <dd84> 19673\n<dd85> <dd85> 7738\n<dd86> <dd86> 8283\n<dd87> <dd8a> 19675\n<dd8b> <dd8b> 8048\n<dd8c> <dd8e> 19679\n<dd8f> <dd8f> 9376\n<dd90> <dd93> 19682\n<dd94> <dd94> 8507\n<dd95> <dd96> 19686\n<dd97> <dd97> 7943\n<dd98> <dd99> 19688\n<dd9a> <dd9a> 8816\n<dd9b> <dd9b> 8759\n<dd9c> <dd9d> 19690\n<dd9e> <dd9e> 9426\n<dd9f> <dd9f> 19692\n<dda0> <dda0> 8627\n<dda1> <ddfe> 5165\n<de40> <de40> 8773\n<de41> <de41> 9377\n<de42> <de43> 19693\n<de44> <de44> 8872\n<de45> <de47> 19695\n<de48> <de48> 8828\n<de49> <de49> 8112\n<de4a> <de4e> 19698\n<de4f> <de4f> 9378\n<de50> <de59> 19703\n<de5a> <de5a> 8006\n<de5b> <de5b> 19713\n<de5c> <de5c> 9088\n<de5d> <de5d> 9365\n<de5e> <de5e> 19714\n<de5f> <de5f> 9360\n<de60> <de6a> 19715\n<de6b> <de6b> 7728\n<de6c> <de6e> 19726\n<de6f> <de6f> 7837\n<de70> <de70> 7755\n<de71> <de71> 7754\n<de72> <de72> 8362\n<de73> <de7e> 19729\n<de80> <de91> 19741\n<de92> <de92> 9851\n<de93> <de9e> 19759\n<de9f> <de9f> 9202\n<dea0> <dea0> 19771\n<dea1> <defe> 5259\n<df40> <df40> 8830\n<df41> <df41> 19772\n<df42> <df42> 8217\n<df43> <df4c> 19773\n<df4d> <df4d> 8123\n<df4e> <df5b> 19783\n<df5c> <df5c> 8787\n<df5d> <df5d> 19797\n<df5e> <df5e> 7998\nendcidrange\n\n100 begincidrange\n<df5f> <df5f> 7846\n<df60> <df60> 8590\n<df61> <df63> 19798\n<df64> <df64> 8684\n<df65> <df65> 19801\n<df66> <df66> 7870\n<df67> <df67> 19802\n<df68> <df68> 8778\n<df69> <df6c> 19803\n<df6d> <df6d> 8499\n<df6e> <df73> 19807\n<df74> <df74> 7812\n<df75> <df76> 19813\n<df77> <df77> 8399\n<df78> <df78> 8674\n<df79> <df79> 19815\n<df7a> <df7a> 8719\n<df7b> <df7b> 19816\n<df7c> <df7c> 8233\n<df7d> <df7d> 19817\n<df7e> <df7e> 8307\n<df80> <df80> 8021\n<df81> <df82> 19818\n<df83> <df83> 9201\n<df84> <df84> 19820\n<df85> <df85> 7750\n<df86> <df88> 19821\n<df89> <df89> 8291\n<df8a> <df8a> 9203\n<df8b> <dfa0> 19824\n<dfa1> <dffe> 5353\n<e040> <e04f> 19846\n<e050> <e050> 8990\n<e051> <e05c> 19862\n<e05d> <e05d> 8755\n<e05e> <e068> 19874\n<e069> <e069> 8992\n<e06a> <e06b> 19885\n<e06c> <e06c> 8647\n<e06d> <e074> 19887\n<e075> <e075> 8892\n<e076> <e076> 19895\n<e077> <e077> 8988\n<e078> <e078> 19896\n<e079> <e079> 8785\n<e07a> <e07e> 19897\n<e080> <e086> 19902\n<e087> <e087> 7867\n<e088> <e08c> 19909\n<e08d> <e08d> 8839\n<e08e> <e08e> 19914\n<e08f> <e08f> 8237\n<e090> <e090> 7851\n<e091> <e091> 19915\n<e092> <e092> 8989\n<e093> <e093> 19916\n<e094> <e094> 8991\n<e095> <e096> 19917\n<e097> <e097> 8987\n<e098> <e0a0> 19919\n<e0a1> <e0fe> 5447\n<e140> <e141> 19928\n<e142> <e142> 8993\n<e143> <e163> 19930\n<e164> <e164> 8789\n<e165> <e167> 19963\n<e168> <e168> 7823\n<e169> <e173> 19966\n<e174> <e174> 8716\n<e175> <e175> 8100\n<e176> <e17e> 19977\n<e180> <e183> 19986\n<e184> <e184> 8347\n<e185> <e185> 8664\n<e186> <e186> 19990\n<e187> <e187> 9722\n<e188> <e188> 19991\n<e189> <e189> 9721\n<e18a> <e18b> 19992\n<e18c> <e18c> 8500\n<e18d> <e18d> 19994\n<e18e> <e190> 9459\n<e191> <e191> 9464\n<e192> <e192> 19995\n<e193> <e193> 9463\n<e194> <e194> 7880\n<e195> <e195> 9462\n<e196> <e197> 19996\n<e198> <e198> 8832\n<e199> <e19d> 19998\n<e19e> <e19e> 7877\n<e19f> <e19f> 9467\n<e1a0> <e1a0> 20003\n<e1a1> <e1fe> 5541\n<e240> <e240> 20004\n<e241> <e241> 9466\n<e242> <e242> 20005\n<e243> <e243> 7917\n<e244> <e24e> 20006\n<e24f> <e24f> 9469\nendcidrange\n\n100 begincidrange\n<e250> <e250> 20017\n<e251> <e251> 9465\n<e252> <e252> 20018\n<e253> <e253> 9470\n<e254> <e254> 8397\n<e255> <e259> 20019\n<e25a> <e25a> 9480\n<e25b> <e25b> 9476\n<e25c> <e25d> 20024\n<e25e> <e25e> 9478\n<e25f> <e261> 20026\n<e262> <e262> 9471\n<e263> <e263> 8336\n<e264> <e266> 20029\n<e267> <e267> 7901\n<e268> <e268> 7973\n<e269> <e269> 20032\n<e26a> <e26a> 9475\n<e26b> <e26b> 9474\n<e26c> <e26d> 20033\n<e26e> <e26e> 7802\n<e26f> <e26f> 8358\n<e270> <e277> 20035\n<e278> <e278> 8149\n<e279> <e27c> 20043\n<e27d> <e27d> 7953\n<e27e> <e27e> 20047\n<e280> <e280> 9479\n<e281> <e281> 9472\n<e282> <e282> 9477\n<e283> <e288> 20048\n<e289> <e289> 9497\n<e28a> <e28a> 20054\n<e28b> <e28b> 9493\n<e28c> <e28d> 20055\n<e28e> <e28e> 9484\n<e28f> <e28f> 8241\n<e290> <e291> 20057\n<e292> <e292> 9483\n<e293> <e293> 9487\n<e294> <e294> 9498\n<e295> <e295> 9481\n<e296> <e297> 20059\n<e298> <e298> 9486\n<e299> <e299> 8756\n<e29a> <e29a> 9491\n<e29b> <e29b> 8064\n<e29c> <e29f> 20061\n<e2a0> <e2a0> 9473\n<e2a1> <e2fe> 5635\n<e340> <e341> 20065\n<e342> <e342> 9495\n<e343> <e343> 9494\n<e344> <e346> 20067\n<e347> <e347> 9496\n<e348> <e34a> 20070\n<e34b> <e34b> 7766\n<e34c> <e34e> 20073\n<e34f> <e34f> 9485\n<e350> <e350> 20076\n<e351> <e351> 8403\n<e352> <e353> 20077\n<e354> <e354> 8314\n<e355> <e355> 8398\n<e356> <e357> 20079\n<e358> <e358> 9488\n<e359> <e35b> 20081\n<e35c> <e35c> 7765\n<e35d> <e35f> 20084\n<e360> <e360> 9482\n<e361> <e365> 20087\n<e366> <e367> 9489\n<e368> <e370> 20092\n<e371> <e371> 8106\n<e372> <e372> 20101\n<e373> <e373> 9502\n<e374> <e374> 7967\n<e375> <e377> 20102\n<e378> <e378> 9517\n<e379> <e379> 8733\n<e37a> <e37b> 20105\n<e37c> <e37c> 9522\n<e37d> <e37d> 20107\n<e37e> <e37e> 8571\n<e380> <e389> 20108\n<e38a> <e38a> 8623\n<e38b> <e38b> 20118\n<e38c> <e38c> 9516\n<e38d> <e38e> 20119\n<e38f> <e38f> 9512\n<e390> <e390> 20121\n<e391> <e391> 8332\n<e392> <e392> 20122\n<e393> <e393> 9519\n<e394> <e394> 20123\n<e395> <e395> 8636\n<e396> <e398> 20124\n<e399> <e399> 9501\n<e39a> <e39b> 20127\n<e39c> <e39c> 9525\nendcidrange\n\n100 begincidrange\n<e39d> <e39d> 20129\n<e39e> <e39e> 8717\n<e39f> <e39f> 9510\n<e3a0> <e3a0> 20130\n<e3a1> <e3fe> 5729\n<e440> <e440> 9524\n<e441> <e441> 9514\n<e442> <e442> 9503\n<e443> <e443> 9521\n<e444> <e444> 9500\n<e445> <e447> 20131\n<e448> <e448> 9509\n<e449> <e44d> 20134\n<e44e> <e44e> 8653\n<e44f> <e44f> 20139\n<e450> <e450> 8666\n<e451> <e451> 20140\n<e452> <e452> 8562\n<e453> <e453> 9534\n<e454> <e457> 20141\n<e458> <e458> 8271\n<e459> <e459> 20145\n<e45a> <e45a> 9539\n<e45b> <e45b> 20146\n<e45c> <e45c> 8663\n<e45d> <e45d> 20147\n<e45e> <e45e> 7740\n<e45f> <e461> 20148\n<e462> <e462> 9513\n<e463> <e464> 20151\n<e465> <e465> 9505\n<e466> <e467> 20153\n<e468> <e468> 7935\n<e469> <e472> 20155\n<e473> <e473> 9535\n<e474> <e474> 20165\n<e475> <e475> 9540\n<e476> <e478> 20166\n<e479> <e479> 9507\n<e47a> <e47a> 7824\n<e47b> <e47b> 9530\n<e47c> <e47c> 9541\n<e47d> <e47d> 20169\n<e47e> <e47e> 9533\n<e480> <e480> 20170\n<e481> <e481> 8385\n<e482> <e483> 20171\n<e484> <e484> 8451\n<e485> <e485> 9504\n<e486> <e486> 9532\n<e487> <e487> 9531\n<e488> <e488> 9528\n<e489> <e48c> 20173\n<e48d> <e48d> 9536\n<e48e> <e48e> 20177\n<e48f> <e48f> 8141\n<e490> <e492> 20178\n<e493> <e493> 7960\n<e494> <e497> 20181\n<e498> <e498> 9547\n<e499> <e49c> 20185\n<e49d> <e49d> 9543\n<e49e> <e49f> 9551\n<e4a0> <e4a0> 20189\n<e4a1> <e4fe> 5823\n<e540> <e545> 20190\n<e546> <e546> 8880\n<e547> <e547> 20196\n<e548> <e548> 9542\n<e549> <e54a> 20197\n<e54b> <e54b> 9548\n<e54c> <e54d> 20199\n<e54e> <e54e> 7834\n<e54f> <e54f> 9554\n<e550> <e550> 9520\n<e551> <e551> 9545\n<e552> <e554> 20201\n<e555> <e555> 9553\n<e556> <e556> 7882\n<e557> <e557> 20204\n<e558> <e558> 8402\n<e559> <e55b> 20205\n<e55c> <e55c> 8120\n<e55d> <e55d> 20208\n<e55e> <e55e> 8313\n<e55f> <e560> 20209\n<e561> <e561> 8619\n<e562> <e563> 20211\n<e564> <e564> 9549\n<e565> <e565> 7845\n<e566> <e567> 20213\n<e568> <e568> 8268\n<e569> <e569> 8320\n<e56a> <e56b> 20215\n<e56c> <e56c> 9837\n<e56d> <e56d> 20217\n<e56e> <e56e> 9527\n<e56f> <e574> 20218\n<e575> <e575> 9546\n<e576> <e576> 8632\nendcidrange\n\n100 begincidrange\n<e577> <e577> 20224\n<e578> <e578> 9550\n<e579> <e57a> 20225\n<e57b> <e57b> 9468\n<e57c> <e57c> 9556\n<e57d> <e57e> 20227\n<e580> <e580> 20229\n<e581> <e581> 7996\n<e582> <e582> 20230\n<e583> <e583> 7893\n<e584> <e589> 20231\n<e58a> <e58a> 9558\n<e58b> <e58d> 20237\n<e58e> <e58e> 8808\n<e58f> <e590> 20240\n<e591> <e591> 7894\n<e592> <e599> 20242\n<e59a> <e59a> 9559\n<e59b> <e59b> 9555\n<e59c> <e59e> 20250\n<e59f> <e59f> 9544\n<e5a0> <e5a0> 20253\n<e5a1> <e5fe> 5917\n<e640> <e640> 8412\n<e641> <e643> 20254\n<e644> <e644> 9561\n<e645> <e648> 20257\n<e649> <e649> 8087\n<e64a> <e64a> 9557\n<e64b> <e64d> 20261\n<e64e> <e64e> 8829\n<e64f> <e651> 20264\n<e652> <e652> 9598\n<e653> <e655> 20267\n<e656> <e656> 8316\n<e657> <e657> 20270\n<e658> <e658> 9562\n<e659> <e65a> 20271\n<e65b> <e65b> 9566\n<e65c> <e65d> 20273\n<e65e> <e65e> 7732\n<e65f> <e668> 20275\n<e669> <e669> 8542\n<e66a> <e66a> 20285\n<e66b> <e66b> 9568\n<e66c> <e674> 20286\n<e675> <e675> 8610\n<e676> <e676> 9044\n<e677> <e678> 20295\n<e679> <e679> 9571\n<e67a> <e67a> 9511\n<e67b> <e67b> 20297\n<e67c> <e67c> 9518\n<e67d> <e67d> 9560\n<e67e> <e67e> 20298\n<e680> <e680> 7963\n<e681> <e681> 20299\n<e682> <e682> 8835\n<e683> <e683> 20300\n<e684> <e684> 9572\n<e685> <e686> 20301\n<e687> <e687> 8352\n<e688> <e688> 20303\n<e689> <e689> 9573\n<e68a> <e68b> 20304\n<e68c> <e68c> 9569\n<e68d> <e692> 20306\n<e693> <e693> 9570\n<e694> <e696> 20312\n<e697> <e697> 9580\n<e698> <e69a> 20315\n<e69b> <e69b> 9581\n<e69c> <e69c> 8224\n<e69d> <e69e> 20318\n<e69f> <e69f> 9567\n<e6a0> <e6a0> 9578\n<e6a1> <e6fe> 6011\n<e740> <e742> 20320\n<e743> <e743> 9582\n<e744> <e747> 20323\n<e748> <e748> 9529\n<e749> <e749> 9564\n<e74a> <e74c> 20327\n<e74d> <e74e> 9576\n<e74f> <e74f> 9579\n<e750> <e750> 7791\n<e751> <e751> 20330\n<e752> <e752> 8132\n<e753> <e753> 9575\n<e754> <e754> 20331\n<e755> <e755> 9563\n<e756> <e758> 20332\n<e759> <e759> 9757\n<e75a> <e765> 20335\n<e766> <e766> 9515\n<e767> <e767> 20347\n<e768> <e768> 9585\n<e769> <e769> 20348\n<e76a> <e76a> 9591\n<e76b> <e773> 20349\nendcidrange\n\n100 begincidrange\n<e774> <e774> 9506\n<e775> <e77b> 20358\n<e77c> <e77c> 9523\n<e77d> <e77e> 20365\n<e780> <e781> 20367\n<e782> <e782> 8234\n<e783> <e783> 20369\n<e784> <e784> 9526\n<e785> <e785> 9587\n<e786> <e786> 9583\n<e787> <e789> 20370\n<e78a> <e78a> 8851\n<e78b> <e78b> 9592\n<e78c> <e78e> 20373\n<e78f> <e78f> 9584\n<e790> <e791> 20376\n<e792> <e792> 9589\n<e793> <e797> 20378\n<e798> <e799> 9537\n<e79a> <e79a> 9565\n<e79b> <e79f> 20383\n<e7a0> <e7a0> 8218\n<e7a1> <e7fe> 6105\n<e840> <e842> 20388\n<e843> <e843> 9594\n<e844> <e844> 8198\n<e845> <e845> 20391\n<e846> <e846> 8567\n<e847> <e848> 20392\n<e849> <e849> 9499\n<e84a> <e84a> 20394\n<e84b> <e84b> 9508\n<e84c> <e84e> 20395\n<e84f> <e84f> 9595\n<e850> <e853> 20398\n<e854> <e854> 8867\n<e855> <e859> 20402\n<e85a> <e85a> 9593\n<e85b> <e85b> 20407\n<e85c> <e85c> 9574\n<e85d> <e861> 20408\n<e862> <e862> 8083\n<e863> <e863> 20413\n<e864> <e864> 9596\n<e865> <e86f> 20414\n<e870> <e870> 9492\n<e871> <e872> 20425\n<e873> <e873> 9597\n<e874> <e874> 20427\n<e875> <e875> 9586\n<e876> <e87b> 20428\n<e87c> <e87c> 9588\n<e87d> <e87e> 20434\n<e880> <e880> 8782\n<e881> <e881> 20436\n<e882> <e882> 8646\n<e883> <e886> 20437\n<e887> <e887> 8351\n<e888> <e888> 20441\n<e889> <e889> 9590\n<e88a> <e88b> 20442\n<e88c> <e88c> 8292\n<e88d> <e88d> 8895\n<e88e> <e88e> 9756\n<e88f> <e88f> 8798\n<e890> <e8a0> 20444\n<e8a1> <e8fe> 6199\n<e940> <e94b> 20461\n<e94c> <e94c> 7797\n<e94d> <e953> 20473\n<e954> <e954> 8317\n<e955> <e955> 20480\n<e956> <e956> 9151\n<e957> <e957> 8467\n<e958> <e959> 20481\n<e95a> <e95a> 9152\n<e95b> <e95c> 20483\n<e95d> <e95d> 7749\n<e95e> <e95e> 20485\n<e95f> <e95f> 8152\n<e960> <e960> 9156\n<e961> <e961> 20486\n<e962> <e962> 9154\n<e963> <e963> 8452\n<e964> <e964> 20487\n<e965> <e965> 8637\n<e966> <e966> 20488\n<e967> <e967> 8071\n<e968> <e968> 9155\n<e969> <e96b> 20489\n<e96c> <e96c> 8809\n<e96d> <e974> 20492\n<e975> <e975> 8003\n<e976> <e976> 20500\n<e977> <e977> 7966\n<e978> <e978> 9849\n<e979> <e979> 7915\n<e97a> <e97b> 20501\n<e97c> <e97c> 7989\n<e97d> <e97d> 8330\nendcidrange\n\n100 begincidrange\n<e97e> <e97e> 20503\n<e980> <e980> 9159\n<e981> <e981> 9161\n<e982> <e982> 9158\n<e983> <e986> 20504\n<e987> <e987> 8783\n<e988> <e98a> 20508\n<e98b> <e98b> 9163\n<e98c> <e98d> 20511\n<e98e> <e98e> 8691\n<e98f> <e98f> 20513\n<e990> <e990> 8695\n<e991> <e991> 9167\n<e992> <e992> 9166\n<e993> <e993> 9162\n<e994> <e994> 9165\n<e995> <e997> 20514\n<e998> <e998> 9168\n<e999> <e99a> 20517\n<e99b> <e99b> 9836\n<e99c> <e99c> 20519\n<e99d> <e99d> 9153\n<e99e> <e99e> 20520\n<e99f> <e99f> 8174\n<e9a0> <e9a0> 9169\n<e9a1> <e9fe> 6293\n<ea40> <ea40> 8184\n<ea41> <ea43> 20521\n<ea44> <ea44> 9171\n<ea45> <ea47> 20524\n<ea48> <ea48> 9170\n<ea49> <ea49> 9172\n<ea4a> <ea4a> 7832\n<ea4b> <ea4f> 20527\n<ea50> <ea50> 7980\n<ea51> <ea51> 20532\n<ea52> <ea52> 9173\n<ea53> <ea54> 20533\n<ea55> <ea55> 7793\n<ea56> <ea56> 9873\n<ea57> <ea58> 20535\n<ea59> <ea59> 9157\n<ea5a> <ea7e> 20537\n<ea80> <ea80> 8986\n<ea81> <ea83> 20574\n<ea84> <ea84> 8468\n<ea85> <ea86> 20577\n<ea87> <ea87> 8836\n<ea88> <ea8d> 20579\n<ea8e> <ea8e> 8732\n<ea8f> <ea8f> 20585\n<ea90> <ea90> 7806\n<ea91> <ea91> 8269\n<ea92> <ea95> 20586\n<ea96> <ea96> 8705\n<ea97> <ea9f> 20590\n<eaa0> <eaa0> 7897\n<eaa1> <eafe> 6387\n<eb40> <eb40> 20599\n<eb41> <eb41> 8114\n<eb42> <eb44> 20600\n<eb45> <eb45> 8786\n<eb46> <eb47> 20603\n<eb48> <eb48> 8057\n<eb49> <eb52> 20605\n<eb53> <eb53> 8535\n<eb54> <eb54> 20615\n<eb55> <eb55> 8639\n<eb56> <eb5a> 20616\n<eb5b> <eb5b> 8735\n<eb5c> <eb5c> 20621\n<eb5d> <eb5d> 8253\n<eb5e> <eb5f> 20622\n<eb60> <eb60> 8213\n<eb61> <eb61> 20624\n<eb62> <eb62> 9893\n<eb63> <eb6c> 20625\n<eb6d> <eb6d> 8534\n<eb6e> <eb6f> 20635\n<eb70> <eb70> 8516\n<eb71> <eb71> 20637\n<eb72> <eb72> 7825\n<eb73> <eb73> 8791\n<eb74> <eb77> 20638\n<eb78> <eb78> 8202\n<eb79> <eb79> 8338\n<eb7a> <eb7e> 20642\n<eb80> <eb84> 20647\n<eb85> <eb85> 8784\n<eb86> <eb89> 20652\n<eb8a> <eb8a> 7875\n<eb8b> <eba0> 20656\n<eba1> <ebfe> 6481\n<ec40> <ec45> 20678\n<ec46> <ec46> 8616\n<ec47> <ec55> 20684\n<ec56> <ec56> 9741\n<ec57> <ec59> 20699\n<ec5a> <ec5a> 9740\n<ec5b> <ec5b> 20702\nendcidrange\n\n100 begincidrange\n<ec5c> <ec5c> 9742\n<ec5d> <ec5f> 20703\n<ec60> <ec60> 8242\n<ec61> <ec6d> 20706\n<ec6e> <ec6e> 9739\n<ec6f> <ec75> 20719\n<ec76> <ec76> 8899\n<ec77> <ec7e> 20726\n<ec80> <ec95> 20734\n<ec96> <ec96> 7971\n<ec97> <eca0> 20756\n<eca1> <ecfe> 6575\n<ed40> <ed45> 20766\n<ed46> <ed46> 9877\n<ed47> <ed57> 20772\n<ed58> <ed58> 9822\n<ed59> <ed5d> 20789\n<ed5e> <ed5e> 9821\n<ed5f> <ed60> 20794\n<ed61> <ed61> 9874\n<ed62> <ed63> 20796\n<ed64> <ed64> 9823\n<ed65> <ed65> 20798\n<ed66> <ed66> 8589\n<ed67> <ed67> 8445\n<ed68> <ed6d> 20799\n<ed6e> <ed6e> 8000\n<ed6f> <ed73> 20805\n<ed74> <ed74> 9317\n<ed75> <ed76> 20810\n<ed77> <ed77> 9319\n<ed78> <ed78> 20812\n<ed79> <ed79> 9318\n<ed7a> <ed7e> 20813\n<ed80> <ed90> 20818\n<ed91> <ed91> 8649\n<ed92> <ed92> 20835\n<ed93> <ed93> 8713\n<ed94> <ed94> 7881\n<ed95> <ed95> 8425\n<ed96> <ed96> 20836\n<ed97> <ed97> 8650\n<ed98> <ed98> 8518\n<ed99> <ed99> 9669\n<ed9a> <ed9a> 8668\n<ed9b> <ed9b> 20837\n<ed9c> <ed9c> 9310\n<ed9d> <ed9d> 20838\n<ed9e> <ed9e> 8527\n<ed9f> <ed9f> 20839\n<eda0> <eda0> 9670\n<eda1> <edfe> 6669\n<ee40> <ee40> 9671\n<ee41> <ee41> 8769\n<ee42> <ee42> 8586\n<ee43> <ee43> 7727\n<ee44> <ee44> 7900\n<ee45> <ee47> 20840\n<ee48> <ee48> 8383\n<ee49> <ee49> 8244\n<ee4a> <ee4c> 20843\n<ee4d> <ee4d> 9673\n<ee4e> <ee51> 20846\n<ee52> <ee52> 9672\n<ee53> <ee54> 20850\n<ee55> <ee55> 8718\n<ee56> <ee56> 20852\n<ee57> <ee57> 9675\n<ee58> <ee5d> 20853\n<ee5e> <ee5e> 8573\n<ee5f> <ee60> 20859\n<ee61> <ee61> 8062\n<ee62> <ee67> 20861\n<ee68> <ee68> 9676\n<ee69> <ee69> 8131\n<ee6a> <ee6b> 20867\n<ee6c> <ee6c> 8377\n<ee6d> <ee6d> 20869\n<ee6e> <ee6e> 8577\n<ee6f> <ee76> 20870\n<ee77> <ee77> 8154\n<ee78> <ee7c> 20878\n<ee7d> <ee7d> 8563\n<ee7e> <ee7e> 7905\n<ee80> <ee80> 9677\n<ee81> <ee84> 20883\n<ee85> <ee85> 9678\n<ee86> <ee86> 8694\n<ee87> <ee89> 20887\n<ee8a> <ee8a> 8779\n<ee8b> <ee8b> 9681\n<ee8c> <ee8c> 20890\n<ee8d> <ee8d> 7872\n<ee8e> <ee8f> 20891\n<ee90> <ee90> 8200\n<ee91> <ee93> 20893\n<ee94> <ee94> 9680\n<ee95> <ee96> 20896\n<ee97> <ee97> 9682\n<ee98> <ee98> 20898\nendcidrange\n\n100 begincidrange\n<ee99> <ee99> 7978\n<ee9a> <ee9c> 20899\n<ee9d> <ee9d> 7794\n<ee9e> <ee9e> 9683\n<ee9f> <eea0> 20902\n<eea1> <eefe> 6763\n<ef40> <ef40> 8638\n<ef41> <ef41> 9684\n<ef42> <ef42> 8260\n<ef43> <ef43> 20904\n<ef44> <ef44> 9679\n<ef45> <ef45> 8435\n<ef46> <ef4b> 20905\n<ef4c> <ef4c> 7936\n<ef4d> <ef51> 20911\n<ef52> <ef53> 9420\n<ef54> <ef54> 20916\n<ef55> <ef55> 9880\n<ef56> <ef56> 20917\n<ef57> <ef57> 9848\n<ef58> <ef59> 20918\n<ef5a> <ef5a> 9422\n<ef5b> <ef5f> 20920\n<ef60> <ef60> 9423\n<ef61> <ef67> 20925\n<ef68> <ef68> 8376\n<ef69> <ef69> 20932\n<ef6a> <ef6a> 9424\n<ef6b> <ef6b> 20933\n<ef6c> <ef6c> 9425\n<ef6d> <ef76> 20934\n<ef77> <ef77> 7924\n<ef78> <ef79> 20944\n<ef7a> <ef7a> 9115\n<ef7b> <ef7b> 20946\n<ef7c> <ef7c> 9854\n<ef7d> <ef7e> 20947\n<ef80> <ef81> 20949\n<ef82> <ef82> 9117\n<ef83> <ef84> 9119\n<ef85> <ef85> 20951\n<ef86> <ef86> 9121\n<ef87> <ef87> 20952\n<ef88> <ef88> 7921\n<ef89> <ef8a> 20953\n<ef8b> <ef8b> 8734\n<ef8c> <ef8c> 20955\n<ef8d> <ef8d> 9122\n<ef8e> <ef94> 20956\n<ef95> <ef95> 8523\n<ef96> <ef96> 7734\n<ef97> <ef97> 8501\n<ef98> <ef9b> 20963\n<ef9c> <ef9c> 8109\n<ef9d> <ef9d> 20967\n<ef9e> <ef9e> 7763\n<ef9f> <efa0> 20968\n<efa1> <effe> 6857\n<f040> <f040> 20970\n<f041> <f041> 9123\n<f042> <f042> 8707\n<f043> <f043> 20971\n<f044> <f044> 7911\n<f045> <f046> 20972\n<f047> <f047> 9124\n<f048> <f048> 8343\n<f049> <f049> 7908\n<f04a> <f04d> 20974\n<f04e> <f04e> 8760\n<f04f> <f050> 20978\n<f051> <f051> 9125\n<f052> <f053> 20980\n<f054> <f054> 8090\n<f055> <f056> 20982\n<f057> <f057> 8643\n<f058> <f05d> 20984\n<f05e> <f05e> 7982\n<f05f> <f067> 20990\n<f068> <f068> 9116\n<f069> <f06b> 20999\n<f06c> <f06c> 9126\n<f06d> <f070> 21002\n<f071> <f071> 9118\n<f072> <f072> 21006\n<f073> <f073> 8245\n<f074> <f074> 9127\n<f075> <f077> 21007\n<f078> <f078> 9128\n<f079> <f079> 21010\n<f07a> <f07a> 8309\n<f07b> <f07c> 21011\n<f07d> <f07e> 9129\n<f080> <f080> 9131\n<f081> <f081> 8171\n<f082> <f082> 9132\n<f083> <f086> 21013\n<f087> <f087> 8042\n<f088> <f088> 8441\n<f089> <f08a> 21017\n<f08b> <f08b> 9830\nendcidrange\n\n100 begincidrange\n<f08c> <f08f> 21019\n<f090> <f090> 9831\n<f091> <f091> 21023\n<f092> <f092> 7788\n<f093> <f095> 21024\n<f096> <f096> 9133\n<f097> <f0a0> 21027\n<f0a1> <f0fe> 6951\n<f140> <f151> 21037\n<f152> <f152> 8301\n<f153> <f153> 8770\n<f154> <f154> 7938\n<f155> <f156> 21055\n<f157> <f157> 8579\n<f158> <f158> 21057\n<f159> <f159> 7813\n<f15a> <f15a> 8681\n<f15b> <f166> 21058\n<f167> <f167> 7767\n<f168> <f175> 21070\n<f176> <f176> 8869\n<f177> <f177> 9223\n<f178> <f178> 8138\n<f179> <f179> 21084\n<f17a> <f17a> 9218\n<f17b> <f17b> 8066\n<f17c> <f17d> 21085\n<f17e> <f17e> 9224\n<f180> <f180> 9220\n<f181> <f181> 21087\n<f182> <f182> 8497\n<f183> <f183> 21088\n<f184> <f184> 8580\n<f185> <f185> 21089\n<f186> <f186> 9219\n<f187> <f187> 21090\n<f188> <f188> 8302\n<f189> <f189> 9227\n<f18a> <f193> 21091\n<f194> <f194> 7999\n<f195> <f197> 21101\n<f198> <f198> 8295\n<f199> <f1a0> 21104\n<f1a1> <f1fe> 7045\n<f240> <f244> 21112\n<f245> <f245> 8151\n<f246> <f246> 21117\n<f247> <f247> 7811\n<f248> <f24a> 21118\n<f24b> <f24b> 9231\n<f24c> <f252> 21121\n<f253> <f253> 9230\n<f254> <f254> 8391\n<f255> <f255> 9229\n<f256> <f25b> 21128\n<f25c> <f25c> 9234\n<f25d> <f25e> 21134\n<f25f> <f25f> 8375\n<f260> <f270> 21136\n<f271> <f271> 9200\n<f272> <f272> 21153\n<f273> <f273> 9233\n<f274> <f274> 9236\n<f275> <f275> 21154\n<f276> <f276> 8560\n<f277> <f27b> 21155\n<f27c> <f27c> 9221\n<f27d> <f27d> 8460\n<f27e> <f27e> 9237\n<f280> <f284> 21160\n<f285> <f285> 8294\n<f286> <f286> 21165\n<f287> <f287> 9042\n<f288> <f288> 9235\n<f289> <f289> 9232\n<f28a> <f28b> 9238\n<f28c> <f28c> 8433\n<f28d> <f290> 21166\n<f291> <f291> 9226\n<f292> <f293> 21170\n<f294> <f294> 9225\n<f295> <f295> 21172\n<f296> <f296> 9240\n<f297> <f29b> 21173\n<f29c> <f29c> 8103\n<f29d> <f29d> 21178\n<f29e> <f29e> 8700\n<f29f> <f2a0> 21179\n<f2a1> <f2fe> 7139\n<f340> <f340> 8129\n<f341> <f341> 9222\n<f342> <f344> 21181\n<f345> <f345> 8860\n<f346> <f347> 21184\n<f348> <f348> 8270\n<f349> <f349> 21186\n<f34a> <f34a> 9242\n<f34b> <f34b> 9241\n<f34c> <f34f> 21187\n<f350> <f350> 9228\nendcidrange\n\n100 begincidrange\n<f351> <f360> 21191\n<f361> <f361> 7721\n<f362> <f373> 21207\n<f374> <f374> 9825\n<f375> <f375> 21225\n<f376> <f376> 9892\n<f377> <f377> 8564\n<f378> <f378> 9827\n<f379> <f379> 9826\n<f37a> <f37e> 21226\n<f380> <f38b> 21231\n<f38c> <f38c> 9845\n<f38d> <f39f> 21243\n<f3a0> <f3a0> 8524\n<f3a1> <f3fe> 7233\n<f440> <f444> 21262\n<f445> <f445> 9850\n<f446> <f44f> 21267\n<f450> <f450> 9888\n<f451> <f456> 21277\n<f457> <f457> 9832\n<f458> <f458> 21283\n<f459> <f459> 7888\n<f45a> <f45a> 21284\n<f45b> <f45b> 8342\n<f45c> <f45c> 21285\n<f45d> <f45d> 9164\n<f45e> <f461> 21286\n<f462> <f462> 9160\n<f463> <f463> 21290\n<f464> <f464> 8766\n<f465> <f474> 21291\n<f475> <f475> 9829\n<f476> <f47b> 21307\n<f47c> <f47c> 9828\n<f47d> <f47d> 21313\n<f47e> <f47e> 8761\n<f480> <f493> 21314\n<f494> <f494> 8266\n<f495> <f498> 21334\n<f499> <f499> 9759\n<f49a> <f49b> 21338\n<f49c> <f49c> 9758\n<f49d> <f4a0> 21340\n<f4a1> <f4fe> 7327\n<f540> <f544> 21344\n<f545> <f545> 9760\n<f546> <f546> 21349\n<f547> <f547> 9761\n<f548> <f551> 21350\n<f552> <f552> 9762\n<f553> <f553> 21360\n<f554> <f554> 9767\n<f555> <f555> 7737\n<f556> <f556> 9765\n<f557> <f55d> 21361\n<f55e> <f55e> 9769\n<f55f> <f560> 21368\n<f561> <f561> 9774\n<f562> <f562> 9771\n<f563> <f56d> 21370\n<f56e> <f56e> 9770\n<f56f> <f56f> 9773\n<f570> <f570> 21381\n<f571> <f571> 9768\n<f572> <f572> 8633\n<f573> <f57e> 21382\n<f580> <f584> 21394\n<f585> <f585> 9782\n<f586> <f586> 9776\n<f587> <f58b> 21399\n<f58c> <f58c> 9784\n<f58d> <f58d> 21404\n<f58e> <f58e> 8205\n<f58f> <f58f> 9783\n<f590> <f598> 21405\n<f599> <f599> 9797\n<f59a> <f59a> 21414\n<f59b> <f59b> 9786\n<f59c> <f59f> 21415\n<f5a0> <f5a0> 9795\n<f5a1> <f5fe> 7421\n<f640> <f640> 21419\n<f641> <f641> 9792\n<f642> <f644> 21420\n<f645> <f645> 9789\n<f646> <f646> 9793\n<f647> <f647> 21423\n<f648> <f648> 9790\n<f649> <f64a> 21424\n<f64b> <f64b> 9791\n<f64c> <f64c> 8128\n<f64d> <f64d> 21426\n<f64e> <f64f> 9787\n<f650> <f653> 21427\n<f654> <f654> 9794\n<f655> <f657> 21431\n<f658> <f658> 9796\n<f659> <f660> 21434\n<f661> <f661> 9785\nendcidrange\n\n100 begincidrange\n<f662> <f662> 21442\n<f663> <f663> 9804\n<f664> <f66b> 21443\n<f66c> <f66c> 9799\n<f66d> <f66d> 9803\n<f66e> <f670> 21451\n<f671> <f671> 9801\n<f672> <f673> 21454\n<f674> <f674> 9800\n<f675> <f675> 21456\n<f676> <f676> 9802\n<f677> <f677> 8456\n<f678> <f67e> 21457\n<f680> <f684> 21464\n<f685> <f685> 9805\n<f686> <f687> 21469\n<f688> <f688> 9780\n<f689> <f689> 21471\n<f68a> <f68a> 9809\n<f68b> <f68c> 21472\n<f68d> <f68d> 9808\n<f68e> <f68e> 9810\n<f68f> <f691> 21474\n<f692> <f692> 9807\n<f693> <f695> 21477\n<f696> <f696> 9778\n<f697> <f697> 9806\n<f698> <f698> 9811\n<f699> <f699> 21480\n<f69a> <f69a> 9815\n<f69b> <f69b> 21481\n<f69c> <f69c> 9781\n<f69d> <f69d> 21482\n<f69e> <f69e> 9779\n<f69f> <f69f> 21483\n<f6a0> <f6a0> 9814\n<f6a1> <f6fe> 7515\n<f740> <f741> 21484\n<f742> <f742> 9812\n<f743> <f748> 21486\n<f749> <f749> 9816\n<f74a> <f74b> 21492\n<f74c> <f74c> 9813\n<f74d> <f74d> 7757\n<f74e> <f755> 21494\n<f756> <f756> 9819\n<f757> <f757> 21502\n<f758> <f758> 9818\n<f759> <f759> 21503\n<f75a> <f75a> 9817\n<f75b> <f75b> 8238\n<f75c> <f75c> 9775\n<f75d> <f760> 21504\n<f761> <f761> 9798\n<f762> <f762> 21508\n<f763> <f763> 9766\n<f764> <f76a> 21509\n<f76b> <f76b> 9820\n<f76c> <f770> 21516\n<f771> <f771> 9772\n<f772> <f77b> 21521\n<f77c> <f77c> 9763\n<f77d> <f77d> 21531\n<f77e> <f77e> 9777\n<f780> <f7a0> 21532\n<f7a1> <f7fe> 7609\n<f840> <f841> 21565\n<f842> <f842> 8348\n<f843> <f845> 21567\n<f846> <f846> 9600\n<f847> <f848> 21570\n<f849> <f849> 8924\n<f84a> <f84f> 21572\n<f850> <f850> 7941\n<f851> <f851> 8331\n<f852> <f852> 21578\n<f853> <f853> 9601\n<f854> <f862> 21579\n<f863> <f863> 9603\n<f864> <f864> 9602\n<f865> <f865> 21594\n<f866> <f866> 8686\n<f867> <f871> 21595\n<f872> <f872> 8578\n<f873> <f877> 21606\n<f878> <f878> 8771\n<f879> <f879> 21611\n<f87a> <f87a> 9607\n<f87b> <f87b> 21612\n<f87c> <f87c> 9608\n<f87d> <f87e> 21613\n<f880> <f880> 21615\n<f881> <f881> 9604\n<f882> <f883> 21616\n<f884> <f884> 8701\n<f885> <f885> 21618\n<f886> <f886> 8687\n<f887> <f88c> 21619\n<f88d> <f88d> 9610\n<f88e> <f88e> 9612\nendcidrange\n\n100 begincidrange\n<f88f> <f898> 21625\n<f899> <f899> 8007\n<f89a> <f89c> 21635\n<f89d> <f89d> 7965\n<f89e> <f89f> 21638\n<f8a0> <f8a0> 9613\n<f940> <f94d> 21640\n<f94e> <f94e> 8144\n<f94f> <f94f> 9618\n<f950> <f950> 9615\n<f951> <f958> 21654\n<f959> <f959> 9620\n<f95a> <f95a> 7904\n<f95b> <f95c> 21662\n<f95d> <f95d> 9617\n<f95e> <f95e> 9621\n<f95f> <f966> 21664\n<f967> <f967> 9623\n<f968> <f968> 21672\n<f969> <f969> 8374\n<f96a> <f96b> 21673\n<f96c> <f96c> 9624\n<f96d> <f96e> 21675\n<f96f> <f96f> 8438\n<f970> <f97e> 21677\n<f980> <f984> 21692\n<f985> <f985> 9605\n<f986> <f986> 21697\n<f987> <f987> 9625\n<f988> <f990> 21698\n<f991> <f991> 9622\n<f992> <f995> 21707\n<f996> <f996> 9626\n<f997> <f997> 21711\n<f998> <f998> 9627\n<f999> <f9a0> 21712\n<fa40> <fa41> 21720\n<fa42> <fa42> 9629\n<fa43> <fa45> 21722\n<fa46> <fa46> 9630\n<fa47> <fa4b> 21725\n<fa4c> <fa4c> 9036\n<fa4d> <fa50> 21730\n<fa51> <fa51> 8004\n<fa52> <fa57> 21734\n<fa58> <fa58> 9824\n<fa59> <fa59> 9632\n<fa5a> <fa5c> 21740\n<fa5d> <fa5d> 9628\n<fa5e> <fa5e> 21743\n<fa5f> <fa5f> 9631\n<fa60> <fa60> 21744\n<fa61> <fa61> 8044\n<fa62> <fa6f> 21745\n<fa70> <fa70> 9634\n<fa71> <fa73> 21759\n<fa74> <fa74> 8366\n<fa75> <fa75> 21762\n<fa76> <fa76> 9611\n<fa77> <fa77> 9635\n<fa78> <fa7e> 21763\n<fa80> <fa82> 21770\n<fa83> <fa83> 9609\n<fa84> <fa84> 9637\n<fa85> <fa8c> 21773\n<fa8d> <fa8d> 9636\n<fa8e> <fa8f> 21781\n<fa90> <fa90> 9638\n<fa91> <fa91> 9619\n<fa92> <fa95> 21783\n<fa96> <fa96> 9639\n<fa97> <fa97> 8738\n<fa98> <fa98> 9641\n<fa99> <faa0> 21787\n<fb40> <fb48> 21795\n<fb49> <fb49> 9640\n<fb4a> <fb51> 21804\n<fb52> <fb52> 9606\n<fb53> <fb56> 21812\n<fb57> <fb57> 9633\n<fb58> <fb58> 9642\n<fb59> <fb59> 21816\n<fb5a> <fb5a> 9616\n<fb5b> <fb5b> 9614\n<fb5c> <fb74> 21817\n<fb75> <fb75> 9864\n<fb76> <fb78> 21842\n<fb79> <fb79> 9886\n<fb7a> <fb7a> 9723\n<fb7b> <fb7b> 21845\n<fb7c> <fb7c> 8076\n<fb7d> <fb7d> 8692\n<fb7e> <fb7e> 21846\n<fb80> <fb8f> 21847\n<fb90> <fb90> 8207\n<fb91> <fb9b> 21863\n<fb9c> <fb9c> 8305\n<fb9d> <fb9e> 21874\n<fb9f> <fb9f> 9719\n<fba0> <fba0> 21876\nendcidrange\n\n70 begincidrange\n<fc40> <fc43> 21877\n<fc44> <fc44> 9878\n<fc45> <fc48> 21881\n<fc49> <fc49> 9871\n<fc4a> <fc59> 21885\n<fc5a> <fc5a> 8922\n<fc5b> <fc62> 21901\n<fc63> <fc63> 7873\n<fc64> <fc67> 21909\n<fc68> <fc68> 7859\n<fc69> <fc6e> 21913\n<fc6f> <fc6f> 9834\n<fc70> <fc70> 21919\n<fc71> <fc71> 9866\n<fc72> <fc73> 21920\n<fc74> <fc74> 9833\n<fc75> <fc76> 21922\n<fc77> <fc78> 9752\n<fc79> <fc7e> 21924\n<fc80> <fc82> 21930\n<fc83> <fc83> 9754\n<fc84> <fc89> 21933\n<fc8a> <fc8a> 9843\n<fc8b> <fca0> 21939\n<fd40> <fd51> 21961\n<fd52> <fd52> 8390\n<fd53> <fd53> 8811\n<fd54> <fd56> 21979\n<fd57> <fd57> 9427\n<fd58> <fd58> 7814\n<fd59> <fd59> 21982\n<fd5a> <fd5a> 9743\n<fd5b> <fd5e> 21983\n<fd5f> <fd5f> 9745\n<fd60> <fd61> 21987\n<fd62> <fd62> 9747\n<fd63> <fd64> 21989\n<fd65> <fd65> 9744\n<fd66> <fd66> 9746\n<fd67> <fd67> 8240\n<fd68> <fd68> 21991\n<fd69> <fd69> 9841\n<fd6a> <fd6b> 21992\n<fd6c> <fd6c> 9748\n<fd6d> <fd6f> 21994\n<fd70> <fd70> 9750\n<fd71> <fd71> 21997\n<fd72> <fd72> 9749\n<fd73> <fd77> 21998\n<fd78> <fd78> 8434\n<fd79> <fd7c> 22003\n<fd7d> <fd7d> 9751\n<fd7e> <fd7e> 22007\n<fd80> <fd87> 22008\n<fd88> <fd88> 8247\n<fd89> <fd8a> 22016\n<fd8b> <fd8b> 8371\n<fd8c> <fd8e> 22018\n<fd8f> <fd8f> 7970\n<fd90> <fd90> 9453\n<fd91> <fd93> 22021\n<fd94> <fd94> 7988\n<fd95> <fd9c> 22024\n<fd9d> <fd9d> 2562\n<fd9e> <fd9e> 16595\n<fd9f> <fd9f> 8204\n<fda0> <fda0> 20611\n<fe40> <fe40> 4697\n<fe41> <fe7e> 22032\n<fe80> <fea0> 22094\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/GBKp-EUC-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (GBKp-EUC-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (GBKp-EUC-H)\n%%BeginResource: CMap (GBKp-EUC-V)\n%%Title: (GBKp-EUC-V Adobe GB1 2)\n%%Version: 12.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/GBKp-EUC-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 2 def\nend def\n\n/CMapName /GBKp-EUC-V def\n/CMapVersion 12.002 def\n/CMapType 1 def\n\n/XUID [1 10 25456] def\n\n/WMode 1 def\n\n20 begincidrange\n<a1a2> <a1a2>  575\n<a1a3> <a1a3>  574\n<a1aa> <a1aa>  598\n<a1ab> <a1ac> 7704\n<a1ad> <a1ad>  599\n<a1b2> <a1bf>  582\n<a1fe> <a1fe> 7706\n<a3a1> <a3a1>  578\n<a3a8> <a3a9>  580\n<a3ac> <a3ac>  573\n<a3ae> <a3ae> 7707\n<a3ba> <a3bb>  576\n<a3bd> <a3bd> 7708\n<a3bf> <a3bf>  579\n<a3db> <a3db> 7709\n<a3dd> <a3dd> 7710\n<a3df> <a3df>  600\n<a3fb> <a3fb>  596\n<a3fd> <a3fd>  597\n<a3fe> <a3fe> 7711\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/GBT-EUC-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (GBT-EUC-H)\n%%Title: (GBT-EUC-H Adobe GB1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 1 def\nend def\n\n/CMapName /GBT-EUC-H def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 480 def\n/XUID [1 10 25370] def\n\n/WMode 0 def\n\n2 begincodespacerange\n  <00>   <80>\n  <A1A1> <FEFE>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 7716\nendnotdefrange\n\n100 begincidrange\n<20> <20> 7716\n<21> <7e> 814\n<a1a1> <a1fe> 96\n<a2b1> <a2e2> 190\n<a2e5> <a2ee> 240\n<a2f1> <a2fc> 250\n<a3a1> <a3fe> 262\n<a4a1> <a4f3> 356\n<a5a1> <a5f6> 439\n<a6a1> <a6b8> 525\n<a6c1> <a6f5> 549\n<a7a1> <a7c1> 602\n<a7d1> <a7f1> 635\n<a8a1> <a8c0> 668\n<a8c5> <a8ea> 700\n<a9a4> <a9ef> 738\n<aaa1> <aafe> 814\n<aba1> <abc0> 908\n<b0a1> <b0a7> 940\n<b0a8> <b0a8> 7717\n<b0a9> <b0a9> 948\n<b0aa> <b0aa> 7718\n<b0ab> <b0ac> 950\n<b0ad> <b0ae> 7719\n<b0af> <b0b8> 954\n<b0b9> <b0b9> 7721\n<b0ba> <b0bf> 965\n<b0c0> <b0c0> 7722\n<b0c1> <b0d2> 972\n<b0d3> <b0d3> 7723\n<b0d4> <b0d4> 991\n<b0d5> <b0d5> 7724\n<b0d6> <b0d9> 993\n<b0da> <b0da> 7725\n<b0db> <b0db> 998\n<b0dc> <b0dc> 7726\n<b0dd> <b0e3> 1000\n<b0e4> <b0e4> 7727\n<b0e5> <b0eb> 1008\n<b0ec> <b0ed> 7728\n<b0ee> <b0ee> 1017\n<b0ef> <b0ef> 7730\n<b0f0> <b0f2> 1019\n<b0f3> <b0f3> 7731\n<b0f4> <b0f6> 1023\n<b0f7> <b0f7> 7732\n<b0f8> <b0f8> 1027\n<b0f9> <b0f9> 7733\n<b0fa> <b0fe> 1029\n<b1a1> <b1a4> 1034\n<b1a5> <b1a6> 7734\n<b1a7> <b1a7> 1040\n<b1a8> <b1a8> 7736\n<b1a9> <b1aa> 1042\n<b1ab> <b1ab> 7737\n<b1ac> <b1b1> 1045\n<b1b2> <b1b2> 7738\n<b1b3> <b1b3> 1052\n<b1b4> <b1b5> 7739\n<b1b6> <b1b6> 1055\n<b1b7> <b1b9> 7741\n<b1ba> <b1c0> 1059\n<b1c1> <b1c1> 7744\n<b1c2> <b1c9> 1067\n<b1ca> <b1ca> 7745\n<b1cb> <b1ce> 1076\n<b1cf> <b1d0> 7746\n<b1d1> <b1d1> 1082\n<b1d2> <b1d2> 7748\n<b1d3> <b1d4> 1084\n<b1d5> <b1d5> 7749\n<b1d6> <b1de> 1087\n<b1df> <b1e1> 7750\n<b1e2> <b1e3> 1099\n<b1e4> <b1e4> 7753\n<b1e5> <b1e6> 1102\n<b1e7> <b1e8> 7754\n<b1e9> <b1e9> 1106\n<b1ea> <b1ea> 7756\n<b1eb> <b1ed> 1108\n<b1ee> <b1ee> 7757\n<b1ef> <b1f0> 1112\n<b1f1> <b1f1> 7758\n<b1f2> <b1f3> 1115\n<b1f4> <b1f7> 7759\n<b1f8> <b1fc> 1121\n<b1fd> <b1fd> 7763\n<b1fe> <b1fe> 1127\n<b2a1> <b2a5> 1128\n<b2a6> <b2a7> 7764\n<b2a8> <b2ab> 1135\n<b2ac> <b2ac> 7766\n<b2ad> <b2b4> 1140\n<b2b5> <b2b5> 7767\n<b2b6> <b2b8> 1149\n<b2b9> <b2b9> 7768\n<b2ba> <b2c5> 1153\n<b2c6> <b2c6> 7769\n<b2c7> <b2cd> 1166\n<b2ce> <b2d7> 7770\nendcidrange\n\n100 begincidrange\n<b2d8> <b2dd> 1183\n<b2de> <b2de> 7780\n<b2df> <b2df> 1190\n<b2e0> <b2e0> 7781\n<b2e1> <b2e1> 1192\n<b2e2> <b2e3> 7782\n<b2e4> <b2ee> 1195\n<b2ef> <b2ef> 7784\n<b2f0> <b2f2> 1207\n<b2f3> <b2fc> 7785\n<b2fd> <b2fe> 1220\n<b3a1> <b3a2> 7795\n<b3a3> <b3a3> 1224\n<b3a4> <b3a7> 7797\n<b3a8> <b3a8> 1229\n<b3a9> <b3a9> 7801\n<b3aa> <b3ad> 1231\n<b3ae> <b3ae> 7802\n<b3af> <b3b4> 1236\n<b3b5> <b3b5> 7803\n<b3b6> <b3b8> 1243\n<b3b9> <b3b9> 7804\n<b3ba> <b3bd> 1247\n<b3be> <b3be> 7805\n<b3bf> <b3c1> 1252\n<b3c2> <b3c2> 7806\n<b3c3> <b3c3> 1256\n<b3c4> <b3c4> 7807\n<b3c5> <b3c5> 1258\n<b3c6> <b3c6> 7808\n<b3c7> <b3cc> 1260\n<b3cd> <b3cd> 7809\n<b3ce> <b3ce> 1267\n<b3cf> <b3cf> 7810\n<b3d0> <b3d1> 1269\n<b3d2> <b3d2> 7811\n<b3d3> <b3d8> 1272\n<b3d9> <b3d9> 7812\n<b3da> <b3da> 1279\n<b3db> <b3db> 7813\n<b3dc> <b3dc> 1281\n<b3dd> <b3dd> 7814\n<b3de> <b3e2> 1283\n<b3e3> <b3e3> 7815\n<b3e4> <b3e4> 1289\n<b3e5> <b3e6> 7816\n<b3e7> <b3e7> 1292\n<b3e8> <b3e8> 7818\n<b3e9> <b3ea> 1294\n<b3eb> <b3ec> 7819\n<b3ed> <b3ee> 1298\n<b3ef> <b3ef> 7821\n<b3f0> <b3f0> 1301\n<b3f1> <b3f1> 7822\n<b3f2> <b3f2> 1303\n<b3f3> <b3f3> 7823\n<b3f4> <b3f9> 1305\n<b3fa> <b3fb> 7824\n<b3fc> <b3fe> 1313\n<b4a1> <b4a2> 7826\n<b4a3> <b4a4> 1318\n<b4a5> <b4a6> 7828\n<b4a7> <b4aa> 1322\n<b4ab> <b4ab> 7830\n<b4ac> <b4ae> 1327\n<b4af> <b4af> 7831\n<b4b0> <b4b2> 1331\n<b4b3> <b4b4> 7832\n<b4b5> <b4b7> 1336\n<b4b8> <b4b8> 7834\n<b4b9> <b4be> 1340\n<b4bf> <b4bf> 7835\n<b4c0> <b4c1> 1347\n<b4c2> <b4c2> 7836\n<b4c3> <b4c6> 1350\n<b4c7> <b4c7> 7837\n<b4c8> <b4c9> 1355\n<b4ca> <b4ca> 7838\n<b4cb> <b4cc> 1358\n<b4cd> <b4cd> 7839\n<b4ce> <b4ce> 1361\n<b4cf> <b4cf> 7840\n<b4d0> <b4d2> 1363\n<b4d3> <b4d4> 7841\n<b4d5> <b4d9> 1368\n<b4da> <b4da> 7843\n<b4db> <b4db> 1374\n<b4dc> <b4dc> 7844\n<b4dd> <b4ec> 1376\n<b4ed> <b4ed> 7845\n<b4ee> <b4ee> 1393\n<b4ef> <b4ef> 7846\n<b4f0> <b4f7> 1395\n<b4f8> <b4f8> 7847\n<b4f9> <b4fa> 1404\n<b4fb> <b4fb> 7848\n<b4fc> <b4fe> 1407\n<b5a1> <b5a2> 1410\n<b5a3> <b5a3> 7849\n<b5a4> <b5a4> 1413\nendcidrange\n\n100 begincidrange\n<b5a5> <b5a8> 7850\n<b5a9> <b5ab> 1418\n<b5ac> <b5ac> 7854\n<b5ad> <b5ad> 1422\n<b5ae> <b5af> 7855\n<b5b0> <b5b0> 1425\n<b5b1> <b5b5> 7857\n<b5b6> <b5b6> 1431\n<b5b7> <b5b7> 7862\n<b5b8> <b5b9> 1433\n<b5ba> <b5bc> 7863\n<b5bd> <b5c5> 1438\n<b5c6> <b5c6> 7866\n<b5c7> <b5ca> 1448\n<b5cb> <b5cb> 7867\n<b5cc> <b5cf> 1453\n<b5d0> <b5d0> 7868\n<b5d1> <b5d2> 1458\n<b5d3> <b5d3> 7869\n<b5d4> <b5dc> 1461\n<b5dd> <b5df> 7870\n<b5e0> <b5e2> 1473\n<b5e3> <b5e3> 7873\n<b5e4> <b5e5> 1477\n<b5e6> <b5e7> 7874\n<b5e8> <b5ec> 1481\n<b5ed> <b5ed> 7876\n<b5ee> <b5f5> 1487\n<b5f6> <b5f7> 7877\n<b5f8> <b5fc> 1497\n<b5fd> <b5fd> 7879\n<b5fe> <b5fe> 1503\n<b6a1> <b6a3> 1504\n<b6a4> <b6a5> 7880\n<b6a6> <b6a6> 1509\n<b6a7> <b6a7> 7882\n<b6a8> <b6a8> 1511\n<b6a9> <b6a9> 7883\n<b6aa> <b6aa> 1513\n<b6ab> <b6ab> 7884\n<b6ac> <b6ae> 1515\n<b6af> <b6b0> 7885\n<b6b1> <b6b2> 1520\n<b6b3> <b6b3> 7887\n<b6b4> <b6b6> 1523\n<b6b7> <b6b7> 7888\n<b6b8> <b6be> 1527\n<b6bf> <b6c1> 7889\n<b6c2> <b6c3> 1537\n<b6c4> <b6c4> 7892\n<b6c5> <b6c5> 1540\n<b6c6> <b6c6> 7893\n<b6c7> <b6cc> 1542\n<b6cd> <b6cd> 7894\n<b6ce> <b6ce> 1549\n<b6cf> <b6d0> 7895\n<b6d1> <b6d2> 1552\n<b6d3> <b6d4> 7897\n<b6d5> <b6d5> 1556\n<b6d6> <b6d6> 7899\n<b6d7> <b6d8> 1558\n<b6d9> <b6d9> 7900\n<b6da> <b6da> 1561\n<b6db> <b6db> 7901\n<b6dc> <b6e0> 1563\n<b6e1> <b6e1> 7902\n<b6e2> <b6e8> 1569\n<b6e9> <b6e9> 7903\n<b6ea> <b6eb> 1577\n<b6ec> <b6ec> 7904\n<b6ed> <b6ed> 1580\n<b6ee> <b6ef> 7905\n<b6f0> <b6f0> 1583\n<b6f1> <b6f1> 7907\n<b6f2> <b6f5> 1585\n<b6f6> <b6f6> 7908\n<b6f7> <b6f8> 1590\n<b6f9> <b6f9> 7909\n<b6fa> <b6fa> 1593\n<b6fb> <b6fc> 7910\n<b6fd> <b6fe> 1596\n<b7a1> <b7a3> 7912\n<b7a4> <b7a6> 1601\n<b7a7> <b7a7> 7915\n<b7a8> <b7ae> 1605\n<b7af> <b7b0> 7916\n<b7b1> <b7b2> 1614\n<b7b3> <b7b3> 7918\n<b7b4> <b7b5> 1617\n<b7b6> <b7b7> 7919\n<b7b8> <b7b8> 1621\n<b7b9> <b7b9> 7921\n<b7ba> <b7c2> 1623\n<b7c3> <b7c4> 7922\n<b7c5> <b7c8> 1634\n<b7c9> <b7c9> 7924\n<b7ca> <b7cb> 1639\n<b7cc> <b7cc> 7925\n<b7cd> <b7ce> 1642\n<b7cf> <b7cf> 7926\nendcidrange\n\n100 begincidrange\n<b7d0> <b7d0> 1645\n<b7d1> <b7d1> 7927\n<b7d2> <b7d6> 1647\n<b7d7> <b7d8> 7928\n<b7d9> <b7db> 1654\n<b7dc> <b7dc> 7930\n<b7dd> <b7de> 1658\n<b7df> <b7e1> 7931\n<b7e2> <b7e2> 1663\n<b7e3> <b7e3> 7934\n<b7e4> <b7e5> 1665\n<b7e6> <b7e8> 7935\n<b7e9> <b7ea> 1670\n<b7eb> <b7ed> 7938\n<b7ee> <b7ee> 1675\n<b7ef> <b7ef> 7941\n<b7f0> <b7f3> 1677\n<b7f4> <b7f4> 7942\n<b7f5> <b7f7> 1682\n<b7f8> <b7f8> 7943\n<b7f9> <b7fe> 1686\n<b8a1> <b8a6> 1692\n<b8a7> <b8a8> 7944\n<b8a9> <b8b2> 1700\n<b8b3> <b8b4> 7946\n<b8b5> <b8b9> 1712\n<b8ba> <b8ba> 7948\n<b8bb> <b8bb> 1718\n<b8bc> <b8bc> 7949\n<b8bd> <b8bd> 1720\n<b8be> <b8bf> 7950\n<b8c0> <b8c2> 1723\n<b8c3> <b8c3> 7952\n<b8c4> <b8c5> 1727\n<b8c6> <b8c7> 7953\n<b8c8> <b8c8> 1731\n<b8c9> <b8c9> 7955\n<b8ca> <b8ce> 1733\n<b8cf> <b8cf> 7956\n<b8d0> <b8d2> 1739\n<b8d3> <b8d6> 7957\n<b8d7> <b8d8> 1746\n<b8d9> <b8da> 7961\n<b8db> <b8e3> 1750\n<b8e4> <b8e4> 7963\n<b8e5> <b8e8> 1760\n<b8e9> <b8e9> 7964\n<b8ea> <b8ea> 1765\n<b8eb> <b8eb> 7965\n<b8ec> <b8f2> 1767\n<b8f3> <b8f3> 7966\n<b8f4> <b8f4> 1775\n<b8f5> <b8f6> 7967\n<b8f7> <b8f7> 1778\n<b8f8> <b8f8> 7969\n<b8f9> <b8fe> 1780\n<b9a1> <b9a7> 1786\n<b9a8> <b9a8> 7970\n<b9a9> <b9ad> 1794\n<b9ae> <b9ae> 7971\n<b9af> <b9b0> 1800\n<b9b1> <b9b1> 7972\n<b9b2> <b9b2> 1803\n<b9b3> <b9b3> 7973\n<b9b4> <b9b4> 1805\n<b9b5> <b9b5> 7974\n<b9b6> <b9b8> 1807\n<b9b9> <b9ba> 7975\n<b9bb> <b9c5> 1812\n<b9c6> <b9c6> 7977\n<b9c7> <b9ca> 1824\n<b9cb> <b9cb> 7978\n<b9cc> <b9cf> 1829\n<b9d0> <b9d0> 7979\n<b9d1> <b9d7> 1834\n<b9d8> <b9d8> 7980\n<b9d9> <b9da> 1842\n<b9db> <b9db> 7981\n<b9dc> <b9dc> 1845\n<b9dd> <b9dd> 7982\n<b9de> <b9de> 1847\n<b9df> <b9df> 7983\n<b9e0> <b9e0> 1849\n<b9e1> <b9e1> 7984\n<b9e2> <b9e2> 1851\n<b9e3> <b9e3> 7985\n<b9e4> <b9e5> 1853\n<b9e6> <b9e6> 7986\n<b9e7> <b9e8> 1856\n<b9e9> <b9ec> 7987\n<b9ed> <b9ed> 1862\n<b9ee> <b9ee> 7991\n<b9ef> <b9f0> 1864\n<b9f1> <b9f1> 7992\n<b9f2> <b9f2> 1867\n<b9f3> <b9f5> 7993\n<b9f6> <b9f7> 1871\n<b9f8> <b9f8> 7996\n<b9f9> <b9f9> 1874\n<b9fa> <b9fa> 7997\nendcidrange\n\n100 begincidrange\n<b9fb> <b9fc> 1876\n<b9fd> <b9fd> 7998\n<b9fe> <b9fe> 1879\n<baa1> <baa6> 1880\n<baa7> <baa7> 7999\n<baa8> <baaa> 1887\n<baab> <baab> 8000\n<baac> <bab9> 1891\n<baba> <baba> 8001\n<babb> <bac4> 1906\n<bac5> <bac5> 8002\n<bac6> <bad1> 1917\n<bad2> <bad2> 8003\n<bad3> <bad6> 1930\n<bad7> <bad8> 8004\n<bad9> <bae3> 1936\n<bae4> <bae4> 8006\n<bae5> <bae7> 1948\n<bae8> <bae8> 8007\n<bae9> <baeb> 1952\n<baec> <baec> 8008\n<baed> <baf2> 1956\n<baf3> <baf3> 5605\n<baf4> <baf7> 1963\n<baf8> <baf8> 8009\n<baf9> <bafe> 1968\n<bba1> <bba3> 1974\n<bba4> <bba4> 8010\n<bba5> <bba5> 1978\n<bba6> <bba6> 8011\n<bba7> <bba8> 1980\n<bba9> <bbaa> 8012\n<bbab> <bbac> 1984\n<bbad> <bbae> 8014\n<bbaf> <bbaf> 1988\n<bbb0> <bbb0> 8016\n<bbb1> <bbb2> 1990\n<bbb3> <bbb3> 8017\n<bbb4> <bbb4> 1993\n<bbb5> <bbb7> 8018\n<bbb8> <bbb8> 1997\n<bbb9> <bbba> 8021\n<bbbb> <bbd0> 2000\n<bbd1> <bbd1> 8023\n<bbd2> <bbd2> 2023\n<bbd3> <bbd4> 8024\n<bbd5> <bbde> 2026\n<bbdf> <bbe7> 8026\n<bbe8> <bbea> 2045\n<bbeb> <bbeb> 8035\n<bbec> <bbf0> 2049\n<bbf1> <bbf1> 8036\n<bbf2> <bbf4> 2055\n<bbf5> <bbf7> 8037\n<bbf8> <bbf9> 2061\n<bbfa> <bbfa> 8040\n<bbfb> <bbfc> 2064\n<bbfd> <bbfd> 8041\n<bbfe> <bbfe> 2067\n<bca1> <bca1> 2068\n<bca2> <bca2> 8042\n<bca3> <bca4> 2070\n<bca5> <bca6> 8043\n<bca7> <bca7> 2074\n<bca8> <bca9> 8045\n<bcaa> <bcaa> 2077\n<bcab> <bcab> 8047\n<bcac> <bcac> 2079\n<bcad> <bcad> 8048\n<bcae> <bcb5> 2081\n<bcb6> <bcb8> 8049\n<bcb9> <bcba> 2092\n<bcbb> <bcbb> 8052\n<bcbc> <bcc0> 2095\n<bcc1> <bcc1> 8053\n<bcc2> <bcc2> 2101\n<bcc3> <bcc3> 8054\n<bcc4> <bcc5> 2103\n<bcc6> <bcc7> 8055\n<bcc8> <bcc9> 2107\n<bcca> <bcca> 8057\n<bccb> <bccb> 2110\n<bccc> <bccd> 8058\n<bcce> <bccf> 2113\n<bcd0> <bcd0> 8060\n<bcd1> <bcd3> 2116\n<bcd4> <bcd6> 8061\n<bcd7> <bcd7> 2122\n<bcd8> <bcd8> 8064\n<bcd9> <bcda> 2124\n<bcdb> <bcdb> 8065\n<bcdc> <bcdc> 2127\n<bcdd> <bcdd> 8066\n<bcde> <bcde> 2129\n<bcdf> <bce1> 8067\n<bce2> <bce2> 2133\n<bce3> <bce4> 8070\n<bce5> <bce7> 2136\n<bce8> <bce8> 8072\n<bce9> <bce9> 2140\nendcidrange\n\n100 begincidrange\n<bcea> <bcec> 8073\n<bced> <bcee> 2144\n<bcef> <bcf3> 8076\n<bcf4> <bcf5> 2151\n<bcf6> <bcfc> 8081\n<bcfd> <bcfe> 2160\n<bda1> <bda1> 2162\n<bda2> <bda7> 8088\n<bda8> <bdaa> 2169\n<bdab> <bdac> 8094\n<bdad> <bdae> 2174\n<bdaf> <bdb2> 8096\n<bdb3> <bdb3> 2180\n<bdb4> <bdb4> 8100\n<bdb5> <bdb9> 2182\n<bdba> <bdba> 8101\n<bdbb> <bdbc> 2188\n<bdbd> <bdbf> 8102\n<bdc0> <bdc0> 2193\n<bdc1> <bdc4> 8105\n<bdc5> <bdc7> 2198\n<bdc8> <bdca> 8109\n<bdcb> <bdcd> 2204\n<bdce> <bdcf> 8112\n<bdd0> <bdd6> 2209\n<bdd7> <bdd7> 8114\n<bdd8> <bdd9> 2217\n<bdda> <bdda> 8115\n<bddb> <bddf> 2220\n<bde0> <bde1> 8116\n<bde2> <bdea> 2227\n<bdeb> <bdeb> 8118\n<bdec> <bdf3> 2237\n<bdf4> <bdf8> 8119\n<bdf9> <bdfc> 2250\n<bdfd> <bdfd> 8124\n<bdfe> <bdfe> 2255\n<bea1> <bea2> 8125\n<bea3> <bea4> 2258\n<bea5> <bea5> 8127\n<bea6> <bea7> 2261\n<bea8> <bea8> 8128\n<bea9> <bea9> 2264\n<beaa> <beaa> 8129\n<beab> <beac> 2266\n<bead> <bead> 8130\n<beae> <beb0> 2269\n<beb1> <beb1> 8131\n<beb2> <beb4> 2273\n<beb5> <beb7> 8132\n<beb8> <beb9> 2279\n<beba> <beba> 8135\n<bebb> <bebf> 2282\n<bec0> <bec0> 8136\n<bec1> <bec8> 2288\n<bec9> <bec9> 8137\n<beca> <bed3> 2297\n<bed4> <bed4> 8138\n<bed5> <bed8> 2308\n<bed9> <bed9> 8139\n<beda> <bedc> 2313\n<bedd> <bedd> 8140\n<bede> <bee1> 2317\n<bee2> <bee2> 8141\n<bee3> <bee4> 2322\n<bee5> <bee5> 8142\n<bee6> <bee6> 2325\n<bee7> <bee7> 8143\n<bee8> <bee8> 2327\n<bee9> <bee9> 8144\n<beea> <beed> 2329\n<beee> <beee> 8145\n<beef> <bef4> 2334\n<bef5> <bef5> 8146\n<bef6> <bef6> 2341\n<bef7> <bef8> 8147\n<bef9> <befa> 2344\n<befb> <befc> 8149\n<befd> <befe> 2348\n<bfa1> <bfa4> 2350\n<bfa5> <bfa5> 8151\n<bfa6> <bfa9> 2355\n<bfaa> <bfaa> 8152\n<bfab> <bfac> 2360\n<bfad> <bfad> 8153\n<bfae> <bfc4> 2363\n<bfc5> <bfc5> 8154\n<bfc6> <bfc6> 2387\n<bfc7> <bfc7> 8155\n<bfc8> <bfcd> 2389\n<bfce> <bfce> 8156\n<bfcf> <bfd0> 2396\n<bfd1> <bfd2> 8157\n<bfd3> <bfd8> 2400\n<bfd9> <bfd9> 8159\n<bfda> <bfe1> 2407\n<bfe2> <bfe4> 8160\n<bfe5> <bfe8> 2418\n<bfe9> <bfe9> 8163\n<bfea> <bfea> 2423\nendcidrange\n\n100 begincidrange\n<bfeb> <bfeb> 8164\n<bfec> <bfec> 2425\n<bfed> <bfed> 8165\n<bfee> <bff2> 2427\n<bff3> <bff3> 8166\n<bff4> <bff4> 2433\n<bff5> <bff5> 8167\n<bff6> <bff6> 2435\n<bff7> <bff7> 8168\n<bff8> <bff8> 2437\n<bff9> <bffa> 8169\n<bffb> <bffe> 2440\n<c0a1> <c0a1> 8171\n<c0a2> <c0a2> 2445\n<c0a3> <c0a3> 8172\n<c0a4> <c0a8> 2447\n<c0a9> <c0a9> 8173\n<c0aa> <c0aa> 2453\n<c0ab> <c0ab> 8174\n<c0ac> <c0ae> 2455\n<c0af> <c0b0> 8175\n<c0b1> <c0b2> 2460\n<c0b3> <c0b6> 8177\n<c0b7> <c0b7> 2466\n<c0b8> <c0c4> 8181\n<c0c5> <c0cb> 2480\n<c0cc> <c0cd> 8194\n<c0ce> <c0d3> 2489\n<c0d4> <c0d4> 8196\n<c0d5> <c0d5> 2496\n<c0d6> <c0d6> 8197\n<c0d7> <c0d7> 2498\n<c0d8> <c0d8> 8198\n<c0d9> <c0dc> 2500\n<c0dd> <c0dd> 8199\n<c0de> <c0df> 2505\n<c0e0> <c0e0> 8200\n<c0e1> <c0e8> 2508\n<c0e9> <c0e9> 8201\n<c0ea> <c0ea> 2517\n<c0eb> <c0ec> 8202\n<c0ed> <c0ee> 2520\n<c0ef> <c0f1> 8204\n<c0f2> <c0f5> 2525\n<c0f6> <c0fa> 8207\n<c0fb> <c0fe> 2534\n<c1a1> <c1a3> 2538\n<c1a4> <c1a5> 8212\n<c1a6> <c1a8> 2543\n<c1a9> <c1ad> 8214\n<c1ae> <c1ae> 2551\n<c1af> <c1b8> 8219\n<c1b9> <c1bc> 2562\n<c1bd> <c1be> 8229\n<c1bf> <c1c1> 2568\n<c1c2> <c1c2> 8231\n<c1c3> <c1c5> 2572\n<c1c6> <c1c6> 8232\n<c1c7> <c1c8> 2576\n<c1c9> <c1c9> 8233\n<c1ca> <c1cc> 2579\n<c1cd> <c1cd> 8234\n<c1ce> <c1d3> 2583\n<c1d4> <c1d4> 8235\n<c1d5> <c1d8> 2590\n<c1d9> <c1db> 8236\n<c1dc> <c1dd> 2597\n<c1de> <c1de> 8239\n<c1df> <c1e3> 2600\n<c1e4> <c1e5> 8240\n<c1e6> <c1e8> 2607\n<c1e9> <c1e9> 8242\n<c1ea> <c1ea> 2611\n<c1eb> <c1ec> 8243\n<c1ed> <c1f2> 2614\n<c1f3> <c1f3> 8245\n<c1f4> <c1f4> 2621\n<c1f5> <c1f5> 8246\n<c1f6> <c1f9> 2623\n<c1fa> <c1fd> 8247\n<c1fe> <c1fe> 2631\n<c2a1> <c2a1> 2632\n<c2a2> <c2a8> 8251\n<c2a9> <c2aa> 2640\n<c2ab> <c2b3> 8258\n<c2b4> <c2b7> 2651\n<c2b8> <c2b8> 8267\n<c2b9> <c2bb> 2656\n<c2bc> <c2bd> 8268\n<c2be> <c2be> 2661\n<c2bf> <c2bf> 8270\n<c2c0> <c2c0> 2663\n<c2c1> <c2c1> 8271\n<c2c2> <c2c4> 2665\n<c2c5> <c2c7> 8272\n<c2c8> <c2ca> 2671\n<c2cb> <c2d0> 8275\n<c2d1> <c2d1> 2680\n<c2d2> <c2d2> 8281\n<c2d3> <c2d4> 2682\nendcidrange\n\n100 begincidrange\n<c2d5> <c2dc> 8282\n<c2dd> <c2dd> 2692\n<c2de> <c2e2> 8290\n<c2e3> <c2e5> 2698\n<c2e6> <c2e8> 8295\n<c2e9> <c2e9> 2704\n<c2ea> <c2ee> 8298\n<c2ef> <c2ef> 2710\n<c2f0> <c2f0> 8303\n<c2f1> <c2f1> 2712\n<c2f2> <c2f5> 8304\n<c2f6> <c2f6> 2717\n<c2f7> <c2fa> 8308\n<c2fb> <c2fe> 2722\n<c3a1> <c3a1> 8312\n<c3a2> <c3a9> 2727\n<c3aa> <c3aa> 8313\n<c3ab> <c3ac> 2736\n<c3ad> <c3ad> 8314\n<c3ae> <c3b2> 2739\n<c3b3> <c3b3> 8315\n<c3b4> <c3b4> 7673\n<c3b5> <c3bd> 2746\n<c3be> <c3be> 8316\n<c3bf> <c3c4> 2756\n<c3c5> <c3c7> 8317\n<c3c8> <c3cb> 2765\n<c3cc> <c3cc> 8320\n<c3cd> <c3cd> 2770\n<c3ce> <c3ce> 8321\n<c3cf> <c3d4> 2772\n<c3d5> <c3d6> 8322\n<c3d7> <c3d8> 2780\n<c3d9> <c3d9> 8324\n<c3da> <c3df> 2783\n<c3e0> <c3e0> 8325\n<c3e1> <c3e4> 2790\n<c3e5> <c3e5> 8326\n<c3e6> <c3ec> 2795\n<c3ed> <c3ed> 8327\n<c3ee> <c3ef> 2803\n<c3f0> <c3f0> 8328\n<c3f1> <c3f4> 2806\n<c3f5> <c3f6> 8329\n<c3f7> <c3f8> 2812\n<c3f9> <c3fa> 8331\n<c3fb> <c3fc> 2816\n<c3fd> <c3fd> 8333\n<c3fe> <c3fe> 2819\n<c4a1> <c4b0> 2820\n<c4b1> <c4b1> 8334\n<c4b2> <c4b5> 2837\n<c4b6> <c4b6> 8335\n<c4b7> <c4c5> 2842\n<c4c6> <c4c6> 8336\n<c4c7> <c4c8> 2858\n<c4c9> <c4c9> 8337\n<c4ca> <c4d0> 2861\n<c4d1> <c4d1> 8338\n<c4d2> <c4d2> 2869\n<c4d3> <c4d6> 8339\n<c4d7> <c4d8> 2874\n<c4d9> <c4d9> 8343\n<c4da> <c4e1> 2877\n<c4e2> <c4e2> 8344\n<c4e3> <c4e4> 2886\n<c4e5> <c4e5> 8345\n<c4e6> <c4eb> 2889\n<c4ec> <c4ec> 8346\n<c4ed> <c4ef> 2896\n<c4f0> <c4f1> 8347\n<c4f2> <c4f3> 2901\n<c4f4> <c4f4> 8349\n<c4f5> <c4f5> 2904\n<c4f6> <c4f8> 8350\n<c4f9> <c4fa> 2908\n<c4fb> <c4fc> 8353\n<c4fd> <c4fd> 2912\n<c4fe> <c4fe> 8355\n<c5a1> <c5a2> 8356\n<c5a3> <c5a4> 2916\n<c5a5> <c5a9> 8358\n<c5aa> <c5b0> 2923\n<c5b1> <c5b1> 8363\n<c5b2> <c5b4> 2931\n<c5b5> <c5b5> 8364\n<c5b6> <c5b6> 2935\n<c5b7> <c5b9> 8365\n<c5ba> <c5ba> 2939\n<c5bb> <c5bb> 8368\n<c5bc> <c5bc> 2941\n<c5bd> <c5bd> 8369\n<c5be> <c5cb> 2943\n<c5cc> <c5cc> 8370\n<c5cd> <c5d2> 2958\n<c5d3> <c5d3> 8371\n<c5d4> <c5e1> 2965\n<c5e2> <c5e2> 8372\n<c5e3> <c5e6> 2980\n<c5e7> <c5e7> 8373\nendcidrange\n\n100 begincidrange\n<c5e8> <c5f3> 2985\n<c5f4> <c5f4> 8374\n<c5f5> <c5fe> 2998\n<c6a1> <c6ac> 3008\n<c6ad> <c6ae> 8375\n<c6af> <c6b4> 3022\n<c6b5> <c6b6> 8377\n<c6b7> <c6ba> 3030\n<c6bb> <c6bb> 8379\n<c6bc> <c6bd> 3035\n<c6be> <c6be> 8380\n<c6bf> <c6bf> 3038\n<c6c0> <c6c0> 8381\n<c6c1> <c6c2> 3040\n<c6c3> <c6c4> 8382\n<c6c5> <c6ca> 3044\n<c6cb> <c6cd> 8384\n<c6ce> <c6d2> 3053\n<c6d3> <c6d3> 8387\n<c6d4> <c6d6> 3059\n<c6d7> <c6d7> 8388\n<c6d8> <c6e9> 3063\n<c6ea> <c6eb> 8389\n<c6ec> <c6ee> 3083\n<c6ef> <c6ef> 8391\n<c6f0> <c6f0> 3087\n<c6f1> <c6f1> 8392\n<c6f2> <c6f3> 3089\n<c6f4> <c6f4> 8393\n<c6f5> <c6f7> 3092\n<c6f8> <c6f8> 8394\n<c6f9> <c6fc> 3096\n<c6fd> <c6fd> 8395\n<c6fe> <c6fe> 3101\n<c7a1> <c7a2> 3102\n<c7a3> <c7a3> 8396\n<c7a4> <c7a4> 3105\n<c7a5> <c7a6> 8397\n<c7a7> <c7a7> 3108\n<c7a8> <c7a9> 8399\n<c7aa> <c7aa> 3111\n<c7ab> <c7ab> 8401\n<c7ac> <c7ad> 3113\n<c7ae> <c7af> 8402\n<c7b0> <c7b2> 3117\n<c7b3> <c7b5> 8404\n<c7b6> <c7b8> 3123\n<c7b9> <c7ba> 8407\n<c7bb> <c7bc> 3128\n<c7bd> <c7be> 8409\n<c7bf> <c7bf> 3132\n<c7c0> <c7c0> 8411\n<c7c1> <c7c1> 3134\n<c7c2> <c7c2> 8412\n<c7c3> <c7c4> 3136\n<c7c5> <c7c5> 8413\n<c7c6> <c7c6> 3139\n<c7c7> <c7c8> 8414\n<c7c9> <c7cb> 3142\n<c7cc> <c7cc> 8416\n<c7cd> <c7ce> 3146\n<c7cf> <c7cf> 8417\n<c7d0> <c7d3> 3149\n<c7d4> <c7d5> 8418\n<c7d6> <c7d6> 3155\n<c7d7> <c7d7> 8420\n<c7d8> <c7dd> 3157\n<c7de> <c7de> 8421\n<c7df> <c7e0> 3164\n<c7e1> <c7e3> 8422\n<c7e4> <c7e9> 3169\n<c7ea> <c7ee> 8425\n<c7ef> <c7f6> 3180\n<c7f7> <c7f8> 8430\n<c7f9> <c7fa> 3190\n<c7fb> <c7fb> 8432\n<c7fc> <c7fc> 3193\n<c7fd> <c7fd> 8433\n<c7fe> <c7fe> 3195\n<c8a1> <c8a2> 3196\n<c8a3> <c8a3> 8434\n<c8a4> <c8a6> 3199\n<c8a7> <c8a8> 8435\n<c8a9> <c8af> 3204\n<c8b0> <c8b0> 8437\n<c8b1> <c8b4> 3212\n<c8b5> <c8b5> 8438\n<c8b6> <c8b6> 3217\n<c8b7> <c8b7> 8439\n<c8b8> <c8c2> 3219\n<c8c3> <c8c6> 8440\n<c8c7> <c8c7> 3234\n<c8c8> <c8c8> 8444\n<c8c9> <c8cc> 3236\n<c8cd> <c8cd> 8445\n<c8ce> <c8ce> 3241\n<c8cf> <c8cf> 8446\n<c8d0> <c8d1> 3243\n<c8d2> <c8d2> 8447\n<c8d3> <c8d8> 3246\nendcidrange\n\n100 begincidrange\n<c8d9> <c8d9> 8448\n<c8da> <c8dd> 3253\n<c8de> <c8de> 8449\n<c8df> <c8ec> 3258\n<c8ed> <c8ed> 8450\n<c8ee> <c8f0> 3273\n<c8f1> <c8f3> 8451\n<c8f4> <c8f6> 3279\n<c8f7> <c8f8> 8454\n<c8f9> <c8f9> 3284\n<c8fa> <c8fa> 8456\n<c8fb> <c8fb> 3286\n<c8fc> <c8fc> 8457\n<c8fd> <c8fe> 3288\n<c9a1> <c9a1> 8458\n<c9a2> <c9a4> 3291\n<c9a5> <c9a5> 8459\n<c9a6> <c9a6> 3295\n<c9a7> <c9a8> 8460\n<c9a9> <c9ab> 3298\n<c9ac> <c9ac> 8462\n<c9ad> <c9b0> 3302\n<c9b1> <c9b1> 8463\n<c9b2> <c9b3> 3307\n<c9b4> <c9b4> 8464\n<c9b5> <c9b7> 3310\n<c9b8> <c9b9> 8465\n<c9ba> <c9c0> 3315\n<c9c1> <c9c2> 8467\n<c9c3> <c9c3> 3324\n<c9c4> <c9c4> 8469\n<c9c5> <c9c8> 3326\n<c9c9> <c9c9> 8470\n<c9ca> <c9ca> 3331\n<c9cb> <c9cb> 8471\n<c9cc> <c9cc> 3333\n<c9cd> <c9cd> 8472\n<c9ce> <c9d4> 3335\n<c9d5> <c9d5> 8473\n<c9d6> <c9db> 3343\n<c9dc> <c9dc> 8474\n<c9dd> <c9dd> 3350\n<c9de> <c9de> 8475\n<c9df> <c9e0> 3352\n<c9e1> <c9e1> 8476\n<c9e2> <c9e2> 3355\n<c9e3> <c9e3> 8477\n<c9e4> <c9e4> 3357\n<c9e5> <c9e5> 8478\n<c9e6> <c9e7> 3359\n<c9e8> <c9e8> 8479\n<c9e9> <c9ef> 3362\n<c9f0> <c9f0> 8480\n<c9f1> <c9f2> 3370\n<c9f3> <c9f4> 8481\n<c9f5> <c9f5> 3374\n<c9f6> <c9f6> 8483\n<c9f7> <c9f7> 3376\n<c9f8> <c9f9> 8484\n<c9fa> <c9fd> 3379\n<c9fe> <c9fe> 8486\n<caa1> <caa3> 3384\n<caa4> <caa6> 8487\n<caa7> <caa7> 3390\n<caa8> <caa8> 8490\n<caa9> <caa9> 3392\n<caaa> <caab> 8491\n<caac> <cab0> 3395\n<cab1> <cab1> 8493\n<cab2> <cab3> 3401\n<cab4> <cab6> 8494\n<cab7> <caba> 3406\n<cabb> <cabb> 8497\n<cabc> <cac5> 3411\n<cac6> <cac6> 8498\n<cac7> <cac9> 3422\n<caca> <caca> 8499\n<cacb> <cacc> 3426\n<cacd> <cace> 8500\n<cacf> <cad2> 3430\n<cad3> <cad4> 8502\n<cad5> <cad8> 3436\n<cad9> <cad9> 8504\n<cada> <cadd> 3441\n<cade> <cade> 8505\n<cadf> <cadf> 3446\n<cae0> <cae0> 8506\n<cae1> <cae3> 3448\n<cae4> <cae4> 8507\n<cae5> <cae8> 3452\n<cae9> <caea> 8508\n<caeb> <caf3> 3458\n<caf4> <caf5> 8510\n<caf6> <caf6> 3469\n<caf7> <caf7> 8512\n<caf8> <caf9> 3471\n<cafa> <cafa> 8513\n<cafb> <cafc> 3474\n<cafd> <cafd> 8514\n<cafe> <cafe> 3477\nendcidrange\n\n100 begincidrange\n<cba1> <cba6> 3478\n<cba7> <cba7> 8515\n<cba8> <cbaa> 3485\n<cbab> <cbab> 8516\n<cbac> <cbac> 3489\n<cbad> <cbad> 8517\n<cbae> <cbb2> 3491\n<cbb3> <cbb3> 8518\n<cbb4> <cbb4> 3497\n<cbb5> <cbb6> 8519\n<cbb7> <cbb7> 3500\n<cbb8> <cbb8> 8521\n<cbb9> <cbbe> 3502\n<cbbf> <cbbf> 8522\n<cbc0> <cbc6> 3509\n<cbc7> <cbc7> 8523\n<cbc8> <cbc8> 3517\n<cbc9> <cbcc> 8524\n<cbcd> <cbce> 3522\n<cbcf> <cbd0> 8528\n<cbd1> <cbd2> 3526\n<cbd3> <cbd3> 8530\n<cbd4> <cbd4> 3529\n<cbd5> <cbd5> 8531\n<cbd6> <cbde> 3531\n<cbdf> <cbe0> 8532\n<cbe1> <cbe3> 3542\n<cbe4> <cbe4> 8534\n<cbe5> <cbe5> 3546\n<cbe6> <cbe7> 8535\n<cbe8> <cbe9> 3549\n<cbea> <cbea> 8537\n<cbeb> <cbee> 3552\n<cbef> <cbf0> 8538\n<cbf1> <cbf4> 3558\n<cbf5> <cbf6> 8540\n<cbf7> <cbf7> 3564\n<cbf8> <cbf8> 8542\n<cbf9> <cbfe> 3566\n<cca1> <cca2> 8543\n<cca3> <cca7> 3574\n<cca8> <cca8> 8545\n<cca9> <ccab> 3580\n<ccac> <ccac> 8546\n<ccad> <ccae> 3584\n<ccaf> <ccb3> 8547\n<ccb4> <ccb6> 3591\n<ccb7> <ccb8> 8552\n<ccb9> <ccbd> 3596\n<ccbe> <ccbe> 8554\n<ccbf> <ccbf> 3602\n<ccc0> <ccc0> 8555\n<ccc1> <cccb> 3604\n<cccc> <cccc> 8556\n<cccd> <cccd> 3616\n<ccce> <ccce> 8557\n<cccf> <cccf> 3618\n<ccd0> <ccd0> 8558\n<ccd1> <ccd5> 3620\n<ccd6> <ccd6> 8559\n<ccd7> <ccd9> 3626\n<ccda> <ccda> 8560\n<ccdb> <ccdb> 3630\n<ccdc> <ccdc> 8561\n<ccdd> <ccdf> 3632\n<cce0> <cce0> 8562\n<cce1> <cce1> 3636\n<cce2> <cce2> 8563\n<cce3> <cce4> 3638\n<cce5> <cce5> 8564\n<cce6> <ccf4> 3641\n<ccf5> <ccf5> 8565\n<ccf6> <ccf8> 3657\n<ccf9> <ccfa> 8566\n<ccfb> <ccfb> 3662\n<ccfc> <ccfe> 8568\n<cda1> <cdac> 3666\n<cdad> <cdad> 8571\n<cdae> <cdb2> 3679\n<cdb3> <cdb3> 8572\n<cdb4> <cdb6> 3685\n<cdb7> <cdb7> 8573\n<cdb8> <cdbb> 3689\n<cdbc> <cdbc> 8574\n<cdbd> <cdbe> 3694\n<cdbf> <cdbf> 8575\n<cdc0> <cdc4> 3697\n<cdc5> <cdc5> 8576\n<cdc6> <cdc6> 3703\n<cdc7> <cdc7> 8577\n<cdc8> <cdd1> 3705\n<cdd2> <cdd2> 8578\n<cdd3> <cdd3> 3716\n<cdd4> <cdd6> 8579\n<cdd7> <cddc> 3720\n<cddd> <cddd> 8582\n<cdde> <cddf> 3727\n<cde0> <cde0> 8583\n<cde1> <cde3> 3730\n<cde4> <cde5> 8584\nendcidrange\n\n100 begincidrange\n<cde6> <cde6> 3735\n<cde7> <cde7> 8586\n<cde8> <cdf1> 3737\n<cdf2> <cdf2> 8587\n<cdf3> <cdf7> 3748\n<cdf8> <cdf8> 8588\n<cdf9> <cdfe> 3754\n<cea1> <cea3> 3760\n<cea4> <cea5> 8589\n<cea6> <cea6> 3765\n<cea7> <cea7> 8591\n<cea8> <cea9> 3767\n<ceaa> <cead> 8592\n<ceae> <ceaf> 3773\n<ceb0> <ceb1> 8596\n<ceb2> <ceb2> 3777\n<ceb3> <ceb3> 8598\n<ceb4> <cebc> 3779\n<cebd> <cebd> 8599\n<cebe> <cebf> 3789\n<cec0> <cec0> 8600\n<cec1> <cec4> 3792\n<cec5> <cec6> 8601\n<cec7> <cec7> 3798\n<cec8> <cec8> 8603\n<cec9> <cec9> 3800\n<ceca> <ceca> 8604\n<cecb> <cecd> 3802\n<cece> <ced1> 8605\n<ced2> <ced7> 3809\n<ced8> <ceda> 8609\n<cedb> <cedb> 3818\n<cedc> <cedc> 8612\n<cedd> <cedd> 3820\n<cede> <cedf> 8613\n<cee0> <ceea> 3823\n<ceeb> <ceeb> 8615\n<ceec> <ceec> 3835\n<ceed> <ceed> 8616\n<ceee> <cef0> 3837\n<cef1> <cef1> 8617\n<cef2> <cef2> 3841\n<cef3> <cef3> 8618\n<cef4> <cefc> 3843\n<cefd> <cefe> 8619\n<cfa1> <cfad> 3854\n<cfae> <cfae> 8621\n<cfaf> <cfaf> 3868\n<cfb0> <cfb0> 8622\n<cfb1> <cfb2> 3870\n<cfb3> <cfb3> 8623\n<cfb4> <cfb6> 3873\n<cfb7> <cfb8> 8624\n<cfb9> <cfb9> 3878\n<cfba> <cfba> 8626\n<cfbb> <cfbc> 3880\n<cfbd> <cfbd> 8627\n<cfbe> <cfbe> 3883\n<cfbf> <cfc1> 8628\n<cfc2> <cfc4> 3887\n<cfc5> <cfc5> 8631\n<cfc6> <cfc6> 3891\n<cfc7> <cfc7> 8632\n<cfc8> <cfc9> 3893\n<cfca> <cfcb> 8633\n<cfcc> <cfcc> 3897\n<cfcd> <cfce> 8635\n<cfcf> <cfcf> 3900\n<cfd0> <cfd0> 8637\n<cfd1> <cfd3> 3902\n<cfd4> <cfd8> 8638\n<cfd9> <cfd9> 3910\n<cfda> <cfda> 8643\n<cfdb> <cfdb> 3912\n<cfdc> <cfdc> 8644\n<cfdd> <cfde> 3914\n<cfdf> <cfdf> 8645\n<cfe0> <cfe1> 3917\n<cfe2> <cfe2> 8646\n<cfe3> <cfe6> 3920\n<cfe7> <cfe7> 8647\n<cfe8> <cfe9> 3925\n<cfea> <cfea> 8648\n<cfeb> <cfeb> 3928\n<cfec> <cfec> 8649\n<cfed> <cfed> 3930\n<cfee> <cfee> 8650\n<cfef> <cff3> 3932\n<cff4> <cff4> 8651\n<cff5> <cff8> 3938\n<cff9> <cffa> 8652\n<cffb> <cffd> 3944\n<cffe> <cffe> 8654\n<d0a1> <d0a4> 3948\n<d0a5> <d0a5> 8655\n<d0a6> <d0ac> 3953\n<d0ad> <d0ae> 8656\n<d0af> <d0b1> 3962\n<d0b2> <d0b4> 8658\n<d0b5> <d0b9> 3968\nendcidrange\n\n100 begincidrange\n<d0ba> <d0bb> 8661\n<d0bc> <d0be> 3975\n<d0bf> <d0bf> 8663\n<d0c0> <d0c5> 3979\n<d0c6> <d0c6> 8664\n<d0c7> <d0ca> 3986\n<d0cb> <d0cb> 8665\n<d0cc> <d0e1> 3991\n<d0e2> <d0e2> 8666\n<d0e3> <d0e4> 4014\n<d0e5> <d0e5> 8667\n<d0e6> <d0ea> 4017\n<d0eb> <d0eb> 8668\n<d0ec> <d0ec> 4023\n<d0ed> <d0ed> 8669\n<d0ee> <d0f6> 4025\n<d0f7> <d0f9> 8670\n<d0fa> <d0fb> 4037\n<d0fc> <d0fc> 8673\n<d0fd> <d0fe> 4040\n<d1a1> <d1a2> 8674\n<d1a3> <d1a3> 4044\n<d1a4> <d1a4> 8676\n<d1a5> <d1a6> 4046\n<d1a7> <d1a7> 8677\n<d1a8> <d1aa> 4049\n<d1ab> <d1ab> 8678\n<d1ac> <d1ae> 4053\n<d1af> <d1b1> 8679\n<d1b2> <d1b4> 4059\n<d1b5> <d1b7> 8682\n<d1b8> <d1b8> 4065\n<d1b9> <d1b9> 8685\n<d1ba> <d1ba> 4067\n<d1bb> <d1bc> 8686\n<d1bd> <d1c5> 4070\n<d1c6> <d1c8> 8688\n<d1c9> <d1ca> 4082\n<d1cb> <d1cb> 8691\n<d1cc> <d1cd> 4085\n<d1ce> <d1cf> 8692\n<d1d0> <d1d4> 4089\n<d1d5> <d1d6> 8694\n<d1d7> <d1dd> 4096\n<d1de> <d1de> 8696\n<d1df> <d1e0> 4104\n<d1e1> <d1e2> 8697\n<d1e3> <d1e7> 4108\n<d1e8> <d1e9> 8699\n<d1ea> <d1eb> 4115\n<d1ec> <d1ec> 8701\n<d1ed> <d1ed> 4118\n<d1ee> <d1ef> 8702\n<d1f0> <d1f0> 4121\n<d1f1> <d1f1> 8704\n<d1f2> <d1f3> 4123\n<d1f4> <d1f4> 8705\n<d1f5> <d1f6> 4126\n<d1f7> <d1f9> 8706\n<d1fa> <d1fe> 4131\n<d2a1> <d2a1> 4136\n<d2a2> <d2a2> 8709\n<d2a3> <d2a4> 4138\n<d2a5> <d2a5> 8710\n<d2a6> <d2a8> 4141\n<d2a9> <d2a9> 8711\n<d2aa> <d2ae> 4145\n<d2af> <d2af> 8712\n<d2b0> <d2b2> 4151\n<d2b3> <d2b3> 8713\n<d2b4> <d2b4> 4155\n<d2b5> <d2b6> 8714\n<d2b7> <d2bc> 4158\n<d2bd> <d2bd> 8716\n<d2be> <d2be> 4165\n<d2bf> <d2bf> 8717\n<d2c0> <d2c2> 4167\n<d2c3> <d2c3> 8718\n<d2c4> <d2c4> 4171\n<d2c5> <d2c5> 8719\n<d2c6> <d2c6> 4173\n<d2c7> <d2c7> 8720\n<d2c8> <d2ce> 4175\n<d2cf> <d2cf> 8721\n<d2d0> <d2d4> 4183\n<d2d5> <d2d5> 8722\n<d2d6> <d2d9> 4189\n<d2da> <d2da> 8723\n<d2db> <d2e3> 4194\n<d2e4> <d2e5> 8724\n<d2e6> <d2e7> 4205\n<d2e8> <d2eb> 8726\n<d2ec> <d2ee> 4211\n<d2ef> <d2ef> 8730\n<d2f0> <d2f0> 4215\n<d2f1> <d2f1> 8731\n<d2f2> <d2f4> 4217\n<d2f5> <d2f5> 8732\n<d2f6> <d2f7> 4221\n<d2f8> <d2f8> 8733\nendcidrange\n\n100 begincidrange\n<d2f9> <d2fa> 4224\n<d2fb> <d2fb> 8734\n<d2fc> <d2fd> 4227\n<d2fe> <d2fe> 8735\n<d3a1> <d3a2> 4230\n<d3a3> <d3ac> 8736\n<d3ad> <d3ad> 4242\n<d3ae> <d3ae> 8746\n<d3af> <d3b0> 4244\n<d3b1> <d3b1> 8747\n<d3b2> <d3b3> 4247\n<d3b4> <d3b6> 8748\n<d3b7> <d3b7> 4252\n<d3b8> <d3b8> 8751\n<d3b9> <d3ba> 4254\n<d3bb> <d3bb> 8752\n<d3bc> <d3c4> 4257\n<d3c5> <d3c5> 8753\n<d3c6> <d3c6> 4267\n<d3c7> <d3c7> 8754\n<d3c8> <d3c9> 4269\n<d3ca> <d3cc> 8755\n<d3cd> <d3d4> 4274\n<d3d5> <d3d5> 8758\n<d3d6> <d3de> 4283\n<d3df> <d3e0> 8759\n<d3e1> <d3e2> 4294\n<d3e3> <d3e3> 8761\n<d3e4> <d3e5> 4297\n<d3e6> <d3e6> 8762\n<d3e7> <d3ea> 4300\n<d3eb> <d3ec> 8763\n<d3ed> <d3ee> 4306\n<d3ef> <d3ef> 8765\n<d3f0> <d3f3> 4309\n<d3f4> <d3f4> 8766\n<d3f5> <d3fb> 4314\n<d3fc> <d3fc> 8767\n<d3fd> <d3fd> 4322\n<d3fe> <d3fe> 8768\n<d4a1> <d4a3> 4324\n<d4a4> <d4a4> 8769\n<d4a5> <d4a5> 4328\n<d4a6> <d4a8> 8770\n<d4a9> <d4ae> 4332\n<d4af> <d4b2> 8773\n<d4b3> <d4b4> 4342\n<d4b5> <d4b6> 8777\n<d4b7> <d4b7> 4346\n<d4b8> <d4b8> 8779\n<d4b9> <d4bb> 4348\n<d4bc> <d4bc> 8780\n<d4bd> <d4bd> 4352\n<d4be> <d4bf> 8781\n<d4c0> <d4c3> 4355\n<d4c4> <d4c4> 8783\n<d4c5> <d4c5> 4360\n<d4c6> <d4c7> 8784\n<d4c8> <d4c8> 4363\n<d4c9> <d4c9> 8786\n<d4ca> <d4ca> 4365\n<d4cb> <d4ce> 8787\n<d4cf> <d4d2> 4370\n<d4d3> <d4d3> 8791\n<d4d4> <d4d7> 4375\n<d4d8> <d4d8> 8792\n<d4d9> <d4db> 4380\n<d4dc> <d4e0> 8793\n<d4e1> <d4e3> 4388\n<d4e4> <d4e4> 8798\n<d4e5> <d4e5> 4392\n<d4e6> <d4e6> 8799\n<d4e7> <d4ed> 4394\n<d4ee> <d4ee> 8800\n<d4ef> <d4ef> 4402\n<d4f0> <d4f4> 8801\n<d4f5> <d4f8> 4408\n<d4f9> <d4f9> 8806\n<d4fa> <d4fd> 4413\n<d4fe> <d4fe> 8807\n<d5a1> <d5a2> 8808\n<d5a3> <d5a8> 4420\n<d5a9> <d5a9> 8810\n<d5aa> <d5aa> 4427\n<d5ab> <d5ab> 8811\n<d5ac> <d5ad> 4429\n<d5ae> <d5ae> 8812\n<d5af> <d5b0> 4432\n<d5b1> <d5b1> 8813\n<d5b2> <d5b4> 4435\n<d5b5> <d5b8> 8814\n<d5b9> <d5ba> 4442\n<d5bb> <d5bb> 8818\n<d5bc> <d5bc> 4445\n<d5bd> <d5bd> 8819\n<d5be> <d5bf> 4447\n<d5c0> <d5c0> 8820\n<d5c1> <d5c4> 4450\n<d5c5> <d5c5> 8821\n<d5c6> <d5c6> 4455\nendcidrange\n\n100 begincidrange\n<d5c7> <d5c7> 8822\n<d5c8> <d5c9> 4457\n<d5ca> <d5cb> 8823\n<d5cc> <d5cc> 4461\n<d5cd> <d5cd> 8825\n<d5ce> <d5d3> 4463\n<d5d4> <d5d4> 8826\n<d5d5> <d5dc> 4470\n<d5dd> <d5de> 8827\n<d5df> <d5df> 4480\n<d5e0> <d5e0> 8829\n<d5e1> <d5e1> 4482\n<d5e2> <d5e2> 8830\n<d5e3> <d5e9> 4484\n<d5ea> <d5ec> 8831\n<d5ed> <d5ee> 4494\n<d5ef> <d5ef> 8834\n<d5f0> <d5f1> 4497\n<d5f2> <d5f3> 8835\n<d5f4> <d5f6> 4501\n<d5f7> <d5f7> 5611\n<d5f8> <d5fe> 4505\n<d6a1> <d6a4> 8837\n<d6a5> <d6ae> 4516\n<d6af> <d6b0> 8841\n<d6b1> <d6b3> 4528\n<d6b4> <d6b4> 8843\n<d6b5> <d6ba> 4532\n<d6bb> <d6bb> 8844\n<d6bc> <d6bc> 4539\n<d6bd> <d6bd> 8845\n<d6be> <d6be> 4541\n<d6bf> <d6c0> 8846\n<d6c1> <d6c3> 4544\n<d6c4> <d6c4> 8848\n<d6c5> <d6c9> 4548\n<d6ca> <d6ca> 8849\n<d6cb> <d6cc> 4554\n<d6cd> <d6cd> 8850\n<d6ce> <d6d2> 4557\n<d6d3> <d6d3> 8851\n<d6d4> <d6d4> 4563\n<d6d5> <d6d7> 8852\n<d6d8> <d6d9> 4567\n<d6da> <d6da> 8855\n<d6db> <d6de> 4570\n<d6df> <d6df> 8856\n<d6e0> <d6e0> 4575\n<d6e1> <d6e1> 8857\n<d6e2> <d6e4> 4577\n<d6e5> <d6e5> 8858\n<d6e6> <d6e6> 4581\n<d6e7> <d6e8> 8859\n<d6e9> <d6ed> 4584\n<d6ee> <d6ef> 8861\n<d6f0> <d6f1> 4591\n<d6f2> <d6f2> 8863\n<d6f3> <d6f4> 4594\n<d6f5> <d6f6> 8864\n<d6f7> <d6fb> 4598\n<d6fc> <d6fe> 8866\n<d7a1> <d7a3> 4606\n<d7a4> <d7a4> 8869\n<d7a5> <d7a7> 4610\n<d7a8> <d7aa> 8870\n<d7ab> <d7ab> 4616\n<d7ac> <d7ac> 8873\n<d7ad> <d7ad> 4618\n<d7ae> <d7b1> 8874\n<d7b2> <d7b2> 4623\n<d7b3> <d7b4> 8878\n<d7b5> <d7b5> 4626\n<d7b6> <d7b6> 8880\n<d7b7> <d7b7> 4628\n<d7b8> <d7bc> 8881\n<d7bd> <d7c6> 4634\n<d7c7> <d7c7> 8886\n<d7c8> <d7c9> 4645\n<d7ca> <d7ca> 8887\n<d7cb> <d7d4> 4648\n<d7d5> <d7d5> 8888\n<d7d6> <d7da> 4659\n<d7db> <d7de> 8889\n<d7df> <d7e6> 4668\n<d7e7> <d7e7> 8893\n<d7e8> <d7e8> 4677\n<d7e9> <d7ea> 8894\n<d7eb> <d7f9> 4680\n<d8a1> <d8c3> 4695\n<d8c4> <d8c4> 8896\n<d8c5> <d8c6> 4731\n<d8c7> <d8c7> 8897\n<d8c8> <d8c8> 4734\n<d8c9> <d8c9> 8898\n<d8ca> <d8cb> 4736\n<d8cc> <d8cd> 8899\n<d8ce> <d8cf> 4740\n<d8d0> <d8d1> 8901\n<d8d2> <d8d2> 4744\n<d8d3> <d8d3> 8903\nendcidrange\n\n100 begincidrange\n<d8d4> <d8d8> 4746\n<d8d9> <d8d9> 8904\n<d8da> <d8da> 4752\n<d8db> <d8dc> 8905\n<d8dd> <d8f0> 4755\n<d8f1> <d8f1> 8907\n<d8f2> <d8f5> 4776\n<d8f6> <d8f7> 8908\n<d8f8> <d8fe> 4782\n<d9a1> <d9ac> 4789\n<d9ad> <d9ad> 8910\n<d9ae> <d9ae> 4802\n<d9af> <d9af> 8911\n<d9b0> <d9b0> 4804\n<d9b1> <d9b3> 8912\n<d9b4> <d9c6> 4808\n<d9c7> <d9c7> 8915\n<d9c8> <d9cc> 4828\n<d9cd> <d9d0> 8916\n<d9d1> <d9dc> 4837\n<d9dd> <d9dd> 8920\n<d9de> <d9e0> 4850\n<d9e1> <d9e1> 8921\n<d9e2> <d9e3> 4854\n<d9e4> <d9e4> 8922\n<d9e5> <d9e5> 4857\n<d9e6> <d9e6> 8923\n<d9e7> <d9eb> 4859\n<d9ec> <d9ec> 8924\n<d9ed> <d9f3> 4865\n<d9f4> <d9f5> 8925\n<d9f6> <d9fe> 4874\n<daa1> <daa4> 4883\n<daa5> <dadf> 8927\n<dae0> <dae9> 4946\n<daea> <daea> 8986\n<daeb> <daf6> 4957\n<daf7> <daf7> 8987\n<daf8> <daf8> 4970\n<daf9> <daf9> 8988\n<dafa> <dafd> 4972\n<dafe> <dafe> 8989\n<dba1> <dba2> 4977\n<dba3> <dba3> 8990\n<dba4> <dba5> 4980\n<dba6> <dba6> 8991\n<dba7> <dba8> 4983\n<dba9> <dbaa> 8992\n<dbab> <dbba> 4987\n<dbbb> <dbbb> 8994\n<dbbc> <dbbc> 5004\n<dbbd> <dbbd> 8995\n<dbbe> <dbce> 5006\n<dbcf> <dbcf> 8996\n<dbd0> <dbd0> 5024\n<dbd1> <dbd1> 8997\n<dbd2> <dbda> 5026\n<dbdb> <dbdb> 8998\n<dbdc> <dbdd> 5036\n<dbde> <dbde> 8999\n<dbdf> <dbe1> 5039\n<dbe2> <dbe2> 9000\n<dbe3> <dbe3> 5043\n<dbe4> <dbe4> 9001\n<dbe5> <dbea> 5045\n<dbeb> <dbeb> 9002\n<dbec> <dbed> 5052\n<dbee> <dbee> 9003\n<dbef> <dbf0> 5055\n<dbf1> <dbf1> 9004\n<dbf2> <dbf4> 5058\n<dbf5> <dbf7> 9005\n<dbf8> <dbfe> 5064\n<dca1> <dcbb> 5071\n<dcbc> <dcbc> 9008\n<dcbd> <dcbe> 5099\n<dcbf> <dcbf> 9009\n<dcc0> <dcc1> 5102\n<dcc2> <dcc2> 9010\n<dcc3> <dcc7> 5105\n<dcc8> <dcca> 9011\n<dccb> <dcd0> 5113\n<dcd1> <dcd1> 9014\n<dcd2> <dcd6> 5120\n<dcd7> <dcd7> 9015\n<dcd8> <dcdf> 5126\n<dce0> <dce0> 9016\n<dce1> <dce2> 5135\n<dce3> <dce4> 9017\n<dce5> <dce8> 5139\n<dce9> <dcea> 9019\n<dceb> <dcf0> 5145\n<dcf1> <dcf1> 9021\n<dcf2> <dcf5> 5152\n<dcf6> <dcf6> 9022\n<dcf7> <dcf8> 5157\n<dcf9> <dcf9> 9023\n<dcfa> <dcfc> 5160\n<dcfd> <dcfe> 9024\n<dda1> <dda1> 9026\nendcidrange\n\n100 begincidrange\n<dda2> <dda2> 5166\n<dda3> <dda7> 9027\n<dda8> <dda9> 5172\n<ddaa> <ddab> 9032\n<ddac> <ddb1> 5176\n<ddb2> <ddb2> 9034\n<ddb3> <ddb4> 5183\n<ddb5> <ddb5> 9035\n<ddb6> <ddb9> 5186\n<ddba> <ddbb> 9036\n<ddbc> <ddd2> 5192\n<ddd3> <ddd3> 9038\n<ddd4> <ddda> 5216\n<dddb> <dddb> 9039\n<dddc> <dddd> 5224\n<ddde> <ddde> 9040\n<dddf> <dde3> 5227\n<dde4> <dde4> 9041\n<dde5> <ddea> 5233\n<ddeb> <ddeb> 9042\n<ddec> <ddf0> 5240\n<ddf1> <ddf1> 9043\n<ddf2> <ddf5> 5246\n<ddf6> <ddf7> 9044\n<ddf8> <ddfb> 5252\n<ddfc> <ddfc> 9046\n<ddfd> <ddfd> 5257\n<ddfe> <ddfe> 9047\n<dea1> <deac> 5259\n<dead> <dead> 9048\n<deae> <deb3> 5272\n<deb4> <deb4> 9049\n<deb5> <deb9> 5279\n<deba> <deba> 9050\n<debb> <dec5> 5285\n<dec6> <dec6> 9051\n<dec7> <dece> 5297\n<decf> <decf> 9052\n<ded0> <ded0> 5306\n<ded1> <ded2> 9053\n<ded3> <ded7> 5309\n<ded8> <ded8> 9055\n<ded9> <dee1> 5315\n<dee2> <dee2> 9056\n<dee3> <dee7> 5325\n<dee8> <dee8> 9057\n<dee9> <deeb> 5331\n<deec> <deec> 9058\n<deed> <def2> 5335\n<def3> <def3> 9059\n<def4> <defb> 5342\n<defc> <defc> 9060\n<defd> <defe> 5351\n<dfa1> <dfa1> 5353\n<dfa2> <dfa3> 9061\n<dfa4> <dfa4> 5356\n<dfa5> <dfa5> 9063\n<dfa6> <dfb3> 5358\n<dfb4> <dfb4> 9064\n<dfb5> <dfbb> 5373\n<dfbc> <dfbd> 9065\n<dfbe> <dfbe> 5382\n<dfbf> <dfbf> 9067\n<dfc0> <dfc1> 5384\n<dfc2> <dfc3> 9068\n<dfc4> <dfcb> 5388\n<dfcc> <dfcc> 9070\n<dfcd> <dfcf> 5397\n<dfd0> <dfd0> 9071\n<dfd1> <dfd4> 5401\n<dfd5> <dfd5> 9072\n<dfd6> <dfd7> 5406\n<dfd8> <dfd9> 9073\n<dfda> <dfdb> 5410\n<dfdc> <dfdc> 9075\n<dfdd> <dfdf> 5413\n<dfe0> <dfe0> 9076\n<dfe1> <dfe1> 5417\n<dfe2> <dfe2> 9077\n<dfe3> <dfe5> 5419\n<dfe6> <dfe6> 9078\n<dfe7> <dfe8> 5423\n<dfe9> <dfe9> 9079\n<dfea> <dfea> 5426\n<dfeb> <dfeb> 9080\n<dfec> <dfee> 5428\n<dfef> <dfef> 9081\n<dff0> <dff4> 5432\n<dff5> <dff5> 9082\n<dff6> <dff8> 5438\n<dff9> <dff9> 9083\n<dffa> <dffe> 5442\n<e0a1> <e0b5> 5447\n<e0b6> <e0b7> 9084\n<e0b8> <e0be> 5470\n<e0bf> <e0bf> 9086\n<e0c0> <e0c7> 5478\n<e0c8> <e0c8> 9087\n<e0c9> <e0cd> 5487\n<e0ce> <e0ce> 9088\nendcidrange\n\n100 begincidrange\n<e0cf> <e0d2> 5493\n<e0d3> <e0d3> 9089\n<e0d4> <e0df> 5498\n<e0e0> <e0e0> 9090\n<e0e1> <e0ef> 5511\n<e0f0> <e0f0> 9091\n<e0f1> <e0f7> 5527\n<e0f8> <e0f8> 9092\n<e0f9> <e0fb> 5535\n<e0fc> <e0fe> 9093\n<e1a1> <e1aa> 5541\n<e1ab> <e1ab> 9096\n<e1ac> <e1ac> 5552\n<e1ad> <e1ad> 9097\n<e1ae> <e1af> 5554\n<e1b0> <e1b0> 9098\n<e1b1> <e1b3> 5557\n<e1b4> <e1b4> 9099\n<e1b5> <e1ba> 5561\n<e1bb> <e1bb> 9100\n<e1bc> <e1bc> 5568\n<e1bd> <e1bd> 9101\n<e1be> <e1bf> 5570\n<e1c0> <e1c1> 9102\n<e1c2> <e1c8> 5574\n<e1c9> <e1c9> 9104\n<e1ca> <e1cf> 5582\n<e1d0> <e1d0> 9105\n<e1d1> <e1da> 5589\n<e1db> <e1db> 9106\n<e1dc> <e1e0> 5600\n<e1e1> <e1e1> 1962\n<e1e2> <e1e2> 9107\n<e1e3> <e1e6> 5607\n<e1e7> <e1e7> 4504\n<e1e8> <e1ed> 5612\n<e1ee> <e1ef> 9108\n<e1f0> <e1f5> 5620\n<e1f6> <e1f6> 9110\n<e1f7> <e1f7> 5627\n<e1f8> <e1f8> 9111\n<e1f9> <e1fc> 5629\n<e1fd> <e1fd> 9112\n<e1fe> <e1fe> 5634\n<e2a1> <e2a3> 5635\n<e2a4> <e2a4> 9113\n<e2a5> <e2a7> 5639\n<e2a8> <e2a8> 9114\n<e2a9> <e2ba> 5643\n<e2bb> <e2c4> 9115\n<e2c5> <e2c5> 4293\n<e2c6> <e2ce> 9125\n<e2cf> <e2cf> 5681\n<e2d0> <e2d0> 9134\n<e2d1> <e2d8> 5683\n<e2d9> <e2d9> 9135\n<e2da> <e2e2> 5692\n<e2e3> <e2e4> 9136\n<e2e5> <e2e5> 5703\n<e2e6> <e2e6> 9138\n<e2e7> <e2e8> 5705\n<e2e9> <e2eb> 9139\n<e2ec> <e2f7> 5710\n<e2f8> <e2f8> 9142\n<e2f9> <e2f9> 5723\n<e2fa> <e2fd> 9143\n<e2fe> <e2fe> 5728\n<e3a1> <e3a1> 5729\n<e3a2> <e3a2> 9147\n<e3a3> <e3a4> 5731\n<e3a5> <e3a5> 9148\n<e3a6> <e3aa> 5734\n<e3ab> <e3ab> 9149\n<e3ac> <e3b3> 5740\n<e3b4> <e3b4> 9150\n<e3b5> <e3c4> 5749\n<e3c5> <e3db> 9151\n<e3dc> <e3e2> 5788\n<e3e3> <e3e3> 9174\n<e3e4> <e3ec> 5796\n<e3ed> <e3ed> 9175\n<e3ee> <e3f0> 5806\n<e3f1> <e3f2> 9176\n<e3f3> <e3f7> 5811\n<e3f8> <e3f8> 9178\n<e3f9> <e3fd> 5817\n<e3fe> <e3fe> 9179\n<e4a1> <e4a3> 5823\n<e4a4> <e4a5> 9180\n<e4a6> <e4aa> 5828\n<e4ab> <e4ab> 9182\n<e4ac> <e4ae> 5834\n<e4af> <e4b1> 9183\n<e4b2> <e4b4> 5840\n<e4b5> <e4b6> 9186\n<e4b7> <e4c1> 5845\n<e4c2> <e4c2> 9188\n<e4c3> <e4c4> 5857\n<e4c5> <e4c5> 9189\n<e4c6> <e4c8> 5860\nendcidrange\n\n100 begincidrange\n<e4c9> <e4c9> 9190\n<e4ca> <e4d8> 5864\n<e4d9> <e4d9> 9191\n<e4da> <e4db> 5880\n<e4dc> <e4dc> 9192\n<e4dd> <e4dd> 5883\n<e4de> <e4de> 9193\n<e4df> <e4e3> 5885\n<e4e4> <e4e4> 9194\n<e4e5> <e4ea> 5891\n<e4eb> <e4ec> 9195\n<e4ed> <e4f1> 5899\n<e4f2> <e4f2> 9197\n<e4f3> <e4fd> 5905\n<e4fe> <e4fe> 9198\n<e5a1> <e5af> 5917\n<e5b0> <e5b0> 9199\n<e5b1> <e5b8> 5933\n<e5b9> <e5b9> 9200\n<e5ba> <e5c6> 5942\n<e5c7> <e5c7> 9201\n<e5c8> <e5c8> 5956\n<e5c9> <e5c9> 9202\n<e5ca> <e5cd> 5958\n<e5ce> <e5ce> 9203\n<e5cf> <e5ef> 5963\n<e5f0> <e5f0> 9204\n<e5f1> <e5f1> 5997\n<e5f2> <e5f2> 9205\n<e5f3> <e5fb> 5999\n<e5fc> <e5fd> 9206\n<e5fe> <e5fe> 6010\n<e6a1> <e6a2> 6011\n<e6a3> <e6a3> 9208\n<e6a4> <e6aa> 6014\n<e6ab> <e6ac> 9209\n<e6ad> <e6ad> 6023\n<e6ae> <e6ae> 9211\n<e6af> <e6b3> 6025\n<e6b4> <e6b5> 9212\n<e6b6> <e6be> 6032\n<e6bf> <e6bf> 9214\n<e6c0> <e6c7> 6042\n<e6c8> <e6c9> 9215\n<e6ca> <e6cc> 6052\n<e6cd> <e6cd> 9217\n<e6ce> <e6df> 6056\n<e6e0> <e6fe> 9218\n<e7a1> <e7da> 9249\n<e7db> <e7e0> 6163\n<e7e1> <e7e2> 9307\n<e7e3> <e7e6> 6171\n<e7e7> <e7e7> 9309\n<e7e8> <e7ee> 6176\n<e7ef> <e7ef> 9310\n<e7f0> <e7f3> 6184\n<e7f4> <e7f6> 9311\n<e7f7> <e7fe> 6191\n<e8a1> <e8a7> 6199\n<e8a8> <e8a8> 9314\n<e8a9> <e8ab> 6207\n<e8ac> <e8ac> 9315\n<e8ad> <e8b5> 6211\n<e8b6> <e8b6> 9316\n<e8b7> <e8b7> 6221\n<e8b8> <e8ba> 9317\n<e8bb> <e8be> 6225\n<e8bf> <e8c0> 9320\n<e8c1> <e8c4> 6231\n<e8c5> <e8c5> 9322\n<e8c6> <e8c6> 6236\n<e8c7> <e8c9> 9323\n<e8ca> <e8cd> 6240\n<e8ce> <e8ce> 9326\n<e8cf> <e8cf> 6245\n<e8d0> <e8d0> 9327\n<e8d1> <e8d2> 6247\n<e8d3> <e8d3> 9328\n<e8d4> <e8dc> 6250\n<e8dd> <e8dd> 9329\n<e8de> <e8de> 6260\n<e8df> <e8df> 9330\n<e8e0> <e8e1> 6262\n<e8e2> <e8e3> 9331\n<e8e4> <e8e4> 6266\n<e8e5> <e8e5> 9333\n<e8e6> <e8e6> 6268\n<e8e7> <e8e7> 9334\n<e8e8> <e8ea> 6270\n<e8eb> <e8eb> 9335\n<e8ec> <e8ec> 6274\n<e8ed> <e8ed> 9336\n<e8ee> <e8ee> 6276\n<e8ef> <e8ef> 9337\n<e8f0> <e8f8> 6278\n<e8f9> <e8f9> 9338\n<e8fa> <e8fb> 6288\n<e8fc> <e8fd> 9339\n<e8fe> <e8fe> 6292\n<e9a1> <e9a1> 9341\nendcidrange\n\n100 begincidrange\n<e9a2> <e9ac> 6294\n<e9ad> <e9ad> 9342\n<e9ae> <e9b3> 6306\n<e9b4> <e9b5> 9343\n<e9b6> <e9b6> 6314\n<e9b7> <e9b7> 9345\n<e9b8> <e9c3> 6316\n<e9c4> <e9c4> 9346\n<e9c5> <e9c5> 6329\n<e9c6> <e9c6> 9347\n<e9c7> <e9c8> 6331\n<e9c9> <e9c9> 9348\n<e9ca> <e9d5> 6334\n<e9d6> <e9d6> 9349\n<e9d7> <e9d9> 6347\n<e9da> <e9da> 9350\n<e9db> <e9e3> 6351\n<e9e4> <e9e4> 9351\n<e9e5> <e9e5> 6361\n<e9e6> <e9e7> 9352\n<e9e8> <e9e8> 6364\n<e9e9> <e9e9> 9354\n<e9ea> <e9ea> 6366\n<e9eb> <e9eb> 9355\n<e9ec> <e9ec> 6368\n<e9ed> <e9fe> 9356\n<eaa1> <eaa5> 9374\n<eaa6> <eaa6> 6392\n<eaa7> <eaa8> 9379\n<eaa9> <eab0> 6395\n<eab1> <eab1> 9381\n<eab2> <eabb> 6404\n<eabc> <eabc> 9382\n<eabd> <eac9> 6415\n<eaca> <eaca> 9383\n<eacb> <eacc> 6429\n<eacd> <eacd> 9384\n<eace> <ead2> 6432\n<ead3> <ead3> 9385\n<ead4> <ead9> 6438\n<eada> <eaef> 9386\n<eaf0> <eafe> 6466\n<eba1> <eba6> 6481\n<eba7> <eba7> 9408\n<eba8> <eba9> 6488\n<ebaa> <ebaa> 9409\n<ebab> <ebb1> 6491\n<ebb2> <ebb2> 9410\n<ebb3> <ebb8> 6499\n<ebb9> <ebb9> 9411\n<ebba> <ebc9> 6506\n<ebca> <ebcb> 9412\n<ebcc> <ebcc> 6524\n<ebcd> <ebcd> 9414\n<ebce> <ebd5> 6526\n<ebd6> <ebd6> 9415\n<ebd7> <ebd9> 6535\n<ebda> <ebda> 9416\n<ebdb> <ebe0> 6539\n<ebe1> <ebe1> 9417\n<ebe2> <ebf6> 6546\n<ebf7> <ebf7> 9418\n<ebf8> <ebfe> 6568\n<eca1> <eca2> 6575\n<eca3> <eca3> 9419\n<eca4> <eca8> 6578\n<eca9> <ecae> 9420\n<ecaf> <ecb0> 6589\n<ecb1> <ecb1> 9426\n<ecb2> <ecb3> 6592\n<ecb4> <ecb5> 9427\n<ecb6> <ecbd> 6596\n<ecbe> <ecbf> 9429\n<ecc0> <ecc0> 6606\n<ecc1> <ecc1> 9431\n<ecc2> <ecc6> 6608\n<ecc7> <ecc7> 9432\n<ecc8> <ecca> 6614\n<eccb> <eccb> 9433\n<eccc> <ece1> 6618\n<ece2> <ece2> 9434\n<ece3> <ecf1> 6641\n<ecf2> <ecf2> 9435\n<ecf3> <ecf4> 6657\n<ecf5> <ecf5> 9436\n<ecf6> <ecf7> 6660\n<ecf8> <ecf8> 9437\n<ecf9> <ecfe> 6663\n<eda1> <eda1> 9438\n<eda2> <eda7> 6670\n<eda8> <eda8> 9439\n<eda9> <edae> 6677\n<edaf> <edb0> 9440\n<edb1> <edb3> 6685\n<edb4> <edb4> 9442\n<edb5> <edb5> 6689\n<edb6> <edb6> 9443\n<edb7> <edb7> 6691\n<edb8> <edb8> 9444\n<edb9> <edb9> 6693\nendcidrange\n\n100 begincidrange\n<edba> <edba> 9445\n<edbb> <edbe> 6695\n<edbf> <edbf> 9446\n<edc0> <edc1> 6700\n<edc2> <edc3> 9447\n<edc4> <edcb> 6704\n<edcc> <edcd> 9449\n<edce> <edd2> 6714\n<edd3> <edd3> 9451\n<edd4> <edd6> 6720\n<edd7> <edd7> 9452\n<edd8> <ede7> 6724\n<ede8> <ede8> 9453\n<ede9> <eded> 6741\n<edee> <edee> 9454\n<edef> <edf8> 6747\n<edf9> <edfa> 9455\n<edfb> <edfe> 6759\n<eea1> <eebb> 6763\n<eebc> <eebc> 9457\n<eebd> <eebe> 6791\n<eebf> <eebf> 9458\n<eec0> <eec3> 6794\n<eec4> <eefe> 9459\n<efa1> <eff1> 9518\n<eff2> <effe> 6938\n<f0a1> <f0a2> 6951\n<f0a3> <f0a3> 9599\n<f0a4> <f0ae> 6954\n<f0af> <f0d9> 9600\n<f0da> <f0db> 7008\n<f0dc> <f0dd> 9643\n<f0de> <f0de> 7012\n<f0df> <f0df> 9645\n<f0e0> <f0e8> 7014\n<f0e9> <f0e9> 9646\n<f0ea> <f0eb> 7024\n<f0ec> <f0ec> 9647\n<f0ed> <f0ee> 7027\n<f0ef> <f0ef> 9648\n<f0f0> <f0f6> 7030\n<f0f7> <f0f7> 9649\n<f0f8> <f0f8> 7038\n<f0f9> <f0f9> 9650\n<f0fa> <f0fb> 7040\n<f0fc> <f0fc> 9651\n<f0fd> <f0fe> 7043\n<f1a1> <f1a7> 7045\n<f1a8> <f1a8> 9652\n<f1a9> <f1aa> 7053\n<f1ab> <f1ab> 9653\n<f1ac> <f1ad> 7056\n<f1ae> <f1ae> 9654\n<f1af> <f1b1> 7059\n<f1b2> <f1b2> 9655\n<f1b3> <f1bb> 7063\n<f1bc> <f1bc> 9656\n<f1bd> <f1bf> 7073\n<f1c0> <f1c0> 9657\n<f1c1> <f1c8> 7077\n<f1c9> <f1c9> 9658\n<f1ca> <f1cc> 7086\n<f1cd> <f1cd> 9659\n<f1ce> <f1ce> 7090\n<f1cf> <f1d0> 9660\n<f1d1> <f1d9> 7093\n<f1da> <f1da> 9662\n<f1db> <f1db> 7103\n<f1dc> <f1dc> 9663\n<f1dd> <f1e3> 7105\n<f1e4> <f1e4> 9664\n<f1e5> <f1eb> 7113\n<f1ec> <f1ec> 9665\n<f1ed> <f1ee> 7121\n<f1ef> <f1ef> 9666\n<f1f0> <f1f6> 7124\n<f1f7> <f1f7> 9667\n<f1f8> <f1f8> 7132\n<f1f9> <f1f9> 9668\n<f1fa> <f1fb> 7134\n<f1fc> <f1fe> 9669\n<f2a1> <f2ad> 9672\n<f2ae> <f2b0> 7152\n<f2b1> <f2b2> 9685\n<f2b3> <f2b8> 7157\n<f2b9> <f2b9> 9687\n<f2ba> <f2c2> 7164\n<f2c3> <f2c3> 9688\n<f2c4> <f2c8> 7174\n<f2c9> <f2c9> 9689\n<f2ca> <f2cb> 7180\n<f2cc> <f2cd> 9690\n<f2ce> <f2ce> 7184\n<f2cf> <f2cf> 9692\n<f2d0> <f2d2> 7186\n<f2d3> <f2d3> 9693\n<f2d4> <f2e4> 7190\n<f2e5> <f2e5> 9694\n<f2e6> <f2ed> 7208\n<f2ee> <f2ee> 9695\nendcidrange\n\n100 begincidrange\n<f2ef> <f2f6> 7217\n<f2f7> <f2f7> 9696\n<f2f8> <f2fc> 7226\n<f2fd> <f2fd> 9697\n<f2fe> <f2fe> 7232\n<f3a1> <f3be> 7233\n<f3bf> <f3bf> 9698\n<f3c0> <f3c5> 7264\n<f3c6> <f3c6> 9699\n<f3c7> <f3c7> 7271\n<f3c8> <f3c8> 9700\n<f3c9> <f3d5> 7273\n<f3d6> <f3d6> 9701\n<f3d7> <f3d8> 7287\n<f3d9> <f3d9> 9702\n<f3da> <f3e4> 7290\n<f3e5> <f3e6> 9703\n<f3e7> <f3e9> 7303\n<f3ea> <f3ea> 9705\n<f3eb> <f3eb> 7307\n<f3ec> <f3ec> 9706\n<f3ed> <f3ee> 7309\n<f3ef> <f3ef> 9707\n<f3f0> <f3f0> 7312\n<f3f1> <f3f1> 9708\n<f3f2> <f3fc> 7314\n<f3fd> <f3fd> 9709\n<f3fe> <f3fe> 7326\n<f4a1> <f4a4> 7327\n<f4a5> <f4a5> 9710\n<f4a6> <f4ae> 7332\n<f4af> <f4af> 9711\n<f4b0> <f4b4> 7342\n<f4b5> <f4b5> 9712\n<f4b6> <f4c0> 7348\n<f4c1> <f4c1> 9713\n<f4c2> <f4c6> 7360\n<f4c7> <f4c7> 9714\n<f4c8> <f4ce> 7366\n<f4cf> <f4d0> 9715\n<f4d1> <f4d5> 7375\n<f4d6> <f4d6> 9717\n<f4d7> <f4e9> 7381\n<f4ea> <f4ea> 9718\n<f4eb> <f4ee> 7401\n<f4ef> <f4ef> 9719\n<f4f0> <f4f4> 7406\n<f4f5> <f4f5> 9720\n<f4f6> <f4fe> 7412\n<f5a1> <f5a5> 7421\n<f5a6> <f5a7> 9721\n<f5a8> <f5b9> 7428\n<f5ba> <f5bb> 9723\n<f5bc> <f5c3> 7448\n<f5c4> <f5c4> 9725\n<f5c5> <f5c7> 7457\n<f5c8> <f5c8> 9726\n<f5c9> <f5cd> 7461\n<f5ce> <f5cf> 9727\n<f5d0> <f5d0> 7468\n<f5d1> <f5d2> 9729\n<f5d3> <f5d8> 7471\n<f5d9> <f5d9> 9731\n<f5da> <f5db> 7478\n<f5dc> <f5dc> 9732\n<f5dd> <f5e5> 7481\n<f5e6> <f5e7> 9733\n<f5e8> <f5ee> 7492\n<f5ef> <f5ef> 9735\n<f5f0> <f5f1> 7500\n<f5f2> <f5f2> 9736\n<f5f3> <f5fb> 7503\n<f5fc> <f5fc> 9737\n<f5fd> <f5fe> 7513\n<f6a1> <f6a2> 7515\n<f6a3> <f6a3> 9738\n<f6a4> <f6a5> 7518\n<f6a6> <f6a6> 9739\n<f6a7> <f6a7> 7521\n<f6a8> <f6a8> 9740\n<f6a9> <f6aa> 7523\n<f6ab> <f6ab> 9741\n<f6ac> <f6af> 7526\n<f6b0> <f6b0> 9742\n<f6b1> <f6b2> 7531\n<f6b3> <f6be> 9743\n<f6bf> <f6c4> 7545\n<f6c5> <f6c5> 9755\n<f6c6> <f6c6> 7552\n<f6c7> <f6c7> 9756\n<f6c8> <f6c8> 7554\n<f6c9> <f6c9> 9757\n<f6ca> <f6ce> 7556\n<f6cf> <f6fe> 9758\n<f7a1> <f7af> 9806\n<f7b0> <f7b1> 7624\n<f7b2> <f7b3> 9821\n<f7b4> <f7b4> 7628\n<f7b5> <f7b5> 9823\n<f7b6> <f7bc> 7630\nendcidrange\n\n83 begincidrange\n<f7bd> <f7bd> 9824\n<f7be> <f7c2> 7638\n<f7c3> <f7c3> 9825\n<f7c4> <f7c4> 7644\n<f7c5> <f7c6> 9826\n<f7c7> <f7c9> 7647\n<f7ca> <f7cb> 9828\n<f7cc> <f7ce> 7652\n<f7cf> <f7d0> 9830\n<f7d1> <f7dd> 7657\n<f7de> <f7de> 9832\n<f7df> <f7e0> 7671\n<f7e1> <f7e1> 2745\n<f7e2> <f7f1> 7674\n<f7f2> <f7f2> 9833\n<f7f3> <f7f4> 7691\n<f7f5> <f7f5> 9834\n<f7f6> <f7fe> 7694\n<f8a1> <f8a6> 9835\n<f8a7> <f8a7> 1228\n<f8a8> <f8a8> 1290\n<f8a9> <f8a9> 1304\n<f8aa> <f8ab> 9841\n<f8ac> <f8ac> 1428\n<f8ad> <f8ad> 1486\n<f8ae> <f8ae> 9843\n<f8af> <f8af> 1526\n<f8b0> <f8b1> 9844\n<f8b2> <f8b2> 1619\n<f8b3> <f8b3> 1662\n<f8b4> <f8b4> 9846\n<f8b5> <f8b5> 1732\n<f8b6> <f8b7> 9847\n<f8b8> <f8b8> 1852\n<f8b9> <f8ba> 9849\n<f8bb> <f8bb> 1987\n<f8bc> <f8bf> 9851\n<f8c0> <f8c0> 2091\n<f8c1> <f8c1> 9855\n<f8c2> <f8c2> 2126\n<f8c3> <f8c3> 2153\n<f8c4> <f8c5> 9856\n<f8c6> <f8c6> 2316\n<f8c7> <f8c8> 9858\n<f8c9> <f8c9> 2417\n<f8ca> <f8ca> 9860\n<f8cb> <f8cc> 2458\n<f8cd> <f8cd> 9861\n<f8ce> <f8ce> 2522\n<f8cf> <f8cf> 9862\n<f8d0> <f8d0> 2554\n<f8d1> <f8db> 9863\n<f8dc> <f8dc> 3034\n<f8dd> <f8dd> 3037\n<f8de> <f8de> 3050\n<f8df> <f8df> 3052\n<f8e0> <f8e0> 3058\n<f8e1> <f8e5> 9874\n<f8e6> <f8e6> 3218\n<f8e7> <f8e7> 3354\n<f8e8> <f8e8> 3468\n<f8e9> <f8e9> 3518\n<f8ea> <f8ea> 9879\n<f8eb> <f8eb> 3579\n<f8ec> <f8ee> 9880\n<f8ef> <f8ef> 3696\n<f8f0> <f8f0> 9883\n<f8f1> <f8f1> 3747\n<f8f2> <f8f7> 9884\n<f8f8> <f8f8> 4157\n<f8f9> <f8f9> 4313\n<f8fa> <f8fb> 9890\n<f8fc> <f8fc> 4347\n<f8fd> <f8fd> 4361\n<f8fe> <f8fe> 9892\n<f9a1> <f9a1> 4513\n<f9a2> <f9a2> 9893\n<f9a3> <f9a3> 4538\n<f9a4> <f9a5> 9894\n<f9a6> <f9a6> 4565\n<f9a7> <f9a7> 9896\n<f9a8> <f9a8> 4605\n<f9a9> <f9a9> 4633\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/GBT-EUC-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (GBT-EUC-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (GBT-EUC-H)\n%%BeginResource: CMap (GBT-EUC-V)\n%%Title: (GBT-EUC-V Adobe GB1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/GBT-EUC-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 1 def\nend def\n\n/CMapName /GBT-EUC-V def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 690 def\n/XUID [1 10 25371] def\n\n/WMode 1 def\n\n20 begincidrange\n<a1a2> <a1a2>  575\n<a1a3> <a1a3>  574\n<a1aa> <a1aa>  598\n<a1ab> <a1ac> 7704\n<a1ad> <a1ad>  599\n<a1b2> <a1bf>  582\n<a1fe> <a1fe> 7706\n<a3a1> <a3a1>  578\n<a3a8> <a3a9>  580\n<a3ac> <a3ac>  573\n<a3ae> <a3ae> 7707\n<a3ba> <a3bb>  576\n<a3bd> <a3bd> 7708\n<a3bf> <a3bf>  579\n<a3db> <a3db> 7709\n<a3dd> <a3dd> 7710\n<a3df> <a3df>  600\n<a3fb> <a3fb>  596\n<a3fd> <a3fd>  597\n<a3fe> <a3fe> 7711\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/GBT-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (GBT-H)\n%%Title: (GBT-H Adobe GB1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 1 def\nend def\n\n/CMapName /GBT-H def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 580 def\n/XUID [1 10 25372] def\n\n/WMode 0 def\n\n1 begincodespacerange\n  <2121> <7E7E>\nendcodespacerange\n\n100 begincidrange\n<2121> <217e> 96\n<2231> <2262> 190\n<2265> <226e> 240\n<2271> <227c> 250\n<2321> <237e> 262\n<2421> <2473> 356\n<2521> <2576> 439\n<2621> <2638> 525\n<2641> <2675> 549\n<2721> <2741> 602\n<2751> <2771> 635\n<2821> <2840> 668\n<2845> <286a> 700\n<2924> <296f> 738\n<2a21> <2a7e> 814\n<2b21> <2b40> 908\n<3021> <3027> 940\n<3028> <3028> 7717\n<3029> <3029> 948\n<302a> <302a> 7718\n<302b> <302c> 950\n<302d> <302e> 7719\n<302f> <3038> 954\n<3039> <3039> 7721\n<303a> <303f> 965\n<3040> <3040> 7722\n<3041> <3052> 972\n<3053> <3053> 7723\n<3054> <3054> 991\n<3055> <3055> 7724\n<3056> <3059> 993\n<305a> <305a> 7725\n<305b> <305b> 998\n<305c> <305c> 7726\n<305d> <3063> 1000\n<3064> <3064> 7727\n<3065> <306b> 1008\n<306c> <306d> 7728\n<306e> <306e> 1017\n<306f> <306f> 7730\n<3070> <3072> 1019\n<3073> <3073> 7731\n<3074> <3076> 1023\n<3077> <3077> 7732\n<3078> <3078> 1027\n<3079> <3079> 7733\n<307a> <307e> 1029\n<3121> <3124> 1034\n<3125> <3126> 7734\n<3127> <3127> 1040\n<3128> <3128> 7736\n<3129> <312a> 1042\n<312b> <312b> 7737\n<312c> <3131> 1045\n<3132> <3132> 7738\n<3133> <3133> 1052\n<3134> <3135> 7739\n<3136> <3136> 1055\n<3137> <3139> 7741\n<313a> <3140> 1059\n<3141> <3141> 7744\n<3142> <3149> 1067\n<314a> <314a> 7745\n<314b> <314e> 1076\n<314f> <3150> 7746\n<3151> <3151> 1082\n<3152> <3152> 7748\n<3153> <3154> 1084\n<3155> <3155> 7749\n<3156> <315e> 1087\n<315f> <3161> 7750\n<3162> <3163> 1099\n<3164> <3164> 7753\n<3165> <3166> 1102\n<3167> <3168> 7754\n<3169> <3169> 1106\n<316a> <316a> 7756\n<316b> <316d> 1108\n<316e> <316e> 7757\n<316f> <3170> 1112\n<3171> <3171> 7758\n<3172> <3173> 1115\n<3174> <3177> 7759\n<3178> <317c> 1121\n<317d> <317d> 7763\n<317e> <317e> 1127\n<3221> <3225> 1128\n<3226> <3227> 7764\n<3228> <322b> 1135\n<322c> <322c> 7766\n<322d> <3234> 1140\n<3235> <3235> 7767\n<3236> <3238> 1149\n<3239> <3239> 7768\n<323a> <3245> 1153\n<3246> <3246> 7769\n<3247> <324d> 1166\n<324e> <3257> 7770\n<3258> <325d> 1183\n<325e> <325e> 7780\nendcidrange\n\n100 begincidrange\n<325f> <325f> 1190\n<3260> <3260> 7781\n<3261> <3261> 1192\n<3262> <3263> 7782\n<3264> <326e> 1195\n<326f> <326f> 7784\n<3270> <3272> 1207\n<3273> <327c> 7785\n<327d> <327e> 1220\n<3321> <3322> 7795\n<3323> <3323> 1224\n<3324> <3327> 7797\n<3328> <3328> 1229\n<3329> <3329> 7801\n<332a> <332d> 1231\n<332e> <332e> 7802\n<332f> <3334> 1236\n<3335> <3335> 7803\n<3336> <3338> 1243\n<3339> <3339> 7804\n<333a> <333d> 1247\n<333e> <333e> 7805\n<333f> <3341> 1252\n<3342> <3342> 7806\n<3343> <3343> 1256\n<3344> <3344> 7807\n<3345> <3345> 1258\n<3346> <3346> 7808\n<3347> <334c> 1260\n<334d> <334d> 7809\n<334e> <334e> 1267\n<334f> <334f> 7810\n<3350> <3351> 1269\n<3352> <3352> 7811\n<3353> <3358> 1272\n<3359> <3359> 7812\n<335a> <335a> 1279\n<335b> <335b> 7813\n<335c> <335c> 1281\n<335d> <335d> 7814\n<335e> <3362> 1283\n<3363> <3363> 7815\n<3364> <3364> 1289\n<3365> <3366> 7816\n<3367> <3367> 1292\n<3368> <3368> 7818\n<3369> <336a> 1294\n<336b> <336c> 7819\n<336d> <336e> 1298\n<336f> <336f> 7821\n<3370> <3370> 1301\n<3371> <3371> 7822\n<3372> <3372> 1303\n<3373> <3373> 7823\n<3374> <3379> 1305\n<337a> <337b> 7824\n<337c> <337e> 1313\n<3421> <3422> 7826\n<3423> <3424> 1318\n<3425> <3426> 7828\n<3427> <342a> 1322\n<342b> <342b> 7830\n<342c> <342e> 1327\n<342f> <342f> 7831\n<3430> <3432> 1331\n<3433> <3434> 7832\n<3435> <3437> 1336\n<3438> <3438> 7834\n<3439> <343e> 1340\n<343f> <343f> 7835\n<3440> <3441> 1347\n<3442> <3442> 7836\n<3443> <3446> 1350\n<3447> <3447> 7837\n<3448> <3449> 1355\n<344a> <344a> 7838\n<344b> <344c> 1358\n<344d> <344d> 7839\n<344e> <344e> 1361\n<344f> <344f> 7840\n<3450> <3452> 1363\n<3453> <3454> 7841\n<3455> <3459> 1368\n<345a> <345a> 7843\n<345b> <345b> 1374\n<345c> <345c> 7844\n<345d> <346c> 1376\n<346d> <346d> 7845\n<346e> <346e> 1393\n<346f> <346f> 7846\n<3470> <3477> 1395\n<3478> <3478> 7847\n<3479> <347a> 1404\n<347b> <347b> 7848\n<347c> <347e> 1407\n<3521> <3522> 1410\n<3523> <3523> 7849\n<3524> <3524> 1413\n<3525> <3528> 7850\n<3529> <352b> 1418\nendcidrange\n\n100 begincidrange\n<352c> <352c> 7854\n<352d> <352d> 1422\n<352e> <352f> 7855\n<3530> <3530> 1425\n<3531> <3535> 7857\n<3536> <3536> 1431\n<3537> <3537> 7862\n<3538> <3539> 1433\n<353a> <353c> 7863\n<353d> <3545> 1438\n<3546> <3546> 7866\n<3547> <354a> 1448\n<354b> <354b> 7867\n<354c> <354f> 1453\n<3550> <3550> 7868\n<3551> <3552> 1458\n<3553> <3553> 7869\n<3554> <355c> 1461\n<355d> <355f> 7870\n<3560> <3562> 1473\n<3563> <3563> 7873\n<3564> <3565> 1477\n<3566> <3567> 7874\n<3568> <356c> 1481\n<356d> <356d> 7876\n<356e> <3575> 1487\n<3576> <3577> 7877\n<3578> <357c> 1497\n<357d> <357d> 7879\n<357e> <357e> 1503\n<3621> <3623> 1504\n<3624> <3625> 7880\n<3626> <3626> 1509\n<3627> <3627> 7882\n<3628> <3628> 1511\n<3629> <3629> 7883\n<362a> <362a> 1513\n<362b> <362b> 7884\n<362c> <362e> 1515\n<362f> <3630> 7885\n<3631> <3632> 1520\n<3633> <3633> 7887\n<3634> <3636> 1523\n<3637> <3637> 7888\n<3638> <363e> 1527\n<363f> <3641> 7889\n<3642> <3643> 1537\n<3644> <3644> 7892\n<3645> <3645> 1540\n<3646> <3646> 7893\n<3647> <364c> 1542\n<364d> <364d> 7894\n<364e> <364e> 1549\n<364f> <3650> 7895\n<3651> <3652> 1552\n<3653> <3654> 7897\n<3655> <3655> 1556\n<3656> <3656> 7899\n<3657> <3658> 1558\n<3659> <3659> 7900\n<365a> <365a> 1561\n<365b> <365b> 7901\n<365c> <3660> 1563\n<3661> <3661> 7902\n<3662> <3668> 1569\n<3669> <3669> 7903\n<366a> <366b> 1577\n<366c> <366c> 7904\n<366d> <366d> 1580\n<366e> <366f> 7905\n<3670> <3670> 1583\n<3671> <3671> 7907\n<3672> <3675> 1585\n<3676> <3676> 7908\n<3677> <3678> 1590\n<3679> <3679> 7909\n<367a> <367a> 1593\n<367b> <367c> 7910\n<367d> <367e> 1596\n<3721> <3723> 7912\n<3724> <3726> 1601\n<3727> <3727> 7915\n<3728> <372e> 1605\n<372f> <3730> 7916\n<3731> <3732> 1614\n<3733> <3733> 7918\n<3734> <3735> 1617\n<3736> <3737> 7919\n<3738> <3738> 1621\n<3739> <3739> 7921\n<373a> <3742> 1623\n<3743> <3744> 7922\n<3745> <3748> 1634\n<3749> <3749> 7924\n<374a> <374b> 1639\n<374c> <374c> 7925\n<374d> <374e> 1642\n<374f> <374f> 7926\n<3750> <3750> 1645\n<3751> <3751> 7927\nendcidrange\n\n100 begincidrange\n<3752> <3756> 1647\n<3757> <3758> 7928\n<3759> <375b> 1654\n<375c> <375c> 7930\n<375d> <375e> 1658\n<375f> <3761> 7931\n<3762> <3762> 1663\n<3763> <3763> 7934\n<3764> <3765> 1665\n<3766> <3768> 7935\n<3769> <376a> 1670\n<376b> <376d> 7938\n<376e> <376e> 1675\n<376f> <376f> 7941\n<3770> <3773> 1677\n<3774> <3774> 7942\n<3775> <3777> 1682\n<3778> <3778> 7943\n<3779> <377e> 1686\n<3821> <3826> 1692\n<3827> <3828> 7944\n<3829> <3832> 1700\n<3833> <3834> 7946\n<3835> <3839> 1712\n<383a> <383a> 7948\n<383b> <383b> 1718\n<383c> <383c> 7949\n<383d> <383d> 1720\n<383e> <383f> 7950\n<3840> <3842> 1723\n<3843> <3843> 7952\n<3844> <3845> 1727\n<3846> <3847> 7953\n<3848> <3848> 1731\n<3849> <3849> 7955\n<384a> <384e> 1733\n<384f> <384f> 7956\n<3850> <3852> 1739\n<3853> <3856> 7957\n<3857> <3858> 1746\n<3859> <385a> 7961\n<385b> <3863> 1750\n<3864> <3864> 7963\n<3865> <3868> 1760\n<3869> <3869> 7964\n<386a> <386a> 1765\n<386b> <386b> 7965\n<386c> <3872> 1767\n<3873> <3873> 7966\n<3874> <3874> 1775\n<3875> <3876> 7967\n<3877> <3877> 1778\n<3878> <3878> 7969\n<3879> <387e> 1780\n<3921> <3927> 1786\n<3928> <3928> 7970\n<3929> <392d> 1794\n<392e> <392e> 7971\n<392f> <3930> 1800\n<3931> <3931> 7972\n<3932> <3932> 1803\n<3933> <3933> 7973\n<3934> <3934> 1805\n<3935> <3935> 7974\n<3936> <3938> 1807\n<3939> <393a> 7975\n<393b> <3945> 1812\n<3946> <3946> 7977\n<3947> <394a> 1824\n<394b> <394b> 7978\n<394c> <394f> 1829\n<3950> <3950> 7979\n<3951> <3957> 1834\n<3958> <3958> 7980\n<3959> <395a> 1842\n<395b> <395b> 7981\n<395c> <395c> 1845\n<395d> <395d> 7982\n<395e> <395e> 1847\n<395f> <395f> 7983\n<3960> <3960> 1849\n<3961> <3961> 7984\n<3962> <3962> 1851\n<3963> <3963> 7985\n<3964> <3965> 1853\n<3966> <3966> 7986\n<3967> <3968> 1856\n<3969> <396c> 7987\n<396d> <396d> 1862\n<396e> <396e> 7991\n<396f> <3970> 1864\n<3971> <3971> 7992\n<3972> <3972> 1867\n<3973> <3975> 7993\n<3976> <3977> 1871\n<3978> <3978> 7996\n<3979> <3979> 1874\n<397a> <397a> 7997\n<397b> <397c> 1876\n<397d> <397d> 7998\nendcidrange\n\n100 begincidrange\n<397e> <397e> 1879\n<3a21> <3a26> 1880\n<3a27> <3a27> 7999\n<3a28> <3a2a> 1887\n<3a2b> <3a2b> 8000\n<3a2c> <3a39> 1891\n<3a3a> <3a3a> 8001\n<3a3b> <3a44> 1906\n<3a45> <3a45> 8002\n<3a46> <3a51> 1917\n<3a52> <3a52> 8003\n<3a53> <3a56> 1930\n<3a57> <3a58> 8004\n<3a59> <3a63> 1936\n<3a64> <3a64> 8006\n<3a65> <3a67> 1948\n<3a68> <3a68> 8007\n<3a69> <3a6b> 1952\n<3a6c> <3a6c> 8008\n<3a6d> <3a72> 1956\n<3a73> <3a73> 5605\n<3a74> <3a77> 1963\n<3a78> <3a78> 8009\n<3a79> <3a7e> 1968\n<3b21> <3b23> 1974\n<3b24> <3b24> 8010\n<3b25> <3b25> 1978\n<3b26> <3b26> 8011\n<3b27> <3b28> 1980\n<3b29> <3b2a> 8012\n<3b2b> <3b2c> 1984\n<3b2d> <3b2e> 8014\n<3b2f> <3b2f> 1988\n<3b30> <3b30> 8016\n<3b31> <3b32> 1990\n<3b33> <3b33> 8017\n<3b34> <3b34> 1993\n<3b35> <3b37> 8018\n<3b38> <3b38> 1997\n<3b39> <3b3a> 8021\n<3b3b> <3b50> 2000\n<3b51> <3b51> 8023\n<3b52> <3b52> 2023\n<3b53> <3b54> 8024\n<3b55> <3b5e> 2026\n<3b5f> <3b67> 8026\n<3b68> <3b6a> 2045\n<3b6b> <3b6b> 8035\n<3b6c> <3b70> 2049\n<3b71> <3b71> 8036\n<3b72> <3b74> 2055\n<3b75> <3b77> 8037\n<3b78> <3b79> 2061\n<3b7a> <3b7a> 8040\n<3b7b> <3b7c> 2064\n<3b7d> <3b7d> 8041\n<3b7e> <3b7e> 2067\n<3c21> <3c21> 2068\n<3c22> <3c22> 8042\n<3c23> <3c24> 2070\n<3c25> <3c26> 8043\n<3c27> <3c27> 2074\n<3c28> <3c29> 8045\n<3c2a> <3c2a> 2077\n<3c2b> <3c2b> 8047\n<3c2c> <3c2c> 2079\n<3c2d> <3c2d> 8048\n<3c2e> <3c35> 2081\n<3c36> <3c38> 8049\n<3c39> <3c3a> 2092\n<3c3b> <3c3b> 8052\n<3c3c> <3c40> 2095\n<3c41> <3c41> 8053\n<3c42> <3c42> 2101\n<3c43> <3c43> 8054\n<3c44> <3c45> 2103\n<3c46> <3c47> 8055\n<3c48> <3c49> 2107\n<3c4a> <3c4a> 8057\n<3c4b> <3c4b> 2110\n<3c4c> <3c4d> 8058\n<3c4e> <3c4f> 2113\n<3c50> <3c50> 8060\n<3c51> <3c53> 2116\n<3c54> <3c56> 8061\n<3c57> <3c57> 2122\n<3c58> <3c58> 8064\n<3c59> <3c5a> 2124\n<3c5b> <3c5b> 8065\n<3c5c> <3c5c> 2127\n<3c5d> <3c5d> 8066\n<3c5e> <3c5e> 2129\n<3c5f> <3c61> 8067\n<3c62> <3c62> 2133\n<3c63> <3c64> 8070\n<3c65> <3c67> 2136\n<3c68> <3c68> 8072\n<3c69> <3c69> 2140\n<3c6a> <3c6c> 8073\n<3c6d> <3c6e> 2144\nendcidrange\n\n100 begincidrange\n<3c6f> <3c73> 8076\n<3c74> <3c75> 2151\n<3c76> <3c7c> 8081\n<3c7d> <3c7e> 2160\n<3d21> <3d21> 2162\n<3d22> <3d27> 8088\n<3d28> <3d2a> 2169\n<3d2b> <3d2c> 8094\n<3d2d> <3d2e> 2174\n<3d2f> <3d32> 8096\n<3d33> <3d33> 2180\n<3d34> <3d34> 8100\n<3d35> <3d39> 2182\n<3d3a> <3d3a> 8101\n<3d3b> <3d3c> 2188\n<3d3d> <3d3f> 8102\n<3d40> <3d40> 2193\n<3d41> <3d44> 8105\n<3d45> <3d47> 2198\n<3d48> <3d4a> 8109\n<3d4b> <3d4d> 2204\n<3d4e> <3d4f> 8112\n<3d50> <3d56> 2209\n<3d57> <3d57> 8114\n<3d58> <3d59> 2217\n<3d5a> <3d5a> 8115\n<3d5b> <3d5f> 2220\n<3d60> <3d61> 8116\n<3d62> <3d6a> 2227\n<3d6b> <3d6b> 8118\n<3d6c> <3d73> 2237\n<3d74> <3d78> 8119\n<3d79> <3d7c> 2250\n<3d7d> <3d7d> 8124\n<3d7e> <3d7e> 2255\n<3e21> <3e22> 8125\n<3e23> <3e24> 2258\n<3e25> <3e25> 8127\n<3e26> <3e27> 2261\n<3e28> <3e28> 8128\n<3e29> <3e29> 2264\n<3e2a> <3e2a> 8129\n<3e2b> <3e2c> 2266\n<3e2d> <3e2d> 8130\n<3e2e> <3e30> 2269\n<3e31> <3e31> 8131\n<3e32> <3e34> 2273\n<3e35> <3e37> 8132\n<3e38> <3e39> 2279\n<3e3a> <3e3a> 8135\n<3e3b> <3e3f> 2282\n<3e40> <3e40> 8136\n<3e41> <3e48> 2288\n<3e49> <3e49> 8137\n<3e4a> <3e53> 2297\n<3e54> <3e54> 8138\n<3e55> <3e58> 2308\n<3e59> <3e59> 8139\n<3e5a> <3e5c> 2313\n<3e5d> <3e5d> 8140\n<3e5e> <3e61> 2317\n<3e62> <3e62> 8141\n<3e63> <3e64> 2322\n<3e65> <3e65> 8142\n<3e66> <3e66> 2325\n<3e67> <3e67> 8143\n<3e68> <3e68> 2327\n<3e69> <3e69> 8144\n<3e6a> <3e6d> 2329\n<3e6e> <3e6e> 8145\n<3e6f> <3e74> 2334\n<3e75> <3e75> 8146\n<3e76> <3e76> 2341\n<3e77> <3e78> 8147\n<3e79> <3e7a> 2344\n<3e7b> <3e7c> 8149\n<3e7d> <3e7e> 2348\n<3f21> <3f24> 2350\n<3f25> <3f25> 8151\n<3f26> <3f29> 2355\n<3f2a> <3f2a> 8152\n<3f2b> <3f2c> 2360\n<3f2d> <3f2d> 8153\n<3f2e> <3f44> 2363\n<3f45> <3f45> 8154\n<3f46> <3f46> 2387\n<3f47> <3f47> 8155\n<3f48> <3f4d> 2389\n<3f4e> <3f4e> 8156\n<3f4f> <3f50> 2396\n<3f51> <3f52> 8157\n<3f53> <3f58> 2400\n<3f59> <3f59> 8159\n<3f5a> <3f61> 2407\n<3f62> <3f64> 8160\n<3f65> <3f68> 2418\n<3f69> <3f69> 8163\n<3f6a> <3f6a> 2423\n<3f6b> <3f6b> 8164\n<3f6c> <3f6c> 2425\nendcidrange\n\n100 begincidrange\n<3f6d> <3f6d> 8165\n<3f6e> <3f72> 2427\n<3f73> <3f73> 8166\n<3f74> <3f74> 2433\n<3f75> <3f75> 8167\n<3f76> <3f76> 2435\n<3f77> <3f77> 8168\n<3f78> <3f78> 2437\n<3f79> <3f7a> 8169\n<3f7b> <3f7e> 2440\n<4021> <4021> 8171\n<4022> <4022> 2445\n<4023> <4023> 8172\n<4024> <4028> 2447\n<4029> <4029> 8173\n<402a> <402a> 2453\n<402b> <402b> 8174\n<402c> <402e> 2455\n<402f> <4030> 8175\n<4031> <4032> 2460\n<4033> <4036> 8177\n<4037> <4037> 2466\n<4038> <4044> 8181\n<4045> <404b> 2480\n<404c> <404d> 8194\n<404e> <4053> 2489\n<4054> <4054> 8196\n<4055> <4055> 2496\n<4056> <4056> 8197\n<4057> <4057> 2498\n<4058> <4058> 8198\n<4059> <405c> 2500\n<405d> <405d> 8199\n<405e> <405f> 2505\n<4060> <4060> 8200\n<4061> <4068> 2508\n<4069> <4069> 8201\n<406a> <406a> 2517\n<406b> <406c> 8202\n<406d> <406e> 2520\n<406f> <4071> 8204\n<4072> <4075> 2525\n<4076> <407a> 8207\n<407b> <407e> 2534\n<4121> <4123> 2538\n<4124> <4125> 8212\n<4126> <4128> 2543\n<4129> <412d> 8214\n<412e> <412e> 2551\n<412f> <4138> 8219\n<4139> <413c> 2562\n<413d> <413e> 8229\n<413f> <4141> 2568\n<4142> <4142> 8231\n<4143> <4145> 2572\n<4146> <4146> 8232\n<4147> <4148> 2576\n<4149> <4149> 8233\n<414a> <414c> 2579\n<414d> <414d> 8234\n<414e> <4153> 2583\n<4154> <4154> 8235\n<4155> <4158> 2590\n<4159> <415b> 8236\n<415c> <415d> 2597\n<415e> <415e> 8239\n<415f> <4163> 2600\n<4164> <4165> 8240\n<4166> <4168> 2607\n<4169> <4169> 8242\n<416a> <416a> 2611\n<416b> <416c> 8243\n<416d> <4172> 2614\n<4173> <4173> 8245\n<4174> <4174> 2621\n<4175> <4175> 8246\n<4176> <4179> 2623\n<417a> <417d> 8247\n<417e> <417e> 2631\n<4221> <4221> 2632\n<4222> <4228> 8251\n<4229> <422a> 2640\n<422b> <4233> 8258\n<4234> <4237> 2651\n<4238> <4238> 8267\n<4239> <423b> 2656\n<423c> <423d> 8268\n<423e> <423e> 2661\n<423f> <423f> 8270\n<4240> <4240> 2663\n<4241> <4241> 8271\n<4242> <4244> 2665\n<4245> <4247> 8272\n<4248> <424a> 2671\n<424b> <4250> 8275\n<4251> <4251> 2680\n<4252> <4252> 8281\n<4253> <4254> 2682\n<4255> <425c> 8282\n<425d> <425d> 2692\nendcidrange\n\n100 begincidrange\n<425e> <4262> 8290\n<4263> <4265> 2698\n<4266> <4268> 8295\n<4269> <4269> 2704\n<426a> <426e> 8298\n<426f> <426f> 2710\n<4270> <4270> 8303\n<4271> <4271> 2712\n<4272> <4275> 8304\n<4276> <4276> 2717\n<4277> <427a> 8308\n<427b> <427e> 2722\n<4321> <4321> 8312\n<4322> <4329> 2727\n<432a> <432a> 8313\n<432b> <432c> 2736\n<432d> <432d> 8314\n<432e> <4332> 2739\n<4333> <4333> 8315\n<4334> <4334> 7673\n<4335> <433d> 2746\n<433e> <433e> 8316\n<433f> <4344> 2756\n<4345> <4347> 8317\n<4348> <434b> 2765\n<434c> <434c> 8320\n<434d> <434d> 2770\n<434e> <434e> 8321\n<434f> <4354> 2772\n<4355> <4356> 8322\n<4357> <4358> 2780\n<4359> <4359> 8324\n<435a> <435f> 2783\n<4360> <4360> 8325\n<4361> <4364> 2790\n<4365> <4365> 8326\n<4366> <436c> 2795\n<436d> <436d> 8327\n<436e> <436f> 2803\n<4370> <4370> 8328\n<4371> <4374> 2806\n<4375> <4376> 8329\n<4377> <4378> 2812\n<4379> <437a> 8331\n<437b> <437c> 2816\n<437d> <437d> 8333\n<437e> <437e> 2819\n<4421> <4430> 2820\n<4431> <4431> 8334\n<4432> <4435> 2837\n<4436> <4436> 8335\n<4437> <4445> 2842\n<4446> <4446> 8336\n<4447> <4448> 2858\n<4449> <4449> 8337\n<444a> <4450> 2861\n<4451> <4451> 8338\n<4452> <4452> 2869\n<4453> <4456> 8339\n<4457> <4458> 2874\n<4459> <4459> 8343\n<445a> <4461> 2877\n<4462> <4462> 8344\n<4463> <4464> 2886\n<4465> <4465> 8345\n<4466> <446b> 2889\n<446c> <446c> 8346\n<446d> <446f> 2896\n<4470> <4471> 8347\n<4472> <4473> 2901\n<4474> <4474> 8349\n<4475> <4475> 2904\n<4476> <4478> 8350\n<4479> <447a> 2908\n<447b> <447c> 8353\n<447d> <447d> 2912\n<447e> <447e> 8355\n<4521> <4522> 8356\n<4523> <4524> 2916\n<4525> <4529> 8358\n<452a> <4530> 2923\n<4531> <4531> 8363\n<4532> <4534> 2931\n<4535> <4535> 8364\n<4536> <4536> 2935\n<4537> <4539> 8365\n<453a> <453a> 2939\n<453b> <453b> 8368\n<453c> <453c> 2941\n<453d> <453d> 8369\n<453e> <454b> 2943\n<454c> <454c> 8370\n<454d> <4552> 2958\n<4553> <4553> 8371\n<4554> <4561> 2965\n<4562> <4562> 8372\n<4563> <4566> 2980\n<4567> <4567> 8373\n<4568> <4573> 2985\n<4574> <4574> 8374\nendcidrange\n\n100 begincidrange\n<4575> <457e> 2998\n<4621> <462c> 3008\n<462d> <462e> 8375\n<462f> <4634> 3022\n<4635> <4636> 8377\n<4637> <463a> 3030\n<463b> <463b> 8379\n<463c> <463d> 3035\n<463e> <463e> 8380\n<463f> <463f> 3038\n<4640> <4640> 8381\n<4641> <4642> 3040\n<4643> <4644> 8382\n<4645> <464a> 3044\n<464b> <464d> 8384\n<464e> <4652> 3053\n<4653> <4653> 8387\n<4654> <4656> 3059\n<4657> <4657> 8388\n<4658> <4669> 3063\n<466a> <466b> 8389\n<466c> <466e> 3083\n<466f> <466f> 8391\n<4670> <4670> 3087\n<4671> <4671> 8392\n<4672> <4673> 3089\n<4674> <4674> 8393\n<4675> <4677> 3092\n<4678> <4678> 8394\n<4679> <467c> 3096\n<467d> <467d> 8395\n<467e> <467e> 3101\n<4721> <4722> 3102\n<4723> <4723> 8396\n<4724> <4724> 3105\n<4725> <4726> 8397\n<4727> <4727> 3108\n<4728> <4729> 8399\n<472a> <472a> 3111\n<472b> <472b> 8401\n<472c> <472d> 3113\n<472e> <472f> 8402\n<4730> <4732> 3117\n<4733> <4735> 8404\n<4736> <4738> 3123\n<4739> <473a> 8407\n<473b> <473c> 3128\n<473d> <473e> 8409\n<473f> <473f> 3132\n<4740> <4740> 8411\n<4741> <4741> 3134\n<4742> <4742> 8412\n<4743> <4744> 3136\n<4745> <4745> 8413\n<4746> <4746> 3139\n<4747> <4748> 8414\n<4749> <474b> 3142\n<474c> <474c> 8416\n<474d> <474e> 3146\n<474f> <474f> 8417\n<4750> <4753> 3149\n<4754> <4755> 8418\n<4756> <4756> 3155\n<4757> <4757> 8420\n<4758> <475d> 3157\n<475e> <475e> 8421\n<475f> <4760> 3164\n<4761> <4763> 8422\n<4764> <4769> 3169\n<476a> <476e> 8425\n<476f> <4776> 3180\n<4777> <4778> 8430\n<4779> <477a> 3190\n<477b> <477b> 8432\n<477c> <477c> 3193\n<477d> <477d> 8433\n<477e> <477e> 3195\n<4821> <4822> 3196\n<4823> <4823> 8434\n<4824> <4826> 3199\n<4827> <4828> 8435\n<4829> <482f> 3204\n<4830> <4830> 8437\n<4831> <4834> 3212\n<4835> <4835> 8438\n<4836> <4836> 3217\n<4837> <4837> 8439\n<4838> <4842> 3219\n<4843> <4846> 8440\n<4847> <4847> 3234\n<4848> <4848> 8444\n<4849> <484c> 3236\n<484d> <484d> 8445\n<484e> <484e> 3241\n<484f> <484f> 8446\n<4850> <4851> 3243\n<4852> <4852> 8447\n<4853> <4858> 3246\n<4859> <4859> 8448\n<485a> <485d> 3253\nendcidrange\n\n100 begincidrange\n<485e> <485e> 8449\n<485f> <486c> 3258\n<486d> <486d> 8450\n<486e> <4870> 3273\n<4871> <4873> 8451\n<4874> <4876> 3279\n<4877> <4878> 8454\n<4879> <4879> 3284\n<487a> <487a> 8456\n<487b> <487b> 3286\n<487c> <487c> 8457\n<487d> <487e> 3288\n<4921> <4921> 8458\n<4922> <4924> 3291\n<4925> <4925> 8459\n<4926> <4926> 3295\n<4927> <4928> 8460\n<4929> <492b> 3298\n<492c> <492c> 8462\n<492d> <4930> 3302\n<4931> <4931> 8463\n<4932> <4933> 3307\n<4934> <4934> 8464\n<4935> <4937> 3310\n<4938> <4939> 8465\n<493a> <4940> 3315\n<4941> <4942> 8467\n<4943> <4943> 3324\n<4944> <4944> 8469\n<4945> <4948> 3326\n<4949> <4949> 8470\n<494a> <494a> 3331\n<494b> <494b> 8471\n<494c> <494c> 3333\n<494d> <494d> 8472\n<494e> <4954> 3335\n<4955> <4955> 8473\n<4956> <495b> 3343\n<495c> <495c> 8474\n<495d> <495d> 3350\n<495e> <495e> 8475\n<495f> <4960> 3352\n<4961> <4961> 8476\n<4962> <4962> 3355\n<4963> <4963> 8477\n<4964> <4964> 3357\n<4965> <4965> 8478\n<4966> <4967> 3359\n<4968> <4968> 8479\n<4969> <496f> 3362\n<4970> <4970> 8480\n<4971> <4972> 3370\n<4973> <4974> 8481\n<4975> <4975> 3374\n<4976> <4976> 8483\n<4977> <4977> 3376\n<4978> <4979> 8484\n<497a> <497d> 3379\n<497e> <497e> 8486\n<4a21> <4a23> 3384\n<4a24> <4a26> 8487\n<4a27> <4a27> 3390\n<4a28> <4a28> 8490\n<4a29> <4a29> 3392\n<4a2a> <4a2b> 8491\n<4a2c> <4a30> 3395\n<4a31> <4a31> 8493\n<4a32> <4a33> 3401\n<4a34> <4a36> 8494\n<4a37> <4a3a> 3406\n<4a3b> <4a3b> 8497\n<4a3c> <4a45> 3411\n<4a46> <4a46> 8498\n<4a47> <4a49> 3422\n<4a4a> <4a4a> 8499\n<4a4b> <4a4c> 3426\n<4a4d> <4a4e> 8500\n<4a4f> <4a52> 3430\n<4a53> <4a54> 8502\n<4a55> <4a58> 3436\n<4a59> <4a59> 8504\n<4a5a> <4a5d> 3441\n<4a5e> <4a5e> 8505\n<4a5f> <4a5f> 3446\n<4a60> <4a60> 8506\n<4a61> <4a63> 3448\n<4a64> <4a64> 8507\n<4a65> <4a68> 3452\n<4a69> <4a6a> 8508\n<4a6b> <4a73> 3458\n<4a74> <4a75> 8510\n<4a76> <4a76> 3469\n<4a77> <4a77> 8512\n<4a78> <4a79> 3471\n<4a7a> <4a7a> 8513\n<4a7b> <4a7c> 3474\n<4a7d> <4a7d> 8514\n<4a7e> <4a7e> 3477\n<4b21> <4b26> 3478\n<4b27> <4b27> 8515\nendcidrange\n\n100 begincidrange\n<4b28> <4b2a> 3485\n<4b2b> <4b2b> 8516\n<4b2c> <4b2c> 3489\n<4b2d> <4b2d> 8517\n<4b2e> <4b32> 3491\n<4b33> <4b33> 8518\n<4b34> <4b34> 3497\n<4b35> <4b36> 8519\n<4b37> <4b37> 3500\n<4b38> <4b38> 8521\n<4b39> <4b3e> 3502\n<4b3f> <4b3f> 8522\n<4b40> <4b46> 3509\n<4b47> <4b47> 8523\n<4b48> <4b48> 3517\n<4b49> <4b4c> 8524\n<4b4d> <4b4e> 3522\n<4b4f> <4b50> 8528\n<4b51> <4b52> 3526\n<4b53> <4b53> 8530\n<4b54> <4b54> 3529\n<4b55> <4b55> 8531\n<4b56> <4b5e> 3531\n<4b5f> <4b60> 8532\n<4b61> <4b63> 3542\n<4b64> <4b64> 8534\n<4b65> <4b65> 3546\n<4b66> <4b67> 8535\n<4b68> <4b69> 3549\n<4b6a> <4b6a> 8537\n<4b6b> <4b6e> 3552\n<4b6f> <4b70> 8538\n<4b71> <4b74> 3558\n<4b75> <4b76> 8540\n<4b77> <4b77> 3564\n<4b78> <4b78> 8542\n<4b79> <4b7e> 3566\n<4c21> <4c22> 8543\n<4c23> <4c27> 3574\n<4c28> <4c28> 8545\n<4c29> <4c2b> 3580\n<4c2c> <4c2c> 8546\n<4c2d> <4c2e> 3584\n<4c2f> <4c33> 8547\n<4c34> <4c36> 3591\n<4c37> <4c38> 8552\n<4c39> <4c3d> 3596\n<4c3e> <4c3e> 8554\n<4c3f> <4c3f> 3602\n<4c40> <4c40> 8555\n<4c41> <4c4b> 3604\n<4c4c> <4c4c> 8556\n<4c4d> <4c4d> 3616\n<4c4e> <4c4e> 8557\n<4c4f> <4c4f> 3618\n<4c50> <4c50> 8558\n<4c51> <4c55> 3620\n<4c56> <4c56> 8559\n<4c57> <4c59> 3626\n<4c5a> <4c5a> 8560\n<4c5b> <4c5b> 3630\n<4c5c> <4c5c> 8561\n<4c5d> <4c5f> 3632\n<4c60> <4c60> 8562\n<4c61> <4c61> 3636\n<4c62> <4c62> 8563\n<4c63> <4c64> 3638\n<4c65> <4c65> 8564\n<4c66> <4c74> 3641\n<4c75> <4c75> 8565\n<4c76> <4c78> 3657\n<4c79> <4c7a> 8566\n<4c7b> <4c7b> 3662\n<4c7c> <4c7e> 8568\n<4d21> <4d2c> 3666\n<4d2d> <4d2d> 8571\n<4d2e> <4d32> 3679\n<4d33> <4d33> 8572\n<4d34> <4d36> 3685\n<4d37> <4d37> 8573\n<4d38> <4d3b> 3689\n<4d3c> <4d3c> 8574\n<4d3d> <4d3e> 3694\n<4d3f> <4d3f> 8575\n<4d40> <4d44> 3697\n<4d45> <4d45> 8576\n<4d46> <4d46> 3703\n<4d47> <4d47> 8577\n<4d48> <4d51> 3705\n<4d52> <4d52> 8578\n<4d53> <4d53> 3716\n<4d54> <4d56> 8579\n<4d57> <4d5c> 3720\n<4d5d> <4d5d> 8582\n<4d5e> <4d5f> 3727\n<4d60> <4d60> 8583\n<4d61> <4d63> 3730\n<4d64> <4d65> 8584\n<4d66> <4d66> 3735\n<4d67> <4d67> 8586\nendcidrange\n\n100 begincidrange\n<4d68> <4d71> 3737\n<4d72> <4d72> 8587\n<4d73> <4d77> 3748\n<4d78> <4d78> 8588\n<4d79> <4d7e> 3754\n<4e21> <4e23> 3760\n<4e24> <4e25> 8589\n<4e26> <4e26> 3765\n<4e27> <4e27> 8591\n<4e28> <4e29> 3767\n<4e2a> <4e2d> 8592\n<4e2e> <4e2f> 3773\n<4e30> <4e31> 8596\n<4e32> <4e32> 3777\n<4e33> <4e33> 8598\n<4e34> <4e3c> 3779\n<4e3d> <4e3d> 8599\n<4e3e> <4e3f> 3789\n<4e40> <4e40> 8600\n<4e41> <4e44> 3792\n<4e45> <4e46> 8601\n<4e47> <4e47> 3798\n<4e48> <4e48> 8603\n<4e49> <4e49> 3800\n<4e4a> <4e4a> 8604\n<4e4b> <4e4d> 3802\n<4e4e> <4e51> 8605\n<4e52> <4e57> 3809\n<4e58> <4e5a> 8609\n<4e5b> <4e5b> 3818\n<4e5c> <4e5c> 8612\n<4e5d> <4e5d> 3820\n<4e5e> <4e5f> 8613\n<4e60> <4e6a> 3823\n<4e6b> <4e6b> 8615\n<4e6c> <4e6c> 3835\n<4e6d> <4e6d> 8616\n<4e6e> <4e70> 3837\n<4e71> <4e71> 8617\n<4e72> <4e72> 3841\n<4e73> <4e73> 8618\n<4e74> <4e7c> 3843\n<4e7d> <4e7e> 8619\n<4f21> <4f2d> 3854\n<4f2e> <4f2e> 8621\n<4f2f> <4f2f> 3868\n<4f30> <4f30> 8622\n<4f31> <4f32> 3870\n<4f33> <4f33> 8623\n<4f34> <4f36> 3873\n<4f37> <4f38> 8624\n<4f39> <4f39> 3878\n<4f3a> <4f3a> 8626\n<4f3b> <4f3c> 3880\n<4f3d> <4f3d> 8627\n<4f3e> <4f3e> 3883\n<4f3f> <4f41> 8628\n<4f42> <4f44> 3887\n<4f45> <4f45> 8631\n<4f46> <4f46> 3891\n<4f47> <4f47> 8632\n<4f48> <4f49> 3893\n<4f4a> <4f4b> 8633\n<4f4c> <4f4c> 3897\n<4f4d> <4f4e> 8635\n<4f4f> <4f4f> 3900\n<4f50> <4f50> 8637\n<4f51> <4f53> 3902\n<4f54> <4f58> 8638\n<4f59> <4f59> 3910\n<4f5a> <4f5a> 8643\n<4f5b> <4f5b> 3912\n<4f5c> <4f5c> 8644\n<4f5d> <4f5e> 3914\n<4f5f> <4f5f> 8645\n<4f60> <4f61> 3917\n<4f62> <4f62> 8646\n<4f63> <4f66> 3920\n<4f67> <4f67> 8647\n<4f68> <4f69> 3925\n<4f6a> <4f6a> 8648\n<4f6b> <4f6b> 3928\n<4f6c> <4f6c> 8649\n<4f6d> <4f6d> 3930\n<4f6e> <4f6e> 8650\n<4f6f> <4f73> 3932\n<4f74> <4f74> 8651\n<4f75> <4f78> 3938\n<4f79> <4f7a> 8652\n<4f7b> <4f7d> 3944\n<4f7e> <4f7e> 8654\n<5021> <5024> 3948\n<5025> <5025> 8655\n<5026> <502c> 3953\n<502d> <502e> 8656\n<502f> <5031> 3962\n<5032> <5034> 8658\n<5035> <5039> 3968\n<503a> <503b> 8661\n<503c> <503e> 3975\nendcidrange\n\n100 begincidrange\n<503f> <503f> 8663\n<5040> <5045> 3979\n<5046> <5046> 8664\n<5047> <504a> 3986\n<504b> <504b> 8665\n<504c> <5061> 3991\n<5062> <5062> 8666\n<5063> <5064> 4014\n<5065> <5065> 8667\n<5066> <506a> 4017\n<506b> <506b> 8668\n<506c> <506c> 4023\n<506d> <506d> 8669\n<506e> <5076> 4025\n<5077> <5079> 8670\n<507a> <507b> 4037\n<507c> <507c> 8673\n<507d> <507e> 4040\n<5121> <5122> 8674\n<5123> <5123> 4044\n<5124> <5124> 8676\n<5125> <5126> 4046\n<5127> <5127> 8677\n<5128> <512a> 4049\n<512b> <512b> 8678\n<512c> <512e> 4053\n<512f> <5131> 8679\n<5132> <5134> 4059\n<5135> <5137> 8682\n<5138> <5138> 4065\n<5139> <5139> 8685\n<513a> <513a> 4067\n<513b> <513c> 8686\n<513d> <5145> 4070\n<5146> <5148> 8688\n<5149> <514a> 4082\n<514b> <514b> 8691\n<514c> <514d> 4085\n<514e> <514f> 8692\n<5150> <5154> 4089\n<5155> <5156> 8694\n<5157> <515d> 4096\n<515e> <515e> 8696\n<515f> <5160> 4104\n<5161> <5162> 8697\n<5163> <5167> 4108\n<5168> <5169> 8699\n<516a> <516b> 4115\n<516c> <516c> 8701\n<516d> <516d> 4118\n<516e> <516f> 8702\n<5170> <5170> 4121\n<5171> <5171> 8704\n<5172> <5173> 4123\n<5174> <5174> 8705\n<5175> <5176> 4126\n<5177> <5179> 8706\n<517a> <517e> 4131\n<5221> <5221> 4136\n<5222> <5222> 8709\n<5223> <5224> 4138\n<5225> <5225> 8710\n<5226> <5228> 4141\n<5229> <5229> 8711\n<522a> <522e> 4145\n<522f> <522f> 8712\n<5230> <5232> 4151\n<5233> <5233> 8713\n<5234> <5234> 4155\n<5235> <5236> 8714\n<5237> <523c> 4158\n<523d> <523d> 8716\n<523e> <523e> 4165\n<523f> <523f> 8717\n<5240> <5242> 4167\n<5243> <5243> 8718\n<5244> <5244> 4171\n<5245> <5245> 8719\n<5246> <5246> 4173\n<5247> <5247> 8720\n<5248> <524e> 4175\n<524f> <524f> 8721\n<5250> <5254> 4183\n<5255> <5255> 8722\n<5256> <5259> 4189\n<525a> <525a> 8723\n<525b> <5263> 4194\n<5264> <5265> 8724\n<5266> <5267> 4205\n<5268> <526b> 8726\n<526c> <526e> 4211\n<526f> <526f> 8730\n<5270> <5270> 4215\n<5271> <5271> 8731\n<5272> <5274> 4217\n<5275> <5275> 8732\n<5276> <5277> 4221\n<5278> <5278> 8733\n<5279> <527a> 4224\n<527b> <527b> 8734\nendcidrange\n\n100 begincidrange\n<527c> <527d> 4227\n<527e> <527e> 8735\n<5321> <5322> 4230\n<5323> <532c> 8736\n<532d> <532d> 4242\n<532e> <532e> 8746\n<532f> <5330> 4244\n<5331> <5331> 8747\n<5332> <5333> 4247\n<5334> <5336> 8748\n<5337> <5337> 4252\n<5338> <5338> 8751\n<5339> <533a> 4254\n<533b> <533b> 8752\n<533c> <5344> 4257\n<5345> <5345> 8753\n<5346> <5346> 4267\n<5347> <5347> 8754\n<5348> <5349> 4269\n<534a> <534c> 8755\n<534d> <5354> 4274\n<5355> <5355> 8758\n<5356> <535e> 4283\n<535f> <5360> 8759\n<5361> <5362> 4294\n<5363> <5363> 8761\n<5364> <5365> 4297\n<5366> <5366> 8762\n<5367> <536a> 4300\n<536b> <536c> 8763\n<536d> <536e> 4306\n<536f> <536f> 8765\n<5370> <5373> 4309\n<5374> <5374> 8766\n<5375> <537b> 4314\n<537c> <537c> 8767\n<537d> <537d> 4322\n<537e> <537e> 8768\n<5421> <5423> 4324\n<5424> <5424> 8769\n<5425> <5425> 4328\n<5426> <5428> 8770\n<5429> <542e> 4332\n<542f> <5432> 8773\n<5433> <5434> 4342\n<5435> <5436> 8777\n<5437> <5437> 4346\n<5438> <5438> 8779\n<5439> <543b> 4348\n<543c> <543c> 8780\n<543d> <543d> 4352\n<543e> <543f> 8781\n<5440> <5443> 4355\n<5444> <5444> 8783\n<5445> <5445> 4360\n<5446> <5447> 8784\n<5448> <5448> 4363\n<5449> <5449> 8786\n<544a> <544a> 4365\n<544b> <544e> 8787\n<544f> <5452> 4370\n<5453> <5453> 8791\n<5454> <5457> 4375\n<5458> <5458> 8792\n<5459> <545b> 4380\n<545c> <5460> 8793\n<5461> <5463> 4388\n<5464> <5464> 8798\n<5465> <5465> 4392\n<5466> <5466> 8799\n<5467> <546d> 4394\n<546e> <546e> 8800\n<546f> <546f> 4402\n<5470> <5474> 8801\n<5475> <5478> 4408\n<5479> <5479> 8806\n<547a> <547d> 4413\n<547e> <547e> 8807\n<5521> <5522> 8808\n<5523> <5528> 4420\n<5529> <5529> 8810\n<552a> <552a> 4427\n<552b> <552b> 8811\n<552c> <552d> 4429\n<552e> <552e> 8812\n<552f> <5530> 4432\n<5531> <5531> 8813\n<5532> <5534> 4435\n<5535> <5538> 8814\n<5539> <553a> 4442\n<553b> <553b> 8818\n<553c> <553c> 4445\n<553d> <553d> 8819\n<553e> <553f> 4447\n<5540> <5540> 8820\n<5541> <5544> 4450\n<5545> <5545> 8821\n<5546> <5546> 4455\n<5547> <5547> 8822\n<5548> <5549> 4457\nendcidrange\n\n100 begincidrange\n<554a> <554b> 8823\n<554c> <554c> 4461\n<554d> <554d> 8825\n<554e> <5553> 4463\n<5554> <5554> 8826\n<5555> <555c> 4470\n<555d> <555e> 8827\n<555f> <555f> 4480\n<5560> <5560> 8829\n<5561> <5561> 4482\n<5562> <5562> 8830\n<5563> <5569> 4484\n<556a> <556c> 8831\n<556d> <556e> 4494\n<556f> <556f> 8834\n<5570> <5571> 4497\n<5572> <5573> 8835\n<5574> <5576> 4501\n<5577> <5577> 5611\n<5578> <557e> 4505\n<5621> <5624> 8837\n<5625> <562e> 4516\n<562f> <5630> 8841\n<5631> <5633> 4528\n<5634> <5634> 8843\n<5635> <563a> 4532\n<563b> <563b> 8844\n<563c> <563c> 4539\n<563d> <563d> 8845\n<563e> <563e> 4541\n<563f> <5640> 8846\n<5641> <5643> 4544\n<5644> <5644> 8848\n<5645> <5649> 4548\n<564a> <564a> 8849\n<564b> <564c> 4554\n<564d> <564d> 8850\n<564e> <5652> 4557\n<5653> <5653> 8851\n<5654> <5654> 4563\n<5655> <5657> 8852\n<5658> <5659> 4567\n<565a> <565a> 8855\n<565b> <565e> 4570\n<565f> <565f> 8856\n<5660> <5660> 4575\n<5661> <5661> 8857\n<5662> <5664> 4577\n<5665> <5665> 8858\n<5666> <5666> 4581\n<5667> <5668> 8859\n<5669> <566d> 4584\n<566e> <566f> 8861\n<5670> <5671> 4591\n<5672> <5672> 8863\n<5673> <5674> 4594\n<5675> <5676> 8864\n<5677> <567b> 4598\n<567c> <567e> 8866\n<5721> <5723> 4606\n<5724> <5724> 8869\n<5725> <5727> 4610\n<5728> <572a> 8870\n<572b> <572b> 4616\n<572c> <572c> 8873\n<572d> <572d> 4618\n<572e> <5731> 8874\n<5732> <5732> 4623\n<5733> <5734> 8878\n<5735> <5735> 4626\n<5736> <5736> 8880\n<5737> <5737> 4628\n<5738> <573c> 8881\n<573d> <5746> 4634\n<5747> <5747> 8886\n<5748> <5749> 4645\n<574a> <574a> 8887\n<574b> <5754> 4648\n<5755> <5755> 8888\n<5756> <575a> 4659\n<575b> <575e> 8889\n<575f> <5766> 4668\n<5767> <5767> 8893\n<5768> <5768> 4677\n<5769> <576a> 8894\n<576b> <5779> 4680\n<5821> <5843> 4695\n<5844> <5844> 8896\n<5845> <5846> 4731\n<5847> <5847> 8897\n<5848> <5848> 4734\n<5849> <5849> 8898\n<584a> <584b> 4736\n<584c> <584d> 8899\n<584e> <584f> 4740\n<5850> <5851> 8901\n<5852> <5852> 4744\n<5853> <5853> 8903\n<5854> <5858> 4746\n<5859> <5859> 8904\nendcidrange\n\n100 begincidrange\n<585a> <585a> 4752\n<585b> <585c> 8905\n<585d> <5870> 4755\n<5871> <5871> 8907\n<5872> <5875> 4776\n<5876> <5877> 8908\n<5878> <587e> 4782\n<5921> <592c> 4789\n<592d> <592d> 8910\n<592e> <592e> 4802\n<592f> <592f> 8911\n<5930> <5930> 4804\n<5931> <5933> 8912\n<5934> <5946> 4808\n<5947> <5947> 8915\n<5948> <594c> 4828\n<594d> <5950> 8916\n<5951> <595c> 4837\n<595d> <595d> 8920\n<595e> <5960> 4850\n<5961> <5961> 8921\n<5962> <5963> 4854\n<5964> <5964> 8922\n<5965> <5965> 4857\n<5966> <5966> 8923\n<5967> <596b> 4859\n<596c> <596c> 8924\n<596d> <5973> 4865\n<5974> <5975> 8925\n<5976> <597e> 4874\n<5a21> <5a24> 4883\n<5a25> <5a5f> 8927\n<5a60> <5a69> 4946\n<5a6a> <5a6a> 8986\n<5a6b> <5a76> 4957\n<5a77> <5a77> 8987\n<5a78> <5a78> 4970\n<5a79> <5a79> 8988\n<5a7a> <5a7d> 4972\n<5a7e> <5a7e> 8989\n<5b21> <5b22> 4977\n<5b23> <5b23> 8990\n<5b24> <5b25> 4980\n<5b26> <5b26> 8991\n<5b27> <5b28> 4983\n<5b29> <5b2a> 8992\n<5b2b> <5b3a> 4987\n<5b3b> <5b3b> 8994\n<5b3c> <5b3c> 5004\n<5b3d> <5b3d> 8995\n<5b3e> <5b4e> 5006\n<5b4f> <5b4f> 8996\n<5b50> <5b50> 5024\n<5b51> <5b51> 8997\n<5b52> <5b5a> 5026\n<5b5b> <5b5b> 8998\n<5b5c> <5b5d> 5036\n<5b5e> <5b5e> 8999\n<5b5f> <5b61> 5039\n<5b62> <5b62> 9000\n<5b63> <5b63> 5043\n<5b64> <5b64> 9001\n<5b65> <5b6a> 5045\n<5b6b> <5b6b> 9002\n<5b6c> <5b6d> 5052\n<5b6e> <5b6e> 9003\n<5b6f> <5b70> 5055\n<5b71> <5b71> 9004\n<5b72> <5b74> 5058\n<5b75> <5b77> 9005\n<5b78> <5b7e> 5064\n<5c21> <5c3b> 5071\n<5c3c> <5c3c> 9008\n<5c3d> <5c3e> 5099\n<5c3f> <5c3f> 9009\n<5c40> <5c41> 5102\n<5c42> <5c42> 9010\n<5c43> <5c47> 5105\n<5c48> <5c4a> 9011\n<5c4b> <5c50> 5113\n<5c51> <5c51> 9014\n<5c52> <5c56> 5120\n<5c57> <5c57> 9015\n<5c58> <5c5f> 5126\n<5c60> <5c60> 9016\n<5c61> <5c62> 5135\n<5c63> <5c64> 9017\n<5c65> <5c68> 5139\n<5c69> <5c6a> 9019\n<5c6b> <5c70> 5145\n<5c71> <5c71> 9021\n<5c72> <5c75> 5152\n<5c76> <5c76> 9022\n<5c77> <5c78> 5157\n<5c79> <5c79> 9023\n<5c7a> <5c7c> 5160\n<5c7d> <5c7e> 9024\n<5d21> <5d21> 9026\n<5d22> <5d22> 5166\n<5d23> <5d27> 9027\nendcidrange\n\n100 begincidrange\n<5d28> <5d29> 5172\n<5d2a> <5d2b> 9032\n<5d2c> <5d31> 5176\n<5d32> <5d32> 9034\n<5d33> <5d34> 5183\n<5d35> <5d35> 9035\n<5d36> <5d39> 5186\n<5d3a> <5d3b> 9036\n<5d3c> <5d52> 5192\n<5d53> <5d53> 9038\n<5d54> <5d5a> 5216\n<5d5b> <5d5b> 9039\n<5d5c> <5d5d> 5224\n<5d5e> <5d5e> 9040\n<5d5f> <5d63> 5227\n<5d64> <5d64> 9041\n<5d65> <5d6a> 5233\n<5d6b> <5d6b> 9042\n<5d6c> <5d70> 5240\n<5d71> <5d71> 9043\n<5d72> <5d75> 5246\n<5d76> <5d77> 9044\n<5d78> <5d7b> 5252\n<5d7c> <5d7c> 9046\n<5d7d> <5d7d> 5257\n<5d7e> <5d7e> 9047\n<5e21> <5e2c> 5259\n<5e2d> <5e2d> 9048\n<5e2e> <5e33> 5272\n<5e34> <5e34> 9049\n<5e35> <5e39> 5279\n<5e3a> <5e3a> 9050\n<5e3b> <5e45> 5285\n<5e46> <5e46> 9051\n<5e47> <5e4e> 5297\n<5e4f> <5e4f> 9052\n<5e50> <5e50> 5306\n<5e51> <5e52> 9053\n<5e53> <5e57> 5309\n<5e58> <5e58> 9055\n<5e59> <5e61> 5315\n<5e62> <5e62> 9056\n<5e63> <5e67> 5325\n<5e68> <5e68> 9057\n<5e69> <5e6b> 5331\n<5e6c> <5e6c> 9058\n<5e6d> <5e72> 5335\n<5e73> <5e73> 9059\n<5e74> <5e7b> 5342\n<5e7c> <5e7c> 9060\n<5e7d> <5e7e> 5351\n<5f21> <5f21> 5353\n<5f22> <5f23> 9061\n<5f24> <5f24> 5356\n<5f25> <5f25> 9063\n<5f26> <5f33> 5358\n<5f34> <5f34> 9064\n<5f35> <5f3b> 5373\n<5f3c> <5f3d> 9065\n<5f3e> <5f3e> 5382\n<5f3f> <5f3f> 9067\n<5f40> <5f41> 5384\n<5f42> <5f43> 9068\n<5f44> <5f4b> 5388\n<5f4c> <5f4c> 9070\n<5f4d> <5f4f> 5397\n<5f50> <5f50> 9071\n<5f51> <5f54> 5401\n<5f55> <5f55> 9072\n<5f56> <5f57> 5406\n<5f58> <5f59> 9073\n<5f5a> <5f5b> 5410\n<5f5c> <5f5c> 9075\n<5f5d> <5f5f> 5413\n<5f60> <5f60> 9076\n<5f61> <5f61> 5417\n<5f62> <5f62> 9077\n<5f63> <5f65> 5419\n<5f66> <5f66> 9078\n<5f67> <5f68> 5423\n<5f69> <5f69> 9079\n<5f6a> <5f6a> 5426\n<5f6b> <5f6b> 9080\n<5f6c> <5f6e> 5428\n<5f6f> <5f6f> 9081\n<5f70> <5f74> 5432\n<5f75> <5f75> 9082\n<5f76> <5f78> 5438\n<5f79> <5f79> 9083\n<5f7a> <5f7e> 5442\n<6021> <6035> 5447\n<6036> <6037> 9084\n<6038> <603e> 5470\n<603f> <603f> 9086\n<6040> <6047> 5478\n<6048> <6048> 9087\n<6049> <604d> 5487\n<604e> <604e> 9088\n<604f> <6052> 5493\n<6053> <6053> 9089\nendcidrange\n\n100 begincidrange\n<6054> <605f> 5498\n<6060> <6060> 9090\n<6061> <606f> 5511\n<6070> <6070> 9091\n<6071> <6077> 5527\n<6078> <6078> 9092\n<6079> <607b> 5535\n<607c> <607e> 9093\n<6121> <612a> 5541\n<612b> <612b> 9096\n<612c> <612c> 5552\n<612d> <612d> 9097\n<612e> <612f> 5554\n<6130> <6130> 9098\n<6131> <6133> 5557\n<6134> <6134> 9099\n<6135> <613a> 5561\n<613b> <613b> 9100\n<613c> <613c> 5568\n<613d> <613d> 9101\n<613e> <613f> 5570\n<6140> <6141> 9102\n<6142> <6148> 5574\n<6149> <6149> 9104\n<614a> <614f> 5582\n<6150> <6150> 9105\n<6151> <615a> 5589\n<615b> <615b> 9106\n<615c> <6160> 5600\n<6161> <6161> 1962\n<6162> <6162> 9107\n<6163> <6166> 5607\n<6167> <6167> 4504\n<6168> <616d> 5612\n<616e> <616f> 9108\n<6170> <6175> 5620\n<6176> <6176> 9110\n<6177> <6177> 5627\n<6178> <6178> 9111\n<6179> <617c> 5629\n<617d> <617d> 9112\n<617e> <617e> 5634\n<6221> <6223> 5635\n<6224> <6224> 9113\n<6225> <6227> 5639\n<6228> <6228> 9114\n<6229> <623a> 5643\n<623b> <6244> 9115\n<6245> <6245> 4293\n<6246> <624e> 9125\n<624f> <624f> 5681\n<6250> <6250> 9134\n<6251> <6258> 5683\n<6259> <6259> 9135\n<625a> <6262> 5692\n<6263> <6264> 9136\n<6265> <6265> 5703\n<6266> <6266> 9138\n<6267> <6268> 5705\n<6269> <626b> 9139\n<626c> <6277> 5710\n<6278> <6278> 9142\n<6279> <6279> 5723\n<627a> <627d> 9143\n<627e> <627e> 5728\n<6321> <6321> 5729\n<6322> <6322> 9147\n<6323> <6324> 5731\n<6325> <6325> 9148\n<6326> <632a> 5734\n<632b> <632b> 9149\n<632c> <6333> 5740\n<6334> <6334> 9150\n<6335> <6344> 5749\n<6345> <635b> 9151\n<635c> <6362> 5788\n<6363> <6363> 9174\n<6364> <636c> 5796\n<636d> <636d> 9175\n<636e> <6370> 5806\n<6371> <6372> 9176\n<6373> <6377> 5811\n<6378> <6378> 9178\n<6379> <637d> 5817\n<637e> <637e> 9179\n<6421> <6423> 5823\n<6424> <6425> 9180\n<6426> <642a> 5828\n<642b> <642b> 9182\n<642c> <642e> 5834\n<642f> <6431> 9183\n<6432> <6434> 5840\n<6435> <6436> 9186\n<6437> <6441> 5845\n<6442> <6442> 9188\n<6443> <6444> 5857\n<6445> <6445> 9189\n<6446> <6448> 5860\n<6449> <6449> 9190\n<644a> <6458> 5864\nendcidrange\n\n100 begincidrange\n<6459> <6459> 9191\n<645a> <645b> 5880\n<645c> <645c> 9192\n<645d> <645d> 5883\n<645e> <645e> 9193\n<645f> <6463> 5885\n<6464> <6464> 9194\n<6465> <646a> 5891\n<646b> <646c> 9195\n<646d> <6471> 5899\n<6472> <6472> 9197\n<6473> <647d> 5905\n<647e> <647e> 9198\n<6521> <652f> 5917\n<6530> <6530> 9199\n<6531> <6538> 5933\n<6539> <6539> 9200\n<653a> <6546> 5942\n<6547> <6547> 9201\n<6548> <6548> 5956\n<6549> <6549> 9202\n<654a> <654d> 5958\n<654e> <654e> 9203\n<654f> <656f> 5963\n<6570> <6570> 9204\n<6571> <6571> 5997\n<6572> <6572> 9205\n<6573> <657b> 5999\n<657c> <657d> 9206\n<657e> <657e> 6010\n<6621> <6622> 6011\n<6623> <6623> 9208\n<6624> <662a> 6014\n<662b> <662c> 9209\n<662d> <662d> 6023\n<662e> <662e> 9211\n<662f> <6633> 6025\n<6634> <6635> 9212\n<6636> <663e> 6032\n<663f> <663f> 9214\n<6640> <6647> 6042\n<6648> <6649> 9215\n<664a> <664c> 6052\n<664d> <664d> 9217\n<664e> <665f> 6056\n<6660> <667e> 9218\n<6721> <675a> 9249\n<675b> <6760> 6163\n<6761> <6762> 9307\n<6763> <6766> 6171\n<6767> <6767> 9309\n<6768> <676e> 6176\n<676f> <676f> 9310\n<6770> <6773> 6184\n<6774> <6776> 9311\n<6777> <677e> 6191\n<6821> <6827> 6199\n<6828> <6828> 9314\n<6829> <682b> 6207\n<682c> <682c> 9315\n<682d> <6835> 6211\n<6836> <6836> 9316\n<6837> <6837> 6221\n<6838> <683a> 9317\n<683b> <683e> 6225\n<683f> <6840> 9320\n<6841> <6844> 6231\n<6845> <6845> 9322\n<6846> <6846> 6236\n<6847> <6849> 9323\n<684a> <684d> 6240\n<684e> <684e> 9326\n<684f> <684f> 6245\n<6850> <6850> 9327\n<6851> <6852> 6247\n<6853> <6853> 9328\n<6854> <685c> 6250\n<685d> <685d> 9329\n<685e> <685e> 6260\n<685f> <685f> 9330\n<6860> <6861> 6262\n<6862> <6863> 9331\n<6864> <6864> 6266\n<6865> <6865> 9333\n<6866> <6866> 6268\n<6867> <6867> 9334\n<6868> <686a> 6270\n<686b> <686b> 9335\n<686c> <686c> 6274\n<686d> <686d> 9336\n<686e> <686e> 6276\n<686f> <686f> 9337\n<6870> <6878> 6278\n<6879> <6879> 9338\n<687a> <687b> 6288\n<687c> <687d> 9339\n<687e> <687e> 6292\n<6921> <6921> 9341\n<6922> <692c> 6294\n<692d> <692d> 9342\nendcidrange\n\n100 begincidrange\n<692e> <6933> 6306\n<6934> <6935> 9343\n<6936> <6936> 6314\n<6937> <6937> 9345\n<6938> <6943> 6316\n<6944> <6944> 9346\n<6945> <6945> 6329\n<6946> <6946> 9347\n<6947> <6948> 6331\n<6949> <6949> 9348\n<694a> <6955> 6334\n<6956> <6956> 9349\n<6957> <6959> 6347\n<695a> <695a> 9350\n<695b> <6963> 6351\n<6964> <6964> 9351\n<6965> <6965> 6361\n<6966> <6967> 9352\n<6968> <6968> 6364\n<6969> <6969> 9354\n<696a> <696a> 6366\n<696b> <696b> 9355\n<696c> <696c> 6368\n<696d> <697e> 9356\n<6a21> <6a25> 9374\n<6a26> <6a26> 6392\n<6a27> <6a28> 9379\n<6a29> <6a30> 6395\n<6a31> <6a31> 9381\n<6a32> <6a3b> 6404\n<6a3c> <6a3c> 9382\n<6a3d> <6a49> 6415\n<6a4a> <6a4a> 9383\n<6a4b> <6a4c> 6429\n<6a4d> <6a4d> 9384\n<6a4e> <6a52> 6432\n<6a53> <6a53> 9385\n<6a54> <6a59> 6438\n<6a5a> <6a6f> 9386\n<6a70> <6a7e> 6466\n<6b21> <6b26> 6481\n<6b27> <6b27> 9408\n<6b28> <6b29> 6488\n<6b2a> <6b2a> 9409\n<6b2b> <6b31> 6491\n<6b32> <6b32> 9410\n<6b33> <6b38> 6499\n<6b39> <6b39> 9411\n<6b3a> <6b49> 6506\n<6b4a> <6b4b> 9412\n<6b4c> <6b4c> 6524\n<6b4d> <6b4d> 9414\n<6b4e> <6b55> 6526\n<6b56> <6b56> 9415\n<6b57> <6b59> 6535\n<6b5a> <6b5a> 9416\n<6b5b> <6b60> 6539\n<6b61> <6b61> 9417\n<6b62> <6b76> 6546\n<6b77> <6b77> 9418\n<6b78> <6b7e> 6568\n<6c21> <6c22> 6575\n<6c23> <6c23> 9419\n<6c24> <6c28> 6578\n<6c29> <6c2e> 9420\n<6c2f> <6c30> 6589\n<6c31> <6c31> 9426\n<6c32> <6c33> 6592\n<6c34> <6c35> 9427\n<6c36> <6c3d> 6596\n<6c3e> <6c3f> 9429\n<6c40> <6c40> 6606\n<6c41> <6c41> 9431\n<6c42> <6c46> 6608\n<6c47> <6c47> 9432\n<6c48> <6c4a> 6614\n<6c4b> <6c4b> 9433\n<6c4c> <6c61> 6618\n<6c62> <6c62> 9434\n<6c63> <6c71> 6641\n<6c72> <6c72> 9435\n<6c73> <6c74> 6657\n<6c75> <6c75> 9436\n<6c76> <6c77> 6660\n<6c78> <6c78> 9437\n<6c79> <6c7e> 6663\n<6d21> <6d21> 9438\n<6d22> <6d27> 6670\n<6d28> <6d28> 9439\n<6d29> <6d2e> 6677\n<6d2f> <6d30> 9440\n<6d31> <6d33> 6685\n<6d34> <6d34> 9442\n<6d35> <6d35> 6689\n<6d36> <6d36> 9443\n<6d37> <6d37> 6691\n<6d38> <6d38> 9444\n<6d39> <6d39> 6693\n<6d3a> <6d3a> 9445\n<6d3b> <6d3e> 6695\nendcidrange\n\n100 begincidrange\n<6d3f> <6d3f> 9446\n<6d40> <6d41> 6700\n<6d42> <6d43> 9447\n<6d44> <6d4b> 6704\n<6d4c> <6d4d> 9449\n<6d4e> <6d52> 6714\n<6d53> <6d53> 9451\n<6d54> <6d56> 6720\n<6d57> <6d57> 9452\n<6d58> <6d67> 6724\n<6d68> <6d68> 9453\n<6d69> <6d6d> 6741\n<6d6e> <6d6e> 9454\n<6d6f> <6d78> 6747\n<6d79> <6d7a> 9455\n<6d7b> <6d7e> 6759\n<6e21> <6e3b> 6763\n<6e3c> <6e3c> 9457\n<6e3d> <6e3e> 6791\n<6e3f> <6e3f> 9458\n<6e40> <6e43> 6794\n<6e44> <6e7e> 9459\n<6f21> <6f71> 9518\n<6f72> <6f7e> 6938\n<7021> <7022> 6951\n<7023> <7023> 9599\n<7024> <702e> 6954\n<702f> <7059> 9600\n<705a> <705b> 7008\n<705c> <705d> 9643\n<705e> <705e> 7012\n<705f> <705f> 9645\n<7060> <7068> 7014\n<7069> <7069> 9646\n<706a> <706b> 7024\n<706c> <706c> 9647\n<706d> <706e> 7027\n<706f> <706f> 9648\n<7070> <7076> 7030\n<7077> <7077> 9649\n<7078> <7078> 7038\n<7079> <7079> 9650\n<707a> <707b> 7040\n<707c> <707c> 9651\n<707d> <707e> 7043\n<7121> <7127> 7045\n<7128> <7128> 9652\n<7129> <712a> 7053\n<712b> <712b> 9653\n<712c> <712d> 7056\n<712e> <712e> 9654\n<712f> <7131> 7059\n<7132> <7132> 9655\n<7133> <713b> 7063\n<713c> <713c> 9656\n<713d> <713f> 7073\n<7140> <7140> 9657\n<7141> <7148> 7077\n<7149> <7149> 9658\n<714a> <714c> 7086\n<714d> <714d> 9659\n<714e> <714e> 7090\n<714f> <7150> 9660\n<7151> <7159> 7093\n<715a> <715a> 9662\n<715b> <715b> 7103\n<715c> <715c> 9663\n<715d> <7163> 7105\n<7164> <7164> 9664\n<7165> <716b> 7113\n<716c> <716c> 9665\n<716d> <716e> 7121\n<716f> <716f> 9666\n<7170> <7176> 7124\n<7177> <7177> 9667\n<7178> <7178> 7132\n<7179> <7179> 9668\n<717a> <717b> 7134\n<717c> <717e> 9669\n<7221> <722d> 9672\n<722e> <7230> 7152\n<7231> <7232> 9685\n<7233> <7238> 7157\n<7239> <7239> 9687\n<723a> <7242> 7164\n<7243> <7243> 9688\n<7244> <7248> 7174\n<7249> <7249> 9689\n<724a> <724b> 7180\n<724c> <724d> 9690\n<724e> <724e> 7184\n<724f> <724f> 9692\n<7250> <7252> 7186\n<7253> <7253> 9693\n<7254> <7264> 7190\n<7265> <7265> 9694\n<7266> <726d> 7208\n<726e> <726e> 9695\n<726f> <7276> 7217\n<7277> <7277> 9696\nendcidrange\n\n100 begincidrange\n<7278> <727c> 7226\n<727d> <727d> 9697\n<727e> <727e> 7232\n<7321> <733e> 7233\n<733f> <733f> 9698\n<7340> <7345> 7264\n<7346> <7346> 9699\n<7347> <7347> 7271\n<7348> <7348> 9700\n<7349> <7355> 7273\n<7356> <7356> 9701\n<7357> <7358> 7287\n<7359> <7359> 9702\n<735a> <7364> 7290\n<7365> <7366> 9703\n<7367> <7369> 7303\n<736a> <736a> 9705\n<736b> <736b> 7307\n<736c> <736c> 9706\n<736d> <736e> 7309\n<736f> <736f> 9707\n<7370> <7370> 7312\n<7371> <7371> 9708\n<7372> <737c> 7314\n<737d> <737d> 9709\n<737e> <737e> 7326\n<7421> <7424> 7327\n<7425> <7425> 9710\n<7426> <742e> 7332\n<742f> <742f> 9711\n<7430> <7434> 7342\n<7435> <7435> 9712\n<7436> <7440> 7348\n<7441> <7441> 9713\n<7442> <7446> 7360\n<7447> <7447> 9714\n<7448> <744e> 7366\n<744f> <7450> 9715\n<7451> <7455> 7375\n<7456> <7456> 9717\n<7457> <7469> 7381\n<746a> <746a> 9718\n<746b> <746e> 7401\n<746f> <746f> 9719\n<7470> <7474> 7406\n<7475> <7475> 9720\n<7476> <747e> 7412\n<7521> <7525> 7421\n<7526> <7527> 9721\n<7528> <7539> 7428\n<753a> <753b> 9723\n<753c> <7543> 7448\n<7544> <7544> 9725\n<7545> <7547> 7457\n<7548> <7548> 9726\n<7549> <754d> 7461\n<754e> <754f> 9727\n<7550> <7550> 7468\n<7551> <7552> 9729\n<7553> <7558> 7471\n<7559> <7559> 9731\n<755a> <755b> 7478\n<755c> <755c> 9732\n<755d> <7565> 7481\n<7566> <7567> 9733\n<7568> <756e> 7492\n<756f> <756f> 9735\n<7570> <7571> 7500\n<7572> <7572> 9736\n<7573> <757b> 7503\n<757c> <757c> 9737\n<757d> <757e> 7513\n<7621> <7622> 7515\n<7623> <7623> 9738\n<7624> <7625> 7518\n<7626> <7626> 9739\n<7627> <7627> 7521\n<7628> <7628> 9740\n<7629> <762a> 7523\n<762b> <762b> 9741\n<762c> <762f> 7526\n<7630> <7630> 9742\n<7631> <7632> 7531\n<7633> <763e> 9743\n<763f> <7644> 7545\n<7645> <7645> 9755\n<7646> <7646> 7552\n<7647> <7647> 9756\n<7648> <7648> 7554\n<7649> <7649> 9757\n<764a> <764e> 7556\n<764f> <767e> 9758\n<7721> <772f> 9806\n<7730> <7731> 7624\n<7732> <7733> 9821\n<7734> <7734> 7628\n<7735> <7735> 9823\n<7736> <773c> 7630\n<773d> <773d> 9824\n<773e> <7742> 7638\nendcidrange\n\n81 begincidrange\n<7743> <7743> 9825\n<7744> <7744> 7644\n<7745> <7746> 9826\n<7747> <7749> 7647\n<774a> <774b> 9828\n<774c> <774e> 7652\n<774f> <7750> 9830\n<7751> <775d> 7657\n<775e> <775e> 9832\n<775f> <7760> 7671\n<7761> <7761> 2745\n<7762> <7771> 7674\n<7772> <7772> 9833\n<7773> <7774> 7691\n<7775> <7775> 9834\n<7776> <777e> 7694\n<7821> <7826> 9835\n<7827> <7827> 1228\n<7828> <7828> 1290\n<7829> <7829> 1304\n<782a> <782b> 9841\n<782c> <782c> 1428\n<782d> <782d> 1486\n<782e> <782e> 9843\n<782f> <782f> 1526\n<7830> <7831> 9844\n<7832> <7832> 1619\n<7833> <7833> 1662\n<7834> <7834> 9846\n<7835> <7835> 1732\n<7836> <7837> 9847\n<7838> <7838> 1852\n<7839> <783a> 9849\n<783b> <783b> 1987\n<783c> <783f> 9851\n<7840> <7840> 2091\n<7841> <7841> 9855\n<7842> <7842> 2126\n<7843> <7843> 2153\n<7844> <7845> 9856\n<7846> <7846> 2316\n<7847> <7848> 9858\n<7849> <7849> 2417\n<784a> <784a> 9860\n<784b> <784c> 2458\n<784d> <784d> 9861\n<784e> <784e> 2522\n<784f> <784f> 9862\n<7850> <7850> 2554\n<7851> <785b> 9863\n<785c> <785c> 3034\n<785d> <785d> 3037\n<785e> <785e> 3050\n<785f> <785f> 3052\n<7860> <7860> 3058\n<7861> <7865> 9874\n<7866> <7866> 3218\n<7867> <7867> 3354\n<7868> <7868> 3468\n<7869> <7869> 3518\n<786a> <786a> 9879\n<786b> <786b> 3579\n<786c> <786e> 9880\n<786f> <786f> 3696\n<7870> <7870> 9883\n<7871> <7871> 3747\n<7872> <7877> 9884\n<7878> <7878> 4157\n<7879> <7879> 4313\n<787a> <787b> 9890\n<787c> <787c> 4347\n<787d> <787d> 4361\n<787e> <787e> 9892\n<7921> <7921> 4513\n<7922> <7922> 9893\n<7923> <7923> 4538\n<7924> <7925> 9894\n<7926> <7926> 4565\n<7927> <7927> 9896\n<7928> <7928> 4605\n<7929> <7929> 4633\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/GBT-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (GBT-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (GBT-H)\n%%BeginResource: CMap (GBT-V)\n%%Title: (GBT-V Adobe GB1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/GBT-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 1 def\nend def\n\n/CMapName /GBT-V def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 700 def\n/XUID [1 10 25373] def\n\n/WMode 1 def\n\n20 begincidrange\n<2122> <2122>  575\n<2123> <2123>  574\n<212a> <212a>  598\n<212b> <212c> 7704\n<212d> <212d>  599\n<2132> <213f>  582\n<217e> <217e> 7706\n<2321> <2321>  578\n<2328> <2329>  580\n<232c> <232c>  573\n<232e> <232e> 7707\n<233a> <233b>  576\n<233d> <233d> 7708\n<233f> <233f>  579\n<235b> <235b> 7709\n<235d> <235d> 7710\n<235f> <235f>  600\n<237b> <237b>  596\n<237d> <237d>  597\n<237e> <237e> 7711\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/GBTpc-EUC-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (GBTpc-EUC-H)\n%%Title: (GBTpc-EUC-H Adobe GB1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 1 def\nend def\n\n/CMapName /GBTpc-EUC-H def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 380 def\n/XUID [1 10 25374] def\n\n/WMode 0 def\n\n3 begincodespacerange\n  <00>   <80>\n  <A1A1> <FCFE>\n  <FD>   <FF>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 1\nendnotdefrange\n\n100 begincidrange\n<20> <7e> 1\n<80> <80> 7712\n<a1a1> <a1fe> 96\n<a2b1> <a2e2> 190\n<a2e5> <a2ee> 240\n<a2f1> <a2fc> 250\n<a3a1> <a3fe> 262\n<a4a1> <a4f3> 356\n<a5a1> <a5f6> 439\n<a6a1> <a6b8> 525\n<a6c1> <a6f5> 549\n<a7a1> <a7c1> 602\n<a7d1> <a7f1> 635\n<a8a1> <a8c0> 668\n<a8c5> <a8ea> 700\n<a9a4> <a9ef> 738\n<aaa1> <aafe> 814\n<aba1> <abc0> 908\n<b0a1> <b0a7> 940\n<b0a8> <b0a8> 7717\n<b0a9> <b0a9> 948\n<b0aa> <b0aa> 7718\n<b0ab> <b0ac> 950\n<b0ad> <b0ae> 7719\n<b0af> <b0b8> 954\n<b0b9> <b0b9> 7721\n<b0ba> <b0bf> 965\n<b0c0> <b0c0> 7722\n<b0c1> <b0d2> 972\n<b0d3> <b0d3> 7723\n<b0d4> <b0d4> 991\n<b0d5> <b0d5> 7724\n<b0d6> <b0d9> 993\n<b0da> <b0da> 7725\n<b0db> <b0db> 998\n<b0dc> <b0dc> 7726\n<b0dd> <b0e3> 1000\n<b0e4> <b0e4> 7727\n<b0e5> <b0eb> 1008\n<b0ec> <b0ed> 7728\n<b0ee> <b0ee> 1017\n<b0ef> <b0ef> 7730\n<b0f0> <b0f2> 1019\n<b0f3> <b0f3> 7731\n<b0f4> <b0f6> 1023\n<b0f7> <b0f7> 7732\n<b0f8> <b0f8> 1027\n<b0f9> <b0f9> 7733\n<b0fa> <b0fe> 1029\n<b1a1> <b1a4> 1034\n<b1a5> <b1a6> 7734\n<b1a7> <b1a7> 1040\n<b1a8> <b1a8> 7736\n<b1a9> <b1aa> 1042\n<b1ab> <b1ab> 7737\n<b1ac> <b1b1> 1045\n<b1b2> <b1b2> 7738\n<b1b3> <b1b3> 1052\n<b1b4> <b1b5> 7739\n<b1b6> <b1b6> 1055\n<b1b7> <b1b9> 7741\n<b1ba> <b1c0> 1059\n<b1c1> <b1c1> 7744\n<b1c2> <b1c9> 1067\n<b1ca> <b1ca> 7745\n<b1cb> <b1ce> 1076\n<b1cf> <b1d0> 7746\n<b1d1> <b1d1> 1082\n<b1d2> <b1d2> 7748\n<b1d3> <b1d4> 1084\n<b1d5> <b1d5> 7749\n<b1d6> <b1de> 1087\n<b1df> <b1e1> 7750\n<b1e2> <b1e3> 1099\n<b1e4> <b1e4> 7753\n<b1e5> <b1e6> 1102\n<b1e7> <b1e8> 7754\n<b1e9> <b1e9> 1106\n<b1ea> <b1ea> 7756\n<b1eb> <b1ed> 1108\n<b1ee> <b1ee> 7757\n<b1ef> <b1f0> 1112\n<b1f1> <b1f1> 7758\n<b1f2> <b1f3> 1115\n<b1f4> <b1f7> 7759\n<b1f8> <b1fc> 1121\n<b1fd> <b1fd> 7763\n<b1fe> <b1fe> 1127\n<b2a1> <b2a5> 1128\n<b2a6> <b2a7> 7764\n<b2a8> <b2ab> 1135\n<b2ac> <b2ac> 7766\n<b2ad> <b2b4> 1140\n<b2b5> <b2b5> 7767\n<b2b6> <b2b8> 1149\n<b2b9> <b2b9> 7768\n<b2ba> <b2c5> 1153\n<b2c6> <b2c6> 7769\n<b2c7> <b2cd> 1166\n<b2ce> <b2d7> 7770\nendcidrange\n\n100 begincidrange\n<b2d8> <b2dd> 1183\n<b2de> <b2de> 7780\n<b2df> <b2df> 1190\n<b2e0> <b2e0> 7781\n<b2e1> <b2e1> 1192\n<b2e2> <b2e3> 7782\n<b2e4> <b2ee> 1195\n<b2ef> <b2ef> 7784\n<b2f0> <b2f2> 1207\n<b2f3> <b2fc> 7785\n<b2fd> <b2fe> 1220\n<b3a1> <b3a2> 7795\n<b3a3> <b3a3> 1224\n<b3a4> <b3a7> 7797\n<b3a8> <b3a8> 1229\n<b3a9> <b3a9> 7801\n<b3aa> <b3ad> 1231\n<b3ae> <b3ae> 7802\n<b3af> <b3b4> 1236\n<b3b5> <b3b5> 7803\n<b3b6> <b3b8> 1243\n<b3b9> <b3b9> 7804\n<b3ba> <b3bd> 1247\n<b3be> <b3be> 7805\n<b3bf> <b3c1> 1252\n<b3c2> <b3c2> 7806\n<b3c3> <b3c3> 1256\n<b3c4> <b3c4> 7807\n<b3c5> <b3c5> 1258\n<b3c6> <b3c6> 7808\n<b3c7> <b3cc> 1260\n<b3cd> <b3cd> 7809\n<b3ce> <b3ce> 1267\n<b3cf> <b3cf> 7810\n<b3d0> <b3d1> 1269\n<b3d2> <b3d2> 7811\n<b3d3> <b3d8> 1272\n<b3d9> <b3d9> 7812\n<b3da> <b3da> 1279\n<b3db> <b3db> 7813\n<b3dc> <b3dc> 1281\n<b3dd> <b3dd> 7814\n<b3de> <b3e2> 1283\n<b3e3> <b3e3> 7815\n<b3e4> <b3e4> 1289\n<b3e5> <b3e6> 7816\n<b3e7> <b3e7> 1292\n<b3e8> <b3e8> 7818\n<b3e9> <b3ea> 1294\n<b3eb> <b3ec> 7819\n<b3ed> <b3ee> 1298\n<b3ef> <b3ef> 7821\n<b3f0> <b3f0> 1301\n<b3f1> <b3f1> 7822\n<b3f2> <b3f2> 1303\n<b3f3> <b3f3> 7823\n<b3f4> <b3f9> 1305\n<b3fa> <b3fb> 7824\n<b3fc> <b3fe> 1313\n<b4a1> <b4a2> 7826\n<b4a3> <b4a4> 1318\n<b4a5> <b4a6> 7828\n<b4a7> <b4aa> 1322\n<b4ab> <b4ab> 7830\n<b4ac> <b4ae> 1327\n<b4af> <b4af> 7831\n<b4b0> <b4b2> 1331\n<b4b3> <b4b4> 7832\n<b4b5> <b4b7> 1336\n<b4b8> <b4b8> 7834\n<b4b9> <b4be> 1340\n<b4bf> <b4bf> 7835\n<b4c0> <b4c1> 1347\n<b4c2> <b4c2> 7836\n<b4c3> <b4c6> 1350\n<b4c7> <b4c7> 7837\n<b4c8> <b4c9> 1355\n<b4ca> <b4ca> 7838\n<b4cb> <b4cc> 1358\n<b4cd> <b4cd> 7839\n<b4ce> <b4ce> 1361\n<b4cf> <b4cf> 7840\n<b4d0> <b4d2> 1363\n<b4d3> <b4d4> 7841\n<b4d5> <b4d9> 1368\n<b4da> <b4da> 7843\n<b4db> <b4db> 1374\n<b4dc> <b4dc> 7844\n<b4dd> <b4ec> 1376\n<b4ed> <b4ed> 7845\n<b4ee> <b4ee> 1393\n<b4ef> <b4ef> 7846\n<b4f0> <b4f7> 1395\n<b4f8> <b4f8> 7847\n<b4f9> <b4fa> 1404\n<b4fb> <b4fb> 7848\n<b4fc> <b4fe> 1407\n<b5a1> <b5a2> 1410\n<b5a3> <b5a3> 7849\n<b5a4> <b5a4> 1413\nendcidrange\n\n100 begincidrange\n<b5a5> <b5a8> 7850\n<b5a9> <b5ab> 1418\n<b5ac> <b5ac> 7854\n<b5ad> <b5ad> 1422\n<b5ae> <b5af> 7855\n<b5b0> <b5b0> 1425\n<b5b1> <b5b5> 7857\n<b5b6> <b5b6> 1431\n<b5b7> <b5b7> 7862\n<b5b8> <b5b9> 1433\n<b5ba> <b5bc> 7863\n<b5bd> <b5c5> 1438\n<b5c6> <b5c6> 7866\n<b5c7> <b5ca> 1448\n<b5cb> <b5cb> 7867\n<b5cc> <b5cf> 1453\n<b5d0> <b5d0> 7868\n<b5d1> <b5d2> 1458\n<b5d3> <b5d3> 7869\n<b5d4> <b5dc> 1461\n<b5dd> <b5df> 7870\n<b5e0> <b5e2> 1473\n<b5e3> <b5e3> 7873\n<b5e4> <b5e5> 1477\n<b5e6> <b5e7> 7874\n<b5e8> <b5ec> 1481\n<b5ed> <b5ed> 7876\n<b5ee> <b5f5> 1487\n<b5f6> <b5f7> 7877\n<b5f8> <b5fc> 1497\n<b5fd> <b5fd> 7879\n<b5fe> <b5fe> 1503\n<b6a1> <b6a3> 1504\n<b6a4> <b6a5> 7880\n<b6a6> <b6a6> 1509\n<b6a7> <b6a7> 7882\n<b6a8> <b6a8> 1511\n<b6a9> <b6a9> 7883\n<b6aa> <b6aa> 1513\n<b6ab> <b6ab> 7884\n<b6ac> <b6ae> 1515\n<b6af> <b6b0> 7885\n<b6b1> <b6b2> 1520\n<b6b3> <b6b3> 7887\n<b6b4> <b6b6> 1523\n<b6b7> <b6b7> 7888\n<b6b8> <b6be> 1527\n<b6bf> <b6c1> 7889\n<b6c2> <b6c3> 1537\n<b6c4> <b6c4> 7892\n<b6c5> <b6c5> 1540\n<b6c6> <b6c6> 7893\n<b6c7> <b6cc> 1542\n<b6cd> <b6cd> 7894\n<b6ce> <b6ce> 1549\n<b6cf> <b6d0> 7895\n<b6d1> <b6d2> 1552\n<b6d3> <b6d4> 7897\n<b6d5> <b6d5> 1556\n<b6d6> <b6d6> 7899\n<b6d7> <b6d8> 1558\n<b6d9> <b6d9> 7900\n<b6da> <b6da> 1561\n<b6db> <b6db> 7901\n<b6dc> <b6e0> 1563\n<b6e1> <b6e1> 7902\n<b6e2> <b6e8> 1569\n<b6e9> <b6e9> 7903\n<b6ea> <b6eb> 1577\n<b6ec> <b6ec> 7904\n<b6ed> <b6ed> 1580\n<b6ee> <b6ef> 7905\n<b6f0> <b6f0> 1583\n<b6f1> <b6f1> 7907\n<b6f2> <b6f5> 1585\n<b6f6> <b6f6> 7908\n<b6f7> <b6f8> 1590\n<b6f9> <b6f9> 7909\n<b6fa> <b6fa> 1593\n<b6fb> <b6fc> 7910\n<b6fd> <b6fe> 1596\n<b7a1> <b7a3> 7912\n<b7a4> <b7a6> 1601\n<b7a7> <b7a7> 7915\n<b7a8> <b7ae> 1605\n<b7af> <b7b0> 7916\n<b7b1> <b7b2> 1614\n<b7b3> <b7b3> 7918\n<b7b4> <b7b5> 1617\n<b7b6> <b7b7> 7919\n<b7b8> <b7b8> 1621\n<b7b9> <b7b9> 7921\n<b7ba> <b7c2> 1623\n<b7c3> <b7c4> 7922\n<b7c5> <b7c8> 1634\n<b7c9> <b7c9> 7924\n<b7ca> <b7cb> 1639\n<b7cc> <b7cc> 7925\n<b7cd> <b7ce> 1642\n<b7cf> <b7cf> 7926\nendcidrange\n\n100 begincidrange\n<b7d0> <b7d0> 1645\n<b7d1> <b7d1> 7927\n<b7d2> <b7d6> 1647\n<b7d7> <b7d8> 7928\n<b7d9> <b7db> 1654\n<b7dc> <b7dc> 7930\n<b7dd> <b7de> 1658\n<b7df> <b7e1> 7931\n<b7e2> <b7e2> 1663\n<b7e3> <b7e3> 7934\n<b7e4> <b7e5> 1665\n<b7e6> <b7e8> 7935\n<b7e9> <b7ea> 1670\n<b7eb> <b7ed> 7938\n<b7ee> <b7ee> 1675\n<b7ef> <b7ef> 7941\n<b7f0> <b7f3> 1677\n<b7f4> <b7f4> 7942\n<b7f5> <b7f7> 1682\n<b7f8> <b7f8> 7943\n<b7f9> <b7fe> 1686\n<b8a1> <b8a6> 1692\n<b8a7> <b8a8> 7944\n<b8a9> <b8b2> 1700\n<b8b3> <b8b4> 7946\n<b8b5> <b8b9> 1712\n<b8ba> <b8ba> 7948\n<b8bb> <b8bb> 1718\n<b8bc> <b8bc> 7949\n<b8bd> <b8bd> 1720\n<b8be> <b8bf> 7950\n<b8c0> <b8c2> 1723\n<b8c3> <b8c3> 7952\n<b8c4> <b8c5> 1727\n<b8c6> <b8c7> 7953\n<b8c8> <b8c8> 1731\n<b8c9> <b8c9> 7955\n<b8ca> <b8ce> 1733\n<b8cf> <b8cf> 7956\n<b8d0> <b8d2> 1739\n<b8d3> <b8d6> 7957\n<b8d7> <b8d8> 1746\n<b8d9> <b8da> 7961\n<b8db> <b8e3> 1750\n<b8e4> <b8e4> 7963\n<b8e5> <b8e8> 1760\n<b8e9> <b8e9> 7964\n<b8ea> <b8ea> 1765\n<b8eb> <b8eb> 7965\n<b8ec> <b8f2> 1767\n<b8f3> <b8f3> 7966\n<b8f4> <b8f4> 1775\n<b8f5> <b8f6> 7967\n<b8f7> <b8f7> 1778\n<b8f8> <b8f8> 7969\n<b8f9> <b8fe> 1780\n<b9a1> <b9a7> 1786\n<b9a8> <b9a8> 7970\n<b9a9> <b9ad> 1794\n<b9ae> <b9ae> 7971\n<b9af> <b9b0> 1800\n<b9b1> <b9b1> 7972\n<b9b2> <b9b2> 1803\n<b9b3> <b9b3> 7973\n<b9b4> <b9b4> 1805\n<b9b5> <b9b5> 7974\n<b9b6> <b9b8> 1807\n<b9b9> <b9ba> 7975\n<b9bb> <b9c5> 1812\n<b9c6> <b9c6> 7977\n<b9c7> <b9ca> 1824\n<b9cb> <b9cb> 7978\n<b9cc> <b9cf> 1829\n<b9d0> <b9d0> 7979\n<b9d1> <b9d7> 1834\n<b9d8> <b9d8> 7980\n<b9d9> <b9da> 1842\n<b9db> <b9db> 7981\n<b9dc> <b9dc> 1845\n<b9dd> <b9dd> 7982\n<b9de> <b9de> 1847\n<b9df> <b9df> 7983\n<b9e0> <b9e0> 1849\n<b9e1> <b9e1> 7984\n<b9e2> <b9e2> 1851\n<b9e3> <b9e3> 7985\n<b9e4> <b9e5> 1853\n<b9e6> <b9e6> 7986\n<b9e7> <b9e8> 1856\n<b9e9> <b9ec> 7987\n<b9ed> <b9ed> 1862\n<b9ee> <b9ee> 7991\n<b9ef> <b9f0> 1864\n<b9f1> <b9f1> 7992\n<b9f2> <b9f2> 1867\n<b9f3> <b9f5> 7993\n<b9f6> <b9f7> 1871\n<b9f8> <b9f8> 7996\n<b9f9> <b9f9> 1874\n<b9fa> <b9fa> 7997\nendcidrange\n\n100 begincidrange\n<b9fb> <b9fc> 1876\n<b9fd> <b9fd> 7998\n<b9fe> <b9fe> 1879\n<baa1> <baa6> 1880\n<baa7> <baa7> 7999\n<baa8> <baaa> 1887\n<baab> <baab> 8000\n<baac> <bab9> 1891\n<baba> <baba> 8001\n<babb> <bac4> 1906\n<bac5> <bac5> 8002\n<bac6> <bad1> 1917\n<bad2> <bad2> 8003\n<bad3> <bad6> 1930\n<bad7> <bad8> 8004\n<bad9> <bae3> 1936\n<bae4> <bae4> 8006\n<bae5> <bae7> 1948\n<bae8> <bae8> 8007\n<bae9> <baeb> 1952\n<baec> <baec> 8008\n<baed> <baf2> 1956\n<baf3> <baf3> 5605\n<baf4> <baf7> 1963\n<baf8> <baf8> 8009\n<baf9> <bafe> 1968\n<bba1> <bba3> 1974\n<bba4> <bba4> 8010\n<bba5> <bba5> 1978\n<bba6> <bba6> 8011\n<bba7> <bba8> 1980\n<bba9> <bbaa> 8012\n<bbab> <bbac> 1984\n<bbad> <bbae> 8014\n<bbaf> <bbaf> 1988\n<bbb0> <bbb0> 8016\n<bbb1> <bbb2> 1990\n<bbb3> <bbb3> 8017\n<bbb4> <bbb4> 1993\n<bbb5> <bbb7> 8018\n<bbb8> <bbb8> 1997\n<bbb9> <bbba> 8021\n<bbbb> <bbd0> 2000\n<bbd1> <bbd1> 8023\n<bbd2> <bbd2> 2023\n<bbd3> <bbd4> 8024\n<bbd5> <bbde> 2026\n<bbdf> <bbe7> 8026\n<bbe8> <bbea> 2045\n<bbeb> <bbeb> 8035\n<bbec> <bbf0> 2049\n<bbf1> <bbf1> 8036\n<bbf2> <bbf4> 2055\n<bbf5> <bbf7> 8037\n<bbf8> <bbf9> 2061\n<bbfa> <bbfa> 8040\n<bbfb> <bbfc> 2064\n<bbfd> <bbfd> 8041\n<bbfe> <bbfe> 2067\n<bca1> <bca1> 2068\n<bca2> <bca2> 8042\n<bca3> <bca4> 2070\n<bca5> <bca6> 8043\n<bca7> <bca7> 2074\n<bca8> <bca9> 8045\n<bcaa> <bcaa> 2077\n<bcab> <bcab> 8047\n<bcac> <bcac> 2079\n<bcad> <bcad> 8048\n<bcae> <bcb5> 2081\n<bcb6> <bcb8> 8049\n<bcb9> <bcba> 2092\n<bcbb> <bcbb> 8052\n<bcbc> <bcc0> 2095\n<bcc1> <bcc1> 8053\n<bcc2> <bcc2> 2101\n<bcc3> <bcc3> 8054\n<bcc4> <bcc5> 2103\n<bcc6> <bcc7> 8055\n<bcc8> <bcc9> 2107\n<bcca> <bcca> 8057\n<bccb> <bccb> 2110\n<bccc> <bccd> 8058\n<bcce> <bccf> 2113\n<bcd0> <bcd0> 8060\n<bcd1> <bcd3> 2116\n<bcd4> <bcd6> 8061\n<bcd7> <bcd7> 2122\n<bcd8> <bcd8> 8064\n<bcd9> <bcda> 2124\n<bcdb> <bcdb> 8065\n<bcdc> <bcdc> 2127\n<bcdd> <bcdd> 8066\n<bcde> <bcde> 2129\n<bcdf> <bce1> 8067\n<bce2> <bce2> 2133\n<bce3> <bce4> 8070\n<bce5> <bce7> 2136\n<bce8> <bce8> 8072\n<bce9> <bce9> 2140\nendcidrange\n\n100 begincidrange\n<bcea> <bcec> 8073\n<bced> <bcee> 2144\n<bcef> <bcf3> 8076\n<bcf4> <bcf5> 2151\n<bcf6> <bcfc> 8081\n<bcfd> <bcfe> 2160\n<bda1> <bda1> 2162\n<bda2> <bda7> 8088\n<bda8> <bdaa> 2169\n<bdab> <bdac> 8094\n<bdad> <bdae> 2174\n<bdaf> <bdb2> 8096\n<bdb3> <bdb3> 2180\n<bdb4> <bdb4> 8100\n<bdb5> <bdb9> 2182\n<bdba> <bdba> 8101\n<bdbb> <bdbc> 2188\n<bdbd> <bdbf> 8102\n<bdc0> <bdc0> 2193\n<bdc1> <bdc4> 8105\n<bdc5> <bdc7> 2198\n<bdc8> <bdca> 8109\n<bdcb> <bdcd> 2204\n<bdce> <bdcf> 8112\n<bdd0> <bdd6> 2209\n<bdd7> <bdd7> 8114\n<bdd8> <bdd9> 2217\n<bdda> <bdda> 8115\n<bddb> <bddf> 2220\n<bde0> <bde1> 8116\n<bde2> <bdea> 2227\n<bdeb> <bdeb> 8118\n<bdec> <bdf3> 2237\n<bdf4> <bdf8> 8119\n<bdf9> <bdfc> 2250\n<bdfd> <bdfd> 8124\n<bdfe> <bdfe> 2255\n<bea1> <bea2> 8125\n<bea3> <bea4> 2258\n<bea5> <bea5> 8127\n<bea6> <bea7> 2261\n<bea8> <bea8> 8128\n<bea9> <bea9> 2264\n<beaa> <beaa> 8129\n<beab> <beac> 2266\n<bead> <bead> 8130\n<beae> <beb0> 2269\n<beb1> <beb1> 8131\n<beb2> <beb4> 2273\n<beb5> <beb7> 8132\n<beb8> <beb9> 2279\n<beba> <beba> 8135\n<bebb> <bebf> 2282\n<bec0> <bec0> 8136\n<bec1> <bec8> 2288\n<bec9> <bec9> 8137\n<beca> <bed3> 2297\n<bed4> <bed4> 8138\n<bed5> <bed8> 2308\n<bed9> <bed9> 8139\n<beda> <bedc> 2313\n<bedd> <bedd> 8140\n<bede> <bee1> 2317\n<bee2> <bee2> 8141\n<bee3> <bee4> 2322\n<bee5> <bee5> 8142\n<bee6> <bee6> 2325\n<bee7> <bee7> 8143\n<bee8> <bee8> 2327\n<bee9> <bee9> 8144\n<beea> <beed> 2329\n<beee> <beee> 8145\n<beef> <bef4> 2334\n<bef5> <bef5> 8146\n<bef6> <bef6> 2341\n<bef7> <bef8> 8147\n<bef9> <befa> 2344\n<befb> <befc> 8149\n<befd> <befe> 2348\n<bfa1> <bfa4> 2350\n<bfa5> <bfa5> 8151\n<bfa6> <bfa9> 2355\n<bfaa> <bfaa> 8152\n<bfab> <bfac> 2360\n<bfad> <bfad> 8153\n<bfae> <bfc4> 2363\n<bfc5> <bfc5> 8154\n<bfc6> <bfc6> 2387\n<bfc7> <bfc7> 8155\n<bfc8> <bfcd> 2389\n<bfce> <bfce> 8156\n<bfcf> <bfd0> 2396\n<bfd1> <bfd2> 8157\n<bfd3> <bfd8> 2400\n<bfd9> <bfd9> 8159\n<bfda> <bfe1> 2407\n<bfe2> <bfe4> 8160\n<bfe5> <bfe8> 2418\n<bfe9> <bfe9> 8163\n<bfea> <bfea> 2423\nendcidrange\n\n100 begincidrange\n<bfeb> <bfeb> 8164\n<bfec> <bfec> 2425\n<bfed> <bfed> 8165\n<bfee> <bff2> 2427\n<bff3> <bff3> 8166\n<bff4> <bff4> 2433\n<bff5> <bff5> 8167\n<bff6> <bff6> 2435\n<bff7> <bff7> 8168\n<bff8> <bff8> 2437\n<bff9> <bffa> 8169\n<bffb> <bffe> 2440\n<c0a1> <c0a1> 8171\n<c0a2> <c0a2> 2445\n<c0a3> <c0a3> 8172\n<c0a4> <c0a8> 2447\n<c0a9> <c0a9> 8173\n<c0aa> <c0aa> 2453\n<c0ab> <c0ab> 8174\n<c0ac> <c0ae> 2455\n<c0af> <c0b0> 8175\n<c0b1> <c0b2> 2460\n<c0b3> <c0b6> 8177\n<c0b7> <c0b7> 2466\n<c0b8> <c0c4> 8181\n<c0c5> <c0cb> 2480\n<c0cc> <c0cd> 8194\n<c0ce> <c0d3> 2489\n<c0d4> <c0d4> 8196\n<c0d5> <c0d5> 2496\n<c0d6> <c0d6> 8197\n<c0d7> <c0d7> 2498\n<c0d8> <c0d8> 8198\n<c0d9> <c0dc> 2500\n<c0dd> <c0dd> 8199\n<c0de> <c0df> 2505\n<c0e0> <c0e0> 8200\n<c0e1> <c0e8> 2508\n<c0e9> <c0e9> 8201\n<c0ea> <c0ea> 2517\n<c0eb> <c0ec> 8202\n<c0ed> <c0ee> 2520\n<c0ef> <c0f1> 8204\n<c0f2> <c0f5> 2525\n<c0f6> <c0fa> 8207\n<c0fb> <c0fe> 2534\n<c1a1> <c1a3> 2538\n<c1a4> <c1a5> 8212\n<c1a6> <c1a8> 2543\n<c1a9> <c1ad> 8214\n<c1ae> <c1ae> 2551\n<c1af> <c1b8> 8219\n<c1b9> <c1bc> 2562\n<c1bd> <c1be> 8229\n<c1bf> <c1c1> 2568\n<c1c2> <c1c2> 8231\n<c1c3> <c1c5> 2572\n<c1c6> <c1c6> 8232\n<c1c7> <c1c8> 2576\n<c1c9> <c1c9> 8233\n<c1ca> <c1cc> 2579\n<c1cd> <c1cd> 8234\n<c1ce> <c1d3> 2583\n<c1d4> <c1d4> 8235\n<c1d5> <c1d8> 2590\n<c1d9> <c1db> 8236\n<c1dc> <c1dd> 2597\n<c1de> <c1de> 8239\n<c1df> <c1e3> 2600\n<c1e4> <c1e5> 8240\n<c1e6> <c1e8> 2607\n<c1e9> <c1e9> 8242\n<c1ea> <c1ea> 2611\n<c1eb> <c1ec> 8243\n<c1ed> <c1f2> 2614\n<c1f3> <c1f3> 8245\n<c1f4> <c1f4> 2621\n<c1f5> <c1f5> 8246\n<c1f6> <c1f9> 2623\n<c1fa> <c1fd> 8247\n<c1fe> <c1fe> 2631\n<c2a1> <c2a1> 2632\n<c2a2> <c2a8> 8251\n<c2a9> <c2aa> 2640\n<c2ab> <c2b3> 8258\n<c2b4> <c2b7> 2651\n<c2b8> <c2b8> 8267\n<c2b9> <c2bb> 2656\n<c2bc> <c2bd> 8268\n<c2be> <c2be> 2661\n<c2bf> <c2bf> 8270\n<c2c0> <c2c0> 2663\n<c2c1> <c2c1> 8271\n<c2c2> <c2c4> 2665\n<c2c5> <c2c7> 8272\n<c2c8> <c2ca> 2671\n<c2cb> <c2d0> 8275\n<c2d1> <c2d1> 2680\n<c2d2> <c2d2> 8281\n<c2d3> <c2d4> 2682\nendcidrange\n\n100 begincidrange\n<c2d5> <c2dc> 8282\n<c2dd> <c2dd> 2692\n<c2de> <c2e2> 8290\n<c2e3> <c2e5> 2698\n<c2e6> <c2e8> 8295\n<c2e9> <c2e9> 2704\n<c2ea> <c2ee> 8298\n<c2ef> <c2ef> 2710\n<c2f0> <c2f0> 8303\n<c2f1> <c2f1> 2712\n<c2f2> <c2f5> 8304\n<c2f6> <c2f6> 2717\n<c2f7> <c2fa> 8308\n<c2fb> <c2fe> 2722\n<c3a1> <c3a1> 8312\n<c3a2> <c3a9> 2727\n<c3aa> <c3aa> 8313\n<c3ab> <c3ac> 2736\n<c3ad> <c3ad> 8314\n<c3ae> <c3b2> 2739\n<c3b3> <c3b3> 8315\n<c3b4> <c3b4> 7673\n<c3b5> <c3bd> 2746\n<c3be> <c3be> 8316\n<c3bf> <c3c4> 2756\n<c3c5> <c3c7> 8317\n<c3c8> <c3cb> 2765\n<c3cc> <c3cc> 8320\n<c3cd> <c3cd> 2770\n<c3ce> <c3ce> 8321\n<c3cf> <c3d4> 2772\n<c3d5> <c3d6> 8322\n<c3d7> <c3d8> 2780\n<c3d9> <c3d9> 8324\n<c3da> <c3df> 2783\n<c3e0> <c3e0> 8325\n<c3e1> <c3e4> 2790\n<c3e5> <c3e5> 8326\n<c3e6> <c3ec> 2795\n<c3ed> <c3ed> 8327\n<c3ee> <c3ef> 2803\n<c3f0> <c3f0> 8328\n<c3f1> <c3f4> 2806\n<c3f5> <c3f6> 8329\n<c3f7> <c3f8> 2812\n<c3f9> <c3fa> 8331\n<c3fb> <c3fc> 2816\n<c3fd> <c3fd> 8333\n<c3fe> <c3fe> 2819\n<c4a1> <c4b0> 2820\n<c4b1> <c4b1> 8334\n<c4b2> <c4b5> 2837\n<c4b6> <c4b6> 8335\n<c4b7> <c4c5> 2842\n<c4c6> <c4c6> 8336\n<c4c7> <c4c8> 2858\n<c4c9> <c4c9> 8337\n<c4ca> <c4d0> 2861\n<c4d1> <c4d1> 8338\n<c4d2> <c4d2> 2869\n<c4d3> <c4d6> 8339\n<c4d7> <c4d8> 2874\n<c4d9> <c4d9> 8343\n<c4da> <c4e1> 2877\n<c4e2> <c4e2> 8344\n<c4e3> <c4e4> 2886\n<c4e5> <c4e5> 8345\n<c4e6> <c4eb> 2889\n<c4ec> <c4ec> 8346\n<c4ed> <c4ef> 2896\n<c4f0> <c4f1> 8347\n<c4f2> <c4f3> 2901\n<c4f4> <c4f4> 8349\n<c4f5> <c4f5> 2904\n<c4f6> <c4f8> 8350\n<c4f9> <c4fa> 2908\n<c4fb> <c4fc> 8353\n<c4fd> <c4fd> 2912\n<c4fe> <c4fe> 8355\n<c5a1> <c5a2> 8356\n<c5a3> <c5a4> 2916\n<c5a5> <c5a9> 8358\n<c5aa> <c5b0> 2923\n<c5b1> <c5b1> 8363\n<c5b2> <c5b4> 2931\n<c5b5> <c5b5> 8364\n<c5b6> <c5b6> 2935\n<c5b7> <c5b9> 8365\n<c5ba> <c5ba> 2939\n<c5bb> <c5bb> 8368\n<c5bc> <c5bc> 2941\n<c5bd> <c5bd> 8369\n<c5be> <c5cb> 2943\n<c5cc> <c5cc> 8370\n<c5cd> <c5d2> 2958\n<c5d3> <c5d3> 8371\n<c5d4> <c5e1> 2965\n<c5e2> <c5e2> 8372\n<c5e3> <c5e6> 2980\n<c5e7> <c5e7> 8373\nendcidrange\n\n100 begincidrange\n<c5e8> <c5f3> 2985\n<c5f4> <c5f4> 8374\n<c5f5> <c5fe> 2998\n<c6a1> <c6ac> 3008\n<c6ad> <c6ae> 8375\n<c6af> <c6b4> 3022\n<c6b5> <c6b6> 8377\n<c6b7> <c6ba> 3030\n<c6bb> <c6bb> 8379\n<c6bc> <c6bd> 3035\n<c6be> <c6be> 8380\n<c6bf> <c6bf> 3038\n<c6c0> <c6c0> 8381\n<c6c1> <c6c2> 3040\n<c6c3> <c6c4> 8382\n<c6c5> <c6ca> 3044\n<c6cb> <c6cd> 8384\n<c6ce> <c6d2> 3053\n<c6d3> <c6d3> 8387\n<c6d4> <c6d6> 3059\n<c6d7> <c6d7> 8388\n<c6d8> <c6e9> 3063\n<c6ea> <c6eb> 8389\n<c6ec> <c6ee> 3083\n<c6ef> <c6ef> 8391\n<c6f0> <c6f0> 3087\n<c6f1> <c6f1> 8392\n<c6f2> <c6f3> 3089\n<c6f4> <c6f4> 8393\n<c6f5> <c6f7> 3092\n<c6f8> <c6f8> 8394\n<c6f9> <c6fc> 3096\n<c6fd> <c6fd> 8395\n<c6fe> <c6fe> 3101\n<c7a1> <c7a2> 3102\n<c7a3> <c7a3> 8396\n<c7a4> <c7a4> 3105\n<c7a5> <c7a6> 8397\n<c7a7> <c7a7> 3108\n<c7a8> <c7a9> 8399\n<c7aa> <c7aa> 3111\n<c7ab> <c7ab> 8401\n<c7ac> <c7ad> 3113\n<c7ae> <c7af> 8402\n<c7b0> <c7b2> 3117\n<c7b3> <c7b5> 8404\n<c7b6> <c7b8> 3123\n<c7b9> <c7ba> 8407\n<c7bb> <c7bc> 3128\n<c7bd> <c7be> 8409\n<c7bf> <c7bf> 3132\n<c7c0> <c7c0> 8411\n<c7c1> <c7c1> 3134\n<c7c2> <c7c2> 8412\n<c7c3> <c7c4> 3136\n<c7c5> <c7c5> 8413\n<c7c6> <c7c6> 3139\n<c7c7> <c7c8> 8414\n<c7c9> <c7cb> 3142\n<c7cc> <c7cc> 8416\n<c7cd> <c7ce> 3146\n<c7cf> <c7cf> 8417\n<c7d0> <c7d3> 3149\n<c7d4> <c7d5> 8418\n<c7d6> <c7d6> 3155\n<c7d7> <c7d7> 8420\n<c7d8> <c7dd> 3157\n<c7de> <c7de> 8421\n<c7df> <c7e0> 3164\n<c7e1> <c7e3> 8422\n<c7e4> <c7e9> 3169\n<c7ea> <c7ee> 8425\n<c7ef> <c7f6> 3180\n<c7f7> <c7f8> 8430\n<c7f9> <c7fa> 3190\n<c7fb> <c7fb> 8432\n<c7fc> <c7fc> 3193\n<c7fd> <c7fd> 8433\n<c7fe> <c7fe> 3195\n<c8a1> <c8a2> 3196\n<c8a3> <c8a3> 8434\n<c8a4> <c8a6> 3199\n<c8a7> <c8a8> 8435\n<c8a9> <c8af> 3204\n<c8b0> <c8b0> 8437\n<c8b1> <c8b4> 3212\n<c8b5> <c8b5> 8438\n<c8b6> <c8b6> 3217\n<c8b7> <c8b7> 8439\n<c8b8> <c8c2> 3219\n<c8c3> <c8c6> 8440\n<c8c7> <c8c7> 3234\n<c8c8> <c8c8> 8444\n<c8c9> <c8cc> 3236\n<c8cd> <c8cd> 8445\n<c8ce> <c8ce> 3241\n<c8cf> <c8cf> 8446\n<c8d0> <c8d1> 3243\n<c8d2> <c8d2> 8447\n<c8d3> <c8d8> 3246\nendcidrange\n\n100 begincidrange\n<c8d9> <c8d9> 8448\n<c8da> <c8dd> 3253\n<c8de> <c8de> 8449\n<c8df> <c8ec> 3258\n<c8ed> <c8ed> 8450\n<c8ee> <c8f0> 3273\n<c8f1> <c8f3> 8451\n<c8f4> <c8f6> 3279\n<c8f7> <c8f8> 8454\n<c8f9> <c8f9> 3284\n<c8fa> <c8fa> 8456\n<c8fb> <c8fb> 3286\n<c8fc> <c8fc> 8457\n<c8fd> <c8fe> 3288\n<c9a1> <c9a1> 8458\n<c9a2> <c9a4> 3291\n<c9a5> <c9a5> 8459\n<c9a6> <c9a6> 3295\n<c9a7> <c9a8> 8460\n<c9a9> <c9ab> 3298\n<c9ac> <c9ac> 8462\n<c9ad> <c9b0> 3302\n<c9b1> <c9b1> 8463\n<c9b2> <c9b3> 3307\n<c9b4> <c9b4> 8464\n<c9b5> <c9b7> 3310\n<c9b8> <c9b9> 8465\n<c9ba> <c9c0> 3315\n<c9c1> <c9c2> 8467\n<c9c3> <c9c3> 3324\n<c9c4> <c9c4> 8469\n<c9c5> <c9c8> 3326\n<c9c9> <c9c9> 8470\n<c9ca> <c9ca> 3331\n<c9cb> <c9cb> 8471\n<c9cc> <c9cc> 3333\n<c9cd> <c9cd> 8472\n<c9ce> <c9d4> 3335\n<c9d5> <c9d5> 8473\n<c9d6> <c9db> 3343\n<c9dc> <c9dc> 8474\n<c9dd> <c9dd> 3350\n<c9de> <c9de> 8475\n<c9df> <c9e0> 3352\n<c9e1> <c9e1> 8476\n<c9e2> <c9e2> 3355\n<c9e3> <c9e3> 8477\n<c9e4> <c9e4> 3357\n<c9e5> <c9e5> 8478\n<c9e6> <c9e7> 3359\n<c9e8> <c9e8> 8479\n<c9e9> <c9ef> 3362\n<c9f0> <c9f0> 8480\n<c9f1> <c9f2> 3370\n<c9f3> <c9f4> 8481\n<c9f5> <c9f5> 3374\n<c9f6> <c9f6> 8483\n<c9f7> <c9f7> 3376\n<c9f8> <c9f9> 8484\n<c9fa> <c9fd> 3379\n<c9fe> <c9fe> 8486\n<caa1> <caa3> 3384\n<caa4> <caa6> 8487\n<caa7> <caa7> 3390\n<caa8> <caa8> 8490\n<caa9> <caa9> 3392\n<caaa> <caab> 8491\n<caac> <cab0> 3395\n<cab1> <cab1> 8493\n<cab2> <cab3> 3401\n<cab4> <cab6> 8494\n<cab7> <caba> 3406\n<cabb> <cabb> 8497\n<cabc> <cac5> 3411\n<cac6> <cac6> 8498\n<cac7> <cac9> 3422\n<caca> <caca> 8499\n<cacb> <cacc> 3426\n<cacd> <cace> 8500\n<cacf> <cad2> 3430\n<cad3> <cad4> 8502\n<cad5> <cad8> 3436\n<cad9> <cad9> 8504\n<cada> <cadd> 3441\n<cade> <cade> 8505\n<cadf> <cadf> 3446\n<cae0> <cae0> 8506\n<cae1> <cae3> 3448\n<cae4> <cae4> 8507\n<cae5> <cae8> 3452\n<cae9> <caea> 8508\n<caeb> <caf3> 3458\n<caf4> <caf5> 8510\n<caf6> <caf6> 3469\n<caf7> <caf7> 8512\n<caf8> <caf9> 3471\n<cafa> <cafa> 8513\n<cafb> <cafc> 3474\n<cafd> <cafd> 8514\n<cafe> <cafe> 3477\nendcidrange\n\n100 begincidrange\n<cba1> <cba6> 3478\n<cba7> <cba7> 8515\n<cba8> <cbaa> 3485\n<cbab> <cbab> 8516\n<cbac> <cbac> 3489\n<cbad> <cbad> 8517\n<cbae> <cbb2> 3491\n<cbb3> <cbb3> 8518\n<cbb4> <cbb4> 3497\n<cbb5> <cbb6> 8519\n<cbb7> <cbb7> 3500\n<cbb8> <cbb8> 8521\n<cbb9> <cbbe> 3502\n<cbbf> <cbbf> 8522\n<cbc0> <cbc6> 3509\n<cbc7> <cbc7> 8523\n<cbc8> <cbc8> 3517\n<cbc9> <cbcc> 8524\n<cbcd> <cbce> 3522\n<cbcf> <cbd0> 8528\n<cbd1> <cbd2> 3526\n<cbd3> <cbd3> 8530\n<cbd4> <cbd4> 3529\n<cbd5> <cbd5> 8531\n<cbd6> <cbde> 3531\n<cbdf> <cbe0> 8532\n<cbe1> <cbe3> 3542\n<cbe4> <cbe4> 8534\n<cbe5> <cbe5> 3546\n<cbe6> <cbe7> 8535\n<cbe8> <cbe9> 3549\n<cbea> <cbea> 8537\n<cbeb> <cbee> 3552\n<cbef> <cbf0> 8538\n<cbf1> <cbf4> 3558\n<cbf5> <cbf6> 8540\n<cbf7> <cbf7> 3564\n<cbf8> <cbf8> 8542\n<cbf9> <cbfe> 3566\n<cca1> <cca2> 8543\n<cca3> <cca7> 3574\n<cca8> <cca8> 8545\n<cca9> <ccab> 3580\n<ccac> <ccac> 8546\n<ccad> <ccae> 3584\n<ccaf> <ccb3> 8547\n<ccb4> <ccb6> 3591\n<ccb7> <ccb8> 8552\n<ccb9> <ccbd> 3596\n<ccbe> <ccbe> 8554\n<ccbf> <ccbf> 3602\n<ccc0> <ccc0> 8555\n<ccc1> <cccb> 3604\n<cccc> <cccc> 8556\n<cccd> <cccd> 3616\n<ccce> <ccce> 8557\n<cccf> <cccf> 3618\n<ccd0> <ccd0> 8558\n<ccd1> <ccd5> 3620\n<ccd6> <ccd6> 8559\n<ccd7> <ccd9> 3626\n<ccda> <ccda> 8560\n<ccdb> <ccdb> 3630\n<ccdc> <ccdc> 8561\n<ccdd> <ccdf> 3632\n<cce0> <cce0> 8562\n<cce1> <cce1> 3636\n<cce2> <cce2> 8563\n<cce3> <cce4> 3638\n<cce5> <cce5> 8564\n<cce6> <ccf4> 3641\n<ccf5> <ccf5> 8565\n<ccf6> <ccf8> 3657\n<ccf9> <ccfa> 8566\n<ccfb> <ccfb> 3662\n<ccfc> <ccfe> 8568\n<cda1> <cdac> 3666\n<cdad> <cdad> 8571\n<cdae> <cdb2> 3679\n<cdb3> <cdb3> 8572\n<cdb4> <cdb6> 3685\n<cdb7> <cdb7> 8573\n<cdb8> <cdbb> 3689\n<cdbc> <cdbc> 8574\n<cdbd> <cdbe> 3694\n<cdbf> <cdbf> 8575\n<cdc0> <cdc4> 3697\n<cdc5> <cdc5> 8576\n<cdc6> <cdc6> 3703\n<cdc7> <cdc7> 8577\n<cdc8> <cdd1> 3705\n<cdd2> <cdd2> 8578\n<cdd3> <cdd3> 3716\n<cdd4> <cdd6> 8579\n<cdd7> <cddc> 3720\n<cddd> <cddd> 8582\n<cdde> <cddf> 3727\n<cde0> <cde0> 8583\n<cde1> <cde3> 3730\n<cde4> <cde5> 8584\nendcidrange\n\n100 begincidrange\n<cde6> <cde6> 3735\n<cde7> <cde7> 8586\n<cde8> <cdf1> 3737\n<cdf2> <cdf2> 8587\n<cdf3> <cdf7> 3748\n<cdf8> <cdf8> 8588\n<cdf9> <cdfe> 3754\n<cea1> <cea3> 3760\n<cea4> <cea5> 8589\n<cea6> <cea6> 3765\n<cea7> <cea7> 8591\n<cea8> <cea9> 3767\n<ceaa> <cead> 8592\n<ceae> <ceaf> 3773\n<ceb0> <ceb1> 8596\n<ceb2> <ceb2> 3777\n<ceb3> <ceb3> 8598\n<ceb4> <cebc> 3779\n<cebd> <cebd> 8599\n<cebe> <cebf> 3789\n<cec0> <cec0> 8600\n<cec1> <cec4> 3792\n<cec5> <cec6> 8601\n<cec7> <cec7> 3798\n<cec8> <cec8> 8603\n<cec9> <cec9> 3800\n<ceca> <ceca> 8604\n<cecb> <cecd> 3802\n<cece> <ced1> 8605\n<ced2> <ced7> 3809\n<ced8> <ceda> 8609\n<cedb> <cedb> 3818\n<cedc> <cedc> 8612\n<cedd> <cedd> 3820\n<cede> <cedf> 8613\n<cee0> <ceea> 3823\n<ceeb> <ceeb> 8615\n<ceec> <ceec> 3835\n<ceed> <ceed> 8616\n<ceee> <cef0> 3837\n<cef1> <cef1> 8617\n<cef2> <cef2> 3841\n<cef3> <cef3> 8618\n<cef4> <cefc> 3843\n<cefd> <cefe> 8619\n<cfa1> <cfad> 3854\n<cfae> <cfae> 8621\n<cfaf> <cfaf> 3868\n<cfb0> <cfb0> 8622\n<cfb1> <cfb2> 3870\n<cfb3> <cfb3> 8623\n<cfb4> <cfb6> 3873\n<cfb7> <cfb8> 8624\n<cfb9> <cfb9> 3878\n<cfba> <cfba> 8626\n<cfbb> <cfbc> 3880\n<cfbd> <cfbd> 8627\n<cfbe> <cfbe> 3883\n<cfbf> <cfc1> 8628\n<cfc2> <cfc4> 3887\n<cfc5> <cfc5> 8631\n<cfc6> <cfc6> 3891\n<cfc7> <cfc7> 8632\n<cfc8> <cfc9> 3893\n<cfca> <cfcb> 8633\n<cfcc> <cfcc> 3897\n<cfcd> <cfce> 8635\n<cfcf> <cfcf> 3900\n<cfd0> <cfd0> 8637\n<cfd1> <cfd3> 3902\n<cfd4> <cfd8> 8638\n<cfd9> <cfd9> 3910\n<cfda> <cfda> 8643\n<cfdb> <cfdb> 3912\n<cfdc> <cfdc> 8644\n<cfdd> <cfde> 3914\n<cfdf> <cfdf> 8645\n<cfe0> <cfe1> 3917\n<cfe2> <cfe2> 8646\n<cfe3> <cfe6> 3920\n<cfe7> <cfe7> 8647\n<cfe8> <cfe9> 3925\n<cfea> <cfea> 8648\n<cfeb> <cfeb> 3928\n<cfec> <cfec> 8649\n<cfed> <cfed> 3930\n<cfee> <cfee> 8650\n<cfef> <cff3> 3932\n<cff4> <cff4> 8651\n<cff5> <cff8> 3938\n<cff9> <cffa> 8652\n<cffb> <cffd> 3944\n<cffe> <cffe> 8654\n<d0a1> <d0a4> 3948\n<d0a5> <d0a5> 8655\n<d0a6> <d0ac> 3953\n<d0ad> <d0ae> 8656\n<d0af> <d0b1> 3962\n<d0b2> <d0b4> 8658\n<d0b5> <d0b9> 3968\nendcidrange\n\n100 begincidrange\n<d0ba> <d0bb> 8661\n<d0bc> <d0be> 3975\n<d0bf> <d0bf> 8663\n<d0c0> <d0c5> 3979\n<d0c6> <d0c6> 8664\n<d0c7> <d0ca> 3986\n<d0cb> <d0cb> 8665\n<d0cc> <d0e1> 3991\n<d0e2> <d0e2> 8666\n<d0e3> <d0e4> 4014\n<d0e5> <d0e5> 8667\n<d0e6> <d0ea> 4017\n<d0eb> <d0eb> 8668\n<d0ec> <d0ec> 4023\n<d0ed> <d0ed> 8669\n<d0ee> <d0f6> 4025\n<d0f7> <d0f9> 8670\n<d0fa> <d0fb> 4037\n<d0fc> <d0fc> 8673\n<d0fd> <d0fe> 4040\n<d1a1> <d1a2> 8674\n<d1a3> <d1a3> 4044\n<d1a4> <d1a4> 8676\n<d1a5> <d1a6> 4046\n<d1a7> <d1a7> 8677\n<d1a8> <d1aa> 4049\n<d1ab> <d1ab> 8678\n<d1ac> <d1ae> 4053\n<d1af> <d1b1> 8679\n<d1b2> <d1b4> 4059\n<d1b5> <d1b7> 8682\n<d1b8> <d1b8> 4065\n<d1b9> <d1b9> 8685\n<d1ba> <d1ba> 4067\n<d1bb> <d1bc> 8686\n<d1bd> <d1c5> 4070\n<d1c6> <d1c8> 8688\n<d1c9> <d1ca> 4082\n<d1cb> <d1cb> 8691\n<d1cc> <d1cd> 4085\n<d1ce> <d1cf> 8692\n<d1d0> <d1d4> 4089\n<d1d5> <d1d6> 8694\n<d1d7> <d1dd> 4096\n<d1de> <d1de> 8696\n<d1df> <d1e0> 4104\n<d1e1> <d1e2> 8697\n<d1e3> <d1e7> 4108\n<d1e8> <d1e9> 8699\n<d1ea> <d1eb> 4115\n<d1ec> <d1ec> 8701\n<d1ed> <d1ed> 4118\n<d1ee> <d1ef> 8702\n<d1f0> <d1f0> 4121\n<d1f1> <d1f1> 8704\n<d1f2> <d1f3> 4123\n<d1f4> <d1f4> 8705\n<d1f5> <d1f6> 4126\n<d1f7> <d1f9> 8706\n<d1fa> <d1fe> 4131\n<d2a1> <d2a1> 4136\n<d2a2> <d2a2> 8709\n<d2a3> <d2a4> 4138\n<d2a5> <d2a5> 8710\n<d2a6> <d2a8> 4141\n<d2a9> <d2a9> 8711\n<d2aa> <d2ae> 4145\n<d2af> <d2af> 8712\n<d2b0> <d2b2> 4151\n<d2b3> <d2b3> 8713\n<d2b4> <d2b4> 4155\n<d2b5> <d2b6> 8714\n<d2b7> <d2bc> 4158\n<d2bd> <d2bd> 8716\n<d2be> <d2be> 4165\n<d2bf> <d2bf> 8717\n<d2c0> <d2c2> 4167\n<d2c3> <d2c3> 8718\n<d2c4> <d2c4> 4171\n<d2c5> <d2c5> 8719\n<d2c6> <d2c6> 4173\n<d2c7> <d2c7> 8720\n<d2c8> <d2ce> 4175\n<d2cf> <d2cf> 8721\n<d2d0> <d2d4> 4183\n<d2d5> <d2d5> 8722\n<d2d6> <d2d9> 4189\n<d2da> <d2da> 8723\n<d2db> <d2e3> 4194\n<d2e4> <d2e5> 8724\n<d2e6> <d2e7> 4205\n<d2e8> <d2eb> 8726\n<d2ec> <d2ee> 4211\n<d2ef> <d2ef> 8730\n<d2f0> <d2f0> 4215\n<d2f1> <d2f1> 8731\n<d2f2> <d2f4> 4217\n<d2f5> <d2f5> 8732\n<d2f6> <d2f7> 4221\n<d2f8> <d2f8> 8733\nendcidrange\n\n100 begincidrange\n<d2f9> <d2fa> 4224\n<d2fb> <d2fb> 8734\n<d2fc> <d2fd> 4227\n<d2fe> <d2fe> 8735\n<d3a1> <d3a2> 4230\n<d3a3> <d3ac> 8736\n<d3ad> <d3ad> 4242\n<d3ae> <d3ae> 8746\n<d3af> <d3b0> 4244\n<d3b1> <d3b1> 8747\n<d3b2> <d3b3> 4247\n<d3b4> <d3b6> 8748\n<d3b7> <d3b7> 4252\n<d3b8> <d3b8> 8751\n<d3b9> <d3ba> 4254\n<d3bb> <d3bb> 8752\n<d3bc> <d3c4> 4257\n<d3c5> <d3c5> 8753\n<d3c6> <d3c6> 4267\n<d3c7> <d3c7> 8754\n<d3c8> <d3c9> 4269\n<d3ca> <d3cc> 8755\n<d3cd> <d3d4> 4274\n<d3d5> <d3d5> 8758\n<d3d6> <d3de> 4283\n<d3df> <d3e0> 8759\n<d3e1> <d3e2> 4294\n<d3e3> <d3e3> 8761\n<d3e4> <d3e5> 4297\n<d3e6> <d3e6> 8762\n<d3e7> <d3ea> 4300\n<d3eb> <d3ec> 8763\n<d3ed> <d3ee> 4306\n<d3ef> <d3ef> 8765\n<d3f0> <d3f3> 4309\n<d3f4> <d3f4> 8766\n<d3f5> <d3fb> 4314\n<d3fc> <d3fc> 8767\n<d3fd> <d3fd> 4322\n<d3fe> <d3fe> 8768\n<d4a1> <d4a3> 4324\n<d4a4> <d4a4> 8769\n<d4a5> <d4a5> 4328\n<d4a6> <d4a8> 8770\n<d4a9> <d4ae> 4332\n<d4af> <d4b2> 8773\n<d4b3> <d4b4> 4342\n<d4b5> <d4b6> 8777\n<d4b7> <d4b7> 4346\n<d4b8> <d4b8> 8779\n<d4b9> <d4bb> 4348\n<d4bc> <d4bc> 8780\n<d4bd> <d4bd> 4352\n<d4be> <d4bf> 8781\n<d4c0> <d4c3> 4355\n<d4c4> <d4c4> 8783\n<d4c5> <d4c5> 4360\n<d4c6> <d4c7> 8784\n<d4c8> <d4c8> 4363\n<d4c9> <d4c9> 8786\n<d4ca> <d4ca> 4365\n<d4cb> <d4ce> 8787\n<d4cf> <d4d2> 4370\n<d4d3> <d4d3> 8791\n<d4d4> <d4d7> 4375\n<d4d8> <d4d8> 8792\n<d4d9> <d4db> 4380\n<d4dc> <d4e0> 8793\n<d4e1> <d4e3> 4388\n<d4e4> <d4e4> 8798\n<d4e5> <d4e5> 4392\n<d4e6> <d4e6> 8799\n<d4e7> <d4ed> 4394\n<d4ee> <d4ee> 8800\n<d4ef> <d4ef> 4402\n<d4f0> <d4f4> 8801\n<d4f5> <d4f8> 4408\n<d4f9> <d4f9> 8806\n<d4fa> <d4fd> 4413\n<d4fe> <d4fe> 8807\n<d5a1> <d5a2> 8808\n<d5a3> <d5a8> 4420\n<d5a9> <d5a9> 8810\n<d5aa> <d5aa> 4427\n<d5ab> <d5ab> 8811\n<d5ac> <d5ad> 4429\n<d5ae> <d5ae> 8812\n<d5af> <d5b0> 4432\n<d5b1> <d5b1> 8813\n<d5b2> <d5b4> 4435\n<d5b5> <d5b8> 8814\n<d5b9> <d5ba> 4442\n<d5bb> <d5bb> 8818\n<d5bc> <d5bc> 4445\n<d5bd> <d5bd> 8819\n<d5be> <d5bf> 4447\n<d5c0> <d5c0> 8820\n<d5c1> <d5c4> 4450\n<d5c5> <d5c5> 8821\n<d5c6> <d5c6> 4455\nendcidrange\n\n100 begincidrange\n<d5c7> <d5c7> 8822\n<d5c8> <d5c9> 4457\n<d5ca> <d5cb> 8823\n<d5cc> <d5cc> 4461\n<d5cd> <d5cd> 8825\n<d5ce> <d5d3> 4463\n<d5d4> <d5d4> 8826\n<d5d5> <d5dc> 4470\n<d5dd> <d5de> 8827\n<d5df> <d5df> 4480\n<d5e0> <d5e0> 8829\n<d5e1> <d5e1> 4482\n<d5e2> <d5e2> 8830\n<d5e3> <d5e9> 4484\n<d5ea> <d5ec> 8831\n<d5ed> <d5ee> 4494\n<d5ef> <d5ef> 8834\n<d5f0> <d5f1> 4497\n<d5f2> <d5f3> 8835\n<d5f4> <d5f6> 4501\n<d5f7> <d5f7> 5611\n<d5f8> <d5fe> 4505\n<d6a1> <d6a4> 8837\n<d6a5> <d6ae> 4516\n<d6af> <d6b0> 8841\n<d6b1> <d6b3> 4528\n<d6b4> <d6b4> 8843\n<d6b5> <d6ba> 4532\n<d6bb> <d6bb> 8844\n<d6bc> <d6bc> 4539\n<d6bd> <d6bd> 8845\n<d6be> <d6be> 4541\n<d6bf> <d6c0> 8846\n<d6c1> <d6c3> 4544\n<d6c4> <d6c4> 8848\n<d6c5> <d6c9> 4548\n<d6ca> <d6ca> 8849\n<d6cb> <d6cc> 4554\n<d6cd> <d6cd> 8850\n<d6ce> <d6d2> 4557\n<d6d3> <d6d3> 8851\n<d6d4> <d6d4> 4563\n<d6d5> <d6d7> 8852\n<d6d8> <d6d9> 4567\n<d6da> <d6da> 8855\n<d6db> <d6de> 4570\n<d6df> <d6df> 8856\n<d6e0> <d6e0> 4575\n<d6e1> <d6e1> 8857\n<d6e2> <d6e4> 4577\n<d6e5> <d6e5> 8858\n<d6e6> <d6e6> 4581\n<d6e7> <d6e8> 8859\n<d6e9> <d6ed> 4584\n<d6ee> <d6ef> 8861\n<d6f0> <d6f1> 4591\n<d6f2> <d6f2> 8863\n<d6f3> <d6f4> 4594\n<d6f5> <d6f6> 8864\n<d6f7> <d6fb> 4598\n<d6fc> <d6fe> 8866\n<d7a1> <d7a3> 4606\n<d7a4> <d7a4> 8869\n<d7a5> <d7a7> 4610\n<d7a8> <d7aa> 8870\n<d7ab> <d7ab> 4616\n<d7ac> <d7ac> 8873\n<d7ad> <d7ad> 4618\n<d7ae> <d7b1> 8874\n<d7b2> <d7b2> 4623\n<d7b3> <d7b4> 8878\n<d7b5> <d7b5> 4626\n<d7b6> <d7b6> 8880\n<d7b7> <d7b7> 4628\n<d7b8> <d7bc> 8881\n<d7bd> <d7c6> 4634\n<d7c7> <d7c7> 8886\n<d7c8> <d7c9> 4645\n<d7ca> <d7ca> 8887\n<d7cb> <d7d4> 4648\n<d7d5> <d7d5> 8888\n<d7d6> <d7da> 4659\n<d7db> <d7de> 8889\n<d7df> <d7e6> 4668\n<d7e7> <d7e7> 8893\n<d7e8> <d7e8> 4677\n<d7e9> <d7ea> 8894\n<d7eb> <d7f9> 4680\n<d8a1> <d8c3> 4695\n<d8c4> <d8c4> 8896\n<d8c5> <d8c6> 4731\n<d8c7> <d8c7> 8897\n<d8c8> <d8c8> 4734\n<d8c9> <d8c9> 8898\n<d8ca> <d8cb> 4736\n<d8cc> <d8cd> 8899\n<d8ce> <d8cf> 4740\n<d8d0> <d8d1> 8901\n<d8d2> <d8d2> 4744\n<d8d3> <d8d3> 8903\nendcidrange\n\n100 begincidrange\n<d8d4> <d8d8> 4746\n<d8d9> <d8d9> 8904\n<d8da> <d8da> 4752\n<d8db> <d8dc> 8905\n<d8dd> <d8f0> 4755\n<d8f1> <d8f1> 8907\n<d8f2> <d8f5> 4776\n<d8f6> <d8f7> 8908\n<d8f8> <d8fe> 4782\n<d9a1> <d9ac> 4789\n<d9ad> <d9ad> 8910\n<d9ae> <d9ae> 4802\n<d9af> <d9af> 8911\n<d9b0> <d9b0> 4804\n<d9b1> <d9b3> 8912\n<d9b4> <d9c6> 4808\n<d9c7> <d9c7> 8915\n<d9c8> <d9cc> 4828\n<d9cd> <d9d0> 8916\n<d9d1> <d9dc> 4837\n<d9dd> <d9dd> 8920\n<d9de> <d9e0> 4850\n<d9e1> <d9e1> 8921\n<d9e2> <d9e3> 4854\n<d9e4> <d9e4> 8922\n<d9e5> <d9e5> 4857\n<d9e6> <d9e6> 8923\n<d9e7> <d9eb> 4859\n<d9ec> <d9ec> 8924\n<d9ed> <d9f3> 4865\n<d9f4> <d9f5> 8925\n<d9f6> <d9fe> 4874\n<daa1> <daa4> 4883\n<daa5> <dadf> 8927\n<dae0> <dae9> 4946\n<daea> <daea> 8986\n<daeb> <daf6> 4957\n<daf7> <daf7> 8987\n<daf8> <daf8> 4970\n<daf9> <daf9> 8988\n<dafa> <dafd> 4972\n<dafe> <dafe> 8989\n<dba1> <dba2> 4977\n<dba3> <dba3> 8990\n<dba4> <dba5> 4980\n<dba6> <dba6> 8991\n<dba7> <dba8> 4983\n<dba9> <dbaa> 8992\n<dbab> <dbba> 4987\n<dbbb> <dbbb> 8994\n<dbbc> <dbbc> 5004\n<dbbd> <dbbd> 8995\n<dbbe> <dbce> 5006\n<dbcf> <dbcf> 8996\n<dbd0> <dbd0> 5024\n<dbd1> <dbd1> 8997\n<dbd2> <dbda> 5026\n<dbdb> <dbdb> 8998\n<dbdc> <dbdd> 5036\n<dbde> <dbde> 8999\n<dbdf> <dbe1> 5039\n<dbe2> <dbe2> 9000\n<dbe3> <dbe3> 5043\n<dbe4> <dbe4> 9001\n<dbe5> <dbea> 5045\n<dbeb> <dbeb> 9002\n<dbec> <dbed> 5052\n<dbee> <dbee> 9003\n<dbef> <dbf0> 5055\n<dbf1> <dbf1> 9004\n<dbf2> <dbf4> 5058\n<dbf5> <dbf7> 9005\n<dbf8> <dbfe> 5064\n<dca1> <dcbb> 5071\n<dcbc> <dcbc> 9008\n<dcbd> <dcbe> 5099\n<dcbf> <dcbf> 9009\n<dcc0> <dcc1> 5102\n<dcc2> <dcc2> 9010\n<dcc3> <dcc7> 5105\n<dcc8> <dcca> 9011\n<dccb> <dcd0> 5113\n<dcd1> <dcd1> 9014\n<dcd2> <dcd6> 5120\n<dcd7> <dcd7> 9015\n<dcd8> <dcdf> 5126\n<dce0> <dce0> 9016\n<dce1> <dce2> 5135\n<dce3> <dce4> 9017\n<dce5> <dce8> 5139\n<dce9> <dcea> 9019\n<dceb> <dcf0> 5145\n<dcf1> <dcf1> 9021\n<dcf2> <dcf5> 5152\n<dcf6> <dcf6> 9022\n<dcf7> <dcf8> 5157\n<dcf9> <dcf9> 9023\n<dcfa> <dcfc> 5160\n<dcfd> <dcfe> 9024\n<dda1> <dda1> 9026\nendcidrange\n\n100 begincidrange\n<dda2> <dda2> 5166\n<dda3> <dda7> 9027\n<dda8> <dda9> 5172\n<ddaa> <ddab> 9032\n<ddac> <ddb1> 5176\n<ddb2> <ddb2> 9034\n<ddb3> <ddb4> 5183\n<ddb5> <ddb5> 9035\n<ddb6> <ddb9> 5186\n<ddba> <ddbb> 9036\n<ddbc> <ddd2> 5192\n<ddd3> <ddd3> 9038\n<ddd4> <ddda> 5216\n<dddb> <dddb> 9039\n<dddc> <dddd> 5224\n<ddde> <ddde> 9040\n<dddf> <dde3> 5227\n<dde4> <dde4> 9041\n<dde5> <ddea> 5233\n<ddeb> <ddeb> 9042\n<ddec> <ddf0> 5240\n<ddf1> <ddf1> 9043\n<ddf2> <ddf5> 5246\n<ddf6> <ddf7> 9044\n<ddf8> <ddfb> 5252\n<ddfc> <ddfc> 9046\n<ddfd> <ddfd> 5257\n<ddfe> <ddfe> 9047\n<dea1> <deac> 5259\n<dead> <dead> 9048\n<deae> <deb3> 5272\n<deb4> <deb4> 9049\n<deb5> <deb9> 5279\n<deba> <deba> 9050\n<debb> <dec5> 5285\n<dec6> <dec6> 9051\n<dec7> <dece> 5297\n<decf> <decf> 9052\n<ded0> <ded0> 5306\n<ded1> <ded2> 9053\n<ded3> <ded7> 5309\n<ded8> <ded8> 9055\n<ded9> <dee1> 5315\n<dee2> <dee2> 9056\n<dee3> <dee7> 5325\n<dee8> <dee8> 9057\n<dee9> <deeb> 5331\n<deec> <deec> 9058\n<deed> <def2> 5335\n<def3> <def3> 9059\n<def4> <defb> 5342\n<defc> <defc> 9060\n<defd> <defe> 5351\n<dfa1> <dfa1> 5353\n<dfa2> <dfa3> 9061\n<dfa4> <dfa4> 5356\n<dfa5> <dfa5> 9063\n<dfa6> <dfb3> 5358\n<dfb4> <dfb4> 9064\n<dfb5> <dfbb> 5373\n<dfbc> <dfbd> 9065\n<dfbe> <dfbe> 5382\n<dfbf> <dfbf> 9067\n<dfc0> <dfc1> 5384\n<dfc2> <dfc3> 9068\n<dfc4> <dfcb> 5388\n<dfcc> <dfcc> 9070\n<dfcd> <dfcf> 5397\n<dfd0> <dfd0> 9071\n<dfd1> <dfd4> 5401\n<dfd5> <dfd5> 9072\n<dfd6> <dfd7> 5406\n<dfd8> <dfd9> 9073\n<dfda> <dfdb> 5410\n<dfdc> <dfdc> 9075\n<dfdd> <dfdf> 5413\n<dfe0> <dfe0> 9076\n<dfe1> <dfe1> 5417\n<dfe2> <dfe2> 9077\n<dfe3> <dfe5> 5419\n<dfe6> <dfe6> 9078\n<dfe7> <dfe8> 5423\n<dfe9> <dfe9> 9079\n<dfea> <dfea> 5426\n<dfeb> <dfeb> 9080\n<dfec> <dfee> 5428\n<dfef> <dfef> 9081\n<dff0> <dff4> 5432\n<dff5> <dff5> 9082\n<dff6> <dff8> 5438\n<dff9> <dff9> 9083\n<dffa> <dffe> 5442\n<e0a1> <e0b5> 5447\n<e0b6> <e0b7> 9084\n<e0b8> <e0be> 5470\n<e0bf> <e0bf> 9086\n<e0c0> <e0c7> 5478\n<e0c8> <e0c8> 9087\n<e0c9> <e0cd> 5487\n<e0ce> <e0ce> 9088\nendcidrange\n\n100 begincidrange\n<e0cf> <e0d2> 5493\n<e0d3> <e0d3> 9089\n<e0d4> <e0df> 5498\n<e0e0> <e0e0> 9090\n<e0e1> <e0ef> 5511\n<e0f0> <e0f0> 9091\n<e0f1> <e0f7> 5527\n<e0f8> <e0f8> 9092\n<e0f9> <e0fb> 5535\n<e0fc> <e0fe> 9093\n<e1a1> <e1aa> 5541\n<e1ab> <e1ab> 9096\n<e1ac> <e1ac> 5552\n<e1ad> <e1ad> 9097\n<e1ae> <e1af> 5554\n<e1b0> <e1b0> 9098\n<e1b1> <e1b3> 5557\n<e1b4> <e1b4> 9099\n<e1b5> <e1ba> 5561\n<e1bb> <e1bb> 9100\n<e1bc> <e1bc> 5568\n<e1bd> <e1bd> 9101\n<e1be> <e1bf> 5570\n<e1c0> <e1c1> 9102\n<e1c2> <e1c8> 5574\n<e1c9> <e1c9> 9104\n<e1ca> <e1cf> 5582\n<e1d0> <e1d0> 9105\n<e1d1> <e1da> 5589\n<e1db> <e1db> 9106\n<e1dc> <e1e0> 5600\n<e1e1> <e1e1> 1962\n<e1e2> <e1e2> 9107\n<e1e3> <e1e6> 5607\n<e1e7> <e1e7> 4504\n<e1e8> <e1ed> 5612\n<e1ee> <e1ef> 9108\n<e1f0> <e1f5> 5620\n<e1f6> <e1f6> 9110\n<e1f7> <e1f7> 5627\n<e1f8> <e1f8> 9111\n<e1f9> <e1fc> 5629\n<e1fd> <e1fd> 9112\n<e1fe> <e1fe> 5634\n<e2a1> <e2a3> 5635\n<e2a4> <e2a4> 9113\n<e2a5> <e2a7> 5639\n<e2a8> <e2a8> 9114\n<e2a9> <e2ba> 5643\n<e2bb> <e2c4> 9115\n<e2c5> <e2c5> 4293\n<e2c6> <e2ce> 9125\n<e2cf> <e2cf> 5681\n<e2d0> <e2d0> 9134\n<e2d1> <e2d8> 5683\n<e2d9> <e2d9> 9135\n<e2da> <e2e2> 5692\n<e2e3> <e2e4> 9136\n<e2e5> <e2e5> 5703\n<e2e6> <e2e6> 9138\n<e2e7> <e2e8> 5705\n<e2e9> <e2eb> 9139\n<e2ec> <e2f7> 5710\n<e2f8> <e2f8> 9142\n<e2f9> <e2f9> 5723\n<e2fa> <e2fd> 9143\n<e2fe> <e2fe> 5728\n<e3a1> <e3a1> 5729\n<e3a2> <e3a2> 9147\n<e3a3> <e3a4> 5731\n<e3a5> <e3a5> 9148\n<e3a6> <e3aa> 5734\n<e3ab> <e3ab> 9149\n<e3ac> <e3b3> 5740\n<e3b4> <e3b4> 9150\n<e3b5> <e3c4> 5749\n<e3c5> <e3db> 9151\n<e3dc> <e3e2> 5788\n<e3e3> <e3e3> 9174\n<e3e4> <e3ec> 5796\n<e3ed> <e3ed> 9175\n<e3ee> <e3f0> 5806\n<e3f1> <e3f2> 9176\n<e3f3> <e3f7> 5811\n<e3f8> <e3f8> 9178\n<e3f9> <e3fd> 5817\n<e3fe> <e3fe> 9179\n<e4a1> <e4a3> 5823\n<e4a4> <e4a5> 9180\n<e4a6> <e4aa> 5828\n<e4ab> <e4ab> 9182\n<e4ac> <e4ae> 5834\n<e4af> <e4b1> 9183\n<e4b2> <e4b4> 5840\n<e4b5> <e4b6> 9186\n<e4b7> <e4c1> 5845\n<e4c2> <e4c2> 9188\n<e4c3> <e4c4> 5857\n<e4c5> <e4c5> 9189\n<e4c6> <e4c8> 5860\nendcidrange\n\n100 begincidrange\n<e4c9> <e4c9> 9190\n<e4ca> <e4d8> 5864\n<e4d9> <e4d9> 9191\n<e4da> <e4db> 5880\n<e4dc> <e4dc> 9192\n<e4dd> <e4dd> 5883\n<e4de> <e4de> 9193\n<e4df> <e4e3> 5885\n<e4e4> <e4e4> 9194\n<e4e5> <e4ea> 5891\n<e4eb> <e4ec> 9195\n<e4ed> <e4f1> 5899\n<e4f2> <e4f2> 9197\n<e4f3> <e4fd> 5905\n<e4fe> <e4fe> 9198\n<e5a1> <e5af> 5917\n<e5b0> <e5b0> 9199\n<e5b1> <e5b8> 5933\n<e5b9> <e5b9> 9200\n<e5ba> <e5c6> 5942\n<e5c7> <e5c7> 9201\n<e5c8> <e5c8> 5956\n<e5c9> <e5c9> 9202\n<e5ca> <e5cd> 5958\n<e5ce> <e5ce> 9203\n<e5cf> <e5ef> 5963\n<e5f0> <e5f0> 9204\n<e5f1> <e5f1> 5997\n<e5f2> <e5f2> 9205\n<e5f3> <e5fb> 5999\n<e5fc> <e5fd> 9206\n<e5fe> <e5fe> 6010\n<e6a1> <e6a2> 6011\n<e6a3> <e6a3> 9208\n<e6a4> <e6aa> 6014\n<e6ab> <e6ac> 9209\n<e6ad> <e6ad> 6023\n<e6ae> <e6ae> 9211\n<e6af> <e6b3> 6025\n<e6b4> <e6b5> 9212\n<e6b6> <e6be> 6032\n<e6bf> <e6bf> 9214\n<e6c0> <e6c7> 6042\n<e6c8> <e6c9> 9215\n<e6ca> <e6cc> 6052\n<e6cd> <e6cd> 9217\n<e6ce> <e6df> 6056\n<e6e0> <e6fe> 9218\n<e7a1> <e7da> 9249\n<e7db> <e7e0> 6163\n<e7e1> <e7e2> 9307\n<e7e3> <e7e6> 6171\n<e7e7> <e7e7> 9309\n<e7e8> <e7ee> 6176\n<e7ef> <e7ef> 9310\n<e7f0> <e7f3> 6184\n<e7f4> <e7f6> 9311\n<e7f7> <e7fe> 6191\n<e8a1> <e8a7> 6199\n<e8a8> <e8a8> 9314\n<e8a9> <e8ab> 6207\n<e8ac> <e8ac> 9315\n<e8ad> <e8b5> 6211\n<e8b6> <e8b6> 9316\n<e8b7> <e8b7> 6221\n<e8b8> <e8ba> 9317\n<e8bb> <e8be> 6225\n<e8bf> <e8c0> 9320\n<e8c1> <e8c4> 6231\n<e8c5> <e8c5> 9322\n<e8c6> <e8c6> 6236\n<e8c7> <e8c9> 9323\n<e8ca> <e8cd> 6240\n<e8ce> <e8ce> 9326\n<e8cf> <e8cf> 6245\n<e8d0> <e8d0> 9327\n<e8d1> <e8d2> 6247\n<e8d3> <e8d3> 9328\n<e8d4> <e8dc> 6250\n<e8dd> <e8dd> 9329\n<e8de> <e8de> 6260\n<e8df> <e8df> 9330\n<e8e0> <e8e1> 6262\n<e8e2> <e8e3> 9331\n<e8e4> <e8e4> 6266\n<e8e5> <e8e5> 9333\n<e8e6> <e8e6> 6268\n<e8e7> <e8e7> 9334\n<e8e8> <e8ea> 6270\n<e8eb> <e8eb> 9335\n<e8ec> <e8ec> 6274\n<e8ed> <e8ed> 9336\n<e8ee> <e8ee> 6276\n<e8ef> <e8ef> 9337\n<e8f0> <e8f8> 6278\n<e8f9> <e8f9> 9338\n<e8fa> <e8fb> 6288\n<e8fc> <e8fd> 9339\n<e8fe> <e8fe> 6292\n<e9a1> <e9a1> 9341\nendcidrange\n\n100 begincidrange\n<e9a2> <e9ac> 6294\n<e9ad> <e9ad> 9342\n<e9ae> <e9b3> 6306\n<e9b4> <e9b5> 9343\n<e9b6> <e9b6> 6314\n<e9b7> <e9b7> 9345\n<e9b8> <e9c3> 6316\n<e9c4> <e9c4> 9346\n<e9c5> <e9c5> 6329\n<e9c6> <e9c6> 9347\n<e9c7> <e9c8> 6331\n<e9c9> <e9c9> 9348\n<e9ca> <e9d5> 6334\n<e9d6> <e9d6> 9349\n<e9d7> <e9d9> 6347\n<e9da> <e9da> 9350\n<e9db> <e9e3> 6351\n<e9e4> <e9e4> 9351\n<e9e5> <e9e5> 6361\n<e9e6> <e9e7> 9352\n<e9e8> <e9e8> 6364\n<e9e9> <e9e9> 9354\n<e9ea> <e9ea> 6366\n<e9eb> <e9eb> 9355\n<e9ec> <e9ec> 6368\n<e9ed> <e9fe> 9356\n<eaa1> <eaa5> 9374\n<eaa6> <eaa6> 6392\n<eaa7> <eaa8> 9379\n<eaa9> <eab0> 6395\n<eab1> <eab1> 9381\n<eab2> <eabb> 6404\n<eabc> <eabc> 9382\n<eabd> <eac9> 6415\n<eaca> <eaca> 9383\n<eacb> <eacc> 6429\n<eacd> <eacd> 9384\n<eace> <ead2> 6432\n<ead3> <ead3> 9385\n<ead4> <ead9> 6438\n<eada> <eaef> 9386\n<eaf0> <eafe> 6466\n<eba1> <eba6> 6481\n<eba7> <eba7> 9408\n<eba8> <eba9> 6488\n<ebaa> <ebaa> 9409\n<ebab> <ebb1> 6491\n<ebb2> <ebb2> 9410\n<ebb3> <ebb8> 6499\n<ebb9> <ebb9> 9411\n<ebba> <ebc9> 6506\n<ebca> <ebcb> 9412\n<ebcc> <ebcc> 6524\n<ebcd> <ebcd> 9414\n<ebce> <ebd5> 6526\n<ebd6> <ebd6> 9415\n<ebd7> <ebd9> 6535\n<ebda> <ebda> 9416\n<ebdb> <ebe0> 6539\n<ebe1> <ebe1> 9417\n<ebe2> <ebf6> 6546\n<ebf7> <ebf7> 9418\n<ebf8> <ebfe> 6568\n<eca1> <eca2> 6575\n<eca3> <eca3> 9419\n<eca4> <eca8> 6578\n<eca9> <ecae> 9420\n<ecaf> <ecb0> 6589\n<ecb1> <ecb1> 9426\n<ecb2> <ecb3> 6592\n<ecb4> <ecb5> 9427\n<ecb6> <ecbd> 6596\n<ecbe> <ecbf> 9429\n<ecc0> <ecc0> 6606\n<ecc1> <ecc1> 9431\n<ecc2> <ecc6> 6608\n<ecc7> <ecc7> 9432\n<ecc8> <ecca> 6614\n<eccb> <eccb> 9433\n<eccc> <ece1> 6618\n<ece2> <ece2> 9434\n<ece3> <ecf1> 6641\n<ecf2> <ecf2> 9435\n<ecf3> <ecf4> 6657\n<ecf5> <ecf5> 9436\n<ecf6> <ecf7> 6660\n<ecf8> <ecf8> 9437\n<ecf9> <ecfe> 6663\n<eda1> <eda1> 9438\n<eda2> <eda7> 6670\n<eda8> <eda8> 9439\n<eda9> <edae> 6677\n<edaf> <edb0> 9440\n<edb1> <edb3> 6685\n<edb4> <edb4> 9442\n<edb5> <edb5> 6689\n<edb6> <edb6> 9443\n<edb7> <edb7> 6691\n<edb8> <edb8> 9444\n<edb9> <edb9> 6693\nendcidrange\n\n100 begincidrange\n<edba> <edba> 9445\n<edbb> <edbe> 6695\n<edbf> <edbf> 9446\n<edc0> <edc1> 6700\n<edc2> <edc3> 9447\n<edc4> <edcb> 6704\n<edcc> <edcd> 9449\n<edce> <edd2> 6714\n<edd3> <edd3> 9451\n<edd4> <edd6> 6720\n<edd7> <edd7> 9452\n<edd8> <ede7> 6724\n<ede8> <ede8> 9453\n<ede9> <eded> 6741\n<edee> <edee> 9454\n<edef> <edf8> 6747\n<edf9> <edfa> 9455\n<edfb> <edfe> 6759\n<eea1> <eebb> 6763\n<eebc> <eebc> 9457\n<eebd> <eebe> 6791\n<eebf> <eebf> 9458\n<eec0> <eec3> 6794\n<eec4> <eefe> 9459\n<efa1> <eff1> 9518\n<eff2> <effe> 6938\n<f0a1> <f0a2> 6951\n<f0a3> <f0a3> 9599\n<f0a4> <f0ae> 6954\n<f0af> <f0d9> 9600\n<f0da> <f0db> 7008\n<f0dc> <f0dd> 9643\n<f0de> <f0de> 7012\n<f0df> <f0df> 9645\n<f0e0> <f0e8> 7014\n<f0e9> <f0e9> 9646\n<f0ea> <f0eb> 7024\n<f0ec> <f0ec> 9647\n<f0ed> <f0ee> 7027\n<f0ef> <f0ef> 9648\n<f0f0> <f0f6> 7030\n<f0f7> <f0f7> 9649\n<f0f8> <f0f8> 7038\n<f0f9> <f0f9> 9650\n<f0fa> <f0fb> 7040\n<f0fc> <f0fc> 9651\n<f0fd> <f0fe> 7043\n<f1a1> <f1a7> 7045\n<f1a8> <f1a8> 9652\n<f1a9> <f1aa> 7053\n<f1ab> <f1ab> 9653\n<f1ac> <f1ad> 7056\n<f1ae> <f1ae> 9654\n<f1af> <f1b1> 7059\n<f1b2> <f1b2> 9655\n<f1b3> <f1bb> 7063\n<f1bc> <f1bc> 9656\n<f1bd> <f1bf> 7073\n<f1c0> <f1c0> 9657\n<f1c1> <f1c8> 7077\n<f1c9> <f1c9> 9658\n<f1ca> <f1cc> 7086\n<f1cd> <f1cd> 9659\n<f1ce> <f1ce> 7090\n<f1cf> <f1d0> 9660\n<f1d1> <f1d9> 7093\n<f1da> <f1da> 9662\n<f1db> <f1db> 7103\n<f1dc> <f1dc> 9663\n<f1dd> <f1e3> 7105\n<f1e4> <f1e4> 9664\n<f1e5> <f1eb> 7113\n<f1ec> <f1ec> 9665\n<f1ed> <f1ee> 7121\n<f1ef> <f1ef> 9666\n<f1f0> <f1f6> 7124\n<f1f7> <f1f7> 9667\n<f1f8> <f1f8> 7132\n<f1f9> <f1f9> 9668\n<f1fa> <f1fb> 7134\n<f1fc> <f1fe> 9669\n<f2a1> <f2ad> 9672\n<f2ae> <f2b0> 7152\n<f2b1> <f2b2> 9685\n<f2b3> <f2b8> 7157\n<f2b9> <f2b9> 9687\n<f2ba> <f2c2> 7164\n<f2c3> <f2c3> 9688\n<f2c4> <f2c8> 7174\n<f2c9> <f2c9> 9689\n<f2ca> <f2cb> 7180\n<f2cc> <f2cd> 9690\n<f2ce> <f2ce> 7184\n<f2cf> <f2cf> 9692\n<f2d0> <f2d2> 7186\n<f2d3> <f2d3> 9693\n<f2d4> <f2e4> 7190\n<f2e5> <f2e5> 9694\n<f2e6> <f2ed> 7208\n<f2ee> <f2ee> 9695\nendcidrange\n\n100 begincidrange\n<f2ef> <f2f6> 7217\n<f2f7> <f2f7> 9696\n<f2f8> <f2fc> 7226\n<f2fd> <f2fd> 9697\n<f2fe> <f2fe> 7232\n<f3a1> <f3be> 7233\n<f3bf> <f3bf> 9698\n<f3c0> <f3c5> 7264\n<f3c6> <f3c6> 9699\n<f3c7> <f3c7> 7271\n<f3c8> <f3c8> 9700\n<f3c9> <f3d5> 7273\n<f3d6> <f3d6> 9701\n<f3d7> <f3d8> 7287\n<f3d9> <f3d9> 9702\n<f3da> <f3e4> 7290\n<f3e5> <f3e6> 9703\n<f3e7> <f3e9> 7303\n<f3ea> <f3ea> 9705\n<f3eb> <f3eb> 7307\n<f3ec> <f3ec> 9706\n<f3ed> <f3ee> 7309\n<f3ef> <f3ef> 9707\n<f3f0> <f3f0> 7312\n<f3f1> <f3f1> 9708\n<f3f2> <f3fc> 7314\n<f3fd> <f3fd> 9709\n<f3fe> <f3fe> 7326\n<f4a1> <f4a4> 7327\n<f4a5> <f4a5> 9710\n<f4a6> <f4ae> 7332\n<f4af> <f4af> 9711\n<f4b0> <f4b4> 7342\n<f4b5> <f4b5> 9712\n<f4b6> <f4c0> 7348\n<f4c1> <f4c1> 9713\n<f4c2> <f4c6> 7360\n<f4c7> <f4c7> 9714\n<f4c8> <f4ce> 7366\n<f4cf> <f4d0> 9715\n<f4d1> <f4d5> 7375\n<f4d6> <f4d6> 9717\n<f4d7> <f4e9> 7381\n<f4ea> <f4ea> 9718\n<f4eb> <f4ee> 7401\n<f4ef> <f4ef> 9719\n<f4f0> <f4f4> 7406\n<f4f5> <f4f5> 9720\n<f4f6> <f4fe> 7412\n<f5a1> <f5a5> 7421\n<f5a6> <f5a7> 9721\n<f5a8> <f5b9> 7428\n<f5ba> <f5bb> 9723\n<f5bc> <f5c3> 7448\n<f5c4> <f5c4> 9725\n<f5c5> <f5c7> 7457\n<f5c8> <f5c8> 9726\n<f5c9> <f5cd> 7461\n<f5ce> <f5cf> 9727\n<f5d0> <f5d0> 7468\n<f5d1> <f5d2> 9729\n<f5d3> <f5d8> 7471\n<f5d9> <f5d9> 9731\n<f5da> <f5db> 7478\n<f5dc> <f5dc> 9732\n<f5dd> <f5e5> 7481\n<f5e6> <f5e7> 9733\n<f5e8> <f5ee> 7492\n<f5ef> <f5ef> 9735\n<f5f0> <f5f1> 7500\n<f5f2> <f5f2> 9736\n<f5f3> <f5fb> 7503\n<f5fc> <f5fc> 9737\n<f5fd> <f5fe> 7513\n<f6a1> <f6a2> 7515\n<f6a3> <f6a3> 9738\n<f6a4> <f6a5> 7518\n<f6a6> <f6a6> 9739\n<f6a7> <f6a7> 7521\n<f6a8> <f6a8> 9740\n<f6a9> <f6aa> 7523\n<f6ab> <f6ab> 9741\n<f6ac> <f6af> 7526\n<f6b0> <f6b0> 9742\n<f6b1> <f6b2> 7531\n<f6b3> <f6be> 9743\n<f6bf> <f6c4> 7545\n<f6c5> <f6c5> 9755\n<f6c6> <f6c6> 7552\n<f6c7> <f6c7> 9756\n<f6c8> <f6c8> 7554\n<f6c9> <f6c9> 9757\n<f6ca> <f6ce> 7556\n<f6cf> <f6fe> 9758\n<f7a1> <f7af> 9806\n<f7b0> <f7b1> 7624\n<f7b2> <f7b3> 9821\n<f7b4> <f7b4> 7628\n<f7b5> <f7b5> 9823\n<f7b6> <f7bc> 7630\nendcidrange\n\n84 begincidrange\n<f7bd> <f7bd> 9824\n<f7be> <f7c2> 7638\n<f7c3> <f7c3> 9825\n<f7c4> <f7c4> 7644\n<f7c5> <f7c6> 9826\n<f7c7> <f7c9> 7647\n<f7ca> <f7cb> 9828\n<f7cc> <f7ce> 7652\n<f7cf> <f7d0> 9830\n<f7d1> <f7dd> 7657\n<f7de> <f7de> 9832\n<f7df> <f7e0> 7671\n<f7e1> <f7e1> 2745\n<f7e2> <f7f1> 7674\n<f7f2> <f7f2> 9833\n<f7f3> <f7f4> 7691\n<f7f5> <f7f5> 9834\n<f7f6> <f7fe> 7694\n<f8a1> <f8a6> 9835\n<f8a7> <f8a7> 1228\n<f8a8> <f8a8> 1290\n<f8a9> <f8a9> 1304\n<f8aa> <f8ab> 9841\n<f8ac> <f8ac> 1428\n<f8ad> <f8ad> 1486\n<f8ae> <f8ae> 9843\n<f8af> <f8af> 1526\n<f8b0> <f8b1> 9844\n<f8b2> <f8b2> 1619\n<f8b3> <f8b3> 1662\n<f8b4> <f8b4> 9846\n<f8b5> <f8b5> 1732\n<f8b6> <f8b7> 9847\n<f8b8> <f8b8> 1852\n<f8b9> <f8ba> 9849\n<f8bb> <f8bb> 1987\n<f8bc> <f8bf> 9851\n<f8c0> <f8c0> 2091\n<f8c1> <f8c1> 9855\n<f8c2> <f8c2> 2126\n<f8c3> <f8c3> 2153\n<f8c4> <f8c5> 9856\n<f8c6> <f8c6> 2316\n<f8c7> <f8c8> 9858\n<f8c9> <f8c9> 2417\n<f8ca> <f8ca> 9860\n<f8cb> <f8cc> 2458\n<f8cd> <f8cd> 9861\n<f8ce> <f8ce> 2522\n<f8cf> <f8cf> 9862\n<f8d0> <f8d0> 2554\n<f8d1> <f8db> 9863\n<f8dc> <f8dc> 3034\n<f8dd> <f8dd> 3037\n<f8de> <f8de> 3050\n<f8df> <f8df> 3052\n<f8e0> <f8e0> 3058\n<f8e1> <f8e5> 9874\n<f8e6> <f8e6> 3218\n<f8e7> <f8e7> 3354\n<f8e8> <f8e8> 3468\n<f8e9> <f8e9> 3518\n<f8ea> <f8ea> 9879\n<f8eb> <f8eb> 3579\n<f8ec> <f8ee> 9880\n<f8ef> <f8ef> 3696\n<f8f0> <f8f0> 9883\n<f8f1> <f8f1> 3747\n<f8f2> <f8f7> 9884\n<f8f8> <f8f8> 4157\n<f8f9> <f8f9> 4313\n<f8fa> <f8fb> 9890\n<f8fc> <f8fc> 4347\n<f8fd> <f8fd> 4361\n<f8fe> <f8fe> 9892\n<f9a1> <f9a1> 4513\n<f9a2> <f9a2> 9893\n<f9a3> <f9a3> 4538\n<f9a4> <f9a5> 9894\n<f9a6> <f9a6> 4565\n<f9a7> <f9a7> 9896\n<f9a8> <f9a8> 4605\n<f9a9> <f9a9> 4633\n<fd> <ff> 7713\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/GBTpc-EUC-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (GBTpc-EUC-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (GBTpc-EUC-H)\n%%BeginResource: CMap (GBTpc-EUC-V)\n%%Title: (GBTpc-EUC-V Adobe GB1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/GBTpc-EUC-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 1 def\nend def\n\n/CMapName /GBTpc-EUC-V def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 680 def\n/XUID [1 10 25375] def\n\n/WMode 1 def\n\n20 begincidrange\n<a1a2> <a1a2>  575\n<a1a3> <a1a3>  574\n<a1aa> <a1aa>  598\n<a1ab> <a1ac> 7704\n<a1ad> <a1ad>  599\n<a1b2> <a1bf>  582\n<a1fe> <a1fe> 7706\n<a3a1> <a3a1>  578\n<a3a8> <a3a9>  580\n<a3ac> <a3ac>  573\n<a3ae> <a3ae> 7707\n<a3ba> <a3bb>  576\n<a3bd> <a3bd> 7708\n<a3bf> <a3bf>  579\n<a3db> <a3db> 7709\n<a3dd> <a3dd> 7710\n<a3df> <a3df>  600\n<a3fb> <a3fb>  596\n<a3fd> <a3fd>  597\n<a3fe> <a3fe> 7711\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/GBpc-EUC-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (GBpc-EUC-H)\n%%Title: (GBpc-EUC-H Adobe GB1 0)\n%%Version: 9.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 0 def\nend def\n\n/CMapName /GBpc-EUC-H def\n/CMapVersion 9.003 def\n/CMapType 1 def\n\n/UIDOffset 0 def\n/XUID [1 10 25364] def\n\n/WMode 0 def\n\n3 begincodespacerange\n  <00>   <80>\n  <A1A1> <FCFE>\n  <FD>   <FF>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 1\nendnotdefrange\n\n91 begincidrange\n<20> <7e> 1\n<80> <80> 7712\n<a1a1> <a1fe> 96\n<a2b1> <a2e2> 190\n<a2e5> <a2ee> 240\n<a2f1> <a2fc> 250\n<a3a1> <a3fe> 262\n<a4a1> <a4f3> 356\n<a5a1> <a5f6> 439\n<a6a1> <a6b8> 525\n<a6c1> <a6f5> 549\n<a7a1> <a7c1> 602\n<a7d1> <a7f1> 635\n<a8a1> <a8c0> 668\n<a8c5> <a8ea> 700\n<a9a4> <a9ef> 738\n<aaa1> <aafe> 814\n<aba1> <abc0> 908\n<b0a1> <b0fe> 940\n<b1a1> <b1fe> 1034\n<b2a1> <b2fe> 1128\n<b3a1> <b3fe> 1222\n<b4a1> <b4fe> 1316\n<b5a1> <b5fe> 1410\n<b6a1> <b6fe> 1504\n<b7a1> <b7fe> 1598\n<b8a1> <b8fe> 1692\n<b9a1> <b9fe> 1786\n<baa1> <bafe> 1880\n<bba1> <bbfe> 1974\n<bca1> <bcfe> 2068\n<bda1> <bdfe> 2162\n<bea1> <befe> 2256\n<bfa1> <bffe> 2350\n<c0a1> <c0fe> 2444\n<c1a1> <c1fe> 2538\n<c2a1> <c2fe> 2632\n<c3a1> <c3fe> 2726\n<c4a1> <c4fe> 2820\n<c5a1> <c5fe> 2914\n<c6a1> <c6fe> 3008\n<c7a1> <c7fe> 3102\n<c8a1> <c8fe> 3196\n<c9a1> <c9fe> 3290\n<caa1> <cafe> 3384\n<cba1> <cbfe> 3478\n<cca1> <ccfe> 3572\n<cda1> <cdfe> 3666\n<cea1> <cefe> 3760\n<cfa1> <cffe> 3854\n<d0a1> <d0fe> 3948\n<d1a1> <d1fe> 4042\n<d2a1> <d2fe> 4136\n<d3a1> <d3fe> 4230\n<d4a1> <d4fe> 4324\n<d5a1> <d5fe> 4418\n<d6a1> <d6fe> 4512\n<d7a1> <d7f9> 4606\n<d8a1> <d8fe> 4695\n<d9a1> <d9fe> 4789\n<daa1> <dafe> 4883\n<dba1> <dbfe> 4977\n<dca1> <dcfe> 5071\n<dda1> <ddfe> 5165\n<dea1> <defe> 5259\n<dfa1> <dffe> 5353\n<e0a1> <e0fe> 5447\n<e1a1> <e1fe> 5541\n<e2a1> <e2fe> 5635\n<e3a1> <e3fe> 5729\n<e4a1> <e4fe> 5823\n<e5a1> <e5fe> 5917\n<e6a1> <e6fe> 6011\n<e7a1> <e7fe> 6105\n<e8a1> <e8fe> 6199\n<e9a1> <e9fe> 6293\n<eaa1> <eafe> 6387\n<eba1> <ebfe> 6481\n<eca1> <ecfe> 6575\n<eda1> <edfe> 6669\n<eea1> <eefe> 6763\n<efa1> <effe> 6857\n<f0a1> <f0fe> 6951\n<f1a1> <f1fe> 7045\n<f2a1> <f2fe> 7139\n<f3a1> <f3fe> 7233\n<f4a1> <f4fe> 7327\n<f5a1> <f5fe> 7421\n<f6a1> <f6fe> 7515\n<f7a1> <f7fe> 7609\n<fd> <ff> 7713\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/GBpc-EUC-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (GBpc-EUC-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (GBpc-EUC-H)\n%%BeginResource: CMap (GBpc-EUC-V)\n%%Title: (GBpc-EUC-V Adobe GB1 0)\n%%Version: 9.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/GBpc-EUC-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 0 def\nend def\n\n/CMapName /GBpc-EUC-V def\n/CMapVersion 9.003 def\n/CMapType 1 def\n\n/UIDOffset 300 def\n/XUID [1 10 25365] def\n\n/WMode 1 def\n\n20 begincidrange\n<a1a2> <a1a2>  575\n<a1a3> <a1a3>  574\n<a1aa> <a1aa>  598\n<a1ab> <a1ac> 7704\n<a1ad> <a1ad>  599\n<a1b2> <a1bf>  582\n<a1fe> <a1fe> 7706\n<a3a1> <a3a1>  578\n<a3a8> <a3a9>  580\n<a3ac> <a3ac>  573\n<a3ae> <a3ae> 7707\n<a3ba> <a3bb>  576\n<a3bd> <a3bd> 7708\n<a3bf> <a3bf>  579\n<a3db> <a3db> 7709\n<a3dd> <a3dd> 7710\n<a3df> <a3df>  600\n<a3fb> <a3fb>  596\n<a3fd> <a3fd>  597\n<a3fe> <a3fe> 7711\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/UniGB-UCS2-H",
    "content": "begincmap\n/CMapName /UniGB-UCS2-H def\n/WMode 0 def\n/UniGB-X usecmap\nbegincodespacerange\n<0000><d7ff>\n<e000><ffff>\nendcodespacerange\nbegincidrange\n<30f8><30f9>22391\nendcidrange\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/UniGB-UCS2-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniGB-UCS2-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniGB-UCS2-H)\n%%BeginResource: CMap (UniGB-UCS2-V)\n%%Title: (UniGB-UCS2-V Adobe GB1 4)\n%%Version: 12.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniGB-UCS2-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 4 def\nend def\n\n/CMapName /UniGB-UCS2-V def\n/CMapVersion 12.002 def\n/CMapType 1 def\n\n/XUID [1 10 25367] def\n\n/WMode 1 def\n\n24 begincidrange\n<2014> <2014> 598\n<2026> <2026> 599\n<2225> <2225> 7708\n<3001> <3001> 575\n<3002> <3002> 574\n<3008> <300f> 584\n<3010> <3011> 594\n<3013> <3013> 7706\n<3014> <3015> 582\n<3016> <3017> 592\n<ff01> <ff01> 578\n<ff08> <ff09> 580\n<ff0c> <ff0c> 573\n<ff0e> <ff0e> 7707\n<ff1a> <ff1b> 576\n<ff1d> <ff1d> 7708\n<ff1f> <ff1f> 579\n<ff3b> <ff3b> 7709\n<ff3d> <ff3d> 7710\n<ff3f> <ff3f> 600\n<ff5b> <ff5b> 596\n<ff5d> <ff5d> 597\n<ff5e> <ff5e> 7704\n<ffe3> <ffe3> 7711\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/UniGB-UTF16-H",
    "content": "begincmap\n/CMapName /UniGB-UTF16-H def\n/WMode 0 def\n/UniGB-X usecmap\nbegincodespacerange\n<0000><d7ff>\n<d800dc00><dbffdfff>\n<e000><ffff>\nendcodespacerange\nbegincidchar\n<a0>1\n<a9>7713\n<b7>99\n<0144>696\n<0148>697\n<0251>694\n<0261>699\n<2022>99\n<205d>599\n<2122>7714\n<3095>22362\n<3096>22364\n<30f8>22392\n<30f9>22391\n<9fb4>22056\n<9fb5>22064\n<9fb8>22076\n<9fb9>22093\n<9fba>22110\n<9fbb>22126\n<e76c>22353\n<e796>599\n<e7c7>695\n<e7c8>698\n<e815>22047\n<f979>2562\n<f995>16595\n<f9e7>8204\n<f9f1>20611\n<fa0c>4697\n<fe10>573\n<fe11>575\n<fe12>574\n<fe19>599\n<fe31>598\nendcidchar\nbegincidrange\n<9fb6><9fb7>22069\n<a000><a48c>29064\n<a490><a4c6>30229\n<e78d><e793>573\n<e794><e795>592\n<e7e7><e7f3>10059\n<e819><e81d>22051\n<e81f><e825>22057\n<e827><e82a>22065\n<e82d><e830>22071\n<e833><e83a>22077\n<e83c><e842>22086\n<e844><e853>22094\n<e856><e863>22112\n<fe13><fe16>576\n<fe17><fe18>592\n<fe33><fe34>600\n<fe35><fe36>580\n<fe37><fe38>596\n<fe39><fe3a>582\n<fe3b><fe3c>594\n<fe3d><fe3e>586\n<fe3f><fe40>584\n<fe41><fe44>588\nendcidrange\nbegincidchar\n<d840dc87>22048\n<d840dc89>22049\n<d840dccc>22050\n<d841dd09>22093\n<d842dd9d>22110\n<d845ddd7>22075\n<d84add8f>22085\n<d850ddfe>22111\nendcidchar\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/UniGB-UTF16-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniGB-UTF16-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniGB-UTF16-H)\n%%BeginResource: CMap (UniGB-UTF16-V)\n%%Title: (UniGB-UTF16-V Adobe GB1 5)\n%%Version: 1.004\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniGB-UTF16-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 5 def\nend def\n\n/CMapName /UniGB-UTF16-V def\n/CMapVersion 1.004 def\n/CMapType 1 def\n\n/XUID [1 10 25602] def\n\n/WMode 1 def\n\n17 begincidchar\n<2014> 598\n<2026> 599\n<3001> 575\n<3002> 574\n<3013> 7706\n<ff01> 578\n<ff0c> 573\n<ff0e> 7707\n<ff1d> 7708\n<ff1f> 579\n<ff3b> 7709\n<ff3d> 7710\n<ff3f> 600\n<ff5b> 596\n<ff5d> 597\n<ff5e> 7704\n<ffe3> 7711\nendcidchar\n\n6 begincidrange\n<3008> <300f> 584\n<3010> <3011> 594\n<3014> <3015> 582\n<3016> <3017> 592\n<ff08> <ff09> 580\n<ff1a> <ff1b> 576\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/UniGB-UTF32-H",
    "content": "begincmap\n/CMapName /UniGB-UTF32-H def\n/WMode 0 def\n/UniGB-X usecmap\nbegincodespacerange\n<00000000><0010ffff>\nendcodespacerange\nbegincidchar\n<a0>1\n<a9>7713\n<b7>99\n<0144>696\n<0148>697\n<0251>694\n<0261>699\n<2022>99\n<205d>599\n<2122>7714\n<3095>22362\n<3096>22364\n<30f8>22392\n<30f9>22391\n<9fb4>22056\n<9fb5>22064\n<9fb8>22076\n<9fb9>22093\n<9fba>22110\n<9fbb>22126\n<e76c>22353\n<e796>599\n<e7c7>695\n<e7c8>698\n<e815>22047\n<f979>2562\n<f995>16595\n<f9e7>8204\n<f9f1>20611\n<fa0c>4697\n<fe10>573\n<fe11>575\n<fe12>574\n<fe19>599\n<fe31>598\nendcidchar\nbegincidrange\n<9fb6><9fb7>22069\n<a000><a48c>29064\n<a490><a4c6>30229\n<e78d><e793>573\n<e794><e795>592\n<e7e7><e7f3>10059\n<e819><e81d>22051\n<e81f><e825>22057\n<e827><e82a>22065\n<e82d><e830>22071\n<e833><e83a>22077\n<e83c><e842>22086\n<e844><e853>22094\n<e856><e863>22112\n<fe13><fe16>576\n<fe17><fe18>592\n<fe33><fe34>600\n<fe35><fe36>580\n<fe37><fe38>596\n<fe39><fe3a>582\n<fe3b><fe3c>594\n<fe3d><fe3e>586\n<fe3f><fe40>584\n<fe41><fe44>588\nendcidrange\nbegincidchar\n<020087>22048\n<020089>22049\n<0200cc>22050\n<020509>22093\n<02099d>22110\n<0215d7>22075\n<02298f>22085\n<0241fe>22111\nendcidchar\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/UniGB-UTF32-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniGB-UTF32-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniGB-UTF32-H)\n%%BeginResource: CMap (UniGB-UTF32-V)\n%%Title: (UniGB-UTF32-V Adobe GB1 5)\n%%Version: 1.004\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution.\n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission.\n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniGB-UTF32-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 5 def\nend def\n\n/CMapName /UniGB-UTF32-V def\n/CMapVersion 1.004 def\n/CMapType 1 def\n\n/XUID [1 10 25604] def\n\n/WMode 1 def\n\n17 begincidchar\n<00002014> 598\n<00002026> 599\n<00003001> 575\n<00003002> 574\n<00003013> 7706\n<0000ff01> 578\n<0000ff0c> 573\n<0000ff0e> 7707\n<0000ff1d> 7708\n<0000ff1f> 579\n<0000ff3b> 7709\n<0000ff3d> 7710\n<0000ff3f> 600\n<0000ff5b> 596\n<0000ff5d> 597\n<0000ff5e> 7704\n<0000ffe3> 7711\nendcidchar\n\n6 begincidrange\n<00003008> <0000300f> 584\n<00003010> <00003011> 594\n<00003014> <00003015> 582\n<00003016> <00003017> 592\n<0000ff08> <0000ff09> 580\n<0000ff1a> <0000ff1b> 576\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/UniGB-UTF8-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (UniGB-UTF8-H)\n%%Title: (UniGB-UTF8-H Adobe GB1 5)\n%%Version: 13.011\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2010 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution.\n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission.\n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 5 def\nend def\n\n/CMapName /UniGB-UTF8-H def\n/CMapVersion 13.011 def\n/CMapType 1 def\n\n/XUID [1 10 25379] def\n\n/WMode 0 def\n\n4 begincodespacerange\n  <00>       <7F>\n  <C080>     <DFBF>\n  <E08080>   <EFBFBF>\n  <F0808080> <F7BFBFBF>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 1\nendnotdefrange\n\n100 begincidchar\n<c2a0> 1\n<c2a4> 167\n<c2a5> 22354\n<c2a7> 171\n<c2a8> 102\n<c2a9> 7713\n<c2b0> 162\n<c2b1> 127\n<c2b7> 99\n<c397> 128\n<c3a0> 671\n<c3a1> 669\n<c3a8> 675\n<c3a9> 673\n<c3aa> 693\n<c3ac> 679\n<c3ad> 677\n<c3b2> 683\n<c3b3> 681\n<c3b7> 129\n<c3b9> 687\n<c3ba> 685\n<c3bc> 692\n<c481> 668\n<c493> 672\n<c49b> 674\n<c4ab> 676\n<c584> 696\n<c588> 697\n<c58d> 680\n<c5ab> 684\n<c78e> 670\n<c790> 678\n<c792> 682\n<c794> 686\n<c796> 688\n<c798> 689\n<c79a> 690\n<c79c> 691\n<c7b9> 698\n<c991> 694\n<c9a1> 699\n<cb87> 101\n<cb89> 100\n<cb99> 9909\n<d081> 608\n<d191> 641\n<e1b8bf> 695\n<e28090> 10018\n<e28093> 9910\n<e28094> 105\n<e28095> 9911\n<e28096> 107\n<e280a2> 99\n<e280a5> 9912\n<e280a6> 108\n<e280b0> 170\n<e280b5> 9913\n<e280bb> 184\n<e2819d> 599\n<e282ac> 22353\n<e28483> 165\n<e28485> 9914\n<e28489> 9915\n<e28496> 172\n<e284a1> 10016\n<e284a2> 7714\n<e28692> 185\n<e28693> 188\n<e28888> 137\n<e2888f> 134\n<e28891> 133\n<e28895> 9920\n<e2889a> 139\n<e2889d> 151\n<e2889e> 157\n<e2889f> 9921\n<e288a0> 142\n<e288a3> 9922\n<e288a5> 141\n<e288a9> 136\n<e288aa> 135\n<e288ab> 145\n<e288ae> 146\n<e288b4> 159\n<e288b5> 158\n<e288b6> 130\n<e288b7> 138\n<e288bd> 150\n<e28988> 149\n<e2898c> 148\n<e28992> 9923\n<e289a0> 152\n<e289a1> 147\n<e28a95> 9988\n<e28a99> 144\n<e28aa5> 140\n<e28abf> 9926\n<e28baf> 108\n<e28c92> 143\nendcidchar\n\n100 begincidchar\n<e296a0> 181\n<e296a1> 180\n<e296b2> 183\n<e296b3> 182\n<e29786> 179\n<e29787> 178\n<e2978b> 175\n<e2978e> 177\n<e2978f> 176\n<e29885> 174\n<e29886> 173\n<e29889> 9987\n<e29980> 161\n<e29982> 160\n<e2ba80> 22428\n<e2ba81> 22047\n<e2ba84> 22051\n<e2ba88> 22054\n<e2ba8b> 22055\n<e2ba8c> 22060\n<e2ba97> 22061\n<e2baa7> 22074\n<e2baaa> 22077\n<e2baae> 22080\n<e2bab3> 22082\n<e2babb> 22088\n<e2bb8a> 22098\n<e2bc80> 4162\n<e2bc81> 4707\n<e2bc82> 4722\n<e2bc83> 4709\n<e2bc84> 4185\n<e2bc85> 10131\n<e2bc86> 1597\n<e2bc87> 4867\n<e2bc88> 3238\n<e2bc89> 1592\n<e2bc8a> 3270\n<e2bc8b> 982\n<e2bc8c> 4765\n<e2bc8d> 4884\n<e2bc8e> 4879\n<e2bc8f> 2091\n<e2bc90> 5017\n<e2bc91> 1431\n<e2bc92> 2543\n<e2bc93> 4860\n<e2bc94> 4710\n<e2bc95> 4740\n<e2bc96> 10778\n<e2bc97> 3397\n<e2bc98> 1150\n<e2bc99> 4946\n<e2bc9a> 1228\n<e2bc9b> 5020\n<e2bc9c> 4283\n<e2bc9d> 2407\n<e2bc9e> 5523\n<e2bc9f> 3698\n<e2bca0> 3414\n<e2bca1> 5660\n<e2bca2> 11565\n<e2bca3> 3859\n<e2bca4> 1398\n<e2bca5> 2927\n<e2bca6> 4656\n<e2bca7> 5934\n<e2bca8> 1386\n<e2bca9> 3948\n<e2bcaa> 5302\n<e2bcab> 3395\n<e2bcac> 6004\n<e2bcad> 3318\n<e2bcae> 6165\n<e2bcaf> 1789\n<e2bcb0> 2093\n<e2bcb1> 2238\n<e2bcb2> 1732\n<e2bcb3> 6163\n<e2bcb4> 1852\n<e2bcb5> 5016\n<e2bcb6> 5293\n<e2bcb7> 5366\n<e2bcb8> 1798\n<e2bcb9> 5986\n<e2bcba> 5614\n<e2bcbb> 5600\n<e2bcbc> 3983\n<e2bcbd> 1765\n<e2bcbe> 12946\n<e2bcbf> 3437\n<e2bd80> 4518\n<e2bd81> 6409\n<e2bd82> 3795\n<e2bd83> 1526\n<e2bd84> 2240\n<e2bd85> 1626\n<e2bd86> 3821\n<e2bd87> 3248\n<e2bd88> 4350\nendcidchar\n\n100 begincidchar\n<e2bd89> 4357\n<e2bd8a> 2849\n<e2bd8b> 3124\n<e2bd8c> 4536\n<e2bd8d> 1400\n<e2bd8e> 6589\n<e2bd8f> 3826\n<e2bd90> 1073\n<e2bd91> 2736\n<e2bd92> 3430\n<e2bd93> 3095\n<e2bd94> 3491\n<e2bd95> 2053\n<e2bd96> 4611\n<e2bd97> 1715\n<e2bd98> 4713\n<e2bd99> 5789\n<e2bd9a> 3019\n<e2bd9b> 4073\n<e2bd9c> 2916\n<e2bd9d> 3209\n<e2bd9e> 4041\n<e2bd9f> 4310\n<e2bda0> 1832\n<e2bda1> 3728\n<e2bda2> 1733\n<e2bda3> 3379\n<e2bda4> 4264\n<e2bda5> 3650\n<e2bda6> 7110\n<e2bda7> 7008\n<e2bda8> 16063\n<e2bda9> 994\n<e2bdaa> 3011\n<e2bdab> 2808\n<e2bdac> 2850\n<e2bdad> 2737\n<e2bdae> 3407\n<e2bdaf> 3398\n<e2bdb0> 3413\n<e2bdb1> 16587\n<e2bdb2> 1923\n<e2bdb3> 4049\n<e2bdb4> 2539\n<e2bdb5> 4592\n<e2bdb6> 2780\n<e2bdb7> 7399\n<e2bdb8> 7262\n<e2bdb9> 3753\n<e2bdba> 4123\n<e2bdbb> 4309\n<e2bdbc> 2490\n<e2bdbd> 1591\n<e2bdbe> 7115\n<e2bdbf> 1593\n<e2be80> 6686\n<e2be81> 3261\n<e2be82> 1249\n<e2be83> 4657\n<e2be84> 4544\n<e2be85> 2297\n<e2be86> 3353\n<e2be87> 5656\n<e2be88> 4570\n<e2be89> 7388\n<e2be8a> 3300\n<e2be8b> 17826\n<e2be8c> 7152\n<e2be8d> 1291\n<e2be8e> 4051\n<e2be8f> 3995\n<e2be90> 4169\n<e2be91> 18908\n<e2be92> 8086\n<e2be93> 2200\n<e2be94> 4093\n<e2be95> 1825\n<e2be96> 1528\n<e2be97> 7445\n<e2be98> 7504\n<e2be99> 7739\n<e2be9a> 1285\n<e2be9b> 4668\n<e2be9c> 4672\n<e2be9d> 3366\n<e2be9e> 7803\n<e2be9f> 3980\n<e2bea0> 1250\n<e2bea1> 19731\n<e2bea2> 4191\n<e2bea3> 4276\n<e2bea4> 19992\n<e2bea5> 2522\n<e2bea6> 2241\n<e2bea7> 7797\n<e2bea8> 8317\n<e2bea9> 1714\n<e2beaa> 2542\n<e2beab> 7545\n<e2beac> 4303\nendcidchar\n\n100 begincidchar\n<e2bead> 20714\n<e2beae> 1636\n<e2beaf> 2795\n<e2beb0> 1770\n<e2beb1> 8589\n<e2beb2> 2289\n<e2beb3> 4219\n<e2beb4> 8713\n<e2beb5> 7936\n<e2beb6> 7924\n<e2beb7> 3402\n<e2beb8> 3438\n<e2beb9> 3920\n<e2beba> 8301\n<e2bebb> 1824\n<e2bebc> 1754\n<e2bebd> 7660\n<e2bebe> 7888\n<e2bebf> 5019\n<e2bf80> 4704\n<e2bf81> 1862\n<e2bf82> 8761\n<e2bf83> 8348\n<e2bf84> 9864\n<e2bf85> 2656\n<e2bf86> 8305\n<e2bf87> 2704\n<e2bf88> 21894\n<e2bf89> 3465\n<e2bf8a> 1937\n<e2bf8b> 6741\n<e2bf8c> 9752\n<e2bf8d> 1509\n<e2bf8e> 1821\n<e2bf8f> 3466\n<e2bf90> 1072\n<e2bf91> 8390\n<e2bf92> 7814\n<e2bf93> 8247\n<e2bf94> 7988\n<e2bf95> 4851\n<e38083> 103\n<e38085> 104\n<e38086> 10024\n<e38087> 7703\n<e38092> 9989\n<e38093> 189\n<e380be> 10059\n<e380bf> 22357\n<e38294> 22375\n<e38295> 22362\n<e38296> 22364\n<e383b7> 22390\n<e383b8> 22392\n<e383b9> 22391\n<e383ba> 22393\n<e383bb> 99\n<e383bc> 10019\n<e388b1> 10017\n<e38aa3> 10001\n<e38ea1> 10007\n<e38f84> 10008\n<e38f8e> 10009\n<e38f95> 10012\n<e39187> 22053\n<e391b3> 22052\n<e3969e> 22057\n<e3988e> 22059\n<e3989a> 22058\n<e3a498> 22063\n<e3a5ae> 22062\n<e3a78f> 22065\n<e3a790> 22068\n<e3a79f> 22066\n<e3a9b3> 22067\n<e3ad8e> 22071\n<e3b1ae> 22072\n<e3b3a0> 22073\n<e48196> 22078\n<e4859f> 22079\n<e48cb7> 22081\n<e48eac> 22087\n<e48eb1> 22086\n<e48f9d> 22089\n<e49396> 22090\n<e4998c> 22092\n<e499a1> 22091\n<e49ca3> 22094\n<e49ca9> 22095\n<e49dbc> 22096\n<e49e8d> 22097\n<e4a587> 22099\n<e4a5ba> 22100\n<e4a5bd> 22101\n<e4a684> 28005\n<e4a69b> 22107\n<e4a69f> 22106\n<e4a6b6> 22109\n<e4a6b7> 22108\n<e4b1b7> 22116\nendcidchar\n\n100 begincidchar\n<e4b2a2> 22117\n<e4b2a3> 22112\n<e4b6ae> 22125\n<e4b880> 4162\n<e4b881> 1504\n<e4b882> 10072\n<e4b883> 3070\n<e4b887> 3747\n<e4b888> 4458\n<e4b889> 3288\n<e4b88a> 3336\n<e4b88b> 3887\n<e4b88c> 4696\n<e4b88d> 1154\n<e4b88e> 4304\n<e4b88f> 10076\n<e4b890> 4698\n<e4b891> 1304\n<e4b892> 10077\n<e4b893> 4613\n<e4b894> 3151\n<e4b895> 4701\n<e4b896> 3415\n<e4b897> 10078\n<e4b898> 3181\n<e4b899> 1124\n<e4b89a> 4156\n<e4b89b> 1367\n<e4b89c> 1514\n<e4b89d> 3508\n<e4b89e> 4703\n<e4b8a2> 1513\n<e4b8a3> 10082\n<e4b8a4> 2566\n<e4b8a5> 4088\n<e4b8a6> 10083\n<e4b8a7> 3294\n<e4b8a8> 4707\n<e4b8a9> 10084\n<e4b8aa> 1777\n<e4b8ab> 4071\n<e4b8ac> 5788\n<e4b8ad> 4559\n<e4b8b0> 1662\n<e4b8b1> 10087\n<e4b8b2> 1329\n<e4b8b3> 10088\n<e4b8b4> 2594\n<e4b8b5> 10089\n<e4b8b6> 4722\n<e4b8b7> 10090\n<e4b8b8> 3737\n<e4b8b9> 1413\n<e4b8ba> 3769\n<e4b8bb> 4598\n<e4b8bc> 10091\n<e4b8bd> 2529\n<e4b8be> 2312\n<e4b8bf> 4709\n<e4b983> 2862\n<e4b984> 10095\n<e4b985> 2290\n<e4b986> 10096\n<e4b987> 4711\n<e4b988> 2745\n<e4b989> 4204\n<e4b98a> 10097\n<e4b98b> 4525\n<e4b98c> 3817\n<e4b98d> 4424\n<e4b98e> 1964\n<e4b98f> 1603\n<e4b990> 2497\n<e4b991> 10098\n<e4b992> 3032\n<e4b993> 2963\n<e4b994> 3140\n<e4b995> 10099\n<e4b996> 1837\n<e4b997> 10100\n<e4b998> 1264\n<e4b999> 4185\n<e4b99c> 4725\n<e4b99d> 2292\n<e4b99e> 3089\n<e4b99f> 4153\n<e4b9a0> 3869\n<e4b9a1> 3924\n<e4b9a6> 3456\n<e4b9a9> 4726\n<e4b9b0> 2713\n<e4b9b1> 2681\n<e4b9b2> 10115\n<e4b9b3> 3268\n<e4b9be> 3113\n<e4b9bf> 10126\n<e4ba82> 8281\n<e4ba86> 2580\n<e4ba87> 10132\n<e4ba88> 4301\nendcidchar\n\n100 begincidchar\n<e4ba89> 4506\n<e4ba8a> 10133\n<e4ba8b> 3417\n<e4ba8c> 1597\n<e4ba8d> 4695\n<e4ba8e> 4287\n<e4ba8f> 2436\n<e4ba90> 10134\n<e4ba91> 4361\n<e4ba92> 1978\n<e4ba93> 4727\n<e4ba94> 3828\n<e4ba95> 2269\n<e4ba98> 4702\n<e4ba99> 10137\n<e4ba9a> 4080\n<e4ba9b> 3956\n<e4ba9e> 8689\n<e4ba9f> 4723\n<e4baa0> 4867\n<e4baa1> 3751\n<e4baa2> 2375\n<e4baa3> 10140\n<e4baa4> 2188\n<e4baa5> 1884\n<e4baa6> 4199\n<e4baa7> 1217\n<e4baa8> 1943\n<e4baa9> 2841\n<e4baaa> 10141\n<e4baab> 3930\n<e4baac> 2264\n<e4baad> 3669\n<e4baae> 2570\n<e4bab2> 3156\n<e4bab3> 4869\n<e4bab4> 10145\n<e4bab5> 4872\n<e4baba> 3238\n<e4babb> 4767\n<e4babf> 4193\n<e4bb80> 3401\n<e4bb81> 3237\n<e4bb82> 4770\n<e4bb83> 4768\n<e4bb84> 4732\n<e4bb85> 2247\n<e4bb86> 3052\n<e4bb87> 1301\n<e4bb88> 10153\n<e4bb89> 4769\n<e4bb8a> 2242\n<e4bb8b> 2234\n<e4bb8c> 10154\n<e4bb8d> 3247\n<e4bb8e> 1366\n<e4bb91> 2687\n<e4bb92> 10157\n<e4bb93> 1181\n<e4bb94> 4653\n<e4bb95> 3426\n<e4bb96> 3568\n<e4bb97> 4461\n<e4bb98> 1713\n<e4bb99> 3894\n<e4bb9d> 4846\n<e4bb9e> 4774\n<e4bb9f> 3111\n<e4bba0> 10161\n<e4bba1> 4772\n<e4bba2> 10162\n<e4bba3> 1405\n<e4bba4> 2615\n<e4bba5> 4187\n<e4bba8> 4771\n<e4bba9> 10165\n<e4bbaa> 4174\n<e4bbab> 4773\n<e4bbac> 2764\n<e4bbb0> 4127\n<e4bbb1> 10169\n<e4bbb2> 4568\n<e4bbb3> 4776\n<e4bbb4> 10170\n<e4bbb5> 4779\n<e4bbb6> 2161\n<e4bbb7> 2126\n<e4bbbb> 3241\n<e4bbbc> 10174\n<e4bbbd> 1658\n<e4bbbe> 10175\n<e4bbbf> 1631\n<e4bc80> 10176\n<e4bc81> 3090\n<e4bc89> 4782\n<e4bc8a> 4168\n<e4bc8d> 3832\n<e4bc8e> 2098\n<e4bc8f> 1689\n<e4bc90> 1602\nendcidchar\n\n100 begincidchar\n<e4bc91> 4008\n<e4bc97> 4569\n<e4bc98> 4266\n<e4bc99> 2052\n<e4bc9a> 2038\n<e4bc9b> 4775\n<e4bc9e> 3290\n<e4bc9f> 3775\n<e4bca0> 1326\n<e4bca1> 10193\n<e4bca2> 4777\n<e4bca3> 10194\n<e4bca4> 3332\n<e4bca5> 4780\n<e4bca6> 2686\n<e4bca7> 4781\n<e4bcaa> 3776\n<e4bcab> 4783\n<e4bcaf> 1141\n<e4bcb0> 1817\n<e4bcb1> 10200\n<e4bcb2> 4791\n<e4bcb3> 10201\n<e4bcb4> 1012\n<e4bcb5> 10202\n<e4bcb6> 2607\n<e4bcb7> 10203\n<e4bcb8> 3365\n<e4bcb9> 10204\n<e4bcba> 3514\n<e4bcbb> 10205\n<e4bcbc> 3515\n<e4bcbd> 4792\n<e4bd83> 1481\n<e4bd86> 1420\n<e4bd8d> 3786\n<e4bd8e> 1454\n<e4bd8f> 4606\n<e4bd90> 4689\n<e4bd91> 4280\n<e4bd92> 10219\n<e4bd93> 3640\n<e4bd94> 10220\n<e4bd95> 1925\n<e4bd96> 10221\n<e4bd97> 4790\n<e4bd98> 4848\n<e4bd99> 4293\n<e4bd9a> 4787\n<e4bd9b> 1677\n<e4bd9c> 4692\n<e4bd9d> 4788\n<e4bd9e> 4784\n<e4bd9f> 4789\n<e4bda0> 2886\n<e4bda3> 4251\n<e4bda4> 4778\n<e4bda5> 4849\n<e4bda6> 10224\n<e4bda7> 4785\n<e4bda8> 10225\n<e4bda9> 2982\n<e4bdac> 2491\n<e4bdaf> 4121\n<e4bdb0> 998\n<e4bdb3> 2116\n<e4bdb4> 4794\n<e4bdb5> 10232\n<e4bdb6> 4793\n<e4bdbb> 4800\n<e4bdbc> 4802\n<e4bdbd> 10237\n<e4bdbe> 4799\n<e4bdbf> 3408\n<e4be83> 4797\n<e4be84> 4533\n<e4be85> 10241\n<e4be86> 8178\n<e4be87> 10242\n<e4be88> 1283\n<e4be89> 4796\n<e4be8a> 10243\n<e4be8b> 2536\n<e4be8c> 10244\n<e4be8d> 3427\n<e4be8e> 10245\n<e4be8f> 4798\n<e4be90> 10246\n<e4be91> 4795\n<e4be94> 4804\n<e4be95> 10249\n<e4be96> 8285\n<e4be97> 1520\n<e4be9b> 1794\n<e4be9c> 10253\n<e4be9d> 4167\n<e4bea0> 3885\n<e4bea3> 2665\n<e4bea4> 10258\n<e4bea5> 2197\nendcidchar\n\n100 begincidchar\n<e4bea6> 4493\n<e4bea7> 1191\n<e4bea8> 3141\n<e4bea9> 2424\n<e4beaa> 4801\n<e4beab> 10259\n<e4beac> 4803\n<e4bead> 10260\n<e4beae> 3833\n<e4beaf> 1957\n<e4beb5> 3155\n<e4bebf> 1100\n<e4bf82> 9884\n<e4bf83> 1372\n<e4bf84> 1580\n<e4bf85> 4808\n<e4bf8a> 2350\n<e4bf8e> 4850\n<e4bf8f> 3147\n<e4bf90> 2537\n<e4bf91> 4812\n<e4bf97> 3532\n<e4bf98> 1690\n<e4bf99> 10289\n<e4bf9a> 4809\n<e4bf9b> 10290\n<e4bf9c> 4811\n<e4bf9d> 1036\n<e4bf9e> 4294\n<e4bf9f> 4813\n<e4bfa0> 8629\n<e4bfa1> 3984\n<e4bfa2> 10291\n<e4bfa3> 4810\n<e4bfa6> 4805\n<e4bfa7> 10294\n<e4bfa8> 4806\n<e4bfa9> 2546\n<e4bfaa> 4807\n<e4bfad> 2150\n<e4bfae> 4009\n<e4bfaf> 1700\n<e4bfb0> 10297\n<e4bfb1> 2322\n<e4bfb2> 10298\n<e4bfb3> 4817\n<e4bfb8> 4814\n<e4bfb9> 10303\n<e4bfba> 958\n<e4bfbe> 4822\n<e4bfbf> 10307\n<e58080> 8908\n<e58086> 8214\n<e58089> 7778\n<e5808a> 10315\n<e5808b> 7968\n<e5808c> 4824\n<e5808d> 1055\n<e5808e> 10316\n<e5808f> 4819\n<e58090> 10317\n<e58091> 8319\n<e58092> 1434\n<e58093> 10318\n<e58094> 2338\n<e58098> 3611\n<e58099> 1961\n<e5809a> 4183\n<e5809b> 10322\n<e5809c> 4823\n<e5809f> 2233\n<e580a0> 10325\n<e580a1> 1232\n<e580a5> 4825\n<e580a6> 2330\n<e580a7> 10329\n<e580a8> 4826\n<e580a9> 4815\n<e580aa> 2882\n<e580ab> 8284\n<e580ac> 4818\n<e580ad> 4821\n<e580ae> 4820\n<e580ba> 4431\n<e580bb> 10341\n<e580bc> 4532\n<e580bd> 10342\n<e580be> 3168\n<e580bf> 10343\n<e58183> 4828\n<e58187> 2124\n<e58188> 4830\n<e58189> 8596\n<e5818c> 4816\n<e5818d> 10352\n<e5818e> 4831\n<e5818f> 3018\n<e58195> 4829\n<e5819a> 4691\n<e5819b> 10362\nendcidchar\n\n100 begincidchar\n<e5819c> 3668\n<e581a5> 2162\n<e581ac> 4832\n<e581b4> 7781\n<e581b5> 8833\n<e581b6> 2941\n<e581b7> 3686\n<e581bb> 4833\n<e581be> 4827\n<e581bf> 1226\n<e58280> 2443\n<e58285> 1712\n<e58288> 2535\n<e5828d> 1027\n<e58296> 8909\n<e58297> 10407\n<e58298> 8458\n<e58299> 7742\n<e582a2> 9855\n<e582a3> 1401\n<e582a4> 10416\n<e582a5> 4834\n<e582a6> 10417\n<e582a7> 4835\n<e582a8> 1317\n<e582a9> 4836\n<e582ac> 1378\n<e582ad> 8750\n<e582b2> 972\n<e582b3> 7830\n<e582b4> 8907\n<e582b5> 8812\n<e582b6> 10424\n<e582b7> 8471\n<e582ba> 4837\n<e582bb> 3310\n<e582be> 8424\n<e582bf> 10429\n<e58382> 8916\n<e58385> 8121\n<e58389> 8920\n<e5838f> 3934\n<e58390> 10442\n<e58391> 8415\n<e58395> 8386\n<e58396> 4838\n<e5839a> 2574\n<e5839e> 8597\n<e583a5> 8108\n<e583a6> 4842\n<e583a7> 3303\n<e583a8> 8915\n<e583ac> 4841\n<e583ad> 4840\n<e583ae> 4843\n<e583b3> 3536\n<e583b4> 10465\n<e583b5> 2170\n<e583b9> 8065\n<e583ba> 10469\n<e583bb> 3014\n<e58480> 8720\n<e58481> 10474\n<e58482> 8911\n<e58483> 10475\n<e58484> 8723\n<e58485> 10476\n<e58486> 4839\n<e58487> 4844\n<e58488> 8164\n<e58489> 8080\n<e5848a> 10477\n<e5848b> 4845\n<e58490> 8918\n<e58491> 10482\n<e58492> 3264\n<e58493> 10483\n<e58494> 8912\n<e58495> 8910\n<e58498> 9857\n<e5849f> 7798\n<e584a0> 10492\n<e584a1> 2503\n<e584aa> 8753\n<e584b2> 7827\n<e584b7> 8914\n<e584ba> 8919\n<e584bb> 8917\n<e584bc> 8913\n<e584bf> 1592\n<e58580> 4697\n<e58581> 4365\n<e58582> 10516\n<e58583> 4333\n<e58584> 4001\n<e58585> 1289\n<e58586> 4472\n<e58587> 10517\n<e58588> 3893\n<e58589> 1851\nendcidchar\n\n100 begincidchar\n<e5858a> 10518\n<e5858b> 2392\n<e5858c> 10519\n<e5858d> 2791\n<e58591> 1553\n<e58592> 7909\n<e58593> 10523\n<e58594> 3700\n<e58595> 4866\n<e58596> 4868\n<e5859a> 1428\n<e5859b> 10527\n<e5859c> 1524\n<e585a2> 2259\n<e585a5> 3270\n<e585a8> 3206\n<e585a9> 8229\n<e585aa> 10537\n<e585ab> 982\n<e585ac> 1796\n<e585ad> 2626\n<e585ae> 4854\n<e585af> 10538\n<e585b0> 2471\n<e585b1> 1803\n<e585b2> 10539\n<e585b3> 1841\n<e585b4> 3990\n<e585b5> 1121\n<e585b6> 3075\n<e585b7> 2318\n<e585b8> 1477\n<e585b9> 4645\n<e585ba> 10540\n<e585bb> 4129\n<e585bc> 2137\n<e585bd> 3445\n<e58680> 2096\n<e58681> 4858\n<e58682> 4765\n<e58685> 2877\n<e58688> 1743\n<e58689> 3224\n<e5868c> 1192\n<e5868d> 4380\n<e58692> 2741\n<e58695> 2790\n<e58696> 4884\n<e58697> 3258\n<e58698> 10555\n<e58699> 3967\n<e5869a> 10556\n<e5869b> 2347\n<e5869c> 2922\n<e586a0> 1843\n<e586a1> 10560\n<e586a2> 4885\n<e586a3> 10561\n<e586a4> 4332\n<e586a5> 4886\n<e586ab> 4879\n<e586ac> 1515\n<e586af> 1672\n<e586b0> 1122\n<e586b1> 4880\n<e586b2> 1290\n<e586b3> 2341\n<e586b4> 10569\n<e586b5> 2435\n<e586b6> 4152\n<e586b7> 2511\n<e586bb> 1522\n<e586bc> 4882\n<e586bd> 4881\n<e58780> 2282\n<e58784> 3071\n<e58785> 10578\n<e58786> 4633\n<e58787> 4883\n<e58788> 10579\n<e58789> 2562\n<e5878a> 10580\n<e5878b> 1491\n<e5878c> 2609\n<e5878d> 7887\n<e5878e> 10581\n<e5878f> 2152\n<e58790> 10582\n<e58791> 1368\n<e5879b> 2598\n<e5879c> 10592\n<e5879d> 2912\n<e587a0> 2091\n<e587a1> 1615\n<e587a4> 1676\n<e587ab> 4864\n<e587ac> 10603\n<e587ad> 3037\n<e587ae> 10604\n<e587af> 2362\nendcidchar\n\n100 begincidchar\n<e587b0> 2016\n<e587b1> 8153\n<e587b2> 10605\n<e587b3> 1451\n<e587b4> 10606\n<e587b5> 5017\n<e587b6> 4002\n<e587b7> 10607\n<e587b8> 3690\n<e587b9> 967\n<e587ba> 1307\n<e587bb> 2060\n<e587bc> 5018\n<e587bd> 1894\n<e587be> 10608\n<e587bf> 4391\n<e58880> 1431\n<e58881> 1492\n<e58882> 4748\n<e58883> 3243\n<e58886> 1651\n<e58887> 3149\n<e58888> 4749\n<e58889> 10611\n<e5888a> 2364\n<e5888d> 5003\n<e5888e> 4750\n<e58891> 3991\n<e58892> 1987\n<e58896> 6510\n<e58897> 2585\n<e58898> 2622\n<e58899> 4405\n<e5889a> 1744\n<e5889b> 1335\n<e5889c> 10619\n<e5889d> 1306\n<e588a0> 3319\n<e588a4> 2961\n<e588a8> 2970\n<e588a9> 2534\n<e588aa> 10628\n<e588ab> 1113\n<e588ac> 10629\n<e588ad> 4751\n<e588ae> 1831\n<e588af> 10630\n<e588b0> 1438\n<e588b3> 4752\n<e588b6> 4549\n<e588b7> 3479\n<e588b8> 3210\n<e588b9> 3307\n<e588ba> 1359\n<e588bb> 2393\n<e588bc> 10635\n<e588bd> 1869\n<e588be> 10636\n<e588bf> 4753\n<e58980> 4754\n<e58981> 1574\n<e58982> 2100\n<e58983> 3645\n<e58984> 8904\n<e58987> 8803\n<e5898a> 3940\n<e5898b> 9859\n<e5898c> 4755\n<e5898d> 3117\n<e58990> 1833\n<e58991> 2164\n<e58994> 3633\n<e58995> 10645\n<e58996> 3049\n<e5899b> 7959\n<e5899c> 4758\n<e5899d> 10650\n<e5899e> 4756\n<e589a1> 4757\n<e589a5> 1033\n<e589a6> 10656\n<e589a7> 2326\n<e589a8> 10657\n<e589a9> 3386\n<e589aa> 2151\n<e589ae> 7979\n<e589af> 1708\n<e589b2> 1769\n<e589b3> 10663\n<e589b4> 8906\n<e589b5> 7833\n<e589bd> 4760\n<e589be> 10671\n<e589bf> 2204\n<e58a80> 10672\n<e58a81> 4762\n<e58a82> 4761\n<e58a83> 8015\n<e58a87> 8143\n<e58a88> 3005\nendcidchar\n\n100 begincidchar\n<e58a89> 8246\n<e58a8a> 7994\n<e58a8b> 10676\n<e58a8c> 8905\n<e58a8d> 8089\n<e58a90> 4763\n<e58a91> 8053\n<e58a92> 10679\n<e58a93> 4764\n<e58a9b> 2543\n<e58a9c> 10687\n<e58a9d> 3211\n<e58a9e> 1015\n<e58a9f> 1791\n<e58aa0> 2118\n<e58aa1> 3840\n<e58aa2> 5005\n<e58aa3> 2588\n<e58aa8> 1518\n<e58aa9> 4601\n<e58aaa> 2925\n<e58aab> 2218\n<e58ab1> 2531\n<e58ab2> 2257\n<e58ab3> 2488\n<e58abe> 5008\n<e58abf> 3421\n<e58b80> 10705\n<e58b81> 8126\n<e58b82> 10706\n<e58b83> 1137\n<e58b87> 4263\n<e58b88> 10710\n<e58b89> 2792\n<e58b8a> 10711\n<e58b8b> 4052\n<e58b90> 5010\n<e58b91> 10716\n<e58b92> 2496\n<e58b95> 7885\n<e58b96> 5011\n<e58b97> 10719\n<e58b98> 2366\n<e58b99> 8617\n<e58b9a> 10720\n<e58b9b> 8678\n<e58b9c> 10721\n<e58b9d> 8487\n<e58b9e> 8195\n<e58b9f> 2847\n<e58ba2> 8498\n<e58ba3> 10724\n<e58ba4> 3159\n<e58bb0> 5012\n<e58bb1> 8995\n<e58bb5> 8209\n<e58bb8> 8437\n<e58bb9> 4860\n<e58bba> 3344\n<e58bbe> 1805\n<e58bbf> 3839\n<e58c80> 4363\n<e58c85> 1031\n<e58c86> 1365\n<e58c87> 10748\n<e58c88> 4004\n<e58c8d> 4861\n<e58c8e> 10753\n<e58c8f> 5301\n<e58c90> 4863\n<e58c95> 4710\n<e58c96> 1988\n<e58c97> 1050\n<e58c98> 10758\n<e58c99> 1276\n<e58c9a> 4740\n<e58c9d> 4372\n<e58ca0> 2180\n<e58ca1> 2428\n<e58ca2> 10763\n<e58ca3> 3880\n<e58ca6> 4742\n<e58caa> 1640\n<e58cad> 8901\n<e58cae> 4743\n<e58caf> 8030\n<e58cb0> 10771\n<e58cb1> 8902\n<e58cb9> 3012\n<e58cba> 3189\n<e58cbb> 4164\n<e58cbe> 4744\n<e58cbf> 2887\n<e58d80> 8431\n<e58d81> 3397\n<e58d82> 10781\n<e58d83> 3108\n<e58d84> 10782\n<e58d85> 4700\n<e58d86> 10783\nendcidchar\n\n100 begincidchar\n<e58d87> 3382\n<e58d88> 3830\n<e58d89> 2033\n<e58d8a> 1014\n<e58d8e> 1983\n<e58d8f> 3960\n<e58d90> 10787\n<e58d91> 1049\n<e58d92> 4673\n<e58d93> 4636\n<e58d94> 8656\n<e58d95> 1414\n<e58d96> 2715\n<e58d97> 2866\n<e58d9a> 1136\n<e58d9b> 10790\n<e58d9c> 1150\n<e58d9d> 10791\n<e58d9e> 1102\n<e58d9f> 5370\n<e58da0> 4445\n<e58da1> 2357\n<e58da2> 2643\n<e58da3> 4747\n<e58da4> 2648\n<e58da5> 10792\n<e58da6> 4746\n<e58da7> 3811\n<e58da8> 10793\n<e58da9> 4946\n<e58daa> 10794\n<e58dab> 3791\n<e58dae> 4714\n<e58daf> 2739\n<e58db0> 4230\n<e58db1> 3762\n<e58db2> 10797\n<e58db3> 2087\n<e58db4> 3215\n<e58db5> 2680\n<e58db6> 10798\n<e58db7> 2332\n<e58db8> 3969\n<e58db9> 10799\n<e58dba> 4947\n<e58dbf> 3169\n<e58e82> 1228\n<e58e83> 10806\n<e58e84> 1585\n<e58e85> 3663\n<e58e86> 2533\n<e58e89> 2530\n<e58e8a> 10809\n<e58e8b> 4066\n<e58e8c> 4106\n<e58e8d> 4733\n<e58e95> 1189\n<e58e98> 2512\n<e58e99> 8897\n<e58e9a> 1960\n<e58e9d> 4734\n<e58e9e> 10821\n<e58e9f> 4336\n<e58ea0> 7780\n<e58ea1> 10822\n<e58ea2> 3918\n<e58ea3> 4735\n<e58ea4> 10823\n<e58ea5> 4736\n<e58ea6> 3888\n<e58ea7> 10824\n<e58ea8> 1309\n<e58ea9> 2294\n<e58ead> 8697\n<e58eae> 4737\n<e58eb2> 8208\n<e58eb3> 10831\n<e58eb4> 8898\n<e58eb5> 10832\n<e58eb6> 5020\n<e58ebb> 3200\n<e58ebf> 3909\n<e58f80> 10840\n<e58f81> 3289\n<e58f82> 1173\n<e58f83> 7770\n<e58f88> 4283\n<e58f89> 1197\n<e58f8a> 2083\n<e58f8b> 4278\n<e58f8c> 3488\n<e58f8d> 1617\n<e58f91> 1599\n<e58f94> 3452\n<e58f95> 10850\n<e58f96> 3196\n<e58f97> 3443\n<e58f98> 1101\n<e58f99> 4027\n<e58f9a> 10851\nendcidchar\n\n100 begincidchar\n<e58f9b> 2962\n<e58f9f> 5013\n<e58fa0> 1503\n<e58fa1> 10855\n<e58fa2> 7842\n<e58fa3> 2407\n<e58fa4> 1822\n<e58fa5> 2323\n<e58fa6> 2614\n<e58fa7> 10856\n<e58fa8> 5374\n<e58fa9> 5373\n<e58faa> 4538\n<e58fab> 2209\n<e58fac> 4474\n<e58fad> 979\n<e58fae> 1506\n<e58faf> 2390\n<e58fb0> 3579\n<e58fb1> 5371\n<e58fb2> 3406\n<e58fb3> 4279\n<e58fb4> 10857\n<e58fb5> 4741\n<e58fb6> 4157\n<e58fb7> 1916\n<e58fb8> 3507\n<e58fb9> 3601\n<e58fba> 10858\n<e58fbb> 5375\n<e58fbc> 1489\n<e58fbd> 5372\n<e59080> 10861\n<e59081> 4314\n<e59082> 10862\n<e59083> 1273\n<e59084> 1778\n<e59085> 10863\n<e59086> 5378\n<e59087> 10864\n<e59088> 1926\n<e59089> 2077\n<e5908a> 1494\n<e5908b> 10865\n<e5908c> 3677\n<e5908d> 2816\n<e5908e> 1962\n<e5908f> 2527\n<e59090> 3699\n<e59091> 3935\n<e59092> 5376\n<e59093> 3890\n<e59094> 10866\n<e59095> 2663\n<e59096> 5377\n<e59097> 2711\n<e5909b> 2348\n<e5909c> 10870\n<e5909d> 2600\n<e5909e> 3709\n<e5909f> 4222\n<e590a0> 1642\n<e590a1> 5385\n<e590a2> 10871\n<e590a3> 5388\n<e590a6> 1678\n<e590a7> 980\n<e590a8> 1557\n<e590a9> 1649\n<e590aa> 10874\n<e590ab> 1891\n<e590ac> 3664\n<e590ad> 2401\n<e590ae> 3494\n<e590af> 3091\n<e590b0> 10875\n<e590b1> 4519\n<e590b2> 5389\n<e590b3> 10876\n<e590b4> 3825\n<e590b5> 1240\n<e590b8> 3851\n<e590b9> 1336\n<e590ba> 10879\n<e590bb> 3798\n<e590bc> 1959\n<e590bd> 10880\n<e590be> 3824\n<e590bf> 10881\n<e59180> 4070\n<e59183> 5384\n<e59186> 1399\n<e59187> 10886\n<e59188> 1263\n<e59189> 10887\n<e5918a> 1761\n<e5918b> 5379\n<e59190> 2856\n<e59191> 10892\n<e59195> 2940\nendcidchar\n\n100 begincidchar\n<e59196> 5383\n<e59197> 5386\n<e59198> 4340\n<e59199> 5387\n<e5919a> 10893\n<e5919b> 3127\n<e5919c> 3815\n<e591a2> 2875\n<e591a3> 10899\n<e591a4> 5394\n<e591a5> 10900\n<e591a6> 5399\n<e591a7> 10901\n<e591a8> 4571\n<e591b1> 5393\n<e591b2> 5410\n<e591b3> 3781\n<e591b4> 10910\n<e591b5> 1918\n<e591b6> 5398\n<e591b7> 5392\n<e591b8> 2975\n<e591bb> 3364\n<e591bc> 1963\n<e591bd> 2817\n<e59280> 2310\n<e59281> 10915\n<e59282> 5390\n<e59283> 10916\n<e59284> 5397\n<e59285> 10917\n<e59286> 2969\n<e5928b> 4423\n<e5928c> 1924\n<e5928d> 10922\n<e5928e> 2299\n<e5928f> 4258\n<e59290> 1723\n<e59291> 10923\n<e59292> 4579\n<e59293> 10924\n<e59294> 5391\n<e59295> 1815\n<e59296> 2356\n<e59299> 2629\n<e5929c> 10927\n<e5929d> 5400\n<e592a3> 5411\n<e592a4> 5421\n<e592a5> 10933\n<e592a6> 5407\n<e592a7> 5406\n<e592a8> 4646\n<e592ab> 5991\n<e592ac> 4142\n<e592ad> 5402\n<e592ae> 10934\n<e592af> 2358\n<e592b0> 10935\n<e592b1> 4382\n<e592b2> 10936\n<e592b3> 2389\n<e592b4> 5404\n<e592b8> 3897\n<e592bb> 5413\n<e592bc> 9069\n<e592bd> 4083\n<e592be> 10942\n<e592bf> 5414\n<e59380> 946\n<e59381> 3030\n<e59382> 5403\n<e59383> 10943\n<e59384> 1948\n<e59385> 10944\n<e59386> 1566\n<e59387> 3724\n<e59388> 1879\n<e59389> 4376\n<e5938c> 5415\n<e5938d> 3929\n<e5938e> 944\n<e5938f> 5423\n<e59390> 5401\n<e59391> 4079\n<e59392> 5405\n<e59395> 5412\n<e59396> 10947\n<e59397> 1982\n<e59398> 10948\n<e5939b> 10949\n<e5939c> 5418\n<e5939d> 5422\n<e5939e> 5424\n<e5939f> 4249\n<e593a0> 10950\n<e593a1> 8775\n<e593a5> 1762\n<e593a6> 2935\n<e593a7> 5426\nendcidchar\n\n100 begincidchar\n<e593a8> 3347\n<e593a9> 2545\n<e593aa> 2855\n<e593ad> 2411\n<e593ae> 3941\n<e593b2> 4477\n<e593b3> 5430\n<e593ba> 1151\n<e593bb> 10965\n<e593bc> 1942\n<e593bd> 5428\n<e593be> 10966\n<e593bf> 5009\n<e59480> 10967\n<e59481> 4109\n<e59484> 9068\n<e59485> 10970\n<e59486> 3561\n<e59487> 1344\n<e59488> 10971\n<e59489> 945\n<e5948f> 5433\n<e59490> 3609\n<e59491> 5434\n<e59494> 5429\n<e5949b> 5425\n<e594a0> 5427\n<e594a1> 10989\n<e594a4> 2002\n<e594a7> 5435\n<e594aa> 5436\n<e594ab> 10994\n<e594ac> 1976\n<e594ad> 10995\n<e594ae> 3442\n<e594af> 3767\n<e594b0> 5453\n<e594b1> 1231\n<e594b2> 10996\n<e594b3> 5452\n<e594b7> 5447\n<e594bc> 5446\n<e594bd> 11004\n<e594be> 3722\n<e594bf> 5444\n<e59580> 11005\n<e59581> 5442\n<e59582> 11006\n<e59583> 2397\n<e59584> 4641\n<e59585> 11007\n<e59586> 3333\n<e59589> 5440\n<e5958a> 940\n<e5958f> 8604\n<e59590> 5445\n<e59593> 8393\n<e59594> 11016\n<e59595> 5443\n<e59596> 5448\n<e5959c> 5454\n<e5959d> 11022\n<e5959e> 8688\n<e595a1> 1637\n<e595a4> 3008\n<e595a5> 3311\n<e595a6> 2461\n<e595a7> 5437\n<e595aa> 2943\n<e595ab> 11029\n<e595ac> 4730\n<e595ad> 5441\n<e595ae> 2905\n<e595b8> 3952\n<e595bb> 5466\n<e595bc> 3639\n<e595bd> 11038\n<e595be> 5463\n<e595bf> 11039\n<e59680> 2355\n<e59681> 5461\n<e59682> 3784\n<e59683> 5457\n<e59684> 3327\n<e59687> 2457\n<e59688> 5460\n<e59689> 1956\n<e5968a> 1895\n<e5968b> 5455\n<e5968f> 5438\n<e59690> 11045\n<e59691> 5465\n<e59694> 5470\n<e59698> 1328\n<e59699> 5471\n<e5969c> 3871\n<e5969d> 1919\n<e5969e> 11053\n<e5969f> 5462\n<e596a7> 4037\nendcidchar\n\n100 begincidchar\n<e596aa> 8459\n<e596ab> 11063\n<e596ac> 8414\n<e596ad> 11064\n<e596ae> 7850\n<e596b1> 5458\n<e596b2> 8748\n<e596b3> 4414\n<e596b4> 11067\n<e596b5> 5439\n<e596b6> 11068\n<e596b7> 2984\n<e596b8> 11069\n<e596b9> 5459\n<e596ba> 11070\n<e596bb> 4316\n<e596bc> 11071\n<e596bf> 11072\n<e59784> 5482\n<e59785> 4012\n<e59786> 8408\n<e59787> 8896\n<e59788> 11077\n<e59789> 5474\n<e5978e> 8303\n<e59791> 5476\n<e59792> 5456\n<e59793> 3293\n<e59794> 5479\n<e59795> 11082\n<e59796> 5464\n<e5979a> 8609\n<e5979b> 11086\n<e5979c> 3423\n<e5979d> 5481\n<e5979e> 11087\n<e5979f> 5467\n<e597a0> 11088\n<e597a1> 3802\n<e597a2> 11089\n<e597a3> 3512\n<e597a4> 5491\n<e597a5> 5484\n<e597a6> 5480\n<e597a7> 11090\n<e597a8> 5489\n<e597a9> 9081\n<e597aa> 5472\n<e597af> 5483\n<e597b4> 11095\n<e597b5> 5490\n<e597b6> 9074\n<e597b7> 5473\n<e597bd> 3529\n<e597be> 5499\n<e597bf> 11101\n<e59880> 5500\n<e59881> 5496\n<e59886> 8554\n<e59887> 11106\n<e59888> 5494\n<e59889> 2113\n<e5988c> 5495\n<e5988d> 9084\n<e5988e> 1725\n<e5988f> 4731\n<e59894> 8368\n<e59895> 11113\n<e59896> 9082\n<e59897> 7796\n<e59898> 4021\n<e5989b> 2710\n<e5989c> 9079\n<e5989d> 11116\n<e5989e> 5493\n<e5989f> 5475\n<e598a3> 5498\n<e598a4> 5497\n<e598a7> 5501\n<e598a8> 11122\n<e598a9> 8012\n<e598ac> 5506\n<e598ad> 5502\n<e598ae> 9080\n<e598af> 8655\n<e598b0> 9064\n<e598b1> 4597\n<e598b2> 1237\n<e598b3> 11125\n<e598b4> 4681\n<e598b5> 9073\n<e598b6> 3504\n<e598b7> 11126\n<e598b8> 9065\n<e598b9> 5504\n<e598ba> 11127\n<e598bb> 3850\n<e598bf> 1936\n<e59980> 11131\n<e59981> 9844\nendcidchar\n\n100 begincidchar\n<e5998c> 5511\n<e5998d> 5507\n<e5998e> 4148\n<e59994> 5512\n<e59997> 5505\n<e59998> 5503\n<e59999> 5509\n<e5999c> 5510\n<e5999d> 9071\n<e599a0> 9072\n<e599a1> 11153\n<e599a2> 5508\n<e599a3> 11154\n<e599a4> 5514\n<e599a5> 9078\n<e599a6> 9075\n<e599a7> 11155\n<e599a8> 3094\n<e599a9> 4706\n<e599aa> 4398\n<e599ab> 5516\n<e599ac> 3424\n<e599af> 9087\n<e599b0> 11158\n<e599b1> 5515\n<e599b2> 9076\n<e599b3> 11159\n<e599b4> 8373\n<e599b5> 11160\n<e599b6> 1724\n<e599b7> 11161\n<e599b8> 7899\n<e599b9> 9842\n<e599ba> 11162\n<e59a80> 9070\n<e59a85> 5519\n<e59a86> 5513\n<e59a87> 8631\n<e59a8c> 9077\n<e59a8d> 11174\n<e59a8e> 1910\n<e59a8f> 3642\n<e59a93> 5520\n<e59a94> 11178\n<e59a95> 9090\n<e59a99> 8350\n<e59aa3> 3942\n<e59aa6> 9067\n<e59aa7> 11193\n<e59aa8> 8249\n<e59aae> 9887\n<e59aaf> 5521\n<e59ab3> 9085\n<e59ab4> 8693\n<e59ab5> 11202\n<e59ab6> 9089\n<e59ab7> 3229\n<e59abc> 2193\n<e59b80> 9083\n<e59b81> 9086\n<e59b82> 8652\n<e59b85> 8923\n<e59b88> 9066\n<e59b89> 9865\n<e59b8a> 2869\n<e59b8b> 11214\n<e59b8c> 9879\n<e59b91> 8865\n<e59b94> 5522\n<e59b97> 5523\n<e59b9a> 3185\n<e59b9b> 3513\n<e59b9c> 11225\n<e59b9d> 5524\n<e59b9e> 2029\n<e59b9f> 4716\n<e59ba0> 4217\n<e59ba1> 5525\n<e59ba2> 3702\n<e59ba3> 11226\n<e59ba4> 1561\n<e59bab> 5527\n<e59bac> 11233\n<e59bad> 4339\n<e59bb0> 2450\n<e59bb1> 1364\n<e59bb4> 3766\n<e59bb5> 5526\n<e59bb9> 5528\n<e59bba> 1829\n<e59bbd> 1875\n<e59bbe> 3693\n<e59bbf> 5529\n<e59c83> 3059\n<e59c84> 5530\n<e59c85> 11246\n<e59c86> 4341\n<e59c87> 9091\n<e59c88> 3201\n<e59c89> 5532\nendcidchar\n\n100 begincidchar\n<e59c8a> 5531\n<e59c8b> 7997\n<e59c8c> 11247\n<e59c8d> 8591\n<e59c92> 8774\n<e59c93> 8776\n<e59c96> 8574\n<e59c97> 11254\n<e59c98> 8576\n<e59c9c> 5533\n<e59c9f> 3698\n<e59ca3> 3388\n<e59ca8> 4381\n<e59ca9> 5031\n<e59caa> 5033\n<e59cab> 11267\n<e59cac> 5032\n<e59cad> 1856\n<e59cb0> 1465\n<e59cb3> 5034\n<e59cb9> 5035\n<e59cba> 1222\n<e59cbb> 5039\n<e59cbe> 2061\n<e59cbf> 11277\n<e59d80> 4534\n<e59d81> 11278\n<e59d82> 5040\n<e59d87> 2344\n<e59d8a> 1624\n<e59d8b> 11285\n<e59d8c> 5024\n<e59d8d> 3585\n<e59d8e> 2367\n<e59d8f> 1994\n<e59d90> 4693\n<e59d91> 2400\n<e59d97> 2422\n<e59d9a> 2132\n<e59d9b> 3590\n<e59d9c> 5038\n<e59d9d> 990\n<e59d9e> 3834\n<e59d9f> 1653\n<e59da0> 4630\n<e59da1> 3041\n<e59da4> 2447\n<e59da5> 11295\n<e59da6> 3596\n<e59da7> 11296\n<e59da8> 5047\n<e59da9> 5041\n<e59daa> 3033\n<e59dab> 5043\n<e59dac> 11297\n<e59dad> 5048\n<e59dae> 11298\n<e59daf> 3000\n<e59db3> 5050\n<e59db6> 5049\n<e59db7> 2381\n<e59dbb> 5046\n<e59dbc> 5045\n<e59e82> 1340\n<e59e83> 2455\n<e59e84> 2633\n<e59e85> 5042\n<e59e86> 5044\n<e59e8b> 3992\n<e59e8c> 5053\n<e59e92> 2504\n<e59e93> 5058\n<e59e9b> 1569\n<e59ea0> 5059\n<e59ea1> 5026\n<e59ea2> 1809\n<e59ea3> 4334\n<e59ea4> 5052\n<e59ea5> 11332\n<e59ea6> 2398\n<e59ea7> 5056\n<e59ea8> 11333\n<e59ea9> 5025\n<e59eaa> 11334\n<e59eab> 1479\n<e59eac> 11335\n<e59ead> 5051\n<e59eae> 2418\n<e59eb2> 5054\n<e59eb3> 11339\n<e59eb4> 5057\n<e59eb8> 5065\n<e59f82> 1786\n<e59f83> 942\n<e59f8b> 2712\n<e59f8e> 1260\n<e59f8f> 5055\n<e59f92> 5064\n<e59f93> 11363\n<e59f94> 3057\nendcidchar\n\n100 begincidchar\n<e59f95> 5060\n<e59f98> 5061\n<e59f99> 5063\n<e59f9a> 5062\n<e59f9d> 5070\n<e59f9e> 11368\n<e59f9f> 4311\n<e59fa0> 1153\n<e59fa1> 9002\n<e59fa4> 5069\n<e59fad> 5074\n<e59fae> 11379\n<e59faf> 5067\n<e59fb4> 5066\n<e59fb7> 8843\n<e59fb8> 5068\n<e59fb9> 2977\n<e59fba> 2062\n<e59fbd> 5073\n<e5a080> 5075\n<e5a081> 11390\n<e5a082> 3606\n<e5a085> 8069\n<e5a086> 1552\n<e5a087> 5196\n<e5a08a> 8997\n<e5a08b> 5071\n<e5a08c> 11395\n<e5a08d> 5072\n<e5a091> 3122\n<e5a095> 1576\n<e5a096> 9004\n<e5a099> 5077\n<e5a09d> 9006\n<e5a09e> 5076\n<e5a09f> 11407\n<e5a0a0> 5079\n<e5a0a1> 1037\n<e5a0a4> 1453\n<e5a0aa> 2365\n<e5a0af> 8709\n<e5a0b0> 4104\n<e5a0b1> 7736\n<e5a0b4> 7795\n<e5a0b5> 1537\n<e5a184> 5078\n<e5a18a> 8163\n<e5a18b> 9017\n<e5a18c> 3567\n<e5a18d> 6563\n<e5a18e> 11440\n<e5a18f> 9003\n<e5a190> 11441\n<e5a191> 3537\n<e5a192> 9005\n<e5a193> 11442\n<e5a194> 3571\n<e5a197> 8575\n<e5a198> 3604\n<e5a19e> 3286\n<e5a1a2> 8615\n<e5a1a3> 11453\n<e5a1a4> 9007\n<e5a1a5> 5080\n<e5a1ab> 3649\n<e5a1ac> 5081\n<e5a1b5> 7805\n<e5a1b9> 8406\n<e5a1be> 5027\n<e5a1bf> 11474\n<e5a280> 5085\n<e5a281> 5082\n<e5a282> 11475\n<e5a283> 2274\n<e5a284> 11476\n<e5a285> 3474\n<e5a289> 5083\n<e5a28a> 7874\n<e5a292> 3331\n<e5a293> 2844\n<e5a299> 3130\n<e5a29a> 5084\n<e5a29b> 11492\n<e5a29c> 8882\n<e5a29d> 11493\n<e5a29e> 4409\n<e5a29f> 4017\n<e5a2a8> 2830\n<e5a2a9> 1556\n<e5a2ae> 7903\n<e5a2b3> 7929\n<e5a2bb> 8409\n<e5a2bc> 5028\n<e5a2bd> 11517\n<e5a2be> 8157\n<e5a2bf> 11518\n<e5a380> 11519\n<e5a381> 1091\n<e5a385> 5029\n<e5a386> 11523\nendcidchar\n\n100 begincidchar\n<e5a387> 8551\n<e5a391> 5030\n<e5a392> 11533\n<e5a393> 8685\n<e5a394> 11534\n<e5a395> 1909\n<e5a398> 8199\n<e5a399> 8998\n<e5a39a> 9001\n<e5a39e> 8018\n<e5a39f> 8251\n<e5a3a0> 9000\n<e5a3a1> 11540\n<e5a3a2> 8999\n<e5a3a3> 11541\n<e5a3a4> 3227\n<e5a3a9> 7723\n<e5a3aa> 11546\n<e5a3ab> 3414\n<e5a3ac> 3236\n<e5a3ad> 11547\n<e5a3ae> 4624\n<e5a3af> 8878\n<e5a3b0> 3378\n<e5a3b3> 2388\n<e5a3b6> 1967\n<e5a3b9> 4163\n<e5a3ba> 8009\n<e5a3bd> 8504\n<e5a482> 5660\n<e5a483> 11560\n<e5a484> 1321\n<e5a487> 1057\n<e5a48d> 1711\n<e5a48e> 11568\n<e5a48f> 3889\n<e5a494> 4859\n<e5a495> 3859\n<e5a496> 3731\n<e5a499> 4865\n<e5a49a> 1567\n<e5a49b> 11575\n<e5a49c> 4160\n<e5a49f> 1812\n<e5a4a2> 8321\n<e5a4a3> 11580\n<e5a4a4> 5659\n<e5a4a5> 5657\n<e5a4a6> 11581\n<e5a4a7> 1398\n<e5a4a8> 11582\n<e5a4a9> 3647\n<e5a4aa> 3582\n<e5a4ab> 1679\n<e5a4ac> 11583\n<e5a4ad> 4712\n<e5a4ae> 4116\n<e5a4af> 1906\n<e5a4b0> 11584\n<e5a4b1> 3390\n<e5a4b4> 3688\n<e5a4b7> 4171\n<e5a4b8> 2417\n<e5a4b9> 2115\n<e5a4ba> 1568\n<e5a4bb> 11589\n<e5a4bc> 5295\n<e5a4bd> 11590\n<e5a4be> 8060\n<e5a4bf> 11591\n<e5a580> 11592\n<e5a581> 5296\n<e5a582> 5004\n<e5a583> 11593\n<e5a584> 4098\n<e5a587> 3077\n<e5a588> 2865\n<e5a589> 1675\n<e5a58a> 11596\n<e5a58b> 1657\n<e5a58e> 2441\n<e5a58f> 4669\n<e5a590> 11599\n<e5a591> 3092\n<e5a594> 1061\n<e5a595> 5298\n<e5a596> 2178\n<e5a597> 3626\n<e5a598> 5300\n<e5a599> 11602\n<e5a59a> 5299\n<e5a5a0> 1485\n<e5a5a1> 11608\n<e5a5a2> 3350\n<e5a5a5> 973\n<e5a5a9> 9051\n<e5a5aa> 7902\n<e5a5ab> 11614\n<e5a5ac> 8098\n<e5a5ad> 11615\nendcidchar\n\n100 begincidchar\n<e5a5ae> 7930\n<e5a5b3> 2927\n<e5a5b4> 2924\n<e5a5b5> 11620\n<e5a5b6> 2863\n<e5a5b7> 11621\n<e5a5b8> 2140\n<e5a5b9> 3570\n<e5a5bd> 1914\n<e5a680> 11627\n<e5a681> 6005\n<e5a682> 3266\n<e5a683> 6006\n<e5a684> 3758\n<e5a685> 11628\n<e5a686> 4622\n<e5a687> 1721\n<e5a688> 2703\n<e5a689> 11629\n<e5a68a> 3244\n<e5a68d> 6007\n<e5a692> 1545\n<e5a693> 2110\n<e5a696> 4134\n<e5a697> 6011\n<e5a698> 11638\n<e5a699> 2803\n<e5a69d> 8877\n<e5a69e> 6014\n<e5a6a3> 6010\n<e5a6a4> 6015\n<e5a6a5> 3720\n<e5a6a8> 1630\n<e5a6ab> 6013\n<e5a6ae> 2880\n<e5a6af> 6018\n<e5a6b2> 6017\n<e5a6b9> 2760\n<e5a6ba> 11658\n<e5a6bb> 3069\n<e5a6be> 6020\n<e5a6bf> 11661\n<e5a786> 2842\n<e5a78a> 6012\n<e5a78b> 3411\n<e5a790> 2228\n<e5a791> 1820\n<e5a792> 6016\n<e5a793> 4000\n<e5a794> 3774\n<e5a797> 6019\n<e5a798> 6026\n<e5a799> 11677\n<e5a79a> 4141\n<e5a79b> 11678\n<e5a79c> 2171\n<e5a79d> 6023\n<e5a7a3> 6025\n<e5a7a4> 11684\n<e5a7a5> 2492\n<e5a7a8> 4179\n<e5a7ac> 2074\n<e5a7b9> 6027\n<e5a7ba> 11702\n<e5a7bb> 4221\n<e5a7bf> 4648\n<e5a880> 11706\n<e5a881> 3759\n<e5a882> 11707\n<e5a883> 3727\n<e5a884> 2637\n<e5a887> 2192\n<e5a888> 6024\n<e5a889> 6029\n<e5a88c> 6028\n<e5a891> 6032\n<e5a892> 11714\n<e5a893> 6034\n<e5a898> 2898\n<e5a89c> 2859\n<e5a89f> 2329\n<e5a8a0> 3368\n<e5a8a3> 6033\n<e5a8a4> 11726\n<e5a8a5> 1583\n<e5a8a9> 2793\n<e5a8b1> 4302\n<e5a8b2> 6030\n<e5a8b3> 11737\n<e5a8b4> 6031\n<e5a8b5> 11738\n<e5a8b6> 3197\n<e5a8bc> 6039\n<e5a980> 6035\n<e5a981> 8255\n<e5a986> 3044\n<e5a989> 3746\n<e5a98a> 6037\n<e5a995> 6038\n<e5a99a> 2046\nendcidchar\n\n100 begincidchar\n<e5a9a2> 6040\n<e5a9a6> 7950\n<e5a9a7> 6036\n<e5a9aa> 2466\n<e5a9ad> 9209\n<e5a9b4> 4233\n<e5a9b5> 6041\n<e5a9b6> 3373\n<e5a9b7> 6045\n<e5a9ba> 6046\n<e5a9bf> 4033\n<e5aa92> 2754\n<e5aa9a> 2761\n<e5aa9b> 6044\n<e5aaa7> 9212\n<e5aaaa> 6043\n<e5aab2> 6049\n<e5aab3> 3870\n<e5aab4> 11838\n<e5aab5> 6564\n<e5aab8> 6052\n<e5aabd> 8297\n<e5aabe> 6047\n<e5aabf> 11845\n<e5ab80> 11846\n<e5ab81> 2129\n<e5ab82> 3298\n<e5ab89> 2088\n<e5ab8c> 3904\n<e5ab92> 6050\n<e5ab93> 11860\n<e5ab94> 6051\n<e5ab95> 11861\n<e5ab96> 6056\n<e5ab97> 9207\n<e5ab98> 6058\n<e5ab9c> 6059\n<e5aba0> 6053\n<e5aba1> 1462\n<e5aba2> 11868\n<e5aba3> 6054\n<e5aba6> 6057\n<e5aba9> 2878\n<e5abaa> 11873\n<e5abab> 6048\n<e5abb1> 6055\n<e5abb5> 9206\n<e5abbb> 9213\n<e5ac80> 9208\n<e5ac88> 9210\n<e5ac89> 6060\n<e5ac8a> 11898\n<e5ac8b> 9214\n<e5ac8c> 8104\n<e5ac96> 6062\n<e5ac97> 6061\n<e5ac98> 11908\n<e5ac99> 9217\n<e5aca1> 9215\n<e5acaa> 9216\n<e5acb0> 8737\n<e5acb1> 11929\n<e5acb2> 6063\n<e5acb3> 11930\n<e5acb4> 4876\n<e5acb7> 6064\n<e5acb8> 8482\n<e5ad80> 6065\n<e5ad8c> 9211\n<e5ad90> 4656\n<e5ad91> 6071\n<e5ad92> 11954\n<e5ad93> 6072\n<e5ad94> 2404\n<e5ad95> 4371\n<e5ad96> 11955\n<e5ad97> 4659\n<e5ad98> 1385\n<e5ad99> 3556\n<e5ad9a> 6068\n<e5ad9b> 4729\n<e5ad9c> 4651\n<e5ad9d> 3949\n<e5ad9e> 11956\n<e5ad9f> 2772\n<e5ada2> 6073\n<e5ada3> 2097\n<e5ada4> 1819\n<e5ada5> 6069\n<e5ada6> 4048\n<e5ada9> 1881\n<e5adaa> 2678\n<e5adab> 8538\n<e5adac> 4705\n<e5adb0> 3458\n<e5adb1> 5994\n<e5adb2> 11964\n<e5adb3> 6070\n<e5adb4> 11965\n<e5adb5> 1682\nendcidchar\n\n100 begincidchar\n<e5adb8> 8677\n<e5adb9> 11968\n<e5adba> 3265\n<e5adbd> 2904\n<e5adbe> 11971\n<e5adbf> 8279\n<e5ae80> 5934\n<e5ae81> 2913\n<e5ae82> 11972\n<e5ae83> 3569\n<e5ae84> 5935\n<e5ae85> 4429\n<e5ae86> 11973\n<e5ae87> 4307\n<e5ae88> 3439\n<e5ae89> 957\n<e5ae8a> 11974\n<e5ae8b> 3523\n<e5ae8c> 3739\n<e5ae8f> 1953\n<e5ae93> 5937\n<e5ae94> 11980\n<e5ae95> 5936\n<e5ae96> 11981\n<e5ae97> 4663\n<e5ae98> 1842\n<e5ae99> 4581\n<e5ae9a> 1511\n<e5ae9b> 3745\n<e5ae9c> 4178\n<e5ae9d> 1039\n<e5ae9e> 3404\n<e5ae9f> 11982\n<e5aea0> 1293\n<e5aea1> 3372\n<e5aea2> 2394\n<e5aea3> 4038\n<e5aea4> 3433\n<e5aea5> 5938\n<e5aea6> 2007\n<e5aeaa> 3913\n<e5aeab> 1797\n<e5aeb0> 4378\n<e5aeb3> 1885\n<e5aeb4> 4112\n<e5aeb5> 3945\n<e5aeb6> 2117\n<e5aeb7> 11992\n<e5aeb8> 5939\n<e5aeb9> 3256\n<e5aebd> 2426\n<e5aebe> 1119\n<e5aebf> 3539\n<e5af82> 2104\n<e5af83> 11998\n<e5af84> 2103\n<e5af85> 4225\n<e5af86> 2785\n<e5af87> 2409\n<e5af8c> 1718\n<e5af90> 2759\n<e5af91> 12006\n<e5af92> 1893\n<e5af93> 4325\n<e5af9d> 3163\n<e5af9e> 2834\n<e5af9f> 1203\n<e5afa0> 12016\n<e5afa1> 1834\n<e5afa2> 8421\n<e5afa3> 12017\n<e5afa4> 5943\n<e5afa5> 2577\n<e5afa6> 8495\n<e5afa7> 8355\n<e5afa8> 4432\n<e5afa9> 8481\n<e5afaa> 12018\n<e5afab> 8660\n<e5afac> 8165\n<e5afad> 12019\n<e5afae> 5944\n<e5afaf> 12020\n<e5afb0> 5946\n<e5afb5> 7818\n<e5afb6> 7735\n<e5afb7> 12025\n<e5afb8> 1386\n<e5afb9> 1555\n<e5afba> 3511\n<e5afbb> 4057\n<e5afbc> 1437\n<e5afbf> 3440\n<e5b080> 12028\n<e5b081> 1663\n<e5b084> 3357\n<e5b085> 12031\n<e5b086> 2172\n<e5b087> 8094\n<e5b088> 8870\nendcidchar\n\n100 begincidchar\n<e5b089> 3789\n<e5b08a> 4685\n<e5b08b> 8680\n<e5b08c> 12032\n<e5b08d> 7898\n<e5b08e> 7865\n<e5b08f> 3948\n<e5b090> 12033\n<e5b091> 3346\n<e5b094> 1594\n<e5b095> 6066\n<e5b096> 2133\n<e5b097> 12036\n<e5b098> 1251\n<e5b099> 12037\n<e5b09a> 3337\n<e5b09b> 12038\n<e5b09c> 6067\n<e5b09d> 1223\n<e5b0a2> 5302\n<e5b0a3> 12043\n<e5b0a4> 4269\n<e5b0a5> 5303\n<e5b0a6> 12044\n<e5b0a7> 4137\n<e5b0ac> 5304\n<e5b0b1> 2300\n<e5b0b4> 5305\n<e5b0b7> 9052\n<e5b0b8> 3395\n<e5b0b9> 4227\n<e5b0ba> 1284\n<e5b0bb> 5990\n<e5b0bc> 2884\n<e5b0bd> 2256\n<e5b0be> 3777\n<e5b0bf> 2901\n<e5b180> 2309\n<e5b181> 3015\n<e5b182> 1194\n<e5b185> 2306\n<e5b188> 3193\n<e5b189> 3646\n<e5b18a> 2237\n<e5b18b> 3820\n<e5b18e> 3409\n<e5b18f> 3040\n<e5b190> 5992\n<e5b191> 3975\n<e5b195> 4442\n<e5b199> 5993\n<e5b19e> 3467\n<e5b19f> 12073\n<e5b1a0> 3697\n<e5b1a1> 2668\n<e5b1a2> 8272\n<e5b1a3> 5995\n<e5b1a4> 7783\n<e5b1a5> 2667\n<e5b1a6> 5996\n<e5b1a7> 12074\n<e5b1a8> 9204\n<e5b1ac> 8510\n<e5b1ad> 12078\n<e5b1ae> 6004\n<e5b1af> 3710\n<e5b1b0> 12079\n<e5b1b1> 3318\n<e5b1b9> 4192\n<e5b1ba> 5548\n<e5b1bf> 4305\n<e5b280> 12091\n<e5b281> 3551\n<e5b282> 3088\n<e5b288> 5552\n<e5b28c> 5547\n<e5b28d> 5549\n<e5b290> 5550\n<e5b291> 5555\n<e5b294> 1204\n<e5b295> 12104\n<e5b296> 5551\n<e5b297> 1749\n<e5b29a> 5556\n<e5b29b> 1435\n<e5b29c> 5557\n<e5b2a1> 7958\n<e5b2a2> 5559\n<e5b2a3> 5564\n<e5b2a9> 4091\n<e5b2aa> 12114\n<e5b2ab> 5562\n<e5b2ac> 5561\n<e5b2ad> 2612\n<e5b2b1> 5563\n<e5b2b2> 12118\n<e5b2b3> 4355\n<e5b2b4> 12119\n<e5b2b5> 5558\n<e5b2b6> 12120\nendcidchar\n\n100 begincidchar\n<e5b2b7> 5566\n<e5b2b8> 961\n<e5b2bd> 5560\n<e5b2be> 12125\n<e5b2bf> 2438\n<e5b380> 12126\n<e5b381> 5565\n<e5b384> 5567\n<e5b38b> 5570\n<e5b392> 5568\n<e5b399> 4548\n<e5b3a1> 3884\n<e5b3a4> 5569\n<e5b3a5> 5571\n<e5b3a6> 2676\n<e5b3a7> 12156\n<e5b3a8> 1578\n<e5b3a9> 12157\n<e5b3aa> 4317\n<e5b3ad> 3146\n<e5b3b0> 1666\n<e5b3b4> 9097\n<e5b3b5> 12165\n<e5b3b6> 7863\n<e5b3bb> 2349\n<e5b3bc> 12170\n<e5b3bd> 8628\n<e5b486> 5579\n<e5b487> 1292\n<e5b48d> 9103\n<e5b48e> 3080\n<e5b494> 1377\n<e5b495> 12187\n<e5b496> 4075\n<e5b497> 7962\n<e5b49b> 5580\n<e5b49e> 5578\n<e5b4a4> 5577\n<e5b4a5> 12198\n<e5b4a6> 5575\n<e5b4a7> 5574\n<e5b4a8> 12199\n<e5b4a9> 1065\n<e5b4ac> 9099\n<e5b4ad> 4441\n<e5b4ae> 5576\n<e5b4b4> 5583\n<e5b4bd> 5584\n<e5b4be> 5582\n<e5b4bf> 12215\n<e5b587> 6946\n<e5b58a> 5591\n<e5b58b> 5590\n<e5b58c> 3123\n<e5b590> 9098\n<e5b598> 5581\n<e5b59b> 5586\n<e5b59c> 12237\n<e5b59d> 5588\n<e5b5a9> 5592\n<e5b5aa> 12249\n<e5b5ab> 5589\n<e5b5ac> 5585\n<e5b5af> 5587\n<e5b5b4> 5593\n<e5b680> 12267\n<e5b681> 9105\n<e5b682> 5594\n<e5b683> 12268\n<e5b684> 8817\n<e5b687> 9096\n<e5b697> 9102\n<e5b698> 12286\n<e5b699> 5595\n<e5b69d> 5596\n<e5b6a0> 9101\n<e5b6a7> 9100\n<e5b6b7> 5598\n<e5b6b8> 9104\n<e5b6b9> 12313\n<e5b6ba> 8243\n<e5b6bb> 12314\n<e5b6bc> 8764\n<e5b785> 5599\n<e5b78b> 8169\n<e5b78c> 12328\n<e5b78d> 3760\n<e5b792> 8277\n<e5b793> 12333\n<e5b794> 9106\n<e5b79b> 6165\n<e5b79c> 12340\n<e5b79d> 1323\n<e5b79e> 4572\n<e5b7a1> 4059\n<e5b7a2> 1239\n<e5b7a5> 1789\n<e5b7a6> 4688\n<e5b7a7> 3142\n<e5b7a8> 2317\nendcidchar\n\n100 begincidchar\n<e5b7a9> 1799\n<e5b7aa> 12345\n<e5b7ab> 3814\n<e5b7ae> 1205\n<e5b7af> 5023\n<e5b7b0> 8996\n<e5b7b1> 2093\n<e5b7b2> 4184\n<e5b7b3> 3517\n<e5b7b4> 984\n<e5b7b7> 3932\n<e5b7bd> 4855\n<e5b7be> 2238\n<e5b7bf> 12355\n<e5b880> 12356\n<e5b881> 1083\n<e5b882> 3431\n<e5b883> 1155\n<e5b884> 12357\n<e5b885> 3484\n<e5b886> 1608\n<e5b887> 12358\n<e5b888> 3389\n<e5b88c> 3856\n<e5b88f> 5534\n<e5b890> 4459\n<e5b891> 5537\n<e5b894> 5536\n<e5b895> 2946\n<e5b896> 3662\n<e5b897> 12366\n<e5b898> 2554\n<e5b899> 5535\n<e5b89a> 4578\n<e5b89b> 1142\n<e5b89c> 4547\n<e5b89d> 1468\n<e5b8a5> 8515\n<e5b8a6> 1403\n<e5b8a7> 4512\n<e5b8ab> 8489\n<e5b8ac> 12377\n<e5b8ad> 3868\n<e5b8ae> 1018\n<e5b8b1> 5538\n<e5b8b2> 12380\n<e5b8b3> 8823\n<e5b8b6> 7847\n<e5b8b7> 5541\n<e5b8b8> 1224\n<e5b8bd> 2742\n<e5b980> 8837\n<e5b981> 12387\n<e5b982> 2786\n<e5b983> 9092\n<e5b984> 5542\n<e5b985> 1686\n<e5b98c> 2020\n<e5b994> 5543\n<e5b995> 2846\n<e5b996> 12401\n<e5b997> 9095\n<e5b998> 9094\n<e5b99b> 5544\n<e5b99e> 5545\n<e5b99f> 8848\n<e5b9a0> 12406\n<e5b9a1> 5546\n<e5b9a2> 1332\n<e5b9a3> 7748\n<e5b9ab> 7730\n<e5b9ac> 9093\n<e5b9b2> 1732\n<e5b9b3> 3036\n<e5b9b4> 2893\n<e5b9b5> 12419\n<e5b9b6> 1129\n<e5b9b7> 12420\n<e5b9b8> 3997\n<e5b9b9> 7955\n<e5b9ba> 6163\n<e5b9bb> 2008\n<e5b9bc> 4284\n<e5b9bd> 4265\n<e5b9be> 8051\n<e5b9bf> 1852\n<e5ba80> 5681\n<e5ba84> 4620\n<e5ba85> 12424\n<e5ba86> 3177\n<e5ba87> 1084\n<e5ba8a> 1333\n<e5ba8b> 5683\n<e5ba8f> 4029\n<e5ba90> 2645\n<e5ba91> 5682\n<e5ba92> 12430\n<e5ba93> 2415\n<e5ba94> 4235\n<e5ba95> 1464\nendcidchar\n\n100 begincidchar\n<e5ba96> 5684\n<e5ba97> 1483\n<e5ba98> 12431\n<e5ba99> 2802\n<e5ba9a> 1784\n<e5ba9b> 12432\n<e5ba9c> 1705\n<e5ba9d> 12433\n<e5ba9e> 2964\n<e5ba9f> 1644\n<e5baa0> 5686\n<e5baa5> 5685\n<e5baa6> 1543\n<e5baa7> 4694\n<e5baab> 8160\n<e5baac> 12441\n<e5baad> 3670\n<e5bab3> 5690\n<e5bab4> 12447\n<e5bab5> 5688\n<e5bab6> 3475\n<e5bab7> 2370\n<e5bab8> 4254\n<e5bab9> 5687\n<e5babe> 5689\n<e5babf> 12452\n<e5bb89> 2551\n<e5bb8a> 2483\n<e5bb91> 5693\n<e5bb92> 5692\n<e5bb93> 2453\n<e5bb96> 2583\n<e5bb9b> 5694\n<e5bb9f> 8327\n<e5bba0> 7800\n<e5bba1> 9134\n<e5bba2> 7926\n<e5bba3> 7985\n<e5bba8> 5695\n<e5bba9> 12481\n<e5bbaa> 5696\n<e5bbab> 12482\n<e5bbac> 8261\n<e5bbb3> 8568\n<e5bbb4> 5016\n<e5bbb5> 12489\n<e5bbb6> 4092\n<e5bbb7> 3667\n<e5bbba> 2169\n<e5bbbe> 5293\n<e5bbbf> 4699\n<e5bc80> 2359\n<e5bc81> 5021\n<e5bc82> 4211\n<e5bc83> 3097\n<e5bc84> 2923\n<e5bc88> 5294\n<e5bc89> 12498\n<e5bc8a> 1088\n<e5bc8b> 5366\n<e5bc8f> 3412\n<e5bc90> 12502\n<e5bc91> 5369\n<e5bc92> 12503\n<e5bc93> 1798\n<e5bc94> 12504\n<e5bc95> 4228\n<e5bc96> 12505\n<e5bc97> 1696\n<e5bc98> 1954\n<e5bc9b> 1279\n<e5bc9f> 1469\n<e5bca0> 4454\n<e5bca5> 2779\n<e5bca6> 3903\n<e5bca7> 1974\n<e5bca8> 12515\n<e5bca9> 5999\n<e5bcaa> 5998\n<e5bcad> 6000\n<e5bcae> 12518\n<e5bcaf> 3733\n<e5bcb0> 12519\n<e5bcb1> 3280\n<e5bcb2> 12520\n<e5bcb3> 9205\n<e5bcb4> 12521\n<e5bcb5> 8821\n<e5bcb9> 1424\n<e5bcba> 3132\n<e5bcbb> 12525\n<e5bcbc> 6002\n<e5bd80> 6590\n<e5bd86> 9838\n<e5bd87> 12534\n<e5bd88> 7856\n<e5bd8c> 8323\n<e5bd8d> 12538\n<e5bd8e> 8584\n<e5bd8f> 12539\nendcidchar\n\n100 begincidchar\n<e5bd90> 5986\n<e5bd91> 12540\n<e5bd92> 1858\n<e5bd93> 1426\n<e5bd94> 12541\n<e5bd95> 2659\n<e5bd96> 5988\n<e5bd97> 5987\n<e5bd98> 5989\n<e5bd99> 9852\n<e5bd9d> 4180\n<e5bda1> 5614\n<e5bda2> 3993\n<e5bda3> 12548\n<e5bda4> 3679\n<e5bda5> 12549\n<e5bda6> 4110\n<e5bda9> 1169\n<e5bdaa> 1108\n<e5bdab> 12552\n<e5bdac> 1115\n<e5bdad> 2990\n<e5bdb0> 4452\n<e5bdb1> 4245\n<e5bdb2> 12555\n<e5bdb3> 5600\n<e5bdb7> 5601\n<e5bdb8> 12559\n<e5bdb9> 4194\n<e5bdba> 12560\n<e5bdbb> 1246\n<e5bdbc> 1076\n<e5be80> 3754\n<e5be81> 4504\n<e5be82> 5602\n<e5be83> 12564\n<e5be84> 2277\n<e5be85> 1408\n<e5be86> 12565\n<e5be87> 5603\n<e5be88> 1939\n<e5be89> 5604\n<e5be8a> 1991\n<e5be8b> 2672\n<e5be8c> 5605\n<e5be90> 4023\n<e5be91> 8133\n<e5be92> 3694\n<e5be95> 5606\n<e5be96> 12571\n<e5be97> 1444\n<e5be98> 2952\n<e5be99> 5607\n<e5be9c> 5608\n<e5be9d> 12574\n<e5be9e> 7841\n<e5be9f> 12575\n<e5bea0> 9107\n<e5bea1> 4318\n<e5bea8> 5609\n<e5bea9> 7947\n<e5beaa> 4054\n<e5bead> 5610\n<e5beae> 3761\n<e5beb5> 5611\n<e5beb6> 12590\n<e5beb7> 1443\n<e5beb8> 12591\n<e5beb9> 7804\n<e5bebc> 5612\n<e5bebd> 2026\n<e5bf83> 3983\n<e5bf84> 5698\n<e5bf85> 1089\n<e5bf86> 4203\n<e5bf89> 5699\n<e5bf8c> 2108\n<e5bf8d> 3239\n<e5bf8e> 12603\n<e5bf8f> 5701\n<e5bf90> 6668\n<e5bf91> 6667\n<e5bf92> 5367\n<e5bf96> 5700\n<e5bf97> 4541\n<e5bf98> 3757\n<e5bf99> 2731\n<e5bf9d> 5763\n<e5bfa0> 4561\n<e5bfa1> 5705\n<e5bfa4> 5706\n<e5bfa7> 4268\n<e5bfaa> 5710\n<e5bfab> 2425\n<e5bfac> 12618\n<e5bfad> 5711\n<e5bfae> 5703\n<e5bfb1> 1253\n<e5bfb5> 2897\n<e5bfb8> 5712\nendcidchar\n\n100 begincidchar\n<e5bfbb> 3982\n<e5bfbc> 12628\n<e5bfbd> 1965\n<e5bfbe> 5707\n<e5bfbf> 1659\n<e68080> 1992\n<e68081> 3583\n<e68082> 3520\n<e68083> 5702\n<e68084> 5704\n<e6808a> 5721\n<e6808d> 5718\n<e6808e> 4408\n<e6808f> 5717\n<e68092> 2926\n<e68093> 12636\n<e68094> 4507\n<e68095> 2947\n<e68096> 1159\n<e68099> 5713\n<e6809a> 12639\n<e6809b> 5716\n<e6809c> 2552\n<e6809d> 3505\n<e680a0> 1410\n<e680a1> 5723\n<e680a5> 2084\n<e680a6> 5715\n<e680a7> 3999\n<e680a8> 4348\n<e680a9> 5719\n<e680aa> 1839\n<e680ab> 5720\n<e680af> 3152\n<e680b5> 5714\n<e680bb> 4665\n<e680bc> 6669\n<e680bf> 5722\n<e68180> 12660\n<e68181> 6673\n<e68182> 5728\n<e68183> 3432\n<e6818b> 2558\n<e6818c> 12668\n<e6818d> 2021\n<e68190> 2403\n<e68191> 12671\n<e68192> 1946\n<e68195> 3478\n<e68199> 6674\n<e6819a> 6671\n<e6819d> 6670\n<e681a2> 2027\n<e681a3> 6675\n<e681a4> 4031\n<e681a7> 6672\n<e681a8> 1941\n<e681a9> 1590\n<e681aa> 5729\n<e681ab> 1521\n<e681ac> 3652\n<e681ad> 1792\n<e681ae> 12685\n<e681af> 3855\n<e681b0> 3102\n<e681b3> 2399\n<e681b6> 1584\n<e681b7> 12690\n<e681ba> 5727\n<e681bb> 5726\n<e681bc> 2872\n<e681bd> 5730\n<e681be> 12691\n<e681bf> 4262\n<e68283> 5735\n<e68284> 3137\n<e68289> 3857\n<e6828c> 5737\n<e6828d> 1902\n<e68292> 5736\n<e68293> 12705\n<e68294> 2031\n<e68295> 12706\n<e68296> 5731\n<e6829a> 5732\n<e6829b> 5738\n<e6829c> 12710\n<e6829d> 5734\n<e6829e> 12711\n<e6829f> 3841\n<e682a0> 4267\n<e682a3> 2001\n<e682a6> 4358\n<e682a7> 12716\n<e682a8> 2909\n<e682ab> 6676\n<e682ac> 4039\n<e682ad> 5733\n<e682ae> 12719\n<e682af> 2810\nendcidchar\n\n100 begincidchar\n<e682b0> 12720\n<e682b1> 5741\n<e682b2> 1048\n<e682b3> 12721\n<e682b4> 5746\n<e682b5> 9140\n<e682b6> 8318\n<e682b7> 12722\n<e682b8> 2101\n<e682bb> 5740\n<e682bc> 1440\n<e68385> 3174\n<e68386> 5744\n<e6838a> 2265\n<e6838b> 3744\n<e68391> 2056\n<e68395> 3643\n<e68398> 5743\n<e68399> 12746\n<e6839a> 5745\n<e6839b> 12747\n<e6839c> 3860\n<e6839d> 5742\n<e6839e> 12748\n<e6839f> 3768\n<e683a0> 2034\n<e683a1> 7907\n<e683a6> 1484\n<e683a7> 2324\n<e683a8> 1177\n<e683a9> 1266\n<e683aa> 12753\n<e683ab> 1058\n<e683ac> 5739\n<e683ad> 1176\n<e683ae> 1421\n<e683af> 1848\n<e683b0> 1575\n<e683b1> 8341\n<e683b2> 9147\n<e683b3> 3928\n<e683b4> 5751\n<e683b5> 12754\n<e683b6> 2017\n<e683b9> 3234\n<e683ba> 3989\n<e683bb> 9145\n<e68480> 5752\n<e68481> 1299\n<e68486> 6677\n<e68487> 12765\n<e68488> 4319\n<e68489> 4297\n<e6848d> 6678\n<e6848e> 5753\n<e6848f> 4201\n<e68495> 5749\n<e6849a> 4291\n<e6849b> 7720\n<e6849c> 9149\n<e6849f> 1739\n<e684a0> 5747\n<e684a3> 5750\n<e684a4> 1660\n<e684a5> 12782\n<e684a6> 5748\n<e684a7> 2445\n<e684ab> 5754\n<e684b4> 9141\n<e684b7> 9146\n<e684be> 9139\n<e684bf> 4347\n<e68588> 1355\n<e68589> 12810\n<e6858a> 5755\n<e6858b> 8546\n<e6858c> 2010\n<e6858d> 12811\n<e6858e> 3376\n<e68591> 3358\n<e68595> 2848\n<e68598> 7774\n<e68599> 12819\n<e6859a> 7773\n<e6859d> 6679\n<e6859e> 12822\n<e6859f> 9143\n<e685a2> 2724\n<e685a3> 7983\n<e685a4> 9439\n<e685a7> 2032\n<e685a8> 2363\n<e685a9> 12827\n<e685aa> 9138\n<e685ab> 8526\n<e685ae> 8274\n<e685af> 12830\n<e685b0> 3790\n<e685b3> 9148\n<e685b4> 12833\nendcidchar\n\n100 begincidchar\n<e685b5> 5756\n<e685b6> 8427\n<e685b7> 2371\n<e68682> 8754\n<e6868a> 7743\n<e6868b> 1112\n<e6868e> 4410\n<e6868f> 12853\n<e68690> 8219\n<e68691> 8380\n<e68692> 9150\n<e68693> 12854\n<e68694> 5758\n<e6869a> 7854\n<e6869d> 6681\n<e686a4> 7931\n<e686a7> 5759\n<e686a8> 1888\n<e686a9> 6680\n<e686aa> 12870\n<e686ab> 8329\n<e686ac> 5757\n<e686ad> 12871\n<e686ae> 9137\n<e686b2> 8644\n<e686b6> 8724\n<e686b7> 5760\n<e686be> 1901\n<e686bf> 12884\n<e68782> 1517\n<e68787> 8158\n<e68788> 3971\n<e68789> 8739\n<e6878a> 974\n<e6878b> 6682\n<e6878c> 9142\n<e68791> 6683\n<e68792> 2476\n<e68793> 12895\n<e68794> 5761\n<e6879e> 9868\n<e6879f> 9438\n<e687a3> 9440\n<e687a6> 2932\n<e687a7> 12910\n<e687a8> 9144\n<e687b2> 7809\n<e687b5> 5762\n<e687b6> 8190\n<e687b7> 8017\n<e687b8> 8673\n<e687b9> 12922\n<e687ba> 9136\n<e687bb> 12923\n<e687bc> 8142\n<e687bd> 12924\n<e687be> 8478\n<e687bf> 5088\n<e68880> 8225\n<e68886> 6684\n<e68887> 9441\n<e68888> 1765\n<e68889> 12930\n<e6888a> 3835\n<e6888b> 6393\n<e6888c> 4018\n<e6888d> 3472\n<e6888e> 3249\n<e6888f> 3876\n<e68890> 1262\n<e68891> 3809\n<e68892> 2229\n<e68893> 12931\n<e68894> 9379\n<e68895> 5790\n<e68896> 2055\n<e68897> 6394\n<e68898> 4446\n<e68899> 12932\n<e6889a> 3068\n<e6889b> 6395\n<e6889f> 6396\n<e688a0> 12936\n<e688a1> 6398\n<e688a2> 6397\n<e688a3> 12937\n<e688a4> 6400\n<e688a5> 6399\n<e688a6> 12938\n<e688a7> 9380\n<e688aa> 2217\n<e688ab> 12941\n<e688ac> 6401\n<e688ad> 12942\n<e688ae> 2661\n<e688af> 12943\n<e688b0> 8819\n<e688b1> 12944\n<e688b2> 8624\n<e688b3> 1348\nendcidchar\n\n100 begincidchar\n<e688b4> 1402\n<e688b7> 1980\n<e688bd> 6644\n<e688be> 6643\n<e688bf> 1628\n<e68980> 3566\n<e68981> 1099\n<e68982> 12952\n<e68983> 6645\n<e68987> 3329\n<e6898a> 12956\n<e6898b> 3437\n<e6898c> 5306\n<e6898d> 1164\n<e6898e> 4413\n<e68991> 3050\n<e68992> 978\n<e68993> 1397\n<e68994> 3246\n<e68998> 3713\n<e6899b> 2373\n<e689a3> 2408\n<e689a6> 3105\n<e689a7> 4531\n<e689a8> 12973\n<e689a9> 2452\n<e689aa> 5307\n<e689ab> 3297\n<e689ac> 4120\n<e689ad> 2917\n<e689ae> 1010\n<e689af> 1243\n<e689b0> 3232\n<e689b3> 1005\n<e689b6> 1683\n<e689b9> 3003\n<e689bc> 1586\n<e689bd> 12982\n<e689be> 4467\n<e689bf> 1269\n<e68a80> 2095\n<e68a84> 1234\n<e68a89> 2336\n<e68a8a> 988\n<e68a91> 4189\n<e68a92> 3450\n<e68a93> 4610\n<e68a94> 12996\n<e68a95> 3687\n<e68a96> 1525\n<e68a97> 2374\n<e68a98> 4476\n<e68a99> 12997\n<e68a9a> 1698\n<e68a9b> 2968\n<e68a9f> 5308\n<e68aa0> 2406\n<e68aa1> 2684\n<e68aa2> 3133\n<e68aa3> 13001\n<e68aa4> 1977\n<e68aa5> 1041\n<e68aa8> 2987\n<e68aab> 3004\n<e68aac> 3578\n<e68ab1> 1040\n<e68ab5> 1463\n<e68ab9> 2827\n<e68aba> 13016\n<e68abb> 5309\n<e68abc> 4067\n<e68abd> 1294\n<e68abe> 13017\n<e68abf> 2807\n<e68b82> 1684\n<e68b83> 13020\n<e68b84> 4595\n<e68b85> 1412\n<e68b86> 1207\n<e68b87> 2839\n<e68b88> 2892\n<e68b89> 2456\n<e68b8a> 5310\n<e68b8b> 13021\n<e68b8c> 1011\n<e68b8d> 2949\n<e68b8e> 2601\n<e68b8f> 13022\n<e68b90> 1838\n<e68b91> 13023\n<e68b92> 2315\n<e68b93> 3721\n<e68b94> 985\n<e68b95> 13024\n<e68b96> 3712\n<e68b97> 5312\n<e68b98> 2303\n<e68b99> 4635\n<e68b9a> 5311\n<e68b9b> 4465\nendcidchar\n\n100 begincidchar\n<e68b9c> 1000\n<e68b9f> 2885\n<e68ba2> 2634\n<e68ba3> 2147\n<e68ba4> 13029\n<e68ba5> 4250\n<e68ba6> 2468\n<e68ba7> 2914\n<e68ba8> 1133\n<e68ba9> 4404\n<e68bac> 2451\n<e68bad> 3418\n<e68bae> 5313\n<e68baf> 4509\n<e68bb0> 13032\n<e68bb1> 1801\n<e68bb2> 13033\n<e68bb3> 3208\n<e68bb4> 3486\n<e68bb5> 13034\n<e68bb6> 5315\n<e68bb7> 2378\n<e68bbc> 3027\n<e68bbd> 4612\n<e68bbe> 3399\n<e68bbf> 2854\n<e68c80> 13039\n<e68c81> 1275\n<e68c82> 1835\n<e68c87> 4535\n<e68c88> 6478\n<e68c89> 959\n<e68c8e> 2419\n<e68c91> 3655\n<e68c96> 3723\n<e68c9a> 4542\n<e68c9b> 2677\n<e68c9c> 13057\n<e68c9d> 3805\n<e68c9e> 3573\n<e68c9f> 3961\n<e68ca0> 2870\n<e68ca1> 1427\n<e68ca2> 5314\n<e68ca3> 4502\n<e68ca4> 2090\n<e68ca5> 2024\n<e68ca8> 943\n<e68ca9> 13060\n<e68caa> 2931\n<e68cab> 1391\n<e68caf> 4498\n<e68cb2> 6479\n<e68cb9> 5316\n<e68cba> 3671\n<e68cbd> 3741\n<e68cbe> 8657\n<e68cbf> 13074\n<e68d82> 3829\n<e68d83> 5318\n<e68d84> 13077\n<e68d85> 3682\n<e68d86> 2449\n<e68d89> 4634\n<e68d8a> 13080\n<e68d8b> 5317\n<e68d8c> 977\n<e68d8d> 1899\n<e68d8e> 3340\n<e68d8f> 2902\n<e68d90> 2327\n<e68d95> 1149\n<e68d9e> 2487\n<e68d9f> 3557\n<e68da0> 13093\n<e68da1> 2148\n<e68da2> 2000\n<e68da3> 1432\n<e68da7> 2998\n<e68da8> 8476\n<e68da9> 5328\n<e68daa> 13097\n<e68dab> 9053\n<e68dac> 13098\n<e68dad> 5325\n<e68dae> 2316\n<e68db1> 5321\n<e68db2> 9858\n<e68db6> 1338\n<e68db7> 2222\n<e68dba> 5322\n<e68dbb> 2896\n<e68e80> 3891\n<e68e81> 13110\n<e68e82> 1473\n<e68e83> 8461\n<e68e84> 8282\n<e68e87> 1565\n<e68e88> 3441\n<e68e89> 1493\nendcidchar\n\n100 begincidchar\n<e68e8a> 5327\n<e68e8b> 13113\n<e68e8c> 4455\n<e68e8d> 13114\n<e68e8e> 5323\n<e68e8f> 3616\n<e68e90> 3101\n<e68e91> 13115\n<e68e92> 2950\n<e68e96> 4155\n<e68e97> 13119\n<e68e98> 2337\n<e68ea0> 2682\n<e68ea1> 13127\n<e68ea2> 3600\n<e68ea3> 1245\n<e68ea4> 13128\n<e68ea5> 2212\n<e68ea6> 13129\n<e68ea7> 2405\n<e68ea8> 3703\n<e68ea9> 4099\n<e68eaa> 1390\n<e68eab> 13130\n<e68eac> 5326\n<e68ead> 5319\n<e68eae> 5329\n<e68eaf> 13131\n<e68eb0> 6480\n<e68eb3> 2647\n<e68eb4> 5324\n<e68eb7> 4543\n<e68eb8> 1416\n<e68eb9> 13136\n<e68eba> 1211\n<e68ebb> 13137\n<e68ebc> 5330\n<e68ebd> 13138\n<e68ebe> 5340\n<e68ebf> 13139\n<e68f80> 8077\n<e68f84> 5335\n<e68f85> 13143\n<e68f86> 5339\n<e68f89> 3259\n<e68f8d> 4670\n<e68f8e> 5337\n<e68f8f> 2797\n<e68f90> 3636\n<e68f91> 13149\n<e68f92> 1196\n<e68f96> 4165\n<e68f9a> 8703\n<e68f9e> 5336\n<e68f9f> 13159\n<e68fa0> 5333\n<e68fa1> 3812\n<e68fa2> 13160\n<e68fa3> 1322\n<e68fa9> 2360\n<e68faa> 2285\n<e68fad> 2211\n<e68fae> 8024\n<e68fb2> 5331\n<e68fb3> 13171\n<e68fb4> 4337\n<e68fb5> 13172\n<e68fb6> 5320\n<e68fb7> 13173\n<e68fb8> 5332\n<e68fbd> 2474\n<e68fbe> 13178\n<e68fbf> 5334\n<e69080> 1210\n<e69081> 1764\n<e69082> 2638\n<e69085> 2194\n<e6908b> 5343\n<e6908c> 5346\n<e6908d> 8539\n<e6908e> 13186\n<e6908f> 1138\n<e69090> 1319\n<e69093> 1389\n<e69094> 3295\n<e69097> 7862\n<e6909b> 5344\n<e6909c> 3526\n<e6909d> 13194\n<e6909e> 1758\n<e6909f> 13195\n<e690a0> 5345\n<e690a1> 5348\n<e690a6> 5347\n<e690aa> 3605\n<e690ab> 13203\n<e690ac> 1004\n<e690ad> 1393\n<e690b4> 5942\n<e690b5> 13210\nendcidchar\n\n100 begincidchar\n<e690b6> 8411\n<e690ba> 3962\n<e690bd> 1202\n<e690be> 13216\n<e690bf> 6481\n<e69180> 13217\n<e69181> 5342\n<e69184> 3356\n<e69185> 5341\n<e69186> 997\n<e69187> 4136\n<e69188> 1120\n<e69189> 13220\n<e6918a> 3586\n<e69191> 9056\n<e69192> 5338\n<e69193> 13227\n<e69194> 3481\n<e69198> 4427\n<e6919c> 9057\n<e6919d> 13234\n<e6919e> 5349\n<e6919f> 8256\n<e691a7> 1376\n<e691a8> 13242\n<e691a9> 2825\n<e691ad> 5351\n<e691ae> 13246\n<e691af> 8846\n<e691b3> 8159\n<e691b6> 9054\n<e691b7> 13252\n<e691ba> 5353\n<e691bb> 7786\n<e69282> 2581\n<e69283> 13259\n<e69284> 5350\n<e69285> 2334\n<e69286> 13260\n<e69287> 3025\n<e69288> 8194\n<e69291> 1258\n<e69292> 3281\n<e69293> 8339\n<e69294> 13269\n<e69295> 3503\n<e69296> 5352\n<e69299> 5356\n<e6929e> 4623\n<e6929f> 9055\n<e692a3> 7852\n<e692a4> 1244\n<e692a5> 7764\n<e692a9> 2572\n<e692aa> 13282\n<e692ab> 7944\n<e692ac> 3144\n<e692ad> 1132\n<e692ae> 1388\n<e692af> 13283\n<e692b0> 4616\n<e692b1> 13284\n<e692b2> 8384\n<e692b3> 9058\n<e692b4> 13285\n<e692b5> 2895\n<e692b6> 13286\n<e692b9> 13287\n<e692ba> 5357\n<e692bb> 8544\n<e692bc> 1898\n<e692bd> 13288\n<e692be> 8605\n<e692bf> 8078\n<e69380> 5358\n<e69381> 8749\n<e69382> 2505\n<e69383> 13289\n<e69384> 8263\n<e69385> 3324\n<e69386> 13290\n<e69387> 8802\n<e6938a> 8039\n<e6938b> 7858\n<e6938c> 13293\n<e6938d> 1184\n<e6938e> 3171\n<e6938f> 13294\n<e69390> 5359\n<e69391> 13295\n<e69392> 3161\n<e69393> 13296\n<e69394> 7849\n<e69397> 5360\n<e69398> 6482\n<e69399> 13299\n<e6939a> 8140\n<e6939e> 3528\n<e6939f> 13303\n<e693a0> 8050\nendcidchar\n\n100 begincidchar\n<e693a1> 13304\n<e693a2> 5362\n<e693a3> 13305\n<e693a4> 5361\n<e693a5> 13306\n<e693a6> 1160\n<e693ac> 8344\n<e693af> 7762\n<e693b0> 8356\n<e693b1> 7964\n<e693b2> 8847\n<e693b3> 13314\n<e693b4> 8173\n<e693b7> 9061\n<e693ba> 7725\n<e693bb> 8530\n<e693bc> 9062\n<e693bd> 13319\n<e693be> 8442\n<e693bf> 13320\n<e69480> 2955\n<e69484> 9059\n<e69485> 13324\n<e69486> 8346\n<e69489> 5363\n<e6948f> 8252\n<e69492> 4383\n<e69493> 13334\n<e69494> 8182\n<e69495> 13335\n<e69496> 9060\n<e69497> 13336\n<e69498> 3228\n<e69499> 7785\n<e6949a> 13337\n<e6949b> 9063\n<e6949c> 13338\n<e6949d> 8477\n<e694a2> 8793\n<e694a3> 8278\n<e694a4> 8547\n<e694a5> 5364\n<e694aa> 8105\n<e694ab> 2335\n<e694ac> 8188\n<e694ad> 13347\n<e694ae> 5365\n<e694af> 4518\n<e694b4> 6409\n<e694b5> 6502\n<e694b6> 3436\n<e694b7> 13352\n<e694b8> 4786\n<e694b9> 1727\n<e694ba> 13353\n<e694bb> 1790\n<e694be> 1634\n<e694bf> 4511\n<e69585> 1827\n<e69588> 3954\n<e69589> 7371\n<e6958c> 1457\n<e6958f> 2809\n<e69590> 13367\n<e69591> 2295\n<e69595> 6503\n<e69596> 968\n<e69597> 7726\n<e69598> 13371\n<e69599> 2205\n<e6959a> 13372\n<e6959b> 2555\n<e6959c> 13373\n<e6959d> 1087\n<e6959e> 1229\n<e695a2> 1741\n<e695a3> 3291\n<e695a6> 1559\n<e695ab> 6504\n<e695ac> 2275\n<e695b0> 3476\n<e695b1> 13386\n<e695b2> 3136\n<e695b3> 13387\n<e695b4> 4508\n<e695b5> 7868\n<e695b6> 13388\n<e695b7> 1680\n<e695b8> 8514\n<e69682> 8222\n<e69683> 7747\n<e69687> 3795\n<e6968b> 4428\n<e6968c> 1116\n<e69690> 6593\n<e69691> 1002\n<e69692> 13407\n<e69693> 6595\n<e69694> 13408\n<e69695> 9428\nendcidchar\n\n100 begincidchar\n<e69696> 13409\n<e69697> 1526\n<e69698> 13410\n<e69699> 2584\n<e6969a> 13411\n<e6969b> 7510\n<e6969c> 3964\n<e6969f> 4486\n<e696a0> 13414\n<e696a1> 3810\n<e696a4> 2240\n<e696a5> 1287\n<e696a6> 13417\n<e696a7> 1702\n<e696a8> 13418\n<e696a9> 4439\n<e696aa> 13419\n<e696ab> 6697\n<e696ac> 8815\n<e696ad> 1550\n<e696ae> 13420\n<e696af> 3502\n<e696b0> 3981\n<e696b7> 7895\n<e696b8> 13427\n<e696b9> 1626\n<e696bc> 6596\n<e696bd> 3392\n<e69780> 13432\n<e69781> 2965\n<e69782> 13433\n<e69783> 6599\n<e69784> 6598\n<e69785> 2666\n<e69786> 6597\n<e6978b> 4040\n<e6978c> 6600\n<e6978d> 13438\n<e6978e> 6601\n<e6978f> 4674\n<e69792> 6602\n<e69796> 6603\n<e69797> 3083\n<e697a0> 3821\n<e697a1> 13452\n<e697a2> 2107\n<e697a5> 3248\n<e697a6> 1418\n<e697a7> 2296\n<e697a8> 4539\n<e697a9> 4394\n<e697ac> 4055\n<e697ad> 4028\n<e697b1> 1900\n<e697b6> 3400\n<e697b7> 2434\n<e697ba> 3755\n<e69880> 6418\n<e69881> 13468\n<e69882> 965\n<e69883> 6416\n<e69886> 2448\n<e6988a> 6413\n<e6988b> 13474\n<e6988c> 1220\n<e6988d> 13475\n<e6988e> 2812\n<e6988f> 2045\n<e69893> 4190\n<e69894> 3843\n<e69895> 6417\n<e69899> 6414\n<e6989d> 6421\n<e6989e> 13485\n<e6989f> 3986\n<e698a0> 4248\n<e698a5> 1341\n<e698a6> 13490\n<e698a7> 2758\n<e698a8> 4687\n<e698ad> 4466\n<e698ae> 13495\n<e698af> 3422\n<e698b0> 13496\n<e698b1> 6423\n<e698b4> 6422\n<e698b5> 6425\n<e698b6> 6424\n<e698bc> 4582\n<e698bd> 13504\n<e698be> 3905\n<e698bf> 13505\n<e69980> 13506\n<e69981> 6429\n<e69982> 8493\n<e69983> 2019\n<e6998b> 2251\n<e6998c> 3335\n<e6998f> 6430\n<e69992> 3314\nendcidchar\n\n100 begincidchar\n<e69993> 3947\n<e69994> 6428\n<e69995> 4369\n<e69996> 6431\n<e69997> 6433\n<e6999a> 3742\n<e6999d> 8859\n<e6999e> 13522\n<e6999f> 6427\n<e699a0> 13523\n<e699a1> 6432\n<e699a4> 3837\n<e699a5> 13526\n<e699a6> 2035\n<e699a7> 13527\n<e699a8> 1252\n<e699ae> 3060\n<e699af> 2271\n<e699b0> 3849\n<e699b4> 3172\n<e699b5> 13536\n<e699b6> 2262\n<e699b7> 6434\n<e699ba> 4550\n<e699be> 2569\n<e699bf> 13542\n<e69a82> 4384\n<e69a83> 13545\n<e69a84> 6435\n<e69a87> 3883\n<e69a88> 8790\n<e69a89> 9384\n<e69a8c> 6436\n<e69a91> 3461\n<e69a96> 2928\n<e69a97> 960\n<e69a9d> 6438\n<e69aa2> 7801\n<e69aa7> 6437\n<e69aa8> 7389\n<e69aab> 8794\n<e69aae> 2845\n<e69ab4> 1042\n<e69ab9> 5979\n<e69abe> 6439\n<e69abf> 13588\n<e69b84> 9383\n<e69b85> 13593\n<e69b86> 9862\n<e69b87> 9382\n<e69b88> 13594\n<e69b89> 8654\n<e69b96> 9385\n<e69b99> 3462\n<e69b9a> 13609\n<e69b9d> 3063\n<e69ba0> 8167\n<e69ba6> 6442\n<e69ba9> 6443\n<e69bac> 8466\n<e69bb0> 4350\n<e69bb1> 13624\n<e69bb2> 3191\n<e69bb3> 4158\n<e69bb4> 1783\n<e69bb7> 6420\n<e69bb8> 8508\n<e69bb9> 1187\n<e69bbc> 2723\n<e69bbd> 13629\n<e69bbe> 4411\n<e69bbf> 3641\n<e69c80> 4683\n<e69c83> 8028\n<e69c88> 4357\n<e69c89> 4277\n<e69c8a> 6515\n<e69c8b> 2996\n<e69c8c> 13636\n<e69c8d> 1691\n<e69c90> 6532\n<e69c94> 3500\n<e69c95> 6542\n<e69c96> 13642\n<e69c97> 2485\n<e69c9b> 3756\n<e69c9c> 13646\n<e69c9d> 1236\n<e69c9e> 13647\n<e69c9f> 3065\n<e69ca6> 6572\n<e69ca7> 9412\n<e69ca8> 2849\n<e69ca9> 13654\n<e69caa> 3779\n<e69cab> 2828\n<e69cac> 1063\n<e69cad> 4416\n<e69cae> 13655\n<e69caf> 3468\nendcidchar\n\n100 begincidchar\n<e69cb0> 13656\n<e69cb1> 4587\n<e69cb4> 3058\n<e69cb5> 1571\n<e69cba> 2063\n<e69cbd> 4011\n<e69d80> 3306\n<e69d81> 13667\n<e69d82> 4374\n<e69d83> 3203\n<e69d86> 1734\n<e69d87> 13670\n<e69d88> 6228\n<e69d89> 3317\n<e69d8c> 6225\n<e69d8d> 13673\n<e69d8e> 2521\n<e69d8f> 3998\n<e69d90> 1163\n<e69d91> 1384\n<e69d92> 13674\n<e69d93> 6226\n<e69d96> 4457\n<e69d9c> 1540\n<e69d9d> 13682\n<e69d9e> 6227\n<e69d9f> 3471\n<e69da0> 1751\n<e69da1> 3656\n<e69da5> 2463\n<e69da8> 4119\n<e69da9> 6229\n<e69daa> 6232\n<e69dad> 1907\n<e69dae> 13690\n<e69daf> 1046\n<e69db0> 2221\n<e69db1> 7884\n<e69db2> 6415\n<e69db3> 6233\n<e69db4> 13691\n<e69db5> 6236\n<e69db6> 13692\n<e69db7> 6241\n<e69dbc> 6242\n<e69dbd> 13697\n<e69dbe> 3518\n<e69dbf> 1008\n<e69e80> 13698\n<e69e81> 2078\n<e69e84> 1810\n<e69e87> 6231\n<e69e88> 13703\n<e69e89> 3752\n<e69e8a> 13704\n<e69e8b> 6240\n<e69e90> 3845\n<e69e95> 4494\n<e69e96> 13713\n<e69e97> 2591\n<e69e98> 6234\n<e69e99> 13714\n<e69e9a> 2747\n<e69e9b> 13715\n<e69e9c> 1876\n<e69e9d> 4517\n<e69e9e> 6238\n<e69ea2> 3447\n<e69ea3> 4393\n<e69ea4> 13719\n<e69ea5> 6230\n<e69ea6> 13720\n<e69ea7> 6235\n<e69ea8> 6237\n<e69ea9> 13721\n<e69eaa> 3126\n<e69eab> 1664\n<e69eac> 13722\n<e69ead> 6239\n<e69eae> 13723\n<e69eaf> 2410\n<e69eb0> 6248\n<e69eb3> 6253\n<e69eb4> 13726\n<e69eb5> 6251\n<e69eb6> 2127\n<e69eb7> 2114\n<e69eb8> 6257\n<e69f80> 13734\n<e69f81> 6260\n<e69f82> 13735\n<e69f83> 6256\n<e69f84> 1123\n<e69f8f> 995\n<e69f90> 2838\n<e69f91> 1735\n<e69f92> 3073\n<e69f93> 3225\n<e69f94> 3260\n<e69f98> 6245\nendcidchar\n\n100 begincidchar\n<e69f99> 6250\n<e69f9a> 6252\n<e69f9b> 13749\n<e69f9c> 1866\n<e69f9d> 6254\n<e69f9e> 4690\n<e69f9f> 13750\n<e69fa0> 2910\n<e69fa1> 13751\n<e69fa2> 6258\n<e69fa5> 1200\n<e69fa9> 6247\n<e69fac> 2144\n<e69faf> 2383\n<e69fb0> 6243\n<e69fb1> 4600\n<e69fb2> 13761\n<e69fb3> 2625\n<e69fb4> 1208\n<e69fbd> 6261\n<e69fbe> 13770\n<e69fbf> 3416\n<e6a080> 6255\n<e6a085> 4421\n<e6a086> 13775\n<e6a087> 1107\n<e6a088> 4444\n<e6a089> 6244\n<e6a08a> 6246\n<e6a08b> 1519\n<e6a08c> 6249\n<e6a08d> 13776\n<e6a08e> 6259\n<e6a08f> 2467\n<e6a090> 13777\n<e6a091> 3470\n<e6a092> 13778\n<e6a093> 3485\n<e6a096> 3067\n<e6a097> 2528\n<e6a09d> 6271\n<e6a0a1> 3950\n<e6a0a9> 6280\n<e6a0aa> 4585\n<e6a0b7> 4130\n<e6a0b8> 1922\n<e6a0b9> 1780\n<e6a0bc> 1772\n<e6a0bd> 4375\n<e6a0be> 6277\n<e6a0bf> 13808\n<e6a180> 6276\n<e6a181> 6274\n<e6a182> 1865\n<e6a183> 3621\n<e6a184> 6268\n<e6a185> 3765\n<e6a186> 2431\n<e6a187> 13809\n<e6a188> 963\n<e6a189> 6279\n<e6a18a> 6278\n<e6a18b> 13810\n<e6a18c> 4637\n<e6a18d> 13811\n<e6a18e> 6266\n<e6a18f> 13812\n<e6a190> 3674\n<e6a191> 3292\n<e6a192> 13813\n<e6a193> 1997\n<e6a194> 2220\n<e6a195> 6272\n<e6a1a2> 6267\n<e6a1a3> 1430\n<e6a1a4> 6269\n<e6a1a5> 3138\n<e6a1a6> 6273\n<e6a1a7> 6275\n<e6a1a8> 2177\n<e6a1a9> 4619\n<e6a1aa> 13824\n<e6a1ab> 6286\n<e6a1b4> 6283\n<e6a1b5> 13833\n<e6a1b6> 3681\n<e6a1b7> 6284\n<e6a280> 13842\n<e6a281> 2563\n<e6a282> 13843\n<e6a283> 6270\n<e6a284> 13844\n<e6a285> 2748\n<e6a286> 1019\n<e6a28f> 6282\n<e6a293> 6285\n<e6a297> 1788\n<e6a298> 9322\n<e6a29d> 8565\n<e6a29e> 13863\nendcidchar\n\n100 begincidchar\n<e6a29f> 9325\n<e6a2a2> 3339\n<e6a2a6> 2771\n<e6a2a7> 3823\n<e6a2a8> 2513\n<e6a2ad> 3560\n<e6a2ae> 13873\n<e6a2af> 3632\n<e6a2b0> 3968\n<e6a2b3> 3448\n<e6a2b4> 13876\n<e6a2b5> 6281\n<e6a380> 2143\n<e6a381> 13887\n<e6a382> 6287\n<e6a389> 2787\n<e6a38a> 13894\n<e6a38b> 3076\n<e6a38c> 13895\n<e6a38d> 1872\n<e6a392> 1023\n<e6a395> 4661\n<e6a396> 9323\n<e6a397> 8799\n<e6a398> 2079\n<e6a399> 13902\n<e6a39a> 2992\n<e6a39f> 7886\n<e6a3a0> 3607\n<e6a3a3> 6298\n<e6a3a7> 8818\n<e6a3ae> 3302\n<e6a3af> 13918\n<e6a3b0> 6294\n<e6a3b1> 2509\n<e6a3b5> 2384\n<e6a3b9> 6292\n<e6a3ba> 1840\n<e6a3bb> 13925\n<e6a3bc> 6289\n<e6a480> 13929\n<e6a481> 6296\n<e6a485> 4181\n<e6a48b> 6295\n<e6a48c> 13938\n<e6a48d> 4529\n<e6a48e> 4626\n<e6a48f> 9331\n<e6a490> 6299\n<e6a491> 13939\n<e6a492> 2184\n<e6a4a4> 6293\n<e6a4ad> 3719\n<e6a4b0> 4147\n<e6a4b4> 6310\n<e6a4b9> 6301\n<e6a4bd> 1325\n<e6a4be> 13975\n<e6a4bf> 1342\n<e6a582> 6303\n<e6a58a> 8702\n<e6a593> 7934\n<e6a594> 3955\n<e6a597> 6297\n<e6a59a> 1315\n<e6a59d> 6304\n<e6a59e> 2510\n<e6a59f> 13999\n<e6a5a0> 6302\n<e6a5a3> 6317\n<e6a5a6> 6316\n<e6a5a7> 14004\n<e6a5a8> 9333\n<e6a5ab> 6306\n<e6a5ac> 14007\n<e6a5ad> 8714\n<e6a5ae> 6288\n<e6a5b1> 6300\n<e6a5b5> 8047\n<e6a5b6> 14013\n<e6a5b7> 2361\n<e6a5b8> 6309\n<e6a5b9> 6318\n<e6a5bc> 2636\n<e6a680> 6307\n<e6a681> 14019\n<e6a682> 1728\n<e6a683> 14020\n<e6a684> 6305\n<e6a685> 14021\n<e6a686> 4289\n<e6a689> 6315\n<e6a68d> 6331\n<e6a694> 2481\n<e6a695> 6329\n<e6a698> 6308\n<e6a69b> 6319\n<e6a69c> 1020\n<e6a6a7> 6320\n<e6a6a8> 4422\nendcidchar\n\n100 begincidchar\n<e6a6a9> 14045\n<e6a6aa> 9320\n<e6a6ab> 6322\n<e6a6ac> 14046\n<e6a6ad> 6323\n<e6a6ae> 8448\n<e6a6b1> 6325\n<e6a6b4> 2618\n<e6a6b7> 3217\n<e6a6bb> 6321\n<e6a6bf> 9334\n<e6a780> 14059\n<e6a781> 6326\n<e6a78a> 6327\n<e6a78b> 7975\n<e6a78c> 6311\n<e6a78d> 8407\n<e6a78e> 6314\n<e6a78f> 14068\n<e6a790> 1990\n<e6a794> 6324\n<e6a79b> 2154\n<e6a79f> 6328\n<e6a7a0> 6330\n<e6a7a7> 9340\n<e6a7ad> 6334\n<e6a7b2> 6338\n<e6a7b3> 8097\n<e6a7bd> 1186\n<e6a7be> 14105\n<e6a7bf> 6332\n<e6a880> 14106\n<e6a881> 8874\n<e6a882> 8197\n<e6a885> 9324\n<e6a88a> 1611\n<e6a893> 8254\n<e6a899> 7756\n<e6a89e> 8506\n<e6a89f> 4450\n<e6a8a0> 14128\n<e6a8a1> 2822\n<e6a8a2> 14129\n<e6a8a3> 8708\n<e6a8a8> 6348\n<e6a8a9> 14134\n<e6a8aa> 1944\n<e6a8af> 6333\n<e6a8b0> 14139\n<e6a8b1> 4232\n<e6a8b5> 6344\n<e6a8b8> 8387\n<e6a8b9> 8512\n<e6a8ba> 9335\n<e6a8bd> 6347\n<e6a8be> 6340\n<e6a8bf> 14147\n<e6a984> 6339\n<e6a987> 3134\n<e6a988> 9332\n<e6a98b> 8413\n<e6a990> 6342\n<e6a998> 6349\n<e6a999> 1261\n<e6a99a> 14167\n<e6a99b> 6343\n<e6a99f> 8040\n<e6a9a0> 14171\n<e6a9a1> 3933\n<e6a9a2> 8581\n<e6a9a5> 6337\n<e6a9b1> 1308\n<e6a9b9> 6346\n<e6a9bc> 6350\n<e6aa80> 3591\n<e6aa84> 3866\n<e6aa89> 9330\n<e6aa8e> 6345\n<e6aa8f> 14208\n<e6aa90> 6352\n<e6aa91> 6351\n<e6aa94> 7861\n<e6aa97> 6354\n<e6aa9c> 9336\n<e6aaa0> 6341\n<e6aaa1> 14220\n<e6aaa2> 8075\n<e6aaa3> 9348\n<e6aaa9> 6353\n<e6aaaa> 14226\n<e6aaab> 6355\n<e6aaac> 2767\n<e6aaaf> 9881\n<e6aab3> 9346\n<e6aab8> 8353\n<e6aabb> 8082\n<e6ab83> 7992\n<e6ab93> 9349\n<e6ab9a> 9344\n<e6ab9b> 9326\nendcidchar\n\n100 begincidchar\n<e6ab9c> 14266\n<e6ab9d> 9339\n<e6ab9e> 9350\n<e6ab9f> 9329\n<e6aba7> 9347\n<e6aba8> 9328\n<e6aba9> 14274\n<e6abaa> 9321\n<e6abab> 14275\n<e6abac> 9343\n<e6abb3> 9327\n<e6abb8> 9345\n<e6abbb> 8736\n<e6ac84> 8181\n<e6ac8a> 8436\n<e6ac8f> 9341\n<e6ac92> 9337\n<e6ac96> 9342\n<e6ac9e> 9338\n<e6ac9f> 14317\n<e6aca0> 3124\n<e6aca1> 1361\n<e6aca2> 1995\n<e6aca3> 3979\n<e6aca4> 6577\n<e6aca7> 2936\n<e6acb2> 4320\n<e6acb7> 6578\n<e6acb8> 14334\n<e6acb9> 6579\n<e6acba> 3066\n<e6acbd> 8419\n<e6acbe> 2427\n<e6acbf> 14337\n<e6ad83> 6580\n<e6ad86> 6581\n<e6ad87> 3957\n<e6ad88> 14343\n<e6ad89> 3125\n<e6ad8c> 1763\n<e6ad90> 8365\n<e6ad99> 6582\n<e6ad9f> 9419\n<e6ada0> 14362\n<e6ada1> 8019\n<e6ada2> 4536\n<e6ada3> 4510\n<e6ada4> 1358\n<e6ada5> 1156\n<e6ada6> 3827\n<e6ada7> 3078\n<e6adaa> 3730\n<e6adb2> 8537\n<e6adb7> 8211\n<e6adb8> 7987\n<e6adb9> 1400\n<e6adba> 14376\n<e6adbb> 3509\n<e6adbc> 2130\n<e6ae80> 14380\n<e6ae83> 4115\n<e6ae84> 6361\n<e6ae85> 14381\n<e6ae86> 1404\n<e6ae87> 6360\n<e6ae88> 14382\n<e6ae89> 4060\n<e6ae8a> 3449\n<e6ae8b> 1175\n<e6ae8c> 14383\n<e6ae8d> 6364\n<e6ae96> 4530\n<e6ae97> 14390\n<e6ae98> 7772\n<e6ae99> 14391\n<e6ae9e> 9352\n<e6aea1> 6367\n<e6aea4> 9351\n<e6aeaa> 6368\n<e6aeab> 9354\n<e6aeae> 9353\n<e6aeaf> 9355\n<e6aeb2> 8067\n<e6aeb3> 6589\n<e6aeb4> 2938\n<e6aeb5> 1549\n<e6aeb6> 14407\n<e6aeb7> 4218\n<e6aeba> 8463\n<e6aebb> 8155\n<e6aebf> 1487\n<e6af80> 14413\n<e6af81> 2030\n<e6af82> 6591\n<e6af85> 4202\n<e6af86> 8367\n<e6af8b> 3826\n<e6af8c> 14420\n<e6af8d> 2843\n<e6af8e> 14421\nendcidchar\n\n100 begincidchar\n<e6af8f> 2756\n<e6af92> 1533\n<e6af93> 4719\n<e6af94> 1073\n<e6af95> 1080\n<e6af96> 1082\n<e6af97> 3007\n<e6af98> 14424\n<e6af99> 1081\n<e6af9a> 14425\n<e6af9b> 2736\n<e6afa1> 4434\n<e6afaa> 6484\n<e6afab> 1912\n<e6afaf> 3597\n<e6afb3> 6485\n<e6afb4> 14445\n<e6afb5> 6487\n<e6afb9> 6488\n<e6afbd> 6486\n<e6afbe> 14452\n<e6afbf> 9408\n<e6b085> 6489\n<e6b086> 6491\n<e6b087> 6490\n<e6b088> 8813\n<e6b08c> 9409\n<e6b08d> 6492\n<e6b08e> 14461\n<e6b08f> 3430\n<e6b090> 4715\n<e6b091> 2806\n<e6b092> 14462\n<e6b093> 2730\n<e6b094> 3095\n<e6b095> 6493\n<e6b096> 2861\n<e6b097> 14463\n<e6b09b> 1650\n<e6b09f> 1687\n<e6b0a0> 14467\n<e6b0a1> 6497\n<e6b0a2> 3167\n<e6b0a3> 8394\n<e6b0a4> 6499\n<e6b0a5> 14468\n<e6b0a6> 1883\n<e6b0a7> 4126\n<e6b0a8> 956\n<e6b0a9> 6498\n<e6b0aa> 6500\n<e6b0ab> 8423\n<e6b0ac> 9410\n<e6b0ad> 14469\n<e6b0ae> 1419\n<e6b0af> 2671\n<e6b0b0> 3173\n<e6b0b1> 14470\n<e6b0b2> 6501\n<e6b0b3> 14471\n<e6b0b4> 3491\n<e6b0b5> 5791\n<e6b0b8> 4261\n<e6b0bd> 4847\n<e6b180> 3666\n<e6b181> 4524\n<e6b182> 3184\n<e6b186> 4852\n<e6b187> 2040\n<e6b188> 14483\n<e6b189> 1905\n<e6b18a> 5794\n<e6b190> 3864\n<e6b194> 5792\n<e6b195> 3328\n<e6b196> 14492\n<e6b197> 1904\n<e6b19b> 4061\n<e6b19c> 5793\n<e6b19d> 3269\n<e6b19e> 1800\n<e6b19f> 2174\n<e6b1a0> 1277\n<e6b1a1> 3818\n<e6b1a4> 3603\n<e6b1aa> 3749\n<e6b1b0> 3584\n<e6b1b1> 14506\n<e6b1b2> 2086\n<e6b1b3> 14507\n<e6b1b4> 5802\n<e6b1b5> 14508\n<e6b1b6> 5803\n<e6b1b9> 4005\n<e6b1bd> 3098\n<e6b1be> 1655\n<e6b1bf> 14514\n<e6b280> 14515\n<e6b281> 3164\n<e6b282> 4177\nendcidchar\n\n100 begincidchar\n<e6b283> 3813\n<e6b284> 14516\n<e6b285> 5796\n<e6b286> 5804\n<e6b287> 14517\n<e6b288> 3371\n<e6b289> 1254\n<e6b28c> 5799\n<e6b28f> 3074\n<e6b290> 5797\n<e6b293> 6687\n<e6b294> 5798\n<e6b299> 3308\n<e6b29a> 14528\n<e6b29b> 2983\n<e6b29f> 1806\n<e6b2a0> 14532\n<e6b2a1> 2752\n<e6b2a2> 14533\n<e6b2a3> 5795\n<e6b2a4> 2942\n<e6b2a5> 2541\n<e6b2a6> 2688\n<e6b2a7> 1182\n<e6b2a8> 14534\n<e6b2a9> 5805\n<e6b2aa> 1979\n<e6b2ab> 2832\n<e6b2ac> 14535\n<e6b2ad> 5808\n<e6b2ae> 2313\n<e6b2b1> 5819\n<e6b2b2> 5813\n<e6b2b3> 1930\n<e6b2b8> 1645\n<e6b2b9> 4274\n<e6b2ba> 14542\n<e6b2bb> 4557\n<e6b2bc> 4468\n<e6b2bd> 1818\n<e6b2be> 4437\n<e6b2bf> 4097\n<e6b384> 3972\n<e6b385> 3187\n<e6b389> 3205\n<e6b38a> 1147\n<e6b38b> 14550\n<e6b38c> 2783\n<e6b390> 5806\n<e6b393> 5820\n<e6b394> 5807\n<e6b395> 1605\n<e6b396> 5815\n<e6b397> 5812\n<e6b39b> 1623\n<e6b39e> 2915\n<e6b39f> 14561\n<e6b3a0> 5814\n<e6b3a1> 2974\n<e6b3a2> 1135\n<e6b3a3> 3099\n<e6b3a4> 14562\n<e6b3a5> 2883\n<e6b3a8> 4607\n<e6b3a9> 14565\n<e6b3aa> 2508\n<e6b3ab> 5817\n<e6b3ae> 5818\n<e6b3af> 5821\n<e6b3b0> 3580\n<e6b3b1> 5811\n<e6b3b2> 14568\n<e6b3b3> 4259\n<e6b3b4> 14569\n<e6b3b5> 1068\n<e6b3b6> 6688\n<e6b3b9> 14570\n<e6b3ba> 5816\n<e6b3bb> 3973\n<e6b3bc> 3042\n<e6b3bd> 4406\n<e6b3be> 5822\n<e6b3bf> 14571\n<e6b480> 14572\n<e6b481> 2225\n<e6b484> 5829\n<e6b487> 5828\n<e6b48b> 4124\n<e6b48c> 5825\n<e6b48d> 14580\n<e6b48e> 5831\n<e6b492> 3282\n<e6b497> 3873\n<e6b498> 14588\n<e6b499> 5830\n<e6b49a> 5836\n<e6b49b> 2700\n<e6b49e> 1523\n<e6b4a5> 2243\n<e6b4a6> 14597\nendcidchar\n\n100 begincidchar\n<e6b4a7> 5824\n<e6b4aa> 1952\n<e6b4ab> 5832\n<e6b4ae> 5834\n<e6b4b1> 1596\n<e6b4b2> 4573\n<e6b4b3> 5840\n<e6b4b4> 14604\n<e6b4b5> 5835\n<e6b4b9> 5823\n<e6b4ba> 14608\n<e6b4bb> 2051\n<e6b4bc> 3726\n<e6b4bd> 3103\n<e6b4be> 2954\n<e6b4bf> 14609\n<e6b580> 14610\n<e6b581> 2624\n<e6b582> 14611\n<e6b583> 5826\n<e6b584> 14612\n<e6b585> 3120\n<e6b586> 2173\n<e6b587> 2190\n<e6b588> 5827\n<e6b589> 14613\n<e6b58a> 4644\n<e6b58b> 1193\n<e6b58c> 14614\n<e6b58d> 5833\n<e6b58e> 2102\n<e6b58f> 5837\n<e6b590> 14615\n<e6b591> 2048\n<e6b592> 5838\n<e6b593> 2921\n<e6b594> 5839\n<e6b599> 4484\n<e6b59a> 2352\n<e6b59b> 14620\n<e6b59c> 5848\n<e6b59d> 14621\n<e6b59e> 5845\n<e6b59f> 14622\n<e6b5a0> 5849\n<e6b5a3> 5851\n<e6b5a6> 3061\n<e6b5a9> 1917\n<e6b5aa> 2486\n<e6b5ae> 1692\n<e6b5af> 5842\n<e6b5b4> 4324\n<e6b5b7> 1882\n<e6b5b8> 2255\n<e6b5b9> 9180\n<e6b5bc> 5850\n<e6b682> 3696\n<e6b685> 2908\n<e6b686> 14647\n<e6b687> 9179\n<e6b688> 3944\n<e6b689> 3359\n<e6b68c> 4260\n<e6b68d> 14650\n<e6b68e> 3902\n<e6b691> 5841\n<e6b692> 14653\n<e6b695> 3644\n<e6b69b> 3617\n<e6b69c> 14659\n<e6b69d> 2495\n<e6b69e> 5843\n<e6b69f> 2553\n<e6b6a0> 5844\n<e6b6a1> 3807\n<e6b6a2> 14660\n<e6b6a3> 2006\n<e6b6a4> 1460\n<e6b6a5> 14661\n<e6b6a6> 3278\n<e6b6a7> 2168\n<e6b6a8> 4456\n<e6b6a9> 3301\n<e6b6aa> 1693\n<e6b6ab> 5864\n<e6b6ae> 5866\n<e6b6af> 4077\n<e6b6b2> 4161\n<e6b6b5> 1892\n<e6b6b8> 1931\n<e6b6bf> 5857\n<e6b780> 1486\n<e6b784> 4650\n<e6b785> 5854\n<e6b786> 3946\n<e6b787> 5853\n<e6b78b> 2597\n<e6b78c> 3613\n<e6b791> 3454\n<e6b796> 2874\nendcidchar\n\n100 begincidchar\n<e6b797> 14690\n<e6b798> 3623\n<e6b799> 5862\n<e6b79d> 5861\n<e6b79e> 5855\n<e6b79f> 14694\n<e6b7a0> 5858\n<e6b7a1> 1422\n<e6b7a4> 4286\n<e6b7a5> 14697\n<e6b7a6> 5860\n<e6b7aa> 8286\n<e6b7ab> 4224\n<e6b7ac> 1382\n<e6b7ad> 14701\n<e6b7ae> 1993\n<e6b7b1> 3367\n<e6b7b2> 14704\n<e6b7b3> 1345\n<e6b7b4> 14705\n<e6b7b5> 8772\n<e6b7b6> 9186\n<e6b7b7> 2049\n<e6b7b8> 14706\n<e6b7b9> 4086\n<e6b7ba> 8404\n<e6b7bb> 3648\n<e6b7bc> 6689\n<e6b885> 3170\n<e6b88a> 4331\n<e6b88b> 14719\n<e6b88c> 5865\n<e6b88d> 4658\n<e6b88e> 5856\n<e6b88f> 14720\n<e6b890> 2166\n<e6b891> 5859\n<e6b894> 4299\n<e6b895> 14723\n<e6b896> 5863\n<e6b897> 3377\n<e6b89a> 5852\n<e6b89d> 4298\n<e6b8a0> 3195\n<e6b8a1> 1544\n<e6b8a2> 14730\n<e6b8a3> 4415\n<e6b8a4> 1146\n<e6b8a5> 5877\n<e6b8a6> 8607\n<e6b8a9> 3793\n<e6b8aa> 14733\n<e6b8ab> 5867\n<e6b8ac> 7782\n<e6b8ad> 3787\n<e6b8ae> 14734\n<e6b8af> 1750\n<e6b8b2> 5876\n<e6b8b3> 14737\n<e6b8b4> 2391\n<e6b8b8> 4275\n<e6b8b9> 14741\n<e6b8ba> 2801\n<e6b8be> 8035\n<e6b8bf> 14745\n<e6b983> 2953\n<e6b984> 5878\n<e6b98d> 3701\n<e6b98e> 5869\n<e6b995> 14761\n<e6b996> 1973\n<e6b997> 14762\n<e6b998> 3923\n<e6b99b> 4448\n<e6b99e> 9181\n<e6b99f> 5872\n<e6b9ab> 5870\n<e6b9ae> 5868\n<e6b9af> 8555\n<e6b9be> 3734\n<e6b9bf> 3393\n<e6ba83> 2446\n<e6ba84> 14797\n<e6ba85> 2167\n<e6ba86> 5873\n<e6ba89> 1731\n<e6ba8f> 5893\n<e6ba90> 4343\n<e6ba96> 8885\n<e6ba97> 14810\n<e6ba98> 5881\n<e6ba9c> 2616\n<e6ba9d> 7974\n<e6ba9e> 14814\n<e6ba9f> 5895\n<e6baa2> 4206\n<e6baa5> 5885\n<e6baa6> 14819\n<e6baa7> 5886\n<e6baaa> 3863\nendcidchar\n\n100 begincidchar\n<e6baaf> 3538\n<e6bab0> 14826\n<e6bab1> 5880\n<e6bab2> 5871\n<e6bab3> 14827\n<e6bab4> 5891\n<e6bab5> 14828\n<e6bab6> 3255\n<e6bab7> 5889\n<e6baba> 2890\n<e6babb> 5888\n<e6babc> 14831\n<e6babd> 5887\n<e6bb80> 14834\n<e6bb81> 1313\n<e6bb82> 5894\n<e6bb83> 14835\n<e6bb84> 7779\n<e6bb85> 8328\n<e6bb86> 14836\n<e6bb87> 1474\n<e6bb8b> 4649\n<e6bb8c> 7869\n<e6bb8d> 14840\n<e6bb8e> 9025\n<e6bb8f> 5892\n<e6bb90> 14841\n<e6bb91> 1985\n<e6bb92> 14842\n<e6bb93> 4655\n<e6bb94> 3618\n<e6bb95> 6568\n<e6bb96> 14843\n<e6bb97> 5890\n<e6bb9a> 1871\n<e6bb9e> 4556\n<e6bb9f> 5879\n<e6bba0> 5882\n<e6bba1> 2721\n<e6bba2> 5884\n<e6bba3> 14849\n<e6bba4> 2674\n<e6bba5> 2479\n<e6bba6> 2679\n<e6bba7> 14850\n<e6bba8> 1118\n<e6bba9> 3589\n<e6bbac> 8011\n<e6bbaf> 8850\n<e6bbb2> 8484\n<e6bbb3> 14857\n<e6bbb4> 1455\n<e6bbb7> 8264\n<e6bbb8> 9184\n<e6bbb9> 5901\n<e6bbbf> 8311\n<e6bc80> 14865\n<e6bc81> 8762\n<e6bc82> 3022\n<e6bc86> 3072\n<e6bc89> 5907\n<e6bc8f> 2640\n<e6bc93> 2519\n<e6bc94> 4102\n<e6bc95> 5900\n<e6bc9a> 8369\n<e6bca0> 2833\n<e6bca1> 14888\n<e6bca2> 8001\n<e6bca3> 8220\n<e6bca4> 5899\n<e6bca9> 5908\n<e6bcaa> 5906\n<e6bcab> 2725\n<e6bcac> 8888\n<e6bcad> 5883\n<e6bcae> 14893\n<e6bcaf> 5902\n<e6bcb0> 14894\n<e6bcb1> 3477\n<e6bcb2> 8822\n<e6bcb3> 4453\n<e6bcb6> 5903\n<e6bcb7> 14897\n<e6bcb8> 8091\n<e6bcbe> 4131\n<e6bcbf> 8095\n<e6bd80> 14903\n<e6bd81> 9674\n<e6bd8b> 5904\n<e6bd8c> 14911\n<e6bd8d> 3770\n<e6bd91> 8382\n<e6bd94> 8116\n<e6bd98> 2956\n<e6bd99> 9175\n<e6bd9c> 3118\n<e6bd9d> 14922\n<e6bd9e> 2657\n<e6bda2> 5896\nendcidchar\n\n100 begincidchar\n<e6bda3> 14926\n<e6bda4> 8453\n<e6bda5> 14927\n<e6bda6> 2579\n<e6bdad> 3593\n<e6bdae> 1238\n<e6bdaf> 9185\n<e6bdb0> 8172\n<e6bdb1> 14934\n<e6bdb2> 5913\n<e6bdb3> 14935\n<e6bdb4> 5905\n<e6bdb7> 9194\n<e6bdb8> 5912\n<e6bdb9> 14938\n<e6bdba> 5915\n<e6bdbb> 14939\n<e6bdbc> 5914\n<e6bdbf> 9187\n<e6be80> 8462\n<e6be84> 1267\n<e6be85> 14945\n<e6be86> 8102\n<e6be87> 8196\n<e6be88> 1247\n<e6be89> 5909\n<e6be8c> 5911\n<e6be8d> 5910\n<e6be8e> 2989\n<e6be97> 8093\n<e6be9c> 2472\n<e6bea0> 9189\n<e6bea1> 4395\n<e6bea4> 8804\n<e6bea7> 5918\n<e6bea8> 14967\n<e6bea9> 9442\n<e6beae> 9182\n<e6beb1> 7876\n<e6beb2> 14974\n<e6beb3> 975\n<e6beb6> 5920\n<e6beb9> 5919\n<e6bf80> 2071\n<e6bf81> 8886\n<e6bf82> 5921\n<e6bf83> 8361\n<e6bf89> 5917\n<e6bf91> 5916\n<e6bf92> 1117\n<e6bf95> 8491\n<e6bf98> 8357\n<e6bf9b> 9867\n<e6bf9e> 5924\n<e6bf9f> 8054\n<e6bfa0> 5925\n<e6bfa1> 5922\n<e6bfa4> 8557\n<e6bfab> 8193\n<e6bfae> 5923\n<e6bfaf> 5926\n<e6bfb0> 8593\n<e6bfb1> 7760\n<e6bfba> 8092\n<e6bfbb> 15023\n<e6bfbc> 9178\n<e6bfbd> 15024\n<e6bfbe> 8275\n<e6bfbf> 15025\n<e78085> 9193\n<e78086> 9188\n<e78089> 8661\n<e7808a> 15033\n<e7808b> 9190\n<e7808f> 9183\n<e78090> 15037\n<e78091> 3064\n<e78095> 7759\n<e78098> 9177\n<e78099> 15043\n<e7809a> 5927\n<e7809b> 5929\n<e7809c> 15044\n<e7809d> 8212\n<e7809e> 15045\n<e7809f> 9196\n<e780a0> 9195\n<e780a3> 5928\n<e780a7> 9176\n<e780a8> 9198\n<e780b0> 9870\n<e780b1> 15058\n<e780b2> 9197\n<e780b5> 5931\n<e780b9> 5930\n<e780be> 8186\n<e780bf> 15068\n<e78183> 9174\n<e78184> 9192\n<e7818c> 1849\nendcidchar\n\n100 begincidchar\n<e7818f> 5932\n<e78190> 15081\n<e78191> 8454\n<e78195> 8203\n<e78198> 8550\n<e7819d> 9199\n<e7819e> 5933\n<e781a3> 8585\n<e781a4> 8280\n<e781a7> 9191\n<e781ab> 2053\n<e781ac> 6639\n<e781ad> 2805\n<e781ae> 15100\n<e781af> 1447\n<e781b0> 2023\n<e781b5> 2610\n<e781b6> 4401\n<e781b7> 15105\n<e781b8> 2291\n<e781bc> 4643\n<e781bd> 15109\n<e781be> 4377\n<e781bf> 1178\n<e78280> 6604\n<e78285> 6419\n<e78289> 2646\n<e7828a> 1337\n<e7828e> 4096\n<e78292> 1241\n<e78293> 15123\n<e78294> 3213\n<e78295> 2376\n<e78296> 6606\n<e78299> 4554\n<e7829c> 6605\n<e7829d> 6607\n<e782ab> 6611\n<e782ac> 2325\n<e782ad> 3602\n<e782ae> 2971\n<e782af> 2283\n<e782b0> 15141\n<e782b1> 6612\n<e782b2> 15142\n<e782b3> 1127\n<e782b7> 6610\n<e782b8> 4425\n<e782b9> 1476\n<e782ba> 15146\n<e782bb> 6608\n<e782bc> 2559\n<e782bd> 1288\n<e78380> 6609\n<e78381> 3501\n<e78382> 2478\n<e78383> 3665\n<e78388> 2587\n<e78389> 15153\n<e7838a> 6614\n<e7838f> 8611\n<e78398> 1949\n<e78399> 2494\n<e7839a> 15166\n<e7839b> 4593\n<e7839f> 4085\n<e783a4> 2379\n<e783a5> 15174\n<e783a6> 1616\n<e783a7> 3342\n<e783a8> 6613\n<e783a9> 2039\n<e783aa> 15175\n<e783ab> 3615\n<e783ac> 2254\n<e783ad> 3235\n<e783ae> 15176\n<e783af> 3862\n<e783b4> 8570\n<e783b7> 3738\n<e783b8> 15183\n<e783b9> 2988\n<e783bd> 1670\n<e78489> 4082\n<e7848a> 1903\n<e78490> 6615\n<e78493> 6616\n<e78494> 15205\n<e78495> 2005\n<e78496> 6617\n<e78497> 15206\n<e78498> 6640\n<e78499> 1059\n<e7849a> 1654\n<e784a1> 8613\n<e784a6> 2186\n<e784af> 6618\n<e784b0> 4111\n<e784b1> 6619\n<e784b6> 3222\nendcidchar\n\n100 begincidchar\n<e78585> 6623\n<e78589> 8226\n<e7858a> 6625\n<e7858b> 15246\n<e7858c> 2018\n<e7858d> 15247\n<e7858e> 2136\n<e78592> 9430\n<e7859c> 6621\n<e7859d> 15260\n<e7859e> 3312\n<e785a2> 9018\n<e785a3> 15264\n<e785a4> 2751\n<e785a5> 15265\n<e785a6> 6641\n<e785a7> 4470\n<e785a8> 6622\n<e785a9> 7918\n<e785ac> 9429\n<e785ad> 15268\n<e785ae> 4594\n<e785b2> 6624\n<e785b3> 6620\n<e785b8> 6626\n<e785b9> 15276\n<e785ba> 6627\n<e785bd> 3320\n<e78684> 3861\n<e7868a> 4007\n<e7868f> 4053\n<e78692> 8744\n<e78693> 15296\n<e78694> 3254\n<e78697> 9431\n<e78698> 6628\n<e78699> 3844\n<e7869f> 3459\n<e786a0> 6632\n<e786a8> 6631\n<e786ac> 969\n<e786b1> 8444\n<e786b2> 15318\n<e786b3> 6629\n<e786b4> 15319\n<e786b5> 6630\n<e786b9> 6642\n<e786be> 7815\n<e786bf> 15327\n<e78780> 15328\n<e78781> 9432\n<e78782> 15329\n<e78783> 3223\n<e78788> 7866\n<e7878e> 2576\n<e78792> 8473\n<e78793> 15342\n<e78794> 6634\n<e78795> 4105\n<e78799> 8556\n<e7879c> 9433\n<e7879f> 8743\n<e787a0> 6633\n<e787a5> 4402\n<e787a6> 7775\n<e787a7> 6635\n<e787ad> 8863\n<e787ae> 5014\n<e787b4> 8029\n<e787b9> 6636\n<e787bc> 8124\n<e787bd> 15370\n<e787be> 9434\n<e787bf> 15371\n<e78886> 1045\n<e7888d> 8521\n<e78890> 8262\n<e7889b> 8192\n<e7889c> 15396\n<e7889d> 6637\n<e788a8> 6638\n<e788a9> 15407\n<e788aa> 4611\n<e788ab> 15408\n<e788ac> 2945\n<e788b0> 6508\n<e788b1> 953\n<e788b2> 8592\n<e788b5> 2339\n<e788b6> 1715\n<e788b7> 4150\n<e788b8> 993\n<e788b9> 1498\n<e788ba> 8712\n<e788bb> 4713\n<e788bc> 15414\n<e788bd> 3489\n<e788be> 7910\n<e788bf> 5789\n<e78987> 3019\nendcidchar\n\n100 begincidchar\n<e78988> 1009\n<e7898c> 2951\n<e7898d> 6505\n<e78992> 6506\n<e78996> 6507\n<e78997> 15432\n<e78998> 9411\n<e78999> 4073\n<e7899a> 15433\n<e7899b> 2916\n<e7899c> 15434\n<e7899d> 6468\n<e7899e> 15435\n<e7899f> 2837\n<e789a0> 15436\n<e789a1> 2840\n<e789a2> 2489\n<e789a6> 6469\n<e789a7> 2852\n<e789a8> 15440\n<e789a9> 3838\n<e789ae> 6466\n<e789af> 6470\n<e789b2> 3381\n<e789b5> 3104\n<e789b9> 3627\n<e789ba> 3853\n<e789bd> 8396\n<e78a80> 3865\n<e78a81> 2514\n<e78a84> 6473\n<e78a8a> 1534\n<e78a8b> 6474\n<e78a8c> 15461\n<e78a8d> 6475\n<e78a8e> 15462\n<e78a8f> 6476\n<e78a92> 6477\n<e78a96> 9024\n<e78a9f> 6467\n<e78aa2> 7889\n<e78aa7> 8620\n<e78aac> 3209\n<e78aad> 5615\n<e78aae> 15486\n<e78aaf> 1621\n<e78ab0> 5616\n<e78ab4> 5617\n<e78ab5> 15490\n<e78ab6> 4625\n<e78ab9> 4273\n<e78b80> 8879\n<e78b81> 5621\n<e78b82> 2430\n<e78b83> 5620\n<e78b84> 1459\n<e78b88> 1056\n<e78b8d> 5623\n<e78b8e> 5622\n<e78b8f> 15504\n<e78b90> 1971\n<e78b91> 15505\n<e78b92> 5624\n<e78b97> 1808\n<e78b98> 15510\n<e78b99> 2304\n<e78b9e> 2911\n<e78b9f> 15515\n<e78ba0> 1940\n<e78ba1> 2199\n<e78ba8> 5625\n<e78ba9> 5627\n<e78bac> 1535\n<e78bad> 3886\n<e78bae> 3391\n<e78baf> 5626\n<e78bb0> 4505\n<e78bb1> 4321\n<e78bb2> 5628\n<e78bb3> 5632\n<e78bb4> 5629\n<e78bb7> 5630\n<e78bb8> 2517\n<e78bb9> 8630\n<e78bbc> 2482\n<e78bbd> 7741\n<e78c80> 15528\n<e78c81> 5631\n<e78c82> 15529\n<e78c83> 5633\n<e78c8a> 5639\n<e78c8e> 2589\n<e78c93> 5637\n<e78c94> 15543\n<e78c95> 5642\n<e78c96> 1221\n<e78c97> 5636\n<e78c9b> 2770\n<e78c9c> 1161\n<e78c9d> 5641\nendcidchar\n\n100 begincidchar\n<e78c9e> 5640\n<e78ca1> 5638\n<e78ca2> 5643\n<e78ca5> 5645\n<e78ca9> 3988\n<e78caa> 4588\n<e78cab> 2733\n<e78cac> 5646\n<e78cad> 15554\n<e78cae> 3908\n<e78cb1> 5648\n<e78cb4> 1958\n<e78cb5> 15559\n<e78cb6> 8757\n<e78cb7> 6356\n<e78cb8> 5647\n<e78cb9> 5644\n<e78cba> 15560\n<e78cbb> 9111\n<e78cbe> 1984\n<e78cbf> 4342\n<e78d80> 15563\n<e78d81> 9109\n<e78d84> 8767\n<e78d85> 8490\n<e78d8d> 5650\n<e78d90> 5649\n<e78d91> 15575\n<e78d92> 6357\n<e78d97> 5651\n<e78da0> 5652\n<e78da8> 7890\n<e78da9> 15595\n<e78daa> 9110\n<e78dab> 9112\n<e78dac> 5653\n<e78dad> 3572\n<e78dae> 15596\n<e78daf> 5654\n<e78db0> 8354\n<e78db1> 15597\n<e78db2> 8036\n<e78db5> 8235\n<e78db6> 15600\n<e78db7> 9108\n<e78db8> 8505\n<e78db9> 15601\n<e78dba> 8543\n<e78dbb> 8641\n<e78dbc> 9114\n<e78dbd> 15602\n<e78dbe> 5655\n<e78dbf> 15603\n<e78e80> 9113\n<e78e84> 4041\n<e78e87> 2673\n<e78e88> 15609\n<e78e89> 4310\n<e78e8a> 15610\n<e78e8b> 3750\n<e78e8e> 6168\n<e78e91> 6169\n<e78e96> 2288\n<e78e9b> 2705\n<e78e9f> 6172\n<e78ea2> 6171\n<e78ea9> 3735\n<e78eaa> 15634\n<e78eab> 2746\n<e78eae> 6170\n<e78eaf> 1996\n<e78eb0> 3907\n<e78eb1> 15637\n<e78eb2> 2602\n<e78eb3> 6177\n<e78eb7> 6176\n<e78eba> 6188\n<e78ebb> 1130\n<e78f80> 6178\n<e78f81> 15647\n<e78f82> 6174\n<e78f88> 6180\n<e78f89> 6179\n<e78f8a> 3315\n<e78f8d> 4485\n<e78f8e> 15655\n<e78f8f> 6173\n<e78f90> 1606\n<e78f91> 6175\n<e78f99> 6182\n<e78f9e> 6187\n<e78f9f> 15667\n<e78fa0> 4584\n<e78fa5> 6181\n<e78fa6> 15672\n<e78fa7> 6186\n<e78fa8> 15673\n<e78fa9> 6185\n<e78fad> 1003\n<e78fb2> 6189\nendcidchar\n\n100 begincidchar\n<e78fbe> 8640\n<e78fbf> 15692\n<e79083> 3183\n<e79084> 15696\n<e79085> 2480\n<e79086> 2520\n<e79089> 2617\n<e7908a> 6184\n<e7908f> 6190\n<e79090> 3563\n<e7909a> 6200\n<e7909b> 6199\n<e790a2> 4638\n<e790a5> 6194\n<e790a6> 6193\n<e790a7> 15720\n<e790a8> 6195\n<e790a9> 15721\n<e790aa> 6191\n<e790ab> 15722\n<e790ac> 6198\n<e790ad> 15723\n<e790ae> 6197\n<e790af> 15724\n<e790b0> 6196\n<e790b3> 2590\n<e790b4> 3158\n<e790b5> 3006\n<e790b6> 2948\n<e790bc> 3178\n<e790bf> 9312\n<e79180> 15734\n<e79181> 6201\n<e7918b> 9308\n<e79195> 6204\n<e79196> 15753\n<e79197> 6203\n<e79198> 15754\n<e79199> 6205\n<e7919a> 1966\n<e7919b> 6192\n<e7919c> 6202\n<e7919d> 15755\n<e7919e> 3275\n<e7919f> 3299\n<e791a3> 8541\n<e791a9> 8741\n<e791aa> 8298\n<e791ad> 6207\n<e791b0> 1854\n<e791b6> 4135\n<e791b7> 6206\n<e791be> 6208\n<e791bf> 15779\n<e79282> 15780\n<e79283> 2544\n<e79287> 6213\n<e79288> 15784\n<e79289> 9313\n<e7928a> 15785\n<e7928b> 6214\n<e7928e> 6210\n<e7928f> 15788\n<e79290> 6218\n<e7929c> 6209\n<e7929d> 15800\n<e7929e> 6215\n<e792a3> 9307\n<e792a6> 9314\n<e792a7> 6219\n<e792b0> 8020\n<e792ba> 6221\n<e792bd> 9311\n<e7938a> 8428\n<e7938f> 9309\n<e79392> 6220\n<e79393> 15842\n<e79394> 9315\n<e7939a> 9316\n<e7939b> 15848\n<e7939c> 1832\n<e7939d> 15849\n<e7939e> 6962\n<e7939f> 15850\n<e793a0> 6963\n<e793a1> 15851\n<e793a2> 3023\n<e793a3> 1013\n<e793a4> 3226\n<e793a5> 15852\n<e793a6> 3728\n<e793ae> 3804\n<e793af> 6403\n<e793b4> 6404\n<e793b5> 15864\n<e793b6> 3038\n<e793b7> 1356\n<e793bf> 6405\n<e79484> 4488\n<e7948c> 9381\nendcidchar\n\n100 begincidchar\n<e7948d> 5253\n<e7948e> 15883\n<e7948f> 6406\n<e79490> 15884\n<e79491> 6407\n<e79492> 15885\n<e79493> 6408\n<e79498> 1733\n<e79499> 5368\n<e7949a> 3374\n<e7949b> 15890\n<e7949c> 3651\n<e7949f> 3379\n<e794a3> 7792\n<e794a4> 15896\n<e794a5> 3380\n<e794a8> 4264\n<e794a9> 3483\n<e794aa> 15899\n<e794ab> 1697\n<e794ac> 6964\n<e794ad> 1067\n<e794ae> 15900\n<e794af> 5940\n<e794b0> 3650\n<e794b1> 4270\n<e794b2> 2122\n<e794b3> 3363\n<e794b4> 15901\n<e794b5> 1480\n<e794b6> 15902\n<e794b7> 2867\n<e794b8> 1482\n<e794b9> 15903\n<e794ba> 6776\n<e794bb> 1986\n<e794be> 6166\n<e794bf> 15906\n<e79580> 6777\n<e79585> 1230\n<e79588> 6780\n<e7958b> 6779\n<e7958c> 2232\n<e7958d> 15915\n<e7958e> 6778\n<e7958f> 3782\n<e79594> 2960\n<e79599> 2621\n<e7959a> 5022\n<e7959b> 6781\n<e7959c> 4030\n<e7959d> 8335\n<e795a2> 7746\n<e795a5> 2683\n<e795a6> 3079\n<e795aa> 1609\n<e795ab> 8014\n<e795b2> 6782\n<e795b3> 15939\n<e795b4> 1296\n<e795b5> 15940\n<e795b6> 7857\n<e795b7> 15941\n<e795b8> 2064\n<e795b9> 6783\n<e795bf> 6164\n<e79683> 6784\n<e79686> 2175\n<e79687> 7819\n<e7968b> 7110\n<e7968f> 3455\n<e79690> 15958\n<e79691> 4176\n<e79692> 7008\n<e79693> 15959\n<e79694> 7009\n<e79695> 15960\n<e79696> 7010\n<e79697> 2575\n<e79698> 15961\n<e79699> 1768\n<e7969a> 2301\n<e7969d> 7012\n<e7969e> 15964\n<e7969f> 2930\n<e796a0> 7011\n<e796a1> 4122\n<e796a2> 15965\n<e796a3> 7014\n<e796a4> 983\n<e796a5> 2235\n<e796ab> 4198\n<e796ac> 7013\n<e796ad> 15971\n<e796ae> 1330\n<e796af> 1669\n<e796b0> 7020\n<e796b1> 7019\n<e796b2> 3010\n<e796b5> 1350\nendcidchar\n\n100 begincidchar\n<e796b8> 7017\n<e796b9> 4495\n<e796bc> 3630\n<e796bd> 2305\n<e796be> 2085\n<e796bf> 15976\n<e79782> 7022\n<e79783> 7021\n<e79784> 7018\n<e79785> 1128\n<e79786> 15979\n<e79787> 4513\n<e79788> 4253\n<e79789> 2278\n<e7978a> 3207\n<e7978d> 7024\n<e79792> 4128\n<e79793> 15986\n<e79794> 4555\n<e79795> 1938\n<e79796> 7023\n<e79797> 15987\n<e79798> 1530\n<e79799> 8134\n<e7979a> 15988\n<e7979b> 3685\n<e7979e> 3013\n<e797a2> 2538\n<e797a3> 7025\n<e797a4> 7028\n<e797a5> 15994\n<e797a6> 7027\n<e797a7> 7030\n<e797a8> 7026\n<e797a9> 15995\n<e797aa> 2003\n<e797ab> 7029\n<e797b0> 3592\n<e797b1> 7032\n<e797b4> 1274\n<e797b9> 1085\n<e797bc> 7033\n<e797bf> 7034\n<e79880> 7036\n<e79881> 1380\n<e79882> 9646\n<e79883> 7031\n<e79884> 16010\n<e79885> 7037\n<e7988a> 7040\n<e7988b> 7937\n<e7988c> 7038\n<e7988d> 8704\n<e79890> 7035\n<e79895> 7043\n<e79896> 16021\n<e79897> 7039\n<e79898> 7042\n<e79899> 7044\n<e7989a> 16022\n<e7989b> 7045\n<e7989e> 9650\n<e7989f> 3792\n<e798a0> 7048\n<e798a1> 7831\n<e798a2> 7047\n<e798a3> 16025\n<e798a4> 2623\n<e798a5> 7041\n<e798a6> 3444\n<e798a7> 8363\n<e798a8> 16026\n<e798a9> 1396\n<e798aa> 1114\n<e798ab> 3588\n<e798ac> 16027\n<e798ad> 7050\n<e798b0> 7051\n<e798b3> 7056\n<e798b4> 4463\n<e798b5> 7053\n<e798b8> 3214\n<e798bb> 9651\n<e798bc> 7046\n<e798bd> 16036\n<e798be> 7055\n<e798bf> 7052\n<e79980> 7049\n<e79981> 16037\n<e79982> 8232\n<e79983> 7054\n<e79988> 16040\n<e79989> 9649\n<e7998c> 948\n<e7998d> 7057\n<e79994> 7059\n<e79995> 16049\n<e79996> 7061\n<e79997> 16050\n<e79998> 9644\nendcidchar\n\n100 begincidchar\n<e7999c> 7060\n<e7999d> 16054\n<e7999e> 7058\n<e7999f> 7758\n<e799a2> 8706\n<e799a3> 4043\n<e799a4> 9643\n<e799a5> 8838\n<e799a6> 16057\n<e799a7> 9645\n<e799a8> 16058\n<e799a9> 9654\n<e799aa> 16059\n<e799ab> 7062\n<e799ac> 8675\n<e799af> 7063\n<e799b0> 8751\n<e799b1> 8549\n<e799b2> 9655\n<e799b8> 1864\n<e799bb> 1448\n<e799bc> 7913\n<e799bd> 994\n<e799be> 996\n<e799bf> 16067\n<e79a82> 4400\n<e79a83> 16070\n<e79a84> 1445\n<e79a85> 16071\n<e79a86> 2213\n<e79a87> 2015\n<e79a88> 6957\n<e79a8b> 1753\n<e79a8e> 6958\n<e79a91> 947\n<e79a92> 16078\n<e79a93> 6959\n<e79a96> 3743\n<e79a99> 6960\n<e79a9a> 7717\n<e79aa4> 6961\n<e79aae> 3011\n<e79ab1> 4580\n<e79ab2> 7112\n<e79ab3> 16103\n<e79ab4> 7113\n<e79ab8> 9664\n<e79ab9> 16107\n<e79aba> 8858\n<e79abf> 2808\n<e79b82> 4288\n<e79b85> 4560\n<e79b86> 2985\n<e79b87> 16116\n<e79b88> 4244\n<e79b89> 16117\n<e79b8a> 4205\n<e79b8d> 6795\n<e79b8e> 966\n<e79b8f> 4438\n<e79b90> 4087\n<e79b91> 2131\n<e79b92> 1927\n<e79b93> 16120\n<e79b94> 2437\n<e79b95> 16121\n<e79b96> 1730\n<e79b97> 1442\n<e79b98> 2957\n<e79b9b> 3385\n<e79b9e> 8814\n<e79b9f> 2768\n<e79ba0> 16126\n<e79ba1> 8125\n<e79ba2> 16127\n<e79ba3> 8068\n<e79ba4> 8370\n<e79ba5> 6796\n<e79ba6> 16128\n<e79ba7> 8259\n<e79bae> 2850\n<e79baf> 1505\n<e79bb0> 16135\n<e79bb1> 6744\n<e79bb2> 2729\n<e79bb3> 16136\n<e79bb4> 4528\n<e79bb8> 3917\n<e79bb9> 6747\n<e79bbc> 2959\n<e79bbd> 16142\n<e79bbe> 1563\n<e79bbf> 16143\n<e79c80> 16144\n<e79c81> 3384\n<e79c84> 6745\n<e79c89> 2753\n<e79c8a> 16149\n<e79c8b> 2369\n<e79c8c> 16150\nendcidchar\n\n100 begincidchar\n<e79c8d> 6746\n<e79c99> 6752\n<e79c9a> 6750\n<e79c9f> 4487\n<e79ca0> 2788\n<e79ca1> 16166\n<e79ca2> 6751\n<e79ca6> 6754\n<e79ca7> 16170\n<e79ca8> 4420\n<e79ca9> 4044\n<e79cad> 6753\n<e79cae> 16174\n<e79caf> 2773\n<e79cb5> 6755\n<e79cb6> 2433\n<e79cb7> 2331\n<e79cb8> 6756\n<e79cb9> 16180\n<e79cba> 3658\n<e79cbb> 16181\n<e79cbc> 4100\n<e79d80> 4642\n<e79d81> 4503\n<e79d82> 16185\n<e79d83> 6760\n<e79d87> 6759\n<e79d8f> 9860\n<e79d9a> 6761\n<e79d9b> 2261\n<e79d9e> 9455\n<e79da1> 3492\n<e79da2> 6763\n<e79da3> 1532\n<e79da4> 16208\n<e79da5> 6764\n<e79da6> 2851\n<e79da7> 16209\n<e79da8> 6762\n<e79dab> 2223\n<e79dac> 1166\n<e79db9> 1538\n<e79dbd> 6767\n<e79dbe> 4720\n<e79dbf> 6765\n<e79e80> 6768\n<e79e84> 2798\n<e79e85> 1303\n<e79e8c> 6769\n<e79e8d> 6766\n<e79e8e> 3878\n<e79e91> 6770\n<e79e92> 2718\n<e79e98> 9454\n<e79e9e> 8308\n<e79ea1> 16248\n<e79ea2> 5269\n<e79ea5> 3026\n<e79ea6> 16251\n<e79ea7> 3139\n<e79ea8> 16252\n<e79ea9> 4596\n<e79eaa> 1450\n<e79eab> 16253\n<e79eac> 3495\n<e79ead> 9863\n<e79eb0> 6773\n<e79eb3> 3676\n<e79eb4> 16258\n<e79eb5> 6774\n<e79ebb> 4433\n<e79ebc> 9456\n<e79ebd> 6775\n<e79ebe> 16264\n<e79ebf> 7550\n<e79f87> 9869\n<e79f8d> 5015\n<e79f97> 1318\n<e79f9a> 8864\n<e79f9b> 2737\n<e79f9c> 7114\n<e79fa2> 3407\n<e79fa3> 4186\n<e79fa4> 16293\n<e79fa5> 4521\n<e79fa6> 16294\n<e79fa7> 6938\n<e79fa8> 16295\n<e79fa9> 2311\n<e79faa> 16296\n<e79fab> 2196\n<e79fac> 6939\n<e79fad> 1547\n<e79fae> 950\n<e79faf> 8107\n<e79fb3> 3398\n<e79fb6> 6690\n<e79fb7> 16302\n<e79fb8> 6691\n<e79fbd> 3848\nendcidchar\n\n100 begincidchar\n<e79fbe> 1612\n<e79fbf> 2432\n<e7a080> 6692\n<e7a081> 2706\n<e7a082> 3305\n<e7a089> 6693\n<e7a08c> 3093\n<e7a08d> 2368\n<e7a091> 6696\n<e7a092> 3001\n<e7a093> 16318\n<e7a094> 4089\n<e7a095> 16319\n<e7a096> 4614\n<e7a099> 16320\n<e7a09a> 4107\n<e7a09b> 16321\n<e7a09e> 16322\n<e7a09f> 6704\n<e7a0a3> 6708\n<e7a0a4> 16326\n<e7a0a5> 6706\n<e7a0a6> 6714\n<e7a0a7> 4489\n<e7a0a8> 16327\n<e7a0a9> 6709\n<e7a0ac> 6707\n<e7a0ad> 6698\n<e7a0b0> 2986\n<e7a0b4> 3045\n<e7a0b7> 3362\n<e7a0b8> 4373\n<e7a0bc> 6705\n<e7a0bd> 16337\n<e7a0be> 2532\n<e7a0bf> 16338\n<e7a180> 1316\n<e7a183> 9896\n<e7a184> 16341\n<e7a185> 1857\n<e7a186> 16342\n<e7a187> 6716\n<e7a18c> 6717\n<e7a18d> 16347\n<e7a18e> 6710\n<e7a18f> 16348\n<e7a190> 6715\n<e7a191> 16349\n<e7a192> 3847\n<e7a195> 3499\n<e7a19d> 3938\n<e7a1a4> 9449\n<e7a1a8> 9445\n<e7a1a9> 16366\n<e7a1aa> 6718\n<e7a1ab> 2619\n<e7a1ac> 4247\n<e7a1ad> 6711\n<e7a1ae> 3218\n<e7a1af> 8698\n<e7a1b7> 2146\n<e7a1bc> 2993\n<e7a287> 6722\n<e7a288> 16388\n<e7a289> 1488\n<e7a28c> 2652\n<e7a28d> 952\n<e7a28e> 3550\n<e7a291> 1047\n<e7a292> 16393\n<e7a293> 6720\n<e7a297> 3740\n<e7a298> 1475\n<e7a299> 16397\n<e7a29a> 6721\n<e7a29b> 6719\n<e7a29c> 6723\n<e7a29f> 1499\n<e7a2a0> 16400\n<e7a2a1> 6724\n<e7a2a2> 16401\n<e7a2a3> 6725\n<e7a2a4> 16402\n<e7a2a5> 6728\n<e7a2a6> 16403\n<e7a2a7> 1077\n<e7a2a8> 16404\n<e7a2a9> 8520\n<e7a2ad> 9444\n<e7a2b0> 2999\n<e7a2b1> 2145\n<e7a2b2> 6726\n<e7a2b3> 3599\n<e7a2b4> 1201\n<e7a2b8> 9446\n<e7a2b9> 6727\n<e7a2ba> 8439\n<e7a2bb> 16413\n<e7a2bc> 8299\n<e7a2bd> 16414\nendcidchar\n\n100 begincidchar\n<e7a2be> 2894\n<e7a2bf> 16415\n<e7a380> 16416\n<e7a381> 1352\n<e7a385> 1024\n<e7a389> 6731\n<e7a38a> 2501\n<e7a38b> 1387\n<e7a390> 2958\n<e7a394> 6729\n<e7a395> 2385\n<e7a399> 6730\n<e7a39a> 8871\n<e7a3a3> 9452\n<e7a3a7> 9451\n<e7a3a8> 2824\n<e7a3ac> 6732\n<e7a3af> 9443\n<e7a3b2> 6733\n<e7a3b3> 16451\n<e7a3b4> 6735\n<e7a3b7> 2592\n<e7a3ba> 2012\n<e7a3bd> 9450\n<e7a480> 16460\n<e7a481> 2185\n<e7a485> 6734\n<e7a48e> 7826\n<e7a493> 6736\n<e7a499> 7719\n<e7a49e> 6738\n<e7a4a4> 6737\n<e7a4a5> 16490\n<e7a4a6> 8166\n<e7a4aa> 9447\n<e7a4ab> 8210\n<e7a4ac> 7916\n<e7a4b1> 9448\n<e7a4b4> 6739\n<e7a4ba> 3413\n<e7a4bb> 6648\n<e7a4bc> 2524\n<e7a4bd> 16505\n<e7a4be> 3360\n<e7a4bf> 16506\n<e7a580> 6649\n<e7a581> 3085\n<e7a586> 6650\n<e7a587> 16511\n<e7a588> 3084\n<e7a589> 6651\n<e7a593> 6654\n<e7a596> 4675\n<e7a597> 6657\n<e7a59a> 6655\n<e7a59d> 4608\n<e7a59e> 3370\n<e7a59f> 3555\n<e7a5a0> 6658\n<e7a5a1> 16525\n<e7a5a2> 6656\n<e7a5a5> 3926\n<e7a5a6> 16528\n<e7a5a7> 6660\n<e7a5a8> 3024\n<e7a5ad> 2099\n<e7a5ae> 16533\n<e7a5af> 6659\n<e7a5b7> 1436\n<e7a5b8> 2059\n<e7a5b9> 16541\n<e7a5ba> 6661\n<e7a680> 4875\n<e7a681> 2252\n<e7a684> 2658\n<e7a685> 6662\n<e7a68a> 6663\n<e7a68d> 8038\n<e7a68e> 9436\n<e7a68f> 1694\n<e7a69a> 6664\n<e7a6a6> 9890\n<e7a6a7> 6665\n<e7a6aa> 9437\n<e7a6ae> 8206\n<e7a6af> 16581\n<e7a6b0> 9435\n<e7a6b1> 7864\n<e7a6b2> 16582\n<e7a6b3> 6666\n<e7a6b9> 4306\n<e7a6ba> 4708\n<e7a6bb> 2518\n<e7a6bc> 16588\n<e7a6bd> 3162\n<e7a6be> 1923\n<e7a6bf> 16589\n<e7a780> 4014\n<e7a781> 3506\n<e7a782> 16590\nendcidchar\n\n100 begincidchar\n<e7a783> 3691\n<e7a786> 1740\n<e7a789> 1125\n<e7a78a> 16595\n<e7a78b> 3180\n<e7a78c> 16596\n<e7a78d> 4565\n<e7a791> 2387\n<e7a792> 2800\n<e7a795> 6941\n<e7a798> 2781\n<e7a79f> 4671\n<e7a7a3> 6943\n<e7a7a4> 1272\n<e7a7a5> 16613\n<e7a7a6> 3157\n<e7a7a7> 4118\n<e7a7a8> 16614\n<e7a7a9> 4551\n<e7a7aa> 16615\n<e7a7ab> 6944\n<e7a7ac> 16616\n<e7a7ad> 6942\n<e7a7ae> 16617\n<e7a7af> 2066\n<e7a7b0> 1259\n<e7a7b8> 2214\n<e7a7bb> 4173\n<e7a7bc> 16627\n<e7a7bd> 2037\n<e7a880> 3854\n<e7a881> 16630\n<e7a882> 6948\n<e7a883> 6947\n<e7a886> 6945\n<e7a88b> 1265\n<e7a88c> 16637\n<e7a88d> 3341\n<e7a88e> 3493\n<e7a894> 6950\n<e7a897> 1001\n<e7a89a> 4552\n<e7a89e> 6949\n<e7a89f> 16650\n<e7a8a0> 1298\n<e7a8a3> 7567\n<e7a8ae> 8853\n<e7a8b1> 7808\n<e7a8b2> 16665\n<e7a8b3> 3799\n<e7a8b7> 6952\n<e7a8b8> 16669\n<e7a8b9> 6951\n<e7a8ba> 16670\n<e7a8bb> 1439\n<e7a8bc> 2125\n<e7a8bd> 2065\n<e7a8be> 16671\n<e7a8bf> 1760\n<e7a980> 9847\n<e7a986> 2853\n<e7a98c> 9764\n<e7a98d> 8041\n<e7a98e> 8747\n<e7a991> 6953\n<e7a997> 3552\n<e7a9a1> 9599\n<e7a9a2> 8027\n<e7a9a9> 8603\n<e7a9aa> 16704\n<e7a9ab> 9853\n<e7a9b0> 6956\n<e7a9b4> 4049\n<e7a9b5> 16712\n<e7a9b6> 2286\n<e7a9b7> 3179\n<e7a9ba> 2402\n<e7a9bf> 1324\n<e7aa80> 7068\n<e7aa81> 3692\n<e7aa82> 16717\n<e7aa83> 3153\n<e7aa84> 4430\n<e7aa85> 16718\n<e7aa86> 7069\n<e7aa87> 16719\n<e7aa88> 7070\n<e7aa8d> 3148\n<e7aa91> 4139\n<e7aa92> 4558\n<e7aa95> 7071\n<e7aa96> 2210\n<e7aa97> 1331\n<e7aa98> 2284\n<e7aa9c> 1375\n<e7aa9d> 3808\n<e7aa9e> 16732\n<e7aa9f> 2412\n<e7aaa0> 7073\n<e7aaa5> 2439\nendcidchar\n\n100 begincidchar\n<e7aaa6> 7072\n<e7aaa7> 16737\n<e7aaa8> 7075\n<e7aaa9> 8608\n<e7aaaa> 8582\n<e7aaab> 16738\n<e7aaac> 7074\n<e7aaad> 7076\n<e7aaae> 8429\n<e7aab3> 7077\n<e7aab6> 9657\n<e7aaba> 8170\n<e7aabf> 2631\n<e7ab84> 7844\n<e7ab85> 8417\n<e7ab86> 16756\n<e7ab87> 9656\n<e7ab88> 8800\n<e7ab89> 16757\n<e7ab8a> 8418\n<e7ab8b> 2539\n<e7ab96> 3473\n<e7ab99> 4447\n<e7ab9e> 2281\n<e7ab9f> 2280\n<e7aba0> 4451\n<e7aba3> 2351\n<e7aba4> 16776\n<e7aba5> 3680\n<e7aba6> 7065\n<e7abaa> 8513\n<e7abad> 2224\n<e7abae> 16782\n<e7abaf> 1546\n<e7abb6> 8135\n<e7abb9> 4592\n<e7abba> 7267\n<e7abbd> 7268\n<e7abbe> 16793\n<e7abbf> 1736\n<e7ac85> 16797\n<e7ac86> 981\n<e7ac87> 16798\n<e7ac88> 7269\n<e7ac89> 16799\n<e7ac8a> 7273\n<e7ac8b> 3558\n<e7ac8f> 7275\n<e7ac90> 16803\n<e7ac91> 3953\n<e7ac94> 1075\n<e7ac95> 7272\n<e7ac99> 7279\n<e7ac9a> 16809\n<e7ac9b> 1458\n<e7ac9e> 7287\n<e7ac9f> 16812\n<e7aca0> 7282\n<e7aca4> 7284\n<e7aca5> 7283\n<e7aca6> 1688\n<e7aca7> 16816\n<e7aca8> 1064\n<e7aca9> 16817\n<e7acaa> 7278\n<e7acab> 7274\n<e7acac> 1467\n<e7acad> 16818\n<e7acae> 7280\n<e7acb1> 7281\n<e7acb2> 16821\n<e7acb3> 7285\n<e7acb8> 7277\n<e7acb9> 16826\n<e7acba> 2134\n<e7acbb> 16827\n<e7acbc> 2630\n<e7acbd> 16828\n<e7acbe> 7286\n<e7acbf> 16829\n<e7ad85> 7290\n<e7ad86> 7745\n<e7ad87> 7276\n<e7ad88> 16835\n<e7ad89> 1449\n<e7ad8a> 16836\n<e7ad8b> 2239\n<e7ad8c> 7292\n<e7ad8f> 1601\n<e7ad90> 2429\n<e7ad91> 4605\n<e7ad92> 3683\n<e7ad93> 16839\n<e7ad94> 1395\n<e7ad95> 16840\n<e7ad96> 1190\n<e7ad97> 16841\n<e7ad98> 7288\n<e7ad99> 16842\n<e7ad9a> 7289\nendcidchar\n\n100 begincidchar\n<e7ad9b> 3313\n<e7ad9c> 16843\n<e7ad9d> 7293\n<e7ada0> 7294\n<e7ada1> 16846\n<e7ada2> 7297\n<e7ada7> 9700\n<e7adae> 7295\n<e7adb1> 7299\n<e7adb2> 7298\n<e7adb5> 7291\n<e7adb6> 16861\n<e7adb7> 2423\n<e7adb8> 16862\n<e7adb9> 1300\n<e7adba> 16863\n<e7adbb> 7296\n<e7adbe> 3110\n<e7adbf> 16866\n<e7ae80> 2149\n<e7ae85> 7307\n<e7ae8b> 8070\n<e7ae8c> 16876\n<e7ae8d> 1816\n<e7ae90> 7300\n<e7ae94> 1140\n<e7ae95> 2067\n<e7ae96> 16882\n<e7ae97> 3544\n<e7ae9c> 7309\n<e7ae9d> 7305\n<e7aea1> 1845\n<e7aea2> 7310\n<e7aea8> 7306\n<e7aea9> 2696\n<e7aeaa> 7308\n<e7aeab> 7311\n<e7aeac> 7304\n<e7aead> 2160\n<e7aeb1> 3921\n<e7aeb4> 7312\n<e7aeb8> 7303\n<e7af80> 8115\n<e7af81> 7314\n<e7af84> 7919\n<e7af85> 16910\n<e7af86> 4618\n<e7af87> 3017\n<e7af88> 16911\n<e7af89> 8868\n<e7af8a> 16912\n<e7af8b> 9704\n<e7af8c> 7315\n<e7af91> 7313\n<e7af92> 16917\n<e7af93> 2639\n<e7af99> 1752\n<e7af9a> 7317\n<e7af9d> 7316\n<e7afa1> 1374\n<e7afa4> 9699\n<e7afa9> 8465\n<e7afaa> 7320\n<e7afae> 2469\n<e7afb1> 2516\n<e7afb2> 16937\n<e7afb3> 9702\n<e7afb7> 2994\n<e7afbc> 7323\n<e7afbd> 16945\n<e7afbe> 7322\n<e7afbf> 16946\n<e7b080> 9703\n<e7b087> 1371\n<e7b08b> 7326\n<e7b08c> 7321\n<e7b08d> 8257\n<e7b08e> 16956\n<e7b08f> 7324\n<e7b096> 7325\n<e7b09e> 9706\n<e7b09f> 7327\n<e7b0a0> 16970\n<e7b0a1> 8079\n<e7b0a2> 16971\n<e7b0a3> 9708\n<e7b0a6> 7329\n<e7b0a7> 2014\n<e7b0aa> 7328\n<e7b0ab> 9707\n<e7b0b8> 7330\n<e7b0bd> 8400\n<e7b0be> 8221\n<e7b0bf> 1157\n<e7b180> 7332\n<e7b181> 7331\n<e7b182> 16992\n<e7b183> 8183\n<e7b18c> 7821\n<e7b18d> 2081\nendcidchar\n\n100 begincidchar\n<e7b19c> 9705\n<e7b19f> 9710\n<e7b1a0> 8250\n<e7b1a4> 9875\n<e7b1a9> 9701\n<e7b1aa> 9709\n<e7b1ab> 17024\n<e7b1ac> 8201\n<e7b1ad> 17025\n<e7b1ae> 8293\n<e7b1b2> 9891\n<e7b1b3> 2780\n<e7b1b4> 4853\n<e7b1bb> 2507\n<e7b1bc> 7370\n<e7b1bd> 4654\n<e7b289> 1656\n<e7b291> 7372\n<e7b292> 2540\n<e7b295> 3048\n<e7b296> 17055\n<e7b297> 1369\n<e7b298> 4436\n<e7b29c> 7374\n<e7b29d> 7373\n<e7b29e> 7375\n<e7b29f> 3535\n<e7b2a2> 7376\n<e7b2a3> 17061\n<e7b2a4> 4356\n<e7b2a5> 4575\n<e7b2aa> 1661\n<e7b2ae> 2561\n<e7b2b1> 2564\n<e7b2b2> 7377\n<e7b2b3> 2267\n<e7b2b9> 1381\n<e7b2be> 2266\n<e7b2bf> 17078\n<e7b380> 17079\n<e7b381> 7380\n<e7b385> 7385\n<e7b386> 17083\n<e7b387> 7381\n<e7b388> 7384\n<e7b389> 17084\n<e7b38a> 1972\n<e7b38b> 17085\n<e7b395> 1757\n<e7b396> 3610\n<e7b397> 7386\n<e7b398> 17093\n<e7b399> 1185\n<e7b39c> 2776\n<e7b39d> 9717\n<e7b39e> 7932\n<e7b39f> 4390\n<e7b3a0> 2372\n<e7b3a7> 8228\n<e7b3a8> 7387\n<e7b3af> 2933\n<e7b3b0> 9883\n<e7b3b1> 17108\n<e7b3b2> 9715\n<e7b3b3> 17109\n<e7b3b4> 8921\n<e7b3b5> 17110\n<e7b3b6> 9716\n<e7b3b7> 17111\n<e7b3b8> 7399\n<e7b3b9> 9243\n<e7b3ba> 17112\n<e7b3bb> 3874\n<e7b3be> 8136\n<e7b3bf> 17115\n<e7b480> 8059\n<e7b481> 17116\n<e7b482> 9245\n<e7b483> 17117\n<e7b484> 8780\n<e7b485> 8008\n<e7b486> 9244\n<e7b489> 8447\n<e7b48a> 3800\n<e7b48b> 8602\n<e7b48c> 17118\n<e7b48d> 8337\n<e7b490> 8359\n<e7b493> 9251\n<e7b494> 7835\n<e7b495> 9250\n<e7b496> 17123\n<e7b497> 8464\n<e7b498> 17124\n<e7b499> 8845\n<e7b49a> 8049\n<e7b49b> 7928\n<e7b49c> 9249\n<e7b4a0> 3533\n<e7b4a1> 7923\nendcidchar\n\n100 begincidchar\n<e7b4a2> 3564\n<e7b4a7> 2245\n<e7b4ab> 4652\n<e7b4af> 2502\n<e7b4b0> 8625\n<e7b4b1> 9254\n<e7b4b2> 9253\n<e7b4b3> 8480\n<e7b4b9> 8474\n<e7b4ba> 9252\n<e7b4bb> 17143\n<e7b4bc> 9256\n<e7b4bf> 9258\n<e7b580> 9257\n<e7b581> 17146\n<e7b582> 8852\n<e7b583> 17147\n<e7b584> 8894\n<e7b585> 17148\n<e7b586> 7729\n<e7b58e> 9260\n<e7b58f> 17156\n<e7b590> 8117\n<e7b59d> 9259\n<e7b59e> 8111\n<e7b5a1> 8296\n<e7b5a2> 8676\n<e7b5a6> 7969\n<e7b5a7> 17174\n<e7b5a8> 8449\n<e7b5ae> 4032\n<e7b5b1> 8572\n<e7b5b2> 8522\n<e7b5b3> 9261\n<e7b5b6> 8148\n<e7b5b7> 7400\n<e7b5b8> 17184\n<e7b5b9> 8145\n<e7b680> 17191\n<e7b681> 7731\n<e7b682> 17192\n<e7b683> 9263\n<e7b686> 9262\n<e7b687> 17195\n<e7b688> 9264\n<e7b689> 8667\n<e7b68f> 8536\n<e7b693> 8130\n<e7b69c> 8889\n<e7b69d> 17212\n<e7b69e> 9270\n<e7b6a2> 7822\n<e7b6a3> 9273\n<e7b6a6> 7401\n<e7b6ab> 8645\n<e7b6ac> 9271\n<e7b6ad> 8594\n<e7b6ae> 7402\n<e7b6af> 17222\n<e7b6b0> 9274\n<e7b6b1> 7961\n<e7b6b2> 8588\n<e7b6b3> 7744\n<e7b6b4> 8883\n<e7b6b8> 8287\n<e7b6b9> 9272\n<e7b6ba> 9266\n<e7b6bb> 8820\n<e7b6bc> 17226\n<e7b6bd> 7836\n<e7b6be> 9265\n<e7b6bf> 8325\n<e7b784> 9269\n<e7b787> 9275\n<e7b78a> 8119\n<e7b78b> 9267\n<e7b791> 8276\n<e7b792> 8670\n<e7b793> 17240\n<e7b794> 9268\n<e7b797> 9277\n<e7b798> 8073\n<e7b799> 9276\n<e7b79d> 8046\n<e7b79e> 7896\n<e7b79f> 17246\n<e7b7a0> 7871\n<e7b7a1> 9285\n<e7b7a2> 17247\n<e7b7a3> 8777\n<e7b7a6> 9281\n<e7b7a7> 17250\n<e7b7a8> 7751\n<e7b7a9> 8022\n<e7b7ac> 8326\n<e7b7af> 8598\n<e7b7b0> 17255\n<e7b7b1> 9283\n<e7b7b2> 9279\n<e7b7b3> 17256\nendcidchar\n\n100 begincidchar\n<e7b7b4> 8227\n<e7b7b5> 17257\n<e7b7b6> 9282\n<e7b7b9> 9278\n<e7b7ba> 17260\n<e7b7bb> 9894\n<e7b888> 9038\n<e7b889> 9286\n<e7b88a> 9291\n<e7b88b> 9284\n<e7b890> 9255\n<e7b891> 9292\n<e7b89b> 7951\n<e7b89c> 17286\n<e7b89d> 9287\n<e7b89e> 9289\n<e7b89f> 9288\n<e7b8a3> 8642\n<e7b8a7> 8558\n<e7b8ab> 7939\n<e7b8ac> 17296\n<e7b8ad> 9290\n<e7b8ae> 8540\n<e7b8b1> 8891\n<e7b8b2> 9296\n<e7b8b3> 17299\n<e7b8b4> 9876\n<e7b8b5> 9295\n<e7b8b6> 9718\n<e7b8b7> 8273\n<e7b8b8> 17300\n<e7b8b9> 9294\n<e7b8ba> 17301\n<e7b8bb> 7675\n<e7b8bc> 17302\n<e7b8bd> 8890\n<e7b8be> 8045\n<e7b8bf> 17303\n<e7b980> 17304\n<e7b981> 1614\n<e7b985> 9298\n<e7b986> 9297\n<e7b987> 7403\n<e7b992> 9301\n<e7b993> 17318\n<e7b994> 8841\n<e7b995> 8470\n<e7b99a> 9300\n<e7b99e> 8443\n<e7b9a2> 9280\n<e7b9a9> 8486\n<e7b9aa> 8033\n<e7b9ab> 9885\n<e7b9ac> 17335\n<e7b9ad> 8074\n<e7b9ae> 9302\n<e7b9af> 9305\n<e7b9b0> 9304\n<e7b9b3> 8110\n<e7b9b9> 8730\n<e7b9bc> 8058\n<e7b9bd> 9293\n<e7b9be> 9303\n<e7b9bf> 17345\n<e7ba82> 4680\n<e7ba88> 9299\n<e7ba89> 17353\n<e7ba8a> 9248\n<e7ba8b> 17354\n<e7ba8c> 8671\n<e7ba8d> 9861\n<e7ba8e> 17355\n<e7ba8f> 7790\n<e7ba93> 8740\n<e7ba94> 9840\n<e7ba95> 17359\n<e7ba96> 8634\n<e7ba97> 17360\n<e7ba98> 9306\n<e7ba9b> 7404\n<e7ba9c> 8191\n<e7ba9f> 6099\n<e7baa0> 2287\n<e7baa1> 6100\n<e7baa2> 1955\n<e7baa3> 6101\n<e7baa4> 3896\n<e7baa5> 6102\n<e7baa6> 4351\n<e7baa7> 2089\n<e7baaa> 2112\n<e7baab> 3245\n<e7baac> 3778\n<e7baad> 6105\n<e7baae> 17365\n<e7baaf> 1346\n<e7bab0> 6106\n<e7bab1> 3309\n<e7bab2> 1748\n<e7bab3> 2860\nendcidchar\n\n100 begincidchar\n<e7bab4> 17366\n<e7bab5> 4666\n<e7bab6> 2689\n<e7bab7> 1652\n<e7bab8> 4540\n<e7bab9> 3797\n<e7baba> 1633\n<e7babd> 2919\n<e7babe> 6107\n<e7babf> 3916\n<e7bb83> 2560\n<e7bb84> 4678\n<e7bb85> 3369\n<e7bb86> 3877\n<e7bb87> 4526\n<e7bb88> 4564\n<e7bb89> 6111\n<e7bb8a> 1016\n<e7bb8d> 3349\n<e7bb8e> 4214\n<e7bb8f> 2268\n<e7bb90> 6114\n<e7bb91> 1022\n<e7bb92> 3257\n<e7bb93> 2226\n<e7bb94> 6115\n<e7bb95> 3233\n<e7bb96> 17369\n<e7bb97> 6116\n<e7bb98> 2043\n<e7bb99> 1779\n<e7bb9a> 4045\n<e7bb9b> 6117\n<e7bb9c> 2702\n<e7bb9d> 2343\n<e7bb9e> 2203\n<e7bb9f> 3684\n<e7bba2> 2333\n<e7bba3> 4016\n<e7bba4> 17370\n<e7bba5> 3548\n<e7bba6> 3619\n<e7bba7> 2111\n<e7bba8> 6120\n<e7bba9> 2075\n<e7bbaa> 4034\n<e7bbab> 6121\n<e7bbac> 17371\n<e7bbad> 4035\n<e7bbb0> 1349\n<e7bbb3> 3383\n<e7bbb4> 3771\n<e7bbb5> 2789\n<e7bbb6> 6127\n<e7bbb7> 1066\n<e7bbb8> 1302\n<e7bbb9> 17372\n<e7bbbc> 4664\n<e7bbbd> 4449\n<e7bbbe> 6130\n<e7bbbf> 2675\n<e7bc80> 4631\n<e7bc84> 2141\n<e7bc85> 2794\n<e7bc86> 2477\n<e7bc89> 2076\n<e7bc8a> 17373\n<e7bc8d> 6126\n<e7bc8e> 1551\n<e7bc8f> 6138\n<e7bc90> 17374\n<e7bc93> 1999\n<e7bc94> 1471\n<e7bc95> 2669\n<e7bc96> 1097\n<e7bc97> 6141\n<e7bc98> 4344\n<e7bc99> 6142\n<e7bc9a> 1722\n<e7bc9b> 6144\n<e7bc9c> 6143\n<e7bc9d> 1673\n<e7bc9e> 17375\n<e7bc9f> 6145\n<e7bca0> 1215\n<e7bca8> 4236\n<e7bca9> 3562\n<e7bcae> 3330\n<e7bcb4> 2202\n<e7bcb5> 6162\n<e7bcb6> 7262\n<e7bcb7> 17376\n<e7bcb8> 1746\n<e7bcb9> 17377\n<e7bcba> 3212\n<e7bd82> 7263\n<e7bd83> 17385\n<e7bd8c> 9698\n<e7bd8d> 17392\n<e7bd8e> 9882\nendcidchar\n\n100 begincidchar\n<e7bd8f> 17393\n<e7bd90> 1847\n<e7bd91> 3753\n<e7bd94> 4766\n<e7bd95> 1896\n<e7bd96> 17396\n<e7bd97> 2693\n<e7bd98> 6785\n<e7bd99> 17397\n<e7bd9a> 1600\n<e7bd9f> 6787\n<e7bda0> 17402\n<e7bda1> 6786\n<e7bda2> 992\n<e7bda8> 6789\n<e7bda9> 4471\n<e7bdaa> 4684\n<e7bdae> 4546\n<e7bdaf> 17411\n<e7bdb0> 7914\n<e7bdb1> 6791\n<e7bdb2> 3463\n<e7bdb3> 17412\n<e7bdb4> 6790\n<e7bdb7> 7724\n<e7bdb8> 17415\n<e7bdb9> 6792\n<e7bdbe> 6794\n<e7bdbf> 17420\n<e7be80> 17421\n<e7be81> 6793\n<e7be85> 8290\n<e7be86> 9457\n<e7be87> 17425\n<e7be88> 9458\n<e7be89> 17426\n<e7be8a> 4123\n<e7be8b> 17427\n<e7be8c> 3129\n<e7be8d> 17428\n<e7be8e> 2757\n<e7be94> 1756\n<e7be9a> 2608\n<e7be9d> 7364\n<e7be9e> 4010\n<e7be9f> 7365\n<e7bea0> 17441\n<e7bea1> 3912\n<e7bea4> 3221\n<e7bea5> 9714\n<e7bea6> 17444\n<e7bea7> 7366\n<e7bea8> 17445\n<e7bea9> 8725\n<e7beb1> 17451\n<e7beb2> 7369\n<e7beb8> 4878\n<e7beb9> 1785\n<e7bebc> 5997\n<e7bebd> 4309\n<e7bebe> 17459\n<e7bebf> 7390\n<e7bf80> 17460\n<e7bf81> 3803\n<e7bf85> 1286\n<e7bf8a> 7064\n<e7bf8b> 17468\n<e7bf8c> 4213\n<e7bf8d> 17469\n<e7bf8e> 7391\n<e7bf92> 8622\n<e7bf93> 17473\n<e7bf94> 3925\n<e7bf95> 7392\n<e7bf98> 3145\n<e7bf9f> 1461\n<e7bfa0> 1383\n<e7bfa1> 7394\n<e7bfa5> 7393\n<e7bfa6> 7395\n<e7bfa9> 7396\n<e7bfae> 7397\n<e7bfaf> 17491\n<e7bfb0> 1897\n<e7bfb1> 970\n<e7bfb2> 17492\n<e7bfb3> 7398\n<e7bfb9> 8416\n<e7bfba> 17498\n<e7bfbb> 1610\n<e7bfbc> 4212\n<e88080> 4146\n<e88081> 2490\n<e88082> 17502\n<e88083> 2377\n<e88084> 6483\n<e88085> 4480\n<e88086> 6426\n<e8808b> 7127\n<e8808c> 1591\nendcidchar\n\n100 begincidchar\n<e8808d> 3480\n<e88090> 2864\n<e88091> 17509\n<e88092> 7115\n<e88093> 17510\n<e88094> 7116\n<e88095> 1782\n<e88096> 7117\n<e88097> 1915\n<e88098> 4360\n<e88099> 989\n<e8809c> 7118\n<e880a0> 7119\n<e880a1> 17516\n<e880a2> 7120\n<e880a8> 7125\n<e880a9> 7124\n<e880aa> 2966\n<e880ab> 17519\n<e880ac> 9666\n<e880ad> 17520\n<e880ae> 9665\n<e880b1> 7126\n<e880b2> 17523\n<e880b3> 1593\n<e880b4> 17524\n<e880b5> 7128\n<e880b6> 4149\n<e880b7> 5297\n<e880b8> 3519\n<e880bb> 1281\n<e880bc> 17527\n<e880bd> 1411\n<e880be> 17528\n<e880bf> 1787\n<e88182> 2903\n<e88183> 7129\n<e88186> 7130\n<e8818a> 2573\n<e8818b> 2628\n<e8818c> 4527\n<e8818d> 7131\n<e88192> 7132\n<e88193> 17540\n<e88194> 2547\n<e88195> 17541\n<e88196> 8488\n<e88197> 17542\n<e88198> 3031\n<e88199> 17543\n<e8819a> 2314\n<e8819e> 8601\n<e881a9> 7133\n<e881aa> 1362\n<e881af> 8215\n<e881b0> 7840\n<e881b1> 7134\n<e881b2> 8485\n<e881b3> 8525\n<e881b4> 17561\n<e881b5> 9668\n<e881b6> 8349\n<e881b7> 8842\n<e881b8> 17562\n<e881b9> 9667\n<e881bd> 8569\n<e881be> 8248\n<e881bf> 6686\n<e88280> 6685\n<e88283> 3541\n<e88284> 4197\n<e88285> 8533\n<e88286> 3510\n<e88287> 4473\n<e88288> 17568\n<e88289> 3261\n<e8828a> 17569\n<e8828b> 2506\n<e8828c> 2068\n<e88293> 6513\n<e88296> 3951\n<e88297> 17578\n<e88298> 4577\n<e88299> 17579\n<e8829a> 1542\n<e8829b> 1747\n<e8829c> 6512\n<e8829d> 1737\n<e8829e> 17580\n<e8829f> 6511\n<e882a0> 1227\n<e882a1> 1826\n<e882a2> 4522\n<e882a3> 17581\n<e882a4> 1681\n<e882a5> 1639\n<e882a9> 2138\n<e882aa> 1627\n<e882ab> 6518\n<e882ac> 17585\nendcidchar\n\n100 begincidchar\n<e882ad> 6519\n<e882ae> 964\n<e882af> 2396\n<e882b0> 17586\n<e882b1> 6517\n<e882b2> 4322\n<e882b3> 17587\n<e882b4> 6520\n<e882b7> 6521\n<e882ba> 1643\n<e882bb> 17592\n<e882bc> 6514\n<e882bd> 6516\n<e882be> 3375\n<e882bf> 4566\n<e88380> 4462\n<e88381> 3965\n<e88382> 6527\n<e88383> 3783\n<e88384> 6528\n<e88385> 17593\n<e88386> 1417\n<e8838c> 1052\n<e8838d> 6530\n<e8838e> 3576\n<e88396> 2967\n<e88397> 6531\n<e88398> 17606\n<e88399> 6529\n<e8839a> 2976\n<e8839b> 6526\n<e8839c> 3387\n<e8839d> 6533\n<e8839e> 1030\n<e883a1> 1969\n<e883a4> 4717\n<e883a5> 7111\n<e883a6> 17611\n<e883ab> 6534\n<e883ac> 6042\n<e883ad> 6537\n<e883ae> 17612\n<e883af> 2421\n<e883b0> 4175\n<e883b1> 6535\n<e883b2> 6540\n<e883b3> 1767\n<e883b4> 6536\n<e883b5> 17613\n<e883b6> 2187\n<e883b7> 17614\n<e883b8> 4003\n<e883b9> 17615\n<e883ba> 962\n<e883bb> 17616\n<e883bc> 6541\n<e883bd> 2879\n<e88482> 4523\n<e88485> 8658\n<e88486> 1379\n<e88489> 2717\n<e8848a> 2092\n<e8848f> 4387\n<e88490> 3081\n<e88491> 2871\n<e88492> 6543\n<e88493> 2920\n<e88494> 4873\n<e88495> 17627\n<e88496> 1144\n<e88497> 17628\n<e88498> 6548\n<e88499> 17629\n<e8849a> 2198\n<e8849b> 9415\n<e8849e> 6546\n<e884ac> 6547\n<e884af> 1703\n<e884b0> 17647\n<e884b1> 3714\n<e884b2> 6549\n<e884b6> 6545\n<e884b7> 17651\n<e884b8> 2556\n<e884b9> 8825\n<e884be> 3009\n<e884bf> 17656\n<e88586> 3654\n<e88587> 17663\n<e88588> 6550\n<e88589> 17664\n<e8858a> 2459\n<e8858b> 4159\n<e8858c> 6551\n<e8858d> 17665\n<e8858e> 8483\n<e8858f> 17666\n<e88590> 1706\n<e88591> 1704\n<e88592> 17667\nendcidchar\n\n100 begincidchar\n<e88593> 6552\n<e88594> 3128\n<e88595> 3748\n<e88596> 9413\n<e885a0> 6557\n<e885a1> 9417\n<e885a5> 3987\n<e885a6> 8340\n<e885a7> 6562\n<e885a8> 17678\n<e885a9> 6558\n<e885aa> 17679\n<e885ab> 8854\n<e885ac> 17680\n<e885ad> 6561\n<e885ae> 3284\n<e885af> 17681\n<e885b0> 4133\n<e885b1> 6556\n<e885b4> 6553\n<e885b8> 7799\n<e885b9> 1716\n<e885ba> 3910\n<e885bb> 2888\n<e885be> 3629\n<e885bf> 3705\n<e88680> 1021\n<e88681> 17687\n<e88682> 6566\n<e88688> 6565\n<e88689> 17693\n<e8868a> 1145\n<e8868f> 1755\n<e88690> 17698\n<e88691> 6567\n<e88698> 1109\n<e88699> 17705\n<e8869a> 7942\n<e8869b> 3608\n<e8869c> 2823\n<e8869d> 3858\n<e886a0> 8101\n<e886a3> 6569\n<e886a6> 6576\n<e886a7> 17712\n<e886a8> 2995\n<e886a9> 8345\n<e886aa> 6570\n<e886b3> 3326\n<e886ba> 5697\n<e886bb> 6574\n<e886bc> 17727\n<e886bd> 7853\n<e886be> 9416\n<e886bf> 8360\n<e88780> 3711\n<e88781> 6575\n<e88782> 1092\n<e88783> 4252\n<e88786> 4195\n<e88789> 8223\n<e8878a> 6573\n<e8878b> 17732\n<e8878c> 6571\n<e8878d> 8389\n<e8878e> 17733\n<e8878f> 9418\n<e88798> 8176\n<e88799> 17742\n<e8879a> 9414\n<e8879f> 8797\n<e887a0> 8926\n<e887a3> 1249\n<e887a7> 6402\n<e887a8> 8236\n<e887a9> 17752\n<e887aa> 4657\n<e887ab> 17753\n<e887ac> 7337\n<e887ad> 1305\n<e887ba> 8545\n<e887bb> 4490\n<e887bc> 2297\n<e887bd> 17764\n<e887be> 7333\n<e887bf> 17765\n<e88880> 4143\n<e88883> 17766\n<e88884> 7336\n<e88885> 2298\n<e88886> 4292\n<e88887> 8763\n<e88888> 8665\n<e88889> 8139\n<e8888a> 8137\n<e8888b> 17767\n<e88890> 7266\n<e88891> 17770\n<e88892> 3453\n<e88893> 17771\nendcidchar\n\n100 begincidchar\n<e88894> 3653\n<e8889b> 5656\n<e8889c> 3497\n<e8889d> 17778\n<e8889e> 3831\n<e8889f> 4570\n<e888a0> 17779\n<e888a8> 7344\n<e888a9> 17784\n<e888aa> 1908\n<e888ab> 7345\n<e888ac> 1006\n<e888ad> 7342\n<e888ae> 17785\n<e888af> 7343\n<e888b0> 2163\n<e888b1> 1180\n<e888b2> 17786\n<e888b5> 1573\n<e888b6> 1143\n<e888b7> 3900\n<e888b8> 7346\n<e888b9> 1327\n<e888ba> 17787\n<e888bb> 7347\n<e888be> 7350\n<e888bf> 17790\n<e88984> 7351\n<e88987> 3672\n<e88988> 17797\n<e88989> 7352\n<e8898a> 17798\n<e8898b> 7353\n<e8898f> 7354\n<e88998> 3527\n<e88999> 7777\n<e8899a> 7355\n<e8899f> 7356\n<e889a4> 9711\n<e889a5> 17818\n<e889a6> 8088\n<e889a7> 17819\n<e889a8> 7357\n<e889ab> 9712\n<e889ae> 7388\n<e889af> 2565\n<e889b0> 2139\n<e889b1> 8072\n<e889b2> 3300\n<e889b3> 4103\n<e889b4> 6001\n<e889b7> 8696\n<e889b8> 17826\n<e889b9> 5089\n<e889ba> 4188\n<e889bd> 5090\n<e889be> 951\n<e889bf> 5091\n<e88a82> 2219\n<e88a83> 17831\n<e88a84> 5095\n<e88a88> 4728\n<e88a89> 17835\n<e88a8a> 5093\n<e88a8b> 4312\n<e88a8c> 17836\n<e88a8d> 3343\n<e88a8e> 5096\n<e88a8f> 5092\n<e88a90> 17837\n<e88a91> 5097\n<e88a92> 2727\n<e88a97> 5098\n<e88a98> 5107\n<e88a99> 5099\n<e88a9c> 3822\n<e88a9d> 4516\n<e88a9e> 17844\n<e88a9f> 5117\n<e88aa0> 17845\n<e88aa1> 5115\n<e88aa4> 5120\n<e88aa5> 2231\n<e88aa6> 2642\n<e88aa7> 17848\n<e88aa8> 5094\n<e88aa9> 5113\n<e88aaa> 5116\n<e88aab> 5100\n<e88aac> 1647\n<e88aad> 976\n<e88aae> 5109\n<e88aaf> 3977\n<e88ab0> 5103\n<e88ab1> 1981\n<e88ab2> 17849\n<e88ab3> 1625\n<e88ab4> 5114\n<e88ab7> 5108\n<e88ab8> 5101\nendcidchar\n\n100 begincidchar\n<e88ab9> 3160\n<e88aba> 17852\n<e88abb> 8994\n<e88abc> 17853\n<e88abd> 4072\n<e88abe> 5102\n<e88abf> 17854\n<e88b80> 17855\n<e88b81> 5112\n<e88b84> 5118\n<e88b87> 3772\n<e88b88> 5104\n<e88b89> 17860\n<e88b8a> 5105\n<e88b8d> 1179\n<e88b8e> 5119\n<e88b8f> 3530\n<e88b90> 17861\n<e88b91> 4346\n<e88b92> 5129\n<e88b93> 5133\n<e88b94> 3577\n<e88b95> 5140\n<e88b96> 17862\n<e88b97> 2796\n<e88b98> 5130\n<e88b9b> 2382\n<e88b9c> 5127\n<e88b9d> 17865\n<e88b9e> 1029\n<e88b9f> 1807\n<e88ba0> 5139\n<e88ba1> 5121\n<e88ba2> 17866\n<e88ba3> 5106\n<e88ba4> 5124\n<e88ba5> 3279\n<e88ba6> 2413\n<e88ba7> 9014\n<e88bab> 3316\n<e88baf> 1062\n<e88bb0> 17873\n<e88bb1> 4231\n<e88bb4> 5128\n<e88bb7> 5123\n<e88bb8> 17878\n<e88bb9> 3034\n<e88bba> 17879\n<e88bbb> 5132\n<e88c80> 17884\n<e88c81> 4639\n<e88c82> 2740\n<e88c83> 1619\n<e88c84> 3150\n<e88c85> 2734\n<e88c86> 5136\n<e88c87> 5126\n<e88c88> 5145\n<e88c89> 5122\n<e88c8c> 5131\n<e88c8d> 17887\n<e88c8e> 2260\n<e88c8f> 5125\n<e88c90> 17888\n<e88c91> 5134\n<e88c96> 17891\n<e88c97> 5158\n<e88c9a> 5135\n<e88c9b> 5166\n<e88c9c> 5141\n<e88ca7> 2142\n<e88ca8> 1351\n<e88cab> 2728\n<e88cac> 1198\n<e88cad> 5160\n<e88cae> 17906\n<e88caf> 5152\n<e88cb0> 17907\n<e88cb1> 5149\n<e88cb2> 17908\n<e88cb3> 5162\n<e88cb4> 5148\n<e88cb5> 4215\n<e88cb6> 1199\n<e88cb7> 17909\n<e88cb8> 3250\n<e88cb9> 3262\n<e88cba> 5161\n<e88cbb> 17910\n<e88cbc> 5147\n<e88d80> 5157\n<e88d83> 5155\n<e88d86> 2258\n<e88d87> 5154\n<e88d88> 17918\n<e88d89> 1188\n<e88d8f> 5153\n<e88d90> 2153\n<e88d91> 5142\n<e88d92> 2009\nendcidchar\n\n100 begincidchar\n<e88d93> 17924\n<e88d94> 2526\n<e88d9a> 2119\n<e88d9d> 17930\n<e88d9e> 5151\n<e88d9f> 5156\n<e88da0> 5159\n<e88da1> 1429\n<e88da2> 17931\n<e88da3> 3252\n<e88da4> 2044\n<e88da5> 5164\n<e88da6> 5163\n<e88da7> 4240\n<e88da8> 5165\n<e88da9> 5167\n<e88daa> 5169\n<e88dab> 4216\n<e88dac> 5168\n<e88daf> 4144\n<e88db7> 1920\n<e88db8> 5173\n<e88dbb> 5186\n<e88dbc> 5181\n<e88dbd> 5184\n<e88e85> 5180\n<e88e86> 3053\n<e88e89> 2525\n<e88e8a> 8875\n<e88e8e> 3304\n<e88e92> 5146\n<e88e93> 5178\n<e88e96> 8127\n<e88e97> 17958\n<e88e98> 5187\n<e88e9b> 5150\n<e88e9c> 5179\n<e88e9d> 17961\n<e88e9e> 5188\n<e88e9f> 17962\n<e88ea0> 5176\n<e88ea1> 17963\n<e88ea2> 8061\n<e88ea7> 9011\n<e88ea8> 5189\n<e88ea9> 5183\n<e88eaa> 5177\n<e88eab> 2829\n<e88eb0> 5172\n<e88eb1> 2462\n<e88eb2> 2548\n<e88eb5> 17972\n<e88eb6> 5182\n<e88eb7> 2054\n<e88eb8> 5185\n<e88eb9> 4237\n<e88eba> 5190\n<e88ebb> 17973\n<e88ebc> 5191\n<e88ebd> 2732\n<e88f80> 5214\n<e88f81> 5192\n<e88f85> 5213\n<e88f86> 17979\n<e88f87> 1814\n<e88f8a> 2308\n<e88f8b> 17982\n<e88f8c> 2345\n<e88f8f> 1921\n<e88f94> 5206\n<e88f95> 17989\n<e88f96> 5201\n<e88f97> 17990\n<e88f98> 5195\n<e88f9c> 1170\n<e88f9d> 5199\n<e88f9e> 17994\n<e88f9f> 5207\n<e88fa0> 1131\n<e88fa1> 5217\n<e88fa5> 5194\n<e88fa9> 3055\n<e88faa> 5212\n<e88faf> 8013\n<e88fb0> 5216\n<e88fb1> 2603\n<e88fb2> 1635\n<e88fbd> 5200\n<e89080> 18015\n<e89081> 5193\n<e89082> 18016\n<e89083> 5209\n<e89084> 3620\n<e89085> 18017\n<e89086> 5205\n<e89087> 9012\n<e8908a> 8177\n<e8908b> 5198\n<e8908c> 2765\n<e8908d> 3035\nendcidchar\n\n100 begincidchar\n<e8908e> 3773\n<e8908f> 5208\n<e89090> 18020\n<e89091> 5204\n<e89098> 5197\n<e8909c> 5202\n<e8909d> 2691\n<e890a6> 5215\n<e890a7> 3937\n<e890a8> 3283\n<e890ac> 8587\n<e890b1> 5234\n<e890b5> 9033\n<e890b8> 5203\n<e890bc> 5228\n<e890bd> 2699\n<e89186> 5229\n<e89189> 8715\n<e89191> 5219\n<e89192> 9030\n<e89197> 4599\n<e89198> 18072\n<e89199> 5221\n<e8919a> 5220\n<e8919b> 1771\n<e8919c> 5218\n<e891a1> 3054\n<e891a2> 18077\n<e891a3> 1516\n<e891a4> 9031\n<e891a5> 18078\n<e891a6> 8595\n<e891a9> 5230\n<e891aa> 18081\n<e891ab> 1968\n<e891ac> 4388\n<e891ad> 5235\n<e891ae> 18082\n<e891af> 9889\n<e891b0> 18083\n<e891b1> 1363\n<e891b2> 18084\n<e891b3> 5222\n<e891b4> 18085\n<e891b5> 2440\n<e891b6> 5231\n<e891b7> 8034\n<e891b8> 5227\n<e891b9> 18086\n<e891ba> 5225\n<e89282> 1466\n<e89289> 5226\n<e8928a> 18098\n<e8928b> 2176\n<e8928c> 5232\n<e8928d> 18099\n<e8928e> 5233\n<e89293> 9037\n<e89294> 9032\n<e89297> 5249\n<e89298> 18106\n<e89299> 2766\n<e8929c> 3543\n<e892a1> 5246\n<e892af> 4759\n<e892b2> 3056\n<e892b3> 18128\n<e892b4> 5248\n<e892b8> 4501\n<e892b9> 5247\n<e892ba> 5244\n<e892bb> 18132\n<e892bc> 7776\n<e892bd> 5240\n<e892be> 18133\n<e892bf> 5243\n<e89380> 9029\n<e89381> 5236\n<e89384> 4025\n<e89389> 3251\n<e8938a> 5242\n<e8938b> 7954\n<e8938c> 18140\n<e8938d> 5237\n<e89390> 5238\n<e89391> 3559\n<e89392> 18143\n<e89393> 5241\n<e89396> 1078\n<e8939d> 2465\n<e8939e> 18152\n<e8939f> 2094\n<e893a0> 5245\n<e893a3> 5251\n<e893a4> 18155\n<e893a5> 5250\n<e893a6> 5239\n<e893ac> 2991\n<e893ad> 18161\n<e893ae> 8216\nendcidchar\n\n100 begincidchar\n<e893af> 9013\n<e893b0> 5255\n<e893bc> 5262\n<e893bd> 9020\n<e893be> 18173\n<e893bf> 5261\n<e8948c> 5252\n<e89491> 2804\n<e89492> 18190\n<e89493> 2722\n<e89494> 9839\n<e89497> 4482\n<e8949a> 3780\n<e8949e> 9041\n<e8949f> 5257\n<e894a0> 18198\n<e894a1> 1171\n<e894a2> 18199\n<e894a3> 8096\n<e894a6> 9016\n<e894ab> 2891\n<e894ac> 3446\n<e894ad> 8731\n<e894b7> 3131\n<e894b8> 5254\n<e894b9> 5256\n<e894ba> 5258\n<e894bb> 5260\n<e894bc> 949\n<e894bd> 1079\n<e89580> 18217\n<e89581> 9026\n<e89582> 18218\n<e89583> 5270\n<e89586> 9039\n<e89587> 18221\n<e89588> 5264\n<e89589> 2183\n<e8958a> 3274\n<e8958e> 9021\n<e89592> 9028\n<e89593> 9009\n<e89594> 18228\n<e89595> 9035\n<e89596> 5259\n<e89597> 18229\n<e89598> 9019\n<e89599> 5263\n<e8959e> 5267\n<e895a2> 9040\n<e895a3> 18237\n<e895a4> 5266\n<e895a8> 5265\n<e895a9> 7860\n<e895aa> 8614\n<e895ad> 8651\n<e895b2> 5271\n<e895b3> 18247\n<e895b4> 4367\n<e895b7> 9045\n<e895b8> 18250\n<e895b9> 5277\n<e895ba> 5268\n<e895bb> 5272\n<e895be> 2500\n<e895bf> 18253\n<e89684> 1034\n<e89685> 5280\n<e89686> 18258\n<e89687> 5275\n<e89688> 9022\n<e89689> 18259\n<e8968a> 8052\n<e8968b> 18260\n<e8968c> 9008\n<e8968f> 5276\n<e89690> 18263\n<e89691> 9856\n<e89694> 8410\n<e8969b> 4047\n<e8969c> 5279\n<e8969f> 9034\n<e896a4> 5273\n<e896a5> 18278\n<e896a6> 8081\n<e896a7> 18279\n<e896a8> 5274\n<e896a9> 8455\n<e896aa> 3976\n<e896ae> 5278\n<e896af> 3460\n<e896b0> 5283\n<e896b7> 5282\n<e896b8> 18289\n<e896b9> 5281\n<e896ba> 9023\n<e89780> 18295\n<e89781> 5285\n<e89789> 2230\n<e8978d> 8180\nendcidchar\n\n100 begincidchar\n<e8978e> 9027\n<e8978f> 1183\n<e89790> 2799\n<e89793> 5284\n<e89794> 18308\n<e89795> 2939\n<e8979c> 5286\n<e8979d> 8722\n<e897a4> 3628\n<e897a5> 8711\n<e897a9> 1607\n<e897aa> 9049\n<e897b4> 8788\n<e897b5> 18333\n<e897b6> 9010\n<e897b9> 7718\n<e897ba> 9047\n<e897bb> 4392\n<e897bf> 5287\n<e89884> 9048\n<e89885> 5289\n<e89886> 8258\n<e89887> 8531\n<e8988b> 8379\n<e89891> 2821\n<e89896> 5291\n<e8989a> 9050\n<e8989e> 9046\n<e898a2> 9015\n<e898a7> 5288\n<e898a8> 18368\n<e898a9> 5290\n<e898ad> 8185\n<e898b8> 4443\n<e898b9> 18382\n<e898ba> 9043\n<e898bb> 18383\n<e898bc> 5292\n<e898bf> 8289\n<e8998d> 7152\n<e8998e> 1975\n<e8998f> 2649\n<e89990> 2929\n<e89991> 2670\n<e89994> 7153\n<e89995> 7829\n<e8999a> 4020\n<e8999b> 18405\n<e8999c> 8265\n<e8999d> 18406\n<e8999e> 4290\n<e8999f> 8002\n<e899a2> 6509\n<e899a7> 8168\n<e899ab> 1291\n<e899ac> 7154\n<e899ad> 18416\n<e899ae> 7155\n<e899b1> 3396\n<e899b9> 1950\n<e899ba> 7157\n<e899bb> 7159\n<e899bc> 7158\n<e899bd> 3545\n<e899be> 3879\n<e899bf> 7156\n<e89a80> 3403\n<e89a81> 4182\n<e89a82> 2707\n<e89a8a> 3794\n<e89a8b> 7162\n<e89a8c> 1025\n<e89a8d> 7161\n<e89a93> 7168\n<e89a94> 18438\n<e89a95> 1174\n<e89a9c> 4074\n<e89a9d> 7164\n<e89aa3> 7166\n<e89aa4> 4396\n<e89aa7> 7165\n<e89aa8> 7160\n<e89aa9> 7169\n<e89aaa> 7167\n<e89aab> 18452\n<e89aac> 7163\n<e89aaf> 7177\n<e89ab0> 7174\n<e89ab1> 7176\n<e89ab4> 7180\n<e89ab5> 7172\n<e89ab6> 7170\n<e89aba> 7175\n<e89b80> 4602\n<e89b84> 7171\n<e89b85> 18468\n<e89b86> 3190\n<e89b87> 3352\n<e89b88> 18469\n<e89b89> 7178\nendcidchar\n\n100 begincidchar\n<e89b8a> 1823\n<e89b8b> 1425\n<e89b8e> 7173\n<e89b8f> 7179\n<e89b90> 7186\n<e89b91> 7192\n<e89b94> 2028\n<e89b98> 7191\n<e89b99> 3725\n<e89b9a> 18477\n<e89b9b> 4586\n<e89b9e> 7188\n<e89b9f> 7190\n<e89ba4> 1773\n<e89ba9> 7181\n<e89bad> 7184\n<e89bae> 2720\n<e89baf> 18491\n<e89bb0> 4478\n<e89bb3> 7185\n<e89bb4> 7189\n<e89bb8> 7195\n<e89bb9> 4257\n<e89bba> 9690\n<e89bbe> 1577\n<e89bbf> 18498\n<e89c80> 3464\n<e89c81> 18499\n<e89c82> 1665\n<e89c83> 7193\n<e89c86> 9687\n<e89c87> 7194\n<e89c88> 7196\n<e89c89> 7199\n<e89c8a> 7197\n<e89c8d> 7198\n<e89c92> 4090\n<e89c93> 7187\n<e89c94> 18508\n<e89c95> 3706\n<e89c96> 18509\n<e89c97> 3806\n<e89c98> 4520\n<e89c99> 18510\n<e89c9a> 7205\n<e89c9b> 18511\n<e89c9c> 2784\n<e89c9d> 18512\n<e89c9e> 7202\n<e89ca1> 2458\n<e89ca2> 7214\n<e89ca3> 7200\n<e89ca4> 18515\n<e89ca5> 7203\n<e89ca9> 7210\n<e89cae> 7204\n<e89cb1> 7209\n<e89cb4> 7208\n<e89cb7> 7211\n<e89cbb> 7201\n<e89cbe> 7206\n<e89cbf> 7212\n<e89d87> 4241\n<e89d88> 7207\n<e89d89> 1212\n<e89d8c> 7220\n<e89d8d> 18543\n<e89d8e> 3958\n<e89d93> 7223\n<e89d94> 18548\n<e89d95> 8494\n<e89d96> 18549\n<e89d97> 2013\n<e89d98> 18550\n<e89d99> 7227\n<e89da0> 7218\n<e89da3> 7224\n<e89da4> 7226\n<e89da5> 7228\n<e89da6> 8626\n<e89dae> 7221\n<e89daf> 18566\n<e89db0> 7219\n<e89db4> 1970\n<e89db5> 18570\n<e89db6> 1500\n<e89db7> 18571\n<e89db8> 8606\n<e89dbb> 7217\n<e89dbc> 7225\n<e89dbf> 18574\n<e89e82> 7213\n<e89e83> 7238\n<e89e84> 9692\n<e89e85> 7235\n<e89e88> 7234\n<e89e8b> 7222\n<e89e8c> 18581\n<e89e8d> 3253\n<e89e93> 7229\nendcidchar\n\n100 begincidchar\n<e89e97> 7237\n<e89e9e> 8300\n<e89e9f> 2813\n<e89ea2> 8742\n<e89ea8> 7231\n<e89eab> 7239\n<e89eac> 7241\n<e89ead> 7236\n<e89eae> 18605\n<e89eaf> 7230\n<e89eb3> 7243\n<e89eb4> 18609\n<e89eb5> 7242\n<e89eba> 2692\n<e89ebb> 9696\n<e89ebc> 18614\n<e89ebd> 7246\n<e89f80> 7248\n<e89f84> 8827\n<e89f85> 18620\n<e89f86> 7233\n<e89f87> 18621\n<e89f88> 9694\n<e89f89> 18622\n<e89f8a> 7249\n<e89f8b> 7244\n<e89f8e> 9697\n<e89f91> 7247\n<e89f92> 7232\n<e89f93> 7245\n<e89f9b> 7250\n<e89fa0> 7252\n<e89fa3> 9685\n<e89fa4> 18640\n<e89fa5> 7240\n<e89faa> 7251\n<e89fab> 18645\n<e89fac> 7787\n<e89fad> 18646\n<e89fae> 7253\n<e89faf> 9691\n<e89fb2> 7817\n<e89fb6> 9689\n<e89fb9> 3970\n<e89fba> 18654\n<e89fbb> 8721\n<e89fbe> 7256\n<e89fbf> 18657\n<e8a083> 4877\n<e8a084> 18661\n<e8a085> 8745\n<e8a086> 9686\n<e8a08a> 7257\n<e8a090> 9693\n<e8a091> 9695\n<e8a092> 18670\n<e8a093> 7255\n<e8a094> 18671\n<e8a095> 3263\n<e8a096> 7254\n<e8a09b> 7258\n<e8a09f> 8175\n<e8a0a0> 18679\n<e8a0a1> 7259\n<e8a0a2> 1347\n<e8a0a3> 9688\n<e8a0b1> 7977\n<e8a0b2> 6797\n<e8a0b6> 7771\n<e8a0b9> 7260\n<e8a0ba> 18698\n<e8a0bb> 8310\n<e8a0bc> 7261\n<e8a180> 4051\n<e8a184> 7338\n<e8a185> 3985\n<e8a186> 8855\n<e8a18a> 9872\n<e8a18b> 18708\n<e8a18c> 3995\n<e8a18d> 4101\n<e8a193> 8511\n<e8a194> 3899\n<e8a197> 2215\n<e8a198> 18716\n<e8a199> 4076\n<e8a19a> 18717\n<e8a19b> 8600\n<e8a19c> 18718\n<e8a19d> 7816\n<e8a1a1> 1945\n<e8a1a2> 5613\n<e8a1a3> 4169\n<e8a1a4> 7078\n<e8a1a5> 1152\n<e8a1a8> 1110\n<e8a1a9> 7079\n<e8a1aa> 18724\n<e8a1ab> 3321\n<e8a1ac> 1257\nendcidchar\n\n100 begincidchar\n<e8a1ad> 18725\n<e8a1ae> 4870\n<e8a1af> 18726\n<e8a1b0> 3482\n<e8a1b1> 18727\n<e8a1b2> 7080\n<e8a1b7> 4563\n<e8a1b8> 18732\n<e8a1b9> 8844\n<e8a1bd> 7081\n<e8a1be> 7358\n<e8a1bf> 7082\n<e8a280> 18736\n<e8a281> 4335\n<e8a282> 7083\n<e8a283> 18737\n<e8a284> 971\n<e8a285> 7359\n<e8a288> 7360\n<e8a28b> 1407\n<e8a28c> 18742\n<e8a28d> 2972\n<e8a292> 3598\n<e8a296> 4015\n<e8a29c> 3729\n<e8a2a2> 7084\n<e8a2a3> 18760\n<e8a2a4> 4871\n<e8a2ab> 1060\n<e8a2ac> 18767\n<e8a2ad> 3867\n<e8a2b1> 1695\n<e8a2b7> 7086\n<e8a2bc> 7087\n<e8a380> 18783\n<e8a381> 1162\n<e8a382> 2586\n<e8a385> 4621\n<e8a386> 7085\n<e8a389> 7088\n<e8a38a> 9713\n<e8a38e> 7090\n<e8a38f> 8204\n<e8a392> 4874\n<e8a393> 18793\n<e8a394> 4200\n<e8a395> 4326\n<e8a398> 7361\n<e8a399> 3220\n<e8a39c> 7768\n<e8a39d> 8876\n<e8a39e> 18798\n<e8a39f> 7362\n<e8a3a2> 7089\n<e8a3a3> 7091\n<e8a3a4> 2416\n<e8a3a5> 7092\n<e8a3a8> 7096\n<e8a3b0> 7098\n<e8a3b1> 7093\n<e8a3b2> 18810\n<e8a3b3> 3338\n<e8a3b4> 2978\n<e8a3b8> 2698\n<e8a3b9> 1877\n<e8a3bc> 7095\n<e8a3bd> 9895\n<e8a3be> 7097\n<e8a3bf> 18816\n<e8a482> 1836\n<e8a487> 9846\n<e8a48a> 7103\n<e8a490> 1933\n<e8a491> 18830\n<e8a492> 1032\n<e8a493> 7101\n<e8a499> 7100\n<e8a49a> 7094\n<e8a49b> 7102\n<e8a4a1> 7099\n<e8a4a5> 3271\n<e8a4aa> 3707\n<e8a4ab> 7105\n<e8a4b0> 5945\n<e8a4b1> 18852\n<e8a4b2> 8161\n<e8a4b3> 9659\n<e8a4b4> 7104\n<e8a4b5> 18853\n<e8a4b6> 7106\n<e8a4b7> 18854\n<e8a4b8> 9662\n<e8a4bb> 8925\n<e8a580> 18861\n<e8a581> 7107\n<e8a584> 3922\n<e8a587> 9661\n<e8a596> 7722\n<e8a59d> 9660\n<e8a59e> 7363\nendcidchar\n\n100 begincidchar\n<e8a59f> 2244\n<e8a5a0> 9658\n<e8a5a4> 9663\n<e8a5a5> 18889\n<e8a5a6> 7108\n<e8a5aa> 8583\n<e8a5ab> 18893\n<e8a5ac> 9835\n<e8a5af> 7807\n<e8a5b2> 8621\n<e8a5bb> 7109\n<e8a5bf> 3846\n<e8a680> 18909\n<e8a681> 4145\n<e8a682> 18910\n<e8a683> 7135\n<e8a686> 1709\n<e8a68b> 8086\n<e8a68f> 7986\n<e8a693> 8324\n<e8a696> 8502\n<e8a697> 18925\n<e8a698> 9400\n<e8a6a1> 9402\n<e8a6a6> 9404\n<e8a6aa> 8420\n<e8a6ab> 18941\n<e8a6ac> 9401\n<e8a6af> 9405\n<e8a6b2> 9406\n<e8a6b7> 9407\n<e8a6ba> 8146\n<e8a6bd> 8189\n<e8a6be> 18954\n<e8a6bf> 9403\n<e8a780> 7981\n<e8a781> 2158\n<e8a782> 1844\n<e8a783> 18955\n<e8a784> 1855\n<e8a785> 2782\n<e8a786> 3434\n<e8a787> 6458\n<e8a788> 2475\n<e8a789> 2340\n<e8a78d> 18956\n<e8a792> 2200\n<e8a796> 7511\n<e8a79a> 7513\n<e8a79b> 18963\n<e8a79c> 7514\n<e8a79d> 18964\n<e8a79e> 7512\n<e8a7a3> 2227\n<e8a7a4> 18969\n<e8a7a5> 7515\n<e8a7a6> 1320\n<e8a7ab> 7516\n<e8a7af> 7517\n<e8a7b3> 6592\n<e8a7b4> 9737\n<e8a7b5> 18980\n<e8a7b6> 9738\n<e8a7b7> 18981\n<e8a7b8> 7828\n<e8a880> 4093\n<e8a881> 8927\n<e8a882> 7883\n<e8a883> 7949\n<e8a887> 4862\n<e8a888> 8055\n<e8a889> 18992\n<e8a88a> 8683\n<e8a88b> 18993\n<e8a88c> 8929\n<e8a88d> 18994\n<e8a88e> 8559\n<e8a88f> 18995\n<e8a890> 8928\n<e8a893> 8682\n<e8a894> 18998\n<e8a895> 8930\n<e8a896> 8395\n<e8a897> 18999\n<e8a898> 8056\n<e8a89b> 7906\n<e8a89c> 19002\n<e8a89d> 8690\n<e8a89e> 19003\n<e8a89f> 8528\n<e8a8a3> 8147\n<e8a8a4> 19007\n<e8a8a5> 8933\n<e8a8aa> 7922\n<e8a8ad> 8479\n<e8a8b1> 8669\n<e8a8b4> 8532\n<e8a8b5> 19019\n<e8a8b6> 8935\n<e8a8ba> 8834\nendcidchar\n\n100 begincidchar\n<e8a8be> 7518\n<e8a8bf> 19026\n<e8a980> 19027\n<e8a981> 8934\n<e8a986> 8936\n<e8a987> 19032\n<e8a988> 6788\n<e8a98e> 8932\n<e8a98f> 19038\n<e8a990> 8810\n<e8a991> 19039\n<e8a992> 8939\n<e8a993> 19040\n<e8a994> 8937\n<e8a995> 8381\n<e8a998> 8938\n<e8a99b> 8893\n<e8a99e> 7838\n<e8a9a1> 8950\n<e8a9a2> 8679\n<e8a9a3> 8726\n<e8a9a6> 8503\n<e8a9a9> 8492\n<e8a9aa> 19053\n<e8a9ab> 7784\n<e8a9ac> 8946\n<e8a9ad> 7991\n<e8a9ae> 8947\n<e8a9af> 19054\n<e8a9b0> 8943\n<e8a9b1> 8016\n<e8a9b2> 7952\n<e8a9b3> 8648\n<e8a9b4> 19055\n<e8a9b5> 8945\n<e8a9b9> 4435\n<e8a9bc> 8944\n<e8a9bf> 8942\n<e8aa84> 8941\n<e8aa85> 8862\n<e8aa86> 8940\n<e8aa87> 8162\n<e8aa88> 19067\n<e8aa89> 4323\n<e8aa8a> 3631\n<e8aa8d> 8446\n<e8aa93> 3419\n<e8aa94> 19073\n<e8aa95> 7855\n<e8aa98> 8758\n<e8aa99> 19076\n<e8aa9a> 8951\n<e8aa9e> 8765\n<e8aa9f> 19080\n<e8aaa0> 7810\n<e8aaa1> 8118\n<e8aaa2> 19081\n<e8aaa3> 8612\n<e8aaa4> 8618\n<e8aaa5> 8952\n<e8aaa6> 8529\n<e8aaa7> 19082\n<e8aaa8> 8032\n<e8aaac> 8519\n<e8aab0> 8517\n<e8aab1> 19089\n<e8aab2> 8156\n<e8aab6> 8961\n<e8aab9> 7925\n<e8aabc> 8728\n<e8aabf> 7878\n<e8ab82> 8960\n<e8ab83> 19101\n<e8ab84> 8884\n<e8ab87> 8553\n<e8ab88> 19104\n<e8ab89> 8957\n<e8ab8a> 19105\n<e8ab8b> 8426\n<e8ab8c> 19106\n<e8ab8d> 8948\n<e8ab8e> 19107\n<e8ab8f> 8955\n<e8ab90> 19108\n<e8ab91> 8956\n<e8ab92> 8231\n<e8ab96> 8288\n<e8ab97> 8959\n<e8ab9b> 8958\n<e8ab9c> 7879\n<e8ab9d> 19115\n<e8ab9e> 8972\n<e8aba2> 8949\n<e8aba3> 19119\n<e8aba4> 8966\n<e8aba5> 19120\n<e8aba6> 8970\n<e8aba7> 8659\n<e8abab> 8963\n<e8abac> 19124\nendcidchar\n\n100 begincidchar\n<e8abad> 8967\n<e8abae> 8971\n<e8abb1> 8031\n<e8abb2> 19127\n<e8abb3> 8969\n<e8abb6> 8962\n<e8abb7> 7940\n<e8abb8> 8861\n<e8abb9> 19130\n<e8abba> 8699\n<e8abbb> 19131\n<e8abbc> 8968\n<e8abbd> 19132\n<e8abbe> 8364\n<e8abbf> 19133\n<e8ac80> 8334\n<e8ac81> 8965\n<e8ac82> 8599\n<e8ac83> 19134\n<e8ac84> 8561\n<e8ac85> 8856\n<e8ac86> 19135\n<e8ac87> 5948\n<e8ac8a> 8023\n<e8ac8e> 8322\n<e8ac8f> 19141\n<e8ac90> 8977\n<e8ac94> 8964\n<e8ac95> 19145\n<e8ac96> 8975\n<e8ac97> 7733\n<e8ac98> 19146\n<e8ac99> 8401\n<e8ac9a> 8976\n<e8ac9b> 8099\n<e8ac9c> 19147\n<e8ac9d> 8662\n<e8aca1> 8710\n<e8aca6> 7519\n<e8aca7> 19155\n<e8aca8> 8973\n<e8acab> 8978\n<e8acac> 8333\n<e8acad> 8979\n<e8acb3> 8931\n<e8acb9> 8122\n<e8acbe> 8312\n<e8acbf> 19172\n<e8ad89> 8840\n<e8ad8e> 8982\n<e8ad8f> 8043\n<e8ad96> 8980\n<e8ad97> 19192\n<e8ad98> 8496\n<e8ad99> 8981\n<e8ad9a> 8552\n<e8ad9b> 19193\n<e8ad9c> 8388\n<e8ada6> 2270\n<e8adab> 8984\n<e8adac> 3016\n<e8adaf> 8729\n<e8adb0> 8727\n<e8adb4> 8405\n<e8adb7> 8010\n<e8adbd> 8768\n<e8ae80> 7891\n<e8ae8a> 7753\n<e8ae8e> 9755\n<e8ae92> 7789\n<e8ae93> 8440\n<e8ae94> 19236\n<e8ae95> 8187\n<e8ae96> 8985\n<e8ae9c> 8974\n<e8ae9d> 19242\n<e8ae9e> 8983\n<e8ae9f> 19243\n<e8aea0> 4887\n<e8aea1> 2105\n<e8aea2> 1512\n<e8aea3> 1719\n<e8aea4> 3242\n<e8aea5> 2072\n<e8aea8> 3625\n<e8aea9> 3230\n<e8aeaa> 4890\n<e8aeab> 3100\n<e8aeac> 19244\n<e8aead> 4062\n<e8aeae> 4208\n<e8aeaf> 4063\n<e8aeb0> 2106\n<e8aeb1> 19245\n<e8aeb2> 2179\n<e8aeb3> 2041\n<e8aeb6> 4081\n<e8aeb7> 4893\n<e8aeb8> 4024\n<e8aeb9> 1582\nendcidchar\n\n100 begincidchar\n<e8aeba> 2690\n<e8aebb> 19246\n<e8aebc> 3524\n<e8aebd> 1674\n<e8aebe> 3361\n<e8aebf> 1632\n<e8af80> 2342\n<e8af81> 4515\n<e8af84> 3039\n<e8af85> 4676\n<e8af86> 3405\n<e8af87> 19247\n<e8af88> 4426\n<e8af89> 3540\n<e8af8a> 4496\n<e8af8b> 4896\n<e8af8c> 4574\n<e8af8d> 1357\n<e8af8e> 4898\n<e8af8f> 4897\n<e8af90> 19248\n<e8af91> 4210\n<e8af95> 3435\n<e8af96> 4902\n<e8af97> 3394\n<e8af9a> 1268\n<e8af9b> 4590\n<e8af9c> 4905\n<e8af9d> 1989\n<e8af9e> 1423\n<e8afa1> 1863\n<e8afa2> 4056\n<e8afa3> 4207\n<e8afa4> 4908\n<e8afa5> 1726\n<e8afa6> 3927\n<e8afa7> 1206\n<e8afaa> 19249\n<e8afab> 2236\n<e8afac> 3819\n<e8afad> 4308\n<e8afae> 4911\n<e8afaf> 3842\n<e8afb0> 4912\n<e8afb1> 4282\n<e8afb2> 2042\n<e8afb3> 4913\n<e8afb4> 3498\n<e8afb5> 3525\n<e8afb6> 4914\n<e8afb7> 3176\n<e8afb8> 4589\n<e8afb9> 4915\n<e8afba> 2934\n<e8afbb> 1536\n<e8afbc> 4916\n<e8afbd> 1641\n<e8afbe> 2395\n<e8afbf> 4917\n<e8b080> 4918\n<e8b081> 3490\n<e8b082> 4919\n<e8b083> 1496\n<e8b084> 4920\n<e8b085> 2571\n<e8b086> 4632\n<e8b087> 4921\n<e8b088> 3595\n<e8b089> 19250\n<e8b08a> 4209\n<e8b08b> 2836\n<e8b08c> 4922\n<e8b08d> 1502\n<e8b08e> 2022\n<e8b08f> 4923\n<e8b090> 3966\n<e8b093> 3788\n<e8b097> 1214\n<e8b098> 4931\n<e8b099> 4929\n<e8b09a> 4113\n<e8b09b> 4930\n<e8b09c> 2778\n<e8b09d> 4932\n<e8b09e> 19251\n<e8b0a2> 3974\n<e8b0a3> 4140\n<e8b0a4> 1028\n<e8b0a5> 4936\n<e8b0a6> 3112\n<e8b0a7> 4937\n<e8b0a8> 2248\n<e8b0a9> 2726\n<e8b0ac> 2818\n<e8b0ad> 3594\n<e8b0b0> 2473\n<e8b0b1> 3062\n<e8b0b4> 3121\n<e8b0b7> 1825\n<e8b180> 19260\nendcidchar\n\n100 begincidchar\n<e8b181> 2050\n<e8b186> 1528\n<e8b187> 7414\n<e8b188> 8392\n<e8b189> 7415\n<e8b18c> 3732\n<e8b190> 7933\n<e8b195> 7445\n<e8b19a> 6544\n<e8b1a1> 3936\n<e8b1a2> 2004\n<e8b1aa> 1911\n<e8b1ab> 4328\n<e8b1b3> 5597\n<e8b1b8> 7504\n<e8b1b9> 1043\n<e8b1ba> 1209\n<e8b282> 7505\n<e8b285> 7507\n<e8b289> 1928\n<e8b28a> 7506\n<e8b28b> 19314\n<e8b28c> 2743\n<e8b294> 7509\n<e8b298> 7508\n<e8b29d> 7739\n<e8b29e> 8831\n<e8b29f> 19329\n<e8b2a0> 7948\n<e8b2a1> 7769\n<e8b2a2> 7972\n<e8b2a7> 8378\n<e8b2a8> 8037\n<e8b2a9> 7920\n<e8b2aa> 8548\n<e8b2ab> 7984\n<e8b2ac> 8801\n<e8b2af> 8866\n<e8b2b0> 9387\n<e8b2b1> 19336\n<e8b2b2> 9391\n<e8b2b3> 7912\n<e8b2b4> 7993\n<e8b2b5> 19337\n<e8b2b6> 7752\n<e8b2b7> 8304\n<e8b2b8> 7848\n<e8b2b9> 19338\n<e8b2ba> 9388\n<e8b2bb> 7927\n<e8b2bc> 8566\n<e8b2bd> 9389\n<e8b2be> 19339\n<e8b2bf> 8315\n<e8b380> 8005\n<e8b381> 9386\n<e8b382> 8267\n<e8b383> 8239\n<e8b384> 8026\n<e8b385> 9392\n<e8b386> 19340\n<e8b387> 8887\n<e8b388> 8063\n<e8b389> 19341\n<e8b38a> 8805\n<e8b391> 9394\n<e8b392> 8475\n<e8b393> 7761\n<e8b394> 19348\n<e8b395> 9396\n<e8b39a> 9395\n<e8b39b> 19353\n<e8b39c> 7839\n<e8b39d> 19354\n<e8b39e> 8472\n<e8b39f> 19355\n<e8b3a0> 8372\n<e8b3a1> 9135\n<e8b3a2> 8635\n<e8b3a3> 8306\n<e8b3a4> 8085\n<e8b3a5> 19356\n<e8b3a6> 7946\n<e8b3a7> 9398\n<e8b3aa> 8849\n<e8b3ab> 9397\n<e8b3ac> 8824\n<e8b3ad> 7892\n<e8b3b4> 8179\n<e8b3ba> 8873\n<e8b3bb> 9399\n<e8b3bc> 7976\n<e8b3bd> 8457\n<e8b3be> 8903\n<e8b3bf> 19370\n<e8b484> 9390\n<e8b485> 8881\n<e8b488> 8806\n<e8b489> 19377\n<e8b48a> 8795\nendcidchar\n\n100 begincidchar\n<e8b48b> 8900\n<e8b48c> 19378\n<e8b48d> 8469\n<e8b48e> 19379\n<e8b48f> 8746\n<e8b490> 9393\n<e8b496> 8509\n<e8b49b> 7957\n<e8b49c> 8796\n<e8b49d> 1053\n<e8b49e> 4491\n<e8b49f> 1717\n<e8b4a0> 19389\n<e8b4a1> 1802\n<e8b4a2> 1165\n<e8b4a3> 4403\n<e8b4a4> 3898\n<e8b4a5> 999\n<e8b4a6> 4460\n<e8b4a7> 2058\n<e8b4a8> 4553\n<e8b4a9> 1620\n<e8b4aa> 3587\n<e8b4ab> 3029\n<e8b4ac> 1098\n<e8b4ad> 1811\n<e8b4ae> 4603\n<e8b4af> 1850\n<e8b4b0> 1598\n<e8b4b1> 2157\n<e8b4b4> 3660\n<e8b4b5> 1868\n<e8b4b6> 6446\n<e8b4b7> 1406\n<e8b4b8> 2744\n<e8b4b9> 1646\n<e8b4ba> 1935\n<e8b4bb> 6447\n<e8b4bc> 4407\n<e8b4bd> 6448\n<e8b4be> 2121\n<e8b4bf> 2036\n<e8b580> 6449\n<e8b581> 2599\n<e8b582> 2655\n<e8b583> 4386\n<e8b584> 4647\n<e8b587> 6454\n<e8b58a> 3351\n<e8b58b> 1710\n<e8b58c> 1539\n<e8b58d> 6455\n<e8b58e> 3457\n<e8b58f> 3334\n<e8b590> 1360\n<e8b593> 5691\n<e8b594> 2979\n<e8b595> 6456\n<e8b596> 2464\n<e8b597> 19392\n<e8b598> 4629\n<e8b599> 6457\n<e8b59a> 4617\n<e8b59b> 3287\n<e8b59c> 4745\n<e8b59d> 4739\n<e8b59e> 4385\n<e8b59f> 19393\n<e8b5a0> 4412\n<e8b5a1> 3325\n<e8b5a2> 4243\n<e8b5a3> 1742\n<e8b5a4> 1285\n<e8b5a5> 19394\n<e8b5a6> 3355\n<e8b5a7> 7412\n<e8b5ab> 1932\n<e8b5ac> 19398\n<e8b5ad> 7413\n<e8b5b0> 4668\n<e8b5b3> 7407\n<e8b5b4> 1707\n<e8b5b5> 4469\n<e8b5b6> 1738\n<e8b5b7> 3087\n<e8b680> 19411\n<e8b681> 1256\n<e8b684> 7408\n<e8b685> 1233\n<e8b68a> 4352\n<e8b68b> 3188\n<e8b691> 7410\n<e8b694> 7409\n<e8b695> 7956\n<e8b699> 8826\n<e8b69f> 3614\n<e8b6a3> 3199\n<e8b6a8> 8430\n<e8b6b1> 7411\n<e8b6b2> 9720\nendcidchar\n\n100 begincidchar\n<e8b6b3> 4672\n<e8b6b4> 2944\n<e8b6b5> 7452\n<e8b6b8> 7447\n<e8b6b9> 19450\n<e8b6ba> 7455\n<e8b6bb> 19451\n<e8b6bc> 7454\n<e8b6bd> 19452\n<e8b6be> 4537\n<e8b6bf> 7453\n<e8b783> 4353\n<e8b784> 7456\n<e8b785> 19456\n<e8b786> 7464\n<e8b78b> 986\n<e8b78c> 1497\n<e8b78d> 19461\n<e8b790> 19462\n<e8b791> 2973\n<e8b79a> 7459\n<e8b79b> 7463\n<e8b79c> 19469\n<e8b79d> 2319\n<e8b79e> 7460\n<e8b79f> 1781\n<e8b7a3> 7468\n<e8b7a4> 7471\n<e8b7a8> 2420\n<e8b7a9> 19476\n<e8b7aa> 1867\n<e8b7ab> 7448\n<e8b7ac> 7465\n<e8b7af> 2654\n<e8b7b3> 3659\n<e8b7b4> 19482\n<e8b7b5> 2156\n<e8b7b6> 19483\n<e8b7b9> 7469\n<e8b7ba> 1572\n<e8b7bb> 7470\n<e8b7bc> 19484\n<e8b7bd> 7473\n<e8b885> 7449\n<e8b889> 7472\n<e8b88a> 4256\n<e8b88b> 19495\n<e8b88c> 1297\n<e8b88f> 3575\n<e8b890> 8084\n<e8b894> 7474\n<e8b89d> 7475\n<e8b89e> 2320\n<e8b89f> 7476\n<e8b8a2> 3634\n<e8b8a3> 7479\n<e8b8a9> 1167\n<e8b8aa> 4662\n<e8b8ab> 19516\n<e8b8ac> 7477\n<e8b8ad> 19517\n<e8b8ae> 7478\n<e8b8af> 7480\n<e8b8b0> 19518\n<e8b8b1> 7486\n<e8b8b4> 8752\n<e8b8b5> 7484\n<e8b8b9> 7483\n<e8b8ba> 7481\n<e8b8bd> 7485\n<e8b980> 7482\n<e8b983> 19528\n<e8b984> 3638\n<e8b987> 5947\n<e8b988> 1433\n<e8b989> 7487\n<e8b98a> 7492\n<e8b98b> 3574\n<e8b98c> 9725\n<e8b995> 9728\n<e8b999> 7450\n<e8b9a3> 9734\n<e8b9a6> 1069\n<e8b9a9> 7451\n<e8b9ac> 1446\n<e8b9ad> 1195\n<e8b9ae> 19555\n<e8b9af> 7496\n<e8b9b0> 7493\n<e8b9b1> 19556\n<e8b9b2> 1558\n<e8b9b3> 19557\n<e8b9b4> 7497\n<e8b9b5> 19558\n<e8b9b6> 7494\n<e8b9ba> 9727\n<e8b9bb> 19562\n<e8b9bc> 7495\n<e8b9bf> 1373\n<e8ba80> 19565\nendcidchar\n\n100 begincidchar\n<e8ba81> 4397\n<e8ba85> 7498\n<e8ba86> 19569\n<e8ba87> 1310\n<e8ba88> 19570\n<e8ba89> 9724\n<e8ba8a> 7820\n<e8ba8b> 9730\n<e8ba8c> 19571\n<e8ba8d> 8781\n<e8ba8e> 19572\n<e8ba8f> 7499\n<e8ba90> 7501\n<e8ba91> 9732\n<e8ba92> 9726\n<e8ba93> 9731\n<e8ba94> 7500\n<e8ba9a> 9729\n<e8ba9b> 19578\n<e8ba9c> 7502\n<e8ba9d> 19579\n<e8ba9e> 7503\n<e8baa1> 9733\n<e8baa5> 7843\n<e8baa6> 9736\n<e8baaa> 9735\n<e8baab> 3366\n<e8baac> 1795\n<e8baaf> 3192\n<e8bab2> 1570\n<e8baba> 3612\n<e8bb80> 8432\n<e8bb8a> 7803\n<e8bb8b> 8807\n<e8bb8c> 7990\n<e8bb8d> 8150\n<e8bb8e> 6392\n<e8bb92> 8672\n<e8bb93> 19616\n<e8bb94> 9356\n<e8bb9b> 9357\n<e8bb9f> 8450\n<e8bba4> 9364\n<e8bbab> 9363\n<e8bbb2> 9358\n<e8bbb8> 8857\n<e8bbb9> 9361\n<e8bbba> 9366\n<e8bbbb> 9359\n<e8bbbc> 9362\n<e8bbbd> 19647\n<e8bbbe> 9367\n<e8bbbf> 19648\n<e8bc83> 8113\n<e8bc84> 19652\n<e8bc85> 9370\n<e8bc86> 19653\n<e8bc87> 9369\n<e8bc88> 19654\n<e8bc89> 8792\n<e8bc8a> 9368\n<e8bc92> 9371\n<e8bc93> 19662\n<e8bc94> 7945\n<e8bc95> 8422\n<e8bc9b> 8230\n<e8bc9c> 9375\n<e8bc9d> 8025\n<e8bca5> 7995\n<e8bca6> 9372\n<e8bca9> 7738\n<e8bcaa> 8283\n<e8bcaf> 8048\n<e8bcb3> 9376\n<e8bcb8> 8507\n<e8bcbb> 7943\n<e8bcbe> 8816\n<e8bcbf> 8759\n<e8bd82> 9426\n<e8bd83> 19692\n<e8bd84> 8627\n<e8bd85> 8773\n<e8bd86> 9377\n<e8bd89> 8872\n<e8bd8d> 8828\n<e8bd8e> 8112\n<e8bd94> 9378\n<e8bd9f> 8006\n<e8bda0> 19713\n<e8bda1> 9088\n<e8bda2> 9365\n<e8bda3> 19714\n<e8bda4> 9360\n<e8bda5> 19715\n<e8bda6> 1242\n<e8bda7> 4417\n<e8bda8> 1861\n<e8bda9> 4036\n<e8bdaa> 19716\n<e8bdab> 6369\nendcidchar\n\n100 begincidchar\n<e8bdac> 4615\n<e8bdad> 6370\n<e8bdae> 2685\n<e8bdaf> 3272\n<e8bdb0> 1947\n<e8bdb4> 4576\n<e8bdb7> 6377\n<e8bdb8> 6376\n<e8bdbb> 3166\n<e8bdbc> 6380\n<e8bdbd> 4379\n<e8bdbe> 6381\n<e8bdbf> 2207\n<e8be80> 19717\n<e8be83> 2208\n<e8be84> 6384\n<e8be85> 1699\n<e8be86> 2567\n<e8be87> 6385\n<e8be88> 1051\n<e8be89> 2025\n<e8be8a> 1870\n<e8be8b> 6386\n<e8be8c> 19718\n<e8be90> 1685\n<e8be91> 2080\n<e8be92> 19719\n<e8be93> 3451\n<e8be94> 5492\n<e8be95> 4338\n<e8be96> 3882\n<e8be97> 4440\n<e8be98> 6390\n<e8be99> 4479\n<e8be9a> 6391\n<e8be9b> 3980\n<e8be9c> 1813\n<e8be9d> 19720\n<e8be9e> 1354\n<e8be9f> 1090\n<e8bea3> 2460\n<e8bea6> 7728\n<e8bea7> 19726\n<e8beaa> 19727\n<e8beab> 1105\n<e8beac> 19728\n<e8bead> 7837\n<e8beae> 7755\n<e8beaf> 7754\n<e8beb0> 1250\n<e8beb1> 3267\n<e8beb2> 8362\n<e8beb6> 5949\n<e8beb9> 1096\n<e8bebd> 2578\n<e8bebe> 1394\n<e8bebf> 19737\n<e8bf80> 19738\n<e8bf81> 3109\n<e8bf82> 4285\n<e8bf83> 19739\n<e8bf84> 3096\n<e8bf85> 4065\n<e8bf86> 19740\n<e8bf87> 1878\n<e8bf88> 2716\n<e8bf8e> 4242\n<e8bf8f> 19746\n<e8bf90> 4366\n<e8bf91> 2253\n<e8bf92> 19747\n<e8bf93> 5950\n<e8bf94> 1618\n<e8bf95> 5951\n<e8bf98> 1998\n<e8bf99> 4483\n<e8bf9a> 19750\n<e8bf9b> 2249\n<e8bf9c> 4345\n<e8bf9d> 3764\n<e8bf9e> 2549\n<e8bf9f> 1278\n<e8bfa2> 3657\n<e8bfa3> 19753\n<e8bfa4> 5954\n<e8bfa5> 5952\n<e8bfa6> 5956\n<e8bfa7> 19754\n<e8bfa8> 5958\n<e8bfa9> 5955\n<e8bfaa> 1456\n<e8bfab> 3047\n<e8bfac> 19755\n<e8bfad> 1501\n<e8bfae> 5953\n<e8bfaf> 19756\n<e8bfb0> 3469\n<e8bfb3> 5957\n<e8bfb4> 9851\n<e8bfb7> 2777\nendcidchar\n\n100 begincidchar\n<e8bfb8> 1070\n<e8bfb9> 2070\n<e8bfbd> 4628\n<e98080> 3708\n<e98081> 3522\n<e98082> 3425\n<e98083> 3622\n<e98084> 5960\n<e98085> 5959\n<e98086> 2889\n<e98089> 4042\n<e9808a> 4064\n<e9808b> 5961\n<e9808c> 19768\n<e9808d> 5964\n<e9808e> 19769\n<e9808f> 3689\n<e98090> 4591\n<e98091> 5963\n<e98092> 1470\n<e98093> 19770\n<e98094> 3695\n<e98095> 9202\n<e98096> 5965\n<e98097> 1529\n<e98098> 19771\n<e98099> 8830\n<e9809a> 3673\n<e9809b> 1853\n<e9809c> 19772\n<e9809d> 3420\n<e9809e> 1270\n<e9809f> 3534\n<e980a0> 4399\n<e980a1> 5966\n<e980a2> 1671\n<e980a3> 8217\n<e980a6> 5962\n<e980ad> 5969\n<e980ae> 1409\n<e980af> 5970\n<e980b2> 8123\n<e980b7> 19785\n<e980b8> 4196\n<e980bb> 2694\n<e980bc> 1071\n<e980bd> 19788\n<e980be> 4295\n<e980bf> 19789\n<e98180> 19790\n<e98181> 1564\n<e98182> 3553\n<e98183> 19791\n<e98184> 5971\n<e98187> 4315\n<e9818b> 8787\n<e9818c> 19797\n<e9818d> 1106\n<e9818e> 7998\n<e9818f> 1587\n<e98190> 5974\n<e98193> 1441\n<e98194> 7846\n<e98195> 8590\n<e98196> 19798\n<e98197> 4172\n<e98198> 5976\n<e9819b> 5978\n<e9819c> 8684\n<e9819d> 19801\n<e9819e> 7870\n<e9819f> 19802\n<e981a0> 8778\n<e981a1> 19803\n<e981a2> 5977\n<e981a3> 3119\n<e981a4> 19804\n<e981a5> 4138\n<e981a8> 5975\n<e981a9> 8499\n<e981ad> 4389\n<e981ae> 4475\n<e981b2> 7812\n<e981b3> 19813\n<e981b4> 5980\n<e981b5> 4686\n<e981b6> 19814\n<e981b7> 8399\n<e981b8> 8674\n<e981b9> 19815\n<e981ba> 8719\n<e981bb> 19816\n<e981bc> 8233\n<e981bd> 5981\n<e981be> 19817\n<e981bf> 1093\n<e98280> 4132\n<e98281> 8307\n<e98282> 5982\n<e98283> 5984\nendcidchar\n\n100 begincidchar\n<e98284> 8021\n<e98287> 9201\n<e98288> 5983\n<e98289> 19820\n<e9828a> 7750\n<e9828b> 5985\n<e9828f> 8291\n<e98290> 9203\n<e98291> 4191\n<e98292> 19824\n<e98293> 1452\n<e98294> 19825\n<e98295> 6167\n<e98296> 19826\n<e98297> 4967\n<e98298> 19827\n<e98299> 4970\n<e9829a> 19828\n<e9829b> 4968\n<e9829c> 19829\n<e9829d> 4969\n<e982a1> 4972\n<e982a2> 3994\n<e982a3> 2858\n<e982a6> 1017\n<e982aa> 3963\n<e982ab> 19838\n<e982ac> 4971\n<e982ad> 19839\n<e982ae> 4271\n<e982af> 1889\n<e982b0> 4978\n<e982b1> 3182\n<e982b2> 19840\n<e982b3> 4974\n<e982b4> 4973\n<e982b5> 3348\n<e982b6> 4975\n<e982b7> 19841\n<e982b8> 4977\n<e982b9> 4667\n<e982ba> 4976\n<e982bb> 2595\n<e982be> 4981\n<e982bf> 19844\n<e98380> 19845\n<e98381> 4313\n<e98384> 4983\n<e98385> 4980\n<e98386> 19848\n<e98387> 4984\n<e9838a> 2189\n<e9838e> 2484\n<e9838f> 4979\n<e98390> 4982\n<e98391> 4514\n<e98392> 19854\n<e98393> 4985\n<e98397> 4989\n<e9839b> 4990\n<e9839c> 4988\n<e9839d> 1913\n<e9839e> 19861\n<e9839f> 8990\n<e983a0> 19862\n<e983a1> 2353\n<e983a2> 4987\n<e983a6> 4986\n<e983a7> 4362\n<e983a8> 1158\n<e983ab> 4991\n<e983ac> 19868\n<e983ad> 1874\n<e983ae> 19869\n<e983af> 4992\n<e983b4> 1248\n<e983b5> 8755\n<e983b8> 1415\n<e983bd> 1531\n<e983be> 4993\n<e983bf> 19880\n<e98482> 1588\n<e98483> 19883\n<e98484> 4994\n<e98485> 19884\n<e98486> 8992\n<e98489> 8647\n<e98492> 8892\n<e98493> 19895\n<e98494> 8988\n<e98495> 19896\n<e98496> 8785\n<e98499> 1074\n<e9849e> 4996\n<e984a2> 4995\n<e984a3> 4997\n<e984a7> 7867\n<e984ad> 8839\n<e984ae> 19914\n<e984af> 4999\nendcidchar\n\n100 begincidchar\n<e984b0> 8237\n<e984b1> 4998\n<e984b2> 7851\n<e984b3> 19915\n<e984b4> 8989\n<e984b5> 19916\n<e984b6> 8991\n<e984b9> 5000\n<e984ba> 8987\n<e98583> 5001\n<e98586> 5002\n<e98587> 19929\n<e98588> 8993\n<e98589> 4276\n<e9858a> 7416\n<e9858b> 3186\n<e9858c> 4640\n<e9858d> 2981\n<e98590> 7417\n<e98591> 19930\n<e98592> 2293\n<e98597> 4026\n<e9859a> 1648\n<e9859d> 4368\n<e9859e> 3581\n<e985a1> 7422\n<e985a2> 7421\n<e985a3> 1887\n<e985a4> 7420\n<e985a5> 3531\n<e985a9> 7424\n<e985aa> 2493\n<e985ab> 19944\n<e985ac> 1295\n<e985ad> 19945\n<e985ae> 3675\n<e985af> 7425\n<e985b0> 7423\n<e985b1> 2181\n<e985b2> 7428\n<e985b3> 19946\n<e985b4> 7429\n<e985b5> 2206\n<e985b6> 2749\n<e985b7> 2414\n<e985b8> 3542\n<e985b9> 7430\n<e985bf> 2899\n<e98685> 7432\n<e98686> 19955\n<e98687> 1343\n<e98688> 19956\n<e98689> 4682\n<e9868a> 19957\n<e9868b> 1370\n<e9868c> 7431\n<e9868d> 7434\n<e98690> 7433\n<e98691> 7435\n<e98692> 3996\n<e98696> 8789\n<e9869a> 2774\n<e9869b> 3204\n<e9869c> 7823\n<e986aa> 7438\n<e986ab> 8716\n<e986ac> 8100\n<e986b4> 7443\n<e986b5> 7442\n<e986ba> 7444\n<e98780> 8347\n<e98781> 8664\n<e98782> 19990\n<e98783> 9722\n<e98784> 19991\n<e98785> 9721\n<e98786> 19992\n<e98787> 1168\n<e98788> 19993\n<e98789> 4281\n<e9878a> 3428\n<e9878b> 8500\n<e9878c> 2522\n<e9878d> 4567\n<e9878e> 4151\n<e9878f> 2568\n<e98790> 19994\n<e98791> 2241\n<e98795> 9464\n<e98796> 19995\n<e98797> 9463\n<e98798> 7880\n<e98799> 9462\n<e9879c> 1701\n<e9879d> 8832\n<e987a3> 7877\n<e987a4> 9467\n<e987a7> 9466\n<e987a8> 20005\n<e987a9> 7917\nendcidchar\n\n100 begincidchar\n<e987b5> 9469\n<e987b6> 20017\n<e987b7> 9465\n<e987b8> 20018\n<e987b9> 9470\n<e987ba> 8397\n<e98880> 9480\n<e98881> 9476\n<e98884> 9478\n<e98888> 9471\n<e98889> 8336\n<e9888d> 7901\n<e9888e> 7973\n<e9888f> 20032\n<e98890> 9475\n<e98891> 9474\n<e98894> 7802\n<e98895> 8358\n<e9889e> 8149\n<e988a3> 7953\n<e988a4> 20047\n<e988a5> 9479\n<e988a6> 9472\n<e988a7> 9477\n<e988ae> 9497\n<e988af> 20054\n<e988b0> 9493\n<e988b3> 9484\n<e988b4> 8241\n<e988b7> 9483\n<e988b8> 9487\n<e988b9> 9498\n<e988ba> 9481\n<e988bd> 9486\n<e988be> 8756\n<e988bf> 9491\n<e98980> 8064\n<e98985> 9473\n<e98988> 9495\n<e98989> 9494\n<e9898d> 9496\n<e98991> 7766\n<e98995> 9485\n<e98996> 20076\n<e98997> 8403\n<e9899a> 8314\n<e9899b> 8398\n<e9899e> 9488\n<e989a2> 7765\n<e989a6> 9482\n<e989b4> 2155\n<e989b8> 8106\n<e989b9> 20101\n<e989ba> 9502\n<e989bb> 7967\n<e989bf> 9517\n<e98a80> 8733\n<e98a83> 9522\n<e98a84> 20107\n<e98a85> 8571\n<e98a8e> 7552\n<e98a91> 8623\n<e98a92> 20118\n<e98a93> 9516\n<e98a96> 9512\n<e98a97> 20121\n<e98a98> 8332\n<e98a99> 20122\n<e98a9a> 9519\n<e98a9b> 20123\n<e98a9c> 8636\n<e98aa0> 9501\n<e98aa3> 9525\n<e98aa4> 20129\n<e98aa5> 8717\n<e98aa6> 9510\n<e98aa7> 20130\n<e98aa8> 9524\n<e98aa9> 9514\n<e98aaa> 9503\n<e98aab> 9521\n<e98aac> 9500\n<e98aad> 20131\n<e98aae> 7553\n<e98ab1> 9509\n<e98ab7> 8653\n<e98ab8> 20139\n<e98ab9> 8666\n<e98aba> 20140\n<e98abb> 8562\n<e98abc> 9534\n<e98b80> 20144\n<e98b81> 8271\n<e98b82> 20145\n<e98b83> 9539\n<e98b84> 20146\n<e98b85> 8663\n<e98b86> 20147\n<e98b87> 7740\n<e98b88> 7554\nendcidchar\n\n100 begincidchar\n<e98b8c> 9513\n<e98b8f> 9505\n<e98b92> 7935\n<e98b9d> 9535\n<e98b9e> 20165\n<e98b9f> 9540\n<e98ba3> 9507\n<e98ba4> 7824\n<e98ba5> 9530\n<e98ba6> 9541\n<e98ba7> 20169\n<e98ba8> 9533\n<e98ba9> 20170\n<e98baa> 8385\n<e98bad> 8451\n<e98bae> 9504\n<e98baf> 9532\n<e98bb0> 9531\n<e98bb1> 9528\n<e98bb6> 9536\n<e98bb7> 20177\n<e98bb8> 8141\n<e98bbc> 7960\n<e98c80> 20184\n<e98c81> 9547\n<e98c86> 9543\n<e98c90> 8880\n<e98c91> 20196\n<e98c92> 9542\n<e98c95> 9548\n<e98c98> 7834\n<e98c99> 9554\n<e98c9a> 9520\n<e98c9b> 9545\n<e98c9f> 9553\n<e98ca0> 7882\n<e98ca1> 20204\n<e98ca2> 8402\n<e98ca6> 8120\n<e98ca7> 20208\n<e98ca8> 8313\n<e98cab> 8619\n<e98cae> 9549\n<e98caf> 7845\n<e98cb2> 8268\n<e98cb3> 8320\n<e98cb6> 9837\n<e98cb7> 20217\n<e98cb8> 9527\n<e98cbe> 7555\n<e98cbf> 20223\n<e98d80> 9546\n<e98d81> 8632\n<e98d82> 20224\n<e98d83> 9550\n<e98d86> 9468\n<e98d87> 9556\n<e98d8b> 7996\n<e98d8c> 20230\n<e98d8d> 7893\n<e98d94> 9558\n<e98d98> 8808\n<e98d9b> 7894\n<e98da4> 9559\n<e98da5> 9555\n<e98da9> 9544\n<e98daa> 7556\n<e98dab> 20253\n<e98dac> 8412\n<e98db0> 9561\n<e98db5> 8087\n<e98db6> 9557\n<e98dba> 8829\n<e98dbe> 9598\n<e98dbf> 20267\n<e98e82> 8316\n<e98e83> 20270\n<e98e84> 9562\n<e98e87> 9566\n<e98e8a> 7732\n<e98e8f> 7558\n<e98e96> 8542\n<e98e97> 20285\n<e98e98> 9568\n<e98ea2> 8610\n<e98ea3> 9044\n<e98ea6> 9571\n<e98ea7> 9511\n<e98ea8> 20297\n<e98ea9> 9518\n<e98eaa> 9560\n<e98eab> 20298\n<e98eac> 7963\n<e98ead> 20299\n<e98eae> 8835\n<e98eaf> 20300\n<e98eb0> 9572\n<e98eb3> 8352\n<e98eb4> 20303\n<e98eb5> 9573\nendcidchar\n\n100 begincidchar\n<e98eb8> 9569\n<e98ebf> 9570\n<e98f83> 9580\n<e98f87> 9581\n<e98f88> 8224\n<e98f89> 20318\n<e98f8a> 7557\n<e98f8b> 20319\n<e98f8c> 9567\n<e98f8d> 9578\n<e98f91> 9582\n<e98f96> 7681\n<e98f97> 9529\n<e98f98> 9564\n<e98f9e> 9579\n<e98f9f> 7791\n<e98fa0> 20330\n<e98fa1> 8132\n<e98fa2> 9575\n<e98fa3> 20331\n<e98fa4> 9563\n<e98fa8> 9757\n<e98fb5> 9515\n<e98fb6> 20347\n<e98fb7> 9585\n<e98fb8> 20348\n<e98fb9> 9591\n<e99083> 9506\n<e9908b> 9523\n<e99090> 8234\n<e99091> 20369\n<e99092> 9526\n<e99093> 9587\n<e99094> 9583\n<e99098> 8851\n<e99099> 9592\n<e9909d> 9584\n<e990a0> 9589\n<e990a8> 9565\n<e990ae> 8218\n<e990b2> 9594\n<e990b3> 8198\n<e990b4> 20391\n<e990b5> 8567\n<e990b8> 9499\n<e990b9> 20394\n<e990ba> 9508\n<e990be> 7559\n<e990bf> 9595\n<e99184> 8867\n<e9918a> 9593\n<e9918b> 20407\n<e9918c> 9574\n<e99192> 8083\n<e99193> 20413\n<e99194> 9596\n<e991a0> 9492\n<e991a3> 9597\n<e991a4> 20427\n<e991a5> 9586\n<e991ab> 7560\n<e991ac> 20433\n<e991ad> 9588\n<e991b0> 8782\n<e991b1> 20436\n<e991b2> 8646\n<e991b7> 8351\n<e991b8> 20441\n<e991b9> 9590\n<e991bc> 8292\n<e991bd> 8895\n<e991be> 9756\n<e991bf> 8798\n<e99288> 4492\n<e99289> 1507\n<e9928a> 6802\n<e9928b> 6801\n<e9928e> 3106\n<e99291> 20449\n<e99292> 1613\n<e99293> 1495\n<e99294> 6807\n<e99295> 6809\n<e99296> 20450\n<e99297> 6808\n<e99298> 20451\n<e99299> 1729\n<e9929d> 1562\n<e9929e> 1235\n<e9929f> 4562\n<e992a0> 2857\n<e992a1> 1054\n<e992a2> 1745\n<e992a5> 4354\n<e992a6> 3154\n<e992a7> 2346\n<e992a8> 3816\n<e992a9> 1804\n<e992aa> 6816\n<e992ab> 6815\nendcidchar\n\n100 begincidchar\n<e992ac> 6818\n<e992ad> 6817\n<e992ae> 2918\n<e992b1> 3115\n<e992b2> 6821\n<e992b3> 3116\n<e992b4> 6822\n<e992b5> 1134\n<e992bb> 4679\n<e992be> 2123\n<e992bf> 6830\n<e99380> 4272\n<e99381> 3661\n<e99382> 1139\n<e99383> 2606\n<e99384> 6831\n<e99385> 3107\n<e99386> 2738\n<e99387> 20452\n<e9938f> 20453\n<e99398> 6846\n<e99399> 6845\n<e9939a> 20456\n<e9939b> 6847\n<e9939c> 3678\n<e9939d> 2664\n<e993a1> 4418\n<e993a2> 6851\n<e993a3> 3872\n<e993a6> 20457\n<e993a9> 6857\n<e993aa> 6856\n<e993ab> 6858\n<e993ac> 1776\n<e993ad> 2815\n<e993b0> 2195\n<e993b1> 4166\n<e993b2> 1216\n<e993b6> 4223\n<e993b7> 6864\n<e993b8> 4604\n<e993b9> 6865\n<e993ba> 3051\n<e993bb> 20458\n<e993be> 2557\n<e993bf> 6868\n<e99480> 3943\n<e99481> 3565\n<e99482> 6870\n<e99483> 6869\n<e99484> 1311\n<e99485> 1873\n<e99488> 4013\n<e9948b> 1667\n<e9948c> 3978\n<e99490> 3276\n<e99491> 3635\n<e99497> 4481\n<e99498> 6883\n<e99499> 1392\n<e9949a> 2735\n<e9949b> 6884\n<e9949c> 20459\n<e994a0> 20460\n<e994a1> 3852\n<e994a2> 6888\n<e994a3> 2695\n<e994a4> 1339\n<e994a5> 4627\n<e994a6> 2246\n<e994a7> 20461\n<e994a8> 3892\n<e994a9> 6891\n<e994ac> 6892\n<e994ad> 1510\n<e994ae> 2159\n<e994af> 2321\n<e994b0> 2769\n<e994b3> 20462\n<e994b4> 6895\n<e994b5> 6903\n<e994b9> 3135\n<e994ba> 6937\n<e994bb> 1548\n<e994bc> 6899\n<e994bd> 20463\n<e99580> 1541\n<e99581> 2755\n<e99582> 6902\n<e99583> 20464\n<e99587> 4499\n<e99588> 20465\n<e99589> 6907\n<e9958a> 2906\n<e9958b> 20466\n<e9958c> 6908\n<e9958d> 2907\n<e99590> 1759\n<e99591> 1026\n<e99595> 20467\nendcidchar\n\n100 begincidchar\n<e9959a> 20468\n<e9959b> 6918\n<e9959c> 2276\n<e9959d> 6921\n<e995a0> 20469\n<e995a3> 2582\n<e995ad> 2499\n<e995ae> 20470\n<e995af> 6933\n<e995b0> 2550\n<e995b6> 3919\n<e995b7> 7797\n<e995bf> 1225\n<e99680> 8317\n<e99681> 20480\n<e99682> 9151\n<e99683> 8467\n<e99686> 9152\n<e99689> 7749\n<e9968a> 20485\n<e9968b> 8152\n<e9968c> 9156\n<e9968d> 20486\n<e9968e> 9154\n<e9968f> 8452\n<e99690> 20487\n<e99691> 8637\n<e99692> 20488\n<e99693> 8071\n<e99694> 9155\n<e99698> 8809\n<e996a1> 8003\n<e996a2> 20500\n<e996a3> 7966\n<e996a4> 9849\n<e996a5> 7915\n<e996a8> 7989\n<e996a9> 8330\n<e996aa> 20503\n<e996ab> 9159\n<e996ac> 9161\n<e996ad> 9158\n<e996b2> 8783\n<e996b6> 9163\n<e996b9> 8691\n<e996ba> 20513\n<e996bb> 8695\n<e996bc> 9167\n<e996bd> 9166\n<e996be> 9162\n<e996bf> 9165\n<e99783> 9168\n<e99786> 9836\n<e99787> 20519\n<e99788> 9153\n<e99789> 20520\n<e9978a> 8174\n<e9978b> 9169\n<e9978c> 8184\n<e99790> 9171\n<e99794> 9170\n<e99795> 9172\n<e99796> 7832\n<e9979c> 7980\n<e9979d> 20532\n<e9979e> 9173\n<e997a1> 7793\n<e997a2> 9873\n<e997a5> 9157\n<e997a8> 2762\n<e997a9> 5765\n<e997aa> 3322\n<e997ab> 5766\n<e997ac> 20539\n<e997ad> 1086\n<e997ae> 3801\n<e997af> 1334\n<e997b0> 3277\n<e997b1> 5767\n<e997b2> 3901\n<e997b3> 5768\n<e997b4> 2135\n<e997b7> 2763\n<e997b8> 4419\n<e997b9> 2873\n<e997ba> 1860\n<e997bb> 3796\n<e997bc> 5771\n<e997bd> 2811\n<e997be> 5772\n<e997bf> 20540\n<e99880> 1604\n<e99881> 1774\n<e99882> 1929\n<e99885> 4359\n<e99886> 5775\n<e99887> 20541\n<e99888> 5776\n<e99889> 4084\n<e9988e> 4095\nendcidchar\n\n100 begincidchar\n<e9988f> 5781\n<e99890> 1218\n<e99891> 2470\n<e99892> 5782\n<e99893> 20542\n<e99894> 2454\n<e99898> 20543\n<e9989b> 20544\n<e9989c> 1714\n<e9989d> 4948\n<e9989e> 20545\n<e9989f> 1554\n<e998a0> 20546\n<e998a1> 4950\n<e998a2> 4949\n<e998aa> 4952\n<e998ae> 3273\n<e998b1> 4951\n<e998b2> 1629\n<e998b3> 4125\n<e998b4> 4220\n<e998b5> 4500\n<e998b6> 2216\n<e998bb> 4677\n<e998bc> 4954\n<e998bd> 4953\n<e998be> 20563\n<e998bf> 941\n<e99980> 3716\n<e99981> 20564\n<e99982> 4955\n<e99983> 20565\n<e99984> 1720\n<e99985> 2109\n<e99986> 2660\n<e99987> 2635\n<e99988> 1255\n<e99989> 4956\n<e9998a> 20566\n<e9998b> 2641\n<e9998c> 2835\n<e9998d> 2182\n<e99990> 3915\n<e99994> 4957\n<e99995> 3323\n<e99998> 8986\n<e9999b> 1094\n<e9999c> 20576\n<e9999d> 8468\n<e9999e> 20577\n<e9999f> 4958\n<e999a0> 20578\n<e999a1> 1527\n<e999a2> 4349\n<e999a3> 8836\n<e999a4> 1314\n<e999a7> 4959\n<e999a8> 4364\n<e999a9> 3906\n<e999aa> 2980\n<e999ab> 20581\n<e999ac> 4960\n<e999b0> 8732\n<e999b1> 20585\n<e999b2> 4961\n<e999b3> 7806\n<e999b4> 4962\n<e999b5> 2611\n<e999b6> 3624\n<e999b7> 3914\n<e999b8> 8269\n<e999bd> 8705\n<e99a85> 4300\n<e99a86> 2632\n<e99a87> 20597\n<e99a88> 4963\n<e99a89> 20598\n<e99a8a> 7897\n<e99a8b> 3546\n<e99a8c> 20599\n<e99a8d> 4964\n<e99a8e> 8114\n<e99a8f> 3547\n<e99a90> 4229\n<e99a94> 1775\n<e99a95> 8786\n<e99a96> 20603\n<e99a97> 4965\n<e99a98> 954\n<e99a99> 3875\n<e99a9a> 20604\n<e99a9b> 8057\n<e99a9c> 4464\n<e99aa7> 3554\n<e99aa8> 8535\n<e99aa9> 20615\n<e99aaa> 8639\n<e99ab0> 4966\n<e99ab1> 8735\n<e99ab2> 20621\nendcidchar\n\n100 begincidchar\n<e99ab3> 5764\n<e99ab4> 8253\n<e99ab5> 20622\n<e99ab6> 2542\n<e99ab7> 20623\n<e99ab8> 8213\n<e99ab9> 7545\n<e99aba> 20624\n<e99abb> 9893\n<e99abe> 2868\n<e99abf> 20625\n<e99b80> 3219\n<e99b81> 4108\n<e99b84> 4006\n<e99b85> 4078\n<e99b86> 2082\n<e99b87> 1830\n<e99b88> 20628\n<e99b89> 6940\n<e99b8c> 1353\n<e99b8d> 4255\n<e99b8e> 7548\n<e99b8f> 1312\n<e99b92> 7549\n<e99b95> 1490\n<e99b96> 8534\n<e99b99> 8516\n<e99b9a> 20637\n<e99b9b> 7825\n<e99b9c> 8791\n<e99ba0> 7551\n<e99ba1> 20641\n<e99ba2> 8202\n<e99ba3> 8338\n<e99ba8> 4303\n<e99ba9> 7521\n<e99baa> 4050\n<e99baf> 7523\n<e99bb2> 8784\n<e99bb3> 7522\n<e99bb6> 2604\n<e99bb7> 2498\n<e99bb8> 20654\n<e99bb9> 1035\n<e99bba> 20655\n<e99bbb> 7875\n<e99bbe> 3836\n<e99bbf> 20658\n<e99c80> 4019\n<e99c81> 7525\n<e99c84> 3939\n<e99c85> 20661\n<e99c86> 7524\n<e99c87> 4497\n<e99c88> 7526\n<e99c89> 2750\n<e99c8d> 2057\n<e99c8e> 7528\n<e99c8f> 7527\n<e99c93> 2881\n<e99c96> 2593\n<e99c9c> 3487\n<e99c9d> 20675\n<e99c9e> 3881\n<e99ca7> 8616\n<e99caa> 7529\n<e99cad> 7530\n<e99cb0> 7531\n<e99cb1> 20690\n<e99cb2> 2653\n<e99cb8> 991\n<e99cb9> 3002\n<e99cbd> 9741\n<e99cbe> 7532\n<e99cbf> 20699\n<e99d82> 9740\n<e99d83> 20702\n<e99d84> 9742\n<e99d88> 8242\n<e99d92> 3165\n<e99d93> 7520\n<e99d96> 2279\n<e99d99> 2273\n<e99d9a> 9739\n<e99d9b> 1478\n<e99d9e> 1636\n<e99d9f> 20721\n<e99da0> 2380\n<e99da1> 2775\n<e99da2> 2795\n<e99da5> 4738\n<e99da8> 8899\n<e99da9> 1770\n<e99db3> 2250\n<e99db4> 4046\n<e99db5> 20735\n<e99db6> 987\n<e99dbc> 7624\n<e99e85> 7625\n<e99e8b> 3959\nendcidchar\n\n100 begincidchar\n<e99e8c> 20754\n<e99e8d> 955\n<e99e8e> 20755\n<e99e8f> 7971\n<e99e90> 20756\n<e99e93> 20757\n<e99e94> 7628\n<e99e98> 3143\n<e99ea0> 2302\n<e99ea3> 7631\n<e99ea6> 9877\n<e99eab> 7630\n<e99eac> 20776\n<e99ead> 1095\n<e99eae> 20777\n<e99eaf> 7629\n<e99eb2> 7632\n<e99eb3> 20780\n<e99eb4> 7633\n<e99ebd> 9822\n<e99f83> 9821\n<e99f86> 9874\n<e99f89> 9823\n<e99f8a> 20798\n<e99f8b> 8589\n<e99f8c> 8445\n<e99f93> 8000\n<e99f99> 9317\n<e99f9c> 9319\n<e99f9d> 20812\n<e99f9e> 9318\n<e99fa6> 3763\n<e99fa7> 3240\n<e99fa8> 20820\n<e99fa9> 1890\n<e99fad> 2289\n<e99fb3> 4219\n<e99fb4> 20826\n<e99fb5> 4370\n<e99fb6> 3345\n<e99fbf> 8649\n<e9a080> 20835\n<e9a081> 8713\n<e9a082> 7881\n<e9a083> 8425\n<e9a084> 20836\n<e9a085> 8650\n<e9a086> 8518\n<e9a087> 9669\n<e9a088> 8668\n<e9a089> 20837\n<e9a08a> 9310\n<e9a08b> 20838\n<e9a08c> 8527\n<e9a08d> 20839\n<e9a090> 8769\n<e9a091> 8586\n<e9a092> 7727\n<e9a093> 7900\n<e9a097> 8383\n<e9a098> 8244\n<e9a09c> 9673\n<e9a0a1> 9672\n<e9a0a4> 8718\n<e9a0a5> 20852\n<e9a0a6> 9675\n<e9a0ad> 8573\n<e9a0b0> 8062\n<e9a0b7> 9676\n<e9a0b8> 8131\n<e9a0bb> 8377\n<e9a0bc> 20869\n<e9a0bd> 8577\n<e9a186> 8154\n<e9a18c> 8563\n<e9a18d> 7905\n<e9a18e> 9677\n<e9a193> 9678\n<e9a194> 8694\n<e9a198> 8779\n<e9a199> 9681\n<e9a19a> 20890\n<e9a19b> 7872\n<e9a19e> 8200\n<e9a1a2> 9680\n<e9a1a5> 9682\n<e9a1a6> 20898\n<e9a1a7> 7978\n<e9a1ab> 7794\n<e9a1ac> 9683\n<e9a1af> 8638\n<e9a1b0> 9684\n<e9a1b1> 8260\n<e9a1b2> 20904\n<e9a1b3> 9679\n<e9a1b4> 8435\n<e9a1b5> 4154\n<e9a1b6> 1508\n<e9a1b7> 3175\n<e9a1b8> 7136\nendcidchar\n\n100 begincidchar\n<e9a1b9> 3931\n<e9a1ba> 3496\n<e9a1bb> 4022\n<e9a1bc> 6183\n<e9a1bd> 3736\n<e9a1be> 1828\n<e9a1bf> 1560\n<e9a280> 7137\n<e9a281> 1007\n<e9a282> 3521\n<e9a283> 7138\n<e9a284> 4327\n<e9a285> 2644\n<e9a286> 2613\n<e9a287> 3043\n<e9a288> 2272\n<e9a289> 7139\n<e9a28a> 2120\n<e9a28b> 20905\n<e9a28e> 20906\n<e9a28f> 7142\n<e9a290> 4170\n<e9a291> 3028\n<e9a292> 20907\n<e9a293> 3704\n<e9a294> 7143\n<e9a295> 20908\n<e9a296> 4246\n<e9a297> 2386\n<e9a298> 3637\n<e9a299> 20909\n<e9a29c> 4094\n<e9a29d> 1581\n<e9a2a0> 1472\n<e9a2a3> 20910\n<e9a2a4> 1219\n<e9a2a7> 3202\n<e9a2a8> 7936\n<e9a2b0> 20916\n<e9a2b1> 9880\n<e9a2b2> 20917\n<e9a2b3> 9848\n<e9a2b6> 9422\n<e9a2bc> 9423\n<e9a384> 8376\n<e9a385> 20932\n<e9a386> 9424\n<e9a387> 20933\n<e9a388> 9425\n<e9a38e> 1668\n<e9a394> 20941\n<e9a395> 6586\n<e9a398> 3021\n<e9a39b> 7924\n<e9a39e> 1638\n<e9a39f> 3402\n<e9a3a0> 9115\n<e9a3a1> 20946\n<e9a3a2> 9854\n<e9a3a7> 5658\n<e9a3a8> 7655\n<e9a3a9> 9117\n<e9a3ac> 20951\n<e9a3ad> 9121\n<e9a3ae> 20952\n<e9a3af> 7921\n<e9a3b2> 8734\n<e9a3b3> 20955\n<e9a3b4> 9122\n<e9a3bc> 8523\n<e9a3bd> 7734\n<e9a3be> 8501\n<e9a3bf> 20963\n<e9a483> 8109\n<e9a484> 20967\n<e9a485> 7763\n<e9a489> 9123\n<e9a48a> 8707\n<e9a48b> 20971\n<e9a48c> 7911\n<e9a48d> 7656\n<e9a490> 1172\n<e9a491> 9124\n<e9a492> 8343\n<e9a493> 7908\n<e9a498> 8760\n<e9a49b> 9125\n<e9a49e> 8090\n<e9a4a1> 8643\n<e9a4a8> 7982\n<e9a4ae> 7657\n<e9a4b3> 9116\n<e9a4b7> 9126\n<e9a4bc> 9118\n<e9a4bd> 21006\n<e9a4be> 8245\n<e9a4bf> 9127\n<e9a583> 9128\n<e9a584> 21010\n<e9a585> 8309\nendcidchar\n\n100 begincidchar\n<e9a58b> 8171\n<e9a58c> 9132\n<e9a591> 8042\n<e9a592> 8441\n<e9a593> 21017\n<e9a594> 7659\n<e9a595> 7658\n<e9a596> 21018\n<e9a597> 9830\n<e9a59c> 9831\n<e9a59d> 21023\n<e9a59e> 7788\n<e9a5a2> 9133\n<e9a5a3> 5661\n<e9a5a4> 21027\n<e9a5a5> 2069\n<e9a5a6> 21028\n<e9a5ad> 1622\n<e9a5ae> 4226\n<e9a5af> 2165\n<e9a5b0> 3429\n<e9a5b1> 1038\n<e9a5b2> 3516\n<e9a5b3> 21029\n<e9a5b4> 5668\n<e9a5b5> 1595\n<e9a5b6> 3231\n<e9a5b7> 5669\n<e9a5ba> 2201\n<e9a5bb> 21032\n<e9a5bc> 1126\n<e9a5bd> 5670\n<e9a5be> 21033\n<e9a5bf> 1589\n<e9a680> 5671\n<e9a681> 2876\n<e9a684> 5672\n<e9a685> 3911\n<e9a686> 1846\n<e9a687> 5673\n<e9a688> 2444\n<e9a689> 21036\n<e9a68a> 5674\n<e9a68b> 1213\n<e9a68c> 21037\n<e9a68d> 5675\n<e9a68e> 21038\n<e9a68f> 2620\n<e9a692> 2719\n<e9a696> 3438\n<e9a697> 4718\n<e9a698> 4857\n<e9a699> 3920\n<e9a6a5> 6955\n<e9a6a8> 5086\n<e9a6ac> 8301\n<e9a6ad> 8770\n<e9a6ae> 7938\n<e9a6b1> 8579\n<e9a6b2> 21057\n<e9a6b3> 7813\n<e9a6b4> 8681\n<e9a780> 21069\n<e9a781> 7767\n<e9a790> 8869\n<e9a791> 9223\n<e9a792> 8138\n<e9a793> 21084\n<e9a794> 9218\n<e9a795> 8066\n<e9a798> 9224\n<e9a799> 9220\n<e9a79a> 21087\n<e9a79b> 8497\n<e9a79c> 21088\n<e9a79d> 8580\n<e9a79e> 21089\n<e9a79f> 9219\n<e9a7a0> 21090\n<e9a7a1> 8302\n<e9a7a2> 9227\n<e9a7ad> 7999\n<e9a7b1> 8295\n<e9a7bf> 8151\n<e9a880> 21117\n<e9a881> 7811\n<e9a885> 9231\n<e9a88d> 9230\n<e9a88e> 8391\n<e9a88f> 9229\n<e9a896> 9234\n<e9a899> 8375\n<e9a8ab> 9200\n<e9a8ac> 21153\n<e9a8ad> 9233\n<e9a8ae> 9236\n<e9a8af> 21154\n<e9a8b0> 8560\n<e9a8b6> 9221\n<e9a8b7> 8460\nendcidchar\n\n100 begincidchar\n<e9a8b8> 9237\n<e9a8be> 8294\n<e9a8bf> 21165\n<e9a980> 9042\n<e9a981> 9235\n<e9a982> 9232\n<e9a985> 8433\n<e9a98a> 9226\n<e9a98d> 9225\n<e9a98e> 21172\n<e9a98f> 9240\n<e9a995> 8103\n<e9a996> 21178\n<e9a997> 8700\n<e9a99a> 8129\n<e9a99b> 9222\n<e9a99f> 8860\n<e9a9a2> 8270\n<e9a9a3> 21186\n<e9a9a4> 9242\n<e9a9a5> 9241\n<e9a9aa> 9228\n<e9a9ab> 21191\n<e9a9ac> 2708\n<e9a9ad> 4329\n<e9a9ae> 3717\n<e9a9af> 4058\n<e9a9b0> 1280\n<e9a9b1> 3194\n<e9a9b2> 21192\n<e9a9b3> 1148\n<e9a9b4> 2662\n<e9a9b5> 6074\n<e9a9b6> 3410\n<e9a9b9> 2307\n<e9a9ba> 6077\n<e9a9bb> 4609\n<e9a9bc> 3718\n<e9a9bd> 6079\n<e9a9be> 2128\n<e9a9bf> 6078\n<e9aa82> 2709\n<e9aa83> 21193\n<e9aa84> 2191\n<e9aa85> 6082\n<e9aa86> 2701\n<e9aa87> 1886\n<e9aa88> 6083\n<e9aa89> 21194\n<e9aa8a> 6084\n<e9aa8b> 1271\n<e9aa8c> 4114\n<e9aa8f> 2354\n<e9aa90> 6085\n<e9aa91> 3086\n<e9aa96> 6088\n<e9aa97> 3020\n<e9aa98> 6089\n<e9aa99> 21199\n<e9aa9a> 3296\n<e9aa9e> 5941\n<e9aaa1> 2697\n<e9aaa4> 4583\n<e9aaa5> 6097\n<e9aaa6> 21200\n<e9aaa7> 6098\n<e9aaa8> 1824\n<e9aaaf> 7721\n<e9aab0> 7635\n<e9aab1> 7634\n<e9aab6> 7638\n<e9aab7> 7636\n<e9aab8> 1880\n<e9aab9> 21211\n<e9aaba> 7639\n<e9aabb> 21212\n<e9aabc> 7640\n<e9ab80> 7642\n<e9ab81> 7641\n<e9ab82> 7644\n<e9ab85> 7643\n<e9ab8f> 9825\n<e9ab90> 21225\n<e9ab91> 7647\n<e9ab92> 9892\n<e9ab93> 3549\n<e9ab94> 8564\n<e9ab95> 9827\n<e9ab96> 9826\n<e9ab97> 21226\n<e9ab98> 1754\n<e9ab9f> 7660\n<e9aba0> 21233\n<e9aba1> 7661\n<e9aba6> 7662\n<e9abab> 7664\n<e9abac> 21242\n<e9abad> 7666\n<e9abae> 9845\n<e9abaf> 7663\nendcidchar\n\n100 begincidchar\n<e9abb9> 7667\n<e9abba> 21252\n<e9abbb> 7665\n<e9ac83> 4660\n<e9ac86> 8524\n<e9ac87> 21262\n<e9ac88> 7668\n<e9ac8d> 9850\n<e9ac8e> 21267\n<e9ac8f> 7669\n<e9ac93> 7670\n<e9ac9a> 9888\n<e9ac9f> 7671\n<e9aca2> 9832\n<e9aca3> 7672\n<e9aca4> 21283\n<e9aca5> 7888\n<e9aca6> 21284\n<e9aca7> 8342\n<e9aca8> 21285\n<e9aca9> 9164\n<e9acae> 9160\n<e9acaf> 5019\n<e9acb0> 21290\n<e9acb1> 8766\n<e9acb2> 4704\n<e9acbb> 6003\n<e9acbc> 1862\n<e9ad80> 21302\n<e9ad81> 2442\n<e9ad82> 2047\n<e9ad83> 7649\n<e9ad84> 3046\n<e9ad85> 7648\n<e9ad86> 21303\n<e9ad87> 7650\n<e9ad88> 7652\n<e9ad89> 7651\n<e9ad8d> 7653\n<e9ad8e> 9829\n<e9ad8f> 3785\n<e9ad90> 21307\n<e9ad91> 7654\n<e9ad94> 2826\n<e9ad98> 9828\n<e9ad99> 21313\n<e9ad9a> 8761\n<e9adaf> 8266\n<e9adb4> 9759\n<e9adb7> 9758\n<e9ae80> 21348\n<e9ae81> 9760\n<e9ae82> 21349\n<e9ae83> 9761\n<e9ae8e> 9762\n<e9ae8f> 21360\n<e9ae90> 9767\n<e9ae91> 7737\n<e9ae92> 9765\n<e9ae9a> 9769\n<e9ae9d> 9774\n<e9ae9e> 9771\n<e9aeaa> 9770\n<e9aeab> 9773\n<e9aeac> 21381\n<e9aead> 9768\n<e9aeae> 8633\n<e9af80> 9782\n<e9af81> 9776\n<e9af87> 9784\n<e9af88> 21404\n<e9af89> 8205\n<e9af8a> 9783\n<e9af94> 9797\n<e9af95> 21414\n<e9af96> 9786\n<e9af9b> 9795\n<e9af9c> 21419\n<e9af9d> 9792\n<e9afa1> 9789\n<e9afa2> 9793\n<e9afa3> 21423\n<e9afa4> 9790\n<e9afa7> 9791\n<e9afa8> 8128\n<e9afa9> 21426\n<e9afb0> 9794\n<e9afb4> 9796\n<e9afbd> 9785\n<e9afbe> 21442\n<e9afbf> 9804\n<e9b088> 9799\n<e9b089> 9803\n<e9b08d> 9801\n<e9b090> 9800\n<e9b091> 21456\n<e9b092> 9802\n<e9b093> 8456\n<e9b0a0> 9805\n<e9b0a3> 9780\nendcidchar\n\n100 begincidchar\n<e9b0a4> 21471\n<e9b0a5> 9809\n<e9b0a8> 9808\n<e9b0a9> 9810\n<e9b0ad> 9807\n<e9b0b1> 9778\n<e9b0b2> 9806\n<e9b0b3> 9811\n<e9b0b4> 21480\n<e9b0b5> 9815\n<e9b0b6> 21481\n<e9b0b7> 9781\n<e9b0b8> 21482\n<e9b0b9> 9779\n<e9b0ba> 21483\n<e9b0bb> 9814\n<e9b0be> 9812\n<e9b0bf> 21486\n<e9b185> 9816\n<e9b188> 9813\n<e9b189> 7757\n<e9b192> 9819\n<e9b193> 21502\n<e9b194> 9818\n<e9b195> 21503\n<e9b196> 9817\n<e9b197> 8238\n<e9b198> 9775\n<e9b19d> 9798\n<e9b19e> 21508\n<e9b19f> 9766\n<e9b1a7> 9820\n<e9b1ad> 9772\n<e9b1b8> 9763\n<e9b1b9> 21531\n<e9b1ba> 9777\n<e9b1bb> 21532\n<e9b1bc> 4296\n<e9b1bf> 7561\n<e9b280> 21535\n<e9b281> 2650\n<e9b282> 7562\n<e9b28b> 7568\n<e9b28c> 21540\n<e9b28d> 1044\n<e9b28e> 7569\n<e9b28f> 21541\n<e9b293> 21542\n<e9b29c> 3895\n<e9b29d> 21547\n<e9b2a4> 2523\n<e9b2aa> 21548\n<e9b2ab> 7588\n<e9b2ac> 21549\n<e9b2af> 21550\n<e9b2b8> 2263\n<e9b2b9> 21551\n<e9b383> 3285\n<e9b396> 1111\n<e9b39e> 2596\n<e9b39f> 7622\n<e9b3a2> 7623\n<e9b3a5> 8348\n<e9b3a9> 9600\n<e9b3ac> 8924\n<e9b3b3> 7941\n<e9b3b4> 8331\n<e9b3b5> 21578\n<e9b3b6> 9601\n<e9b486> 9603\n<e9b487> 9602\n<e9b488> 21594\n<e9b489> 8686\n<e9b495> 8578\n<e9b49b> 8771\n<e9b49c> 21611\n<e9b49d> 9607\n<e9b49e> 21612\n<e9b49f> 9608\n<e9b4a3> 9604\n<e9b4a6> 8701\n<e9b4a7> 21618\n<e9b4a8> 8687\n<e9b4af> 9610\n<e9b4b0> 9612\n<e9b4bb> 8007\n<e9b4bf> 7965\n<e9b582> 9613\n<e9b591> 8144\n<e9b592> 9618\n<e9b593> 9615\n<e9b59c> 9620\n<e9b59d> 7904\n<e9b5a0> 9617\n<e9b5a1> 9621\n<e9b5aa> 9623\n<e9b5ab> 21672\n<e9b5ac> 8374\n<e9b5af> 9624\n<e9b5b2> 8438\nendcidchar\n\n100 begincidchar\n<e9b687> 9605\n<e9b688> 21697\n<e9b689> 9625\n<e9b693> 9622\n<e9b698> 9626\n<e9b699> 21711\n<e9b69a> 9627\n<e9b6a5> 9629\n<e9b6a9> 9630\n<e9b6af> 9036\n<e9b6b4> 8004\n<e9b6bb> 9824\n<e9b6bc> 9632\n<e9b780> 9628\n<e9b781> 21743\n<e9b782> 9631\n<e9b783> 21744\n<e9b784> 8044\n<e9b793> 9634\n<e9b797> 8366\n<e9b798> 21762\n<e9b799> 9611\n<e9b79a> 9635\n<e9b7a5> 9609\n<e9b7a6> 9637\n<e9b7af> 9636\n<e9b7b2> 9638\n<e9b7b3> 9619\n<e9b7b8> 9639\n<e9b7b9> 8738\n<e9b7ba> 9641\n<e9b88c> 9640\n<e9b895> 9606\n<e9b89a> 9633\n<e9b89b> 9642\n<e9b89c> 21816\n<e9b89d> 9616\n<e9b89e> 9614\n<e9b89f> 2900\n<e9b8a0> 6965\n<e9b8a1> 2073\n<e9b8a2> 6966\n<e9b8a3> 2814\n<e9b8a4> 21817\n<e9b8a5> 2937\n<e9b8a6> 4068\n<e9b8a7> 21818\n<e9b8ad> 4069\n<e9b8ae> 21819\n<e9b8af> 4117\n<e9b8b0> 21820\n<e9b8b1> 6973\n<e9b8b2> 6972\n<e9b8b3> 4330\n<e9b8b4> 21821\n<e9b8b5> 3715\n<e9b8b6> 6974\n<e9b8b7> 6976\n<e9b8b8> 6975\n<e9b8bd> 1766\n<e9b8be> 6979\n<e9b8bf> 1951\n<e9b980> 21824\n<e9b983> 2328\n<e9b984> 6982\n<e9b985> 1579\n<e9b98a> 3216\n<e9b98d> 21825\n<e9b98e> 6989\n<e9b98f> 2997\n<e9b990> 21826\n<e9b991> 6990\n<e9b995> 6991\n<e9b996> 21830\n<e9b997> 6992\n<e9b998> 7637\n<e9b999> 21831\n<e9b99d> 21832\n<e9b99e> 6996\n<e9b9a3> 6997\n<e9b9a4> 1934\n<e9b9a5> 21837\n<e9b9ad> 7006\n<e9b9b0> 4234\n<e9b9b1> 7005\n<e9b9b2> 21840\n<e9b9b3> 7007\n<e9b9b4> 21841\n<e9b9b5> 9864\n<e9b9b9> 9886\n<e9b9ba> 9723\n<e9b9bb> 21845\n<e9b9bc> 8076\n<e9b9bd> 8692\n<e9b9be> 7446\n<e9b9bf> 2656\n<e9ba82> 7676\n<e9ba8b> 7679\n<e9ba92> 7680\n<e9ba93> 2651\nendcidchar\n\n100 begincidchar\n<e9ba97> 8207\n<e9ba9d> 7682\n<e9ba9e> 21868\n<e9ba9f> 7683\n<e9baa5> 8305\n<e9baa6> 2714\n<e9baa9> 9719\n<e9baaf> 9878\n<e9bab4> 7406\n<e9bab5> 9871\n<e9bab8> 7405\n<e9babb> 2704\n<e9babc> 21889\n<e9babf> 21890\n<e9bb84> 2011\n<e9bb89> 4856\n<e9bb8c> 8922\n<e9bb8d> 3465\n<e9bb8e> 2515\n<e9bb8f> 6954\n<e9bb90> 21901\n<e9bb91> 1937\n<e9bb94> 3114\n<e9bb98> 2831\n<e9bb9e> 7873\n<e9bb9f> 7688\n<e9bba0> 7687\n<e9bba1> 21909\n<e9bba2> 7689\n<e9bba5> 7692\n<e9bba6> 21912\n<e9bba7> 7691\n<e9bba8> 7859\n<e9bba9> 7690\n<e9bbaa> 7693\n<e9bbaf> 7694\n<e9bbb2> 9834\n<e9bbb3> 21919\n<e9bbb4> 9866\n<e9bbb7> 9833\n<e9bbb8> 21922\n<e9bbb9> 6741\n<e9bbba> 21923\n<e9bbbd> 9752\n<e9bbbe> 7542\n<e9bbbf> 9753\n<e9bc89> 9754\n<e9bc8a> 21933\n<e9bc8b> 7543\n<e9bc8c> 21934\n<e9bc8d> 7544\n<e9bc8e> 1509\n<e9bc8f> 21935\n<e9bc90> 4724\n<e9bc93> 1821\n<e9bc94> 21938\n<e9bc95> 9843\n<e9bc96> 21939\n<e9bc97> 4721\n<e9bc98> 21940\n<e9bc99> 5087\n<e9bca0> 3466\n<e9bca1> 21947\n<e9bca2> 7695\n<e9bcac> 7696\n<e9bcaf> 7697\n<e9bcb7> 7699\n<e9bcb8> 21966\n<e9bcb9> 7698\n<e9bcba> 21967\n<e9bcbb> 1072\n<e9bcbc> 21968\n<e9bcbf> 21969\n<e9bd84> 7702\n<e9bd8a> 8390\n<e9bd8b> 8811\n<e9bd8f> 9427\n<e9bd90> 3082\n<e9bd91> 6594\n<e9bd92> 7814\n<e9bd93> 21982\n<e9bd94> 9743\n<e9bd99> 9745\n<e9bd9c> 9747\n<e9bd9f> 9744\n<e9bda0> 9746\n<e9bda1> 8240\n<e9bda2> 21991\n<e9bda3> 9841\n<e9bda6> 9748\n<e9bdaa> 9750\n<e9bdab> 21997\n<e9bdac> 9749\n<e9bdb2> 8434\n<e9bdb7> 9751\n<e9bdbf> 1282\n<e9be80> 7533\n<e9be83> 7534\n<e9be84> 2605\n<e9be8b> 3198\nendcidchar\n\n51 begincidchar\n<e9be8c> 7541\n<e9be8d> 8247\n<e9be90> 8371\n<e9be94> 7970\n<e9be95> 9453\n<e9be99> 2627\n<e9be9a> 1793\n<e9be9b> 6740\n<e9be9c> 7988\n<e9be9f> 1859\n<e9bea0> 4851\n<e9beb4> 22056\n<e9beb5> 22064\n<e9beb8> 22076\n<e9beb9> 22093\n<e9beba> 22110\n<e9bebb> 22126\n<ee9dac> 22353\n<ee9e96> 599\n<ee9f87> 695\n<ee9f88> 698\n<efa4ac> 22031\n<efa5b9> 2562\n<efa695> 16595\n<efa7a7> 8204\n<efa7b1> 20611\n<efa88c> 4697\n<efa891> 22035\n<efa898> 22038\n<efb890> 573\n<efb891> 575\n<efb892> 574\n<efb899> 599\n<efb8b0> 10013\n<efb8b1> 598\n<efb8bf> 584\n<efb980> 585\n<efbc84> 166\n<efbd9e> 106\n<efbfa2> 10014\n<efbfa3> 355\n<efbfa4> 10015\n<efbfa5> 265\n<f0a08287> 22048\n<f0a08289> 22049\n<f0a0838c> 22050\n<f0a09489> 22093\n<f0a0a69d> 22110\n<f0a19797> 22075\n<f0a2a68f> 22085\n<f0a487be> 22111\nendcidchar\n\n100 begincidrange\n<20> <7e> 1\n<cb8a> <cb8b> 9907\n<ce91> <cea1> 525\n<cea3> <cea9> 542\n<ceb1> <cebf> 549\n<cf80> <cf81> 564\n<cf83> <cf89> 566\n<d090> <d095> 602\n<d096> <d0b5> 609\n<d0b6> <d0bf> 642\n<d180> <d18f> 652\n<e28098> <e28099> 109\n<e2809c> <e2809d> 111\n<e280b2> <e280b3> 163\n<e285a0> <e285ab> 250\n<e285b0> <e285b9> 9897\n<e28690> <e28691> 186\n<e28696> <e28699> 9916\n<e288a7> <e288a8> 131\n<e289a4> <e289a5> 155\n<e289a6> <e289a7> 9924\n<e289ae> <e289af> 153\n<e291a0> <e291a9> 230\n<e291b4> <e291bf> 210\n<e29280> <e29287> 222\n<e29288> <e2929b> 190\n<e29480> <e294bf> 738\n<e29580> <e2958b> 802\n<e29590> <e295b3> 9927\n<e29681> <e2968f> 9963\n<e29693> <e29695> 9978\n<e296bc> <e296bd> 9981\n<e297a2> <e297a5> 9983\n<e2ba82> <e2ba83> 22429\n<e2ba85> <e2ba87> 22431\n<e2ba89> <e2ba8a> 22434\n<e2ba8d> <e2ba96> 22436\n<e2ba98> <e2ba99> 22446\n<e2ba9b> <e2baa6> 22448\n<e2baa8> <e2baa9> 22460\n<e2baab> <e2baad> 22462\n<e2baaf> <e2bab2> 22465\n<e2bab4> <e2bab5> 22469\n<e2bab6> <e2bab7> 22083\n<e2bab8> <e2baba> 22471\n<e2babc> <e2babf> 22474\n<e2bb80> <e2bb89> 22478\n<e2bb8b> <e2bbb3> 22488\n<e2bfb0> <e2bfbb> 10060\n<e38080> <e38082> 96\n<e38088> <e3808f> 115\n<e38090> <e38091> 125\n<e38094> <e38095> 113\n<e38096> <e38097> 123\n<e3809d> <e3809e> 9990\n<e380a1> <e380a9> 9992\n<e380b3> <e380b5> 22395\n<e380b8> <e380ba> 22398\n<e38181> <e381bf> 356\n<e38280> <e38293> 419\n<e3829b> <e3829c> 10020\n<e3829d> <e3829e> 10025\n<e382a1> <e382bf> 439\n<e38380> <e383b6> 470\n<e383bd> <e383be> 10022\n<e38485> <e384a9> 700\n<e384aa> <e384ac> 22401\n<e386a0> <e386b7> 22404\n<e388a0> <e388a9> 240\n<e38e8e> <e38e8f> 10002\n<e38e9c> <e38e9e> 10004\n<e38f91> <e38f92> 10010\n<e39080> <e390bf> 22529\n<e39180> <e39186> 22593\n<e39188> <e391b2> 22600\n<e391b4> <e391bf> 22643\n<e39280> <e392bf> 22655\n<e39380> <e393bf> 22719\n<e39480> <e394bf> 22783\n<e39580> <e395bf> 22847\n<e39680> <e3969d> 22911\n<e3969f> <e396bf> 22941\n<e39780> <e397bf> 22974\n<e39880> <e3988d> 23038\n<e3988f> <e39899> 23052\n<e3989b> <e398bf> 23063\n<e39980> <e399bf> 23100\n<e39a80> <e39abf> 23164\n<e39b80> <e39bbf> 23228\n<e39c80> <e39cbf> 23292\n<e39d80> <e39dbf> 23356\n<e39e80> <e39ebf> 23420\n<e39f80> <e39fbf> 23484\n<e3a080> <e3a0bf> 23548\n<e3a180> <e3a1bf> 23612\n<e3a280> <e3a2bf> 23676\n<e3a380> <e3a3bf> 23740\n<e3a480> <e3a497> 23804\n<e3a499> <e3a4bf> 23828\n<e3a580> <e3a5ad> 23867\nendcidrange\n\n100 begincidrange\n<e3a5af> <e3a5bf> 23913\n<e3a680> <e3a6bf> 23930\n<e3a780> <e3a78e> 23994\n<e3a791> <e3a79e> 24009\n<e3a7a0> <e3a7bf> 24023\n<e3a880> <e3a8bf> 24055\n<e3a980> <e3a9b2> 24119\n<e3a9b4> <e3a9bf> 24170\n<e3aa80> <e3aabf> 24182\n<e3ab80> <e3abbf> 24246\n<e3ac80> <e3acbf> 24310\n<e3ad80> <e3ad8d> 24374\n<e3ad8f> <e3adbf> 24388\n<e3ae80> <e3aebf> 24437\n<e3af80> <e3afbf> 24501\n<e3b080> <e3b0bf> 24565\n<e3b180> <e3b1ad> 24629\n<e3b1af> <e3b1bf> 24675\n<e3b280> <e3b2bf> 24692\n<e3b380> <e3b39f> 24756\n<e3b3a1> <e3b3bf> 24788\n<e3b480> <e3b4bf> 24819\n<e3b580> <e3b5bf> 24883\n<e3b680> <e3b6bf> 24947\n<e3b780> <e3b7bf> 25011\n<e3b880> <e3b8bf> 25075\n<e3b980> <e3b9bf> 25139\n<e3ba80> <e3babf> 25203\n<e3bb80> <e3bbbf> 25267\n<e3bc80> <e3bcbf> 25331\n<e3bd80> <e3bdbf> 25395\n<e3be80> <e3bebf> 25459\n<e3bf80> <e3bfbf> 25523\n<e48080> <e480bf> 25587\n<e48180> <e48195> 25651\n<e48197> <e481bf> 25673\n<e48280> <e482bf> 25714\n<e48380> <e483bf> 25778\n<e48480> <e484bf> 25842\n<e48580> <e4859e> 25906\n<e485a0> <e485bf> 25937\n<e48680> <e486bf> 25969\n<e48780> <e487bf> 26033\n<e48880> <e488bf> 26097\n<e48980> <e489bf> 26161\n<e48a80> <e48abf> 26225\n<e48b80> <e48bbf> 26289\n<e48c80> <e48cb6> 26353\n<e48cb8> <e48cbf> 26408\n<e48d80> <e48dbf> 26416\n<e48e80> <e48eab> 26480\n<e48ead> <e48eb0> 26524\n<e48eb2> <e48ebf> 26528\n<e48f80> <e48f9c> 26542\n<e48f9e> <e48fbf> 26571\n<e49080> <e490bf> 26605\n<e49180> <e491bf> 26669\n<e49280> <e492bf> 26733\n<e49380> <e49395> 26797\n<e49397> <e493bf> 26819\n<e49480> <e494bf> 26860\n<e49580> <e495bf> 26924\n<e49680> <e496bf> 26988\n<e49780> <e497bf> 27052\n<e49880> <e498bf> 27116\n<e49980> <e4998b> 27180\n<e4998d> <e499a0> 27192\n<e499a2> <e499bf> 27212\n<e49a80> <e49abf> 27242\n<e49b80> <e49bbf> 27306\n<e49c80> <e49ca2> 27370\n<e49ca4> <e49ca8> 27405\n<e49caa> <e49cbf> 27410\n<e49d80> <e49dbb> 27432\n<e49dbd> <e49dbf> 27492\n<e49e80> <e49e8c> 27495\n<e49e8e> <e49ebf> 27508\n<e49f80> <e49fbf> 27558\n<e4a080> <e4a0bf> 27622\n<e4a180> <e4a1bf> 27686\n<e4a280> <e4a2bf> 27750\n<e4a380> <e4a3bf> 27814\n<e4a480> <e4a4bf> 27878\n<e4a580> <e4a586> 27942\n<e4a588> <e4a5b9> 27949\n<e4a5bb> <e4a5bc> 27999\n<e4a5be> <e4a5bf> 28001\n<e4a680> <e4a681> 28003\n<e4a682> <e4a683> 22102\n<e4a685> <e4a686> 22104\n<e4a687> <e4a69a> 28006\n<e4a69c> <e4a69e> 28026\n<e4a6a0> <e4a6b5> 28029\n<e4a6b8> <e4a6bf> 28051\n<e4a780> <e4a7bf> 28059\n<e4a880> <e4a8bf> 28123\n<e4a980> <e4a9bf> 28187\n<e4aa80> <e4aabf> 28251\n<e4ab80> <e4abbf> 28315\n<e4ac80> <e4acbf> 28379\nendcidrange\n\n100 begincidrange\n<e4ad80> <e4adbf> 28443\n<e4ae80> <e4aebf> 28507\n<e4af80> <e4afbf> 28571\n<e4b080> <e4b0bf> 28635\n<e4b180> <e4b1b6> 28699\n<e4b1b8> <e4b1bf> 28754\n<e4b280> <e4b29e> 28762\n<e4b29f> <e4b2a1> 22113\n<e4b2a4> <e4b2bf> 28793\n<e4b380> <e4b3bf> 28821\n<e4b480> <e4b492> 28885\n<e4b493> <e4b499> 22118\n<e4b49a> <e4b4bf> 28904\n<e4b580> <e4b5bf> 28942\n<e4b680> <e4b6ad> 29006\n<e4b6af> <e4b6b5> 29052\n<e4b884> <e4b886> 10073\n<e4b89f> <e4b8a1> 10079\n<e4b8ae> <e4b8af> 10085\n<e4b980> <e4b982> 10092\n<e4b99a> <e4b99b> 10101\n<e4b9a2> <e4b9a5> 10103\n<e4b9a7> <e4b9a8> 10107\n<e4b9aa> <e4b9af> 10109\n<e4b9b4> <e4b9bd> 10116\n<e4ba80> <e4ba81> 10127\n<e4ba83> <e4ba85> 10129\n<e4ba96> <e4ba97> 10135\n<e4ba9c> <e4ba9d> 10138\n<e4baaf> <e4bab1> 10142\n<e4bab6> <e4bab9> 10146\n<e4babc> <e4babe> 10150\n<e4bb8f> <e4bb90> 10155\n<e4bb9a> <e4bb9c> 10158\n<e4bba6> <e4bba7> 10163\n<e4bbad> <e4bbaf> 10166\n<e4bbb8> <e4bbba> 10171\n<e4bc82> <e4bc88> 10177\n<e4bc8b> <e4bc8c> 10184\n<e4bc92> <e4bc96> 10186\n<e4bc9c> <e4bc9d> 10191\n<e4bca8> <e4bca9> 10195\n<e4bcac> <e4bcae> 10197\n<e4bcbe> <e4bcbf> 10206\n<e4bd80> <e4bd82> 10208\n<e4bd84> <e4bd85> 10211\n<e4bd87> <e4bd8c> 10213\n<e4bda1> <e4bda2> 10222\n<e4bdaa> <e4bdab> 10226\n<e4bdad> <e4bdae> 10228\n<e4bdb1> <e4bdb2> 10230\n<e4bdb7> <e4bdba> 10233\n<e4be80> <e4be82> 10238\n<e4be92> <e4be93> 10247\n<e4be98> <e4be9a> 10250\n<e4be9e> <e4be9f> 10254\n<e4bea1> <e4bea2> 10256\n<e4beb0> <e4beb4> 10261\n<e4beb6> <e4bebe> 10266\n<e4bf80> <e4bf81> 10275\n<e4bf86> <e4bf89> 10277\n<e4bf8b> <e4bf8d> 10281\n<e4bf92> <e4bf96> 10284\n<e4bfa4> <e4bfa5> 10292\n<e4bfab> <e4bfac> 10295\n<e4bfb4> <e4bfb7> 10299\n<e4bfbb> <e4bfbd> 10304\n<e58081> <e58085> 10308\n<e58087> <e58088> 10313\n<e58095> <e58097> 10319\n<e5809d> <e5809e> 10323\n<e580a2> <e580a4> 10326\n<e580af> <e580b9> 10330\n<e58180> <e58182> 10344\n<e58184> <e58186> 10347\n<e5818a> <e5818b> 10350\n<e58190> <e58194> 10353\n<e58196> <e58199> 10358\n<e5819d> <e581a4> 10363\n<e581a6> <e581ab> 10371\n<e581ad> <e581b3> 10377\n<e581b8> <e581ba> 10384\n<e581bc> <e581bd> 10387\n<e58281> <e58284> 10389\n<e58286> <e58287> 10393\n<e58289> <e5828c> 10395\n<e5828e> <e58295> 10399\n<e5829a> <e582a1> 10408\n<e582aa> <e582ab> 10418\n<e582ae> <e582b1> 10420\n<e582b8> <e582b9> 10425\n<e582bc> <e582bd> 10427\n<e58380> <e58381> 10430\n<e58383> <e58384> 10432\n<e58386> <e58388> 10434\n<e5838a> <e5838e> 10437\n<e58392> <e58394> 10443\n<e58397> <e58399> 10446\n<e5839b> <e5839d> 10449\n<e5839f> <e583a4> 10452\nendcidrange\n\n100 begincidrange\n<e583a9> <e583ab> 10458\n<e583af> <e583b2> 10461\n<e583b6> <e583b8> 10466\n<e583bc> <e583bf> 10470\n<e5848c> <e5848f> 10478\n<e58496> <e58497> 10484\n<e58499> <e5849e> 10486\n<e584a2> <e584a9> 10493\n<e584ab> <e584b1> 10501\n<e584b3> <e584b6> 10508\n<e584b8> <e584b9> 10512\n<e584bd> <e584be> 10514\n<e5858e> <e58590> 10520\n<e58597> <e58599> 10524\n<e5859d> <e585a1> 10528\n<e585a3> <e585a4> 10533\n<e585a6> <e585a7> 10535\n<e585be> <e585bf> 10541\n<e58683> <e58684> 10543\n<e58686> <e58687> 10545\n<e5868a> <e5868b> 10547\n<e5868e> <e58691> 10549\n<e58693> <e58694> 10553\n<e5869d> <e5869f> 10557\n<e586a6> <e586aa> 10562\n<e586ad> <e586ae> 10567\n<e586b8> <e586ba> 10570\n<e586be> <e586bf> 10573\n<e58781> <e58783> 10575\n<e58792> <e5879a> 10583\n<e5879e> <e5879f> 10593\n<e587a2> <e587a3> 10595\n<e587a5> <e587aa> 10597\n<e58884> <e58885> 10609\n<e5888b> <e5888c> 10612\n<e5888f> <e58890> 10614\n<e58893> <e58895> 10616\n<e5889e> <e5889f> 10620\n<e588a1> <e588a3> 10622\n<e588a5> <e588a7> 10625\n<e588b1> <e588b2> 10631\n<e588b4> <e588b5> 10633\n<e58985> <e58986> 10637\n<e58988> <e58989> 10639\n<e5898e> <e5898f> 10641\n<e58992> <e58993> 10643\n<e58997> <e5899a> 10646\n<e5899f> <e589a0> 10651\n<e589a2> <e589a4> 10653\n<e589ab> <e589ad> 10658\n<e589b0> <e589b1> 10661\n<e589b6> <e589bc> 10664\n<e58a84> <e58a86> 10673\n<e58a8e> <e58a8f> 10677\n<e58a94> <e58a9a> 10680\n<e58aa4> <e58aa7> 10688\n<e58aac> <e58aad> 5006\n<e58aae> <e58ab0> 10692\n<e58ab4> <e58abd> 10695\n<e58b84> <e58b86> 10707\n<e58b8c> <e58b8f> 10712\n<e58b93> <e58b94> 10717\n<e58ba0> <e58ba1> 10722\n<e58ba5> <e58baf> 10725\n<e58bb2> <e58bb4> 10736\n<e58bb6> <e58bb7> 10739\n<e58bbb> <e58bbd> 10741\n<e58c81> <e58c84> 10744\n<e58c89> <e58c8c> 10749\n<e58c91> <e58c94> 10754\n<e58c9b> <e58c9c> 10759\n<e58c9e> <e58c9f> 10761\n<e58ca4> <e58ca5> 10764\n<e58ca7> <e58ca9> 10766\n<e58cab> <e58cac> 10769\n<e58cb2> <e58cb8> 10772\n<e58cbc> <e58cbd> 10779\n<e58d8b> <e58d8d> 10784\n<e58d98> <e58d99> 10788\n<e58dac> <e58dad> 10795\n<e58dbb> <e58dbe> 10800\n<e58e80> <e58e81> 10804\n<e58e87> <e58e88> 10807\n<e58e8e> <e58e94> 10810\n<e58e96> <e58e97> 10817\n<e58e9b> <e58e9c> 10819\n<e58eaa> <e58eac> 10825\n<e58eaf> <e58eb1> 10828\n<e58eb7> <e58eba> 10833\n<e58ebc> <e58ebe> 10837\n<e58f84> <e58f87> 10841\n<e58f8e> <e58f90> 10845\n<e58f92> <e58f93> 10848\n<e58f9c> <e58f9e> 10852\n<e58fbe> <e58fbf> 10859\n<e59098> <e5909a> 10867\n<e590a4> <e590a5> 10872\n<e590b6> <e590b7> 10877\n<e59181> <e59182> 10882\n<e59184> <e59185> 10884\nendcidrange\n\n100 begincidrange\n<e5918c> <e5918f> 10888\n<e59192> <e59194> 5380\n<e5919d> <e591a1> 10894\n<e591a9> <e591b0> 10902\n<e591b9> <e591ba> 10911\n<e591be> <e591bf> 10913\n<e59287> <e5928a> 10918\n<e59297> <e59298> 10925\n<e5929a> <e5929b> 5395\n<e5929e> <e592a2> 10928\n<e592a9> <e592aa> 5419\n<e592b5> <e592b7> 10937\n<e592b9> <e592ba> 10940\n<e5938a> <e5938b> 10945\n<e59393> <e59394> 5408\n<e59399> <e5939a> 5416\n<e593a2> <e593a4> 10951\n<e593ab> <e593ac> 10954\n<e593af> <e593b1> 10956\n<e593b4> <e593b9> 10959\n<e59482> <e59483> 10968\n<e5948a> <e5948e> 10972\n<e59492> <e59493> 10977\n<e59495> <e5949a> 10979\n<e5949c> <e5949f> 10985\n<e594a2> <e594a3> 5431\n<e594a5> <e594a6> 10990\n<e594a8> <e594a9> 10992\n<e594b4> <e594b6> 10997\n<e594b8> <e594bb> 11000\n<e59587> <e59588> 11008\n<e5958b> <e5958e> 11010\n<e59591> <e59592> 11014\n<e59597> <e5959b> 11017\n<e5959f> <e595a0> 11023\n<e595a2> <e595a3> 11025\n<e595a8> <e595a9> 11027\n<e595af> <e595b4> 11030\n<e595b5> <e595b7> 5449\n<e595b9> <e595ba> 11036\n<e59685> <e59686> 11040\n<e5968c> <e5968e> 11042\n<e59692> <e59693> 11046\n<e59695> <e59697> 11048\n<e5969a> <e5969b> 11051\n<e596a0> <e596a6> 11054\n<e596a8> <e596a9> 11061\n<e596af> <e596b0> 11065\n<e596bd> <e596be> 5468\n<e59780> <e59783> 11073\n<e5978a> <e5978b> 11078\n<e5978c> <e5978d> 5487\n<e5978f> <e59790> 11080\n<e59797> <e59799> 11083\n<e597ab> <e597ac> 5477\n<e597ad> <e597ae> 11091\n<e597b0> <e597b1> 11093\n<e597b2> <e597b3> 5485\n<e597b8> <e597bc> 11096\n<e59882> <e59885> 11102\n<e5988a> <e5988b> 11107\n<e59890> <e59893> 11109\n<e59899> <e5989a> 11114\n<e598a0> <e598a2> 11117\n<e598a5> <e598a6> 11120\n<e598aa> <e598ab> 11123\n<e598bc> <e598be> 11128\n<e59982> <e5998b> 11132\n<e5998f> <e59993> 11142\n<e59995> <e59996> 11147\n<e5999a> <e5999b> 11149\n<e5999e> <e5999f> 11151\n<e599ad> <e599ae> 11156\n<e599bb> <e599bc> 5517\n<e599bd> <e599bf> 11163\n<e59a81> <e59a84> 11166\n<e59a88> <e59a8b> 11170\n<e59a90> <e59a92> 11175\n<e59a96> <e59a98> 11179\n<e59a9a> <e59aa2> 11182\n<e59aa4> <e59aa5> 11191\n<e59aa9> <e59aad> 11194\n<e59ab0> <e59ab2> 11199\n<e59ab8> <e59abb> 11203\n<e59abd> <e59abf> 11207\n<e59b83> <e59b84> 11210\n<e59b86> <e59b87> 11212\n<e59b8d> <e59b90> 11215\n<e59b92> <e59b93> 11219\n<e59b95> <e59b96> 11221\n<e59b98> <e59b99> 11223\n<e59ba5> <e59baa> 11227\n<e59bae> <e59baf> 11234\n<e59bb2> <e59bb3> 11236\n<e59bb6> <e59bb8> 11238\n<e59bbb> <e59bbc> 11241\n<e59c80> <e59c82> 11243\n<e59c8e> <e59c91> 11248\n<e59c94> <e59c95> 11252\n<e59c99> <e59c9b> 11255\nendcidrange\n\n100 begincidrange\n<e59c9d> <e59c9e> 11258\n<e59ca0> <e59ca2> 11260\n<e59ca4> <e59ca7> 11263\n<e59cae> <e59caf> 5036\n<e59cb1> <e59cb2> 11268\n<e59cb4> <e59cb8> 11270\n<e59cbc> <e59cbd> 11275\n<e59d83> <e59d86> 11279\n<e59d88> <e59d89> 11283\n<e59d92> <e59d96> 11286\n<e59d98> <e59d99> 11291\n<e59da2> <e59da3> 11293\n<e59db0> <e59db2> 11299\n<e59db4> <e59db5> 11302\n<e59db8> <e59dba> 11304\n<e59dbd> <e59dbf> 11307\n<e59e80> <e59e81> 11310\n<e59e87> <e59e8a> 11312\n<e59e8d> <e59e91> 11316\n<e59e94> <e59e9a> 11321\n<e59e9c> <e59e9f> 11328\n<e59eaf> <e59eb1> 11336\n<e59eb5> <e59eb7> 11340\n<e59eb9> <e59ebf> 11343\n<e59f80> <e59f81> 11350\n<e59f84> <e59f8a> 11352\n<e59f8c> <e59f8d> 11359\n<e59f90> <e59f91> 11361\n<e59f96> <e59f97> 11364\n<e59f9b> <e59f9c> 11366\n<e59fa2> <e59fa3> 11369\n<e59fa5> <e59fac> 11371\n<e59fb0> <e59fb3> 11380\n<e59fb5> <e59fb6> 11384\n<e59fbb> <e59fbc> 11386\n<e59fbe> <e59fbf> 11388\n<e5a083> <e5a084> 11391\n<e5a088> <e5a089> 11393\n<e5a08e> <e5a090> 11396\n<e5a092> <e5a094> 11399\n<e5a097> <e5a098> 11402\n<e5a09a> <e5a09c> 11404\n<e5a0a2> <e5a0a3> 11408\n<e5a0a5> <e5a0a9> 11410\n<e5a0ab> <e5a0ae> 11415\n<e5a0b2> <e5a0b3> 11419\n<e5a0b6> <e5a0bf> 11421\n<e5a180> <e5a183> 11431\n<e5a185> <e5a189> 11435\n<e5a195> <e5a196> 11443\n<e5a199> <e5a19d> 11445\n<e5a19f> <e5a1a1> 11450\n<e5a1a6> <e5a1aa> 11454\n<e5a1ad> <e5a1b4> 11459\n<e5a1b6> <e5a1b8> 11467\n<e5a1ba> <e5a1bd> 11470\n<e5a286> <e5a288> 11477\n<e5a28b> <e5a291> 11480\n<e5a294> <e5a298> 11487\n<e5a2a0> <e5a2a7> 11494\n<e5a2aa> <e5a2ad> 11502\n<e5a2af> <e5a2b2> 11506\n<e5a2b4> <e5a2ba> 11510\n<e5a382> <e5a384> 11520\n<e5a388> <e5a390> 11524\n<e5a396> <e5a397> 11535\n<e5a39b> <e5a39d> 11537\n<e5a3a5> <e5a3a8> 11542\n<e5a3b1> <e5a3b2> 11548\n<e5a3b4> <e5a3b5> 11550\n<e5a3b7> <e5a3b8> 11552\n<e5a3bb> <e5a3bc> 11554\n<e5a3be> <e5a3bf> 11556\n<e5a480> <e5a481> 11558\n<e5a485> <e5a486> 11561\n<e5a488> <e5a48c> 11563\n<e5a490> <e5a493> 11569\n<e5a497> <e5a498> 11573\n<e5a49d> <e5a49e> 11576\n<e5a4a0> <e5a4a1> 11578\n<e5a4b2> <e5a4b3> 11585\n<e5a4b5> <e5a4b6> 11587\n<e5a585> <e5a586> 11594\n<e5a58c> <e5a58d> 11597\n<e5a592> <e5a593> 11600\n<e5a59b> <e5a59f> 11603\n<e5a5a3> <e5a5a4> 11609\n<e5a5a6> <e5a5a8> 11611\n<e5a5af> <e5a5b2> 11616\n<e5a5ba> <e5a5bc> 11622\n<e5a5be> <e5a5bf> 11625\n<e5a68b> <e5a68c> 11630\n<e5a68e> <e5a691> 11632\n<e5a694> <e5a695> 11636\n<e5a69a> <e5a69c> 11639\n<e5a69f> <e5a6a2> 11642\n<e5a6a6> <e5a6a7> 11646\n<e5a6a9> <e5a6aa> 6008\n<e5a6ac> <e5a6ad> 11648\n<e5a6b0> <e5a6b1> 11650\nendcidrange\n\n100 begincidrange\n<e5a6b3> <e5a6b8> 11652\n<e5a6bc> <e5a6bd> 11659\n<e5a780> <e5a785> 11662\n<e5a787> <e5a789> 11668\n<e5a78c> <e5a78f> 11671\n<e5a795> <e5a796> 11675\n<e5a79e> <e5a7a2> 11679\n<e5a7a6> <e5a7a7> 11685\n<e5a7a9> <e5a7ab> 11687\n<e5a7ad> <e5a7b8> 11690\n<e5a7bc> <e5a7be> 11703\n<e5a885> <e5a886> 6021\n<e5a88a> <e5a88b> 11708\n<e5a88d> <e5a890> 11710\n<e5a894> <e5a897> 11715\n<e5a899> <e5a89b> 11719\n<e5a89d> <e5a89e> 11722\n<e5a8a1> <e5a8a2> 11724\n<e5a8a6> <e5a8a8> 11727\n<e5a8aa> <e5a8b0> 11730\n<e5a8b7> <e5a8bb> 11739\n<e5a8bd> <e5a8bf> 11744\n<e5a982> <e5a985> 11747\n<e5a987> <e5a988> 11751\n<e5a98b> <e5a994> 11753\n<e5a996> <e5a999> 11763\n<e5a99b> <e5a9a1> 11767\n<e5a9a3> <e5a9a5> 11774\n<e5a9a8> <e5a9a9> 11777\n<e5a9ab> <e5a9ac> 11779\n<e5a9ae> <e5a9b3> 11781\n<e5a9b8> <e5a9b9> 11787\n<e5a9bb> <e5a9be> 11789\n<e5aa80> <e5aa91> 11793\n<e5aa93> <e5aa99> 11811\n<e5aa9c> <e5aaa6> 11818\n<e5aaa8> <e5aaa9> 11829\n<e5aaab> <e5aab1> 11831\n<e5aab6> <e5aab7> 11839\n<e5aab9> <e5aabc> 11841\n<e5ab83> <e5ab88> 11847\n<e5ab8a> <e5ab8b> 11853\n<e5ab8d> <e5ab91> 11855\n<e5ab99> <e5ab9b> 11862\n<e5ab9d> <e5ab9f> 11865\n<e5aba4> <e5aba5> 11869\n<e5aba7> <e5aba8> 11871\n<e5abac> <e5abb0> 11874\n<e5abb2> <e5abb4> 11879\n<e5abb6> <e5abba> 11882\n<e5abbc> <e5abbf> 11887\n<e5ac81> <e5ac87> 11891\n<e5ac8d> <e5ac95> 11899\n<e5ac9a> <e5aca0> 11909\n<e5aca2> <e5aca9> 11916\n<e5acab> <e5acaf> 11924\n<e5acb5> <e5acb6> 11931\n<e5acb9> <e5acbf> 11933\n<e5ad81> <e5ad8b> 11940\n<e5ad8d> <e5ad8f> 11951\n<e5ada0> <e5ada1> 11957\n<e5ada7> <e5ada8> 11959\n<e5adad> <e5adaf> 11961\n<e5adb6> <e5adb7> 11966\n<e5adbb> <e5adbc> 11969\n<e5ae8d> <e5ae8e> 11975\n<e5ae90> <e5ae92> 11977\n<e5aea7> <e5aea9> 11983\n<e5aeac> <e5aeaf> 11986\n<e5aeb1> <e5aeb2> 11990\n<e5aeba> <e5aebc> 11993\n<e5af80> <e5af81> 11996\n<e5af88> <e5af8b> 11999\n<e5af8d> <e5af8f> 12003\n<e5af94> <e5af9c> 12007\n<e5afb1> <e5afb4> 12021\n<e5afbd> <e5afbe> 12026\n<e5b082> <e5b083> 12029\n<e5b092> <e5b093> 12034\n<e5b09e> <e5b0a1> 12039\n<e5b0a8> <e5b0ab> 12045\n<e5b0ad> <e5b0b0> 12049\n<e5b0b2> <e5b0b3> 12053\n<e5b0b5> <e5b0b6> 12055\n<e5b183> <e5b184> 12057\n<e5b186> <e5b187> 12059\n<e5b18c> <e5b18d> 12061\n<e5b192> <e5b194> 12063\n<e5b196> <e5b198> 12066\n<e5b19a> <e5b19d> 12069\n<e5b1a9> <e5b1ab> 12075\n<e5b1b2> <e5b1b8> 12080\n<e5b1bb> <e5b1be> 12087\n<e5b283> <e5b287> 12092\n<e5b289> <e5b28b> 12097\n<e5b28e> <e5b28f> 12100\n<e5b292> <e5b293> 12102\n<e5b298> <e5b299> 5553\n<e5b29d> <e5b2a0> 12105\n<e5b2a4> <e5b2a8> 12109\nendcidrange\n\n100 begincidrange\n<e5b2ae> <e5b2b0> 12115\n<e5b2b9> <e5b2bc> 12121\n<e5b382> <e5b383> 12127\n<e5b385> <e5b38a> 12129\n<e5b38c> <e5b391> 12135\n<e5b393> <e5b398> 12141\n<e5b39a> <e5b3a0> 12147\n<e5b3a2> <e5b3a3> 12154\n<e5b3ab> <e5b3ac> 12158\n<e5b3ae> <e5b3af> 12160\n<e5b3b1> <e5b3b3> 12162\n<e5b3b7> <e5b3ba> 12166\n<e5b3be> <e5b3bf> 12171\n<e5b480> <e5b481> 12173\n<e5b482> <e5b483> 5572\n<e5b484> <e5b485> 12175\n<e5b488> <e5b48c> 12177\n<e5b48f> <e5b493> 12182\n<e5b498> <e5b49a> 12188\n<e5b49c> <e5b49d> 12191\n<e5b49f> <e5b4a3> 12193\n<e5b4aa> <e5b4ab> 12200\n<e5b4af> <e5b4b3> 12202\n<e5b4b5> <e5b4bc> 12207\n<e5b580> <e5b586> 12216\n<e5b588> <e5b589> 12223\n<e5b58d> <e5b58f> 12225\n<e5b591> <e5b597> 12228\n<e5b599> <e5b59a> 12235\n<e5b59e> <e5b5a8> 12238\n<e5b5ad> <e5b5ae> 12250\n<e5b5b0> <e5b5b3> 12252\n<e5b5b5> <e5b5bf> 12256\n<e5b685> <e5b686> 12269\n<e5b688> <e5b696> 12271\n<e5b69a> <e5b69c> 12287\n<e5b69e> <e5b69f> 12290\n<e5b6a1> <e5b6a6> 12292\n<e5b6a8> <e5b6b6> 12298\n<e5b6bd> <e5b6bf> 12315\n<e5b780> <e5b784> 12318\n<e5b786> <e5b78a> 12323\n<e5b78e> <e5b791> 12329\n<e5b795> <e5b79a> 12334\n<e5b79f> <e5b7a0> 12341\n<e5b7a3> <e5b7a4> 12343\n<e5b7ac> <e5b7ad> 12346\n<e5b7b5> <e5b7b6> 12348\n<e5b7b8> <e5b7bc> 12350\n<e5b889> <e5b88b> 12359\n<e5b88d> <e5b88e> 12362\n<e5b892> <e5b893> 12364\n<e5b89e> <e5b8a4> 12367\n<e5b8a8> <e5b8aa> 12374\n<e5b8af> <e5b8b0> 12378\n<e5b8b4> <e5b8b5> 12381\n<e5b8b9> <e5b8ba> 12383\n<e5b8bb> <e5b8bc> 5539\n<e5b8be> <e5b8bf> 12385\n<e5b986> <e5b98b> 12388\n<e5b98d> <e5b993> 12394\n<e5b999> <e5b99a> 12402\n<e5b99c> <e5b99d> 12404\n<e5b9a4> <e5b9aa> 12407\n<e5b9ad> <e5b9b1> 12414\n<e5ba81> <e5ba83> 12421\n<e5ba88> <e5ba89> 12425\n<e5ba8c> <e5ba8e> 12427\n<e5baa1> <e5baa4> 12434\n<e5baa8> <e5baaa> 12438\n<e5baae> <e5bab2> 12442\n<e5baba> <e5babd> 12448\n<e5bb80> <e5bb88> 12453\n<e5bb8b> <e5bb90> 12462\n<e5bb94> <e5bb95> 12468\n<e5bb97> <e5bb9a> 12470\n<e5bb9c> <e5bb9e> 12474\n<e5bba4> <e5bba7> 12477\n<e5bbad> <e5bbb2> 12483\n<e5bbb8> <e5bbb9> 12490\n<e5bbbb> <e5bbbd> 12492\n<e5bc85> <e5bc87> 12495\n<e5bc8c> <e5bc8e> 12499\n<e5bc99> <e5bc9a> 12506\n<e5bc9c> <e5bc9e> 12508\n<e5bca1> <e5bca4> 12511\n<e5bcab> <e5bcac> 12516\n<e5bcb6> <e5bcb8> 12522\n<e5bcbd> <e5bcbf> 12526\n<e5bd81> <e5bd85> 12529\n<e5bd89> <e5bd8b> 12535\n<e5bd9a> <e5bd9c> 12542\n<e5bd9e> <e5bda0> 12545\n<e5bda7> <e5bda8> 12550\n<e5bdae> <e5bdaf> 12553\n<e5bdb4> <e5bdb6> 12556\n<e5bdbd> <e5bdbf> 12561\n<e5be8d> <e5be8f> 12566\n<e5be93> <e5be94> 12569\n<e5be9a> <e5be9b> 12572\nendcidrange\n\n100 begincidrange\n<e5bea2> <e5bea7> 12576\n<e5beab> <e5beac> 12582\n<e5beaf> <e5beb4> 12584\n<e5beba> <e5bebb> 12592\n<e5bebe> <e5bebf> 12594\n<e5bf80> <e5bf82> 12596\n<e5bf87> <e5bf88> 12599\n<e5bf8a> <e5bf8b> 12601\n<e5bf93> <e5bf95> 12604\n<e5bf9a> <e5bf9c> 12607\n<e5bf9e> <e5bf9f> 12610\n<e5bfa2> <e5bfa3> 12612\n<e5bfa5> <e5bfa6> 12614\n<e5bfa8> <e5bfa9> 12616\n<e5bfaf> <e5bfb0> 12619\n<e5bfb2> <e5bfb4> 12621\n<e5bfb6> <e5bfb7> 12624\n<e5bfb9> <e5bfba> 12626\n<e68085> <e68086> 5708\n<e68087> <e68089> 12629\n<e6808b> <e6808c> 12632\n<e68090> <e68091> 12634\n<e68097> <e68098> 12637\n<e6809e> <e6809f> 12640\n<e680a2> <e680a4> 12642\n<e680ac> <e680ae> 12645\n<e680b0> <e680b4> 12648\n<e680b6> <e680ba> 12653\n<e680bd> <e680be> 12658\n<e68184> <e6818a> 12661\n<e6818e> <e6818f> 12669\n<e68193> <e68194> 12672\n<e68196> <e68198> 12674\n<e6819b> <e6819c> 12677\n<e6819e> <e681a1> 12679\n<e681a5> <e681a6> 12683\n<e681b1> <e681b2> 12686\n<e681b4> <e681b5> 12688\n<e681b8> <e681b9> 5724\n<e68280> <e68282> 12692\n<e68285> <e68288> 12695\n<e6828a> <e6828b> 12699\n<e6828e> <e68291> 12701\n<e68297> <e68299> 12707\n<e682a1> <e682a2> 12712\n<e682a4> <e682a5> 12714\n<e682a9> <e682aa> 12717\n<e682b9> <e682ba> 12723\n<e682bd> <e682bf> 12725\n<e68380> <e68384> 12728\n<e68387> <e68389> 12733\n<e6838c> <e68390> 12736\n<e68392> <e68394> 12741\n<e68396> <e68397> 12744\n<e683a2> <e683a5> 12749\n<e683b7> <e683b8> 12755\n<e683bc> <e683bf> 12757\n<e68482> <e68485> 12761\n<e6848a> <e6848c> 12766\n<e68490> <e68494> 12769\n<e68496> <e68499> 12774\n<e6849d> <e6849e> 12778\n<e684a1> <e684a2> 12780\n<e684a8> <e684aa> 12783\n<e684ac> <e684b3> 12786\n<e684b5> <e684b6> 12794\n<e684b8> <e684bd> 12796\n<e68580> <e68587> 12802\n<e6858f> <e68590> 12812\n<e68592> <e68594> 12814\n<e68596> <e68597> 12817\n<e6859b> <e6859c> 12820\n<e685a0> <e685a1> 12823\n<e685a5> <e685a6> 12825\n<e685ac> <e685ad> 12828\n<e685b1> <e685b2> 12831\n<e685b8> <e685bf> 12834\n<e68680> <e68681> 12842\n<e68683> <e68689> 12844\n<e6868c> <e6868d> 12851\n<e68695> <e68699> 12855\n<e6869b> <e6869c> 12860\n<e6869e> <e686a3> 12862\n<e686a5> <e686a6> 12868\n<e686af> <e686b1> 12872\n<e686b3> <e686b5> 12875\n<e686b8> <e686bd> 12878\n<e68780> <e68781> 12885\n<e68783> <e68786> 12887\n<e6878d> <e68790> 12891\n<e68795> <e6879d> 12896\n<e687a0> <e687a2> 12905\n<e687a4> <e687a5> 12908\n<e687a9> <e687b1> 12911\n<e687b3> <e687b4> 12920\n<e68881> <e68885> 12925\n<e6889c> <e6889e> 12933\n<e688a8> <e688a9> 12939\n<e688b5> <e688b6> 12945\n<e688b8> <e688bc> 12947\nendcidrange\n\n100 begincidrange\n<e68984> <e68986> 12953\n<e68988> <e68989> 6646\n<e6898f> <e68990> 12957\n<e68995> <e68997> 12959\n<e68999> <e6899a> 12962\n<e6899c> <e689a2> 12964\n<e689a4> <e689a5> 12971\n<e689b1> <e689b2> 12974\n<e689b4> <e689b5> 12976\n<e689b7> <e689b8> 12978\n<e689ba> <e689bb> 12980\n<e68a81> <e68a83> 12983\n<e68a85> <e68a88> 12986\n<e68a8b> <e68a90> 12990\n<e68a9c> <e68a9e> 12998\n<e68aa6> <e68aa7> 13002\n<e68aa9> <e68aaa> 13004\n<e68aad> <e68ab0> 13006\n<e68ab2> <e68ab4> 13010\n<e68ab6> <e68ab8> 13013\n<e68b80> <e68b81> 13018\n<e68b9d> <e68b9e> 13025\n<e68ba0> <e68ba1> 13027\n<e68baa> <e68bab> 13030\n<e68bb8> <e68bbb> 13035\n<e68c83> <e68c86> 13040\n<e68c8a> <e68c8d> 13044\n<e68c8f> <e68c90> 13048\n<e68c92> <e68c95> 13050\n<e68c97> <e68c99> 13054\n<e68ca6> <e68ca7> 13058\n<e68cac> <e68cae> 13061\n<e68cb0> <e68cb1> 13064\n<e68cb3> <e68cb8> 13066\n<e68cbb> <e68cbc> 13072\n<e68d80> <e68d81> 13075\n<e68d87> <e68d88> 13078\n<e68d91> <e68d94> 13081\n<e68d96> <e68d9d> 13085\n<e68da4> <e68da6> 13094\n<e68daf> <e68db0> 13099\n<e68db3> <e68db5> 13101\n<e68db8> <e68db9> 13104\n<e68dbc> <e68dbf> 13106\n<e68e85> <e68e86> 13111\n<e68e93> <e68e95> 13116\n<e68e99> <e68e9f> 13120\n<e68eb1> <e68eb2> 13132\n<e68eb5> <e68eb6> 13134\n<e68f81> <e68f83> 13140\n<e68f87> <e68f88> 13144\n<e68f8a> <e68f8c> 13146\n<e68f93> <e68f95> 13150\n<e68f97> <e68f99> 13153\n<e68f9b> <e68f9d> 13156\n<e68fa4> <e68fa8> 13161\n<e68fab> <e68fac> 13166\n<e68faf> <e68fb1> 13168\n<e68fb9> <e68fbc> 13174\n<e69083> <e69084> 13179\n<e69086> <e6908a> 13181\n<e69091> <e69092> 13187\n<e69095> <e69096> 13189\n<e69098> <e6909a> 13191\n<e690a2> <e690a5> 13196\n<e690a7> <e690a9> 13200\n<e690ae> <e690b3> 13204\n<e690b7> <e690b9> 13211\n<e690bb> <e690bc> 13214\n<e69182> <e69183> 13218\n<e6918b> <e69190> 13221\n<e69195> <e69197> 13228\n<e69199> <e6919b> 13231\n<e691a0> <e691a6> 13235\n<e691aa> <e691ac> 13243\n<e691b0> <e691b2> 13247\n<e691b4> <e691b5> 13250\n<e691b8> <e691b9> 2819\n<e691bc> <e691bf> 13253\n<e69280> <e69281> 13257\n<e69289> <e69290> 13261\n<e69297> <e69298> 13270\n<e6929a> <e6929d> 13272\n<e692a0> <e692a2> 13276\n<e692a6> <e692a8> 13279\n<e692b7> <e692b8> 5354\n<e69388> <e69389> 13291\n<e69395> <e69396> 13297\n<e6939b> <e6939d> 13300\n<e693a7> <e693ab> 13307\n<e693ad> <e693ae> 13312\n<e693b5> <e693b6> 13315\n<e693b8> <e693b9> 13317\n<e69481> <e69483> 13321\n<e69487> <e69488> 13325\n<e6948a> <e6948e> 13327\n<e69490> <e69491> 13332\n<e6949e> <e694a1> 13339\n<e694a6> <e694a9> 13343\n<e694b0> <e694b3> 13348\nendcidrange\n\n100 begincidrange\n<e694bc> <e694bd> 13354\n<e69580> <e69584> 13356\n<e69586> <e69587> 13361\n<e6958a> <e6958b> 13363\n<e6958d> <e6958e> 13365\n<e69592> <e69594> 13368\n<e6959f> <e695a1> 13374\n<e695a4> <e695a5> 13377\n<e695a7> <e695aa> 13379\n<e695ad> <e695af> 13383\n<e695b9> <e695bf> 13389\n<e69680> <e69681> 13396\n<e69684> <e69686> 13398\n<e69688> <e6968a> 13401\n<e6968d> <e6968f> 13404\n<e6969d> <e6969e> 13412\n<e696a2> <e696a3> 13415\n<e696b1> <e696b6> 13421\n<e696ba> <e696bb> 13428\n<e696be> <e696bf> 13430\n<e69787> <e6978a> 13434\n<e69790> <e69791> 13439\n<e69793> <e69795> 13441\n<e69798> <e6979f> 13444\n<e697a3> <e697a4> 13453\n<e697aa> <e697ab> 13455\n<e697ae> <e697b0> 6410\n<e697b2> <e697b5> 13457\n<e697b8> <e697b9> 13461\n<e697bb> <e697bf> 13463\n<e69884> <e69885> 13469\n<e69887> <e69889> 13471\n<e69890> <e69892> 13476\n<e69896> <e69898> 13479\n<e6989a> <e6989c> 13482\n<e698a1> <e698a4> 13486\n<e698a9> <e698ac> 13491\n<e698b2> <e698b3> 13497\n<e698b7> <e698bb> 13499\n<e69984> <e6998a> 13507\n<e6998d> <e6998e> 13514\n<e69990> <e69991> 13516\n<e69998> <e69999> 13518\n<e6999b> <e6999c> 13520\n<e699a2> <e699a3> 13524\n<e699a9> <e699ad> 13528\n<e699b1> <e699b3> 13533\n<e699b8> <e699b9> 13537\n<e699bb> <e699bd> 13539\n<e69a80> <e69a81> 13543\n<e69a85> <e69a86> 13546\n<e69a8a> <e69a8b> 13548\n<e69a8d> <e69a90> 13550\n<e69a92> <e69a95> 13554\n<e69a98> <e69a9c> 13558\n<e69a9e> <e69aa1> 13563\n<e69aa3> <e69aa6> 13567\n<e69aa9> <e69aaa> 13571\n<e69aac> <e69aad> 13573\n<e69aaf> <e69ab3> 13575\n<e69ab5> <e69ab8> 13580\n<e69aba> <e69abd> 13584\n<e69b80> <e69b83> 13589\n<e69b8a> <e69b95> 13595\n<e69b97> <e69b98> 13607\n<e69b9b> <e69b9c> 6440\n<e69b9e> <e69b9f> 13610\n<e69ba1> <e69ba5> 13612\n<e69ba7> <e69ba8> 13617\n<e69baa> <e69bab> 13619\n<e69bad> <e69baf> 13621\n<e69bb5> <e69bb6> 13625\n<e69bba> <e69bbb> 13627\n<e69c81> <e69c82> 13630\n<e69c84> <e69c87> 13632\n<e69c8e> <e69c8f> 13637\n<e69c91> <e69c93> 13639\n<e69c98> <e69c9a> 13643\n<e69ca0> <e69ca5> 13648\n<e69cb2> <e69cb3> 13657\n<e69cb6> <e69cb9> 13659\n<e69cbb> <e69cbc> 13663\n<e69cbe> <e69cbf> 13665\n<e69d84> <e69d85> 13668\n<e69d8a> <e69d8b> 13671\n<e69d94> <e69d95> 13675\n<e69d97> <e69d9b> 13677\n<e69da2> <e69da4> 13683\n<e69da6> <e69da7> 13686\n<e69dab> <e69dac> 13688\n<e69db8> <e69dbb> 13693\n<e69e82> <e69e83> 13699\n<e69e85> <e69e86> 13701\n<e69e8c> <e69e8f> 13705\n<e69e91> <e69e94> 13709\n<e69e9f> <e69ea1> 13716\n<e69eb1> <e69eb2> 13724\n<e69eb9> <e69ebf> 13727\n<e69f85> <e69f8e> 13736\n<e69f95> <e69f97> 13746\nendcidrange\n\n100 begincidrange\n<e69fa3> <e69fa4> 13752\n<e69fa6> <e69fa8> 13754\n<e69faa> <e69fab> 13757\n<e69fad> <e69fae> 13759\n<e69fb5> <e69fbc> 13762\n<e6a081> <e6a084> 13771\n<e6a094> <e6a095> 13779\n<e6a098> <e6a09c> 13781\n<e6a09e> <e6a0a0> 13786\n<e6a0a2> <e6a0a8> 13789\n<e6a0ab> <e6a0b1> 13796\n<e6a0b2> <e6a0b3> 6262\n<e6a0b4> <e6a0b6> 13803\n<e6a0ba> <e6a0bb> 13806\n<e6a196> <e6a19f> 13814\n<e6a1a0> <e6a1a1> 6264\n<e6a1ac> <e6a1b3> 13825\n<e6a1b8> <e6a1bf> 13834\n<e6a287> <e6a28e> 13845\n<e6a290> <e6a292> 13853\n<e6a294> <e6a296> 13856\n<e6a299> <e6a29c> 13859\n<e6a2a0> <e6a2a1> 13864\n<e6a2a3> <e6a2a5> 13866\n<e6a2a9> <e6a2ac> 13869\n<e6a2b1> <e6a2b2> 13874\n<e6a2b6> <e6a2bf> 13877\n<e6a383> <e6a388> 13888\n<e6a38e> <e6a391> 13896\n<e6a393> <e6a394> 13900\n<e6a39b> <e6a39e> 13903\n<e6a3a1> <e6a3a2> 13907\n<e6a3a4> <e6a3a6> 13909\n<e6a3a8> <e6a3ad> 13912\n<e6a3b2> <e6a3b4> 13919\n<e6a3b6> <e6a3b8> 13922\n<e6a3bd> <e6a3bf> 13926\n<e6a482> <e6a484> 13930\n<e6a486> <e6a48a> 13933\n<e6a493> <e6a49e> 13940\n<e6a49f> <e6a4a0> 6290\n<e6a4a1> <e6a4a3> 13952\n<e6a4a5> <e6a4ac> 13955\n<e6a4ae> <e6a4af> 13963\n<e6a4b1> <e6a4b3> 13965\n<e6a4b5> <e6a4b8> 13968\n<e6a4ba> <e6a4bc> 13972\n<e6a580> <e6a581> 13976\n<e6a583> <e6a589> 13978\n<e6a58b> <e6a592> 13985\n<e6a595> <e6a596> 13993\n<e6a598> <e6a599> 13995\n<e6a59b> <e6a59c> 13997\n<e6a5a1> <e6a5a2> 14000\n<e6a5a4> <e6a5a5> 14002\n<e6a5a9> <e6a5aa> 14005\n<e6a5af> <e6a5b0> 14008\n<e6a5b2> <e6a5b4> 14010\n<e6a5ba> <e6a5bb> 14014\n<e6a5bd> <e6a5bf> 14016\n<e6a687> <e6a688> 6312\n<e6a68a> <e6a68c> 14022\n<e6a68e> <e6a693> 14025\n<e6a696> <e6a697> 14031\n<e6a699> <e6a69a> 14033\n<e6a69d> <e6a6a6> 14035\n<e6a6af> <e6a6b0> 14047\n<e6a6b2> <e6a6b3> 14049\n<e6a6b5> <e6a6b6> 14051\n<e6a6b8> <e6a6ba> 14053\n<e6a6bc> <e6a6be> 14056\n<e6a782> <e6a789> 14060\n<e6a791> <e6a793> 14069\n<e6a795> <e6a79a> 14072\n<e6a79c> <e6a79e> 14078\n<e6a7a1> <e6a7a6> 14081\n<e6a7a8> <e6a7ac> 14087\n<e6a7ae> <e6a7b1> 14092\n<e6a7b4> <e6a7bc> 14096\n<e6a883> <e6a884> 14107\n<e6a886> <e6a889> 14109\n<e6a88b> <e6a892> 14113\n<e6a894> <e6a896> 14121\n<e6a897> <e6a898> 6335\n<e6a89a> <e6a89d> 14124\n<e6a8a4> <e6a8a7> 14130\n<e6a8ab> <e6a8ae> 14135\n<e6a8b2> <e6a8b4> 14140\n<e6a8b6> <e6a8b7> 14143\n<e6a8bb> <e6a8bc> 14145\n<e6a980> <e6a983> 14148\n<e6a985> <e6a986> 14152\n<e6a989> <e6a98a> 14154\n<e6a98c> <e6a98f> 14156\n<e6a991> <e6a997> 14160\n<e6a99c> <e6a99e> 14168\n<e6a9a3> <e6a9a4> 14172\n<e6a9a6> <e6a9b0> 14174\n<e6a9b2> <e6a9b8> 14185\n<e6a9ba> <e6a9bb> 14192\nendcidrange\n\n100 begincidrange\n<e6a9bd> <e6a9bf> 14194\n<e6aa81> <e6aa83> 14197\n<e6aa85> <e6aa88> 14200\n<e6aa8a> <e6aa8d> 14204\n<e6aa92> <e6aa93> 14209\n<e6aa95> <e6aa96> 14211\n<e6aa98> <e6aa9b> 14213\n<e6aa9d> <e6aa9f> 14217\n<e6aaa4> <e6aaa8> 14221\n<e6aaad> <e6aaae> 14227\n<e6aab0> <e6aab2> 14229\n<e6aab4> <e6aab7> 14232\n<e6aab9> <e6aaba> 14236\n<e6aabc> <e6aabf> 14238\n<e6ab80> <e6ab82> 14242\n<e6ab84> <e6ab92> 14245\n<e6ab94> <e6ab99> 14260\n<e6aba0> <e6aba6> 14267\n<e6abad> <e6abb2> 14276\n<e6abb4> <e6abb7> 14282\n<e6abb9> <e6abba> 14286\n<e6abbc> <e6abbf> 14288\n<e6ac80> <e6ac83> 14292\n<e6ac85> <e6ac89> 14296\n<e6ac8b> <e6ac8e> 14301\n<e6ac90> <e6ac91> 14305\n<e6ac93> <e6ac95> 14307\n<e6ac97> <e6ac9d> 14310\n<e6aca5> <e6aca6> 14318\n<e6aca8> <e6acb1> 14320\n<e6acb3> <e6acb6> 14330\n<e6acbb> <e6acbc> 14335\n<e6ad80> <e6ad82> 14338\n<e6ad84> <e6ad85> 14341\n<e6ad8a> <e6ad8b> 14344\n<e6ad8d> <e6ad8f> 14346\n<e6ad91> <e6ad98> 14349\n<e6ad9a> <e6ad9e> 14357\n<e6ada8> <e6ada9> 14363\n<e6adab> <e6adb1> 14365\n<e6adb3> <e6adb6> 14372\n<e6adbd> <e6adbf> 14377\n<e6ae81> <e6ae82> 6358\n<e6ae8e> <e6ae91> 14384\n<e6ae92> <e6ae93> 6362\n<e6ae94> <e6ae95> 14388\n<e6ae9a> <e6ae9b> 6365\n<e6ae9c> <e6ae9d> 14392\n<e6ae9f> <e6aea0> 14394\n<e6aea2> <e6aea3> 14396\n<e6aea5> <e6aea9> 14398\n<e6aeac> <e6aead> 14403\n<e6aeb0> <e6aeb1> 14405\n<e6aeb8> <e6aeb9> 14408\n<e6aebc> <e6aebe> 14410\n<e6af83> <e6af84> 14414\n<e6af87> <e6af8a> 14416\n<e6af90> <e6af91> 14422\n<e6af9c> <e6afa0> 14426\n<e6afa2> <e6afa9> 14431\n<e6afac> <e6afae> 14439\n<e6afb0> <e6afb2> 14442\n<e6afb6> <e6afb8> 14446\n<e6afba> <e6afbc> 14449\n<e6b080> <e6b084> 14453\n<e6b089> <e6b08b> 14458\n<e6b098> <e6b09a> 6494\n<e6b09c> <e6b09e> 14464\n<e6b0b6> <e6b0b7> 14472\n<e6b0b9> <e6b0bc> 14474\n<e6b0be> <e6b0bf> 14478\n<e6b183> <e6b185> 14480\n<e6b18b> <e6b18f> 14484\n<e6b191> <e6b193> 14489\n<e6b198> <e6b19a> 14493\n<e6b1a2> <e6b1a3> 14496\n<e6b1a5> <e6b1a7> 14498\n<e6b1a8> <e6b1a9> 5800\n<e6b1ab> <e6b1af> 14501\n<e6b1b7> <e6b1b8> 14509\n<e6b1ba> <e6b1bc> 14511\n<e6b28a> <e6b28b> 14518\n<e6b28d> <e6b28e> 14520\n<e6b291> <e6b292> 14522\n<e6b295> <e6b298> 14524\n<e6b29c> <e6b29e> 14529\n<e6b2af> <e6b2b0> 14536\n<e6b2b4> <e6b2b7> 14538\n<e6b380> <e6b383> 14543\n<e6b386> <e6b388> 14547\n<e6b38d> <e6b38f> 14551\n<e6b391> <e6b392> 14554\n<e6b398> <e6b39a> 14556\n<e6b39c> <e6b39d> 14559\n<e6b3a6> <e6b3a7> 14563\n<e6b3ac> <e6b3ad> 14566\n<e6b3b7> <e6b3b8> 5809\n<e6b482> <e6b483> 14573\n<e6b485> <e6b486> 14575\n<e6b488> <e6b48a> 14577\nendcidrange\n\n100 begincidrange\n<e6b48f> <e6b491> 14581\n<e6b493> <e6b496> 14584\n<e6b49c> <e6b49d> 14589\n<e6b49f> <e6b4a4> 14591\n<e6b4a8> <e6b4a9> 14598\n<e6b4ac> <e6b4ad> 14600\n<e6b4af> <e6b4b0> 14602\n<e6b4b6> <e6b4b8> 14605\n<e6b595> <e6b598> 14616\n<e6b5a1> <e6b5a2> 14623\n<e6b5a4> <e6b5a5> 14625\n<e6b5a7> <e6b5a8> 14627\n<e6b5ab> <e6b5ad> 14629\n<e6b5b0> <e6b5b3> 14632\n<e6b5b5> <e6b5b6> 14636\n<e6b5ba> <e6b5bb> 14638\n<e6b5bd> <e6b5bf> 14640\n<e6b680> <e6b681> 14643\n<e6b683> <e6b684> 14645\n<e6b68a> <e6b68b> 14648\n<e6b68f> <e6b690> 14651\n<e6b693> <e6b694> 5846\n<e6b696> <e6b69a> 14654\n<e6b6ac> <e6b6ad> 14662\n<e6b6b0> <e6b6b1> 14664\n<e6b6b3> <e6b6b4> 14666\n<e6b6b6> <e6b6b7> 14668\n<e6b6b9> <e6b6be> 14670\n<e6b781> <e6b783> 14676\n<e6b788> <e6b78a> 14679\n<e6b78d> <e6b790> 14682\n<e6b792> <e6b795> 14686\n<e6b79a> <e6b79c> 14691\n<e6b7a2> <e6b7a3> 14695\n<e6b7a7> <e6b7a9> 14698\n<e6b7af> <e6b7b0> 14702\n<e6b7bd> <e6b7bf> 14707\n<e6b880> <e6b884> 14710\n<e6b886> <e6b889> 14715\n<e6b892> <e6b893> 14721\n<e6b898> <e6b899> 14724\n<e6b89b> <e6b89c> 14726\n<e6b89e> <e6b89f> 14728\n<e6b8a7> <e6b8a8> 14731\n<e6b8b0> <e6b8b1> 14735\n<e6b8b5> <e6b8b7> 14738\n<e6b8bb> <e6b8bd> 14742\n<e6b980> <e6b982> 14746\n<e6b985> <e6b98c> 14749\n<e6b98f> <e6b992> 14757\n<e6b993> <e6b994> 5874\n<e6b999> <e6b99a> 14763\n<e6b99c> <e6b99d> 14765\n<e6b9a0> <e6b9aa> 14767\n<e6b9ac> <e6b9ad> 14778\n<e6b9b0> <e6b9bd> 14780\n<e6ba80> <e6ba82> 14794\n<e6ba87> <e6ba88> 14798\n<e6ba8a> <e6ba8e> 14800\n<e6ba91> <e6ba95> 14805\n<e6ba99> <e6ba9b> 14811\n<e6baa0> <e6baa1> 14815\n<e6baa3> <e6baa4> 14817\n<e6baa8> <e6baa9> 14820\n<e6baab> <e6baae> 14822\n<e6bab8> <e6bab9> 14829\n<e6babe> <e6babf> 14832\n<e6bb88> <e6bb8a> 14837\n<e6bb98> <e6bb99> 14844\n<e6bb9b> <e6bb9d> 14846\n<e6bbaa> <e6bbab> 14851\n<e6bbad> <e6bbae> 14853\n<e6bbb0> <e6bbb1> 14855\n<e6bbb5> <e6bbb6> 14858\n<e6bbba> <e6bbbe> 14860\n<e6bc83> <e6bc85> 14866\n<e6bc87> <e6bc88> 14869\n<e6bc8a> <e6bc8e> 14871\n<e6bc90> <e6bc92> 14876\n<e6bc96> <e6bc99> 14879\n<e6bc9b> <e6bc9f> 14883\n<e6bca5> <e6bca8> 14889\n<e6bcb4> <e6bcb5> 14895\n<e6bcb9> <e6bcbd> 14898\n<e6bd82> <e6bd85> 14904\n<e6bd86> <e6bd87> 5897\n<e6bd88> <e6bd8a> 14908\n<e6bd8e> <e6bd90> 14912\n<e6bd92> <e6bd93> 14915\n<e6bd95> <e6bd97> 14917\n<e6bd9a> <e6bd9b> 14920\n<e6bd9f> <e6bda1> 14923\n<e6bda7> <e6bdac> 14928\n<e6bdb5> <e6bdb6> 14936\n<e6bdbd> <e6bdbe> 14940\n<e6be81> <e6be83> 14942\n<e6be8a> <e6be8b> 14946\n<e6be8f> <e6be96> 14948\n<e6be98> <e6be9b> 14956\n<e6be9d> <e6be9f> 14960\nendcidrange\n\n100 begincidrange\n<e6bea2> <e6bea3> 14963\n<e6bea5> <e6bea6> 14965\n<e6beaa> <e6bead> 14968\n<e6beaf> <e6beb0> 14972\n<e6beb4> <e6beb5> 14975\n<e6beb7> <e6beb8> 14977\n<e6beba> <e6bebf> 14979\n<e6bf84> <e6bf88> 14985\n<e6bf8a> <e6bf90> 14990\n<e6bf93> <e6bf94> 14997\n<e6bf96> <e6bf97> 14999\n<e6bf99> <e6bf9a> 15001\n<e6bf9c> <e6bf9d> 15003\n<e6bfa2> <e6bfa3> 15005\n<e6bfa5> <e6bfaa> 15007\n<e6bfac> <e6bfad> 15013\n<e6bfb2> <e6bfb9> 15015\n<e78080> <e78084> 15026\n<e78087> <e78088> 15031\n<e7808c> <e7808e> 15034\n<e78092> <e78094> 15038\n<e78096> <e78097> 15041\n<e780a1> <e780a2> 15046\n<e780a4> <e780a6> 15048\n<e780a9> <e780af> 15051\n<e780b3> <e780b4> 15059\n<e780b6> <e780b8> 15061\n<e780ba> <e780bd> 15064\n<e78180> <e78182> 15069\n<e78185> <e7818b> 15072\n<e7818d> <e7818e> 15079\n<e78192> <e78194> 15082\n<e78196> <e78197> 15085\n<e78199> <e7819c> 15087\n<e7819f> <e781a2> 15091\n<e781a5> <e781a6> 15095\n<e781a8> <e781aa> 15097\n<e781b1> <e781b4> 15101\n<e781b9> <e781bb> 15106\n<e78281> <e78284> 15110\n<e78286> <e78288> 15114\n<e7828b> <e7828d> 15117\n<e7828f> <e78291> 15120\n<e78297> <e78298> 15124\n<e7829a> <e7829b> 15126\n<e7829e> <e782aa> 15128\n<e782b4> <e782b6> 15143\n<e782be> <e782bf> 15147\n<e78384> <e78387> 15149\n<e7838b> <e7838e> 15154\n<e78390> <e78397> 15158\n<e7839c> <e7839e> 15167\n<e783a0> <e783a3> 15170\n<e783b0> <e783b3> 15177\n<e783b5> <e783b6> 15181\n<e783ba> <e783bc> 15184\n<e783be> <e783bf> 15187\n<e78480> <e78488> 15189\n<e7848b> <e7848f> 15198\n<e78491> <e78492> 15203\n<e7849b> <e784a0> 15207\n<e784a2> <e784a5> 15213\n<e784a7> <e784ae> 15217\n<e784b2> <e784b5> 15225\n<e784b7> <e784bf> 15229\n<e78580> <e78584> 15238\n<e78586> <e78588> 15243\n<e7858f> <e78591> 15248\n<e78593> <e7859b> 15251\n<e7859f> <e785a1> 15261\n<e785aa> <e785ab> 15266\n<e785af> <e785b1> 15269\n<e785b4> <e785b7> 15272\n<e785bb> <e785bc> 15277\n<e785be> <e785bf> 15279\n<e78680> <e78683> 15281\n<e78685> <e78689> 15285\n<e7868b> <e7868e> 15290\n<e78690> <e78691> 15294\n<e78695> <e78696> 15297\n<e7869a> <e7869e> 15299\n<e786a1> <e786a7> 15304\n<e786a9> <e786ab> 15311\n<e786ad> <e786b0> 15314\n<e786b6> <e786b8> 15320\n<e786ba> <e786bd> 15323\n<e78784> <e78787> 15330\n<e78789> <e7878d> 15334\n<e7878f> <e78791> 15339\n<e78796> <e78798> 15343\n<e7879a> <e7879b> 15346\n<e7879d> <e7879e> 15348\n<e787a1> <e787a4> 15350\n<e787a8> <e787ac> 15354\n<e787af> <e787b3> 15359\n<e787b5> <e787b8> 15364\n<e787ba> <e787bb> 15368\n<e78880> <e78885> 15372\n<e78887> <e7888c> 15378\n<e7888e> <e7888f> 15384\nendcidrange\n\n100 begincidrange\n<e78891> <e7889a> 15386\n<e7889e> <e788a7> 15397\n<e788ad> <e788af> 15409\n<e788b3> <e788b4> 15412\n<e78980> <e78986> 15415\n<e78989> <e7898b> 15422\n<e7898e> <e78991> 15425\n<e78993> <e78995> 15429\n<e789a3> <e789a5> 15437\n<e789aa> <e789ad> 15441\n<e789b0> <e789b1> 15445\n<e789b3> <e789b4> 15447\n<e789b6> <e789b8> 15449\n<e789bb> <e789bc> 15452\n<e789be> <e789bf> 6471\n<e78a82> <e78a83> 15454\n<e78a85> <e78a89> 15456\n<e78a90> <e78a91> 15463\n<e78a93> <e78a95> 15465\n<e78a97> <e78a9e> 15468\n<e78aa0> <e78aa1> 15476\n<e78aa3> <e78aa6> 15478\n<e78aa8> <e78aab> 15482\n<e78ab1> <e78ab3> 15487\n<e78ab7> <e78ab8> 5618\n<e78aba> <e78abf> 15491\n<e78b85> <e78b87> 15497\n<e78b89> <e78b8c> 15500\n<e78b93> <e78b96> 15506\n<e78b9a> <e78b9d> 15511\n<e78ba2> <e78ba7> 15516\n<e78baa> <e78bab> 15522\n<e78bb5> <e78bb6> 15524\n<e78bba> <e78bbb> 5634\n<e78bbe> <e78bbf> 15526\n<e78c84> <e78c89> 15530\n<e78c8b> <e78c8d> 15536\n<e78c8f> <e78c92> 15539\n<e78c98> <e78c9a> 15544\n<e78c9f> <e78ca0> 15547\n<e78ca3> <e78ca4> 15549\n<e78ca6> <e78ca8> 15551\n<e78caf> <e78cb0> 15555\n<e78cb2> <e78cb3> 15557\n<e78cbc> <e78cbd> 15561\n<e78d82> <e78d83> 15564\n<e78d86> <e78d8c> 15566\n<e78d8e> <e78d8f> 15573\n<e78d93> <e78d96> 15576\n<e78d98> <e78d9f> 15580\n<e78da1> <e78da7> 15588\n<e78db3> <e78db4> 15598\n<e78e81> <e78e83> 15604\n<e78e85> <e78e86> 15607\n<e78e8c> <e78e8d> 15611\n<e78e8f> <e78e90> 15613\n<e78e92> <e78e95> 15615\n<e78e97> <e78e9a> 15619\n<e78e9c> <e78e9e> 15623\n<e78ea0> <e78ea1> 15626\n<e78ea3> <e78ea8> 15628\n<e78eac> <e78ead> 15635\n<e78eb4> <e78eb6> 15638\n<e78eb8> <e78eb9> 15641\n<e78ebc> <e78ebf> 15643\n<e78f83> <e78f87> 15648\n<e78f8b> <e78f8c> 15653\n<e78f92> <e78f98> 15656\n<e78f9a> <e78f9d> 15663\n<e78fa1> <e78fa4> 15668\n<e78faa> <e78fac> 15674\n<e78fae> <e78fb1> 15677\n<e78fb3> <e78fbd> 15681\n<e79080> <e79082> 15693\n<e79087> <e79088> 15697\n<e7908b> <e7908e> 15699\n<e79091> <e79099> 15703\n<e7909c> <e790a1> 15712\n<e790a3> <e790a4> 15718\n<e790b1> <e790b2> 15725\n<e790b7> <e790bb> 15727\n<e790bd> <e790be> 15732\n<e79182> <e7918a> 15735\n<e7918c> <e79194> 15744\n<e791a0> <e791a2> 15756\n<e791a4> <e791a8> 15759\n<e791ab> <e791ac> 15764\n<e791ae> <e791af> 15766\n<e791b1> <e791b5> 15768\n<e791b8> <e791bd> 15773\n<e79280> <e79281> 6211\n<e79284> <e79286> 15781\n<e7928c> <e7928d> 15786\n<e79291> <e7929b> 15789\n<e7929f> <e792a2> 15801\n<e792a4> <e792a5> 15805\n<e792a8> <e792a9> 6216\n<e792aa> <e792af> 15807\n<e792b1> <e792b9> 15813\n<e792bb> <e792bc> 15822\nendcidrange\n\n100 begincidrange\n<e792be> <e792bf> 15824\n<e79380> <e79389> 15826\n<e7938b> <e7938e> 15836\n<e79390> <e79391> 15840\n<e79395> <e79399> 15843\n<e793a7> <e793ad> 15853\n<e793b0> <e793b3> 15860\n<e793b8> <e793be> 15865\n<e79480> <e79483> 15872\n<e79485> <e7948b> 15876\n<e79494> <e79497> 15886\n<e7949d> <e7949e> 15891\n<e794a0> <e794a2> 15893\n<e794a6> <e794a7> 15897\n<e794bc> <e794bd> 15904\n<e79581> <e79584> 15907\n<e79586> <e79587> 15911\n<e79589> <e7958a> 15913\n<e79590> <e79593> 15916\n<e79595> <e79598> 15920\n<e7959e> <e795a1> 15924\n<e795a3> <e795a4> 15928\n<e795a7> <e795a9> 15930\n<e795ac> <e795b1> 15933\n<e795ba> <e795be> 15942\n<e79680> <e79682> 15947\n<e79684> <e79685> 15950\n<e79688> <e7968a> 15952\n<e7968c> <e7968e> 15955\n<e7969b> <e7969c> 15962\n<e796a6> <e796aa> 15966\n<e796b3> <e796b4> 7015\n<e796b6> <e796b7> 15972\n<e796ba> <e796bb> 15974\n<e79780> <e79781> 15977\n<e7978b> <e7978c> 15980\n<e7978e> <e79791> 15982\n<e7979c> <e7979d> 15989\n<e7979f> <e797a1> 15991\n<e797ac> <e797af> 15996\n<e797b2> <e797b3> 16000\n<e797b5> <e797b8> 16002\n<e797ba> <e797bb> 16006\n<e797bd> <e797be> 16008\n<e79886> <e79889> 16011\n<e7988e> <e7988f> 16015\n<e79891> <e79894> 16017\n<e7989c> <e7989d> 16023\n<e798ae> <e798af> 16028\n<e798b1> <e798b2> 16030\n<e798b6> <e798b7> 16032\n<e798b9> <e798ba> 16034\n<e79984> <e79985> 16038\n<e79986> <e79987> 9647\n<e7998a> <e7998b> 16041\n<e7998e> <e79993> 16043\n<e79999> <e7999b> 16051\n<e799a0> <e799a1> 16055\n<e799ad> <e799ae> 9652\n<e799b3> <e799b7> 16060\n<e799b9> <e799ba> 16065\n<e79a80> <e79a81> 16068\n<e79a89> <e79a8a> 16072\n<e79a8c> <e79a8d> 16074\n<e79a8f> <e79a90> 16076\n<e79a94> <e79a95> 16079\n<e79a97> <e79a98> 16081\n<e79a9b> <e79aa3> 16083\n<e79aa5> <e79aad> 16092\n<e79aaf> <e79ab0> 16101\n<e79ab5> <e79ab7> 16104\n<e79abb> <e79abe> 16108\n<e79b80> <e79b81> 16112\n<e79b83> <e79b84> 16114\n<e79b8b> <e79b8c> 16118\n<e79b99> <e79b9a> 16122\n<e79b9c> <e79b9d> 16124\n<e79ba8> <e79bad> 16129\n<e79bb5> <e79bb7> 16137\n<e79bba> <e79bbb> 16140\n<e79c82> <e79c83> 16145\n<e79c85> <e79c86> 16147\n<e79c87> <e79c88> 6748\n<e79c8e> <e79c98> 16151\n<e79c9b> <e79c9e> 16162\n<e79ca3> <e79ca5> 16167\n<e79caa> <e79cac> 16171\n<e79cb0> <e79cb4> 16175\n<e79cbd> <e79cbf> 16182\n<e79d84> <e79d86> 16186\n<e79d88> <e79d8e> 16189\n<e79d90> <e79d91> 6757\n<e79d92> <e79d99> 16196\n<e79d9c> <e79d9d> 16204\n<e79d9f> <e79da0> 16206\n<e79da9> <e79daa> 16210\n<e79dad> <e79db8> 16212\n<e79dba> <e79dbc> 16224\n<e79e81> <e79e83> 16227\n<e79e86> <e79e8b> 16230\nendcidrange\n\n100 begincidrange\n<e79e8f> <e79e90> 16236\n<e79e93> <e79e97> 16238\n<e79e99> <e79e9d> 16243\n<e79e9f> <e79ea0> 6771\n<e79ea3> <e79ea4> 16249\n<e79eae> <e79eaf> 16254\n<e79eb1> <e79eb2> 16256\n<e79eb6> <e79eba> 16259\n<e79f80> <e79f86> 16265\n<e79f88> <e79f8c> 16272\n<e79f8e> <e79f96> 16277\n<e79f98> <e79f99> 16286\n<e79f9d> <e79fa1> 16288\n<e79fb0> <e79fb2> 16297\n<e79fb4> <e79fb5> 16300\n<e79fb9> <e79fbc> 16303\n<e7a083> <e7a088> 16307\n<e7a08a> <e7a08b> 16313\n<e7a08e> <e7a090> 16315\n<e7a097> <e7a098> 6694\n<e7a09c> <e7a09d> 6699\n<e7a0a0> <e7a0a2> 16323\n<e7a0aa> <e7a0ab> 16328\n<e7a0ae> <e7a0af> 16330\n<e7a0b1> <e7a0b3> 16332\n<e7a0b5> <e7a0b6> 16335\n<e7a0b9> <e7a0bb> 6701\n<e7a181> <e7a182> 16339\n<e7a188> <e7a18b> 16343\n<e7a193> <e7a194> 16350\n<e7a196> <e7a197> 6712\n<e7a198> <e7a19c> 16352\n<e7a19e> <e7a1a3> 16357\n<e7a1a5> <e7a1a7> 16363\n<e7a1b0> <e7a1b6> 16367\n<e7a1b8> <e7a1bb> 16374\n<e7a1bd> <e7a1bf> 16378\n<e7a280> <e7a286> 16381\n<e7a28a> <e7a28b> 16389\n<e7a28f> <e7a290> 16391\n<e7a294> <e7a296> 16394\n<e7a29d> <e7a29e> 16398\n<e7a2aa> <e7a2ac> 16405\n<e7a2ae> <e7a2af> 16408\n<e7a2b5> <e7a2b7> 16410\n<e7a382> <e7a384> 16417\n<e7a386> <e7a388> 16420\n<e7a38c> <e7a38f> 16423\n<e7a391> <e7a393> 16427\n<e7a396> <e7a398> 16430\n<e7a39b> <e7a3a2> 16433\n<e7a3a4> <e7a3a6> 16441\n<e7a3a9> <e7a3ab> 16444\n<e7a3ad> <e7a3ae> 16447\n<e7a3b0> <e7a3b1> 16449\n<e7a3b5> <e7a3b6> 16452\n<e7a3b8> <e7a3b9> 16454\n<e7a3bb> <e7a3bc> 16456\n<e7a3be> <e7a3bf> 16458\n<e7a482> <e7a484> 16461\n<e7a486> <e7a48d> 16464\n<e7a48f> <e7a492> 16472\n<e7a494> <e7a498> 16476\n<e7a49a> <e7a49d> 16481\n<e7a49f> <e7a4a3> 16485\n<e7a4a7> <e7a4a9> 16491\n<e7a4ad> <e7a4b0> 16494\n<e7a4b2> <e7a4b3> 16498\n<e7a4b5> <e7a4b9> 16500\n<e7a582> <e7a585> 16507\n<e7a58a> <e7a592> 16512\n<e7a594> <e7a595> 16521\n<e7a598> <e7a599> 16523\n<e7a59b> <e7a59c> 6652\n<e7a5a3> <e7a5a4> 16526\n<e7a5a9> <e7a5ac> 16529\n<e7a5b0> <e7a5b6> 16534\n<e7a5bb> <e7a5bf> 16542\n<e7a682> <e7a683> 16547\n<e7a686> <e7a689> 16549\n<e7a68b> <e7a68c> 16553\n<e7a690> <e7a699> 16555\n<e7a69b> <e7a6a5> 16565\n<e7a6a8> <e7a6a9> 16576\n<e7a6ab> <e7a6ad> 16578\n<e7a6b4> <e7a6b8> 16583\n<e7a784> <e7a785> 16591\n<e7a787> <e7a788> 16593\n<e7a78e> <e7a790> 16597\n<e7a793> <e7a794> 16600\n<e7a796> <e7a797> 16602\n<e7a799> <e7a79e> 16604\n<e7a7a0> <e7a7a2> 16610\n<e7a7b1> <e7a7b7> 16618\n<e7a7b9> <e7a7ba> 16625\n<e7a7be> <e7a7bf> 16628\n<e7a884> <e7a885> 16631\n<e7a887> <e7a88a> 16633\n<e7a88f> <e7a893> 16638\n<e7a895> <e7a896> 16643\nendcidrange\n\n100 begincidrange\n<e7a898> <e7a899> 16645\n<e7a89b> <e7a89d> 16647\n<e7a8a1> <e7a8a2> 16651\n<e7a8a4> <e7a8ad> 16653\n<e7a8af> <e7a8b0> 16663\n<e7a8b4> <e7a8b6> 16666\n<e7a981> <e7a985> 16672\n<e7a987> <e7a98b> 16677\n<e7a98f> <e7a990> 16682\n<e7a992> <e7a996> 16684\n<e7a998> <e7a9a0> 16689\n<e7a9a3> <e7a9a8> 16698\n<e7a9ac> <e7a9af> 16705\n<e7a9b1> <e7a9b3> 16709\n<e7a9b8> <e7a9b9> 7066\n<e7a9bb> <e7a9be> 16713\n<e7aa89> <e7aa8c> 16720\n<e7aa8e> <e7aa90> 16724\n<e7aa93> <e7aa94> 16727\n<e7aa99> <e7aa9b> 16729\n<e7aaa1> <e7aaa4> 16733\n<e7aaaf> <e7aab2> 16739\n<e7aab4> <e7aab5> 16743\n<e7aab7> <e7aab9> 16745\n<e7aabb> <e7aabe> 16748\n<e7ab80> <e7ab83> 16752\n<e7ab8c> <e7ab95> 16758\n<e7ab97> <e7ab98> 16768\n<e7ab9a> <e7ab9d> 16770\n<e7aba1> <e7aba2> 16774\n<e7aba7> <e7aba9> 16777\n<e7abab> <e7abac> 16780\n<e7abb0> <e7abb5> 16783\n<e7abb7> <e7abb8> 16789\n<e7abbb> <e7abbc> 16791\n<e7ac80> <e7ac82> 16794\n<e7ac83> <e7ac84> 7270\n<e7ac8c> <e7ac8e> 16800\n<e7ac92> <e7ac93> 16804\n<e7ac96> <e7ac98> 16806\n<e7ac9c> <e7ac9d> 16810\n<e7aca1> <e7aca3> 16813\n<e7acaf> <e7acb0> 16819\n<e7acb4> <e7acb7> 16822\n<e7ad80> <e7ad84> 16830\n<e7ad8d> <e7ad8e> 16837\n<e7ad9e> <e7ad9f> 16844\n<e7ada3> <e7ada6> 16847\n<e7ada8> <e7adad> 16851\n<e7adaf> <e7adb0> 16857\n<e7adb3> <e7adb4> 16859\n<e7adbc> <e7adbd> 16864\n<e7ae81> <e7ae84> 16867\n<e7ae86> <e7ae8a> 16871\n<e7ae8e> <e7ae8f> 16877\n<e7ae91> <e7ae93> 16879\n<e7ae98> <e7ae9b> 16883\n<e7ae9e> <e7aea0> 16887\n<e7aea3> <e7aea5> 16890\n<e7aea6> <e7aea7> 7301\n<e7aeae> <e7aeb0> 16893\n<e7aeb2> <e7aeb3> 16896\n<e7aeb5> <e7aeb7> 16898\n<e7aeb9> <e7aebf> 16901\n<e7af82> <e7af83> 16908\n<e7af8d> <e7af90> 16913\n<e7af94> <e7af98> 16918\n<e7af9b> <e7af9c> 16923\n<e7af9e> <e7afa0> 16925\n<e7afa2> <e7afa3> 16928\n<e7afa5> <e7afa6> 7318\n<e7afa7> <e7afa8> 16930\n<e7afab> <e7afad> 16932\n<e7afaf> <e7afb0> 16935\n<e7afb4> <e7afb6> 16938\n<e7afb8> <e7afbb> 16941\n<e7b081> <e7b086> 16947\n<e7b088> <e7b08a> 16953\n<e7b090> <e7b095> 16957\n<e7b097> <e7b09d> 16963\n<e7b0a4> <e7b0a5> 16972\n<e7b0a8> <e7b0a9> 16974\n<e7b0ac> <e7b0b7> 16976\n<e7b0b9> <e7b0bc> 16988\n<e7b184> <e7b18b> 16993\n<e7b18e> <e7b19b> 17001\n<e7b19d> <e7b19e> 17015\n<e7b1a1> <e7b1a3> 17017\n<e7b1a5> <e7b1a8> 17020\n<e7b1af> <e7b1b1> 17026\n<e7b1b5> <e7b1ba> 17029\n<e7b1be> <e7b1bf> 17035\n<e7b280> <e7b288> 17037\n<e7b28a> <e7b290> 17046\n<e7b293> <e7b294> 17053\n<e7b299> <e7b29b> 17056\n<e7b2a0> <e7b2a1> 17059\n<e7b2a6> <e7b2a9> 17062\n<e7b2ab> <e7b2ad> 17066\n<e7b2af> <e7b2b0> 17069\nendcidrange\n\n100 begincidrange\n<e7b2b4> <e7b2b8> 17071\n<e7b2ba> <e7b2bb> 17076\n<e7b2bc> <e7b2bd> 7378\n<e7b382> <e7b384> 17080\n<e7b38c> <e7b38d> 7382\n<e7b38e> <e7b394> 17086\n<e7b39a> <e7b39b> 17094\n<e7b3a1> <e7b3a6> 17096\n<e7b3a9> <e7b3ae> 17102\n<e7b3bc> <e7b3bd> 17113\n<e7b487> <e7b488> 9246\n<e7b48e> <e7b48f> 17119\n<e7b491> <e7b492> 17121\n<e7b49d> <e7b49f> 17125\n<e7b4a3> <e7b4a6> 17128\n<e7b4a8> <e7b4aa> 17132\n<e7b4ac> <e7b4ae> 17135\n<e7b4b4> <e7b4b8> 17138\n<e7b4bd> <e7b4be> 17144\n<e7b587> <e7b58d> 17149\n<e7b591> <e7b59c> 17157\n<e7b59f> <e7b5a0> 17169\n<e7b5a3> <e7b5a5> 17171\n<e7b5a9> <e7b5ad> 17175\n<e7b5af> <e7b5b0> 17180\n<e7b5b4> <e7b5b5> 17182\n<e7b5ba> <e7b5bf> 17185\n<e7b684> <e7b685> 17193\n<e7b68a> <e7b68e> 17196\n<e7b690> <e7b692> 17201\n<e7b694> <e7b69b> 17204\n<e7b69f> <e7b6a1> 17213\n<e7b6a4> <e7b6a5> 17216\n<e7b6a7> <e7b6aa> 17218\n<e7b6b5> <e7b6b7> 17223\n<e7b780> <e7b783> 17227\n<e7b785> <e7b786> 17231\n<e7b788> <e7b789> 17233\n<e7b78c> <e7b790> 17235\n<e7b795> <e7b796> 17241\n<e7b79a> <e7b79c> 17243\n<e7b7a4> <e7b7a5> 17248\n<e7b7aa> <e7b7ab> 17251\n<e7b7ad> <e7b7ae> 17253\n<e7b7b7> <e7b7b8> 17258\n<e7b7bc> <e7b7bf> 17261\n<e7b880> <e7b887> 17265\n<e7b88c> <e7b88f> 17273\n<e7b892> <e7b89a> 17277\n<e7b8a0> <e7b8a2> 17287\n<e7b8a4> <e7b8a6> 17290\n<e7b8a8> <e7b8aa> 17293\n<e7b8af> <e7b8b0> 17297\n<e7b982> <e7b984> 17305\n<e7b988> <e7b991> 17308\n<e7b996> <e7b999> 17319\n<e7b99b> <e7b99d> 17323\n<e7b99f> <e7b9a1> 17326\n<e7b9a3> <e7b9a8> 17329\n<e7b9b1> <e7b9b2> 17336\n<e7b9b4> <e7b9b8> 17338\n<e7b9ba> <e7b9bb> 17343\n<e7ba80> <e7ba81> 17346\n<e7ba83> <e7ba87> 17348\n<e7ba90> <e7ba92> 17356\n<e7ba99> <e7ba9a> 17361\n<e7ba9d> <e7ba9e> 17363\n<e7baa8> <e7baa9> 6103\n<e7babb> <e7babc> 17367\n<e7bb80> <e7bb82> 6108\n<e7bb8b> <e7bb8c> 6112\n<e7bba0> <e7bba1> 6118\n<e7bbae> <e7bbaf> 6122\n<e7bbb1> <e7bbb2> 6124\n<e7bbba> <e7bbbb> 6128\n<e7bc81> <e7bc83> 6131\n<e7bc87> <e7bc88> 6134\n<e7bc8b> <e7bc8c> 6136\n<e7bc91> <e7bc92> 6139\n<e7bca1> <e7bca7> 6146\n<e7bcaa> <e7bcad> 6153\n<e7bcaf> <e7bcb3> 6157\n<e7bcbb> <e7bcbf> 17378\n<e7bd80> <e7bd81> 17383\n<e7bd84> <e7bd85> 7264\n<e7bd86> <e7bd8b> 17386\n<e7bd92> <e7bd93> 17394\n<e7bd9b> <e7bd9e> 17398\n<e7bda3> <e7bda7> 17403\n<e7bdab> <e7bdad> 17408\n<e7bdb5> <e7bdb6> 17413\n<e7bdba> <e7bdbd> 17416\n<e7be82> <e7be84> 17422\n<e7be8f> <e7be93> 17429\n<e7be95> <e7be99> 17434\n<e7be9b> <e7be9c> 17439\n<e7bea2> <e7bea3> 17442\n<e7beaa> <e7beae> 17446\n<e7beaf> <e7beb0> 7367\n<e7beb3> <e7beb7> 17452\nendcidrange\n\n100 begincidrange\n<e7beba> <e7bebb> 17457\n<e7bf82> <e7bf84> 17461\n<e7bf86> <e7bf89> 17464\n<e7bf8f> <e7bf91> 17470\n<e7bf96> <e7bf97> 17474\n<e7bf99> <e7bf9e> 17476\n<e7bfa2> <e7bfa4> 17482\n<e7bfa7> <e7bfa8> 17485\n<e7bfaa> <e7bfad> 17487\n<e7bfb4> <e7bfb8> 17493\n<e7bfbd> <e7bfbf> 17499\n<e88087> <e8808a> 17503\n<e8808e> <e8808f> 17507\n<e8809a> <e8809b> 17511\n<e8809d> <e8809f> 17513\n<e880a3> <e880a4> 17517\n<e880a5> <e880a7> 7121\n<e880af> <e880b0> 17521\n<e880b9> <e880ba> 17525\n<e88180> <e88181> 17529\n<e88184> <e88185> 17531\n<e88187> <e88189> 17533\n<e8818e> <e88191> 17536\n<e8819b> <e8819d> 17544\n<e8819f> <e881a8> 17547\n<e881ab> <e881ae> 17557\n<e881ba> <e881bc> 17563\n<e88281> <e88282> 17566\n<e8828d> <e88292> 17570\n<e88294> <e88295> 17576\n<e882a6> <e882a8> 17582\n<e882b5> <e882b6> 17588\n<e882b8> <e882b9> 17590\n<e88387> <e8838b> 17594\n<e8838f> <e88395> 17599\n<e8839f> <e883a0> 17607\n<e883a2> <e883a3> 17609\n<e883a7> <e883aa> 6522\n<e883be> <e883bf> 17617\n<e88480> <e88481> 17619\n<e88483> <e88484> 17621\n<e88487> <e88488> 17623\n<e8848b> <e8848c> 17625\n<e8848d> <e8848e> 6538\n<e8849c> <e8849d> 17630\n<e8849f> <e884ab> 17632\n<e884ad> <e884ae> 17645\n<e884b3> <e884b5> 17648\n<e884ba> <e884bd> 17652\n<e88580> <e88585> 17657\n<e88597> <e88598> 17668\n<e88599> <e8859a> 6554\n<e8859b> <e8859f> 17670\n<e885a2> <e885a4> 17675\n<e885b2> <e885b3> 17682\n<e885b5> <e885b7> 17684\n<e885bc> <e885bd> 6559\n<e88683> <e88687> 17688\n<e8868b> <e8868e> 17694\n<e88692> <e88697> 17699\n<e8869e> <e8869f> 17706\n<e886a1> <e886a2> 17708\n<e886a4> <e886a5> 17710\n<e886ab> <e886b2> 17713\n<e886b4> <e886b9> 17721\n<e88784> <e88785> 17728\n<e88787> <e88788> 17730\n<e88790> <e88797> 17734\n<e8879b> <e8879e> 17743\n<e887a1> <e887a2> 17747\n<e887a4> <e887a6> 17749\n<e887ae> <e887b2> 17754\n<e887b3> <e887b4> 4544\n<e887b5> <e887b9> 17759\n<e88881> <e88882> 7334\n<e8888c> <e8888d> 3353\n<e8888e> <e8888f> 17768\n<e88895> <e8889a> 17772\n<e888a1> <e888a3> 7339\n<e888a4> <e888a7> 17780\n<e888b3> <e888b4> 7348\n<e888bc> <e888bd> 17788\n<e88980> <e88983> 17791\n<e88985> <e88986> 17795\n<e8898c> <e8898e> 17799\n<e88990> <e88997> 17802\n<e8899b> <e8899e> 17810\n<e889a0> <e889a3> 17814\n<e889a9> <e889aa> 17820\n<e889ac> <e889ad> 17822\n<e889b5> <e889b6> 17824\n<e889bb> <e889bc> 17827\n<e88a80> <e88a81> 17829\n<e88a85> <e88a87> 17832\n<e88a93> <e88a96> 17838\n<e88a9a> <e88a9b> 17842\n<e88aa2> <e88aa3> 17846\n<e88ab5> <e88ab6> 17850\n<e88b82> <e88b83> 17856\n<e88b85> <e88b86> 17858\nendcidrange\n\n100 begincidrange\n<e88b8b> <e88b8c> 5110\n<e88b99> <e88b9a> 17863\n<e88ba8> <e88baa> 17867\n<e88bac> <e88bae> 17870\n<e88bb2> <e88bb3> 17874\n<e88bb5> <e88bb6> 17876\n<e88bbc> <e88bbf> 17880\n<e88c8a> <e88c8b> 17885\n<e88c92> <e88c93> 17889\n<e88c94> <e88c95> 5137\n<e88c98> <e88c99> 17892\n<e88c9d> <e88ca6> 17894\n<e88ca9> <e88caa> 17904\n<e88cbd> <e88cbf> 17911\n<e88d81> <e88d82> 17914\n<e88d84> <e88d85> 17916\n<e88d8a> <e88d8e> 17919\n<e88d95> <e88d99> 17925\n<e88d9b> <e88d9c> 5143\n<e88dad> <e88dae> 5170\n<e88db0> <e88db6> 17932\n<e88db9> <e88dba> 17939\n<e88dbe> <e88dbf> 17941\n<e88e80> <e88e84> 17943\n<e88e87> <e88e88> 17948\n<e88e8b> <e88e8d> 17950\n<e88e8f> <e88e91> 17953\n<e88e94> <e88e95> 17956\n<e88e99> <e88e9a> 17959\n<e88ea3> <e88ea6> 17964\n<e88eac> <e88eaf> 17968\n<e88eb3> <e88eb4> 5174\n<e88ebe> <e88ebf> 17974\n<e88f82> <e88f84> 17976\n<e88f88> <e88f89> 17980\n<e88f8d> <e88f8e> 17983\n<e88f90> <e88f93> 17985\n<e88f99> <e88f9b> 17991\n<e88fa2> <e88fa4> 17995\n<e88fa6> <e88fa8> 17998\n<e88fab> <e88fae> 18001\n<e88fb3> <e88fb7> 18005\n<e88fb8> <e88fb9> 5210\n<e88fba> <e88fbc> 18010\n<e88fbe> <e88fbf> 18013\n<e89088> <e89089> 18018\n<e89092> <e89097> 18021\n<e89099> <e8909b> 18027\n<e8909e> <e890a3> 18030\n<e890a4> <e890a5> 4238\n<e890a9> <e890ab> 18036\n<e890ad> <e890b0> 18039\n<e890b2> <e890b4> 18043\n<e890b6> <e890b7> 18046\n<e890b9> <e890bb> 18048\n<e890be> <e890bf> 18051\n<e89180> <e89185> 18053\n<e89187> <e89188> 18059\n<e8918a> <e89190> 18061\n<e89193> <e89196> 18068\n<e8919d> <e891a0> 18073\n<e891a7> <e891a8> 18079\n<e891bb> <e891bf> 18087\n<e89280> <e89281> 18092\n<e89283> <e89286> 18094\n<e89287> <e89288> 5223\n<e8928f> <e89292> 18100\n<e89295> <e89296> 18104\n<e8929a> <e8929b> 18107\n<e8929d> <e892a0> 18109\n<e892a2> <e892ae> 18113\n<e892b0> <e892b1> 18126\n<e892b5> <e892b7> 18129\n<e89382> <e89383> 18134\n<e89385> <e89388> 18136\n<e8938e> <e8938f> 18141\n<e89394> <e89395> 18144\n<e89397> <e8939c> 18146\n<e893a1> <e893a2> 18153\n<e893a7> <e893ab> 18156\n<e893b1> <e893bb> 18162\n<e89480> <e8948b> 18174\n<e8948d> <e89490> 18186\n<e89495> <e89496> 18191\n<e89498> <e89499> 18193\n<e8949b> <e8949d> 18195\n<e894a4> <e894a5> 18200\n<e894a7> <e894aa> 18202\n<e894ae> <e894b6> 18206\n<e894be> <e894bf> 18215\n<e89584> <e89585> 18219\n<e8958b> <e8958d> 18222\n<e8958f> <e89591> 18225\n<e8959a> <e8959d> 18230\n<e8959f> <e895a1> 18234\n<e895a5> <e895a7> 18238\n<e895ab> <e895ac> 18241\n<e895ae> <e895b1> 18243\n<e895b5> <e895b6> 18248\n<e895bc> <e895bd> 18251\nendcidrange\n\n100 begincidrange\n<e89680> <e89683> 18254\n<e8968d> <e8968e> 18261\n<e89692> <e89693> 18264\n<e89695> <e8969a> 18266\n<e8969d> <e8969e> 18272\n<e896a0> <e896a3> 18274\n<e896ab> <e896ad> 18280\n<e896b1> <e896b6> 18283\n<e896bb> <e896bf> 18290\n<e89782> <e89788> 18296\n<e8978a> <e8978c> 18303\n<e89791> <e89792> 18306\n<e89796> <e8979b> 18309\n<e8979e> <e897a3> 18315\n<e897a6> <e897a8> 18321\n<e897ab> <e897b3> 18324\n<e897b7> <e897b8> 18334\n<e897bc> <e897be> 18336\n<e89880> <e89883> 18339\n<e89888> <e8988a> 18343\n<e8988c> <e89890> 18346\n<e89892> <e89895> 18351\n<e89897> <e89899> 18355\n<e8989b> <e8989d> 18358\n<e8989f> <e898a1> 18361\n<e898a3> <e898a6> 18364\n<e898aa> <e898ac> 18369\n<e898ae> <e898b7> 18372\n<e898bd> <e898be> 18384\n<e89980> <e8998c> 18386\n<e89992> <e89993> 18399\n<e89996> <e89999> 18401\n<e899a0> <e899a1> 18407\n<e899a3> <e899a6> 18409\n<e899a8> <e899aa> 18413\n<e899af> <e899b0> 18417\n<e899b2> <e899b8> 18419\n<e89a83> <e89a89> 18426\n<e89a8e> <e89a92> 18433\n<e89a96> <e89a9b> 18439\n<e89a9e> <e89aa2> 18445\n<e89aa5> <e89aa6> 18450\n<e89aad> <e89aae> 18453\n<e89ab2> <e89ab3> 18455\n<e89ab7> <e89ab9> 18457\n<e89abb> <e89abf> 18460\n<e89b81> <e89b83> 18465\n<e89b8c> <e89b8d> 18470\n<e89b92> <e89b93> 18472\n<e89b95> <e89b97> 18474\n<e89b9c> <e89b9d> 18478\n<e89ba0> <e89ba3> 18480\n<e89ba5> <e89ba8> 18484\n<e89baa> <e89bac> 18488\n<e89bb1> <e89bb2> 7182\n<e89bb5> <e89bb7> 18492\n<e89bbb> <e89bbd> 18495\n<e89c84> <e89c85> 18500\n<e89c8b> <e89c8c> 18502\n<e89c8e> <e89c91> 18504\n<e89c9f> <e89ca0> 18513\n<e89ca6> <e89ca8> 18516\n<e89caa> <e89cad> 18519\n<e89caf> <e89cb0> 18523\n<e89cb2> <e89cb3> 18525\n<e89cb5> <e89cb6> 18527\n<e89cb8> <e89cba> 18529\n<e89cbc> <e89cbd> 18532\n<e89d80> <e89d86> 18534\n<e89d8a> <e89d8b> 18541\n<e89d8f> <e89d92> 18544\n<e89d9a> <e89d9f> 18551\n<e89da1> <e89da2> 18557\n<e89da7> <e89dad> 18559\n<e89db1> <e89db3> 18567\n<e89db9> <e89dba> 18572\n<e89dbd> <e89dbe> 7215\n<e89e80> <e89e81> 18575\n<e89e86> <e89e87> 18577\n<e89e89> <e89e8a> 18579\n<e89e8e> <e89e92> 18582\n<e89e94> <e89e96> 18587\n<e89e98> <e89e9d> 18590\n<e89ea0> <e89ea1> 18596\n<e89ea3> <e89ea7> 18598\n<e89ea9> <e89eaa> 18603\n<e89eb0> <e89eb2> 18606\n<e89eb6> <e89eb9> 18610\n<e89ebe> <e89ebf> 18615\n<e89f81> <e89f83> 18617\n<e89f8c> <e89f8d> 18623\n<e89f8f> <e89f90> 18625\n<e89f94> <e89f9a> 18627\n<e89f9c> <e89f9f> 18634\n<e89fa1> <e89fa2> 18638\n<e89fa6> <e89fa9> 18641\n<e89fb0> <e89fb1> 18647\n<e89fb3> <e89fb5> 18649\n<e89fb7> <e89fb8> 18652\n<e89fbc> <e89fbd> 18655\nendcidrange\n\n100 begincidrange\n<e8a080> <e8a082> 18658\n<e8a087> <e8a089> 18662\n<e8a08b> <e8a08f> 18665\n<e8a097> <e8a09a> 18672\n<e8a09c> <e8a09e> 18676\n<e8a0a4> <e8a0b0> 18680\n<e8a0b3> <e8a0b5> 18693\n<e8a0b7> <e8a0b8> 18696\n<e8a0bd> <e8a0bf> 18699\n<e8a181> <e8a183> 18702\n<e8a187> <e8a189> 18705\n<e8a18e> <e8a192> 18709\n<e8a195> <e8a196> 18714\n<e8a19e> <e8a1a0> 18719\n<e8a1a6> <e8a1a7> 18722\n<e8a1b3> <e8a1b6> 18728\n<e8a1ba> <e8a1bc> 18733\n<e8a286> <e8a287> 18738\n<e8a289> <e8a28a> 18740\n<e8a28e> <e8a291> 18743\n<e8a293> <e8a295> 18747\n<e8a297> <e8a29b> 18750\n<e8a29d> <e8a2a1> 18755\n<e8a2a5> <e8a2aa> 18761\n<e8a2ae> <e8a2b0> 18768\n<e8a2b2> <e8a2b6> 18771\n<e8a2b8> <e8a2bb> 18776\n<e8a2bd> <e8a2bf> 18780\n<e8a383> <e8a384> 18784\n<e8a387> <e8a388> 18786\n<e8a38b> <e8a38d> 18788\n<e8a390> <e8a391> 18791\n<e8a396> <e8a397> 18794\n<e8a39a> <e8a39b> 18796\n<e8a3a0> <e8a3a1> 18799\n<e8a3a6> <e8a3a7> 18801\n<e8a3a9> <e8a3af> 18803\n<e8a3b5> <e8a3b7> 18811\n<e8a3ba> <e8a3bb> 18814\n<e8a480> <e8a481> 18817\n<e8a483> <e8a486> 18819\n<e8a488> <e8a489> 18823\n<e8a48b> <e8a48f> 18825\n<e8a494> <e8a498> 18831\n<e8a49c> <e8a4a0> 18836\n<e8a4a2> <e8a4a4> 18841\n<e8a4a6> <e8a4a9> 18844\n<e8a4ac> <e8a4af> 18848\n<e8a4b9> <e8a4ba> 18855\n<e8a4bc> <e8a4bf> 18857\n<e8a582> <e8a583> 18862\n<e8a585> <e8a586> 18864\n<e8a588> <e8a595> 18866\n<e8a597> <e8a59c> 18880\n<e8a5a1> <e8a5a3> 18886\n<e8a5a7> <e8a5a9> 18890\n<e8a5ad> <e8a5ae> 18894\n<e8a5b0> <e8a5b1> 18896\n<e8a5b3> <e8a5ba> 18898\n<e8a5bc> <e8a5be> 18906\n<e8a684> <e8a685> 18911\n<e8a687> <e8a68a> 18913\n<e8a68c> <e8a68e> 18917\n<e8a690> <e8a692> 18920\n<e8a694> <e8a695> 18923\n<e8a699> <e8a6a0> 18926\n<e8a6a2> <e8a6a5> 18934\n<e8a6a7> <e8a6a9> 18938\n<e8a6ad> <e8a6ae> 18942\n<e8a6b0> <e8a6b1> 18944\n<e8a6b3> <e8a6b6> 18946\n<e8a6b8> <e8a6b9> 18950\n<e8a6bb> <e8a6bc> 18952\n<e8a78a> <e8a78c> 6459\n<e8a78e> <e8a791> 6462\n<e8a793> <e8a795> 18957\n<e8a797> <e8a799> 18960\n<e8a79f> <e8a7a2> 18965\n<e8a7a7> <e8a7aa> 18970\n<e8a7ac> <e8a7ae> 18974\n<e8a7b0> <e8a7b2> 18977\n<e8a7b9> <e8a7bf> 18982\n<e8a884> <e8a886> 18989\n<e8a891> <e8a892> 18996\n<e8a899> <e8a89a> 19000\n<e8a8a0> <e8a8a2> 19004\n<e8a8a6> <e8a8a9> 19008\n<e8a8ab> <e8a8ac> 19012\n<e8a8ae> <e8a8b0> 19014\n<e8a8b2> <e8a8b3> 19017\n<e8a8b7> <e8a8b9> 19020\n<e8a8bb> <e8a8bd> 19023\n<e8a982> <e8a985> 19028\n<e8a989> <e8a98d> 19033\n<e8a996> <e8a997> 19041\n<e8a999> <e8a99a> 19043\n<e8a99c> <e8a99d> 19045\n<e8a99f> <e8a9a0> 19047\n<e8a9a4> <e8a9a5> 19049\n<e8a9a7> <e8a9a8> 19051\nendcidrange\n\n100 begincidrange\n<e8a9b6> <e8a9b8> 19056\n<e8a9ba> <e8a9bb> 19059\n<e8a9bd> <e8a9be> 19061\n<e8aa80> <e8aa83> 19063\n<e8aa8b> <e8aa8c> 19068\n<e8aa8e> <e8aa90> 19070\n<e8aa91> <e8aa92> 8953\n<e8aa96> <e8aa97> 19074\n<e8aa9b> <e8aa9d> 19077\n<e8aaa9> <e8aaab> 19083\n<e8aaad> <e8aaaf> 19086\n<e8aab3> <e8aab5> 19090\n<e8aab7> <e8aab8> 19093\n<e8aaba> <e8aabb> 19095\n<e8aabd> <e8aabe> 19097\n<e8ab80> <e8ab81> 19099\n<e8ab85> <e8ab86> 19102\n<e8ab93> <e8ab95> 19109\n<e8ab98> <e8ab9a> 19112\n<e8ab9f> <e8aba1> 19116\n<e8aba8> <e8abaa> 19121\n<e8abaf> <e8abb0> 19125\n<e8abb4> <e8abb5> 19128\n<e8ac88> <e8ac89> 19136\n<e8ac8b> <e8ac8d> 19138\n<e8ac91> <e8ac93> 19142\n<e8ac9e> <e8aca0> 19148\n<e8aca2> <e8aca5> 19151\n<e8aca9> <e8acaa> 19156\n<e8acae> <e8acb2> 19158\n<e8acb4> <e8acb8> 19163\n<e8acba> <e8acbd> 19168\n<e8ad80> <e8ad88> 19173\n<e8ad8a> <e8ad8d> 19182\n<e8ad90> <e8ad95> 19186\n<e8ad9d> <e8ada5> 19194\n<e8ada7> <e8adaa> 19203\n<e8adad> <e8adae> 19207\n<e8adb1> <e8adb3> 19209\n<e8adb5> <e8adb6> 19212\n<e8adb8> <e8adbc> 19214\n<e8adbe> <e8adbf> 19219\n<e8ae81> <e8ae89> 19221\n<e8ae8b> <e8ae8d> 19230\n<e8ae8f> <e8ae91> 19233\n<e8ae97> <e8ae9b> 19237\n<e8aea6> <e8aea7> 4888\n<e8aeb4> <e8aeb5> 4891\n<e8af82> <e8af83> 4894\n<e8af92> <e8af94> 4899\n<e8af98> <e8af99> 4903\n<e8af9f> <e8afa0> 4906\n<e8afa8> <e8afa9> 4909\n<e8b091> <e8b092> 4924\n<e8b094> <e8b096> 4926\n<e8b09f> <e8b0a1> 4933\n<e8b0aa> <e8b0ab> 4938\n<e8b0ae> <e8b0af> 4940\n<e8b0b2> <e8b0b3> 4942\n<e8b0b5> <e8b0b6> 4944\n<e8b0b8> <e8b0bf> 19252\n<e8b182> <e8b185> 19261\n<e8b18a> <e8b18b> 19265\n<e8b18d> <e8b18f> 19267\n<e8b191> <e8b194> 19270\n<e8b196> <e8b199> 19274\n<e8b19b> <e8b1a0> 19278\n<e8b1a3> <e8b1a9> 19284\n<e8b1ac> <e8b1b2> 19291\n<e8b1b4> <e8b1b7> 19298\n<e8b1bb> <e8b1bf> 19302\n<e8b280> <e8b281> 19307\n<e8b283> <e8b284> 19309\n<e8b286> <e8b288> 19311\n<e8b28d> <e8b293> 19315\n<e8b295> <e8b297> 19322\n<e8b299> <e8b29c> 19325\n<e8b2a3> <e8b2a6> 19330\n<e8b2ad> <e8b2ae> 19334\n<e8b38b> <e8b390> 19342\n<e8b396> <e8b399> 19349\n<e8b3a8> <e8b3a9> 19357\n<e8b3ae> <e8b3b3> 19359\n<e8b3b5> <e8b3b9> 19365\n<e8b480> <e8b483> 19371\n<e8b486> <e8b487> 19375\n<e8b491> <e8b495> 19380\n<e8b497> <e8b49a> 19385\n<e8b4b2> <e8b4b3> 6444\n<e8b585> <e8b586> 6450\n<e8b588> <e8b589> 6452\n<e8b591> <e8b592> 19390\n<e8b5a8> <e8b5aa> 19395\n<e8b5ae> <e8b5af> 19399\n<e8b5b1> <e8b5b2> 19401\n<e8b5b8> <e8b5bf> 19403\n<e8b682> <e8b683> 19412\n<e8b686> <e8b689> 19414\n<e8b68c> <e8b690> 19418\n<e8b692> <e8b693> 19423\nendcidrange\n\n100 begincidrange\n<e8b696> <e8b698> 19425\n<e8b69a> <e8b69e> 19428\n<e8b6a0> <e8b6a2> 19433\n<e8b6a4> <e8b6a7> 19436\n<e8b6a9> <e8b6b0> 19440\n<e8b6b6> <e8b6b7> 19448\n<e8b780> <e8b782> 19453\n<e8b787> <e8b78a> 19457\n<e8b78e> <e8b78f> 7461\n<e8b792> <e8b795> 19463\n<e8b796> <e8b797> 7457\n<e8b798> <e8b799> 19467\n<e8b7a0> <e8b7a2> 19470\n<e8b7a5> <e8b7a7> 19473\n<e8b7ad> <e8b7ae> 19477\n<e8b7b0> <e8b7b2> 19479\n<e8b7b7> <e8b7b8> 7466\n<e8b7be> <e8b7bf> 19485\n<e8b880> <e8b884> 19487\n<e8b886> <e8b888> 19492\n<e8b88d> <e8b88e> 19496\n<e8b891> <e8b893> 19498\n<e8b895> <e8b89c> 19501\n<e8b8a0> <e8b8a1> 19509\n<e8b8a4> <e8b8a8> 19511\n<e8b8b2> <e8b8b3> 19519\n<e8b8b6> <e8b8b8> 19521\n<e8b8bb> <e8b8bc> 19524\n<e8b8be> <e8b8bf> 19526\n<e8b981> <e8b982> 7488\n<e8b985> <e8b986> 19529\n<e8b98d> <e8b990> 19531\n<e8b991> <e8b992> 7490\n<e8b993> <e8b994> 19535\n<e8b996> <e8b998> 19537\n<e8b99a> <e8b9a2> 19540\n<e8b9a4> <e8b9a5> 19549\n<e8b9a7> <e8b9a8> 19551\n<e8b9aa> <e8b9ab> 19553\n<e8b9b7> <e8b9b9> 19559\n<e8b9bd> <e8b9be> 19563\n<e8ba82> <e8ba84> 19566\n<e8ba95> <e8ba99> 19573\n<e8ba9f> <e8baa0> 19580\n<e8baa2> <e8baa4> 19582\n<e8baa7> <e8baa9> 19585\n<e8baad> <e8baae> 19588\n<e8bab0> <e8bab1> 19590\n<e8bab3> <e8bab9> 19592\n<e8babb> <e8babf> 19599\n<e8bb81> <e8bb89> 19604\n<e8bb8f> <e8bb91> 19613\n<e8bb95> <e8bb9a> 19617\n<e8bb9c> <e8bb9e> 19623\n<e8bba0> <e8bba3> 19626\n<e8bba5> <e8bbaa> 19630\n<e8bbac> <e8bbb1> 19636\n<e8bbb3> <e8bbb7> 19642\n<e8bc80> <e8bc82> 19649\n<e8bc8b> <e8bc91> 19655\n<e8bc96> <e8bc9a> 19663\n<e8bc9e> <e8bc9f> 9373\n<e8bca0> <e8bca4> 19668\n<e8bca7> <e8bca8> 19673\n<e8bcab> <e8bcae> 19675\n<e8bcb0> <e8bcb2> 19679\n<e8bcb4> <e8bcb7> 19682\n<e8bcb9> <e8bcba> 19686\n<e8bcbc> <e8bcbd> 19688\n<e8bd80> <e8bd81> 19690\n<e8bd87> <e8bd88> 19693\n<e8bd8a> <e8bd8c> 19695\n<e8bd8f> <e8bd93> 19698\n<e8bd95> <e8bd9e> 19703\n<e8bdb1> <e8bdb3> 6371\n<e8bdb5> <e8bdb6> 6374\n<e8bdb9> <e8bdba> 6378\n<e8be81> <e8be82> 6382\n<e8be8d> <e8be8f> 6387\n<e8bea0> <e8bea2> 19721\n<e8bea4> <e8bea5> 19724\n<e8bea8> <e8bea9> 1103\n<e8beb3> <e8beb5> 19729\n<e8beb7> <e8beb8> 19732\n<e8beba> <e8bebc> 19734\n<e8bf89> <e8bf8d> 19741\n<e8bf96> <e8bf97> 19748\n<e8bfa0> <e8bfa1> 19751\n<e8bfb1> <e8bfb2> 19757\n<e8bfb5> <e8bfb6> 19759\n<e8bfba> <e8bfbc> 19761\n<e8bfbe> <e8bfbf> 19764\n<e98087> <e98088> 19766\n<e980a4> <e980a5> 19773\n<e980a7> <e980ac> 19775\n<e980b0> <e980b1> 19781\n<e980b3> <e980b4> 19783\n<e980b5> <e980b6> 5967\n<e980b9> <e980ba> 19786\n<e98185> <e98186> 19792\nendcidrange\n\n100 begincidrange\n<e98188> <e9818a> 19794\n<e98191> <e98192> 5972\n<e98199> <e9819a> 19799\n<e981a6> <e981a7> 19805\n<e981aa> <e981ac> 19807\n<e981af> <e981b1> 19810\n<e98285> <e98286> 19818\n<e9828c> <e9828e> 19821\n<e9829e> <e982a0> 19830\n<e982a4> <e982a5> 19833\n<e982a7> <e982a9> 19835\n<e982bc> <e982bd> 19842\n<e98382> <e98383> 19846\n<e98388> <e98389> 19849\n<e9838b> <e9838d> 19851\n<e98394> <e98396> 19855\n<e98398> <e9839a> 19858\n<e983a3> <e983a5> 19863\n<e983a9> <e983aa> 19866\n<e983b0> <e983b3> 19870\n<e983b6> <e983b7> 19874\n<e983b9> <e983bc> 19876\n<e98480> <e98481> 19881\n<e98487> <e98488> 19885\n<e9848a> <e98491> 19887\n<e98497> <e98498> 19897\n<e9849a> <e9849d> 19899\n<e9849f> <e984a1> 19903\n<e984a4> <e984a6> 19906\n<e984a8> <e984ac> 19909\n<e984b7> <e984b8> 19917\n<e984bb> <e984bf> 19919\n<e98580> <e98582> 19924\n<e98584> <e98585> 19927\n<e9858e> <e9858f> 7418\n<e98593> <e98596> 19931\n<e98598> <e98599> 19935\n<e9859b> <e9859c> 19937\n<e9859f> <e985a0> 19939\n<e985a6> <e985a8> 19941\n<e985ba> <e985bc> 19947\n<e985bd> <e985be> 7426\n<e98680> <e98684> 19950\n<e9868e> <e9868f> 19958\n<e98693> <e98695> 19960\n<e98697> <e98699> 19963\n<e9869d> <e986a1> 19966\n<e986a2> <e986a3> 7436\n<e986a4> <e986a9> 19971\n<e986ad> <e986af> 7439\n<e986b0> <e986b3> 19977\n<e986b6> <e986b9> 19981\n<e986bb> <e986bf> 19985\n<e98792> <e98794> 9459\n<e9879a> <e9879b> 19996\n<e9879e> <e987a2> 19998\n<e987a5> <e987a6> 20003\n<e987aa> <e987b4> 20006\n<e987bb> <e987bf> 20019\n<e98882> <e98883> 20024\n<e98885> <e98887> 20026\n<e9888a> <e9888c> 20029\n<e98892> <e98893> 20033\n<e98896> <e9889d> 20035\n<e9889f> <e988a2> 20043\n<e988a8> <e988ad> 20048\n<e988b1> <e988b2> 20055\n<e988b5> <e988b6> 20057\n<e988bb> <e988bc> 20059\n<e98981> <e98984> 20061\n<e98986> <e98987> 20065\n<e9898a> <e9898c> 20067\n<e9898e> <e98990> 20070\n<e98992> <e98994> 20073\n<e98998> <e98999> 20077\n<e9899c> <e9899d> 20079\n<e9899f> <e989a1> 20081\n<e989a3> <e989a5> 20084\n<e989a7> <e989ab> 20087\n<e989ac> <e989ad> 9489\n<e989ae> <e989b3> 20092\n<e989b5> <e989b7> 20098\n<e989bc> <e989be> 20102\n<e98a81> <e98a82> 20105\n<e98a86> <e98a8d> 20108\n<e98a8f> <e98a90> 20116\n<e98a94> <e98a95> 20119\n<e98a9d> <e98a9f> 20124\n<e98aa1> <e98aa2> 20127\n<e98aaf> <e98ab0> 20132\n<e98ab2> <e98ab6> 20134\n<e98abd> <e98abf> 20141\n<e98b89> <e98b8b> 20148\n<e98b8d> <e98b8e> 20151\n<e98b90> <e98b91> 20153\n<e98b93> <e98b9c> 20155\n<e98ba0> <e98ba2> 20166\n<e98bab> <e98bac> 20171\n<e98bb2> <e98bb5> 20173\n<e98bb9> <e98bbb> 20178\nendcidrange\n\n100 begincidrange\n<e98bbd> <e98bbf> 20181\n<e98c82> <e98c85> 20185\n<e98c87> <e98c88> 9551\n<e98c89> <e98c8f> 20189\n<e98c93> <e98c94> 20197\n<e98c96> <e98c97> 20199\n<e98c9c> <e98c9e> 20201\n<e98ca3> <e98ca5> 20205\n<e98ca9> <e98caa> 20209\n<e98cac> <e98cad> 20211\n<e98cb0> <e98cb1> 20213\n<e98cb4> <e98cb5> 20215\n<e98cb9> <e98cbd> 20218\n<e98d84> <e98d85> 20225\n<e98d88> <e98d8a> 20227\n<e98d8e> <e98d93> 20231\n<e98d95> <e98d97> 20237\n<e98d99> <e98d9a> 20240\n<e98d9c> <e98da3> 20242\n<e98da6> <e98da8> 20250\n<e98dad> <e98daf> 20254\n<e98db1> <e98db4> 20257\n<e98db7> <e98db9> 20261\n<e98dbb> <e98dbd> 20264\n<e98e80> <e98e81> 20268\n<e98e85> <e98e86> 20271\n<e98e88> <e98e89> 20273\n<e98e8b> <e98e8e> 20275\n<e98e90> <e98e95> 20279\n<e98e99> <e98ea1> 20286\n<e98ea4> <e98ea5> 20295\n<e98eb1> <e98eb2> 20301\n<e98eb6> <e98eb7> 20304\n<e98eb9> <e98ebe> 20306\n<e98f80> <e98f82> 20312\n<e98f84> <e98f86> 20315\n<e98f8e> <e98f90> 20320\n<e98f92> <e98f95> 20323\n<e98f99> <e98f9b> 20327\n<e98f9c> <e98f9d> 9576\n<e98fa5> <e98fa7> 20332\n<e98fa9> <e98fb4> 20335\n<e98fba> <e98fbf> 20349\n<e99080> <e99082> 20355\n<e99084> <e9908a> 20358\n<e9908c> <e9908f> 20365\n<e99095> <e99097> 20370\n<e9909a> <e9909c> 20373\n<e9909e> <e9909f> 20376\n<e990a1> <e990a5> 20378\n<e990a6> <e990a7> 9537\n<e990a9> <e990ad> 20383\n<e990af> <e990b1> 20388\n<e990b6> <e990b7> 20392\n<e990bb> <e990bd> 20395\n<e99180> <e99183> 20398\n<e99185> <e99189> 20402\n<e9918d> <e99191> 20408\n<e99195> <e9919f> 20414\n<e991a1> <e991a2> 20425\n<e991a6> <e991aa> 20428\n<e991ae> <e991af> 20434\n<e991b3> <e991b6> 20437\n<e991ba> <e991bb> 20442\n<e99280> <e99284> 20444\n<e99285> <e99287> 6798\n<e9928c> <e9928d> 6803\n<e9928f> <e99290> 6805\n<e9929a> <e9929c> 6810\n<e992a3> <e992a4> 6813\n<e992af> <e992b0> 6819\n<e992b6> <e992ba> 6823\n<e992bc> <e992bd> 6828\n<e99388> <e9938e> 6832\n<e99390> <e99392> 6839\n<e99393> <e99394> 20454\n<e99395> <e99397> 6842\n<e9939e> <e993a0> 6848\n<e993a4> <e993a5> 6852\n<e993a7> <e993a8> 6854\n<e993ae> <e993af> 6859\n<e993b3> <e993b5> 6861\n<e993bc> <e993bd> 6866\n<e99486> <e99487> 6871\n<e99489> <e9948a> 6873\n<e9948d> <e9948f> 6875\n<e99492> <e99496> 6878\n<e9949d> <e9949f> 6885\n<e994aa> <e994ab> 6889\n<e994b1> <e994b2> 6893\n<e994b6> <e994b8> 6896\n<e994be> <e994bf> 6900\n<e99584> <e99586> 6904\n<e9958e> <e9958f> 6909\n<e99592> <e99594> 6911\n<e99596> <e99599> 6914\n<e9959e> <e9959f> 6919\n<e995a1> <e995a2> 6922\n<e995a4> <e995ac> 6924\n<e995b1> <e995b3> 6934\nendcidrange\n\n100 begincidrange\n<e995b4> <e995b5> 20471\n<e995b8> <e995be> 20473\n<e99684> <e99685> 20481\n<e99687> <e99688> 20483\n<e99695> <e99697> 20489\n<e99699> <e996a0> 20492\n<e996a6> <e996a7> 20501\n<e996ae> <e996b1> 20504\n<e996b3> <e996b5> 20508\n<e996b7> <e996b8> 20511\n<e99780> <e99782> 20514\n<e99784> <e99785> 20517\n<e9978d> <e9978f> 20521\n<e99791> <e99793> 20524\n<e99797> <e9979b> 20527\n<e9979f> <e997a0> 20533\n<e997a3> <e997a4> 20535\n<e997a6> <e997a7> 20537\n<e997b5> <e997b6> 5769\n<e99883> <e99884> 5773\n<e9988a> <e9988d> 5777\n<e99895> <e99897> 5783\n<e99899> <e9989a> 5786\n<e998a3> <e998a9> 20547\n<e998ab> <e998ad> 20554\n<e998af> <e998b0> 20557\n<e998b7> <e998ba> 20559\n<e9998e> <e9998f> 20567\n<e99991> <e99993> 20569\n<e99996> <e99997> 20572\n<e99999> <e9999a> 20574\n<e999a5> <e999a6> 20579\n<e999ad> <e999af> 20582\n<e999b9> <e999bc> 20586\n<e999be> <e999bf> 20590\n<e99a80> <e99a84> 20592\n<e99a91> <e99a93> 20600\n<e99a9d> <e99aa6> 20605\n<e99aab> <e99aaf> 20616\n<e99abc> <e99abd> 7546\n<e99b82> <e99b83> 20626\n<e99b8a> <e99b8b> 20629\n<e99b90> <e99b91> 20631\n<e99b93> <e99b94> 20633\n<e99b97> <e99b98> 20635\n<e99b9d> <e99b9f> 20638\n<e99ba4> <e99ba7> 20642\n<e99bab> <e99bae> 20646\n<e99bb0> <e99bb1> 20650\n<e99bb4> <e99bb5> 20652\n<e99bbc> <e99bbd> 20656\n<e99c82> <e99c83> 20659\n<e99c8a> <e99c8c> 20662\n<e99c90> <e99c92> 20665\n<e99c94> <e99c95> 20668\n<e99c97> <e99c9b> 20670\n<e99c9f> <e99ca6> 20676\n<e99ca8> <e99ca9> 20684\n<e99cab> <e99cac> 20686\n<e99cae> <e99caf> 20688\n<e99cb3> <e99cb7> 20691\n<e99cba> <e99cbc> 20696\n<e99d80> <e99d81> 20700\n<e99d85> <e99d87> 20703\n<e99d89> <e99d91> 20706\n<e99d94> <e99d95> 20715\n<e99d97> <e99d98> 20717\n<e99d9c> <e99d9d> 20719\n<e99da3> <e99da4> 20722\n<e99da6> <e99da7> 20724\n<e99daa> <e99db2> 20726\n<e99db7> <e99dbb> 20736\n<e99dbd> <e99dbf> 20741\n<e99e80> <e99e84> 20744\n<e99e86> <e99e8a> 20749\n<e99e91> <e99e92> 7626\n<e99e95> <e99e97> 20758\n<e99e99> <e99e9f> 20761\n<e99ea1> <e99ea2> 20768\n<e99ea4> <e99ea5> 20770\n<e99ea7> <e99eaa> 20772\n<e99eb0> <e99eb1> 20778\n<e99eb5> <e99ebc> 20781\n<e99ebe> <e99ebf> 20789\n<e99f80> <e99f82> 20791\n<e99f84> <e99f85> 20794\n<e99f87> <e99f88> 20796\n<e99f8d> <e99f92> 20799\n<e99f94> <e99f98> 20805\n<e99f9a> <e99f9b> 20810\n<e99f9f> <e99fa5> 20813\n<e99faa> <e99fac> 6222\n<e99fae> <e99fb2> 20821\n<e99fb7> <e99fbe> 20827\n<e9a08e> <e9a08f> 9670\n<e9a094> <e9a096> 20840\n<e9a099> <e9a09b> 20843\n<e9a09d> <e9a0a0> 20846\n<e9a0a2> <e9a0a3> 20850\n<e9a0a7> <e9a0ac> 20853\nendcidrange\n\n100 begincidrange\n<e9a0ae> <e9a0af> 20859\n<e9a0b1> <e9a0b6> 20861\n<e9a0b9> <e9a0ba> 20867\n<e9a0be> <e9a0bf> 20870\n<e9a180> <e9a185> 20872\n<e9a187> <e9a18b> 20878\n<e9a18f> <e9a192> 20883\n<e9a195> <e9a197> 20887\n<e9a19c> <e9a19d> 20891\n<e9a19f> <e9a1a1> 20893\n<e9a1a3> <e9a1a4> 20896\n<e9a1a8> <e9a1aa> 20899\n<e9a1ad> <e9a1ae> 20902\n<e9a28c> <e9a28d> 7140\n<e9a29a> <e9a29b> 7144\n<e9a29e> <e9a29f> 7146\n<e9a2a1> <e9a2a2> 7148\n<e9a2a5> <e9a2a6> 7150\n<e9a2a9> <e9a2ad> 20911\n<e9a2ae> <e9a2af> 9420\n<e9a2b4> <e9a2b5> 20918\n<e9a2b7> <e9a2bb> 20920\n<e9a2bd> <e9a2bf> 20925\n<e9a380> <e9a383> 20928\n<e9a389> <e9a38d> 20934\n<e9a38f> <e9a390> 20939\n<e9a391> <e9a393> 6583\n<e9a396> <e9a397> 20942\n<e9a399> <e9a39a> 6587\n<e9a39c> <e9a39d> 20944\n<e9a3a3> <e9a3a6> 20947\n<e9a3aa> <e9a3ab> 9119\n<e9a3b0> <e9a3b1> 20953\n<e9a3b5> <e9a3bb> 20956\n<e9a480> <e9a482> 20964\n<e9a486> <e9a488> 20968\n<e9a48e> <e9a48f> 20972\n<e9a494> <e9a497> 20974\n<e9a499> <e9a49a> 20978\n<e9a49c> <e9a49d> 20980\n<e9a49f> <e9a4a0> 20982\n<e9a4a2> <e9a4a7> 20984\n<e9a4a9> <e9a4ad> 20990\n<e9a4af> <e9a4b2> 20995\n<e9a4b4> <e9a4b6> 20999\n<e9a4b8> <e9a4bb> 21002\n<e9a580> <e9a582> 21007\n<e9a586> <e9a587> 21011\n<e9a588> <e9a58a> 9129\n<e9a58d> <e9a590> 21013\n<e9a598> <e9a59b> 21019\n<e9a59f> <e9a5a1> 21024\n<e9a5a7> <e9a5ac> 5662\n<e9a5b8> <e9a5b9> 21030\n<e9a682> <e9a683> 21034\n<e9a690> <e9a691> 5676\n<e9a693> <e9a695> 5678\n<e9a69a> <e9a6a4> 21039\n<e9a6a6> <e9a6a7> 21050\n<e9a6a9> <e9a6ab> 21052\n<e9a6af> <e9a6b0> 21055\n<e9a6b5> <e9a6bf> 21058\n<e9a782> <e9a78f> 21070\n<e9a796> <e9a797> 21085\n<e9a7a3> <e9a7ac> 21091\n<e9a7ae> <e9a7b0> 21101\n<e9a7b2> <e9a7be> 21104\n<e9a882> <e9a884> 21118\n<e9a886> <e9a88c> 21121\n<e9a890> <e9a895> 21128\n<e9a897> <e9a898> 21134\n<e9a89a> <e9a8aa> 21136\n<e9a8b1> <e9a8b5> 21155\n<e9a8b9> <e9a8bd> 21160\n<e9a983> <e9a984> 9238\n<e9a986> <e9a989> 21166\n<e9a98b> <e9a98c> 21170\n<e9a990> <e9a994> 21173\n<e9a998> <e9a999> 21179\n<e9a99c> <e9a99e> 21181\n<e9a9a0> <e9a9a1> 21184\n<e9a9a6> <e9a9a9> 21187\n<e9a9b7> <e9a9b8> 6075\n<e9aa80> <e9aa81> 6080\n<e9aa8d> <e9aa8e> 21195\n<e9aa92> <e9aa93> 6086\n<e9aa94> <e9aa95> 21197\n<e9aa9b> <e9aa9d> 6090\n<e9aa9f> <e9aaa0> 6093\n<e9aaa2> <e9aaa3> 6095\n<e9aaa9> <e9aaae> 21201\n<e9aab2> <e9aab5> 21207\n<e9aabd> <e9aabf> 21213\n<e9ab83> <e9ab84> 21216\n<e9ab86> <e9ab8a> 21218\n<e9ab8b> <e9ab8c> 7645\n<e9ab8d> <e9ab8e> 21223\n<e9ab99> <e9ab9e> 21227\n<e9aba2> <e9aba5> 21234\n<e9aba7> <e9abaa> 21238\nendcidrange\n\n100 begincidrange\n<e9abb0> <e9abb8> 21243\n<e9abbc> <e9abbf> 21253\n<e9ac80> <e9ac82> 21257\n<e9ac84> <e9ac85> 21260\n<e9ac89> <e9ac8c> 21263\n<e9ac90> <e9ac92> 21268\n<e9ac94> <e9ac99> 21271\n<e9ac9b> <e9ac9e> 21277\n<e9aca0> <e9aca1> 21281\n<e9acaa> <e9acad> 21286\n<e9acb3> <e9acba> 21291\n<e9acbd> <e9acbf> 21299\n<e9ad8a> <e9ad8c> 21304\n<e9ad92> <e9ad93> 21308\n<e9ad95> <e9ad97> 21310\n<e9ad9b> <e9adae> 21314\n<e9adb0> <e9adb3> 21334\n<e9adb5> <e9adb6> 21338\n<e9adb8> <e9adbf> 21340\n<e9ae84> <e9ae8d> 21350\n<e9ae93> <e9ae99> 21361\n<e9ae9b> <e9ae9c> 21368\n<e9ae9f> <e9aea9> 21370\n<e9aeaf> <e9aebf> 21382\n<e9af82> <e9af86> 21399\n<e9af8b> <e9af93> 21405\n<e9af97> <e9af9a> 21415\n<e9af9e> <e9afa0> 21420\n<e9afa5> <e9afa6> 21424\n<e9afaa> <e9afab> 9787\n<e9afac> <e9afaf> 21427\n<e9afb1> <e9afb3> 21431\n<e9afb5> <e9afbc> 21434\n<e9b080> <e9b087> 21443\n<e9b08a> <e9b08c> 21451\n<e9b08e> <e9b08f> 21454\n<e9b094> <e9b09f> 21457\n<e9b0a1> <e9b0a2> 21469\n<e9b0a6> <e9b0a7> 21472\n<e9b0aa> <e9b0ac> 21474\n<e9b0ae> <e9b0b0> 21477\n<e9b0bc> <e9b0bd> 21484\n<e9b180> <e9b184> 21487\n<e9b186> <e9b187> 21492\n<e9b18a> <e9b191> 21494\n<e9b199> <e9b19c> 21504\n<e9b1a0> <e9b1a6> 21509\n<e9b1a8> <e9b1ac> 21516\n<e9b1ae> <e9b1b7> 21521\n<e9b1bd> <e9b1be> 21533\n<e9b283> <e9b284> 21536\n<e9b285> <e9b288> 7563\n<e9b289> <e9b28a> 21538\n<e9b290> <e9b292> 7570\n<e9b294> <e9b295> 7573\n<e9b296> <e9b299> 21543\n<e9b29a> <e9b29b> 7575\n<e9b29e> <e9b2a3> 7577\n<e9b2a5> <e9b2a9> 7583\n<e9b2ad> <e9b2ae> 7589\n<e9b2b0> <e9b2b7> 7591\n<e9b2ba> <e9b2bd> 7599\n<e9b2be> <e9b2bf> 21552\n<e9b380> <e9b382> 21554\n<e9b384> <e9b387> 7603\n<e9b388> <e9b389> 21557\n<e9b38a> <e9b390> 7607\n<e9b391> <e9b392> 21559\n<e9b393> <e9b395> 7614\n<e9b397> <e9b399> 7617\n<e9b39a> <e9b39b> 21561\n<e9b39c> <e9b39d> 7620\n<e9b3a0> <e9b3a1> 21563\n<e9b3a3> <e9b3a4> 21565\n<e9b3a6> <e9b3a8> 21567\n<e9b3aa> <e9b3ab> 21570\n<e9b3ad> <e9b3b2> 21572\n<e9b3b7> <e9b3bf> 21579\n<e9b480> <e9b485> 21588\n<e9b48a> <e9b494> 21595\n<e9b496> <e9b49a> 21606\n<e9b4a0> <e9b4a2> 21613\n<e9b4a4> <e9b4a5> 21616\n<e9b4a9> <e9b4ae> 21619\n<e9b4b1> <e9b4ba> 21625\n<e9b4bc> <e9b4be> 21635\n<e9b580> <e9b581> 21638\n<e9b583> <e9b590> 21640\n<e9b594> <e9b59b> 21654\n<e9b59e> <e9b59f> 21662\n<e9b5a2> <e9b5a9> 21664\n<e9b5ad> <e9b5ae> 21673\n<e9b5b0> <e9b5b1> 21675\n<e9b5b3> <e9b5bf> 21677\n<e9b680> <e9b686> 21690\n<e9b68a> <e9b692> 21698\n<e9b694> <e9b697> 21707\n<e9b69b> <e9b6a4> 21712\n<e9b6a6> <e9b6a8> 21722\n<e9b6aa> <e9b6ae> 21725\nendcidrange\n\n100 begincidrange\n<e9b6b0> <e9b6b3> 21730\n<e9b6b5> <e9b6ba> 21734\n<e9b6bd> <e9b6bf> 21740\n<e9b785> <e9b792> 21745\n<e9b794> <e9b796> 21759\n<e9b79b> <e9b7a4> 21763\n<e9b7a7> <e9b7ae> 21773\n<e9b7b0> <e9b7b1> 21781\n<e9b7b4> <e9b7b7> 21783\n<e9b7bb> <e9b7bf> 21787\n<e9b880> <e9b88b> 21792\n<e9b88d> <e9b894> 21804\n<e9b896> <e9b899> 21812\n<e9b8a8> <e9b8ac> 6967\n<e9b8b9> <e9b8ba> 6977\n<e9b8bb> <e9b8bc> 21822\n<e9b981> <e9b982> 6980\n<e9b986> <e9b989> 6983\n<e9b98b> <e9b98c> 6987\n<e9b992> <e9b994> 21827\n<e9b99a> <e9b99c> 6993\n<e9b99f> <e9b9a2> 21833\n<e9b9a6> <e9b9ac> 6998\n<e9b9ae> <e9b9af> 21838\n<e9b9b6> <e9b9b8> 21842\n<e9ba80> <e9ba81> 21846\n<e9ba83> <e9ba86> 21848\n<e9ba87> <e9ba88> 7677\n<e9ba89> <e9ba8a> 21852\n<e9ba8c> <e9ba91> 21854\n<e9ba94> <e9ba96> 21860\n<e9ba98> <e9ba9c> 21863\n<e9baa0> <e9baa4> 21869\n<e9baa7> <e9baa8> 21874\n<e9baaa> <e9baae> 21876\n<e9bab0> <e9bab3> 21881\n<e9bab6> <e9bab7> 21885\n<e9bab9> <e9baba> 21887\n<e9babd> <e9babe> 7673\n<e9bb80> <e9bb83> 21891\n<e9bb85> <e9bb88> 21895\n<e9bb8a> <e9bb8b> 21899\n<e9bb92> <e9bb93> 21902\n<e9bb95> <e9bb97> 21904\n<e9bb99> <e9bb9a> 21907\n<e9bb9b> <e9bb9d> 7684\n<e9bba3> <e9bba4> 21910\n<e9bbab> <e9bbae> 21913\n<e9bbb0> <e9bbb1> 21917\n<e9bbb5> <e9bbb6> 21920\n<e9bbbb> <e9bbbc> 6742\n<e9bc80> <e9bc88> 21924\n<e9bc91> <e9bc92> 21936\n<e9bc9a> <e9bc9f> 21941\n<e9bca3> <e9bcab> 21948\n<e9bcad> <e9bcae> 21957\n<e9bcb0> <e9bcb6> 21959\n<e9bcbd> <e9bcbe> 7700\n<e9bd80> <e9bd83> 21970\n<e9bd85> <e9bd89> 21974\n<e9bd8c> <e9bd8e> 21979\n<e9bd95> <e9bd98> 21983\n<e9bd9a> <e9bd9b> 21987\n<e9bd9d> <e9bd9e> 21989\n<e9bda4> <e9bda5> 21992\n<e9bda7> <e9bda9> 21994\n<e9bdad> <e9bdb1> 21998\n<e9bdb3> <e9bdb6> 22003\n<e9bdb8> <e9bdbe> 22007\n<e9be81> <e9be82> 22014\n<e9be85> <e9be8a> 7535\n<e9be8e> <e9be8f> 22016\n<e9be91> <e9be93> 22018\n<e9be96> <e9be98> 22021\n<e9be9d> <e9be9e> 22024\n<e9bea1> <e9bea5> 22026\n<e9beb6> <e9beb7> 22069\n<ea8080> <ea80bf> 29064\n<ea8180> <ea81bf> 29128\n<ea8280> <ea82bf> 29192\n<ea8380> <ea83bf> 29256\n<ea8480> <ea84bf> 29320\n<ea8580> <ea85bf> 29384\n<ea8680> <ea86bf> 29448\n<ea8780> <ea87bf> 29512\n<ea8880> <ea88bf> 29576\n<ea8980> <ea89bf> 29640\n<ea8a80> <ea8abf> 29704\n<ea8b80> <ea8bbf> 29768\n<ea8c80> <ea8cbf> 29832\n<ea8d80> <ea8dbf> 29896\n<ea8e80> <ea8ebf> 29960\n<ea8f80> <ea8fbf> 30024\n<ea9080> <ea90bf> 30088\n<ea9180> <ea91bf> 30152\n<ea9280> <ea928c> 30216\n<ea9290> <ea92bf> 30229\n<ea9380> <ea9386> 30277\n<ee9e8d> <ee9e93> 573\n<ee9e94> <ee9e95> 592\nendcidrange\n\n25 begincidrange\n<ee9fa7> <ee9fb3> 10059\n<eea095> <eea0bf> 22047\n<eea180> <eea1a4> 22090\n<efa88d> <efa88f> 22032\n<efa893> <efa894> 22036\n<efa89f> <efa8a1> 22039\n<efa8a3> <efa8a4> 22042\n<efa8a7> <efa8a9> 22044\n<efb893> <efb896> 576\n<efb897> <efb898> 592\n<efb8b3> <efb8b4> 600\n<efb8b5> <efb8b6> 580\n<efb8b7> <efb8b8> 596\n<efb8b9> <efb8ba> 582\n<efb8bb> <efb8bc> 594\n<efb8bd> <efb8be> 586\n<efb981> <efb984> 588\n<efb989> <efb992> 10027\n<efb994> <efb997> 10037\n<efb999> <efb9a6> 10041\n<efb9a8> <efb9ab> 10055\n<efbc81> <efbc83> 262\n<efbc85> <efbcbf> 266\n<efbd80> <efbd9d> 325\n<efbfa0> <efbfa1> 168\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/UniGB-UTF8-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniGB-UTF8-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniGB-UTF8-H)\n%%BeginResource: CMap (UniGB-UTF8-V)\n%%Title: (UniGB-UTF8-V Adobe GB1 5)\n%%Version: 13.004\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution.\n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission.\n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniGB-UTF8-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (GB1) def\n  /Supplement 5 def\nend def\n\n/CMapName /UniGB-UTF8-V def\n/CMapVersion 13.004 def\n/CMapType 1 def\n\n/XUID [1 10 25450] def\n\n/WMode 1 def\n\n17 begincidchar\n<e28094> 598\n<e280a6> 599\n<e38081> 575\n<e38082> 574\n<e38093> 7706\n<efbc81> 578\n<efbc8c> 573\n<efbc8e> 7707\n<efbc9d> 7708\n<efbc9f> 579\n<efbcbb> 7709\n<efbcbd> 7710\n<efbcbf> 600\n<efbd9b> 596\n<efbd9d> 597\n<efbd9e> 7704\n<efbfa3> 7711\nendcidchar\n\n6 begincidrange\n<e38088> <e3808f> 584\n<e38090> <e38091> 594\n<e38094> <e38095> 582\n<e38096> <e38097> 592\n<efbc88> <efbc89> 580\n<efbc9a> <efbc9b> 576\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/gb/UniGB-X",
    "content": "begincmap\n/CMapName /UniGB-X def\n/WMode 0 def\nbegincidchar\n<a4>167\n<a5>22354\n<a7>171\n<a8>102\n<b0>162\n<b1>127\n<d7>128\n<e0>671\n<e1>669\n<e8>675\n<e9>673\n<ea>693\n<ec>679\n<ed>677\n<f2>683\n<f3>681\n<f7>129\n<f9>687\n<fa>685\n<fc>692\n<0101>668\n<0113>672\n<011b>674\n<012b>676\n<014d>680\n<016b>684\n<01ce>670\n<01d0>678\n<01d2>682\n<01d4>686\n<01d6>688\n<01d8>689\n<01da>690\n<01dc>691\n<01f9>698\n<02c7>101\n<02c9>100\n<02d9>9909\n<0401>608\n<0451>641\n<1e3f>695\n<2010>10018\n<2013>9910\n<2014>105\n<2015>9911\n<2016>107\n<2025>9912\n<2026>108\n<2030>170\n<2035>9913\n<203b>184\n<20ac>22353\n<2103>165\n<2105>9914\n<2109>9915\n<2116>172\n<2121>10016\n<2192>185\n<2193>188\n<2208>137\n<220f>134\n<2211>133\n<2215>9920\n<221a>139\n<221d>151\n<221e>157\n<221f>9921\n<2220>142\n<2223>9922\n<2225>141\n<2229>136\n<222a>135\n<222b>145\n<222e>146\n<2234>159\n<2235>158\n<2236>130\n<2237>138\n<223d>150\n<2248>149\n<224c>148\n<2252>9923\n<2260>152\n<2261>147\n<2295>9988\n<2299>144\n<22a5>140\n<22bf>9926\n<22ef>108\n<2312>143\n<25a0>181\n<25a1>180\n<25b2>183\n<25b3>182\n<25c6>179\n<25c7>178\n<25cb>175\n<25ce>177\n<25cf>176\n<2605>174\n<2606>173\n<2609>9987\n<2640>161\n<2642>160\n<2e80>22428\n<2e81>22047\n<2e84>22051\n<2e88>22054\n<2e8b>22055\n<2e8c>22060\n<2e97>22061\n<2ea7>22074\n<2eaa>22077\n<2eae>22080\n<2eb3>22082\n<2ebb>22088\n<2eca>22098\n<2f00>4162\n<2f01>4707\n<2f02>4722\n<2f03>4709\n<2f04>4185\n<2f05>10131\n<2f06>1597\n<2f07>4867\n<2f08>3238\n<2f09>1592\n<2f0a>3270\n<2f0b>982\n<2f0c>4765\n<2f0d>4884\n<2f0e>4879\n<2f0f>2091\n<2f10>5017\n<2f11>1431\n<2f12>2543\n<2f13>4860\n<2f14>4710\n<2f15>4740\n<2f16>10778\n<2f17>3397\n<2f18>1150\n<2f19>4946\n<2f1a>1228\n<2f1b>5020\n<2f1c>4283\n<2f1d>2407\n<2f1e>5523\n<2f1f>3698\n<2f20>3414\n<2f21>5660\n<2f22>11565\n<2f23>3859\n<2f24>1398\n<2f25>2927\n<2f26>4656\n<2f27>5934\n<2f28>1386\n<2f29>3948\n<2f2a>5302\n<2f2b>3395\n<2f2c>6004\n<2f2d>3318\n<2f2e>6165\n<2f2f>1789\n<2f30>2093\n<2f31>2238\n<2f32>1732\n<2f33>6163\n<2f34>1852\n<2f35>5016\n<2f36>5293\n<2f37>5366\n<2f38>1798\n<2f39>5986\n<2f3a>5614\n<2f3b>5600\n<2f3c>3983\n<2f3d>1765\n<2f3e>12946\n<2f3f>3437\n<2f40>4518\n<2f41>6409\n<2f42>3795\n<2f43>1526\n<2f44>2240\n<2f45>1626\n<2f46>3821\n<2f47>3248\n<2f48>4350\n<2f49>4357\n<2f4a>2849\n<2f4b>3124\n<2f4c>4536\n<2f4d>1400\n<2f4e>6589\n<2f4f>3826\n<2f50>1073\n<2f51>2736\n<2f52>3430\n<2f53>3095\n<2f54>3491\n<2f55>2053\n<2f56>4611\n<2f57>1715\n<2f58>4713\n<2f59>5789\n<2f5a>3019\n<2f5b>4073\n<2f5c>2916\n<2f5d>3209\n<2f5e>4041\n<2f5f>4310\n<2f60>1832\n<2f61>3728\n<2f62>1733\n<2f63>3379\n<2f64>4264\n<2f65>3650\n<2f66>7110\n<2f67>7008\n<2f68>16063\n<2f69>994\n<2f6a>3011\n<2f6b>2808\n<2f6c>2850\n<2f6d>2737\n<2f6e>3407\n<2f6f>3398\n<2f70>3413\n<2f71>16587\n<2f72>1923\n<2f73>4049\n<2f74>2539\n<2f75>4592\n<2f76>2780\n<2f77>7399\n<2f78>7262\n<2f79>3753\n<2f7a>4123\n<2f7b>4309\n<2f7c>2490\n<2f7d>1591\n<2f7e>7115\n<2f7f>1593\n<2f80>6686\n<2f81>3261\n<2f82>1249\n<2f83>4657\n<2f84>4544\n<2f85>2297\n<2f86>3353\n<2f87>5656\n<2f88>4570\n<2f89>7388\n<2f8a>3300\n<2f8b>17826\n<2f8c>7152\n<2f8d>1291\n<2f8e>4051\n<2f8f>3995\n<2f90>4169\n<2f91>18908\n<2f92>8086\n<2f93>2200\n<2f94>4093\n<2f95>1825\n<2f96>1528\n<2f97>7445\n<2f98>7504\n<2f99>7739\n<2f9a>1285\n<2f9b>4668\n<2f9c>4672\n<2f9d>3366\n<2f9e>7803\n<2f9f>3980\n<2fa0>1250\n<2fa1>19731\n<2fa2>4191\n<2fa3>4276\n<2fa4>19992\n<2fa5>2522\n<2fa6>2241\n<2fa7>7797\n<2fa8>8317\n<2fa9>1714\n<2faa>2542\n<2fab>7545\n<2fac>4303\n<2fad>20714\n<2fae>1636\n<2faf>2795\n<2fb0>1770\n<2fb1>8589\n<2fb2>2289\n<2fb3>4219\n<2fb4>8713\n<2fb5>7936\n<2fb6>7924\n<2fb7>3402\n<2fb8>3438\n<2fb9>3920\n<2fba>8301\n<2fbb>1824\n<2fbc>1754\n<2fbd>7660\n<2fbe>7888\n<2fbf>5019\n<2fc0>4704\n<2fc1>1862\n<2fc2>8761\n<2fc3>8348\n<2fc4>9864\n<2fc5>2656\n<2fc6>8305\n<2fc7>2704\n<2fc8>21894\n<2fc9>3465\n<2fca>1937\n<2fcb>6741\n<2fcc>9752\n<2fcd>1509\n<2fce>1821\n<2fcf>3466\n<2fd0>1072\n<2fd1>8390\n<2fd2>7814\n<2fd3>8247\n<2fd4>7988\n<2fd5>4851\n<3003>103\n<3005>104\n<3006>10024\n<3007>7703\n<3012>9989\n<3013>189\n<303e>10059\n<303f>22357\n<3094>22375\n<30f7>22390\n<30fa>22393\n<30fb>99\n<30fc>10019\n<3231>10017\n<32a3>10001\n<33a1>10007\n<33c4>10008\n<33ce>10009\n<33d5>10012\n<3447>22053\n<3473>22052\n<359e>22057\n<360e>22059\n<361a>22058\n<3918>22063\n<396e>22062\n<39cf>22065\n<39d0>22068\n<39df>22066\n<3a73>22067\n<3b4e>22071\n<3c6e>22072\n<3ce0>22073\n<4056>22078\n<415f>22079\n<4337>22081\n<43ac>22087\n<43b1>22086\n<43dd>22089\n<44d6>22090\n<464c>22092\n<4661>22091\n<4723>22094\n<4729>22095\n<477c>22096\n<478d>22097\n<4947>22099\n<497a>22100\n<497d>22101\n<4984>28005\n<499b>22107\n<499f>22106\n<49b6>22109\n<49b7>22108\n<4c77>22116\n<4ca2>22117\n<4ca3>22112\n<4dae>22125\n<4e00>4162\n<4e01>1504\n<4e02>10072\n<4e03>3070\n<4e07>3747\n<4e08>4458\n<4e09>3288\n<4e0a>3336\n<4e0b>3887\n<4e0c>4696\n<4e0d>1154\n<4e0e>4304\n<4e0f>10076\n<4e10>4698\n<4e11>1304\n<4e12>10077\n<4e13>4613\n<4e14>3151\n<4e15>4701\n<4e16>3415\n<4e17>10078\n<4e18>3181\n<4e19>1124\n<4e1a>4156\n<4e1b>1367\n<4e1c>1514\n<4e1d>3508\n<4e1e>4703\n<4e22>1513\n<4e23>10082\n<4e24>2566\n<4e25>4088\n<4e26>10083\n<4e27>3294\n<4e28>4707\n<4e29>10084\n<4e2a>1777\n<4e2b>4071\n<4e2c>5788\n<4e2d>4559\n<4e30>1662\n<4e31>10087\n<4e32>1329\n<4e33>10088\n<4e34>2594\n<4e35>10089\n<4e36>4722\n<4e37>10090\n<4e38>3737\n<4e39>1413\n<4e3a>3769\n<4e3b>4598\n<4e3c>10091\n<4e3d>2529\n<4e3e>2312\n<4e3f>4709\n<4e43>2862\n<4e44>10095\n<4e45>2290\n<4e46>10096\n<4e47>4711\n<4e48>2745\n<4e49>4204\n<4e4a>10097\n<4e4b>4525\n<4e4c>3817\n<4e4d>4424\n<4e4e>1964\n<4e4f>1603\n<4e50>2497\n<4e51>10098\n<4e52>3032\n<4e53>2963\n<4e54>3140\n<4e55>10099\n<4e56>1837\n<4e57>10100\n<4e58>1264\n<4e59>4185\n<4e5c>4725\n<4e5d>2292\n<4e5e>3089\n<4e5f>4153\n<4e60>3869\n<4e61>3924\n<4e66>3456\n<4e69>4726\n<4e70>2713\n<4e71>2681\n<4e72>10115\n<4e73>3268\n<4e7e>3113\n<4e82>8281\n<4e86>2580\n<4e87>10132\n<4e88>4301\n<4e89>4506\n<4e8a>10133\n<4e8b>3417\n<4e8c>1597\n<4e8d>4695\n<4e8e>4287\n<4e8f>2436\n<4e90>10134\n<4e91>4361\n<4e92>1978\n<4e93>4727\n<4e94>3828\n<4e95>2269\n<4e98>4702\n<4e99>10137\n<4e9a>4080\n<4e9b>3956\n<4e9e>8689\n<4e9f>4723\n<4ea0>4867\n<4ea1>3751\n<4ea2>2375\n<4ea3>10140\n<4ea4>2188\n<4ea5>1884\n<4ea6>4199\n<4ea7>1217\n<4ea8>1943\n<4ea9>2841\n<4eaa>10141\n<4eab>3930\n<4eac>2264\n<4ead>3669\n<4eae>2570\n<4eb2>3156\n<4eb3>4869\n<4eb4>10145\n<4eb5>4872\n<4eba>3238\n<4ebb>4767\n<4ebf>4193\n<4ec0>3401\n<4ec1>3237\n<4ec2>4770\n<4ec3>4768\n<4ec4>4732\n<4ec5>2247\n<4ec6>3052\n<4ec7>1301\n<4ec8>10153\n<4ec9>4769\n<4eca>2242\n<4ecb>2234\n<4ecc>10154\n<4ecd>3247\n<4ece>1366\n<4ed1>2687\n<4ed2>10157\n<4ed3>1181\n<4ed4>4653\n<4ed5>3426\n<4ed6>3568\n<4ed7>4461\n<4ed8>1713\n<4ed9>3894\n<4edd>4846\n<4ede>4774\n<4edf>3111\n<4ee0>10161\n<4ee1>4772\n<4ee2>10162\n<4ee3>1405\n<4ee4>2615\n<4ee5>4187\n<4ee8>4771\n<4ee9>10165\n<4eea>4174\n<4eeb>4773\n<4eec>2764\n<4ef0>4127\n<4ef1>10169\n<4ef2>4568\n<4ef3>4776\n<4ef4>10170\n<4ef5>4779\n<4ef6>2161\n<4ef7>2126\n<4efb>3241\n<4efc>10174\n<4efd>1658\n<4efe>10175\n<4eff>1631\n<4f00>10176\n<4f01>3090\n<4f09>4782\n<4f0a>4168\n<4f0d>3832\n<4f0e>2098\n<4f0f>1689\n<4f10>1602\n<4f11>4008\n<4f17>4569\n<4f18>4266\n<4f19>2052\n<4f1a>2038\n<4f1b>4775\n<4f1e>3290\n<4f1f>3775\n<4f20>1326\n<4f21>10193\n<4f22>4777\n<4f23>10194\n<4f24>3332\n<4f25>4780\n<4f26>2686\n<4f27>4781\n<4f2a>3776\n<4f2b>4783\n<4f2f>1141\n<4f30>1817\n<4f31>10200\n<4f32>4791\n<4f33>10201\n<4f34>1012\n<4f35>10202\n<4f36>2607\n<4f37>10203\n<4f38>3365\n<4f39>10204\n<4f3a>3514\n<4f3b>10205\n<4f3c>3515\n<4f3d>4792\n<4f43>1481\n<4f46>1420\n<4f4d>3786\n<4f4e>1454\n<4f4f>4606\n<4f50>4689\n<4f51>4280\n<4f52>10219\n<4f53>3640\n<4f54>10220\n<4f55>1925\n<4f56>10221\n<4f57>4790\n<4f58>4848\n<4f59>4293\n<4f5a>4787\n<4f5b>1677\n<4f5c>4692\n<4f5d>4788\n<4f5e>4784\n<4f5f>4789\n<4f60>2886\n<4f63>4251\n<4f64>4778\n<4f65>4849\n<4f66>10224\n<4f67>4785\n<4f68>10225\n<4f69>2982\n<4f6c>2491\n<4f6f>4121\n<4f70>998\n<4f73>2116\n<4f74>4794\n<4f75>10232\n<4f76>4793\n<4f7b>4800\n<4f7c>4802\n<4f7d>10237\n<4f7e>4799\n<4f7f>3408\n<4f83>4797\n<4f84>4533\n<4f85>10241\n<4f86>8178\n<4f87>10242\n<4f88>1283\n<4f89>4796\n<4f8a>10243\n<4f8b>2536\n<4f8c>10244\n<4f8d>3427\n<4f8e>10245\n<4f8f>4798\n<4f90>10246\n<4f91>4795\n<4f94>4804\n<4f95>10249\n<4f96>8285\n<4f97>1520\n<4f9b>1794\n<4f9c>10253\n<4f9d>4167\n<4fa0>3885\n<4fa3>2665\n<4fa4>10258\n<4fa5>2197\n<4fa6>4493\n<4fa7>1191\n<4fa8>3141\n<4fa9>2424\n<4faa>4801\n<4fab>10259\n<4fac>4803\n<4fad>10260\n<4fae>3833\n<4faf>1957\n<4fb5>3155\n<4fbf>1100\n<4fc2>9884\n<4fc3>1372\n<4fc4>1580\n<4fc5>4808\n<4fca>2350\n<4fce>4850\n<4fcf>3147\n<4fd0>2537\n<4fd1>4812\n<4fd7>3532\n<4fd8>1690\n<4fd9>10289\n<4fda>4809\n<4fdb>10290\n<4fdc>4811\n<4fdd>1036\n<4fde>4294\n<4fdf>4813\n<4fe0>8629\n<4fe1>3984\n<4fe2>10291\n<4fe3>4810\n<4fe6>4805\n<4fe7>10294\n<4fe8>4806\n<4fe9>2546\n<4fea>4807\n<4fed>2150\n<4fee>4009\n<4fef>1700\n<4ff0>10297\n<4ff1>2322\n<4ff2>10298\n<4ff3>4817\n<4ff8>4814\n<4ff9>10303\n<4ffa>958\n<4ffe>4822\n<4fff>10307\n<5000>8908\n<5006>8214\n<5009>7778\n<500a>10315\n<500b>7968\n<500c>4824\n<500d>1055\n<500e>10316\n<500f>4819\n<5010>10317\n<5011>8319\n<5012>1434\n<5013>10318\n<5014>2338\n<5018>3611\n<5019>1961\n<501a>4183\n<501b>10322\n<501c>4823\n<501f>2233\n<5020>10325\n<5021>1232\n<5025>4825\n<5026>2330\n<5027>10329\n<5028>4826\n<5029>4815\n<502a>2882\n<502b>8284\n<502c>4818\n<502d>4821\n<502e>4820\n<503a>4431\n<503b>10341\n<503c>4532\n<503d>10342\n<503e>3168\n<5043>4828\n<5047>2124\n<5048>4830\n<5049>8596\n<504c>4816\n<504d>10352\n<504e>4831\n<504f>3018\n<5055>4829\n<505a>4691\n<505b>10362\n<505c>3668\n<5065>2162\n<506c>4832\n<5074>7781\n<5075>8833\n<5076>2941\n<5077>3686\n<507b>4833\n<507e>4827\n<507f>1226\n<5080>2443\n<5085>1712\n<5088>2535\n<508d>1027\n<5096>8909\n<5097>10407\n<5098>8458\n<5099>7742\n<50a2>9855\n<50a3>1401\n<50a4>10416\n<50a5>4834\n<50a6>10417\n<50a7>4835\n<50a8>1317\n<50a9>4836\n<50ac>1378\n<50ad>8750\n<50b2>972\n<50b3>7830\n<50b4>8907\n<50b5>8812\n<50b6>10424\n<50b7>8471\n<50ba>4837\n<50bb>3310\n<50be>8424\n<50c2>8916\n<50c5>8121\n<50c9>8920\n<50cf>3934\n<50d0>10442\n<50d1>8415\n<50d5>8386\n<50d6>4838\n<50da>2574\n<50de>8597\n<50e5>8108\n<50e6>4842\n<50e7>3303\n<50e8>8915\n<50ec>4841\n<50ed>4840\n<50ee>4843\n<50f3>3536\n<50f4>10465\n<50f5>2170\n<50f9>8065\n<50fa>10469\n<50fb>3014\n<5100>8720\n<5101>10474\n<5102>8911\n<5103>10475\n<5104>8723\n<5105>10476\n<5106>4839\n<5107>4844\n<5108>8164\n<5109>8080\n<510a>10477\n<510b>4845\n<5110>8918\n<5111>10482\n<5112>3264\n<5113>10483\n<5114>8912\n<5115>8910\n<5118>9857\n<511f>7798\n<5120>10492\n<5121>2503\n<512a>8753\n<5132>7827\n<5137>8914\n<513a>8919\n<513b>8917\n<513c>8913\n<513f>1592\n<5140>4697\n<5141>4365\n<5142>10516\n<5143>4333\n<5144>4001\n<5145>1289\n<5146>4472\n<5147>10517\n<5148>3893\n<5149>1851\n<514a>10518\n<514b>2392\n<514c>10519\n<514d>2791\n<5151>1553\n<5152>7909\n<5153>10523\n<5154>3700\n<5155>4866\n<5156>4868\n<515a>1428\n<515b>10527\n<515c>1524\n<5162>2259\n<5165>3270\n<5168>3206\n<5169>8229\n<516a>10537\n<516b>982\n<516c>1796\n<516d>2626\n<516e>4854\n<516f>10538\n<5170>2471\n<5171>1803\n<5172>10539\n<5173>1841\n<5174>3990\n<5175>1121\n<5176>3075\n<5177>2318\n<5178>1477\n<5179>4645\n<517a>10540\n<517b>4129\n<517c>2137\n<517d>3445\n<5180>2096\n<5181>4858\n<5182>4765\n<5185>2877\n<5188>1743\n<5189>3224\n<518c>1192\n<518d>4380\n<5192>2741\n<5195>2790\n<5196>4884\n<5197>3258\n<5198>10555\n<5199>3967\n<519a>10556\n<519b>2347\n<519c>2922\n<51a0>1843\n<51a1>10560\n<51a2>4885\n<51a3>10561\n<51a4>4332\n<51a5>4886\n<51ab>4879\n<51ac>1515\n<51af>1672\n<51b0>1122\n<51b1>4880\n<51b2>1290\n<51b3>2341\n<51b4>10569\n<51b5>2435\n<51b6>4152\n<51b7>2511\n<51bb>1522\n<51bc>4882\n<51bd>4881\n<51c0>2282\n<51c4>3071\n<51c5>10578\n<51c6>4633\n<51c7>4883\n<51c8>10579\n<51c9>2562\n<51ca>10580\n<51cb>1491\n<51cc>2609\n<51cd>7887\n<51ce>10581\n<51cf>2152\n<51d0>10582\n<51d1>1368\n<51db>2598\n<51dc>10592\n<51dd>2912\n<51e0>2091\n<51e1>1615\n<51e4>1676\n<51eb>4864\n<51ec>10603\n<51ed>3037\n<51ee>10604\n<51ef>2362\n<51f0>2016\n<51f1>8153\n<51f2>10605\n<51f3>1451\n<51f4>10606\n<51f5>5017\n<51f6>4002\n<51f7>10607\n<51f8>3690\n<51f9>967\n<51fa>1307\n<51fb>2060\n<51fc>5018\n<51fd>1894\n<51fe>10608\n<51ff>4391\n<5200>1431\n<5201>1492\n<5202>4748\n<5203>3243\n<5206>1651\n<5207>3149\n<5208>4749\n<5209>10611\n<520a>2364\n<520d>5003\n<520e>4750\n<5211>3991\n<5212>1987\n<5216>6510\n<5217>2585\n<5218>2622\n<5219>4405\n<521a>1744\n<521b>1335\n<521c>10619\n<521d>1306\n<5220>3319\n<5224>2961\n<5228>2970\n<5229>2534\n<522a>10628\n<522b>1113\n<522c>10629\n<522d>4751\n<522e>1831\n<522f>10630\n<5230>1438\n<5233>4752\n<5236>4549\n<5237>3479\n<5238>3210\n<5239>3307\n<523a>1359\n<523b>2393\n<523c>10635\n<523d>1869\n<523e>10636\n<5241>1574\n<5242>2100\n<5243>3645\n<5244>8904\n<5247>8803\n<524a>3940\n<524b>9859\n<524c>4755\n<524d>3117\n<5250>1833\n<5251>2164\n<5254>3633\n<5255>10645\n<5256>3049\n<525b>7959\n<525c>4758\n<525d>10650\n<525e>4756\n<5261>4757\n<5265>1033\n<5266>10656\n<5267>2326\n<5268>10657\n<5269>3386\n<526a>2151\n<526e>7979\n<526f>1708\n<5272>1769\n<5273>10663\n<5274>8906\n<5275>7833\n<527d>4760\n<527e>10671\n<527f>2204\n<5280>10672\n<5281>4762\n<5282>4761\n<5283>8015\n<5287>8143\n<5288>3005\n<5289>8246\n<528a>7994\n<528b>10676\n<528c>8905\n<528d>8089\n<5290>4763\n<5291>8053\n<5292>10679\n<5293>4764\n<529b>2543\n<529c>10687\n<529d>3211\n<529e>1015\n<529f>1791\n<52a0>2118\n<52a1>3840\n<52a2>5005\n<52a3>2588\n<52a8>1518\n<52a9>4601\n<52aa>2925\n<52ab>2218\n<52b1>2531\n<52b2>2257\n<52b3>2488\n<52be>5008\n<52bf>3421\n<52c0>10705\n<52c1>8126\n<52c2>10706\n<52c3>1137\n<52c7>4263\n<52c8>10710\n<52c9>2792\n<52ca>10711\n<52cb>4052\n<52d0>5010\n<52d1>10716\n<52d2>2496\n<52d5>7885\n<52d6>5011\n<52d7>10719\n<52d8>2366\n<52d9>8617\n<52da>10720\n<52db>8678\n<52dc>10721\n<52dd>8487\n<52de>8195\n<52df>2847\n<52e2>8498\n<52e3>10724\n<52e4>3159\n<52f0>5012\n<52f1>8995\n<52f5>8209\n<52f8>8437\n<52f9>4860\n<52fa>3344\n<52fe>1805\n<52ff>3839\n<5300>4363\n<5305>1031\n<5306>1365\n<5307>10748\n<5308>4004\n<530d>4861\n<530e>10753\n<530f>5301\n<5310>4863\n<5315>4710\n<5316>1988\n<5317>1050\n<5318>10758\n<5319>1276\n<531a>4740\n<531d>4372\n<5320>2180\n<5321>2428\n<5322>10763\n<5323>3880\n<5326>4742\n<532a>1640\n<532d>8901\n<532e>4743\n<532f>8030\n<5330>10771\n<5331>8902\n<5339>3012\n<533a>3189\n<533b>4164\n<533e>4744\n<533f>2887\n<5340>8431\n<5341>3397\n<5342>10781\n<5343>3108\n<5344>10782\n<5345>4700\n<5346>10783\n<5347>3382\n<5348>3830\n<5349>2033\n<534a>1014\n<534e>1983\n<534f>3960\n<5350>10787\n<5351>1049\n<5352>4673\n<5353>4636\n<5354>8656\n<5355>1414\n<5356>2715\n<5357>2866\n<535a>1136\n<535b>10790\n<535c>1150\n<535d>10791\n<535e>1102\n<535f>5370\n<5360>4445\n<5361>2357\n<5362>2643\n<5363>4747\n<5364>2648\n<5365>10792\n<5366>4746\n<5367>3811\n<5368>10793\n<5369>4946\n<536a>10794\n<536b>3791\n<536e>4714\n<536f>2739\n<5370>4230\n<5371>3762\n<5372>10797\n<5373>2087\n<5374>3215\n<5375>2680\n<5376>10798\n<5377>2332\n<5378>3969\n<5379>10799\n<537a>4947\n<537f>3169\n<5382>1228\n<5383>10806\n<5384>1585\n<5385>3663\n<5386>2533\n<5389>2530\n<538a>10809\n<538b>4066\n<538c>4106\n<538d>4733\n<5395>1189\n<5398>2512\n<5399>8897\n<539a>1960\n<539d>4734\n<539e>10821\n<539f>4336\n<53a0>7780\n<53a1>10822\n<53a2>3918\n<53a3>4735\n<53a4>10823\n<53a5>4736\n<53a6>3888\n<53a7>10824\n<53a8>1309\n<53a9>2294\n<53ad>8697\n<53ae>4737\n<53b2>8208\n<53b3>10831\n<53b4>8898\n<53b5>10832\n<53b6>5020\n<53bb>3200\n<53bf>3909\n<53c0>10840\n<53c1>3289\n<53c2>1173\n<53c3>7770\n<53c8>4283\n<53c9>1197\n<53ca>2083\n<53cb>4278\n<53cc>3488\n<53cd>1617\n<53d1>1599\n<53d4>3452\n<53d5>10850\n<53d6>3196\n<53d7>3443\n<53d8>1101\n<53d9>4027\n<53da>10851\n<53db>2962\n<53df>5013\n<53e0>1503\n<53e1>10855\n<53e2>7842\n<53e3>2407\n<53e4>1822\n<53e5>2323\n<53e6>2614\n<53e7>10856\n<53e8>5374\n<53e9>5373\n<53ea>4538\n<53eb>2209\n<53ec>4474\n<53ed>979\n<53ee>1506\n<53ef>2390\n<53f0>3579\n<53f1>5371\n<53f2>3406\n<53f3>4279\n<53f4>10857\n<53f5>4741\n<53f6>4157\n<53f7>1916\n<53f8>3507\n<53f9>3601\n<53fa>10858\n<53fb>5375\n<53fc>1489\n<53fd>5372\n<5401>4314\n<5402>10862\n<5403>1273\n<5404>1778\n<5405>10863\n<5406>5378\n<5407>10864\n<5408>1926\n<5409>2077\n<540a>1494\n<540b>10865\n<540c>3677\n<540d>2816\n<540e>1962\n<540f>2527\n<5410>3699\n<5411>3935\n<5412>5376\n<5413>3890\n<5414>10866\n<5415>2663\n<5416>5377\n<5417>2711\n<541b>2348\n<541c>10870\n<541d>2600\n<541e>3709\n<541f>4222\n<5420>1642\n<5421>5385\n<5422>10871\n<5423>5388\n<5426>1678\n<5427>980\n<5428>1557\n<5429>1649\n<542a>10874\n<542b>1891\n<542c>3664\n<542d>2401\n<542e>3494\n<542f>3091\n<5430>10875\n<5431>4519\n<5432>5389\n<5433>10876\n<5434>3825\n<5435>1240\n<5438>3851\n<5439>1336\n<543a>10879\n<543b>3798\n<543c>1959\n<543d>10880\n<543e>3824\n<543f>10881\n<5440>4070\n<5443>5384\n<5446>1399\n<5447>10886\n<5448>1263\n<5449>10887\n<544a>1761\n<544b>5379\n<5450>2856\n<5451>10892\n<5455>2940\n<5456>5383\n<5457>5386\n<5458>4340\n<5459>5387\n<545a>10893\n<545b>3127\n<545c>3815\n<5462>2875\n<5463>10899\n<5464>5394\n<5465>10900\n<5466>5399\n<5467>10901\n<5468>4571\n<5471>5393\n<5472>5410\n<5473>3781\n<5474>10910\n<5475>1918\n<5476>5398\n<5477>5392\n<5478>2975\n<547b>3364\n<547c>1963\n<547d>2817\n<5480>2310\n<5481>10915\n<5482>5390\n<5483>10916\n<5484>5397\n<5485>10917\n<5486>2969\n<548b>4423\n<548c>1924\n<548d>10922\n<548e>2299\n<548f>4258\n<5490>1723\n<5491>10923\n<5492>4579\n<5493>10924\n<5494>5391\n<5495>1815\n<5496>2356\n<5499>2629\n<549c>10927\n<549d>5400\n<54a3>5411\n<54a4>5421\n<54a5>10933\n<54a6>5407\n<54a7>5406\n<54a8>4646\n<54ab>5991\n<54ac>4142\n<54ad>5402\n<54ae>10934\n<54af>2358\n<54b0>10935\n<54b1>4382\n<54b2>10936\n<54b3>2389\n<54b4>5404\n<54b8>3897\n<54bb>5413\n<54bc>9069\n<54bd>4083\n<54be>10942\n<54bf>5414\n<54c0>946\n<54c1>3030\n<54c2>5403\n<54c3>10943\n<54c4>1948\n<54c5>10944\n<54c6>1566\n<54c7>3724\n<54c8>1879\n<54c9>4376\n<54cc>5415\n<54cd>3929\n<54ce>944\n<54cf>5423\n<54d0>5401\n<54d1>4079\n<54d2>5405\n<54d5>5412\n<54d6>10947\n<54d7>1982\n<54d8>10948\n<54db>10949\n<54dc>5418\n<54dd>5422\n<54de>5424\n<54df>4249\n<54e0>10950\n<54e1>8775\n<54e5>1762\n<54e6>2935\n<54e7>5426\n<54e8>3347\n<54e9>2545\n<54ea>2855\n<54ed>2411\n<54ee>3941\n<54f2>4477\n<54f3>5430\n<54fa>1151\n<54fb>10965\n<54fc>1942\n<54fd>5428\n<54fe>10966\n<54ff>5009\n<5500>10967\n<5501>4109\n<5504>9068\n<5505>10970\n<5506>3561\n<5507>1344\n<5508>10971\n<5509>945\n<550f>5433\n<5510>3609\n<5511>5434\n<5514>5429\n<551b>5425\n<5520>5427\n<5521>10989\n<5524>2002\n<5527>5435\n<552a>5436\n<552b>10994\n<552c>1976\n<552d>10995\n<552e>3442\n<552f>3767\n<5530>5453\n<5531>1231\n<5532>10996\n<5533>5452\n<5537>5447\n<553c>5446\n<553d>11004\n<553e>3722\n<553f>5444\n<5540>11005\n<5541>5442\n<5542>11006\n<5543>2397\n<5544>4641\n<5545>11007\n<5546>3333\n<5549>5440\n<554a>940\n<554f>8604\n<5550>5445\n<5553>8393\n<5554>11016\n<5555>5443\n<5556>5448\n<555c>5454\n<555d>11022\n<555e>8688\n<5561>1637\n<5564>3008\n<5565>3311\n<5566>2461\n<5567>5437\n<556a>2943\n<556b>11029\n<556c>4730\n<556d>5441\n<556e>2905\n<5578>3952\n<557b>5466\n<557c>3639\n<557d>11038\n<557e>5463\n<557f>11039\n<5580>2355\n<5581>5461\n<5582>3784\n<5583>5457\n<5584>3327\n<5587>2457\n<5588>5460\n<5589>1956\n<558a>1895\n<558b>5455\n<558f>5438\n<5590>11045\n<5591>5465\n<5594>5470\n<5598>1328\n<5599>5471\n<559c>3871\n<559d>1919\n<559e>11053\n<559f>5462\n<55a7>4037\n<55aa>8459\n<55ab>11063\n<55ac>8414\n<55ad>11064\n<55ae>7850\n<55b1>5458\n<55b2>8748\n<55b3>4414\n<55b4>11067\n<55b5>5439\n<55b6>11068\n<55b7>2984\n<55b8>11069\n<55b9>5459\n<55ba>11070\n<55bb>4316\n<55bc>11071\n<55c4>5482\n<55c5>4012\n<55c6>8408\n<55c7>8896\n<55c8>11077\n<55c9>5474\n<55ce>8303\n<55d1>5476\n<55d2>5456\n<55d3>3293\n<55d4>5479\n<55d5>11082\n<55d6>5464\n<55da>8609\n<55db>11086\n<55dc>3423\n<55dd>5481\n<55de>11087\n<55df>5467\n<55e0>11088\n<55e1>3802\n<55e2>11089\n<55e3>3512\n<55e4>5491\n<55e5>5484\n<55e6>5480\n<55e7>11090\n<55e8>5489\n<55e9>9081\n<55ea>5472\n<55ef>5483\n<55f4>11095\n<55f5>5490\n<55f6>9074\n<55f7>5473\n<55fd>3529\n<55fe>5499\n<55ff>11101\n<5600>5500\n<5601>5496\n<5606>8554\n<5607>11106\n<5608>5494\n<5609>2113\n<560c>5495\n<560d>9084\n<560e>1725\n<560f>4731\n<5614>8368\n<5615>11113\n<5616>9082\n<5617>7796\n<5618>4021\n<561b>2710\n<561c>9079\n<561d>11116\n<561e>5493\n<561f>5475\n<5623>5498\n<5624>5497\n<5627>5501\n<5628>11122\n<5629>8012\n<562c>5506\n<562d>5502\n<562e>9080\n<562f>8655\n<5630>9064\n<5631>4597\n<5632>1237\n<5633>11125\n<5634>4681\n<5635>9073\n<5636>3504\n<5637>11126\n<5638>9065\n<5639>5504\n<563a>11127\n<563b>3850\n<563f>1936\n<5640>11131\n<5641>9844\n<564c>5511\n<564d>5507\n<564e>4148\n<5654>5512\n<5657>5505\n<5658>5503\n<5659>5509\n<565c>5510\n<565d>9071\n<5660>9072\n<5661>11153\n<5662>5508\n<5663>11154\n<5664>5514\n<5665>9078\n<5666>9075\n<5667>11155\n<5668>3094\n<5669>4706\n<566a>4398\n<566b>5516\n<566c>3424\n<566f>9087\n<5670>11158\n<5671>5515\n<5672>9076\n<5673>11159\n<5674>8373\n<5675>11160\n<5676>1724\n<5677>11161\n<5678>7899\n<5679>9842\n<567a>11162\n<5680>9070\n<5685>5519\n<5686>5513\n<5687>8631\n<568c>9077\n<568d>11174\n<568e>1910\n<568f>3642\n<5693>5520\n<5694>11178\n<5695>9090\n<5699>8350\n<56a3>3942\n<56a6>9067\n<56a7>11193\n<56a8>8249\n<56ae>9887\n<56af>5521\n<56b3>9085\n<56b4>8693\n<56b5>11202\n<56b6>9089\n<56b7>3229\n<56bc>2193\n<56c0>9083\n<56c1>9086\n<56c2>8652\n<56c5>8923\n<56c8>9066\n<56c9>9865\n<56ca>2869\n<56cb>11214\n<56cc>9879\n<56d1>8865\n<56d4>5522\n<56d7>5523\n<56da>3185\n<56db>3513\n<56dc>11225\n<56dd>5524\n<56de>2029\n<56df>4716\n<56e0>4217\n<56e1>5525\n<56e2>3702\n<56e3>11226\n<56e4>1561\n<56eb>5527\n<56ec>11233\n<56ed>4339\n<56f0>2450\n<56f1>1364\n<56f4>3766\n<56f5>5526\n<56f9>5528\n<56fa>1829\n<56fd>1875\n<56fe>3693\n<56ff>5529\n<5703>3059\n<5704>5530\n<5705>11246\n<5706>4341\n<5707>9091\n<5708>3201\n<5709>5532\n<570a>5531\n<570b>7997\n<570c>11247\n<570d>8591\n<5712>8774\n<5713>8776\n<5716>8574\n<5717>11254\n<5718>8576\n<571c>5533\n<571f>3698\n<5723>3388\n<5728>4381\n<5729>5031\n<572a>5033\n<572b>11267\n<572c>5032\n<572d>1856\n<5730>1465\n<5733>5034\n<5739>5035\n<573a>1222\n<573b>5039\n<573e>2061\n<573f>11277\n<5740>4534\n<5741>11278\n<5742>5040\n<5747>2344\n<574a>1624\n<574b>11285\n<574c>5024\n<574d>3585\n<574e>2367\n<574f>1994\n<5750>4693\n<5751>2400\n<5757>2422\n<575a>2132\n<575b>3590\n<575c>5038\n<575d>990\n<575e>3834\n<575f>1653\n<5760>4630\n<5761>3041\n<5764>2447\n<5765>11295\n<5766>3596\n<5767>11296\n<5768>5047\n<5769>5041\n<576a>3033\n<576b>5043\n<576c>11297\n<576d>5048\n<576e>11298\n<576f>3000\n<5773>5050\n<5776>5049\n<5777>2381\n<577b>5046\n<577c>5045\n<5782>1340\n<5783>2455\n<5784>2633\n<5785>5042\n<5786>5044\n<578b>3992\n<578c>5053\n<5792>2504\n<5793>5058\n<579b>1569\n<57a0>5059\n<57a1>5026\n<57a2>1809\n<57a3>4334\n<57a4>5052\n<57a5>11332\n<57a6>2398\n<57a7>5056\n<57a8>11333\n<57a9>5025\n<57aa>11334\n<57ab>1479\n<57ac>11335\n<57ad>5051\n<57ae>2418\n<57b2>5054\n<57b3>11339\n<57b4>5057\n<57b8>5065\n<57c2>1786\n<57c3>942\n<57cb>2712\n<57ce>1260\n<57cf>5055\n<57d2>5064\n<57d3>11363\n<57d4>3057\n<57d5>5060\n<57d8>5061\n<57d9>5063\n<57da>5062\n<57dd>5070\n<57de>11368\n<57df>4311\n<57e0>1153\n<57e1>9002\n<57e4>5069\n<57ed>5074\n<57ee>11379\n<57ef>5067\n<57f4>5066\n<57f7>8843\n<57f8>5068\n<57f9>2977\n<57fa>2062\n<57fd>5073\n<5800>5075\n<5801>11390\n<5802>3606\n<5805>8069\n<5806>1552\n<5807>5196\n<580a>8997\n<580b>5071\n<580c>11395\n<580d>5072\n<5811>3122\n<5815>1576\n<5816>9004\n<5819>5077\n<581d>9006\n<581e>5076\n<581f>11407\n<5820>5079\n<5821>1037\n<5824>1453\n<582a>2365\n<582f>8709\n<5830>4104\n<5831>7736\n<5834>7795\n<5835>1537\n<5844>5078\n<584a>8163\n<584b>9017\n<584c>3567\n<584d>6563\n<584e>11440\n<584f>9003\n<5850>11441\n<5851>3537\n<5852>9005\n<5853>11442\n<5854>3571\n<5857>8575\n<5858>3604\n<585e>3286\n<5862>8615\n<5863>11453\n<5864>9007\n<5865>5080\n<586b>3649\n<586c>5081\n<5875>7805\n<5879>8406\n<587e>5027\n<587f>11474\n<5880>5085\n<5881>5082\n<5882>11475\n<5883>2274\n<5884>11476\n<5885>3474\n<5889>5083\n<588a>7874\n<5892>3331\n<5893>2844\n<5899>3130\n<589a>5084\n<589b>11492\n<589c>8882\n<589d>11493\n<589e>4409\n<589f>4017\n<58a8>2830\n<58a9>1556\n<58ae>7903\n<58b3>7929\n<58bb>8409\n<58bc>5028\n<58bd>11517\n<58be>8157\n<58c1>1091\n<58c5>5029\n<58c6>11523\n<58c7>8551\n<58d1>5030\n<58d2>11533\n<58d3>8685\n<58d4>11534\n<58d5>1909\n<58d8>8199\n<58d9>8998\n<58da>9001\n<58de>8018\n<58df>8251\n<58e0>9000\n<58e1>11540\n<58e2>8999\n<58e3>11541\n<58e4>3227\n<58e9>7723\n<58ea>11546\n<58eb>3414\n<58ec>3236\n<58ed>11547\n<58ee>4624\n<58ef>8878\n<58f0>3378\n<58f3>2388\n<58f6>1967\n<58f9>4163\n<58fa>8009\n<58fd>8504\n<5902>5660\n<5903>11560\n<5904>1321\n<5907>1057\n<590d>1711\n<590e>11568\n<590f>3889\n<5914>4859\n<5915>3859\n<5916>3731\n<5919>4865\n<591a>1567\n<591b>11575\n<591c>4160\n<591f>1812\n<5922>8321\n<5923>11580\n<5924>5659\n<5925>5657\n<5926>11581\n<5927>1398\n<5928>11582\n<5929>3647\n<592a>3582\n<592b>1679\n<592c>11583\n<592d>4712\n<592e>4116\n<592f>1906\n<5930>11584\n<5931>3390\n<5934>3688\n<5937>4171\n<5938>2417\n<5939>2115\n<593a>1568\n<593b>11589\n<593c>5295\n<593d>11590\n<593e>8060\n<5941>5296\n<5942>5004\n<5943>11593\n<5944>4098\n<5947>3077\n<5948>2865\n<5949>1675\n<594a>11596\n<594b>1657\n<594e>2441\n<594f>4669\n<5950>11599\n<5951>3092\n<5954>1061\n<5955>5298\n<5956>2178\n<5957>3626\n<5958>5300\n<5959>11602\n<595a>5299\n<5960>1485\n<5961>11608\n<5962>3350\n<5965>973\n<5969>9051\n<596a>7902\n<596b>11614\n<596c>8098\n<596d>11615\n<596e>7930\n<5973>2927\n<5974>2924\n<5975>11620\n<5976>2863\n<5977>11621\n<5978>2140\n<5979>3570\n<597d>1914\n<5981>6005\n<5982>3266\n<5983>6006\n<5984>3758\n<5985>11628\n<5986>4622\n<5987>1721\n<5988>2703\n<5989>11629\n<598a>3244\n<598d>6007\n<5992>1545\n<5993>2110\n<5996>4134\n<5997>6011\n<5998>11638\n<5999>2803\n<599d>8877\n<599e>6014\n<59a3>6010\n<59a4>6015\n<59a5>3720\n<59a8>1630\n<59ab>6013\n<59ae>2880\n<59af>6018\n<59b2>6017\n<59b9>2760\n<59ba>11658\n<59bb>3069\n<59be>6020\n<59c6>2842\n<59ca>6012\n<59cb>3411\n<59d0>2228\n<59d1>1820\n<59d2>6016\n<59d3>4000\n<59d4>3774\n<59d7>6019\n<59d8>6026\n<59d9>11677\n<59da>4141\n<59db>11678\n<59dc>2171\n<59dd>6023\n<59e3>6025\n<59e4>11684\n<59e5>2492\n<59e8>4179\n<59ec>2074\n<59f9>6027\n<59fa>11702\n<59fb>4221\n<59ff>4648\n<5a00>11706\n<5a01>3759\n<5a02>11707\n<5a03>3727\n<5a04>2637\n<5a07>2192\n<5a08>6024\n<5a09>6029\n<5a0c>6028\n<5a11>6032\n<5a12>11714\n<5a13>6034\n<5a18>2898\n<5a1c>2859\n<5a1f>2329\n<5a20>3368\n<5a23>6033\n<5a24>11726\n<5a25>1583\n<5a29>2793\n<5a31>4302\n<5a32>6030\n<5a33>11737\n<5a34>6031\n<5a35>11738\n<5a36>3197\n<5a3c>6039\n<5a40>6035\n<5a41>8255\n<5a46>3044\n<5a49>3746\n<5a4a>6037\n<5a55>6038\n<5a5a>2046\n<5a62>6040\n<5a66>7950\n<5a67>6036\n<5a6a>2466\n<5a6d>9209\n<5a74>4233\n<5a75>6041\n<5a76>3373\n<5a77>6045\n<5a7a>6046\n<5a7f>4033\n<5a92>2754\n<5a9a>2761\n<5a9b>6044\n<5aa7>9212\n<5aaa>6043\n<5ab2>6049\n<5ab3>3870\n<5ab4>11838\n<5ab5>6564\n<5ab8>6052\n<5abd>8297\n<5abe>6047\n<5ac1>2129\n<5ac2>3298\n<5ac9>2088\n<5acc>3904\n<5ad2>6050\n<5ad3>11860\n<5ad4>6051\n<5ad5>11861\n<5ad6>6056\n<5ad7>9207\n<5ad8>6058\n<5adc>6059\n<5ae0>6053\n<5ae1>1462\n<5ae2>11868\n<5ae3>6054\n<5ae6>6057\n<5ae9>2878\n<5aea>11873\n<5aeb>6048\n<5af1>6055\n<5af5>9206\n<5afb>9213\n<5b00>9208\n<5b08>9210\n<5b09>6060\n<5b0a>11898\n<5b0b>9214\n<5b0c>8104\n<5b16>6062\n<5b17>6061\n<5b18>11908\n<5b19>9217\n<5b21>9215\n<5b2a>9216\n<5b30>8737\n<5b31>11929\n<5b32>6063\n<5b33>11930\n<5b34>4876\n<5b37>6064\n<5b38>8482\n<5b40>6065\n<5b4c>9211\n<5b50>4656\n<5b51>6071\n<5b52>11954\n<5b53>6072\n<5b54>2404\n<5b55>4371\n<5b56>11955\n<5b57>4659\n<5b58>1385\n<5b59>3556\n<5b5a>6068\n<5b5b>4729\n<5b5c>4651\n<5b5d>3949\n<5b5e>11956\n<5b5f>2772\n<5b62>6073\n<5b63>2097\n<5b64>1819\n<5b65>6069\n<5b66>4048\n<5b69>1881\n<5b6a>2678\n<5b6b>8538\n<5b6c>4705\n<5b70>3458\n<5b71>5994\n<5b72>11964\n<5b73>6070\n<5b74>11965\n<5b75>1682\n<5b78>8677\n<5b79>11968\n<5b7a>3265\n<5b7d>2904\n<5b7e>11971\n<5b7f>8279\n<5b80>5934\n<5b81>2913\n<5b82>11972\n<5b83>3569\n<5b84>5935\n<5b85>4429\n<5b86>11973\n<5b87>4307\n<5b88>3439\n<5b89>957\n<5b8a>11974\n<5b8b>3523\n<5b8c>3739\n<5b8f>1953\n<5b93>5937\n<5b94>11980\n<5b95>5936\n<5b96>11981\n<5b97>4663\n<5b98>1842\n<5b99>4581\n<5b9a>1511\n<5b9b>3745\n<5b9c>4178\n<5b9d>1039\n<5b9e>3404\n<5b9f>11982\n<5ba0>1293\n<5ba1>3372\n<5ba2>2394\n<5ba3>4038\n<5ba4>3433\n<5ba5>5938\n<5ba6>2007\n<5baa>3913\n<5bab>1797\n<5bb0>4378\n<5bb3>1885\n<5bb4>4112\n<5bb5>3945\n<5bb6>2117\n<5bb7>11992\n<5bb8>5939\n<5bb9>3256\n<5bbd>2426\n<5bbe>1119\n<5bbf>3539\n<5bc2>2104\n<5bc3>11998\n<5bc4>2103\n<5bc5>4225\n<5bc6>2785\n<5bc7>2409\n<5bcc>1718\n<5bd0>2759\n<5bd1>12006\n<5bd2>1893\n<5bd3>4325\n<5bdd>3163\n<5bde>2834\n<5bdf>1203\n<5be0>12016\n<5be1>1834\n<5be2>8421\n<5be3>12017\n<5be4>5943\n<5be5>2577\n<5be6>8495\n<5be7>8355\n<5be8>4432\n<5be9>8481\n<5bea>12018\n<5beb>8660\n<5bec>8165\n<5bed>12019\n<5bee>5944\n<5bef>12020\n<5bf0>5946\n<5bf5>7818\n<5bf6>7735\n<5bf7>12025\n<5bf8>1386\n<5bf9>1555\n<5bfa>3511\n<5bfb>4057\n<5bfc>1437\n<5bff>3440\n<5c00>12028\n<5c01>1663\n<5c04>3357\n<5c05>12031\n<5c06>2172\n<5c07>8094\n<5c08>8870\n<5c09>3789\n<5c0a>4685\n<5c0b>8680\n<5c0c>12032\n<5c0d>7898\n<5c0e>7865\n<5c0f>3948\n<5c10>12033\n<5c11>3346\n<5c14>1594\n<5c15>6066\n<5c16>2133\n<5c17>12036\n<5c18>1251\n<5c19>12037\n<5c1a>3337\n<5c1b>12038\n<5c1c>6067\n<5c1d>1223\n<5c22>5302\n<5c23>12043\n<5c24>4269\n<5c25>5303\n<5c26>12044\n<5c27>4137\n<5c2c>5304\n<5c31>2300\n<5c34>5305\n<5c37>9052\n<5c38>3395\n<5c39>4227\n<5c3a>1284\n<5c3b>5990\n<5c3c>2884\n<5c3d>2256\n<5c3e>3777\n<5c3f>2901\n<5c40>2309\n<5c41>3015\n<5c42>1194\n<5c45>2306\n<5c48>3193\n<5c49>3646\n<5c4a>2237\n<5c4b>3820\n<5c4e>3409\n<5c4f>3040\n<5c50>5992\n<5c51>3975\n<5c55>4442\n<5c59>5993\n<5c5e>3467\n<5c5f>12073\n<5c60>3697\n<5c61>2668\n<5c62>8272\n<5c63>5995\n<5c64>7783\n<5c65>2667\n<5c66>5996\n<5c67>12074\n<5c68>9204\n<5c6c>8510\n<5c6d>12078\n<5c6e>6004\n<5c6f>3710\n<5c70>12079\n<5c71>3318\n<5c79>4192\n<5c7a>5548\n<5c7f>4305\n<5c80>12091\n<5c81>3551\n<5c82>3088\n<5c88>5552\n<5c8c>5547\n<5c8d>5549\n<5c90>5550\n<5c91>5555\n<5c94>1204\n<5c95>12104\n<5c96>5551\n<5c97>1749\n<5c9a>5556\n<5c9b>1435\n<5c9c>5557\n<5ca1>7958\n<5ca2>5559\n<5ca3>5564\n<5ca9>4091\n<5caa>12114\n<5cab>5562\n<5cac>5561\n<5cad>2612\n<5cb1>5563\n<5cb2>12118\n<5cb3>4355\n<5cb4>12119\n<5cb5>5558\n<5cb6>12120\n<5cb7>5566\n<5cb8>961\n<5cbd>5560\n<5cbe>12125\n<5cbf>2438\n<5cc0>12126\n<5cc1>5565\n<5cc4>5567\n<5ccb>5570\n<5cd2>5568\n<5cd9>4548\n<5ce1>3884\n<5ce4>5569\n<5ce5>5571\n<5ce6>2676\n<5ce7>12156\n<5ce8>1578\n<5ce9>12157\n<5cea>4317\n<5ced>3146\n<5cf0>1666\n<5cf4>9097\n<5cf5>12165\n<5cf6>7863\n<5cfb>2349\n<5cfc>12170\n<5cfd>8628\n<5d06>5579\n<5d07>1292\n<5d0d>9103\n<5d0e>3080\n<5d14>1377\n<5d15>12187\n<5d16>4075\n<5d17>7962\n<5d1b>5580\n<5d1e>5578\n<5d24>5577\n<5d25>12198\n<5d26>5575\n<5d27>5574\n<5d28>12199\n<5d29>1065\n<5d2c>9099\n<5d2d>4441\n<5d2e>5576\n<5d34>5583\n<5d3d>5584\n<5d3e>5582\n<5d47>6946\n<5d4a>5591\n<5d4b>5590\n<5d4c>3123\n<5d50>9098\n<5d58>5581\n<5d5b>5586\n<5d5c>12237\n<5d5d>5588\n<5d69>5592\n<5d6a>12249\n<5d6b>5589\n<5d6c>5585\n<5d6f>5587\n<5d74>5593\n<5d81>9105\n<5d82>5594\n<5d83>12268\n<5d84>8817\n<5d87>9096\n<5d97>9102\n<5d98>12286\n<5d99>5595\n<5d9d>5596\n<5da0>9101\n<5da7>9100\n<5db7>5598\n<5db8>9104\n<5db9>12313\n<5dba>8243\n<5dbb>12314\n<5dbc>8764\n<5dc5>5599\n<5dcb>8169\n<5dcc>12328\n<5dcd>3760\n<5dd2>8277\n<5dd3>12333\n<5dd4>9106\n<5ddb>6165\n<5ddc>12340\n<5ddd>1323\n<5dde>4572\n<5de1>4059\n<5de2>1239\n<5de5>1789\n<5de6>4688\n<5de7>3142\n<5de8>2317\n<5de9>1799\n<5dea>12345\n<5deb>3814\n<5dee>1205\n<5def>5023\n<5df0>8996\n<5df1>2093\n<5df2>4184\n<5df3>3517\n<5df4>984\n<5df7>3932\n<5dfd>4855\n<5dfe>2238\n<5e01>1083\n<5e02>3431\n<5e03>1155\n<5e04>12357\n<5e05>3484\n<5e06>1608\n<5e07>12358\n<5e08>3389\n<5e0c>3856\n<5e0f>5534\n<5e10>4459\n<5e11>5537\n<5e14>5536\n<5e15>2946\n<5e16>3662\n<5e17>12366\n<5e18>2554\n<5e19>5535\n<5e1a>4578\n<5e1b>1142\n<5e1c>4547\n<5e1d>1468\n<5e25>8515\n<5e26>1403\n<5e27>4512\n<5e2b>8489\n<5e2c>12377\n<5e2d>3868\n<5e2e>1018\n<5e31>5538\n<5e32>12380\n<5e33>8823\n<5e36>7847\n<5e37>5541\n<5e38>1224\n<5e3d>2742\n<5e40>8837\n<5e41>12387\n<5e42>2786\n<5e43>9092\n<5e44>5542\n<5e45>1686\n<5e4c>2020\n<5e54>5543\n<5e55>2846\n<5e56>12401\n<5e57>9095\n<5e58>9094\n<5e5b>5544\n<5e5e>5545\n<5e5f>8848\n<5e60>12406\n<5e61>5546\n<5e62>1332\n<5e63>7748\n<5e6b>7730\n<5e6c>9093\n<5e72>1732\n<5e73>3036\n<5e74>2893\n<5e75>12419\n<5e76>1129\n<5e77>12420\n<5e78>3997\n<5e79>7955\n<5e7a>6163\n<5e7b>2008\n<5e7c>4284\n<5e7d>4265\n<5e7e>8051\n<5e7f>1852\n<5e80>5681\n<5e84>4620\n<5e85>12424\n<5e86>3177\n<5e87>1084\n<5e8a>1333\n<5e8b>5683\n<5e8f>4029\n<5e90>2645\n<5e91>5682\n<5e92>12430\n<5e93>2415\n<5e94>4235\n<5e95>1464\n<5e96>5684\n<5e97>1483\n<5e98>12431\n<5e99>2802\n<5e9a>1784\n<5e9b>12432\n<5e9c>1705\n<5e9d>12433\n<5e9e>2964\n<5e9f>1644\n<5ea0>5686\n<5ea5>5685\n<5ea6>1543\n<5ea7>4694\n<5eab>8160\n<5eac>12441\n<5ead>3670\n<5eb3>5690\n<5eb4>12447\n<5eb5>5688\n<5eb6>3475\n<5eb7>2370\n<5eb8>4254\n<5eb9>5687\n<5ebe>5689\n<5ec9>2551\n<5eca>2483\n<5ed1>5693\n<5ed2>5692\n<5ed3>2453\n<5ed6>2583\n<5edb>5694\n<5edf>8327\n<5ee0>7800\n<5ee1>9134\n<5ee2>7926\n<5ee3>7985\n<5ee8>5695\n<5ee9>12481\n<5eea>5696\n<5eeb>12482\n<5eec>8261\n<5ef3>8568\n<5ef4>5016\n<5ef5>12489\n<5ef6>4092\n<5ef7>3667\n<5efa>2169\n<5efe>5293\n<5eff>4699\n<5f00>2359\n<5f01>5021\n<5f02>4211\n<5f03>3097\n<5f04>2923\n<5f08>5294\n<5f09>12498\n<5f0a>1088\n<5f0b>5366\n<5f0f>3412\n<5f10>12502\n<5f11>5369\n<5f12>12503\n<5f13>1798\n<5f14>12504\n<5f15>4228\n<5f16>12505\n<5f17>1696\n<5f18>1954\n<5f1b>1279\n<5f1f>1469\n<5f20>4454\n<5f25>2779\n<5f26>3903\n<5f27>1974\n<5f28>12515\n<5f29>5999\n<5f2a>5998\n<5f2d>6000\n<5f2e>12518\n<5f2f>3733\n<5f30>12519\n<5f31>3280\n<5f32>12520\n<5f33>9205\n<5f34>12521\n<5f35>8821\n<5f39>1424\n<5f3a>3132\n<5f3b>12525\n<5f3c>6002\n<5f40>6590\n<5f46>9838\n<5f47>12534\n<5f48>7856\n<5f4c>8323\n<5f4d>12538\n<5f4e>8584\n<5f4f>12539\n<5f50>5986\n<5f51>12540\n<5f52>1858\n<5f53>1426\n<5f54>12541\n<5f55>2659\n<5f56>5988\n<5f57>5987\n<5f58>5989\n<5f59>9852\n<5f5d>4180\n<5f61>5614\n<5f62>3993\n<5f63>12548\n<5f64>3679\n<5f65>12549\n<5f66>4110\n<5f69>1169\n<5f6a>1108\n<5f6b>12552\n<5f6c>1115\n<5f6d>2990\n<5f70>4452\n<5f71>4245\n<5f72>12555\n<5f73>5600\n<5f77>5601\n<5f78>12559\n<5f79>4194\n<5f7a>12560\n<5f7b>1246\n<5f7c>1076\n<5f80>3754\n<5f81>4504\n<5f82>5602\n<5f83>12564\n<5f84>2277\n<5f85>1408\n<5f86>12565\n<5f87>5603\n<5f88>1939\n<5f89>5604\n<5f8a>1991\n<5f8b>2672\n<5f8c>5605\n<5f90>4023\n<5f91>8133\n<5f92>3694\n<5f95>5606\n<5f96>12571\n<5f97>1444\n<5f98>2952\n<5f99>5607\n<5f9c>5608\n<5f9d>12574\n<5f9e>7841\n<5f9f>12575\n<5fa0>9107\n<5fa1>4318\n<5fa8>5609\n<5fa9>7947\n<5faa>4054\n<5fad>5610\n<5fae>3761\n<5fb5>5611\n<5fb6>12590\n<5fb7>1443\n<5fb8>12591\n<5fb9>7804\n<5fbc>5612\n<5fbd>2026\n<5fc3>3983\n<5fc4>5698\n<5fc5>1089\n<5fc6>4203\n<5fc9>5699\n<5fcc>2108\n<5fcd>3239\n<5fce>12603\n<5fcf>5701\n<5fd0>6668\n<5fd1>6667\n<5fd2>5367\n<5fd6>5700\n<5fd7>4541\n<5fd8>3757\n<5fd9>2731\n<5fdd>5763\n<5fe0>4561\n<5fe1>5705\n<5fe4>5706\n<5fe7>4268\n<5fea>5710\n<5feb>2425\n<5fec>12618\n<5fed>5711\n<5fee>5703\n<5ff1>1253\n<5ff5>2897\n<5ff8>5712\n<5ffb>3982\n<5ffc>12628\n<5ffd>1965\n<5ffe>5707\n<5fff>1659\n<6000>1992\n<6001>3583\n<6002>3520\n<6003>5702\n<6004>5704\n<600a>5721\n<600d>5718\n<600e>4408\n<600f>5717\n<6012>2926\n<6013>12636\n<6014>4507\n<6015>2947\n<6016>1159\n<6019>5713\n<601a>12639\n<601b>5716\n<601c>2552\n<601d>3505\n<6020>1410\n<6021>5723\n<6025>2084\n<6026>5715\n<6027>3999\n<6028>4348\n<6029>5719\n<602a>1839\n<602b>5720\n<602f>3152\n<6035>5714\n<603b>4665\n<603c>6669\n<603f>5722\n<6040>12660\n<6041>6673\n<6042>5728\n<6043>3432\n<604b>2558\n<604c>12668\n<604d>2021\n<6050>2403\n<6051>12671\n<6052>1946\n<6055>3478\n<6059>6674\n<605a>6671\n<605d>6670\n<6062>2027\n<6063>6675\n<6064>4031\n<6067>6672\n<6068>1941\n<6069>1590\n<606a>5729\n<606b>1521\n<606c>3652\n<606d>1792\n<606e>12685\n<606f>3855\n<6070>3102\n<6073>2399\n<6076>1584\n<6077>12690\n<607a>5727\n<607b>5726\n<607c>2872\n<607d>5730\n<607e>12691\n<607f>4262\n<6083>5735\n<6084>3137\n<6089>3857\n<608c>5737\n<608d>1902\n<6092>5736\n<6093>12705\n<6094>2031\n<6095>12706\n<6096>5731\n<609a>5732\n<609b>5738\n<609c>12710\n<609d>5734\n<609e>12711\n<609f>3841\n<60a0>4267\n<60a3>2001\n<60a6>4358\n<60a7>12716\n<60a8>2909\n<60ab>6676\n<60ac>4039\n<60ad>5733\n<60ae>12719\n<60af>2810\n<60b0>12720\n<60b1>5741\n<60b2>1048\n<60b3>12721\n<60b4>5746\n<60b5>9140\n<60b6>8318\n<60b7>12722\n<60b8>2101\n<60bb>5740\n<60bc>1440\n<60c5>3174\n<60c6>5744\n<60ca>2265\n<60cb>3744\n<60d1>2056\n<60d5>3643\n<60d8>5743\n<60d9>12746\n<60da>5745\n<60db>12747\n<60dc>3860\n<60dd>5742\n<60de>12748\n<60df>3768\n<60e0>2034\n<60e1>7907\n<60e6>1484\n<60e7>2324\n<60e8>1177\n<60e9>1266\n<60ea>12753\n<60eb>1058\n<60ec>5739\n<60ed>1176\n<60ee>1421\n<60ef>1848\n<60f0>1575\n<60f1>8341\n<60f2>9147\n<60f3>3928\n<60f4>5751\n<60f5>12754\n<60f6>2017\n<60f9>3234\n<60fa>3989\n<60fb>9145\n<6100>5752\n<6101>1299\n<6106>6677\n<6107>12765\n<6108>4319\n<6109>4297\n<610d>6678\n<610e>5753\n<610f>4201\n<6115>5749\n<611a>4291\n<611b>7720\n<611c>9149\n<611f>1739\n<6120>5747\n<6123>5750\n<6124>1660\n<6125>12782\n<6126>5748\n<6127>2445\n<612b>5754\n<6134>9141\n<6137>9146\n<613e>9139\n<613f>4347\n<6148>1355\n<6149>12810\n<614a>5755\n<614b>8546\n<614c>2010\n<614d>12811\n<614e>3376\n<6151>3358\n<6155>2848\n<6158>7774\n<6159>12819\n<615a>7773\n<615d>6679\n<615e>12822\n<615f>9143\n<6162>2724\n<6163>7983\n<6164>9439\n<6167>2032\n<6168>2363\n<6169>12827\n<616a>9138\n<616b>8526\n<616e>8274\n<616f>12830\n<6170>3790\n<6173>9148\n<6174>12833\n<6175>5756\n<6176>8427\n<6177>2371\n<6182>8754\n<618a>7743\n<618b>1112\n<618e>4410\n<618f>12853\n<6190>8219\n<6191>8380\n<6192>9150\n<6193>12854\n<6194>5758\n<619a>7854\n<619d>6681\n<61a4>7931\n<61a7>5759\n<61a8>1888\n<61a9>6680\n<61aa>12870\n<61ab>8329\n<61ac>5757\n<61ad>12871\n<61ae>9137\n<61b2>8644\n<61b6>8724\n<61b7>5760\n<61be>1901\n<61c2>1517\n<61c7>8158\n<61c8>3971\n<61c9>8739\n<61ca>974\n<61cb>6682\n<61cc>9142\n<61d1>6683\n<61d2>2476\n<61d3>12895\n<61d4>5761\n<61de>9868\n<61df>9438\n<61e3>9440\n<61e6>2932\n<61e7>12910\n<61e8>9144\n<61f2>7809\n<61f5>5762\n<61f6>8190\n<61f7>8017\n<61f8>8673\n<61f9>12922\n<61fa>9136\n<61fb>12923\n<61fc>8142\n<61fd>12924\n<61fe>8478\n<61ff>5088\n<6200>8225\n<6206>6684\n<6207>9441\n<6208>1765\n<6209>12930\n<620a>3835\n<620b>6393\n<620c>4018\n<620d>3472\n<620e>3249\n<620f>3876\n<6210>1262\n<6211>3809\n<6212>2229\n<6213>12931\n<6214>9379\n<6215>5790\n<6216>2055\n<6217>6394\n<6218>4446\n<6219>12932\n<621a>3068\n<621b>6395\n<621f>6396\n<6220>12936\n<6221>6398\n<6222>6397\n<6223>12937\n<6224>6400\n<6225>6399\n<6226>12938\n<6227>9380\n<622a>2217\n<622b>12941\n<622c>6401\n<622d>12942\n<622e>2661\n<622f>12943\n<6230>8819\n<6231>12944\n<6232>8624\n<6233>1348\n<6234>1402\n<6237>1980\n<623d>6644\n<623e>6643\n<623f>1628\n<6240>3566\n<6241>1099\n<6242>12952\n<6243>6645\n<6247>3329\n<624a>12956\n<624b>3437\n<624c>5306\n<624d>1164\n<624e>4413\n<6251>3050\n<6252>978\n<6253>1397\n<6254>3246\n<6258>3713\n<625b>2373\n<6263>2408\n<6266>3105\n<6267>4531\n<6268>12973\n<6269>2452\n<626a>5307\n<626b>3297\n<626c>4120\n<626d>2917\n<626e>1010\n<626f>1243\n<6270>3232\n<6273>1005\n<6276>1683\n<6279>3003\n<627c>1586\n<627d>12982\n<627e>4467\n<627f>1269\n<6280>2095\n<6284>1234\n<6289>2336\n<628a>988\n<6291>4189\n<6292>3450\n<6293>4610\n<6294>12996\n<6295>3687\n<6296>1525\n<6297>2374\n<6298>4476\n<6299>12997\n<629a>1698\n<629b>2968\n<629f>5308\n<62a0>2406\n<62a1>2684\n<62a2>3133\n<62a3>13001\n<62a4>1977\n<62a5>1041\n<62a8>2987\n<62ab>3004\n<62ac>3578\n<62b1>1040\n<62b5>1463\n<62b9>2827\n<62ba>13016\n<62bb>5309\n<62bc>4067\n<62bd>1294\n<62be>13017\n<62bf>2807\n<62c2>1684\n<62c3>13020\n<62c4>4595\n<62c5>1412\n<62c6>1207\n<62c7>2839\n<62c8>2892\n<62c9>2456\n<62ca>5310\n<62cb>13021\n<62cc>1011\n<62cd>2949\n<62ce>2601\n<62cf>13022\n<62d0>1838\n<62d1>13023\n<62d2>2315\n<62d3>3721\n<62d4>985\n<62d5>13024\n<62d6>3712\n<62d7>5312\n<62d8>2303\n<62d9>4635\n<62da>5311\n<62db>4465\n<62dc>1000\n<62df>2885\n<62e2>2634\n<62e3>2147\n<62e4>13029\n<62e5>4250\n<62e6>2468\n<62e7>2914\n<62e8>1133\n<62e9>4404\n<62ec>2451\n<62ed>3418\n<62ee>5313\n<62ef>4509\n<62f0>13032\n<62f1>1801\n<62f2>13033\n<62f3>3208\n<62f4>3486\n<62f5>13034\n<62f6>5315\n<62f7>2378\n<62fc>3027\n<62fd>4612\n<62fe>3399\n<62ff>2854\n<6300>13039\n<6301>1275\n<6302>1835\n<6307>4535\n<6308>6478\n<6309>959\n<630e>2419\n<6311>3655\n<6316>3723\n<631a>4542\n<631b>2677\n<631c>13057\n<631d>3805\n<631e>3573\n<631f>3961\n<6320>2870\n<6321>1427\n<6322>5314\n<6323>4502\n<6324>2090\n<6325>2024\n<6328>943\n<6329>13060\n<632a>2931\n<632b>1391\n<632f>4498\n<6332>6479\n<6339>5316\n<633a>3671\n<633d>3741\n<633e>8657\n<6342>3829\n<6343>5318\n<6344>13077\n<6345>3682\n<6346>2449\n<6349>4634\n<634a>13080\n<634b>5317\n<634c>977\n<634d>1899\n<634e>3340\n<634f>2902\n<6350>2327\n<6355>1149\n<635e>2487\n<635f>3557\n<6360>13093\n<6361>2148\n<6362>2000\n<6363>1432\n<6367>2998\n<6368>8476\n<6369>5328\n<636a>13097\n<636b>9053\n<636c>13098\n<636d>5325\n<636e>2316\n<6371>5321\n<6372>9858\n<6376>1338\n<6377>2222\n<637a>5322\n<637b>2896\n<6380>3891\n<6381>13110\n<6382>1473\n<6383>8461\n<6384>8282\n<6387>1565\n<6388>3441\n<6389>1493\n<638a>5327\n<638b>13113\n<638c>4455\n<638d>13114\n<638e>5323\n<638f>3616\n<6390>3101\n<6391>13115\n<6392>2950\n<6396>4155\n<6397>13119\n<6398>2337\n<63a0>2682\n<63a1>13127\n<63a2>3600\n<63a3>1245\n<63a4>13128\n<63a5>2212\n<63a6>13129\n<63a7>2405\n<63a8>3703\n<63a9>4099\n<63aa>1390\n<63ab>13130\n<63ac>5326\n<63ad>5319\n<63ae>5329\n<63af>13131\n<63b0>6480\n<63b3>2647\n<63b4>5324\n<63b7>4543\n<63b8>1416\n<63b9>13136\n<63ba>1211\n<63bb>13137\n<63bc>5330\n<63bd>13138\n<63be>5340\n<63bf>13139\n<63c0>8077\n<63c4>5335\n<63c5>13143\n<63c6>5339\n<63c9>3259\n<63cd>4670\n<63ce>5337\n<63cf>2797\n<63d0>3636\n<63d1>13149\n<63d2>1196\n<63d6>4165\n<63da>8703\n<63de>5336\n<63df>13159\n<63e0>5333\n<63e1>3812\n<63e2>13160\n<63e3>1322\n<63e9>2360\n<63ea>2285\n<63ed>2211\n<63ee>8024\n<63f2>5331\n<63f3>13171\n<63f4>4337\n<63f5>13172\n<63f6>5320\n<63f7>13173\n<63f8>5332\n<63fd>2474\n<63fe>13178\n<63ff>5334\n<6400>1210\n<6401>1764\n<6402>2638\n<6405>2194\n<640b>5343\n<640c>5346\n<640d>8539\n<640e>13186\n<640f>1138\n<6410>1319\n<6413>1389\n<6414>3295\n<6417>7862\n<641b>5344\n<641c>3526\n<641d>13194\n<641e>1758\n<641f>13195\n<6420>5345\n<6421>5348\n<6426>5347\n<642a>3605\n<642b>13203\n<642c>1004\n<642d>1393\n<6434>5942\n<6435>13210\n<6436>8411\n<643a>3962\n<643d>1202\n<643e>13216\n<643f>6481\n<6440>13217\n<6441>5342\n<6444>3356\n<6445>5341\n<6446>997\n<6447>4136\n<6448>1120\n<6449>13220\n<644a>3586\n<6451>9056\n<6452>5338\n<6453>13227\n<6454>3481\n<6458>4427\n<645c>9057\n<645d>13234\n<645e>5349\n<645f>8256\n<6467>1376\n<6468>13242\n<6469>2825\n<646d>5351\n<646e>13246\n<646f>8846\n<6473>8159\n<6476>9054\n<6477>13252\n<647a>5353\n<647b>7786\n<6482>2581\n<6483>13259\n<6484>5350\n<6485>2334\n<6486>13260\n<6487>3025\n<6488>8194\n<6491>1258\n<6492>3281\n<6493>8339\n<6494>13269\n<6495>3503\n<6496>5352\n<6499>5356\n<649e>4623\n<649f>9055\n<64a3>7852\n<64a4>1244\n<64a5>7764\n<64a9>2572\n<64aa>13282\n<64ab>7944\n<64ac>3144\n<64ad>1132\n<64ae>1388\n<64af>13283\n<64b0>4616\n<64b1>13284\n<64b2>8384\n<64b3>9058\n<64b4>13285\n<64b5>2895\n<64b6>13286\n<64b9>13287\n<64ba>5357\n<64bb>8544\n<64bc>1898\n<64bd>13288\n<64be>8605\n<64bf>8078\n<64c0>5358\n<64c1>8749\n<64c2>2505\n<64c3>13289\n<64c4>8263\n<64c5>3324\n<64c6>13290\n<64c7>8802\n<64ca>8039\n<64cb>7858\n<64cc>13293\n<64cd>1184\n<64ce>3171\n<64cf>13294\n<64d0>5359\n<64d1>13295\n<64d2>3161\n<64d3>13296\n<64d4>7849\n<64d7>5360\n<64d8>6482\n<64d9>13299\n<64da>8140\n<64de>3528\n<64df>13303\n<64e0>8050\n<64e1>13304\n<64e2>5362\n<64e3>13305\n<64e4>5361\n<64e5>13306\n<64e6>1160\n<64ec>8344\n<64ef>7762\n<64f0>8356\n<64f1>7964\n<64f2>8847\n<64f3>13314\n<64f4>8173\n<64f7>9061\n<64fa>7725\n<64fb>8530\n<64fc>9062\n<64fd>13319\n<64fe>8442\n<64ff>13320\n<6500>2955\n<6504>9059\n<6505>13324\n<6506>8346\n<6509>5363\n<650f>8252\n<6512>4383\n<6513>13334\n<6514>8182\n<6515>13335\n<6516>9060\n<6517>13336\n<6518>3228\n<6519>7785\n<651a>13337\n<651b>9063\n<651c>13338\n<651d>8477\n<6522>8793\n<6523>8278\n<6524>8547\n<6525>5364\n<652a>8105\n<652b>2335\n<652c>8188\n<652d>13347\n<652e>5365\n<652f>4518\n<6534>6409\n<6535>6502\n<6536>3436\n<6537>13352\n<6538>4786\n<6539>1727\n<653a>13353\n<653b>1790\n<653e>1634\n<653f>4511\n<6545>1827\n<6548>3954\n<6549>7371\n<654c>1457\n<654f>2809\n<6550>13367\n<6551>2295\n<6555>6503\n<6556>968\n<6557>7726\n<6558>13371\n<6559>2205\n<655a>13372\n<655b>2555\n<655c>13373\n<655d>1087\n<655e>1229\n<6562>1741\n<6563>3291\n<6566>1559\n<656b>6504\n<656c>2275\n<6570>3476\n<6571>13386\n<6572>3136\n<6573>13387\n<6574>4508\n<6575>7868\n<6576>13388\n<6577>1680\n<6578>8514\n<6582>8222\n<6583>7747\n<6587>3795\n<658b>4428\n<658c>1116\n<6590>6593\n<6591>1002\n<6592>13407\n<6593>6595\n<6594>13408\n<6595>9428\n<6596>13409\n<6597>1526\n<6598>13410\n<6599>2584\n<659a>13411\n<659b>7510\n<659c>3964\n<659f>4486\n<65a0>13414\n<65a1>3810\n<65a4>2240\n<65a5>1287\n<65a6>13417\n<65a7>1702\n<65a8>13418\n<65a9>4439\n<65aa>13419\n<65ab>6697\n<65ac>8815\n<65ad>1550\n<65ae>13420\n<65af>3502\n<65b0>3981\n<65b7>7895\n<65b8>13427\n<65b9>1626\n<65bc>6596\n<65bd>3392\n<65c1>2965\n<65c2>13433\n<65c3>6599\n<65c4>6598\n<65c5>2666\n<65c6>6597\n<65cb>4040\n<65cc>6600\n<65cd>13438\n<65ce>6601\n<65cf>4674\n<65d2>6602\n<65d6>6603\n<65d7>3083\n<65e0>3821\n<65e1>13452\n<65e2>2107\n<65e5>3248\n<65e6>1418\n<65e7>2296\n<65e8>4539\n<65e9>4394\n<65ec>4055\n<65ed>4028\n<65f1>1900\n<65f6>3400\n<65f7>2434\n<65fa>3755\n<6600>6418\n<6601>13468\n<6602>965\n<6603>6416\n<6606>2448\n<660a>6413\n<660b>13474\n<660c>1220\n<660d>13475\n<660e>2812\n<660f>2045\n<6613>4190\n<6614>3843\n<6615>6417\n<6619>6414\n<661d>6421\n<661e>13485\n<661f>3986\n<6620>4248\n<6625>1341\n<6626>13490\n<6627>2758\n<6628>4687\n<662d>4466\n<662e>13495\n<662f>3422\n<6630>13496\n<6631>6423\n<6634>6422\n<6635>6425\n<6636>6424\n<663c>4582\n<663d>13504\n<663e>3905\n<6641>6429\n<6642>8493\n<6643>2019\n<664b>2251\n<664c>3335\n<664f>6430\n<6652>3314\n<6653>3947\n<6654>6428\n<6655>4369\n<6656>6431\n<6657>6433\n<665a>3742\n<665d>8859\n<665e>13522\n<665f>6427\n<6660>13523\n<6661>6432\n<6664>3837\n<6665>13526\n<6666>2035\n<6667>13527\n<6668>1252\n<666e>3060\n<666f>2271\n<6670>3849\n<6674>3172\n<6675>13536\n<6676>2262\n<6677>6434\n<667a>4550\n<667e>2569\n<6682>4384\n<6683>13545\n<6684>6435\n<6687>3883\n<6688>8790\n<6689>9384\n<668c>6436\n<6691>3461\n<6696>2928\n<6697>960\n<669d>6438\n<66a2>7801\n<66a7>6437\n<66a8>7389\n<66ab>8794\n<66ae>2845\n<66b4>1042\n<66b9>5979\n<66be>6439\n<66c4>9383\n<66c5>13593\n<66c6>9862\n<66c7>9382\n<66c8>13594\n<66c9>8654\n<66d6>9385\n<66d9>3462\n<66da>13609\n<66dd>3063\n<66e0>8167\n<66e6>6442\n<66e9>6443\n<66ec>8466\n<66f0>4350\n<66f1>13624\n<66f2>3191\n<66f3>4158\n<66f4>1783\n<66f7>6420\n<66f8>8508\n<66f9>1187\n<66fc>2723\n<66fd>13629\n<66fe>4411\n<66ff>3641\n<6700>4683\n<6703>8028\n<6708>4357\n<6709>4277\n<670a>6515\n<670b>2996\n<670c>13636\n<670d>1691\n<6710>6532\n<6714>3500\n<6715>6542\n<6716>13642\n<6717>2485\n<671b>3756\n<671c>13646\n<671d>1236\n<671e>13647\n<671f>3065\n<6726>6572\n<6727>9412\n<6728>2849\n<6729>13654\n<672a>3779\n<672b>2828\n<672c>1063\n<672d>4416\n<672e>13655\n<672f>3468\n<6730>13656\n<6731>4587\n<6734>3058\n<6735>1571\n<673a>2063\n<673d>4011\n<6740>3306\n<6741>13667\n<6742>4374\n<6743>3203\n<6746>1734\n<6747>13670\n<6748>6228\n<6749>3317\n<674c>6225\n<674d>13673\n<674e>2521\n<674f>3998\n<6750>1163\n<6751>1384\n<6752>13674\n<6753>6226\n<6756>4457\n<675c>1540\n<675d>13682\n<675e>6227\n<675f>3471\n<6760>1751\n<6761>3656\n<6765>2463\n<6768>4119\n<6769>6229\n<676a>6232\n<676d>1907\n<676e>13690\n<676f>1046\n<6770>2221\n<6771>7884\n<6772>6415\n<6773>6233\n<6774>13691\n<6775>6236\n<6776>13692\n<6777>6241\n<677c>6242\n<677d>13697\n<677e>3518\n<677f>1008\n<6780>13698\n<6781>2078\n<6784>1810\n<6787>6231\n<6788>13703\n<6789>3752\n<678a>13704\n<678b>6240\n<6790>3845\n<6795>4494\n<6796>13713\n<6797>2591\n<6798>6234\n<6799>13714\n<679a>2747\n<679b>13715\n<679c>1876\n<679d>4517\n<679e>6238\n<67a2>3447\n<67a3>4393\n<67a4>13719\n<67a5>6230\n<67a6>13720\n<67a7>6235\n<67a8>6237\n<67a9>13721\n<67aa>3126\n<67ab>1664\n<67ac>13722\n<67ad>6239\n<67ae>13723\n<67af>2410\n<67b0>6248\n<67b3>6253\n<67b4>13726\n<67b5>6251\n<67b6>2127\n<67b7>2114\n<67b8>6257\n<67c1>6260\n<67c2>13735\n<67c3>6256\n<67c4>1123\n<67cf>995\n<67d0>2838\n<67d1>1735\n<67d2>3073\n<67d3>3225\n<67d4>3260\n<67d8>6245\n<67d9>6250\n<67da>6252\n<67db>13749\n<67dc>1866\n<67dd>6254\n<67de>4690\n<67df>13750\n<67e0>2910\n<67e1>13751\n<67e2>6258\n<67e5>1200\n<67e9>6247\n<67ec>2144\n<67ef>2383\n<67f0>6243\n<67f1>4600\n<67f2>13761\n<67f3>2625\n<67f4>1208\n<67fd>6261\n<67fe>13770\n<67ff>3416\n<6800>6255\n<6805>4421\n<6806>13775\n<6807>1107\n<6808>4444\n<6809>6244\n<680a>6246\n<680b>1519\n<680c>6249\n<680d>13776\n<680e>6259\n<680f>2467\n<6810>13777\n<6811>3470\n<6812>13778\n<6813>3485\n<6816>3067\n<6817>2528\n<681d>6271\n<6821>3950\n<6829>6280\n<682a>4585\n<6837>4130\n<6838>1922\n<6839>1780\n<683c>1772\n<683d>4375\n<683e>6277\n<683f>13808\n<6840>6276\n<6841>6274\n<6842>1865\n<6843>3621\n<6844>6268\n<6845>3765\n<6846>2431\n<6847>13809\n<6848>963\n<6849>6279\n<684a>6278\n<684b>13810\n<684c>4637\n<684d>13811\n<684e>6266\n<684f>13812\n<6850>3674\n<6851>3292\n<6852>13813\n<6853>1997\n<6854>2220\n<6855>6272\n<6862>6267\n<6863>1430\n<6864>6269\n<6865>3138\n<6866>6273\n<6867>6275\n<6868>2177\n<6869>4619\n<686a>13824\n<686b>6286\n<6874>6283\n<6875>13833\n<6876>3681\n<6877>6284\n<6881>2563\n<6882>13843\n<6883>6270\n<6884>13844\n<6885>2748\n<6886>1019\n<688f>6282\n<6893>6285\n<6897>1788\n<6898>9322\n<689d>8565\n<689e>13863\n<689f>9325\n<68a2>3339\n<68a6>2771\n<68a7>3823\n<68a8>2513\n<68ad>3560\n<68ae>13873\n<68af>3632\n<68b0>3968\n<68b3>3448\n<68b4>13876\n<68b5>6281\n<68c0>2143\n<68c1>13887\n<68c2>6287\n<68c9>2787\n<68ca>13894\n<68cb>3076\n<68cc>13895\n<68cd>1872\n<68d2>1023\n<68d5>4661\n<68d6>9323\n<68d7>8799\n<68d8>2079\n<68d9>13902\n<68da>2992\n<68df>7886\n<68e0>3607\n<68e3>6298\n<68e7>8818\n<68ee>3302\n<68ef>13918\n<68f0>6294\n<68f1>2509\n<68f5>2384\n<68f9>6292\n<68fa>1840\n<68fb>13925\n<68fc>6289\n<6901>6296\n<6905>4181\n<690b>6295\n<690c>13938\n<690d>4529\n<690e>4626\n<690f>9331\n<6910>6299\n<6911>13939\n<6912>2184\n<6924>6293\n<692d>3719\n<6930>4147\n<6934>6310\n<6939>6301\n<693d>1325\n<693e>13975\n<693f>1342\n<6942>6303\n<694a>8702\n<6953>7934\n<6954>3955\n<6957>6297\n<695a>1315\n<695d>6304\n<695e>2510\n<695f>13999\n<6960>6302\n<6963>6317\n<6966>6316\n<6967>14004\n<6968>9333\n<696b>6306\n<696c>14007\n<696d>8714\n<696e>6288\n<6971>6300\n<6975>8047\n<6976>14013\n<6977>2361\n<6978>6309\n<6979>6318\n<697c>2636\n<6980>6307\n<6981>14019\n<6982>1728\n<6983>14020\n<6984>6305\n<6985>14021\n<6986>4289\n<6989>6315\n<698d>6331\n<6994>2481\n<6995>6329\n<6998>6308\n<699b>6319\n<699c>1020\n<69a7>6320\n<69a8>4422\n<69a9>14045\n<69aa>9320\n<69ab>6322\n<69ac>14046\n<69ad>6323\n<69ae>8448\n<69b1>6325\n<69b4>2618\n<69b7>3217\n<69bb>6321\n<69bf>9334\n<69c0>14059\n<69c1>6326\n<69ca>6327\n<69cb>7975\n<69cc>6311\n<69cd>8407\n<69ce>6314\n<69cf>14068\n<69d0>1990\n<69d4>6324\n<69db>2154\n<69df>6328\n<69e0>6330\n<69e7>9340\n<69ed>6334\n<69f2>6338\n<69f3>8097\n<69fd>1186\n<69fe>14105\n<69ff>6332\n<6a00>14106\n<6a01>8874\n<6a02>8197\n<6a05>9324\n<6a0a>1611\n<6a13>8254\n<6a19>7756\n<6a1e>8506\n<6a1f>4450\n<6a20>14128\n<6a21>2822\n<6a22>14129\n<6a23>8708\n<6a28>6348\n<6a29>14134\n<6a2a>1944\n<6a2f>6333\n<6a30>14139\n<6a31>4232\n<6a35>6344\n<6a38>8387\n<6a39>8512\n<6a3a>9335\n<6a3d>6347\n<6a3e>6340\n<6a44>6339\n<6a47>3134\n<6a48>9332\n<6a4b>8413\n<6a50>6342\n<6a58>6349\n<6a59>1261\n<6a5a>14167\n<6a5b>6343\n<6a5f>8040\n<6a60>14171\n<6a61>3933\n<6a62>8581\n<6a65>6337\n<6a71>1308\n<6a79>6346\n<6a7c>6350\n<6a80>3591\n<6a84>3866\n<6a89>9330\n<6a8e>6345\n<6a8f>14208\n<6a90>6352\n<6a91>6351\n<6a94>7861\n<6a97>6354\n<6a9c>9336\n<6aa0>6341\n<6aa1>14220\n<6aa2>8075\n<6aa3>9348\n<6aa9>6353\n<6aaa>14226\n<6aab>6355\n<6aac>2767\n<6aaf>9881\n<6ab3>9346\n<6ab8>8353\n<6abb>8082\n<6ac3>7992\n<6ad3>9349\n<6ada>9344\n<6adb>9326\n<6adc>14266\n<6add>9339\n<6ade>9350\n<6adf>9329\n<6ae7>9347\n<6ae8>9328\n<6ae9>14274\n<6aea>9321\n<6aeb>14275\n<6aec>9343\n<6af3>9327\n<6af8>9345\n<6afb>8736\n<6b04>8181\n<6b0a>8436\n<6b0f>9341\n<6b12>9337\n<6b16>9342\n<6b1e>9338\n<6b1f>14317\n<6b20>3124\n<6b21>1361\n<6b22>1995\n<6b23>3979\n<6b24>6577\n<6b27>2936\n<6b32>4320\n<6b37>6578\n<6b38>14334\n<6b39>6579\n<6b3a>3066\n<6b3d>8419\n<6b3e>2427\n<6b43>6580\n<6b46>6581\n<6b47>3957\n<6b48>14343\n<6b49>3125\n<6b4c>1763\n<6b50>8365\n<6b59>6582\n<6b5f>9419\n<6b60>14362\n<6b61>8019\n<6b62>4536\n<6b63>4510\n<6b64>1358\n<6b65>1156\n<6b66>3827\n<6b67>3078\n<6b6a>3730\n<6b72>8537\n<6b77>8211\n<6b78>7987\n<6b79>1400\n<6b7a>14376\n<6b7b>3509\n<6b7c>2130\n<6b83>4115\n<6b84>6361\n<6b85>14381\n<6b86>1404\n<6b87>6360\n<6b88>14382\n<6b89>4060\n<6b8a>3449\n<6b8b>1175\n<6b8c>14383\n<6b8d>6364\n<6b96>4530\n<6b97>14390\n<6b98>7772\n<6b99>14391\n<6b9e>9352\n<6ba1>6367\n<6ba4>9351\n<6baa>6368\n<6bab>9354\n<6bae>9353\n<6baf>9355\n<6bb2>8067\n<6bb3>6589\n<6bb4>2938\n<6bb5>1549\n<6bb6>14407\n<6bb7>4218\n<6bba>8463\n<6bbb>8155\n<6bbf>1487\n<6bc0>14413\n<6bc1>2030\n<6bc2>6591\n<6bc5>4202\n<6bc6>8367\n<6bcb>3826\n<6bcc>14420\n<6bcd>2843\n<6bce>14421\n<6bcf>2756\n<6bd2>1533\n<6bd3>4719\n<6bd4>1073\n<6bd5>1080\n<6bd6>1082\n<6bd7>3007\n<6bd8>14424\n<6bd9>1081\n<6bda>14425\n<6bdb>2736\n<6be1>4434\n<6bea>6484\n<6beb>1912\n<6bef>3597\n<6bf3>6485\n<6bf4>14445\n<6bf5>6487\n<6bf9>6488\n<6bfd>6486\n<6bfe>14452\n<6bff>9408\n<6c05>6489\n<6c06>6491\n<6c07>6490\n<6c08>8813\n<6c0c>9409\n<6c0d>6492\n<6c0e>14461\n<6c0f>3430\n<6c10>4715\n<6c11>2806\n<6c12>14462\n<6c13>2730\n<6c14>3095\n<6c15>6493\n<6c16>2861\n<6c17>14463\n<6c1b>1650\n<6c1f>1687\n<6c20>14467\n<6c21>6497\n<6c22>3167\n<6c23>8394\n<6c24>6499\n<6c25>14468\n<6c26>1883\n<6c27>4126\n<6c28>956\n<6c29>6498\n<6c2a>6500\n<6c2b>8423\n<6c2c>9410\n<6c2d>14469\n<6c2e>1419\n<6c2f>2671\n<6c30>3173\n<6c31>14470\n<6c32>6501\n<6c33>14471\n<6c34>3491\n<6c35>5791\n<6c38>4261\n<6c3d>4847\n<6c40>3666\n<6c41>4524\n<6c42>3184\n<6c46>4852\n<6c47>2040\n<6c48>14483\n<6c49>1905\n<6c4a>5794\n<6c50>3864\n<6c54>5792\n<6c55>3328\n<6c56>14492\n<6c57>1904\n<6c5b>4061\n<6c5c>5793\n<6c5d>3269\n<6c5e>1800\n<6c5f>2174\n<6c60>1277\n<6c61>3818\n<6c64>3603\n<6c6a>3749\n<6c70>3584\n<6c71>14506\n<6c72>2086\n<6c73>14507\n<6c74>5802\n<6c75>14508\n<6c76>5803\n<6c79>4005\n<6c7d>3098\n<6c7e>1655\n<6c81>3164\n<6c82>4177\n<6c83>3813\n<6c84>14516\n<6c85>5796\n<6c86>5804\n<6c87>14517\n<6c88>3371\n<6c89>1254\n<6c8c>5799\n<6c8f>3074\n<6c90>5797\n<6c93>6687\n<6c94>5798\n<6c99>3308\n<6c9a>14528\n<6c9b>2983\n<6c9f>1806\n<6ca0>14532\n<6ca1>2752\n<6ca2>14533\n<6ca3>5795\n<6ca4>2942\n<6ca5>2541\n<6ca6>2688\n<6ca7>1182\n<6ca8>14534\n<6ca9>5805\n<6caa>1979\n<6cab>2832\n<6cac>14535\n<6cad>5808\n<6cae>2313\n<6cb1>5819\n<6cb2>5813\n<6cb3>1930\n<6cb8>1645\n<6cb9>4274\n<6cba>14542\n<6cbb>4557\n<6cbc>4468\n<6cbd>1818\n<6cbe>4437\n<6cbf>4097\n<6cc4>3972\n<6cc5>3187\n<6cc9>3205\n<6cca>1147\n<6ccb>14550\n<6ccc>2783\n<6cd0>5806\n<6cd3>5820\n<6cd4>5807\n<6cd5>1605\n<6cd6>5815\n<6cd7>5812\n<6cdb>1623\n<6cde>2915\n<6cdf>14561\n<6ce0>5814\n<6ce1>2974\n<6ce2>1135\n<6ce3>3099\n<6ce4>14562\n<6ce5>2883\n<6ce8>4607\n<6ce9>14565\n<6cea>2508\n<6ceb>5817\n<6cee>5818\n<6cef>5821\n<6cf0>3580\n<6cf1>5811\n<6cf2>14568\n<6cf3>4259\n<6cf4>14569\n<6cf5>1068\n<6cf6>6688\n<6cf9>14570\n<6cfa>5816\n<6cfb>3973\n<6cfc>3042\n<6cfd>4406\n<6cfe>5822\n<6d01>2225\n<6d04>5829\n<6d07>5828\n<6d0b>4124\n<6d0c>5825\n<6d0d>14580\n<6d0e>5831\n<6d12>3282\n<6d17>3873\n<6d18>14588\n<6d19>5830\n<6d1a>5836\n<6d1b>2700\n<6d1e>1523\n<6d25>2243\n<6d26>14597\n<6d27>5824\n<6d2a>1952\n<6d2b>5832\n<6d2e>5834\n<6d31>1596\n<6d32>4573\n<6d33>5840\n<6d34>14604\n<6d35>5835\n<6d39>5823\n<6d3a>14608\n<6d3b>2051\n<6d3c>3726\n<6d3d>3103\n<6d3e>2954\n<6d41>2624\n<6d42>14611\n<6d43>5826\n<6d44>14612\n<6d45>3120\n<6d46>2173\n<6d47>2190\n<6d48>5827\n<6d49>14613\n<6d4a>4644\n<6d4b>1193\n<6d4c>14614\n<6d4d>5833\n<6d4e>2102\n<6d4f>5837\n<6d50>14615\n<6d51>2048\n<6d52>5838\n<6d53>2921\n<6d54>5839\n<6d59>4484\n<6d5a>2352\n<6d5b>14620\n<6d5c>5848\n<6d5d>14621\n<6d5e>5845\n<6d5f>14622\n<6d60>5849\n<6d63>5851\n<6d66>3061\n<6d69>1917\n<6d6a>2486\n<6d6e>1692\n<6d6f>5842\n<6d74>4324\n<6d77>1882\n<6d78>2255\n<6d79>9180\n<6d7c>5850\n<6d82>3696\n<6d85>2908\n<6d86>14647\n<6d87>9179\n<6d88>3944\n<6d89>3359\n<6d8c>4260\n<6d8d>14650\n<6d8e>3902\n<6d91>5841\n<6d92>14653\n<6d95>3644\n<6d9b>3617\n<6d9c>14659\n<6d9d>2495\n<6d9e>5843\n<6d9f>2553\n<6da0>5844\n<6da1>3807\n<6da2>14660\n<6da3>2006\n<6da4>1460\n<6da5>14661\n<6da6>3278\n<6da7>2168\n<6da8>4456\n<6da9>3301\n<6daa>1693\n<6dab>5864\n<6dae>5866\n<6daf>4077\n<6db2>4161\n<6db5>1892\n<6db8>1931\n<6dbf>5857\n<6dc0>1486\n<6dc4>4650\n<6dc5>5854\n<6dc6>3946\n<6dc7>5853\n<6dcb>2597\n<6dcc>3613\n<6dd1>3454\n<6dd6>2874\n<6dd7>14690\n<6dd8>3623\n<6dd9>5862\n<6ddd>5861\n<6dde>5855\n<6ddf>14694\n<6de0>5858\n<6de1>1422\n<6de4>4286\n<6de5>14697\n<6de6>5860\n<6dea>8286\n<6deb>4224\n<6dec>1382\n<6ded>14701\n<6dee>1993\n<6df1>3367\n<6df2>14704\n<6df3>1345\n<6df4>14705\n<6df5>8772\n<6df6>9186\n<6df7>2049\n<6df8>14706\n<6df9>4086\n<6dfa>8404\n<6dfb>3648\n<6dfc>6689\n<6e05>3170\n<6e0a>4331\n<6e0b>14719\n<6e0c>5865\n<6e0d>4658\n<6e0e>5856\n<6e0f>14720\n<6e10>2166\n<6e11>5859\n<6e14>4299\n<6e15>14723\n<6e16>5863\n<6e17>3377\n<6e1a>5852\n<6e1d>4298\n<6e20>3195\n<6e21>1544\n<6e22>14730\n<6e23>4415\n<6e24>1146\n<6e25>5877\n<6e26>8607\n<6e29>3793\n<6e2a>14733\n<6e2b>5867\n<6e2c>7782\n<6e2d>3787\n<6e2e>14734\n<6e2f>1750\n<6e32>5876\n<6e33>14737\n<6e34>2391\n<6e38>4275\n<6e39>14741\n<6e3a>2801\n<6e3e>8035\n<6e43>2953\n<6e44>5878\n<6e4d>3701\n<6e4e>5869\n<6e55>14761\n<6e56>1973\n<6e57>14762\n<6e58>3923\n<6e5b>4448\n<6e5e>9181\n<6e5f>5872\n<6e6b>5870\n<6e6e>5868\n<6e6f>8555\n<6e7e>3734\n<6e7f>3393\n<6e83>2446\n<6e84>14797\n<6e85>2167\n<6e86>5873\n<6e89>1731\n<6e8f>5893\n<6e90>4343\n<6e96>8885\n<6e97>14810\n<6e98>5881\n<6e9c>2616\n<6e9d>7974\n<6e9e>14814\n<6e9f>5895\n<6ea2>4206\n<6ea5>5885\n<6ea6>14819\n<6ea7>5886\n<6eaa>3863\n<6eaf>3538\n<6eb0>14826\n<6eb1>5880\n<6eb2>5871\n<6eb3>14827\n<6eb4>5891\n<6eb5>14828\n<6eb6>3255\n<6eb7>5889\n<6eba>2890\n<6ebb>5888\n<6ebc>14831\n<6ebd>5887\n<6ec1>1313\n<6ec2>5894\n<6ec3>14835\n<6ec4>7779\n<6ec5>8328\n<6ec6>14836\n<6ec7>1474\n<6ecb>4649\n<6ecc>7869\n<6ecd>14840\n<6ece>9025\n<6ecf>5892\n<6ed0>14841\n<6ed1>1985\n<6ed2>14842\n<6ed3>4655\n<6ed4>3618\n<6ed5>6568\n<6ed6>14843\n<6ed7>5890\n<6eda>1871\n<6ede>4556\n<6edf>5879\n<6ee0>5882\n<6ee1>2721\n<6ee2>5884\n<6ee3>14849\n<6ee4>2674\n<6ee5>2479\n<6ee6>2679\n<6ee7>14850\n<6ee8>1118\n<6ee9>3589\n<6eec>8011\n<6eef>8850\n<6ef2>8484\n<6ef3>14857\n<6ef4>1455\n<6ef7>8264\n<6ef8>9184\n<6ef9>5901\n<6eff>8311\n<6f00>14865\n<6f01>8762\n<6f02>3022\n<6f06>3072\n<6f09>5907\n<6f0f>2640\n<6f13>2519\n<6f14>4102\n<6f15>5900\n<6f1a>8369\n<6f20>2833\n<6f21>14888\n<6f22>8001\n<6f23>8220\n<6f24>5899\n<6f29>5908\n<6f2a>5906\n<6f2b>2725\n<6f2c>8888\n<6f2d>5883\n<6f2e>14893\n<6f2f>5902\n<6f30>14894\n<6f31>3477\n<6f32>8822\n<6f33>4453\n<6f36>5903\n<6f37>14897\n<6f38>8091\n<6f3e>4131\n<6f3f>8095\n<6f40>14903\n<6f41>9674\n<6f4b>5904\n<6f4c>14911\n<6f4d>3770\n<6f51>8382\n<6f54>8116\n<6f58>2956\n<6f59>9175\n<6f5c>3118\n<6f5d>14922\n<6f5e>2657\n<6f62>5896\n<6f63>14926\n<6f64>8453\n<6f65>14927\n<6f66>2579\n<6f6d>3593\n<6f6e>1238\n<6f6f>9185\n<6f70>8172\n<6f71>14934\n<6f72>5913\n<6f73>14935\n<6f74>5905\n<6f77>9194\n<6f78>5912\n<6f79>14938\n<6f7a>5915\n<6f7b>14939\n<6f7c>5914\n<6f7f>9187\n<6f80>8462\n<6f84>1267\n<6f85>14945\n<6f86>8102\n<6f87>8196\n<6f88>1247\n<6f89>5909\n<6f8c>5911\n<6f8d>5910\n<6f8e>2989\n<6f97>8093\n<6f9c>2472\n<6fa0>9189\n<6fa1>4395\n<6fa4>8804\n<6fa7>5918\n<6fa8>14967\n<6fa9>9442\n<6fae>9182\n<6fb1>7876\n<6fb2>14974\n<6fb3>975\n<6fb6>5920\n<6fb9>5919\n<6fc0>2071\n<6fc1>8886\n<6fc2>5921\n<6fc3>8361\n<6fc9>5917\n<6fd1>5916\n<6fd2>1117\n<6fd5>8491\n<6fd8>8357\n<6fdb>9867\n<6fde>5924\n<6fdf>8054\n<6fe0>5925\n<6fe1>5922\n<6fe4>8557\n<6feb>8193\n<6fee>5923\n<6fef>5926\n<6ff0>8593\n<6ff1>7760\n<6ffa>8092\n<6ffb>15023\n<6ffc>9178\n<6ffd>15024\n<6ffe>8275\n<7005>9193\n<7006>9188\n<7009>8661\n<700a>15033\n<700b>9190\n<700f>9183\n<7010>15037\n<7011>3064\n<7015>7759\n<7018>9177\n<7019>15043\n<701a>5927\n<701b>5929\n<701c>15044\n<701d>8212\n<701e>15045\n<701f>9196\n<7020>9195\n<7023>5928\n<7027>9176\n<7028>9198\n<7030>9870\n<7031>15058\n<7032>9197\n<7035>5931\n<7039>5930\n<703e>8186\n<7043>9174\n<7044>9192\n<704c>1849\n<704f>5932\n<7050>15081\n<7051>8454\n<7055>8203\n<7058>8550\n<705d>9199\n<705e>5933\n<7063>8585\n<7064>8280\n<7067>9191\n<706b>2053\n<706c>6639\n<706d>2805\n<706e>15100\n<706f>1447\n<7070>2023\n<7075>2610\n<7076>4401\n<7077>15105\n<7078>2291\n<707c>4643\n<707d>15109\n<707e>4377\n<707f>1178\n<7080>6604\n<7085>6419\n<7089>2646\n<708a>1337\n<708e>4096\n<7092>1241\n<7093>15123\n<7094>3213\n<7095>2376\n<7096>6606\n<7099>4554\n<709c>6605\n<709d>6607\n<70ab>6611\n<70ac>2325\n<70ad>3602\n<70ae>2971\n<70af>2283\n<70b0>15141\n<70b1>6612\n<70b2>15142\n<70b3>1127\n<70b7>6610\n<70b8>4425\n<70b9>1476\n<70ba>15146\n<70bb>6608\n<70bc>2559\n<70bd>1288\n<70c0>6609\n<70c1>3501\n<70c2>2478\n<70c3>3665\n<70c8>2587\n<70c9>15153\n<70ca>6614\n<70cf>8611\n<70d8>1949\n<70d9>2494\n<70da>15166\n<70db>4593\n<70df>4085\n<70e4>2379\n<70e5>15174\n<70e6>1616\n<70e7>3342\n<70e8>6613\n<70e9>2039\n<70ea>15175\n<70eb>3615\n<70ec>2254\n<70ed>3235\n<70ee>15176\n<70ef>3862\n<70f4>8570\n<70f7>3738\n<70f8>15183\n<70f9>2988\n<70fd>1670\n<7109>4082\n<710a>1903\n<7110>6615\n<7113>6616\n<7114>15205\n<7115>2005\n<7116>6617\n<7117>15206\n<7118>6640\n<7119>1059\n<711a>1654\n<7121>8613\n<7126>2186\n<712f>6618\n<7130>4111\n<7131>6619\n<7136>3222\n<7145>6623\n<7149>8226\n<714a>6625\n<714b>15246\n<714c>2018\n<714d>15247\n<714e>2136\n<7152>9430\n<715c>6621\n<715d>15260\n<715e>3312\n<7162>9018\n<7163>15264\n<7164>2751\n<7165>15265\n<7166>6641\n<7167>4470\n<7168>6622\n<7169>7918\n<716c>9429\n<716d>15268\n<716e>4594\n<7172>6624\n<7173>6620\n<7178>6626\n<7179>15276\n<717a>6627\n<717d>3320\n<7184>3861\n<718a>4007\n<718f>4053\n<7192>8744\n<7193>15296\n<7194>3254\n<7197>9431\n<7198>6628\n<7199>3844\n<719f>3459\n<71a0>6632\n<71a8>6631\n<71ac>969\n<71b1>8444\n<71b2>15318\n<71b3>6629\n<71b4>15319\n<71b5>6630\n<71b9>6642\n<71be>7815\n<71c1>9432\n<71c2>15329\n<71c3>3223\n<71c8>7866\n<71ce>2576\n<71d2>8473\n<71d3>15342\n<71d4>6634\n<71d5>4105\n<71d9>8556\n<71dc>9433\n<71df>8743\n<71e0>6633\n<71e5>4402\n<71e6>7775\n<71e7>6635\n<71ed>8863\n<71ee>5014\n<71f4>8029\n<71f9>6636\n<71fc>8124\n<71fd>15370\n<71fe>9434\n<7206>1045\n<720d>8521\n<7210>8262\n<721b>8192\n<721c>15396\n<721d>6637\n<7228>6638\n<7229>15407\n<722a>4611\n<722b>15408\n<722c>2945\n<7230>6508\n<7231>953\n<7232>8592\n<7235>2339\n<7236>1715\n<7237>4150\n<7238>993\n<7239>1498\n<723a>8712\n<723b>4713\n<723c>15414\n<723d>3489\n<723e>7910\n<723f>5789\n<7247>3019\n<7248>1009\n<724c>2951\n<724d>6505\n<7252>6506\n<7256>6507\n<7257>15432\n<7258>9411\n<7259>4073\n<725a>15433\n<725b>2916\n<725c>15434\n<725d>6468\n<725e>15435\n<725f>2837\n<7260>15436\n<7261>2840\n<7262>2489\n<7266>6469\n<7267>2852\n<7268>15440\n<7269>3838\n<726e>6466\n<726f>6470\n<7272>3381\n<7275>3104\n<7279>3627\n<727a>3853\n<727d>8396\n<7280>3865\n<7281>2514\n<7284>6473\n<728a>1534\n<728b>6474\n<728c>15461\n<728d>6475\n<728e>15462\n<728f>6476\n<7292>6477\n<7296>9024\n<729f>6467\n<72a2>7889\n<72a7>8620\n<72ac>3209\n<72ad>5615\n<72ae>15486\n<72af>1621\n<72b0>5616\n<72b4>5617\n<72b5>15490\n<72b6>4625\n<72b9>4273\n<72c0>8879\n<72c1>5621\n<72c2>2430\n<72c3>5620\n<72c4>1459\n<72c8>1056\n<72cd>5623\n<72ce>5622\n<72cf>15504\n<72d0>1971\n<72d1>15505\n<72d2>5624\n<72d7>1808\n<72d8>15510\n<72d9>2304\n<72de>2911\n<72df>15515\n<72e0>1940\n<72e1>2199\n<72e8>5625\n<72e9>5627\n<72ec>1535\n<72ed>3886\n<72ee>3391\n<72ef>5626\n<72f0>4505\n<72f1>4321\n<72f2>5628\n<72f3>5632\n<72f4>5629\n<72f7>5630\n<72f8>2517\n<72f9>8630\n<72fc>2482\n<72fd>7741\n<7301>5631\n<7302>15529\n<7303>5633\n<730a>5639\n<730e>2589\n<7313>5637\n<7314>15543\n<7315>5642\n<7316>1221\n<7317>5636\n<731b>2770\n<731c>1161\n<731d>5641\n<731e>5640\n<7321>5638\n<7322>5643\n<7325>5645\n<7329>3988\n<732a>4588\n<732b>2733\n<732c>5646\n<732d>15554\n<732e>3908\n<7331>5648\n<7334>1958\n<7335>15559\n<7336>8757\n<7337>6356\n<7338>5647\n<7339>5644\n<733a>15560\n<733b>9111\n<733e>1984\n<733f>4342\n<7340>15563\n<7341>9109\n<7344>8767\n<7345>8490\n<734d>5650\n<7350>5649\n<7351>15575\n<7352>6357\n<7357>5651\n<7360>5652\n<7368>7890\n<7369>15595\n<736a>9110\n<736b>9112\n<736c>5653\n<736d>3572\n<736e>15596\n<736f>5654\n<7370>8354\n<7371>15597\n<7372>8036\n<7375>8235\n<7376>15600\n<7377>9108\n<7378>8505\n<7379>15601\n<737a>8543\n<737b>8641\n<737c>9114\n<737d>15602\n<737e>5655\n<737f>15603\n<7380>9113\n<7384>4041\n<7387>2673\n<7388>15609\n<7389>4310\n<738a>15610\n<738b>3750\n<738e>6168\n<7391>6169\n<7396>2288\n<739b>2705\n<739f>6172\n<73a2>6171\n<73a9>3735\n<73aa>15634\n<73ab>2746\n<73ae>6170\n<73af>1996\n<73b0>3907\n<73b1>15637\n<73b2>2602\n<73b3>6177\n<73b7>6176\n<73ba>6188\n<73bb>1130\n<73c0>6178\n<73c1>15647\n<73c2>6174\n<73c8>6180\n<73c9>6179\n<73ca>3315\n<73cd>4485\n<73ce>15655\n<73cf>6173\n<73d0>1606\n<73d1>6175\n<73d9>6182\n<73de>6187\n<73df>15667\n<73e0>4584\n<73e5>6181\n<73e6>15672\n<73e7>6186\n<73e8>15673\n<73e9>6185\n<73ed>1003\n<73f2>6189\n<73fe>8640\n<7403>3183\n<7404>15696\n<7405>2480\n<7406>2520\n<7409>2617\n<740a>6184\n<740f>6190\n<7410>3563\n<741a>6200\n<741b>6199\n<7422>4638\n<7425>6194\n<7426>6193\n<7427>15720\n<7428>6195\n<7429>15721\n<742a>6191\n<742b>15722\n<742c>6198\n<742d>15723\n<742e>6197\n<742f>15724\n<7430>6196\n<7433>2590\n<7434>3158\n<7435>3006\n<7436>2948\n<743c>3178\n<743f>9312\n<7440>15734\n<7441>6201\n<744b>9308\n<7455>6204\n<7456>15753\n<7457>6203\n<7458>15754\n<7459>6205\n<745a>1966\n<745b>6192\n<745c>6202\n<745d>15755\n<745e>3275\n<745f>3299\n<7463>8541\n<7469>8741\n<746a>8298\n<746d>6207\n<7470>1854\n<7476>4135\n<7477>6206\n<747e>6208\n<747f>15779\n<7482>15780\n<7483>2544\n<7487>6213\n<7488>15784\n<7489>9313\n<748a>15785\n<748b>6214\n<748e>6210\n<748f>15788\n<7490>6218\n<749c>6209\n<749d>15800\n<749e>6215\n<74a3>9307\n<74a6>9314\n<74a7>6219\n<74b0>8020\n<74ba>6221\n<74bd>9311\n<74ca>8428\n<74cf>9309\n<74d2>6220\n<74d3>15842\n<74d4>9315\n<74da>9316\n<74db>15848\n<74dc>1832\n<74dd>15849\n<74de>6962\n<74df>15850\n<74e0>6963\n<74e1>15851\n<74e2>3023\n<74e3>1013\n<74e4>3226\n<74e5>15852\n<74e6>3728\n<74ee>3804\n<74ef>6403\n<74f4>6404\n<74f5>15864\n<74f6>3038\n<74f7>1356\n<74ff>6405\n<7504>4488\n<750c>9381\n<750d>5253\n<750e>15883\n<750f>6406\n<7510>15884\n<7511>6407\n<7512>15885\n<7513>6408\n<7518>1733\n<7519>5368\n<751a>3374\n<751b>15890\n<751c>3651\n<751f>3379\n<7523>7792\n<7524>15896\n<7525>3380\n<7528>4264\n<7529>3483\n<752a>15899\n<752b>1697\n<752c>6964\n<752d>1067\n<752e>15900\n<752f>5940\n<7530>3650\n<7531>4270\n<7532>2122\n<7533>3363\n<7534>15901\n<7535>1480\n<7536>15902\n<7537>2867\n<7538>1482\n<7539>15903\n<753a>6776\n<753b>1986\n<753e>6166\n<753f>15906\n<7540>6777\n<7545>1230\n<7548>6780\n<754b>6779\n<754c>2232\n<754d>15915\n<754e>6778\n<754f>3782\n<7554>2960\n<7559>2621\n<755a>5022\n<755b>6781\n<755c>4030\n<755d>8335\n<7562>7746\n<7565>2683\n<7566>3079\n<756a>1609\n<756b>8014\n<7572>6782\n<7573>15939\n<7574>1296\n<7575>15940\n<7576>7857\n<7577>15941\n<7578>2064\n<7579>6783\n<757f>6164\n<7583>6784\n<7586>2175\n<7587>7819\n<758b>7110\n<758f>3455\n<7590>15958\n<7591>4176\n<7592>7008\n<7593>15959\n<7594>7009\n<7595>15960\n<7596>7010\n<7597>2575\n<7598>15961\n<7599>1768\n<759a>2301\n<759d>7012\n<759e>15964\n<759f>2930\n<75a0>7011\n<75a1>4122\n<75a2>15965\n<75a3>7014\n<75a4>983\n<75a5>2235\n<75ab>4198\n<75ac>7013\n<75ad>15971\n<75ae>1330\n<75af>1669\n<75b0>7020\n<75b1>7019\n<75b2>3010\n<75b5>1350\n<75b8>7017\n<75b9>4495\n<75bc>3630\n<75bd>2305\n<75be>2085\n<75c2>7022\n<75c3>7021\n<75c4>7018\n<75c5>1128\n<75c6>15979\n<75c7>4513\n<75c8>4253\n<75c9>2278\n<75ca>3207\n<75cd>7024\n<75d2>4128\n<75d3>15986\n<75d4>4555\n<75d5>1938\n<75d6>7023\n<75d7>15987\n<75d8>1530\n<75d9>8134\n<75da>15988\n<75db>3685\n<75de>3013\n<75e2>2538\n<75e3>7025\n<75e4>7028\n<75e5>15994\n<75e6>7027\n<75e7>7030\n<75e8>7026\n<75e9>15995\n<75ea>2003\n<75eb>7029\n<75f0>3592\n<75f1>7032\n<75f4>1274\n<75f9>1085\n<75fc>7033\n<75ff>7034\n<7600>7036\n<7601>1380\n<7602>9646\n<7603>7031\n<7604>16010\n<7605>7037\n<760a>7040\n<760b>7937\n<760c>7038\n<760d>8704\n<7610>7035\n<7615>7043\n<7616>16021\n<7617>7039\n<7618>7042\n<7619>7044\n<761a>16022\n<761b>7045\n<761e>9650\n<761f>3792\n<7620>7048\n<7621>7831\n<7622>7047\n<7623>16025\n<7624>2623\n<7625>7041\n<7626>3444\n<7627>8363\n<7628>16026\n<7629>1396\n<762a>1114\n<762b>3588\n<762c>16027\n<762d>7050\n<7630>7051\n<7633>7056\n<7634>4463\n<7635>7053\n<7638>3214\n<763b>9651\n<763c>7046\n<763d>16036\n<763e>7055\n<763f>7052\n<7640>7049\n<7641>16037\n<7642>8232\n<7643>7054\n<7648>16040\n<7649>9649\n<764c>948\n<764d>7057\n<7654>7059\n<7655>16049\n<7656>7061\n<7657>16050\n<7658>9644\n<765c>7060\n<765d>16054\n<765e>7058\n<765f>7758\n<7662>8706\n<7663>4043\n<7664>9643\n<7665>8838\n<7666>16057\n<7667>9645\n<7668>16058\n<7669>9654\n<766a>16059\n<766b>7062\n<766c>8675\n<766f>7063\n<7670>8751\n<7671>8549\n<7672>9655\n<7678>1864\n<767b>1448\n<767c>7913\n<767d>994\n<767e>996\n<7682>4400\n<7683>16070\n<7684>1445\n<7685>16071\n<7686>2213\n<7687>2015\n<7688>6957\n<768b>1753\n<768e>6958\n<7691>947\n<7692>16078\n<7693>6959\n<7696>3743\n<7699>6960\n<769a>7717\n<76a4>6961\n<76ae>3011\n<76b1>4580\n<76b2>7112\n<76b3>16103\n<76b4>7113\n<76b8>9664\n<76b9>16107\n<76ba>8858\n<76bf>2808\n<76c2>4288\n<76c5>4560\n<76c6>2985\n<76c7>16116\n<76c8>4244\n<76c9>16117\n<76ca>4205\n<76cd>6795\n<76ce>966\n<76cf>4438\n<76d0>4087\n<76d1>2131\n<76d2>1927\n<76d3>16120\n<76d4>2437\n<76d5>16121\n<76d6>1730\n<76d7>1442\n<76d8>2957\n<76db>3385\n<76de>8814\n<76df>2768\n<76e0>16126\n<76e1>8125\n<76e2>16127\n<76e3>8068\n<76e4>8370\n<76e5>6796\n<76e6>16128\n<76e7>8259\n<76ee>2850\n<76ef>1505\n<76f0>16135\n<76f1>6744\n<76f2>2729\n<76f3>16136\n<76f4>4528\n<76f8>3917\n<76f9>6747\n<76fc>2959\n<76fd>16142\n<76fe>1563\n<7701>3384\n<7704>6745\n<7709>2753\n<770a>16149\n<770b>2369\n<770c>16150\n<770d>6746\n<7719>6752\n<771a>6750\n<771f>4487\n<7720>2788\n<7721>16166\n<7722>6751\n<7726>6754\n<7727>16170\n<7728>4420\n<7729>4044\n<772d>6753\n<772e>16174\n<772f>2773\n<7735>6755\n<7736>2433\n<7737>2331\n<7738>6756\n<7739>16180\n<773a>3658\n<773b>16181\n<773c>4100\n<7740>4642\n<7741>4503\n<7742>16185\n<7743>6760\n<7747>6759\n<774f>9860\n<775a>6761\n<775b>2261\n<775e>9455\n<7761>3492\n<7762>6763\n<7763>1532\n<7764>16208\n<7765>6764\n<7766>2851\n<7767>16209\n<7768>6762\n<776b>2223\n<776c>1166\n<7779>1538\n<777d>6767\n<777e>4720\n<777f>6765\n<7780>6768\n<7784>2798\n<7785>1303\n<778c>6769\n<778d>6766\n<778e>3878\n<7791>6770\n<7792>2718\n<7798>9454\n<779e>8308\n<77a1>16248\n<77a2>5269\n<77a5>3026\n<77a6>16251\n<77a7>3139\n<77a8>16252\n<77a9>4596\n<77aa>1450\n<77ab>16253\n<77ac>3495\n<77ad>9863\n<77b0>6773\n<77b3>3676\n<77b4>16258\n<77b5>6774\n<77bb>4433\n<77bc>9456\n<77bd>6775\n<77be>16264\n<77bf>7550\n<77c7>9869\n<77cd>5015\n<77d7>1318\n<77da>8864\n<77db>2737\n<77dc>7114\n<77e2>3407\n<77e3>4186\n<77e4>16293\n<77e5>4521\n<77e6>16294\n<77e7>6938\n<77e8>16295\n<77e9>2311\n<77ea>16296\n<77eb>2196\n<77ec>6939\n<77ed>1547\n<77ee>950\n<77ef>8107\n<77f3>3398\n<77f6>6690\n<77f7>16302\n<77f8>6691\n<77fd>3848\n<77fe>1612\n<77ff>2432\n<7800>6692\n<7801>2706\n<7802>3305\n<7809>6693\n<780c>3093\n<780d>2368\n<7811>6696\n<7812>3001\n<7813>16318\n<7814>4089\n<7815>16319\n<7816>4614\n<7819>16320\n<781a>4107\n<781b>16321\n<781e>16322\n<781f>6704\n<7823>6708\n<7824>16326\n<7825>6706\n<7826>6714\n<7827>4489\n<7828>16327\n<7829>6709\n<782c>6707\n<782d>6698\n<7830>2986\n<7834>3045\n<7837>3362\n<7838>4373\n<783c>6705\n<783d>16337\n<783e>2532\n<783f>16338\n<7840>1316\n<7843>9896\n<7844>16341\n<7845>1857\n<7846>16342\n<7847>6716\n<784c>6717\n<784d>16347\n<784e>6710\n<784f>16348\n<7850>6715\n<7851>16349\n<7852>3847\n<7855>3499\n<785d>3938\n<7864>9449\n<7868>9445\n<7869>16366\n<786a>6718\n<786b>2619\n<786c>4247\n<786d>6711\n<786e>3218\n<786f>8698\n<7877>2146\n<787c>2993\n<7887>6722\n<7888>16388\n<7889>1488\n<788c>2652\n<788d>952\n<788e>3550\n<7891>1047\n<7892>16393\n<7893>6720\n<7897>3740\n<7898>1475\n<7899>16397\n<789a>6721\n<789b>6719\n<789c>6723\n<789f>1499\n<78a0>16400\n<78a1>6724\n<78a2>16401\n<78a3>6725\n<78a4>16402\n<78a5>6728\n<78a6>16403\n<78a7>1077\n<78a8>16404\n<78a9>8520\n<78ad>9444\n<78b0>2999\n<78b1>2145\n<78b2>6726\n<78b3>3599\n<78b4>1201\n<78b8>9446\n<78b9>6727\n<78ba>8439\n<78bb>16413\n<78bc>8299\n<78bd>16414\n<78be>2894\n<78c1>1352\n<78c5>1024\n<78c9>6731\n<78ca>2501\n<78cb>1387\n<78d0>2958\n<78d4>6729\n<78d5>2385\n<78d9>6730\n<78da>8871\n<78e3>9452\n<78e7>9451\n<78e8>2824\n<78ec>6732\n<78ef>9443\n<78f2>6733\n<78f3>16451\n<78f4>6735\n<78f7>2592\n<78fa>2012\n<78fd>9450\n<7901>2185\n<7905>6734\n<790e>7826\n<7913>6736\n<7919>7719\n<791e>6738\n<7924>6737\n<7925>16490\n<7926>8166\n<792a>9447\n<792b>8210\n<792c>7916\n<7931>9448\n<7934>6739\n<793a>3413\n<793b>6648\n<793c>2524\n<793d>16505\n<793e>3360\n<793f>16506\n<7940>6649\n<7941>3085\n<7946>6650\n<7947>16511\n<7948>3084\n<7949>6651\n<7953>6654\n<7956>4675\n<7957>6657\n<795a>6655\n<795d>4608\n<795e>3370\n<795f>3555\n<7960>6658\n<7961>16525\n<7962>6656\n<7965>3926\n<7966>16528\n<7967>6660\n<7968>3024\n<796d>2099\n<796e>16533\n<796f>6659\n<7977>1436\n<7978>2059\n<7979>16541\n<797a>6661\n<7980>4875\n<7981>2252\n<7984>2658\n<7985>6662\n<798a>6663\n<798d>8038\n<798e>9436\n<798f>1694\n<799a>6664\n<79a6>9890\n<79a7>6665\n<79aa>9437\n<79ae>8206\n<79af>16581\n<79b0>9435\n<79b1>7864\n<79b2>16582\n<79b3>6666\n<79b9>4306\n<79ba>4708\n<79bb>2518\n<79bc>16588\n<79bd>3162\n<79be>1923\n<79bf>16589\n<79c0>4014\n<79c1>3506\n<79c2>16590\n<79c3>3691\n<79c6>1740\n<79c9>1125\n<79ca>16595\n<79cb>3180\n<79cc>16596\n<79cd>4565\n<79d1>2387\n<79d2>2800\n<79d5>6941\n<79d8>2781\n<79df>4671\n<79e3>6943\n<79e4>1272\n<79e5>16613\n<79e6>3157\n<79e7>4118\n<79e8>16614\n<79e9>4551\n<79ea>16615\n<79eb>6944\n<79ec>16616\n<79ed>6942\n<79ee>16617\n<79ef>2066\n<79f0>1259\n<79f8>2214\n<79fb>4173\n<79fc>16627\n<79fd>2037\n<7a00>3854\n<7a01>16630\n<7a02>6948\n<7a03>6947\n<7a06>6945\n<7a0b>1265\n<7a0c>16637\n<7a0d>3341\n<7a0e>3493\n<7a14>6950\n<7a17>1001\n<7a1a>4552\n<7a1e>6949\n<7a1f>16650\n<7a20>1298\n<7a23>7567\n<7a2e>8853\n<7a31>7808\n<7a32>16665\n<7a33>3799\n<7a37>6952\n<7a38>16669\n<7a39>6951\n<7a3a>16670\n<7a3b>1439\n<7a3c>2125\n<7a3d>2065\n<7a3e>16671\n<7a3f>1760\n<7a40>9847\n<7a46>2853\n<7a4c>9764\n<7a4d>8041\n<7a4e>8747\n<7a51>6953\n<7a57>3552\n<7a61>9599\n<7a62>8027\n<7a69>8603\n<7a6a>16704\n<7a6b>9853\n<7a70>6956\n<7a74>4049\n<7a75>16712\n<7a76>2286\n<7a77>3179\n<7a7a>2402\n<7a7f>1324\n<7a80>7068\n<7a81>3692\n<7a82>16717\n<7a83>3153\n<7a84>4430\n<7a85>16718\n<7a86>7069\n<7a87>16719\n<7a88>7070\n<7a8d>3148\n<7a91>4139\n<7a92>4558\n<7a95>7071\n<7a96>2210\n<7a97>1331\n<7a98>2284\n<7a9c>1375\n<7a9d>3808\n<7a9e>16732\n<7a9f>2412\n<7aa0>7073\n<7aa5>2439\n<7aa6>7072\n<7aa7>16737\n<7aa8>7075\n<7aa9>8608\n<7aaa>8582\n<7aab>16738\n<7aac>7074\n<7aad>7076\n<7aae>8429\n<7ab3>7077\n<7ab6>9657\n<7aba>8170\n<7abf>2631\n<7ac4>7844\n<7ac5>8417\n<7ac6>16756\n<7ac7>9656\n<7ac8>8800\n<7ac9>16757\n<7aca>8418\n<7acb>2539\n<7ad6>3473\n<7ad9>4447\n<7ade>2281\n<7adf>2280\n<7ae0>4451\n<7ae3>2351\n<7ae4>16776\n<7ae5>3680\n<7ae6>7065\n<7aea>8513\n<7aed>2224\n<7aee>16782\n<7aef>1546\n<7af6>8135\n<7af9>4592\n<7afa>7267\n<7afd>7268\n<7afe>16793\n<7aff>1736\n<7b05>16797\n<7b06>981\n<7b07>16798\n<7b08>7269\n<7b09>16799\n<7b0a>7273\n<7b0b>3558\n<7b0f>7275\n<7b10>16803\n<7b11>3953\n<7b14>1075\n<7b15>7272\n<7b19>7279\n<7b1a>16809\n<7b1b>1458\n<7b1e>7287\n<7b1f>16812\n<7b20>7282\n<7b24>7284\n<7b25>7283\n<7b26>1688\n<7b27>16816\n<7b28>1064\n<7b29>16817\n<7b2a>7278\n<7b2b>7274\n<7b2c>1467\n<7b2d>16818\n<7b2e>7280\n<7b31>7281\n<7b32>16821\n<7b33>7285\n<7b38>7277\n<7b39>16826\n<7b3a>2134\n<7b3b>16827\n<7b3c>2630\n<7b3d>16828\n<7b3e>7286\n<7b45>7290\n<7b46>7745\n<7b47>7276\n<7b48>16835\n<7b49>1449\n<7b4a>16836\n<7b4b>2239\n<7b4c>7292\n<7b4f>1601\n<7b50>2429\n<7b51>4605\n<7b52>3683\n<7b53>16839\n<7b54>1395\n<7b55>16840\n<7b56>1190\n<7b57>16841\n<7b58>7288\n<7b59>16842\n<7b5a>7289\n<7b5b>3313\n<7b5c>16843\n<7b5d>7293\n<7b60>7294\n<7b61>16846\n<7b62>7297\n<7b67>9700\n<7b6e>7295\n<7b71>7299\n<7b72>7298\n<7b75>7291\n<7b76>16861\n<7b77>2423\n<7b78>16862\n<7b79>1300\n<7b7a>16863\n<7b7b>7296\n<7b7e>3110\n<7b7f>16866\n<7b80>2149\n<7b85>7307\n<7b8b>8070\n<7b8c>16876\n<7b8d>1816\n<7b90>7300\n<7b94>1140\n<7b95>2067\n<7b96>16882\n<7b97>3544\n<7b9c>7309\n<7b9d>7305\n<7ba1>1845\n<7ba2>7310\n<7ba8>7306\n<7ba9>2696\n<7baa>7308\n<7bab>7311\n<7bac>7304\n<7bad>2160\n<7bb1>3921\n<7bb4>7312\n<7bb8>7303\n<7bc0>8115\n<7bc1>7314\n<7bc4>7919\n<7bc5>16910\n<7bc6>4618\n<7bc7>3017\n<7bc8>16911\n<7bc9>8868\n<7bca>16912\n<7bcb>9704\n<7bcc>7315\n<7bd1>7313\n<7bd2>16917\n<7bd3>2639\n<7bd9>1752\n<7bda>7317\n<7bdd>7316\n<7be1>1374\n<7be4>9699\n<7be9>8465\n<7bea>7320\n<7bee>2469\n<7bf1>2516\n<7bf2>16937\n<7bf3>9702\n<7bf7>2994\n<7bfc>7323\n<7bfd>16945\n<7bfe>7322\n<7bff>16946\n<7c00>9703\n<7c07>1371\n<7c0b>7326\n<7c0c>7321\n<7c0d>8257\n<7c0e>16956\n<7c0f>7324\n<7c16>7325\n<7c1e>9706\n<7c1f>7327\n<7c20>16970\n<7c21>8079\n<7c22>16971\n<7c23>9708\n<7c26>7329\n<7c27>2014\n<7c2a>7328\n<7c2b>9707\n<7c38>7330\n<7c3d>8400\n<7c3e>8221\n<7c3f>1157\n<7c40>7332\n<7c41>7331\n<7c42>16992\n<7c43>8183\n<7c4c>7821\n<7c4d>2081\n<7c5c>9705\n<7c5f>9710\n<7c60>8250\n<7c64>9875\n<7c69>9701\n<7c6a>9709\n<7c6b>17024\n<7c6c>8201\n<7c6d>17025\n<7c6e>8293\n<7c72>9891\n<7c73>2780\n<7c74>4853\n<7c7b>2507\n<7c7c>7370\n<7c7d>4654\n<7c89>1656\n<7c91>7372\n<7c92>2540\n<7c95>3048\n<7c96>17055\n<7c97>1369\n<7c98>4436\n<7c9c>7374\n<7c9d>7373\n<7c9e>7375\n<7c9f>3535\n<7ca2>7376\n<7ca3>17061\n<7ca4>4356\n<7ca5>4575\n<7caa>1661\n<7cae>2561\n<7cb1>2564\n<7cb2>7377\n<7cb3>2267\n<7cb9>1381\n<7cbe>2266\n<7cc1>7380\n<7cc5>7385\n<7cc6>17083\n<7cc7>7381\n<7cc8>7384\n<7cc9>17084\n<7cca>1972\n<7ccb>17085\n<7cd5>1757\n<7cd6>3610\n<7cd7>7386\n<7cd8>17093\n<7cd9>1185\n<7cdc>2776\n<7cdd>9717\n<7cde>7932\n<7cdf>4390\n<7ce0>2372\n<7ce7>8228\n<7ce8>7387\n<7cef>2933\n<7cf0>9883\n<7cf1>17108\n<7cf2>9715\n<7cf3>17109\n<7cf4>8921\n<7cf5>17110\n<7cf6>9716\n<7cf7>17111\n<7cf8>7399\n<7cf9>9243\n<7cfa>17112\n<7cfb>3874\n<7cfe>8136\n<7cff>17115\n<7d00>8059\n<7d01>17116\n<7d02>9245\n<7d03>17117\n<7d04>8780\n<7d05>8008\n<7d06>9244\n<7d09>8447\n<7d0a>3800\n<7d0b>8602\n<7d0c>17118\n<7d0d>8337\n<7d10>8359\n<7d13>9251\n<7d14>7835\n<7d15>9250\n<7d16>17123\n<7d17>8464\n<7d18>17124\n<7d19>8845\n<7d1a>8049\n<7d1b>7928\n<7d1c>9249\n<7d20>3533\n<7d21>7923\n<7d22>3564\n<7d27>2245\n<7d2b>4652\n<7d2f>2502\n<7d30>8625\n<7d31>9254\n<7d32>9253\n<7d33>8480\n<7d39>8474\n<7d3a>9252\n<7d3b>17143\n<7d3c>9256\n<7d3f>9258\n<7d40>9257\n<7d41>17146\n<7d42>8852\n<7d43>17147\n<7d44>8894\n<7d45>17148\n<7d46>7729\n<7d4e>9260\n<7d4f>17156\n<7d50>8117\n<7d5d>9259\n<7d5e>8111\n<7d61>8296\n<7d62>8676\n<7d66>7969\n<7d67>17174\n<7d68>8449\n<7d6e>4032\n<7d71>8572\n<7d72>8522\n<7d73>9261\n<7d76>8148\n<7d77>7400\n<7d78>17184\n<7d79>8145\n<7d81>7731\n<7d82>17192\n<7d83>9263\n<7d86>9262\n<7d87>17195\n<7d88>9264\n<7d89>8667\n<7d8f>8536\n<7d93>8130\n<7d9c>8889\n<7d9d>17212\n<7d9e>9270\n<7da2>7822\n<7da3>9273\n<7da6>7401\n<7dab>8645\n<7dac>9271\n<7dad>8594\n<7dae>7402\n<7daf>17222\n<7db0>9274\n<7db1>7961\n<7db2>8588\n<7db3>7744\n<7db4>8883\n<7db8>8287\n<7db9>9272\n<7dba>9266\n<7dbb>8820\n<7dbc>17226\n<7dbd>7836\n<7dbe>9265\n<7dbf>8325\n<7dc4>9269\n<7dc7>9275\n<7dca>8119\n<7dcb>9267\n<7dd1>8276\n<7dd2>8670\n<7dd3>17240\n<7dd4>9268\n<7dd7>9277\n<7dd8>8073\n<7dd9>9276\n<7ddd>8046\n<7dde>7896\n<7ddf>17246\n<7de0>7871\n<7de1>9285\n<7de2>17247\n<7de3>8777\n<7de6>9281\n<7de7>17250\n<7de8>7751\n<7de9>8022\n<7dec>8326\n<7def>8598\n<7df0>17255\n<7df1>9283\n<7df2>9279\n<7df3>17256\n<7df4>8227\n<7df5>17257\n<7df6>9282\n<7df9>9278\n<7dfa>17260\n<7dfb>9894\n<7e08>9038\n<7e09>9286\n<7e0a>9291\n<7e0b>9284\n<7e10>9255\n<7e11>9292\n<7e1b>7951\n<7e1c>17286\n<7e1d>9287\n<7e1e>9289\n<7e1f>9288\n<7e23>8642\n<7e27>8558\n<7e2b>7939\n<7e2c>17296\n<7e2d>9290\n<7e2e>8540\n<7e31>8891\n<7e32>9296\n<7e33>17299\n<7e34>9876\n<7e35>9295\n<7e36>9718\n<7e37>8273\n<7e38>17300\n<7e39>9294\n<7e3a>17301\n<7e3b>7675\n<7e3c>17302\n<7e3d>8890\n<7e3e>8045\n<7e41>1614\n<7e45>9298\n<7e46>9297\n<7e47>7403\n<7e52>9301\n<7e53>17318\n<7e54>8841\n<7e55>8470\n<7e5a>9300\n<7e5e>8443\n<7e62>9280\n<7e69>8486\n<7e6a>8033\n<7e6b>9885\n<7e6c>17335\n<7e6d>8074\n<7e6e>9302\n<7e6f>9305\n<7e70>9304\n<7e73>8110\n<7e79>8730\n<7e7c>8058\n<7e7d>9293\n<7e7e>9303\n<7e82>4680\n<7e88>9299\n<7e89>17353\n<7e8a>9248\n<7e8b>17354\n<7e8c>8671\n<7e8d>9861\n<7e8e>17355\n<7e8f>7790\n<7e93>8740\n<7e94>9840\n<7e95>17359\n<7e96>8634\n<7e97>17360\n<7e98>9306\n<7e9b>7404\n<7e9c>8191\n<7e9f>6099\n<7ea0>2287\n<7ea1>6100\n<7ea2>1955\n<7ea3>6101\n<7ea4>3896\n<7ea5>6102\n<7ea6>4351\n<7ea7>2089\n<7eaa>2112\n<7eab>3245\n<7eac>3778\n<7ead>6105\n<7eae>17365\n<7eaf>1346\n<7eb0>6106\n<7eb1>3309\n<7eb2>1748\n<7eb3>2860\n<7eb4>17366\n<7eb5>4666\n<7eb6>2689\n<7eb7>1652\n<7eb8>4540\n<7eb9>3797\n<7eba>1633\n<7ebd>2919\n<7ebe>6107\n<7ebf>3916\n<7ec3>2560\n<7ec4>4678\n<7ec5>3369\n<7ec6>3877\n<7ec7>4526\n<7ec8>4564\n<7ec9>6111\n<7eca>1016\n<7ecd>3349\n<7ece>4214\n<7ecf>2268\n<7ed0>6114\n<7ed1>1022\n<7ed2>3257\n<7ed3>2226\n<7ed4>6115\n<7ed5>3233\n<7ed6>17369\n<7ed7>6116\n<7ed8>2043\n<7ed9>1779\n<7eda>4045\n<7edb>6117\n<7edc>2702\n<7edd>2343\n<7ede>2203\n<7edf>3684\n<7ee2>2333\n<7ee3>4016\n<7ee4>17370\n<7ee5>3548\n<7ee6>3619\n<7ee7>2111\n<7ee8>6120\n<7ee9>2075\n<7eea>4034\n<7eeb>6121\n<7eec>17371\n<7eed>4035\n<7ef0>1349\n<7ef3>3383\n<7ef4>3771\n<7ef5>2789\n<7ef6>6127\n<7ef7>1066\n<7ef8>1302\n<7ef9>17372\n<7efc>4664\n<7efd>4449\n<7efe>6130\n<7eff>2675\n<7f00>4631\n<7f04>2141\n<7f05>2794\n<7f06>2477\n<7f09>2076\n<7f0a>17373\n<7f0d>6126\n<7f0e>1551\n<7f0f>6138\n<7f10>17374\n<7f13>1999\n<7f14>1471\n<7f15>2669\n<7f16>1097\n<7f17>6141\n<7f18>4344\n<7f19>6142\n<7f1a>1722\n<7f1b>6144\n<7f1c>6143\n<7f1d>1673\n<7f1e>17375\n<7f1f>6145\n<7f20>1215\n<7f28>4236\n<7f29>3562\n<7f2e>3330\n<7f34>2202\n<7f35>6162\n<7f36>7262\n<7f37>17376\n<7f38>1746\n<7f39>17377\n<7f3a>3212\n<7f42>7263\n<7f43>17385\n<7f4c>9698\n<7f4d>17392\n<7f4e>9882\n<7f4f>17393\n<7f50>1847\n<7f51>3753\n<7f54>4766\n<7f55>1896\n<7f56>17396\n<7f57>2693\n<7f58>6785\n<7f59>17397\n<7f5a>1600\n<7f5f>6787\n<7f60>17402\n<7f61>6786\n<7f62>992\n<7f68>6789\n<7f69>4471\n<7f6a>4684\n<7f6e>4546\n<7f6f>17411\n<7f70>7914\n<7f71>6791\n<7f72>3463\n<7f73>17412\n<7f74>6790\n<7f77>7724\n<7f78>17415\n<7f79>6792\n<7f7e>6794\n<7f81>6793\n<7f85>8290\n<7f86>9457\n<7f87>17425\n<7f88>9458\n<7f89>17426\n<7f8a>4123\n<7f8b>17427\n<7f8c>3129\n<7f8d>17428\n<7f8e>2757\n<7f94>1756\n<7f9a>2608\n<7f9d>7364\n<7f9e>4010\n<7f9f>7365\n<7fa0>17441\n<7fa1>3912\n<7fa4>3221\n<7fa5>9714\n<7fa6>17444\n<7fa7>7366\n<7fa8>17445\n<7fa9>8725\n<7fb1>17451\n<7fb2>7369\n<7fb8>4878\n<7fb9>1785\n<7fbc>5997\n<7fbd>4309\n<7fbe>17459\n<7fbf>7390\n<7fc0>17460\n<7fc1>3803\n<7fc5>1286\n<7fca>7064\n<7fcb>17468\n<7fcc>4213\n<7fcd>17469\n<7fce>7391\n<7fd2>8622\n<7fd3>17473\n<7fd4>3925\n<7fd5>7392\n<7fd8>3145\n<7fdf>1461\n<7fe0>1383\n<7fe1>7394\n<7fe5>7393\n<7fe6>7395\n<7fe9>7396\n<7fee>7397\n<7fef>17491\n<7ff0>1897\n<7ff1>970\n<7ff2>17492\n<7ff3>7398\n<7ff9>8416\n<7ffa>17498\n<7ffb>1610\n<7ffc>4212\n<8000>4146\n<8001>2490\n<8002>17502\n<8003>2377\n<8004>6483\n<8005>4480\n<8006>6426\n<800b>7127\n<800c>1591\n<800d>3480\n<8010>2864\n<8011>17509\n<8012>7115\n<8013>17510\n<8014>7116\n<8015>1782\n<8016>7117\n<8017>1915\n<8018>4360\n<8019>989\n<801c>7118\n<8020>7119\n<8021>17516\n<8022>7120\n<8028>7125\n<8029>7124\n<802a>2966\n<802b>17519\n<802c>9666\n<802d>17520\n<802e>9665\n<8031>7126\n<8032>17523\n<8033>1593\n<8034>17524\n<8035>7128\n<8036>4149\n<8037>5297\n<8038>3519\n<803b>1281\n<803c>17527\n<803d>1411\n<803e>17528\n<803f>1787\n<8042>2903\n<8043>7129\n<8046>7130\n<804a>2573\n<804b>2628\n<804c>4527\n<804d>7131\n<8052>7132\n<8053>17540\n<8054>2547\n<8055>17541\n<8056>8488\n<8057>17542\n<8058>3031\n<8059>17543\n<805a>2314\n<805e>8601\n<8069>7133\n<806a>1362\n<806f>8215\n<8070>7840\n<8071>7134\n<8072>8485\n<8073>8525\n<8074>17561\n<8075>9668\n<8076>8349\n<8077>8842\n<8078>17562\n<8079>9667\n<807d>8569\n<807e>8248\n<807f>6686\n<8080>6685\n<8083>3541\n<8084>4197\n<8085>8533\n<8086>3510\n<8087>4473\n<8088>17568\n<8089>3261\n<808a>17569\n<808b>2506\n<808c>2068\n<8093>6513\n<8096>3951\n<8097>17578\n<8098>4577\n<8099>17579\n<809a>1542\n<809b>1747\n<809c>6512\n<809d>1737\n<809e>17580\n<809f>6511\n<80a0>1227\n<80a1>1826\n<80a2>4522\n<80a3>17581\n<80a4>1681\n<80a5>1639\n<80a9>2138\n<80aa>1627\n<80ab>6518\n<80ac>17585\n<80ad>6519\n<80ae>964\n<80af>2396\n<80b0>17586\n<80b1>6517\n<80b2>4322\n<80b3>17587\n<80b4>6520\n<80b7>6521\n<80ba>1643\n<80bb>17592\n<80bc>6514\n<80bd>6516\n<80be>3375\n<80bf>4566\n<80c0>4462\n<80c1>3965\n<80c2>6527\n<80c3>3783\n<80c4>6528\n<80c5>17593\n<80c6>1417\n<80cc>1052\n<80cd>6530\n<80ce>3576\n<80d6>2967\n<80d7>6531\n<80d8>17606\n<80d9>6529\n<80da>2976\n<80db>6526\n<80dc>3387\n<80dd>6533\n<80de>1030\n<80e1>1969\n<80e4>4717\n<80e5>7111\n<80e6>17611\n<80eb>6534\n<80ec>6042\n<80ed>6537\n<80ee>17612\n<80ef>2421\n<80f0>4175\n<80f1>6535\n<80f2>6540\n<80f3>1767\n<80f4>6536\n<80f5>17613\n<80f6>2187\n<80f7>17614\n<80f8>4003\n<80f9>17615\n<80fa>962\n<80fb>17616\n<80fc>6541\n<80fd>2879\n<8102>4523\n<8105>8658\n<8106>1379\n<8109>2717\n<810a>2092\n<810f>4387\n<8110>3081\n<8111>2871\n<8112>6543\n<8113>2920\n<8114>4873\n<8115>17627\n<8116>1144\n<8117>17628\n<8118>6548\n<8119>17629\n<811a>2198\n<811b>9415\n<811e>6546\n<812c>6547\n<812f>1703\n<8130>17647\n<8131>3714\n<8132>6549\n<8136>6545\n<8137>17651\n<8138>2556\n<8139>8825\n<813e>3009\n<8146>3654\n<8147>17663\n<8148>6550\n<8149>17664\n<814a>2459\n<814b>4159\n<814c>6551\n<814d>17665\n<814e>8483\n<814f>17666\n<8150>1706\n<8151>1704\n<8152>17667\n<8153>6552\n<8154>3128\n<8155>3748\n<8156>9413\n<8160>6557\n<8161>9417\n<8165>3987\n<8166>8340\n<8167>6562\n<8168>17678\n<8169>6558\n<816a>17679\n<816b>8854\n<816c>17680\n<816d>6561\n<816e>3284\n<816f>17681\n<8170>4133\n<8171>6556\n<8174>6553\n<8178>7799\n<8179>1716\n<817a>3910\n<817b>2888\n<817e>3629\n<817f>3705\n<8180>1021\n<8181>17687\n<8182>6566\n<8188>6565\n<8189>17693\n<818a>1145\n<818f>1755\n<8190>17698\n<8191>6567\n<8198>1109\n<8199>17705\n<819a>7942\n<819b>3608\n<819c>2823\n<819d>3858\n<81a0>8101\n<81a3>6569\n<81a6>6576\n<81a7>17712\n<81a8>2995\n<81a9>8345\n<81aa>6570\n<81b3>3326\n<81ba>5697\n<81bb>6574\n<81bc>17727\n<81bd>7853\n<81be>9416\n<81bf>8360\n<81c0>3711\n<81c1>6575\n<81c2>1092\n<81c3>4252\n<81c6>4195\n<81c9>8223\n<81ca>6573\n<81cb>17732\n<81cc>6571\n<81cd>8389\n<81ce>17733\n<81cf>9418\n<81d8>8176\n<81d9>17742\n<81da>9414\n<81df>8797\n<81e0>8926\n<81e3>1249\n<81e7>6402\n<81e8>8236\n<81e9>17752\n<81ea>4657\n<81eb>17753\n<81ec>7337\n<81ed>1305\n<81fa>8545\n<81fb>4490\n<81fc>2297\n<81fd>17764\n<81fe>7333\n<81ff>17765\n<8200>4143\n<8203>17766\n<8204>7336\n<8205>2298\n<8206>4292\n<8207>8763\n<8208>8665\n<8209>8139\n<820a>8137\n<820b>17767\n<8210>7266\n<8211>17770\n<8212>3453\n<8213>17771\n<8214>3653\n<821b>5656\n<821c>3497\n<821d>17778\n<821e>3831\n<821f>4570\n<8220>17779\n<8228>7344\n<8229>17784\n<822a>1908\n<822b>7345\n<822c>1006\n<822d>7342\n<822e>17785\n<822f>7343\n<8230>2163\n<8231>1180\n<8232>17786\n<8235>1573\n<8236>1143\n<8237>3900\n<8238>7346\n<8239>1327\n<823a>17787\n<823b>7347\n<823e>7350\n<8244>7351\n<8247>3672\n<8248>17797\n<8249>7352\n<824a>17798\n<824b>7353\n<824f>7354\n<8258>3527\n<8259>7777\n<825a>7355\n<825f>7356\n<8264>9711\n<8265>17818\n<8266>8088\n<8267>17819\n<8268>7357\n<826b>9712\n<826e>7388\n<826f>2565\n<8270>2139\n<8271>8072\n<8272>3300\n<8273>4103\n<8274>6001\n<8277>8696\n<8278>17826\n<8279>5089\n<827a>4188\n<827d>5090\n<827e>951\n<827f>5091\n<8282>2219\n<8283>17831\n<8284>5095\n<8288>4728\n<8289>17835\n<828a>5093\n<828b>4312\n<828c>17836\n<828d>3343\n<828e>5096\n<828f>5092\n<8290>17837\n<8291>5097\n<8292>2727\n<8297>5098\n<8298>5107\n<8299>5099\n<829c>3822\n<829d>4516\n<829e>17844\n<829f>5117\n<82a0>17845\n<82a1>5115\n<82a4>5120\n<82a5>2231\n<82a6>2642\n<82a7>17848\n<82a8>5094\n<82a9>5113\n<82aa>5116\n<82ab>5100\n<82ac>1647\n<82ad>976\n<82ae>5109\n<82af>3977\n<82b0>5103\n<82b1>1981\n<82b2>17849\n<82b3>1625\n<82b4>5114\n<82b7>5108\n<82b8>5101\n<82b9>3160\n<82ba>17852\n<82bb>8994\n<82bc>17853\n<82bd>4072\n<82be>5102\n<82c1>5112\n<82c4>5118\n<82c7>3772\n<82c8>5104\n<82c9>17860\n<82ca>5105\n<82cd>1179\n<82ce>5119\n<82cf>3530\n<82d0>17861\n<82d1>4346\n<82d2>5129\n<82d3>5133\n<82d4>3577\n<82d5>5140\n<82d6>17862\n<82d7>2796\n<82d8>5130\n<82db>2382\n<82dc>5127\n<82dd>17865\n<82de>1029\n<82df>1807\n<82e0>5139\n<82e1>5121\n<82e2>17866\n<82e3>5106\n<82e4>5124\n<82e5>3279\n<82e6>2413\n<82e7>9014\n<82eb>3316\n<82ef>1062\n<82f0>17873\n<82f1>4231\n<82f4>5128\n<82f7>5123\n<82f8>17878\n<82f9>3034\n<82fa>17879\n<82fb>5132\n<8301>4639\n<8302>2740\n<8303>1619\n<8304>3150\n<8305>2734\n<8306>5136\n<8307>5126\n<8308>5145\n<8309>5122\n<830c>5131\n<830d>17887\n<830e>2260\n<830f>5125\n<8310>17888\n<8311>5134\n<8316>17891\n<8317>5158\n<831a>5135\n<831b>5166\n<831c>5141\n<8327>2142\n<8328>1351\n<832b>2728\n<832c>1198\n<832d>5160\n<832e>17906\n<832f>5152\n<8330>17907\n<8331>5149\n<8332>17908\n<8333>5162\n<8334>5148\n<8335>4215\n<8336>1199\n<8337>17909\n<8338>3250\n<8339>3262\n<833a>5161\n<833b>17910\n<833c>5147\n<8340>5157\n<8343>5155\n<8346>2258\n<8347>5154\n<8348>17918\n<8349>1188\n<834f>5153\n<8350>2153\n<8351>5142\n<8352>2009\n<8353>17924\n<8354>2526\n<835a>2119\n<835d>17930\n<835e>5151\n<835f>5156\n<8360>5159\n<8361>1429\n<8362>17931\n<8363>3252\n<8364>2044\n<8365>5164\n<8366>5163\n<8367>4240\n<8368>5165\n<8369>5167\n<836a>5169\n<836b>4216\n<836c>5168\n<836f>4144\n<8377>1920\n<8378>5173\n<837b>5186\n<837c>5181\n<837d>5184\n<8385>5180\n<8386>3053\n<8389>2525\n<838a>8875\n<838e>3304\n<8392>5146\n<8393>5178\n<8396>8127\n<8397>17958\n<8398>5187\n<839b>5150\n<839c>5179\n<839d>17961\n<839e>5188\n<839f>17962\n<83a0>5176\n<83a1>17963\n<83a2>8061\n<83a7>9011\n<83a8>5189\n<83a9>5183\n<83aa>5177\n<83ab>2829\n<83b0>5172\n<83b1>2462\n<83b2>2548\n<83b5>17972\n<83b6>5182\n<83b7>2054\n<83b8>5185\n<83b9>4237\n<83ba>5190\n<83bb>17973\n<83bc>5191\n<83bd>2732\n<83c0>5214\n<83c1>5192\n<83c5>5213\n<83c6>17979\n<83c7>1814\n<83ca>2308\n<83cb>17982\n<83cc>2345\n<83cf>1921\n<83d4>5206\n<83d5>17989\n<83d6>5201\n<83d7>17990\n<83d8>5195\n<83dc>1170\n<83dd>5199\n<83de>17994\n<83df>5207\n<83e0>1131\n<83e1>5217\n<83e5>5194\n<83e9>3055\n<83ea>5212\n<83ef>8013\n<83f0>5216\n<83f1>2603\n<83f2>1635\n<83fd>5200\n<8401>5193\n<8402>18016\n<8403>5209\n<8404>3620\n<8405>18017\n<8406>5205\n<8407>9012\n<840a>8177\n<840b>5198\n<840c>2765\n<840d>3035\n<840e>3773\n<840f>5208\n<8410>18020\n<8411>5204\n<8418>5197\n<841c>5202\n<841d>2691\n<8426>5215\n<8427>3937\n<8428>3283\n<842c>8587\n<8431>5234\n<8435>9033\n<8438>5203\n<843c>5228\n<843d>2699\n<8446>5229\n<8449>8715\n<8451>5219\n<8452>9030\n<8457>4599\n<8458>18072\n<8459>5221\n<845a>5220\n<845b>1771\n<845c>5218\n<8461>3054\n<8462>18077\n<8463>1516\n<8464>9031\n<8465>18078\n<8466>8595\n<8469>5230\n<846a>18081\n<846b>1968\n<846c>4388\n<846d>5235\n<846e>18082\n<846f>9889\n<8470>18083\n<8471>1363\n<8472>18084\n<8473>5222\n<8474>18085\n<8475>2440\n<8476>5231\n<8477>8034\n<8478>5227\n<8479>18086\n<847a>5225\n<8482>1466\n<8489>5226\n<848a>18098\n<848b>2176\n<848c>5232\n<848d>18099\n<848e>5233\n<8493>9037\n<8494>9032\n<8497>5249\n<8498>18106\n<8499>2766\n<849c>3543\n<84a1>5246\n<84af>4759\n<84b2>3056\n<84b3>18128\n<84b4>5248\n<84b8>4501\n<84b9>5247\n<84ba>5244\n<84bb>18132\n<84bc>7776\n<84bd>5240\n<84be>18133\n<84bf>5243\n<84c0>9029\n<84c1>5236\n<84c4>4025\n<84c9>3251\n<84ca>5242\n<84cb>7954\n<84cc>18140\n<84cd>5237\n<84d0>5238\n<84d1>3559\n<84d2>18143\n<84d3>5241\n<84d6>1078\n<84dd>2465\n<84de>18152\n<84df>2094\n<84e0>5245\n<84e3>5251\n<84e4>18155\n<84e5>5250\n<84e6>5239\n<84ec>2991\n<84ed>18161\n<84ee>8216\n<84ef>9013\n<84f0>5255\n<84fc>5262\n<84fd>9020\n<84fe>18173\n<84ff>5261\n<850c>5252\n<8511>2804\n<8512>18190\n<8513>2722\n<8514>9839\n<8517>4482\n<851a>3780\n<851e>9041\n<851f>5257\n<8520>18198\n<8521>1171\n<8522>18199\n<8523>8096\n<8526>9016\n<852b>2891\n<852c>3446\n<852d>8731\n<8537>3131\n<8538>5254\n<8539>5256\n<853a>5258\n<853b>5260\n<853c>949\n<853d>1079\n<8541>9026\n<8542>18218\n<8543>5270\n<8546>9039\n<8547>18221\n<8548>5264\n<8549>2183\n<854a>3274\n<854e>9021\n<8552>9028\n<8553>9009\n<8554>18228\n<8555>9035\n<8556>5259\n<8557>18229\n<8558>9019\n<8559>5263\n<855e>5267\n<8562>9040\n<8563>18237\n<8564>5266\n<8568>5265\n<8569>7860\n<856a>8614\n<856d>8651\n<8572>5271\n<8573>18247\n<8574>4367\n<8577>9045\n<8578>18250\n<8579>5277\n<857a>5268\n<857b>5272\n<857e>2500\n<8584>1034\n<8585>5280\n<8586>18258\n<8587>5275\n<8588>9022\n<8589>18259\n<858a>8052\n<858b>18260\n<858c>9008\n<858f>5276\n<8590>18263\n<8591>9856\n<8594>8410\n<859b>4047\n<859c>5279\n<859f>9034\n<85a4>5273\n<85a5>18278\n<85a6>8081\n<85a7>18279\n<85a8>5274\n<85a9>8455\n<85aa>3976\n<85ae>5278\n<85af>3460\n<85b0>5283\n<85b7>5282\n<85b8>18289\n<85b9>5281\n<85ba>9023\n<85c1>5285\n<85c9>2230\n<85cd>8180\n<85ce>9027\n<85cf>1183\n<85d0>2799\n<85d3>5284\n<85d4>18308\n<85d5>2939\n<85dc>5286\n<85dd>8722\n<85e4>3628\n<85e5>8711\n<85e9>1607\n<85ea>9049\n<85f4>8788\n<85f5>18333\n<85f6>9010\n<85f9>7718\n<85fa>9047\n<85fb>4392\n<85ff>5287\n<8604>9048\n<8605>5289\n<8606>8258\n<8607>8531\n<860b>8379\n<8611>2821\n<8616>5291\n<861a>9050\n<861e>9046\n<8622>9015\n<8627>5288\n<8628>18368\n<8629>5290\n<862d>8185\n<8638>4443\n<8639>18382\n<863a>9043\n<863b>18383\n<863c>5292\n<863f>8289\n<864d>7152\n<864e>1975\n<864f>2649\n<8650>2929\n<8651>2670\n<8654>7153\n<8655>7829\n<865a>4020\n<865b>18405\n<865c>8265\n<865d>18406\n<865e>4290\n<865f>8002\n<8662>6509\n<8667>8168\n<866b>1291\n<866c>7154\n<866d>18416\n<866e>7155\n<8671>3396\n<8679>1950\n<867a>7157\n<867b>7159\n<867c>7158\n<867d>3545\n<867e>3879\n<867f>7156\n<8680>3403\n<8681>4182\n<8682>2707\n<868a>3794\n<868b>7162\n<868c>1025\n<868d>7161\n<8693>7168\n<8694>18438\n<8695>1174\n<869c>4074\n<869d>7164\n<86a3>7166\n<86a4>4396\n<86a7>7165\n<86a8>7160\n<86a9>7169\n<86aa>7167\n<86ab>18452\n<86ac>7163\n<86af>7177\n<86b0>7174\n<86b1>7176\n<86b4>7180\n<86b5>7172\n<86b6>7170\n<86ba>7175\n<86c0>4602\n<86c4>7171\n<86c5>18468\n<86c6>3190\n<86c7>3352\n<86c8>18469\n<86c9>7178\n<86ca>1823\n<86cb>1425\n<86ce>7173\n<86cf>7179\n<86d0>7186\n<86d1>7192\n<86d4>2028\n<86d8>7191\n<86d9>3725\n<86da>18477\n<86db>4586\n<86de>7188\n<86df>7190\n<86e4>1773\n<86e9>7181\n<86ed>7184\n<86ee>2720\n<86ef>18491\n<86f0>4478\n<86f3>7185\n<86f4>7189\n<86f8>7195\n<86f9>4257\n<86fa>9690\n<86fe>1577\n<86ff>18498\n<8700>3464\n<8701>18499\n<8702>1665\n<8703>7193\n<8706>9687\n<8707>7194\n<8708>7196\n<8709>7199\n<870a>7197\n<870d>7198\n<8712>4090\n<8713>7187\n<8714>18508\n<8715>3706\n<8716>18509\n<8717>3806\n<8718>4520\n<8719>18510\n<871a>7205\n<871b>18511\n<871c>2784\n<871d>18512\n<871e>7202\n<8721>2458\n<8722>7214\n<8723>7200\n<8724>18515\n<8725>7203\n<8729>7210\n<872e>7204\n<8731>7209\n<8734>7208\n<8737>7211\n<873b>7201\n<873e>7206\n<873f>7212\n<8747>4241\n<8748>7207\n<8749>1212\n<874c>7220\n<874d>18543\n<874e>3958\n<8753>7223\n<8754>18548\n<8755>8494\n<8756>18549\n<8757>2013\n<8758>18550\n<8759>7227\n<8760>7218\n<8763>7224\n<8764>7226\n<8765>7228\n<8766>8626\n<876e>7221\n<876f>18566\n<8770>7219\n<8774>1970\n<8775>18570\n<8776>1500\n<8777>18571\n<8778>8606\n<877b>7217\n<877c>7225\n<8782>7213\n<8783>7238\n<8784>9692\n<8785>7235\n<8788>7234\n<878b>7222\n<878c>18581\n<878d>3253\n<8793>7229\n<8797>7237\n<879e>8300\n<879f>2813\n<87a2>8742\n<87a8>7231\n<87ab>7239\n<87ac>7241\n<87ad>7236\n<87ae>18605\n<87af>7230\n<87b3>7243\n<87b4>18609\n<87b5>7242\n<87ba>2692\n<87bb>9696\n<87bc>18614\n<87bd>7246\n<87c0>7248\n<87c4>8827\n<87c5>18620\n<87c6>7233\n<87c7>18621\n<87c8>9694\n<87c9>18622\n<87ca>7249\n<87cb>7244\n<87ce>9697\n<87d1>7247\n<87d2>7232\n<87d3>7245\n<87db>7250\n<87e0>7252\n<87e3>9685\n<87e4>18640\n<87e5>7240\n<87ea>7251\n<87eb>18645\n<87ec>7787\n<87ed>18646\n<87ee>7253\n<87ef>9691\n<87f2>7817\n<87f6>9689\n<87f9>3970\n<87fa>18654\n<87fb>8721\n<87fe>7256\n<8803>4877\n<8804>18661\n<8805>8745\n<8806>9686\n<880a>7257\n<8810>9693\n<8811>9695\n<8812>18670\n<8813>7255\n<8814>18671\n<8815>3263\n<8816>7254\n<881b>7258\n<881f>8175\n<8820>18679\n<8821>7259\n<8822>1347\n<8823>9688\n<8831>7977\n<8832>6797\n<8836>7771\n<8839>7260\n<883a>18698\n<883b>8310\n<883c>7261\n<8840>4051\n<8844>7338\n<8845>3985\n<8846>8855\n<884a>9872\n<884b>18708\n<884c>3995\n<884d>4101\n<8853>8511\n<8854>3899\n<8857>2215\n<8858>18716\n<8859>4076\n<885a>18717\n<885b>8600\n<885c>18718\n<885d>7816\n<8861>1945\n<8862>5613\n<8863>4169\n<8864>7078\n<8865>1152\n<8868>1110\n<8869>7079\n<886a>18724\n<886b>3321\n<886c>1257\n<886d>18725\n<886e>4870\n<886f>18726\n<8870>3482\n<8871>18727\n<8872>7080\n<8877>4563\n<8878>18732\n<8879>8844\n<887d>7081\n<887e>7358\n<887f>7082\n<8880>18736\n<8881>4335\n<8882>7083\n<8883>18737\n<8884>971\n<8885>7359\n<8888>7360\n<888b>1407\n<888c>18742\n<888d>2972\n<8892>3598\n<8896>4015\n<889c>3729\n<88a2>7084\n<88a3>18760\n<88a4>4871\n<88ab>1060\n<88ac>18767\n<88ad>3867\n<88b1>1695\n<88b7>7086\n<88bc>7087\n<88c1>1162\n<88c2>2586\n<88c5>4621\n<88c6>7085\n<88c9>7088\n<88ca>9713\n<88ce>7090\n<88cf>8204\n<88d2>4874\n<88d3>18793\n<88d4>4200\n<88d5>4326\n<88d8>7361\n<88d9>3220\n<88dc>7768\n<88dd>8876\n<88de>18798\n<88df>7362\n<88e2>7089\n<88e3>7091\n<88e4>2416\n<88e5>7092\n<88e8>7096\n<88f0>7098\n<88f1>7093\n<88f2>18810\n<88f3>3338\n<88f4>2978\n<88f8>2698\n<88f9>1877\n<88fc>7095\n<88fd>9895\n<88fe>7097\n<8902>1836\n<8907>9846\n<890a>7103\n<8910>1933\n<8911>18830\n<8912>1032\n<8913>7101\n<8919>7100\n<891a>7094\n<891b>7102\n<8921>7099\n<8925>3271\n<892a>3707\n<892b>7105\n<8930>5945\n<8931>18852\n<8932>8161\n<8933>9659\n<8934>7104\n<8935>18853\n<8936>7106\n<8937>18854\n<8938>9662\n<893b>8925\n<8941>7107\n<8944>3922\n<8947>9661\n<8956>7722\n<895d>9660\n<895e>7363\n<895f>2244\n<8960>9658\n<8964>9663\n<8965>18889\n<8966>7108\n<896a>8583\n<896b>18893\n<896c>9835\n<896f>7807\n<8972>8621\n<897b>7109\n<897f>3846\n<8980>18909\n<8981>4145\n<8982>18910\n<8983>7135\n<8986>1709\n<898b>8086\n<898f>7986\n<8993>8324\n<8996>8502\n<8997>18925\n<8998>9400\n<89a1>9402\n<89a6>9404\n<89aa>8420\n<89ab>18941\n<89ac>9401\n<89af>9405\n<89b2>9406\n<89b7>9407\n<89ba>8146\n<89bd>8189\n<89be>18954\n<89bf>9403\n<89c0>7981\n<89c1>2158\n<89c2>1844\n<89c3>18955\n<89c4>1855\n<89c5>2782\n<89c6>3434\n<89c7>6458\n<89c8>2475\n<89c9>2340\n<89cd>18956\n<89d2>2200\n<89d6>7511\n<89da>7513\n<89db>18963\n<89dc>7514\n<89dd>18964\n<89de>7512\n<89e3>2227\n<89e4>18969\n<89e5>7515\n<89e6>1320\n<89eb>7516\n<89ef>7517\n<89f3>6592\n<89f4>9737\n<89f5>18980\n<89f6>9738\n<89f7>18981\n<89f8>7828\n<8a00>4093\n<8a01>8927\n<8a02>7883\n<8a03>7949\n<8a07>4862\n<8a08>8055\n<8a09>18992\n<8a0a>8683\n<8a0b>18993\n<8a0c>8929\n<8a0d>18994\n<8a0e>8559\n<8a0f>18995\n<8a10>8928\n<8a13>8682\n<8a14>18998\n<8a15>8930\n<8a16>8395\n<8a17>18999\n<8a18>8056\n<8a1b>7906\n<8a1c>19002\n<8a1d>8690\n<8a1e>19003\n<8a1f>8528\n<8a23>8147\n<8a24>19007\n<8a25>8933\n<8a2a>7922\n<8a2d>8479\n<8a31>8669\n<8a34>8532\n<8a35>19019\n<8a36>8935\n<8a3a>8834\n<8a3e>7518\n<8a41>8934\n<8a46>8936\n<8a47>19032\n<8a48>6788\n<8a4e>8932\n<8a4f>19038\n<8a50>8810\n<8a51>19039\n<8a52>8939\n<8a53>19040\n<8a54>8937\n<8a55>8381\n<8a58>8938\n<8a5b>8893\n<8a5e>7838\n<8a61>8950\n<8a62>8679\n<8a63>8726\n<8a66>8503\n<8a69>8492\n<8a6a>19053\n<8a6b>7784\n<8a6c>8946\n<8a6d>7991\n<8a6e>8947\n<8a6f>19054\n<8a70>8943\n<8a71>8016\n<8a72>7952\n<8a73>8648\n<8a74>19055\n<8a75>8945\n<8a79>4435\n<8a7c>8944\n<8a7f>8942\n<8a84>8941\n<8a85>8862\n<8a86>8940\n<8a87>8162\n<8a88>19067\n<8a89>4323\n<8a8a>3631\n<8a8d>8446\n<8a93>3419\n<8a94>19073\n<8a95>7855\n<8a98>8758\n<8a99>19076\n<8a9a>8951\n<8a9e>8765\n<8a9f>19080\n<8aa0>7810\n<8aa1>8118\n<8aa2>19081\n<8aa3>8612\n<8aa4>8618\n<8aa5>8952\n<8aa6>8529\n<8aa7>19082\n<8aa8>8032\n<8aac>8519\n<8ab0>8517\n<8ab1>19089\n<8ab2>8156\n<8ab6>8961\n<8ab9>7925\n<8abc>8728\n<8abf>7878\n<8ac2>8960\n<8ac3>19101\n<8ac4>8884\n<8ac7>8553\n<8ac8>19104\n<8ac9>8957\n<8aca>19105\n<8acb>8426\n<8acc>19106\n<8acd>8948\n<8ace>19107\n<8acf>8955\n<8ad0>19108\n<8ad1>8956\n<8ad2>8231\n<8ad6>8288\n<8ad7>8959\n<8adb>8958\n<8adc>7879\n<8add>19115\n<8ade>8972\n<8ae2>8949\n<8ae3>19119\n<8ae4>8966\n<8ae5>19120\n<8ae6>8970\n<8ae7>8659\n<8aeb>8963\n<8aec>19124\n<8aed>8967\n<8aee>8971\n<8af1>8031\n<8af2>19127\n<8af3>8969\n<8af6>8962\n<8af7>7940\n<8af8>8861\n<8af9>19130\n<8afa>8699\n<8afb>19131\n<8afc>8968\n<8afd>19132\n<8afe>8364\n<8aff>19133\n<8b00>8334\n<8b01>8965\n<8b02>8599\n<8b03>19134\n<8b04>8561\n<8b05>8856\n<8b06>19135\n<8b07>5948\n<8b0a>8023\n<8b0e>8322\n<8b0f>19141\n<8b10>8977\n<8b14>8964\n<8b15>19145\n<8b16>8975\n<8b17>7733\n<8b18>19146\n<8b19>8401\n<8b1a>8976\n<8b1b>8099\n<8b1c>19147\n<8b1d>8662\n<8b21>8710\n<8b26>7519\n<8b27>19155\n<8b28>8973\n<8b2b>8978\n<8b2c>8333\n<8b2d>8979\n<8b33>8931\n<8b39>8122\n<8b3e>8312\n<8b49>8840\n<8b4e>8982\n<8b4f>8043\n<8b56>8980\n<8b57>19192\n<8b58>8496\n<8b59>8981\n<8b5a>8552\n<8b5b>19193\n<8b5c>8388\n<8b66>2270\n<8b6b>8984\n<8b6c>3016\n<8b6f>8729\n<8b70>8727\n<8b74>8405\n<8b77>8010\n<8b7d>8768\n<8b80>7891\n<8b8a>7753\n<8b8e>9755\n<8b92>7789\n<8b93>8440\n<8b94>19236\n<8b95>8187\n<8b96>8985\n<8b9c>8974\n<8b9d>19242\n<8b9e>8983\n<8b9f>19243\n<8ba0>4887\n<8ba1>2105\n<8ba2>1512\n<8ba3>1719\n<8ba4>3242\n<8ba5>2072\n<8ba8>3625\n<8ba9>3230\n<8baa>4890\n<8bab>3100\n<8bac>19244\n<8bad>4062\n<8bae>4208\n<8baf>4063\n<8bb0>2106\n<8bb1>19245\n<8bb2>2179\n<8bb3>2041\n<8bb6>4081\n<8bb7>4893\n<8bb8>4024\n<8bb9>1582\n<8bba>2690\n<8bbb>19246\n<8bbc>3524\n<8bbd>1674\n<8bbe>3361\n<8bbf>1632\n<8bc0>2342\n<8bc1>4515\n<8bc4>3039\n<8bc5>4676\n<8bc6>3405\n<8bc7>19247\n<8bc8>4426\n<8bc9>3540\n<8bca>4496\n<8bcb>4896\n<8bcc>4574\n<8bcd>1357\n<8bce>4898\n<8bcf>4897\n<8bd0>19248\n<8bd1>4210\n<8bd5>3435\n<8bd6>4902\n<8bd7>3394\n<8bda>1268\n<8bdb>4590\n<8bdc>4905\n<8bdd>1989\n<8bde>1423\n<8be1>1863\n<8be2>4056\n<8be3>4207\n<8be4>4908\n<8be5>1726\n<8be6>3927\n<8be7>1206\n<8bea>19249\n<8beb>2236\n<8bec>3819\n<8bed>4308\n<8bee>4911\n<8bef>3842\n<8bf0>4912\n<8bf1>4282\n<8bf2>2042\n<8bf3>4913\n<8bf4>3498\n<8bf5>3525\n<8bf6>4914\n<8bf7>3176\n<8bf8>4589\n<8bf9>4915\n<8bfa>2934\n<8bfb>1536\n<8bfc>4916\n<8bfd>1641\n<8bfe>2395\n<8c01>3490\n<8c02>4919\n<8c03>1496\n<8c04>4920\n<8c05>2571\n<8c06>4632\n<8c07>4921\n<8c08>3595\n<8c09>19250\n<8c0a>4209\n<8c0b>2836\n<8c0c>4922\n<8c0d>1502\n<8c0e>2022\n<8c0f>4923\n<8c10>3966\n<8c13>3788\n<8c17>1214\n<8c18>4931\n<8c19>4929\n<8c1a>4113\n<8c1b>4930\n<8c1c>2778\n<8c1d>4932\n<8c1e>19251\n<8c22>3974\n<8c23>4140\n<8c24>1028\n<8c25>4936\n<8c26>3112\n<8c27>4937\n<8c28>2248\n<8c29>2726\n<8c2c>2818\n<8c2d>3594\n<8c30>2473\n<8c31>3062\n<8c34>3121\n<8c37>1825\n<8c41>2050\n<8c46>1528\n<8c47>7414\n<8c48>8392\n<8c49>7415\n<8c4c>3732\n<8c50>7933\n<8c55>7445\n<8c5a>6544\n<8c61>3936\n<8c62>2004\n<8c6a>1911\n<8c6b>4328\n<8c73>5597\n<8c78>7504\n<8c79>1043\n<8c7a>1209\n<8c82>7505\n<8c85>7507\n<8c89>1928\n<8c8a>7506\n<8c8b>19314\n<8c8c>2743\n<8c94>7509\n<8c98>7508\n<8c9d>7739\n<8c9e>8831\n<8c9f>19329\n<8ca0>7948\n<8ca1>7769\n<8ca2>7972\n<8ca7>8378\n<8ca8>8037\n<8ca9>7920\n<8caa>8548\n<8cab>7984\n<8cac>8801\n<8caf>8866\n<8cb0>9387\n<8cb1>19336\n<8cb2>9391\n<8cb3>7912\n<8cb4>7993\n<8cb5>19337\n<8cb6>7752\n<8cb7>8304\n<8cb8>7848\n<8cb9>19338\n<8cba>9388\n<8cbb>7927\n<8cbc>8566\n<8cbd>9389\n<8cbe>19339\n<8cbf>8315\n<8cc0>8005\n<8cc1>9386\n<8cc2>8267\n<8cc3>8239\n<8cc4>8026\n<8cc5>9392\n<8cc6>19340\n<8cc7>8887\n<8cc8>8063\n<8cc9>19341\n<8cca>8805\n<8cd1>9394\n<8cd2>8475\n<8cd3>7761\n<8cd4>19348\n<8cd5>9396\n<8cda>9395\n<8cdb>19353\n<8cdc>7839\n<8cdd>19354\n<8cde>8472\n<8cdf>19355\n<8ce0>8372\n<8ce1>9135\n<8ce2>8635\n<8ce3>8306\n<8ce4>8085\n<8ce5>19356\n<8ce6>7946\n<8ce7>9398\n<8cea>8849\n<8ceb>9397\n<8cec>8824\n<8ced>7892\n<8cf4>8179\n<8cfa>8873\n<8cfb>9399\n<8cfc>7976\n<8cfd>8457\n<8cfe>8903\n<8d04>9390\n<8d05>8881\n<8d08>8806\n<8d09>19377\n<8d0a>8795\n<8d0b>8900\n<8d0c>19378\n<8d0d>8469\n<8d0e>19379\n<8d0f>8746\n<8d10>9393\n<8d16>8509\n<8d1b>7957\n<8d1c>8796\n<8d1d>1053\n<8d1e>4491\n<8d1f>1717\n<8d20>19389\n<8d21>1802\n<8d22>1165\n<8d23>4403\n<8d24>3898\n<8d25>999\n<8d26>4460\n<8d27>2058\n<8d28>4553\n<8d29>1620\n<8d2a>3587\n<8d2b>3029\n<8d2c>1098\n<8d2d>1811\n<8d2e>4603\n<8d2f>1850\n<8d30>1598\n<8d31>2157\n<8d34>3660\n<8d35>1868\n<8d36>6446\n<8d37>1406\n<8d38>2744\n<8d39>1646\n<8d3a>1935\n<8d3b>6447\n<8d3c>4407\n<8d3d>6448\n<8d3e>2121\n<8d3f>2036\n<8d40>6449\n<8d41>2599\n<8d42>2655\n<8d43>4386\n<8d44>4647\n<8d47>6454\n<8d4a>3351\n<8d4b>1710\n<8d4c>1539\n<8d4d>6455\n<8d4e>3457\n<8d4f>3334\n<8d50>1360\n<8d53>5691\n<8d54>2979\n<8d55>6456\n<8d56>2464\n<8d57>19392\n<8d58>4629\n<8d59>6457\n<8d5a>4617\n<8d5b>3287\n<8d5c>4745\n<8d5d>4739\n<8d5e>4385\n<8d5f>19393\n<8d60>4412\n<8d61>3325\n<8d62>4243\n<8d63>1742\n<8d64>1285\n<8d65>19394\n<8d66>3355\n<8d67>7412\n<8d6b>1932\n<8d6c>19398\n<8d6d>7413\n<8d70>4668\n<8d73>7407\n<8d74>1707\n<8d75>4469\n<8d76>1738\n<8d77>3087\n<8d81>1256\n<8d84>7408\n<8d85>1233\n<8d8a>4352\n<8d8b>3188\n<8d91>7410\n<8d94>7409\n<8d95>7956\n<8d99>8826\n<8d9f>3614\n<8da3>3199\n<8da8>8430\n<8db1>7411\n<8db2>9720\n<8db3>4672\n<8db4>2944\n<8db5>7452\n<8db8>7447\n<8db9>19450\n<8dba>7455\n<8dbb>19451\n<8dbc>7454\n<8dbd>19452\n<8dbe>4537\n<8dbf>7453\n<8dc3>4353\n<8dc4>7456\n<8dc5>19456\n<8dc6>7464\n<8dcb>986\n<8dcc>1497\n<8dcd>19461\n<8dd0>19462\n<8dd1>2973\n<8dda>7459\n<8ddb>7463\n<8ddc>19469\n<8ddd>2319\n<8dde>7460\n<8ddf>1781\n<8de3>7468\n<8de4>7471\n<8de8>2420\n<8de9>19476\n<8dea>1867\n<8deb>7448\n<8dec>7465\n<8def>2654\n<8df3>3659\n<8df4>19482\n<8df5>2156\n<8df6>19483\n<8df9>7469\n<8dfa>1572\n<8dfb>7470\n<8dfc>19484\n<8dfd>7473\n<8e05>7449\n<8e09>7472\n<8e0a>4256\n<8e0b>19495\n<8e0c>1297\n<8e0f>3575\n<8e10>8084\n<8e14>7474\n<8e1d>7475\n<8e1e>2320\n<8e1f>7476\n<8e22>3634\n<8e23>7479\n<8e29>1167\n<8e2a>4662\n<8e2b>19516\n<8e2c>7477\n<8e2d>19517\n<8e2e>7478\n<8e2f>7480\n<8e30>19518\n<8e31>7486\n<8e34>8752\n<8e35>7484\n<8e39>7483\n<8e3a>7481\n<8e3d>7485\n<8e40>7482\n<8e43>19528\n<8e44>3638\n<8e47>5947\n<8e48>1433\n<8e49>7487\n<8e4a>7492\n<8e4b>3574\n<8e4c>9725\n<8e55>9728\n<8e59>7450\n<8e63>9734\n<8e66>1069\n<8e69>7451\n<8e6c>1446\n<8e6d>1195\n<8e6e>19555\n<8e6f>7496\n<8e70>7493\n<8e71>19556\n<8e72>1558\n<8e73>19557\n<8e74>7497\n<8e75>19558\n<8e76>7494\n<8e7a>9727\n<8e7b>19562\n<8e7c>7495\n<8e7f>1373\n<8e80>19565\n<8e81>4397\n<8e85>7498\n<8e86>19569\n<8e87>1310\n<8e88>19570\n<8e89>9724\n<8e8a>7820\n<8e8b>9730\n<8e8c>19571\n<8e8d>8781\n<8e8e>19572\n<8e8f>7499\n<8e90>7501\n<8e91>9732\n<8e92>9726\n<8e93>9731\n<8e94>7500\n<8e9a>9729\n<8e9b>19578\n<8e9c>7502\n<8e9d>19579\n<8e9e>7503\n<8ea1>9733\n<8ea5>7843\n<8ea6>9736\n<8eaa>9735\n<8eab>3366\n<8eac>1795\n<8eaf>3192\n<8eb2>1570\n<8eba>3612\n<8ec0>8432\n<8eca>7803\n<8ecb>8807\n<8ecc>7990\n<8ecd>8150\n<8ece>6392\n<8ed2>8672\n<8ed3>19616\n<8ed4>9356\n<8edb>9357\n<8edf>8450\n<8ee4>9364\n<8eeb>9363\n<8ef2>9358\n<8ef8>8857\n<8ef9>9361\n<8efa>9366\n<8efb>9359\n<8efc>9362\n<8efd>19647\n<8efe>9367\n<8f03>8113\n<8f04>19652\n<8f05>9370\n<8f06>19653\n<8f07>9369\n<8f08>19654\n<8f09>8792\n<8f0a>9368\n<8f12>9371\n<8f13>19662\n<8f14>7945\n<8f15>8422\n<8f1b>8230\n<8f1c>9375\n<8f1d>8025\n<8f25>7995\n<8f26>9372\n<8f29>7738\n<8f2a>8283\n<8f2f>8048\n<8f33>9376\n<8f38>8507\n<8f3b>7943\n<8f3e>8816\n<8f3f>8759\n<8f42>9426\n<8f43>19692\n<8f44>8627\n<8f45>8773\n<8f46>9377\n<8f49>8872\n<8f4d>8828\n<8f4e>8112\n<8f54>9378\n<8f5f>8006\n<8f60>19713\n<8f61>9088\n<8f62>9365\n<8f63>19714\n<8f64>9360\n<8f65>19715\n<8f66>1242\n<8f67>4417\n<8f68>1861\n<8f69>4036\n<8f6a>19716\n<8f6b>6369\n<8f6c>4615\n<8f6d>6370\n<8f6e>2685\n<8f6f>3272\n<8f70>1947\n<8f74>4576\n<8f77>6377\n<8f78>6376\n<8f7b>3166\n<8f7c>6380\n<8f7d>4379\n<8f7e>6381\n<8f7f>2207\n<8f80>19717\n<8f83>2208\n<8f84>6384\n<8f85>1699\n<8f86>2567\n<8f87>6385\n<8f88>1051\n<8f89>2025\n<8f8a>1870\n<8f8b>6386\n<8f8c>19718\n<8f90>1685\n<8f91>2080\n<8f92>19719\n<8f93>3451\n<8f94>5492\n<8f95>4338\n<8f96>3882\n<8f97>4440\n<8f98>6390\n<8f99>4479\n<8f9a>6391\n<8f9b>3980\n<8f9c>1813\n<8f9d>19720\n<8f9e>1354\n<8f9f>1090\n<8fa3>2460\n<8fa6>7728\n<8fa7>19726\n<8faa>19727\n<8fab>1105\n<8fac>19728\n<8fad>7837\n<8fae>7755\n<8faf>7754\n<8fb0>1250\n<8fb1>3267\n<8fb2>8362\n<8fb6>5949\n<8fb9>1096\n<8fbd>2578\n<8fbe>1394\n<8fc1>3109\n<8fc2>4285\n<8fc3>19739\n<8fc4>3096\n<8fc5>4065\n<8fc6>19740\n<8fc7>1878\n<8fc8>2716\n<8fce>4242\n<8fcf>19746\n<8fd0>4366\n<8fd1>2253\n<8fd2>19747\n<8fd3>5950\n<8fd4>1618\n<8fd5>5951\n<8fd8>1998\n<8fd9>4483\n<8fda>19750\n<8fdb>2249\n<8fdc>4345\n<8fdd>3764\n<8fde>2549\n<8fdf>1278\n<8fe2>3657\n<8fe3>19753\n<8fe4>5954\n<8fe5>5952\n<8fe6>5956\n<8fe7>19754\n<8fe8>5958\n<8fe9>5955\n<8fea>1456\n<8feb>3047\n<8fec>19755\n<8fed>1501\n<8fee>5953\n<8fef>19756\n<8ff0>3469\n<8ff3>5957\n<8ff4>9851\n<8ff7>2777\n<8ff8>1070\n<8ff9>2070\n<8ffd>4628\n<9000>3708\n<9001>3522\n<9002>3425\n<9003>3622\n<9004>5960\n<9005>5959\n<9006>2889\n<9009>4042\n<900a>4064\n<900b>5961\n<900c>19768\n<900d>5964\n<900e>19769\n<900f>3689\n<9010>4591\n<9011>5963\n<9012>1470\n<9013>19770\n<9014>3695\n<9015>9202\n<9016>5965\n<9017>1529\n<9018>19771\n<9019>8830\n<901a>3673\n<901b>1853\n<901c>19772\n<901d>3420\n<901e>1270\n<901f>3534\n<9020>4399\n<9021>5966\n<9022>1671\n<9023>8217\n<9026>5962\n<902d>5969\n<902e>1409\n<902f>5970\n<9032>8123\n<9037>19785\n<9038>4196\n<903b>2694\n<903c>1071\n<903d>19788\n<903e>4295\n<9041>1564\n<9042>3553\n<9043>19791\n<9044>5971\n<9047>4315\n<904b>8787\n<904c>19797\n<904d>1106\n<904e>7998\n<904f>1587\n<9050>5974\n<9053>1441\n<9054>7846\n<9055>8590\n<9056>19798\n<9057>4172\n<9058>5976\n<905b>5978\n<905c>8684\n<905d>19801\n<905e>7870\n<905f>19802\n<9060>8778\n<9061>19803\n<9062>5977\n<9063>3119\n<9064>19804\n<9065>4138\n<9068>5975\n<9069>8499\n<906d>4389\n<906e>4475\n<9072>7812\n<9073>19813\n<9074>5980\n<9075>4686\n<9076>19814\n<9077>8399\n<9078>8674\n<9079>19815\n<907a>8719\n<907b>19816\n<907c>8233\n<907d>5981\n<907e>19817\n<907f>1093\n<9080>4132\n<9081>8307\n<9082>5982\n<9083>5984\n<9084>8021\n<9087>9201\n<9088>5983\n<9089>19820\n<908a>7750\n<908b>5985\n<908f>8291\n<9090>9203\n<9091>4191\n<9092>19824\n<9093>1452\n<9094>19825\n<9095>6167\n<9096>19826\n<9097>4967\n<9098>19827\n<9099>4970\n<909a>19828\n<909b>4968\n<909c>19829\n<909d>4969\n<90a1>4972\n<90a2>3994\n<90a3>2858\n<90a6>1017\n<90aa>3963\n<90ab>19838\n<90ac>4971\n<90ad>19839\n<90ae>4271\n<90af>1889\n<90b0>4978\n<90b1>3182\n<90b2>19840\n<90b3>4974\n<90b4>4973\n<90b5>3348\n<90b6>4975\n<90b7>19841\n<90b8>4977\n<90b9>4667\n<90ba>4976\n<90bb>2595\n<90be>4981\n<90c1>4313\n<90c4>4983\n<90c5>4980\n<90c6>19848\n<90c7>4984\n<90ca>2189\n<90ce>2484\n<90cf>4979\n<90d0>4982\n<90d1>4514\n<90d2>19854\n<90d3>4985\n<90d7>4989\n<90db>4990\n<90dc>4988\n<90dd>1913\n<90de>19861\n<90df>8990\n<90e0>19862\n<90e1>2353\n<90e2>4987\n<90e6>4986\n<90e7>4362\n<90e8>1158\n<90eb>4991\n<90ec>19868\n<90ed>1874\n<90ee>19869\n<90ef>4992\n<90f4>1248\n<90f5>8755\n<90f8>1415\n<90fd>1531\n<90fe>4993\n<9102>1588\n<9103>19883\n<9104>4994\n<9105>19884\n<9106>8992\n<9109>8647\n<9112>8892\n<9113>19895\n<9114>8988\n<9115>19896\n<9116>8785\n<9119>1074\n<911e>4996\n<9122>4995\n<9123>4997\n<9127>7867\n<912d>8839\n<912e>19914\n<912f>4999\n<9130>8237\n<9131>4998\n<9132>7851\n<9133>19915\n<9134>8989\n<9135>19916\n<9136>8991\n<9139>5000\n<913a>8987\n<9143>5001\n<9146>5002\n<9147>19929\n<9148>8993\n<9149>4276\n<914a>7416\n<914b>3186\n<914c>4640\n<914d>2981\n<9150>7417\n<9151>19930\n<9152>2293\n<9157>4026\n<915a>1648\n<915d>4368\n<915e>3581\n<9161>7422\n<9162>7421\n<9163>1887\n<9164>7420\n<9165>3531\n<9169>7424\n<916a>2493\n<916b>19944\n<916c>1295\n<916d>19945\n<916e>3675\n<916f>7425\n<9170>7423\n<9171>2181\n<9172>7428\n<9173>19946\n<9174>7429\n<9175>2206\n<9176>2749\n<9177>2414\n<9178>3542\n<9179>7430\n<917f>2899\n<9185>7432\n<9186>19955\n<9187>1343\n<9188>19956\n<9189>4682\n<918a>19957\n<918b>1370\n<918c>7431\n<918d>7434\n<9190>7433\n<9191>7435\n<9192>3996\n<9196>8789\n<919a>2774\n<919b>3204\n<919c>7823\n<91aa>7438\n<91ab>8716\n<91ac>8100\n<91b4>7443\n<91b5>7442\n<91ba>7444\n<91c0>8347\n<91c1>8664\n<91c2>19990\n<91c3>9722\n<91c4>19991\n<91c5>9721\n<91c6>19992\n<91c7>1168\n<91c8>19993\n<91c9>4281\n<91ca>3428\n<91cb>8500\n<91cc>2522\n<91cd>4567\n<91ce>4151\n<91cf>2568\n<91d0>19994\n<91d1>2241\n<91d5>9464\n<91d6>19995\n<91d7>9463\n<91d8>7880\n<91d9>9462\n<91dc>1701\n<91dd>8832\n<91e3>7877\n<91e4>9467\n<91e7>9466\n<91e8>20005\n<91e9>7917\n<91f5>9469\n<91f6>20017\n<91f7>9465\n<91f8>20018\n<91f9>9470\n<91fa>8397\n<9200>9480\n<9201>9476\n<9204>9478\n<9208>9471\n<9209>8336\n<920d>7901\n<920e>7973\n<920f>20032\n<9210>9475\n<9211>9474\n<9214>7802\n<9215>8358\n<921e>8149\n<9223>7953\n<9224>20047\n<9225>9479\n<9226>9472\n<9227>9477\n<922e>9497\n<922f>20054\n<9230>9493\n<9233>9484\n<9234>8241\n<9237>9483\n<9238>9487\n<9239>9498\n<923a>9481\n<923d>9486\n<923e>8756\n<923f>9491\n<9240>8064\n<9245>9473\n<9248>9495\n<9249>9494\n<924d>9496\n<9251>7766\n<9255>9485\n<9256>20076\n<9257>8403\n<925a>8314\n<925b>8398\n<925e>9488\n<9262>7765\n<9266>9482\n<9274>2155\n<9278>8106\n<9279>20101\n<927a>9502\n<927b>7967\n<927f>9517\n<9280>8733\n<9283>9522\n<9284>20107\n<9285>8571\n<928e>7552\n<9291>8623\n<9292>20118\n<9293>9516\n<9296>9512\n<9297>20121\n<9298>8332\n<9299>20122\n<929a>9519\n<929b>20123\n<929c>8636\n<92a0>9501\n<92a3>9525\n<92a4>20129\n<92a5>8717\n<92a6>9510\n<92a7>20130\n<92a8>9524\n<92a9>9514\n<92aa>9503\n<92ab>9521\n<92ac>9500\n<92ad>20131\n<92ae>7553\n<92b1>9509\n<92b7>8653\n<92b8>20139\n<92b9>8666\n<92ba>20140\n<92bb>8562\n<92bc>9534\n<92c1>8271\n<92c2>20145\n<92c3>9539\n<92c4>20146\n<92c5>8663\n<92c6>20147\n<92c7>7740\n<92c8>7554\n<92cc>9513\n<92cf>9505\n<92d2>7935\n<92dd>9535\n<92de>20165\n<92df>9540\n<92e3>9507\n<92e4>7824\n<92e5>9530\n<92e6>9541\n<92e7>20169\n<92e8>9533\n<92e9>20170\n<92ea>8385\n<92ed>8451\n<92ee>9504\n<92ef>9532\n<92f0>9531\n<92f1>9528\n<92f6>9536\n<92f7>20177\n<92f8>8141\n<92fc>7960\n<9301>9547\n<9306>9543\n<9310>8880\n<9311>20196\n<9312>9542\n<9315>9548\n<9318>7834\n<9319>9554\n<931a>9520\n<931b>9545\n<931f>9553\n<9320>7882\n<9321>20204\n<9322>8402\n<9326>8120\n<9327>20208\n<9328>8313\n<932b>8619\n<932e>9549\n<932f>7845\n<9332>8268\n<9333>8320\n<9336>9837\n<9337>20217\n<9338>9527\n<933e>7555\n<933f>20223\n<9340>9546\n<9341>8632\n<9342>20224\n<9343>9550\n<9346>9468\n<9347>9556\n<934b>7996\n<934c>20230\n<934d>7893\n<9354>9558\n<9358>8808\n<935b>7894\n<9364>9559\n<9365>9555\n<9369>9544\n<936a>7556\n<936b>20253\n<936c>8412\n<9370>9561\n<9375>8087\n<9376>9557\n<937a>8829\n<937e>9598\n<9382>8316\n<9383>20270\n<9384>9562\n<9387>9566\n<938a>7732\n<938f>7558\n<9396>8542\n<9397>20285\n<9398>9568\n<93a2>8610\n<93a3>9044\n<93a6>9571\n<93a7>9511\n<93a8>20297\n<93a9>9518\n<93aa>9560\n<93ab>20298\n<93ac>7963\n<93ad>20299\n<93ae>8835\n<93af>20300\n<93b0>9572\n<93b3>8352\n<93b4>20303\n<93b5>9573\n<93b8>9569\n<93bf>9570\n<93c3>9580\n<93c7>9581\n<93c8>8224\n<93c9>20318\n<93ca>7557\n<93cb>20319\n<93cc>9567\n<93cd>9578\n<93d1>9582\n<93d6>7681\n<93d7>9529\n<93d8>9564\n<93de>9579\n<93df>7791\n<93e0>20330\n<93e1>8132\n<93e2>9575\n<93e3>20331\n<93e4>9563\n<93e8>9757\n<93f5>9515\n<93f6>20347\n<93f7>9585\n<93f8>20348\n<93f9>9591\n<9403>9506\n<940b>9523\n<9410>8234\n<9411>20369\n<9412>9526\n<9413>9587\n<9414>9583\n<9418>8851\n<9419>9592\n<941d>9584\n<9420>9589\n<9428>9565\n<942e>8218\n<9432>9594\n<9433>8198\n<9434>20391\n<9435>8567\n<9438>9499\n<9439>20394\n<943a>9508\n<943e>7559\n<943f>9595\n<9444>8867\n<944a>9593\n<944b>20407\n<944c>9574\n<9452>8083\n<9453>20413\n<9454>9596\n<9460>9492\n<9463>9597\n<9464>20427\n<9465>9586\n<946b>7560\n<946c>20433\n<946d>9588\n<9470>8782\n<9471>20436\n<9472>8646\n<9477>8351\n<9478>20441\n<9479>9590\n<947c>8292\n<947d>8895\n<947e>9756\n<947f>8798\n<9488>4492\n<9489>1507\n<948a>6802\n<948b>6801\n<948e>3106\n<9491>20449\n<9492>1613\n<9493>1495\n<9494>6807\n<9495>6809\n<9496>20450\n<9497>6808\n<9498>20451\n<9499>1729\n<949d>1562\n<949e>1235\n<949f>4562\n<94a0>2857\n<94a1>1054\n<94a2>1745\n<94a5>4354\n<94a6>3154\n<94a7>2346\n<94a8>3816\n<94a9>1804\n<94aa>6816\n<94ab>6815\n<94ac>6818\n<94ad>6817\n<94ae>2918\n<94b1>3115\n<94b2>6821\n<94b3>3116\n<94b4>6822\n<94b5>1134\n<94bb>4679\n<94be>2123\n<94bf>6830\n<94c0>4272\n<94c1>3661\n<94c2>1139\n<94c3>2606\n<94c4>6831\n<94c5>3107\n<94c6>2738\n<94c7>20452\n<94cf>20453\n<94d8>6846\n<94d9>6845\n<94da>20456\n<94db>6847\n<94dc>3678\n<94dd>2664\n<94e1>4418\n<94e2>6851\n<94e3>3872\n<94e6>20457\n<94e9>6857\n<94ea>6856\n<94eb>6858\n<94ec>1776\n<94ed>2815\n<94f0>2195\n<94f1>4166\n<94f2>1216\n<94f6>4223\n<94f7>6864\n<94f8>4604\n<94f9>6865\n<94fa>3051\n<94fb>20458\n<94fe>2557\n<94ff>6868\n<9500>3943\n<9501>3565\n<9502>6870\n<9503>6869\n<9504>1311\n<9505>1873\n<9508>4013\n<950b>1667\n<950c>3978\n<9510>3276\n<9511>3635\n<9517>4481\n<9518>6883\n<9519>1392\n<951a>2735\n<951b>6884\n<951c>20459\n<9520>20460\n<9521>3852\n<9522>6888\n<9523>2695\n<9524>1339\n<9525>4627\n<9526>2246\n<9527>20461\n<9528>3892\n<9529>6891\n<952c>6892\n<952d>1510\n<952e>2159\n<952f>2321\n<9530>2769\n<9533>20462\n<9534>6895\n<9535>6903\n<9539>3135\n<953a>6937\n<953b>1548\n<953c>6899\n<953d>20463\n<9540>1541\n<9541>2755\n<9542>6902\n<9543>20464\n<9547>4499\n<9548>20465\n<9549>6907\n<954a>2906\n<954b>20466\n<954c>6908\n<954d>2907\n<9550>1759\n<9551>1026\n<9555>20467\n<955a>20468\n<955b>6918\n<955c>2276\n<955d>6921\n<9560>20469\n<9563>2582\n<956d>2499\n<956e>20470\n<956f>6933\n<9570>2550\n<9576>3919\n<9577>7797\n<957f>1225\n<9580>8317\n<9581>20480\n<9582>9151\n<9583>8467\n<9586>9152\n<9589>7749\n<958a>20485\n<958b>8152\n<958c>9156\n<958d>20486\n<958e>9154\n<958f>8452\n<9590>20487\n<9591>8637\n<9592>20488\n<9593>8071\n<9594>9155\n<9598>8809\n<95a1>8003\n<95a2>20500\n<95a3>7966\n<95a4>9849\n<95a5>7915\n<95a8>7989\n<95a9>8330\n<95aa>20503\n<95ab>9159\n<95ac>9161\n<95ad>9158\n<95b2>8783\n<95b6>9163\n<95b9>8691\n<95ba>20513\n<95bb>8695\n<95bc>9167\n<95bd>9166\n<95be>9162\n<95bf>9165\n<95c3>9168\n<95c6>9836\n<95c7>20519\n<95c8>9153\n<95c9>20520\n<95ca>8174\n<95cb>9169\n<95cc>8184\n<95d0>9171\n<95d4>9170\n<95d5>9172\n<95d6>7832\n<95dc>7980\n<95dd>20532\n<95de>9173\n<95e1>7793\n<95e2>9873\n<95e5>9157\n<95e8>2762\n<95e9>5765\n<95ea>3322\n<95eb>5766\n<95ec>20539\n<95ed>1086\n<95ee>3801\n<95ef>1334\n<95f0>3277\n<95f1>5767\n<95f2>3901\n<95f3>5768\n<95f4>2135\n<95f7>2763\n<95f8>4419\n<95f9>2873\n<95fa>1860\n<95fb>3796\n<95fc>5771\n<95fd>2811\n<95fe>5772\n<95ff>20540\n<9600>1604\n<9601>1774\n<9602>1929\n<9605>4359\n<9606>5775\n<9607>20541\n<9608>5776\n<9609>4084\n<960e>4095\n<960f>5781\n<9610>1218\n<9611>2470\n<9612>5782\n<9613>20542\n<9614>2454\n<9618>20543\n<961b>20544\n<961c>1714\n<961d>4948\n<961e>20545\n<961f>1554\n<9620>20546\n<9621>4950\n<9622>4949\n<962a>4952\n<962e>3273\n<9631>4951\n<9632>1629\n<9633>4125\n<9634>4220\n<9635>4500\n<9636>2216\n<963b>4677\n<963c>4954\n<963d>4953\n<963e>20563\n<963f>941\n<9640>3716\n<9641>20564\n<9642>4955\n<9643>20565\n<9644>1720\n<9645>2109\n<9646>2660\n<9647>2635\n<9648>1255\n<9649>4956\n<964a>20566\n<964b>2641\n<964c>2835\n<964d>2182\n<9650>3915\n<9654>4957\n<9655>3323\n<9658>8986\n<965b>1094\n<965c>20576\n<965d>8468\n<965e>20577\n<965f>4958\n<9660>20578\n<9661>1527\n<9662>4349\n<9663>8836\n<9664>1314\n<9667>4959\n<9668>4364\n<9669>3906\n<966a>2980\n<966b>20581\n<966c>4960\n<9670>8732\n<9671>20585\n<9672>4961\n<9673>7806\n<9674>4962\n<9675>2611\n<9676>3624\n<9677>3914\n<9678>8269\n<967d>8705\n<9685>4300\n<9686>2632\n<9687>20597\n<9688>4963\n<9689>20598\n<968a>7897\n<968b>3546\n<968c>20599\n<968d>4964\n<968e>8114\n<968f>3547\n<9690>4229\n<9694>1775\n<9695>8786\n<9696>20603\n<9697>4965\n<9698>954\n<9699>3875\n<969a>20604\n<969b>8057\n<969c>4464\n<96a7>3554\n<96a8>8535\n<96a9>20615\n<96aa>8639\n<96b0>4966\n<96b1>8735\n<96b2>20621\n<96b3>5764\n<96b4>8253\n<96b5>20622\n<96b6>2542\n<96b7>20623\n<96b8>8213\n<96b9>7545\n<96ba>20624\n<96bb>9893\n<96be>2868\n<96bf>20625\n<96c0>3219\n<96c1>4108\n<96c4>4006\n<96c5>4078\n<96c6>2082\n<96c7>1830\n<96c8>20628\n<96c9>6940\n<96cc>1353\n<96cd>4255\n<96ce>7548\n<96cf>1312\n<96d2>7549\n<96d5>1490\n<96d6>8534\n<96d9>8516\n<96da>20637\n<96db>7825\n<96dc>8791\n<96e0>7551\n<96e1>20641\n<96e2>8202\n<96e3>8338\n<96e8>4303\n<96e9>7521\n<96ea>4050\n<96ef>7523\n<96f2>8784\n<96f3>7522\n<96f6>2604\n<96f7>2498\n<96f8>20654\n<96f9>1035\n<96fa>20655\n<96fb>7875\n<96fe>3836\n<96ff>20658\n<9700>4019\n<9701>7525\n<9704>3939\n<9705>20661\n<9706>7524\n<9707>4497\n<9708>7526\n<9709>2750\n<970d>2057\n<970e>7528\n<970f>7527\n<9713>2881\n<9716>2593\n<971c>3487\n<971d>20675\n<971e>3881\n<9727>8616\n<972a>7529\n<972d>7530\n<9730>7531\n<9731>20690\n<9732>2653\n<9738>991\n<9739>3002\n<973d>9741\n<973e>7532\n<9742>9740\n<9743>20702\n<9744>9742\n<9748>8242\n<9752>3165\n<9753>7520\n<9756>2279\n<9759>2273\n<975a>9739\n<975b>1478\n<975e>1636\n<975f>20721\n<9760>2380\n<9761>2775\n<9762>2795\n<9765>4738\n<9768>8899\n<9769>1770\n<9773>2250\n<9774>4046\n<9775>20735\n<9776>987\n<977c>7624\n<9785>7625\n<978b>3959\n<978c>20754\n<978d>955\n<978e>20755\n<978f>7971\n<9790>20756\n<9793>20757\n<9794>7628\n<9798>3143\n<97a0>2302\n<97a3>7631\n<97a6>9877\n<97ab>7630\n<97ac>20776\n<97ad>1095\n<97ae>20777\n<97af>7629\n<97b2>7632\n<97b3>20780\n<97b4>7633\n<97bd>9822\n<97c3>9821\n<97c6>9874\n<97c9>9823\n<97ca>20798\n<97cb>8589\n<97cc>8445\n<97d3>8000\n<97d9>9317\n<97dc>9319\n<97dd>20812\n<97de>9318\n<97e6>3763\n<97e7>3240\n<97e8>20820\n<97e9>1890\n<97ed>2289\n<97f3>4219\n<97f4>20826\n<97f5>4370\n<97f6>3345\n<97ff>8649\n<9800>20835\n<9801>8713\n<9802>7881\n<9803>8425\n<9804>20836\n<9805>8650\n<9806>8518\n<9807>9669\n<9808>8668\n<9809>20837\n<980a>9310\n<980b>20838\n<980c>8527\n<980d>20839\n<9810>8769\n<9811>8586\n<9812>7727\n<9813>7900\n<9817>8383\n<9818>8244\n<981c>9673\n<9821>9672\n<9824>8718\n<9825>20852\n<9826>9675\n<982d>8573\n<9830>8062\n<9837>9676\n<9838>8131\n<983b>8377\n<983c>20869\n<983d>8577\n<9846>8154\n<984c>8563\n<984d>7905\n<984e>9677\n<9853>9678\n<9854>8694\n<9858>8779\n<9859>9681\n<985a>20890\n<985b>7872\n<985e>8200\n<9862>9680\n<9865>9682\n<9866>20898\n<9867>7978\n<986b>7794\n<986c>9683\n<986f>8638\n<9870>9684\n<9871>8260\n<9872>20904\n<9873>9679\n<9874>8435\n<9875>4154\n<9876>1508\n<9877>3175\n<9878>7136\n<9879>3931\n<987a>3496\n<987b>4022\n<987c>6183\n<987d>3736\n<987e>1828\n<987f>1560\n<9880>7137\n<9881>1007\n<9882>3521\n<9883>7138\n<9884>4327\n<9885>2644\n<9886>2613\n<9887>3043\n<9888>2272\n<9889>7139\n<988a>2120\n<988b>20905\n<988e>20906\n<988f>7142\n<9890>4170\n<9891>3028\n<9892>20907\n<9893>3704\n<9894>7143\n<9895>20908\n<9896>4246\n<9897>2386\n<9898>3637\n<9899>20909\n<989c>4094\n<989d>1581\n<98a0>1472\n<98a3>20910\n<98a4>1219\n<98a7>3202\n<98a8>7936\n<98b0>20916\n<98b1>9880\n<98b2>20917\n<98b3>9848\n<98b6>9422\n<98bc>9423\n<98c4>8376\n<98c5>20932\n<98c6>9424\n<98c7>20933\n<98c8>9425\n<98ce>1668\n<98d4>20941\n<98d5>6586\n<98d8>3021\n<98db>7924\n<98de>1638\n<98df>3402\n<98e0>9115\n<98e1>20946\n<98e2>9854\n<98e7>5658\n<98e8>7655\n<98e9>9117\n<98ec>20951\n<98ed>9121\n<98ee>20952\n<98ef>7921\n<98f2>8734\n<98f3>20955\n<98f4>9122\n<98fc>8523\n<98fd>7734\n<98fe>8501\n<9903>8109\n<9904>20967\n<9905>7763\n<9909>9123\n<990a>8707\n<990b>20971\n<990c>7911\n<990d>7656\n<9910>1172\n<9911>9124\n<9912>8343\n<9913>7908\n<9918>8760\n<991b>9125\n<991e>8090\n<9921>8643\n<9928>7982\n<992e>7657\n<9933>9116\n<9937>9126\n<993c>9118\n<993d>21006\n<993e>8245\n<993f>9127\n<9943>9128\n<9944>21010\n<9945>8309\n<994b>8171\n<994c>9132\n<9951>8042\n<9952>8441\n<9953>21017\n<9954>7659\n<9955>7658\n<9956>21018\n<9957>9830\n<995c>9831\n<995d>21023\n<995e>7788\n<9962>9133\n<9963>5661\n<9964>21027\n<9965>2069\n<9966>21028\n<996d>1622\n<996e>4226\n<996f>2165\n<9970>3429\n<9971>1038\n<9972>3516\n<9973>21029\n<9974>5668\n<9975>1595\n<9976>3231\n<9977>5669\n<997a>2201\n<997b>21032\n<997c>1126\n<997d>5670\n<997e>21033\n<997f>1589\n<9980>5671\n<9981>2876\n<9984>5672\n<9985>3911\n<9986>1846\n<9987>5673\n<9988>2444\n<9989>21036\n<998a>5674\n<998b>1213\n<998c>21037\n<998d>5675\n<998e>21038\n<998f>2620\n<9992>2719\n<9996>3438\n<9997>4718\n<9998>4857\n<9999>3920\n<99a5>6955\n<99a8>5086\n<99ac>8301\n<99ad>8770\n<99ae>7938\n<99b1>8579\n<99b2>21057\n<99b3>7813\n<99b4>8681\n<99c1>7767\n<99d0>8869\n<99d1>9223\n<99d2>8138\n<99d3>21084\n<99d4>9218\n<99d5>8066\n<99d8>9224\n<99d9>9220\n<99da>21087\n<99db>8497\n<99dc>21088\n<99dd>8580\n<99de>21089\n<99df>9219\n<99e0>21090\n<99e1>8302\n<99e2>9227\n<99ed>7999\n<99f1>8295\n<99ff>8151\n<9a00>21117\n<9a01>7811\n<9a05>9231\n<9a0d>9230\n<9a0e>8391\n<9a0f>9229\n<9a16>9234\n<9a19>8375\n<9a2b>9200\n<9a2c>21153\n<9a2d>9233\n<9a2e>9236\n<9a2f>21154\n<9a30>8560\n<9a36>9221\n<9a37>8460\n<9a38>9237\n<9a3e>8294\n<9a3f>21165\n<9a40>9042\n<9a41>9235\n<9a42>9232\n<9a45>8433\n<9a4a>9226\n<9a4d>9225\n<9a4e>21172\n<9a4f>9240\n<9a55>8103\n<9a56>21178\n<9a57>8700\n<9a5a>8129\n<9a5b>9222\n<9a5f>8860\n<9a62>8270\n<9a63>21186\n<9a64>9242\n<9a65>9241\n<9a6a>9228\n<9a6b>21191\n<9a6c>2708\n<9a6d>4329\n<9a6e>3717\n<9a6f>4058\n<9a70>1280\n<9a71>3194\n<9a72>21192\n<9a73>1148\n<9a74>2662\n<9a75>6074\n<9a76>3410\n<9a79>2307\n<9a7a>6077\n<9a7b>4609\n<9a7c>3718\n<9a7d>6079\n<9a7e>2128\n<9a7f>6078\n<9a82>2709\n<9a83>21193\n<9a84>2191\n<9a85>6082\n<9a86>2701\n<9a87>1886\n<9a88>6083\n<9a89>21194\n<9a8a>6084\n<9a8b>1271\n<9a8c>4114\n<9a8f>2354\n<9a90>6085\n<9a91>3086\n<9a96>6088\n<9a97>3020\n<9a98>6089\n<9a99>21199\n<9a9a>3296\n<9a9e>5941\n<9aa1>2697\n<9aa4>4583\n<9aa5>6097\n<9aa6>21200\n<9aa7>6098\n<9aa8>1824\n<9aaf>7721\n<9ab0>7635\n<9ab1>7634\n<9ab6>7638\n<9ab7>7636\n<9ab8>1880\n<9ab9>21211\n<9aba>7639\n<9abb>21212\n<9abc>7640\n<9ac0>7642\n<9ac1>7641\n<9ac2>7644\n<9ac5>7643\n<9acf>9825\n<9ad0>21225\n<9ad1>7647\n<9ad2>9892\n<9ad3>3549\n<9ad4>8564\n<9ad5>9827\n<9ad6>9826\n<9ad7>21226\n<9ad8>1754\n<9adf>7660\n<9ae0>21233\n<9ae1>7661\n<9ae6>7662\n<9aeb>7664\n<9aec>21242\n<9aed>7666\n<9aee>9845\n<9aef>7663\n<9af9>7667\n<9afa>21252\n<9afb>7665\n<9b03>4660\n<9b06>8524\n<9b07>21262\n<9b08>7668\n<9b0d>9850\n<9b0e>21267\n<9b0f>7669\n<9b13>7670\n<9b1a>9888\n<9b1f>7671\n<9b22>9832\n<9b23>7672\n<9b24>21283\n<9b25>7888\n<9b26>21284\n<9b27>8342\n<9b28>21285\n<9b29>9164\n<9b2e>9160\n<9b2f>5019\n<9b30>21290\n<9b31>8766\n<9b32>4704\n<9b3b>6003\n<9b3c>1862\n<9b41>2442\n<9b42>2047\n<9b43>7649\n<9b44>3046\n<9b45>7648\n<9b46>21303\n<9b47>7650\n<9b48>7652\n<9b49>7651\n<9b4d>7653\n<9b4e>9829\n<9b4f>3785\n<9b50>21307\n<9b51>7654\n<9b54>2826\n<9b58>9828\n<9b59>21313\n<9b5a>8761\n<9b6f>8266\n<9b74>9759\n<9b77>9758\n<9b81>9760\n<9b82>21349\n<9b83>9761\n<9b8e>9762\n<9b8f>21360\n<9b90>9767\n<9b91>7737\n<9b92>9765\n<9b9a>9769\n<9b9d>9774\n<9b9e>9771\n<9baa>9770\n<9bab>9773\n<9bac>21381\n<9bad>9768\n<9bae>8633\n<9bc0>9782\n<9bc1>9776\n<9bc7>9784\n<9bc8>21404\n<9bc9>8205\n<9bca>9783\n<9bd4>9797\n<9bd5>21414\n<9bd6>9786\n<9bdb>9795\n<9bdc>21419\n<9bdd>9792\n<9be1>9789\n<9be2>9793\n<9be3>21423\n<9be4>9790\n<9be7>9791\n<9be8>8128\n<9be9>21426\n<9bf0>9794\n<9bf4>9796\n<9bfd>9785\n<9bfe>21442\n<9bff>9804\n<9c08>9799\n<9c09>9803\n<9c0d>9801\n<9c10>9800\n<9c11>21456\n<9c12>9802\n<9c13>8456\n<9c20>9805\n<9c23>9780\n<9c24>21471\n<9c25>9809\n<9c28>9808\n<9c29>9810\n<9c2d>9807\n<9c31>9778\n<9c32>9806\n<9c33>9811\n<9c34>21480\n<9c35>9815\n<9c36>21481\n<9c37>9781\n<9c38>21482\n<9c39>9779\n<9c3a>21483\n<9c3b>9814\n<9c3e>9812\n<9c45>9816\n<9c48>9813\n<9c49>7757\n<9c52>9819\n<9c53>21502\n<9c54>9818\n<9c55>21503\n<9c56>9817\n<9c57>8238\n<9c58>9775\n<9c5d>9798\n<9c5e>21508\n<9c5f>9766\n<9c67>9820\n<9c6d>9772\n<9c78>9763\n<9c79>21531\n<9c7a>9777\n<9c7b>21532\n<9c7c>4296\n<9c7f>7561\n<9c80>21535\n<9c81>2650\n<9c82>7562\n<9c8b>7568\n<9c8c>21540\n<9c8d>1044\n<9c8e>7569\n<9c8f>21541\n<9c93>21542\n<9c9c>3895\n<9c9d>21547\n<9ca4>2523\n<9caa>21548\n<9cab>7588\n<9cac>21549\n<9caf>21550\n<9cb8>2263\n<9cb9>21551\n<9cc3>3285\n<9cd6>1111\n<9cde>2596\n<9cdf>7622\n<9ce2>7623\n<9ce5>8348\n<9ce9>9600\n<9cec>8924\n<9cf3>7941\n<9cf4>8331\n<9cf5>21578\n<9cf6>9601\n<9d06>9603\n<9d07>9602\n<9d08>21594\n<9d09>8686\n<9d15>8578\n<9d1b>8771\n<9d1c>21611\n<9d1d>9607\n<9d1e>21612\n<9d1f>9608\n<9d23>9604\n<9d26>8701\n<9d27>21618\n<9d28>8687\n<9d2f>9610\n<9d30>9612\n<9d3b>8007\n<9d3f>7965\n<9d42>9613\n<9d51>8144\n<9d52>9618\n<9d53>9615\n<9d5c>9620\n<9d5d>7904\n<9d60>9617\n<9d61>9621\n<9d6a>9623\n<9d6b>21672\n<9d6c>8374\n<9d6f>9624\n<9d72>8438\n<9d87>9605\n<9d88>21697\n<9d89>9625\n<9d93>9622\n<9d98>9626\n<9d99>21711\n<9d9a>9627\n<9da5>9629\n<9da9>9630\n<9daf>9036\n<9db4>8004\n<9dbb>9824\n<9dbc>9632\n<9dc0>9628\n<9dc1>21743\n<9dc2>9631\n<9dc3>21744\n<9dc4>8044\n<9dd3>9634\n<9dd7>8366\n<9dd8>21762\n<9dd9>9611\n<9dda>9635\n<9de5>9609\n<9de6>9637\n<9def>9636\n<9df2>9638\n<9df3>9619\n<9df8>9639\n<9df9>8738\n<9dfa>9641\n<9e0c>9640\n<9e15>9606\n<9e1a>9633\n<9e1b>9642\n<9e1c>21816\n<9e1d>9616\n<9e1e>9614\n<9e1f>2900\n<9e20>6965\n<9e21>2073\n<9e22>6966\n<9e23>2814\n<9e24>21817\n<9e25>2937\n<9e26>4068\n<9e27>21818\n<9e2d>4069\n<9e2e>21819\n<9e2f>4117\n<9e30>21820\n<9e31>6973\n<9e32>6972\n<9e33>4330\n<9e34>21821\n<9e35>3715\n<9e36>6974\n<9e37>6976\n<9e38>6975\n<9e3d>1766\n<9e3e>6979\n<9e3f>1951\n<9e40>21824\n<9e43>2328\n<9e44>6982\n<9e45>1579\n<9e4a>3216\n<9e4d>21825\n<9e4e>6989\n<9e4f>2997\n<9e50>21826\n<9e51>6990\n<9e55>6991\n<9e56>21830\n<9e57>6992\n<9e58>7637\n<9e59>21831\n<9e5d>21832\n<9e5e>6996\n<9e63>6997\n<9e64>1934\n<9e65>21837\n<9e6d>7006\n<9e70>4234\n<9e71>7005\n<9e72>21840\n<9e73>7007\n<9e74>21841\n<9e75>9864\n<9e79>9886\n<9e7a>9723\n<9e7b>21845\n<9e7c>8076\n<9e7d>8692\n<9e7e>7446\n<9e7f>2656\n<9e82>7676\n<9e8b>7679\n<9e92>7680\n<9e93>2651\n<9e97>8207\n<9e9d>7682\n<9e9e>21868\n<9e9f>7683\n<9ea5>8305\n<9ea6>2714\n<9ea9>9719\n<9eaf>9878\n<9eb4>7406\n<9eb5>9871\n<9eb8>7405\n<9ebb>2704\n<9ebc>21889\n<9ec4>2011\n<9ec9>4856\n<9ecc>8922\n<9ecd>3465\n<9ece>2515\n<9ecf>6954\n<9ed0>21901\n<9ed1>1937\n<9ed4>3114\n<9ed8>2831\n<9ede>7873\n<9edf>7688\n<9ee0>7687\n<9ee1>21909\n<9ee2>7689\n<9ee5>7692\n<9ee6>21912\n<9ee7>7691\n<9ee8>7859\n<9ee9>7690\n<9eea>7693\n<9eef>7694\n<9ef2>9834\n<9ef3>21919\n<9ef4>9866\n<9ef7>9833\n<9ef8>21922\n<9ef9>6741\n<9efa>21923\n<9efd>9752\n<9efe>7542\n<9eff>9753\n<9f09>9754\n<9f0a>21933\n<9f0b>7543\n<9f0c>21934\n<9f0d>7544\n<9f0e>1509\n<9f0f>21935\n<9f10>4724\n<9f13>1821\n<9f14>21938\n<9f15>9843\n<9f16>21939\n<9f17>4721\n<9f18>21940\n<9f19>5087\n<9f20>3466\n<9f21>21947\n<9f22>7695\n<9f2c>7696\n<9f2f>7697\n<9f37>7699\n<9f38>21966\n<9f39>7698\n<9f3a>21967\n<9f3b>1072\n<9f3c>21968\n<9f44>7702\n<9f4a>8390\n<9f4b>8811\n<9f4f>9427\n<9f50>3082\n<9f51>6594\n<9f52>7814\n<9f53>21982\n<9f54>9743\n<9f59>9745\n<9f5c>9747\n<9f5f>9744\n<9f60>9746\n<9f61>8240\n<9f62>21991\n<9f63>9841\n<9f66>9748\n<9f6a>9750\n<9f6b>21997\n<9f6c>9749\n<9f72>8434\n<9f77>9751\n<9f7f>1282\n<9f80>7533\n<9f83>7534\n<9f84>2605\n<9f8b>3198\n<9f8c>7541\n<9f8d>8247\n<9f90>8371\n<9f94>7970\n<9f95>9453\n<9f99>2627\n<9f9a>1793\n<9f9b>6740\n<9f9c>7988\n<9f9f>1859\n<9fa0>4851\n<e81e>22056\n<e826>22064\n<e83b>22085\n<e843>22093\n<e864>22126\n<f92c>22031\n<fa11>22035\n<fa18>22038\n<fe30>10013\n<ff04>166\n<ff5e>106\n<ffe2>10014\n<ffe3>355\n<ffe4>10015\n<ffe5>265\nendcidchar\nbegincidrange\n<20><7e>1\n<02ca><02cb>9907\n<0391><03a1>525\n<03a3><03a9>542\n<03b1><03c1>549\n<03c3><03c9>566\n<0410><0415>602\n<0416><0435>609\n<0436><044f>642\n<2018><2019>109\n<201c><201d>111\n<2032><2033>163\n<2160><216b>250\n<2170><2179>9897\n<2190><2191>186\n<2196><2199>9916\n<2227><2228>131\n<2264><2265>155\n<2266><2267>9924\n<226e><226f>153\n<2460><2469>230\n<2474><2487>210\n<2488><249b>190\n<2500><254b>738\n<2550><2573>9927\n<2581><258f>9963\n<2593><2595>9978\n<25bc><25bd>9981\n<25e2><25e5>9983\n<2e82><2e83>22429\n<2e85><2e87>22431\n<2e89><2e8a>22434\n<2e8d><2e96>22436\n<2e98><2e99>22446\n<2e9b><2ea6>22448\n<2ea8><2ea9>22460\n<2eab><2ead>22462\n<2eaf><2eb2>22465\n<2eb4><2eb5>22469\n<2eb6><2eb7>22083\n<2eb8><2eba>22471\n<2ebc><2ec9>22474\n<2ecb><2ef3>22488\n<2ff0><2ffb>10060\n<3000><3002>96\n<3008><300f>115\n<3010><3011>125\n<3014><3015>113\n<3016><3017>123\n<301d><301e>9990\n<3021><3029>9992\n<3033><3035>22395\n<3038><303a>22398\n<3041><3093>356\n<309b><309c>10020\n<309d><309e>10025\n<30a1><30f6>439\n<30fd><30fe>10022\n<3105><3129>700\n<312a><312c>22401\n<31a0><31b7>22404\n<3220><3229>240\n<338e><338f>10002\n<339c><339e>10004\n<33d1><33d2>10010\n<3400><3446>22529\n<3448><3472>22600\n<3474><359d>22643\n<359f><360d>22941\n<360f><3619>23052\n<361b><3917>23063\n<3919><396d>23828\n<396f><39ce>23913\n<39d1><39de>24009\n<39e0><3a72>24023\n<3a74><3b4d>24170\n<3b4f><3c6d>24388\n<3c6f><3cdf>24675\n<3ce1><4055>24788\n<4057><415e>25673\n<4160><4336>25937\n<4338><43ab>26408\n<43ad><43b0>26524\n<43b2><43dc>26528\n<43de><44d5>26571\n<44d7><464b>26819\n<464d><4660>27192\n<4662><4722>27212\n<4724><4728>27405\n<472a><477b>27410\n<477d><478c>27492\n<478e><4946>27508\n<4948><4979>27949\n<497b><497c>27999\n<497e><4981>28001\n<4982><4983>22102\n<4985><4986>22104\n<4987><499a>28006\n<499c><499e>28026\n<49a0><49b5>28029\n<49b8><4c76>28051\n<4c78><4c9e>28754\n<4c9f><4ca1>22113\n<4ca4><4d12>28793\n<4d13><4d19>22118\n<4d1a><4dad>28904\n<4daf><4db5>29052\n<4e04><4e06>10073\n<4e1f><4e21>10079\n<4e2e><4e2f>10085\n<4e40><4e42>10092\n<4e5a><4e5b>10101\n<4e62><4e65>10103\n<4e67><4e68>10107\n<4e6a><4e6f>10109\n<4e74><4e7d>10116\n<4e7f><4e81>10126\n<4e83><4e85>10129\n<4e96><4e97>10135\n<4e9c><4e9d>10138\n<4eaf><4eb1>10142\n<4eb6><4eb9>10146\n<4ebc><4ebe>10150\n<4ecf><4ed0>10155\n<4eda><4edc>10158\n<4ee6><4ee7>10163\n<4eed><4eef>10166\n<4ef8><4efa>10171\n<4f02><4f08>10177\n<4f0b><4f0c>10184\n<4f12><4f16>10186\n<4f1c><4f1d>10191\n<4f28><4f29>10195\n<4f2c><4f2e>10197\n<4f3e><4f42>10206\n<4f44><4f45>10211\n<4f47><4f4c>10213\n<4f61><4f62>10222\n<4f6a><4f6b>10226\n<4f6d><4f6e>10228\n<4f71><4f72>10230\n<4f77><4f7a>10233\n<4f80><4f82>10238\n<4f92><4f93>10247\n<4f98><4f9a>10250\n<4f9e><4f9f>10254\n<4fa1><4fa2>10256\n<4fb0><4fb4>10261\n<4fb6><4fbe>10266\n<4fc0><4fc1>10275\n<4fc6><4fc9>10277\n<4fcb><4fcd>10281\n<4fd2><4fd6>10284\n<4fe4><4fe5>10292\n<4feb><4fec>10295\n<4ff4><4ff7>10299\n<4ffb><4ffd>10304\n<5001><5005>10308\n<5007><5008>10313\n<5015><5017>10319\n<501d><501e>10323\n<5022><5024>10326\n<502f><5039>10330\n<503f><5042>10343\n<5044><5046>10347\n<504a><504b>10350\n<5050><5054>10353\n<5056><5059>10358\n<505d><5064>10363\n<5066><506b>10371\n<506d><5073>10377\n<5078><507a>10384\n<507c><507d>10387\n<5081><5084>10389\n<5086><5087>10393\n<5089><508c>10395\n<508e><5095>10399\n<509a><50a1>10408\n<50aa><50ab>10418\n<50ae><50b1>10420\n<50b8><50b9>10425\n<50bc><50bd>10427\n<50bf><50c1>10429\n<50c3><50c4>10432\n<50c6><50c8>10434\n<50ca><50ce>10437\n<50d2><50d4>10443\n<50d7><50d9>10446\n<50db><50dd>10449\n<50df><50e4>10452\n<50e9><50eb>10458\n<50ef><50f2>10461\n<50f6><50f8>10466\n<50fc><50ff>10470\n<510c><510f>10478\n<5116><5117>10484\n<5119><511e>10486\n<5122><5129>10493\n<512b><5131>10501\n<5133><5136>10508\n<5138><5139>10512\n<513d><513e>10514\n<514e><5150>10520\n<5157><5159>10524\n<515d><5161>10528\n<5163><5164>10533\n<5166><5167>10535\n<517e><517f>10541\n<5183><5184>10543\n<5186><5187>10545\n<518a><518b>10547\n<518e><5191>10549\n<5193><5194>10553\n<519d><519f>10557\n<51a6><51aa>10562\n<51ad><51ae>10567\n<51b8><51ba>10570\n<51be><51bf>10573\n<51c1><51c3>10575\n<51d2><51da>10583\n<51de><51df>10593\n<51e2><51e3>10595\n<51e5><51ea>10597\n<5204><5205>10609\n<520b><520c>10612\n<520f><5210>10614\n<5213><5215>10616\n<521e><521f>10620\n<5221><5223>10622\n<5225><5227>10625\n<5231><5232>10631\n<5234><5235>10633\n<523f><5240>4753\n<5245><5246>10637\n<5248><5249>10639\n<524e><524f>10641\n<5252><5253>10643\n<5257><525a>10646\n<525f><5260>10651\n<5262><5264>10653\n<526b><526d>10658\n<5270><5271>10661\n<5276><527c>10664\n<5284><5286>10673\n<528e><528f>10677\n<5294><529a>10680\n<52a4><52a7>10688\n<52ac><52ad>5006\n<52ae><52b0>10692\n<52b4><52bd>10695\n<52c4><52c6>10707\n<52cc><52cf>10712\n<52d3><52d4>10717\n<52e0><52e1>10722\n<52e5><52ef>10725\n<52f2><52f4>10736\n<52f6><52f7>10739\n<52fb><52fd>10741\n<5301><5304>10744\n<5309><530c>10749\n<5311><5314>10754\n<531b><531c>10759\n<531e><531f>10761\n<5324><5325>10764\n<5327><5329>10766\n<532b><532c>10769\n<5332><5338>10772\n<533c><533d>10779\n<534b><534d>10784\n<5358><5359>10788\n<536c><536d>10795\n<537b><537e>10800\n<5380><5381>10804\n<5387><5388>10807\n<538e><5394>10810\n<5396><5397>10817\n<539b><539c>10819\n<53aa><53ac>10825\n<53af><53b1>10828\n<53b7><53ba>10833\n<53bc><53be>10837\n<53c4><53c7>10841\n<53ce><53d0>10845\n<53d2><53d3>10848\n<53dc><53de>10852\n<53fe><5400>10859\n<5418><541a>10867\n<5424><5425>10872\n<5436><5437>10877\n<5441><5442>10882\n<5444><5445>10884\n<544c><544f>10888\n<5452><5454>5380\n<545d><5461>10894\n<5469><5470>10902\n<5479><547a>10911\n<547e><547f>10913\n<5487><548a>10918\n<5497><5498>10925\n<549a><549b>5395\n<549e><54a2>10928\n<54a9><54aa>5419\n<54b5><54b7>10937\n<54b9><54ba>10940\n<54ca><54cb>10945\n<54d3><54d4>5408\n<54d9><54da>5416\n<54e2><54e4>10951\n<54eb><54ec>10954\n<54ef><54f1>10956\n<54f4><54f9>10959\n<5502><5503>10968\n<550a><550e>10972\n<5512><5513>10977\n<5515><551a>10979\n<551c><551f>10985\n<5522><5523>5431\n<5525><5526>10990\n<5528><5529>10992\n<5534><5536>10997\n<5538><553b>11000\n<5547><5548>11008\n<554b><554e>11010\n<5551><5552>11014\n<5557><555b>11017\n<555f><5560>11023\n<5562><5563>11025\n<5568><5569>11027\n<556f><5574>11030\n<5575><5577>5449\n<5579><557a>11036\n<5585><5586>11040\n<558c><558e>11042\n<5592><5593>11046\n<5595><5597>11048\n<559a><559b>11051\n<55a0><55a6>11054\n<55a8><55a9>11061\n<55af><55b0>11065\n<55bd><55be>5468\n<55bf><55c3>11072\n<55ca><55cb>11078\n<55cc><55cd>5487\n<55cf><55d0>11080\n<55d7><55d9>11083\n<55eb><55ec>5477\n<55ed><55ee>11091\n<55f0><55f1>11093\n<55f2><55f3>5485\n<55f8><55fc>11096\n<5602><5605>11102\n<560a><560b>11107\n<5610><5613>11109\n<5619><561a>11114\n<5620><5622>11117\n<5625><5626>11120\n<562a><562b>11123\n<563c><563e>11128\n<5642><564b>11132\n<564f><5653>11142\n<5655><5656>11147\n<565a><565b>11149\n<565e><565f>11151\n<566d><566e>11156\n<567b><567c>5517\n<567d><567f>11163\n<5681><5684>11166\n<5688><568b>11170\n<5690><5692>11175\n<5696><5698>11179\n<569a><56a2>11182\n<56a4><56a5>11191\n<56a9><56ad>11194\n<56b0><56b2>11199\n<56b8><56bb>11203\n<56bd><56bf>11207\n<56c3><56c4>11210\n<56c6><56c7>11212\n<56cd><56d0>11215\n<56d2><56d3>11219\n<56d5><56d6>11221\n<56d8><56d9>11223\n<56e5><56ea>11227\n<56ee><56ef>11234\n<56f2><56f3>11236\n<56f6><56f8>11238\n<56fb><56fc>11241\n<5700><5702>11243\n<570e><5711>11248\n<5714><5715>11252\n<5719><571b>11255\n<571d><571e>11258\n<5720><5722>11260\n<5724><5727>11263\n<572e><572f>5036\n<5731><5732>11268\n<5734><5738>11270\n<573c><573d>11275\n<5743><5746>11279\n<5748><5749>11283\n<5752><5756>11286\n<5758><5759>11291\n<5762><5763>11293\n<5770><5772>11299\n<5774><5775>11302\n<5778><577a>11304\n<577d><5781>11307\n<5787><578a>11312\n<578d><5791>11316\n<5794><579a>11321\n<579c><579f>11328\n<57af><57b1>11336\n<57b5><57b7>11340\n<57b9><57c1>11343\n<57c4><57ca>11352\n<57cc><57cd>11359\n<57d0><57d1>11361\n<57d6><57d7>11364\n<57db><57dc>11366\n<57e2><57e3>11369\n<57e5><57ec>11371\n<57f0><57f3>11380\n<57f5><57f6>11384\n<57fb><57fc>11386\n<57fe><57ff>11388\n<5803><5804>11391\n<5808><5809>11393\n<580e><5810>11396\n<5812><5814>11399\n<5817><5818>11402\n<581a><581c>11404\n<5822><5823>11408\n<5825><5829>11410\n<582b><582e>11415\n<5832><5833>11419\n<5836><5843>11421\n<5845><5849>11435\n<5855><5856>11443\n<5859><585d>11445\n<585f><5861>11450\n<5866><586a>11454\n<586d><5874>11459\n<5876><5878>11467\n<587a><587d>11470\n<5886><5888>11477\n<588b><5891>11480\n<5894><5898>11487\n<58a0><58a7>11494\n<58aa><58ad>11502\n<58af><58b2>11506\n<58b4><58ba>11510\n<58bf><58c0>11518\n<58c2><58c4>11520\n<58c8><58d0>11524\n<58d6><58d7>11535\n<58db><58dd>11537\n<58e5><58e8>11542\n<58f1><58f2>11548\n<58f4><58f5>11550\n<58f7><58f8>11552\n<58fb><58fc>11554\n<58fe><5901>11556\n<5905><5906>11561\n<5908><590c>11563\n<5910><5913>11569\n<5917><5918>11573\n<591d><591e>11576\n<5920><5921>11578\n<5932><5933>11585\n<5935><5936>11587\n<593f><5940>11591\n<5945><5946>11594\n<594c><594d>11597\n<5952><5953>11600\n<595b><595f>11603\n<5963><5964>11609\n<5966><5968>11611\n<596f><5972>11616\n<597a><597c>11622\n<597e><5980>11625\n<598b><598c>11630\n<598e><5991>11632\n<5994><5995>11636\n<599a><599c>11639\n<599f><59a2>11642\n<59a6><59a7>11646\n<59a9><59aa>6008\n<59ac><59ad>11648\n<59b0><59b1>11650\n<59b3><59b8>11652\n<59bc><59bd>11659\n<59bf><59c5>11661\n<59c7><59c9>11668\n<59cc><59cf>11671\n<59d5><59d6>11675\n<59de><59e2>11679\n<59e6><59e7>11685\n<59e9><59eb>11687\n<59ed><59f8>11690\n<59fc><59fe>11703\n<5a05><5a06>6021\n<5a0a><5a0b>11708\n<5a0d><5a10>11710\n<5a14><5a17>11715\n<5a19><5a1b>11719\n<5a1d><5a1e>11722\n<5a21><5a22>11724\n<5a26><5a28>11727\n<5a2a><5a30>11730\n<5a37><5a3b>11739\n<5a3d><5a3f>11744\n<5a42><5a45>11747\n<5a47><5a48>11751\n<5a4b><5a54>11753\n<5a56><5a59>11763\n<5a5b><5a61>11767\n<5a63><5a65>11774\n<5a68><5a69>11777\n<5a6b><5a6c>11779\n<5a6e><5a73>11781\n<5a78><5a79>11787\n<5a7b><5a7e>11789\n<5a80><5a91>11793\n<5a93><5a99>11811\n<5a9c><5aa6>11818\n<5aa8><5aa9>11829\n<5aab><5ab1>11831\n<5ab6><5ab7>11839\n<5ab9><5abc>11841\n<5abf><5ac0>11845\n<5ac3><5ac8>11847\n<5aca><5acb>11853\n<5acd><5ad1>11855\n<5ad9><5adb>11862\n<5add><5adf>11865\n<5ae4><5ae5>11869\n<5ae7><5ae8>11871\n<5aec><5af0>11874\n<5af2><5af4>11879\n<5af6><5afa>11882\n<5afc><5aff>11887\n<5b01><5b07>11891\n<5b0d><5b15>11899\n<5b1a><5b20>11909\n<5b22><5b29>11916\n<5b2b><5b2f>11924\n<5b35><5b36>11931\n<5b39><5b3f>11933\n<5b41><5b4b>11940\n<5b4d><5b4f>11951\n<5b60><5b61>11957\n<5b67><5b68>11959\n<5b6d><5b6f>11961\n<5b76><5b77>11966\n<5b7b><5b7c>11969\n<5b8d><5b8e>11975\n<5b90><5b92>11977\n<5ba7><5ba9>11983\n<5bac><5baf>11986\n<5bb1><5bb2>11990\n<5bba><5bbc>11993\n<5bc0><5bc1>11996\n<5bc8><5bcb>11999\n<5bcd><5bcf>12003\n<5bd4><5bdc>12007\n<5bf1><5bf4>12021\n<5bfd><5bfe>12026\n<5c02><5c03>12029\n<5c12><5c13>12034\n<5c1e><5c21>12039\n<5c28><5c2b>12045\n<5c2d><5c30>12049\n<5c32><5c33>12053\n<5c35><5c36>12055\n<5c43><5c44>12057\n<5c46><5c47>12059\n<5c4c><5c4d>12061\n<5c52><5c54>12063\n<5c56><5c58>12066\n<5c5a><5c5d>12069\n<5c69><5c6b>12075\n<5c72><5c78>12080\n<5c7b><5c7e>12087\n<5c83><5c87>12092\n<5c89><5c8b>12097\n<5c8e><5c8f>12100\n<5c92><5c93>12102\n<5c98><5c99>5553\n<5c9d><5ca0>12105\n<5ca4><5ca8>12109\n<5cae><5cb0>12115\n<5cb9><5cbc>12121\n<5cc2><5cc3>12127\n<5cc5><5cca>12129\n<5ccc><5cd1>12135\n<5cd3><5cd8>12141\n<5cda><5ce0>12147\n<5ce2><5ce3>12154\n<5ceb><5cec>12158\n<5cee><5cef>12160\n<5cf1><5cf3>12162\n<5cf7><5cfa>12166\n<5cfe><5d01>12171\n<5d02><5d03>5572\n<5d04><5d05>12175\n<5d08><5d0c>12177\n<5d0f><5d13>12182\n<5d18><5d1a>12188\n<5d1c><5d1d>12191\n<5d1f><5d23>12193\n<5d2a><5d2b>12200\n<5d2f><5d33>12202\n<5d35><5d3c>12207\n<5d3f><5d46>12215\n<5d48><5d49>12223\n<5d4d><5d4f>12225\n<5d51><5d57>12228\n<5d59><5d5a>12235\n<5d5e><5d68>12238\n<5d6d><5d6e>12250\n<5d70><5d73>12252\n<5d75><5d80>12256\n<5d85><5d86>12269\n<5d88><5d96>12271\n<5d9a><5d9c>12287\n<5d9e><5d9f>12290\n<5da1><5da6>12292\n<5da8><5db6>12298\n<5dbd><5dc4>12315\n<5dc6><5dca>12323\n<5dce><5dd1>12329\n<5dd5><5dda>12334\n<5ddf><5de0>12341\n<5de3><5de4>12343\n<5dec><5ded>12346\n<5df5><5df6>12348\n<5df8><5dfc>12350\n<5dff><5e00>12355\n<5e09><5e0b>12359\n<5e0d><5e0e>12362\n<5e12><5e13>12364\n<5e1e><5e24>12367\n<5e28><5e2a>12374\n<5e2f><5e30>12378\n<5e34><5e35>12381\n<5e39><5e3a>12383\n<5e3b><5e3c>5539\n<5e3e><5e3f>12385\n<5e46><5e4b>12388\n<5e4d><5e53>12394\n<5e59><5e5a>12402\n<5e5c><5e5d>12404\n<5e64><5e6a>12407\n<5e6d><5e71>12414\n<5e81><5e83>12421\n<5e88><5e89>12425\n<5e8c><5e8e>12427\n<5ea1><5ea4>12434\n<5ea8><5eaa>12438\n<5eae><5eb2>12442\n<5eba><5ebd>12448\n<5ebf><5ec8>12452\n<5ecb><5ed0>12462\n<5ed4><5ed5>12468\n<5ed7><5eda>12470\n<5edc><5ede>12474\n<5ee4><5ee7>12477\n<5eed><5ef2>12483\n<5ef8><5ef9>12490\n<5efb><5efd>12492\n<5f05><5f07>12495\n<5f0c><5f0e>12499\n<5f19><5f1a>12506\n<5f1c><5f1e>12508\n<5f21><5f24>12511\n<5f2b><5f2c>12516\n<5f36><5f38>12522\n<5f3d><5f3f>12526\n<5f41><5f45>12529\n<5f49><5f4b>12535\n<5f5a><5f5c>12542\n<5f5e><5f60>12545\n<5f67><5f68>12550\n<5f6e><5f6f>12553\n<5f74><5f76>12556\n<5f7d><5f7f>12561\n<5f8d><5f8f>12566\n<5f93><5f94>12569\n<5f9a><5f9b>12572\n<5fa2><5fa7>12576\n<5fab><5fac>12582\n<5faf><5fb4>12584\n<5fba><5fbb>12592\n<5fbe><5fc2>12594\n<5fc7><5fc8>12599\n<5fca><5fcb>12601\n<5fd3><5fd5>12604\n<5fda><5fdc>12607\n<5fde><5fdf>12610\n<5fe2><5fe3>12612\n<5fe5><5fe6>12614\n<5fe8><5fe9>12616\n<5fef><5ff0>12619\n<5ff2><5ff4>12621\n<5ff6><5ff7>12624\n<5ff9><5ffa>12626\n<6005><6006>5708\n<6007><6009>12629\n<600b><600c>12632\n<6010><6011>12634\n<6017><6018>12637\n<601e><601f>12640\n<6022><6024>12642\n<602c><602e>12645\n<6030><6034>12648\n<6036><603a>12653\n<603d><603e>12658\n<6044><604a>12661\n<604e><604f>12669\n<6053><6054>12672\n<6056><6058>12674\n<605b><605c>12677\n<605e><6061>12679\n<6065><6066>12683\n<6071><6072>12686\n<6074><6075>12688\n<6078><6079>5724\n<6080><6082>12692\n<6085><6088>12695\n<608a><608b>12699\n<608e><6091>12701\n<6097><6099>12707\n<60a1><60a2>12712\n<60a4><60a5>12714\n<60a9><60aa>12717\n<60b9><60ba>12723\n<60bd><60c4>12725\n<60c7><60c9>12733\n<60cc><60d0>12736\n<60d2><60d4>12741\n<60d6><60d7>12744\n<60e2><60e5>12749\n<60f7><60f8>12755\n<60fc><60ff>12757\n<6102><6105>12761\n<610a><610c>12766\n<6110><6114>12769\n<6116><6119>12774\n<611d><611e>12778\n<6121><6122>12780\n<6128><612a>12783\n<612c><6133>12786\n<6135><6136>12794\n<6138><613d>12796\n<6140><6147>12802\n<614f><6150>12812\n<6152><6154>12814\n<6156><6157>12817\n<615b><615c>12820\n<6160><6161>12823\n<6165><6166>12825\n<616c><616d>12828\n<6171><6172>12831\n<6178><6181>12834\n<6183><6189>12844\n<618c><618d>12851\n<6195><6199>12855\n<619b><619c>12860\n<619e><61a3>12862\n<61a5><61a6>12868\n<61af><61b1>12872\n<61b3><61b5>12875\n<61b8><61bd>12878\n<61bf><61c1>12884\n<61c3><61c6>12887\n<61cd><61d0>12891\n<61d5><61dd>12896\n<61e0><61e2>12905\n<61e4><61e5>12908\n<61e9><61f1>12911\n<61f3><61f4>12920\n<6201><6205>12925\n<621c><621e>12933\n<6228><6229>12939\n<6235><6236>12945\n<6238><623c>12947\n<6244><6246>12953\n<6248><6249>6646\n<624f><6250>12957\n<6255><6257>12959\n<6259><625a>12962\n<625c><6262>12964\n<6264><6265>12971\n<6271><6272>12974\n<6274><6275>12976\n<6277><6278>12978\n<627a><627b>12980\n<6281><6283>12983\n<6285><6288>12986\n<628b><6290>12990\n<629c><629e>12998\n<62a6><62a7>13002\n<62a9><62aa>13004\n<62ad><62b0>13006\n<62b2><62b4>13010\n<62b6><62b8>13013\n<62c0><62c1>13018\n<62dd><62de>13025\n<62e0><62e1>13027\n<62ea><62eb>13030\n<62f8><62fb>13035\n<6303><6306>13040\n<630a><630d>13044\n<630f><6310>13048\n<6312><6315>13050\n<6317><6319>13054\n<6326><6327>13058\n<632c><632e>13061\n<6330><6331>13064\n<6333><6338>13066\n<633b><633c>13072\n<633f><6341>13074\n<6347><6348>13078\n<6351><6354>13081\n<6356><635d>13085\n<6364><6366>13094\n<636f><6370>13099\n<6373><6375>13101\n<6378><6379>13104\n<637c><637f>13106\n<6385><6386>13111\n<6393><6395>13116\n<6399><639f>13120\n<63b1><63b2>13132\n<63b5><63b6>13134\n<63c1><63c3>13140\n<63c7><63c8>13144\n<63ca><63cc>13146\n<63d3><63d5>13150\n<63d7><63d9>13153\n<63db><63dd>13156\n<63e4><63e8>13161\n<63eb><63ec>13166\n<63ef><63f1>13168\n<63f9><63fc>13174\n<6403><6404>13179\n<6406><640a>13181\n<6411><6412>13187\n<6415><6416>13189\n<6418><641a>13191\n<6422><6425>13196\n<6427><6429>13200\n<642e><6433>13204\n<6437><6439>13211\n<643b><643c>13214\n<6442><6443>13218\n<644b><6450>13221\n<6455><6457>13228\n<6459><645b>13231\n<6460><6466>13235\n<646a><646c>13243\n<6470><6472>13247\n<6474><6475>13250\n<6478><6479>2819\n<647c><6481>13253\n<6489><6490>13261\n<6497><6498>13270\n<649a><649d>13272\n<64a0><64a2>13276\n<64a6><64a8>13279\n<64b7><64b8>5354\n<64c8><64c9>13291\n<64d5><64d6>13297\n<64db><64dd>13300\n<64e7><64eb>13307\n<64ed><64ee>13312\n<64f5><64f6>13315\n<64f8><64f9>13317\n<6501><6503>13321\n<6507><6508>13325\n<650a><650e>13327\n<6510><6511>13332\n<651e><6521>13339\n<6526><6529>13343\n<6530><6533>13348\n<653c><653d>13354\n<6540><6544>13356\n<6546><6547>13361\n<654a><654b>13363\n<654d><654e>13365\n<6552><6554>13368\n<655f><6561>13374\n<6564><6565>13377\n<6567><656a>13379\n<656d><656f>13383\n<6579><6581>13389\n<6584><6586>13398\n<6588><658a>13401\n<658d><658f>13404\n<659d><659e>13412\n<65a2><65a3>13415\n<65b1><65b6>13421\n<65ba><65bb>13428\n<65be><65c0>13430\n<65c7><65ca>13434\n<65d0><65d1>13439\n<65d3><65d5>13441\n<65d8><65df>13444\n<65e3><65e4>13453\n<65ea><65eb>13455\n<65ee><65f0>6410\n<65f2><65f5>13457\n<65f8><65f9>13461\n<65fb><65ff>13463\n<6604><6605>13469\n<6607><6609>13471\n<6610><6612>13476\n<6616><6618>13479\n<661a><661c>13482\n<6621><6624>13486\n<6629><662c>13491\n<6632><6633>13497\n<6637><663b>13499\n<663f><6640>13505\n<6644><664a>13507\n<664d><664e>13514\n<6650><6651>13516\n<6658><6659>13518\n<665b><665c>13520\n<6662><6663>13524\n<6669><666d>13528\n<6671><6673>13533\n<6678><6679>13537\n<667b><667d>13539\n<667f><6681>13542\n<6685><6686>13546\n<668a><668b>13548\n<668d><6690>13550\n<6692><6695>13554\n<6698><669c>13558\n<669e><66a1>13563\n<66a3><66a6>13567\n<66a9><66aa>13571\n<66ac><66ad>13573\n<66af><66b3>13575\n<66b5><66b8>13580\n<66ba><66bd>13584\n<66bf><66c3>13588\n<66ca><66d5>13595\n<66d7><66d8>13607\n<66db><66dc>6440\n<66de><66df>13610\n<66e1><66e5>13612\n<66e7><66e8>13617\n<66ea><66eb>13619\n<66ed><66ef>13621\n<66f5><66f6>13625\n<66fa><66fb>13627\n<6701><6702>13630\n<6704><6707>13632\n<670e><670f>13637\n<6711><6713>13639\n<6718><671a>13643\n<6720><6725>13648\n<6732><6733>13657\n<6736><6739>13659\n<673b><673c>13663\n<673e><673f>13665\n<6744><6745>13668\n<674a><674b>13671\n<6754><6755>13675\n<6757><675b>13677\n<6762><6764>13683\n<6766><6767>13686\n<676b><676c>13688\n<6778><677b>13693\n<6782><6783>13699\n<6785><6786>13701\n<678c><678f>13705\n<6791><6794>13709\n<679f><67a1>13716\n<67b1><67b2>13724\n<67b9><67c0>13727\n<67c5><67ce>13736\n<67d5><67d7>13746\n<67e3><67e4>13752\n<67e6><67e8>13754\n<67ea><67eb>13757\n<67ed><67ee>13759\n<67f5><67fc>13762\n<6801><6804>13771\n<6814><6815>13779\n<6818><681c>13781\n<681e><6820>13786\n<6822><6828>13789\n<682b><6831>13796\n<6832><6833>6262\n<6834><6836>13803\n<683a><683b>13806\n<6856><685f>13814\n<6860><6861>6264\n<686c><6873>13825\n<6878><6880>13834\n<6887><688e>13845\n<6890><6892>13853\n<6894><6896>13856\n<6899><689c>13859\n<68a0><68a1>13864\n<68a3><68a5>13866\n<68a9><68ac>13869\n<68b1><68b2>13874\n<68b6><68bf>13877\n<68c3><68c8>13888\n<68ce><68d1>13896\n<68d3><68d4>13900\n<68db><68de>13903\n<68e1><68e2>13907\n<68e4><68e6>13909\n<68e8><68ed>13912\n<68f2><68f4>13919\n<68f6><68f8>13922\n<68fd><6900>13926\n<6902><6904>13930\n<6906><690a>13933\n<6913><691e>13940\n<691f><6920>6290\n<6921><6923>13952\n<6925><692c>13955\n<692e><692f>13963\n<6931><6933>13965\n<6935><6938>13968\n<693a><693c>13972\n<6940><6941>13976\n<6943><6949>13978\n<694b><6952>13985\n<6955><6956>13993\n<6958><6959>13995\n<695b><695c>13997\n<6961><6962>14000\n<6964><6965>14002\n<6969><696a>14005\n<696f><6970>14008\n<6972><6974>14010\n<697a><697b>14014\n<697d><697f>14016\n<6987><6988>6312\n<698a><698c>14022\n<698e><6993>14025\n<6996><6997>14031\n<6999><699a>14033\n<699d><69a6>14035\n<69af><69b0>14047\n<69b2><69b3>14049\n<69b5><69b6>14051\n<69b8><69ba>14053\n<69bc><69be>14056\n<69c2><69c9>14060\n<69d1><69d3>14069\n<69d5><69da>14072\n<69dc><69de>14078\n<69e1><69e6>14081\n<69e8><69ec>14087\n<69ee><69f1>14092\n<69f4><69fc>14096\n<6a03><6a04>14107\n<6a06><6a09>14109\n<6a0b><6a12>14113\n<6a14><6a16>14121\n<6a17><6a18>6335\n<6a1a><6a1d>14124\n<6a24><6a27>14130\n<6a2b><6a2e>14135\n<6a32><6a34>14140\n<6a36><6a37>14143\n<6a3b><6a3c>14145\n<6a3f><6a43>14147\n<6a45><6a46>14152\n<6a49><6a4a>14154\n<6a4c><6a4f>14156\n<6a51><6a57>14160\n<6a5c><6a5e>14168\n<6a63><6a64>14172\n<6a66><6a70>14174\n<6a72><6a78>14185\n<6a7a><6a7b>14192\n<6a7d><6a7f>14194\n<6a81><6a83>14197\n<6a85><6a88>14200\n<6a8a><6a8d>14204\n<6a92><6a93>14209\n<6a95><6a96>14211\n<6a98><6a9b>14213\n<6a9d><6a9f>14217\n<6aa4><6aa8>14221\n<6aad><6aae>14227\n<6ab0><6ab2>14229\n<6ab4><6ab7>14232\n<6ab9><6aba>14236\n<6abc><6ac2>14238\n<6ac4><6ad2>14245\n<6ad4><6ad9>14260\n<6ae0><6ae6>14267\n<6aed><6af2>14276\n<6af4><6af7>14282\n<6af9><6afa>14286\n<6afc><6b03>14288\n<6b05><6b09>14296\n<6b0b><6b0e>14301\n<6b10><6b11>14305\n<6b13><6b15>14307\n<6b17><6b1d>14310\n<6b25><6b26>14318\n<6b28><6b31>14320\n<6b33><6b36>14330\n<6b3b><6b3c>14335\n<6b3f><6b42>14337\n<6b44><6b45>14341\n<6b4a><6b4b>14344\n<6b4d><6b4f>14346\n<6b51><6b58>14349\n<6b5a><6b5e>14357\n<6b68><6b69>14363\n<6b6b><6b71>14365\n<6b73><6b76>14372\n<6b7d><6b80>14377\n<6b81><6b82>6358\n<6b8e><6b91>14384\n<6b92><6b93>6362\n<6b94><6b95>14388\n<6b9a><6b9b>6365\n<6b9c><6b9d>14392\n<6b9f><6ba0>14394\n<6ba2><6ba3>14396\n<6ba5><6ba9>14398\n<6bac><6bad>14403\n<6bb0><6bb1>14405\n<6bb8><6bb9>14408\n<6bbc><6bbe>14410\n<6bc3><6bc4>14414\n<6bc7><6bca>14416\n<6bd0><6bd1>14422\n<6bdc><6be0>14426\n<6be2><6be9>14431\n<6bec><6bee>14439\n<6bf0><6bf2>14442\n<6bf6><6bf8>14446\n<6bfa><6bfc>14449\n<6c00><6c04>14453\n<6c09><6c0b>14458\n<6c18><6c1a>6494\n<6c1c><6c1e>14464\n<6c36><6c37>14472\n<6c39><6c3c>14474\n<6c3e><6c3f>14478\n<6c43><6c45>14480\n<6c4b><6c4f>14484\n<6c51><6c53>14489\n<6c58><6c5a>14493\n<6c62><6c63>14496\n<6c65><6c67>14498\n<6c68><6c69>5800\n<6c6b><6c6f>14501\n<6c77><6c78>14509\n<6c7a><6c7c>14511\n<6c7f><6c80>14514\n<6c8a><6c8b>14518\n<6c8d><6c8e>14520\n<6c91><6c92>14522\n<6c95><6c98>14524\n<6c9c><6c9e>14529\n<6caf><6cb0>14536\n<6cb4><6cb7>14538\n<6cc0><6cc3>14543\n<6cc6><6cc8>14547\n<6ccd><6ccf>14551\n<6cd1><6cd2>14554\n<6cd8><6cda>14556\n<6cdc><6cdd>14559\n<6ce6><6ce7>14563\n<6cec><6ced>14566\n<6cf7><6cf8>5809\n<6cff><6d00>14571\n<6d02><6d03>14573\n<6d05><6d06>14575\n<6d08><6d0a>14577\n<6d0f><6d11>14581\n<6d13><6d16>14584\n<6d1c><6d1d>14589\n<6d1f><6d24>14591\n<6d28><6d29>14598\n<6d2c><6d2d>14600\n<6d2f><6d30>14602\n<6d36><6d38>14605\n<6d3f><6d40>14609\n<6d55><6d58>14616\n<6d61><6d62>14623\n<6d64><6d65>14625\n<6d67><6d68>14627\n<6d6b><6d6d>14629\n<6d70><6d73>14632\n<6d75><6d76>14636\n<6d7a><6d7b>14638\n<6d7d><6d81>14640\n<6d83><6d84>14645\n<6d8a><6d8b>14648\n<6d8f><6d90>14651\n<6d93><6d94>5846\n<6d96><6d9a>14654\n<6dac><6dad>14662\n<6db0><6db1>14664\n<6db3><6db4>14666\n<6db6><6db7>14668\n<6db9><6dbe>14670\n<6dc1><6dc3>14676\n<6dc8><6dca>14679\n<6dcd><6dd0>14682\n<6dd2><6dd5>14686\n<6dda><6ddc>14691\n<6de2><6de3>14695\n<6de7><6de9>14698\n<6def><6df0>14702\n<6dfd><6e04>14707\n<6e06><6e09>14715\n<6e12><6e13>14721\n<6e18><6e19>14724\n<6e1b><6e1c>14726\n<6e1e><6e1f>14728\n<6e27><6e28>14731\n<6e30><6e31>14735\n<6e35><6e37>14738\n<6e3b><6e3d>14742\n<6e3f><6e42>14745\n<6e45><6e4c>14749\n<6e4f><6e52>14757\n<6e53><6e54>5874\n<6e59><6e5a>14763\n<6e5c><6e5d>14765\n<6e60><6e6a>14767\n<6e6c><6e6d>14778\n<6e70><6e7d>14780\n<6e80><6e82>14794\n<6e87><6e88>14798\n<6e8a><6e8e>14800\n<6e91><6e95>14805\n<6e99><6e9b>14811\n<6ea0><6ea1>14815\n<6ea3><6ea4>14817\n<6ea8><6ea9>14820\n<6eab><6eae>14822\n<6eb8><6eb9>14829\n<6ebe><6ec0>14832\n<6ec8><6eca>14837\n<6ed8><6ed9>14844\n<6edb><6edd>14846\n<6eea><6eeb>14851\n<6eed><6eee>14853\n<6ef0><6ef1>14855\n<6ef5><6ef6>14858\n<6efa><6efe>14860\n<6f03><6f05>14866\n<6f07><6f08>14869\n<6f0a><6f0e>14871\n<6f10><6f12>14876\n<6f16><6f19>14879\n<6f1b><6f1f>14883\n<6f25><6f28>14889\n<6f34><6f35>14895\n<6f39><6f3d>14898\n<6f42><6f45>14904\n<6f46><6f47>5897\n<6f48><6f4a>14908\n<6f4e><6f50>14912\n<6f52><6f53>14915\n<6f55><6f57>14917\n<6f5a><6f5b>14920\n<6f5f><6f61>14923\n<6f67><6f6c>14928\n<6f75><6f76>14936\n<6f7d><6f7e>14940\n<6f81><6f83>14942\n<6f8a><6f8b>14946\n<6f8f><6f96>14948\n<6f98><6f9b>14956\n<6f9d><6f9f>14960\n<6fa2><6fa3>14963\n<6fa5><6fa6>14965\n<6faa><6fad>14968\n<6faf><6fb0>14972\n<6fb4><6fb5>14975\n<6fb7><6fb8>14977\n<6fba><6fbf>14979\n<6fc4><6fc8>14985\n<6fca><6fd0>14990\n<6fd3><6fd4>14997\n<6fd6><6fd7>14999\n<6fd9><6fda>15001\n<6fdc><6fdd>15003\n<6fe2><6fe3>15005\n<6fe5><6fea>15007\n<6fec><6fed>15013\n<6ff2><6ff9>15015\n<6fff><7004>15025\n<7007><7008>15031\n<700c><700e>15034\n<7012><7014>15038\n<7016><7017>15041\n<7021><7022>15046\n<7024><7026>15048\n<7029><702f>15051\n<7033><7034>15059\n<7036><7038>15061\n<703a><703d>15064\n<703f><7042>15068\n<7045><704b>15072\n<704d><704e>15079\n<7052><7054>15082\n<7056><7057>15085\n<7059><705c>15087\n<705f><7062>15091\n<7065><7066>15095\n<7068><706a>15097\n<7071><7074>15101\n<7079><707b>15106\n<7081><7084>15110\n<7086><7088>15114\n<708b><708d>15117\n<708f><7091>15120\n<7097><7098>15124\n<709a><709b>15126\n<709e><70aa>15128\n<70b4><70b6>15143\n<70be><70bf>15147\n<70c4><70c7>15149\n<70cb><70ce>15154\n<70d0><70d7>15158\n<70dc><70de>15167\n<70e0><70e3>15170\n<70f0><70f3>15177\n<70f5><70f6>15181\n<70fa><70fc>15184\n<70fe><7108>15187\n<710b><710f>15198\n<7111><7112>15203\n<711b><7120>15207\n<7122><7125>15213\n<7127><712e>15217\n<7132><7135>15225\n<7137><7144>15229\n<7146><7148>15243\n<714f><7151>15248\n<7153><715b>15251\n<715f><7161>15261\n<716a><716b>15266\n<716f><7171>15269\n<7174><7177>15272\n<717b><717c>15277\n<717e><7183>15279\n<7185><7189>15285\n<718b><718e>15290\n<7190><7191>15294\n<7195><7196>15297\n<719a><719e>15299\n<71a1><71a7>15304\n<71a9><71ab>15311\n<71ad><71b0>15314\n<71b6><71b8>15320\n<71ba><71bd>15323\n<71bf><71c0>15327\n<71c4><71c7>15330\n<71c9><71cd>15334\n<71cf><71d1>15339\n<71d6><71d8>15343\n<71da><71db>15346\n<71dd><71de>15348\n<71e1><71e4>15350\n<71e8><71ec>15354\n<71ef><71f3>15359\n<71f5><71f8>15364\n<71fa><71fb>15368\n<71ff><7205>15371\n<7207><720c>15378\n<720e><720f>15384\n<7211><721a>15386\n<721e><7227>15397\n<722d><722f>15409\n<7233><7234>15412\n<7240><7246>15415\n<7249><724b>15422\n<724e><7251>15425\n<7253><7255>15429\n<7263><7265>15437\n<726a><726d>15441\n<7270><7271>15445\n<7273><7274>15447\n<7276><7278>15449\n<727b><727c>15452\n<727e><727f>6471\n<7282><7283>15454\n<7285><7289>15456\n<7290><7291>15463\n<7293><7295>15465\n<7297><729e>15468\n<72a0><72a1>15476\n<72a3><72a6>15478\n<72a8><72ab>15482\n<72b1><72b3>15487\n<72b7><72b8>5618\n<72ba><72bf>15491\n<72c5><72c7>15497\n<72c9><72cc>15500\n<72d3><72d6>15506\n<72da><72dd>15511\n<72e2><72e7>15516\n<72ea><72eb>15522\n<72f5><72f6>15524\n<72fa><72fb>5634\n<72fe><7300>15526\n<7304><7309>15530\n<730b><730d>15536\n<730f><7312>15539\n<7318><731a>15544\n<731f><7320>15547\n<7323><7324>15549\n<7326><7328>15551\n<732f><7330>15555\n<7332><7333>15557\n<733c><733d>15561\n<7342><7343>15564\n<7346><734c>15566\n<734e><734f>15573\n<7353><7356>15576\n<7358><735f>15580\n<7361><7367>15588\n<7373><7374>15598\n<7381><7383>15604\n<7385><7386>15607\n<738c><738d>15611\n<738f><7390>15613\n<7392><7395>15615\n<7397><739a>15619\n<739c><739e>15623\n<73a0><73a1>15626\n<73a3><73a8>15628\n<73ac><73ad>15635\n<73b4><73b6>15638\n<73b8><73b9>15641\n<73bc><73bf>15643\n<73c3><73c7>15648\n<73cb><73cc>15653\n<73d2><73d8>15656\n<73da><73dd>15663\n<73e1><73e4>15668\n<73ea><73ec>15674\n<73ee><73f1>15677\n<73f3><73fd>15681\n<73ff><7402>15692\n<7407><7408>15697\n<740b><740e>15699\n<7411><7419>15703\n<741c><7421>15712\n<7423><7424>15718\n<7431><7432>15725\n<7437><743b>15727\n<743d><743e>15732\n<7442><744a>15735\n<744c><7454>15744\n<7460><7462>15756\n<7464><7468>15759\n<746b><746c>15764\n<746e><746f>15766\n<7471><7475>15768\n<7478><747d>15773\n<7480><7481>6211\n<7484><7486>15781\n<748c><748d>15786\n<7491><749b>15789\n<749f><74a2>15801\n<74a4><74a5>15805\n<74a8><74a9>6216\n<74aa><74af>15807\n<74b1><74b9>15813\n<74bb><74bc>15822\n<74be><74c9>15824\n<74cb><74ce>15836\n<74d0><74d1>15840\n<74d5><74d9>15843\n<74e7><74ed>15853\n<74f0><74f3>15860\n<74f8><74fe>15865\n<7500><7503>15872\n<7505><750b>15876\n<7514><7517>15886\n<751d><751e>15891\n<7520><7522>15893\n<7526><7527>15897\n<753c><753d>15904\n<7541><7544>15907\n<7546><7547>15911\n<7549><754a>15913\n<7550><7553>15916\n<7555><7558>15920\n<755e><7561>15924\n<7563><7564>15928\n<7567><7569>15930\n<756c><7571>15933\n<757a><757e>15942\n<7580><7582>15947\n<7584><7585>15950\n<7588><758a>15952\n<758c><758e>15955\n<759b><759c>15962\n<75a6><75aa>15966\n<75b3><75b4>7015\n<75b6><75b7>15972\n<75ba><75bb>15974\n<75bf><75c1>15976\n<75cb><75cc>15980\n<75ce><75d1>15982\n<75dc><75dd>15989\n<75df><75e1>15991\n<75ec><75ef>15996\n<75f2><75f3>16000\n<75f5><75f8>16002\n<75fa><75fb>16006\n<75fd><75fe>16008\n<7606><7609>16011\n<760e><760f>16015\n<7611><7614>16017\n<761c><761d>16023\n<762e><762f>16028\n<7631><7632>16030\n<7636><7637>16032\n<7639><763a>16034\n<7644><7645>16038\n<7646><7647>9647\n<764a><764b>16041\n<764e><7653>16043\n<7659><765b>16051\n<7660><7661>16055\n<766d><766e>9652\n<7673><7677>16060\n<7679><767a>16065\n<767f><7681>16067\n<7689><768a>16072\n<768c><768d>16074\n<768f><7690>16076\n<7694><7695>16079\n<7697><7698>16081\n<769b><76a3>16083\n<76a5><76ad>16092\n<76af><76b0>16101\n<76b5><76b7>16104\n<76bb><76be>16108\n<76c0><76c1>16112\n<76c3><76c4>16114\n<76cb><76cc>16118\n<76d9><76da>16122\n<76dc><76dd>16124\n<76e8><76ed>16129\n<76f5><76f7>16137\n<76fa><76fb>16140\n<76ff><7700>16143\n<7702><7703>16145\n<7705><7706>16147\n<7707><7708>6748\n<770e><7718>16151\n<771b><771e>16162\n<7723><7725>16167\n<772a><772c>16171\n<7730><7734>16175\n<773d><773f>16182\n<7744><7746>16186\n<7748><774e>16189\n<7750><7751>6757\n<7752><7759>16196\n<775c><775d>16204\n<775f><7760>16206\n<7769><776a>16210\n<776d><7778>16212\n<777a><777c>16224\n<7781><7783>16227\n<7786><778b>16230\n<778f><7790>16236\n<7793><7797>16238\n<7799><779d>16243\n<779f><77a0>6771\n<77a3><77a4>16249\n<77ae><77af>16254\n<77b1><77b2>16256\n<77b6><77ba>16259\n<77c0><77c6>16265\n<77c8><77cc>16272\n<77ce><77d6>16277\n<77d8><77d9>16286\n<77dd><77e1>16288\n<77f0><77f2>16297\n<77f4><77f5>16300\n<77f9><77fc>16303\n<7803><7808>16307\n<780a><780b>16313\n<780e><7810>16315\n<7817><7818>6694\n<781c><781d>6699\n<7820><7822>16323\n<782a><782b>16328\n<782e><782f>16330\n<7831><7833>16332\n<7835><7836>16335\n<7839><783b>6701\n<7841><7842>16339\n<7848><784b>16343\n<7853><7854>16350\n<7856><7857>6712\n<7858><785c>16352\n<785e><7863>16357\n<7865><7867>16363\n<7870><7876>16367\n<7878><787b>16374\n<787d><7886>16378\n<788a><788b>16389\n<788f><7890>16391\n<7894><7896>16394\n<789d><789e>16398\n<78aa><78ac>16405\n<78ae><78af>16408\n<78b5><78b7>16410\n<78bf><78c0>16415\n<78c2><78c4>16417\n<78c6><78c8>16420\n<78cc><78cf>16423\n<78d1><78d3>16427\n<78d6><78d8>16430\n<78db><78e2>16433\n<78e4><78e6>16441\n<78e9><78eb>16444\n<78ed><78ee>16447\n<78f0><78f1>16449\n<78f5><78f6>16452\n<78f8><78f9>16454\n<78fb><78fc>16456\n<78fe><7900>16458\n<7902><7904>16461\n<7906><790d>16464\n<790f><7912>16472\n<7914><7918>16476\n<791a><791d>16481\n<791f><7923>16485\n<7927><7929>16491\n<792d><7930>16494\n<7932><7933>16498\n<7935><7939>16500\n<7942><7945>16507\n<794a><7952>16512\n<7954><7955>16521\n<7958><7959>16523\n<795b><795c>6652\n<7963><7964>16526\n<7969><796c>16529\n<7970><7976>16534\n<797b><797f>16542\n<7982><7983>16547\n<7986><7989>16549\n<798b><798c>16553\n<7990><7999>16555\n<799b><79a5>16565\n<79a8><79a9>16576\n<79ab><79ad>16578\n<79b4><79b8>16583\n<79c4><79c5>16591\n<79c7><79c8>16593\n<79ce><79d0>16597\n<79d3><79d4>16600\n<79d6><79d7>16602\n<79d9><79de>16604\n<79e0><79e2>16610\n<79f1><79f7>16618\n<79f9><79fa>16625\n<79fe><79ff>16628\n<7a04><7a05>16631\n<7a07><7a0a>16633\n<7a0f><7a13>16638\n<7a15><7a16>16643\n<7a18><7a19>16645\n<7a1b><7a1d>16647\n<7a21><7a22>16651\n<7a24><7a2d>16653\n<7a2f><7a30>16663\n<7a34><7a36>16666\n<7a41><7a45>16672\n<7a47><7a4b>16677\n<7a4f><7a50>16682\n<7a52><7a56>16684\n<7a58><7a60>16689\n<7a63><7a68>16698\n<7a6c><7a6f>16705\n<7a71><7a73>16709\n<7a78><7a79>7066\n<7a7b><7a7e>16713\n<7a89><7a8c>16720\n<7a8e><7a90>16724\n<7a93><7a94>16727\n<7a99><7a9b>16729\n<7aa1><7aa4>16733\n<7aaf><7ab2>16739\n<7ab4><7ab5>16743\n<7ab7><7ab9>16745\n<7abb><7abe>16748\n<7ac0><7ac3>16752\n<7acc><7ad5>16758\n<7ad7><7ad8>16768\n<7ada><7add>16770\n<7ae1><7ae2>16774\n<7ae7><7ae9>16777\n<7aeb><7aec>16780\n<7af0><7af5>16783\n<7af7><7af8>16789\n<7afb><7afc>16791\n<7b00><7b02>16794\n<7b03><7b04>7270\n<7b0c><7b0e>16800\n<7b12><7b13>16804\n<7b16><7b18>16806\n<7b1c><7b1d>16810\n<7b21><7b23>16813\n<7b2f><7b30>16819\n<7b34><7b37>16822\n<7b3f><7b44>16829\n<7b4d><7b4e>16837\n<7b5e><7b5f>16844\n<7b63><7b66>16847\n<7b68><7b6d>16851\n<7b6f><7b70>16857\n<7b73><7b74>16859\n<7b7c><7b7d>16864\n<7b81><7b84>16867\n<7b86><7b8a>16871\n<7b8e><7b8f>16877\n<7b91><7b93>16879\n<7b98><7b9b>16883\n<7b9e><7ba0>16887\n<7ba3><7ba5>16890\n<7ba6><7ba7>7301\n<7bae><7bb0>16893\n<7bb2><7bb3>16896\n<7bb5><7bb7>16898\n<7bb9><7bbf>16901\n<7bc2><7bc3>16908\n<7bcd><7bd0>16913\n<7bd4><7bd8>16918\n<7bdb><7bdc>16923\n<7bde><7be0>16925\n<7be2><7be3>16928\n<7be5><7be6>7318\n<7be7><7be8>16930\n<7beb><7bed>16932\n<7bef><7bf0>16935\n<7bf4><7bf6>16938\n<7bf8><7bfb>16941\n<7c01><7c06>16947\n<7c08><7c0a>16953\n<7c10><7c15>16957\n<7c17><7c1d>16963\n<7c24><7c25>16972\n<7c28><7c29>16974\n<7c2c><7c37>16976\n<7c39><7c3c>16988\n<7c44><7c4b>16993\n<7c4e><7c5b>17001\n<7c5d><7c5e>17015\n<7c61><7c63>17017\n<7c65><7c68>17020\n<7c6f><7c71>17026\n<7c75><7c7a>17029\n<7c7e><7c88>17035\n<7c8a><7c90>17046\n<7c93><7c94>17053\n<7c99><7c9b>17056\n<7ca0><7ca1>17059\n<7ca6><7ca9>17062\n<7cab><7cad>17066\n<7caf><7cb0>17069\n<7cb4><7cb8>17071\n<7cba><7cbb>17076\n<7cbc><7cbd>7378\n<7cbf><7cc0>17078\n<7cc2><7cc4>17080\n<7ccc><7ccd>7382\n<7cce><7cd4>17086\n<7cda><7cdb>17094\n<7ce1><7ce6>17096\n<7ce9><7cee>17102\n<7cfc><7cfd>17113\n<7d07><7d08>9246\n<7d0e><7d0f>17119\n<7d11><7d12>17121\n<7d1d><7d1f>17125\n<7d23><7d26>17128\n<7d28><7d2a>17132\n<7d2c><7d2e>17135\n<7d34><7d38>17138\n<7d3d><7d3e>17144\n<7d47><7d4d>17149\n<7d51><7d5c>17157\n<7d5f><7d60>17169\n<7d63><7d65>17171\n<7d69><7d6d>17175\n<7d6f><7d70>17180\n<7d74><7d75>17182\n<7d7a><7d80>17185\n<7d84><7d85>17193\n<7d8a><7d8e>17196\n<7d90><7d92>17201\n<7d94><7d9b>17204\n<7d9f><7da1>17213\n<7da4><7da5>17216\n<7da7><7daa>17218\n<7db5><7db7>17223\n<7dc0><7dc3>17227\n<7dc5><7dc6>17231\n<7dc8><7dc9>17233\n<7dcc><7dd0>17235\n<7dd5><7dd6>17241\n<7dda><7ddc>17243\n<7de4><7de5>17248\n<7dea><7deb>17251\n<7ded><7dee>17253\n<7df7><7df8>17258\n<7dfc><7e07>17261\n<7e0c><7e0f>17273\n<7e12><7e1a>17277\n<7e20><7e22>17287\n<7e24><7e26>17290\n<7e28><7e2a>17293\n<7e2f><7e30>17297\n<7e3f><7e40>17303\n<7e42><7e44>17305\n<7e48><7e51>17308\n<7e56><7e59>17319\n<7e5b><7e5d>17323\n<7e5f><7e61>17326\n<7e63><7e68>17329\n<7e71><7e72>17336\n<7e74><7e78>17338\n<7e7a><7e7b>17343\n<7e7f><7e81>17345\n<7e83><7e87>17348\n<7e90><7e92>17356\n<7e99><7e9a>17361\n<7e9d><7e9e>17363\n<7ea8><7ea9>6103\n<7ebb><7ebc>17367\n<7ec0><7ec2>6108\n<7ecb><7ecc>6112\n<7ee0><7ee1>6118\n<7eee><7eef>6122\n<7ef1><7ef2>6124\n<7efa><7efb>6128\n<7f01><7f03>6131\n<7f07><7f08>6134\n<7f0b><7f0c>6136\n<7f11><7f12>6139\n<7f21><7f27>6146\n<7f2a><7f2d>6153\n<7f2f><7f33>6157\n<7f3b><7f41>17378\n<7f44><7f45>7264\n<7f46><7f4b>17386\n<7f52><7f53>17394\n<7f5b><7f5e>17398\n<7f63><7f67>17403\n<7f6b><7f6d>17408\n<7f75><7f76>17413\n<7f7a><7f7d>17416\n<7f7f><7f80>17420\n<7f82><7f84>17422\n<7f8f><7f93>17429\n<7f95><7f99>17434\n<7f9b><7f9c>17439\n<7fa2><7fa3>17442\n<7faa><7fae>17446\n<7faf><7fb0>7367\n<7fb3><7fb7>17452\n<7fba><7fbb>17457\n<7fc2><7fc4>17461\n<7fc6><7fc9>17464\n<7fcf><7fd1>17470\n<7fd6><7fd7>17474\n<7fd9><7fde>17476\n<7fe2><7fe4>17482\n<7fe7><7fe8>17485\n<7fea><7fed>17487\n<7ff4><7ff8>17493\n<7ffd><7fff>17499\n<8007><800a>17503\n<800e><800f>17507\n<801a><801b>17511\n<801d><801f>17513\n<8023><8024>17517\n<8025><8027>7121\n<802f><8030>17521\n<8039><803a>17525\n<8040><8041>17529\n<8044><8045>17531\n<8047><8049>17533\n<804e><8051>17536\n<805b><805d>17544\n<805f><8068>17547\n<806b><806e>17557\n<807a><807c>17563\n<8081><8082>17566\n<808d><8092>17570\n<8094><8095>17576\n<80a6><80a8>17582\n<80b5><80b6>17588\n<80b8><80b9>17590\n<80c7><80cb>17594\n<80cf><80d5>17599\n<80df><80e0>17607\n<80e2><80e3>17609\n<80e7><80ea>6522\n<80fe><8101>17617\n<8103><8104>17621\n<8107><8108>17623\n<810b><810c>17625\n<810d><810e>6538\n<811c><811d>17630\n<811f><812b>17632\n<812d><812e>17645\n<8133><8135>17648\n<813a><813d>17652\n<813f><8145>17656\n<8157><8158>17668\n<8159><815a>6554\n<815b><815f>17670\n<8162><8164>17675\n<8172><8173>17682\n<8175><8177>17684\n<817c><817d>6559\n<8183><8187>17688\n<818b><818e>17694\n<8192><8197>17699\n<819e><819f>17706\n<81a1><81a2>17708\n<81a4><81a5>17710\n<81ab><81b2>17713\n<81b4><81b9>17721\n<81c4><81c5>17728\n<81c7><81c8>17730\n<81d0><81d7>17734\n<81db><81de>17743\n<81e1><81e2>17747\n<81e4><81e6>17749\n<81ee><81f2>17754\n<81f3><81f4>4544\n<81f5><81f9>17759\n<8201><8202>7334\n<820c><820d>3353\n<820e><820f>17768\n<8215><821a>17772\n<8221><8223>7339\n<8224><8227>17780\n<8233><8234>7348\n<823c><823d>17788\n<823f><8243>17790\n<8245><8246>17795\n<824c><824e>17799\n<8250><8257>17802\n<825b><825e>17810\n<8260><8263>17814\n<8269><826a>17820\n<826c><826d>17822\n<8275><8276>17824\n<827b><827c>17827\n<8280><8281>17829\n<8285><8287>17832\n<8293><8296>17838\n<829a><829b>17842\n<82a2><82a3>17846\n<82b5><82b6>17850\n<82bf><82c0>17854\n<82c2><82c3>17856\n<82c5><82c6>17858\n<82cb><82cc>5110\n<82d9><82da>17863\n<82e8><82ea>17867\n<82ec><82ee>17870\n<82f2><82f3>17874\n<82f5><82f6>17876\n<82fc><8300>17880\n<830a><830b>17885\n<8312><8313>17889\n<8314><8315>5137\n<8318><8319>17892\n<831d><8326>17894\n<8329><832a>17904\n<833d><833f>17911\n<8341><8342>17914\n<8344><8345>17916\n<834a><834e>17919\n<8355><8359>17925\n<835b><835c>5143\n<836d><836e>5170\n<8370><8376>17932\n<8379><837a>17939\n<837e><8384>17941\n<8387><8388>17948\n<838b><838d>17950\n<838f><8391>17953\n<8394><8395>17956\n<8399><839a>17959\n<83a3><83a6>17964\n<83ac><83af>17968\n<83b3><83b4>5174\n<83be><83bf>17974\n<83c2><83c4>17976\n<83c8><83c9>17980\n<83cd><83ce>17983\n<83d0><83d3>17985\n<83d9><83db>17991\n<83e2><83e4>17995\n<83e6><83e8>17998\n<83eb><83ee>18001\n<83f3><83f7>18005\n<83f8><83f9>5210\n<83fa><83fc>18010\n<83fe><8400>18013\n<8408><8409>18018\n<8412><8417>18021\n<8419><841b>18027\n<841e><8423>18030\n<8424><8425>4238\n<8429><842b>18036\n<842d><8430>18039\n<8432><8434>18043\n<8436><8437>18046\n<8439><843b>18048\n<843e><8445>18051\n<8447><8448>18059\n<844a><8450>18061\n<8453><8456>18068\n<845d><8460>18073\n<8467><8468>18079\n<847b><8481>18087\n<8483><8486>18094\n<8487><8488>5223\n<848f><8492>18100\n<8495><8496>18104\n<849a><849b>18107\n<849d><84a0>18109\n<84a2><84ae>18113\n<84b0><84b1>18126\n<84b5><84b7>18129\n<84c2><84c3>18134\n<84c5><84c8>18136\n<84ce><84cf>18141\n<84d4><84d5>18144\n<84d7><84dc>18146\n<84e1><84e2>18153\n<84e7><84eb>18156\n<84f1><84fb>18162\n<8500><850b>18174\n<850d><8510>18186\n<8515><8516>18191\n<8518><8519>18193\n<851b><851d>18195\n<8524><8525>18200\n<8527><852a>18202\n<852e><8536>18206\n<853e><8540>18215\n<8544><8545>18219\n<854b><854d>18222\n<854f><8551>18225\n<855a><855d>18230\n<855f><8561>18234\n<8565><8567>18238\n<856b><856c>18241\n<856e><8571>18243\n<8575><8576>18248\n<857c><857d>18251\n<857f><8583>18253\n<858d><858e>18261\n<8592><8593>18264\n<8595><859a>18266\n<859d><859e>18272\n<85a0><85a3>18274\n<85ab><85ad>18280\n<85b1><85b6>18283\n<85bb><85c0>18290\n<85c2><85c8>18296\n<85ca><85cc>18303\n<85d1><85d2>18306\n<85d6><85db>18309\n<85de><85e3>18315\n<85e6><85e8>18321\n<85eb><85f3>18324\n<85f7><85f8>18334\n<85fc><85fe>18336\n<8600><8603>18339\n<8608><860a>18343\n<860c><8610>18346\n<8612><8615>18351\n<8617><8619>18355\n<861b><861d>18358\n<861f><8621>18361\n<8623><8626>18364\n<862a><862c>18369\n<862e><8637>18372\n<863d><863e>18384\n<8640><864c>18386\n<8652><8653>18399\n<8656><8659>18401\n<8660><8661>18407\n<8663><8666>18409\n<8668><866a>18413\n<866f><8670>18417\n<8672><8678>18419\n<8683><8689>18426\n<868e><8692>18433\n<8696><869b>18439\n<869e><86a2>18445\n<86a5><86a6>18450\n<86ad><86ae>18453\n<86b2><86b3>18455\n<86b7><86b9>18457\n<86bb><86bf>18460\n<86c1><86c3>18465\n<86cc><86cd>18470\n<86d2><86d3>18472\n<86d5><86d7>18474\n<86dc><86dd>18478\n<86e0><86e3>18480\n<86e5><86e8>18484\n<86ea><86ec>18488\n<86f1><86f2>7182\n<86f5><86f7>18492\n<86fb><86fd>18495\n<8704><8705>18500\n<870b><870c>18502\n<870e><8711>18504\n<871f><8720>18513\n<8726><8728>18516\n<872a><872d>18519\n<872f><8730>18523\n<8732><8733>18525\n<8735><8736>18527\n<8738><873a>18529\n<873c><873d>18532\n<8740><8746>18534\n<874a><874b>18541\n<874f><8752>18544\n<875a><875f>18551\n<8761><8762>18557\n<8767><876d>18559\n<8771><8773>18567\n<8779><877a>18572\n<877d><877e>7215\n<877f><8781>18574\n<8786><8787>18577\n<8789><878a>18579\n<878e><8792>18582\n<8794><8796>18587\n<8798><879d>18590\n<87a0><87a1>18596\n<87a3><87a7>18598\n<87a9><87aa>18603\n<87b0><87b2>18606\n<87b6><87b9>18610\n<87be><87bf>18615\n<87c1><87c3>18617\n<87cc><87cd>18623\n<87cf><87d0>18625\n<87d4><87da>18627\n<87dc><87df>18634\n<87e1><87e2>18638\n<87e6><87e9>18641\n<87f0><87f1>18647\n<87f3><87f5>18649\n<87f7><87f8>18652\n<87fc><87fd>18655\n<87ff><8802>18657\n<8807><8809>18662\n<880b><880f>18665\n<8817><881a>18672\n<881c><881e>18676\n<8824><8830>18680\n<8833><8835>18693\n<8837><8838>18696\n<883d><883f>18699\n<8841><8843>18702\n<8847><8849>18705\n<884e><8852>18709\n<8855><8856>18714\n<885e><8860>18719\n<8866><8867>18722\n<8873><8876>18728\n<887a><887c>18733\n<8886><8887>18738\n<8889><888a>18740\n<888e><8891>18743\n<8893><8895>18747\n<8897><889b>18750\n<889d><88a1>18755\n<88a5><88aa>18761\n<88ae><88b0>18768\n<88b2><88b6>18771\n<88b8><88bb>18776\n<88bd><88c0>18780\n<88c3><88c4>18784\n<88c7><88c8>18786\n<88cb><88cd>18788\n<88d0><88d1>18791\n<88d6><88d7>18794\n<88da><88db>18796\n<88e0><88e1>18799\n<88e6><88e7>18801\n<88e9><88ef>18803\n<88f5><88f7>18811\n<88fa><88fb>18814\n<88ff><8901>18816\n<8903><8906>18819\n<8908><8909>18823\n<890b><890f>18825\n<8914><8918>18831\n<891c><8920>18836\n<8922><8924>18841\n<8926><8929>18844\n<892c><892f>18848\n<8939><893a>18855\n<893c><8940>18857\n<8942><8943>18862\n<8945><8946>18864\n<8948><8955>18866\n<8957><895c>18880\n<8961><8963>18886\n<8967><8969>18890\n<896d><896e>18894\n<8970><8971>18896\n<8973><897a>18898\n<897c><897e>18906\n<8984><8985>18911\n<8987><898a>18913\n<898c><898e>18917\n<8990><8992>18920\n<8994><8995>18923\n<8999><89a0>18926\n<89a2><89a5>18934\n<89a7><89a9>18938\n<89ad><89ae>18942\n<89b0><89b1>18944\n<89b3><89b6>18946\n<89b8><89b9>18950\n<89bb><89bc>18952\n<89ca><89cc>6459\n<89ce><89d1>6462\n<89d3><89d5>18957\n<89d7><89d9>18960\n<89df><89e2>18965\n<89e7><89ea>18970\n<89ec><89ee>18974\n<89f0><89f2>18977\n<89f9><89ff>18982\n<8a04><8a06>18989\n<8a11><8a12>18996\n<8a19><8a1a>19000\n<8a20><8a22>19004\n<8a26><8a29>19008\n<8a2b><8a2c>19012\n<8a2e><8a30>19014\n<8a32><8a33>19017\n<8a37><8a39>19020\n<8a3b><8a3d>19023\n<8a3f><8a40>19026\n<8a42><8a45>19028\n<8a49><8a4d>19033\n<8a56><8a57>19041\n<8a59><8a5a>19043\n<8a5c><8a5d>19045\n<8a5f><8a60>19047\n<8a64><8a65>19049\n<8a67><8a68>19051\n<8a76><8a78>19056\n<8a7a><8a7b>19059\n<8a7d><8a7e>19061\n<8a80><8a83>19063\n<8a8b><8a8c>19068\n<8a8e><8a90>19070\n<8a91><8a92>8953\n<8a96><8a97>19074\n<8a9b><8a9d>19077\n<8aa9><8aab>19083\n<8aad><8aaf>19086\n<8ab3><8ab5>19090\n<8ab7><8ab8>19093\n<8aba><8abb>19095\n<8abd><8abe>19097\n<8ac0><8ac1>19099\n<8ac5><8ac6>19102\n<8ad3><8ad5>19109\n<8ad8><8ada>19112\n<8adf><8ae1>19116\n<8ae8><8aea>19121\n<8aef><8af0>19125\n<8af4><8af5>19128\n<8b08><8b09>19136\n<8b0b><8b0d>19138\n<8b11><8b13>19142\n<8b1e><8b20>19148\n<8b22><8b25>19151\n<8b29><8b2a>19156\n<8b2e><8b32>19158\n<8b34><8b38>19163\n<8b3a><8b3d>19168\n<8b3f><8b48>19172\n<8b4a><8b4d>19182\n<8b50><8b55>19186\n<8b5d><8b65>19194\n<8b67><8b6a>19203\n<8b6d><8b6e>19207\n<8b71><8b73>19209\n<8b75><8b76>19212\n<8b78><8b7c>19214\n<8b7e><8b7f>19219\n<8b81><8b89>19221\n<8b8b><8b8d>19230\n<8b8f><8b91>19233\n<8b97><8b9b>19237\n<8ba6><8ba7>4888\n<8bb4><8bb5>4891\n<8bc2><8bc3>4894\n<8bd2><8bd4>4899\n<8bd8><8bd9>4903\n<8bdf><8be0>4906\n<8be8><8be9>4909\n<8bff><8c00>4917\n<8c11><8c12>4924\n<8c14><8c16>4926\n<8c1f><8c21>4933\n<8c2a><8c2b>4938\n<8c2e><8c2f>4940\n<8c32><8c33>4942\n<8c35><8c36>4944\n<8c38><8c40>19252\n<8c42><8c45>19261\n<8c4a><8c4b>19265\n<8c4d><8c4f>19267\n<8c51><8c54>19270\n<8c56><8c59>19274\n<8c5b><8c60>19278\n<8c63><8c69>19284\n<8c6c><8c72>19291\n<8c74><8c77>19298\n<8c7b><8c81>19302\n<8c83><8c84>19309\n<8c86><8c88>19311\n<8c8d><8c93>19315\n<8c95><8c97>19322\n<8c99><8c9c>19325\n<8ca3><8ca6>19330\n<8cad><8cae>19334\n<8ccb><8cd0>19342\n<8cd6><8cd9>19349\n<8ce8><8ce9>19357\n<8cee><8cf3>19359\n<8cf5><8cf9>19365\n<8cff><8d03>19370\n<8d06><8d07>19375\n<8d11><8d15>19380\n<8d17><8d1a>19385\n<8d32><8d33>6444\n<8d45><8d46>6450\n<8d48><8d49>6452\n<8d51><8d52>19390\n<8d68><8d6a>19395\n<8d6e><8d6f>19399\n<8d71><8d72>19401\n<8d78><8d80>19403\n<8d82><8d83>19412\n<8d86><8d89>19414\n<8d8c><8d90>19418\n<8d92><8d93>19423\n<8d96><8d98>19425\n<8d9a><8d9e>19428\n<8da0><8da2>19433\n<8da4><8da7>19436\n<8da9><8db0>19440\n<8db6><8db7>19448\n<8dc0><8dc2>19453\n<8dc7><8dca>19457\n<8dce><8dcf>7461\n<8dd2><8dd5>19463\n<8dd6><8dd7>7457\n<8dd8><8dd9>19467\n<8de0><8de2>19470\n<8de5><8de7>19473\n<8ded><8dee>19477\n<8df0><8df2>19479\n<8df7><8df8>7466\n<8dfe><8e04>19485\n<8e06><8e08>19492\n<8e0d><8e0e>19496\n<8e11><8e13>19498\n<8e15><8e1c>19501\n<8e20><8e21>19509\n<8e24><8e28>19511\n<8e32><8e33>19519\n<8e36><8e38>19521\n<8e3b><8e3c>19524\n<8e3e><8e3f>19526\n<8e41><8e42>7488\n<8e45><8e46>19529\n<8e4d><8e50>19531\n<8e51><8e52>7490\n<8e53><8e54>19535\n<8e56><8e58>19537\n<8e5a><8e62>19540\n<8e64><8e65>19549\n<8e67><8e68>19551\n<8e6a><8e6b>19553\n<8e77><8e79>19559\n<8e7d><8e7e>19563\n<8e82><8e84>19566\n<8e95><8e99>19573\n<8e9f><8ea0>19580\n<8ea2><8ea4>19582\n<8ea7><8ea9>19585\n<8ead><8eae>19588\n<8eb0><8eb1>19590\n<8eb3><8eb9>19592\n<8ebb><8ebf>19599\n<8ec1><8ec9>19604\n<8ecf><8ed1>19613\n<8ed5><8eda>19617\n<8edc><8ede>19623\n<8ee0><8ee3>19626\n<8ee5><8eea>19630\n<8eec><8ef1>19636\n<8ef3><8ef7>19642\n<8eff><8f02>19648\n<8f0b><8f11>19655\n<8f16><8f1a>19663\n<8f1e><8f1f>9373\n<8f20><8f24>19668\n<8f27><8f28>19673\n<8f2b><8f2e>19675\n<8f30><8f32>19679\n<8f34><8f37>19682\n<8f39><8f3a>19686\n<8f3c><8f3d>19688\n<8f40><8f41>19690\n<8f47><8f48>19693\n<8f4a><8f4c>19695\n<8f4f><8f53>19698\n<8f55><8f5e>19703\n<8f71><8f73>6371\n<8f75><8f76>6374\n<8f79><8f7a>6378\n<8f81><8f82>6382\n<8f8d><8f8f>6387\n<8fa0><8fa2>19721\n<8fa4><8fa5>19724\n<8fa8><8fa9>1103\n<8fb3><8fb5>19729\n<8fb7><8fb8>19732\n<8fba><8fbc>19734\n<8fbf><8fc0>19737\n<8fc9><8fcd>19741\n<8fd6><8fd7>19748\n<8fe0><8fe1>19751\n<8ff1><8ff2>19757\n<8ff5><8ff6>19759\n<8ffa><8ffc>19761\n<8ffe><8fff>19764\n<9007><9008>19766\n<9024><9025>19773\n<9027><902c>19775\n<9030><9031>19781\n<9033><9034>19783\n<9035><9036>5967\n<9039><903a>19786\n<903f><9040>19789\n<9045><9046>19792\n<9048><904a>19794\n<9051><9052>5972\n<9059><905a>19799\n<9066><9067>19805\n<906a><906c>19807\n<906f><9071>19810\n<9085><9086>19818\n<908c><908e>19821\n<909e><90a0>19830\n<90a4><90a5>19833\n<90a7><90a9>19835\n<90bc><90bd>19842\n<90bf><90c0>19844\n<90c2><90c3>19846\n<90c8><90c9>19849\n<90cb><90cd>19851\n<90d4><90d6>19855\n<90d8><90da>19858\n<90e3><90e5>19863\n<90e9><90ea>19866\n<90f0><90f3>19870\n<90f6><90f7>19874\n<90f9><90fc>19876\n<90ff><9101>19880\n<9107><9108>19885\n<910a><9111>19887\n<9117><9118>19897\n<911a><911d>19899\n<911f><9121>19903\n<9124><9126>19906\n<9128><912c>19909\n<9137><9138>19917\n<913b><9142>19919\n<9144><9145>19927\n<914e><914f>7418\n<9153><9156>19931\n<9158><9159>19935\n<915b><915c>19937\n<915f><9160>19939\n<9166><9168>19941\n<917a><917c>19947\n<917d><917e>7426\n<9180><9184>19950\n<918e><918f>19958\n<9193><9195>19960\n<9197><9199>19963\n<919d><91a1>19966\n<91a2><91a3>7436\n<91a4><91a9>19971\n<91ad><91af>7439\n<91b0><91b3>19977\n<91b6><91b9>19981\n<91bb><91bf>19985\n<91d2><91d4>9459\n<91da><91db>19996\n<91de><91e2>19998\n<91e5><91e6>20003\n<91ea><91f4>20006\n<91fb><91ff>20019\n<9202><9203>20024\n<9205><9207>20026\n<920a><920c>20029\n<9212><9213>20033\n<9216><921d>20035\n<921f><9222>20043\n<9228><922d>20048\n<9231><9232>20055\n<9235><9236>20057\n<923b><923c>20059\n<9241><9244>20061\n<9246><9247>20065\n<924a><924c>20067\n<924e><9250>20070\n<9252><9254>20073\n<9258><9259>20077\n<925c><925d>20079\n<925f><9261>20081\n<9263><9265>20084\n<9267><926b>20087\n<926c><926d>9489\n<926e><9273>20092\n<9275><9277>20098\n<927c><927e>20102\n<9281><9282>20105\n<9286><928d>20108\n<928f><9290>20116\n<9294><9295>20119\n<929d><929f>20124\n<92a1><92a2>20127\n<92af><92b0>20132\n<92b2><92b6>20134\n<92bd><92c0>20141\n<92c9><92cb>20148\n<92cd><92ce>20151\n<92d0><92d1>20153\n<92d3><92dc>20155\n<92e0><92e2>20166\n<92eb><92ec>20171\n<92f2><92f5>20173\n<92f9><92fb>20178\n<92fd><9300>20181\n<9302><9305>20185\n<9307><9308>9551\n<9309><930f>20189\n<9313><9314>20197\n<9316><9317>20199\n<931c><931e>20201\n<9323><9325>20205\n<9329><932a>20209\n<932c><932d>20211\n<9330><9331>20213\n<9334><9335>20215\n<9339><933d>20218\n<9344><9345>20225\n<9348><934a>20227\n<934e><9353>20231\n<9355><9357>20237\n<9359><935a>20240\n<935c><9363>20242\n<9366><9368>20250\n<936d><936f>20254\n<9371><9374>20257\n<9377><9379>20261\n<937b><937d>20264\n<937f><9381>20267\n<9385><9386>20271\n<9388><9389>20273\n<938b><938e>20275\n<9390><9395>20279\n<9399><93a1>20286\n<93a4><93a5>20295\n<93b1><93b2>20301\n<93b6><93b7>20304\n<93b9><93be>20306\n<93c0><93c2>20312\n<93c4><93c6>20315\n<93ce><93d0>20320\n<93d2><93d5>20323\n<93d9><93db>20327\n<93dc><93dd>9576\n<93e5><93e7>20332\n<93e9><93f4>20335\n<93fa><9402>20349\n<9404><940a>20358\n<940c><940f>20365\n<9415><9417>20370\n<941a><941c>20373\n<941e><941f>20376\n<9421><9425>20378\n<9426><9427>9537\n<9429><942d>20383\n<942f><9431>20388\n<9436><9437>20392\n<943b><943d>20395\n<9440><9443>20398\n<9445><9449>20402\n<944d><9451>20408\n<9455><945f>20414\n<9461><9462>20425\n<9466><946a>20428\n<946e><946f>20434\n<9473><9476>20437\n<947a><947b>20442\n<9480><9484>20444\n<9485><9487>6798\n<948c><948d>6803\n<948f><9490>6805\n<949a><949c>6810\n<94a3><94a4>6813\n<94af><94b0>6819\n<94b6><94ba>6823\n<94bc><94bd>6828\n<94c8><94ce>6832\n<94d0><94d2>6839\n<94d3><94d4>20454\n<94d5><94d7>6842\n<94de><94e0>6848\n<94e4><94e5>6852\n<94e7><94e8>6854\n<94ee><94ef>6859\n<94f3><94f5>6861\n<94fc><94fd>6866\n<9506><9507>6871\n<9509><950a>6873\n<950d><950f>6875\n<9512><9516>6878\n<951d><951f>6885\n<952a><952b>6889\n<9531><9532>6893\n<9536><9538>6896\n<953e><953f>6900\n<9544><9546>6904\n<954e><954f>6909\n<9552><9554>6911\n<9556><9559>6914\n<955e><955f>6919\n<9561><9562>6922\n<9564><956c>6924\n<9571><9573>6934\n<9574><9575>20471\n<9578><957e>20473\n<9584><9585>20481\n<9587><9588>20483\n<9595><9597>20489\n<9599><95a0>20492\n<95a6><95a7>20501\n<95ae><95b1>20504\n<95b3><95b5>20508\n<95b7><95b8>20511\n<95c0><95c2>20514\n<95c4><95c5>20517\n<95cd><95cf>20521\n<95d1><95d3>20524\n<95d7><95db>20527\n<95df><95e0>20533\n<95e3><95e4>20535\n<95e6><95e7>20537\n<95f5><95f6>5769\n<9603><9604>5773\n<960a><960d>5777\n<9615><9617>5783\n<9619><961a>5786\n<9623><9629>20547\n<962b><962d>20554\n<962f><9630>20557\n<9637><963a>20559\n<964e><964f>20567\n<9651><9653>20569\n<9656><9657>20572\n<9659><965a>20574\n<9665><9666>20579\n<966d><966f>20582\n<9679><967c>20586\n<967e><9684>20590\n<9691><9693>20600\n<969d><96a6>20605\n<96ab><96af>20616\n<96bc><96bd>7546\n<96c2><96c3>20626\n<96ca><96cb>20629\n<96d0><96d1>20631\n<96d3><96d4>20633\n<96d7><96d8>20635\n<96dd><96df>20638\n<96e4><96e7>20642\n<96eb><96ee>20646\n<96f0><96f1>20650\n<96f4><96f5>20652\n<96fc><96fd>20656\n<9702><9703>20659\n<970a><970c>20662\n<9710><9712>20665\n<9714><9715>20668\n<9717><971b>20670\n<971f><9726>20676\n<9728><9729>20684\n<972b><972c>20686\n<972e><972f>20688\n<9733><9737>20691\n<973a><973c>20696\n<973f><9741>20699\n<9745><9747>20703\n<9749><9751>20706\n<9754><9755>20715\n<9757><9758>20717\n<975c><975d>20719\n<9763><9764>20722\n<9766><9767>20724\n<976a><9772>20726\n<9777><977b>20736\n<977d><9784>20741\n<9786><978a>20749\n<9791><9792>7626\n<9795><9797>20758\n<9799><979f>20761\n<97a1><97a2>20768\n<97a4><97a5>20770\n<97a7><97aa>20772\n<97b0><97b1>20778\n<97b5><97bc>20781\n<97be><97c2>20789\n<97c4><97c5>20794\n<97c7><97c8>20796\n<97cd><97d2>20799\n<97d4><97d8>20805\n<97da><97db>20810\n<97df><97e5>20813\n<97ea><97ec>6222\n<97ee><97f2>20821\n<97f7><97fe>20827\n<980e><980f>9670\n<9814><9816>20840\n<9819><981b>20843\n<981d><9820>20846\n<9822><9823>20850\n<9827><982c>20853\n<982e><982f>20859\n<9831><9836>20861\n<9839><983a>20867\n<983e><9845>20870\n<9847><984b>20878\n<984f><9852>20883\n<9855><9857>20887\n<985c><985d>20891\n<985f><9861>20893\n<9863><9864>20896\n<9868><986a>20899\n<986d><986e>20902\n<988c><988d>7140\n<989a><989b>7144\n<989e><989f>7146\n<98a1><98a2>7148\n<98a5><98a6>7150\n<98a9><98ad>20911\n<98ae><98af>9420\n<98b4><98b5>20918\n<98b7><98bb>20920\n<98bd><98c3>20925\n<98c9><98cd>20934\n<98cf><98d0>20939\n<98d1><98d3>6583\n<98d6><98d7>20942\n<98d9><98da>6587\n<98dc><98dd>20944\n<98e3><98e6>20947\n<98ea><98eb>9119\n<98f0><98f1>20953\n<98f5><98fb>20956\n<98ff><9902>20963\n<9906><9908>20968\n<990e><990f>20972\n<9914><9917>20974\n<9919><991a>20978\n<991c><991d>20980\n<991f><9920>20982\n<9922><9927>20984\n<9929><992d>20990\n<992f><9932>20995\n<9934><9936>20999\n<9938><993b>21002\n<9940><9942>21007\n<9946><9947>21011\n<9948><994a>9129\n<994d><9950>21013\n<9958><995b>21019\n<995f><9961>21024\n<9967><996c>5662\n<9978><9979>21030\n<9982><9983>21034\n<9990><9991>5676\n<9993><9995>5678\n<999a><99a4>21039\n<99a6><99a7>21050\n<99a9><99ab>21052\n<99af><99b0>21055\n<99b5><99c0>21058\n<99c2><99cf>21070\n<99d6><99d7>21085\n<99e3><99ec>21091\n<99ee><99f0>21101\n<99f2><99fe>21104\n<9a02><9a04>21118\n<9a06><9a0c>21121\n<9a10><9a15>21128\n<9a17><9a18>21134\n<9a1a><9a2a>21136\n<9a31><9a35>21155\n<9a39><9a3d>21160\n<9a43><9a44>9238\n<9a46><9a49>21166\n<9a4b><9a4c>21170\n<9a50><9a54>21173\n<9a58><9a59>21179\n<9a5c><9a5e>21181\n<9a60><9a61>21184\n<9a66><9a69>21187\n<9a77><9a78>6075\n<9a80><9a81>6080\n<9a8d><9a8e>21195\n<9a92><9a93>6086\n<9a94><9a95>21197\n<9a9b><9a9d>6090\n<9a9f><9aa0>6093\n<9aa2><9aa3>6095\n<9aa9><9aae>21201\n<9ab2><9ab5>21207\n<9abd><9abf>21213\n<9ac3><9ac4>21216\n<9ac6><9aca>21218\n<9acb><9acc>7645\n<9acd><9ace>21223\n<9ad9><9ade>21227\n<9ae2><9ae5>21234\n<9ae7><9aea>21238\n<9af0><9af8>21243\n<9afc><9b02>21253\n<9b04><9b05>21260\n<9b09><9b0c>21263\n<9b10><9b12>21268\n<9b14><9b19>21271\n<9b1b><9b1e>21277\n<9b20><9b21>21281\n<9b2a><9b2d>21286\n<9b33><9b3a>21291\n<9b3d><9b40>21299\n<9b4a><9b4c>21304\n<9b52><9b53>21308\n<9b55><9b57>21310\n<9b5b><9b6e>21314\n<9b70><9b73>21334\n<9b75><9b76>21338\n<9b78><9b80>21340\n<9b84><9b8d>21350\n<9b93><9b99>21361\n<9b9b><9b9c>21368\n<9b9f><9ba9>21370\n<9baf><9bbf>21382\n<9bc2><9bc6>21399\n<9bcb><9bd3>21405\n<9bd7><9bda>21415\n<9bde><9be0>21420\n<9be5><9be6>21424\n<9bea><9beb>9787\n<9bec><9bef>21427\n<9bf1><9bf3>21431\n<9bf5><9bfc>21434\n<9c00><9c07>21443\n<9c0a><9c0c>21451\n<9c0e><9c0f>21454\n<9c14><9c1f>21457\n<9c21><9c22>21469\n<9c26><9c27>21472\n<9c2a><9c2c>21474\n<9c2e><9c30>21477\n<9c3c><9c3d>21484\n<9c3f><9c44>21486\n<9c46><9c47>21492\n<9c4a><9c51>21494\n<9c59><9c5c>21504\n<9c60><9c66>21509\n<9c68><9c6c>21516\n<9c6e><9c77>21521\n<9c7d><9c7e>21533\n<9c83><9c84>21536\n<9c85><9c88>7563\n<9c89><9c8a>21538\n<9c90><9c92>7570\n<9c94><9c95>7573\n<9c96><9c99>21543\n<9c9a><9c9b>7575\n<9c9e><9ca3>7577\n<9ca5><9ca9>7583\n<9cad><9cae>7589\n<9cb0><9cb7>7591\n<9cba><9cbd>7599\n<9cbe><9cc2>21552\n<9cc4><9cc7>7603\n<9cc8><9cc9>21557\n<9cca><9cd0>7607\n<9cd1><9cd2>21559\n<9cd3><9cd5>7614\n<9cd7><9cd9>7617\n<9cda><9cdb>21561\n<9cdc><9cdd>7620\n<9ce0><9ce1>21563\n<9ce3><9ce4>21565\n<9ce6><9ce8>21567\n<9cea><9ceb>21570\n<9ced><9cf2>21572\n<9cf7><9d05>21579\n<9d0a><9d14>21595\n<9d16><9d1a>21606\n<9d20><9d22>21613\n<9d24><9d25>21616\n<9d29><9d2e>21619\n<9d31><9d3a>21625\n<9d3c><9d3e>21635\n<9d40><9d41>21638\n<9d43><9d50>21640\n<9d54><9d5b>21654\n<9d5e><9d5f>21662\n<9d62><9d69>21664\n<9d6d><9d6e>21673\n<9d70><9d71>21675\n<9d73><9d86>21677\n<9d8a><9d92>21698\n<9d94><9d97>21707\n<9d9b><9da4>21712\n<9da6><9da8>21722\n<9daa><9dae>21725\n<9db0><9db3>21730\n<9db5><9dba>21734\n<9dbd><9dbf>21740\n<9dc5><9dd2>21745\n<9dd4><9dd6>21759\n<9ddb><9de4>21763\n<9de7><9dee>21773\n<9df0><9df1>21781\n<9df4><9df7>21783\n<9dfb><9e0b>21787\n<9e0d><9e14>21804\n<9e16><9e19>21812\n<9e28><9e2c>6967\n<9e39><9e3a>6977\n<9e3b><9e3c>21822\n<9e41><9e42>6980\n<9e46><9e49>6983\n<9e4b><9e4c>6987\n<9e52><9e54>21827\n<9e5a><9e5c>6993\n<9e5f><9e62>21833\n<9e66><9e6c>6998\n<9e6e><9e6f>21838\n<9e76><9e78>21842\n<9e80><9e81>21846\n<9e83><9e86>21848\n<9e87><9e88>7677\n<9e89><9e8a>21852\n<9e8c><9e91>21854\n<9e94><9e96>21860\n<9e98><9e9c>21863\n<9ea0><9ea4>21869\n<9ea7><9ea8>21874\n<9eaa><9eae>21876\n<9eb0><9eb3>21881\n<9eb6><9eb7>21885\n<9eb9><9eba>21887\n<9ebd><9ebe>7673\n<9ebf><9ec3>21890\n<9ec5><9ec8>21895\n<9eca><9ecb>21899\n<9ed2><9ed3>21902\n<9ed5><9ed7>21904\n<9ed9><9eda>21907\n<9edb><9edd>7684\n<9ee3><9ee4>21910\n<9eeb><9eee>21913\n<9ef0><9ef1>21917\n<9ef5><9ef6>21920\n<9efb><9efc>6742\n<9f00><9f08>21924\n<9f11><9f12>21936\n<9f1a><9f1f>21941\n<9f23><9f2b>21948\n<9f2d><9f2e>21957\n<9f30><9f36>21959\n<9f3d><9f3e>7700\n<9f3f><9f43>21969\n<9f45><9f49>21974\n<9f4c><9f4e>21979\n<9f55><9f58>21983\n<9f5a><9f5b>21987\n<9f5d><9f5e>21989\n<9f64><9f65>21992\n<9f67><9f69>21994\n<9f6d><9f71>21998\n<9f73><9f76>22003\n<9f78><9f7e>22007\n<9f81><9f82>22014\n<9f85><9f8a>7535\n<9f8e><9f8f>22016\n<9f91><9f93>22018\n<9f96><9f98>22021\n<9f9d><9f9e>22024\n<9fa1><9fa5>22026\n<e816><e818>22048\n<e82b><e82c>22069\n<e831><e832>22075\n<e854><e855>22110\n<fa0d><fa0f>22032\n<fa13><fa14>22036\n<fa1f><fa21>22039\n<fa23><fa24>22042\n<fa27><fa29>22044\n<fe49><fe52>10027\n<fe54><fe57>10037\n<fe59><fe66>10041\n<fe68><fe6b>10055\n<ff01><ff03>262\n<ff05><ff5d>266\n<ffe0><ffe1>168\nendcidrange\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/78-EUC-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (78-EUC-H)\n%%Title: (78-EUC-H Adobe Japan1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 0 def\nend def\n\n/CMapName /78-EUC-H def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/XUID [1 10 25347] def\n\n/WMode 0 def\n\n3 begincodespacerange\n  <00>   <80>\n  <8EA0> <8EDF>\n  <A1A1> <FEFE>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 231\nendnotdefrange\n\n100 begincidrange\n<20> <7e> 231\n<8ea0> <8edf> 326\n<a1a1> <a1fe> 633\n<a2a1> <a2ae> 727\n<a3b0> <a3b9> 780\n<a3c1> <a3da> 790\n<a3e1> <a3fa> 816\n<a4a1> <a4f3> 842\n<a5a1> <a5f6> 925\n<a6a1> <a6b8> 1011\n<a6c1> <a6d8> 1035\n<a7a1> <a7c1> 1059\n<a7d1> <a7f1> 1092\n<b0a1> <b0a1> 1125\n<b0a2> <b0a2> 7633\n<b0a3> <b0a8> 1127\n<b0a9> <b0a9> 8266\n<b0aa> <b0b1> 1134\n<b0b2> <b0b2> 7961\n<b0b3> <b0b3> 7330\n<b0b4> <b0ba> 1144\n<b0bb> <b0bb> 7634\n<b0bc> <b0ed> 1152\n<b0ee> <b0ee> 7635\n<b0ef> <b0f2> 1203\n<b0f3> <b0f3> 7636\n<b0f4> <b0fb> 1208\n<b0fc> <b0fc> 7637\n<b0fd> <b0fe> 1217\n<b1a1> <b1a9> 1219\n<b1aa> <b1aa> 7638\n<b1ab> <b1b4> 1229\n<b1b5> <b1b5> 7639\n<b1b6> <b1b8> 1240\n<b1b9> <b1b9> 7640\n<b1ba> <b1bc> 1244\n<b1bd> <b1bd> 7642\n<b1be> <b1c1> 1248\n<b1c2> <b1c2> 7643\n<b1c3> <b1ea> 1253\n<b1eb> <b1eb> 7644\n<b1ec> <b1fe> 1294\n<b2a1> <b2a7> 1313\n<b2a8> <b2a8> 7645\n<b2a9> <b2a9> 7369\n<b2aa> <b2aa> 7646\n<b2ab> <b2df> 1323\n<b2e0> <b2e0> 7647\n<b2e1> <b2f9> 1377\n<b2fa> <b2fa> 7648\n<b2fb> <b2fc> 1403\n<b2fd> <b2fd> 7649\n<b2fe> <b2fe> 1406\n<b3a1> <b3a1> 1407\n<b3a2> <b3a2> 7650\n<b3a3> <b3c1> 1409\n<b3c2> <b3c2> 6497\n<b3c3> <b3c8> 1441\n<b3c9> <b3c9> 5023\n<b3ca> <b3e4> 1448\n<b3e5> <b3e5> 7651\n<b3e6> <b3ea> 1476\n<b3eb> <b3eb> 7652\n<b3ec> <b3f2> 1482\n<b3f3> <b3f3> 7653\n<b3f4> <b3f5> 1490\n<b3f6> <b3f6> 5937\n<b3f7> <b3f9> 1493\n<b3fa> <b3fa> 7654\n<b3fb> <b3fe> 1497\n<b4a1> <b4c1> 1501\n<b4c2> <b4c2> 7655\n<b4c3> <b4c3> 5490\n<b4c4> <b4cc> 1536\n<b4cd> <b4cd> 7656\n<b4ce> <b4d1> 1546\n<b4d2> <b4d2> 6688\n<b4d3> <b4e4> 1551\n<b4e5> <b4e5> 7657\n<b4e6> <b4fe> 1570\n<b5a1> <b5aa> 1595\n<b5ab> <b5ab> 7658\n<b5ac> <b5bf> 1606\n<b5c0> <b5c0> 7659\n<b5c1> <b5fe> 1627\n<b6a1> <b6a1> 1689\n<b6a2> <b6a2> 7660\n<b6a3> <b6a9> 1691\n<b6aa> <b6aa> 7661\n<b6ab> <b6c5> 1699\n<b6c6> <b6c6> 7474\n<b6c7> <b6ce> 1727\n<b6cf> <b6cf> 7662\n<b6d0> <b6ec> 1736\n<b6ed> <b6ed> 7663\n<b6ee> <b6f3> 1766\n<b6f4> <b6f4> 7664\n<b6f5> <b6fa> 1773\n<b6fb> <b6fb> 7665\n<b6fc> <b6fc> 1780\nendcidrange\n\n100 begincidrange\n<b6fd> <b6fd> 7666\n<b6fe> <b6fe> 1782\n<b7a1> <b7a3> 1783\n<b7a4> <b7a4> 7667\n<b7a5> <b7b6> 1787\n<b7b7> <b7b7> 7668\n<b7b8> <b7c4> 1806\n<b7c5> <b7c5> 7669\n<b7c6> <b7cd> 1820\n<b7ce> <b7ce> 7670\n<b7cf> <b7d1> 1829\n<b7d2> <b7d2> 7671\n<b7d3> <b7d4> 1833\n<b7d5> <b7d5> 7672\n<b7d6> <b7da> 1836\n<b7db> <b7db> 7181\n<b7dc> <b7e3> 1842\n<b7e4> <b7e4> 7673\n<b7e5> <b7f0> 1851\n<b7f1> <b7f1> 7674\n<b7f2> <b7f8> 1864\n<b7f9> <b7f9> 7675\n<b7fa> <b7fd> 1872\n<b7fe> <b7fe> 7676\n<b8a1> <b8b3> 1877\n<b8b4> <b8b4> 7677\n<b8b5> <b8c0> 1897\n<b8c1> <b8c1> 7678\n<b8c2> <b8fe> 1910\n<b9a1> <b9aa> 1971\n<b9ab> <b9ab> 7679\n<b9ac> <b9b6> 1982\n<b9b7> <b9b7> 7680\n<b9b8> <b9c1> 1994\n<b9c2> <b9c2> 7681\n<b9c3> <b9db> 2005\n<b9dc> <b9dc> 5853\n<b9dd> <b9ec> 2031\n<b9ed> <b9ed> 7682\n<b9ee> <b9f3> 2048\n<b9f4> <b9f4> 7683\n<b9f5> <b9f8> 2055\n<b9f9> <b9f9> 7684\n<b9fa> <b9fe> 2060\n<baa1> <bad2> 2065\n<bad3> <bad3> 7685\n<bad4> <bae6> 2116\n<bae7> <bae7> 7686\n<bae8> <baf3> 2136\n<baf4> <baf4> 7687\n<baf5> <bafe> 2149\n<bba1> <bba6> 2159\n<bba7> <bba7> 7688\n<bba8> <bba9> 2166\n<bbaa> <bbaa> 7689\n<bbab> <bbab> 2169\n<bbac> <bbac> 7690\n<bbad> <bbb8> 2171\n<bbb9> <bbb9> 7691\n<bbba> <bbfe> 2184\n<bca1> <bcc7> 2253\n<bcc8> <bcc8> 7693\n<bcc9> <bcc9> 6441\n<bcca> <bcd6> 2294\n<bcd7> <bcd7> 7694\n<bcd8> <bcdc> 2308\n<bcdd> <bcde> 7695\n<bcdf> <bcfe> 2315\n<bda1> <bdaa> 2347\n<bdab> <bdab> 7697\n<bdac> <bdb5> 2358\n<bdb6> <bdb6> 7698\n<bdb7> <bdeb> 2369\n<bdec> <bded> 7699\n<bdee> <bdf1> 2424\n<bdf2> <bdf3> 7701\n<bdf4> <bdfe> 2430\n<bea1> <bea4> 2441\n<bea5> <bea5> 7703\n<bea6> <beb2> 2446\n<beb3> <beb3> 7704\n<beb4> <bebe> 2460\n<bebf> <bebf> 7705\n<bec0> <bed4> 2472\n<bed5> <bed5> 7706\n<bed6> <bede> 2494\n<bedf> <bedf> 7707\n<bee0> <bee3> 2504\n<bee4> <bee4> 7708\n<bee5> <befe> 2509\n<bfa1> <bfa9> 2535\n<bfaa> <bfaa> 7709\n<bfab> <bfd8> 2545\n<bfd9> <bfd9> 7710\n<bfda> <bfdf> 2592\n<bfe0> <bfe0> 7711\n<bfe1> <bfe8> 2599\n<bfe9> <bfe9> 7712\n<bfea> <bffe> 2608\n<c0a1> <c0a1> 2629\nendcidrange\n\n100 begincidrange\n<c0a2> <c0a2> 7713\n<c0a3> <c0c1> 2631\n<c0c2> <c0c2> 7714\n<c0c3> <c0e5> 2663\n<c0e6> <c0e6> 7715\n<c0e7> <c0f0> 2699\n<c0f1> <c0f2> 7716\n<c0f3> <c0f8> 2711\n<c0f9> <c0fa> 7718\n<c0fb> <c0fe> 2719\n<c1a1> <c1a6> 2723\n<c1a7> <c1a7> 7720\n<c1a8> <c1a8> 6766\n<c1a9> <c1b8> 2731\n<c1b9> <c1b9> 7721\n<c1ba> <c1cb> 2748\n<c1cc> <c1cc> 7722\n<c1cd> <c1ce> 2767\n<c1cf> <c1cf> 7723\n<c1d0> <c1de> 2770\n<c1df> <c1df> 7724\n<c1e0> <c1e8> 2786\n<c1e9> <c1e9> 7725\n<c1ea> <c1fe> 2796\n<c2a1> <c2bc> 2817\n<c2bd> <c2bd> 7726\n<c2be> <c2cc> 2846\n<c2cd> <c2cd> 7727\n<c2ce> <c2db> 2862\n<c2dc> <c2dc> 7728\n<c2dd> <c2e2> 2877\n<c2e3> <c2e3> 7729\n<c2e4> <c2ee> 2884\n<c2ef> <c2ef> 7730\n<c2f0> <c2f4> 2896\n<c2f5> <c2f6> 7731\n<c2f7> <c2fc> 2903\n<c2fd> <c2fd> 7733\n<c2fe> <c2fe> 2910\n<c3a1> <c3a6> 2911\n<c3a7> <c3a7> 7734\n<c3a8> <c3a8> 2918\n<c3a9> <c3aa> 7735\n<c3ab> <c3ac> 2921\n<c3ad> <c3ae> 7737\n<c3af> <c3bc> 2925\n<c3bd> <c3bd> 7739\n<c3be> <c3ef> 2940\n<c3f0> <c3f0> 7740\n<c3f1> <c3f4> 2991\n<c3f5> <c3f5> 7741\n<c3f6> <c3fb> 2996\n<c3fc> <c3fc> 7742\n<c3fd> <c3fe> 3003\n<c4a1> <c4bc> 3005\n<c4bd> <c4bd> 7743\n<c4be> <c4c7> 3034\n<c4c8> <c4c8> 7744\n<c4c9> <c4c9> 3045\n<c4ca> <c4ca> 7745\n<c4cb> <c4cc> 3047\n<c4cd> <c4cd> 7746\n<c4ce> <c4ce> 3050\n<c4cf> <c4cf> 7747\n<c4d0> <c4d3> 3052\n<c4d4> <c4d4> 8267\n<c4d5> <c4da> 3057\n<c4db> <c4db> 4533\n<c4dc> <c4fe> 3064\n<c5a1> <c5a1> 3099\n<c5a2> <c5a2> 7748\n<c5a3> <c5a6> 3101\n<c5a7> <c5a7> 7749\n<c5a8> <c5ad> 3106\n<c5ae> <c5ae> 7750\n<c5af> <c5b5> 3113\n<c5b6> <c5b6> 7751\n<c5b7> <c5be> 3121\n<c5bf> <c5bf> 7752\n<c5c0> <c5c7> 3130\n<c5c8> <c5c8> 7753\n<c5c9> <c5ca> 3139\n<c5cb> <c5cb> 7754\n<c5cc> <c5d0> 3142\n<c5d1> <c5d2> 7755\n<c5d3> <c5d6> 3149\n<c5d7> <c5d7> 5855\n<c5d8> <c5e3> 3154\n<c5e4> <c5e4> 7757\n<c5e5> <c5ed> 3167\n<c5ee> <c5ee> 5200\n<c5ef> <c5f2> 3177\n<c5f3> <c5f3> 5430\n<c5f4> <c5f7> 3182\n<c5f8> <c5f8> 7758\n<c5f9> <c5fe> 3187\n<c6a1> <c6bd> 3193\n<c6be> <c6be> 7759\n<c6bf> <c6c1> 3223\n<c6c2> <c6c2> 7760\nendcidrange\n\n100 begincidrange\n<c6c3> <c6d3> 3227\n<c6d4> <c6d5> 7761\n<c6d6> <c6da> 3246\n<c6db> <c6dc> 7763\n<c6dd> <c6e0> 3253\n<c6e1> <c6e1> 7765\n<c6e2> <c6e5> 3258\n<c6e6> <c6e7> 7766\n<c6e8> <c6e9> 3264\n<c6ea> <c6ea> 7768\n<c6eb> <c6f5> 3267\n<c6f6> <c6f6> 6893\n<c6f7> <c6fe> 3279\n<c7a1> <c7a8> 3287\n<c7a9> <c7a9> 7769\n<c7aa> <c7b8> 3296\n<c7b9> <c7b9> 7770\n<c7ba> <c7d6> 3312\n<c7d7> <c7d7> 7771\n<c7d8> <c7e6> 3342\n<c7e7> <c7e7> 7772\n<c7e8> <c7e8> 6537\n<c7e9> <c7e9> 7773\n<c7ea> <c7ec> 3360\n<c7ed> <c7ed> 7774\n<c7ee> <c7fe> 3364\n<c8a1> <c8a3> 3381\n<c8a4> <c8a4> 7775\n<c8a5> <c8ad> 3385\n<c8ae> <c8ae> 7776\n<c8af> <c8af> 3395\n<c8b0> <c8b0> 7777\n<c8b1> <c8d3> 3397\n<c8d4> <c8d4> 7778\n<c8d5> <c8e1> 3433\n<c8e2> <c8e2> 7779\n<c8e3> <c8f4> 3447\n<c8f5> <c8f5> 7780\n<c8f6> <c8fe> 3466\n<c9a1> <c9a1> 3475\n<c9a2> <c9a3> 7781\n<c9a4> <c9ae> 3478\n<c9af> <c9af> 7783\n<c9b0> <c9b0> 5179\n<c9b1> <c9b1> 3491\n<c9b2> <c9b2> 7784\n<c9b3> <c9b4> 3493\n<c9b5> <c9b5> 7785\n<c9b6> <c9bf> 3496\n<c9c0> <c9c0> 7786\n<c9c1> <c9cd> 3507\n<c9ce> <c9ce> 7787\n<c9cf> <c9d0> 3521\n<c9d1> <c9d1> 7788\n<c9d2> <c9fe> 3524\n<caa1> <cac2> 3569\n<cac3> <cac3> 7789\n<cac4> <cacc> 3604\n<cacd> <cacd> 7790\n<cace> <cad9> 3614\n<cada> <cada> 7791\n<cadb> <caf8> 3627\n<caf9> <caf9> 7792\n<cafa> <cafe> 3658\n<cba1> <cba1> 3663\n<cba2> <cba2> 7793\n<cba3> <cba8> 3665\n<cba9> <cba9> 7794\n<cbaa> <cbca> 3672\n<cbcb> <cbcb> 7795\n<cbcc> <cbe9> 3706\n<cbea> <cbea> 7475\n<cbeb> <cbef> 3737\n<cbf0> <cbf0> 7796\n<cbf1> <cbf7> 3743\n<cbf8> <cbf8> 7980\n<cbf9> <cbf9> 4143\n<cbfa> <cbfe> 3752\n<cca1> <cccc> 3757\n<cccd> <cccd> 7797\n<ccce> <ccd8> 3802\n<ccd9> <ccd9> 7798\n<ccda> <ccde> 3814\n<ccdf> <ccdf> 7799\n<cce0> <cce1> 3820\n<cce2> <cce2> 7800\n<cce3> <ccf8> 3823\n<ccf9> <ccf9> 6453\n<ccfa> <ccfa> 7801\n<ccfb> <ccfb> 3847\n<ccfc> <ccfc> 7802\n<ccfd> <ccfd> 3849\n<ccfe> <ccfe> 7803\n<cda1> <cdb1> 3851\n<cdb2> <cdb2> 7804\n<cdb3> <cdcf> 3869\n<cdd0> <cdd0> 7805\n<cdd1> <cdd3> 3899\n<cdd4> <cdd4> 7806\n<cdd5> <cdd9> 3903\nendcidrange\n\n100 begincidrange\n<cdda> <cdda> 7476\n<cddb> <cde8> 3909\n<cde9> <cde9> 7807\n<cdea> <cdfe> 3924\n<cea1> <ceca> 3945\n<cecb> <cecb> 7808\n<cecc> <cef9> 3988\n<cefa> <cefb> 7809\n<cefc> <cefe> 4036\n<cfa1> <cfa1> 7811\n<cfa2> <cfb0> 4040\n<cfb1> <cfb1> 7812\n<cfb2> <cfb5> 4056\n<cfb6> <cfb6> 6007\n<cfb7> <cfb8> 4061\n<cfb9> <cfb9> 7813\n<cfba> <cfd3> 4064\n<d0a1> <d0d5> 4090\n<d0d6> <d0d6> 3751\n<d0d7> <d0fe> 4144\n<d1a1> <d1bc> 4184\n<d1bd> <d1bd> 7814\n<d1be> <d1c6> 4213\n<d1c7> <d1c7> 7815\n<d1c8> <d1ca> 4223\n<d1cb> <d1cb> 7816\n<d1cc> <d1cc> 4227\n<d1cd> <d1cd> 7817\n<d1ce> <d1fe> 4229\n<d2a1> <d2fe> 4278\n<d3a1> <d3af> 4372\n<d3b0> <d3b0> 7818\n<d3b1> <d3b9> 4388\n<d3ba> <d3ba> 7819\n<d3bb> <d3dd> 4398\n<d3de> <d3de> 7821\n<d3df> <d3ea> 4434\n<d3eb> <d3eb> 7822\n<d3ec> <d3fe> 4447\n<d4a1> <d4c3> 4466\n<d4c4> <d4c4> 7823\n<d4c5> <d4e3> 4502\n<d4e4> <d4e4> 3063\n<d4e5> <d4fe> 4534\n<d5a1> <d5bc> 4560\n<d5bd> <d5bd> 7824\n<d5be> <d5e2> 4589\n<d5e3> <d5e3> 7825\n<d5e4> <d5fe> 4627\n<d6a1> <d6a1> 4654\n<d6a2> <d6a2> 7826\n<d6a3> <d6fe> 4656\n<d7a1> <d7fe> 4748\n<d8a1> <d8a3> 4842\n<d8a4> <d8a4> 7828\n<d8a5> <d8fe> 4846\n<d9a1> <d9df> 4936\n<d9e0> <d9e0> 7829\n<d9e1> <d9eb> 5000\n<d9ec> <d9ec> 7830\n<d9ed> <d9f7> 5012\n<d9f8> <d9f8> 1447\n<d9f9> <d9fe> 5024\n<daa1> <dab8> 5030\n<dab9> <dab9> 7831\n<daba> <dacc> 5055\n<dacd> <dacd> 7832\n<dace> <dafe> 5075\n<dba1> <dbc4> 5124\n<dbc5> <dbc5> 7833\n<dbc6> <dbc9> 5161\n<dbca> <dbca> 7834\n<dbcb> <dbd7> 5166\n<dbd8> <dbd8> 3490\n<dbd9> <dbea> 5180\n<dbeb> <dbeb> 7835\n<dbec> <dbec> 5199\n<dbed> <dbed> 3176\n<dbee> <dbf3> 5201\n<dbf4> <dbf4> 7836\n<dbf5> <dbfe> 5208\n<dca1> <dcfe> 5218\n<dda1> <ddfe> 5312\n<dea1> <deb8> 5406\n<deb9> <deb9> 3181\n<deba> <decf> 5431\n<ded0> <ded0> 7837\n<ded1> <def4> 5454\n<def5> <def5> 1535\n<def6> <defe> 5491\n<dfa1> <dffe> 5500\n<e0a1> <e0a5> 5594\n<e0a6> <e0a6> 7839\n<e0a7> <e0de> 5600\n<e0df> <e0df> 7840\n<e0e0> <e0f5> 5657\n<e0f6> <e0f6> 7477\n<e0f7> <e0fe> 5680\n<e1a1> <e1aa> 5688\n<e1ab> <e1ab> 7841\nendcidrange\n\n100 begincidrange\n<e1ac> <e1af> 5699\n<e1b0> <e1b1> 7842\n<e1b2> <e1fe> 5705\n<e2a1> <e2aa> 5782\n<e2ab> <e2ab> 7844\n<e2ac> <e2e7> 5793\n<e2e8> <e2e8> 2030\n<e2e9> <e2e9> 5854\n<e2ea> <e2ea> 3153\n<e2eb> <e2ee> 5856\n<e2ef> <e2ef> 7845\n<e2f0> <e2fe> 5861\n<e3a1> <e3c9> 5876\n<e3ca> <e3ca> 7846\n<e3cb> <e3d3> 5918\n<e3d4> <e3d4> 7847\n<e3d5> <e3dd> 5928\n<e3de> <e3de> 1492\n<e3df> <e3fe> 5938\n<e4a1> <e4b8> 5970\n<e4b9> <e4b9> 7848\n<e4ba> <e4c5> 5995\n<e4c6> <e4c6> 4060\n<e4c7> <e4e3> 6008\n<e4e4> <e4e4> 7849\n<e4e5> <e4ed> 6038\n<e4ee> <e4ee> 7850\n<e4ef> <e4fe> 6048\n<e5a1> <e5b8> 6064\n<e5b9> <e5b9> 7851\n<e5ba> <e5ba> 6089\n<e5bb> <e5bb> 7852\n<e5bc> <e5c5> 6091\n<e5c6> <e5c6> 7853\n<e5c7> <e5fe> 6102\n<e6a1> <e6c5> 6158\n<e6c6> <e6c6> 7854\n<e6c7> <e6fe> 6196\n<e7a1> <e7e3> 6252\n<e7e4> <e7e4> 7855\n<e7e5> <e7e8> 6320\n<e7e9> <e7e9> 7856\n<e7ea> <e7f1> 6325\n<e7f2> <e7f2> 7857\n<e7f3> <e7fe> 6334\n<e8a1> <e8b3> 6346\n<e8b4> <e8b4> 7858\n<e8b5> <e8ba> 6366\n<e8bb> <e8bb> 7859\n<e8bc> <e8f3> 6373\n<e8f4> <e8f4> 7860\n<e8f5> <e8fe> 6430\n<e9a1> <e9a1> 6440\n<e9a2> <e9a2> 2293\n<e9a3> <e9ad> 6442\n<e9ae> <e9ae> 3845\n<e9af> <e9d9> 6454\n<e9da> <e9da> 1440\n<e9db> <e9fe> 6498\n<eaa1> <eaa3> 6534\n<eaa4> <eaa4> 3358\n<eaa5> <eaa6> 6538\n<eaa7> <eaa7> 7862\n<eaa8> <eabc> 6541\n<eabd> <eabd> 7863\n<eabe> <eaee> 6563\n<eaef> <eaef> 7864\n<eaf0> <eafe> 6613\n<eba1> <ebb1> 6628\n<ebb2> <ebb2> 7865\n<ebb3> <ebdc> 6646\n<ebdd> <ebdd> 1550\n<ebde> <ebe5> 6689\n<ebe6> <ebe6> 7866\n<ebe7> <ebf5> 6698\n<ebf6> <ebf6> 7867\n<ebf7> <ebfe> 6714\n<eca1> <eccc> 6722\n<eccd> <eccd> 2730\n<ecce> <ece8> 6767\n<ece9> <ece9> 7868\n<ecea> <ecf3> 6795\n<ecf4> <ecf4> 7869\n<ecf5> <ecfe> 6806\n<eda1> <edcd> 6816\n<edce> <edce> 7870\n<edcf> <edeb> 6862\n<edec> <edec> 7871\n<eded> <eded> 6892\n<edee> <edee> 7872\n<edef> <edfe> 6894\n<eea1> <eea8> 6910\n<eea9> <eea9> 7873\n<eeaa> <eebc> 6919\n<eebd> <eebd> 7874\n<eebe> <eed6> 6939\n<eed7> <eed7> 7875\n<eed8> <eefe> 6965\n<efa1> <effe> 7004\n<f0a1> <f0c4> 7098\nendcidrange\n\n25 begincidrange\n<f0c5> <f0c5> 7878\n<f0c6> <f0d0> 7135\n<f0d1> <f0d1> 7879\n<f0d2> <f0d6> 7147\n<f0d7> <f0d7> 7880\n<f0d8> <f0f3> 7153\n<f0f4> <f0f4> 1841\n<f0f5> <f0f5> 7881\n<f0f6> <f0fe> 7183\n<f1a1> <f1fe> 7192\n<f2a1> <f2ac> 7286\n<f2ad> <f2ad> 7882\n<f2ae> <f2bb> 7299\n<f2bc> <f2bc> 7883\n<f2bd> <f2cc> 7314\n<f2cd> <f2cd> 1143\n<f2ce> <f2ce> 7884\n<f2cf> <f2f3> 7332\n<f2f4> <f2f4> 1321\n<f2f5> <f2fe> 7370\n<f3a1> <f3d0> 7380\n<f3d1> <f3d1> 7885\n<f3d2> <f3fc> 7429\n<f3fd> <f3fd> 7886\n<f3fe> <f3fe> 7473\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/78-EUC-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (78-EUC-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (78-EUC-H)\n%%BeginResource: CMap (78-EUC-V)\n%%Title: (78-EUC-V Adobe Japan1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/78-EUC-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 0 def\nend def\n\n/CMapName /78-EUC-V def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/XUID [1 10 25355] def\n\n/WMode 1 def\n\n27 begincidrange\n<a1a2> <a1a3> 7887\n<a1b1> <a1b2> 7889\n<a1bc> <a1be> 7891\n<a1c1> <a1c5> 7894\n<a1ca> <a1db> 7899\n<a1e1> <a1e1> 7917\n<a4a1> <a4a1> 7918\n<a4a3> <a4a3> 7919\n<a4a5> <a4a5> 7920\n<a4a7> <a4a7> 7921\n<a4a9> <a4a9> 7922\n<a4c3> <a4c3> 7923\n<a4e3> <a4e3> 7924\n<a4e5> <a4e5> 7925\n<a4e7> <a4e7> 7926\n<a4ee> <a4ee> 7927\n<a5a1> <a5a1> 7928\n<a5a3> <a5a3> 7929\n<a5a5> <a5a5> 7930\n<a5a7> <a5a7> 7931\n<a5a9> <a5a9> 7932\n<a5c3> <a5c3> 7933\n<a5e3> <a5e3> 7934\n<a5e5> <a5e5> 7935\n<a5e7> <a5e7> 7936\n<a5ee> <a5ee> 7937\n<a5f5> <a5f6> 7938\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/78-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (78-H)\n%%Title: (78-H Adobe Japan1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 0 def\nend def\n\n/CMapName /78-H def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/XUID [1 10 25345] def\n\n/WMode 0 def\n\n1 begincodespacerange\n  <2121> <7E7E>\nendcodespacerange\n\n100 begincidrange\n<2121> <217e> 633\n<2221> <222e> 727\n<2330> <2339> 780\n<2341> <235a> 790\n<2361> <237a> 816\n<2421> <2473> 842\n<2521> <2576> 925\n<2621> <2638> 1011\n<2641> <2658> 1035\n<2721> <2741> 1059\n<2751> <2771> 1092\n<3021> <3021> 1125\n<3022> <3022> 7633\n<3023> <3028> 1127\n<3029> <3029> 8266\n<302a> <3031> 1134\n<3032> <3032> 7961\n<3033> <3033> 7330\n<3034> <303a> 1144\n<303b> <303b> 7634\n<303c> <306d> 1152\n<306e> <306e> 7635\n<306f> <3072> 1203\n<3073> <3073> 7636\n<3074> <307b> 1208\n<307c> <307c> 7637\n<307d> <307e> 1217\n<3121> <3129> 1219\n<312a> <312a> 7638\n<312b> <3134> 1229\n<3135> <3135> 7639\n<3136> <3138> 1240\n<3139> <3139> 7640\n<313a> <313c> 1244\n<313d> <313d> 7642\n<313e> <3141> 1248\n<3142> <3142> 7643\n<3143> <316a> 1253\n<316b> <316b> 7644\n<316c> <317e> 1294\n<3221> <3227> 1313\n<3228> <3228> 7645\n<3229> <3229> 7369\n<322a> <322a> 7646\n<322b> <325f> 1323\n<3260> <3260> 7647\n<3261> <3279> 1377\n<327a> <327a> 7648\n<327b> <327c> 1403\n<327d> <327d> 7649\n<327e> <327e> 1406\n<3321> <3321> 1407\n<3322> <3322> 7650\n<3323> <3341> 1409\n<3342> <3342> 6497\n<3343> <3348> 1441\n<3349> <3349> 5023\n<334a> <3364> 1448\n<3365> <3365> 7651\n<3366> <336a> 1476\n<336b> <336b> 7652\n<336c> <3372> 1482\n<3373> <3373> 7653\n<3374> <3375> 1490\n<3376> <3376> 5937\n<3377> <3379> 1493\n<337a> <337a> 7654\n<337b> <337e> 1497\n<3421> <3441> 1501\n<3442> <3442> 7655\n<3443> <3443> 5490\n<3444> <344c> 1536\n<344d> <344d> 7656\n<344e> <3451> 1546\n<3452> <3452> 6688\n<3453> <3464> 1551\n<3465> <3465> 7657\n<3466> <347e> 1570\n<3521> <352a> 1595\n<352b> <352b> 7658\n<352c> <353f> 1606\n<3540> <3540> 7659\n<3541> <357e> 1627\n<3621> <3621> 1689\n<3622> <3622> 7660\n<3623> <3629> 1691\n<362a> <362a> 7661\n<362b> <3645> 1699\n<3646> <3646> 7474\n<3647> <364e> 1727\n<364f> <364f> 7662\n<3650> <366c> 1736\n<366d> <366d> 7663\n<366e> <3673> 1766\n<3674> <3674> 7664\n<3675> <367a> 1773\n<367b> <367b> 7665\n<367c> <367c> 1780\n<367d> <367d> 7666\n<367e> <367e> 1782\nendcidrange\n\n100 begincidrange\n<3721> <3723> 1783\n<3724> <3724> 7667\n<3725> <3736> 1787\n<3737> <3737> 7668\n<3738> <3744> 1806\n<3745> <3745> 7669\n<3746> <374d> 1820\n<374e> <374e> 7670\n<374f> <3751> 1829\n<3752> <3752> 7671\n<3753> <3754> 1833\n<3755> <3755> 7672\n<3756> <375a> 1836\n<375b> <375b> 7181\n<375c> <3763> 1842\n<3764> <3764> 7673\n<3765> <3770> 1851\n<3771> <3771> 7674\n<3772> <3778> 1864\n<3779> <3779> 7675\n<377a> <377d> 1872\n<377e> <377e> 7676\n<3821> <3833> 1877\n<3834> <3834> 7677\n<3835> <3840> 1897\n<3841> <3841> 7678\n<3842> <387e> 1910\n<3921> <392a> 1971\n<392b> <392b> 7679\n<392c> <3936> 1982\n<3937> <3937> 7680\n<3938> <3941> 1994\n<3942> <3942> 7681\n<3943> <395b> 2005\n<395c> <395c> 5853\n<395d> <396c> 2031\n<396d> <396d> 7682\n<396e> <3973> 2048\n<3974> <3974> 7683\n<3975> <3978> 2055\n<3979> <3979> 7684\n<397a> <397e> 2060\n<3a21> <3a52> 2065\n<3a53> <3a53> 7685\n<3a54> <3a66> 2116\n<3a67> <3a67> 7686\n<3a68> <3a73> 2136\n<3a74> <3a74> 7687\n<3a75> <3a7e> 2149\n<3b21> <3b26> 2159\n<3b27> <3b27> 7688\n<3b28> <3b29> 2166\n<3b2a> <3b2a> 7689\n<3b2b> <3b2b> 2169\n<3b2c> <3b2c> 7690\n<3b2d> <3b38> 2171\n<3b39> <3b39> 7691\n<3b3a> <3b7e> 2184\n<3c21> <3c47> 2253\n<3c48> <3c48> 7693\n<3c49> <3c49> 6441\n<3c4a> <3c56> 2294\n<3c57> <3c57> 7694\n<3c58> <3c5c> 2308\n<3c5d> <3c5e> 7695\n<3c5f> <3c7e> 2315\n<3d21> <3d2a> 2347\n<3d2b> <3d2b> 7697\n<3d2c> <3d35> 2358\n<3d36> <3d36> 7698\n<3d37> <3d6b> 2369\n<3d6c> <3d6d> 7699\n<3d6e> <3d71> 2424\n<3d72> <3d73> 7701\n<3d74> <3d7e> 2430\n<3e21> <3e24> 2441\n<3e25> <3e25> 7703\n<3e26> <3e32> 2446\n<3e33> <3e33> 7704\n<3e34> <3e3e> 2460\n<3e3f> <3e3f> 7705\n<3e40> <3e54> 2472\n<3e55> <3e55> 7706\n<3e56> <3e5e> 2494\n<3e5f> <3e5f> 7707\n<3e60> <3e63> 2504\n<3e64> <3e64> 7708\n<3e65> <3e7e> 2509\n<3f21> <3f29> 2535\n<3f2a> <3f2a> 7709\n<3f2b> <3f58> 2545\n<3f59> <3f59> 7710\n<3f5a> <3f5f> 2592\n<3f60> <3f60> 7711\n<3f61> <3f68> 2599\n<3f69> <3f69> 7712\n<3f6a> <3f7e> 2608\n<4021> <4021> 2629\n<4022> <4022> 7713\n<4023> <4041> 2631\nendcidrange\n\n100 begincidrange\n<4042> <4042> 7714\n<4043> <4065> 2663\n<4066> <4066> 7715\n<4067> <4070> 2699\n<4071> <4072> 7716\n<4073> <4078> 2711\n<4079> <407a> 7718\n<407b> <407e> 2719\n<4121> <4126> 2723\n<4127> <4127> 7720\n<4128> <4128> 6766\n<4129> <4138> 2731\n<4139> <4139> 7721\n<413a> <414b> 2748\n<414c> <414c> 7722\n<414d> <414e> 2767\n<414f> <414f> 7723\n<4150> <415e> 2770\n<415f> <415f> 7724\n<4160> <4168> 2786\n<4169> <4169> 7725\n<416a> <417e> 2796\n<4221> <423c> 2817\n<423d> <423d> 7726\n<423e> <424c> 2846\n<424d> <424d> 7727\n<424e> <425b> 2862\n<425c> <425c> 7728\n<425d> <4262> 2877\n<4263> <4263> 7729\n<4264> <426e> 2884\n<426f> <426f> 7730\n<4270> <4274> 2896\n<4275> <4276> 7731\n<4277> <427c> 2903\n<427d> <427d> 7733\n<427e> <427e> 2910\n<4321> <4326> 2911\n<4327> <4327> 7734\n<4328> <4328> 2918\n<4329> <432a> 7735\n<432b> <432c> 2921\n<432d> <432e> 7737\n<432f> <433c> 2925\n<433d> <433d> 7739\n<433e> <436f> 2940\n<4370> <4370> 7740\n<4371> <4374> 2991\n<4375> <4375> 7741\n<4376> <437b> 2996\n<437c> <437c> 7742\n<437d> <437e> 3003\n<4421> <443c> 3005\n<443d> <443d> 7743\n<443e> <4447> 3034\n<4448> <4448> 7744\n<4449> <4449> 3045\n<444a> <444a> 7745\n<444b> <444c> 3047\n<444d> <444d> 7746\n<444e> <444e> 3050\n<444f> <444f> 7747\n<4450> <4453> 3052\n<4454> <4454> 8267\n<4455> <445a> 3057\n<445b> <445b> 4533\n<445c> <447e> 3064\n<4521> <4521> 3099\n<4522> <4522> 7748\n<4523> <4526> 3101\n<4527> <4527> 7749\n<4528> <452d> 3106\n<452e> <452e> 7750\n<452f> <4535> 3113\n<4536> <4536> 7751\n<4537> <453e> 3121\n<453f> <453f> 7752\n<4540> <4547> 3130\n<4548> <4548> 7753\n<4549> <454a> 3139\n<454b> <454b> 7754\n<454c> <4550> 3142\n<4551> <4552> 7755\n<4553> <4556> 3149\n<4557> <4557> 5855\n<4558> <4563> 3154\n<4564> <4564> 7757\n<4565> <456d> 3167\n<456e> <456e> 5200\n<456f> <4572> 3177\n<4573> <4573> 5430\n<4574> <4577> 3182\n<4578> <4578> 7758\n<4579> <457e> 3187\n<4621> <463d> 3193\n<463e> <463e> 7759\n<463f> <4641> 3223\n<4642> <4642> 7760\n<4643> <4653> 3227\n<4654> <4655> 7761\nendcidrange\n\n100 begincidrange\n<4656> <465a> 3246\n<465b> <465c> 7763\n<465d> <4660> 3253\n<4661> <4661> 7765\n<4662> <4665> 3258\n<4666> <4667> 7766\n<4668> <4669> 3264\n<466a> <466a> 7768\n<466b> <4675> 3267\n<4676> <4676> 6893\n<4677> <467e> 3279\n<4721> <4728> 3287\n<4729> <4729> 7769\n<472a> <4738> 3296\n<4739> <4739> 7770\n<473a> <4756> 3312\n<4757> <4757> 7771\n<4758> <4766> 3342\n<4767> <4767> 7772\n<4768> <4768> 6537\n<4769> <4769> 7773\n<476a> <476c> 3360\n<476d> <476d> 7774\n<476e> <477e> 3364\n<4821> <4823> 3381\n<4824> <4824> 7775\n<4825> <482d> 3385\n<482e> <482e> 7776\n<482f> <482f> 3395\n<4830> <4830> 7777\n<4831> <4853> 3397\n<4854> <4854> 7778\n<4855> <4861> 3433\n<4862> <4862> 7779\n<4863> <4874> 3447\n<4875> <4875> 7780\n<4876> <487e> 3466\n<4921> <4921> 3475\n<4922> <4923> 7781\n<4924> <492e> 3478\n<492f> <492f> 7783\n<4930> <4930> 5179\n<4931> <4931> 3491\n<4932> <4932> 7784\n<4933> <4934> 3493\n<4935> <4935> 7785\n<4936> <493f> 3496\n<4940> <4940> 7786\n<4941> <494d> 3507\n<494e> <494e> 7787\n<494f> <4950> 3521\n<4951> <4951> 7788\n<4952> <497e> 3524\n<4a21> <4a42> 3569\n<4a43> <4a43> 7789\n<4a44> <4a4c> 3604\n<4a4d> <4a4d> 7790\n<4a4e> <4a59> 3614\n<4a5a> <4a5a> 7791\n<4a5b> <4a78> 3627\n<4a79> <4a79> 7792\n<4a7a> <4a7e> 3658\n<4b21> <4b21> 3663\n<4b22> <4b22> 7793\n<4b23> <4b28> 3665\n<4b29> <4b29> 7794\n<4b2a> <4b4a> 3672\n<4b4b> <4b4b> 7795\n<4b4c> <4b69> 3706\n<4b6a> <4b6a> 7475\n<4b6b> <4b6f> 3737\n<4b70> <4b70> 7796\n<4b71> <4b77> 3743\n<4b78> <4b78> 7980\n<4b79> <4b79> 4143\n<4b7a> <4b7e> 3752\n<4c21> <4c4c> 3757\n<4c4d> <4c4d> 7797\n<4c4e> <4c58> 3802\n<4c59> <4c59> 7798\n<4c5a> <4c5e> 3814\n<4c5f> <4c5f> 7799\n<4c60> <4c61> 3820\n<4c62> <4c62> 7800\n<4c63> <4c78> 3823\n<4c79> <4c79> 6453\n<4c7a> <4c7a> 7801\n<4c7b> <4c7b> 3847\n<4c7c> <4c7c> 7802\n<4c7d> <4c7d> 3849\n<4c7e> <4c7e> 7803\n<4d21> <4d31> 3851\n<4d32> <4d32> 7804\n<4d33> <4d4f> 3869\n<4d50> <4d50> 7805\n<4d51> <4d53> 3899\n<4d54> <4d54> 7806\n<4d55> <4d59> 3903\n<4d5a> <4d5a> 7476\n<4d5b> <4d68> 3909\nendcidrange\n\n100 begincidrange\n<4d69> <4d69> 7807\n<4d6a> <4d7e> 3924\n<4e21> <4e4a> 3945\n<4e4b> <4e4b> 7808\n<4e4c> <4e79> 3988\n<4e7a> <4e7b> 7809\n<4e7c> <4e7e> 4036\n<4f21> <4f21> 7811\n<4f22> <4f30> 4040\n<4f31> <4f31> 7812\n<4f32> <4f35> 4056\n<4f36> <4f36> 6007\n<4f37> <4f38> 4061\n<4f39> <4f39> 7813\n<4f3a> <4f53> 4064\n<5021> <5055> 4090\n<5056> <5056> 3751\n<5057> <507e> 4144\n<5121> <513c> 4184\n<513d> <513d> 7814\n<513e> <5146> 4213\n<5147> <5147> 7815\n<5148> <514a> 4223\n<514b> <514b> 7816\n<514c> <514c> 4227\n<514d> <514d> 7817\n<514e> <517e> 4229\n<5221> <527e> 4278\n<5321> <532f> 4372\n<5330> <5330> 7818\n<5331> <5339> 4388\n<533a> <533a> 7819\n<533b> <535d> 4398\n<535e> <535e> 7821\n<535f> <536a> 4434\n<536b> <536b> 7822\n<536c> <537e> 4447\n<5421> <5443> 4466\n<5444> <5444> 7823\n<5445> <5463> 4502\n<5464> <5464> 3063\n<5465> <547e> 4534\n<5521> <553c> 4560\n<553d> <553d> 7824\n<553e> <5562> 4589\n<5563> <5563> 7825\n<5564> <557e> 4627\n<5621> <5621> 4654\n<5622> <5622> 7826\n<5623> <567e> 4656\n<5721> <577e> 4748\n<5821> <5823> 4842\n<5824> <5824> 7828\n<5825> <587e> 4846\n<5921> <595f> 4936\n<5960> <5960> 7829\n<5961> <596b> 5000\n<596c> <596c> 7830\n<596d> <5977> 5012\n<5978> <5978> 1447\n<5979> <597e> 5024\n<5a21> <5a38> 5030\n<5a39> <5a39> 7831\n<5a3a> <5a4c> 5055\n<5a4d> <5a4d> 7832\n<5a4e> <5a7e> 5075\n<5b21> <5b44> 5124\n<5b45> <5b45> 7833\n<5b46> <5b49> 5161\n<5b4a> <5b4a> 7834\n<5b4b> <5b57> 5166\n<5b58> <5b58> 3490\n<5b59> <5b6a> 5180\n<5b6b> <5b6b> 7835\n<5b6c> <5b6c> 5199\n<5b6d> <5b6d> 3176\n<5b6e> <5b73> 5201\n<5b74> <5b74> 7836\n<5b75> <5b7e> 5208\n<5c21> <5c7e> 5218\n<5d21> <5d7e> 5312\n<5e21> <5e38> 5406\n<5e39> <5e39> 3181\n<5e3a> <5e4f> 5431\n<5e50> <5e50> 7837\n<5e51> <5e74> 5454\n<5e75> <5e75> 1535\n<5e76> <5e7e> 5491\n<5f21> <5f7e> 5500\n<6021> <6025> 5594\n<6026> <6026> 7839\n<6027> <605e> 5600\n<605f> <605f> 7840\n<6060> <6075> 5657\n<6076> <6076> 7477\n<6077> <607e> 5680\n<6121> <612a> 5688\n<612b> <612b> 7841\n<612c> <612f> 5699\n<6130> <6131> 7842\nendcidrange\n\n100 begincidrange\n<6132> <617e> 5705\n<6221> <622a> 5782\n<622b> <622b> 7844\n<622c> <6267> 5793\n<6268> <6268> 2030\n<6269> <6269> 5854\n<626a> <626a> 3153\n<626b> <626e> 5856\n<626f> <626f> 7845\n<6270> <627e> 5861\n<6321> <6349> 5876\n<634a> <634a> 7846\n<634b> <6353> 5918\n<6354> <6354> 7847\n<6355> <635d> 5928\n<635e> <635e> 1492\n<635f> <637e> 5938\n<6421> <6438> 5970\n<6439> <6439> 7848\n<643a> <6445> 5995\n<6446> <6446> 4060\n<6447> <6463> 6008\n<6464> <6464> 7849\n<6465> <646d> 6038\n<646e> <646e> 7850\n<646f> <647e> 6048\n<6521> <6538> 6064\n<6539> <6539> 7851\n<653a> <653a> 6089\n<653b> <653b> 7852\n<653c> <6545> 6091\n<6546> <6546> 7853\n<6547> <657e> 6102\n<6621> <6645> 6158\n<6646> <6646> 7854\n<6647> <667e> 6196\n<6721> <6763> 6252\n<6764> <6764> 7855\n<6765> <6768> 6320\n<6769> <6769> 7856\n<676a> <6771> 6325\n<6772> <6772> 7857\n<6773> <677e> 6334\n<6821> <6833> 6346\n<6834> <6834> 7858\n<6835> <683a> 6366\n<683b> <683b> 7859\n<683c> <6873> 6373\n<6874> <6874> 7860\n<6875> <687e> 6430\n<6921> <6921> 6440\n<6922> <6922> 2293\n<6923> <692d> 6442\n<692e> <692e> 3845\n<692f> <6959> 6454\n<695a> <695a> 1440\n<695b> <697e> 6498\n<6a21> <6a23> 6534\n<6a24> <6a24> 3358\n<6a25> <6a26> 6538\n<6a27> <6a27> 7862\n<6a28> <6a3c> 6541\n<6a3d> <6a3d> 7863\n<6a3e> <6a6e> 6563\n<6a6f> <6a6f> 7864\n<6a70> <6a7e> 6613\n<6b21> <6b31> 6628\n<6b32> <6b32> 7865\n<6b33> <6b5c> 6646\n<6b5d> <6b5d> 1550\n<6b5e> <6b65> 6689\n<6b66> <6b66> 7866\n<6b67> <6b75> 6698\n<6b76> <6b76> 7867\n<6b77> <6b7e> 6714\n<6c21> <6c4c> 6722\n<6c4d> <6c4d> 2730\n<6c4e> <6c68> 6767\n<6c69> <6c69> 7868\n<6c6a> <6c73> 6795\n<6c74> <6c74> 7869\n<6c75> <6c7e> 6806\n<6d21> <6d4d> 6816\n<6d4e> <6d4e> 7870\n<6d4f> <6d6b> 6862\n<6d6c> <6d6c> 7871\n<6d6d> <6d6d> 6892\n<6d6e> <6d6e> 7872\n<6d6f> <6d7e> 6894\n<6e21> <6e28> 6910\n<6e29> <6e29> 7873\n<6e2a> <6e3c> 6919\n<6e3d> <6e3d> 7874\n<6e3e> <6e56> 6939\n<6e57> <6e57> 7875\n<6e58> <6e7e> 6965\n<6f21> <6f7e> 7004\n<7021> <7044> 7098\n<7045> <7045> 7878\n<7046> <7050> 7135\nendcidrange\n\n23 begincidrange\n<7051> <7051> 7879\n<7052> <7056> 7147\n<7057> <7057> 7880\n<7058> <7073> 7153\n<7074> <7074> 1841\n<7075> <7075> 7881\n<7076> <707e> 7183\n<7121> <717e> 7192\n<7221> <722c> 7286\n<722d> <722d> 7882\n<722e> <723b> 7299\n<723c> <723c> 7883\n<723d> <724c> 7314\n<724d> <724d> 1143\n<724e> <724e> 7884\n<724f> <7273> 7332\n<7274> <7274> 1321\n<7275> <727e> 7370\n<7321> <7350> 7380\n<7351> <7351> 7885\n<7352> <737c> 7429\n<737d> <737d> 7886\n<737e> <737e> 7473\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/78-RKSJ-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (78-RKSJ-H)\n%%Title: (78-RKSJ-H Adobe Japan1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 0 def\nend def\n\n/CMapName /78-RKSJ-H def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/XUID [1 10 25346] def\n\n/WMode 0 def\n\n4 begincodespacerange\n  <00>   <80>\n  <8140> <9FFC>\n  <A0>   <DF>\n  <E040> <FCFC>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 231\nendnotdefrange\n\n100 begincidrange\n<20> <7e> 231\n<8140> <817e> 633\n<8180> <81ac> 696\n<824f> <8258> 780\n<8260> <8279> 790\n<8281> <829a> 816\n<829f> <82f1> 842\n<8340> <837e> 925\n<8380> <8396> 988\n<839f> <83b6> 1011\n<83bf> <83d6> 1035\n<8440> <8460> 1059\n<8470> <847e> 1092\n<8480> <8491> 1107\n<889f> <889f> 1125\n<88a0> <88a0> 7633\n<88a1> <88a6> 1127\n<88a7> <88a7> 8266\n<88a8> <88af> 1134\n<88b0> <88b0> 7961\n<88b1> <88b1> 7330\n<88b2> <88b8> 1144\n<88b9> <88b9> 7634\n<88ba> <88eb> 1152\n<88ec> <88ec> 7635\n<88ed> <88f0> 1203\n<88f1> <88f1> 7636\n<88f2> <88f9> 1208\n<88fa> <88fa> 7637\n<88fb> <88fc> 1217\n<8940> <8948> 1219\n<8949> <8949> 7638\n<894a> <8953> 1229\n<8954> <8954> 7639\n<8955> <8957> 1240\n<8958> <8958> 7640\n<8959> <895b> 1244\n<895c> <895c> 7642\n<895d> <8960> 1248\n<8961> <8961> 7643\n<8962> <897e> 1253\n<8980> <898a> 1282\n<898b> <898b> 7644\n<898c> <89a5> 1294\n<89a6> <89a6> 7645\n<89a7> <89a7> 7369\n<89a8> <89a8> 7646\n<89a9> <89dd> 1323\n<89de> <89de> 7647\n<89df> <89f7> 1377\n<89f8> <89f8> 7648\n<89f9> <89fa> 1403\n<89fb> <89fb> 7649\n<89fc> <89fc> 1406\n<8a40> <8a40> 1407\n<8a41> <8a41> 7650\n<8a42> <8a60> 1409\n<8a61> <8a61> 6497\n<8a62> <8a67> 1441\n<8a68> <8a68> 5023\n<8a69> <8a7e> 1448\n<8a80> <8a84> 1470\n<8a85> <8a85> 7651\n<8a86> <8a8a> 1476\n<8a8b> <8a8b> 7652\n<8a8c> <8a92> 1482\n<8a93> <8a93> 7653\n<8a94> <8a95> 1490\n<8a96> <8a96> 5937\n<8a97> <8a99> 1493\n<8a9a> <8a9a> 7654\n<8a9b> <8abf> 1497\n<8ac0> <8ac0> 7655\n<8ac1> <8ac1> 5490\n<8ac2> <8aca> 1536\n<8acb> <8acb> 7656\n<8acc> <8acf> 1546\n<8ad0> <8ad0> 6688\n<8ad1> <8ae2> 1551\n<8ae3> <8ae3> 7657\n<8ae4> <8afc> 1570\n<8b40> <8b49> 1595\n<8b4a> <8b4a> 7658\n<8b4b> <8b5e> 1606\n<8b5f> <8b5f> 7659\n<8b60> <8b7e> 1627\n<8b80> <8b9f> 1658\n<8ba0> <8ba0> 7660\n<8ba1> <8ba7> 1691\n<8ba8> <8ba8> 7661\n<8ba9> <8bc3> 1699\n<8bc4> <8bc4> 7474\n<8bc5> <8bcc> 1727\n<8bcd> <8bcd> 7662\n<8bce> <8bea> 1736\n<8beb> <8beb> 7663\n<8bec> <8bf1> 1766\n<8bf2> <8bf2> 7664\n<8bf3> <8bf8> 1773\n<8bf9> <8bf9> 7665\nendcidrange\n\n100 begincidrange\n<8bfa> <8bfa> 1780\n<8bfb> <8bfb> 7666\n<8bfc> <8bfc> 1782\n<8c40> <8c42> 1783\n<8c43> <8c43> 7667\n<8c44> <8c55> 1787\n<8c56> <8c56> 7668\n<8c57> <8c63> 1806\n<8c64> <8c64> 7669\n<8c65> <8c6c> 1820\n<8c6d> <8c6d> 7670\n<8c6e> <8c70> 1829\n<8c71> <8c71> 7671\n<8c72> <8c73> 1833\n<8c74> <8c74> 7672\n<8c75> <8c79> 1836\n<8c7a> <8c7a> 7181\n<8c7b> <8c7e> 1842\n<8c80> <8c83> 1846\n<8c84> <8c84> 7673\n<8c85> <8c90> 1851\n<8c91> <8c91> 7674\n<8c92> <8c98> 1864\n<8c99> <8c99> 7675\n<8c9a> <8c9d> 1872\n<8c9e> <8c9e> 7676\n<8c9f> <8cb1> 1877\n<8cb2> <8cb2> 7677\n<8cb3> <8cbe> 1897\n<8cbf> <8cbf> 7678\n<8cc0> <8cfc> 1910\n<8d40> <8d49> 1971\n<8d4a> <8d4a> 7679\n<8d4b> <8d55> 1982\n<8d56> <8d56> 7680\n<8d57> <8d60> 1994\n<8d61> <8d61> 7681\n<8d62> <8d7a> 2005\n<8d7b> <8d7b> 5853\n<8d7c> <8d7e> 2031\n<8d80> <8d8c> 2034\n<8d8d> <8d8d> 7682\n<8d8e> <8d93> 2048\n<8d94> <8d94> 7683\n<8d95> <8d98> 2055\n<8d99> <8d99> 7684\n<8d9a> <8dd0> 2060\n<8dd1> <8dd1> 7685\n<8dd2> <8de4> 2116\n<8de5> <8de5> 7686\n<8de6> <8df1> 2136\n<8df2> <8df2> 7687\n<8df3> <8dfc> 2149\n<8e40> <8e45> 2159\n<8e46> <8e46> 7688\n<8e47> <8e48> 2166\n<8e49> <8e49> 7689\n<8e4a> <8e4a> 2169\n<8e4b> <8e4b> 7690\n<8e4c> <8e57> 2171\n<8e58> <8e58> 7691\n<8e59> <8e7e> 2184\n<8e80> <8ec5> 2222\n<8ec6> <8ec6> 7693\n<8ec7> <8ec7> 6441\n<8ec8> <8ed4> 2294\n<8ed5> <8ed5> 7694\n<8ed6> <8eda> 2308\n<8edb> <8edc> 7695\n<8edd> <8efc> 2315\n<8f40> <8f49> 2347\n<8f4a> <8f4a> 7697\n<8f4b> <8f54> 2358\n<8f55> <8f55> 7698\n<8f56> <8f7e> 2369\n<8f80> <8f8b> 2410\n<8f8c> <8f8d> 7699\n<8f8e> <8f91> 2424\n<8f92> <8f93> 7701\n<8f94> <8fa2> 2430\n<8fa3> <8fa3> 7703\n<8fa4> <8fb0> 2446\n<8fb1> <8fb1> 7704\n<8fb2> <8fbc> 2460\n<8fbd> <8fbd> 7705\n<8fbe> <8fd2> 2472\n<8fd3> <8fd3> 7706\n<8fd4> <8fdc> 2494\n<8fdd> <8fdd> 7707\n<8fde> <8fe1> 2504\n<8fe2> <8fe2> 7708\n<8fe3> <8ffc> 2509\n<9040> <9048> 2535\n<9049> <9049> 7709\n<904a> <9077> 2545\n<9078> <9078> 7710\n<9079> <907e> 2592\n<9080> <9080> 7711\n<9081> <9088> 2599\n<9089> <9089> 7712\nendcidrange\n\n100 begincidrange\n<908a> <909f> 2608\n<90a0> <90a0> 7713\n<90a1> <90bf> 2631\n<90c0> <90c0> 7714\n<90c1> <90e3> 2663\n<90e4> <90e4> 7715\n<90e5> <90ee> 2699\n<90ef> <90f0> 7716\n<90f1> <90f6> 2711\n<90f7> <90f8> 7718\n<90f9> <90fc> 2719\n<9140> <9145> 2723\n<9146> <9146> 7720\n<9147> <9147> 6766\n<9148> <9157> 2731\n<9158> <9158> 7721\n<9159> <916a> 2748\n<916b> <916b> 7722\n<916c> <916d> 2767\n<916e> <916e> 7723\n<916f> <917d> 2770\n<917e> <917e> 7724\n<9180> <9188> 2786\n<9189> <9189> 7725\n<918a> <91ba> 2796\n<91bb> <91bb> 7726\n<91bc> <91ca> 2846\n<91cb> <91cb> 7727\n<91cc> <91d9> 2862\n<91da> <91da> 7728\n<91db> <91e0> 2877\n<91e1> <91e1> 7729\n<91e2> <91ec> 2884\n<91ed> <91ed> 7730\n<91ee> <91f2> 2896\n<91f3> <91f4> 7731\n<91f5> <91fa> 2903\n<91fb> <91fb> 7733\n<91fc> <91fc> 2910\n<9240> <9245> 2911\n<9246> <9246> 7734\n<9247> <9247> 2918\n<9248> <9249> 7735\n<924a> <924b> 2921\n<924c> <924d> 7737\n<924e> <925b> 2925\n<925c> <925c> 7739\n<925d> <927e> 2940\n<9280> <928f> 2974\n<9290> <9290> 7740\n<9291> <9294> 2991\n<9295> <9295> 7741\n<9296> <929b> 2996\n<929c> <929c> 7742\n<929d> <92ba> 3003\n<92bb> <92bb> 7743\n<92bc> <92c5> 3034\n<92c6> <92c6> 7744\n<92c7> <92c7> 3045\n<92c8> <92c8> 7745\n<92c9> <92ca> 3047\n<92cb> <92cb> 7746\n<92cc> <92cc> 3050\n<92cd> <92cd> 7747\n<92ce> <92d1> 3052\n<92d2> <92d2> 8267\n<92d3> <92d8> 3057\n<92d9> <92d9> 4533\n<92da> <92fc> 3064\n<9340> <9340> 3099\n<9341> <9341> 7748\n<9342> <9345> 3101\n<9346> <9346> 7749\n<9347> <934c> 3106\n<934d> <934d> 7750\n<934e> <9354> 3113\n<9355> <9355> 7751\n<9356> <935d> 3121\n<935e> <935e> 7752\n<935f> <9366> 3130\n<9367> <9367> 7753\n<9368> <9369> 3139\n<936a> <936a> 7754\n<936b> <936f> 3142\n<9370> <9371> 7755\n<9372> <9375> 3149\n<9376> <9376> 5855\n<9377> <937e> 3154\n<9380> <9383> 3162\n<9384> <9384> 7757\n<9385> <938d> 3167\n<938e> <938e> 5200\n<938f> <9392> 3177\n<9393> <9393> 5430\n<9394> <9397> 3182\n<9398> <9398> 7758\n<9399> <93bb> 3187\n<93bc> <93bc> 7759\n<93bd> <93bf> 3223\n<93c0> <93c0> 7760\nendcidrange\n\n100 begincidrange\n<93c1> <93d1> 3227\n<93d2> <93d3> 7761\n<93d4> <93d8> 3246\n<93d9> <93da> 7763\n<93db> <93de> 3253\n<93df> <93df> 7765\n<93e0> <93e3> 3258\n<93e4> <93e5> 7766\n<93e6> <93e7> 3264\n<93e8> <93e8> 7768\n<93e9> <93f3> 3267\n<93f4> <93f4> 6893\n<93f5> <93fc> 3279\n<9440> <9447> 3287\n<9448> <9448> 7769\n<9449> <9457> 3296\n<9458> <9458> 7770\n<9459> <9475> 3312\n<9476> <9476> 7771\n<9477> <947e> 3342\n<9480> <9486> 3350\n<9487> <9487> 7772\n<9488> <9488> 6537\n<9489> <9489> 7773\n<948a> <948c> 3360\n<948d> <948d> 7774\n<948e> <94a1> 3364\n<94a2> <94a2> 7775\n<94a3> <94ab> 3385\n<94ac> <94ac> 7776\n<94ad> <94ad> 3395\n<94ae> <94ae> 7777\n<94af> <94d1> 3397\n<94d2> <94d2> 7778\n<94d3> <94df> 3433\n<94e0> <94e0> 7779\n<94e1> <94f2> 3447\n<94f3> <94f3> 7780\n<94f4> <94fc> 3466\n<9540> <9540> 3475\n<9541> <9542> 7781\n<9543> <954d> 3478\n<954e> <954e> 7783\n<954f> <954f> 5179\n<9550> <9550> 3491\n<9551> <9551> 7784\n<9552> <9553> 3493\n<9554> <9554> 7785\n<9555> <955e> 3496\n<955f> <955f> 7786\n<9560> <956c> 3507\n<956d> <956d> 7787\n<956e> <956f> 3521\n<9570> <9570> 7788\n<9571> <957e> 3524\n<9580> <95c0> 3538\n<95c1> <95c1> 7789\n<95c2> <95ca> 3604\n<95cb> <95cb> 7790\n<95cc> <95d7> 3614\n<95d8> <95d8> 7791\n<95d9> <95f6> 3627\n<95f7> <95f7> 7792\n<95f8> <95fc> 3658\n<9640> <9640> 3663\n<9641> <9641> 7793\n<9642> <9647> 3665\n<9648> <9648> 7794\n<9649> <9669> 3672\n<966a> <966a> 7795\n<966b> <967e> 3706\n<9680> <9689> 3726\n<968a> <968a> 7475\n<968b> <968f> 3737\n<9690> <9690> 7796\n<9691> <9697> 3743\n<9698> <9698> 7980\n<9699> <9699> 4143\n<969a> <96ca> 3752\n<96cb> <96cb> 7797\n<96cc> <96d6> 3802\n<96d7> <96d7> 7798\n<96d8> <96dc> 3814\n<96dd> <96dd> 7799\n<96de> <96df> 3820\n<96e0> <96e0> 7800\n<96e1> <96f6> 3823\n<96f7> <96f7> 6453\n<96f8> <96f8> 7801\n<96f9> <96f9> 3847\n<96fa> <96fa> 7802\n<96fb> <96fb> 3849\n<96fc> <96fc> 7803\n<9740> <9750> 3851\n<9751> <9751> 7804\n<9752> <976e> 3869\n<976f> <976f> 7805\n<9770> <9772> 3899\n<9773> <9773> 7806\n<9774> <9778> 3903\nendcidrange\n\n100 begincidrange\n<9779> <9779> 7476\n<977a> <977e> 3909\n<9780> <9788> 3914\n<9789> <9789> 7807\n<978a> <97c8> 3924\n<97c9> <97c9> 7808\n<97ca> <97f7> 3988\n<97f8> <97f9> 7809\n<97fa> <97fc> 4036\n<9840> <9840> 7811\n<9841> <984f> 4040\n<9850> <9850> 7812\n<9851> <9854> 4056\n<9855> <9855> 6007\n<9856> <9857> 4061\n<9858> <9858> 7813\n<9859> <9872> 4064\n<989f> <98d3> 4090\n<98d4> <98d4> 3751\n<98d5> <98fc> 4144\n<9940> <995b> 4184\n<995c> <995c> 7814\n<995d> <9965> 4213\n<9966> <9966> 7815\n<9967> <9969> 4223\n<996a> <996a> 7816\n<996b> <996b> 4227\n<996c> <996c> 7817\n<996d> <997e> 4229\n<9980> <99fc> 4247\n<9a40> <9a4e> 4372\n<9a4f> <9a4f> 7818\n<9a50> <9a58> 4388\n<9a59> <9a59> 7819\n<9a5a> <9a7c> 4398\n<9a7d> <9a7d> 7821\n<9a7e> <9a7e> 4434\n<9a80> <9a8a> 4435\n<9a8b> <9a8b> 7822\n<9a8c> <9ac1> 4447\n<9ac2> <9ac2> 7823\n<9ac3> <9ae1> 4502\n<9ae2> <9ae2> 3063\n<9ae3> <9afc> 4534\n<9b40> <9b5b> 4560\n<9b5c> <9b5c> 7824\n<9b5d> <9b7e> 4589\n<9b80> <9b82> 4623\n<9b83> <9b83> 7825\n<9b84> <9b9f> 4627\n<9ba0> <9ba0> 7826\n<9ba1> <9bfc> 4656\n<9c40> <9c7e> 4748\n<9c80> <9ca1> 4811\n<9ca2> <9ca2> 7828\n<9ca3> <9cfc> 4846\n<9d40> <9d7e> 4936\n<9d80> <9d80> 7829\n<9d81> <9d8b> 5000\n<9d8c> <9d8c> 7830\n<9d8d> <9d97> 5012\n<9d98> <9d98> 1447\n<9d99> <9db6> 5024\n<9db7> <9db7> 7831\n<9db8> <9dca> 5055\n<9dcb> <9dcb> 7832\n<9dcc> <9dfc> 5075\n<9e40> <9e63> 5124\n<9e64> <9e64> 7833\n<9e65> <9e68> 5161\n<9e69> <9e69> 7834\n<9e6a> <9e76> 5166\n<9e77> <9e77> 3490\n<9e78> <9e7e> 5180\n<9e80> <9e8a> 5187\n<9e8b> <9e8b> 7835\n<9e8c> <9e8c> 5199\n<9e8d> <9e8d> 3176\n<9e8e> <9e93> 5201\n<9e94> <9e94> 7836\n<9e95> <9efc> 5208\n<9f40> <9f7e> 5312\n<9f80> <9fb6> 5375\n<9fb7> <9fb7> 3181\n<9fb8> <9fcd> 5431\n<9fce> <9fce> 7837\n<9fcf> <9ff2> 5454\n<9ff3> <9ff3> 1535\n<9ff4> <9ffc> 5491\n<a0> <df> 326\n<e040> <e07e> 5500\n<e080> <e0a3> 5563\n<e0a4> <e0a4> 7839\n<e0a5> <e0dc> 5600\n<e0dd> <e0dd> 7840\n<e0de> <e0f3> 5657\n<e0f4> <e0f4> 7477\n<e0f5> <e0fc> 5680\n<e140> <e149> 5688\n<e14a> <e14a> 7841\nendcidrange\n\n100 begincidrange\n<e14b> <e14e> 5699\n<e14f> <e150> 7842\n<e151> <e17e> 5705\n<e180> <e1a8> 5751\n<e1a9> <e1a9> 7844\n<e1aa> <e1e5> 5793\n<e1e6> <e1e6> 2030\n<e1e7> <e1e7> 5854\n<e1e8> <e1e8> 3153\n<e1e9> <e1ec> 5856\n<e1ed> <e1ed> 7845\n<e1ee> <e1fc> 5861\n<e240> <e268> 5876\n<e269> <e269> 7846\n<e26a> <e272> 5918\n<e273> <e273> 7847\n<e274> <e27c> 5928\n<e27d> <e27d> 1492\n<e27e> <e27e> 5938\n<e280> <e2b6> 5939\n<e2b7> <e2b7> 7848\n<e2b8> <e2c3> 5995\n<e2c4> <e2c4> 4060\n<e2c5> <e2e1> 6008\n<e2e2> <e2e2> 7849\n<e2e3> <e2eb> 6038\n<e2ec> <e2ec> 7850\n<e2ed> <e2fc> 6048\n<e340> <e357> 6064\n<e358> <e358> 7851\n<e359> <e359> 6089\n<e35a> <e35a> 7852\n<e35b> <e364> 6091\n<e365> <e365> 7853\n<e366> <e37e> 6102\n<e380> <e3c3> 6127\n<e3c4> <e3c4> 7854\n<e3c5> <e3fc> 6196\n<e440> <e47e> 6252\n<e480> <e483> 6315\n<e484> <e484> 7855\n<e485> <e488> 6320\n<e489> <e489> 7856\n<e48a> <e491> 6325\n<e492> <e492> 7857\n<e493> <e4b1> 6334\n<e4b2> <e4b2> 7858\n<e4b3> <e4b8> 6366\n<e4b9> <e4b9> 7859\n<e4ba> <e4f1> 6373\n<e4f2> <e4f2> 7860\n<e4f3> <e4fc> 6430\n<e540> <e540> 6440\n<e541> <e541> 2293\n<e542> <e54c> 6442\n<e54d> <e54d> 3845\n<e54e> <e578> 6454\n<e579> <e579> 1440\n<e57a> <e57e> 6498\n<e580> <e5a1> 6503\n<e5a2> <e5a2> 3358\n<e5a3> <e5a4> 6538\n<e5a5> <e5a5> 7862\n<e5a6> <e5ba> 6541\n<e5bb> <e5bb> 7863\n<e5bc> <e5ec> 6563\n<e5ed> <e5ed> 7864\n<e5ee> <e5fc> 6613\n<e640> <e650> 6628\n<e651> <e651> 7865\n<e652> <e67b> 6646\n<e67c> <e67c> 1550\n<e67d> <e67e> 6689\n<e680> <e685> 6691\n<e686> <e686> 7866\n<e687> <e695> 6698\n<e696> <e696> 7867\n<e697> <e6ca> 6714\n<e6cb> <e6cb> 2730\n<e6cc> <e6e6> 6767\n<e6e7> <e6e7> 7868\n<e6e8> <e6f1> 6795\n<e6f2> <e6f2> 7869\n<e6f3> <e6fc> 6806\n<e740> <e76c> 6816\n<e76d> <e76d> 7870\n<e76e> <e77e> 6862\n<e780> <e78b> 6879\n<e78c> <e78c> 7871\n<e78d> <e78d> 6892\n<e78e> <e78e> 7872\n<e78f> <e7a6> 6894\n<e7a7> <e7a7> 7873\n<e7a8> <e7ba> 6919\n<e7bb> <e7bb> 7874\n<e7bc> <e7d4> 6939\n<e7d5> <e7d5> 7875\n<e7d6> <e7fc> 6965\n<e840> <e87e> 7004\n<e880> <e8c2> 7067\nendcidrange\n\n26 begincidrange\n<e8c3> <e8c3> 7878\n<e8c4> <e8ce> 7135\n<e8cf> <e8cf> 7879\n<e8d0> <e8d4> 7147\n<e8d5> <e8d5> 7880\n<e8d6> <e8f1> 7153\n<e8f2> <e8f2> 1841\n<e8f3> <e8f3> 7881\n<e8f4> <e8fc> 7183\n<e940> <e97e> 7192\n<e980> <e9aa> 7255\n<e9ab> <e9ab> 7882\n<e9ac> <e9b9> 7299\n<e9ba> <e9ba> 7883\n<e9bb> <e9ca> 7314\n<e9cb> <e9cb> 1143\n<e9cc> <e9cc> 7884\n<e9cd> <e9f1> 7332\n<e9f2> <e9f2> 1321\n<e9f3> <e9fc> 7370\n<ea40> <ea6f> 7380\n<ea70> <ea70> 7885\n<ea71> <ea7e> 7429\n<ea80> <ea9c> 7443\n<ea9d> <ea9d> 7886\n<ea9e> <ea9e> 7473\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/78-RKSJ-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (78-RKSJ-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (78-RKSJ-H)\n%%BeginResource: CMap (78-RKSJ-V)\n%%Title: (78-RKSJ-V Adobe Japan1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/78-RKSJ-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 0 def\nend def\n\n/CMapName /78-RKSJ-V def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/XUID [1 10 25354] def\n\n/WMode 1 def\n\n27 begincidrange\n<8141> <8142> 7887\n<8150> <8151> 7889\n<815b> <815d> 7891\n<8160> <8164> 7894\n<8169> <817a> 7899\n<8181> <8181> 7917\n<829f> <829f> 7918\n<82a1> <82a1> 7919\n<82a3> <82a3> 7920\n<82a5> <82a5> 7921\n<82a7> <82a7> 7922\n<82c1> <82c1> 7923\n<82e1> <82e1> 7924\n<82e3> <82e3> 7925\n<82e5> <82e5> 7926\n<82ec> <82ec> 7927\n<8340> <8340> 7928\n<8342> <8342> 7929\n<8344> <8344> 7930\n<8346> <8346> 7931\n<8348> <8348> 7932\n<8362> <8362> 7933\n<8383> <8383> 7934\n<8385> <8385> 7935\n<8387> <8387> 7936\n<838e> <838e> 7937\n<8395> <8396> 7938\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/78-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (78-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (78-H)\n%%BeginResource: CMap (78-V)\n%%Title: (78-V Adobe Japan1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/78-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 0 def\nend def\n\n/CMapName /78-V def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/XUID [1 10 25353] def\n\n/WMode 1 def\n\n27 begincidrange\n<2122> <2123> 7887\n<2131> <2132> 7889\n<213c> <213e> 7891\n<2141> <2145> 7894\n<214a> <215b> 7899\n<2161> <2161> 7917\n<2421> <2421> 7918\n<2423> <2423> 7919\n<2425> <2425> 7920\n<2427> <2427> 7921\n<2429> <2429> 7922\n<2443> <2443> 7923\n<2463> <2463> 7924\n<2465> <2465> 7925\n<2467> <2467> 7926\n<246e> <246e> 7927\n<2521> <2521> 7928\n<2523> <2523> 7929\n<2525> <2525> 7930\n<2527> <2527> 7931\n<2529> <2529> 7932\n<2543> <2543> 7933\n<2563> <2563> 7934\n<2565> <2565> 7935\n<2567> <2567> 7936\n<256e> <256e> 7937\n<2575> <2576> 7938\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/78ms-RKSJ-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (78ms-RKSJ-H)\n%%Title: (78ms-RKSJ-H Adobe Japan1 2)\n%%Version: 11.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 2 def\nend def\n\n/CMapName /78ms-RKSJ-H def\n/CMapVersion 11.003 def\n/CMapType 1 def\n\n/XUID [1 10 25441] def\n\n/WMode 0 def\n\n4 begincodespacerange\n  <00>   <80>\n  <8140> <9FFC>\n  <A0>   <DF>\n  <E040> <FCFC>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 231\nendnotdefrange\n\n100 begincidrange\n<20> <7d> 231\n<7e> <7e> 631\n<8140> <817e> 633\n<8180> <81ac> 696\n<81b8> <81bf> 741\n<81c8> <81ce> 749\n<81da> <81e8> 756\n<81f0> <81f7> 771\n<81fc> <81fc> 779\n<824f> <8258> 780\n<8260> <8279> 790\n<8281> <829a> 816\n<829f> <82f1> 842\n<8340> <837e> 925\n<8380> <8396> 988\n<839f> <83b6> 1011\n<83bf> <83d6> 1035\n<8440> <8460> 1059\n<8470> <847e> 1092\n<8480> <8491> 1107\n<849f> <849f> 7479\n<84a0> <84a0> 7481\n<84a1> <84a1> 7491\n<84a2> <84a2> 7495\n<84a3> <84a3> 7503\n<84a4> <84a4> 7499\n<84a5> <84a5> 7507\n<84a6> <84a6> 7523\n<84a7> <84a7> 7515\n<84a8> <84a8> 7531\n<84a9> <84a9> 7539\n<84aa> <84aa> 7480\n<84ab> <84ab> 7482\n<84ac> <84ac> 7494\n<84ad> <84ad> 7498\n<84ae> <84ae> 7506\n<84af> <84af> 7502\n<84b0> <84b0> 7514\n<84b1> <84b1> 7530\n<84b2> <84b2> 7522\n<84b3> <84b3> 7538\n<84b4> <84b4> 7554\n<84b5> <84b5> 7511\n<84b6> <84b6> 7526\n<84b7> <84b7> 7519\n<84b8> <84b8> 7534\n<84b9> <84b9> 7542\n<84ba> <84ba> 7508\n<84bb> <84bb> 7527\n<84bc> <84bc> 7516\n<84bd> <84bd> 7535\n<84be> <84be> 7545\n<8740> <875d> 7555\n<875f> <8760> 7585\n<8761> <8761> 8038\n<8762> <8762> 7588\n<8763> <8763> 8040\n<8764> <8764> 7590\n<8765> <8765> 8042\n<8766> <8767> 7592\n<8768> <8768> 8044\n<8769> <876a> 7595\n<876b> <876b> 8043\n<876c> <876d> 7598\n<876e> <876e> 8047\n<876f> <8775> 7601\n<877e> <877e> 8323\n<8780> <8783> 7608\n<8784> <8784> 8055\n<8785> <878f> 7613\n<8790> <8790> 762\n<8791> <8791> 761\n<8792> <8792> 769\n<8793> <8799> 7624\n<879a> <879a> 768\n<879b> <879c> 7631\n<889f> <889f> 1125\n<88a0> <88a0> 7633\n<88a1> <88a6> 1127\n<88a7> <88a7> 8266\n<88a8> <88af> 1134\n<88b0> <88b0> 7961\n<88b1> <88b1> 7330\n<88b2> <88b8> 1144\n<88b9> <88b9> 7634\n<88ba> <88eb> 1152\n<88ec> <88ec> 7635\n<88ed> <88f0> 1203\n<88f1> <88f1> 7636\n<88f2> <88f9> 1208\n<88fa> <88fa> 7637\n<88fb> <88fc> 1217\n<8940> <8948> 1219\n<8949> <8949> 7638\n<894a> <8953> 1229\n<8954> <8954> 7639\n<8955> <8957> 1240\n<8958> <8958> 7640\n<8959> <895b> 1244\n<895c> <895c> 7642\nendcidrange\n\n100 begincidrange\n<895d> <8960> 1248\n<8961> <8961> 7643\n<8962> <897e> 1253\n<8980> <898a> 1282\n<898b> <898b> 7644\n<898c> <89a5> 1294\n<89a6> <89a6> 7645\n<89a7> <89a7> 7369\n<89a8> <89a8> 7646\n<89a9> <89dd> 1323\n<89de> <89de> 7647\n<89df> <89f7> 1377\n<89f8> <89f8> 7648\n<89f9> <89fa> 1403\n<89fb> <89fb> 7649\n<89fc> <89fc> 1406\n<8a40> <8a40> 1407\n<8a41> <8a41> 7650\n<8a42> <8a60> 1409\n<8a61> <8a61> 6497\n<8a62> <8a67> 1441\n<8a68> <8a68> 5023\n<8a69> <8a7e> 1448\n<8a80> <8a84> 1470\n<8a85> <8a85> 7651\n<8a86> <8a8a> 1476\n<8a8b> <8a8b> 7652\n<8a8c> <8a92> 1482\n<8a93> <8a93> 7653\n<8a94> <8a95> 1490\n<8a96> <8a96> 5937\n<8a97> <8a99> 1493\n<8a9a> <8a9a> 7654\n<8a9b> <8abf> 1497\n<8ac0> <8ac0> 7655\n<8ac1> <8ac1> 5490\n<8ac2> <8aca> 1536\n<8acb> <8acb> 7656\n<8acc> <8acf> 1546\n<8ad0> <8ad0> 6688\n<8ad1> <8ae2> 1551\n<8ae3> <8ae3> 7657\n<8ae4> <8afc> 1570\n<8b40> <8b49> 1595\n<8b4a> <8b4a> 7658\n<8b4b> <8b5e> 1606\n<8b5f> <8b5f> 7659\n<8b60> <8b7e> 1627\n<8b80> <8b9f> 1658\n<8ba0> <8ba0> 7660\n<8ba1> <8ba7> 1691\n<8ba8> <8ba8> 7661\n<8ba9> <8bc3> 1699\n<8bc4> <8bc4> 7474\n<8bc5> <8bcc> 1727\n<8bcd> <8bcd> 7662\n<8bce> <8bea> 1736\n<8beb> <8beb> 7663\n<8bec> <8bf1> 1766\n<8bf2> <8bf2> 7664\n<8bf3> <8bf8> 1773\n<8bf9> <8bf9> 7665\n<8bfa> <8bfa> 1780\n<8bfb> <8bfb> 7666\n<8bfc> <8bfc> 1782\n<8c40> <8c42> 1783\n<8c43> <8c43> 7667\n<8c44> <8c55> 1787\n<8c56> <8c56> 7668\n<8c57> <8c63> 1806\n<8c64> <8c64> 7669\n<8c65> <8c6c> 1820\n<8c6d> <8c6d> 7670\n<8c6e> <8c70> 1829\n<8c71> <8c71> 7671\n<8c72> <8c73> 1833\n<8c74> <8c74> 7672\n<8c75> <8c79> 1836\n<8c7a> <8c7a> 7181\n<8c7b> <8c7e> 1842\n<8c80> <8c83> 1846\n<8c84> <8c84> 7673\n<8c85> <8c90> 1851\n<8c91> <8c91> 7674\n<8c92> <8c98> 1864\n<8c99> <8c99> 7675\n<8c9a> <8c9d> 1872\n<8c9e> <8c9e> 7676\n<8c9f> <8cb1> 1877\n<8cb2> <8cb2> 7677\n<8cb3> <8cbe> 1897\n<8cbf> <8cbf> 7678\n<8cc0> <8cfc> 1910\n<8d40> <8d49> 1971\n<8d4a> <8d4a> 7679\n<8d4b> <8d55> 1982\n<8d56> <8d56> 7680\n<8d57> <8d60> 1994\n<8d61> <8d61> 7681\n<8d62> <8d7a> 2005\nendcidrange\n\n100 begincidrange\n<8d7b> <8d7b> 5853\n<8d7c> <8d7e> 2031\n<8d80> <8d8c> 2034\n<8d8d> <8d8d> 7682\n<8d8e> <8d93> 2048\n<8d94> <8d94> 7683\n<8d95> <8d98> 2055\n<8d99> <8d99> 7684\n<8d9a> <8dd0> 2060\n<8dd1> <8dd1> 7685\n<8dd2> <8de4> 2116\n<8de5> <8de5> 7686\n<8de6> <8df1> 2136\n<8df2> <8df2> 7687\n<8df3> <8dfc> 2149\n<8e40> <8e45> 2159\n<8e46> <8e46> 7688\n<8e47> <8e48> 2166\n<8e49> <8e49> 7689\n<8e4a> <8e4a> 2169\n<8e4b> <8e4b> 7690\n<8e4c> <8e57> 2171\n<8e58> <8e58> 7691\n<8e59> <8e7e> 2184\n<8e80> <8ec5> 2222\n<8ec6> <8ec6> 7693\n<8ec7> <8ec7> 6441\n<8ec8> <8ed4> 2294\n<8ed5> <8ed5> 7694\n<8ed6> <8eda> 2308\n<8edb> <8edc> 7695\n<8edd> <8efc> 2315\n<8f40> <8f49> 2347\n<8f4a> <8f4a> 7697\n<8f4b> <8f54> 2358\n<8f55> <8f55> 7698\n<8f56> <8f7e> 2369\n<8f80> <8f8b> 2410\n<8f8c> <8f8d> 7699\n<8f8e> <8f91> 2424\n<8f92> <8f93> 7701\n<8f94> <8fa2> 2430\n<8fa3> <8fa3> 7703\n<8fa4> <8fb0> 2446\n<8fb1> <8fb1> 7704\n<8fb2> <8fbc> 2460\n<8fbd> <8fbd> 7705\n<8fbe> <8fd2> 2472\n<8fd3> <8fd3> 7706\n<8fd4> <8fdc> 2494\n<8fdd> <8fdd> 7707\n<8fde> <8fe1> 2504\n<8fe2> <8fe2> 7708\n<8fe3> <8ffc> 2509\n<9040> <9048> 2535\n<9049> <9049> 7709\n<904a> <9077> 2545\n<9078> <9078> 7710\n<9079> <907e> 2592\n<9080> <9080> 7711\n<9081> <9088> 2599\n<9089> <9089> 7712\n<908a> <909f> 2608\n<90a0> <90a0> 7713\n<90a1> <90bf> 2631\n<90c0> <90c0> 7714\n<90c1> <90e3> 2663\n<90e4> <90e4> 7715\n<90e5> <90ee> 2699\n<90ef> <90f0> 7716\n<90f1> <90f6> 2711\n<90f7> <90f8> 7718\n<90f9> <90fc> 2719\n<9140> <9145> 2723\n<9146> <9146> 7720\n<9147> <9147> 6766\n<9148> <9157> 2731\n<9158> <9158> 7721\n<9159> <916a> 2748\n<916b> <916b> 7722\n<916c> <916d> 2767\n<916e> <916e> 7723\n<916f> <917d> 2770\n<917e> <917e> 7724\n<9180> <9188> 2786\n<9189> <9189> 7725\n<918a> <91ba> 2796\n<91bb> <91bb> 7726\n<91bc> <91ca> 2846\n<91cb> <91cb> 7727\n<91cc> <91d9> 2862\n<91da> <91da> 7728\n<91db> <91e0> 2877\n<91e1> <91e1> 7729\n<91e2> <91ec> 2884\n<91ed> <91ed> 7730\n<91ee> <91f2> 2896\n<91f3> <91f4> 7731\n<91f5> <91fa> 2903\n<91fb> <91fb> 7733\nendcidrange\n\n100 begincidrange\n<91fc> <91fc> 2910\n<9240> <9245> 2911\n<9246> <9246> 7734\n<9247> <9247> 2918\n<9248> <9249> 7735\n<924a> <924b> 2921\n<924c> <924d> 7737\n<924e> <925b> 2925\n<925c> <925c> 7739\n<925d> <927e> 2940\n<9280> <928f> 2974\n<9290> <9290> 7740\n<9291> <9294> 2991\n<9295> <9295> 7741\n<9296> <929b> 2996\n<929c> <929c> 7742\n<929d> <92ba> 3003\n<92bb> <92bb> 7743\n<92bc> <92c5> 3034\n<92c6> <92c6> 7744\n<92c7> <92c7> 3045\n<92c8> <92c8> 7745\n<92c9> <92ca> 3047\n<92cb> <92cb> 7746\n<92cc> <92cc> 3050\n<92cd> <92cd> 7747\n<92ce> <92d1> 3052\n<92d2> <92d2> 8267\n<92d3> <92d8> 3057\n<92d9> <92d9> 4533\n<92da> <92fc> 3064\n<9340> <9340> 3099\n<9341> <9341> 7748\n<9342> <9345> 3101\n<9346> <9346> 7749\n<9347> <934c> 3106\n<934d> <934d> 7750\n<934e> <9354> 3113\n<9355> <9355> 7751\n<9356> <935d> 3121\n<935e> <935e> 7752\n<935f> <9366> 3130\n<9367> <9367> 7753\n<9368> <9369> 3139\n<936a> <936a> 7754\n<936b> <936f> 3142\n<9370> <9371> 7755\n<9372> <9375> 3149\n<9376> <9376> 5855\n<9377> <937e> 3154\n<9380> <9383> 3162\n<9384> <9384> 7757\n<9385> <938d> 3167\n<938e> <938e> 5200\n<938f> <9392> 3177\n<9393> <9393> 5430\n<9394> <9397> 3182\n<9398> <9398> 7758\n<9399> <93bb> 3187\n<93bc> <93bc> 7759\n<93bd> <93bf> 3223\n<93c0> <93c0> 7760\n<93c1> <93d1> 3227\n<93d2> <93d3> 7761\n<93d4> <93d8> 3246\n<93d9> <93da> 7763\n<93db> <93de> 3253\n<93df> <93df> 7765\n<93e0> <93e3> 3258\n<93e4> <93e5> 7766\n<93e6> <93e7> 3264\n<93e8> <93e8> 7768\n<93e9> <93f3> 3267\n<93f4> <93f4> 6893\n<93f5> <93fc> 3279\n<9440> <9447> 3287\n<9448> <9448> 7769\n<9449> <9457> 3296\n<9458> <9458> 7770\n<9459> <9475> 3312\n<9476> <9476> 7771\n<9477> <947e> 3342\n<9480> <9486> 3350\n<9487> <9487> 7772\n<9488> <9488> 6537\n<9489> <9489> 7773\n<948a> <948c> 3360\n<948d> <948d> 7774\n<948e> <94a1> 3364\n<94a2> <94a2> 7775\n<94a3> <94ab> 3385\n<94ac> <94ac> 7776\n<94ad> <94ad> 3395\n<94ae> <94ae> 7777\n<94af> <94d1> 3397\n<94d2> <94d2> 7778\n<94d3> <94df> 3433\n<94e0> <94e0> 7779\n<94e1> <94f2> 3447\n<94f3> <94f3> 7780\nendcidrange\n\n100 begincidrange\n<94f4> <94fc> 3466\n<9540> <9540> 3475\n<9541> <9542> 7781\n<9543> <954d> 3478\n<954e> <954e> 7783\n<954f> <954f> 5179\n<9550> <9550> 3491\n<9551> <9551> 7784\n<9552> <9553> 3493\n<9554> <9554> 7785\n<9555> <955e> 3496\n<955f> <955f> 7786\n<9560> <956c> 3507\n<956d> <956d> 7787\n<956e> <956f> 3521\n<9570> <9570> 7788\n<9571> <957e> 3524\n<9580> <95c0> 3538\n<95c1> <95c1> 7789\n<95c2> <95ca> 3604\n<95cb> <95cb> 7790\n<95cc> <95d7> 3614\n<95d8> <95d8> 7791\n<95d9> <95f6> 3627\n<95f7> <95f7> 7792\n<95f8> <95fc> 3658\n<9640> <9640> 3663\n<9641> <9641> 7793\n<9642> <9647> 3665\n<9648> <9648> 7794\n<9649> <9669> 3672\n<966a> <966a> 7795\n<966b> <967e> 3706\n<9680> <9689> 3726\n<968a> <968a> 7475\n<968b> <968f> 3737\n<9690> <9690> 7796\n<9691> <9697> 3743\n<9698> <9698> 7980\n<9699> <9699> 4143\n<969a> <96ca> 3752\n<96cb> <96cb> 7797\n<96cc> <96d6> 3802\n<96d7> <96d7> 7798\n<96d8> <96dc> 3814\n<96dd> <96dd> 7799\n<96de> <96df> 3820\n<96e0> <96e0> 7800\n<96e1> <96f6> 3823\n<96f7> <96f7> 6453\n<96f8> <96f8> 7801\n<96f9> <96f9> 3847\n<96fa> <96fa> 7802\n<96fb> <96fb> 3849\n<96fc> <96fc> 7803\n<9740> <9750> 3851\n<9751> <9751> 7804\n<9752> <976e> 3869\n<976f> <976f> 7805\n<9770> <9772> 3899\n<9773> <9773> 7806\n<9774> <9778> 3903\n<9779> <9779> 7476\n<977a> <977e> 3909\n<9780> <9788> 3914\n<9789> <9789> 7807\n<978a> <97c8> 3924\n<97c9> <97c9> 7808\n<97ca> <97f7> 3988\n<97f8> <97f9> 7809\n<97fa> <97fc> 4036\n<9840> <9840> 7811\n<9841> <984f> 4040\n<9850> <9850> 7812\n<9851> <9854> 4056\n<9855> <9855> 6007\n<9856> <9857> 4061\n<9858> <9858> 7813\n<9859> <9872> 4064\n<989f> <98d3> 4090\n<98d4> <98d4> 3751\n<98d5> <98fc> 4144\n<9940> <995b> 4184\n<995c> <995c> 7814\n<995d> <9965> 4213\n<9966> <9966> 7815\n<9967> <9969> 4223\n<996a> <996a> 7816\n<996b> <996b> 4227\n<996c> <996c> 7817\n<996d> <997e> 4229\n<9980> <99fc> 4247\n<9a40> <9a4e> 4372\n<9a4f> <9a4f> 7818\n<9a50> <9a58> 4388\n<9a59> <9a59> 7819\n<9a5a> <9a7c> 4398\n<9a7d> <9a7d> 7821\n<9a7e> <9a7e> 4434\n<9a80> <9a8a> 4435\nendcidrange\n\n100 begincidrange\n<9a8b> <9a8b> 7822\n<9a8c> <9ac1> 4447\n<9ac2> <9ac2> 7823\n<9ac3> <9ae1> 4502\n<9ae2> <9ae2> 3063\n<9ae3> <9afc> 4534\n<9b40> <9b5b> 4560\n<9b5c> <9b5c> 7824\n<9b5d> <9b7e> 4589\n<9b80> <9b82> 4623\n<9b83> <9b83> 7825\n<9b84> <9b9f> 4627\n<9ba0> <9ba0> 7826\n<9ba1> <9bfc> 4656\n<9c40> <9c7e> 4748\n<9c80> <9ca1> 4811\n<9ca2> <9ca2> 7828\n<9ca3> <9cfc> 4846\n<9d40> <9d7e> 4936\n<9d80> <9d80> 7829\n<9d81> <9d8b> 5000\n<9d8c> <9d8c> 7830\n<9d8d> <9d97> 5012\n<9d98> <9d98> 1447\n<9d99> <9db6> 5024\n<9db7> <9db7> 7831\n<9db8> <9dca> 5055\n<9dcb> <9dcb> 7832\n<9dcc> <9dfc> 5075\n<9e40> <9e63> 5124\n<9e64> <9e64> 7833\n<9e65> <9e68> 5161\n<9e69> <9e69> 7834\n<9e6a> <9e76> 5166\n<9e77> <9e77> 3490\n<9e78> <9e7e> 5180\n<9e80> <9e8a> 5187\n<9e8b> <9e8b> 7835\n<9e8c> <9e8c> 5199\n<9e8d> <9e8d> 3176\n<9e8e> <9e93> 5201\n<9e94> <9e94> 7836\n<9e95> <9efc> 5208\n<9f40> <9f7e> 5312\n<9f80> <9fb6> 5375\n<9fb7> <9fb7> 3181\n<9fb8> <9fcd> 5431\n<9fce> <9fce> 7837\n<9fcf> <9ff2> 5454\n<9ff3> <9ff3> 1535\n<9ff4> <9ffc> 5491\n<a0> <df> 326\n<e040> <e07e> 5500\n<e080> <e0a3> 5563\n<e0a4> <e0a4> 7839\n<e0a5> <e0dc> 5600\n<e0dd> <e0dd> 7840\n<e0de> <e0f3> 5657\n<e0f4> <e0f4> 7477\n<e0f5> <e0fc> 5680\n<e140> <e149> 5688\n<e14a> <e14a> 7841\n<e14b> <e14e> 5699\n<e14f> <e150> 7842\n<e151> <e17e> 5705\n<e180> <e1a8> 5751\n<e1a9> <e1a9> 7844\n<e1aa> <e1e5> 5793\n<e1e6> <e1e6> 2030\n<e1e7> <e1e7> 5854\n<e1e8> <e1e8> 3153\n<e1e9> <e1ec> 5856\n<e1ed> <e1ed> 7845\n<e1ee> <e1fc> 5861\n<e240> <e268> 5876\n<e269> <e269> 7846\n<e26a> <e272> 5918\n<e273> <e273> 7847\n<e274> <e27c> 5928\n<e27d> <e27d> 1492\n<e27e> <e27e> 5938\n<e280> <e2b6> 5939\n<e2b7> <e2b7> 7848\n<e2b8> <e2c3> 5995\n<e2c4> <e2c4> 4060\n<e2c5> <e2e1> 6008\n<e2e2> <e2e2> 7849\n<e2e3> <e2eb> 6038\n<e2ec> <e2ec> 7850\n<e2ed> <e2fc> 6048\n<e340> <e357> 6064\n<e358> <e358> 7851\n<e359> <e359> 6089\n<e35a> <e35a> 7852\n<e35b> <e364> 6091\n<e365> <e365> 7853\n<e366> <e37e> 6102\n<e380> <e3c3> 6127\n<e3c4> <e3c4> 7854\n<e3c5> <e3fc> 6196\nendcidrange\n\n100 begincidrange\n<e440> <e47e> 6252\n<e480> <e483> 6315\n<e484> <e484> 7855\n<e485> <e488> 6320\n<e489> <e489> 7856\n<e48a> <e491> 6325\n<e492> <e492> 7857\n<e493> <e4b1> 6334\n<e4b2> <e4b2> 7858\n<e4b3> <e4b8> 6366\n<e4b9> <e4b9> 7859\n<e4ba> <e4f1> 6373\n<e4f2> <e4f2> 7860\n<e4f3> <e4fc> 6430\n<e540> <e540> 6440\n<e541> <e541> 2293\n<e542> <e54c> 6442\n<e54d> <e54d> 3845\n<e54e> <e578> 6454\n<e579> <e579> 1440\n<e57a> <e57e> 6498\n<e580> <e5a1> 6503\n<e5a2> <e5a2> 3358\n<e5a3> <e5a4> 6538\n<e5a5> <e5a5> 7862\n<e5a6> <e5ba> 6541\n<e5bb> <e5bb> 7863\n<e5bc> <e5ec> 6563\n<e5ed> <e5ed> 7864\n<e5ee> <e5fc> 6613\n<e640> <e650> 6628\n<e651> <e651> 7865\n<e652> <e67b> 6646\n<e67c> <e67c> 1550\n<e67d> <e67e> 6689\n<e680> <e685> 6691\n<e686> <e686> 7866\n<e687> <e695> 6698\n<e696> <e696> 7867\n<e697> <e6ca> 6714\n<e6cb> <e6cb> 2730\n<e6cc> <e6e6> 6767\n<e6e7> <e6e7> 7868\n<e6e8> <e6f1> 6795\n<e6f2> <e6f2> 7869\n<e6f3> <e6fc> 6806\n<e740> <e76c> 6816\n<e76d> <e76d> 7870\n<e76e> <e77e> 6862\n<e780> <e78b> 6879\n<e78c> <e78c> 7871\n<e78d> <e78d> 6892\n<e78e> <e78e> 7872\n<e78f> <e7a6> 6894\n<e7a7> <e7a7> 7873\n<e7a8> <e7ba> 6919\n<e7bb> <e7bb> 7874\n<e7bc> <e7d4> 6939\n<e7d5> <e7d5> 7875\n<e7d6> <e7fc> 6965\n<e840> <e87e> 7004\n<e880> <e8c2> 7067\n<e8c3> <e8c3> 7878\n<e8c4> <e8ce> 7135\n<e8cf> <e8cf> 7879\n<e8d0> <e8d4> 7147\n<e8d5> <e8d5> 7880\n<e8d6> <e8f1> 7153\n<e8f2> <e8f2> 1841\n<e8f3> <e8f3> 7881\n<e8f4> <e8fc> 7183\n<e940> <e97e> 7192\n<e980> <e9aa> 7255\n<e9ab> <e9ab> 7882\n<e9ac> <e9b9> 7299\n<e9ba> <e9ba> 7883\n<e9bb> <e9ca> 7314\n<e9cb> <e9cb> 1143\n<e9cc> <e9cc> 7884\n<e9cd> <e9f1> 7332\n<e9f2> <e9f2> 1321\n<e9f3> <e9fc> 7370\n<ea40> <ea6f> 7380\n<ea70> <ea70> 7885\n<ea71> <ea7e> 7429\n<ea80> <ea9c> 7443\n<ea9d> <ea9d> 7886\n<ea9e> <eaa2> 7473\n<eaa3> <eaa4> 8284\n<ed40> <ed7e> 8359\n<ed80> <edb3> 8422\n<edb4> <edb4> 1993\n<edb5> <edfc> 8474\n<ee40> <ee7e> 8546\n<ee80> <eeec> 8609\n<eeef> <eef8> 8092\n<eef9> <eef9> 751\n<eefa> <eefc> 8005\n<fa40> <fa49> 8092\n<fa4a> <fa53> 7575\nendcidrange\n\n13 begincidrange\n<fa54> <fa54> 751\n<fa55> <fa57> 8005\n<fa58> <fa58> 7618\n<fa59> <fa59> 7610\n<fa5a> <fa5a> 8055\n<fa5b> <fa5b> 768\n<fa5c> <fa7e> 8359\n<fa80> <facf> 8394\n<fad0> <fad0> 1993\n<fad1> <fafc> 8474\n<fb40> <fb7e> 8518\n<fb80> <fbfc> 8581\n<fc40> <fc4b> 8706\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/78ms-RKSJ-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (78ms-RKSJ-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (78ms-RKSJ-H)\n%%BeginResource: CMap (78ms-RKSJ-V)\n%%Title: (78ms-RKSJ-V Adobe Japan1 2)\n%%Version: 11.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/78ms-RKSJ-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 2 def\nend def\n\n/CMapName /78ms-RKSJ-V def\n/CMapVersion 11.003 def\n/CMapType 1 def\n\n/XUID [1 10 25442] def\n\n/WMode 1 def\n\n78 begincidrange\n<8141> <8142> 7887\n<8143> <8143> 8268\n<8144> <8144> 8274\n<8150> <8151> 7889\n<815b> <815d> 7891\n<8160> <8164> 7894\n<8169> <817a> 7899\n<8181> <8181> 7917\n<81a8> <81a8>  739\n<81a9> <81a9>  738\n<81aa> <81ab>  736\n<81ac> <81ac> 8270\n<829f> <829f> 7918\n<82a1> <82a1> 7919\n<82a3> <82a3> 7920\n<82a5> <82a5> 7921\n<82a7> <82a7> 7922\n<82c1> <82c1> 7923\n<82e1> <82e1> 7924\n<82e3> <82e3> 7925\n<82e5> <82e5> 7926\n<82ec> <82ec> 7927\n<8340> <8340> 7928\n<8342> <8342> 7929\n<8344> <8344> 7930\n<8346> <8346> 7931\n<8348> <8348> 7932\n<8362> <8362> 7933\n<8383> <8383> 7934\n<8385> <8385> 7935\n<8387> <8387> 7936\n<838e> <838e> 7937\n<8395> <8396> 7938\n<849f> <849f> 7481\n<84a0> <84a0> 7479\n<84a1> <84a1> 7495\n<84a2> <84a2> 7503\n<84a3> <84a3> 7499\n<84a4> <84a4> 7491\n<84a5> <84a5> 7523\n<84a6> <84a6> 7515\n<84a7> <84a7> 7531\n<84a8> <84a8> 7507\n<84a9> <84a9> 7539\n<84aa> <84aa> 7482\n<84ab> <84ab> 7480\n<84ac> <84ac> 7498\n<84ad> <84ad> 7506\n<84ae> <84ae> 7502\n<84af> <84af> 7494\n<84b0> <84b0> 7530\n<84b1> <84b1> 7522\n<84b2> <84b2> 7538\n<84b3> <84b3> 7514\n<84b4> <84b4> 7554\n<84b5> <84b5> 7526\n<84b6> <84b6> 7519\n<84b7> <84b7> 7534\n<84b8> <84b8> 7511\n<84b9> <84b9> 7545\n<84ba> <84ba> 7527\n<84bb> <84bb> 7516\n<84bc> <84bc> 7535\n<84bd> <84bd> 7508\n<84be> <84be> 7542\n<875f> <8760> 7940\n<8761> <8761> 8329\n<8762> <8762> 7943\n<8763> <8763> 8339\n<8764> <8764> 7945\n<8765> <8765> 8338\n<8766> <8767> 7947\n<8768> <8768> 8344\n<8769> <876a> 7950\n<876b> <876b> 8348\n<876c> <876d> 7953\n<876e> <876e> 8349\n<8780> <8781> 7956\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/83pv-RKSJ-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (83pv-RKSJ-H)\n%%Title: (83pv-RKSJ-H Adobe Japan1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 1 def\nend def\n\n/CMapName /83pv-RKSJ-H def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 0 def\n/XUID [1 10 25324] def\n\n/WMode 0 def\n\n5 begincodespacerange\n  <00>   <80>\n  <8140> <9FFC>\n  <A0>   <DF>\n  <E040> <FCFC>\n  <FD>   <FF>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 1\nendnotdefrange\n\n100 begincidrange\n<20> <7e>        1\n<80> <80>       97\n<8140> <817e>  633\n<8180> <81ac>  696\n<81b8> <81bf>  741\n<81c8> <81ce>  749\n<81da> <81e8>  756\n<81f0> <81f7>  771\n<81fc> <81fc>  779\n<824f> <8258>  780\n<8260> <8279>  790\n<8281> <829a>  816\n<829f> <82f1>  842\n<8340> <837e>  925\n<8380> <8396>  988\n<839f> <83b6> 1011\n<83bf> <83d6> 1035\n<8440> <8460> 1059\n<8470> <847e> 1092\n<8480> <8491> 1107\n<849f> <849f> 7479\n<84a0> <84a0> 7481\n<84a1> <84a1> 7491\n<84a2> <84a2> 7495\n<84a3> <84a3> 7503\n<84a4> <84a4> 7499\n<84a5> <84a5> 7507\n<84a6> <84a6> 7523\n<84a7> <84a7> 7515\n<84a8> <84a8> 7531\n<84a9> <84a9> 7539\n<84aa> <84aa> 7480\n<84ab> <84ab> 7482\n<84ac> <84ac> 7494\n<84ad> <84ad> 7498\n<84ae> <84ae> 7506\n<84af> <84af> 7502\n<84b0> <84b0> 7514\n<84b1> <84b1> 7530\n<84b2> <84b2> 7522\n<84b3> <84b3> 7538\n<84b4> <84b4> 7554\n<84b5> <84b5> 7511\n<84b6> <84b6> 7526\n<84b7> <84b7> 7519\n<84b8> <84b8> 7534\n<84b9> <84b9> 7542\n<84ba> <84ba> 7508\n<84bb> <84bb> 7527\n<84bc> <84bc> 7516\n<84bd> <84bd> 7535\n<84be> <84be> 7545\n<8540> <857e>  232\n<8580> <8580>  390\n<8581> <859e>  296\n<859f> <85dd>  327\n<85de> <85fc>  391\n<8640> <867e>  422\n<8680> <8691>  485\n<8692> <8692>  295\n<8693> <869e>  503\n<86a2> <86ed> 7479\n<8740> <875d> 7555\n<875f> <8775> 7585\n<8780> <878f> 7608\n<8790> <8790>  762\n<8791> <8791>  761\n<8792> <8792>  769\n<8793> <8799> 7624\n<879a> <879a>  768\n<879b> <879c> 7631\n<889f> <88fc> 1125\n<8940> <897e> 1219\n<8980> <89fc> 1282\n<8a40> <8a7e> 1407\n<8a80> <8afc> 1470\n<8b40> <8b7e> 1595\n<8b80> <8bfc> 1658\n<8c40> <8c7e> 1783\n<8c80> <8cfc> 1846\n<8d40> <8d7e> 1971\n<8d80> <8dfc> 2034\n<8e40> <8e7e> 2159\n<8e80> <8efc> 2222\n<8f40> <8f7e> 2347\n<8f80> <8ffc> 2410\n<9040> <907e> 2535\n<9080> <90fc> 2598\n<9140> <917e> 2723\n<9180> <91fc> 2786\n<9240> <927e> 2911\n<9280> <92fc> 2974\n<9340> <937e> 3099\n<9380> <93fc> 3162\n<9440> <947e> 3287\n<9480> <94fc> 3350\n<9540> <957e> 3475\n<9580> <95fc> 3538\n<9640> <967e> 3663\n<9680> <96fc> 3726\nendcidrange\n\n100 begincidrange\n<9740> <977e> 3851\n<9780> <97fc> 3914\n<9840> <9872> 4039\n<989f> <98fc> 4090\n<9940> <997e> 4184\n<9980> <99fc> 4247\n<9a40> <9a7e> 4372\n<9a80> <9afc> 4435\n<9b40> <9b7e> 4560\n<9b80> <9bfc> 4623\n<9c40> <9c7e> 4748\n<9c80> <9cfc> 4811\n<9d40> <9d7e> 4936\n<9d80> <9dfc> 4999\n<9e40> <9e7e> 5124\n<9e80> <9efc> 5187\n<9f40> <9f7e> 5312\n<9f80> <9ffc> 5375\n<a0> <df>      326\n<e040> <e07e> 5500\n<e080> <e0fc> 5563\n<e140> <e17e> 5688\n<e180> <e1fc> 5751\n<e240> <e27e> 5876\n<e280> <e2fc> 5939\n<e340> <e37e> 6064\n<e380> <e3fc> 6127\n<e440> <e47e> 6252\n<e480> <e4fc> 6315\n<e540> <e57e> 6440\n<e580> <e5fc> 6503\n<e640> <e67e> 6628\n<e680> <e6fc> 6691\n<e740> <e77e> 6816\n<e780> <e7fc> 6879\n<e840> <e87e> 7004\n<e880> <e8fc> 7067\n<e940> <e97e> 7192\n<e980> <e9fc> 7255\n<ea40> <ea7e> 7380\n<ea80> <eaa2> 7443\n<eaa3> <eaa4> 8284\n<eb40> <eb40>  633\n<eb41> <eb42> 7887\n<eb43> <eb4f>  636\n<eb50> <eb51> 7889\n<eb52> <eb5a>  651\n<eb5b> <eb5d> 7891\n<eb5e> <eb5f>  663\n<eb60> <eb64> 7894\n<eb65> <eb68>  670\n<eb69> <eb7a> 7899\n<eb7b> <eb7e>  692\n<eb80> <eb80>  696\n<eb81> <eb81> 7917\n<eb82> <ebac>  698\n<ebb8> <ebbf>  741\n<ebc8> <ebce>  749\n<ebda> <ebe8>  756\n<ebf0> <ebf7>  771\n<ebfc> <ebfc>  779\n<ec4f> <ec58>  780\n<ec60> <ec79>  790\n<ec81> <ec9a>  816\n<ec9f> <ec9f> 7918\n<eca0> <eca0>  843\n<eca1> <eca1> 7919\n<eca2> <eca2>  845\n<eca3> <eca3> 7920\n<eca4> <eca4>  847\n<eca5> <eca5> 7921\n<eca6> <eca6>  849\n<eca7> <eca7> 7922\n<eca8> <ecc0>  851\n<ecc1> <ecc1> 7923\n<ecc2> <ece0>  877\n<ece1> <ece1> 7924\n<ece2> <ece2>  909\n<ece3> <ece3> 7925\n<ece4> <ece4>  911\n<ece5> <ece5> 7926\n<ece6> <eceb>  913\n<ecec> <ecec> 7927\n<eced> <ecf1>  920\n<ed40> <ed40> 7928\n<ed41> <ed41>  926\n<ed42> <ed42> 7929\n<ed43> <ed43>  928\n<ed44> <ed44> 7930\n<ed45> <ed45>  930\n<ed46> <ed46> 7931\n<ed47> <ed47>  932\n<ed48> <ed48> 7932\n<ed49> <ed61>  934\n<ed62> <ed62> 7933\n<ed63> <ed7e>  960\n<ed80> <ed82>  988\n<ed83> <ed83> 7934\n<ed84> <ed84>  992\n<ed85> <ed85> 7935\nendcidrange\n\n22 begincidrange\n<ed86> <ed86>  994\n<ed87> <ed87> 7936\n<ed88> <ed8d>  996\n<ed8e> <ed8e> 7937\n<ed8f> <ed94> 1003\n<ed95> <ed96> 7938\n<ed9f> <edb6> 1011\n<edbf> <edd6> 1035\n<ee40> <ee5d> 7555\n<ee5f> <ee6e> 7940\n<ee6f> <ee75> 7601\n<ee80> <ee81> 7956\n<ee82> <ee8f> 7610\n<ee90> <ee90>  762\n<ee91> <ee91>  761\n<ee92> <ee92>  769\n<ee93> <ee99> 7624\n<ee9a> <ee9a>  768\n<ee9b> <ee9c> 7631\n<fd> <fd>      152\n<fe> <fe>      228\n<ff> <ff>      124\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/90ms-RKSJ-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (90ms-RKSJ-H)\n%%Title: (90ms-RKSJ-H Adobe Japan1 2)\n%%Version: 11.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 2 def\nend def\n\n/CMapName /90ms-RKSJ-H def\n/CMapVersion 11.003 def\n/CMapType 1 def\n\n/UIDOffset 950 def\n/XUID [1 10 25343] def\n\n/WMode 0 def\n\n4 begincodespacerange\n  <00>   <80>\n  <8140> <9FFC>\n  <A0>   <DF>\n  <E040> <FCFC>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 231\nendnotdefrange\n\n100 begincidrange\n<20> <7d>      231\n<7e> <7e>      631\n<8140> <817e>  633\n<8180> <81ac>  696\n<81b8> <81bf>  741\n<81c8> <81ce>  749\n<81da> <81e8>  756\n<81f0> <81f7>  771\n<81fc> <81fc>  779\n<824f> <8258>  780\n<8260> <8279>  790\n<8281> <829a>  816\n<829f> <82f1>  842\n<8340> <837e>  925\n<8380> <8396>  988\n<839f> <83b6> 1011\n<83bf> <83d6> 1035\n<8440> <8460> 1059\n<8470> <847e> 1092\n<8480> <8491> 1107\n<849f> <849f> 7479\n<84a0> <84a0> 7481\n<84a1> <84a1> 7491\n<84a2> <84a2> 7495\n<84a3> <84a3> 7503\n<84a4> <84a4> 7499\n<84a5> <84a5> 7507\n<84a6> <84a6> 7523\n<84a7> <84a7> 7515\n<84a8> <84a8> 7531\n<84a9> <84a9> 7539\n<84aa> <84aa> 7480\n<84ab> <84ab> 7482\n<84ac> <84ac> 7494\n<84ad> <84ad> 7498\n<84ae> <84ae> 7506\n<84af> <84af> 7502\n<84b0> <84b0> 7514\n<84b1> <84b1> 7530\n<84b2> <84b2> 7522\n<84b3> <84b3> 7538\n<84b4> <84b4> 7554\n<84b5> <84b5> 7511\n<84b6> <84b6> 7526\n<84b7> <84b7> 7519\n<84b8> <84b8> 7534\n<84b9> <84b9> 7542\n<84ba> <84ba> 7508\n<84bb> <84bb> 7527\n<84bc> <84bc> 7516\n<84bd> <84bd> 7535\n<84be> <84be> 7545\n<8740> <875d> 7555\n<875f> <8760> 7585\n<8761> <8761> 8038\n<8762> <8762> 7588\n<8763> <8763> 8040\n<8764> <8764> 7590\n<8765> <8765> 8042\n<8766> <8767> 7592\n<8768> <8768> 8044\n<8769> <876a> 7595\n<876b> <876b> 8043\n<876c> <876d> 7598\n<876e> <876e> 8047\n<876f> <8775> 7601\n<877e> <877e> 8323\n<8780> <8783> 7608\n<8784> <8784> 8055\n<8785> <878f> 7613\n<8790> <8790>  762\n<8791> <8791>  761\n<8792> <8792>  769\n<8793> <8799> 7624\n<879a> <879a>  768\n<879b> <879c> 7631\n<889f> <88fc> 1125\n<8940> <897e> 1219\n<8980> <89fc> 1282\n<8a40> <8a7e> 1407\n<8a80> <8afc> 1470\n<8b40> <8b7e> 1595\n<8b80> <8bfc> 1658\n<8c40> <8c7e> 1783\n<8c80> <8cfc> 1846\n<8d40> <8d7e> 1971\n<8d80> <8dfc> 2034\n<8e40> <8e7e> 2159\n<8e80> <8efc> 2222\n<8f40> <8f7e> 2347\n<8f80> <8ffc> 2410\n<9040> <907e> 2535\n<9080> <90fc> 2598\n<9140> <917e> 2723\n<9180> <91fc> 2786\n<9240> <927e> 2911\n<9280> <92fc> 2974\n<9340> <937e> 3099\n<9380> <93fc> 3162\n<9440> <947e> 3287\nendcidrange\n\n71 begincidrange\n<9480> <94fc> 3350\n<9540> <957e> 3475\n<9580> <95fc> 3538\n<9640> <967e> 3663\n<9680> <96fc> 3726\n<9740> <977e> 3851\n<9780> <97fc> 3914\n<9840> <9872> 4039\n<989f> <98fc> 4090\n<9940> <997e> 4184\n<9980> <99fc> 4247\n<9a40> <9a7e> 4372\n<9a80> <9afc> 4435\n<9b40> <9b7e> 4560\n<9b80> <9bfc> 4623\n<9c40> <9c7e> 4748\n<9c80> <9cfc> 4811\n<9d40> <9d7e> 4936\n<9d80> <9dfc> 4999\n<9e40> <9e7e> 5124\n<9e80> <9efc> 5187\n<9f40> <9f7e> 5312\n<9f80> <9ffc> 5375\n<a0> <df>      326\n<e040> <e07e> 5500\n<e080> <e0fc> 5563\n<e140> <e17e> 5688\n<e180> <e1fc> 5751\n<e240> <e27e> 5876\n<e280> <e2fc> 5939\n<e340> <e37e> 6064\n<e380> <e3fc> 6127\n<e440> <e47e> 6252\n<e480> <e4fc> 6315\n<e540> <e57e> 6440\n<e580> <e5fc> 6503\n<e640> <e67e> 6628\n<e680> <e6fc> 6691\n<e740> <e77e> 6816\n<e780> <e7fc> 6879\n<e840> <e87e> 7004\n<e880> <e8fc> 7067\n<e940> <e97e> 7192\n<e980> <e9fc> 7255\n<ea40> <ea7e> 7380\n<ea80> <eaa2> 7443\n<eaa3> <eaa4> 8284\n<ed40> <ed7e> 8359\n<ed80> <edb3> 8422\n<edb4> <edb4> 1993\n<edb5> <edfc> 8474\n<ee40> <ee7e> 8546\n<ee80> <eeec> 8609\n<eeef> <eef8> 8092\n<eef9> <eef9>  751\n<eefa> <eefc> 8005\n<fa40> <fa49> 8092\n<fa4a> <fa53> 7575\n<fa54> <fa54>  751\n<fa55> <fa57> 8005\n<fa58> <fa58> 7618\n<fa59> <fa59> 7610\n<fa5a> <fa5a> 8055\n<fa5b> <fa5b>  768\n<fa5c> <fa7e> 8359\n<fa80> <facf> 8394\n<fad0> <fad0> 1993\n<fad1> <fafc> 8474\n<fb40> <fb7e> 8518\n<fb80> <fbfc> 8581\n<fc40> <fc4b> 8706\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/90ms-RKSJ-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (90ms-RKSJ-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (90ms-RKSJ-H)\n%%BeginResource: CMap (90ms-RKSJ-V)\n%%Title: (90ms-RKSJ-V Adobe Japan1 2)\n%%Version: 11.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/90ms-RKSJ-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 2 def\nend def\n\n/CMapName /90ms-RKSJ-V def\n/CMapVersion 11.003 def\n/CMapType 1 def\n\n/UIDOffset 1020 def\n/XUID [1 10 25344] def\n\n/WMode 1 def\n\n78 begincidrange\n<8141> <8142> 7887\n<8143> <8143> 8268\n<8144> <8144> 8274\n<8150> <8151> 7889\n<815b> <815d> 7891\n<8160> <8164> 7894\n<8169> <817a> 7899\n<8181> <8181> 7917\n<81a8> <81a8>  739\n<81a9> <81a9>  738\n<81aa> <81ab>  736\n<81ac> <81ac> 8270\n<829f> <829f> 7918\n<82a1> <82a1> 7919\n<82a3> <82a3> 7920\n<82a5> <82a5> 7921\n<82a7> <82a7> 7922\n<82c1> <82c1> 7923\n<82e1> <82e1> 7924\n<82e3> <82e3> 7925\n<82e5> <82e5> 7926\n<82ec> <82ec> 7927\n<8340> <8340> 7928\n<8342> <8342> 7929\n<8344> <8344> 7930\n<8346> <8346> 7931\n<8348> <8348> 7932\n<8362> <8362> 7933\n<8383> <8383> 7934\n<8385> <8385> 7935\n<8387> <8387> 7936\n<838e> <838e> 7937\n<8395> <8396> 7938\n<849f> <849f> 7481\n<84a0> <84a0> 7479\n<84a1> <84a1> 7495\n<84a2> <84a2> 7503\n<84a3> <84a3> 7499\n<84a4> <84a4> 7491\n<84a5> <84a5> 7523\n<84a6> <84a6> 7515\n<84a7> <84a7> 7531\n<84a8> <84a8> 7507\n<84a9> <84a9> 7539\n<84aa> <84aa> 7482\n<84ab> <84ab> 7480\n<84ac> <84ac> 7498\n<84ad> <84ad> 7506\n<84ae> <84ae> 7502\n<84af> <84af> 7494\n<84b0> <84b0> 7530\n<84b1> <84b1> 7522\n<84b2> <84b2> 7538\n<84b3> <84b3> 7514\n<84b4> <84b4> 7554\n<84b5> <84b5> 7526\n<84b6> <84b6> 7519\n<84b7> <84b7> 7534\n<84b8> <84b8> 7511\n<84b9> <84b9> 7545\n<84ba> <84ba> 7527\n<84bb> <84bb> 7516\n<84bc> <84bc> 7535\n<84bd> <84bd> 7508\n<84be> <84be> 7542\n<875f> <8760> 7940\n<8761> <8761> 8329\n<8762> <8762> 7943\n<8763> <8763> 8339\n<8764> <8764> 7945\n<8765> <8765> 8338\n<8766> <8767> 7947\n<8768> <8768> 8344\n<8769> <876a> 7950\n<876b> <876b> 8348\n<876c> <876d> 7953\n<876e> <876e> 8349\n<8780> <8781> 7956\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/90msp-RKSJ-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (90msp-RKSJ-H)\n%%Title: (90msp-RKSJ-H Adobe Japan1 2)\n%%Version: 11.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 2 def\nend def\n\n/CMapName /90msp-RKSJ-H def\n/CMapVersion 11.003 def\n/CMapType 1 def\n\n/XUID [1 10 25445] def\n\n/WMode 0 def\n\n4 begincodespacerange\n  <00>   <80>\n  <8140> <9FFC>\n  <A0>   <DF>\n  <E040> <FCFC>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 1\nendnotdefrange\n\n100 begincidrange\n<20> <7e> 1\n<8140> <817e> 633\n<8180> <81ac> 696\n<81b8> <81bf> 741\n<81c8> <81ce> 749\n<81da> <81e8> 756\n<81f0> <81f7> 771\n<81fc> <81fc> 779\n<824f> <8258> 780\n<8260> <8279> 790\n<8281> <829a> 816\n<829f> <82f1> 842\n<8340> <837e> 925\n<8380> <8396> 988\n<839f> <83b6> 1011\n<83bf> <83d6> 1035\n<8440> <8460> 1059\n<8470> <847e> 1092\n<8480> <8491> 1107\n<849f> <849f> 7479\n<84a0> <84a0> 7481\n<84a1> <84a1> 7491\n<84a2> <84a2> 7495\n<84a3> <84a3> 7503\n<84a4> <84a4> 7499\n<84a5> <84a5> 7507\n<84a6> <84a6> 7523\n<84a7> <84a7> 7515\n<84a8> <84a8> 7531\n<84a9> <84a9> 7539\n<84aa> <84aa> 7480\n<84ab> <84ab> 7482\n<84ac> <84ac> 7494\n<84ad> <84ad> 7498\n<84ae> <84ae> 7506\n<84af> <84af> 7502\n<84b0> <84b0> 7514\n<84b1> <84b1> 7530\n<84b2> <84b2> 7522\n<84b3> <84b3> 7538\n<84b4> <84b4> 7554\n<84b5> <84b5> 7511\n<84b6> <84b6> 7526\n<84b7> <84b7> 7519\n<84b8> <84b8> 7534\n<84b9> <84b9> 7542\n<84ba> <84ba> 7508\n<84bb> <84bb> 7527\n<84bc> <84bc> 7516\n<84bd> <84bd> 7535\n<84be> <84be> 7545\n<8740> <875d> 7555\n<875f> <8760> 7585\n<8761> <8761> 8038\n<8762> <8762> 7588\n<8763> <8763> 8040\n<8764> <8764> 7590\n<8765> <8765> 8042\n<8766> <8767> 7592\n<8768> <8768> 8044\n<8769> <876a> 7595\n<876b> <876b> 8043\n<876c> <876d> 7598\n<876e> <876e> 8047\n<876f> <8775> 7601\n<877e> <877e> 8323\n<8780> <8783> 7608\n<8784> <8784> 8055\n<8785> <878f> 7613\n<8790> <8790> 762\n<8791> <8791> 761\n<8792> <8792> 769\n<8793> <8799> 7624\n<879a> <879a> 768\n<879b> <879c> 7631\n<889f> <88fc> 1125\n<8940> <897e> 1219\n<8980> <89fc> 1282\n<8a40> <8a7e> 1407\n<8a80> <8afc> 1470\n<8b40> <8b7e> 1595\n<8b80> <8bfc> 1658\n<8c40> <8c7e> 1783\n<8c80> <8cfc> 1846\n<8d40> <8d7e> 1971\n<8d80> <8dfc> 2034\n<8e40> <8e7e> 2159\n<8e80> <8efc> 2222\n<8f40> <8f7e> 2347\n<8f80> <8ffc> 2410\n<9040> <907e> 2535\n<9080> <90fc> 2598\n<9140> <917e> 2723\n<9180> <91fc> 2786\n<9240> <927e> 2911\n<9280> <92fc> 2974\n<9340> <937e> 3099\n<9380> <93fc> 3162\n<9440> <947e> 3287\n<9480> <94fc> 3350\nendcidrange\n\n70 begincidrange\n<9540> <957e> 3475\n<9580> <95fc> 3538\n<9640> <967e> 3663\n<9680> <96fc> 3726\n<9740> <977e> 3851\n<9780> <97fc> 3914\n<9840> <9872> 4039\n<989f> <98fc> 4090\n<9940> <997e> 4184\n<9980> <99fc> 4247\n<9a40> <9a7e> 4372\n<9a80> <9afc> 4435\n<9b40> <9b7e> 4560\n<9b80> <9bfc> 4623\n<9c40> <9c7e> 4748\n<9c80> <9cfc> 4811\n<9d40> <9d7e> 4936\n<9d80> <9dfc> 4999\n<9e40> <9e7e> 5124\n<9e80> <9efc> 5187\n<9f40> <9f7e> 5312\n<9f80> <9ffc> 5375\n<a0> <df> 326\n<e040> <e07e> 5500\n<e080> <e0fc> 5563\n<e140> <e17e> 5688\n<e180> <e1fc> 5751\n<e240> <e27e> 5876\n<e280> <e2fc> 5939\n<e340> <e37e> 6064\n<e380> <e3fc> 6127\n<e440> <e47e> 6252\n<e480> <e4fc> 6315\n<e540> <e57e> 6440\n<e580> <e5fc> 6503\n<e640> <e67e> 6628\n<e680> <e6fc> 6691\n<e740> <e77e> 6816\n<e780> <e7fc> 6879\n<e840> <e87e> 7004\n<e880> <e8fc> 7067\n<e940> <e97e> 7192\n<e980> <e9fc> 7255\n<ea40> <ea7e> 7380\n<ea80> <eaa2> 7443\n<eaa3> <eaa4> 8284\n<ed40> <ed7e> 8359\n<ed80> <edb3> 8422\n<edb4> <edb4> 1993\n<edb5> <edfc> 8474\n<ee40> <ee7e> 8546\n<ee80> <eeec> 8609\n<eeef> <eef8> 8092\n<eef9> <eef9> 751\n<eefa> <eefc> 8005\n<fa40> <fa49> 8092\n<fa4a> <fa53> 7575\n<fa54> <fa54> 751\n<fa55> <fa57> 8005\n<fa58> <fa58> 7618\n<fa59> <fa59> 7610\n<fa5a> <fa5a> 8055\n<fa5b> <fa5b> 768\n<fa5c> <fa7e> 8359\n<fa80> <facf> 8394\n<fad0> <fad0> 1993\n<fad1> <fafc> 8474\n<fb40> <fb7e> 8518\n<fb80> <fbfc> 8581\n<fc40> <fc4b> 8706\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/90msp-RKSJ-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (90msp-RKSJ-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (90msp-RKSJ-H)\n%%BeginResource: CMap (90msp-RKSJ-V)\n%%Title: (90msp-RKSJ-V Adobe Japan1 2)\n%%Version: 11.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/90msp-RKSJ-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 2 def\nend def\n\n/CMapName /90msp-RKSJ-V def\n/CMapVersion 11.003 def\n/CMapType 1 def\n\n/XUID [1 10 25446] def\n\n/WMode 1 def\n\n78 begincidrange\n<8141> <8142> 7887\n<8143> <8143> 8268\n<8144> <8144> 8274\n<8150> <8151> 7889\n<815b> <815d> 7891\n<8160> <8164> 7894\n<8169> <817a> 7899\n<8181> <8181> 7917\n<81a8> <81a8> 739\n<81a9> <81a9> 738\n<81aa> <81ab> 736\n<81ac> <81ac> 8270\n<829f> <829f> 7918\n<82a1> <82a1> 7919\n<82a3> <82a3> 7920\n<82a5> <82a5> 7921\n<82a7> <82a7> 7922\n<82c1> <82c1> 7923\n<82e1> <82e1> 7924\n<82e3> <82e3> 7925\n<82e5> <82e5> 7926\n<82ec> <82ec> 7927\n<8340> <8340> 7928\n<8342> <8342> 7929\n<8344> <8344> 7930\n<8346> <8346> 7931\n<8348> <8348> 7932\n<8362> <8362> 7933\n<8383> <8383> 7934\n<8385> <8385> 7935\n<8387> <8387> 7936\n<838e> <838e> 7937\n<8395> <8396> 7938\n<849f> <849f> 7481\n<84a0> <84a0> 7479\n<84a1> <84a1> 7495\n<84a2> <84a2> 7503\n<84a3> <84a3> 7499\n<84a4> <84a4> 7491\n<84a5> <84a5> 7523\n<84a6> <84a6> 7515\n<84a7> <84a7> 7531\n<84a8> <84a8> 7507\n<84a9> <84a9> 7539\n<84aa> <84aa> 7482\n<84ab> <84ab> 7480\n<84ac> <84ac> 7498\n<84ad> <84ad> 7506\n<84ae> <84ae> 7502\n<84af> <84af> 7494\n<84b0> <84b0> 7530\n<84b1> <84b1> 7522\n<84b2> <84b2> 7538\n<84b3> <84b3> 7514\n<84b4> <84b4> 7554\n<84b5> <84b5> 7526\n<84b6> <84b6> 7519\n<84b7> <84b7> 7534\n<84b8> <84b8> 7511\n<84b9> <84b9> 7545\n<84ba> <84ba> 7527\n<84bb> <84bb> 7516\n<84bc> <84bc> 7535\n<84bd> <84bd> 7508\n<84be> <84be> 7542\n<875f> <8760> 7940\n<8761> <8761> 8329\n<8762> <8762> 7943\n<8763> <8763> 8339\n<8764> <8764> 7945\n<8765> <8765> 8338\n<8766> <8767> 7947\n<8768> <8768> 8344\n<8769> <876a> 7950\n<876b> <876b> 8348\n<876c> <876d> 7953\n<876e> <876e> 8349\n<8780> <8781> 7956\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/90pv-RKSJ-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (90pv-RKSJ-H)\n%%Title: (90pv-RKSJ-H Adobe Japan1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 1 def\nend def\n\n/CMapName /90pv-RKSJ-H def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 870 def\n/XUID [1 10 25341] def\n\n/WMode 0 def\n\n5 begincodespacerange\n  <00>   <80>\n  <8140> <9FFC>\n  <A0>   <DF>\n  <E040> <FCFC>\n  <FD>   <FF>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 1\nendnotdefrange\n\n100 begincidrange\n<20> <7e> 1\n<80> <80> 97\n<8140> <817e> 633\n<8180> <81ac> 696\n<81b8> <81bf> 741\n<81c8> <81ce> 749\n<81da> <81e8> 756\n<81f0> <81f7> 771\n<81fc> <81fc> 779\n<824f> <8258> 780\n<8260> <8279> 790\n<8281> <829a> 816\n<829f> <82f1> 842\n<8340> <837e> 925\n<8380> <8396> 988\n<839f> <83b6> 1011\n<83bf> <83d6> 1035\n<8440> <8460> 1059\n<8470> <847e> 1092\n<8480> <8491> 1107\n<849f> <849f> 7479\n<84a0> <84a0> 7481\n<84a1> <84a1> 7491\n<84a2> <84a2> 7495\n<84a3> <84a3> 7503\n<84a4> <84a4> 7499\n<84a5> <84a5> 7507\n<84a6> <84a6> 7523\n<84a7> <84a7> 7515\n<84a8> <84a8> 7531\n<84a9> <84a9> 7539\n<84aa> <84aa> 7480\n<84ab> <84ab> 7482\n<84ac> <84ac> 7494\n<84ad> <84ad> 7498\n<84ae> <84ae> 7506\n<84af> <84af> 7502\n<84b0> <84b0> 7514\n<84b1> <84b1> 7530\n<84b2> <84b2> 7522\n<84b3> <84b3> 7538\n<84b4> <84b4> 7554\n<84b5> <84b5> 7511\n<84b6> <84b6> 7526\n<84b7> <84b7> 7519\n<84b8> <84b8> 7534\n<84b9> <84b9> 7542\n<84ba> <84ba> 7508\n<84bb> <84bb> 7527\n<84bc> <84bc> 7516\n<84bd> <84bd> 7535\n<84be> <84be> 7545\n<8540> <8553> 7555\n<855e> <8571> 8071\n<857c> <857e> 8286\n<8580> <8585> 8289\n<8591> <859a> 8061\n<859f> <85a8> 7575\n<85a9> <85aa> 8225\n<85ab> <85ad> 8295\n<85b3> <85bc> 8092\n<85bd> <85c1> 8298\n<85db> <85f4> 8112\n<8640> <8640> 7601\n<8641> <8641> 8186\n<8642> <8642> 7602\n<8643> <8643> 8020\n<8644> <8644> 8022\n<8645> <8645> 8303\n<8646> <8646> 7607\n<8647> <8647> 8023\n<8648> <8648> 7603\n<8649> <8649> 8021\n<864a> <864a> 7604\n<864b> <864b> 8304\n<864c> <864d> 7605\n<864e> <864e> 8037\n<864f> <8655> 8024\n<8656> <8656> 8305\n<8657> <8657> 8036\n<8658> <8659> 8034\n<865a> <865c> 8031\n<865d> <865d> 8306\n<869b> <869d> 7610\n<869e> <869e> 8307\n<869f> <869f> 8018\n<86a0> <86a1> 8016\n<86a2> <86a2> 8019\n<86a3> <86a3> 8211\n<86a4> <86a4> 8213\n<86a5> <86a5> 8212\n<86a6> <86a6> 8214\n<86b3> <86b3> 8058\n<86b4> <86b4> 8056\n<86b5> <86b5> 8308\n<86c7> <86ca> 8219\n<86cb> <86ce> 8309\n<86cf> <86cf> 8014\n<86d0> <86d0> 8013\n<86d1> <86d1> 8012\nendcidrange\n\n100 begincidrange\n<86d2> <86d2> 8011\n<86d3> <86d6> 8206\n<8740> <8746> 8197\n<8747> <8747> 8150\n<8748> <8748> 8204\n<8749> <8749> 8145\n<874a> <874a> 8138\n<874b> <874b> 7620\n<874c> <874c> 8151\n<874d> <874d> 7618\n<874e> <874e> 8146\n<874f> <874f> 8141\n<8750> <8750> 7619\n<8751> <8751> 8149\n<8752> <8752> 8147\n<8753> <8753> 8143\n<8754> <8754> 8148\n<8755> <8755> 8144\n<8756> <8757> 8139\n<8758> <8758> 8142\n<8791> <8792> 8317\n<8793> <8797> 7613\n<8798> <8798> 8154\n<8799> <8799> 8165\n<879a> <879a> 8319\n<879b> <879b> 8158\n<879c> <879c> 8191\n<879d> <879d> 8320\n<879e> <879e> 8223\n<879f> <879f> 7585\n<87a0> <87a0> 8038\n<87a1> <87a1> 7588\n<87a2> <87a2> 7586\n<87a3> <87a3> 8039\n<87a4> <87a4> 8183\n<87a5> <87a6> 8327\n<87a7> <87a7> 8042\n<87a8> <87a8> 7592\n<87a9> <87aa> 8040\n<87ab> <87ab> 7590\n<87ac> <87ac> 7593\n<87ad> <87ad> 7599\n<87ae> <87ae> 8046\n<87af> <87af> 8044\n<87b0> <87b0> 7595\n<87b1> <87b1> 8045\n<87b2> <87b2> 8043\n<87b3> <87b3> 7596\n<87b4> <87b4> 8047\n<87b5> <87b5> 7598\n<87bd> <87bd> 8048\n<87be> <87bf> 8051\n<87c0> <87c1> 8049\n<87e5> <87e7> 7621\n<87e8> <87e8> 8323\n<87fa> <87fa> 8054\n<87fb> <87fc> 8321\n<8840> <8840> 7624\n<8841> <8842> 7629\n<8854> <8855> 7608\n<8868> <8868> 7958\n<886a> <886d> 8313\n<889f> <88fc> 1125\n<8940> <897e> 1219\n<8980> <89fc> 1282\n<8a40> <8a7e> 1407\n<8a80> <8afc> 1470\n<8b40> <8b7e> 1595\n<8b80> <8bfc> 1658\n<8c40> <8c7e> 1783\n<8c80> <8cfc> 1846\n<8d40> <8d7e> 1971\n<8d80> <8dfc> 2034\n<8e40> <8e7e> 2159\n<8e80> <8efc> 2222\n<8f40> <8f7e> 2347\n<8f80> <8ffc> 2410\n<9040> <907e> 2535\n<9080> <90fc> 2598\n<9140> <917e> 2723\n<9180> <91fc> 2786\n<9240> <927e> 2911\n<9280> <92fc> 2974\n<9340> <937e> 3099\n<9380> <93fc> 3162\n<9440> <947e> 3287\n<9480> <94fc> 3350\n<9540> <957e> 3475\n<9580> <95fc> 3538\n<9640> <967e> 3663\n<9680> <96fc> 3726\n<9740> <977e> 3851\n<9780> <97fc> 3914\n<9840> <9872> 4039\n<989f> <98fc> 4090\n<9940> <997e> 4184\n<9980> <99fc> 4247\n<9a40> <9a7e> 4372\n<9a80> <9afc> 4435\n<9b40> <9b7e> 4560\nendcidrange\n\n63 begincidrange\n<9b80> <9bfc> 4623\n<9c40> <9c7e> 4748\n<9c80> <9cfc> 4811\n<9d40> <9d7e> 4936\n<9d80> <9dfc> 4999\n<9e40> <9e7e> 5124\n<9e80> <9efc> 5187\n<9f40> <9f7e> 5312\n<9f80> <9ffc> 5375\n<a0> <df> 326\n<e040> <e07e> 5500\n<e080> <e0fc> 5563\n<e140> <e17e> 5688\n<e180> <e1fc> 5751\n<e240> <e27e> 5876\n<e280> <e2fc> 5939\n<e340> <e37e> 6064\n<e380> <e3fc> 6127\n<e440> <e47e> 6252\n<e480> <e4fc> 6315\n<e540> <e57e> 6440\n<e580> <e5fc> 6503\n<e640> <e67e> 6628\n<e680> <e6fc> 6691\n<e740> <e77e> 6816\n<e780> <e7fc> 6879\n<e840> <e87e> 7004\n<e880> <e8fc> 7067\n<e940> <e97e> 7192\n<e980> <e9fc> 7255\n<ea40> <ea7e> 7380\n<ea80> <eaa2> 7443\n<eaa3> <eaa4> 8284\n<eb41> <eb42> 7887\n<eb50> <eb51> 7889\n<eb5b> <eb5d> 7891\n<eb60> <eb64> 7894\n<eb69> <eb7a> 7899\n<eb81> <eb81> 7917\n<ec9f> <ec9f> 7918\n<eca1> <eca1> 7919\n<eca3> <eca3> 7920\n<eca5> <eca5> 7921\n<eca7> <eca7> 7922\n<ecc1> <ecc1> 7923\n<ece1> <ece1> 7924\n<ece3> <ece3> 7925\n<ece5> <ece5> 7926\n<ecec> <ecec> 7927\n<ed40> <ed40> 7928\n<ed42> <ed42> 7929\n<ed44> <ed44> 7930\n<ed46> <ed46> 7931\n<ed48> <ed48> 7932\n<ed62> <ed62> 7933\n<ed83> <ed83> 7934\n<ed85> <ed85> 7935\n<ed87> <ed87> 7936\n<ed8e> <ed8e> 7937\n<ed95> <ed96> 7938\n<fd> <fd> 152\n<fe> <fe> 228\n<ff> <ff> 124\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/90pv-RKSJ-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (90pv-RKSJ-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (90pv-RKSJ-H)\n%%BeginResource: CMap (90pv-RKSJ-V)\n%%Title: (90pv-RKSJ-V Adobe Japan1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/90pv-RKSJ-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 1 def\nend def\n\n/CMapName /90pv-RKSJ-V def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 940 def\n/XUID [1 10 25342] def\n\n/WMode 1 def\n\n51 begincidrange\n<8141> <8142> 7887\n<8150> <8151> 7889\n<815b> <815d> 7891\n<8160> <8164> 7894\n<8169> <817a> 7899\n<8181> <8181> 7917\n<829f> <829f> 7918\n<82a1> <82a1> 7919\n<82a3> <82a3> 7920\n<82a5> <82a5> 7921\n<82a7> <82a7> 7922\n<82c1> <82c1> 7923\n<82e1> <82e1> 7924\n<82e3> <82e3> 7925\n<82e5> <82e5> 7926\n<82ec> <82ec> 7927\n<8340> <8340> 7928\n<8342> <8342> 7929\n<8344> <8344> 7930\n<8346> <8346> 7931\n<8348> <8348> 7932\n<8362> <8362> 7933\n<8383> <8383> 7934\n<8385> <8385> 7935\n<8387> <8387> 7936\n<838e> <838e> 7937\n<8395> <8396> 7938\n<879f> <879f> 7940\n<87a0> <87a0> 8329\n<87a1> <87a1> 7943\n<87a2> <87a2> 7941\n<87a3> <87a3> 8330\n<87a4> <87a5> 8333\n<87a6> <87a7> 8337\n<87a8> <87a8> 7947\n<87a9> <87aa> 8339\n<87ab> <87ab> 7945\n<87ac> <87ac> 7948\n<87ad> <87ad> 7954\n<87ae> <87af> 8343\n<87b0> <87b0> 7950\n<87b1> <87b2> 8347\n<87b3> <87b3> 7951\n<87b4> <87b4> 8349\n<87b5> <87b5> 7953\n<87bd> <87bd> 8350\n<87be> <87be> 8353\n<87bf> <87bf> 8356\n<87c0> <87c0> 8358\n<87c1> <87c1> 8357\n<87fa> <87fc> 8324\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/Add-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Add-H)\n%%Title: (Add-H Adobe Japan1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 1 def\nend def\n\n/CMapName /Add-H def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 580 def\n/XUID [1 10 25325] def\n\n/WMode 0 def\n\n1 begincodespacerange\n  <2121> <7E7E>\nendcodespacerange\n\n100 begincidrange\n<2121> <217e>  633\n<2221> <222e>  727\n<223a> <2241>  741\n<224a> <2250>  749\n<225c> <226a>  756\n<2272> <2279>  771\n<227e> <227e>  779\n<2330> <2339>  780\n<2341> <235a>  790\n<2361> <237a>  816\n<2421> <2473>  842\n<2474> <2476> 7958\n<2521> <2576>  925\n<2621> <2638> 1011\n<2641> <2658> 1035\n<2721> <2741> 1059\n<2751> <2771> 1092\n<2821> <2821> 7479\n<2822> <2822> 7481\n<2823> <2823> 7491\n<2824> <2824> 7495\n<2825> <2825> 7503\n<2826> <2826> 7499\n<2827> <2827> 7507\n<2828> <2828> 7523\n<2829> <2829> 7515\n<282a> <282a> 7531\n<282b> <282b> 7539\n<282c> <282c> 7480\n<282d> <282d> 7482\n<282e> <282e> 7494\n<282f> <282f> 7498\n<2830> <2830> 7506\n<2831> <2831> 7502\n<2832> <2832> 7514\n<2833> <2833> 7530\n<2834> <2834> 7522\n<2835> <2835> 7538\n<2836> <2836> 7554\n<2837> <2837> 7511\n<2838> <2838> 7526\n<2839> <2839> 7519\n<283a> <283a> 7534\n<283b> <283b> 7542\n<283c> <283c> 7508\n<283d> <283d> 7527\n<283e> <283e> 7516\n<283f> <283f> 7535\n<2840> <2840> 7545\n<3021> <3021> 1125\n<3022> <3022> 7633\n<3023> <3031> 1127\n<3032> <3032> 7961\n<3033> <303a> 1143\n<303b> <303b> 7634\n<303c> <306d> 1152\n<306e> <306e> 7635\n<306f> <3070> 1203\n<3071> <3071> 7962\n<3072> <3072> 1206\n<3073> <3073> 7636\n<3074> <307b> 1208\n<307c> <307c> 7637\n<307d> <307e> 1217\n<3121> <3129> 1219\n<312a> <312a> 7638\n<312b> <3132> 1229\n<3133> <3133> 7963\n<3134> <3134> 1238\n<3135> <3135> 7639\n<3136> <3138> 1240\n<3139> <3139> 7964\n<313a> <313c> 1244\n<313d> <313d> 7642\n<313e> <3141> 1248\n<3142> <3142> 7643\n<3143> <316a> 1253\n<316b> <316b> 7644\n<316c> <317e> 1294\n<3221> <3227> 1313\n<3228> <3228> 7645\n<3229> <3229> 1321\n<322a> <322a> 7646\n<322b> <325f> 1323\n<3260> <3260> 7647\n<3261> <3266> 1377\n<3267> <3267> 7965\n<3268> <3279> 1384\n<327a> <327a> 7648\n<327b> <327e> 1403\n<3321> <3321> 1407\n<3322> <3322> 7650\n<3323> <336a> 1409\n<336b> <336b> 7652\n<336c> <3372> 1482\n<3373> <3373> 7653\n<3374> <3379> 1490\n<337a> <337a> 7654\n<337b> <337e> 1497\n<3421> <3441> 1501\nendcidrange\n\n100 begincidrange\n<3442> <3442> 7655\n<3443> <344c> 1535\n<344d> <344d> 7656\n<344e> <3464> 1546\n<3465> <3465> 7657\n<3466> <347e> 1570\n<3521> <352a> 1595\n<352b> <352b> 7658\n<352c> <353f> 1606\n<3540> <3540> 7659\n<3541> <3561> 1627\n<3562> <3562> 7966\n<3563> <3567> 1661\n<3568> <3568> 7967\n<3569> <357e> 1667\n<3621> <3621> 1689\n<3622> <3622> 7660\n<3623> <3629> 1691\n<362a> <362a> 7661\n<362b> <3641> 1699\n<3642> <3642> 7968\n<3643> <364e> 1723\n<364f> <364f> 7662\n<3650> <366c> 1736\n<366d> <366d> 7663\n<366e> <3673> 1766\n<3674> <3674> 7664\n<3675> <367a> 1773\n<367b> <367b> 7665\n<367c> <367c> 1780\n<367d> <367d> 7666\n<367e> <367e> 1782\n<3721> <3736> 1783\n<3737> <3737> 7668\n<3738> <3751> 1806\n<3752> <3752> 7671\n<3753> <3770> 1833\n<3771> <3771> 7674\n<3772> <377c> 1864\n<377d> <377d> 7969\n<377e> <377e> 7676\n<3821> <3833> 1877\n<3834> <3834> 7677\n<3835> <3840> 1897\n<3841> <3841> 7678\n<3842> <387e> 1910\n<3921> <392a> 1971\n<392b> <392b> 7679\n<392c> <396c> 1982\n<396d> <396d> 7682\n<396e> <3973> 2048\n<3974> <3974> 7683\n<3975> <3978> 2055\n<3979> <3979> 7684\n<397a> <397e> 2060\n<3a21> <3a52> 2065\n<3a53> <3a53> 7685\n<3a54> <3a66> 2116\n<3a67> <3a67> 7686\n<3a68> <3a73> 2136\n<3a74> <3a74> 7687\n<3a75> <3a7e> 2149\n<3b21> <3b26> 2159\n<3b27> <3b27> 7688\n<3b28> <3b29> 2166\n<3b2a> <3b2a> 7689\n<3b2b> <3b2b> 2169\n<3b2c> <3b2c> 7690\n<3b2d> <3b38> 2171\n<3b39> <3b39> 7691\n<3b3a> <3b40> 2184\n<3b41> <3b41> 7970\n<3b42> <3b7e> 2192\n<3c21> <3c47> 2253\n<3c48> <3c48> 7693\n<3c49> <3c5c> 2293\n<3c5d> <3c5e> 7695\n<3c5f> <3c7e> 2315\n<3d21> <3d2a> 2347\n<3d2b> <3d2b> 7697\n<3d2c> <3d35> 2358\n<3d36> <3d36> 7698\n<3d37> <3d6b> 2369\n<3d6c> <3d6c> 7699\n<3d6d> <3d71> 2423\n<3d72> <3d73> 7701\n<3d74> <3d7e> 2430\n<3e21> <3e24> 2441\n<3e25> <3e25> 7703\n<3e26> <3e32> 2446\n<3e33> <3e33> 7704\n<3e34> <3e54> 2460\n<3e55> <3e55> 7706\n<3e56> <3e5e> 2494\n<3e5f> <3e5f> 7707\n<3e60> <3e63> 2504\n<3e64> <3e64> 7708\n<3e65> <3e7e> 2509\n<3f21> <3f29> 2535\n<3f2a> <3f2a> 7709\nendcidrange\n\n100 begincidrange\n<3f2b> <3f58> 2545\n<3f59> <3f59> 7971\n<3f5a> <3f5f> 2592\n<3f60> <3f60> 7711\n<3f61> <3f7e> 2599\n<4021> <4021> 2629\n<4022> <4022> 7713\n<4023> <4065> 2631\n<4066> <4066> 7715\n<4067> <4070> 2699\n<4071> <4071> 7716\n<4072> <4078> 2710\n<4079> <4079> 7718\n<407a> <407a> 7972\n<407b> <407b> 2719\n<407c> <407d> 7973\n<407e> <407e> 2722\n<4121> <4126> 2723\n<4127> <4127> 7720\n<4128> <4138> 2730\n<4139> <4139> 7721\n<413a> <414b> 2748\n<414c> <414c> 7722\n<414d> <414e> 2767\n<414f> <414f> 7723\n<4150> <415e> 2770\n<415f> <415f> 7724\n<4160> <4168> 2786\n<4169> <4169> 7725\n<416a> <417e> 2796\n<4221> <4236> 2817\n<4237> <4237> 7975\n<4238> <423c> 2840\n<423d> <423d> 7726\n<423e> <424c> 2846\n<424d> <424d> 7727\n<424e> <425b> 2862\n<425c> <425c> 7728\n<425d> <4262> 2877\n<4263> <4263> 7729\n<4264> <426e> 2884\n<426f> <426f> 7730\n<4270> <427c> 2896\n<427d> <427d> 7733\n<427e> <427e> 2910\n<4321> <4326> 2911\n<4327> <4327> 7734\n<4328> <4328> 2918\n<4329> <4329> 7735\n<432a> <432c> 2920\n<432d> <432e> 7737\n<432f> <433c> 2925\n<433d> <433d> 7739\n<433e> <436f> 2940\n<4370> <4370> 7740\n<4371> <4374> 2991\n<4375> <4375> 7741\n<4376> <437b> 2996\n<437c> <437c> 7742\n<437d> <437e> 3003\n<4421> <443c> 3005\n<443d> <443d> 7743\n<443e> <4447> 3034\n<4448> <4448> 7744\n<4449> <4449> 3045\n<444a> <444a> 7745\n<444b> <444e> 3047\n<444f> <444f> 7747\n<4450> <447e> 3052\n<4521> <4521> 3099\n<4522> <4522> 7748\n<4523> <4526> 3101\n<4527> <4527> 7749\n<4528> <452d> 3106\n<452e> <452e> 7750\n<452f> <4535> 3113\n<4536> <4536> 7751\n<4537> <453e> 3121\n<453f> <453f> 7752\n<4540> <4547> 3130\n<4548> <4548> 7753\n<4549> <454a> 3139\n<454b> <454b> 7754\n<454c> <4550> 3142\n<4551> <4551> 7976\n<4552> <4552> 7756\n<4553> <4563> 3149\n<4564> <4564> 7757\n<4565> <4577> 3167\n<4578> <4578> 7758\n<4579> <457e> 3187\n<4621> <4641> 3193\n<4642> <4642> 7760\n<4643> <4653> 3227\n<4654> <4654> 7761\n<4655> <465a> 3245\n<465b> <465b> 7763\n<465c> <4665> 3252\n<4666> <4667> 7766\n<4668> <4669> 3264\nendcidrange\n\n100 begincidrange\n<466a> <466a> 7768\n<466b> <4675> 3267\n<4676> <4676> 7872\n<4677> <467e> 3279\n<4721> <4728> 3287\n<4729> <4729> 7769\n<472a> <472a> 7977\n<472b> <4738> 3297\n<4739> <4739> 7770\n<473a> <4756> 3312\n<4757> <4757> 7771\n<4758> <4766> 3342\n<4767> <4767> 7772\n<4768> <4768> 3358\n<4769> <4769> 7773\n<476a> <476c> 3360\n<476d> <476d> 7774\n<476e> <477e> 3364\n<4821> <4823> 3381\n<4824> <4824> 7775\n<4825> <482d> 3385\n<482e> <482e> 7776\n<482f> <482f> 3395\n<4830> <4830> 7777\n<4831> <483f> 3397\n<4840> <4840> 7978\n<4841> <4853> 3413\n<4854> <4854> 7778\n<4855> <4874> 3433\n<4875> <4875> 7780\n<4876> <487e> 3466\n<4921> <4921> 3475\n<4922> <4923> 7781\n<4924> <492e> 3478\n<492f> <492f> 7783\n<4930> <4931> 3490\n<4932> <4932> 7784\n<4933> <4934> 3493\n<4935> <4935> 7785\n<4936> <493f> 3496\n<4940> <4940> 7786\n<4941> <494d> 3507\n<494e> <494e> 7787\n<494f> <497e> 3521\n<4a21> <4a42> 3569\n<4a43> <4a43> 7789\n<4a44> <4a4c> 3604\n<4a4d> <4a4d> 7790\n<4a4e> <4a52> 3614\n<4a53> <4a53> 7979\n<4a54> <4a59> 3620\n<4a5a> <4a5a> 7791\n<4a5b> <4a78> 3627\n<4a79> <4a79> 7792\n<4a7a> <4a7e> 3658\n<4b21> <4b28> 3663\n<4b29> <4b29> 7794\n<4b2a> <4b4a> 3672\n<4b4b> <4b4b> 7795\n<4b4c> <4b6f> 3706\n<4b70> <4b70> 7796\n<4b71> <4b77> 3743\n<4b78> <4b78> 7980\n<4b79> <4b7e> 3751\n<4c21> <4c4c> 3757\n<4c4d> <4c4d> 7797\n<4c4e> <4c58> 3802\n<4c59> <4c59> 7798\n<4c5a> <4c5e> 3814\n<4c5f> <4c5f> 7799\n<4c60> <4c61> 3820\n<4c62> <4c62> 7800\n<4c63> <4c79> 3823\n<4c7a> <4c7a> 7801\n<4c7b> <4c7b> 3847\n<4c7c> <4c7c> 7802\n<4c7d> <4c7e> 3849\n<4d21> <4d31> 3851\n<4d32> <4d32> 7804\n<4d33> <4d4f> 3869\n<4d50> <4d50> 7805\n<4d51> <4d53> 3899\n<4d54> <4d54> 7806\n<4d55> <4d68> 3903\n<4d69> <4d69> 7807\n<4d6a> <4d7e> 3924\n<4e21> <4e79> 3945\n<4e7a> <4e7b> 7809\n<4e7c> <4e7c> 7981\n<4e7d> <4e7e> 4037\n<4f21> <4f21> 7811\n<4f22> <4f30> 4040\n<4f31> <4f31> 7812\n<4f32> <4f38> 4056\n<4f39> <4f39> 7813\n<4f3a> <4f53> 4064\n<5021> <507e> 4090\n<5121> <5121> 4184\n<5122> <5122> 7982\n<5123> <513c> 4186\nendcidrange\n\n100 begincidrange\n<513d> <513d> 7814\n<513e> <514c> 4213\n<514d> <514d> 7817\n<514e> <517e> 4229\n<5221> <5237> 4278\n<5238> <5238> 7983\n<5239> <527e> 4302\n<5321> <532f> 4372\n<5330> <5330> 7818\n<5331> <5339> 4388\n<533a> <533a> 7819\n<533b> <5347> 4398\n<5348> <5348> 7984\n<5349> <535d> 4412\n<535e> <535e> 7821\n<535f> <536a> 4434\n<536b> <536b> 7822\n<536c> <536c> 7985\n<536d> <537e> 4448\n<5421> <5443> 4466\n<5444> <5444> 7823\n<5445> <5445> 7986\n<5446> <546b> 4503\n<546c> <546c> 7987\n<546d> <547e> 4542\n<5521> <553c> 4560\n<553d> <553d> 7824\n<553e> <5562> 4589\n<5563> <5563> 7825\n<5564> <5577> 4627\n<5578> <5578> 7988\n<5579> <557e> 4648\n<5621> <5621> 4654\n<5622> <5622> 7826\n<5623> <567c> 4656\n<567d> <567e> 7989\n<5721> <577e> 4748\n<5821> <5823> 4842\n<5824> <5824> 7828\n<5825> <587e> 4846\n<5921> <5927> 4936\n<5928> <5928> 7991\n<5929> <595f> 4944\n<5960> <5960> 7829\n<5961> <596b> 5000\n<596c> <596c> 7830\n<596d> <597e> 5012\n<5a21> <5a38> 5030\n<5a39> <5a39> 7831\n<5a3a> <5a79> 5055\n<5a7a> <5a7a> 7992\n<5a7b> <5a7e> 5120\n<5b21> <5b44> 5124\n<5b45> <5b45> 7833\n<5b46> <5b6a> 5161\n<5b6b> <5b6b> 7835\n<5b6c> <5b7e> 5199\n<5c21> <5c7e> 5218\n<5d21> <5d60> 5312\n<5d61> <5d61> 7993\n<5d62> <5d7e> 5377\n<5e21> <5e4f> 5406\n<5e50> <5e50> 7837\n<5e51> <5e55> 5454\n<5e56> <5e56> 7994\n<5e57> <5e75> 5460\n<5e76> <5e76> 7995\n<5e77> <5e7e> 5492\n<5f21> <5f72> 5500\n<5f73> <5f73> 7838\n<5f74> <5f7e> 5583\n<6021> <6025> 5594\n<6026> <6026> 7839\n<6027> <605e> 5600\n<605f> <605f> 7840\n<6060> <607e> 5657\n<6121> <612a> 5688\n<612b> <612b> 7841\n<612c> <617e> 5699\n<6221> <626e> 5782\n<626f> <626f> 7845\n<6270> <627e> 5861\n<6321> <6349> 5876\n<634a> <634a> 7846\n<634b> <6353> 5918\n<6354> <6354> 7847\n<6355> <6358> 5928\n<6359> <6359> 7996\n<635a> <637e> 5933\n<6421> <6438> 5970\n<6439> <6439> 7848\n<643a> <643f> 5995\n<6440> <6440> 7997\n<6441> <6463> 6002\n<6464> <6464> 7849\n<6465> <646d> 6038\n<646e> <646e> 7850\n<646f> <647e> 6048\n<6521> <6538> 6064\n<6539> <6539> 7851\nendcidrange\n\n100 begincidrange\n<653a> <653a> 6089\n<653b> <653b> 7852\n<653c> <6545> 6091\n<6546> <6546> 7853\n<6547> <657e> 6102\n<6621> <6648> 6158\n<6649> <6649> 7998\n<664a> <667e> 6199\n<6721> <6763> 6252\n<6764> <6764> 7855\n<6765> <6768> 6320\n<6769> <6769> 7856\n<676a> <6771> 6325\n<6772> <6772> 7857\n<6773> <677e> 6334\n<6821> <683a> 6346\n<683b> <683b> 7859\n<683c> <684c> 6373\n<684d> <684d> 7999\n<684e> <687e> 6391\n<6921> <697d> 6440\n<697e> <697e> 8000\n<6a21> <6a3b> 6534\n<6a3c> <6a3d> 8001\n<6a3e> <6a6e> 6563\n<6a6f> <6a6f> 7864\n<6a70> <6a7e> 6613\n<6b21> <6b31> 6628\n<6b32> <6b32> 7865\n<6b33> <6b65> 6646\n<6b66> <6b66> 7866\n<6b67> <6b7e> 6698\n<6c21> <6c68> 6722\n<6c69> <6c69> 7868\n<6c6a> <6c7e> 6795\n<6d21> <6d4d> 6816\n<6d4e> <6d4e> 7870\n<6d4f> <6d7e> 6862\n<6e21> <6e28> 6910\n<6e29> <6e29> 7873\n<6e2a> <6e3c> 6919\n<6e3d> <6e3d> 7874\n<6e3e> <6e7e> 6939\n<6f21> <6f7e> 7004\n<7021> <7050> 7098\n<7051> <7051> 7879\n<7052> <707e> 7147\n<7121> <7158> 7192\n<7159> <7159> 8003\n<715a> <717e> 7249\n<7221> <722c> 7286\n<722d> <722d> 7882\n<722e> <723b> 7299\n<723c> <723c> 7883\n<723d> <724d> 7314\n<724e> <724e> 7884\n<724f> <727e> 7332\n<7321> <7350> 7380\n<7351> <7351> 7885\n<7352> <7352> 8004\n<7353> <737c> 7430\n<737d> <737d> 7886\n<737e> <737e> 7473\n<7421> <7424> 7474\n<7425> <7426> 8284\n<7721> <7723> 8005\n<7727> <7727> 8008\n<7728> <7728>  768\n<7729> <7729>  762\n<772a> <772a>  761\n<772e> <7738> 8009\n<773c> <773e> 7601\n<773f> <773f> 8020\n<7740> <7740> 7607\n<7741> <7743> 8021\n<7744> <7746> 7604\n<7747> <7750> 8024\n<7751> <7751>  771\n<7752> <7752> 8034\n<7753> <7753>  772\n<7754> <7755> 8035\n<7757> <7757> 8037\n<7759> <7759> 7588\n<775a> <775a> 7585\n<775b> <775b> 8038\n<775c> <775c> 7586\n<775d> <775f> 8039\n<7760> <7760> 7590\n<7761> <7761> 8042\n<7762> <7762> 7592\n<7763> <7763> 7596\n<7764> <7764> 8043\n<7765> <7765> 7598\n<7766> <7766> 7595\n<7767> <7768> 8044\n<7769> <7769> 7599\n<776a> <7770> 8046\n<7774> <7779> 8053\n<777a> <777a> 7610\n<777b> <777b> 8059\nendcidrange\n\n31 begincidrange\n<777e> <777e> 8060\n<7829> <7832> 8061\n<7834> <7847> 8071\n<7849> <785c> 7555\n<785d> <785d> 8091\n<785e> <7867> 7575\n<786b> <787e> 8092\n<7921> <793a> 8112\n<7945> <7945> 7958\n<7949> <794a> 8138\n<794b> <794b> 7620\n<794c> <794e> 8140\n<794f> <794f> 7619\n<7950> <7954> 8143\n<7955> <7955> 7618\n<7956> <7959> 8148\n<795d> <796a> 8152\n<796f> <797e> 8166\n<7d21> <7d22> 7887\n<7d23> <7d23> 8268\n<7d24> <7d24> 8274\n<7d25> <7d2e> 7889\n<7d2f> <7d2f> 8282\n<7d30> <7d30> 8275\n<7d31> <7d31> 8280\n<7d32> <7d32> 8277\n<7d33> <7d44> 7899\n<7d45> <7d5a> 7918\n<7d5b> <7d5c> 8264\n<7d6d> <7d70>  736\n<7d71> <7d74> 8182\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/Add-RKSJ-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Add-RKSJ-H)\n%%Title: (Add-RKSJ-H Adobe Japan1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 1 def\nend def\n\n/CMapName /Add-RKSJ-H def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 140 def\n/XUID [1 10 25326] def\n\n/WMode 0 def\n\n4 begincodespacerange\n  <00>   <80>\n  <8140> <9FFC>\n  <A0>   <DF>\n  <E040> <FCFC>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 231\nendnotdefrange\n\n100 begincidrange\n<20> <7e>      231\n<8140> <817e>  633\n<8180> <81ac>  696\n<81b8> <81bf>  741\n<81c8> <81ce>  749\n<81da> <81e8>  756\n<81f0> <81f7>  771\n<81fc> <81fc>  779\n<824f> <8258>  780\n<8260> <8279>  790\n<8281> <829a>  816\n<829f> <82f1>  842\n<82f2> <82f4> 7958\n<8340> <837e>  925\n<8380> <8396>  988\n<839f> <83b6> 1011\n<83bf> <83d6> 1035\n<8440> <8460> 1059\n<8470> <847e> 1092\n<8480> <8491> 1107\n<849f> <849f> 7479\n<84a0> <84a0> 7481\n<84a1> <84a1> 7491\n<84a2> <84a2> 7495\n<84a3> <84a3> 7503\n<84a4> <84a4> 7499\n<84a5> <84a5> 7507\n<84a6> <84a6> 7523\n<84a7> <84a7> 7515\n<84a8> <84a8> 7531\n<84a9> <84a9> 7539\n<84aa> <84aa> 7480\n<84ab> <84ab> 7482\n<84ac> <84ac> 7494\n<84ad> <84ad> 7498\n<84ae> <84ae> 7506\n<84af> <84af> 7502\n<84b0> <84b0> 7514\n<84b1> <84b1> 7530\n<84b2> <84b2> 7522\n<84b3> <84b3> 7538\n<84b4> <84b4> 7554\n<84b5> <84b5> 7511\n<84b6> <84b6> 7526\n<84b7> <84b7> 7519\n<84b8> <84b8> 7534\n<84b9> <84b9> 7542\n<84ba> <84ba> 7508\n<84bb> <84bb> 7527\n<84bc> <84bc> 7516\n<84bd> <84bd> 7535\n<84be> <84be> 7545\n<889f> <889f> 1125\n<88a0> <88a0> 7633\n<88a1> <88af> 1127\n<88b0> <88b0> 7961\n<88b1> <88b8> 1143\n<88b9> <88b9> 7634\n<88ba> <88eb> 1152\n<88ec> <88ec> 7635\n<88ed> <88ee> 1203\n<88ef> <88ef> 7962\n<88f0> <88f0> 1206\n<88f1> <88f1> 7636\n<88f2> <88f9> 1208\n<88fa> <88fa> 7637\n<88fb> <88fc> 1217\n<8940> <8948> 1219\n<8949> <8949> 7638\n<894a> <8951> 1229\n<8952> <8952> 7963\n<8953> <8953> 1238\n<8954> <8954> 7639\n<8955> <8957> 1240\n<8958> <8958> 7964\n<8959> <895b> 1244\n<895c> <895c> 7642\n<895d> <8960> 1248\n<8961> <8961> 7643\n<8962> <897e> 1253\n<8980> <898a> 1282\n<898b> <898b> 7644\n<898c> <89a5> 1294\n<89a6> <89a6> 7645\n<89a7> <89a7> 1321\n<89a8> <89a8> 7646\n<89a9> <89dd> 1323\n<89de> <89de> 7647\n<89df> <89e4> 1377\n<89e5> <89e5> 7965\n<89e6> <89f7> 1384\n<89f8> <89f8> 7648\n<89f9> <89fc> 1403\n<8a40> <8a40> 1407\n<8a41> <8a41> 7650\n<8a42> <8a7e> 1409\n<8a80> <8a8a> 1470\n<8a8b> <8a8b> 7652\n<8a8c> <8a92> 1482\n<8a93> <8a93> 7653\nendcidrange\n\n100 begincidrange\n<8a94> <8a99> 1490\n<8a9a> <8a9a> 7654\n<8a9b> <8abf> 1497\n<8ac0> <8ac0> 7655\n<8ac1> <8aca> 1535\n<8acb> <8acb> 7656\n<8acc> <8ae2> 1546\n<8ae3> <8ae3> 7657\n<8ae4> <8afc> 1570\n<8b40> <8b49> 1595\n<8b4a> <8b4a> 7658\n<8b4b> <8b5e> 1606\n<8b5f> <8b5f> 7659\n<8b60> <8b7e> 1627\n<8b80> <8b81> 1658\n<8b82> <8b82> 7966\n<8b83> <8b87> 1661\n<8b88> <8b88> 7967\n<8b89> <8b9f> 1667\n<8ba0> <8ba0> 7660\n<8ba1> <8ba7> 1691\n<8ba8> <8ba8> 7661\n<8ba9> <8bbf> 1699\n<8bc0> <8bc0> 7968\n<8bc1> <8bcc> 1723\n<8bcd> <8bcd> 7662\n<8bce> <8bea> 1736\n<8beb> <8beb> 7663\n<8bec> <8bf1> 1766\n<8bf2> <8bf2> 7664\n<8bf3> <8bf8> 1773\n<8bf9> <8bf9> 7665\n<8bfa> <8bfa> 1780\n<8bfb> <8bfb> 7666\n<8bfc> <8bfc> 1782\n<8c40> <8c55> 1783\n<8c56> <8c56> 7668\n<8c57> <8c70> 1806\n<8c71> <8c71> 7671\n<8c72> <8c7e> 1833\n<8c80> <8c90> 1846\n<8c91> <8c91> 7674\n<8c92> <8c9c> 1864\n<8c9d> <8c9d> 7969\n<8c9e> <8c9e> 7676\n<8c9f> <8cb1> 1877\n<8cb2> <8cb2> 7677\n<8cb3> <8cbe> 1897\n<8cbf> <8cbf> 7678\n<8cc0> <8cfc> 1910\n<8d40> <8d49> 1971\n<8d4a> <8d4a> 7679\n<8d4b> <8d7e> 1982\n<8d80> <8d8c> 2034\n<8d8d> <8d8d> 7682\n<8d8e> <8d93> 2048\n<8d94> <8d94> 7683\n<8d95> <8d98> 2055\n<8d99> <8d99> 7684\n<8d9a> <8dd0> 2060\n<8dd1> <8dd1> 7685\n<8dd2> <8de4> 2116\n<8de5> <8de5> 7686\n<8de6> <8df1> 2136\n<8df2> <8df2> 7687\n<8df3> <8dfc> 2149\n<8e40> <8e45> 2159\n<8e46> <8e46> 7688\n<8e47> <8e48> 2166\n<8e49> <8e49> 7689\n<8e4a> <8e4a> 2169\n<8e4b> <8e4b> 7690\n<8e4c> <8e57> 2171\n<8e58> <8e58> 7691\n<8e59> <8e5f> 2184\n<8e60> <8e60> 7970\n<8e61> <8e7e> 2192\n<8e80> <8ec5> 2222\n<8ec6> <8ec6> 7693\n<8ec7> <8eda> 2293\n<8edb> <8edc> 7695\n<8edd> <8efc> 2315\n<8f40> <8f49> 2347\n<8f4a> <8f4a> 7697\n<8f4b> <8f54> 2358\n<8f55> <8f55> 7698\n<8f56> <8f7e> 2369\n<8f80> <8f8b> 2410\n<8f8c> <8f8c> 7699\n<8f8d> <8f91> 2423\n<8f92> <8f93> 7701\n<8f94> <8fa2> 2430\n<8fa3> <8fa3> 7703\n<8fa4> <8fb0> 2446\n<8fb1> <8fb1> 7704\n<8fb2> <8fd2> 2460\n<8fd3> <8fd3> 7706\n<8fd4> <8fdc> 2494\n<8fdd> <8fdd> 7707\n<8fde> <8fe1> 2504\nendcidrange\n\n100 begincidrange\n<8fe2> <8fe2> 7708\n<8fe3> <8ffc> 2509\n<9040> <9048> 2535\n<9049> <9049> 7709\n<904a> <9077> 2545\n<9078> <9078> 7971\n<9079> <907e> 2592\n<9080> <9080> 7711\n<9081> <909f> 2599\n<90a0> <90a0> 7713\n<90a1> <90e3> 2631\n<90e4> <90e4> 7715\n<90e5> <90ee> 2699\n<90ef> <90ef> 7716\n<90f0> <90f6> 2710\n<90f7> <90f7> 7718\n<90f8> <90f8> 7972\n<90f9> <90f9> 2719\n<90fa> <90fb> 7973\n<90fc> <90fc> 2722\n<9140> <9145> 2723\n<9146> <9146> 7720\n<9147> <9157> 2730\n<9158> <9158> 7721\n<9159> <916a> 2748\n<916b> <916b> 7722\n<916c> <916d> 2767\n<916e> <916e> 7723\n<916f> <917d> 2770\n<917e> <917e> 7724\n<9180> <9188> 2786\n<9189> <9189> 7725\n<918a> <91b4> 2796\n<91b5> <91b5> 7975\n<91b6> <91ba> 2840\n<91bb> <91bb> 7726\n<91bc> <91ca> 2846\n<91cb> <91cb> 7727\n<91cc> <91d9> 2862\n<91da> <91da> 7728\n<91db> <91e0> 2877\n<91e1> <91e1> 7729\n<91e2> <91ec> 2884\n<91ed> <91ed> 7730\n<91ee> <91fa> 2896\n<91fb> <91fb> 7733\n<91fc> <91fc> 2910\n<9240> <9245> 2911\n<9246> <9246> 7734\n<9247> <9247> 2918\n<9248> <9248> 7735\n<9249> <924b> 2920\n<924c> <924d> 7737\n<924e> <925b> 2925\n<925c> <925c> 7739\n<925d> <927e> 2940\n<9280> <928f> 2974\n<9290> <9290> 7740\n<9291> <9294> 2991\n<9295> <9295> 7741\n<9296> <929b> 2996\n<929c> <929c> 7742\n<929d> <92ba> 3003\n<92bb> <92bb> 7743\n<92bc> <92c5> 3034\n<92c6> <92c6> 7744\n<92c7> <92c7> 3045\n<92c8> <92c8> 7745\n<92c9> <92cc> 3047\n<92cd> <92cd> 7747\n<92ce> <92fc> 3052\n<9340> <9340> 3099\n<9341> <9341> 7748\n<9342> <9345> 3101\n<9346> <9346> 7749\n<9347> <934c> 3106\n<934d> <934d> 7750\n<934e> <9354> 3113\n<9355> <9355> 7751\n<9356> <935d> 3121\n<935e> <935e> 7752\n<935f> <9366> 3130\n<9367> <9367> 7753\n<9368> <9369> 3139\n<936a> <936a> 7754\n<936b> <936f> 3142\n<9370> <9370> 7976\n<9371> <9371> 7756\n<9372> <937e> 3149\n<9380> <9383> 3162\n<9384> <9384> 7757\n<9385> <9397> 3167\n<9398> <9398> 7758\n<9399> <93bf> 3187\n<93c0> <93c0> 7760\n<93c1> <93d1> 3227\n<93d2> <93d2> 7761\n<93d3> <93d8> 3245\n<93d9> <93d9> 7763\n<93da> <93e3> 3252\nendcidrange\n\n100 begincidrange\n<93e4> <93e5> 7766\n<93e6> <93e7> 3264\n<93e8> <93e8> 7768\n<93e9> <93f3> 3267\n<93f4> <93f4> 7872\n<93f5> <93fc> 3279\n<9440> <9447> 3287\n<9448> <9448> 7769\n<9449> <9449> 7977\n<944a> <9457> 3297\n<9458> <9458> 7770\n<9459> <9475> 3312\n<9476> <9476> 7771\n<9477> <947e> 3342\n<9480> <9486> 3350\n<9487> <9487> 7772\n<9488> <9488> 3358\n<9489> <9489> 7773\n<948a> <948c> 3360\n<948d> <948d> 7774\n<948e> <94a1> 3364\n<94a2> <94a2> 7775\n<94a3> <94ab> 3385\n<94ac> <94ac> 7776\n<94ad> <94ad> 3395\n<94ae> <94ae> 7777\n<94af> <94bd> 3397\n<94be> <94be> 7978\n<94bf> <94d1> 3413\n<94d2> <94d2> 7778\n<94d3> <94f2> 3433\n<94f3> <94f3> 7780\n<94f4> <94fc> 3466\n<9540> <9540> 3475\n<9541> <9542> 7781\n<9543> <954d> 3478\n<954e> <954e> 7783\n<954f> <9550> 3490\n<9551> <9551> 7784\n<9552> <9553> 3493\n<9554> <9554> 7785\n<9555> <955e> 3496\n<955f> <955f> 7786\n<9560> <956c> 3507\n<956d> <956d> 7787\n<956e> <957e> 3521\n<9580> <95c0> 3538\n<95c1> <95c1> 7789\n<95c2> <95ca> 3604\n<95cb> <95cb> 7790\n<95cc> <95d0> 3614\n<95d1> <95d1> 7979\n<95d2> <95d7> 3620\n<95d8> <95d8> 7791\n<95d9> <95f6> 3627\n<95f7> <95f7> 7792\n<95f8> <95fc> 3658\n<9640> <9647> 3663\n<9648> <9648> 7794\n<9649> <9669> 3672\n<966a> <966a> 7795\n<966b> <967e> 3706\n<9680> <968f> 3726\n<9690> <9690> 7796\n<9691> <9697> 3743\n<9698> <9698> 7980\n<9699> <96ca> 3751\n<96cb> <96cb> 7797\n<96cc> <96d6> 3802\n<96d7> <96d7> 7798\n<96d8> <96dc> 3814\n<96dd> <96dd> 7799\n<96de> <96df> 3820\n<96e0> <96e0> 7800\n<96e1> <96f7> 3823\n<96f8> <96f8> 7801\n<96f9> <96f9> 3847\n<96fa> <96fa> 7802\n<96fb> <96fc> 3849\n<9740> <9750> 3851\n<9751> <9751> 7804\n<9752> <976e> 3869\n<976f> <976f> 7805\n<9770> <9772> 3899\n<9773> <9773> 7806\n<9774> <977e> 3903\n<9780> <9788> 3914\n<9789> <9789> 7807\n<978a> <97f7> 3924\n<97f8> <97f9> 7809\n<97fa> <97fa> 7981\n<97fb> <97fc> 4037\n<9840> <9840> 7811\n<9841> <984f> 4040\n<9850> <9850> 7812\n<9851> <9857> 4056\n<9858> <9858> 7813\n<9859> <9872> 4064\n<989f> <98fc> 4090\n<9940> <9940> 4184\nendcidrange\n\n100 begincidrange\n<9941> <9941> 7982\n<9942> <995b> 4186\n<995c> <995c> 7814\n<995d> <996b> 4213\n<996c> <996c> 7817\n<996d> <997e> 4229\n<9980> <99b5> 4247\n<99b6> <99b6> 7983\n<99b7> <99fc> 4302\n<9a40> <9a4e> 4372\n<9a4f> <9a4f> 7818\n<9a50> <9a58> 4388\n<9a59> <9a59> 7819\n<9a5a> <9a66> 4398\n<9a67> <9a67> 7984\n<9a68> <9a7c> 4412\n<9a7d> <9a7d> 7821\n<9a7e> <9a7e> 4434\n<9a80> <9a8a> 4435\n<9a8b> <9a8b> 7822\n<9a8c> <9a8c> 7985\n<9a8d> <9ac1> 4448\n<9ac2> <9ac2> 7823\n<9ac3> <9ac3> 7986\n<9ac4> <9ae9> 4503\n<9aea> <9aea> 7987\n<9aeb> <9afc> 4542\n<9b40> <9b5b> 4560\n<9b5c> <9b5c> 7824\n<9b5d> <9b7e> 4589\n<9b80> <9b82> 4623\n<9b83> <9b83> 7825\n<9b84> <9b97> 4627\n<9b98> <9b98> 7988\n<9b99> <9b9f> 4648\n<9ba0> <9ba0> 7826\n<9ba1> <9bfa> 4656\n<9bfb> <9bfc> 7989\n<9c40> <9c7e> 4748\n<9c80> <9ca1> 4811\n<9ca2> <9ca2> 7828\n<9ca3> <9cfc> 4846\n<9d40> <9d46> 4936\n<9d47> <9d47> 7991\n<9d48> <9d7e> 4944\n<9d80> <9d80> 7829\n<9d81> <9d8b> 5000\n<9d8c> <9d8c> 7830\n<9d8d> <9db6> 5012\n<9db7> <9db7> 7831\n<9db8> <9df7> 5055\n<9df8> <9df8> 7992\n<9df9> <9dfc> 5120\n<9e40> <9e63> 5124\n<9e64> <9e64> 7833\n<9e65> <9e7e> 5161\n<9e80> <9e8a> 5187\n<9e8b> <9e8b> 7835\n<9e8c> <9efc> 5199\n<9f40> <9f7e> 5312\n<9f80> <9f80> 5375\n<9f81> <9f81> 7993\n<9f82> <9fcd> 5377\n<9fce> <9fce> 7837\n<9fcf> <9fd3> 5454\n<9fd4> <9fd4> 7994\n<9fd5> <9ff3> 5460\n<9ff4> <9ff4> 7995\n<9ff5> <9ffc> 5492\n<a0> <df>      326\n<e040> <e07e> 5500\n<e080> <e092> 5563\n<e093> <e093> 7838\n<e094> <e0a3> 5583\n<e0a4> <e0a4> 7839\n<e0a5> <e0dc> 5600\n<e0dd> <e0dd> 7840\n<e0de> <e0fc> 5657\n<e140> <e149> 5688\n<e14a> <e14a> 7841\n<e14b> <e17e> 5699\n<e180> <e1ec> 5751\n<e1ed> <e1ed> 7845\n<e1ee> <e1fc> 5861\n<e240> <e268> 5876\n<e269> <e269> 7846\n<e26a> <e272> 5918\n<e273> <e273> 7847\n<e274> <e277> 5928\n<e278> <e278> 7996\n<e279> <e27e> 5933\n<e280> <e2b6> 5939\n<e2b7> <e2b7> 7848\n<e2b8> <e2bd> 5995\n<e2be> <e2be> 7997\n<e2bf> <e2e1> 6002\n<e2e2> <e2e2> 7849\n<e2e3> <e2eb> 6038\n<e2ec> <e2ec> 7850\n<e2ed> <e2fc> 6048\nendcidrange\n\n100 begincidrange\n<e340> <e357> 6064\n<e358> <e358> 7851\n<e359> <e359> 6089\n<e35a> <e35a> 7852\n<e35b> <e364> 6091\n<e365> <e365> 7853\n<e366> <e37e> 6102\n<e380> <e3c6> 6127\n<e3c7> <e3c7> 7998\n<e3c8> <e3fc> 6199\n<e440> <e47e> 6252\n<e480> <e483> 6315\n<e484> <e484> 7855\n<e485> <e488> 6320\n<e489> <e489> 7856\n<e48a> <e491> 6325\n<e492> <e492> 7857\n<e493> <e4b8> 6334\n<e4b9> <e4b9> 7859\n<e4ba> <e4ca> 6373\n<e4cb> <e4cb> 7999\n<e4cc> <e4fc> 6391\n<e540> <e57e> 6440\n<e580> <e59d> 6503\n<e59e> <e59e> 8000\n<e59f> <e5b9> 6534\n<e5ba> <e5bb> 8001\n<e5bc> <e5ec> 6563\n<e5ed> <e5ed> 7864\n<e5ee> <e5fc> 6613\n<e640> <e650> 6628\n<e651> <e651> 7865\n<e652> <e67e> 6646\n<e680> <e685> 6691\n<e686> <e686> 7866\n<e687> <e6e6> 6698\n<e6e7> <e6e7> 7868\n<e6e8> <e6fc> 6795\n<e740> <e76c> 6816\n<e76d> <e76d> 7870\n<e76e> <e77e> 6862\n<e780> <e7a6> 6879\n<e7a7> <e7a7> 7873\n<e7a8> <e7ba> 6919\n<e7bb> <e7bb> 7874\n<e7bc> <e7fc> 6939\n<e840> <e87e> 7004\n<e880> <e8ce> 7067\n<e8cf> <e8cf> 7879\n<e8d0> <e8fc> 7147\n<e940> <e977> 7192\n<e978> <e978> 8003\n<e979> <e97e> 7249\n<e980> <e9aa> 7255\n<e9ab> <e9ab> 7882\n<e9ac> <e9b9> 7299\n<e9ba> <e9ba> 7883\n<e9bb> <e9cb> 7314\n<e9cc> <e9cc> 7884\n<e9cd> <e9fc> 7332\n<ea40> <ea6f> 7380\n<ea70> <ea70> 7885\n<ea71> <ea71> 8004\n<ea72> <ea7e> 7430\n<ea80> <ea9c> 7443\n<ea9d> <ea9d> 7886\n<ea9e> <eaa2> 7473\n<eaa3> <eaa4> 8284\n<ec40> <ec42> 8005\n<ec46> <ec46> 8008\n<ec47> <ec47>  768\n<ec48> <ec48>  762\n<ec49> <ec49>  761\n<ec4d> <ec57> 8009\n<ec5b> <ec5d> 7601\n<ec5e> <ec5e> 8020\n<ec5f> <ec5f> 7607\n<ec60> <ec62> 8021\n<ec63> <ec65> 7604\n<ec66> <ec6f> 8024\n<ec70> <ec70>  771\n<ec71> <ec71> 8034\n<ec72> <ec72>  772\n<ec73> <ec74> 8035\n<ec76> <ec76> 8037\n<ec78> <ec78> 7588\n<ec79> <ec79> 7585\n<ec7a> <ec7a> 8038\n<ec7b> <ec7b> 7586\n<ec7c> <ec7e> 8039\n<ec80> <ec80> 7590\n<ec81> <ec81> 8042\n<ec82> <ec82> 7592\n<ec83> <ec83> 7596\n<ec84> <ec84> 8043\n<ec85> <ec85> 7598\n<ec86> <ec86> 7595\n<ec87> <ec88> 8044\n<ec89> <ec89> 7599\n<ec8a> <ec90> 8046\nendcidrange\n\n35 begincidrange\n<ec94> <ec99> 8053\n<ec9a> <ec9a> 7610\n<ec9b> <ec9b> 8059\n<ec9e> <ec9e> 8060\n<eca7> <ecb0> 8061\n<ecb2> <ecc5> 8071\n<ecc7> <ecda> 7555\n<ecdb> <ecdb> 8091\n<ecdc> <ece5> 7575\n<ece9> <ecfc> 8092\n<ed40> <ed59> 8112\n<ed64> <ed64> 7958\n<ed68> <ed69> 8138\n<ed6a> <ed6a> 7620\n<ed6b> <ed6d> 8140\n<ed6e> <ed6e> 7619\n<ed6f> <ed73> 8143\n<ed74> <ed74> 7618\n<ed75> <ed78> 8148\n<ed7c> <ed7e> 8152\n<ed80> <ed8a> 8155\n<ed8f> <ed9e> 8166\n<ef40> <ef41> 7887\n<ef42> <ef42> 8268\n<ef43> <ef43> 8274\n<ef44> <ef4d> 7889\n<ef4e> <ef4e> 8282\n<ef4f> <ef4f> 8275\n<ef50> <ef50> 8280\n<ef51> <ef51> 8277\n<ef52> <ef63> 7899\n<ef64> <ef79> 7918\n<ef7a> <ef7b> 8264\n<ef8d> <ef90>  736\n<ef91> <ef94> 8182\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/Add-RKSJ-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (Add-RKSJ-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (Add-RKSJ-H)\n%%BeginResource: CMap (Add-RKSJ-V)\n%%Title: (Add-RKSJ-V Adobe Japan1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/Add-RKSJ-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 1 def\nend def\n\n/CMapName /Add-RKSJ-V def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 780 def\n/XUID [1 10 25327] def\n\n/WMode 1 def\n\n57 begincidrange\n<8141> <8142> 7887\n<8143> <8143> 8268\n<8144> <8144> 8274\n<8150> <8151> 7889\n<815b> <815d> 7891\n<8160> <8164> 7894\n<8165> <8165> 8282\n<8166> <8166> 8275\n<8167> <8167> 8280\n<8168> <8168> 8277\n<8169> <817a> 7899\n<829f> <829f> 7918\n<82a1> <82a1> 7919\n<82a3> <82a3> 7920\n<82a5> <82a5> 7921\n<82a7> <82a7> 7922\n<82c1> <82c1> 7923\n<82e1> <82e1> 7924\n<82e3> <82e3> 7925\n<82e5> <82e5> 7926\n<82ec> <82ec> 7927\n<82f3> <82f4> 8264\n<8340> <8340> 7928\n<8342> <8342> 7929\n<8344> <8344> 7930\n<8346> <8346> 7931\n<8348> <8348> 7932\n<8362> <8362> 7933\n<8383> <8383> 7934\n<8385> <8385> 7935\n<8387> <8387> 7936\n<838e> <838e> 7937\n<8395> <8396> 7938\n<ec78> <ec78> 7943\n<ec79> <ec79> 7940\n<ec7a> <ec7a> 8329\n<ec7b> <ec7b> 7941\n<ec7c> <ec7c> 8330\n<ec7d> <ec7e> 8339\n<ec80> <ec80> 7945\n<ec81> <ec81> 8338\n<ec82> <ec82> 7947\n<ec83> <ec83> 7951\n<ec84> <ec84> 8348\n<ec85> <ec85> 7953\n<ec86> <ec86> 7950\n<ec87> <ec87> 8344\n<ec88> <ec88> 8347\n<ec89> <ec89> 7954\n<ec8a> <ec8a> 8343\n<ec8b> <ec8c> 8349\n<ec8d> <ec8d> 8358\n<ec8e> <ec8e> 8357\n<ec8f> <ec8f> 8353\n<ec90> <ec90> 8356\n<ec95> <ec95> 8324\n<ef92> <ef92> 8333\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/Add-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (Add-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (Add-H)\n%%BeginResource: CMap (Add-V)\n%%Title: (Add-V Adobe Japan1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/Add-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 1 def\nend def\n\n/CMapName /Add-V def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 790 def\n/XUID [1 10 25328] def\n\n/WMode 1 def\n\n57 begincidrange\n<2122> <2123> 7887\n<2124> <2124> 8268\n<2125> <2125> 8274\n<2131> <2132> 7889\n<213c> <213e> 7891\n<2141> <2145> 7894\n<2146> <2146> 8282\n<2147> <2147> 8275\n<2148> <2148> 8280\n<2149> <2149> 8277\n<214a> <215b> 7899\n<2421> <2421> 7918\n<2423> <2423> 7919\n<2425> <2425> 7920\n<2427> <2427> 7921\n<2429> <2429> 7922\n<2443> <2443> 7923\n<2463> <2463> 7924\n<2465> <2465> 7925\n<2467> <2467> 7926\n<246e> <246e> 7927\n<2475> <2476> 8264\n<2521> <2521> 7928\n<2523> <2523> 7929\n<2525> <2525> 7930\n<2527> <2527> 7931\n<2529> <2529> 7932\n<2543> <2543> 7933\n<2563> <2563> 7934\n<2565> <2565> 7935\n<2567> <2567> 7936\n<256e> <256e> 7937\n<2575> <2576> 7938\n<7759> <7759> 7943\n<775a> <775a> 7940\n<775b> <775b> 8329\n<775c> <775c> 7941\n<775d> <775d> 8330\n<775e> <775f> 8339\n<7760> <7760> 7945\n<7761> <7761> 8338\n<7762> <7762> 7947\n<7763> <7763> 7951\n<7764> <7764> 8348\n<7765> <7765> 7953\n<7766> <7766> 7950\n<7767> <7767> 8344\n<7768> <7768> 8347\n<7769> <7769> 7954\n<776a> <776a> 8343\n<776b> <776c> 8349\n<776d> <776d> 8358\n<776e> <776e> 8357\n<776f> <776f> 8353\n<7770> <7770> 8356\n<7775> <7775> 8324\n<7d72> <7d72> 8333\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/Adobe-Japan1-0",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe Japan1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 0 def\nend def\n\n/CMapName /Adobe-Japan1-0 def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 480 def\n/XUID [1 10 25358] def\n\n/WMode 0 def\n\n/CIDCount 8284 def\n\n1 begincodespacerange\n  <0000> <20FF>\nendcodespacerange\n\n33 begincidrange\n<0000> <00ff>    0\n<0100> <01ff>  256\n<0200> <02ff>  512\n<0300> <03ff>  768\n<0400> <04ff> 1024\n<0500> <05ff> 1280\n<0600> <06ff> 1536\n<0700> <07ff> 1792\n<0800> <08ff> 2048\n<0900> <09ff> 2304\n<0a00> <0aff> 2560\n<0b00> <0bff> 2816\n<0c00> <0cff> 3072\n<0d00> <0dff> 3328\n<0e00> <0eff> 3584\n<0f00> <0fff> 3840\n<1000> <10ff> 4096\n<1100> <11ff> 4352\n<1200> <12ff> 4608\n<1300> <13ff> 4864\n<1400> <14ff> 5120\n<1500> <15ff> 5376\n<1600> <16ff> 5632\n<1700> <17ff> 5888\n<1800> <18ff> 6144\n<1900> <19ff> 6400\n<1a00> <1aff> 6656\n<1b00> <1bff> 6912\n<1c00> <1cff> 7168\n<1d00> <1dff> 7424\n<1e00> <1eff> 7680\n<1f00> <1fff> 7936\n<2000> <205b> 8192\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/Adobe-Japan1-1",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe Japan1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 1 def\nend def\n\n/CMapName /Adobe-Japan1-1 def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 1030 def\n/XUID [1 10 25530] def\n\n/WMode 0 def\n\n/CIDCount 8359 def\n\n1 begincodespacerange\n  <0000> <20FF>\nendcodespacerange\n\n33 begincidrange\n<0000> <00ff>    0\n<0100> <01ff>  256\n<0200> <02ff>  512\n<0300> <03ff>  768\n<0400> <04ff> 1024\n<0500> <05ff> 1280\n<0600> <06ff> 1536\n<0700> <07ff> 1792\n<0800> <08ff> 2048\n<0900> <09ff> 2304\n<0a00> <0aff> 2560\n<0b00> <0bff> 2816\n<0c00> <0cff> 3072\n<0d00> <0dff> 3328\n<0e00> <0eff> 3584\n<0f00> <0fff> 3840\n<1000> <10ff> 4096\n<1100> <11ff> 4352\n<1200> <12ff> 4608\n<1300> <13ff> 4864\n<1400> <14ff> 5120\n<1500> <15ff> 5376\n<1600> <16ff> 5632\n<1700> <17ff> 5888\n<1800> <18ff> 6144\n<1900> <19ff> 6400\n<1a00> <1aff> 6656\n<1b00> <1bff> 6912\n<1c00> <1cff> 7168\n<1d00> <1dff> 7424\n<1e00> <1eff> 7680\n<1f00> <1fff> 7936\n<2000> <20a6> 8192\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/Adobe-Japan1-2",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe Japan1 2)\n%%Version: 11.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 2 def\nend def\n\n/CMapName /Adobe-Japan1-2 def\n/CMapVersion 11.003 def\n/CMapType 1 def\n\n/UIDOffset 1065 def\n/XUID [1 10 25531] def\n\n/WMode 0 def\n\n/CIDCount 8720 def\n\n1 begincodespacerange\n  <0000> <22FF>\nendcodespacerange\n\n35 begincidrange\n<0000> <00ff>    0\n<0100> <01ff>  256\n<0200> <02ff>  512\n<0300> <03ff>  768\n<0400> <04ff> 1024\n<0500> <05ff> 1280\n<0600> <06ff> 1536\n<0700> <07ff> 1792\n<0800> <08ff> 2048\n<0900> <09ff> 2304\n<0a00> <0aff> 2560\n<0b00> <0bff> 2816\n<0c00> <0cff> 3072\n<0d00> <0dff> 3328\n<0e00> <0eff> 3584\n<0f00> <0fff> 3840\n<1000> <10ff> 4096\n<1100> <11ff> 4352\n<1200> <12ff> 4608\n<1300> <13ff> 4864\n<1400> <14ff> 5120\n<1500> <15ff> 5376\n<1600> <16ff> 5632\n<1700> <17ff> 5888\n<1800> <18ff> 6144\n<1900> <19ff> 6400\n<1a00> <1aff> 6656\n<1b00> <1bff> 6912\n<1c00> <1cff> 7168\n<1d00> <1dff> 7424\n<1e00> <1eff> 7680\n<1f00> <1fff> 7936\n<2000> <20ff> 8192\n<2100> <21ff> 8448\n<2200> <220f> 8704\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/Adobe-Japan1-3",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe Japan1 3)\n%%Version: 1.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 3 def\nend def\n\n/CMapName /Adobe-Japan1-3 def\n/CMapVersion 1.002 def\n/CMapType 1 def\n\n/XUID [1 10 25534] def\n\n/WMode 0 def\n\n/CIDCount 9354 def\n\n1 begincodespacerange\n  <0000> <24FF>\nendcodespacerange\n\n37 begincidrange\n<0000> <00ff> 0\n<0100> <01ff> 256\n<0200> <02ff> 512\n<0300> <03ff> 768\n<0400> <04ff> 1024\n<0500> <05ff> 1280\n<0600> <06ff> 1536\n<0700> <07ff> 1792\n<0800> <08ff> 2048\n<0900> <09ff> 2304\n<0a00> <0aff> 2560\n<0b00> <0bff> 2816\n<0c00> <0cff> 3072\n<0d00> <0dff> 3328\n<0e00> <0eff> 3584\n<0f00> <0fff> 3840\n<1000> <10ff> 4096\n<1100> <11ff> 4352\n<1200> <12ff> 4608\n<1300> <13ff> 4864\n<1400> <14ff> 5120\n<1500> <15ff> 5376\n<1600> <16ff> 5632\n<1700> <17ff> 5888\n<1800> <18ff> 6144\n<1900> <19ff> 6400\n<1a00> <1aff> 6656\n<1b00> <1bff> 6912\n<1c00> <1cff> 7168\n<1d00> <1dff> 7424\n<1e00> <1eff> 7680\n<1f00> <1fff> 7936\n<2000> <20ff> 8192\n<2100> <21ff> 8448\n<2200> <22ff> 8704\n<2300> <23ff> 8960\n<2400> <2489> 9216\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/Adobe-Japan1-4",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe Japan1 4)\n%%Version: 1.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 4 def\nend def\n\n/CMapName /Adobe-Japan1-4 def\n/CMapVersion 1.002 def\n/CMapType 1 def\n\n/XUID [1 10 25537] def\n\n/WMode 0 def\n\n/CIDCount 15444 def\n\n1 begincodespacerange\n  <0000> <3CFF>\nendcodespacerange\n\n61 begincidrange\n<0000> <00ff> 0\n<0100> <01ff> 256\n<0200> <02ff> 512\n<0300> <03ff> 768\n<0400> <04ff> 1024\n<0500> <05ff> 1280\n<0600> <06ff> 1536\n<0700> <07ff> 1792\n<0800> <08ff> 2048\n<0900> <09ff> 2304\n<0a00> <0aff> 2560\n<0b00> <0bff> 2816\n<0c00> <0cff> 3072\n<0d00> <0dff> 3328\n<0e00> <0eff> 3584\n<0f00> <0fff> 3840\n<1000> <10ff> 4096\n<1100> <11ff> 4352\n<1200> <12ff> 4608\n<1300> <13ff> 4864\n<1400> <14ff> 5120\n<1500> <15ff> 5376\n<1600> <16ff> 5632\n<1700> <17ff> 5888\n<1800> <18ff> 6144\n<1900> <19ff> 6400\n<1a00> <1aff> 6656\n<1b00> <1bff> 6912\n<1c00> <1cff> 7168\n<1d00> <1dff> 7424\n<1e00> <1eff> 7680\n<1f00> <1fff> 7936\n<2000> <20ff> 8192\n<2100> <21ff> 8448\n<2200> <22ff> 8704\n<2300> <23ff> 8960\n<2400> <24ff> 9216\n<2500> <25ff> 9472\n<2600> <26ff> 9728\n<2700> <27ff> 9984\n<2800> <28ff> 10240\n<2900> <29ff> 10496\n<2a00> <2aff> 10752\n<2b00> <2bff> 11008\n<2c00> <2cff> 11264\n<2d00> <2dff> 11520\n<2e00> <2eff> 11776\n<2f00> <2fff> 12032\n<3000> <30ff> 12288\n<3100> <31ff> 12544\n<3200> <32ff> 12800\n<3300> <33ff> 13056\n<3400> <34ff> 13312\n<3500> <35ff> 13568\n<3600> <36ff> 13824\n<3700> <37ff> 14080\n<3800> <38ff> 14336\n<3900> <39ff> 14592\n<3a00> <3aff> 14848\n<3b00> <3bff> 15104\n<3c00> <3c53> 15360\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/Adobe-Japan1-5",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe Japan1 5)\n%%Version: 1.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 5 def\nend def\n\n/CMapName /Adobe-Japan1-5 def\n/CMapVersion 1.002 def\n/CMapType 1 def\n\n/XUID [1 10 25613] def\n\n/WMode 0 def\n\n/CIDCount 20317 def\n\n1 begincodespacerange\n  <0000> <4FFF>\nendcodespacerange\n\n80 begincidrange\n<0000> <00ff> 0\n<0100> <01ff> 256\n<0200> <02ff> 512\n<0300> <03ff> 768\n<0400> <04ff> 1024\n<0500> <05ff> 1280\n<0600> <06ff> 1536\n<0700> <07ff> 1792\n<0800> <08ff> 2048\n<0900> <09ff> 2304\n<0a00> <0aff> 2560\n<0b00> <0bff> 2816\n<0c00> <0cff> 3072\n<0d00> <0dff> 3328\n<0e00> <0eff> 3584\n<0f00> <0fff> 3840\n<1000> <10ff> 4096\n<1100> <11ff> 4352\n<1200> <12ff> 4608\n<1300> <13ff> 4864\n<1400> <14ff> 5120\n<1500> <15ff> 5376\n<1600> <16ff> 5632\n<1700> <17ff> 5888\n<1800> <18ff> 6144\n<1900> <19ff> 6400\n<1a00> <1aff> 6656\n<1b00> <1bff> 6912\n<1c00> <1cff> 7168\n<1d00> <1dff> 7424\n<1e00> <1eff> 7680\n<1f00> <1fff> 7936\n<2000> <20ff> 8192\n<2100> <21ff> 8448\n<2200> <22ff> 8704\n<2300> <23ff> 8960\n<2400> <24ff> 9216\n<2500> <25ff> 9472\n<2600> <26ff> 9728\n<2700> <27ff> 9984\n<2800> <28ff> 10240\n<2900> <29ff> 10496\n<2a00> <2aff> 10752\n<2b00> <2bff> 11008\n<2c00> <2cff> 11264\n<2d00> <2dff> 11520\n<2e00> <2eff> 11776\n<2f00> <2fff> 12032\n<3000> <30ff> 12288\n<3100> <31ff> 12544\n<3200> <32ff> 12800\n<3300> <33ff> 13056\n<3400> <34ff> 13312\n<3500> <35ff> 13568\n<3600> <36ff> 13824\n<3700> <37ff> 14080\n<3800> <38ff> 14336\n<3900> <39ff> 14592\n<3a00> <3aff> 14848\n<3b00> <3bff> 15104\n<3c00> <3cff> 15360\n<3d00> <3dff> 15616\n<3e00> <3eff> 15872\n<3f00> <3fff> 16128\n<4000> <40ff> 16384\n<4100> <41ff> 16640\n<4200> <42ff> 16896\n<4300> <43ff> 17152\n<4400> <44ff> 17408\n<4500> <45ff> 17664\n<4600> <46ff> 17920\n<4700> <47ff> 18176\n<4800> <48ff> 18432\n<4900> <49ff> 18688\n<4a00> <4aff> 18944\n<4b00> <4bff> 19200\n<4c00> <4cff> 19456\n<4d00> <4dff> 19712\n<4e00> <4eff> 19968\n<4f00> <4f5c> 20224\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/Adobe-Japan1-6",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe Japan1 6)\n%%Version: 1.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 6 def\nend def\n\n/CMapName /Adobe-Japan1-6 def\n/CMapVersion 1.003 def\n/CMapType 1 def\n\n/XUID [1 10 25614] def\n\n/WMode 0 def\n\n/CIDCount 23058 def\n\n1 begincodespacerange\n  <0000> <5AFF>\nendcodespacerange\n\n91 begincidrange\n<0000> <00ff> 0\n<0100> <01ff> 256\n<0200> <02ff> 512\n<0300> <03ff> 768\n<0400> <04ff> 1024\n<0500> <05ff> 1280\n<0600> <06ff> 1536\n<0700> <07ff> 1792\n<0800> <08ff> 2048\n<0900> <09ff> 2304\n<0a00> <0aff> 2560\n<0b00> <0bff> 2816\n<0c00> <0cff> 3072\n<0d00> <0dff> 3328\n<0e00> <0eff> 3584\n<0f00> <0fff> 3840\n<1000> <10ff> 4096\n<1100> <11ff> 4352\n<1200> <12ff> 4608\n<1300> <13ff> 4864\n<1400> <14ff> 5120\n<1500> <15ff> 5376\n<1600> <16ff> 5632\n<1700> <17ff> 5888\n<1800> <18ff> 6144\n<1900> <19ff> 6400\n<1a00> <1aff> 6656\n<1b00> <1bff> 6912\n<1c00> <1cff> 7168\n<1d00> <1dff> 7424\n<1e00> <1eff> 7680\n<1f00> <1fff> 7936\n<2000> <20ff> 8192\n<2100> <21ff> 8448\n<2200> <22ff> 8704\n<2300> <23ff> 8960\n<2400> <24ff> 9216\n<2500> <25ff> 9472\n<2600> <26ff> 9728\n<2700> <27ff> 9984\n<2800> <28ff> 10240\n<2900> <29ff> 10496\n<2a00> <2aff> 10752\n<2b00> <2bff> 11008\n<2c00> <2cff> 11264\n<2d00> <2dff> 11520\n<2e00> <2eff> 11776\n<2f00> <2fff> 12032\n<3000> <30ff> 12288\n<3100> <31ff> 12544\n<3200> <32ff> 12800\n<3300> <33ff> 13056\n<3400> <34ff> 13312\n<3500> <35ff> 13568\n<3600> <36ff> 13824\n<3700> <37ff> 14080\n<3800> <38ff> 14336\n<3900> <39ff> 14592\n<3a00> <3aff> 14848\n<3b00> <3bff> 15104\n<3c00> <3cff> 15360\n<3d00> <3dff> 15616\n<3e00> <3eff> 15872\n<3f00> <3fff> 16128\n<4000> <40ff> 16384\n<4100> <41ff> 16640\n<4200> <42ff> 16896\n<4300> <43ff> 17152\n<4400> <44ff> 17408\n<4500> <45ff> 17664\n<4600> <46ff> 17920\n<4700> <47ff> 18176\n<4800> <48ff> 18432\n<4900> <49ff> 18688\n<4a00> <4aff> 18944\n<4b00> <4bff> 19200\n<4c00> <4cff> 19456\n<4d00> <4dff> 19712\n<4e00> <4eff> 19968\n<4f00> <4fff> 20224\n<5000> <50ff> 20480\n<5100> <51ff> 20736\n<5200> <52ff> 20992\n<5300> <53ff> 21248\n<5400> <54ff> 21504\n<5500> <55ff> 21760\n<5600> <56ff> 22016\n<5700> <57ff> 22272\n<5800> <58ff> 22528\n<5900> <59ff> 22784\n<5a00> <5a11> 23040\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/Adobe-Japan1-UCS2",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Adobe-Japan1-UCS2)\n%%Title: (Adobe-Japan1-UCS2 Adobe Japan1 6)\n%%Version: 8.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Adobe_Japan1_UCS2) def\n  /Supplement 6 def\nend def\n\n/CMapName /Adobe-Japan1-UCS2 def\n/CMapVersion 8.002 def\n/CMapType 2 def\n\n/XUID [1 10 25335 1212] def\n\n/WMode 0 def\n\n1 begincodespacerange\n  <0000> <FFFF>\nendcodespacerange\n\n100 beginbfchar\n<0000> <fffd>\n<003d> <00a5>\n<005d> <00a6>\n<005e> <007d>\n<005f> <0303>\n<0060> <2019>\n<0061> <005c>\n<0062> <2018>\n<0063> <007c>\n<0064> <007e>\n<0068> <2044>\n<0069> <0192>\n<006a> <00a7>\n<006b> <00a4>\n<006c> <201c>\n<006d> <00ab>\n<0072> <2012>\n<0075> <00b7>\n<0076> <00b6>\n<0077> <2022>\n<0078> <201a>\n<0079> <201e>\n<007a> <201d>\n<007b> <00bb>\n<007c> <2026>\n<007d> <2030>\n<007e> <00bf>\n<0081> <00af>\n<0085> <030a>\n<0086> <00b8>\n<0087> <030b>\n<0088> <0328>\n<0089> <030c>\n<008a> <0336>\n<008b> <00c6>\n<008c> <00aa>\n<008d> <0141>\n<008e> <00d8>\n<008f> <0152>\n<0090> <00ba>\n<0091> <00e6>\n<0092> <0131>\n<0093> <0142>\n<0094> <00f8>\n<0095> <0153>\n<0096> <00df>\n<0097> <002d>\n<0098> <00a9>\n<0099> <00ac>\n<009a> <00ae>\n<009f> <00b5>\n<00a0> <00b9>\n<00df> <0160>\n<00e0> <0178>\n<00e1> <017d>\n<00e2> <0305>\n<00e3> <0161>\n<00e4> <2122>\n<00e5> <017e>\n<00e6> <0030>\n<0123> <00a5>\n<0145> <203e>\n<0186> <ff40>\n<0189> <30ee>\n<018a> <30ab>\n<018b> <30b1>\n<018c> <30f4>\n<018d> <30ac>\n<018e> <30ae>\n<018f> <30b0>\n<0190> <30b2>\n<0191> <30b4>\n<0192> <30b6>\n<0193> <30b8>\n<0194> <30ba>\n<0195> <30bc>\n<0196> <30be>\n<0197> <30c0>\n<0198> <30c2>\n<0199> <30c5>\n<019a> <30c7>\n<019b> <30c9>\n<01a6> <ff60>\n<01f5> <2032>\n<01f6> <00a8>\n<01f7> <2036>\n<01f8> <005b>\n<01f9> <005d>\n<0202> <2012>\n<0203> <ff60>\n<0204> <3092>\n<0205> <3041>\n<0206> <3043>\n<0207> <3045>\n<0208> <3047>\n<0209> <3049>\n<020a> <3083>\n<020b> <3085>\n<020c> <3087>\n<020d> <3063>\nendbfchar\n\n100 beginbfchar\n<020e> <3042>\n<020f> <3044>\n<0210> <3046>\n<0211> <3048>\n<0214> <304d>\n<0215> <304f>\n<0216> <3051>\n<0217> <3053>\n<0218> <3055>\n<0219> <3057>\n<021a> <3059>\n<021b> <305b>\n<021c> <305d>\n<021d> <305f>\n<021e> <3061>\n<021f> <3064>\n<0220> <3066>\n<0221> <3068>\n<0228> <3072>\n<0229> <3075>\n<022a> <3078>\n<022b> <307b>\n<0231> <3084>\n<0232> <3086>\n<0239> <308f>\n<023a> <3093>\n<023d> <308e>\n<023e> <304c>\n<023f> <304e>\n<0240> <3050>\n<0241> <3052>\n<0242> <3054>\n<0243> <3056>\n<0244> <3068>\n<0245> <305a>\n<0246> <305c>\n<0247> <305e>\n<0248> <3060>\n<0249> <3062>\n<024a> <3065>\n<024b> <3067>\n<024c> <3069>\n<0257> <00c4>\n<0258> <00f9>\n<0259> <00e9>\n<025a> <00ed>\n<025b> <00df>\n<025c> <00e7>\n<025d> <00c7>\n<025e> <00d1>\n<025f> <00f1>\n<0262> <00f3>\n<0263> <00fa>\n<0264> <00a1>\n<0265> <00bf>\n<0266> <00bd>\n<0267> <00d6>\n<0268> <00dc>\n<0269> <00e4>\n<026a> <00eb>\n<026b> <00ef>\n<026c> <00f6>\n<026d> <00dc>\n<026e> <00e2>\n<026f> <00ea>\n<0270> <00ee>\n<0271> <00f4>\n<0272> <00fc>\n<0273> <00e0>\n<0274> <00e9>\n<0275> <25b2>\n<0276> <00e1>\n<0277> <007e>\n<0278> <0030>\n<027c> <ff0c>\n<027d> <ff0e>\n<027e> <30fb>\n<0281> <ff1f>\n<0282> <ff01>\n<0285> <00b4>\n<0286> <ff40>\n<0287> <00a8>\n<0288> <ff3e>\n<0289> <203e>\n<028a> <ff3f>\n<028f> <3003>\n<0290> <4edd>\n<0294> <30fc>\n<0295> <2015>\n<0296> <2010>\n<0297> <ff0f>\n<0298> <ff3c>\n<0299> <ff5e>\n<029a> <2016>\n<029b> <ff5c>\n<029c> <2026>\n<029d> <2025>\n<02a6> <ff3b>\n<02a7> <ff3d>\n<02a8> <ff5b>\nendbfchar\n\n100 beginbfchar\n<02a9> <ff5d>\n<02b4> <ff0b>\n<02b5> <ff0d>\n<02b6> <00b1>\n<02b7> <00d7>\n<02b8> <00f7>\n<02b9> <ff1d>\n<02ba> <2260>\n<02bb> <ff1c>\n<02bc> <ff1e>\n<02bf> <221e>\n<02c0> <2234>\n<02c1> <2642>\n<02c2> <2640>\n<02c3> <00b0>\n<02c6> <2103>\n<02c7> <ffe5>\n<02c8> <ff04>\n<02cb> <ff05>\n<02cc> <ff03>\n<02cd> <ff06>\n<02ce> <ff0a>\n<02cf> <ff20>\n<02d0> <00a7>\n<02d1> <2606>\n<02d2> <2605>\n<02d3> <25cb>\n<02d4> <25cf>\n<02d5> <25ce>\n<02d6> <25c7>\n<02d7> <25c6>\n<02d8> <25a1>\n<02d9> <25a0>\n<02da> <25b3>\n<02db> <25b2>\n<02dc> <25bd>\n<02dd> <25bc>\n<02de> <203b>\n<02df> <3012>\n<02e0> <2192>\n<02e3> <2193>\n<02e4> <3013>\n<02e5> <2208>\n<02e6> <220b>\n<02eb> <222a>\n<02ec> <2229>\n<02ef> <00ac>\n<02f0> <21d2>\n<02f1> <21d4>\n<02f2> <2200>\n<02f3> <2203>\n<02f4> <2220>\n<02f5> <22a5>\n<02f6> <2312>\n<02f7> <2202>\n<02f8> <2207>\n<02f9> <2261>\n<02fa> <2252>\n<02fd> <221a>\n<02fe> <223d>\n<02ff> <221d>\n<0300> <2235>\n<0303> <212b>\n<0304> <2030>\n<0305> <266f>\n<0306> <266d>\n<0307> <266a>\n<030a> <00b6>\n<030b> <25ef>\n<0429> <0401>\n<044a> <0451>\n<0465> <4e9c>\n<0466> <5516>\n<0467> <5a03>\n<0468> <963f>\n<0469> <54c0>\n<046a> <611b>\n<046b> <6328>\n<046c> <59f6>\n<046d> <9022>\n<046e> <8475>\n<046f> <831c>\n<0470> <7a50>\n<0471> <60aa>\n<0472> <63e1>\n<0473> <6e25>\n<0474> <65ed>\n<0475> <8466>\n<0476> <82a6>\n<0477> <9bf5>\n<0478> <6893>\n<0479> <5727>\n<047a> <65a1>\n<047b> <6271>\n<047c> <5b9b>\n<047d> <59d0>\n<047e> <867b>\n<047f> <98f4>\n<0480> <7d62>\n<0481> <7dbe>\nendbfchar\n\n100 beginbfchar\n<0482> <9b8e>\n<0483> <6216>\n<0484> <7c9f>\n<0485> <88b7>\n<0486> <5b89>\n<0487> <5eb5>\n<0488> <6309>\n<0489> <6697>\n<048a> <6848>\n<048b> <95c7>\n<048c> <978d>\n<048d> <674f>\n<048e> <4ee5>\n<048f> <4f0a>\n<0490> <4f4d>\n<0491> <4f9d>\n<0492> <5049>\n<0493> <56f2>\n<0494> <5937>\n<0495> <59d4>\n<0496> <5a01>\n<0497> <5c09>\n<0498> <60df>\n<0499> <610f>\n<049a> <6170>\n<049b> <6613>\n<049c> <6905>\n<049d> <70ba>\n<049e> <754f>\n<049f> <7570>\n<04a0> <79fb>\n<04a1> <7dad>\n<04a2> <7def>\n<04a3> <80c3>\n<04a4> <840e>\n<04a5> <8863>\n<04a6> <8b02>\n<04a7> <9055>\n<04a8> <907a>\n<04a9> <533b>\n<04aa> <4e95>\n<04ab> <4ea5>\n<04ac> <57df>\n<04ad> <80b2>\n<04ae> <90c1>\n<04af> <78ef>\n<04b0> <4e00>\n<04b1> <58f1>\n<04b2> <6ea2>\n<04b3> <9038>\n<04b4> <7a32>\n<04b5> <8328>\n<04b6> <828b>\n<04b7> <9c2f>\n<04b8> <5141>\n<04b9> <5370>\n<04ba> <54bd>\n<04bb> <54e1>\n<04bc> <56e0>\n<04bd> <59fb>\n<04be> <5f15>\n<04bf> <98f2>\n<04c0> <6deb>\n<04c1> <80e4>\n<04c2> <852d>\n<04c3> <9662>\n<04c4> <9670>\n<04c5> <96a0>\n<04c6> <97fb>\n<04c7> <540b>\n<04c8> <53f3>\n<04c9> <5b87>\n<04ca> <70cf>\n<04cb> <7fbd>\n<04cc> <8fc2>\n<04cd> <96e8>\n<04ce> <536f>\n<04cf> <9d5c>\n<04d0> <7aba>\n<04d1> <4e11>\n<04d2> <7893>\n<04d3> <81fc>\n<04d4> <6e26>\n<04d5> <5618>\n<04d6> <5504>\n<04d7> <6b1d>\n<04d8> <851a>\n<04d9> <9c3b>\n<04da> <59e5>\n<04db> <53a9>\n<04dc> <6d66>\n<04dd> <74dc>\n<04de> <958f>\n<04df> <5642>\n<04e0> <4e91>\n<04e1> <904b>\n<04e2> <96f2>\n<04e3> <834f>\n<04e4> <990c>\n<04e5> <53e1>\nendbfchar\n\n100 beginbfchar\n<04e6> <55b6>\n<04e7> <5b30>\n<04e8> <5f71>\n<04e9> <6620>\n<04ea> <66f3>\n<04eb> <6804>\n<04ec> <6c38>\n<04ed> <6cf3>\n<04ee> <6d29>\n<04ef> <745b>\n<04f0> <76c8>\n<04f1> <7a4e>\n<04f2> <9834>\n<04f3> <82f1>\n<04f4> <885b>\n<04f5> <8a60>\n<04f6> <92ed>\n<04f7> <6db2>\n<04f8> <75ab>\n<04f9> <76ca>\n<04fa> <99c5>\n<04fb> <60a6>\n<04fc> <8b01>\n<04fd> <8d8a>\n<04fe> <95b2>\n<04ff> <698e>\n<0500> <53ad>\n<0501> <5186>\n<0502> <5712>\n<0503> <5830>\n<0504> <5944>\n<0505> <5bb4>\n<0506> <5ef6>\n<0507> <6028>\n<0508> <63a9>\n<0509> <63f4>\n<050a> <6cbf>\n<050b> <6f14>\n<050c> <708e>\n<050d> <7114>\n<050e> <7159>\n<050f> <71d5>\n<0510> <733f>\n<0511> <7e01>\n<0512> <8276>\n<0513> <82d1>\n<0514> <8597>\n<0515> <9060>\n<0516> <925b>\n<0517> <9d1b>\n<0518> <5869>\n<0519> <65bc>\n<051a> <6c5a>\n<051b> <7525>\n<051c> <51f9>\n<051d> <592e>\n<051e> <5965>\n<051f> <5f80>\n<0520> <5fdc>\n<0521> <62bc>\n<0522> <65fa>\n<0523> <6a2a>\n<0524> <6b27>\n<0525> <6bb4>\n<0526> <738b>\n<0527> <7fc1>\n<0528> <8956>\n<0529> <9d2c>\n<052a> <9d0e>\n<052b> <9ec4>\n<052c> <5ca1>\n<052d> <6c96>\n<052e> <837b>\n<052f> <5104>\n<0530> <5c4b>\n<0531> <61b6>\n<0532> <81c6>\n<0533> <6876>\n<0534> <7261>\n<0535> <4e59>\n<0536> <4ffa>\n<0537> <5378>\n<0538> <6069>\n<0539> <6e29>\n<053a> <7a4f>\n<053b> <97f3>\n<053c> <4e0b>\n<053d> <5316>\n<053e> <4eee>\n<053f> <4f55>\n<0540> <4f3d>\n<0541> <4fa1>\n<0542> <4f73>\n<0543> <52a0>\n<0544> <53ef>\n<0545> <5609>\n<0546> <590f>\n<0547> <5ac1>\n<0548> <5bb6>\n<0549> <5be1>\nendbfchar\n\n100 beginbfchar\n<054a> <79d1>\n<054b> <6687>\n<054c> <679c>\n<054d> <67b6>\n<054e> <6b4c>\n<054f> <6cb3>\n<0550> <706b>\n<0551> <73c2>\n<0552> <798d>\n<0553> <79be>\n<0554> <7a3c>\n<0555> <7b87>\n<0556> <82b1>\n<0557> <82db>\n<0558> <8304>\n<0559> <8377>\n<055a> <83ef>\n<055b> <83d3>\n<055c> <8766>\n<055d> <8ab2>\n<055e> <5629>\n<055f> <8ca8>\n<0560> <8fe6>\n<0561> <904e>\n<0562> <971e>\n<0563> <868a>\n<0564> <4fc4>\n<0565> <5ce8>\n<0566> <6211>\n<0567> <7259>\n<0568> <753b>\n<0569> <81e5>\n<056a> <82bd>\n<056b> <86fe>\n<056c> <8cc0>\n<056d> <96c5>\n<056e> <9913>\n<056f> <99d5>\n<0570> <4ecb>\n<0571> <4f1a>\n<0572> <89e3>\n<0573> <56de>\n<0574> <584a>\n<0575> <58ca>\n<0576> <5efb>\n<0577> <5feb>\n<0578> <602a>\n<0579> <6094>\n<057a> <6062>\n<057b> <61d0>\n<057c> <6212>\n<057d> <62d0>\n<057e> <6539>\n<057f> <9b41>\n<0580> <6666>\n<0581> <68b0>\n<0582> <6d77>\n<0583> <7070>\n<0584> <754c>\n<0585> <7686>\n<0586> <7d75>\n<0587> <82a5>\n<0588> <87f9>\n<0589> <958b>\n<058a> <968e>\n<058b> <8c9d>\n<058c> <51f1>\n<058d> <52be>\n<058e> <5916>\n<058f> <54b3>\n<0590> <5bb3>\n<0591> <5d16>\n<0592> <6168>\n<0593> <6982>\n<0594> <6daf>\n<0595> <788d>\n<0596> <84cb>\n<0597> <8857>\n<0598> <8a72>\n<0599> <93a7>\n<059a> <9ab8>\n<059b> <6d6c>\n<059c> <99a8>\n<059d> <86d9>\n<059e> <57a3>\n<059f> <67ff>\n<05a0> <86ce>\n<05a1> <920e>\n<05a2> <5283>\n<05a3> <5687>\n<05a4> <5404>\n<05a5> <5ed3>\n<05a6> <62e1>\n<05a7> <64b9>\n<05a8> <683c>\n<05a9> <6838>\n<05aa> <6bbb>\n<05ab> <7372>\n<05ac> <78ba>\n<05ad> <7a6b>\nendbfchar\n\n100 beginbfchar\n<05ae> <899a>\n<05af> <89d2>\n<05b0> <8d6b>\n<05b1> <8f03>\n<05b2> <90ed>\n<05b3> <95a3>\n<05b4> <9694>\n<05b5> <9769>\n<05b6> <5b66>\n<05b7> <5cb3>\n<05b8> <697d>\n<05bb> <639b>\n<05bc> <7b20>\n<05bd> <6a2b>\n<05be> <6a7f>\n<05bf> <68b6>\n<05c0> <9c0d>\n<05c1> <6f5f>\n<05c2> <5272>\n<05c3> <559d>\n<05c4> <6070>\n<05c5> <62ec>\n<05c6> <6d3b>\n<05c7> <6e07>\n<05c8> <6ed1>\n<05c9> <845b>\n<05ca> <8910>\n<05cb> <8f44>\n<05cc> <4e14>\n<05cd> <9c39>\n<05ce> <53f6>\n<05cf> <691b>\n<05d0> <6a3a>\n<05d1> <9784>\n<05d2> <682a>\n<05d3> <515c>\n<05d4> <7ac3>\n<05d5> <84b2>\n<05d6> <91dc>\n<05d7> <938c>\n<05d8> <565b>\n<05d9> <9d28>\n<05da> <6822>\n<05db> <8305>\n<05dc> <8431>\n<05dd> <7ca5>\n<05de> <5208>\n<05df> <82c5>\n<05e0> <74e6>\n<05e1> <4e7e>\n<05e2> <4f83>\n<05e3> <51a0>\n<05e4> <5bd2>\n<05e5> <520a>\n<05e6> <52d8>\n<05e7> <52e7>\n<05e8> <5dfb>\n<05e9> <559a>\n<05ea> <582a>\n<05eb> <59e6>\n<05ec> <5b8c>\n<05ed> <5b98>\n<05ee> <5bdb>\n<05ef> <5e72>\n<05f0> <5e79>\n<05f1> <60a3>\n<05f2> <611f>\n<05f3> <6163>\n<05f4> <61be>\n<05f5> <63db>\n<05f6> <6562>\n<05f7> <67d1>\n<05f8> <6853>\n<05f9> <68fa>\n<05fa> <6b3e>\n<05fb> <6b53>\n<05fc> <6c57>\n<05fd> <6f22>\n<05fe> <6f97>\n<05ff> <6f45>\n<0600> <74b0>\n<0601> <7518>\n<0602> <76e3>\n<0603> <770b>\n<0604> <7aff>\n<0605> <7ba1>\n<0606> <7c21>\n<0607> <7de9>\n<0608> <7f36>\n<0609> <7ff0>\n<060a> <809d>\n<060b> <8266>\n<060c> <839e>\n<060d> <89b3>\n<060e> <8acc>\n<060f> <8cab>\n<0610> <9084>\n<0611> <9451>\n<0612> <9593>\n<0613> <9591>\nendbfchar\n\n100 beginbfchar\n<0614> <95a2>\n<0615> <9665>\n<0616> <97d3>\n<0617> <9928>\n<0618> <8218>\n<0619> <4e38>\n<061a> <542b>\n<061b> <5cb8>\n<061c> <5dcc>\n<061d> <73a9>\n<061e> <764c>\n<061f> <773c>\n<0620> <5ca9>\n<0621> <7feb>\n<0622> <8d0b>\n<0623> <96c1>\n<0624> <9811>\n<0625> <9854>\n<0626> <9858>\n<0627> <4f01>\n<0628> <4f0e>\n<0629> <5371>\n<062a> <559c>\n<062b> <5668>\n<062c> <57fa>\n<062d> <5947>\n<062e> <5b09>\n<062f> <5bc4>\n<0630> <5c90>\n<0631> <5e0c>\n<0632> <5e7e>\n<0633> <5fcc>\n<0634> <63ee>\n<0635> <673a>\n<0636> <65d7>\n<0637> <65e2>\n<0638> <671f>\n<0639> <68cb>\n<063a> <68c4>\n<063b> <6a5f>\n<063c> <5e30>\n<063d> <6bc5>\n<063e> <6c17>\n<063f> <6c7d>\n<0640> <757f>\n<0641> <7948>\n<0642> <5b63>\n<0643> <7a00>\n<0644> <7d00>\n<0645> <5fbd>\n<0646> <898f>\n<0647> <8a18>\n<0648> <8cb4>\n<0649> <8d77>\n<064a> <8ecc>\n<064b> <8f1d>\n<064c> <98e2>\n<064d> <9a0e>\n<064e> <9b3c>\n<064f> <4e80>\n<0650> <507d>\n<0651> <5100>\n<0652> <5993>\n<0653> <5b9c>\n<0654> <622f>\n<0655> <6280>\n<0656> <64ec>\n<0657> <6b3a>\n<0658> <72a0>\n<0659> <7591>\n<065a> <7947>\n<065b> <7fa9>\n<065c> <87fb>\n<065d> <8abc>\n<065e> <8b70>\n<065f> <63ac>\n<0660> <83ca>\n<0661> <97a0>\n<0662> <5409>\n<0663> <5403>\n<0664> <55ab>\n<0665> <6854>\n<0666> <6a58>\n<0667> <8a70>\n<0668> <7827>\n<0669> <6775>\n<066a> <9ecd>\n<066b> <5374>\n<066c> <5ba2>\n<066d> <811a>\n<066e> <8650>\n<066f> <9006>\n<0670> <4e18>\n<0671> <4e45>\n<0672> <4ec7>\n<0673> <4f11>\n<0674> <53ca>\n<0675> <5438>\n<0676> <5bae>\n<0677> <5f13>\nendbfchar\n\n100 beginbfchar\n<0678> <6025>\n<0679> <6551>\n<067a> <673d>\n<067b> <6c42>\n<067c> <6c72>\n<067d> <6ce3>\n<067e> <7078>\n<067f> <7403>\n<0680> <7a76>\n<0681> <7aae>\n<0682> <7b08>\n<0683> <7d1a>\n<0684> <7cfe>\n<0685> <7d66>\n<0686> <65e7>\n<0687> <725b>\n<0688> <53bb>\n<0689> <5c45>\n<068a> <5de8>\n<068b> <62d2>\n<068c> <62e0>\n<068d> <6319>\n<068e> <6e20>\n<068f> <865a>\n<0690> <8a31>\n<0691> <8ddd>\n<0692> <92f8>\n<0693> <6f01>\n<0694> <79a6>\n<0695> <9b5a>\n<0696> <4ea8>\n<0699> <4f9b>\n<069a> <4fa0>\n<069b> <50d1>\n<069c> <5147>\n<069d> <7af6>\n<069e> <5171>\n<069f> <51f6>\n<06a0> <5354>\n<06a1> <5321>\n<06a2> <537f>\n<06a3> <53eb>\n<06a4> <55ac>\n<06a5> <5883>\n<06a6> <5ce1>\n<06a7> <5f37>\n<06a8> <5f4a>\n<06a9> <602f>\n<06aa> <6050>\n<06ab> <606d>\n<06ac> <631f>\n<06ad> <6559>\n<06ae> <6a4b>\n<06af> <6cc1>\n<06b0> <72c2>\n<06b1> <72ed>\n<06b2> <77ef>\n<06b3> <80f8>\n<06b4> <8105>\n<06b5> <8208>\n<06b6> <854e>\n<06b7> <90f7>\n<06b8> <93e1>\n<06b9> <97ff>\n<06ba> <9957>\n<06bb> <9a5a>\n<06bc> <4ef0>\n<06bd> <51dd>\n<06be> <5c2d>\n<06bf> <6681>\n<06c0> <696d>\n<06c1> <5c40>\n<06c2> <66f2>\n<06c3> <6975>\n<06c4> <7389>\n<06c5> <6850>\n<06c6> <7c81>\n<06c7> <50c5>\n<06c8> <52e4>\n<06c9> <5747>\n<06ca> <5dfe>\n<06cb> <9326>\n<06cc> <65a4>\n<06cd> <6b23>\n<06ce> <6b3d>\n<06cf> <7434>\n<06d0> <7981>\n<06d1> <79bd>\n<06d2> <7b4b>\n<06d3> <7dca>\n<06d4> <82b9>\n<06d5> <83cc>\n<06d6> <887f>\n<06d7> <895f>\n<06d8> <8b39>\n<06d9> <8fd1>\n<06da> <91d1>\n<06db> <541f>\n<06dc> <9280>\n<06dd> <4e5d>\nendbfchar\n\n100 beginbfchar\n<06de> <5036>\n<06df> <53e5>\n<06e0> <533a>\n<06e1> <72d7>\n<06e2> <7396>\n<06e3> <77e9>\n<06e4> <82e6>\n<06e5> <8eaf>\n<06e6> <99c6>\n<06e7> <99c8>\n<06e8> <99d2>\n<06e9> <5177>\n<06ea> <611a>\n<06eb> <865e>\n<06ec> <55b0>\n<06ed> <7a7a>\n<06ee> <5076>\n<06ef> <5bd3>\n<06f0> <9047>\n<06f1> <9685>\n<06f2> <4e32>\n<06f3> <6adb>\n<06f4> <91e7>\n<06f5> <5c51>\n<06f6> <5c48>\n<06f7> <6398>\n<06f8> <7a9f>\n<06f9> <6c93>\n<06fa> <9774>\n<06fb> <8f61>\n<06fc> <7aaa>\n<06fd> <718a>\n<06fe> <9688>\n<06ff> <7c82>\n<0700> <6817>\n<0701> <7e70>\n<0702> <6851>\n<0703> <936c>\n<0704> <52f2>\n<0705> <541b>\n<0706> <85ab>\n<0707> <8a13>\n<0708> <7fa4>\n<0709> <8ecd>\n<070a> <90e1>\n<070b> <5366>\n<070c> <8888>\n<070d> <7941>\n<070e> <4fc2>\n<070f> <50be>\n<0710> <5211>\n<0711> <5144>\n<0712> <5553>\n<0713> <572d>\n<0714> <73ea>\n<0715> <578b>\n<0716> <5951>\n<0717> <5f62>\n<0718> <5f84>\n<0719> <6075>\n<071a> <6176>\n<071b> <6167>\n<071c> <61a9>\n<071d> <63b2>\n<071e> <643a>\n<071f> <656c>\n<0720> <666f>\n<0721> <6842>\n<0722> <6e13>\n<0723> <7566>\n<0724> <7a3d>\n<0725> <7cfb>\n<0726> <7d4c>\n<0727> <7d99>\n<0728> <7e4b>\n<0729> <7f6b>\n<072a> <830e>\n<072b> <834a>\n<072c> <86cd>\n<072d> <8a08>\n<072e> <8a63>\n<072f> <8b66>\n<0730> <8efd>\n<0731> <981a>\n<0732> <9d8f>\n<0733> <82b8>\n<0734> <8fce>\n<0735> <9be8>\n<0736> <5287>\n<0737> <621f>\n<0738> <6483>\n<0739> <6fc0>\n<073a> <9699>\n<073b> <6841>\n<073c> <5091>\n<073d> <6b20>\n<073e> <6c7a>\n<073f> <6f54>\n<0740> <7a74>\n<0741> <7d50>\nendbfchar\n\n100 beginbfchar\n<0742> <8840>\n<0743> <8a23>\n<0744> <6708>\n<0745> <4ef6>\n<0746> <5039>\n<0747> <5026>\n<0748> <5065>\n<0749> <517c>\n<074a> <5238>\n<074b> <5263>\n<074c> <55a7>\n<074d> <570f>\n<074e> <5805>\n<074f> <5acc>\n<0750> <5efa>\n<0751> <61b2>\n<0752> <61f8>\n<0753> <62f3>\n<0754> <6372>\n<0755> <691c>\n<0756> <6a29>\n<0757> <727d>\n<0758> <72ac>\n<0759> <732e>\n<075a> <7814>\n<075b> <786f>\n<075c> <7d79>\n<075d> <770c>\n<075e> <80a9>\n<075f> <898b>\n<0760> <8b19>\n<0761> <8ce2>\n<0762> <8ed2>\n<0763> <9063>\n<0764> <9375>\n<0765> <967a>\n<0766> <9855>\n<0767> <9a13>\n<0768> <9e78>\n<0769> <5143>\n<076a> <539f>\n<076b> <53b3>\n<076c> <5e7b>\n<076d> <5f26>\n<076e> <6e1b>\n<076f> <6e90>\n<0770> <7384>\n<0771> <73fe>\n<0772> <7d43>\n<0773> <8237>\n<0774> <8a00>\n<0775> <8afa>\n<0776> <9650>\n<0777> <4e4e>\n<0778> <500b>\n<0779> <53e4>\n<077a> <547c>\n<077b> <56fa>\n<077c> <59d1>\n<077d> <5b64>\n<077e> <5df1>\n<077f> <5eab>\n<0780> <5f27>\n<0781> <6238>\n<0782> <6545>\n<0783> <67af>\n<0784> <6e56>\n<0785> <72d0>\n<0786> <7cca>\n<0787> <88b4>\n<0788> <80a1>\n<0789> <80e1>\n<078a> <83f0>\n<078b> <864e>\n<078c> <8a87>\n<078d> <8de8>\n<078e> <9237>\n<078f> <96c7>\n<0790> <9867>\n<0791> <9f13>\n<0792> <4e94>\n<0793> <4e92>\n<0794> <4f0d>\n<0795> <5348>\n<0796> <5449>\n<0797> <543e>\n<0798> <5a2f>\n<0799> <5f8c>\n<079a> <5fa1>\n<079b> <609f>\n<079c> <68a7>\n<079d> <6a8e>\n<079e> <745a>\n<079f> <7881>\n<07a0> <8a9e>\n<07a1> <8aa4>\n<07a2> <8b77>\n<07a3> <9190>\n<07a4> <4e5e>\n<07a5> <9bc9>\nendbfchar\n\n100 beginbfchar\n<07a6> <4ea4>\n<07a7> <4f7c>\n<07a8> <4faf>\n<07a9> <5019>\n<07aa> <5016>\n<07ab> <5149>\n<07ac> <516c>\n<07ad> <529f>\n<07ae> <52b9>\n<07af> <52fe>\n<07b0> <539a>\n<07b1> <53e3>\n<07b2> <5411>\n<07b3> <540e>\n<07b4> <5589>\n<07b5> <5751>\n<07b6> <57a2>\n<07b7> <597d>\n<07b8> <5b54>\n<07b9> <5b5d>\n<07ba> <5b8f>\n<07bb> <5de5>\n<07bc> <5de7>\n<07bd> <5df7>\n<07be> <5e78>\n<07bf> <5e83>\n<07c0> <5e9a>\n<07c1> <5eb7>\n<07c2> <5f18>\n<07c3> <6052>\n<07c4> <614c>\n<07c5> <6297>\n<07c6> <62d8>\n<07c7> <63a7>\n<07c8> <653b>\n<07c9> <6602>\n<07ca> <6643>\n<07cb> <66f4>\n<07cc> <676d>\n<07cd> <6821>\n<07ce> <6897>\n<07cf> <69cb>\n<07d0> <6c5f>\n<07d1> <6d2a>\n<07d2> <6d69>\n<07d3> <6e2f>\n<07d4> <6e9d>\n<07d5> <7532>\n<07d6> <7687>\n<07d7> <786c>\n<07d8> <7a3f>\n<07d9> <7ce0>\n<07da> <7d05>\n<07db> <7d18>\n<07dc> <7d5e>\n<07dd> <7db1>\n<07de> <8015>\n<07df> <8003>\n<07e0> <80af>\n<07e1> <80b1>\n<07e2> <8154>\n<07e3> <818f>\n<07e4> <822a>\n<07e5> <8352>\n<07e6> <884c>\n<07e7> <8861>\n<07e8> <8b1b>\n<07e9> <8ca2>\n<07ea> <8cfc>\n<07eb> <90ca>\n<07ec> <9175>\n<07ed> <9271>\n<07ee> <783f>\n<07ef> <92fc>\n<07f0> <95a4>\n<07f1> <964d>\n<07f2> <9805>\n<07f3> <9999>\n<07f4> <9ad8>\n<07f5> <9d3b>\n<07f6> <525b>\n<07f7> <52ab>\n<07f8> <53f7>\n<07f9> <5408>\n<07fa> <58d5>\n<07fb> <62f7>\n<07fc> <6fe0>\n<07fd> <8c6a>\n<07fe> <8f5f>\n<07ff> <9eb9>\n<0800> <514b>\n<0801> <523b>\n<0802> <544a>\n<0803> <56fd>\n<0804> <7a40>\n<0805> <9177>\n<0806> <9d60>\n<0807> <9ed2>\n<0808> <7344>\n<0809> <6f09>\nendbfchar\n\n100 beginbfchar\n<080a> <8170>\n<080b> <7511>\n<080c> <5ffd>\n<080d> <60da>\n<080e> <9aa8>\n<080f> <72db>\n<0810> <8fbc>\n<0811> <6b64>\n<0812> <9803>\n<0813> <4eca>\n<0814> <56f0>\n<0815> <5764>\n<0816> <58be>\n<0817> <5a5a>\n<0818> <6068>\n<0819> <61c7>\n<081a> <660f>\n<081b> <6606>\n<081c> <6839>\n<081d> <68b1>\n<081e> <6df7>\n<081f> <75d5>\n<0820> <7d3a>\n<0821> <826e>\n<0822> <9b42>\n<0823> <4e9b>\n<0824> <4f50>\n<0825> <53c9>\n<0826> <5506>\n<0827> <5d6f>\n<0828> <5de6>\n<0829> <5dee>\n<082a> <67fb>\n<082b> <6c99>\n<082c> <7473>\n<082d> <7802>\n<082e> <8a50>\n<082f> <9396>\n<0830> <88df>\n<0831> <5750>\n<0832> <5ea7>\n<0833> <632b>\n<0834> <50b5>\n<0835> <50ac>\n<0836> <518d>\n<0837> <6700>\n<0838> <54c9>\n<0839> <585e>\n<083a> <59bb>\n<083b> <5bb0>\n<083c> <5f69>\n<083d> <624d>\n<083e> <63a1>\n<083f> <683d>\n<0840> <6b73>\n<0841> <6e08>\n<0842> <707d>\n<0843> <91c7>\n<0844> <7280>\n<0845> <7815>\n<0846> <7826>\n<0847> <796d>\n<0848> <658e>\n<0849> <7d30>\n<084a> <83dc>\n<084b> <88c1>\n<084c> <8f09>\n<084d> <969b>\n<084e> <5264>\n<084f> <5728>\n<0850> <6750>\n<0851> <7f6a>\n<0852> <8ca1>\n<0853> <51b4>\n<0854> <5742>\n<0855> <962a>\n<0856> <583a>\n<0857> <698a>\n<0858> <80b4>\n<0859> <54b2>\n<085a> <5d0e>\n<085b> <57fc>\n<085c> <7895>\n<085d> <9dfa>\n<085e> <4f5c>\n<085f> <524a>\n<0860> <548b>\n<0861> <643e>\n<0862> <6628>\n<0863> <6714>\n<0864> <67f5>\n<0865> <7a84>\n<0866> <7b56>\n<0867> <7d22>\n<0868> <932f>\n<0869> <685c>\n<086a> <9bad>\n<086b> <7b39>\n<086c> <5319>\n<086d> <518a>\nendbfchar\n\n100 beginbfchar\n<086e> <5237>\n<086f> <5bdf>\n<0870> <62f6>\n<0871> <64ae>\n<0872> <64e6>\n<0873> <672d>\n<0874> <6bba>\n<0875> <85a9>\n<0876> <96d1>\n<0877> <7690>\n<0878> <9bd6>\n<0879> <634c>\n<087a> <9306>\n<087b> <9bab>\n<087c> <76bf>\n<087d> <6652>\n<087e> <4e09>\n<087f> <5098>\n<0880> <53c2>\n<0881> <5c71>\n<0882> <60e8>\n<0883> <6492>\n<0884> <6563>\n<0885> <685f>\n<0886> <71e6>\n<0887> <73ca>\n<0888> <7523>\n<0889> <7b97>\n<088a> <7e82>\n<088b> <8695>\n<088c> <8b83>\n<088d> <8cdb>\n<088e> <9178>\n<088f> <9910>\n<0890> <65ac>\n<0891> <66ab>\n<0892> <6b8b>\n<0893> <4ed5>\n<0894> <4ed4>\n<0895> <4f3a>\n<0896> <4f7f>\n<0897> <523a>\n<0898> <53f8>\n<0899> <53f2>\n<089a> <55e3>\n<089b> <56db>\n<089c> <58eb>\n<089d> <59cb>\n<089e> <59c9>\n<089f> <59ff>\n<08a0> <5b50>\n<08a1> <5c4d>\n<08a2> <5e02>\n<08a3> <5e2b>\n<08a4> <5fd7>\n<08a5> <601d>\n<08a6> <6307>\n<08a7> <652f>\n<08a8> <5b5c>\n<08a9> <65af>\n<08aa> <65bd>\n<08ab> <65e8>\n<08ac> <679d>\n<08ad> <6b62>\n<08ae> <6b7b>\n<08af> <6c0f>\n<08b0> <7345>\n<08b1> <7949>\n<08b2> <79c1>\n<08b3> <7cf8>\n<08b4> <7d19>\n<08b5> <7d2b>\n<08b6> <80a2>\n<08b7> <8102>\n<08b8> <81f3>\n<08b9> <8996>\n<08ba> <8a5e>\n<08bb> <8a69>\n<08bc> <8a66>\n<08bd> <8a8c>\n<08be> <8aee>\n<08bf> <8cc7>\n<08c0> <8cdc>\n<08c1> <96cc>\n<08c2> <98fc>\n<08c3> <6b6f>\n<08c4> <4e8b>\n<08c5> <4f3c>\n<08c6> <4f8d>\n<08c7> <5150>\n<08c8> <5b57>\n<08c9> <5bfa>\n<08ca> <6148>\n<08cb> <6301>\n<08cc> <6642>\n<08cd> <6b21>\n<08ce> <6ecb>\n<08cf> <6cbb>\n<08d0> <723e>\n<08d1> <74bd>\nendbfchar\n\n100 beginbfchar\n<08d2> <75d4>\n<08d3> <78c1>\n<08d4> <793a>\n<08d5> <800c>\n<08d6> <8033>\n<08d7> <81ea>\n<08d8> <8494>\n<08d9> <8f9e>\n<08da> <6c50>\n<08db> <9e7f>\n<08dc> <5f0f>\n<08dd> <8b58>\n<08de> <9d2b>\n<08df> <7afa>\n<08e0> <8ef8>\n<08e1> <5b8d>\n<08e2> <96eb>\n<08e3> <4e03>\n<08e4> <53f1>\n<08e5> <57f7>\n<08e6> <5931>\n<08e7> <5ac9>\n<08e8> <5ba4>\n<08e9> <6089>\n<08ea> <6e7f>\n<08eb> <6f06>\n<08ec> <75be>\n<08ed> <8cea>\n<08ee> <5b9f>\n<08ef> <8500>\n<08f0> <7be0>\n<08f1> <5072>\n<08f2> <67f4>\n<08f3> <829d>\n<08f4> <5c61>\n<08f5> <854a>\n<08f6> <7e1e>\n<08f7> <820e>\n<08f8> <5199>\n<08f9> <5c04>\n<08fa> <6368>\n<08fb> <8d66>\n<08fc> <659c>\n<08fd> <716e>\n<08fe> <793e>\n<08ff> <7d17>\n<0900> <8005>\n<0901> <8b1d>\n<0902> <8eca>\n<0903> <906e>\n<0904> <86c7>\n<0905> <90aa>\n<0906> <501f>\n<0907> <52fa>\n<0908> <5c3a>\n<0909> <6753>\n<090a> <707c>\n<090b> <7235>\n<090c> <914c>\n<090d> <91c8>\n<090e> <932b>\n<090f> <82e5>\n<0910> <5bc2>\n<0911> <5f31>\n<0912> <60f9>\n<0913> <4e3b>\n<0914> <53d6>\n<0915> <5b88>\n<0916> <624b>\n<0917> <6731>\n<0918> <6b8a>\n<0919> <72e9>\n<091a> <73e0>\n<091b> <7a2e>\n<091c> <816b>\n<091d> <8da3>\n<091e> <9152>\n<091f> <9996>\n<0920> <5112>\n<0921> <53d7>\n<0922> <546a>\n<0923> <5bff>\n<0924> <6388>\n<0925> <6a39>\n<0926> <7dac>\n<0927> <9700>\n<0928> <56da>\n<0929> <53ce>\n<092a> <5468>\n<092b> <5b97>\n<092c> <5c31>\n<092d> <5dde>\n<092e> <4fee>\n<092f> <6101>\n<0930> <62fe>\n<0931> <6d32>\n<0932> <79c0>\n<0933> <79cb>\n<0934> <7d42>\n<0935> <7e4d>\nendbfchar\n\n100 beginbfchar\n<0936> <7fd2>\n<0937> <81ed>\n<0938> <821f>\n<0939> <8490>\n<093a> <8846>\n<093b> <8972>\n<093c> <8b90>\n<093d> <8e74>\n<093e> <8f2f>\n<093f> <9031>\n<0940> <914b>\n<0941> <916c>\n<0942> <96c6>\n<0943> <919c>\n<0944> <4ec0>\n<0945> <4f4f>\n<0946> <5145>\n<0947> <5341>\n<0948> <5f93>\n<0949> <620e>\n<094a> <67d4>\n<094b> <6c41>\n<094c> <6e0b>\n<094d> <7363>\n<094e> <7e26>\n<094f> <91cd>\n<0950> <9283>\n<0951> <53d4>\n<0952> <5919>\n<0953> <5bbf>\n<0954> <6dd1>\n<0955> <795d>\n<0956> <7e2e>\n<0957> <7c9b>\n<0958> <587e>\n<0959> <719f>\n<095a> <51fa>\n<095b> <8853>\n<095c> <8ff0>\n<095d> <4fca>\n<095e> <5cfb>\n<095f> <6625>\n<0960> <77ac>\n<0961> <7ae3>\n<0962> <821c>\n<0963> <99ff>\n<0964> <51c6>\n<0965> <5faa>\n<0966> <65ec>\n<0967> <696f>\n<0968> <6b89>\n<0969> <6df3>\n<096a> <6e96>\n<096b> <6f64>\n<096c> <76fe>\n<096d> <7d14>\n<096e> <5de1>\n<096f> <9075>\n<0970> <9187>\n<0971> <9806>\n<0972> <51e6>\n<0973> <521d>\n<0974> <6240>\n<0975> <6691>\n<0976> <66d9>\n<0977> <6e1a>\n<0978> <5eb6>\n<0979> <7dd2>\n<097a> <7f72>\n<097b> <66f8>\n<097c> <85af>\n<097d> <85f7>\n<097e> <8af8>\n<097f> <52a9>\n<0980> <53d9>\n<0981> <5973>\n<0982> <5e8f>\n<0983> <5f90>\n<0984> <6055>\n<0985> <92e4>\n<0986> <9664>\n<0987> <50b7>\n<0988> <511f>\n<0989> <52dd>\n<098a> <5320>\n<098b> <5347>\n<098c> <53ec>\n<098d> <54e8>\n<098e> <5546>\n<098f> <5531>\n<0990> <5617>\n<0991> <5968>\n<0992> <59be>\n<0993> <5a3c>\n<0994> <5bb5>\n<0995> <5c06>\n<0996> <5c0f>\n<0997> <5c11>\n<0998> <5c1a>\n<0999> <5e84>\nendbfchar\n\n100 beginbfchar\n<099a> <5e8a>\n<099b> <5ee0>\n<099c> <5f70>\n<099d> <627f>\n<099e> <6284>\n<099f> <62db>\n<09a0> <638c>\n<09a1> <6377>\n<09a2> <6607>\n<09a3> <660c>\n<09a4> <662d>\n<09a5> <6676>\n<09a6> <677e>\n<09a7> <68a2>\n<09a8> <6a1f>\n<09a9> <6a35>\n<09aa> <6cbc>\n<09ab> <6d88>\n<09ac> <6e09>\n<09ad> <6e58>\n<09ae> <713c>\n<09af> <7126>\n<09b0> <7167>\n<09b1> <75c7>\n<09b2> <7701>\n<09b3> <785d>\n<09b4> <7901>\n<09b5> <7965>\n<09b6> <79f0>\n<09b7> <7ae0>\n<09b8> <7b11>\n<09b9> <7ca7>\n<09ba> <7d39>\n<09bb> <8096>\n<09bc> <83d6>\n<09bd> <848b>\n<09be> <8549>\n<09bf> <885d>\n<09c0> <88f3>\n<09c1> <8a1f>\n<09c2> <8a3c>\n<09c3> <8a54>\n<09c4> <8a73>\n<09c5> <8c61>\n<09c6> <8cde>\n<09c7> <91a4>\n<09c8> <9266>\n<09c9> <937e>\n<09ca> <9418>\n<09cb> <969c>\n<09cc> <9798>\n<09cd> <4e0a>\n<09ce> <4e08>\n<09cf> <4e1e>\n<09d0> <4e57>\n<09d1> <5197>\n<09d2> <5270>\n<09d3> <57ce>\n<09d4> <5834>\n<09d5> <58cc>\n<09d6> <5b22>\n<09d7> <5e38>\n<09d8> <60c5>\n<09d9> <64fe>\n<09da> <6761>\n<09db> <6756>\n<09dc> <6d44>\n<09dd> <72b6>\n<09de> <7573>\n<09df> <7a63>\n<09e0> <84b8>\n<09e1> <8b72>\n<09e2> <91b8>\n<09e3> <9320>\n<09e4> <5631>\n<09e5> <57f4>\n<09e6> <98fe>\n<09e7> <62ed>\n<09e8> <690d>\n<09e9> <6b96>\n<09ea> <71ed>\n<09eb> <7e54>\n<09ec> <8077>\n<09ed> <8272>\n<09ee> <89e6>\n<09ef> <98df>\n<09f0> <8755>\n<09f1> <8fb1>\n<09f2> <5c3b>\n<09f3> <4f38>\n<09f4> <4fe1>\n<09f5> <4fb5>\n<09f6> <5507>\n<09f7> <5a20>\n<09f8> <5bdd>\n<09f9> <5be9>\n<09fa> <5fc3>\n<09fb> <614e>\n<09fc> <632f>\n<09fd> <65b0>\nendbfchar\n\n100 beginbfchar\n<09fe> <664b>\n<09ff> <68ee>\n<0a00> <699b>\n<0a01> <6d78>\n<0a02> <6df1>\n<0a03> <7533>\n<0a04> <75b9>\n<0a05> <771f>\n<0a06> <795e>\n<0a07> <79e6>\n<0a08> <7d33>\n<0a09> <81e3>\n<0a0a> <82af>\n<0a0b> <85aa>\n<0a0c> <89aa>\n<0a0d> <8a3a>\n<0a0e> <8eab>\n<0a0f> <8f9b>\n<0a10> <9032>\n<0a11> <91dd>\n<0a12> <9707>\n<0a13> <4eba>\n<0a14> <4ec1>\n<0a15> <5203>\n<0a16> <5875>\n<0a17> <58ec>\n<0a18> <5c0b>\n<0a19> <751a>\n<0a1a> <5c3d>\n<0a1b> <814e>\n<0a1c> <8a0a>\n<0a1d> <8fc5>\n<0a1e> <9663>\n<0a1f> <976d>\n<0a20> <7b25>\n<0a21> <8acf>\n<0a22> <9808>\n<0a23> <9162>\n<0a24> <56f3>\n<0a25> <53a8>\n<0a26> <9017>\n<0a27> <5439>\n<0a28> <5782>\n<0a29> <5e25>\n<0a2a> <63a8>\n<0a2b> <6c34>\n<0a2c> <708a>\n<0a2d> <7761>\n<0a2e> <7c8b>\n<0a2f> <7fe0>\n<0a30> <8870>\n<0a31> <9042>\n<0a32> <9154>\n<0a33> <9310>\n<0a34> <9318>\n<0a35> <968f>\n<0a36> <745e>\n<0a37> <9ac4>\n<0a38> <5d07>\n<0a39> <5d69>\n<0a3a> <6570>\n<0a3b> <67a2>\n<0a3c> <8da8>\n<0a3d> <96db>\n<0a3e> <636e>\n<0a3f> <6749>\n<0a40> <6919>\n<0a41> <83c5>\n<0a42> <9817>\n<0a43> <96c0>\n<0a44> <88fe>\n<0a45> <6f84>\n<0a46> <647a>\n<0a47> <5bf8>\n<0a48> <4e16>\n<0a49> <702c>\n<0a4a> <755d>\n<0a4b> <662f>\n<0a4c> <51c4>\n<0a4d> <5236>\n<0a4e> <52e2>\n<0a4f> <59d3>\n<0a50> <5f81>\n<0a51> <6027>\n<0a52> <6210>\n<0a53> <653f>\n<0a54> <6574>\n<0a55> <661f>\n<0a56> <6674>\n<0a57> <68f2>\n<0a58> <6816>\n<0a59> <6b63>\n<0a5a> <6e05>\n<0a5b> <7272>\n<0a5c> <751f>\n<0a5d> <76db>\n<0a5e> <7cbe>\n<0a5f> <8056>\n<0a60> <58f0>\n<0a61> <88fd>\nendbfchar\n\n100 beginbfchar\n<0a62> <897f>\n<0a63> <8aa0>\n<0a64> <8a93>\n<0a65> <8acb>\n<0a66> <901d>\n<0a67> <9192>\n<0a68> <9752>\n<0a69> <9759>\n<0a6a> <6589>\n<0a6b> <7a0e>\n<0a6c> <8106>\n<0a6d> <96bb>\n<0a6e> <5e2d>\n<0a6f> <60dc>\n<0a70> <621a>\n<0a71> <65a5>\n<0a72> <6614>\n<0a73> <6790>\n<0a74> <77f3>\n<0a75> <7a4d>\n<0a76> <7c4d>\n<0a77> <7e3e>\n<0a78> <810a>\n<0a79> <8cac>\n<0a7a> <8d64>\n<0a7b> <8de1>\n<0a7c> <8e5f>\n<0a7d> <78a9>\n<0a7e> <5207>\n<0a7f> <62d9>\n<0a80> <63a5>\n<0a81> <6442>\n<0a82> <6298>\n<0a83> <8a2d>\n<0a84> <7a83>\n<0a85> <7bc0>\n<0a86> <8aac>\n<0a87> <96ea>\n<0a88> <7d76>\n<0a89> <820c>\n<0a8a> <8749>\n<0a8b> <4ed9>\n<0a8c> <5148>\n<0a8d> <5343>\n<0a8e> <5360>\n<0a8f> <5ba3>\n<0a90> <5c02>\n<0a91> <5c16>\n<0a92> <5ddd>\n<0a93> <6226>\n<0a94> <6247>\n<0a95> <64b0>\n<0a96> <6813>\n<0a97> <6834>\n<0a98> <6cc9>\n<0a99> <6d45>\n<0a9a> <6d17>\n<0a9b> <67d3>\n<0a9c> <6f5c>\n<0a9d> <714e>\n<0a9e> <717d>\n<0a9f> <65cb>\n<0aa0> <7a7f>\n<0aa1> <7bad>\n<0aa2> <7dda>\n<0aa3> <7e4a>\n<0aa4> <7fa8>\n<0aa5> <817a>\n<0aa6> <821b>\n<0aa7> <8239>\n<0aa8> <85a6>\n<0aa9> <8a6e>\n<0aaa> <8cce>\n<0aab> <8df5>\n<0aac> <9078>\n<0aad> <9077>\n<0aae> <92ad>\n<0aaf> <9291>\n<0ab0> <9583>\n<0ab1> <9bae>\n<0ab2> <524d>\n<0ab3> <5584>\n<0ab4> <6f38>\n<0ab5> <7136>\n<0ab6> <5168>\n<0ab7> <7985>\n<0ab8> <7e55>\n<0ab9> <81b3>\n<0aba> <7cce>\n<0abb> <564c>\n<0abc> <5851>\n<0abd> <5ca8>\n<0abe> <63aa>\n<0abf> <66fe>\n<0ac0> <66fd>\n<0ac1> <695a>\n<0ac2> <72d9>\n<0ac3> <758f>\n<0ac4> <758e>\n<0ac5> <790e>\nendbfchar\n\n100 beginbfchar\n<0ac6> <7956>\n<0ac7> <79df>\n<0ac8> <7c97>\n<0ac9> <7d20>\n<0aca> <7d44>\n<0acb> <8607>\n<0acc> <8a34>\n<0acd> <963b>\n<0ace> <9061>\n<0acf> <9f20>\n<0ad0> <50e7>\n<0ad1> <5275>\n<0ad2> <53cc>\n<0ad3> <53e2>\n<0ad4> <5009>\n<0ad5> <55aa>\n<0ad6> <58ee>\n<0ad7> <594f>\n<0ad8> <723d>\n<0ad9> <5b8b>\n<0ada> <5c64>\n<0adb> <531d>\n<0adc> <60e3>\n<0add> <60f3>\n<0ade> <635c>\n<0adf> <6383>\n<0ae0> <633f>\n<0ae1> <63bb>\n<0ae2> <64cd>\n<0ae3> <65e9>\n<0ae4> <66f9>\n<0ae5> <5de3>\n<0ae6> <69cd>\n<0ae7> <69fd>\n<0ae8> <6f15>\n<0ae9> <71e5>\n<0aea> <4e89>\n<0aeb> <75e9>\n<0aec> <76f8>\n<0aed> <7a93>\n<0aee> <7cdf>\n<0aef> <7dcf>\n<0af0> <7d9c>\n<0af1> <8061>\n<0af2> <8349>\n<0af3> <8358>\n<0af4> <846c>\n<0af5> <84bc>\n<0af6> <85fb>\n<0af7> <88c5>\n<0af8> <8d70>\n<0af9> <9001>\n<0afa> <906d>\n<0afb> <9397>\n<0afc> <971c>\n<0afd> <9a12>\n<0afe> <50cf>\n<0aff> <5897>\n<0b00> <618e>\n<0b01> <81d3>\n<0b02> <8535>\n<0b03> <8d08>\n<0b04> <9020>\n<0b05> <4fc3>\n<0b06> <5074>\n<0b07> <5247>\n<0b08> <5373>\n<0b09> <606f>\n<0b0a> <6349>\n<0b0b> <675f>\n<0b0c> <6e2c>\n<0b0d> <8db3>\n<0b0e> <901f>\n<0b0f> <4fd7>\n<0b10> <5c5e>\n<0b11> <8cca>\n<0b12> <65cf>\n<0b13> <7d9a>\n<0b14> <5352>\n<0b15> <8896>\n<0b16> <5176>\n<0b17> <63c3>\n<0b18> <5b58>\n<0b19> <5b6b>\n<0b1a> <5c0a>\n<0b1b> <640d>\n<0b1c> <6751>\n<0b1d> <905c>\n<0b1e> <4ed6>\n<0b1f> <591a>\n<0b20> <592a>\n<0b21> <6c70>\n<0b22> <8a51>\n<0b23> <553e>\n<0b24> <5815>\n<0b25> <59a5>\n<0b26> <60f0>\n<0b27> <6253>\n<0b28> <67c1>\n<0b29> <8235>\nendbfchar\n\n100 beginbfchar\n<0b2a> <6955>\n<0b2b> <9640>\n<0b2c> <99c4>\n<0b2d> <9a28>\n<0b2e> <4f53>\n<0b2f> <5806>\n<0b30> <5bfe>\n<0b31> <8010>\n<0b32> <5cb1>\n<0b33> <5e2f>\n<0b34> <5f85>\n<0b35> <6020>\n<0b36> <614b>\n<0b37> <6234>\n<0b38> <66ff>\n<0b39> <6cf0>\n<0b3a> <6ede>\n<0b3b> <80ce>\n<0b3c> <817f>\n<0b3d> <82d4>\n<0b3e> <888b>\n<0b3f> <8cb8>\n<0b40> <9000>\n<0b41> <902e>\n<0b42> <968a>\n<0b43> <9edb>\n<0b44> <9bdb>\n<0b45> <4ee3>\n<0b46> <53f0>\n<0b47> <5927>\n<0b48> <7b2c>\n<0b49> <918d>\n<0b4a> <984c>\n<0b4b> <9df9>\n<0b4c> <6edd>\n<0b4d> <7027>\n<0b4e> <5353>\n<0b4f> <5544>\n<0b50> <5b85>\n<0b51> <6258>\n<0b52> <629e>\n<0b53> <62d3>\n<0b54> <6ca2>\n<0b55> <6fef>\n<0b56> <7422>\n<0b57> <8a17>\n<0b58> <9438>\n<0b59> <6fc1>\n<0b5a> <8afe>\n<0b5b> <8338>\n<0b5c> <51e7>\n<0b5d> <86f8>\n<0b5e> <53ea>\n<0b5f> <53e9>\n<0b60> <4f46>\n<0b61> <9054>\n<0b62> <8fb0>\n<0b63> <596a>\n<0b64> <8131>\n<0b65> <5dfd>\n<0b66> <7aea>\n<0b67> <8fbf>\n<0b68> <68da>\n<0b69> <8c37>\n<0b6a> <72f8>\n<0b6b> <9c48>\n<0b6c> <6a3d>\n<0b6d> <8ab0>\n<0b6e> <4e39>\n<0b6f> <5358>\n<0b70> <5606>\n<0b71> <5766>\n<0b72> <62c5>\n<0b73> <63a2>\n<0b74> <65e6>\n<0b75> <6b4e>\n<0b76> <6de1>\n<0b77> <6e5b>\n<0b78> <70ad>\n<0b79> <77ed>\n<0b7a> <7aef>\n<0b7b> <7baa>\n<0b7c> <7dbb>\n<0b7d> <803d>\n<0b7e> <80c6>\n<0b7f> <86cb>\n<0b80> <8a95>\n<0b81> <935b>\n<0b82> <56e3>\n<0b83> <58c7>\n<0b84> <5f3e>\n<0b85> <65ad>\n<0b86> <6696>\n<0b87> <6a80>\n<0b88> <6bb5>\n<0b89> <7537>\n<0b8a> <8ac7>\n<0b8b> <5024>\n<0b8c> <77e5>\n<0b8d> <5730>\nendbfchar\n\n100 beginbfchar\n<0b8e> <5f1b>\n<0b8f> <6065>\n<0b90> <667a>\n<0b91> <6c60>\n<0b92> <75f4>\n<0b93> <7a1a>\n<0b94> <7f6e>\n<0b95> <81f4>\n<0b96> <8718>\n<0b97> <9045>\n<0b98> <99b3>\n<0b99> <7bc9>\n<0b9a> <755c>\n<0b9b> <7af9>\n<0b9c> <7b51>\n<0b9d> <84c4>\n<0b9e> <9010>\n<0b9f> <79e9>\n<0ba0> <7a92>\n<0ba1> <8336>\n<0ba2> <5ae1>\n<0ba3> <7740>\n<0ba4> <4e2d>\n<0ba5> <4ef2>\n<0ba6> <5b99>\n<0ba7> <5fe0>\n<0ba8> <62bd>\n<0ba9> <663c>\n<0baa> <67f1>\n<0bab> <6ce8>\n<0bac> <866b>\n<0bad> <8877>\n<0bae> <8a3b>\n<0baf> <914e>\n<0bb0> <92f3>\n<0bb1> <99d0>\n<0bb2> <6a17>\n<0bb3> <7026>\n<0bb4> <732a>\n<0bb5> <82e7>\n<0bb6> <8457>\n<0bb7> <8caf>\n<0bb8> <4e01>\n<0bb9> <5146>\n<0bba> <51cb>\n<0bbb> <558b>\n<0bbc> <5bf5>\n<0bbd> <5e16>\n<0bbe> <5e33>\n<0bbf> <5e81>\n<0bc0> <5f14>\n<0bc1> <5f35>\n<0bc2> <5f6b>\n<0bc3> <5fb4>\n<0bc4> <61f2>\n<0bc5> <6311>\n<0bc6> <66a2>\n<0bc7> <671d>\n<0bc8> <6f6e>\n<0bc9> <7252>\n<0bca> <753a>\n<0bcb> <773a>\n<0bcc> <8074>\n<0bcd> <8139>\n<0bce> <8178>\n<0bcf> <8776>\n<0bd0> <8abf>\n<0bd1> <8adc>\n<0bd2> <8d85>\n<0bd3> <8df3>\n<0bd4> <929a>\n<0bd5> <9577>\n<0bd6> <9802>\n<0bd7> <9ce5>\n<0bd8> <52c5>\n<0bd9> <6357>\n<0bda> <76f4>\n<0bdb> <6715>\n<0bdc> <6c88>\n<0bdd> <73cd>\n<0bde> <8cc3>\n<0bdf> <93ae>\n<0be0> <9673>\n<0be1> <6d25>\n<0be2> <589c>\n<0be3> <690e>\n<0be4> <69cc>\n<0be5> <8ffd>\n<0be6> <939a>\n<0be7> <75db>\n<0be8> <901a>\n<0be9> <585a>\n<0bea> <6802>\n<0beb> <63b4>\n<0bec> <69fb>\n<0bed> <4f43>\n<0bee> <6f2c>\n<0bef> <67d8>\n<0bf0> <8fbb>\n<0bf1> <8526>\nendbfchar\n\n100 beginbfchar\n<0bf2> <7db4>\n<0bf3> <9354>\n<0bf4> <693f>\n<0bf5> <6f70>\n<0bf6> <576a>\n<0bf7> <58f7>\n<0bf8> <5b2c>\n<0bf9> <7d2c>\n<0bfa> <722a>\n<0bfb> <540a>\n<0bfc> <91e3>\n<0bfd> <9db4>\n<0bfe> <4ead>\n<0bff> <4f4e>\n<0c00> <505c>\n<0c01> <5075>\n<0c02> <5243>\n<0c03> <8c9e>\n<0c04> <5448>\n<0c05> <5824>\n<0c06> <5b9a>\n<0c07> <5e1d>\n<0c08> <5e95>\n<0c09> <5ead>\n<0c0a> <5ef7>\n<0c0b> <5f1f>\n<0c0c> <608c>\n<0c0d> <62b5>\n<0c0e> <633a>\n<0c0f> <63d0>\n<0c10> <68af>\n<0c11> <6c40>\n<0c12> <7887>\n<0c13> <798e>\n<0c14> <7a0b>\n<0c15> <7de0>\n<0c16> <8247>\n<0c17> <8a02>\n<0c18> <8ae6>\n<0c19> <8e44>\n<0c1a> <9013>\n<0c1b> <90b8>\n<0c1c> <912d>\n<0c1d> <91d8>\n<0c1e> <9f0e>\n<0c1f> <6ce5>\n<0c20> <6458>\n<0c21> <64e2>\n<0c22> <6575>\n<0c23> <6ef4>\n<0c24> <7684>\n<0c25> <7b1b>\n<0c26> <9069>\n<0c27> <93d1>\n<0c28> <6eba>\n<0c29> <54f2>\n<0c2a> <5fb9>\n<0c2b> <64a4>\n<0c2c> <8f4d>\n<0c2d> <8fed>\n<0c2e> <9244>\n<0c2f> <5178>\n<0c30> <586b>\n<0c31> <5929>\n<0c32> <5c55>\n<0c33> <5e97>\n<0c34> <6dfb>\n<0c35> <7e8f>\n<0c36> <751c>\n<0c37> <8cbc>\n<0c38> <8ee2>\n<0c39> <985b>\n<0c3a> <70b9>\n<0c3b> <4f1d>\n<0c3c> <6bbf>\n<0c3d> <6fb1>\n<0c3e> <7530>\n<0c3f> <96fb>\n<0c40> <514e>\n<0c41> <5410>\n<0c42> <5835>\n<0c43> <5857>\n<0c44> <59ac>\n<0c45> <5c60>\n<0c46> <5f92>\n<0c47> <6597>\n<0c48> <675c>\n<0c49> <6e21>\n<0c4a> <767b>\n<0c4b> <83df>\n<0c4c> <8ced>\n<0c4d> <9014>\n<0c4e> <90fd>\n<0c4f> <934d>\n<0c50> <7825>\n<0c51> <783a>\n<0c52> <52aa>\n<0c53> <5ea6>\n<0c54> <571f>\n<0c55> <5974>\nendbfchar\n\n100 beginbfchar\n<0c56> <6012>\n<0c57> <5012>\n<0c58> <515a>\n<0c59> <51ac>\n<0c5a> <51cd>\n<0c5b> <5200>\n<0c5c> <5510>\n<0c5d> <5854>\n<0c5e> <5858>\n<0c5f> <5957>\n<0c60> <5b95>\n<0c61> <5cf6>\n<0c62> <5d8b>\n<0c63> <60bc>\n<0c64> <6295>\n<0c65> <642d>\n<0c66> <6771>\n<0c67> <6843>\n<0c68> <68bc>\n<0c69> <68df>\n<0c6a> <76d7>\n<0c6b> <6dd8>\n<0c6c> <6e6f>\n<0c6d> <6d9b>\n<0c6e> <706f>\n<0c6f> <71c8>\n<0c70> <5f53>\n<0c71> <75d8>\n<0c72> <7977>\n<0c73> <7b49>\n<0c74> <7b54>\n<0c75> <7b52>\n<0c76> <7cd6>\n<0c77> <7d71>\n<0c78> <5230>\n<0c79> <8463>\n<0c7a> <8569>\n<0c7b> <85e4>\n<0c7c> <8a0e>\n<0c7d> <8b04>\n<0c7e> <8c46>\n<0c7f> <8e0f>\n<0c80> <9003>\n<0c81> <900f>\n<0c82> <9419>\n<0c83> <9676>\n<0c84> <982d>\n<0c85> <9a30>\n<0c86> <95d8>\n<0c87> <50cd>\n<0c88> <52d5>\n<0c89> <540c>\n<0c8a> <5802>\n<0c8b> <5c0e>\n<0c8c> <61a7>\n<0c8d> <649e>\n<0c8e> <6d1e>\n<0c8f> <77b3>\n<0c90> <7ae5>\n<0c91> <80f4>\n<0c92> <8404>\n<0c93> <9053>\n<0c94> <9285>\n<0c95> <5ce0>\n<0c96> <9d07>\n<0c97> <533f>\n<0c98> <5f97>\n<0c99> <5fb3>\n<0c9a> <6d9c>\n<0c9b> <7279>\n<0c9c> <7763>\n<0c9d> <79bf>\n<0c9e> <7be4>\n<0c9f> <6bd2>\n<0ca0> <72ec>\n<0ca1> <8aad>\n<0ca2> <6803>\n<0ca3> <6a61>\n<0ca4> <51f8>\n<0ca5> <7a81>\n<0ca6> <6934>\n<0ca7> <5c4a>\n<0ca8> <9cf6>\n<0ca9> <82eb>\n<0caa> <5bc5>\n<0cab> <9149>\n<0cac> <701e>\n<0cad> <5678>\n<0cae> <5c6f>\n<0caf> <60c7>\n<0cb0> <6566>\n<0cb1> <6c8c>\n<0cb2> <8c5a>\n<0cb3> <9041>\n<0cb4> <9813>\n<0cb5> <5451>\n<0cb6> <66c7>\n<0cb7> <920d>\n<0cb8> <5948>\n<0cb9> <90a3>\nendbfchar\n\n100 beginbfchar\n<0cba> <5185>\n<0cbb> <4e4d>\n<0cbc> <51ea>\n<0cbd> <8599>\n<0cbe> <8b0e>\n<0cbf> <7058>\n<0cc0> <637a>\n<0cc1> <934b>\n<0cc2> <6962>\n<0cc3> <99b4>\n<0cc4> <7e04>\n<0cc5> <7577>\n<0cc6> <5357>\n<0cc7> <6960>\n<0cc8> <8edf>\n<0cc9> <96e3>\n<0cca> <6c5d>\n<0ccb> <4e8c>\n<0ccc> <5c3c>\n<0ccd> <5f10>\n<0cce> <8fe9>\n<0ccf> <5302>\n<0cd0> <8cd1>\n<0cd1> <8089>\n<0cd2> <8679>\n<0cd3> <5eff>\n<0cd4> <65e5>\n<0cd5> <4e73>\n<0cd6> <5165>\n<0cd7> <5982>\n<0cd8> <5c3f>\n<0cd9> <97ee>\n<0cda> <4efb>\n<0cdb> <598a>\n<0cdc> <5fcd>\n<0cdd> <8a8d>\n<0cde> <6fe1>\n<0cdf> <79b0>\n<0ce0> <7962>\n<0ce1> <5be7>\n<0ce2> <8471>\n<0ce3> <732b>\n<0ce4> <71b1>\n<0ce5> <5e74>\n<0ce6> <5ff5>\n<0ce7> <637b>\n<0ce8> <649a>\n<0ce9> <71c3>\n<0cea> <7c98>\n<0ceb> <4e43>\n<0cec> <5efc>\n<0ced> <4e4b>\n<0cee> <57dc>\n<0cef> <56a2>\n<0cf0> <60a9>\n<0cf1> <6fc3>\n<0cf2> <7d0d>\n<0cf3> <80fd>\n<0cf4> <8133>\n<0cf5> <81bf>\n<0cf6> <8fb2>\n<0cf7> <8997>\n<0cf8> <86a4>\n<0cf9> <5df4>\n<0cfa> <628a>\n<0cfb> <64ad>\n<0cfc> <8987>\n<0cfd> <6777>\n<0cfe> <6ce2>\n<0cff> <6d3e>\n<0d00> <7436>\n<0d01> <7834>\n<0d02> <5a46>\n<0d03> <7f75>\n<0d04> <82ad>\n<0d05> <99ac>\n<0d06> <4ff3>\n<0d07> <5ec3>\n<0d08> <62dd>\n<0d09> <6392>\n<0d0a> <6557>\n<0d0b> <676f>\n<0d0c> <76c3>\n<0d0d> <724c>\n<0d0e> <80cc>\n<0d0f> <80ba>\n<0d10> <8f29>\n<0d11> <914d>\n<0d12> <500d>\n<0d13> <57f9>\n<0d14> <5a92>\n<0d15> <6885>\n<0d16> <6973>\n<0d17> <7164>\n<0d18> <72fd>\n<0d19> <8cb7>\n<0d1a> <58f2>\n<0d1b> <8ce0>\n<0d1c> <966a>\n<0d1d> <9019>\nendbfchar\n\n100 beginbfchar\n<0d1e> <877f>\n<0d1f> <79e4>\n<0d20> <77e7>\n<0d21> <8429>\n<0d22> <4f2f>\n<0d23> <5265>\n<0d24> <535a>\n<0d25> <62cd>\n<0d26> <67cf>\n<0d27> <6cca>\n<0d28> <767d>\n<0d29> <7b94>\n<0d2a> <7c95>\n<0d2b> <8236>\n<0d2c> <8584>\n<0d2d> <8feb>\n<0d2e> <66dd>\n<0d2f> <6f20>\n<0d30> <7206>\n<0d31> <7e1b>\n<0d32> <83ab>\n<0d33> <99c1>\n<0d34> <9ea6>\n<0d35> <51fd>\n<0d36> <7bb1>\n<0d37> <7872>\n<0d38> <7bb8>\n<0d39> <8087>\n<0d3a> <7b48>\n<0d3b> <6ae8>\n<0d3c> <5e61>\n<0d3d> <808c>\n<0d3e> <7551>\n<0d3f> <7560>\n<0d40> <516b>\n<0d41> <9262>\n<0d42> <6e8c>\n<0d43> <767a>\n<0d44> <9197>\n<0d45> <9aea>\n<0d46> <4f10>\n<0d47> <7f70>\n<0d48> <629c>\n<0d49> <7b4f>\n<0d4a> <95a5>\n<0d4b> <9ce9>\n<0d4c> <567a>\n<0d4d> <5859>\n<0d4e> <86e4>\n<0d4f> <96bc>\n<0d50> <4f34>\n<0d51> <5224>\n<0d52> <534a>\n<0d53> <53cd>\n<0d54> <53db>\n<0d55> <5e06>\n<0d56> <642c>\n<0d57> <6591>\n<0d58> <677f>\n<0d59> <6c3e>\n<0d5a> <6c4e>\n<0d5b> <7248>\n<0d5c> <72af>\n<0d5d> <73ed>\n<0d5e> <7554>\n<0d5f> <7e41>\n<0d60> <822c>\n<0d61> <85e9>\n<0d62> <8ca9>\n<0d63> <7bc4>\n<0d64> <91c6>\n<0d65> <7169>\n<0d66> <9812>\n<0d67> <98ef>\n<0d68> <633d>\n<0d69> <6669>\n<0d6a> <756a>\n<0d6b> <76e4>\n<0d6c> <78d0>\n<0d6d> <8543>\n<0d6e> <86ee>\n<0d6f> <532a>\n<0d70> <5351>\n<0d71> <5426>\n<0d72> <5983>\n<0d73> <5e87>\n<0d74> <5f7c>\n<0d75> <60b2>\n<0d76> <6249>\n<0d77> <6279>\n<0d78> <62ab>\n<0d79> <6590>\n<0d7a> <6bd4>\n<0d7b> <6ccc>\n<0d7c> <75b2>\n<0d7d> <76ae>\n<0d7e> <7891>\n<0d7f> <79d8>\n<0d80> <7dcb>\n<0d81> <7f77>\nendbfchar\n\n100 beginbfchar\n<0d82> <80a5>\n<0d83> <88ab>\n<0d84> <8ab9>\n<0d85> <8cbb>\n<0d86> <907f>\n<0d87> <975e>\n<0d88> <98db>\n<0d89> <6a0b>\n<0d8a> <7c38>\n<0d8b> <5099>\n<0d8c> <5c3e>\n<0d8d> <5fae>\n<0d8e> <6787>\n<0d8f> <6bd8>\n<0d90> <7435>\n<0d91> <7709>\n<0d92> <7f8e>\n<0d93> <9f3b>\n<0d94> <67ca>\n<0d95> <7a17>\n<0d96> <5339>\n<0d97> <758b>\n<0d98> <9aed>\n<0d99> <5f66>\n<0d9a> <819d>\n<0d9b> <83f1>\n<0d9c> <8098>\n<0d9d> <5f3c>\n<0d9e> <5fc5>\n<0d9f> <7562>\n<0da0> <7b46>\n<0da1> <903c>\n<0da2> <6867>\n<0da3> <59eb>\n<0da4> <5a9b>\n<0da5> <7d10>\n<0da6> <767e>\n<0da7> <8b2c>\n<0da8> <4ff5>\n<0da9> <5f6a>\n<0daa> <6a19>\n<0dab> <6c37>\n<0dac> <6f02>\n<0dad> <74e2>\n<0dae> <7968>\n<0daf> <8868>\n<0db0> <8a55>\n<0db1> <8c79>\n<0db2> <5edf>\n<0db3> <63cf>\n<0db4> <75c5>\n<0db5> <79d2>\n<0db6> <82d7>\n<0db7> <9328>\n<0db8> <92f2>\n<0db9> <849c>\n<0dba> <86ed>\n<0dbb> <9c2d>\n<0dbc> <54c1>\n<0dbd> <5f6c>\n<0dbe> <658c>\n<0dbf> <6d5c>\n<0dc0> <7015>\n<0dc1> <8ca7>\n<0dc2> <8cd3>\n<0dc3> <983b>\n<0dc4> <654f>\n<0dc5> <74f6>\n<0dc6> <4e0d>\n<0dc7> <4ed8>\n<0dc8> <57e0>\n<0dc9> <592b>\n<0dca> <5a66>\n<0dcb> <5bcc>\n<0dcc> <51a8>\n<0dcd> <5e03>\n<0dce> <5e9c>\n<0dcf> <6016>\n<0dd0> <6276>\n<0dd1> <6577>\n<0dd2> <65a7>\n<0dd3> <666e>\n<0dd4> <6d6e>\n<0dd5> <7236>\n<0dd6> <7b26>\n<0dd7> <8150>\n<0dd8> <819a>\n<0dd9> <8299>\n<0dda> <8b5c>\n<0ddb> <8ca0>\n<0ddc> <8ce6>\n<0ddd> <8d74>\n<0dde> <961c>\n<0ddf> <9644>\n<0de0> <4fae>\n<0de1> <64ab>\n<0de2> <6b66>\n<0de3> <821e>\n<0de4> <8461>\n<0de5> <856a>\nendbfchar\n\n100 beginbfchar\n<0de6> <90e8>\n<0de7> <5c01>\n<0de8> <6953>\n<0de9> <98a8>\n<0dea> <847a>\n<0deb> <8557>\n<0dec> <4f0f>\n<0ded> <526f>\n<0dee> <5fa9>\n<0def> <5e45>\n<0df0> <670d>\n<0df1> <798f>\n<0df2> <8179>\n<0df3> <8907>\n<0df4> <8986>\n<0df5> <6df5>\n<0df6> <5f17>\n<0df7> <6255>\n<0df8> <6cb8>\n<0df9> <4ecf>\n<0dfa> <7269>\n<0dfb> <9b92>\n<0dfc> <5206>\n<0dfd> <543b>\n<0dfe> <5674>\n<0dff> <58b3>\n<0e00> <61a4>\n<0e01> <626e>\n<0e02> <711a>\n<0e03> <596e>\n<0e04> <7c89>\n<0e05> <7cde>\n<0e06> <7d1b>\n<0e07> <96f0>\n<0e08> <6587>\n<0e09> <805e>\n<0e0a> <4e19>\n<0e0b> <4f75>\n<0e0c> <5175>\n<0e0d> <5840>\n<0e0e> <5e63>\n<0e0f> <5e73>\n<0e10> <5f0a>\n<0e11> <67c4>\n<0e12> <4e26>\n<0e13> <853d>\n<0e14> <9589>\n<0e15> <965b>\n<0e16> <7c73>\n<0e17> <9801>\n<0e18> <50fb>\n<0e19> <58c1>\n<0e1a> <7656>\n<0e1b> <78a7>\n<0e1c> <5225>\n<0e1d> <77a5>\n<0e1e> <8511>\n<0e1f> <7b86>\n<0e20> <504f>\n<0e21> <5909>\n<0e22> <7247>\n<0e23> <7bc7>\n<0e24> <7de8>\n<0e25> <8fba>\n<0e26> <8fd4>\n<0e27> <904d>\n<0e28> <4fbf>\n<0e29> <52c9>\n<0e2a> <5a29>\n<0e2b> <5f01>\n<0e2c> <97ad>\n<0e2d> <4fdd>\n<0e2e> <8217>\n<0e2f> <92ea>\n<0e30> <5703>\n<0e31> <6355>\n<0e32> <6b69>\n<0e33> <752b>\n<0e34> <88dc>\n<0e35> <8f14>\n<0e36> <7a42>\n<0e37> <52df>\n<0e38> <5893>\n<0e39> <6155>\n<0e3a> <620a>\n<0e3b> <66ae>\n<0e3c> <6bcd>\n<0e3d> <7c3f>\n<0e3e> <83e9>\n<0e3f> <5023>\n<0e40> <4ff8>\n<0e41> <5305>\n<0e42> <5446>\n<0e43> <5831>\n<0e44> <5949>\n<0e45> <5b9d>\n<0e46> <5cf0>\n<0e47> <5cef>\n<0e48> <5d29>\n<0e49> <5e96>\nendbfchar\n\n100 beginbfchar\n<0e4a> <62b1>\n<0e4b> <6367>\n<0e4c> <653e>\n<0e4d> <65b9>\n<0e4e> <670b>\n<0e4f> <6cd5>\n<0e50> <6ce1>\n<0e51> <70f9>\n<0e52> <7832>\n<0e53> <7e2b>\n<0e54> <80de>\n<0e55> <82b3>\n<0e56> <840c>\n<0e57> <84ec>\n<0e58> <8702>\n<0e59> <8912>\n<0e5a> <8a2a>\n<0e5b> <8c4a>\n<0e5c> <90a6>\n<0e5d> <92d2>\n<0e5e> <98fd>\n<0e5f> <9cf3>\n<0e60> <9d6c>\n<0e61> <4e4f>\n<0e62> <4ea1>\n<0e63> <508d>\n<0e64> <5256>\n<0e65> <574a>\n<0e66> <59a8>\n<0e67> <5e3d>\n<0e6a> <623f>\n<0e6b> <66b4>\n<0e6c> <671b>\n<0e6d> <67d0>\n<0e6e> <68d2>\n<0e6f> <5192>\n<0e70> <7d21>\n<0e71> <80aa>\n<0e72> <81a8>\n<0e73> <8b00>\n<0e74> <8c8c>\n<0e75> <8cbf>\n<0e76> <927e>\n<0e77> <9632>\n<0e78> <5420>\n<0e79> <982c>\n<0e7a> <5317>\n<0e7b> <50d5>\n<0e7c> <535c>\n<0e7d> <58a8>\n<0e7e> <64b2>\n<0e7f> <6734>\n<0e80> <7267>\n<0e81> <7766>\n<0e82> <7a46>\n<0e83> <91e6>\n<0e84> <52c3>\n<0e85> <6ca1>\n<0e86> <6b86>\n<0e87> <5800>\n<0e88> <5e4c>\n<0e89> <5954>\n<0e8a> <672c>\n<0e8b> <7ffb>\n<0e8c> <51e1>\n<0e8d> <76c6>\n<0e8e> <6469>\n<0e8f> <78e8>\n<0e90> <9b54>\n<0e91> <9ebb>\n<0e92> <57cb>\n<0e93> <59b9>\n<0e94> <6627>\n<0e95> <679a>\n<0e96> <6bce>\n<0e97> <54e9>\n<0e98> <69d9>\n<0e99> <5e55>\n<0e9a> <819c>\n<0e9b> <6795>\n<0e9c> <9baa>\n<0e9d> <67fe>\n<0e9e> <9c52>\n<0e9f> <685d>\n<0ea0> <4ea6>\n<0ea1> <4fe3>\n<0ea2> <53c8>\n<0ea3> <62b9>\n<0ea4> <672b>\n<0ea5> <6cab>\n<0ea6> <8fc4>\n<0ea7> <4fad>\n<0ea8> <7e6d>\n<0ea9> <9ebf>\n<0eaa> <4e07>\n<0eab> <6162>\n<0eac> <6e80>\n<0ead> <6f2b>\n<0eae> <8513>\n<0eaf> <5473>\nendbfchar\n\n100 beginbfchar\n<0eb0> <672a>\n<0eb1> <9b45>\n<0eb2> <5df3>\n<0eb3> <7b95>\n<0eb4> <5cac>\n<0eb5> <5bc6>\n<0eb6> <871c>\n<0eb7> <6e4a>\n<0eb8> <84d1>\n<0eb9> <7a14>\n<0eba> <8108>\n<0ebb> <5999>\n<0ebc> <7c8d>\n<0ebd> <6c11>\n<0ebe> <7720>\n<0ebf> <52d9>\n<0ec0> <5922>\n<0ec1> <7121>\n<0ec2> <725f>\n<0ec3> <77db>\n<0ec4> <9727>\n<0ec5> <9d61>\n<0ec6> <690b>\n<0ec7> <5a7f>\n<0ec8> <5a18>\n<0ec9> <51a5>\n<0eca> <540d>\n<0ecb> <547d>\n<0ecc> <660e>\n<0ecd> <76df>\n<0ece> <8ff7>\n<0ecf> <9298>\n<0ed0> <9cf4>\n<0ed1> <59ea>\n<0ed2> <725d>\n<0ed3> <6ec5>\n<0ed4> <514d>\n<0ed5> <68c9>\n<0ed6> <7dbf>\n<0ed7> <7dec>\n<0ed8> <9762>\n<0ed9> <9eba>\n<0eda> <6478>\n<0edb> <6a21>\n<0edc> <8302>\n<0edd> <5984>\n<0ede> <5b5f>\n<0edf> <6bdb>\n<0ee0> <731b>\n<0ee1> <76f2>\n<0ee2> <7db2>\n<0ee3> <8017>\n<0ee4> <8499>\n<0ee5> <5132>\n<0ee6> <6728>\n<0ee7> <9ed9>\n<0ee8> <76ee>\n<0ee9> <6762>\n<0eea> <52ff>\n<0eeb> <9905>\n<0eec> <5c24>\n<0eed> <623b>\n<0eee> <7c7e>\n<0eef> <8cb0>\n<0ef0> <554f>\n<0ef1> <60b6>\n<0ef2> <7d0b>\n<0ef3> <9580>\n<0ef4> <5301>\n<0ef5> <4e5f>\n<0ef6> <51b6>\n<0ef7> <591c>\n<0ef8> <723a>\n<0ef9> <8036>\n<0efa> <91ce>\n<0efb> <5f25>\n<0efc> <77e2>\n<0efd> <5384>\n<0efe> <5f79>\n<0eff> <7d04>\n<0f00> <85ac>\n<0f01> <8a33>\n<0f02> <8e8d>\n<0f03> <9756>\n<0f04> <67f3>\n<0f05> <85ae>\n<0f06> <9453>\n<0f07> <6109>\n<0f08> <6108>\n<0f09> <6cb9>\n<0f0a> <7652>\n<0f0b> <8aed>\n<0f0c> <8f38>\n<0f0d> <552f>\n<0f0e> <4f51>\n<0f0f> <512a>\n<0f10> <52c7>\n<0f11> <53cb>\n<0f12> <5ba5>\n<0f13> <5e7d>\nendbfchar\n\n100 beginbfchar\n<0f14> <60a0>\n<0f15> <6182>\n<0f16> <63d6>\n<0f17> <6709>\n<0f18> <67da>\n<0f19> <6e67>\n<0f1a> <6d8c>\n<0f1d> <7531>\n<0f1e> <7950>\n<0f1f> <88d5>\n<0f20> <8a98>\n<0f21> <904a>\n<0f22> <9091>\n<0f23> <90f5>\n<0f24> <96c4>\n<0f25> <878d>\n<0f26> <5915>\n<0f27> <4e88>\n<0f28> <4f59>\n<0f29> <4e0e>\n<0f2a> <8a89>\n<0f2b> <8f3f>\n<0f2c> <9810>\n<0f2d> <50ad>\n<0f2e> <5e7c>\n<0f2f> <5996>\n<0f30> <5bb9>\n<0f31> <5eb8>\n<0f32> <63da>\n<0f33> <63fa>\n<0f34> <64c1>\n<0f35> <66dc>\n<0f36> <694a>\n<0f37> <69d8>\n<0f38> <6d0b>\n<0f39> <6eb6>\n<0f3a> <7194>\n<0f3b> <7528>\n<0f3c> <7aaf>\n<0f3d> <7f8a>\n<0f3e> <8000>\n<0f3f> <8449>\n<0f40> <84c9>\n<0f41> <8981>\n<0f42> <8b21>\n<0f43> <8e0a>\n<0f44> <9065>\n<0f45> <967d>\n<0f46> <990a>\n<0f47> <617e>\n<0f48> <6291>\n<0f49> <6b32>\n<0f4a> <6c83>\n<0f4b> <6d74>\n<0f4c> <7fcc>\n<0f4d> <7ffc>\n<0f4e> <6dc0>\n<0f4f> <7f85>\n<0f50> <87ba>\n<0f51> <88f8>\n<0f52> <6765>\n<0f53> <83b1>\n<0f54> <983c>\n<0f55> <96f7>\n<0f56> <6d1b>\n<0f57> <7d61>\n<0f58> <843d>\n<0f59> <916a>\n<0f5a> <4e71>\n<0f5b> <5375>\n<0f5c> <5d50>\n<0f5d> <6b04>\n<0f5e> <6feb>\n<0f5f> <85cd>\n<0f60> <862d>\n<0f61> <89a7>\n<0f62> <5229>\n<0f63> <540f>\n<0f64> <5c65>\n<0f65> <674e>\n<0f66> <68a8>\n<0f67> <7406>\n<0f68> <7483>\n<0f69> <75e2>\n<0f6a> <88cf>\n<0f6b> <88e1>\n<0f6c> <91cc>\n<0f6d> <96e2>\n<0f6e> <9678>\n<0f6f> <5f8b>\n<0f70> <7387>\n<0f71> <7acb>\n<0f72> <844e>\n<0f73> <63a0>\n<0f74> <7565>\n<0f75> <5289>\n<0f76> <6d41>\n<0f77> <6e9c>\n<0f78> <7409>\n<0f79> <7559>\nendbfchar\n\n100 beginbfchar\n<0f7a> <786b>\n<0f7b> <7c92>\n<0f7c> <9686>\n<0f7d> <7adc>\n<0f7e> <9f8d>\n<0f7f> <4fb6>\n<0f80> <616e>\n<0f81> <65c5>\n<0f82> <865c>\n<0f83> <4e86>\n<0f84> <4eae>\n<0f85> <50da>\n<0f86> <4e21>\n<0f87> <51cc>\n<0f88> <5bee>\n<0f89> <6599>\n<0f8a> <6881>\n<0f8b> <6dbc>\n<0f8c> <731f>\n<0f8d> <7642>\n<0f8e> <77ad>\n<0f8f> <7a1c>\n<0f90> <7ce7>\n<0f91> <826f>\n<0f92> <8ad2>\n<0f93> <907c>\n<0f94> <91cf>\n<0f95> <9675>\n<0f96> <9818>\n<0f97> <529b>\n<0f98> <7dd1>\n<0f99> <502b>\n<0f9a> <5398>\n<0f9b> <6797>\n<0f9c> <6dcb>\n<0f9d> <71d0>\n<0f9e> <7433>\n<0f9f> <81e8>\n<0fa0> <8f2a>\n<0fa1> <96a3>\n<0fa2> <9c57>\n<0fa3> <9e9f>\n<0fa4> <7460>\n<0fa5> <5841>\n<0fa6> <6d99>\n<0fa7> <7d2f>\n<0fa8> <985e>\n<0fa9> <4ee4>\n<0faa> <4f36>\n<0fab> <4f8b>\n<0fac> <51b7>\n<0fad> <52b1>\n<0fae> <5dba>\n<0faf> <601c>\n<0fb0> <73b2>\n<0fb1> <793c>\n<0fb2> <82d3>\n<0fb3> <9234>\n<0fb4> <96b7>\n<0fb5> <96f6>\n<0fb6> <970a>\n<0fb7> <9e97>\n<0fb8> <9f62>\n<0fb9> <66a6>\n<0fba> <6b74>\n<0fbb> <5217>\n<0fbc> <52a3>\n<0fbd> <70c8>\n<0fbe> <88c2>\n<0fbf> <5ec9>\n<0fc0> <604b>\n<0fc1> <6190>\n<0fc2> <6f23>\n<0fc3> <7149>\n<0fc4> <7c3e>\n<0fc5> <7df4>\n<0fc6> <806f>\n<0fc7> <84ee>\n<0fc8> <9023>\n<0fc9> <932c>\n<0fca> <5442>\n<0fcb> <9b6f>\n<0fcc> <6ad3>\n<0fcd> <7089>\n<0fce> <8cc2>\n<0fcf> <8def>\n<0fd0> <9732>\n<0fd1> <52b4>\n<0fd2> <5a41>\n<0fd3> <5eca>\n<0fd4> <5f04>\n<0fd5> <6717>\n<0fd6> <697c>\n<0fd7> <6994>\n<0fd8> <6d6a>\n<0fd9> <6f0f>\n<0fda> <7262>\n<0fdb> <72fc>\n<0fdc> <7bed>\n<0fdd> <8001>\nendbfchar\n\n100 beginbfchar\n<0fde> <807e>\n<0fdf> <874b>\n<0fe0> <90ce>\n<0fe1> <516d>\n<0fe2> <9e93>\n<0fe3> <7984>\n<0fe4> <808b>\n<0fe5> <9332>\n<0fe6> <8ad6>\n<0fe7> <502d>\n<0fe8> <548c>\n<0fe9> <8a71>\n<0fea> <6b6a>\n<0feb> <8cc4>\n<0fec> <8107>\n<0fed> <60d1>\n<0fee> <67a0>\n<0fef> <9df2>\n<0ff0> <4e99>\n<0ff1> <4e98>\n<0ff2> <9c10>\n<0ff3> <8a6b>\n<0ff4> <85c1>\n<0ff5> <8568>\n<0ff6> <6900>\n<0ff7> <6e7e>\n<0ff8> <7897>\n<0ff9> <8155>\n<0ffa> <5f0c>\n<0ffb> <4e10>\n<0ffc> <4e15>\n<0ffd> <4e2a>\n<0ffe> <4e31>\n<0fff> <4e36>\n<1000> <4e3c>\n<1001> <4e3f>\n<1002> <4e42>\n<1003> <4e56>\n<1004> <4e58>\n<1005> <4e82>\n<1006> <4e85>\n<1007> <8c6b>\n<1008> <4e8a>\n<1009> <8212>\n<100a> <5f0d>\n<100b> <4e8e>\n<100f> <4ea2>\n<1010> <4eb0>\n<1011> <4eb3>\n<1012> <4eb6>\n<1013> <4ece>\n<1014> <4ecd>\n<1015> <4ec4>\n<1016> <4ec6>\n<1017> <4ec2>\n<1018> <4ed7>\n<1019> <4ede>\n<101a> <4eed>\n<101b> <4edf>\n<101c> <4ef7>\n<101d> <4f09>\n<101e> <4f5a>\n<101f> <4f30>\n<1020> <4f5b>\n<1021> <4f5d>\n<1022> <4f57>\n<1023> <4f47>\n<1024> <4f76>\n<1025> <4f88>\n<1026> <4f8f>\n<1027> <4f98>\n<1028> <4f7b>\n<1029> <4f69>\n<102a> <4f70>\n<102b> <4f91>\n<102c> <4f6f>\n<102d> <4f86>\n<102e> <4f96>\n<102f> <5118>\n<1030> <4fd4>\n<1031> <4fdf>\n<1032> <4fce>\n<1033> <4fd8>\n<1034> <4fdb>\n<1035> <4fd1>\n<1036> <4fda>\n<1037> <4fd0>\n<103a> <501a>\n<103b> <5028>\n<103c> <5014>\n<103d> <502a>\n<103e> <5025>\n<103f> <5005>\n<1040> <4f1c>\n<1041> <4ff6>\n<1042> <5021>\n<1043> <5029>\n<1044> <502c>\n<1045> <4ffe>\n<1046> <4fef>\nendbfchar\n\n100 beginbfchar\n<1047> <5011>\n<1048> <5006>\n<1049> <5043>\n<104a> <5047>\n<104b> <6703>\n<104c> <5055>\n<104d> <5050>\n<104e> <5048>\n<104f> <505a>\n<1050> <5056>\n<1051> <506c>\n<1052> <5078>\n<1053> <5080>\n<1054> <509a>\n<1055> <5085>\n<1056> <50b4>\n<1057> <50b2>\n<105a> <50b3>\n<105b> <50c2>\n<105c> <50d6>\n<105d> <50de>\n<105e> <50e5>\n<105f> <50ed>\n<1060> <50e3>\n<1061> <50ee>\n<1062> <50f9>\n<1063> <50f5>\n<1064> <5109>\n<1067> <5116>\n<1068> <5115>\n<1069> <5114>\n<106a> <511a>\n<106b> <5121>\n<106c> <513a>\n<106d> <5137>\n<106e> <513c>\n<106f> <513b>\n<1072> <5152>\n<1073> <514c>\n<1074> <5154>\n<1075> <5162>\n<1076> <7af8>\n<1079> <516e>\n<107a> <5180>\n<107b> <5182>\n<107c> <56d8>\n<107d> <518c>\n<107e> <5189>\n<107f> <518f>\n<1080> <5191>\n<1081> <5193>\n<1084> <51a4>\n<1085> <51a6>\n<1086> <51a2>\n<108a> <51b3>\n<108d> <51b0>\n<108e> <51b5>\n<108f> <51bd>\n<1090> <51c5>\n<1091> <51c9>\n<1092> <51db>\n<1093> <51e0>\n<1094> <8655>\n<1095> <51e9>\n<1096> <51ed>\n<1097> <51f0>\n<1098> <51f5>\n<1099> <51fe>\n<109a> <5204>\n<109b> <520b>\n<109c> <5214>\n<109d> <520e>\n<109e> <5227>\n<109f> <522a>\n<10a0> <522e>\n<10a1> <5233>\n<10a2> <5239>\n<10a3> <524f>\n<10a4> <5244>\n<10a7> <525e>\n<10a8> <5254>\n<10a9> <526a>\n<10aa> <5274>\n<10ab> <5269>\n<10ac> <5273>\n<10ad> <527f>\n<10ae> <527d>\n<10af> <528d>\n<10b0> <5294>\n<10b1> <5292>\n<10b2> <5271>\n<10b3> <5288>\n<10b4> <5291>\n<10b5> <8fa8>\n<10b6> <8fa7>\n<10b9> <52bc>\n<10ba> <52b5>\n<10bb> <52c1>\n<10bc> <52cd>\n<10bd> <52d7>\nendbfchar\n\n100 beginbfchar\n<10be> <52de>\n<10bf> <52e3>\n<10c0> <52e6>\n<10c1> <98ed>\n<10c2> <52e0>\n<10c3> <52f3>\n<10c4> <52f5>\n<10c7> <5306>\n<10c8> <5308>\n<10c9> <7538>\n<10ca> <530d>\n<10cb> <5310>\n<10cc> <530f>\n<10cd> <5315>\n<10ce> <531a>\n<10cf> <5323>\n<10d0> <532f>\n<10d1> <5331>\n<10d2> <5333>\n<10d3> <5338>\n<10d4> <5340>\n<10d5> <5346>\n<10d6> <5345>\n<10d7> <4e17>\n<10d8> <5349>\n<10d9> <534d>\n<10da> <51d6>\n<10db> <535e>\n<10dc> <5369>\n<10dd> <536e>\n<10de> <5918>\n<10df> <537b>\n<10e0> <5377>\n<10e1> <5382>\n<10e2> <5396>\n<10e3> <53a0>\n<10e4> <53a6>\n<10e5> <53a5>\n<10e6> <53ae>\n<10e7> <53b0>\n<10e8> <53b6>\n<10e9> <53c3>\n<10ea> <7c12>\n<10eb> <96d9>\n<10ec> <53df>\n<10ed> <66fc>\n<10ee> <71ee>\n<10ef> <53ee>\n<10f0> <53e8>\n<10f1> <53ed>\n<10f2> <53fa>\n<10f3> <5401>\n<10f4> <543d>\n<10f5> <5440>\n<10f8> <543c>\n<10f9> <542e>\n<10fa> <5436>\n<10fb> <5429>\n<10fc> <541d>\n<10fd> <544e>\n<10fe> <548f>\n<10ff> <5475>\n<1100> <548e>\n<1101> <545f>\n<1102> <5471>\n<1103> <5477>\n<1104> <5470>\n<1105> <5492>\n<1106> <547b>\n<1107> <5480>\n<1108> <5476>\n<1109> <5484>\n<110a> <5490>\n<110b> <5486>\n<110c> <54c7>\n<110d> <54a2>\n<110e> <54b8>\n<110f> <54a5>\n<1110> <54ac>\n<1111> <54c4>\n<1112> <54c8>\n<1113> <54a8>\n<1114> <54ab>\n<1115> <54c2>\n<1116> <54a4>\n<1117> <54be>\n<1118> <54bc>\n<1119> <54d8>\n<111c> <550f>\n<111d> <5514>\n<111e> <54fd>\n<111f> <54ee>\n<1120> <54ed>\n<1121> <54fa>\n<1122> <54e2>\n<1123> <5539>\n<1124> <5540>\n<1125> <5563>\n<1126> <554c>\n<1127> <552e>\nendbfchar\n\n100 beginbfchar\n<1128> <555c>\n<1129> <5545>\n<112c> <5538>\n<112d> <5533>\n<112e> <555d>\n<112f> <5599>\n<1130> <5580>\n<1131> <54af>\n<1132> <558a>\n<1133> <559f>\n<1134> <557b>\n<1135> <557e>\n<1136> <5598>\n<1137> <559e>\n<1138> <55ae>\n<1139> <557c>\n<113a> <5583>\n<113b> <55a9>\n<113c> <5587>\n<113d> <55a8>\n<113e> <55da>\n<113f> <55c5>\n<1140> <55df>\n<1141> <55c4>\n<1142> <55dc>\n<1143> <55e4>\n<1144> <55d4>\n<1145> <5614>\n<1146> <55f7>\n<1147> <5616>\n<1148> <55fe>\n<1149> <55fd>\n<114a> <561b>\n<114b> <55f9>\n<114c> <564e>\n<114d> <5650>\n<114e> <71df>\n<114f> <5634>\n<1150> <5636>\n<1151> <5632>\n<1152> <5638>\n<1153> <566b>\n<1154> <5664>\n<1155> <562f>\n<1156> <566c>\n<1157> <566a>\n<1158> <5686>\n<1159> <5680>\n<115a> <568a>\n<115b> <56a0>\n<115c> <5694>\n<115d> <568f>\n<115e> <56a5>\n<115f> <56ae>\n<1160> <56b6>\n<1161> <56b4>\n<1162> <56c2>\n<1163> <56bc>\n<1164> <56c1>\n<1165> <56c3>\n<1166> <56c0>\n<1167> <56c8>\n<1168> <56ce>\n<1169> <56d1>\n<116a> <56d3>\n<116b> <56d7>\n<116c> <56ee>\n<116d> <56f9>\n<116e> <5700>\n<116f> <56ff>\n<1170> <5704>\n<1171> <5709>\n<1172> <5708>\n<1173> <570b>\n<1174> <570d>\n<1175> <5713>\n<1176> <5718>\n<1177> <5716>\n<1178> <55c7>\n<1179> <571c>\n<117a> <5726>\n<117d> <574e>\n<117e> <573b>\n<117f> <5740>\n<1180> <574f>\n<1181> <5769>\n<1182> <57c0>\n<1183> <5788>\n<1184> <5761>\n<1185> <577f>\n<1186> <5789>\n<1187> <5793>\n<1188> <57a0>\n<1189> <57b3>\n<118a> <57a4>\n<118b> <57aa>\n<118c> <57b0>\n<118d> <57c3>\n<118e> <57c6>\n<118f> <57d4>\nendbfchar\n\n100 beginbfchar\n<1192> <580a>\n<1193> <57d6>\n<1194> <57e3>\n<1195> <580b>\n<1196> <5819>\n<1197> <581d>\n<1198> <5872>\n<1199> <5821>\n<119a> <5862>\n<119b> <584b>\n<119c> <5870>\n<119d> <6bc0>\n<119e> <5852>\n<119f> <583d>\n<11a0> <5879>\n<11a1> <5885>\n<11a2> <58b9>\n<11a3> <589f>\n<11a4> <58ab>\n<11a5> <58ba>\n<11a6> <58de>\n<11a7> <58bb>\n<11a8> <58b8>\n<11a9> <58ae>\n<11aa> <58c5>\n<11ab> <58d3>\n<11ac> <58d1>\n<11ad> <58d7>\n<11ae> <58d9>\n<11af> <58d8>\n<11b0> <58e5>\n<11b1> <58dc>\n<11b2> <58e4>\n<11b3> <58df>\n<11b4> <58ef>\n<11b5> <58fa>\n<11b6> <58f9>\n<11ba> <5902>\n<11bb> <590a>\n<11bc> <5910>\n<11bd> <591b>\n<11be> <68a6>\n<11bf> <5925>\n<11c2> <5932>\n<11c3> <5938>\n<11c4> <593e>\n<11c5> <7ad2>\n<11c6> <5955>\n<11c7> <5950>\n<11c8> <594e>\n<11c9> <595a>\n<11ca> <5958>\n<11cb> <5962>\n<11cc> <5960>\n<11cd> <5967>\n<11ce> <596c>\n<11cf> <5969>\n<11d0> <5978>\n<11d1> <5981>\n<11d2> <599d>\n<11d3> <4f5e>\n<11d4> <4fab>\n<11d5> <59a3>\n<11d6> <59b2>\n<11d7> <59c6>\n<11d8> <59e8>\n<11d9> <59dc>\n<11da> <598d>\n<11dd> <5a25>\n<11de> <5a1f>\n<11df> <5a11>\n<11e0> <5a1c>\n<11e1> <5a09>\n<11e2> <5a1a>\n<11e3> <5a40>\n<11e4> <5a6c>\n<11e5> <5a49>\n<11e8> <5a62>\n<11e9> <5a6a>\n<11ea> <5a9a>\n<11eb> <5abc>\n<11ec> <5abe>\n<11ed> <5acb>\n<11ee> <5ac2>\n<11ef> <5abd>\n<11f0> <5ae3>\n<11f1> <5ad7>\n<11f2> <5ae6>\n<11f3> <5ae9>\n<11f4> <5ad6>\n<11f7> <5b0c>\n<11f8> <5b0b>\n<11f9> <5b16>\n<11fa> <5b32>\n<11fb> <5ad0>\n<11fc> <5b2a>\n<11fd> <5b36>\n<11fe> <5b3e>\n<11ff> <5b43>\n<1200> <5b45>\nendbfchar\n\n100 beginbfchar\n<1201> <5b40>\n<1202> <5b51>\n<1203> <5b55>\n<1206> <5b65>\n<1207> <5b69>\n<1208> <5b70>\n<1209> <5b73>\n<120a> <5b75>\n<120b> <5b78>\n<120c> <6588>\n<120d> <5b7a>\n<120e> <5b80>\n<120f> <5b83>\n<1210> <5ba6>\n<1211> <5bb8>\n<1212> <5bc3>\n<1213> <5bc7>\n<1214> <5bc9>\n<1215> <5bd4>\n<1216> <5bd0>\n<1217> <5be4>\n<1218> <5be6>\n<1219> <5be2>\n<121a> <5bde>\n<121b> <5be5>\n<121c> <5beb>\n<121d> <5bf0>\n<121e> <5bf6>\n<121f> <5bf3>\n<1220> <5c05>\n<1223> <5c0d>\n<1224> <5c13>\n<1225> <5c20>\n<1226> <5c22>\n<1227> <5c28>\n<122a> <5c41>\n<122b> <5c46>\n<122c> <5c4e>\n<122d> <5c53>\n<122e> <5c50>\n<122f> <5c4f>\n<1230> <5b71>\n<1231> <5c6c>\n<1232> <5c6e>\n<1233> <4e62>\n<1234> <5c76>\n<1235> <5c79>\n<1236> <5c8c>\n<1237> <5c91>\n<1238> <5c94>\n<1239> <599b>\n<123a> <5cab>\n<123b> <5cbb>\n<123c> <5cb6>\n<123d> <5cbc>\n<123e> <5cb7>\n<123f> <5cc5>\n<1240> <5cbe>\n<1241> <5cc7>\n<1242> <5cd9>\n<1243> <5ce9>\n<1244> <5cfd>\n<1245> <5cfa>\n<1246> <5ced>\n<1247> <5d8c>\n<1248> <5cea>\n<1249> <5d0b>\n<124a> <5d15>\n<124b> <5d17>\n<124c> <5d5c>\n<124d> <5d1f>\n<124e> <5d1b>\n<124f> <5d11>\n<1250> <5d14>\n<1251> <5d22>\n<1252> <5d1a>\n<1253> <5d19>\n<1254> <5d18>\n<1255> <5d4c>\n<1256> <5d52>\n<1257> <5d4e>\n<1258> <5d4b>\n<1259> <5d6c>\n<125a> <5d73>\n<125b> <5d76>\n<125c> <5d87>\n<125d> <5d84>\n<125e> <5d82>\n<125f> <5da2>\n<1260> <5d9d>\n<1261> <5dac>\n<1262> <5dae>\n<1263> <5dbd>\n<1264> <5d90>\n<1265> <5db7>\n<1266> <5dbc>\n<1267> <5dc9>\n<1268> <5dcd>\n<1269> <5dd3>\n<126a> <5dd2>\nendbfchar\n\n100 beginbfchar\n<126b> <5dd6>\n<126c> <5ddb>\n<126d> <5deb>\n<126e> <5df2>\n<126f> <5df5>\n<1270> <5e0b>\n<1271> <5e1a>\n<1272> <5e19>\n<1273> <5e11>\n<1274> <5e1b>\n<1277> <5e44>\n<1278> <5e43>\n<1279> <5e40>\n<127a> <5e4e>\n<127b> <5e57>\n<127c> <5e54>\n<127d> <5e5f>\n<127e> <5e62>\n<127f> <5e64>\n<1280> <5e47>\n<1283> <5e7a>\n<1284> <9ebc>\n<1285> <5e7f>\n<1286> <5ea0>\n<1289> <5ec8>\n<128a> <5ed0>\n<128b> <5ecf>\n<128c> <5ed6>\n<128d> <5ee3>\n<128e> <5edd>\n<1291> <5ee2>\n<1292> <5ee1>\n<1295> <5eec>\n<1296> <5ef1>\n<1297> <5ef3>\n<1298> <5ef0>\n<1299> <5ef4>\n<129a> <5ef8>\n<129b> <5efe>\n<129c> <5f03>\n<129d> <5f09>\n<129e> <5f5d>\n<129f> <5f5c>\n<12a0> <5f0b>\n<12a1> <5f11>\n<12a2> <5f16>\n<12a3> <5f29>\n<12a4> <5f2d>\n<12a5> <5f38>\n<12a6> <5f41>\n<12a7> <5f48>\n<12a8> <5f4c>\n<12a9> <5f4e>\n<12aa> <5f2f>\n<12ab> <5f51>\n<12ae> <5f59>\n<12af> <5f61>\n<12b0> <5f6d>\n<12b1> <5f73>\n<12b2> <5f77>\n<12b3> <5f83>\n<12b4> <5f82>\n<12b5> <5f7f>\n<12b6> <5f8a>\n<12b7> <5f88>\n<12b8> <5f91>\n<12b9> <5f87>\n<12ba> <5f9e>\n<12bb> <5f99>\n<12bc> <5f98>\n<12bd> <5fa0>\n<12be> <5fa8>\n<12bf> <5fad>\n<12c0> <5fbc>\n<12c1> <5fd6>\n<12c2> <5ffb>\n<12c3> <5fe4>\n<12c4> <5ff8>\n<12c5> <5ff1>\n<12c6> <5fdd>\n<12c7> <60b3>\n<12c8> <5fff>\n<12c9> <6021>\n<12ca> <6060>\n<12cb> <6019>\n<12cc> <6010>\n<12cd> <6029>\n<12ce> <600e>\n<12cf> <6031>\n<12d0> <601b>\n<12d1> <6015>\n<12d2> <602b>\n<12d3> <6026>\n<12d4> <600f>\n<12d5> <603a>\n<12d6> <605a>\n<12d7> <6041>\n<12d8> <606a>\n<12d9> <6077>\n<12da> <605f>\nendbfchar\n\n100 beginbfchar\n<12db> <604a>\n<12dc> <6046>\n<12dd> <604d>\n<12de> <6063>\n<12df> <6043>\n<12e0> <6064>\n<12e1> <6042>\n<12e2> <606c>\n<12e3> <606b>\n<12e4> <6059>\n<12e5> <6081>\n<12e6> <608d>\n<12e7> <60e7>\n<12e8> <6083>\n<12e9> <609a>\n<12ea> <6084>\n<12eb> <609b>\n<12ee> <6092>\n<12ef> <60a7>\n<12f0> <608b>\n<12f1> <60e1>\n<12f2> <60b8>\n<12f3> <60e0>\n<12f4> <60d3>\n<12f5> <60b4>\n<12f6> <5ff0>\n<12f7> <60bd>\n<12f8> <60c6>\n<12f9> <60b5>\n<12fa> <60d8>\n<12fb> <614d>\n<12fc> <6115>\n<12fd> <6106>\n<1300> <6100>\n<1301> <60f4>\n<1302> <60fa>\n<1303> <6103>\n<1304> <6121>\n<1305> <60fb>\n<1306> <60f1>\n<1309> <6147>\n<130a> <613e>\n<130b> <6128>\n<130c> <6127>\n<130d> <614a>\n<130e> <613f>\n<130f> <613c>\n<1310> <612c>\n<1311> <6134>\n<1312> <613d>\n<1313> <6142>\n<1314> <6144>\n<1315> <6173>\n<1316> <6177>\n<131a> <616b>\n<131b> <6174>\n<131c> <616f>\n<131d> <6165>\n<131e> <6171>\n<131f> <615f>\n<1320> <615d>\n<1321> <6153>\n<1322> <6175>\n<1323> <6199>\n<1324> <6196>\n<1325> <6187>\n<1326> <61ac>\n<1327> <6194>\n<1328> <619a>\n<1329> <618a>\n<132a> <6191>\n<132b> <61ab>\n<132c> <61ae>\n<132d> <61cc>\n<132e> <61ca>\n<132f> <61c9>\n<1330> <61f7>\n<1331> <61c8>\n<1332> <61c3>\n<1333> <61c6>\n<1334> <61ba>\n<1335> <61cb>\n<1336> <7f79>\n<1337> <61cd>\n<1338> <61e6>\n<1339> <61e3>\n<133a> <61f6>\n<133b> <61fa>\n<133c> <61f4>\n<133d> <61ff>\n<133e> <61fd>\n<133f> <61fc>\n<1340> <61fe>\n<1341> <6200>\n<1344> <620d>\n<1345> <620c>\n<1346> <6214>\n<1347> <621b>\n<1348> <621e>\n<1349> <6221>\nendbfchar\n\n100 beginbfchar\n<134a> <622a>\n<134b> <622e>\n<134c> <6230>\n<134f> <6241>\n<1350> <624e>\n<1351> <625e>\n<1352> <6263>\n<1353> <625b>\n<1354> <6260>\n<1355> <6268>\n<1356> <627c>\n<1357> <6282>\n<1358> <6289>\n<1359> <627e>\n<135c> <6296>\n<135d> <62d4>\n<135e> <6283>\n<135f> <6294>\n<1360> <62d7>\n<1361> <62d1>\n<1362> <62bb>\n<1363> <62cf>\n<1364> <62ff>\n<1365> <62c6>\n<1366> <64d4>\n<1367> <62c8>\n<1368> <62dc>\n<1369> <62cc>\n<136a> <62ca>\n<136b> <62c2>\n<136c> <62c7>\n<136d> <629b>\n<136e> <62c9>\n<136f> <630c>\n<1370> <62ee>\n<1371> <62f1>\n<1372> <6327>\n<1373> <6302>\n<1374> <6308>\n<1375> <62ef>\n<1376> <62f5>\n<1377> <6350>\n<1378> <633e>\n<1379> <634d>\n<137a> <641c>\n<137b> <634f>\n<137c> <6396>\n<137d> <638e>\n<137e> <6380>\n<137f> <63ab>\n<1380> <6376>\n<1381> <63a3>\n<1382> <638f>\n<1383> <6389>\n<1384> <639f>\n<1385> <63b5>\n<1386> <636b>\n<1387> <6369>\n<1388> <63be>\n<1389> <63e9>\n<138a> <63c0>\n<138b> <63c6>\n<138c> <63e3>\n<138d> <63c9>\n<138e> <63d2>\n<138f> <63f6>\n<1390> <63c4>\n<1391> <6416>\n<1392> <6434>\n<1393> <6406>\n<1394> <6413>\n<1395> <6426>\n<1396> <6436>\n<1397> <651d>\n<1398> <6417>\n<1399> <6428>\n<139a> <640f>\n<139b> <6467>\n<139c> <646f>\n<139d> <6476>\n<139e> <644e>\n<139f> <652a>\n<13a0> <6495>\n<13a1> <6493>\n<13a2> <64a5>\n<13a3> <64a9>\n<13a4> <6488>\n<13a5> <64bc>\n<13a6> <64da>\n<13a7> <64d2>\n<13a8> <64c5>\n<13a9> <64c7>\n<13aa> <64bb>\n<13ab> <64d8>\n<13ac> <64c2>\n<13ad> <64f1>\n<13ae> <64e7>\n<13af> <8209>\n<13b2> <62ac>\n<13b3> <64e3>\nendbfchar\n\n100 beginbfchar\n<13b4> <64ef>\n<13b5> <652c>\n<13b6> <64f6>\n<13b7> <64f4>\n<13b8> <64f2>\n<13b9> <64fa>\n<13ba> <6500>\n<13bb> <64fd>\n<13bc> <6518>\n<13bd> <651c>\n<13be> <6505>\n<13bf> <6524>\n<13c0> <6523>\n<13c1> <652b>\n<13c4> <6537>\n<13c5> <6536>\n<13c6> <6538>\n<13c7> <754b>\n<13c8> <6548>\n<13c9> <6556>\n<13ca> <6555>\n<13cb> <654d>\n<13cc> <6558>\n<13cd> <655e>\n<13ce> <655d>\n<13cf> <6572>\n<13d0> <6578>\n<13d3> <8b8a>\n<13d4> <659b>\n<13d5> <659f>\n<13d6> <65ab>\n<13d7> <65b7>\n<13d8> <65c3>\n<13d9> <65c6>\n<13da> <65c1>\n<13db> <65c4>\n<13dc> <65cc>\n<13dd> <65d2>\n<13de> <65db>\n<13df> <65d9>\n<13e2> <65f1>\n<13e3> <6772>\n<13e4> <660a>\n<13e5> <6603>\n<13e6> <65fb>\n<13e7> <6773>\n<13ea> <6634>\n<13eb> <661c>\n<13ec> <664f>\n<13ed> <6644>\n<13ee> <6649>\n<13ef> <6641>\n<13f0> <665e>\n<13f1> <665d>\n<13f2> <6664>\n<13f5> <665f>\n<13f6> <6662>\n<13f7> <6670>\n<13f8> <6683>\n<13f9> <6688>\n<13fa> <668e>\n<13fb> <6689>\n<13fc> <6684>\n<13fd> <6698>\n<13fe> <669d>\n<13ff> <66c1>\n<1400> <66b9>\n<1401> <66c9>\n<1402> <66be>\n<1403> <66bc>\n<1404> <66c4>\n<1405> <66b8>\n<1406> <66d6>\n<1407> <66da>\n<1408> <66e0>\n<1409> <663f>\n<140a> <66e6>\n<140b> <66e9>\n<140c> <66f0>\n<140d> <66f5>\n<140e> <66f7>\n<140f> <670f>\n<1410> <6716>\n<1411> <671e>\n<1414> <9738>\n<1415> <672e>\n<1416> <673f>\n<1417> <6736>\n<1418> <6741>\n<1419> <6738>\n<141a> <6737>\n<141b> <6746>\n<141c> <675e>\n<141d> <6760>\n<141e> <6759>\n<1421> <6789>\n<1422> <6770>\n<1423> <67a9>\n<1424> <677c>\n<1425> <676a>\nendbfchar\n\n100 beginbfchar\n<1426> <678c>\n<1427> <678b>\n<1428> <67a6>\n<1429> <67a1>\n<142a> <6785>\n<142b> <67b7>\n<142c> <67ef>\n<142d> <67b4>\n<142e> <67ec>\n<142f> <67b3>\n<1430> <67e9>\n<1431> <67b8>\n<1432> <67e4>\n<1433> <67de>\n<1434> <67dd>\n<1435> <67e2>\n<1436> <67ee>\n<1437> <67b9>\n<1438> <67ce>\n<1439> <67c6>\n<143a> <67e7>\n<143b> <6a9c>\n<143c> <681e>\n<143d> <6846>\n<143e> <6829>\n<143f> <6840>\n<1440> <684d>\n<1441> <6832>\n<1442> <684e>\n<1443> <68b3>\n<1444> <682b>\n<1445> <6859>\n<1446> <6863>\n<1447> <6877>\n<1448> <687f>\n<1449> <689f>\n<144a> <688f>\n<144b> <68ad>\n<144c> <6894>\n<144d> <689d>\n<144e> <689b>\n<144f> <6883>\n<1450> <6aae>\n<1451> <68b9>\n<1452> <6874>\n<1453> <68b5>\n<1454> <68a0>\n<1455> <68ba>\n<1456> <690f>\n<1457> <688d>\n<1458> <687e>\n<1459> <6901>\n<145a> <68ca>\n<145b> <6908>\n<145c> <68d8>\n<145d> <6922>\n<145e> <6926>\n<145f> <68e1>\n<1460> <690c>\n<1461> <68cd>\n<1462> <68d4>\n<1463> <68e7>\n<1464> <68d5>\n<1465> <6936>\n<1466> <6912>\n<1467> <6904>\n<1468> <68d7>\n<1469> <68e3>\n<146a> <6925>\n<146b> <68f9>\n<146c> <68e0>\n<146d> <68ef>\n<146e> <6928>\n<146f> <692a>\n<1470> <691a>\n<1471> <6923>\n<1472> <6921>\n<1473> <68c6>\n<1474> <6979>\n<1475> <6977>\n<1476> <695c>\n<1477> <6978>\n<1478> <696b>\n<1479> <6954>\n<147a> <697e>\n<147b> <696e>\n<147c> <6939>\n<147d> <6974>\n<147e> <693d>\n<147f> <6959>\n<1480> <6930>\n<1481> <6961>\n<1482> <695e>\n<1483> <695d>\n<1484> <6981>\n<1485> <696a>\n<1486> <69b2>\n<1487> <69ae>\n<1488> <69d0>\n<1489> <69bf>\nendbfchar\n\n100 beginbfchar\n<148a> <69c1>\n<148b> <69d3>\n<148c> <69be>\n<148d> <69ce>\n<148e> <5be8>\n<148f> <69ca>\n<1490> <69dd>\n<1491> <69bb>\n<1492> <69c3>\n<1493> <69a7>\n<1494> <6a2e>\n<1495> <6991>\n<1496> <69a0>\n<1497> <699c>\n<1498> <6995>\n<1499> <69b4>\n<149a> <69de>\n<149b> <69e8>\n<149c> <6a02>\n<149d> <6a1b>\n<149e> <69ff>\n<149f> <6b0a>\n<14a0> <69f9>\n<14a1> <69f2>\n<14a2> <69e7>\n<14a3> <6a05>\n<14a4> <69b1>\n<14a5> <6a1e>\n<14a6> <69ed>\n<14a7> <6a14>\n<14a8> <69eb>\n<14a9> <6a0a>\n<14aa> <6a12>\n<14ab> <6ac1>\n<14ac> <6a23>\n<14ad> <6a13>\n<14ae> <6a44>\n<14af> <6a0c>\n<14b0> <6a72>\n<14b1> <6a36>\n<14b2> <6a78>\n<14b3> <6a47>\n<14b4> <6a62>\n<14b5> <6a59>\n<14b6> <6a66>\n<14b7> <6a48>\n<14b8> <6a38>\n<14b9> <6a22>\n<14ba> <6a90>\n<14bb> <6a8d>\n<14bc> <6aa0>\n<14bd> <6a84>\n<14c0> <6a97>\n<14c1> <8617>\n<14c2> <6abb>\n<14c3> <6ac3>\n<14c4> <6ac2>\n<14c5> <6ab8>\n<14c6> <6ab3>\n<14c7> <6aac>\n<14c8> <6ade>\n<14c9> <6ad1>\n<14ca> <6adf>\n<14cb> <6aaa>\n<14cc> <6ada>\n<14cd> <6aea>\n<14ce> <6afb>\n<14cf> <6b05>\n<14d0> <8616>\n<14d1> <6afa>\n<14d2> <6b12>\n<14d3> <6b16>\n<14d4> <9b31>\n<14d5> <6b1f>\n<14d6> <6b38>\n<14d7> <6b37>\n<14d8> <76dc>\n<14d9> <6b39>\n<14da> <98ee>\n<14db> <6b47>\n<14dc> <6b43>\n<14dd> <6b49>\n<14de> <6b50>\n<14df> <6b59>\n<14e0> <6b54>\n<14e1> <6b5b>\n<14e2> <6b5f>\n<14e3> <6b61>\n<14e8> <6b84>\n<14e9> <6b83>\n<14ea> <6b8d>\n<14eb> <6b98>\n<14ec> <6b95>\n<14ed> <6b9e>\n<14ee> <6ba4>\n<14f1> <6baf>\n<14f2> <6bb2>\n<14f3> <6bb1>\n<14f4> <6bb3>\n<14f5> <6bb7>\nendbfchar\n\n100 beginbfchar\n<14f6> <6bbc>\n<14f7> <6bc6>\n<14f8> <6bcb>\n<14f9> <6bd3>\n<14fa> <6bdf>\n<14fb> <6bec>\n<14fc> <6beb>\n<14fd> <6bf3>\n<14fe> <6bef>\n<14ff> <9ebe>\n<1500> <6c08>\n<1503> <6c1b>\n<1504> <6c24>\n<1505> <6c23>\n<1506> <6c5e>\n<1507> <6c55>\n<1508> <6c62>\n<1509> <6c6a>\n<150a> <6c82>\n<150b> <6c8d>\n<150c> <6c9a>\n<150d> <6c81>\n<150e> <6c9b>\n<150f> <6c7e>\n<1510> <6c68>\n<1511> <6c73>\n<1512> <6c92>\n<1513> <6c90>\n<1514> <6cc4>\n<1515> <6cf1>\n<1516> <6cd3>\n<1517> <6cbd>\n<1518> <6cd7>\n<1519> <6cc5>\n<151a> <6cdd>\n<151b> <6cae>\n<151c> <6cb1>\n<151d> <6cbe>\n<151e> <6cba>\n<151f> <6cdb>\n<1520> <6cef>\n<1521> <6cd9>\n<1522> <6cea>\n<1523> <6d1f>\n<1524> <884d>\n<1525> <6d36>\n<1526> <6d2b>\n<1527> <6d3d>\n<1528> <6d38>\n<1529> <6d19>\n<152a> <6d35>\n<152b> <6d33>\n<152c> <6d12>\n<152d> <6d0c>\n<152e> <6d63>\n<152f> <6d93>\n<1530> <6d64>\n<1531> <6d5a>\n<1532> <6d79>\n<1533> <6d59>\n<1534> <6d8e>\n<1535> <6d95>\n<1536> <6fe4>\n<1537> <6d85>\n<1538> <6df9>\n<1539> <6e15>\n<153a> <6e0a>\n<153b> <6db5>\n<153c> <6dc7>\n<153d> <6de6>\n<153e> <6db8>\n<153f> <6dc6>\n<1540> <6dec>\n<1541> <6dde>\n<1542> <6dcc>\n<1543> <6de8>\n<1544> <6dd2>\n<1545> <6dc5>\n<1546> <6dfa>\n<1547> <6dd9>\n<1548> <6de4>\n<1549> <6dd5>\n<154a> <6dea>\n<154b> <6dee>\n<154c> <6e2d>\n<154d> <6e6e>\n<154e> <6e2e>\n<154f> <6e19>\n<1550> <6e72>\n<1551> <6e5f>\n<1552> <6e3e>\n<1553> <6e23>\n<1554> <6e6b>\n<1555> <6e2b>\n<1556> <6e76>\n<1557> <6e4d>\n<1558> <6e1f>\n<1559> <6e43>\n<155a> <6e3a>\n<155b> <6e4e>\nendbfchar\n\n100 beginbfchar\n<155c> <6e24>\n<155d> <6eff>\n<155e> <6e1d>\n<155f> <6e38>\n<1560> <6e82>\n<1561> <6eaa>\n<1562> <6e98>\n<1563> <6ec9>\n<1564> <6eb7>\n<1565> <6ed3>\n<1566> <6ebd>\n<1567> <6eaf>\n<1568> <6ec4>\n<1569> <6eb2>\n<156c> <6e8f>\n<156d> <6ea5>\n<156e> <6ec2>\n<156f> <6e9f>\n<1570> <6f41>\n<1571> <6f11>\n<1572> <704c>\n<1573> <6eec>\n<1574> <6ef8>\n<1575> <6efe>\n<1576> <6f3f>\n<1577> <6ef2>\n<1578> <6f31>\n<1579> <6eef>\n<157a> <6f32>\n<157b> <6ecc>\n<157c> <6f3e>\n<157d> <6f13>\n<157e> <6ef7>\n<157f> <6f86>\n<1580> <6f7a>\n<1581> <6f78>\n<1582> <6f81>\n<1583> <6f80>\n<1584> <6f6f>\n<1585> <6f5b>\n<1586> <6ff3>\n<1587> <6f6d>\n<1588> <6f82>\n<1589> <6f7c>\n<158a> <6f58>\n<158b> <6f8e>\n<158c> <6f91>\n<158d> <6fc2>\n<158e> <6f66>\n<158f> <6fb3>\n<1590> <6fa3>\n<1591> <6fa1>\n<1592> <6fa4>\n<1593> <6fb9>\n<1594> <6fc6>\n<1595> <6faa>\n<1596> <6fdf>\n<1597> <6fd5>\n<1598> <6fec>\n<1599> <6fd4>\n<159a> <6fd8>\n<159b> <6ff1>\n<159c> <6fee>\n<159d> <6fdb>\n<159e> <7009>\n<159f> <700b>\n<15a0> <6ffa>\n<15a1> <7011>\n<15a2> <7001>\n<15a3> <700f>\n<15a4> <6ffe>\n<15a5> <701b>\n<15a6> <701a>\n<15a7> <6f74>\n<15a8> <701d>\n<15a9> <7018>\n<15aa> <701f>\n<15ab> <7030>\n<15ac> <703e>\n<15ad> <7032>\n<15ae> <7051>\n<15af> <7063>\n<15b0> <7099>\n<15b1> <7092>\n<15b2> <70af>\n<15b3> <70f1>\n<15b4> <70ac>\n<15b5> <70b8>\n<15b6> <70b3>\n<15b7> <70ae>\n<15b8> <70df>\n<15b9> <70cb>\n<15ba> <70dd>\n<15bb> <70d9>\n<15bc> <7109>\n<15bd> <70fd>\n<15be> <711c>\n<15bf> <7119>\n<15c0> <7165>\n<15c1> <7155>\nendbfchar\n\n100 beginbfchar\n<15c2> <7188>\n<15c3> <7166>\n<15c4> <7162>\n<15c5> <714c>\n<15c6> <7156>\n<15c7> <716c>\n<15c8> <718f>\n<15c9> <71fb>\n<15ca> <7184>\n<15cb> <7195>\n<15cc> <71a8>\n<15cd> <71ac>\n<15ce> <71d7>\n<15cf> <71b9>\n<15d0> <71be>\n<15d1> <71d2>\n<15d2> <71c9>\n<15d3> <71d4>\n<15d4> <71ce>\n<15d5> <71e0>\n<15d6> <71ec>\n<15d7> <71e7>\n<15d8> <71f5>\n<15d9> <71fc>\n<15da> <71f9>\n<15db> <71ff>\n<15dc> <720d>\n<15dd> <7210>\n<15de> <721b>\n<15df> <7228>\n<15e0> <722d>\n<15e1> <722c>\n<15e2> <7230>\n<15e3> <7232>\n<15e8> <7246>\n<15e9> <724b>\n<15ea> <7258>\n<15eb> <7274>\n<15ec> <727e>\n<15ed> <7282>\n<15ee> <7281>\n<15ef> <7287>\n<15f0> <7292>\n<15f1> <7296>\n<15f2> <72a2>\n<15f3> <72a7>\n<15f4> <72b9>\n<15f5> <72b2>\n<15f6> <72c3>\n<15f7> <72c6>\n<15f8> <72c4>\n<15f9> <72ce>\n<15fa> <72d2>\n<15fb> <72e2>\n<15fe> <72f9>\n<15ff> <72f7>\n<1600> <500f>\n<1601> <7317>\n<1602> <730a>\n<1603> <731c>\n<1604> <7316>\n<1605> <731d>\n<1606> <7334>\n<1607> <732f>\n<1608> <7329>\n<1609> <7325>\n<160a> <733e>\n<160d> <9ed8>\n<160e> <7357>\n<160f> <736a>\n<1610> <7368>\n<1611> <7370>\n<1612> <7378>\n<1613> <7375>\n<1614> <737b>\n<1615> <737a>\n<1616> <73c8>\n<1617> <73b3>\n<1618> <73ce>\n<1619> <73bb>\n<161a> <73c0>\n<161b> <73e5>\n<161c> <73ee>\n<161d> <73de>\n<161e> <74a2>\n<161f> <7405>\n<1620> <746f>\n<1621> <7425>\n<1622> <73f8>\n<1623> <7432>\n<1624> <743a>\n<1625> <7455>\n<1626> <743f>\n<1627> <745f>\n<1628> <7459>\n<1629> <7441>\n<162a> <745c>\n<162b> <7469>\n<162c> <7470>\n<162d> <7463>\nendbfchar\n\n100 beginbfchar\n<162e> <746a>\n<162f> <7476>\n<1630> <747e>\n<1631> <748b>\n<1632> <749e>\n<1633> <74a7>\n<1634> <74ca>\n<1635> <74cf>\n<1636> <74d4>\n<1637> <73f1>\n<1638> <74e0>\n<1639> <74e3>\n<163a> <74e7>\n<163b> <74e9>\n<163c> <74ee>\n<163d> <74f2>\n<1640> <74f8>\n<1641> <74f7>\n<1642> <7504>\n<1643> <7503>\n<1644> <7505>\n<1645> <750c>\n<1646> <750e>\n<1647> <750d>\n<1648> <7515>\n<1649> <7513>\n<164a> <751e>\n<164b> <7526>\n<164c> <752c>\n<164d> <753c>\n<164e> <7544>\n<164f> <754d>\n<1650> <754a>\n<1651> <7549>\n<1652> <755b>\n<1653> <7546>\n<1654> <755a>\n<1655> <7569>\n<1656> <7564>\n<1657> <7567>\n<1658> <756b>\n<1659> <756d>\n<165a> <7578>\n<165b> <7576>\n<165e> <7574>\n<165f> <758a>\n<1660> <7589>\n<1661> <7582>\n<1662> <7594>\n<1663> <759a>\n<1664> <759d>\n<1665> <75a5>\n<1666> <75a3>\n<1667> <75c2>\n<1668> <75b3>\n<1669> <75c3>\n<166a> <75b5>\n<166b> <75bd>\n<166c> <75b8>\n<166d> <75bc>\n<166e> <75b1>\n<166f> <75cd>\n<1670> <75ca>\n<1671> <75d2>\n<1672> <75d9>\n<1673> <75e3>\n<1674> <75de>\n<1677> <75fc>\n<1678> <7601>\n<1679> <75f0>\n<167a> <75fa>\n<167d> <760b>\n<167e> <760d>\n<167f> <7609>\n<1680> <761f>\n<1681> <7627>\n<1685> <7624>\n<1686> <7634>\n<1687> <7630>\n<1688> <763b>\n<168b> <7646>\n<168c> <765c>\n<168d> <7658>\n<1693> <7667>\n<1694> <766c>\n<1695> <7670>\n<1696> <7672>\n<1697> <7676>\n<1698> <7678>\n<1699> <767c>\n<169a> <7680>\n<169b> <7683>\n<169c> <7688>\n<169d> <768b>\n<169e> <768e>\n<169f> <7696>\n<16a0> <7693>\n<16a3> <76b0>\n<16a4> <76b4>\n<16a8> <76c2>\nendbfchar\n\n100 beginbfchar\n<16a9> <76cd>\n<16aa> <76d6>\n<16ab> <76d2>\n<16ac> <76de>\n<16ad> <76e1>\n<16ae> <76e5>\n<16af> <76e7>\n<16b0> <76ea>\n<16b1> <862f>\n<16b2> <76fb>\n<16b3> <7708>\n<16b4> <7707>\n<16b5> <7704>\n<16b6> <7729>\n<16b7> <7724>\n<16b8> <771e>\n<16bb> <771b>\n<16be> <7747>\n<16bf> <775a>\n<16c0> <7768>\n<16c1> <776b>\n<16c2> <775b>\n<16c3> <7765>\n<16c4> <777f>\n<16c5> <777e>\n<16c6> <7779>\n<16c7> <778e>\n<16c8> <778b>\n<16c9> <7791>\n<16ca> <77a0>\n<16cb> <779e>\n<16cc> <77b0>\n<16cd> <77b6>\n<16ce> <77b9>\n<16cf> <77bf>\n<16d2> <77bb>\n<16d3> <77c7>\n<16d4> <77cd>\n<16d5> <77d7>\n<16d6> <77da>\n<16d7> <77dc>\n<16d8> <77e3>\n<16d9> <77ee>\n<16da> <77fc>\n<16db> <780c>\n<16dc> <7812>\n<16dd> <7926>\n<16de> <7820>\n<16df> <792a>\n<16e0> <7845>\n<16e1> <788e>\n<16e2> <7874>\n<16e3> <7886>\n<16e4> <787c>\n<16e5> <789a>\n<16e6> <788c>\n<16e7> <78a3>\n<16e8> <78b5>\n<16e9> <78aa>\n<16ea> <78af>\n<16eb> <78d1>\n<16ec> <78c6>\n<16ed> <78cb>\n<16ee> <78d4>\n<16ef> <78be>\n<16f0> <78bc>\n<16f1> <78c5>\n<16f2> <78ca>\n<16f3> <78ec>\n<16f4> <78e7>\n<16f5> <78da>\n<16f6> <78fd>\n<16f7> <78f4>\n<16f8> <7907>\n<16f9> <7912>\n<16fa> <7911>\n<16fb> <7919>\n<16fc> <792c>\n<16fd> <792b>\n<16fe> <7940>\n<16ff> <7960>\n<1700> <7957>\n<1701> <795f>\n<1702> <795a>\n<1703> <7955>\n<1704> <7953>\n<1705> <797a>\n<1706> <797f>\n<1707> <798a>\n<1708> <799d>\n<1709> <79a7>\n<170a> <9f4b>\n<170b> <79aa>\n<170c> <79ae>\n<170d> <79b3>\n<1710> <79c9>\n<1711> <79d5>\n<1712> <79e7>\n<1713> <79ec>\n<1714> <79e1>\nendbfchar\n\n100 beginbfchar\n<1715> <79e3>\n<1716> <7a08>\n<1717> <7a0d>\n<171a> <7a20>\n<171b> <7a1f>\n<171c> <7980>\n<171d> <7a31>\n<171e> <7a3b>\n<171f> <7a3e>\n<1720> <7a37>\n<1721> <7a43>\n<1722> <7a57>\n<1723> <7a49>\n<1726> <7a69>\n<1727> <9f9d>\n<1728> <7a70>\n<1729> <7a79>\n<172a> <7a7d>\n<172b> <7a88>\n<172c> <7a97>\n<172d> <7a95>\n<172e> <7a98>\n<172f> <7a96>\n<1730> <7aa9>\n<1731> <7ac8>\n<1732> <7ab0>\n<1733> <7ab6>\n<1734> <7ac5>\n<1735> <7ac4>\n<1736> <7abf>\n<1737> <9083>\n<1738> <7ac7>\n<1739> <7aca>\n<173a> <7acd>\n<173b> <7acf>\n<173c> <7ad5>\n<173d> <7ad3>\n<1740> <7add>\n<1743> <7ae6>\n<1744> <7aed>\n<1745> <7af0>\n<1746> <7b02>\n<1747> <7b0f>\n<1748> <7b0a>\n<1749> <7b06>\n<174a> <7b33>\n<174d> <7b1e>\n<174e> <7b35>\n<174f> <7b28>\n<1750> <7b36>\n<1751> <7b50>\n<1752> <7b7a>\n<1753> <7b04>\n<1754> <7b4d>\n<1755> <7b0b>\n<1756> <7b4c>\n<1757> <7b45>\n<1758> <7b75>\n<1759> <7b65>\n<175a> <7b74>\n<175b> <7b67>\n<175e> <7b6c>\n<175f> <7b6e>\n<1760> <7b9d>\n<1761> <7b98>\n<1762> <7b9f>\n<1763> <7b8d>\n<1764> <7b9c>\n<1765> <7b9a>\n<1766> <7b8b>\n<1767> <7b92>\n<1768> <7b8f>\n<1769> <7b5d>\n<176a> <7b99>\n<176b> <7bcb>\n<176c> <7bc1>\n<176d> <7bcc>\n<176e> <7bcf>\n<176f> <7bb4>\n<1770> <7bc6>\n<1771> <7bdd>\n<1772> <7be9>\n<1773> <7c11>\n<1774> <7c14>\n<1775> <7be6>\n<1776> <7be5>\n<1777> <7c60>\n<1778> <7c00>\n<1779> <7c07>\n<177a> <7c13>\n<177b> <7bf3>\n<177c> <7bf7>\n<177d> <7c17>\n<177e> <7c0d>\n<177f> <7bf6>\n<1780> <7c23>\n<1781> <7c27>\n<1782> <7c2a>\n<1783> <7c1f>\n<1784> <7c37>\nendbfchar\n\n100 beginbfchar\n<1785> <7c2b>\n<1786> <7c3d>\n<1787> <7c4c>\n<1788> <7c43>\n<1789> <7c54>\n<178a> <7c4f>\n<178b> <7c40>\n<178c> <7c50>\n<178d> <7c58>\n<178e> <7c5f>\n<178f> <7c64>\n<1790> <7c56>\n<1791> <7c65>\n<1792> <7c6c>\n<1793> <7c75>\n<1794> <7c83>\n<1795> <7c90>\n<1796> <7ca4>\n<1797> <7cad>\n<1798> <7ca2>\n<1799> <7cab>\n<179a> <7ca1>\n<179b> <7ca8>\n<179c> <7cb3>\n<179d> <7cb2>\n<179e> <7cb1>\n<179f> <7cae>\n<17a0> <7cb9>\n<17a1> <7cbd>\n<17a2> <7cc0>\n<17a3> <7cc5>\n<17a4> <7cc2>\n<17a5> <7cd8>\n<17a6> <7cd2>\n<17a7> <7cdc>\n<17a8> <7ce2>\n<17a9> <9b3b>\n<17aa> <7cef>\n<17ab> <7cf2>\n<17ac> <7cf4>\n<17ad> <7cf6>\n<17ae> <7cfa>\n<17af> <7d06>\n<17b0> <7d02>\n<17b1> <7d1c>\n<17b2> <7d15>\n<17b3> <7d0a>\n<17b4> <7d45>\n<17b5> <7d4b>\n<17b6> <7d2e>\n<17b7> <7d32>\n<17b8> <7d3f>\n<17b9> <7d35>\n<17ba> <7d46>\n<17bb> <7d73>\n<17bc> <7d56>\n<17bd> <7d4e>\n<17be> <7d72>\n<17bf> <7d68>\n<17c0> <7d6e>\n<17c1> <7d4f>\n<17c2> <7d63>\n<17c3> <7d93>\n<17c4> <7d89>\n<17c5> <7d5b>\n<17c6> <7d8f>\n<17c7> <7d7d>\n<17c8> <7d9b>\n<17c9> <7dba>\n<17ca> <7dae>\n<17cb> <7da3>\n<17cc> <7db5>\n<17cd> <7dc7>\n<17ce> <7dbd>\n<17cf> <7dab>\n<17d0> <7e3d>\n<17d1> <7da2>\n<17d2> <7daf>\n<17d3> <7ddc>\n<17d4> <7db8>\n<17d5> <7d9f>\n<17d6> <7db0>\n<17d7> <7dd8>\n<17d8> <7ddd>\n<17d9> <7de4>\n<17da> <7dde>\n<17db> <7dfb>\n<17dc> <7df2>\n<17dd> <7de1>\n<17de> <7e05>\n<17df> <7e0a>\n<17e0> <7e23>\n<17e1> <7e21>\n<17e2> <7e12>\n<17e3> <7e31>\n<17e4> <7e1f>\n<17e5> <7e09>\n<17e6> <7e0b>\n<17e7> <7e22>\n<17e8> <7e46>\nendbfchar\n\n100 beginbfchar\n<17e9> <7e66>\n<17ea> <7e3b>\n<17eb> <7e35>\n<17ec> <7e39>\n<17ed> <7e43>\n<17ee> <7e37>\n<17ef> <7e32>\n<17f0> <7e3a>\n<17f1> <7e67>\n<17f2> <7e5d>\n<17f3> <7e56>\n<17f4> <7e5e>\n<17f7> <7e79>\n<17f8> <7e6a>\n<17f9> <7e69>\n<17fa> <7e7c>\n<17fb> <7e7b>\n<17fc> <7e83>\n<17fd> <7dd5>\n<17fe> <7e7d>\n<17ff> <8fae>\n<1800> <7e7f>\n<1803> <7e8c>\n<1804> <7e92>\n<1805> <7e90>\n<1808> <7e96>\n<1809> <7e8e>\n<180c> <7f38>\n<180d> <7f3a>\n<180e> <7f45>\n<1814> <7f55>\n<1815> <7f54>\n<1816> <7f58>\n<181b> <7f67>\n<181c> <7f78>\n<181d> <7f82>\n<181e> <7f86>\n<181f> <7f83>\n<1820> <7f88>\n<1821> <7f87>\n<1822> <7f8c>\n<1823> <7f94>\n<1824> <7f9e>\n<1825> <7f9d>\n<1826> <7f9a>\n<1827> <7fa3>\n<1828> <7faf>\n<1829> <7fb2>\n<182a> <7fb9>\n<182b> <7fae>\n<182c> <7fb6>\n<182d> <7fb8>\n<182e> <8b71>\n<1831> <7fca>\n<1832> <7fd5>\n<1833> <7fd4>\n<1834> <7fe1>\n<1835> <7fe6>\n<1836> <7fe9>\n<1837> <7ff3>\n<1838> <7ff9>\n<1839> <98dc>\n<183a> <8006>\n<183b> <8004>\n<183c> <800b>\n<183d> <8012>\n<1840> <801c>\n<1841> <8021>\n<1842> <8028>\n<1843> <803f>\n<1844> <803b>\n<1845> <804a>\n<1846> <8046>\n<1847> <8052>\n<1848> <8058>\n<1849> <805a>\n<184a> <805f>\n<184b> <8062>\n<184c> <8068>\n<184d> <8073>\n<184e> <8072>\n<184f> <8070>\n<1850> <8076>\n<1851> <8079>\n<1852> <807d>\n<1853> <807f>\n<1854> <8084>\n<1855> <8086>\n<1856> <8085>\n<1857> <809b>\n<1858> <8093>\n<1859> <809a>\n<185a> <80ad>\n<185b> <5190>\n<185c> <80ac>\n<185d> <80db>\n<185e> <80e5>\n<185f> <80d9>\n<1860> <80dd>\n<1861> <80c4>\nendbfchar\n\n100 beginbfchar\n<1862> <80da>\n<1863> <80d6>\n<1864> <8109>\n<1865> <80ef>\n<1866> <80f1>\n<1867> <811b>\n<1868> <8129>\n<1869> <8123>\n<186a> <812f>\n<186b> <814b>\n<186c> <968b>\n<186d> <8146>\n<186e> <813e>\n<186f> <8153>\n<1870> <8151>\n<1871> <80fc>\n<1872> <8171>\n<1873> <816e>\n<1876> <8174>\n<1877> <8183>\n<1878> <8188>\n<1879> <818a>\n<187a> <8180>\n<187b> <8182>\n<187c> <81a0>\n<187d> <8195>\n<187e> <81a4>\n<187f> <81a3>\n<1880> <815f>\n<1881> <8193>\n<1882> <81a9>\n<1883> <81b0>\n<1884> <81b5>\n<1885> <81be>\n<1886> <81b8>\n<1887> <81bd>\n<1888> <81c0>\n<1889> <81c2>\n<188a> <81ba>\n<188b> <81c9>\n<188c> <81cd>\n<188d> <81d1>\n<188e> <81d9>\n<188f> <81d8>\n<1890> <81c8>\n<1891> <81da>\n<1894> <81e7>\n<1897> <81fe>\n<189a> <8205>\n<189b> <8207>\n<189c> <820a>\n<189d> <820d>\n<189e> <8210>\n<189f> <8216>\n<18a0> <8229>\n<18a1> <822b>\n<18a2> <8238>\n<18a3> <8233>\n<18a4> <8240>\n<18a5> <8259>\n<18a6> <8258>\n<18a7> <825d>\n<18a8> <825a>\n<18a9> <825f>\n<18aa> <8264>\n<18ab> <8262>\n<18ac> <8268>\n<18af> <822e>\n<18b0> <8271>\n<18b3> <827e>\n<18b4> <828d>\n<18b5> <8292>\n<18b6> <82ab>\n<18b7> <829f>\n<18b8> <82bb>\n<18b9> <82ac>\n<18ba> <82e1>\n<18bb> <82e3>\n<18bc> <82df>\n<18bd> <82d2>\n<18be> <82f4>\n<18bf> <82f3>\n<18c0> <82fa>\n<18c1> <8393>\n<18c2> <8303>\n<18c3> <82fb>\n<18c4> <82f9>\n<18c5> <82de>\n<18c6> <8306>\n<18c7> <82dc>\n<18c8> <8309>\n<18c9> <82d9>\n<18ca> <8335>\n<18cb> <8334>\n<18cc> <8316>\n<18cd> <8332>\n<18ce> <8331>\n<18cf> <8340>\n<18d0> <8339>\n<18d1> <8350>\nendbfchar\n\n100 beginbfchar\n<18d2> <8345>\n<18d3> <832f>\n<18d4> <832b>\n<18d7> <8385>\n<18d8> <839a>\n<18d9> <83aa>\n<18da> <839f>\n<18db> <83a2>\n<18dc> <8396>\n<18dd> <8323>\n<18de> <838e>\n<18df> <8387>\n<18e0> <838a>\n<18e1> <837c>\n<18e2> <83b5>\n<18e3> <8373>\n<18e4> <8375>\n<18e5> <83a0>\n<18e6> <8389>\n<18e7> <83a8>\n<18e8> <83f4>\n<18e9> <8413>\n<18ea> <83eb>\n<18eb> <83ce>\n<18ec> <83fd>\n<18ed> <8403>\n<18ee> <83d8>\n<18ef> <840b>\n<18f0> <83c1>\n<18f1> <83f7>\n<18f2> <8407>\n<18f3> <83e0>\n<18f4> <83f2>\n<18f5> <840d>\n<18f6> <8422>\n<18f7> <8420>\n<18f8> <83bd>\n<18f9> <8438>\n<18fa> <8506>\n<18fb> <83fb>\n<18fc> <846d>\n<18fd> <842a>\n<18fe> <843c>\n<18ff> <855a>\n<1900> <8484>\n<1901> <8477>\n<1902> <846b>\n<1903> <84ad>\n<1904> <846e>\n<1905> <8482>\n<1906> <8469>\n<1907> <8446>\n<1908> <842c>\n<1909> <846f>\n<190a> <8479>\n<190b> <8435>\n<190c> <84ca>\n<190d> <8462>\n<190e> <84b9>\n<190f> <84bf>\n<1910> <849f>\n<1911> <84d9>\n<1912> <84cd>\n<1913> <84bb>\n<1914> <84da>\n<1915> <84d0>\n<1916> <84c1>\n<1917> <84c6>\n<1918> <84d6>\n<1919> <84a1>\n<191a> <8521>\n<191b> <84ff>\n<191c> <84f4>\n<191f> <852c>\n<1920> <851f>\n<1921> <8515>\n<1922> <8514>\n<1923> <84fc>\n<1924> <8540>\n<1925> <8563>\n<1926> <8558>\n<1927> <8548>\n<1928> <8541>\n<1929> <8602>\n<192a> <854b>\n<192b> <8555>\n<192c> <8580>\n<192d> <85a4>\n<192e> <8588>\n<192f> <8591>\n<1930> <858a>\n<1931> <85a8>\n<1932> <856d>\n<1933> <8594>\n<1934> <859b>\n<1935> <85ea>\n<1936> <8587>\n<1937> <859c>\n<1938> <8577>\n<1939> <857e>\nendbfchar\n\n100 beginbfchar\n<193a> <8590>\n<193b> <85c9>\n<193c> <85ba>\n<193d> <85cf>\n<193e> <85b9>\n<193f> <85d0>\n<1940> <85d5>\n<1941> <85dd>\n<1942> <85e5>\n<1943> <85dc>\n<1944> <85f9>\n<1945> <860a>\n<1946> <8613>\n<1947> <860b>\n<1948> <85fe>\n<1949> <85fa>\n<194a> <8606>\n<194b> <8622>\n<194c> <861a>\n<194d> <8630>\n<194e> <863f>\n<194f> <864d>\n<1950> <4e55>\n<1951> <8654>\n<1952> <865f>\n<1953> <8667>\n<1954> <8671>\n<1955> <8693>\n<1956> <86a3>\n<195b> <86b6>\n<195c> <86af>\n<195d> <86c4>\n<195e> <86c6>\n<195f> <86b0>\n<1960> <86c9>\n<1961> <8823>\n<1962> <86ab>\n<1963> <86d4>\n<1964> <86de>\n<1965> <86e9>\n<1966> <86ec>\n<1967> <86df>\n<1968> <86db>\n<1969> <86ef>\n<196a> <8712>\n<196b> <8706>\n<196c> <8708>\n<196d> <8700>\n<196e> <8703>\n<196f> <86fb>\n<1970> <8711>\n<1971> <8709>\n<1972> <870d>\n<1973> <86f9>\n<1974> <870a>\n<1975> <8734>\n<1976> <873f>\n<1977> <8737>\n<1978> <873b>\n<1979> <8725>\n<197a> <8729>\n<197b> <871a>\n<197c> <8760>\n<197d> <875f>\n<197e> <8778>\n<197f> <874c>\n<1980> <874e>\n<1981> <8774>\n<1982> <8757>\n<1983> <8768>\n<1984> <876e>\n<1985> <8759>\n<1986> <8753>\n<1987> <8763>\n<1988> <876a>\n<1989> <8805>\n<198a> <87a2>\n<198b> <879f>\n<198c> <8782>\n<198d> <87af>\n<198e> <87cb>\n<198f> <87bd>\n<1990> <87c0>\n<1991> <87d0>\n<1992> <96d6>\n<1993> <87ab>\n<1994> <87c4>\n<1995> <87b3>\n<1996> <87c7>\n<1997> <87c6>\n<1998> <87bb>\n<1999> <87ef>\n<199a> <87f2>\n<199b> <87e0>\n<199c> <880f>\n<199d> <880d>\n<199e> <87fe>\n<19a1> <880e>\n<19a2> <87d2>\n<19a3> <8811>\nendbfchar\n\n100 beginbfchar\n<19a4> <8816>\n<19a5> <8815>\n<19a6> <8822>\n<19a7> <8821>\n<19a8> <8831>\n<19a9> <8836>\n<19aa> <8839>\n<19ab> <8827>\n<19ac> <883b>\n<19ad> <8844>\n<19ae> <8842>\n<19af> <8852>\n<19b0> <8859>\n<19b1> <885e>\n<19b2> <8862>\n<19b3> <886b>\n<19b4> <8881>\n<19b5> <887e>\n<19b6> <889e>\n<19b7> <8875>\n<19b8> <887d>\n<19b9> <88b5>\n<19ba> <8872>\n<19bb> <8882>\n<19bc> <8897>\n<19bd> <8892>\n<19be> <88ae>\n<19bf> <8899>\n<19c0> <88a2>\n<19c1> <888d>\n<19c2> <88a4>\n<19c3> <88b0>\n<19c4> <88bf>\n<19c5> <88b1>\n<19c8> <88d4>\n<19cb> <88dd>\n<19cc> <88f9>\n<19cd> <8902>\n<19ce> <88fc>\n<19cf> <88f4>\n<19d0> <88e8>\n<19d1> <88f2>\n<19d2> <8904>\n<19d3> <890c>\n<19d4> <890a>\n<19d5> <8913>\n<19d6> <8943>\n<19d7> <891e>\n<19d8> <8925>\n<19db> <8941>\n<19dc> <8944>\n<19dd> <893b>\n<19de> <8936>\n<19df> <8938>\n<19e0> <894c>\n<19e1> <891d>\n<19e2> <8960>\n<19e3> <895e>\n<19e4> <8966>\n<19e5> <8964>\n<19e6> <896d>\n<19e7> <896a>\n<19e8> <896f>\n<19e9> <8974>\n<19ea> <8977>\n<19eb> <897e>\n<19ec> <8983>\n<19ed> <8988>\n<19ee> <898a>\n<19ef> <8993>\n<19f0> <8998>\n<19f1> <89a1>\n<19f2> <89a9>\n<19f3> <89a6>\n<19f4> <89ac>\n<19f5> <89af>\n<19f6> <89b2>\n<19f7> <89ba>\n<19f8> <89bd>\n<19fb> <89da>\n<19fe> <89e7>\n<19ff> <89f4>\n<1a00> <89f8>\n<1a01> <8a03>\n<1a02> <8a16>\n<1a03> <8a10>\n<1a04> <8a0c>\n<1a05> <8a1b>\n<1a06> <8a1d>\n<1a07> <8a25>\n<1a08> <8a36>\n<1a09> <8a41>\n<1a0a> <8a5b>\n<1a0b> <8a52>\n<1a0c> <8a46>\n<1a0d> <8a48>\n<1a0e> <8a7c>\n<1a0f> <8a6d>\n<1a10> <8a6c>\n<1a11> <8a62>\nendbfchar\n\n100 beginbfchar\n<1a12> <8a85>\n<1a13> <8a82>\n<1a14> <8a84>\n<1a15> <8aa8>\n<1a16> <8aa1>\n<1a17> <8a91>\n<1a1a> <8a9a>\n<1a1b> <8aa3>\n<1a1c> <8ac4>\n<1a1d> <8acd>\n<1a1e> <8ac2>\n<1a1f> <8ada>\n<1a20> <8aeb>\n<1a21> <8af3>\n<1a22> <8ae7>\n<1a23> <8ae4>\n<1a24> <8af1>\n<1a25> <8b14>\n<1a26> <8ae0>\n<1a27> <8ae2>\n<1a28> <8af7>\n<1a29> <8ade>\n<1a2a> <8adb>\n<1a2b> <8b0c>\n<1a2c> <8b07>\n<1a2d> <8b1a>\n<1a2e> <8ae1>\n<1a2f> <8b16>\n<1a30> <8b10>\n<1a31> <8b17>\n<1a32> <8b20>\n<1a33> <8b33>\n<1a34> <97ab>\n<1a35> <8b26>\n<1a36> <8b2b>\n<1a37> <8b3e>\n<1a38> <8b28>\n<1a39> <8b41>\n<1a3a> <8b4c>\n<1a3b> <8b4f>\n<1a3c> <8b4e>\n<1a3d> <8b49>\n<1a3e> <8b56>\n<1a3f> <8b5b>\n<1a40> <8b5a>\n<1a41> <8b6b>\n<1a42> <8b5f>\n<1a43> <8b6c>\n<1a44> <8b6f>\n<1a45> <8b74>\n<1a46> <8b7d>\n<1a47> <8b80>\n<1a48> <8b8c>\n<1a49> <8b8e>\n<1a4c> <8b96>\n<1a4f> <8c3a>\n<1a50> <8c41>\n<1a51> <8c3f>\n<1a52> <8c48>\n<1a53> <8c4c>\n<1a54> <8c4e>\n<1a55> <8c50>\n<1a56> <8c55>\n<1a57> <8c62>\n<1a58> <8c6c>\n<1a59> <8c78>\n<1a5a> <8c7a>\n<1a5b> <8c82>\n<1a5c> <8c89>\n<1a5d> <8c85>\n<1a5e> <8c8a>\n<1a61> <8c94>\n<1a62> <8c7c>\n<1a63> <8c98>\n<1a64> <621d>\n<1a65> <8cad>\n<1a66> <8caa>\n<1a67> <8cbd>\n<1a6a> <8cae>\n<1a6b> <8cb6>\n<1a6c> <8cc8>\n<1a6d> <8cc1>\n<1a6e> <8ce4>\n<1a6f> <8ce3>\n<1a70> <8cda>\n<1a71> <8cfd>\n<1a76> <8d0a>\n<1a77> <8d07>\n<1a78> <8d0f>\n<1a79> <8d0d>\n<1a7a> <8d10>\n<1a7b> <9f4e>\n<1a7c> <8d13>\n<1a7d> <8ccd>\n<1a7e> <8d14>\n<1a7f> <8d16>\n<1a80> <8d67>\n<1a81> <8d6d>\n<1a82> <8d71>\n<1a83> <8d73>\nendbfchar\n\n100 beginbfchar\n<1a84> <8d81>\n<1a85> <8d99>\n<1a86> <8dc2>\n<1a87> <8dbe>\n<1a88> <8dba>\n<1a89> <8dcf>\n<1a8a> <8dda>\n<1a8b> <8dd6>\n<1a8c> <8dcc>\n<1a8d> <8ddb>\n<1a8e> <8dcb>\n<1a91> <8ddf>\n<1a92> <8de3>\n<1a93> <8dfc>\n<1a96> <8dff>\n<1a99> <8e10>\n<1a9a> <8e1f>\n<1a9b> <8e42>\n<1a9c> <8e35>\n<1a9d> <8e30>\n<1a9e> <8e34>\n<1a9f> <8e4a>\n<1aa0> <8e47>\n<1aa1> <8e49>\n<1aa2> <8e4c>\n<1aa3> <8e50>\n<1aa4> <8e48>\n<1aa5> <8e59>\n<1aa6> <8e64>\n<1aa7> <8e60>\n<1aa8> <8e2a>\n<1aa9> <8e63>\n<1aaa> <8e55>\n<1aab> <8e76>\n<1aac> <8e72>\n<1aad> <8e7c>\n<1aae> <8e81>\n<1aaf> <8e87>\n<1ab0> <8e85>\n<1ab1> <8e84>\n<1ab2> <8e8b>\n<1ab3> <8e8a>\n<1ab4> <8e93>\n<1ab5> <8e91>\n<1ab6> <8e94>\n<1ab7> <8e99>\n<1ab8> <8eaa>\n<1ab9> <8ea1>\n<1aba> <8eac>\n<1abb> <8eb0>\n<1abc> <8ec6>\n<1abd> <8eb1>\n<1abe> <8ebe>\n<1abf> <8ec5>\n<1ac0> <8ec8>\n<1ac1> <8ecb>\n<1ac2> <8edb>\n<1ac3> <8ee3>\n<1ac4> <8efc>\n<1ac5> <8efb>\n<1ac6> <8eeb>\n<1ac7> <8efe>\n<1ac8> <8f0a>\n<1ac9> <8f05>\n<1aca> <8f15>\n<1acb> <8f12>\n<1acc> <8f19>\n<1acd> <8f13>\n<1ace> <8f1c>\n<1acf> <8f1f>\n<1ad0> <8f1b>\n<1ad1> <8f0c>\n<1ad2> <8f26>\n<1ad3> <8f33>\n<1ad4> <8f3b>\n<1ad5> <8f39>\n<1ad6> <8f45>\n<1ad7> <8f42>\n<1ad8> <8f3e>\n<1ad9> <8f4c>\n<1ada> <8f49>\n<1adb> <8f46>\n<1adc> <8f4e>\n<1add> <8f57>\n<1ade> <8f5c>\n<1ae2> <8f9c>\n<1ae3> <8f9f>\n<1ae4> <8fa3>\n<1ae5> <8fad>\n<1ae6> <8faf>\n<1ae7> <8fb7>\n<1ae8> <8fda>\n<1ae9> <8fe5>\n<1aea> <8fe2>\n<1aeb> <8fea>\n<1aec> <8fef>\n<1aed> <9087>\n<1aee> <8ff4>\n<1aef> <9005>\n<1af2> <9011>\nendbfchar\n\n100 beginbfchar\n<1af3> <9015>\n<1af4> <9021>\n<1af5> <900d>\n<1af6> <901e>\n<1af7> <9016>\n<1af8> <900b>\n<1af9> <9027>\n<1afa> <9036>\n<1afb> <9035>\n<1afc> <9039>\n<1afd> <8ff8>\n<1b02> <900e>\n<1b03> <9049>\n<1b04> <903e>\n<1b05> <9056>\n<1b06> <9058>\n<1b07> <905e>\n<1b08> <9068>\n<1b09> <906f>\n<1b0a> <9076>\n<1b0b> <96a8>\n<1b0c> <9072>\n<1b0d> <9082>\n<1b0e> <907d>\n<1b0f> <9081>\n<1b10> <9080>\n<1b11> <908a>\n<1b12> <9089>\n<1b13> <908f>\n<1b14> <90a8>\n<1b15> <90af>\n<1b16> <90b1>\n<1b17> <90b5>\n<1b18> <90e2>\n<1b19> <90e4>\n<1b1a> <6248>\n<1b1b> <90db>\n<1b1c> <9102>\n<1b1d> <9112>\n<1b1e> <9119>\n<1b1f> <9132>\n<1b20> <9130>\n<1b21> <914a>\n<1b22> <9156>\n<1b23> <9158>\n<1b24> <9163>\n<1b25> <9165>\n<1b26> <9169>\n<1b27> <9173>\n<1b28> <9172>\n<1b29> <918b>\n<1b2a> <9189>\n<1b2b> <9182>\n<1b2c> <91a2>\n<1b2d> <91ab>\n<1b2e> <91af>\n<1b2f> <91aa>\n<1b30> <91b5>\n<1b31> <91b4>\n<1b32> <91ba>\n<1b35> <91c9>\n<1b36> <91cb>\n<1b37> <91d0>\n<1b38> <91d6>\n<1b39> <91df>\n<1b3a> <91e1>\n<1b3b> <91db>\n<1b3c> <91fc>\n<1b3f> <921e>\n<1b40> <91ff>\n<1b41> <9214>\n<1b42> <922c>\n<1b43> <9215>\n<1b44> <9211>\n<1b45> <925e>\n<1b46> <9257>\n<1b47> <9245>\n<1b48> <9249>\n<1b49> <9264>\n<1b4a> <9248>\n<1b4b> <9295>\n<1b4c> <923f>\n<1b4d> <924b>\n<1b4e> <9250>\n<1b4f> <929c>\n<1b50> <9296>\n<1b51> <9293>\n<1b52> <929b>\n<1b53> <925a>\n<1b54> <92cf>\n<1b55> <92b9>\n<1b56> <92b7>\n<1b57> <92e9>\n<1b58> <930f>\n<1b59> <92fa>\n<1b5a> <9344>\n<1b5b> <932e>\n<1b5c> <9319>\n<1b5d> <9322>\n<1b5e> <931a>\nendbfchar\n\n100 beginbfchar\n<1b5f> <9323>\n<1b60> <933a>\n<1b61> <9335>\n<1b62> <933b>\n<1b63> <935c>\n<1b64> <9360>\n<1b65> <937c>\n<1b66> <936e>\n<1b67> <9356>\n<1b68> <93b0>\n<1b6b> <9394>\n<1b6c> <93b9>\n<1b6f> <93e8>\n<1b70> <93e5>\n<1b71> <93d8>\n<1b72> <93c3>\n<1b73> <93dd>\n<1b74> <93d0>\n<1b75> <93c8>\n<1b76> <93e4>\n<1b77> <941a>\n<1b78> <9414>\n<1b79> <9413>\n<1b7a> <9403>\n<1b7b> <9407>\n<1b7c> <9410>\n<1b7d> <9436>\n<1b7e> <942b>\n<1b7f> <9435>\n<1b80> <9421>\n<1b81> <943a>\n<1b82> <9441>\n<1b83> <9452>\n<1b84> <9444>\n<1b85> <945b>\n<1b86> <9460>\n<1b87> <9462>\n<1b88> <945e>\n<1b89> <946a>\n<1b8a> <9229>\n<1b8b> <9470>\n<1b8c> <9475>\n<1b8d> <9477>\n<1b8e> <947d>\n<1b8f> <945a>\n<1b90> <947c>\n<1b91> <947e>\n<1b92> <9481>\n<1b93> <947f>\n<1b94> <9582>\n<1b95> <9587>\n<1b96> <958a>\n<1b97> <9594>\n<1b98> <9596>\n<1b9b> <95a0>\n<1b9c> <95a8>\n<1b9d> <95a7>\n<1b9e> <95ad>\n<1b9f> <95bc>\n<1ba0> <95bb>\n<1ba1> <95b9>\n<1ba2> <95be>\n<1ba3> <95ca>\n<1ba4> <6ff6>\n<1ba5> <95c3>\n<1ba6> <95cd>\n<1ba7> <95cc>\n<1ba8> <95d5>\n<1ba9> <95d4>\n<1baa> <95d6>\n<1bab> <95dc>\n<1bac> <95e1>\n<1bad> <95e5>\n<1bae> <95e2>\n<1baf> <9621>\n<1bb0> <9628>\n<1bb3> <9642>\n<1bb4> <964c>\n<1bb5> <964f>\n<1bb6> <964b>\n<1bb7> <9677>\n<1bb8> <965c>\n<1bb9> <965e>\n<1bba> <965d>\n<1bbb> <965f>\n<1bbc> <9666>\n<1bbd> <9672>\n<1bbe> <966c>\n<1bbf> <968d>\n<1bc0> <9698>\n<1bc1> <9695>\n<1bc2> <9697>\n<1bc3> <96aa>\n<1bc4> <96a7>\n<1bc7> <96b0>\n<1bc8> <96b4>\n<1bc9> <96b6>\n<1bcc> <96ce>\n<1bcd> <96cb>\n<1bce> <96c9>\nendbfchar\n\n100 beginbfchar\n<1bcf> <96cd>\n<1bd0> <894d>\n<1bd1> <96dc>\n<1bd2> <970d>\n<1bd3> <96d5>\n<1bd4> <96f9>\n<1bd5> <9704>\n<1bd6> <9706>\n<1bd7> <9708>\n<1bd8> <9713>\n<1bd9> <970e>\n<1bda> <9711>\n<1bdb> <970f>\n<1bdc> <9716>\n<1bdd> <9719>\n<1bde> <9724>\n<1bdf> <972a>\n<1be0> <9730>\n<1be1> <9739>\n<1be4> <9744>\n<1be5> <9746>\n<1be6> <9748>\n<1be7> <9742>\n<1be8> <9749>\n<1be9> <975c>\n<1bea> <9760>\n<1beb> <9764>\n<1bec> <9766>\n<1bed> <9768>\n<1bee> <52d2>\n<1bef> <976b>\n<1bf0> <9771>\n<1bf1> <9779>\n<1bf2> <9785>\n<1bf3> <977c>\n<1bf4> <9781>\n<1bf5> <977a>\n<1bf6> <9786>\n<1bf7> <978b>\n<1bfa> <979c>\n<1bfb> <97a8>\n<1bfc> <97a6>\n<1bfd> <97a3>\n<1c00> <97c3>\n<1c01> <97c6>\n<1c02> <97c8>\n<1c03> <97cb>\n<1c04> <97dc>\n<1c05> <97ed>\n<1c06> <9f4f>\n<1c07> <97f2>\n<1c08> <7adf>\n<1c09> <97f6>\n<1c0a> <97f5>\n<1c0b> <980f>\n<1c0c> <980c>\n<1c0d> <9838>\n<1c0e> <9824>\n<1c0f> <9821>\n<1c10> <9837>\n<1c11> <983d>\n<1c12> <9846>\n<1c13> <984f>\n<1c14> <984b>\n<1c15> <986b>\n<1c19> <9874>\n<1c1a> <9873>\n<1c1b> <98aa>\n<1c1c> <98af>\n<1c1d> <98b1>\n<1c1e> <98b6>\n<1c1f> <98c4>\n<1c20> <98c3>\n<1c21> <98c6>\n<1c22> <98e9>\n<1c23> <98eb>\n<1c24> <9903>\n<1c25> <9909>\n<1c26> <9912>\n<1c27> <9914>\n<1c28> <9918>\n<1c29> <9921>\n<1c2c> <9924>\n<1c2d> <9920>\n<1c2e> <992c>\n<1c2f> <992e>\n<1c32> <9942>\n<1c33> <9949>\n<1c34> <9945>\n<1c35> <9950>\n<1c36> <994b>\n<1c39> <994c>\n<1c3a> <9955>\n<1c3d> <99a5>\n<1c40> <99bc>\n<1c41> <99df>\n<1c42> <99db>\n<1c43> <99dd>\n<1c44> <99d8>\n<1c45> <99d1>\nendbfchar\n\n100 beginbfchar\n<1c4a> <99fb>\n<1c4b> <99f8>\n<1c4c> <9a01>\n<1c4d> <9a0f>\n<1c4e> <9a05>\n<1c4f> <99e2>\n<1c50> <9a19>\n<1c51> <9a2b>\n<1c52> <9a37>\n<1c53> <9a45>\n<1c54> <9a42>\n<1c55> <9a40>\n<1c56> <9a43>\n<1c57> <9a3e>\n<1c58> <9a55>\n<1c59> <9a4d>\n<1c5a> <9a5b>\n<1c5b> <9a57>\n<1c5c> <9a5f>\n<1c5d> <9a62>\n<1c5e> <9a65>\n<1c5f> <9a64>\n<1c60> <9a69>\n<1c61> <9a6b>\n<1c62> <9a6a>\n<1c63> <9aad>\n<1c64> <9ab0>\n<1c65> <9abc>\n<1c66> <9ac0>\n<1c67> <9acf>\n<1c68> <9ad1>\n<1c6f> <9ae6>\n<1c70> <9aef>\n<1c71> <9aeb>\n<1c72> <9aee>\n<1c73> <9af4>\n<1c74> <9af1>\n<1c75> <9af7>\n<1c76> <9afb>\n<1c77> <9b06>\n<1c78> <9b18>\n<1c79> <9b1a>\n<1c7a> <9b1f>\n<1c7d> <9b25>\n<1c84> <9b32>\n<1c85> <9b44>\n<1c86> <9b43>\n<1c87> <9b4f>\n<1c8a> <9b51>\n<1c8b> <9b58>\n<1c8c> <9b74>\n<1c8d> <9b93>\n<1c8e> <9b83>\n<1c8f> <9b91>\n<1c94> <9ba8>\n<1c95> <9bb4>\n<1c96> <9bc0>\n<1c97> <9bca>\n<1c98> <9bb9>\n<1c99> <9bc6>\n<1c9a> <9bcf>\n<1c9d> <9be3>\n<1c9e> <9be2>\n<1c9f> <9be4>\n<1ca0> <9bd4>\n<1ca1> <9be1>\n<1ca2> <9c3a>\n<1ca3> <9bf2>\n<1ca4> <9bf1>\n<1ca5> <9bf0>\n<1ca6> <9c15>\n<1ca7> <9c14>\n<1ca8> <9c09>\n<1ca9> <9c13>\n<1caa> <9c0c>\n<1cab> <9c06>\n<1cac> <9c08>\n<1cad> <9c12>\n<1cae> <9c0a>\n<1caf> <9c04>\n<1cb0> <9c2e>\n<1cb1> <9c1b>\n<1cb2> <9c25>\n<1cb3> <9c24>\n<1cb4> <9c21>\n<1cb5> <9c30>\n<1cb6> <9c47>\n<1cb7> <9c32>\n<1cb8> <9c46>\n<1cb9> <9c3e>\n<1cba> <9c5a>\n<1cbb> <9c60>\n<1cbc> <9c67>\n<1cbd> <9c76>\n<1cbe> <9c78>\n<1cbf> <9ce7>\n<1cc0> <9cec>\n<1cc1> <9cf0>\n<1cc2> <9d09>\n<1cc3> <9d08>\nendbfchar\n\n100 beginbfchar\n<1cc4> <9ceb>\n<1cc5> <9d03>\n<1cc6> <9d06>\n<1cc7> <9d2a>\n<1cc8> <9d26>\n<1cc9> <9daf>\n<1cca> <9d23>\n<1ccb> <9d1f>\n<1ccc> <9d44>\n<1ccd> <9d15>\n<1cce> <9d12>\n<1ccf> <9d41>\n<1cd0> <9d3f>\n<1cd1> <9d3e>\n<1cd2> <9d46>\n<1cd3> <9d48>\n<1cd6> <9d64>\n<1cd7> <9d51>\n<1cd8> <9d50>\n<1cd9> <9d59>\n<1cda> <9d72>\n<1cdb> <9d89>\n<1cdc> <9d87>\n<1cdd> <9dab>\n<1cde> <9d6f>\n<1cdf> <9d7a>\n<1ce0> <9d9a>\n<1ce1> <9da4>\n<1ce2> <9da9>\n<1ce3> <9db2>\n<1ce4> <9dc4>\n<1ce5> <9dc1>\n<1ce6> <9dbb>\n<1ce7> <9db8>\n<1ce8> <9dba>\n<1ce9> <9dc6>\n<1cea> <9dcf>\n<1ceb> <9dc2>\n<1cec> <9dd9>\n<1ced> <9dd3>\n<1cee> <9df8>\n<1cef> <9de6>\n<1cf0> <9ded>\n<1cf1> <9def>\n<1cf2> <9dfd>\n<1cf5> <9e1e>\n<1cf6> <9e75>\n<1cf7> <9e79>\n<1cf8> <9e7d>\n<1cf9> <9e81>\n<1cfa> <9e88>\n<1cfd> <9e92>\n<1cfe> <9e95>\n<1cff> <9e91>\n<1d00> <9e9d>\n<1d01> <9ea5>\n<1d02> <9ea9>\n<1d03> <9eb8>\n<1d04> <9eaa>\n<1d05> <9ead>\n<1d06> <9761>\n<1d07> <9ecc>\n<1d0b> <9ed4>\n<1d0c> <9edc>\n<1d0d> <9ede>\n<1d0e> <9edd>\n<1d0f> <9ee0>\n<1d10> <9ee5>\n<1d11> <9ee8>\n<1d12> <9eef>\n<1d13> <9ef4>\n<1d16> <9ef9>\n<1d1c> <76b7>\n<1d1d> <9f15>\n<1d1e> <9f21>\n<1d1f> <9f2c>\n<1d20> <9f3e>\n<1d21> <9f4a>\n<1d22> <9f52>\n<1d23> <9f54>\n<1d24> <9f63>\n<1d2a> <9f6c>\n<1d2b> <9f6a>\n<1d2c> <9f77>\n<1d2d> <9f72>\n<1d2e> <9f76>\n<1d2f> <9f95>\n<1d30> <9f9c>\n<1d31> <9fa0>\n<1d32> <582f>\n<1d33> <69c7>\n<1d34> <9059>\n<1d35> <7464>\n<1d36> <2642>\n<1da1> <3349>\n<1da2> <3314>\n<1da3> <3322>\n<1da4> <334d>\n<1da5> <3318>\n<1da6> <3327>\nendbfchar\n\n100 beginbfchar\n<1da7> <3303>\n<1da8> <3336>\n<1da9> <3351>\n<1daa> <3357>\n<1dab> <330d>\n<1dac> <3326>\n<1dad> <3323>\n<1dae> <332b>\n<1daf> <334a>\n<1db0> <333b>\n<1db6> <33c4>\n<1db7> <33a1>\n<1db8> <301d>\n<1db9> <301f>\n<1dba> <2116>\n<1dbb> <33cd>\n<1dbc> <2121>\n<1dc4> <3239>\n<1dc5> <337e>\n<1dc6> <337d>\n<1dc7> <337c>\n<1dc8> <222e>\n<1dc9> <2211>\n<1dca> <221a>\n<1dcb> <22a5>\n<1dcc> <2220>\n<1dcd> <221f>\n<1dce> <22bf>\n<1dd1> <555e>\n<1dd2> <98f4>\n<1dd3> <6ea2>\n<1dd4> <9c2f>\n<1dd5> <6deb>\n<1dd6> <8fc2>\n<1dd7> <6b1d>\n<1dd8> <53a9>\n<1dd9> <d863dcdd>\n<1dda> <5642>\n<1ddb> <990c>\n<1ddc> <7130>\n<1ddd> <8956>\n<1dde> <9dd7>\n<1ddf> <8fe6>\n<1de0> <6062>\n<1de1> <62d0>\n<1de2> <6666>\n<1de3> <fa36>\n<1de4> <845b>\n<1de5> <9784>\n<1de6> <5699>\n<1de7> <3d4e>\n<1de8> <7ff0>\n<1de9> <7feb>\n<1dea> <5fbd>\n<1deb> <7947>\n<1dec> <4fe0>\n<1ded> <537f>\n<1dee> <50c5>\n<1def> <8ec0>\n<1df0> <55b0>\n<1df1> <d87edced>\n<1df2> <5c51>\n<1df3> <9774>\n<1df4> <7941>\n<1df5> <6167>\n<1df6> <d856dc74>\n<1df7> <7e6b>\n<1df8> <8346>\n<1df9> <d863def6>\n<1dfa> <5026>\n<1dfb> <5acc>\n<1dfc> <6372>\n<1dfd> <9e7c>\n<1dfe> <8afa>\n<1dff> <5df7>\n<1e00> <663b>\n<1e01> <6e9d>\n<1e02> <9eb4>\n<1e03> <9d60>\n<1e04> <7511>\n<1e05> <91c7>\n<1e06> <698a>\n<1e07> <6805>\n<1e08> <85a9>\n<1e09> <9bd6>\n<1e0a> <9306>\n<1e0b> <73ca>\n<1e0c> <53f1>\n<1e0d> <5c62>\n<1e0e> <906e>\n<1e0f> <d87edcdc>\n<1e10> <707c>\n<1e11> <7e61>\n<1e12> <914b>\n<1e13> <66d9>\n<1e14> <fa46>\n<1e15> <85af>\n<1e16> <85f7>\n<1e17> <54e8>\n<1e18> <5ee0>\nendbfchar\n\n100 beginbfchar\n<1e19> <68a2>\n<1e1a> <8523>\n<1e1b> <91ac>\n<1e1c> <9798>\n<1e1d> <8755>\n<1e1e> <976d>\n<1e1f> <9017>\n<1e20> <7fe0>\n<1e21> <647a>\n<1e22> <901d>\n<1e23> <87ec>\n<1e24> <64b0>\n<1e25> <6813>\n<1e26> <714e>\n<1e27> <717d>\n<1e28> <8a6e>\n<1e29> <564c>\n<1e2a> <9061>\n<1e2b> <5275>\n<1e2c> <6414>\n<1e2d> <75e9>\n<1e2e> <905c>\n<1e2f> <9a52>\n<1e30> <817f>\n<1e31> <9edb>\n<1e32> <5544>\n<1e33> <6fef>\n<1e34> <fa4a>\n<1e35> <86f8>\n<1e36> <d87edc84>\n<1e37> <8fbf>\n<1e38> <68da>\n<1e39> <9c48>\n<1e3a> <6a3d>\n<1e3b> <7c1e>\n<1e3c> <8a3b>\n<1e3d> <7026>\n<1e3e> <51cb>\n<1e3f> <6357>\n<1e40> <69cc>\n<1e41> <939a>\n<1e42> <fa10>\n<1e43> <6451>\n<1e44> <912d>\n<1e45> <64e2>\n<1e46> <f9ec>\n<1e47> <5861>\n<1e48> <985a>\n<1e49> <5835>\n<1e4a> <d87edc77>\n<1e4b> <83df>\n<1e4c> <8ced>\n<1e4d> <5858>\n<1e4e> <79b1>\n<1e4f> <9d07>\n<1e50> <7006>\n<1e51> <701e>\n<1e52> <5678>\n<1e53> <9041>\n<1e54> <9813>\n<1e55> <90a3>\n<1e56> <8b0e>\n<1e57> <7058>\n<1e58> <6962>\n<1e59> <79b0>\n<1e5a> <56ca>\n<1e5b> <724c>\n<1e5c> <9019>\n<1e5d> <79e4>\n<1e5e> <525d>\n<1e5f> <7bb8>\n<1e60> <6f51>\n<1e61> <91b1>\n<1e62> <633d>\n<1e63> <6249>\n<1e64> <6a0b>\n<1e65> <67ca>\n<1e66> <7a17>\n<1e67> <903c>\n<1e68> <5a9b>\n<1e69> <8b2c>\n<1e6a> <5edf>\n<1e6b> <7015>\n<1e6c> <fa6a>\n<1e6d> <853d>\n<1e6e> <77a5>\n<1e6f> <5a29>\n<1e70> <5e96>\n<1e71> <6ce1>\n<1e72> <84ec>\n<1e73> <9830>\n<1e74> <9c52>\n<1e75> <9eb5>\n<1e76> <5132>\n<1e77> <9905>\n<1e78> <7c7e>\n<1e79> <9453>\n<1e7a> <6108>\n<1e7b> <7652>\n<1e7c> <7337>\nendbfchar\n\n100 beginbfchar\n<1e7d> <7194>\n<1e7e> <8000>\n<1e7f> <840a>\n<1e80> <f9c3>\n<1e83> <f999>\n<1e84> <6994>\n<1e85> <881f>\n<1e86> <d87edc0f>\n<1e87> <5189>\n<1e88> <d87edcd3>\n<1e89> <d87edc18>\n<1e8a> <5539>\n<1e8b> <5533>\n<1e8c> <55e4>\n<1e8d> <5632>\n<1e8e> <56a5>\n<1e8f> <580b>\n<1e90> <5abe>\n<1e91> <d846de1a>\n<1e92> <5c5b>\n<1e93> <5e64>\n<1e94> <6097>\n<1e95> <6369>\n<1e96> <6406>\n<1e97> <6522>\n<1e98> <6583>\n<1e99> <67a6>\n<1e9a> <67fa>\n<1e9b> <689b>\n<1e9c> <688e>\n<1e9d> <6e6e>\n<1e9e> <d850dfd0>\n<1e9f> <d87edd20>\n<1ea0> <73ce>\n<1ea1> <7504>\n<1ea2> <750d>\n<1ea3> <7515>\n<1ea4> <7693>\n<1ea5> <787c>\n<1ea6> <7a31>\n<1ea7> <9f9d>\n<1ea8> <7b99>\n<1ea9> <7c90>\n<1eaa> <7cae>\n<1eab> <7d9b>\n<1eac> <7dae>\n<1ead> <7d9f>\n<1eae> <7fd4>\n<1eaf> <822e>\n<1eb0> <828d>\n<1eb1> <82d2>\n<1eb2> <8323>\n<1eb3> <8375>\n<1eb4> <8517>\n<1eb5> <853e>\n<1eb6> <8782>\n<1eb7> <87d2>\n<1eb8> <890a>\n<1eb9> <89af>\n<1eba> <8ade>\n<1ebb> <8b41>\n<1ebc> <8dda>\n<1ebd> <8e09>\n<1ebe> <8f13>\n<1ebf> <8fea>\n<1ec0> <9087>\n<1ec1> <9058>\n<1ec2> <6248>\n<1ec3> <91c1>\n<1ec4> <95bb>\n<1ec5> <7762>\n<1ec6> <9724>\n<1ec7> <9760>\n<1ec8> <9771>\n<1ec9> <9824>\n<1eca> <9b2e>\n<1ecb> <9b97>\n<1ecc> <9bf2>\n<1ecd> <9eaa>\n<1ece> <9f9c>\n<1ed1> <203e>\n<1ed2> <ff3f>\n<1ed3> <30fc>\n<1ed4> <2015>\n<1ed5> <2010>\n<1ed6> <301c>\n<1ed7> <2016>\n<1ed8> <ff5c>\n<1ed9> <2026>\n<1eda> <2025>\n<1ee1> <ff5b>\n<1ee2> <ff5d>\n<1eed> <ff1d>\n<1eee> <3041>\n<1eef> <3043>\n<1ef0> <3045>\n<1ef1> <3047>\n<1ef2> <3049>\n<1ef3> <3063>\n<1ef4> <3083>\nendbfchar\n\n100 beginbfchar\n<1ef5> <3085>\n<1ef6> <3087>\n<1ef7> <308e>\n<1ef8> <30a1>\n<1ef9> <30a3>\n<1efa> <30a5>\n<1efb> <30a7>\n<1efc> <30a9>\n<1efd> <30c3>\n<1efe> <30e3>\n<1eff> <30e5>\n<1f00> <30e7>\n<1f01> <30ee>\n<1f04> <3349>\n<1f05> <3314>\n<1f06> <3322>\n<1f07> <334d>\n<1f08> <3318>\n<1f09> <3327>\n<1f0a> <3303>\n<1f0b> <3336>\n<1f0c> <3351>\n<1f0d> <3357>\n<1f0e> <330d>\n<1f0f> <3326>\n<1f10> <3323>\n<1f11> <332b>\n<1f12> <334a>\n<1f13> <333b>\n<1f19> <82a6>\n<1f1a> <8328>\n<1f1b> <5653>\n<1f1c> <53a9>\n<1f1d> <7259>\n<1f1e> <6c72>\n<1f1f> <7b08>\n<1f20> <9957>\n<1f21> <62f3>\n<1f22> <9910>\n<1f23> <976d>\n<1f24> <717d>\n<1f25> <7a7f>\n<1f26> <7bad>\n<1f27> <63c3>\n<1f28> <83df>\n<1f29> <7962>\n<1f2a> <53db>\n<1f2b> <7bc7>\n<1f2c> <8fc4>\n<1f2d> <7c3e>\n<1f2e> <50ca>\n<1f2f> <5315>\n<1f30> <55a9>\n<1f31> <56ae>\n<1f32> <5819>\n<1f33> <591b>\n<1f34> <5c28>\n<1f35> <5ed0>\n<1f36> <5ecf>\n<1f37> <6241>\n<1f38> <66c1>\n<1f39> <6c08>\n<1f3a> <6e23>\n<1f3b> <6eec>\n<1f3c> <7a97>\n<1f3d> <7bdd>\n<1f3e> <7fe9>\n<1f3f> <8422>\n<1f40> <8759>\n<1f41> <880e>\n<1f42> <87d2>\n<1f43> <9a19>\n<1f44> <9ead>\n<1f45> <ffe4>\n<1f46> <ff07>\n<1f47> <ff02>\n<1f48> <11a8>\n<1f49> <25c1>\n<1f4a> <25b7>\n<1f4b> <21e9>\n<1f4c> <21e7>\n<1f4d> <21e6>\n<1f4e> <21e8>\n<1f4f> <25a2>\n<1f50> <2667>\n<1f51> <2661>\n<1f52> <2664>\n<1f53> <2662>\n<1f54> <33a0>\n<1f55> <33a2>\n<1f58> <3397>\n<1f59> <2113>\n<1f5a> <3398>\n<1f5b> <33b3>\n<1f5c> <33b2>\n<1f5d> <33b1>\n<1f5e> <33b0>\n<1f62> <33cb>\n<1f63> <3390>\n<1f64> <33d4>\nendbfchar\n\n100 beginbfchar\n<1f65> <3396>\n<1f66> <3322>\n<1f67> <3316>\n<1f68> <3318>\n<1f69> <3315>\n<1f6a> <3303>\n<1f6b> <3323>\n<1f6c> <3357>\n<1f6d> <3342>\n<1f6e> <3339>\n<1f6f> <333b>\n<1f70> <3300>\n<1f71> <3331>\n<1f72> <3347>\n<1f73> <331e>\n<1f74> <332a>\n<1f75> <33cd>\n<1f76> <337f>\n<1f77> <2121>\n<1f78> <260e>\n<1f79> <3036>\n<1f7a> <3020>\n<1f7b> <00a9>\n<1f7c> <00ae>\n<1f7d> <0030002e>\n<1f9b> <3251>\n<1fca> <3243>\n<1fcb> <323d>\n<1fcc> <323f>\n<1fcd> <3234>\n<1fce> <3238>\n<1fcf> <3233>\n<1fd0> <323c>\n<1fd1> <3242>\n<1fd2> <323e>\n<1fd3> <3236>\n<1fd4> <3235>\n<1fd5> <323b>\n<1fd6> <3240>\n<1fd7> <323a>\n<1fd8> <32b0>\n<1fd9> <32ad>\n<1fda> <32a9>\n<1fdb> <32af>\n<1fdc> <3294>\n<1fdd> <32aa>\n<1fde> <3298>\n<1fdf> <32ab>\n<1fe0> <3292>\n<1fe1> <3291>\n<1fe2> <3293>\n<1fe3> <32ac>\n<1fe4> <32ae>\n<1fe5> <3296>\n<1fe6> <23a9>\n<1fe7> <23a8>\n<1fe8> <23a7>\n<1fe9> <fe38>\n<1fea> <23ad>\n<1feb> <23ac>\n<1fec> <23ab>\n<1fed> <fe38>\n<1ff1> <fe38>\n<1ff5> <fe38>\n<1ff6> <33cc>\n<1ff7> <3305>\n<1ff8> <00bd>\n<1ff9> <00bc>\n<1ffa> <339f>\n<1ffb> <33a3>\n<1ffc> <33a6>\n<1ffd> <007300650063>\n<1ffe> <006d0069006e>\n<1fff> <329e>\n<2002> <33c8>\n<2003> <222d>\n<2004> <5370>\n<2005> <3230>\n<200c> <3237>\n<200d> <3241>\n<200e> <27a1>\n<2012> <25c9>\n<2013> <2660>\n<2014> <2665>\n<2015> <2663>\n<2016> <2666>\n<201b> <261e>\n<201e> <261f>\n<201f> <3299>\n<2020> <24ea>\n<2023> <ff10>\n<2024> <ff10>\n<2025> <3000>\n<202e> <258f>\n<202f> <258e>\n<2030> <258d>\n<2031> <258c>\n<2032> <258b>\n<2033> <258a>\n<2034> <2589>\nendbfchar\n\n100 beginbfchar\n<2039> <2570>\n<203a> <256f>\n<203b> <2550>\n<203c> <255e>\n<203d> <256a>\n<203e> <2561>\n<2041> <25e5>\n<2042> <25e4>\n<2043> <25cf>\n<2044> <0ed0>\n<204a> <9022>\n<204b> <8fbb>\n<204c> <ff0c>\n<204d> <00b0>\n<204e> <3013>\n<204f> <309c>\n<2050> <309b>\n<2051> <2032>\n<2052> <ff0e>\n<2057> <201c>\n<2058> <201e>\n<2059> <2018>\n<205a> <201a>\n<205b> <2033>\n<205c> <51dc>\n<205d> <7199>\n<2067> <0058004900490049>\n<2068> <005800490056>\n<2069> <00580056>\n<206c> <0078006900690069>\n<206d> <007800690076>\n<206e> <00780076>\n<206f> <217f>\n<2070> <210a>\n<2071> <2109>\n<2072> <00540042>\n<2073> <213b>\n<2074> <3004>\n<2075> <21c6>\n<2078> <21932191>\n<207d> <5927>\n<207e> <5c0f>\n<207f> <329d>\n<2080> <63a7>\n<2081> <670996504f1a793e>\n<2082> <8ca156e36cd54eba>\n<2083> <337b>\n<2084> <337f>\n<2085> <670996504f1a793e>\n<2086> <8ca156e36cd54eba>\n<2087> <3333>\n<2088> <334e>\n<2089> <3322>\n<208a> <3316>\n<208b> <3305>\n<208c> <3305>\n<208d> <3305>\n<208e> <3333>\n<208f> <334e>\n<2090> <334e>\n<2091> <334e>\n<2092> <3303>\n<2093> <3318>\n<2094> <3315>\n<2095> <3339>\n<2096> <3339>\n<2097> <3339>\n<2098> <3357>\n<2099> <3342>\n<209a> <3342>\n<209b> <3342>\n<209c> <3323>\n<209d> <333b>\n<209e> <3300>\n<209f> <331e>\n<20a0> <331e>\n<20a1> <331e>\n<20a2> <332a>\n<20a3> <332a>\n<20a4> <332a>\n<20a5> <3347>\n<20a6> <3331>\n<20a7> <7e8a>\n<20a8> <891c>\n<20a9> <9348>\n<20aa> <9288>\n<20ab> <84dc>\n<20ac> <4fc9>\n<20ad> <70bb>\n<20ae> <6631>\n<20af> <68c8>\n<20b0> <92f9>\n<20b1> <66fb>\n<20b2> <5f45>\n<20b3> <4e28>\n<20b4> <4ee1>\n<20b5> <4efc>\n<20b6> <4f00>\n<20b7> <4f03>\n<20b8> <4f39>\nendbfchar\n\n100 beginbfchar\n<20b9> <4f56>\n<20ba> <4f92>\n<20bb> <4f8a>\n<20bc> <4f9a>\n<20bd> <4f94>\n<20be> <4fcd>\n<20bf> <5040>\n<20c0> <5022>\n<20c1> <4fff>\n<20c2> <501e>\n<20c3> <5046>\n<20c4> <5070>\n<20c5> <5042>\n<20c6> <5094>\n<20c7> <50f4>\n<20c8> <50d8>\n<20c9> <514a>\n<20ca> <5164>\n<20cb> <519d>\n<20cc> <51be>\n<20cd> <51ec>\n<20ce> <5215>\n<20cf> <529c>\n<20d0> <52a6>\n<20d1> <52c0>\n<20d2> <52db>\n<20d3> <5300>\n<20d4> <5307>\n<20d5> <5324>\n<20d6> <5372>\n<20d7> <5393>\n<20d8> <53b2>\n<20d9> <53dd>\n<20da> <fa0e>\n<20db> <549c>\n<20dc> <548a>\n<20dd> <54a9>\n<20de> <54ff>\n<20df> <5586>\n<20e0> <5759>\n<20e1> <5765>\n<20e2> <57ac>\n<20e3> <57c8>\n<20e4> <57c7>\n<20e5> <fa0f>\n<20e6> <585a>\n<20e7> <589e>\n<20e8> <58b2>\n<20e9> <590b>\n<20ea> <5953>\n<20eb> <595b>\n<20ec> <595d>\n<20ed> <5963>\n<20ee> <59a4>\n<20ef> <59ba>\n<20f0> <5b56>\n<20f1> <5bc0>\n<20f2> <752f>\n<20f3> <5bd8>\n<20f4> <5bdb>\n<20f5> <5c1e>\n<20f6> <5ca6>\n<20f7> <5cba>\n<20f8> <5cf5>\n<20f9> <5d27>\n<20fa> <5d53>\n<20fb> <fa11>\n<20fc> <5d42>\n<20fd> <5d6d>\n<2100> <5dd0>\n<2101> <5f21>\n<2102> <5f34>\n<2103> <5f67>\n<2104> <5fb7>\n<2105> <5fde>\n<2106> <605d>\n<2107> <6085>\n<2108> <608a>\n<2109> <60de>\n<210a> <60d5>\n<210b> <6120>\n<210c> <60f2>\n<210d> <6111>\n<210e> <6137>\n<210f> <6130>\n<2110> <6198>\n<2111> <6213>\n<2112> <62a6>\n<2113> <63f5>\n<2114> <6460>\n<2115> <649d>\n<2116> <64ce>\n<2117> <654e>\n<2118> <6600>\n<2119> <6615>\n<211a> <6609>\n<211b> <662e>\n<211c> <661e>\n<211d> <6624>\n<211e> <6665>\nendbfchar\n\n100 beginbfchar\n<211f> <6657>\n<2120> <6659>\n<2121> <fa12>\n<2122> <6673>\n<2123> <6699>\n<2124> <66a0>\n<2125> <66b2>\n<2126> <66bf>\n<2127> <66fa>\n<2128> <670e>\n<2129> <6717>\n<212a> <6766>\n<212b> <67bb>\n<212c> <6852>\n<212d> <67c0>\n<212e> <6801>\n<212f> <6844>\n<2130> <68cf>\n<2131> <fa13>\n<2132> <6968>\n<2133> <fa14>\n<2134> <6998>\n<2135> <69e2>\n<2136> <6a30>\n<2137> <6a6b>\n<2138> <6a46>\n<2139> <6a73>\n<213a> <6a7e>\n<213b> <6ae2>\n<213c> <6ae4>\n<213d> <6bd6>\n<213e> <6c3f>\n<213f> <6c5c>\n<2140> <6c86>\n<2141> <6c6f>\n<2142> <6cda>\n<2143> <6d04>\n<2144> <6d87>\n<2145> <6d6f>\n<2146> <6d96>\n<2147> <6dac>\n<2148> <6dcf>\n<2149> <6df8>\n<214a> <6df2>\n<214b> <6dfc>\n<214c> <6e39>\n<214d> <6e5c>\n<214e> <6e27>\n<214f> <6e3c>\n<2150> <6ebf>\n<2151> <6f88>\n<2152> <6fb5>\n<2153> <6ff5>\n<2154> <7005>\n<2155> <7007>\n<2156> <7028>\n<2157> <7085>\n<2158> <70ab>\n<2159> <710f>\n<215a> <7104>\n<215b> <715c>\n<215e> <d841de11>\n<215f> <71c1>\n<2160> <71fe>\n<2161> <72b1>\n<2162> <72be>\n<2163> <7324>\n<2164> <fa16>\n<2165> <7377>\n<2166> <73bd>\n<2167> <73c9>\n<2168> <73d6>\n<2169> <73e3>\n<216a> <73d2>\n<216b> <7407>\n<216c> <73f5>\n<216d> <7426>\n<216e> <742a>\n<216f> <7429>\n<2170> <742e>\n<2171> <7462>\n<2172> <7489>\n<2173> <749f>\n<2174> <7501>\n<2175> <756f>\n<2176> <7682>\n<2177> <769c>\n<2178> <769e>\n<2179> <769b>\n<217a> <76a6>\n<217b> <fa17>\n<217c> <7746>\n<217d> <52af>\n<217e> <7821>\n<217f> <784e>\n<2180> <7864>\n<2181> <787a>\n<2182> <7930>\n<2186> <7994>\n<2187> <fa1b>\nendbfchar\n\n100 beginbfchar\n<2188> <799b>\n<2189> <7ad1>\n<218a> <7ae7>\n<218b> <fa1c>\n<218c> <7aeb>\n<218d> <7b9e>\n<218e> <fa1d>\n<218f> <7d48>\n<2190> <7d5c>\n<2191> <7db7>\n<2192> <7da0>\n<2193> <7dd6>\n<2194> <7e52>\n<2195> <7f47>\n<2196> <7fa1>\n<2197> <fa1e>\n<2198> <8301>\n<2199> <8362>\n<219a> <837f>\n<219b> <83c7>\n<219c> <83f6>\n<219d> <8448>\n<219e> <84b4>\n<219f> <8553>\n<21a0> <8559>\n<21a1> <856b>\n<21a2> <fa1f>\n<21a3> <85b0>\n<21a6> <8807>\n<21a7> <88f5>\n<21a8> <8a12>\n<21a9> <8a37>\n<21aa> <8a79>\n<21ab> <8aa7>\n<21ac> <8abe>\n<21ad> <8adf>\n<21ae> <fa22>\n<21af> <8af6>\n<21b0> <8b53>\n<21b1> <8b7f>\n<21b2> <8cf0>\n<21b3> <8cf4>\n<21b4> <8d12>\n<21b5> <8d76>\n<21b6> <fa23>\n<21b7> <8ecf>\n<21ba> <9067>\n<21bb> <90de>\n<21bc> <fa26>\n<21bd> <9115>\n<21be> <9127>\n<21bf> <91da>\n<21c0> <91d7>\n<21c1> <91de>\n<21c6> <9206>\n<21c7> <9210>\n<21c8> <920a>\n<21c9> <923a>\n<21ca> <9240>\n<21cb> <923c>\n<21cc> <924e>\n<21cd> <9259>\n<21ce> <9251>\n<21cf> <9239>\n<21d0> <9267>\n<21d1> <92a7>\n<21d4> <92e7>\n<21d5> <92d7>\n<21d6> <92d9>\n<21d7> <92d0>\n<21d8> <fa27>\n<21d9> <92d5>\n<21da> <92e0>\n<21db> <92d3>\n<21dc> <9325>\n<21dd> <9321>\n<21de> <92fb>\n<21df> <fa28>\n<21e0> <931e>\n<21e1> <92ff>\n<21e2> <931d>\n<21e3> <9302>\n<21e4> <9370>\n<21e5> <9357>\n<21e6> <93a4>\n<21e7> <93c6>\n<21e8> <93de>\n<21e9> <93f8>\n<21ea> <9431>\n<21eb> <9445>\n<21ec> <9448>\n<21ed> <9592>\n<21ee> <9686>\n<21ef> <fa29>\n<21f0> <969d>\n<21f1> <96af>\n<21f2> <9733>\n<21f3> <973b>\n<21f4> <9743>\n<21f5> <974d>\nendbfchar\n\n100 beginbfchar\n<21f6> <974f>\n<21f7> <9751>\n<21f8> <9755>\n<21f9> <9857>\n<21fa> <9865>\n<21fd> <9927>\n<21fe> <fa2c>\n<21ff> <999e>\n<2200> <9a4e>\n<2201> <9ad9>\n<2202> <9adc>\n<2203> <9b75>\n<2204> <9b72>\n<2205> <9b8f>\n<2206> <9bb1>\n<2207> <9bbb>\n<2208> <9c00>\n<2209> <9d70>\n<220a> <9d6b>\n<220b> <fa2d>\n<220c> <9e19>\n<220d> <9ed1>\n<220e> <00ac>\n<220f> <005c>\n<224c> <00a5>\n<226c> <00a6>\n<226d> <007d>\n<226e> <0303>\n<226f> <2019>\n<2270> <005c>\n<2271> <2018>\n<2272> <007c>\n<2273> <007e>\n<2277> <2044>\n<2278> <0192>\n<2279> <00a7>\n<227a> <00a4>\n<227b> <201c>\n<227c> <00ab>\n<2281> <2012>\n<2284> <00b7>\n<2285> <00b6>\n<2286> <2022>\n<2287> <201a>\n<2288> <201e>\n<2289> <201d>\n<228a> <00bb>\n<228b> <2026>\n<228c> <2030>\n<228d> <00bf>\n<2290> <00af>\n<2294> <030a>\n<2295> <00b8>\n<2296> <030b>\n<2297> <0328>\n<2298> <030c>\n<2299> <0336>\n<229a> <00c6>\n<229b> <00aa>\n<229c> <0141>\n<229d> <00d8>\n<229e> <0152>\n<229f> <00ba>\n<22a0> <00e6>\n<22a1> <0131>\n<22a2> <0142>\n<22a3> <00f8>\n<22a4> <0153>\n<22a5> <00df>\n<22a6> <002d>\n<22a7> <00a9>\n<22a8> <00ac>\n<22a9> <00ae>\n<22ae> <00b5>\n<22af> <00b9>\n<22ee> <0160>\n<22ef> <0178>\n<22f0> <017d>\n<22f1> <0305>\n<22f2> <0161>\n<22f3> <2122>\n<22f4> <017e>\n<22f5> <0030>\n<22f6> <2002>\n<2332> <00a5>\n<2354> <203e>\n<2355> <ff40>\n<2356> <2032>\n<2357> <00a8>\n<2358> <2036>\n<2359> <00c4>\n<235a> <00f9>\n<235b> <00e9>\n<235c> <00ed>\n<235d> <00df>\n<235e> <00e7>\n<235f> <00c7>\n<2360> <00d1>\n<2361> <00f1>\n<2364> <00f3>\nendbfchar\n\n100 beginbfchar\n<2365> <00fa>\n<2366> <00a1>\n<2367> <00bf>\n<2368> <00bd>\n<2369> <00d6>\n<236a> <00dc>\n<236b> <00e4>\n<236c> <00eb>\n<236d> <00ef>\n<236e> <00f6>\n<236f> <00dc>\n<2370> <00e2>\n<2371> <00ea>\n<2372> <00ee>\n<2373> <00f4>\n<2374> <00fc>\n<2375> <00e0>\n<2376> <00e9>\n<2377> <00e1>\n<2378> <007e>\n<2379> <0030>\n<237a> <00ac>\n<237b> <005c>\n<23be> <30ee>\n<23bf> <30ab>\n<23c0> <30b1>\n<23c1> <30f4>\n<23c2> <30ac>\n<23c3> <30ae>\n<23c4> <30b0>\n<23c5> <30b2>\n<23c6> <30b4>\n<23c7> <30b6>\n<23c8> <30b8>\n<23c9> <30ba>\n<23ca> <30bc>\n<23cb> <30be>\n<23cc> <30c0>\n<23cd> <30c2>\n<23ce> <30c5>\n<23cf> <30c7>\n<23d0> <30c9>\n<23db> <ff60>\n<23dc> <3092>\n<23dd> <3041>\n<23de> <3043>\n<23df> <3045>\n<23e0> <3047>\n<23e1> <3049>\n<23e2> <3083>\n<23e3> <3085>\n<23e4> <3087>\n<23e5> <3063>\n<23e6> <3042>\n<23e7> <3044>\n<23e8> <3046>\n<23e9> <3048>\n<23ec> <304d>\n<23ed> <304f>\n<23ee> <3051>\n<23ef> <3053>\n<23f0> <3055>\n<23f1> <3057>\n<23f2> <3059>\n<23f3> <305b>\n<23f4> <305d>\n<23f5> <305f>\n<23f6> <3061>\n<23f7> <3064>\n<23f8> <3066>\n<23f9> <3068>\n<2400> <3072>\n<2401> <3075>\n<2402> <3078>\n<2403> <307b>\n<2409> <3084>\n<240a> <3086>\n<2411> <308f>\n<2412> <3093>\n<2415> <308e>\n<2416> <304c>\n<2417> <304e>\n<2418> <3050>\n<2419> <3052>\n<241a> <3054>\n<241b> <3056>\n<241c> <3068>\n<241d> <305a>\n<241e> <305c>\n<241f> <305e>\n<2420> <3060>\n<2421> <3062>\n<2422> <3065>\n<2423> <3067>\n<2424> <3069>\n<2431> <005b>\n<2432> <005d>\n<243b> <2012>\n<243c> <ff60>\n<2489> <25b2>\nendbfchar\n\n100 beginbfchar\n<248a> <20ac>\n<248b> <2126>\n<248e> <fb00>\n<2491> <0101>\n<2492> <012b>\n<2493> <016b>\n<2494> <0113>\n<2495> <014d>\n<2496> <0100>\n<2497> <012a>\n<2498> <016a>\n<2499> <0112>\n<249a> <014c>\n<24a1> <2070>\n<24b2> <01cd>\n<24b3> <011a>\n<24b4> <0045030a>\n<24b5> <1ebc>\n<24b6> <01cf>\n<24b7> <0049030a>\n<24b8> <0128>\n<24b9> <01d1>\n<24ba> <004f030a>\n<24bb> <01d3>\n<24bc> <016e>\n<24bd> <0168>\n<24be> <01ce>\n<24bf> <011b>\n<24c0> <0065030a>\n<24c1> <1ebd>\n<24c2> <01d0>\n<24c3> <0131030a>\n<24c4> <0129>\n<24c5> <01d2>\n<24c6> <006f030a>\n<24c7> <01d4>\n<24c8> <016f>\n<24c9> <0169>\n<24ca> <0251>\n<24cb> <1f71>\n<24cc> <1f70>\n<24cd> <01fd>\n<24ce> <00e6>\n<24cf> <0254>\n<24d0> <0254>\n<24d1> <0254>\n<24d2> <0259>\n<24d3> <0259>\n<24d6> <025a>\n<24d9> <1f73>\n<24da> <1f72>\n<24db> <0237>\n<24dc> <014b>\n<24dd> <0275>\n<24de> <028c>\n<24df> <028c>\n<24e0> <028c>\n<24e1> <0292>\n<24e2> <0283>\n<24e3> <02d0>\n<2520> <00a5>\n<2540> <00a6>\n<2541> <007d>\n<2542> <0303>\n<2543> <2019>\n<2544> <005c>\n<2545> <2018>\n<2546> <007c>\n<2547> <007e>\n<254b> <2044>\n<254c> <0192>\n<254d> <00a7>\n<254e> <00a4>\n<254f> <201c>\n<2550> <00ab>\n<2555> <2012>\n<2558> <00b7>\n<2559> <00b6>\n<255a> <2022>\n<255b> <201a>\n<255c> <201e>\n<255d> <201d>\n<255e> <00bb>\n<255f> <2026>\n<2560> <2030>\n<2561> <00bf>\n<2564> <00af>\n<2568> <030a>\n<2569> <00b8>\n<256a> <030b>\n<256b> <0328>\n<256c> <030c>\n<256d> <0336>\n<256e> <00c6>\n<256f> <00aa>\n<2570> <0141>\n<2571> <00d8>\n<2572> <0152>\n<2573> <00ba>\n<2574> <00e6>\nendbfchar\n\n100 beginbfchar\n<2575> <0131>\n<2576> <0142>\n<2577> <00f8>\n<2578> <0153>\n<2579> <00df>\n<257a> <002d>\n<257b> <00a9>\n<257c> <00ac>\n<257d> <00ae>\n<2582> <00b5>\n<2583> <00b9>\n<25c2> <0160>\n<25c3> <0178>\n<25c4> <017d>\n<25c5> <0305>\n<25c6> <0161>\n<25c7> <2122>\n<25c8> <017e>\n<25c9> <0030>\n<25ca> <20ac>\n<25cb> <2126>\n<25ce> <fb00>\n<25d1> <0101>\n<25d2> <012b>\n<25d3> <016b>\n<25d4> <0113>\n<25d5> <014d>\n<25d6> <0100>\n<25d7> <012a>\n<25d8> <016a>\n<25d9> <0112>\n<25da> <014c>\n<25e1> <2070>\n<25f2> <01cd>\n<25f3> <011a>\n<25f4> <0045030a>\n<25f5> <1ebc>\n<25f6> <01cf>\n<25f7> <0049030a>\n<25f8> <0128>\n<25f9> <01d1>\n<25fa> <004f030a>\n<25fb> <01d3>\n<25fc> <016e>\n<25fd> <0168>\n<25fe> <01ce>\n<25ff> <011b>\n<2600> <0065030a>\n<2601> <1ebd>\n<2602> <01d0>\n<2603> <0131030a>\n<2604> <0129>\n<2605> <01d2>\n<2606> <006f030a>\n<2607> <01d4>\n<2608> <016f>\n<2609> <0169>\n<2614> <0336>\n<2615> <002d>\n<2616> <003d>\n<2617> <002c>\n<2628> <0336>\n<2629> <002d>\n<262a> <003d>\n<262b> <002c>\n<2632> <00b7>\n<2633> <20ac>\n<2634> <0030002f0033>\n<2637> <00be>\n<263e> <0031002f0037>\n<263f> <0032002f0037>\n<2640> <0033002f0037>\n<2641> <0034002f0037>\n<2642> <0035002f0037>\n<2643> <0036002f0037>\n<2648> <0031002f0039>\n<2649> <0032002f0039>\n<264a> <0034002f0039>\n<264b> <0035002f0039>\n<264c> <0037002f0039>\n<264d> <0038002f0039>\n<264e> <0031002f00310030>\n<264f> <0033002f00310030>\n<2650> <0037002f00310030>\n<2651> <0039002f00310030>\n<2652> <0031002f00310031>\n<2653> <0032002f00310031>\n<2654> <0033002f00310031>\n<2655> <0034002f00310031>\n<2656> <0035002f00310031>\n<2657> <0036002f00310031>\n<2658> <0037002f00310031>\n<2659> <0038002f00310031>\n<265a> <0039002f00310031>\n<265b> <00310030002f00310031>\n<265c> <0031002f00310032>\n<265d> <0035002f00310032>\n<265e> <0037002f00310032>\n<265f> <00310031002f00310032>\n<2660> <0031002f003100300030>\nendbfchar\n\n100 beginbfchar\n<2661> <0030002f0033>\n<2662> <0031002f0032>\n<2663> <0031002f0033>\n<2664> <0032002f0033>\n<2665> <0031002f0034>\n<2666> <0033002f0034>\n<2667> <0031002f0035>\n<2668> <0032002f0035>\n<2669> <0033002f0035>\n<266a> <0034002f0035>\n<266b> <0031002f0036>\n<266c> <0035002f0036>\n<266d> <0031002f0037>\n<266e> <0032002f0037>\n<266f> <0033002f0037>\n<2670> <0034002f0037>\n<2671> <0035002f0037>\n<2672> <0036002f0037>\n<2673> <0031002f0038>\n<2674> <0033002f0038>\n<2675> <0035002f0038>\n<2676> <0037002f0038>\n<2677> <0031002f0039>\n<2678> <0032002f0039>\n<2679> <0034002f0039>\n<267a> <0035002f0039>\n<267b> <0037002f0039>\n<267c> <0038002f0039>\n<267d> <0031002f00310030>\n<267e> <0033002f00310030>\n<267f> <0037002f00310030>\n<2680> <0039002f00310030>\n<2681> <0031002f00310031>\n<2682> <0032002f00310031>\n<2683> <0033002f00310031>\n<2684> <0034002f00310031>\n<2685> <0035002f00310031>\n<2686> <0036002f00310031>\n<2687> <0037002f00310031>\n<2688> <0038002f00310031>\n<2689> <0039002f00310031>\n<268a> <00310030002f00310031>\n<268b> <0031002f00310032>\n<268c> <0035002f00310032>\n<268d> <0037002f00310032>\n<268e> <00310031002f00310032>\n<268f> <0031002f003100300030>\n<269a> <0030>\n<269b> <2163>\n<269c> <00300030>\n<269d> <00300031>\n<269e> <00300032>\n<269f> <00300033>\n<26a0> <00300034>\n<26a1> <00300035>\n<26a2> <00300036>\n<26a3> <00300037>\n<26a4> <00300038>\n<26a5> <00300039>\n<26a6> <00320031>\n<26a7> <00320032>\n<26a8> <00320033>\n<26a9> <00320034>\n<26aa> <00320035>\n<26ab> <00320036>\n<26ac> <00320037>\n<26ad> <00320038>\n<26ae> <00320039>\n<26af> <00330030>\n<26b0> <00330031>\n<26b1> <00330032>\n<26b2> <00330033>\n<26b3> <00330034>\n<26b4> <00330035>\n<26b5> <00330036>\n<26b6> <00330037>\n<26b7> <00330038>\n<26b8> <00330039>\n<26b9> <00340030>\n<26ba> <00340031>\n<26bb> <00340032>\n<26bc> <00340033>\n<26bd> <00340034>\n<26be> <00340035>\n<26bf> <00340036>\n<26c0> <00340037>\n<26c1> <00340038>\n<26c2> <00340039>\n<26c3> <00350030>\n<26c4> <00350031>\n<26c5> <00350032>\n<26c6> <00350033>\n<26c7> <00350034>\n<26c8> <00350035>\n<26c9> <00350036>\n<26ca> <00350037>\n<26cb> <00350038>\n<26cc> <00350039>\n<26cd> <00360030>\n<26ce> <00360031>\nendbfchar\n\n100 beginbfchar\n<26cf> <00360032>\n<26d0> <00360033>\n<26d1> <00360034>\n<26d2> <00360035>\n<26d3> <00360036>\n<26d4> <00360037>\n<26d5> <00360038>\n<26d6> <00360039>\n<26d7> <00370030>\n<26d8> <00370031>\n<26d9> <00370032>\n<26da> <00370033>\n<26db> <00370034>\n<26dc> <00370035>\n<26dd> <00370036>\n<26de> <00370037>\n<26df> <00370038>\n<26e0> <00370039>\n<26e1> <00380030>\n<26e2> <00380031>\n<26e3> <00380032>\n<26e4> <00380033>\n<26e5> <00380034>\n<26e6> <00380035>\n<26e7> <00380036>\n<26e8> <00380037>\n<26e9> <00380038>\n<26ea> <00380039>\n<26eb> <00390030>\n<26ec> <00390031>\n<26ed> <00390032>\n<26ee> <00390033>\n<26ef> <00390034>\n<26f0> <00390035>\n<26f1> <00390036>\n<26f2> <00390037>\n<26f3> <00390038>\n<26f4> <00390039>\n<26f5> <003100300030>\n<2702> <0078006900690069>\n<2703> <007800690076>\n<2704> <00780076>\n<2711> <0058004900490049>\n<2712> <005800490056>\n<2713> <00580056>\n<272e> <3042>\n<272f> <3044>\n<2730> <3046>\n<2731> <3048>\n<2734> <304d>\n<2735> <304f>\n<2736> <3051>\n<2737> <3053>\n<2738> <3055>\n<2739> <3057>\n<273a> <3059>\n<273b> <305b>\n<273c> <305d>\n<273d> <305f>\n<273e> <3061>\n<273f> <3064>\n<2740> <3066>\n<2741> <3068>\n<2748> <3072>\n<2749> <3075>\n<274a> <3078>\n<274b> <307b>\n<2751> <3084>\n<2752> <3086>\n<275e> <30a2>\n<275f> <30a4>\n<2760> <30a6>\n<2761> <30a8>\n<2764> <30ad>\n<2765> <30af>\n<2766> <30b1>\n<2767> <30b3>\n<2768> <30b5>\n<2769> <30b7>\n<276a> <30b9>\n<276b> <30bb>\n<276c> <30bd>\n<276d> <30bf>\n<276e> <30c1>\n<276f> <30c4>\n<2770> <30c6>\n<2771> <30c8>\n<2778> <30d2>\n<2779> <30d5>\n<277a> <30d8>\n<277b> <30db>\n<2781> <30e4>\n<2782> <30e6>\n<2798> <53414e00>\n<2799> <53414e8c>\n<279a> <53414e09>\n<279b> <534156db>\n<279c> <53414e94>\n<279d> <5341516d>\n<279e> <53414e03>\nendbfchar\n\n100 beginbfchar\n<279f> <5341516b>\n<27a0> <53414e5d>\n<27a1> <4e8c5341>\n<27a2> <55b6>\n<27a3> <5408>\n<27a4> <6ceb>\n<27a5> <554f>\n<27a6> <7b54>\n<27a7> <4f8b>\n<27bc> <3063>\n<27bd> <624d>\n<27be> <3007>\n<27bf> <4e00>\n<27c0> <4e8c>\n<27c1> <4e09>\n<27c2> <56db>\n<27c3> <4e94>\n<27c4> <516d>\n<27c5> <4e03>\n<27c6> <516b>\n<27c7> <4e5d>\n<27c8> <5341>\n<27c9> <3007>\n<27ca> <4e00>\n<27cb> <4e8c>\n<27cc> <4e09>\n<27cd> <56db>\n<27ce> <4e94>\n<27cf> <516d>\n<27d0> <4e03>\n<27d1> <516b>\n<27d2> <4e5d>\n<27d3> <5341>\n<27d4> <3007>\n<27d5> <4e00>\n<27d6> <4e8c>\n<27d7> <4e09>\n<27d8> <56db>\n<27d9> <4e94>\n<27da> <516d>\n<27db> <4e03>\n<27dc> <516b>\n<27dd> <4e5d>\n<27de> <3064>\n<27df> <624d>\n<27e0> <4e00>\n<27e1> <4e8c>\n<27e2> <4e09>\n<27e3> <56db>\n<27e4> <4e94>\n<27e5> <516d>\n<27e6> <4e03>\n<27e7> <516b>\n<27e8> <4e5d>\n<27e9> <5341>\n<27ea> <3007>\n<27eb> <4e00>\n<27ec> <4e8c>\n<27ed> <4e09>\n<27ee> <56db>\n<27ef> <4e94>\n<27f0> <516d>\n<27f1> <4e03>\n<27f2> <516b>\n<27f3> <4e5d>\n<27f4> <5341>\n<27f5> <30b3>\n<27f6> <3063>\n<27f7> <30c3>\n<27f8> <30a9>\n<27f9> <00280029>\n<27fa> <00300030>\n<2804> <00330032>\n<2805> <00330033>\n<2806> <00330034>\n<2807> <00330035>\n<2808> <00330036>\n<2809> <00330037>\n<280a> <00330038>\n<280b> <00330039>\n<280c> <00340030>\n<280d> <00340031>\n<280e> <00340032>\n<280f> <00340033>\n<2810> <00340034>\n<2811> <00340035>\n<2812> <00340036>\n<2813> <00340037>\n<2814> <00340038>\n<2815> <00340039>\n<2816> <00350030>\n<2817> <00350031>\n<2818> <00350032>\n<2819> <00350033>\n<281a> <00350034>\n<281b> <00350035>\n<281c> <00350036>\n<281d> <00350037>\n<281e> <00350038>\n<281f> <00350039>\nendbfchar\n\n100 beginbfchar\n<2820> <00360030>\n<2821> <00360031>\n<2822> <00360032>\n<2823> <00360033>\n<2824> <00360034>\n<2825> <00360035>\n<2826> <00360036>\n<2827> <00360037>\n<2828> <00360038>\n<2829> <00360039>\n<282a> <00370030>\n<282b> <00370031>\n<282c> <00370032>\n<282d> <00370033>\n<282e> <00370034>\n<282f> <00370035>\n<2830> <00370036>\n<2831> <00370037>\n<2832> <00370038>\n<2833> <00370039>\n<2834> <00380030>\n<2835> <00380031>\n<2836> <00380032>\n<2837> <00380033>\n<2838> <00380034>\n<2839> <00380035>\n<283a> <00380036>\n<283b> <00380037>\n<283c> <00380038>\n<283d> <00380039>\n<283e> <00390030>\n<283f> <00390031>\n<2840> <00390032>\n<2841> <00390033>\n<2842> <00390034>\n<2843> <00390035>\n<2844> <00390036>\n<2845> <00390037>\n<2846> <00390038>\n<2847> <00390039>\n<2848> <003100300030>\n<287d> <3042>\n<287e> <3044>\n<287f> <3046>\n<2880> <3048>\n<2883> <304d>\n<2884> <304f>\n<2885> <3051>\n<2886> <3053>\n<2887> <3055>\n<2888> <3057>\n<2889> <3059>\n<288a> <305b>\n<288b> <305d>\n<288c> <305f>\n<288d> <3061>\n<288e> <3064>\n<288f> <3066>\n<2890> <3068>\n<2897> <3072>\n<2898> <3075>\n<2899> <3078>\n<289a> <307b>\n<28a0> <3084>\n<28a1> <3086>\n<28dc> <30f3>\n<28e7> <3290>\n<28ee> <8abf>\n<28ef> <329f>\n<28f0> <526f>\n<28f1> <6e1b>\n<28f2> <6a19>\n<28f3> <6b20>\n<28f4> <57fa>\n<28f5> <7981>\n<28f8> <329b>\n<28f9> <329a>\n<28fa> <32a3>\n<28fb> <32a2>\n<28fc> <3297>\n<28fd> <51fa>\n<28fe> <329c>\n<28ff> <3295>\n<2900> <6e08>\n<2901> <5897>\n<2902> <554f>\n<2903> <7b54>\n<2904> <4f8b>\n<2905> <96fb>\n<2906> <25cc>\n<2907> <24ff>\n<2908> <00300030>\n<2909> <00300031>\n<290a> <00300032>\n<290b> <00300033>\n<290c> <00300034>\n<290d> <00300035>\n<290e> <00300036>\n<290f> <00300037>\n<2910> <00300038>\nendbfchar\n\n100 beginbfchar\n<2911> <00300039>\n<2912> <00310030>\n<2913> <00310031>\n<2914> <00310032>\n<2915> <00310033>\n<2916> <00310034>\n<2917> <00310035>\n<2918> <00310036>\n<2919> <00310037>\n<291a> <00310038>\n<291b> <00310039>\n<291c> <00320030>\n<291d> <00320031>\n<291e> <00320032>\n<291f> <00320033>\n<2920> <00320034>\n<2921> <00320035>\n<2922> <00320036>\n<2923> <00320037>\n<2924> <00320038>\n<2925> <00320039>\n<2926> <00330030>\n<2927> <00330031>\n<2928> <00330032>\n<2929> <00330033>\n<292a> <00330034>\n<292b> <00330035>\n<292c> <00330036>\n<292d> <00330037>\n<292e> <00330038>\n<292f> <00330039>\n<2930> <00340030>\n<2931> <00340031>\n<2932> <00340032>\n<2933> <00340033>\n<2934> <00340034>\n<2935> <00340035>\n<2936> <00340036>\n<2937> <00340037>\n<2938> <00340038>\n<2939> <00340039>\n<293a> <00350030>\n<293b> <00350031>\n<293c> <00350032>\n<293d> <00350033>\n<293e> <00350034>\n<293f> <00350035>\n<2940> <00350036>\n<2941> <00350037>\n<2942> <00350038>\n<2943> <00350039>\n<2944> <00360030>\n<2945> <00360031>\n<2946> <00360032>\n<2947> <00360033>\n<2948> <00360034>\n<2949> <00360035>\n<294a> <00360036>\n<294b> <00360037>\n<294c> <00360038>\n<294d> <00360039>\n<294e> <00370030>\n<294f> <00370031>\n<2950> <00370032>\n<2951> <00370033>\n<2952> <00370034>\n<2953> <00370035>\n<2954> <00370036>\n<2955> <00370037>\n<2956> <00370038>\n<2957> <00370039>\n<2958> <00380030>\n<2959> <00380031>\n<295a> <00380032>\n<295b> <00380033>\n<295c> <00380034>\n<295d> <00380035>\n<295e> <00380036>\n<295f> <00380037>\n<2960> <00380038>\n<2961> <00380039>\n<2962> <00390030>\n<2963> <00390031>\n<2964> <00390032>\n<2965> <00390033>\n<2966> <00390034>\n<2967> <00390035>\n<2968> <00390036>\n<2969> <00390037>\n<296a> <00390038>\n<296b> <00390039>\n<296c> <003100300030>\n<29a1> <3042>\n<29a2> <3044>\n<29a3> <3046>\n<29a4> <3048>\n<29a7> <304d>\n<29a8> <304f>\n<29a9> <3051>\n<29aa> <3053>\nendbfchar\n\n100 beginbfchar\n<29ab> <3055>\n<29ac> <3057>\n<29ad> <3059>\n<29ae> <305b>\n<29af> <305d>\n<29b0> <305f>\n<29b1> <3061>\n<29b2> <3064>\n<29b3> <3066>\n<29b4> <3068>\n<29bb> <3072>\n<29bc> <3075>\n<29bd> <3078>\n<29be> <307b>\n<29c4> <3084>\n<29c5> <3086>\n<29d1> <30a2>\n<29d2> <30a4>\n<29d3> <30a6>\n<29d4> <30a8>\n<29d7> <30ad>\n<29d8> <30af>\n<29d9> <30b1>\n<29da> <30b3>\n<29db> <30b5>\n<29dc> <30b7>\n<29dd> <30b9>\n<29de> <30bb>\n<29df> <30bd>\n<29e0> <30bf>\n<29e1> <30c1>\n<29e2> <30c4>\n<29e3> <30c6>\n<29e4> <30c8>\n<29eb> <30d2>\n<29ec> <30d5>\n<29ed> <30d8>\n<29ee> <30db>\n<29f4> <30e4>\n<29f5> <30e6>\n<2a00> <30f3>\n<2a01> <65e5>\n<2a02> <6708>\n<2a03> <706b>\n<2a04> <6c34>\n<2a05> <6728>\n<2a06> <91d1>\n<2a07> <571f>\n<2a08> <554f>\n<2a09> <7b54>\n<2a0a> <4f8b>\n<2a0b> <25cf>\n<2a0c> <0030>\n<2a0d> <00300030>\n<2a0e> <0031>\n<2a0f> <00300031>\n<2a10> <0032>\n<2a11> <00300032>\n<2a12> <0033>\n<2a13> <00300033>\n<2a14> <0034>\n<2a15> <00300034>\n<2a16> <0035>\n<2a17> <00300035>\n<2a18> <0036>\n<2a19> <00300036>\n<2a1a> <0037>\n<2a1b> <00300037>\n<2a1c> <0038>\n<2a1d> <00300038>\n<2a1e> <0039>\n<2a1f> <00300039>\n<2a20> <00310030>\n<2a21> <00310031>\n<2a22> <00310032>\n<2a23> <00310033>\n<2a24> <00310034>\n<2a25> <00310035>\n<2a26> <00310036>\n<2a27> <00310037>\n<2a28> <00310038>\n<2a29> <00310039>\n<2a2a> <00320030>\n<2a2b> <00320031>\n<2a2c> <00320032>\n<2a2d> <00320033>\n<2a2e> <00320034>\n<2a2f> <00320035>\n<2a30> <00320036>\n<2a31> <00320037>\n<2a32> <00320038>\n<2a33> <00320039>\n<2a34> <00330030>\n<2a35> <00330031>\n<2a36> <00330032>\n<2a37> <00330033>\n<2a38> <00330034>\n<2a39> <00330035>\n<2a3a> <00330036>\n<2a3b> <00330037>\nendbfchar\n\n100 beginbfchar\n<2a3c> <00330038>\n<2a3d> <00330039>\n<2a3e> <00340030>\n<2a3f> <00340031>\n<2a40> <00340032>\n<2a41> <00340033>\n<2a42> <00340034>\n<2a43> <00340035>\n<2a44> <00340036>\n<2a45> <00340037>\n<2a46> <00340038>\n<2a47> <00340039>\n<2a48> <00350030>\n<2a49> <00350031>\n<2a4a> <00350032>\n<2a4b> <00350033>\n<2a4c> <00350034>\n<2a4d> <00350035>\n<2a4e> <00350036>\n<2a4f> <00350037>\n<2a50> <00350038>\n<2a51> <00350039>\n<2a52> <00360030>\n<2a53> <00360031>\n<2a54> <00360032>\n<2a55> <00360033>\n<2a56> <00360034>\n<2a57> <00360035>\n<2a58> <00360036>\n<2a59> <00360037>\n<2a5a> <00360038>\n<2a5b> <00360039>\n<2a5c> <00370030>\n<2a5d> <00370031>\n<2a5e> <00370032>\n<2a5f> <00370033>\n<2a60> <00370034>\n<2a61> <00370035>\n<2a62> <00370036>\n<2a63> <00370037>\n<2a64> <00370038>\n<2a65> <00370039>\n<2a66> <00380030>\n<2a67> <00380031>\n<2a68> <00380032>\n<2a69> <00380033>\n<2a6a> <00380034>\n<2a6b> <00380035>\n<2a6c> <00380036>\n<2a6d> <00380037>\n<2a6e> <00380038>\n<2a6f> <00380039>\n<2a70> <00390030>\n<2a71> <00390031>\n<2a72> <00390032>\n<2a73> <00390033>\n<2a74> <00390034>\n<2a75> <00390035>\n<2a76> <00390036>\n<2a77> <00390037>\n<2a78> <00390038>\n<2a79> <00390039>\n<2a7a> <003100300030>\n<2aaf> <3042>\n<2ab0> <3044>\n<2ab1> <3046>\n<2ab2> <3048>\n<2ab5> <304d>\n<2ab6> <304f>\n<2ab7> <3051>\n<2ab8> <3053>\n<2ab9> <3055>\n<2aba> <3057>\n<2abb> <3059>\n<2abc> <305b>\n<2abd> <305d>\n<2abe> <305f>\n<2abf> <3061>\n<2ac0> <3064>\n<2ac1> <3066>\n<2ac2> <3068>\n<2ac9> <3072>\n<2aca> <3075>\n<2acb> <3078>\n<2acc> <307b>\n<2ad2> <3084>\n<2ad3> <3086>\n<2adf> <30a2>\n<2ae0> <30a4>\n<2ae1> <30a6>\n<2ae2> <30a8>\n<2ae5> <30ad>\n<2ae6> <30af>\n<2ae7> <30b1>\n<2ae8> <30b3>\n<2ae9> <30b5>\n<2aea> <30b7>\n<2aeb> <30b9>\n<2aec> <30bb>\n<2aed> <30bd>\nendbfchar\n\n100 beginbfchar\n<2aee> <30bf>\n<2aef> <30c1>\n<2af0> <30c4>\n<2af1> <30c6>\n<2af2> <30c8>\n<2af9> <30d2>\n<2afa> <30d5>\n<2afb> <30d8>\n<2afc> <30db>\n<2b02> <30e4>\n<2b03> <30e6>\n<2b0f> <65e5>\n<2b10> <6708>\n<2b11> <706b>\n<2b12> <6c34>\n<2b13> <6728>\n<2b14> <91d1>\n<2b15> <571f>\n<2b16> <8ca0>\n<2b17> <52dd>\n<2b18> <554f>\n<2b19> <7b54>\n<2b1a> <4f8b>\n<2b1b> <20de>\n<2b1c> <25a1>\n<2b1d> <0030>\n<2b1e> <00300030>\n<2b1f> <0031>\n<2b20> <00300031>\n<2b21> <0032>\n<2b22> <00300032>\n<2b23> <0033>\n<2b24> <00300033>\n<2b25> <0034>\n<2b26> <00300034>\n<2b27> <0035>\n<2b28> <00300035>\n<2b29> <0036>\n<2b2a> <00300036>\n<2b2b> <0037>\n<2b2c> <00300037>\n<2b2d> <0038>\n<2b2e> <00300038>\n<2b2f> <0039>\n<2b30> <00300039>\n<2b31> <00310030>\n<2b32> <00310031>\n<2b33> <00310032>\n<2b34> <00310033>\n<2b35> <00310034>\n<2b36> <00310035>\n<2b37> <00310036>\n<2b38> <00310037>\n<2b39> <00310038>\n<2b3a> <00310039>\n<2b3b> <00320030>\n<2b3c> <00320031>\n<2b3d> <00320032>\n<2b3e> <00320033>\n<2b3f> <00320034>\n<2b40> <00320035>\n<2b41> <00320036>\n<2b42> <00320037>\n<2b43> <00320038>\n<2b44> <00320039>\n<2b45> <00330030>\n<2b46> <00330031>\n<2b47> <00330032>\n<2b48> <00330033>\n<2b49> <00330034>\n<2b4a> <00330035>\n<2b4b> <00330036>\n<2b4c> <00330037>\n<2b4d> <00330038>\n<2b4e> <00330039>\n<2b4f> <00340030>\n<2b50> <00340031>\n<2b51> <00340032>\n<2b52> <00340033>\n<2b53> <00340034>\n<2b54> <00340035>\n<2b55> <00340036>\n<2b56> <00340037>\n<2b57> <00340038>\n<2b58> <00340039>\n<2b59> <00350030>\n<2b5a> <00350031>\n<2b5b> <00350032>\n<2b5c> <00350033>\n<2b5d> <00350034>\n<2b5e> <00350035>\n<2b5f> <00350036>\n<2b60> <00350037>\n<2b61> <00350038>\n<2b62> <00350039>\n<2b63> <00360030>\n<2b64> <00360031>\n<2b65> <00360032>\n<2b66> <00360033>\n<2b67> <00360034>\nendbfchar\n\n100 beginbfchar\n<2b68> <00360035>\n<2b69> <00360036>\n<2b6a> <00360037>\n<2b6b> <00360038>\n<2b6c> <00360039>\n<2b6d> <00370030>\n<2b6e> <00370031>\n<2b6f> <00370032>\n<2b70> <00370033>\n<2b71> <00370034>\n<2b72> <00370035>\n<2b73> <00370036>\n<2b74> <00370037>\n<2b75> <00370038>\n<2b76> <00370039>\n<2b77> <00380030>\n<2b78> <00380031>\n<2b79> <00380032>\n<2b7a> <00380033>\n<2b7b> <00380034>\n<2b7c> <00380035>\n<2b7d> <00380036>\n<2b7e> <00380037>\n<2b7f> <00380038>\n<2b80> <00380039>\n<2b81> <00390030>\n<2b82> <00390031>\n<2b83> <00390032>\n<2b84> <00390033>\n<2b85> <00390034>\n<2b86> <00390035>\n<2b87> <00390036>\n<2b88> <00390037>\n<2b89> <00390038>\n<2b8a> <00390039>\n<2b8b> <003100300030>\n<2bc0> <3042>\n<2bc1> <3044>\n<2bc2> <3046>\n<2bc3> <3048>\n<2bc6> <304d>\n<2bc7> <304f>\n<2bc8> <3051>\n<2bc9> <3053>\n<2bca> <3055>\n<2bcb> <3057>\n<2bcc> <3059>\n<2bcd> <305b>\n<2bce> <305d>\n<2bcf> <305f>\n<2bd0> <3061>\n<2bd1> <3064>\n<2bd2> <3066>\n<2bd3> <3068>\n<2bda> <3072>\n<2bdb> <3075>\n<2bdc> <3078>\n<2bdd> <307b>\n<2be3> <3084>\n<2be4> <3086>\n<2bf0> <30a2>\n<2bf1> <30a4>\n<2bf2> <30a6>\n<2bf3> <30a8>\n<2bf6> <30ad>\n<2bf7> <30af>\n<2bf8> <30b1>\n<2bf9> <30b3>\n<2bfa> <30b5>\n<2bfb> <30b7>\n<2bfc> <30b9>\n<2bfd> <30bb>\n<2bfe> <30bd>\n<2bff> <30bf>\n<2c00> <30c1>\n<2c01> <30c4>\n<2c02> <30c6>\n<2c03> <30c8>\n<2c0a> <30d2>\n<2c0b> <30d5>\n<2c0c> <30d8>\n<2c0d> <30db>\n<2c13> <30e4>\n<2c14> <30e6>\n<2c20> <65e5>\n<2c21> <6708>\n<2c22> <706b>\n<2c23> <6c34>\n<2c24> <6728>\n<2c25> <91d1>\n<2c26> <571f>\n<2c27> <554f>\n<2c28> <7b54>\n<2c29> <4f8b>\n<2c2a> <25a0>\n<2c2b> <0030>\n<2c2c> <00300030>\n<2c2d> <0031>\n<2c2e> <00300031>\n<2c2f> <0032>\nendbfchar\n\n100 beginbfchar\n<2c30> <00300032>\n<2c31> <0033>\n<2c32> <00300033>\n<2c33> <0034>\n<2c34> <00300034>\n<2c35> <0035>\n<2c36> <00300035>\n<2c37> <0036>\n<2c38> <00300036>\n<2c39> <0037>\n<2c3a> <00300037>\n<2c3b> <0038>\n<2c3c> <00300038>\n<2c3d> <0039>\n<2c3e> <00300039>\n<2c3f> <00310030>\n<2c40> <00310031>\n<2c41> <00310032>\n<2c42> <00310033>\n<2c43> <00310034>\n<2c44> <00310035>\n<2c45> <00310036>\n<2c46> <00310037>\n<2c47> <00310038>\n<2c48> <00310039>\n<2c49> <00320030>\n<2c4a> <00320031>\n<2c4b> <00320032>\n<2c4c> <00320033>\n<2c4d> <00320034>\n<2c4e> <00320035>\n<2c4f> <00320036>\n<2c50> <00320037>\n<2c51> <00320038>\n<2c52> <00320039>\n<2c53> <00330030>\n<2c54> <00330031>\n<2c55> <00330032>\n<2c56> <00330033>\n<2c57> <00330034>\n<2c58> <00330035>\n<2c59> <00330036>\n<2c5a> <00330037>\n<2c5b> <00330038>\n<2c5c> <00330039>\n<2c5d> <00340030>\n<2c5e> <00340031>\n<2c5f> <00340032>\n<2c60> <00340033>\n<2c61> <00340034>\n<2c62> <00340035>\n<2c63> <00340036>\n<2c64> <00340037>\n<2c65> <00340038>\n<2c66> <00340039>\n<2c67> <00350030>\n<2c68> <00350031>\n<2c69> <00350032>\n<2c6a> <00350033>\n<2c6b> <00350034>\n<2c6c> <00350035>\n<2c6d> <00350036>\n<2c6e> <00350037>\n<2c6f> <00350038>\n<2c70> <00350039>\n<2c71> <00360030>\n<2c72> <00360031>\n<2c73> <00360032>\n<2c74> <00360033>\n<2c75> <00360034>\n<2c76> <00360035>\n<2c77> <00360036>\n<2c78> <00360037>\n<2c79> <00360038>\n<2c7a> <00360039>\n<2c7b> <00370030>\n<2c7c> <00370031>\n<2c7d> <00370032>\n<2c7e> <00370033>\n<2c7f> <00370034>\n<2c80> <00370035>\n<2c81> <00370036>\n<2c82> <00370037>\n<2c83> <00370038>\n<2c84> <00370039>\n<2c85> <00380030>\n<2c86> <00380031>\n<2c87> <00380032>\n<2c88> <00380033>\n<2c89> <00380034>\n<2c8a> <00380035>\n<2c8b> <00380036>\n<2c8c> <00380037>\n<2c8d> <00380038>\n<2c8e> <00380039>\n<2c8f> <00390030>\n<2c90> <00390031>\n<2c91> <00390032>\n<2c92> <00390033>\n<2c93> <00390034>\nendbfchar\n\n100 beginbfchar\n<2c94> <00390035>\n<2c95> <00390036>\n<2c96> <00390037>\n<2c97> <00390038>\n<2c98> <00390039>\n<2c99> <003100300030>\n<2cce> <3042>\n<2ccf> <3044>\n<2cd0> <3046>\n<2cd1> <3048>\n<2cd4> <304d>\n<2cd5> <304f>\n<2cd6> <3051>\n<2cd7> <3053>\n<2cd8> <3055>\n<2cd9> <3057>\n<2cda> <3059>\n<2cdb> <305b>\n<2cdc> <305d>\n<2cdd> <305f>\n<2cde> <3061>\n<2cdf> <3064>\n<2ce0> <3066>\n<2ce1> <3068>\n<2ce8> <3072>\n<2ce9> <3075>\n<2cea> <3078>\n<2ceb> <307b>\n<2cf1> <3084>\n<2cf2> <3086>\n<2cfe> <30a2>\n<2cff> <30a4>\n<2d00> <30a6>\n<2d01> <30a8>\n<2d04> <30ad>\n<2d05> <30af>\n<2d06> <30b1>\n<2d07> <30b3>\n<2d08> <30b5>\n<2d09> <30b7>\n<2d0a> <30b9>\n<2d0b> <30bb>\n<2d0c> <30bd>\n<2d0d> <30bf>\n<2d0e> <30c1>\n<2d0f> <30c4>\n<2d10> <30c6>\n<2d11> <30c8>\n<2d18> <30d2>\n<2d19> <30d5>\n<2d1a> <30d8>\n<2d1b> <30db>\n<2d21> <30e4>\n<2d22> <30e6>\n<2d2e> <65e5>\n<2d2f> <6708>\n<2d30> <706b>\n<2d31> <6c34>\n<2d32> <6728>\n<2d33> <91d1>\n<2d34> <571f>\n<2d35> <554f>\n<2d36> <7b54>\n<2d37> <4f8b>\n<2d38> <0030>\n<2d39> <00300030>\n<2d3a> <0031>\n<2d3b> <00300031>\n<2d3c> <0032>\n<2d3d> <00300032>\n<2d3e> <0033>\n<2d3f> <00300033>\n<2d40> <0034>\n<2d41> <00300034>\n<2d42> <0035>\n<2d43> <00300035>\n<2d44> <0036>\n<2d45> <00300036>\n<2d46> <0037>\n<2d47> <00300037>\n<2d48> <0038>\n<2d49> <00300038>\n<2d4a> <0039>\n<2d4b> <00300039>\n<2d4c> <00310030>\n<2d4d> <00310031>\n<2d4e> <00310032>\n<2d4f> <00310033>\n<2d50> <00310034>\n<2d51> <00310035>\n<2d52> <00310036>\n<2d53> <00310037>\n<2d54> <00310038>\n<2d55> <00310039>\n<2d56> <00320030>\n<2d57> <00320031>\n<2d58> <00320032>\n<2d59> <00320033>\n<2d5a> <00320034>\n<2d5b> <00320035>\nendbfchar\n\n100 beginbfchar\n<2d5c> <00320036>\n<2d5d> <00320037>\n<2d5e> <00320038>\n<2d5f> <00320039>\n<2d60> <00330030>\n<2d61> <00330031>\n<2d62> <00330032>\n<2d63> <00330033>\n<2d64> <00330034>\n<2d65> <00330035>\n<2d66> <00330036>\n<2d67> <00330037>\n<2d68> <00330038>\n<2d69> <00330039>\n<2d6a> <00340030>\n<2d6b> <00340031>\n<2d6c> <00340032>\n<2d6d> <00340033>\n<2d6e> <00340034>\n<2d6f> <00340035>\n<2d70> <00340036>\n<2d71> <00340037>\n<2d72> <00340038>\n<2d73> <00340039>\n<2d74> <00350030>\n<2d75> <00350031>\n<2d76> <00350032>\n<2d77> <00350033>\n<2d78> <00350034>\n<2d79> <00350035>\n<2d7a> <00350036>\n<2d7b> <00350037>\n<2d7c> <00350038>\n<2d7d> <00350039>\n<2d7e> <00360030>\n<2d7f> <00360031>\n<2d80> <00360032>\n<2d81> <00360033>\n<2d82> <00360034>\n<2d83> <00360035>\n<2d84> <00360036>\n<2d85> <00360037>\n<2d86> <00360038>\n<2d87> <00360039>\n<2d88> <00370030>\n<2d89> <00370031>\n<2d8a> <00370032>\n<2d8b> <00370033>\n<2d8c> <00370034>\n<2d8d> <00370035>\n<2d8e> <00370036>\n<2d8f> <00370037>\n<2d90> <00370038>\n<2d91> <00370039>\n<2d92> <00380030>\n<2d93> <00380031>\n<2d94> <00380032>\n<2d95> <00380033>\n<2d96> <00380034>\n<2d97> <00380035>\n<2d98> <00380036>\n<2d99> <00380037>\n<2d9a> <00380038>\n<2d9b> <00380039>\n<2d9c> <00390030>\n<2d9d> <00390031>\n<2d9e> <00390032>\n<2d9f> <00390033>\n<2da0> <00390034>\n<2da1> <00390035>\n<2da2> <00390036>\n<2da3> <00390037>\n<2da4> <00390038>\n<2da5> <00390039>\n<2da6> <003100300030>\n<2ddb> <3042>\n<2ddc> <3044>\n<2ddd> <3046>\n<2dde> <3048>\n<2de1> <304d>\n<2de2> <304f>\n<2de3> <3051>\n<2de4> <3053>\n<2de5> <3055>\n<2de6> <3057>\n<2de7> <3059>\n<2de8> <305b>\n<2de9> <305d>\n<2dea> <305f>\n<2deb> <3061>\n<2dec> <3064>\n<2ded> <3066>\n<2dee> <3068>\n<2df5> <3072>\n<2df6> <3075>\n<2df7> <3078>\n<2df8> <307b>\n<2dfe> <3084>\n<2dff> <3086>\n<2e0b> <30a2>\nendbfchar\n\n100 beginbfchar\n<2e0c> <30a4>\n<2e0d> <30a6>\n<2e0e> <30a8>\n<2e11> <30ad>\n<2e12> <30af>\n<2e13> <30b1>\n<2e14> <30b3>\n<2e15> <30b5>\n<2e16> <30b7>\n<2e17> <30b9>\n<2e18> <30bb>\n<2e19> <30bd>\n<2e1a> <30bf>\n<2e1b> <30c1>\n<2e1c> <30c4>\n<2e1d> <30c6>\n<2e1e> <30c8>\n<2e25> <30d2>\n<2e26> <30d5>\n<2e27> <30d8>\n<2e28> <30db>\n<2e2e> <30e4>\n<2e2f> <30e6>\n<2e3b> <65e5>\n<2e3c> <6708>\n<2e3d> <706b>\n<2e3e> <6c34>\n<2e3f> <6728>\n<2e40> <91d1>\n<2e41> <571f>\n<2e42> <554f>\n<2e43> <7b54>\n<2e44> <4f8b>\n<2e45> <25a0>\n<2e46> <33c2>\n<2e47> <33cd>\n<2e48> <2116>\n<2e49> <00500048>\n<2e4a> <33d8>\n<2e4b> <33da>\n<2e4e> <00560053>\n<2e4f> <2100>\n<2e50> <33c2>\n<2e51> <0063002f0063>\n<2e52> <33c4>\n<2e53> <2105>\n<2e54> <3397>\n<2e55> <3371>\n<2e56> <3398>\n<2e57> <2113>\n<2e58> <338d>\n<2e59> <339b>\n<2e5a> <3396>\n<2e5b> <006d002f006d>\n<2e5c> <006e002f006d>\n<2e5f> <30553058>\n<2e60> <30553058>\n<2e61> <30a230c8>\n<2e64> <3304>\n<2e65> <3306>\n<2e66> <30a630eb30b7>\n<2e67> <3308>\n<2e68> <30a830af30b5>\n<2e69> <3307>\n<2e6a> <330a>\n<2e6b> <30aa30f330b030b930c830ed30fc30e0>\n<2e6c> <3309>\n<2e6d> <30aa30f330c830ed>\n<2e6e> <330b>\n<2e6f> <30ab30c330d7>\n<2e70> <330c>\n<2e77> <30ad30ed30ea30c330c830eb>\n<2e78> <3317>\n<2e79> <30b030b930fc30e0>\n<2e7a> <3319>\n<2e7b> <30af30eb30b630fc30c9>\n<2e83> <3324>\n<2e84> <30c730ab>\n<2e85> <3325>\n<2e86> <30c630e9>\n<2e87> <30c930e930af30de>\n<2e8a> <30d030fc30c4>\n<2e8b> <332d>\n<2e8c> <30d130b930ab30eb>\n<2e8d> <30d030ec30eb>\n<2e91> <3332>\n<2e92> <30d530a130e930c9>\n<2e93> <30d530a730e030c8>\n<2e96> <333c>\n<2e97> <30d830af30c8>\n<2e98> <30d830af30c830d130b930ab30eb>\n<2e99> <30da30bb30bf>\n<2e9a> <3337>\n<2e9b> <30da30bf>\n<2e9c> <3338>\n<2e9d> <333a>\n<2e9e> <333d>\n<2e9f> <3341>\n<2ea7> <3348>\n<2eac> <30e630fc30ed>\nendbfchar\n\n100 beginbfchar\n<2ead> <30e930c9>\n<2eae> <3352>\n<2eaf> <3354>\n<2eb0> <30eb30af30b9>\n<2eb1> <30eb30d430a2>\n<2eb2> <3353>\n<2eb5> <30a230c8>\n<2eb8> <3304>\n<2eb9> <3306>\n<2eba> <30a630eb30b7>\n<2ebb> <3308>\n<2ebc> <30a830af30b5>\n<2ebd> <3307>\n<2ebe> <330a>\n<2ebf> <30aa30f330b030b930c830ed30fc30e0>\n<2ec0> <3309>\n<2ec1> <30aa30f330c830ed>\n<2ec2> <330b>\n<2ec3> <30ab30c330d7>\n<2ec4> <330c>\n<2ecb> <30ad30ed30ea30c430c830eb>\n<2ecc> <3317>\n<2ecd> <30b030b930fc30e0>\n<2ece> <3319>\n<2ecf> <30af30eb30b630cf30c9>\n<2ed7> <3324>\n<2ed8> <30c730ab>\n<2ed9> <3325>\n<2eda> <30c630e9>\n<2edb> <30c930e930af30de>\n<2ede> <30d030fc30c4>\n<2edf> <332d>\n<2ee0> <30d130b930ab30eb>\n<2ee1> <30d030ec30eb>\n<2ee5> <3332>\n<2ee6> <30d530a130e930c9>\n<2ee7> <30d530a730e030c8>\n<2eea> <333c>\n<2eeb> <30d830af30c8>\n<2eec> <30d830af30c830d130b930ab30eb>\n<2eed> <30da30bb30bf>\n<2eee> <3337>\n<2eef> <30da30bf>\n<2ef0> <3338>\n<2ef1> <333a>\n<2ef2> <333d>\n<2ef3> <3341>\n<2efb> <3348>\n<2f00> <30e630fc30ed>\n<2f01> <30e930c9>\n<2f02> <3352>\n<2f03> <3354>\n<2f04> <30eb30af30b9>\n<2f05> <30eb30d430a2>\n<2f06> <3353>\n<2f09> <337e>\n<2f0a> <337d>\n<2f0b> <337c>\n<2f0c> <337b>\n<2f0d> <533b76426cd54eba>\n<2f0e> <5b6668216cd54eba>\n<2f0f> <5171540c7d445408>\n<2f10> <5354540c7d445408>\n<2f11> <54088cc74f1a793e>\n<2f12> <5408540d4f1a793e>\n<2f13> <793e56e36cd54eba>\n<2f14> <5b9765596cd54eba>\n<2f15> <90f54fbf756a53f7>\n<2f16> <533b76426cd54eba>\n<2f17> <5b6668216cd54eba>\n<2f18> <5171540c7d445408>\n<2f19> <5354540c7d445408>\n<2f1a> <54088cc74f1a793e>\n<2f1b> <5408540d4f1a793e>\n<2f1c> <793e56e36cd54eba>\n<2f1d> <5b9765596cd54eba>\n<2f1e> <90f54fbf756a53f7>\n<2f1f> <002d>\n<2f20> <003d>\n<2f21> <2103>\n<2f22> <2640>\n<2f23> <2642>\n<2f24> <3013>\n<2f25> <3012>\n<2f36> <0027>\n<2f37> <0022>\n<2f38> <004a00410053>\n<2f39> <2135>\n<2f3a> <03d0>\n<2f3b> <220a>\n<2f3c> <210f>\n<2f3d> <00b5>\n<2f3e> <03d5>\n<2f3f> <03db>\n<2f40> <03d1>\n<2f41> <91ce7403>\n<2f44> <266c>\n<2f45> <ff1a>\n<2f46> <00a9>\n<2f47> <00a9>\nendbfchar\n\n100 beginbfchar\n<2f48> <00ae>\n<2f49> <00ae>\n<2f4a> <303b>\n<2f4b> <303b>\n<2f4f> <203c>\n<2f50> <2049>\n<2f51> <0021>\n<2f52> <203c>\n<2f53> <2049>\n<2f54> <244a>\n<2f55> <005c005c>\n<2f56> <2213>\n<2f57> <2260>\n<2f58> <2243>\n<2f6f> <239b>\n<2f72> <23a0>\n<2f73> <239d>\n<2f74> <239b>\n<2f75> <23a0>\n<2f76> <239e>\n<2f77> <23a1>\n<2f7a> <23a6>\n<2f7b> <23a3>\n<2f7c> <23a1>\n<2f7d> <23a6>\n<2f7e> <23a4>\n<2f7f> <23a1>\n<2f82> <23a6>\n<2f83> <23a3>\n<2f84> <23a1>\n<2f85> <23a6>\n<2f86> <23a4>\n<2f87> <ff5c>\n<2f88> <2015>\n<2f8f> <2702>\n<2f90> <2702>\n<2f91> <2702>\n<2f92> <2702>\n<2f93> <303d>\n<2f94> <3012>\n<2f95> <309f>\n<2f96> <534d>\n<2f97> <2207>\n<2f98> <2205>\n<2f99> <22a0>\n<2f9a> <2296>\n<2f9b> <2298>\n<2f9c> <2295>\n<2f9d> <2297>\n<2f9e> <229e>\n<2f9f> <2295>\n<2fa0> <26a0>\n<2fa1> <25b3>\n<2fa2> <25c0>\n<2fa3> <25b6>\n<2fa4> <21e6>\n<2fa5> <21e8>\n<2fa6> <21e7>\n<2fa7> <21e9>\n<2fa8> <21d0>\n<2fa9> <2194>\n<2fae> <21cc>\n<2faf> <21cb>\n<2fb2> <2190>\n<2fb3> <2192>\n<2fb4> <2191>\n<2fb8> <2504>\n<2fb9> <2506>\n<2fba> <3030>\n<2fbb> <2307>\n<2fbc> <3030>\n<2fbd> <2307>\n<2fbe> <3030>\n<2fbf> <2307>\n<2fc0> <3030>\n<2fc1> <2307>\n<2fc2> <3030>\n<2fc3> <2307>\n<2fc4> <2740>\n<2fc5> <273f>\n<2fc6> <25a1>\n<2fc9> <25a1>\n<2fca> <25a1>\n<2fcb> <25a1>\n<2fcc> <25a1>\n<2fcd> <25ab>\n<2fce> <25a0>\n<2fcf> <25aa>\n<2fd0> <271a>\n<2fd1> <271a>\n<2fd2> <25c7>\n<2fd5> <25c7>\n<2fd6> <25c7>\n<2fd7> <25c7>\n<2fd8> <25c7>\n<2fd9> <25c6>\n<2fda> <25c6>\n<2fdb> <25ce>\n<2fdc> <25c9>\n<2fdd> <25cb>\nendbfchar\n\n100 beginbfchar\n<2fde> <25e6>\n<2fdf> <25cf>\n<2fe0> <2022>\n<2fe1> <2756>\n<2fe2> <2756>\n<2fe3> <2756>\n<2fe4> <2756>\n<2fed> <3053>\n<2fee> <3053>\n<2fef> <30b3>\n<2ff0> <30b3>\n<2ffd> <3095>\n<3004> <3096>\n<304c> <30fc>\n<3057> <30f5>\n<305e> <30f6>\n<30b4> <3095>\n<30bb> <3096>\n<3100> <3094>\n<3103> <30fc>\n<310e> <30f5>\n<3115> <30f6>\n<3161> <30fb>\n<3162> <ff0a>\n<3163> <203b>\n<3164> <25cb>\n<3165> <25ce>\n<3166> <25c9>\n<3167> <25b3>\n<3168> <25b2>\n<318a> <3095>\n<3191> <3096>\n<31d5> <3041>\n<31d6> <3043>\n<31d7> <3045>\n<31d8> <3047>\n<31d9> <3049>\n<31da> <304b>\n<31db> <3051>\n<31dc> <3063>\n<31dd> <3083>\n<31de> <3085>\n<31df> <3087>\n<31e0> <308e>\n<31ec> <30f5>\n<31f3> <30f6>\n<3237> <30a1>\n<3238> <30a3>\n<3239> <30a5>\n<323a> <30a7>\n<323b> <30a9>\n<323e> <30c3>\n<323f> <30e3>\n<3240> <30e5>\n<3241> <30e7>\n<3242> <30ee>\n<3243> <30fc>\n<3244> <30fc>\n<3245> <6ce8>\n<3246> <20ac>\n<3247> <2126>\n<324a> <fb00>\n<324d> <0101>\n<324e> <012b>\n<324f> <016b>\n<3250> <0113>\n<3251> <014d>\n<3252> <0100>\n<3253> <012a>\n<3254> <016a>\n<3255> <0112>\n<3256> <014c>\n<325d> <2070>\n<326e> <01cd>\n<326f> <011a>\n<3270> <0045030a>\n<3271> <1ebc>\n<3272> <01cf>\n<3273> <0049030a>\n<3274> <0128>\n<3275> <01d1>\n<3276> <004f030a>\n<3277> <01d3>\n<3278> <016e>\n<3279> <0168>\n<327a> <01ce>\n<327b> <011b>\n<327c> <0065030a>\n<327d> <1ebd>\n<327e> <01d0>\n<327f> <0131030a>\n<3280> <0129>\n<3281> <01d2>\n<3282> <006f030a>\n<3283> <01d4>\n<3284> <016f>\n<3285> <0169>\n<3286> <0251>\n<3287> <0251>\n<3288> <0251>\nendbfchar\n\n100 beginbfchar\n<3289> <01fd>\n<328a> <00e6>\n<328b> <0254>\n<328c> <0254>\n<328d> <0254>\n<328e> <0259>\n<328f> <0259>\n<3292> <025a>\n<3295> <025b>\n<3296> <025b>\n<3297> <006a>\n<3298> <014b>\n<3299> <0275>\n<329a> <028c>\n<329b> <028c>\n<329c> <028c>\n<329d> <0292>\n<329e> <0283>\n<329f> <02d0>\n<32dc> <00a5>\n<32fc> <00a6>\n<32fd> <007d>\n<32fe> <0303>\n<32ff> <2019>\n<3300> <005c>\n<3301> <2018>\n<3302> <007c>\n<3303> <007e>\n<3307> <2044>\n<3308> <0192>\n<3309> <00a7>\n<330a> <00a4>\n<330b> <201c>\n<330c> <00ab>\n<3311> <2012>\n<3314> <00b7>\n<3315> <00b6>\n<3316> <2022>\n<3317> <201a>\n<3318> <201e>\n<3319> <201d>\n<331a> <00bb>\n<331b> <2026>\n<331c> <2030>\n<331d> <00bf>\n<3320> <00af>\n<3324> <030a>\n<3325> <00b8>\n<3326> <030b>\n<3327> <0328>\n<3328> <030c>\n<3329> <0336>\n<332a> <00c6>\n<332b> <00aa>\n<332c> <0141>\n<332d> <00d8>\n<332e> <0152>\n<332f> <00ba>\n<3330> <00e6>\n<3331> <0131>\n<3332> <0142>\n<3333> <00f8>\n<3334> <0153>\n<3335> <00df>\n<3336> <002d>\n<3337> <00a9>\n<3338> <00ac>\n<3339> <00ae>\n<333e> <00b5>\n<333f> <00b9>\n<337e> <0160>\n<337f> <0178>\n<3380> <017d>\n<3381> <0305>\n<3382> <0161>\n<3383> <2122>\n<3384> <017e>\n<3385> <0030>\n<3386> <20ac>\n<3387> <2126>\n<338a> <fb00>\n<338d> <0101>\n<338e> <012b>\n<338f> <016b>\n<3390> <0113>\n<3391> <014d>\n<3392> <0100>\n<3393> <012a>\n<3394> <016a>\n<3395> <0112>\n<3396> <014c>\n<339d> <2070>\n<33ae> <01cd>\n<33af> <011a>\n<33b0> <0045030a>\n<33b1> <1ebc>\n<33b2> <01cf>\n<33b3> <0049030a>\n<33b4> <0128>\n<33b5> <01d1>\nendbfchar\n\n100 beginbfchar\n<33b6> <004f030a>\n<33b7> <01d3>\n<33b8> <016e>\n<33b9> <0168>\n<33ba> <01ce>\n<33bb> <011b>\n<33bc> <0065030a>\n<33bd> <1ebd>\n<33be> <01d0>\n<33bf> <0131030a>\n<33c0> <0129>\n<33c1> <01d2>\n<33c2> <006f030a>\n<33c3> <01d4>\n<33c4> <016f>\n<33c5> <0169>\n<33d0> <0336>\n<33d1> <002d>\n<33d2> <003d>\n<33d3> <002c>\n<33e4> <0336>\n<33e5> <002d>\n<33e6> <003d>\n<33e7> <002c>\n<33ee> <00b7>\n<33ef> <002d>\n<33f0> <003d>\n<33f1> <2103>\n<33f2> <2640>\n<33f3> <2642>\n<33f4> <3013>\n<33f5> <3012>\n<3406> <0027>\n<3407> <0022>\n<3408> <fa67>\n<3409> <fa62>\n<340a> <7de3>\n<340b> <9ec3>\n<340c> <6eab>\n<340d> <fa52>\n<340e> <fa3d>\n<340f> <fa45>\n<3410> <fa3e>\n<3411> <69ea>\n<3412> <6e34>\n<3413> <fa60>\n<3414> <fa47>\n<3415> <fa38>\n<3416> <fa42>\n<3417> <fa4e>\n<3418> <865b>\n<3419> <fa69>\n<341a> <fa34>\n<341b> <fa63>\n<341c> <63ed>\n<341d> <64ca>\n<341e> <784f>\n<341f> <fa54>\n<3420> <f970>\n<3421> <fa4d>\n<3422> <fa61>\n<3423> <fa48>\n<3424> <fa4c>\n<3427> <fa51>\n<3428> <fa43>\n<3429> <fa5a>\n<342a> <6d89>\n<342b> <72c0>\n<342c> <614e>\n<342d> <d87edd45>\n<342e> <fa56>\n<342f> <fa50>\n<3430> <fa31>\n<3431> <fa3b>\n<3432> <5de2>\n<3433> <fa3f>\n<3434> <fa65>\n<3435> <537d>\n<3436> <fa37>\n<3437> <fa5f>\n<3438> <5fb5>\n<3439> <fa40>\n<343a> <93ae>\n<343b> <fa53>\n<343c> <9b2d>\n<343d> <fa55>\n<343e> <fa68>\n<343f> <fa44>\n<3440> <fa59>\n<3441> <665a>\n<3442> <fa35>\n<3443> <fa4b>\n<3444> <fa64>\n<3445> <fa41>\n<3446> <fa30>\n<3447> <4f75>\n<3448> <fa39>\n<3449> <fa33>\n<344a> <6b65>\n<344b> <fa3a>\nendbfchar\n\n100 beginbfchar\n<344c> <6bcf>\n<344d> <fa32>\n<344e> <623e>\n<344f> <fa4f>\n<3450> <f91d>\n<3451> <f9dc>\n<3452> <f936>\n<3453> <6dda>\n<3454> <f9d0>\n<3455> <66c6>\n<3456> <6b77>\n<3457> <fa57>\n<3458> <934a>\n<3459> <5eca>\n<345a> <9304>\n<345b> <6982>\n<345c> <51b4>\n<345d> <634c>\n<345e> <86db>\n<345f> <9089>\n<3460> <9022>\n<3461> <5049>\n<3462> <7def>\n<3463> <9055>\n<3464> <53a9>\n<3465> <990c>\n<3466> <885b>\n<3467> <5ef6>\n<3468> <6cbf>\n<3469> <925b>\n<346a> <7fc1>\n<346b> <82bd>\n<346c> <96c5>\n<346d> <5bb3>\n<346e> <6168>\n<346f> <6982>\n<3470> <6bbb>\n<3471> <6562>\n<3472> <8cab>\n<3473> <5dcc>\n<3474> <9811>\n<3475> <5e30>\n<3476> <8ecc>\n<3477> <7aae>\n<3478> <5747>\n<3479> <5091>\n<347a> <7a74>\n<347b> <5065>\n<347c> <5efa>\n<347d> <9237>\n<347e> <6a8e>\n<347f> <4ea4>\n<3480> <516c>\n<3481> <66f4>\n<3482> <6821>\n<3483> <786c>\n<3484> <7d5e>\n<3485> <8003>\n<3486> <8cfc>\n<3487> <964d>\n<3488> <62f7>\n<3489> <7f6a>\n<348a> <4f7f>\n<348b> <53f2>\n<348c> <59c9>\n<348d> <8b1d>\n<348e> <90aa>\n<348f> <53ce>\n<3490> <8f2f>\n<3491> <67d4>\n<3492> <77ac>\n<3493> <821c>\n<3494> <696f>\n<3495> <677e>\n<3496> <8a1f>\n<3497> <4e08>\n<3498> <57f4>\n<3499> <690d>\n<349a> <8077>\n<349b> <89aa>\n<349c> <9042>\n<349d> <636e>\n<349e> <6442>\n<349f> <8239>\n<34a0> <7dcf>\n<34a1> <8061>\n<34a2> <50cf>\n<34a3> <8a95>\n<34a4> <6065>\n<34a5> <5146>\n<34a6> <773a>\n<34a7> <8074>\n<34a8> <8df3>\n<34a9> <5ead>\n<34aa> <5ef7>\n<34ab> <8247>\n<34ac> <6843>\n<34ad> <9003>\n<34ae> <6d3e>\n<34af> <6392>\nendbfchar\n\n100 beginbfchar\n<34b0> <8f29>\n<34b1> <73ed>\n<34b2> <9812>\n<34b3> <60b2>\n<34b4> <6249>\n<34b5> <6590>\n<34b6> <7dcb>\n<34b7> <8ab9>\n<34b8> <8ca7>\n<34b9> <7236>\n<34ba> <847a>\n<34bb> <5206>\n<34bc> <5674>\n<34bd> <61a4>\n<34be> <7c89>\n<34bf> <7d1b>\n<34c0> <96f0>\n<34c1> <853d>\n<34c2> <4fbf>\n<34c3> <6367>\n<34c4> <76c6>\n<34c5> <685d>\n<34c6> <8108>\n<34c7> <8036>\n<34c8> <7ffc>\n<34c9> <540f>\n<34ca> <96a3>\n<34cb> <9e9f>\n<34cc> <9e97>\n<34cd> <806f>\n<34ce> <807e>\n<34cf> <6e7e>\n<34d0> <5085>\n<34d1> <5193>\n<34d2> <51db>\n<34d3> <d842dd0e>\n<34d4> <5340>\n<34d5> <96d9>\n<34d6> <55a9>\n<34d7> <56c1>\n<34d8> <570d>\n<34d9> <58ab>\n<34da> <59da>\n<34db> <5a36>\n<34dc> <5abe>\n<34dd> <5d4e>\n<34de> <5d87>\n<34df> <5dc9>\n<34e0> <5dd3>\n<34e1> <5f2d>\n<34e2> <5f98>\n<34e3> <60d8>\n<34e4> <613d>\n<34e5> <61fe>\n<34e6> <6268>\n<34e7> <62cf>\n<34e8> <651d>\n<34e9> <640f>\n<34ea> <64f2>\n<34eb> <655d>\n<34ec> <665f>\n<34ed> <67a9>\n<34ee> <67e7>\n<34ef> <696b>\n<34f0> <6930>\n<34f1> <69a7>\n<34f2> <6a44>\n<34f3> <6a90>\n<34f4> <6c08>\n<34f5> <6c13>\n<34f6> <6e23>\n<34f7> <6f11>\n<34f8> <6efe>\n<34f9> <6f3e>\n<34fa> <71ff>\n<34fb> <73e5>\n<34fc> <7432>\n<34fd> <745f>\n<34fe> <74e0>\n<34ff> <750c>\n<3500> <7672>\n<3501> <792a>\n<3502> <78d4>\n<3503> <79ba>\n<3504> <7a19>\n<3505> <7a95>\n<3506> <7cf2>\n<3507> <7d73>\n<3508> <7ddd>\n<3509> <7e35>\n<350a> <7fae>\n<350b> <7fe1>\n<350c> <805a>\n<350d> <805f>\n<350e> <8073>\n<350f> <8070>\n<3510> <8076>\n<3511> <8153>\n<3512> <818a>\n<3513> <81b5>\nendbfchar\n\n100 beginbfchar\n<3514> <81cd>\n<3515> <83f2>\n<3516> <8555>\n<3517> <85d5>\n<3518> <871a>\n<3519> <8836>\n<351a> <889e>\n<351b> <88d8>\n<351c> <88f4>\n<351d> <892b>\n<351e> <893b>\n<351f> <896a>\n<3520> <896f>\n<3521> <8a1d>\n<3522> <8d05>\n<3523> <8d0f>\n<3524> <9f4e>\n<3525> <8e91>\n<3526> <8ea1>\n<3527> <9052>\n<3528> <900e>\n<3529> <9130>\n<352a> <9156>\n<352b> <9158>\n<352c> <9165>\n<352d> <9173>\n<352e> <9172>\n<352f> <91a2>\n<3530> <91af>\n<3531> <91aa>\n<3532> <91b4>\n<3533> <91ba>\n<3534> <9477>\n<3535> <9698>\n<3536> <973d>\n<3537> <9760>\n<3538> <9771>\n<3539> <980c>\n<353a> <9873>\n<353b> <98c3>\n<353c> <9a45>\n<353d> <9b4d>\n<353e> <9b58>\n<353f> <9bc6>\n<3540> <9be1>\n<3541> <9bf1>\n<3542> <9d48>\n<3543> <9dcf>\n<3544> <9f08>\n<3545> <6271>\n<3546> <6697>\n<3547> <610f>\n<3548> <8863>\n<3549> <9055>\n<354a> <907a>\n<354b> <78ef>\n<354c> <8c9f>\n<354d> <2ed7>\n<354e> <2ebd>\n<354f> <5ed0>\n<3550> <74dc>\n<3551> <904b>\n<3552> <990c>\n<3553> <885e>\n<3554> <92b3>\n<3555> <95b1>\n<3556> <5ef6>\n<3557> <63f4>\n<3558> <d87edcfc>\n<3559> <7159>\n<355a> <9060>\n<355b> <925b>\n<355c> <65bc>\n<355d> <5f80>\n<355e> <7fc1>\n<355f> <5378>\n<3560> <97f3>\n<3561> <5316>\n<3562> <82b1>\n<3563> <83d3>\n<3564> <8ca8>\n<3565> <904e>\n<3566> <d87edd95>\n<3567> <96c5>\n<3568> <9913>\n<3569> <5efb>\n<356a> <7070>\n<356b> <5bb3>\n<356c> <6168>\n<356d> <6168>\n<356e> <6168>\n<356f> <d87edcea>\n<3570> <6982>\n<3571> <676e>\n<3572> <2ec6>\n<3573> <9694>\n<3574> <d87edc22>\n<3575> <8f44>\n<3576> <938c>\n<3577> <82c5>\nendbfchar\n\n100 beginbfchar\n<3578> <5bd2>\n<3579> <74b0>\n<357a> <7de9>\n<357b> <7f36>\n<357c> <9084>\n<357d> <9592>\n<357e> <97d3>\n<357f> <8218>\n<3580> <5371>\n<3581> <3402>\n<3582> <3402>\n<3583> <3402>\n<3584> <5e7e>\n<3585> <65e3>\n<3586> <671f>\n<3587> <6a5f>\n<3588> <8d77>\n<3589> <98e2>\n<358a> <d842dfb7>\n<358b> <55ab>\n<358c> <8650>\n<358d> <9006>\n<358e> <53ca>\n<358f> <5438>\n<3590> <6025>\n<3591> <7d1a>\n<3592> <5de8>\n<3593> <62d2>\n<3594> <8ddd>\n<3595> <d867dd4b>\n<3596> <d867dd4b>\n<3597> <d87edc33>\n<3598> <5f3a>\n<3599> <6050>\n<359a> <69c1>\n<359b> <d84dde3a>\n<359c> <d84dde3a>\n<359d> <90f7>\n<359e> <97ff>\n<359f> <9957>\n<35a0> <6681>\n<35a1> <2ea9>\n<35a2> <8fd1>\n<35a3> <4ff1>\n<35a4> <77e9>\n<35a5> <5177>\n<35a6> <865e>\n<35a7> <7a7a>\n<35a8> <9047>\n<35a9> <6adb>\n<35aa> <5553>\n<35ab> <f909>\n<35ac> <6075>\n<35ad> <6167>\n<35ae> <8fce>\n<35af> <5091>\n<35b0> <6f54>\n<35b1> <7a74>\n<35b2> <6708>\n<35b3> <2ebc>\n<35b4> <517c>\n<35b5> <5238>\n<35b6> <d87edcac>\n<35b7> <6743>\n<35b8> <80a9>\n<35b9> <8b19>\n<35ba> <9063>\n<35bb> <d842de64>\n<35bc> <8a01>\n<35bd> <6236>\n<35be> <96c7>\n<35bf> <9867>\n<35c0> <5433>\n<35c1> <5a1b>\n<35c2> <8aa4>\n<35c3> <5de5>\n<35c4> <614c>\n<35c5> <6285>\n<35c6> <63a7>\n<35c7> <69cb>\n<35c8> <d87edd03>\n<35c9> <6e2f>\n<35ca> <8015>\n<35cb> <8154>\n<35cc> <8352>\n<35cd> <8b1b>\n<35ce> <8cfc>\n<35cf> <543f>\n<35d0> <9177>\n<35d1> <8170>\n<35d2> <7511>\n<35d3> <8fbc>\n<35d4> <4eca>\n<35d5> <9396>\n<35d6> <5ea7>\n<35d7> <5f69>\n<35d8> <63a1>\n<35d9> <6b72>\n<35da> <83dc>\n<35db> <51b4>\nendbfchar\n\n100 beginbfchar\n<35dc> <54b2>\n<35dd> <524a>\n<35de> <7522>\n<35df> <4b38>\n<35e0> <59ff>\n<35e1> <59ff>\n<35e2> <5dff>\n<35e3> <8aee>\n<35e4> <8aee>\n<35e5> <8cc7>\n<35e6> <8cc7>\n<35e7> <6b21>\n<35e8> <6b21>\n<35e9> <d87edd0b>\n<35ea> <73ba>\n<35eb> <d842df9f>\n<35ec> <6368>\n<35ed> <659c>\n<35ee> <90aa>\n<35ef> <d87edc28>\n<35f0> <7235>\n<35f1> <d87edd21>\n<35f2> <914c>\n<35f3> <5f31>\n<35f4> <4e3b>\n<35f5> <53d7>\n<35f6> <6388>\n<35f7> <d87edc3f>\n<35f8> <7d42>\n<35f9> <7fd2>\n<35fa> <8846>\n<35fb> <9031>\n<35fc> <4f4f>\n<35fd> <8853>\n<35fe> <8ff0>\n<35ff> <5de1>\n<3600> <9075>\n<3601> <9075>\n<3602> <6240>\n<3603> <66f8>\n<3604> <5973>\n<3605> <52dd>\n<3606> <5546>\n<3607> <5bb5>\n<3608> <d87edc73>\n<360b> <5c19>\n<360c> <6d88>\n<360d> <785d>\n<360e> <8096>\n<360f> <d840dc0b>\n<3610> <5b82>\n<3611> <d87edc52>\n<3612> <60c5>\n<3613> <57f4>\n<3614> <98fe>\n<3615> <690d>\n<3616> <6b96>\n<3617> <2edd>\n<3618> <98e0>\n<3619> <2ede>\n<361a> <378d>\n<361b> <4fb5>\n<361c> <2e97>\n<361d> <6d78>\n<361e> <d87edd47>\n<361f> <9032>\n<3620> <4ebb>\n<3621> <d840dda2>\n<3622> <5203>\n<3623> <5c0b>\n<3624> <8a0a>\n<3625> <8a0a>\n<3626> <8fc5>\n<3627> <8870>\n<3628> <9042>\n<3629> <351f>\n<362a> <52e2>\n<362b> <d87edcb2>\n<362c> <76db>\n<362d> <8056>\n<362e> <8980>\n<362f> <8aa0>\n<3630> <8acb>\n<3631> <975c>\n<3632> <975c>\n<3633> <7a05>\n<3634> <8106>\n<3635> <96bb>\n<3636> <7c4d>\n<3637> <7bc0>\n<3638> <8aaa>\n<3639> <96ea>\n<363a> <7d55>\n<363b> <6247>\n<363c> <6f98>\n<363d> <7fa1>\n<363e> <8239>\n<363f> <9078>\n<3640> <9077>\n<3641> <524d>\nendbfchar\n\n100 beginbfchar\n<3642> <5168>\n<3643> <6383>\n<3644> <63f7>\n<3645> <7626>\n<3646> <8d70>\n<3647> <9001>\n<3648> <906d>\n<3649> <9020>\n<364a> <2eca>\n<364b> <901f>\n<364c> <8cca>\n<364d> <5c0a>\n<364e> <5c0a>\n<364f> <59a5>\n<3650> <d84fdcfe>\n<3651> <9000>\n<3652> <902e>\n<3653> <968a>\n<3654> <9bdb>\n<3655> <5927>\n<3656> <3427>\n<3657> <7027>\n<3658> <9039>\n<3659> <812b>\n<365a> <4e39>\n<365b> <6b4e>\n<365c> <d87edd1a>\n<365d> <8a95>\n<365e> <6696>\n<365f> <5024>\n<3660> <7f6e>\n<3661> <7bc9>\n<3662> <2eae>\n<3663> <7b51>\n<3664> <9010>\n<3665> <67f1>\n<3666> <6ce8>\n<3667> <99d0>\n<3668> <d87edc9a>\n<3669> <5fb5>\n<366a> <61f2>\n<366b> <671d>\n<366c> <d87edd0f>\n<366d> <8abf>\n<366e> <76f4>\n<366f> <6715>\n<3670> <6715>\n<3671> <589c>\n<3672> <8ffd>\n<3673> <901a>\n<3674> <576a>\n<3675> <91e3>\n<3676> <5448>\n<3677> <5e1d>\n<3678> <7a0b>\n<3679> <7684>\n<367a> <9069>\n<367b> <8fed>\n<367c> <6dfb>\n<367d> <514e>\n<367e> <9014>\n<367f> <783a>\n<3680> <5721>\n<3681> <d844de3d>\n<3682> <d87edc1a>\n<3683> <5510>\n<3684> <fa03>\n<3685> <85e4>\n<3686> <8b04>\n<3687> <9003>\n<3688> <900f>\n<3689> <9a30>\n<368a> <5c0e>\n<368b> <9053>\n<368c> <541e>\n<368d> <3b88>\n<368e> <5167>\n<368f> <8089>\n<3690> <4e73>\n<3691> <5fcd>\n<3692> <8a8d>\n<3693> <f95f>\n<3694> <7d0d>\n<3695> <8987>\n<3696> <6d3e>\n<3697> <80ba>\n<3698> <535a>\n<3699> <8584>\n<369a> <8feb>\n<369b> <7e1b>\n<369c> <8087>\n<369d> <4e37>\n<369e> <6f51>\n<369f> <91b1>\n<36a0> <4f34>\n<36a1> <5224>\n<36a2> <534a>\n<36a3> <5e06>\n<36a4> <7554>\n<36a5> <6669>\nendbfchar\n\n100 beginbfchar\n<36a6> <8543>\n<36a7> <907f>\n<36a8> <5fae>\n<36a9> <9f3b>\n<36aa> <5339>\n<36ab> <2eaa>\n<36ac> <5f65>\n<36ad> <59ec>\n<36ae> <d87edc62>\n<36af> <8a55>\n<36b0> <5e99>\n<36b1> <75c5>\n<36b2> <5a66>\n<36b3> <6577>\n<36b4> <6d6e>\n<36b5> <8ca0>\n<36b6> <8ca0>\n<36b7> <670d>\n<36b8> <8986>\n<36b9> <4e19>\n<36ba> <5e63>\n<36bb> <5e73>\n<36bc> <5f0a>\n<36bd> <8511>\n<36be> <504f>\n<36bf> <7de8>\n<36c0> <8fd4>\n<36c1> <904d>\n<36c2> <7c3f>\n<36c3> <5305>\n<36c4> <5d29>\n<36c5> <62b1>\n<36c6> <670b>\n<36c7> <7832>\n<36c8> <7e2b>\n<36c9> <80de>\n<36ca> <840c>\n<36cb> <90a6>\n<36cc> <90a6>\n<36cd> <98fd>\n<36ce> <9d6c>\n<36cf> <4ea1>\n<36d0> <5e3d>\n<36d3> <623f>\n<36d4> <671b>\n<36d5> <671b>\n<36d6> <5192>\n<36d7> <6469>\n<36d8> <7ffb>\n<36d9> <51e1>\n<36da> <78e8>\n<36db> <9b54>\n<36dc> <9ebb>\n<36dd> <69d9>\n<36de> <685d>\n<36df> <3468>\n<36e0> <9fb4>\n<36e1> <7e6d>\n<36e2> <9ebf>\n<36e3> <8108>\n<36e4> <660e>\n<36e5> <76df>\n<36e6> <8ff7>\n<36e7> <5984>\n<36e8> <52d0>\n<36e9> <76f2>\n<36ea> <8017>\n<36eb> <623b>\n<36ec> <7d0b>\n<36ed> <9580>\n<36ee> <7d04>\n<36ef> <8e8d>\n<36f0> <687a>\n<36f1> <687a>\n<36f2> <6801>\n<36f3> <6109>\n<36f4> <d87eddd0>\n<36f5> <d87edddf>\n<36f6> <52c7>\n<36f7> <6709>\n<36f8> <7336>\n<36fb> <d855de7f>\n<36fc> <904a>\n<36fd> <66dc>\n<36fe> <2eb7>\n<36ff> <8981>\n<3700> <990a>\n<3701> <7fcc>\n<3702> <7ffc>\n<3703> <8eb6>\n<3704> <f91f>\n<3705> <7387>\n<3706> <9f8d>\n<3707> <9f8d>\n<3708> <f983>\n<3709> <6881>\n<370a> <71d0>\n<370b> <96a3>\n<370c> <9c57>\n<370d> <9e9f>\nendbfchar\n\n100 beginbfchar\n<370e> <7c7b>\n<370f> <f9a2>\n<3710> <6190>\n<3711> <f99a>\n<3712> <6717>\n<3713> <8002>\n<3714> <d859deb0>\n<3715> <50ca>\n<3716> <511a>\n<3717> <5154>\n<3718> <5195>\n<3719> <2e87>\n<371a> <528d>\n<371b> <52d7>\n<371c> <d840dc8a>\n<371d> <d87edc2c>\n<371e> <353e>\n<371f> <53df>\n<3720> <66fc>\n<3721> <5533>\n<3722> <55e4>\n<3723> <5455>\n<3724> <56c0>\n<3725> <5939>\n<3726> <5a1c>\n<3727> <5ac2>\n<3728> <5b76>\n<3729> <d87edc6d>\n<372a> <5c14>\n<372b> <37e2>\n<372c> <5ce6>\n<372d> <5e54>\n<372e> <4e48>\n<372f> <5ee3>\n<3730> <6097>\n<3731> <d87edcb6>\n<3732> <62cc>\n<3733> <641c>\n<3734> <63c6>\n<3735> <6428>\n<3736> <d85add99>\n<3737> <631b>\n<3738> <665f>\n<3739> <665f>\n<373a> <6663>\n<373b> <66f5>\n<373c> <d87edcdb>\n<373d> <689d>\n<373e> <688d>\n<373f> <69f6>\n<3740> <6986>\n<3741> <5be8>\n<3742> <5be8>\n<3743> <69bb>\n<3744> <6bcc>\n<3745> <6f11>\n<3746> <6e17>\n<3747> <6f98>\n<3748> <6caa>\n<3749> <6caa>\n<374a> <701b>\n<374b> <7162>\n<374c> <723b>\n<374d> <4e2c>\n<374e> <731c>\n<374f> <74ca>\n<3750> <74ef>\n<3751> <7575>\n<3752> <75ec>\n<3753> <764e>\n<3754> <3fb1>\n<3755> <776a>\n<3756> <77a9>\n<3757> <7940>\n<3758> <7953>\n<3759> <7953>\n<375a> <9f4b>\n<375b> <79ae>\n<375c> <9083>\n<375d> <7b53>\n<375e> <7c14>\n<375f> <7c14>\n<3760> <4264>\n<3761> <7c50>\n<3762> <7c58>\n<3763> <7d46>\n<3764> <d87edd6c>\n<3765> <7e22>\n<3766> <7e22>\n<3767> <7e48>\n<3768> <7e35>\n<3769> <7e43>\n<376a> <7e8c>\n<376d> <7f51>\n<376e> <d858de70>\n<3771> <7fe9>\n<3772> <8141>\n<3773> <4453>\n<3774> <8258>\n<3775> <8279>\nendbfchar\n\n100 beginbfchar\n<3778> <82e3>\n<3779> <5179>\n<377a> <835a>\n<377b> <8420>\n<377c> <83bd>\n<377d> <84f4>\n<377e> <4525>\n<377f> <8587>\n<3780> <85f4>\n<3781> <d840dcb0>\n<3782> <8737>\n<3783> <873b>\n<3784> <8805>\n<3785> <87bd>\n<3786> <867d>\n<3787> <8836>\n<3788> <342e>\n<3789> <88c6>\n<378a> <89bd>\n<378b> <8adb>\n<378c> <8b3e>\n<378d> <8b5a>\n<378e> <8d73>\n<378f> <8d99>\n<3790> <47e6>\n<3791> <8e34>\n<3792> <8e4a>\n<3793> <8fef>\n<3794> <9087>\n<3795> <8ffa>\n<3796> <901e>\n<3797> <9035>\n<3798> <9050>\n<3799> <8fc8>\n<379a> <9081>\n<379b> <908a>\n<379c> <908a>\n<379d> <908a>\n<379e> <908a>\n<379f> <908a>\n<37a0> <908a>\n<37a1> <9089>\n<37a2> <9089>\n<37a3> <9089>\n<37a4> <9089>\n<37a5> <9089>\n<37a6> <9089>\n<37a7> <9089>\n<37a8> <9089>\n<37a9> <9089>\n<37aa> <9089>\n<37ab> <9089>\n<37ac> <9089>\n<37ad> <d862dd87>\n<37ae> <93dd>\n<37af> <95bc>\n<37b0> <d863de17>\n<37b1> <96b2>\n<37b2> <975c>\n<37b3> <9839>\n<37b4> <98eb>\n<37b5> <9903>\n<37b6> <9909>\n<37b7> <9945>\n<37b8> <9945>\n<37b9> <994b>\n<37ba> <9a08>\n<37bb> <9a5f>\n<37bc> <9a65>\n<37bd> <9aef>\n<37be> <9b18>\n<37bf> <9bdf>\n<37c0> <9d09>\n<37c1> <9d08>\n<37c2> <9ea5>\n<37c3> <9ecc>\n<37c4> <9f08>\n<37c5> <9f4a>\n<37c6> <9f63>\n<37c7> <9f67>\n<37c8> <d869de1a>\n<37c9> <d850deee>\n<37ca> <d850deee>\n<37cb> <891c>\n<37cc> <68c8>\n<37cd> <66fb>\n<37ce> <5f45>\n<37cf> <5300>\n<37d0> <5389>\n<37d1> <5953>\n<37d2> <fa11>\n<37d3> <d87edce1>\n<37d4> <6a73>\n<37d5> <d84fdcbe>\n<37d6> <d841de11>\n<37d7> <8a12>\n<37da> <4e1f>\n<37db> <4e2b>\n<37e0> <4e44>\n<37e1> <4e5a>\nendbfchar\n\n100 beginbfchar\n<37e2> <4e7f>\n<37e3> <4e8d>\n<37e4> <4e96>\n<37e5> <4eb9>\n<37e6> <4ed0>\n<37e7> <4ee0>\n<37e8> <4efd>\n<37e9> <4eff>\n<37ea> <4f0b>\n<37eb> <4f15>\n<37ec> <4f60>\n<37ed> <4f3b>\n<37ee> <4f49>\n<37ef> <4f54>\n<37f0> <4f7a>\n<37f3> <4f97>\n<37f4> <4fbe>\n<37f5> <4fcf>\n<37f6> <4ffd>\n<37f9> <5010>\n<37fa> <501b>\n<37fb> <5027>\n<37fc> <502e>\n<37fd> <5057>\n<37fe> <5066>\n<37ff> <506a>\n<3800> <503b>\n<3801> <508f>\n<3802> <5096>\n<3803> <509c>\n<3804> <50cc>\n<3805> <50e6>\n<3806> <50e9>\n<3807> <50ef>\n<3808> <5108>\n<3809> <510b>\n<380a> <5110>\n<380b> <511b>\n<380c> <511e>\n<380d> <515f>\n<380e> <51a1>\n<380f> <51bc>\n<3810> <51de>\n<3811> <51ee>\n<3812> <51f4>\n<3815> <5213>\n<3816> <5249>\n<3817> <5261>\n<3818> <5266>\n<3819> <5293>\n<381a> <52c8>\n<381b> <52f0>\n<381e> <533e>\n<381f> <534c>\n<3820> <534b>\n<3821> <5361>\n<3822> <536c>\n<3823> <53ab>\n<3824> <53da>\n<3825> <53e6>\n<3826> <53f5>\n<3827> <5427>\n<3828> <544d>\n<3829> <5466>\n<382a> <546b>\n<382b> <5474>\n<382c> <548d>\n<382d> <5496>\n<382e> <54a1>\n<382f> <54ad>\n<3830> <54b9>\n<3831> <54bf>\n<3832> <54c6>\n<3833> <54cd>\n<3834> <550e>\n<3835> <552b>\n<3836> <5535>\n<3837> <554a>\n<383a> <5588>\n<383b> <558e>\n<383c> <5608>\n<383f> <5637>\n<3840> <563f>\n<3841> <5649>\n<3842> <564b>\n<3843> <564f>\n<3844> <5666>\n<3845> <5669>\n<3846> <566f>\n<3849> <5695>\n<384a> <569a>\n<384d> <56b1>\n<384e> <56c9>\n<384f> <56dd>\n<3850> <56e4>\n<3851> <570a>\n<3852> <5715>\n<3853> <5723>\n<3854> <572f>\n<3857> <574c>\nendbfchar\n\n100 beginbfchar\n<3858> <5770>\n<3859> <578c>\n<385a> <579c>\n<385b> <57b8>\n<385c> <57e6>\n<385d> <57ed>\n<3860> <57ff>\n<3861> <5809>\n<3862> <5820>\n<3863> <5832>\n<3864> <587c>\n<3865> <5880>\n<3866> <58a9>\n<3867> <58ce>\n<3868> <58d0>\n<3869> <58d4>\n<386a> <58da>\n<386b> <58e9>\n<386c> <590c>\n<386d> <5924>\n<386e> <592f>\n<386f> <5961>\n<3870> <596d>\n<3871> <59ca>\n<3872> <59d2>\n<3873> <59dd>\n<3876> <5a04>\n<3877> <5a0c>\n<3878> <5a23>\n<3879> <5a47>\n<387a> <5a55>\n<387b> <5a63>\n<387c> <5a6d>\n<387d> <5a7e>\n<387e> <5a9e>\n<387f> <5aa7>\n<3880> <5aac>\n<3881> <5ab3>\n<3882> <5ae0>\n<3883> <5b00>\n<3884> <5b19>\n<3885> <5b25>\n<3886> <5b2d>\n<3887> <5b41>\n<3888> <5b7c>\n<388b> <5b8a>\n<388c> <5c23>\n<388d> <5c2b>\n<388e> <5c30>\n<388f> <5c63>\n<3890> <5c69>\n<3891> <5c7c>\n<3892> <5ccb>\n<3893> <5cd2>\n<3894> <5cf4>\n<3895> <5d24>\n<3896> <5d26>\n<3897> <5d43>\n<3898> <5d46>\n<3899> <5d4a>\n<389a> <5d92>\n<389b> <5d94>\n<389c> <5d99>\n<389d> <5da0>\n<389e> <5dd8>\n<389f> <5de0>\n<38a0> <5df8>\n<38a1> <5e00>\n<38a2> <5e12>\n<38a5> <5e18>\n<38a6> <5e2e>\n<38a7> <5e58>\n<38aa> <5ea8>\n<38ab> <5eaa>\n<38ae> <5ecb>\n<38af> <5ed2>\n<38b0> <5f07>\n<38b1> <5f0e>\n<38b4> <5f22>\n<38b5> <5f28>\n<38b6> <5f36>\n<38b7> <5f3b>\n<38b8> <5f40>\n<38b9> <5f50>\n<38ba> <5f58>\n<38bb> <5f64>\n<38bc> <5f89>\n<38bd> <5f9c>\n<38be> <5fa7>\n<38bf> <5fa4>\n<38c0> <5faf>\n<38c1> <5fb8>\n<38c2> <5fc4>\n<38c3> <5fc9>\n<38c4> <5fe1>\n<38c5> <5fe9>\n<38c6> <5fed>\n<38c7> <5ffc>\n<38c8> <6017>\n<38c9> <601a>\nendbfchar\n\n100 beginbfchar\n<38ca> <6033>\n<38cb> <6061>\n<38cc> <607f>\n<38cd> <609e>\n<38ce> <60a4>\n<38cf> <60b0>\n<38d0> <60cb>\n<38d1> <60db>\n<38d2> <60f8>\n<38d6> <611c>\n<38d7> <617c>\n<38d8> <618d>\n<38d9> <619f>\n<38da> <61a8>\n<38db> <61c2>\n<38dc> <61df>\n<38dd> <6215>\n<38de> <6229>\n<38df> <6243>\n<38e0> <6246>\n<38e1> <624c>\n<38e2> <6251>\n<38e3> <6256>\n<38e4> <62c4>\n<38e5> <62fc>\n<38e6> <630a>\n<38e7> <630d>\n<38e8> <6318>\n<38e9> <6339>\n<38ec> <6365>\n<38ed> <6374>\n<38ee> <637d>\n<38ef> <6384>\n<38f0> <6387>\n<38f1> <6390>\n<38f2> <639e>\n<38f3> <63d1>\n<38f4> <63dc>\n<38f5> <6409>\n<38f6> <6410>\n<38f7> <6422>\n<38f8> <6454>\n<38f9> <645b>\n<38fa> <646d>\n<38fb> <647b>\n<38fe> <64e5>\n<38ff> <64f7>\n<3900> <64fb>\n<3901> <6504>\n<3902> <6516>\n<3903> <6519>\n<3904> <6547>\n<3905> <6567>\n<3906> <6581>\n<3907> <6585>\n<3908> <65c2>\n<3909> <65f0>\n<390a> <65f2>\n<390b> <662c>\n<390c> <664c>\n<390f> <6661>\n<3910> <666b>\n<3911> <6677>\n<3912> <66a4>\n<3913> <66c8>\n<3914> <66ec>\n<3915> <6705>\n<3916> <6713>\n<3917> <6733>\n<3918> <6748>\n<3919> <674c>\n<391a> <6776>\n<391b> <677b>\n<391c> <67b0>\n<391d> <67b2>\n<391e> <67f9>\n<391f> <67d7>\n<3920> <67d9>\n<3921> <67f0>\n<3922> <682c>\n<3925> <685b>\n<3926> <6872>\n<3927> <6875>\n<3928> <687a>\n<3929> <6884>\n<392a> <68a5>\n<392b> <68b2>\n<392c> <68d0>\n<392d> <68d6>\n<392e> <68e8>\n<392f> <68ed>\n<3932> <68fc>\n<3933> <6911>\n<3934> <6913>\n<3935> <6935>\n<3936> <693b>\n<3937> <6957>\n<3938> <6963>\n<3939> <6972>\n<393c> <69a6>\nendbfchar\n\n100 beginbfchar\n<393d> <69ad>\n<393e> <69b7>\n<3941> <6a01>\n<3942> <6a0f>\n<3943> <6a15>\n<3944> <6a28>\n<3945> <6a34>\n<3946> <6a3e>\n<3947> <6a45>\n<394a> <6a56>\n<394b> <6a5b>\n<394c> <6a83>\n<394d> <6a89>\n<394e> <6a91>\n<3952> <6adc>\n<3953> <6ae7>\n<3954> <6aec>\n<3955> <6b1e>\n<3956> <6b24>\n<3957> <6b35>\n<3958> <6b46>\n<3959> <6b56>\n<395a> <6b60>\n<395b> <6b82>\n<395c> <6bbe>\n<395d> <6be1>\n<395e> <6bf1>\n<395f> <6c10>\n<3960> <6c33>\n<3961> <6c35>\n<3962> <6c3a>\n<3963> <6c59>\n<3964> <6c76>\n<3965> <6c7b>\n<3966> <6c85>\n<3967> <6c95>\n<3968> <6c9c>\n<3969> <6cd0>\n<396a> <6cd4>\n<396b> <6cd6>\n<396c> <6ce0>\n<396f> <6cee>\n<3970> <6d0a>\n<3971> <6d0e>\n<3972> <6d11>\n<3973> <6d2e>\n<3974> <6d57>\n<3975> <6d5e>\n<3976> <6d65>\n<3977> <6d82>\n<3978> <6dbf>\n<3979> <6dc4>\n<397a> <6dca>\n<397b> <6dd6>\n<397c> <6de9>\n<397d> <6e22>\n<397e> <6e51>\n<397f> <6ec7>\n<3980> <6eca>\n<3981> <6ece>\n<3982> <6efd>\n<3983> <6f1a>\n<3984> <6f2a>\n<3985> <6f2f>\n<3986> <6f33>\n<3987> <6f5a>\n<3988> <6f5e>\n<3989> <6f62>\n<398a> <6f7d>\n<398b> <6f8b>\n<398c> <6f8d>\n<398d> <6f92>\n<398e> <6f94>\n<398f> <6f9a>\n<3992> <6fb6>\n<3993> <6fda>\n<3994> <6fde>\n<3995> <6ff9>\n<3996> <7039>\n<3997> <703c>\n<3998> <704a>\n<3999> <7054>\n<399c> <7064>\n<399d> <706c>\n<399e> <707e>\n<399f> <7081>\n<39a0> <7095>\n<39a1> <70b7>\n<39a4> <70d8>\n<39a5> <70dc>\n<39a6> <7107>\n<39a7> <7120>\n<39a8> <7131>\n<39a9> <714a>\n<39aa> <7152>\n<39ab> <7160>\n<39ac> <7179>\n<39ad> <7192>\n<39ae> <71b3>\n<39af> <71cb>\nendbfchar\n\n100 beginbfchar\n<39b0> <71d3>\n<39b1> <71d6>\n<39b2> <7200>\n<39b3> <721d>\n<39b4> <722b>\n<39b5> <7238>\n<39b6> <7241>\n<39b7> <7253>\n<39ba> <725c>\n<39bb> <728d>\n<39bc> <72ad>\n<39bd> <72b4>\n<39be> <72c7>\n<39bf> <72fb>\n<39c2> <7328>\n<39c3> <7331>\n<39c4> <7343>\n<39c5> <736c>\n<39c6> <737c>\n<39c7> <7383>\n<39ca> <7395>\n<39ce> <73a6>\n<39cf> <73ab>\n<39d0> <73b5>\n<39d1> <73b7>\n<39d2> <73bc>\n<39d3> <73cf>\n<39d4> <73d9>\n<39d5> <73e9>\n<39d6> <73f4>\n<39d7> <73fd>\n<39d8> <7404>\n<39d9> <740a>\n<39dc> <7424>\n<39dd> <7428>\n<39de> <742c>\n<39e2> <7439>\n<39e3> <7444>\n<39e4> <7447>\n<39e5> <744b>\n<39e6> <744d>\n<39e7> <7451>\n<39e8> <7457>\n<39e9> <7466>\n<39ea> <746b>\n<39eb> <7471>\n<39ec> <7480>\n<39f0> <7490>\n<39f1> <7498>\n<39f2> <749c>\n<39f3> <74a0>\n<39f4> <74a3>\n<39f5> <74a8>\n<39f6> <74ab>\n<39f7> <74b5>\n<39f8> <74bf>\n<39f9> <74c8>\n<39fa> <74da>\n<39fb> <74de>\n<39fc> <754e>\n<39fd> <7579>\n<39fe> <7581>\n<39ff> <7590>\n<3a02> <75b4>\n<3a03> <75e4>\n<3a04> <75f9>\n<3a05> <7600>\n<3a06> <760a>\n<3a09> <7619>\n<3a0a> <761e>\n<3a0b> <762d>\n<3a0c> <7635>\n<3a0d> <7643>\n<3a0e> <764b>\n<3a0f> <7665>\n<3a10> <766d>\n<3a11> <766f>\n<3a12> <7671>\n<3a13> <7674>\n<3a16> <76c5>\n<3a17> <76cc>\n<3a18> <76ec>\n<3a19> <76fc>\n<3a1a> <7734>\n<3a1b> <7736>\n<3a1c> <775c>\n<3a1f> <7772>\n<3a20> <777d>\n<3a21> <7795>\n<3a22> <77aa>\n<3a23> <77e6>\n<3a24> <77f0>\n<3a25> <77f4>\n<3a26> <7806>\n<3a27> <7822>\n<3a2a> <7830>\n<3a2b> <7835>\n<3a2c> <7868>\n<3a2d> <789e>\n<3a2e> <78c8>\nendbfchar\n\n100 beginbfchar\n<3a2f> <78cc>\n<3a30> <78ce>\n<3a31> <78e4>\n<3a34> <78f2>\n<3a35> <78f7>\n<3a36> <78fb>\n<3a37> <7931>\n<3a38> <7934>\n<3a39> <793b>\n<3a3a> <793d>\n<3a3b> <7945>\n<3a3e> <798b>\n<3a3f> <7996>\n<3a40> <7998>\n<3a41> <79b8>\n<3a42> <79bb>\n<3a43> <79ca>\n<3a44> <79da>\n<3a45> <7a03>\n<3a46> <7a09>\n<3a47> <7a11>\n<3a48> <7a1e>\n<3a49> <7a2d>\n<3a4a> <7a39>\n<3a4b> <7a45>\n<3a4c> <7a4c>\n<3a4d> <7a5d>\n<3a4e> <7a60>\n<3a4f> <7a6d>\n<3a50> <7a78>\n<3a51> <7aa0>\n<3a52> <7aa3>\n<3a53> <7ab3>\n<3a56> <7ac6>\n<3a57> <7b07>\n<3a58> <7b14>\n<3a59> <7b27>\n<3a5a> <7b31>\n<3a5b> <7b47>\n<3a5c> <7b4e>\n<3a5d> <7b60>\n<3a5e> <7b69>\n<3a5f> <7b6d>\n<3a60> <7b72>\n<3a61> <7b91>\n<3a62> <7baf>\n<3a63> <7bd7>\n<3a64> <7bd9>\n<3a65> <7c0b>\n<3a66> <7c0f>\n<3a67> <7c20>\n<3a68> <7c26>\n<3a69> <7c31>\n<3a6a> <7c36>\n<3a6b> <7c51>\n<3a6c> <7c59>\n<3a6d> <7c67>\n<3a6e> <7c6e>\n<3a6f> <7c70>\n<3a70> <7cbc>\n<3a71> <7cbf>\n<3a74> <7cd7>\n<3a75> <7cd9>\n<3a76> <7cdd>\n<3a77> <7ceb>\n<3a7b> <7d13>\n<3a7c> <7d1d>\n<3a7d> <7d23>\n<3a7e> <7d41>\n<3a7f> <7d53>\n<3a80> <7d59>\n<3a81> <7d5d>\n<3a82> <7d7a>\n<3a83> <7d86>\n<3a86> <7dcc>\n<3a87> <7deb>\n<3a88> <7df1>\n<3a89> <7df9>\n<3a8a> <7e08>\n<3a8b> <7e11>\n<3a8c> <7e15>\n<3a8d> <7e20>\n<3a8e> <7e47>\n<3a8f> <7e62>\n<3a90> <7e6e>\n<3a91> <7e73>\n<3a92> <7e8d>\n<3a93> <7e91>\n<3a94> <7e98>\n<3a95> <7f44>\n<3a96> <7f4f>\n<3a99> <7f61>\n<3a9a> <7f91>\n<3a9b> <7fbf>\n<3a9c> <7fce>\n<3a9d> <7fdf>\n<3a9e> <7fe5>\n<3a9f> <7fec>\n<3aa2> <7ffa>\n<3aa3> <800e>\nendbfchar\n\n100 beginbfchar\n<3aa4> <8011>\n<3aa5> <8014>\n<3aa6> <8024>\n<3aa7> <8026>\n<3aa8> <803a>\n<3aa9> <803c>\n<3aaa> <8060>\n<3aab> <8071>\n<3aac> <8075>\n<3aad> <809e>\n<3aae> <80a6>\n<3aaf> <80ab>\n<3ab2> <8116>\n<3ab3> <8118>\n<3ab4> <813a>\n<3ab5> <814a>\n<3ab6> <814c>\n<3ab7> <8181>\n<3ab8> <8184>\n<3ab9> <81b4>\n<3aba> <81cf>\n<3abb> <81f9>\n<3abc> <8203>\n<3abd> <8221>\n<3abe> <8232>\n<3abf> <8234>\n<3ac0> <8246>\n<3ac1> <824b>\n<3ac2> <824f>\n<3ac3> <828e>\n<3ac4> <82ae>\n<3ac5> <82b7>\n<3ac6> <82be>\n<3ac7> <82c6>\n<3ac8> <82fe>\n<3ac9> <8343>\n<3aca> <8351>\n<3acb> <8355>\n<3acc> <8386>\n<3acd> <838d>\n<3ace> <8392>\n<3acf> <8398>\n<3ad0> <83a9>\n<3ad3> <83ea>\n<3ad4> <840f>\n<3ad5> <8411>\n<3ad6> <844a>\n<3ad7> <8476>\n<3ad8> <84a8>\n<3ad9> <84af>\n<3ada> <84c0>\n<3adb> <84c2>\n<3adc> <84f0>\n<3add> <84fd>\n<3ade> <850c>\n<3adf> <8534>\n<3ae0> <855e>\n<3ae1> <858f>\n<3ae2> <85b7>\n<3ae3> <85ce>\n<3ae4> <85ad>\n<3ae5> <8612>\n<3ae6> <8629>\n<3ae7> <8652>\n<3ae8> <8663>\n<3ae9> <866c>\n<3aea> <866f>\n<3aeb> <867a>\n<3aec> <868d>\n<3aed> <8691>\n<3aee> <8698>\n<3af1> <86fa>\n<3af2> <86fd>\n<3af3> <870b>\n<3af4> <8713>\n<3af5> <8719>\n<3af6> <871e>\n<3af7> <8728>\n<3af8> <873e>\n<3af9> <8771>\n<3afa> <8788>\n<3afb> <8799>\n<3afe> <87b5>\n<3aff> <87d6>\n<3b00> <87eb>\n<3b01> <87ed>\n<3b02> <8801>\n<3b03> <8803>\n<3b04> <8806>\n<3b05> <880b>\n<3b06> <8814>\n<3b07> <881c>\n<3b08> <8856>\n<3b09> <885f>\n<3b0a> <8864>\n<3b0b> <8898>\n<3b0c> <88aa>\n<3b0f> <88ca>\n<3b10> <88d2>\n<3b11> <88db>\nendbfchar\n\n100 beginbfchar\n<3b14> <8906>\n<3b18> <8927>\n<3b19> <8930>\n<3b1a> <893e>\n<3b1b> <897b>\n<3b1c> <89d4>\n<3b1d> <89d6>\n<3b1e> <89e5>\n<3b1f> <89f1>\n<3b20> <8a07>\n<3b21> <8a0f>\n<3b22> <8a15>\n<3b23> <8a22>\n<3b24> <8a4e>\n<3b25> <8a7f>\n<3b26> <8af4>\n<3b27> <8b1f>\n<3b28> <8b37>\n<3b2b> <8b54>\n<3b2c> <8b9c>\n<3b2d> <8b9e>\n<3b2e> <8c47>\n<3b2f> <8c54>\n<3b30> <8c73>\n<3b31> <8ca4>\n<3b32> <8cd9>\n<3b33> <8ce1>\n<3b34> <8cf8>\n<3b35> <8cfe>\n<3b36> <8d1b>\n<3b37> <8d69>\n<3b38> <8d6c>\n<3b39> <8d84>\n<3b3a> <8d8d>\n<3b3b> <8d95>\n<3b3c> <8da6>\n<3b3d> <8dc6>\n<3b3e> <8dce>\n<3b3f> <8de4>\n<3b40> <8dec>\n<3b41> <8e20>\n<3b42> <8e4b>\n<3b43> <8e6c>\n<3b44> <8e70>\n<3b45> <8e7a>\n<3b46> <8e92>\n<3b47> <8eae>\n<3b48> <8eb3>\n<3b49> <8ed1>\n<3b4a> <8ed4>\n<3b4b> <8ef9>\n<3b4c> <8f17>\n<3b4d> <8f36>\n<3b4e> <8fa6>\n<3b51> <8fc6>\n<3b52> <8fe0>\n<3b53> <8fe4>\n<3b54> <8ff6>\n<3b55> <9002>\n<3b56> <902c>\n<3b57> <9044>\n<3b58> <9088>\n<3b59> <9095>\n<3b5a> <9099>\n<3b5b> <909b>\n<3b5c> <90a2>\n<3b5d> <90b4>\n<3b5e> <90d7>\n<3b5f> <90dd>\n<3b60> <90f4>\n<3b61> <9117>\n<3b62> <911c>\n<3b63> <9131>\n<3b64> <913a>\n<3b65> <913d>\n<3b66> <9148>\n<3b67> <915b>\n<3b68> <9161>\n<3b69> <9164>\n<3b6a> <918e>\n<3b6b> <919e>\n<3b6c> <91a8>\n<3b6f> <91b2>\n<3b70> <91bc>\n<3b71> <91f0>\n<3b72> <91f7>\n<3b73> <91fb>\n<3b74> <9207>\n<3b75> <9228>\n<3b76> <9233>\n<3b77> <9238>\n<3b78> <9243>\n<3b79> <9247>\n<3b7a> <924f>\n<3b7b> <9260>\n<3b7c> <92c2>\n<3b7f> <92df>\n<3b80> <930d>\n<3b81> <9315>\n<3b82> <931f>\nendbfchar\n\n100 beginbfchar\n<3b83> <9327>\n<3b84> <9347>\n<3b85> <9352>\n<3b86> <9365>\n<3b87> <936a>\n<3b88> <936d>\n<3b89> <939b>\n<3b8a> <93ba>\n<3b8b> <93a9>\n<3b8c> <93c1>\n<3b8d> <93ca>\n<3b8e> <93e2>\n<3b8f> <93fa>\n<3b90> <93fd>\n<3b91> <940f>\n<3b92> <9434>\n<3b93> <943f>\n<3b94> <9455>\n<3b95> <946b>\n<3b96> <9472>\n<3b97> <9578>\n<3b98> <95a6>\n<3b99> <95a9>\n<3b9a> <95ab>\n<3b9b> <95b4>\n<3b9c> <95bd>\n<3b9d> <95da>\n<3b9e> <961d>\n<3b9f> <9641>\n<3ba0> <9658>\n<3ba1> <9684>\n<3ba2> <96a4>\n<3ba3> <96a9>\n<3ba4> <96d2>\n<3ba5> <d87eddf4>\n<3ba6> <96de>\n<3ba7> <96e9>\n<3ba8> <96f1>\n<3ba9> <9702>\n<3baa> <9709>\n<3bab> <975a>\n<3bac> <9763>\n<3bad> <976e>\n<3bae> <9773>\n<3baf> <979a>\n<3bb0> <97a2>\n<3bb3> <97d9>\n<3bb4> <97de>\n<3bb5> <97f4>\n<3bb6> <980a>\n<3bb7> <980e>\n<3bb8> <981e>\n<3bb9> <9823>\n<3bba> <982b>\n<3bbb> <983e>\n<3bbe> <9859>\n<3bbf> <986c>\n<3bc0> <98b8>\n<3bc1> <98ba>\n<3bc2> <98bf>\n<3bc3> <98c8>\n<3bc4> <98e5>\n<3bc7> <9940>\n<3bc8> <994d>\n<3bc9> <995c>\n<3bca> <995f>\n<3bcb> <99b1>\n<3bce> <99c9>\n<3bcf> <9a02>\n<3bd0> <9a16>\n<3bd1> <9a24>\n<3bd2> <9a27>\n<3bd5> <9a36>\n<3bd6> <9a38>\n<3bd7> <9a4a>\n<3bd8> <9a56>\n<3bdb> <9af9>\n<3bdc> <9b03>\n<3bdd> <9b20>\n<3be0> <9b73>\n<3be1> <9b79>\n<3be2> <9ba7>\n<3be3> <9bc1>\n<3be4> <9bc7>\n<3be5> <9bd7>\n<3be6> <9be7>\n<3be7> <9beb>\n<3be8> <9bf7>\n<3be9> <9bfa>\n<3bea> <9bfd>\n<3beb> <9c0b>\n<3bec> <9c27>\n<3bed> <9c2a>\n<3bee> <9c36>\n<3bef> <9c41>\n<3bf0> <9c53>\n<3bf1> <9c63>\n<3bf2> <9c70>\n<3bf3> <9c77>\n<3bf4> <9d02>\nendbfchar\n\n100 beginbfchar\n<3bf5> <9d42>\n<3bf6> <9d47>\n<3bf7> <9d63>\n<3bf8> <9d69>\n<3bf9> <9d7c>\n<3bfa> <9d7e>\n<3bfb> <9d8d>\n<3bfc> <9db1>\n<3bfd> <9dc3>\n<3bfe> <9dc7>\n<3bff> <9dd6>\n<3c00> <9ddf>\n<3c01> <9deb>\n<3c02> <9df4>\n<3c03> <9e15>\n<3c04> <9e1d>\n<3c05> <9ea4>\n<3c06> <9ea8>\n<3c07> <9eac>\n<3c08> <9ee7>\n<3c09> <9eee>\n<3c0a> <9f10>\n<3c0b> <9f12>\n<3c0c> <9f17>\n<3c0d> <9f19>\n<3c0e> <9f2f>\n<3c0f> <9f37>\n<3c10> <9f39>\n<3c11> <9f41>\n<3c12> <9f45>\n<3c13> <9f57>\n<3c14> <9f68>\n<3c15> <9f71>\n<3c16> <9f75>\n<3c17> <9f90>\n<3c18> <9f94>\n<3c19> <9fa2>\n<3c1a> <4e30>\n<3c1b> <3405>\n<3c1c> <d87edc04>\n<3c1d> <5620>\n<3c1e> <5ecb>\n<3c1f> <2e95>\n<3c20> <60a4>\n<3c21> <d84dde3a>\n<3c22> <6b24>\n<3c23> <6ff9>\n<3c24> <6ee6>\n<3c25> <71b3>\n<3c26> <2ea4>\n<3c27> <7ac6>\n<3c28> <7f61>\n<3c29> <8071>\n<3c2a> <809e>\n<3c2b> <2ecc>\n<3c2c> <91fc>\n<3c2d> <5db2>\n<3c2e> <97de>\n<3c2f> <4fd3>\n<3c30> <50d9>\n<3c31> <50f0>\n<3c32> <51c3>\n<3c33> <5676>\n<3c34> <6a54>\n<3c35> <6d01>\n<3c36> <6dd0>\n<3c37> <6e42>\n<3c38> <6ed9>\n<3c39> <73e4>\n<3c3a> <7421>\n<3c3b> <756c>\n<3c3c> <7851>\n<3c3d> <87f5>\n<3c3e> <d84cdffe>\n<3c3f> <73a8>\n<3c40> <3af3>\n<3c41> <34db>\n<3c42> <440c>\n<3c43> <3e8a>\n<3c44> <d84dddc4>\n<3c45> <fffd>\n<3c46> <4be8>\n<3c47> <fffd>\n<3c48> <3eda>\n<3c49> <3b22>\n<3c4a> <fffd>\n<3c4b> <457a>\n<3c4c> <4093>\n<3c4d> <d867de3d>\n<3c4e> <4665>\n<3c4f> <4103>\n<3c50> <4293>\n<3c51> <46ae>\n<3c52> <3488>\n<3c53> <d849de09>\n<3c57> <f87a>\n<3c58> <f87f>\n<3c5d> <3003>\n<3c5e> <3006>\n<3c5f> <30fc>\nendbfchar\n\n100 beginbfchar\n<3c60> <2260>\n<3c63> <221e>\n<3c64> <2234>\n<3c65> <2103>\n<3c66> <30ff>\n<3c67> <309f>\n<3c68> <2208>\n<3c69> <220b>\n<3c6e> <222a>\n<3c6f> <2229>\n<3c74> <2209>\n<3c75> <2205>\n<3c7a> <21d2>\n<3c7b> <21d4>\n<3c7c> <2200>\n<3c7d> <2203>\n<3c83> <2220>\n<3c84> <22a5>\n<3c85> <2202>\n<3c86> <2207>\n<3c87> <2261>\n<3c88> <2252>\n<3c8b> <221a>\n<3c8c> <223d>\n<3c8d> <221d>\n<3c8e> <2235>\n<3c91> <2262>\n<3c92> <2243>\n<3c93> <2245>\n<3c94> <2248>\n<3c97> <2194>\n<3c98> <2213>\n<3c99> <2135>\n<3c9a> <210f>\n<3c9b> <2127>\n<3c9c> <30a0>\n<3cf3> <304b309a>\n<3cf4> <304d309a>\n<3cf5> <304f309a>\n<3cf6> <3051309a>\n<3cf7> <3053309a>\n<3d4e> <30ab309a>\n<3d4f> <30ad309a>\n<3d50> <30af309a>\n<3d51> <30b1309a>\n<3d52> <30b3309a>\n<3d53> <30bb309a>\n<3d54> <30c4309a>\n<3d55> <30c8309a>\n<3d60> <31f7309a>\n<3d6b> <3053>\n<3d6c> <30b3>\n<3d6f> <2155>\n<3d70> <2318>\n<3d75> <01d6>\n<3d76> <01d8>\n<3d77> <01da>\n<3d78> <01dc>\n<3d79> <0104>\n<3d7a> <02d8>\n<3d7b> <013d>\n<3d7c> <015a>\n<3d7d> <015e>\n<3d7e> <0164>\n<3d7f> <0179>\n<3d80> <017b>\n<3d81> <0105>\n<3d82> <02db>\n<3d83> <013e>\n<3d84> <015b>\n<3d85> <02c7>\n<3d86> <015f>\n<3d87> <0165>\n<3d88> <017a>\n<3d89> <02dd>\n<3d8a> <017c>\n<3d8b> <0154>\n<3d8c> <0102>\n<3d8d> <0139>\n<3d8e> <0106>\n<3d8f> <010c>\n<3d90> <0118>\n<3d91> <010e>\n<3d92> <0143>\n<3d93> <0147>\n<3d94> <0150>\n<3d95> <0158>\n<3d96> <0170>\n<3d97> <0162>\n<3d98> <0155>\n<3d99> <0103>\n<3d9a> <013a>\n<3d9b> <0107>\n<3d9c> <010d>\n<3d9d> <0119>\n<3d9e> <010f>\n<3d9f> <0111>\n<3da0> <0144>\n<3da1> <0148>\n<3da2> <0151>\nendbfchar\n\n100 beginbfchar\n<3da3> <0159>\n<3da4> <0171>\n<3da5> <0163>\n<3da6> <02d9>\n<3da7> <0108>\n<3da8> <011c>\n<3da9> <0124>\n<3daa> <0134>\n<3dab> <015c>\n<3dac> <016c>\n<3dad> <0109>\n<3dae> <011d>\n<3daf> <0125>\n<3db0> <0135>\n<3db1> <015d>\n<3db2> <016d>\n<3db3> <0271>\n<3db4> <028b>\n<3db5> <027e>\n<3db6> <026c>\n<3db7> <026e>\n<3db8> <0279>\n<3db9> <0288>\n<3dba> <0256>\n<3dbb> <0273>\n<3dbc> <027d>\n<3dbd> <0282>\n<3dbe> <0290>\n<3dbf> <027b>\n<3dc0> <026d>\n<3dc1> <025f>\n<3dc2> <0272>\n<3dc3> <029d>\n<3dc4> <028e>\n<3dc5> <0261>\n<3dc6> <0270>\n<3dc7> <0281>\n<3dc8> <0127>\n<3dc9> <0295>\n<3dca> <0294>\n<3dcb> <0266>\n<3dcc> <0298>\n<3dcd> <01c2>\n<3dce> <0253>\n<3dcf> <0257>\n<3dd0> <0284>\n<3dd1> <0260>\n<3dd2> <0193>\n<3dd3> <0268>\n<3dd4> <0289>\n<3dd5> <0258>\n<3dd6> <025c>\n<3dd7> <025e>\n<3dd8> <0250>\n<3dd9> <026f>\n<3dda> <028a>\n<3ddb> <0264>\n<3ddc> <0252>\n<3ddd> <028d>\n<3dde> <0265>\n<3ddf> <02a2>\n<3de0> <02a1>\n<3de1> <0255>\n<3de2> <0291>\n<3de3> <027a>\n<3de4> <0267>\n<3de5> <0361>\n<3de6> <02c8>\n<3de7> <02cc>\n<3de8> <02d1>\n<3de9> <203f>\n<3dea> <030f>\n<3df0> <02e902e5>\n<3df1> <02e502e9>\n<3df2> <0325>\n<3df3> <032c>\n<3df4> <0339>\n<3df5> <031c>\n<3df8> <033d>\n<3df9> <0329>\n<3dfa> <032f>\n<3dfb> <02de>\n<3dfc> <0324>\n<3dfd> <0330>\n<3dfe> <033c>\n<3dff> <0334>\n<3e04> <032a>\n<3e07> <031a>\n<3e08> <222e>\n<3e09> <221f>\n<3e0a> <22bf>\n<3e0d> <026a>\n<3e0e> <0274>\n<3e0f> <0276>\n<3e10> <0278>\n<3e11> <0280>\n<3e12> <028f>\n<3e13> <0299>\n<3e14> <029c>\n<3e15> <029f>\nendbfchar\n\n100 beginbfchar\n<3e16> <02b0>\n<3e17> <02b2>\n<3e18> <02b7>\n<3e19> <02c1>\n<3e1c> <220a>\n<3e1d> <2211>\n<3e1e> <222d>\n<3e21> <2298>\n<3e22> <229e>\n<3e23> <22a0>\n<3e24> <006e>\n<3e25> <03b2>\n<3e26> <03b8>\n<3e27> <03c7>\n<3e28> <2127>\n<3e29> <30a0>\n<3e2a> <2155>\n<3e2f> <01d6>\n<3e30> <01d8>\n<3e31> <01da>\n<3e32> <01dc>\n<3e33> <0104>\n<3e34> <013d>\n<3e35> <015a>\n<3e36> <015e>\n<3e37> <0164>\n<3e38> <0179>\n<3e39> <017b>\n<3e3a> <0105>\n<3e3b> <013e>\n<3e3c> <015b>\n<3e3d> <015f>\n<3e3e> <0165>\n<3e3f> <017a>\n<3e40> <017c>\n<3e41> <0154>\n<3e42> <0102>\n<3e43> <0139>\n<3e44> <0106>\n<3e45> <010c>\n<3e46> <0118>\n<3e47> <010e>\n<3e48> <0143>\n<3e49> <0147>\n<3e4a> <0150>\n<3e4b> <0158>\n<3e4c> <0170>\n<3e4d> <0162>\n<3e4e> <0155>\n<3e4f> <0103>\n<3e50> <013a>\n<3e51> <0107>\n<3e52> <010d>\n<3e53> <0119>\n<3e54> <010f>\n<3e55> <0111>\n<3e56> <0144>\n<3e57> <0148>\n<3e58> <0151>\n<3e59> <0159>\n<3e5a> <0171>\n<3e5b> <0163>\n<3e5c> <0108>\n<3e5d> <011c>\n<3e5e> <0124>\n<3e5f> <0134>\n<3e60> <015c>\n<3e61> <016c>\n<3e62> <0109>\n<3e63> <011d>\n<3e64> <0125>\n<3e65> <0135>\n<3e66> <015d>\n<3e67> <016d>\n<3e6c> <3003>\n<3e6d> <3006>\n<3e6e> <30fc>\n<3e6f> <30ff>\n<3e70> <309f>\n<3ec7> <304b309a>\n<3ec8> <304d309a>\n<3ec9> <304f309a>\n<3eca> <3051309a>\n<3ecb> <3053309a>\n<3f22> <30ab309a>\n<3f23> <30ad309a>\n<3f24> <30af309a>\n<3f25> <30b1309a>\n<3f26> <30b3309a>\n<3f27> <30bb309a>\n<3f28> <30c4309a>\n<3f29> <30c8309a>\n<3f34> <31f7309a>\n<3f3f> <3053>\n<3f40> <30b3>\n<3f41> <30fd>\n<3f42> <303c>\n<3f43> <30ff>\n<3f44> <2225>\n<3f47> <266e>\nendbfchar\n\n100 beginbfchar\n<3f48> <266b>\n<3f4b> <29bf>\n<3f4c> <2127>\n<3f4d> <30a0>\n<3f4e> <2013>\n<3f51> <304b309a>\n<3f52> <304d309a>\n<3f53> <304f309a>\n<3f54> <3051309a>\n<3f55> <3053309a>\n<3f56> <30ab309a>\n<3f57> <30ad309a>\n<3f58> <30af309a>\n<3f59> <30b1309a>\n<3f5a> <30b3309a>\n<3f5b> <30bb309a>\n<3f5c> <30c4309a>\n<3f5d> <30c8309a>\n<3f5e> <03c2>\n<3f6b> <25b1>\n<3f76> <31f7309a>\n<3f8c> <203e>\n<3f8d> <ff3f>\n<3f8e> <2713>\n<3f8f> <2318>\n<3f90> <2423>\n<3f91> <23ce>\n<3f98> <00a4>\n<3f99> <2051>\n<3f9a> <2042>\n<3fab> <2209>\n<3fac> <2226>\n<3fad> <2245>\n<3fae> <2248>\n<3faf> <2262>\n<3fc8> <20dd>\n<3fcb> <30a0>\n<3fcc> <2013>\n<3fd7> <31f7309a>\n<3fe0> <304b309a>\n<3fe1> <304d309a>\n<3fe2> <304f309a>\n<3fe3> <3051309a>\n<3fe4> <3053309a>\n<3fe5> <30ab309a>\n<3fe6> <30ad309a>\n<3fe7> <30af309a>\n<3fe8> <30b1309a>\n<3fe9> <30b3309a>\n<3fea> <30bb309a>\n<3feb> <30c4309a>\n<3fec> <30c8309a>\n<3ff7> <31f7309a>\n<3ffe> <304b309a>\n<3fff> <304d309a>\n<4000> <304f309a>\n<4001> <3051309a>\n<4002> <3053309a>\n<4003> <30ab309a>\n<4004> <30ad309a>\n<4005> <30af309a>\n<4006> <30b1309a>\n<4007> <30b3309a>\n<4008> <30bb309a>\n<4009> <30c4309a>\n<400a> <30c8309a>\n<4015> <31f7309a>\n<401c> <29bf>\n<401d> <25e6>\n<401e> <304b309a>\n<401f> <304d309a>\n<4020> <304f309a>\n<4021> <3051309a>\n<4022> <3053309a>\n<4023> <30ab309a>\n<4024> <30ad309a>\n<4025> <30af309a>\n<4026> <30b1309a>\n<4027> <30b3309a>\n<4028> <30bb309a>\n<4029> <30c4309a>\n<402a> <30c8309a>\n<4035> <31f7309a>\n<4040> <3053>\n<4041> <30b3>\n<404c> <31f7309a>\n<4053> <3053>\n<4054> <30b3>\n<4055> <2260>\n<4058> <221e>\n<4059> <2234>\n<405a> <2103>\n<405b> <2208>\n<405c> <220b>\n<4061> <222a>\n<4062> <2229>\n<4067> <2209>\n<4068> <2205>\n<406d> <21d2>\n<406e> <21d4>\nendbfchar\n\n100 beginbfchar\n<406f> <2200>\n<4070> <2203>\n<4076> <2220>\n<4077> <22a5>\n<4078> <2202>\n<4079> <2207>\n<407a> <2261>\n<407b> <2252>\n<407e> <221a>\n<407f> <223d>\n<4080> <221d>\n<4081> <2235>\n<4084> <2262>\n<4085> <2243>\n<4086> <2245>\n<4087> <2248>\n<408a> <2194>\n<408b> <2213>\n<408c> <2135>\n<408d> <210f>\n<408e> <2127>\n<408f> <30a0>\n<4092> <2155>\n<4093> <2318>\n<4098> <01d6>\n<4099> <01d8>\n<409a> <01da>\n<409b> <01dc>\n<409c> <0104>\n<409d> <02d8>\n<409e> <013d>\n<409f> <015a>\n<40a0> <015e>\n<40a1> <0164>\n<40a2> <0179>\n<40a3> <017b>\n<40a4> <0105>\n<40a5> <02db>\n<40a6> <013e>\n<40a7> <015b>\n<40a8> <02c7>\n<40a9> <015f>\n<40aa> <0165>\n<40ab> <017a>\n<40ac> <02dd>\n<40ad> <017c>\n<40ae> <0154>\n<40af> <0102>\n<40b0> <0139>\n<40b1> <0106>\n<40b2> <010c>\n<40b3> <0118>\n<40b4> <010e>\n<40b5> <0143>\n<40b6> <0147>\n<40b7> <0150>\n<40b8> <0158>\n<40b9> <0170>\n<40ba> <0162>\n<40bb> <0155>\n<40bc> <0103>\n<40bd> <013a>\n<40be> <0107>\n<40bf> <010d>\n<40c0> <0119>\n<40c1> <010f>\n<40c2> <0111>\n<40c3> <0144>\n<40c4> <0148>\n<40c5> <0151>\n<40c6> <0159>\n<40c7> <0171>\n<40c8> <0163>\n<40c9> <02d9>\n<40ca> <0108>\n<40cb> <011c>\n<40cc> <0124>\n<40cd> <0134>\n<40ce> <015c>\n<40cf> <016c>\n<40d0> <0109>\n<40d1> <011d>\n<40d2> <0125>\n<40d3> <0135>\n<40d4> <015d>\n<40d5> <016d>\n<40d6> <0271>\n<40d7> <028b>\n<40d8> <027e>\n<40d9> <026c>\n<40da> <026e>\n<40db> <0279>\n<40dc> <0288>\n<40dd> <0256>\n<40de> <0273>\n<40df> <027d>\n<40e0> <0282>\n<40e1> <0290>\n<40e2> <027b>\n<40e3> <026d>\nendbfchar\n\n100 beginbfchar\n<40e4> <025f>\n<40e5> <0272>\n<40e6> <029d>\n<40e7> <028e>\n<40e8> <0261>\n<40e9> <0270>\n<40ea> <0281>\n<40eb> <0127>\n<40ec> <0295>\n<40ed> <0294>\n<40ee> <0266>\n<40ef> <0298>\n<40f0> <01c2>\n<40f1> <0253>\n<40f2> <0257>\n<40f3> <0284>\n<40f4> <0260>\n<40f5> <0193>\n<40f6> <0268>\n<40f7> <0289>\n<40f8> <0258>\n<40f9> <025c>\n<40fa> <025e>\n<40fb> <0250>\n<40fc> <026f>\n<40fd> <028a>\n<40fe> <0264>\n<40ff> <0252>\n<4100> <028d>\n<4101> <0265>\n<4102> <02a2>\n<4103> <02a1>\n<4104> <0255>\n<4105> <0291>\n<4106> <027a>\n<4107> <0267>\n<4108> <0361>\n<4109> <02c8>\n<410a> <02cc>\n<410b> <02d1>\n<410c> <203f>\n<410d> <030f>\n<4113> <02e902e5>\n<4114> <02e502e9>\n<4115> <0325>\n<4116> <032c>\n<4117> <0339>\n<4118> <031c>\n<411b> <033d>\n<411c> <0329>\n<411d> <032f>\n<411e> <02de>\n<411f> <0324>\n<4120> <0330>\n<4121> <033c>\n<4122> <0334>\n<4127> <032a>\n<412a> <031a>\n<412b> <222e>\n<412c> <221f>\n<412d> <22bf>\n<4130> <026a>\n<4131> <0274>\n<4132> <0276>\n<4133> <0278>\n<4134> <0280>\n<4135> <028f>\n<4136> <0299>\n<4137> <029c>\n<4138> <029f>\n<4139> <02b0>\n<413a> <02b2>\n<413b> <02b7>\n<413c> <02c0>\n<413f> <220a>\n<4140> <2211>\n<4141> <222d>\n<4144> <2298>\n<4145> <229e>\n<4146> <22a0>\n<4147> <006e>\n<4148> <03b2>\n<4149> <03b8>\n<414a> <03c7>\n<414b> <2127>\n<414c> <30a0>\n<414d> <2155>\n<4152> <01d6>\n<4153> <01d8>\n<4154> <01da>\n<4155> <01dc>\n<4156> <0104>\n<4157> <013d>\n<4158> <015a>\n<4159> <015e>\n<415a> <0164>\n<415b> <0179>\n<415c> <017b>\n<415d> <0105>\n<415e> <013e>\nendbfchar\n\n100 beginbfchar\n<415f> <015b>\n<4160> <015f>\n<4161> <0165>\n<4162> <017a>\n<4163> <017c>\n<4164> <0154>\n<4165> <0102>\n<4166> <0139>\n<4167> <0106>\n<4168> <010c>\n<4169> <0118>\n<416a> <010e>\n<416b> <0143>\n<416c> <0147>\n<416d> <0150>\n<416e> <0158>\n<416f> <0170>\n<4170> <0162>\n<4171> <0155>\n<4172> <0103>\n<4173> <013a>\n<4174> <0107>\n<4175> <010d>\n<4176> <0119>\n<4177> <010f>\n<4178> <0111>\n<4179> <0144>\n<417a> <0148>\n<417b> <0151>\n<417c> <0159>\n<417d> <0171>\n<417e> <0163>\n<417f> <0108>\n<4180> <011c>\n<4181> <0124>\n<4182> <0134>\n<4183> <015c>\n<4184> <016c>\n<4185> <0109>\n<4186> <011d>\n<4187> <0125>\n<4188> <0135>\n<4189> <015d>\n<418a> <016d>\n<418b> <4f48>\n<418c> <4f5f>\n<418d> <4f6a>\n<418e> <4f6c>\n<418f> <500e>\n<4190> <5018>\n<4191> <5041>\n<4192> <50f2>\n<4193> <50d0>\n<4194> <5106>\n<4195> <5103>\n<4196> <5135>\n<4197> <5155>\n<4198> <5157>\n<4199> <34b5>\n<419a> <51ca>\n<419b> <51e2>\n<419c> <5257>\n<419d> <52cc>\n<419e> <52d6>\n<419f> <52fb>\n<41a0> <531c>\n<41a1> <5363>\n<41a2> <539d>\n<41a3> <5412>\n<41a4> <547f>\n<41a5> <5488>\n<41a6> <5550>\n<41a7> <5581>\n<41a8> <55ad>\n<41a9> <55ce>\n<41aa> <563b>\n<41ab> <569e>\n<41ac> <56a9>\n<41ad> <56b3>\n<41ae> <5777>\n<41af> <577c>\n<41b0> <d844df1b>\n<41b1> <57cf>\n<41b2> <57e4>\n<41b3> <5864>\n<41b4> <5889>\n<41b5> <d845dc6e>\n<41b6> <58d2>\n<41b7> <58e0>\n<41b8> <8641>\n<41b9> <598b>\n<41ba> <5992>\n<41bb> <59c3>\n<41bc> <5a13>\n<41bd> <5a67>\n<41be> <5a77>\n<41bf> <5a84>\n<41c0> <5ac4>\n<41c1> <d846dcbd>\n<41c2> <5b7d>\nendbfchar\n\n100 beginbfchar\n<41c3> <5b93>\n<41c4> <5c12>\n<41c5> <fa3c>\n<41c6> <d845deb4>\n<41c7> <5c7a>\n<41c8> <5c8f>\n<41c9> <5c9f>\n<41ca> <5ca3>\n<41cb> <5caa>\n<41cc> <5cd0>\n<41cd> <d847de34>\n<41ce> <5d0d>\n<41cf> <5d47>\n<41d0> <5d81>\n<41d1> <5da4>\n<41d2> <5da7>\n<41d3> <5dcb>\n<41d4> <5e5e>\n<41d5> <5ef9>\n<41d6> <5f00>\n<41d7> <5f02>\n<41d8> <5f23>\n<41d9> <5f3d>\n<41da> <5f54>\n<41db> <5f7d>\n<41dc> <600d>\n<41dd> <6014>\n<41de> <6018>\n<41df> <6035>\n<41e0> <6047>\n<41e1> <609d>\n<41e2> <60d4>\n<41e3> <60dd>\n<41e4> <612b>\n<41e5> <61bc>\n<41e6> <61b9>\n<41e7> <6222>\n<41e8> <625a>\n<41e9> <626f>\n<41ea> <62d6>\n<41eb> <637c>\n<41ec> <63e5>\n<41ed> <6479>\n<41ee> <64c4>\n<41ef> <64d0>\n<41f0> <6529>\n<41f1> <659d>\n<41f2> <663a>\n<41f3> <6622>\n<41f4> <662b>\n<41f5> <6630>\n<41f6> <6633>\n<41f7> <6648>\n<41f8> <d84cddc4>\n<41fb> <668d>\n<41fc> <66bb>\n<41fd> <66db>\n<41fe> <66e8>\n<41ff> <6747>\n<4200> <6781>\n<4201> <6793>\n<4202> <6798>\n<4203> <679b>\n<4204> <67fc>\n<4205> <681d>\n<4206> <68a3>\n<4207> <690a>\n<4208> <6949>\n<4209> <d84dddc4>\n<420a> <6942>\n<420b> <6964>\n<420c> <69a5>\n<420d> <69cf>\n<420e> <3bb6>\n<420f> <3bc3>\n<4210> <69e9>\n<4211> <69f5>\n<4212> <d84ddf3f>\n<4213> <6a3b>\n<4214> <d84ddf63>\n<4215> <6a94>\n<4216> <6aa5>\n<4217> <3c0f>\n<4218> <6b1b>\n<4219> <6b2c>\n<421a> <6b67>\n<421b> <6ba9>\n<421c> <6bad>\n<421d> <6bd7>\n<421e> <6bff>\n<421f> <6c05>\n<4220> <6c74>\n<4221> <6c98>\n<4222> <6cfb>\n<4223> <6cc6>\n<4224> <6d31>\n<4225> <6d39>\n<4226> <6d3f>\n<4227> <6d58>\n<4228> <6d94>\nendbfchar\n\n100 beginbfchar\n<4229> <6daa>\n<422a> <6ddb>\n<422b> <6ddd>\n<422c> <6e44>\n<422d> <6e5e>\n<422e> <6eb1>\n<422f> <6ec1>\n<4230> <6f10>\n<4231> <6f59>\n<4232> <6f61>\n<4233> <6f7e>\n<4234> <6f8c>\n<4235> <6fa0>\n<4236> <6fbc>\n<4237> <6fc7>\n<4238> <6fca>\n<4239> <6ff0>\n<423a> <704e>\n<423b> <7075>\n<423c> <70a4>\n<423d> <70e4>\n<423e> <712b>\n<423f> <711e>\n<4240> <712e>\n<4241> <7151>\n<4242> <7168>\n<4243> <7185>\n<4244> <7187>\n<4245> <71ba>\n<4246> <71c4>\n<4247> <7215>\n<4248> <3e3f>\n<4249> <729b>\n<424a> <d851dff1>\n<424b> <7327>\n<424c> <7350>\n<424d> <7366>\n<424e> <73a2>\n<424f> <742b>\n<4250> <7446>\n<4251> <7462>\n<4252> <746d>\n<4253> <74a6>\n<4254> <74a9>\n<4255> <74c9>\n<4256> <74ff>\n<4257> <7517>\n<4258> <3f72>\n<4259> <75ce>\n<425a> <7602>\n<425b> <7608>\n<425c> <7664>\n<425d> <7681>\n<425e> <769d>\n<425f> <76aa>\n<4260> <76b6>\n<4261> <76ce>\n<4262> <76d4>\n<4263> <76e6>\n<4264> <76f1>\n<4265> <770a>\n<4266> <7719>\n<4269> <777a>\n<426a> <7780>\n<426b> <7794>\n<426c> <77e0>\n<426d> <d855dc8e>\n<426e> <7843>\n<426f> <786e>\n<4270> <78b0>\n<4271> <d855dd0e>\n<4272> <78ad>\n<4273> <7900>\n<4274> <791c>\n<4275> <792e>\n<4276> <7934>\n<4277> <7946>\n<4278> <7979>\n<4279> <79c8>\n<427a> <d855df71>\n<427b> <79d4>\n<427c> <79de>\n<427d> <79eb>\n<427e> <79ed>\n<427f> <7a85>\n<4280> <d856ddc4>\n<4281> <7ace>\n<4282> <7afd>\n<4283> <7b12>\n<4284> <7b2d>\n<4285> <7b3b>\n<4286> <7b6f>\n<4287> <7c01>\n<4288> <7c33>\n<4289> <d857dda1>\n<428a> <7c6d>\n<428b> <7c79>\n<428c> <7c8f>\n<428d> <7c94>\n<428e> <7ca0>\nendbfchar\n\n100 beginbfchar\n<428f> <7cd5>\n<4290> <7d31>\n<4291> <7d5c>\n<4292> <7d83>\n<4293> <7da6>\n<4294> <7dc2>\n<4295> <7e28>\n<4296> <7f97>\n<4297> <7fdb>\n<4298> <8035>\n<4299> <8037>\n<429a> <80ca>\n<429b> <80e0>\n<429c> <80f3>\n<429d> <8160>\n<42a0> <816d>\n<42a1> <81bb>\n<42a2> <81ca>\n<42a3> <81d7>\n<42a4> <445b>\n<42a5> <8260>\n<42a6> <8274>\n<42a7> <d85adeff>\n<42a8> <82a1>\n<42ab> <82a9>\n<42ac> <82bf>\n<42ad> <82d5>\n<42ae> <82fd>\n<42af> <8300>\n<42b0> <8322>\n<42b1> <832d>\n<42b2> <833a>\n<42b3> <8347>\n<42b4> <837d>\n<42b5> <83a7>\n<42b6> <83cf>\n<42b7> <83d1>\n<42b8> <83e1>\n<42b9> <8401>\n<42ba> <8406>\n<42bb> <845f>\n<42bc> <8470>\n<42bd> <8473>\n<42be> <8485>\n<42bf> <849e>\n<42c0> <84ba>\n<42c1> <d85bde40>\n<42c2> <8532>\n<42c3> <851e>\n<42c4> <852f>\n<42c5> <8564>\n<42c6> <857a>\n<42c7> <858c>\n<42c8> <85a2>\n<42c9> <85cb>\n<42ca> <85ed>\n<42cb> <85ff>\n<42ce> <8610>\n<42cf> <d85cdcf4>\n<42d0> <8618>\n<42d1> <8638>\n<42d2> <8657>\n<42d3> <8662>\n<42d4> <459d>\n<42d5> <8675>\n<42d6> <86b8>\n<42d7> <86fc>\n<42d8> <8787>\n<42d9> <45ea>\n<42da> <880a>\n<42db> <8810>\n<42dc> <88ce>\n<42dd> <d85dde84>\n<42de> <8932>\n<42df> <8939>\n<42e0> <8940>\n<42e1> <8994>\n<42e2> <89f6>\n<42e3> <8a47>\n<42e4> <8a5d>\n<42e5> <8a61>\n<42e6> <8a75>\n<42e7> <8ad0>\n<42e8> <8b46>\n<42e9> <8b59>\n<42ea> <8b69>\n<42eb> <8b9d>\n<42ec> <8c49>\n<42ed> <8c68>\n<42ee> <8daf>\n<42ef> <8dd1>\n<42f0> <8dd7>\n<42f1> <8e23>\n<42f2> <8e3d>\n<42f3> <8e7b>\n<42f4> <d860de77>\n<42f5> <4844>\n<42f6> <8efa>\n<42f7> <8f1e>\n<42f8> <8f2d>\nendbfchar\n\n100 beginbfchar\n<42f9> <8f54>\n<42fa> <d860dfcd>\n<42fb> <8fe8>\n<42fc> <8fee>\n<42fd> <9008>\n<42fe> <902d>\n<42ff> <9097>\n<4300> <90b3>\n<4301> <90be>\n<4304> <90c7>\n<4305> <90ef>\n<4306> <9114>\n<4307> <9116>\n<430a> <912f>\n<430b> <9134>\n<430c> <9183>\n<430d> <91f1>\n<430e> <9349>\n<4311> <93a3>\n<4312> <93df>\n<4313> <9404>\n<4314> <9433>\n<4315> <944a>\n<4316> <9463>\n<4317> <9471>\n<4318> <958e>\n<4319> <959f>\n<431a> <95ac>\n<431b> <95b6>\n<431c> <95cb>\n<431d> <95d0>\n<431e> <95d3>\n<431f> <49b0>\n<4320> <95de>\n<4321> <96a5>\n<4322> <96ef>\n<4323> <974e>\n<4324> <9795>\n<4325> <97ae>\n<4326> <97ba>\n<4327> <97c1>\n<4328> <97c9>\n<4329> <97db>\n<432a> <9856>\n<432b> <98e7>\n<432c> <9958>\n<432d> <9a03>\n<432e> <9ac1>\n<432f> <9ac3>\n<4330> <9ace>\n<4331> <9ad6>\n<4332> <9b02>\n<4333> <9b08>\n<4334> <4c17>\n<4335> <9b2d>\n<4336> <9b5e>\n<4337> <9b66>\n<4338> <9b84>\n<4339> <9b8a>\n<433a> <9b9e>\n<433b> <9bce>\n<433c> <9be5>\n<433d> <9bf8>\n<433e> <9c23>\n<4341> <9c65>\n<4344> <9d43>\n<4345> <9d52>\n<4346> <9d8a>\n<4347> <9d96>\n<4348> <9dc0>\n<4349> <9dac>\n<434a> <9dbc>\n<434b> <d868dd90>\n<434c> <9de7>\n<434d> <9e07>\n<434e> <9e9e>\n<434f> <9eaf>\n<4350> <9f97>\n<4351> <d840dc89>\n<4352> <4e02>\n<4353> <4e0f>\n<4354> <4e12>\n<4355> <4e29>\n<4356> <4e2e>\n<4357> <4e47>\n<4358> <d840dca2>\n<4359> <4e51>\n<435a> <3406>\n<435b> <d840dca4>\n<435c> <4e69>\n<435d> <4e9d>\n<435e> <342c>\n<435f> <4ebc>\n<4360> <4ec3>\n<4361> <4ec8>\n<4362> <4eeb>\n<4363> <4eda>\n<4364> <4ef1>\n<4365> <4ef5>\n<4366> <4f16>\nendbfchar\n\n100 beginbfchar\n<4367> <4f64>\n<4368> <4f37>\n<4369> <4f3e>\n<436a> <4f58>\n<436b> <d840de13>\n<436e> <4f82>\n<436f> <4f85>\n<4370> <4fe6>\n<4371> <4fb2>\n<4372> <4fc5>\n<4373> <4fcb>\n<4374> <4fd2>\n<4375> <346a>\n<4376> <4ff2>\n<4377> <5013>\n<4378> <501c>\n<4379> <504e>\n<437a> <5053>\n<437b> <5063>\n<437c> <50a3>\n<437d> <5088>\n<4380> <5095>\n<4381> <50aa>\n<4382> <d840df2b>\n<4383> <50b1>\n<4386> <50c4>\n<4387> <50c7>\n<4388> <50f3>\n<4389> <d840df81>\n<438a> <50ce>\n<438b> <d840df71>\n<438c> <50d4>\n<438d> <50e1>\n<438e> <3492>\n<438f> <d840dff9>\n<4390> <5117>\n<4391> <d841dc4a>\n<4392> <5160>\n<4393> <d841dd09>\n<4394> <5173>\n<4395> <5183>\n<4396> <518b>\n<4397> <34bc>\n<4398> <5198>\n<4399> <51a3>\n<439a> <51ad>\n<439b> <34c7>\n<439c> <d841ddd6>\n<439d> <51f3>\n<439e> <5212>\n<439f> <5216>\n<43a0> <d841df4f>\n<43a1> <5255>\n<43a2> <525c>\n<43a3> <526c>\n<43a4> <5277>\n<43a5> <5284>\n<43a6> <5282>\n<43a7> <d842dc07>\n<43a8> <5298>\n<43a9> <d842dc3a>\n<43aa> <52a4>\n<43ad> <52ca>\n<43ae> <52d1>\n<43af> <d842dcb9>\n<43b0> <52f7>\n<43b1> <5335>\n<43b2> <5342>\n<43b3> <d842dd7c>\n<43b4> <d842dd9d>\n<43b5> <5367>\n<43b6> <537a>\n<43b7> <53a4>\n<43b8> <53b4>\n<43b9> <d842ded3>\n<43ba> <53b7>\n<43bb> <53c0>\n<43bc> <d842df1d>\n<43bf> <53d5>\n<43c0> <3563>\n<43c1> <53f4>\n<43c2> <5424>\n<43c3> <5428>\n<43c4> <356e>\n<43c5> <5443>\n<43c6> <5462>\n<43c7> <546c>\n<43c8> <5495>\n<43c9> <54a0>\n<43ca> <54a6>\n<43cb> <54ae>\n<43cc> <54b7>\n<43cd> <54ba>\n<43ce> <54c3>\n<43cf> <d843dd45>\n<43d0> <54ec>\n<43d1> <54ef>\n<43d2> <54f1>\n<43d3> <54f3>\n<43d6> <5509>\nendbfchar\n\n100 beginbfchar\n<43d7> <553c>\n<43d8> <5541>\n<43d9> <35a6>\n<43da> <5547>\n<43db> <35a8>\n<43dc> <5564>\n<43dd> <d843dde1>\n<43de> <557d>\n<43df> <5582>\n<43e0> <5591>\n<43e1> <35c5>\n<43e2> <55d2>\n<43e3> <d843de95>\n<43e4> <d843de6d>\n<43e5> <55bf>\n<43e6> <55c9>\n<43e7> <55cc>\n<43e8> <55d1>\n<43e9> <55dd>\n<43ea> <35da>\n<43eb> <55e2>\n<43ec> <d843de64>\n<43ed> <55e9>\n<43ee> <5628>\n<43ef> <d843df5f>\n<43f0> <5607>\n<43f1> <5610>\n<43f2> <5630>\n<43f3> <35f4>\n<43f4> <563d>\n<43f5> <5640>\n<43f6> <5647>\n<43f7> <565e>\n<43f8> <5660>\n<43f9> <566d>\n<43fa> <3605>\n<43fb> <5688>\n<43fc> <568c>\n<43fd> <569d>\n<43fe> <56a8>\n<43ff> <56b2>\n<4400> <56c5>\n<4401> <56cd>\n<4402> <56df>\n<4403> <56e8>\n<4406> <d844de01>\n<4407> <d844de55>\n<4408> <5729>\n<4409> <d844de7b>\n<440c> <574d>\n<440d> <d844de74>\n<440e> <5768>\n<440f> <576f>\n<4413> <577b>\n<4414> <d844dee4>\n<4415> <d844ded7>\n<4416> <579a>\n<4419> <57a8>\n<441a> <57d7>\n<441b> <d844defd>\n<441c> <57cc>\n<441d> <d844df36>\n<441e> <d844df44>\n<441f> <57de>\n<4420> <57f0>\n<4421> <364a>\n<4422> <57f8>\n<4423> <57fb>\n<4424> <57fd>\n<4425> <5804>\n<4426> <581e>\n<4427> <5827>\n<4428> <5839>\n<4429> <d844dfc4>\n<442a> <5849>\n<442b> <584c>\n<442c> <5867>\n<442f> <588d>\n<4432> <5894>\n<4433> <589d>\n<4434> <58aa>\n<4435> <58b1>\n<4436> <d845dc6d>\n<4437> <58c3>\n<4438> <58cd>\n<4439> <58e2>\n<443e> <590d>\n<443f> <5914>\n<4440> <d845ddd7>\n<4441> <3691>\n<4442> <593d>\n<4443> <3699>\n<4444> <5946>\n<4445> <3696>\n<4446> <d85bdc29>\n<4447> <595f>\n<4448> <d845de47>\n<444b> <597c>\n<444c> <599f>\n<444d> <59ae>\nendbfchar\n\n100 beginbfchar\n<444e> <59bc>\n<444f> <59c8>\n<4450> <59cd>\n<4451> <59de>\n<4452> <59e7>\n<4453> <59ee>\n<4454> <d845df06>\n<4455> <d845df42>\n<4456> <36cf>\n<4457> <5a0d>\n<4458> <5a17>\n<4459> <5a27>\n<445a> <5a2d>\n<445b> <5a65>\n<445c> <5a7a>\n<445d> <5a8b>\n<445e> <5a9c>\n<4461> <5aa2>\n<4462> <5ab1>\n<4463> <5ab5>\n<4464> <5aba>\n<4465> <5abf>\n<4466> <5ada>\n<4467> <5adc>\n<4468> <5ae5>\n<4469> <5af0>\n<446a> <5aee>\n<446b> <5af5>\n<446c> <5b08>\n<446d> <5b17>\n<446e> <5b34>\n<446f> <5b4c>\n<4470> <5b52>\n<4471> <5b68>\n<4472> <5b6f>\n<4473> <5b81>\n<4474> <5b84>\n<4475> <d846ddc3>\n<4476> <5b96>\n<4477> <5bac>\n<447a> <5bce>\n<447b> <5bd6>\n<447c> <376c>\n<447d> <376b>\n<447e> <5bf1>\n<447f> <5bfd>\n<4480> <3775>\n<4481> <5c03>\n<4482> <5c29>\n<4483> <d847dc56>\n<4484> <5c5f>\n<4487> <5c70>\n<4488> <d847dd2d>\n<4489> <d847dd45>\n<448a> <d847dd78>\n<448b> <d847dd62>\n<448c> <5c88>\n<448d> <5c8a>\n<448e> <37c1>\n<448f> <d847dda1>\n<4490> <d847dd9c>\n<4491> <5ca0>\n<4492> <5ca2>\n<4493> <5ca7>\n<4494> <d847dd92>\n<4495> <5cad>\n<4496> <5cb5>\n<4497> <d847ddb7>\n<4498> <5cc9>\n<4499> <d847dde0>\n<449a> <d847de33>\n<449b> <5d06>\n<449c> <5d10>\n<449d> <5d2b>\n<449e> <5d1d>\n<449f> <5d20>\n<44a0> <5d31>\n<44a1> <5d39>\n<44a2> <37e8>\n<44a3> <5d61>\n<44a4> <5d6a>\n<44a5> <37f4>\n<44a6> <5d70>\n<44a7> <d847df1e>\n<44a8> <37fd>\n<44a9> <5d88>\n<44aa> <3800>\n<44ab> <5d97>\n<44ac> <5db0>\n<44ad> <5db4>\n<44ae> <d847df76>\n<44af> <5dd1>\n<44b0> <5dd7>\n<44b1> <d847dffa>\n<44b2> <5de4>\n<44b3> <5de9>\n<44b4> <382f>\n<44b5> <3836>\n<44b6> <3840>\n<44b7> <5e1f>\nendbfchar\n\n100 beginbfchar\n<44b8> <5e3e>\n<44b9> <5e49>\n<44ba> <385c>\n<44bb> <5e56>\n<44bc> <3861>\n<44bf> <d848dd7b>\n<44c0> <5ea5>\n<44c1> <5eac>\n<44c2> <5eb9>\n<44c3> <5ec6>\n<44c4> <5ed9>\n<44c5> <d848df1e>\n<44c6> <5efd>\n<44c7> <5f08>\n<44c8> <d848dfad>\n<44c9> <5f1e>\n<44ca> <5f47>\n<44cb> <5f63>\n<44cc> <5f72>\n<44cd> <5f7e>\n<44ce> <5f8f>\n<44cf> <5fa2>\n<44d0> <5fc7>\n<44d1> <5fcb>\n<44d5> <5fe2>\n<44d8> <5ff3>\n<44d9> <3917>\n<44da> <6022>\n<44db> <6024>\n<44dc> <391a>\n<44dd> <604c>\n<44de> <6095>\n<44df> <60a8>\n<44e0> <d849def3>\n<44e1> <60b1>\n<44e2> <60be>\n<44e3> <60c8>\n<44e4> <60d9>\n<44e5> <60ee>\n<44e6> <60f5>\n<44e7> <6110>\n<44e8> <6119>\n<44e9> <611e>\n<44ea> <613a>\n<44eb> <396f>\n<44ec> <6141>\n<44ed> <6146>\n<44ee> <6160>\n<44ef> <d84adc5b>\n<44f2> <6197>\n<44f3> <61a5>\n<44f4> <61ad>\n<44f5> <d84adcab>\n<44f6> <61d5>\n<44f7> <61dd>\n<44f8> <61f5>\n<44f9> <d84add8f>\n<44fa> <6223>\n<44fb> <6252>\n<44fc> <6261>\n<44fd> <6264>\n<44fe> <627b>\n<44ff> <626d>\n<4500> <6273>\n<4501> <6299>\n<4502> <62d5>\n<4503> <d84adeb8>\n<4504> <62fd>\n<4505> <6303>\n<4506> <6310>\n<4509> <6332>\n<450a> <6335>\n<450d> <6341>\n<450e> <6344>\n<450f> <634e>\n<4510> <d84adf46>\n<4511> <6359>\n<4512> <d84bdc1d>\n<4513> <d84adfa6>\n<4514> <636c>\n<4515> <6399>\n<4516> <d84bdc24>\n<4517> <6394>\n<4518> <63bd>\n<451b> <63e0>\n<451e> <63f2>\n<451f> <641e>\n<4520> <6425>\n<4521> <6429>\n<4522> <642f>\n<4523> <645a>\n<4524> <645d>\n<4525> <6473>\n<4526> <647d>\n<4527> <6487>\n<4528> <6491>\n<4529> <649f>\n<452c> <64d5>\n<452d> <64d7>\n<452e> <d84bdde1>\nendbfchar\n\n100 beginbfchar\n<452f> <64e4>\n<4530> <64ff>\n<4531> <3a6e>\n<4532> <650f>\n<4533> <6514>\n<4534> <3a73>\n<4535> <651e>\n<4536> <6532>\n<4537> <6544>\n<4538> <6554>\n<4539> <656b>\n<453a> <657a>\n<453b> <6584>\n<453c> <658a>\n<453d> <65b2>\n<453e> <65b5>\n<453f> <65b8>\n<4540> <65bf>\n<4541> <65c9>\n<4542> <65d4>\n<4543> <3ad6>\n<4544> <65f9>\n<4545> <65fc>\n<4546> <6604>\n<4547> <6608>\n<4548> <6621>\n<4549> <662a>\n<454a> <6645>\n<454b> <6651>\n<454c> <664e>\n<454d> <3aea>\n<454e> <d84cddc3>\n<454f> <d84cddf5>\n<4550> <d84cddb6>\n<4551> <666a>\n<4554> <667b>\n<4555> <6680>\n<4556> <6690>\n<4557> <6692>\n<4558> <3b0e>\n<4559> <66ad>\n<455a> <66b1>\n<455b> <66b5>\n<455c> <3b1a>\n<455d> <3b1c>\n<455e> <3ad7>\n<455f> <6701>\n<4560> <6712>\n<4561> <d84cdf72>\n<4562> <6719>\n<4563> <d84cdfd3>\n<4564> <d84cdfd2>\n<4565> <674d>\n<4566> <6754>\n<4567> <675d>\n<4568> <d84cdfd0>\n<4569> <d84cdfe4>\n<456a> <d84cdfd5>\n<456b> <6774>\n<456c> <d84cdfda>\n<456d> <6792>\n<456e> <d84cdfdf>\n<456f> <8363>\n<4570> <6810>\n<4571> <67c3>\n<4572> <67c8>\n<4573> <67d2>\n<4574> <67db>\n<4575> <67f7>\n<4576> <d84ddc4a>\n<4577> <d84ddc51>\n<4578> <d84ddc4b>\n<4579> <6818>\n<457a> <681f>\n<457b> <682d>\n<457c> <d84ddc65>\n<457d> <6833>\n<457e> <683b>\n<457f> <683e>\n<4580> <6845>\n<4581> <6849>\n<4582> <684c>\n<4583> <6855>\n<4584> <6857>\n<4585> <3b77>\n<4586> <686b>\n<4587> <686e>\n<4588> <687c>\n<4589> <6882>\n<458a> <6890>\n<458b> <6896>\n<458c> <3b6d>\n<4590> <689c>\n<4593> <68b4>\n<4594> <68bb>\n<4595> <68fb>\n<4596> <d84ddce4>\n<4597> <d84ddd5a>\n<4598> <68c3>\n<4599> <68c5>\nendbfchar\n\n100 beginbfchar\n<459a> <68cc>\n<459b> <68d9>\n<459e> <68ec>\n<459f> <68f7>\n<45a0> <6903>\n<45a1> <6907>\n<45a2> <3b87>\n<45a3> <d84ddd94>\n<45a4> <3b8d>\n<45a5> <6946>\n<45a6> <6969>\n<45a7> <696c>\n<45a8> <697a>\n<45a9> <6992>\n<45aa> <3ba4>\n<45ab> <6996>\n<45ac> <69b0>\n<45ad> <69ba>\n<45ae> <69bc>\n<45af> <69c0>\n<45b0> <69d1>\n<45b1> <d84dde39>\n<45b2> <d84dde47>\n<45b3> <d84dde38>\n<45b4> <69e3>\n<45b7> <69f3>\n<45b8> <3bcd>\n<45b9> <69f4>\n<45ba> <69fe>\n<45bb> <6a11>\n<45bc> <6a1a>\n<45bd> <6a1d>\n<45be> <d84ddf1c>\n<45c1> <6a3f>\n<45c2> <6a49>\n<45c3> <6a7a>\n<45c4> <6a4e>\n<45c5> <6a52>\n<45c6> <6a64>\n<45c7> <d84ddf0c>\n<45c8> <6a8b>\n<45c9> <3bf0>\n<45ca> <6aa1>\n<45cb> <d84ddf64>\n<45cc> <6aab>\n<45cd> <6abd>\n<45ce> <6ac6>\n<45cf> <6ad4>\n<45d0> <6ad0>\n<45d1> <6add>\n<45d2> <d84ddfff>\n<45d3> <d84ddfe7>\n<45d7> <6afd>\n<45d8> <d84edc24>\n<45d9> <6b0b>\n<45dd> <d84edc3d>\n<45de> <6b17>\n<45df> <3c26>\n<45e0> <6b2f>\n<45e1> <6b4a>\n<45e2> <6b58>\n<45e3> <6b6c>\n<45e4> <6b75>\n<45e5> <6b7a>\n<45e6> <6b81>\n<45e7> <6b9b>\n<45e8> <6bae>\n<45e9> <d84ede98>\n<45ea> <6bbd>\n<45ee> <6bda>\n<45f1> <6bee>\n<45f2> <6c02>\n<45f3> <6c0a>\n<45f4> <6c0e>\n<45f5> <6c36>\n<45f6> <d84fdc7f>\n<45f7> <6c4d>\n<45f8> <6c5b>\n<45f9> <6c6d>\n<45fa> <6c84>\n<45fb> <6c89>\n<45fc> <3cc3>\n<45fd> <6c94>\n<45fe> <6c97>\n<45ff> <6cad>\n<4600> <6cc2>\n<4601> <3cd2>\n<4602> <6cdc>\n<4603> <6ce9>\n<4604> <6ced>\n<4605> <d84fdd00>\n<4606> <6d00>\n<4607> <6d24>\n<460a> <6c67>\n<460b> <6d2f>\n<460c> <6d3c>\n<460d> <6d5b>\n<460e> <6d60>\n<460f> <6d70>\n<4612> <6d8a>\nendbfchar\n\n100 beginbfchar\n<4613> <6d8d>\n<4614> <6d91>\n<4615> <6d98>\n<4616> <d84fdd40>\n<4617> <d84fddfa>\n<4618> <d84fddf9>\n<4619> <d84fddd3>\n<461a> <6dab>\n<461b> <6dae>\n<461c> <6db4>\n<461d> <6dc2>\n<461e> <6d34>\n<461f> <6dc8>\n<4620> <6dce>\n<4621> <6ddf>\n<4622> <6df6>\n<4623> <6e36>\n<4624> <6e1e>\n<4625> <3d11>\n<4626> <6e32>\n<462b> <6e4f>\n<462e> <6e57>\n<462f> <6e63>\n<4630> <3d1e>\n<4631> <6e93>\n<4632> <6ea7>\n<4633> <6eb4>\n<4634> <6ec3>\n<4635> <6f35>\n<4636> <6eeb>\n<4637> <6ef9>\n<4638> <6efb>\n<4639> <6f0a>\n<463a> <6f0c>\n<463b> <6f18>\n<463c> <6f25>\n<463d> <6f36>\n<463e> <6f3c>\n<463f> <d84fdf7e>\n<4640> <6f52>\n<4641> <6f57>\n<4642> <6f60>\n<4643> <6f68>\n<4644> <6f90>\n<4645> <6f96>\n<4646> <6fbe>\n<4647> <6f9f>\n<4648> <6fa5>\n<4649> <6faf>\n<464a> <3d64>\n<464d> <6fe9>\n<464e> <d850dc96>\n<464f> <6ffc>\n<4650> <7000>\n<4651> <700a>\n<4652> <7023>\n<4653> <d850dd03>\n<4654> <703a>\n<4655> <7043>\n<4656> <7047>\n<4657> <704b>\n<4658> <3d9a>\n<4659> <7065>\n<465a> <7069>\n<465b> <706e>\n<465c> <7076>\n<465d> <7086>\n<465e> <7097>\n<465f> <d850ddc6>\n<4660> <709f>\n<4661> <70b1>\n<4662> <d850ddfe>\n<4663> <70ec>\n<4664> <70ca>\n<4665> <70d1>\n<4666> <7103>\n<4667> <7106>\n<4668> <7108>\n<4669> <710c>\n<466a> <3dc0>\n<466b> <712f>\n<466c> <7150>\n<466d> <7153>\n<466e> <715e>\n<466f> <3dd4>\n<4670> <7196>\n<4671> <7180>\n<4672> <719b>\n<4673> <71a0>\n<4674> <71a2>\n<4677> <d850dfbc>\n<4678> <71d9>\n<4679> <71dc>\n<467a> <7207>\n<467b> <3e05>\n<467c> <7234>\n<467d> <7239>\n<467e> <7242>\n<467f> <7257>\n<4680> <7263>\nendbfchar\n\n100 beginbfchar\n<4681> <d851de29>\n<4684> <7278>\n<4685> <727f>\n<4686> <728e>\n<4687> <d851dea5>\n<4688> <72ae>\n<4689> <72b0>\n<468a> <72c1>\n<468b> <3e60>\n<468c> <72cc>\n<468d> <3e66>\n<468e> <3e68>\n<468f> <72f3>\n<4690> <72fa>\n<4691> <7307>\n<4692> <7312>\n<4695> <3e83>\n<4696> <7339>\n<4697> <732c>\n<4698> <7333>\n<4699> <733d>\n<469a> <7352>\n<469b> <3e94>\n<469c> <736b>\n<469d> <d852dc96>\n<46a0> <7371>\n<46a1> <7381>\n<46a2> <738a>\n<46a3> <7394>\n<46a4> <7398>\n<46a5> <739c>\n<46a6> <73a5>\n<46a7> <73b9>\n<46a8> <73bf>\n<46a9> <73c5>\n<46aa> <73cb>\n<46ab> <73e1>\n<46ac> <73e7>\n<46ad> <73f9>\n<46ae> <7413>\n<46af> <73fa>\n<46b0> <7401>\n<46b1> <7453>\n<46b2> <7440>\n<46b3> <7443>\n<46b4> <7452>\n<46b5> <745d>\n<46b6> <7481>\n<46b7> <7488>\n<46b8> <d852de4d>\n<46b9> <7492>\n<46ba> <7497>\n<46bb> <7499>\n<46bc> <74a1>\n<46bd> <74a5>\n<46be> <74aa>\n<46bf> <74b9>\n<46c0> <74bb>\n<46c1> <74ba>\n<46c2> <74d6>\n<46c3> <74d8>\n<46c4> <74eb>\n<46c5> <d852df56>\n<46c6> <74fa>\n<46c7> <d852df6f>\n<46c8> <7520>\n<46c9> <7524>\n<46ca> <752a>\n<46cb> <3f57>\n<46cc> <d853dc16>\n<46cf> <7540>\n<46d0> <7548>\n<46d1> <7550>\n<46d2> <7552>\n<46d3> <7572>\n<46d4> <7571>\n<46d5> <757a>\n<46d8> <758c>\n<46d9> <3f75>\n<46da> <75a2>\n<46db> <3f77>\n<46dc> <75b0>\n<46dd> <75b7>\n<46e0> <75c6>\n<46e1> <75cf>\n<46e2> <75d3>\n<46e3> <75dd>\n<46e6> <75e7>\n<46e7> <75ee>\n<46e8> <75f1>\n<46e9> <7603>\n<46ea> <7618>\n<46eb> <7607>\n<46ec> <760f>\n<46ed> <3fae>\n<46ee> <d853de0e>\n<46ef> <7613>\n<46f2> <d853de37>\n<46f3> <7625>\n<46f4> <7628>\nendbfchar\n\n100 beginbfchar\n<46f5> <763c>\n<46f6> <7633>\n<46f7> <d853de6a>\n<46f8> <3fc9>\n<46f9> <7641>\n<46fa> <d853de8b>\n<46fb> <7649>\n<46fc> <7655>\n<46fd> <3fd7>\n<46fe> <766e>\n<46ff> <7695>\n<4700> <76a1>\n<4701> <76a0>\n<4704> <76af>\n<4705> <d854dc4a>\n<4706> <76c9>\n<4707> <d854dc55>\n<4708> <76e8>\n<4709> <d854dd22>\n<470a> <7717>\n<470b> <771a>\n<470c> <772d>\n<470d> <7735>\n<470e> <d854dda9>\n<470f> <4039>\n<4710> <d854dde5>\n<4711> <d854ddcd>\n<4712> <7758>\n<4713> <d854de1e>\n<4714> <777c>\n<4715> <d854de4c>\n<4716> <4058>\n<4717> <779a>\n<4718> <779f>\n<4719> <77a2>\n<471a> <77a4>\n<471d> <77e4>\n<471e> <77ea>\n<471f> <77ec>\n<4720> <77fb>\n<4721> <d855dc2e>\n<4722> <7805>\n<4723> <7809>\n<4724> <780d>\n<4725> <7819>\n<4726> <782c>\n<4727> <7847>\n<4728> <786a>\n<4729> <d855dcd9>\n<472a> <788a>\n<472b> <7894>\n<472c> <78a4>\n<472d> <789d>\n<472e> <789f>\n<472f> <78bb>\n<4730> <78d5>\n<4731> <78e6>\n<4734> <78fe>\n<4735> <d855dda7>\n<4736> <7910>\n<4737> <791b>\n<4738> <7925>\n<4739> <794a>\n<473a> <7958>\n<473b> <4105>\n<473c> <7967>\n<473d> <7972>\n<473e> <7995>\n<473f> <79a1>\n<4740> <79a9>\n<4741> <79b4>\n<4742> <79c2>\n<4743> <79c7>\n<4746> <79d6>\n<4747> <4148>\n<4748> <d855dfa9>\n<4749> <d855dfb4>\n<474a> <414f>\n<474b> <7a0a>\n<474c> <7a15>\n<474d> <7a1b>\n<474e> <4163>\n<474f> <7a38>\n<4750> <7a47>\n<4751> <7a56>\n<4752> <7a59>\n<4753> <7a5c>\n<4754> <7a5f>\n<4755> <7a67>\n<4756> <7a6a>\n<4757> <7a75>\n<4758> <7a82>\n<4759> <7a8a>\n<475a> <7a90>\n<475b> <7aac>\n<475c> <d856ddd4>\n<475d> <41b4>\n<475e> <7ab9>\n<475f> <7abe>\n<4760> <41bf>\nendbfchar\n\n100 beginbfchar\n<4761> <7acc>\n<4762> <7ae8>\n<4763> <7af4>\n<4764> <d856dee4>\n<4765> <d856dee3>\n<4766> <d856def1>\n<4767> <7b3d>\n<4768> <7b2a>\n<476b> <41e6>\n<476c> <41f3>\n<476d> <7b7f>\n<476e> <7b41>\n<476f> <41ee>\n<4770> <7b55>\n<4771> <7b79>\n<4772> <7b64>\n<4773> <7b66>\n<4774> <7b73>\n<4775> <d856dfb2>\n<4776> <4207>\n<4777> <7b90>\n<4778> <7b9b>\n<4779> <420e>\n<477a> <7bb5>\n<477b> <7bbc>\n<477c> <7bc5>\n<477d> <7bca>\n<477e> <d857dc4b>\n<477f> <d857dc64>\n<4780> <7bd4>\n<4781> <7bd6>\n<4782> <7bda>\n<4783> <7bea>\n<4784> <7bf0>\n<4785> <7c03>\n<4786> <7c0e>\n<4787> <7c45>\n<4788> <7c4a>\n<4789> <7c57>\n<478a> <7c5e>\n<478b> <7c61>\n<478c> <7c69>\n<478d> <7c6f>\n<478e> <d857de2e>\n<478f> <d857de56>\n<4790> <d857de65>\n<4791> <7ca6>\n<4792> <d857de62>\n<4795> <d857ded8>\n<4796> <7cc4>\n<4797> <d857dec2>\n<4798> <7ccd>\n<4799> <d857dee8>\n<479a> <d857df23>\n<479b> <7ce6>\n<479c> <d857df5c>\n<479d> <7cf5>\n<479e> <7d03>\n<479f> <42c6>\n<47a0> <7d12>\n<47a1> <7d1e>\n<47a2> <d857dfe0>\n<47a3> <d857dfd4>\n<47a6> <7d40>\n<47a7> <7d47>\n<47a8> <d858dc0c>\n<47a9> <d857dffb>\n<47aa> <42d6>\n<47ab> <7d5a>\n<47ac> <7d6a>\n<47ad> <7d70>\n<47ae> <42dd>\n<47af> <7d7f>\n<47b0> <d858dc17>\n<47b1> <7d88>\n<47b2> <7d97>\n<47b3> <d858dc60>\n<47b4> <7d9d>\n<47b5> <7da7>\n<47b6> <7daa>\n<47b7> <7db6>\n<47b8> <7dc0>\n<47b9> <7dd7>\n<47ba> <7dd9>\n<47bb> <7de6>\n<47bc> <4302>\n<47bd> <d858dced>\n<47be> <fa58>\n<47bf> <7e10>\n<47c0> <7e17>\n<47c1> <7e1d>\n<47c2> <7e27>\n<47c3> <7e2c>\n<47c4> <7e45>\n<47c5> <7e75>\n<47c6> <7e7e>\n<47c9> <432b>\n<47ca> <7e9a>\n<47cb> <4343>\n<47cc> <7f3c>\nendbfchar\n\n100 beginbfchar\n<47cd> <7f3b>\n<47ce> <7f3e>\n<47cf> <7f43>\n<47d0> <34c1>\n<47d1> <d858de70>\n<47d2> <d858de86>\n<47d5> <7f6d>\n<47d8> <7f90>\n<47d9> <517b>\n<47da> <d84fdd0e>\n<47db> <7f96>\n<47dc> <7f9c>\n<47dd> <7fad>\n<47de> <d859dc02>\n<47df> <7fc3>\n<47e0> <7fcf>\n<47e1> <7fe3>\n<47e2> <7ff2>\n<47e3> <800a>\n<47e4> <8008>\n<47e5> <8016>\n<47e6> <802c>\n<47e7> <8030>\n<47e8> <8043>\n<47e9> <8066>\n<47ea> <807b>\n<47eb> <8099>\n<47ec> <809c>\n<47ed> <80a4>\n<47ee> <80a7>\n<47ef> <80b8>\n<47f0> <d859de7e>\n<47f1> <80c5>\n<47f2> <80d5>\n<47f3> <80e6>\n<47f4> <810d>\n<47f5> <80f5>\n<47f6> <80fb>\n<47f7> <43ee>\n<47f8> <8135>\n<47f9> <811e>\n<47fa> <43f0>\n<47fb> <8124>\n<47fc> <8127>\n<47fd> <812c>\n<47fe> <d859df1d>\n<47ff> <813d>\n<4800> <4408>\n<4801> <8169>\n<4802> <4417>\n<4803> <441c>\n<4804> <8185>\n<4805> <4422>\n<4806> <8198>\n<4807> <81b2>\n<4808> <81c1>\n<4809> <81c3>\n<480a> <81d6>\n<480b> <81db>\n<480c> <d85adcdd>\n<480d> <81e4>\n<480e> <d85adcea>\n<480f> <81ec>\n<4810> <81fd>\n<4811> <81ff>\n<4812> <d85add6f>\n<4813> <8204>\n<4814> <d85adddd>\n<4815> <8219>\n<4816> <8222>\n<4817> <d85ade1e>\n<4818> <823c>\n<4819> <8249>\n<481a> <8245>\n<481b> <d85ade58>\n<481c> <4476>\n<481d> <447a>\n<481e> <8257>\n<481f> <d85ade8c>\n<4820> <825c>\n<4821> <8263>\n<4822> <d85adeb7>\n<4823> <4491>\n<4824> <827d>\n<4825> <827f>\n<4826> <8283>\n<4827> <828a>\n<4828> <8293>\n<482b> <82b2>\n<482c> <82b4>\n<482d> <82ba>\n<482e> <82bc>\n<482f> <82e2>\n<4830> <82e8>\n<4831> <82f7>\n<4834> <830c>\n<4835> <8354>\n<4836> <831b>\n<4837> <831d>\n<4838> <8330>\nendbfchar\n\n100 beginbfchar\n<4839> <833c>\n<483a> <8344>\n<483b> <8357>\n<483c> <44be>\n<483d> <44d4>\n<483e> <44b3>\n<4841> <839b>\n<4842> <839d>\n<4843> <83c9>\n<4844> <83d0>\n<4845> <83d4>\n<4846> <83dd>\n<4847> <83e5>\n<4848> <83f9>\n<4849> <8415>\n<484a> <d85bdc73>\n<484b> <8417>\n<484c> <8439>\n<484d> <844f>\n<4852> <845c>\n<4853> <d85bdcdd>\n<4854> <8465>\n<4855> <8478>\n<4856> <847c>\n<4857> <8481>\n<4858> <450d>\n<4859> <8497>\n<485a> <84a6>\n<485b> <84be>\n<485c> <4508>\n<485f> <84d3>\n<4860> <d85bde65>\n<4861> <84e7>\n<4862> <84ea>\n<4863> <84ef>\n<4864> <84f1>\n<4865> <84fa>\n<4866> <851b>\n<4869> <852b>\n<486a> <854f>\n<486b> <856f>\n<486c> <4543>\n<486d> <8551>\n<4870> <d85bdf94>\n<4871> <857b>\n<4872> <857d>\n<4873> <857f>\n<4874> <8581>\n<4875> <8586>\n<4876> <8593>\n<4877> <859d>\n<4878> <859f>\n<4879> <d85bdff8>\n<487c> <85bc>\n<487d> <85c7>\n<487e> <85ca>\n<4881> <85df>\n<4882> <85e1>\n<4883> <85e6>\n<4884> <85f6>\n<4885> <8600>\n<4886> <8611>\n<4887> <861e>\n<4888> <8621>\n<4889> <8624>\n<488a> <8627>\n<488b> <d85cdd0d>\n<488c> <8639>\n<488d> <863c>\n<488e> <d85cdd39>\n<488f> <8640>\n<4890> <8653>\n<4891> <8656>\n<4892> <8677>\n<4893> <8687>\n<4894> <8689>\n<4897> <86b1>\n<4898> <86b3>\n<4899> <86c1>\n<489a> <86c3>\n<489b> <86d1>\n<489c> <86d5>\n<489d> <86d7>\n<489e> <86e3>\n<489f> <86e6>\n<48a0> <45b8>\n<48a1> <8705>\n<48a2> <8707>\n<48a3> <870e>\n<48a4> <8710>\n<48a5> <871f>\n<48a6> <8721>\n<48a7> <8723>\n<48a8> <8731>\n<48a9> <873a>\n<48aa> <8740>\n<48ab> <8743>\n<48ac> <8751>\n<48ad> <8758>\n<48b0> <8772>\nendbfchar\n\n100 beginbfchar\n<48b1> <877c>\n<48b2> <d85cdfdb>\n<48b3> <d85cdfda>\n<48b4> <87a7>\n<48b5> <8789>\n<48b6> <878b>\n<48b7> <8793>\n<48b8> <87a0>\n<48b9> <d85cdffe>\n<48ba> <45e5>\n<48bb> <87be>\n<48bc> <d85ddc10>\n<48bd> <87c1>\n<48be> <87ce>\n<48bf> <87df>\n<48c0> <d85ddc49>\n<48c1> <87e3>\n<48c4> <87ea>\n<48c5> <8813>\n<48c6> <8828>\n<48c7> <882e>\n<48c8> <8832>\n<48c9> <883c>\n<48ca> <460f>\n<48cb> <884a>\n<48cc> <8858>\n<48cd> <d85dde15>\n<48ce> <d85dde14>\n<48cf> <8869>\n<48d0> <d85dde31>\n<48d1> <886f>\n<48d2> <88a0>\n<48d3> <88bc>\n<48d4> <88c0>\n<48d5> <d85dde93>\n<48d6> <88d1>\n<48d7> <88d3>\n<48d8> <4641>\n<48d9> <8901>\n<48da> <d85ddf0e>\n<48db> <8937>\n<48dc> <d85ddf23>\n<48dd> <8942>\n<48de> <8945>\n<48df> <8949>\n<48e0> <d85ddf52>\n<48e1> <8962>\n<48e2> <8989>\n<48e3> <8990>\n<48e4> <899f>\n<48e5> <89b0>\n<48e6> <89b7>\n<48e7> <89d8>\n<48e8> <89eb>\n<48e9> <46a1>\n<48ea> <89f3>\n<48eb> <89fd>\n<48ec> <89ff>\n<48ed> <46af>\n<48ee> <8a11>\n<48ef> <8a14>\n<48f0> <d85edd85>\n<48f1> <8a21>\n<48f2> <8a35>\n<48f3> <8a3e>\n<48f4> <8a45>\n<48f5> <8a4d>\n<48f6> <8a58>\n<48f7> <8aae>\n<48f8> <8a90>\n<48f9> <8ab7>\n<48fa> <8ad7>\n<48fb> <8afc>\n<48fc> <d85ede84>\n<48fd> <8b0a>\n<48fe> <8b05>\n<48ff> <8b0d>\n<4900> <8b1c>\n<4901> <8b2d>\n<4902> <470c>\n<4903> <8b51>\n<4904> <8b5e>\n<4905> <8b76>\n<4906> <8b81>\n<4907> <8b8b>\n<490a> <8c39>\n<490b> <d85edfb3>\n<490c> <8c3d>\n<490d> <d85edfbe>\n<490e> <d85edfc7>\n<490f> <8c45>\n<4910> <8c4f>\n<4911> <8c57>\n<4912> <8c69>\n<4913> <8c6d>\n<4914> <d85fdcb8>\n<4915> <8c93>\n<4916> <8c92>\n<4917> <8c99>\n<4918> <4764>\nendbfchar\n\n100 beginbfchar\n<4919> <8c9b>\n<491a> <8cd6>\n<491b> <8cd5>\n<491c> <d85fdda0>\n<491d> <8cf1>\n<491e> <d85fde10>\n<491f> <8d09>\n<4920> <8d0e>\n<4921> <8dc8>\n<4922> <8dd9>\n<4923> <8e0c>\n<4924> <47fd>\n<4925> <8dfd>\n<4926> <8e06>\n<4927> <d860dc8a>\n<4928> <8e14>\n<4929> <8e16>\n<492c> <8e27>\n<492d> <d860dcbb>\n<492e> <4816>\n<492f> <8e36>\n<4930> <8e39>\n<4931> <8e54>\n<4932> <8e62>\n<4933> <8e6d>\n<4934> <8e6f>\n<4935> <8e98>\n<4936> <8e9e>\n<4937> <8eb5>\n<4938> <8ebb>\n<4939> <d860de82>\n<493a> <484e>\n<493b> <d860def3>\n<493c> <8f00>\n<493d> <8f08>\n<493e> <8f2b>\n<493f> <8f40>\n<4940> <8f4a>\n<4941> <8f58>\n<4942> <d861dc0c>\n<4943> <8fa4>\n<4944> <8fb4>\n<4945> <d861dc55>\n<4946> <8fc1>\n<4947> <8fc6>\n<4948> <fa24>\n<4949> <8fca>\n<494a> <8fcd>\n<494b> <8fd3>\n<494c> <8fd5>\n<494d> <8ff1>\n<494e> <8ff5>\n<494f> <8ffb>\n<4950> <900c>\n<4951> <9037>\n<4952> <d861dd6b>\n<4953> <9043>\n<4954> <905d>\n<4957> <9085>\n<4958> <908c>\n<4959> <9090>\n<495a> <90a1>\n<495b> <48b5>\n<495c> <90b0>\n<495d> <90b6>\n<495e> <90c3>\n<495f> <90c8>\n<4960> <d861ded7>\n<4961> <90dc>\n<4962> <90df>\n<4963> <d861defa>\n<4964> <90f6>\n<4965> <90f2>\n<4966> <9100>\n<4967> <90eb>\n<496a> <9104>\n<496b> <9106>\n<496c> <9118>\n<496d> <911e>\n<496e> <9137>\n<496f> <9139>\n<4972> <9157>\n<4973> <9159>\n<4974> <9174>\n<4975> <9179>\n<4976> <9185>\n<4977> <91b3>\n<4978> <91b6>\n<497b> <d862dd49>\n<497c> <d862dd46>\n<497d> <91ec>\n<497e> <9201>\n<4981> <d862dd6b>\n<4982> <9242>\n<4983> <924a>\n<4984> <9256>\n<4985> <9261>\n<4986> <9265>\n<4987> <9268>\n<4988> <d862dd88>\nendbfchar\n\n100 beginbfchar\n<498b> <927f>\n<498c> <9289>\n<498d> <928d>\n<498e> <9297>\n<498f> <9299>\n<4990> <929f>\n<4991> <92ab>\n<4994> <92b2>\n<4997> <92c6>\n<4998> <92ce>\n<4999> <92e5>\n<499a> <9311>\n<499b> <d862de1e>\n<499c> <d862de29>\n<499d> <92f7>\n<499e> <9329>\n<499f> <d862de71>\n<49a0> <d862de43>\n<49a1> <9351>\n<49a2> <935a>\n<49a3> <936b>\n<49a4> <9371>\n<49a5> <9373>\n<49a6> <93a1>\n<49a7> <d862de99>\n<49a8> <d862decd>\n<49a9> <9388>\n<49aa> <938b>\n<49ab> <938f>\n<49ac> <939e>\n<49ad> <93f5>\n<49ae> <d862dee4>\n<49af> <d862dedd>\n<49b0> <93f1>\n<49b1> <93c7>\n<49b2> <93dc>\n<49b3> <93e7>\n<49b4> <9409>\n<49b7> <93fb>\n<49b8> <9432>\n<49b9> <943b>\n<49ba> <d862dfc1>\n<49bb> <d862dfef>\n<49bc> <946d>\n<49bd> <946f>\n<49be> <9579>\n<49bf> <9586>\n<49c2> <d863dd10>\n<49c3> <d863dd71>\n<49c4> <95c8>\n<49c5> <d863ddfb>\n<49c6> <d863de1f>\n<49c7> <962c>\n<49ca> <d863de36>\n<49cb> <963c>\n<49cc> <9661>\n<49cd> <d863de89>\n<49ce> <9682>\n<49cf> <d863deeb>\n<49d0> <969a>\n<49d1> <d863df32>\n<49d2> <49e7>\n<49d3> <96b3>\n<49d4> <96ba>\n<49d5> <96bd>\n<49d6> <49fa>\n<49d7> <d863dff8>\n<49d8> <96d8>\n<49d9> <96da>\n<49da> <96dd>\n<49db> <4a04>\n<49dc> <9714>\n<49dd> <9723>\n<49de> <4a29>\n<49df> <9736>\n<49e0> <9741>\n<49e1> <9747>\n<49e2> <9757>\n<49e3> <975b>\n<49e4> <976a>\n<49e5> <d864dea0>\n<49e6> <d864deb1>\n<49e7> <9796>\n<49e8> <979e>\n<49eb> <97be>\n<49ec> <97cc>\n<49ed> <97d1>\n<49ee> <97d4>\n<49ef> <97d8>\n<49f0> <97e1>\n<49f1> <97f1>\n<49f2> <9804>\n<49f3> <980d>\n<49f4> <9814>\n<49f5> <9816>\n<49f6> <4abc>\n<49f7> <d865dc90>\n<49fa> <9825>\n<49fb> <9847>\n<49fc> <9866>\nendbfchar\n\n100 beginbfchar\n<49fd> <98ab>\n<49fe> <98ad>\n<49ff> <98b0>\n<4a00> <d865ddcf>\n<4a01> <98b7>\n<4a04> <98c2>\n<4a05> <98c7>\n<4a06> <98cb>\n<4a07> <98e1>\n<4a08> <98e3>\n<4a09> <98ea>\n<4a0c> <98f3>\n<4a0d> <9908>\n<4a0e> <4b3b>\n<4a0f> <d865def0>\n<4a12> <d865df19>\n<4a16> <d865df50>\n<4a17> <9931>\n<4a1b> <9941>\n<4a1c> <9946>\n<4a1d> <994e>\n<4a1e> <9960>\n<4a1f> <99a3>\n<4a20> <99a6>\n<4a21> <99bd>\n<4a22> <99bf>\n<4a23> <99c3>\n<4a24> <99d4>\n<4a25> <99d9>\n<4a26> <99de>\n<4a27> <d866dcc6>\n<4a28> <99f0>\n<4a29> <99f9>\n<4a2a> <99fc>\n<4a2b> <9a0a>\n<4a2c> <9a11>\n<4a2d> <9a1a>\n<4a2e> <9a20>\n<4a2f> <9a31>\n<4a30> <9a44>\n<4a31> <9a4c>\n<4a32> <9a58>\n<4a33> <4bc2>\n<4a34> <9aaf>\n<4a35> <4bca>\n<4a36> <9ab7>\n<4a37> <4bd2>\n<4a38> <9ab9>\n<4a39> <d866de72>\n<4a3a> <9ac6>\n<4a3b> <9ad0>\n<4a3c> <9ad2>\n<4a3d> <9ad5>\n<4a3e> <9ae0>\n<4a3f> <9ae5>\n<4a40> <9ae9>\n<4a41> <9b0c>\n<4a42> <9b10>\n<4a43> <9b12>\n<4a44> <9b16>\n<4a45> <9b1c>\n<4a46> <9b2b>\n<4a47> <9b3d>\n<4a48> <4c20>\n<4a49> <9b4b>\n<4a4a> <9b63>\n<4a4b> <9b65>\n<4a50> <9ba6>\n<4a51> <9bac>\n<4a52> <d867dddb>\n<4a53> <9bb2>\n<4a54> <9bb8>\n<4a55> <9bbe>\n<4a56> <9bf3>\n<4a57> <9bd8>\n<4a58> <9bdd>\n<4a59> <9bea>\n<4a5a> <9bef>\n<4a5b> <9bee>\n<4a5c> <d867de15>\n<4a5d> <d867de8a>\n<4a5e> <d867de49>\n<4a5f> <9c16>\n<4a63> <9c1d>\n<4a64> <9c22>\n<4a65> <9c29>\n<4a66> <d867dec4>\n<4a67> <9c31>\n<4a68> <9c37>\n<4a69> <9c45>\n<4a6a> <9c5c>\n<4a6b> <d867dee9>\n<4a6e> <d867dedb>\n<4a6f> <9c54>\n<4a70> <9c58>\n<4a71> <9c5b>\n<4a72> <9c5d>\n<4a73> <9c5f>\n<4a79> <9c72>\n<4a7a> <9c75>\nendbfchar\n\n100 beginbfchar\n<4a7b> <9c7a>\n<4a7c> <9ce6>\n<4a7d> <9cf2>\n<4a7e> <9d0b>\n<4a7f> <d867dfd7>\n<4a80> <9d11>\n<4a83> <d868dc2f>\n<4a84> <4cc4>\n<4a85> <d868dc1a>\n<4a86> <9d32>\n<4a87> <4cd1>\n<4a88> <9d4a>\n<4a89> <9d5f>\n<4a8a> <9d62>\n<4a8b> <d868dcf9>\n<4a8c> <d868dc82>\n<4a8d> <9d73>\n<4a90> <9d84>\n<4a91> <9d99>\n<4a92> <9da1>\n<4a93> <9dbf>\n<4a94> <9db5>\n<4a95> <9db9>\n<4a96> <9dbd>\n<4a97> <9dc9>\n<4a98> <9dda>\n<4a99> <9de0>\n<4a9a> <9de3>\n<4a9b> <4d07>\n<4a9c> <9e0a>\n<4a9d> <9e02>\n<4a9e> <9e0d>\n<4a9f> <9e1c>\n<4aa0> <9e7b>\n<4aa1> <d848de18>\n<4aa2> <9e80>\n<4aa3> <9e85>\n<4aa4> <9e9b>\n<4aa5> <d868df8c>\n<4aa6> <9ebd>\n<4aa7> <d869dc37>\n<4aa8> <9edf>\n<4aa9> <9eff>\n<4aaa> <9f02>\n<4aab> <4d77>\n<4aac> <9f03>\n<4aad> <9f3a>\n<4aae> <9f3d>\n<4aaf> <9f46>\n<4ab0> <9f53>\n<4ab1> <9f55>\n<4ab2> <9f58>\n<4ab3> <d869ddf1>\n<4ab4> <9f5d>\n<4ab5> <d869de02>\n<4ab6> <9f69>\n<4ab7> <9f6d>\n<4ab8> <9f70>\n<4ab9> <d869deb2>\n<4aba> <2eac>\n<4abb> <3614>\n<4abc> <38ad>\n<4abd> <3dcc>\n<4abe> <3fdc>\n<4abf> <45be>\n<4ac0> <4610>\n<4ac1> <4b7e>\n<4ac2> <4c38>\n<4ac3> <4ce1>\n<4ac4> <4e0c>\n<4ac7> <4e79>\n<4ac8> <4ef3>\n<4ac9> <4f0c>\n<4aca> <4f19>\n<4acb> <4f2b>\n<4acc> <4f2e>\n<4acd> <4f31>\n<4ace> <4f84>\n<4acf> <4f9e>\n<4ad0> <4fb7>\n<4ad1> <5004>\n<4ad2> <500c>\n<4ad3> <504c>\n<4ad4> <505f>\n<4ad5> <5062>\n<4ad6> <5077>\n<4ad7> <508e>\n<4ad8> <509e>\n<4ad9> <50a2>\n<4ada> <50c3>\n<4adb> <50e8>\n<4adc> <50f1>\n<4add> <50fe>\n<4ade> <5107>\n<4ae2> <5133>\n<4ae3> <5138>\n<4ae4> <5174>\n<4ae5> <5184>\n<4ae6> <51b8>\n<4ae7> <51ba>\nendbfchar\n\n100 beginbfchar\n<4ae8> <51c8>\n<4ae9> <51cf>\n<4aea> <51d1>\n<4aed> <51d8>\n<4aee> <51df>\n<4aef> <5205>\n<4af0> <5226>\n<4af1> <5228>\n<4af2> <522b>\n<4af5> <5235>\n<4af6> <523c>\n<4af7> <525a>\n<4af8> <5260>\n<4af9> <526e>\n<4afc> <528a>\n<4afd> <528c>\n<4afe> <52e1>\n<4aff> <52e9>\n<4b00> <52f1>\n<4b01> <5303>\n<4b02> <5311>\n<4b03> <531f>\n<4b04> <532d>\n<4b05> <5332>\n<4b06> <533d>\n<4b07> <5365>\n<4b08> <536d>\n<4b09> <5379>\n<4b0a> <537e>\n<4b0b> <5394>\n<4b0c> <5399>\n<4b0d> <53aa>\n<4b0e> <53af>\n<4b0f> <53ba>\n<4b10> <53c1>\n<4b13> <53e0>\n<4b14> <5413>\n<4b15> <542a>\n<4b16> <5431>\n<4b19> <544c>\n<4b1a> <54a7>\n<4b1b> <54aa>\n<4b1c> <54b1>\n<4b1d> <54bb>\n<4b1e> <54ce>\n<4b1f> <54ea>\n<4b20> <54fc>\n<4b21> <5505>\n<4b22> <5508>\n<4b23> <5515>\n<4b24> <5527>\n<4b25> <552a>\n<4b26> <5536>\n<4b27> <5551>\n<4b28> <5566>\n<4b29> <558f>\n<4b2a> <5592>\n<4b2b> <5594>\n<4b2c> <55a4>\n<4b2d> <55b2>\n<4b2e> <55c3>\n<4b2f> <55c6>\n<4b30> <55d3>\n<4b31> <55db>\n<4b32> <55ec>\n<4b33> <55ee>\n<4b34> <55f1>\n<4b35> <55f6>\n<4b36> <55f8>\n<4b37> <5605>\n<4b38> <560d>\n<4b3b> <562c>\n<4b3c> <5635>\n<4b3d> <5639>\n<4b3e> <564d>\n<4b3f> <5654>\n<4b40> <5685>\n<4b41> <569f>\n<4b42> <56a6>\n<4b43> <56b7>\n<4b44> <56cc>\n<4b45> <56cf>\n<4b46> <56d9>\n<4b47> <56e1>\n<4b48> <56eb>\n<4b49> <56ed>\n<4b4a> <56f1>\n<4b4b> <5707>\n<4b4c> <570c>\n<4b4f> <571d>\n<4b50> <572c>\n<4b51> <572e>\n<4b54> <575f>\n<4b55> <576b>\n<4b56> <576d>\n<4b57> <577a>\n<4b58> <5783>\n<4b59> <5797>\n<4b5a> <57ae>\n<4b5b> <57d5>\nendbfchar\n\n100 beginbfchar\n<4b5c> <57e7>\n<4b5d> <580d>\n<4b5e> <5826>\n<4b5f> <584d>\n<4b60> <584f>\n<4b61> <585f>\n<4b62> <586d>\n<4b63> <587f>\n<4b64> <5881>\n<4b65> <5898>\n<4b66> <58bc>\n<4b67> <591f>\n<4b68> <5923>\n<4b69> <5959>\n<4b6a> <5979>\n<4b6b> <5997>\n<4b6c> <59af>\n<4b6d> <59b3>\n<4b6e> <59df>\n<4b6f> <59f1>\n<4b70> <59f8>\n<4b71> <5ab2>\n<4b72> <5ab8>\n<4b73> <5aea>\n<4b74> <5af6>\n<4b75> <5b1b>\n<4b76> <5b1d>\n<4b77> <5b21>\n<4b78> <5b38>\n<4b79> <5bb7>\n<4b7a> <5bd7>\n<4b7b> <5be0>\n<4b7c> <5c1f>\n<4b7d> <5c2a>\n<4b7e> <5c2c>\n<4b7f> <5c36>\n<4b80> <5c59>\n<4b81> <5c5c>\n<4b82> <5c6d>\n<4b83> <5cdd>\n<4b84> <5d01>\n<4b85> <5d34>\n<4b86> <5d3d>\n<4b87> <5d59>\n<4b88> <5d7e>\n<4b89> <5d83>\n<4b8a> <5dc7>\n<4b8b> <5df9>\n<4b8c> <5e28>\n<4b8d> <5e32>\n<4b8e> <5e35>\n<4b8f> <5e5b>\n<4b90> <5e68>\n<4b91> <5e6a>\n<4b92> <5e77>\n<4b93> <5e80>\n<4b94> <5e8b>\n<4b95> <5eb3>\n<4b96> <5ebd>\n<4b97> <5ed1>\n<4b9a> <5f4d>\n<4b9b> <5fac>\n<4b9c> <5fea>\n<4b9d> <6007>\n<4b9e> <6049>\n<4b9f> <6054>\n<4ba0> <6067>\n<4ba1> <60bb>\n<4ba2> <60c4>\n<4ba3> <60fd>\n<4ba4> <610a>\n<4ba5> <6116>\n<4ba6> <612a>\n<4ba7> <6136>\n<4ba8> <615e>\n<4ba9> <6164>\n<4baa> <617b>\n<4bab> <617d>\n<4bac> <617f>\n<4bad> <619d>\n<4bae> <61b8>\n<4baf> <61dc>\n<4bb0> <61e2>\n<4bb1> <61e5>\n<4bb2> <61e8>\n<4bb3> <6204>\n<4bb4> <6207>\n<4bb5> <6231>\n<4bb6> <6239>\n<4bb7> <623d>\n<4bb8> <627a>\n<4bb9> <6290>\n<4bba> <62a8>\n<4bbb> <62da>\n<4bbc> <62f4>\n<4bbd> <6316>\n<4bbe> <632a>\n<4bbf> <6336>\n<4bc0> <6346>\n<4bc1> <634b>\nendbfchar\n\n100 beginbfchar\n<4bc2> <6353>\n<4bc3> <6371>\n<4bc4> <6375>\n<4bc5> <637f>\n<4bc6> <6382>\n<4bc7> <638a>\n<4bca> <63ea>\n<4bcd> <6412>\n<4bce> <6418>\n<4bcf> <6420>\n<4bd0> <6424>\n<4bd1> <642a>\n<4bd2> <6435>\n<4bd3> <643d>\n<4bd4> <643f>\n<4bd5> <6452>\n<4bd6> <645f>\n<4bd7> <6474>\n<4bd8> <6490>\n<4bdb> <64ac>\n<4bdc> <64b3>\n<4bdd> <64ed>\n<4bde> <64f0>\n<4bdf> <651b>\n<4be0> <651f>\n<4be1> <652e>\n<4be2> <6549>\n<4be3> <6560>\n<4be4> <6592>\n<4be5> <6595>\n<4be6> <65b4>\n<4be7> <65be>\n<4be8> <65c8>\n<4be9> <65ce>\n<4bea> <65d0>\n<4beb> <65df>\n<4bec> <667e>\n<4bef> <66b3>\n<4bf0> <66c0>\n<4bf1> <66cf>\n<4bf2> <6725>\n<4bf3> <6735>\n<4bf4> <6755>\n<4bf5> <6780>\n<4bf6> <678f>\n<4bf7> <6791>\n<4bf8> <67a4>\n<4bf9> <67b1>\n<4bfa> <67b5>\n<4bfb> <67be>\n<4bfc> <6828>\n<4bfd> <6886>\n<4bfe> <68eb>\n<4bff> <68f5>\n<4c00> <6917>\n<4c01> <6933>\n<4c02> <6938>\n<4c03> <695b>\n<4c04> <6965>\n<4c05> <69a8>\n<4c06> <69ab>\n<4c07> <69af>\n<4c08> <69e5>\n<4c09> <69f1>\n<4c0a> <6a4a>\n<4c0b> <6a55>\n<4c0c> <6a67>\n<4c0d> <6a71>\n<4c0e> <6aaf>\n<4c11> <6b03>\n<4c12> <6b3b>\n<4c13> <6b3f>\n<4c16> <6bb0>\n<4c17> <6bf7>\n<4c18> <6bf9>\n<4c19> <6c04>\n<4c1a> <6c09>\n<4c1b> <6c0d>\n<4c1c> <6c2c>\n<4c1d> <6c4a>\n<4c1e> <6c52>\n<4c1f> <6c54>\n<4c20> <6c79>\n<4c21> <6cac>\n<4c22> <6cb4>\n<4c23> <6cd2>\n<4c24> <6d61>\n<4c25> <6d7c>\n<4c26> <6db9>\n<4c27> <6df0>\n<4c28> <6e45>\n<4c29> <6e73>\n<4c2a> <6e7b>\n<4c2b> <6e7d>\n<4c2c> <6e89>\n<4c2d> <6ebc>\n<4c30> <6f26>\n<4c31> <6f29>\n<4c32> <6f30>\n<4c33> <6f87>\nendbfchar\n\n100 beginbfchar\n<4c34> <6f9d>\n<4c35> <6fae>\n<4c36> <6fb7>\n<4c37> <700d>\n<4c38> <7020>\n<4c39> <7049>\n<4c3a> <7098>\n<4c3b> <70b0>\n<4c3e> <7145>\n<4c3f> <71b2>\n<4c40> <71f4>\n<4c41> <7217>\n<4c42> <721f>\n<4c43> <7243>\n<4c46> <725a>\n<4c47> <7260>\n<4c48> <7268>\n<4c49> <7277>\n<4c4a> <7284>\n<4c4b> <72c9>\n<4c4c> <72e5>\n<4c4d> <72f4>\n<4c4e> <7302>\n<4c4f> <730b>\n<4c50> <731e>\n<4c51> <7322>\n<4c54> <734d>\n<4c55> <7358>\n<4c56> <7367>\n<4c57> <7472>\n<4c58> <74af>\n<4c59> <74df>\n<4c5a> <74e4>\n<4c5b> <74f4>\n<4c5c> <74fb>\n<4c5d> <7516>\n<4c5e> <7521>\n<4c5f> <753f>\n<4c60> <755e>\n<4c61> <7599>\n<4c62> <75a4>\n<4c63> <75c1>\n<4c64> <75c4>\n<4c65> <75cc>\n<4c66> <75d7>\n<4c67> <75dc>\n<4c68> <75e1>\n<4c69> <75ef>\n<4c6a> <7604>\n<4c6b> <760c>\n<4c6c> <761d>\n<4c6d> <7632>\n<4c6e> <7638>\n<4c6f> <7645>\n<4c70> <764a>\n<4c71> <765f>\n<4c72> <76ad>\n<4c73> <76bd>\n<4c74> <76d9>\n<4c75> <76eb>\n<4c76> <76f0>\n<4c77> <76f9>\n<4c78> <7700>\n<4c79> <770e>\n<4c7a> <7722>\n<4c7b> <7728>\n<4c7c> <772f>\n<4c7d> <7739>\n<4c7e> <773e>\n<4c7f> <7745>\n<4c80> <774a>\n<4c81> <774f>\n<4c82> <775e>\n<4c83> <7764>\n<4c84> <7767>\n<4c85> <776c>\n<4c86> <7784>\n<4c89> <7796>\n<4c8a> <77a7>\n<4c8b> <77af>\n<4c8c> <77b7>\n<4c8d> <77be>\n<4c8e> <77c9>\n<4c8f> <77d1>\n<4c90> <77d9>\n<4c91> <77f1>\n<4c92> <7837>\n<4c93> <785c>\n<4c94> <787e>\n<4c95> <7898>\n<4c96> <78a1>\n<4c97> <78b1>\n<4c98> <78b3>\n<4c99> <78c9>\n<4c9a> <78d3>\n<4c9b> <790c>\n<4c9c> <791f>\n<4c9f> <793f>\n<4ca0> <7942>\n<4ca1> <7954>\nendbfchar\n\n100 beginbfchar\n<4ca2> <796b>\n<4ca3> <797c>\n<4ca4> <79ab>\n<4ca5> <79c4>\n<4ca6> <79ea>\n<4ca7> <7a02>\n<4ca8> <7a0c>\n<4ca9> <7a30>\n<4caa> <7a3a>\n<4cab> <7a44>\n<4cac> <7a80>\n<4cad> <7a86>\n<4cae> <7a94>\n<4caf> <7ab5>\n<4cb0> <7abd>\n<4cb1> <7afe>\n<4cb2> <7b2b>\n<4cb3> <7b77>\n<4cb4> <7ba0>\n<4cb5> <7bac>\n<4cb6> <7bb0>\n<4cb7> <7be8>\n<4cb8> <7bf2>\n<4cb9> <7bf8>\n<4cba> <7bfc>\n<4cbb> <7bfe>\n<4cbc> <7c09>\n<4cbd> <7c28>\n<4cbe> <7c2f>\n<4cbf> <7c42>\n<4cc5> <7c72>\n<4cc6> <7c7d>\n<4cc7> <7c87>\n<4cc8> <7c9e>\n<4cc9> <7cba>\n<4cca> <7cc7>\n<4ccb> <7cd3>\n<4ccc> <7cda>\n<4ccd> <7d3c>\n<4cce> <7d4d>\n<4ccf> <7d82>\n<4cd0> <7d85>\n<4cd1> <7d8d>\n<4cd2> <7d91>\n<4cd3> <7d9e>\n<4cd4> <7db3>\n<4cd5> <7db9>\n<4cd6> <7dd0>\n<4cd7> <7de5>\n<4cda> <7e2f>\n<4cdb> <7e36>\n<4cdc> <7e44>\n<4cdd> <7e6f>\n<4cde> <7e78>\n<4cdf> <7e81>\n<4ce0> <7f3d>\n<4ce1> <7f5b>\n<4ce2> <7f5d>\n<4ce3> <7f65>\n<4ce4> <7f71>\n<4ce7> <7f8b>\n<4ce8> <7fa2>\n<4cec> <8007>\n<4ced> <800d>\n<4cee> <801e>\n<4cef> <8039>\n<4cf0> <8088>\n<4cf1> <808e>\n<4cf2> <80cf>\n<4cf3> <80d4>\n<4cf4> <80ed>\n<4cf5> <80f0>\n<4cf6> <80f7>\n<4cf7> <80fa>\n<4cf8> <80fe>\n<4cf9> <8103>\n<4cfa> <8117>\n<4cfb> <8130>\n<4cfc> <8157>\n<4cfd> <816f>\n<4cfe> <8173>\n<4cff> <818b>\n<4d00> <8190>\n<4d01> <819b>\n<4d02> <819e>\n<4d03> <81cb>\n<4d04> <81d5>\n<4d07> <81e1>\n<4d08> <81ef>\n<4d09> <81f6>\n<4d0a> <8200>\n<4d0b> <820b>\n<4d0e> <821a>\n<4d0f> <823a>\n<4d10> <8244>\n<4d11> <826d>\n<4d12> <8284>\n<4d13> <8289>\n<4d14> <8291>\n<4d15> <82aa>\nendbfchar\n\n100 beginbfchar\n<4d16> <82b0>\n<4d17> <82d0>\n<4d18> <82ea>\n<4d19> <82ef>\n<4d1a> <82f6>\n<4d1b> <8356>\n<4d1c> <8378>\n<4d1d> <83f8>\n<4d1e> <83fc>\n<4d1f> <8458>\n<4d20> <8493>\n<4d21> <84b1>\n<4d22> <84bd>\n<4d23> <84fb>\n<4d24> <8546>\n<4d25> <8556>\n<4d26> <855d>\n<4d27> <8585>\n<4d28> <8598>\n<4d29> <8642>\n<4d2a> <8646>\n<4d2b> <86c0>\n<4d2c> <8714>\n<4d2d> <8722>\n<4d2e> <872e>\n<4d2f> <8739>\n<4d30> <875d>\n<4d31> <877b>\n<4d32> <878c>\n<4d33> <878e>\n<4d36> <879e>\n<4d37> <87a3>\n<4d38> <87ae>\n<4d39> <87bf>\n<4d3a> <87c9>\n<4d3b> <87da>\n<4d3c> <8818>\n<4d3d> <881b>\n<4d3e> <882d>\n<4d3f> <883a>\n<4d40> <8845>\n<4d41> <884b>\n<4d42> <884e>\n<4d43> <8855>\n<4d44> <885a>\n<4d45> <886e>\n<4d49> <88cd>\n<4d4a> <88e0>\n<4d4b> <88ef>\n<4d4e> <8926>\n<4d4f> <8935>\n<4d50> <895a>\n<4d51> <895c>\n<4d52> <896b>\n<4d53> <8970>\n<4d54> <897c>\n<4d55> <89a5>\n<4d56> <89b5>\n<4d57> <89bc>\n<4d58> <89d5>\n<4d59> <8a49>\n<4d5a> <8a57>\n<4d5b> <8a67>\n<4d5c> <8a7e>\n<4d5d> <8a86>\n<4d5e> <8a96>\n<4d5f> <8ab6>\n<4d60> <8ac9>\n<4d61> <8ad1>\n<4d62> <8add>\n<4d63> <8aec>\n<4d64> <8af5>\n<4d65> <8b06>\n<4d66> <8b0f>\n<4d67> <8b11>\n<4d68> <8b45>\n<4d69> <8b52>\n<4d6a> <8b6d>\n<4d6b> <8b78>\n<4d6c> <8b7c>\n<4d6d> <8b7e>\n<4d6e> <8b85>\n<4d6f> <8b9f>\n<4d70> <8c4b>\n<4d71> <8c53>\n<4d72> <8c7b>\n<4d73> <8cba>\n<4d74> <8cc5>\n<4d75> <8cc9>\n<4d76> <8cd2>\n<4d77> <8cec>\n<4d78> <8cf5>\n<4d79> <8cf7>\n<4d7a> <8d01>\n<4d7b> <8d03>\n<4d7c> <8d17>\n<4d7d> <8d1c>\n<4d7e> <8d6e>\n<4d7f> <8d91>\n<4d80> <8d9f>\nendbfchar\n\n100 beginbfchar\n<4d81> <8dab>\n<4d82> <8db2>\n<4d83> <8dd5>\n<4d84> <8de7>\n<4d87> <8df4>\n<4d88> <8e01>\n<4d89> <8e0b>\n<4d8a> <8e26>\n<4d8b> <8e31>\n<4d8e> <8e4d>\n<4d8f> <8e4f>\n<4d90> <8e5c>\n<4d91> <8e61>\n<4d92> <8e69>\n<4d93> <8e71>\n<4d94> <8e75>\n<4d95> <8e77>\n<4d96> <8e89>\n<4d97> <8e90>\n<4d98> <8e95>\n<4d99> <8e9a>\n<4d9a> <8ea7>\n<4d9b> <8ea9>\n<4d9c> <8ead>\n<4d9d> <8ee8>\n<4d9e> <8ef0>\n<4d9f> <8f07>\n<4da0> <8f18>\n<4da1> <8f25>\n<4da2> <8f27>\n<4da3> <8f2c>\n<4da4> <8f35>\n<4da5> <8f3a>\n<4da6> <8f43>\n<4da7> <8f47>\n<4da8> <8f51>\n<4da9> <8f55>\n<4dad> <8fa5>\n<4dae> <9004>\n<4daf> <901b>\n<4db0> <902f>\n<4db1> <904c>\n<4db2> <905b>\n<4db3> <9070>\n<4db4> <9074>\n<4db5> <9079>\n<4db6> <908b>\n<4db7> <9098>\n<4db8> <90a0>\n<4db9> <90b2>\n<4dba> <90bd>\n<4dbb> <90c9>\n<4dbc> <90f0>\n<4dbd> <9105>\n<4dbe> <9125>\n<4dbf> <915a>\n<4dc0> <9167>\n<4dc1> <917a>\n<4dc2> <918a>\n<4dc3> <9191>\n<4dc4> <9195>\n<4dc5> <91b0>\n<4dc6> <91bb>\n<4dc7> <91bd>\n<4dc8> <91c2>\n<4dc9> <91c5>\n<4dca> <9200>\n<4dcb> <9209>\n<4dcc> <9223>\n<4dcd> <9276>\n<4dce> <928e>\n<4dcf> <92af>\n<4dd2> <92c1>\n<4dd3> <92c3>\n<4dd4> <92c5>\n<4dd5> <92c8>\n<4dd6> <9314>\n<4dd7> <9333>\n<4dd8> <9336>\n<4dd9> <9358>\n<4dda> <937f>\n<4ddb> <9382>\n<4ddc> <938a>\n<4ddd> <93bb>\n<4dde> <93cc>\n<4ddf> <93e6>\n<4de0> <93f9>\n<4de1> <9402>\n<4de4> <942e>\n<4de5> <944c>\n<4de6> <9588>\n<4de7> <95a1>\n<4de8> <95bf>\n<4de9> <95c6>\n<4dea> <95c9>\n<4ded> <95e0>\n<4dee> <95e4>\n<4def> <95e6>\n<4df0> <9624>\n<4df1> <9631>\nendbfchar\n\n100 beginbfchar\n<4df2> <9638>\n<4df3> <963d>\n<4df4> <9654>\n<4df5> <9674>\n<4df6> <967b>\n<4df7> <967f>\n<4df8> <9681>\n<4df9> <9683>\n<4dfa> <9689>\n<4dfb> <9696>\n<4dfc> <96ae>\n<4dfd> <9703>\n<4dfe> <971b>\n<4dff> <9721>\n<4e00> <9722>\n<4e01> <9728>\n<4e02> <9731>\n<4e03> <9767>\n<4e04> <9776>\n<4e05> <977d>\n<4e06> <977f>\n<4e07> <9799>\n<4e08> <979f>\n<4e09> <97ac>\n<4e0a> <97b9>\n<4e0b> <97cd>\n<4e0c> <97e0>\n<4e0d> <97ef>\n<4e0e> <9807>\n<4e0f> <9826>\n<4e10> <982e>\n<4e13> <98b4>\n<4e14> <98c5>\n<4e15> <9902>\n<4e16> <9911>\n<4e17> <9915>\n<4e18> <9935>\n<4e19> <9948>\n<4e1a> <9954>\n<4e1b> <995e>\n<4e1c> <99e1>\n<4e1d> <9a0c>\n<4e1e> <9a10>\n<4e1f> <9a23>\n<4e20> <9a41>\n<4e21> <9a51>\n<4e24> <9b01>\n<4e25> <9b09>\n<4e26> <9b0b>\n<4e29> <9b19>\n<4e2a> <9b35>\n<4e2b> <9b48>\n<4e2c> <9b55>\n<4e2d> <9b68>\n<4e2e> <9b80>\n<4e2f> <9b86>\n<4e30> <9b90>\n<4e31> <9b9d>\n<4e32> <9bb0>\n<4e33> <9bbf>\n<4e34> <9bc8>\n<4e35> <9bff>\n<4e36> <9c02>\n<4e37> <9c1c>\n<4e38> <9c35>\n<4e39> <9c44>\n<4e3a> <9c56>\n<4e3b> <9c61>\n<4e3c> <9c68>\n<4e3d> <9d30>\n<4e3e> <9d3d>\n<4e3f> <9d6a>\n<4e40> <9d7b>\n<4e41> <9de5>\n<4e42> <9de9>\n<4e43> <9df3>\n<4e44> <9e7a>\n<4e48> <9eb0>\n<4e49> <9ee4>\n<4e4a> <9ef0>\n<4e4b> <9ef2>\n<4e4c> <9f09>\n<4e4d> <9f0f>\n<4e4e> <9f14>\n<4e4f> <9f1b>\n<4e50> <9f22>\n<4e51> <9f26>\n<4e54> <9f34>\n<4e55> <9f5a>\n<4e56> <9f6f>\n<4e57> <9f9e>\n<4e58> <9fa5>\n<4e59> <d840dcf5>\n<4e5a> <d853de04>\n<4e5b> <d853dff2>\n<4e5c> <d85fdd73>\n<4e5d> <d87edc15>\n<4e5e> <d87edc46>\n<4e5f> <d87edc99>\n<4e60> <d87edca6>\nendbfchar\n\n100 beginbfchar\n<4e61> <d87edce5>\n<4e62> <d87eddde>\n<4e63> <35de>\n<4e64> <fffd>\n<4e65> <fffd>\n<4e66> <fffd>\n<4e67> <fffd>\n<4e68> <d868deb2>\n<4e69> <4e0e>\n<4e6a> <4e26>\n<4e6b> <d840dd58>\n<4e6c> <4f73>\n<4e6d> <5056>\n<4e6e> <50ed>\n<4e6f> <516b>\n<4e70> <d841ddb1>\n<4e71> <51de>\n<4e72> <51fd>\n<4e73> <d841deec>\n<4e74> <5264>\n<4e77> <533f>\n<4e78> <5354>\n<4e79> <5440>\n<4e7a> <d843dd58>\n<4e7b> <559c>\n<4e7c> <55ab>\n<4e7d> <5609>\n<4e7e> <56ae>\n<4e7f> <56ae>\n<4e80> <56c0>\n<4e81> <56c3>\n<4e82> <56ce>\n<4e83> <56ee>\n<4e84> <57d6>\n<4e85> <583d>\n<4e86> <5859>\n<4e87> <594f>\n<4e88> <5951>\n<4e89> <5960>\n<4e8a> <5962>\n<4e8b> <5ada>\n<4e8c> <5b5a>\n<4e8d> <5b73>\n<4e8e> <5b7c>\n<4e8f> <5bb3>\n<4e90> <d856ddcc>\n<4e91> <5e43>\n<4e92> <5ea7>\n<4e93> <5ee3>\n<4e94> <5f38>\n<4e95> <5fa1>\n<4e96> <5fdd>\n<4e97> <6162>\n<4e98> <61b2>\n<4e99> <61f8>\n<4e9a> <39a4>\n<4e9b> <39b8>\n<4e9c> <d84bde42>\n<4e9d> <64a5>\n<4e9e> <64f6>\n<4e9f> <3a5c>\n<4ea2> <d84bdfeb>\n<4ea3> <6587>\n<4ea4> <6589>\n<4ea5> <d85eddb4>\n<4ea6> <658e>\n<4ea7> <3ac4>\n<4ea8> <3acb>\n<4ea9> <65e1>\n<4eaa> <6667>\n<4eab> <666e>\n<4eac> <66c1>\n<4ead> <66dc>\n<4eae> <3a85>\n<4eaf> <6700>\n<4eb0> <6761>\n<4eb1> <67c4>\n<4eb2> <6802>\n<4eb3> <693d>\n<4eb4> <695e>\n<4eb5> <6a05>\n<4eb6> <6a9c>\n<4eb7> <3bf3>\n<4eb8> <6af8>\n<4eb9> <6bb1>\n<4eba> <6c38>\n<4ebb> <6caa>\n<4ebc> <6dbc>\n<4ebd> <6de4>\n<4ebe> <3d31>\n<4ebf> <6e08>\n<4ec0> <6e72>\n<4ec1> <6ecb>\n<4ec2> <6ed5>\n<4ec3> <6edb>\n<4ec4> <6f5b>\n<4ec5> <6f5b>\n<4ec6> <6f64>\n<4ec7> <6f74>\n<4ec8> <d850dc4b>\nendbfchar\n\n100 beginbfchar\n<4ec9> <723e>\n<4eca> <3e40>\n<4ecb> <38a1>\n<4ecc> <73ca>\n<4ecd> <74bd>\n<4ece> <755d>\n<4ecf> <75bc>\n<4ed0> <75d9>\n<4ed1> <7608>\n<4ed2> <7664>\n<4ed3> <7669>\n<4ed4> <76c8>\n<4ed5> <7737>\n<4ed6> <777e>\n<4ed7> <79a7>\n<4ed8> <79b1>\n<4ed9> <7abe>\n<4eda> <7be0>\n<4edb> <7c50>\n<4edc> <7d09>\n<4edd> <7db2>\n<4ede> <7db2>\n<4edf> <7f3e>\n<4ee0> <7fe1>\n<4ee1> <8012>\n<4ee2> <8077>\n<4ee3> <80d6>\n<4ee4> <8109>\n<4ee5> <8129>\n<4ee6> <820c>\n<4ee7> <821b>\n<4ee8> <8240>\n<4ee9> <83df>\n<4eea> <83d4>\n<4eeb> <840f>\n<4eec> <8449>\n<4eed> <84ea>\n<4eee> <d85bdc9e>\n<4eef> <8551>\n<4ef0> <8563>\n<4ef1> <85cf>\n<4ef2> <864e>\n<4ef3> <8662>\n<4ef4> <868a>\n<4ef5> <8842>\n<4ef6> <8877>\n<4ef7> <8941>\n<4ef8> <8b56>\n<4ef9> <8b56>\n<4efa> <8b5c>\n<4efb> <471f>\n<4efc> <d85fdc3c>\n<4efd> <8c6a>\n<4efe> <8c79>\n<4eff> <8cca>\n<4f00> <8d67>\n<4f01> <481e>\n<4f02> <8f03>\n<4f03> <8f44>\n<4f04> <8fc5>\n<4f05> <8fd4>\n<4f06> <8ff6>\n<4f07> <9077>\n<4f08> <9077>\n<4f0b> <90a8>\n<4f0c> <914d>\n<4f0d> <92e9>\n<4f0e> <9335>\n<4f0f> <938b>\n<4f10> <943a>\n<4f11> <95cd>\n<4f12> <962a>\n<4f13> <9698>\n<4f14> <96a7>\n<4f15> <97ff>\n<4f16> <97ff>\n<4f17> <990a>\n<4f18> <9921>\n<4f19> <9957>\n<4f1a> <9ba8>\n<4f1b> <9bae>\n<4f1c> <9bb9>\n<4f1d> <9c08>\n<4f1e> <9c24>\n<4f1f> <9c3b>\n<4f20> <9c75>\n<4f21> <9ce6>\n<4f22> <9dc0>\n<4f23> <9dc2>\n<4f24> <9e78>\n<4f25> <98ef>\n<4f26> <d84edc3d>\n<4f27> <7b08>\n<4f28> <646f>\n<4f29> <7c3e>\n<4f2a> <7b75>\n<4f2b> <7515>\n<4f2c> <8a1d>\n<4f2d> <6062>\n<4f2e> <7078>\nendbfchar\n\n100 beginbfchar\n<4f2f> <5ed0>\n<4f30> <7c82>\n<4f31> <9699>\n<4f32> <8654>\n<4f33> <8171>\n<4f34> <9375>\n<4f35> <54ac>\n<4f36> <72e1>\n<4f37> <6897>\n<4f38> <9bab>\n<4f39> <53c9>\n<4f3a> <6756>\n<4f3b> <7526>\n<4f3c> <7511>\n<4f3d> <7ac8>\n<4f3e> <633a>\n<4f3f> <9041>\n<4f40> <99c1>\n<4f41> <65a7>\n<4f42> <91e1>\n<4f43> <97ad>\n<4f44> <8292>\n<4f45> <7c7e>\n<4f46> <723a>\n<4f47> <8805>\n<4f48> <8703>\n<4f49> <9b1d>\n<4f4a> <9b2c>\n<4f4b> <5002>\n<4f4c> <51de>\n<4f4d> <5307>\n<4f4e> <5bec>\n<4f4f> <f928>\n<4f50> <661e>\n<4f51> <f929>\n<4f52> <704a>\n<4f53> <fa15>\n<4f54> <5561>\n<4f55> <6c3a>\n<4f56> <7a60>\n<4f57> <d858df4c>\n<4f58> <8803>\n<4f59> <95ab>\n<4f5a> <9755>\n<4f5b> <d867de3d>\n<4f5c> <d869de1a>\n<4f5f> <00ba>\n<4f60> <00aa>\n<4f61> <2116>\n<4f62> <0110>\n<4f63> <0126>\n<4f64> <0132>\n<4f65> <013f>\n<4f66> <014a>\n<4f67> <0166>\n<4f68> <0133>\n<4f69> <0138>\n<4f6a> <0140>\n<4f6b> <0149>\n<4f6c> <0167>\n<4f6d> <010a>\n<4f6e> <0116>\n<4f6f> <011e>\n<4f70> <0122>\n<4f71> <0120>\n<4f72> <0130>\n<4f73> <012e>\n<4f74> <0136>\n<4f75> <013d>\n<4f76> <013b>\n<4f77> <0145>\n<4f78> <0156>\n<4f79> <0172>\n<4f7a> <01d7>\n<4f7b> <01db>\n<4f7c> <01d9>\n<4f7d> <01d5>\n<4f7e> <0174>\n<4f7f> <0176>\n<4f80> <010b>\n<4f81> <0117>\n<4f82> <01f5>\n<4f83> <011f>\n<4f84> <0121>\n<4f85> <012f>\n<4f86> <0137>\n<4f87> <013e>\n<4f88> <013c>\n<4f89> <0146>\n<4f8a> <0157>\n<4f8b> <0173>\n<4f8c> <0175>\n<4f8d> <0177>\n<4f8e> <212e>\n<4f8f> <2206>\n<4f90> <220f>\n<4f93> <25ca>\n<4f96> <00ba>\n<4f97> <00aa>\n<4f98> <2116>\nendbfchar\n\n100 beginbfchar\n<4f99> <0110>\n<4f9a> <0126>\n<4f9b> <0132>\n<4f9c> <013f>\n<4f9d> <014a>\n<4f9e> <0166>\n<4f9f> <0133>\n<4fa0> <0138>\n<4fa1> <0140>\n<4fa2> <0149>\n<4fa3> <0167>\n<4fa4> <010a>\n<4fa5> <0116>\n<4fa6> <011e>\n<4fa7> <0122>\n<4fa8> <0120>\n<4fa9> <0130>\n<4faa> <012e>\n<4fab> <0136>\n<4fac> <013d>\n<4fad> <013b>\n<4fae> <0145>\n<4faf> <0156>\n<4fb0> <0172>\n<4fb1> <01d7>\n<4fb2> <01db>\n<4fb3> <01d9>\n<4fb4> <01d5>\n<4fb5> <0174>\n<4fb6> <0176>\n<4fb7> <010b>\n<4fb8> <0117>\n<4fb9> <01f5>\n<4fba> <011f>\n<4fbb> <0121>\n<4fbc> <012f>\n<4fbd> <0137>\n<4fbe> <013e>\n<4fbf> <013c>\n<4fc0> <0146>\n<4fc1> <0157>\n<4fc2> <0173>\n<4fc3> <0175>\n<4fc4> <0177>\n<4fc5> <212e>\n<4fc6> <2206>\n<4fc7> <220f>\n<4fca> <25ca>\n<4fcb> <0386>\n<4fcf> <03aa>\n<4fd0> <038c>\n<4fd1> <038e>\n<4fd2> <03ab>\n<4fd3> <038f>\n<4fd8> <03ca>\n<4fd9> <0390>\n<4fdc> <03cb>\n<4fdd> <03b0>\n<4fde> <03ce>\n<4ffb> <30d2>\n<4ffc> <30d5>\n<4ffd> <30d8>\n<4ffe> <30db>\n<4fff> <30de>\n<5004> <30e4>\n<5005> <30e6>\n<5017> <7d42>\n<5018> <0048>\n<5019> <0043004c>\n<501a> <004b0043004c>\n<501b> <00420045004c>\n<501c> <00410053>\n<501d> <0041004d>\n<501e> <6bb5>\n<501f> <30b4>\n<5020> <30df>\n<502a> <0030>\n<502b> <003000d7>\n<502c> <003100d7>\n<502d> <003200d7>\n<502e> <003300d7>\n<502f> <003400d7>\n<5030> <003500d7>\n<5031> <003600d7>\n<5032> <003700d7>\n<5033> <003800d7>\n<5034> <003900d7>\n<5049> <5e74>\n<504a> <004e>\n<504b> <5929>\n<504c> <518d>\n<504d> <65b0>\n<504e> <6620>\n<504f> <58f0>\n<5050> <524d>\n<5051> <5f8c>\n<5052> <7d42>\n<5053> <7acb>\n<5054> <4ea4>\n<5055> <307b304b>\nendbfchar\n\n100 beginbfchar\n<5056> <5287>\n<5057> <53f8>\n<5058> <89e3>\n<5059> <682a>\n<505a> <6c17>\n<505b> <4e8c>\n<505c> <591a>\n<505d> <6587>\n<505e> <624b>\n<505f> <00500056>\n<5060> <004d0056>\n<5061> <53cc>\n<5062> <00530053>\n<5063> <00530031>\n<5064> <00530032>\n<5065> <00530033>\n<5066> <30c7>\n<5067> <00480056>\n<5068> <2014>\n<5069> <2014>\n<506a> <2014>\n<506d> <00300030>\n<506e> <00300031>\n<506f> <00300032>\n<5070> <00300033>\n<5071> <00300034>\n<5072> <00300035>\n<5073> <00300036>\n<5074> <00300037>\n<5075> <00300038>\n<5076> <00300039>\n<5077> <00310030>\n<5078> <00310031>\n<5079> <00310032>\n<507a> <00310033>\n<507b> <00310034>\n<507c> <00310035>\n<507d> <00310036>\n<507e> <00310037>\n<507f> <00310038>\n<5080> <00310039>\n<5081> <00320030>\n<5082> <00320031>\n<5083> <00320032>\n<5084> <00320033>\n<5085> <00320034>\n<5086> <00320035>\n<5087> <00320036>\n<5088> <00320037>\n<5089> <00320038>\n<508a> <00320039>\n<508b> <00330030>\n<508c> <00330031>\n<508d> <00330032>\n<508e> <00330033>\n<508f> <00330034>\n<5090> <00330035>\n<5091> <00330036>\n<5092> <00330037>\n<5093> <00330038>\n<5094> <00330039>\n<5095> <00340030>\n<5096> <00340031>\n<5097> <00340032>\n<5098> <00340033>\n<5099> <00340034>\n<509a> <00340035>\n<509b> <00340036>\n<509c> <00340037>\n<509d> <00340038>\n<509e> <00340039>\n<509f> <00350030>\n<50a0> <00350031>\n<50a1> <00350032>\n<50a2> <00350033>\n<50a3> <00350034>\n<50a4> <00350035>\n<50a5> <00350036>\n<50a6> <00350037>\n<50a7> <00350038>\n<50a8> <00350039>\n<50a9> <002700300030>\n<50aa> <002700300031>\n<50ab> <002700300032>\n<50ac> <002700300033>\n<50ad> <002700300034>\n<50ae> <002700300035>\n<50af> <002700300036>\n<50b0> <002700300037>\n<50b1> <002700300038>\n<50b2> <002700300039>\n<50b3> <002700310030>\n<50b4> <002700310031>\n<50b5> <002700310032>\n<50b6> <002700310033>\n<50b7> <002700310034>\n<50b8> <002700310035>\n<50b9> <002700310036>\n<50ba> <002700310037>\n<50bb> <002700310038>\nendbfchar\n\n100 beginbfchar\n<50bc> <002700310039>\n<50bd> <002700320030>\n<50be> <002700320031>\n<50bf> <002700320032>\n<50c0> <002700320033>\n<50c1> <002700320034>\n<50c2> <002700320035>\n<50c3> <002700320036>\n<50c4> <002700320037>\n<50c5> <002700320038>\n<50c6> <002700320039>\n<50c7> <002700330030>\n<50c8> <002700330031>\n<50c9> <002700330032>\n<50ca> <002700330033>\n<50cb> <002700330034>\n<50cc> <002700330035>\n<50cd> <002700330036>\n<50ce> <002700330037>\n<50cf> <002700330038>\n<50d0> <002700330039>\n<50d1> <002700340030>\n<50d2> <002700340031>\n<50d3> <002700340032>\n<50d4> <002700340033>\n<50d5> <002700340034>\n<50d6> <002700340035>\n<50d7> <002700340036>\n<50d8> <002700340037>\n<50d9> <002700340038>\n<50da> <002700340039>\n<50db> <002700350030>\n<50dc> <002700350031>\n<50dd> <002700350032>\n<50de> <002700350033>\n<50df> <002700350034>\n<50e0> <002700350035>\n<50e1> <002700350036>\n<50e2> <002700350037>\n<50e3> <002700350038>\n<50e4> <002700350039>\n<50e5> <002700360030>\n<50e6> <002700360031>\n<50e7> <002700360032>\n<50e8> <002700360033>\n<50e9> <002700360034>\n<50ea> <002700360035>\n<50eb> <002700360036>\n<50ec> <002700360037>\n<50ed> <002700360038>\n<50ee> <002700360039>\n<50ef> <002700370030>\n<50f0> <002700370031>\n<50f1> <002700370032>\n<50f2> <002700370033>\n<50f3> <002700370034>\n<50f4> <002700370035>\n<50f5> <002700370036>\n<50f6> <002700370037>\n<50f7> <002700370038>\n<50f8> <002700370039>\n<50f9> <002700380030>\n<50fa> <002700380031>\n<50fb> <002700380032>\n<50fc> <002700380033>\n<50fd> <002700380034>\n<50fe> <002700380035>\n<50ff> <002700380036>\n<5100> <002700380037>\n<5101> <002700380038>\n<5102> <002700380039>\n<5103> <002700390030>\n<5104> <002700390031>\n<5105> <002700390032>\n<5106> <002700390033>\n<5107> <002700390034>\n<5108> <002700390035>\n<5109> <002700390036>\n<510a> <002700390037>\n<510b> <002700390038>\n<510c> <002700390039>\n<510d> <00300030>\n<510e> <00300031>\n<510f> <00300032>\n<5110> <00300033>\n<5111> <00300034>\n<5112> <00300035>\n<5113> <00300036>\n<5114> <00300037>\n<5115> <00300038>\n<5116> <00300039>\n<5117> <00310030>\n<5118> <00310031>\n<5119> <00310032>\n<511a> <00310033>\n<511b> <00310034>\n<511c> <00310035>\n<511d> <00310036>\n<511e> <00310037>\n<511f> <00310038>\nendbfchar\n\n100 beginbfchar\n<5120> <00310039>\n<5121> <00320030>\n<5122> <00320031>\n<5123> <00320032>\n<5124> <00320033>\n<5125> <00320034>\n<5126> <00320035>\n<5127> <00320036>\n<5128> <00320037>\n<5129> <00320038>\n<512a> <00320039>\n<512b> <00330030>\n<512c> <00330031>\n<512d> <00330032>\n<512e> <00330033>\n<512f> <00330034>\n<5130> <00330035>\n<5131> <00330036>\n<5132> <00330037>\n<5133> <00330038>\n<5134> <00330039>\n<5135> <00340030>\n<5136> <00340031>\n<5137> <00340032>\n<5138> <00340033>\n<5139> <00340034>\n<513a> <00340035>\n<513b> <00340036>\n<513c> <00340037>\n<513d> <00340038>\n<513e> <00340039>\n<513f> <00350030>\n<5140> <00350031>\n<5141> <00350032>\n<5142> <00350033>\n<5143> <00350034>\n<5144> <00350035>\n<5145> <00350036>\n<5146> <00350037>\n<5147> <00350038>\n<5148> <00350039>\n<5149> <00360030>\n<514a> <00360031>\n<514b> <00360032>\n<514c> <00360033>\n<514d> <00360034>\n<514e> <00360035>\n<514f> <00360036>\n<5150> <00360037>\n<5151> <00360038>\n<5152> <00360039>\n<5153> <00370030>\n<5154> <00370031>\n<5155> <00370032>\n<5156> <00370033>\n<5157> <00370034>\n<5158> <00370035>\n<5159> <00370036>\n<515a> <00370037>\n<515b> <00370038>\n<515c> <00370039>\n<515d> <00380030>\n<515e> <00380031>\n<515f> <00380032>\n<5160> <00380033>\n<5161> <00380034>\n<5162> <00380035>\n<5163> <00380036>\n<5164> <00380037>\n<5165> <00380038>\n<5166> <00380039>\n<5167> <00390030>\n<5168> <00390031>\n<5169> <00390032>\n<516a> <00390033>\n<516b> <00390034>\n<516c> <00390035>\n<516d> <00390036>\n<516e> <00390037>\n<516f> <00390038>\n<5170> <00390039>\n<5171> <003100300030>\n<5172> <003100300031>\n<5173> <003100300032>\n<5174> <003100300033>\n<5175> <003100300034>\n<5176> <003100300035>\n<5177> <003100300036>\n<5178> <003100300037>\n<5179> <003100300038>\n<517a> <003100300039>\n<517b> <003100310030>\n<517c> <003100310031>\n<517d> <003100310032>\n<517e> <003100310033>\n<517f> <003100310034>\n<5180> <003100310035>\n<5181> <003100310036>\n<5182> <003100310037>\n<5183> <003100310038>\nendbfchar\n\n100 beginbfchar\n<5184> <003100310039>\n<5185> <003100320030>\n<5186> <003100320031>\n<5187> <003100320032>\n<5188> <003100320033>\n<5189> <003100320034>\n<518a> <003100320035>\n<518b> <003100320036>\n<518c> <003100320037>\n<518d> <003100320038>\n<518e> <003100320039>\n<518f> <003100330030>\n<5190> <003100330031>\n<5191> <003100330032>\n<5192> <003100330033>\n<5193> <003100330034>\n<5194> <003100330035>\n<5195> <003100330036>\n<5196> <003100330037>\n<5197> <003100330038>\n<5198> <003100330039>\n<5199> <003100340030>\n<519a> <003100340031>\n<519b> <003100340032>\n<519c> <003100340033>\n<519d> <003100340034>\n<519e> <003100340035>\n<519f> <003100340036>\n<51a0> <003100340037>\n<51a1> <003100340038>\n<51a2> <003100340039>\n<51a3> <002e0030>\n<51a4> <002e0031>\n<51a5> <002e0032>\n<51a6> <002e0033>\n<51a7> <002e0034>\n<51a8> <002e0035>\n<51a9> <002e0036>\n<51aa> <002e0037>\n<51ab> <002e0038>\n<51ac> <002e0039>\n<51ad> <002c0030>\n<51ae> <002c0031>\n<51af> <002c0032>\n<51b0> <002c0033>\n<51b1> <002c0034>\n<51b2> <002c0035>\n<51b3> <002c0036>\n<51b4> <002c0037>\n<51b5> <002c0038>\n<51b6> <002c0039>\n<51b7> <007000700062>\n<51b8> <00700070006d>\n<51b9> <00270053>\n<51ba> <00480032>\n<51bb> <004f0032>\n<51bc> <004f0078>\n<51bd> <004e0078>\n<51be> <00510032>\n<51bf> <004a0072002e>\n<51c0> <00440072002e>\n<51c1> <30ac30eb>\n<51c2> <30b030ec30a4>\n<51c3> <30af30ed30fc30ca>\n<51c4> <30b730fc30d930eb30c8>\n<51c5> <30b730a730b130eb>\n<51c6> <30b830e530fc30eb>\n<51c7> <30c730b730d930eb>\n<51c8> <30c930c330c8>\n<51c9> <30d030a430c8>\n<51ca> <30d330c330c8>\n<51cb> <30d930af30ec30eb>\n<51cc> <30dc30fc>\n<51cd> <30e930f330c9>\n<51ce> <30ea30f330ae30c330c8>\n<51cf> <30ac30eb>\n<51d0> <30b030ec30a4>\n<51d1> <30af30ed30fc30ca>\n<51d2> <30b730fc30d930eb30c8>\n<51d3> <30b730a730b130eb>\n<51d4> <30b830e530fc30eb>\n<51d5> <30c730b730d930eb>\n<51d6> <30c930c330c8>\n<51d7> <30d030a430c8>\n<51d8> <30d330c330c8>\n<51d9> <30d930af30ec30eb>\n<51da> <30dc30fc>\n<51db> <30e930f330c9>\n<51dc> <30ea30f330ae30c330c8>\n<51dd> <fffd>\n<51de> <fffd>\n<51df> <3002300d>\n<51e0> <3002300f>\n<51e3> <00ba>\n<51e4> <00aa>\n<51e5> <2116>\n<51e6> <0110>\n<51e7> <0126>\n<51e8> <0132>\n<51e9> <013f>\nendbfchar\n\n100 beginbfchar\n<51ea> <014a>\n<51eb> <0166>\n<51ec> <0133>\n<51ed> <0138>\n<51ee> <0140>\n<51ef> <0149>\n<51f0> <0167>\n<51f1> <010a>\n<51f2> <0116>\n<51f3> <011e>\n<51f4> <0122>\n<51f5> <0120>\n<51f6> <0130>\n<51f7> <012e>\n<51f8> <0136>\n<51f9> <013d>\n<51fa> <013b>\n<51fb> <0145>\n<51fc> <0156>\n<51fd> <0172>\n<51fe> <01d7>\n<51ff> <01db>\n<5200> <01d9>\n<5201> <01d5>\n<5202> <0174>\n<5203> <0176>\n<5204> <010b>\n<5205> <0117>\n<5206> <01f5>\n<5207> <011f>\n<5208> <0121>\n<5209> <012f>\n<520a> <0137>\n<520b> <013e>\n<520c> <013c>\n<520d> <0146>\n<520e> <0157>\n<520f> <0173>\n<5210> <0175>\n<5211> <0177>\n<5212> <212e>\n<5213> <2206>\n<5214> <220f>\n<5217> <25ca>\n<521a> <00ba>\n<521b> <00aa>\n<521c> <2116>\n<521d> <0110>\n<521e> <0126>\n<521f> <0132>\n<5220> <013f>\n<5221> <014a>\n<5222> <0166>\n<5223> <0133>\n<5224> <0138>\n<5225> <0140>\n<5226> <0149>\n<5227> <0167>\n<5228> <010a>\n<5229> <0116>\n<522a> <011e>\n<522b> <0122>\n<522c> <0120>\n<522d> <0130>\n<522e> <012e>\n<522f> <0136>\n<5230> <013d>\n<5231> <013b>\n<5232> <0145>\n<5233> <0156>\n<5234> <0172>\n<5235> <01d7>\n<5236> <01db>\n<5237> <01d9>\n<5238> <01d5>\n<5239> <0174>\n<523a> <0176>\n<523b> <010b>\n<523c> <0117>\n<523d> <01f5>\n<523e> <011f>\n<523f> <0121>\n<5240> <012f>\n<5241> <0137>\n<5242> <013e>\n<5243> <013c>\n<5244> <0146>\n<5245> <0157>\n<5246> <0173>\n<5247> <0175>\n<5248> <0177>\n<5249> <212e>\n<524a> <2206>\n<524b> <220f>\n<524e> <25ca>\n<524f> <6ea2>\n<5250> <fa40>\n<5251> <fa20>\n<5252> <8b7f>\n<5253> <4e35>\nendbfchar\n\n100 beginbfchar\n<5254> <4e5c>\n<5255> <4e63>\n<5256> <4e68>\n<5259> <4e97>\n<525a> <4eaf>\n<525b> <4edb>\n<525c> <4ee2>\n<525d> <4ee8>\n<525e> <4eef>\n<525f> <4efe>\n<5260> <4f02>\n<5261> <4f08>\n<5262> <4f12>\n<5263> <4f17>\n<5264> <4f33>\n<5265> <4f35>\n<5266> <4f40>\n<5267> <4f42>\n<526a> <4f52>\n<526b> <4f63>\n<526c> <4f6e>\n<526d> <4f71>\n<526e> <4f79>\n<526f> <4f81>\n<5270> <4f89>\n<5271> <4f8c>\n<5272> <4f8e>\n<5273> <4f90>\n<5274> <4f93>\n<5275> <4f99>\n<5276> <4f9f>\n<5277> <4fb9>\n<527d> <4fc6>\n<527e> <4fc8>\n<527f> <4fcc>\n<5280> <4fdc>\n<5281> <4fe2>\n<5282> <4ff0>\n<5283> <4ffc>\n<5284> <5007>\n<5285> <500a>\n<5286> <5017>\n<5287> <501d>\n<5288> <5030>\n<528b> <5035>\n<528c> <5045>\n<528d> <504a>\n<5290> <5059>\n<5291> <5060>\n<5292> <5067>\n<5293> <506d>\n<5294> <5071>\n<5295> <5081>\n<5298> <5086>\n<5299> <508a>\n<529a> <5090>\n<529b> <509b>\n<52a1> <50b9>\n<52a2> <50bd>\n<52a3> <50c0>\n<52a4> <50d3>\n<52a7> <50df>\n<52a8> <50e2>\n<52a9> <50e4>\n<52aa> <50f6>\n<52ab> <50fa>\n<52ac> <50f2>\n<52ad> <5119>\n<52b0> <5123>\n<52b5> <512f>\n<52b6> <5131>\n<52b7> <5134>\n<52b8> <5139>\n<52b9> <5142>\n<52ba> <514f>\n<52bb> <5153>\n<52bc> <5158>\n<52bd> <5166>\n<52be> <517e>\n<52bf> <518e>\n<52c0> <51bf>\n<52c1> <51c2>\n<52c2> <51d2>\n<52c3> <51d5>\n<52c4> <51e5>\n<52c5> <51f2>\n<52c6> <51f7>\n<52c7> <5218>\n<52c8> <5222>\n<52c9> <5245>\n<52ca> <5258>\n<52cb> <525f>\n<52cc> <5280>\n<52cd> <5285>\n<52d1> <529a>\n<52d2> <52a5>\n<52d3> <52a7>\n<52d4> <52b0>\n<52d8> <52bd>\n<52d9> <52c4>\nendbfchar\n\n100 beginbfchar\n<52da> <52c6>\n<52db> <52cf>\n<52dc> <52d4>\n<52dd> <52dc>\n<52de> <52e5>\n<52df> <52e8>\n<52e0> <52ea>\n<52e1> <52ec>\n<52e2> <52f4>\n<52e3> <52f6>\n<52e4> <530c>\n<52e5> <5313>\n<52e6> <5318>\n<52e7> <531b>\n<52e8> <531e>\n<52e9> <5325>\n<52ef> <5330>\n<52f0> <533c>\n<52f1> <5359>\n<52f2> <535b>\n<52f3> <5365>\n<52f4> <5383>\n<52f7> <538e>\n<52f8> <53a1>\n<52f9> <53b5>\n<52fa> <53b8>\n<52fb> <53bd>\n<52fc> <53cf>\n<52ff> <53de>\n<5300> <53e0>\n<5301> <53e7>\n<5302> <5402>\n<5303> <541a>\n<5304> <5421>\n<5305> <542f>\n<5306> <5444>\n<5307> <5447>\n<5308> <544f>\n<5309> <545e>\n<530a> <5464>\n<530b> <5467>\n<530c> <5469>\n<530f> <5481>\n<5310> <5483>\n<5311> <5485>\n<5312> <5489>\n<5313> <5491>\n<5314> <549f>\n<5315> <54ca>\n<5316> <54e0>\n<5317> <54f6>\n<5318> <54fe>\n<531b> <5532>\n<531c> <553b>\n<531d> <553d>\n<531e> <5549>\n<531f> <554d>\n<5320> <5558>\n<5323> <557f>\n<5324> <5593>\n<5325> <5597>\n<5326> <55a3>\n<5327> <55c1>\n<5328> <55cb>\n<532b> <55de>\n<532c> <55ff>\n<532d> <5605>\n<532e> <560a>\n<532f> <5619>\n<5330> <5633>\n<5331> <563c>\n<5332> <5641>\n<5335> <5646>\n<5339> <5675>\n<533a> <5684>\n<533b> <568b>\n<533c> <56a7>\n<533d> <56ab>\n<533e> <56be>\n<533f> <56cb>\n<5340> <56d0>\n<5341> <56dc>\n<5347> <5711>\n<5348> <5720>\n<5349> <5722>\n<534c> <572a>\n<534d> <573f>\n<534e> <5752>\n<534f> <5762>\n<5350> <5767>\n<5351> <576e>\n<5352> <5771>\n<5353> <5779>\n<5354> <577e>\n<5355> <5781>\n<5356> <5794>\n<5357> <5799>\n<5358> <579f>\n<5359> <57a1>\n<535a> <5795>\nendbfchar\n\n100 beginbfchar\n<535b> <57a7>\n<535c> <57a9>\n<535d> <57bd>\n<535e> <57dd>\n<535f> <57e9>\n<5360> <57fe>\n<5361> <5803>\n<5362> <5808>\n<5363> <57e1>\n<5364> <580c>\n<5365> <581b>\n<5366> <581f>\n<5367> <582d>\n<5368> <583f>\n<5369> <5850>\n<536a> <5855>\n<536b> <5868>\n<536c> <5878>\n<536f> <588c>\n<5370> <5896>\n<5374> <58a6>\n<5375> <58c4>\n<5376> <58c2>\n<5377> <58c8>\n<5378> <58d6>\n<5379> <58dd>\n<537a> <58e1>\n<537b> <5906>\n<537e> <591d>\n<537f> <5921>\n<5380> <5928>\n<5381> <5930>\n<5382> <5933>\n<5385> <593f>\n<5386> <5943>\n<5387> <5952>\n<5388> <595e>\n<5389> <596b>\n<538a> <596f>\n<538b> <5972>\n<538c> <597b>\n<538d> <598c>\n<538e> <598e>\n<538f> <5995>\n<5390> <59a7>\n<5391> <59ad>\n<5392> <59b0>\n<5393> <59b7>\n<5394> <59c1>\n<5395> <59c4>\n<5396> <59ef>\n<5397> <59f2>\n<5398> <59f4>\n<5399> <59f7>\n<539a> <5a00>\n<539b> <5a0e>\n<539c> <5a12>\n<539d> <5a1e>\n<539e> <5a24>\n<539f> <5a28>\n<53a0> <5a2a>\n<53a1> <5a30>\n<53a4> <5a48>\n<53a5> <5a4c>\n<53a6> <5a50>\n<53a7> <5a5e>\n<53a8> <5a7b>\n<53a9> <5a90>\n<53aa> <5a93>\n<53ab> <5a96>\n<53ac> <5a99>\n<53ad> <5abb>\n<53ae> <5ac6>\n<53af> <5ac8>\n<53b0> <5acf>\n<53b1> <5afd>\n<53b2> <5b01>\n<53b3> <5b4b>\n<53b4> <5b5e>\n<53b5> <5b6e>\n<53b6> <5b86>\n<53b7> <5b8e>\n<53ba> <5b94>\n<53bd> <5bad>\n<53be> <5baf>\n<53c1> <5bba>\n<53c2> <5bbc>\n<53c3> <5bc1>\n<53c4> <5bcd>\n<53c5> <5bcf>\n<53c8> <5bef>\n<53c9> <5bf4>\n<53ca> <5c0c>\n<53cb> <5c17>\n<53cc> <5c26>\n<53cd> <5c2e>\n<53ce> <5c32>\n<53cf> <5c35>\n<53d0> <5c5a>\n<53d3> <5c7b>\nendbfchar\n\n100 beginbfchar\n<53d4> <5c7d>\n<53d5> <5c87>\n<53d6> <5c92>\n<53d7> <5c9d>\n<53d8> <5cb2>\n<53d9> <5cb4>\n<53da> <5cd7>\n<53db> <5cee>\n<53de> <5d12>\n<53df> <5d23>\n<53e0> <5d3f>\n<53e1> <5d48>\n<53e2> <5d55>\n<53e3> <5d51>\n<53e6> <5d62>\n<53e7> <5d64>\n<53ea> <5d7f>\n<53eb> <5d8a>\n<53ec> <5d93>\n<53ed> <5d95>\n<53ee> <5d9b>\n<53ef> <5d9f>\n<53f0> <5dab>\n<53f1> <5dc3>\n<53f2> <5dce>\n<53f3> <5dd9>\n<53f4> <5e07>\n<53f5> <5e0d>\n<53f6> <5e20>\n<53f7> <5e4b>\n<53fa> <5e5c>\n<53fb> <5e70>\n<53fc> <5e8e>\n<53fd> <5ea2>\n<53fe> <5ea4>\n<53ff> <5eb1>\n<5400> <5ecc>\n<5401> <5ece>\n<5402> <5edc>\n<5403> <5ede>\n<5404> <5ee5>\n<5405> <5eeb>\n<5406> <5f06>\n<5407> <5f19>\n<5408> <5f24>\n<540b> <5f2e>\n<540c> <5f30>\n<540d> <5f3f>\n<540e> <5f44>\n<540f> <5f5b>\n<5410> <5f60>\n<5411> <5f6f>\n<5414> <5f78>\n<5415> <5f7a>\n<5416> <5f8d>\n<5417> <5f96>\n<5418> <5f9d>\n<5419> <5fab>\n<541c> <5fc8>\n<541f> <5fe8>\n<5420> <5fec>\n<5421> <5ff2>\n<5422> <5ff6>\n<5423> <5ffa>\n<5424> <600a>\n<5425> <6013>\n<5426> <601f>\n<5427> <602d>\n<5428> <6040>\n<5429> <6048>\n<542a> <6051>\n<542d> <6071>\n<542e> <607e>\n<542f> <6082>\n<5430> <6086>\n<5431> <6088>\n<5432> <608e>\n<5433> <6091>\n<5434> <6093>\n<5435> <6098>\n<5436> <65df>\n<5437> <60a2>\n<5438> <60a5>\n<5439> <60b7>\n<543a> <60c2>\n<543f> <60e2>\n<5440> <60e5>\n<5441> <60fc>\n<5442> <6102>\n<5443> <6107>\n<5444> <610c>\n<5445> <6117>\n<5446> <6122>\n<5447> <6131>\n<5448> <6135>\n<5449> <6139>\n<544a> <6145>\n<544b> <6149>\n<544c> <616c>\n<544d> <6172>\nendbfchar\n\n100 beginbfchar\n<544e> <6178>\n<5453> <618b>\n<5454> <619c>\n<5455> <61a0>\n<5456> <61aa>\n<545b> <61de>\n<545c> <61e1>\n<545d> <61e7>\n<545e> <61e9>\n<5461> <61ef>\n<5462> <6201>\n<5463> <6203>\n<5464> <621c>\n<5465> <6220>\n<5466> <6227>\n<5467> <622b>\n<5468> <6242>\n<5469> <6244>\n<546a> <6250>\n<546b> <6254>\n<546c> <625c>\n<546d> <627d>\n<5471> <62b3>\n<5474> <62ba>\n<5477> <62ce>\n<5478> <62ea>\n<5479> <62f2>\n<547a> <6304>\n<547b> <630b>\n<547c> <6313>\n<547d> <6329>\n<547e> <632d>\n<547f> <634a>\n<5480> <6352>\n<5481> <6354>\n<5482> <6358>\n<5483> <635b>\n<5484> <6366>\n<5485> <636d>\n<5486> <6378>\n<5487> <6395>\n<5488> <639a>\n<5489> <63a4>\n<548a> <63a6>\n<548b> <63ad>\n<548c> <63c1>\n<548d> <63c5>\n<548e> <63c8>\n<548f> <63ce>\n<5490> <63d3>\n<5491> <63f3>\n<5492> <640a>\n<5493> <6430>\n<5494> <644b>\n<5495> <644f>\n<5496> <6453>\n<5497> <645c>\n<5498> <6461>\n<5499> <6463>\n<549a> <6485>\n<549b> <648f>\n<549c> <649b>\n<549d> <64a1>\n<549e> <64a3>\n<549f> <64a6>\n<54a0> <64a8>\n<54a1> <64bd>\n<54a2> <64c9>\n<54a3> <64d1>\n<54a6> <64f5>\n<54a7> <6501>\n<54ab> <6513>\n<54ac> <6526>\n<54ad> <6531>\n<54ae> <653a>\n<54b1> <6543>\n<54b2> <6550>\n<54b3> <6552>\n<54b4> <655f>\n<54b5> <657d>\n<54b6> <6598>\n<54b7> <65a0>\n<54b8> <65a3>\n<54b9> <65a6>\n<54ba> <65ae>\n<54bb> <65b3>\n<54bc> <65d6>\n<54bd> <65d8>\n<54be> <65df>\n<54c3> <660d>\n<54c6> <6616>\n<54c7> <661d>\n<54c8> <6623>\n<54c9> <6626>\n<54ca> <6629>\n<54cb> <6639>\n<54cc> <6637>\n<54cd> <6640>\n<54ce> <6646>\n<54cf> <664a>\nendbfchar\n\n100 beginbfchar\n<54d0> <6658>\n<54d1> <6660>\n<54d2> <6675>\n<54d3> <667f>\n<54d4> <6679>\n<54d5> <667c>\n<54d9> <669f>\n<54da> <69fe>\n<54dd> <66cc>\n<54de> <66ce>\n<54df> <66d4>\n<54e0> <66df>\n<54e1> <66eb>\n<54e2> <66ee>\n<54e3> <6707>\n<54e4> <671c>\n<54e5> <6720>\n<54e6> <6722>\n<54e7> <673e>\n<54e8> <6745>\n<54e9> <676c>\n<54ea> <6784>\n<54eb> <678e>\n<54ec> <6796>\n<54ed> <6799>\n<54f0> <67c2>\n<54f1> <67c5>\n<54f2> <67c9>\n<54f3> <67dc>\n<54f4> <67e1>\n<54f5> <67e6>\n<54f6> <67f2>\n<54f7> <67f6>\n<54f8> <6814>\n<54f9> <6819>\n<54fa> <6827>\n<54fb> <682f>\n<54fc> <683f>\n<54fd> <684a>\n<54fe> <6858>\n<54ff> <686f>\n<5502> <6879>\n<5503> <687b>\n<5504> <6888>\n<5505> <68a1>\n<5506> <68a9>\n<5507> <68ae>\n<5508> <68d1>\n<5509> <68d3>\n<550c> <68ea>\n<550d> <68f6>\n<550e> <68fd>\n<550f> <6906>\n<5510> <6909>\n<5511> <6910>\n<5512> <6916>\n<5513> <6931>\n<5514> <6945>\n<5515> <694e>\n<5516> <6966>\n<5519> <697b>\n<551a> <698d>\n<551b> <69a1>\n<551c> <69b8>\n<551d> <69c5>\n<551e> <69c8>\n<551f> <69fe>\n<5520> <6a00>\n<5521> <6a03>\n<5522> <6a20>\n<5523> <6a24>\n<5524> <6a37>\n<5525> <6a55>\n<5526> <6a6a>\n<5527> <6a81>\n<552a> <6a9b>\n<552d> <6ab4>\n<5530> <6acc>\n<5533> <6af0>\n<5534> <6afc>\n<5535> <6b02>\n<5538> <6b09>\n<5539> <6b28>\n<553a> <6b2b>\n<553b> <6b36>\n<553c> <6b4d>\n<553d> <6b52>\n<553e> <6b5d>\n<553f> <6b6b>\n<5540> <6b6e>\n<5541> <6b70>\n<5542> <6b85>\n<5543> <6b97>\n<5548> <6ba8>\n<5549> <6bac>\n<554e> <6be3>\n<554f> <6c12>\n<5550> <6c19>\n<5551> <6c1f>\n<5555> <6c2e>\nendbfchar\n\n100 beginbfchar\n<5556> <6c3b>\n<5557> <6c4b>\n<5558> <6c4f>\n<5559> <6c6b>\n<555a> <6c78>\n<555b> <6c87>\n<555c> <6c9f>\n<555d> <6cb0>\n<555e> <6cb2>\n<555f> <6ccd>\n<5560> <6ccf>\n<5561> <6cd1>\n<5562> <6ce7>\n<5563> <6cf2>\n<5564> <6cf4>\n<5565> <6d07>\n<5566> <6d0f>\n<5567> <6d13>\n<5568> <6d1a>\n<5569> <6d28>\n<556a> <6d5f>\n<556b> <6d67>\n<556c> <6d92>\n<556d> <6d97>\n<556e> <6db7>\n<556f> <6dbd>\n<5570> <6de0>\n<5571> <6de2>\n<5572> <6de5>\n<5573> <6def>\n<5574> <6df4>\n<5575> <6e00>\n<5576> <6e04>\n<5577> <6e3b>\n<5578> <6e52>\n<5579> <6e5d>\n<557a> <6e62>\n<557b> <6e68>\n<557c> <6e8d>\n<557d> <6e99>\n<557e> <6ea0>\n<5581> <6eb3>\n<5582> <6ebb>\n<5583> <6ec0>\n<5584> <6ec8>\n<5585> <6ecd>\n<5586> <6ecf>\n<5589> <6f04>\n<558a> <6f08>\n<558b> <6f0d>\n<558c> <6f16>\n<558d> <6f1b>\n<558e> <6f3b>\n<558f> <6f2d>\n<5590> <6f4f>\n<5591> <6f53>\n<5592> <6f5d>\n<5593> <6f6c>\n<5594> <6f83>\n<5595> <6f93>\n<5596> <6fa6>\n<5597> <6fb0>\n<5598> <6fc5>\n<5599> <6fe8>\n<559a> <6ffd>\n<559b> <7017>\n<559c> <702f>\n<559d> <7034>\n<559e> <7037>\n<559f> <7044>\n<55a0> <7048>\n<55a1> <7055>\n<55a2> <7094>\n<55a3> <7096>\n<55a4> <709b>\n<55a5> <70b4>\n<55a6> <70fa>\n<55a7> <7105>\n<55a8> <710b>\n<55a9> <712d>\n<55aa> <7138>\n<55ab> <7141>\n<55ac> <714b>\n<55ad> <74d8>\n<55ae> <7157>\n<55af> <715a>\n<55b0> <718c>\n<55b1> <719a>\n<55b2> <71b0>\n<55b5> <71cc>\n<55b6> <71da>\n<55b7> <71f8>\n<55ba> <7213>\n<55bb> <721a>\n<55bc> <7224>\n<55bd> <722f>\n<55be> <7245>\n<55bf> <724e>\n<55c0> <725e>\n<55c1> <726b>\nendbfchar\n\n100 beginbfchar\n<55c2> <7271>\n<55c5> <7289>\n<55c6> <7293>\n<55c7> <72a8>\n<55ca> <72d8>\n<55cb> <72df>\n<55cc> <72fe>\n<55cd> <730d>\n<55ce> <7313>\n<55cf> <7332>\n<55d0> <7335>\n<55d1> <7356>\n<55d6> <7369>\n<55d7> <7379>\n<55d8> <7380>\n<55d9> <738e>\n<55da> <7390>\n<55db> <7393>\n<55dc> <7397>\n<55dd> <73aa>\n<55de> <73ad>\n<55df> <73c6>\n<55e0> <73cc>\n<55e1> <73d3>\n<55e2> <73dd>\n<55e3> <73e6>\n<55e4> <73f7>\n<55e5> <73fb>\n<55e8> <7411>\n<55e9> <742d>\n<55ec> <746e>\n<55ed> <748f>\n<55ee> <7491>\n<55ef> <749a>\n<55f0> <74ae>\n<55f3> <74cc>\n<55f4> <74d0>\n<55f5> <74d3>\n<55f6> <74d8>\n<55f7> <74db>\n<55f8> <74e8>\n<55f9> <74ea>\n<55fa> <74ef>\n<55fb> <74fc>\n<55fc> <7506>\n<55fd> <7512>\n<55fe> <7527>\n<55ff> <7529>\n<5600> <7536>\n<5601> <7539>\n<5602> <7543>\n<5603> <7547>\n<5604> <7557>\n<5605> <755f>\n<5606> <7561>\n<5609> <7585>\n<560a> <7595>\n<560b> <759c>\n<560c> <75ba>\n<560d> <7612>\n<560e> <7623>\n<560f> <7629>\n<5612> <7640>\n<5613> <7644>\n<5614> <7659>\n<5615> <7685>\n<5618> <769f>\n<561b> <76c1>\n<561c> <76cb>\n<561d> <76d4>\n<561e> <76e0>\n<561f> <76f6>\n<5620> <7706>\n<5621> <7712>\n<5624> <771c>\n<5625> <772e>\n<5626> <773d>\n<5627> <7742>\n<5628> <7752>\n<562b> <7770>\n<562e> <778d>\n<562f> <77a2>\n<5630> <77ae>\n<5631> <77b1>\n<5632> <77b5>\n<5633> <77c3>\n<5634> <77d2>\n<5635> <77d5>\n<5636> <77f8>\n<5637> <780e>\n<5638> <7811>\n<5639> <781d>\n<563a> <7823>\n<563b> <7844>\n<563c> <7848>\n<563d> <784c>\n<563e> <7852>\n<563f> <785e>\n<5642> <7863>\n<5643> <788f>\nendbfchar\n\n100 beginbfchar\n<5644> <78a8>\n<5645> <78ac>\n<5646> <78b2>\n<5647> <78bd>\n<5648> <78bf>\n<5649> <78c7>\n<564a> <78d2>\n<564b> <78d6>\n<564c> <78db>\n<564d> <78df>\n<564e> <78ea>\n<564f> <78f3>\n<5650> <78f6>\n<5651> <78ff>\n<5652> <7906>\n<5653> <791a>\n<5654> <791e>\n<5655> <7920>\n<5656> <7929>\n<5657> <792d>\n<5658> <7935>\n<5659> <7944>\n<565a> <794b>\n<565b> <794f>\n<565c> <7951>\n<565d> <7969>\n<565e> <797b>\n<565f> <797e>\n<5660> <798c>\n<5661> <7991>\n<5662> <7993>\n<5663> <799c>\n<5664> <79a8>\n<5665> <79af>\n<5666> <79cf>\n<5667> <79dd>\n<5668> <79e0>\n<5669> <79e2>\n<566a> <79e5>\n<566b> <79f1>\n<566c> <79f8>\n<566d> <79fc>\n<566e> <7a07>\n<566f> <7a21>\n<5670> <7a27>\n<5671> <7a2b>\n<5672> <7a2f>\n<5675> <7a48>\n<5676> <7a55>\n<5677> <7a65>\n<5678> <7a7e>\n<5679> <7a8b>\n<567a> <7a91>\n<567b> <7a9e>\n<567c> <7ac9>\n<567d> <7adb>\n<567e> <7ae9>\n<567f> <7aec>\n<5680> <7af1>\n<5681> <7afb>\n<5682> <7b1f>\n<5683> <7b23>\n<5684> <7b29>\n<5685> <7b30>\n<5686> <7b34>\n<5689> <7b6a>\n<568a> <7b84>\n<568b> <7b89>\n<568c> <7b8e>\n<568d> <7b96>\n<568e> <7ba5>\n<568f> <7bb2>\n<5690> <7bb6>\n<5693> <7bbd>\n<5694> <7bc2>\n<5695> <7bc8>\n<5696> <7bdb>\n<569b> <7c02>\n<569c> <7c04>\n<569d> <7c06>\n<569e> <7c0c>\n<569f> <7c19>\n<56a0> <7c1b>\n<56a1> <7c25>\n<56a2> <7c2c>\n<56a3> <7c34>\n<56a6> <7c46>\n<56a7> <7c55>\n<56a8> <7c5a>\n<56a9> <7c63>\n<56aa> <7c69>\n<56ab> <7c7c>\n<56ac> <7c86>\n<56ad> <7cb0>\n<56ae> <7cbb>\n<56af> <7ccf>\n<56b0> <7cd4>\n<56b1> <7ce9>\n<56b2> <7d0f>\n<56b3> <7d11>\nendbfchar\n\n100 beginbfchar\n<56b4> <7d16>\n<56b5> <7d26>\n<56b6> <7d2a>\n<56b7> <7d2d>\n<56b8> <7d51>\n<56b9> <7d57>\n<56ba> <7d65>\n<56bb> <7d67>\n<56bc> <7d78>\n<56bd> <7d7b>\n<56be> <7d81>\n<56bf> <7d96>\n<56c6> <7e00>\n<56c7> <7de2>\n<56c8> <7dea>\n<56c9> <7ded>\n<56ca> <7dfa>\n<56cb> <7e1c>\n<56cc> <7e2d>\n<56cd> <7e33>\n<56ce> <7e3f>\n<56cf> <7e4e>\n<56d0> <7e50>\n<56d1> <7e58>\n<56d2> <7e5f>\n<56d3> <7e65>\n<56d4> <7e95>\n<56d7> <7f3f>\n<56d8> <7f5c>\n<56d9> <7f66>\n<56da> <7f80>\n<56db> <7f8d>\n<56dc> <7f8f>\n<56dd> <7fa6>\n<56de> <7faa>\n<56df> <7fb4>\n<56e0> <7fbc>\n<56e1> <7fc0>\n<56e2> <7fc8>\n<56e3> <7fe8>\n<56e4> <800f>\n<56e5> <8013>\n<56e6> <801d>\n<56e9> <802e>\n<56ea> <8034>\n<56eb> <803e>\n<56ec> <8040>\n<56ed> <8044>\n<56ee> <8064>\n<56ef> <806d>\n<56f0> <8081>\n<56f1> <80b9>\n<56f2> <80c8>\n<56f3> <80cd>\n<56f4> <80d2>\n<56f5> <80ee>\n<56f6> <80f2>\n<56f7> <80f6>\n<56f8> <80f9>\n<56f9> <810b>\n<56fa> <811c>\n<56fb> <8120>\n<56fc> <813c>\n<56fd> <8145>\n<56fe> <8147>\n<56ff> <8152>\n<5700> <8161>\n<5701> <8177>\n<5702> <8186>\n<5703> <818e>\n<5704> <8196>\n<5705> <81a2>\n<5706> <81ae>\n<5707> <81c5>\n<5708> <81ce>\n<5709> <81eb>\n<570d> <81f5>\n<570e> <81f8>\n<570f> <8200>\n<5710> <820f>\n<5711> <821d>\n<5712> <8228>\n<5713> <8243>\n<5714> <824e>\n<5715> <8251>\n<5716> <8256>\n<5717> <8267>\n<5718> <827b>\n<571b> <8287>\n<571c> <8294>\n<571d> <8296>\n<571e> <8298>\n<5721> <82a0>\n<5722> <82da>\n<5723> <82e0>\n<5724> <82e4>\n<5725> <82ed>\n<572a> <8321>\n<572b> <832c>\n<572c> <832e>\nendbfchar\n\n100 beginbfchar\n<572d> <8333>\n<572e> <8337>\n<572f> <833d>\n<5730> <8342>\n<5733> <8370>\n<5734> <8380>\n<5735> <8382>\n<5736> <8384>\n<5737> <8399>\n<5738> <839c>\n<5739> <83a6>\n<573a> <83ac>\n<573b> <83be>\n<573c> <8353>\n<573d> <83e8>\n<573e> <8419>\n<573f> <83ad>\n<5740> <842f>\n<5741> <8445>\n<5742> <8447>\n<5743> <844d>\n<5744> <8456>\n<5745> <845c>\n<5746> <8460>\n<5747> <8464>\n<5748> <8467>\n<5749> <846a>\n<574a> <8474>\n<574b> <847d>\n<574c> <8492>\n<574d> <8495>\n<5752> <84cc>\n<5753> <84f2>\n<5754> <84f7>\n<5757> <8507>\n<5758> <850e>\n<5759> <8510>\n<575a> <851c>\n<575b> <8522>\n<575c> <8527>\n<575d> <852a>\n<575e> <8533>\n<575f> <8536>\n<5760> <853f>\n<5761> <8550>\n<5762> <8552>\n<5767> <8579>\n<5768> <8589>\n<5769> <858b>\n<576a> <85a0>\n<576b> <85a5>\n<576c> <85a7>\n<576d> <85b4>\n<576e> <85b6>\n<576f> <85b8>\n<5773> <85c2>\n<5774> <85da>\n<5775> <85e0>\n<5776> <85e8>\n<5777> <85f3>\n<5778> <85fc>\n<577b> <8619>\n<577c> <861b>\n<577d> <8636>\n<577e> <863a>\n<577f> <863d>\n<5782> <865d>\n<5785> <8664>\n<5786> <8669>\n<5787> <8676>\n<5788> <8696>\n<5789> <869a>\n<578a> <86a1>\n<578b> <86a6>\n<578c> <86ad>\n<578f> <86b7>\n<5790> <86b9>\n<5791> <86bf>\n<5792> <86c5>\n<5793> <86d2>\n<5794> <86da>\n<5795> <86dc>\n<5796> <86e0>\n<5797> <86e5>\n<5798> <86e7>\n<5799> <8688>\n<579a> <8704>\n<579b> <870f>\n<579c> <872f>\n<579d> <8732>\n<57a0> <8745>\n<57a1> <874d>\n<57a2> <8761>\n<57a3> <876f>\n<57a8> <8790>\n<57a9> <8795>\n<57aa> <87a3>\n<57ab> <87b1>\n<57ac> <87c8>\n<57ad> <87ca>\nendbfchar\n\n100 beginbfchar\n<57ae> <87d5>\n<57af> <87d9>\n<57b0> <87dc>\n<57b1> <87e2>\n<57b2> <87e4>\n<57b3> <87f1>\n<57b4> <87f3>\n<57b5> <87f8>\n<57b6> <87fa>\n<57b7> <87ff>\n<57b8> <8809>\n<57b9> <8819>\n<57ba> <8812>\n<57bb> <881a>\n<57bc> <881e>\n<57bd> <8830>\n<57be> <8835>\n<57bf> <8841>\n<57c0> <8843>\n<57c3> <884b>\n<57c4> <8851>\n<57c5> <885c>\n<57c6> <8860>\n<57c7> <8871>\n<57c8> <8879>\n<57c9> <887b>\n<57ca> <8880>\n<57cb> <889f>\n<57cc> <88a8>\n<57cd> <88ba>\n<57d0> <88de>\n<57d1> <88e7>\n<57d2> <88f7>\n<57d3> <890d>\n<57d6> <8920>\n<57d7> <8928>\n<57d8> <8931>\n<57d9> <893a>\n<57da> <8946>\n<57db> <894f>\n<57dc> <8952>\n<57dd> <8957>\n<57de> <895b>\n<57df> <8961>\n<57e0> <8963>\n<57e1> <896e>\n<57e2> <8973>\n<57e3> <8975>\n<57e4> <897a>\n<57e5> <897d>\n<57e6> <898d>\n<57e7> <8995>\n<57ea> <89a0>\n<57eb> <89b4>\n<57ec> <89b6>\n<57ed> <89d7>\n<57ee> <89e9>\n<57ef> <89ed>\n<57f0> <89f9>\n<57f3> <8a1e>\n<57f4> <8a20>\n<57f5> <8a24>\n<57f6> <8a26>\n<57f9> <8a2f>\n<57fa> <8a3d>\n<57fb> <8a40>\n<57fc> <8a43>\n<57fd> <8a53>\n<57fe> <8a56>\n<57ff> <8a5c>\n<5800> <8a65>\n<5805> <8a80>\n<5806> <8a83>\n<5807> <8a8b>\n<5808> <8a8f>\n<5809> <8a92>\n<580a> <8a97>\n<580b> <8a99>\n<580c> <8a9f>\n<580d> <8aa9>\n<580e> <8aaf>\n<580f> <8ab3>\n<5810> <8abb>\n<5811> <8ac3>\n<5812> <8ac6>\n<5813> <8ac8>\n<5814> <8aca>\n<5818> <8af0>\n<5819> <8aff>\n<581a> <8b0b>\n<581b> <8b1e>\n<581c> <8b30>\n<581d> <8b3c>\n<581e> <8b42>\n<581f> <8b48>\n<5820> <8b4d>\n<5821> <8b63>\n<5822> <8b79>\n<5823> <8b84>\n<5824> <8b8d>\nendbfchar\n\n100 beginbfchar\n<5825> <8b8f>\n<5826> <8c38>\n<5827> <8c3e>\n<5828> <8c51>\n<5829> <8c58>\n<582a> <8c5b>\n<582b> <8c5d>\n<582c> <8c59>\n<582f> <8c66>\n<5832> <8c7e>\n<5835> <8c8b>\n<5836> <8c90>\n<5839> <8cb9>\n<583a> <8cc6>\n<583b> <8ccb>\n<583c> <8ccf>\n<583d> <8cdd>\n<583e> <8ce8>\n<583f> <8cef>\n<5840> <8cf2>\n<5841> <8cff>\n<5842> <8d65>\n<5843> <8d7f>\n<5844> <8d82>\n<5845> <8d88>\n<5846> <8d90>\n<5847> <8d9e>\n<5848> <8da0>\n<5849> <8dac>\n<584a> <8db5>\n<584b> <8db7>\n<584c> <8db9>\n<584d> <8dbb>\n<584e> <8dc0>\n<584f> <8dc5>\n<5850> <8dc7>\n<5851> <8dca>\n<5852> <8dd4>\n<5853> <8de5>\n<5854> <8df0>\n<5855> <8dbc>\n<5858> <8e11>\n<5859> <8e33>\n<585c> <8e4e>\n<585d> <8e5b>\n<5860> <8e79>\n<5863> <8e9b>\n<5864> <8e9d>\n<5865> <8ea2>\n<5866> <8eba>\n<5867> <8ec1>\n<586a> <8ec7>\n<586b> <8edc>\n<586c> <8eee>\n<586d> <8ef1>\n<586e> <8ef7>\n<586f> <8eed>\n<5870> <8f02>\n<5873> <8f16>\n<5876> <8f23>\n<5877> <8f28>\n<5878> <8f2e>\n<5879> <8f34>\n<587a> <8f37>\n<587b> <8f41>\n<587c> <8f4f>\n<5881> <8f65>\n<5882> <8f9d>\n<5883> <8fb8>\n<5884> <8fbe>\n<5885> <8fc0>\n<5886> <8fcb>\n<5887> <8fd0>\n<5888> <8fd2>\n<5889> <8fe3>\n<588a> <8ffe>\n<588b> <9018>\n<5891> <903f>\n<5892> <9062>\n<5893> <9066>\n<5894> <906c>\n<5895> <908e>\n<5896> <90a5>\n<5897> <90cc>\n<5898> <90d5>\n<589b> <90e5>\n<589c> <90d2>\n<589d> <9108>\n<589e> <910d>\n<589f> <9110>\n<58a0> <911a>\n<58a1> <9120>\n<58a2> <9129>\n<58a3> <912e>\n<58a4> <9136>\n<58a5> <913c>\n<58a6> <9143>\n<58a7> <914f>\n<58a8> <9153>\n<58a9> <916d>\nendbfchar\n\n100 beginbfchar\n<58aa> <917b>\n<58ab> <9181>\n<58ac> <9186>\n<58af> <9198>\n<58b0> <91a1>\n<58b1> <91a6>\n<58b2> <91bf>\n<58b5> <91d9>\n<58b8> <91ef>\n<58b9> <91f9>\n<58ba> <91fd>\n<58bd> <920c>\n<58c0> <9218>\n<58cb> <923e>\n<58cc> <9246>\n<58cd> <924d>\n<58ce> <9258>\n<58d1> <9269>\n<58d5> <9275>\n<58d6> <9279>\n<58d7> <927b>\n<58d8> <928a>\n<58d9> <9292>\n<58da> <92a0>\n<58dd> <92a8>\n<58de> <92b6>\n<58df> <92b8>\n<58e0> <92ba>\n<58e1> <92bd>\n<58e2> <92c7>\n<58e3> <92cd>\n<58e4> <92d8>\n<58e7> <92e1>\n<58e8> <92e3>\n<58e9> <92e8>\n<58ea> <92ec>\n<58eb> <92ee>\n<58ec> <92f0>\n<58ed> <9300>\n<58ee> <9308>\n<58ef> <931c>\n<58f0> <9324>\n<58f1> <932a>\n<58f2> <9334>\n<58f3> <9337>\n<58f4> <9350>\n<58f5> <9355>\n<58f6> <935e>\n<58f7> <9367>\n<58f8> <9369>\n<58f9> <936f>\n<58fa> <9374>\n<58fb> <9376>\n<58fc> <937a>\n<58fd> <937d>\n<5900> <938d>\n<5901> <9392>\n<5902> <9395>\n<5903> <9398>\n<5904> <93a1>\n<5905> <93a6>\n<5906> <93a8>\n<5907> <93ab>\n<590d> <93c9>\n<590e> <93cb>\n<590f> <93cd>\n<5910> <93d3>\n<5911> <93d9>\n<5912> <93f7>\n<5913> <9401>\n<5914> <9408>\n<5915> <9415>\n<5916> <941f>\n<5917> <942f>\n<5918> <943d>\n<5919> <9443>\n<591a> <9459>\n<591b> <945c>\n<591c> <945f>\n<591d> <9461>\n<591e> <9468>\n<591f> <946e>\n<5920> <9484>\n<5921> <9483>\n<5922> <957e>\n<5923> <9584>\n<5926> <95ba>\n<5927> <95d9>\n<5928> <95dd>\n<5929> <95df>\n<592a> <961e>\n<592b> <9622>\n<592e> <9637>\n<5931> <9652>\n<5934> <966e>\n<5935> <967c>\n<5936> <967e>\n<5937> <9691>\n<5938> <969f>\n<5939> <96a6>\nendbfchar\n\n100 beginbfchar\n<593a> <96ca>\n<593b> <96da>\n<593c> <96df>\n<593d> <96fa>\n<593e> <9705>\n<593f> <971a>\n<5940> <971d>\n<5941> <9721>\n<5942> <974a>\n<5943> <9758>\n<5946> <977b>\n<5947> <9780>\n<5948> <9789>\n<5949> <9797>\n<594a> <97b8>\n<594b> <97bc>\n<594c> <97bf>\n<594f> <97c7>\n<5950> <97ca>\n<5951> <97ce>\n<5952> <97d0>\n<5953> <97d7>\n<5954> <97dd>\n<5955> <97e4>\n<5958> <97fa>\n<5959> <9819>\n<595a> <981c>\n<595b> <9820>\n<595c> <982f>\n<595d> <9835>\n<595e> <9844>\n<595f> <984a>\n<5960> <9851>\n<5961> <986a>\n<5962> <98ae>\n<5963> <98cc>\n<5964> <98e6>\n<5965> <98f6>\n<5966> <9907>\n<5967> <991f>\n<5968> <9922>\n<5969> <9926>\n<596a> <992b>\n<596b> <9934>\n<596c> <9939>\n<596d> <9947>\n<596e> <9959>\n<596f> <995b>\n<5970> <999b>\n<5971> <999d>\n<5972> <999f>\n<5973> <99b0>\n<5974> <99b2>\n<5975> <99b5>\n<5976> <99d3>\n<5977> <99da>\n<5978> <99dc>\n<5979> <99e7>\n<5981> <9a04>\n<5982> <9a0b>\n<5983> <9a1e>\n<5984> <9a22>\n<5985> <9a33>\n<5986> <9a35>\n<5987> <9a47>\n<598a> <9a54>\n<598b> <9a5d>\n<598c> <9aaa>\n<598d> <9aac>\n<598e> <9aae>\n<598f> <9ab2>\n<5990> <9ab4>\n<5991> <9abb>\n<5992> <9abf>\n<5993> <9ac8>\n<5994> <9ad7>\n<5995> <9adb>\n<5996> <9ae4>\n<5997> <9ae7>\n<5998> <9aec>\n<599b> <9af5>\n<599c> <9afa>\n<599d> <9afd>\n<59a2> <9b1b>\n<59a3> <9b26>\n<59a4> <9b35>\n<59a5> <9b37>\n<59a8> <9b4c>\n<59ab> <9b5b>\n<59ac> <9b61>\n<59ad> <9b6a>\n<59b0> <9b78>\n<59b1> <9b7f>\n<59b2> <9b85>\n<59b3> <9b87>\n<59b4> <9b89>\n<59b5> <9b8b>\n<59b6> <9b8d>\n<59b7> <9b94>\n<59b8> <9b9a>\nendbfchar\n\n68 beginbfchar\n<59b9> <9ba9>\n<59ba> <9bb7>\n<59bb> <9bbc>\n<59bc> <9bd0>\n<59bd> <9bf9>\n<59be> <9c0f>\n<59bf> <9c11>\n<59c0> <9c1e>\n<59c1> <9c26>\n<59c2> <9c28>\n<59c3> <9c3d>\n<59c4> <9c43>\n<59c5> <9c4e>\n<59c6> <9c5e>\n<59c7> <9c7b>\n<59c8> <9cf7>\n<59c9> <9cf9>\n<59ca> <9d1c>\n<59cb> <9d2f>\n<59ce> <9d3a>\n<59cf> <9d3c>\n<59d0> <9d45>\n<59d3> <9d65>\n<59d4> <9d83>\n<59d5> <9d86>\n<59d6> <9d8e>\n<59d9> <9d95>\n<59dc> <9daa>\n<59dd> <9dae>\n<59de> <9dbf>\n<59df> <9dca>\n<59e2> <9dde>\n<59e3> <9dee>\n<59e4> <9df0>\n<59e5> <9dfe>\n<59e6> <9e0e>\n<59ea> <9e16>\n<59eb> <9e87>\n<59ee> <9e96>\n<59ef> <9e98>\n<59f0> <9eae>\n<59f1> <9eb3>\n<59f2> <9ec6>\n<59f3> <9ec8>\n<59f4> <9ecb>\n<59f5> <9ed5>\n<59f8> <9ef1>\n<59f9> <9ef5>\n<59fa> <9ef8>\n<59fb> <9f11>\n<59fc> <9f16>\n<59fd> <9f1a>\n<59fe> <9f1f>\n<59ff> <9f31>\n<5a00> <9f32>\n<5a01> <9f3c>\n<5a02> <9f3f>\n<5a05> <9f47>\n<5a06> <9f56>\n<5a07> <9f5e>\n<5a08> <9f6e>\n<5a09> <9f73>\n<5a0a> <9f7a>\n<5a0b> <9f7d>\n<5a0c> <9f8f>\n<5a0f> <9f96>\n<5a10> <9fa1>\n<5a11> <9fa3>\nendbfchar\n\n100 beginbfrange\n<0001> <003c> <0020>\n<003e> <005c> <005d>\n<0065> <0067> <00a1>\n<006e> <006f> <2039>\n<0070> <0071> <fb01>\n<0073> <0074> <2020>\n<007f> <0080> <0301>\n<0082> <0084> <0306>\n<009b> <009e> <00b0>\n<00a1> <00a3> <00bc>\n<00a4> <00a9> <00c0>\n<00aa> <00ba> <00c7>\n<00bb> <00c0> <00d9>\n<00c1> <00c6> <00e0>\n<00c7> <00d7> <00e7>\n<00d8> <00de> <00f9>\n<00e7> <00ff> <0020>\n<0100> <0122> <0039>\n<0124> <0144> <005d>\n<0146> <0185> <ff60>\n<0187> <0188> <30f0>\n<019c> <019d> <30d0>\n<019e> <019f> <30d3>\n<01a0> <01a1> <30d6>\n<01a2> <01a3> <30d9>\n<01a4> <01a5> <30dc>\n<01a7> <01a8> <301d>\n<01a9> <01f4> <2500>\n<01fa> <01fd> <3008>\n<01fe> <01ff> <300e>\n<0200> <0201> <3010>\n<0212> <0213> <304a>\n<0222> <0227> <306a>\n<022c> <0230> <307e>\n<0233> <0238> <3088>\n<023b> <023c> <3090>\n<024d> <024e> <3070>\n<024f> <0250> <3073>\n<0251> <0252> <3076>\n<0253> <0254> <3079>\n<0255> <0256> <307c>\n<0260> <0261> <00a2>\n<0279> <027b> <3000>\n<027f> <0280> <ff1a>\n<0283> <0284> <309b>\n<028b> <028c> <30fd>\n<028d> <028e> <309d>\n<0291> <0293> <3005>\n<029e> <029f> <2018>\n<02a0> <02a1> <201c>\n<02a2> <02a3> <ff08>\n<02a4> <02a5> <3014>\n<02aa> <02b3> <3008>\n<02bd> <02be> <2266>\n<02c4> <02c5> <2032>\n<02c9> <02ca> <00a2>\n<02e1> <02e2> <2190>\n<02e7> <02e8> <2286>\n<02e9> <02ea> <2282>\n<02ed> <02ee> <2227>\n<02fb> <02fc> <226a>\n<0301> <0302> <222b>\n<0308> <0309> <2020>\n<030c> <0315> <ff10>\n<0316> <032f> <ff21>\n<0330> <0349> <ff41>\n<034a> <039c> <3041>\n<039d> <03f2> <30a1>\n<03f3> <03ff> <0391>\n<0400> <0403> <039e>\n<0404> <040a> <03a3>\n<040b> <041b> <03b1>\n<041c> <0422> <03c3>\n<0423> <0428> <0410>\n<042a> <0449> <0416>\n<044b> <0464> <0436>\n<05b9> <05ba> <984d>\n<0697> <0698> <4eab>\n<0e68> <0e69> <5fd8>\n<0f1b> <0f1c> <7336>\n<100c> <100e> <4e9e>\n<1038> <1039> <4fe4>\n<1058> <1059> <50c9>\n<1065> <1066> <5101>\n<1070> <1071> <513f>\n<1077> <1078> <5169>\n<1082> <1083> <5195>\n<1087> <1089> <51a9>\n<108b> <108c> <51b1>\n<10a5> <10a6> <524b>\n<10b7> <10b8> <52ac>\n<10c5> <10c6> <52f8>\n<10f6> <10f7> <542c>\n<111a> <111b> <54e5>\n<112a> <112b> <5556>\n<117b> <117c> <5737>\n<1190> <1191> <57d2>\n<11b7> <11b9> <58fb>\n<11c0> <11c1> <592c>\n<11db> <11dc> <59d9>\nendbfrange\n\n100 beginbfrange\n<11e6> <11e7> <5a35>\n<11f5> <11f6> <5afa>\n<1204> <1205> <5b5a>\n<1221> <1222> <5c07>\n<1228> <1229> <5c38>\n<1275> <1276> <5e36>\n<1281> <1282> <5e75>\n<1287> <1288> <5ec1>\n<128f> <1290> <5eda>\n<1293> <1294> <5ee8>\n<12ac> <12ad> <5f56>\n<12ec> <12ed> <6096>\n<12fe> <12ff> <60f6>\n<1307> <1308> <610d>\n<1317> <1319> <6158>\n<1342> <1343> <6208>\n<134d> <134e> <6232>\n<135a> <135b> <6292>\n<13b0> <13b1> <64e0>\n<13c2> <13c3> <6534>\n<13d1> <13d2> <6582>\n<13e0> <13e1> <65e0>\n<13e8> <13e9> <6635>\n<13f3> <13f4> <6667>\n<1412> <1413> <6726>\n<141f> <1420> <6763>\n<14be> <14bf> <6aa2>\n<14e4> <14e5> <6b78>\n<14e6> <14e7> <6b7f>\n<14ef> <14f0> <6baa>\n<1501> <1502> <6c13>\n<156a> <156b> <6ed4>\n<15e4> <15e5> <723b>\n<15e6> <15e7> <723f>\n<15fc> <15fd> <72e0>\n<160b> <160c> <734e>\n<163e> <163f> <74f0>\n<165c> <165d> <7586>\n<1675> <1676> <75fe>\n<167b> <167c> <75f2>\n<1682> <1684> <7620>\n<1689> <168a> <7647>\n<168e> <168f> <7661>\n<1690> <1692> <7668>\n<16a1> <16a2> <7699>\n<16a5> <16a7> <76b8>\n<16b9> <16ba> <7725>\n<16bc> <16bd> <7737>\n<16d0> <16d1> <77bc>\n<170e> <170f> <79b9>\n<1718> <1719> <7a18>\n<1724> <1725> <7a61>\n<173e> <173f> <7ad9>\n<1741> <1742> <7ae1>\n<174b> <174c> <7b18>\n<175c> <175d> <7b70>\n<17f5> <17f6> <7e59>\n<1801> <1802> <7e88>\n<1806> <1807> <7e93>\n<180a> <180b> <7e9b>\n<180f> <1811> <7f4c>\n<1812> <1813> <7f50>\n<1817> <1818> <7f5f>\n<1819> <181a> <7f68>\n<182f> <1830> <7fc5>\n<183e> <183f> <8018>\n<1874> <1875> <8165>\n<1892> <1893> <81df>\n<1895> <1896> <81fa>\n<1898> <1899> <8201>\n<18ad> <18ae> <826a>\n<18b1> <18b2> <8277>\n<18d5> <18d6> <8317>\n<191d> <191e> <8517>\n<1957> <1958> <86a9>\n<1959> <195a> <868b>\n<199f> <19a0> <87f6>\n<19c6> <19c7> <88c3>\n<19c9> <19ca> <88d8>\n<19d9> <19da> <892a>\n<19f9> <19fa> <89bf>\n<19fc> <19fd> <89dc>\n<1a18> <1a19> <8aa5>\n<1a4a> <1a4b> <8b92>\n<1a4d> <1a4e> <8b99>\n<1a5f> <1a60> <8c8d>\n<1a68> <1a69> <8cb2>\n<1a72> <1a73> <8cfa>\n<1a74> <1a75> <8d04>\n<1a8f> <1a90> <8dea>\n<1a94> <1a95> <8e08>\n<1a97> <1a98> <8e1d>\n<1adf> <1ae1> <8f62>\n<1af0> <1af1> <8ff9>\n<1afe> <1aff> <904f>\n<1b00> <1b01> <9051>\n<1b33> <1b34> <91c0>\n<1b3d> <1b3e> <91f5>\n<1b69> <1b6a> <93ac>\n<1b6d> <1b6e> <93d6>\nendbfrange\n\n100 beginbfrange\n<1b99> <1b9a> <9598>\n<1bb1> <1bb2> <962e>\n<1bc5> <1bc6> <96b1>\n<1bca> <1bcb> <96b8>\n<1be2> <1be3> <973d>\n<1bf8> <1bf9> <978f>\n<1bfe> <1bff> <97b3>\n<1c16> <1c18> <986f>\n<1c2a> <1c2b> <991d>\n<1c30> <1c31> <993d>\n<1c37> <1c38> <9951>\n<1c3b> <1c3c> <9997>\n<1c3e> <1c3f> <99ad>\n<1c46> <1c47> <99ed>\n<1c48> <1c49> <99f1>\n<1c69> <1c6a> <9ad3>\n<1c6b> <1c6c> <9ade>\n<1c6d> <1c6e> <9ae2>\n<1c7b> <1c7c> <9b22>\n<1c7e> <1c81> <9b27>\n<1c82> <1c83> <9b2e>\n<1c88> <1c89> <9b4d>\n<1c90> <1c91> <9b96>\n<1c92> <1c93> <9b9f>\n<1c9b> <1c9c> <9bd1>\n<1cd4> <1cd5> <9d5d>\n<1cf3> <1cf4> <9e1a>\n<1cfb> <1cfc> <9e8b>\n<1d08> <1d0a> <9ece>\n<1d14> <1d15> <9ef6>\n<1d17> <1d19> <9efb>\n<1d1a> <1d1b> <9f07>\n<1d25> <1d27> <9f5f>\n<1d28> <1d29> <9f66>\n<1d37> <1d82> <2500>\n<1d83> <1d96> <2460>\n<1d97> <1da0> <2160>\n<1db1> <1db3> <339c>\n<1db4> <1db5> <338e>\n<1dbd> <1dc1> <32a4>\n<1dc2> <1dc3> <3231>\n<1dcf> <1dd0> <2229>\n<1e81> <1e82> <f992>\n<1ecf> <1ed0> <3001>\n<1edb> <1edc> <ff08>\n<1edd> <1ede> <3014>\n<1edf> <1ee0> <fe47>\n<1ee3> <1eec> <3008>\n<1f02> <1f03> <30f5>\n<1f14> <1f15> <301d>\n<1f16> <1f18> <3094>\n<1f56> <1f57> <33a4>\n<1f5f> <1f61> <3385>\n<1f7e> <1f86> <2488>\n<1f87> <1f9a> <2474>\n<1f9c> <1fa5> <2170>\n<1fa6> <1faf> <3252>\n<1fb0> <1fc9> <249c>\n<1fee> <1ff0> <23ab>\n<1ff2> <1ff4> <23a7>\n<2000> <2001> <3388>\n<2006> <200b> <322a>\n<200f> <2011> <2b05>\n<2017> <201a> <2600>\n<201c> <201d> <261c>\n<2021> <2022> <216a>\n<2026> <202d> <2581>\n<2035> <2036> <2594>\n<2037> <2038> <256d>\n<203f> <2040> <25e2>\n<2045> <2047> <2571>\n<2048> <2049> <3095>\n<2053> <2054> <2018>\n<2055> <2056> <201c>\n<205e> <2066> <2776>\n<206a> <206b> <217a>\n<2076> <2077> <21c4>\n<2079> <207c> <30f7>\n<20fe> <20ff> <5db8>\n<215c> <215d> <7146>\n<2183> <2185> <fa18>\n<21a4> <21a5> <fa20>\n<21b8> <21b9> <fa24>\n<21c2> <21c3> <91ed>\n<21c4> <21c5> <91e4>\n<21d2> <21d3> <9277>\n<21fb> <21fc> <fa2a>\n<2210> <224b> <0020>\n<224d> <226b> <005d>\n<2274> <2276> <00a1>\n<227d> <227e> <2039>\n<227f> <2280> <fb01>\n<2282> <2283> <2020>\n<228e> <228f> <0301>\n<2291> <2293> <0306>\n<22aa> <22ad> <00b0>\n<22b0> <22b2> <00bc>\n<22b3> <22b8> <00c0>\n<22b9> <22c9> <00c7>\n<22ca> <22cf> <00d9>\nendbfrange\n\n100 beginbfrange\n<22d0> <22d5> <00e0>\n<22d6> <22e6> <00e7>\n<22e7> <22ed> <00f9>\n<22f7> <22ff> <0021>\n<2300> <2331> <002a>\n<2333> <2353> <005d>\n<2362> <2363> <00a2>\n<237c> <23bb> <ff60>\n<23bc> <23bd> <30f0>\n<23d1> <23d2> <30d0>\n<23d3> <23d4> <30d3>\n<23d5> <23d6> <30d6>\n<23d7> <23d8> <30d9>\n<23d9> <23da> <30dc>\n<23ea> <23eb> <304a>\n<23fa> <23ff> <306a>\n<2404> <2408> <307e>\n<240b> <2410> <3088>\n<2413> <2414> <3090>\n<2425> <2426> <3070>\n<2427> <2428> <3073>\n<2429> <242a> <3076>\n<242b> <242c> <3079>\n<242d> <242e> <307c>\n<242f> <2430> <301d>\n<2433> <2436> <3008>\n<2437> <243a> <300e>\n<243d> <2488> <2500>\n<248c> <248d> <2032>\n<248f> <2490> <fb03>\n<249b> <249e> <215b>\n<249f> <24a0> <2153>\n<24a2> <24a7> <2074>\n<24a8> <24b1> <2080>\n<24d4> <24d5> <0259>\n<24d7> <24d8> <025a>\n<24e4> <24ff> <0020>\n<2500> <251f> <003c>\n<2521> <253f> <005d>\n<2548> <254a> <00a1>\n<2551> <2552> <2039>\n<2553> <2554> <fb01>\n<2556> <2557> <2020>\n<2562> <2563> <0301>\n<2565> <2567> <0306>\n<257e> <2581> <00b0>\n<2584> <2586> <00bc>\n<2587> <258c> <00c0>\n<258d> <259d> <00c7>\n<259e> <25a3> <00d9>\n<25a4> <25a9> <00e0>\n<25aa> <25ba> <00e7>\n<25bb> <25c1> <00f9>\n<25cc> <25cd> <2032>\n<25cf> <25d0> <fb03>\n<25db> <25de> <215b>\n<25df> <25e0> <2153>\n<25e2> <25e7> <2074>\n<25e8> <25f1> <2080>\n<260a> <2613> <0030>\n<2618> <2619> <0028>\n<261a> <261b> <002e>\n<261c> <261d> <003a>\n<261e> <2627> <0030>\n<262c> <262d> <0028>\n<262e> <262f> <002e>\n<2630> <2631> <003a>\n<2635> <2636> <2153>\n<2638> <263d> <2155>\n<2644> <2647> <215b>\n<2690> <2699> <0030>\n<26f6> <26ff> <2170>\n<2700> <2701> <217a>\n<2705> <2710> <2160>\n<2714> <272d> <0041>\n<2732> <2733> <304a>\n<2742> <2747> <306a>\n<274c> <2750> <307e>\n<2753> <2758> <3088>\n<2759> <275d> <308f>\n<2762> <2763> <30aa>\n<2772> <2777> <30ca>\n<277c> <2780> <30de>\n<2783> <2788> <30e8>\n<2789> <278d> <30ef>\n<278e> <2797> <3220>\n<27a8> <27b1> <0030>\n<27b2> <27bb> <0030>\n<27fb> <27ff> <2460>\n<2800> <2803> <2465>\n<2849> <2862> <24d0>\n<2863> <287c> <24b6>\n<2881> <2882> <304a>\n<2891> <2896> <306a>\n<289b> <289f> <307e>\n<28a2> <28a7> <3088>\n<28a8> <28ac> <308f>\n<28ad> <28db> <32d0>\n<28dd> <28e6> <3280>\n<28e8> <28ed> <328a>\nendbfrange\n\n100 beginbfrange\n<28f6> <28f7> <32a0>\n<296d> <2986> <0061>\n<2987> <29a0> <0041>\n<29a5> <29a6> <304a>\n<29b5> <29ba> <306a>\n<29bf> <29c3> <307e>\n<29c6> <29cb> <3088>\n<29cc> <29d0> <308f>\n<29d5> <29d6> <30aa>\n<29e5> <29ea> <30ca>\n<29ef> <29f3> <30de>\n<29f6> <29fb> <30e8>\n<29fc> <29ff> <30ef>\n<2a7b> <2a94> <0061>\n<2a95> <2aae> <0041>\n<2ab3> <2ab4> <304a>\n<2ac3> <2ac8> <306a>\n<2acd> <2ad1> <307e>\n<2ad4> <2ad9> <3088>\n<2ada> <2ade> <308f>\n<2ae3> <2ae4> <30aa>\n<2af3> <2af8> <30ca>\n<2afd> <2aff> <30de>\n<2b00> <2b01> <30e1>\n<2b04> <2b09> <30e8>\n<2b0a> <2b0e> <30ef>\n<2b8c> <2ba5> <0061>\n<2ba6> <2bbf> <0041>\n<2bc4> <2bc5> <304a>\n<2bd4> <2bd9> <306a>\n<2bde> <2be2> <307e>\n<2be5> <2bea> <3088>\n<2beb> <2bef> <308f>\n<2bf4> <2bf5> <30aa>\n<2c04> <2c09> <30ca>\n<2c0e> <2c12> <30de>\n<2c15> <2c1a> <30e8>\n<2c1b> <2c1f> <30ef>\n<2c9a> <2cb3> <0061>\n<2cb4> <2ccd> <0041>\n<2cd2> <2cd3> <304a>\n<2ce2> <2ce7> <306a>\n<2cec> <2cf0> <307e>\n<2cf3> <2cf8> <3088>\n<2cf9> <2cfd> <308f>\n<2d02> <2d03> <30aa>\n<2d12> <2d17> <30ca>\n<2d1c> <2d20> <30de>\n<2d23> <2d28> <30e8>\n<2d29> <2d2d> <30ef>\n<2da7> <2dc0> <0061>\n<2dc1> <2dda> <0041>\n<2ddf> <2de0> <304a>\n<2def> <2df4> <306a>\n<2df9> <2dfd> <307e>\n<2e00> <2e05> <3088>\n<2e06> <2e0a> <308f>\n<2e0f> <2e10> <30aa>\n<2e1f> <2e24> <30ca>\n<2e29> <2e2d> <30de>\n<2e30> <2e35> <30e8>\n<2e36> <2e3a> <30ef>\n<2e4c> <2e4d> <2121>\n<2e5d> <2e5e> <33d7>\n<2e62> <2e63> <3301>\n<2e71> <2e76> <330e>\n<2e7c> <2e7f> <331a>\n<2e80> <2e82> <331f>\n<2e88> <2e89> <3328>\n<2e8e> <2e90> <332e>\n<2e94> <2e95> <3334>\n<2ea0> <2ea2> <333e>\n<2ea3> <2ea6> <3343>\n<2ea8> <2ea9> <334b>\n<2eaa> <2eab> <334f>\n<2eb3> <2eb4> <3355>\n<2eb6> <2eb7> <3301>\n<2ec5> <2eca> <330e>\n<2ed0> <2ed3> <331a>\n<2ed4> <2ed6> <331f>\n<2edc> <2edd> <3328>\n<2ee2> <2ee4> <332e>\n<2ee8> <2ee9> <3334>\n<2ef4> <2ef6> <333e>\n<2ef7> <2efa> <3343>\n<2efc> <2efd> <334b>\n<2efe> <2eff> <334f>\n<2f07> <2f08> <3355>\n<2f26> <2f29> <300c>\n<2f2a> <2f2b> <301a>\n<2f2c> <2f2d> <3018>\n<2f2e> <2f2f> <ff08>\n<2f30> <2f31> <301d>\n<2f32> <2f33> <2018>\n<2f34> <2f35> <201c>\n<2f42> <2f43> <2668>\n<2f4c> <2f4e> <3033>\n<2f59> <2f5a> <2272>\n<2f5b> <2f5e> <300c>\n<2f5f> <2f60> <301a>\nendbfrange\n\n100 beginbfrange\n<2f61> <2f62> <3018>\n<2f63> <2f64> <ff5f>\n<2f65> <2f68> <300c>\n<2f69> <2f6a> <301a>\n<2f6b> <2f6c> <3018>\n<2f6d> <2f6e> <ff5f>\n<2f70> <2f71> <239d>\n<2f78> <2f79> <23a3>\n<2f80> <2f81> <23a3>\n<2f89> <2f8a> <301d>\n<2f8b> <2f8c> <2018>\n<2f8d> <2f8e> <2018>\n<2faa> <2fab> <2198>\n<2fac> <2fad> <2196>\n<2fb0> <2fb1> <21c4>\n<2fb5> <2fb7> <2193>\n<2fc7> <2fc8> <25a0>\n<2fd3> <2fd4> <25c6>\n<2fe5> <2fe6> <3008>\n<2fe7> <2fea> <3008>\n<2feb> <2fec> <300a>\n<2ff1> <2ff2> <309d>\n<2ff3> <2ffc> <3041>\n<2ffe> <2fff> <304b>\n<3000> <3003> <304d>\n<3005> <3007> <3051>\n<3008> <3049> <3053>\n<304a> <304b> <30fd>\n<304d> <3056> <30a1>\n<3058> <305d> <30ab>\n<305f> <3061> <30b1>\n<3062> <30a3> <30b3>\n<30a4> <30a7> <30f7>\n<30a8> <30a9> <309d>\n<30aa> <30b3> <3041>\n<30b5> <30ba> <304b>\n<30bc> <30be> <3051>\n<30bf> <30ff> <3053>\n<3101> <3102> <30fd>\n<3104> <310d> <30a1>\n<310f> <3114> <30ab>\n<3116> <3118> <30b1>\n<3119> <315a> <30b3>\n<315b> <315e> <30f7>\n<315f> <3160> <fe45>\n<3169> <316a> <30fd>\n<316b> <316c> <309d>\n<316d> <316e> <ff08>\n<316f> <3170> <3014>\n<3171> <3172> <ff08>\n<3173> <3174> <3014>\n<3175> <317e> <0030>\n<317f> <3189> <3041>\n<318b> <3190> <304c>\n<3192> <31d4> <3052>\n<31e1> <31eb> <30a1>\n<31ed> <31f2> <30ac>\n<31f4> <31ff> <30b2>\n<3200> <3236> <30be>\n<323c> <323d> <30f5>\n<3248> <3249> <2032>\n<324b> <324c> <fb03>\n<3257> <325a> <215b>\n<325b> <325c> <2153>\n<325e> <3263> <2074>\n<3264> <326d> <2080>\n<3290> <3291> <0259>\n<3293> <3294> <025a>\n<32a0> <32db> <0020>\n<32dd> <32fb> <005d>\n<3304> <3306> <00a1>\n<330d> <330e> <2039>\n<330f> <3310> <fb01>\n<3312> <3313> <2020>\n<331e> <331f> <0301>\n<3321> <3323> <0306>\n<333a> <333d> <00b0>\n<3340> <3342> <00bc>\n<3343> <3348> <00c0>\n<3349> <3359> <00c7>\n<335a> <335f> <00d9>\n<3360> <3365> <00e0>\n<3366> <3376> <00e7>\n<3377> <337d> <00f9>\n<3388> <3389> <2032>\n<338b> <338c> <fb03>\n<3397> <339a> <215b>\n<339b> <339c> <2153>\n<339e> <33a3> <2074>\n<33a4> <33ad> <2080>\n<33c6> <33cf> <0030>\n<33d4> <33d5> <0028>\n<33d6> <33d7> <002e>\n<33d8> <33d9> <003a>\n<33da> <33e3> <0030>\n<33e8> <33e9> <0028>\n<33ea> <33eb> <002e>\n<33ec> <33ed> <003a>\n<33f6> <33f9> <300c>\n<33fa> <33fb> <301a>\nendbfrange\n\n100 beginbfrange\n<33fc> <33fd> <3018>\n<33fe> <33ff> <ff08>\n<3400> <3401> <301d>\n<3402> <3403> <2018>\n<3404> <3405> <201c>\n<3425> <3426> <fa5b>\n<3609> <360a> <2e8c>\n<36d1> <36d2> <5fd8>\n<36f9> <36fa> <7336>\n<376b> <376c> <7f50>\n<376f> <3770> <7fc5>\n<3776> <3777> <2ebf>\n<37d8> <37d9> <4e04>\n<37dc> <37dd> <4e2f>\n<37de> <37df> <4e40>\n<37f1> <37f2> <4f7d>\n<37f7> <37f8> <5000>\n<3813> <3814> <5201>\n<381c> <381d> <530a>\n<3838> <3839> <5560>\n<383d> <383e> <560e>\n<3847> <3848> <5671>\n<384b> <384c> <56ac>\n<3855> <3856> <5733>\n<385e> <385f> <57f5>\n<3874> <3875> <59e3>\n<3889> <388a> <5b7e>\n<38a3> <38a4> <5e14>\n<38a8> <38a9> <5e6b>\n<38ac> <38ad> <5ebe>\n<38b2> <38b3> <5f1c>\n<38d3> <38d5> <6112>\n<38ea> <38eb> <6342>\n<38fc> <38fd> <64be>\n<390d> <390e> <665b>\n<3923> <3924> <6830>\n<3930> <3931> <68f0>\n<393a> <393b> <697f>\n<393f> <3940> <69d6>\n<3948> <3949> <6a50>\n<394f> <3951> <6a9d>\n<396d> <396e> <6ceb>\n<3990> <3991> <6fa7>\n<399a> <399b> <705d>\n<39a2> <39a3> <70d3>\n<39b8> <39b9> <7255>\n<39c0> <39c1> <7304>\n<39c8> <39c9> <7385>\n<39cb> <39cd> <739e>\n<39da> <39db> <741a>\n<39df> <39e1> <742f>\n<39ed> <39ef> <7485>\n<3a00> <3a01> <7592>\n<3a07> <3a08> <7615>\n<3a14> <3a15> <76a4>\n<3a1d> <3a1e> <775f>\n<3a28> <3a29> <782d>\n<3a32> <3a33> <78e0>\n<3a3c> <3a3d> <795b>\n<3a54> <3a55> <7abb>\n<3a72> <3a73> <7cc8>\n<3a78> <3a7a> <7d07>\n<3a84> <3a85> <7d8b>\n<3a97> <3a98> <7f52>\n<3aa0> <3aa1> <7fee>\n<3ab0> <3ab1> <80d7>\n<3ad1> <3ad2> <83bf>\n<3aef> <3af0> <86a7>\n<3afc> <3afd> <87ac>\n<3b0d> <3b0e> <88bd>\n<3b12> <3b13> <88f0>\n<3b15> <3b17> <8918>\n<3b29> <3b2a> <8b43>\n<3b4f> <3b50> <8fb5>\n<3b6d> <3b6e> <91ad>\n<3b7d> <3b7e> <92cb>\n<3bb1> <3bb2> <97b5>\n<3bbc> <3bbd> <9852>\n<3bc5> <3bc6> <9932>\n<3bcc> <3bcd> <99b9>\n<3bd3> <3bd4> <9a2d>\n<3bd9> <3bda> <9ab5>\n<3bde> <3bdf> <9b33>\n<3c54> <3c56> <f860>\n<3c59> <3c5a> <30fd>\n<3c5b> <3c5c> <309d>\n<3c61> <3c62> <2266>\n<3c6a> <3c6b> <2286>\n<3c6c> <3c6d> <2282>\n<3c70> <3c71> <2284>\n<3c72> <3c73> <228a>\n<3c76> <3c77> <2305>\n<3c78> <3c79> <2227>\n<3c7e> <3c80> <2295>\n<3c81> <3c82> <2225>\n<3c89> <3c8a> <226a>\n<3c8f> <3c90> <222b>\n<3c95> <3c96> <2276>\n<3c9d> <3cf2> <3041>\n<3cf8> <3cff> <30a1>\nendbfrange\n\n100 beginbfrange\n<3d00> <3d4d> <30a9>\n<3d56> <3d5f> <31f0>\n<3d61> <3d66> <31fa>\n<3d67> <3d6a> <30f7>\n<3d6d> <3d6e> <22da>\n<3d71> <3d72> <1e3e>\n<3d73> <3d74> <01f8>\n<3deb> <3def> <02e5>\n<3df6> <3df7> <031f>\n<3e00> <3e01> <031d>\n<3e02> <3e03> <0318>\n<3e05> <3e06> <033a>\n<3e0b> <3e0c> <0262>\n<3e1a> <3e1b> <02e0>\n<3e1f> <3e20> <2272>\n<3e2b> <3e2c> <1e3e>\n<3e2d> <3e2e> <01f8>\n<3e68> <3e69> <30fd>\n<3e6a> <3e6b> <309d>\n<3e71> <3ec6> <3041>\n<3ecc> <3eff> <30a1>\n<3f00> <3f21> <30d5>\n<3f2a> <3f33> <31f0>\n<3f35> <3f3a> <31fa>\n<3f3b> <3f3e> <30f7>\n<3f45> <3f46> <3016>\n<3f49> <3f4a> <2934>\n<3f4f> <3f50> <29fa>\n<3f5f> <3f68> <24f5>\n<3f69> <3f6a> <2616>\n<3f6c> <3f75> <31f0>\n<3f77> <3f7c> <31fa>\n<3f7d> <3f8b> <23be>\n<3f92> <3f95> <25d0>\n<3f96> <3f97> <2047>\n<3f9b> <3faa> <3190>\n<3fb0> <3fb1> <2276>\n<3fb2> <3fb3> <2284>\n<3fb4> <3fb5> <228a>\n<3fb6> <3fb7> <22da>\n<3fb8> <3fb9> <23b0>\n<3fba> <3fc5> <2672>\n<3fc6> <3fc7> <3099>\n<3fc9> <3fca> <3016>\n<3fcd> <3fd6> <31f0>\n<3fd8> <3fdd> <31fa>\n<3fde> <3fdf> <23b0>\n<3fed> <3ff6> <31f0>\n<3ff8> <3ffd> <31fa>\n<400b> <4014> <31f0>\n<4016> <401b> <31fa>\n<402b> <4034> <31f0>\n<4036> <403b> <31fa>\n<403c> <403f> <30f7>\n<4042> <404b> <31f0>\n<404d> <4052> <31fa>\n<4056> <4057> <2266>\n<405d> <405e> <2286>\n<405f> <4060> <2282>\n<4063> <4064> <2284>\n<4065> <4066> <228a>\n<4069> <406a> <2305>\n<406b> <406c> <2227>\n<4071> <4073> <2295>\n<4074> <4075> <2225>\n<407c> <407d> <226a>\n<4082> <4083> <222b>\n<4088> <4089> <2276>\n<4090> <4091> <22da>\n<4094> <4095> <1e3e>\n<4096> <4097> <01f8>\n<410e> <4112> <02e5>\n<4119> <411a> <031f>\n<4123> <4124> <031d>\n<4125> <4126> <0318>\n<4128> <4129> <033a>\n<412e> <412f> <0262>\n<413d> <413e> <02e0>\n<4142> <4143> <2272>\n<414e> <414f> <1e3e>\n<4150> <4151> <01f8>\n<41f9> <41fa> <6677>\n<4267> <4268> <774d>\n<429e> <429f> <8167>\n<42a9> <42aa> <82a3>\n<42cc> <42cd> <8604>\n<4302> <4303> <90c4>\n<4308> <4309> <9122>\n<430f> <4310> <9364>\n<433f> <4340> <9c4f>\n<4342> <4343> <9d1d>\n<436c> <436d> <4f77>\n<437e> <437f> <5092>\n<4384> <4385> <50ba>\n<43ab> <43ac> <52ba>\n<43bd> <43be> <355d>\n<43d4> <43d5> <5500>\n<4404> <4405> <56f6>\n<440a> <440b> <5745>\n<4410> <4412> <5773>\nendbfrange\n\n100 beginbfrange\n<4417> <4418> <579d>\n<442d> <442e> <588a>\n<4430> <4431> <588f>\n<443a> <443b> <58f3>\n<443c> <443d> <5905>\n<4449> <444a> <5975>\n<445f> <4460> <5a9f>\n<4478> <4479> <3761>\n<4485> <4486> <5c67>\n<44bd> <44be> <5e6d>\n<44d2> <44d4> <5fd2>\n<44d6> <44d7> <5fee>\n<44f0> <44f1> <6192>\n<4507> <4508> <d84adf4f>\n<450b> <450c> <633b>\n<4519> <451a> <63d4>\n<451c> <451d> <63eb>\n<452a> <452b> <64cb>\n<4552> <4553> <666c>\n<458d> <458f> <6898>\n<4591> <4592> <68aa>\n<459c> <459d> <68e4>\n<45b5> <45b6> <69ee>\n<45bf> <45c0> <6a32>\n<45d4> <45d6> <6af1>\n<45da> <45dc> <6b0f>\n<45eb> <45ed> <6bc7>\n<45ef> <45f0> <6be6>\n<4608> <4609> <6d26>\n<4610> <4611> <6d80>\n<4627> <4628> <6e48>\n<4629> <462a> <6e4b>\n<462c> <462d> <6e53>\n<464b> <464c> <6fc8>\n<4675> <4676> <71ae>\n<4682> <4683> <726e>\n<4693> <4694> <7318>\n<469e> <469f> <736e>\n<46cd> <46ce> <753d>\n<46d6> <46d7> <757d>\n<46de> <46df> <75bf>\n<46e4> <46e5> <75df>\n<46f0> <46f1> <761b>\n<4702> <4703> <76a7>\n<471b> <471c> <77de>\n<4732> <4733> <78f9>\n<4744> <4745> <79cc>\n<4769> <476a> <7b2e>\n<4793> <4794> <7cb6>\n<47a4> <47a5> <7d3d>\n<47c7> <47c8> <7e86>\n<47d3> <47d4> <7f63>\n<47d6> <47d7> <7f7d>\n<4829> <482a> <82a7>\n<4832> <4833> <8307>\n<483f> <4840> <8394>\n<484e> <484f> <8451>\n<4850> <4851> <8459>\n<485d> <485e> <84ce>\n<4867> <4868> <8524>\n<486e> <486f> <8561>\n<487a> <487b> <d85bdff6>\n<487f> <4880> <85d8>\n<4895> <4896> <869c>\n<48ae> <48af> <8764>\n<48c2> <48c3> <87e5>\n<4908> <4909> <8b94>\n<492a> <492b> <8e21>\n<4955> <4956> <d861ddc8>\n<4968> <4969> <90fe>\n<4970> <4971> <9146>\n<4979> <497a> <91c3>\n<497f> <4980> <9216>\n<4989> <498a> <927c>\n<4992> <4993> <d862ddba>\n<4995> <4996> <92bf>\n<49b5> <49b6> <9416>\n<49c0> <49c1> <958c>\n<49c8> <49c9> <9633>\n<49e9> <49ea> <97b1>\n<49f8> <49f9> <9832>\n<4a02> <4a03> <98bb>\n<4a0a> <4a0b> <98f0>\n<4a10> <4a11> <9916>\n<4a13> <4a15> <991a>\n<4a18> <4a1a> <993a>\n<4a4c> <4a4d> <9b6b>\n<4a4e> <4a4f> <9b76>\n<4a60> <4a62> <9c18>\n<4a6c> <4a6d> <9c49>\n<4a74> <4a76> <9c69>\n<4a77> <4a78> <9c6d>\n<4a81> <4a82> <9d17>\n<4a8e> <4a8f> <9d76>\n<4ac5> <4ac6> <4e23>\n<4adf> <4ae1> <510c>\n<4aeb> <4aec> <51d3>\n<4af3> <4af4> <5231>\n<4afa> <4afb> <5278>\n<4b11> <4b12> <53c4>\nendbfrange\n\n100 beginbfrange\n<4b17> <4b18> <5434>\n<4b39> <4b3a> <5611>\n<4b4d> <4b4e> <571a>\n<4b52> <4b53> <573d>\n<4b98> <4b99> <5ed4>\n<4bc8> <4bc9> <63ae>\n<4bcb> <4bcc> <63f8>\n<4bd9> <4bda> <6498>\n<4bed> <4bee> <668b>\n<4c0f> <4c10> <6ac8>\n<4c14> <4c15> <6b7d>\n<4c2e> <4c2f> <6eda>\n<4c3c> <4c3d> <70d5>\n<4c44> <4c45> <724f>\n<4c52> <4c53> <733a>\n<4c87> <4c88> <778c>\n<4c9d> <4c9e> <7927>\n<4cc0> <4cc1> <7c52>\n<4cc2> <4cc4> <7c5b>\n<4cd8> <4cd9> <7df5>\n<4ce5> <4ce6> <7f7f>\n<4ce9> <4ceb> <7ffd>\n<4d05> <4d06> <81dd>\n<4d0c> <4d0d> <8213>\n<4d34> <4d35> <8797>\n<4d46> <4d48> <889a>\n<4d4c> <4d4d> <890e>\n<4d85> <4d86> <8df1>\n<4d8c> <4d8d> <8e40>\n<4daa> <4dac> <8fa0>\n<4dd0> <4dd1> <92bb>\n<4de2> <4de3> <940d>\n<4deb> <4dec> <95d1>\n<4e11> <4e12> <9862>\n<4e22> <4e23> <9abd>\n<4e27> <4e28> <9b0d>\n<4e45> <4e47> <9e82>\n<4e52> <4e53> <9f2a>\n<4e75> <4e76> <5271>\n<4ea0> <4ea1> <655d>\n<4f09> <4f0a> <9089>\n<4f5d> <4f5e> <0384>\n<4f91> <4f92> <2264>\n<4f94> <4f95> <0384>\n<4fc8> <4fc9> <2264>\n<4fcc> <4fce> <0388>\n<4fd4> <4fd7> <03ac>\n<4fda> <4fdb> <03cc>\n<4fdf> <4fe9> <0402>\n<4fea> <4feb> <040e>\n<4fec> <4ff6> <0452>\n<4ff7> <4ff8> <045e>\n<4ff9> <4ffa> <30ce>\n<5000> <5003> <30df>\n<5006> <500b> <30e8>\n<500c> <5010> <30ef>\n<5011> <5016> <0041>\n<5021> <5029> <0031>\n<5035> <503e> <0030>\n<503f> <5048> <0030>\n<506b> <506c> <2491>\n<51e1> <51e2> <0384>\n<5215> <5216> <2264>\n<5218> <5219> <0384>\n<524c> <524d> <2264>\n<5257> <5258> <4e74>\n<5268> <5269> <4f4b>\n<5278> <527a> <4fbb>\n<527b> <527c> <4fc0>\n<5289> <528a> <5032>\n<528e> <528f> <5051>\n<5296> <5297> <5083>\n<529c> <529e> <509f>\n<529f> <52a0> <50af>\n<52a5> <52a6> <50dc>\n<52ae> <52af> <511c>\n<52b1> <52b2> <5127>\n<52b3> <52b4> <512c>\n<52ce> <52d0> <5295>\n<52d5> <52d7> <52b6>\n<52ea> <52ec> <5327>\n<52ed> <52ee> <532b>\n<52f5> <52f6> <5387>\n<52fd> <52fe> <53d2>\n<530d> <530e> <546d>\n<5319> <531a> <550c>\n<5321> <5322> <555a>\n<5329> <532a> <55d7>\n<5333> <5334> <5643>\n<5336> <5338> <5661>\n<5342> <5344> <56e5>\n<5345> <5346> <5701>\n<534a> <534b> <5724>\n<536d> <536e> <5887>\n<5371> <5373> <58a0>\n<537c> <537d> <5912>\n<5383> <5384> <5935>\n<53a2> <53a3> <5a44>\n<53b8> <53b9> <5b90>\n<53bb> <53bc> <5ba8>\nendbfrange\n\n100 beginbfrange\n<53bf> <53c0> <5bb1>\n<53c6> <53c7> <5bd9>\n<53d1> <53d2> <5c74>\n<53dc> <53dd> <5cf1>\n<53e4> <53e5> <5d5f>\n<53e8> <53e9> <5d79>\n<53f8> <53f9> <5e50>\n<5409> <540a> <5f2b>\n<5412> <5413> <5f74>\n<541a> <541b> <5fb0>\n<541d> <541e> <5fd0>\n<542b> <542c> <6056>\n<543b> <543c> <60c9>\n<543d> <543e> <60ce>\n<544f> <5450> <6180>\n<5451> <5452> <6183>\n<5457> <5458> <61c0>\n<5459> <545a> <61ce>\n<545f> <5460> <61ec>\n<546e> <5470> <628d>\n<5472> <5473> <62b6>\n<5475> <5476> <62be>\n<54a4> <54a5> <64e9>\n<54a8> <54aa> <6508>\n<54af> <54b0> <653c>\n<54bf> <54c0> <65f4>\n<54c1> <54c2> <65fe>\n<54c4> <54c5> <6611>\n<54d6> <54d8> <669a>\n<54db> <54dc> <66c2>\n<54ee> <54ef> <67bc>\n<5500> <5501> <6870>\n<550a> <550b> <68dc>\n<5517> <5518> <6970>\n<5528> <5529> <6a86>\n<552b> <552c> <6ab0>\n<552e> <552f> <6abe>\n<5531> <5532> <6ad5>\n<5536> <5537> <6b06>\n<5544> <5545> <6b9f>\n<5546> <5547> <6ba2>\n<554a> <554b> <6bb8>\n<554c> <554d> <6bc3>\n<5552> <5554> <6c26>\n<557f> <5580> <6ead>\n<5587> <5588> <6eed>\n<55b3> <55b4> <71bf>\n<55b8> <55b9> <7208>\n<55c3> <55c4> <727b>\n<55c8> <55c9> <72d5>\n<55d2> <55d5> <735d>\n<55e6> <55e7> <73ff>\n<55ea> <55eb> <7467>\n<55f1> <55f2> <74b1>\n<5607> <5608> <757b>\n<5610> <5611> <7639>\n<5616> <5617> <768c>\n<5619> <561a> <76a2>\n<5622> <5623> <7714>\n<5629> <562a> <7756>\n<562c> <562d> <7773>\n<5640> <5641> <7860>\n<5673> <5674> <7a34>\n<5687> <5688> <7b3f>\n<5691> <5692> <7bba>\n<5697> <5698> <7bf4>\n<5699> <569a> <7bf9>\n<56a4> <56a5> <7c39>\n<56c0> <56c3> <7dc3>\n<56c4> <56c5> <7dcd>\n<56d5> <56d6> <7e9d>\n<56e7> <56e8> <801f>\n<570a> <570c> <81f0>\n<5719> <571a> <8280>\n<571f> <5720> <829a>\n<5726> <5727> <830a>\n<5728> <5729> <831e>\n<5731> <5732> <834d>\n<574e> <574f> <84a9>\n<5750> <5751> <84c7>\n<5755> <5756> <8502>\n<5763> <5764> <855c>\n<5765> <5766> <855f>\n<5770> <5772> <85bd>\n<5779> <577a> <860d>\n<5780> <5781> <8658>\n<5783> <5784> <8660>\n<578d> <578e> <86b4>\n<579e> <579f> <873c>\n<57a4> <57a7> <8783>\n<57c1> <57c2> <8848>\n<57ce> <57cf> <88cb>\n<57d4> <57d5> <8915>\n<57e8> <57e9> <899b>\n<57f1> <57f2> <8a04>\n<57f7> <57f8> <8a2b>\n<5801> <5802> <8a76>\n<5803> <5804> <8a7a>\n<5815> <5817> <8ad3>\n<582d> <582e> <8c63>\nendbfrange\n\n58 beginbfrange\n<5830> <5831> <8c75>\n<5833> <5834> <8c86>\n<5837> <5838> <8c9b>\n<5856> <5857> <8e04>\n<585a> <585b> <8e37>\n<585e> <585f> <8e5d>\n<5861> <5862> <8e82>\n<5868> <5869> <8ec3>\n<5871> <5872> <8f0f>\n<5874> <5875> <8f20>\n<587d> <587e> <8f52>\n<587f> <5880> <8f5d>\n<588c> <588e> <9028>\n<588f> <5890> <9033>\n<5899> <589a> <90d8>\n<58ad> <58ae> <9193>\n<58b3> <58b4> <91d3>\n<58b6> <58b7> <91e9>\n<58bb> <58bc> <9204>\n<58be> <58bf> <9212>\n<58c1> <58c2> <921c>\n<58c3> <58c5> <9224>\n<58c6> <58c8> <922e>\n<58c9> <58ca> <9235>\n<58cf> <58d0> <925c>\n<58d2> <58d4> <926e>\n<58db> <58dc> <92a4>\n<58e5> <58e6> <92dc>\n<58fe> <58ff> <9380>\n<5908> <590a> <93b4>\n<590b> <590c> <93c4>\n<5924> <5925> <959d>\n<592c> <592d> <9625>\n<592f> <5930> <9639>\n<5932> <5933> <9656>\n<5944> <5945> <9777>\n<594d> <594e> <97c4>\n<5956> <5957> <97f7>\n<597a> <597c> <99ea>\n<597d> <597e> <99f4>\n<597f> <5980> <99fd>\n<5988> <5989> <9a4a>\n<5999> <599a> <9af2>\n<599e> <599f> <9aff>\n<59a0> <59a1> <9b04>\n<59a6> <59a7> <9b39>\n<59a9> <59aa> <9b56>\n<59ae> <59af> <9b6d>\n<59cc> <59cd> <9d33>\n<59d1> <59d2> <9d53>\n<59d7> <59d8> <9d92>\n<59da> <59db> <9d97>\n<59e0> <59e1> <9dd4>\n<59e7> <59e9> <9e10>\n<59ec> <59ed> <9e8e>\n<59f6> <59f7> <9eec>\n<5a03> <5a04> <9f43>\n<5a0d> <5a0e> <9f91>\nendbfrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/EUC-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (EUC-H)\n%%Title: (EUC-H Adobe Japan1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 1 def\nend def\n\n/CMapName /EUC-H def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 680 def\n/XUID [1 10 25329] def\n\n/WMode 0 def\n\n3 begincodespacerange\n  <00>     <80>\n  <8EA0>   <8EDF>\n  <A1A1>   <FEFE>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 231\nendnotdefrange\n\n100 begincidrange\n<20> <7e>      231\n<8ea0> <8edf>  326\n<a1a1> <a1fe>  633\n<a2a1> <a2ae>  727\n<a2ba> <a2c1>  741\n<a2ca> <a2d0>  749\n<a2dc> <a2ea>  756\n<a2f2> <a2f9>  771\n<a2fe> <a2fe>  779\n<a3b0> <a3b9>  780\n<a3c1> <a3da>  790\n<a3e1> <a3fa>  816\n<a4a1> <a4f3>  842\n<a5a1> <a5f6>  925\n<a6a1> <a6b8> 1011\n<a6c1> <a6d8> 1035\n<a7a1> <a7c1> 1059\n<a7d1> <a7f1> 1092\n<a8a1> <a8a1> 7479\n<a8a2> <a8a2> 7481\n<a8a3> <a8a3> 7491\n<a8a4> <a8a4> 7495\n<a8a5> <a8a5> 7503\n<a8a6> <a8a6> 7499\n<a8a7> <a8a7> 7507\n<a8a8> <a8a8> 7523\n<a8a9> <a8a9> 7515\n<a8aa> <a8aa> 7531\n<a8ab> <a8ab> 7539\n<a8ac> <a8ac> 7480\n<a8ad> <a8ad> 7482\n<a8ae> <a8ae> 7494\n<a8af> <a8af> 7498\n<a8b0> <a8b0> 7506\n<a8b1> <a8b1> 7502\n<a8b2> <a8b2> 7514\n<a8b3> <a8b3> 7530\n<a8b4> <a8b4> 7522\n<a8b5> <a8b5> 7538\n<a8b6> <a8b6> 7554\n<a8b7> <a8b7> 7511\n<a8b8> <a8b8> 7526\n<a8b9> <a8b9> 7519\n<a8ba> <a8ba> 7534\n<a8bb> <a8bb> 7542\n<a8bc> <a8bc> 7508\n<a8bd> <a8bd> 7527\n<a8be> <a8be> 7516\n<a8bf> <a8bf> 7535\n<a8c0> <a8c0> 7545\n<b0a1> <b0fe> 1125\n<b1a1> <b1fe> 1219\n<b2a1> <b2fe> 1313\n<b3a1> <b3fe> 1407\n<b4a1> <b4fe> 1501\n<b5a1> <b5fe> 1595\n<b6a1> <b6fe> 1689\n<b7a1> <b7fe> 1783\n<b8a1> <b8fe> 1877\n<b9a1> <b9fe> 1971\n<baa1> <bafe> 2065\n<bba1> <bbfe> 2159\n<bca1> <bcfe> 2253\n<bda1> <bdfe> 2347\n<bea1> <befe> 2441\n<bfa1> <bffe> 2535\n<c0a1> <c0fe> 2629\n<c1a1> <c1fe> 2723\n<c2a1> <c2fe> 2817\n<c3a1> <c3fe> 2911\n<c4a1> <c4fe> 3005\n<c5a1> <c5fe> 3099\n<c6a1> <c6fe> 3193\n<c7a1> <c7fe> 3287\n<c8a1> <c8fe> 3381\n<c9a1> <c9fe> 3475\n<caa1> <cafe> 3569\n<cba1> <cbfe> 3663\n<cca1> <ccfe> 3757\n<cda1> <cdfe> 3851\n<cea1> <cefe> 3945\n<cfa1> <cfd3> 4039\n<d0a1> <d0fe> 4090\n<d1a1> <d1fe> 4184\n<d2a1> <d2fe> 4278\n<d3a1> <d3fe> 4372\n<d4a1> <d4fe> 4466\n<d5a1> <d5fe> 4560\n<d6a1> <d6fe> 4654\n<d7a1> <d7fe> 4748\n<d8a1> <d8fe> 4842\n<d9a1> <d9fe> 4936\n<daa1> <dafe> 5030\n<dba1> <dbfe> 5124\n<dca1> <dcfe> 5218\n<dda1> <ddfe> 5312\n<dea1> <defe> 5406\n<dfa1> <dffe> 5500\n<e0a1> <e0fe> 5594\n<e1a1> <e1fe> 5688\nendcidrange\n\n20 begincidrange\n<e2a1> <e2fe> 5782\n<e3a1> <e3fe> 5876\n<e4a1> <e4fe> 5970\n<e5a1> <e5fe> 6064\n<e6a1> <e6fe> 6158\n<e7a1> <e7fe> 6252\n<e8a1> <e8fe> 6346\n<e9a1> <e9fe> 6440\n<eaa1> <eafe> 6534\n<eba1> <ebfe> 6628\n<eca1> <ecfe> 6722\n<eda1> <edfe> 6816\n<eea1> <eefe> 6910\n<efa1> <effe> 7004\n<f0a1> <f0fe> 7098\n<f1a1> <f1fe> 7192\n<f2a1> <f2fe> 7286\n<f3a1> <f3fe> 7380\n<f4a1> <f4a4> 7474\n<f4a5> <f4a6> 8284\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/EUC-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (EUC-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (EUC-H)\n%%BeginResource: CMap (EUC-V)\n%%Title: (EUC-V Adobe Japan1 1)\n%%Version: 12.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/EUC-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 1 def\nend def\n\n/CMapName /EUC-V def\n/CMapVersion 12.002 def\n/CMapType 1 def\n\n/UIDOffset 800 def\n/XUID [1 10 25330] def\n\n/WMode 1 def\n\n27 begincidrange\n<a1a2> <a1a3> 7887\n<a1b1> <a1b2> 7889\n<a1bc> <a1be> 7891\n<a1c1> <a1c5> 7894\n<a1ca> <a1db> 7899\n<a1e1> <a1e1> 7917\n<a4a1> <a4a1> 7918\n<a4a3> <a4a3> 7919\n<a4a5> <a4a5> 7920\n<a4a7> <a4a7> 7921\n<a4a9> <a4a9> 7922\n<a4c3> <a4c3> 7923\n<a4e3> <a4e3> 7924\n<a4e5> <a4e5> 7925\n<a4e7> <a4e7> 7926\n<a4ee> <a4ee> 7927\n<a5a1> <a5a1> 7928\n<a5a3> <a5a3> 7929\n<a5a5> <a5a5> 7930\n<a5a7> <a5a7> 7931\n<a5a9> <a5a9> 7932\n<a5c3> <a5c3> 7933\n<a5e3> <a5e3> 7934\n<a5e5> <a5e5> 7935\n<a5e7> <a5e7> 7936\n<a5ee> <a5ee> 7937\n<a5f5> <a5f6> 7938\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/Ext-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Ext-H)\n%%Title: (Ext-H Adobe Japan1 2)\n%%Version: 11.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 2 def\nend def\n\n/CMapName /Ext-H def\n/CMapVersion 11.003 def\n/CMapType 1 def\n\n/UIDOffset 380 def\n/XUID [1 10 25331] def\n\n/WMode 0 def\n\n1 begincodespacerange\n  <2121> <7E7E>\nendcodespacerange\n\n100 begincidrange\n<2121> <2168>  633\n<2169> <2169> 7478\n<216a> <217e>  706\n<2221> <222e>  727\n<2330> <2339>  780\n<2341> <235a>  790\n<2361> <237a>  816\n<2421> <2473>  842\n<2521> <2576>  925\n<2621> <2638> 1011\n<2641> <2658> 1035\n<2721> <2741> 1059\n<2751> <2771> 1092\n<2921> <295f>  232\n<2960> <2960>  390\n<2961> <297e>  296\n<2a21> <2a5f>  327\n<2a60> <2a7e>  391\n<2b21> <2b71>  422\n<2b72> <2b72>  295\n<2b73> <2b7e>  503\n<2c24> <2c6f> 7479\n<2d21> <2d3e> 7555\n<2d40> <2d56> 7585\n<2d5f> <2d5f> 8323\n<2d60> <2d6f> 7608\n<2d70> <2d70>  762\n<2d71> <2d71>  761\n<2d72> <2d72>  769\n<2d73> <2d79> 7624\n<2d7a> <2d7a>  768\n<2d7b> <2d7c> 7631\n<3021> <3021> 1125\n<3022> <3022> 7633\n<3023> <3032> 1127\n<3033> <3033> 7330\n<3034> <303a> 1144\n<303b> <303b> 7634\n<303c> <306d> 1152\n<306e> <306e> 7635\n<306f> <3072> 1203\n<3073> <3073> 7636\n<3074> <307b> 1208\n<307c> <307c> 7637\n<307d> <307e> 1217\n<3121> <3129> 1219\n<312a> <312a> 7638\n<312b> <3134> 1229\n<3135> <3135> 7639\n<3136> <3138> 1240\n<3139> <3139> 7640\n<313a> <313b> 1244\n<313c> <313d> 7641\n<313e> <3141> 1248\n<3142> <3142> 7643\n<3143> <316a> 1253\n<316b> <316b> 7644\n<316c> <317e> 1294\n<3221> <3227> 1313\n<3228> <3228> 7645\n<3229> <3229> 7369\n<322a> <322a> 7646\n<322b> <325f> 1323\n<3260> <3260> 7647\n<3261> <3279> 1377\n<327a> <327a> 7648\n<327b> <327c> 1403\n<327d> <327d> 7649\n<327e> <327e> 1406\n<3321> <3321> 1407\n<3322> <3322> 7650\n<3323> <3341> 1409\n<3342> <3342> 6497\n<3343> <3348> 1441\n<3349> <3349> 5023\n<334a> <3364> 1448\n<3365> <3365> 7651\n<3366> <336a> 1476\n<336b> <336b> 7652\n<336c> <3372> 1482\n<3373> <3373> 7653\n<3374> <3375> 1490\n<3376> <3376> 5937\n<3377> <3379> 1493\n<337a> <337a> 7654\n<337b> <337e> 1497\n<3421> <3441> 1501\n<3442> <3442> 7655\n<3443> <3443> 5490\n<3444> <344c> 1536\n<344d> <344d> 7656\n<344e> <3451> 1546\n<3452> <3452> 6688\n<3453> <3464> 1551\n<3465> <3465> 7657\n<3466> <347e> 1570\n<3521> <352a> 1595\n<352b> <352b> 7658\n<352c> <353f> 1606\n<3540> <3540> 7659\nendcidrange\n\n100 begincidrange\n<3541> <357e> 1627\n<3621> <3621> 1689\n<3622> <3622> 7660\n<3623> <3629> 1691\n<362a> <362a> 7661\n<362b> <3645> 1699\n<3646> <3646> 7474\n<3647> <364e> 1727\n<364f> <364f> 7662\n<3650> <366c> 1736\n<366d> <366d> 7663\n<366e> <3673> 1766\n<3674> <3674> 7664\n<3675> <367a> 1773\n<367b> <367b> 7665\n<367c> <367c> 1780\n<367d> <367d> 7666\n<367e> <367e> 1782\n<3721> <3723> 1783\n<3724> <3724> 7667\n<3725> <3736> 1787\n<3737> <3737> 7668\n<3738> <3744> 1806\n<3745> <3745> 7669\n<3746> <374d> 1820\n<374e> <374e> 7670\n<374f> <3751> 1829\n<3752> <3752> 7671\n<3753> <3754> 1833\n<3755> <3755> 7672\n<3756> <375a> 1836\n<375b> <375b> 7181\n<375c> <3763> 1842\n<3764> <3764> 7673\n<3765> <3770> 1851\n<3771> <3771> 7674\n<3772> <3778> 1864\n<3779> <3779> 7675\n<377a> <377d> 1872\n<377e> <377e> 7676\n<3821> <3833> 1877\n<3834> <3834> 7677\n<3835> <3840> 1897\n<3841> <3841> 7678\n<3842> <387e> 1910\n<3921> <392a> 1971\n<392b> <392b> 7679\n<392c> <3936> 1982\n<3937> <3937> 7680\n<3938> <3941> 1994\n<3942> <3942> 7681\n<3943> <395b> 2005\n<395c> <395c> 5853\n<395d> <396c> 2031\n<396d> <396d> 7682\n<396e> <3973> 2048\n<3974> <3974> 7683\n<3975> <3978> 2055\n<3979> <3979> 7684\n<397a> <397e> 2060\n<3a21> <3a52> 2065\n<3a53> <3a53> 7685\n<3a54> <3a66> 2116\n<3a67> <3a67> 7686\n<3a68> <3a73> 2136\n<3a74> <3a74> 7687\n<3a75> <3a7e> 2149\n<3b21> <3b26> 2159\n<3b27> <3b27> 7688\n<3b28> <3b29> 2166\n<3b2a> <3b2a> 7689\n<3b2b> <3b2b> 2169\n<3b2c> <3b2c> 7690\n<3b2d> <3b38> 2171\n<3b39> <3b39> 7691\n<3b3a> <3b7e> 2184\n<3c21> <3c37> 2253\n<3c38> <3c38> 7692\n<3c39> <3c47> 2277\n<3c48> <3c48> 7693\n<3c49> <3c49> 6441\n<3c4a> <3c56> 2294\n<3c57> <3c57> 7694\n<3c58> <3c5c> 2308\n<3c5d> <3c5e> 7695\n<3c5f> <3c7e> 2315\n<3d21> <3d2a> 2347\n<3d2b> <3d2b> 7697\n<3d2c> <3d35> 2358\n<3d36> <3d36> 7698\n<3d37> <3d6b> 2369\n<3d6c> <3d6d> 7699\n<3d6e> <3d71> 2424\n<3d72> <3d73> 7701\n<3d74> <3d7e> 2430\n<3e21> <3e24> 2441\n<3e25> <3e25> 7703\n<3e26> <3e32> 2446\n<3e33> <3e33> 7704\n<3e34> <3e3e> 2460\nendcidrange\n\n100 begincidrange\n<3e3f> <3e3f> 7705\n<3e40> <3e54> 2472\n<3e55> <3e55> 7706\n<3e56> <3e5e> 2494\n<3e5f> <3e5f> 7707\n<3e60> <3e63> 2504\n<3e64> <3e64> 7708\n<3e65> <3e7e> 2509\n<3f21> <3f29> 2535\n<3f2a> <3f2a> 7709\n<3f2b> <3f58> 2545\n<3f59> <3f59> 7710\n<3f5a> <3f5f> 2592\n<3f60> <3f60> 7711\n<3f61> <3f68> 2599\n<3f69> <3f69> 7712\n<3f6a> <3f7e> 2608\n<4021> <4021> 2629\n<4022> <4022> 7713\n<4023> <4041> 2631\n<4042> <4042> 7714\n<4043> <4065> 2663\n<4066> <4066> 7715\n<4067> <4070> 2699\n<4071> <4072> 7716\n<4073> <4078> 2711\n<4079> <407a> 7718\n<407b> <407e> 2719\n<4121> <4126> 2723\n<4127> <4127> 7720\n<4128> <4128> 6766\n<4129> <4138> 2731\n<4139> <4139> 7721\n<413a> <414b> 2748\n<414c> <414c> 7722\n<414d> <414e> 2767\n<414f> <414f> 7723\n<4150> <415e> 2770\n<415f> <415f> 7724\n<4160> <4168> 2786\n<4169> <4169> 7725\n<416a> <417e> 2796\n<4221> <423c> 2817\n<423d> <423d> 7726\n<423e> <424c> 2846\n<424d> <424d> 7727\n<424e> <425b> 2862\n<425c> <425c> 7728\n<425d> <4262> 2877\n<4263> <4263> 7729\n<4264> <426e> 2884\n<426f> <426f> 7730\n<4270> <4274> 2896\n<4275> <4276> 7731\n<4277> <427c> 2903\n<427d> <427d> 7733\n<427e> <427e> 2910\n<4321> <4326> 2911\n<4327> <4327> 7734\n<4328> <4328> 2918\n<4329> <432a> 7735\n<432b> <432c> 2921\n<432d> <432e> 7737\n<432f> <433c> 2925\n<433d> <433d> 7739\n<433e> <436f> 2940\n<4370> <4370> 7740\n<4371> <4374> 2991\n<4375> <4375> 7741\n<4376> <437b> 2996\n<437c> <437c> 7742\n<437d> <437e> 3003\n<4421> <443c> 3005\n<443d> <443d> 7743\n<443e> <4447> 3034\n<4448> <4448> 7744\n<4449> <4449> 3045\n<444a> <444a> 7745\n<444b> <444c> 3047\n<444d> <444d> 7746\n<444e> <444e> 3050\n<444f> <444f> 7747\n<4450> <445a> 3052\n<445b> <445b> 4533\n<445c> <447e> 3064\n<4521> <4521> 3099\n<4522> <4522> 7748\n<4523> <4526> 3101\n<4527> <4527> 7749\n<4528> <452d> 3106\n<452e> <452e> 7750\n<452f> <4535> 3113\n<4536> <4536> 7751\n<4537> <453e> 3121\n<453f> <453f> 7752\n<4540> <4547> 3130\n<4548> <4548> 7753\n<4549> <454a> 3139\n<454b> <454b> 7754\n<454c> <4550> 3142\nendcidrange\n\n100 begincidrange\n<4551> <4552> 7755\n<4553> <4556> 3149\n<4557> <4557> 5855\n<4558> <4563> 3154\n<4564> <4564> 7757\n<4565> <456d> 3167\n<456e> <456e> 5200\n<456f> <4572> 3177\n<4573> <4573> 5430\n<4574> <4577> 3182\n<4578> <4578> 7758\n<4579> <457e> 3187\n<4621> <463d> 3193\n<463e> <463e> 7759\n<463f> <4641> 3223\n<4642> <4642> 7760\n<4643> <4653> 3227\n<4654> <4655> 7761\n<4656> <465a> 3246\n<465b> <465c> 7763\n<465d> <4660> 3253\n<4661> <4661> 7765\n<4662> <4665> 3258\n<4666> <4667> 7766\n<4668> <4669> 3264\n<466a> <466a> 7768\n<466b> <4675> 3267\n<4676> <4676> 6893\n<4677> <467e> 3279\n<4721> <4728> 3287\n<4729> <4729> 7769\n<472a> <4738> 3296\n<4739> <4739> 7770\n<473a> <4756> 3312\n<4757> <4757> 7771\n<4758> <4766> 3342\n<4767> <4767> 7772\n<4768> <4768> 6537\n<4769> <4769> 7773\n<476a> <476c> 3360\n<476d> <476d> 7774\n<476e> <477e> 3364\n<4821> <4823> 3381\n<4824> <4824> 7775\n<4825> <482d> 3385\n<482e> <482e> 7776\n<482f> <482f> 3395\n<4830> <4830> 7777\n<4831> <4853> 3397\n<4854> <4854> 7778\n<4855> <4861> 3433\n<4862> <4862> 7779\n<4863> <4874> 3447\n<4875> <4875> 7780\n<4876> <487e> 3466\n<4921> <4921> 3475\n<4922> <4923> 7781\n<4924> <492e> 3478\n<492f> <492f> 7783\n<4930> <4930> 5179\n<4931> <4931> 3491\n<4932> <4932> 7784\n<4933> <4934> 3493\n<4935> <4935> 7785\n<4936> <493f> 3496\n<4940> <4940> 7786\n<4941> <494d> 3507\n<494e> <494e> 7787\n<494f> <4950> 3521\n<4951> <4951> 7788\n<4952> <497e> 3524\n<4a21> <4a42> 3569\n<4a43> <4a43> 7789\n<4a44> <4a4c> 3604\n<4a4d> <4a4d> 7790\n<4a4e> <4a59> 3614\n<4a5a> <4a5a> 7791\n<4a5b> <4a78> 3627\n<4a79> <4a79> 7792\n<4a7a> <4a7e> 3658\n<4b21> <4b21> 3663\n<4b22> <4b22> 7793\n<4b23> <4b28> 3665\n<4b29> <4b29> 7794\n<4b2a> <4b4a> 3672\n<4b4b> <4b4b> 7795\n<4b4c> <4b69> 3706\n<4b6a> <4b6a> 7475\n<4b6b> <4b6f> 3737\n<4b70> <4b70> 7796\n<4b71> <4b78> 3743\n<4b79> <4b79> 4143\n<4b7a> <4b7e> 3752\n<4c21> <4c4c> 3757\n<4c4d> <4c4d> 7797\n<4c4e> <4c58> 3802\n<4c59> <4c59> 7798\n<4c5a> <4c5e> 3814\n<4c5f> <4c5f> 7799\n<4c60> <4c61> 3820\nendcidrange\n\n100 begincidrange\n<4c62> <4c62> 7800\n<4c63> <4c78> 3823\n<4c79> <4c79> 6453\n<4c7a> <4c7a> 7801\n<4c7b> <4c7b> 3847\n<4c7c> <4c7c> 7802\n<4c7d> <4c7d> 3849\n<4c7e> <4c7e> 7803\n<4d21> <4d31> 3851\n<4d32> <4d32> 7804\n<4d33> <4d4f> 3869\n<4d50> <4d50> 7805\n<4d51> <4d53> 3899\n<4d54> <4d54> 7806\n<4d55> <4d59> 3903\n<4d5a> <4d5a> 7476\n<4d5b> <4d68> 3909\n<4d69> <4d69> 7807\n<4d6a> <4d7e> 3924\n<4e21> <4e4a> 3945\n<4e4b> <4e4b> 7808\n<4e4c> <4e79> 3988\n<4e7a> <4e7b> 7809\n<4e7c> <4e7e> 4036\n<4f21> <4f21> 7811\n<4f22> <4f30> 4040\n<4f31> <4f31> 7812\n<4f32> <4f35> 4056\n<4f36> <4f36> 6007\n<4f37> <4f38> 4061\n<4f39> <4f39> 7813\n<4f3a> <4f53> 4064\n<5021> <5055> 4090\n<5056> <5056> 3751\n<5057> <507e> 4144\n<5121> <513c> 4184\n<513d> <513d> 7814\n<513e> <5146> 4213\n<5147> <5147> 7815\n<5148> <514a> 4223\n<514b> <514b> 7816\n<514c> <514c> 4227\n<514d> <514d> 7817\n<514e> <517e> 4229\n<5221> <527e> 4278\n<5321> <532f> 4372\n<5330> <5330> 7818\n<5331> <5339> 4388\n<533a> <533a> 7819\n<533b> <534f> 4398\n<5350> <5350> 7820\n<5351> <535d> 4420\n<535e> <535e> 7821\n<535f> <536a> 4434\n<536b> <536b> 7822\n<536c> <537e> 4447\n<5421> <5443> 4466\n<5444> <5444> 7823\n<5445> <5463> 4502\n<5464> <5464> 3063\n<5465> <547e> 4534\n<5521> <553c> 4560\n<553d> <553d> 7824\n<553e> <5562> 4589\n<5563> <5563> 7825\n<5564> <557e> 4627\n<5621> <5621> 4654\n<5622> <5622> 7826\n<5623> <5671> 4656\n<5672> <5672> 7827\n<5673> <567e> 4736\n<5721> <577e> 4748\n<5821> <5823> 4842\n<5824> <5824> 7828\n<5825> <587e> 4846\n<5921> <595f> 4936\n<5960> <5960> 7829\n<5961> <596b> 5000\n<596c> <596c> 7830\n<596d> <5977> 5012\n<5978> <5978> 1447\n<5979> <597e> 5024\n<5a21> <5a38> 5030\n<5a39> <5a39> 7831\n<5a3a> <5a4c> 5055\n<5a4d> <5a4d> 7832\n<5a4e> <5a7e> 5075\n<5b21> <5b44> 5124\n<5b45> <5b45> 7833\n<5b46> <5b49> 5161\n<5b4a> <5b4a> 7834\n<5b4b> <5b57> 5166\n<5b58> <5b58> 3490\n<5b59> <5b6a> 5180\n<5b6b> <5b6b> 7835\n<5b6c> <5b6c> 5199\n<5b6d> <5b6d> 3176\n<5b6e> <5b73> 5201\n<5b74> <5b74> 7836\n<5b75> <5b7e> 5208\nendcidrange\n\n100 begincidrange\n<5c21> <5c7e> 5218\n<5d21> <5d7e> 5312\n<5e21> <5e38> 5406\n<5e39> <5e39> 3181\n<5e3a> <5e4f> 5431\n<5e50> <5e50> 7837\n<5e51> <5e74> 5454\n<5e75> <5e75> 1535\n<5e76> <5e7e> 5491\n<5f21> <5f72> 5500\n<5f73> <5f73> 7838\n<5f74> <5f7e> 5583\n<6021> <6025> 5594\n<6026> <6026> 7839\n<6027> <605e> 5600\n<605f> <605f> 7840\n<6060> <6075> 5657\n<6076> <6076> 7477\n<6077> <607e> 5680\n<6121> <612a> 5688\n<612b> <612b> 7841\n<612c> <612f> 5699\n<6130> <6131> 7842\n<6132> <617e> 5705\n<6221> <622a> 5782\n<622b> <622b> 7844\n<622c> <6267> 5793\n<6268> <6268> 2030\n<6269> <6269> 5854\n<626a> <626a> 3153\n<626b> <626e> 5856\n<626f> <626f> 7845\n<6270> <627e> 5861\n<6321> <6349> 5876\n<634a> <634a> 7846\n<634b> <6353> 5918\n<6354> <6354> 7847\n<6355> <635d> 5928\n<635e> <635e> 1492\n<635f> <637e> 5938\n<6421> <6438> 5970\n<6439> <6439> 7848\n<643a> <6445> 5995\n<6446> <6446> 4060\n<6447> <6463> 6008\n<6464> <6464> 7849\n<6465> <646d> 6038\n<646e> <646e> 7850\n<646f> <647e> 6048\n<6521> <6538> 6064\n<6539> <6539> 7851\n<653a> <653a> 6089\n<653b> <653b> 7852\n<653c> <6545> 6091\n<6546> <6546> 7853\n<6547> <657e> 6102\n<6621> <6645> 6158\n<6646> <6646> 7854\n<6647> <667e> 6196\n<6721> <6763> 6252\n<6764> <6764> 7855\n<6765> <6768> 6320\n<6769> <6769> 7856\n<676a> <6771> 6325\n<6772> <6772> 7857\n<6773> <677e> 6334\n<6821> <6833> 6346\n<6834> <6834> 7858\n<6835> <683a> 6366\n<683b> <683b> 7859\n<683c> <6873> 6373\n<6874> <6874> 7860\n<6875> <687e> 6430\n<6921> <6921> 6440\n<6922> <6922> 2293\n<6923> <692d> 6442\n<692e> <692e> 3845\n<692f> <693b> 6454\n<693c> <693c> 7861\n<693d> <6959> 6468\n<695a> <695a> 1440\n<695b> <697e> 6498\n<6a21> <6a23> 6534\n<6a24> <6a24> 3358\n<6a25> <6a26> 6538\n<6a27> <6a27> 7862\n<6a28> <6a3c> 6541\n<6a3d> <6a3d> 7863\n<6a3e> <6a6e> 6563\n<6a6f> <6a6f> 7864\n<6a70> <6a7e> 6613\n<6b21> <6b31> 6628\n<6b32> <6b32> 7865\n<6b33> <6b5c> 6646\n<6b5d> <6b5d> 1550\n<6b5e> <6b65> 6689\n<6b66> <6b66> 7866\n<6b67> <6b75> 6698\n<6b76> <6b76> 7867\n<6b77> <6b7e> 6714\nendcidrange\n\n61 begincidrange\n<6c21> <6c4c> 6722\n<6c4d> <6c4d> 2730\n<6c4e> <6c68> 6767\n<6c69> <6c69> 7868\n<6c6a> <6c73> 6795\n<6c74> <6c74> 7869\n<6c75> <6c7e> 6806\n<6d21> <6d4d> 6816\n<6d4e> <6d4e> 7870\n<6d4f> <6d6b> 6862\n<6d6c> <6d6c> 7871\n<6d6d> <6d6d> 6892\n<6d6e> <6d6e> 7872\n<6d6f> <6d7e> 6894\n<6e21> <6e28> 6910\n<6e29> <6e29> 7873\n<6e2a> <6e3c> 6919\n<6e3d> <6e3d> 7874\n<6e3e> <6e56> 6939\n<6e57> <6e57> 7875\n<6e58> <6e7e> 6965\n<6f21> <6f64> 7004\n<6f65> <6f65> 7876\n<6f66> <6f7e> 7073\n<7021> <7032> 7098\n<7033> <7033> 7877\n<7034> <7044> 7117\n<7045> <7045> 7878\n<7046> <7050> 7135\n<7051> <7051> 7879\n<7052> <7056> 7147\n<7057> <7057> 7880\n<7058> <7073> 7153\n<7074> <7074> 1841\n<7075> <7075> 7881\n<7076> <707e> 7183\n<7121> <717e> 7192\n<7221> <722c> 7286\n<722d> <722d> 7882\n<722e> <723b> 7299\n<723c> <723c> 7883\n<723d> <724c> 7314\n<724d> <724d> 1143\n<724e> <724e> 7884\n<724f> <7273> 7332\n<7274> <7274> 1321\n<7275> <727e> 7370\n<7321> <7350> 7380\n<7351> <7351> 7885\n<7352> <737c> 7429\n<737d> <737d> 7886\n<737e> <737e> 7473\n<7921> <797e> 8359\n<7a21> <7a35> 8453\n<7a36> <7a36> 1993\n<7a37> <7a7e> 8474\n<7b21> <7b7e> 8546\n<7c21> <7c6e> 8640\n<7c71> <7c7a> 8092\n<7c7b> <7c7b>  751\n<7c7c> <7c7e> 8005\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/Ext-RKSJ-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Ext-RKSJ-H)\n%%Title: (Ext-RKSJ-H Adobe Japan1 2)\n%%Version: 11.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 2 def\nend def\n\n/CMapName /Ext-RKSJ-H def\n/CMapVersion 11.003 def\n/CMapType 1 def\n\n/UIDOffset 70 def\n/XUID [1 10 25332] def\n\n/WMode 0 def\n\n4 begincodespacerange\n  <00>   <80>\n  <8140> <9FFC>\n  <A0>   <DF>\n  <E040> <FCFC>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 231\nendnotdefrange\n\n100 begincidrange\n<20> <7e>      231\n<8140> <817e>  633\n<8180> <8188>  696\n<8189> <8189> 7478\n<818a> <81ac>  706\n<824f> <8258>  780\n<8260> <8279>  790\n<8281> <829a>  816\n<829f> <82f1>  842\n<8340> <837e>  925\n<8380> <8396>  988\n<839f> <83b6> 1011\n<83bf> <83d6> 1035\n<8440> <8460> 1059\n<8470> <847e> 1092\n<8480> <8491> 1107\n<8540> <857e>  232\n<8580> <8580>  390\n<8581> <859e>  296\n<859f> <85dd>  327\n<85de> <85fc>  391\n<8640> <867e>  422\n<8680> <8691>  485\n<8692> <8692>  295\n<8693> <869e>  503\n<86a2> <86ed> 7479\n<8740> <875d> 7555\n<875f> <8775> 7585\n<877e> <877e> 8323\n<8780> <878f> 7608\n<8790> <8790>  762\n<8791> <8791>  761\n<8792> <8792>  769\n<8793> <8799> 7624\n<879a> <879a>  768\n<879b> <879c> 7631\n<889f> <889f> 1125\n<88a0> <88a0> 7633\n<88a1> <88b0> 1127\n<88b1> <88b1> 7330\n<88b2> <88b8> 1144\n<88b9> <88b9> 7634\n<88ba> <88eb> 1152\n<88ec> <88ec> 7635\n<88ed> <88f0> 1203\n<88f1> <88f1> 7636\n<88f2> <88f9> 1208\n<88fa> <88fa> 7637\n<88fb> <88fc> 1217\n<8940> <8948> 1219\n<8949> <8949> 7638\n<894a> <8953> 1229\n<8954> <8954> 7639\n<8955> <8957> 1240\n<8958> <8958> 7640\n<8959> <895a> 1244\n<895b> <895c> 7641\n<895d> <8960> 1248\n<8961> <8961> 7643\n<8962> <897e> 1253\n<8980> <898a> 1282\n<898b> <898b> 7644\n<898c> <89a5> 1294\n<89a6> <89a6> 7645\n<89a7> <89a7> 7369\n<89a8> <89a8> 7646\n<89a9> <89dd> 1323\n<89de> <89de> 7647\n<89df> <89f7> 1377\n<89f8> <89f8> 7648\n<89f9> <89fa> 1403\n<89fb> <89fb> 7649\n<89fc> <89fc> 1406\n<8a40> <8a40> 1407\n<8a41> <8a41> 7650\n<8a42> <8a60> 1409\n<8a61> <8a61> 6497\n<8a62> <8a67> 1441\n<8a68> <8a68> 5023\n<8a69> <8a7e> 1448\n<8a80> <8a84> 1470\n<8a85> <8a85> 7651\n<8a86> <8a8a> 1476\n<8a8b> <8a8b> 7652\n<8a8c> <8a92> 1482\n<8a93> <8a93> 7653\n<8a94> <8a95> 1490\n<8a96> <8a96> 5937\n<8a97> <8a99> 1493\n<8a9a> <8a9a> 7654\n<8a9b> <8abf> 1497\n<8ac0> <8ac0> 7655\n<8ac1> <8ac1> 5490\n<8ac2> <8aca> 1536\n<8acb> <8acb> 7656\n<8acc> <8acf> 1546\n<8ad0> <8ad0> 6688\n<8ad1> <8ae2> 1551\n<8ae3> <8ae3> 7657\n<8ae4> <8afc> 1570\nendcidrange\n\n100 begincidrange\n<8b40> <8b49> 1595\n<8b4a> <8b4a> 7658\n<8b4b> <8b5e> 1606\n<8b5f> <8b5f> 7659\n<8b60> <8b7e> 1627\n<8b80> <8b9f> 1658\n<8ba0> <8ba0> 7660\n<8ba1> <8ba7> 1691\n<8ba8> <8ba8> 7661\n<8ba9> <8bc3> 1699\n<8bc4> <8bc4> 7474\n<8bc5> <8bcc> 1727\n<8bcd> <8bcd> 7662\n<8bce> <8bea> 1736\n<8beb> <8beb> 7663\n<8bec> <8bf1> 1766\n<8bf2> <8bf2> 7664\n<8bf3> <8bf8> 1773\n<8bf9> <8bf9> 7665\n<8bfa> <8bfa> 1780\n<8bfb> <8bfb> 7666\n<8bfc> <8bfc> 1782\n<8c40> <8c42> 1783\n<8c43> <8c43> 7667\n<8c44> <8c55> 1787\n<8c56> <8c56> 7668\n<8c57> <8c63> 1806\n<8c64> <8c64> 7669\n<8c65> <8c6c> 1820\n<8c6d> <8c6d> 7670\n<8c6e> <8c70> 1829\n<8c71> <8c71> 7671\n<8c72> <8c73> 1833\n<8c74> <8c74> 7672\n<8c75> <8c79> 1836\n<8c7a> <8c7a> 7181\n<8c7b> <8c7e> 1842\n<8c80> <8c83> 1846\n<8c84> <8c84> 7673\n<8c85> <8c90> 1851\n<8c91> <8c91> 7674\n<8c92> <8c98> 1864\n<8c99> <8c99> 7675\n<8c9a> <8c9d> 1872\n<8c9e> <8c9e> 7676\n<8c9f> <8cb1> 1877\n<8cb2> <8cb2> 7677\n<8cb3> <8cbe> 1897\n<8cbf> <8cbf> 7678\n<8cc0> <8cfc> 1910\n<8d40> <8d49> 1971\n<8d4a> <8d4a> 7679\n<8d4b> <8d55> 1982\n<8d56> <8d56> 7680\n<8d57> <8d60> 1994\n<8d61> <8d61> 7681\n<8d62> <8d7a> 2005\n<8d7b> <8d7b> 5853\n<8d7c> <8d7e> 2031\n<8d80> <8d8c> 2034\n<8d8d> <8d8d> 7682\n<8d8e> <8d93> 2048\n<8d94> <8d94> 7683\n<8d95> <8d98> 2055\n<8d99> <8d99> 7684\n<8d9a> <8dd0> 2060\n<8dd1> <8dd1> 7685\n<8dd2> <8de4> 2116\n<8de5> <8de5> 7686\n<8de6> <8df1> 2136\n<8df2> <8df2> 7687\n<8df3> <8dfc> 2149\n<8e40> <8e45> 2159\n<8e46> <8e46> 7688\n<8e47> <8e48> 2166\n<8e49> <8e49> 7689\n<8e4a> <8e4a> 2169\n<8e4b> <8e4b> 7690\n<8e4c> <8e57> 2171\n<8e58> <8e58> 7691\n<8e59> <8e7e> 2184\n<8e80> <8eb5> 2222\n<8eb6> <8eb6> 7692\n<8eb7> <8ec5> 2277\n<8ec6> <8ec6> 7693\n<8ec7> <8ec7> 6441\n<8ec8> <8ed4> 2294\n<8ed5> <8ed5> 7694\n<8ed6> <8eda> 2308\n<8edb> <8edc> 7695\n<8edd> <8efc> 2315\n<8f40> <8f49> 2347\n<8f4a> <8f4a> 7697\n<8f4b> <8f54> 2358\n<8f55> <8f55> 7698\n<8f56> <8f7e> 2369\n<8f80> <8f8b> 2410\n<8f8c> <8f8d> 7699\n<8f8e> <8f91> 2424\n<8f92> <8f93> 7701\nendcidrange\n\n100 begincidrange\n<8f94> <8fa2> 2430\n<8fa3> <8fa3> 7703\n<8fa4> <8fb0> 2446\n<8fb1> <8fb1> 7704\n<8fb2> <8fbc> 2460\n<8fbd> <8fbd> 7705\n<8fbe> <8fd2> 2472\n<8fd3> <8fd3> 7706\n<8fd4> <8fdc> 2494\n<8fdd> <8fdd> 7707\n<8fde> <8fe1> 2504\n<8fe2> <8fe2> 7708\n<8fe3> <8ffc> 2509\n<9040> <9048> 2535\n<9049> <9049> 7709\n<904a> <9077> 2545\n<9078> <9078> 7710\n<9079> <907e> 2592\n<9080> <9080> 7711\n<9081> <9088> 2599\n<9089> <9089> 7712\n<908a> <909f> 2608\n<90a0> <90a0> 7713\n<90a1> <90bf> 2631\n<90c0> <90c0> 7714\n<90c1> <90e3> 2663\n<90e4> <90e4> 7715\n<90e5> <90ee> 2699\n<90ef> <90f0> 7716\n<90f1> <90f6> 2711\n<90f7> <90f8> 7718\n<90f9> <90fc> 2719\n<9140> <9145> 2723\n<9146> <9146> 7720\n<9147> <9147> 6766\n<9148> <9157> 2731\n<9158> <9158> 7721\n<9159> <916a> 2748\n<916b> <916b> 7722\n<916c> <916d> 2767\n<916e> <916e> 7723\n<916f> <917d> 2770\n<917e> <917e> 7724\n<9180> <9188> 2786\n<9189> <9189> 7725\n<918a> <91ba> 2796\n<91bb> <91bb> 7726\n<91bc> <91ca> 2846\n<91cb> <91cb> 7727\n<91cc> <91d9> 2862\n<91da> <91da> 7728\n<91db> <91e0> 2877\n<91e1> <91e1> 7729\n<91e2> <91ec> 2884\n<91ed> <91ed> 7730\n<91ee> <91f2> 2896\n<91f3> <91f4> 7731\n<91f5> <91fa> 2903\n<91fb> <91fb> 7733\n<91fc> <91fc> 2910\n<9240> <9245> 2911\n<9246> <9246> 7734\n<9247> <9247> 2918\n<9248> <9249> 7735\n<924a> <924b> 2921\n<924c> <924d> 7737\n<924e> <925b> 2925\n<925c> <925c> 7739\n<925d> <927e> 2940\n<9280> <928f> 2974\n<9290> <9290> 7740\n<9291> <9294> 2991\n<9295> <9295> 7741\n<9296> <929b> 2996\n<929c> <929c> 7742\n<929d> <92ba> 3003\n<92bb> <92bb> 7743\n<92bc> <92c5> 3034\n<92c6> <92c6> 7744\n<92c7> <92c7> 3045\n<92c8> <92c8> 7745\n<92c9> <92ca> 3047\n<92cb> <92cb> 7746\n<92cc> <92cc> 3050\n<92cd> <92cd> 7747\n<92ce> <92d8> 3052\n<92d9> <92d9> 4533\n<92da> <92fc> 3064\n<9340> <9340> 3099\n<9341> <9341> 7748\n<9342> <9345> 3101\n<9346> <9346> 7749\n<9347> <934c> 3106\n<934d> <934d> 7750\n<934e> <9354> 3113\n<9355> <9355> 7751\n<9356> <935d> 3121\n<935e> <935e> 7752\n<935f> <9366> 3130\n<9367> <9367> 7753\nendcidrange\n\n100 begincidrange\n<9368> <9369> 3139\n<936a> <936a> 7754\n<936b> <936f> 3142\n<9370> <9371> 7755\n<9372> <9375> 3149\n<9376> <9376> 5855\n<9377> <937e> 3154\n<9380> <9383> 3162\n<9384> <9384> 7757\n<9385> <938d> 3167\n<938e> <938e> 5200\n<938f> <9392> 3177\n<9393> <9393> 5430\n<9394> <9397> 3182\n<9398> <9398> 7758\n<9399> <93bb> 3187\n<93bc> <93bc> 7759\n<93bd> <93bf> 3223\n<93c0> <93c0> 7760\n<93c1> <93d1> 3227\n<93d2> <93d3> 7761\n<93d4> <93d8> 3246\n<93d9> <93da> 7763\n<93db> <93de> 3253\n<93df> <93df> 7765\n<93e0> <93e3> 3258\n<93e4> <93e5> 7766\n<93e6> <93e7> 3264\n<93e8> <93e8> 7768\n<93e9> <93f3> 3267\n<93f4> <93f4> 6893\n<93f5> <93fc> 3279\n<9440> <9447> 3287\n<9448> <9448> 7769\n<9449> <9457> 3296\n<9458> <9458> 7770\n<9459> <9475> 3312\n<9476> <9476> 7771\n<9477> <947e> 3342\n<9480> <9486> 3350\n<9487> <9487> 7772\n<9488> <9488> 6537\n<9489> <9489> 7773\n<948a> <948c> 3360\n<948d> <948d> 7774\n<948e> <94a1> 3364\n<94a2> <94a2> 7775\n<94a3> <94ab> 3385\n<94ac> <94ac> 7776\n<94ad> <94ad> 3395\n<94ae> <94ae> 7777\n<94af> <94d1> 3397\n<94d2> <94d2> 7778\n<94d3> <94df> 3433\n<94e0> <94e0> 7779\n<94e1> <94f2> 3447\n<94f3> <94f3> 7780\n<94f4> <94fc> 3466\n<9540> <9540> 3475\n<9541> <9542> 7781\n<9543> <954d> 3478\n<954e> <954e> 7783\n<954f> <954f> 5179\n<9550> <9550> 3491\n<9551> <9551> 7784\n<9552> <9553> 3493\n<9554> <9554> 7785\n<9555> <955e> 3496\n<955f> <955f> 7786\n<9560> <956c> 3507\n<956d> <956d> 7787\n<956e> <956f> 3521\n<9570> <9570> 7788\n<9571> <957e> 3524\n<9580> <95c0> 3538\n<95c1> <95c1> 7789\n<95c2> <95ca> 3604\n<95cb> <95cb> 7790\n<95cc> <95d7> 3614\n<95d8> <95d8> 7791\n<95d9> <95f6> 3627\n<95f7> <95f7> 7792\n<95f8> <95fc> 3658\n<9640> <9640> 3663\n<9641> <9641> 7793\n<9642> <9647> 3665\n<9648> <9648> 7794\n<9649> <9669> 3672\n<966a> <966a> 7795\n<966b> <967e> 3706\n<9680> <9689> 3726\n<968a> <968a> 7475\n<968b> <968f> 3737\n<9690> <9690> 7796\n<9691> <9698> 3743\n<9699> <9699> 4143\n<969a> <96ca> 3752\n<96cb> <96cb> 7797\n<96cc> <96d6> 3802\n<96d7> <96d7> 7798\nendcidrange\n\n100 begincidrange\n<96d8> <96dc> 3814\n<96dd> <96dd> 7799\n<96de> <96df> 3820\n<96e0> <96e0> 7800\n<96e1> <96f6> 3823\n<96f7> <96f7> 6453\n<96f8> <96f8> 7801\n<96f9> <96f9> 3847\n<96fa> <96fa> 7802\n<96fb> <96fb> 3849\n<96fc> <96fc> 7803\n<9740> <9750> 3851\n<9751> <9751> 7804\n<9752> <976e> 3869\n<976f> <976f> 7805\n<9770> <9772> 3899\n<9773> <9773> 7806\n<9774> <9778> 3903\n<9779> <9779> 7476\n<977a> <977e> 3909\n<9780> <9788> 3914\n<9789> <9789> 7807\n<978a> <97c8> 3924\n<97c9> <97c9> 7808\n<97ca> <97f7> 3988\n<97f8> <97f9> 7809\n<97fa> <97fc> 4036\n<9840> <9840> 7811\n<9841> <984f> 4040\n<9850> <9850> 7812\n<9851> <9854> 4056\n<9855> <9855> 6007\n<9856> <9857> 4061\n<9858> <9858> 7813\n<9859> <9872> 4064\n<989f> <98d3> 4090\n<98d4> <98d4> 3751\n<98d5> <98fc> 4144\n<9940> <995b> 4184\n<995c> <995c> 7814\n<995d> <9965> 4213\n<9966> <9966> 7815\n<9967> <9969> 4223\n<996a> <996a> 7816\n<996b> <996b> 4227\n<996c> <996c> 7817\n<996d> <997e> 4229\n<9980> <99fc> 4247\n<9a40> <9a4e> 4372\n<9a4f> <9a4f> 7818\n<9a50> <9a58> 4388\n<9a59> <9a59> 7819\n<9a5a> <9a6e> 4398\n<9a6f> <9a6f> 7820\n<9a70> <9a7c> 4420\n<9a7d> <9a7d> 7821\n<9a7e> <9a7e> 4434\n<9a80> <9a8a> 4435\n<9a8b> <9a8b> 7822\n<9a8c> <9ac1> 4447\n<9ac2> <9ac2> 7823\n<9ac3> <9ae1> 4502\n<9ae2> <9ae2> 3063\n<9ae3> <9afc> 4534\n<9b40> <9b5b> 4560\n<9b5c> <9b5c> 7824\n<9b5d> <9b7e> 4589\n<9b80> <9b82> 4623\n<9b83> <9b83> 7825\n<9b84> <9b9f> 4627\n<9ba0> <9ba0> 7826\n<9ba1> <9bef> 4656\n<9bf0> <9bf0> 7827\n<9bf1> <9bfc> 4736\n<9c40> <9c7e> 4748\n<9c80> <9ca1> 4811\n<9ca2> <9ca2> 7828\n<9ca3> <9cfc> 4846\n<9d40> <9d7e> 4936\n<9d80> <9d80> 7829\n<9d81> <9d8b> 5000\n<9d8c> <9d8c> 7830\n<9d8d> <9d97> 5012\n<9d98> <9d98> 1447\n<9d99> <9db6> 5024\n<9db7> <9db7> 7831\n<9db8> <9dca> 5055\n<9dcb> <9dcb> 7832\n<9dcc> <9dfc> 5075\n<9e40> <9e63> 5124\n<9e64> <9e64> 7833\n<9e65> <9e68> 5161\n<9e69> <9e69> 7834\n<9e6a> <9e76> 5166\n<9e77> <9e77> 3490\n<9e78> <9e7e> 5180\n<9e80> <9e8a> 5187\n<9e8b> <9e8b> 7835\n<9e8c> <9e8c> 5199\n<9e8d> <9e8d> 3176\nendcidrange\n\n100 begincidrange\n<9e8e> <9e93> 5201\n<9e94> <9e94> 7836\n<9e95> <9efc> 5208\n<9f40> <9f7e> 5312\n<9f80> <9fb6> 5375\n<9fb7> <9fb7> 3181\n<9fb8> <9fcd> 5431\n<9fce> <9fce> 7837\n<9fcf> <9ff2> 5454\n<9ff3> <9ff3> 1535\n<9ff4> <9ffc> 5491\n<a0> <df>      326\n<e040> <e07e> 5500\n<e080> <e092> 5563\n<e093> <e093> 7838\n<e094> <e0a3> 5583\n<e0a4> <e0a4> 7839\n<e0a5> <e0dc> 5600\n<e0dd> <e0dd> 7840\n<e0de> <e0f3> 5657\n<e0f4> <e0f4> 7477\n<e0f5> <e0fc> 5680\n<e140> <e149> 5688\n<e14a> <e14a> 7841\n<e14b> <e14e> 5699\n<e14f> <e150> 7842\n<e151> <e17e> 5705\n<e180> <e1a8> 5751\n<e1a9> <e1a9> 7844\n<e1aa> <e1e5> 5793\n<e1e6> <e1e6> 2030\n<e1e7> <e1e7> 5854\n<e1e8> <e1e8> 3153\n<e1e9> <e1ec> 5856\n<e1ed> <e1ed> 7845\n<e1ee> <e1fc> 5861\n<e240> <e268> 5876\n<e269> <e269> 7846\n<e26a> <e272> 5918\n<e273> <e273> 7847\n<e274> <e27c> 5928\n<e27d> <e27d> 1492\n<e27e> <e27e> 5938\n<e280> <e2b6> 5939\n<e2b7> <e2b7> 7848\n<e2b8> <e2c3> 5995\n<e2c4> <e2c4> 4060\n<e2c5> <e2e1> 6008\n<e2e2> <e2e2> 7849\n<e2e3> <e2eb> 6038\n<e2ec> <e2ec> 7850\n<e2ed> <e2fc> 6048\n<e340> <e357> 6064\n<e358> <e358> 7851\n<e359> <e359> 6089\n<e35a> <e35a> 7852\n<e35b> <e364> 6091\n<e365> <e365> 7853\n<e366> <e37e> 6102\n<e380> <e3c3> 6127\n<e3c4> <e3c4> 7854\n<e3c5> <e3fc> 6196\n<e440> <e47e> 6252\n<e480> <e483> 6315\n<e484> <e484> 7855\n<e485> <e488> 6320\n<e489> <e489> 7856\n<e48a> <e491> 6325\n<e492> <e492> 7857\n<e493> <e4b1> 6334\n<e4b2> <e4b2> 7858\n<e4b3> <e4b8> 6366\n<e4b9> <e4b9> 7859\n<e4ba> <e4f1> 6373\n<e4f2> <e4f2> 7860\n<e4f3> <e4fc> 6430\n<e540> <e540> 6440\n<e541> <e541> 2293\n<e542> <e54c> 6442\n<e54d> <e54d> 3845\n<e54e> <e55a> 6454\n<e55b> <e55b> 7861\n<e55c> <e578> 6468\n<e579> <e579> 1440\n<e57a> <e57e> 6498\n<e580> <e5a1> 6503\n<e5a2> <e5a2> 3358\n<e5a3> <e5a4> 6538\n<e5a5> <e5a5> 7862\n<e5a6> <e5ba> 6541\n<e5bb> <e5bb> 7863\n<e5bc> <e5ec> 6563\n<e5ed> <e5ed> 7864\n<e5ee> <e5fc> 6613\n<e640> <e650> 6628\n<e651> <e651> 7865\n<e652> <e67b> 6646\n<e67c> <e67c> 1550\n<e67d> <e67e> 6689\n<e680> <e685> 6691\nendcidrange\n\n65 begincidrange\n<e686> <e686> 7866\n<e687> <e695> 6698\n<e696> <e696> 7867\n<e697> <e6ca> 6714\n<e6cb> <e6cb> 2730\n<e6cc> <e6e6> 6767\n<e6e7> <e6e7> 7868\n<e6e8> <e6f1> 6795\n<e6f2> <e6f2> 7869\n<e6f3> <e6fc> 6806\n<e740> <e76c> 6816\n<e76d> <e76d> 7870\n<e76e> <e77e> 6862\n<e780> <e78b> 6879\n<e78c> <e78c> 7871\n<e78d> <e78d> 6892\n<e78e> <e78e> 7872\n<e78f> <e7a6> 6894\n<e7a7> <e7a7> 7873\n<e7a8> <e7ba> 6919\n<e7bb> <e7bb> 7874\n<e7bc> <e7d4> 6939\n<e7d5> <e7d5> 7875\n<e7d6> <e7fc> 6965\n<e840> <e87e> 7004\n<e880> <e884> 7067\n<e885> <e885> 7876\n<e886> <e8b0> 7073\n<e8b1> <e8b1> 7877\n<e8b2> <e8c2> 7117\n<e8c3> <e8c3> 7878\n<e8c4> <e8ce> 7135\n<e8cf> <e8cf> 7879\n<e8d0> <e8d4> 7147\n<e8d5> <e8d5> 7880\n<e8d6> <e8f1> 7153\n<e8f2> <e8f2> 1841\n<e8f3> <e8f3> 7881\n<e8f4> <e8fc> 7183\n<e940> <e97e> 7192\n<e980> <e9aa> 7255\n<e9ab> <e9ab> 7882\n<e9ac> <e9b9> 7299\n<e9ba> <e9ba> 7883\n<e9bb> <e9ca> 7314\n<e9cb> <e9cb> 1143\n<e9cc> <e9cc> 7884\n<e9cd> <e9f1> 7332\n<e9f2> <e9f2> 1321\n<e9f3> <e9fc> 7370\n<ea40> <ea6f> 7380\n<ea70> <ea70> 7885\n<ea71> <ea7e> 7429\n<ea80> <ea9c> 7443\n<ea9d> <ea9d> 7886\n<ea9e> <ea9e> 7473\n<ed40> <ed7e> 8359\n<ed80> <edb3> 8422\n<edb4> <edb4> 1993\n<edb5> <edfc> 8474\n<ee40> <ee7e> 8546\n<ee80> <eeec> 8609\n<eeef> <eef8> 8092\n<eef9> <eef9>  751\n<eefa> <eefc> 8005\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/Ext-RKSJ-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (Ext-RKSJ-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (Ext-RKSJ-H)\n%%BeginResource: CMap (Ext-RKSJ-V)\n%%Title: (Ext-RKSJ-V Adobe Japan1 2)\n%%Version: 12.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/Ext-RKSJ-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 2 def\nend def\n\n/CMapName /Ext-RKSJ-V def\n/CMapVersion 12.002 def\n/CMapType 1 def\n\n/UIDOffset 810 def\n/XUID [1 10 25333] def\n\n/WMode 1 def\n\n39 begincidrange\n<8141> <8142> 7887\n<8143> <8143> 8268\n<8144> <8144> 8274\n<814a> <814a> 8272\n<814b> <814b> 8271\n<815b> <815d> 7891\n<8160> <8164> 7894\n<8165> <8165> 8281\n<8166> <8166> 8276\n<8167> <8167> 8279\n<8168> <8168> 8278\n<8169> <817a> 7899\n<818b> <818b> 8269\n<818c> <818c> 8273\n<818d> <818d> 8283\n<81ac> <81ac> 8270\n<829f> <829f> 7918\n<82a1> <82a1> 7919\n<82a3> <82a3> 7920\n<82a5> <82a5> 7921\n<82a7> <82a7> 7922\n<82c1> <82c1> 7923\n<82e1> <82e1> 7924\n<82e3> <82e3> 7925\n<82e5> <82e5> 7926\n<82ec> <82ec> 7927\n<8340> <8340> 7928\n<8342> <8342> 7929\n<8344> <8344> 7930\n<8346> <8346> 7931\n<8348> <8348> 7932\n<8362> <8362> 7933\n<8383> <8383> 7934\n<8385> <8385> 7935\n<8387> <8387> 7936\n<838e> <838e> 7937\n<8395> <8396> 7938\n<875f> <876e> 7940\n<8780> <8781> 7956\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/Ext-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (Ext-H)\n%%IncludeResource: procset (CIDInit)\n%%IncludeResource: CMap (Ext-H)\n%%BeginResource: CMap (Ext-V)\n%%Title: (Ext-V Adobe Japan1 2)\n%%Version: 12.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/Ext-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 2 def\nend def\n\n/CMapName /Ext-V def\n/CMapVersion 12.002 def\n/CMapType 1 def\n\n/UIDOffset 820 def\n/XUID [1 10 25334] def\n\n/WMode 1 def\n\n39 begincidrange\n<2122> <2123> 7887\n<2124> <2124> 8268\n<2125> <2125> 8274\n<212b> <212b> 8272\n<212c> <212c> 8271\n<213c> <213e> 7891\n<2141> <2145> 7894\n<2146> <2146> 8281\n<2147> <2147> 8276\n<2148> <2148> 8279\n<2149> <2149> 8278\n<214a> <215b> 7899\n<216b> <216b> 8269\n<216c> <216c> 8273\n<216d> <216d> 8283\n<222e> <222e> 8270\n<2421> <2421> 7918\n<2423> <2423> 7919\n<2425> <2425> 7920\n<2427> <2427> 7921\n<2429> <2429> 7922\n<2443> <2443> 7923\n<2463> <2463> 7924\n<2465> <2465> 7925\n<2467> <2467> 7926\n<246e> <246e> 7927\n<2521> <2521> 7928\n<2523> <2523> 7929\n<2525> <2525> 7930\n<2527> <2527> 7931\n<2529> <2529> 7932\n<2543> <2543> 7933\n<2563> <2563> 7934\n<2565> <2565> 7935\n<2567> <2567> 7936\n<256e> <256e> 7937\n<2575> <2576> 7938\n<2d40> <2d4f> 7940\n<2d60> <2d61> 7956\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (H)\n%%Title: (H Adobe Japan1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 1 def\nend def\n\n/CMapName /H def\n\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 280 def\n/XUID [1 10 25335] def\n\n/WMode 0 def\n\n1 begincodespacerange\n  <2121> <7E7E>\nendcodespacerange\n\n100 begincidrange\n<2121> <217e>  633\n<2221> <222e>  727\n<223a> <2241>  741\n<224a> <2250>  749\n<225c> <226a>  756\n<2272> <2279>  771\n<227e> <227e>  779\n<2330> <2339>  780\n<2341> <235a>  790\n<2361> <237a>  816\n<2421> <2473>  842\n<2521> <2576>  925\n<2621> <2638> 1011\n<2641> <2658> 1035\n<2721> <2741> 1059\n<2751> <2771> 1092\n<2821> <2821> 7479\n<2822> <2822> 7481\n<2823> <2823> 7491\n<2824> <2824> 7495\n<2825> <2825> 7503\n<2826> <2826> 7499\n<2827> <2827> 7507\n<2828> <2828> 7523\n<2829> <2829> 7515\n<282a> <282a> 7531\n<282b> <282b> 7539\n<282c> <282c> 7480\n<282d> <282d> 7482\n<282e> <282e> 7494\n<282f> <282f> 7498\n<2830> <2830> 7506\n<2831> <2831> 7502\n<2832> <2832> 7514\n<2833> <2833> 7530\n<2834> <2834> 7522\n<2835> <2835> 7538\n<2836> <2836> 7554\n<2837> <2837> 7511\n<2838> <2838> 7526\n<2839> <2839> 7519\n<283a> <283a> 7534\n<283b> <283b> 7542\n<283c> <283c> 7508\n<283d> <283d> 7527\n<283e> <283e> 7516\n<283f> <283f> 7535\n<2840> <2840> 7545\n<3021> <307e> 1125\n<3121> <317e> 1219\n<3221> <327e> 1313\n<3321> <337e> 1407\n<3421> <347e> 1501\n<3521> <357e> 1595\n<3621> <367e> 1689\n<3721> <377e> 1783\n<3821> <387e> 1877\n<3921> <397e> 1971\n<3a21> <3a7e> 2065\n<3b21> <3b7e> 2159\n<3c21> <3c7e> 2253\n<3d21> <3d7e> 2347\n<3e21> <3e7e> 2441\n<3f21> <3f7e> 2535\n<4021> <407e> 2629\n<4121> <417e> 2723\n<4221> <427e> 2817\n<4321> <437e> 2911\n<4421> <447e> 3005\n<4521> <457e> 3099\n<4621> <467e> 3193\n<4721> <477e> 3287\n<4821> <487e> 3381\n<4921> <497e> 3475\n<4a21> <4a7e> 3569\n<4b21> <4b7e> 3663\n<4c21> <4c7e> 3757\n<4d21> <4d7e> 3851\n<4e21> <4e7e> 3945\n<4f21> <4f53> 4039\n<5021> <507e> 4090\n<5121> <517e> 4184\n<5221> <527e> 4278\n<5321> <537e> 4372\n<5421> <547e> 4466\n<5521> <557e> 4560\n<5621> <567e> 4654\n<5721> <577e> 4748\n<5821> <587e> 4842\n<5921> <597e> 4936\n<5a21> <5a7e> 5030\n<5b21> <5b7e> 5124\n<5c21> <5c7e> 5218\n<5d21> <5d7e> 5312\n<5e21> <5e7e> 5406\n<5f21> <5f7e> 5500\n<6021> <607e> 5594\n<6121> <617e> 5688\n<6221> <627e> 5782\n<6321> <637e> 5876\nendcidrange\n\n18 begincidrange\n<6421> <647e> 5970\n<6521> <657e> 6064\n<6621> <667e> 6158\n<6721> <677e> 6252\n<6821> <687e> 6346\n<6921> <697e> 6440\n<6a21> <6a7e> 6534\n<6b21> <6b7e> 6628\n<6c21> <6c7e> 6722\n<6d21> <6d7e> 6816\n<6e21> <6e7e> 6910\n<6f21> <6f7e> 7004\n<7021> <707e> 7098\n<7121> <717e> 7192\n<7221> <727e> 7286\n<7321> <737e> 7380\n<7421> <7424> 7474\n<7425> <7426> 8284\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/Hankaku",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Hankaku)\n%%Title: (Hankaku Adobe Japan1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 0 def\nend def\n\n/CMapName /Hankaku def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 860 def\n/XUID [1 10 25348] def\n\n/WMode 0 def\n\n1 begincodespacerange\n  <00> <FF>\nendcodespacerange\n\n10 begincidrange\n<20> <5f> 231\n<60> <60> 231\n<61> <7e> 296\n<81> <85> 327\n<86> <8f> 516\n<90> <90> 342\n<91> <9f> 526\n<a1> <df> 327\n<e0> <fd> 541\n<fe> <ff> 388\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/Hiragana",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Hiragana)\n%%Title: (Hiragana Adobe Japan1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 0 def\nend def\n\n/CMapName /Hiragana def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 862 def\n/XUID [1 10 25349] def\n\n/WMode 0 def\n\n1 begincodespacerange\n  <00> <FF>\nendcodespacerange\n\n8 begincidrange\n<20> <20> 515\n<21> <25> 327\n<26> <2f> 516\n<30> <30> 342\n<31> <5d> 526\n<5e> <5f> 388\n<60> <62> 571\n<66> <7e> 574\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/Katakana",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Katakana)\n%%Title: (Katakana Adobe Japan1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 0 def\nend def\n\n/CMapName /Katakana def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 864 def\n/XUID [1 10 25350] def\n\n/WMode 0 def\n\n1 begincodespacerange\n  <00> <FF>\nendcodespacerange\n\n2 begincidrange\n<20> <5f> 326\n<60> <7e> 391\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/NWP-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (NWP-H)\n%%Title: (NWP-H Adobe Japan1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 0 def\nend def\n\n/CMapName /NWP-H def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/XUID [1 10 25336] def\n\n/WMode 0 def\n\n1 begincodespacerange\n  <2121> <7E7E>\nendcodespacerange\n\n100 begincidrange\n<2121> <2168>  633\n<2169> <2169> 7478\n<216a> <217e>  706\n<2221> <222e>  727\n<223a> <2241>  741\n<224a> <2250>  749\n<225c> <226a>  756\n<2272> <2279>  771\n<227e> <227e>  779\n<2330> <2339>  780\n<2341> <235a>  790\n<2361> <237a>  816\n<2421> <2473>  842\n<2521> <2576>  925\n<2621> <2638> 1011\n<2641> <2658> 1035\n<2721> <2741> 1059\n<2751> <2771> 1092\n<2921> <295f>  232\n<2960> <2960>  390\n<2961> <297e>  296\n<2a21> <2a5f>  327\n<2a60> <2a7e>  391\n<2b21> <2b71>  422\n<2b72> <2b72>  295\n<2b73> <2b7e>  503\n<2c24> <2c6f> 7479\n<2d21> <2d3e> 7555\n<2d40> <2d56> 7585\n<2d60> <2d6f> 7608\n<2d70> <2d70>  762\n<2d71> <2d71>  761\n<2d72> <2d72>  769\n<2d73> <2d79> 7624\n<2d7a> <2d7a>  768\n<2d7b> <2d7c> 7631\n<2e21> <2e21>  642\n<2e22> <2e22>  673\n<2e23> <2e23>  773\n<2e24> <2e24>  712\n<2e25> <2e25>  715\n<2e26> <2e26>  717\n<2e27> <2e27>  671\n<2e28> <2e29>  674\n<2e2a> <2e2a>  718\n<2e2b> <2e2b>  692\n<2e2c> <2e2c>  636\n<2e2d> <2e2d>  693\n<2e2e> <2e2e>  637\n<2e2f> <2e2f>  663\n<2e30> <2e39>  780\n<2e3a> <2e3b>  639\n<2e3c> <2e3c>  699\n<2e3d> <2e3d>  697\n<2e3e> <2e3e>  700\n<2e3f> <2e3f>  641\n<2e40> <2e40>  719\n<2e41> <2e5a>  790\n<2e5b> <2e5b>  678\n<2e5c> <2e5c>  711\n<2e5d> <2e5d>  679\n<2e5e> <2e5e>  648\n<2e5f> <2e5f>  650\n<2e60> <2e60>  646\n<2e61> <2e7a>  816\n<2e7b> <2e7b>  680\n<2e7c> <2e7c>  667\n<2e7d> <2e7d>  681\n<2e7e> <2e7e>  649\n<2f21> <2f21>  635\n<2f22> <2f23>  686\n<2f24> <2f24>  634\n<2f25> <2f25>  638\n<2f26> <2f26> 1006\n<2f27> <2f27>  925\n<2f28> <2f28>  927\n<2f29> <2f29>  929\n<2f2a> <2f2a>  931\n<2f2b> <2f2b>  933\n<2f2c> <2f2c>  991\n<2f2d> <2f2d>  993\n<2f2e> <2f2e>  995\n<2f2f> <2f2f>  959\n<2f30> <2f30>  660\n<2f31> <2f31>  926\n<2f32> <2f32>  928\n<2f33> <2f33>  930\n<2f34> <2f34>  932\n<2f35> <2f36>  934\n<2f37> <2f37>  937\n<2f38> <2f38>  939\n<2f39> <2f39>  941\n<2f3a> <2f3a>  943\n<2f3b> <2f3b>  945\n<2f3c> <2f3c>  947\n<2f3d> <2f3d>  949\n<2f3e> <2f3e>  951\n<2f3f> <2f3f>  953\n<2f40> <2f40>  955\n<2f41> <2f41>  957\nendcidrange\n\n100 begincidrange\n<2f42> <2f42>  960\n<2f43> <2f43>  962\n<2f44> <2f44>  964\n<2f45> <2f4a>  966\n<2f4b> <2f4b>  974\n<2f4c> <2f4c>  977\n<2f4d> <2f4d>  980\n<2f4e> <2f4e>  983\n<2f4f> <2f53>  986\n<2f54> <2f54>  992\n<2f55> <2f55>  994\n<2f56> <2f5b>  996\n<2f5c> <2f5c> 1003\n<2f5d> <2f5d> 1007\n<2f5e> <2f5f>  643\n<2f60> <2f61> 1004\n<2f62> <2f62> 1002\n<2f63> <2f64> 1009\n<2f65> <2f65> 1008\n<2f66> <2f66>  936\n<2f67> <2f67>  938\n<2f68> <2f68>  940\n<2f69> <2f69>  942\n<2f6a> <2f6a>  944\n<2f6b> <2f6b>  946\n<2f6c> <2f6c>  948\n<2f6d> <2f6d>  950\n<2f6e> <2f6e>  952\n<2f6f> <2f6f>  954\n<2f70> <2f70>  956\n<2f71> <2f71>  958\n<2f72> <2f72>  961\n<2f73> <2f73>  963\n<2f74> <2f74>  965\n<2f75> <2f76>  972\n<2f77> <2f78>  975\n<2f79> <2f7a>  978\n<2f7b> <2f7c>  981\n<2f7d> <2f7e>  984\n<3021> <3021> 1125\n<3022> <3022> 7633\n<3023> <3032> 1127\n<3033> <3033> 7330\n<3034> <303a> 1144\n<303b> <303b> 7634\n<303c> <306d> 1152\n<306e> <306e> 7635\n<306f> <3072> 1203\n<3073> <3073> 7636\n<3074> <307b> 1208\n<307c> <307c> 7637\n<307d> <307e> 1217\n<3121> <3129> 1219\n<312a> <312a> 7638\n<312b> <3134> 1229\n<3135> <3135> 7639\n<3136> <3138> 1240\n<3139> <3139> 7640\n<313a> <313b> 1244\n<313c> <313d> 7641\n<313e> <3141> 1248\n<3142> <3142> 7643\n<3143> <316a> 1253\n<316b> <316b> 7644\n<316c> <317e> 1294\n<3221> <3227> 1313\n<3228> <3228> 7645\n<3229> <3229> 7369\n<322a> <322a> 7646\n<322b> <325f> 1323\n<3260> <3260> 7647\n<3261> <3279> 1377\n<327a> <327a> 7648\n<327b> <327c> 1403\n<327d> <327d> 7649\n<327e> <327e> 1406\n<3321> <3321> 1407\n<3322> <3322> 7650\n<3323> <3341> 1409\n<3342> <3342> 6497\n<3343> <3348> 1441\n<3349> <3349> 5023\n<334a> <3364> 1448\n<3365> <3365> 7651\n<3366> <336a> 1476\n<336b> <336b> 7652\n<336c> <3372> 1482\n<3373> <3373> 7653\n<3374> <3375> 1490\n<3376> <3376> 5937\n<3377> <3379> 1493\n<337a> <337a> 7654\n<337b> <337e> 1497\n<3421> <3441> 1501\n<3442> <3442> 7655\n<3443> <3443> 5490\n<3444> <344c> 1536\n<344d> <344d> 7656\n<344e> <3451> 1546\n<3452> <3452> 6688\nendcidrange\n\n100 begincidrange\n<3453> <3464> 1551\n<3465> <3465> 7657\n<3466> <347e> 1570\n<3521> <352a> 1595\n<352b> <352b> 7658\n<352c> <353f> 1606\n<3540> <3540> 7659\n<3541> <357e> 1627\n<3621> <3621> 1689\n<3622> <3622> 7660\n<3623> <3629> 1691\n<362a> <362a> 7661\n<362b> <3645> 1699\n<3646> <3646> 7474\n<3647> <364e> 1727\n<364f> <364f> 7662\n<3650> <366c> 1736\n<366d> <366d> 7663\n<366e> <3673> 1766\n<3674> <3674> 7664\n<3675> <367a> 1773\n<367b> <367b> 7665\n<367c> <367c> 1780\n<367d> <367d> 7666\n<367e> <367e> 1782\n<3721> <3723> 1783\n<3724> <3724> 7667\n<3725> <3736> 1787\n<3737> <3737> 7668\n<3738> <3744> 1806\n<3745> <3745> 7669\n<3746> <374d> 1820\n<374e> <374e> 7670\n<374f> <3751> 1829\n<3752> <3752> 7671\n<3753> <3754> 1833\n<3755> <3755> 7672\n<3756> <375a> 1836\n<375b> <375b> 7181\n<375c> <3763> 1842\n<3764> <3764> 7673\n<3765> <3770> 1851\n<3771> <3771> 7674\n<3772> <3778> 1864\n<3779> <3779> 7675\n<377a> <377d> 1872\n<377e> <377e> 7676\n<3821> <3833> 1877\n<3834> <3834> 7677\n<3835> <3840> 1897\n<3841> <3841> 7678\n<3842> <387e> 1910\n<3921> <392a> 1971\n<392b> <392b> 7679\n<392c> <3936> 1982\n<3937> <3937> 7680\n<3938> <3941> 1994\n<3942> <3942> 7681\n<3943> <395b> 2005\n<395c> <395c> 5853\n<395d> <396c> 2031\n<396d> <396d> 7682\n<396e> <3973> 2048\n<3974> <3974> 7683\n<3975> <3978> 2055\n<3979> <3979> 7684\n<397a> <397e> 2060\n<3a21> <3a52> 2065\n<3a53> <3a53> 7685\n<3a54> <3a66> 2116\n<3a67> <3a67> 7686\n<3a68> <3a73> 2136\n<3a74> <3a74> 7687\n<3a75> <3a7e> 2149\n<3b21> <3b26> 2159\n<3b27> <3b27> 7688\n<3b28> <3b29> 2166\n<3b2a> <3b2a> 7689\n<3b2b> <3b2b> 2169\n<3b2c> <3b2c> 7690\n<3b2d> <3b38> 2171\n<3b39> <3b39> 7691\n<3b3a> <3b7e> 2184\n<3c21> <3c37> 2253\n<3c38> <3c38> 7692\n<3c39> <3c47> 2277\n<3c48> <3c48> 7693\n<3c49> <3c49> 6441\n<3c4a> <3c56> 2294\n<3c57> <3c57> 7694\n<3c58> <3c5c> 2308\n<3c5d> <3c5e> 7695\n<3c5f> <3c7e> 2315\n<3d21> <3d2a> 2347\n<3d2b> <3d2b> 7697\n<3d2c> <3d35> 2358\n<3d36> <3d36> 7698\n<3d37> <3d6b> 2369\n<3d6c> <3d6d> 7699\n<3d6e> <3d71> 2424\nendcidrange\n\n100 begincidrange\n<3d72> <3d73> 7701\n<3d74> <3d7e> 2430\n<3e21> <3e24> 2441\n<3e25> <3e25> 7703\n<3e26> <3e32> 2446\n<3e33> <3e33> 7704\n<3e34> <3e3e> 2460\n<3e3f> <3e3f> 7705\n<3e40> <3e54> 2472\n<3e55> <3e55> 7706\n<3e56> <3e5e> 2494\n<3e5f> <3e5f> 7707\n<3e60> <3e63> 2504\n<3e64> <3e64> 7708\n<3e65> <3e7e> 2509\n<3f21> <3f29> 2535\n<3f2a> <3f2a> 7709\n<3f2b> <3f58> 2545\n<3f59> <3f59> 7710\n<3f5a> <3f5f> 2592\n<3f60> <3f60> 7711\n<3f61> <3f68> 2599\n<3f69> <3f69> 7712\n<3f6a> <3f7e> 2608\n<4021> <4021> 2629\n<4022> <4022> 7713\n<4023> <4041> 2631\n<4042> <4042> 7714\n<4043> <4065> 2663\n<4066> <4066> 7715\n<4067> <4070> 2699\n<4071> <4072> 7716\n<4073> <4078> 2711\n<4079> <407a> 7718\n<407b> <407e> 2719\n<4121> <4126> 2723\n<4127> <4127> 7720\n<4128> <4128> 6766\n<4129> <4138> 2731\n<4139> <4139> 7721\n<413a> <414b> 2748\n<414c> <414c> 7722\n<414d> <414e> 2767\n<414f> <414f> 7723\n<4150> <415e> 2770\n<415f> <415f> 7724\n<4160> <4168> 2786\n<4169> <4169> 7725\n<416a> <417e> 2796\n<4221> <423c> 2817\n<423d> <423d> 7726\n<423e> <424c> 2846\n<424d> <424d> 7727\n<424e> <425b> 2862\n<425c> <425c> 7728\n<425d> <4262> 2877\n<4263> <4263> 7729\n<4264> <426e> 2884\n<426f> <426f> 7730\n<4270> <4274> 2896\n<4275> <4276> 7731\n<4277> <427c> 2903\n<427d> <427d> 7733\n<427e> <427e> 2910\n<4321> <4326> 2911\n<4327> <4327> 7734\n<4328> <4328> 2918\n<4329> <432a> 7735\n<432b> <432c> 2921\n<432d> <432e> 7737\n<432f> <433c> 2925\n<433d> <433d> 7739\n<433e> <436f> 2940\n<4370> <4370> 7740\n<4371> <4374> 2991\n<4375> <4375> 7741\n<4376> <437b> 2996\n<437c> <437c> 7742\n<437d> <437e> 3003\n<4421> <443c> 3005\n<443d> <443d> 7743\n<443e> <4447> 3034\n<4448> <4448> 7744\n<4449> <4449> 3045\n<444a> <444a> 7745\n<444b> <444c> 3047\n<444d> <444d> 7746\n<444e> <444e> 3050\n<444f> <444f> 7747\n<4450> <445a> 3052\n<445b> <445b> 4533\n<445c> <447e> 3064\n<4521> <4521> 3099\n<4522> <4522> 7748\n<4523> <4526> 3101\n<4527> <4527> 7749\n<4528> <452d> 3106\n<452e> <452e> 7750\n<452f> <4535> 3113\n<4536> <4536> 7751\nendcidrange\n\n100 begincidrange\n<4537> <453e> 3121\n<453f> <453f> 7752\n<4540> <4547> 3130\n<4548> <4548> 7753\n<4549> <454a> 3139\n<454b> <454b> 7754\n<454c> <4550> 3142\n<4551> <4552> 7755\n<4553> <4556> 3149\n<4557> <4557> 5855\n<4558> <4563> 3154\n<4564> <4564> 7757\n<4565> <456d> 3167\n<456e> <456e> 5200\n<456f> <4572> 3177\n<4573> <4573> 5430\n<4574> <4577> 3182\n<4578> <4578> 7758\n<4579> <457e> 3187\n<4621> <463d> 3193\n<463e> <463e> 7759\n<463f> <4641> 3223\n<4642> <4642> 7760\n<4643> <4653> 3227\n<4654> <4655> 7761\n<4656> <465a> 3246\n<465b> <465c> 7763\n<465d> <4660> 3253\n<4661> <4661> 7765\n<4662> <4665> 3258\n<4666> <4667> 7766\n<4668> <4669> 3264\n<466a> <466a> 7768\n<466b> <4675> 3267\n<4676> <4676> 6893\n<4677> <467e> 3279\n<4721> <4728> 3287\n<4729> <4729> 7769\n<472a> <4738> 3296\n<4739> <4739> 7770\n<473a> <4756> 3312\n<4757> <4757> 7771\n<4758> <4766> 3342\n<4767> <4767> 7772\n<4768> <4768> 6537\n<4769> <4769> 7773\n<476a> <476c> 3360\n<476d> <476d> 7774\n<476e> <477e> 3364\n<4821> <4823> 3381\n<4824> <4824> 7775\n<4825> <482d> 3385\n<482e> <482e> 7776\n<482f> <482f> 3395\n<4830> <4830> 7777\n<4831> <4853> 3397\n<4854> <4854> 7778\n<4855> <4861> 3433\n<4862> <4862> 7779\n<4863> <4874> 3447\n<4875> <4875> 7780\n<4876> <487e> 3466\n<4921> <4921> 3475\n<4922> <4923> 7781\n<4924> <492e> 3478\n<492f> <492f> 7783\n<4930> <4930> 5179\n<4931> <4931> 3491\n<4932> <4932> 7784\n<4933> <4934> 3493\n<4935> <4935> 7785\n<4936> <493f> 3496\n<4940> <4940> 7786\n<4941> <494d> 3507\n<494e> <494e> 7787\n<494f> <4950> 3521\n<4951> <4951> 7788\n<4952> <497e> 3524\n<4a21> <4a42> 3569\n<4a43> <4a43> 7789\n<4a44> <4a4c> 3604\n<4a4d> <4a4d> 7790\n<4a4e> <4a59> 3614\n<4a5a> <4a5a> 7791\n<4a5b> <4a78> 3627\n<4a79> <4a79> 7792\n<4a7a> <4a7e> 3658\n<4b21> <4b21> 3663\n<4b22> <4b22> 7793\n<4b23> <4b28> 3665\n<4b29> <4b29> 7794\n<4b2a> <4b4a> 3672\n<4b4b> <4b4b> 7795\n<4b4c> <4b69> 3706\n<4b6a> <4b6a> 7475\n<4b6b> <4b6f> 3737\n<4b70> <4b70> 7796\n<4b71> <4b78> 3743\n<4b79> <4b79> 4143\n<4b7a> <4b7e> 3752\nendcidrange\n\n100 begincidrange\n<4c21> <4c4c> 3757\n<4c4d> <4c4d> 7797\n<4c4e> <4c58> 3802\n<4c59> <4c59> 7798\n<4c5a> <4c5e> 3814\n<4c5f> <4c5f> 7799\n<4c60> <4c61> 3820\n<4c62> <4c62> 7800\n<4c63> <4c78> 3823\n<4c79> <4c79> 6453\n<4c7a> <4c7a> 7801\n<4c7b> <4c7b> 3847\n<4c7c> <4c7c> 7802\n<4c7d> <4c7d> 3849\n<4c7e> <4c7e> 7803\n<4d21> <4d31> 3851\n<4d32> <4d32> 7804\n<4d33> <4d4f> 3869\n<4d50> <4d50> 7805\n<4d51> <4d53> 3899\n<4d54> <4d54> 7806\n<4d55> <4d59> 3903\n<4d5a> <4d5a> 7476\n<4d5b> <4d68> 3909\n<4d69> <4d69> 7807\n<4d6a> <4d7e> 3924\n<4e21> <4e4a> 3945\n<4e4b> <4e4b> 7808\n<4e4c> <4e79> 3988\n<4e7a> <4e7b> 7809\n<4e7c> <4e7e> 4036\n<4f21> <4f21> 7811\n<4f22> <4f30> 4040\n<4f31> <4f31> 7812\n<4f32> <4f35> 4056\n<4f36> <4f36> 6007\n<4f37> <4f38> 4061\n<4f39> <4f39> 7813\n<4f3a> <4f53> 4064\n<5021> <5055> 4090\n<5056> <5056> 3751\n<5057> <507e> 4144\n<5121> <513c> 4184\n<513d> <513d> 7814\n<513e> <5146> 4213\n<5147> <5147> 7815\n<5148> <514a> 4223\n<514b> <514b> 7816\n<514c> <514c> 4227\n<514d> <514d> 7817\n<514e> <517e> 4229\n<5221> <527e> 4278\n<5321> <532f> 4372\n<5330> <5330> 7818\n<5331> <5339> 4388\n<533a> <533a> 7819\n<533b> <534f> 4398\n<5350> <5350> 7820\n<5351> <535d> 4420\n<535e> <535e> 7821\n<535f> <536a> 4434\n<536b> <536b> 7822\n<536c> <537e> 4447\n<5421> <5443> 4466\n<5444> <5444> 7823\n<5445> <5463> 4502\n<5464> <5464> 3063\n<5465> <547e> 4534\n<5521> <553c> 4560\n<553d> <553d> 7824\n<553e> <5562> 4589\n<5563> <5563> 7825\n<5564> <557e> 4627\n<5621> <5621> 4654\n<5622> <5622> 7826\n<5623> <5671> 4656\n<5672> <5672> 7827\n<5673> <567e> 4736\n<5721> <577e> 4748\n<5821> <5823> 4842\n<5824> <5824> 7828\n<5825> <587e> 4846\n<5921> <595f> 4936\n<5960> <5960> 7829\n<5961> <596b> 5000\n<596c> <596c> 7830\n<596d> <5977> 5012\n<5978> <5978> 1447\n<5979> <597e> 5024\n<5a21> <5a38> 5030\n<5a39> <5a39> 7831\n<5a3a> <5a4c> 5055\n<5a4d> <5a4d> 7832\n<5a4e> <5a7e> 5075\n<5b21> <5b44> 5124\n<5b45> <5b45> 7833\n<5b46> <5b49> 5161\n<5b4a> <5b4a> 7834\n<5b4b> <5b57> 5166\n<5b58> <5b58> 3490\nendcidrange\n\n100 begincidrange\n<5b59> <5b6a> 5180\n<5b6b> <5b6b> 7835\n<5b6c> <5b6c> 5199\n<5b6d> <5b6d> 3176\n<5b6e> <5b73> 5201\n<5b74> <5b74> 7836\n<5b75> <5b7e> 5208\n<5c21> <5c7e> 5218\n<5d21> <5d7e> 5312\n<5e21> <5e38> 5406\n<5e39> <5e39> 3181\n<5e3a> <5e4f> 5431\n<5e50> <5e50> 7837\n<5e51> <5e74> 5454\n<5e75> <5e75> 1535\n<5e76> <5e7e> 5491\n<5f21> <5f72> 5500\n<5f73> <5f73> 7838\n<5f74> <5f7e> 5583\n<6021> <6025> 5594\n<6026> <6026> 7839\n<6027> <605e> 5600\n<605f> <605f> 7840\n<6060> <6075> 5657\n<6076> <6076> 7477\n<6077> <607e> 5680\n<6121> <612a> 5688\n<612b> <612b> 7841\n<612c> <612f> 5699\n<6130> <6131> 7842\n<6132> <617e> 5705\n<6221> <622a> 5782\n<622b> <622b> 7844\n<622c> <6267> 5793\n<6268> <6268> 2030\n<6269> <6269> 5854\n<626a> <626a> 3153\n<626b> <626e> 5856\n<626f> <626f> 7845\n<6270> <627e> 5861\n<6321> <6349> 5876\n<634a> <634a> 7846\n<634b> <6353> 5918\n<6354> <6354> 7847\n<6355> <635d> 5928\n<635e> <635e> 1492\n<635f> <637e> 5938\n<6421> <6438> 5970\n<6439> <6439> 7848\n<643a> <6445> 5995\n<6446> <6446> 4060\n<6447> <6463> 6008\n<6464> <6464> 7849\n<6465> <646d> 6038\n<646e> <646e> 7850\n<646f> <647e> 6048\n<6521> <6538> 6064\n<6539> <6539> 7851\n<653a> <653a> 6089\n<653b> <653b> 7852\n<653c> <6545> 6091\n<6546> <6546> 7853\n<6547> <657e> 6102\n<6621> <6645> 6158\n<6646> <6646> 7854\n<6647> <667e> 6196\n<6721> <6763> 6252\n<6764> <6764> 7855\n<6765> <6768> 6320\n<6769> <6769> 7856\n<676a> <6771> 6325\n<6772> <6772> 7857\n<6773> <677e> 6334\n<6821> <6833> 6346\n<6834> <6834> 7858\n<6835> <683a> 6366\n<683b> <683b> 7859\n<683c> <6873> 6373\n<6874> <6874> 7860\n<6875> <687e> 6430\n<6921> <6921> 6440\n<6922> <6922> 2293\n<6923> <692d> 6442\n<692e> <692e> 3845\n<692f> <693b> 6454\n<693c> <693c> 7861\n<693d> <6959> 6468\n<695a> <695a> 1440\n<695b> <697e> 6498\n<6a21> <6a23> 6534\n<6a24> <6a24> 3358\n<6a25> <6a26> 6538\n<6a27> <6a27> 7862\n<6a28> <6a3c> 6541\n<6a3d> <6a3d> 7863\n<6a3e> <6a6e> 6563\n<6a6f> <6a6f> 7864\n<6a70> <6a7e> 6613\n<6b21> <6b31> 6628\n<6b32> <6b32> 7865\nendcidrange\n\n59 begincidrange\n<6b33> <6b5c> 6646\n<6b5d> <6b5d> 1550\n<6b5e> <6b65> 6689\n<6b66> <6b66> 7866\n<6b67> <6b75> 6698\n<6b76> <6b76> 7867\n<6b77> <6b7e> 6714\n<6c21> <6c4c> 6722\n<6c4d> <6c4d> 2730\n<6c4e> <6c68> 6767\n<6c69> <6c69> 7868\n<6c6a> <6c73> 6795\n<6c74> <6c74> 7869\n<6c75> <6c7e> 6806\n<6d21> <6d4d> 6816\n<6d4e> <6d4e> 7870\n<6d4f> <6d6b> 6862\n<6d6c> <6d6c> 7871\n<6d6d> <6d6d> 6892\n<6d6e> <6d6e> 7872\n<6d6f> <6d7e> 6894\n<6e21> <6e28> 6910\n<6e29> <6e29> 7873\n<6e2a> <6e3c> 6919\n<6e3d> <6e3d> 7874\n<6e3e> <6e56> 6939\n<6e57> <6e57> 7875\n<6e58> <6e7e> 6965\n<6f21> <6f64> 7004\n<6f65> <6f65> 7876\n<6f66> <6f7e> 7073\n<7021> <7032> 7098\n<7033> <7033> 7877\n<7034> <7044> 7117\n<7045> <7045> 7878\n<7046> <7050> 7135\n<7051> <7051> 7879\n<7052> <7056> 7147\n<7057> <7057> 7880\n<7058> <7073> 7153\n<7074> <7074> 1841\n<7075> <7075> 7881\n<7076> <707e> 7183\n<7121> <717e> 7192\n<7221> <722c> 7286\n<722d> <722d> 7882\n<722e> <723b> 7299\n<723c> <723c> 7883\n<723d> <724c> 7314\n<724d> <724d> 1143\n<724e> <724e> 7884\n<724f> <7273> 7332\n<7274> <7274> 1321\n<7275> <727e> 7370\n<7321> <7350> 7380\n<7351> <7351> 7885\n<7352> <737c> 7429\n<737d> <737d> 7886\n<737e> <737e> 7473\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/NWP-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (NWP-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (NWP-H)\n%%BeginResource: CMap (NWP-V)\n%%Title: (NWP-V Adobe Japan1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/NWP-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 0 def\nend def\n\n/CMapName /NWP-V def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/XUID [1 10 25337] def\n\n/WMode 1 def\n\n48 begincidrange\n<2122> <2123> 7887\n<2124> <2124> 8268\n<2125> <2125> 8274\n<212b> <212b> 8272\n<212c> <212c> 8271\n<213c> <213e> 7891\n<2141> <2145> 7894\n<2146> <2146> 8281\n<2147> <2147> 8276\n<2148> <2148> 8279\n<2149> <2149> 8278\n<214a> <215b> 7899\n<216b> <216b> 8269\n<216c> <216c> 8273\n<216d> <216d> 8283\n<222e> <222e> 8270\n<2421> <2421> 7918\n<2423> <2423> 7919\n<2425> <2425> 7920\n<2427> <2427> 7921\n<2429> <2429> 7922\n<2443> <2443> 7923\n<2463> <2463> 7924\n<2465> <2465> 7925\n<2467> <2467> 7926\n<246e> <246e> 7927\n<2521> <2521> 7928\n<2523> <2523> 7929\n<2525> <2525> 7930\n<2527> <2527> 7931\n<2529> <2529> 7932\n<2543> <2543> 7933\n<2563> <2563> 7934\n<2565> <2565> 7935\n<2567> <2567> 7936\n<256e> <256e> 7937\n<2575> <2576> 7938\n<2d40> <2d4f> 7940\n<2d60> <2d61> 7956\n<2f21> <2f21> 7888\n<2f22> <2f23> 7911\n<2f24> <2f24> 7887\n<2f27> <2f2b> 7928\n<2f2c> <2f2e> 7934\n<2f2f> <2f2f> 7933\n<2f30> <2f30> 7891\n<2f5e> <2f5e> 8272\n<2f5f> <2f5f> 8271\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/RKSJ-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (RKSJ-H)\n%%Title: (RKSJ-H Adobe Japan1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 1 def\nend def\n\n/CMapName /RKSJ-H def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 210 def\n/XUID [1 10 25338] def\n\n/WMode 0 def\n\n4 begincodespacerange\n  <00>   <80>\n  <8140> <9FFC>\n  <A0>   <DF>\n  <E040> <FCFC>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 231\nendnotdefrange\n\n100 begincidrange\n<20> <7e>      231\n<8140> <817e>  633\n<8180> <81ac>  696\n<81b8> <81bf>  741\n<81c8> <81ce>  749\n<81da> <81e8>  756\n<81f0> <81f7>  771\n<81fc> <81fc>  779\n<824f> <8258>  780\n<8260> <8279>  790\n<8281> <829a>  816\n<829f> <82f1>  842\n<8340> <837e>  925\n<8380> <8396>  988\n<839f> <83b6> 1011\n<83bf> <83d6> 1035\n<8440> <8460> 1059\n<8470> <847e> 1092\n<8480> <8491> 1107\n<849f> <849f> 7479\n<84a0> <84a0> 7481\n<84a1> <84a1> 7491\n<84a2> <84a2> 7495\n<84a3> <84a3> 7503\n<84a4> <84a4> 7499\n<84a5> <84a5> 7507\n<84a6> <84a6> 7523\n<84a7> <84a7> 7515\n<84a8> <84a8> 7531\n<84a9> <84a9> 7539\n<84aa> <84aa> 7480\n<84ab> <84ab> 7482\n<84ac> <84ac> 7494\n<84ad> <84ad> 7498\n<84ae> <84ae> 7506\n<84af> <84af> 7502\n<84b0> <84b0> 7514\n<84b1> <84b1> 7530\n<84b2> <84b2> 7522\n<84b3> <84b3> 7538\n<84b4> <84b4> 7554\n<84b5> <84b5> 7511\n<84b6> <84b6> 7526\n<84b7> <84b7> 7519\n<84b8> <84b8> 7534\n<84b9> <84b9> 7542\n<84ba> <84ba> 7508\n<84bb> <84bb> 7527\n<84bc> <84bc> 7516\n<84bd> <84bd> 7535\n<84be> <84be> 7545\n<889f> <88fc> 1125\n<8940> <897e> 1219\n<8980> <89fc> 1282\n<8a40> <8a7e> 1407\n<8a80> <8afc> 1470\n<8b40> <8b7e> 1595\n<8b80> <8bfc> 1658\n<8c40> <8c7e> 1783\n<8c80> <8cfc> 1846\n<8d40> <8d7e> 1971\n<8d80> <8dfc> 2034\n<8e40> <8e7e> 2159\n<8e80> <8efc> 2222\n<8f40> <8f7e> 2347\n<8f80> <8ffc> 2410\n<9040> <907e> 2535\n<9080> <90fc> 2598\n<9140> <917e> 2723\n<9180> <91fc> 2786\n<9240> <927e> 2911\n<9280> <92fc> 2974\n<9340> <937e> 3099\n<9380> <93fc> 3162\n<9440> <947e> 3287\n<9480> <94fc> 3350\n<9540> <957e> 3475\n<9580> <95fc> 3538\n<9640> <967e> 3663\n<9680> <96fc> 3726\n<9740> <977e> 3851\n<9780> <97fc> 3914\n<9840> <9872> 4039\n<989f> <98fc> 4090\n<9940> <997e> 4184\n<9980> <99fc> 4247\n<9a40> <9a7e> 4372\n<9a80> <9afc> 4435\n<9b40> <9b7e> 4560\n<9b80> <9bfc> 4623\n<9c40> <9c7e> 4748\n<9c80> <9cfc> 4811\n<9d40> <9d7e> 4936\n<9d80> <9dfc> 4999\n<9e40> <9e7e> 5124\n<9e80> <9efc> 5187\n<9f40> <9f7e> 5312\n<9f80> <9ffc> 5375\n<a0> <df>      326\n<e040> <e07e> 5500\nendcidrange\n\n22 begincidrange\n<e080> <e0fc> 5563\n<e140> <e17e> 5688\n<e180> <e1fc> 5751\n<e240> <e27e> 5876\n<e280> <e2fc> 5939\n<e340> <e37e> 6064\n<e380> <e3fc> 6127\n<e440> <e47e> 6252\n<e480> <e4fc> 6315\n<e540> <e57e> 6440\n<e580> <e5fc> 6503\n<e640> <e67e> 6628\n<e680> <e6fc> 6691\n<e740> <e77e> 6816\n<e780> <e7fc> 6879\n<e840> <e87e> 7004\n<e880> <e8fc> 7067\n<e940> <e97e> 7192\n<e980> <e9fc> 7255\n<ea40> <ea7e> 7380\n<ea80> <eaa2> 7443\n<eaa3> <eaa4> 8284\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/RKSJ-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (RKSJ-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (RKSJ-H)\n%%BeginResource: CMap (RKSJ-V)\n%%Title: (RKSJ-V Adobe Japan1 1)\n%%Version: 12.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/RKSJ-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 1 def\nend def\n\n/CMapName /RKSJ-V def\n/CMapVersion 12.002 def\n/CMapType 1 def\n\n/UIDOffset 840 def\n/XUID [1 10 25339] def\n\n/WMode 1 def\n\n27 begincidrange\n<8141> <8142> 7887\n<8150> <8151> 7889\n<815b> <815d> 7891\n<8160> <8164> 7894\n<8169> <817a> 7899\n<8181> <8181> 7917\n<829f> <829f> 7918\n<82a1> <82a1> 7919\n<82a3> <82a3> 7920\n<82a5> <82a5> 7921\n<82a7> <82a7> 7922\n<82c1> <82c1> 7923\n<82e1> <82e1> 7924\n<82e3> <82e3> 7925\n<82e5> <82e5> 7926\n<82ec> <82ec> 7927\n<8340> <8340> 7928\n<8342> <8342> 7929\n<8344> <8344> 7930\n<8346> <8346> 7931\n<8348> <8348> 7932\n<8362> <8362> 7933\n<8383> <8383> 7934\n<8385> <8385> 7935\n<8387> <8387> 7936\n<838e> <838e> 7937\n<8395> <8396> 7938\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/Roman",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Roman)\n%%Title: (Roman Adobe Japan1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 0 def\nend def\n\n/CMapName /Roman def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 866 def\n/XUID [1 10 25351] def\n\n/WMode 0 def\n\n1 begincodespacerange\n  <00> <FF>\nendcodespacerange\n\n1 begincidrange\n<20> <7e> 231\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJIS-UCS2-H",
    "content": "begincmap\n/CMapName /UniJIS-UCS2-H def\n/WMode 0 def\n/UniJIS-X usecmap\nbegincodespacerange\n<0000><d7ff>\n<e000><ffff>\nendcodespacerange\nbegincidchar\n<7c>93\n<7e>95\n<a6>99\n<a7>720\n<a8>647\n<b0>707\n<b1>694\n<b4>645\n<b6>778\n<d7>695\n<f7>696\n<0127>12092\n<01c0>99\n<0361>758\n<045b>12092\n<2010>662\n<2012>114\n<203e>325\n<20dd>779\n<210f>12092\n<2135>12089\n<2194>12201\n<2195>12215\n<21d2>752\n<21d4>753\n<2200>754\n<2202>759\n<2203>755\n<2205>12184\n<2207>760\n<2208>741\n<220a>12091\n<220b>742\n<2211>7625\n<2212>693\n<2213>12118\n<221a>765\n<221d>767\n<221e>703\n<221f>7629\n<2220>756\n<2225>666\n<2229>748\n<222a>747\n<222d>8195\n<222e>7624\n<2234>704\n<2235>768\n<223c>665\n<223d>766\n<2243>12120\n<2252>762\n<2260>698\n<2261>761\n<2295>12188\n<2296>12186\n<2297>12189\n<2298>12187\n<229d>12186\n<229e>12190\n<22a0>12185\n<22a5>757\n<22bf>7630\n<22ee>7897\n<22ef>668\n<2300>12184\n<244a>12116\n<2612>12185\n<2eac>2260\n<2f5b>1383\n<5002>13383\n<5026>1863\n<50c5>1735\n<5132>3813\n<514e>3136\n<51a4>4228\n<51de>14352\n<5307>8404\n<537f>1698\n<53a9>1243\n<53c9>2085\n<53db>3412\n<53df>4332\n<54ac>4368\n<54e8>2445\n<5561>14393\n<55b0>1772\n<5632>4433\n<5642>1247\n<564c>2747\n<56c0>4454\n<5835>3138\n<5a29>3626\n<5bec>8436\n<5c51>1781\n<5c60>3141\n<5db2>15269\n<5df7>1981\n<5e96>3657\n<5ecb>14510\n<5edf>3506\n<5efb>1398\n<5f98>4796\n<5fbd>1605\n<6062>1402\n<609e>14541\n<6108>3848\n<6241>4943\n<633a>3086\n<633d>3432\n<6357>3033\n<6372>1876\n<63c3>2839\n<646f>5020\n<647a>2630\n<64b0>2709\n<64e2>3105\n<65a7>3538\n<661e>8476\n<6666>1408\n<6677>14609\n<6753>2313\n<6756>2523\n<6801>8494\n<6897>1998\n<6962>3266\n<696f>2407\n<698a>2135\n<6994>4055\n<69cc>3044\n<69ea>13679\n<6a0b>3465\n<6a3d>2924\n<6adb>1779\n<6b4e>2933\n<6c3a>14690\n<6c72>1660\n<6deb>1216\n<6ea2>1202\n<6eba>3112\n<6f23>4034\n<6ff9>14741\n<7015>3520\n<701e>3244\n<7026>2995\n<704a>14744\n<7058>3263\n<7078>1662\n<707c>2314\n<7149>4035\n<714e>2717\n<7152>14762\n<717d>2718\n<71b3>14766\n<723a>3832\n<724c>3341\n<7259>1383\n<72e1>5629\n<7337>3868\n<7462>8561\n<7511>2059\n<7515>5704\n<7526>5707\n<75bc>5741\n<7626>7725\n<77a5>3613\n<7934>14904\n<7941>1805\n<7947>1626\n<79b0>3295\n<79e4>3359\n<7a17>3477\n<7a60>14926\n<7a7f>2720\n<7ac8>5937\n<7b08>1666\n<7b75>5976\n<7bad>2721\n<7bb8>3384\n<7bc7>3619\n<7bdd>6001\n<7c3e>4036\n<7c7e>3822\n<7c82>1791\n<7d5c>8592\n<7feb>1569\n<7ff0>1545\n<8171>6258\n<817f>2876\n<8258>6310\n<8292>6325\n<82a6>1142\n<8328>1205\n<845b>1481\n<84ec>3671\n<8511>3614\n<853d>3603\n<85a9>2165\n<85af>2428\n<85f7>2429\n<8654>6481\n<86f8>2909\n<8703>6510\n<8755>2544\n<8803>15107\n<8805>6537\n<8956>1320\n<8a0a>2588\n<8a1d>6662\n<8a3b>2990\n<8a6e>2729\n<8ab9>3460\n<8afa>1909\n<8b0e>3262\n<8b2c>3495\n<8b7f>8625\n<8c79>3505\n<8ced>3148\n<8fbb>3056\n<8fbf>2919\n<8fc2>1228\n<8fc4>3750\n<8fc6>15185\n<8fe6>1376\n<9017>2598\n<9019>3357\n<9022>1133\n<903c>3489\n<9041>3251\n<905c>2845\n<9061>2766\n<912d>3100\n<914b>2368\n<91dc>1494\n<9306>2170\n<9365>15238\n<9375>1892\n<939a>3046\n<9453>3846\n<95ab>15258\n<9699>1850\n<9755>8696\n<9771>7152\n<9784>1489\n<9798>2508\n<97ad>3628\n<98f4>1151\n<9905>3819\n<990c>1252\n<9910>2191\n<9957>1722\n<99c1>3379\n<9a19>7248\n<9a4a>15319\n<9b2d>13372\n<9bab>2171\n<9bd6>2168\n<9c2f>1207\n<9c52>3742\n<9c6a>15346\n<9d09>7362\n<9d60>2054\n<f929>8489\n<f9dc>8686\n<fa10>8422\n<fa11>8443\n<fa15>8542\n<fa20>8612\n<fa24>8632\nendcidchar\nbegincidrange\n<2018><2019>670\n<201c><201d>672\n<2032><2033>708\n<2227><2228>749\n<222b><222c>769\n<2266><2267>701\n<226a><226b>763\n<2272><2273>12121\n<2282><2283>745\n<2286><2287>743\nendcidrange\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJIS-UCS2-HW-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniJIS-UCS2-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniJIS-UCS2-H)\n%%BeginResource: CMap (UniJIS-UCS2-HW-H)\n%%Title: (UniJIS-UCS2-HW-H Adobe Japan1 4)\n%%Version: 12.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniJIS-UCS2-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 4 def\nend def\n\n/CMapName /UniJIS-UCS2-HW-H def\n/CMapVersion 12.002 def\n/CMapType 1 def\n\n/XUID [1 10 25448] def\n\n/WMode 0 def\n\n4 begincidrange\n<0020> <005b> 231\n<005c> <005c> 8719\n<005d> <007e> 292\n<00a5> <00a5> 291\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJIS-UCS2-HW-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniJIS-UCS2-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniJIS-UCS2-H)\n%%BeginResource: CMap (UniJIS-UCS2-HW-V)\n%%Title: (UniJIS-UCS2-HW-V Adobe Japan1 4)\n%%Version: 12.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniJIS-UCS2-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 4 def\nend def\n\n/CMapName /UniJIS-UCS2-HW-V def\n/CMapVersion 12.003 def\n/CMapType 1 def\n\n/XUID [1 10 25449] def\n\n/WMode 1 def\n\n100 begincidrange\n<0020> <005b> 231\n<005c> <005c> 8719\n<005d> <007e> 292\n<00a5> <00a5> 291\n<00b0> <00b0> 8269\n<2010> <2010> 7893\n<2015> <2015> 7892\n<2016> <2016> 7895\n<2018> <2019> 8281\n<201c> <201d> 8279\n<2025> <2025> 7898\n<2026> <2026> 7897\n<2032> <2032> 8273\n<2033> <2033> 8283\n<2190> <2190> 738\n<2191> <2191> 736\n<2192> <2192> 739\n<2193> <2193> 737\n<2195> <2195> 12214\n<21c4> <21c4> 8311\n<21c5> <21c5> 8310\n<21c6> <21c6> 8312\n<21e6> <21e6> 8012\n<21e7> <21e7> 8014\n<21e8> <21e8> 8011\n<21e9> <21e9> 8013\n<2225> <2225> 7895\n<223c> <223c> 7894\n<22ef> <22ef> 7897\n<2500> <2501> 7481\n<2502> <2503> 7479\n<2504> <2505> 7485\n<2506> <2507> 7483\n<2508> <2509> 7489\n<250a> <250b> 7487\n<250c> <250c> 7495\n<250d> <250d> 7497\n<250e> <250e> 7496\n<250f> <250f> 7498\n<2510> <2510> 7503\n<2511> <2511> 7505\n<2512> <2512> 7504\n<2513> <2513> 7506\n<2514> <2514> 7491\n<2515> <2515> 7493\n<2516> <2516> 7492\n<2517> <2517> 7494\n<2518> <2518> 7499\n<2519> <2519> 7501\n<251a> <251a> 7500\n<251b> <251b> 7502\n<251c> <251c> 7523\n<251d> <251d> 7527\n<251e> <251e> 7525\n<251f> <251f> 7524\n<2520> <2520> 7526\n<2521> <2521> 7529\n<2522> <2522> 7528\n<2523> <2524> 7530\n<2525> <2525> 7535\n<2526> <2526> 7533\n<2527> <2527> 7532\n<2528> <2528> 7534\n<2529> <2529> 7537\n<252a> <252a> 7536\n<252b> <252b> 7538\n<252c> <252c> 7515\n<252d> <252f> 7517\n<2530> <2530> 7516\n<2531> <2533> 7520\n<2534> <2534> 7507\n<2535> <2537> 7509\n<2538> <2538> 7508\n<2539> <253b> 7512\n<253d> <253f> 7543\n<2540> <2540> 7541\n<2541> <2541> 7540\n<2542> <2542> 7542\n<2543> <2543> 7547\n<2544> <2544> 7549\n<2545> <2545> 7546\n<2546> <2546> 7548\n<2547> <2547> 7553\n<2548> <2548> 7552\n<2549> <254a> 7550\n<261c> <261c> 8221\n<261d> <261d> 8219\n<261e> <261e> 8222\n<261f> <261f> 8220\n<2702> <2702> 12178\n<27a1> <27a1> 8209\n<3001> <3002> 7887\n<3008> <3011> 7907\n<3013> <3013> 8270\n<3014> <3015> 7901\n<301c> <301c> 7894\n<301d> <301d> 7956\n<301f> <301f> 7957\n<3041> <3041> 7918\n<3043> <3043> 7919\nendcidrange\n\n99 begincidrange\n<3045> <3045> 7920\n<3047> <3047> 7921\n<3049> <3049> 7922\n<3063> <3063> 7923\n<3083> <3083> 7924\n<3085> <3085> 7925\n<3087> <3087> 7926\n<308e> <308e> 7927\n<309b> <309b> 8272\n<309c> <309c> 8271\n<30a1> <30a1> 7928\n<30a3> <30a3> 7929\n<30a5> <30a5> 7930\n<30a7> <30a7> 7931\n<30a9> <30a9> 7932\n<30c3> <30c3> 7933\n<30e3> <30e3> 7934\n<30e5> <30e5> 7935\n<30e7> <30e7> 7936\n<30ee> <30ee> 7937\n<30f5> <30f6> 7938\n<30fc> <30fc> 7891\n<3300> <3300> 8350\n<3301> <3302> 11958\n<3303> <3303> 8338\n<3304> <3304> 11960\n<3305> <3305> 8333\n<3306> <3306> 11961\n<3307> <3307> 11965\n<3308> <3308> 11963\n<3309> <3309> 11968\n<330a> <330a> 11966\n<330b> <330b> 11970\n<330c> <330c> 11972\n<330d> <330d> 7950\n<330e> <3313> 11973\n<3314> <3314> 7941\n<3315> <3315> 8340\n<3316> <3316> 8330\n<3317> <3317> 11980\n<3318> <3318> 8339\n<3319> <3319> 11982\n<331a> <331d> 11984\n<331e> <331e> 8353\n<331f> <3321> 11988\n<3322> <3322> 8329\n<3323> <3323> 8348\n<3324> <3324> 11991\n<3325> <3325> 11993\n<3326> <3326> 7951\n<3327> <3327> 7945\n<3328> <3329> 11996\n<332a> <332a> 8356\n<332b> <332b> 7953\n<332d> <332d> 11999\n<332e> <3330> 12002\n<3331> <3331> 8358\n<3332> <3332> 12005\n<3333> <3333> 8334\n<3334> <3335> 12008\n<3336> <3336> 7947\n<3337> <3337> 12014\n<3338> <3338> 12016\n<3339> <3339> 8343\n<333a> <333a> 12017\n<333b> <333b> 8349\n<333c> <333c> 12010\n<333d> <333d> 12018\n<333e> <3340> 12020\n<3341> <3341> 12019\n<3342> <3342> 8347\n<3343> <3346> 12023\n<3347> <3347> 8357\n<3348> <3348> 12027\n<3349> <3349> 7940\n<334a> <334a> 7954\n<334b> <334c> 12028\n<334d> <334d> 7943\n<334e> <334e> 8337\n<334f> <3350> 12030\n<3351> <3351> 7948\n<3352> <3352> 12034\n<3353> <3353> 12038\n<3354> <3354> 12035\n<3355> <3356> 12039\n<3357> <3357> 8344\n<337f> <337f> 8324\n<ff08> <ff09> 7899\n<ff0c> <ff0c> 8268\n<ff0e> <ff0e> 8274\n<ff1d> <ff1d> 7917\n<ff3b> <ff3b> 7903\n<ff3d> <ff3d> 7904\n<ff3f> <ff3f> 7890\n<ff5b> <ff5b> 7905\n<ff5c> <ff5c> 7896\n<ff5d> <ff5d> 7906\n<ff5e> <ff5e> 7894\n<ffe3> <ffe3> 7889\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJIS-UCS2-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniJIS-UCS2-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniJIS-UCS2-H)\n%%BeginResource: CMap (UniJIS-UCS2-V)\n%%Title: (UniJIS-UCS2-V Adobe Japan1 4)\n%%Version: 12.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniJIS-UCS2-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 4 def\nend def\n\n/CMapName /UniJIS-UCS2-V def\n/CMapVersion 12.003 def\n/CMapType 1 def\n\n/XUID [1 10 25357] def\n\n/WMode 1 def\n\n100 begincidrange\n<00b0> <00b0> 8269\n<2010> <2010> 7893\n<2015> <2015> 7892\n<2016> <2016> 7895\n<2018> <2019> 8281\n<201c> <201d> 8279\n<2025> <2025> 7898\n<2026> <2026> 7897\n<2032> <2032> 8273\n<2033> <2033> 8283\n<2190> <2190> 738\n<2191> <2191> 736\n<2192> <2192> 739\n<2193> <2193> 737\n<2195> <2195> 12214\n<21c4> <21c4> 8311\n<21c5> <21c5> 8310\n<21c6> <21c6> 8312\n<21e6> <21e6> 8012\n<21e7> <21e7> 8014\n<21e8> <21e8> 8011\n<21e9> <21e9> 8013\n<2225> <2225> 7895\n<223c> <223c> 7894\n<22ef> <22ef> 7897\n<2500> <2501> 7481\n<2502> <2503> 7479\n<2504> <2505> 7485\n<2506> <2507> 7483\n<2508> <2509> 7489\n<250a> <250b> 7487\n<250c> <250c> 7495\n<250d> <250d> 7497\n<250e> <250e> 7496\n<250f> <250f> 7498\n<2510> <2510> 7503\n<2511> <2511> 7505\n<2512> <2512> 7504\n<2513> <2513> 7506\n<2514> <2514> 7491\n<2515> <2515> 7493\n<2516> <2516> 7492\n<2517> <2517> 7494\n<2518> <2518> 7499\n<2519> <2519> 7501\n<251a> <251a> 7500\n<251b> <251b> 7502\n<251c> <251c> 7523\n<251d> <251d> 7527\n<251e> <251e> 7525\n<251f> <251f> 7524\n<2520> <2520> 7526\n<2521> <2521> 7529\n<2522> <2522> 7528\n<2523> <2524> 7530\n<2525> <2525> 7535\n<2526> <2526> 7533\n<2527> <2527> 7532\n<2528> <2528> 7534\n<2529> <2529> 7537\n<252a> <252a> 7536\n<252b> <252b> 7538\n<252c> <252c> 7515\n<252d> <252f> 7517\n<2530> <2530> 7516\n<2531> <2533> 7520\n<2534> <2534> 7507\n<2535> <2537> 7509\n<2538> <2538> 7508\n<2539> <253b> 7512\n<253d> <253f> 7543\n<2540> <2540> 7541\n<2541> <2541> 7540\n<2542> <2542> 7542\n<2543> <2543> 7547\n<2544> <2544> 7549\n<2545> <2545> 7546\n<2546> <2546> 7548\n<2547> <2547> 7553\n<2548> <2548> 7552\n<2549> <254a> 7550\n<261c> <261c> 8221\n<261d> <261d> 8219\n<261e> <261e> 8222\n<261f> <261f> 8220\n<2702> <2702> 12178\n<27a1> <27a1> 8209\n<3001> <3002> 7887\n<3008> <3011> 7907\n<3013> <3013> 8270\n<3014> <3015> 7901\n<301c> <301c> 7894\n<301d> <301d> 7956\n<301f> <301f> 7957\n<3041> <3041> 7918\n<3043> <3043> 7919\n<3045> <3045> 7920\n<3047> <3047> 7921\n<3049> <3049> 7922\n<3063> <3063> 7923\nendcidrange\n\n95 begincidrange\n<3083> <3083> 7924\n<3085> <3085> 7925\n<3087> <3087> 7926\n<308e> <308e> 7927\n<309b> <309b> 8272\n<309c> <309c> 8271\n<30a1> <30a1> 7928\n<30a3> <30a3> 7929\n<30a5> <30a5> 7930\n<30a7> <30a7> 7931\n<30a9> <30a9> 7932\n<30c3> <30c3> 7933\n<30e3> <30e3> 7934\n<30e5> <30e5> 7935\n<30e7> <30e7> 7936\n<30ee> <30ee> 7937\n<30f5> <30f6> 7938\n<30fc> <30fc> 7891\n<3300> <3300> 8350\n<3301> <3302> 11958\n<3303> <3303> 8338\n<3304> <3304> 11960\n<3305> <3305> 8333\n<3306> <3306> 11961\n<3307> <3307> 11965\n<3308> <3308> 11963\n<3309> <3309> 11968\n<330a> <330a> 11966\n<330b> <330b> 11970\n<330c> <330c> 11972\n<330d> <330d> 7950\n<330e> <3313> 11973\n<3314> <3314> 7941\n<3315> <3315> 8340\n<3316> <3316> 8330\n<3317> <3317> 11980\n<3318> <3318> 8339\n<3319> <3319> 11982\n<331a> <331d> 11984\n<331e> <331e> 8353\n<331f> <3321> 11988\n<3322> <3322> 8329\n<3323> <3323> 8348\n<3324> <3324> 11991\n<3325> <3325> 11993\n<3326> <3326> 7951\n<3327> <3327> 7945\n<3328> <3329> 11996\n<332a> <332a> 8356\n<332b> <332b> 7953\n<332d> <332d> 11999\n<332e> <3330> 12002\n<3331> <3331> 8358\n<3332> <3332> 12005\n<3333> <3333> 8334\n<3334> <3335> 12008\n<3336> <3336> 7947\n<3337> <3337> 12014\n<3338> <3338> 12016\n<3339> <3339> 8343\n<333a> <333a> 12017\n<333b> <333b> 8349\n<333c> <333c> 12010\n<333d> <333d> 12018\n<333e> <3340> 12020\n<3341> <3341> 12019\n<3342> <3342> 8347\n<3343> <3346> 12023\n<3347> <3347> 8357\n<3348> <3348> 12027\n<3349> <3349> 7940\n<334a> <334a> 7954\n<334b> <334c> 12028\n<334d> <334d> 7943\n<334e> <334e> 8337\n<334f> <3350> 12030\n<3351> <3351> 7948\n<3352> <3352> 12034\n<3353> <3353> 12038\n<3354> <3354> 12035\n<3355> <3356> 12039\n<3357> <3357> 8344\n<337f> <337f> 8324\n<ff08> <ff09> 7899\n<ff0c> <ff0c> 8268\n<ff0e> <ff0e> 8274\n<ff1d> <ff1d> 7917\n<ff3b> <ff3b> 7903\n<ff3d> <ff3d> 7904\n<ff3f> <ff3f> 7890\n<ff5b> <ff5b> 7905\n<ff5c> <ff5c> 7896\n<ff5d> <ff5d> 7906\n<ff5e> <ff5e> 7894\n<ffe3> <ffe3> 7889\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJIS-UTF16-H",
    "content": "begincmap\n/CMapName /UniJIS-UTF16-H def\n/WMode 0 def\n/UniJIS-X16 usecmap\nbegincodespacerange\n<0000><d7ff>\n<d800dc00><dbffdfff>\n<e000><ffff>\nendcodespacerange\nbegincidchar\n<2f5b>1383\n<5026>1863\n<50c5>1735\n<5132>3813\n<514e>3136\n<51a4>4228\n<537f>1698\n<53a9>1243\n<53c9>2085\n<53db>3412\n<53df>4332\n<54ac>4368\n<54e8>2445\n<55b0>1772\n<5632>4433\n<5642>1247\n<564c>2747\n<56c0>4454\n<5835>3138\n<5906>17469\n<5a29>3626\n<5c51>1781\n<5c60>3141\n<5df7>1981\n<5e96>3657\n<5edf>3506\n<5efb>1398\n<5f98>4796\n<5fbd>1605\n<6062>1402\n<609e>14541\n<6108>3848\n<6241>4943\n<633a>3086\n<633d>3432\n<6357>3033\n<6372>1876\n<63c3>2839\n<646f>5020\n<647a>2630\n<64b0>2709\n<64e2>3105\n<65a7>3538\n<6666>1408\n<66b5>17755\n<6753>2313\n<6756>2523\n<6897>1998\n<6962>3266\n<696f>2407\n<698a>2135\n<6994>4055\n<69cc>3044\n<6a0b>3465\n<6a3d>2924\n<6adb>1779\n<6b4e>2933\n<6c72>1660\n<6deb>1216\n<6ea2>1202\n<6eba>3112\n<6f23>4034\n<7015>3520\n<701e>3244\n<7026>2995\n<7058>3263\n<7078>1662\n<707c>2314\n<7149>4035\n<714e>2717\n<7152>14762\n<717d>2718\n<723a>3832\n<724c>3341\n<7259>1383\n<72e1>5629\n<7337>3868\n<7511>2059\n<7515>5704\n<7526>5707\n<75bc>5741\n<77a5>3613\n<7941>1805\n<7947>1626\n<79b0>3295\n<79e4>3359\n<7a17>3477\n<7a7f>2720\n<7ac8>5937\n<7b08>1666\n<7b75>5976\n<7bad>2721\n<7bb8>3384\n<7bc7>3619\n<7bdd>6001\n<7c3e>4036\n<7c7e>3822\n<7c82>1791\n<7feb>1569\n<7ff0>1545\n<8171>6258\n<817f>2876\n<8258>6310\n<8292>6325\n<82a6>1142\n<8328>1205\n<845b>1481\n<84ec>3671\n<8511>3614\n<853d>3603\n<85a9>2165\n<85af>2428\n<85f7>2429\n<8654>6481\n<86f8>2909\n<8703>6510\n<8755>2544\n<8805>6537\n<8956>1320\n<8a0a>2588\n<8a1d>6662\n<8a3b>2990\n<8a6e>2729\n<8ab9>3460\n<8afa>1909\n<8b0e>3262\n<8b2c>3495\n<8b7f>8625\n<8c79>3505\n<8ced>3148\n<8fbb>3056\n<8fbf>2919\n<8fc2>1228\n<8fc4>3750\n<8fe6>1376\n<9017>2598\n<9019>3357\n<9022>1133\n<903c>3489\n<9041>3251\n<905c>2845\n<9061>2766\n<912d>3100\n<914b>2368\n<91dc>1494\n<9306>2170\n<9375>1892\n<939a>3046\n<9453>3846\n<9699>1850\n<9771>7152\n<9784>1489\n<9798>2508\n<97ad>3628\n<98f4>1151\n<9905>3819\n<990c>1252\n<9910>2191\n<9957>1722\n<99c1>3379\n<9a19>7248\n<9a4a>15319\n<9bab>2171\n<9bd6>2168\n<9c2f>1207\n<9c52>3742\n<9d09>7362\n<9d60>2054\n<fa20>8612\n<fa40>13369\nendcidchar\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJIS-UTF16-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniJIS-UTF16-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniJIS-UTF16-H)\n%%BeginResource: CMap (UniJIS-UTF16-V)\n%%Title: (UniJIS-UTF16-V Adobe Japan1 6)\n%%Version: 1.004\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniJIS-UTF16-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 6 def\nend def\n\n/CMapName /UniJIS-UTF16-V def\n/CMapVersion 1.004 def\n/CMapType 1 def\n\n/XUID [1 10 25612] def\n\n/WMode 1 def\n\n100 begincidchar\n<00b0> 8269\n<2010> 7893\n<2015> 7892\n<2016> 7895\n<2025> 7898\n<2026> 7897\n<2032> 8273\n<2033> 8283\n<2190> 738\n<2191> 736\n<2192> 739\n<2193> 737\n<21c4> 8311\n<21c5> 8310\n<21c6> 8312\n<21e6> 8012\n<21e7> 8014\n<21e8> 8011\n<21e9> 8013\n<239b> 12148\n<239c> 12168\n<239d> 12147\n<239e> 12150\n<239f> 12168\n<23a0> 12149\n<23a1> 12156\n<23a2> 12168\n<23a3> 12155\n<23a4> 12158\n<23a5> 12168\n<23a6> 12157\n<23a7> 8168\n<23a8> 8167\n<23a9> 8166\n<23aa> 12168\n<23ab> 8172\n<23ac> 8171\n<23ad> 8170\n<250c> 7495\n<250d> 7497\n<250e> 7496\n<250f> 7498\n<2510> 7503\n<2511> 7505\n<2512> 7504\n<2513> 7506\n<2514> 7491\n<2515> 7493\n<2516> 7492\n<2517> 7494\n<2518> 7499\n<2519> 7501\n<251a> 7500\n<251b> 7502\n<251c> 7523\n<251d> 7527\n<251e> 7525\n<251f> 7524\n<2520> 7526\n<2521> 7529\n<2522> 7528\n<2525> 7535\n<2526> 7533\n<2527> 7532\n<2528> 7534\n<2529> 7537\n<252a> 7536\n<252b> 7538\n<252c> 7515\n<2530> 7516\n<2534> 7507\n<2538> 7508\n<2540> 7541\n<2541> 7540\n<2542> 7542\n<2543> 7547\n<2544> 7549\n<2545> 7546\n<2546> 7548\n<2547> 7553\n<2548> 7552\n<261c> 8221\n<261d> 8219\n<261e> 8222\n<261f> 8220\n<2702> 12178\n<27a1> 8209\n<301c> 7894\n<301d> 7956\n<301f> 7957\n<3041> 7918\n<3043> 7919\n<3045> 7920\n<3047> 7921\n<3049> 7922\n<3063> 7923\n<3083> 7924\n<3085> 7925\n<3087> 7926\n<308e> 7927\nendcidchar\n\n78 begincidchar\n<309b> 8272\n<309c> 8271\n<30a0> 16331\n<30a1> 7928\n<30a3> 7929\n<30a5> 7930\n<30a7> 7931\n<30a9> 7932\n<30c3> 7933\n<30e3> 7934\n<30e5> 7935\n<30e7> 7936\n<30ee> 7937\n<30fc> 7891\n<3300> 8350\n<3303> 8338\n<3304> 11960\n<3305> 8333\n<3306> 11961\n<3307> 11965\n<3308> 11963\n<3309> 11968\n<330a> 11966\n<330b> 11970\n<330c> 11972\n<330d> 7950\n<3314> 7941\n<3315> 8340\n<3316> 8330\n<3317> 11980\n<3318> 8339\n<3319> 11982\n<331e> 8353\n<3322> 8329\n<3323> 8348\n<3324> 11991\n<3325> 11993\n<3326> 7951\n<3327> 7945\n<332a> 8356\n<332b> 7953\n<332d> 11999\n<3331> 8358\n<3332> 12005\n<3333> 8334\n<3336> 7947\n<3337> 12014\n<3338> 12016\n<3339> 8343\n<333a> 12017\n<333b> 8349\n<333c> 12010\n<333d> 12018\n<3341> 12019\n<3342> 8347\n<3347> 8357\n<3348> 12027\n<3349> 7940\n<334a> 7954\n<334d> 7943\n<334e> 8337\n<3351> 7948\n<3352> 12034\n<3353> 12038\n<3354> 12035\n<3357> 8344\n<337f> 8324\n<ff0c> 8268\n<ff0e> 8274\n<ff1d> 7917\n<ff3b> 7903\n<ff3d> 7904\n<ff3f> 7890\n<ff5b> 7905\n<ff5c> 7896\n<ff5d> 7906\n<ff5e> 7894\n<ffe3> 7889\nendcidchar\n\n37 begincidrange\n<23b0> <23b1> 16350\n<2500> <2501> 7481\n<2502> <2503> 7479\n<2504> <2505> 7485\n<2506> <2507> 7483\n<2508> <2509> 7489\n<250a> <250b> 7487\n<2523> <2524> 7530\n<252d> <252f> 7517\n<2531> <2533> 7520\n<2535> <2537> 7509\n<2539> <253b> 7512\n<253d> <253f> 7543\n<2549> <254a> 7550\n<3001> <3002> 7887\n<3008> <3011> 7907\n<3014> <3015> 7901\n<3016> <3017> 16329\n<3018> <3019> 12139\n<3095> <3096> 8264\n<30f5> <30f6> 7938\n<31f0> <31f9> 16333\n<31fa> <31ff> 16344\n<3301> <3302> 11958\n<330e> <3313> 11973\n<331a> <331d> 11984\n<331f> <3321> 11988\n<3328> <3329> 11996\n<332e> <3330> 12002\n<3334> <3335> 12008\n<333e> <3340> 12020\n<3343> <3346> 12023\n<334b> <334c> 12028\n<334f> <3350> 12030\n<3355> <3356> 12039\n<ff08> <ff09> 7899\n<ff5f> <ff60> 12141\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJIS-UTF32-H",
    "content": "begincmap\n/CMapName /UniJIS-UTF32-H def\n/WMode 0 def\n/UniJIS-X32 usecmap\nbegincodespacerange\n<00000000><0010ffff>\nendcodespacerange\nbegincidchar\n<a7>720\n<a8>647\n<b0>707\n<b1>694\n<b4>645\n<b6>778\n<d7>695\n<f7>696\n<2010>662\n<2012>114\n<210f>12092\n<2135>12089\n<2194>12201\n<21d2>752\n<21d4>753\n<2200>754\n<2202>759\n<2203>755\n<2205>12184\n<2207>760\n<2208>741\n<220a>12091\n<220b>742\n<2211>7625\n<2212>693\n<2213>12118\n<221a>765\n<221d>767\n<221e>703\n<221f>7629\n<2220>756\n<2229>748\n<222a>747\n<222d>8195\n<222e>7624\n<2234>704\n<2235>768\n<223d>766\n<2243>12120\n<2252>762\n<2260>698\n<2261>761\n<2295>12188\n<2296>12186\n<2297>12189\n<2298>12187\n<22a0>12185\n<22a5>757\n<22bf>7630\n<2f5b>1383\n<5026>1863\n<50c5>1735\n<5132>3813\n<514e>3136\n<51a4>4228\n<537f>1698\n<53a9>1243\n<53c9>2085\n<53db>3412\n<53df>4332\n<54ac>4368\n<54e8>2445\n<55b0>1772\n<5632>4433\n<5642>1247\n<564c>2747\n<56c0>4454\n<5835>3138\n<5906>17469\n<5a29>3626\n<5c51>1781\n<5c60>3141\n<5df7>1981\n<5e96>3657\n<5edf>3506\n<5efb>1398\n<5f98>4796\n<5fbd>1605\n<6062>1402\n<609e>14541\n<6108>3848\n<6241>4943\n<633a>3086\n<633d>3432\n<6357>3033\n<6372>1876\n<63c3>2839\n<646f>5020\n<647a>2630\n<64b0>2709\n<64e2>3105\n<65a7>3538\n<6666>1408\n<66b5>17755\n<6753>2313\n<6756>2523\n<6897>1998\n<6962>3266\n<696f>2407\n<698a>2135\n<6994>4055\n<69cc>3044\n<6a0b>3465\n<6a3d>2924\n<6adb>1779\n<6b4e>2933\n<6c72>1660\n<6deb>1216\n<6ea2>1202\n<6eba>3112\n<6f23>4034\n<7015>3520\n<701e>3244\n<7026>2995\n<7058>3263\n<7078>1662\n<707c>2314\n<7149>4035\n<714e>2717\n<7152>14762\n<717d>2718\n<723a>3832\n<724c>3341\n<7259>1383\n<72e1>5629\n<7337>3868\n<7511>2059\n<7515>5704\n<7526>5707\n<75bc>5741\n<77a5>3613\n<7941>1805\n<7947>1626\n<79b0>3295\n<79e4>3359\n<7a17>3477\n<7a7f>2720\n<7ac8>5937\n<7b08>1666\n<7b75>5976\n<7bad>2721\n<7bb8>3384\n<7bc7>3619\n<7bdd>6001\n<7c3e>4036\n<7c7e>3822\n<7c82>1791\n<7feb>1569\n<7ff0>1545\n<8171>6258\n<817f>2876\n<8258>6310\n<8292>6325\n<82a6>1142\n<8328>1205\n<845b>1481\n<84ec>3671\n<8511>3614\n<853d>3603\n<85a9>2165\n<85af>2428\n<85f7>2429\n<8654>6481\n<86f8>2909\n<8703>6510\n<8755>2544\n<8805>6537\n<8956>1320\n<8a0a>2588\n<8a1d>6662\n<8a3b>2990\n<8a6e>2729\n<8ab9>3460\n<8afa>1909\n<8b0e>3262\n<8b2c>3495\n<8b7f>8625\n<8c79>3505\n<8ced>3148\n<8fbb>3056\n<8fbf>2919\n<8fc2>1228\n<8fc4>3750\n<8fe6>1376\n<9017>2598\n<9019>3357\n<9022>1133\n<903c>3489\n<9041>3251\n<905c>2845\n<9061>2766\n<912d>3100\n<914b>2368\n<91dc>1494\n<9306>2170\n<9375>1892\n<939a>3046\n<9453>3846\n<9699>1850\n<9771>7152\n<9784>1489\n<9798>2508\n<97ad>3628\n<98f4>1151\n<9905>3819\n<990c>1252\n<9910>2191\n<9957>1722\n<99c1>3379\n<9a19>7248\n<9a4a>15319\n<9bab>2171\n<9bd6>2168\n<9c2f>1207\n<9c52>3742\n<9d09>7362\n<9d60>2054\n<fa20>8612\n<fa40>13369\nendcidchar\nbegincidrange\n<2032><2033>708\n<2227><2228>749\n<222b><222c>769\n<2266><2267>701\n<226a><226b>763\n<2272><2273>12121\n<2282><2283>745\n<2286><2287>743\nendcidrange\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJIS-UTF32-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniJIS-UTF32-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniJIS-UTF32-H)\n%%BeginResource: CMap (UniJIS-UTF32-V)\n%%Title: (UniJIS-UTF32-V Adobe Japan1 6)\n%%Version: 1.004\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution.\n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission.\n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniJIS-UTF32-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 6 def\nend def\n\n/CMapName /UniJIS-UTF32-V def\n/CMapVersion 1.004 def\n/CMapType 1 def\n\n/XUID [1 10 25610] def\n\n/WMode 1 def\n\n100 begincidchar\n<000000b0> 8269\n<00002010> 7893\n<00002015> 7892\n<00002016> 7895\n<00002025> 7898\n<00002026> 7897\n<00002032> 8273\n<00002033> 8283\n<00002190> 738\n<00002191> 736\n<00002192> 739\n<00002193> 737\n<000021c4> 8311\n<000021c5> 8310\n<000021c6> 8312\n<000021e6> 8012\n<000021e7> 8014\n<000021e8> 8011\n<000021e9> 8013\n<0000239b> 12148\n<0000239c> 12168\n<0000239d> 12147\n<0000239e> 12150\n<0000239f> 12168\n<000023a0> 12149\n<000023a1> 12156\n<000023a2> 12168\n<000023a3> 12155\n<000023a4> 12158\n<000023a5> 12168\n<000023a6> 12157\n<000023a7> 8168\n<000023a8> 8167\n<000023a9> 8166\n<000023aa> 12168\n<000023ab> 8172\n<000023ac> 8171\n<000023ad> 8170\n<0000250c> 7495\n<0000250d> 7497\n<0000250e> 7496\n<0000250f> 7498\n<00002510> 7503\n<00002511> 7505\n<00002512> 7504\n<00002513> 7506\n<00002514> 7491\n<00002515> 7493\n<00002516> 7492\n<00002517> 7494\n<00002518> 7499\n<00002519> 7501\n<0000251a> 7500\n<0000251b> 7502\n<0000251c> 7523\n<0000251d> 7527\n<0000251e> 7525\n<0000251f> 7524\n<00002520> 7526\n<00002521> 7529\n<00002522> 7528\n<00002525> 7535\n<00002526> 7533\n<00002527> 7532\n<00002528> 7534\n<00002529> 7537\n<0000252a> 7536\n<0000252b> 7538\n<0000252c> 7515\n<00002530> 7516\n<00002534> 7507\n<00002538> 7508\n<00002540> 7541\n<00002541> 7540\n<00002542> 7542\n<00002543> 7547\n<00002544> 7549\n<00002545> 7546\n<00002546> 7548\n<00002547> 7553\n<00002548> 7552\n<0000261c> 8221\n<0000261d> 8219\n<0000261e> 8222\n<0000261f> 8220\n<00002702> 12178\n<000027a1> 8209\n<0000301c> 7894\n<0000301d> 7956\n<0000301f> 7957\n<00003041> 7918\n<00003043> 7919\n<00003045> 7920\n<00003047> 7921\n<00003049> 7922\n<00003063> 7923\n<00003083> 7924\n<00003085> 7925\n<00003087> 7926\n<0000308e> 7927\nendcidchar\n\n78 begincidchar\n<0000309b> 8272\n<0000309c> 8271\n<000030a0> 16331\n<000030a1> 7928\n<000030a3> 7929\n<000030a5> 7930\n<000030a7> 7931\n<000030a9> 7932\n<000030c3> 7933\n<000030e3> 7934\n<000030e5> 7935\n<000030e7> 7936\n<000030ee> 7937\n<000030fc> 7891\n<00003300> 8350\n<00003303> 8338\n<00003304> 11960\n<00003305> 8333\n<00003306> 11961\n<00003307> 11965\n<00003308> 11963\n<00003309> 11968\n<0000330a> 11966\n<0000330b> 11970\n<0000330c> 11972\n<0000330d> 7950\n<00003314> 7941\n<00003315> 8340\n<00003316> 8330\n<00003317> 11980\n<00003318> 8339\n<00003319> 11982\n<0000331e> 8353\n<00003322> 8329\n<00003323> 8348\n<00003324> 11991\n<00003325> 11993\n<00003326> 7951\n<00003327> 7945\n<0000332a> 8356\n<0000332b> 7953\n<0000332d> 11999\n<00003331> 8358\n<00003332> 12005\n<00003333> 8334\n<00003336> 7947\n<00003337> 12014\n<00003338> 12016\n<00003339> 8343\n<0000333a> 12017\n<0000333b> 8349\n<0000333c> 12010\n<0000333d> 12018\n<00003341> 12019\n<00003342> 8347\n<00003347> 8357\n<00003348> 12027\n<00003349> 7940\n<0000334a> 7954\n<0000334d> 7943\n<0000334e> 8337\n<00003351> 7948\n<00003352> 12034\n<00003353> 12038\n<00003354> 12035\n<00003357> 8344\n<0000337f> 8324\n<0000ff0c> 8268\n<0000ff0e> 8274\n<0000ff1d> 7917\n<0000ff3b> 7903\n<0000ff3d> 7904\n<0000ff3f> 7890\n<0000ff5b> 7905\n<0000ff5c> 7896\n<0000ff5d> 7906\n<0000ff5e> 7894\n<0000ffe3> 7889\nendcidchar\n\n37 begincidrange\n<000023b0> <000023b1> 16350\n<00002500> <00002501> 7481\n<00002502> <00002503> 7479\n<00002504> <00002505> 7485\n<00002506> <00002507> 7483\n<00002508> <00002509> 7489\n<0000250a> <0000250b> 7487\n<00002523> <00002524> 7530\n<0000252d> <0000252f> 7517\n<00002531> <00002533> 7520\n<00002535> <00002537> 7509\n<00002539> <0000253b> 7512\n<0000253d> <0000253f> 7543\n<00002549> <0000254a> 7550\n<00003001> <00003002> 7887\n<00003008> <00003011> 7907\n<00003014> <00003015> 7901\n<00003016> <00003017> 16329\n<00003018> <00003019> 12139\n<00003095> <00003096> 8264\n<000030f5> <000030f6> 7938\n<000031f0> <000031f9> 16333\n<000031fa> <000031ff> 16344\n<00003301> <00003302> 11958\n<0000330e> <00003313> 11973\n<0000331a> <0000331d> 11984\n<0000331f> <00003321> 11988\n<00003328> <00003329> 11996\n<0000332e> <00003330> 12002\n<00003334> <00003335> 12008\n<0000333e> <00003340> 12020\n<00003343> <00003346> 12023\n<0000334b> <0000334c> 12028\n<0000334f> <00003350> 12030\n<00003355> <00003356> 12039\n<0000ff08> <0000ff09> 7899\n<0000ff5f> <0000ff60> 12141\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJIS-UTF8-H",
    "content": "begincmap\n/CMapName /UniJIS-UTF8-H def\n/WMode 0 def\n/UniJIS-X8 usecmap\nbegincodespacerange\n<00><7f>\n<c080><dfbf>\n<e08080><efbfbf>\n<f0808080><f7bfbfbf>\nendcodespacerange\nbegincidchar\n<e2bd9b>1383\n<e580a6>1863\n<e58385>1735\n<e584b2>3813\n<e5858e>3136\n<e586a4>4228\n<e58dbf>1698\n<e58ea9>1243\n<e58f89>2085\n<e58f9b>3412\n<e58f9f>4332\n<e592ac>4368\n<e593a8>2445\n<e596b0>1772\n<e598b2>4433\n<e59982>1247\n<e5998c>2747\n<e59b80>4454\n<e5a0b5>3138\n<e5a486>17469\n<e5a8a9>3626\n<e5b191>1781\n<e5b1a0>3141\n<e5b7b7>1981\n<e5ba96>3657\n<e5bb9f>3506\n<e5bbbb>1398\n<e5be98>4796\n<e5bebd>1605\n<e681a2>1402\n<e6829e>14541\n<e68488>3848\n<e68981>4943\n<e68cba>3086\n<e68cbd>3432\n<e68d97>3033\n<e68db2>1876\n<e68f83>2839\n<e691af>5020\n<e691ba>2630\n<e692b0>2709\n<e693a2>3105\n<e696a7>3538\n<e699a6>1408\n<e69ab5>17755\n<e69d93>2313\n<e69d96>2523\n<e6a297>1998\n<e6a5a2>3266\n<e6a5af>2407\n<e6a68a>2135\n<e6a694>4055\n<e6a78c>3044\n<e6a88b>3465\n<e6a8bd>2924\n<e6ab9b>1779\n<e6ad8e>2933\n<e6b1b2>1660\n<e6b7ab>1216\n<e6baa2>1202\n<e6baba>3112\n<e6bca3>4034\n<e78095>3520\n<e7809e>3244\n<e780a6>2995\n<e78198>3263\n<e781b8>1662\n<e781bc>2314\n<e78589>4035\n<e7858e>2717\n<e78592>14762\n<e785bd>2718\n<e788ba>3832\n<e7898c>3341\n<e78999>1383\n<e78ba1>5629\n<e78cb7>3868\n<e79491>2059\n<e79495>5704\n<e794a6>5707\n<e796bc>5741\n<e79ea5>3613\n<e7a581>1805\n<e7a587>1626\n<e7a6b0>3295\n<e7a7a4>3359\n<e7a897>3477\n<e7a9bf>2720\n<e7ab88>5937\n<e7ac88>1666\n<e7adb5>5976\n<e7aead>2721\n<e7aeb8>3384\n<e7af87>3619\n<e7af9d>6001\n<e7b0be>4036\n<e7b1be>3822\n<e7b282>1791\n<e7bfab>1569\n<e7bfb0>1545\n<e885b1>6258\n<e885bf>2876\n<e88998>6310\n<e88a92>6325\n<e88aa6>1142\n<e88ca8>1205\n<e8919b>1481\n<e893ac>3671\n<e89491>3614\n<e894bd>3603\n<e896a9>2165\n<e896af>2428\n<e897b7>2429\n<e89994>6481\n<e89bb8>2909\n<e89c83>6510\n<e89d95>2544\n<e8a085>6537\n<e8a596>1320\n<e8a88a>2588\n<e8a89d>6662\n<e8a8bb>2990\n<e8a9ae>2729\n<e8aab9>3460\n<e8abba>1909\n<e8ac8e>3262\n<e8acac>3495\n<e8adbf>8625\n<e8b1b9>3505\n<e8b3ad>3148\n<e8bebb>3056\n<e8bebf>2919\n<e8bf82>1228\n<e8bf84>3750\n<e8bfa6>1376\n<e98097>2598\n<e98099>3357\n<e980a2>1133\n<e980bc>3489\n<e98181>3251\n<e9819c>2845\n<e981a1>2766\n<e984ad>3100\n<e9858b>2368\n<e9879c>1494\n<e98c86>2170\n<e98db5>1892\n<e98e9a>3046\n<e99193>3846\n<e99a99>1850\n<e99db1>7152\n<e99e84>1489\n<e99e98>2508\n<e99ead>3628\n<e9a3b4>1151\n<e9a485>3819\n<e9a48c>1252\n<e9a490>2191\n<e9a597>1722\n<e9a781>3379\n<e9a899>7248\n<e9a98a>15319\n<e9aeab>2171\n<e9af96>2168\n<e9b0af>1207\n<e9b192>3742\n<e9b489>7362\n<e9b5a0>2054\n<efa8a0>8612\n<efa980>13369\nendcidchar\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJIS-UTF8-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniJIS-UTF8-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniJIS-UTF8-H)\n%%BeginResource: CMap (UniJIS-UTF8-V)\n%%Title: (UniJIS-UTF8-V Adobe Japan1 6)\n%%Version: 13.004\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution.\n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission.\n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniJIS-UTF8-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 6 def\nend def\n\n/CMapName /UniJIS-UTF8-V def\n/CMapVersion 13.004 def\n/CMapType 1 def\n\n/XUID [1 10 25440] def\n\n/WMode 1 def\n\n100 begincidchar\n<c2b0> 8269\n<e28090> 7893\n<e28095> 7892\n<e28096> 7895\n<e280a5> 7898\n<e280a6> 7897\n<e280b2> 8273\n<e280b3> 8283\n<e28690> 738\n<e28691> 736\n<e28692> 739\n<e28693> 737\n<e28784> 8311\n<e28785> 8310\n<e28786> 8312\n<e287a6> 8012\n<e287a7> 8014\n<e287a8> 8011\n<e287a9> 8013\n<e28e9b> 12148\n<e28e9c> 12168\n<e28e9d> 12147\n<e28e9e> 12150\n<e28e9f> 12168\n<e28ea0> 12149\n<e28ea1> 12156\n<e28ea2> 12168\n<e28ea3> 12155\n<e28ea4> 12158\n<e28ea5> 12168\n<e28ea6> 12157\n<e28ea7> 8168\n<e28ea8> 8167\n<e28ea9> 8166\n<e28eaa> 12168\n<e28eab> 8172\n<e28eac> 8171\n<e28ead> 8170\n<e2948c> 7495\n<e2948d> 7497\n<e2948e> 7496\n<e2948f> 7498\n<e29490> 7503\n<e29491> 7505\n<e29492> 7504\n<e29493> 7506\n<e29494> 7491\n<e29495> 7493\n<e29496> 7492\n<e29497> 7494\n<e29498> 7499\n<e29499> 7501\n<e2949a> 7500\n<e2949b> 7502\n<e2949c> 7523\n<e2949d> 7527\n<e2949e> 7525\n<e2949f> 7524\n<e294a0> 7526\n<e294a1> 7529\n<e294a2> 7528\n<e294a5> 7535\n<e294a6> 7533\n<e294a7> 7532\n<e294a8> 7534\n<e294a9> 7537\n<e294aa> 7536\n<e294ab> 7538\n<e294ac> 7515\n<e294b0> 7516\n<e294b4> 7507\n<e294b8> 7508\n<e29580> 7541\n<e29581> 7540\n<e29582> 7542\n<e29583> 7547\n<e29584> 7549\n<e29585> 7546\n<e29586> 7548\n<e29587> 7553\n<e29588> 7552\n<e2989c> 8221\n<e2989d> 8219\n<e2989e> 8222\n<e2989f> 8220\n<e29c82> 12178\n<e29ea1> 8209\n<e3809c> 7894\n<e3809d> 7956\n<e3809f> 7957\n<e38181> 7918\n<e38183> 7919\n<e38185> 7920\n<e38187> 7921\n<e38189> 7922\n<e381a3> 7923\n<e38283> 7924\n<e38285> 7925\n<e38287> 7926\n<e3828e> 7927\nendcidchar\n\n79 begincidchar\n<e3829b> 8272\n<e3829c> 8271\n<e382a0> 16331\n<e382a1> 7928\n<e382a3> 7929\n<e382a5> 7930\n<e382a7> 7931\n<e382a9> 7932\n<e38383> 7933\n<e383a3> 7934\n<e383a5> 7935\n<e383a7> 7936\n<e383ae> 7937\n<e383bc> 7891\n<e38c80> 8350\n<e38c83> 8338\n<e38c84> 11960\n<e38c85> 8333\n<e38c86> 11961\n<e38c87> 11965\n<e38c88> 11963\n<e38c89> 11968\n<e38c8a> 11966\n<e38c8b> 11970\n<e38c8c> 11972\n<e38c8d> 7950\n<e38c94> 7941\n<e38c95> 8340\n<e38c96> 8330\n<e38c97> 11980\n<e38c98> 8339\n<e38c99> 11982\n<e38c9e> 8353\n<e38ca2> 8329\n<e38ca3> 8348\n<e38ca4> 11991\n<e38ca5> 11993\n<e38ca6> 7951\n<e38ca7> 7945\n<e38caa> 8356\n<e38cab> 7953\n<e38cad> 11999\n<e38cb1> 8358\n<e38cb2> 12005\n<e38cb3> 8334\n<e38cb6> 7947\n<e38cb7> 12014\n<e38cb8> 12016\n<e38cb9> 8343\n<e38cba> 12017\n<e38cbb> 8349\n<e38cbc> 12010\n<e38cbd> 12018\n<e38d80> 12022\n<e38d81> 12019\n<e38d82> 8347\n<e38d87> 8357\n<e38d88> 12027\n<e38d89> 7940\n<e38d8a> 7954\n<e38d8d> 7943\n<e38d8e> 8337\n<e38d91> 7948\n<e38d92> 12034\n<e38d93> 12038\n<e38d94> 12035\n<e38d97> 8344\n<e38dbf> 8324\n<efbc8c> 8268\n<efbc8e> 8274\n<efbc9d> 7917\n<efbcbb> 7903\n<efbcbd> 7904\n<efbcbf> 7890\n<efbd9b> 7905\n<efbd9c> 7896\n<efbd9d> 7906\n<efbd9e> 7894\n<efbfa3> 7889\nendcidchar\n\n37 begincidrange\n<e28eb0> <e28eb1> 16350\n<e29480> <e29481> 7481\n<e29482> <e29483> 7479\n<e29484> <e29485> 7485\n<e29486> <e29487> 7483\n<e29488> <e29489> 7489\n<e2948a> <e2948b> 7487\n<e294a3> <e294a4> 7530\n<e294ad> <e294af> 7517\n<e294b1> <e294b3> 7520\n<e294b5> <e294b7> 7509\n<e294b9> <e294bb> 7512\n<e294bd> <e294bf> 7543\n<e29589> <e2958a> 7550\n<e38081> <e38082> 7887\n<e38088> <e38091> 7907\n<e38094> <e38095> 7901\n<e38096> <e38097> 16329\n<e38098> <e38099> 12139\n<e38295> <e38296> 8264\n<e383b5> <e383b6> 7938\n<e387b0> <e387b9> 16333\n<e387ba> <e387bf> 16344\n<e38c81> <e38c82> 11958\n<e38c8e> <e38c93> 11973\n<e38c9a> <e38c9d> 11984\n<e38c9f> <e38ca1> 11988\n<e38ca8> <e38ca9> 11996\n<e38cae> <e38cb0> 12002\n<e38cb4> <e38cb5> 12008\n<e38cbe> <e38cbf> 12020\n<e38d83> <e38d86> 12023\n<e38d8b> <e38d8c> 12028\n<e38d8f> <e38d90> 12030\n<e38d95> <e38d96> 12039\n<efbc88> <efbc89> 7899\n<efbd9f> <efbda0> 12141\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJIS-X",
    "content": "begincmap\n/CMapName /UniJIS-X def\n/WMode 0 def\nbegincidchar\n<5c>97\n<7d>94\n<a4>107\n<a5>61\n<a9>152\n<aa>140\n<ab>109\n<ac>153\n<ad>151\n<ae>154\n<af>129\n<b5>159\n<b7>117\n<b8>134\n<b9>160\n<ba>144\n<bb>123\n<bf>126\n<c6>139\n<d8>142\n<df>150\n<e6>145\n<f8>148\n<0100>9366\n<0101>9361\n<0112>9369\n<0113>9364\n<011a>9395\n<011b>9407\n<0128>9400\n<0129>9412\n<012a>9367\n<012b>9362\n<0131>146\n<0141>141\n<0142>147\n<014b>9436\n<014c>9370\n<014d>9365\n<0152>143\n<0153>149\n<0160>223\n<0161>227\n<0168>9405\n<0169>9417\n<016a>9368\n<016b>9363\n<016e>9404\n<016f>9416\n<0178>224\n<017d>225\n<017e>229\n<01cd>9394\n<01ce>9406\n<01cf>9398\n<01d0>9410\n<01d1>9401\n<01d2>9413\n<01d3>9403\n<01d4>9415\n<01fd>9421\n<0251>9418\n<0254>9423\n<0259>9426\n<025a>9429\n<025b>9432\n<0275>9437\n<0283>9442\n<028c>9438\n<0292>9441\n<02d0>9443\n<0300>65\n<0303>95\n<0304>129\n<0305>226\n<030a>133\n<030b>135\n<030c>137\n<0327>134\n<0328>136\n<0332>64\n<0336>138\n<03d0>12090\n<03d1>12096\n<03db>12095\n<0401>1065\n<0451>1098\n<1ebc>9397\n<1ebd>9409\n<2002>231\n<2003>633\n<2011>14\n<2013>114\n<2014>138\n<2015>661\n<2016>666\n<201a>120\n<201e>121\n<2022>119\n<2025>669\n<2026>668\n<2030>772\n<203b>734\n<203c>12111\n<2044>104\n<2049>12112\n<2070>9377\n<20ac>9354\n<2100>11855\n<2103>710\n<2105>11859\n<2109>8305\n<210a>8304\n<2113>8025\n<2116>7610\n<2121>8055\n<2122>228\n<2126>9355\n<212b>771\n<217f>8303\n<2192>736\n<2193>739\n<21c6>8309\n<21cc>12206\n<21d0>12200\n<21e6>8013\n<21e7>8012\n<21e8>8014\n<21e9>8011\n<2307>12219\n<2312>758\n<24ea>8224\n<2550>8251\n<255e>8252\n<2561>8254\n<256a>8253\n<256f>8250\n<2570>8249\n<2589>8244\n<258a>8243\n<258b>8242\n<258c>8241\n<258d>8240\n<258e>8239\n<258f>8238\n<25a0>729\n<25a1>728\n<25a2>8015\n<25aa>12239\n<25ab>12237\n<25b2>731\n<25b3>730\n<25b6>12195\n<25b7>8010\n<25bc>733\n<25bd>732\n<25c0>12194\n<25c1>8009\n<25c6>727\n<25c7>726\n<25c9>8210\n<25cb>723\n<25cc>10502\n<25ce>725\n<25cf>724\n<25e4>8258\n<25e5>8257\n<25e6>12254\n<25ef>779\n<2605>722\n<2606>721\n<260e>8056\n<261e>8219\n<261f>8222\n<2640>706\n<2642>705\n<2660>8211\n<2661>8017\n<2662>8019\n<2663>8213\n<2664>8018\n<2665>8212\n<2666>8214\n<2667>8016\n<266a>775\n<266c>12100\n<266d>774\n<266f>773\n<2702>12176\n<271a>12241\n<2756>12259\n<27a1>8206\n<2e83>14305\n<2e85>13856\n<2e87>14105\n<2e89>14356\n<2e8b>14110\n<2e8e>4209\n<2e8f>14476\n<2e90>4646\n<2e92>3762\n<2e93>4739\n<2e94>4779\n<2e95>15391\n<2e96>14530\n<2e97>13852\n<2e98>14561\n<2e99>5059\n<2e9b>5089\n<2e9f>3644\n<2ea0>3773\n<2ea3>14749\n<2ea4>15398\n<2ea6>14157\n<2ea8>14780\n<2ea9>13729\n<2eaa>13995\n<2eab>14999\n<2ead>14905\n<2eae>13922\n<2eb1>15000\n<2eb2>14999\n<2eb3>14189\n<2eb7>14078\n<2eb9>14099\n<2ebc>13747\n<2ebd>13646\n<2ec1>1931\n<2ec2>15114\n<2ec3>13870\n<2ec4>2658\n<2ec6>13682\n<2eca>13898\n<2ecc>15403\n<2ecd>15184\n<2ecf>15262\n<2ed1>3029\n<2ed2>15255\n<2ed6>15262\n<2ed7>13645\n<2ed8>2664\n<2edd>13847\n<2ede>13849\n<2edf>13848\n<2ee4>1614\n<2ee8>3380\n<2ee9>1323\n<2eeb>2666\n<2eed>2243\n<2eef>3965\n<2ef2>1615\n<2f00>1200\n<2f01>8371\n<2f02>4095\n<2f03>4097\n<2f04>1333\n<2f05>4102\n<2f06>3275\n<2f07>4110\n<2f08>2579\n<2f09>4208\n<2f0a>3286\n<2f0b>3392\n<2f0c>4219\n<2f0d>4227\n<2f0e>4233\n<2f0f>4243\n<2f10>4248\n<2f11>3163\n<2f12>3991\n<2f13>4294\n<2f16>4307\n<2f17>2375\n<2f18>3708\n<2f19>4316\n<2f1a>4321\n<2f1b>4328\n<2f1c>3746\n<2f1d>1969\n<2f1e>4459\n<2f1f>3156\n<2f20>2204\n<2f23>3878\n<2f24>2887\n<2f25>2433\n<2f26>2208\n<2f27>4622\n<2f28>2631\n<2f29>2454\n<2f2a>4646\n<2f2b>4648\n<2f2c>4658\n<2f2d>2177\n<2f2e>4716\n<2f2f>1979\n<2f30>1918\n<2f31>1738\n<2f32>1519\n<2f33>4739\n<2f34>4741\n<2f35>4761\n<2f36>4763\n<2f37>4768\n<2f38>1655\n<2f39>14521\n<2f3a>4783\n<2f3b>4785\n<2f3c>2554\n<2f3d>4930\n<2f3e>1921\n<2f3f>2326\n<2f40>2215\n<2f41>5058\n<2f42>3592\n<2f43>3143\n<2f44>1740\n<2f45>3661\n<2f46>5088\n<2f47>3284\n<2f48>5132\n<2f49>1860\n<2f4a>3814\n<2f4b>1853\n<2f4c>2221\n<2f4d>5349\n<2f4e>5364\n<2f4f>5368\n<2f50>3450\n<2f51>3807\n<2f52>2223\n<2f53>5378\n<2f54>2603\n<2f55>1360\n<2f56>3066\n<2f57>3541\n<2f58>5604\n<2f59>5606\n<2f5a>3618\n<2f5c>1671\n<2f5d>1880\n<2f5e>1904\n<2f5f>1732\n<2f60>1245\n<2f61>1504\n<2f62>1537\n<2f63>2652\n<2f64>3899\n<2f65>3134\n<2f66>3479\n<2f67>14848\n<2f68>5783\n<2f69>3368\n<2f6a>3453\n<2f6b>2172\n<2f6c>3816\n<2f6d>3779\n<2f6e>3836\n<2f6f>2676\n<2f70>2260\n<2f71>14913\n<2f72>1363\n<2f73>1856\n<2f74>3953\n<2f75>2971\n<2f76>3606\n<2f77>2227\n<2f78>1544\n<2f79>6163\n<2f7a>3901\n<2f7b>1227\n<2f7c>4061\n<2f7d>2261\n<2f7e>6205\n<2f7f>2262\n<2f80>6227\n<2f81>3281\n<2f82>2569\n<2f83>2263\n<2f84>2232\n<2f85>1235\n<2f86>2697\n<2f87>2726\n<2f88>2360\n<2f89>2081\n<2f8a>2541\n<2f8b>6322\n<2f8c>6479\n<2f8d>2988\n<2f8e>1858\n<2f8f>2022\n<2f90>1189\n<2f91>6635\n<2f92>1887\n<2f93>1455\n<2f94>1908\n<2f95>2921\n<2f96>3198\n<2f97>6742\n<2f98>6745\n<2f99>1419\n<2f9a>2682\n<2f9b>2808\n<2f9c>2829\n<2f9d>2574\n<2f9e>2306\n<2f9f>2575\n<2fa0>2914\n<2fa1>15183\n<2fa2>3874\n<2fa3>3243\n<2fa4>3428\n<2fa5>3948\n<2fa6>1754\n<2fa7>3029\n<2fa8>3827\n<2fa9>3550\n<2faa>7113\n<2fab>7115\n<2fac>1229\n<2fad>8695\n<2fae>3463\n<2faf>3800\n<2fb0>1461\n<2fb1>7171\n<2fb2>7173\n<2fb3>1339\n<2fb4>3607\n<2fb5>3561\n<2fb6>3464\n<2fb7>2543\n<2fb8>2335\n<2fb9>2035\n<2fba>3333\n<2fbb>2062\n<2fbc>2036\n<2fbd>7276\n<2fbe>7293\n<2fc1>1614\n<2fc2>1685\n<2fc3>3031\n<2fc4>7414\n<2fc5>2267\n<2fc6>7425\n<2fc7>3729\n<2fc8>13323\n<2fc9>1642\n<2fca>2055\n<2fcb>7446\n<2fcc>7449\n<2fcd>3102\n<2fce>1937\n<2fcf>2767\n<2fd0>3475\n<2fd3>3966\n<3003>655\n<3004>8308\n<3012>735\n<3013>740\n<301c>665\n<301d>7608\n<301f>7609\n<3020>8058\n<3030>12218\n<3036>8057\n<3094>7958\n<30fb>638\n<30fc>660\n<3230>8197\n<3233>8143\n<3234>8141\n<3235>8148\n<3236>8147\n<3237>8204\n<3238>8142\n<3239>7620\n<323a>8151\n<323b>8149\n<323c>8144\n<323d>8139\n<323e>8146\n<323f>8140\n<3240>8150\n<3241>8205\n<3242>8145\n<3243>8138\n<3290>10471\n<3291>8161\n<3292>8160\n<3293>8162\n<3294>8156\n<3295>10495\n<3296>8165\n<3297>10492\n<3298>8158\n<3299>8223\n<329a>10489\n<329b>10488\n<329c>10494\n<329d>8319\n<329e>8191\n<329f>10479\n<32a2>10491\n<32a3>10490\n<32a9>8154\n<32aa>8157\n<32ab>8159\n<32ac>8163\n<32ad>8153\n<32ae>8164\n<32af>8155\n<32b0>8152\n<3300>8048\n<3303>8042\n<3304>11876\n<3305>8183\n<3306>11877\n<3307>11881\n<3308>11879\n<3309>11884\n<330a>11882\n<330b>11886\n<330c>11888\n<330d>7595\n<3314>7586\n<3315>8041\n<3316>8039\n<3317>11896\n<3318>8040\n<3319>11898\n<331e>8051\n<3322>8038\n<3323>8043\n<3324>11907\n<3325>11909\n<3326>7596\n<3327>7590\n<332a>8052\n<332b>7598\n<332d>11915\n<3331>8049\n<3332>11921\n<3333>8327\n<3336>7592\n<3337>11930\n<3338>11932\n<3339>8046\n<333a>11933\n<333b>8047\n<333c>11926\n<333d>11934\n<3341>11935\n<3342>8045\n<3347>8050\n<3348>11943\n<3349>7585\n<334a>7599\n<334d>7588\n<334e>8328\n<3351>7593\n<3352>11950\n<3353>11954\n<3354>11951\n<3357>8044\n<3371>11861\n<337b>8323\n<337c>7623\n<337d>7622\n<337e>7621\n<337f>8054\n<338d>11864\n<3390>8035\n<3396>8037\n<3397>8024\n<3398>8026\n<339b>11865\n<339f>8186\n<33a0>8020\n<33a1>7607\n<33a2>8021\n<33a3>8187\n<33a6>8188\n<33b0>8030\n<33b1>8029\n<33b2>8028\n<33b3>8027\n<33c2>11856\n<33c4>7606\n<33c8>8194\n<33cb>8034\n<33cc>8182\n<33cd>7611\n<33d4>8036\n<33da>11851\n<3402>13698\n<3405>15387\n<3427>13910\n<3488>15442\n<34db>15425\n<351f>13865\n<353e>14110\n<378d>13850\n<37e2>14123\n<3af3>15424\n<3b22>15433\n<3b88>13965\n<3e8a>15427\n<3eda>15432\n<3fb1>14164\n<4093>15436\n<4103>15439\n<4264>14176\n<4293>15440\n<440c>15426\n<4453>14195\n<457a>15435\n<4665>15438\n<46ae>15441\n<4be8>15430\n<4e00>1200\n<4e01>3000\n<4e03>2275\n<4e07>3754\n<4e08>2510\n<4e09>2174\n<4e0a>2509\n<4e0b>1340\n<4e0d>3526\n<4e0e>3881\n<4e10>4091\n<4e11>1233\n<4e14>1484\n<4e15>4092\n<4e16>2632\n<4e17>4311\n<4e18>1648\n<4e19>3594\n<4e1e>2511\n<4e1f>14298\n<4e21>3974\n<4e26>3602\n<4e28>8371\n<4e2a>4093\n<4e2b>14299\n<4e2c>14157\n<4e2d>2980\n<4e31>4094\n<4e32>1778\n<4e36>4095\n<4e37>13981\n<4e38>1561\n<4e39>2926\n<4e3b>2323\n<4e3c>4096\n<4e3f>4097\n<4e42>4098\n<4e43>3307\n<4e44>14304\n<4e45>1649\n<4e48>14126\n<4e4b>3309\n<4e4d>3259\n<4e4e>1911\n<4e4f>3681\n<4e55>6480\n<4e56>4099\n<4e57>2512\n<4e58>4100\n<4e59>1333\n<4e5a>14305\n<4e5d>1757\n<4e5e>1956\n<4e5f>3829\n<4e62>4659\n<4e71>3930\n<4e73>3285\n<4e7e>1505\n<4e7f>14306\n<4e80>1615\n<4e82>4101\n<4e85>4102\n<4e86>3971\n<4e88>3879\n<4e89>2794\n<4e8a>4104\n<4e8b>2244\n<4e8c>3275\n<4e8d>14307\n<4e8e>4107\n<4e91>1248\n<4e92>1939\n<4e94>1938\n<4e95>1194\n<4e96>14308\n<4e98>4081\n<4e99>4080\n<4e9b>2083\n<4e9c>1125\n<4ea1>3682\n<4ea2>4111\n<4ea4>1958\n<4ea5>1195\n<4ea6>3744\n<4ea8>1686\n<4ead>3070\n<4eae>3972\n<4eb0>4112\n<4eb3>4113\n<4eb6>4114\n<4eb9>14309\n<4eba>2579\n<4ebb>13856\n<4ec0>2372\n<4ec1>2580\n<4ec2>4119\n<4ec4>4117\n<4ec6>4118\n<4ec7>1650\n<4eca>2067\n<4ecb>1392\n<4ecd>4116\n<4ece>4115\n<4ecf>3577\n<4ed0>14310\n<4ed4>2196\n<4ed5>2195\n<4ed6>2846\n<4ed7>4120\n<4ed8>3527\n<4ed9>2699\n<4edd>656\n<4ede>4121\n<4edf>4123\n<4ee0>14311\n<4ee1>8372\n<4ee3>2885\n<4ee4>4009\n<4ee5>1166\n<4eed>4122\n<4eee>1342\n<4ef0>1724\n<4ef2>2981\n<4ef6>1861\n<4ef7>4124\n<4efb>3290\n<4efc>8373\n<4efd>14312\n<4eff>14313\n<4f00>8374\n<4f01>1575\n<4f03>8375\n<4f09>4125\n<4f0a>1167\n<4f0b>14314\n<4f0d>1940\n<4f0e>1576\n<4f0f>3564\n<4f10>3398\n<4f11>1651\n<4f15>14315\n<4f1a>1393\n<4f1c>4160\n<4f1d>3131\n<4f2f>3362\n<4f30>4127\n<4f34>3408\n<4f36>4010\n<4f38>2547\n<4f39>8376\n<4f3a>2197\n<4f3b>14317\n<4f3c>2245\n<4f3d>1344\n<4f43>3053\n<4f46>2912\n<4f47>4131\n<4f49>14318\n<4f4d>1168\n<4f4e>3071\n<4f4f>2373\n<4f50>2084\n<4f51>3854\n<4f53>2862\n<4f54>14319\n<4f55>1343\n<4f56>8377\n<4f57>4130\n<4f59>3880\n<4f5a>4126\n<4f5b>4128\n<4f5c>2142\n<4f5d>4129\n<4f5e>4563\n<4f60>14316\n<4f69>4137\n<4f6f>4140\n<4f70>4138\n<4f73>1346\n<4f75>3595\n<4f76>4132\n<4f7a>14320\n<4f7b>4136\n<4f7c>1959\n<4f7f>2198\n<4f83>1506\n<4f86>4141\n<4f88>4133\n<4f8a>8379\n<4f8b>4011\n<4f8d>2246\n<4f8f>4134\n<4f91>4139\n<4f92>8378\n<4f94>8381\n<4f96>4142\n<4f97>14323\n<4f98>4135\n<4f9a>8380\n<4f9b>1689\n<4f9d>1169\n<4fa0>1690\n<4fa1>1345\n<4fab>4564\n<4fad>3751\n<4fae>3552\n<4faf>1960\n<4fb5>2549\n<4fb6>3967\n<4fbe>14324\n<4fbf>3624\n<4fc2>1806\n<4fc3>2821\n<4fc4>1380\n<4fc9>8364\n<4fca>2397\n<4fcd>8382\n<4fce>4146\n<4fcf>14325\n<4fd0>4151\n<4fd1>4149\n<4fd3>15407\n<4fd4>4144\n<4fd7>2831\n<4fd8>4147\n<4fda>4150\n<4fdb>4148\n<4fdd>3629\n<4fdf>4145\n<4fe0>7660\n<4fe1>2548\n<4fe3>3745\n<4fee>2350\n<4fef>4166\n<4ff3>3334\n<4ff5>3496\n<4ff6>4161\n<4ff8>3648\n<4ffa>1334\n<4ffd>14326\n<4ffe>4165\n<4fff>8385\n<5005>4159\n<5006>4168\n<5009>2772\n<500b>1912\n<500d>3346\n<500f>5632\n<5010>14329\n<5011>4167\n<5012>3159\n<5014>4156\n<5016>1962\n<5019>1961\n<501a>4154\n<501b>14330\n<501e>8386\n<501f>2310\n<5021>4162\n<5022>8384\n<5023>3647\n<5024>2955\n<5025>4158\n<5027>14331\n<5028>4155\n<5029>4163\n<502a>4157\n<502b>3993\n<502c>4164\n<502d>4071\n<502e>14332\n<5036>1758\n<5039>1862\n<503b>14336\n<5040>8383\n<5042>8389\n<5043>4169\n<5046>8387\n<5047>4170\n<5048>4174\n<5049>1170\n<504f>3616\n<5050>4173\n<5055>4172\n<5056>4176\n<5057>14333\n<505a>4175\n<505c>3072\n<5065>1864\n<5066>14334\n<506a>14335\n<506c>4177\n<5070>8388\n<5072>2289\n<5074>2822\n<5075>3073\n<5076>1774\n<5078>4178\n<507d>1616\n<5080>4179\n<5085>4181\n<508d>3683\n<508f>14337\n<5091>1852\n<5094>8390\n<5096>14338\n<5098>2175\n<5099>3467\n<509a>4180\n<509c>14339\n<50ac>2101\n<50ad>3885\n<50b2>4183\n<50b3>4186\n<50b4>4182\n<50b5>2100\n<50b7>2439\n<50be>1807\n<50c2>4187\n<50cc>14340\n<50cd>3207\n<50cf>2814\n<50d1>1691\n<50d5>3707\n<50d6>4188\n<50d8>8392\n<50d9>15408\n<50da>3973\n<50de>4189\n<50e3>4192\n<50e5>4190\n<50e6>14341\n<50e7>2768\n<50e9>14342\n<50ed>4191\n<50ee>4193\n<50ef>14343\n<50f0>15409\n<50f4>8391\n<50f5>4195\n<50f9>4194\n<50fb>3608\n<5100>1617\n<5104>1327\n<5108>14344\n<5109>4196\n<510b>14345\n<5110>14346\n<5112>2336\n<5114>4201\n<5115>4200\n<5116>4199\n<5118>4143\n<511a>4202\n<511b>14347\n<511e>14348\n<511f>2440\n<5121>4203\n<512a>3855\n<5137>4205\n<513a>4204\n<513b>4207\n<513c>4206\n<5141>1208\n<5143>1897\n<5144>1809\n<5145>2374\n<5146>3001\n<5147>1692\n<5148>2700\n<5149>1963\n<514a>8393\n<514b>2048\n<514c>4211\n<514d>3796\n<5150>2247\n<5152>4210\n<5154>4212\n<515a>3160\n<515c>1491\n<515f>14349\n<5162>4213\n<5164>8394\n<5165>3286\n<5167>13966\n<5168>2742\n<516b>3392\n<516c>1964\n<516d>4065\n<516e>4217\n<5171>1694\n<5175>3596\n<5176>2838\n<5177>1769\n<5178>3119\n<5179>14201\n<517c>1865\n<5180>4218\n<5182>4219\n<5185>3258\n<5186>1281\n<5189>4222\n<518a>2157\n<518c>4221\n<518d>2102\n<518f>4223\n<5190>6235\n<5191>4224\n<5192>3695\n<5193>4225\n<5197>2513\n<5199>2296\n<519d>8395\n<51a0>1507\n<51a1>14350\n<51a2>4230\n<51a5>3785\n<51a6>4229\n<51a8>3532\n<51ac>3161\n<51b0>4237\n<51b3>4234\n<51b4>2131\n<51b5>4238\n<51b6>3830\n<51b7>4012\n<51bc>14351\n<51bd>4239\n<51be>8396\n<51c3>15410\n<51c4>2636\n<51c5>4240\n<51c6>2404\n<51c9>4241\n<51cb>3002\n<51cc>3975\n<51cd>3162\n<51d6>4314\n<51db>4242\n<51dc>8284\n<51dd>1725\n<51e0>4243\n<51e1>3724\n<51e6>2418\n<51e7>2908\n<51e9>4245\n<51ea>3260\n<51ec>8397\n<51ed>4246\n<51ee>14353\n<51f0>4247\n<51f1>1420\n<51f4>14354\n<51f5>4248\n<51f6>1695\n<51f8>3236\n<51f9>1308\n<51fa>2394\n<51fd>3381\n<51fe>4249\n<5200>3163\n<5203>2581\n<5204>4250\n<5206>3580\n<5207>2686\n<5208>1502\n<520a>1509\n<520b>4251\n<520e>4253\n<5211>1808\n<5213>14357\n<5214>4252\n<5215>8398\n<5217>4027\n<521d>2419\n<5224>3409\n<5225>3612\n<5227>4254\n<5229>3938\n<522a>4255\n<522e>4256\n<5230>3192\n<5233>4257\n<5236>2637\n<5237>2158\n<5238>1866\n<5239>4258\n<523a>2199\n<523b>2049\n<5243>3074\n<5244>4260\n<5247>2823\n<5249>14358\n<524a>2143\n<524d>2738\n<524f>4259\n<5254>4264\n<5256>3684\n<525b>2038\n<525d>7774\n<525e>4263\n<5261>14359\n<5263>1867\n<5264>2126\n<5265>3363\n<5266>14360\n<5269>4267\n<526a>4265\n<526f>3565\n<5270>2514\n<5271>4274\n<5272>1474\n<5273>4268\n<5274>4266\n<5275>2769\n<527d>4270\n<527f>4269\n<5283>1442\n<5287>1846\n<5288>4275\n<5289>3957\n<528d>4271\n<5291>4276\n<5292>4273\n<5293>14361\n<5294>4272\n<529b>3991\n<529c>8399\n<529f>1965\n<52a0>1347\n<52a3>4028\n<52a6>8400\n<52a9>2431\n<52aa>3154\n<52ab>2039\n<52af>8573\n<52b1>4013\n<52b4>4049\n<52b5>4282\n<52b9>1966\n<52bc>4281\n<52be>1421\n<52c0>8401\n<52c1>4283\n<52c3>3716\n<52c5>3032\n<52c7>3856\n<52c8>14362\n<52c9>3625\n<52cd>4284\n<52d0>14056\n<52d2>7150\n<52d5>3208\n<52d7>4285\n<52d8>1510\n<52d9>3775\n<52db>8402\n<52dd>2441\n<52de>4286\n<52df>3639\n<52e0>4290\n<52e2>2638\n<52e3>4287\n<52e4>1736\n<52e6>4288\n<52e7>1511\n<52f0>14363\n<52f2>1796\n<52f3>4291\n<52f5>4292\n<52fa>2311\n<52fe>1967\n<52ff>3818\n<5300>8403\n<5301>3828\n<5302>3279\n<5305>3649\n<5306>4295\n<5308>4296\n<530d>4298\n<530f>4300\n<5310>4299\n<5315>4301\n<5316>1341\n<5317>3706\n<5319>2156\n<531a>4302\n<531d>2779\n<5320>2442\n<5321>1697\n<5323>4303\n<5324>8405\n<532a>3439\n<532f>4304\n<5331>4305\n<5333>4306\n<5338>4307\n<5339>3478\n<533a>1760\n<533b>1193\n<533e>14366\n<533f>3223\n<5340>4308\n<5341>2375\n<5343>2701\n<5345>4310\n<5346>4309\n<5347>2443\n<5348>1941\n<5349>4312\n<534a>3410\n<534b>14368\n<534c>14367\n<534d>4313\n<5351>3440\n<5352>2836\n<5353>2894\n<5354>1696\n<5357>3270\n<5358>2927\n<535a>3364\n<535c>3708\n<535e>4315\n<5360>2702\n<5361>14369\n<5366>1803\n<5369>4316\n<536c>14370\n<536e>4317\n<536f>1230\n<5370>1209\n<5371>1577\n<5372>8406\n<5373>2824\n<5374>1643\n<5375>3931\n<5377>4320\n<5378>1335\n<537b>4319\n<537d>13365\n<5382>4321\n<5384>3837\n<5389>14288\n<5393>8407\n<5396>4322\n<5398>3994\n<539a>1968\n<539f>1898\n<53a0>4323\n<53a5>4325\n<53a6>4324\n<53a8>2597\n<53ab>14371\n<53ad>1280\n<53ae>4326\n<53b0>4327\n<53b2>8408\n<53b3>1899\n<53b6>4328\n<53bb>1672\n<53c2>2176\n<53c3>4329\n<53c8>3746\n<53ca>1652\n<53cb>3857\n<53cc>2770\n<53cd>3411\n<53ce>2345\n<53d4>2385\n<53d6>2324\n<53d7>2337\n<53d9>2432\n<53da>14372\n<53dd>8409\n<53e1>1253\n<53e2>2771\n<53e3>1969\n<53e4>1913\n<53e5>1759\n<53e6>14373\n<53e8>4336\n<53e9>2911\n<53ea>2910\n<53eb>1699\n<53ec>2444\n<53ed>4337\n<53ee>4335\n<53ef>1348\n<53f0>2886\n<53f1>2276\n<53f2>2201\n<53f3>1224\n<53f5>14374\n<53f6>1486\n<53f7>2040\n<53f8>2200\n<53fa>4338\n<5401>4339\n<5403>1635\n<5404>1444\n<5408>2041\n<5409>1634\n<540a>3067\n<540b>1223\n<540c>3209\n<540d>3786\n<540e>1971\n<540f>3939\n<5410>3137\n<5411>1970\n<541b>1797\n<541d>4348\n<541f>1755\n<5420>3704\n<5426>3441\n<5427>14375\n<5429>4347\n<542b>1562\n<542e>4345\n<5433>13760\n<5436>4346\n<5438>1653\n<5439>2599\n<543b>3581\n<543c>4344\n<543d>4340\n<543e>1943\n<543f>13775\n<5440>4341\n<5442>4042\n<5446>3650\n<5448>3076\n<5449>1942\n<544a>2050\n<544d>14376\n<544e>4349\n<5451>3253\n<5455>14115\n<545f>4353\n<5466>14377\n<5468>2346\n<546a>2338\n<546b>14378\n<5470>4356\n<5471>4354\n<5473>3759\n<5474>14379\n<5475>4351\n<5476>4360\n<5477>4355\n<547b>4358\n<547c>1914\n<547d>3787\n<5480>4359\n<5484>4361\n<5486>4363\n<548a>8412\n<548b>2144\n<548c>4072\n<548d>14380\n<548e>4352\n<548f>4350\n<5490>4362\n<5492>4357\n<5496>14381\n<549c>8411\n<54a1>14382\n<54a2>4365\n<54a4>4374\n<54a5>4367\n<54a8>4371\n<54a9>8413\n<54ab>4372\n<54ad>14383\n<54af>4401\n<54b2>2137\n<54b3>1423\n<54b8>4366\n<54b9>14384\n<54bc>4376\n<54bd>1210\n<54be>4375\n<54bf>14385\n<54c0>1129\n<54c1>3516\n<54c2>4373\n<54c4>4369\n<54c6>14386\n<54c7>4364\n<54c8>4370\n<54c9>2104\n<54cd>14387\n<54d8>4377\n<54e1>1211\n<54e2>4386\n<54e9>3735\n<54ed>4384\n<54ee>4383\n<54f2>3113\n<54fa>4385\n<54fd>4382\n<54ff>8414\n<5504>1238\n<5506>2086\n<5507>2550\n<550e>14388\n<550f>4380\n<5510>3164\n<5514>4381\n<5516>1126\n<552b>14389\n<552e>4391\n<552f>3853\n<5531>2447\n<5533>4397\n<5535>14390\n<5538>4396\n<5539>4387\n<553e>2851\n<5540>4388\n<5544>2895\n<5545>4393\n<5546>2446\n<554a>14391\n<554c>4390\n<554f>3824\n<5553>1810\n<555c>4392\n<555d>4398\n<555e>7633\n<5560>14392\n<5563>4389\n<557b>4404\n<557c>4409\n<557e>4405\n<5580>4400\n<5583>4410\n<5584>2739\n<5586>8415\n<5587>4412\n<5588>14394\n<5589>1972\n<558a>4402\n<558b>3003\n<558e>14395\n<5598>4406\n<5599>4399\n<559a>1513\n<559c>1578\n<559d>1475\n<559e>4407\n<559f>4403\n<55a7>1868\n<55a8>4413\n<55a9>4411\n<55aa>2773\n<55ab>1636\n<55ac>1700\n<55ae>4408\n<55b6>1254\n<55c4>4417\n<55c5>4415\n<55c7>4472\n<55d4>4420\n<55da>4414\n<55dc>4418\n<55df>4416\n<55e3>2202\n<55e4>4419\n<55f7>4422\n<55f9>4427\n<55fd>4425\n<55fe>4424\n<5606>2928\n<5608>14396\n<5609>1349\n<5614>4421\n<5616>4423\n<5617>2448\n<5618>1237\n<561b>4426\n<5620>15389\n<5629>1374\n<562f>4437\n<5631>2532\n<5634>4431\n<5636>4432\n<5637>14399\n<5638>4434\n<563f>14400\n<5649>14401\n<564b>14402\n<564e>4428\n<564f>14403\n<5650>4429\n<5653>7963\n<565b>1496\n<5664>4436\n<5666>14404\n<5668>1579\n<5669>14405\n<566a>4439\n<566b>4435\n<566c>4438\n<566f>14406\n<5674>3582\n<5676>15411\n<5678>3245\n<567a>3404\n<5680>4441\n<5686>4440\n<5687>1443\n<568a>4442\n<568f>4445\n<5694>4444\n<5695>14409\n<5699>7654\n<569a>14410\n<56a0>4443\n<56a2>3311\n<56a5>4446\n<56ae>4447\n<56b1>14413\n<56b4>4449\n<56b6>4448\n<56bc>4451\n<56c1>4452\n<56c2>4450\n<56c3>4453\n<56c8>4455\n<56c9>14414\n<56ca>7770\n<56ce>4456\n<56d1>4457\n<56d3>4458\n<56d7>4459\n<56d8>4220\n<56da>2344\n<56db>2203\n<56dd>14415\n<56de>1395\n<56e0>1212\n<56e3>2946\n<56e4>14416\n<56ee>4460\n<56f0>2068\n<56f2>1171\n<56f3>2596\n<56f9>4461\n<56fa>1915\n<56fd>2051\n<56ff>4463\n<5700>4462\n<5703>3632\n<5704>4464\n<5708>4466\n<5709>4465\n<570a>14417\n<570b>4467\n<570d>4468\n<570f>1869\n<5712>1282\n<5713>4469\n<5715>14418\n<5716>4471\n<5718>4470\n<571c>4473\n<571f>3156\n<5721>13952\n<5723>14419\n<5726>4474\n<5727>1145\n<5728>2127\n<572d>1811\n<572f>14420\n<5730>2957\n<573b>4478\n<5740>4479\n<5742>2132\n<5747>1737\n<574a>3685\n<574c>14423\n<574e>4477\n<574f>4480\n<5750>2097\n<5751>1973\n<5759>8416\n<5761>4484\n<5764>2069\n<5765>8417\n<5766>2929\n<5769>4481\n<576a>3062\n<5770>14424\n<577f>4485\n<5782>2600\n<5788>4483\n<5789>4486\n<578b>1813\n<578c>14425\n<5793>4487\n<579c>14426\n<57a0>4488\n<57a2>1974\n<57a3>1438\n<57a4>4490\n<57aa>4491\n<57ac>8418\n<57b0>4492\n<57b3>4489\n<57b8>14427\n<57c0>4482\n<57c3>4493\n<57c6>4494\n<57c7>8420\n<57c8>8419\n<57cb>3730\n<57ce>2515\n<57d4>4495\n<57d6>4499\n<57dc>3310\n<57df>1196\n<57e0>3528\n<57e3>4500\n<57e6>14428\n<57ed>14429\n<57f4>2533\n<57f7>2277\n<57f9>3347\n<57fa>1580\n<57fc>2139\n<57ff>14432\n<5800>3719\n<5802>3210\n<5805>1870\n<5806>2863\n<5809>14433\n<580a>4498\n<580b>4501\n<5815>2852\n<5819>4502\n<581d>4503\n<5820>14434\n<5821>4505\n<5824>3077\n<582a>1514\n<582f>7474\n<5830>1283\n<5831>3651\n<5832>14435\n<5834>2516\n<583a>2134\n<583d>4511\n<5840>3597\n<5841>4005\n<584a>1396\n<584b>4507\n<5851>2748\n<5852>4510\n<5854>3165\n<5857>3139\n<5858>3166\n<5859>3405\n<585a>3049\n<585e>2105\n<5861>7751\n<5862>4506\n<5869>1304\n<586b>3120\n<5870>4508\n<5872>4504\n<5875>2582\n<5879>4512\n<587c>14436\n<587e>2392\n<5880>14437\n<5883>1701\n<5885>4513\n<5893>3640\n<5897>2815\n<589c>3042\n<589e>8423\n<589f>4515\n<58a8>3709\n<58a9>14438\n<58ab>4516\n<58ae>4521\n<58b2>8424\n<58b3>3583\n<58b8>4520\n<58b9>4514\n<58ba>4517\n<58bb>4519\n<58be>2070\n<58c1>3609\n<58c5>4522\n<58c7>2947\n<58ca>1397\n<58cc>2517\n<58ce>14439\n<58d0>14440\n<58d1>4524\n<58d3>4523\n<58d4>14441\n<58d5>2042\n<58d7>4525\n<58d8>4527\n<58d9>4526\n<58da>14442\n<58dc>4529\n<58de>4518\n<58df>4531\n<58e4>4530\n<58e5>4528\n<58e9>14443\n<58eb>2204\n<58ec>2583\n<58ee>2774\n<58ef>4532\n<58f0>2656\n<58f1>1201\n<58f2>3354\n<58f7>3063\n<58f9>4534\n<58fa>4533\n<5902>4538\n<5909>3617\n<590a>4539\n<590b>8425\n<590c>14444\n<590f>1350\n<5910>4540\n<5915>3878\n<5916>1422\n<5918>4318\n<5919>2386\n<591a>2847\n<591b>4541\n<591c>3831\n<5922>3776\n<5924>14445\n<5925>4543\n<5927>2887\n<5929>3121\n<592a>2848\n<592b>3529\n<592e>1309\n<592f>14446\n<5931>2278\n<5932>4546\n<5937>1172\n<5938>4547\n<5939>14117\n<593e>4548\n<5944>1284\n<5947>1581\n<5948>3256\n<5949>3652\n<594e>4552\n<594f>2775\n<5950>4551\n<5951>1814\n<5953>8426\n<5954>3721\n<5955>4550\n<5957>3167\n<5958>4554\n<595a>4553\n<595b>8427\n<595d>8428\n<5960>4556\n<5961>14447\n<5962>4555\n<5963>8429\n<5965>1310\n<5967>4557\n<5968>2449\n<5969>4559\n<596a>2915\n<596c>4558\n<596d>14448\n<596e>3587\n<5973>2433\n<5974>3157\n<5978>4560\n<597d>1975\n<5981>4561\n<5982>3287\n<5983>3442\n<5984>3805\n<598a>3291\n<598d>4570\n<5993>1618\n<5996>3887\n<5999>3771\n<599b>4665\n<599d>4562\n<59a3>4565\n<59a4>8430\n<59a5>2853\n<59a8>3686\n<59ac>3140\n<59b2>4566\n<59b9>3731\n<59ba>8431\n<59bb>2106\n<59be>2450\n<59c6>4567\n<59c9>2206\n<59ca>14449\n<59cb>2205\n<59d0>1149\n<59d1>1916\n<59d2>14450\n<59d3>2639\n<59d4>1173\n<59dc>4569\n<59dd>14451\n<59e5>1242\n<59e6>1515\n<59e8>4568\n<59ea>3793\n<59eb>3491\n<59ec>13997\n<59f6>1132\n<59fb>1213\n<59ff>2207\n<5a01>1174\n<5a03>1127\n<5a04>14454\n<5a09>4577\n<5a0c>14455\n<5a11>4575\n<5a18>3784\n<5a1a>4578\n<5a1b>13761\n<5a1c>4576\n<5a1f>4574\n<5a20>2551\n<5a23>14456\n<5a25>4573\n<5a2f>1944\n<5a3c>2451\n<5a40>4579\n<5a41>4050\n<5a46>3330\n<5a47>14457\n<5a49>4581\n<5a55>14458\n<5a5a>2071\n<5a62>4584\n<5a63>14459\n<5a66>3530\n<5a6a>4585\n<5a6c>4580\n<5a6d>14460\n<5a7e>14461\n<5a7f>3783\n<5a92>3348\n<5a9a>4586\n<5a9b>3492\n<5a9e>14462\n<5aa7>14463\n<5aac>14464\n<5ab3>14465\n<5abc>4587\n<5abd>4591\n<5abe>4588\n<5ac1>1351\n<5ac2>4590\n<5ac9>2279\n<5acb>4589\n<5acc>1871\n<5ad0>4603\n<5ad6>4596\n<5ad7>4593\n<5ae0>14466\n<5ae1>2978\n<5ae3>4592\n<5ae6>4594\n<5ae9>4595\n<5b00>14467\n<5b09>1582\n<5b0b>4600\n<5b0c>4599\n<5b16>4601\n<5b19>14468\n<5b22>2518\n<5b25>14469\n<5b2a>4604\n<5b2c>3064\n<5b2d>14470\n<5b30>1255\n<5b32>4602\n<5b36>4605\n<5b3e>4606\n<5b40>4609\n<5b41>14471\n<5b43>4607\n<5b45>4608\n<5b50>2208\n<5b51>4610\n<5b54>1976\n<5b55>4611\n<5b56>8432\n<5b57>2248\n<5b58>2840\n<5b5c>2216\n<5b5d>1977\n<5b5f>3806\n<5b63>1602\n<5b64>1917\n<5b65>4614\n<5b66>1462\n<5b69>4615\n<5b6b>2841\n<5b70>4616\n<5b71>4656\n<5b73>4617\n<5b75>4618\n<5b78>4619\n<5b7a>4621\n<5b7c>14472\n<5b80>4622\n<5b82>13840\n<5b83>4623\n<5b85>2896\n<5b87>1225\n<5b88>2325\n<5b89>1158\n<5b8a>14475\n<5b8b>2777\n<5b8c>1516\n<5b8d>2273\n<5b8f>1978\n<5b95>3168\n<5b97>2347\n<5b98>1517\n<5b99>2982\n<5b9a>3078\n<5b9b>1148\n<5b9c>1619\n<5b9d>3653\n<5b9f>2286\n<5ba2>1644\n<5ba3>2703\n<5ba4>2280\n<5ba5>3858\n<5ba6>4624\n<5bae>1654\n<5bb0>2107\n<5bb3>1424\n<5bb4>1285\n<5bb5>2452\n<5bb6>1352\n<5bb8>4625\n<5bb9>3888\n<5bbf>2387\n<5bc0>8433\n<5bc2>2320\n<5bc3>4626\n<5bc4>1583\n<5bc5>3242\n<5bc6>3765\n<5bc7>4627\n<5bc9>4628\n<5bcc>3531\n<5bd0>4630\n<5bd2>1508\n<5bd3>1775\n<5bd4>4629\n<5bd8>8435\n<5bdb>1518\n<5bdd>2552\n<5bde>4634\n<5bdf>2159\n<5be1>1353\n<5be2>4633\n<5be4>4631\n<5be5>4635\n<5be6>4632\n<5be7>3297\n<5be8>5262\n<5be9>2553\n<5beb>4636\n<5bee>3976\n<5bf0>4637\n<5bf3>4639\n<5bf5>3004\n<5bf6>4638\n<5bf8>2631\n<5bfa>2249\n<5bfe>2864\n<5bff>2339\n<5c01>3559\n<5c02>2704\n<5c04>2297\n<5c05>4640\n<5c06>2453\n<5c09>1175\n<5c0a>2842\n<5c0b>2584\n<5c0d>4643\n<5c0e>3211\n<5c0f>2454\n<5c11>2455\n<5c13>4644\n<5c14>14122\n<5c16>2705\n<5c19>13835\n<5c1a>2456\n<5c1e>8437\n<5c20>4645\n<5c22>4646\n<5c23>14476\n<5c24>3820\n<5c28>4647\n<5c2b>14477\n<5c2d>1726\n<5c30>14478\n<5c31>2348\n<5c3a>2312\n<5c3b>2546\n<5c3c>3276\n<5c3d>2586\n<5c3e>3468\n<5c3f>3288\n<5c40>1729\n<5c41>4650\n<5c45>1673\n<5c46>4651\n<5c48>1782\n<5c4a>3239\n<5c4b>1328\n<5c4d>2209\n<5c4e>4652\n<5c4f>4655\n<5c50>4654\n<5c53>4653\n<5c55>3122\n<5c5b>7826\n<5c5e>2832\n<5c61>2292\n<5c62>7693\n<5c63>14479\n<5c64>2778\n<5c65>3940\n<5c69>14480\n<5c6c>4657\n<5c6e>4658\n<5c6f>3246\n<5c71>2177\n<5c76>4660\n<5c79>4661\n<5c7c>14481\n<5c8c>4662\n<5c90>1584\n<5c91>4663\n<5c94>4664\n<5ca1>1324\n<5ca6>8438\n<5ca8>2749\n<5ca9>1568\n<5cab>4666\n<5cac>3764\n<5cb1>2866\n<5cb3>1463\n<5cb6>4668\n<5cb7>4670\n<5cb8>1563\n<5cba>8439\n<5cbb>4667\n<5cbc>4669\n<5cbe>4672\n<5cc5>4671\n<5cc7>4673\n<5ccb>14482\n<5cd2>14483\n<5cd9>4674\n<5ce0>3221\n<5ce1>1702\n<5ce6>14124\n<5ce8>1381\n<5ce9>4675\n<5cea>4680\n<5ced>4678\n<5cef>3655\n<5cf0>3654\n<5cf4>14484\n<5cf5>8440\n<5cf6>3169\n<5cfa>4677\n<5cfb>2398\n<5cfd>4676\n<5d07>2616\n<5d0b>4681\n<5d0e>2138\n<5d11>4687\n<5d14>4688\n<5d15>4682\n<5d16>1425\n<5d17>4683\n<5d18>4692\n<5d19>4691\n<5d1a>4690\n<5d1b>4686\n<5d1f>4685\n<5d22>4689\n<5d24>14485\n<5d26>14486\n<5d27>8441\n<5d29>3656\n<5d42>8444\n<5d43>14487\n<5d46>14488\n<5d4a>14489\n<5d4b>4696\n<5d4c>4693\n<5d4e>4695\n<5d50>3932\n<5d52>4694\n<5d53>8442\n<5d5c>4684\n<5d69>2617\n<5d6c>4697\n<5d6d>8445\n<5d6f>2087\n<5d73>4698\n<5d76>4699\n<5d82>4702\n<5d84>4701\n<5d87>4700\n<5d8b>3170\n<5d8c>4679\n<5d90>4708\n<5d92>14490\n<5d94>14491\n<5d99>14492\n<5d9d>4704\n<5da0>14493\n<5da2>4703\n<5dac>4705\n<5dae>4706\n<5db7>4709\n<5dba>4014\n<5dbc>4710\n<5dbd>4707\n<5dc9>4711\n<5dcc>1564\n<5dcd>4712\n<5dd0>8448\n<5dd2>4714\n<5dd3>4713\n<5dd6>4715\n<5dd8>14494\n<5ddb>4716\n<5ddd>2706\n<5dde>2349\n<5de0>14495\n<5de1>2414\n<5de2>13362\n<5de3>2789\n<5de5>1979\n<5de6>2088\n<5de7>1980\n<5de8>1674\n<5deb>4717\n<5dee>2089\n<5df1>1918\n<5df2>4718\n<5df3>3762\n<5df4>3321\n<5df5>4719\n<5df8>14496\n<5dfb>1512\n<5dfd>2917\n<5dfe>1738\n<5dff>13794\n<5e00>14497\n<5e02>2210\n<5e03>3533\n<5e06>3413\n<5e0b>4720\n<5e0c>1585\n<5e11>4723\n<5e12>14498\n<5e16>3005\n<5e18>14501\n<5e19>4722\n<5e1a>4721\n<5e1b>4724\n<5e1d>3079\n<5e25>2601\n<5e2b>2211\n<5e2d>2670\n<5e2e>14502\n<5e2f>2867\n<5e30>1596\n<5e33>3006\n<5e38>2519\n<5e3d>3687\n<5e40>4729\n<5e43>4728\n<5e44>4727\n<5e45>3567\n<5e47>4736\n<5e4c>3720\n<5e4e>4730\n<5e54>4732\n<5e55>3737\n<5e57>4731\n<5e58>14503\n<5e5f>4733\n<5e61>3388\n<5e62>4734\n<5e63>3598\n<5e64>4735\n<5e72>1519\n<5e73>3599\n<5e74>3301\n<5e78>1982\n<5e79>1520\n<5e7a>4739\n<5e7b>1900\n<5e7c>3886\n<5e7d>3859\n<5e7e>1586\n<5e7f>4741\n<5e81>3007\n<5e83>1983\n<5e84>2457\n<5e87>3443\n<5e8a>2458\n<5e8f>2434\n<5e95>3080\n<5e97>3123\n<5e99>14000\n<5e9a>1984\n<5e9c>3534\n<5ea0>4742\n<5ea6>3155\n<5ea7>2098\n<5ea8>14506\n<5eaa>14507\n<5eab>1919\n<5ead>3081\n<5eb5>1159\n<5eb6>2424\n<5eb7>1985\n<5eb8>3889\n<5ec3>3335\n<5ec8>4745\n<5ec9>4031\n<5eca>4051\n<5ecf>4747\n<5ed0>4746\n<5ed2>14511\n<5ed3>1445\n<5ed6>4748\n<5edd>4750\n<5ee0>2459\n<5ee1>4754\n<5ee2>4753\n<5ee3>4749\n<5eec>4757\n<5ef0>4760\n<5ef1>4758\n<5ef3>4759\n<5ef4>4761\n<5ef6>1286\n<5ef7>3082\n<5ef8>4762\n<5efa>1872\n<5efc>3308\n<5efe>4763\n<5eff>3283\n<5f01>3627\n<5f03>4764\n<5f04>4052\n<5f07>14512\n<5f09>4765\n<5f0a>3600\n<5f0b>4768\n<5f0c>4090\n<5f0d>4106\n<5f0e>14513\n<5f0f>2268\n<5f10>3277\n<5f11>4769\n<5f13>1655\n<5f14>3008\n<5f15>1214\n<5f16>4770\n<5f17>3574\n<5f18>1986\n<5f1b>2958\n<5f1f>3083\n<5f21>8449\n<5f22>14516\n<5f25>3835\n<5f26>1901\n<5f27>1920\n<5f28>14517\n<5f29>4771\n<5f2d>4772\n<5f2f>4778\n<5f31>2321\n<5f34>8450\n<5f35>3009\n<5f36>14518\n<5f37>1703\n<5f38>4773\n<5f3a>13720\n<5f3b>14519\n<5f3c>3485\n<5f3e>2948\n<5f40>14520\n<5f41>4774\n<5f45>8370\n<5f48>4775\n<5f4a>1704\n<5f4c>4776\n<5f4e>4777\n<5f50>14521\n<5f51>4779\n<5f53>3184\n<5f58>14522\n<5f59>4782\n<5f5c>4767\n<5f5d>4766\n<5f61>4783\n<5f62>1815\n<5f64>14523\n<5f65>13996\n<5f66>3481\n<5f67>8451\n<5f69>2108\n<5f6a>3497\n<5f6b>3010\n<5f6c>3517\n<5f6d>4784\n<5f70>2460\n<5f71>1256\n<5f73>4785\n<5f77>4786\n<5f79>3838\n<5f7c>3444\n<5f7f>4789\n<5f80>1311\n<5f81>2640\n<5f82>4788\n<5f83>4787\n<5f84>1816\n<5f85>2868\n<5f87>4793\n<5f88>4791\n<5f89>14524\n<5f8a>4790\n<5f8b>3951\n<5f8c>1945\n<5f90>2435\n<5f91>4792\n<5f92>3142\n<5f93>2376\n<5f97>3224\n<5f99>4795\n<5f9c>14525\n<5f9e>4794\n<5fa0>4797\n<5fa1>1946\n<5fa4>14527\n<5fa7>14526\n<5fa8>4798\n<5fa9>3566\n<5faa>2405\n<5fad>4799\n<5fae>3469\n<5faf>14528\n<5fb3>3225\n<5fb4>3011\n<5fb5>13368\n<5fb7>8452\n<5fb8>14529\n<5fb9>3114\n<5fbc>4800\n<5fc3>2554\n<5fc4>14530\n<5fc5>3486\n<5fc9>14531\n<5fcc>1587\n<5fcd>3292\n<5fd6>4801\n<5fd7>2212\n<5fdc>1312\n<5fdd>4806\n<5fde>8453\n<5fe0>2983\n<5fe1>14532\n<5fe4>4803\n<5fe9>14533\n<5feb>1399\n<5fed>14534\n<5ff0>4854\n<5ff1>4805\n<5ff5>3302\n<5ff8>4804\n<5ffb>4802\n<5ffc>14535\n<5ffd>2060\n<5fff>4808\n<600e>4814\n<600f>4820\n<6010>4812\n<6012>3158\n<6015>4817\n<6016>3535\n<6017>14536\n<6019>4811\n<601a>14537\n<601b>4816\n<601c>4015\n<601d>2213\n<6020>2869\n<6021>4809\n<6025>1656\n<6026>4819\n<6027>2641\n<6028>1287\n<6029>4813\n<602a>1400\n<602b>4818\n<602f>1705\n<6031>4815\n<6033>14538\n<603a>4821\n<6041>4823\n<6042>4833\n<6043>4831\n<6046>4828\n<604a>4827\n<604b>4032\n<604d>4829\n<6050>1706\n<6052>1987\n<6055>2436\n<6059>4836\n<605a>4822\n<605d>8454\n<605f>4826\n<6060>4810\n<6061>14539\n<6063>4830\n<6064>4832\n<6065>2959\n<6068>2072\n<6069>1336\n<606a>4824\n<606b>4835\n<606c>4834\n<606d>1707\n<606f>2825\n<6070>1476\n<6075>1817\n<6077>4825\n<607f>14540\n<6081>4837\n<6083>4840\n<6084>4842\n<6085>8455\n<6089>2281\n<608a>8456\n<608b>4848\n<608c>3084\n<608d>4838\n<6092>4846\n<6094>1401\n<609a>4841\n<609b>4843\n<609f>1947\n<60a0>3860\n<60a3>1521\n<60a4>14542\n<60a6>1275\n<60a7>4847\n<60a9>3312\n<60aa>1137\n<60b0>14543\n<60b2>3445\n<60b3>4807\n<60b4>4853\n<60b5>4857\n<60b6>3825\n<60b8>4850\n<60bc>3171\n<60bd>4855\n<60c5>2520\n<60c6>4856\n<60c7>3247\n<60cb>14544\n<60d1>4077\n<60d3>4852\n<60d5>8458\n<60d8>4858\n<60da>2061\n<60db>14545\n<60dc>2671\n<60de>8457\n<60df>1176\n<60e0>4851\n<60e1>4849\n<60e3>2780\n<60e7>4839\n<60e8>2178\n<60f0>2854\n<60f1>4870\n<60f2>8460\n<60f3>2781\n<60f4>4865\n<60f8>14546\n<60f9>2322\n<60fa>4866\n<60fb>4869\n<6100>4864\n<6101>2351\n<6103>4867\n<6106>4861\n<6109>3847\n<610f>1177\n<6111>8461\n<6115>4860\n<611a>1770\n<611b>1130\n<611c>14550\n<611f>1522\n<6120>8459\n<6121>4868\n<6127>4876\n<6128>4875\n<612c>4880\n<6130>8463\n<6134>4881\n<6137>8462\n<613c>4879\n<613d>4882\n<613e>4874\n<613f>4878\n<6142>4883\n<6144>4884\n<6147>4873\n<6148>2250\n<614a>4877\n<614b>2870\n<614c>1988\n<614d>4859\n<614e>2555\n<6153>4897\n<6155>3641\n<615d>4896\n<615f>4895\n<6162>3755\n<6163>1523\n<6165>4893\n<6167>1819\n<6168>1426\n<616b>4890\n<616e>3968\n<616f>4892\n<6170>1178\n<6171>4894\n<6173>4885\n<6174>4891\n<6175>4898\n<6176>1818\n<6177>4886\n<617c>14551\n<617e>3911\n<6182>3861\n<6187>4901\n<618a>4905\n<618d>14552\n<618e>2816\n<6190>4033\n<6191>4906\n<6194>4903\n<6196>4900\n<6198>8464\n<6199>4899\n<619a>4904\n<619f>14553\n<61a4>3584\n<61a7>3212\n<61a8>14554\n<61a9>1820\n<61ab>4907\n<61ac>4902\n<61ae>4908\n<61b2>1873\n<61b6>1329\n<61ba>4916\n<61be>1524\n<61c2>14555\n<61c3>4914\n<61c6>4915\n<61c7>2073\n<61c8>4913\n<61c9>4911\n<61ca>4910\n<61cb>4917\n<61cc>4909\n<61cd>4919\n<61d0>1403\n<61df>14556\n<61e3>4921\n<61e6>4920\n<61f2>3012\n<61f4>4924\n<61f6>4922\n<61f7>4912\n<61f8>1874\n<61fa>4923\n<61fc>4927\n<61fd>4926\n<61fe>4928\n<61ff>4925\n<6200>4929\n<620a>3642\n<620c>4933\n<620d>4932\n<620e>2377\n<6210>2642\n<6211>1382\n<6212>1404\n<6213>8465\n<6214>4934\n<6215>14557\n<6216>1155\n<621a>2672\n<621b>4935\n<621d>6756\n<621e>4936\n<621f>1847\n<6221>4937\n<6226>2707\n<6229>14558\n<622a>4938\n<622e>4939\n<622f>1620\n<6230>4940\n<6234>2871\n<6236>13757\n<6238>1921\n<623b>3821\n<623e>13390\n<623f>3690\n<6240>2420\n<6243>14559\n<6246>14560\n<6247>2708\n<6248>6938\n<6249>3446\n<624b>2326\n<624c>14561\n<624d>2109\n<624e>4944\n<6251>14562\n<6253>2855\n<6255>3575\n<6256>14563\n<6258>2897\n<625b>4947\n<625e>4945\n<6260>4948\n<6263>4946\n<6268>4949\n<626e>3585\n<6271>1147\n<6276>3536\n<6279>3447\n<627c>4950\n<627e>4953\n<627f>2461\n<6280>1621\n<6282>4951\n<6283>4958\n<6284>2462\n<6285>13765\n<6289>4952\n<628a>3322\n<6291>3912\n<6294>4959\n<6295>3172\n<6296>4956\n<6297>1989\n<6298>2690\n<629b>4973\n<629c>3400\n<629e>2898\n<62a6>8466\n<62ab>3448\n<62ac>5042\n<62b1>3658\n<62b5>3085\n<62b9>3747\n<62bb>4962\n<62bc>1313\n<62bd>2984\n<62c2>4971\n<62c4>14564\n<62c5>2930\n<62c6>4965\n<62c7>4972\n<62c8>4967\n<62c9>4974\n<62ca>4970\n<62cc>4969\n<62cd>3365\n<62cf>4963\n<62d0>1405\n<62d1>4961\n<62d2>1675\n<62d3>2899\n<62d4>4957\n<62d7>4960\n<62d8>1990\n<62d9>2687\n<62db>2463\n<62dc>4968\n<62dd>3336\n<62e0>1676\n<62e1>1446\n<62ec>1477\n<62ed>2535\n<62ee>4976\n<62ef>4981\n<62f1>4977\n<62f3>1875\n<62f5>4982\n<62f6>2160\n<62f7>2043\n<62fc>14565\n<62fe>2352\n<62ff>4964\n<6301>2251\n<6302>4979\n<6307>2214\n<6308>4980\n<6309>1160\n<630a>14566\n<630c>4975\n<630d>14567\n<6311>3013\n<6318>14568\n<6319>1677\n<631b>14135\n<631f>1708\n<6327>4978\n<6328>1131\n<632b>2099\n<632f>2556\n<6339>14569\n<633e>4984\n<633f>2784\n<6349>2826\n<634c>2169\n<634d>4985\n<634f>4987\n<6350>4983\n<6355>3633\n<635c>2782\n<6365>14572\n<6367>3659\n<6368>2298\n<6369>4999\n<636b>4998\n<636e>2622\n<6374>14573\n<6376>4992\n<6377>2465\n<637a>3264\n<637b>3303\n<637d>14574\n<6380>4990\n<6383>2783\n<6384>14575\n<6387>14576\n<6388>2340\n<6389>4995\n<638c>2464\n<638e>4989\n<638f>4994\n<6390>14577\n<6392>3337\n<6396>4988\n<6398>1783\n<639b>1467\n<639e>14578\n<639f>4996\n<63a0>3955\n<63a1>2110\n<63a2>2931\n<63a3>4993\n<63a5>2688\n<63a7>1991\n<63a8>2602\n<63a9>1288\n<63aa>2750\n<63ab>4991\n<63ac>1631\n<63b2>1821\n<63b4>3051\n<63b5>4997\n<63bb>2785\n<63be>5000\n<63c0>5002\n<63c4>5008\n<63c6>5003\n<63c9>5005\n<63cf>3507\n<63d0>3087\n<63d1>14579\n<63d2>5006\n<63d6>3862\n<63da>3890\n<63db>1525\n<63dc>14580\n<63e1>1138\n<63e3>5004\n<63e9>5001\n<63ed>13340\n<63ee>1588\n<63f4>1289\n<63f5>8467\n<63f6>5007\n<63f7>13892\n<63fa>3891\n<6406>5011\n<6409>14581\n<640d>2843\n<640f>5018\n<6410>14582\n<6413>5012\n<6414>7724\n<6416>5009\n<6417>5016\n<641c>4986\n<6422>14583\n<6426>5013\n<6428>5017\n<642c>3414\n<642d>3173\n<6434>5010\n<6436>5014\n<643a>1822\n<643e>2145\n<6442>2689\n<644e>5022\n<6451>7747\n<6454>14584\n<6458>3104\n<645b>14585\n<6460>8468\n<6467>5019\n<6469>3726\n<646d>14586\n<6476>5021\n<6478>3802\n<647b>14587\n<6483>1848\n<6488>5028\n<6492>2179\n<6493>5025\n<6495>5024\n<649a>3304\n<649d>8469\n<649e>3213\n<64a4>3115\n<64a5>5026\n<64a9>5027\n<64ab>3553\n<64ad>3323\n<64ae>2161\n<64b2>3710\n<64b9>1447\n<64bb>5034\n<64bc>5029\n<64c1>3892\n<64c2>5036\n<64c5>5032\n<64c7>5033\n<64ca>13341\n<64cd>2786\n<64ce>8470\n<64d2>5031\n<64d4>4966\n<64d8>5035\n<64da>5030\n<64e3>5043\n<64e5>14590\n<64e6>2162\n<64e7>5038\n<64ec>1622\n<64ef>5044\n<64f1>5037\n<64f2>5048\n<64f4>5047\n<64f6>5046\n<64f7>14591\n<64fa>5049\n<64fb>14592\n<64fd>5051\n<64fe>2521\n<6500>5050\n<6504>14593\n<6505>5054\n<6516>14594\n<6518>5052\n<6519>14595\n<651c>5053\n<651d>5015\n<6522>7831\n<6523>5056\n<6524>5055\n<652a>5023\n<652b>5057\n<652c>5045\n<652f>2215\n<6536>5061\n<6537>5060\n<6538>5062\n<6539>1406\n<653b>1992\n<653e>3660\n<653f>2643\n<6545>1922\n<6547>14596\n<6548>5064\n<654d>5067\n<654e>8471\n<654f>3524\n<6551>1657\n<6555>5066\n<6556>5065\n<6557>3338\n<6558>5068\n<6559>1709\n<655d>5070\n<655e>5069\n<6562>1526\n<6563>2180\n<6566>3248\n<6567>14597\n<656c>1823\n<6570>2618\n<6572>5071\n<6574>2644\n<6575>3106\n<6577>3537\n<6578>5072\n<6581>14598\n<6585>14599\n<6587>3592\n<6588>4620\n<6589>2666\n<658c>3518\n<658e>2120\n<6590>3449\n<6591>3415\n<6597>3143\n<6599>3977\n<659b>5076\n<659c>2300\n<659f>5077\n<65a1>1146\n<65a4>1740\n<65a5>2673\n<65ab>5078\n<65ac>2192\n<65ad>2949\n<65af>2217\n<65b0>2557\n<65b7>5079\n<65b9>3661\n<65bc>1305\n<65bd>2218\n<65c1>5082\n<65c2>14600\n<65c3>5080\n<65c4>5083\n<65c5>3969\n<65c6>5081\n<65cb>2719\n<65cc>5084\n<65cf>2834\n<65d2>5085\n<65d7>1590\n<65d9>5087\n<65db>5086\n<65e2>1591\n<65e3>13701\n<65e5>3284\n<65e6>2932\n<65e7>1670\n<65e8>2219\n<65e9>2787\n<65ec>2406\n<65ed>1140\n<65f0>14601\n<65f1>5090\n<65f2>14602\n<65fa>1314\n<65fb>5094\n<6600>8472\n<6602>1993\n<6603>5093\n<6606>2075\n<6607>2466\n<6609>8474\n<660a>5092\n<660c>2467\n<660e>3788\n<660f>2074\n<6613>1179\n<6614>2674\n<6615>8473\n<661c>5099\n<661f>2645\n<6620>1257\n<6624>8477\n<6625>2399\n<6627>3732\n<6628>2146\n<662c>14603\n<662d>2468\n<662e>8475\n<662f>2635\n<6631>8366\n<6634>5098\n<663b>7680\n<663c>2985\n<663f>5129\n<6641>5103\n<6642>2252\n<6643>1994\n<6644>5101\n<6649>5102\n<664b>2558\n<664c>14604\n<664f>5100\n<6652>2173\n<6657>8479\n<6659>8480\n<665d>5105\n<665e>5104\n<665f>5109\n<6661>14607\n<6662>5110\n<6663>14138\n<6664>5106\n<6665>8478\n<6669>3433\n<666b>14608\n<666e>3539\n<666f>1824\n<6670>5111\n<6673>8482\n<6674>2646\n<6676>2469\n<667a>2960\n<6681>1727\n<6683>5112\n<6684>5116\n<6687>1355\n<6688>5113\n<6689>5115\n<668e>5114\n<6691>2421\n<6696>2950\n<6697>1161\n<6698>5117\n<6699>8483\n<669d>5118\n<66a0>8484\n<66a2>3014\n<66a4>14610\n<66a6>4025\n<66ab>2193\n<66ae>3643\n<66b2>8485\n<66b4>3691\n<66b8>5125\n<66b9>5120\n<66bc>5123\n<66be>5122\n<66bf>8486\n<66c1>5119\n<66c4>5124\n<66c6>13397\n<66c7>3254\n<66c8>14611\n<66c9>5121\n<66d6>5126\n<66d9>2422\n<66da>5127\n<66dc>3893\n<66dd>3374\n<66e0>5128\n<66e6>5130\n<66e9>5131\n<66ec>14612\n<66f0>5132\n<66f2>1730\n<66f3>1258\n<66f4>1995\n<66f5>5133\n<66f7>5134\n<66f8>2427\n<66f9>2788\n<66fa>8487\n<66fb>8369\n<66fc>4333\n<66fd>2752\n<66fe>2751\n<66ff>2872\n<6700>2103\n<6703>4171\n<6705>14613\n<6708>1860\n<6709>3863\n<670b>3662\n<670d>3568\n<670e>8488\n<670f>5135\n<6713>14614\n<6714>2147\n<6715>3035\n<6716>5136\n<6717>4053\n<671b>3692\n<671d>3015\n<671e>5137\n<671f>1592\n<6728>3814\n<672a>3760\n<672b>3748\n<672c>3722\n<672d>2163\n<672e>5141\n<6731>2327\n<6733>14615\n<6734>3711\n<6736>5143\n<6737>5146\n<6738>5145\n<673a>1589\n<673d>1658\n<673f>5142\n<6741>5144\n<6743>13751\n<6746>5147\n<6748>14616\n<6749>2623\n<674c>14617\n<674e>3941\n<674f>1165\n<6750>2128\n<6751>2844\n<6759>5150\n<675c>3144\n<675e>5148\n<675f>2827\n<6760>5149\n<6761>2522\n<6762>3817\n<6765>3922\n<6766>8490\n<676a>5157\n<676d>1996\n<676e>13681\n<676f>3339\n<6770>5154\n<6771>3174\n<6772>5091\n<6773>5095\n<6775>1641\n<6776>14618\n<6777>3325\n<677b>14619\n<677c>5156\n<677e>2470\n<677f>3416\n<6785>5162\n<6787>3470\n<6789>5153\n<678b>5159\n<678c>5158\n<6790>2675\n<6795>3739\n<6797>3995\n<679a>3733\n<679c>1356\n<679d>2220\n<67a0>4078\n<67a1>5161\n<67a2>2619\n<67a6>5160\n<67a9>5155\n<67af>1923\n<67b0>14620\n<67b2>14621\n<67b3>5167\n<67b4>5165\n<67b6>1357\n<67b7>5163\n<67b8>5169\n<67b9>5175\n<67bb>8491\n<67c0>8493\n<67c1>2856\n<67c4>3601\n<67c6>5177\n<67ca>3476\n<67ce>5176\n<67cf>3366\n<67d0>3693\n<67d1>1527\n<67d3>2715\n<67d4>2378\n<67d7>14623\n<67d8>3055\n<67d9>14624\n<67da>3864\n<67dd>5172\n<67de>5171\n<67e2>5173\n<67e4>5170\n<67e7>5178\n<67e9>5168\n<67ec>5166\n<67ee>5174\n<67ef>5164\n<67f0>14625\n<67f1>2986\n<67f3>3844\n<67f4>2290\n<67f5>2148\n<67f9>14622\n<67fb>2090\n<67fe>3741\n<67ff>1439\n<6802>3050\n<6803>3234\n<6804>1259\n<6805>7687\n<6813>2710\n<6816>2648\n<6817>1792\n<681e>5180\n<6821>1997\n<6822>1498\n<6829>5182\n<682a>1490\n<682b>5188\n<682c>14626\n<6832>5185\n<6834>2711\n<6838>1449\n<6839>2076\n<683c>1448\n<683d>2111\n<6840>5183\n<6841>1851\n<6842>1825\n<6843>3175\n<6844>8495\n<6846>5181\n<6848>1162\n<684d>5184\n<684e>5186\n<6850>1733\n<6851>1794\n<6852>8492\n<6853>1528\n<6854>1637\n<6859>5189\n<685b>14629\n<685c>2153\n<685d>3743\n<685f>2181\n<6863>5190\n<6867>3490\n<6872>14630\n<6874>5202\n<6875>14631\n<6876>1331\n<6877>5191\n<687a>14632\n<687e>5208\n<687f>5192\n<6881>3978\n<6883>5199\n<6884>14633\n<6885>3349\n<688d>5207\n<688e>7836\n<688f>5194\n<6893>1144\n<6894>5196\n<689b>5198\n<689d>5197\n<689f>5193\n<68a0>5204\n<68a2>2471\n<68a5>14634\n<68a6>4542\n<68a7>1948\n<68a8>3942\n<68ad>5195\n<68af>3088\n<68b0>1409\n<68b1>2077\n<68b2>14635\n<68b3>5187\n<68b5>5203\n<68b6>1471\n<68b9>5201\n<68ba>5205\n<68bc>3176\n<68c4>1594\n<68c6>5235\n<68c8>8367\n<68c9>3797\n<68ca>5210\n<68cb>1593\n<68cd>5217\n<68cf>8496\n<68d0>14636\n<68d2>3694\n<68d4>5218\n<68d5>5220\n<68d6>14637\n<68d7>5224\n<68d8>5212\n<68da>2920\n<68df>3177\n<68e0>5228\n<68e1>5215\n<68e3>5225\n<68e7>5219\n<68e8>14638\n<68ed>14639\n<68ee>2559\n<68ef>5229\n<68f2>2647\n<68f9>5227\n<68fa>1529\n<68fc>14642\n<6900>4086\n<6901>5209\n<6904>5223\n<6905>1180\n<6908>5211\n<690b>3782\n<690c>5216\n<690d>2536\n<690e>3043\n<690f>5206\n<6911>14643\n<6912>5222\n<6913>14644\n<6919>2624\n<691a>5232\n<691b>1487\n<691c>1877\n<6921>5234\n<6922>5213\n<6923>5233\n<6925>5226\n<6926>5214\n<6928>5230\n<692a>5231\n<6930>5248\n<6934>3238\n<6935>14645\n<6936>5221\n<6939>5244\n<693b>14646\n<693d>5246\n<693f>3060\n<694a>3894\n<6953>3560\n<6954>5241\n<6955>2858\n<6957>14647\n<6959>5247\n<695a>2753\n<695c>5238\n<695d>5251\n<695e>5250\n<6960>3271\n<6961>5249\n<6963>14648\n<6968>8498\n<696a>5253\n<696b>5240\n<696d>1728\n<696e>5243\n<6972>14649\n<6973>3350\n<6974>5245\n<6975>1731\n<6977>5237\n<6978>5239\n<6979>5236\n<697c>4054\n<697d>1464\n<697e>5242\n<6981>5252\n<6982>1427\n<698e>1279\n<6991>5269\n<6995>5272\n<6998>8500\n<699b>2560\n<699c>5271\n<69a0>5270\n<69a6>14652\n<69a7>5267\n<69ad>14653\n<69ae>5255\n<69b1>5284\n<69b2>5254\n<69b4>5273\n<69b7>14654\n<69bb>5265\n<69be>5260\n<69bf>5257\n<69c1>5258\n<69c3>5266\n<69c7>7475\n<69ca>5263\n<69cb>1999\n<69cd>2790\n<69ce>5261\n<69d0>5256\n<69d3>5259\n<69d8>3895\n<69d9>3736\n<69dd>5264\n<69de>5274\n<69e2>8501\n<69e7>5282\n<69e8>5275\n<69eb>5288\n<69ed>5286\n<69f2>5281\n<69f6>14143\n<69f9>5280\n<69fb>3052\n<69fd>2791\n<69ff>5278\n<6a01>14657\n<6a02>5276\n<6a05>5283\n<6a0a>5289\n<6a0c>5295\n<6a0f>14658\n<6a12>5290\n<6a13>5293\n<6a14>5287\n<6a15>14659\n<6a17>2994\n<6a19>3498\n<6a1b>5277\n<6a1e>5285\n<6a1f>2472\n<6a21>3803\n<6a22>5305\n<6a23>5292\n<6a28>14660\n<6a29>1878\n<6a2a>1315\n<6a2b>1469\n<6a2e>5268\n<6a30>8502\n<6a34>14661\n<6a35>2473\n<6a36>5297\n<6a38>5304\n<6a39>2341\n<6a3a>1488\n<6a3e>14662\n<6a44>5294\n<6a45>14663\n<6a46>8504\n<6a47>5299\n<6a48>5303\n<6a4b>1710\n<6a54>15412\n<6a56>14666\n<6a58>1638\n<6a59>5301\n<6a5b>14667\n<6a5f>1595\n<6a61>3235\n<6a62>5300\n<6a66>5302\n<6a6b>8503\n<6a72>5296\n<6a73>8505\n<6a78>5298\n<6a7e>8506\n<6a7f>1470\n<6a80>2951\n<6a83>14668\n<6a84>5309\n<6a89>14669\n<6a8d>5307\n<6a8e>1949\n<6a90>5306\n<6a91>14670\n<6a97>5312\n<6a9c>5179\n<6aa0>5308\n<6aaa>5323\n<6aac>5319\n<6aae>5200\n<6ab3>5318\n<6ab8>5317\n<6abb>5314\n<6ac1>5291\n<6ac2>5316\n<6ac3>5315\n<6ad1>5321\n<6ad3>4044\n<6ada>5324\n<6adc>14674\n<6ade>5320\n<6adf>5322\n<6ae2>8507\n<6ae4>8508\n<6ae7>14675\n<6ae8>3387\n<6aea>5325\n<6aec>14676\n<6afa>5329\n<6afb>5326\n<6b04>3933\n<6b05>5327\n<6b0a>5279\n<6b12>5330\n<6b16>5331\n<6b1d>1239\n<6b1e>14677\n<6b1f>5333\n<6b20>1853\n<6b21>2253\n<6b23>1741\n<6b24>14678\n<6b27>1316\n<6b32>3913\n<6b35>14679\n<6b37>5335\n<6b38>5334\n<6b39>5337\n<6b3a>1623\n<6b3d>1742\n<6b3e>1530\n<6b43>5340\n<6b46>14680\n<6b47>5339\n<6b49>5341\n<6b4c>1358\n<6b50>5342\n<6b53>1531\n<6b54>5344\n<6b56>14681\n<6b59>5343\n<6b5b>5345\n<6b5f>5346\n<6b60>14682\n<6b61>5347\n<6b62>2221\n<6b63>2649\n<6b64>2065\n<6b65>13386\n<6b66>3554\n<6b69>3634\n<6b6a>4074\n<6b6f>2243\n<6b72>13785\n<6b73>2112\n<6b74>4026\n<6b77>13398\n<6b7b>2222\n<6b82>14683\n<6b83>5353\n<6b84>5352\n<6b86>3718\n<6b89>2408\n<6b8a>2328\n<6b8b>2194\n<6b8d>5354\n<6b95>5356\n<6b96>2537\n<6b98>5355\n<6b9e>5357\n<6ba4>5358\n<6baf>5361\n<6bb1>5363\n<6bb2>5362\n<6bb3>5364\n<6bb4>1317\n<6bb5>2952\n<6bb7>5365\n<6bba>2164\n<6bbb>1450\n<6bbc>5366\n<6bbe>14684\n<6bbf>3132\n<6bc0>4509\n<6bc5>1597\n<6bc6>5367\n<6bcb>5368\n<6bcc>14148\n<6bcd>3644\n<6bce>3734\n<6bcf>13388\n<6bd2>3231\n<6bd3>5369\n<6bd4>3450\n<6bd6>8509\n<6bd8>3471\n<6bdb>3807\n<6bdf>5370\n<6be1>14685\n<6beb>5372\n<6bec>5371\n<6bef>5374\n<6bf1>14686\n<6bf3>5373\n<6c08>5376\n<6c0f>2223\n<6c10>14687\n<6c11>3773\n<6c17>1598\n<6c1b>5379\n<6c23>5381\n<6c24>5380\n<6c33>14688\n<6c34>2603\n<6c35>14689\n<6c37>3499\n<6c38>1260\n<6c3e>3417\n<6c3f>8510\n<6c40>3089\n<6c41>2379\n<6c42>1659\n<6c4e>3418\n<6c50>2266\n<6c55>5383\n<6c57>1532\n<6c59>14691\n<6c5a>1306\n<6c5c>8511\n<6c5d>3274\n<6c5e>5382\n<6c5f>2000\n<6c60>2961\n<6c62>5384\n<6c68>5392\n<6c6a>5385\n<6c6f>8513\n<6c70>2849\n<6c73>5393\n<6c76>14692\n<6c7a>1854\n<6c7b>14693\n<6c7d>1599\n<6c7e>5391\n<6c81>5389\n<6c82>5386\n<6c83>3914\n<6c85>14694\n<6c86>8512\n<6c88>3036\n<6c8c>3249\n<6c8d>5387\n<6c90>5395\n<6c92>5394\n<6c93>1785\n<6c95>14695\n<6c96>1325\n<6c99>2091\n<6c9a>5388\n<6c9b>5390\n<6c9c>14696\n<6ca1>3717\n<6ca2>2900\n<6caa>14153\n<6cab>3749\n<6cae>5403\n<6cb1>5404\n<6cb3>1359\n<6cb8>3576\n<6cb9>3849\n<6cba>5406\n<6cbb>2255\n<6cbc>2474\n<6cbd>5399\n<6cbe>5405\n<6cbf>1290\n<6cc1>1711\n<6cc4>5396\n<6cc5>5401\n<6cc9>2712\n<6cca>3367\n<6ccc>3451\n<6cd0>14697\n<6cd3>5398\n<6cd4>14698\n<6cd5>3663\n<6cd6>14699\n<6cd7>5400\n<6cd9>5409\n<6cda>8514\n<6cdb>5407\n<6cdd>5402\n<6ce0>14700\n<6ce1>3664\n<6ce2>3326\n<6ce3>1661\n<6ce5>3103\n<6ce8>2987\n<6cea>5410\n<6cee>14703\n<6cef>5408\n<6cf0>2873\n<6cf1>5397\n<6cf3>1261\n<6d01>15413\n<6d04>8515\n<6d0a>14704\n<6d0b>3896\n<6d0c>5421\n<6d0e>14705\n<6d11>14706\n<6d12>5420\n<6d17>2714\n<6d19>5417\n<6d1b>3926\n<6d1e>3214\n<6d1f>5411\n<6d25>3041\n<6d29>1262\n<6d2a>2001\n<6d2b>5414\n<6d2e>14707\n<6d32>2353\n<6d33>5419\n<6d35>5418\n<6d36>5413\n<6d38>5416\n<6d3b>1478\n<6d3d>5415\n<6d3e>3327\n<6d41>3958\n<6d44>2524\n<6d45>2713\n<6d57>14708\n<6d59>5427\n<6d5a>5425\n<6d5c>3519\n<6d5e>14709\n<6d63>5422\n<6d64>5424\n<6d65>14710\n<6d66>1244\n<6d69>2002\n<6d6a>4056\n<6d6c>1435\n<6d6e>3540\n<6d6f>8517\n<6d74>3915\n<6d77>1410\n<6d78>2561\n<6d79>5426\n<6d82>14711\n<6d85>5431\n<6d87>8516\n<6d88>2475\n<6d89>13354\n<6d8c>3866\n<6d8e>5428\n<6d93>5423\n<6d95>5429\n<6d96>8518\n<6d99>4006\n<6d9b>3181\n<6d9c>3226\n<6dac>8519\n<6daf>1428\n<6db2>1271\n<6db5>5435\n<6db8>5438\n<6dbc>3979\n<6dbf>14712\n<6dc0>3918\n<6dc4>14713\n<6dc5>5445\n<6dc6>5439\n<6dc7>5436\n<6dca>14714\n<6dcb>3996\n<6dcc>5442\n<6dcf>8520\n<6dd0>15414\n<6dd1>2388\n<6dd2>5444\n<6dd5>5449\n<6dd6>14715\n<6dd8>3179\n<6dd9>5447\n<6dda>13395\n<6dde>5441\n<6de1>2934\n<6de4>5448\n<6de6>5437\n<6de8>5443\n<6de9>14716\n<6dea>5450\n<6dec>5440\n<6dee>5451\n<6df1>2562\n<6df2>8522\n<6df3>2409\n<6df5>3573\n<6df7>2078\n<6df8>8521\n<6df9>5432\n<6dfa>5446\n<6dfb>3124\n<6dfc>8523\n<6e05>2650\n<6e07>1479\n<6e08>2113\n<6e09>2476\n<6e0a>5434\n<6e0b>2380\n<6e13>1826\n<6e15>5433\n<6e17>14150\n<6e19>5455\n<6e1a>2423\n<6e1b>1902\n<6e1d>5470\n<6e1f>5464\n<6e20>1678\n<6e21>3145\n<6e22>14717\n<6e23>5459\n<6e24>5468\n<6e25>1139\n<6e26>1236\n<6e27>8526\n<6e29>1337\n<6e2b>5461\n<6e2c>2828\n<6e2d>5452\n<6e2e>5454\n<6e2f>2003\n<6e34>13330\n<6e38>5471\n<6e39>8524\n<6e3a>5466\n<6e3c>8527\n<6e3e>5458\n<6e42>15415\n<6e43>5465\n<6e4a>3767\n<6e4d>5463\n<6e4e>5467\n<6e51>14718\n<6e56>1924\n<6e58>2477\n<6e5b>2935\n<6e5c>8525\n<6e5f>5457\n<6e67>3865\n<6e6b>5460\n<6e6e>5453\n<6e6f>3180\n<6e72>5456\n<6e76>5462\n<6e7e>4087\n<6e7f>2282\n<6e80>3756\n<6e82>5472\n<6e8c>3394\n<6e8f>5484\n<6e90>1903\n<6e96>2410\n<6e98>5474\n<6e9c>3959\n<6e9d>2004\n<6e9f>5487\n<6ea5>5485\n<6eaa>5473\n<6eab>13324\n<6eaf>5479\n<6eb2>5481\n<6eb6>3897\n<6eb7>5476\n<6ebd>5478\n<6ebf>8528\n<6ec2>5486\n<6ec4>5480\n<6ec5>3795\n<6ec7>14719\n<6ec9>5475\n<6eca>14720\n<6ecb>2254\n<6ecc>5499\n<6ece>14721\n<6ed1>1480\n<6ed3>5477\n<6ed9>15416\n<6edd>2892\n<6ede>2874\n<6ee6>15396\n<6eec>5491\n<6eef>5497\n<6ef2>5495\n<6ef4>3107\n<6ef7>5502\n<6ef8>5492\n<6efd>14722\n<6efe>5493\n<6eff>5469\n<6f01>1683\n<6f02>3500\n<6f06>2283\n<6f09>2057\n<6f0f>4057\n<6f11>5489\n<6f13>5501\n<6f14>1291\n<6f15>2792\n<6f1a>14723\n<6f20>3375\n<6f22>1533\n<6f2a>14724\n<6f2b>3757\n<6f2c>3054\n<6f2f>14725\n<6f31>5496\n<6f32>5498\n<6f33>14726\n<6f38>2740\n<6f3e>5500\n<6f3f>5494\n<6f41>5488\n<6f45>1535\n<6f51>7776\n<6f54>1855\n<6f58>5514\n<6f5a>14727\n<6f5b>5509\n<6f5c>2716\n<6f5e>14728\n<6f5f>1473\n<6f62>14729\n<6f64>2411\n<6f66>5518\n<6f6d>5511\n<6f6e>3016\n<6f6f>5508\n<6f70>3061\n<6f74>5543\n<6f78>5505\n<6f7a>5504\n<6f7c>5513\n<6f7d>14730\n<6f80>5507\n<6f81>5506\n<6f82>5512\n<6f84>2629\n<6f86>5503\n<6f88>8529\n<6f8b>14731\n<6f8d>14732\n<6f8e>5515\n<6f91>5516\n<6f92>14733\n<6f94>14734\n<6f97>1534\n<6f98>13884\n<6f9a>14735\n<6fa1>5521\n<6fa3>5520\n<6fa4>5522\n<6faa>5525\n<6fb1>3133\n<6fb3>5519\n<6fb5>8530\n<6fb6>14738\n<6fb9>5523\n<6fc0>1849\n<6fc1>2905\n<6fc2>5517\n<6fc3>3313\n<6fc6>5524\n<6fd4>5529\n<6fd5>5527\n<6fd8>5530\n<6fda>14739\n<6fdb>5533\n<6fde>14740\n<6fdf>5526\n<6fe0>2044\n<6fe1>3294\n<6fe4>5430\n<6feb>3934\n<6fec>5528\n<6fee>5532\n<6fef>2901\n<6ff1>5531\n<6ff3>5510\n<6ff5>8531\n<6ff6>7076\n<6ffa>5536\n<6ffe>5540\n<7001>5538\n<7005>8532\n<7006>7760\n<7007>8533\n<7009>5534\n<700b>5535\n<700f>5539\n<7011>5537\n<7018>5545\n<701a>5542\n<701b>5541\n<701d>5544\n<701f>5546\n<7027>2893\n<7028>8534\n<702c>2633\n<7030>5547\n<7032>5549\n<7039>14742\n<703c>14743\n<703e>5548\n<704c>5490\n<7051>5550\n<7054>14745\n<7063>5551\n<7064>14748\n<706b>1360\n<706c>14749\n<706f>3182\n<7070>1411\n<707d>2114\n<707e>14750\n<7081>14751\n<7085>8535\n<7089>4045\n<708a>2604\n<708e>1292\n<7092>5553\n<7095>14752\n<7099>5552\n<70ab>8536\n<70ac>5556\n<70ad>2936\n<70ae>5559\n<70af>5554\n<70b3>5558\n<70b7>14753\n<70b8>5557\n<70b9>3130\n<70ba>1181\n<70bb>8365\n<70c8>4029\n<70cb>5561\n<70cf>1226\n<70d8>14756\n<70d9>5563\n<70dc>14757\n<70dd>5562\n<70df>5560\n<70f1>5555\n<70f9>3665\n<70fd>5565\n<7104>8538\n<7107>14758\n<7109>5564\n<710f>8537\n<7114>1293\n<7119>5567\n<711a>3586\n<711c>5566\n<7120>14759\n<7121>3777\n<7126>2479\n<7130>7644\n<7131>14760\n<7136>2741\n<713c>2478\n<714a>14761\n<714c>5573\n<7155>5569\n<7156>5574\n<7159>1294\n<715c>8539\n<7160>14763\n<7162>5572\n<7164>3351\n<7165>5568\n<7166>5571\n<7167>2480\n<7169>3429\n<716c>5575\n<716e>2301\n<7179>14764\n<7184>5578\n<7188>5570\n<718a>1789\n<718f>5576\n<7192>14765\n<7194>3898\n<7195>5579\n<7199>8285\n<719f>2393\n<71a8>5580\n<71ac>5581\n<71b1>3300\n<71b9>5583\n<71be>5584\n<71c1>8543\n<71c3>3305\n<71c8>3183\n<71c9>5586\n<71cb>14767\n<71ce>5588\n<71d0>3997\n<71d2>5585\n<71d3>14768\n<71d4>5587\n<71d5>1295\n<71d6>14769\n<71d7>5582\n<71df>4430\n<71e0>5589\n<71e5>2793\n<71e6>2182\n<71e7>5591\n<71ec>5590\n<71ed>2538\n<71ee>4334\n<71f5>5592\n<71f9>5594\n<71fb>5577\n<71fc>5593\n<71fe>8544\n<71ff>5595\n<7200>14770\n<7206>3376\n<720d>5596\n<7210>5597\n<721b>5598\n<721d>14771\n<7228>5599\n<722a>3066\n<722b>14772\n<722c>5601\n<722d>5600\n<7230>5602\n<7232>5603\n<7235>2315\n<7236>3541\n<7238>14773\n<723d>2776\n<723e>2256\n<7241>14774\n<7246>5608\n<7247>3618\n<7248>3419\n<724b>5609\n<7252>3017\n<7253>14775\n<7258>5610\n<725b>1671\n<725c>14778\n<725d>3794\n<725f>3778\n<7261>1332\n<7262>4058\n<7267>3712\n<7269>3578\n<7272>2651\n<7274>5611\n<7279>3227\n<727d>1879\n<727e>5612\n<7280>2116\n<7281>5614\n<7282>5613\n<7287>5615\n<728d>14779\n<7292>5616\n<7296>5617\n<72a0>1624\n<72a2>5618\n<72a7>5619\n<72ac>1880\n<72ad>14780\n<72af>3420\n<72b1>8545\n<72b2>5621\n<72b4>14781\n<72b6>2525\n<72b9>5620\n<72be>8546\n<72c0>13355\n<72c2>1712\n<72c3>5622\n<72c4>5624\n<72c6>5623\n<72c7>14782\n<72ce>5625\n<72d0>1925\n<72d2>5626\n<72d7>1761\n<72d9>2754\n<72db>2063\n<72e0>5628\n<72e2>5627\n<72e9>2329\n<72ec>3232\n<72ed>1713\n<72f7>5631\n<72f8>2922\n<72f9>5630\n<72fb>14783\n<72fc>4059\n<72fd>3352\n<730a>5634\n<7316>5636\n<7317>5633\n<731b>3808\n<731c>5635\n<731d>5637\n<731f>3980\n<7324>8547\n<7325>5641\n<7328>14786\n<7329>5640\n<732a>2996\n<732b>3299\n<732e>1881\n<732f>5639\n<7331>14787\n<7334>5638\n<7336>3867\n<733e>5642\n<733f>1296\n<7343>14788\n<7344>2056\n<7345>2224\n<7357>5646\n<7363>2381\n<7368>5648\n<736a>5647\n<736c>14789\n<7370>5649\n<7372>1451\n<7375>5651\n<7377>8549\n<7378>5650\n<737a>5653\n<737b>5652\n<737c>14790\n<7383>14791\n<7384>1904\n<7387>3952\n<7389>1732\n<738b>1318\n<7395>14794\n<7396>1762\n<73a6>14798\n<73a8>15423\n<73a9>1565\n<73ab>14799\n<73b2>4016\n<73b3>5655\n<73b5>14800\n<73b7>14801\n<73ba>13802\n<73bb>5657\n<73bc>14802\n<73bd>8550\n<73c0>5658\n<73c2>1361\n<73c8>5654\n<73c9>8551\n<73ca>2183\n<73cd>3037\n<73ce>5656\n<73cf>14803\n<73d2>8554\n<73d6>8552\n<73d9>14804\n<73de>5661\n<73e0>2330\n<73e3>8553\n<73e4>15417\n<73e5>5659\n<73e9>14805\n<73ea>1812\n<73ed>3421\n<73ee>5660\n<73f1>5687\n<73f4>14806\n<73f5>8556\n<73f8>5666\n<73fd>14807\n<73fe>1905\n<7403>1663\n<7404>14808\n<7405>5663\n<7406>3943\n<7407>8555\n<7409>3960\n<740a>14809\n<7421>15418\n<7422>2902\n<7424>14812\n<7425>5665\n<7426>8557\n<7428>14813\n<7429>8559\n<742a>8558\n<742c>14814\n<742e>8560\n<7432>5667\n<7433>3998\n<7434>1743\n<7435>3472\n<7436>3328\n<7439>14818\n<743a>5668\n<743f>5670\n<7441>5673\n<7444>14819\n<7447>14820\n<744b>14821\n<744d>14822\n<7451>14823\n<7455>5669\n<7457>14824\n<7459>5672\n<745a>1950\n<745b>1263\n<745c>5674\n<745e>2614\n<745f>5671\n<7460>4004\n<7463>5677\n<7464>7477\n<7466>14825\n<7469>5675\n<746a>5678\n<746b>14826\n<746f>5664\n<7470>5676\n<7471>14827\n<7473>2092\n<7476>5679\n<747e>5680\n<7480>14828\n<7483>3944\n<7489>8562\n<748b>5681\n<7490>14832\n<7498>14833\n<749c>14834\n<749e>5682\n<749f>8563\n<74a0>14835\n<74a2>5662\n<74a3>14836\n<74a7>5683\n<74a8>14837\n<74ab>14838\n<74b0>1536\n<74b5>14839\n<74bd>2257\n<74bf>14840\n<74c8>14841\n<74ca>5684\n<74cf>5685\n<74d4>5686\n<74da>14842\n<74dc>1245\n<74de>14843\n<74e0>5688\n<74e2>3501\n<74e3>5689\n<74e6>1504\n<74e7>5690\n<74e9>5691\n<74ee>5692\n<74ef>14160\n<74f2>5693\n<74f6>3525\n<74f7>5697\n<74f8>5696\n<7501>8564\n<7503>5699\n<7504>5698\n<7505>5700\n<750c>5701\n<750d>5703\n<750e>5702\n<7513>5705\n<7518>1537\n<751a>2585\n<751c>3126\n<751e>5706\n<751f>2652\n<7522>13790\n<7523>2184\n<7525>1307\n<7528>3899\n<752b>3635\n<752c>5708\n<752f>8434\n<7530>3134\n<7531>3869\n<7532>2005\n<7533>2563\n<7537>2953\n<7538>4297\n<753a>3018\n<753b>1384\n<753c>5709\n<7544>5710\n<7546>5715\n<7549>5713\n<754a>5712\n<754b>5063\n<754c>1412\n<754d>5711\n<754e>14844\n<754f>1182\n<7551>3390\n<7554>3422\n<7559>3961\n<755a>5716\n<755b>5714\n<755c>2970\n<755d>2634\n<7560>3391\n<7562>3487\n<7564>5718\n<7565>3956\n<7566>1827\n<7567>5719\n<7569>5717\n<756a>3434\n<756b>5720\n<756c>15419\n<756d>5721\n<756f>8565\n<7570>1183\n<7573>2526\n<7574>5726\n<7575>14161\n<7576>5723\n<7577>3269\n<7578>5722\n<7579>14845\n<757f>1600\n<7581>14846\n<7582>5729\n<7589>5728\n<758a>5727\n<758b>3479\n<758e>2756\n<758f>2755\n<7590>14847\n<7591>1625\n<7594>5730\n<759a>5731\n<759d>5732\n<75a3>5734\n<75a5>5733\n<75ab>1272\n<75b1>5742\n<75b2>3452\n<75b3>5736\n<75b4>14850\n<75b5>5738\n<75b8>5740\n<75b9>2564\n<75bd>5739\n<75be>2284\n<75c2>5735\n<75c3>5737\n<75c5>3508\n<75c7>2481\n<75ca>5744\n<75cd>5743\n<75d2>5745\n<75d4>2258\n<75d5>2079\n<75d8>3185\n<75d9>5746\n<75db>3047\n<75de>5748\n<75e2>3945\n<75e3>5747\n<75e4>14851\n<75e9>2795\n<75ec>14162\n<75f0>5753\n<75f4>2962\n<75f9>14852\n<75fa>5754\n<75fc>5751\n<7600>14853\n<7601>5752\n<7609>5759\n<760a>14854\n<760b>5757\n<760d>5758\n<7619>14857\n<761e>14858\n<761f>5760\n<7624>5765\n<7627>5761\n<762d>14859\n<7630>5767\n<7634>5766\n<7635>14860\n<763b>5768\n<7642>3981\n<7643>14861\n<7646>5771\n<764b>14862\n<764c>1566\n<764e>14163\n<7652>3850\n<7656>3610\n<7658>5773\n<765c>5772\n<7665>14863\n<7667>5779\n<766c>5780\n<766d>14864\n<766f>14865\n<7670>5781\n<7671>14866\n<7672>5782\n<7674>14867\n<7676>5783\n<7678>5784\n<767a>3395\n<767b>3146\n<767c>5785\n<767d>3368\n<767e>3494\n<7680>5786\n<7682>8566\n<7683>5787\n<7684>3108\n<7686>1413\n<7687>2006\n<7688>5788\n<768b>5789\n<768e>5790\n<7690>2167\n<7693>5792\n<7696>5791\n<769b>8569\n<769c>8567\n<769e>8568\n<76a6>8570\n<76ae>3453\n<76b0>5795\n<76b4>5796\n<76b7>7452\n<76bf>2172\n<76c2>5800\n<76c3>3340\n<76c5>14870\n<76c6>3725\n<76c8>1264\n<76ca>1273\n<76cc>14871\n<76cd>5801\n<76d2>5803\n<76d6>5802\n<76d7>3178\n<76db>2653\n<76dc>5336\n<76de>5804\n<76df>3789\n<76e1>5805\n<76e3>1538\n<76e4>3435\n<76e5>5806\n<76e7>5807\n<76ea>5808\n<76ec>14872\n<76ee>3816\n<76f2>3809\n<76f4>3034\n<76f8>2796\n<76fb>5810\n<76fc>14873\n<76fe>2412\n<7701>2482\n<7704>5813\n<7707>5812\n<7708>5811\n<7709>3473\n<770b>1539\n<770c>1885\n<771b>5819\n<771e>5816\n<771f>2565\n<7720>3774\n<7724>5815\n<7729>5814\n<7734>14874\n<7736>14875\n<773a>3019\n<773c>1567\n<7740>2979\n<7746>8572\n<7747>5822\n<775a>5823\n<775b>5826\n<775c>14876\n<7761>2605\n<7762>7877\n<7763>3228\n<7765>5827\n<7766>3713\n<7768>5824\n<776a>14165\n<776b>5825\n<7772>14879\n<7779>5830\n<777d>14880\n<777e>5829\n<777f>5828\n<778b>5832\n<778e>5831\n<7791>5833\n<7795>14881\n<779e>5835\n<77a0>5834\n<77a9>14166\n<77aa>14882\n<77ac>2400\n<77ad>3982\n<77b0>5836\n<77b3>3215\n<77b6>5837\n<77b9>5838\n<77bb>5842\n<77bf>5839\n<77c7>5843\n<77cd>5844\n<77d7>5845\n<77da>5846\n<77db>3779\n<77dc>5847\n<77e2>3836\n<77e3>5848\n<77e5>2956\n<77e6>14883\n<77e7>3360\n<77e9>1763\n<77ed>2937\n<77ee>5849\n<77ef>1714\n<77f0>14884\n<77f3>2676\n<77f4>14885\n<77fc>5850\n<7802>2093\n<7806>14886\n<780c>5851\n<7812>5852\n<7814>1882\n<7815>2117\n<7820>5854\n<7821>8574\n<7822>14887\n<7825>3152\n<7826>2118\n<7827>1640\n<7830>14890\n<7832>3666\n<7834>3329\n<7835>14891\n<783a>3153\n<783f>2030\n<7845>5856\n<784e>8575\n<784f>13342\n<7851>15420\n<785d>2483\n<7864>8576\n<7868>14892\n<786b>3962\n<786c>2007\n<786f>1883\n<7872>3383\n<7874>5858\n<787a>8577\n<787c>5860\n<7881>1951\n<7886>5859\n<7887>3090\n<788c>5862\n<788d>1429\n<788e>5857\n<7891>3454\n<7893>1234\n<7895>2140\n<7897>4088\n<789a>5861\n<789e>14893\n<78a3>5863\n<78a7>3611\n<78a9>2685\n<78aa>5865\n<78af>5866\n<78b5>5864\n<78ba>1452\n<78bc>5872\n<78be>5871\n<78c1>2259\n<78c5>5873\n<78c6>5868\n<78c8>14894\n<78ca>5874\n<78cb>5869\n<78cc>14895\n<78ce>14896\n<78d0>3436\n<78d1>5867\n<78d4>5870\n<78da>5877\n<78e4>14897\n<78e7>5876\n<78e8>3727\n<78ec>5875\n<78ef>1199\n<78f2>14900\n<78f4>5879\n<78f7>14901\n<78fb>14902\n<78fd>5878\n<7901>2484\n<7907>5880\n<790e>2757\n<7911>5882\n<7912>5881\n<7919>5883\n<7926>5853\n<792a>5855\n<792b>5885\n<792c>5884\n<7930>8578\n<7931>14903\n<793a>2260\n<793b>14905\n<793c>4017\n<793d>14906\n<793e>2302\n<7940>5886\n<7945>14907\n<7948>1601\n<7949>2225\n<7950>3870\n<7953>5892\n<7955>5891\n<7956>2758\n<7957>5888\n<795a>5890\n<795d>2389\n<795e>2566\n<795f>5889\n<7960>5887\n<7962>3296\n<7965>2485\n<7968>3502\n<796d>2119\n<7977>3186\n<797a>5893\n<797f>5894\n<7980>5916\n<7981>1744\n<7984>4067\n<7985>2743\n<798a>5895\n<798b>14910\n<798d>1362\n<798e>3091\n<798f>3569\n<7994>8582\n<7996>14911\n<7998>14912\n<799b>8584\n<799d>5896\n<79a6>1684\n<79a7>5897\n<79aa>5899\n<79ae>5900\n<79b1>7758\n<79b3>5901\n<79b8>14913\n<79bb>14914\n<79bd>1745\n<79be>1363\n<79bf>3229\n<79c0>2354\n<79c1>2226\n<79c9>5904\n<79ca>14915\n<79cb>2355\n<79d1>1354\n<79d2>3509\n<79d5>5905\n<79d8>3455\n<79da>14916\n<79df>2759\n<79e1>5908\n<79e3>5909\n<79e6>2567\n<79e7>5906\n<79e9>2975\n<79ec>5907\n<79f0>2486\n<79fb>1184\n<7a00>1603\n<7a03>14917\n<7a05>13875\n<7a08>5910\n<7a09>14918\n<7a0b>3092\n<7a0d>5911\n<7a0e>2667\n<7a11>14919\n<7a14>3769\n<7a1a>2963\n<7a1c>3983\n<7a1e>14920\n<7a1f>5915\n<7a20>5914\n<7a2d>14921\n<7a2e>2331\n<7a31>5917\n<7a32>1204\n<7a37>5920\n<7a39>14922\n<7a3b>5918\n<7a3c>1364\n<7a3d>1828\n<7a3e>5919\n<7a3f>2008\n<7a40>2052\n<7a42>3638\n<7a43>5921\n<7a45>14923\n<7a46>3714\n<7a49>5923\n<7a4c>14924\n<7a4d>2677\n<7a4e>1265\n<7a4f>1338\n<7a50>1136\n<7a57>5922\n<7a5d>14925\n<7a63>2527\n<7a69>5926\n<7a6b>1453\n<7a6d>14927\n<7a70>5928\n<7a74>1856\n<7a76>1664\n<7a78>14928\n<7a79>5929\n<7a7a>1773\n<7a7d>5930\n<7a81>3237\n<7a83>2692\n<7a84>2149\n<7a88>5931\n<7a92>2976\n<7a93>2797\n<7a95>5933\n<7a96>5935\n<7a97>5932\n<7a98>5934\n<7a9f>1784\n<7aa0>14929\n<7aa3>14930\n<7aa9>5936\n<7aaa>1788\n<7aae>1665\n<7aaf>3900\n<7ab0>5938\n<7ab3>14931\n<7ab6>5939\n<7aba>1232\n<7abf>5942\n<7ac3>1492\n<7ac4>5941\n<7ac5>5940\n<7ac6>14934\n<7ac7>5944\n<7aca>5945\n<7acb>3953\n<7acd>5946\n<7acf>5947\n<7ad1>8585\n<7ad2>4549\n<7ad3>5949\n<7ad5>5948\n<7adc>3965\n<7add>5952\n<7adf>7176\n<7ae0>2487\n<7ae3>2401\n<7ae5>3216\n<7ae6>5955\n<7ae7>8586\n<7aea>2918\n<7aeb>8588\n<7aed>5956\n<7aef>2938\n<7af0>5957\n<7af6>1693\n<7af8>4214\n<7af9>2971\n<7afa>2271\n<7aff>1540\n<7b02>5958\n<7b04>5971\n<7b06>5961\n<7b07>14935\n<7b0a>5960\n<7b0b>5973\n<7b0f>5959\n<7b11>2488\n<7b14>14936\n<7b1b>3109\n<7b1e>5965\n<7b20>1468\n<7b25>2592\n<7b26>3542\n<7b27>14937\n<7b28>5967\n<7b2c>2888\n<7b31>14938\n<7b33>5962\n<7b35>5966\n<7b36>5968\n<7b39>2155\n<7b45>5975\n<7b46>3488\n<7b47>14939\n<7b48>3386\n<7b49>3187\n<7b4b>1746\n<7b4c>5974\n<7b4d>5972\n<7b4e>14940\n<7b4f>3401\n<7b50>5969\n<7b51>2972\n<7b52>3189\n<7b53>14173\n<7b54>3188\n<7b56>2150\n<7b5d>5993\n<7b60>14941\n<7b65>5977\n<7b67>5979\n<7b69>14942\n<7b6c>5982\n<7b6d>14943\n<7b6e>5983\n<7b72>14944\n<7b74>5978\n<7b7a>5970\n<7b86>3615\n<7b87>1365\n<7b8b>5990\n<7b8d>5987\n<7b8f>5992\n<7b91>14945\n<7b92>5991\n<7b94>3369\n<7b95>3763\n<7b97>2185\n<7b98>5985\n<7b99>5994\n<7b9a>5989\n<7b9c>5988\n<7b9d>5984\n<7b9e>8589\n<7b9f>5986\n<7ba1>1541\n<7baa>2939\n<7baf>14946\n<7bb1>3382\n<7bb4>5999\n<7bc0>2693\n<7bc1>5996\n<7bc4>3427\n<7bc6>6000\n<7bc9>2969\n<7bcb>5995\n<7bcc>5997\n<7bcf>5998\n<7bd7>14947\n<7bd9>14948\n<7be0>2288\n<7be4>3230\n<7be5>6006\n<7be6>6005\n<7be9>6002\n<7bed>4060\n<7bf3>6011\n<7bf6>6015\n<7bf7>6012\n<7c00>6008\n<7c07>6009\n<7c0b>14949\n<7c0d>6014\n<7c0f>14950\n<7c11>6003\n<7c12>4330\n<7c13>6010\n<7c14>6004\n<7c17>6013\n<7c1e>7739\n<7c1f>6019\n<7c20>14951\n<7c21>1542\n<7c23>6016\n<7c26>14952\n<7c27>6017\n<7c2a>6018\n<7c2b>6021\n<7c31>14953\n<7c36>14954\n<7c37>6020\n<7c38>3466\n<7c3d>6022\n<7c3f>3645\n<7c40>6027\n<7c43>6024\n<7c4c>6023\n<7c4d>2678\n<7c4f>6026\n<7c50>6028\n<7c51>14955\n<7c54>6025\n<7c56>6032\n<7c58>6029\n<7c59>14956\n<7c5f>6030\n<7c60>6007\n<7c64>6031\n<7c65>6033\n<7c67>14957\n<7c6c>6034\n<7c6e>14958\n<7c70>14959\n<7c73>3606\n<7c75>6035\n<7c7b>14094\n<7c81>1734\n<7c83>6036\n<7c89>3588\n<7c8b>2606\n<7c8d>3772\n<7c90>6037\n<7c92>3963\n<7c95>3370\n<7c97>2760\n<7c98>3306\n<7c9b>2391\n<7c9f>1156\n<7ca1>6042\n<7ca2>6040\n<7ca4>6038\n<7ca5>1501\n<7ca7>2489\n<7ca8>6043\n<7cab>6041\n<7cad>6039\n<7cae>6047\n<7cb1>6046\n<7cb2>6045\n<7cb3>6044\n<7cb9>6048\n<7cbc>14960\n<7cbd>6049\n<7cbe>2654\n<7cbf>14961\n<7cc0>6050\n<7cc2>6052\n<7cc5>6051\n<7cca>1926\n<7cce>2746\n<7cd2>6054\n<7cd6>3190\n<7cd7>14964\n<7cd8>6053\n<7cd9>14965\n<7cdc>6055\n<7cdd>14966\n<7cde>3589\n<7cdf>2798\n<7ce0>2009\n<7ce2>6056\n<7ce7>3984\n<7ceb>14967\n<7cef>6058\n<7cf2>6059\n<7cf4>6060\n<7cf6>6061\n<7cf8>2227\n<7cfa>6062\n<7cfb>1829\n<7cfe>1668\n<7d00>1604\n<7d02>6064\n<7d04>3839\n<7d05>2010\n<7d06>6063\n<7d0a>6067\n<7d0b>3826\n<7d0d>3314\n<7d10>3493\n<7d13>14971\n<7d14>2413\n<7d15>6066\n<7d17>2303\n<7d18>2011\n<7d19>2228\n<7d1a>1667\n<7d1b>3590\n<7d1c>6065\n<7d1d>14972\n<7d20>2761\n<7d21>3696\n<7d22>2151\n<7d23>14973\n<7d2b>2229\n<7d2c>3065\n<7d2e>6070\n<7d2f>4007\n<7d30>2121\n<7d32>6071\n<7d33>2568\n<7d35>6073\n<7d39>2490\n<7d3a>2080\n<7d3f>6072\n<7d41>14974\n<7d42>2356\n<7d43>1906\n<7d44>2762\n<7d45>6068\n<7d46>6074\n<7d48>8591\n<7d4b>6069\n<7d4c>1830\n<7d4e>6077\n<7d4f>6081\n<7d50>1857\n<7d53>14975\n<7d56>6076\n<7d59>14976\n<7d5b>6085\n<7d5d>14977\n<7d5e>2012\n<7d61>3927\n<7d62>1152\n<7d63>6082\n<7d66>1669\n<7d68>6079\n<7d6e>6080\n<7d71>3191\n<7d72>6078\n<7d73>6075\n<7d75>1414\n<7d76>2696\n<7d79>1884\n<7d7a>14978\n<7d7d>6087\n<7d86>14979\n<7d89>6084\n<7d8f>6086\n<7d93>6083\n<7d99>1831\n<7d9a>2835\n<7d9b>6088\n<7d9c>2800\n<7d9f>6101\n<7da0>8594\n<7da2>6097\n<7da3>6091\n<7dab>6095\n<7dac>2342\n<7dad>1185\n<7dae>6090\n<7daf>6098\n<7db0>6102\n<7db1>2013\n<7db2>3810\n<7db4>3058\n<7db5>6092\n<7db7>8593\n<7db8>6100\n<7dba>6089\n<7dbb>2940\n<7dbd>6094\n<7dbe>1153\n<7dbf>3798\n<7dc7>6093\n<7dca>1747\n<7dcb>3456\n<7dcc>14982\n<7dcf>2799\n<7dd1>3992\n<7dd2>2425\n<7dd5>6141\n<7dd6>8595\n<7dd8>6103\n<7dda>2722\n<7ddc>6099\n<7ddd>6104\n<7dde>6106\n<7de0>3093\n<7de1>6109\n<7de3>13322\n<7de4>6105\n<7de8>3620\n<7de9>1543\n<7deb>14983\n<7dec>3799\n<7def>1186\n<7df1>14984\n<7df2>6108\n<7df4>4037\n<7df9>14985\n<7dfb>6107\n<7e01>1297\n<7e04>3268\n<7e05>6110\n<7e08>14986\n<7e09>6117\n<7e0a>6111\n<7e0b>6118\n<7e11>14987\n<7e12>6114\n<7e15>14988\n<7e1b>3377\n<7e1e>2294\n<7e1f>6116\n<7e20>14989\n<7e21>6113\n<7e22>6119\n<7e23>6112\n<7e26>2382\n<7e2b>3667\n<7e2e>2390\n<7e31>6115\n<7e32>6127\n<7e35>6123\n<7e37>6126\n<7e39>6124\n<7e3a>6128\n<7e3b>6122\n<7e3d>6096\n<7e3e>2679\n<7e41>3423\n<7e43>6125\n<7e46>6120\n<7e47>14990\n<7e48>14183\n<7e4a>2723\n<7e4b>1832\n<7e4d>2357\n<7e52>8596\n<7e54>2539\n<7e55>2744\n<7e56>6131\n<7e5d>6130\n<7e5e>6132\n<7e61>7697\n<7e62>14991\n<7e66>6121\n<7e67>6129\n<7e69>6137\n<7e6a>6136\n<7e6b>7671\n<7e6d>3752\n<7e6e>14992\n<7e70>1793\n<7e73>14993\n<7e79>6135\n<7e7b>6139\n<7e7c>6138\n<7e7d>6142\n<7e7f>6144\n<7e82>2186\n<7e83>6140\n<7e8a>8359\n<7e8c>6147\n<7e8d>14994\n<7e8e>6153\n<7e8f>3125\n<7e90>6149\n<7e91>14995\n<7e92>6148\n<7e96>6152\n<7e98>14996\n<7f36>1544\n<7f38>6156\n<7f3a>6157\n<7f44>14997\n<7f45>6158\n<7f47>8597\n<7f4f>14998\n<7f54>6165\n<7f55>6164\n<7f58>6166\n<7f61>15001\n<7f67>6171\n<7f6a>2129\n<7f6b>1833\n<7f6e>2964\n<7f70>3399\n<7f72>2426\n<7f75>3331\n<7f77>3457\n<7f78>6172\n<7f79>4918\n<7f82>6173\n<7f83>6175\n<7f85>3919\n<7f86>6174\n<7f87>6177\n<7f88>6176\n<7f8a>3901\n<7f8c>6178\n<7f8e>3474\n<7f91>15002\n<7f94>6179\n<7f9a>6182\n<7f9d>6181\n<7f9e>6180\n<7fa1>8598\n<7fa3>6183\n<7fa4>1800\n<7fa8>2724\n<7fa9>1627\n<7fae>6187\n<7faf>6184\n<7fb2>6185\n<7fb6>6188\n<7fb8>6189\n<7fb9>6186\n<7fbd>1227\n<7fbf>15003\n<7fc1>1319\n<7fca>6193\n<7fcc>3916\n<7fce>15004\n<7fd2>2358\n<7fd4>6195\n<7fd5>6194\n<7fdf>15005\n<7fe0>2607\n<7fe1>6196\n<7fe5>15006\n<7fe6>6197\n<7fe9>6198\n<7fec>15007\n<7ff3>6199\n<7ff9>6200\n<7ffa>15010\n<7ffb>3723\n<7ffc>3917\n<8000>3902\n<8001>4061\n<8002>14099\n<8003>2015\n<8004>6203\n<8005>2304\n<8006>6202\n<800b>6204\n<800c>2261\n<800e>15011\n<8010>2865\n<8011>15012\n<8012>6205\n<8014>15013\n<8015>2014\n<8017>3811\n<801c>6208\n<8021>6209\n<8024>15014\n<8026>15015\n<8028>6210\n<8033>2262\n<8036>3833\n<803a>15016\n<803b>6212\n<803c>15017\n<803d>2941\n<803f>6211\n<8046>6214\n<804a>6213\n<8052>6215\n<8056>2655\n<8058>6216\n<805a>6217\n<805e>3593\n<805f>6218\n<8060>15018\n<8061>2801\n<8062>6219\n<8068>6220\n<806f>4038\n<8070>6223\n<8071>15019\n<8072>6222\n<8073>6221\n<8074>3020\n<8075>15020\n<8076>6224\n<8077>2540\n<8079>6225\n<807d>6226\n<807e>4062\n<807f>6227\n<8084>6228\n<8085>6230\n<8086>6229\n<8087>3385\n<8089>3281\n<808b>4068\n<808c>3389\n<8093>6232\n<8096>2491\n<8098>3484\n<809a>6233\n<809b>6231\n<809d>1546\n<809e>15021\n<80a1>1928\n<80a2>2230\n<80a5>3458\n<80a6>15022\n<80a9>1886\n<80aa>3697\n<80ab>15023\n<80ac>6236\n<80ad>6234\n<80af>2016\n<80b1>2017\n<80b2>1197\n<80b4>2136\n<80ba>3343\n<80c3>1187\n<80c4>6241\n<80c6>2942\n<80cc>3342\n<80ce>2875\n<80d6>6243\n<80d9>6239\n<80da>6242\n<80db>6237\n<80dd>6240\n<80de>3668\n<80e1>1929\n<80e4>1217\n<80e5>6238\n<80ef>6245\n<80f1>6246\n<80f4>3217\n<80f8>1715\n<80fc>6257\n<80fd>3315\n<8102>2231\n<8105>1716\n<8106>2668\n<8107>4076\n<8108>3770\n<8109>6244\n<810a>2680\n<8116>15026\n<8118>15027\n<811a>1645\n<811b>6247\n<8123>6249\n<8129>6248\n<812b>13913\n<812f>6250\n<8131>2916\n<8133>3316\n<8139>3021\n<813a>15028\n<813e>6254\n<8141>14194\n<8146>6253\n<814a>15029\n<814b>6251\n<814c>15030\n<814e>2587\n<8150>3543\n<8151>6256\n<8153>6255\n<8154>2018\n<8155>4089\n<815f>6272\n<816b>2332\n<816e>6259\n<8170>2058\n<8174>6262\n<8178>3022\n<8179>3570\n<817a>2725\n<8180>6266\n<8181>15031\n<8182>6267\n<8183>6263\n<8184>15032\n<8188>6264\n<818a>6265\n<818f>2019\n<8193>6273\n<8195>6269\n<819a>3544\n<819c>3738\n<819d>3482\n<81a0>6268\n<81a3>6271\n<81a4>6270\n<81a8>3698\n<81a9>6274\n<81b0>6275\n<81b3>2745\n<81b4>15033\n<81b5>6276\n<81b8>6278\n<81ba>6282\n<81bd>6279\n<81be>6277\n<81bf>3317\n<81c0>6280\n<81c2>6281\n<81c6>1330\n<81c8>6288\n<81c9>6283\n<81cd>6284\n<81cf>15034\n<81d1>6285\n<81d3>2817\n<81d8>6287\n<81d9>6286\n<81da>6289\n<81e3>2569\n<81e5>1385\n<81e7>6292\n<81e8>3999\n<81ea>2263\n<81ed>2359\n<81f3>2232\n<81f4>2965\n<81f9>15035\n<81fc>1235\n<81fe>6295\n<8203>15036\n<8205>6298\n<8207>6299\n<8208>1717\n<8209>5039\n<820a>6300\n<820c>2697\n<820d>6301\n<820e>2295\n<8210>6302\n<8212>4105\n<8216>6303\n<8217>3630\n<8218>1560\n<821b>2726\n<821c>2402\n<821e>3555\n<821f>2360\n<8221>15037\n<8229>6304\n<822a>2020\n<822b>6305\n<822c>3424\n<822e>6319\n<8232>15038\n<8233>6307\n<8234>15039\n<8235>2857\n<8236>3371\n<8237>1907\n<8238>6306\n<8239>2727\n<8240>6308\n<8246>15040\n<8247>3094\n<824b>15041\n<824f>15042\n<8259>6309\n<825a>6312\n<825d>6311\n<825f>6313\n<8262>6315\n<8264>6314\n<8266>1547\n<8268>6316\n<826e>2081\n<826f>3985\n<8271>6320\n<8272>2541\n<8276>1298\n<8279>14197\n<827e>6323\n<828b>1206\n<828d>6324\n<828e>15043\n<8299>3545\n<829d>2291\n<829f>6327\n<82a5>1415\n<82ab>6326\n<82ac>6329\n<82ad>3332\n<82ae>15044\n<82af>2570\n<82b1>1366\n<82b3>3669\n<82b7>15045\n<82b8>1843\n<82b9>1748\n<82bb>6328\n<82bd>1386\n<82be>15046\n<82c5>1503\n<82c6>15047\n<82d1>1299\n<82d2>6333\n<82d3>4018\n<82d4>2877\n<82d7>3510\n<82d9>6345\n<82db>1367\n<82dc>6343\n<82de>6341\n<82df>6332\n<82e1>6330\n<82e3>6331\n<82e5>2319\n<82e6>1764\n<82e7>2997\n<82eb>3241\n<82f1>1267\n<82f3>6335\n<82f4>6334\n<82f9>6340\n<82fa>6336\n<82fb>6339\n<82fe>15048\n<8301>8600\n<8302>3804\n<8303>6338\n<8304>1368\n<8305>1499\n<8306>6342\n<8309>6344\n<830e>1834\n<8316>6348\n<831c>1135\n<8323>6365\n<832b>6356\n<832f>6355\n<8331>6350\n<8332>6349\n<8334>6347\n<8335>6346\n<8336>2977\n<8338>2907\n<8339>6352\n<8340>6351\n<8343>15049\n<8345>6354\n<8349>2802\n<834a>1835\n<834f>1251\n<8350>6353\n<8351>15050\n<8352>2021\n<8355>15051\n<8358>2803\n<8362>8601\n<8373>6371\n<8375>6372\n<8377>1369\n<837b>1326\n<837c>6369\n<837f>8602\n<8385>6359\n<8386>15052\n<8387>6367\n<8389>6374\n<838a>6368\n<838d>15053\n<838e>6366\n<8392>15054\n<8393>6337\n<8396>6364\n<8398>15055\n<839a>6360\n<839e>1548\n<839f>6362\n<83a0>6373\n<83a2>6363\n<83a8>6375\n<83a9>15056\n<83aa>6361\n<83ab>3378\n<83b1>3923\n<83b5>6370\n<83bd>6392\n<83c1>6384\n<83c5>2625\n<83c7>8603\n<83ca>1632\n<83cc>1749\n<83ce>6379\n<83d3>1371\n<83d6>2492\n<83d8>6382\n<83dc>2122\n<83df>3147\n<83e0>6387\n<83e9>3646\n<83ea>15059\n<83eb>6378\n<83ef>1370\n<83f0>1930\n<83f1>3483\n<83f2>6388\n<83f4>6376\n<83f6>8604\n<83f7>6385\n<83fb>6395\n<83fd>6380\n<8403>6381\n<8404>3218\n<8407>6386\n<840a>7807\n<840b>6383\n<840c>3670\n<840d>6389\n<840e>1188\n<840f>15060\n<8411>15061\n<8413>6377\n<8420>6391\n<8422>6390\n<8429>3361\n<842a>6397\n<842c>6408\n<8431>1500\n<8435>6411\n<8438>6393\n<843c>6398\n<843d>3928\n<8446>6407\n<8448>8605\n<8449>3903\n<844a>15062\n<844e>3954\n<8457>2998\n<8461>3556\n<8462>6413\n<8463>3193\n<8466>1141\n<8469>6406\n<846b>6402\n<846c>2804\n<846d>6396\n<846e>6404\n<846f>6409\n<8471>3298\n<8475>1134\n<8476>15063\n<8477>6401\n<8479>6410\n<847a>3562\n<8482>6405\n<8484>6400\n<848b>2493\n<8490>2361\n<8494>2264\n<8499>3812\n<849c>3513\n<849f>6416\n<84a1>6425\n<84a8>15064\n<84ad>6403\n<84af>15065\n<84b2>1493\n<84b4>8606\n<84b8>2528\n<84b9>6414\n<84bb>6419\n<84bc>2805\n<84bf>6415\n<84c0>15066\n<84c1>6422\n<84c2>15067\n<84c4>2973\n<84c6>6423\n<84c9>3904\n<84ca>6412\n<84cb>1430\n<84cd>6418\n<84d0>6421\n<84d1>3768\n<84d6>6424\n<84d9>6417\n<84da>6420\n<84dc>8363\n<84ee>4039\n<84f0>15068\n<84f4>6428\n<84fc>6435\n<84fd>15069\n<84ff>6427\n<8500>2287\n<8506>6394\n<850c>15070\n<8513>3758\n<8514>6434\n<8515>6433\n<851a>1240\n<851f>6432\n<8521>6426\n<8523>7706\n<8526>3057\n<852c>6431\n<852d>1218\n<8534>15071\n<8535>2818\n<853e>7861\n<8540>6436\n<8541>6440\n<8543>3437\n<8548>6439\n<8549>2494\n<854a>2293\n<854b>6442\n<854e>1718\n<8553>8607\n<8555>6443\n<8557>3563\n<8558>6438\n<8559>8608\n<855a>6399\n<855e>15072\n<8563>6437\n<8568>4085\n<8569>3194\n<856a>3557\n<856b>8609\n<856d>6450\n<8577>6456\n<857e>6457\n<8580>6444\n<8584>3372\n<8587>6454\n<8588>6446\n<858a>6448\n<858f>15073\n<8590>6458\n<8591>6447\n<8594>6451\n<8597>1300\n<8599>3261\n<859b>6452\n<859c>6455\n<85a4>6445\n<85a6>2728\n<85a8>6449\n<85aa>2571\n<85ab>1798\n<85ac>3840\n<85ad>15076\n<85ae>3845\n<85b0>8611\n<85b7>15074\n<85b9>6462\n<85ba>6460\n<85c1>4084\n<85c9>6459\n<85cd>3935\n<85ce>15075\n<85cf>6461\n<85d0>6463\n<85d5>6464\n<85dc>6467\n<85dd>6465\n<85e4>3195\n<85e5>6466\n<85e9>3425\n<85ea>6453\n<85f4>14208\n<85f9>6468\n<85fa>6473\n<85fb>2806\n<85fe>6472\n<8602>6441\n<8606>6474\n<8607>2763\n<860a>6469\n<860b>6471\n<8612>15077\n<8613>6470\n<8616>5328\n<8617>5313\n<861a>6476\n<8622>6475\n<8629>15078\n<862d>3936\n<862f>5809\n<8630>6477\n<863f>6478\n<864d>6479\n<864e>1931\n<8650>1646\n<8652>15079\n<8655>4244\n<865a>1679\n<865b>13336\n<865c>3970\n<865e>1771\n<865f>6482\n<8663>15080\n<8667>6483\n<866b>2988\n<866c>15081\n<866f>15082\n<8671>6484\n<8679>3282\n<867a>15083\n<867b>1150\n<867d>14214\n<868a>1379\n<868d>15084\n<8691>15085\n<8693>6485\n<8695>2187\n<8698>15086\n<86a3>6486\n<86a4>3320\n<86ab>6498\n<86af>6492\n<86b0>6495\n<86b6>6491\n<86c4>6493\n<86c6>6494\n<86c7>2308\n<86c9>6496\n<86cb>2943\n<86cd>1836\n<86ce>1440\n<86d4>6499\n<86d9>1437\n<86db>6504\n<86de>6500\n<86df>6503\n<86e4>3406\n<86e9>6501\n<86ec>6502\n<86ed>3514\n<86ee>3438\n<86ef>6505\n<86f9>6515\n<86fa>15089\n<86fb>6511\n<86fd>15090\n<86fe>1387\n<8700>6509\n<8702>3672\n<8706>6507\n<8708>6508\n<8709>6513\n<870a>6516\n<870b>15091\n<870d>6514\n<8711>6512\n<8712>6506\n<8713>15092\n<8718>2966\n<8719>15093\n<871a>6523\n<871c>3766\n<871e>15094\n<8725>6521\n<8728>15095\n<8729>6522\n<8734>6517\n<8737>6519\n<873b>6520\n<873e>15096\n<873f>6518\n<8749>2698\n<874b>4063\n<874c>6527\n<874e>6528\n<8753>6534\n<8757>6530\n<8759>6533\n<875f>6525\n<8760>6524\n<8763>6535\n<8766>1372\n<8768>6531\n<876a>6536\n<876e>6532\n<8771>15097\n<8774>6529\n<8776>3023\n<8778>6526\n<877f>3358\n<8782>6540\n<8788>15098\n<878d>3877\n<8799>15099\n<879f>6539\n<87a2>6538\n<87ab>6547\n<87af>6541\n<87b3>6549\n<87b5>15102\n<87ba>3920\n<87bb>6552\n<87bd>6543\n<87c0>6544\n<87c4>6548\n<87c6>6551\n<87c7>6550\n<87cb>6542\n<87d0>6545\n<87d2>6562\n<87d6>15103\n<87e0>6555\n<87eb>15104\n<87ec>7715\n<87ed>15105\n<87ef>6553\n<87f2>6554\n<87f5>15421\n<87f9>1416\n<87fb>1628\n<87fe>6558\n<8801>15106\n<8806>15108\n<8807>8614\n<880b>15109\n<880d>6557\n<880e>6561\n<880f>6556\n<8811>6563\n<8814>15110\n<8815>6565\n<8816>6564\n<881c>15111\n<881f>7813\n<8821>6567\n<8822>6566\n<8823>6497\n<8827>6571\n<8831>6568\n<8836>6569\n<8839>6570\n<883b>6572\n<8840>1858\n<8842>6574\n<8844>6573\n<8846>2362\n<884c>2022\n<884d>5412\n<8852>6575\n<8853>2395\n<8856>15112\n<8857>1431\n<8859>6576\n<885b>1268\n<885d>2495\n<885e>6577\n<885f>15113\n<8861>2023\n<8862>6578\n<8863>1189\n<8864>15114\n<8868>3503\n<886b>6579\n<8870>2608\n<8872>6586\n<8875>6583\n<8877>2989\n<887d>6584\n<887e>6581\n<887f>1750\n<8881>6580\n<8882>6587\n<8888>1804\n<888b>2878\n<888d>6593\n<8892>6589\n<8896>2837\n<8897>6588\n<8898>15115\n<8899>6591\n<889e>6582\n<88a2>6592\n<88a4>6594\n<88aa>15116\n<88ab>3459\n<88ae>6590\n<88b0>6595\n<88b1>6597\n<88b4>1927\n<88b5>6585\n<88b7>1157\n<88bf>6596\n<88c1>2123\n<88c2>4030\n<88c5>2807\n<88c6>14217\n<88ca>15119\n<88cf>3946\n<88d2>15120\n<88d4>6600\n<88d5>3871\n<88db>15121\n<88dc>3636\n<88dd>6603\n<88df>2096\n<88e1>3947\n<88e8>6608\n<88f2>6609\n<88f3>2496\n<88f4>6607\n<88f5>8615\n<88f8>3921\n<88f9>6604\n<88fc>6606\n<88fd>2657\n<88fe>2628\n<8902>6605\n<8904>6610\n<8906>15124\n<8907>3571\n<890a>6612\n<890c>6611\n<8910>1482\n<8912>3673\n<8913>6613\n<891c>8360\n<891d>6625\n<891e>6615\n<8925>6616\n<8927>15128\n<8930>15129\n<8936>6622\n<8938>6623\n<893b>6621\n<893e>15130\n<8941>6619\n<8943>6614\n<8944>6620\n<894c>6624\n<894d>7120\n<895e>6627\n<895f>1751\n<8960>6626\n<8964>6629\n<8966>6628\n<896a>6631\n<896d>6630\n<896f>6632\n<8972>2363\n<8974>6633\n<8977>6634\n<897b>15131\n<897e>6635\n<897f>2658\n<8980>13870\n<8981>3905\n<8983>6636\n<8986>3572\n<8987>3324\n<8988>6637\n<898a>6638\n<898b>1887\n<898f>1606\n<8993>6639\n<8996>2233\n<8997>3319\n<8998>6640\n<899a>1454\n<89a1>6641\n<89a6>6643\n<89a7>3937\n<89a9>6642\n<89aa>2572\n<89ac>6644\n<89af>6645\n<89b2>6646\n<89b3>1549\n<89ba>6647\n<89bd>6648\n<89d2>1455\n<89d4>15132\n<89d6>15133\n<89da>6651\n<89e3>1394\n<89e5>15134\n<89e6>2542\n<89e7>6654\n<89f1>15135\n<89f4>6655\n<89f8>6656\n<8a00>1908\n<8a01>13756\n<8a02>3095\n<8a03>6657\n<8a07>15136\n<8a08>1837\n<8a0c>6660\n<8a0e>3196\n<8a0f>15137\n<8a10>6659\n<8a12>8616\n<8a13>1799\n<8a15>15138\n<8a16>6658\n<8a17>2903\n<8a18>1607\n<8a1b>6661\n<8a1f>2497\n<8a22>15139\n<8a23>1859\n<8a25>6663\n<8a2a>3674\n<8a2d>2691\n<8a31>1680\n<8a33>3841\n<8a34>2764\n<8a36>6664\n<8a37>8617\n<8a3a>2573\n<8a3c>2498\n<8a41>6665\n<8a46>6668\n<8a48>6669\n<8a4e>15140\n<8a50>2094\n<8a51>2850\n<8a52>6667\n<8a54>2499\n<8a55>3504\n<8a5b>6666\n<8a5e>2234\n<8a60>1269\n<8a62>6673\n<8a63>1838\n<8a66>2236\n<8a69>2235\n<8a6b>4083\n<8a6c>6672\n<8a6d>6671\n<8a70>1639\n<8a71>4073\n<8a72>1432\n<8a73>2500\n<8a79>8618\n<8a7c>6670\n<8a7f>15141\n<8a82>6675\n<8a84>6676\n<8a85>6674\n<8a87>1932\n<8a89>3882\n<8a8c>2237\n<8a8d>3293\n<8a91>6679\n<8a93>2660\n<8a95>2944\n<8a98>3872\n<8a9a>6682\n<8a9e>1952\n<8aa0>2659\n<8aa1>6678\n<8aa3>6683\n<8aa4>1953\n<8aa7>8619\n<8aa8>6677\n<8aaa>13880\n<8aac>2694\n<8aad>3233\n<8ab0>2925\n<8ab2>1373\n<8abc>1629\n<8abe>8620\n<8abf>3024\n<8ac2>6686\n<8ac4>6684\n<8ac7>2954\n<8acb>2661\n<8acc>1550\n<8acd>6685\n<8acf>2593\n<8ad2>3986\n<8ad6>4070\n<8ada>6687\n<8adb>6698\n<8adc>3025\n<8ade>6697\n<8adf>8621\n<8ae0>6694\n<8ae1>6702\n<8ae2>6695\n<8ae4>6691\n<8ae6>3096\n<8ae7>6690\n<8aeb>6688\n<8aed>3851\n<8aee>2238\n<8af1>6692\n<8af3>6689\n<8af4>15142\n<8af6>8623\n<8af7>6696\n<8af8>2430\n<8afe>2906\n<8b00>3699\n<8b01>1276\n<8b02>1190\n<8b04>3197\n<8b07>6700\n<8b0c>6699\n<8b10>6704\n<8b14>6693\n<8b16>6703\n<8b17>6705\n<8b19>1888\n<8b1a>6701\n<8b1b>2024\n<8b1d>2305\n<8b1f>15143\n<8b20>6706\n<8b21>3906\n<8b26>6709\n<8b28>6712\n<8b2b>6710\n<8b33>6707\n<8b37>15144\n<8b39>1752\n<8b3e>6711\n<8b41>6713\n<8b49>6717\n<8b4c>6714\n<8b4e>6716\n<8b4f>6715\n<8b53>8624\n<8b54>15147\n<8b56>6718\n<8b58>2269\n<8b5a>6720\n<8b5b>6719\n<8b5c>3546\n<8b5f>6722\n<8b66>1839\n<8b6b>6721\n<8b6c>6723\n<8b6f>6724\n<8b70>1630\n<8b71>6190\n<8b72>2529\n<8b74>6725\n<8b77>1954\n<8b7d>6726\n<8b80>6727\n<8b83>2188\n<8b8a>5075\n<8b8c>6728\n<8b8e>6729\n<8b90>2364\n<8b96>6732\n<8b9c>15148\n<8b9e>15149\n<8c37>2921\n<8c3a>6735\n<8c3f>6737\n<8c41>6736\n<8c46>3198\n<8c47>15150\n<8c48>6738\n<8c4a>3675\n<8c4c>6739\n<8c4e>6740\n<8c50>6741\n<8c54>15151\n<8c55>6742\n<8c5a>3250\n<8c61>2501\n<8c62>6743\n<8c6a>2045\n<8c6b>4103\n<8c6c>6744\n<8c73>15152\n<8c78>6745\n<8c7a>6746\n<8c7c>6754\n<8c82>6747\n<8c85>6749\n<8c89>6748\n<8c8a>6750\n<8c8c>3700\n<8c94>6753\n<8c98>6755\n<8c9d>1419\n<8c9e>3075\n<8ca0>3547\n<8ca1>2130\n<8ca2>2025\n<8ca4>15153\n<8ca7>3521\n<8ca8>1375\n<8ca9>3426\n<8caa>6758\n<8cab>1551\n<8cac>2681\n<8cad>6757\n<8cae>6762\n<8caf>2999\n<8cb0>3823\n<8cb4>1608\n<8cb6>6763\n<8cb7>3353\n<8cb8>2879\n<8cbb>3461\n<8cbc>3127\n<8cbd>6759\n<8cbf>3701\n<8cc0>1388\n<8cc1>6765\n<8cc2>4046\n<8cc3>3038\n<8cc4>4075\n<8cc7>2239\n<8cc8>6764\n<8cca>2833\n<8ccd>6781\n<8cce>2730\n<8cd1>3280\n<8cd3>3522\n<8cd9>15154\n<8cda>6768\n<8cdb>2189\n<8cdc>2240\n<8cde>2502\n<8ce0>3355\n<8ce1>15155\n<8ce2>1889\n<8ce3>6767\n<8ce4>6766\n<8ce6>3548\n<8cea>2285\n<8cf0>8626\n<8cf4>8627\n<8cf8>15156\n<8cfc>2026\n<8cfd>6769\n<8cfe>15157\n<8d07>6775\n<8d08>2819\n<8d0a>6774\n<8d0b>1570\n<8d0d>6777\n<8d0f>6776\n<8d10>6778\n<8d12>8628\n<8d13>6780\n<8d14>6782\n<8d16>6783\n<8d1b>15158\n<8d64>2682\n<8d66>2299\n<8d67>6784\n<8d69>15159\n<8d6b>1456\n<8d6c>15160\n<8d6d>6785\n<8d70>2808\n<8d71>6786\n<8d73>6787\n<8d74>3549\n<8d76>8629\n<8d77>1609\n<8d81>6788\n<8d84>15161\n<8d85>3026\n<8d8a>1277\n<8d8d>15162\n<8d95>15163\n<8d99>6789\n<8da3>2333\n<8da6>15164\n<8da8>2620\n<8db3>2829\n<8dba>6792\n<8dbe>6791\n<8dc2>6790\n<8dc6>15165\n<8dcb>6798\n<8dcc>6796\n<8dce>15166\n<8dcf>6793\n<8dd6>6795\n<8dda>6794\n<8ddb>6797\n<8ddd>1681\n<8ddf>6801\n<8de1>2683\n<8de3>6802\n<8de4>15167\n<8de8>1933\n<8dec>15168\n<8def>4047\n<8df3>3027\n<8df5>2731\n<8dfc>6803\n<8dff>6806\n<8e0a>3907\n<8e0f>3199\n<8e10>6809\n<8e1f>6810\n<8e20>15169\n<8e2a>6824\n<8e30>6813\n<8e34>6814\n<8e35>6812\n<8e42>6811\n<8e44>3097\n<8e47>6816\n<8e48>6820\n<8e49>6817\n<8e4a>6815\n<8e4b>15170\n<8e4c>6818\n<8e50>6819\n<8e55>6826\n<8e59>6821\n<8e5f>2684\n<8e60>6823\n<8e63>6825\n<8e64>6822\n<8e6c>15171\n<8e70>15172\n<8e72>6828\n<8e74>2365\n<8e76>6827\n<8e7a>15173\n<8e7c>6829\n<8e81>6830\n<8e84>6833\n<8e85>6832\n<8e87>6831\n<8e8a>6835\n<8e8b>6834\n<8e8d>3842\n<8e91>6837\n<8e92>15174\n<8e93>6836\n<8e94>6838\n<8e99>6839\n<8ea1>6841\n<8eaa>6840\n<8eab>2574\n<8eac>6842\n<8eae>15175\n<8eaf>1765\n<8eb0>6843\n<8eb1>6845\n<8eb3>15176\n<8eb6>14083\n<8ebe>6846\n<8ec0>7663\n<8ec5>6847\n<8ec6>6844\n<8ec8>6848\n<8eca>2306\n<8ecb>6849\n<8ecc>1610\n<8ecd>1801\n<8ecf>8631\n<8ed1>15177\n<8ed2>1890\n<8ed4>15178\n<8edb>6850\n<8edf>3272\n<8ee2>3128\n<8ee3>6851\n<8eeb>6854\n<8ef8>2272\n<8ef9>15179\n<8efb>6853\n<8efc>6852\n<8efd>1840\n<8efe>6855\n<8f03>1457\n<8f05>6857\n<8f09>2124\n<8f0a>6856\n<8f0c>6865\n<8f12>6859\n<8f13>6861\n<8f14>3637\n<8f15>6858\n<8f17>15180\n<8f19>6860\n<8f1b>6864\n<8f1c>6862\n<8f1d>1611\n<8f1f>6863\n<8f26>6866\n<8f29>3344\n<8f2a>4000\n<8f2f>2366\n<8f33>6867\n<8f36>15181\n<8f38>3852\n<8f39>6869\n<8f3b>6868\n<8f3e>6872\n<8f3f>3883\n<8f42>6871\n<8f44>1483\n<8f45>6870\n<8f46>6875\n<8f49>6874\n<8f4c>6873\n<8f4d>3116\n<8f4e>6876\n<8f57>6877\n<8f5c>6878\n<8f5f>2046\n<8f61>1787\n<8f9b>2575\n<8f9c>6882\n<8f9e>2265\n<8f9f>6883\n<8fa3>6884\n<8fa6>15182\n<8fa7>4278\n<8fa8>4277\n<8fad>6885\n<8fae>6143\n<8faf>6886\n<8fb0>2914\n<8fb1>2545\n<8fb2>3318\n<8fb7>6887\n<8fba>3621\n<8fbc>2064\n<8fc5>2589\n<8fc8>14233\n<8fce>1844\n<8fd1>1753\n<8fd4>3622\n<8fda>6888\n<8fe0>15186\n<8fe2>6890\n<8fe4>15187\n<8fe5>6889\n<8fe9>3278\n<8fea>6891\n<8feb>3373\n<8fed>3117\n<8fef>6892\n<8ff0>2396\n<8ff4>6894\n<8ff6>15188\n<8ff7>3790\n<8ff8>6909\n<8ffd>3045\n<9000>2880\n<9001>2809\n<9002>15189\n<9003>3200\n<9005>6895\n<9006>1647\n<900b>6904\n<900d>6901\n<900e>6914\n<900f>3201\n<9010>2974\n<9011>6898\n<9013>3098\n<9014>3149\n<9015>6899\n<9016>6903\n<901a>3048\n<901d>2662\n<901e>6902\n<901f>2830\n<9020>2820\n<9021>6900\n<9023>4040\n<9027>6905\n<902c>15190\n<902e>2881\n<9031>2367\n<9032>2576\n<9035>6907\n<9036>6906\n<9038>1203\n<9039>6908\n<903e>6916\n<9042>2609\n<9044>15191\n<9045>2967\n<9047>1776\n<9049>6915\n<904a>3873\n<904b>1249\n<904d>3623\n<904e>1377\n<9053>3219\n<9054>2913\n<9055>1191\n<9056>6917\n<9058>6918\n<9059>7476\n<905e>6919\n<9060>1301\n<9063>1891\n<9065>3908\n<9067>8634\n<9068>6920\n<9069>3110\n<906d>2810\n<906e>2307\n<906f>6921\n<9072>6924\n<9075>2415\n<9076>6922\n<9077>2733\n<9078>2732\n<907a>1192\n<907c>3987\n<907d>6926\n<907f>3462\n<9080>6928\n<9081>6927\n<9082>6925\n<9083>5943\n<9084>1552\n<9087>6893\n<9088>15192\n<9089>6930\n<908a>6929\n<908f>6931\n<9091>3874\n<9095>15193\n<9099>15194\n<909b>15195\n<90a2>15196\n<90a3>3257\n<90a6>3676\n<90a8>6932\n<90aa>2309\n<90af>6933\n<90b1>6934\n<90b4>15197\n<90b5>6935\n<90b8>3099\n<90c1>1198\n<90ca>2027\n<90ce>4064\n<90d7>15198\n<90db>6939\n<90dd>15199\n<90de>8635\n<90e1>1802\n<90e2>6936\n<90e4>6937\n<90e8>3558\n<90ed>1458\n<90f4>15200\n<90f5>3875\n<90f7>1719\n<90fd>3150\n<9102>6940\n<9112>6941\n<9115>8637\n<9117>15201\n<9119>6942\n<911c>15202\n<9127>8638\n<9130>6944\n<9131>15203\n<9132>6943\n<913a>15204\n<913d>15205\n<9148>15206\n<9149>3243\n<914a>6945\n<914c>2316\n<914d>3345\n<914e>2991\n<9152>2334\n<9154>2610\n<9156>6946\n<9158>6947\n<915b>15207\n<9161>15208\n<9162>2595\n<9163>6948\n<9164>15209\n<9165>6949\n<9169>6950\n<916a>3929\n<916c>2369\n<9172>6952\n<9173>6951\n<9175>2028\n<9177>2053\n<9178>2190\n<9182>6955\n<9187>2416\n<9189>6954\n<918b>6953\n<918d>2889\n<918e>15210\n<9190>1955\n<9192>2663\n<9197>3396\n<919c>2371\n<919e>15211\n<91a2>6956\n<91a4>2503\n<91a8>15212\n<91aa>6959\n<91ab>6957\n<91ac>7707\n<91af>6958\n<91b1>7777\n<91b2>15215\n<91b4>6961\n<91b5>6960\n<91b8>2530\n<91ba>6962\n<91bc>15216\n<91c6>3428\n<91c7>2115\n<91c8>2317\n<91c9>6965\n<91cb>6966\n<91cc>3948\n<91cd>2383\n<91ce>3834\n<91cf>3988\n<91d0>6967\n<91d1>1754\n<91d6>6968\n<91d7>8640\n<91d8>3101\n<91da>8639\n<91db>6971\n<91dd>2577\n<91de>8641\n<91df>6969\n<91e1>6970\n<91e3>3068\n<91e6>3715\n<91e7>1780\n<91f0>15217\n<91f7>15218\n<91fb>15219\n<91fc>6972\n<91ff>6976\n<9206>8646\n<9207>15220\n<920a>8648\n<920d>3255\n<920e>1441\n<9210>8647\n<9211>6980\n<9214>6977\n<9215>6979\n<921e>6975\n<9228>15221\n<9229>7050\n<922c>6978\n<9233>15222\n<9234>4019\n<9237>1934\n<9238>15223\n<9239>8655\n<923a>8649\n<923c>8651\n<923f>6988\n<9240>8650\n<9243>15224\n<9244>3118\n<9245>6983\n<9247>15225\n<9248>6986\n<9249>6984\n<924b>6989\n<924e>8652\n<924f>15226\n<9250>6990\n<9251>8654\n<9257>6982\n<9259>8653\n<925a>6995\n<925b>1302\n<925e>6981\n<9260>15227\n<9262>3393\n<9264>6985\n<9266>2504\n<9267>8656\n<9271>2029\n<927e>3702\n<9280>1756\n<9283>2384\n<9285>3220\n<9288>8362\n<9291>2735\n<9293>6993\n<9295>6987\n<9296>6992\n<9298>3791\n<929a>3028\n<929b>6994\n<929c>6991\n<92a7>8657\n<92ad>2734\n<92b3>13652\n<92b7>6998\n<92b9>6997\n<92c2>15228\n<92cf>6996\n<92d0>8663\n<92d2>3677\n<92d3>8667\n<92d5>8665\n<92d7>8661\n<92d9>8662\n<92df>15231\n<92e0>8666\n<92e4>2437\n<92e7>8660\n<92e9>6999\n<92ea>3631\n<92ed>1270\n<92f2>3512\n<92f3>2992\n<92f8>1682\n<92f9>8368\n<92fa>7001\n<92fb>8670\n<92fc>2031\n<92ff>8673\n<9302>8675\n<9304>13402\n<930d>15232\n<930f>7000\n<9310>2611\n<9315>15233\n<9318>2612\n<9319>7004\n<931a>7006\n<931d>8674\n<931e>8672\n<931f>15234\n<9320>2531\n<9321>8669\n<9322>7005\n<9323>7007\n<9325>8668\n<9326>1739\n<9327>15235\n<9328>3511\n<932b>2318\n<932c>4041\n<932e>7003\n<932f>2152\n<9332>4069\n<9335>7009\n<933a>7008\n<933b>7010\n<9344>7002\n<9347>15236\n<9348>8361\n<934a>13400\n<934b>3265\n<934d>3151\n<9352>15237\n<9354>3059\n<9356>7015\n<9357>8677\n<935b>2945\n<935c>7011\n<9360>7012\n<936a>15239\n<936c>1795\n<936d>15240\n<936e>7014\n<9370>8676\n<937c>7013\n<937e>2505\n<938c>1495\n<9394>7019\n<9396>2095\n<9397>2811\n<939b>15241\n<93a4>8678\n<93a7>1433\n<93a9>15243\n<93ae>3039\n<93b0>7016\n<93b9>7020\n<93ba>15242\n<93c1>15244\n<93c3>7026\n<93c6>8679\n<93c8>7029\n<93ca>15245\n<93d0>7028\n<93d1>3111\n<93d8>7025\n<93dd>7027\n<93de>8680\n<93e1>1720\n<93e2>15246\n<93e4>7030\n<93e5>7024\n<93e8>7023\n<93f8>8681\n<93fa>15247\n<93fd>15248\n<9403>7034\n<9407>7035\n<940f>15249\n<9410>7036\n<9413>7033\n<9414>7032\n<9418>2506\n<9419>3202\n<941a>7031\n<9421>7040\n<942b>7038\n<9431>8682\n<9434>15250\n<9435>7039\n<9436>7037\n<9438>2904\n<943a>7041\n<943f>15251\n<9441>7042\n<9444>7044\n<9445>8683\n<9448>8684\n<9451>1553\n<9452>7043\n<9455>15252\n<945a>7055\n<945b>7045\n<945e>7048\n<9460>7046\n<9462>7047\n<946a>7049\n<946b>15253\n<9470>7051\n<9472>15254\n<9475>7052\n<9477>7053\n<947c>7056\n<947d>7054\n<947e>7057\n<947f>7059\n<9481>7058\n<9577>3029\n<9578>15255\n<9580>3827\n<9582>7060\n<9583>2736\n<9587>7061\n<9589>3604\n<958a>7062\n<958b>1417\n<958f>1246\n<9591>1555\n<9592>8685\n<9593>1554\n<9594>7063\n<9596>7064\n<95a0>7067\n<95a2>1556\n<95a3>1459\n<95a4>2032\n<95a5>3402\n<95a6>15256\n<95a7>7069\n<95a8>7068\n<95a9>15257\n<95ad>7070\n<95b1>13653\n<95b2>1278\n<95b4>15259\n<95b9>7073\n<95bb>7072\n<95bc>7071\n<95bd>15260\n<95be>7074\n<95c3>7077\n<95c7>1163\n<95ca>7075\n<95cc>7079\n<95cd>7078\n<95d4>7081\n<95d5>7080\n<95d6>7082\n<95d8>3206\n<95da>15261\n<95dc>7083\n<95e1>7084\n<95e2>7086\n<95e5>7085\n<961c>3550\n<961d>15262\n<9621>7087\n<9628>7088\n<962a>2133\n<9632>3703\n<963b>2765\n<963f>1128\n<9640>2859\n<9641>15263\n<9642>7091\n<9644>3551\n<964b>7094\n<964c>7092\n<964d>2033\n<964f>7093\n<9650>1910\n<9658>15264\n<965b>3605\n<965c>7096\n<965d>7098\n<965e>7097\n<965f>7099\n<9662>1219\n<9663>2590\n<9664>2438\n<9665>1557\n<9666>7100\n<966a>3356\n<966c>7102\n<9670>1220\n<9672>7101\n<9673>3040\n<9675>3989\n<9676>3203\n<9677>7095\n<9678>3950\n<967a>1893\n<967d>3909\n<9684>15265\n<9685>1777\n<9686>3964\n<9688>1790\n<968a>2882\n<968b>6252\n<968d>7103\n<968e>1418\n<968f>2613\n<9694>1460\n<9695>7105\n<9697>7106\n<9698>7104\n<969b>2125\n<969c>2507\n<969d>8688\n<96a0>1221\n<96a3>4001\n<96a4>15266\n<96a7>7108\n<96a8>6923\n<96a9>15267\n<96aa>7107\n<96af>8689\n<96b0>7111\n<96b4>7112\n<96b6>7113\n<96b7>4020\n<96bb>2669\n<96bc>3407\n<96c0>2627\n<96c1>1571\n<96c4>3876\n<96c5>1389\n<96c6>2370\n<96c7>1935\n<96c9>7118\n<96cb>7117\n<96cc>2241\n<96cd>7119\n<96ce>7116\n<96d1>2166\n<96d2>15268\n<96d5>7123\n<96d6>6546\n<96d9>4331\n<96db>2621\n<96dc>7121\n<96de>15270\n<96e2>3949\n<96e3>3273\n<96e8>1229\n<96e9>15271\n<96ea>2695\n<96eb>2274\n<96f0>3591\n<96f1>15272\n<96f2>1250\n<96f6>4021\n<96f7>3925\n<96f9>7124\n<96fb>3135\n<9700>2343\n<9702>15273\n<9704>7125\n<9706>7126\n<9707>2578\n<9708>7127\n<9709>15274\n<970a>4022\n<970d>7122\n<970e>7129\n<970f>7131\n<9711>7130\n<9713>7128\n<9716>7132\n<9719>7133\n<971c>2812\n<971e>1378\n<9724>7134\n<9727>3780\n<972a>7135\n<9730>7136\n<9732>4048\n<9733>8690\n<9738>5140\n<9739>7137\n<973b>8691\n<9742>7143\n<9743>8692\n<9744>7140\n<9746>7141\n<9748>7142\n<9749>7144\n<974d>8693\n<974f>8694\n<9751>8695\n<9752>2664\n<9756>3843\n<9759>2665\n<975a>15275\n<975c>7145\n<975e>3463\n<9760>7146\n<9761>7430\n<9762>3800\n<9763>15276\n<9764>7147\n<9766>7148\n<9768>7149\n<9769>1461\n<976b>7151\n<976d>2591\n<976e>15277\n<9773>15278\n<9774>1786\n<9779>7153\n<977a>7157\n<977c>7155\n<9781>7156\n<9785>7154\n<9786>7158\n<978b>7159\n<978d>1164\n<979a>15279\n<979c>7162\n<97a0>1633\n<97a2>15280\n<97a3>7165\n<97a6>7164\n<97a8>7163\n<97ab>6708\n<97c3>7168\n<97c6>7169\n<97c8>7170\n<97cb>7171\n<97d3>1558\n<97d9>15283\n<97dc>7172\n<97de>15284\n<97ed>7173\n<97ee>3289\n<97f2>7175\n<97f3>1339\n<97f4>15285\n<97f5>7178\n<97f6>7177\n<97fb>1222\n<97ff>1721\n<9801>3607\n<9802>3030\n<9803>2066\n<9805>2034\n<9806>2417\n<9808>2594\n<980a>15286\n<980c>7180\n<980e>15287\n<980f>7179\n<9810>3884\n<9811>1572\n<9812>3430\n<9813>3252\n<9817>2626\n<9818>3990\n<981a>1841\n<981e>15288\n<9821>7183\n<9823>15289\n<9824>7182\n<982b>15290\n<982c>3705\n<982d>3204\n<9830>7795\n<9834>1266\n<9837>7184\n<9838>7181\n<9839>14259\n<983b>3523\n<983c>3924\n<983d>7185\n<983e>15291\n<9846>7186\n<984b>7188\n<984c>2890\n<984f>7187\n<9854>1573\n<9855>1894\n<9857>8697\n<9858>1574\n<9859>15294\n<985a>7752\n<985b>3129\n<985e>4008\n<9865>8698\n<9867>1936\n<986b>7189\n<986c>15295\n<9873>7194\n<9874>7193\n<98a8>3561\n<98aa>7195\n<98af>7196\n<98b1>7197\n<98b6>7198\n<98b8>15296\n<98ba>15297\n<98bf>15298\n<98c3>7200\n<98c4>7199\n<98c6>7201\n<98c8>15299\n<98db>3464\n<98dc>6201\n<98df>2543\n<98e0>13848\n<98e2>1612\n<98e5>15300\n<98e9>7202\n<98eb>7203\n<98ed>4289\n<98ee>5338\n<98ef>3431\n<98f2>1215\n<98fc>2242\n<98fd>3678\n<98fe>2534\n<9903>7204\n<9909>7205\n<990a>3910\n<9912>7206\n<9913>1390\n<9914>7207\n<9918>7208\n<9920>7213\n<9921>7209\n<9924>7212\n<9927>8701\n<9928>1559\n<992c>7214\n<992e>7215\n<9940>15303\n<9942>7218\n<9945>7220\n<9949>7219\n<994b>7222\n<994c>7225\n<994d>15304\n<9950>7221\n<9955>7226\n<995c>15305\n<995f>15306\n<9996>2335\n<9999>2035\n<999e>8703\n<99a5>7229\n<99a8>1436\n<99ac>3333\n<99b1>15307\n<99b3>2968\n<99b4>3267\n<99bc>7232\n<99c4>2860\n<99c5>1274\n<99c6>1766\n<99c8>1767\n<99c9>15310\n<99d0>2993\n<99d1>7237\n<99d2>1768\n<99d5>1391\n<99d8>7236\n<99db>7234\n<99dd>7235\n<99df>7233\n<99e2>7247\n<99f8>7243\n<99fb>7242\n<99ff>2403\n<9a01>7244\n<9a02>15311\n<9a05>7246\n<9a08>14266\n<9a0e>1613\n<9a0f>7245\n<9a12>2813\n<9a13>1895\n<9a16>15312\n<9a24>15313\n<9a27>15314\n<9a28>2861\n<9a2b>7249\n<9a30>3205\n<9a36>15317\n<9a37>7250\n<9a38>15318\n<9a3e>7255\n<9a40>7253\n<9a42>7252\n<9a43>7254\n<9a45>7251\n<9a4d>7257\n<9a4e>8704\n<9a52>7727\n<9a55>7256\n<9a56>15320\n<9a57>7259\n<9a5a>1723\n<9a5b>7258\n<9a5f>7260\n<9a62>7261\n<9a64>7263\n<9a65>7262\n<9a69>7264\n<9a6a>7266\n<9a6b>7265\n<9aa8>2062\n<9aad>7267\n<9ab0>7268\n<9ab8>1434\n<9abc>7269\n<9ac0>7270\n<9ac4>2615\n<9acf>7271\n<9ad1>7272\n<9ad8>2036\n<9ad9>8705\n<9adc>8706\n<9ae6>7279\n<9aea>3397\n<9aeb>7281\n<9aed>3480\n<9aee>7282\n<9aef>7280\n<9af1>7284\n<9af4>7283\n<9af7>7285\n<9af9>15323\n<9afb>7286\n<9b03>15324\n<9b06>7287\n<9b18>7288\n<9b1a>7289\n<9b1f>7290\n<9b20>15325\n<9b25>7293\n<9b31>5332\n<9b32>7300\n<9b3b>6057\n<9b3c>1614\n<9b41>1407\n<9b42>2082\n<9b43>7302\n<9b44>7301\n<9b45>3761\n<9b4f>7303\n<9b51>7306\n<9b54>3728\n<9b58>7307\n<9b5a>1685\n<9b6f>4043\n<9b72>8708\n<9b73>15328\n<9b74>7308\n<9b75>8707\n<9b79>15329\n<9b83>7310\n<9b8e>1154\n<9b8f>8709\n<9b91>7311\n<9b92>3579\n<9b93>7309\n<9ba7>15330\n<9ba8>7316\n<9baa>3740\n<9bad>2154\n<9bae>2737\n<9bb1>8710\n<9bb4>7317\n<9bb9>7320\n<9bbb>8711\n<9bc0>7318\n<9bc1>15331\n<9bc6>7321\n<9bc7>15332\n<9bc9>1957\n<9bca>7319\n<9bcf>7322\n<9bd4>7328\n<9bd7>15333\n<9bdb>2884\n<9bdf>14271\n<9be1>7329\n<9be2>7326\n<9be3>7325\n<9be4>7327\n<9be7>15334\n<9be8>1845\n<9beb>15335\n<9bf0>7333\n<9bf1>7332\n<9bf2>7331\n<9bf5>1143\n<9bf7>15336\n<9bfa>15337\n<9bfd>15338\n<9c00>8712\n<9c04>7343\n<9c06>7339\n<9c08>7340\n<9c09>7336\n<9c0a>7342\n<9c0b>15339\n<9c0c>7338\n<9c0d>1472\n<9c10>4082\n<9c12>7341\n<9c13>7337\n<9c14>7335\n<9c15>7334\n<9c1b>7345\n<9c21>7348\n<9c24>7347\n<9c25>7346\n<9c27>15340\n<9c2a>15341\n<9c2d>3515\n<9c2e>7344\n<9c30>7349\n<9c32>7351\n<9c36>15342\n<9c39>1485\n<9c3a>7330\n<9c3b>1241\n<9c3e>7353\n<9c41>15343\n<9c46>7352\n<9c47>7350\n<9c48>2923\n<9c53>15344\n<9c57>4002\n<9c5a>7354\n<9c60>7355\n<9c63>15345\n<9c67>7356\n<9c76>7357\n<9c77>15347\n<9c78>7358\n<9ce5>3031\n<9ce7>7359\n<9ce9>3403\n<9ceb>7364\n<9cec>7360\n<9cf0>7361\n<9cf3>3679\n<9cf4>3792\n<9cf6>3240\n<9d02>15348\n<9d03>7365\n<9d06>7366\n<9d07>3222\n<9d08>7363\n<9d0e>1322\n<9d12>7374\n<9d15>7373\n<9d1b>1303\n<9d1f>7371\n<9d23>7370\n<9d26>7368\n<9d28>1497\n<9d2a>7367\n<9d2b>2270\n<9d2c>1321\n<9d3b>2037\n<9d3e>7377\n<9d3f>7376\n<9d41>7375\n<9d42>15349\n<9d44>7372\n<9d46>7378\n<9d47>15350\n<9d48>7379\n<9d50>7384\n<9d51>7383\n<9d59>7385\n<9d5c>1231\n<9d61>3781\n<9d63>15351\n<9d64>7382\n<9d69>15352\n<9d6b>8714\n<9d6c>3680\n<9d6f>7390\n<9d70>8713\n<9d72>7386\n<9d7a>7391\n<9d7c>15353\n<9d7e>15354\n<9d87>7388\n<9d89>7387\n<9d8d>15355\n<9d8f>1842\n<9d9a>7392\n<9da4>7393\n<9da9>7394\n<9dab>7389\n<9daf>7369\n<9db1>15356\n<9db2>7395\n<9db4>3069\n<9db8>7399\n<9dba>7400\n<9dbb>7398\n<9dc1>7397\n<9dc2>7403\n<9dc3>15357\n<9dc4>7396\n<9dc6>7401\n<9dc7>15358\n<9dcf>7402\n<9dd3>7405\n<9dd6>15359\n<9dd7>7646\n<9dd9>7404\n<9ddf>15360\n<9de6>7407\n<9deb>15361\n<9ded>7408\n<9def>7409\n<9df2>4079\n<9df4>15362\n<9df8>7406\n<9df9>2891\n<9dfa>2141\n<9dfd>7410\n<9e15>15363\n<9e19>8716\n<9e1d>15364\n<9e1e>7413\n<9e75>7414\n<9e78>1896\n<9e79>7415\n<9e7c>7677\n<9e7d>7416\n<9e7f>2267\n<9e81>7417\n<9e88>7418\n<9e91>7423\n<9e92>7421\n<9e93>4066\n<9e95>7422\n<9e97>4023\n<9e9d>7424\n<9e9f>4003\n<9ea4>15365\n<9ea5>7425\n<9ea6>3380\n<9ea8>15366\n<9ea9>7426\n<9eaa>7428\n<9eac>15367\n<9ead>7429\n<9eb4>7682\n<9eb5>7797\n<9eb8>7427\n<9eb9>2047\n<9eba>3801\n<9ebb>3729\n<9ebc>4740\n<9ebe>5375\n<9ebf>3753\n<9ec3>13323\n<9ec4>1323\n<9ecc>7431\n<9ecd>1642\n<9ed1>8717\n<9ed2>2055\n<9ed4>7435\n<9ed8>5645\n<9ed9>3815\n<9edb>2883\n<9edc>7436\n<9edd>7438\n<9ede>7437\n<9ee0>7439\n<9ee5>7440\n<9ee7>15368\n<9ee8>7441\n<9eee>15369\n<9eef>7442\n<9ef4>7443\n<9ef9>7446\n<9f0e>3102\n<9f10>15370\n<9f12>15371\n<9f13>1937\n<9f15>7453\n<9f17>15372\n<9f19>15373\n<9f20>2767\n<9f21>7454\n<9f2c>7455\n<9f2f>15374\n<9f37>15375\n<9f39>15376\n<9f3b>3475\n<9f3e>7456\n<9f41>15377\n<9f45>15378\n<9f4a>7457\n<9f4b>5898\n<9f4e>6779\n<9f4f>7174\n<9f52>7458\n<9f54>7459\n<9f57>15379\n<9f62>4024\n<9f63>7460\n<9f68>15380\n<9f6a>7467\n<9f6c>7466\n<9f71>15381\n<9f72>7469\n<9f75>15382\n<9f76>7470\n<9f77>7468\n<9f8d>3966\n<9f90>15383\n<9f94>15384\n<9f95>7471\n<9f9c>7472\n<9f9d>5927\n<9fa0>7473\n<9fa2>15385\n<fa0e>8410\n<fa0f>8421\n<fa12>8481\n<fa13>8497\n<fa14>8499\n<fa16>8548\n<fa17>8571\n<fa1b>8583\n<fa1c>8587\n<fa1d>8590\n<fa1e>8599\n<fa1f>8610\n<fa21>8613\n<fa22>8622\n<fa23>8630\n<fa25>8633\n<fa26>8636\n<fa27>8664\n<fa28>8671\n<fa29>8687\n<fa2c>8702\n<fa2d>8715\n<fb00>9358\n<fe30>7898\n<fe33>7890\n<ff01>642\n<ff02>8007\n<ff03>716\n<ff04>712\n<ff05>715\n<ff06>717\n<ff07>8006\n<ff0a>718\n<ff0b>692\n<ff0c>636\n<ff0d>693\n<ff0e>637\n<ff0f>663\n<ff1c>699\n<ff1d>697\n<ff1e>700\n<ff1f>641\n<ff20>719\n<ff3b>678\n<ff3c>664\n<ff3d>679\n<ff3e>648\n<ff3f>650\n<ff40>646\n<ff5b>680\n<ff5c>667\n<ff5d>681\n<ff5e>665\n<ffe2>751\n<ffe3>649\n<ffe4>8005\n<ffe5>711\n<ffe8>323\nendcidchar\nbegincidrange\n<20><5b>1\n<5d><7b>62\n<a1><a3>101\n<b2><b3>157\n<bc><be>161\n<c0><c5>164\n<c7><d6>170\n<d9><de>187\n<e0><e5>193\n<e7><f6>199\n<f9><ff>216\n<0301><0302>127\n<0306><0308>130\n<0391><03a1>1011\n<03a3><03a9>1028\n<03b1><03c1>1035\n<03c3><03c9>1052\n<0410><0415>1059\n<0416><0435>1066\n<0436><044f>1099\n<2020><2021>776\n<2039><203a>110\n<2074><2079>9378\n<2080><2089>9384\n<2153><2154>9375\n<215b><215e>9371\n<2160><2169>7575\n<216a><216b>8225\n<2170><2179>8092\n<217a><217b>8298\n<2190><2191>737\n<2196><2197>12204\n<2198><2199>12202\n<21c4><21c5>8310\n<2460><2473>7555\n<2474><2487>8071\n<2488><2490>8062\n<249c><24b5>8112\n<24b6><24cf>10339\n<24d0><24e9>10313\n<2500><254b>7479\n<256d><256e>8247\n<2571><2573>8261\n<2581><2588>8230\n<2594><2595>8245\n<25e2><25e3>8255\n<2600><2603>8215\n<261c><261d>8220\n<2668><2669>12098\n<2776><277e>8286\n<2e8c><2e8d>13833\n<2ea1><2ea2>14689\n<2ebe><2ec0>14197\n<2f14><2f15>4301\n<2f21><2f22>4538\n<2fbf><2fc0>7299\n<2fd1><2fd2>7457\n<2fd4><2fd5>7472\n<3000><3002>633\n<3005><3007>657\n<3008><3011>682\n<3014><3015>676\n<3033><3035>12108\n<3041><3093>842\n<309b><309c>643\n<309d><309e>653\n<30a1><30f6>925\n<30f7><30fa>8313\n<30fd><30fe>651\n<3220><3229>10126\n<322a><322f>8198\n<3231><3232>7618\n<3280><3289>10461\n<328a><328f>10472\n<32a0><32a1>10486\n<32a4><32a8>7613\n<32d0><32fe>10413\n<3301><3302>11874\n<330e><3313>11889\n<331a><331d>11900\n<331f><3321>11904\n<3328><3329>11912\n<332e><3330>11918\n<3334><3335>11924\n<333e><3340>11936\n<3343><3346>11939\n<334b><334c>11944\n<334f><3350>11946\n<3355><3356>11955\n<3385><3387>8031\n<3388><3389>8192\n<338e><338f>7604\n<339c><339e>7601\n<33a4><33a5>8022\n<33d7><33d8>11869\n<4e04><4e05>14296\n<4e2f><4e30>14300\n<4e40><4e41>14302\n<4e9e><4ea0>4108\n<4eab><4eac>1687\n<4f7d><4f7e>14321\n<4fe4><4fe5>4152\n<5000><5001>14327\n<50c9><50ca>4184\n<5101><5102>4197\n<513f><5140>4208\n<5169><516a>4215\n<5195><5196>4226\n<51a9><51ab>4231\n<51b1><51b2>4235\n<5201><5202>14355\n<524b><524c>4261\n<52ac><52ad>4279\n<52f8><52f9>4293\n<530a><530b>14364\n<542c><542d>4342\n<54e5><54e6>4378\n<5556><5557>4394\n<560e><560f>14397\n<5671><5672>14407\n<56ac><56ad>14411\n<5733><5734>14421\n<5737><5738>4475\n<57d2><57d3>4496\n<57f5><57f6>14430\n<58fb><58fd>4535\n<592c><592d>4544\n<59d9><59da>4571\n<59e3><59e4>14452\n<5a35><5a36>4582\n<5afa><5afb>4597\n<5b5a><5b5b>4612\n<5b7e><5b7f>14473\n<5c07><5c08>4641\n<5c38><5c39>4648\n<5db8><5db9>8446\n<5e14><5e15>14499\n<5e36><5e37>4725\n<5e6b><5e6c>14504\n<5e75><5e76>4737\n<5ebe><5ebf>14508\n<5ec1><5ec2>4743\n<5eda><5edb>4751\n<5ee8><5ee9>4755\n<5f1c><5f1d>14514\n<5f56><5f57>4780\n<5fd8><5fd9>3688\n<6096><6097>4844\n<60f6><60f7>4862\n<610d><610e>4871\n<6112><6114>14547\n<6158><615a>4887\n<6208><6209>4930\n<6232><6233>4941\n<6292><6293>4954\n<6342><6343>14570\n<64be><64bf>14588\n<64e0><64e1>5040\n<6534><6535>5058\n<6582><6583>5073\n<65e0><65e1>5088\n<6635><6636>5096\n<665b><665c>14605\n<6667><6668>5107\n<6726><6727>5138\n<6763><6764>5151\n<6830><6831>14627\n<68f0><68f1>14640\n<697f><6980>14650\n<69d6><69d7>14655\n<6a50><6a51>14664\n<6a9d><6a9f>14671\n<6aa2><6aa3>5310\n<6b78><6b79>5348\n<6b7f><6b80>5350\n<6baa><6bab>5359\n<6c13><6c14>5377\n<6ceb><6cec>14701\n<6ed4><6ed5>5482\n<6fa7><6fa8>14736\n<705d><705e>14746\n<70d3><70d4>14754\n<7146><7147>8540\n<723b><723c>5604\n<723f><7240>5606\n<7255><7256>14776\n<7304><7305>14784\n<734e><734f>5643\n<7385><7386>14792\n<739e><73a0>14795\n<741a><741b>14810\n<742f><7431>14815\n<7485><7487>14829\n<74f0><74f1>5694\n<7586><7587>5724\n<7592><7593>14848\n<75f2><75f3>5755\n<75fe><75ff>5749\n<7615><7616>14855\n<7620><7622>5762\n<7647><7648>5769\n<7661><7662>5774\n<7668><766a>5776\n<7699><769a>5793\n<76a4><76a5>14868\n<76b8><76ba>5797\n<7725><7726>5817\n<7737><7738>5820\n<775f><7760>14877\n<77bc><77bd>5840\n<782d><782e>14888\n<78e0><78e1>14898\n<795b><795c>14908\n<79b9><79ba>5902\n<7a18><7a19>5912\n<7a61><7a62>5924\n<7abb><7abc>14932\n<7ad9><7ada>5950\n<7ae1><7ae2>5953\n<7b18><7b19>5963\n<7b70><7b71>5980\n<7cc8><7cc9>14962\n<7d07><7d09>14968\n<7d8b><7d8c>14980\n<7e59><7e5a>6133\n<7e88><7e89>6145\n<7e93><7e94>6150\n<7e9b><7e9c>6154\n<7f4c><7f4e>6159\n<7f50><7f51>6162\n<7f52><7f53>14999\n<7f5f><7f60>6167\n<7f68><7f69>6169\n<7fc5><7fc6>6191\n<7fee><7fef>15008\n<8018><8019>6206\n<80d7><80d8>15024\n<8165><8166>6260\n<81df><81e0>6290\n<81fa><81fb>6293\n<8201><8202>6296\n<826a><826b>6317\n<8277><8278>6321\n<8317><8318>6357\n<83bf><83c0>15057\n<8517><8518>6429\n<868b><868c>6489\n<86a7><86a8>15087\n<86a9><86aa>6487\n<87ac><87ad>15100\n<87f6><87f7>6559\n<88bd><88be>15117\n<88c3><88c4>6598\n<88d8><88d9>6601\n<88f0><88f1>15122\n<8918><891a>15125\n<892a><892b>6617\n<89bf><89c0>6649\n<89dc><89dd>6652\n<8aa5><8aa6>6680\n<8b43><8b44>15145\n<8b92><8b93>6730\n<8b99><8b9a>6733\n<8c8d><8c8e>6751\n<8cb2><8cb3>6760\n<8cfa><8cfb>6770\n<8d04><8d05>6772\n<8dea><8deb>6799\n<8e08><8e09>6804\n<8e1d><8e1e>6807\n<8f62><8f64>6879\n<8fb5><8fb6>15183\n<8ff9><8ffa>6896\n<904f><9052>6910\n<91ad><91ae>15213\n<91c0><91c1>6963\n<91e4><91e5>8644\n<91ed><91ee>8642\n<91f5><91f6>6973\n<9277><9278>8658\n<92cb><92cc>15229\n<93ac><93ad>7017\n<93d6><93d7>7021\n<9598><9599>7065\n<962e><962f>7089\n<96b1><96b2>7109\n<96b8><96b9>7114\n<973d><973e>7138\n<978f><9790>7160\n<97b3><97b4>7166\n<97b5><97b6>15281\n<984d><984e>1465\n<9852><9853>15292\n<986f><9871>7190\n<991d><991e>7210\n<9932><9933>15301\n<993d><993e>7216\n<9951><9952>7223\n<9997><9998>7227\n<99ad><99ae>7230\n<99b9><99ba>15308\n<99ed><99ee>7238\n<99f1><99f2>7240\n<9a2d><9a2e>15315\n<9ab5><9ab6>15321\n<9ad3><9ad4>7273\n<9ade><9adf>7275\n<9ae2><9ae3>7277\n<9b22><9b23>7291\n<9b27><9b2a>7294\n<9b2e><9b2f>7298\n<9b33><9b34>15326\n<9b4d><9b4e>7304\n<9b96><9b97>7312\n<9b9f><9ba0>7314\n<9bd1><9bd2>7323\n<9d5d><9d5e>7380\n<9e1a><9e1b>7411\n<9e8b><9e8c>7419\n<9ece><9ed0>7432\n<9ef6><9ef7>7444\n<9efb><9efd>7447\n<9f07><9f08>7450\n<9f5f><9f61>7461\n<9f66><9f67>7464\n<fa18><fa1a>8579\n<fa2a><fa2b>8699\n<fb01><fb02>112\n<fb03><fb04>9359\n<fe31><fe32>7892\n<fe35><fe36>7899\n<fe37><fe38>7905\n<fe39><fe3a>7901\n<fe3b><fe3c>7915\n<fe3d><fe3e>7909\n<fe3f><fe40>7907\n<fe41><fe44>7911\n<ff08><ff09>674\n<ff10><ff19>780\n<ff1a><ff1b>639\n<ff21><ff3a>790\n<ff41><ff5a>816\n<ff61><ff9f>327\n<ffe0><ffe1>713\nendcidrange\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJIS-X16",
    "content": "begincmap\n/CMapName /UniJIS-X16 def\n/WMode 0 def\n/UniJIS-X usecmap\nbegincidchar\n<7c>99\n<7e>100\n<a0>1\n<a6>93\n<a7>720\n<a8>647\n<b0>707\n<b1>694\n<b4>645\n<b6>778\n<d7>695\n<f7>696\n<0102>15756\n<0103>15769\n<0104>15737\n<0105>15745\n<0106>15758\n<0107>15771\n<0108>15783\n<0109>15789\n<010a>20333\n<010b>20352\n<010c>15759\n<010d>15772\n<010e>15761\n<010f>15774\n<0110>20322\n<0111>15775\n<0116>20334\n<0117>20353\n<0118>15760\n<0119>15773\n<011c>15784\n<011d>15790\n<011e>20335\n<011f>20355\n<0120>20337\n<0121>20356\n<0122>20336\n<0124>15785\n<0125>15791\n<0126>20323\n<0127>15816\n<012e>20339\n<012f>20357\n<0130>20338\n<0132>20324\n<0133>20328\n<0134>15786\n<0135>15792\n<0136>20340\n<0137>20358\n<0138>20329\n<0139>15757\n<013a>15770\n<013b>20342\n<013c>20360\n<013d>15739\n<013e>15747\n<013f>20325\n<0140>20330\n<0143>15762\n<0144>15776\n<0145>20343\n<0146>20361\n<0147>15763\n<0148>15777\n<0149>20331\n<014a>20326\n<0150>15764\n<0151>15778\n<0154>15755\n<0155>15768\n<0156>20344\n<0157>20362\n<0158>15765\n<0159>15779\n<015a>15740\n<015b>15748\n<015c>15787\n<015d>15793\n<015e>15741\n<015f>15750\n<0162>15767\n<0163>15781\n<0164>15742\n<0165>15751\n<0166>20327\n<0167>20332\n<016c>15788\n<016d>15794\n<0170>15766\n<0171>15780\n<0172>20345\n<0173>20363\n<0174>20350\n<0175>20364\n<0176>20351\n<0177>20365\n<0179>15743\n<017a>15752\n<017b>15744\n<017c>15754\n<0192>105\n<0193>15826\n<01c2>15821\n<01d5>20349\n<01d6>15733\n<01d7>20346\n<01d8>15734\n<01d9>20348\n<01da>15735\n<01db>20347\n<01dc>15736\n<01f5>20354\n<0237>9435\n<0250>15832\n<0252>15836\n<0253>15822\n<0255>15841\n<0256>15802\n<0257>15823\n<0258>15829\n<025c>15830\n<025e>15831\n<025f>15809\n<0260>15825\n<0261>15813\n<0264>15835\n<0265>15838\n<0266>15819\n<0267>15844\n<0268>15827\n<026a>15885\n<026c>15798\n<026d>15808\n<026e>15799\n<026f>15833\n<0270>15814\n<0271>15795\n<0272>15810\n<0273>15803\n<0274>15886\n<0276>15887\n<0278>15888\n<0279>15800\n<027a>15843\n<027b>15807\n<027d>15804\n<027e>15797\n<0280>15889\n<0281>15815\n<0282>15805\n<0284>15824\n<0288>15801\n<0289>15828\n<028a>15834\n<028b>15796\n<028d>15837\n<028e>15812\n<028f>15890\n<0290>15806\n<0291>15842\n<0294>15818\n<0295>15817\n<0298>15820\n<0299>15891\n<029c>15892\n<029d>15811\n<029f>15893\n<02a1>15840\n<02a2>15839\n<02b0>15894\n<02b2>15895\n<02b7>15896\n<02bb>98\n<02bc>96\n<02c1>15897\n<02c6>128\n<02c7>15749\n<02c8>15846\n<02cc>15847\n<02d1>15848\n<02d8>15738\n<02d9>15782\n<02da>133\n<02db>15746\n<02dc>95\n<02dd>15753\n<02de>15867\n<030f>15850\n<031a>15879\n<031c>15861\n<0324>15868\n<0325>15858\n<0329>15865\n<032a>15876\n<032c>15859\n<032f>15866\n<0330>15869\n<0334>15871\n<0339>15860\n<033c>15870\n<033d>15864\n<0361>15845\n<0386>20427\n<038c>20432\n<038e>20433\n<038f>20435\n<0390>20441\n<03aa>20431\n<03ab>20434\n<03b0>20445\n<03c2>16222\n<03ca>20440\n<03cb>20444\n<03ce>20446\n<03d5>12094\n<1f70>9420\n<1f71>9419\n<1f72>9434\n<1f73>9433\n<2010>662\n<2012>114\n<2018>98\n<2019>96\n<201c>108\n<201d>122\n<203e>226\n<203f>15849\n<2042>16282\n<2051>16281\n<205a>7898\n<205d>7897\n<207f>15908\n<20dd>16328\n<20de>11035\n<210f>12092\n<2127>15515\n<212e>20366\n<2135>12089\n<213b>8307\n<2150>9790\n<2151>9800\n<2152>9806\n<2155>15727\n<2189>9780\n<2194>12201\n<21cb>12207\n<21d2>752\n<21d4>753\n<2200>754\n<2202>759\n<2203>755\n<2205>12184\n<2206>20367\n<2207>760\n<2208>741\n<2209>15476\n<220a>12091\n<220b>742\n<220f>20368\n<2211>7625\n<2212>693\n<2213>12118\n<2219>117\n<221a>765\n<221d>767\n<221e>703\n<221f>7629\n<2220>756\n<2229>748\n<222a>747\n<222d>8195\n<222e>7624\n<2234>704\n<2235>768\n<223c>100\n<223d>766\n<2243>12120\n<2245>15507\n<2248>15508\n<2252>762\n<2260>698\n<2261>761\n<2262>15505\n<2295>12188\n<2296>12186\n<2297>12189\n<2298>12187\n<229e>15906\n<22a0>12185\n<22a5>757\n<22bf>7630\n<2318>15728\n<239b>12143\n<239c>12167\n<239f>12167\n<23a0>12146\n<23a1>12151\n<23a2>12167\n<23a5>12167\n<23a6>12154\n<23aa>12167\n<23ce>16273\n<2423>16272\n<24ff>10503\n<25b1>16235\n<25ca>20371\n<266b>16200\n<266e>16199\n<26a0>12192\n<26bd>20957\n<26be>12097\n<2713>16270\n<273f>12229\n<2740>12228\n<277f>10514\n<29bf>16203\n<2b1a>11036\n<2e9e>17893\n<2eac>19130\n<303b>12106\n<303c>16194\n<303d>12179\n<309f>12181\n<30a0>16205\n<30ff>16195\n<3244>10498\n<3251>8091\n<3406>17242\n<342c>17246\n<342e>14216\n<3468>14047\n<346a>17269\n<3492>17294\n<34b5>16793\n<34bc>17303\n<34c1>18384\n<34c7>17307\n<3563>17344\n<356e>17348\n<35a6>17369\n<35a8>17371\n<35c5>17377\n<35da>17386\n<35de>20067\n<35f4>17395\n<3605>17402\n<3614>19131\n<364a>17441\n<3691>17473\n<3696>17477\n<3699>17475\n<36cf>17494\n<376b>17533\n<376c>17532\n<3775>17536\n<37c1>17550\n<37e8>17570\n<37f4>17573\n<37fd>17576\n<3800>17578\n<382f>17588\n<3836>17589\n<3840>17590\n<385c>17594\n<3861>17596\n<38a1>20171\n<38ad>19132\n<38fa>13852\n<3917>17625\n<391a>17628\n<396f>17643\n<39a4>20122\n<39b8>20123\n<3a5c>20127\n<3a6e>17713\n<3a73>17716\n<3a85>20142\n<3ac4>20135\n<3acb>20136\n<3ad6>17731\n<3ad7>17758\n<3aea>17741\n<3b0e>17752\n<3b1a>17756\n<3b1c>17757\n<3b6d>17804\n<3b77>17797\n<3b87>17826\n<3b8d>17828\n<3ba4>17834\n<3bb6>16910\n<3bc3>16911\n<3bcd>17848\n<3bf0>17865\n<3bf3>20151\n<3c0f>16919\n<3c26>17887\n<3cc3>17916\n<3cd2>17921\n<3d11>17957\n<3d1e>17968\n<3d31>20158\n<3d4e>7655\n<3d64>17994\n<3d9a>18008\n<3dc0>18026\n<3dcc>19133\n<3dd4>18031\n<3e05>18043\n<3e3f>16968\n<3e40>20170\n<3e60>18059\n<3e66>18061\n<3e68>18062\n<3e83>18069\n<3e94>18075\n<3f57>18123\n<3f72>16984\n<3f75>18137\n<3f77>18139\n<3fae>18157\n<3fc9>18168\n<3fd7>18173\n<3fdc>19134\n<4039>18191\n<4058>18198\n<4105>18235\n<4148>18247\n<414f>18250\n<4163>18254\n<41b4>18269\n<41bf>18272\n<41e6>18283\n<41ee>18287\n<41f3>18284\n<4207>18294\n<420e>18297\n<42c6>18335\n<42d6>18346\n<42dd>18350\n<4302>18364\n<432b>18377\n<4343>18379\n<43ee>18423\n<43f0>18426\n<4408>18432\n<4417>18434\n<441c>18435\n<4422>18437\n<445b>17060\n<4476>18460\n<447a>18461\n<4491>18467\n<44b3>18494\n<44be>18492\n<44d4>18493\n<4508>18524\n<450d>18520\n<4525>14206\n<4543>18540\n<459d>17108\n<45b8>18592\n<45be>19135\n<45e5>18618\n<45ea>17113\n<460f>18634\n<4610>19136\n<4641>18648\n<46a1>18665\n<46af>18669\n<470c>18690\n<471f>20219\n<4764>18712\n<47e6>14224\n<47fd>18724\n<4816>18734\n<481e>20225\n<4844>17141\n<484e>18746\n<48b5>18779\n<49b0>17183\n<49e7>18898\n<49fa>18902\n<4a04>18907\n<4a29>18910\n<4abc>18934\n<4b38>13791\n<4b3b>18958\n<4b7e>19137\n<4bc2>18995\n<4bca>18997\n<4bd2>18999\n<4c17>17204\n<4c20>19016\n<4c38>19138\n<4cc4>19076\n<4cd1>19079\n<4ce1>19139\n<4d07>19099\n<4d77>19115\n<4e02>17234\n<4e0c>19140\n<4e0f>17235\n<4e12>17236\n<4e29>17237\n<4e2e>17238\n<4e35>21075\n<4e47>17239\n<4e51>17241\n<4e5c>21076\n<4e63>21077\n<4e68>21078\n<4e69>17244\n<4e79>19143\n<4e97>21081\n<4e9d>17245\n<4eaf>21082\n<4ebc>17247\n<4ec3>17248\n<4ec8>17249\n<4eda>17251\n<4edb>21083\n<4ee2>21084\n<4ee8>21085\n<4eeb>17250\n<4eef>21086\n<4ef1>17252\n<4ef3>19144\n<4ef5>17253\n<4efe>21087\n<4f02>21088\n<4f08>21089\n<4f0c>19145\n<4f12>21090\n<4f16>17254\n<4f17>21091\n<4f19>19146\n<4f2b>19147\n<4f2e>19148\n<4f31>19149\n<4f33>21092\n<4f35>21093\n<4f37>17256\n<4f3e>17257\n<4f40>21094\n<4f42>21095\n<4f48>16779\n<4f52>21098\n<4f58>17258\n<4f5f>16780\n<4f63>21099\n<4f64>17255\n<4f6a>16781\n<4f6c>16782\n<4f6e>21100\n<4f71>21101\n<4f79>21102\n<4f81>21103\n<4f82>17262\n<4f84>19150\n<4f85>17263\n<4f89>21104\n<4f8c>21105\n<4f8e>21106\n<4f90>21107\n<4f93>21108\n<4f99>21109\n<4f9e>19151\n<4f9f>21110\n<4fb2>17265\n<4fb7>19152\n<4fb9>21111\n<4fc5>17266\n<4fc6>21117\n<4fc8>21118\n<4fcb>17267\n<4fcc>21119\n<4fd2>17268\n<4fdc>21120\n<4fe2>21121\n<4fe6>17264\n<4ff0>21122\n<4ff1>13731\n<4ff2>17270\n<4ffc>21123\n<5002>20299\n<5004>19153\n<5007>21124\n<500a>21125\n<500c>19154\n<500e>16783\n<5013>17271\n<5017>21126\n<5018>16784\n<501c>17272\n<501d>21127\n<5030>21128\n<5035>21131\n<5041>16785\n<5045>21132\n<504a>21133\n<504c>19155\n<504e>17273\n<5053>17274\n<5059>21136\n<505f>19156\n<5060>21137\n<5062>19157\n<5063>17275\n<5067>21138\n<506d>21139\n<5071>21140\n<5077>19158\n<5081>21141\n<5086>21144\n<5088>17277\n<508a>21145\n<508e>19159\n<5090>21146\n<5095>17280\n<509b>21147\n<509e>19160\n<50a2>19161\n<50a3>17276\n<50aa>17281\n<50b1>17283\n<50b9>21153\n<50bd>21154\n<50c0>21155\n<50c3>19162\n<50c4>17286\n<50c7>17287\n<50ce>17290\n<50d0>16787\n<50d3>21156\n<50d4>17292\n<50df>21159\n<50e1>17293\n<50e2>21160\n<50e4>21161\n<50e8>19163\n<50f1>19164\n<50f2>16786\n<50f3>17288\n<50f6>21162\n<50fa>21163\n<50fe>19165\n<5103>16789\n<5106>16788\n<5107>19166\n<5117>17296\n<5119>21165\n<5123>21168\n<512f>21173\n<5131>21174\n<5133>19170\n<5134>21175\n<5135>16790\n<5138>19171\n<5139>21176\n<5142>21177\n<514f>21178\n<5153>21179\n<5155>16791\n<5157>16792\n<5158>21180\n<5160>17298\n<5166>21181\n<5173>17300\n<5174>19172\n<517b>18393\n<517e>21182\n<5183>17301\n<5184>19173\n<518b>17302\n<518e>21183\n<5198>17304\n<51a3>17305\n<51ad>17306\n<51b8>19174\n<51ba>19175\n<51bf>21184\n<51c2>21185\n<51c8>19176\n<51ca>16794\n<51cf>19177\n<51d1>19178\n<51d2>21186\n<51d5>21187\n<51d8>19181\n<51de>20300\n<51df>19182\n<51e2>16795\n<51e5>21188\n<51f2>21189\n<51f3>17309\n<51f7>21190\n<5205>19183\n<5212>17310\n<5216>17311\n<5218>21191\n<5222>21192\n<5226>19184\n<5228>19185\n<522b>19186\n<5235>19189\n<523c>19190\n<5245>21193\n<5255>17313\n<5257>16796\n<5258>21194\n<525a>19191\n<525c>17314\n<525f>21195\n<5260>19192\n<526c>17315\n<526e>19193\n<5277>17316\n<5280>21196\n<5282>17318\n<5284>17317\n<5285>21197\n<528a>19196\n<528c>19197\n<5298>17320\n<529a>21201\n<52a4>17322\n<52a5>21202\n<52a7>21203\n<52b0>21204\n<52bd>21208\n<52c4>21209\n<52c6>21210\n<52ca>17325\n<52cc>16797\n<52cf>21211\n<52d1>17326\n<52d4>21212\n<52d6>16798\n<52dc>21213\n<52e1>19198\n<52e5>21214\n<52e8>21215\n<52e9>19199\n<52ea>21216\n<52ec>21217\n<52f1>19200\n<52f4>21218\n<52f6>21219\n<52f7>17328\n<52fb>16799\n<5303>19201\n<5307>20301\n<530c>21220\n<5311>19202\n<5313>21221\n<5318>21222\n<531b>21223\n<531c>16800\n<531e>21224\n<531f>19203\n<5325>21225\n<532d>19204\n<5330>21231\n<5332>19205\n<5335>17329\n<533c>21232\n<533d>19206\n<5342>17330\n<5359>21233\n<535b>21234\n<5363>16801\n<5365>19207\n<5367>17333\n<536d>19208\n<5379>19209\n<537a>17334\n<537e>19210\n<5383>21236\n<538e>21239\n<5394>19211\n<5399>19212\n<539d>16802\n<53a1>21240\n<53a4>17335\n<53aa>19213\n<53af>19214\n<53b4>17336\n<53b5>21241\n<53b7>17338\n<53b8>21242\n<53ba>19215\n<53bd>21243\n<53c0>17339\n<53c1>19216\n<53cf>21244\n<53d5>17343\n<53de>21247\n<53e0>19219\n<53e7>21249\n<53f4>17345\n<5402>21250\n<5412>16803\n<5413>19220\n<541a>21251\n<541e>13964\n<5421>21252\n<5424>17346\n<5428>17347\n<542a>19221\n<542f>21253\n<5431>19222\n<5443>17349\n<5444>21254\n<5447>21255\n<544c>19225\n<544f>21256\n<545e>21257\n<5462>17350\n<5464>21258\n<5467>21259\n<5469>21260\n<546c>17351\n<547f>16804\n<5481>21263\n<5483>21264\n<5485>21265\n<5488>16805\n<5489>21266\n<5491>21267\n<5495>17352\n<549f>21268\n<54a0>17353\n<54a6>17354\n<54a7>19226\n<54aa>19227\n<54ae>17355\n<54b1>19228\n<54b7>17356\n<54ba>17357\n<54bb>19229\n<54c3>17358\n<54ca>21269\n<54ce>19230\n<54e0>21270\n<54ea>19231\n<54ec>17360\n<54ef>17361\n<54f1>17362\n<54f3>17363\n<54f6>21271\n<54fc>19232\n<54fe>21272\n<5505>19233\n<5508>19234\n<5509>17366\n<5515>19235\n<5527>19236\n<552a>19237\n<5532>21275\n<5536>19238\n<553b>21276\n<553c>17367\n<553d>21277\n<5541>17368\n<5547>17370\n<5549>21278\n<554d>21279\n<5550>16806\n<5551>19239\n<5558>21280\n<5561>20308\n<5564>17372\n<5566>19240\n<557d>17374\n<557f>21283\n<5581>16807\n<5582>17375\n<558f>19241\n<5591>17376\n<5592>19242\n<5593>21284\n<5594>19243\n<5597>21285\n<55a3>21286\n<55a4>19244\n<55ad>16808\n<55b2>19245\n<55bf>17381\n<55c1>21287\n<55c3>19246\n<55c6>19247\n<55c9>17382\n<55cb>21288\n<55cc>17383\n<55ce>16809\n<55d1>17384\n<55d2>17378\n<55d3>19248\n<55db>19249\n<55dd>17385\n<55de>21291\n<55e2>17387\n<55e9>17389\n<55ec>19250\n<55ee>19251\n<55f1>19252\n<55f6>19253\n<55f8>19254\n<55ff>21292\n<5605>19255\n<5607>17392\n<560a>21294\n<560d>19256\n<5610>17393\n<5619>21295\n<5628>17390\n<562c>19259\n<5630>17394\n<5633>21296\n<5635>19260\n<5639>19261\n<563b>16810\n<563c>21297\n<563d>17396\n<5640>17397\n<5641>21298\n<5646>21301\n<5647>17398\n<564d>19262\n<5654>19263\n<565e>17399\n<5660>17400\n<566d>17401\n<5675>21305\n<5684>21306\n<5685>19264\n<5688>17403\n<568b>21307\n<568c>17404\n<569d>17405\n<569e>16811\n<569f>19265\n<56a6>19266\n<56a7>21308\n<56a8>17406\n<56a9>16812\n<56ab>21309\n<56b2>17407\n<56b3>16813\n<56b7>19267\n<56be>21310\n<56c5>17408\n<56cb>21311\n<56cc>19268\n<56cd>17409\n<56cf>19269\n<56d0>21312\n<56d9>19270\n<56dc>21313\n<56df>17410\n<56e1>19271\n<56e8>17411\n<56eb>19272\n<56ed>19273\n<56f1>19274\n<5707>19275\n<570c>19276\n<5711>21319\n<571d>19279\n<5720>21320\n<5722>21321\n<5729>17416\n<572a>21324\n<572c>19280\n<572e>19281\n<573f>21325\n<574d>17420\n<5752>21326\n<575f>19284\n<5762>21327\n<5767>21328\n<5768>17422\n<576b>19285\n<576d>19286\n<576e>21329\n<576f>17423\n<5771>21330\n<5777>16814\n<5779>21331\n<577a>19287\n<577b>17427\n<577c>16815\n<577e>21332\n<5781>21333\n<5783>19288\n<5794>21334\n<5795>21338\n<5797>19289\n<5799>21335\n<579a>17430\n<579f>21336\n<57a1>21337\n<57a7>21339\n<57a8>17433\n<57a9>21340\n<57ae>19290\n<57bd>21341\n<57cc>17436\n<57cf>16817\n<57d5>19291\n<57d7>17434\n<57dd>21342\n<57de>17439\n<57e1>21347\n<57e4>16818\n<57e7>19292\n<57e9>21343\n<57f0>17440\n<57f8>17442\n<57fb>17443\n<57fd>17444\n<57fe>21344\n<5803>21345\n<5804>17445\n<5808>21346\n<580c>21348\n<580d>19293\n<581b>21349\n<581e>17446\n<581f>21350\n<5826>19294\n<5827>17447\n<582d>21351\n<5839>17448\n<583f>21352\n<5849>17450\n<584c>17451\n<584d>19295\n<584f>19296\n<5850>21353\n<5855>21354\n<585f>19297\n<5864>16819\n<5867>17452\n<5868>21355\n<586d>19298\n<5878>21356\n<587f>19299\n<5881>19300\n<5889>16820\n<588c>21359\n<588d>17455\n<5894>17458\n<5896>21360\n<5898>19301\n<589d>17459\n<58a6>21364\n<58aa>17460\n<58b1>17461\n<58bc>19302\n<58c2>21366\n<58c3>17463\n<58c4>21365\n<58c8>21367\n<58cd>17464\n<58d2>16822\n<58d6>21368\n<58dd>21369\n<58e0>16823\n<58e1>21370\n<58e2>17465\n<5905>17468\n<590d>17470\n<5914>17471\n<591d>21374\n<591f>19303\n<5921>21375\n<5923>19304\n<5928>21376\n<5930>21377\n<5933>21378\n<593d>17474\n<593f>21381\n<5943>21382\n<5946>17476\n<5952>21383\n<5959>19305\n<595e>21384\n<595f>17479\n<596b>21385\n<596f>21386\n<5972>21387\n<5979>19306\n<597b>21388\n<597c>17483\n<598b>16825\n<598c>21389\n<598e>21390\n<5992>16826\n<5995>21391\n<5997>19307\n<599f>17484\n<59a7>21392\n<59ad>21393\n<59ae>17485\n<59af>19308\n<59b0>21394\n<59b3>19309\n<59b7>21395\n<59bc>17486\n<59c1>21396\n<59c3>16827\n<59c4>21397\n<59c8>17487\n<59cd>17488\n<59de>17489\n<59df>19310\n<59e7>17490\n<59ee>17491\n<59ef>21398\n<59f1>19311\n<59f2>21399\n<59f4>21400\n<59f7>21401\n<59f8>19312\n<5a00>21402\n<5a0d>17495\n<5a0e>21403\n<5a12>21404\n<5a13>16828\n<5a17>17496\n<5a1e>21405\n<5a24>21406\n<5a27>17497\n<5a28>21407\n<5a2a>21408\n<5a2d>17498\n<5a30>21409\n<5a48>21412\n<5a4c>21413\n<5a50>21414\n<5a5e>21415\n<5a65>17499\n<5a67>16829\n<5a77>16830\n<5a7a>17500\n<5a7b>21416\n<5a84>16831\n<5a8b>17501\n<5a90>21417\n<5a93>21418\n<5a96>21419\n<5a99>21420\n<5a9c>17502\n<5aa2>17505\n<5ab1>17506\n<5ab2>19313\n<5ab5>17507\n<5ab8>19314\n<5aba>17508\n<5abb>21421\n<5abf>17509\n<5ac4>16832\n<5ac6>21422\n<5ac8>21423\n<5acf>21424\n<5ada>17510\n<5adc>17511\n<5ae5>17512\n<5aea>19315\n<5aee>17514\n<5af0>17513\n<5af5>17515\n<5af6>19316\n<5afd>21425\n<5b01>21426\n<5b08>17516\n<5b17>17517\n<5b1b>19317\n<5b1d>19318\n<5b21>19319\n<5b34>17518\n<5b38>19320\n<5b4b>21427\n<5b4c>17519\n<5b52>17520\n<5b5e>21428\n<5b68>17521\n<5b6e>21429\n<5b6f>17522\n<5b76>14120\n<5b7d>16834\n<5b81>17523\n<5b84>17524\n<5b86>21430\n<5b8e>21431\n<5b93>16835\n<5b94>21434\n<5b96>17526\n<5bac>17527\n<5bad>21437\n<5baf>21438\n<5bb7>19321\n<5bba>21441\n<5bbc>21442\n<5bc1>21443\n<5bcd>21444\n<5bce>17530\n<5bcf>21445\n<5bd6>17531\n<5bd7>19322\n<5be0>19323\n<5bec>20302\n<5bef>21448\n<5bf1>17534\n<5bf4>21449\n<5bfd>17535\n<5c03>17537\n<5c0c>21450\n<5c12>16836\n<5c17>21451\n<5c1f>19324\n<5c26>21452\n<5c29>17538\n<5c2a>19325\n<5c2c>19326\n<5c2e>21453\n<5c32>21454\n<5c35>21455\n<5c36>19327\n<5c59>19328\n<5c5a>21456\n<5c5c>19329\n<5c5f>17540\n<5c6d>19330\n<5c70>17543\n<5c7a>16839\n<5c7b>21459\n<5c7d>21460\n<5c87>21461\n<5c88>17548\n<5c8a>17549\n<5c8f>16840\n<5c92>21462\n<5c9d>21463\n<5c9f>16841\n<5ca0>17553\n<5ca2>17554\n<5ca3>16842\n<5ca7>17555\n<5caa>16843\n<5cad>17557\n<5cb2>21464\n<5cb4>21465\n<5cb5>17558\n<5cc9>17560\n<5cd0>16844\n<5cd7>21466\n<5cdd>19331\n<5cee>21467\n<5d01>19332\n<5d06>17563\n<5d0d>16846\n<5d10>17564\n<5d12>21470\n<5d1d>17566\n<5d20>17567\n<5d23>21471\n<5d2b>17565\n<5d31>17568\n<5d34>19333\n<5d39>17569\n<5d3d>19334\n<5d3f>21472\n<5d47>16847\n<5d48>21473\n<5d51>21475\n<5d55>21474\n<5d59>19335\n<5d61>17571\n<5d62>21478\n<5d64>21479\n<5d6a>17572\n<5d70>17574\n<5d7e>19336\n<5d7f>21482\n<5d81>16848\n<5d83>19337\n<5d88>17577\n<5d8a>21483\n<5d93>21484\n<5d95>21485\n<5d97>17579\n<5d9b>21486\n<5d9f>21487\n<5da4>16849\n<5da7>16850\n<5dab>21488\n<5db0>17580\n<5db2>15405\n<5db4>17581\n<5dc3>21489\n<5dc7>19338\n<5dcb>16851\n<5dce>21490\n<5dd1>17583\n<5dd7>17584\n<5dd9>21491\n<5de4>17586\n<5de9>17587\n<5df9>19339\n<5e07>21492\n<5e0d>21493\n<5e1f>17591\n<5e20>21494\n<5e28>19340\n<5e32>19341\n<5e35>19342\n<5e3e>17592\n<5e49>17593\n<5e4b>21495\n<5e56>17595\n<5e5b>19343\n<5e5c>21498\n<5e5e>16852\n<5e68>19344\n<5e6a>19345\n<5e70>21499\n<5e77>19346\n<5e80>19347\n<5e8b>19348\n<5e8e>21500\n<5ea2>21501\n<5ea4>21502\n<5ea5>17600\n<5eac>17601\n<5eb1>21503\n<5eb3>19349\n<5eb9>17602\n<5ebd>19350\n<5ec6>17603\n<5ecb>15390\n<5ecc>21504\n<5ece>21505\n<5ed1>19351\n<5ed9>17604\n<5edc>21506\n<5ede>21507\n<5ee5>21508\n<5eeb>21509\n<5ef9>16853\n<5efd>17606\n<5f00>16854\n<5f02>16855\n<5f06>21510\n<5f08>17607\n<5f19>21511\n<5f1e>17609\n<5f23>16856\n<5f24>21512\n<5f2e>21515\n<5f30>21516\n<5f3d>16857\n<5f3f>21517\n<5f44>21518\n<5f47>17610\n<5f4d>19354\n<5f54>16858\n<5f5b>21519\n<5f60>21520\n<5f63>17611\n<5f6f>21521\n<5f72>17612\n<5f78>21524\n<5f7a>21525\n<5f7d>16859\n<5f7e>17613\n<5f8d>21526\n<5f8f>17614\n<5f96>21527\n<5f9d>21528\n<5fa2>17615\n<5fab>21529\n<5fac>19355\n<5fc7>17616\n<5fc8>21532\n<5fcb>17617\n<5fe2>17621\n<5fe8>21535\n<5fea>19356\n<5fec>21536\n<5ff2>21537\n<5ff3>17624\n<5ff6>21538\n<5ffa>21539\n<6007>19357\n<600a>21540\n<600d>16860\n<6013>21541\n<6014>16861\n<6018>16862\n<601f>21542\n<6022>17626\n<6024>17627\n<602d>21543\n<6035>16863\n<6040>21544\n<6047>16864\n<6048>21545\n<6049>19358\n<604c>17629\n<6051>21546\n<6054>19359\n<6067>19360\n<6071>21549\n<607e>21550\n<6082>21551\n<6086>21552\n<6088>21553\n<608e>21554\n<6091>21555\n<6093>21556\n<6095>17630\n<6098>21557\n<609d>16865\n<60a2>21559\n<60a5>21560\n<60a8>17631\n<60b1>17633\n<60b7>21561\n<60bb>19361\n<60be>17634\n<60c2>21562\n<60c4>19362\n<60c8>17635\n<60d4>16866\n<60d9>17636\n<60dd>16867\n<60e2>21567\n<60e5>21568\n<60ee>17637\n<60f5>17638\n<60fc>21569\n<60fd>19363\n<6102>21570\n<6107>21571\n<610a>19364\n<610c>21572\n<6110>17639\n<6116>19365\n<6117>21573\n<6119>17640\n<611e>17641\n<6122>21574\n<612a>19366\n<612b>16868\n<6131>21575\n<6135>21576\n<6136>19367\n<6139>21577\n<613a>17642\n<6141>17644\n<6145>21578\n<6146>17645\n<6149>21579\n<615e>19368\n<6160>17646\n<6164>19369\n<616c>21580\n<6172>21581\n<6178>21582\n<617b>19370\n<617d>19371\n<617f>19372\n<618b>21587\n<6197>17650\n<619c>21588\n<619d>19373\n<61a0>21589\n<61a5>17651\n<61aa>21590\n<61ad>17652\n<61b8>19374\n<61b9>16870\n<61bc>16869\n<61d5>17654\n<61dc>19375\n<61dd>17655\n<61de>21595\n<61e1>21596\n<61e2>19376\n<61e5>19377\n<61e7>21597\n<61e8>19378\n<61e9>21598\n<61ef>21601\n<61f5>17656\n<6201>21602\n<6203>21603\n<6204>19379\n<6207>19380\n<621c>21604\n<6220>21605\n<6222>16871\n<6223>17658\n<6227>21606\n<622b>21607\n<6231>19381\n<6239>19382\n<623d>19383\n<6242>21608\n<6244>21609\n<6250>21610\n<6252>17659\n<6254>21611\n<625a>16872\n<625c>21612\n<6261>17660\n<6264>17661\n<626d>17663\n<626f>16873\n<6273>17664\n<627a>19384\n<627b>17662\n<627d>21613\n<6290>19385\n<6299>17665\n<62a8>19386\n<62b3>21617\n<62ba>21620\n<62ce>21623\n<62d5>17666\n<62d6>16874\n<62da>19387\n<62ea>21624\n<62f2>21625\n<62f4>19388\n<62fd>17668\n<6303>17669\n<6304>21626\n<630b>21627\n<6310>17670\n<6313>21628\n<6316>19389\n<6329>21629\n<632a>19390\n<632d>21630\n<6332>17673\n<6335>17674\n<6336>19391\n<6341>17677\n<6344>17678\n<6346>19392\n<634a>21631\n<634b>19393\n<634e>17679\n<6352>21632\n<6353>19394\n<6354>21633\n<6358>21634\n<6359>17681\n<635b>21635\n<6366>21636\n<636c>17684\n<636d>21637\n<6371>19395\n<6375>19396\n<6378>21638\n<637c>16875\n<637f>19397\n<6382>19398\n<638a>19399\n<6394>17687\n<6395>21639\n<6399>17685\n<639a>21640\n<63a4>21641\n<63a6>21642\n<63ad>21643\n<63bd>17688\n<63c1>21644\n<63c5>21645\n<63c8>21646\n<63ce>21647\n<63d3>21648\n<63e0>17691\n<63e5>16876\n<63ea>19402\n<63f2>17694\n<63f3>21649\n<640a>21650\n<6412>19405\n<6418>19406\n<641e>17695\n<6420>19407\n<6424>19408\n<6425>17696\n<6429>17697\n<642a>19409\n<642f>17698\n<6430>21651\n<6435>19410\n<643d>19411\n<643f>19412\n<644b>21652\n<644f>21653\n<6452>19413\n<6453>21654\n<645a>17699\n<645c>21655\n<645d>17700\n<645f>19414\n<6461>21656\n<6463>21657\n<6473>17701\n<6474>19415\n<6479>16877\n<647d>17702\n<6485>21658\n<6487>17703\n<648f>21659\n<6490>19416\n<6491>17704\n<649b>21660\n<649f>17705\n<64a1>21661\n<64a3>21662\n<64a6>21663\n<64a8>21664\n<64ac>19419\n<64b3>19420\n<64bd>21665\n<64c4>16878\n<64c9>21666\n<64d0>16879\n<64d1>21667\n<64d5>17708\n<64d7>17709\n<64e4>17711\n<64ed>19421\n<64f0>19422\n<64f5>21670\n<64ff>17712\n<6501>21671\n<650f>17714\n<6513>21675\n<6514>17715\n<651b>19423\n<651e>17717\n<651f>19424\n<6526>21676\n<6529>16880\n<652e>19425\n<6531>21677\n<6532>17718\n<653a>21678\n<6543>21681\n<6544>17719\n<6549>19426\n<6550>21682\n<6552>21683\n<6554>17720\n<655f>21684\n<6560>19427\n<656b>17721\n<657a>17722\n<657d>21685\n<6584>17723\n<658a>17724\n<6592>19428\n<6595>19429\n<6598>21686\n<659d>16881\n<65a0>21687\n<65a3>21688\n<65a6>21689\n<65ae>21690\n<65b2>17725\n<65b3>21691\n<65b4>19430\n<65b5>17726\n<65b8>17727\n<65be>19431\n<65bf>17728\n<65c8>19432\n<65c9>17729\n<65ce>19433\n<65d0>19434\n<65d4>17730\n<65d6>21692\n<65d8>21693\n<65df>19435\n<65f9>17732\n<65fc>17733\n<6604>17734\n<6608>17735\n<660d>21699\n<6616>21702\n<661d>21703\n<661e>20304\n<6621>17736\n<6622>16883\n<6623>21704\n<6626>21705\n<6629>21706\n<662a>17737\n<662b>16884\n<6630>16885\n<6633>16886\n<6637>21708\n<6639>21707\n<663a>16882\n<6640>21709\n<6645>17738\n<6646>21710\n<6648>16887\n<664a>21711\n<664e>17740\n<6651>17739\n<6658>21712\n<665a>13377\n<6660>21713\n<666a>17745\n<6675>21714\n<6679>21716\n<667b>17748\n<667c>21717\n<667e>19436\n<667f>21715\n<6680>17749\n<668d>16891\n<6690>17750\n<6692>17751\n<669f>21721\n<66ad>17753\n<66b1>17754\n<66b3>19439\n<66bb>16892\n<66c0>19440\n<66cc>21725\n<66ce>21726\n<66cf>19441\n<66d4>21727\n<66db>16893\n<66df>21728\n<66e8>16894\n<66eb>21729\n<66ee>21730\n<6701>17759\n<6707>21731\n<6712>17760\n<6719>17762\n<671c>21732\n<6720>21733\n<6722>21734\n<6725>19442\n<6735>19443\n<673e>21735\n<6745>21736\n<6747>16895\n<674d>17765\n<6754>17766\n<6755>19444\n<675d>17767\n<676c>21737\n<6774>17771\n<6780>19445\n<6781>16896\n<6784>21738\n<678e>21739\n<678f>19446\n<6791>19447\n<6792>17773\n<6793>16897\n<6796>21740\n<6798>16898\n<6799>21741\n<679b>16899\n<67a4>19448\n<67b1>19449\n<67b5>19450\n<67be>19451\n<67c2>21744\n<67c3>17777\n<67c5>21745\n<67c8>17778\n<67c9>21746\n<67d2>17779\n<67db>17780\n<67dc>21747\n<67e1>21748\n<67e6>21749\n<67f2>21750\n<67f6>21751\n<67f7>17781\n<67fa>7834\n<67fc>16900\n<6801>14066\n<6810>17776\n<6814>21752\n<6818>17785\n<6819>21753\n<681d>16901\n<681f>17786\n<6827>21754\n<6828>19452\n<682d>17787\n<682f>21755\n<6833>17789\n<683b>17790\n<683e>17791\n<683f>21756\n<6845>17792\n<6849>17793\n<684a>21757\n<684c>17794\n<6855>17795\n<6857>17796\n<6858>21758\n<686b>17798\n<686e>17799\n<6879>21762\n<687b>21763\n<687c>17800\n<6882>17801\n<6886>19453\n<6888>21764\n<6890>17802\n<6896>17803\n<689c>17808\n<68a1>21765\n<68a3>16902\n<68a9>21766\n<68ae>21767\n<68b4>17811\n<68bb>17812\n<68c3>17816\n<68c5>17817\n<68cc>17818\n<68d1>21768\n<68d3>21769\n<68d9>17819\n<68ea>21772\n<68eb>19454\n<68ec>17822\n<68f5>19455\n<68f6>21773\n<68f7>17823\n<68fb>17813\n<68fd>21774\n<6903>17824\n<6906>21775\n<6907>17825\n<6909>21776\n<690a>16903\n<6910>21777\n<6916>21778\n<6917>19456\n<6931>21779\n<6933>19457\n<6938>19458\n<6942>16906\n<6945>21780\n<6946>17829\n<6949>16904\n<694e>21781\n<695b>19459\n<6964>16907\n<6965>19460\n<6966>21782\n<6969>17830\n<696c>17831\n<697a>17832\n<697b>21785\n<6986>14144\n<698d>21786\n<6992>17833\n<6996>17835\n<69a1>21787\n<69a5>16908\n<69a8>19461\n<69ab>19462\n<69af>19463\n<69b0>17836\n<69b8>21788\n<69ba>17837\n<69bc>17838\n<69c0>17839\n<69c5>21789\n<69c8>21790\n<69cf>16909\n<69d1>17840\n<69e3>17844\n<69e5>19464\n<69e9>16912\n<69ea>13329\n<69f1>19465\n<69f3>17847\n<69f4>17849\n<69f5>16913\n<69fe>17850\n<6a00>21792\n<6a03>21793\n<6a11>17851\n<6a1a>17852\n<6a1d>17853\n<6a20>21794\n<6a24>21795\n<6a37>21796\n<6a3b>16915\n<6a3f>17857\n<6a49>17858\n<6a4a>19466\n<6a4e>17860\n<6a52>17861\n<6a55>19467\n<6a64>17862\n<6a67>19468\n<6a6a>21798\n<6a71>19469\n<6a7a>17859\n<6a81>21799\n<6a8b>17864\n<6a94>16917\n<6a9b>21802\n<6aa1>17866\n<6aa5>16918\n<6aab>17868\n<6aaf>19470\n<6ab4>21805\n<6abd>17869\n<6ac6>17870\n<6acc>21808\n<6ad0>17872\n<6ad4>17871\n<6add>17873\n<6af0>21811\n<6af8>20152\n<6afc>21812\n<6afd>17879\n<6b02>21813\n<6b03>19473\n<6b09>21816\n<6b0b>17881\n<6b17>17886\n<6b1b>16920\n<6b28>21817\n<6b2b>21818\n<6b2c>16921\n<6b2f>17888\n<6b36>21819\n<6b3b>19474\n<6b3f>19475\n<6b4a>17889\n<6b4d>21820\n<6b52>21821\n<6b58>17890\n<6b5d>21822\n<6b67>16922\n<6b6b>21823\n<6b6c>17891\n<6b6e>21824\n<6b70>21825\n<6b75>17892\n<6b7a>17893\n<6b81>17894\n<6b85>21826\n<6b97>21827\n<6b9b>17895\n<6ba8>21832\n<6ba9>16923\n<6bac>21833\n<6bad>16924\n<6bae>17896\n<6bb0>19478\n<6bbd>17898\n<6bd7>16925\n<6bda>17902\n<6be3>21838\n<6bee>17905\n<6bf7>19479\n<6bf9>19480\n<6bff>16926\n<6c02>17906\n<6c04>19481\n<6c05>16927\n<6c09>19482\n<6c0a>17907\n<6c0d>19483\n<6c0e>17908\n<6c12>21839\n<6c19>21840\n<6c1f>21841\n<6c2c>19484\n<6c2e>21845\n<6c36>17909\n<6c3a>20309\n<6c3b>21846\n<6c4a>19485\n<6c4b>21847\n<6c4d>17911\n<6c4f>21848\n<6c52>19486\n<6c54>19487\n<6c5b>17912\n<6c67>17930\n<6c6b>21849\n<6c6d>17913\n<6c74>16928\n<6c78>21850\n<6c79>19488\n<6c84>17914\n<6c87>21851\n<6c89>17915\n<6c94>17917\n<6c97>17918\n<6c98>16929\n<6c9f>21852\n<6cac>19489\n<6cad>17919\n<6cb0>21853\n<6cb2>21854\n<6cb4>19490\n<6cc2>17920\n<6cc6>16931\n<6ccd>21855\n<6ccf>21856\n<6cd1>21857\n<6cd2>19491\n<6cdc>17922\n<6ce7>21858\n<6ce9>17923\n<6ced>17924\n<6cf2>21859\n<6cf4>21860\n<6cfb>16930\n<6d00>17926\n<6d07>21861\n<6d0f>21862\n<6d13>21863\n<6d1a>21864\n<6d24>17927\n<6d28>21865\n<6d2f>17931\n<6d31>16932\n<6d34>17950\n<6d39>16933\n<6d3c>17932\n<6d3f>16934\n<6d58>16935\n<6d5b>17933\n<6d5f>21866\n<6d60>17934\n<6d61>19492\n<6d67>21867\n<6d70>17935\n<6d7c>19493\n<6d8a>17938\n<6d8d>17939\n<6d91>17940\n<6d92>21868\n<6d94>16936\n<6d97>21869\n<6d98>17941\n<6daa>16937\n<6dab>17946\n<6dae>17947\n<6db4>17948\n<6db7>21870\n<6db9>19494\n<6dbd>21871\n<6dc2>17949\n<6dc8>17951\n<6dce>17952\n<6ddb>16938\n<6ddd>16939\n<6ddf>17953\n<6de0>21872\n<6de2>21873\n<6de5>21874\n<6def>21875\n<6df0>19495\n<6df4>21876\n<6df6>17954\n<6e00>21877\n<6e04>21878\n<6e1e>17956\n<6e32>17958\n<6e36>17955\n<6e3b>21879\n<6e44>16940\n<6e45>19496\n<6e4f>17963\n<6e52>21880\n<6e57>17966\n<6e5d>21881\n<6e5e>16941\n<6e62>21882\n<6e63>17967\n<6e68>21883\n<6e73>19497\n<6e7b>19498\n<6e7d>19499\n<6e89>19500\n<6e8d>21884\n<6e93>17969\n<6e99>21885\n<6ea0>21886\n<6ea7>17970\n<6eb1>16942\n<6eb3>21889\n<6eb4>17971\n<6ebb>21890\n<6ebc>19501\n<6ec0>21891\n<6ec1>16943\n<6ec3>17972\n<6ec8>21892\n<6ecd>21893\n<6ecf>21894\n<6eeb>17974\n<6ef9>17975\n<6efb>17976\n<6f04>21897\n<6f08>21898\n<6f0a>17977\n<6f0c>17978\n<6f0d>21899\n<6f10>16944\n<6f16>21900\n<6f18>17979\n<6f1b>21901\n<6f25>17980\n<6f26>19504\n<6f29>19505\n<6f2d>21903\n<6f30>19506\n<6f35>17973\n<6f36>17981\n<6f3b>21902\n<6f3c>17982\n<6f4f>21904\n<6f52>17984\n<6f53>21905\n<6f57>17985\n<6f59>16945\n<6f5d>21906\n<6f60>17986\n<6f61>16946\n<6f68>17987\n<6f6c>21907\n<6f7e>16947\n<6f83>21908\n<6f87>19507\n<6f8c>16948\n<6f90>17988\n<6f93>21909\n<6f96>17989\n<6f9d>19508\n<6f9f>17991\n<6fa0>16949\n<6fa5>17992\n<6fa6>21910\n<6fae>19509\n<6faf>17993\n<6fb0>21911\n<6fb7>19510\n<6fbc>16950\n<6fbe>17990\n<6fc5>21912\n<6fc7>16951\n<6fca>16952\n<6fe8>21913\n<6fe9>17997\n<6ff0>16953\n<6ff9>15395\n<6ffc>17999\n<6ffd>21914\n<7000>18000\n<700a>18001\n<700d>19511\n<7017>21915\n<7020>19512\n<7023>18002\n<702f>21916\n<7034>21917\n<7037>21918\n<703a>18004\n<7043>18005\n<7044>21919\n<7047>18006\n<7048>21920\n<7049>19513\n<704a>20306\n<704b>18007\n<704e>16954\n<7055>21921\n<7065>18009\n<7069>18010\n<706e>18011\n<7075>16955\n<7076>18012\n<7086>18013\n<7094>21922\n<7096>21923\n<7097>18014\n<7098>19514\n<709b>21924\n<709f>18016\n<70a4>16956\n<70b0>19515\n<70b1>18017\n<70b4>21925\n<70ca>18020\n<70d1>18021\n<70e4>16957\n<70ec>18019\n<70fa>21926\n<7103>18022\n<7105>21927\n<7106>18023\n<7108>18024\n<710b>21928\n<710c>18025\n<711e>16959\n<712b>16958\n<712d>21929\n<712e>16960\n<712f>18027\n<7138>21930\n<7141>21931\n<7145>19518\n<714b>21932\n<7150>18028\n<7151>16961\n<7153>18029\n<7157>21934\n<715a>21935\n<715e>18030\n<7168>16962\n<7180>18033\n<7185>16963\n<7187>16964\n<718c>21936\n<7196>18032\n<719a>21937\n<719b>18034\n<71a0>18035\n<71a2>18036\n<71b0>21938\n<71b2>19519\n<71b3>15397\n<71ba>16965\n<71c4>16966\n<71cc>21941\n<71d9>18040\n<71da>21942\n<71dc>18041\n<71f4>19520\n<71f8>21943\n<7207>18042\n<7213>21946\n<7215>16967\n<7217>19521\n<721a>21947\n<721f>19522\n<7224>21948\n<722f>21949\n<7234>18044\n<7239>18045\n<7242>18046\n<7243>19523\n<7245>21950\n<724e>21951\n<7257>18047\n<725a>19526\n<725e>21952\n<7260>19527\n<7263>18048\n<7268>19528\n<726b>21953\n<7271>21954\n<7277>19529\n<7278>18052\n<727f>18053\n<7284>19530\n<7289>21957\n<728e>18054\n<7293>21958\n<729b>16969\n<72a8>21959\n<72ae>18056\n<72b0>18057\n<72c1>18058\n<72c9>19531\n<72cc>18060\n<72d8>21962\n<72df>21963\n<72e5>19532\n<72f3>18063\n<72f4>19533\n<72fa>18064\n<72fe>21964\n<7302>19534\n<7307>18065\n<730b>19535\n<730d>21965\n<7312>18066\n<7313>21966\n<731e>19536\n<7322>19537\n<7327>16971\n<732c>18071\n<7332>21967\n<7333>18072\n<7335>21968\n<7339>18070\n<733d>18073\n<734d>19540\n<7350>16972\n<7352>18074\n<7356>21969\n<7358>19541\n<7366>16973\n<7367>19542\n<7369>21974\n<736b>18076\n<7371>18080\n<7379>21975\n<7380>21976\n<7381>18081\n<738a>18082\n<738e>21977\n<7390>21978\n<7393>21979\n<7394>18083\n<7397>21980\n<7398>18084\n<739c>18085\n<73a2>16974\n<73a5>18086\n<73aa>21981\n<73ad>21982\n<73b9>18087\n<73bf>18088\n<73c5>18089\n<73c6>21983\n<73cb>18090\n<73cc>21984\n<73d3>21985\n<73dd>21986\n<73e1>18091\n<73e6>21987\n<73e7>18092\n<73f7>21988\n<73f9>18093\n<73fa>18095\n<73fb>21989\n<7401>18096\n<7411>21992\n<7413>18094\n<742b>16975\n<742d>21993\n<7440>18098\n<7443>18099\n<7446>16976\n<7452>18100\n<7453>18097\n<745d>18101\n<7462>16977\n<746d>16978\n<746e>21996\n<7472>19543\n<7481>18102\n<7488>18103\n<748f>21997\n<7491>21998\n<7492>18105\n<7497>18106\n<7499>18107\n<749a>21999\n<74a1>18108\n<74a5>18109\n<74a6>16979\n<74a9>16980\n<74aa>18110\n<74ae>22000\n<74af>19544\n<74b9>18111\n<74ba>18113\n<74bb>18112\n<74c9>16981\n<74cc>22003\n<74d0>22004\n<74d3>22005\n<74d6>18114\n<74d8>18115\n<74db>22007\n<74df>19545\n<74e4>19546\n<74e8>22008\n<74ea>22009\n<74eb>18116\n<74f4>19547\n<74fa>18118\n<74fb>19548\n<74fc>22011\n<74ff>16982\n<7506>22012\n<7512>22013\n<7516>19549\n<7517>16983\n<7520>18120\n<7521>19550\n<7524>18121\n<7527>22014\n<7529>22015\n<752a>18122\n<7536>22016\n<7539>22017\n<753f>19551\n<7540>18127\n<7543>22018\n<7547>22019\n<7548>18128\n<7550>18129\n<7552>18130\n<7557>22020\n<755e>19552\n<755f>22021\n<7561>22022\n<7571>18132\n<7572>18131\n<757a>18133\n<7585>22025\n<758c>18136\n<7595>22026\n<7599>19553\n<759c>22027\n<75a2>18138\n<75a4>19554\n<75b0>18140\n<75b7>18141\n<75ba>22028\n<75c1>19555\n<75c4>19556\n<75c6>18144\n<75cc>19557\n<75ce>16985\n<75cf>18145\n<75d3>18146\n<75d7>19558\n<75dc>19559\n<75dd>18147\n<75e1>19560\n<75e7>18150\n<75ee>18151\n<75ef>19561\n<75f1>18152\n<7602>16986\n<7603>18153\n<7604>19562\n<7607>18155\n<7608>16987\n<760c>19563\n<760f>18156\n<7612>22029\n<7613>18159\n<7618>18154\n<761d>19564\n<7623>22030\n<7625>18163\n<7626>13893\n<7628>18164\n<7629>22031\n<7632>19565\n<7633>18166\n<7638>19566\n<763c>18165\n<7640>22034\n<7641>18169\n<7644>22035\n<7645>19567\n<7649>18171\n<764a>19568\n<7655>18172\n<7659>22036\n<765f>19569\n<7664>16988\n<766e>18174\n<7681>16989\n<7685>22037\n<7695>18175\n<769d>16990\n<769f>22040\n<76a0>18177\n<76a1>18176\n<76aa>16991\n<76ad>19570\n<76af>18180\n<76b6>16992\n<76bd>19571\n<76c1>22043\n<76c9>18182\n<76cb>22044\n<76ce>16993\n<76d4>16994\n<76d9>19572\n<76e0>22046\n<76e6>16995\n<76e8>18184\n<76eb>19573\n<76f0>19574\n<76f1>16996\n<76f6>22047\n<76f9>19575\n<7700>19576\n<7706>22048\n<770a>16997\n<770e>19577\n<7712>22049\n<7717>18186\n<7719>16998\n<771a>18187\n<771c>22052\n<7722>19578\n<7728>19579\n<772d>18188\n<772e>22053\n<772f>19580\n<7735>18189\n<7739>19581\n<773d>22054\n<773e>19582\n<7742>22055\n<7745>19583\n<774a>19584\n<774f>19585\n<7752>22056\n<7758>18194\n<775e>19586\n<7764>19587\n<7767>19588\n<776c>19589\n<7770>22059\n<777a>17001\n<777c>18196\n<7780>17002\n<7784>19590\n<7794>17003\n<7796>19593\n<779a>18199\n<779f>18200\n<77a2>18201\n<77a4>18202\n<77a7>19594\n<77ae>22064\n<77af>19595\n<77b1>22065\n<77b5>22066\n<77b7>19596\n<77be>19597\n<77c3>22067\n<77c9>19598\n<77d1>19599\n<77d2>22068\n<77d5>22069\n<77d9>19600\n<77e0>17004\n<77e4>18205\n<77ea>18206\n<77ec>18207\n<77f1>19601\n<77f8>22070\n<77fb>18208\n<7805>18210\n<7809>18211\n<780d>18212\n<780e>22071\n<7811>22072\n<7819>18213\n<781d>22073\n<7823>22074\n<782c>18214\n<7837>19602\n<7843>17006\n<7844>22075\n<7847>18215\n<7848>22076\n<784c>22077\n<7852>22078\n<785c>19603\n<785e>22079\n<7863>22082\n<786a>18216\n<786e>17007\n<787e>19604\n<788a>18218\n<788f>22083\n<7894>18219\n<7898>19605\n<789d>18221\n<789f>18222\n<78a1>19606\n<78a4>18220\n<78a8>22084\n<78ac>22085\n<78ad>17010\n<78b0>17008\n<78b1>19607\n<78b2>22086\n<78b3>19608\n<78bb>18223\n<78bd>22087\n<78bf>22088\n<78c7>22089\n<78c9>19609\n<78d2>22090\n<78d3>19610\n<78d5>18224\n<78d6>22091\n<78db>22092\n<78df>22093\n<78e6>18225\n<78ea>22094\n<78f3>22095\n<78f6>22096\n<78fe>18228\n<78ff>22097\n<7900>17011\n<7906>22098\n<790c>19611\n<7910>18230\n<791a>22099\n<791b>18231\n<791c>17012\n<791e>22100\n<791f>19612\n<7920>22101\n<7925>18232\n<7929>22102\n<792d>22103\n<792e>17013\n<7934>17014\n<7935>22104\n<793f>19615\n<7942>19616\n<7944>22105\n<7946>17015\n<794a>18233\n<794b>22106\n<794f>22107\n<7951>22108\n<7954>19617\n<7958>18234\n<7967>18236\n<7969>22109\n<796b>19618\n<7972>18237\n<7979>17016\n<797b>22110\n<797c>19619\n<797e>22111\n<798c>22112\n<7991>22113\n<7993>22114\n<7995>18238\n<799c>22115\n<79a1>18239\n<79a8>22116\n<79a9>18240\n<79ab>19620\n<79af>22117\n<79b4>18241\n<79c2>18242\n<79c4>19621\n<79c7>18243\n<79c8>17017\n<79cf>22118\n<79d4>17019\n<79d6>18246\n<79dd>22119\n<79de>17020\n<79e0>22120\n<79e2>22121\n<79e5>22122\n<79ea>19622\n<79eb>17021\n<79ed>17022\n<79f1>22123\n<79f8>22124\n<79fc>22125\n<7a02>19623\n<7a07>22126\n<7a0a>18251\n<7a0c>19624\n<7a15>18252\n<7a1b>18253\n<7a21>22127\n<7a27>22128\n<7a2b>22129\n<7a2f>22130\n<7a30>19625\n<7a38>18255\n<7a3a>19626\n<7a44>19627\n<7a47>18256\n<7a48>22133\n<7a55>22134\n<7a56>18257\n<7a59>18258\n<7a5c>18259\n<7a5f>18260\n<7a60>20310\n<7a65>22135\n<7a67>18261\n<7a6a>18262\n<7a75>18263\n<7a7e>22136\n<7a80>19628\n<7a82>18264\n<7a85>17023\n<7a86>19629\n<7a8a>18265\n<7a8b>22137\n<7a90>18266\n<7a91>22138\n<7a94>19630\n<7a9e>22139\n<7aac>18267\n<7ab5>19631\n<7ab9>18270\n<7abd>19632\n<7abe>18271\n<7ac9>22140\n<7acc>18273\n<7ace>17025\n<7adb>22141\n<7ae8>18274\n<7ae9>22142\n<7aec>22143\n<7af1>22144\n<7af4>18275\n<7afb>22145\n<7afd>17026\n<7afe>19633\n<7b12>17027\n<7b1f>22146\n<7b23>22147\n<7b29>22148\n<7b2a>18280\n<7b2b>19634\n<7b2d>17028\n<7b30>22149\n<7b34>22150\n<7b3b>17029\n<7b3d>18279\n<7b41>18286\n<7b55>18288\n<7b64>18290\n<7b66>18291\n<7b6a>22153\n<7b6f>17030\n<7b73>18292\n<7b77>19635\n<7b79>18289\n<7b7f>18285\n<7b84>22154\n<7b89>22155\n<7b8e>22156\n<7b90>18295\n<7b96>22157\n<7b9b>18296\n<7ba0>19636\n<7ba5>22158\n<7bac>19637\n<7bb0>19638\n<7bb2>22159\n<7bb5>18298\n<7bb6>22160\n<7bbc>18299\n<7bbd>22163\n<7bc2>22164\n<7bc5>18300\n<7bc8>22165\n<7bca>18301\n<7bd4>18304\n<7bd6>18305\n<7bda>18306\n<7bdb>22166\n<7be8>19639\n<7bea>18307\n<7bf0>18308\n<7bf2>19640\n<7bf8>19641\n<7bfc>19642\n<7bfe>19643\n<7c01>17031\n<7c02>22171\n<7c03>18309\n<7c04>22172\n<7c06>22173\n<7c09>19644\n<7c0c>22174\n<7c0e>18310\n<7c19>22175\n<7c1b>22176\n<7c25>22177\n<7c28>19645\n<7c2c>22178\n<7c2f>19646\n<7c33>17032\n<7c34>22179\n<7c42>19647\n<7c45>18311\n<7c46>22182\n<7c4a>18312\n<7c55>22183\n<7c57>18313\n<7c5a>22184\n<7c5e>18314\n<7c61>18315\n<7c63>22185\n<7c69>18316\n<7c6d>17034\n<7c6f>18317\n<7c72>19653\n<7c79>17035\n<7c7c>22187\n<7c7d>19654\n<7c86>22188\n<7c87>19655\n<7c8f>17036\n<7c94>17037\n<7c9e>19656\n<7ca0>17038\n<7ca6>18321\n<7cb0>22189\n<7cba>19657\n<7cbb>22190\n<7cc4>18326\n<7cc7>19658\n<7ccd>18328\n<7ccf>22191\n<7cd3>19659\n<7cd4>22192\n<7cd5>17039\n<7cda>19660\n<7ce6>18331\n<7ce9>22193\n<7cf5>18333\n<7d03>18334\n<7d0f>22194\n<7d11>22195\n<7d12>18336\n<7d16>22196\n<7d1e>18337\n<7d26>22197\n<7d2a>22198\n<7d2d>22199\n<7d31>17040\n<7d3c>19661\n<7d40>18342\n<7d47>18343\n<7d4d>19662\n<7d51>22200\n<7d55>13882\n<7d57>22201\n<7d5a>18347\n<7d5c>17041\n<7d65>22202\n<7d67>22203\n<7d6a>18348\n<7d70>18349\n<7d78>22204\n<7d7b>22205\n<7d7f>18351\n<7d81>22206\n<7d82>19663\n<7d83>17042\n<7d85>19664\n<7d88>18353\n<7d8d>19665\n<7d91>19666\n<7d96>22207\n<7d97>18354\n<7d9d>18356\n<7d9e>19667\n<7da6>17043\n<7da7>18357\n<7daa>18358\n<7db3>19668\n<7db6>18359\n<7db9>19669\n<7dc0>18360\n<7dc2>17044\n<7dd0>19670\n<7dd7>18361\n<7dd9>18362\n<7de2>22215\n<7de5>19671\n<7de6>18363\n<7dea>22216\n<7ded>22217\n<7dfa>22218\n<7e00>22214\n<7e10>18367\n<7e17>18368\n<7e1c>22219\n<7e1d>18369\n<7e27>18370\n<7e28>17045\n<7e2c>18371\n<7e2d>22220\n<7e2f>19674\n<7e33>22221\n<7e36>19675\n<7e3f>22222\n<7e44>19676\n<7e45>18372\n<7e4e>22223\n<7e50>22224\n<7e58>22225\n<7e5f>22226\n<7e65>22227\n<7e6f>19677\n<7e75>18373\n<7e78>19678\n<7e7e>18374\n<7e81>19679\n<7e95>22228\n<7e9a>18378\n<7f3b>18381\n<7f3c>18380\n<7f3d>19680\n<7f3e>18382\n<7f3f>22231\n<7f43>18383\n<7f5b>19681\n<7f5c>22232\n<7f5d>19682\n<7f65>19683\n<7f66>22233\n<7f6d>18389\n<7f71>19684\n<7f8b>19687\n<7f8d>22235\n<7f8f>22236\n<7f90>18392\n<7f96>18395\n<7f97>17046\n<7f9c>18396\n<7fa2>19688\n<7fa6>22237\n<7faa>22238\n<7fad>18397\n<7fb4>22239\n<7fbc>22240\n<7fc0>22241\n<7fc3>18399\n<7fc8>22242\n<7fcf>18400\n<7fdb>17047\n<7fe3>18401\n<7fe8>22243\n<7ff2>18402\n<8007>19692\n<8008>18404\n<800a>18403\n<800d>19693\n<800f>22244\n<8013>22245\n<8016>18405\n<801d>22246\n<801e>19694\n<802c>18406\n<802e>22249\n<8030>18407\n<8034>22250\n<8035>17048\n<8037>17049\n<8039>19695\n<803e>22251\n<8040>22252\n<8043>18408\n<8044>22253\n<8064>22254\n<8066>18409\n<806d>22255\n<807b>18410\n<8081>22256\n<8088>19696\n<808e>19697\n<8099>18411\n<809c>18412\n<80a4>18413\n<80a7>18414\n<80b8>18415\n<80b9>22257\n<80c5>18417\n<80c8>22258\n<80ca>17050\n<80cd>22259\n<80cf>19698\n<80d2>22260\n<80d4>19699\n<80d5>18418\n<80e0>17051\n<80e6>18419\n<80ed>19700\n<80ee>22261\n<80f0>19701\n<80f2>22262\n<80f3>17052\n<80f5>18421\n<80f6>22263\n<80f7>19702\n<80f9>22264\n<80fa>19703\n<80fb>18422\n<80fe>19704\n<8103>19705\n<810b>22265\n<810d>18420\n<8117>19706\n<811c>22266\n<811e>18425\n<8120>22267\n<8124>18427\n<8127>18428\n<812c>18429\n<8130>19707\n<8135>18424\n<813c>22268\n<813d>18431\n<8145>22269\n<8147>22270\n<8152>22271\n<8157>19708\n<8160>17053\n<8161>22272\n<8169>18433\n<816d>17056\n<816f>19709\n<8173>19710\n<8177>22273\n<8185>18436\n<8186>22274\n<818b>19711\n<818e>22275\n<8190>19712\n<8196>22276\n<8198>18438\n<819b>19713\n<819e>19714\n<81a2>22277\n<81ae>22278\n<81b2>18439\n<81bb>17057\n<81c1>18440\n<81c3>18441\n<81c5>22279\n<81ca>17058\n<81cb>19715\n<81ce>22280\n<81d5>19716\n<81d6>18442\n<81d7>17059\n<81db>18443\n<81e1>19719\n<81e4>18445\n<81eb>22281\n<81ec>18447\n<81ef>19720\n<81f5>22285\n<81f6>19721\n<81f8>22286\n<81fd>18448\n<81ff>18449\n<8200>19722\n<8204>18451\n<820b>19723\n<820f>22288\n<8219>18453\n<821a>19726\n<821d>22289\n<8222>18454\n<8228>22290\n<823a>19727\n<823c>18456\n<8243>22291\n<8244>19728\n<8245>18458\n<8249>18457\n<824e>22292\n<8251>22293\n<8256>22294\n<8257>18462\n<825c>18464\n<8260>17061\n<8263>18465\n<8267>22295\n<826d>19729\n<8274>17062\n<827b>22296\n<827d>18468\n<827f>18469\n<8283>18470\n<8284>19730\n<8287>22299\n<8289>19731\n<828a>18471\n<8291>19732\n<8293>18472\n<8294>22300\n<8296>22301\n<8298>22302\n<82a0>22305\n<82a1>17064\n<82a9>17067\n<82aa>19733\n<82b0>19734\n<82b2>18475\n<82b4>18476\n<82ba>18477\n<82bc>18478\n<82bf>17068\n<82d0>19735\n<82d5>17069\n<82da>22306\n<82e0>22307\n<82e2>18479\n<82e4>22308\n<82e8>18480\n<82ea>19736\n<82ed>22309\n<82ef>19737\n<82f6>19738\n<82f7>18481\n<82fd>17070\n<8300>17071\n<830c>18484\n<831b>18486\n<831d>18487\n<8321>22314\n<8322>17072\n<832c>22315\n<832d>17073\n<832e>22316\n<8330>18488\n<8333>22317\n<8337>22318\n<833a>17074\n<833c>18489\n<833d>22319\n<8342>22320\n<8344>18490\n<8346>7672\n<8347>17075\n<8353>22332\n<8354>18485\n<8356>19739\n<8357>18491\n<835a>14202\n<8363>17775\n<8370>22323\n<8378>19740\n<837d>17076\n<8380>22324\n<8382>22325\n<8384>22326\n<8399>22327\n<839b>18497\n<839c>22328\n<839d>18498\n<83a6>22329\n<83a7>17077\n<83ac>22330\n<83ad>22335\n<83be>22331\n<83c9>18499\n<83cf>17078\n<83d0>18500\n<83d1>17079\n<83d4>18501\n<83dd>18502\n<83e1>17080\n<83e5>18503\n<83e8>22333\n<83f8>19741\n<83f9>18504\n<83fc>19742\n<8401>17081\n<8406>17082\n<8415>18505\n<8417>18507\n<8419>22334\n<842f>22336\n<8439>18508\n<8445>22337\n<8447>22338\n<844d>22339\n<844f>18509\n<8456>22340\n<8458>19743\n<845c>18514\n<845f>17083\n<8460>22342\n<8464>22343\n<8465>18516\n<8467>22344\n<846a>22345\n<8470>17084\n<8473>17085\n<8474>22346\n<8478>18517\n<847c>18518\n<847d>22347\n<8481>18519\n<8485>17086\n<8492>22348\n<8493>19744\n<8495>22349\n<8497>18521\n<849e>17087\n<84a6>18522\n<84b1>19745\n<84ba>17088\n<84bd>19746\n<84be>18523\n<84cc>22354\n<84d3>18527\n<84e7>18529\n<84ea>18530\n<84ef>18531\n<84f1>18532\n<84f2>22355\n<84f7>22356\n<84fa>18533\n<84fb>19747\n<8507>22359\n<850e>22360\n<8510>22361\n<851b>18534\n<851c>22362\n<851e>17091\n<8522>22363\n<8527>22364\n<852a>22365\n<852b>18537\n<852f>17092\n<8532>17090\n<8533>22366\n<8536>22367\n<853f>22368\n<8546>19748\n<854f>18538\n<8550>22369\n<8551>18541\n<8552>22370\n<8556>19749\n<855c>22371\n<855d>19750\n<8564>17093\n<856f>18539\n<8579>22375\n<857a>17094\n<857b>18545\n<857d>18546\n<857f>18547\n<8581>18548\n<8585>19751\n<8586>18549\n<8589>22376\n<858b>22377\n<858c>17095\n<8593>18550\n<8598>19752\n<859d>18551\n<859f>18552\n<85a0>22378\n<85a2>17096\n<85a5>22379\n<85a7>22380\n<85b4>22381\n<85b6>22382\n<85b8>22383\n<85bc>18556\n<85c2>22387\n<85c7>18557\n<85ca>18558\n<85cb>17097\n<85da>22388\n<85df>18561\n<85e0>22389\n<85e1>18562\n<85e6>18563\n<85e8>22390\n<85ed>17098\n<85f3>22391\n<85f6>18564\n<85fc>22392\n<85ff>17099\n<8600>18565\n<8610>17102\n<8611>18566\n<8618>17104\n<8619>22395\n<861b>22396\n<861e>18567\n<8621>18568\n<8624>18569\n<8627>18570\n<8636>22397\n<8638>17105\n<8639>18572\n<863a>22398\n<863c>18573\n<863d>22399\n<8640>18575\n<8641>16824\n<8642>19753\n<8646>19754\n<8653>18576\n<8656>18577\n<8657>17106\n<865d>22402\n<8662>17107\n<8664>22405\n<8669>22406\n<8675>17109\n<8676>22407\n<8677>18578\n<8687>18579\n<8688>22425\n<8689>18580\n<8696>22408\n<869a>22409\n<86a1>22410\n<86a6>22411\n<86ad>22412\n<86b1>18583\n<86b3>18584\n<86b7>22415\n<86b8>17110\n<86b9>22416\n<86bf>22417\n<86c0>19755\n<86c1>18585\n<86c3>18586\n<86c5>22418\n<86d1>18587\n<86d2>22419\n<86d5>18588\n<86d7>18589\n<86da>22420\n<86dc>22421\n<86e0>22422\n<86e3>18590\n<86e5>22423\n<86e6>18591\n<86e7>22424\n<86fc>17111\n<8704>22426\n<8705>18593\n<8707>18594\n<870e>18595\n<870f>22427\n<8710>18596\n<8714>19756\n<871f>18597\n<8721>18598\n<8722>19757\n<8723>18599\n<872e>19758\n<872f>22428\n<8731>18600\n<8732>22429\n<8739>19759\n<873a>18601\n<8740>18602\n<8743>18603\n<8745>22432\n<874d>22433\n<8751>18604\n<8758>18605\n<875d>19760\n<8761>22434\n<876f>22435\n<8772>18608\n<877b>19761\n<877c>18609\n<8787>17112\n<8789>18613\n<878b>18614\n<878c>19762\n<878e>19763\n<8790>22440\n<8793>18615\n<8795>22441\n<879e>19766\n<87a0>18616\n<87a3>19767\n<87a7>18612\n<87ae>19768\n<87b1>22443\n<87be>18619\n<87bf>19769\n<87c1>18621\n<87c8>22444\n<87c9>19770\n<87ca>22445\n<87ce>18622\n<87d5>22446\n<87d9>22447\n<87da>19771\n<87dc>22448\n<87df>18623\n<87e2>22449\n<87e3>18625\n<87e4>22450\n<87ea>18628\n<87f1>22451\n<87f3>22452\n<87f8>22453\n<87fa>22454\n<87ff>22455\n<8803>20312\n<8809>22456\n<880a>17114\n<8810>17115\n<8812>22458\n<8813>18629\n<8818>19772\n<8819>22457\n<881a>22459\n<881b>19773\n<881e>22460\n<8828>18630\n<882d>19774\n<882e>18631\n<8830>22461\n<8832>18632\n<8835>22462\n<883a>19775\n<883c>18633\n<8841>22463\n<8843>22464\n<8845>19776\n<884a>18635\n<884b>19777\n<884e>19778\n<8851>22468\n<8855>19779\n<8858>18636\n<885a>19780\n<885c>22469\n<8860>22470\n<8869>18639\n<886e>19781\n<886f>18641\n<8871>22471\n<8879>22472\n<887b>22473\n<8880>22474\n<889f>22475\n<88a0>18642\n<88a8>22476\n<88ba>22477\n<88bc>18643\n<88c0>18644\n<88cd>19785\n<88ce>17116\n<88d1>18646\n<88d3>18647\n<88de>22480\n<88e0>19786\n<88e7>22481\n<88ef>19787\n<88f7>22482\n<8901>18649\n<890d>22483\n<8920>22486\n<8926>19790\n<8928>22487\n<8931>22488\n<8932>17118\n<8935>19791\n<8937>18651\n<8939>17119\n<893a>22489\n<8940>17120\n<8942>18653\n<8945>18654\n<8946>22490\n<8949>18655\n<894f>22491\n<8952>22492\n<8957>22493\n<895a>19792\n<895b>22494\n<895c>19793\n<8961>22495\n<8962>18657\n<8963>22496\n<896b>19794\n<896e>22497\n<8970>19795\n<8973>22498\n<8975>22499\n<897a>22500\n<897c>19796\n<897d>22501\n<8989>18658\n<898d>22502\n<8990>18659\n<8994>17121\n<8995>22503\n<899f>18660\n<89a0>22506\n<89a5>19797\n<89b0>18661\n<89b4>22507\n<89b5>19798\n<89b6>22508\n<89b7>18662\n<89bc>19799\n<89d5>19800\n<89d7>22509\n<89d8>18663\n<89e9>22510\n<89eb>18664\n<89ed>22511\n<89f3>18666\n<89f6>17122\n<89f9>22512\n<89fd>18667\n<89ff>18668\n<8a11>18670\n<8a14>18671\n<8a1e>22515\n<8a20>22516\n<8a21>18673\n<8a24>22517\n<8a26>22518\n<8a2f>22521\n<8a35>18674\n<8a3d>22522\n<8a3e>18675\n<8a40>22523\n<8a43>22524\n<8a45>18676\n<8a47>17123\n<8a49>19801\n<8a4d>18677\n<8a53>22525\n<8a56>22526\n<8a57>19802\n<8a58>18678\n<8a5c>22527\n<8a5d>17124\n<8a61>17125\n<8a65>22528\n<8a67>19803\n<8a75>17126\n<8a7e>19804\n<8a80>22533\n<8a83>22534\n<8a86>19805\n<8a8b>22535\n<8a8f>22536\n<8a90>18680\n<8a92>22537\n<8a96>19806\n<8a97>22538\n<8a99>22539\n<8a9f>22540\n<8aa9>22541\n<8aae>18679\n<8aaf>22542\n<8ab3>22543\n<8ab6>19807\n<8ab7>18681\n<8abb>22544\n<8ac3>22545\n<8ac6>22546\n<8ac8>22547\n<8ac9>19808\n<8aca>22548\n<8ad0>17127\n<8ad1>19809\n<8ad7>18682\n<8add>19810\n<8aec>19811\n<8af0>22552\n<8af5>19812\n<8afc>18683\n<8aff>22553\n<8b05>18686\n<8b06>19813\n<8b0a>18685\n<8b0b>22554\n<8b0d>18687\n<8b0f>19814\n<8b11>19815\n<8b1c>18688\n<8b1e>22555\n<8b2d>18689\n<8b30>22556\n<8b3c>22557\n<8b42>22558\n<8b45>19816\n<8b46>17128\n<8b48>22559\n<8b4d>22560\n<8b51>18691\n<8b52>19817\n<8b59>17129\n<8b5e>18692\n<8b63>22561\n<8b69>17130\n<8b6d>19818\n<8b76>18693\n<8b78>19819\n<8b79>22562\n<8b7c>19820\n<8b7e>19821\n<8b81>18694\n<8b84>22563\n<8b85>19822\n<8b8b>18695\n<8b8d>22564\n<8b8f>22565\n<8b9d>17131\n<8b9f>19823\n<8c38>22566\n<8c39>18698\n<8c3d>18700\n<8c3e>22567\n<8c45>18703\n<8c49>17132\n<8c4b>19824\n<8c4f>18704\n<8c51>22568\n<8c53>19825\n<8c57>18705\n<8c58>22569\n<8c59>22572\n<8c5b>22570\n<8c5d>22571\n<8c66>22575\n<8c68>17133\n<8c69>18706\n<8c6d>18707\n<8c7b>19826\n<8c7e>22578\n<8c8b>22581\n<8c90>22582\n<8c92>18710\n<8c93>18709\n<8c99>18711\n<8c9b>18713\n<8c9c>22584\n<8c9f>13644\n<8cb9>22585\n<8cba>19827\n<8cc5>19828\n<8cc6>22586\n<8cc9>19829\n<8ccb>22587\n<8ccf>22588\n<8cd2>19830\n<8cd5>18715\n<8cd6>18714\n<8cdd>22589\n<8ce8>22590\n<8cec>19831\n<8cef>22591\n<8cf1>18717\n<8cf2>22592\n<8cf5>19832\n<8cf7>19833\n<8cff>22593\n<8d01>19834\n<8d03>19835\n<8d09>18719\n<8d0e>18720\n<8d17>19836\n<8d1c>19837\n<8d65>22594\n<8d6e>19838\n<8d7f>22595\n<8d82>22596\n<8d88>22597\n<8d90>22598\n<8d91>19839\n<8d9e>22599\n<8d9f>19840\n<8da0>22600\n<8dab>19841\n<8dac>22601\n<8daf>17134\n<8db2>19842\n<8db5>22602\n<8db7>22603\n<8db9>22604\n<8dbb>22605\n<8dbc>22613\n<8dc0>22606\n<8dc5>22607\n<8dc7>22608\n<8dc8>18721\n<8dca>22609\n<8dd1>17135\n<8dd4>22610\n<8dd5>19843\n<8dd7>17136\n<8dd9>18722\n<8de5>22611\n<8de7>19844\n<8df0>22612\n<8df4>19847\n<8dfd>18725\n<8e01>19848\n<8e06>18726\n<8e0b>19849\n<8e0c>18723\n<8e11>22616\n<8e14>18728\n<8e16>18729\n<8e23>17137\n<8e26>19850\n<8e27>18732\n<8e31>19851\n<8e33>22617\n<8e36>18735\n<8e39>18736\n<8e3d>17138\n<8e4d>19854\n<8e4e>22620\n<8e4f>19855\n<8e54>18737\n<8e5b>22621\n<8e5c>19856\n<8e61>19857\n<8e62>18738\n<8e69>19858\n<8e6d>18739\n<8e6f>18740\n<8e71>19859\n<8e75>19860\n<8e77>19861\n<8e79>22624\n<8e7b>17139\n<8e89>19862\n<8e90>19863\n<8e95>19864\n<8e98>18741\n<8e9a>19865\n<8e9b>22627\n<8e9d>22628\n<8e9e>18742\n<8ea2>22629\n<8ea7>19866\n<8ea9>19867\n<8ead>19868\n<8eb5>18743\n<8eba>22630\n<8ebb>18744\n<8ec1>22631\n<8ec7>22634\n<8edc>22635\n<8ee8>19869\n<8eed>22639\n<8eee>22636\n<8ef0>19870\n<8ef1>22637\n<8ef7>22638\n<8efa>17142\n<8f00>18748\n<8f02>22640\n<8f07>19871\n<8f08>18749\n<8f16>22643\n<8f18>19872\n<8f1e>17143\n<8f23>22646\n<8f25>19873\n<8f27>19874\n<8f28>22647\n<8f2b>18750\n<8f2c>19875\n<8f2d>17144\n<8f2e>22648\n<8f34>22649\n<8f35>19876\n<8f37>22650\n<8f3a>19877\n<8f40>18751\n<8f41>22651\n<8f43>19878\n<8f47>19879\n<8f4a>18752\n<8f4f>22652\n<8f51>19880\n<8f54>17145\n<8f55>19881\n<8f58>18753\n<8f65>22657\n<8f9d>22658\n<8fa4>18755\n<8fa5>19885\n<8fb4>18756\n<8fb8>22659\n<8fbe>22660\n<8fc0>22661\n<8fc1>18758\n<8fc6>18759\n<8fca>18761\n<8fcb>22662\n<8fcd>18762\n<8fd0>22663\n<8fd2>22664\n<8fd3>18763\n<8fd5>18764\n<8fe3>22665\n<8fe8>17147\n<8fee>17148\n<8ff1>18765\n<8ff5>18766\n<8ffb>18767\n<8ffe>22666\n<9004>19886\n<9008>17149\n<900c>18768\n<9018>22667\n<901b>19887\n<902d>17150\n<902f>19888\n<9037>18769\n<903f>22673\n<9043>18771\n<904c>19889\n<905b>19890\n<905d>18772\n<9062>22674\n<9066>22675\n<906c>22676\n<9070>19891\n<9074>19892\n<9079>19893\n<9085>18775\n<908b>19894\n<908c>18776\n<908e>22677\n<9090>18777\n<9097>17151\n<9098>19895\n<90a0>19896\n<90a1>18778\n<90a5>22678\n<90b0>18780\n<90b2>19897\n<90b3>17152\n<90b6>18781\n<90bd>19898\n<90be>17153\n<90c3>18782\n<90c7>17156\n<90c8>18783\n<90c9>19899\n<90cc>22679\n<90d2>22684\n<90d5>22680\n<90dc>18785\n<90df>18786\n<90e5>22683\n<90eb>18791\n<90ef>17157\n<90f0>19900\n<90f2>18789\n<90f6>18788\n<9100>18790\n<9104>18794\n<9105>19901\n<9106>18795\n<9108>22685\n<910d>22686\n<9110>22687\n<9114>17158\n<9116>17159\n<9118>18796\n<911a>22688\n<911e>18797\n<9120>22689\n<9125>19902\n<9129>22690\n<912e>22691\n<912f>17162\n<9134>17163\n<9136>22692\n<9137>18798\n<9139>18799\n<913c>22693\n<9143>22694\n<914f>22695\n<9153>22696\n<9157>18802\n<9159>18803\n<915a>19903\n<9167>19904\n<916d>22697\n<9174>18804\n<9179>18805\n<917a>19905\n<917b>22698\n<9181>22699\n<9183>17164\n<9185>18806\n<9186>22700\n<918a>19906\n<9191>19907\n<9195>19908\n<9198>22703\n<91a1>22704\n<91a6>22705\n<91b0>19909\n<91b3>18807\n<91b6>18808\n<91bb>19910\n<91bd>19911\n<91bf>22706\n<91c2>19912\n<91c5>19913\n<91d9>22709\n<91ec>18813\n<91ef>22712\n<91f1>17165\n<91f9>22713\n<91fd>22714\n<9200>19914\n<9201>18814\n<9209>19915\n<920c>22717\n<9218>22720\n<9223>19916\n<923e>22731\n<9242>18818\n<9246>22732\n<924a>18819\n<924d>22733\n<9256>18820\n<9258>22734\n<9261>18821\n<9265>18822\n<9268>18823\n<9269>22737\n<9275>22741\n<9276>19917\n<9279>22742\n<927b>22743\n<927f>18827\n<9289>18828\n<928a>22744\n<928d>18829\n<928e>19918\n<9292>22745\n<9297>18830\n<9299>18831\n<929f>18832\n<92a0>22746\n<92a8>22749\n<92ab>18833\n<92af>19919\n<92b2>18836\n<92b6>22750\n<92b8>22751\n<92ba>22752\n<92bd>22753\n<92c1>19922\n<92c3>19923\n<92c5>19924\n<92c6>18839\n<92c7>22754\n<92c8>19925\n<92cd>22755\n<92ce>18840\n<92d8>22756\n<92e1>22759\n<92e3>22760\n<92e5>18841\n<92e8>22761\n<92ec>22762\n<92ee>22763\n<92f0>22764\n<92f7>18845\n<9300>22765\n<9308>22766\n<9311>18842\n<9314>19926\n<931c>22767\n<9324>22768\n<9329>18846\n<932a>22769\n<9333>19927\n<9334>22770\n<9336>19928\n<9337>22771\n<9349>17166\n<9350>22772\n<9351>18849\n<9355>22773\n<9358>19929\n<935a>18850\n<935e>22774\n<9367>22775\n<9369>22776\n<936b>18851\n<936f>22777\n<9371>18852\n<9373>18853\n<9374>22778\n<9376>22779\n<937a>22780\n<937d>22781\n<937f>19930\n<9382>19931\n<9388>18857\n<938a>19932\n<938b>18858\n<938d>22784\n<938f>18859\n<9392>22785\n<9395>22786\n<9398>22787\n<939e>18860\n<93a1>18854\n<93a3>17169\n<93a6>22789\n<93a8>22790\n<93ab>22791\n<93bb>19933\n<93c7>18865\n<93c9>22797\n<93cb>22798\n<93cc>19934\n<93cd>22799\n<93d3>22800\n<93d9>22801\n<93dc>18866\n<93df>17170\n<93e6>19935\n<93e7>18867\n<93f1>18864\n<93f5>18861\n<93f7>22802\n<93f9>19936\n<93fb>18871\n<9401>22803\n<9402>19937\n<9404>17171\n<9408>22804\n<9409>18868\n<9415>22805\n<941f>22806\n<942e>19940\n<942f>22807\n<9432>18872\n<9433>17172\n<943b>18873\n<943d>22808\n<9443>22809\n<944a>17173\n<944c>19941\n<9459>22810\n<945c>22811\n<945f>22812\n<9461>22813\n<9463>17174\n<9468>22814\n<946d>18876\n<946e>22815\n<946f>18877\n<9471>17175\n<9483>22817\n<9484>22816\n<9579>18878\n<957e>22818\n<9584>22819\n<9586>18879\n<9588>19942\n<958e>17176\n<959f>17177\n<95a1>19943\n<95ab>20313\n<95ac>17178\n<95b6>17179\n<95ba>22822\n<95bf>19944\n<95c6>19945\n<95c8>18884\n<95c9>19946\n<95cb>17180\n<95d0>17181\n<95d3>17182\n<95d9>22823\n<95dd>22824\n<95de>17184\n<95df>22825\n<95e0>19949\n<95e4>19950\n<95e6>19951\n<95e8>14061\n<961e>22826\n<9622>22827\n<9624>19952\n<962c>18887\n<9631>19953\n<9637>22830\n<9638>19954\n<963c>18891\n<963d>19955\n<9652>22833\n<9654>19956\n<9661>18892\n<966e>22836\n<9674>19957\n<967b>19958\n<967c>22837\n<967e>22838\n<967f>19959\n<9681>19960\n<9682>18894\n<9683>19961\n<9689>19962\n<9691>22839\n<9696>19963\n<969a>18896\n<969f>22840\n<96a5>17185\n<96a6>22841\n<96ae>19964\n<96b3>18899\n<96ba>18900\n<96bd>18901\n<96ca>22842\n<96d8>18904\n<96da>18905\n<96dd>18906\n<96df>22844\n<96ef>17186\n<96fa>22845\n<9703>19965\n<9705>22846\n<9714>18908\n<971a>22847\n<971b>19966\n<971d>22848\n<9723>18909\n<9728>19969\n<9731>19970\n<9736>18911\n<9741>18912\n<9747>18913\n<974a>22850\n<974e>17187\n<9755>20314\n<9757>18914\n<9758>22851\n<975b>18915\n<9767>19971\n<976a>18916\n<9776>19972\n<977b>22854\n<977d>19973\n<977f>19974\n<9780>22855\n<9789>22856\n<9795>17188\n<9796>18919\n<9797>22857\n<9799>19975\n<979e>18920\n<979f>19976\n<97ac>19977\n<97ae>17189\n<97b8>22858\n<97b9>19978\n<97ba>17190\n<97bc>22859\n<97be>18923\n<97bf>22860\n<97c1>17191\n<97c7>22863\n<97c9>17192\n<97ca>22864\n<97cc>18924\n<97cd>19979\n<97ce>22865\n<97d0>22866\n<97d1>18925\n<97d4>18926\n<97d7>22867\n<97d8>18927\n<97db>17193\n<97dd>22868\n<97e0>19980\n<97e1>18928\n<97e4>22869\n<97ef>19981\n<97f1>18929\n<97fa>22872\n<9804>18930\n<9807>19982\n<980d>18931\n<9814>18932\n<9816>18933\n<9819>22873\n<981c>22874\n<9820>22875\n<9825>18938\n<9826>19983\n<982e>19984\n<982f>22876\n<9835>22877\n<9844>22878\n<9847>18939\n<984a>22879\n<9851>22880\n<9856>17194\n<9866>18940\n<986a>22881\n<98ab>18941\n<98ad>18942\n<98ae>22882\n<98b0>18943\n<98b4>19987\n<98b7>18945\n<98c2>18948\n<98c5>19988\n<98c7>18949\n<98cb>18950\n<98cc>22883\n<98e1>18951\n<98e3>18952\n<98e6>22884\n<98e7>17195\n<98ea>18953\n<98f3>18956\n<98f6>22885\n<9902>19989\n<9907>22886\n<9908>18957\n<9911>19990\n<9915>19991\n<991f>22887\n<9922>22888\n<9926>22889\n<992b>22890\n<9931>18967\n<9934>22891\n<9935>19992\n<9939>22892\n<9941>18971\n<9946>18972\n<9947>22893\n<9948>19993\n<994e>18973\n<9954>19994\n<9958>17196\n<9959>22894\n<995b>22895\n<995e>19995\n<9960>18974\n<999b>22896\n<999d>22897\n<999f>22898\n<99a3>18975\n<99a6>18976\n<99b0>22899\n<99b2>22900\n<99b5>22901\n<99bd>18977\n<99bf>18978\n<99c3>18979\n<99d3>22902\n<99d4>18980\n<99d9>18981\n<99da>22903\n<99dc>22904\n<99de>18982\n<99e1>19996\n<99e7>22905\n<99f0>18984\n<99f9>18985\n<99fc>18986\n<9a03>17197\n<9a04>22913\n<9a0a>18987\n<9a0b>22914\n<9a0c>19997\n<9a10>19998\n<9a11>18988\n<9a1a>18989\n<9a1e>22915\n<9a20>18990\n<9a22>22916\n<9a23>19999\n<9a31>18991\n<9a33>22917\n<9a35>22918\n<9a41>20000\n<9a44>18992\n<9a47>22919\n<9a4b>22921\n<9a4c>18993\n<9a51>20001\n<9a54>22922\n<9a58>18994\n<9a5d>22923\n<9aaa>22924\n<9aac>22925\n<9aae>22926\n<9aaf>18996\n<9ab2>22927\n<9ab4>22928\n<9ab7>18998\n<9ab9>19000\n<9abb>22929\n<9abf>22930\n<9ac1>17198\n<9ac3>17199\n<9ac6>19002\n<9ac8>22931\n<9ace>17200\n<9ad0>19003\n<9ad2>19004\n<9ad5>19005\n<9ad6>17201\n<9ad7>22932\n<9adb>22933\n<9ae0>19006\n<9ae4>22934\n<9ae5>19007\n<9ae7>22935\n<9ae9>19008\n<9aec>22936\n<9af5>22939\n<9afa>22940\n<9afd>22941\n<9b01>20004\n<9b02>17202\n<9b08>17203\n<9b09>20005\n<9b0b>20006\n<9b0c>19009\n<9b10>19010\n<9b12>19011\n<9b16>19012\n<9b19>20009\n<9b1b>22946\n<9b1c>19013\n<9b1d>20297\n<9b26>22947\n<9b2b>19014\n<9b2c>20298\n<9b2d>17205\n<9b35>20010\n<9b37>22949\n<9b3d>19015\n<9b48>20011\n<9b4b>19017\n<9b4c>22952\n<9b55>20012\n<9b5b>22955\n<9b5e>17206\n<9b61>22956\n<9b63>19018\n<9b65>19019\n<9b66>17207\n<9b68>20013\n<9b6a>22957\n<9b78>22960\n<9b7f>22961\n<9b80>20014\n<9b84>17208\n<9b85>22962\n<9b86>20015\n<9b87>22963\n<9b89>22964\n<9b8a>17209\n<9b8b>22965\n<9b8d>22966\n<9b90>20016\n<9b94>22967\n<9b9a>22968\n<9b9d>20017\n<9b9e>17210\n<9ba6>19024\n<9ba9>22969\n<9bac>19025\n<9bb0>20018\n<9bb2>19027\n<9bb7>22970\n<9bb8>19028\n<9bbc>22971\n<9bbe>19029\n<9bbf>20019\n<9bc8>20020\n<9bce>17211\n<9bd0>22972\n<9bd8>19031\n<9bdd>19032\n<9be5>17212\n<9bea>19033\n<9bee>19035\n<9bef>19034\n<9bf3>19030\n<9bf8>17213\n<9bf9>22973\n<9bff>20021\n<9c02>20022\n<9c0f>22974\n<9c11>22975\n<9c16>19039\n<9c1c>20023\n<9c1d>19043\n<9c1e>22976\n<9c22>19044\n<9c23>17214\n<9c26>22977\n<9c28>22978\n<9c29>19045\n<9c31>19047\n<9c35>20024\n<9c37>19048\n<9c3d>22979\n<9c43>22980\n<9c44>20025\n<9c45>19049\n<9c4e>22981\n<9c54>19055\n<9c56>20026\n<9c58>19056\n<9c5b>19057\n<9c5c>19050\n<9c5d>19058\n<9c5e>22982\n<9c5f>19059\n<9c61>20027\n<9c65>17217\n<9c68>20028\n<9c70>15346\n<9c72>19065\n<9c75>19066\n<9c7a>19067\n<9c7b>22983\n<9ce6>19068\n<9cf2>19069\n<9cf7>22984\n<9cf9>22985\n<9d0b>19070\n<9d11>19072\n<9d1c>22986\n<9d2f>22987\n<9d30>20029\n<9d32>19078\n<9d3a>22990\n<9d3c>22991\n<9d3d>20030\n<9d43>17220\n<9d45>22992\n<9d4a>19080\n<9d52>17221\n<9d5f>19081\n<9d62>19082\n<9d65>22995\n<9d6a>20031\n<9d73>19085\n<9d7b>20032\n<9d83>22996\n<9d84>19088\n<9d86>22997\n<9d8a>17222\n<9d8e>22998\n<9d95>23001\n<9d96>17223\n<9d99>19089\n<9da1>19090\n<9daa>23004\n<9dac>17225\n<9dae>23005\n<9db5>19092\n<9db9>19093\n<9dbc>17226\n<9dbd>19094\n<9dbf>19091\n<9dc0>17224\n<9dc9>19095\n<9dca>23007\n<9dda>19096\n<9dde>23010\n<9de0>19097\n<9de3>19098\n<9de5>20033\n<9de7>17228\n<9de9>20034\n<9dee>23011\n<9df0>23012\n<9df3>20035\n<9dfe>23013\n<9e02>19101\n<9e07>17229\n<9e0a>19100\n<9e0d>19102\n<9e0e>23014\n<9e16>23018\n<9e1c>19103\n<9e7a>20036\n<9e7b>19104\n<9e80>19106\n<9e85>19107\n<9e87>23019\n<9e96>23022\n<9e98>23023\n<9e9b>19108\n<9e9e>17230\n<9eae>23024\n<9eaf>17231\n<9eb0>20040\n<9eb3>23025\n<9ebd>19110\n<9ec6>23026\n<9ec8>23027\n<9ecb>23028\n<9ed5>23029\n<9edf>19112\n<9ee4>20041\n<9ef0>20042\n<9ef1>23032\n<9ef2>20043\n<9ef5>23033\n<9ef8>23034\n<9eff>19113\n<9f02>19114\n<9f03>19116\n<9f09>20044\n<9f0f>20045\n<9f11>23035\n<9f14>20046\n<9f16>23036\n<9f1a>23037\n<9f1b>20047\n<9f1f>23038\n<9f22>20048\n<9f26>20049\n<9f34>20052\n<9f3a>19117\n<9f3c>23041\n<9f3d>19118\n<9f3f>23042\n<9f46>19119\n<9f47>23045\n<9f53>19120\n<9f55>19121\n<9f56>23046\n<9f58>19122\n<9f5a>20053\n<9f5d>19124\n<9f5e>23047\n<9f69>19126\n<9f6d>19127\n<9f6e>23048\n<9f6f>20054\n<9f70>19128\n<9f73>23049\n<9f7a>23050\n<9f7d>23051\n<9f8f>23052\n<9f96>23055\n<9f97>17232\n<9f9e>20055\n<9fa1>23056\n<9fa3>23057\n<9fa5>20056\n<9fb4>14048\n<9fbc>15431\n<9fbd>15429\n<9fbe>15434\n<9fc4>14089\n<9fc6>14168\n<9fcc>20156\n<f87a>15447\n<f87f>15448\n<f909>13739\n<f91d>13392\n<f91f>14084\n<f928>20303\n<f929>20305\n<f936>13394\n<f95f>13971\n<f970>13344\n<f983>14088\n<f999>7811\n<f99a>14097\n<f9a2>14095\n<f9c3>7808\n<f9d0>13396\n<f9dc>13393\n<f9ec>7750\n<fa03>13956\n<fa10>7746\n<fa11>14290\n<fa15>20307\n<fa24>18760\n<fa30>13382\n<fa31>13360\n<fa32>13389\n<fa33>13385\n<fa34>13338\n<fa35>13378\n<fa36>7651\n<fa37>13366\n<fa38>13333\n<fa39>13384\n<fa3a>13387\n<fa3b>13361\n<fa3c>16837\n<fa3d>13326\n<fa3e>13328\n<fa3f>13363\n<fa41>13381\n<fa42>13334\n<fa43>13352\n<fa44>13375\n<fa45>13327\n<fa46>7700\n<fa47>13332\n<fa48>13347\n<fa49>15398\n<fa4a>7732\n<fa4b>13379\n<fa4c>13348\n<fa4d>13345\n<fa4e>13335\n<fa4f>13391\n<fa50>13359\n<fa51>13351\n<fa52>13325\n<fa53>13371\n<fa54>13343\n<fa55>13373\n<fa56>13358\n<fa57>13399\n<fa58>18366\n<fa59>13376\n<fa5a>13353\n<fa5d>14199\n<fa5e>14198\n<fa5f>13367\n<fa60>13331\n<fa61>13346\n<fa62>13321\n<fa63>13339\n<fa64>13380\n<fa65>13364\n<fa66>15403\n<fa67>13320\n<fa68>13374\n<fa69>13337\n<fa6a>7788\n<fa6b>13740\n<fa6c>14281\n<fa6d>13695\n<fe10>8268\n<fe19>7897\nendcidchar\nbegincidrange\n<01f8><01f9>15731\n<0262><0263>15883\n<02e0><02e1>15898\n<02e5><02e9>15851\n<0318><0319>15874\n<031d><031e>15872\n<031f><0320>15862\n<033a><033b>15877\n<0384><0385>20317\n<0388><038a>20428\n<03ac><03af>20436\n<03cc><03cd>20442\n<0402><040c>20447\n<040e><040f>20458\n<0452><045c>20460\n<045e><045f>20471\n<1e3e><1e3f>15729\n<2032><2033>708\n<2047><2048>16278\n<2156><215a>9785\n<2225><2226>15489\n<2227><2228>749\n<222b><222c>769\n<2264><2265>20369\n<2266><2267>701\n<226a><226b>763\n<2272><2273>12121\n<2276><2277>15509\n<2282><2283>745\n<2284><2285>15472\n<2286><2287>743\n<228a><228b>15474\n<22da><22db>15725\n<2305><2306>15478\n<2329><232a>682\n<239d><239e>12144\n<23a3><23a4>12152\n<23a7><23a9>8178\n<23ab><23ad>8174\n<23b0><23b1>16312\n<23be><23cc>16253\n<2491><2492>20587\n<24eb><24f4>10515\n<24f5><24fe>16223\n<25d0><25d3>16274\n<2616><2617>16233\n<2672><267d>16314\n<2934><2935>16201\n<29fa><29fb>16207\n<2b05><2b07>8207\n<3016><3017>16197\n<3018><3019>12129\n<3095><3096>7959\n<3099><309a>16326\n<3190><319f>16283\n<31f0><31f9>16236\n<31fa><31ff>16247\n<3252><325b>8102\n<325c><325f>10244\n<32b1><32bf>10248\n<355d><355e>17341\n<3761><3762>17528\n<4e23><4e24>19141\n<4e74><4e75>21079\n<4f4b><4f4c>21096\n<4f77><4f78>17260\n<4fbb><4fbd>21112\n<4fc0><4fc1>21115\n<5032><5033>21129\n<5051><5052>21134\n<5083><5084>21142\n<5092><5093>17278\n<509f><50a1>21148\n<50af><50b0>21151\n<50ba><50bb>17284\n<50dc><50dd>21157\n<510c><510e>19167\n<511c><511d>21166\n<5127><5128>21169\n<512c><512d>21171\n<51d3><51d4>19179\n<5231><5232>19187\n<5278><5279>19194\n<5295><5297>21198\n<52b6><52b8>21205\n<52ba><52bb>17323\n<5327><5329>21226\n<532b><532c>21229\n<5387><5388>21237\n<53c4><53c5>19217\n<53d2><53d3>21245\n<5434><5435>19223\n<546d><546e>21261\n<5500><5501>17364\n<550c><550d>21273\n<555a><555b>21281\n<55d7><55d8>21289\n<5611><5612>19257\n<5643><5644>21299\n<5661><5663>21302\n<56e5><56e7>21314\n<56f6><56f7>17412\n<5701><5702>21317\n<571a><571b>19277\n<5724><5725>21322\n<573d><573e>19282\n<5745><5746>17418\n<5773><5775>17424\n<579d><579e>17431\n<5887><5888>21357\n<588a><588b>17453\n<588f><5890>17456\n<58a0><58a2>21361\n<58f3><58f4>17466\n<5912><5913>21372\n<5935><5936>21379\n<5975><5976>17481\n<5a44><5a45>21410\n<5a9f><5aa0>17503\n<5b90><5b91>21432\n<5ba8><5ba9>21435\n<5bb1><5bb2>21439\n<5bd9><5bda>21446\n<5c67><5c68>17541\n<5c74><5c75>21457\n<5cf1><5cf2>21468\n<5d5f><5d60>21476\n<5d79><5d7a>21480\n<5e50><5e51>21496\n<5e6d><5e6e>17597\n<5ed4><5ed5>19352\n<5f2b><5f2c>21513\n<5f74><5f75>21522\n<5fb0><5fb1>21530\n<5fd0><5fd1>21533\n<5fd2><5fd4>17618\n<5fee><5fef>17622\n<6056><6057>21547\n<60c9><60ca>21563\n<60ce><60cf>21565\n<6180><6181>21583\n<6183><6184>21585\n<6192><6193>17648\n<61c0><61c1>21591\n<61ce><61cf>21593\n<61ec><61ed>21599\n<628d><628f>21614\n<62b6><62b7>21618\n<62be><62bf>21621\n<633b><633c>17675\n<63ae><63af>19400\n<63d4><63d5>17689\n<63eb><63ec>17692\n<63f8><63f9>19403\n<6498><6499>19417\n<64cb><64cc>17706\n<64e9><64ea>21668\n<6508><650a>21672\n<653c><653d>21679\n<65f4><65f5>21695\n<65fe><65ff>21697\n<6611><6612>21700\n<666c><666d>17746\n<6677><6678>16889\n<668b><668c>19437\n<669a><669c>21718\n<66c2><66c3>21723\n<67bc><67bd>21742\n<686f><6871>21759\n<6898><689a>17805\n<68aa><68ab>17809\n<68dc><68dd>21770\n<68e4><68e5>17820\n<6970><6971>21783\n<69ee><69ef>17845\n<6a32><6a33>17855\n<6a86><6a87>21800\n<6ab0><6ab1>21803\n<6abe><6abf>21806\n<6ac8><6ac9>19471\n<6ad5><6ad6>21809\n<6af1><6af3>17876\n<6b06><6b07>21814\n<6b0f><6b11>17882\n<6b7d><6b7e>19476\n<6b9f><6ba0>21828\n<6ba2><6ba3>21830\n<6bb8><6bb9>21834\n<6bc3><6bc4>21836\n<6bc7><6bc9>17899\n<6be6><6be7>17903\n<6c26><6c28>21842\n<6d26><6d27>17928\n<6d80><6d81>17936\n<6e48><6e49>17959\n<6e4b><6e4c>17961\n<6e53><6e54>17964\n<6ead><6eae>21887\n<6eda><6edb>19502\n<6eed><6eee>21895\n<6fc8><6fc9>17995\n<70d5><70d6>19516\n<71ae><71af>18037\n<71bf><71c0>21939\n<7208><7209>21944\n<724f><7250>19524\n<726e><726f>18050\n<727b><727c>21955\n<72d5><72d6>21960\n<7318><7319>18067\n<733a><733b>19538\n<735d><7360>21970\n<736e><736f>18078\n<73ff><7400>21990\n<7467><7468>21994\n<74b1><74b2>22001\n<753d><753e>18125\n<757b><757c>22023\n<757d><757e>18134\n<75bf><75c0>18142\n<75df><75e0>18148\n<761b><761c>18160\n<7639><763a>22032\n<768c><768d>22038\n<76a2><76a3>22041\n<76a7><76a8>18178\n<7714><7715>22050\n<774d><774e>16999\n<7756><7757>22057\n<7773><7774>22060\n<778c><778d>19591\n<77de><77df>18203\n<7860><7861>22080\n<78f9><78fa>18226\n<7927><7928>19613\n<79cc><79cd>18244\n<7a34><7a35>22131\n<7b2e><7b2f>18281\n<7b3f><7b40>22151\n<7bba><7bbb>22161\n<7bf4><7bf5>22167\n<7bf9><7bfa>22169\n<7c39><7c3a>22180\n<7c52><7c53>19648\n<7c5b><7c5d>19650\n<7cb6><7cb7>18323\n<7d3d><7d3e>18340\n<7dc3><7dc6>22208\n<7dcd><7dce>22212\n<7df5><7df6>19672\n<7e86><7e87>18375\n<7e9d><7e9e>22229\n<7f63><7f64>18387\n<7f7d><7f7e>18390\n<7f7f><7f80>19685\n<7ffd><7fff>19689\n<801f><8020>22247\n<8167><8168>17054\n<81dd><81de>19717\n<81f0><81f2>22282\n<8213><8214>19724\n<8280><8281>22297\n<829a><829b>22303\n<82a3><82a4>17065\n<82a7><82a8>18473\n<8307><8308>18482\n<830a><830b>22310\n<831e><831f>22312\n<834d><834e>22321\n<8394><8395>18495\n<8451><8452>18510\n<8459><845a>18512\n<84a9><84aa>22350\n<84c7><84c8>22352\n<84ce><84cf>18525\n<8502><8503>22357\n<8524><8525>18535\n<855f><8560>22373\n<8561><8562>18542\n<85bd><85bf>22384\n<85d8><85d9>18559\n<8604><8605>17100\n<860d><860e>22393\n<8658><8659>22400\n<8660><8661>22403\n<869c><869d>18581\n<86b4><86b5>22413\n<873c><873d>22430\n<8764><8765>18606\n<8783><8786>22436\n<8797><8798>19764\n<87e5><87e6>18626\n<8848><8849>22465\n<889a><889c>19782\n<88cb><88cc>22478\n<890e><890f>19788\n<8915><8916>22484\n<899b><899c>22504\n<8a04><8a05>22513\n<8a2b><8a2c>22519\n<8a76><8a77>22529\n<8a7a><8a7b>22531\n<8ad3><8ad5>22549\n<8b94><8b95>18696\n<8c63><8c64>22573\n<8c75><8c76>22576\n<8c86><8c87>22579\n<8df1><8df2>19845\n<8e04><8e05>22614\n<8e21><8e22>18730\n<8e37><8e38>22618\n<8e40><8e41>19852\n<8e5d><8e5e>22622\n<8e82><8e83>22625\n<8ec3><8ec4>22632\n<8f0f><8f10>22641\n<8f20><8f21>22644\n<8f52><8f53>22653\n<8f5d><8f5e>22655\n<8fa0><8fa2>19882\n<9028><902a>22668\n<9033><9034>22671\n<90c4><90c5>17154\n<90d8><90d9>22681\n<90fe><90ff>18792\n<9122><9123>17160\n<9146><9147>18800\n<9193><9194>22701\n<91c3><91c4>18809\n<91d3><91d4>22707\n<91e9><91ea>22710\n<9204><9205>22715\n<9212><9213>22718\n<9216><9217>18815\n<921c><921d>22721\n<9224><9226>22723\n<922e><9230>22726\n<9235><9236>22729\n<925c><925d>22735\n<926e><9270>22738\n<927c><927d>18825\n<92a4><92a5>22747\n<92bb><92bc>19920\n<92bf><92c0>18837\n<92dc><92dd>22757\n<9364><9365>17167\n<9380><9381>22782\n<93b4><93b6>22792\n<93c4><93c5>22795\n<940d><940e>19938\n<9416><9417>18869\n<958c><958d>18880\n<959d><959e>22820\n<95d1><95d2>19947\n<9625><9626>22828\n<9633><9634>18888\n<9639><963a>22831\n<9656><9657>22834\n<9721><9722>19967\n<9777><9778>22852\n<97b1><97b2>18921\n<97c4><97c5>22861\n<97f7><97f8>22870\n<9832><9833>18936\n<9862><9863>19985\n<98bb><98bc>18946\n<98f0><98f1>18954\n<9916><9917>18960\n<991a><991c>18963\n<993a><993c>18968\n<99ea><99ec>22906\n<99f4><99f5>22909\n<99fd><99fe>22911\n<9abd><9abe>20002\n<9af2><9af3>22937\n<9aff><9b00>22942\n<9b04><9b05>22944\n<9b0d><9b0e>20007\n<9b39><9b3a>22950\n<9b56><9b57>22953\n<9b6b><9b6c>19020\n<9b6d><9b6e>22958\n<9b76><9b77>19022\n<9c18><9c1a>19040\n<9c49><9c4a>19052\n<9c4f><9c50>17215\n<9c69><9c6b>19060\n<9c6d><9c6e>19063\n<9d17><9d18>19073\n<9d1d><9d1e>17218\n<9d33><9d34>22988\n<9d53><9d54>22993\n<9d76><9d77>19086\n<9d92><9d93>22999\n<9d97><9d98>23002\n<9dd4><9dd5>23008\n<9e10><9e12>23015\n<9e82><9e84>20037\n<9e8e><9e8f>23020\n<9eec><9eed>23030\n<9f2a><9f2b>20050\n<9f31><9f32>23039\n<9f43><9f44>23043\n<9f91><9f92>23053\n<9fbf><9fc2>20068\n<f860><f862>15444\n<f992><f993>7809\n<fa5b><fa5c>13349\n<fe11><fe12>7887\n<fe45><fe46>12639\n<fe47><fe48>7903\n<ff5f><ff60>12131\nendcidrange\nbegincidchar\n<d83cdd00>8061\n<d83cde02>10985\n<d83cde37>11024\n<d840dc0b>13839\n<d840dc89>17233\n<d840dc8a>14108\n<d840dca2>17240\n<d840dca4>17243\n<d840dcb0>14209\n<d840dcf5>20057\n<d840dd58>20075\n<d840dda2>13857\n<d840de13>17259\n<d840df2b>17282\n<d840df71>17291\n<d840df81>17289\n<d840dff9>17295\n<d841dc4a>17297\n<d841dd09>17299\n<d841dd3f>14188\n<d841ddb1>20080\n<d841ddd6>17308\n<d841de11>14294\n<d841de28>14105\n<d841deec>20083\n<d841df4f>17312\n<d841dfc8>20128\n<d842dc07>17319\n<d842dc3a>17321\n<d842dcb9>17327\n<d842dd0e>13523\n<d842dd7c>17331\n<d842dd84>14109\n<d842dd9d>17332\n<d842de64>13755\n<d842ded3>17337\n<d842df1d>17340\n<d842df9f>13803\n<d842dfb7>13706\n<d843dd45>17359\n<d843dd58>20090\n<d843dde1>17373\n<d843de64>17388\n<d843de6d>17380\n<d843de95>17379\n<d843df5f>17391\n<d844de01>17414\n<d844de3d>13953\n<d844de55>17415\n<d844de74>17421\n<d844de7b>17417\n<d844ded7>17429\n<d844dee4>17428\n<d844defd>17435\n<d844df1b>16816\n<d844df36>17437\n<d844df44>17438\n<d844dfc4>17449\n<d845dc6d>17462\n<d845dc6e>16821\n<d845ddd7>17472\n<d845de47>17480\n<d845deb4>16838\n<d845df06>17492\n<d845df42>17493\n<d846dcbd>16833\n<d846ddc3>17525\n<d846de1a>7825\n<d847dc56>17539\n<d847dd2d>17544\n<d847dd45>17545\n<d847dd62>17547\n<d847dd78>17546\n<d847dd92>17556\n<d847dd9c>17552\n<d847dda1>17551\n<d847ddb7>17559\n<d847dde0>17561\n<d847de33>17562\n<d847de34>16845\n<d847df1e>17575\n<d847df76>17582\n<d847dffa>17585\n<d848dd7b>17599\n<d848de18>19105\n<d848df1e>17605\n<d848dfad>17608\n<d849de09>15443\n<d849def3>17632\n<d84adc5b>17647\n<d84adcab>17653\n<d84add8f>17657\n<d84adeb8>17667\n<d84adf46>17680\n<d84adfa6>17683\n<d84bdc1d>17682\n<d84bdc24>17686\n<d84bdde1>17710\n<d84bde42>20124\n<d84bdfeb>20130\n<d84cddb6>17744\n<d84cddc3>17742\n<d84cddc4>16888\n<d84cddf5>17743\n<d84cdf72>17761\n<d84cdfcc>14140\n<d84cdfd0>17768\n<d84cdfd2>17764\n<d84cdfd3>17763\n<d84cdfd5>17770\n<d84cdfda>17772\n<d84cdfdf>17774\n<d84cdfe4>17769\n<d84cdffe>15422\n<d84ddc4a>17782\n<d84ddc4b>17784\n<d84ddc51>17783\n<d84ddc65>17788\n<d84ddce4>17814\n<d84ddd5a>17815\n<d84ddd94>17827\n<d84dddc4>16905\n<d84dde38>17843\n<d84dde39>17841\n<d84dde3a>15393\n<d84dde47>17842\n<d84ddf0c>17863\n<d84ddf1c>17854\n<d84ddf3f>16914\n<d84ddf63>16916\n<d84ddf64>17867\n<d84ddfe7>17875\n<d84ddff1>20152\n<d84ddfff>17874\n<d84edc24>17880\n<d84edc3d>17885\n<d84ede98>17897\n<d84fdc7f>17910\n<d84fdcbe>14293\n<d84fdcfe>13904\n<d84fdd00>17925\n<d84fdd0e>18394\n<d84fdd40>17942\n<d84fddd3>17945\n<d84fddf9>17944\n<d84fddfa>17943\n<d84fdf7e>17983\n<d850dc4b>20168\n<d850dc96>17998\n<d850dd03>18003\n<d850ddc6>18015\n<d850ddfe>18018\n<d850deee>14282\n<d850dfbc>18039\n<d850dfd0>7838\n<d851de29>18049\n<d851dea5>18055\n<d851dff1>16970\n<d852dc96>18077\n<d852de4d>18104\n<d852df56>18117\n<d852df6f>18119\n<d853dc16>18124\n<d853dd14>13995\n<d853de04>20058\n<d853de0e>18158\n<d853de37>18162\n<d853de6a>18167\n<d853de8b>18170\n<d853dff2>20059\n<d854dc4a>18181\n<d854dc55>18183\n<d854dd22>18185\n<d854dda9>18190\n<d854ddcd>18193\n<d854dde5>18192\n<d854de1e>18195\n<d854de4c>18197\n<d855dc2e>18209\n<d855dc8e>17005\n<d855dcd9>18217\n<d855dd0e>17009\n<d855dda7>18229\n<d855de7f>14075\n<d855df71>17018\n<d855dfa9>18248\n<d855dfb4>18249\n<d856dc74>7670\n<d856ddc4>17024\n<d856ddcc>20112\n<d856ddd4>18268\n<d856ded7>13922\n<d856dee3>18277\n<d856dee4>18276\n<d856def1>18278\n<d856dfb2>18293\n<d857dc4b>18302\n<d857dc64>18303\n<d857dda1>17033\n<d857de2e>18318\n<d857de56>18319\n<d857de62>18322\n<d857de65>18320\n<d857dec2>18327\n<d857ded8>18325\n<d857dee8>18329\n<d857df23>18330\n<d857df5c>18332\n<d857dfd4>18339\n<d857dfe0>18338\n<d857dffb>18345\n<d858dc0c>18344\n<d858dc17>18352\n<d858dc60>18355\n<d858dced>18365\n<d858de22>13691\n<d858de6a>14189\n<d858de70>18385\n<d858de86>18386\n<d858df4c>20311\n<d859dc02>18398\n<d859de7e>18416\n<d859deb0>14100\n<d859df1d>18430\n<d85adcdd>18444\n<d85adcea>18446\n<d85add51>13646\n<d85add6f>18450\n<d85add99>14134\n<d85adddd>18452\n<d85ade1e>18455\n<d85ade58>18459\n<d85ade8c>18463\n<d85adeb7>18466\n<d85adeff>17063\n<d85bdc29>17478\n<d85bdc73>18506\n<d85bdc9e>20206\n<d85bdcdd>18515\n<d85bde40>17089\n<d85bde65>18528\n<d85bdf94>18544\n<d85bdff8>18553\n<d85cdcf4>17103\n<d85cdd0d>18571\n<d85cdd39>18574\n<d85cdfda>18611\n<d85cdfdb>18610\n<d85cdffe>18617\n<d85ddc10>18620\n<d85ddc49>18624\n<d85dde14>18638\n<d85dde15>18637\n<d85dde31>18640\n<d85dde84>17117\n<d85dde93>18645\n<d85ddf0e>18650\n<d85ddf23>18652\n<d85ddf52>18656\n<d85edd85>18672\n<d85eddb4>20133\n<d85ede84>18684\n<d85edfb3>18699\n<d85edfbe>18701\n<d85edfc7>18702\n<d85fdc3c>20220\n<d85fdcb8>18708\n<d85fdd73>20060\n<d85fdda0>18716\n<d85fde10>18718\n<d85fdfb7>13898\n<d860dc8a>18727\n<d860dcbb>18733\n<d860de77>17140\n<d860de82>18745\n<d860def3>18747\n<d860dfcd>17146\n<d861dc0c>18754\n<d861dc55>18757\n<d861dd6b>18770\n<d861ded7>18784\n<d861defa>18787\n<d862dd46>18812\n<d862dd49>18811\n<d862dd6b>18817\n<d862dd87>14253\n<d862dd88>18824\n<d862de1e>18843\n<d862de29>18844\n<d862de43>18848\n<d862de71>18847\n<d862de99>18855\n<d862decd>18856\n<d862dedd>18863\n<d862dee4>18862\n<d862dfc1>18874\n<d862dfef>18875\n<d863dcdd>7641\n<d863dd10>18882\n<d863dd71>18883\n<d863ddfb>18885\n<d863de17>14256\n<d863de1f>18886\n<d863de36>18890\n<d863de89>18893\n<d863deeb>18895\n<d863def6>7673\n<d863df32>18897\n<d863dff8>18903\n<d864dea0>18917\n<d864deb1>18918\n<d865dc90>18935\n<d865ddcf>18944\n<d865de7f>13849\n<d865def0>18959\n<d865df19>18962\n<d865df50>18966\n<d866dcc6>18983\n<d866de72>19001\n<d867dd4b>13717\n<d867dddb>19026\n<d867de15>19036\n<d867de3d>20315\n<d867de49>19038\n<d867de8a>19037\n<d867dec4>19046\n<d867dedb>19054\n<d867dee9>19051\n<d867dfce>19071\n<d867dfd7>19071\n<d868dc1a>19077\n<d868dc2f>19075\n<d868dc82>19084\n<d868dcf9>19083\n<d868dd90>17227\n<d868deb2>20072\n<d868df8c>19109\n<d869dc37>19111\n<d869ddf1>19123\n<d869de02>19125\n<d869de1a>20316\n<d869deb2>19129\n<d86adde6>14145\n<d86ddf46>13780\n<d86ddf51>13866\n<d86ddf53>20088\n<d86ddf5a>20096\n<d86ddf5c>20097\n<d86ddf65>20247\n<d86ddf76>20114\n<d86ddf77>13782\n<d86ddf7c>20125\n<d86ddf82>20141\n<d86ddf89>14064\n<d86ddf8b>20149\n<d86ddf8e>13724\n<d86ddf94>20153\n<d86ddfac>20176\n<d86ddfaf>20180\n<d86ddfbd>14174\n<d86ddfc9>20194\n<d86ddfcf>20201\n<d86ddfd2>20204\n<d86ddfd8>13651\n<d86ddff0>20240\n<d86edc0d>20256\n<d86edc17>20260\n<d86edc1a>14278\n<d87edc04>15388\n<d87edc0f>7814\n<d87edc15>20061\n<d87edc18>7817\n<d87edc1a>13954\n<d87edc22>13684\n<d87edc28>13807\n<d87edc2c>14109\n<d87edc33>13719\n<d87edc3f>13815\n<d87edc46>20062\n<d87edc52>13841\n<d87edc62>13998\n<d87edc6d>14121\n<d87edc73>13832\n<d87edc77>7754\n<d87edc84>7734\n<d87edc99>20063\n<d87edc9a>13928\n<d87edca6>20064\n<d87edcac>13750\n<d87edcb2>13867\n<d87edcb6>14129\n<d87edcd3>7816\n<d87edcdb>14140\n<d87edcdc>7695\n<d87edce1>14291\n<d87edce5>20065\n<d87edcea>13679\n<d87edced>7665\n<d87edcfc>13656\n<d87edd03>13768\n<d87edd0b>13801\n<d87edd0f>13932\n<d87edd1a>13916\n<d87edd20>7839\n<d87edd21>13809\n<d87edd45>13357\n<d87edd47>13854\n<d87edd6c>14180\n<d87edd95>13670\n<d87eddd0>14068\n<d87eddde>20066\n<d87edddf>14069\n<d87eddf4>15269\nendcidchar\nbegincidrange\n<d83cdd10><d83cdd29>10004\n<d83cdd30><d83cdd49>10901\n<d83cdd50><d83cdd69>10631\n<d83cdd70><d83cdd89>11713\n<d84adf4f><d84adf50>17671\n<d85bdff6><d85bdff7>18554\n<d861ddc8><d861ddc9>18773\n<d862ddba><d862ddbb>18834\nendcidrange\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJIS-X32",
    "content": "begincmap\n/CMapName /UniJIS-X32 def\n/WMode 0 def\n/UniJIS-X usecmap\nbegincidchar\n<7c>99\n<7e>100\n<a0>1\n<a6>93\n<0102>15756\n<0103>15769\n<0104>15737\n<0105>15745\n<0106>15758\n<0107>15771\n<0108>15783\n<0109>15789\n<010a>20333\n<010b>20352\n<010c>15759\n<010d>15772\n<010e>15761\n<010f>15774\n<0110>20322\n<0111>15775\n<0116>20334\n<0117>20353\n<0118>15760\n<0119>15773\n<011c>15784\n<011d>15790\n<011e>20335\n<011f>20355\n<0120>20337\n<0121>20356\n<0122>20336\n<0124>15785\n<0125>15791\n<0126>20323\n<0127>15816\n<012e>20339\n<012f>20357\n<0130>20338\n<0132>20324\n<0133>20328\n<0134>15786\n<0135>15792\n<0136>20340\n<0137>20358\n<0138>20329\n<0139>15757\n<013a>15770\n<013b>20342\n<013c>20360\n<013d>15739\n<013e>15747\n<013f>20325\n<0140>20330\n<0143>15762\n<0144>15776\n<0145>20343\n<0146>20361\n<0147>15763\n<0148>15777\n<0149>20331\n<014a>20326\n<0150>15764\n<0151>15778\n<0154>15755\n<0155>15768\n<0156>20344\n<0157>20362\n<0158>15765\n<0159>15779\n<015a>15740\n<015b>15748\n<015c>15787\n<015d>15793\n<015e>15741\n<015f>15750\n<0162>15767\n<0163>15781\n<0164>15742\n<0165>15751\n<0166>20327\n<0167>20332\n<016c>15788\n<016d>15794\n<0170>15766\n<0171>15780\n<0172>20345\n<0173>20363\n<0174>20350\n<0175>20364\n<0176>20351\n<0177>20365\n<0179>15743\n<017a>15752\n<017b>15744\n<017c>15754\n<0192>105\n<0193>15826\n<01c2>15821\n<01d5>20349\n<01d6>15733\n<01d7>20346\n<01d8>15734\n<01d9>20348\n<01da>15735\n<01db>20347\n<01dc>15736\n<01f5>20354\n<0237>9435\n<0250>15832\n<0252>15836\n<0253>15822\n<0255>15841\n<0256>15802\n<0257>15823\n<0258>15829\n<025c>15830\n<025e>15831\n<025f>15809\n<0260>15825\n<0261>15813\n<0264>15835\n<0265>15838\n<0266>15819\n<0267>15844\n<0268>15827\n<026a>15885\n<026c>15798\n<026d>15808\n<026e>15799\n<026f>15833\n<0270>15814\n<0271>15795\n<0272>15810\n<0273>15803\n<0274>15886\n<0276>15887\n<0278>15888\n<0279>15800\n<027a>15843\n<027b>15807\n<027d>15804\n<027e>15797\n<0280>15889\n<0281>15815\n<0282>15805\n<0284>15824\n<0288>15801\n<0289>15828\n<028a>15834\n<028b>15796\n<028d>15837\n<028e>15812\n<028f>15890\n<0290>15806\n<0291>15842\n<0294>15818\n<0295>15817\n<0298>15820\n<0299>15891\n<029c>15892\n<029d>15811\n<029f>15893\n<02a1>15840\n<02a2>15839\n<02b0>15894\n<02b2>15895\n<02b7>15896\n<02bb>98\n<02bc>96\n<02c1>15897\n<02c6>128\n<02c7>15749\n<02c8>15846\n<02cc>15847\n<02d1>15848\n<02d8>15738\n<02d9>15782\n<02da>133\n<02db>15746\n<02dc>95\n<02dd>15753\n<02de>15867\n<030f>15850\n<031a>15879\n<031c>15861\n<0324>15868\n<0325>15858\n<0329>15865\n<032a>15876\n<032c>15859\n<032f>15866\n<0330>15869\n<0334>15871\n<0339>15860\n<033c>15870\n<033d>15864\n<0361>15845\n<0386>20427\n<038c>20432\n<038e>20433\n<038f>20435\n<0390>20441\n<03aa>20431\n<03ab>20434\n<03b0>20445\n<03c2>16222\n<03ca>20440\n<03cb>20444\n<03ce>20446\n<03d5>12094\n<1f70>9420\n<1f71>9419\n<1f72>9434\n<1f73>9433\n<2018>98\n<2019>96\n<201c>108\n<201d>122\n<203e>226\n<203f>15849\n<2042>16282\n<2051>16281\n<205a>7898\n<205d>7897\n<207f>15908\n<20dd>16328\n<20de>11035\n<2127>15515\n<212e>20366\n<213b>8307\n<2150>9790\n<2151>9800\n<2152>9806\n<2155>15727\n<2189>9780\n<21cb>12207\n<2206>20367\n<2209>15476\n<220f>20368\n<2219>117\n<223c>100\n<2245>15507\n<2248>15508\n<2262>15505\n<229e>15906\n<2318>15728\n<239b>12143\n<239c>12167\n<239f>12167\n<23a0>12146\n<23a1>12151\n<23a2>12167\n<23a5>12167\n<23a6>12154\n<23aa>12167\n<23ce>16273\n<2423>16272\n<24ff>10503\n<25b1>16235\n<25ca>20371\n<266b>16200\n<266e>16199\n<26a0>12192\n<26bd>20957\n<26be>12097\n<2713>16270\n<273f>12229\n<2740>12228\n<277f>10514\n<29bf>16203\n<2b1a>11036\n<2e9e>17893\n<2eac>19130\n<303b>12106\n<303c>16194\n<303d>12179\n<309f>12181\n<30a0>16205\n<30ff>16195\n<3244>10498\n<3251>8091\n<3406>17242\n<342c>17246\n<342e>14216\n<3468>14047\n<346a>17269\n<3492>17294\n<34b5>16793\n<34bc>17303\n<34c1>18384\n<34c7>17307\n<3563>17344\n<356e>17348\n<35a6>17369\n<35a8>17371\n<35c5>17377\n<35da>17386\n<35de>20067\n<35f4>17395\n<3605>17402\n<3614>19131\n<364a>17441\n<3691>17473\n<3696>17477\n<3699>17475\n<36cf>17494\n<376b>17533\n<376c>17532\n<3775>17536\n<37c1>17550\n<37e8>17570\n<37f4>17573\n<37fd>17576\n<3800>17578\n<382f>17588\n<3836>17589\n<3840>17590\n<385c>17594\n<3861>17596\n<38a1>20171\n<38ad>19132\n<38fa>13852\n<3917>17625\n<391a>17628\n<396f>17643\n<39a4>20122\n<39b8>20123\n<3a5c>20127\n<3a6e>17713\n<3a73>17716\n<3a85>20142\n<3ac4>20135\n<3acb>20136\n<3ad6>17731\n<3ad7>17758\n<3aea>17741\n<3b0e>17752\n<3b1a>17756\n<3b1c>17757\n<3b6d>17804\n<3b77>17797\n<3b87>17826\n<3b8d>17828\n<3ba4>17834\n<3bb6>16910\n<3bc3>16911\n<3bcd>17848\n<3bf0>17865\n<3bf3>20151\n<3c0f>16919\n<3c26>17887\n<3cc3>17916\n<3cd2>17921\n<3d11>17957\n<3d1e>17968\n<3d31>20158\n<3d4e>7655\n<3d64>17994\n<3d9a>18008\n<3dc0>18026\n<3dcc>19133\n<3dd4>18031\n<3e05>18043\n<3e3f>16968\n<3e40>20170\n<3e60>18059\n<3e66>18061\n<3e68>18062\n<3e83>18069\n<3e94>18075\n<3f57>18123\n<3f72>16984\n<3f75>18137\n<3f77>18139\n<3fae>18157\n<3fc9>18168\n<3fd7>18173\n<3fdc>19134\n<4039>18191\n<4058>18198\n<4105>18235\n<4148>18247\n<414f>18250\n<4163>18254\n<41b4>18269\n<41bf>18272\n<41e6>18283\n<41ee>18287\n<41f3>18284\n<4207>18294\n<420e>18297\n<42c6>18335\n<42d6>18346\n<42dd>18350\n<4302>18364\n<432b>18377\n<4343>18379\n<43ee>18423\n<43f0>18426\n<4408>18432\n<4417>18434\n<441c>18435\n<4422>18437\n<445b>17060\n<4476>18460\n<447a>18461\n<4491>18467\n<44b3>18494\n<44be>18492\n<44d4>18493\n<4508>18524\n<450d>18520\n<4525>14206\n<4543>18540\n<459d>17108\n<45b8>18592\n<45be>19135\n<45e5>18618\n<45ea>17113\n<460f>18634\n<4610>19136\n<4641>18648\n<46a1>18665\n<46af>18669\n<470c>18690\n<471f>20219\n<4764>18712\n<47e6>14224\n<47fd>18724\n<4816>18734\n<481e>20225\n<4844>17141\n<484e>18746\n<48b5>18779\n<49b0>17183\n<49e7>18898\n<49fa>18902\n<4a04>18907\n<4a29>18910\n<4abc>18934\n<4b38>13791\n<4b3b>18958\n<4b7e>19137\n<4bc2>18995\n<4bca>18997\n<4bd2>18999\n<4c17>17204\n<4c20>19016\n<4c38>19138\n<4cc4>19076\n<4cd1>19079\n<4ce1>19139\n<4d07>19099\n<4d77>19115\n<4e02>17234\n<4e0c>19140\n<4e0f>17235\n<4e12>17236\n<4e29>17237\n<4e2e>17238\n<4e35>21075\n<4e47>17239\n<4e51>17241\n<4e5c>21076\n<4e63>21077\n<4e68>21078\n<4e69>17244\n<4e79>19143\n<4e97>21081\n<4e9d>17245\n<4eaf>21082\n<4ebc>17247\n<4ec3>17248\n<4ec8>17249\n<4eda>17251\n<4edb>21083\n<4ee2>21084\n<4ee8>21085\n<4eeb>17250\n<4eef>21086\n<4ef1>17252\n<4ef3>19144\n<4ef5>17253\n<4efe>21087\n<4f02>21088\n<4f08>21089\n<4f0c>19145\n<4f12>21090\n<4f16>17254\n<4f17>21091\n<4f19>19146\n<4f2b>19147\n<4f2e>19148\n<4f31>19149\n<4f33>21092\n<4f35>21093\n<4f37>17256\n<4f3e>17257\n<4f40>21094\n<4f42>21095\n<4f48>16779\n<4f52>21098\n<4f58>17258\n<4f5f>16780\n<4f63>21099\n<4f64>17255\n<4f6a>16781\n<4f6c>16782\n<4f6e>21100\n<4f71>21101\n<4f79>21102\n<4f81>21103\n<4f82>17262\n<4f84>19150\n<4f85>17263\n<4f89>21104\n<4f8c>21105\n<4f8e>21106\n<4f90>21107\n<4f93>21108\n<4f99>21109\n<4f9e>19151\n<4f9f>21110\n<4fb2>17265\n<4fb7>19152\n<4fb9>21111\n<4fc5>17266\n<4fc6>21117\n<4fc8>21118\n<4fcb>17267\n<4fcc>21119\n<4fd2>17268\n<4fdc>21120\n<4fe2>21121\n<4fe6>17264\n<4ff0>21122\n<4ff1>13731\n<4ff2>17270\n<4ffc>21123\n<5002>20299\n<5004>19153\n<5007>21124\n<500a>21125\n<500c>19154\n<500e>16783\n<5013>17271\n<5017>21126\n<5018>16784\n<501c>17272\n<501d>21127\n<5030>21128\n<5035>21131\n<5041>16785\n<5045>21132\n<504a>21133\n<504c>19155\n<504e>17273\n<5053>17274\n<5059>21136\n<505f>19156\n<5060>21137\n<5062>19157\n<5063>17275\n<5067>21138\n<506d>21139\n<5071>21140\n<5077>19158\n<5081>21141\n<5086>21144\n<5088>17277\n<508a>21145\n<508e>19159\n<5090>21146\n<5095>17280\n<509b>21147\n<509e>19160\n<50a2>19161\n<50a3>17276\n<50aa>17281\n<50b1>17283\n<50b9>21153\n<50bd>21154\n<50c0>21155\n<50c3>19162\n<50c4>17286\n<50c7>17287\n<50ce>17290\n<50d0>16787\n<50d3>21156\n<50d4>17292\n<50df>21159\n<50e1>17293\n<50e2>21160\n<50e4>21161\n<50e8>19163\n<50f1>19164\n<50f2>16786\n<50f3>17288\n<50f6>21162\n<50fa>21163\n<50fe>19165\n<5103>16789\n<5106>16788\n<5107>19166\n<5117>17296\n<5119>21165\n<5123>21168\n<512f>21173\n<5131>21174\n<5133>19170\n<5134>21175\n<5135>16790\n<5138>19171\n<5139>21176\n<5142>21177\n<514f>21178\n<5153>21179\n<5155>16791\n<5157>16792\n<5158>21180\n<5160>17298\n<5166>21181\n<5173>17300\n<5174>19172\n<517b>18393\n<517e>21182\n<5183>17301\n<5184>19173\n<518b>17302\n<518e>21183\n<5198>17304\n<51a3>17305\n<51ad>17306\n<51b8>19174\n<51ba>19175\n<51bf>21184\n<51c2>21185\n<51c8>19176\n<51ca>16794\n<51cf>19177\n<51d1>19178\n<51d2>21186\n<51d5>21187\n<51d8>19181\n<51de>20300\n<51df>19182\n<51e2>16795\n<51e5>21188\n<51f2>21189\n<51f3>17309\n<51f7>21190\n<5205>19183\n<5212>17310\n<5216>17311\n<5218>21191\n<5222>21192\n<5226>19184\n<5228>19185\n<522b>19186\n<5235>19189\n<523c>19190\n<5245>21193\n<5255>17313\n<5257>16796\n<5258>21194\n<525a>19191\n<525c>17314\n<525f>21195\n<5260>19192\n<526c>17315\n<526e>19193\n<5277>17316\n<5280>21196\n<5282>17318\n<5284>17317\n<5285>21197\n<528a>19196\n<528c>19197\n<5298>17320\n<529a>21201\n<52a4>17322\n<52a5>21202\n<52a7>21203\n<52b0>21204\n<52bd>21208\n<52c4>21209\n<52c6>21210\n<52ca>17325\n<52cc>16797\n<52cf>21211\n<52d1>17326\n<52d4>21212\n<52d6>16798\n<52dc>21213\n<52e1>19198\n<52e5>21214\n<52e8>21215\n<52e9>19199\n<52ea>21216\n<52ec>21217\n<52f1>19200\n<52f4>21218\n<52f6>21219\n<52f7>17328\n<52fb>16799\n<5303>19201\n<5307>20301\n<530c>21220\n<5311>19202\n<5313>21221\n<5318>21222\n<531b>21223\n<531c>16800\n<531e>21224\n<531f>19203\n<5325>21225\n<532d>19204\n<5330>21231\n<5332>19205\n<5335>17329\n<533c>21232\n<533d>19206\n<5342>17330\n<5359>21233\n<535b>21234\n<5363>16801\n<5365>19207\n<5367>17333\n<536d>19208\n<5379>19209\n<537a>17334\n<537e>19210\n<5383>21236\n<538e>21239\n<5394>19211\n<5399>19212\n<539d>16802\n<53a1>21240\n<53a4>17335\n<53aa>19213\n<53af>19214\n<53b4>17336\n<53b5>21241\n<53b7>17338\n<53b8>21242\n<53ba>19215\n<53bd>21243\n<53c0>17339\n<53c1>19216\n<53cf>21244\n<53d5>17343\n<53de>21247\n<53e0>19219\n<53e7>21249\n<53f4>17345\n<5402>21250\n<5412>16803\n<5413>19220\n<541a>21251\n<541e>13964\n<5421>21252\n<5424>17346\n<5428>17347\n<542a>19221\n<542f>21253\n<5431>19222\n<5443>17349\n<5444>21254\n<5447>21255\n<544c>19225\n<544f>21256\n<545e>21257\n<5462>17350\n<5464>21258\n<5467>21259\n<5469>21260\n<546c>17351\n<547f>16804\n<5481>21263\n<5483>21264\n<5485>21265\n<5488>16805\n<5489>21266\n<5491>21267\n<5495>17352\n<549f>21268\n<54a0>17353\n<54a6>17354\n<54a7>19226\n<54aa>19227\n<54ae>17355\n<54b1>19228\n<54b7>17356\n<54ba>17357\n<54bb>19229\n<54c3>17358\n<54ca>21269\n<54ce>19230\n<54e0>21270\n<54ea>19231\n<54ec>17360\n<54ef>17361\n<54f1>17362\n<54f3>17363\n<54f6>21271\n<54fc>19232\n<54fe>21272\n<5505>19233\n<5508>19234\n<5509>17366\n<5515>19235\n<5527>19236\n<552a>19237\n<5532>21275\n<5536>19238\n<553b>21276\n<553c>17367\n<553d>21277\n<5541>17368\n<5547>17370\n<5549>21278\n<554d>21279\n<5550>16806\n<5551>19239\n<5558>21280\n<5561>20308\n<5564>17372\n<5566>19240\n<557d>17374\n<557f>21283\n<5581>16807\n<5582>17375\n<558f>19241\n<5591>17376\n<5592>19242\n<5593>21284\n<5594>19243\n<5597>21285\n<55a3>21286\n<55a4>19244\n<55ad>16808\n<55b2>19245\n<55bf>17381\n<55c1>21287\n<55c3>19246\n<55c6>19247\n<55c9>17382\n<55cb>21288\n<55cc>17383\n<55ce>16809\n<55d1>17384\n<55d2>17378\n<55d3>19248\n<55db>19249\n<55dd>17385\n<55de>21291\n<55e2>17387\n<55e9>17389\n<55ec>19250\n<55ee>19251\n<55f1>19252\n<55f6>19253\n<55f8>19254\n<55ff>21292\n<5605>19255\n<5607>17392\n<560a>21294\n<560d>19256\n<5610>17393\n<5619>21295\n<5628>17390\n<562c>19259\n<5630>17394\n<5633>21296\n<5635>19260\n<5639>19261\n<563b>16810\n<563c>21297\n<563d>17396\n<5640>17397\n<5641>21298\n<5646>21301\n<5647>17398\n<564d>19262\n<5654>19263\n<565e>17399\n<5660>17400\n<566d>17401\n<5675>21305\n<5684>21306\n<5685>19264\n<5688>17403\n<568b>21307\n<568c>17404\n<569d>17405\n<569e>16811\n<569f>19265\n<56a6>19266\n<56a7>21308\n<56a8>17406\n<56a9>16812\n<56ab>21309\n<56b2>17407\n<56b3>16813\n<56b7>19267\n<56be>21310\n<56c5>17408\n<56cb>21311\n<56cc>19268\n<56cd>17409\n<56cf>19269\n<56d0>21312\n<56d9>19270\n<56dc>21313\n<56df>17410\n<56e1>19271\n<56e8>17411\n<56eb>19272\n<56ed>19273\n<56f1>19274\n<5707>19275\n<570c>19276\n<5711>21319\n<571d>19279\n<5720>21320\n<5722>21321\n<5729>17416\n<572a>21324\n<572c>19280\n<572e>19281\n<573f>21325\n<574d>17420\n<5752>21326\n<575f>19284\n<5762>21327\n<5767>21328\n<5768>17422\n<576b>19285\n<576d>19286\n<576e>21329\n<576f>17423\n<5771>21330\n<5777>16814\n<5779>21331\n<577a>19287\n<577b>17427\n<577c>16815\n<577e>21332\n<5781>21333\n<5783>19288\n<5794>21334\n<5795>21338\n<5797>19289\n<5799>21335\n<579a>17430\n<579f>21336\n<57a1>21337\n<57a7>21339\n<57a8>17433\n<57a9>21340\n<57ae>19290\n<57bd>21341\n<57cc>17436\n<57cf>16817\n<57d5>19291\n<57d7>17434\n<57dd>21342\n<57de>17439\n<57e1>21347\n<57e4>16818\n<57e7>19292\n<57e9>21343\n<57f0>17440\n<57f8>17442\n<57fb>17443\n<57fd>17444\n<57fe>21344\n<5803>21345\n<5804>17445\n<5808>21346\n<580c>21348\n<580d>19293\n<581b>21349\n<581e>17446\n<581f>21350\n<5826>19294\n<5827>17447\n<582d>21351\n<5839>17448\n<583f>21352\n<5849>17450\n<584c>17451\n<584d>19295\n<584f>19296\n<5850>21353\n<5855>21354\n<585f>19297\n<5864>16819\n<5867>17452\n<5868>21355\n<586d>19298\n<5878>21356\n<587f>19299\n<5881>19300\n<5889>16820\n<588c>21359\n<588d>17455\n<5894>17458\n<5896>21360\n<5898>19301\n<589d>17459\n<58a6>21364\n<58aa>17460\n<58b1>17461\n<58bc>19302\n<58c2>21366\n<58c3>17463\n<58c4>21365\n<58c8>21367\n<58cd>17464\n<58d2>16822\n<58d6>21368\n<58dd>21369\n<58e0>16823\n<58e1>21370\n<58e2>17465\n<5905>17468\n<590d>17470\n<5914>17471\n<591d>21374\n<591f>19303\n<5921>21375\n<5923>19304\n<5928>21376\n<5930>21377\n<5933>21378\n<593d>17474\n<593f>21381\n<5943>21382\n<5946>17476\n<5952>21383\n<5959>19305\n<595e>21384\n<595f>17479\n<596b>21385\n<596f>21386\n<5972>21387\n<5979>19306\n<597b>21388\n<597c>17483\n<598b>16825\n<598c>21389\n<598e>21390\n<5992>16826\n<5995>21391\n<5997>19307\n<599f>17484\n<59a7>21392\n<59ad>21393\n<59ae>17485\n<59af>19308\n<59b0>21394\n<59b3>19309\n<59b7>21395\n<59bc>17486\n<59c1>21396\n<59c3>16827\n<59c4>21397\n<59c8>17487\n<59cd>17488\n<59de>17489\n<59df>19310\n<59e7>17490\n<59ee>17491\n<59ef>21398\n<59f1>19311\n<59f2>21399\n<59f4>21400\n<59f7>21401\n<59f8>19312\n<5a00>21402\n<5a0d>17495\n<5a0e>21403\n<5a12>21404\n<5a13>16828\n<5a17>17496\n<5a1e>21405\n<5a24>21406\n<5a27>17497\n<5a28>21407\n<5a2a>21408\n<5a2d>17498\n<5a30>21409\n<5a48>21412\n<5a4c>21413\n<5a50>21414\n<5a5e>21415\n<5a65>17499\n<5a67>16829\n<5a77>16830\n<5a7a>17500\n<5a7b>21416\n<5a84>16831\n<5a8b>17501\n<5a90>21417\n<5a93>21418\n<5a96>21419\n<5a99>21420\n<5a9c>17502\n<5aa2>17505\n<5ab1>17506\n<5ab2>19313\n<5ab5>17507\n<5ab8>19314\n<5aba>17508\n<5abb>21421\n<5abf>17509\n<5ac4>16832\n<5ac6>21422\n<5ac8>21423\n<5acf>21424\n<5ada>17510\n<5adc>17511\n<5ae5>17512\n<5aea>19315\n<5aee>17514\n<5af0>17513\n<5af5>17515\n<5af6>19316\n<5afd>21425\n<5b01>21426\n<5b08>17516\n<5b17>17517\n<5b1b>19317\n<5b1d>19318\n<5b21>19319\n<5b34>17518\n<5b38>19320\n<5b4b>21427\n<5b4c>17519\n<5b52>17520\n<5b5e>21428\n<5b68>17521\n<5b6e>21429\n<5b6f>17522\n<5b76>14120\n<5b7d>16834\n<5b81>17523\n<5b84>17524\n<5b86>21430\n<5b8e>21431\n<5b93>16835\n<5b94>21434\n<5b96>17526\n<5bac>17527\n<5bad>21437\n<5baf>21438\n<5bb7>19321\n<5bba>21441\n<5bbc>21442\n<5bc1>21443\n<5bcd>21444\n<5bce>17530\n<5bcf>21445\n<5bd6>17531\n<5bd7>19322\n<5be0>19323\n<5bec>20302\n<5bef>21448\n<5bf1>17534\n<5bf4>21449\n<5bfd>17535\n<5c03>17537\n<5c0c>21450\n<5c12>16836\n<5c17>21451\n<5c1f>19324\n<5c26>21452\n<5c29>17538\n<5c2a>19325\n<5c2c>19326\n<5c2e>21453\n<5c32>21454\n<5c35>21455\n<5c36>19327\n<5c59>19328\n<5c5a>21456\n<5c5c>19329\n<5c5f>17540\n<5c6d>19330\n<5c70>17543\n<5c7a>16839\n<5c7b>21459\n<5c7d>21460\n<5c87>21461\n<5c88>17548\n<5c8a>17549\n<5c8f>16840\n<5c92>21462\n<5c9d>21463\n<5c9f>16841\n<5ca0>17553\n<5ca2>17554\n<5ca3>16842\n<5ca7>17555\n<5caa>16843\n<5cad>17557\n<5cb2>21464\n<5cb4>21465\n<5cb5>17558\n<5cc9>17560\n<5cd0>16844\n<5cd7>21466\n<5cdd>19331\n<5cee>21467\n<5d01>19332\n<5d06>17563\n<5d0d>16846\n<5d10>17564\n<5d12>21470\n<5d1d>17566\n<5d20>17567\n<5d23>21471\n<5d2b>17565\n<5d31>17568\n<5d34>19333\n<5d39>17569\n<5d3d>19334\n<5d3f>21472\n<5d47>16847\n<5d48>21473\n<5d51>21475\n<5d55>21474\n<5d59>19335\n<5d61>17571\n<5d62>21478\n<5d64>21479\n<5d6a>17572\n<5d70>17574\n<5d7e>19336\n<5d7f>21482\n<5d81>16848\n<5d83>19337\n<5d88>17577\n<5d8a>21483\n<5d93>21484\n<5d95>21485\n<5d97>17579\n<5d9b>21486\n<5d9f>21487\n<5da4>16849\n<5da7>16850\n<5dab>21488\n<5db0>17580\n<5db2>15405\n<5db4>17581\n<5dc3>21489\n<5dc7>19338\n<5dcb>16851\n<5dce>21490\n<5dd1>17583\n<5dd7>17584\n<5dd9>21491\n<5de4>17586\n<5de9>17587\n<5df9>19339\n<5e07>21492\n<5e0d>21493\n<5e1f>17591\n<5e20>21494\n<5e28>19340\n<5e32>19341\n<5e35>19342\n<5e3e>17592\n<5e49>17593\n<5e4b>21495\n<5e56>17595\n<5e5b>19343\n<5e5c>21498\n<5e5e>16852\n<5e68>19344\n<5e6a>19345\n<5e70>21499\n<5e77>19346\n<5e80>19347\n<5e8b>19348\n<5e8e>21500\n<5ea2>21501\n<5ea4>21502\n<5ea5>17600\n<5eac>17601\n<5eb1>21503\n<5eb3>19349\n<5eb9>17602\n<5ebd>19350\n<5ec6>17603\n<5ecb>15390\n<5ecc>21504\n<5ece>21505\n<5ed1>19351\n<5ed9>17604\n<5edc>21506\n<5ede>21507\n<5ee5>21508\n<5eeb>21509\n<5ef9>16853\n<5efd>17606\n<5f00>16854\n<5f02>16855\n<5f06>21510\n<5f08>17607\n<5f19>21511\n<5f1e>17609\n<5f23>16856\n<5f24>21512\n<5f2e>21515\n<5f30>21516\n<5f3d>16857\n<5f3f>21517\n<5f44>21518\n<5f47>17610\n<5f4d>19354\n<5f54>16858\n<5f5b>21519\n<5f60>21520\n<5f63>17611\n<5f6f>21521\n<5f72>17612\n<5f78>21524\n<5f7a>21525\n<5f7d>16859\n<5f7e>17613\n<5f8d>21526\n<5f8f>17614\n<5f96>21527\n<5f9d>21528\n<5fa2>17615\n<5fab>21529\n<5fac>19355\n<5fc7>17616\n<5fc8>21532\n<5fcb>17617\n<5fe2>17621\n<5fe8>21535\n<5fea>19356\n<5fec>21536\n<5ff2>21537\n<5ff3>17624\n<5ff6>21538\n<5ffa>21539\n<6007>19357\n<600a>21540\n<600d>16860\n<6013>21541\n<6014>16861\n<6018>16862\n<601f>21542\n<6022>17626\n<6024>17627\n<602d>21543\n<6035>16863\n<6040>21544\n<6047>16864\n<6048>21545\n<6049>19358\n<604c>17629\n<6051>21546\n<6054>19359\n<6067>19360\n<6071>21549\n<607e>21550\n<6082>21551\n<6086>21552\n<6088>21553\n<608e>21554\n<6091>21555\n<6093>21556\n<6095>17630\n<6098>21557\n<609d>16865\n<60a2>21559\n<60a5>21560\n<60a8>17631\n<60b1>17633\n<60b7>21561\n<60bb>19361\n<60be>17634\n<60c2>21562\n<60c4>19362\n<60c8>17635\n<60d4>16866\n<60d9>17636\n<60dd>16867\n<60e2>21567\n<60e5>21568\n<60ee>17637\n<60f5>17638\n<60fc>21569\n<60fd>19363\n<6102>21570\n<6107>21571\n<610a>19364\n<610c>21572\n<6110>17639\n<6116>19365\n<6117>21573\n<6119>17640\n<611e>17641\n<6122>21574\n<612a>19366\n<612b>16868\n<6131>21575\n<6135>21576\n<6136>19367\n<6139>21577\n<613a>17642\n<6141>17644\n<6145>21578\n<6146>17645\n<6149>21579\n<615e>19368\n<6160>17646\n<6164>19369\n<616c>21580\n<6172>21581\n<6178>21582\n<617b>19370\n<617d>19371\n<617f>19372\n<618b>21587\n<6197>17650\n<619c>21588\n<619d>19373\n<61a0>21589\n<61a5>17651\n<61aa>21590\n<61ad>17652\n<61b8>19374\n<61b9>16870\n<61bc>16869\n<61d5>17654\n<61dc>19375\n<61dd>17655\n<61de>21595\n<61e1>21596\n<61e2>19376\n<61e5>19377\n<61e7>21597\n<61e8>19378\n<61e9>21598\n<61ef>21601\n<61f5>17656\n<6201>21602\n<6203>21603\n<6204>19379\n<6207>19380\n<621c>21604\n<6220>21605\n<6222>16871\n<6223>17658\n<6227>21606\n<622b>21607\n<6231>19381\n<6239>19382\n<623d>19383\n<6242>21608\n<6244>21609\n<6250>21610\n<6252>17659\n<6254>21611\n<625a>16872\n<625c>21612\n<6261>17660\n<6264>17661\n<626d>17663\n<626f>16873\n<6273>17664\n<627a>19384\n<627b>17662\n<627d>21613\n<6290>19385\n<6299>17665\n<62a8>19386\n<62b3>21617\n<62ba>21620\n<62ce>21623\n<62d5>17666\n<62d6>16874\n<62da>19387\n<62ea>21624\n<62f2>21625\n<62f4>19388\n<62fd>17668\n<6303>17669\n<6304>21626\n<630b>21627\n<6310>17670\n<6313>21628\n<6316>19389\n<6329>21629\n<632a>19390\n<632d>21630\n<6332>17673\n<6335>17674\n<6336>19391\n<6341>17677\n<6344>17678\n<6346>19392\n<634a>21631\n<634b>19393\n<634e>17679\n<6352>21632\n<6353>19394\n<6354>21633\n<6358>21634\n<6359>17681\n<635b>21635\n<6366>21636\n<636c>17684\n<636d>21637\n<6371>19395\n<6375>19396\n<6378>21638\n<637c>16875\n<637f>19397\n<6382>19398\n<638a>19399\n<6394>17687\n<6395>21639\n<6399>17685\n<639a>21640\n<63a4>21641\n<63a6>21642\n<63ad>21643\n<63bd>17688\n<63c1>21644\n<63c5>21645\n<63c8>21646\n<63ce>21647\n<63d3>21648\n<63e0>17691\n<63e5>16876\n<63ea>19402\n<63f2>17694\n<63f3>21649\n<640a>21650\n<6412>19405\n<6418>19406\n<641e>17695\n<6420>19407\n<6424>19408\n<6425>17696\n<6429>17697\n<642a>19409\n<642f>17698\n<6430>21651\n<6435>19410\n<643d>19411\n<643f>19412\n<644b>21652\n<644f>21653\n<6452>19413\n<6453>21654\n<645a>17699\n<645c>21655\n<645d>17700\n<645f>19414\n<6461>21656\n<6463>21657\n<6473>17701\n<6474>19415\n<6479>16877\n<647d>17702\n<6485>21658\n<6487>17703\n<648f>21659\n<6490>19416\n<6491>17704\n<649b>21660\n<649f>17705\n<64a1>21661\n<64a3>21662\n<64a6>21663\n<64a8>21664\n<64ac>19419\n<64b3>19420\n<64bd>21665\n<64c4>16878\n<64c9>21666\n<64d0>16879\n<64d1>21667\n<64d5>17708\n<64d7>17709\n<64e4>17711\n<64ed>19421\n<64f0>19422\n<64f5>21670\n<64ff>17712\n<6501>21671\n<650f>17714\n<6513>21675\n<6514>17715\n<651b>19423\n<651e>17717\n<651f>19424\n<6526>21676\n<6529>16880\n<652e>19425\n<6531>21677\n<6532>17718\n<653a>21678\n<6543>21681\n<6544>17719\n<6549>19426\n<6550>21682\n<6552>21683\n<6554>17720\n<655f>21684\n<6560>19427\n<656b>17721\n<657a>17722\n<657d>21685\n<6584>17723\n<658a>17724\n<6592>19428\n<6595>19429\n<6598>21686\n<659d>16881\n<65a0>21687\n<65a3>21688\n<65a6>21689\n<65ae>21690\n<65b2>17725\n<65b3>21691\n<65b4>19430\n<65b5>17726\n<65b8>17727\n<65be>19431\n<65bf>17728\n<65c8>19432\n<65c9>17729\n<65ce>19433\n<65d0>19434\n<65d4>17730\n<65d6>21692\n<65d8>21693\n<65df>19435\n<65f9>17732\n<65fc>17733\n<6604>17734\n<6608>17735\n<660d>21699\n<6616>21702\n<661d>21703\n<661e>20304\n<6621>17736\n<6622>16883\n<6623>21704\n<6626>21705\n<6629>21706\n<662a>17737\n<662b>16884\n<6630>16885\n<6633>16886\n<6637>21708\n<6639>21707\n<663a>16882\n<6640>21709\n<6645>17738\n<6646>21710\n<6648>16887\n<664a>21711\n<664e>17740\n<6651>17739\n<6658>21712\n<665a>13377\n<6660>21713\n<666a>17745\n<6675>21714\n<6679>21716\n<667b>17748\n<667c>21717\n<667e>19436\n<667f>21715\n<6680>17749\n<668d>16891\n<6690>17750\n<6692>17751\n<669f>21721\n<66ad>17753\n<66b1>17754\n<66b3>19439\n<66bb>16892\n<66c0>19440\n<66cc>21725\n<66ce>21726\n<66cf>19441\n<66d4>21727\n<66db>16893\n<66df>21728\n<66e8>16894\n<66eb>21729\n<66ee>21730\n<6701>17759\n<6707>21731\n<6712>17760\n<6719>17762\n<671c>21732\n<6720>21733\n<6722>21734\n<6725>19442\n<6735>19443\n<673e>21735\n<6745>21736\n<6747>16895\n<674d>17765\n<6754>17766\n<6755>19444\n<675d>17767\n<676c>21737\n<6774>17771\n<6780>19445\n<6781>16896\n<6784>21738\n<678e>21739\n<678f>19446\n<6791>19447\n<6792>17773\n<6793>16897\n<6796>21740\n<6798>16898\n<6799>21741\n<679b>16899\n<67a4>19448\n<67b1>19449\n<67b5>19450\n<67be>19451\n<67c2>21744\n<67c3>17777\n<67c5>21745\n<67c8>17778\n<67c9>21746\n<67d2>17779\n<67db>17780\n<67dc>21747\n<67e1>21748\n<67e6>21749\n<67f2>21750\n<67f6>21751\n<67f7>17781\n<67fa>7834\n<67fc>16900\n<6801>14066\n<6810>17776\n<6814>21752\n<6818>17785\n<6819>21753\n<681d>16901\n<681f>17786\n<6827>21754\n<6828>19452\n<682d>17787\n<682f>21755\n<6833>17789\n<683b>17790\n<683e>17791\n<683f>21756\n<6845>17792\n<6849>17793\n<684a>21757\n<684c>17794\n<6855>17795\n<6857>17796\n<6858>21758\n<686b>17798\n<686e>17799\n<6879>21762\n<687b>21763\n<687c>17800\n<6882>17801\n<6886>19453\n<6888>21764\n<6890>17802\n<6896>17803\n<689c>17808\n<68a1>21765\n<68a3>16902\n<68a9>21766\n<68ae>21767\n<68b4>17811\n<68bb>17812\n<68c3>17816\n<68c5>17817\n<68cc>17818\n<68d1>21768\n<68d3>21769\n<68d9>17819\n<68ea>21772\n<68eb>19454\n<68ec>17822\n<68f5>19455\n<68f6>21773\n<68f7>17823\n<68fb>17813\n<68fd>21774\n<6903>17824\n<6906>21775\n<6907>17825\n<6909>21776\n<690a>16903\n<6910>21777\n<6916>21778\n<6917>19456\n<6931>21779\n<6933>19457\n<6938>19458\n<6942>16906\n<6945>21780\n<6946>17829\n<6949>16904\n<694e>21781\n<695b>19459\n<6964>16907\n<6965>19460\n<6966>21782\n<6969>17830\n<696c>17831\n<697a>17832\n<697b>21785\n<6986>14144\n<698d>21786\n<6992>17833\n<6996>17835\n<69a1>21787\n<69a5>16908\n<69a8>19461\n<69ab>19462\n<69af>19463\n<69b0>17836\n<69b8>21788\n<69ba>17837\n<69bc>17838\n<69c0>17839\n<69c5>21789\n<69c8>21790\n<69cf>16909\n<69d1>17840\n<69e3>17844\n<69e5>19464\n<69e9>16912\n<69ea>13329\n<69f1>19465\n<69f3>17847\n<69f4>17849\n<69f5>16913\n<69fe>17850\n<6a00>21792\n<6a03>21793\n<6a11>17851\n<6a1a>17852\n<6a1d>17853\n<6a20>21794\n<6a24>21795\n<6a37>21796\n<6a3b>16915\n<6a3f>17857\n<6a49>17858\n<6a4a>19466\n<6a4e>17860\n<6a52>17861\n<6a55>19467\n<6a64>17862\n<6a67>19468\n<6a6a>21798\n<6a71>19469\n<6a7a>17859\n<6a81>21799\n<6a8b>17864\n<6a94>16917\n<6a9b>21802\n<6aa1>17866\n<6aa5>16918\n<6aab>17868\n<6aaf>19470\n<6ab4>21805\n<6abd>17869\n<6ac6>17870\n<6acc>21808\n<6ad0>17872\n<6ad4>17871\n<6add>17873\n<6af0>21811\n<6af8>20152\n<6afc>21812\n<6afd>17879\n<6b02>21813\n<6b03>19473\n<6b09>21816\n<6b0b>17881\n<6b17>17886\n<6b1b>16920\n<6b28>21817\n<6b2b>21818\n<6b2c>16921\n<6b2f>17888\n<6b36>21819\n<6b3b>19474\n<6b3f>19475\n<6b4a>17889\n<6b4d>21820\n<6b52>21821\n<6b58>17890\n<6b5d>21822\n<6b67>16922\n<6b6b>21823\n<6b6c>17891\n<6b6e>21824\n<6b70>21825\n<6b75>17892\n<6b7a>17893\n<6b81>17894\n<6b85>21826\n<6b97>21827\n<6b9b>17895\n<6ba8>21832\n<6ba9>16923\n<6bac>21833\n<6bad>16924\n<6bae>17896\n<6bb0>19478\n<6bbd>17898\n<6bd7>16925\n<6bda>17902\n<6be3>21838\n<6bee>17905\n<6bf7>19479\n<6bf9>19480\n<6bff>16926\n<6c02>17906\n<6c04>19481\n<6c05>16927\n<6c09>19482\n<6c0a>17907\n<6c0d>19483\n<6c0e>17908\n<6c12>21839\n<6c19>21840\n<6c1f>21841\n<6c2c>19484\n<6c2e>21845\n<6c36>17909\n<6c3a>20309\n<6c3b>21846\n<6c4a>19485\n<6c4b>21847\n<6c4d>17911\n<6c4f>21848\n<6c52>19486\n<6c54>19487\n<6c5b>17912\n<6c67>17930\n<6c6b>21849\n<6c6d>17913\n<6c74>16928\n<6c78>21850\n<6c79>19488\n<6c84>17914\n<6c87>21851\n<6c89>17915\n<6c94>17917\n<6c97>17918\n<6c98>16929\n<6c9f>21852\n<6cac>19489\n<6cad>17919\n<6cb0>21853\n<6cb2>21854\n<6cb4>19490\n<6cc2>17920\n<6cc6>16931\n<6ccd>21855\n<6ccf>21856\n<6cd1>21857\n<6cd2>19491\n<6cdc>17922\n<6ce7>21858\n<6ce9>17923\n<6ced>17924\n<6cf2>21859\n<6cf4>21860\n<6cfb>16930\n<6d00>17926\n<6d07>21861\n<6d0f>21862\n<6d13>21863\n<6d1a>21864\n<6d24>17927\n<6d28>21865\n<6d2f>17931\n<6d31>16932\n<6d34>17950\n<6d39>16933\n<6d3c>17932\n<6d3f>16934\n<6d58>16935\n<6d5b>17933\n<6d5f>21866\n<6d60>17934\n<6d61>19492\n<6d67>21867\n<6d70>17935\n<6d7c>19493\n<6d8a>17938\n<6d8d>17939\n<6d91>17940\n<6d92>21868\n<6d94>16936\n<6d97>21869\n<6d98>17941\n<6daa>16937\n<6dab>17946\n<6dae>17947\n<6db4>17948\n<6db7>21870\n<6db9>19494\n<6dbd>21871\n<6dc2>17949\n<6dc8>17951\n<6dce>17952\n<6ddb>16938\n<6ddd>16939\n<6ddf>17953\n<6de0>21872\n<6de2>21873\n<6de5>21874\n<6def>21875\n<6df0>19495\n<6df4>21876\n<6df6>17954\n<6e00>21877\n<6e04>21878\n<6e1e>17956\n<6e32>17958\n<6e36>17955\n<6e3b>21879\n<6e44>16940\n<6e45>19496\n<6e4f>17963\n<6e52>21880\n<6e57>17966\n<6e5d>21881\n<6e5e>16941\n<6e62>21882\n<6e63>17967\n<6e68>21883\n<6e73>19497\n<6e7b>19498\n<6e7d>19499\n<6e89>19500\n<6e8d>21884\n<6e93>17969\n<6e99>21885\n<6ea0>21886\n<6ea7>17970\n<6eb1>16942\n<6eb3>21889\n<6eb4>17971\n<6ebb>21890\n<6ebc>19501\n<6ec0>21891\n<6ec1>16943\n<6ec3>17972\n<6ec8>21892\n<6ecd>21893\n<6ecf>21894\n<6eeb>17974\n<6ef9>17975\n<6efb>17976\n<6f04>21897\n<6f08>21898\n<6f0a>17977\n<6f0c>17978\n<6f0d>21899\n<6f10>16944\n<6f16>21900\n<6f18>17979\n<6f1b>21901\n<6f25>17980\n<6f26>19504\n<6f29>19505\n<6f2d>21903\n<6f30>19506\n<6f35>17973\n<6f36>17981\n<6f3b>21902\n<6f3c>17982\n<6f4f>21904\n<6f52>17984\n<6f53>21905\n<6f57>17985\n<6f59>16945\n<6f5d>21906\n<6f60>17986\n<6f61>16946\n<6f68>17987\n<6f6c>21907\n<6f7e>16947\n<6f83>21908\n<6f87>19507\n<6f8c>16948\n<6f90>17988\n<6f93>21909\n<6f96>17989\n<6f9d>19508\n<6f9f>17991\n<6fa0>16949\n<6fa5>17992\n<6fa6>21910\n<6fae>19509\n<6faf>17993\n<6fb0>21911\n<6fb7>19510\n<6fbc>16950\n<6fbe>17990\n<6fc5>21912\n<6fc7>16951\n<6fca>16952\n<6fe8>21913\n<6fe9>17997\n<6ff0>16953\n<6ff9>15395\n<6ffc>17999\n<6ffd>21914\n<7000>18000\n<700a>18001\n<700d>19511\n<7017>21915\n<7020>19512\n<7023>18002\n<702f>21916\n<7034>21917\n<7037>21918\n<703a>18004\n<7043>18005\n<7044>21919\n<7047>18006\n<7048>21920\n<7049>19513\n<704a>20306\n<704b>18007\n<704e>16954\n<7055>21921\n<7065>18009\n<7069>18010\n<706e>18011\n<7075>16955\n<7076>18012\n<7086>18013\n<7094>21922\n<7096>21923\n<7097>18014\n<7098>19514\n<709b>21924\n<709f>18016\n<70a4>16956\n<70b0>19515\n<70b1>18017\n<70b4>21925\n<70ca>18020\n<70d1>18021\n<70e4>16957\n<70ec>18019\n<70fa>21926\n<7103>18022\n<7105>21927\n<7106>18023\n<7108>18024\n<710b>21928\n<710c>18025\n<711e>16959\n<712b>16958\n<712d>21929\n<712e>16960\n<712f>18027\n<7138>21930\n<7141>21931\n<7145>19518\n<714b>21932\n<7150>18028\n<7151>16961\n<7153>18029\n<7157>21934\n<715a>21935\n<715e>18030\n<7168>16962\n<7180>18033\n<7185>16963\n<7187>16964\n<718c>21936\n<7196>18032\n<719a>21937\n<719b>18034\n<71a0>18035\n<71a2>18036\n<71b0>21938\n<71b2>19519\n<71b3>15397\n<71ba>16965\n<71c4>16966\n<71cc>21941\n<71d9>18040\n<71da>21942\n<71dc>18041\n<71f4>19520\n<71f8>21943\n<7207>18042\n<7213>21946\n<7215>16967\n<7217>19521\n<721a>21947\n<721f>19522\n<7224>21948\n<722f>21949\n<7234>18044\n<7239>18045\n<7242>18046\n<7243>19523\n<7245>21950\n<724e>21951\n<7257>18047\n<725a>19526\n<725e>21952\n<7260>19527\n<7263>18048\n<7268>19528\n<726b>21953\n<7271>21954\n<7277>19529\n<7278>18052\n<727f>18053\n<7284>19530\n<7289>21957\n<728e>18054\n<7293>21958\n<729b>16969\n<72a8>21959\n<72ae>18056\n<72b0>18057\n<72c1>18058\n<72c9>19531\n<72cc>18060\n<72d8>21962\n<72df>21963\n<72e5>19532\n<72f3>18063\n<72f4>19533\n<72fa>18064\n<72fe>21964\n<7302>19534\n<7307>18065\n<730b>19535\n<730d>21965\n<7312>18066\n<7313>21966\n<731e>19536\n<7322>19537\n<7327>16971\n<732c>18071\n<7332>21967\n<7333>18072\n<7335>21968\n<7339>18070\n<733d>18073\n<734d>19540\n<7350>16972\n<7352>18074\n<7356>21969\n<7358>19541\n<7366>16973\n<7367>19542\n<7369>21974\n<736b>18076\n<7371>18080\n<7379>21975\n<7380>21976\n<7381>18081\n<738a>18082\n<738e>21977\n<7390>21978\n<7393>21979\n<7394>18083\n<7397>21980\n<7398>18084\n<739c>18085\n<73a2>16974\n<73a5>18086\n<73aa>21981\n<73ad>21982\n<73b9>18087\n<73bf>18088\n<73c5>18089\n<73c6>21983\n<73cb>18090\n<73cc>21984\n<73d3>21985\n<73dd>21986\n<73e1>18091\n<73e6>21987\n<73e7>18092\n<73f7>21988\n<73f9>18093\n<73fa>18095\n<73fb>21989\n<7401>18096\n<7411>21992\n<7413>18094\n<742b>16975\n<742d>21993\n<7440>18098\n<7443>18099\n<7446>16976\n<7452>18100\n<7453>18097\n<745d>18101\n<7462>16977\n<746d>16978\n<746e>21996\n<7472>19543\n<7481>18102\n<7488>18103\n<748f>21997\n<7491>21998\n<7492>18105\n<7497>18106\n<7499>18107\n<749a>21999\n<74a1>18108\n<74a5>18109\n<74a6>16979\n<74a9>16980\n<74aa>18110\n<74ae>22000\n<74af>19544\n<74b9>18111\n<74ba>18113\n<74bb>18112\n<74c9>16981\n<74cc>22003\n<74d0>22004\n<74d3>22005\n<74d6>18114\n<74d8>18115\n<74db>22007\n<74df>19545\n<74e4>19546\n<74e8>22008\n<74ea>22009\n<74eb>18116\n<74f4>19547\n<74fa>18118\n<74fb>19548\n<74fc>22011\n<74ff>16982\n<7506>22012\n<7512>22013\n<7516>19549\n<7517>16983\n<7520>18120\n<7521>19550\n<7524>18121\n<7527>22014\n<7529>22015\n<752a>18122\n<7536>22016\n<7539>22017\n<753f>19551\n<7540>18127\n<7543>22018\n<7547>22019\n<7548>18128\n<7550>18129\n<7552>18130\n<7557>22020\n<755e>19552\n<755f>22021\n<7561>22022\n<7571>18132\n<7572>18131\n<757a>18133\n<7585>22025\n<758c>18136\n<7595>22026\n<7599>19553\n<759c>22027\n<75a2>18138\n<75a4>19554\n<75b0>18140\n<75b7>18141\n<75ba>22028\n<75c1>19555\n<75c4>19556\n<75c6>18144\n<75cc>19557\n<75ce>16985\n<75cf>18145\n<75d3>18146\n<75d7>19558\n<75dc>19559\n<75dd>18147\n<75e1>19560\n<75e7>18150\n<75ee>18151\n<75ef>19561\n<75f1>18152\n<7602>16986\n<7603>18153\n<7604>19562\n<7607>18155\n<7608>16987\n<760c>19563\n<760f>18156\n<7612>22029\n<7613>18159\n<7618>18154\n<761d>19564\n<7623>22030\n<7625>18163\n<7626>13893\n<7628>18164\n<7629>22031\n<7632>19565\n<7633>18166\n<7638>19566\n<763c>18165\n<7640>22034\n<7641>18169\n<7644>22035\n<7645>19567\n<7649>18171\n<764a>19568\n<7655>18172\n<7659>22036\n<765f>19569\n<7664>16988\n<766e>18174\n<7681>16989\n<7685>22037\n<7695>18175\n<769d>16990\n<769f>22040\n<76a0>18177\n<76a1>18176\n<76aa>16991\n<76ad>19570\n<76af>18180\n<76b6>16992\n<76bd>19571\n<76c1>22043\n<76c9>18182\n<76cb>22044\n<76ce>16993\n<76d4>16994\n<76d9>19572\n<76e0>22046\n<76e6>16995\n<76e8>18184\n<76eb>19573\n<76f0>19574\n<76f1>16996\n<76f6>22047\n<76f9>19575\n<7700>19576\n<7706>22048\n<770a>16997\n<770e>19577\n<7712>22049\n<7717>18186\n<7719>16998\n<771a>18187\n<771c>22052\n<7722>19578\n<7728>19579\n<772d>18188\n<772e>22053\n<772f>19580\n<7735>18189\n<7739>19581\n<773d>22054\n<773e>19582\n<7742>22055\n<7745>19583\n<774a>19584\n<774f>19585\n<7752>22056\n<7758>18194\n<775e>19586\n<7764>19587\n<7767>19588\n<776c>19589\n<7770>22059\n<777a>17001\n<777c>18196\n<7780>17002\n<7784>19590\n<7794>17003\n<7796>19593\n<779a>18199\n<779f>18200\n<77a2>18201\n<77a4>18202\n<77a7>19594\n<77ae>22064\n<77af>19595\n<77b1>22065\n<77b5>22066\n<77b7>19596\n<77be>19597\n<77c3>22067\n<77c9>19598\n<77d1>19599\n<77d2>22068\n<77d5>22069\n<77d9>19600\n<77e0>17004\n<77e4>18205\n<77ea>18206\n<77ec>18207\n<77f1>19601\n<77f8>22070\n<77fb>18208\n<7805>18210\n<7809>18211\n<780d>18212\n<780e>22071\n<7811>22072\n<7819>18213\n<781d>22073\n<7823>22074\n<782c>18214\n<7837>19602\n<7843>17006\n<7844>22075\n<7847>18215\n<7848>22076\n<784c>22077\n<7852>22078\n<785c>19603\n<785e>22079\n<7863>22082\n<786a>18216\n<786e>17007\n<787e>19604\n<788a>18218\n<788f>22083\n<7894>18219\n<7898>19605\n<789d>18221\n<789f>18222\n<78a1>19606\n<78a4>18220\n<78a8>22084\n<78ac>22085\n<78ad>17010\n<78b0>17008\n<78b1>19607\n<78b2>22086\n<78b3>19608\n<78bb>18223\n<78bd>22087\n<78bf>22088\n<78c7>22089\n<78c9>19609\n<78d2>22090\n<78d3>19610\n<78d5>18224\n<78d6>22091\n<78db>22092\n<78df>22093\n<78e6>18225\n<78ea>22094\n<78f3>22095\n<78f6>22096\n<78fe>18228\n<78ff>22097\n<7900>17011\n<7906>22098\n<790c>19611\n<7910>18230\n<791a>22099\n<791b>18231\n<791c>17012\n<791e>22100\n<791f>19612\n<7920>22101\n<7925>18232\n<7929>22102\n<792d>22103\n<792e>17013\n<7934>17014\n<7935>22104\n<793f>19615\n<7942>19616\n<7944>22105\n<7946>17015\n<794a>18233\n<794b>22106\n<794f>22107\n<7951>22108\n<7954>19617\n<7958>18234\n<7967>18236\n<7969>22109\n<796b>19618\n<7972>18237\n<7979>17016\n<797b>22110\n<797c>19619\n<797e>22111\n<798c>22112\n<7991>22113\n<7993>22114\n<7995>18238\n<799c>22115\n<79a1>18239\n<79a8>22116\n<79a9>18240\n<79ab>19620\n<79af>22117\n<79b4>18241\n<79c2>18242\n<79c4>19621\n<79c7>18243\n<79c8>17017\n<79cf>22118\n<79d4>17019\n<79d6>18246\n<79dd>22119\n<79de>17020\n<79e0>22120\n<79e2>22121\n<79e5>22122\n<79ea>19622\n<79eb>17021\n<79ed>17022\n<79f1>22123\n<79f8>22124\n<79fc>22125\n<7a02>19623\n<7a07>22126\n<7a0a>18251\n<7a0c>19624\n<7a15>18252\n<7a1b>18253\n<7a21>22127\n<7a27>22128\n<7a2b>22129\n<7a2f>22130\n<7a30>19625\n<7a38>18255\n<7a3a>19626\n<7a44>19627\n<7a47>18256\n<7a48>22133\n<7a55>22134\n<7a56>18257\n<7a59>18258\n<7a5c>18259\n<7a5f>18260\n<7a60>20310\n<7a65>22135\n<7a67>18261\n<7a6a>18262\n<7a75>18263\n<7a7e>22136\n<7a80>19628\n<7a82>18264\n<7a85>17023\n<7a86>19629\n<7a8a>18265\n<7a8b>22137\n<7a90>18266\n<7a91>22138\n<7a94>19630\n<7a9e>22139\n<7aac>18267\n<7ab5>19631\n<7ab9>18270\n<7abd>19632\n<7abe>18271\n<7ac9>22140\n<7acc>18273\n<7ace>17025\n<7adb>22141\n<7ae8>18274\n<7ae9>22142\n<7aec>22143\n<7af1>22144\n<7af4>18275\n<7afb>22145\n<7afd>17026\n<7afe>19633\n<7b12>17027\n<7b1f>22146\n<7b23>22147\n<7b29>22148\n<7b2a>18280\n<7b2b>19634\n<7b2d>17028\n<7b30>22149\n<7b34>22150\n<7b3b>17029\n<7b3d>18279\n<7b41>18286\n<7b55>18288\n<7b64>18290\n<7b66>18291\n<7b6a>22153\n<7b6f>17030\n<7b73>18292\n<7b77>19635\n<7b79>18289\n<7b7f>18285\n<7b84>22154\n<7b89>22155\n<7b8e>22156\n<7b90>18295\n<7b96>22157\n<7b9b>18296\n<7ba0>19636\n<7ba5>22158\n<7bac>19637\n<7bb0>19638\n<7bb2>22159\n<7bb5>18298\n<7bb6>22160\n<7bbc>18299\n<7bbd>22163\n<7bc2>22164\n<7bc5>18300\n<7bc8>22165\n<7bca>18301\n<7bd4>18304\n<7bd6>18305\n<7bda>18306\n<7bdb>22166\n<7be8>19639\n<7bea>18307\n<7bf0>18308\n<7bf2>19640\n<7bf8>19641\n<7bfc>19642\n<7bfe>19643\n<7c01>17031\n<7c02>22171\n<7c03>18309\n<7c04>22172\n<7c06>22173\n<7c09>19644\n<7c0c>22174\n<7c0e>18310\n<7c19>22175\n<7c1b>22176\n<7c25>22177\n<7c28>19645\n<7c2c>22178\n<7c2f>19646\n<7c33>17032\n<7c34>22179\n<7c42>19647\n<7c45>18311\n<7c46>22182\n<7c4a>18312\n<7c55>22183\n<7c57>18313\n<7c5a>22184\n<7c5e>18314\n<7c61>18315\n<7c63>22185\n<7c69>18316\n<7c6d>17034\n<7c6f>18317\n<7c72>19653\n<7c79>17035\n<7c7c>22187\n<7c7d>19654\n<7c86>22188\n<7c87>19655\n<7c8f>17036\n<7c94>17037\n<7c9e>19656\n<7ca0>17038\n<7ca6>18321\n<7cb0>22189\n<7cba>19657\n<7cbb>22190\n<7cc4>18326\n<7cc7>19658\n<7ccd>18328\n<7ccf>22191\n<7cd3>19659\n<7cd4>22192\n<7cd5>17039\n<7cda>19660\n<7ce6>18331\n<7ce9>22193\n<7cf5>18333\n<7d03>18334\n<7d0f>22194\n<7d11>22195\n<7d12>18336\n<7d16>22196\n<7d1e>18337\n<7d26>22197\n<7d2a>22198\n<7d2d>22199\n<7d31>17040\n<7d3c>19661\n<7d40>18342\n<7d47>18343\n<7d4d>19662\n<7d51>22200\n<7d55>13882\n<7d57>22201\n<7d5a>18347\n<7d5c>17041\n<7d65>22202\n<7d67>22203\n<7d6a>18348\n<7d70>18349\n<7d78>22204\n<7d7b>22205\n<7d7f>18351\n<7d81>22206\n<7d82>19663\n<7d83>17042\n<7d85>19664\n<7d88>18353\n<7d8d>19665\n<7d91>19666\n<7d96>22207\n<7d97>18354\n<7d9d>18356\n<7d9e>19667\n<7da6>17043\n<7da7>18357\n<7daa>18358\n<7db3>19668\n<7db6>18359\n<7db9>19669\n<7dc0>18360\n<7dc2>17044\n<7dd0>19670\n<7dd7>18361\n<7dd9>18362\n<7de2>22215\n<7de5>19671\n<7de6>18363\n<7dea>22216\n<7ded>22217\n<7dfa>22218\n<7e00>22214\n<7e10>18367\n<7e17>18368\n<7e1c>22219\n<7e1d>18369\n<7e27>18370\n<7e28>17045\n<7e2c>18371\n<7e2d>22220\n<7e2f>19674\n<7e33>22221\n<7e36>19675\n<7e3f>22222\n<7e44>19676\n<7e45>18372\n<7e4e>22223\n<7e50>22224\n<7e58>22225\n<7e5f>22226\n<7e65>22227\n<7e6f>19677\n<7e75>18373\n<7e78>19678\n<7e7e>18374\n<7e81>19679\n<7e95>22228\n<7e9a>18378\n<7f3b>18381\n<7f3c>18380\n<7f3d>19680\n<7f3e>18382\n<7f3f>22231\n<7f43>18383\n<7f5b>19681\n<7f5c>22232\n<7f5d>19682\n<7f65>19683\n<7f66>22233\n<7f6d>18389\n<7f71>19684\n<7f8b>19687\n<7f8d>22235\n<7f8f>22236\n<7f90>18392\n<7f96>18395\n<7f97>17046\n<7f9c>18396\n<7fa2>19688\n<7fa6>22237\n<7faa>22238\n<7fad>18397\n<7fb4>22239\n<7fbc>22240\n<7fc0>22241\n<7fc3>18399\n<7fc8>22242\n<7fcf>18400\n<7fdb>17047\n<7fe3>18401\n<7fe8>22243\n<7ff2>18402\n<8007>19692\n<8008>18404\n<800a>18403\n<800d>19693\n<800f>22244\n<8013>22245\n<8016>18405\n<801d>22246\n<801e>19694\n<802c>18406\n<802e>22249\n<8030>18407\n<8034>22250\n<8035>17048\n<8037>17049\n<8039>19695\n<803e>22251\n<8040>22252\n<8043>18408\n<8044>22253\n<8064>22254\n<8066>18409\n<806d>22255\n<807b>18410\n<8081>22256\n<8088>19696\n<808e>19697\n<8099>18411\n<809c>18412\n<80a4>18413\n<80a7>18414\n<80b8>18415\n<80b9>22257\n<80c5>18417\n<80c8>22258\n<80ca>17050\n<80cd>22259\n<80cf>19698\n<80d2>22260\n<80d4>19699\n<80d5>18418\n<80e0>17051\n<80e6>18419\n<80ed>19700\n<80ee>22261\n<80f0>19701\n<80f2>22262\n<80f3>17052\n<80f5>18421\n<80f6>22263\n<80f7>19702\n<80f9>22264\n<80fa>19703\n<80fb>18422\n<80fe>19704\n<8103>19705\n<810b>22265\n<810d>18420\n<8117>19706\n<811c>22266\n<811e>18425\n<8120>22267\n<8124>18427\n<8127>18428\n<812c>18429\n<8130>19707\n<8135>18424\n<813c>22268\n<813d>18431\n<8145>22269\n<8147>22270\n<8152>22271\n<8157>19708\n<8160>17053\n<8161>22272\n<8169>18433\n<816d>17056\n<816f>19709\n<8173>19710\n<8177>22273\n<8185>18436\n<8186>22274\n<818b>19711\n<818e>22275\n<8190>19712\n<8196>22276\n<8198>18438\n<819b>19713\n<819e>19714\n<81a2>22277\n<81ae>22278\n<81b2>18439\n<81bb>17057\n<81c1>18440\n<81c3>18441\n<81c5>22279\n<81ca>17058\n<81cb>19715\n<81ce>22280\n<81d5>19716\n<81d6>18442\n<81d7>17059\n<81db>18443\n<81e1>19719\n<81e4>18445\n<81eb>22281\n<81ec>18447\n<81ef>19720\n<81f5>22285\n<81f6>19721\n<81f8>22286\n<81fd>18448\n<81ff>18449\n<8200>19722\n<8204>18451\n<820b>19723\n<820f>22288\n<8219>18453\n<821a>19726\n<821d>22289\n<8222>18454\n<8228>22290\n<823a>19727\n<823c>18456\n<8243>22291\n<8244>19728\n<8245>18458\n<8249>18457\n<824e>22292\n<8251>22293\n<8256>22294\n<8257>18462\n<825c>18464\n<8260>17061\n<8263>18465\n<8267>22295\n<826d>19729\n<8274>17062\n<827b>22296\n<827d>18468\n<827f>18469\n<8283>18470\n<8284>19730\n<8287>22299\n<8289>19731\n<828a>18471\n<8291>19732\n<8293>18472\n<8294>22300\n<8296>22301\n<8298>22302\n<82a0>22305\n<82a1>17064\n<82a9>17067\n<82aa>19733\n<82b0>19734\n<82b2>18475\n<82b4>18476\n<82ba>18477\n<82bc>18478\n<82bf>17068\n<82d0>19735\n<82d5>17069\n<82da>22306\n<82e0>22307\n<82e2>18479\n<82e4>22308\n<82e8>18480\n<82ea>19736\n<82ed>22309\n<82ef>19737\n<82f6>19738\n<82f7>18481\n<82fd>17070\n<8300>17071\n<830c>18484\n<831b>18486\n<831d>18487\n<8321>22314\n<8322>17072\n<832c>22315\n<832d>17073\n<832e>22316\n<8330>18488\n<8333>22317\n<8337>22318\n<833a>17074\n<833c>18489\n<833d>22319\n<8342>22320\n<8344>18490\n<8346>7672\n<8347>17075\n<8353>22332\n<8354>18485\n<8356>19739\n<8357>18491\n<835a>14202\n<8363>17775\n<8370>22323\n<8378>19740\n<837d>17076\n<8380>22324\n<8382>22325\n<8384>22326\n<8399>22327\n<839b>18497\n<839c>22328\n<839d>18498\n<83a6>22329\n<83a7>17077\n<83ac>22330\n<83ad>22335\n<83be>22331\n<83c9>18499\n<83cf>17078\n<83d0>18500\n<83d1>17079\n<83d4>18501\n<83dd>18502\n<83e1>17080\n<83e5>18503\n<83e8>22333\n<83f8>19741\n<83f9>18504\n<83fc>19742\n<8401>17081\n<8406>17082\n<8415>18505\n<8417>18507\n<8419>22334\n<842f>22336\n<8439>18508\n<8445>22337\n<8447>22338\n<844d>22339\n<844f>18509\n<8456>22340\n<8458>19743\n<845c>18514\n<845f>17083\n<8460>22342\n<8464>22343\n<8465>18516\n<8467>22344\n<846a>22345\n<8470>17084\n<8473>17085\n<8474>22346\n<8478>18517\n<847c>18518\n<847d>22347\n<8481>18519\n<8485>17086\n<8492>22348\n<8493>19744\n<8495>22349\n<8497>18521\n<849e>17087\n<84a6>18522\n<84b1>19745\n<84ba>17088\n<84bd>19746\n<84be>18523\n<84cc>22354\n<84d3>18527\n<84e7>18529\n<84ea>18530\n<84ef>18531\n<84f1>18532\n<84f2>22355\n<84f7>22356\n<84fa>18533\n<84fb>19747\n<8507>22359\n<850e>22360\n<8510>22361\n<851b>18534\n<851c>22362\n<851e>17091\n<8522>22363\n<8527>22364\n<852a>22365\n<852b>18537\n<852f>17092\n<8532>17090\n<8533>22366\n<8536>22367\n<853f>22368\n<8546>19748\n<854f>18538\n<8550>22369\n<8551>18541\n<8552>22370\n<8556>19749\n<855c>22371\n<855d>19750\n<8564>17093\n<856f>18539\n<8579>22375\n<857a>17094\n<857b>18545\n<857d>18546\n<857f>18547\n<8581>18548\n<8585>19751\n<8586>18549\n<8589>22376\n<858b>22377\n<858c>17095\n<8593>18550\n<8598>19752\n<859d>18551\n<859f>18552\n<85a0>22378\n<85a2>17096\n<85a5>22379\n<85a7>22380\n<85b4>22381\n<85b6>22382\n<85b8>22383\n<85bc>18556\n<85c2>22387\n<85c7>18557\n<85ca>18558\n<85cb>17097\n<85da>22388\n<85df>18561\n<85e0>22389\n<85e1>18562\n<85e6>18563\n<85e8>22390\n<85ed>17098\n<85f3>22391\n<85f6>18564\n<85fc>22392\n<85ff>17099\n<8600>18565\n<8610>17102\n<8611>18566\n<8618>17104\n<8619>22395\n<861b>22396\n<861e>18567\n<8621>18568\n<8624>18569\n<8627>18570\n<8636>22397\n<8638>17105\n<8639>18572\n<863a>22398\n<863c>18573\n<863d>22399\n<8640>18575\n<8641>16824\n<8642>19753\n<8646>19754\n<8653>18576\n<8656>18577\n<8657>17106\n<865d>22402\n<8662>17107\n<8664>22405\n<8669>22406\n<8675>17109\n<8676>22407\n<8677>18578\n<8687>18579\n<8688>22425\n<8689>18580\n<8696>22408\n<869a>22409\n<86a1>22410\n<86a6>22411\n<86ad>22412\n<86b1>18583\n<86b3>18584\n<86b7>22415\n<86b8>17110\n<86b9>22416\n<86bf>22417\n<86c0>19755\n<86c1>18585\n<86c3>18586\n<86c5>22418\n<86d1>18587\n<86d2>22419\n<86d5>18588\n<86d7>18589\n<86da>22420\n<86dc>22421\n<86e0>22422\n<86e3>18590\n<86e5>22423\n<86e6>18591\n<86e7>22424\n<86fc>17111\n<8704>22426\n<8705>18593\n<8707>18594\n<870e>18595\n<870f>22427\n<8710>18596\n<8714>19756\n<871f>18597\n<8721>18598\n<8722>19757\n<8723>18599\n<872e>19758\n<872f>22428\n<8731>18600\n<8732>22429\n<8739>19759\n<873a>18601\n<8740>18602\n<8743>18603\n<8745>22432\n<874d>22433\n<8751>18604\n<8758>18605\n<875d>19760\n<8761>22434\n<876f>22435\n<8772>18608\n<877b>19761\n<877c>18609\n<8787>17112\n<8789>18613\n<878b>18614\n<878c>19762\n<878e>19763\n<8790>22440\n<8793>18615\n<8795>22441\n<879e>19766\n<87a0>18616\n<87a3>19767\n<87a7>18612\n<87ae>19768\n<87b1>22443\n<87be>18619\n<87bf>19769\n<87c1>18621\n<87c8>22444\n<87c9>19770\n<87ca>22445\n<87ce>18622\n<87d5>22446\n<87d9>22447\n<87da>19771\n<87dc>22448\n<87df>18623\n<87e2>22449\n<87e3>18625\n<87e4>22450\n<87ea>18628\n<87f1>22451\n<87f3>22452\n<87f8>22453\n<87fa>22454\n<87ff>22455\n<8803>20312\n<8809>22456\n<880a>17114\n<8810>17115\n<8812>22458\n<8813>18629\n<8818>19772\n<8819>22457\n<881a>22459\n<881b>19773\n<881e>22460\n<8828>18630\n<882d>19774\n<882e>18631\n<8830>22461\n<8832>18632\n<8835>22462\n<883a>19775\n<883c>18633\n<8841>22463\n<8843>22464\n<8845>19776\n<884a>18635\n<884b>19777\n<884e>19778\n<8851>22468\n<8855>19779\n<8858>18636\n<885a>19780\n<885c>22469\n<8860>22470\n<8869>18639\n<886e>19781\n<886f>18641\n<8871>22471\n<8879>22472\n<887b>22473\n<8880>22474\n<889f>22475\n<88a0>18642\n<88a8>22476\n<88ba>22477\n<88bc>18643\n<88c0>18644\n<88cd>19785\n<88ce>17116\n<88d1>18646\n<88d3>18647\n<88de>22480\n<88e0>19786\n<88e7>22481\n<88ef>19787\n<88f7>22482\n<8901>18649\n<890d>22483\n<8920>22486\n<8926>19790\n<8928>22487\n<8931>22488\n<8932>17118\n<8935>19791\n<8937>18651\n<8939>17119\n<893a>22489\n<8940>17120\n<8942>18653\n<8945>18654\n<8946>22490\n<8949>18655\n<894f>22491\n<8952>22492\n<8957>22493\n<895a>19792\n<895b>22494\n<895c>19793\n<8961>22495\n<8962>18657\n<8963>22496\n<896b>19794\n<896e>22497\n<8970>19795\n<8973>22498\n<8975>22499\n<897a>22500\n<897c>19796\n<897d>22501\n<8989>18658\n<898d>22502\n<8990>18659\n<8994>17121\n<8995>22503\n<899f>18660\n<89a0>22506\n<89a5>19797\n<89b0>18661\n<89b4>22507\n<89b5>19798\n<89b6>22508\n<89b7>18662\n<89bc>19799\n<89d5>19800\n<89d7>22509\n<89d8>18663\n<89e9>22510\n<89eb>18664\n<89ed>22511\n<89f3>18666\n<89f6>17122\n<89f9>22512\n<89fd>18667\n<89ff>18668\n<8a11>18670\n<8a14>18671\n<8a1e>22515\n<8a20>22516\n<8a21>18673\n<8a24>22517\n<8a26>22518\n<8a2f>22521\n<8a35>18674\n<8a3d>22522\n<8a3e>18675\n<8a40>22523\n<8a43>22524\n<8a45>18676\n<8a47>17123\n<8a49>19801\n<8a4d>18677\n<8a53>22525\n<8a56>22526\n<8a57>19802\n<8a58>18678\n<8a5c>22527\n<8a5d>17124\n<8a61>17125\n<8a65>22528\n<8a67>19803\n<8a75>17126\n<8a7e>19804\n<8a80>22533\n<8a83>22534\n<8a86>19805\n<8a8b>22535\n<8a8f>22536\n<8a90>18680\n<8a92>22537\n<8a96>19806\n<8a97>22538\n<8a99>22539\n<8a9f>22540\n<8aa9>22541\n<8aae>18679\n<8aaf>22542\n<8ab3>22543\n<8ab6>19807\n<8ab7>18681\n<8abb>22544\n<8ac3>22545\n<8ac6>22546\n<8ac8>22547\n<8ac9>19808\n<8aca>22548\n<8ad0>17127\n<8ad1>19809\n<8ad7>18682\n<8add>19810\n<8aec>19811\n<8af0>22552\n<8af5>19812\n<8afc>18683\n<8aff>22553\n<8b05>18686\n<8b06>19813\n<8b0a>18685\n<8b0b>22554\n<8b0d>18687\n<8b0f>19814\n<8b11>19815\n<8b1c>18688\n<8b1e>22555\n<8b2d>18689\n<8b30>22556\n<8b3c>22557\n<8b42>22558\n<8b45>19816\n<8b46>17128\n<8b48>22559\n<8b4d>22560\n<8b51>18691\n<8b52>19817\n<8b59>17129\n<8b5e>18692\n<8b63>22561\n<8b69>17130\n<8b6d>19818\n<8b76>18693\n<8b78>19819\n<8b79>22562\n<8b7c>19820\n<8b7e>19821\n<8b81>18694\n<8b84>22563\n<8b85>19822\n<8b8b>18695\n<8b8d>22564\n<8b8f>22565\n<8b9d>17131\n<8b9f>19823\n<8c38>22566\n<8c39>18698\n<8c3d>18700\n<8c3e>22567\n<8c45>18703\n<8c49>17132\n<8c4b>19824\n<8c4f>18704\n<8c51>22568\n<8c53>19825\n<8c57>18705\n<8c58>22569\n<8c59>22572\n<8c5b>22570\n<8c5d>22571\n<8c66>22575\n<8c68>17133\n<8c69>18706\n<8c6d>18707\n<8c7b>19826\n<8c7e>22578\n<8c8b>22581\n<8c90>22582\n<8c92>18710\n<8c93>18709\n<8c99>18711\n<8c9b>18713\n<8c9c>22584\n<8c9f>13644\n<8cb9>22585\n<8cba>19827\n<8cc5>19828\n<8cc6>22586\n<8cc9>19829\n<8ccb>22587\n<8ccf>22588\n<8cd2>19830\n<8cd5>18715\n<8cd6>18714\n<8cdd>22589\n<8ce8>22590\n<8cec>19831\n<8cef>22591\n<8cf1>18717\n<8cf2>22592\n<8cf5>19832\n<8cf7>19833\n<8cff>22593\n<8d01>19834\n<8d03>19835\n<8d09>18719\n<8d0e>18720\n<8d17>19836\n<8d1c>19837\n<8d65>22594\n<8d6e>19838\n<8d7f>22595\n<8d82>22596\n<8d88>22597\n<8d90>22598\n<8d91>19839\n<8d9e>22599\n<8d9f>19840\n<8da0>22600\n<8dab>19841\n<8dac>22601\n<8daf>17134\n<8db2>19842\n<8db5>22602\n<8db7>22603\n<8db9>22604\n<8dbb>22605\n<8dbc>22613\n<8dc0>22606\n<8dc5>22607\n<8dc7>22608\n<8dc8>18721\n<8dca>22609\n<8dd1>17135\n<8dd4>22610\n<8dd5>19843\n<8dd7>17136\n<8dd9>18722\n<8de5>22611\n<8de7>19844\n<8df0>22612\n<8df4>19847\n<8dfd>18725\n<8e01>19848\n<8e06>18726\n<8e0b>19849\n<8e0c>18723\n<8e11>22616\n<8e14>18728\n<8e16>18729\n<8e23>17137\n<8e26>19850\n<8e27>18732\n<8e31>19851\n<8e33>22617\n<8e36>18735\n<8e39>18736\n<8e3d>17138\n<8e4d>19854\n<8e4e>22620\n<8e4f>19855\n<8e54>18737\n<8e5b>22621\n<8e5c>19856\n<8e61>19857\n<8e62>18738\n<8e69>19858\n<8e6d>18739\n<8e6f>18740\n<8e71>19859\n<8e75>19860\n<8e77>19861\n<8e79>22624\n<8e7b>17139\n<8e89>19862\n<8e90>19863\n<8e95>19864\n<8e98>18741\n<8e9a>19865\n<8e9b>22627\n<8e9d>22628\n<8e9e>18742\n<8ea2>22629\n<8ea7>19866\n<8ea9>19867\n<8ead>19868\n<8eb5>18743\n<8eba>22630\n<8ebb>18744\n<8ec1>22631\n<8ec7>22634\n<8edc>22635\n<8ee8>19869\n<8eed>22639\n<8eee>22636\n<8ef0>19870\n<8ef1>22637\n<8ef7>22638\n<8efa>17142\n<8f00>18748\n<8f02>22640\n<8f07>19871\n<8f08>18749\n<8f16>22643\n<8f18>19872\n<8f1e>17143\n<8f23>22646\n<8f25>19873\n<8f27>19874\n<8f28>22647\n<8f2b>18750\n<8f2c>19875\n<8f2d>17144\n<8f2e>22648\n<8f34>22649\n<8f35>19876\n<8f37>22650\n<8f3a>19877\n<8f40>18751\n<8f41>22651\n<8f43>19878\n<8f47>19879\n<8f4a>18752\n<8f4f>22652\n<8f51>19880\n<8f54>17145\n<8f55>19881\n<8f58>18753\n<8f65>22657\n<8f9d>22658\n<8fa4>18755\n<8fa5>19885\n<8fb4>18756\n<8fb8>22659\n<8fbe>22660\n<8fc0>22661\n<8fc1>18758\n<8fc6>18759\n<8fca>18761\n<8fcb>22662\n<8fcd>18762\n<8fd0>22663\n<8fd2>22664\n<8fd3>18763\n<8fd5>18764\n<8fe3>22665\n<8fe8>17147\n<8fee>17148\n<8ff1>18765\n<8ff5>18766\n<8ffb>18767\n<8ffe>22666\n<9004>19886\n<9008>17149\n<900c>18768\n<9018>22667\n<901b>19887\n<902d>17150\n<902f>19888\n<9037>18769\n<903f>22673\n<9043>18771\n<904c>19889\n<905b>19890\n<905d>18772\n<9062>22674\n<9066>22675\n<906c>22676\n<9070>19891\n<9074>19892\n<9079>19893\n<9085>18775\n<908b>19894\n<908c>18776\n<908e>22677\n<9090>18777\n<9097>17151\n<9098>19895\n<90a0>19896\n<90a1>18778\n<90a5>22678\n<90b0>18780\n<90b2>19897\n<90b3>17152\n<90b6>18781\n<90bd>19898\n<90be>17153\n<90c3>18782\n<90c7>17156\n<90c8>18783\n<90c9>19899\n<90cc>22679\n<90d2>22684\n<90d5>22680\n<90dc>18785\n<90df>18786\n<90e5>22683\n<90eb>18791\n<90ef>17157\n<90f0>19900\n<90f2>18789\n<90f6>18788\n<9100>18790\n<9104>18794\n<9105>19901\n<9106>18795\n<9108>22685\n<910d>22686\n<9110>22687\n<9114>17158\n<9116>17159\n<9118>18796\n<911a>22688\n<911e>18797\n<9120>22689\n<9125>19902\n<9129>22690\n<912e>22691\n<912f>17162\n<9134>17163\n<9136>22692\n<9137>18798\n<9139>18799\n<913c>22693\n<9143>22694\n<914f>22695\n<9153>22696\n<9157>18802\n<9159>18803\n<915a>19903\n<9167>19904\n<916d>22697\n<9174>18804\n<9179>18805\n<917a>19905\n<917b>22698\n<9181>22699\n<9183>17164\n<9185>18806\n<9186>22700\n<918a>19906\n<9191>19907\n<9195>19908\n<9198>22703\n<91a1>22704\n<91a6>22705\n<91b0>19909\n<91b3>18807\n<91b6>18808\n<91bb>19910\n<91bd>19911\n<91bf>22706\n<91c2>19912\n<91c5>19913\n<91d9>22709\n<91ec>18813\n<91ef>22712\n<91f1>17165\n<91f9>22713\n<91fd>22714\n<9200>19914\n<9201>18814\n<9209>19915\n<920c>22717\n<9218>22720\n<9223>19916\n<923e>22731\n<9242>18818\n<9246>22732\n<924a>18819\n<924d>22733\n<9256>18820\n<9258>22734\n<9261>18821\n<9265>18822\n<9268>18823\n<9269>22737\n<9275>22741\n<9276>19917\n<9279>22742\n<927b>22743\n<927f>18827\n<9289>18828\n<928a>22744\n<928d>18829\n<928e>19918\n<9292>22745\n<9297>18830\n<9299>18831\n<929f>18832\n<92a0>22746\n<92a8>22749\n<92ab>18833\n<92af>19919\n<92b2>18836\n<92b6>22750\n<92b8>22751\n<92ba>22752\n<92bd>22753\n<92c1>19922\n<92c3>19923\n<92c5>19924\n<92c6>18839\n<92c7>22754\n<92c8>19925\n<92cd>22755\n<92ce>18840\n<92d8>22756\n<92e1>22759\n<92e3>22760\n<92e5>18841\n<92e8>22761\n<92ec>22762\n<92ee>22763\n<92f0>22764\n<92f7>18845\n<9300>22765\n<9308>22766\n<9311>18842\n<9314>19926\n<931c>22767\n<9324>22768\n<9329>18846\n<932a>22769\n<9333>19927\n<9334>22770\n<9336>19928\n<9337>22771\n<9349>17166\n<9350>22772\n<9351>18849\n<9355>22773\n<9358>19929\n<935a>18850\n<935e>22774\n<9367>22775\n<9369>22776\n<936b>18851\n<936f>22777\n<9371>18852\n<9373>18853\n<9374>22778\n<9376>22779\n<937a>22780\n<937d>22781\n<937f>19930\n<9382>19931\n<9388>18857\n<938a>19932\n<938b>18858\n<938d>22784\n<938f>18859\n<9392>22785\n<9395>22786\n<9398>22787\n<939e>18860\n<93a1>18854\n<93a3>17169\n<93a6>22789\n<93a8>22790\n<93ab>22791\n<93bb>19933\n<93c7>18865\n<93c9>22797\n<93cb>22798\n<93cc>19934\n<93cd>22799\n<93d3>22800\n<93d9>22801\n<93dc>18866\n<93df>17170\n<93e6>19935\n<93e7>18867\n<93f1>18864\n<93f5>18861\n<93f7>22802\n<93f9>19936\n<93fb>18871\n<9401>22803\n<9402>19937\n<9404>17171\n<9408>22804\n<9409>18868\n<9415>22805\n<941f>22806\n<942e>19940\n<942f>22807\n<9432>18872\n<9433>17172\n<943b>18873\n<943d>22808\n<9443>22809\n<944a>17173\n<944c>19941\n<9459>22810\n<945c>22811\n<945f>22812\n<9461>22813\n<9463>17174\n<9468>22814\n<946d>18876\n<946e>22815\n<946f>18877\n<9471>17175\n<9483>22817\n<9484>22816\n<9579>18878\n<957e>22818\n<9584>22819\n<9586>18879\n<9588>19942\n<958e>17176\n<959f>17177\n<95a1>19943\n<95ab>20313\n<95ac>17178\n<95b6>17179\n<95ba>22822\n<95bf>19944\n<95c6>19945\n<95c8>18884\n<95c9>19946\n<95cb>17180\n<95d0>17181\n<95d3>17182\n<95d9>22823\n<95dd>22824\n<95de>17184\n<95df>22825\n<95e0>19949\n<95e4>19950\n<95e6>19951\n<95e8>14061\n<961e>22826\n<9622>22827\n<9624>19952\n<962c>18887\n<9631>19953\n<9637>22830\n<9638>19954\n<963c>18891\n<963d>19955\n<9652>22833\n<9654>19956\n<9661>18892\n<966e>22836\n<9674>19957\n<967b>19958\n<967c>22837\n<967e>22838\n<967f>19959\n<9681>19960\n<9682>18894\n<9683>19961\n<9689>19962\n<9691>22839\n<9696>19963\n<969a>18896\n<969f>22840\n<96a5>17185\n<96a6>22841\n<96ae>19964\n<96b3>18899\n<96ba>18900\n<96bd>18901\n<96ca>22842\n<96d8>18904\n<96da>18905\n<96dd>18906\n<96df>22844\n<96ef>17186\n<96fa>22845\n<9703>19965\n<9705>22846\n<9714>18908\n<971a>22847\n<971b>19966\n<971d>22848\n<9723>18909\n<9728>19969\n<9731>19970\n<9736>18911\n<9741>18912\n<9747>18913\n<974a>22850\n<974e>17187\n<9755>20314\n<9757>18914\n<9758>22851\n<975b>18915\n<9767>19971\n<976a>18916\n<9776>19972\n<977b>22854\n<977d>19973\n<977f>19974\n<9780>22855\n<9789>22856\n<9795>17188\n<9796>18919\n<9797>22857\n<9799>19975\n<979e>18920\n<979f>19976\n<97ac>19977\n<97ae>17189\n<97b8>22858\n<97b9>19978\n<97ba>17190\n<97bc>22859\n<97be>18923\n<97bf>22860\n<97c1>17191\n<97c7>22863\n<97c9>17192\n<97ca>22864\n<97cc>18924\n<97cd>19979\n<97ce>22865\n<97d0>22866\n<97d1>18925\n<97d4>18926\n<97d7>22867\n<97d8>18927\n<97db>17193\n<97dd>22868\n<97e0>19980\n<97e1>18928\n<97e4>22869\n<97ef>19981\n<97f1>18929\n<97fa>22872\n<9804>18930\n<9807>19982\n<980d>18931\n<9814>18932\n<9816>18933\n<9819>22873\n<981c>22874\n<9820>22875\n<9825>18938\n<9826>19983\n<982e>19984\n<982f>22876\n<9835>22877\n<9844>22878\n<9847>18939\n<984a>22879\n<9851>22880\n<9856>17194\n<9866>18940\n<986a>22881\n<98ab>18941\n<98ad>18942\n<98ae>22882\n<98b0>18943\n<98b4>19987\n<98b7>18945\n<98c2>18948\n<98c5>19988\n<98c7>18949\n<98cb>18950\n<98cc>22883\n<98e1>18951\n<98e3>18952\n<98e6>22884\n<98e7>17195\n<98ea>18953\n<98f3>18956\n<98f6>22885\n<9902>19989\n<9907>22886\n<9908>18957\n<9911>19990\n<9915>19991\n<991f>22887\n<9922>22888\n<9926>22889\n<992b>22890\n<9931>18967\n<9934>22891\n<9935>19992\n<9939>22892\n<9941>18971\n<9946>18972\n<9947>22893\n<9948>19993\n<994e>18973\n<9954>19994\n<9958>17196\n<9959>22894\n<995b>22895\n<995e>19995\n<9960>18974\n<999b>22896\n<999d>22897\n<999f>22898\n<99a3>18975\n<99a6>18976\n<99b0>22899\n<99b2>22900\n<99b5>22901\n<99bd>18977\n<99bf>18978\n<99c3>18979\n<99d3>22902\n<99d4>18980\n<99d9>18981\n<99da>22903\n<99dc>22904\n<99de>18982\n<99e1>19996\n<99e7>22905\n<99f0>18984\n<99f9>18985\n<99fc>18986\n<9a03>17197\n<9a04>22913\n<9a0a>18987\n<9a0b>22914\n<9a0c>19997\n<9a10>19998\n<9a11>18988\n<9a1a>18989\n<9a1e>22915\n<9a20>18990\n<9a22>22916\n<9a23>19999\n<9a31>18991\n<9a33>22917\n<9a35>22918\n<9a41>20000\n<9a44>18992\n<9a47>22919\n<9a4b>22921\n<9a4c>18993\n<9a51>20001\n<9a54>22922\n<9a58>18994\n<9a5d>22923\n<9aaa>22924\n<9aac>22925\n<9aae>22926\n<9aaf>18996\n<9ab2>22927\n<9ab4>22928\n<9ab7>18998\n<9ab9>19000\n<9abb>22929\n<9abf>22930\n<9ac1>17198\n<9ac3>17199\n<9ac6>19002\n<9ac8>22931\n<9ace>17200\n<9ad0>19003\n<9ad2>19004\n<9ad5>19005\n<9ad6>17201\n<9ad7>22932\n<9adb>22933\n<9ae0>19006\n<9ae4>22934\n<9ae5>19007\n<9ae7>22935\n<9ae9>19008\n<9aec>22936\n<9af5>22939\n<9afa>22940\n<9afd>22941\n<9b01>20004\n<9b02>17202\n<9b08>17203\n<9b09>20005\n<9b0b>20006\n<9b0c>19009\n<9b10>19010\n<9b12>19011\n<9b16>19012\n<9b19>20009\n<9b1b>22946\n<9b1c>19013\n<9b1d>20297\n<9b26>22947\n<9b2b>19014\n<9b2c>20298\n<9b2d>17205\n<9b35>20010\n<9b37>22949\n<9b3d>19015\n<9b48>20011\n<9b4b>19017\n<9b4c>22952\n<9b55>20012\n<9b5b>22955\n<9b5e>17206\n<9b61>22956\n<9b63>19018\n<9b65>19019\n<9b66>17207\n<9b68>20013\n<9b6a>22957\n<9b78>22960\n<9b7f>22961\n<9b80>20014\n<9b84>17208\n<9b85>22962\n<9b86>20015\n<9b87>22963\n<9b89>22964\n<9b8a>17209\n<9b8b>22965\n<9b8d>22966\n<9b90>20016\n<9b94>22967\n<9b9a>22968\n<9b9d>20017\n<9b9e>17210\n<9ba6>19024\n<9ba9>22969\n<9bac>19025\n<9bb0>20018\n<9bb2>19027\n<9bb7>22970\n<9bb8>19028\n<9bbc>22971\n<9bbe>19029\n<9bbf>20019\n<9bc8>20020\n<9bce>17211\n<9bd0>22972\n<9bd8>19031\n<9bdd>19032\n<9be5>17212\n<9bea>19033\n<9bee>19035\n<9bef>19034\n<9bf3>19030\n<9bf8>17213\n<9bf9>22973\n<9bff>20021\n<9c02>20022\n<9c0f>22974\n<9c11>22975\n<9c16>19039\n<9c1c>20023\n<9c1d>19043\n<9c1e>22976\n<9c22>19044\n<9c23>17214\n<9c26>22977\n<9c28>22978\n<9c29>19045\n<9c31>19047\n<9c35>20024\n<9c37>19048\n<9c3d>22979\n<9c43>22980\n<9c44>20025\n<9c45>19049\n<9c4e>22981\n<9c54>19055\n<9c56>20026\n<9c58>19056\n<9c5b>19057\n<9c5c>19050\n<9c5d>19058\n<9c5e>22982\n<9c5f>19059\n<9c61>20027\n<9c65>17217\n<9c68>20028\n<9c70>15346\n<9c72>19065\n<9c75>19066\n<9c7a>19067\n<9c7b>22983\n<9ce6>19068\n<9cf2>19069\n<9cf7>22984\n<9cf9>22985\n<9d0b>19070\n<9d11>19072\n<9d1c>22986\n<9d2f>22987\n<9d30>20029\n<9d32>19078\n<9d3a>22990\n<9d3c>22991\n<9d3d>20030\n<9d43>17220\n<9d45>22992\n<9d4a>19080\n<9d52>17221\n<9d5f>19081\n<9d62>19082\n<9d65>22995\n<9d6a>20031\n<9d73>19085\n<9d7b>20032\n<9d83>22996\n<9d84>19088\n<9d86>22997\n<9d8a>17222\n<9d8e>22998\n<9d95>23001\n<9d96>17223\n<9d99>19089\n<9da1>19090\n<9daa>23004\n<9dac>17225\n<9dae>23005\n<9db5>19092\n<9db9>19093\n<9dbc>17226\n<9dbd>19094\n<9dbf>19091\n<9dc0>17224\n<9dc9>19095\n<9dca>23007\n<9dda>19096\n<9dde>23010\n<9de0>19097\n<9de3>19098\n<9de5>20033\n<9de7>17228\n<9de9>20034\n<9dee>23011\n<9df0>23012\n<9df3>20035\n<9dfe>23013\n<9e02>19101\n<9e07>17229\n<9e0a>19100\n<9e0d>19102\n<9e0e>23014\n<9e16>23018\n<9e1c>19103\n<9e7a>20036\n<9e7b>19104\n<9e80>19106\n<9e85>19107\n<9e87>23019\n<9e96>23022\n<9e98>23023\n<9e9b>19108\n<9e9e>17230\n<9eae>23024\n<9eaf>17231\n<9eb0>20040\n<9eb3>23025\n<9ebd>19110\n<9ec6>23026\n<9ec8>23027\n<9ecb>23028\n<9ed5>23029\n<9edf>19112\n<9ee4>20041\n<9ef0>20042\n<9ef1>23032\n<9ef2>20043\n<9ef5>23033\n<9ef8>23034\n<9eff>19113\n<9f02>19114\n<9f03>19116\n<9f09>20044\n<9f0f>20045\n<9f11>23035\n<9f14>20046\n<9f16>23036\n<9f1a>23037\n<9f1b>20047\n<9f1f>23038\n<9f22>20048\n<9f26>20049\n<9f34>20052\n<9f3a>19117\n<9f3c>23041\n<9f3d>19118\n<9f3f>23042\n<9f46>19119\n<9f47>23045\n<9f53>19120\n<9f55>19121\n<9f56>23046\n<9f58>19122\n<9f5a>20053\n<9f5d>19124\n<9f5e>23047\n<9f69>19126\n<9f6d>19127\n<9f6e>23048\n<9f6f>20054\n<9f70>19128\n<9f73>23049\n<9f7a>23050\n<9f7d>23051\n<9f8f>23052\n<9f96>23055\n<9f97>17232\n<9f9e>20055\n<9fa1>23056\n<9fa3>23057\n<9fa5>20056\n<9fb4>14048\n<9fbc>15431\n<9fbd>15429\n<9fbe>15434\n<9fc4>14089\n<9fc6>14168\n<9fcc>20156\n<f87a>15447\n<f87f>15448\n<f909>13739\n<f91d>13392\n<f91f>14084\n<f928>20303\n<f929>20305\n<f936>13394\n<f95f>13971\n<f970>13344\n<f983>14088\n<f999>7811\n<f99a>14097\n<f9a2>14095\n<f9c3>7808\n<f9d0>13396\n<f9dc>13393\n<f9ec>7750\n<fa03>13956\n<fa10>7746\n<fa11>14290\n<fa15>20307\n<fa24>18760\n<fa30>13382\n<fa31>13360\n<fa32>13389\n<fa33>13385\n<fa34>13338\n<fa35>13378\n<fa36>7651\n<fa37>13366\n<fa38>13333\n<fa39>13384\n<fa3a>13387\n<fa3b>13361\n<fa3c>16837\n<fa3d>13326\n<fa3e>13328\n<fa3f>13363\n<fa41>13381\n<fa42>13334\n<fa43>13352\n<fa44>13375\n<fa45>13327\n<fa46>7700\n<fa47>13332\n<fa48>13347\n<fa49>15398\n<fa4a>7732\n<fa4b>13379\n<fa4c>13348\n<fa4d>13345\n<fa4e>13335\n<fa4f>13391\n<fa50>13359\n<fa51>13351\n<fa52>13325\n<fa53>13371\n<fa54>13343\n<fa55>13373\n<fa56>13358\n<fa57>13399\n<fa58>18366\n<fa59>13376\n<fa5a>13353\n<fa5d>14199\n<fa5e>14198\n<fa5f>13367\n<fa60>13331\n<fa61>13346\n<fa62>13321\n<fa63>13339\n<fa64>13380\n<fa65>13364\n<fa66>15403\n<fa67>13320\n<fa68>13374\n<fa69>13337\n<fa6a>7788\n<fa6b>13740\n<fa6c>14281\n<fa6d>13695\n<fe10>8268\n<fe19>7897\nendcidchar\nbegincidrange\n<01f8><01f9>15731\n<0262><0263>15883\n<02e0><02e1>15898\n<02e5><02e9>15851\n<0318><0319>15874\n<031d><031e>15872\n<031f><0320>15862\n<033a><033b>15877\n<0384><0385>20317\n<0388><038a>20428\n<03ac><03af>20436\n<03cc><03cd>20442\n<0402><040c>20447\n<040e><040f>20458\n<0452><045c>20460\n<045e><045f>20471\n<1e3e><1e3f>15729\n<2047><2048>16278\n<2156><215a>9785\n<2225><2226>15489\n<2264><2265>20369\n<2276><2277>15509\n<2284><2285>15472\n<228a><228b>15474\n<22da><22db>15725\n<2305><2306>15478\n<2329><232a>682\n<239d><239e>12144\n<23a3><23a4>12152\n<23a7><23a9>8178\n<23ab><23ad>8174\n<23b0><23b1>16312\n<23be><23cc>16253\n<2491><2492>20587\n<24eb><24f4>10515\n<24f5><24fe>16223\n<25d0><25d3>16274\n<2616><2617>16233\n<2672><267d>16314\n<2934><2935>16201\n<29fa><29fb>16207\n<2b05><2b07>8207\n<3016><3017>16197\n<3018><3019>12129\n<3095><3096>7959\n<3099><309a>16326\n<3190><319f>16283\n<31f0><31f9>16236\n<31fa><31ff>16247\n<3252><325b>8102\n<325c><325f>10244\n<32b1><32bf>10248\n<355d><355e>17341\n<3761><3762>17528\n<4e23><4e24>19141\n<4e74><4e75>21079\n<4f4b><4f4c>21096\n<4f77><4f78>17260\n<4fbb><4fbd>21112\n<4fc0><4fc1>21115\n<5032><5033>21129\n<5051><5052>21134\n<5083><5084>21142\n<5092><5093>17278\n<509f><50a1>21148\n<50af><50b0>21151\n<50ba><50bb>17284\n<50dc><50dd>21157\n<510c><510e>19167\n<511c><511d>21166\n<5127><5128>21169\n<512c><512d>21171\n<51d3><51d4>19179\n<5231><5232>19187\n<5278><5279>19194\n<5295><5297>21198\n<52b6><52b8>21205\n<52ba><52bb>17323\n<5327><5329>21226\n<532b><532c>21229\n<5387><5388>21237\n<53c4><53c5>19217\n<53d2><53d3>21245\n<5434><5435>19223\n<546d><546e>21261\n<5500><5501>17364\n<550c><550d>21273\n<555a><555b>21281\n<55d7><55d8>21289\n<5611><5612>19257\n<5643><5644>21299\n<5661><5663>21302\n<56e5><56e7>21314\n<56f6><56f7>17412\n<5701><5702>21317\n<571a><571b>19277\n<5724><5725>21322\n<573d><573e>19282\n<5745><5746>17418\n<5773><5775>17424\n<579d><579e>17431\n<5887><5888>21357\n<588a><588b>17453\n<588f><5890>17456\n<58a0><58a2>21361\n<58f3><58f4>17466\n<5912><5913>21372\n<5935><5936>21379\n<5975><5976>17481\n<5a44><5a45>21410\n<5a9f><5aa0>17503\n<5b90><5b91>21432\n<5ba8><5ba9>21435\n<5bb1><5bb2>21439\n<5bd9><5bda>21446\n<5c67><5c68>17541\n<5c74><5c75>21457\n<5cf1><5cf2>21468\n<5d5f><5d60>21476\n<5d79><5d7a>21480\n<5e50><5e51>21496\n<5e6d><5e6e>17597\n<5ed4><5ed5>19352\n<5f2b><5f2c>21513\n<5f74><5f75>21522\n<5fb0><5fb1>21530\n<5fd0><5fd1>21533\n<5fd2><5fd4>17618\n<5fee><5fef>17622\n<6056><6057>21547\n<60c9><60ca>21563\n<60ce><60cf>21565\n<6180><6181>21583\n<6183><6184>21585\n<6192><6193>17648\n<61c0><61c1>21591\n<61ce><61cf>21593\n<61ec><61ed>21599\n<628d><628f>21614\n<62b6><62b7>21618\n<62be><62bf>21621\n<633b><633c>17675\n<63ae><63af>19400\n<63d4><63d5>17689\n<63eb><63ec>17692\n<63f8><63f9>19403\n<6498><6499>19417\n<64cb><64cc>17706\n<64e9><64ea>21668\n<6508><650a>21672\n<653c><653d>21679\n<65f4><65f5>21695\n<65fe><65ff>21697\n<6611><6612>21700\n<666c><666d>17746\n<6677><6678>16889\n<668b><668c>19437\n<669a><669c>21718\n<66c2><66c3>21723\n<67bc><67bd>21742\n<686f><6871>21759\n<6898><689a>17805\n<68aa><68ab>17809\n<68dc><68dd>21770\n<68e4><68e5>17820\n<6970><6971>21783\n<69ee><69ef>17845\n<6a32><6a33>17855\n<6a86><6a87>21800\n<6ab0><6ab1>21803\n<6abe><6abf>21806\n<6ac8><6ac9>19471\n<6ad5><6ad6>21809\n<6af1><6af3>17876\n<6b06><6b07>21814\n<6b0f><6b11>17882\n<6b7d><6b7e>19476\n<6b9f><6ba0>21828\n<6ba2><6ba3>21830\n<6bb8><6bb9>21834\n<6bc3><6bc4>21836\n<6bc7><6bc9>17899\n<6be6><6be7>17903\n<6c26><6c28>21842\n<6d26><6d27>17928\n<6d80><6d81>17936\n<6e48><6e49>17959\n<6e4b><6e4c>17961\n<6e53><6e54>17964\n<6ead><6eae>21887\n<6eda><6edb>19502\n<6eed><6eee>21895\n<6fc8><6fc9>17995\n<70d5><70d6>19516\n<71ae><71af>18037\n<71bf><71c0>21939\n<7208><7209>21944\n<724f><7250>19524\n<726e><726f>18050\n<727b><727c>21955\n<72d5><72d6>21960\n<7318><7319>18067\n<733a><733b>19538\n<735d><7360>21970\n<736e><736f>18078\n<73ff><7400>21990\n<7467><7468>21994\n<74b1><74b2>22001\n<753d><753e>18125\n<757b><757c>22023\n<757d><757e>18134\n<75bf><75c0>18142\n<75df><75e0>18148\n<761b><761c>18160\n<7639><763a>22032\n<768c><768d>22038\n<76a2><76a3>22041\n<76a7><76a8>18178\n<7714><7715>22050\n<774d><774e>16999\n<7756><7757>22057\n<7773><7774>22060\n<778c><778d>19591\n<77de><77df>18203\n<7860><7861>22080\n<78f9><78fa>18226\n<7927><7928>19613\n<79cc><79cd>18244\n<7a34><7a35>22131\n<7b2e><7b2f>18281\n<7b3f><7b40>22151\n<7bba><7bbb>22161\n<7bf4><7bf5>22167\n<7bf9><7bfa>22169\n<7c39><7c3a>22180\n<7c52><7c53>19648\n<7c5b><7c5d>19650\n<7cb6><7cb7>18323\n<7d3d><7d3e>18340\n<7dc3><7dc6>22208\n<7dcd><7dce>22212\n<7df5><7df6>19672\n<7e86><7e87>18375\n<7e9d><7e9e>22229\n<7f63><7f64>18387\n<7f7d><7f7e>18390\n<7f7f><7f80>19685\n<7ffd><7fff>19689\n<801f><8020>22247\n<8167><8168>17054\n<81dd><81de>19717\n<81f0><81f2>22282\n<8213><8214>19724\n<8280><8281>22297\n<829a><829b>22303\n<82a3><82a4>17065\n<82a7><82a8>18473\n<8307><8308>18482\n<830a><830b>22310\n<831e><831f>22312\n<834d><834e>22321\n<8394><8395>18495\n<8451><8452>18510\n<8459><845a>18512\n<84a9><84aa>22350\n<84c7><84c8>22352\n<84ce><84cf>18525\n<8502><8503>22357\n<8524><8525>18535\n<855f><8560>22373\n<8561><8562>18542\n<85bd><85bf>22384\n<85d8><85d9>18559\n<8604><8605>17100\n<860d><860e>22393\n<8658><8659>22400\n<8660><8661>22403\n<869c><869d>18581\n<86b4><86b5>22413\n<873c><873d>22430\n<8764><8765>18606\n<8783><8786>22436\n<8797><8798>19764\n<87e5><87e6>18626\n<8848><8849>22465\n<889a><889c>19782\n<88cb><88cc>22478\n<890e><890f>19788\n<8915><8916>22484\n<899b><899c>22504\n<8a04><8a05>22513\n<8a2b><8a2c>22519\n<8a76><8a77>22529\n<8a7a><8a7b>22531\n<8ad3><8ad5>22549\n<8b94><8b95>18696\n<8c63><8c64>22573\n<8c75><8c76>22576\n<8c86><8c87>22579\n<8df1><8df2>19845\n<8e04><8e05>22614\n<8e21><8e22>18730\n<8e37><8e38>22618\n<8e40><8e41>19852\n<8e5d><8e5e>22622\n<8e82><8e83>22625\n<8ec3><8ec4>22632\n<8f0f><8f10>22641\n<8f20><8f21>22644\n<8f52><8f53>22653\n<8f5d><8f5e>22655\n<8fa0><8fa2>19882\n<9028><902a>22668\n<9033><9034>22671\n<90c4><90c5>17154\n<90d8><90d9>22681\n<90fe><90ff>18792\n<9122><9123>17160\n<9146><9147>18800\n<9193><9194>22701\n<91c3><91c4>18809\n<91d3><91d4>22707\n<91e9><91ea>22710\n<9204><9205>22715\n<9212><9213>22718\n<9216><9217>18815\n<921c><921d>22721\n<9224><9226>22723\n<922e><9230>22726\n<9235><9236>22729\n<925c><925d>22735\n<926e><9270>22738\n<927c><927d>18825\n<92a4><92a5>22747\n<92bb><92bc>19920\n<92bf><92c0>18837\n<92dc><92dd>22757\n<9364><9365>17167\n<9380><9381>22782\n<93b4><93b6>22792\n<93c4><93c5>22795\n<940d><940e>19938\n<9416><9417>18869\n<958c><958d>18880\n<959d><959e>22820\n<95d1><95d2>19947\n<9625><9626>22828\n<9633><9634>18888\n<9639><963a>22831\n<9656><9657>22834\n<9721><9722>19967\n<9777><9778>22852\n<97b1><97b2>18921\n<97c4><97c5>22861\n<97f7><97f8>22870\n<9832><9833>18936\n<9862><9863>19985\n<98bb><98bc>18946\n<98f0><98f1>18954\n<9916><9917>18960\n<991a><991c>18963\n<993a><993c>18968\n<99ea><99ec>22906\n<99f4><99f5>22909\n<99fd><99fe>22911\n<9abd><9abe>20002\n<9af2><9af3>22937\n<9aff><9b00>22942\n<9b04><9b05>22944\n<9b0d><9b0e>20007\n<9b39><9b3a>22950\n<9b56><9b57>22953\n<9b6b><9b6c>19020\n<9b6d><9b6e>22958\n<9b76><9b77>19022\n<9c18><9c1a>19040\n<9c49><9c4a>19052\n<9c4f><9c50>17215\n<9c69><9c6b>19060\n<9c6d><9c6e>19063\n<9d17><9d18>19073\n<9d1d><9d1e>17218\n<9d33><9d34>22988\n<9d53><9d54>22993\n<9d76><9d77>19086\n<9d92><9d93>22999\n<9d97><9d98>23002\n<9dd4><9dd5>23008\n<9e10><9e12>23015\n<9e82><9e84>20037\n<9e8e><9e8f>23020\n<9eec><9eed>23030\n<9f2a><9f2b>20050\n<9f31><9f32>23039\n<9f43><9f44>23043\n<9f91><9f92>23053\n<9fbf><9fc2>20068\n<f860><f862>15444\n<f992><f993>7809\n<fa5b><fa5c>13349\n<fe11><fe12>7887\n<fe45><fe46>12639\n<fe47><fe48>7903\n<ff5f><ff60>12131\nendcidrange\nbegincidchar\n<01f100>8061\n<01f202>10985\n<01f237>11024\n<02000b>13839\n<020089>17233\n<02008a>14108\n<0200a2>17240\n<0200a4>17243\n<0200b0>14209\n<0200f5>20057\n<020158>20075\n<0201a2>13857\n<020213>17259\n<02032b>17282\n<020371>17291\n<020381>17289\n<0203f9>17295\n<02044a>17297\n<020509>17299\n<02053f>14188\n<0205b1>20080\n<0205d6>17308\n<020611>14294\n<020628>14105\n<0206ec>20083\n<02074f>17312\n<0207c8>20128\n<020807>17319\n<02083a>17321\n<0208b9>17327\n<02090e>13523\n<02097c>17331\n<020984>14109\n<02099d>17332\n<020a64>13755\n<020ad3>17337\n<020b1d>17340\n<020b9f>13803\n<020bb7>13706\n<020d45>17359\n<020d58>20090\n<020de1>17373\n<020e64>17388\n<020e6d>17380\n<020e95>17379\n<020f5f>17391\n<021201>17414\n<02123d>13953\n<021255>17415\n<021274>17421\n<02127b>17417\n<0212d7>17429\n<0212e4>17428\n<0212fd>17435\n<02131b>16816\n<021336>17437\n<021344>17438\n<0213c4>17449\n<02146d>17462\n<02146e>16821\n<0215d7>17472\n<021647>17480\n<0216b4>16838\n<021706>17492\n<021742>17493\n<0218bd>16833\n<0219c3>17525\n<021a1a>7825\n<021c56>17539\n<021d2d>17544\n<021d45>17545\n<021d62>17547\n<021d78>17546\n<021d92>17556\n<021d9c>17552\n<021da1>17551\n<021db7>17559\n<021de0>17561\n<021e33>17562\n<021e34>16845\n<021f1e>17575\n<021f76>17582\n<021ffa>17585\n<02217b>17599\n<022218>19105\n<02231e>17605\n<0223ad>17608\n<022609>15443\n<0226f3>17632\n<02285b>17647\n<0228ab>17653\n<02298f>17657\n<022ab8>17667\n<022b46>17680\n<022ba6>17683\n<022c1d>17682\n<022c24>17686\n<022de1>17710\n<022e42>20124\n<022feb>20130\n<0231b6>17744\n<0231c3>17742\n<0231c4>16888\n<0231f5>17743\n<023372>17761\n<0233cc>14140\n<0233d0>17768\n<0233d2>17764\n<0233d3>17763\n<0233d5>17770\n<0233da>17772\n<0233df>17774\n<0233e4>17769\n<0233fe>15422\n<02344a>17782\n<02344b>17784\n<023451>17783\n<023465>17788\n<0234e4>17814\n<02355a>17815\n<023594>17827\n<0235c4>16905\n<023638>17843\n<023639>17841\n<02363a>15393\n<023647>17842\n<02370c>17863\n<02371c>17854\n<02373f>16914\n<023763>16916\n<023764>17867\n<0237e7>17875\n<0237f1>20152\n<0237ff>17874\n<023824>17880\n<02383d>17885\n<023a98>17897\n<023c7f>17910\n<023cbe>14293\n<023cfe>13904\n<023d00>17925\n<023d0e>18394\n<023d40>17942\n<023dd3>17945\n<023df9>17944\n<023dfa>17943\n<023f7e>17983\n<02404b>20168\n<024096>17998\n<024103>18003\n<0241c6>18015\n<0241fe>18018\n<0242ee>14282\n<0243bc>18039\n<0243d0>7838\n<024629>18049\n<0246a5>18055\n<0247f1>16970\n<024896>18077\n<024a4d>18104\n<024b56>18117\n<024b6f>18119\n<024c16>18124\n<024d14>13995\n<024e04>20058\n<024e0e>18158\n<024e37>18162\n<024e6a>18167\n<024e8b>18170\n<024ff2>20059\n<02504a>18181\n<025055>18183\n<025122>18185\n<0251a9>18190\n<0251cd>18193\n<0251e5>18192\n<02521e>18195\n<02524c>18197\n<02542e>18209\n<02548e>17005\n<0254d9>18217\n<02550e>17009\n<0255a7>18229\n<02567f>14075\n<025771>17018\n<0257a9>18248\n<0257b4>18249\n<025874>7670\n<0259c4>17024\n<0259cc>20112\n<0259d4>18268\n<025ad7>13922\n<025ae3>18277\n<025ae4>18276\n<025af1>18278\n<025bb2>18293\n<025c4b>18302\n<025c64>18303\n<025da1>17033\n<025e2e>18318\n<025e56>18319\n<025e62>18322\n<025e65>18320\n<025ec2>18327\n<025ed8>18325\n<025ee8>18329\n<025f23>18330\n<025f5c>18332\n<025fd4>18339\n<025fe0>18338\n<025ffb>18345\n<02600c>18344\n<026017>18352\n<026060>18355\n<0260ed>18365\n<026222>13691\n<02626a>14189\n<026270>18385\n<026286>18386\n<02634c>20311\n<026402>18398\n<02667e>18416\n<0266b0>14100\n<02671d>18430\n<0268dd>18444\n<0268ea>18446\n<026951>13646\n<02696f>18450\n<026999>14134\n<0269dd>18452\n<026a1e>18455\n<026a58>18459\n<026a8c>18463\n<026ab7>18466\n<026aff>17063\n<026c29>17478\n<026c73>18506\n<026c9e>20206\n<026cdd>18515\n<026e40>17089\n<026e65>18528\n<026f94>18544\n<026ff8>18553\n<0270f4>17103\n<02710d>18571\n<027139>18574\n<0273da>18611\n<0273db>18610\n<0273fe>18617\n<027410>18620\n<027449>18624\n<027614>18638\n<027615>18637\n<027631>18640\n<027684>17117\n<027693>18645\n<02770e>18650\n<027723>18652\n<027752>18656\n<027985>18672\n<0279b4>20133\n<027a84>18684\n<027bb3>18699\n<027bbe>18701\n<027bc7>18702\n<027c3c>20220\n<027cb8>18708\n<027d73>20060\n<027da0>18716\n<027e10>18718\n<027fb7>13898\n<02808a>18727\n<0280bb>18733\n<028277>17140\n<028282>18745\n<0282f3>18747\n<0283cd>17146\n<02840c>18754\n<028455>18757\n<02856b>18770\n<0286d7>18784\n<0286fa>18787\n<028946>18812\n<028949>18811\n<02896b>18817\n<028987>14253\n<028988>18824\n<028a1e>18843\n<028a29>18844\n<028a43>18848\n<028a71>18847\n<028a99>18855\n<028acd>18856\n<028add>18863\n<028ae4>18862\n<028bc1>18874\n<028bef>18875\n<028cdd>7641\n<028d10>18882\n<028d71>18883\n<028dfb>18885\n<028e17>14256\n<028e1f>18886\n<028e36>18890\n<028e89>18893\n<028eeb>18895\n<028ef6>7673\n<028f32>18897\n<028ff8>18903\n<0292a0>18917\n<0292b1>18918\n<029490>18935\n<0295cf>18944\n<02967f>13849\n<0296f0>18959\n<029719>18962\n<029750>18966\n<0298c6>18983\n<029a72>19001\n<029d4b>13717\n<029ddb>19026\n<029e15>19036\n<029e3d>20315\n<029e49>19038\n<029e8a>19037\n<029ec4>19046\n<029edb>19054\n<029ee9>19051\n<029fce>19071\n<029fd7>19071\n<02a01a>19077\n<02a02f>19075\n<02a082>19084\n<02a0f9>19083\n<02a190>17227\n<02a2b2>20072\n<02a38c>19109\n<02a437>19111\n<02a5f1>19123\n<02a602>19125\n<02a61a>20316\n<02a6b2>19129\n<02a9e6>14145\n<02b746>13780\n<02b751>13866\n<02b753>20088\n<02b75a>20096\n<02b75c>20097\n<02b765>20247\n<02b776>20114\n<02b777>13782\n<02b77c>20125\n<02b782>20141\n<02b789>14064\n<02b78b>20149\n<02b78e>13724\n<02b794>20153\n<02b7ac>20176\n<02b7af>20180\n<02b7bd>14174\n<02b7c9>20194\n<02b7cf>20201\n<02b7d2>20204\n<02b7d8>13651\n<02b7f0>20240\n<02b80d>20256\n<02b817>20260\n<02b81a>14278\n<02f804>15388\n<02f80f>7814\n<02f815>20061\n<02f818>7817\n<02f81a>13954\n<02f822>13684\n<02f828>13807\n<02f82c>14109\n<02f833>13719\n<02f83f>13815\n<02f846>20062\n<02f852>13841\n<02f862>13998\n<02f86d>14121\n<02f873>13832\n<02f877>7754\n<02f884>7734\n<02f899>20063\n<02f89a>13928\n<02f8a6>20064\n<02f8ac>13750\n<02f8b2>13867\n<02f8b6>14129\n<02f8d3>7816\n<02f8db>14140\n<02f8dc>7695\n<02f8e1>14291\n<02f8e5>20065\n<02f8ea>13679\n<02f8ed>7665\n<02f8fc>13656\n<02f903>13768\n<02f90b>13801\n<02f90f>13932\n<02f91a>13916\n<02f920>7839\n<02f921>13809\n<02f945>13357\n<02f947>13854\n<02f96c>14180\n<02f995>13670\n<02f9d0>14068\n<02f9de>20066\n<02f9df>14069\n<02f9f4>15269\nendcidchar\nbegincidrange\n<01f110><01f129>10004\n<01f130><01f149>10901\n<01f150><01f169>10631\n<01f170><01f189>11713\n<022b4f><022b50>17671\n<026ff6><026ff7>18554\n<0285c8><0285c9>18773\n<0289ba><0289bb>18834\nendcidrange\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJIS-X8",
    "content": "begincmap\n/CMapName /UniJIS-X8 def\n/WMode 0 def\nbegincidchar\n<5c>97\n<7c>99\n<7d>94\n<7e>100\n<c2a0>1\n<c2a4>107\n<c2a5>61\n<c2a6>93\n<c2a7>720\n<c2a8>647\n<c2a9>152\n<c2aa>140\n<c2ab>109\n<c2ac>153\n<c2ad>151\n<c2ae>154\n<c2af>129\n<c2b0>707\n<c2b1>694\n<c2b4>645\n<c2b5>159\n<c2b6>778\n<c2b7>117\n<c2b8>134\n<c2b9>160\n<c2ba>144\n<c2bb>123\n<c2bf>126\n<c386>139\n<c397>695\n<c398>142\n<c39f>150\n<c3a6>145\n<c3b7>696\n<c3b8>148\n<c480>9366\n<c481>9361\n<c482>15756\n<c483>15769\n<c484>15737\n<c485>15745\n<c486>15758\n<c487>15771\n<c488>15783\n<c489>15789\n<c48a>20333\n<c48b>20352\n<c48c>15759\n<c48d>15772\n<c48e>15761\n<c48f>15774\n<c490>20322\n<c491>15775\n<c492>9369\n<c493>9364\n<c496>20334\n<c497>20353\n<c498>15760\n<c499>15773\n<c49a>9395\n<c49b>9407\n<c49c>15784\n<c49d>15790\n<c49e>20335\n<c49f>20355\n<c4a0>20337\n<c4a1>20356\n<c4a2>20336\n<c4a4>15785\n<c4a5>15791\n<c4a6>20323\n<c4a7>15816\n<c4a8>9400\n<c4a9>9412\n<c4aa>9367\n<c4ab>9362\n<c4ae>20339\n<c4af>20357\n<c4b0>20338\n<c4b1>146\n<c4b2>20324\n<c4b3>20328\n<c4b4>15786\n<c4b5>15792\n<c4b6>20340\n<c4b7>20358\n<c4b8>20329\n<c4b9>15757\n<c4ba>15770\n<c4bb>20342\n<c4bc>20360\n<c4bd>15739\n<c4be>15747\n<c4bf>20325\n<c580>20330\n<c581>141\n<c582>147\n<c583>15762\n<c584>15776\n<c585>20343\n<c586>20361\n<c587>15763\n<c588>15777\n<c589>20331\n<c58a>20326\n<c58b>9436\n<c58c>9370\n<c58d>9365\n<c590>15764\n<c591>15778\n<c592>143\n<c593>149\n<c594>15755\n<c595>15768\n<c596>20344\n<c597>20362\n<c598>15765\n<c599>15779\n<c59a>15740\n<c59b>15748\n<c59c>15787\n<c59d>15793\n<c59e>15741\n<c59f>15750\n<c5a0>223\n<c5a1>227\n<c5a2>15767\n<c5a3>15781\n<c5a4>15742\n<c5a5>15751\n<c5a6>20327\n<c5a7>20332\n<c5a8>9405\n<c5a9>9417\n<c5aa>9368\n<c5ab>9363\n<c5ac>15788\n<c5ad>15794\n<c5ae>9404\n<c5af>9416\n<c5b0>15766\n<c5b1>15780\n<c5b2>20345\n<c5b3>20363\n<c5b4>20350\n<c5b5>20364\n<c5b6>20351\n<c5b7>20365\n<c5b8>224\n<c5b9>15743\n<c5ba>15752\n<c5bb>15744\n<c5bc>15754\n<c5bd>225\n<c5be>229\n<c692>105\n<c693>15826\n<c782>15821\n<c78d>9394\n<c78e>9406\n<c78f>9398\n<c790>9410\n<c791>9401\n<c792>9413\n<c793>9403\n<c794>9415\n<c795>20349\n<c796>15733\n<c797>20346\n<c798>15734\n<c799>20348\n<c79a>15735\n<c79b>20347\n<c79c>15736\n<c7b5>20354\n<c7bd>9421\n<c8b7>9435\n<c990>15832\n<c991>9418\n<c992>15836\n<c993>15822\n<c994>9423\n<c995>15841\n<c996>15802\n<c997>15823\n<c998>15829\n<c999>9426\n<c99a>9429\n<c99b>9432\n<c99c>15830\n<c99e>15831\n<c99f>15809\n<c9a0>15825\n<c9a1>15813\n<c9a4>15835\n<c9a5>15838\n<c9a6>15819\n<c9a7>15844\n<c9a8>15827\n<c9aa>15885\n<c9ac>15798\n<c9ad>15808\n<c9ae>15799\n<c9af>15833\n<c9b0>15814\n<c9b1>15795\n<c9b2>15810\n<c9b3>15803\n<c9b4>15886\n<c9b5>9437\n<c9b6>15887\n<c9b8>15888\n<c9b9>15800\n<c9ba>15843\n<c9bb>15807\n<c9bd>15804\n<c9be>15797\n<ca80>15889\n<ca81>15815\n<ca82>15805\n<ca83>9442\n<ca84>15824\n<ca88>15801\n<ca89>15828\n<ca8a>15834\n<ca8b>15796\n<ca8c>9438\n<ca8d>15837\n<ca8e>15812\n<ca8f>15890\n<ca90>15806\n<ca91>15842\n<ca92>9441\n<ca94>15818\n<ca95>15817\n<ca98>15820\n<ca99>15891\n<ca9c>15892\n<ca9d>15811\n<ca9f>15893\n<caa1>15840\n<caa2>15839\n<cab0>15894\n<cab2>15895\n<cab7>15896\n<cabb>98\n<cabc>96\n<cb81>15897\n<cb86>128\n<cb87>15749\n<cb88>15846\n<cb8c>15847\n<cb90>9443\n<cb91>15848\n<cb98>15738\n<cb99>15782\n<cb9a>133\n<cb9b>15746\n<cb9c>95\n<cb9d>15753\n<cb9e>15867\n<cc80>65\n<cc83>95\n<cc84>129\n<cc85>226\n<cc8a>133\n<cc8b>135\n<cc8c>137\n<cc8f>15850\n<cc9a>15879\n<cc9c>15861\n<cca4>15868\n<cca5>15858\n<cca7>134\n<cca8>136\n<cca9>15865\n<ccaa>15876\n<ccac>15859\n<ccaf>15866\n<ccb0>15869\n<ccb2>64\n<ccb4>15871\n<ccb6>138\n<ccb9>15860\n<ccbc>15870\n<ccbd>15864\n<cda1>15845\n<ce86>20427\n<ce8c>20432\n<ce8e>20433\n<ce8f>20435\n<ce90>20441\n<ceaa>20431\n<ceab>20434\n<ceb0>20445\n<cf82>16222\n<cf8a>20440\n<cf8b>20444\n<cf8e>20446\n<cf90>12090\n<cf91>12096\n<cf95>12094\n<cf9b>12095\n<d081>1065\n<d191>1098\nendcidchar\nbegincidrange\n<20><5b>1\n<5d><7b>62\n<c2a1><c2a3>101\n<c2b2><c2b3>157\n<c2bc><c2be>161\n<c380><c385>164\n<c387><c396>170\n<c399><c39e>187\n<c3a0><c3a5>193\n<c3a7><c3b6>199\n<c3b9><c3bf>216\n<c7b8><c7b9>15731\n<c9a2><c9a3>15883\n<cba0><cba1>15898\n<cba5><cba9>15851\n<cc81><cc82>127\n<cc86><cc88>130\n<cc98><cc99>15874\n<cc9d><cc9e>15872\n<cc9f><cca0>15862\n<ccba><ccbb>15877\n<ce84><ce85>20317\n<ce88><ce8a>20428\n<ce91><cea1>1011\n<cea3><cea9>1028\n<ceac><ceaf>20436\n<ceb1><cebf>1035\n<cf80><cf81>1050\n<cf83><cf89>1052\n<cf8c><cf8d>20442\n<d082><d08c>20447\n<d08e><d08f>20458\n<d090><d095>1059\n<d096><d0b5>1066\n<d0b6><d0bf>1099\n<d180><d18f>1109\n<d192><d19c>20460\n<d19e><d19f>20471\nendcidrange\nbegincidchar\n<e1babc>9397\n<e1babd>9409\n<e1bdb0>9420\n<e1bdb1>9419\n<e1bdb2>9434\n<e1bdb3>9433\n<e28082>231\n<e28083>633\n<e28090>662\n<e28091>14\n<e28092>114\n<e28093>114\n<e28094>138\n<e28095>661\n<e28096>666\n<e28098>98\n<e28099>96\n<e2809a>120\n<e2809c>108\n<e2809d>122\n<e2809e>121\n<e280a2>119\n<e280a5>669\n<e280a6>668\n<e280b0>772\n<e280bb>734\n<e280bc>12111\n<e280be>226\n<e280bf>15849\n<e28182>16282\n<e28184>104\n<e28189>12112\n<e28191>16281\n<e2819a>7898\n<e2819d>7897\n<e281b0>9377\n<e281bf>15908\n<e282ac>9354\n<e2839d>16328\n<e2839e>11035\n<e28480>11855\n<e28483>710\n<e28485>11859\n<e28489>8305\n<e2848a>8304\n<e2848f>12092\n<e28493>8025\n<e28496>7610\n<e284a1>8055\n<e284a2>228\n<e284a6>9355\n<e284a7>15515\n<e284ab>771\n<e284ae>20366\n<e284b5>12089\n<e284bb>8307\n<e28590>9790\n<e28591>9800\n<e28592>9806\n<e28595>15727\n<e285bf>8303\n<e28689>9780\n<e28692>736\n<e28693>739\n<e28694>12201\n<e28786>8309\n<e2878b>12207\n<e2878c>12206\n<e28790>12200\n<e28792>752\n<e28794>753\n<e287a6>8013\n<e287a7>8012\n<e287a8>8014\n<e287a9>8011\n<e28880>754\n<e28882>759\n<e28883>755\n<e28885>12184\n<e28886>20367\n<e28887>760\n<e28888>741\n<e28889>15476\n<e2888a>12091\n<e2888b>742\n<e2888f>20368\n<e28891>7625\n<e28892>693\n<e28893>12118\n<e28899>117\n<e2889a>765\n<e2889d>767\n<e2889e>703\n<e2889f>7629\n<e288a0>756\n<e288a9>748\n<e288aa>747\n<e288ad>8195\n<e288ae>7624\n<e288b4>704\n<e288b5>768\n<e288bc>100\n<e288bd>766\n<e28983>12120\n<e28985>15507\n<e28988>15508\n<e28992>762\n<e289a0>698\n<e289a1>761\n<e289a2>15505\n<e28a95>12188\n<e28a96>12186\n<e28a97>12189\n<e28a98>12187\n<e28a9e>15906\n<e28aa0>12185\n<e28aa5>757\n<e28abf>7630\n<e28c87>12219\n<e28c92>758\n<e28c98>15728\n<e28e9b>12143\n<e28e9c>12167\n<e28e9f>12167\n<e28ea0>12146\n<e28ea1>12151\n<e28ea2>12167\n<e28ea5>12167\n<e28ea6>12154\n<e28eaa>12167\n<e28f8e>16273\n<e290a3>16272\n<e293aa>8224\n<e293bf>10503\n<e29590>8251\n<e2959e>8252\n<e295a1>8254\n<e295aa>8253\n<e295af>8250\n<e295b0>8249\n<e29689>8244\n<e2968a>8243\n<e2968b>8242\n<e2968c>8241\n<e2968d>8240\n<e2968e>8239\n<e2968f>8238\n<e296a0>729\n<e296a1>728\n<e296a2>8015\n<e296aa>12239\n<e296ab>12237\n<e296b1>16235\n<e296b2>731\n<e296b3>730\n<e296b6>12195\n<e296b7>8010\n<e296bc>733\n<e296bd>732\n<e29780>12194\n<e29781>8009\n<e29786>727\n<e29787>726\n<e29789>8210\n<e2978a>20371\n<e2978b>723\n<e2978c>10502\n<e2978e>725\n<e2978f>724\n<e297a4>8258\n<e297a5>8257\n<e297a6>12254\n<e297af>779\n<e29885>722\n<e29886>721\n<e2988e>8056\n<e2989e>8219\n<e2989f>8222\n<e29980>706\n<e29982>705\n<e299a0>8211\n<e299a1>8017\n<e299a2>8019\n<e299a3>8213\n<e299a4>8018\n<e299a5>8212\n<e299a6>8214\n<e299a7>8016\n<e299aa>775\n<e299ab>16200\n<e299ac>12100\n<e299ad>774\n<e299ae>16199\n<e299af>773\n<e29aa0>12192\n<e29abd>20957\n<e29abe>12097\n<e29c82>12176\n<e29c93>16270\n<e29c9a>12241\n<e29cbf>12229\n<e29d80>12228\n<e29d96>12259\n<e29dbf>10514\n<e29ea1>8206\n<e2a6bf>16203\n<e2ac9a>11036\n<e2ba83>14305\n<e2ba85>13856\n<e2ba87>14105\n<e2ba89>14356\n<e2ba8b>14110\n<e2ba8e>4209\n<e2ba8f>14476\n<e2ba90>4646\n<e2ba92>3762\n<e2ba93>4739\n<e2ba94>4779\n<e2ba95>15391\n<e2ba96>14530\n<e2ba97>13852\n<e2ba98>14561\n<e2ba99>5059\n<e2ba9b>5089\n<e2ba9e>17893\n<e2ba9f>3644\n<e2baa0>3773\n<e2baa3>14749\n<e2baa4>15398\n<e2baa6>14157\n<e2baa8>14780\n<e2baa9>13729\n<e2baaa>13995\n<e2baab>14999\n<e2baac>19130\n<e2baad>14905\n<e2baae>13922\n<e2bab1>15000\n<e2bab2>14999\n<e2bab3>14189\n<e2bab7>14078\n<e2bab9>14099\n<e2babc>13747\n<e2babd>13646\n<e2bb80>14199\n<e2bb81>1931\n<e2bb82>15114\n<e2bb83>13870\n<e2bb84>2658\n<e2bb86>13682\n<e2bb8a>13898\n<e2bb8c>15403\n<e2bb8d>15184\n<e2bb8f>15262\n<e2bb91>3029\n<e2bb92>15255\n<e2bb96>15262\n<e2bb97>13645\n<e2bb98>2664\n<e2bb9d>13847\n<e2bb9e>13849\n<e2bb9f>13848\n<e2bba4>1614\n<e2bba8>3380\n<e2bba9>1323\n<e2bbab>2666\n<e2bbad>2243\n<e2bbaf>3965\n<e2bbb2>1615\n<e2bc80>1200\n<e2bc81>8371\n<e2bc82>4095\n<e2bc83>4097\n<e2bc84>1333\n<e2bc85>4102\n<e2bc86>3275\n<e2bc87>4110\n<e2bc88>2579\n<e2bc89>4208\n<e2bc8a>3286\n<e2bc8b>3392\n<e2bc8c>4219\n<e2bc8d>4227\n<e2bc8e>4233\n<e2bc8f>4243\n<e2bc90>4248\n<e2bc91>3163\n<e2bc92>3991\n<e2bc93>4294\n<e2bc96>4307\n<e2bc97>2375\n<e2bc98>3708\n<e2bc99>4316\n<e2bc9a>4321\n<e2bc9b>4328\n<e2bc9c>3746\n<e2bc9d>1969\n<e2bc9e>4459\n<e2bc9f>3156\n<e2bca0>2204\n<e2bca3>3878\n<e2bca4>2887\n<e2bca5>2433\n<e2bca6>2208\n<e2bca7>4622\n<e2bca8>2631\n<e2bca9>2454\n<e2bcaa>4646\n<e2bcab>4648\n<e2bcac>4658\n<e2bcad>2177\n<e2bcae>4716\n<e2bcaf>1979\n<e2bcb0>1918\n<e2bcb1>1738\n<e2bcb2>1519\n<e2bcb3>4739\n<e2bcb4>4741\n<e2bcb5>4761\n<e2bcb6>4763\n<e2bcb7>4768\n<e2bcb8>1655\n<e2bcb9>14521\n<e2bcba>4783\n<e2bcbb>4785\n<e2bcbc>2554\n<e2bcbd>4930\n<e2bcbe>1921\n<e2bcbf>2326\n<e2bd80>2215\n<e2bd81>5058\n<e2bd82>3592\n<e2bd83>3143\n<e2bd84>1740\n<e2bd85>3661\n<e2bd86>5088\n<e2bd87>3284\n<e2bd88>5132\n<e2bd89>1860\n<e2bd8a>3814\n<e2bd8b>1853\n<e2bd8c>2221\n<e2bd8d>5349\n<e2bd8e>5364\n<e2bd8f>5368\n<e2bd90>3450\n<e2bd91>3807\n<e2bd92>2223\n<e2bd93>5378\n<e2bd94>2603\n<e2bd95>1360\n<e2bd96>3066\n<e2bd97>3541\n<e2bd98>5604\n<e2bd99>5606\n<e2bd9a>3618\n<e2bd9c>1671\n<e2bd9d>1880\n<e2bd9e>1904\n<e2bd9f>1732\n<e2bda0>1245\n<e2bda1>1504\n<e2bda2>1537\n<e2bda3>2652\n<e2bda4>3899\n<e2bda5>3134\n<e2bda6>3479\n<e2bda7>14848\n<e2bda8>5783\n<e2bda9>3368\n<e2bdaa>3453\n<e2bdab>2172\n<e2bdac>3816\n<e2bdad>3779\n<e2bdae>3836\n<e2bdaf>2676\n<e2bdb0>2260\n<e2bdb1>14913\n<e2bdb2>1363\n<e2bdb3>1856\n<e2bdb4>3953\n<e2bdb5>2971\n<e2bdb6>3606\n<e2bdb7>2227\n<e2bdb8>1544\n<e2bdb9>6163\n<e2bdba>3901\n<e2bdbb>1227\n<e2bdbc>4061\n<e2bdbd>2261\n<e2bdbe>6205\n<e2bdbf>2262\n<e2be80>6227\n<e2be81>3281\n<e2be82>2569\n<e2be83>2263\n<e2be84>2232\n<e2be85>1235\n<e2be86>2697\n<e2be87>2726\n<e2be88>2360\n<e2be89>2081\n<e2be8a>2541\n<e2be8b>6322\n<e2be8c>6479\n<e2be8d>2988\n<e2be8e>1858\n<e2be8f>2022\n<e2be90>1189\n<e2be91>6635\n<e2be92>1887\n<e2be93>1455\n<e2be94>1908\n<e2be95>2921\n<e2be96>3198\n<e2be97>6742\n<e2be98>6745\n<e2be99>1419\n<e2be9a>2682\n<e2be9b>2808\n<e2be9c>2829\n<e2be9d>2574\n<e2be9e>2306\n<e2be9f>2575\n<e2bea0>2914\n<e2bea1>15183\n<e2bea2>3874\n<e2bea3>3243\n<e2bea4>3428\n<e2bea5>3948\n<e2bea6>1754\n<e2bea7>3029\n<e2bea8>3827\n<e2bea9>3550\n<e2beaa>7113\n<e2beab>7115\n<e2beac>1229\n<e2bead>8695\n<e2beae>3463\n<e2beaf>3800\n<e2beb0>1461\n<e2beb1>7171\n<e2beb2>7173\n<e2beb3>1339\n<e2beb4>3607\n<e2beb5>3561\n<e2beb6>3464\n<e2beb7>2543\n<e2beb8>2335\n<e2beb9>2035\n<e2beba>3333\n<e2bebb>2062\n<e2bebc>2036\n<e2bebd>7276\n<e2bebe>7293\n<e2bebf>7299\n<e2bf80>7300\n<e2bf81>1614\n<e2bf82>1685\n<e2bf83>3031\n<e2bf84>7414\n<e2bf85>2267\n<e2bf86>7425\n<e2bf87>3729\n<e2bf88>13323\n<e2bf89>1642\n<e2bf8a>2055\n<e2bf8b>7446\n<e2bf8c>7449\n<e2bf8d>3102\n<e2bf8e>1937\n<e2bf8f>2767\n<e2bf90>3475\n<e2bf93>3966\n<e38083>655\n<e38084>8308\n<e38092>735\n<e38093>740\n<e3809c>665\n<e3809d>7608\n<e3809f>7609\n<e380a0>8058\n<e380b0>12218\n<e380b6>8057\n<e380bb>12106\n<e380bc>16194\n<e380bd>12179\n<e3829f>12181\n<e382a0>16205\n<e383bb>638\n<e383bc>660\n<e383bf>16195\n<e388b0>8197\n<e388b3>8143\n<e388b4>8141\n<e388b5>8148\n<e388b6>8147\n<e388b7>8204\n<e388b8>8142\n<e388b9>7620\n<e388ba>8151\n<e388bb>8149\n<e388bc>8144\n<e388bd>8139\n<e388be>8146\n<e388bf>8140\n<e38980>8150\n<e38981>8205\n<e38982>8145\n<e38983>8138\n<e38984>10498\n<e38991>8091\n<e38a90>10471\n<e38a91>8161\n<e38a92>8160\n<e38a93>8162\n<e38a94>8156\n<e38a95>10495\n<e38a96>8165\n<e38a97>10492\n<e38a98>8158\n<e38a99>8223\n<e38a9a>10489\n<e38a9b>10488\n<e38a9c>10494\n<e38a9d>8319\n<e38a9e>8191\n<e38a9f>10479\n<e38aa2>10491\n<e38aa3>10490\n<e38aa9>8154\n<e38aaa>8157\n<e38aab>8159\n<e38aac>8163\n<e38aad>8153\n<e38aae>8164\n<e38aaf>8155\n<e38ab0>8152\n<e38c80>8048\n<e38c83>8042\n<e38c84>11876\n<e38c85>8183\n<e38c86>11877\n<e38c87>11881\n<e38c88>11879\n<e38c89>11884\n<e38c8a>11882\n<e38c8b>11886\n<e38c8c>11888\n<e38c8d>7595\n<e38c94>7586\n<e38c95>8041\n<e38c96>8039\n<e38c97>11896\n<e38c98>8040\n<e38c99>11898\n<e38c9e>8051\n<e38ca2>8038\n<e38ca3>8043\n<e38ca4>11907\n<e38ca5>11909\n<e38ca6>7596\n<e38ca7>7590\n<e38caa>8052\n<e38cab>7598\n<e38cad>11915\n<e38cb1>8049\n<e38cb2>11921\n<e38cb3>8327\n<e38cb6>7592\n<e38cb7>11930\n<e38cb8>11932\n<e38cb9>8046\n<e38cba>11933\n<e38cbb>8047\n<e38cbc>11926\n<e38cbd>11934\n<e38d80>11938\n<e38d81>11935\n<e38d82>8045\n<e38d87>8050\n<e38d88>11943\n<e38d89>7585\n<e38d8a>7599\n<e38d8d>7588\n<e38d8e>8328\n<e38d91>7593\n<e38d92>11950\n<e38d93>11954\n<e38d94>11951\n<e38d97>8044\n<e38db1>11861\n<e38dbb>8323\n<e38dbc>7623\n<e38dbd>7622\n<e38dbe>7621\n<e38dbf>8054\n<e38e8d>11864\n<e38e90>8035\n<e38e96>8037\n<e38e97>8024\n<e38e98>8026\n<e38e9b>11865\n<e38e9f>8186\n<e38ea0>8020\n<e38ea1>7607\n<e38ea2>8021\n<e38ea3>8187\n<e38ea6>8188\n<e38eb0>8030\n<e38eb1>8029\n<e38eb2>8028\n<e38eb3>8027\n<e38f82>11856\n<e38f84>7606\n<e38f88>8194\n<e38f8b>8034\n<e38f8c>8182\n<e38f8d>7611\n<e38f94>8036\n<e38f9a>11851\n<e39082>13698\n<e39085>15387\n<e39086>17242\n<e390a7>13910\n<e390ac>17246\n<e390ae>14216\n<e391a8>14047\n<e391aa>17269\n<e39288>15442\n<e39292>17294\n<e392b5>16793\n<e392bc>17303\n<e39381>18384\n<e39387>17307\n<e3939b>15425\n<e3949f>13865\n<e394be>14110\n<e395a3>17344\n<e395ae>17348\n<e396a6>17369\n<e396a8>17371\n<e39785>17377\n<e3979a>17386\n<e3979e>20067\n<e397b4>17395\n<e39885>17402\n<e39894>19131\n<e3998a>17441\n<e39a91>17473\n<e39a96>17477\n<e39a99>17475\n<e39b8f>17494\n<e39dab>17533\n<e39dac>17532\n<e39db5>17536\n<e39e8d>13850\n<e39f81>17550\n<e39fa2>14123\n<e39fa8>17570\n<e39fb4>17573\n<e39fbd>17576\n<e3a080>17578\n<e3a0af>17588\n<e3a0b6>17589\n<e3a180>17590\n<e3a19c>17594\n<e3a1a1>17596\n<e3a2a1>20171\n<e3a2ad>19132\n<e3a3ba>13852\n<e3a497>17625\n<e3a49a>17628\n<e3a5af>17643\n<e3a6a4>20122\n<e3a6b8>20123\n<e3a99c>20127\n<e3a9ae>17713\n<e3a9b3>17716\n<e3aa85>20142\n<e3ab84>20135\n<e3ab8b>20136\n<e3ab96>17731\n<e3ab97>17758\n<e3abaa>17741\n<e3abb3>15424\n<e3ac8e>17752\n<e3ac9a>17756\n<e3ac9c>17757\n<e3aca2>15433\n<e3adad>17804\n<e3adb7>17797\n<e3ae87>17826\n<e3ae88>13965\n<e3ae8d>17828\n<e3aea4>17834\n<e3aeb6>16910\n<e3af83>16911\n<e3af8d>17848\n<e3afb0>17865\n<e3afb3>20151\n<e3b08f>16919\n<e3b0a6>17887\n<e3b383>17916\n<e3b392>17921\n<e3b491>17957\n<e3b49e>17968\n<e3b4b1>20158\n<e3b58e>7655\n<e3b5a4>17994\n<e3b69a>18008\n<e3b780>18026\n<e3b78c>19133\n<e3b794>18031\n<e3b885>18043\n<e3b8bf>16968\n<e3b980>20170\n<e3b9a0>18059\n<e3b9a6>18061\n<e3b9a8>18062\n<e3ba83>18069\n<e3ba8a>15427\n<e3ba94>18075\n<e3bb9a>15432\n<e3bd97>18123\n<e3bdb2>16984\n<e3bdb5>18137\n<e3bdb7>18139\n<e3beae>18157\n<e3beb1>14164\n<e3bf89>18168\n<e3bf97>18173\n<e3bf9c>19134\n<e480b9>18191\n<e48198>18198\n<e48293>15436\n<e48483>15439\n<e48485>18235\n<e48588>18247\n<e4858f>18250\n<e485a3>18254\n<e486b4>18269\n<e486bf>18272\n<e487a6>18283\n<e487ae>18287\n<e487b3>18284\n<e48887>18294\n<e4888e>18297\n<e489a4>14176\n<e48a93>15440\n<e48b86>18335\n<e48b96>18346\n<e48b9d>18350\n<e48c82>18364\n<e48cab>18377\n<e48d83>18379\n<e48fae>18423\n<e48fb0>18426\n<e49088>18432\n<e4908c>15426\n<e49097>18434\n<e4909c>18435\n<e490a2>18437\n<e49193>14195\n<e4919b>17060\n<e491b6>18460\n<e491ba>18461\n<e49291>18467\n<e492b3>18494\n<e492be>18492\n<e49394>18493\n<e49488>18524\n<e4948d>18520\n<e494a5>14206\n<e49583>18540\n<e495ba>15435\n<e4969d>17108\n<e496b8>18592\n<e496be>19135\n<e497a5>18618\n<e497aa>17113\n<e4988f>18634\n<e49890>19136\n<e49981>18648\n<e499a5>15438\n<e49aa1>18665\n<e49aae>15441\n<e49aaf>18669\n<e49c8c>18690\n<e49c9f>20219\n<e49da4>18712\n<e49fa6>14224\n<e49fbd>18724\n<e4a096>18734\n<e4a09e>20225\n<e4a184>17141\n<e4a18e>18746\n<e4a2b5>18779\n<e4a6b0>17183\n<e4a7a7>18898\n<e4a7ba>18902\n<e4a884>18907\n<e4a8a9>18910\n<e4aabc>18934\n<e4acb8>13791\n<e4acbb>18958\n<e4adbe>19137\n<e4af82>18995\n<e4af8a>18997\n<e4af92>18999\n<e4afa8>15430\n<e4b097>17204\n<e4b0a0>19016\n<e4b0b8>19138\n<e4b384>19076\n<e4b391>19079\n<e4b3a1>19139\n<e4b487>19099\n<e4b5b7>19115\n<e4b880>1200\n<e4b881>3000\n<e4b882>17234\n<e4b883>2275\n<e4b887>3754\n<e4b888>2510\n<e4b889>2174\n<e4b88a>2509\n<e4b88b>1340\n<e4b88c>19140\n<e4b88d>3526\n<e4b88e>3881\n<e4b88f>17235\n<e4b890>4091\n<e4b891>1233\n<e4b892>17236\n<e4b894>1484\n<e4b895>4092\n<e4b896>2632\n<e4b897>4311\n<e4b898>1648\n<e4b899>3594\n<e4b89e>2511\n<e4b89f>14298\n<e4b8a1>3974\n<e4b8a6>3602\n<e4b8a8>8371\n<e4b8a9>17237\n<e4b8aa>4093\n<e4b8ab>14299\n<e4b8ac>14157\n<e4b8ad>2980\n<e4b8ae>17238\n<e4b8b1>4094\n<e4b8b2>1778\n<e4b8b5>21075\n<e4b8b6>4095\n<e4b8b7>13981\n<e4b8b8>1561\n<e4b8b9>2926\n<e4b8bb>2323\n<e4b8bc>4096\n<e4b8bf>4097\n<e4b982>4098\n<e4b983>3307\n<e4b984>14304\n<e4b985>1649\n<e4b987>17239\n<e4b988>14126\n<e4b98b>3309\n<e4b98d>3259\n<e4b98e>1911\n<e4b98f>3681\n<e4b991>17241\n<e4b995>6480\n<e4b996>4099\n<e4b997>2512\n<e4b998>4100\n<e4b999>1333\n<e4b99a>14305\n<e4b99c>21076\n<e4b99d>1757\n<e4b99e>1956\n<e4b99f>3829\n<e4b9a2>4659\n<e4b9a3>21077\n<e4b9a8>21078\n<e4b9a9>17244\n<e4b9b1>3930\n<e4b9b3>3285\n<e4b9b9>19143\n<e4b9be>1505\n<e4b9bf>14306\n<e4ba80>1615\n<e4ba82>4101\n<e4ba85>4102\n<e4ba86>3971\n<e4ba88>3879\n<e4ba89>2794\n<e4ba8a>4104\n<e4ba8b>2244\n<e4ba8c>3275\n<e4ba8d>14307\n<e4ba8e>4107\n<e4ba91>1248\n<e4ba92>1939\n<e4ba94>1938\n<e4ba95>1194\n<e4ba96>14308\n<e4ba97>21081\n<e4ba98>4081\n<e4ba99>4080\n<e4ba9b>2083\n<e4ba9c>1125\n<e4ba9d>17245\n<e4baa1>3682\n<e4baa2>4111\n<e4baa4>1958\n<e4baa5>1195\n<e4baa6>3744\n<e4baa8>1686\n<e4baad>3070\n<e4baae>3972\n<e4baaf>21082\n<e4bab0>4112\n<e4bab3>4113\n<e4bab6>4114\n<e4bab9>14309\n<e4baba>2579\n<e4babb>13856\n<e4babc>17247\n<e4bb80>2372\n<e4bb81>2580\n<e4bb82>4119\n<e4bb83>17248\n<e4bb84>4117\n<e4bb86>4118\n<e4bb87>1650\n<e4bb88>17249\n<e4bb8a>2067\n<e4bb8b>1392\n<e4bb8d>4116\n<e4bb8e>4115\n<e4bb8f>3577\n<e4bb90>14310\n<e4bb94>2196\n<e4bb95>2195\n<e4bb96>2846\n<e4bb97>4120\n<e4bb98>3527\n<e4bb99>2699\n<e4bb9a>17251\n<e4bb9b>21083\n<e4bb9d>656\n<e4bb9e>4121\n<e4bb9f>4123\n<e4bba0>14311\n<e4bba1>8372\n<e4bba2>21084\n<e4bba3>2885\n<e4bba4>4009\n<e4bba5>1166\n<e4bba8>21085\n<e4bbab>17250\n<e4bbad>4122\n<e4bbae>1342\n<e4bbaf>21086\n<e4bbb0>1724\n<e4bbb1>17252\n<e4bbb2>2981\n<e4bbb3>19144\n<e4bbb5>17253\n<e4bbb6>1861\n<e4bbb7>4124\n<e4bbbb>3290\n<e4bbbc>8373\n<e4bbbd>14312\n<e4bbbe>21087\n<e4bbbf>14313\n<e4bc80>8374\n<e4bc81>1575\n<e4bc82>21088\n<e4bc83>8375\n<e4bc88>21089\n<e4bc89>4125\n<e4bc8a>1167\n<e4bc8b>14314\n<e4bc8c>19145\n<e4bc8d>1940\n<e4bc8e>1576\n<e4bc8f>3564\n<e4bc90>3398\n<e4bc91>1651\n<e4bc92>21090\n<e4bc95>14315\n<e4bc96>17254\n<e4bc97>21091\n<e4bc99>19146\n<e4bc9a>1393\n<e4bc9c>4160\n<e4bc9d>3131\n<e4bcab>19147\n<e4bcae>19148\n<e4bcaf>3362\n<e4bcb0>4127\n<e4bcb1>19149\n<e4bcb3>21092\n<e4bcb4>3408\n<e4bcb5>21093\n<e4bcb6>4010\n<e4bcb7>17256\n<e4bcb8>2547\n<e4bcb9>8376\n<e4bcba>2197\n<e4bcbb>14317\n<e4bcbc>2245\n<e4bcbd>1344\n<e4bcbe>17257\n<e4bd80>21094\n<e4bd82>21095\n<e4bd83>3053\n<e4bd86>2912\n<e4bd87>4131\n<e4bd88>16779\n<e4bd89>14318\n<e4bd8d>1168\n<e4bd8e>3071\n<e4bd8f>2373\n<e4bd90>2084\n<e4bd91>3854\n<e4bd92>21098\n<e4bd93>2862\n<e4bd94>14319\n<e4bd95>1343\n<e4bd96>8377\n<e4bd97>4130\n<e4bd98>17258\n<e4bd99>3880\n<e4bd9a>4126\n<e4bd9b>4128\n<e4bd9c>2142\n<e4bd9d>4129\n<e4bd9e>4563\n<e4bd9f>16780\n<e4bda0>14316\n<e4bda3>21099\n<e4bda4>17255\n<e4bda9>4137\n<e4bdaa>16781\n<e4bdac>16782\n<e4bdae>21100\n<e4bdaf>4140\n<e4bdb0>4138\n<e4bdb1>21101\n<e4bdb3>1346\n<e4bdb5>3595\n<e4bdb6>4132\n<e4bdb9>21102\n<e4bdba>14320\n<e4bdbb>4136\n<e4bdbc>1959\n<e4bdbf>2198\n<e4be81>21103\n<e4be82>17262\n<e4be83>1506\n<e4be84>19150\n<e4be85>17263\n<e4be86>4141\n<e4be88>4133\n<e4be89>21104\n<e4be8a>8379\n<e4be8b>4011\n<e4be8c>21105\n<e4be8d>2246\n<e4be8e>21106\n<e4be8f>4134\n<e4be90>21107\n<e4be91>4139\n<e4be92>8378\n<e4be93>21108\n<e4be94>8381\n<e4be96>4142\n<e4be97>14323\n<e4be98>4135\n<e4be99>21109\n<e4be9a>8380\n<e4be9b>1689\n<e4be9d>1169\n<e4be9e>19151\n<e4be9f>21110\n<e4bea0>1690\n<e4bea1>1345\n<e4beab>4564\n<e4bead>3751\n<e4beae>3552\n<e4beaf>1960\n<e4beb2>17265\n<e4beb5>2549\n<e4beb6>3967\n<e4beb7>19152\n<e4beb9>21111\n<e4bebe>14324\n<e4bebf>3624\n<e4bf82>1806\n<e4bf83>2821\n<e4bf84>1380\n<e4bf85>17266\n<e4bf86>21117\n<e4bf88>21118\n<e4bf89>8364\n<e4bf8a>2397\n<e4bf8b>17267\n<e4bf8c>21119\n<e4bf8d>8382\n<e4bf8e>4146\n<e4bf8f>14325\n<e4bf90>4151\n<e4bf91>4149\n<e4bf92>17268\n<e4bf93>15407\n<e4bf94>4144\n<e4bf97>2831\n<e4bf98>4147\n<e4bf9a>4150\n<e4bf9b>4148\n<e4bf9c>21120\n<e4bf9d>3629\n<e4bf9f>4145\n<e4bfa0>7660\n<e4bfa1>2548\n<e4bfa2>21121\n<e4bfa3>3745\n<e4bfa6>17264\n<e4bfae>2350\n<e4bfaf>4166\n<e4bfb0>21122\n<e4bfb1>13731\n<e4bfb2>17270\n<e4bfb3>3334\n<e4bfb5>3496\n<e4bfb6>4161\n<e4bfb8>3648\n<e4bfba>1334\n<e4bfbc>21123\n<e4bfbd>14326\n<e4bfbe>4165\n<e4bfbf>8385\n<e58082>20299\n<e58084>19153\n<e58085>4159\n<e58086>4168\n<e58087>21124\n<e58089>2772\n<e5808a>21125\n<e5808b>1912\n<e5808c>19154\n<e5808d>3346\n<e5808e>16783\n<e5808f>5632\n<e58090>14329\n<e58091>4167\n<e58092>3159\n<e58093>17271\n<e58094>4156\n<e58096>1962\n<e58097>21126\n<e58098>16784\n<e58099>1961\n<e5809a>4154\n<e5809b>14330\n<e5809c>17272\n<e5809d>21127\n<e5809e>8386\n<e5809f>2310\n<e580a1>4162\n<e580a2>8384\n<e580a3>3647\n<e580a4>2955\n<e580a5>4158\n<e580a7>14331\n<e580a8>4155\n<e580a9>4163\n<e580aa>4157\n<e580ab>3993\n<e580ac>4164\n<e580ad>4071\n<e580ae>14332\n<e580b0>21128\n<e580b5>21131\n<e580b6>1758\n<e580b9>1862\n<e580bb>14336\n<e58180>8383\n<e58181>16785\n<e58182>8389\n<e58183>4169\n<e58185>21132\n<e58186>8387\n<e58187>4170\n<e58188>4174\n<e58189>1170\n<e5818a>21133\n<e5818c>19155\n<e5818e>17273\n<e5818f>3616\n<e58190>4173\n<e58193>17274\n<e58195>4172\n<e58196>4176\n<e58197>14333\n<e58199>21136\n<e5819a>4175\n<e5819c>3072\n<e5819f>19156\n<e581a0>21137\n<e581a2>19157\n<e581a3>17275\n<e581a5>1864\n<e581a6>14334\n<e581a7>21138\n<e581aa>14335\n<e581ac>4177\n<e581ad>21139\n<e581b0>8388\n<e581b1>21140\n<e581b2>2289\n<e581b4>2822\n<e581b5>3073\n<e581b6>1774\n<e581b7>19158\n<e581b8>4178\n<e581bd>1616\n<e58280>4179\n<e58281>21141\n<e58285>4181\n<e58286>21144\n<e58288>17277\n<e5828a>21145\n<e5828d>3683\n<e5828e>19159\n<e5828f>14337\n<e58290>21146\n<e58291>1852\n<e58294>8390\n<e58295>17280\n<e58296>14338\n<e58298>2175\n<e58299>3467\n<e5829a>4180\n<e5829b>21147\n<e5829c>14339\n<e5829e>19160\n<e582a2>19161\n<e582a3>17276\n<e582aa>17281\n<e582ac>2101\n<e582ad>3885\n<e582b1>17283\n<e582b2>4183\n<e582b3>4186\n<e582b4>4182\n<e582b5>2100\n<e582b7>2439\n<e582b9>21153\n<e582bd>21154\n<e582be>1807\n<e58380>21155\n<e58382>4187\n<e58383>19162\n<e58384>17286\n<e58387>17287\n<e5838c>14340\n<e5838d>3207\n<e5838e>17290\n<e5838f>2814\n<e58390>16787\n<e58391>1691\n<e58393>21156\n<e58394>17292\n<e58395>3707\n<e58396>4188\n<e58398>8392\n<e58399>15408\n<e5839a>3973\n<e5839e>4189\n<e5839f>21159\n<e583a1>17293\n<e583a2>21160\n<e583a3>4192\n<e583a4>21161\n<e583a5>4190\n<e583a6>14341\n<e583a7>2768\n<e583a8>19163\n<e583a9>14342\n<e583ad>4191\n<e583ae>4193\n<e583af>14343\n<e583b0>15409\n<e583b1>19164\n<e583b2>16786\n<e583b3>17288\n<e583b4>8391\n<e583b5>4195\n<e583b6>21162\n<e583b9>4194\n<e583ba>21163\n<e583bb>3608\n<e583be>19165\n<e58480>1617\n<e58483>16789\n<e58484>1327\n<e58486>16788\n<e58487>19166\n<e58488>14344\n<e58489>4196\n<e5848b>14345\n<e58490>14346\n<e58492>2336\n<e58494>4201\n<e58495>4200\n<e58496>4199\n<e58497>17296\n<e58498>4143\n<e58499>21165\n<e5849a>4202\n<e5849b>14347\n<e5849e>14348\n<e5849f>2440\n<e584a1>4203\n<e584a3>21168\n<e584aa>3855\n<e584af>21173\n<e584b1>21174\n<e584b3>19170\n<e584b4>21175\n<e584b5>16790\n<e584b7>4205\n<e584b8>19171\n<e584b9>21176\n<e584ba>4204\n<e584bb>4207\n<e584bc>4206\n<e584bf>4208\n<e58580>4209\n<e58581>1208\n<e58582>21177\n<e58583>1897\n<e58584>1809\n<e58585>2374\n<e58586>3001\n<e58587>1692\n<e58588>2700\n<e58589>1963\n<e5858a>8393\n<e5858b>2048\n<e5858c>4211\n<e5858d>3796\n<e5858f>21178\n<e58590>2247\n<e58592>4210\n<e58593>21179\n<e58594>4212\n<e58595>16791\n<e58597>16792\n<e58598>21180\n<e5859a>3160\n<e5859c>1491\n<e5859f>14349\n<e585a0>17298\n<e585a2>4213\n<e585a4>8394\n<e585a5>3286\n<e585a6>21181\n<e585a7>13966\n<e585a8>2742\n<e585ab>3392\n<e585ac>1964\n<e585ad>4065\n<e585ae>4217\n<e585b1>1694\n<e585b3>17300\n<e585b4>19172\n<e585b5>3596\n<e585b6>2838\n<e585b7>1769\n<e585b8>3119\n<e585b9>14201\n<e585bb>18393\n<e585bc>1865\n<e585be>21182\n<e58680>4218\n<e58682>4219\n<e58683>17301\n<e58684>19173\n<e58685>3258\n<e58686>1281\n<e58689>4222\n<e5868a>2157\n<e5868b>17302\n<e5868c>4221\n<e5868d>2102\n<e5868e>21183\n<e5868f>4223\n<e58690>6235\n<e58691>4224\n<e58692>3695\n<e58693>4225\n<e58697>2513\n<e58698>17304\n<e58699>2296\n<e5869d>8395\n<e586a0>1507\n<e586a1>14350\n<e586a2>4230\n<e586a3>17305\n<e586a5>3785\n<e586a6>4229\n<e586a8>3532\n<e586ac>3161\n<e586ad>17306\n<e586b0>4237\n<e586b3>4234\n<e586b4>2131\n<e586b5>4238\n<e586b6>3830\n<e586b7>4012\n<e586b8>19174\n<e586ba>19175\n<e586bc>14351\n<e586bd>4239\n<e586be>8396\n<e586bf>21184\n<e58782>21185\n<e58783>15410\n<e58784>2636\n<e58785>4240\n<e58786>2404\n<e58788>19176\n<e58789>4241\n<e5878a>16794\n<e5878b>3002\n<e5878c>3975\n<e5878d>3162\n<e5878f>19177\n<e58791>19178\n<e58792>21186\n<e58795>21187\n<e58796>4314\n<e58798>19181\n<e5879b>4242\n<e5879c>8284\n<e5879d>1725\n<e5879e>20300\n<e5879f>19182\n<e587a0>4243\n<e587a1>3724\n<e587a2>16795\n<e587a5>21188\n<e587a6>2418\n<e587a7>2908\n<e587a9>4245\n<e587aa>3260\n<e587ac>8397\n<e587ad>4246\n<e587ae>14353\n<e587b0>4247\n<e587b1>1420\n<e587b2>21189\n<e587b3>17309\n<e587b4>14354\n<e587b5>4248\n<e587b6>1695\n<e587b7>21190\n<e587b8>3236\n<e587b9>1308\n<e587ba>2394\n<e587bd>3381\n<e587be>4249\n<e58880>3163\n<e58883>2581\n<e58884>4250\n<e58885>19183\n<e58886>3580\n<e58887>2686\n<e58888>1502\n<e5888a>1509\n<e5888b>4251\n<e5888e>4253\n<e58891>1808\n<e58892>17310\n<e58893>14357\n<e58894>4252\n<e58895>8398\n<e58896>17311\n<e58897>4027\n<e58898>21191\n<e5889d>2419\n<e588a2>21192\n<e588a4>3409\n<e588a5>3612\n<e588a6>19184\n<e588a7>4254\n<e588a8>19185\n<e588a9>3938\n<e588aa>4255\n<e588ab>19186\n<e588ae>4256\n<e588b0>3192\n<e588b3>4257\n<e588b5>19189\n<e588b6>2637\n<e588b7>2158\n<e588b8>1866\n<e588b9>4258\n<e588ba>2199\n<e588bb>2049\n<e588bc>19190\n<e58983>3074\n<e58984>4260\n<e58985>21193\n<e58987>2823\n<e58989>14358\n<e5898a>2143\n<e5898d>2738\n<e5898f>4259\n<e58994>4264\n<e58995>17313\n<e58996>3684\n<e58997>16796\n<e58998>21194\n<e5899a>19191\n<e5899b>2038\n<e5899c>17314\n<e5899d>7774\n<e5899e>4263\n<e5899f>21195\n<e589a0>19192\n<e589a1>14359\n<e589a3>1867\n<e589a4>2126\n<e589a5>3363\n<e589a6>14360\n<e589a9>4267\n<e589aa>4265\n<e589ac>17315\n<e589ae>19193\n<e589af>3565\n<e589b0>2514\n<e589b1>4274\n<e589b2>1474\n<e589b3>4268\n<e589b4>4266\n<e589b5>2769\n<e589b7>17316\n<e589bd>4270\n<e589bf>4269\n<e58a80>21196\n<e58a82>17318\n<e58a83>1442\n<e58a84>17317\n<e58a85>21197\n<e58a87>1846\n<e58a88>4275\n<e58a89>3957\n<e58a8a>19196\n<e58a8c>19197\n<e58a8d>4271\n<e58a91>4276\n<e58a92>4273\n<e58a93>14361\n<e58a94>4272\n<e58a98>17320\n<e58a9a>21201\n<e58a9b>3991\n<e58a9c>8399\n<e58a9f>1965\n<e58aa0>1347\n<e58aa3>4028\n<e58aa4>17322\n<e58aa5>21202\n<e58aa6>8400\n<e58aa7>21203\n<e58aa9>2431\n<e58aaa>3154\n<e58aab>2039\n<e58aaf>8573\n<e58ab0>21204\n<e58ab1>4013\n<e58ab4>4049\n<e58ab5>4282\n<e58ab9>1966\n<e58abc>4281\n<e58abd>21208\n<e58abe>1421\n<e58b80>8401\n<e58b81>4283\n<e58b83>3716\n<e58b84>21209\n<e58b85>3032\n<e58b86>21210\n<e58b87>3856\n<e58b88>14362\n<e58b89>3625\n<e58b8a>17325\n<e58b8c>16797\n<e58b8d>4284\n<e58b8f>21211\n<e58b90>14056\n<e58b91>17326\n<e58b92>7150\n<e58b94>21212\n<e58b95>3208\n<e58b96>16798\n<e58b97>4285\n<e58b98>1510\n<e58b99>3775\n<e58b9b>8402\n<e58b9c>21213\n<e58b9d>2441\n<e58b9e>4286\n<e58b9f>3639\n<e58ba0>4290\n<e58ba1>19198\n<e58ba2>2638\n<e58ba3>4287\n<e58ba4>1736\n<e58ba5>21214\n<e58ba6>4288\n<e58ba7>1511\n<e58ba8>21215\n<e58ba9>19199\n<e58baa>21216\n<e58bac>21217\n<e58bb0>14363\n<e58bb1>19200\n<e58bb2>1796\n<e58bb3>4291\n<e58bb4>21218\n<e58bb5>4292\n<e58bb6>21219\n<e58bb7>17328\n<e58bba>2311\n<e58bbb>16799\n<e58bbe>1967\n<e58bbf>3818\n<e58c80>8403\n<e58c81>3828\n<e58c82>3279\n<e58c83>19201\n<e58c85>3649\n<e58c86>4295\n<e58c87>20301\n<e58c88>4296\n<e58c8c>21220\n<e58c8d>4298\n<e58c8f>4300\n<e58c90>4299\n<e58c91>19202\n<e58c93>21221\n<e58c95>4301\n<e58c96>1341\n<e58c97>3706\n<e58c98>21222\n<e58c99>2156\n<e58c9a>4302\n<e58c9b>21223\n<e58c9c>16800\n<e58c9d>2779\n<e58c9e>21224\n<e58c9f>19203\n<e58ca0>2442\n<e58ca1>1697\n<e58ca3>4303\n<e58ca4>8405\n<e58ca5>21225\n<e58caa>3439\n<e58cad>19204\n<e58caf>4304\n<e58cb0>21231\n<e58cb1>4305\n<e58cb2>19205\n<e58cb3>4306\n<e58cb5>17329\n<e58cb8>4307\n<e58cb9>3478\n<e58cba>1760\n<e58cbb>1193\n<e58cbc>21232\n<e58cbd>19206\n<e58cbe>14366\n<e58cbf>3223\n<e58d80>4308\n<e58d81>2375\n<e58d82>17330\n<e58d83>2701\n<e58d85>4310\n<e58d86>4309\n<e58d87>2443\n<e58d88>1941\n<e58d89>4312\n<e58d8a>3410\n<e58d8b>14368\n<e58d8c>14367\n<e58d8d>4313\n<e58d91>3440\n<e58d92>2836\n<e58d93>2894\n<e58d94>1696\n<e58d97>3270\n<e58d98>2927\n<e58d99>21233\n<e58d9a>3364\n<e58d9b>21234\n<e58d9c>3708\n<e58d9e>4315\n<e58da0>2702\n<e58da1>14369\n<e58da3>16801\n<e58da5>19207\n<e58da6>1803\n<e58da7>17333\n<e58da9>4316\n<e58dac>14370\n<e58dad>19208\n<e58dae>4317\n<e58daf>1230\n<e58db0>1209\n<e58db1>1577\n<e58db2>8406\n<e58db3>2824\n<e58db4>1643\n<e58db5>3931\n<e58db7>4320\n<e58db8>1335\n<e58db9>19209\n<e58dba>17334\n<e58dbb>4319\n<e58dbd>13365\n<e58dbe>19210\n<e58e82>4321\n<e58e83>21236\n<e58e84>3837\n<e58e89>14288\n<e58e8e>21239\n<e58e93>8407\n<e58e94>19211\n<e58e96>4322\n<e58e98>3994\n<e58e99>19212\n<e58e9a>1968\n<e58e9d>16802\n<e58e9f>1898\n<e58ea0>4323\n<e58ea1>21240\n<e58ea4>17335\n<e58ea5>4325\n<e58ea6>4324\n<e58ea8>2597\n<e58eaa>19213\n<e58eab>14371\n<e58ead>1280\n<e58eae>4326\n<e58eaf>19214\n<e58eb0>4327\n<e58eb2>8408\n<e58eb3>1899\n<e58eb4>17336\n<e58eb5>21241\n<e58eb6>4328\n<e58eb7>17338\n<e58eb8>21242\n<e58eba>19215\n<e58ebb>1672\n<e58ebd>21243\n<e58f80>17339\n<e58f81>19216\n<e58f82>2176\n<e58f83>4329\n<e58f88>3746\n<e58f8a>1652\n<e58f8b>3857\n<e58f8c>2770\n<e58f8d>3411\n<e58f8e>2345\n<e58f8f>21244\n<e58f94>2385\n<e58f95>17343\n<e58f96>2324\n<e58f97>2337\n<e58f99>2432\n<e58f9a>14372\n<e58f9d>8409\n<e58f9e>21247\n<e58fa0>19219\n<e58fa1>1253\n<e58fa2>2771\n<e58fa3>1969\n<e58fa4>1913\n<e58fa5>1759\n<e58fa6>14373\n<e58fa7>21249\n<e58fa8>4336\n<e58fa9>2911\n<e58faa>2910\n<e58fab>1699\n<e58fac>2444\n<e58fad>4337\n<e58fae>4335\n<e58faf>1348\n<e58fb0>2886\n<e58fb1>2276\n<e58fb2>2201\n<e58fb3>1224\n<e58fb4>17345\n<e58fb5>14374\n<e58fb6>1486\n<e58fb7>2040\n<e58fb8>2200\n<e58fba>4338\n<e59081>4339\n<e59082>21250\n<e59083>1635\n<e59084>1444\n<e59088>2041\n<e59089>1634\n<e5908a>3067\n<e5908b>1223\n<e5908c>3209\n<e5908d>3786\n<e5908e>1971\n<e5908f>3939\n<e59090>3137\n<e59091>1970\n<e59092>16803\n<e59093>19220\n<e5909a>21251\n<e5909b>1797\n<e5909d>4348\n<e5909e>13964\n<e5909f>1755\n<e590a0>3704\n<e590a1>21252\n<e590a4>17346\n<e590a6>3441\n<e590a7>14375\n<e590a8>17347\n<e590a9>4347\n<e590aa>19221\n<e590ab>1562\n<e590ae>4345\n<e590af>21253\n<e590b1>19222\n<e590b3>13760\n<e590b6>4346\n<e590b8>1653\n<e590b9>2599\n<e590bb>3581\n<e590bc>4344\n<e590bd>4340\n<e590be>1943\n<e590bf>13775\n<e59180>4341\n<e59182>4042\n<e59183>17349\n<e59184>21254\n<e59186>3650\n<e59187>21255\n<e59188>3076\n<e59189>1942\n<e5918a>2050\n<e5918c>19225\n<e5918d>14376\n<e5918e>4349\n<e5918f>21256\n<e59191>3253\n<e59195>14115\n<e5919e>21257\n<e5919f>4353\n<e591a2>17350\n<e591a4>21258\n<e591a6>14377\n<e591a7>21259\n<e591a8>2346\n<e591a9>21260\n<e591aa>2338\n<e591ab>14378\n<e591ac>17351\n<e591b0>4356\n<e591b1>4354\n<e591b3>3759\n<e591b4>14379\n<e591b5>4351\n<e591b6>4360\n<e591b7>4355\n<e591bb>4358\n<e591bc>1914\n<e591bd>3787\n<e591bf>16804\n<e59280>4359\n<e59281>21263\n<e59283>21264\n<e59284>4361\n<e59285>21265\n<e59286>4363\n<e59288>16805\n<e59289>21266\n<e5928a>8412\n<e5928b>2144\n<e5928c>4072\n<e5928d>14380\n<e5928e>4352\n<e5928f>4350\n<e59290>4362\n<e59291>21267\n<e59292>4357\n<e59295>17352\n<e59296>14381\n<e5929c>8411\n<e5929f>21268\n<e592a0>17353\n<e592a1>14382\n<e592a2>4365\n<e592a4>4374\n<e592a5>4367\n<e592a6>17354\n<e592a7>19226\n<e592a8>4371\n<e592a9>8413\n<e592aa>19227\n<e592ab>4372\n<e592ad>14383\n<e592ae>17355\n<e592af>4401\n<e592b1>19228\n<e592b2>2137\n<e592b3>1423\n<e592b7>17356\n<e592b8>4366\n<e592b9>14384\n<e592ba>17357\n<e592bb>19229\n<e592bc>4376\n<e592bd>1210\n<e592be>4375\n<e592bf>14385\n<e59380>1129\n<e59381>3516\n<e59382>4373\n<e59383>17358\n<e59384>4369\n<e59386>14386\n<e59387>4364\n<e59388>4370\n<e59389>2104\n<e5938a>21269\n<e5938d>14387\n<e5938e>19230\n<e59398>4377\n<e593a0>21270\n<e593a1>1211\n<e593a2>4386\n<e593a9>3735\n<e593aa>19231\n<e593ac>17360\n<e593ad>4384\n<e593ae>4383\n<e593af>17361\n<e593b1>17362\n<e593b2>3113\n<e593b3>17363\n<e593b6>21271\n<e593ba>4385\n<e593bc>19232\n<e593bd>4382\n<e593be>21272\n<e593bf>8414\n<e59484>1238\n<e59485>19233\n<e59486>2086\n<e59487>2550\n<e59488>19234\n<e59489>17366\n<e5948e>14388\n<e5948f>4380\n<e59490>3164\n<e59494>4381\n<e59495>19235\n<e59496>1126\n<e594a7>19236\n<e594aa>19237\n<e594ab>14389\n<e594ae>4391\n<e594af>3853\n<e594b1>2447\n<e594b2>21275\n<e594b3>4397\n<e594b5>14390\n<e594b6>19238\n<e594b8>4396\n<e594b9>4387\n<e594bb>21276\n<e594bc>17367\n<e594bd>21277\n<e594be>2851\n<e59580>4388\n<e59581>17368\n<e59584>2895\n<e59585>4393\n<e59586>2446\n<e59587>17370\n<e59589>21278\n<e5958a>14391\n<e5958c>4390\n<e5958d>21279\n<e5958f>3824\n<e59590>16806\n<e59591>19239\n<e59593>1810\n<e59598>21280\n<e5959c>4392\n<e5959d>4398\n<e5959e>7633\n<e595a0>14392\n<e595a1>20308\n<e595a3>4389\n<e595a4>17372\n<e595a6>19240\n<e595bb>4404\n<e595bc>4409\n<e595bd>17374\n<e595be>4405\n<e595bf>21283\n<e59680>4400\n<e59681>16807\n<e59682>17375\n<e59683>4410\n<e59684>2739\n<e59686>8415\n<e59687>4412\n<e59688>14394\n<e59689>1972\n<e5968a>4402\n<e5968b>3003\n<e5968e>14395\n<e5968f>19241\n<e59691>17376\n<e59692>19242\n<e59693>21284\n<e59694>19243\n<e59697>21285\n<e59698>4406\n<e59699>4399\n<e5969a>1513\n<e5969c>1578\n<e5969d>1475\n<e5969e>4407\n<e5969f>4403\n<e596a3>21286\n<e596a4>19244\n<e596a7>1868\n<e596a8>4413\n<e596a9>4411\n<e596aa>2773\n<e596ab>1636\n<e596ac>1700\n<e596ad>16808\n<e596ae>4408\n<e596b2>19245\n<e596b6>1254\n<e596bf>17381\n<e59781>21287\n<e59783>19246\n<e59784>4417\n<e59785>4415\n<e59786>19247\n<e59787>4472\n<e59789>17382\n<e5978b>21288\n<e5978c>17383\n<e5978e>16809\n<e59791>17384\n<e59792>17378\n<e59793>19248\n<e59794>4420\n<e5979a>4414\n<e5979b>19249\n<e5979c>4418\n<e5979d>17385\n<e5979e>21291\n<e5979f>4416\n<e597a2>17387\n<e597a3>2202\n<e597a4>4419\n<e597a9>17389\n<e597ac>19250\n<e597ae>19251\n<e597b1>19252\n<e597b6>19253\n<e597b7>4422\n<e597b8>19254\n<e597b9>4427\n<e597bd>4425\n<e597be>4424\n<e597bf>21292\n<e59885>19255\n<e59886>2928\n<e59887>17392\n<e59888>14396\n<e59889>1349\n<e5988a>21294\n<e5988d>19256\n<e59890>17393\n<e59894>4421\n<e59896>4423\n<e59897>2448\n<e59898>1237\n<e59899>21295\n<e5989b>4426\n<e598a0>15389\n<e598a8>17390\n<e598a9>1374\n<e598ac>19259\n<e598af>4437\n<e598b0>17394\n<e598b1>2532\n<e598b3>21296\n<e598b4>4431\n<e598b5>19260\n<e598b6>4432\n<e598b7>14399\n<e598b8>4434\n<e598b9>19261\n<e598bb>16810\n<e598bc>21297\n<e598bd>17396\n<e598bf>14400\n<e59980>17397\n<e59981>21298\n<e59986>21301\n<e59987>17398\n<e59989>14401\n<e5998b>14402\n<e5998d>19262\n<e5998e>4428\n<e5998f>14403\n<e59990>4429\n<e59993>7963\n<e59994>19263\n<e5999b>1496\n<e5999e>17399\n<e599a0>17400\n<e599a4>4436\n<e599a6>14404\n<e599a8>1579\n<e599a9>14405\n<e599aa>4439\n<e599ab>4435\n<e599ac>4438\n<e599ad>17401\n<e599af>14406\n<e599b4>3582\n<e599b5>21305\n<e599b6>15411\n<e599b8>3245\n<e599ba>3404\n<e59a80>4441\n<e59a84>21306\n<e59a85>19264\n<e59a86>4440\n<e59a87>1443\n<e59a88>17403\n<e59a8a>4442\n<e59a8b>21307\n<e59a8c>17404\n<e59a8f>4445\n<e59a94>4444\n<e59a95>14409\n<e59a99>7654\n<e59a9a>14410\n<e59a9d>17405\n<e59a9e>16811\n<e59a9f>19265\n<e59aa0>4443\n<e59aa2>3311\n<e59aa5>4446\n<e59aa6>19266\n<e59aa7>21308\n<e59aa8>17406\n<e59aa9>16812\n<e59aab>21309\n<e59aae>4447\n<e59ab1>14413\n<e59ab2>17407\n<e59ab3>16813\n<e59ab4>4449\n<e59ab6>4448\n<e59ab7>19267\n<e59abc>4451\n<e59abe>21310\n<e59b81>4452\n<e59b82>4450\n<e59b83>4453\n<e59b85>17408\n<e59b88>4455\n<e59b89>14414\n<e59b8a>7770\n<e59b8b>21311\n<e59b8c>19268\n<e59b8d>17409\n<e59b8e>4456\n<e59b8f>19269\n<e59b90>21312\n<e59b91>4457\n<e59b93>4458\n<e59b97>4459\n<e59b98>4220\n<e59b99>19270\n<e59b9a>2344\n<e59b9b>2203\n<e59b9c>21313\n<e59b9d>14415\n<e59b9e>1395\n<e59b9f>17410\n<e59ba0>1212\n<e59ba1>19271\n<e59ba3>2946\n<e59ba4>14416\n<e59ba8>17411\n<e59bab>19272\n<e59bad>19273\n<e59bae>4460\n<e59bb0>2068\n<e59bb1>19274\n<e59bb2>1171\n<e59bb3>2596\n<e59bb9>4461\n<e59bba>1915\n<e59bbd>2051\n<e59bbf>4463\n<e59c80>4462\n<e59c83>3632\n<e59c84>4464\n<e59c87>19275\n<e59c88>4466\n<e59c89>4465\n<e59c8a>14417\n<e59c8b>4467\n<e59c8c>19276\n<e59c8d>4468\n<e59c8f>1869\n<e59c91>21319\n<e59c92>1282\n<e59c93>4469\n<e59c95>14418\n<e59c96>4471\n<e59c98>4470\n<e59c9c>4473\n<e59c9d>19279\n<e59c9f>3156\n<e59ca0>21320\n<e59ca1>13952\n<e59ca2>21321\n<e59ca3>14419\n<e59ca6>4474\n<e59ca7>1145\n<e59ca8>2127\n<e59ca9>17416\n<e59caa>21324\n<e59cac>19280\n<e59cad>1811\n<e59cae>19281\n<e59caf>14420\n<e59cb0>2957\n<e59cbb>4478\n<e59cbf>21325\n<e59d80>4479\n<e59d82>2132\n<e59d87>1737\n<e59d8a>3685\n<e59d8c>14423\n<e59d8d>17420\n<e59d8e>4477\n<e59d8f>4480\n<e59d90>2097\n<e59d91>1973\n<e59d92>21326\n<e59d99>8416\n<e59d9f>19284\n<e59da1>4484\n<e59da2>21327\n<e59da4>2069\n<e59da5>8417\n<e59da6>2929\n<e59da7>21328\n<e59da8>17422\n<e59da9>4481\n<e59daa>3062\n<e59dab>19285\n<e59dad>19286\n<e59dae>21329\n<e59daf>17423\n<e59db0>14424\n<e59db1>21330\n<e59db7>16814\n<e59db9>21331\n<e59dba>19287\n<e59dbb>17427\n<e59dbc>16815\n<e59dbe>21332\n<e59dbf>4485\n<e59e81>21333\n<e59e82>2600\n<e59e83>19288\n<e59e88>4483\n<e59e89>4486\n<e59e8b>1813\n<e59e8c>14425\n<e59e93>4487\n<e59e94>21334\n<e59e95>21338\n<e59e97>19289\n<e59e99>21335\n<e59e9a>17430\n<e59e9c>14426\n<e59e9f>21336\n<e59ea0>4488\n<e59ea1>21337\n<e59ea2>1974\n<e59ea3>1438\n<e59ea4>4490\n<e59ea7>21339\n<e59ea8>17433\n<e59ea9>21340\n<e59eaa>4491\n<e59eac>8418\n<e59eae>19290\n<e59eb0>4492\n<e59eb3>4489\n<e59eb8>14427\n<e59ebd>21341\n<e59f80>4482\n<e59f83>4493\n<e59f86>4494\n<e59f87>8420\n<e59f88>8419\n<e59f8b>3730\n<e59f8c>17436\n<e59f8e>2515\n<e59f8f>16817\n<e59f94>4495\n<e59f95>19291\n<e59f96>4499\n<e59f97>17434\n<e59f9c>3310\n<e59f9d>21342\n<e59f9e>17439\n<e59f9f>1196\n<e59fa0>3528\n<e59fa1>21347\n<e59fa3>4500\n<e59fa4>16818\n<e59fa6>14428\n<e59fa7>19292\n<e59fa9>21343\n<e59fad>14429\n<e59fb0>17440\n<e59fb4>2533\n<e59fb7>2277\n<e59fb8>17442\n<e59fb9>3347\n<e59fba>1580\n<e59fbb>17443\n<e59fbc>2139\n<e59fbd>17444\n<e59fbe>21344\n<e59fbf>14432\n<e5a080>3719\n<e5a082>3210\n<e5a083>21345\n<e5a084>17445\n<e5a085>1870\n<e5a086>2863\n<e5a088>21346\n<e5a089>14433\n<e5a08a>4498\n<e5a08b>4501\n<e5a08c>21348\n<e5a08d>19293\n<e5a095>2852\n<e5a099>4502\n<e5a09b>21349\n<e5a09d>4503\n<e5a09e>17446\n<e5a09f>21350\n<e5a0a0>14434\n<e5a0a1>4505\n<e5a0a4>3077\n<e5a0a6>19294\n<e5a0a7>17447\n<e5a0aa>1514\n<e5a0ad>21351\n<e5a0af>7474\n<e5a0b0>1283\n<e5a0b1>3651\n<e5a0b2>14435\n<e5a0b4>2516\n<e5a0b9>17448\n<e5a0ba>2134\n<e5a0bd>4511\n<e5a0bf>21352\n<e5a180>3597\n<e5a181>4005\n<e5a189>17450\n<e5a18a>1396\n<e5a18b>4507\n<e5a18c>17451\n<e5a18d>19295\n<e5a18f>19296\n<e5a190>21353\n<e5a191>2748\n<e5a192>4510\n<e5a194>3165\n<e5a195>21354\n<e5a197>3139\n<e5a198>3166\n<e5a199>3405\n<e5a19a>3049\n<e5a19e>2105\n<e5a19f>19297\n<e5a1a1>7751\n<e5a1a2>4506\n<e5a1a4>16819\n<e5a1a7>17452\n<e5a1a8>21355\n<e5a1a9>1304\n<e5a1ab>3120\n<e5a1ad>19298\n<e5a1b0>4508\n<e5a1b2>4504\n<e5a1b5>2582\n<e5a1b8>21356\n<e5a1b9>4512\n<e5a1bc>14436\n<e5a1be>2392\n<e5a1bf>19299\n<e5a280>14437\n<e5a281>19300\n<e5a283>1701\n<e5a285>4513\n<e5a289>16820\n<e5a28c>21359\n<e5a28d>17455\n<e5a293>3640\n<e5a294>17458\n<e5a296>21360\n<e5a297>2815\n<e5a298>19301\n<e5a29c>3042\n<e5a29d>17459\n<e5a29e>8423\n<e5a29f>4515\n<e5a2a6>21364\n<e5a2a8>3709\n<e5a2a9>14438\n<e5a2aa>17460\n<e5a2ab>4516\n<e5a2ae>4521\n<e5a2b1>17461\n<e5a2b2>8424\n<e5a2b3>3583\n<e5a2b8>4520\n<e5a2b9>4514\n<e5a2ba>4517\n<e5a2bb>4519\n<e5a2bc>19302\n<e5a2be>2070\n<e5a381>3609\n<e5a382>21366\n<e5a383>17463\n<e5a384>21365\n<e5a385>4522\n<e5a387>2947\n<e5a388>21367\n<e5a38a>1397\n<e5a38c>2517\n<e5a38d>17464\n<e5a38e>14439\n<e5a390>14440\n<e5a391>4524\n<e5a392>16822\n<e5a393>4523\n<e5a394>14441\n<e5a395>2042\n<e5a396>21368\n<e5a397>4525\n<e5a398>4527\n<e5a399>4526\n<e5a39a>14442\n<e5a39c>4529\n<e5a39d>21369\n<e5a39e>4518\n<e5a39f>4531\n<e5a3a0>16823\n<e5a3a1>21370\n<e5a3a2>17465\n<e5a3a4>4530\n<e5a3a5>4528\n<e5a3a9>14443\n<e5a3ab>2204\n<e5a3ac>2583\n<e5a3ae>2774\n<e5a3af>4532\n<e5a3b0>2656\n<e5a3b1>1201\n<e5a3b2>3354\n<e5a3b7>3063\n<e5a3b9>4534\n<e5a3ba>4533\n<e5a482>4538\n<e5a485>17468\n<e5a489>3617\n<e5a48a>4539\n<e5a48b>8425\n<e5a48c>14444\n<e5a48d>17470\n<e5a48f>1350\n<e5a490>4540\n<e5a494>17471\n<e5a495>3878\n<e5a496>1422\n<e5a498>4318\n<e5a499>2386\n<e5a49a>2847\n<e5a49b>4541\n<e5a49c>3831\n<e5a49d>21374\n<e5a49f>19303\n<e5a4a1>21375\n<e5a4a2>3776\n<e5a4a3>19304\n<e5a4a4>14445\n<e5a4a5>4543\n<e5a4a7>2887\n<e5a4a8>21376\n<e5a4a9>3121\n<e5a4aa>2848\n<e5a4ab>3529\n<e5a4ae>1309\n<e5a4af>14446\n<e5a4b0>21377\n<e5a4b1>2278\n<e5a4b2>4546\n<e5a4b3>21378\n<e5a4b7>1172\n<e5a4b8>4547\n<e5a4b9>14117\n<e5a4bd>17474\n<e5a4be>4548\n<e5a4bf>21381\n<e5a583>21382\n<e5a584>1284\n<e5a586>17476\n<e5a587>1581\n<e5a588>3256\n<e5a589>3652\n<e5a58e>4552\n<e5a58f>2775\n<e5a590>4551\n<e5a591>1814\n<e5a592>21383\n<e5a593>8426\n<e5a594>3721\n<e5a595>4550\n<e5a597>3167\n<e5a598>4554\n<e5a599>19305\n<e5a59a>4553\n<e5a59b>8427\n<e5a59d>8428\n<e5a59e>21384\n<e5a59f>17479\n<e5a5a0>4556\n<e5a5a1>14447\n<e5a5a2>4555\n<e5a5a3>8429\n<e5a5a5>1310\n<e5a5a7>4557\n<e5a5a8>2449\n<e5a5a9>4559\n<e5a5aa>2915\n<e5a5ab>21385\n<e5a5ac>4558\n<e5a5ad>14448\n<e5a5ae>3587\n<e5a5af>21386\n<e5a5b2>21387\n<e5a5b3>2433\n<e5a5b4>3157\n<e5a5b8>4560\n<e5a5b9>19306\n<e5a5bb>21388\n<e5a5bc>17483\n<e5a5bd>1975\n<e5a681>4561\n<e5a682>3287\n<e5a683>3442\n<e5a684>3805\n<e5a68a>3291\n<e5a68b>16825\n<e5a68c>21389\n<e5a68d>4570\n<e5a68e>21390\n<e5a692>16826\n<e5a693>1618\n<e5a695>21391\n<e5a696>3887\n<e5a697>19307\n<e5a699>3771\n<e5a69b>4665\n<e5a69d>4562\n<e5a69f>17484\n<e5a6a3>4565\n<e5a6a4>8430\n<e5a6a5>2853\n<e5a6a7>21392\n<e5a6a8>3686\n<e5a6ac>3140\n<e5a6ad>21393\n<e5a6ae>17485\n<e5a6af>19308\n<e5a6b0>21394\n<e5a6b2>4566\n<e5a6b3>19309\n<e5a6b7>21395\n<e5a6b9>3731\n<e5a6ba>8431\n<e5a6bb>2106\n<e5a6bc>17486\n<e5a6be>2450\n<e5a781>21396\n<e5a783>16827\n<e5a784>21397\n<e5a786>4567\n<e5a788>17487\n<e5a789>2206\n<e5a78a>14449\n<e5a78b>2205\n<e5a78d>17488\n<e5a790>1149\n<e5a791>1916\n<e5a792>14450\n<e5a793>2639\n<e5a794>1173\n<e5a79c>4569\n<e5a79d>14451\n<e5a79e>17489\n<e5a79f>19310\n<e5a7a5>1242\n<e5a7a6>1515\n<e5a7a7>17490\n<e5a7a8>4568\n<e5a7aa>3793\n<e5a7ab>3491\n<e5a7ac>13997\n<e5a7ae>17491\n<e5a7af>21398\n<e5a7b1>19311\n<e5a7b2>21399\n<e5a7b4>21400\n<e5a7b6>1132\n<e5a7b7>21401\n<e5a7b8>19312\n<e5a7bb>1213\n<e5a7bf>2207\n<e5a880>21402\n<e5a881>1174\n<e5a883>1127\n<e5a884>14454\n<e5a889>4577\n<e5a88c>14455\n<e5a88d>17495\n<e5a88e>21403\n<e5a891>4575\n<e5a892>21404\n<e5a893>16828\n<e5a897>17496\n<e5a898>3784\n<e5a89a>4578\n<e5a89b>13761\n<e5a89c>4576\n<e5a89e>21405\n<e5a89f>4574\n<e5a8a0>2551\n<e5a8a3>14456\n<e5a8a4>21406\n<e5a8a5>4573\n<e5a8a7>17497\n<e5a8a8>21407\n<e5a8aa>21408\n<e5a8ad>17498\n<e5a8af>1944\n<e5a8b0>21409\n<e5a8bc>2451\n<e5a980>4579\n<e5a981>4050\n<e5a986>3330\n<e5a987>14457\n<e5a988>21412\n<e5a989>4581\n<e5a98c>21413\n<e5a990>21414\n<e5a995>14458\n<e5a99a>2071\n<e5a99e>21415\n<e5a9a2>4584\n<e5a9a3>14459\n<e5a9a5>17499\n<e5a9a6>3530\n<e5a9a7>16829\n<e5a9aa>4585\n<e5a9ac>4580\n<e5a9ad>14460\n<e5a9b7>16830\n<e5a9ba>17500\n<e5a9bb>21416\n<e5a9be>14461\n<e5a9bf>3783\n<e5aa84>16831\n<e5aa8b>17501\n<e5aa90>21417\n<e5aa92>3348\n<e5aa93>21418\n<e5aa96>21419\n<e5aa99>21420\n<e5aa9a>4586\n<e5aa9b>3492\n<e5aa9c>17502\n<e5aa9e>14462\n<e5aaa2>17505\n<e5aaa7>14463\n<e5aaac>14464\n<e5aab1>17506\n<e5aab2>19313\n<e5aab3>14465\n<e5aab5>17507\n<e5aab8>19314\n<e5aaba>17508\n<e5aabb>21421\n<e5aabc>4587\n<e5aabd>4591\n<e5aabe>4588\n<e5aabf>17509\n<e5ab81>1351\n<e5ab82>4590\n<e5ab84>16832\n<e5ab86>21422\n<e5ab88>21423\n<e5ab89>2279\n<e5ab8b>4589\n<e5ab8c>1871\n<e5ab8f>21424\n<e5ab90>4603\n<e5ab96>4596\n<e5ab97>4593\n<e5ab9a>17510\n<e5ab9c>17511\n<e5aba0>14466\n<e5aba1>2978\n<e5aba3>4592\n<e5aba5>17512\n<e5aba6>4594\n<e5aba9>4595\n<e5abaa>19315\n<e5abae>17514\n<e5abb0>17513\n<e5abb5>17515\n<e5abb6>19316\n<e5abbd>21425\n<e5ac80>14467\n<e5ac81>21426\n<e5ac88>17516\n<e5ac89>1582\n<e5ac8b>4600\n<e5ac8c>4599\n<e5ac96>4601\n<e5ac97>17517\n<e5ac99>14468\n<e5ac9b>19317\n<e5ac9d>19318\n<e5aca1>19319\n<e5aca2>2518\n<e5aca5>14469\n<e5acaa>4604\n<e5acac>3064\n<e5acad>14470\n<e5acb0>1255\n<e5acb2>4602\n<e5acb4>17518\n<e5acb6>4605\n<e5acb8>19320\n<e5acbe>4606\n<e5ad80>4609\n<e5ad81>14471\n<e5ad83>4607\n<e5ad85>4608\n<e5ad8b>21427\n<e5ad8c>17519\n<e5ad90>2208\n<e5ad91>4610\n<e5ad92>17520\n<e5ad94>1976\n<e5ad95>4611\n<e5ad96>8432\n<e5ad97>2248\n<e5ad98>2840\n<e5ad9c>2216\n<e5ad9d>1977\n<e5ad9e>21428\n<e5ad9f>3806\n<e5ada3>1602\n<e5ada4>1917\n<e5ada5>4614\n<e5ada6>1462\n<e5ada8>17521\n<e5ada9>4615\n<e5adab>2841\n<e5adae>21429\n<e5adaf>17522\n<e5adb0>4616\n<e5adb1>4656\n<e5adb3>4617\n<e5adb5>4618\n<e5adb6>14120\n<e5adb8>4619\n<e5adba>4621\n<e5adbc>14472\n<e5adbd>16834\n<e5ae80>4622\n<e5ae81>17523\n<e5ae82>13840\n<e5ae83>4623\n<e5ae84>17524\n<e5ae85>2896\n<e5ae86>21430\n<e5ae87>1225\n<e5ae88>2325\n<e5ae89>1158\n<e5ae8a>14475\n<e5ae8b>2777\n<e5ae8c>1516\n<e5ae8d>2273\n<e5ae8e>21431\n<e5ae8f>1978\n<e5ae93>16835\n<e5ae94>21434\n<e5ae95>3168\n<e5ae96>17526\n<e5ae97>2347\n<e5ae98>1517\n<e5ae99>2982\n<e5ae9a>3078\n<e5ae9b>1148\n<e5ae9c>1619\n<e5ae9d>3653\n<e5ae9f>2286\n<e5aea2>1644\n<e5aea3>2703\n<e5aea4>2280\n<e5aea5>3858\n<e5aea6>4624\n<e5aeac>17527\n<e5aead>21437\n<e5aeae>1654\n<e5aeaf>21438\n<e5aeb0>2107\n<e5aeb3>1424\n<e5aeb4>1285\n<e5aeb5>2452\n<e5aeb6>1352\n<e5aeb7>19321\n<e5aeb8>4625\n<e5aeb9>3888\n<e5aeba>21441\n<e5aebc>21442\n<e5aebf>2387\n<e5af80>8433\n<e5af81>21443\n<e5af82>2320\n<e5af83>4626\n<e5af84>1583\n<e5af85>3242\n<e5af86>3765\n<e5af87>4627\n<e5af89>4628\n<e5af8c>3531\n<e5af8d>21444\n<e5af8e>17530\n<e5af8f>21445\n<e5af90>4630\n<e5af92>1508\n<e5af93>1775\n<e5af94>4629\n<e5af96>17531\n<e5af97>19322\n<e5af98>8435\n<e5af9b>1518\n<e5af9d>2552\n<e5af9e>4634\n<e5af9f>2159\n<e5afa0>19323\n<e5afa1>1353\n<e5afa2>4633\n<e5afa4>4631\n<e5afa5>4635\n<e5afa6>4632\n<e5afa7>3297\n<e5afa8>5262\n<e5afa9>2553\n<e5afab>4636\n<e5afac>20302\n<e5afae>3976\n<e5afaf>21448\n<e5afb0>4637\n<e5afb1>17534\n<e5afb3>4639\n<e5afb4>21449\n<e5afb5>3004\n<e5afb6>4638\n<e5afb8>2631\n<e5afba>2249\n<e5afbd>17535\n<e5afbe>2864\n<e5afbf>2339\n<e5b081>3559\n<e5b082>2704\n<e5b083>17537\n<e5b084>2297\n<e5b085>4640\n<e5b086>2453\n<e5b089>1175\n<e5b08a>2842\n<e5b08b>2584\n<e5b08c>21450\n<e5b08d>4643\n<e5b08e>3211\n<e5b08f>2454\n<e5b091>2455\n<e5b092>16836\n<e5b093>4644\n<e5b094>14122\n<e5b096>2705\n<e5b097>21451\n<e5b099>13835\n<e5b09a>2456\n<e5b09e>8437\n<e5b09f>19324\n<e5b0a0>4645\n<e5b0a2>4646\n<e5b0a3>14476\n<e5b0a4>3820\n<e5b0a6>21452\n<e5b0a8>4647\n<e5b0a9>17538\n<e5b0aa>19325\n<e5b0ab>14477\n<e5b0ac>19326\n<e5b0ad>1726\n<e5b0ae>21453\n<e5b0b0>14478\n<e5b0b1>2348\n<e5b0b2>21454\n<e5b0b5>21455\n<e5b0b6>19327\n<e5b0ba>2312\n<e5b0bb>2546\n<e5b0bc>3276\n<e5b0bd>2586\n<e5b0be>3468\n<e5b0bf>3288\n<e5b180>1729\n<e5b181>4650\n<e5b185>1673\n<e5b186>4651\n<e5b188>1782\n<e5b18a>3239\n<e5b18b>1328\n<e5b18d>2209\n<e5b18e>4652\n<e5b18f>4655\n<e5b190>4654\n<e5b193>4653\n<e5b195>3122\n<e5b199>19328\n<e5b19a>21456\n<e5b19b>7826\n<e5b19c>19329\n<e5b19e>2832\n<e5b19f>17540\n<e5b1a1>2292\n<e5b1a2>7693\n<e5b1a3>14479\n<e5b1a4>2778\n<e5b1a5>3940\n<e5b1a9>14480\n<e5b1ac>4657\n<e5b1ad>19330\n<e5b1ae>4658\n<e5b1af>3246\n<e5b1b0>17543\n<e5b1b1>2177\n<e5b1b6>4660\n<e5b1b9>4661\n<e5b1ba>16839\n<e5b1bb>21459\n<e5b1bc>14481\n<e5b1bd>21460\n<e5b287>21461\n<e5b288>17548\n<e5b28a>17549\n<e5b28c>4662\n<e5b28f>16840\n<e5b290>1584\n<e5b291>4663\n<e5b292>21462\n<e5b294>4664\n<e5b29d>21463\n<e5b29f>16841\n<e5b2a0>17553\n<e5b2a1>1324\n<e5b2a2>17554\n<e5b2a3>16842\n<e5b2a6>8438\n<e5b2a7>17555\n<e5b2a8>2749\n<e5b2a9>1568\n<e5b2aa>16843\n<e5b2ab>4666\n<e5b2ac>3764\n<e5b2ad>17557\n<e5b2b1>2866\n<e5b2b2>21464\n<e5b2b3>1463\n<e5b2b4>21465\n<e5b2b5>17558\n<e5b2b6>4668\n<e5b2b7>4670\n<e5b2b8>1563\n<e5b2ba>8439\n<e5b2bb>4667\n<e5b2bc>4669\n<e5b2be>4672\n<e5b385>4671\n<e5b387>4673\n<e5b389>17560\n<e5b38b>14482\n<e5b390>16844\n<e5b392>14483\n<e5b397>21466\n<e5b399>4674\n<e5b39d>19331\n<e5b3a0>3221\n<e5b3a1>1702\n<e5b3a6>14124\n<e5b3a8>1381\n<e5b3a9>4675\n<e5b3aa>4680\n<e5b3ad>4678\n<e5b3ae>21467\n<e5b3af>3655\n<e5b3b0>3654\n<e5b3b4>14484\n<e5b3b5>8440\n<e5b3b6>3169\n<e5b3ba>4677\n<e5b3bb>2398\n<e5b3bd>4676\n<e5b481>19332\n<e5b486>17563\n<e5b487>2616\n<e5b48b>4681\n<e5b48d>16846\n<e5b48e>2138\n<e5b490>17564\n<e5b491>4687\n<e5b492>21470\n<e5b494>4688\n<e5b495>4682\n<e5b496>1425\n<e5b497>4683\n<e5b498>4692\n<e5b499>4691\n<e5b49a>4690\n<e5b49b>4686\n<e5b49d>17566\n<e5b49f>4685\n<e5b4a0>17567\n<e5b4a2>4689\n<e5b4a3>21471\n<e5b4a4>14485\n<e5b4a6>14486\n<e5b4a7>8441\n<e5b4a9>3656\n<e5b4ab>17565\n<e5b4b1>17568\n<e5b4b4>19333\n<e5b4b9>17569\n<e5b4bd>19334\n<e5b4bf>21472\n<e5b582>8444\n<e5b583>14487\n<e5b586>14488\n<e5b587>16847\n<e5b588>21473\n<e5b58a>14489\n<e5b58b>4696\n<e5b58c>4693\n<e5b58e>4695\n<e5b590>3932\n<e5b591>21475\n<e5b592>4694\n<e5b593>8442\n<e5b595>21474\n<e5b599>19335\n<e5b59c>4684\n<e5b5a1>17571\n<e5b5a2>21478\n<e5b5a4>21479\n<e5b5a9>2617\n<e5b5aa>17572\n<e5b5ac>4697\n<e5b5ad>8445\n<e5b5af>2087\n<e5b5b0>17574\n<e5b5b3>4698\n<e5b5b6>4699\n<e5b5be>19336\n<e5b5bf>21482\n<e5b681>16848\n<e5b682>4702\n<e5b683>19337\n<e5b684>4701\n<e5b687>4700\n<e5b688>17577\n<e5b68a>21483\n<e5b68b>3170\n<e5b68c>4679\n<e5b690>4708\n<e5b692>14490\n<e5b693>21484\n<e5b694>14491\n<e5b695>21485\n<e5b697>17579\n<e5b699>14492\n<e5b69b>21486\n<e5b69d>4704\n<e5b69f>21487\n<e5b6a0>14493\n<e5b6a2>4703\n<e5b6a4>16849\n<e5b6a7>16850\n<e5b6ab>21488\n<e5b6ac>4705\n<e5b6ae>4706\n<e5b6b0>17580\n<e5b6b2>15405\n<e5b6b4>17581\n<e5b6b7>4709\n<e5b6ba>4014\n<e5b6bc>4710\n<e5b6bd>4707\n<e5b783>21489\n<e5b787>19338\n<e5b789>4711\n<e5b78b>16851\n<e5b78c>1564\n<e5b78d>4712\n<e5b78e>21490\n<e5b790>8448\n<e5b791>17583\n<e5b792>4714\n<e5b793>4713\n<e5b796>4715\n<e5b797>17584\n<e5b798>14494\n<e5b799>21491\n<e5b79b>4716\n<e5b79d>2706\n<e5b79e>2349\n<e5b7a0>14495\n<e5b7a1>2414\n<e5b7a2>13362\n<e5b7a3>2789\n<e5b7a4>17586\n<e5b7a5>1979\n<e5b7a6>2088\n<e5b7a7>1980\n<e5b7a8>1674\n<e5b7a9>17587\n<e5b7ab>4717\n<e5b7ae>2089\n<e5b7b1>1918\n<e5b7b2>4718\n<e5b7b3>3762\n<e5b7b4>3321\n<e5b7b5>4719\n<e5b7b8>14496\n<e5b7b9>19339\n<e5b7bb>1512\n<e5b7bd>2917\n<e5b7be>1738\n<e5b7bf>13794\n<e5b880>14497\n<e5b882>2210\n<e5b883>3533\n<e5b886>3413\n<e5b887>21492\n<e5b88b>4720\n<e5b88c>1585\n<e5b88d>21493\n<e5b891>4723\n<e5b892>14498\n<e5b896>3005\n<e5b898>14501\n<e5b899>4722\n<e5b89a>4721\n<e5b89b>4724\n<e5b89d>3079\n<e5b89f>17591\n<e5b8a0>21494\n<e5b8a5>2601\n<e5b8a8>19340\n<e5b8ab>2211\n<e5b8ad>2670\n<e5b8ae>14502\n<e5b8af>2867\n<e5b8b0>1596\n<e5b8b2>19341\n<e5b8b3>3006\n<e5b8b5>19342\n<e5b8b8>2519\n<e5b8bd>3687\n<e5b8be>17592\n<e5b980>4729\n<e5b983>4728\n<e5b984>4727\n<e5b985>3567\n<e5b987>4736\n<e5b989>17593\n<e5b98b>21495\n<e5b98c>3720\n<e5b98e>4730\n<e5b994>4732\n<e5b995>3737\n<e5b996>17595\n<e5b997>4731\n<e5b998>14503\n<e5b99b>19343\n<e5b99c>21498\n<e5b99e>16852\n<e5b99f>4733\n<e5b9a1>3388\n<e5b9a2>4734\n<e5b9a3>3598\n<e5b9a4>4735\n<e5b9a8>19344\n<e5b9aa>19345\n<e5b9b0>21499\n<e5b9b2>1519\n<e5b9b3>3599\n<e5b9b4>3301\n<e5b9b7>19346\n<e5b9b8>1982\n<e5b9b9>1520\n<e5b9ba>4739\n<e5b9bb>1900\n<e5b9bc>3886\n<e5b9bd>3859\n<e5b9be>1586\n<e5b9bf>4741\n<e5ba80>19347\n<e5ba81>3007\n<e5ba83>1983\n<e5ba84>2457\n<e5ba87>3443\n<e5ba8a>2458\n<e5ba8b>19348\n<e5ba8e>21500\n<e5ba8f>2434\n<e5ba95>3080\n<e5ba97>3123\n<e5ba99>14000\n<e5ba9a>1984\n<e5ba9c>3534\n<e5baa0>4742\n<e5baa2>21501\n<e5baa4>21502\n<e5baa5>17600\n<e5baa6>3155\n<e5baa7>2098\n<e5baa8>14506\n<e5baaa>14507\n<e5baab>1919\n<e5baac>17601\n<e5baad>3081\n<e5bab1>21503\n<e5bab3>19349\n<e5bab5>1159\n<e5bab6>2424\n<e5bab7>1985\n<e5bab8>3889\n<e5bab9>17602\n<e5babd>19350\n<e5bb83>3335\n<e5bb86>17603\n<e5bb88>4745\n<e5bb89>4031\n<e5bb8a>4051\n<e5bb8b>15390\n<e5bb8c>21504\n<e5bb8e>21505\n<e5bb8f>4747\n<e5bb90>4746\n<e5bb91>19351\n<e5bb92>14511\n<e5bb93>1445\n<e5bb96>4748\n<e5bb99>17604\n<e5bb9c>21506\n<e5bb9d>4750\n<e5bb9e>21507\n<e5bba0>2459\n<e5bba1>4754\n<e5bba2>4753\n<e5bba3>4749\n<e5bba5>21508\n<e5bbab>21509\n<e5bbac>4757\n<e5bbb0>4760\n<e5bbb1>4758\n<e5bbb3>4759\n<e5bbb4>4761\n<e5bbb6>1286\n<e5bbb7>3082\n<e5bbb8>4762\n<e5bbb9>16853\n<e5bbba>1872\n<e5bbbc>3308\n<e5bbbd>17606\n<e5bbbe>4763\n<e5bbbf>3283\n<e5bc80>16854\n<e5bc81>3627\n<e5bc82>16855\n<e5bc83>4764\n<e5bc84>4052\n<e5bc86>21510\n<e5bc87>14512\n<e5bc88>17607\n<e5bc89>4765\n<e5bc8a>3600\n<e5bc8b>4768\n<e5bc8c>4090\n<e5bc8d>4106\n<e5bc8e>14513\n<e5bc8f>2268\n<e5bc90>3277\n<e5bc91>4769\n<e5bc93>1655\n<e5bc94>3008\n<e5bc95>1214\n<e5bc96>4770\n<e5bc97>3574\n<e5bc98>1986\n<e5bc99>21511\n<e5bc9b>2958\n<e5bc9e>17609\n<e5bc9f>3083\n<e5bca1>8449\n<e5bca2>14516\n<e5bca3>16856\n<e5bca4>21512\n<e5bca5>3835\n<e5bca6>1901\n<e5bca7>1920\n<e5bca8>14517\n<e5bca9>4771\n<e5bcad>4772\n<e5bcae>21515\n<e5bcaf>4778\n<e5bcb0>21516\n<e5bcb1>2321\n<e5bcb4>8450\n<e5bcb5>3009\n<e5bcb6>14518\n<e5bcb7>1703\n<e5bcb8>4773\n<e5bcba>13720\n<e5bcbb>14519\n<e5bcbc>3485\n<e5bcbd>16857\n<e5bcbe>2948\n<e5bcbf>21517\n<e5bd80>14520\n<e5bd81>4774\n<e5bd84>21518\n<e5bd85>8370\n<e5bd87>17610\n<e5bd88>4775\n<e5bd8a>1704\n<e5bd8c>4776\n<e5bd8d>19354\n<e5bd8e>4777\n<e5bd90>14521\n<e5bd91>4779\n<e5bd93>3184\n<e5bd94>16858\n<e5bd98>14522\n<e5bd99>4782\n<e5bd9b>21519\n<e5bd9c>4767\n<e5bd9d>4766\n<e5bda0>21520\n<e5bda1>4783\n<e5bda2>1815\n<e5bda3>17611\n<e5bda4>14523\n<e5bda5>13996\n<e5bda6>3481\n<e5bda7>8451\n<e5bda9>2108\n<e5bdaa>3497\n<e5bdab>3010\n<e5bdac>3517\n<e5bdad>4784\n<e5bdaf>21521\n<e5bdb0>2460\n<e5bdb1>1256\n<e5bdb2>17612\n<e5bdb3>4785\n<e5bdb7>4786\n<e5bdb8>21524\n<e5bdb9>3838\n<e5bdba>21525\n<e5bdbc>3444\n<e5bdbd>16859\n<e5bdbe>17613\n<e5bdbf>4789\n<e5be80>1311\n<e5be81>2640\n<e5be82>4788\n<e5be83>4787\n<e5be84>1816\n<e5be85>2868\n<e5be87>4793\n<e5be88>4791\n<e5be89>14524\n<e5be8a>4790\n<e5be8b>3951\n<e5be8c>1945\n<e5be8d>21526\n<e5be8f>17614\n<e5be90>2435\n<e5be91>4792\n<e5be92>3142\n<e5be93>2376\n<e5be96>21527\n<e5be97>3224\n<e5be99>4795\n<e5be9c>14525\n<e5be9d>21528\n<e5be9e>4794\n<e5bea0>4797\n<e5bea1>1946\n<e5bea2>17615\n<e5bea4>14527\n<e5bea7>14526\n<e5bea8>4798\n<e5bea9>3566\n<e5beaa>2405\n<e5beab>21529\n<e5beac>19355\n<e5bead>4799\n<e5beae>3469\n<e5beaf>14528\n<e5beb3>3225\n<e5beb4>3011\n<e5beb5>13368\n<e5beb7>8452\n<e5beb8>14529\n<e5beb9>3114\n<e5bebc>4800\n<e5bf83>2554\n<e5bf84>14530\n<e5bf85>3486\n<e5bf87>17616\n<e5bf88>21532\n<e5bf89>14531\n<e5bf8b>17617\n<e5bf8c>1587\n<e5bf8d>3292\n<e5bf96>4801\n<e5bf97>2212\n<e5bf9c>1312\n<e5bf9d>4806\n<e5bf9e>8453\n<e5bfa0>2983\n<e5bfa1>14532\n<e5bfa2>17621\n<e5bfa4>4803\n<e5bfa8>21535\n<e5bfa9>14533\n<e5bfaa>19356\n<e5bfab>1399\n<e5bfac>21536\n<e5bfad>14534\n<e5bfb0>4854\n<e5bfb1>4805\n<e5bfb2>21537\n<e5bfb3>17624\n<e5bfb5>3302\n<e5bfb6>21538\n<e5bfb8>4804\n<e5bfba>21539\n<e5bfbb>4802\n<e5bfbc>14535\n<e5bfbd>2060\n<e5bfbf>4808\n<e68087>19357\n<e6808a>21540\n<e6808d>16860\n<e6808e>4814\n<e6808f>4820\n<e68090>4812\n<e68092>3158\n<e68093>21541\n<e68094>16861\n<e68095>4817\n<e68096>3535\n<e68097>14536\n<e68098>16862\n<e68099>4811\n<e6809a>14537\n<e6809b>4816\n<e6809c>4015\n<e6809d>2213\n<e6809f>21542\n<e680a0>2869\n<e680a1>4809\n<e680a2>17626\n<e680a4>17627\n<e680a5>1656\n<e680a6>4819\n<e680a7>2641\n<e680a8>1287\n<e680a9>4813\n<e680aa>1400\n<e680ab>4818\n<e680ad>21543\n<e680af>1705\n<e680b1>4815\n<e680b3>14538\n<e680b5>16863\n<e680ba>4821\n<e68180>21544\n<e68181>4823\n<e68182>4833\n<e68183>4831\n<e68186>4828\n<e68187>16864\n<e68188>21545\n<e68189>19358\n<e6818a>4827\n<e6818b>4032\n<e6818c>17629\n<e6818d>4829\n<e68190>1706\n<e68191>21546\n<e68192>1987\n<e68194>19359\n<e68195>2436\n<e68199>4836\n<e6819a>4822\n<e6819d>8454\n<e6819f>4826\n<e681a0>4810\n<e681a1>14539\n<e681a3>4830\n<e681a4>4832\n<e681a5>2959\n<e681a7>19360\n<e681a8>2072\n<e681a9>1336\n<e681aa>4824\n<e681ab>4835\n<e681ac>4834\n<e681ad>1707\n<e681af>2825\n<e681b0>1476\n<e681b1>21549\n<e681b5>1817\n<e681b7>4825\n<e681be>21550\n<e681bf>14540\n<e68281>4837\n<e68282>21551\n<e68283>4840\n<e68284>4842\n<e68285>8455\n<e68286>21552\n<e68288>21553\n<e68289>2281\n<e6828a>8456\n<e6828b>4848\n<e6828c>3084\n<e6828d>4838\n<e6828e>21554\n<e68291>21555\n<e68292>4846\n<e68293>21556\n<e68294>1401\n<e68295>17630\n<e68298>21557\n<e6829a>4841\n<e6829b>4843\n<e6829d>16865\n<e6829f>1947\n<e682a0>3860\n<e682a2>21559\n<e682a3>1521\n<e682a4>14542\n<e682a5>21560\n<e682a6>1275\n<e682a7>4847\n<e682a8>17631\n<e682a9>3312\n<e682aa>1137\n<e682b0>14543\n<e682b1>17633\n<e682b2>3445\n<e682b3>4807\n<e682b4>4853\n<e682b5>4857\n<e682b6>3825\n<e682b7>21561\n<e682b8>4850\n<e682bb>19361\n<e682bc>3171\n<e682bd>4855\n<e682be>17634\n<e68382>21562\n<e68384>19362\n<e68385>2520\n<e68386>4856\n<e68387>3247\n<e68388>17635\n<e6838b>14544\n<e68391>4077\n<e68393>4852\n<e68394>16866\n<e68395>8458\n<e68398>4858\n<e68399>17636\n<e6839a>2061\n<e6839b>14545\n<e6839c>2671\n<e6839d>16867\n<e6839e>8457\n<e6839f>1176\n<e683a0>4851\n<e683a1>4849\n<e683a2>21567\n<e683a3>2780\n<e683a5>21568\n<e683a7>4839\n<e683a8>2178\n<e683ae>17637\n<e683b0>2854\n<e683b1>4870\n<e683b2>8460\n<e683b3>2781\n<e683b4>4865\n<e683b5>17638\n<e683b8>14546\n<e683b9>2322\n<e683ba>4866\n<e683bb>4869\n<e683bc>21569\n<e683bd>19363\n<e68480>4864\n<e68481>2351\n<e68482>21570\n<e68483>4867\n<e68486>4861\n<e68487>21571\n<e68489>3847\n<e6848a>19364\n<e6848c>21572\n<e6848f>1177\n<e68490>17639\n<e68491>8461\n<e68495>4860\n<e68496>19365\n<e68497>21573\n<e68499>17640\n<e6849a>1770\n<e6849b>1130\n<e6849c>14550\n<e6849e>17641\n<e6849f>1522\n<e684a0>8459\n<e684a1>4868\n<e684a2>21574\n<e684a7>4876\n<e684a8>4875\n<e684aa>19366\n<e684ab>16868\n<e684ac>4880\n<e684b0>8463\n<e684b1>21575\n<e684b4>4881\n<e684b5>21576\n<e684b6>19367\n<e684b7>8462\n<e684b9>21577\n<e684ba>17642\n<e684bc>4879\n<e684bd>4882\n<e684be>4874\n<e684bf>4878\n<e68581>17644\n<e68582>4883\n<e68584>4884\n<e68585>21578\n<e68586>17645\n<e68587>4873\n<e68588>2250\n<e68589>21579\n<e6858a>4877\n<e6858b>2870\n<e6858c>1988\n<e6858d>4859\n<e6858e>2555\n<e68593>4897\n<e68595>3641\n<e6859d>4896\n<e6859e>19368\n<e6859f>4895\n<e685a0>17646\n<e685a2>3755\n<e685a3>1523\n<e685a4>19369\n<e685a5>4893\n<e685a7>1819\n<e685a8>1426\n<e685ab>4890\n<e685ac>21580\n<e685ae>3968\n<e685af>4892\n<e685b0>1178\n<e685b1>4894\n<e685b2>21581\n<e685b3>4885\n<e685b4>4891\n<e685b5>4898\n<e685b6>1818\n<e685b7>4886\n<e685b8>21582\n<e685bb>19370\n<e685bc>14551\n<e685bd>19371\n<e685be>3911\n<e685bf>19372\n<e68682>3861\n<e68687>4901\n<e6868a>4905\n<e6868b>21587\n<e6868d>14552\n<e6868e>2816\n<e68690>4033\n<e68691>4906\n<e68694>4903\n<e68696>4900\n<e68697>17650\n<e68698>8464\n<e68699>4899\n<e6869a>4904\n<e6869c>21588\n<e6869d>19373\n<e6869f>14553\n<e686a0>21589\n<e686a4>3584\n<e686a5>17651\n<e686a7>3212\n<e686a8>14554\n<e686a9>1820\n<e686aa>21590\n<e686ab>4907\n<e686ac>4902\n<e686ad>17652\n<e686ae>4908\n<e686b2>1873\n<e686b6>1329\n<e686b8>19374\n<e686b9>16870\n<e686ba>4916\n<e686bc>16869\n<e686be>1524\n<e68782>14555\n<e68783>4914\n<e68786>4915\n<e68787>2073\n<e68788>4913\n<e68789>4911\n<e6878a>4910\n<e6878b>4917\n<e6878c>4909\n<e6878d>4919\n<e68790>1403\n<e68795>17654\n<e6879c>19375\n<e6879d>17655\n<e6879e>21595\n<e6879f>14556\n<e687a1>21596\n<e687a2>19376\n<e687a3>4921\n<e687a5>19377\n<e687a6>4920\n<e687a7>21597\n<e687a8>19378\n<e687a9>21598\n<e687af>21601\n<e687b2>3012\n<e687b4>4924\n<e687b5>17656\n<e687b6>4922\n<e687b7>4912\n<e687b8>1874\n<e687ba>4923\n<e687bc>4927\n<e687bd>4926\n<e687be>4928\n<e687bf>4925\n<e68880>4929\n<e68881>21602\n<e68883>21603\n<e68884>19379\n<e68887>19380\n<e6888a>3642\n<e6888c>4933\n<e6888d>4932\n<e6888e>2377\n<e68890>2642\n<e68891>1382\n<e68892>1404\n<e68893>8465\n<e68894>4934\n<e68895>14557\n<e68896>1155\n<e6889a>2672\n<e6889b>4935\n<e6889c>21604\n<e6889d>6756\n<e6889e>4936\n<e6889f>1847\n<e688a0>21605\n<e688a1>4937\n<e688a2>16871\n<e688a3>17658\n<e688a6>2707\n<e688a7>21606\n<e688a9>14558\n<e688aa>4938\n<e688ab>21607\n<e688ae>4939\n<e688af>1620\n<e688b0>4940\n<e688b1>19381\n<e688b4>2871\n<e688b6>13757\n<e688b8>1921\n<e688b9>19382\n<e688bb>3821\n<e688bd>19383\n<e688be>13390\n<e688bf>3690\n<e68980>2420\n<e68982>21608\n<e68983>14559\n<e68984>21609\n<e68986>14560\n<e68987>2708\n<e68988>6938\n<e68989>3446\n<e6898b>2326\n<e6898c>14561\n<e6898d>2109\n<e6898e>4944\n<e68990>21610\n<e68991>14562\n<e68992>17659\n<e68993>2855\n<e68994>21611\n<e68995>3575\n<e68996>14563\n<e68998>2897\n<e6899a>16872\n<e6899b>4947\n<e6899c>21612\n<e6899e>4945\n<e689a0>4948\n<e689a1>17660\n<e689a3>4946\n<e689a4>17661\n<e689a8>4949\n<e689ad>17663\n<e689ae>3585\n<e689af>16873\n<e689b1>1147\n<e689b3>17664\n<e689b6>3536\n<e689b9>3447\n<e689ba>19384\n<e689bb>17662\n<e689bc>4950\n<e689bd>21613\n<e689be>4953\n<e689bf>2461\n<e68a80>1621\n<e68a82>4951\n<e68a83>4958\n<e68a84>2462\n<e68a85>13765\n<e68a89>4952\n<e68a8a>3322\n<e68a90>19385\n<e68a91>3912\n<e68a94>4959\n<e68a95>3172\n<e68a96>4956\n<e68a97>1989\n<e68a98>2690\n<e68a99>17665\n<e68a9b>4973\n<e68a9c>3400\n<e68a9e>2898\n<e68aa6>8466\n<e68aa8>19386\n<e68aab>3448\n<e68aac>5042\n<e68ab1>3658\n<e68ab3>21617\n<e68ab5>3085\n<e68ab9>3747\n<e68aba>21620\n<e68abb>4962\n<e68abc>1313\n<e68abd>2984\n<e68b82>4971\n<e68b84>14564\n<e68b85>2930\n<e68b86>4965\n<e68b87>4972\n<e68b88>4967\n<e68b89>4974\n<e68b8a>4970\n<e68b8c>4969\n<e68b8d>3365\n<e68b8e>21623\n<e68b8f>4963\n<e68b90>1405\n<e68b91>4961\n<e68b92>1675\n<e68b93>2899\n<e68b94>4957\n<e68b95>17666\n<e68b96>16874\n<e68b97>4960\n<e68b98>1990\n<e68b99>2687\n<e68b9a>19387\n<e68b9b>2463\n<e68b9c>4968\n<e68b9d>3336\n<e68ba0>1676\n<e68ba1>1446\n<e68baa>21624\n<e68bac>1477\n<e68bad>2535\n<e68bae>4976\n<e68baf>4981\n<e68bb1>4977\n<e68bb2>21625\n<e68bb3>1875\n<e68bb4>19388\n<e68bb5>4982\n<e68bb6>2160\n<e68bb7>2043\n<e68bbc>14565\n<e68bbd>17668\n<e68bbe>2352\n<e68bbf>4964\n<e68c81>2251\n<e68c82>4979\n<e68c83>17669\n<e68c84>21626\n<e68c87>2214\n<e68c88>4980\n<e68c89>1160\n<e68c8a>14566\n<e68c8b>21627\n<e68c8c>4975\n<e68c8d>14567\n<e68c90>17670\n<e68c91>3013\n<e68c93>21628\n<e68c96>19389\n<e68c98>14568\n<e68c99>1677\n<e68c9b>14135\n<e68c9f>1708\n<e68ca7>4978\n<e68ca8>1131\n<e68ca9>21629\n<e68caa>19390\n<e68cab>2099\n<e68cad>21630\n<e68caf>2556\n<e68cb2>17673\n<e68cb5>17674\n<e68cb6>19391\n<e68cb9>14569\n<e68cbe>4984\n<e68cbf>2784\n<e68d81>17677\n<e68d84>17678\n<e68d86>19392\n<e68d89>2826\n<e68d8a>21631\n<e68d8b>19393\n<e68d8c>2169\n<e68d8d>4985\n<e68d8e>17679\n<e68d8f>4987\n<e68d90>4983\n<e68d92>21632\n<e68d93>19394\n<e68d94>21633\n<e68d95>3633\n<e68d98>21634\n<e68d99>17681\n<e68d9b>21635\n<e68d9c>2782\n<e68da5>14572\n<e68da6>21636\n<e68da7>3659\n<e68da8>2298\n<e68da9>4999\n<e68dab>4998\n<e68dac>17684\n<e68dad>21637\n<e68dae>2622\n<e68db1>19395\n<e68db4>14573\n<e68db5>19396\n<e68db6>4992\n<e68db7>2465\n<e68db8>21638\n<e68dba>3264\n<e68dbb>3303\n<e68dbc>16875\n<e68dbd>14574\n<e68dbf>19397\n<e68e80>4990\n<e68e82>19398\n<e68e83>2783\n<e68e84>14575\n<e68e87>14576\n<e68e88>2340\n<e68e89>4995\n<e68e8a>19399\n<e68e8c>2464\n<e68e8e>4989\n<e68e8f>4994\n<e68e90>14577\n<e68e92>3337\n<e68e94>17687\n<e68e95>21639\n<e68e96>4988\n<e68e98>1783\n<e68e99>17685\n<e68e9a>21640\n<e68e9b>1467\n<e68e9e>14578\n<e68e9f>4996\n<e68ea0>3955\n<e68ea1>2110\n<e68ea2>2931\n<e68ea3>4993\n<e68ea4>21641\n<e68ea5>2688\n<e68ea6>21642\n<e68ea7>1991\n<e68ea8>2602\n<e68ea9>1288\n<e68eaa>2750\n<e68eab>4991\n<e68eac>1631\n<e68ead>21643\n<e68eb2>1821\n<e68eb4>3051\n<e68eb5>4997\n<e68ebb>2785\n<e68ebd>17688\n<e68ebe>5000\n<e68f80>5002\n<e68f81>21644\n<e68f84>5008\n<e68f85>21645\n<e68f86>5003\n<e68f88>21646\n<e68f89>5005\n<e68f8e>21647\n<e68f8f>3507\n<e68f90>3087\n<e68f91>14579\n<e68f92>5006\n<e68f93>21648\n<e68f96>3862\n<e68f9a>3890\n<e68f9b>1525\n<e68f9c>14580\n<e68fa0>17691\n<e68fa1>1138\n<e68fa3>5004\n<e68fa5>16876\n<e68fa9>5001\n<e68faa>19402\n<e68fad>13340\n<e68fae>1588\n<e68fb2>17694\n<e68fb3>21649\n<e68fb4>1289\n<e68fb5>8467\n<e68fb6>5007\n<e68fb7>13892\n<e68fba>3891\n<e69086>5011\n<e69089>14581\n<e6908a>21650\n<e6908d>2843\n<e6908f>5018\n<e69090>14582\n<e69092>19405\n<e69093>5012\n<e69094>7724\n<e69096>5009\n<e69097>5016\n<e69098>19406\n<e6909c>4986\n<e6909e>17695\n<e690a0>19407\n<e690a2>14583\n<e690a4>19408\n<e690a5>17696\n<e690a6>5013\n<e690a8>5017\n<e690a9>17697\n<e690aa>19409\n<e690ac>3414\n<e690ad>3173\n<e690af>17698\n<e690b0>21651\n<e690b4>5010\n<e690b5>19410\n<e690b6>5014\n<e690ba>1822\n<e690bd>19411\n<e690be>2145\n<e690bf>19412\n<e69182>2689\n<e6918b>21652\n<e6918e>5022\n<e6918f>21653\n<e69191>7747\n<e69192>19413\n<e69193>21654\n<e69194>14584\n<e69198>3104\n<e6919a>17699\n<e6919b>14585\n<e6919c>21655\n<e6919d>17700\n<e6919f>19414\n<e691a0>8468\n<e691a1>21656\n<e691a3>21657\n<e691a7>5019\n<e691a9>3726\n<e691ad>14586\n<e691b3>17701\n<e691b4>19415\n<e691b6>5021\n<e691b8>3802\n<e691b9>16877\n<e691bb>14587\n<e691bd>17702\n<e69283>1848\n<e69285>21658\n<e69287>17703\n<e69288>5028\n<e6928f>21659\n<e69290>19416\n<e69291>17704\n<e69292>2179\n<e69293>5025\n<e69295>5024\n<e6929a>3304\n<e6929b>21660\n<e6929d>8469\n<e6929e>3213\n<e6929f>17705\n<e692a1>21661\n<e692a3>21662\n<e692a4>3115\n<e692a5>5026\n<e692a6>21663\n<e692a8>21664\n<e692a9>5027\n<e692ab>3553\n<e692ac>19419\n<e692ad>3323\n<e692ae>2161\n<e692b2>3710\n<e692b3>19420\n<e692b9>1447\n<e692bb>5034\n<e692bc>5029\n<e692bd>21665\n<e69381>3892\n<e69382>5036\n<e69384>16878\n<e69385>5032\n<e69387>5033\n<e69389>21666\n<e6938a>13341\n<e6938d>2786\n<e6938e>8470\n<e69390>16879\n<e69391>21667\n<e69392>5031\n<e69394>4966\n<e69395>17708\n<e69397>17709\n<e69398>5035\n<e6939a>5030\n<e693a3>5043\n<e693a4>17711\n<e693a5>14590\n<e693a6>2162\n<e693a7>5038\n<e693ac>1622\n<e693ad>19421\n<e693af>5044\n<e693b0>19422\n<e693b1>5037\n<e693b2>5048\n<e693b4>5047\n<e693b5>21670\n<e693b6>5046\n<e693b7>14591\n<e693ba>5049\n<e693bb>14592\n<e693bd>5051\n<e693be>2521\n<e693bf>17712\n<e69480>5050\n<e69481>21671\n<e69484>14593\n<e69485>5054\n<e6948f>17714\n<e69493>21675\n<e69494>17715\n<e69496>14594\n<e69498>5052\n<e69499>14595\n<e6949b>19423\n<e6949c>5053\n<e6949d>5015\n<e6949e>17717\n<e6949f>19424\n<e694a2>7831\n<e694a3>5056\n<e694a4>5055\n<e694a6>21676\n<e694a9>16880\n<e694aa>5023\n<e694ab>5057\n<e694ac>5045\n<e694ae>19425\n<e694af>2215\n<e694b1>21677\n<e694b2>17718\n<e694b6>5061\n<e694b7>5060\n<e694b8>5062\n<e694b9>1406\n<e694ba>21678\n<e694bb>1992\n<e694be>3660\n<e694bf>2643\n<e69583>21681\n<e69584>17719\n<e69585>1922\n<e69587>14596\n<e69588>5064\n<e69589>19426\n<e6958d>5067\n<e6958e>8471\n<e6958f>3524\n<e69590>21682\n<e69591>1657\n<e69592>21683\n<e69594>17720\n<e69595>5066\n<e69596>5065\n<e69597>3338\n<e69598>5068\n<e69599>1709\n<e6959d>5070\n<e6959e>5069\n<e6959f>21684\n<e695a0>19427\n<e695a2>1526\n<e695a3>2180\n<e695a6>3248\n<e695a7>14597\n<e695ab>17721\n<e695ac>1823\n<e695b0>2618\n<e695b2>5071\n<e695b4>2644\n<e695b5>3106\n<e695b7>3537\n<e695b8>5072\n<e695ba>17722\n<e695bd>21685\n<e69681>14598\n<e69684>17723\n<e69685>14599\n<e69687>3592\n<e69688>4620\n<e69689>2666\n<e6968a>17724\n<e6968c>3518\n<e6968e>2120\n<e69690>3449\n<e69691>3415\n<e69692>19428\n<e69695>19429\n<e69697>3143\n<e69698>21686\n<e69699>3977\n<e6969b>5076\n<e6969c>2300\n<e6969d>16881\n<e6969f>5077\n<e696a0>21687\n<e696a1>1146\n<e696a3>21688\n<e696a4>1740\n<e696a5>2673\n<e696a6>21689\n<e696ab>5078\n<e696ac>2192\n<e696ad>2949\n<e696ae>21690\n<e696af>2217\n<e696b0>2557\n<e696b2>17725\n<e696b3>21691\n<e696b4>19430\n<e696b5>17726\n<e696b7>5079\n<e696b8>17727\n<e696b9>3661\n<e696bc>1305\n<e696bd>2218\n<e696be>19431\n<e696bf>17728\n<e69781>5082\n<e69782>14600\n<e69783>5080\n<e69784>5083\n<e69785>3969\n<e69786>5081\n<e69788>19432\n<e69789>17729\n<e6978b>2719\n<e6978c>5084\n<e6978e>19433\n<e6978f>2834\n<e69790>19434\n<e69792>5085\n<e69794>17730\n<e69796>21692\n<e69797>1590\n<e69798>21693\n<e69799>5087\n<e6979b>5086\n<e6979f>19435\n<e697a2>1591\n<e697a3>13701\n<e697a5>3284\n<e697a6>2932\n<e697a7>1670\n<e697a8>2219\n<e697a9>2787\n<e697ac>2406\n<e697ad>1140\n<e697b0>14601\n<e697b1>5090\n<e697b2>14602\n<e697b9>17732\n<e697ba>1314\n<e697bb>5094\n<e697bc>17733\n<e69880>8472\n<e69882>1993\n<e69883>5093\n<e69884>17734\n<e69886>2075\n<e69887>2466\n<e69888>17735\n<e69889>8474\n<e6988a>5092\n<e6988c>2467\n<e6988d>21699\n<e6988e>3788\n<e6988f>2074\n<e69893>1179\n<e69894>2674\n<e69895>8473\n<e69896>21702\n<e6989c>5099\n<e6989d>21703\n<e6989e>20304\n<e6989f>2645\n<e698a0>1257\n<e698a1>17736\n<e698a2>16883\n<e698a3>21704\n<e698a4>8477\n<e698a5>2399\n<e698a6>21705\n<e698a7>3732\n<e698a8>2146\n<e698a9>21706\n<e698aa>17737\n<e698ab>16884\n<e698ac>14603\n<e698ad>2468\n<e698ae>8475\n<e698af>2635\n<e698b0>16885\n<e698b1>8366\n<e698b3>16886\n<e698b4>5098\n<e698b7>21708\n<e698b9>21707\n<e698ba>16882\n<e698bb>7680\n<e698bc>2985\n<e698bf>5129\n<e69980>21709\n<e69981>5103\n<e69982>2252\n<e69983>1994\n<e69984>5101\n<e69985>17738\n<e69986>21710\n<e69988>16887\n<e69989>5102\n<e6998a>21711\n<e6998b>2558\n<e6998c>14604\n<e6998e>17740\n<e6998f>5100\n<e69991>17739\n<e69992>2173\n<e69997>8479\n<e69998>21712\n<e69999>8480\n<e6999a>13377\n<e6999d>5105\n<e6999e>5104\n<e6999f>5109\n<e699a0>21713\n<e699a1>14607\n<e699a2>5110\n<e699a3>14138\n<e699a4>5106\n<e699a5>8478\n<e699a9>3433\n<e699aa>17745\n<e699ab>14608\n<e699ae>3539\n<e699af>1824\n<e699b0>5111\n<e699b3>8482\n<e699b4>2646\n<e699b5>21714\n<e699b6>2469\n<e699b9>21716\n<e699ba>2960\n<e699bb>17748\n<e699bc>21717\n<e699be>19436\n<e699bf>21715\n<e69a80>17749\n<e69a81>1727\n<e69a83>5112\n<e69a84>5116\n<e69a87>1355\n<e69a88>5113\n<e69a89>5115\n<e69a8d>16891\n<e69a8e>5114\n<e69a90>17750\n<e69a91>2421\n<e69a92>17751\n<e69a96>2950\n<e69a97>1161\n<e69a98>5117\n<e69a99>8483\n<e69a9d>5118\n<e69a9f>21721\n<e69aa0>8484\n<e69aa2>3014\n<e69aa4>14610\n<e69aa6>4025\n<e69aab>2193\n<e69aad>17753\n<e69aae>3643\n<e69ab1>17754\n<e69ab2>8485\n<e69ab3>19439\n<e69ab4>3691\n<e69ab8>5125\n<e69ab9>5120\n<e69abb>16892\n<e69abc>5123\n<e69abe>5122\n<e69abf>8486\n<e69b80>19440\n<e69b81>5119\n<e69b84>5124\n<e69b86>13397\n<e69b87>3254\n<e69b88>14611\n<e69b89>5121\n<e69b8c>21725\n<e69b8e>21726\n<e69b8f>19441\n<e69b94>21727\n<e69b96>5126\n<e69b99>2422\n<e69b9a>5127\n<e69b9b>16893\n<e69b9c>3893\n<e69b9d>3374\n<e69b9f>21728\n<e69ba0>5128\n<e69ba6>5130\n<e69ba8>16894\n<e69ba9>5131\n<e69bab>21729\n<e69bac>14612\n<e69bae>21730\n<e69bb0>5132\n<e69bb2>1730\n<e69bb3>1258\n<e69bb4>1995\n<e69bb5>5133\n<e69bb7>5134\n<e69bb8>2427\n<e69bb9>2788\n<e69bba>8487\n<e69bbb>8369\n<e69bbc>4333\n<e69bbd>2752\n<e69bbe>2751\n<e69bbf>2872\n<e69c80>2103\n<e69c81>17759\n<e69c83>4171\n<e69c85>14613\n<e69c87>21731\n<e69c88>1860\n<e69c89>3863\n<e69c8b>3662\n<e69c8d>3568\n<e69c8e>8488\n<e69c8f>5135\n<e69c92>17760\n<e69c93>14614\n<e69c94>2147\n<e69c95>3035\n<e69c96>5136\n<e69c97>4053\n<e69c99>17762\n<e69c9b>3692\n<e69c9c>21732\n<e69c9d>3015\n<e69c9e>5137\n<e69c9f>1592\n<e69ca0>21733\n<e69ca2>21734\n<e69ca5>19442\n<e69ca8>3814\n<e69caa>3760\n<e69cab>3748\n<e69cac>3722\n<e69cad>2163\n<e69cae>5141\n<e69cb1>2327\n<e69cb3>14615\n<e69cb4>3711\n<e69cb5>19443\n<e69cb6>5143\n<e69cb7>5146\n<e69cb8>5145\n<e69cba>1589\n<e69cbd>1658\n<e69cbe>21735\n<e69cbf>5142\n<e69d81>5144\n<e69d83>13751\n<e69d85>21736\n<e69d86>5147\n<e69d87>16895\n<e69d88>14616\n<e69d89>2623\n<e69d8c>14617\n<e69d8d>17765\n<e69d8e>3941\n<e69d8f>1165\n<e69d90>2128\n<e69d91>2844\n<e69d94>17766\n<e69d95>19444\n<e69d99>5150\n<e69d9c>3144\n<e69d9d>17767\n<e69d9e>5148\n<e69d9f>2827\n<e69da0>5149\n<e69da1>2522\n<e69da2>3817\n<e69da5>3922\n<e69da6>8490\n<e69daa>5157\n<e69dac>21737\n<e69dad>1996\n<e69dae>13681\n<e69daf>3339\n<e69db0>5154\n<e69db1>3174\n<e69db2>5091\n<e69db3>5095\n<e69db4>17771\n<e69db5>1641\n<e69db6>14618\n<e69db7>3325\n<e69dbb>14619\n<e69dbc>5156\n<e69dbe>2470\n<e69dbf>3416\n<e69e80>19445\n<e69e81>16896\n<e69e84>21738\n<e69e85>5162\n<e69e87>3470\n<e69e89>5153\n<e69e8b>5159\n<e69e8c>5158\n<e69e8e>21739\n<e69e8f>19446\n<e69e90>2675\n<e69e91>19447\n<e69e92>17773\n<e69e93>16897\n<e69e95>3739\n<e69e96>21740\n<e69e97>3995\n<e69e98>16898\n<e69e99>21741\n<e69e9a>3733\n<e69e9b>16899\n<e69e9c>1356\n<e69e9d>2220\n<e69ea0>4078\n<e69ea1>5161\n<e69ea2>2619\n<e69ea4>19448\n<e69ea6>5160\n<e69ea9>5155\n<e69eaf>1923\n<e69eb0>14620\n<e69eb1>19449\n<e69eb2>14621\n<e69eb3>5167\n<e69eb4>5165\n<e69eb5>19450\n<e69eb6>1357\n<e69eb7>5163\n<e69eb8>5169\n<e69eb9>5175\n<e69ebb>8491\n<e69ebe>19451\n<e69f80>8493\n<e69f81>2856\n<e69f82>21744\n<e69f83>17777\n<e69f84>3601\n<e69f85>21745\n<e69f86>5177\n<e69f88>17778\n<e69f89>21746\n<e69f8a>3476\n<e69f8e>5176\n<e69f8f>3366\n<e69f90>3693\n<e69f91>1527\n<e69f92>17779\n<e69f93>2715\n<e69f94>2378\n<e69f97>14623\n<e69f98>3055\n<e69f99>14624\n<e69f9a>3864\n<e69f9b>17780\n<e69f9c>21747\n<e69f9d>5172\n<e69f9e>5171\n<e69fa1>21748\n<e69fa2>5173\n<e69fa4>5170\n<e69fa6>21749\n<e69fa7>5178\n<e69fa9>5168\n<e69fac>5166\n<e69fae>5174\n<e69faf>5164\n<e69fb0>14625\n<e69fb1>2986\n<e69fb2>21750\n<e69fb3>3844\n<e69fb4>2290\n<e69fb5>2148\n<e69fb6>21751\n<e69fb7>17781\n<e69fb9>14622\n<e69fba>7834\n<e69fbb>2090\n<e69fbc>16900\n<e69fbe>3741\n<e69fbf>1439\n<e6a081>14066\n<e6a082>3050\n<e6a083>3234\n<e6a084>1259\n<e6a085>7687\n<e6a090>17776\n<e6a093>2710\n<e6a094>21752\n<e6a096>2648\n<e6a097>1792\n<e6a098>17785\n<e6a099>21753\n<e6a09d>16901\n<e6a09e>5180\n<e6a09f>17786\n<e6a0a1>1997\n<e6a0a2>1498\n<e6a0a7>21754\n<e6a0a8>19452\n<e6a0a9>5182\n<e6a0aa>1490\n<e6a0ab>5188\n<e6a0ac>14626\n<e6a0ad>17787\n<e6a0af>21755\n<e6a0b2>5185\n<e6a0b3>17789\n<e6a0b4>2711\n<e6a0b8>1449\n<e6a0b9>2076\n<e6a0bb>17790\n<e6a0bc>1448\n<e6a0bd>2111\n<e6a0be>17791\n<e6a0bf>21756\n<e6a180>5183\n<e6a181>1851\n<e6a182>1825\n<e6a183>3175\n<e6a184>8495\n<e6a185>17792\n<e6a186>5181\n<e6a188>1162\n<e6a189>17793\n<e6a18a>21757\n<e6a18c>17794\n<e6a18d>5184\n<e6a18e>5186\n<e6a190>1733\n<e6a191>1794\n<e6a192>8492\n<e6a193>1528\n<e6a194>1637\n<e6a195>17795\n<e6a197>17796\n<e6a198>21758\n<e6a199>5189\n<e6a19b>14629\n<e6a19c>2153\n<e6a19d>3743\n<e6a19f>2181\n<e6a1a3>5190\n<e6a1a7>3490\n<e6a1ab>17798\n<e6a1ae>17799\n<e6a1b2>14630\n<e6a1b4>5202\n<e6a1b5>14631\n<e6a1b6>1331\n<e6a1b7>5191\n<e6a1b9>21762\n<e6a1ba>14632\n<e6a1bb>21763\n<e6a1bc>17800\n<e6a1be>5208\n<e6a1bf>5192\n<e6a281>3978\n<e6a282>17801\n<e6a283>5199\n<e6a284>14633\n<e6a285>3349\n<e6a286>19453\n<e6a288>21764\n<e6a28d>5207\n<e6a28e>7836\n<e6a28f>5194\n<e6a290>17802\n<e6a293>1144\n<e6a294>5196\n<e6a296>17803\n<e6a29b>5198\n<e6a29c>17808\n<e6a29d>5197\n<e6a29f>5193\n<e6a2a0>5204\n<e6a2a1>21765\n<e6a2a2>2471\n<e6a2a3>16902\n<e6a2a5>14634\n<e6a2a6>4542\n<e6a2a7>1948\n<e6a2a8>3942\n<e6a2a9>21766\n<e6a2ad>5195\n<e6a2ae>21767\n<e6a2af>3088\n<e6a2b0>1409\n<e6a2b1>2077\n<e6a2b2>14635\n<e6a2b3>5187\n<e6a2b4>17811\n<e6a2b5>5203\n<e6a2b6>1471\n<e6a2b9>5201\n<e6a2ba>5205\n<e6a2bb>17812\n<e6a2bc>3176\n<e6a383>17816\n<e6a384>1594\n<e6a385>17817\n<e6a386>5235\n<e6a388>8367\n<e6a389>3797\n<e6a38a>5210\n<e6a38b>1593\n<e6a38c>17818\n<e6a38d>5217\n<e6a38f>8496\n<e6a390>14636\n<e6a391>21768\n<e6a392>3694\n<e6a393>21769\n<e6a394>5218\n<e6a395>5220\n<e6a396>14637\n<e6a397>5224\n<e6a398>5212\n<e6a399>17819\n<e6a39a>2920\n<e6a39f>3177\n<e6a3a0>5228\n<e6a3a1>5215\n<e6a3a3>5225\n<e6a3a7>5219\n<e6a3a8>14638\n<e6a3aa>21772\n<e6a3ab>19454\n<e6a3ac>17822\n<e6a3ad>14639\n<e6a3ae>2559\n<e6a3af>5229\n<e6a3b2>2647\n<e6a3b5>19455\n<e6a3b6>21773\n<e6a3b7>17823\n<e6a3b9>5227\n<e6a3ba>1529\n<e6a3bb>17813\n<e6a3bc>14642\n<e6a3bd>21774\n<e6a480>4086\n<e6a481>5209\n<e6a483>17824\n<e6a484>5223\n<e6a485>1180\n<e6a486>21775\n<e6a487>17825\n<e6a488>5211\n<e6a489>21776\n<e6a48a>16903\n<e6a48b>3782\n<e6a48c>5216\n<e6a48d>2536\n<e6a48e>3043\n<e6a48f>5206\n<e6a490>21777\n<e6a491>14643\n<e6a492>5222\n<e6a493>14644\n<e6a496>21778\n<e6a497>19456\n<e6a499>2624\n<e6a49a>5232\n<e6a49b>1487\n<e6a49c>1877\n<e6a4a1>5234\n<e6a4a2>5213\n<e6a4a3>5233\n<e6a4a5>5226\n<e6a4a6>5214\n<e6a4a8>5230\n<e6a4aa>5231\n<e6a4b0>5248\n<e6a4b1>21779\n<e6a4b3>19457\n<e6a4b4>3238\n<e6a4b5>14645\n<e6a4b6>5221\n<e6a4b8>19458\n<e6a4b9>5244\n<e6a4bb>14646\n<e6a4bd>5246\n<e6a4bf>3060\n<e6a582>16906\n<e6a585>21780\n<e6a586>17829\n<e6a589>16904\n<e6a58a>3894\n<e6a58e>21781\n<e6a593>3560\n<e6a594>5241\n<e6a595>2858\n<e6a597>14647\n<e6a599>5247\n<e6a59a>2753\n<e6a59b>19459\n<e6a59c>5238\n<e6a59d>5251\n<e6a59e>5250\n<e6a5a0>3271\n<e6a5a1>5249\n<e6a5a3>14648\n<e6a5a4>16907\n<e6a5a5>19460\n<e6a5a6>21782\n<e6a5a8>8498\n<e6a5a9>17830\n<e6a5aa>5253\n<e6a5ab>5240\n<e6a5ac>17831\n<e6a5ad>1728\n<e6a5ae>5243\n<e6a5b2>14649\n<e6a5b3>3350\n<e6a5b4>5245\n<e6a5b5>1731\n<e6a5b7>5237\n<e6a5b8>5239\n<e6a5b9>5236\n<e6a5ba>17832\n<e6a5bb>21785\n<e6a5bc>4054\n<e6a5bd>1464\n<e6a5be>5242\n<e6a5bf>14650\n<e6a680>14651\n<e6a681>5252\n<e6a682>1427\n<e6a686>14144\n<e6a68d>21786\n<e6a68e>1279\n<e6a691>5269\n<e6a692>17833\n<e6a695>5272\n<e6a696>17835\n<e6a698>8500\n<e6a69b>2560\n<e6a69c>5271\n<e6a6a0>5270\n<e6a6a1>21787\n<e6a6a5>16908\n<e6a6a6>14652\n<e6a6a7>5267\n<e6a6a8>19461\n<e6a6ab>19462\n<e6a6ad>14653\n<e6a6ae>5255\n<e6a6af>19463\n<e6a6b0>17836\n<e6a6b1>5284\n<e6a6b2>5254\n<e6a6b4>5273\n<e6a6b7>14654\n<e6a6b8>21788\n<e6a6ba>17837\n<e6a6bb>5265\n<e6a6bc>17838\n<e6a6be>5260\n<e6a6bf>5257\n<e6a780>17839\n<e6a781>5258\n<e6a783>5266\n<e6a785>21789\n<e6a787>7475\n<e6a788>21790\n<e6a78a>5263\n<e6a78b>1999\n<e6a78d>2790\n<e6a78e>5261\n<e6a78f>16909\n<e6a790>5256\n<e6a791>17840\n<e6a793>5259\n<e6a798>3895\n<e6a799>3736\n<e6a79d>5264\n<e6a79e>5274\n<e6a7a2>8501\n<e6a7a3>17844\n<e6a7a5>19464\n<e6a7a7>5282\n<e6a7a8>5275\n<e6a7a9>16912\n<e6a7aa>13329\n<e6a7ab>5288\n<e6a7ad>5286\n<e6a7b1>19465\n<e6a7b2>5281\n<e6a7b3>17847\n<e6a7b4>17849\n<e6a7b5>16913\n<e6a7b6>14143\n<e6a7b9>5280\n<e6a7bb>3052\n<e6a7bd>2791\n<e6a7be>17850\n<e6a7bf>5278\n<e6a880>21792\n<e6a881>14657\n<e6a882>5276\n<e6a883>21793\n<e6a885>5283\n<e6a88a>5289\n<e6a88c>5295\n<e6a88f>14658\n<e6a891>17851\n<e6a892>5290\n<e6a893>5293\n<e6a894>5287\n<e6a895>14659\n<e6a897>2994\n<e6a899>3498\n<e6a89a>17852\n<e6a89b>5277\n<e6a89d>17853\n<e6a89e>5285\n<e6a89f>2472\n<e6a8a0>21794\n<e6a8a1>3803\n<e6a8a2>5305\n<e6a8a3>5292\n<e6a8a4>21795\n<e6a8a8>14660\n<e6a8a9>1878\n<e6a8aa>1315\n<e6a8ab>1469\n<e6a8ae>5268\n<e6a8b0>8502\n<e6a8b4>14661\n<e6a8b5>2473\n<e6a8b6>5297\n<e6a8b7>21796\n<e6a8b8>5304\n<e6a8b9>2341\n<e6a8ba>1488\n<e6a8bb>16915\n<e6a8be>14662\n<e6a8bf>17857\n<e6a984>5294\n<e6a985>14663\n<e6a986>8504\n<e6a987>5299\n<e6a988>5303\n<e6a989>17858\n<e6a98a>19466\n<e6a98b>1710\n<e6a98e>17860\n<e6a992>17861\n<e6a994>15412\n<e6a995>19467\n<e6a996>14666\n<e6a998>1638\n<e6a999>5301\n<e6a99b>14667\n<e6a99f>1595\n<e6a9a1>3235\n<e6a9a2>5300\n<e6a9a4>17862\n<e6a9a6>5302\n<e6a9a7>19468\n<e6a9aa>21798\n<e6a9ab>8503\n<e6a9b1>19469\n<e6a9b2>5296\n<e6a9b3>8505\n<e6a9b8>5298\n<e6a9ba>17859\n<e6a9be>8506\n<e6a9bf>1470\n<e6aa80>2951\n<e6aa81>21799\n<e6aa83>14668\n<e6aa84>5309\n<e6aa89>14669\n<e6aa8b>17864\n<e6aa8d>5307\n<e6aa8e>1949\n<e6aa90>5306\n<e6aa91>14670\n<e6aa94>16917\n<e6aa97>5312\n<e6aa9b>21802\n<e6aa9c>5179\n<e6aaa0>5308\n<e6aaa1>17866\n<e6aaa5>16918\n<e6aaaa>5323\n<e6aaab>17868\n<e6aaac>5319\n<e6aaae>5200\n<e6aaaf>19470\n<e6aab3>5318\n<e6aab4>21805\n<e6aab8>5317\n<e6aabb>5314\n<e6aabd>17869\n<e6ab81>5291\n<e6ab82>5316\n<e6ab83>5315\n<e6ab86>17870\n<e6ab8c>21808\n<e6ab90>17872\n<e6ab91>5321\n<e6ab93>4044\n<e6ab94>17871\n<e6ab9a>5324\n<e6ab9c>14674\n<e6ab9d>17873\n<e6ab9e>5320\n<e6ab9f>5322\n<e6aba2>8507\n<e6aba4>8508\n<e6aba7>14675\n<e6aba8>3387\n<e6abaa>5325\n<e6abac>14676\n<e6abb0>21811\n<e6abb8>20152\n<e6abba>5329\n<e6abbb>5326\n<e6abbc>21812\n<e6abbd>17879\n<e6ac82>21813\n<e6ac83>19473\n<e6ac84>3933\n<e6ac85>5327\n<e6ac89>21816\n<e6ac8a>5279\n<e6ac8b>17881\n<e6ac92>5330\n<e6ac96>5331\n<e6ac97>17886\n<e6ac9b>16920\n<e6ac9d>1239\n<e6ac9e>14677\n<e6ac9f>5333\n<e6aca0>1853\n<e6aca1>2253\n<e6aca3>1741\n<e6aca4>14678\n<e6aca7>1316\n<e6aca8>21817\n<e6acab>21818\n<e6acac>16921\n<e6acaf>17888\n<e6acb2>3913\n<e6acb5>14679\n<e6acb6>21819\n<e6acb7>5335\n<e6acb8>5334\n<e6acb9>5337\n<e6acba>1623\n<e6acbb>19474\n<e6acbd>1742\n<e6acbe>1530\n<e6acbf>19475\n<e6ad83>5340\n<e6ad86>14680\n<e6ad87>5339\n<e6ad89>5341\n<e6ad8a>17889\n<e6ad8c>1358\n<e6ad8d>21820\n<e6ad90>5342\n<e6ad92>21821\n<e6ad93>1531\n<e6ad94>5344\n<e6ad96>14681\n<e6ad98>17890\n<e6ad99>5343\n<e6ad9b>5345\n<e6ad9d>21822\n<e6ad9f>5346\n<e6ada0>14682\n<e6ada1>5347\n<e6ada2>2221\n<e6ada3>2649\n<e6ada4>2065\n<e6ada5>13386\n<e6ada6>3554\n<e6ada7>16922\n<e6ada9>3634\n<e6adaa>4074\n<e6adab>21823\n<e6adac>17891\n<e6adae>21824\n<e6adaf>2243\n<e6adb0>21825\n<e6adb2>13785\n<e6adb3>2112\n<e6adb4>4026\n<e6adb5>17892\n<e6adb7>13398\n<e6adba>17893\n<e6adbb>2222\n<e6adbf>5350\n<e6ae80>5351\n<e6ae81>17894\n<e6ae82>14683\n<e6ae83>5353\n<e6ae84>5352\n<e6ae85>21826\n<e6ae86>3718\n<e6ae89>2408\n<e6ae8a>2328\n<e6ae8b>2194\n<e6ae8d>5354\n<e6ae95>5356\n<e6ae96>2537\n<e6ae97>21827\n<e6ae98>5355\n<e6ae9b>17895\n<e6ae9e>5357\n<e6aea4>5358\n<e6aea8>21832\n<e6aea9>16923\n<e6aeac>21833\n<e6aead>16924\n<e6aeae>17896\n<e6aeaf>5361\n<e6aeb0>19478\n<e6aeb1>5363\n<e6aeb2>5362\n<e6aeb3>5364\n<e6aeb4>1317\n<e6aeb5>2952\n<e6aeb7>5365\n<e6aeba>2164\n<e6aebb>1450\n<e6aebc>5366\n<e6aebd>17898\n<e6aebe>14684\n<e6aebf>3132\n<e6af80>4509\n<e6af85>1597\n<e6af86>5367\n<e6af8b>5368\n<e6af8c>14148\n<e6af8d>3644\n<e6af8e>3734\n<e6af8f>13388\n<e6af92>3231\n<e6af93>5369\n<e6af94>3450\n<e6af96>8509\n<e6af97>16925\n<e6af98>3471\n<e6af9a>17902\n<e6af9b>3807\n<e6af9f>5370\n<e6afa1>14685\n<e6afa3>21838\n<e6afab>5372\n<e6afac>5371\n<e6afae>17905\n<e6afaf>5374\n<e6afb1>14686\n<e6afb3>5373\n<e6afb7>19479\n<e6afb9>19480\n<e6afbf>16926\n<e6b082>17906\n<e6b084>19481\n<e6b085>16927\n<e6b088>5376\n<e6b089>19482\n<e6b08a>17907\n<e6b08d>19483\n<e6b08e>17908\n<e6b08f>2223\n<e6b090>14687\n<e6b091>3773\n<e6b092>21839\n<e6b097>1598\n<e6b099>21840\n<e6b09b>5379\n<e6b09f>21841\n<e6b0a3>5381\n<e6b0a4>5380\n<e6b0ac>19484\n<e6b0ae>21845\n<e6b0b3>14688\n<e6b0b4>2603\n<e6b0b5>14689\n<e6b0b6>17909\n<e6b0b7>3499\n<e6b0b8>1260\n<e6b0ba>20309\n<e6b0bb>21846\n<e6b0be>3417\n<e6b0bf>8510\n<e6b180>3089\n<e6b181>2379\n<e6b182>1659\n<e6b18a>19485\n<e6b18b>21847\n<e6b18d>17911\n<e6b18e>3418\n<e6b18f>21848\n<e6b190>2266\n<e6b192>19486\n<e6b194>19487\n<e6b195>5383\n<e6b197>1532\n<e6b199>14691\n<e6b19a>1306\n<e6b19b>17912\n<e6b19c>8511\n<e6b19d>3274\n<e6b19e>5382\n<e6b19f>2000\n<e6b1a0>2961\n<e6b1a2>5384\n<e6b1a7>17930\n<e6b1a8>5392\n<e6b1aa>5385\n<e6b1ab>21849\n<e6b1ad>17913\n<e6b1af>8513\n<e6b1b0>2849\n<e6b1b3>5393\n<e6b1b4>16928\n<e6b1b6>14692\n<e6b1b8>21850\n<e6b1b9>19488\n<e6b1ba>1854\n<e6b1bb>14693\n<e6b1bd>1599\n<e6b1be>5391\n<e6b281>5389\n<e6b282>5386\n<e6b283>3914\n<e6b284>17914\n<e6b285>14694\n<e6b286>8512\n<e6b287>21851\n<e6b288>3036\n<e6b289>17915\n<e6b28c>3249\n<e6b28d>5387\n<e6b290>5395\n<e6b292>5394\n<e6b293>1785\n<e6b294>17917\n<e6b295>14695\n<e6b296>1325\n<e6b297>17918\n<e6b298>16929\n<e6b299>2091\n<e6b29a>5388\n<e6b29b>5390\n<e6b29c>14696\n<e6b29f>21852\n<e6b2a1>3717\n<e6b2a2>2900\n<e6b2aa>14153\n<e6b2ab>3749\n<e6b2ac>19489\n<e6b2ad>17919\n<e6b2ae>5403\n<e6b2b0>21853\n<e6b2b1>5404\n<e6b2b2>21854\n<e6b2b3>1359\n<e6b2b4>19490\n<e6b2b8>3576\n<e6b2b9>3849\n<e6b2ba>5406\n<e6b2bb>2255\n<e6b2bc>2474\n<e6b2bd>5399\n<e6b2be>5405\n<e6b2bf>1290\n<e6b381>1711\n<e6b382>17920\n<e6b384>5396\n<e6b385>5401\n<e6b386>16931\n<e6b389>2712\n<e6b38a>3367\n<e6b38c>3451\n<e6b38d>21855\n<e6b38f>21856\n<e6b390>14697\n<e6b391>21857\n<e6b392>19491\n<e6b393>5398\n<e6b394>14698\n<e6b395>3663\n<e6b396>14699\n<e6b397>5400\n<e6b399>5409\n<e6b39a>8514\n<e6b39b>5407\n<e6b39c>17922\n<e6b39d>5402\n<e6b3a0>14700\n<e6b3a1>3664\n<e6b3a2>3326\n<e6b3a3>1661\n<e6b3a5>3103\n<e6b3a7>21858\n<e6b3a8>2987\n<e6b3a9>17923\n<e6b3aa>5410\n<e6b3ad>17924\n<e6b3ae>14703\n<e6b3af>5408\n<e6b3b0>2873\n<e6b3b1>5397\n<e6b3b2>21859\n<e6b3b3>1261\n<e6b3b4>21860\n<e6b3bb>16930\n<e6b480>17926\n<e6b481>15413\n<e6b484>8515\n<e6b487>21861\n<e6b48a>14704\n<e6b48b>3896\n<e6b48c>5421\n<e6b48e>14705\n<e6b48f>21862\n<e6b491>14706\n<e6b492>5420\n<e6b493>21863\n<e6b497>2714\n<e6b499>5417\n<e6b49a>21864\n<e6b49b>3926\n<e6b49e>3214\n<e6b49f>5411\n<e6b4a4>17927\n<e6b4a5>3041\n<e6b4a8>21865\n<e6b4a9>1262\n<e6b4aa>2001\n<e6b4ab>5414\n<e6b4ae>14707\n<e6b4af>17931\n<e6b4b1>16932\n<e6b4b2>2353\n<e6b4b3>5419\n<e6b4b4>17950\n<e6b4b5>5418\n<e6b4b6>5413\n<e6b4b8>5416\n<e6b4b9>16933\n<e6b4bb>1478\n<e6b4bc>17932\n<e6b4bd>5415\n<e6b4be>3327\n<e6b4bf>16934\n<e6b581>3958\n<e6b584>2524\n<e6b585>2713\n<e6b597>14708\n<e6b598>16935\n<e6b599>5427\n<e6b59a>5425\n<e6b59b>17933\n<e6b59c>3519\n<e6b59e>14709\n<e6b59f>21866\n<e6b5a0>17934\n<e6b5a1>19492\n<e6b5a3>5422\n<e6b5a4>5424\n<e6b5a5>14710\n<e6b5a6>1244\n<e6b5a7>21867\n<e6b5a9>2002\n<e6b5aa>4056\n<e6b5ac>1435\n<e6b5ae>3540\n<e6b5af>8517\n<e6b5b0>17935\n<e6b5b4>3915\n<e6b5b7>1410\n<e6b5b8>2561\n<e6b5b9>5426\n<e6b5bc>19493\n<e6b682>14711\n<e6b685>5431\n<e6b687>8516\n<e6b688>2475\n<e6b689>13354\n<e6b68a>17938\n<e6b68c>3866\n<e6b68d>17939\n<e6b68e>5428\n<e6b691>17940\n<e6b692>21868\n<e6b693>5423\n<e6b694>16936\n<e6b695>5429\n<e6b696>8518\n<e6b697>21869\n<e6b698>17941\n<e6b699>4006\n<e6b69b>3181\n<e6b69c>3226\n<e6b6aa>16937\n<e6b6ab>17946\n<e6b6ac>8519\n<e6b6ae>17947\n<e6b6af>1428\n<e6b6b2>1271\n<e6b6b4>17948\n<e6b6b5>5435\n<e6b6b7>21870\n<e6b6b8>5438\n<e6b6b9>19494\n<e6b6bc>3979\n<e6b6bd>21871\n<e6b6bf>14712\n<e6b780>3918\n<e6b782>17949\n<e6b784>14713\n<e6b785>5445\n<e6b786>5439\n<e6b787>5436\n<e6b788>17951\n<e6b78a>14714\n<e6b78b>3996\n<e6b78c>5442\n<e6b78e>17952\n<e6b78f>8520\n<e6b790>15414\n<e6b791>2388\n<e6b792>5444\n<e6b795>5449\n<e6b796>14715\n<e6b798>3179\n<e6b799>5447\n<e6b79a>13395\n<e6b79b>16938\n<e6b79d>16939\n<e6b79e>5441\n<e6b79f>17953\n<e6b7a0>21872\n<e6b7a1>2934\n<e6b7a2>21873\n<e6b7a4>5448\n<e6b7a5>21874\n<e6b7a6>5437\n<e6b7a8>5443\n<e6b7a9>14716\n<e6b7aa>5450\n<e6b7ac>5440\n<e6b7ae>5451\n<e6b7af>21875\n<e6b7b0>19495\n<e6b7b1>2562\n<e6b7b2>8522\n<e6b7b3>2409\n<e6b7b4>21876\n<e6b7b5>3573\n<e6b7b6>17954\n<e6b7b7>2078\n<e6b7b8>8521\n<e6b7b9>5432\n<e6b7ba>5446\n<e6b7bb>3124\n<e6b7bc>8523\n<e6b880>21877\n<e6b884>21878\n<e6b885>2650\n<e6b887>1479\n<e6b888>2113\n<e6b889>2476\n<e6b88a>5434\n<e6b88b>2380\n<e6b893>1826\n<e6b895>5433\n<e6b897>14150\n<e6b899>5455\n<e6b89a>2423\n<e6b89b>1902\n<e6b89d>5470\n<e6b89e>17956\n<e6b89f>5464\n<e6b8a0>1678\n<e6b8a1>3145\n<e6b8a2>14717\n<e6b8a3>5459\n<e6b8a4>5468\n<e6b8a5>1139\n<e6b8a6>1236\n<e6b8a7>8526\n<e6b8a9>1337\n<e6b8ab>5461\n<e6b8ac>2828\n<e6b8ad>5452\n<e6b8ae>5454\n<e6b8af>2003\n<e6b8b2>17958\n<e6b8b4>13330\n<e6b8b6>17955\n<e6b8b8>5471\n<e6b8b9>8524\n<e6b8ba>5466\n<e6b8bb>21879\n<e6b8bc>8527\n<e6b8be>5458\n<e6b982>15415\n<e6b983>5465\n<e6b984>16940\n<e6b985>19496\n<e6b98a>3767\n<e6b98d>5463\n<e6b98e>5467\n<e6b98f>17963\n<e6b991>14718\n<e6b992>21880\n<e6b996>1924\n<e6b997>17966\n<e6b998>2477\n<e6b99b>2935\n<e6b99c>8525\n<e6b99d>21881\n<e6b99e>16941\n<e6b99f>5457\n<e6b9a2>21882\n<e6b9a3>17967\n<e6b9a7>3865\n<e6b9a8>21883\n<e6b9ab>5460\n<e6b9ae>5453\n<e6b9af>3180\n<e6b9b2>5456\n<e6b9b3>19497\n<e6b9b6>5462\n<e6b9bb>19498\n<e6b9bd>19499\n<e6b9be>4087\n<e6b9bf>2282\n<e6ba80>3756\n<e6ba82>5472\n<e6ba89>19500\n<e6ba8c>3394\n<e6ba8d>21884\n<e6ba8f>5484\n<e6ba90>1903\n<e6ba93>17969\n<e6ba96>2410\n<e6ba98>5474\n<e6ba99>21885\n<e6ba9c>3959\n<e6ba9d>2004\n<e6ba9f>5487\n<e6baa0>21886\n<e6baa5>5485\n<e6baa7>17970\n<e6baaa>5473\n<e6baab>13324\n<e6baaf>5479\n<e6bab1>16942\n<e6bab2>5481\n<e6bab3>21889\n<e6bab4>17971\n<e6bab6>3897\n<e6bab7>5476\n<e6babb>21890\n<e6babc>19501\n<e6babd>5478\n<e6babf>8528\n<e6bb80>21891\n<e6bb81>16943\n<e6bb82>5486\n<e6bb83>17972\n<e6bb84>5480\n<e6bb85>3795\n<e6bb87>14719\n<e6bb88>21892\n<e6bb89>5475\n<e6bb8a>14720\n<e6bb8b>2254\n<e6bb8c>5499\n<e6bb8d>21893\n<e6bb8e>14721\n<e6bb8f>21894\n<e6bb91>1480\n<e6bb93>5477\n<e6bb99>15416\n<e6bb9d>2892\n<e6bb9e>2874\n<e6bba6>15396\n<e6bbab>17974\n<e6bbac>5491\n<e6bbaf>5497\n<e6bbb2>5495\n<e6bbb4>3107\n<e6bbb7>5502\n<e6bbb8>5492\n<e6bbb9>17975\n<e6bbbb>17976\n<e6bbbd>14722\n<e6bbbe>5493\n<e6bbbf>5469\n<e6bc81>1683\n<e6bc82>3500\n<e6bc84>21897\n<e6bc86>2283\n<e6bc88>21898\n<e6bc89>2057\n<e6bc8a>17977\n<e6bc8c>17978\n<e6bc8d>21899\n<e6bc8f>4057\n<e6bc90>16944\n<e6bc91>5489\n<e6bc93>5501\n<e6bc94>1291\n<e6bc95>2792\n<e6bc96>21900\n<e6bc98>17979\n<e6bc9a>14723\n<e6bc9b>21901\n<e6bca0>3375\n<e6bca2>1533\n<e6bca5>17980\n<e6bca6>19504\n<e6bca9>19505\n<e6bcaa>14724\n<e6bcab>3757\n<e6bcac>3054\n<e6bcad>21903\n<e6bcaf>14725\n<e6bcb0>19506\n<e6bcb1>5496\n<e6bcb2>5498\n<e6bcb3>14726\n<e6bcb5>17973\n<e6bcb6>17981\n<e6bcb8>2740\n<e6bcbb>21902\n<e6bcbc>17982\n<e6bcbe>5500\n<e6bcbf>5494\n<e6bd81>5488\n<e6bd85>1535\n<e6bd8f>21904\n<e6bd91>7776\n<e6bd92>17984\n<e6bd93>21905\n<e6bd94>1855\n<e6bd97>17985\n<e6bd98>5514\n<e6bd99>16945\n<e6bd9a>14727\n<e6bd9b>5509\n<e6bd9c>2716\n<e6bd9d>21906\n<e6bd9e>14728\n<e6bd9f>1473\n<e6bda0>17986\n<e6bda1>16946\n<e6bda2>14729\n<e6bda4>2411\n<e6bda6>5518\n<e6bda8>17987\n<e6bdac>21907\n<e6bdad>5511\n<e6bdae>3016\n<e6bdaf>5508\n<e6bdb0>3061\n<e6bdb4>5543\n<e6bdb8>5505\n<e6bdba>5504\n<e6bdbc>5513\n<e6bdbd>14730\n<e6bdbe>16947\n<e6be80>5507\n<e6be81>5506\n<e6be82>5512\n<e6be83>21908\n<e6be84>2629\n<e6be86>5503\n<e6be87>19507\n<e6be88>8529\n<e6be8b>14731\n<e6be8c>16948\n<e6be8d>14732\n<e6be8e>5515\n<e6be90>17988\n<e6be91>5516\n<e6be92>14733\n<e6be93>21909\n<e6be94>14734\n<e6be96>17989\n<e6be97>1534\n<e6be98>13884\n<e6be9a>14735\n<e6be9d>19508\n<e6be9f>17991\n<e6bea0>16949\n<e6bea1>5521\n<e6bea3>5520\n<e6bea4>5522\n<e6bea5>17992\n<e6bea6>21910\n<e6beaa>5525\n<e6beae>19509\n<e6beaf>17993\n<e6beb0>21911\n<e6beb1>3133\n<e6beb3>5519\n<e6beb5>8530\n<e6beb6>14738\n<e6beb7>19510\n<e6beb9>5523\n<e6bebc>16950\n<e6bebe>17990\n<e6bf80>1849\n<e6bf81>2905\n<e6bf82>5517\n<e6bf83>3313\n<e6bf85>21912\n<e6bf86>5524\n<e6bf87>16951\n<e6bf8a>16952\n<e6bf94>5529\n<e6bf95>5527\n<e6bf98>5530\n<e6bf9a>14739\n<e6bf9b>5533\n<e6bf9e>14740\n<e6bf9f>5526\n<e6bfa0>2044\n<e6bfa1>3294\n<e6bfa4>5430\n<e6bfa8>21913\n<e6bfa9>17997\n<e6bfab>3934\n<e6bfac>5528\n<e6bfae>5532\n<e6bfaf>2901\n<e6bfb0>16953\n<e6bfb1>5531\n<e6bfb3>5510\n<e6bfb5>8531\n<e6bfb6>7076\n<e6bfb9>15395\n<e6bfba>5536\n<e6bfbc>17999\n<e6bfbd>21914\n<e6bfbe>5540\n<e78080>18000\n<e78081>5538\n<e78085>8532\n<e78086>7760\n<e78087>8533\n<e78089>5534\n<e7808a>18001\n<e7808b>5535\n<e7808d>19511\n<e7808f>5539\n<e78091>5537\n<e78097>21915\n<e78098>5545\n<e7809a>5542\n<e7809b>5541\n<e7809d>5544\n<e7809f>5546\n<e780a0>19512\n<e780a3>18002\n<e780a7>2893\n<e780a8>8534\n<e780ac>2633\n<e780af>21916\n<e780b0>5547\n<e780b2>5549\n<e780b4>21917\n<e780b7>21918\n<e780b9>14742\n<e780ba>18004\n<e780bc>14743\n<e780be>5548\n<e78183>18005\n<e78184>21919\n<e78187>18006\n<e78188>21920\n<e78189>19513\n<e7818a>20306\n<e7818b>18007\n<e7818c>5490\n<e7818e>16954\n<e78191>5550\n<e78194>14745\n<e78195>21921\n<e781a3>5551\n<e781a4>14748\n<e781a5>18009\n<e781a9>18010\n<e781ab>1360\n<e781ac>14749\n<e781ae>18011\n<e781af>3182\n<e781b0>1411\n<e781b5>16955\n<e781b6>18012\n<e781bd>2114\n<e781be>14750\n<e78281>14751\n<e78285>8535\n<e78286>18013\n<e78289>4045\n<e7828a>2604\n<e7828e>1292\n<e78292>5553\n<e78294>21922\n<e78295>14752\n<e78296>21923\n<e78297>18014\n<e78298>19514\n<e78299>5552\n<e7829b>21924\n<e7829f>18016\n<e782a4>16956\n<e782ab>8536\n<e782ac>5556\n<e782ad>2936\n<e782ae>5559\n<e782af>5554\n<e782b0>19515\n<e782b1>18017\n<e782b3>5558\n<e782b4>21925\n<e782b7>14753\n<e782b8>5557\n<e782b9>3130\n<e782ba>1181\n<e782bb>8365\n<e78388>4029\n<e7838a>18020\n<e7838b>5561\n<e7838f>1226\n<e78391>18021\n<e78398>14756\n<e78399>5563\n<e7839c>14757\n<e7839d>5562\n<e7839f>5560\n<e783a4>16957\n<e783ac>18019\n<e783b1>5555\n<e783b9>3665\n<e783ba>21926\n<e783bd>5565\n<e78483>18022\n<e78484>8538\n<e78485>21927\n<e78486>18023\n<e78487>14758\n<e78488>18024\n<e78489>5564\n<e7848b>21928\n<e7848c>18025\n<e7848f>8537\n<e78494>1293\n<e78499>5567\n<e7849a>3586\n<e7849c>5566\n<e7849e>16959\n<e784a0>14759\n<e784a1>3777\n<e784a6>2479\n<e784ab>16958\n<e784ad>21929\n<e784ae>16960\n<e784af>18027\n<e784b0>7644\n<e784b1>14760\n<e784b6>2741\n<e784b8>21930\n<e784bc>2478\n<e78581>21931\n<e78585>19518\n<e7858a>14761\n<e7858b>21932\n<e7858c>5573\n<e78590>18028\n<e78591>16961\n<e78593>18029\n<e78595>5569\n<e78596>5574\n<e78597>21934\n<e78599>1294\n<e7859a>21935\n<e7859c>8539\n<e7859e>18030\n<e785a0>14763\n<e785a2>5572\n<e785a4>3351\n<e785a5>5568\n<e785a6>5571\n<e785a7>2480\n<e785a8>16962\n<e785a9>3429\n<e785ac>5575\n<e785ae>2301\n<e785b9>14764\n<e78680>18033\n<e78684>5578\n<e78685>16963\n<e78687>16964\n<e78688>5570\n<e7868a>1789\n<e7868c>21936\n<e7868f>5576\n<e78692>14765\n<e78694>3898\n<e78695>5579\n<e78696>18032\n<e78699>8285\n<e7869a>21937\n<e7869b>18034\n<e7869f>2393\n<e786a0>18035\n<e786a2>18036\n<e786a8>5580\n<e786ac>5581\n<e786b0>21938\n<e786b1>3300\n<e786b2>19519\n<e786b3>15397\n<e786b9>5583\n<e786ba>16965\n<e786be>5584\n<e786bf>21939\n<e78780>21940\n<e78781>8543\n<e78783>3305\n<e78784>16966\n<e78788>3183\n<e78789>5586\n<e7878b>14767\n<e7878c>21941\n<e7878e>5588\n<e78790>3997\n<e78792>5585\n<e78793>14768\n<e78794>5587\n<e78795>1295\n<e78796>14769\n<e78797>5582\n<e78799>18040\n<e7879a>21942\n<e7879c>18041\n<e7879f>4430\n<e787a0>5589\n<e787a5>2793\n<e787a6>2182\n<e787a7>5591\n<e787ac>5590\n<e787ad>2538\n<e787ae>4334\n<e787b4>19520\n<e787b5>5592\n<e787b8>21943\n<e787b9>5594\n<e787bb>5577\n<e787bc>5593\n<e787be>8544\n<e787bf>5595\n<e78880>14770\n<e78886>3376\n<e78887>18042\n<e7888d>5596\n<e78890>5597\n<e78893>21946\n<e78895>16967\n<e78897>19521\n<e7889a>21947\n<e7889b>5598\n<e7889d>14771\n<e7889f>19522\n<e788a4>21948\n<e788a8>5599\n<e788aa>3066\n<e788ab>14772\n<e788ac>5601\n<e788ad>5600\n<e788af>21949\n<e788b0>5602\n<e788b2>5603\n<e788b4>18044\n<e788b5>2315\n<e788b6>3541\n<e788b8>14773\n<e788b9>18045\n<e788bd>2776\n<e788be>2256\n<e788bf>5606\n<e78980>5607\n<e78981>14774\n<e78982>18046\n<e78983>19523\n<e78985>21950\n<e78986>5608\n<e78987>3618\n<e78988>3419\n<e7898b>5609\n<e7898e>21951\n<e78992>3017\n<e78993>14775\n<e78997>18047\n<e78998>5610\n<e7899a>19526\n<e7899b>1671\n<e7899c>14778\n<e7899d>3794\n<e7899e>21952\n<e7899f>3778\n<e789a0>19527\n<e789a1>1332\n<e789a2>4058\n<e789a3>18048\n<e789a7>3712\n<e789a8>19528\n<e789a9>3578\n<e789ab>21953\n<e789b1>21954\n<e789b2>2651\n<e789b4>5611\n<e789b7>19529\n<e789b8>18052\n<e789b9>3227\n<e789bd>1879\n<e789be>5612\n<e789bf>18053\n<e78a80>2116\n<e78a81>5614\n<e78a82>5613\n<e78a84>19530\n<e78a87>5615\n<e78a89>21957\n<e78a8d>14779\n<e78a8e>18054\n<e78a92>5616\n<e78a93>21958\n<e78a96>5617\n<e78a9b>16969\n<e78aa0>1624\n<e78aa2>5618\n<e78aa7>5619\n<e78aa8>21959\n<e78aac>1880\n<e78aad>14780\n<e78aae>18056\n<e78aaf>3420\n<e78ab0>18057\n<e78ab1>8545\n<e78ab2>5621\n<e78ab4>14781\n<e78ab6>2525\n<e78ab9>5620\n<e78abe>8546\n<e78b80>13355\n<e78b81>18058\n<e78b82>1712\n<e78b83>5622\n<e78b84>5624\n<e78b86>5623\n<e78b87>14782\n<e78b89>19531\n<e78b8c>18060\n<e78b8e>5625\n<e78b90>1925\n<e78b92>5626\n<e78b97>1761\n<e78b98>21962\n<e78b99>2754\n<e78b9b>2063\n<e78b9f>21963\n<e78ba0>5628\n<e78ba2>5627\n<e78ba5>19532\n<e78ba9>2329\n<e78bac>3232\n<e78bad>1713\n<e78bb3>18063\n<e78bb4>19533\n<e78bb7>5631\n<e78bb8>2922\n<e78bb9>5630\n<e78bba>18064\n<e78bbb>14783\n<e78bbc>4059\n<e78bbd>3352\n<e78bbe>21964\n<e78c82>19534\n<e78c87>18065\n<e78c8a>5634\n<e78c8b>19535\n<e78c8d>21965\n<e78c92>18066\n<e78c93>21966\n<e78c96>5636\n<e78c97>5633\n<e78c9b>3808\n<e78c9c>5635\n<e78c9d>5637\n<e78c9e>19536\n<e78c9f>3980\n<e78ca2>19537\n<e78ca4>8547\n<e78ca5>5641\n<e78ca7>16971\n<e78ca8>14786\n<e78ca9>5640\n<e78caa>2996\n<e78cab>3299\n<e78cac>18071\n<e78cae>1881\n<e78caf>5639\n<e78cb1>14787\n<e78cb2>21967\n<e78cb3>18072\n<e78cb4>5638\n<e78cb5>21968\n<e78cb6>3867\n<e78cb9>18070\n<e78cbd>18073\n<e78cbe>5642\n<e78cbf>1296\n<e78d83>14788\n<e78d84>2056\n<e78d85>2224\n<e78d8d>19540\n<e78d90>16972\n<e78d92>18074\n<e78d96>21969\n<e78d97>5646\n<e78d98>19541\n<e78da3>2381\n<e78da6>16973\n<e78da7>19542\n<e78da8>5648\n<e78da9>21974\n<e78daa>5647\n<e78dab>18076\n<e78dac>14789\n<e78db0>5649\n<e78db1>18080\n<e78db2>1451\n<e78db5>5651\n<e78db7>8549\n<e78db8>5650\n<e78db9>21975\n<e78dba>5653\n<e78dbb>5652\n<e78dbc>14790\n<e78e80>21976\n<e78e81>18081\n<e78e83>14791\n<e78e84>1904\n<e78e87>3952\n<e78e89>1732\n<e78e8a>18082\n<e78e8b>1318\n<e78e8e>21977\n<e78e90>21978\n<e78e93>21979\n<e78e94>18083\n<e78e95>14794\n<e78e96>1762\n<e78e97>21980\n<e78e98>18084\n<e78e9c>18085\n<e78ea2>16974\n<e78ea5>18086\n<e78ea6>14798\n<e78ea8>15423\n<e78ea9>1565\n<e78eaa>21981\n<e78eab>14799\n<e78ead>21982\n<e78eb2>4016\n<e78eb3>5655\n<e78eb5>14800\n<e78eb7>14801\n<e78eb9>18087\n<e78eba>13802\n<e78ebb>5657\n<e78ebc>14802\n<e78ebd>8550\n<e78ebf>18088\n<e78f80>5658\n<e78f82>1361\n<e78f85>18089\n<e78f86>21983\n<e78f88>5654\n<e78f89>8551\n<e78f8a>2183\n<e78f8b>18090\n<e78f8c>21984\n<e78f8d>3037\n<e78f8e>5656\n<e78f8f>14803\n<e78f92>8554\n<e78f93>21985\n<e78f96>8552\n<e78f99>14804\n<e78f9d>21986\n<e78f9e>5661\n<e78fa0>2330\n<e78fa1>18091\n<e78fa3>8553\n<e78fa4>15417\n<e78fa5>5659\n<e78fa6>21987\n<e78fa7>18092\n<e78fa9>14805\n<e78faa>1812\n<e78fad>3421\n<e78fae>5660\n<e78fb1>5687\n<e78fb4>14806\n<e78fb5>8556\n<e78fb7>21988\n<e78fb8>5666\n<e78fb9>18093\n<e78fba>18095\n<e78fbb>21989\n<e78fbd>14807\n<e78fbe>1905\n<e78fbf>21990\n<e79080>21991\n<e79081>18096\n<e79083>1663\n<e79084>14808\n<e79085>5663\n<e79086>3943\n<e79087>8555\n<e79089>3960\n<e7908a>14809\n<e79091>21992\n<e79093>18094\n<e790a1>15418\n<e790a2>2902\n<e790a4>14812\n<e790a5>5665\n<e790a6>8557\n<e790a8>14813\n<e790a9>8559\n<e790aa>8558\n<e790ab>16975\n<e790ac>14814\n<e790ad>21993\n<e790ae>8560\n<e790b2>5667\n<e790b3>3998\n<e790b4>1743\n<e790b5>3472\n<e790b6>3328\n<e790b9>14818\n<e790ba>5668\n<e790bf>5670\n<e79180>18098\n<e79181>5673\n<e79183>18099\n<e79184>14819\n<e79186>16976\n<e79187>14820\n<e7918b>14821\n<e7918d>14822\n<e79191>14823\n<e79192>18100\n<e79193>18097\n<e79195>5669\n<e79197>14824\n<e79199>5672\n<e7919a>1950\n<e7919b>1263\n<e7919c>5674\n<e7919d>18101\n<e7919e>2614\n<e7919f>5671\n<e791a0>4004\n<e791a2>16977\n<e791a3>5677\n<e791a4>7477\n<e791a6>14825\n<e791a9>5675\n<e791aa>5678\n<e791ab>14826\n<e791ad>16978\n<e791ae>21996\n<e791af>5664\n<e791b0>5676\n<e791b1>14827\n<e791b2>19543\n<e791b3>2092\n<e791b6>5679\n<e791be>5680\n<e79280>14828\n<e79281>18102\n<e79283>3944\n<e79288>18103\n<e79289>8562\n<e7928b>5681\n<e7928f>21997\n<e79290>14832\n<e79291>21998\n<e79292>18105\n<e79297>18106\n<e79298>14833\n<e79299>18107\n<e7929a>21999\n<e7929c>14834\n<e7929e>5682\n<e7929f>8563\n<e792a0>14835\n<e792a1>18108\n<e792a2>5662\n<e792a3>14836\n<e792a5>18109\n<e792a6>16979\n<e792a7>5683\n<e792a8>14837\n<e792a9>16980\n<e792aa>18110\n<e792ab>14838\n<e792ae>22000\n<e792af>19544\n<e792b0>1536\n<e792b5>14839\n<e792b9>18111\n<e792ba>18113\n<e792bb>18112\n<e792bd>2257\n<e792bf>14840\n<e79388>14841\n<e79389>16981\n<e7938a>5684\n<e7938c>22003\n<e7938f>5685\n<e79390>22004\n<e79393>22005\n<e79394>5686\n<e79396>18114\n<e79398>18115\n<e7939a>14842\n<e7939b>22007\n<e7939c>1245\n<e7939e>14843\n<e7939f>19545\n<e793a0>5688\n<e793a2>3501\n<e793a3>5689\n<e793a4>19546\n<e793a6>1504\n<e793a7>5690\n<e793a8>22008\n<e793a9>5691\n<e793aa>22009\n<e793ab>18116\n<e793ae>5692\n<e793af>14160\n<e793b2>5693\n<e793b4>19547\n<e793b6>3525\n<e793b7>5697\n<e793b8>5696\n<e793ba>18118\n<e793bb>19548\n<e793bc>22011\n<e793bf>16982\n<e79481>8564\n<e79483>5699\n<e79484>5698\n<e79485>5700\n<e79486>22012\n<e7948c>5701\n<e7948d>5703\n<e7948e>5702\n<e79492>22013\n<e79493>5705\n<e79496>19549\n<e79497>16983\n<e79498>1537\n<e7949a>2585\n<e7949c>3126\n<e7949e>5706\n<e7949f>2652\n<e794a0>18120\n<e794a1>19550\n<e794a2>13790\n<e794a3>2184\n<e794a4>18121\n<e794a5>1307\n<e794a7>22014\n<e794a8>3899\n<e794a9>22015\n<e794aa>18122\n<e794ab>3635\n<e794ac>5708\n<e794af>8434\n<e794b0>3134\n<e794b1>3869\n<e794b2>2005\n<e794b3>2563\n<e794b6>22016\n<e794b7>2953\n<e794b8>4297\n<e794b9>22017\n<e794ba>3018\n<e794bb>1384\n<e794bc>5709\n<e794bf>19551\n<e79580>18127\n<e79583>22018\n<e79584>5710\n<e79586>5715\n<e79587>22019\n<e79588>18128\n<e79589>5713\n<e7958a>5712\n<e7958b>5063\n<e7958c>1412\n<e7958d>5711\n<e7958e>14844\n<e7958f>1182\n<e79590>18129\n<e79591>3390\n<e79592>18130\n<e79594>3422\n<e79597>22020\n<e79599>3961\n<e7959a>5716\n<e7959b>5714\n<e7959c>2970\n<e7959d>2634\n<e7959e>19552\n<e7959f>22021\n<e795a0>3391\n<e795a1>22022\n<e795a2>3487\n<e795a4>5718\n<e795a5>3956\n<e795a6>1827\n<e795a7>5719\n<e795a9>5717\n<e795aa>3434\n<e795ab>5720\n<e795ac>15419\n<e795ad>5721\n<e795af>8565\n<e795b0>1183\n<e795b1>18132\n<e795b2>18131\n<e795b3>2526\n<e795b4>5726\n<e795b5>14161\n<e795b6>5723\n<e795b7>3269\n<e795b8>5722\n<e795b9>14845\n<e795ba>18133\n<e795bf>1600\n<e79681>14846\n<e79682>5729\n<e79685>22025\n<e79689>5728\n<e7968a>5727\n<e7968b>3479\n<e7968c>18136\n<e7968e>2756\n<e7968f>2755\n<e79690>14847\n<e79691>1625\n<e79694>5730\n<e79695>22026\n<e79699>19553\n<e7969a>5731\n<e7969c>22027\n<e7969d>5732\n<e796a2>18138\n<e796a3>5734\n<e796a4>19554\n<e796a5>5733\n<e796ab>1272\n<e796b0>18140\n<e796b1>5742\n<e796b2>3452\n<e796b3>5736\n<e796b4>14850\n<e796b5>5738\n<e796b7>18141\n<e796b8>5740\n<e796b9>2564\n<e796ba>22028\n<e796bd>5739\n<e796be>2284\n<e796bf>18142\n<e79780>18143\n<e79781>19555\n<e79782>5735\n<e79783>5737\n<e79784>19556\n<e79785>3508\n<e79786>18144\n<e79787>2481\n<e7978a>5744\n<e7978c>19557\n<e7978d>5743\n<e7978e>16985\n<e7978f>18145\n<e79792>5745\n<e79793>18146\n<e79794>2258\n<e79795>2079\n<e79797>19558\n<e79798>3185\n<e79799>5746\n<e7979b>3047\n<e7979c>19559\n<e7979d>18147\n<e7979e>5748\n<e797a1>19560\n<e797a2>3945\n<e797a3>5747\n<e797a4>14851\n<e797a7>18150\n<e797a9>2795\n<e797ac>14162\n<e797ae>18151\n<e797af>19561\n<e797b0>5753\n<e797b1>18152\n<e797b4>2962\n<e797b9>14852\n<e797ba>5754\n<e797bc>5751\n<e79880>14853\n<e79881>5752\n<e79882>16986\n<e79883>18153\n<e79884>19562\n<e79887>18155\n<e79888>16987\n<e79889>5759\n<e7988a>14854\n<e7988b>5757\n<e7988c>19563\n<e7988d>5758\n<e7988f>18156\n<e79892>22029\n<e79893>18159\n<e79898>18154\n<e79899>14857\n<e7989d>19564\n<e7989e>14858\n<e7989f>5760\n<e798a3>22030\n<e798a4>5765\n<e798a5>18163\n<e798a6>13893\n<e798a7>5761\n<e798a8>18164\n<e798a9>22031\n<e798ad>14859\n<e798b0>5767\n<e798b2>19565\n<e798b3>18166\n<e798b4>5766\n<e798b5>14860\n<e798b8>19566\n<e798bb>5768\n<e798bc>18165\n<e79980>22034\n<e79981>18169\n<e79982>3981\n<e79983>14861\n<e79984>22035\n<e79985>19567\n<e79986>5771\n<e79989>18171\n<e7998a>19568\n<e7998b>14862\n<e7998c>1566\n<e7998e>14163\n<e79992>3850\n<e79995>18172\n<e79996>3610\n<e79998>5773\n<e79999>22036\n<e7999c>5772\n<e7999f>19569\n<e799a4>16988\n<e799a5>14863\n<e799a7>5779\n<e799ac>5780\n<e799ad>14864\n<e799ae>18174\n<e799af>14865\n<e799b0>5781\n<e799b1>14866\n<e799b2>5782\n<e799b4>14867\n<e799b6>5783\n<e799b8>5784\n<e799ba>3395\n<e799bb>3146\n<e799bc>5785\n<e799bd>3368\n<e799be>3494\n<e79a80>5786\n<e79a81>16989\n<e79a82>8566\n<e79a83>5787\n<e79a84>3108\n<e79a85>22037\n<e79a86>1413\n<e79a87>2006\n<e79a88>5788\n<e79a8b>5789\n<e79a8e>5790\n<e79a90>2167\n<e79a93>5792\n<e79a95>18175\n<e79a96>5791\n<e79a9b>8569\n<e79a9c>8567\n<e79a9d>16990\n<e79a9e>8568\n<e79a9f>22040\n<e79aa0>18177\n<e79aa1>18176\n<e79aa6>8570\n<e79aaa>16991\n<e79aad>19570\n<e79aae>3453\n<e79aaf>18180\n<e79ab0>5795\n<e79ab4>5796\n<e79ab6>16992\n<e79ab7>7452\n<e79abd>19571\n<e79abf>2172\n<e79b81>22043\n<e79b82>5800\n<e79b83>3340\n<e79b85>14870\n<e79b86>3725\n<e79b88>1264\n<e79b89>18182\n<e79b8a>1273\n<e79b8b>22044\n<e79b8c>14871\n<e79b8d>5801\n<e79b8e>16993\n<e79b92>5803\n<e79b94>16994\n<e79b96>5802\n<e79b97>3178\n<e79b99>19572\n<e79b9b>2653\n<e79b9c>5336\n<e79b9e>5804\n<e79b9f>3789\n<e79ba0>22046\n<e79ba1>5805\n<e79ba3>1538\n<e79ba4>3435\n<e79ba5>5806\n<e79ba6>16995\n<e79ba7>5807\n<e79ba8>18184\n<e79baa>5808\n<e79bab>19573\n<e79bac>14872\n<e79bae>3816\n<e79bb0>19574\n<e79bb1>16996\n<e79bb2>3809\n<e79bb4>3034\n<e79bb6>22047\n<e79bb8>2796\n<e79bb9>19575\n<e79bbb>5810\n<e79bbc>14873\n<e79bbe>2412\n<e79c80>19576\n<e79c81>2482\n<e79c84>5813\n<e79c86>22048\n<e79c87>5812\n<e79c88>5811\n<e79c89>3473\n<e79c8a>16997\n<e79c8b>1539\n<e79c8c>1885\n<e79c8e>19577\n<e79c92>22049\n<e79c97>18186\n<e79c99>16998\n<e79c9a>18187\n<e79c9b>5819\n<e79c9c>22052\n<e79c9e>5816\n<e79c9f>2565\n<e79ca0>3774\n<e79ca2>19578\n<e79ca4>5815\n<e79ca8>19579\n<e79ca9>5814\n<e79cad>18188\n<e79cae>22053\n<e79caf>19580\n<e79cb4>14874\n<e79cb5>18189\n<e79cb6>14875\n<e79cb9>19581\n<e79cba>3019\n<e79cbc>1567\n<e79cbd>22054\n<e79cbe>19582\n<e79d80>2979\n<e79d82>22055\n<e79d85>19583\n<e79d86>8572\n<e79d87>5822\n<e79d8a>19584\n<e79d8f>19585\n<e79d92>22056\n<e79d98>18194\n<e79d9a>5823\n<e79d9b>5826\n<e79d9c>14876\n<e79d9e>19586\n<e79da1>2605\n<e79da2>7877\n<e79da3>3228\n<e79da4>19587\n<e79da5>5827\n<e79da6>3713\n<e79da7>19588\n<e79da8>5824\n<e79daa>14165\n<e79dab>5825\n<e79dac>19589\n<e79db0>22059\n<e79db2>14879\n<e79db9>5830\n<e79dba>17001\n<e79dbc>18196\n<e79dbd>14880\n<e79dbe>5829\n<e79dbf>5828\n<e79e80>17002\n<e79e84>19590\n<e79e8b>5832\n<e79e8e>5831\n<e79e91>5833\n<e79e94>17003\n<e79e95>14881\n<e79e96>19593\n<e79e9a>18199\n<e79e9e>5835\n<e79e9f>18200\n<e79ea0>5834\n<e79ea2>18201\n<e79ea4>18202\n<e79ea7>19594\n<e79ea9>14166\n<e79eaa>14882\n<e79eac>2400\n<e79ead>3982\n<e79eae>22064\n<e79eaf>19595\n<e79eb0>5836\n<e79eb1>22065\n<e79eb3>3215\n<e79eb5>22066\n<e79eb6>5837\n<e79eb7>19596\n<e79eb9>5838\n<e79ebb>5842\n<e79ebe>19597\n<e79ebf>5839\n<e79f83>22067\n<e79f87>5843\n<e79f89>19598\n<e79f8d>5844\n<e79f91>19599\n<e79f92>22068\n<e79f95>22069\n<e79f97>5845\n<e79f99>19600\n<e79f9a>5846\n<e79f9b>3779\n<e79f9c>5847\n<e79fa0>17004\n<e79fa2>3836\n<e79fa3>5848\n<e79fa4>18205\n<e79fa5>2956\n<e79fa6>14883\n<e79fa7>3360\n<e79fa9>1763\n<e79faa>18206\n<e79fac>18207\n<e79fad>2937\n<e79fae>5849\n<e79faf>1714\n<e79fb0>14884\n<e79fb1>19601\n<e79fb3>2676\n<e79fb4>14885\n<e79fb8>22070\n<e79fbb>18208\n<e79fbc>5850\n<e7a082>2093\n<e7a085>18210\n<e7a086>14886\n<e7a089>18211\n<e7a08c>5851\n<e7a08d>18212\n<e7a08e>22071\n<e7a091>22072\n<e7a092>5852\n<e7a094>1882\n<e7a095>2117\n<e7a099>18213\n<e7a09d>22073\n<e7a0a0>5854\n<e7a0a1>8574\n<e7a0a2>14887\n<e7a0a3>22074\n<e7a0a5>3152\n<e7a0a6>2118\n<e7a0a7>1640\n<e7a0ac>18214\n<e7a0b0>14890\n<e7a0b2>3666\n<e7a0b4>3329\n<e7a0b5>14891\n<e7a0b7>19602\n<e7a0ba>3153\n<e7a0bf>2030\n<e7a183>17006\n<e7a184>22075\n<e7a185>5856\n<e7a187>18215\n<e7a188>22076\n<e7a18c>22077\n<e7a18e>8575\n<e7a18f>13342\n<e7a191>15420\n<e7a192>22078\n<e7a19c>19603\n<e7a19d>2483\n<e7a19e>22079\n<e7a1a3>22082\n<e7a1a4>8576\n<e7a1a8>14892\n<e7a1aa>18216\n<e7a1ab>3962\n<e7a1ac>2007\n<e7a1ae>17007\n<e7a1af>1883\n<e7a1b2>3383\n<e7a1b4>5858\n<e7a1ba>8577\n<e7a1bc>5860\n<e7a1be>19604\n<e7a281>1951\n<e7a286>5859\n<e7a287>3090\n<e7a28a>18218\n<e7a28c>5862\n<e7a28d>1429\n<e7a28e>5857\n<e7a28f>22083\n<e7a291>3454\n<e7a293>1234\n<e7a294>18219\n<e7a295>2140\n<e7a297>4088\n<e7a298>19605\n<e7a29a>5861\n<e7a29d>18221\n<e7a29e>14893\n<e7a29f>18222\n<e7a2a1>19606\n<e7a2a3>5863\n<e7a2a4>18220\n<e7a2a7>3611\n<e7a2a8>22084\n<e7a2a9>2685\n<e7a2aa>5865\n<e7a2ac>22085\n<e7a2ad>17010\n<e7a2af>5866\n<e7a2b0>17008\n<e7a2b1>19607\n<e7a2b2>22086\n<e7a2b3>19608\n<e7a2b5>5864\n<e7a2ba>1452\n<e7a2bb>18223\n<e7a2bc>5872\n<e7a2bd>22087\n<e7a2be>5871\n<e7a2bf>22088\n<e7a381>2259\n<e7a385>5873\n<e7a386>5868\n<e7a387>22089\n<e7a388>14894\n<e7a389>19609\n<e7a38a>5874\n<e7a38b>5869\n<e7a38c>14895\n<e7a38e>14896\n<e7a390>3436\n<e7a391>5867\n<e7a392>22090\n<e7a393>19610\n<e7a394>5870\n<e7a395>18224\n<e7a396>22091\n<e7a39a>5877\n<e7a39b>22092\n<e7a39f>22093\n<e7a3a4>14897\n<e7a3a6>18225\n<e7a3a7>5876\n<e7a3a8>3727\n<e7a3aa>22094\n<e7a3ac>5875\n<e7a3af>1199\n<e7a3b2>14900\n<e7a3b3>22095\n<e7a3b4>5879\n<e7a3b6>22096\n<e7a3b7>14901\n<e7a3bb>14902\n<e7a3bd>5878\n<e7a3be>18228\n<e7a3bf>22097\n<e7a480>17011\n<e7a481>2484\n<e7a486>22098\n<e7a487>5880\n<e7a48c>19611\n<e7a48e>2757\n<e7a490>18230\n<e7a491>5882\n<e7a492>5881\n<e7a499>5883\n<e7a49a>22099\n<e7a49b>18231\n<e7a49c>17012\n<e7a49e>22100\n<e7a49f>19612\n<e7a4a0>22101\n<e7a4a5>18232\n<e7a4a6>5853\n<e7a4a9>22102\n<e7a4aa>5855\n<e7a4ab>5885\n<e7a4ac>5884\n<e7a4ad>22103\n<e7a4ae>17013\n<e7a4b0>8578\n<e7a4b1>14903\n<e7a4b4>17014\n<e7a4b5>22104\n<e7a4ba>2260\n<e7a4bb>14905\n<e7a4bc>4017\n<e7a4bd>14906\n<e7a4be>2302\n<e7a4bf>19615\n<e7a580>5886\n<e7a582>19616\n<e7a584>22105\n<e7a585>14907\n<e7a586>17015\n<e7a588>1601\n<e7a589>2225\n<e7a58a>18233\n<e7a58b>22106\n<e7a58f>22107\n<e7a590>3870\n<e7a591>22108\n<e7a593>5892\n<e7a594>19617\n<e7a595>5891\n<e7a596>2758\n<e7a597>5888\n<e7a598>18234\n<e7a59a>5890\n<e7a59d>2389\n<e7a59e>2566\n<e7a59f>5889\n<e7a5a0>5887\n<e7a5a2>3296\n<e7a5a5>2485\n<e7a5a7>18236\n<e7a5a8>3502\n<e7a5a9>22109\n<e7a5ab>19618\n<e7a5ad>2119\n<e7a5b2>18237\n<e7a5b7>3186\n<e7a5b9>17016\n<e7a5ba>5893\n<e7a5bb>22110\n<e7a5bc>19619\n<e7a5be>22111\n<e7a5bf>5894\n<e7a680>5916\n<e7a681>1744\n<e7a684>4067\n<e7a685>2743\n<e7a68a>5895\n<e7a68b>14910\n<e7a68c>22112\n<e7a68d>1362\n<e7a68e>3091\n<e7a68f>3569\n<e7a691>22113\n<e7a693>22114\n<e7a694>8582\n<e7a695>18238\n<e7a696>14911\n<e7a698>14912\n<e7a69b>8584\n<e7a69c>22115\n<e7a69d>5896\n<e7a6a1>18239\n<e7a6a6>1684\n<e7a6a7>5897\n<e7a6a8>22116\n<e7a6a9>18240\n<e7a6aa>5899\n<e7a6ab>19620\n<e7a6ae>5900\n<e7a6af>22117\n<e7a6b1>7758\n<e7a6b3>5901\n<e7a6b4>18241\n<e7a6b8>14913\n<e7a6bb>14914\n<e7a6bd>1745\n<e7a6be>1363\n<e7a6bf>3229\n<e7a780>2354\n<e7a781>2226\n<e7a782>18242\n<e7a784>19621\n<e7a787>18243\n<e7a788>17017\n<e7a789>5904\n<e7a78a>14915\n<e7a78b>2355\n<e7a78f>22118\n<e7a791>1354\n<e7a792>3509\n<e7a794>17019\n<e7a795>5905\n<e7a796>18246\n<e7a798>3455\n<e7a79a>14916\n<e7a79d>22119\n<e7a79e>17020\n<e7a79f>2759\n<e7a7a0>22120\n<e7a7a1>5908\n<e7a7a2>22121\n<e7a7a3>5909\n<e7a7a5>22122\n<e7a7a6>2567\n<e7a7a7>5906\n<e7a7a9>2975\n<e7a7aa>19622\n<e7a7ab>17021\n<e7a7ac>5907\n<e7a7ad>17022\n<e7a7b0>2486\n<e7a7b1>22123\n<e7a7b8>22124\n<e7a7bb>1184\n<e7a7bc>22125\n<e7a880>1603\n<e7a882>19623\n<e7a883>14917\n<e7a885>13875\n<e7a887>22126\n<e7a888>5910\n<e7a889>14918\n<e7a88a>18251\n<e7a88b>3092\n<e7a88c>19624\n<e7a88d>5911\n<e7a88e>2667\n<e7a891>14919\n<e7a894>3769\n<e7a895>18252\n<e7a89a>2963\n<e7a89b>18253\n<e7a89c>3983\n<e7a89e>14920\n<e7a89f>5915\n<e7a8a0>5914\n<e7a8a1>22127\n<e7a8a7>22128\n<e7a8ab>22129\n<e7a8ad>14921\n<e7a8ae>2331\n<e7a8af>22130\n<e7a8b0>19625\n<e7a8b1>5917\n<e7a8b2>1204\n<e7a8b7>5920\n<e7a8b8>18255\n<e7a8b9>14922\n<e7a8ba>19626\n<e7a8bb>5918\n<e7a8bc>1364\n<e7a8bd>1828\n<e7a8be>5919\n<e7a8bf>2008\n<e7a980>2052\n<e7a982>3638\n<e7a983>5921\n<e7a984>19627\n<e7a985>14923\n<e7a986>3714\n<e7a987>18256\n<e7a988>22133\n<e7a989>5923\n<e7a98c>14924\n<e7a98d>2677\n<e7a98e>1265\n<e7a98f>1338\n<e7a990>1136\n<e7a995>22134\n<e7a996>18257\n<e7a997>5922\n<e7a999>18258\n<e7a99c>18259\n<e7a99d>14925\n<e7a99f>18260\n<e7a9a0>20310\n<e7a9a3>2527\n<e7a9a5>22135\n<e7a9a7>18261\n<e7a9a9>5926\n<e7a9aa>18262\n<e7a9ab>1453\n<e7a9ad>14927\n<e7a9b0>5928\n<e7a9b4>1856\n<e7a9b5>18263\n<e7a9b6>1664\n<e7a9b8>14928\n<e7a9b9>5929\n<e7a9ba>1773\n<e7a9bd>5930\n<e7a9be>22136\n<e7aa80>19628\n<e7aa81>3237\n<e7aa82>18264\n<e7aa83>2692\n<e7aa84>2149\n<e7aa85>17023\n<e7aa86>19629\n<e7aa88>5931\n<e7aa8a>18265\n<e7aa8b>22137\n<e7aa90>18266\n<e7aa91>22138\n<e7aa92>2976\n<e7aa93>2797\n<e7aa94>19630\n<e7aa95>5933\n<e7aa96>5935\n<e7aa97>5932\n<e7aa98>5934\n<e7aa9e>22139\n<e7aa9f>1784\n<e7aaa0>14929\n<e7aaa3>14930\n<e7aaa9>5936\n<e7aaaa>1788\n<e7aaac>18267\n<e7aaae>1665\n<e7aaaf>3900\n<e7aab0>5938\n<e7aab3>14931\n<e7aab5>19631\n<e7aab6>5939\n<e7aab9>18270\n<e7aaba>1232\n<e7aabd>19632\n<e7aabe>18271\n<e7aabf>5942\n<e7ab83>1492\n<e7ab84>5941\n<e7ab85>5940\n<e7ab86>14934\n<e7ab87>5944\n<e7ab89>22140\n<e7ab8a>5945\n<e7ab8b>3953\n<e7ab8c>18273\n<e7ab8d>5946\n<e7ab8e>17025\n<e7ab8f>5947\n<e7ab91>8585\n<e7ab92>4549\n<e7ab93>5949\n<e7ab95>5948\n<e7ab9b>22141\n<e7ab9c>3965\n<e7ab9d>5952\n<e7ab9f>7176\n<e7aba0>2487\n<e7aba3>2401\n<e7aba5>3216\n<e7aba6>5955\n<e7aba7>8586\n<e7aba8>18274\n<e7aba9>22142\n<e7abaa>2918\n<e7abab>8588\n<e7abac>22143\n<e7abad>5956\n<e7abaf>2938\n<e7abb0>5957\n<e7abb1>22144\n<e7abb4>18275\n<e7abb6>1693\n<e7abb8>4214\n<e7abb9>2971\n<e7abba>2271\n<e7abbb>22145\n<e7abbd>17026\n<e7abbe>19633\n<e7abbf>1540\n<e7ac82>5958\n<e7ac84>5971\n<e7ac86>5961\n<e7ac87>14935\n<e7ac8a>5960\n<e7ac8b>5973\n<e7ac8f>5959\n<e7ac91>2488\n<e7ac92>17027\n<e7ac94>14936\n<e7ac9b>3109\n<e7ac9e>5965\n<e7ac9f>22146\n<e7aca0>1468\n<e7aca3>22147\n<e7aca5>2592\n<e7aca6>3542\n<e7aca7>14937\n<e7aca8>5967\n<e7aca9>22148\n<e7acaa>18280\n<e7acab>19634\n<e7acac>2888\n<e7acad>17028\n<e7acb0>22149\n<e7acb1>14938\n<e7acb3>5962\n<e7acb4>22150\n<e7acb5>5966\n<e7acb6>5968\n<e7acb9>2155\n<e7acbb>17029\n<e7acbd>18279\n<e7acbf>22151\n<e7ad80>22152\n<e7ad81>18286\n<e7ad85>5975\n<e7ad86>3488\n<e7ad87>14939\n<e7ad88>3386\n<e7ad89>3187\n<e7ad8b>1746\n<e7ad8c>5974\n<e7ad8d>5972\n<e7ad8e>14940\n<e7ad8f>3401\n<e7ad90>5969\n<e7ad91>2972\n<e7ad92>3189\n<e7ad93>14173\n<e7ad94>3188\n<e7ad95>18288\n<e7ad96>2150\n<e7ad9d>5993\n<e7ada0>14941\n<e7ada4>18290\n<e7ada5>5977\n<e7ada6>18291\n<e7ada7>5979\n<e7ada9>14942\n<e7adaa>22153\n<e7adac>5982\n<e7adad>14943\n<e7adae>5983\n<e7adaf>17030\n<e7adb2>14944\n<e7adb3>18292\n<e7adb4>5978\n<e7adb7>19635\n<e7adb9>18289\n<e7adba>5970\n<e7adbf>18285\n<e7ae84>22154\n<e7ae86>3615\n<e7ae87>1365\n<e7ae89>22155\n<e7ae8b>5990\n<e7ae8d>5987\n<e7ae8e>22156\n<e7ae8f>5992\n<e7ae90>18295\n<e7ae91>14945\n<e7ae92>5991\n<e7ae94>3369\n<e7ae95>3763\n<e7ae96>22157\n<e7ae97>2185\n<e7ae98>5985\n<e7ae99>5994\n<e7ae9a>5989\n<e7ae9b>18296\n<e7ae9c>5988\n<e7ae9d>5984\n<e7ae9e>8589\n<e7ae9f>5986\n<e7aea0>19636\n<e7aea1>1541\n<e7aea5>22158\n<e7aeaa>2939\n<e7aeac>19637\n<e7aeaf>14946\n<e7aeb0>19638\n<e7aeb1>3382\n<e7aeb2>22159\n<e7aeb4>5999\n<e7aeb5>18298\n<e7aeb6>22160\n<e7aebc>18299\n<e7aebd>22163\n<e7af80>2693\n<e7af81>5996\n<e7af82>22164\n<e7af84>3427\n<e7af85>18300\n<e7af86>6000\n<e7af88>22165\n<e7af89>2969\n<e7af8a>18301\n<e7af8b>5995\n<e7af8c>5997\n<e7af8f>5998\n<e7af94>18304\n<e7af96>18305\n<e7af97>14947\n<e7af99>14948\n<e7af9a>18306\n<e7af9b>22166\n<e7afa0>2288\n<e7afa4>3230\n<e7afa5>6006\n<e7afa6>6005\n<e7afa8>19639\n<e7afa9>6002\n<e7afaa>18307\n<e7afad>4060\n<e7afb0>18308\n<e7afb2>19640\n<e7afb3>6011\n<e7afb6>6015\n<e7afb7>6012\n<e7afb8>19641\n<e7afbc>19642\n<e7afbe>19643\n<e7b080>6008\n<e7b081>17031\n<e7b082>22171\n<e7b083>18309\n<e7b084>22172\n<e7b086>22173\n<e7b087>6009\n<e7b089>19644\n<e7b08b>14949\n<e7b08c>22174\n<e7b08d>6014\n<e7b08e>18310\n<e7b08f>14950\n<e7b091>6003\n<e7b092>4330\n<e7b093>6010\n<e7b094>6004\n<e7b097>6013\n<e7b099>22175\n<e7b09b>22176\n<e7b09e>7739\n<e7b09f>6019\n<e7b0a0>14951\n<e7b0a1>1542\n<e7b0a3>6016\n<e7b0a5>22177\n<e7b0a6>14952\n<e7b0a7>6017\n<e7b0a8>19645\n<e7b0aa>6018\n<e7b0ab>6021\n<e7b0ac>22178\n<e7b0af>19646\n<e7b0b1>14953\n<e7b0b3>17032\n<e7b0b4>22179\n<e7b0b6>14954\n<e7b0b7>6020\n<e7b0b8>3466\n<e7b0bd>6022\n<e7b0bf>3645\n<e7b180>6027\n<e7b182>19647\n<e7b183>6024\n<e7b185>18311\n<e7b186>22182\n<e7b18a>18312\n<e7b18c>6023\n<e7b18d>2678\n<e7b18f>6026\n<e7b190>6028\n<e7b191>14955\n<e7b194>6025\n<e7b195>22183\n<e7b196>6032\n<e7b197>18313\n<e7b198>6029\n<e7b199>14956\n<e7b19a>22184\n<e7b19e>18314\n<e7b19f>6030\n<e7b1a0>6007\n<e7b1a1>18315\n<e7b1a3>22185\n<e7b1a4>6031\n<e7b1a5>6033\n<e7b1a7>14957\n<e7b1a9>18316\n<e7b1ac>6034\n<e7b1ad>17034\n<e7b1ae>14958\n<e7b1af>18317\n<e7b1b0>14959\n<e7b1b2>19653\n<e7b1b3>3606\n<e7b1b5>6035\n<e7b1b9>17035\n<e7b1bb>14094\n<e7b1bc>22187\n<e7b1bd>19654\n<e7b281>1734\n<e7b283>6036\n<e7b286>22188\n<e7b287>19655\n<e7b289>3588\n<e7b28b>2606\n<e7b28d>3772\n<e7b28f>17036\n<e7b290>6037\n<e7b292>3963\n<e7b294>17037\n<e7b295>3370\n<e7b297>2760\n<e7b298>3306\n<e7b29b>2391\n<e7b29e>19656\n<e7b29f>1156\n<e7b2a0>17038\n<e7b2a1>6042\n<e7b2a2>6040\n<e7b2a4>6038\n<e7b2a5>1501\n<e7b2a6>18321\n<e7b2a7>2489\n<e7b2a8>6043\n<e7b2ab>6041\n<e7b2ad>6039\n<e7b2ae>6047\n<e7b2b0>22189\n<e7b2b1>6046\n<e7b2b2>6045\n<e7b2b3>6044\n<e7b2b9>6048\n<e7b2ba>19657\n<e7b2bb>22190\n<e7b2bc>14960\n<e7b2bd>6049\n<e7b2be>2654\n<e7b2bf>14961\n<e7b380>6050\n<e7b382>6052\n<e7b384>18326\n<e7b385>6051\n<e7b387>19658\n<e7b38a>1926\n<e7b38d>18328\n<e7b38e>2746\n<e7b38f>22191\n<e7b392>6054\n<e7b393>19659\n<e7b394>22192\n<e7b395>17039\n<e7b396>3190\n<e7b397>14964\n<e7b398>6053\n<e7b399>14965\n<e7b39a>19660\n<e7b39c>6055\n<e7b39d>14966\n<e7b39e>3589\n<e7b39f>2798\n<e7b3a0>2009\n<e7b3a2>6056\n<e7b3a6>18331\n<e7b3a7>3984\n<e7b3a9>22193\n<e7b3ab>14967\n<e7b3af>6058\n<e7b3b2>6059\n<e7b3b4>6060\n<e7b3b5>18333\n<e7b3b6>6061\n<e7b3b8>2227\n<e7b3ba>6062\n<e7b3bb>1829\n<e7b3be>1668\n<e7b480>1604\n<e7b482>6064\n<e7b483>18334\n<e7b484>3839\n<e7b485>2010\n<e7b486>6063\n<e7b48a>6067\n<e7b48b>3826\n<e7b48d>3314\n<e7b48f>22194\n<e7b490>3493\n<e7b491>22195\n<e7b492>18336\n<e7b493>14971\n<e7b494>2413\n<e7b495>6066\n<e7b496>22196\n<e7b497>2303\n<e7b498>2011\n<e7b499>2228\n<e7b49a>1667\n<e7b49b>3590\n<e7b49c>6065\n<e7b49d>14972\n<e7b49e>18337\n<e7b4a0>2761\n<e7b4a1>3696\n<e7b4a2>2151\n<e7b4a3>14973\n<e7b4a6>22197\n<e7b4aa>22198\n<e7b4ab>2229\n<e7b4ac>3065\n<e7b4ad>22199\n<e7b4ae>6070\n<e7b4af>4007\n<e7b4b0>2121\n<e7b4b1>17040\n<e7b4b2>6071\n<e7b4b3>2568\n<e7b4b5>6073\n<e7b4b9>2490\n<e7b4ba>2080\n<e7b4bc>19661\n<e7b4bf>6072\n<e7b580>18342\n<e7b581>14974\n<e7b582>2356\n<e7b583>1906\n<e7b584>2762\n<e7b585>6068\n<e7b586>6074\n<e7b587>18343\n<e7b588>8591\n<e7b58b>6069\n<e7b58c>1830\n<e7b58d>19662\n<e7b58e>6077\n<e7b58f>6081\n<e7b590>1857\n<e7b591>22200\n<e7b593>14975\n<e7b595>13882\n<e7b596>6076\n<e7b597>22201\n<e7b599>14976\n<e7b59a>18347\n<e7b59b>6085\n<e7b59c>17041\n<e7b59d>14977\n<e7b59e>2012\n<e7b5a1>3927\n<e7b5a2>1152\n<e7b5a3>6082\n<e7b5a5>22202\n<e7b5a6>1669\n<e7b5a7>22203\n<e7b5a8>6079\n<e7b5aa>18348\n<e7b5ae>6080\n<e7b5b0>18349\n<e7b5b1>3191\n<e7b5b2>6078\n<e7b5b3>6075\n<e7b5b5>1414\n<e7b5b6>2696\n<e7b5b8>22204\n<e7b5b9>1884\n<e7b5ba>14978\n<e7b5bb>22205\n<e7b5bd>6087\n<e7b5bf>18351\n<e7b681>22206\n<e7b682>19663\n<e7b683>17042\n<e7b685>19664\n<e7b686>14979\n<e7b688>18353\n<e7b689>6084\n<e7b68d>19665\n<e7b68f>6086\n<e7b691>19666\n<e7b693>6083\n<e7b696>22207\n<e7b697>18354\n<e7b699>1831\n<e7b69a>2835\n<e7b69b>6088\n<e7b69c>2800\n<e7b69d>18356\n<e7b69e>19667\n<e7b69f>6101\n<e7b6a0>8594\n<e7b6a2>6097\n<e7b6a3>6091\n<e7b6a6>17043\n<e7b6a7>18357\n<e7b6aa>18358\n<e7b6ab>6095\n<e7b6ac>2342\n<e7b6ad>1185\n<e7b6ae>6090\n<e7b6af>6098\n<e7b6b0>6102\n<e7b6b1>2013\n<e7b6b2>3810\n<e7b6b3>19668\n<e7b6b4>3058\n<e7b6b5>6092\n<e7b6b6>18359\n<e7b6b7>8593\n<e7b6b8>6100\n<e7b6b9>19669\n<e7b6ba>6089\n<e7b6bb>2940\n<e7b6bd>6094\n<e7b6be>1153\n<e7b6bf>3798\n<e7b780>18360\n<e7b782>17044\n<e7b787>6093\n<e7b78a>1747\n<e7b78b>3456\n<e7b78c>14982\n<e7b78f>2799\n<e7b790>19670\n<e7b791>3992\n<e7b792>2425\n<e7b795>6141\n<e7b796>8595\n<e7b797>18361\n<e7b798>6103\n<e7b799>18362\n<e7b79a>2722\n<e7b79c>6099\n<e7b79d>6104\n<e7b79e>6106\n<e7b7a0>3093\n<e7b7a1>6109\n<e7b7a2>22215\n<e7b7a3>13322\n<e7b7a4>6105\n<e7b7a5>19671\n<e7b7a6>18363\n<e7b7a8>3620\n<e7b7a9>1543\n<e7b7aa>22216\n<e7b7ab>14983\n<e7b7ac>3799\n<e7b7ad>22217\n<e7b7af>1186\n<e7b7b1>14984\n<e7b7b2>6108\n<e7b7b4>4037\n<e7b7b9>14985\n<e7b7ba>22218\n<e7b7bb>6107\n<e7b880>22214\n<e7b881>1297\n<e7b884>3268\n<e7b885>6110\n<e7b888>14986\n<e7b889>6117\n<e7b88a>6111\n<e7b88b>6118\n<e7b890>18367\n<e7b891>14987\n<e7b892>6114\n<e7b895>14988\n<e7b897>18368\n<e7b89b>3377\n<e7b89c>22219\n<e7b89d>18369\n<e7b89e>2294\n<e7b89f>6116\n<e7b8a0>14989\n<e7b8a1>6113\n<e7b8a2>6119\n<e7b8a3>6112\n<e7b8a6>2382\n<e7b8a7>18370\n<e7b8a8>17045\n<e7b8ab>3667\n<e7b8ac>18371\n<e7b8ad>22220\n<e7b8ae>2390\n<e7b8af>19674\n<e7b8b1>6115\n<e7b8b2>6127\n<e7b8b3>22221\n<e7b8b5>6123\n<e7b8b6>19675\n<e7b8b7>6126\n<e7b8b9>6124\n<e7b8ba>6128\n<e7b8bb>6122\n<e7b8bd>6096\n<e7b8be>2679\n<e7b8bf>22222\n<e7b981>3423\n<e7b983>6125\n<e7b984>19676\n<e7b985>18372\n<e7b986>6120\n<e7b987>14990\n<e7b988>14183\n<e7b98a>2723\n<e7b98b>1832\n<e7b98d>2357\n<e7b98e>22223\n<e7b990>22224\n<e7b992>8596\n<e7b994>2539\n<e7b995>2744\n<e7b996>6131\n<e7b998>22225\n<e7b99d>6130\n<e7b99e>6132\n<e7b99f>22226\n<e7b9a1>7697\n<e7b9a2>14991\n<e7b9a5>22227\n<e7b9a6>6121\n<e7b9a7>6129\n<e7b9a9>6137\n<e7b9aa>6136\n<e7b9ab>7671\n<e7b9ad>3752\n<e7b9ae>14992\n<e7b9af>19677\n<e7b9b0>1793\n<e7b9b3>14993\n<e7b9b5>18373\n<e7b9b8>19678\n<e7b9b9>6135\n<e7b9bb>6139\n<e7b9bc>6138\n<e7b9bd>6142\n<e7b9be>18374\n<e7b9bf>6144\n<e7ba81>19679\n<e7ba82>2186\n<e7ba83>6140\n<e7ba8a>8359\n<e7ba8c>6147\n<e7ba8d>14994\n<e7ba8e>6153\n<e7ba8f>3125\n<e7ba90>6149\n<e7ba91>14995\n<e7ba92>6148\n<e7ba95>22228\n<e7ba96>6152\n<e7ba98>14996\n<e7ba9a>18378\n<e7bcb6>1544\n<e7bcb8>6156\n<e7bcba>6157\n<e7bcbb>18381\n<e7bcbc>18380\n<e7bcbd>19680\n<e7bcbe>18382\n<e7bcbf>22231\n<e7bd83>18383\n<e7bd84>14997\n<e7bd85>6158\n<e7bd87>8597\n<e7bd8f>14998\n<e7bd94>6165\n<e7bd95>6164\n<e7bd98>6166\n<e7bd9b>19681\n<e7bd9c>22232\n<e7bd9d>19682\n<e7bda1>15001\n<e7bda5>19683\n<e7bda6>22233\n<e7bda7>6171\n<e7bdaa>2129\n<e7bdab>1833\n<e7bdad>18389\n<e7bdae>2964\n<e7bdb0>3399\n<e7bdb1>19684\n<e7bdb2>2426\n<e7bdb5>3331\n<e7bdb7>3457\n<e7bdb8>6172\n<e7bdb9>4918\n<e7bdbf>19685\n<e7be80>19686\n<e7be82>6173\n<e7be83>6175\n<e7be85>3919\n<e7be86>6174\n<e7be87>6177\n<e7be88>6176\n<e7be8a>3901\n<e7be8b>19687\n<e7be8c>6178\n<e7be8d>22235\n<e7be8e>3474\n<e7be8f>22236\n<e7be90>18392\n<e7be91>15002\n<e7be94>6179\n<e7be96>18395\n<e7be97>17046\n<e7be9a>6182\n<e7be9c>18396\n<e7be9d>6181\n<e7be9e>6180\n<e7bea1>8598\n<e7bea2>19688\n<e7bea3>6183\n<e7bea4>1800\n<e7bea6>22237\n<e7bea8>2724\n<e7bea9>1627\n<e7beaa>22238\n<e7bead>18397\n<e7beae>6187\n<e7beaf>6184\n<e7beb2>6185\n<e7beb4>22239\n<e7beb6>6188\n<e7beb8>6189\n<e7beb9>6186\n<e7bebc>22240\n<e7bebd>1227\n<e7bebf>15003\n<e7bf80>22241\n<e7bf81>1319\n<e7bf83>18399\n<e7bf88>22242\n<e7bf8a>6193\n<e7bf8c>3916\n<e7bf8e>15004\n<e7bf8f>18400\n<e7bf92>2358\n<e7bf94>6195\n<e7bf95>6194\n<e7bf9b>17047\n<e7bf9f>15005\n<e7bfa0>2607\n<e7bfa1>6196\n<e7bfa3>18401\n<e7bfa5>15006\n<e7bfa6>6197\n<e7bfa8>22243\n<e7bfa9>6198\n<e7bfac>15007\n<e7bfb2>18402\n<e7bfb3>6199\n<e7bfb9>6200\n<e7bfba>15010\n<e7bfbb>3723\n<e7bfbc>3917\n<e88080>3902\n<e88081>4061\n<e88082>14099\n<e88083>2015\n<e88084>6203\n<e88085>2304\n<e88086>6202\n<e88087>19692\n<e88088>18404\n<e8808a>18403\n<e8808b>6204\n<e8808c>2261\n<e8808d>19693\n<e8808e>15011\n<e8808f>22244\n<e88090>2865\n<e88091>15012\n<e88092>6205\n<e88093>22245\n<e88094>15013\n<e88095>2014\n<e88096>18405\n<e88097>3811\n<e8809c>6208\n<e8809d>22246\n<e8809e>19694\n<e880a1>6209\n<e880a4>15014\n<e880a6>15015\n<e880a8>6210\n<e880ac>18406\n<e880ae>22249\n<e880b0>18407\n<e880b3>2262\n<e880b4>22250\n<e880b5>17048\n<e880b6>3833\n<e880b7>17049\n<e880b9>19695\n<e880ba>15016\n<e880bb>6212\n<e880bc>15017\n<e880bd>2941\n<e880be>22251\n<e880bf>6211\n<e88180>22252\n<e88183>18408\n<e88184>22253\n<e88186>6214\n<e8818a>6213\n<e88192>6215\n<e88196>2655\n<e88198>6216\n<e8819a>6217\n<e8819e>3593\n<e8819f>6218\n<e881a0>15018\n<e881a1>2801\n<e881a2>6219\n<e881a4>22254\n<e881a6>18409\n<e881a8>6220\n<e881ad>22255\n<e881af>4038\n<e881b0>6223\n<e881b1>15019\n<e881b2>6222\n<e881b3>6221\n<e881b4>3020\n<e881b5>15020\n<e881b6>6224\n<e881b7>2540\n<e881b9>6225\n<e881bb>18410\n<e881bd>6226\n<e881be>4062\n<e881bf>6227\n<e88281>22256\n<e88284>6228\n<e88285>6230\n<e88286>6229\n<e88287>3385\n<e88288>19696\n<e88289>3281\n<e8828b>4068\n<e8828c>3389\n<e8828e>19697\n<e88293>6232\n<e88296>2491\n<e88298>3484\n<e88299>18411\n<e8829a>6233\n<e8829b>6231\n<e8829c>18412\n<e8829d>1546\n<e8829e>15021\n<e882a1>1928\n<e882a2>2230\n<e882a4>18413\n<e882a5>3458\n<e882a6>15022\n<e882a7>18414\n<e882a9>1886\n<e882aa>3697\n<e882ab>15023\n<e882ac>6236\n<e882ad>6234\n<e882af>2016\n<e882b1>2017\n<e882b2>1197\n<e882b4>2136\n<e882b8>18415\n<e882b9>22257\n<e882ba>3343\n<e88383>1187\n<e88384>6241\n<e88385>18417\n<e88386>2942\n<e88388>22258\n<e8838a>17050\n<e8838c>3342\n<e8838d>22259\n<e8838e>2875\n<e8838f>19698\n<e88392>22260\n<e88394>19699\n<e88395>18418\n<e88396>6243\n<e88399>6239\n<e8839a>6242\n<e8839b>6237\n<e8839d>6240\n<e8839e>3668\n<e883a0>17051\n<e883a1>1929\n<e883a4>1217\n<e883a5>6238\n<e883a6>18419\n<e883ad>19700\n<e883ae>22261\n<e883af>6245\n<e883b0>19701\n<e883b1>6246\n<e883b2>22262\n<e883b3>17052\n<e883b4>3217\n<e883b5>18421\n<e883b6>22263\n<e883b7>19702\n<e883b8>1715\n<e883b9>22264\n<e883ba>19703\n<e883bb>18422\n<e883bc>6257\n<e883bd>3315\n<e883be>19704\n<e88482>2231\n<e88483>19705\n<e88485>1716\n<e88486>2668\n<e88487>4076\n<e88488>3770\n<e88489>6244\n<e8848a>2680\n<e8848b>22265\n<e8848d>18420\n<e88496>15026\n<e88497>19706\n<e88498>15027\n<e8849a>1645\n<e8849b>6247\n<e8849c>22266\n<e8849e>18425\n<e884a0>22267\n<e884a3>6249\n<e884a4>18427\n<e884a7>18428\n<e884a9>6248\n<e884ab>13913\n<e884ac>18429\n<e884af>6250\n<e884b0>19707\n<e884b1>2916\n<e884b3>3316\n<e884b5>18424\n<e884b9>3021\n<e884ba>15028\n<e884bc>22268\n<e884bd>18431\n<e884be>6254\n<e88581>14194\n<e88585>22269\n<e88586>6253\n<e88587>22270\n<e8858a>15029\n<e8858b>6251\n<e8858c>15030\n<e8858e>2587\n<e88590>3543\n<e88591>6256\n<e88592>22271\n<e88593>6255\n<e88594>2018\n<e88595>4089\n<e88597>19708\n<e8859f>6272\n<e885a0>17053\n<e885a1>22272\n<e885a9>18433\n<e885ab>2332\n<e885ad>17056\n<e885ae>6259\n<e885af>19709\n<e885b0>2058\n<e885b3>19710\n<e885b4>6262\n<e885b7>22273\n<e885b8>3022\n<e885b9>3570\n<e885ba>2725\n<e88680>6266\n<e88681>15031\n<e88682>6267\n<e88683>6263\n<e88684>15032\n<e88685>18436\n<e88686>22274\n<e88688>6264\n<e8868a>6265\n<e8868b>19711\n<e8868e>22275\n<e8868f>2019\n<e88690>19712\n<e88693>6273\n<e88695>6269\n<e88696>22276\n<e88698>18438\n<e8869a>3544\n<e8869b>19713\n<e8869c>3738\n<e8869d>3482\n<e8869e>19714\n<e886a0>6268\n<e886a2>22277\n<e886a3>6271\n<e886a4>6270\n<e886a8>3698\n<e886a9>6274\n<e886ae>22278\n<e886b0>6275\n<e886b2>18439\n<e886b3>2745\n<e886b4>15033\n<e886b5>6276\n<e886b8>6278\n<e886ba>6282\n<e886bb>17057\n<e886bd>6279\n<e886be>6277\n<e886bf>3317\n<e88780>6280\n<e88781>18440\n<e88782>6281\n<e88783>18441\n<e88785>22279\n<e88786>1330\n<e88788>6288\n<e88789>6283\n<e8878a>17058\n<e8878b>19715\n<e8878d>6284\n<e8878e>22280\n<e8878f>15034\n<e88791>6285\n<e88793>2817\n<e88795>19716\n<e88796>18442\n<e88797>17059\n<e88798>6287\n<e88799>6286\n<e8879a>6289\n<e8879b>18443\n<e887a1>19719\n<e887a3>2569\n<e887a4>18445\n<e887a5>1385\n<e887a7>6292\n<e887a8>3999\n<e887aa>2263\n<e887ab>22281\n<e887ac>18447\n<e887ad>2359\n<e887af>19720\n<e887b3>2232\n<e887b4>2965\n<e887b5>22285\n<e887b6>19721\n<e887b8>22286\n<e887b9>15035\n<e887bc>1235\n<e887bd>18448\n<e887be>6295\n<e887bf>18449\n<e88880>19722\n<e88883>15036\n<e88884>18451\n<e88885>6298\n<e88887>6299\n<e88888>1717\n<e88889>5039\n<e8888a>6300\n<e8888b>19723\n<e8888c>2697\n<e8888d>6301\n<e8888e>2295\n<e8888f>22288\n<e88890>6302\n<e88892>4105\n<e88896>6303\n<e88897>3630\n<e88898>1560\n<e88899>18453\n<e8889a>19726\n<e8889b>2726\n<e8889c>2402\n<e8889d>22289\n<e8889e>3555\n<e8889f>2360\n<e888a1>15037\n<e888a2>18454\n<e888a8>22290\n<e888a9>6304\n<e888aa>2020\n<e888ab>6305\n<e888ac>3424\n<e888ae>6319\n<e888b2>15038\n<e888b3>6307\n<e888b4>15039\n<e888b5>2857\n<e888b6>3371\n<e888b7>1907\n<e888b8>6306\n<e888b9>2727\n<e888ba>19727\n<e888bc>18456\n<e88980>6308\n<e88983>22291\n<e88984>19728\n<e88985>18458\n<e88986>15040\n<e88987>3094\n<e88989>18457\n<e8898b>15041\n<e8898e>22292\n<e8898f>15042\n<e88991>22293\n<e88996>22294\n<e88997>18462\n<e88999>6309\n<e8899a>6312\n<e8899c>18464\n<e8899d>6311\n<e8899f>6313\n<e889a0>17061\n<e889a2>6315\n<e889a3>18465\n<e889a4>6314\n<e889a6>1547\n<e889a7>22295\n<e889a8>6316\n<e889ad>19729\n<e889ae>2081\n<e889af>3985\n<e889b1>6320\n<e889b2>2541\n<e889b4>17062\n<e889b6>1298\n<e889b9>14197\n<e889bb>22296\n<e889bd>18468\n<e889be>6323\n<e889bf>18469\n<e88a83>18470\n<e88a84>19730\n<e88a87>22299\n<e88a89>19731\n<e88a8a>18471\n<e88a8b>1206\n<e88a8d>6324\n<e88a8e>15043\n<e88a91>19732\n<e88a93>18472\n<e88a94>22300\n<e88a96>22301\n<e88a98>22302\n<e88a99>3545\n<e88a9d>2291\n<e88a9f>6327\n<e88aa0>22305\n<e88aa1>17064\n<e88aa5>1415\n<e88aa9>17067\n<e88aaa>19733\n<e88aab>6326\n<e88aac>6329\n<e88aad>3332\n<e88aae>15044\n<e88aaf>2570\n<e88ab0>19734\n<e88ab1>1366\n<e88ab2>18475\n<e88ab3>3669\n<e88ab4>18476\n<e88ab7>15045\n<e88ab8>1843\n<e88ab9>1748\n<e88aba>18477\n<e88abb>6328\n<e88abc>18478\n<e88abd>1386\n<e88abe>15046\n<e88abf>17068\n<e88b85>1503\n<e88b86>15047\n<e88b90>19735\n<e88b91>1299\n<e88b92>6333\n<e88b93>4018\n<e88b94>2877\n<e88b95>17069\n<e88b97>3510\n<e88b99>6345\n<e88b9a>22306\n<e88b9b>1367\n<e88b9c>6343\n<e88b9e>6341\n<e88b9f>6332\n<e88ba0>22307\n<e88ba1>6330\n<e88ba2>18479\n<e88ba3>6331\n<e88ba4>22308\n<e88ba5>2319\n<e88ba6>1764\n<e88ba7>2997\n<e88ba8>18480\n<e88baa>19736\n<e88bab>3241\n<e88bad>22309\n<e88baf>19737\n<e88bb1>1267\n<e88bb3>6335\n<e88bb4>6334\n<e88bb6>19738\n<e88bb7>18481\n<e88bb9>6340\n<e88bba>6336\n<e88bbb>6339\n<e88bbd>17070\n<e88bbe>15048\n<e88c80>17071\n<e88c81>8600\n<e88c82>3804\n<e88c83>6338\n<e88c84>1368\n<e88c85>1499\n<e88c86>6342\n<e88c89>6344\n<e88c8c>18484\n<e88c8e>1834\n<e88c96>6348\n<e88c9b>18486\n<e88c9c>1135\n<e88c9d>18487\n<e88ca1>22314\n<e88ca2>17072\n<e88ca3>6365\n<e88cab>6356\n<e88cac>22315\n<e88cad>17073\n<e88cae>22316\n<e88caf>6355\n<e88cb0>18488\n<e88cb1>6350\n<e88cb2>6349\n<e88cb3>22317\n<e88cb4>6347\n<e88cb5>6346\n<e88cb6>2977\n<e88cb7>22318\n<e88cb8>2907\n<e88cb9>6352\n<e88cba>17074\n<e88cbc>18489\n<e88cbd>22319\n<e88d80>6351\n<e88d82>22320\n<e88d83>15049\n<e88d84>18490\n<e88d85>6354\n<e88d86>7672\n<e88d87>17075\n<e88d89>2802\n<e88d8a>1835\n<e88d8f>1251\n<e88d90>6353\n<e88d91>15050\n<e88d92>2021\n<e88d93>22332\n<e88d94>18485\n<e88d95>15051\n<e88d96>19739\n<e88d97>18491\n<e88d98>2803\n<e88d9a>14202\n<e88da2>8601\n<e88da3>17775\n<e88db0>22323\n<e88db3>6371\n<e88db5>6372\n<e88db7>1369\n<e88db8>19740\n<e88dbb>1326\n<e88dbc>6369\n<e88dbd>17076\n<e88dbf>8602\n<e88e80>22324\n<e88e82>22325\n<e88e84>22326\n<e88e85>6359\n<e88e86>15052\n<e88e87>6367\n<e88e89>6374\n<e88e8a>6368\n<e88e8d>15053\n<e88e8e>6366\n<e88e92>15054\n<e88e93>6337\n<e88e96>6364\n<e88e98>15055\n<e88e99>22327\n<e88e9a>6360\n<e88e9b>18497\n<e88e9c>22328\n<e88e9d>18498\n<e88e9e>1548\n<e88e9f>6362\n<e88ea0>6373\n<e88ea2>6363\n<e88ea6>22329\n<e88ea7>17077\n<e88ea8>6375\n<e88ea9>15056\n<e88eaa>6361\n<e88eab>3378\n<e88eac>22330\n<e88ead>22335\n<e88eb1>3923\n<e88eb5>6370\n<e88ebd>6392\n<e88ebe>22331\n<e88ebf>15057\n<e88f80>15058\n<e88f81>6384\n<e88f85>2625\n<e88f87>8603\n<e88f89>18499\n<e88f8a>1632\n<e88f8c>1749\n<e88f8e>6379\n<e88f8f>17078\n<e88f90>18500\n<e88f91>17079\n<e88f93>1371\n<e88f94>18501\n<e88f96>2492\n<e88f98>6382\n<e88f9c>2122\n<e88f9d>18502\n<e88f9f>3147\n<e88fa0>6387\n<e88fa1>17080\n<e88fa5>18503\n<e88fa8>22333\n<e88fa9>3646\n<e88faa>15059\n<e88fab>6378\n<e88faf>1370\n<e88fb0>1930\n<e88fb1>3483\n<e88fb2>6388\n<e88fb4>6376\n<e88fb6>8604\n<e88fb7>6385\n<e88fb8>19741\n<e88fb9>18504\n<e88fbb>6395\n<e88fbc>19742\n<e88fbd>6380\n<e89081>17081\n<e89083>6381\n<e89084>3218\n<e89086>17082\n<e89087>6386\n<e8908a>7807\n<e8908b>6383\n<e8908c>3670\n<e8908d>6389\n<e8908e>1188\n<e8908f>15060\n<e89091>15061\n<e89093>6377\n<e89095>18505\n<e89097>18507\n<e89099>22334\n<e890a0>6391\n<e890a2>6390\n<e890a9>3361\n<e890aa>6397\n<e890ac>6408\n<e890af>22336\n<e890b1>1500\n<e890b5>6411\n<e890b8>6393\n<e890b9>18508\n<e890bc>6398\n<e890bd>3928\n<e89185>22337\n<e89186>6407\n<e89187>22338\n<e89188>8605\n<e89189>3903\n<e8918a>15062\n<e8918d>22339\n<e8918e>3954\n<e8918f>18509\n<e89196>22340\n<e89197>2998\n<e89198>19743\n<e8919c>18514\n<e8919f>17083\n<e891a0>22342\n<e891a1>3556\n<e891a2>6413\n<e891a3>3193\n<e891a4>22343\n<e891a5>18516\n<e891a6>1141\n<e891a7>22344\n<e891a9>6406\n<e891aa>22345\n<e891ab>6402\n<e891ac>2804\n<e891ad>6396\n<e891ae>6404\n<e891af>6409\n<e891b0>17084\n<e891b1>3298\n<e891b3>17085\n<e891b4>22346\n<e891b5>1134\n<e891b6>15063\n<e891b7>6401\n<e891b8>18517\n<e891b9>6410\n<e891ba>3562\n<e891bc>18518\n<e891bd>22347\n<e89281>18519\n<e89282>6405\n<e89284>6400\n<e89285>17086\n<e8928b>2493\n<e89290>2361\n<e89292>22348\n<e89293>19744\n<e89294>2264\n<e89295>22349\n<e89297>18521\n<e89299>3812\n<e8929c>3513\n<e8929e>17087\n<e8929f>6416\n<e892a1>6425\n<e892a6>18522\n<e892a8>15064\n<e892ad>6403\n<e892af>15065\n<e892b1>19745\n<e892b2>1493\n<e892b4>8606\n<e892b8>2528\n<e892b9>6414\n<e892ba>17088\n<e892bb>6419\n<e892bc>2805\n<e892bd>19746\n<e892be>18523\n<e892bf>6415\n<e89380>15066\n<e89381>6422\n<e89382>15067\n<e89384>2973\n<e89386>6423\n<e89389>3904\n<e8938a>6412\n<e8938b>1430\n<e8938c>22354\n<e8938d>6418\n<e89390>6421\n<e89391>3768\n<e89393>18527\n<e89396>6424\n<e89399>6417\n<e8939a>6420\n<e8939c>8363\n<e893a7>18529\n<e893aa>18530\n<e893ae>4039\n<e893af>18531\n<e893b0>15068\n<e893b1>18532\n<e893b2>22355\n<e893b4>6428\n<e893b7>22356\n<e893ba>18533\n<e893bb>19747\n<e893bc>6435\n<e893bd>15069\n<e893bf>6427\n<e89480>2287\n<e89486>6394\n<e89487>22359\n<e8948c>15070\n<e8948e>22360\n<e89490>22361\n<e89493>3758\n<e89494>6434\n<e89495>6433\n<e8949a>1240\n<e8949b>18534\n<e8949c>22362\n<e8949e>17091\n<e8949f>6432\n<e894a1>6426\n<e894a2>22363\n<e894a3>7706\n<e894a6>3057\n<e894a7>22364\n<e894aa>22365\n<e894ab>18537\n<e894ac>6431\n<e894ad>1218\n<e894af>17092\n<e894b2>17090\n<e894b3>22366\n<e894b4>15071\n<e894b5>2818\n<e894b6>22367\n<e894be>7861\n<e894bf>22368\n<e89580>6436\n<e89581>6440\n<e89583>3437\n<e89586>19748\n<e89588>6439\n<e89589>2494\n<e8958a>2293\n<e8958b>6442\n<e8958e>1718\n<e8958f>18538\n<e89590>22369\n<e89591>18541\n<e89592>22370\n<e89593>8607\n<e89595>6443\n<e89596>19749\n<e89597>3563\n<e89598>6438\n<e89599>8608\n<e8959a>6399\n<e8959c>22371\n<e8959d>19750\n<e8959e>15072\n<e895a3>6437\n<e895a4>17093\n<e895a8>4085\n<e895a9>3194\n<e895aa>3557\n<e895ab>8609\n<e895ad>6450\n<e895af>18539\n<e895b7>6456\n<e895b9>22375\n<e895ba>17094\n<e895bb>18545\n<e895bd>18546\n<e895be>6457\n<e895bf>18547\n<e89680>6444\n<e89681>18548\n<e89684>3372\n<e89685>19751\n<e89686>18549\n<e89687>6454\n<e89688>6446\n<e89689>22376\n<e8968a>6448\n<e8968b>22377\n<e8968c>17095\n<e8968f>15073\n<e89690>6458\n<e89691>6447\n<e89693>18550\n<e89694>6451\n<e89697>1300\n<e89698>19752\n<e89699>3261\n<e8969b>6452\n<e8969c>6455\n<e8969d>18551\n<e8969f>18552\n<e896a0>22378\n<e896a2>17096\n<e896a4>6445\n<e896a5>22379\n<e896a6>2728\n<e896a7>22380\n<e896a8>6449\n<e896aa>2571\n<e896ab>1798\n<e896ac>3840\n<e896ad>15076\n<e896ae>3845\n<e896b0>8611\n<e896b4>22381\n<e896b6>22382\n<e896b7>15074\n<e896b8>22383\n<e896b9>6462\n<e896ba>6460\n<e896bc>18556\n<e89781>4084\n<e89782>22387\n<e89787>18557\n<e89789>6459\n<e8978a>18558\n<e8978b>17097\n<e8978d>3935\n<e8978e>15075\n<e8978f>6461\n<e89790>6463\n<e89795>6464\n<e8979a>22388\n<e8979c>6467\n<e8979d>6465\n<e8979f>18561\n<e897a0>22389\n<e897a1>18562\n<e897a4>3195\n<e897a5>6466\n<e897a6>18563\n<e897a8>22390\n<e897a9>3425\n<e897aa>6453\n<e897ad>17098\n<e897b3>22391\n<e897b4>14208\n<e897b6>18564\n<e897b9>6468\n<e897ba>6473\n<e897bb>2806\n<e897bc>22392\n<e897be>6472\n<e897bf>17099\n<e89880>18565\n<e89882>6441\n<e89886>6474\n<e89887>2763\n<e8988a>6469\n<e8988b>6471\n<e89890>17102\n<e89891>18566\n<e89892>15077\n<e89893>6470\n<e89896>5328\n<e89897>5313\n<e89898>17104\n<e89899>22395\n<e8989a>6476\n<e8989b>22396\n<e8989e>18567\n<e898a1>18568\n<e898a2>6475\n<e898a4>18569\n<e898a7>18570\n<e898a9>15078\n<e898ad>3936\n<e898af>5809\n<e898b0>6477\n<e898b6>22397\n<e898b8>17105\n<e898b9>18572\n<e898ba>22398\n<e898bc>18573\n<e898bd>22399\n<e898bf>6478\n<e89980>18575\n<e89981>16824\n<e89982>19753\n<e89986>19754\n<e8998d>6479\n<e8998e>1931\n<e89990>1646\n<e89992>15079\n<e89993>18576\n<e89995>4244\n<e89996>18577\n<e89997>17106\n<e8999a>1679\n<e8999b>13336\n<e8999c>3970\n<e8999d>22402\n<e8999e>1771\n<e8999f>6482\n<e899a2>17107\n<e899a3>15080\n<e899a4>22405\n<e899a7>6483\n<e899a9>22406\n<e899ab>2988\n<e899ac>15081\n<e899af>15082\n<e899b1>6484\n<e899b5>17109\n<e899b6>22407\n<e899b7>18578\n<e899b9>3282\n<e899ba>15083\n<e899bb>1150\n<e899bd>14214\n<e89a87>18579\n<e89a88>22425\n<e89a89>18580\n<e89a8a>1379\n<e89a8d>15084\n<e89a91>15085\n<e89a93>6485\n<e89a95>2187\n<e89a96>22408\n<e89a98>15086\n<e89a9a>22409\n<e89aa1>22410\n<e89aa3>6486\n<e89aa4>3320\n<e89aa6>22411\n<e89aab>6498\n<e89aad>22412\n<e89aaf>6492\n<e89ab0>6495\n<e89ab1>18583\n<e89ab3>18584\n<e89ab6>6491\n<e89ab7>22415\n<e89ab8>17110\n<e89ab9>22416\n<e89abf>22417\n<e89b80>19755\n<e89b81>18585\n<e89b83>18586\n<e89b84>6493\n<e89b85>22418\n<e89b86>6494\n<e89b87>2308\n<e89b89>6496\n<e89b8b>2943\n<e89b8d>1836\n<e89b8e>1440\n<e89b91>18587\n<e89b92>22419\n<e89b94>6499\n<e89b95>18588\n<e89b97>18589\n<e89b99>1437\n<e89b9a>22420\n<e89b9b>6504\n<e89b9c>22421\n<e89b9e>6500\n<e89b9f>6503\n<e89ba0>22422\n<e89ba3>18590\n<e89ba4>3406\n<e89ba5>22423\n<e89ba6>18591\n<e89ba7>22424\n<e89ba9>6501\n<e89bac>6502\n<e89bad>3514\n<e89bae>3438\n<e89baf>6505\n<e89bb9>6515\n<e89bba>15089\n<e89bbb>6511\n<e89bbc>17111\n<e89bbd>15090\n<e89bbe>1387\n<e89c80>6509\n<e89c82>3672\n<e89c84>22426\n<e89c85>18593\n<e89c86>6507\n<e89c87>18594\n<e89c88>6508\n<e89c89>6513\n<e89c8a>6516\n<e89c8b>15091\n<e89c8d>6514\n<e89c8e>18595\n<e89c8f>22427\n<e89c90>18596\n<e89c91>6512\n<e89c92>6506\n<e89c93>15092\n<e89c94>19756\n<e89c98>2966\n<e89c99>15093\n<e89c9a>6523\n<e89c9c>3766\n<e89c9e>15094\n<e89c9f>18597\n<e89ca1>18598\n<e89ca2>19757\n<e89ca3>18599\n<e89ca5>6521\n<e89ca8>15095\n<e89ca9>6522\n<e89cae>19758\n<e89caf>22428\n<e89cb1>18600\n<e89cb2>22429\n<e89cb4>6517\n<e89cb7>6519\n<e89cb9>19759\n<e89cba>18601\n<e89cbb>6520\n<e89cbe>15096\n<e89cbf>6518\n<e89d80>18602\n<e89d83>18603\n<e89d85>22432\n<e89d89>2698\n<e89d8b>4063\n<e89d8c>6527\n<e89d8d>22433\n<e89d8e>6528\n<e89d91>18604\n<e89d93>6534\n<e89d97>6530\n<e89d98>18605\n<e89d99>6533\n<e89d9d>19760\n<e89d9f>6525\n<e89da0>6524\n<e89da1>22434\n<e89da3>6535\n<e89da6>1372\n<e89da8>6531\n<e89daa>6536\n<e89dae>6532\n<e89daf>22435\n<e89db1>15097\n<e89db2>18608\n<e89db4>6529\n<e89db6>3023\n<e89db8>6526\n<e89dbb>19761\n<e89dbc>18609\n<e89dbf>3358\n<e89e82>6540\n<e89e87>17112\n<e89e88>15098\n<e89e89>18613\n<e89e8b>18614\n<e89e8c>19762\n<e89e8d>3877\n<e89e8e>19763\n<e89e90>22440\n<e89e93>18615\n<e89e95>22441\n<e89e99>15099\n<e89e9e>19766\n<e89e9f>6539\n<e89ea0>18616\n<e89ea2>6538\n<e89ea3>19767\n<e89ea7>18612\n<e89eab>6547\n<e89eae>19768\n<e89eaf>6541\n<e89eb1>22443\n<e89eb3>6549\n<e89eb5>15102\n<e89eba>3920\n<e89ebb>6552\n<e89ebd>6543\n<e89ebe>18619\n<e89ebf>19769\n<e89f80>6544\n<e89f81>18621\n<e89f84>6548\n<e89f86>6551\n<e89f87>6550\n<e89f88>22444\n<e89f89>19770\n<e89f8a>22445\n<e89f8b>6542\n<e89f8e>18622\n<e89f90>6545\n<e89f92>6562\n<e89f95>22446\n<e89f96>15103\n<e89f99>22447\n<e89f9a>19771\n<e89f9c>22448\n<e89f9f>18623\n<e89fa0>6555\n<e89fa2>22449\n<e89fa3>18625\n<e89fa4>22450\n<e89faa>18628\n<e89fab>15104\n<e89fac>7715\n<e89fad>15105\n<e89faf>6553\n<e89fb1>22451\n<e89fb2>6554\n<e89fb3>22452\n<e89fb5>15421\n<e89fb8>22453\n<e89fb9>1416\n<e89fba>22454\n<e89fbb>1628\n<e89fbe>6558\n<e89fbf>22455\n<e8a081>15106\n<e8a083>20312\n<e8a086>15108\n<e8a087>8614\n<e8a089>22456\n<e8a08a>17114\n<e8a08b>15109\n<e8a08d>6557\n<e8a08e>6561\n<e8a08f>6556\n<e8a090>17115\n<e8a091>6563\n<e8a092>22458\n<e8a093>18629\n<e8a094>15110\n<e8a095>6565\n<e8a096>6564\n<e8a098>19772\n<e8a099>22457\n<e8a09a>22459\n<e8a09b>19773\n<e8a09c>15111\n<e8a09e>22460\n<e8a09f>7813\n<e8a0a1>6567\n<e8a0a2>6566\n<e8a0a3>6497\n<e8a0a7>6571\n<e8a0a8>18630\n<e8a0ad>19774\n<e8a0ae>18631\n<e8a0b0>22461\n<e8a0b1>6568\n<e8a0b2>18632\n<e8a0b5>22462\n<e8a0b6>6569\n<e8a0b9>6570\n<e8a0ba>19775\n<e8a0bb>6572\n<e8a0bc>18633\n<e8a180>1858\n<e8a181>22463\n<e8a182>6574\n<e8a183>22464\n<e8a184>6573\n<e8a185>19776\n<e8a186>2362\n<e8a18a>18635\n<e8a18b>19777\n<e8a18c>2022\n<e8a18d>5412\n<e8a18e>19778\n<e8a191>22468\n<e8a192>6575\n<e8a193>2395\n<e8a195>19779\n<e8a196>15112\n<e8a197>1431\n<e8a198>18636\n<e8a199>6576\n<e8a19a>19780\n<e8a19b>1268\n<e8a19c>22469\n<e8a19d>2495\n<e8a19e>6577\n<e8a19f>15113\n<e8a1a0>22470\n<e8a1a1>2023\n<e8a1a2>6578\n<e8a1a3>1189\n<e8a1a4>15114\n<e8a1a8>3503\n<e8a1a9>18639\n<e8a1ab>6579\n<e8a1ae>19781\n<e8a1af>18641\n<e8a1b0>2608\n<e8a1b1>22471\n<e8a1b2>6586\n<e8a1b5>6583\n<e8a1b7>2989\n<e8a1b9>22472\n<e8a1bb>22473\n<e8a1bd>6584\n<e8a1be>6581\n<e8a1bf>1750\n<e8a280>22474\n<e8a281>6580\n<e8a282>6587\n<e8a288>1804\n<e8a28b>2878\n<e8a28d>6593\n<e8a292>6589\n<e8a296>2837\n<e8a297>6588\n<e8a298>15115\n<e8a299>6591\n<e8a29e>6582\n<e8a29f>22475\n<e8a2a0>18642\n<e8a2a2>6592\n<e8a2a4>6594\n<e8a2a8>22476\n<e8a2aa>15116\n<e8a2ab>3459\n<e8a2ae>6590\n<e8a2b0>6595\n<e8a2b1>6597\n<e8a2b4>1927\n<e8a2b5>6585\n<e8a2b7>1157\n<e8a2ba>22477\n<e8a2bc>18643\n<e8a2bf>6596\n<e8a380>18644\n<e8a381>2123\n<e8a382>4030\n<e8a385>2807\n<e8a386>14217\n<e8a38a>15119\n<e8a38d>19785\n<e8a38e>17116\n<e8a38f>3946\n<e8a391>18646\n<e8a392>15120\n<e8a393>18647\n<e8a394>6600\n<e8a395>3871\n<e8a39b>15121\n<e8a39c>3636\n<e8a39d>6603\n<e8a39e>22480\n<e8a39f>2096\n<e8a3a0>19786\n<e8a3a1>3947\n<e8a3a7>22481\n<e8a3a8>6608\n<e8a3af>19787\n<e8a3b2>6609\n<e8a3b3>2496\n<e8a3b4>6607\n<e8a3b5>8615\n<e8a3b7>22482\n<e8a3b8>3921\n<e8a3b9>6604\n<e8a3bc>6606\n<e8a3bd>2657\n<e8a3be>2628\n<e8a481>18649\n<e8a482>6605\n<e8a484>6610\n<e8a486>15124\n<e8a487>3571\n<e8a48a>6612\n<e8a48c>6611\n<e8a48d>22483\n<e8a490>1482\n<e8a492>3673\n<e8a493>6613\n<e8a49c>8360\n<e8a49d>6625\n<e8a49e>6615\n<e8a4a0>22486\n<e8a4a5>6616\n<e8a4a6>19790\n<e8a4a7>15128\n<e8a4a8>22487\n<e8a4b0>15129\n<e8a4b1>22488\n<e8a4b2>17118\n<e8a4b5>19791\n<e8a4b6>6622\n<e8a4b7>18651\n<e8a4b8>6623\n<e8a4b9>17119\n<e8a4ba>22489\n<e8a4bb>6621\n<e8a4be>15130\n<e8a580>17120\n<e8a581>6619\n<e8a582>18653\n<e8a583>6614\n<e8a584>6620\n<e8a585>18654\n<e8a586>22490\n<e8a589>18655\n<e8a58c>6624\n<e8a58d>7120\n<e8a58f>22491\n<e8a592>22492\n<e8a597>22493\n<e8a59a>19792\n<e8a59b>22494\n<e8a59c>19793\n<e8a59e>6627\n<e8a59f>1751\n<e8a5a0>6626\n<e8a5a1>22495\n<e8a5a2>18657\n<e8a5a3>22496\n<e8a5a4>6629\n<e8a5a6>6628\n<e8a5aa>6631\n<e8a5ab>19794\n<e8a5ad>6630\n<e8a5ae>22497\n<e8a5af>6632\n<e8a5b0>19795\n<e8a5b2>2363\n<e8a5b3>22498\n<e8a5b4>6633\n<e8a5b5>22499\n<e8a5b7>6634\n<e8a5ba>22500\n<e8a5bb>15131\n<e8a5bc>19796\n<e8a5bd>22501\n<e8a5be>6635\n<e8a5bf>2658\n<e8a680>13870\n<e8a681>3905\n<e8a683>6636\n<e8a686>3572\n<e8a687>3324\n<e8a688>6637\n<e8a689>18658\n<e8a68a>6638\n<e8a68b>1887\n<e8a68d>22502\n<e8a68f>1606\n<e8a690>18659\n<e8a693>6639\n<e8a694>17121\n<e8a695>22503\n<e8a696>2233\n<e8a697>3319\n<e8a698>6640\n<e8a69a>1454\n<e8a69f>18660\n<e8a6a0>22506\n<e8a6a1>6641\n<e8a6a5>19797\n<e8a6a6>6643\n<e8a6a7>3937\n<e8a6a9>6642\n<e8a6aa>2572\n<e8a6ac>6644\n<e8a6af>6645\n<e8a6b0>18661\n<e8a6b2>6646\n<e8a6b3>1549\n<e8a6b4>22507\n<e8a6b5>19798\n<e8a6b6>22508\n<e8a6b7>18662\n<e8a6ba>6647\n<e8a6bc>19799\n<e8a6bd>6648\n<e8a6bf>6649\n<e8a780>6650\n<e8a792>1455\n<e8a794>15132\n<e8a795>19800\n<e8a796>15133\n<e8a797>22509\n<e8a798>18663\n<e8a79a>6651\n<e8a7a3>1394\n<e8a7a5>15134\n<e8a7a6>2542\n<e8a7a7>6654\n<e8a7a9>22510\n<e8a7ab>18664\n<e8a7ad>22511\n<e8a7b1>15135\n<e8a7b3>18666\n<e8a7b4>6655\n<e8a7b6>17122\n<e8a7b8>6656\n<e8a7b9>22512\n<e8a7bd>18667\n<e8a7bf>18668\n<e8a880>1908\n<e8a881>13756\n<e8a882>3095\n<e8a883>6657\n<e8a887>15136\n<e8a888>1837\n<e8a88c>6660\n<e8a88e>3196\n<e8a88f>15137\n<e8a890>6659\n<e8a891>18670\n<e8a892>8616\n<e8a893>1799\n<e8a894>18671\n<e8a895>15138\n<e8a896>6658\n<e8a897>2903\n<e8a898>1607\n<e8a89b>6661\n<e8a89e>22515\n<e8a89f>2497\n<e8a8a0>22516\n<e8a8a1>18673\n<e8a8a2>15139\n<e8a8a3>1859\n<e8a8a4>22517\n<e8a8a5>6663\n<e8a8a6>22518\n<e8a8aa>3674\n<e8a8ad>2691\n<e8a8af>22521\n<e8a8b1>1680\n<e8a8b3>3841\n<e8a8b4>2764\n<e8a8b5>18674\n<e8a8b6>6664\n<e8a8b7>8617\n<e8a8ba>2573\n<e8a8bc>2498\n<e8a8bd>22522\n<e8a8be>18675\n<e8a980>22523\n<e8a981>6665\n<e8a983>22524\n<e8a985>18676\n<e8a986>6668\n<e8a987>17123\n<e8a988>6669\n<e8a989>19801\n<e8a98d>18677\n<e8a98e>15140\n<e8a990>2094\n<e8a991>2850\n<e8a992>6667\n<e8a993>22525\n<e8a994>2499\n<e8a995>3504\n<e8a996>22526\n<e8a997>19802\n<e8a998>18678\n<e8a99b>6666\n<e8a99c>22527\n<e8a99d>17124\n<e8a99e>2234\n<e8a9a0>1269\n<e8a9a1>17125\n<e8a9a2>6673\n<e8a9a3>1838\n<e8a9a5>22528\n<e8a9a6>2236\n<e8a9a7>19803\n<e8a9a9>2235\n<e8a9ab>4083\n<e8a9ac>6672\n<e8a9ad>6671\n<e8a9b0>1639\n<e8a9b1>4073\n<e8a9b2>1432\n<e8a9b3>2500\n<e8a9b5>17126\n<e8a9b9>8618\n<e8a9bc>6670\n<e8a9be>19804\n<e8a9bf>15141\n<e8aa80>22533\n<e8aa82>6675\n<e8aa83>22534\n<e8aa84>6676\n<e8aa85>6674\n<e8aa86>19805\n<e8aa87>1932\n<e8aa89>3882\n<e8aa8b>22535\n<e8aa8c>2237\n<e8aa8d>3293\n<e8aa8f>22536\n<e8aa90>18680\n<e8aa91>6679\n<e8aa92>22537\n<e8aa93>2660\n<e8aa95>2944\n<e8aa96>19806\n<e8aa97>22538\n<e8aa98>3872\n<e8aa99>22539\n<e8aa9a>6682\n<e8aa9e>1952\n<e8aa9f>22540\n<e8aaa0>2659\n<e8aaa1>6678\n<e8aaa3>6683\n<e8aaa4>1953\n<e8aaa7>8619\n<e8aaa8>6677\n<e8aaa9>22541\n<e8aaaa>13880\n<e8aaac>2694\n<e8aaad>3233\n<e8aaae>18679\n<e8aaaf>22542\n<e8aab0>2925\n<e8aab2>1373\n<e8aab3>22543\n<e8aab6>19807\n<e8aab7>18681\n<e8aabb>22544\n<e8aabc>1629\n<e8aabe>8620\n<e8aabf>3024\n<e8ab82>6686\n<e8ab83>22545\n<e8ab84>6684\n<e8ab86>22546\n<e8ab87>2954\n<e8ab88>22547\n<e8ab89>19808\n<e8ab8a>22548\n<e8ab8b>2661\n<e8ab8c>1550\n<e8ab8d>6685\n<e8ab8f>2593\n<e8ab90>17127\n<e8ab91>19809\n<e8ab92>3986\n<e8ab96>4070\n<e8ab97>18682\n<e8ab9a>6687\n<e8ab9b>6698\n<e8ab9c>3025\n<e8ab9d>19810\n<e8ab9e>6697\n<e8ab9f>8621\n<e8aba0>6694\n<e8aba1>6702\n<e8aba2>6695\n<e8aba4>6691\n<e8aba6>3096\n<e8aba7>6690\n<e8abab>6688\n<e8abac>19811\n<e8abad>3851\n<e8abae>2238\n<e8abb0>22552\n<e8abb1>6692\n<e8abb3>6689\n<e8abb4>15142\n<e8abb5>19812\n<e8abb6>8623\n<e8abb7>6696\n<e8abb8>2430\n<e8abbc>18683\n<e8abbe>2906\n<e8abbf>22553\n<e8ac80>3699\n<e8ac81>1276\n<e8ac82>1190\n<e8ac84>3197\n<e8ac85>18686\n<e8ac86>19813\n<e8ac87>6700\n<e8ac8a>18685\n<e8ac8b>22554\n<e8ac8c>6699\n<e8ac8d>18687\n<e8ac8f>19814\n<e8ac90>6704\n<e8ac91>19815\n<e8ac94>6693\n<e8ac96>6703\n<e8ac97>6705\n<e8ac99>1888\n<e8ac9a>6701\n<e8ac9b>2024\n<e8ac9c>18688\n<e8ac9d>2305\n<e8ac9e>22555\n<e8ac9f>15143\n<e8aca0>6706\n<e8aca1>3906\n<e8aca6>6709\n<e8aca8>6712\n<e8acab>6710\n<e8acad>18689\n<e8acb0>22556\n<e8acb3>6707\n<e8acb7>15144\n<e8acb9>1752\n<e8acbc>22557\n<e8acbe>6711\n<e8ad81>6713\n<e8ad82>22558\n<e8ad85>19816\n<e8ad86>17128\n<e8ad88>22559\n<e8ad89>6717\n<e8ad8c>6714\n<e8ad8d>22560\n<e8ad8e>6716\n<e8ad8f>6715\n<e8ad91>18691\n<e8ad92>19817\n<e8ad93>8624\n<e8ad94>15147\n<e8ad96>6718\n<e8ad98>2269\n<e8ad99>17129\n<e8ad9a>6720\n<e8ad9b>6719\n<e8ad9c>3546\n<e8ad9e>18692\n<e8ad9f>6722\n<e8ada3>22561\n<e8ada6>1839\n<e8ada9>17130\n<e8adab>6721\n<e8adac>6723\n<e8adad>19818\n<e8adaf>6724\n<e8adb0>1630\n<e8adb1>6190\n<e8adb2>2529\n<e8adb4>6725\n<e8adb6>18693\n<e8adb7>1954\n<e8adb8>19819\n<e8adb9>22562\n<e8adbc>19820\n<e8adbd>6726\n<e8adbe>19821\n<e8ae80>6727\n<e8ae81>18694\n<e8ae83>2188\n<e8ae84>22563\n<e8ae85>19822\n<e8ae8a>5075\n<e8ae8b>18695\n<e8ae8c>6728\n<e8ae8d>22564\n<e8ae8e>6729\n<e8ae8f>22565\n<e8ae90>2364\n<e8ae96>6732\n<e8ae9c>15148\n<e8ae9d>17131\n<e8ae9e>15149\n<e8ae9f>19823\n<e8b0b7>2921\n<e8b0b8>22566\n<e8b0b9>18698\n<e8b0ba>6735\n<e8b0bd>18700\n<e8b0be>22567\n<e8b0bf>6737\n<e8b181>6736\n<e8b185>18703\n<e8b186>3198\n<e8b187>15150\n<e8b188>6738\n<e8b189>17132\n<e8b18a>3675\n<e8b18b>19824\n<e8b18c>6739\n<e8b18e>6740\n<e8b18f>18704\n<e8b190>6741\n<e8b191>22568\n<e8b193>19825\n<e8b194>15151\n<e8b195>6742\n<e8b197>18705\n<e8b198>22569\n<e8b199>22572\n<e8b19a>3250\n<e8b19b>22570\n<e8b19d>22571\n<e8b1a1>2501\n<e8b1a2>6743\n<e8b1a6>22575\n<e8b1a8>17133\n<e8b1a9>18706\n<e8b1aa>2045\n<e8b1ab>4103\n<e8b1ac>6744\n<e8b1ad>18707\n<e8b1b3>15152\n<e8b1b8>6745\n<e8b1ba>6746\n<e8b1bb>19826\n<e8b1bc>6754\n<e8b1be>22578\n<e8b282>6747\n<e8b285>6749\n<e8b289>6748\n<e8b28a>6750\n<e8b28b>22581\n<e8b28c>3700\n<e8b290>22582\n<e8b292>18710\n<e8b293>18709\n<e8b294>6753\n<e8b298>6755\n<e8b299>18711\n<e8b29b>18713\n<e8b29c>22584\n<e8b29d>1419\n<e8b29e>3075\n<e8b29f>13644\n<e8b2a0>3547\n<e8b2a1>2130\n<e8b2a2>2025\n<e8b2a4>15153\n<e8b2a7>3521\n<e8b2a8>1375\n<e8b2a9>3426\n<e8b2aa>6758\n<e8b2ab>1551\n<e8b2ac>2681\n<e8b2ad>6757\n<e8b2ae>6762\n<e8b2af>2999\n<e8b2b0>3823\n<e8b2b4>1608\n<e8b2b6>6763\n<e8b2b7>3353\n<e8b2b8>2879\n<e8b2b9>22585\n<e8b2ba>19827\n<e8b2bb>3461\n<e8b2bc>3127\n<e8b2bd>6759\n<e8b2bf>3701\n<e8b380>1388\n<e8b381>6765\n<e8b382>4046\n<e8b383>3038\n<e8b384>4075\n<e8b385>19828\n<e8b386>22586\n<e8b387>2239\n<e8b388>6764\n<e8b389>19829\n<e8b38a>2833\n<e8b38b>22587\n<e8b38d>6781\n<e8b38e>2730\n<e8b38f>22588\n<e8b391>3280\n<e8b392>19830\n<e8b393>3522\n<e8b395>18715\n<e8b396>18714\n<e8b399>15154\n<e8b39a>6768\n<e8b39b>2189\n<e8b39c>2240\n<e8b39d>22589\n<e8b39e>2502\n<e8b3a0>3355\n<e8b3a1>15155\n<e8b3a2>1889\n<e8b3a3>6767\n<e8b3a4>6766\n<e8b3a6>3548\n<e8b3a8>22590\n<e8b3aa>2285\n<e8b3ac>19831\n<e8b3af>22591\n<e8b3b0>8626\n<e8b3b1>18717\n<e8b3b2>22592\n<e8b3b4>8627\n<e8b3b5>19832\n<e8b3b7>19833\n<e8b3b8>15156\n<e8b3bc>2026\n<e8b3bd>6769\n<e8b3be>15157\n<e8b3bf>22593\n<e8b481>19834\n<e8b483>19835\n<e8b487>6775\n<e8b488>2819\n<e8b489>18719\n<e8b48a>6774\n<e8b48b>1570\n<e8b48d>6777\n<e8b48e>18720\n<e8b48f>6776\n<e8b490>6778\n<e8b492>8628\n<e8b493>6780\n<e8b494>6782\n<e8b496>6783\n<e8b497>19836\n<e8b49b>15158\n<e8b49c>19837\n<e8b5a4>2682\n<e8b5a5>22594\n<e8b5a6>2299\n<e8b5a7>6784\n<e8b5a9>15159\n<e8b5ab>1456\n<e8b5ac>15160\n<e8b5ad>6785\n<e8b5ae>19838\n<e8b5b0>2808\n<e8b5b1>6786\n<e8b5b3>6787\n<e8b5b4>3549\n<e8b5b6>8629\n<e8b5b7>1609\n<e8b5bf>22595\n<e8b681>6788\n<e8b682>22596\n<e8b684>15161\n<e8b685>3026\n<e8b688>22597\n<e8b68a>1277\n<e8b68d>15162\n<e8b690>22598\n<e8b691>19839\n<e8b695>15163\n<e8b699>6789\n<e8b69e>22599\n<e8b69f>19840\n<e8b6a0>22600\n<e8b6a3>2333\n<e8b6a6>15164\n<e8b6a8>2620\n<e8b6ab>19841\n<e8b6ac>22601\n<e8b6af>17134\n<e8b6b2>19842\n<e8b6b3>2829\n<e8b6b5>22602\n<e8b6b7>22603\n<e8b6b9>22604\n<e8b6ba>6792\n<e8b6bb>22605\n<e8b6bc>22613\n<e8b6be>6791\n<e8b780>22606\n<e8b782>6790\n<e8b785>22607\n<e8b786>15165\n<e8b787>22608\n<e8b788>18721\n<e8b78a>22609\n<e8b78b>6798\n<e8b78c>6796\n<e8b78e>15166\n<e8b78f>6793\n<e8b791>17135\n<e8b794>22610\n<e8b795>19843\n<e8b796>6795\n<e8b797>17136\n<e8b799>18722\n<e8b79a>6794\n<e8b79b>6797\n<e8b79d>1681\n<e8b79f>6801\n<e8b7a1>2683\n<e8b7a3>6802\n<e8b7a4>15167\n<e8b7a5>22611\n<e8b7a7>19844\n<e8b7a8>1933\n<e8b7ac>15168\n<e8b7af>4047\n<e8b7b0>22612\n<e8b7b3>3027\n<e8b7b4>19847\n<e8b7b5>2731\n<e8b7bc>6803\n<e8b7bd>18725\n<e8b7bf>6806\n<e8b881>19848\n<e8b886>18726\n<e8b88a>3907\n<e8b88b>19849\n<e8b88c>18723\n<e8b88f>3199\n<e8b890>6809\n<e8b891>22616\n<e8b894>18728\n<e8b896>18729\n<e8b89f>6810\n<e8b8a0>15169\n<e8b8a3>17137\n<e8b8a6>19850\n<e8b8a7>18732\n<e8b8aa>6824\n<e8b8b0>6813\n<e8b8b1>19851\n<e8b8b3>22617\n<e8b8b4>6814\n<e8b8b5>6812\n<e8b8b6>18735\n<e8b8b9>18736\n<e8b8bd>17138\n<e8b982>6811\n<e8b984>3097\n<e8b987>6816\n<e8b988>6820\n<e8b989>6817\n<e8b98a>6815\n<e8b98b>15170\n<e8b98c>6818\n<e8b98d>19854\n<e8b98e>22620\n<e8b98f>19855\n<e8b990>6819\n<e8b994>18737\n<e8b995>6826\n<e8b999>6821\n<e8b99b>22621\n<e8b99c>19856\n<e8b99f>2684\n<e8b9a0>6823\n<e8b9a1>19857\n<e8b9a2>18738\n<e8b9a3>6825\n<e8b9a4>6822\n<e8b9a9>19858\n<e8b9ac>15171\n<e8b9ad>18739\n<e8b9af>18740\n<e8b9b0>15172\n<e8b9b1>19859\n<e8b9b2>6828\n<e8b9b4>2365\n<e8b9b5>19860\n<e8b9b6>6827\n<e8b9b7>19861\n<e8b9b9>22624\n<e8b9ba>15173\n<e8b9bb>17139\n<e8b9bc>6829\n<e8ba81>6830\n<e8ba84>6833\n<e8ba85>6832\n<e8ba87>6831\n<e8ba89>19862\n<e8ba8a>6835\n<e8ba8b>6834\n<e8ba8d>3842\n<e8ba90>19863\n<e8ba91>6837\n<e8ba92>15174\n<e8ba93>6836\n<e8ba94>6838\n<e8ba95>19864\n<e8ba98>18741\n<e8ba99>6839\n<e8ba9a>19865\n<e8ba9b>22627\n<e8ba9d>22628\n<e8ba9e>18742\n<e8baa1>6841\n<e8baa2>22629\n<e8baa7>19866\n<e8baa9>19867\n<e8baaa>6840\n<e8baab>2574\n<e8baac>6842\n<e8baad>19868\n<e8baae>15175\n<e8baaf>1765\n<e8bab0>6843\n<e8bab1>6845\n<e8bab3>15176\n<e8bab5>18743\n<e8bab6>14083\n<e8baba>22630\n<e8babb>18744\n<e8babe>6846\n<e8bb80>7663\n<e8bb81>22631\n<e8bb85>6847\n<e8bb86>6844\n<e8bb87>22634\n<e8bb88>6848\n<e8bb8a>2306\n<e8bb8b>6849\n<e8bb8c>1610\n<e8bb8d>1801\n<e8bb8f>8631\n<e8bb91>15177\n<e8bb92>1890\n<e8bb94>15178\n<e8bb9b>6850\n<e8bb9c>22635\n<e8bb9f>3272\n<e8bba2>3128\n<e8bba3>6851\n<e8bba8>19869\n<e8bbab>6854\n<e8bbad>22639\n<e8bbae>22636\n<e8bbb0>19870\n<e8bbb1>22637\n<e8bbb7>22638\n<e8bbb8>2272\n<e8bbb9>15179\n<e8bbba>17142\n<e8bbbb>6853\n<e8bbbc>6852\n<e8bbbd>1840\n<e8bbbe>6855\n<e8bc80>18748\n<e8bc82>22640\n<e8bc83>1457\n<e8bc85>6857\n<e8bc87>19871\n<e8bc88>18749\n<e8bc89>2124\n<e8bc8a>6856\n<e8bc8c>6865\n<e8bc92>6859\n<e8bc93>6861\n<e8bc94>3637\n<e8bc95>6858\n<e8bc96>22643\n<e8bc97>15180\n<e8bc98>19872\n<e8bc99>6860\n<e8bc9b>6864\n<e8bc9c>6862\n<e8bc9d>1611\n<e8bc9e>17143\n<e8bc9f>6863\n<e8bca3>22646\n<e8bca5>19873\n<e8bca6>6866\n<e8bca7>19874\n<e8bca8>22647\n<e8bca9>3344\n<e8bcaa>4000\n<e8bcab>18750\n<e8bcac>19875\n<e8bcad>17144\n<e8bcae>22648\n<e8bcaf>2366\n<e8bcb3>6867\n<e8bcb4>22649\n<e8bcb5>19876\n<e8bcb6>15181\n<e8bcb7>22650\n<e8bcb8>3852\n<e8bcb9>6869\n<e8bcba>19877\n<e8bcbb>6868\n<e8bcbe>6872\n<e8bcbf>3883\n<e8bd80>18751\n<e8bd81>22651\n<e8bd82>6871\n<e8bd83>19878\n<e8bd84>1483\n<e8bd85>6870\n<e8bd86>6875\n<e8bd87>19879\n<e8bd89>6874\n<e8bd8a>18752\n<e8bd8c>6873\n<e8bd8d>3116\n<e8bd8e>6876\n<e8bd8f>22652\n<e8bd91>19880\n<e8bd94>17145\n<e8bd95>19881\n<e8bd97>6877\n<e8bd98>18753\n<e8bd9c>6878\n<e8bd9f>2046\n<e8bda1>1787\n<e8bda5>22657\n<e8be9b>2575\n<e8be9c>6882\n<e8be9d>22658\n<e8be9e>2265\n<e8be9f>6883\n<e8bea3>6884\n<e8bea4>18755\n<e8bea5>19885\n<e8bea6>15182\n<e8bea7>4278\n<e8bea8>4277\n<e8bead>6885\n<e8beae>6143\n<e8beaf>6886\n<e8beb0>2914\n<e8beb1>2545\n<e8beb2>3318\n<e8beb4>18756\n<e8beb7>6887\n<e8beb8>22659\n<e8beba>3621\n<e8bebc>2064\n<e8bebe>22660\n<e8bf80>22661\n<e8bf81>18758\n<e8bf85>2589\n<e8bf86>18759\n<e8bf88>14233\n<e8bf8a>18761\n<e8bf8b>22662\n<e8bf8d>18762\n<e8bf8e>1844\n<e8bf90>22663\n<e8bf91>1753\n<e8bf92>22664\n<e8bf93>18763\n<e8bf94>3622\n<e8bf95>18764\n<e8bf9a>6888\n<e8bfa0>15186\n<e8bfa2>6890\n<e8bfa3>22665\n<e8bfa4>15187\n<e8bfa5>6889\n<e8bfa8>17147\n<e8bfa9>3278\n<e8bfaa>6891\n<e8bfab>3373\n<e8bfad>3117\n<e8bfae>17148\n<e8bfaf>6892\n<e8bfb0>2396\n<e8bfb1>18765\n<e8bfb4>6894\n<e8bfb5>18766\n<e8bfb6>15188\n<e8bfb7>3790\n<e8bfb8>6909\n<e8bfbb>18767\n<e8bfbd>3045\n<e8bfbe>22666\n<e98080>2880\n<e98081>2809\n<e98082>15189\n<e98083>3200\n<e98084>19886\n<e98085>6895\n<e98086>1647\n<e98088>17149\n<e9808b>6904\n<e9808c>18768\n<e9808d>6901\n<e9808e>6914\n<e9808f>3201\n<e98090>2974\n<e98091>6898\n<e98093>3098\n<e98094>3149\n<e98095>6899\n<e98096>6903\n<e98098>22667\n<e9809a>3048\n<e9809b>19887\n<e9809d>2662\n<e9809e>6902\n<e9809f>2830\n<e980a0>2820\n<e980a1>6900\n<e980a3>4040\n<e980a7>6905\n<e980ac>15190\n<e980ad>17150\n<e980ae>2881\n<e980af>19888\n<e980b1>2367\n<e980b2>2576\n<e980b5>6907\n<e980b6>6906\n<e980b7>18769\n<e980b8>1203\n<e980b9>6908\n<e980be>6916\n<e980bf>22673\n<e98182>2609\n<e98183>18771\n<e98184>15191\n<e98185>2967\n<e98187>1776\n<e98189>6915\n<e9818a>3873\n<e9818b>1249\n<e9818c>19889\n<e9818d>3623\n<e9818e>1377\n<e98193>3219\n<e98194>2913\n<e98195>1191\n<e98196>6917\n<e98198>6918\n<e98199>7476\n<e9819b>19890\n<e9819d>18772\n<e9819e>6919\n<e981a0>1301\n<e981a2>22674\n<e981a3>1891\n<e981a5>3908\n<e981a6>22675\n<e981a7>8634\n<e981a8>6920\n<e981a9>3110\n<e981ac>22676\n<e981ad>2810\n<e981ae>2307\n<e981af>6921\n<e981b0>19891\n<e981b2>6924\n<e981b4>19892\n<e981b5>2415\n<e981b6>6922\n<e981b7>2733\n<e981b8>2732\n<e981b9>19893\n<e981ba>1192\n<e981bc>3987\n<e981bd>6926\n<e981bf>3462\n<e98280>6928\n<e98281>6927\n<e98282>6925\n<e98283>5943\n<e98284>1552\n<e98285>18775\n<e98287>6893\n<e98288>15192\n<e98289>6930\n<e9828a>6929\n<e9828b>19894\n<e9828c>18776\n<e9828e>22677\n<e9828f>6931\n<e98290>18777\n<e98291>3874\n<e98295>15193\n<e98297>17151\n<e98298>19895\n<e98299>15194\n<e9829b>15195\n<e982a0>19896\n<e982a1>18778\n<e982a2>15196\n<e982a3>3257\n<e982a5>22678\n<e982a6>3676\n<e982a8>6932\n<e982aa>2309\n<e982af>6933\n<e982b0>18780\n<e982b1>6934\n<e982b2>19897\n<e982b3>17152\n<e982b4>15197\n<e982b5>6935\n<e982b6>18781\n<e982b8>3099\n<e982bd>19898\n<e982be>17153\n<e98381>1198\n<e98383>18782\n<e98387>17156\n<e98388>18783\n<e98389>19899\n<e9838a>2027\n<e9838c>22679\n<e9838e>4064\n<e98392>22684\n<e98395>22680\n<e98397>15198\n<e9839b>6939\n<e9839c>18785\n<e9839d>15199\n<e9839e>8635\n<e9839f>18786\n<e983a1>1802\n<e983a2>6936\n<e983a4>6937\n<e983a5>22683\n<e983a8>3558\n<e983ab>18791\n<e983ad>1458\n<e983af>17157\n<e983b0>19900\n<e983b2>18789\n<e983b4>15200\n<e983b5>3875\n<e983b6>18788\n<e983b7>1719\n<e983bd>3150\n<e98480>18790\n<e98482>6940\n<e98484>18794\n<e98485>19901\n<e98486>18795\n<e98488>22685\n<e9848d>22686\n<e98490>22687\n<e98492>6941\n<e98494>17158\n<e98495>8637\n<e98496>17159\n<e98497>15201\n<e98498>18796\n<e98499>6942\n<e9849a>22688\n<e9849c>15202\n<e9849e>18797\n<e984a0>22689\n<e984a5>19902\n<e984a7>8638\n<e984a9>22690\n<e984ae>22691\n<e984af>17162\n<e984b0>6944\n<e984b1>15203\n<e984b2>6943\n<e984b4>17163\n<e984b6>22692\n<e984b7>18798\n<e984b9>18799\n<e984ba>15204\n<e984bc>22693\n<e984bd>15205\n<e98583>22694\n<e98588>15206\n<e98589>3243\n<e9858a>6945\n<e9858c>2316\n<e9858d>3345\n<e9858e>2991\n<e9858f>22695\n<e98592>2334\n<e98593>22696\n<e98594>2610\n<e98596>6946\n<e98597>18802\n<e98598>6947\n<e98599>18803\n<e9859a>19903\n<e9859b>15207\n<e985a1>15208\n<e985a2>2595\n<e985a3>6948\n<e985a4>15209\n<e985a5>6949\n<e985a7>19904\n<e985a9>6950\n<e985aa>3929\n<e985ac>2369\n<e985ad>22697\n<e985b2>6952\n<e985b3>6951\n<e985b4>18804\n<e985b5>2028\n<e985b7>2053\n<e985b8>2190\n<e985b9>18805\n<e985ba>19905\n<e985bb>22698\n<e98681>22699\n<e98682>6955\n<e98683>17164\n<e98685>18806\n<e98686>22700\n<e98687>2416\n<e98689>6954\n<e9868a>19906\n<e9868b>6953\n<e9868d>2889\n<e9868e>15210\n<e98690>1955\n<e98691>19907\n<e98692>2663\n<e98695>19908\n<e98697>3396\n<e98698>22703\n<e9869c>2371\n<e9869e>15211\n<e986a1>22704\n<e986a2>6956\n<e986a4>2503\n<e986a6>22705\n<e986a8>15212\n<e986aa>6959\n<e986ab>6957\n<e986ac>7707\n<e986af>6958\n<e986b0>19909\n<e986b1>7777\n<e986b2>15215\n<e986b3>18807\n<e986b4>6961\n<e986b5>6960\n<e986b6>18808\n<e986b8>2530\n<e986ba>6962\n<e986bb>19910\n<e986bc>15216\n<e986bd>19911\n<e986bf>22706\n<e98782>19912\n<e98785>19913\n<e98786>3428\n<e98787>2115\n<e98788>2317\n<e98789>6965\n<e9878b>6966\n<e9878c>3948\n<e9878d>2383\n<e9878e>3834\n<e9878f>3988\n<e98790>6967\n<e98791>1754\n<e98796>6968\n<e98797>8640\n<e98798>3101\n<e98799>22709\n<e9879a>8639\n<e9879b>6971\n<e9879d>2577\n<e9879e>8641\n<e9879f>6969\n<e987a1>6970\n<e987a3>3068\n<e987a6>3715\n<e987a7>1780\n<e987ac>18813\n<e987af>22712\n<e987b0>15217\n<e987b1>17165\n<e987b7>15218\n<e987b9>22713\n<e987bb>15219\n<e987bc>6972\n<e987bd>22714\n<e987bf>6976\n<e98880>19914\n<e98881>18814\n<e98886>8646\n<e98887>15220\n<e98889>19915\n<e9888a>8648\n<e9888c>22717\n<e9888d>3255\n<e9888e>1441\n<e98890>8647\n<e98891>6980\n<e98894>6977\n<e98895>6979\n<e98898>22720\n<e9889e>6975\n<e988a3>19916\n<e988a8>15221\n<e988a9>7050\n<e988ac>6978\n<e988b3>15222\n<e988b4>4019\n<e988b7>1934\n<e988b8>15223\n<e988b9>8655\n<e988ba>8649\n<e988bc>8651\n<e988be>22731\n<e988bf>6988\n<e98980>8650\n<e98982>18818\n<e98983>15224\n<e98984>3118\n<e98985>6983\n<e98986>22732\n<e98987>15225\n<e98988>6986\n<e98989>6984\n<e9898a>18819\n<e9898b>6989\n<e9898d>22733\n<e9898e>8652\n<e9898f>15226\n<e98990>6990\n<e98991>8654\n<e98996>18820\n<e98997>6982\n<e98998>22734\n<e98999>8653\n<e9899a>6995\n<e9899b>1302\n<e9899e>6981\n<e989a0>15227\n<e989a1>18821\n<e989a2>3393\n<e989a4>6985\n<e989a5>18822\n<e989a6>2504\n<e989a7>8656\n<e989a8>18823\n<e989a9>22737\n<e989b1>2029\n<e989b5>22741\n<e989b6>19917\n<e989b9>22742\n<e989bb>22743\n<e989be>3702\n<e989bf>18827\n<e98a80>1756\n<e98a83>2384\n<e98a85>3220\n<e98a88>8362\n<e98a89>18828\n<e98a8a>22744\n<e98a8d>18829\n<e98a8e>19918\n<e98a91>2735\n<e98a92>22745\n<e98a93>6993\n<e98a95>6987\n<e98a96>6992\n<e98a97>18830\n<e98a98>3791\n<e98a99>18831\n<e98a9a>3028\n<e98a9b>6994\n<e98a9c>6991\n<e98a9f>18832\n<e98aa0>22746\n<e98aa7>8657\n<e98aa8>22749\n<e98aab>18833\n<e98aad>2734\n<e98aaf>19919\n<e98ab2>18836\n<e98ab3>13652\n<e98ab6>22750\n<e98ab7>6998\n<e98ab8>22751\n<e98ab9>6997\n<e98aba>22752\n<e98abd>22753\n<e98abf>18837\n<e98b80>18838\n<e98b81>19922\n<e98b82>15228\n<e98b83>19923\n<e98b85>19924\n<e98b86>18839\n<e98b87>22754\n<e98b88>19925\n<e98b8d>22755\n<e98b8e>18840\n<e98b8f>6996\n<e98b90>8663\n<e98b92>3677\n<e98b93>8667\n<e98b95>8665\n<e98b97>8661\n<e98b98>22756\n<e98b99>8662\n<e98b9f>15231\n<e98ba0>8666\n<e98ba1>22759\n<e98ba3>22760\n<e98ba4>2437\n<e98ba5>18841\n<e98ba7>8660\n<e98ba8>22761\n<e98ba9>6999\n<e98baa>3631\n<e98bac>22762\n<e98bad>1270\n<e98bae>22763\n<e98bb0>22764\n<e98bb2>3512\n<e98bb3>2992\n<e98bb7>18845\n<e98bb8>1682\n<e98bb9>8368\n<e98bba>7001\n<e98bbb>8670\n<e98bbc>2031\n<e98bbf>8673\n<e98c80>22765\n<e98c82>8675\n<e98c84>13402\n<e98c88>22766\n<e98c8d>15232\n<e98c8f>7000\n<e98c90>2611\n<e98c91>18842\n<e98c94>19926\n<e98c95>15233\n<e98c98>2612\n<e98c99>7004\n<e98c9a>7006\n<e98c9c>22767\n<e98c9d>8674\n<e98c9e>8672\n<e98c9f>15234\n<e98ca0>2531\n<e98ca1>8669\n<e98ca2>7005\n<e98ca3>7007\n<e98ca4>22768\n<e98ca5>8668\n<e98ca6>1739\n<e98ca7>15235\n<e98ca8>3511\n<e98ca9>18846\n<e98caa>22769\n<e98cab>2318\n<e98cac>4041\n<e98cae>7003\n<e98caf>2152\n<e98cb2>4069\n<e98cb3>19927\n<e98cb4>22770\n<e98cb5>7009\n<e98cb6>19928\n<e98cb7>22771\n<e98cba>7008\n<e98cbb>7010\n<e98d84>7002\n<e98d87>15236\n<e98d88>8361\n<e98d89>17166\n<e98d8a>13400\n<e98d8b>3265\n<e98d8d>3151\n<e98d90>22772\n<e98d91>18849\n<e98d92>15237\n<e98d94>3059\n<e98d95>22773\n<e98d96>7015\n<e98d97>8677\n<e98d98>19929\n<e98d9a>18850\n<e98d9b>2945\n<e98d9c>7011\n<e98d9e>22774\n<e98da0>7012\n<e98da7>22775\n<e98da9>22776\n<e98daa>15239\n<e98dab>18851\n<e98dac>1795\n<e98dad>15240\n<e98dae>7014\n<e98daf>22777\n<e98db0>8676\n<e98db1>18852\n<e98db3>18853\n<e98db4>22778\n<e98db6>22779\n<e98dba>22780\n<e98dbc>7013\n<e98dbd>22781\n<e98dbe>2505\n<e98dbf>19930\n<e98e82>19931\n<e98e88>18857\n<e98e8a>19932\n<e98e8b>18858\n<e98e8c>1495\n<e98e8d>22784\n<e98e8f>18859\n<e98e92>22785\n<e98e94>7019\n<e98e95>22786\n<e98e96>2095\n<e98e97>2811\n<e98e98>22787\n<e98e9b>15241\n<e98e9e>18860\n<e98ea1>18854\n<e98ea3>17169\n<e98ea4>8678\n<e98ea6>22789\n<e98ea7>1433\n<e98ea8>22790\n<e98ea9>15243\n<e98eab>22791\n<e98eae>3039\n<e98eb0>7016\n<e98eb9>7020\n<e98eba>15242\n<e98ebb>19933\n<e98f81>15244\n<e98f83>7026\n<e98f86>8679\n<e98f87>18865\n<e98f88>7029\n<e98f89>22797\n<e98f8a>15245\n<e98f8b>22798\n<e98f8c>19934\n<e98f8d>22799\n<e98f90>7028\n<e98f91>3111\n<e98f93>22800\n<e98f98>7025\n<e98f99>22801\n<e98f9c>18866\n<e98f9d>7027\n<e98f9e>8680\n<e98f9f>17170\n<e98fa1>1720\n<e98fa2>15246\n<e98fa4>7030\n<e98fa5>7024\n<e98fa6>19935\n<e98fa7>18867\n<e98fa8>7023\n<e98fb1>18864\n<e98fb5>18861\n<e98fb7>22802\n<e98fb8>8681\n<e98fb9>19936\n<e98fba>15247\n<e98fbb>18871\n<e98fbd>15248\n<e99081>22803\n<e99082>19937\n<e99083>7034\n<e99084>17171\n<e99087>7035\n<e99088>22804\n<e99089>18868\n<e9908f>15249\n<e99090>7036\n<e99093>7033\n<e99094>7032\n<e99095>22805\n<e99098>2506\n<e99099>3202\n<e9909a>7031\n<e9909f>22806\n<e990a1>7040\n<e990ab>7038\n<e990ae>19940\n<e990af>22807\n<e990b1>8682\n<e990b2>18872\n<e990b3>17172\n<e990b4>15250\n<e990b5>7039\n<e990b6>7037\n<e990b8>2904\n<e990ba>7041\n<e990bb>18873\n<e990bd>22808\n<e990bf>15251\n<e99181>7042\n<e99183>22809\n<e99184>7044\n<e99185>8683\n<e99188>8684\n<e9918a>17173\n<e9918c>19941\n<e99191>1553\n<e99192>7043\n<e99195>15252\n<e99199>22810\n<e9919a>7055\n<e9919b>7045\n<e9919c>22811\n<e9919e>7048\n<e9919f>22812\n<e991a0>7046\n<e991a1>22813\n<e991a2>7047\n<e991a3>17174\n<e991a8>22814\n<e991aa>7049\n<e991ab>15253\n<e991ad>18876\n<e991ae>22815\n<e991af>18877\n<e991b0>7051\n<e991b1>17175\n<e991b2>15254\n<e991b5>7052\n<e991b7>7053\n<e991bc>7056\n<e991bd>7054\n<e991be>7057\n<e991bf>7059\n<e99281>7058\n<e99283>22817\n<e99284>22816\n<e995b7>3029\n<e995b8>15255\n<e995b9>18878\n<e995be>22818\n<e99680>3827\n<e99682>7060\n<e99683>2736\n<e99684>22819\n<e99686>18879\n<e99687>7061\n<e99688>19942\n<e99689>3604\n<e9968a>7062\n<e9968b>1417\n<e9968e>17176\n<e9968f>1246\n<e99691>1555\n<e99692>8685\n<e99693>1554\n<e99694>7063\n<e99696>7064\n<e9969f>17177\n<e996a0>7067\n<e996a1>19943\n<e996a2>1556\n<e996a3>1459\n<e996a4>2032\n<e996a5>3402\n<e996a6>15256\n<e996a7>7069\n<e996a8>7068\n<e996a9>15257\n<e996ab>20313\n<e996ac>17178\n<e996ad>7070\n<e996b1>13653\n<e996b2>1278\n<e996b4>15259\n<e996b6>17179\n<e996b9>7073\n<e996ba>22822\n<e996bb>7072\n<e996bc>7071\n<e996bd>15260\n<e996be>7074\n<e996bf>19944\n<e99783>7077\n<e99786>19945\n<e99787>1163\n<e99788>18884\n<e99789>19946\n<e9978a>7075\n<e9978b>17180\n<e9978c>7079\n<e9978d>7078\n<e99790>17181\n<e99793>17182\n<e99794>7081\n<e99795>7080\n<e99796>7082\n<e99798>3206\n<e99799>22823\n<e9979a>15261\n<e9979c>7083\n<e9979d>22824\n<e9979e>17184\n<e9979f>22825\n<e997a0>19949\n<e997a1>7084\n<e997a2>7086\n<e997a4>19950\n<e997a5>7085\n<e997a6>19951\n<e997a8>14061\n<e9989c>3550\n<e9989d>15262\n<e9989e>22826\n<e998a1>7087\n<e998a2>22827\n<e998a4>19952\n<e998a8>7088\n<e998aa>2133\n<e998ac>18887\n<e998b1>19953\n<e998b2>3703\n<e998b7>22830\n<e998b8>19954\n<e998bb>2765\n<e998bc>18891\n<e998bd>19955\n<e998bf>1128\n<e99980>2859\n<e99981>15263\n<e99982>7091\n<e99984>3551\n<e9998b>7094\n<e9998c>7092\n<e9998d>2033\n<e9998f>7093\n<e99990>1910\n<e99992>22833\n<e99994>19956\n<e99998>15264\n<e9999b>3605\n<e9999c>7096\n<e9999d>7098\n<e9999e>7097\n<e9999f>7099\n<e999a1>18892\n<e999a2>1219\n<e999a3>2590\n<e999a4>2438\n<e999a5>1557\n<e999a6>7100\n<e999aa>3356\n<e999ac>7102\n<e999ae>22836\n<e999b0>1220\n<e999b2>7101\n<e999b3>3040\n<e999b4>19957\n<e999b5>3989\n<e999b6>3203\n<e999b7>7095\n<e999b8>3950\n<e999ba>1893\n<e999bb>19958\n<e999bc>22837\n<e999bd>3909\n<e999be>22838\n<e999bf>19959\n<e99a81>19960\n<e99a82>18894\n<e99a83>19961\n<e99a84>15265\n<e99a85>1777\n<e99a86>3964\n<e99a88>1790\n<e99a89>19962\n<e99a8a>2882\n<e99a8b>6252\n<e99a8d>7103\n<e99a8e>1418\n<e99a8f>2613\n<e99a91>22839\n<e99a94>1460\n<e99a95>7105\n<e99a96>19963\n<e99a97>7106\n<e99a98>7104\n<e99a9a>18896\n<e99a9b>2125\n<e99a9c>2507\n<e99a9d>8688\n<e99a9f>22840\n<e99aa0>1221\n<e99aa3>4001\n<e99aa4>15266\n<e99aa5>17185\n<e99aa6>22841\n<e99aa7>7108\n<e99aa8>6923\n<e99aa9>15267\n<e99aaa>7107\n<e99aae>19964\n<e99aaf>8689\n<e99ab0>7111\n<e99ab3>18899\n<e99ab4>7112\n<e99ab6>7113\n<e99ab7>4020\n<e99aba>18900\n<e99abb>2669\n<e99abc>3407\n<e99abd>18901\n<e99b80>2627\n<e99b81>1571\n<e99b84>3876\n<e99b85>1389\n<e99b86>2370\n<e99b87>1935\n<e99b89>7118\n<e99b8a>22842\n<e99b8b>7117\n<e99b8c>2241\n<e99b8d>7119\n<e99b8e>7116\n<e99b91>2166\n<e99b92>15268\n<e99b95>7123\n<e99b96>6546\n<e99b98>18904\n<e99b99>4331\n<e99b9a>18905\n<e99b9b>2621\n<e99b9c>7121\n<e99b9d>18906\n<e99b9e>15270\n<e99b9f>22844\n<e99ba2>3949\n<e99ba3>3273\n<e99ba8>1229\n<e99ba9>15271\n<e99baa>2695\n<e99bab>2274\n<e99baf>17186\n<e99bb0>3591\n<e99bb1>15272\n<e99bb2>1250\n<e99bb6>4021\n<e99bb7>3925\n<e99bb9>7124\n<e99bba>22845\n<e99bbb>3135\n<e99c80>2343\n<e99c82>15273\n<e99c83>19965\n<e99c84>7125\n<e99c85>22846\n<e99c86>7126\n<e99c87>2578\n<e99c88>7127\n<e99c89>15274\n<e99c8a>4022\n<e99c8d>7122\n<e99c8e>7129\n<e99c8f>7131\n<e99c91>7130\n<e99c93>7128\n<e99c94>18908\n<e99c96>7132\n<e99c99>7133\n<e99c9a>22847\n<e99c9b>19966\n<e99c9c>2812\n<e99c9d>22848\n<e99c9e>1378\n<e99ca3>18909\n<e99ca4>7134\n<e99ca7>3780\n<e99ca8>19969\n<e99caa>7135\n<e99cb0>7136\n<e99cb1>19970\n<e99cb2>4048\n<e99cb3>8690\n<e99cb6>18911\n<e99cb8>5140\n<e99cb9>7137\n<e99cbb>8691\n<e99d81>18912\n<e99d82>7143\n<e99d83>8692\n<e99d84>7140\n<e99d86>7141\n<e99d87>18913\n<e99d88>7142\n<e99d89>7144\n<e99d8a>22850\n<e99d8d>8693\n<e99d8e>17187\n<e99d8f>8694\n<e99d91>8695\n<e99d92>2664\n<e99d95>20314\n<e99d96>3843\n<e99d97>18914\n<e99d98>22851\n<e99d99>2665\n<e99d9a>15275\n<e99d9b>18915\n<e99d9c>7145\n<e99d9e>3463\n<e99da0>7146\n<e99da1>7430\n<e99da2>3800\n<e99da3>15276\n<e99da4>7147\n<e99da6>7148\n<e99da7>19971\n<e99da8>7149\n<e99da9>1461\n<e99daa>18916\n<e99dab>7151\n<e99dad>2591\n<e99dae>15277\n<e99db3>15278\n<e99db4>1786\n<e99db6>19972\n<e99db9>7153\n<e99dba>7157\n<e99dbb>22854\n<e99dbc>7155\n<e99dbd>19973\n<e99dbf>19974\n<e99e80>22855\n<e99e81>7156\n<e99e85>7154\n<e99e86>7158\n<e99e89>22856\n<e99e8b>7159\n<e99e8d>1164\n<e99e95>17188\n<e99e96>18919\n<e99e97>22857\n<e99e99>19975\n<e99e9a>15279\n<e99e9c>7162\n<e99e9e>18920\n<e99e9f>19976\n<e99ea0>1633\n<e99ea2>15280\n<e99ea3>7165\n<e99ea6>7164\n<e99ea8>7163\n<e99eab>6708\n<e99eac>19977\n<e99eae>17189\n<e99eb8>22858\n<e99eb9>19978\n<e99eba>17190\n<e99ebc>22859\n<e99ebe>18923\n<e99ebf>22860\n<e99f81>17191\n<e99f83>7168\n<e99f86>7169\n<e99f87>22863\n<e99f88>7170\n<e99f89>17192\n<e99f8a>22864\n<e99f8b>7171\n<e99f8c>18924\n<e99f8d>19979\n<e99f8e>22865\n<e99f90>22866\n<e99f91>18925\n<e99f93>1558\n<e99f94>18926\n<e99f97>22867\n<e99f98>18927\n<e99f99>15283\n<e99f9b>17193\n<e99f9c>7172\n<e99f9d>22868\n<e99f9e>15284\n<e99fa0>19980\n<e99fa1>18928\n<e99fa4>22869\n<e99fad>7173\n<e99fae>3289\n<e99faf>19981\n<e99fb1>18929\n<e99fb2>7175\n<e99fb3>1339\n<e99fb4>15285\n<e99fb5>7178\n<e99fb6>7177\n<e99fba>22872\n<e99fbb>1222\n<e99fbf>1721\n<e9a081>3607\n<e9a082>3030\n<e9a083>2066\n<e9a084>18930\n<e9a085>2034\n<e9a086>2417\n<e9a087>19982\n<e9a088>2594\n<e9a08a>15286\n<e9a08c>7180\n<e9a08d>18931\n<e9a08e>15287\n<e9a08f>7179\n<e9a090>3884\n<e9a091>1572\n<e9a092>3430\n<e9a093>3252\n<e9a094>18932\n<e9a096>18933\n<e9a097>2626\n<e9a098>3990\n<e9a099>22873\n<e9a09a>1841\n<e9a09c>22874\n<e9a09e>15288\n<e9a0a0>22875\n<e9a0a1>7183\n<e9a0a3>15289\n<e9a0a4>7182\n<e9a0a5>18938\n<e9a0a6>19983\n<e9a0ab>15290\n<e9a0ac>3705\n<e9a0ad>3204\n<e9a0ae>19984\n<e9a0af>22876\n<e9a0b0>7795\n<e9a0b4>1266\n<e9a0b5>22877\n<e9a0b7>7184\n<e9a0b8>7181\n<e9a0b9>14259\n<e9a0bb>3523\n<e9a0bc>3924\n<e9a0bd>7185\n<e9a0be>15291\n<e9a184>22878\n<e9a186>7186\n<e9a187>18939\n<e9a18a>22879\n<e9a18b>7188\n<e9a18c>2890\n<e9a18f>7187\n<e9a191>22880\n<e9a194>1573\n<e9a195>1894\n<e9a196>17194\n<e9a197>8697\n<e9a198>1574\n<e9a199>15294\n<e9a19a>7752\n<e9a19b>3129\n<e9a19e>4008\n<e9a1a5>8698\n<e9a1a6>18940\n<e9a1a7>1936\n<e9a1aa>22881\n<e9a1ab>7189\n<e9a1ac>15295\n<e9a1b3>7194\n<e9a1b4>7193\n<e9a2a8>3561\n<e9a2aa>7195\n<e9a2ab>18941\n<e9a2ad>18942\n<e9a2ae>22882\n<e9a2af>7196\n<e9a2b0>18943\n<e9a2b1>7197\n<e9a2b4>19987\n<e9a2b6>7198\n<e9a2b7>18945\n<e9a2b8>15296\n<e9a2ba>15297\n<e9a2bf>15298\n<e9a382>18948\n<e9a383>7200\n<e9a384>7199\n<e9a385>19988\n<e9a386>7201\n<e9a387>18949\n<e9a388>15299\n<e9a38b>18950\n<e9a38c>22883\n<e9a39b>3464\n<e9a39c>6201\n<e9a39f>2543\n<e9a3a0>13848\n<e9a3a1>18951\n<e9a3a2>1612\n<e9a3a3>18952\n<e9a3a5>15300\n<e9a3a6>22884\n<e9a3a7>17195\n<e9a3a9>7202\n<e9a3aa>18953\n<e9a3ab>7203\n<e9a3ad>4289\n<e9a3ae>5338\n<e9a3af>3431\n<e9a3b2>1215\n<e9a3b3>18956\n<e9a3b6>22885\n<e9a3bc>2242\n<e9a3bd>3678\n<e9a3be>2534\n<e9a482>19989\n<e9a483>7204\n<e9a487>22886\n<e9a488>18957\n<e9a489>7205\n<e9a48a>3910\n<e9a491>19990\n<e9a492>7206\n<e9a493>1390\n<e9a494>7207\n<e9a495>19991\n<e9a498>7208\n<e9a49f>22887\n<e9a4a0>7213\n<e9a4a1>7209\n<e9a4a2>22888\n<e9a4a4>7212\n<e9a4a6>22889\n<e9a4a7>8701\n<e9a4a8>1559\n<e9a4ab>22890\n<e9a4ac>7214\n<e9a4ae>7215\n<e9a4b1>18967\n<e9a4b4>22891\n<e9a4b5>19992\n<e9a4b9>22892\n<e9a580>15303\n<e9a581>18971\n<e9a582>7218\n<e9a585>7220\n<e9a586>18972\n<e9a587>22893\n<e9a588>19993\n<e9a589>7219\n<e9a58b>7222\n<e9a58c>7225\n<e9a58d>15304\n<e9a58e>18973\n<e9a590>7221\n<e9a594>19994\n<e9a595>7226\n<e9a598>17196\n<e9a599>22894\n<e9a59b>22895\n<e9a59c>15305\n<e9a59e>19995\n<e9a59f>15306\n<e9a5a0>18974\n<e9a696>2335\n<e9a699>2035\n<e9a69b>22896\n<e9a69d>22897\n<e9a69e>8703\n<e9a69f>22898\n<e9a6a3>18975\n<e9a6a5>7229\n<e9a6a6>18976\n<e9a6a8>1436\n<e9a6ac>3333\n<e9a6b0>22899\n<e9a6b1>15307\n<e9a6b2>22900\n<e9a6b3>2968\n<e9a6b4>3267\n<e9a6b5>22901\n<e9a6bc>7232\n<e9a6bd>18977\n<e9a6bf>18978\n<e9a783>18979\n<e9a784>2860\n<e9a785>1274\n<e9a786>1766\n<e9a788>1767\n<e9a789>15310\n<e9a790>2993\n<e9a791>7237\n<e9a792>1768\n<e9a793>22902\n<e9a794>18980\n<e9a795>1391\n<e9a798>7236\n<e9a799>18981\n<e9a79a>22903\n<e9a79b>7234\n<e9a79c>22904\n<e9a79d>7235\n<e9a79e>18982\n<e9a79f>7233\n<e9a7a1>19996\n<e9a7a2>7247\n<e9a7a7>22905\n<e9a7b0>18984\n<e9a7b8>7243\n<e9a7b9>18985\n<e9a7bb>7242\n<e9a7bc>18986\n<e9a7bf>2403\n<e9a881>7244\n<e9a882>15311\n<e9a883>17197\n<e9a884>22913\n<e9a885>7246\n<e9a888>14266\n<e9a88a>18987\n<e9a88b>22914\n<e9a88c>19997\n<e9a88e>1613\n<e9a88f>7245\n<e9a890>19998\n<e9a891>18988\n<e9a892>2813\n<e9a893>1895\n<e9a896>15312\n<e9a89a>18989\n<e9a89e>22915\n<e9a8a0>18990\n<e9a8a2>22916\n<e9a8a3>19999\n<e9a8a4>15313\n<e9a8a7>15314\n<e9a8a8>2861\n<e9a8ab>7249\n<e9a8b0>3205\n<e9a8b1>18991\n<e9a8b3>22917\n<e9a8b5>22918\n<e9a8b6>15317\n<e9a8b7>7250\n<e9a8b8>15318\n<e9a8be>7255\n<e9a980>7253\n<e9a981>20000\n<e9a982>7252\n<e9a983>7254\n<e9a984>18992\n<e9a985>7251\n<e9a987>22919\n<e9a98b>22921\n<e9a98c>18993\n<e9a98d>7257\n<e9a98e>8704\n<e9a991>20001\n<e9a992>7727\n<e9a994>22922\n<e9a995>7256\n<e9a996>15320\n<e9a997>7259\n<e9a998>18994\n<e9a99a>1723\n<e9a99b>7258\n<e9a99d>22923\n<e9a99f>7260\n<e9a9a2>7261\n<e9a9a4>7263\n<e9a9a5>7262\n<e9a9a9>7264\n<e9a9aa>7266\n<e9a9ab>7265\n<e9aaa8>2062\n<e9aaaa>22924\n<e9aaac>22925\n<e9aaad>7267\n<e9aaae>22926\n<e9aaaf>18996\n<e9aab0>7268\n<e9aab2>22927\n<e9aab4>22928\n<e9aab7>18998\n<e9aab8>1434\n<e9aab9>19000\n<e9aabb>22929\n<e9aabc>7269\n<e9aabf>22930\n<e9ab80>7270\n<e9ab81>17198\n<e9ab83>17199\n<e9ab84>2615\n<e9ab86>19002\n<e9ab88>22931\n<e9ab8e>17200\n<e9ab8f>7271\n<e9ab90>19003\n<e9ab91>7272\n<e9ab92>19004\n<e9ab95>19005\n<e9ab96>17201\n<e9ab97>22932\n<e9ab98>2036\n<e9ab99>8705\n<e9ab9b>22933\n<e9ab9c>8706\n<e9aba0>19006\n<e9aba4>22934\n<e9aba5>19007\n<e9aba6>7279\n<e9aba7>22935\n<e9aba9>19008\n<e9abaa>3397\n<e9abab>7281\n<e9abac>22936\n<e9abad>3480\n<e9abae>7282\n<e9abaf>7280\n<e9abb1>7284\n<e9abb4>7283\n<e9abb5>22939\n<e9abb7>7285\n<e9abb9>15323\n<e9abba>22940\n<e9abbb>7286\n<e9abbd>22941\n<e9abbf>22942\n<e9ac80>22943\n<e9ac81>20004\n<e9ac82>17202\n<e9ac83>15324\n<e9ac86>7287\n<e9ac88>17203\n<e9ac89>20005\n<e9ac8b>20006\n<e9ac8c>19009\n<e9ac90>19010\n<e9ac92>19011\n<e9ac96>19012\n<e9ac98>7288\n<e9ac99>20009\n<e9ac9a>7289\n<e9ac9b>22946\n<e9ac9c>19013\n<e9ac9d>20297\n<e9ac9f>7290\n<e9aca0>15325\n<e9aca5>7293\n<e9aca6>22947\n<e9acab>19014\n<e9acac>20298\n<e9acad>17205\n<e9acb1>5332\n<e9acb2>7300\n<e9acb5>20010\n<e9acb7>22949\n<e9acbb>6057\n<e9acbc>1614\n<e9acbd>19015\n<e9ad81>1407\n<e9ad82>2082\n<e9ad83>7302\n<e9ad84>7301\n<e9ad85>3761\n<e9ad88>20011\n<e9ad8b>19017\n<e9ad8c>22952\n<e9ad8f>7303\n<e9ad91>7306\n<e9ad94>3728\n<e9ad95>20012\n<e9ad98>7307\n<e9ad9a>1685\n<e9ad9b>22955\n<e9ad9e>17206\n<e9ada1>22956\n<e9ada3>19018\n<e9ada5>19019\n<e9ada6>17207\n<e9ada8>20013\n<e9adaa>22957\n<e9adaf>4043\n<e9adb2>8708\n<e9adb3>15328\n<e9adb4>7308\n<e9adb5>8707\n<e9adb8>22960\n<e9adb9>15329\n<e9adbf>22961\n<e9ae80>20014\n<e9ae83>7310\n<e9ae84>17208\n<e9ae85>22962\n<e9ae86>20015\n<e9ae87>22963\n<e9ae89>22964\n<e9ae8a>17209\n<e9ae8b>22965\n<e9ae8d>22966\n<e9ae8e>1154\n<e9ae8f>8709\n<e9ae90>20016\n<e9ae91>7311\n<e9ae92>3579\n<e9ae93>7309\n<e9ae94>22967\n<e9ae9a>22968\n<e9ae9d>20017\n<e9ae9e>17210\n<e9aea6>19024\n<e9aea7>15330\n<e9aea8>7316\n<e9aea9>22969\n<e9aeaa>3740\n<e9aeac>19025\n<e9aead>2154\n<e9aeae>2737\n<e9aeb0>20018\n<e9aeb1>8710\n<e9aeb2>19027\n<e9aeb4>7317\n<e9aeb7>22970\n<e9aeb8>19028\n<e9aeb9>7320\n<e9aebb>8711\n<e9aebc>22971\n<e9aebe>19029\n<e9aebf>20019\n<e9af80>7318\n<e9af81>15331\n<e9af86>7321\n<e9af87>15332\n<e9af88>20020\n<e9af89>1957\n<e9af8a>7319\n<e9af8e>17211\n<e9af8f>7322\n<e9af90>22972\n<e9af94>7328\n<e9af97>15333\n<e9af98>19031\n<e9af9b>2884\n<e9af9d>19032\n<e9af9f>14271\n<e9afa1>7329\n<e9afa2>7326\n<e9afa3>7325\n<e9afa4>7327\n<e9afa5>17212\n<e9afa7>15334\n<e9afa8>1845\n<e9afaa>19033\n<e9afab>15335\n<e9afae>19035\n<e9afaf>19034\n<e9afb0>7333\n<e9afb1>7332\n<e9afb2>7331\n<e9afb3>19030\n<e9afb5>1143\n<e9afb7>15336\n<e9afb8>17213\n<e9afb9>22973\n<e9afba>15337\n<e9afbd>15338\n<e9afbf>20021\n<e9b080>8712\n<e9b082>20022\n<e9b084>7343\n<e9b086>7339\n<e9b088>7340\n<e9b089>7336\n<e9b08a>7342\n<e9b08b>15339\n<e9b08c>7338\n<e9b08d>1472\n<e9b08f>22974\n<e9b090>4082\n<e9b091>22975\n<e9b092>7341\n<e9b093>7337\n<e9b094>7335\n<e9b095>7334\n<e9b096>19039\n<e9b09b>7345\n<e9b09c>20023\n<e9b09d>19043\n<e9b09e>22976\n<e9b0a1>7348\n<e9b0a2>19044\n<e9b0a3>17214\n<e9b0a4>7347\n<e9b0a5>7346\n<e9b0a6>22977\n<e9b0a7>15340\n<e9b0a8>22978\n<e9b0a9>19045\n<e9b0aa>15341\n<e9b0ad>3515\n<e9b0ae>7344\n<e9b0b0>7349\n<e9b0b1>19047\n<e9b0b2>7351\n<e9b0b5>20024\n<e9b0b6>15342\n<e9b0b7>19048\n<e9b0b9>1485\n<e9b0ba>7330\n<e9b0bb>1241\n<e9b0bd>22979\n<e9b0be>7353\n<e9b181>15343\n<e9b183>22980\n<e9b184>20025\n<e9b185>19049\n<e9b186>7352\n<e9b187>7350\n<e9b188>2923\n<e9b18e>22981\n<e9b193>15344\n<e9b194>19055\n<e9b196>20026\n<e9b197>4002\n<e9b198>19056\n<e9b19a>7354\n<e9b19b>19057\n<e9b19c>19050\n<e9b19d>19058\n<e9b19e>22982\n<e9b19f>19059\n<e9b1a0>7355\n<e9b1a1>20027\n<e9b1a3>15345\n<e9b1a5>17217\n<e9b1a7>7356\n<e9b1a8>20028\n<e9b1b0>15346\n<e9b1b2>19065\n<e9b1b5>19066\n<e9b1b6>7357\n<e9b1b7>15347\n<e9b1b8>7358\n<e9b1ba>19067\n<e9b1bb>22983\n<e9b3a5>3031\n<e9b3a6>19068\n<e9b3a7>7359\n<e9b3a9>3403\n<e9b3ab>7364\n<e9b3ac>7360\n<e9b3b0>7361\n<e9b3b2>19069\n<e9b3b3>3679\n<e9b3b4>3792\n<e9b3b6>3240\n<e9b3b7>22984\n<e9b3b9>22985\n<e9b482>15348\n<e9b483>7365\n<e9b486>7366\n<e9b487>3222\n<e9b488>7363\n<e9b48b>19070\n<e9b48e>1322\n<e9b491>19072\n<e9b492>7374\n<e9b495>7373\n<e9b49b>1303\n<e9b49c>22986\n<e9b49f>7371\n<e9b4a3>7370\n<e9b4a6>7368\n<e9b4a8>1497\n<e9b4aa>7367\n<e9b4ab>2270\n<e9b4ac>1321\n<e9b4af>22987\n<e9b4b0>20029\n<e9b4b2>19078\n<e9b4ba>22990\n<e9b4bb>2037\n<e9b4bc>22991\n<e9b4bd>20030\n<e9b4be>7377\n<e9b4bf>7376\n<e9b581>7375\n<e9b582>15349\n<e9b583>17220\n<e9b584>7372\n<e9b585>22992\n<e9b586>7378\n<e9b587>15350\n<e9b588>7379\n<e9b58a>19080\n<e9b590>7384\n<e9b591>7383\n<e9b592>17221\n<e9b599>7385\n<e9b59c>1231\n<e9b59f>19081\n<e9b5a1>3781\n<e9b5a2>19082\n<e9b5a3>15351\n<e9b5a4>7382\n<e9b5a5>22995\n<e9b5a9>15352\n<e9b5aa>20031\n<e9b5ab>8714\n<e9b5ac>3680\n<e9b5af>7390\n<e9b5b0>8713\n<e9b5b2>7386\n<e9b5b3>19085\n<e9b5ba>7391\n<e9b5bb>20032\n<e9b5bc>15353\n<e9b5be>15354\n<e9b683>22996\n<e9b684>19088\n<e9b686>22997\n<e9b687>7388\n<e9b689>7387\n<e9b68a>17222\n<e9b68d>15355\n<e9b68e>22998\n<e9b68f>1842\n<e9b695>23001\n<e9b696>17223\n<e9b699>19089\n<e9b69a>7392\n<e9b6a1>19090\n<e9b6a4>7393\n<e9b6a9>7394\n<e9b6aa>23004\n<e9b6ab>7389\n<e9b6ac>17225\n<e9b6ae>23005\n<e9b6af>7369\n<e9b6b1>15356\n<e9b6b2>7395\n<e9b6b4>3069\n<e9b6b5>19092\n<e9b6b8>7399\n<e9b6b9>19093\n<e9b6ba>7400\n<e9b6bb>7398\n<e9b6bc>17226\n<e9b6bd>19094\n<e9b6bf>19091\n<e9b780>17224\n<e9b781>7397\n<e9b782>7403\n<e9b783>15357\n<e9b784>7396\n<e9b786>7401\n<e9b787>15358\n<e9b789>19095\n<e9b78a>23007\n<e9b78f>7402\n<e9b793>7405\n<e9b796>15359\n<e9b797>7646\n<e9b799>7404\n<e9b79a>19096\n<e9b79e>23010\n<e9b79f>15360\n<e9b7a0>19097\n<e9b7a3>19098\n<e9b7a5>20033\n<e9b7a6>7407\n<e9b7a7>17228\n<e9b7a9>20034\n<e9b7ab>15361\n<e9b7ad>7408\n<e9b7ae>23011\n<e9b7af>7409\n<e9b7b0>23012\n<e9b7b2>4079\n<e9b7b3>20035\n<e9b7b4>15362\n<e9b7b8>7406\n<e9b7b9>2891\n<e9b7ba>2141\n<e9b7bd>7410\n<e9b7be>23013\n<e9b882>19101\n<e9b887>17229\n<e9b88a>19100\n<e9b88d>19102\n<e9b88e>23014\n<e9b895>15363\n<e9b896>23018\n<e9b899>8716\n<e9b89c>19103\n<e9b89d>15364\n<e9b89e>7413\n<e9b9b5>7414\n<e9b9b8>1896\n<e9b9b9>7415\n<e9b9ba>20036\n<e9b9bb>19104\n<e9b9bc>7677\n<e9b9bd>7416\n<e9b9bf>2267\n<e9ba80>19106\n<e9ba81>7417\n<e9ba85>19107\n<e9ba87>23019\n<e9ba88>7418\n<e9ba91>7423\n<e9ba92>7421\n<e9ba93>4066\n<e9ba95>7422\n<e9ba96>23022\n<e9ba97>4023\n<e9ba98>23023\n<e9ba9b>19108\n<e9ba9d>7424\n<e9ba9e>17230\n<e9ba9f>4003\n<e9baa4>15365\n<e9baa5>7425\n<e9baa6>3380\n<e9baa8>15366\n<e9baa9>7426\n<e9baaa>7428\n<e9baac>15367\n<e9baad>7429\n<e9baae>23024\n<e9baaf>17231\n<e9bab0>20040\n<e9bab3>23025\n<e9bab4>7682\n<e9bab5>7797\n<e9bab8>7427\n<e9bab9>2047\n<e9baba>3801\n<e9babb>3729\n<e9babc>4740\n<e9babd>19110\n<e9babe>5375\n<e9babf>3753\n<e9bb83>13323\n<e9bb84>1323\n<e9bb86>23026\n<e9bb88>23027\n<e9bb8b>23028\n<e9bb8c>7431\n<e9bb8d>1642\n<e9bb91>8717\n<e9bb92>2055\n<e9bb94>7435\n<e9bb95>23029\n<e9bb98>5645\n<e9bb99>3815\n<e9bb9b>2883\n<e9bb9c>7436\n<e9bb9d>7438\n<e9bb9e>7437\n<e9bb9f>19112\n<e9bba0>7439\n<e9bba4>20041\n<e9bba5>7440\n<e9bba7>15368\n<e9bba8>7441\n<e9bbae>15369\n<e9bbaf>7442\n<e9bbb0>20042\n<e9bbb1>23032\n<e9bbb2>20043\n<e9bbb4>7443\n<e9bbb5>23033\n<e9bbb8>23034\n<e9bbb9>7446\n<e9bbbf>19113\n<e9bc82>19114\n<e9bc83>19116\n<e9bc89>20044\n<e9bc8e>3102\n<e9bc8f>20045\n<e9bc90>15370\n<e9bc91>23035\n<e9bc92>15371\n<e9bc93>1937\n<e9bc94>20046\n<e9bc95>7453\n<e9bc96>23036\n<e9bc97>15372\n<e9bc99>15373\n<e9bc9a>23037\n<e9bc9b>20047\n<e9bc9f>23038\n<e9bca0>2767\n<e9bca1>7454\n<e9bca2>20048\n<e9bca6>20049\n<e9bcac>7455\n<e9bcaf>15374\n<e9bcb4>20052\n<e9bcb7>15375\n<e9bcb9>15376\n<e9bcba>19117\n<e9bcbb>3475\n<e9bcbc>23041\n<e9bcbd>19118\n<e9bcbe>7456\n<e9bcbf>23042\n<e9bd81>15377\n<e9bd85>15378\n<e9bd86>19119\n<e9bd87>23045\n<e9bd8a>7457\n<e9bd8b>5898\n<e9bd8e>6779\n<e9bd8f>7174\n<e9bd92>7458\n<e9bd93>19120\n<e9bd94>7459\n<e9bd95>19121\n<e9bd96>23046\n<e9bd97>15379\n<e9bd98>19122\n<e9bd9a>20053\n<e9bd9d>19124\n<e9bd9e>23047\n<e9bda2>4024\n<e9bda3>7460\n<e9bda8>15380\n<e9bda9>19126\n<e9bdaa>7467\n<e9bdac>7466\n<e9bdad>19127\n<e9bdae>23048\n<e9bdaf>20054\n<e9bdb0>19128\n<e9bdb1>15381\n<e9bdb2>7469\n<e9bdb3>23049\n<e9bdb5>15382\n<e9bdb6>7470\n<e9bdb7>7468\n<e9bdba>23050\n<e9bdbd>23051\n<e9be8d>3966\n<e9be8f>23052\n<e9be90>15383\n<e9be94>15384\n<e9be95>7471\n<e9be96>23055\n<e9be97>17232\n<e9be9c>7472\n<e9be9d>5927\n<e9be9e>20055\n<e9bea0>7473\n<e9bea1>23056\n<e9bea2>15385\n<e9bea3>23057\n<e9bea5>20056\n<e9beb4>14048\n<e9bebc>15431\n<e9bebd>15429\n<e9bebe>15434\n<e9bebf>20068\n<e9bf84>14089\n<e9bf86>14168\n<e9bf8c>20156\n<efa1ba>15447\n<efa1bf>15448\n<efa489>13739\n<efa49d>13392\n<efa49f>14084\n<efa4a8>20303\n<efa4a9>20305\n<efa4b6>13394\n<efa59f>13971\n<efa5b0>13344\n<efa683>14088\n<efa699>7811\n<efa69a>14097\n<efa6a2>14095\n<efa783>7808\n<efa790>13396\n<efa79c>13393\n<efa7ac>7750\n<efa883>13956\n<efa88e>8410\n<efa88f>8421\n<efa890>7746\n<efa891>14290\n<efa892>8481\n<efa893>8497\n<efa894>8499\n<efa895>20307\n<efa896>8548\n<efa897>8571\n<efa89b>8583\n<efa89c>8587\n<efa89d>8590\n<efa89e>8599\n<efa89f>8610\n<efa8a1>8613\n<efa8a2>8622\n<efa8a3>8630\n<efa8a4>18760\n<efa8a5>8633\n<efa8a6>8636\n<efa8a7>8664\n<efa8a8>8671\n<efa8a9>8687\n<efa8ac>8702\n<efa8ad>8715\n<efa8b0>13382\n<efa8b1>13360\n<efa8b2>13389\n<efa8b3>13385\n<efa8b4>13338\n<efa8b5>13378\n<efa8b6>7651\n<efa8b7>13366\n<efa8b8>13333\n<efa8b9>13384\n<efa8ba>13387\n<efa8bb>13361\n<efa8bc>16837\n<efa8bd>13326\n<efa8be>13328\n<efa8bf>13363\n<efa981>13381\n<efa982>13334\n<efa983>13352\n<efa984>13375\n<efa985>13327\n<efa986>7700\n<efa987>13332\n<efa988>13347\n<efa989>15398\n<efa98a>7732\n<efa98b>13379\n<efa98c>13348\n<efa98d>13345\n<efa98e>13335\n<efa98f>13391\n<efa990>13359\n<efa991>13351\n<efa992>13325\n<efa993>13371\n<efa994>13343\n<efa995>13373\n<efa996>13358\n<efa997>13399\n<efa998>18366\n<efa999>13376\n<efa99a>13353\n<efa99d>14199\n<efa99e>14198\n<efa99f>13367\n<efa9a0>13331\n<efa9a1>13346\n<efa9a2>13321\n<efa9a3>13339\n<efa9a4>13380\n<efa9a5>13364\n<efa9a6>15403\n<efa9a7>13320\n<efa9a8>13374\n<efa9a9>13337\n<efa9aa>7788\n<efa9ab>13740\n<efa9ac>14281\n<efa9ad>13695\n<efac80>9358\n<efb890>8268\n<efb899>7897\n<efb8b0>7898\n<efb8b3>7890\n<efb8bf>7907\n<efb980>7908\n<efbc81>642\n<efbc82>8007\n<efbc83>716\n<efbc84>712\n<efbc85>715\n<efbc86>717\n<efbc87>8006\n<efbc8a>718\n<efbc8b>692\n<efbc8c>636\n<efbc8d>693\n<efbc8e>637\n<efbc8f>663\n<efbc9c>699\n<efbc9d>697\n<efbc9e>700\n<efbc9f>641\n<efbca0>719\n<efbcbb>678\n<efbcbc>664\n<efbcbd>679\n<efbcbe>648\n<efbcbf>650\n<efbd80>646\n<efbd9b>680\n<efbd9c>667\n<efbd9d>681\n<efbd9e>665\n<efbfa2>751\n<efbfa3>649\n<efbfa4>8005\n<efbfa5>711\n<efbfa8>323\n<f09f8480>8061\n<f09f8882>10985\n<f09f88b7>11024\n<f0a0808b>13839\n<f0a08289>17233\n<f0a0828a>14108\n<f0a082a2>17240\n<f0a082a4>17243\n<f0a082b0>14209\n<f0a083b5>20057\n<f0a08598>20075\n<f0a086a2>13857\n<f0a08893>17259\n<f0a08cab>17282\n<f0a08db1>17291\n<f0a08e81>17289\n<f0a08fb9>17295\n<f0a0918a>17297\n<f0a09489>17299\n<f0a094bf>14188\n<f0a096b1>20080\n<f0a09796>17308\n<f0a09891>14294\n<f0a098a8>14105\n<f0a09bac>20083\n<f0a09d8f>17312\n<f0a09f88>20128\n<f0a0a087>17319\n<f0a0a0ba>17321\n<f0a0a2b9>17327\n<f0a0a48e>13523\n<f0a0a5bc>17331\n<f0a0a684>14109\n<f0a0a69d>17332\n<f0a0a9a4>13755\n<f0a0ab93>17337\n<f0a0ac9d>17340\n<f0a0ae9f>13803\n<f0a0aeb7>13706\n<f0a0b585>17359\n<f0a0b598>20090\n<f0a0b7a1>17373\n<f0a0b9a4>17388\n<f0a0b9ad>17380\n<f0a0ba95>17379\n<f0a0bd9f>17391\n<f0a18881>17414\n<f0a188bd>13953\n<f0a18995>17415\n<f0a189b4>17421\n<f0a189bb>17417\n<f0a18b97>17429\n<f0a18ba4>17428\n<f0a18bbd>17435\n<f0a18c9b>16816\n<f0a18cb6>17437\n<f0a18d84>17438\n<f0a18f84>17449\n<f0a191ad>17462\n<f0a191ae>16821\n<f0a19797>17472\n<f0a19987>17480\n<f0a19ab4>16838\n<f0a19c86>17492\n<f0a19d82>17493\n<f0a1a2bd>16833\n<f0a1a783>17525\n<f0a1a89a>7825\n<f0a1b196>17539\n<f0a1b4ad>17544\n<f0a1b585>17545\n<f0a1b5a2>17547\n<f0a1b5b8>17546\n<f0a1b692>17556\n<f0a1b69c>17552\n<f0a1b6a1>17551\n<f0a1b6b7>17559\n<f0a1b7a0>17561\n<f0a1b8b3>17562\n<f0a1b8b4>16845\n<f0a1bc9e>17575\n<f0a1bdb6>17582\n<f0a1bfba>17585\n<f0a285bb>17599\n<f0a28898>19105\n<f0a28c9e>17605\n<f0a28ead>17608\n<f0a29889>15443\n<f0a29bb3>17632\n<f0a2a19b>17647\n<f0a2a2ab>17653\n<f0a2a68f>17657\n<f0a2aab8>17667\n<f0a2ad86>17680\n<f0a2aea6>17683\n<f0a2b09d>17682\n<f0a2b0a4>17686\n<f0a2b7a1>17710\n<f0a2b982>20124\n<f0a2bfab>20130\n<f0a386b6>17744\n<f0a38783>17742\n<f0a38784>16888\n<f0a387b5>17743\n<f0a38db2>17761\n<f0a38f8c>14140\n<f0a38f90>17768\n<f0a38f92>17764\n<f0a38f93>17763\n<f0a38f95>17770\n<f0a38f9a>17772\n<f0a38f9f>17774\n<f0a38fa4>17769\n<f0a38fbe>15422\n<f0a3918a>17782\n<f0a3918b>17784\n<f0a39191>17783\n<f0a391a5>17788\n<f0a393a4>17814\n<f0a3959a>17815\n<f0a39694>17827\n<f0a39784>16905\n<f0a398b8>17843\n<f0a398b9>17841\n<f0a398ba>15393\n<f0a39987>17842\n<f0a39c8c>17863\n<f0a39c9c>17854\n<f0a39cbf>16914\n<f0a39da3>16916\n<f0a39da4>17867\n<f0a39fa7>17875\n<f0a39fb1>20152\n<f0a39fbf>17874\n<f0a3a0a4>17880\n<f0a3a0bd>17885\n<f0a3aa98>17897\n<f0a3b1bf>17910\n<f0a3b2be>14293\n<f0a3b3be>13904\n<f0a3b480>17925\n<f0a3b48e>18394\n<f0a3b580>17942\n<f0a3b793>17945\n<f0a3b7b9>17944\n<f0a3b7ba>17943\n<f0a3bdbe>17983\n<f0a4818b>20168\n<f0a48296>17998\n<f0a48483>18003\n<f0a48786>18015\n<f0a487be>18018\n<f0a48bae>14282\n<f0a48ebc>18039\n<f0a48f90>7838\n<f0a498a9>18049\n<f0a49aa5>18055\n<f0a49fb1>16970\n<f0a4a296>18077\n<f0a4a98d>18104\n<f0a4ad96>18117\n<f0a4adaf>18119\n<f0a4b096>18124\n<f0a4b494>13995\n<f0a4b884>20058\n<f0a4b88e>18158\n<f0a4b8b7>18162\n<f0a4b9aa>18167\n<f0a4ba8b>18170\n<f0a4bfb2>20059\n<f0a5818a>18181\n<f0a58195>18183\n<f0a584a2>18185\n<f0a586a9>18190\n<f0a5878d>18193\n<f0a587a5>18192\n<f0a5889e>18195\n<f0a5898c>18197\n<f0a590ae>18209\n<f0a5928e>17005\n<f0a59399>18217\n<f0a5948e>17009\n<f0a596a7>18229\n<f0a599bf>14075\n<f0a59db1>17018\n<f0a59ea9>18248\n<f0a59eb4>18249\n<f0a5a1b4>7670\n<f0a5a784>17024\n<f0a5a78c>20112\n<f0a5a794>18268\n<f0a5ab97>13922\n<f0a5aba3>18277\n<f0a5aba4>18276\n<f0a5abb1>18278\n<f0a5aeb2>18293\n<f0a5b18b>18302\n<f0a5b1a4>18303\n<f0a5b6a1>17033\n<f0a5b8ae>18318\n<f0a5b996>18319\n<f0a5b9a2>18322\n<f0a5b9a5>18320\n<f0a5bb82>18327\n<f0a5bb98>18325\n<f0a5bba8>18329\n<f0a5bca3>18330\n<f0a5bd9c>18332\n<f0a5bf94>18339\n<f0a5bfa0>18338\n<f0a5bfbb>18345\n<f0a6808c>18344\n<f0a68097>18352\n<f0a681a0>18355\n<f0a683ad>18365\n<f0a688a2>13691\n<f0a689aa>14189\n<f0a689b0>18385\n<f0a68a86>18386\n<f0a68d8c>20311\n<f0a69082>18398\n<f0a699be>18416\n<f0a69ab0>14100\n<f0a69c9d>18430\n<f0a6a39d>18444\n<f0a6a3aa>18446\n<f0a6a591>13646\n<f0a6a5af>18450\n<f0a6a699>14134\n<f0a6a79d>18452\n<f0a6a89e>18455\n<f0a6a998>18459\n<f0a6aa8c>18463\n<f0a6aab7>18466\n<f0a6abbf>17063\n<f0a6b0a9>17478\n<f0a6b1b3>18506\n<f0a6b29e>20206\n<f0a6b39d>18515\n<f0a6b980>17089\n<f0a6b9a5>18528\n<f0a6be94>18544\n<f0a6bfb8>18553\n<f0a783b4>17103\n<f0a7848d>18571\n<f0a784b9>18574\n<f0a78f9a>18611\n<f0a78f9b>18610\n<f0a78fbe>18617\n<f0a79090>18620\n<f0a79189>18624\n<f0a79894>18638\n<f0a79895>18637\n<f0a798b1>18640\n<f0a79a84>17117\n<f0a79a93>18645\n<f0a79c8e>18650\n<f0a79ca3>18652\n<f0a79d92>18656\n<f0a7a685>18672\n<f0a7a6b4>20133\n<f0a7aa84>18684\n<f0a7aeb3>18699\n<f0a7aebe>18701\n<f0a7af87>18702\n<f0a7b0bc>20220\n<f0a7b2b8>18708\n<f0a7b5b3>20060\n<f0a7b6a0>18716\n<f0a7b890>18718\n<f0a7beb7>13898\n<f0a8828a>18727\n<f0a882bb>18733\n<f0a889b7>17140\n<f0a88a82>18745\n<f0a88bb3>18747\n<f0a88f8d>17146\n<f0a8908c>18754\n<f0a89195>18757\n<f0a895ab>18770\n<f0a89b97>18784\n<f0a89bba>18787\n<f0a8a586>18812\n<f0a8a589>18811\n<f0a8a5ab>18817\n<f0a8a687>14253\n<f0a8a688>18824\n<f0a8a89e>18843\n<f0a8a8a9>18844\n<f0a8a983>18848\n<f0a8a9b1>18847\n<f0a8aa99>18855\n<f0a8ab8d>18856\n<f0a8ab9d>18863\n<f0a8aba4>18862\n<f0a8af81>18874\n<f0a8afaf>18875\n<f0a8b39d>7641\n<f0a8b490>18882\n<f0a8b5b1>18883\n<f0a8b7bb>18885\n<f0a8b897>14256\n<f0a8b89f>18886\n<f0a8b8b6>18890\n<f0a8ba89>18893\n<f0a8bbab>18895\n<f0a8bbb6>7673\n<f0a8bcb2>18897\n<f0a8bfb8>18903\n<f0a98aa0>18917\n<f0a98ab1>18918\n<f0a99290>18935\n<f0a9978f>18944\n<f0a999bf>13849\n<f0a99bb0>18959\n<f0a99c99>18962\n<f0a99d90>18966\n<f0a9a386>18983\n<f0a9a9b2>19001\n<f0a9b58b>13717\n<f0a9b79b>19026\n<f0a9b895>19036\n<f0a9b8bd>20315\n<f0a9b989>19038\n<f0a9ba8a>19037\n<f0a9bb84>19046\n<f0a9bb9b>19054\n<f0a9bba9>19051\n<f0a9bf8e>19071\n<f0a9bf97>19071\n<f0aa809a>19077\n<f0aa80af>19075\n<f0aa8282>19084\n<f0aa83b9>19083\n<f0aa8690>17227\n<f0aa8ab2>20072\n<f0aa8e8c>19109\n<f0aa90b7>19111\n<f0aa97b1>19123\n<f0aa9882>19125\n<f0aa989a>20316\n<f0aa9ab2>19129\n<f0aaa7a6>14145\n<f0ab9d86>13780\n<f0ab9d91>13866\n<f0ab9d93>20088\n<f0ab9d9a>20096\n<f0ab9d9c>20097\n<f0ab9da5>20247\n<f0ab9db6>20114\n<f0ab9db7>13782\n<f0ab9dbc>20125\n<f0ab9e82>20141\n<f0ab9e89>14064\n<f0ab9e8b>20149\n<f0ab9e8e>13724\n<f0ab9e94>20153\n<f0ab9eac>20176\n<f0ab9eaf>20180\n<f0ab9ebd>14174\n<f0ab9f89>20194\n<f0ab9f8f>20201\n<f0ab9f92>20204\n<f0ab9f98>13651\n<f0ab9fb0>20240\n<f0aba08d>20256\n<f0aba097>20260\n<f0aba09a>14278\n<f0afa084>15388\n<f0afa08f>7814\n<f0afa095>20061\n<f0afa098>7817\n<f0afa09a>13954\n<f0afa0a2>13684\n<f0afa0a8>13807\n<f0afa0ac>14109\n<f0afa0b3>13719\n<f0afa0bf>13815\n<f0afa186>20062\n<f0afa192>13841\n<f0afa1a2>13998\n<f0afa1ad>14121\n<f0afa1b3>13832\n<f0afa1b7>7754\n<f0afa284>7734\n<f0afa299>20063\n<f0afa29a>13928\n<f0afa2a6>20064\n<f0afa2ac>13750\n<f0afa2b2>13867\n<f0afa2b6>14129\n<f0afa393>7816\n<f0afa39b>14140\n<f0afa39c>7695\n<f0afa3a1>14291\n<f0afa3a5>20065\n<f0afa3aa>13679\n<f0afa3ad>7665\n<f0afa3bc>13656\n<f0afa483>13768\n<f0afa48b>13801\n<f0afa48f>13932\n<f0afa49a>13916\n<f0afa4a0>7839\n<f0afa4a1>13809\n<f0afa585>13357\n<f0afa587>13854\n<f0afa5ac>14180\n<f0afa695>13670\n<f0afa790>14068\n<f0afa79e>20066\n<f0afa79f>14069\n<f0afa7b4>15269\nendcidchar\nbegincidrange\n<e1b8be><e1b8bf>15729\n<e280a0><e280a1>776\n<e280b2><e280b3>708\n<e280b9><e280ba>110\n<e28187><e28188>16278\n<e281b4><e281b9>9378\n<e28280><e28289>9384\n<e28593><e28594>9375\n<e28596><e2859a>9785\n<e2859b><e2859e>9371\n<e285a0><e285a9>7575\n<e285aa><e285ab>8225\n<e285b0><e285b9>8092\n<e285ba><e285bb>8298\n<e28690><e28691>737\n<e28696><e28697>12204\n<e28698><e28699>12202\n<e28784><e28785>8310\n<e288a5><e288a6>15489\n<e288a7><e288a8>749\n<e288ab><e288ac>769\n<e289a4><e289a5>20369\n<e289a6><e289a7>701\n<e289aa><e289ab>763\n<e289b2><e289b3>12121\n<e289b6><e289b7>15509\n<e28a82><e28a83>745\n<e28a84><e28a85>15472\n<e28a86><e28a87>743\n<e28a8a><e28a8b>15474\n<e28b9a><e28b9b>15725\n<e28c85><e28c86>15478\n<e28ca9><e28caa>682\n<e28e9d><e28e9e>12144\n<e28ea3><e28ea4>12152\n<e28ea7><e28ea9>8178\n<e28eab><e28ead>8174\n<e28eb0><e28eb1>16312\n<e28ebe><e28ebf>16253\n<e28f80><e28f8c>16255\n<e291a0><e291b3>7555\n<e291b4><e291bf>8071\n<e29280><e29287>8083\n<e29288><e29290>8062\n<e29291><e29292>20587\n<e2929c><e292b5>8112\n<e292b6><e292bf>10339\n<e29380><e2938f>10349\n<e29390><e293a9>10313\n<e293ab><e293b4>10515\n<e293b5><e293be>16223\n<e29480><e294bf>7479\n<e29580><e2958b>7543\n<e295ad><e295ae>8247\n<e295b1><e295b3>8261\n<e29681><e29688>8230\n<e29694><e29695>8245\n<e29790><e29793>16274\n<e297a2><e297a3>8255\n<e29880><e29883>8215\n<e29896><e29897>16233\n<e2989c><e2989d>8220\n<e299a8><e299a9>12098\n<e299b2><e299bd>16314\n<e29db6><e29dbe>8286\n<e2a4b4><e2a4b5>16201\n<e2a7ba><e2a7bb>16207\n<e2ac85><e2ac87>8207\n<e2ba8c><e2ba8d>13833\n<e2baa1><e2baa2>14689\n<e2babe><e2babf>14197\n<e2bc94><e2bc95>4301\n<e2bca1><e2bca2>4538\n<e2bf91><e2bf92>7457\n<e2bf94><e2bf95>7472\n<e38080><e38082>633\n<e38085><e38087>657\n<e38088><e38091>682\n<e38094><e38095>676\n<e38096><e38097>16197\n<e38098><e38099>12129\n<e380b3><e380b5>12108\n<e38181><e381bf>842\n<e38280><e38293>905\n<e38294><e38296>7958\n<e38299><e3829a>16326\n<e3829b><e3829c>643\n<e3829d><e3829e>653\n<e382a1><e382bf>925\n<e38380><e383b6>956\n<e383b7><e383ba>8313\n<e383bd><e383be>651\n<e38690><e3869f>16283\n<e387b0><e387b9>16236\n<e387ba><e387bf>16247\n<e388a0><e388a9>10126\n<e388aa><e388af>8198\n<e388b1><e388b2>7618\n<e38992><e3899b>8102\n<e3899c><e3899f>10244\n<e38a80><e38a89>10461\n<e38a8a><e38a8f>10472\n<e38aa0><e38aa1>10486\n<e38aa4><e38aa8>7613\n<e38ab1><e38abf>10248\n<e38b90><e38bbe>10413\n<e38c81><e38c82>11874\n<e38c8e><e38c93>11889\n<e38c9a><e38c9d>11900\n<e38c9f><e38ca1>11904\n<e38ca8><e38ca9>11912\n<e38cae><e38cb0>11918\n<e38cb4><e38cb5>11924\n<e38cbe><e38cbf>11936\n<e38d83><e38d86>11939\n<e38d8b><e38d8c>11944\n<e38d8f><e38d90>11946\n<e38d95><e38d96>11955\n<e38e85><e38e87>8031\n<e38e88><e38e89>8192\n<e38e8e><e38e8f>7604\n<e38e9c><e38e9e>7601\n<e38ea4><e38ea5>8022\n<e38f97><e38f98>11869\n<e3959d><e3959e>17341\n<e39da1><e39da2>17528\n<e4b884><e4b885>14296\n<e4b8a3><e4b8a4>19141\n<e4b8af><e4b8b0>14300\n<e4b980><e4b981>14302\n<e4b9b4><e4b9b5>21079\n<e4ba9e><e4baa0>4108\n<e4baab><e4baac>1687\n<e4bd8b><e4bd8c>21096\n<e4bdb7><e4bdb8>17260\n<e4bdbd><e4bdbe>14321\n<e4bebb><e4bebd>21112\n<e4bf80><e4bf81>21115\n<e4bfa4><e4bfa5>4152\n<e58080><e58081>14327\n<e580b2><e580b3>21129\n<e58191><e58192>21134\n<e58283><e58284>21142\n<e58292><e58293>17278\n<e5829f><e582a1>21148\n<e582af><e582b0>21151\n<e582ba><e582bb>17284\n<e58389><e5838a>4184\n<e5839c><e5839d>21157\n<e58481><e58482>4197\n<e5848c><e5848e>19167\n<e5849c><e5849d>21166\n<e584a7><e584a8>21169\n<e584ac><e584ad>21171\n<e585a9><e585aa>4215\n<e58695><e58696>4226\n<e586a9><e586ab>4231\n<e586b1><e586b2>4235\n<e58793><e58794>19179\n<e58881><e58882>14355\n<e588b1><e588b2>19187\n<e5898b><e5898c>4261\n<e589b8><e589b9>19194\n<e58a95><e58a97>21198\n<e58aac><e58aad>4279\n<e58ab6><e58ab8>21205\n<e58aba><e58abb>17323\n<e58bb8><e58bb9>4293\n<e58c8a><e58c8b>14364\n<e58ca7><e58ca9>21226\n<e58cab><e58cac>21229\n<e58e87><e58e88>21237\n<e58f84><e58f85>19217\n<e58f92><e58f93>21245\n<e590ac><e590ad>4342\n<e590b4><e590b5>19223\n<e591ad><e591ae>21261\n<e593a5><e593a6>4378\n<e59480><e59481>17364\n<e5948c><e5948d>21273\n<e59596><e59597>4394\n<e5959a><e5959b>21281\n<e59797><e59798>21289\n<e5988e><e5988f>14397\n<e59891><e59892>19257\n<e59983><e59984>21299\n<e599a1><e599a3>21302\n<e599b1><e599b2>14407\n<e59aac><e59aad>14411\n<e59ba5><e59ba7>21314\n<e59bb6><e59bb7>17412\n<e59c81><e59c82>21317\n<e59c9a><e59c9b>19277\n<e59ca4><e59ca5>21322\n<e59cb3><e59cb4>14421\n<e59cb7><e59cb8>4475\n<e59cbd><e59cbe>19282\n<e59d85><e59d86>17418\n<e59db3><e59db5>17424\n<e59e9d><e59e9e>17431\n<e59f92><e59f93>4496\n<e59fb5><e59fb6>14430\n<e5a287><e5a288>21357\n<e5a28a><e5a28b>17453\n<e5a28f><e5a290>17456\n<e5a2a0><e5a2a2>21361\n<e5a3b3><e5a3b4>17466\n<e5a3bb><e5a3bd>4535\n<e5a492><e5a493>21372\n<e5a4ac><e5a4ad>4544\n<e5a4b5><e5a4b6>21379\n<e5a5b5><e5a5b6>17481\n<e5a799><e5a79a>4571\n<e5a7a3><e5a7a4>14452\n<e5a8b5><e5a8b6>4582\n<e5a984><e5a985>21410\n<e5aa9f><e5aaa0>17503\n<e5abba><e5abbb>4597\n<e5ad9a><e5ad9b>4612\n<e5adbe><e5adbf>14473\n<e5ae90><e5ae91>21432\n<e5aea8><e5aea9>21435\n<e5aeb1><e5aeb2>21439\n<e5af99><e5af9a>21446\n<e5b087><e5b088>4641\n<e5b0b8><e5b0b9>4648\n<e5b1a7><e5b1a8>17541\n<e5b1b4><e5b1b5>21457\n<e5b3b1><e5b3b2>21468\n<e5b59f><e5b5a0>21476\n<e5b5b9><e5b5ba>21480\n<e5b6b8><e5b6b9>8446\n<e5b894><e5b895>14499\n<e5b8b6><e5b8b7>4725\n<e5b990><e5b991>21496\n<e5b9ab><e5b9ac>14504\n<e5b9ad><e5b9ae>17597\n<e5b9b5><e5b9b6>4737\n<e5babe><e5babf>14508\n<e5bb81><e5bb82>4743\n<e5bb94><e5bb95>19352\n<e5bb9a><e5bb9b>4751\n<e5bba8><e5bba9>4755\n<e5bc9c><e5bc9d>14514\n<e5bcab><e5bcac>21513\n<e5bd96><e5bd97>4780\n<e5bdb4><e5bdb5>21522\n<e5beb0><e5beb1>21530\n<e5bf90><e5bf91>21533\n<e5bf92><e5bf94>17618\n<e5bf98><e5bf99>3688\n<e5bfae><e5bfaf>17622\n<e68196><e68197>21547\n<e68296><e68297>4844\n<e68389><e6838a>21563\n<e6838e><e6838f>21565\n<e683b6><e683b7>4862\n<e6848d><e6848e>4871\n<e68492><e68494>14547\n<e68598><e6859a>4887\n<e68680><e68681>21583\n<e68683><e68684>21585\n<e68692><e68693>17648\n<e68780><e68781>21591\n<e6878e><e6878f>21593\n<e687ac><e687ad>21599\n<e68888><e68889>4930\n<e688b2><e688b3>4941\n<e68a8d><e68a8f>21614\n<e68a92><e68a93>4954\n<e68ab6><e68ab7>21618\n<e68abe><e68abf>21621\n<e68cbb><e68cbc>17675\n<e68d82><e68d83>14570\n<e68eae><e68eaf>19400\n<e68f94><e68f95>17689\n<e68fab><e68fac>17692\n<e68fb8><e68fb9>19403\n<e69298><e69299>19417\n<e692be><e692bf>14588\n<e6938b><e6938c>17706\n<e693a0><e693a1>5040\n<e693a9><e693aa>21668\n<e69488><e6948a>21672\n<e694b4><e694b5>5058\n<e694bc><e694bd>21679\n<e69682><e69683>5073\n<e697a0><e697a1>5088\n<e697b4><e697b5>21695\n<e697be><e697bf>21697\n<e69891><e69892>21700\n<e698b5><e698b6>5096\n<e6999b><e6999c>14605\n<e699a7><e699a8>5107\n<e699ac><e699ad>17746\n<e699b7><e699b8>16889\n<e69a8b><e69a8c>19437\n<e69a9a><e69a9c>21718\n<e69b82><e69b83>21723\n<e69ca6><e69ca7>5138\n<e69da3><e69da4>5151\n<e69ebc><e69ebd>21742\n<e6a0b0><e6a0b1>14627\n<e6a1af><e6a1b1>21759\n<e6a298><e6a29a>17805\n<e6a2aa><e6a2ab>17809\n<e6a39c><e6a39d>21770\n<e6a3a4><e6a3a5>17820\n<e6a3b0><e6a3b1>14640\n<e6a5b0><e6a5b1>21783\n<e6a796><e6a797>14655\n<e6a7ae><e6a7af>17845\n<e6a8b2><e6a8b3>17855\n<e6a990><e6a991>14664\n<e6aa86><e6aa87>21800\n<e6aa9d><e6aa9f>14671\n<e6aaa2><e6aaa3>5310\n<e6aab0><e6aab1>21803\n<e6aabe><e6aabf>21806\n<e6ab88><e6ab89>19471\n<e6ab95><e6ab96>21809\n<e6abb1><e6abb3>17876\n<e6ac86><e6ac87>21814\n<e6ac8f><e6ac91>17882\n<e6adb8><e6adb9>5348\n<e6adbd><e6adbe>19476\n<e6ae9f><e6aea0>21828\n<e6aea2><e6aea3>21830\n<e6aeaa><e6aeab>5359\n<e6aeb8><e6aeb9>21834\n<e6af83><e6af84>21836\n<e6af87><e6af89>17899\n<e6afa6><e6afa7>17903\n<e6b093><e6b094>5377\n<e6b0a6><e6b0a8>21842\n<e6b3ab><e6b3ac>14701\n<e6b4a6><e6b4a7>17928\n<e6b680><e6b681>17936\n<e6b988><e6b989>17959\n<e6b98b><e6b98c>17961\n<e6b993><e6b994>17964\n<e6baad><e6baae>21887\n<e6bb94><e6bb95>5482\n<e6bb9a><e6bb9b>19502\n<e6bbad><e6bbae>21895\n<e6bea7><e6bea8>14736\n<e6bf88><e6bf89>17995\n<e7819d><e7819e>14746\n<e78393><e78394>14754\n<e78395><e78396>19516\n<e78586><e78587>8540\n<e786ae><e786af>18037\n<e78888><e78889>21944\n<e788bb><e788bc>5604\n<e7898f><e78990>19524\n<e78995><e78996>14776\n<e789ae><e789af>18050\n<e789bb><e789bc>21955\n<e78b95><e78b96>21960\n<e78c84><e78c85>14784\n<e78c98><e78c99>18067\n<e78cba><e78cbb>19538\n<e78d8e><e78d8f>5643\n<e78d9d><e78da0>21970\n<e78dae><e78daf>18078\n<e78e85><e78e86>14792\n<e78e9e><e78ea0>14795\n<e7909a><e7909b>14810\n<e790af><e790b1>14815\n<e791a7><e791a8>21994\n<e79285><e79287>14829\n<e792b1><e792b2>22001\n<e793b0><e793b1>5694\n<e794bd><e794be>18125\n<e795bb><e795bc>22023\n<e795bd><e795be>18134\n<e79686><e79687>5724\n<e79692><e79693>14848\n<e7979f><e797a0>18148\n<e797b2><e797b3>5755\n<e797be><e797bf>5749\n<e79895><e79896>14855\n<e7989b><e7989c>18160\n<e798a0><e798a2>5762\n<e798b9><e798ba>22032\n<e79987><e79988>5769\n<e799a1><e799a2>5774\n<e799a8><e799aa>5776\n<e79a8c><e79a8d>22038\n<e79a99><e79a9a>5793\n<e79aa2><e79aa3>22041\n<e79aa4><e79aa5>14868\n<e79aa7><e79aa8>18178\n<e79ab8><e79aba>5797\n<e79c94><e79c95>22050\n<e79ca5><e79ca6>5817\n<e79cb7><e79cb8>5820\n<e79d8d><e79d8e>16999\n<e79d96><e79d97>22057\n<e79d9f><e79da0>14877\n<e79db3><e79db4>22060\n<e79e8c><e79e8d>19591\n<e79ebc><e79ebd>5840\n<e79f9e><e79f9f>18203\n<e7a0ad><e7a0ae>14888\n<e7a1a0><e7a1a1>22080\n<e7a3a0><e7a3a1>14898\n<e7a3b9><e7a3ba>18226\n<e7a4a7><e7a4a8>19613\n<e7a59b><e7a59c>14908\n<e7a6b9><e7a6ba>5902\n<e7a78c><e7a78d>18244\n<e7a898><e7a899>5912\n<e7a8b4><e7a8b5>22131\n<e7a9a1><e7a9a2>5924\n<e7aabb><e7aabc>14932\n<e7ab99><e7ab9a>5950\n<e7aba1><e7aba2>5953\n<e7ac98><e7ac99>5963\n<e7acae><e7acaf>18281\n<e7adb0><e7adb1>5980\n<e7aeba><e7aebb>22161\n<e7afb4><e7afb5>22167\n<e7afb9><e7afba>22169\n<e7b0b9><e7b0ba>22180\n<e7b192><e7b193>19648\n<e7b19b><e7b19d>19650\n<e7b2b6><e7b2b7>18323\n<e7b388><e7b389>14962\n<e7b487><e7b489>14968\n<e7b4bd><e7b4be>18340\n<e7b68b><e7b68c>14980\n<e7b783><e7b786>22208\n<e7b78d><e7b78e>22212\n<e7b7b5><e7b7b6>19672\n<e7b999><e7b99a>6133\n<e7ba86><e7ba87>18375\n<e7ba88><e7ba89>6145\n<e7ba93><e7ba94>6150\n<e7ba9b><e7ba9c>6154\n<e7ba9d><e7ba9e>22229\n<e7bd8c><e7bd8e>6159\n<e7bd90><e7bd91>6162\n<e7bd92><e7bd93>14999\n<e7bd9f><e7bda0>6167\n<e7bda3><e7bda4>18387\n<e7bda8><e7bda9>6169\n<e7bdbd><e7bdbe>18390\n<e7bf85><e7bf86>6191\n<e7bfae><e7bfaf>15008\n<e7bfbd><e7bfbf>19689\n<e88098><e88099>6206\n<e8809f><e880a0>22247\n<e88397><e88398>15024\n<e885a5><e885a6>6260\n<e885a7><e885a8>17054\n<e8879d><e8879e>19717\n<e8879f><e887a0>6290\n<e887b0><e887b2>22282\n<e887ba><e887bb>6293\n<e88881><e88882>6296\n<e88893><e88894>19724\n<e889aa><e889ab>6317\n<e889b7><e889b8>6321\n<e88a80><e88a81>22297\n<e88a9a><e88a9b>22303\n<e88aa3><e88aa4>17065\n<e88aa7><e88aa8>18473\n<e88c87><e88c88>18482\n<e88c8a><e88c8b>22310\n<e88c97><e88c98>6357\n<e88c9e><e88c9f>22312\n<e88d8d><e88d8e>22321\n<e88e94><e88e95>18495\n<e89191><e89192>18510\n<e89199><e8919a>18512\n<e892a9><e892aa>22350\n<e89387><e89388>22352\n<e8938e><e8938f>18525\n<e89482><e89483>22357\n<e89497><e89498>6429\n<e894a4><e894a5>18535\n<e8959f><e895a0>22373\n<e895a1><e895a2>18542\n<e896bd><e896bf>22384\n<e89798><e89799>18559\n<e89884><e89885>17100\n<e8988d><e8988e>22393\n<e89998><e89999>22400\n<e899a0><e899a1>22403\n<e89a8b><e89a8c>6489\n<e89a9c><e89a9d>18581\n<e89aa7><e89aa8>15087\n<e89aa9><e89aaa>6487\n<e89ab4><e89ab5>22413\n<e89cbc><e89cbd>22430\n<e89da4><e89da5>18606\n<e89e83><e89e86>22436\n<e89e97><e89e98>19764\n<e89eac><e89ead>15100\n<e89fa5><e89fa6>18626\n<e89fb6><e89fb7>6559\n<e8a188><e8a189>22465\n<e8a29a><e8a29c>19782\n<e8a2bd><e8a2be>15117\n<e8a383><e8a384>6598\n<e8a38b><e8a38c>22478\n<e8a398><e8a399>6601\n<e8a3b0><e8a3b1>15122\n<e8a48e><e8a48f>19788\n<e8a495><e8a496>22484\n<e8a498><e8a49a>15125\n<e8a4aa><e8a4ab>6617\n<e8a69b><e8a69c>22504\n<e8a79c><e8a79d>6652\n<e8a884><e8a885>22513\n<e8a8ab><e8a8ac>22519\n<e8a9b6><e8a9b7>22529\n<e8a9ba><e8a9bb>22531\n<e8aaa5><e8aaa6>6680\n<e8ab93><e8ab95>22549\n<e8ad83><e8ad84>15145\n<e8ae92><e8ae93>6730\n<e8ae94><e8ae95>18696\n<e8ae99><e8ae9a>6733\n<e8b1a3><e8b1a4>22573\n<e8b1b5><e8b1b6>22576\n<e8b286><e8b287>22579\n<e8b28d><e8b28e>6751\n<e8b2b2><e8b2b3>6760\n<e8b3ba><e8b3bb>6770\n<e8b484><e8b485>6772\n<e8b7aa><e8b7ab>6799\n<e8b7b1><e8b7b2>19845\n<e8b884><e8b885>22614\n<e8b888><e8b889>6804\n<e8b89d><e8b89e>6807\n<e8b8a1><e8b8a2>18730\n<e8b8b7><e8b8b8>22618\n<e8b980><e8b981>19852\n<e8b99d><e8b99e>22622\n<e8ba82><e8ba83>22625\n<e8bb83><e8bb84>22632\n<e8bc8f><e8bc90>22641\n<e8bca0><e8bca1>22644\n<e8bd92><e8bd93>22653\n<e8bd9d><e8bd9e>22655\n<e8bda2><e8bda4>6879\n<e8bea0><e8bea2>19882\n<e8beb5><e8beb6>15183\n<e8bfb9><e8bfba>6896\n<e980a8><e980aa>22668\n<e980b3><e980b4>22671\n<e9818f><e98192>6910\n<e98384><e98385>17154\n<e98398><e98399>22681\n<e983be><e983bf>18792\n<e984a2><e984a3>17160\n<e98586><e98587>18800\n<e98693><e98694>22701\n<e986ad><e986ae>15213\n<e98780><e98781>6963\n<e98783><e98784>18809\n<e98793><e98794>22707\n<e987a4><e987a5>8644\n<e987a9><e987aa>22710\n<e987ad><e987ae>8642\n<e987b5><e987b6>6973\n<e98884><e98885>22715\n<e98892><e98893>22718\n<e98896><e98897>18815\n<e9889c><e9889d>22721\n<e988a4><e988a6>22723\n<e988ae><e988b0>22726\n<e988b5><e988b6>22729\n<e9899c><e9899d>22735\n<e989ae><e989b0>22738\n<e989b7><e989b8>8658\n<e989bc><e989bd>18825\n<e98aa4><e98aa5>22747\n<e98abb><e98abc>19920\n<e98b8b><e98b8c>15229\n<e98b9c><e98b9d>22757\n<e98da4><e98da5>17167\n<e98e80><e98e81>22782\n<e98eac><e98ead>7017\n<e98eb4><e98eb6>22792\n<e98f84><e98f85>22795\n<e98f96><e98f97>7021\n<e9908d><e9908e>19938\n<e99096><e99097>18869\n<e9968c><e9968d>18880\n<e99698><e99699>7065\n<e9969d><e9969e>22820\n<e99791><e99792>19947\n<e998a5><e998a6>22828\n<e998ae><e998af>7089\n<e998b3><e998b4>18888\n<e998b9><e998ba>22831\n<e99996><e99997>22834\n<e99ab1><e99ab2>7109\n<e99ab8><e99ab9>7114\n<e99ca1><e99ca2>19967\n<e99cbd><e99cbe>7138\n<e99db7><e99db8>22852\n<e99e8f><e99e90>7160\n<e99eb1><e99eb2>18921\n<e99eb3><e99eb4>7166\n<e99eb5><e99eb6>15281\n<e99f84><e99f85>22861\n<e99fb7><e99fb8>22870\n<e9a0b2><e9a0b3>18936\n<e9a18d><e9a18e>1465\n<e9a192><e9a193>15292\n<e9a1a2><e9a1a3>19985\n<e9a1af><e9a1b1>7190\n<e9a2bb><e9a2bc>18946\n<e9a3b0><e9a3b1>18954\n<e9a496><e9a497>18960\n<e9a49a><e9a49c>18963\n<e9a49d><e9a49e>7210\n<e9a4b2><e9a4b3>15301\n<e9a4ba><e9a4bc>18968\n<e9a4bd><e9a4be>7216\n<e9a591><e9a592>7223\n<e9a697><e9a698>7227\n<e9a6ad><e9a6ae>7230\n<e9a6b9><e9a6ba>15308\n<e9a7aa><e9a7ac>22906\n<e9a7ad><e9a7ae>7238\n<e9a7b1><e9a7b2>7240\n<e9a7b4><e9a7b5>22909\n<e9a7bd><e9a7be>22911\n<e9a8ad><e9a8ae>15315\n<e9aab5><e9aab6>15321\n<e9aabd><e9aabe>20002\n<e9ab93><e9ab94>7273\n<e9ab9e><e9ab9f>7275\n<e9aba2><e9aba3>7277\n<e9abb2><e9abb3>22937\n<e9ac84><e9ac85>22944\n<e9ac8d><e9ac8e>20007\n<e9aca2><e9aca3>7291\n<e9aca7><e9acaa>7294\n<e9acae><e9acaf>7298\n<e9acb3><e9acb4>15326\n<e9acb9><e9acba>22950\n<e9ad8d><e9ad8e>7304\n<e9ad96><e9ad97>22953\n<e9adab><e9adac>19020\n<e9adad><e9adae>22958\n<e9adb6><e9adb7>19022\n<e9ae96><e9ae97>7312\n<e9ae9f><e9aea0>7314\n<e9af91><e9af92>7323\n<e9b098><e9b09a>19040\n<e9b189><e9b18a>19052\n<e9b18f><e9b190>17215\n<e9b1a9><e9b1ab>19060\n<e9b1ad><e9b1ae>19063\n<e9b497><e9b498>19073\n<e9b49d><e9b49e>17218\n<e9b4b3><e9b4b4>22988\n<e9b593><e9b594>22993\n<e9b59d><e9b59e>7380\n<e9b5b6><e9b5b7>19086\n<e9b692><e9b693>22999\n<e9b697><e9b698>23002\n<e9b794><e9b795>23008\n<e9b890><e9b892>23015\n<e9b89a><e9b89b>7411\n<e9ba82><e9ba84>20037\n<e9ba8b><e9ba8c>7419\n<e9ba8e><e9ba8f>23020\n<e9bb8e><e9bb90>7432\n<e9bbac><e9bbad>23030\n<e9bbb6><e9bbb7>7444\n<e9bbbb><e9bbbd>7447\n<e9bc87><e9bc88>7450\n<e9bcaa><e9bcab>20050\n<e9bcb1><e9bcb2>23039\n<e9bd83><e9bd84>23043\n<e9bd9f><e9bda1>7461\n<e9bda6><e9bda7>7464\n<e9be91><e9be92>23053\n<e9bf80><e9bf82>20069\n<efa1a0><efa1a2>15444\n<efa692><efa693>7809\n<efa898><efa89a>8579\n<efa8aa><efa8ab>8699\n<efa99b><efa99c>13349\n<efac81><efac82>112\n<efac83><efac84>9359\n<efb891><efb892>7887\n<efb8b1><efb8b2>7892\n<efb8b5><efb8b6>7899\n<efb8b7><efb8b8>7905\n<efb8b9><efb8ba>7901\n<efb8bb><efb8bc>7915\n<efb8bd><efb8be>7909\n<efb981><efb984>7911\n<efb985><efb986>12639\n<efb987><efb988>7903\n<efbc88><efbc89>674\n<efbc90><efbc99>780\n<efbc9a><efbc9b>639\n<efbca1><efbcba>790\n<efbd81><efbd9a>816\n<efbd9f><efbda0>12131\n<efbda1><efbdbf>327\n<efbe80><efbe9f>358\n<efbfa0><efbfa1>713\n<f09f8490><f09f84a9>10004\n<f09f84b0><f09f84bf>10901\n<f09f8580><f09f8589>10917\n<f09f8590><f09f85a9>10631\n<f09f85b0><f09f85bf>11713\n<f09f8680><f09f8689>11729\n<f0a2ad8f><f0a2ad90>17671\n<f0a6bfb6><f0a6bfb7>18554\n<f0a89788><f0a89789>18773\n<f0a8a6ba><f0a8a6bb>18834\nendcidrange\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJIS2004-UTF16-H",
    "content": "begincmap\n/CMapName /UniJIS2004-UTF16-H def\n/WMode 0 def\n/UniJIS-X16 usecmap\nbegincodespacerange\n<0000><d7ff>\n<d800dc00><dbffdfff>\n<e000><ffff>\nendcodespacerange\nbegincidchar\n<2f5b>7965\n<5026>7674\n<50c5>7662\n<5132>7798\n<514e>13949\n<51a4>7817\n<537f>7661\n<53a9>20271\n<53c9>20281\n<53db>7978\n<53df>14111\n<54ac>20277\n<54e8>7703\n<55b0>7664\n<5632>7821\n<5642>7642\n<564c>7721\n<56c0>14116\n<5835>7753\n<5906>21371\n<5a29>7791\n<5c51>7666\n<5c60>7754\n<5df7>7679\n<5e96>7792\n<5edf>7786\n<5efb>13673\n<5f98>13538\n<5fbd>7658\n<6062>20269\n<609e>21558\n<6108>7802\n<6241>7991\n<633a>20286\n<633d>7778\n<6357>7743\n<6372>7676\n<63c3>7975\n<646f>20264\n<647a>7713\n<64b0>7716\n<64e2>7749\n<65a7>20289\n<6666>7650\n<66b5>21722\n<6753>7695\n<6756>20282\n<6897>20279\n<6962>7768\n<696f>13460\n<698a>7686\n<6994>7812\n<69cc>7744\n<6a0b>7780\n<6a3d>7738\n<6adb>7665\n<6b4e>13915\n<6c72>7966\n<6deb>7637\n<6ea2>7635\n<6eba>7750\n<6f23>7809\n<7015>7787\n<701e>7761\n<7026>7741\n<7058>7767\n<7078>20270\n<707c>7696\n<7149>7810\n<714e>7718\n<7152>21933\n<717d>7972\n<723a>20294\n<724c>7771\n<7259>7965\n<72e1>20278\n<7337>14074\n<7511>20284\n<7515>20267\n<7526>20283\n<75bc>20175\n<77a5>7790\n<7941>7668\n<7947>7659\n<79b0>7769\n<79e4>7773\n<7a17>7782\n<7a7f>7973\n<7ac8>20285\n<7b08>20263\n<7b75>20266\n<7bad>7974\n<7bb8>7775\n<7bc7>7979\n<7bdd>7997\n<7c3e>20265\n<7c7e>20293\n<7c82>20272\n<7feb>7657\n<7ff0>7656\n<8171>20275\n<817f>7728\n<8258>14196\n<8292>20292\n<82a6>7961\n<8328>7962\n<845b>7652\n<84ec>7794\n<8511>14013\n<853d>7789\n<85a9>7688\n<85af>7701\n<85f7>7702\n<8654>20274\n<86f8>7733\n<8703>20296\n<8755>7709\n<8805>20295\n<8956>7645\n<8a0a>13860\n<8a1d>20268\n<8a3b>7740\n<8a6e>7720\n<8ab9>13495\n<8afa>7678\n<8b0e>7766\n<8b2c>7785\n<8b7f>21074\n<8c79>20222\n<8ced>7756\n<8fbb>8267\n<8fbf>7735\n<8fc2>7638\n<8fc4>7980\n<8fe6>7647\n<9017>7711\n<9019>7772\n<9022>8266\n<903c>7783\n<9041>20287\n<905c>7726\n<9061>7722\n<912d>7748\n<914b>7698\n<91dc>20290\n<9306>7690\n<9375>20276\n<939a>7745\n<9453>7801\n<9699>20273\n<9771>13624\n<9784>7653\n<9798>7708\n<97ad>20291\n<98f4>7634\n<9905>7799\n<990c>13650\n<9910>7970\n<9957>7968\n<99c1>20288\n<9a19>8003\n<9a4a>22920\n<9bab>20280\n<9bd6>7689\n<9c2f>7636\n<9c52>7796\n<9d09>14272\n<9d60>7683\n<fa20>21073\n<fa40>21072\nendcidchar\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJIS2004-UTF16-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniJIS2004-UTF16-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniJIS2004-UTF16-H)\n%%BeginResource: CMap (UniJIS2004-UTF16-V)\n%%Title: (UniJIS2004-UTF16-V Adobe Japan1 6)\n%%Version: 1.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution.\n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission.\n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniJIS2004-UTF16-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 6 def\nend def\n\n/CMapName /UniJIS2004-UTF16-V def\n/CMapVersion 1.002 def\n/CMapType 1 def\n\n/XUID [1 10 25630] def\n\n/WMode 1 def\n\n100 begincidchar\n<00b0> 8269\n<2010> 7893\n<2015> 7892\n<2016> 7895\n<2025> 7898\n<2026> 7897\n<2032> 8273\n<2033> 8283\n<2190> 738\n<2191> 736\n<2192> 739\n<2193> 737\n<21c4> 8311\n<21c5> 8310\n<21c6> 8312\n<21e6> 8012\n<21e7> 8014\n<21e8> 8011\n<21e9> 8013\n<239b> 12148\n<239c> 12168\n<239d> 12147\n<239e> 12150\n<239f> 12168\n<23a0> 12149\n<23a1> 12156\n<23a2> 12168\n<23a3> 12155\n<23a4> 12158\n<23a5> 12168\n<23a6> 12157\n<23a7> 8168\n<23a8> 8167\n<23a9> 8166\n<23aa> 12168\n<23ab> 8172\n<23ac> 8171\n<23ad> 8170\n<250c> 7495\n<250d> 7497\n<250e> 7496\n<250f> 7498\n<2510> 7503\n<2511> 7505\n<2512> 7504\n<2513> 7506\n<2514> 7491\n<2515> 7493\n<2516> 7492\n<2517> 7494\n<2518> 7499\n<2519> 7501\n<251a> 7500\n<251b> 7502\n<251c> 7523\n<251d> 7527\n<251e> 7525\n<251f> 7524\n<2520> 7526\n<2521> 7529\n<2522> 7528\n<2525> 7535\n<2526> 7533\n<2527> 7532\n<2528> 7534\n<2529> 7537\n<252a> 7536\n<252b> 7538\n<252c> 7515\n<2530> 7516\n<2534> 7507\n<2538> 7508\n<2540> 7541\n<2541> 7540\n<2542> 7542\n<2543> 7547\n<2544> 7549\n<2545> 7546\n<2546> 7548\n<2547> 7553\n<2548> 7552\n<261c> 8221\n<261d> 8219\n<261e> 8222\n<261f> 8220\n<2702> 12178\n<27a1> 8209\n<301c> 7894\n<301d> 7956\n<301f> 7957\n<3041> 7918\n<3043> 7919\n<3045> 7920\n<3047> 7921\n<3049> 7922\n<3063> 7923\n<3083> 7924\n<3085> 7925\n<3087> 7926\n<308e> 7927\nendcidchar\n\n78 begincidchar\n<309b> 8272\n<309c> 8271\n<30a0> 16331\n<30a1> 7928\n<30a3> 7929\n<30a5> 7930\n<30a7> 7931\n<30a9> 7932\n<30c3> 7933\n<30e3> 7934\n<30e5> 7935\n<30e7> 7936\n<30ee> 7937\n<30fc> 7891\n<3300> 8350\n<3303> 8338\n<3304> 11960\n<3305> 8333\n<3306> 11961\n<3307> 11965\n<3308> 11963\n<3309> 11968\n<330a> 11966\n<330b> 11970\n<330c> 11972\n<330d> 7950\n<3314> 7941\n<3315> 8340\n<3316> 8330\n<3317> 11980\n<3318> 8339\n<3319> 11982\n<331e> 8353\n<3322> 8329\n<3323> 8348\n<3324> 11991\n<3325> 11993\n<3326> 7951\n<3327> 7945\n<332a> 8356\n<332b> 7953\n<332d> 11999\n<3331> 8358\n<3332> 12005\n<3333> 8334\n<3336> 7947\n<3337> 12014\n<3338> 12016\n<3339> 8343\n<333a> 12017\n<333b> 8349\n<333c> 12010\n<333d> 12018\n<3341> 12019\n<3342> 8347\n<3347> 8357\n<3348> 12027\n<3349> 7940\n<334a> 7954\n<334d> 7943\n<334e> 8337\n<3351> 7948\n<3352> 12034\n<3353> 12038\n<3354> 12035\n<3357> 8344\n<337f> 8324\n<ff0c> 8268\n<ff0e> 8274\n<ff1d> 7917\n<ff3b> 7903\n<ff3d> 7904\n<ff3f> 7890\n<ff5b> 7905\n<ff5c> 7896\n<ff5d> 7906\n<ff5e> 7894\n<ffe3> 7889\nendcidchar\n\n37 begincidrange\n<23b0> <23b1> 16350\n<2500> <2501> 7481\n<2502> <2503> 7479\n<2504> <2505> 7485\n<2506> <2507> 7483\n<2508> <2509> 7489\n<250a> <250b> 7487\n<2523> <2524> 7530\n<252d> <252f> 7517\n<2531> <2533> 7520\n<2535> <2537> 7509\n<2539> <253b> 7512\n<253d> <253f> 7543\n<2549> <254a> 7550\n<3001> <3002> 7887\n<3008> <3011> 7907\n<3014> <3015> 7901\n<3016> <3017> 16329\n<3018> <3019> 12139\n<3095> <3096> 8264\n<30f5> <30f6> 7938\n<31f0> <31f9> 16333\n<31fa> <31ff> 16344\n<3301> <3302> 11958\n<330e> <3313> 11973\n<331a> <331d> 11984\n<331f> <3321> 11988\n<3328> <3329> 11996\n<332e> <3330> 12002\n<3334> <3335> 12008\n<333e> <3340> 12020\n<3343> <3346> 12023\n<334b> <334c> 12028\n<334f> <3350> 12030\n<3355> <3356> 12039\n<ff08> <ff09> 7899\n<ff5f> <ff60> 12141\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJIS2004-UTF32-H",
    "content": "begincmap\n/CMapName /UniJIS2004-UTF32-H def\n/WMode 0 def\n/UniJIS-X32 usecmap\nbegincodespacerange\n<00000000><0010ffff>\nendcodespacerange\nbegincidchar\n<a7>720\n<a8>647\n<b0>707\n<b1>694\n<b4>645\n<b6>778\n<d7>695\n<f7>696\n<2010>662\n<2012>114\n<210f>12092\n<2135>12089\n<2194>12201\n<21d2>752\n<21d4>753\n<2200>754\n<2202>759\n<2203>755\n<2205>12184\n<2207>760\n<2208>741\n<220a>12091\n<220b>742\n<2211>7625\n<2212>693\n<2213>12118\n<221a>765\n<221d>767\n<221e>703\n<221f>7629\n<2220>756\n<2229>748\n<222a>747\n<222d>8195\n<222e>7624\n<2234>704\n<2235>768\n<223d>766\n<2243>12120\n<2252>762\n<2260>698\n<2261>761\n<2295>12188\n<2296>12186\n<2297>12189\n<2298>12187\n<22a0>12185\n<22a5>757\n<22bf>7630\n<2f5b>7965\n<5026>7674\n<50c5>7662\n<5132>7798\n<514e>13949\n<51a4>7817\n<537f>7661\n<53a9>20271\n<53c9>20281\n<53db>7978\n<53df>14111\n<54ac>20277\n<54e8>7703\n<55b0>7664\n<5632>7821\n<5642>7642\n<564c>7721\n<56c0>14116\n<5835>7753\n<5906>21371\n<5a29>7791\n<5c51>7666\n<5c60>7754\n<5df7>7679\n<5e96>7792\n<5edf>7786\n<5efb>13673\n<5f98>13538\n<5fbd>7658\n<6062>20269\n<609e>21558\n<6108>7802\n<6241>7991\n<633a>20286\n<633d>7778\n<6357>7743\n<6372>7676\n<63c3>7975\n<646f>20264\n<647a>7713\n<64b0>7716\n<64e2>7749\n<65a7>20289\n<6666>7650\n<66b5>21722\n<6753>7695\n<6756>20282\n<6897>20279\n<6962>7768\n<696f>13460\n<698a>7686\n<6994>7812\n<69cc>7744\n<6a0b>7780\n<6a3d>7738\n<6adb>7665\n<6b4e>13915\n<6c72>7966\n<6deb>7637\n<6ea2>7635\n<6eba>7750\n<6f23>7809\n<7015>7787\n<701e>7761\n<7026>7741\n<7058>7767\n<7078>20270\n<707c>7696\n<7149>7810\n<714e>7718\n<7152>21933\n<717d>7972\n<723a>20294\n<724c>7771\n<7259>7965\n<72e1>20278\n<7337>14074\n<7511>20284\n<7515>20267\n<7526>20283\n<75bc>20175\n<77a5>7790\n<7941>7668\n<7947>7659\n<79b0>7769\n<79e4>7773\n<7a17>7782\n<7a7f>7973\n<7ac8>20285\n<7b08>20263\n<7b75>20266\n<7bad>7974\n<7bb8>7775\n<7bc7>7979\n<7bdd>7997\n<7c3e>20265\n<7c7e>20293\n<7c82>20272\n<7feb>7657\n<7ff0>7656\n<8171>20275\n<817f>7728\n<8258>14196\n<8292>20292\n<82a6>7961\n<8328>7962\n<845b>7652\n<84ec>7794\n<8511>14013\n<853d>7789\n<85a9>7688\n<85af>7701\n<85f7>7702\n<8654>20274\n<86f8>7733\n<8703>20296\n<8755>7709\n<8805>20295\n<8956>7645\n<8a0a>13860\n<8a1d>20268\n<8a3b>7740\n<8a6e>7720\n<8ab9>13495\n<8afa>7678\n<8b0e>7766\n<8b2c>7785\n<8b7f>21074\n<8c79>20222\n<8ced>7756\n<8fbb>8267\n<8fbf>7735\n<8fc2>7638\n<8fc4>7980\n<8fe6>7647\n<9017>7711\n<9019>7772\n<9022>8266\n<903c>7783\n<9041>20287\n<905c>7726\n<9061>7722\n<912d>7748\n<914b>7698\n<91dc>20290\n<9306>7690\n<9375>20276\n<939a>7745\n<9453>7801\n<9699>20273\n<9771>13624\n<9784>7653\n<9798>7708\n<97ad>20291\n<98f4>7634\n<9905>7799\n<990c>13650\n<9910>7970\n<9957>7968\n<99c1>20288\n<9a19>8003\n<9a4a>22920\n<9bab>20280\n<9bd6>7689\n<9c2f>7636\n<9c52>7796\n<9d09>14272\n<9d60>7683\n<fa20>21073\n<fa40>21072\nendcidchar\nbegincidrange\n<2032><2033>708\n<2227><2228>749\n<222b><222c>769\n<2266><2267>701\n<226a><226b>763\n<2272><2273>12121\n<2282><2283>745\n<2286><2287>743\nendcidrange\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJIS2004-UTF32-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniJIS2004-UTF32-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniJIS2004-UTF32-H)\n%%BeginResource: CMap (UniJIS2004-UTF32-V)\n%%Title: (UniJIS2004-UTF32-V Adobe Japan1 6)\n%%Version: 1.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution.\n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission.\n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniJIS2004-UTF32-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 6 def\nend def\n\n/CMapName /UniJIS2004-UTF32-V def\n/CMapVersion 1.002 def\n/CMapType 1 def\n\n/XUID [1 10 25618] def\n\n/WMode 1 def\n\n100 begincidchar\n<000000b0> 8269\n<00002010> 7893\n<00002015> 7892\n<00002016> 7895\n<00002025> 7898\n<00002026> 7897\n<00002032> 8273\n<00002033> 8283\n<00002190> 738\n<00002191> 736\n<00002192> 739\n<00002193> 737\n<000021c4> 8311\n<000021c5> 8310\n<000021c6> 8312\n<000021e6> 8012\n<000021e7> 8014\n<000021e8> 8011\n<000021e9> 8013\n<0000239b> 12148\n<0000239c> 12168\n<0000239d> 12147\n<0000239e> 12150\n<0000239f> 12168\n<000023a0> 12149\n<000023a1> 12156\n<000023a2> 12168\n<000023a3> 12155\n<000023a4> 12158\n<000023a5> 12168\n<000023a6> 12157\n<000023a7> 8168\n<000023a8> 8167\n<000023a9> 8166\n<000023aa> 12168\n<000023ab> 8172\n<000023ac> 8171\n<000023ad> 8170\n<0000250c> 7495\n<0000250d> 7497\n<0000250e> 7496\n<0000250f> 7498\n<00002510> 7503\n<00002511> 7505\n<00002512> 7504\n<00002513> 7506\n<00002514> 7491\n<00002515> 7493\n<00002516> 7492\n<00002517> 7494\n<00002518> 7499\n<00002519> 7501\n<0000251a> 7500\n<0000251b> 7502\n<0000251c> 7523\n<0000251d> 7527\n<0000251e> 7525\n<0000251f> 7524\n<00002520> 7526\n<00002521> 7529\n<00002522> 7528\n<00002525> 7535\n<00002526> 7533\n<00002527> 7532\n<00002528> 7534\n<00002529> 7537\n<0000252a> 7536\n<0000252b> 7538\n<0000252c> 7515\n<00002530> 7516\n<00002534> 7507\n<00002538> 7508\n<00002540> 7541\n<00002541> 7540\n<00002542> 7542\n<00002543> 7547\n<00002544> 7549\n<00002545> 7546\n<00002546> 7548\n<00002547> 7553\n<00002548> 7552\n<0000261c> 8221\n<0000261d> 8219\n<0000261e> 8222\n<0000261f> 8220\n<00002702> 12178\n<000027a1> 8209\n<0000301c> 7894\n<0000301d> 7956\n<0000301f> 7957\n<00003041> 7918\n<00003043> 7919\n<00003045> 7920\n<00003047> 7921\n<00003049> 7922\n<00003063> 7923\n<00003083> 7924\n<00003085> 7925\n<00003087> 7926\n<0000308e> 7927\nendcidchar\n\n78 begincidchar\n<0000309b> 8272\n<0000309c> 8271\n<000030a0> 16331\n<000030a1> 7928\n<000030a3> 7929\n<000030a5> 7930\n<000030a7> 7931\n<000030a9> 7932\n<000030c3> 7933\n<000030e3> 7934\n<000030e5> 7935\n<000030e7> 7936\n<000030ee> 7937\n<000030fc> 7891\n<00003300> 8350\n<00003303> 8338\n<00003304> 11960\n<00003305> 8333\n<00003306> 11961\n<00003307> 11965\n<00003308> 11963\n<00003309> 11968\n<0000330a> 11966\n<0000330b> 11970\n<0000330c> 11972\n<0000330d> 7950\n<00003314> 7941\n<00003315> 8340\n<00003316> 8330\n<00003317> 11980\n<00003318> 8339\n<00003319> 11982\n<0000331e> 8353\n<00003322> 8329\n<00003323> 8348\n<00003324> 11991\n<00003325> 11993\n<00003326> 7951\n<00003327> 7945\n<0000332a> 8356\n<0000332b> 7953\n<0000332d> 11999\n<00003331> 8358\n<00003332> 12005\n<00003333> 8334\n<00003336> 7947\n<00003337> 12014\n<00003338> 12016\n<00003339> 8343\n<0000333a> 12017\n<0000333b> 8349\n<0000333c> 12010\n<0000333d> 12018\n<00003341> 12019\n<00003342> 8347\n<00003347> 8357\n<00003348> 12027\n<00003349> 7940\n<0000334a> 7954\n<0000334d> 7943\n<0000334e> 8337\n<00003351> 7948\n<00003352> 12034\n<00003353> 12038\n<00003354> 12035\n<00003357> 8344\n<0000337f> 8324\n<0000ff0c> 8268\n<0000ff0e> 8274\n<0000ff1d> 7917\n<0000ff3b> 7903\n<0000ff3d> 7904\n<0000ff3f> 7890\n<0000ff5b> 7905\n<0000ff5c> 7896\n<0000ff5d> 7906\n<0000ff5e> 7894\n<0000ffe3> 7889\nendcidchar\n\n37 begincidrange\n<000023b0> <000023b1> 16350\n<00002500> <00002501> 7481\n<00002502> <00002503> 7479\n<00002504> <00002505> 7485\n<00002506> <00002507> 7483\n<00002508> <00002509> 7489\n<0000250a> <0000250b> 7487\n<00002523> <00002524> 7530\n<0000252d> <0000252f> 7517\n<00002531> <00002533> 7520\n<00002535> <00002537> 7509\n<00002539> <0000253b> 7512\n<0000253d> <0000253f> 7543\n<00002549> <0000254a> 7550\n<00003001> <00003002> 7887\n<00003008> <00003011> 7907\n<00003014> <00003015> 7901\n<00003016> <00003017> 16329\n<00003018> <00003019> 12139\n<00003095> <00003096> 8264\n<000030f5> <000030f6> 7938\n<000031f0> <000031f9> 16333\n<000031fa> <000031ff> 16344\n<00003301> <00003302> 11958\n<0000330e> <00003313> 11973\n<0000331a> <0000331d> 11984\n<0000331f> <00003321> 11988\n<00003328> <00003329> 11996\n<0000332e> <00003330> 12002\n<00003334> <00003335> 12008\n<0000333e> <00003340> 12020\n<00003343> <00003346> 12023\n<0000334b> <0000334c> 12028\n<0000334f> <00003350> 12030\n<00003355> <00003356> 12039\n<0000ff08> <0000ff09> 7899\n<0000ff5f> <0000ff60> 12141\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJIS2004-UTF8-H",
    "content": "begincmap\n/CMapName /UniJIS2004-UTF8-H def\n/WMode 0 def\n/UniJIS-X8 usecmap\nbegincodespacerange\n<00><7f>\n<c080><dfbf>\n<e08080><efbfbf>\n<f0808080><f7bfbfbf>\nendcodespacerange\nbegincidchar\n<e2bd9b>7965\n<e580a6>7674\n<e58385>7662\n<e584b2>7798\n<e5858e>13949\n<e586a4>7817\n<e58dbf>7661\n<e58ea9>20271\n<e58f89>20281\n<e58f9b>7978\n<e58f9f>14111\n<e592ac>20277\n<e593a8>7703\n<e596b0>7664\n<e598b2>7821\n<e59982>7642\n<e5998c>7721\n<e59b80>14116\n<e5a0b5>7753\n<e5a486>21371\n<e5a8a9>7791\n<e5b191>7666\n<e5b1a0>7754\n<e5b7b7>7679\n<e5ba96>7792\n<e5bb9f>7786\n<e5bbbb>13673\n<e5be98>13538\n<e5bebd>7658\n<e681a2>20269\n<e6829e>21558\n<e68488>7802\n<e68981>7991\n<e68cba>20286\n<e68cbd>7778\n<e68d97>7743\n<e68db2>7676\n<e68f83>7975\n<e691af>20264\n<e691ba>7713\n<e692b0>7716\n<e693a2>7749\n<e696a7>20289\n<e699a6>7650\n<e69ab5>21722\n<e69d93>7695\n<e69d96>20282\n<e6a297>20279\n<e6a5a2>7768\n<e6a5af>13460\n<e6a68a>7686\n<e6a694>7812\n<e6a78c>7744\n<e6a88b>7780\n<e6a8bd>7738\n<e6ab9b>7665\n<e6ad8e>13915\n<e6b1b2>7966\n<e6b7ab>7637\n<e6baa2>7635\n<e6baba>7750\n<e6bca3>7809\n<e78095>7787\n<e7809e>7761\n<e780a6>7741\n<e78198>7767\n<e781b8>20270\n<e781bc>7696\n<e78589>7810\n<e7858e>7718\n<e78592>21933\n<e785bd>7972\n<e788ba>20294\n<e7898c>7771\n<e78999>7965\n<e78ba1>20278\n<e78cb7>14074\n<e79491>20284\n<e79495>20267\n<e794a6>20283\n<e796bc>20175\n<e79ea5>7790\n<e7a581>7668\n<e7a587>7659\n<e7a6b0>7769\n<e7a7a4>7773\n<e7a897>7782\n<e7a9bf>7973\n<e7ab88>20285\n<e7ac88>20263\n<e7adb5>20266\n<e7aead>7974\n<e7aeb8>7775\n<e7af87>7979\n<e7af9d>7997\n<e7b0be>20265\n<e7b1be>20293\n<e7b282>20272\n<e7bfab>7657\n<e7bfb0>7656\n<e885b1>20275\n<e885bf>7728\n<e88998>14196\n<e88a92>20292\n<e88aa6>7961\n<e88ca8>7962\n<e8919b>7652\n<e893ac>7794\n<e89491>14013\n<e894bd>7789\n<e896a9>7688\n<e896af>7701\n<e897b7>7702\n<e89994>20274\n<e89bb8>7733\n<e89c83>20296\n<e89d95>7709\n<e8a085>20295\n<e8a596>7645\n<e8a88a>13860\n<e8a89d>20268\n<e8a8bb>7740\n<e8a9ae>7720\n<e8aab9>13495\n<e8abba>7678\n<e8ac8e>7766\n<e8acac>7785\n<e8adbf>21074\n<e8b1b9>20222\n<e8b3ad>7756\n<e8bebb>8267\n<e8bebf>7735\n<e8bf82>7638\n<e8bf84>7980\n<e8bfa6>7647\n<e98097>7711\n<e98099>7772\n<e980a2>8266\n<e980bc>7783\n<e98181>20287\n<e9819c>7726\n<e981a1>7722\n<e984ad>7748\n<e9858b>7698\n<e9879c>20290\n<e98c86>7690\n<e98db5>20276\n<e98e9a>7745\n<e99193>7801\n<e99a99>20273\n<e99db1>13624\n<e99e84>7653\n<e99e98>7708\n<e99ead>20291\n<e9a3b4>7634\n<e9a485>7799\n<e9a48c>13650\n<e9a490>7970\n<e9a597>7968\n<e9a781>20288\n<e9a899>8003\n<e9a98a>22920\n<e9aeab>20280\n<e9af96>7689\n<e9b0af>7636\n<e9b192>7796\n<e9b489>14272\n<e9b5a0>7683\n<efa8a0>21073\n<efa980>21072\nendcidchar\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJIS2004-UTF8-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniJIS2004-UTF8-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniJIS2004-UTF8-H)\n%%BeginResource: CMap (UniJIS2004-UTF8-V)\n%%Title: (UniJIS2004-UTF8-V Adobe Japan1 6)\n%%Version: 1.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution.\n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission.\n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniJIS2004-UTF8-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 6 def\nend def\n\n/CMapName /UniJIS2004-UTF8-V def\n/CMapVersion 1.002 def\n/CMapType 1 def\n\n/XUID [1 10 25632] def\n\n/WMode 1 def\n\n100 begincidchar\n<c2b0> 8269\n<e28090> 7893\n<e28095> 7892\n<e28096> 7895\n<e280a5> 7898\n<e280a6> 7897\n<e280b2> 8273\n<e280b3> 8283\n<e28690> 738\n<e28691> 736\n<e28692> 739\n<e28693> 737\n<e28784> 8311\n<e28785> 8310\n<e28786> 8312\n<e287a6> 8012\n<e287a7> 8014\n<e287a8> 8011\n<e287a9> 8013\n<e28e9b> 12148\n<e28e9c> 12168\n<e28e9d> 12147\n<e28e9e> 12150\n<e28e9f> 12168\n<e28ea0> 12149\n<e28ea1> 12156\n<e28ea2> 12168\n<e28ea3> 12155\n<e28ea4> 12158\n<e28ea5> 12168\n<e28ea6> 12157\n<e28ea7> 8168\n<e28ea8> 8167\n<e28ea9> 8166\n<e28eaa> 12168\n<e28eab> 8172\n<e28eac> 8171\n<e28ead> 8170\n<e2948c> 7495\n<e2948d> 7497\n<e2948e> 7496\n<e2948f> 7498\n<e29490> 7503\n<e29491> 7505\n<e29492> 7504\n<e29493> 7506\n<e29494> 7491\n<e29495> 7493\n<e29496> 7492\n<e29497> 7494\n<e29498> 7499\n<e29499> 7501\n<e2949a> 7500\n<e2949b> 7502\n<e2949c> 7523\n<e2949d> 7527\n<e2949e> 7525\n<e2949f> 7524\n<e294a0> 7526\n<e294a1> 7529\n<e294a2> 7528\n<e294a5> 7535\n<e294a6> 7533\n<e294a7> 7532\n<e294a8> 7534\n<e294a9> 7537\n<e294aa> 7536\n<e294ab> 7538\n<e294ac> 7515\n<e294b0> 7516\n<e294b4> 7507\n<e294b8> 7508\n<e29580> 7541\n<e29581> 7540\n<e29582> 7542\n<e29583> 7547\n<e29584> 7549\n<e29585> 7546\n<e29586> 7548\n<e29587> 7553\n<e29588> 7552\n<e2989c> 8221\n<e2989d> 8219\n<e2989e> 8222\n<e2989f> 8220\n<e29c82> 12178\n<e29ea1> 8209\n<e3809c> 7894\n<e3809d> 7956\n<e3809f> 7957\n<e38181> 7918\n<e38183> 7919\n<e38185> 7920\n<e38187> 7921\n<e38189> 7922\n<e381a3> 7923\n<e38283> 7924\n<e38285> 7925\n<e38287> 7926\n<e3828e> 7927\nendcidchar\n\n79 begincidchar\n<e3829b> 8272\n<e3829c> 8271\n<e382a0> 16331\n<e382a1> 7928\n<e382a3> 7929\n<e382a5> 7930\n<e382a7> 7931\n<e382a9> 7932\n<e38383> 7933\n<e383a3> 7934\n<e383a5> 7935\n<e383a7> 7936\n<e383ae> 7937\n<e383bc> 7891\n<e38c80> 8350\n<e38c83> 8338\n<e38c84> 11960\n<e38c85> 8333\n<e38c86> 11961\n<e38c87> 11965\n<e38c88> 11963\n<e38c89> 11968\n<e38c8a> 11966\n<e38c8b> 11970\n<e38c8c> 11972\n<e38c8d> 7950\n<e38c94> 7941\n<e38c95> 8340\n<e38c96> 8330\n<e38c97> 11980\n<e38c98> 8339\n<e38c99> 11982\n<e38c9e> 8353\n<e38ca2> 8329\n<e38ca3> 8348\n<e38ca4> 11991\n<e38ca5> 11993\n<e38ca6> 7951\n<e38ca7> 7945\n<e38caa> 8356\n<e38cab> 7953\n<e38cad> 11999\n<e38cb1> 8358\n<e38cb2> 12005\n<e38cb3> 8334\n<e38cb6> 7947\n<e38cb7> 12014\n<e38cb8> 12016\n<e38cb9> 8343\n<e38cba> 12017\n<e38cbb> 8349\n<e38cbc> 12010\n<e38cbd> 12018\n<e38d80> 12022\n<e38d81> 12019\n<e38d82> 8347\n<e38d87> 8357\n<e38d88> 12027\n<e38d89> 7940\n<e38d8a> 7954\n<e38d8d> 7943\n<e38d8e> 8337\n<e38d91> 7948\n<e38d92> 12034\n<e38d93> 12038\n<e38d94> 12035\n<e38d97> 8344\n<e38dbf> 8324\n<efbc8c> 8268\n<efbc8e> 8274\n<efbc9d> 7917\n<efbcbb> 7903\n<efbcbd> 7904\n<efbcbf> 7890\n<efbd9b> 7905\n<efbd9c> 7896\n<efbd9d> 7906\n<efbd9e> 7894\n<efbfa3> 7889\nendcidchar\n\n37 begincidrange\n<e28eb0> <e28eb1> 16350\n<e29480> <e29481> 7481\n<e29482> <e29483> 7479\n<e29484> <e29485> 7485\n<e29486> <e29487> 7483\n<e29488> <e29489> 7489\n<e2948a> <e2948b> 7487\n<e294a3> <e294a4> 7530\n<e294ad> <e294af> 7517\n<e294b1> <e294b3> 7520\n<e294b5> <e294b7> 7509\n<e294b9> <e294bb> 7512\n<e294bd> <e294bf> 7543\n<e29589> <e2958a> 7550\n<e38081> <e38082> 7887\n<e38088> <e38091> 7907\n<e38094> <e38095> 7901\n<e38096> <e38097> 16329\n<e38098> <e38099> 12139\n<e38295> <e38296> 8264\n<e383b5> <e383b6> 7938\n<e387b0> <e387b9> 16333\n<e387ba> <e387bf> 16344\n<e38c81> <e38c82> 11958\n<e38c8e> <e38c93> 11973\n<e38c9a> <e38c9d> 11984\n<e38c9f> <e38ca1> 11988\n<e38ca8> <e38ca9> 11996\n<e38cae> <e38cb0> 12002\n<e38cb4> <e38cb5> 12008\n<e38cbe> <e38cbf> 12020\n<e38d83> <e38d86> 12023\n<e38d8b> <e38d8c> 12028\n<e38d8f> <e38d90> 12030\n<e38d95> <e38d96> 12039\n<efbc88> <efbc89> 7899\n<efbd9f> <efbda0> 12141\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJISPro-UCS2-HW-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniJIS-UCS2-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniJIS-UCS2-H)\n%%BeginResource: CMap (UniJISPro-UCS2-HW-V)\n%%Title: (UniJISPro-UCS2-HW-V Adobe Japan1 4)\n%%Version: 1.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniJIS-UCS2-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 4 def\nend def\n\n/CMapName /UniJISPro-UCS2-HW-V def\n/CMapVersion 1.002 def\n/CMapType 1 def\n\n/XUID [1 10 25538] def\n\n/WMode 1 def\n\n100 begincidrange\n<0020> <005b> 231\n<005c> <005c> 8719\n<005d> <007e> 292\n<00a5> <00a5> 291\n<00b0> <00b0> 8269\n<2010> <2010> 7893\n<2015> <2015> 7892\n<2016> <2016> 7895\n<2018> <2019> 12173\n<201c> <201d> 7956\n<2025> <2025> 7898\n<2026> <2026> 7897\n<2032> <2032> 8273\n<2033> <2033> 8283\n<2190> <2190> 738\n<2191> <2191> 736\n<2192> <2192> 739\n<2193> <2193> 737\n<2195> <2195> 12214\n<21c4> <21c4> 8311\n<21c5> <21c5> 8310\n<21c6> <21c6> 8312\n<21e6> <21e6> 8012\n<21e7> <21e7> 8014\n<21e8> <21e8> 8011\n<21e9> <21e9> 8013\n<2225> <2225> 7895\n<223c> <223c> 7894\n<22ef> <22ef> 7897\n<2500> <2501> 7481\n<2502> <2503> 7479\n<2504> <2505> 7485\n<2506> <2507> 7483\n<2508> <2509> 7489\n<250a> <250b> 7487\n<250c> <250c> 7495\n<250d> <250d> 7497\n<250e> <250e> 7496\n<250f> <250f> 7498\n<2510> <2510> 7503\n<2511> <2511> 7505\n<2512> <2512> 7504\n<2513> <2513> 7506\n<2514> <2514> 7491\n<2515> <2515> 7493\n<2516> <2516> 7492\n<2517> <2517> 7494\n<2518> <2518> 7499\n<2519> <2519> 7501\n<251a> <251a> 7500\n<251b> <251b> 7502\n<251c> <251c> 7523\n<251d> <251d> 7527\n<251e> <251e> 7525\n<251f> <251f> 7524\n<2520> <2520> 7526\n<2521> <2521> 7529\n<2522> <2522> 7528\n<2523> <2524> 7530\n<2525> <2525> 7535\n<2526> <2526> 7533\n<2527> <2527> 7532\n<2528> <2528> 7534\n<2529> <2529> 7537\n<252a> <252a> 7536\n<252b> <252b> 7538\n<252c> <252c> 7515\n<252d> <252f> 7517\n<2530> <2530> 7516\n<2531> <2533> 7520\n<2534> <2534> 7507\n<2535> <2537> 7509\n<2538> <2538> 7508\n<2539> <253b> 7512\n<253d> <253f> 7543\n<2540> <2540> 7541\n<2541> <2541> 7540\n<2542> <2542> 7542\n<2543> <2543> 7547\n<2544> <2544> 7549\n<2545> <2545> 7546\n<2546> <2546> 7548\n<2547> <2547> 7553\n<2548> <2548> 7552\n<2549> <254a> 7550\n<261c> <261c> 8221\n<261d> <261d> 8219\n<261e> <261e> 8222\n<261f> <261f> 8220\n<2702> <2702> 12178\n<27a1> <27a1> 8209\n<3001> <3002> 7887\n<3008> <3011> 7907\n<3013> <3013> 8270\n<3014> <3015> 7901\n<301c> <301c> 7894\n<301d> <301d> 7956\n<301f> <301f> 7957\n<3041> <3041> 7918\n<3043> <3043> 7919\nendcidrange\n\n100 begincidrange\n<3045> <3045> 7920\n<3047> <3047> 7921\n<3049> <3049> 7922\n<3063> <3063> 7923\n<3083> <3083> 7924\n<3085> <3085> 7925\n<3087> <3087> 7926\n<308e> <308e> 7927\n<309b> <309b> 8272\n<309c> <309c> 8271\n<30a1> <30a1> 7928\n<30a3> <30a3> 7929\n<30a5> <30a5> 7930\n<30a7> <30a7> 7931\n<30a9> <30a9> 7932\n<30c3> <30c3> 7933\n<30e3> <30e3> 7934\n<30e5> <30e5> 7935\n<30e7> <30e7> 7936\n<30ee> <30ee> 7937\n<30f5> <30f6> 7938\n<30fc> <30fc> 7891\n<3300> <3300> 8350\n<3301> <3302> 11958\n<3303> <3303> 8338\n<3304> <3304> 11960\n<3305> <3305> 8333\n<3306> <3306> 11961\n<3307> <3307> 11965\n<3308> <3308> 11963\n<3309> <3309> 11968\n<330a> <330a> 11966\n<330b> <330b> 11970\n<330c> <330c> 11972\n<330d> <330d> 7950\n<330e> <3313> 11973\n<3314> <3314> 7941\n<3315> <3315> 8340\n<3316> <3316> 8330\n<3317> <3317> 11980\n<3318> <3318> 8339\n<3319> <3319> 11982\n<331a> <331d> 11984\n<331e> <331e> 8353\n<331f> <3321> 11988\n<3322> <3322> 8329\n<3323> <3323> 8348\n<3324> <3324> 11991\n<3325> <3325> 11993\n<3326> <3326> 7951\n<3327> <3327> 7945\n<3328> <3329> 11996\n<332a> <332a> 8356\n<332b> <332b> 7953\n<332d> <332d> 11999\n<332e> <3330> 12002\n<3331> <3331> 8358\n<3332> <3332> 12005\n<3333> <3333> 8334\n<3334> <3335> 12008\n<3336> <3336> 7947\n<3337> <3337> 12014\n<3338> <3338> 12016\n<3339> <3339> 8343\n<333a> <333a> 12017\n<333b> <333b> 8349\n<333c> <333c> 12010\n<333d> <333d> 12018\n<333e> <3340> 12020\n<3341> <3341> 12019\n<3342> <3342> 8347\n<3343> <3346> 12023\n<3347> <3347> 8357\n<3348> <3348> 12027\n<3349> <3349> 7940\n<334a> <334a> 7954\n<334b> <334c> 12028\n<334d> <334d> 7943\n<334e> <334e> 8337\n<334f> <3350> 12030\n<3351> <3351> 7948\n<3352> <3352> 12034\n<3353> <3353> 12038\n<3354> <3354> 12035\n<3355> <3356> 12039\n<3357> <3357> 8344\n<337b> <337b> 12044\n<337c> <337c> 12043\n<337d> <337d> 12042\n<337e> <337e> 12041\n<337f> <337f> 8324\n<ff08> <ff09> 7899\n<ff0c> <ff0c> 8268\n<ff0e> <ff0e> 8274\n<ff1a> <ff1a> 12101\n<ff1d> <ff1d> 7917\n<ff3b> <ff3b> 7903\n<ff3d> <ff3d> 7904\n<ff3f> <ff3f> 7890\n<ff5b> <ff5b> 7905\nendcidrange\n\n4 begincidrange\n<ff5c> <ff5c> 7896\n<ff5d> <ff5d> 7906\n<ff5e> <ff5e> 7894\n<ffe3> <ffe3> 7889\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJISPro-UCS2-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniJIS-UCS2-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniJIS-UCS2-H)\n%%BeginResource: CMap (UniJISPro-UCS2-V)\n%%Title: (UniJISPro-UCS2-V Adobe Japan1 4)\n%%Version: 1.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniJIS-UCS2-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 4 def\nend def\n\n/CMapName /UniJISPro-UCS2-V def\n/CMapVersion 1.002 def\n/CMapType 1 def\n\n/XUID [1 10 25535] def\n\n/WMode 1 def\n\n100 begincidrange\n<00b0> <00b0> 8269\n<2010> <2010> 7893\n<2015> <2015> 7892\n<2016> <2016> 7895\n<2018> <2019> 12173\n<201c> <201d> 7956\n<2025> <2025> 7898\n<2026> <2026> 7897\n<2032> <2032> 8273\n<2033> <2033> 8283\n<2190> <2190> 738\n<2191> <2191> 736\n<2192> <2192> 739\n<2193> <2193> 737\n<2195> <2195> 12214\n<21c4> <21c4> 8311\n<21c5> <21c5> 8310\n<21c6> <21c6> 8312\n<21e6> <21e6> 8012\n<21e7> <21e7> 8014\n<21e8> <21e8> 8011\n<21e9> <21e9> 8013\n<2225> <2225> 7895\n<223c> <223c> 7894\n<22ef> <22ef> 7897\n<2500> <2501> 7481\n<2502> <2503> 7479\n<2504> <2505> 7485\n<2506> <2507> 7483\n<2508> <2509> 7489\n<250a> <250b> 7487\n<250c> <250c> 7495\n<250d> <250d> 7497\n<250e> <250e> 7496\n<250f> <250f> 7498\n<2510> <2510> 7503\n<2511> <2511> 7505\n<2512> <2512> 7504\n<2513> <2513> 7506\n<2514> <2514> 7491\n<2515> <2515> 7493\n<2516> <2516> 7492\n<2517> <2517> 7494\n<2518> <2518> 7499\n<2519> <2519> 7501\n<251a> <251a> 7500\n<251b> <251b> 7502\n<251c> <251c> 7523\n<251d> <251d> 7527\n<251e> <251e> 7525\n<251f> <251f> 7524\n<2520> <2520> 7526\n<2521> <2521> 7529\n<2522> <2522> 7528\n<2523> <2524> 7530\n<2525> <2525> 7535\n<2526> <2526> 7533\n<2527> <2527> 7532\n<2528> <2528> 7534\n<2529> <2529> 7537\n<252a> <252a> 7536\n<252b> <252b> 7538\n<252c> <252c> 7515\n<252d> <252f> 7517\n<2530> <2530> 7516\n<2531> <2533> 7520\n<2534> <2534> 7507\n<2535> <2537> 7509\n<2538> <2538> 7508\n<2539> <253b> 7512\n<253d> <253f> 7543\n<2540> <2540> 7541\n<2541> <2541> 7540\n<2542> <2542> 7542\n<2543> <2543> 7547\n<2544> <2544> 7549\n<2545> <2545> 7546\n<2546> <2546> 7548\n<2547> <2547> 7553\n<2548> <2548> 7552\n<2549> <254a> 7550\n<261c> <261c> 8221\n<261d> <261d> 8219\n<261e> <261e> 8222\n<261f> <261f> 8220\n<2702> <2702> 12178\n<27a1> <27a1> 8209\n<3001> <3002> 7887\n<3008> <3011> 7907\n<3013> <3013> 8270\n<3014> <3015> 7901\n<301c> <301c> 7894\n<301d> <301d> 7956\n<301f> <301f> 7957\n<3041> <3041> 7918\n<3043> <3043> 7919\n<3045> <3045> 7920\n<3047> <3047> 7921\n<3049> <3049> 7922\n<3063> <3063> 7923\nendcidrange\n\n100 begincidrange\n<3083> <3083> 7924\n<3085> <3085> 7925\n<3087> <3087> 7926\n<308e> <308e> 7927\n<309b> <309b> 8272\n<309c> <309c> 8271\n<30a1> <30a1> 7928\n<30a3> <30a3> 7929\n<30a5> <30a5> 7930\n<30a7> <30a7> 7931\n<30a9> <30a9> 7932\n<30c3> <30c3> 7933\n<30e3> <30e3> 7934\n<30e5> <30e5> 7935\n<30e7> <30e7> 7936\n<30ee> <30ee> 7937\n<30f5> <30f6> 7938\n<30fc> <30fc> 7891\n<3300> <3300> 8350\n<3301> <3302> 11958\n<3303> <3303> 8338\n<3304> <3304> 11960\n<3305> <3305> 8333\n<3306> <3306> 11961\n<3307> <3307> 11965\n<3308> <3308> 11963\n<3309> <3309> 11968\n<330a> <330a> 11966\n<330b> <330b> 11970\n<330c> <330c> 11972\n<330d> <330d> 7950\n<330e> <3313> 11973\n<3314> <3314> 7941\n<3315> <3315> 8340\n<3316> <3316> 8330\n<3317> <3317> 11980\n<3318> <3318> 8339\n<3319> <3319> 11982\n<331a> <331d> 11984\n<331e> <331e> 8353\n<331f> <3321> 11988\n<3322> <3322> 8329\n<3323> <3323> 8348\n<3324> <3324> 11991\n<3325> <3325> 11993\n<3326> <3326> 7951\n<3327> <3327> 7945\n<3328> <3329> 11996\n<332a> <332a> 8356\n<332b> <332b> 7953\n<332d> <332d> 11999\n<332e> <3330> 12002\n<3331> <3331> 8358\n<3332> <3332> 12005\n<3333> <3333> 8334\n<3334> <3335> 12008\n<3336> <3336> 7947\n<3337> <3337> 12014\n<3338> <3338> 12016\n<3339> <3339> 8343\n<333a> <333a> 12017\n<333b> <333b> 8349\n<333c> <333c> 12010\n<333d> <333d> 12018\n<333e> <3340> 12020\n<3341> <3341> 12019\n<3342> <3342> 8347\n<3343> <3346> 12023\n<3347> <3347> 8357\n<3348> <3348> 12027\n<3349> <3349> 7940\n<334a> <334a> 7954\n<334b> <334c> 12028\n<334d> <334d> 7943\n<334e> <334e> 8337\n<334f> <3350> 12030\n<3351> <3351> 7948\n<3352> <3352> 12034\n<3353> <3353> 12038\n<3354> <3354> 12035\n<3355> <3356> 12039\n<3357> <3357> 8344\n<337b> <337b> 12044\n<337c> <337c> 12043\n<337d> <337d> 12042\n<337e> <337e> 12041\n<337f> <337f> 8324\n<ff08> <ff09> 7899\n<ff0c> <ff0c> 8268\n<ff0e> <ff0e> 8274\n<ff1a> <ff1a> 12101\n<ff1d> <ff1d> 7917\n<ff3b> <ff3b> 7903\n<ff3d> <ff3d> 7904\n<ff3f> <ff3f> 7890\n<ff5b> <ff5b> 7905\n<ff5c> <ff5c> 7896\n<ff5d> <ff5d> 7906\n<ff5e> <ff5e> 7894\n<ffe3> <ffe3> 7889\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJISPro-UTF8-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniJIS-UTF8-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniJIS-UTF8-H)\n%%BeginResource: CMap (UniJISPro-UTF8-V)\n%%Title: (UniJISPro-UTF8-V Adobe Japan1 4)\n%%Version: 1.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution.\n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission.\n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniJIS-UTF8-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 4 def\nend def\n\n/CMapName /UniJISPro-UTF8-V def\n/CMapVersion 1.002 def\n/CMapType 1 def\n\n/XUID [1 10 25536] def\n\n/WMode 1 def\n\n100 begincidrange\n<c2b0> <c2b0> 8269\n<e28090> <e28090> 7893\n<e28095> <e28095> 7892\n<e28096> <e28096> 7895\n<e28098> <e28099> 12173\n<e2809c> <e2809d> 7956\n<e280a5> <e280a5> 7898\n<e280a6> <e280a6> 7897\n<e280b2> <e280b2> 8273\n<e280b3> <e280b3> 8283\n<e28690> <e28690> 738\n<e28691> <e28691> 736\n<e28692> <e28692> 739\n<e28693> <e28693> 737\n<e28695> <e28695> 12214\n<e28784> <e28784> 8311\n<e28785> <e28785> 8310\n<e28786> <e28786> 8312\n<e287a6> <e287a6> 8012\n<e287a7> <e287a7> 8014\n<e287a8> <e287a8> 8011\n<e287a9> <e287a9> 8013\n<e288a5> <e288a5> 7895\n<e288bc> <e288bc> 7894\n<e28baf> <e28baf> 7897\n<e29480> <e29481> 7481\n<e29482> <e29483> 7479\n<e29484> <e29485> 7485\n<e29486> <e29487> 7483\n<e29488> <e29489> 7489\n<e2948a> <e2948b> 7487\n<e2948c> <e2948c> 7495\n<e2948d> <e2948d> 7497\n<e2948e> <e2948e> 7496\n<e2948f> <e2948f> 7498\n<e29490> <e29490> 7503\n<e29491> <e29491> 7505\n<e29492> <e29492> 7504\n<e29493> <e29493> 7506\n<e29494> <e29494> 7491\n<e29495> <e29495> 7493\n<e29496> <e29496> 7492\n<e29497> <e29497> 7494\n<e29498> <e29498> 7499\n<e29499> <e29499> 7501\n<e2949a> <e2949a> 7500\n<e2949b> <e2949b> 7502\n<e2949c> <e2949c> 7523\n<e2949d> <e2949d> 7527\n<e2949e> <e2949e> 7525\n<e2949f> <e2949f> 7524\n<e294a0> <e294a0> 7526\n<e294a1> <e294a1> 7529\n<e294a2> <e294a2> 7528\n<e294a3> <e294a4> 7530\n<e294a5> <e294a5> 7535\n<e294a6> <e294a6> 7533\n<e294a7> <e294a7> 7532\n<e294a8> <e294a8> 7534\n<e294a9> <e294a9> 7537\n<e294aa> <e294aa> 7536\n<e294ab> <e294ab> 7538\n<e294ac> <e294ac> 7515\n<e294ad> <e294af> 7517\n<e294b0> <e294b0> 7516\n<e294b1> <e294b3> 7520\n<e294b4> <e294b4> 7507\n<e294b5> <e294b7> 7509\n<e294b8> <e294b8> 7508\n<e294b9> <e294bb> 7512\n<e294bd> <e294bf> 7543\n<e29580> <e29580> 7541\n<e29581> <e29581> 7540\n<e29582> <e29582> 7542\n<e29583> <e29583> 7547\n<e29584> <e29584> 7549\n<e29585> <e29585> 7546\n<e29586> <e29586> 7548\n<e29587> <e29587> 7553\n<e29588> <e29588> 7552\n<e29589> <e2958a> 7550\n<e2989c> <e2989c> 8221\n<e2989d> <e2989d> 8219\n<e2989e> <e2989e> 8222\n<e2989f> <e2989f> 8220\n<e29c82> <e29c82> 12178\n<e29ea1> <e29ea1> 8209\n<e38081> <e38082> 7887\n<e38088> <e38091> 7907\n<e38093> <e38093> 8270\n<e38094> <e38095> 7901\n<e3809c> <e3809c> 7894\n<e3809d> <e3809d> 7956\n<e3809f> <e3809f> 7957\n<e38181> <e38181> 7918\n<e38183> <e38183> 7919\n<e38185> <e38185> 7920\n<e38187> <e38187> 7921\n<e38189> <e38189> 7922\n<e381a3> <e381a3> 7923\nendcidrange\n\n100 begincidrange\n<e38283> <e38283> 7924\n<e38285> <e38285> 7925\n<e38287> <e38287> 7926\n<e3828e> <e3828e> 7927\n<e3829b> <e3829b> 8272\n<e3829c> <e3829c> 8271\n<e382a1> <e382a1> 7928\n<e382a3> <e382a3> 7929\n<e382a5> <e382a5> 7930\n<e382a7> <e382a7> 7931\n<e382a9> <e382a9> 7932\n<e38383> <e38383> 7933\n<e383a3> <e383a3> 7934\n<e383a5> <e383a5> 7935\n<e383a7> <e383a7> 7936\n<e383ae> <e383ae> 7937\n<e383b5> <e383b6> 7938\n<e383bc> <e383bc> 7891\n<e38c80> <e38c80> 8350\n<e38c81> <e38c82> 11958\n<e38c83> <e38c83> 8338\n<e38c84> <e38c84> 11960\n<e38c85> <e38c85> 8333\n<e38c86> <e38c86> 11961\n<e38c87> <e38c87> 11965\n<e38c88> <e38c88> 11963\n<e38c89> <e38c89> 11968\n<e38c8a> <e38c8a> 11966\n<e38c8b> <e38c8b> 11970\n<e38c8c> <e38c8c> 11972\n<e38c8d> <e38c8d> 7950\n<e38c8e> <e38c93> 11973\n<e38c94> <e38c94> 7941\n<e38c95> <e38c95> 8340\n<e38c96> <e38c96> 8330\n<e38c97> <e38c97> 11980\n<e38c98> <e38c98> 8339\n<e38c99> <e38c99> 11982\n<e38c9a> <e38c9d> 11984\n<e38c9e> <e38c9e> 8353\n<e38c9f> <e38ca1> 11988\n<e38ca2> <e38ca2> 8329\n<e38ca3> <e38ca3> 8348\n<e38ca4> <e38ca4> 11991\n<e38ca5> <e38ca5> 11993\n<e38ca6> <e38ca6> 7951\n<e38ca7> <e38ca7> 7945\n<e38ca8> <e38ca9> 11996\n<e38caa> <e38caa> 8356\n<e38cab> <e38cab> 7953\n<e38cad> <e38cad> 11999\n<e38cae> <e38cb0> 12002\n<e38cb1> <e38cb1> 8358\n<e38cb2> <e38cb2> 12005\n<e38cb3> <e38cb3> 8334\n<e38cb4> <e38cb5> 12008\n<e38cb6> <e38cb6> 7947\n<e38cb7> <e38cb7> 12014\n<e38cb8> <e38cb8> 12016\n<e38cb9> <e38cb9> 8343\n<e38cba> <e38cba> 12017\n<e38cbb> <e38cbb> 8349\n<e38cbc> <e38cbc> 12010\n<e38cbd> <e38cbd> 12018\n<e38cbe> <e38cbf> 12020\n<e38d80> <e38d80> 12022\n<e38d81> <e38d81> 12019\n<e38d82> <e38d82> 8347\n<e38d83> <e38d86> 12023\n<e38d87> <e38d87> 8357\n<e38d88> <e38d88> 12027\n<e38d89> <e38d89> 7940\n<e38d8a> <e38d8a> 7954\n<e38d8b> <e38d8c> 12028\n<e38d8d> <e38d8d> 7943\n<e38d8e> <e38d8e> 8337\n<e38d8f> <e38d90> 12030\n<e38d91> <e38d91> 7948\n<e38d92> <e38d92> 12034\n<e38d93> <e38d93> 12038\n<e38d94> <e38d94> 12035\n<e38d95> <e38d96> 12039\n<e38d97> <e38d97> 8344\n<e38dbb> <e38dbb> 12044\n<e38dbc> <e38dbc> 12043\n<e38dbd> <e38dbd> 12042\n<e38dbe> <e38dbe> 12041\n<e38dbf> <e38dbf> 8324\n<efbc88> <efbc89> 7899\n<efbc8c> <efbc8c> 8268\n<efbc8e> <efbc8e> 8274\n<efbc9a> <efbc9a> 12101\n<efbc9d> <efbc9d> 7917\n<efbcbb> <efbcbb> 7903\n<efbcbd> <efbcbd> 7904\n<efbcbf> <efbcbf> 7890\n<efbd9b> <efbd9b> 7905\n<efbd9c> <efbd9c> 7896\n<efbd9d> <efbd9d> 7906\n<efbd9e> <efbd9e> 7894\nendcidrange\n\n1 begincidrange\n<efbfa3> <efbfa3> 7889\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJISX0213-UTF32-H",
    "content": "begincmap\n/CMapName /UniJISX0213-UTF32-H def\n/WMode 0 def\n/UniJIS-X32 usecmap\nbegincodespacerange\n<00000000><0010ffff>\nendcodespacerange\nbegincidchar\n<a7>106\n<a8>132\n<b4>127\n<b6>118\n<d7>186\n<f7>215\n<2010>14\n<2012>14\n<210f>15514\n<2135>15513\n<2194>15511\n<21d2>15482\n<21d4>15483\n<2200>15484\n<2202>15493\n<2203>15485\n<2205>15477\n<2207>15494\n<2208>15464\n<220a>15900\n<220b>15465\n<2211>15901\n<2212>151\n<2213>15512\n<221a>15499\n<221d>15501\n<221e>15459\n<221f>15881\n<2220>15491\n<2229>15471\n<222a>15470\n<222d>15902\n<222e>15880\n<2234>15460\n<2235>15502\n<223d>15500\n<2243>15506\n<2252>15496\n<2260>15456\n<2261>15495\n<2298>15905\n<22a0>15907\n<22a5>15492\n<22bf>15882\n<2f5b>1383\n<5026>1863\n<50c5>1735\n<5132>3813\n<514e>3136\n<51a4>4228\n<537f>1698\n<53a9>1243\n<53c9>2085\n<53db>3412\n<53df>4332\n<54ac>4368\n<54e8>2445\n<55b0>1772\n<5632>4433\n<5642>1247\n<564c>2747\n<56c0>4454\n<5835>3138\n<5906>17469\n<5a29>3626\n<5c51>1781\n<5c60>3141\n<5df7>1981\n<5e96>3657\n<5edf>3506\n<5efb>1398\n<5f98>4796\n<5fbd>1605\n<6062>1402\n<609e>14541\n<6108>3848\n<6241>4943\n<633a>3086\n<633d>3432\n<6357>3033\n<6372>1876\n<63c3>2839\n<646f>5020\n<647a>2630\n<64b0>2709\n<64e2>3105\n<65a7>3538\n<6666>1408\n<66b5>17755\n<6753>2313\n<6756>2523\n<6897>1998\n<6962>3266\n<696f>2407\n<698a>2135\n<6994>4055\n<69cc>3044\n<6a0b>3465\n<6a3d>2924\n<6adb>1779\n<6b4e>2933\n<6c72>1660\n<6deb>1216\n<6ea2>1202\n<6eba>3112\n<6f23>4034\n<7015>3520\n<701e>3244\n<7026>2995\n<7058>3263\n<7078>1662\n<707c>2314\n<7149>4035\n<714e>2717\n<7152>14762\n<717d>2718\n<723a>3832\n<724c>3341\n<7259>1383\n<72e1>5629\n<7337>3868\n<7511>2059\n<7515>5704\n<7526>5707\n<75bc>5741\n<77a5>3613\n<7941>1805\n<7947>1626\n<79b0>3295\n<79e4>3359\n<7a17>3477\n<7a7f>2720\n<7ac8>5937\n<7b08>1666\n<7b75>5976\n<7bad>2721\n<7bb8>3384\n<7bc7>3619\n<7bdd>6001\n<7c3e>4036\n<7c7e>3822\n<7c82>1791\n<7feb>1569\n<7ff0>1545\n<8171>6258\n<817f>2876\n<8258>6310\n<8292>6325\n<82a6>1142\n<8328>1205\n<845b>1481\n<84ec>3671\n<8511>3614\n<853d>3603\n<85a9>2165\n<85af>2428\n<85f7>2429\n<8654>6481\n<86f8>2909\n<8703>6510\n<8755>2544\n<8805>6537\n<8956>1320\n<8a0a>2588\n<8a1d>6662\n<8a3b>2990\n<8a6e>2729\n<8ab9>3460\n<8afa>1909\n<8b0e>3262\n<8b2c>3495\n<8b7f>8625\n<8c79>3505\n<8ced>3148\n<8fbb>3056\n<8fbf>2919\n<8fc2>1228\n<8fc4>3750\n<8fe6>1376\n<9017>2598\n<9019>3357\n<9022>1133\n<903c>3489\n<9041>3251\n<905c>2845\n<9061>2766\n<912d>3100\n<914b>2368\n<91dc>1494\n<9306>2170\n<9375>1892\n<939a>3046\n<9453>3846\n<9699>1850\n<9771>7152\n<9784>1489\n<9798>2508\n<97ad>3628\n<98f4>1151\n<9905>3819\n<990c>1252\n<9910>2191\n<9957>1722\n<99c1>3379\n<9a19>7248\n<9a4a>15319\n<9bab>2171\n<9bd6>2168\n<9c2f>1207\n<9c52>3742\n<9d09>7362\n<9d60>2054\n<fa20>8612\n<fa40>13369\nendcidchar\nbegincidrange\n<b0><b1>155\n<2032><2033>9356\n<2227><2228>15480\n<222b><222c>15503\n<2266><2267>15457\n<226a><226b>15497\n<2272><2273>15903\n<2282><2283>15468\n<2286><2287>15466\n<2295><2297>15486\nendcidrange\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJISX0213-UTF32-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniJISX0213-UTF32-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniJISX0213-UTF32-H)\n%%BeginResource: CMap (UniJISX0213-UTF32-V)\n%%Title: (UniJISX0213-UTF32-V Adobe Japan1 6)\n%%Version: 1.004\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution.\n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission.\n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniJISX0213-UTF32-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 6 def\nend def\n\n/CMapName /UniJISX0213-UTF32-V def\n/CMapVersion 1.004 def\n/CMapType 1 def\n\n/XUID [1 10 25615] def\n\n/WMode 1 def\n\n100 begincidchar\n<00002015> 7892\n<00002016> 7895\n<00002025> 7898\n<00002026> 7897\n<00002190> 738\n<00002191> 736\n<00002192> 739\n<00002193> 737\n<000021c4> 8311\n<000021c5> 8310\n<000021c6> 8312\n<000021e6> 8012\n<000021e7> 8014\n<000021e8> 8011\n<000021e9> 8013\n<0000239b> 12148\n<0000239c> 12168\n<0000239d> 12147\n<0000239e> 12150\n<0000239f> 12168\n<000023a0> 12149\n<000023a1> 12156\n<000023a2> 12168\n<000023a3> 12155\n<000023a4> 12158\n<000023a5> 12168\n<000023a6> 12157\n<000023a7> 8168\n<000023a8> 8167\n<000023a9> 8166\n<000023aa> 12168\n<000023ab> 8172\n<000023ac> 8171\n<000023ad> 8170\n<0000250c> 7495\n<0000250d> 7497\n<0000250e> 7496\n<0000250f> 7498\n<00002510> 7503\n<00002511> 7505\n<00002512> 7504\n<00002513> 7506\n<00002514> 7491\n<00002515> 7493\n<00002516> 7492\n<00002517> 7494\n<00002518> 7499\n<00002519> 7501\n<0000251a> 7500\n<0000251b> 7502\n<0000251c> 7523\n<0000251d> 7527\n<0000251e> 7525\n<0000251f> 7524\n<00002520> 7526\n<00002521> 7529\n<00002522> 7528\n<00002525> 7535\n<00002526> 7533\n<00002527> 7532\n<00002528> 7534\n<00002529> 7537\n<0000252a> 7536\n<0000252b> 7538\n<0000252c> 7515\n<00002530> 7516\n<00002534> 7507\n<00002538> 7508\n<00002540> 7541\n<00002541> 7540\n<00002542> 7542\n<00002543> 7547\n<00002544> 7549\n<00002545> 7546\n<00002546> 7548\n<00002547> 7553\n<00002548> 7552\n<0000261c> 8221\n<0000261d> 8219\n<0000261e> 8222\n<0000261f> 8220\n<00002702> 12178\n<000027a1> 8209\n<0000301c> 7894\n<0000301d> 7956\n<0000301f> 7957\n<00003041> 7918\n<00003043> 7919\n<00003045> 7920\n<00003047> 7921\n<00003049> 7922\n<00003063> 7923\n<00003083> 7924\n<00003085> 7925\n<00003087> 7926\n<0000308e> 7927\n<0000309b> 8272\n<0000309c> 8271\n<000030a0> 16331\n<000030a1> 7928\nendcidchar\n\n79 begincidchar\n<000030a3> 7929\n<000030a5> 7930\n<000030a7> 7931\n<000030a9> 7932\n<000030c3> 7933\n<000030e3> 7934\n<000030e5> 7935\n<000030e7> 7936\n<000030ee> 7937\n<000030fc> 7891\n<00003300> 8350\n<00003303> 8338\n<00003304> 11960\n<00003305> 8333\n<00003306> 11961\n<00003307> 11965\n<00003308> 11963\n<00003309> 11968\n<0000330a> 11966\n<0000330b> 11970\n<0000330c> 11972\n<0000330d> 7950\n<00003314> 7941\n<00003315> 8340\n<00003316> 8330\n<00003317> 11980\n<00003318> 8339\n<00003319> 11982\n<0000331e> 8353\n<00003322> 8329\n<00003323> 8348\n<00003324> 11991\n<00003325> 11993\n<00003326> 7951\n<00003327> 7945\n<0000332a> 8356\n<0000332b> 7953\n<0000332d> 11999\n<00003331> 8358\n<00003332> 12005\n<00003333> 8334\n<00003336> 7947\n<00003337> 12014\n<00003338> 12016\n<00003339> 8343\n<0000333a> 12017\n<0000333b> 8349\n<0000333c> 12010\n<0000333d> 12018\n<00003341> 12019\n<00003342> 8347\n<00003347> 8357\n<00003348> 12027\n<00003349> 7940\n<0000334a> 7954\n<0000334d> 7943\n<0000334e> 8337\n<00003351> 7948\n<00003352> 12034\n<00003353> 12038\n<00003354> 12035\n<00003357> 8344\n<0000337b> 12044\n<0000337c> 12043\n<0000337d> 12042\n<0000337e> 12041\n<0000337f> 8324\n<0000ff0c> 8268\n<0000ff0e> 8274\n<0000ff1a> 12101\n<0000ff1d> 7917\n<0000ff3b> 7903\n<0000ff3d> 7904\n<0000ff3f> 7890\n<0000ff5b> 7905\n<0000ff5c> 7896\n<0000ff5d> 7906\n<0000ff5e> 7894\n<0000ffe3> 7889\nendcidchar\n\n37 begincidrange\n<000023b0> <000023b1> 16350\n<00002500> <00002501> 7481\n<00002502> <00002503> 7479\n<00002504> <00002505> 7485\n<00002506> <00002507> 7483\n<00002508> <00002509> 7489\n<0000250a> <0000250b> 7487\n<00002523> <00002524> 7530\n<0000252d> <0000252f> 7517\n<00002531> <00002533> 7520\n<00002535> <00002537> 7509\n<00002539> <0000253b> 7512\n<0000253d> <0000253f> 7543\n<00002549> <0000254a> 7550\n<00003001> <00003002> 7887\n<00003008> <00003011> 7907\n<00003014> <00003015> 7901\n<00003016> <00003017> 16329\n<00003018> <00003019> 12139\n<00003095> <00003096> 8264\n<000030f5> <000030f6> 7938\n<000031f0> <000031f9> 16333\n<000031fa> <000031ff> 16344\n<00003301> <00003302> 11958\n<0000330e> <00003313> 11973\n<0000331a> <0000331d> 11984\n<0000331f> <00003321> 11988\n<00003328> <00003329> 11996\n<0000332e> <00003330> 12002\n<00003334> <00003335> 12008\n<0000333e> <00003340> 12020\n<00003343> <00003346> 12023\n<0000334b> <0000334c> 12028\n<0000334f> <00003350> 12030\n<00003355> <00003356> 12039\n<0000ff08> <0000ff09> 7899\n<0000ff5f> <0000ff60> 12141\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJISX02132004-UTF32-H",
    "content": "begincmap\n/CMapName /UniJISX02132004-UTF32-H def\n/WMode 0 def\n/UniJIS-X32 usecmap\nbegincodespacerange\n<00000000><0010ffff>\nendcodespacerange\nbegincidchar\n<a7>106\n<a8>132\n<b4>127\n<b6>118\n<d7>186\n<f7>215\n<2010>14\n<2012>14\n<210f>15514\n<2135>15513\n<2194>15511\n<21d2>15482\n<21d4>15483\n<2200>15484\n<2202>15493\n<2203>15485\n<2205>15477\n<2207>15494\n<2208>15464\n<220a>15900\n<220b>15465\n<2211>15901\n<2212>151\n<2213>15512\n<221a>15499\n<221d>15501\n<221e>15459\n<221f>15881\n<2220>15491\n<2229>15471\n<222a>15470\n<222d>15902\n<222e>15880\n<2234>15460\n<2235>15502\n<223d>15500\n<2243>15506\n<2252>15496\n<2260>15456\n<2261>15495\n<2298>15905\n<22a0>15907\n<22a5>15492\n<22bf>15882\n<2f5b>7965\n<5026>7674\n<50c5>7662\n<5132>7798\n<514e>13949\n<51a4>7817\n<537f>7661\n<53a9>20271\n<53c9>20281\n<53db>7978\n<53df>14111\n<54ac>20277\n<54e8>7703\n<55b0>7664\n<5632>7821\n<5642>7642\n<564c>7721\n<56c0>14116\n<5835>7753\n<5906>21371\n<5a29>7791\n<5c51>7666\n<5c60>7754\n<5df7>7679\n<5e96>7792\n<5edf>7786\n<5efb>13673\n<5f98>13538\n<5fbd>7658\n<6062>20269\n<609e>21558\n<6108>7802\n<6241>7991\n<633a>20286\n<633d>7778\n<6357>7743\n<6372>7676\n<63c3>7975\n<646f>20264\n<647a>7713\n<64b0>7716\n<64e2>7749\n<65a7>20289\n<6666>7650\n<66b5>21722\n<6753>7695\n<6756>20282\n<6897>20279\n<6962>7768\n<696f>13460\n<698a>7686\n<6994>7812\n<69cc>7744\n<6a0b>7780\n<6a3d>7738\n<6adb>7665\n<6b4e>13915\n<6c72>7966\n<6deb>7637\n<6ea2>7635\n<6eba>7750\n<6f23>7809\n<7015>7787\n<701e>7761\n<7026>7741\n<7058>7767\n<7078>20270\n<707c>7696\n<7149>7810\n<714e>7718\n<7152>21933\n<717d>7972\n<723a>20294\n<724c>7771\n<7259>7965\n<72e1>20278\n<7337>14074\n<7511>20284\n<7515>20267\n<7526>20283\n<75bc>20175\n<77a5>7790\n<7941>7668\n<7947>7659\n<79b0>7769\n<79e4>7773\n<7a17>7782\n<7a7f>7973\n<7ac8>20285\n<7b08>20263\n<7b75>20266\n<7bad>7974\n<7bb8>7775\n<7bc7>7979\n<7bdd>7997\n<7c3e>20265\n<7c7e>20293\n<7c82>20272\n<7feb>7657\n<7ff0>7656\n<8171>20275\n<817f>7728\n<8258>14196\n<8292>20292\n<82a6>7961\n<8328>7962\n<845b>7652\n<84ec>7794\n<8511>14013\n<853d>7789\n<85a9>7688\n<85af>7701\n<85f7>7702\n<8654>20274\n<86f8>7733\n<8703>20296\n<8755>7709\n<8805>20295\n<8956>7645\n<8a0a>13860\n<8a1d>20268\n<8a3b>7740\n<8a6e>7720\n<8ab9>13495\n<8afa>7678\n<8b0e>7766\n<8b2c>7785\n<8b7f>21074\n<8c79>20222\n<8ced>7756\n<8fbb>8267\n<8fbf>7735\n<8fc2>7638\n<8fc4>7980\n<8fe6>7647\n<9017>7711\n<9019>7772\n<9022>8266\n<903c>7783\n<9041>20287\n<905c>7726\n<9061>7722\n<912d>7748\n<914b>7698\n<91dc>20290\n<9306>7690\n<9375>20276\n<939a>7745\n<9453>7801\n<9699>20273\n<9771>13624\n<9784>7653\n<9798>7708\n<97ad>20291\n<98f4>7634\n<9905>7799\n<990c>13650\n<9910>7970\n<9957>7968\n<99c1>20288\n<9a19>8003\n<9a4a>22920\n<9bab>20280\n<9bd6>7689\n<9c2f>7636\n<9c52>7796\n<9d09>14272\n<9d60>7683\n<fa20>21073\n<fa40>21072\nendcidchar\nbegincidrange\n<b0><b1>155\n<2032><2033>9356\n<2227><2228>15480\n<222b><222c>15503\n<2266><2267>15457\n<226a><226b>15497\n<2272><2273>15903\n<2282><2283>15468\n<2286><2287>15466\n<2295><2297>15486\nendcidrange\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/UniJISX02132004-UTF32-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniJISX02132004-UTF32-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniJISX02132004-UTF32-H)\n%%BeginResource: CMap (UniJISX02132004-UTF32-V)\n%%Title: (UniJISX02132004-UTF32-V Adobe Japan1 6)\n%%Version: 1.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution.\n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission.\n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniJISX02132004-UTF32-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 6 def\nend def\n\n/CMapName /UniJISX02132004-UTF32-V def\n/CMapVersion 1.002 def\n/CMapType 1 def\n\n/XUID [1 10 25634] def\n\n/WMode 1 def\n\n100 begincidchar\n<00002015> 7892\n<00002016> 7895\n<00002025> 7898\n<00002026> 7897\n<00002190> 738\n<00002191> 736\n<00002192> 739\n<00002193> 737\n<000021c4> 8311\n<000021c5> 8310\n<000021c6> 8312\n<000021e6> 8012\n<000021e7> 8014\n<000021e8> 8011\n<000021e9> 8013\n<0000239b> 12148\n<0000239c> 12168\n<0000239d> 12147\n<0000239e> 12150\n<0000239f> 12168\n<000023a0> 12149\n<000023a1> 12156\n<000023a2> 12168\n<000023a3> 12155\n<000023a4> 12158\n<000023a5> 12168\n<000023a6> 12157\n<000023a7> 8168\n<000023a8> 8167\n<000023a9> 8166\n<000023aa> 12168\n<000023ab> 8172\n<000023ac> 8171\n<000023ad> 8170\n<0000250c> 7495\n<0000250d> 7497\n<0000250e> 7496\n<0000250f> 7498\n<00002510> 7503\n<00002511> 7505\n<00002512> 7504\n<00002513> 7506\n<00002514> 7491\n<00002515> 7493\n<00002516> 7492\n<00002517> 7494\n<00002518> 7499\n<00002519> 7501\n<0000251a> 7500\n<0000251b> 7502\n<0000251c> 7523\n<0000251d> 7527\n<0000251e> 7525\n<0000251f> 7524\n<00002520> 7526\n<00002521> 7529\n<00002522> 7528\n<00002525> 7535\n<00002526> 7533\n<00002527> 7532\n<00002528> 7534\n<00002529> 7537\n<0000252a> 7536\n<0000252b> 7538\n<0000252c> 7515\n<00002530> 7516\n<00002534> 7507\n<00002538> 7508\n<00002540> 7541\n<00002541> 7540\n<00002542> 7542\n<00002543> 7547\n<00002544> 7549\n<00002545> 7546\n<00002546> 7548\n<00002547> 7553\n<00002548> 7552\n<0000261c> 8221\n<0000261d> 8219\n<0000261e> 8222\n<0000261f> 8220\n<00002702> 12178\n<000027a1> 8209\n<0000301c> 7894\n<0000301d> 7956\n<0000301f> 7957\n<00003041> 7918\n<00003043> 7919\n<00003045> 7920\n<00003047> 7921\n<00003049> 7922\n<00003063> 7923\n<00003083> 7924\n<00003085> 7925\n<00003087> 7926\n<0000308e> 7927\n<0000309b> 8272\n<0000309c> 8271\n<000030a0> 16331\n<000030a1> 7928\nendcidchar\n\n79 begincidchar\n<000030a3> 7929\n<000030a5> 7930\n<000030a7> 7931\n<000030a9> 7932\n<000030c3> 7933\n<000030e3> 7934\n<000030e5> 7935\n<000030e7> 7936\n<000030ee> 7937\n<000030fc> 7891\n<00003300> 8350\n<00003303> 8338\n<00003304> 11960\n<00003305> 8333\n<00003306> 11961\n<00003307> 11965\n<00003308> 11963\n<00003309> 11968\n<0000330a> 11966\n<0000330b> 11970\n<0000330c> 11972\n<0000330d> 7950\n<00003314> 7941\n<00003315> 8340\n<00003316> 8330\n<00003317> 11980\n<00003318> 8339\n<00003319> 11982\n<0000331e> 8353\n<00003322> 8329\n<00003323> 8348\n<00003324> 11991\n<00003325> 11993\n<00003326> 7951\n<00003327> 7945\n<0000332a> 8356\n<0000332b> 7953\n<0000332d> 11999\n<00003331> 8358\n<00003332> 12005\n<00003333> 8334\n<00003336> 7947\n<00003337> 12014\n<00003338> 12016\n<00003339> 8343\n<0000333a> 12017\n<0000333b> 8349\n<0000333c> 12010\n<0000333d> 12018\n<00003341> 12019\n<00003342> 8347\n<00003347> 8357\n<00003348> 12027\n<00003349> 7940\n<0000334a> 7954\n<0000334d> 7943\n<0000334e> 8337\n<00003351> 7948\n<00003352> 12034\n<00003353> 12038\n<00003354> 12035\n<00003357> 8344\n<0000337b> 12044\n<0000337c> 12043\n<0000337d> 12042\n<0000337e> 12041\n<0000337f> 8324\n<0000ff0c> 8268\n<0000ff0e> 8274\n<0000ff1a> 12101\n<0000ff1d> 7917\n<0000ff3b> 7903\n<0000ff3d> 7904\n<0000ff3f> 7890\n<0000ff5b> 7905\n<0000ff5c> 7896\n<0000ff5d> 7906\n<0000ff5e> 7894\n<0000ffe3> 7889\nendcidchar\n\n37 begincidrange\n<000023b0> <000023b1> 16350\n<00002500> <00002501> 7481\n<00002502> <00002503> 7479\n<00002504> <00002505> 7485\n<00002506> <00002507> 7483\n<00002508> <00002509> 7489\n<0000250a> <0000250b> 7487\n<00002523> <00002524> 7530\n<0000252d> <0000252f> 7517\n<00002531> <00002533> 7520\n<00002535> <00002537> 7509\n<00002539> <0000253b> 7512\n<0000253d> <0000253f> 7543\n<00002549> <0000254a> 7550\n<00003001> <00003002> 7887\n<00003008> <00003011> 7907\n<00003014> <00003015> 7901\n<00003016> <00003017> 16329\n<00003018> <00003019> 12139\n<00003095> <00003096> 8264\n<000030f5> <000030f6> 7938\n<000031f0> <000031f9> 16333\n<000031fa> <000031ff> 16344\n<00003301> <00003302> 11958\n<0000330e> <00003313> 11973\n<0000331a> <0000331d> 11984\n<0000331f> <00003321> 11988\n<00003328> <00003329> 11996\n<0000332e> <00003330> 12002\n<00003334> <00003335> 12008\n<0000333e> <00003340> 12020\n<00003343> <00003346> 12023\n<0000334b> <0000334c> 12028\n<0000334f> <00003350> 12030\n<00003355> <00003356> 12039\n<0000ff08> <0000ff09> 7899\n<0000ff5f> <0000ff60> 12141\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (H)\n%%BeginResource: CMap (V)\n%%Title: (V Adobe Japan1 1)\n%%Version: 12.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 1 def\nend def\n\n/CMapName /V def\n/CMapVersion 12.002 def\n/CMapType 1 def\n\n/UIDOffset 850 def\n/XUID [1 10 25340] def\n\n/WMode 1 def\n\n27 begincidrange\n<2122> <2123> 7887\n<2131> <2132> 7889\n<213c> <213e> 7891\n<2141> <2145> 7894\n<214a> <215b> 7899\n<2161> <2161> 7917\n<2421> <2421> 7918\n<2423> <2423> 7919\n<2425> <2425> 7920\n<2427> <2427> 7921\n<2429> <2429> 7922\n<2443> <2443> 7923\n<2463> <2463> 7924\n<2465> <2465> 7925\n<2467> <2467> 7926\n<246e> <246e> 7927\n<2521> <2521> 7928\n<2523> <2523> 7929\n<2525> <2525> 7930\n<2527> <2527> 7931\n<2529> <2529> 7932\n<2543> <2543> 7933\n<2563> <2563> 7934\n<2565> <2565> 7935\n<2567> <2567> 7936\n<256e> <256e> 7937\n<2575> <2576> 7938\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/japan/WP-Symbol",
    "content": "%!PS-Adobe-3.0 Resource-CMap \n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (WP-Symbol)\n%%Title: (WP-Symbol Adobe Japan1 0)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Japan1) def\n  /Supplement 0 def\nend def\n\n/CMapName /WP-Symbol def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 868 def\n/XUID [1 10 25352] def\n\n/WMode 0 def\n\n1 begincodespacerange\n  <00> <FF>\nendcodespacerange\n\n27 begincidrange\n<01> <01> 8056\n<02> <02> 8058\n<03> <03> 8191\n<04> <04> 8196\n<05> <18> 8061\n<19> <22> 8092\n<23> <23> 8186\n<24> <25> 8020\n<26> <26> 8187\n<27> <28> 8022\n<29> <29> 8188\n<2a> <2a> 8037\n<2b> <2d> 8024\n<2e> <2f> 8189\n<30> <31> 8192\n<32> <33> 7899\n<34> <34> 7894\n<35> <35> 8194\n<36> <36> 8035\n<37> <39> 8027\n<3a> <3a> 8195\n<3b> <54> 8112\n<55> <5d> 8197\n<5e> <5e> 8151\n<61> <71> 8206\n<72> <72> 8057\n<73> <77> 8223\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/Adobe-Korea1-0",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe Korea1 0)\n%%Version: 9.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Korea1) def\n  /Supplement 0 def\nend def\n\n/CMapName /Adobe-Korea1-0 def\n/CMapVersion 9.003 def\n/CMapType 1 def\n\n/XUID [1 10 25408] def\n\n/WMode 0 def\n\n/CIDCount 9333 def\n\n1 begincodespacerange\n  <0000> <24FF>\nendcodespacerange\n\n37 begincidrange\n<0000> <00ff>     0\n<0100> <01ff>   256\n<0200> <02ff>   512\n<0300> <03ff>   768\n<0400> <04ff>  1024\n<0500> <05ff>  1280\n<0600> <06ff>  1536\n<0700> <07ff>  1792\n<0800> <08ff>  2048\n<0900> <09ff>  2304\n<0a00> <0aff>  2560\n<0b00> <0bff>  2816\n<0c00> <0cff>  3072\n<0d00> <0dff>  3328\n<0e00> <0eff>  3584\n<0f00> <0fff>  3840\n<1000> <10ff>  4096\n<1100> <11ff>  4352\n<1200> <12ff>  4608\n<1300> <13ff>  4864\n<1400> <14ff>  5120\n<1500> <15ff>  5376\n<1600> <16ff>  5632\n<1700> <17ff>  5888\n<1800> <18ff>  6144\n<1900> <19ff>  6400\n<1a00> <1aff>  6656\n<1b00> <1bff>  6912\n<1c00> <1cff>  7168\n<1d00> <1dff>  7424\n<1e00> <1eff>  7680\n<1f00> <1fff>  7936\n<2000> <20ff>  8192\n<2100> <21ff>  8448\n<2200> <22ff>  8704\n<2300> <23ff>  8960\n<2400> <2474>  9216\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/Adobe-Korea1-1",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe Korea1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Korea1) def\n  /Supplement 1 def\nend def\n\n/CMapName /Adobe-Korea1-1 def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 330 def\n/XUID [1 10 25418] def\n\n/WMode 0 def\n\n/CIDCount 18155 def\n\n1 begincodespacerange\n  <0000> <46FF>\nendcodespacerange\n\n71 begincidrange\n<0000> <00ff> 0\n<0100> <01ff> 256\n<0200> <02ff> 512\n<0300> <03ff> 768\n<0400> <04ff> 1024\n<0500> <05ff> 1280\n<0600> <06ff> 1536\n<0700> <07ff> 1792\n<0800> <08ff> 2048\n<0900> <09ff> 2304\n<0a00> <0aff> 2560\n<0b00> <0bff> 2816\n<0c00> <0cff> 3072\n<0d00> <0dff> 3328\n<0e00> <0eff> 3584\n<0f00> <0fff> 3840\n<1000> <10ff> 4096\n<1100> <11ff> 4352\n<1200> <12ff> 4608\n<1300> <13ff> 4864\n<1400> <14ff> 5120\n<1500> <15ff> 5376\n<1600> <16ff> 5632\n<1700> <17ff> 5888\n<1800> <18ff> 6144\n<1900> <19ff> 6400\n<1a00> <1aff> 6656\n<1b00> <1bff> 6912\n<1c00> <1cff> 7168\n<1d00> <1dff> 7424\n<1e00> <1eff> 7680\n<1f00> <1fff> 7936\n<2000> <20ff> 8192\n<2100> <21ff> 8448\n<2200> <22ff> 8704\n<2300> <23ff> 8960\n<2400> <24ff> 9216\n<2500> <25ff> 9472\n<2600> <26ff> 9728\n<2700> <27ff> 9984\n<2800> <28ff> 10240\n<2900> <29ff> 10496\n<2a00> <2aff> 10752\n<2b00> <2bff> 11008\n<2c00> <2cff> 11264\n<2d00> <2dff> 11520\n<2e00> <2eff> 11776\n<2f00> <2fff> 12032\n<3000> <30ff> 12288\n<3100> <31ff> 12544\n<3200> <32ff> 12800\n<3300> <33ff> 13056\n<3400> <34ff> 13312\n<3500> <35ff> 13568\n<3600> <36ff> 13824\n<3700> <37ff> 14080\n<3800> <38ff> 14336\n<3900> <39ff> 14592\n<3a00> <3aff> 14848\n<3b00> <3bff> 15104\n<3c00> <3cff> 15360\n<3d00> <3dff> 15616\n<3e00> <3eff> 15872\n<3f00> <3fff> 16128\n<4000> <40ff> 16384\n<4100> <41ff> 16640\n<4200> <42ff> 16896\n<4300> <43ff> 17152\n<4400> <44ff> 17408\n<4500> <45ff> 17664\n<4600> <46ea> 17920\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/Adobe-Korea1-2",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Identity)\n%%Title: (Identity Adobe Korea1 2)\n%%Version: 1.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Korea1) def\n  /Supplement 2 def\nend def\n\n/CMapName /Adobe-Korea1-2 def\n/CMapVersion 1.002 def\n/CMapType 1 def\n\n/XUID [1 10 25541] def\n\n/WMode 0 def\n\n/CIDCount 18352 def\n\n1 begincodespacerange\n  <0000> <47FF>\nendcodespacerange\n\n72 begincidrange\n<0000> <00ff> 0\n<0100> <01ff> 256\n<0200> <02ff> 512\n<0300> <03ff> 768\n<0400> <04ff> 1024\n<0500> <05ff> 1280\n<0600> <06ff> 1536\n<0700> <07ff> 1792\n<0800> <08ff> 2048\n<0900> <09ff> 2304\n<0a00> <0aff> 2560\n<0b00> <0bff> 2816\n<0c00> <0cff> 3072\n<0d00> <0dff> 3328\n<0e00> <0eff> 3584\n<0f00> <0fff> 3840\n<1000> <10ff> 4096\n<1100> <11ff> 4352\n<1200> <12ff> 4608\n<1300> <13ff> 4864\n<1400> <14ff> 5120\n<1500> <15ff> 5376\n<1600> <16ff> 5632\n<1700> <17ff> 5888\n<1800> <18ff> 6144\n<1900> <19ff> 6400\n<1a00> <1aff> 6656\n<1b00> <1bff> 6912\n<1c00> <1cff> 7168\n<1d00> <1dff> 7424\n<1e00> <1eff> 7680\n<1f00> <1fff> 7936\n<2000> <20ff> 8192\n<2100> <21ff> 8448\n<2200> <22ff> 8704\n<2300> <23ff> 8960\n<2400> <24ff> 9216\n<2500> <25ff> 9472\n<2600> <26ff> 9728\n<2700> <27ff> 9984\n<2800> <28ff> 10240\n<2900> <29ff> 10496\n<2a00> <2aff> 10752\n<2b00> <2bff> 11008\n<2c00> <2cff> 11264\n<2d00> <2dff> 11520\n<2e00> <2eff> 11776\n<2f00> <2fff> 12032\n<3000> <30ff> 12288\n<3100> <31ff> 12544\n<3200> <32ff> 12800\n<3300> <33ff> 13056\n<3400> <34ff> 13312\n<3500> <35ff> 13568\n<3600> <36ff> 13824\n<3700> <37ff> 14080\n<3800> <38ff> 14336\n<3900> <39ff> 14592\n<3a00> <3aff> 14848\n<3b00> <3bff> 15104\n<3c00> <3cff> 15360\n<3d00> <3dff> 15616\n<3e00> <3eff> 15872\n<3f00> <3fff> 16128\n<4000> <40ff> 16384\n<4100> <41ff> 16640\n<4200> <42ff> 16896\n<4300> <43ff> 17152\n<4400> <44ff> 17408\n<4500> <45ff> 17664\n<4600> <46ff> 17920\n<4700> <47af> 18176\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/Adobe-Korea1-UCS2",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (Adobe-Korea1-UCS2)\n%%Title: (Adobe-Korea1-UCS2 Adobe Korea1 2)\n%%Version: 5.001\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Adobe_Korea1_UCS2) def\n  /Supplement 2 def\nend def\n\n/CMapName /Adobe-Korea1-UCS2 def\n\n/CMapVersion 5.001 def\n/CMapType 2 def\n\n/XUID [1 10 25335 1212] def\n\n/WMode 0 def\n\n1 begincodespacerange\n  <0000> <FFFF>\nendcodespacerange\n\n100 beginbfchar\n<0000> <FFFD>\n<0060> <20A9>\n<0061> <2010>\n<0062> <00A9>\n<0063> <2122>\n<0064> <22EF>\n<0068> <00B7>\n<006B> <00A8>\n<006C> <3003>\n<006F> <2016>\n<0070> <FF3C>\n<0071> <223C>\n<0082> <00B1>\n<0083> <00D7>\n<0084> <00F7>\n<0085> <2260>\n<0088> <221E>\n<0089> <2234>\n<008A> <00B0>\n<008D> <2103>\n<008E> <212B>\n<0091> <FFE5>\n<0092> <2642>\n<0093> <2640>\n<0094> <2220>\n<0095> <22A5>\n<0096> <2312>\n<0097> <2202>\n<0098> <2207>\n<0099> <2261>\n<009A> <2252>\n<009B> <00A7>\n<009C> <203B>\n<009D> <2606>\n<009E> <2605>\n<009F> <25CB>\n<00A0> <25CF>\n<00A1> <25CE>\n<00A2> <25C7>\n<00A3> <25C6>\n<00A4> <25A1>\n<00A5> <25A0>\n<00A6> <25B3>\n<00A7> <25B2>\n<00A8> <25BD>\n<00A9> <25BC>\n<00AA> <2192>\n<00AF> <3013>\n<00B2> <221A>\n<00B3> <223D>\n<00B4> <221D>\n<00B5> <2235>\n<00B8> <2208>\n<00B9> <220B>\n<00BE> <222A>\n<00BF> <2229>\n<00C2> <FFE2>\n<00C3> <21D2>\n<00C4> <21D4>\n<00C5> <2200>\n<00C6> <2203>\n<00C7> <00B4>\n<00C8> <02DC>\n<00C9> <02C7>\n<00CA> <02D8>\n<00CB> <02DD>\n<00CC> <02DA>\n<00CD> <02D9>\n<00CE> <00B8>\n<00CF> <02DB>\n<00D0> <00A1>\n<00D1> <00BF>\n<00D2> <2236>\n<00D3> <222E>\n<00D4> <2211>\n<00D5> <220F>\n<00D6> <00A4>\n<00D7> <2109>\n<00D8> <2030>\n<00D9> <25C1>\n<00DA> <25C0>\n<00DB> <25B7>\n<00DC> <25B6>\n<00DD> <2664>\n<00E0> <2665>\n<00E1> <2667>\n<00E2> <2663>\n<00E3> <2299>\n<00E4> <25C8>\n<00E5> <25A3>\n<00E8> <2592>\n<00EB> <25A8>\n<00EC> <25A7>\n<00ED> <25A6>\n<00EE> <25A9>\n<00EF> <2668>\n<00F0> <260F>\n<00F1> <260E>\n<00F2> <261C>\n<00F3> <261E>\nendbfchar\n\n100 beginbfchar\n<00F4> <00B6>\n<00F7> <2195>\n<00F8> <2197>\n<00F9> <2199>\n<00FA> <2196>\n<00FB> <2198>\n<00FC> <266D>\n<00FF> <266C>\n<0100> <327F>\n<0101> <321C>\n<0102> <2116>\n<0103> <33C7>\n<0104> <2122>\n<0105> <33C2>\n<0106> <33D8>\n<0107> <2121>\n<0143> <FFE6>\n<0165> <FFE3>\n<0207> <2500>\n<0208> <2502>\n<0209> <250C>\n<020A> <2510>\n<020B> <2518>\n<020C> <2514>\n<020D> <251C>\n<020E> <252C>\n<020F> <2524>\n<0210> <2534>\n<0211> <253C>\n<0212> <2501>\n<0213> <2503>\n<0214> <250F>\n<0215> <2513>\n<0216> <251B>\n<0217> <2517>\n<0218> <2523>\n<0219> <2533>\n<021A> <252B>\n<021B> <253B>\n<021C> <254B>\n<021D> <2520>\n<021E> <252F>\n<021F> <2528>\n<0220> <2537>\n<0221> <253F>\n<0222> <251D>\n<0223> <2530>\n<0224> <2525>\n<0225> <2538>\n<0226> <2542>\n<0227> <2512>\n<0228> <2511>\n<0229> <251A>\n<022A> <2519>\n<022B> <2516>\n<022C> <2515>\n<022D> <250E>\n<022E> <250D>\n<024E> <2113>\n<024F> <3398>\n<0250> <33C4>\n<025F> <33CA>\n<0263> <33CF>\n<0266> <33C8>\n<0283> <2126>\n<0289> <33D6>\n<028A> <33C5>\n<028E> <33DB>\n<0293> <33DD>\n<0294> <33D0>\n<0295> <33D3>\n<0296> <33C3>\n<0297> <33C9>\n<0298> <33DC>\n<0299> <33C6>\n<029A> <00C6>\n<029B> <00D0>\n<029C> <00AA>\n<029D> <0126>\n<029E> <0132>\n<029F> <013F>\n<02A0> <0141>\n<02A1> <00D8>\n<02A2> <0152>\n<02A3> <00BA>\n<02A4> <00DE>\n<02A5> <0166>\n<02A6> <014A>\n<02EC> <00BD>\n<02EF> <00BC>\n<02F0> <00BE>\n<02F5> <00E6>\n<02F6> <0111>\n<02F7> <00F0>\n<02F8> <0127>\n<02F9> <0131>\n<02FA> <0133>\n<02FB> <0138>\n<02FC> <0140>\n<02FD> <0142>\nendbfchar\n\n100 beginbfchar\n<02FE> <00F8>\n<02FF> <0153>\n<0300> <00DF>\n<0301> <00FE>\n<0302> <0167>\n<0303> <014B>\n<0304> <0149>\n<034A> <00B9>\n<034D> <2074>\n<034E> <207F>\n<0402> <0401>\n<0423> <0451>\n<0440> <AC04>\n<0452> <AC20>\n<0453> <AC24>\n<045B> <AC3C>\n<045C> <AC40>\n<045D> <AC4B>\n<045E> <AC4D>\n<045F> <AC54>\n<0460> <AC58>\n<0461> <AC5C>\n<0464> <AC74>\n<0467> <AC7A>\n<0472> <AC90>\n<0473> <AC94>\n<047C> <ACAC>\n<0484> <ACC1>\n<0485> <ACC4>\n<0486> <ACC8>\n<0487> <ACCC>\n<0488> <ACD5>\n<0489> <ACD7>\n<048C> <ACE4>\n<048F> <ACEA>\n<0490> <ACEC>\n<0494> <ACF3>\n<0499> <AD00>\n<049A> <AD04>\n<049B> <AD06>\n<049E> <AD0F>\n<049F> <AD11>\n<04A0> <AD18>\n<04A1> <AD1C>\n<04A2> <AD20>\n<04A3> <AD29>\n<04A8> <AD38>\n<04A9> <AD3C>\n<04AC> <AD47>\n<04AD> <AD49>\n<04AE> <AD50>\n<04AF> <AD54>\n<04B0> <AD58>\n<04B1> <AD61>\n<04B2> <AD63>\n<04B5> <AD70>\n<04BD> <AD7F>\n<04C2> <AD8C>\n<04C3> <AD90>\n<04C6> <ADA4>\n<04C7> <ADB7>\n<04CA> <ADC4>\n<04CB> <ADC8>\n<04CE> <ADD3>\n<04CF> <ADDC>\n<04D0> <ADE0>\n<04D1> <ADE4>\n<04D4> <ADFC>\n<04DA> <AE0B>\n<04DB> <AE0D>\n<04DC> <AE14>\n<04DF> <AE34>\n<04E2> <AE3A>\n<04E5> <AE43>\n<04E8> <AE4A>\n<04EC> <AE50>\n<04ED> <AE54>\n<04EE> <AE56>\n<04F4> <AE65>\n<04F7> <AE6C>\n<04F8> <AE70>\n<0500> <AE8C>\n<0504> <AEC0>\n<0505> <AEC4>\n<050D> <AEDC>\n<050E> <AEE8>\n<050F> <AEEB>\n<0510> <AEED>\n<0511> <AEF4>\n<0512> <AEF8>\n<0513> <AEFC>\n<0516> <AF0D>\n<0517> <AF10>\n<051A> <AF30>\n<051B> <AF32>\n<051C> <AF34>\n<051F> <AF3F>\n<0525> <AF50>\n<052A> <AF79>\n<052B> <AF80>\nendbfchar\n\n100 beginbfchar\n<052C> <AF84>\n<052D> <AF88>\n<0530> <AF95>\n<0531> <AF9C>\n<0534> <AFBC>\n<0535> <AFC0>\n<0539> <AFCB>\n<053C> <AFD4>\n<053D> <AFDC>\n<0542> <AFF4>\n<0543> <AFF8>\n<0546> <B004>\n<0547> <B00C>\n<0548> <B010>\n<0549> <B014>\n<054C> <B028>\n<054F> <B048>\n<0550> <B04A>\n<0551> <B04C>\n<0552> <B04E>\n<0556> <B057>\n<0557> <B059>\n<0558> <B05D>\n<055B> <B080>\n<055C> <B084>\n<055F> <B08F>\n<0560> <B091>\n<0564> <B09C>\n<0570> <B0B1>\n<0574> <B0B8>\n<0575> <B0BC>\n<057D> <B0D4>\n<057E> <B0D8>\n<057F> <B0E0>\n<0580> <B0E5>\n<0585> <B110>\n<0590> <B128>\n<0591> <B12C>\n<0599> <B144>\n<059A> <B148>\n<059F> <B158>\n<05A0> <B15C>\n<05A1> <B160>\n<05A4> <B17C>\n<05A5> <B180>\n<05A6> <B182>\n<05A9> <B18B>\n<05AA> <B18D>\n<05AE> <B198>\n<05AF> <B19C>\n<05B0> <B1A8>\n<05B1> <B1CC>\n<05B2> <B1D0>\n<05B3> <B1D4>\n<05B6> <B1DF>\n<05B9> <B1EC>\n<05BA> <B1F0>\n<05BB> <B1F9>\n<05BC> <B1FB>\n<05BD> <B1FD>\n<05C0> <B208>\n<05C5> <B217>\n<05C6> <B219>\n<05C7> <B220>\n<05C8> <B234>\n<05C9> <B23C>\n<05CA> <B258>\n<05CB> <B25C>\n<05CC> <B260>\n<05D1> <B27C>\n<05D4> <B289>\n<05D7> <B294>\n<05DD> <B2A3>\n<05E0> <B2AA>\n<05E1> <B2AC>\n<05E2> <B2B0>\n<05E3> <B2B4>\n<05E6> <B2CC>\n<05E7> <B2D0>\n<05E8> <B2D2>\n<05EB> <B2DB>\n<05EC> <B2DD>\n<05ED> <B2E2>\n<05F1> <B2E8>\n<05FF> <B2FF>\n<0602> <B304>\n<0603> <B308>\n<0609> <B31C>\n<060D> <B358>\n<0614> <B367>\n<0615> <B369>\n<0616> <B36B>\n<0617> <B36E>\n<061A> <B374>\n<061B> <B378>\n<0621> <B38C>\n<0622> <B390>\n<0623> <B394>\n<0626> <B3A8>\n<0627> <B3AC>\nendbfchar\n\n100 beginbfchar\n<062A> <B3C8>\n<062D> <B3CE>\n<062E> <B3D0>\n<0631> <B3D7>\n<0632> <B3D9>\n<0633> <B3DB>\n<0634> <B3DD>\n<0635> <B3E0>\n<0636> <B3E4>\n<0637> <B3E8>\n<0638> <B3FC>\n<0639> <B410>\n<063A> <B418>\n<063B> <B41C>\n<063C> <B420>\n<063F> <B42B>\n<0640> <B434>\n<0643> <B454>\n<0644> <B458>\n<0647> <B463>\n<0648> <B465>\n<0649> <B46C>\n<064A> <B480>\n<064B> <B488>\n<064C> <B49D>\n<064D> <B4A4>\n<064E> <B4A8>\n<064F> <B4AC>\n<0650> <B4B5>\n<0651> <B4B7>\n<0652> <B4B9>\n<0653> <B4C0>\n<0654> <B4C4>\n<0655> <B4C8>\n<0656> <B4D0>\n<0657> <B4D5>\n<065A> <B4E0>\n<065D> <B4E6>\n<0660> <B4EF>\n<0661> <B4F1>\n<0662> <B4F8>\n<0665> <B518>\n<0670> <B534>\n<0671> <B538>\n<067A> <B550>\n<067B> <B554>\n<0683> <B5A4>\n<0684> <B5A8>\n<068F> <B5C0>\n<0690> <B5C4>\n<0696> <B5D8>\n<0697> <B5EC>\n<069A> <B614>\n<069B> <B618>\n<069C> <B625>\n<069D> <B62C>\n<069E> <B634>\n<069F> <B648>\n<06A0> <B664>\n<06A1> <B668>\n<06A4> <B6A0>\n<06A5> <B6A4>\n<06A8> <B6B1>\n<06A9> <B6D4>\n<06AA> <B6F0>\n<06AB> <B6F4>\n<06AC> <B6F8>\n<06AF> <B705>\n<06B2> <B72C>\n<06B7> <B73B>\n<06B8> <B744>\n<06B9> <B748>\n<06BA> <B74C>\n<06BD> <B760>\n<06BE> <B764>\n<06BF> <B768>\n<06C2> <B773>\n<06C3> <B775>\n<06C6> <B780>\n<06C7> <B784>\n<06D2> <B79C>\n<06D3> <B7A0>\n<06DB> <B7B8>\n<06DC> <B7C7>\n<06DD> <B7C9>\n<06E0> <B7F0>\n<06E1> <B7F4>\n<06EA> <B80C>\n<06EB> <B810>\n<06EE> <B81B>\n<06EF> <B81D>\n<06F2> <B828>\n<06F3> <B82C>\n<06F9> <B840>\n<06FA> <B844>\n<06FB> <B851>\n<06FC> <B853>\n<06FF> <B860>\n<0700> <B864>\n<0703> <B86F>\nendbfchar\n\n100 beginbfchar\n<0704> <B871>\n<0705> <B878>\n<0706> <B87C>\n<0707> <B88D>\n<0708> <B8A8>\n<0709> <B8B0>\n<070A> <B8B4>\n<070B> <B8B8>\n<070E> <B8C3>\n<070F> <B8C5>\n<0710> <B8CC>\n<0711> <B8D0>\n<0712> <B8D4>\n<0713> <B8DD>\n<0714> <B8DF>\n<0715> <B8E1>\n<0718> <B8EC>\n<0719> <B8F0>\n<071C> <B8FB>\n<071D> <B8FD>\n<071E> <B904>\n<071F> <B918>\n<0720> <B920>\n<0723> <B940>\n<0724> <B944>\n<0725> <B94C>\n<0726> <B94F>\n<0727> <B951>\n<072A> <B95C>\n<072B> <B960>\n<072E> <B96B>\n<072F> <B96D>\n<0732> <B978>\n<0733> <B97C>\n<0736> <B987>\n<073D> <B9B0>\n<073E> <B9B4>\n<0741> <B9BF>\n<0742> <B9C1>\n<0745> <B9CC>\n<074D> <B9DB>\n<0750> <B9E1>\n<0754> <B9E8>\n<0755> <B9EC>\n<075E> <BA08>\n<075F> <BA15>\n<0762> <BA3C>\n<0763> <BA40>\n<0764> <BA42>\n<0767> <BA4B>\n<076D> <BA58>\n<076E> <BA5C>\n<0776> <BA74>\n<0777> <BA78>\n<077B> <BA87>\n<077C> <BA8C>\n<0781> <BAB0>\n<0782> <BAB2>\n<0785> <BABB>\n<0786> <BABD>\n<0787> <BAC4>\n<0788> <BAC8>\n<078B> <BAFC>\n<078C> <BB00>\n<078D> <BB04>\n<078E> <BB0D>\n<078F> <BB0F>\n<0790> <BB11>\n<0791> <BB18>\n<0792> <BB1C>\n<0793> <BB20>\n<0794> <BB29>\n<0795> <BB2B>\n<0799> <BB38>\n<07A0> <BB47>\n<07A1> <BB49>\n<07A2> <BB4D>\n<07A5> <BB54>\n<07A6> <BB58>\n<07A7> <BB61>\n<07A8> <BB63>\n<07A9> <BB6C>\n<07AA> <BB88>\n<07AB> <BB8C>\n<07AC> <BB90>\n<07AD> <BBA4>\n<07AE> <BBA8>\n<07AF> <BBAC>\n<07B0> <BBB4>\n<07B1> <BBB7>\n<07B2> <BBC0>\n<07B3> <BBC4>\n<07B4> <BBC8>\n<07B5> <BBD0>\n<07B6> <BBD3>\n<07B9> <BBFC>\n<07BC> <BC02>\n<07C2> <BC0F>\n<07C3> <BC11>\n<07D0> <BC27>\nendbfchar\n\n100 beginbfchar\n<07D1> <BC29>\n<07D2> <BC2D>\n<07D5> <BC34>\n<07D6> <BC38>\n<07DC> <BC49>\n<07DF> <BC50>\n<07E0> <BC5D>\n<07E3> <BC88>\n<07E6> <BC8E>\n<07E9> <BC97>\n<07EE> <BCA4>\n<07F8> <BCC0>\n<07F9> <BCC4>\n<07FA> <BCCD>\n<07FE> <BCD5>\n<07FF> <BCD8>\n<0800> <BCDC>\n<0804> <BCF8>\n<0805> <BCFC>\n<0808> <BD07>\n<0809> <BD09>\n<080A> <BD10>\n<080B> <BD14>\n<080C> <BD24>\n<080D> <BD2C>\n<080E> <BD40>\n<0811> <BD4C>\n<0812> <BD50>\n<0815> <BD64>\n<0816> <BD68>\n<0819> <BD84>\n<0820> <BD93>\n<0821> <BD95>\n<0824> <BD9C>\n<0825> <BDA4>\n<0826> <BDB0>\n<0827> <BDB8>\n<082A> <BDD8>\n<082B> <BDDC>\n<082C> <BDE9>\n<082D> <BDF0>\n<082E> <BDF4>\n<082F> <BDF8>\n<0830> <BE00>\n<0831> <BE03>\n<0832> <BE05>\n<0835> <BE10>\n<0836> <BE14>\n<0839> <BE1F>\n<083C> <BE48>\n<083D> <BE4C>\n<083E> <BE4E>\n<0841> <BE57>\n<0847> <BE64>\n<0848> <BE68>\n<0849> <BE6A>\n<0852> <BE80>\n<0853> <BE84>\n<085B> <BEA8>\n<085E> <BED4>\n<0861> <BEE0>\n<0865> <BEEC>\n<0866> <BF01>\n<0870> <BF44>\n<0871> <BF48>\n<0874> <BF55>\n<0875> <BF94>\n<0876> <BFB0>\n<0877> <BFC5>\n<087A> <BFD0>\n<087B> <BFD4>\n<087C> <BFDC>\n<087D> <BFDF>\n<087E> <BFE1>\n<087F> <C03C>\n<0880> <C051>\n<0881> <C058>\n<0882> <C05C>\n<0883> <C060>\n<0888> <C094>\n<0889> <C098>\n<088C> <C0A3>\n<088D> <C0A5>\n<089B> <C0C5>\n<089E> <C0CC>\n<089F> <C0D0>\n<08A7> <C0E8>\n<08A8> <C0EC>\n<08AB> <C0F7>\n<08AC> <C0F9>\n<08AD> <C100>\n<08AE> <C104>\n<08AF> <C108>\n<08B0> <C110>\n<08B1> <C115>\n<08C0> <C136>\n<08C3> <C13C>\n<08C4> <C140>\n<08CC> <C158>\n<08CD> <C15C>\nendbfchar\n\n100 beginbfchar\n<08D3> <C170>\n<08D4> <C174>\n<08D5> <C178>\n<08D6> <C185>\n<08DA> <C190>\n<08DB> <C194>\n<08DC> <C196>\n<08DF> <C19F>\n<08E0> <C1A1>\n<08E1> <C1A5>\n<08E4> <C1AC>\n<08E5> <C1B0>\n<08E6> <C1BD>\n<08E7> <C1C4>\n<08E8> <C1C8>\n<08E9> <C1CC>\n<08EA> <C1D4>\n<08ED> <C1E0>\n<08EE> <C1E4>\n<08EF> <C1E8>\n<08F2> <C1F3>\n<08F5> <C200>\n<08F6> <C204>\n<08F9> <C20F>\n<08FA> <C211>\n<08FD> <C21C>\n<0902> <C22B>\n<0903> <C22D>\n<0904> <C22F>\n<0907> <C234>\n<0908> <C248>\n<090B> <C254>\n<090C> <C258>\n<090D> <C260>\n<090E> <C265>\n<0911> <C270>\n<0912> <C274>\n<0915> <C27F>\n<0916> <C281>\n<0919> <C290>\n<091A> <C298>\n<091B> <C29B>\n<091C> <C29D>\n<091F> <C2A8>\n<0924> <C2B7>\n<0925> <C2B9>\n<0928> <C2E0>\n<092E> <C2EF>\n<092F> <C2F1>\n<0930> <C2F6>\n<0935> <C300>\n<093D> <C318>\n<093E> <C31C>\n<0943> <C345>\n<0946> <C36C>\n<0947> <C370>\n<0948> <C372>\n<094D> <C384>\n<094E> <C388>\n<094F> <C38C>\n<0950> <C3C0>\n<0953> <C3DC>\n<0956> <C3E2>\n<0959> <C3ED>\n<095C> <C3F8>\n<095D> <C408>\n<095E> <C410>\n<095F> <C424>\n<0960> <C42C>\n<0961> <C430>\n<0962> <C434>\n<0965> <C448>\n<0968> <C468>\n<0969> <C46C>\n<096C> <C479>\n<096D> <C480>\n<096E> <C494>\n<096F> <C49C>\n<0970> <C4B8>\n<0971> <C4BC>\n<0972> <C4E9>\n<0975> <C4F4>\n<0976> <C4F8>\n<0977> <C4FA>\n<097B> <C50C>\n<097C> <C510>\n<097D> <C514>\n<097E> <C51C>\n<0981> <C52C>\n<0982> <C530>\n<0985> <C53B>\n<0986> <C53D>\n<0999> <C564>\n<099A> <C568>\n<09A2> <C580>\n<09A3> <C584>\n<09A4> <C587>\n<09A7> <C58F>\n<09A8> <C591>\n<09A9> <C595>\nendbfchar\n\n100 beginbfchar\n<09AC> <C59C>\n<09AD> <C5A0>\n<09AE> <C5A9>\n<09BE> <C5CC>\n<09BF> <C5CE>\n<09C2> <C5D4>\n<09C3> <C5D8>\n<09C6> <C5E3>\n<09C7> <C5E5>\n<09CB> <C5F0>\n<09CC> <C5F4>\n<09D9> <C60C>\n<09DA> <C610>\n<09E1> <C628>\n<09E5> <C630>\n<09E9> <C637>\n<09EA> <C639>\n<09EB> <C63B>\n<09EE> <C644>\n<09EF> <C648>\n<09F7> <C660>\n<09F8> <C66C>\n<09F9> <C66F>\n<09FA> <C671>\n<09FD> <C67C>\n<09FE> <C680>\n<09FF> <C688>\n<0A00> <C689>\n<0A01> <C68B>\n<0A02> <C68D>\n<0A05> <C698>\n<0A06> <C69C>\n<0A09> <C6A7>\n<0A0A> <C6A9>\n<0A0D> <C6B4>\n<0A13> <C6C3>\n<0A14> <C6C5>\n<0A17> <C6D0>\n<0A18> <C6D4>\n<0A1F> <C6EC>\n<0A20> <C6F0>\n<0A23> <C6FD>\n<0A26> <C708>\n<0A27> <C70C>\n<0A2A> <C717>\n<0A2B> <C719>\n<0A2E> <C724>\n<0A2F> <C728>\n<0A32> <C733>\n<0A33> <C735>\n<0A34> <C737>\n<0A37> <C740>\n<0A38> <C744>\n<0A39> <C74A>\n<0A3C> <C74F>\n<0A45> <C75C>\n<0A46> <C760>\n<0A47> <C768>\n<0A48> <C76B>\n<0A4B> <C778>\n<0A56> <C78E>\n<0A59> <C794>\n<0A5D> <C79A>\n<0A66> <C7B0>\n<0A67> <C7B4>\n<0A6F> <C7CC>\n<0A70> <C7CE>\n<0A71> <C7D0>\n<0A72> <C7D8>\n<0A73> <C7DD>\n<0A74> <C7E4>\n<0A75> <C7E8>\n<0A76> <C7EC>\n<0A79> <C804>\n<0A7A> <C808>\n<0A7B> <C80A>\n<0A7E> <C813>\n<0A83> <C820>\n<0A84> <C824>\n<0A87> <C82F>\n<0A88> <C831>\n<0A89> <C838>\n<0A8A> <C83C>\n<0A8B> <C840>\n<0A90> <C854>\n<0A93> <C874>\n<0A94> <C878>\n<0A95> <C87A>\n<0A98> <C883>\n<0A9F> <C894>\n<0AA0> <C89D>\n<0AA1> <C89F>\n<0AA2> <C8A1>\n<0AA3> <C8A8>\n<0AA6> <C8C4>\n<0AA7> <C8C8>\n<0AA8> <C8CC>\n<0AAB> <C8D7>\n<0AAC> <C8D9>\n<0AAF> <C8E4>\nendbfchar\n\n100 beginbfchar\n<0AB0> <C8F5>\n<0AB3> <C900>\n<0AB9> <C90F>\n<0ABA> <C911>\n<0ABB> <C918>\n<0ABC> <C92C>\n<0ABD> <C934>\n<0AC0> <C954>\n<0AC1> <C958>\n<0AC4> <C963>\n<0AC5> <C96C>\n<0AC6> <C970>\n<0AC7> <C974>\n<0AC8> <C97C>\n<0ACB> <C98C>\n<0ACC> <C990>\n<0ACF> <C99B>\n<0AD0> <C99D>\n<0AD3> <C9C4>\n<0AD6> <C9CA>\n<0AD9> <C9D3>\n<0AE0> <C9E0>\n<0AE1> <C9E2>\n<0AE2> <C9E4>\n<0AE3> <C9E7>\n<0AEB> <C9FC>\n<0AEC> <CA00>\n<0AF2> <CA14>\n<0AF3> <CA18>\n<0AF4> <CA29>\n<0AF7> <CA50>\n<0AF8> <CA54>\n<0AFE> <CA68>\n<0AFF> <CA7D>\n<0B00> <CA84>\n<0B01> <CA98>\n<0B04> <CAC0>\n<0B05> <CAC4>\n<0B08> <CACF>\n<0B09> <CAD1>\n<0B0A> <CAD3>\n<0B0D> <CAE0>\n<0B0E> <CAEC>\n<0B0F> <CAF4>\n<0B10> <CB08>\n<0B11> <CB10>\n<0B12> <CB14>\n<0B13> <CB18>\n<0B16> <CB41>\n<0B19> <CB4C>\n<0B1A> <CB50>\n<0B1D> <CB5D>\n<0B1E> <CB64>\n<0B21> <CB9C>\n<0B22> <CBB8>\n<0B23> <CBD4>\n<0B24> <CBE4>\n<0B25> <CBE7>\n<0B26> <CBE9>\n<0B29> <CC10>\n<0B2A> <CC14>\n<0B32> <CC2C>\n<0B33> <CC2E>\n<0B34> <CC30>\n<0B3D> <CC48>\n<0B3E> <CC4C>\n<0B44> <CC60>\n<0B45> <CC64>\n<0B46> <CC66>\n<0B47> <CC68>\n<0B48> <CC70>\n<0B49> <CC75>\n<0B4C> <CC9C>\n<0B4D> <CCA0>\n<0B55> <CCB8>\n<0B56> <CCBC>\n<0B59> <CCC7>\n<0B5A> <CCC9>\n<0B5B> <CCD0>\n<0B5C> <CCD4>\n<0B5D> <CCE4>\n<0B5E> <CCEC>\n<0B5F> <CCF0>\n<0B60> <CD01>\n<0B63> <CD0C>\n<0B64> <CD10>\n<0B67> <CD1B>\n<0B68> <CD1D>\n<0B69> <CD24>\n<0B6A> <CD28>\n<0B6B> <CD2C>\n<0B6C> <CD39>\n<0B6D> <CD5C>\n<0B6E> <CD60>\n<0B6F> <CD64>\n<0B72> <CD6F>\n<0B73> <CD71>\n<0B74> <CD78>\n<0B75> <CD88>\n<0B78> <CD98>\nendbfchar\n\n100 beginbfchar\n<0B79> <CD9C>\n<0B7C> <CDA7>\n<0B7D> <CDA9>\n<0B7E> <CDB0>\n<0B7F> <CDC4>\n<0B80> <CDCC>\n<0B81> <CDD0>\n<0B82> <CDE8>\n<0B83> <CDEC>\n<0B84> <CDF0>\n<0B87> <CDFB>\n<0B88> <CDFD>\n<0B89> <CE04>\n<0B8A> <CE08>\n<0B8B> <CE0C>\n<0B8C> <CE14>\n<0B8D> <CE19>\n<0B90> <CE24>\n<0B91> <CE28>\n<0B94> <CE33>\n<0B95> <CE35>\n<0B98> <CE5C>\n<0B9E> <CE6B>\n<0B9F> <CE6D>\n<0BA2> <CE78>\n<0BA3> <CE7C>\n<0BA6> <CE87>\n<0BA7> <CE89>\n<0BAA> <CE94>\n<0BAB> <CE98>\n<0BB3> <CEC1>\n<0BB6> <CEE8>\n<0BC0> <CF04>\n<0BC1> <CF08>\n<0BC4> <CF13>\n<0BC5> <CF15>\n<0BC6> <CF1C>\n<0BC7> <CF20>\n<0BC8> <CF24>\n<0BCE> <CF38>\n<0BD1> <CF58>\n<0BD2> <CF5C>\n<0BD5> <CF67>\n<0BD6> <CF69>\n<0BD9> <CF74>\n<0BDA> <CF78>\n<0BDB> <CF80>\n<0BDC> <CF85>\n<0BDD> <CF8C>\n<0BDE> <CFA1>\n<0BDF> <CFA8>\n<0BE0> <CFB0>\n<0BE1> <CFC4>\n<0BE4> <CFE4>\n<0BE5> <CFE8>\n<0BE8> <CFF3>\n<0BE9> <CFF5>\n<0BEA> <CFFC>\n<0BEB> <D000>\n<0BEC> <D004>\n<0BED> <D011>\n<0BEE> <D018>\n<0BEF> <D02D>\n<0BF2> <D038>\n<0BF3> <D03C>\n<0BF6> <D047>\n<0BF7> <D049>\n<0BF8> <D050>\n<0BF9> <D054>\n<0BFA> <D058>\n<0BFB> <D060>\n<0BFE> <D070>\n<0BFF> <D074>\n<0C02> <D081>\n<0C05> <D0A8>\n<0C06> <D0AC>\n<0C09> <D0B7>\n<0C0A> <D0B9>\n<0C0D> <D0C4>\n<0C17> <D0E0>\n<0C18> <D0E4>\n<0C1E> <D0F8>\n<0C1F> <D10D>\n<0C22> <D134>\n<0C23> <D138>\n<0C24> <D13A>\n<0C2C> <D150>\n<0C2D> <D154>\n<0C30> <D15F>\n<0C31> <D161>\n<0C32> <D168>\n<0C33> <D16C>\n<0C34> <D17C>\n<0C35> <D184>\n<0C36> <D188>\n<0C39> <D1A4>\n<0C3A> <D1A8>\n<0C3D> <D1B3>\n<0C3E> <D1B5>\n<0C3F> <D1BA>\nendbfchar\n\n100 beginbfchar\n<0C40> <D1BC>\n<0C41> <D1C0>\n<0C42> <D1D8>\n<0C43> <D1F4>\n<0C44> <D1F8>\n<0C45> <D207>\n<0C46> <D209>\n<0C47> <D210>\n<0C4A> <D230>\n<0C4B> <D234>\n<0C4E> <D23F>\n<0C4F> <D241>\n<0C50> <D248>\n<0C51> <D25C>\n<0C52> <D264>\n<0C55> <D284>\n<0C56> <D288>\n<0C59> <D295>\n<0C5A> <D29C>\n<0C5B> <D2A0>\n<0C5C> <D2A4>\n<0C5D> <D2AC>\n<0C5E> <D2B1>\n<0C61> <D2BC>\n<0C64> <D2C2>\n<0C67> <D2CB>\n<0C68> <D2D4>\n<0C69> <D2D8>\n<0C6A> <D2DC>\n<0C6F> <D2F4>\n<0C70> <D2F8>\n<0C73> <D303>\n<0C74> <D305>\n<0C78> <D310>\n<0C79> <D314>\n<0C7A> <D316>\n<0C80> <D325>\n<0C83> <D32C>\n<0C84> <D330>\n<0C8E> <D380>\n<0C8F> <D384>\n<0C97> <D39C>\n<0C98> <D3A0>\n<0C9B> <D3AB>\n<0C9C> <D3AD>\n<0C9D> <D3B4>\n<0C9E> <D3B8>\n<0C9F> <D3BC>\n<0CA4> <D3D0>\n<0CA5> <D3D8>\n<0CA6> <D3E1>\n<0CA7> <D3E3>\n<0CAA> <D3F0>\n<0CAB> <D3F4>\n<0CAE> <D3FF>\n<0CAF> <D401>\n<0CB0> <D408>\n<0CB1> <D41D>\n<0CB2> <D440>\n<0CB3> <D444>\n<0CB4> <D45C>\n<0CB5> <D460>\n<0CB6> <D464>\n<0CB7> <D46D>\n<0CB8> <D46F>\n<0CBB> <D47C>\n<0CBE> <D482>\n<0CC1> <D48B>\n<0CC2> <D48D>\n<0CC3> <D494>\n<0CC4> <D4A9>\n<0CC5> <D4CC>\n<0CC6> <D4D0>\n<0CC7> <D4D4>\n<0CC8> <D4DC>\n<0CC9> <D4DF>\n<0CCA> <D4E8>\n<0CCB> <D4EC>\n<0CCC> <D4F0>\n<0CCD> <D4F8>\n<0CCE> <D4FB>\n<0CCF> <D4FD>\n<0CD0> <D504>\n<0CD1> <D508>\n<0CD2> <D50C>\n<0CD5> <D517>\n<0CD8> <D540>\n<0CD9> <D544>\n<0CDC> <D54F>\n<0CDD> <D551>\n<0CE0> <D55C>\n<0CE1> <D560>\n<0CE2> <D565>\n<0CE5> <D56B>\n<0CE6> <D56D>\n<0CE9> <D578>\n<0CEA> <D57C>\n<0CF0> <D590>\n<0CF1> <D5A5>\n<0CF4> <D5CC>\nendbfchar\n\n100 beginbfchar\n<0CF5> <D5D0>\n<0CF6> <D5D2>\n<0CF9> <D5DB>\n<0CFA> <D5DD>\n<0CFD> <D5E8>\n<0CFE> <D5EC>\n<0CFF> <D5F4>\n<0D00> <D5F5>\n<0D01> <D5F7>\n<0D02> <D5F9>\n<0D05> <D604>\n<0D06> <D608>\n<0D0C> <D61C>\n<0D0D> <D620>\n<0D0E> <D624>\n<0D0F> <D62D>\n<0D12> <D63C>\n<0D13> <D640>\n<0D14> <D645>\n<0D17> <D64B>\n<0D18> <D64D>\n<0D19> <D651>\n<0D1C> <D658>\n<0D1D> <D65C>\n<0D1E> <D667>\n<0D1F> <D669>\n<0D22> <D674>\n<0D23> <D683>\n<0D24> <D685>\n<0D27> <D690>\n<0D28> <D694>\n<0D29> <D69D>\n<0D2A> <D69F>\n<0D2B> <D6A1>\n<0D2C> <D6A8>\n<0D2D> <D6AC>\n<0D2E> <D6B0>\n<0D2F> <D6B9>\n<0D30> <D6BB>\n<0D33> <D6C8>\n<0D34> <D6CC>\n<0D35> <D6D1>\n<0D36> <D6D4>\n<0D37> <D6D7>\n<0D38> <D6D9>\n<0D39> <D6E0>\n<0D3A> <D6E4>\n<0D3B> <D6E8>\n<0D3C> <D6F0>\n<0D3D> <D6F5>\n<0D40> <D700>\n<0D41> <D704>\n<0D42> <D711>\n<0D45> <D71C>\n<0D46> <D720>\n<0D49> <D72B>\n<0D4A> <D72D>\n<0D4D> <D738>\n<0D4E> <D73C>\n<0D4F> <D744>\n<0D50> <D747>\n<0D51> <D749>\n<0D54> <D754>\n<0D5B> <D763>\n<0D5C> <D765>\n<0D5D> <D769>\n<0D5E> <D76C>\n<0D5F> <D770>\n<0D60> <D774>\n<0D63> <D781>\n<0D66> <D78C>\n<0D67> <D790>\n<0D6A> <D79B>\n<0D6B> <D79D>\n<0D6C> <4F3D>\n<0D6D> <4F73>\n<0D6E> <5047>\n<0D6F> <50F9>\n<0D70> <52A0>\n<0D71> <53EF>\n<0D72> <5475>\n<0D73> <54E5>\n<0D74> <5609>\n<0D75> <5AC1>\n<0D76> <5BB6>\n<0D77> <6687>\n<0D7A> <67EF>\n<0D7B> <6B4C>\n<0D7C> <73C2>\n<0D7D> <75C2>\n<0D7E> <7A3C>\n<0D7F> <82DB>\n<0D80> <8304>\n<0D81> <8857>\n<0D82> <8888>\n<0D83> <8A36>\n<0D84> <8CC8>\n<0D85> <8DCF>\n<0D86> <8EFB>\n<0D87> <8FE6>\nendbfchar\n\n100 beginbfchar\n<0D88> <99D5>\n<0D89> <523B>\n<0D8A> <5374>\n<0D8B> <5404>\n<0D8C> <606A>\n<0D8D> <6164>\n<0D8E> <6BBC>\n<0D8F> <73CF>\n<0D90> <811A>\n<0D91> <89BA>\n<0D92> <89D2>\n<0D93> <95A3>\n<0D94> <4F83>\n<0D95> <520A>\n<0D96> <58BE>\n<0D97> <5978>\n<0D98> <59E6>\n<0D99> <5E72>\n<0D9A> <5E79>\n<0D9B> <61C7>\n<0D9C> <63C0>\n<0D9D> <6746>\n<0D9E> <67EC>\n<0D9F> <687F>\n<0DA0> <6F97>\n<0DA1> <764E>\n<0DA2> <770B>\n<0DA3> <78F5>\n<0DA4> <7A08>\n<0DA5> <7AFF>\n<0DA6> <7C21>\n<0DA7> <809D>\n<0DA8> <826E>\n<0DA9> <8271>\n<0DAA> <8AEB>\n<0DAB> <9593>\n<0DAC> <4E6B>\n<0DAD> <559D>\n<0DAE> <66F7>\n<0DAF> <6E34>\n<0DB0> <78A3>\n<0DB1> <7AED>\n<0DB2> <845B>\n<0DB3> <8910>\n<0DB4> <874E>\n<0DB5> <97A8>\n<0DB6> <52D8>\n<0DB7> <574E>\n<0DB8> <582A>\n<0DB9> <5D4C>\n<0DBA> <611F>\n<0DBB> <61BE>\n<0DBC> <6221>\n<0DBD> <6562>\n<0DBE> <67D1>\n<0DBF> <6A44>\n<0DC0> <6E1B>\n<0DC1> <7518>\n<0DC2> <75B3>\n<0DC3> <76E3>\n<0DC4> <77B0>\n<0DC5> <7D3A>\n<0DC6> <90AF>\n<0DC9> <9F95>\n<0DCA> <5323>\n<0DCB> <5CAC>\n<0DCC> <7532>\n<0DCD> <80DB>\n<0DCE> <9240>\n<0DCF> <9598>\n<0DD0> <525B>\n<0DD1> <5808>\n<0DD2> <59DC>\n<0DD3> <5CA1>\n<0DD4> <5D17>\n<0DD5> <5EB7>\n<0DD6> <5F3A>\n<0DD7> <5F4A>\n<0DD8> <6177>\n<0DD9> <6C5F>\n<0DDA> <757A>\n<0DDB> <7586>\n<0DDC> <7CE0>\n<0DDD> <7D73>\n<0DDE> <7DB1>\n<0DDF> <7F8C>\n<0DE0> <8154>\n<0DE1> <8221>\n<0DE2> <8591>\n<0DE3> <8941>\n<0DE4> <8B1B>\n<0DE5> <92FC>\n<0DE6> <964D>\n<0DE7> <9C47>\n<0DE8> <4ECB>\n<0DE9> <4EF7>\n<0DEA> <500B>\n<0DEB> <51F1>\n<0DEC> <584F>\n<0DED> <6137>\nendbfchar\n\n100 beginbfchar\n<0DEE> <613E>\n<0DEF> <6168>\n<0DF0> <6539>\n<0DF1> <69EA>\n<0DF2> <6F11>\n<0DF3> <75A5>\n<0DF4> <7686>\n<0DF5> <76D6>\n<0DF6> <7B87>\n<0DF7> <82A5>\n<0DF8> <84CB>\n<0DF9> <93A7>\n<0DFA> <958B>\n<0DFB> <5580>\n<0DFC> <5BA2>\n<0DFD> <5751>\n<0DFE> <7CB3>\n<0DFF> <7FB9>\n<0E00> <91B5>\n<0E01> <5028>\n<0E02> <53BB>\n<0E03> <5C45>\n<0E04> <5DE8>\n<0E05> <62D2>\n<0E06> <636E>\n<0E07> <64DA>\n<0E08> <64E7>\n<0E09> <6E20>\n<0E0A> <70AC>\n<0E0B> <795B>\n<0E0C> <8DDD>\n<0E0D> <8E1E>\n<0E0E> <907D>\n<0E0F> <9245>\n<0E10> <92F8>\n<0E11> <4E7E>\n<0E12> <4EF6>\n<0E13> <5065>\n<0E14> <5DFE>\n<0E15> <5EFA>\n<0E16> <6106>\n<0E17> <6957>\n<0E18> <8171>\n<0E19> <8654>\n<0E1A> <8E47>\n<0E1B> <9375>\n<0E1C> <9A2B>\n<0E1D> <4E5E>\n<0E1E> <5091>\n<0E1F> <6770>\n<0E20> <6840>\n<0E21> <5109>\n<0E22> <528D>\n<0E23> <5292>\n<0E24> <6AA2>\n<0E25> <77BC>\n<0E26> <9210>\n<0E27> <9ED4>\n<0E28> <52AB>\n<0E29> <602F>\n<0E2A> <8FF2>\n<0E2B> <5048>\n<0E2C> <61A9>\n<0E2D> <63ED>\n<0E2E> <64CA>\n<0E2F> <683C>\n<0E30> <6A84>\n<0E31> <6FC0>\n<0E32> <8188>\n<0E33> <89A1>\n<0E34> <9694>\n<0E35> <5805>\n<0E36> <727D>\n<0E37> <72AC>\n<0E38> <7504>\n<0E39> <7D79>\n<0E3A> <7E6D>\n<0E3B> <80A9>\n<0E3C> <898B>\n<0E3D> <8B74>\n<0E3E> <9063>\n<0E3F> <9D51>\n<0E40> <6289>\n<0E41> <6C7A>\n<0E42> <6F54>\n<0E43> <7D50>\n<0E44> <7F3A>\n<0E45> <8A23>\n<0E46> <517C>\n<0E47> <614A>\n<0E48> <7B9D>\n<0E49> <8B19>\n<0E4A> <9257>\n<0E4B> <938C>\n<0E4C> <4EAC>\n<0E4D> <4FD3>\n<0E4E> <501E>\n<0E4F> <50BE>\n<0E50> <5106>\n<0E51> <52C1>\nendbfchar\n\n100 beginbfchar\n<0E52> <52CD>\n<0E53> <537F>\n<0E54> <5770>\n<0E55> <5883>\n<0E56> <5E9A>\n<0E57> <5F91>\n<0E58> <6176>\n<0E59> <61AC>\n<0E5A> <64CE>\n<0E5B> <656C>\n<0E5C> <666F>\n<0E5D> <66BB>\n<0E5E> <66F4>\n<0E5F> <6897>\n<0E60> <6D87>\n<0E61> <7085>\n<0E62> <70F1>\n<0E63> <749F>\n<0E64> <74A5>\n<0E65> <74CA>\n<0E66> <75D9>\n<0E67> <786C>\n<0E68> <78EC>\n<0E69> <7ADF>\n<0E6A> <7AF6>\n<0E6B> <7D45>\n<0E6C> <7D93>\n<0E6D> <8015>\n<0E6E> <803F>\n<0E6F> <811B>\n<0E70> <8396>\n<0E71> <8B66>\n<0E72> <8F15>\n<0E73> <9015>\n<0E74> <93E1>\n<0E75> <9803>\n<0E76> <9838>\n<0E77> <9A5A>\n<0E78> <9BE8>\n<0E79> <4FC2>\n<0E7A> <5553>\n<0E7B> <583A>\n<0E7C> <5951>\n<0E7D> <5B63>\n<0E7E> <5C46>\n<0E7F> <60B8>\n<0E80> <6212>\n<0E81> <6842>\n<0E82> <68B0>\n<0E83> <68E8>\n<0E84> <6EAA>\n<0E85> <754C>\n<0E86> <7678>\n<0E87> <78CE>\n<0E88> <7A3D>\n<0E89> <7CFB>\n<0E8A> <7E6B>\n<0E8B> <7E7C>\n<0E8C> <8A08>\n<0E8D> <8AA1>\n<0E8E> <8C3F>\n<0E8F> <968E>\n<0E90> <9DC4>\n<0E91> <53E4>\n<0E92> <53E9>\n<0E93> <544A>\n<0E94> <5471>\n<0E95> <56FA>\n<0E96> <59D1>\n<0E97> <5B64>\n<0E98> <5C3B>\n<0E99> <5EAB>\n<0E9A> <62F7>\n<0E9B> <6537>\n<0E9C> <6545>\n<0E9D> <6572>\n<0E9E> <66A0>\n<0E9F> <67AF>\n<0EA0> <69C1>\n<0EA1> <6CBD>\n<0EA2> <75FC>\n<0EA3> <7690>\n<0EA4> <777E>\n<0EA5> <7A3F>\n<0EA6> <7F94>\n<0EA7> <8003>\n<0EA8> <80A1>\n<0EA9> <818F>\n<0EAA> <82E6>\n<0EAB> <82FD>\n<0EAC> <83F0>\n<0EAD> <85C1>\n<0EAE> <8831>\n<0EAF> <88B4>\n<0EB0> <8AA5>\n<0EB1> <8F9C>\n<0EB2> <932E>\n<0EB3> <96C7>\n<0EB4> <9867>\n<0EB5> <9AD8>\nendbfchar\n\n100 beginbfchar\n<0EB6> <9F13>\n<0EB7> <54ED>\n<0EB8> <659B>\n<0EB9> <66F2>\n<0EBA> <688F>\n<0EBB> <7A40>\n<0EBC> <8C37>\n<0EBD> <9D60>\n<0EBE> <56F0>\n<0EBF> <5764>\n<0EC0> <5D11>\n<0EC1> <6606>\n<0EC2> <68B1>\n<0EC3> <68CD>\n<0EC4> <6EFE>\n<0EC5> <7428>\n<0EC6> <889E>\n<0EC7> <9BE4>\n<0EC8> <6C68>\n<0EC9> <9AA8>\n<0ECA> <4F9B>\n<0ECB> <516C>\n<0ECC> <5171>\n<0ECD> <529F>\n<0ECE> <5B54>\n<0ECF> <5DE5>\n<0ED0> <6050>\n<0ED1> <606D>\n<0ED2> <62F1>\n<0ED3> <63A7>\n<0ED4> <653B>\n<0ED5> <73D9>\n<0ED6> <7A7A>\n<0ED7> <86A3>\n<0ED8> <8CA2>\n<0ED9> <978F>\n<0EDA> <4E32>\n<0EDB> <5BE1>\n<0EDC> <6208>\n<0EDD> <679C>\n<0EDE> <74DC>\n<0EDF> <79D1>\n<0EE0> <83D3>\n<0EE1> <8A87>\n<0EE2> <8AB2>\n<0EE3> <8DE8>\n<0EE4> <904E>\n<0EE5> <934B>\n<0EE6> <9846>\n<0EE7> <5ED3>\n<0EE8> <69E8>\n<0EE9> <85FF>\n<0EEA> <90ED>\n<0EEB> <51A0>\n<0EEC> <5B98>\n<0EED> <5BEC>\n<0EEE> <6163>\n<0EEF> <68FA>\n<0EF0> <6B3E>\n<0EF1> <704C>\n<0EF2> <742F>\n<0EF3> <74D8>\n<0EF4> <7BA1>\n<0EF5> <7F50>\n<0EF6> <83C5>\n<0EF7> <89C0>\n<0EF8> <8CAB>\n<0EF9> <95DC>\n<0EFA> <9928>\n<0EFB> <522E>\n<0EFC> <605D>\n<0EFD> <62EC>\n<0EFE> <9002>\n<0EFF> <4F8A>\n<0F00> <5149>\n<0F01> <5321>\n<0F02> <58D9>\n<0F03> <5EE3>\n<0F04> <66E0>\n<0F05> <6D38>\n<0F06> <709A>\n<0F07> <72C2>\n<0F08> <73D6>\n<0F09> <7B50>\n<0F0A> <80F1>\n<0F0B> <945B>\n<0F0C> <5366>\n<0F0D> <639B>\n<0F0E> <7F6B>\n<0F0F> <4E56>\n<0F10> <5080>\n<0F11> <584A>\n<0F12> <58DE>\n<0F13> <602A>\n<0F14> <6127>\n<0F15> <62D0>\n<0F16> <69D0>\n<0F17> <9B41>\n<0F18> <5B8F>\n<0F19> <7D18>\nendbfchar\n\n100 beginbfchar\n<0F1A> <80B1>\n<0F1B> <8F5F>\n<0F1C> <4EA4>\n<0F1D> <50D1>\n<0F1E> <54AC>\n<0F1F> <55AC>\n<0F20> <5B0C>\n<0F21> <5DA0>\n<0F22> <5DE7>\n<0F23> <652A>\n<0F24> <654E>\n<0F25> <6821>\n<0F26> <6A4B>\n<0F27> <72E1>\n<0F28> <768E>\n<0F29> <77EF>\n<0F2A> <7D5E>\n<0F2B> <7FF9>\n<0F2C> <81A0>\n<0F2D> <854E>\n<0F2E> <86DF>\n<0F2F> <8F03>\n<0F30> <8F4E>\n<0F31> <90CA>\n<0F32> <9903>\n<0F33> <9A55>\n<0F34> <9BAB>\n<0F35> <4E18>\n<0F36> <4E45>\n<0F37> <4E5D>\n<0F38> <4EC7>\n<0F39> <4FF1>\n<0F3A> <5177>\n<0F3B> <52FE>\n<0F3C> <5340>\n<0F3D> <53E3>\n<0F3E> <53E5>\n<0F3F> <548E>\n<0F40> <5614>\n<0F41> <5775>\n<0F42> <57A2>\n<0F43> <5BC7>\n<0F44> <5D87>\n<0F45> <5ED0>\n<0F46> <61FC>\n<0F47> <62D8>\n<0F48> <6551>\n<0F49> <67B8>\n<0F4A> <67E9>\n<0F4B> <69CB>\n<0F4C> <6B50>\n<0F4D> <6BC6>\n<0F4E> <6BEC>\n<0F4F> <6C42>\n<0F50> <6E9D>\n<0F51> <7078>\n<0F52> <72D7>\n<0F53> <7396>\n<0F54> <7403>\n<0F55> <77BF>\n<0F56> <77E9>\n<0F57> <7A76>\n<0F58> <7D7F>\n<0F59> <8009>\n<0F5A> <81FC>\n<0F5B> <8205>\n<0F5C> <820A>\n<0F5D> <82DF>\n<0F5E> <8862>\n<0F5F> <8B33>\n<0F60> <8CFC>\n<0F61> <8EC0>\n<0F62> <9011>\n<0F63> <90B1>\n<0F64> <9264>\n<0F65> <92B6>\n<0F66> <99D2>\n<0F67> <9A45>\n<0F68> <9CE9>\n<0F69> <9DD7>\n<0F6A> <9F9C>\n<0F6B> <570B>\n<0F6C> <5C40>\n<0F6D> <83CA>\n<0F6E> <97A0>\n<0F6F> <97AB>\n<0F70> <9EB4>\n<0F71> <541B>\n<0F72> <7A98>\n<0F73> <7FA4>\n<0F74> <88D9>\n<0F75> <8ECD>\n<0F76> <90E1>\n<0F77> <5800>\n<0F78> <5C48>\n<0F79> <6398>\n<0F7A> <7A9F>\n<0F7B> <5BAE>\n<0F7C> <5F13>\n<0F7D> <7A79>\nendbfchar\n\n100 beginbfchar\n<0F7E> <7AAE>\n<0F7F> <828E>\n<0F80> <8EAC>\n<0F81> <5026>\n<0F82> <5238>\n<0F83> <52F8>\n<0F84> <5377>\n<0F85> <5708>\n<0F86> <62F3>\n<0F87> <6372>\n<0F88> <6B0A>\n<0F89> <6DC3>\n<0F8A> <7737>\n<0F8B> <53A5>\n<0F8C> <7357>\n<0F8D> <8568>\n<0F8E> <8E76>\n<0F8F> <95D5>\n<0F90> <673A>\n<0F91> <6AC3>\n<0F92> <6F70>\n<0F93> <8A6D>\n<0F94> <8ECC>\n<0F95> <994B>\n<0F96> <6677>\n<0F97> <6B78>\n<0F98> <8CB4>\n<0F99> <9B3C>\n<0F9A> <53EB>\n<0F9B> <572D>\n<0F9C> <594E>\n<0F9D> <63C6>\n<0F9E> <69FB>\n<0F9F> <73EA>\n<0FA0> <7845>\n<0FA1> <7ABA>\n<0FA2> <7AC5>\n<0FA3> <7CFE>\n<0FA4> <8475>\n<0FA5> <898F>\n<0FA6> <8D73>\n<0FA7> <9035>\n<0FA8> <95A8>\n<0FA9> <52FB>\n<0FAA> <5747>\n<0FAB> <7547>\n<0FAC> <7B60>\n<0FAD> <83CC>\n<0FAE> <921E>\n<0FAF> <6A58>\n<0FB0> <514B>\n<0FB1> <524B>\n<0FB2> <5287>\n<0FB3> <621F>\n<0FB4> <68D8>\n<0FB5> <6975>\n<0FB6> <9699>\n<0FB7> <50C5>\n<0FB8> <52A4>\n<0FB9> <52E4>\n<0FBA> <61C3>\n<0FBB> <65A4>\n<0FBC> <6839>\n<0FBD> <69FF>\n<0FBE> <747E>\n<0FBF> <7B4B>\n<0FC0> <82B9>\n<0FC1> <83EB>\n<0FC2> <89B2>\n<0FC3> <8B39>\n<0FC4> <8FD1>\n<0FC5> <9949>\n<0FC6> <4ECA>\n<0FC7> <5997>\n<0FC8> <64D2>\n<0FC9> <6611>\n<0FCA> <6A8E>\n<0FCB> <7434>\n<0FCC> <7981>\n<0FCD> <79BD>\n<0FCE> <82A9>\n<0FD1> <895F>\n<0FD2> <9326>\n<0FD3> <4F0B>\n<0FD4> <53CA>\n<0FD5> <6025>\n<0FD6> <6271>\n<0FD7> <6C72>\n<0FD8> <7D1A>\n<0FD9> <7D66>\n<0FDA> <4E98>\n<0FDB> <5162>\n<0FDC> <77DC>\n<0FDD> <80AF>\n<0FDE> <4F01>\n<0FDF> <4F0E>\n<0FE0> <5176>\n<0FE1> <5180>\n<0FE2> <55DC>\n<0FE3> <5668>\nendbfchar\n\n100 beginbfchar\n<0FE4> <573B>\n<0FE5> <57FA>\n<0FE6> <57FC>\n<0FE7> <5914>\n<0FE8> <5947>\n<0FE9> <5993>\n<0FEA> <5BC4>\n<0FEB> <5C90>\n<0FEC> <5D0E>\n<0FED> <5DF1>\n<0FEE> <5E7E>\n<0FEF> <5FCC>\n<0FF0> <6280>\n<0FF1> <65D7>\n<0FF2> <65E3>\n<0FF5> <675E>\n<0FF6> <68CB>\n<0FF7> <68C4>\n<0FF8> <6A5F>\n<0FF9> <6B3A>\n<0FFA> <6C23>\n<0FFB> <6C7D>\n<0FFC> <6C82>\n<0FFD> <6DC7>\n<0FFE> <7398>\n<0FFF> <7426>\n<1000> <742A>\n<1001> <7482>\n<1002> <74A3>\n<1003> <7578>\n<1004> <757F>\n<1005> <7881>\n<1006> <78EF>\n<1007> <7941>\n<100A> <797A>\n<100B> <7B95>\n<100C> <7D00>\n<100D> <7DBA>\n<100E> <7F88>\n<100F> <8006>\n<1010> <802D>\n<1011> <808C>\n<1012> <8A18>\n<1013> <8B4F>\n<1014> <8C48>\n<1015> <8D77>\n<1016> <9321>\n<1017> <9324>\n<1018> <98E2>\n<1019> <9951>\n<101C> <9A65>\n<101D> <9E92>\n<101E> <7DCA>\n<101F> <4F76>\n<1020> <5409>\n<1021> <62EE>\n<1022> <6854>\n<1023> <91D1>\n<1024> <55AB>\n<1025> <513A>\n<1026> <5A1C>\n<1027> <61E6>\n<1028> <62CF>\n<1029> <62FF>\n<102A> <90A3>\n<102B> <8AFE>\n<102C> <6696>\n<102D> <7156>\n<102E> <96E3>\n<102F> <634F>\n<1030> <637A>\n<1031> <5357>\n<1032> <678F>\n<1033> <6960>\n<1034> <6E73>\n<1035> <7537>\n<1036> <7D0D>\n<1037> <8872>\n<1038> <56CA>\n<1039> <5A18>\n<103A> <4E43>\n<103B> <5167>\n<103C> <5948>\n<103D> <67F0>\n<103E> <8010>\n<103F> <5973>\n<1040> <5E74>\n<1041> <649A>\n<1042> <79CA>\n<1043> <5FF5>\n<1044> <606C>\n<1045> <62C8>\n<1046> <637B>\n<1047> <5BE7>\n<1048> <5BD7>\n<1049> <52AA>\n<104A> <5974>\n<104B> <5F29>\n<104C> <6012>\n<104D> <7459>\nendbfchar\n\n100 beginbfchar\n<104E> <99D1>\n<104F> <6FC3>\n<1050> <81BF>\n<1051> <8FB2>\n<1052> <60F1>\n<1053> <8166>\n<1054> <5C3F>\n<1055> <5AE9>\n<1056> <8A25>\n<1057> <677B>\n<1058> <7D10>\n<1059> <80FD>\n<105A> <5C3C>\n<105B> <6CE5>\n<105C> <533F>\n<105D> <6EBA>\n<105E> <591A>\n<105F> <8336>\n<1060> <4E39>\n<1061> <4EB6>\n<1062> <4F46>\n<1063> <55AE>\n<1064> <5718>\n<1065> <58C7>\n<1066> <5F56>\n<1067> <65B7>\n<1068> <65E6>\n<1069> <6A80>\n<106A> <6BB5>\n<106B> <6E4D>\n<106C> <77ED>\n<106D> <7AEF>\n<106E> <7C1E>\n<106F> <7DDE>\n<1070> <86CB>\n<1071> <8892>\n<1072> <9132>\n<1073> <935B>\n<1074> <64BB>\n<1075> <6FBE>\n<1076> <737A>\n<1077> <75B8>\n<1078> <9054>\n<1079> <5556>\n<107A> <574D>\n<107B> <61BA>\n<107C> <64D4>\n<107D> <66C7>\n<107E> <6DE1>\n<107F> <6E5B>\n<1080> <6F6D>\n<1081> <6FB9>\n<1082> <75F0>\n<1083> <8043>\n<1084> <81BD>\n<1085> <8541>\n<1086> <8983>\n<1087> <8AC7>\n<1088> <8B5A>\n<1089> <931F>\n<108A> <6C93>\n<108B> <7553>\n<108C> <7B54>\n<108D> <8E0F>\n<108E> <905D>\n<108F> <5510>\n<1090> <5802>\n<1091> <5858>\n<1092> <5E62>\n<1093> <6207>\n<1094> <649E>\n<1095> <68E0>\n<1096> <7576>\n<1097> <7CD6>\n<1098> <87B3>\n<1099> <9EE8>\n<109A> <4EE3>\n<109B> <5788>\n<109C> <576E>\n<109D> <5927>\n<109E> <5C0D>\n<109F> <5CB1>\n<10A0> <5E36>\n<10A1> <5F85>\n<10A2> <6234>\n<10A3> <64E1>\n<10A4> <73B3>\n<10A5> <81FA>\n<10A6> <888B>\n<10A7> <8CB8>\n<10A8> <968A>\n<10A9> <9EDB>\n<10AA> <5B85>\n<10AB> <5FB7>\n<10AC> <60B3>\n<10AD> <5012>\n<10AE> <5200>\n<10AF> <5230>\n<10B0> <5716>\n<10B1> <5835>\nendbfchar\n\n100 beginbfchar\n<10B2> <5857>\n<10B3> <5C0E>\n<10B4> <5C60>\n<10B5> <5CF6>\n<10B6> <5D8B>\n<10B7> <5EA6>\n<10B8> <5F92>\n<10B9> <60BC>\n<10BA> <6311>\n<10BB> <6389>\n<10BC> <6417>\n<10BD> <6843>\n<10BE> <68F9>\n<10BF> <6AC2>\n<10C0> <6DD8>\n<10C1> <6E21>\n<10C2> <6ED4>\n<10C3> <6FE4>\n<10C4> <71FE>\n<10C5> <76DC>\n<10C6> <7779>\n<10C7> <79B1>\n<10C8> <7A3B>\n<10C9> <8404>\n<10CA> <89A9>\n<10CB> <8CED>\n<10CC> <8DF3>\n<10CD> <8E48>\n<10CE> <9003>\n<10CF> <9014>\n<10D0> <9053>\n<10D1> <90FD>\n<10D2> <934D>\n<10D3> <9676>\n<10D4> <97DC>\n<10D5> <6BD2>\n<10D6> <7006>\n<10D7> <7258>\n<10D8> <72A2>\n<10D9> <7368>\n<10DA> <7763>\n<10DB> <79BF>\n<10DC> <7BE4>\n<10DD> <7E9B>\n<10DE> <8B80>\n<10DF> <58A9>\n<10E0> <60C7>\n<10E1> <6566>\n<10E2> <65FD>\n<10E3> <66BE>\n<10E4> <6C8C>\n<10E5> <711E>\n<10E6> <71C9>\n<10E7> <8C5A>\n<10E8> <9813>\n<10E9> <4E6D>\n<10EA> <7A81>\n<10EB> <4EDD>\n<10EC> <51AC>\n<10ED> <51CD>\n<10EE> <52D5>\n<10EF> <540C>\n<10F0> <61A7>\n<10F1> <6771>\n<10F2> <6850>\n<10F3> <68DF>\n<10F4> <6D1E>\n<10F5> <6F7C>\n<10F6> <75BC>\n<10F7> <77B3>\n<10F8> <7AE5>\n<10F9> <80F4>\n<10FA> <8463>\n<10FB> <9285>\n<10FC> <515C>\n<10FD> <6597>\n<10FE> <675C>\n<10FF> <6793>\n<1100> <75D8>\n<1101> <7AC7>\n<1102> <8373>\n<1103> <8C46>\n<1104> <9017>\n<1105> <982D>\n<1106> <5C6F>\n<1107> <81C0>\n<1108> <829A>\n<1109> <9041>\n<110A> <906F>\n<110B> <920D>\n<110C> <5F97>\n<110D> <5D9D>\n<110E> <6A59>\n<110F> <71C8>\n<1110> <767B>\n<1111> <7B49>\n<1112> <85E4>\n<1113> <8B04>\n<1114> <9127>\n<1115> <9A30>\nendbfchar\n\n100 beginbfchar\n<1116> <5587>\n<1117> <61F6>\n<1118> <7669>\n<1119> <7F85>\n<111A> <863F>\n<111B> <87BA>\n<111C> <88F8>\n<111D> <908F>\n<111E> <6D1B>\n<111F> <70D9>\n<1120> <73DE>\n<1121> <7D61>\n<1122> <843D>\n<1123> <916A>\n<1124> <99F1>\n<1125> <4E82>\n<1126> <5375>\n<1127> <6B04>\n<1128> <6B12>\n<1129> <703E>\n<112A> <721B>\n<112B> <862D>\n<112C> <9E1E>\n<112D> <524C>\n<112E> <8FA3>\n<112F> <5D50>\n<1130> <64E5>\n<1131> <652C>\n<1132> <6B16>\n<1133> <6FEB>\n<1134> <7C43>\n<1135> <7E9C>\n<1136> <85CD>\n<1137> <8964>\n<1138> <89BD>\n<1139> <62C9>\n<113A> <81D8>\n<113B> <881F>\n<113C> <5ECA>\n<113D> <6717>\n<113E> <6D6A>\n<113F> <72FC>\n<1140> <7405>\n<1141> <746F>\n<1142> <8782>\n<1143> <90DE>\n<1144> <4F86>\n<1145> <5D0D>\n<1146> <5FA0>\n<1147> <840A>\n<1148> <51B7>\n<1149> <63A0>\n<114A> <7565>\n<114B> <4EAE>\n<114C> <5006>\n<114D> <5169>\n<114E> <51C9>\n<114F> <6881>\n<1150> <6A11>\n<1151> <7CAE>\n<1152> <7CB1>\n<1153> <7CE7>\n<1154> <826F>\n<1155> <8AD2>\n<1156> <8F1B>\n<1157> <91CF>\n<1158> <4FB6>\n<1159> <5137>\n<115A> <52F5>\n<115B> <5442>\n<115C> <5EEC>\n<115D> <616E>\n<115E> <623E>\n<115F> <65C5>\n<1160> <6ADA>\n<1161> <6FFE>\n<1162> <792A>\n<1163> <85DC>\n<1164> <8823>\n<1165> <95AD>\n<1166> <9A62>\n<1167> <9A6A>\n<1168> <9E97>\n<1169> <9ECE>\n<116A> <529B>\n<116B> <66C6>\n<116C> <6B77>\n<116D> <701D>\n<116E> <792B>\n<116F> <8F62>\n<1170> <9742>\n<1171> <6190>\n<1172> <6200>\n<1173> <6523>\n<1174> <6F23>\n<1175> <7149>\n<1176> <7489>\n<1177> <7DF4>\n<1178> <806F>\n<1179> <84EE>\nendbfchar\n\n100 beginbfchar\n<117A> <8F26>\n<117B> <9023>\n<117C> <934A>\n<117D> <51BD>\n<117E> <5217>\n<117F> <52A3>\n<1180> <6D0C>\n<1181> <70C8>\n<1182> <88C2>\n<1183> <5EC9>\n<1184> <6582>\n<1185> <6BAE>\n<1186> <6FC2>\n<1187> <7C3E>\n<1188> <7375>\n<1189> <4EE4>\n<118A> <4F36>\n<118B> <56F9>\n<118C> <5CBA>\n<118D> <5DBA>\n<118E> <601C>\n<118F> <73B2>\n<1190> <7B2D>\n<1191> <7F9A>\n<1192> <7FCE>\n<1193> <8046>\n<1194> <901E>\n<1195> <9234>\n<1196> <96F6>\n<1197> <9748>\n<1198> <9818>\n<1199> <9F61>\n<119A> <4F8B>\n<119B> <6FA7>\n<119C> <79AE>\n<119D> <91B4>\n<119E> <96B7>\n<119F> <52DE>\n<11A0> <6488>\n<11A1> <64C4>\n<11A2> <6AD3>\n<11A3> <6F5E>\n<11A4> <7018>\n<11A5> <7210>\n<11A6> <76E7>\n<11A7> <8001>\n<11A8> <8606>\n<11A9> <865C>\n<11AA> <8DEF>\n<11AB> <8F05>\n<11AC> <9732>\n<11AD> <9B6F>\n<11AE> <9DFA>\n<11AF> <9E75>\n<11B0> <788C>\n<11B1> <797F>\n<11B2> <7DA0>\n<11B3> <83C9>\n<11B4> <9304>\n<11B5> <9E7F>\n<11B6> <9E93>\n<11B7> <8AD6>\n<11B8> <58DF>\n<11B9> <5F04>\n<11BA> <6727>\n<11BB> <7027>\n<11BC> <74CF>\n<11BD> <7C60>\n<11BE> <807E>\n<11BF> <5121>\n<11C0> <7028>\n<11C1> <7262>\n<11C2> <78CA>\n<11C3> <8CC2>\n<11C4> <8CDA>\n<11C5> <8CF4>\n<11C6> <96F7>\n<11C7> <4E86>\n<11C8> <50DA>\n<11C9> <5BEE>\n<11CA> <5ED6>\n<11CB> <6599>\n<11CC> <71CE>\n<11CD> <7642>\n<11CE> <77AD>\n<11CF> <804A>\n<11D0> <84FC>\n<11D1> <907C>\n<11D2> <9B27>\n<11D3> <9F8D>\n<11D4> <58D8>\n<11D5> <5A41>\n<11D6> <5C62>\n<11D7> <6A13>\n<11D8> <6DDA>\n<11D9> <6F0F>\n<11DA> <763B>\n<11DB> <7D2F>\n<11DC> <7E37>\n<11DD> <851E>\nendbfchar\n\n100 beginbfchar\n<11DE> <8938>\n<11DF> <93E4>\n<11E0> <964B>\n<11E1> <5289>\n<11E2> <65D2>\n<11E3> <67F3>\n<11E4> <69B4>\n<11E5> <6D41>\n<11E6> <6E9C>\n<11E7> <700F>\n<11E8> <7409>\n<11E9> <7460>\n<11EA> <7559>\n<11EB> <7624>\n<11EC> <786B>\n<11ED> <8B2C>\n<11EE> <985E>\n<11EF> <516D>\n<11F0> <622E>\n<11F1> <9678>\n<11F2> <4F96>\n<11F3> <502B>\n<11F4> <5D19>\n<11F5> <6DEA>\n<11F6> <7DB8>\n<11F7> <8F2A>\n<11F8> <5F8B>\n<11F9> <6144>\n<11FA> <6817>\n<11FB> <9686>\n<11FC> <52D2>\n<11FD> <808B>\n<11FE> <51DC>\n<11FF> <51CC>\n<1200> <695E>\n<1201> <7A1C>\n<1202> <7DBE>\n<1203> <83F1>\n<1204> <9675>\n<1205> <4FDA>\n<1206> <5229>\n<1207> <5398>\n<1208> <540F>\n<1209> <550E>\n<120A> <5C65>\n<120B> <60A7>\n<120C> <674E>\n<120D> <68A8>\n<120E> <6D6C>\n<120F> <7281>\n<1210> <72F8>\n<1211> <7406>\n<1212> <7483>\n<1213> <75E2>\n<1214> <7C6C>\n<1215> <7F79>\n<1216> <7FB8>\n<1217> <8389>\n<1218> <88CF>\n<1219> <88E1>\n<121A> <91CC>\n<121B> <91D0>\n<121C> <96E2>\n<121D> <9BC9>\n<121E> <541D>\n<121F> <6F7E>\n<1220> <71D0>\n<1221> <7498>\n<1222> <85FA>\n<1223> <8EAA>\n<1224> <96A3>\n<1225> <9C57>\n<1226> <9E9F>\n<1227> <6797>\n<1228> <6DCB>\n<1229> <7433>\n<122A> <81E8>\n<122B> <9716>\n<122C> <782C>\n<122D> <7ACB>\n<122E> <7B20>\n<122F> <7C92>\n<1230> <6469>\n<1231> <746A>\n<1232> <75F2>\n<1233> <78BC>\n<1234> <78E8>\n<1235> <99AC>\n<1236> <9B54>\n<1237> <9EBB>\n<1238> <5BDE>\n<1239> <5E55>\n<123A> <6F20>\n<123B> <819C>\n<123C> <83AB>\n<123D> <9088>\n<123E> <4E07>\n<123F> <534D>\n<1240> <5A29>\n<1241> <5DD2>\nendbfchar\n\n100 beginbfchar\n<1242> <5F4E>\n<1243> <6162>\n<1244> <633D>\n<1245> <6669>\n<1246> <66FC>\n<1247> <6EFF>\n<1248> <6F2B>\n<1249> <7063>\n<124A> <779E>\n<124B> <842C>\n<124C> <8513>\n<124D> <883B>\n<124E> <8F13>\n<124F> <9945>\n<1250> <9C3B>\n<1251> <551C>\n<1252> <62B9>\n<1253> <672B>\n<1254> <6CAB>\n<1255> <8309>\n<1256> <896A>\n<1257> <977A>\n<1258> <4EA1>\n<1259> <5984>\n<125C> <671B>\n<125D> <7DB2>\n<125E> <7F54>\n<125F> <8292>\n<1260> <832B>\n<1261> <83BD>\n<1262> <8F1E>\n<1263> <9099>\n<1264> <57CB>\n<1265> <59B9>\n<1266> <5A92>\n<1267> <5BD0>\n<1268> <6627>\n<1269> <679A>\n<126A> <6885>\n<126B> <6BCF>\n<126C> <7164>\n<126D> <7F75>\n<126E> <8CB7>\n<126F> <8CE3>\n<1270> <9081>\n<1271> <9B45>\n<1272> <8108>\n<1273> <8C8A>\n<1274> <964C>\n<1275> <9A40>\n<1276> <9EA5>\n<1277> <5B5F>\n<1278> <6C13>\n<1279> <731B>\n<127A> <76F2>\n<127B> <76DF>\n<127C> <840C>\n<127D> <51AA>\n<127E> <8993>\n<127F> <514D>\n<1280> <5195>\n<1281> <52C9>\n<1282> <68C9>\n<1283> <6C94>\n<1284> <7704>\n<1285> <7720>\n<1286> <7DBF>\n<1287> <7DEC>\n<1288> <9762>\n<1289> <9EB5>\n<128A> <6EC5>\n<128B> <8511>\n<128C> <51A5>\n<128D> <540D>\n<128E> <547D>\n<128F> <660E>\n<1290> <669D>\n<1291> <6927>\n<1292> <6E9F>\n<1293> <76BF>\n<1294> <7791>\n<1295> <8317>\n<1296> <84C2>\n<1297> <879F>\n<1298> <9169>\n<1299> <9298>\n<129A> <9CF4>\n<129B> <8882>\n<129C> <4FAE>\n<129D> <5192>\n<129E> <52DF>\n<129F> <59C6>\n<12A0> <5E3D>\n<12A1> <6155>\n<12A4> <66AE>\n<12A5> <67D0>\n<12A6> <6A21>\n<12A7> <6BCD>\n<12A8> <6BDB>\n<12A9> <725F>\nendbfchar\n\n100 beginbfchar\n<12AA> <7261>\n<12AB> <7441>\n<12AC> <7738>\n<12AD> <77DB>\n<12AE> <8017>\n<12AF> <82BC>\n<12B0> <8305>\n<12B1> <8B00>\n<12B2> <8B28>\n<12B3> <8C8C>\n<12B4> <6728>\n<12B5> <6C90>\n<12B6> <7267>\n<12B7> <76EE>\n<12B8> <7766>\n<12B9> <7A46>\n<12BA> <9DA9>\n<12BB> <6B7F>\n<12BC> <6C92>\n<12BD> <5922>\n<12BE> <6726>\n<12BF> <8499>\n<12C0> <536F>\n<12C1> <5893>\n<12C2> <5999>\n<12C3> <5EDF>\n<12C4> <63CF>\n<12C5> <6634>\n<12C6> <6773>\n<12C7> <6E3A>\n<12C8> <732B>\n<12C9> <7AD7>\n<12CA> <82D7>\n<12CB> <9328>\n<12CC> <52D9>\n<12CD> <5DEB>\n<12CE> <61AE>\n<12CF> <61CB>\n<12D0> <620A>\n<12D1> <62C7>\n<12D2> <64AB>\n<12D3> <65E0>\n<12D4> <6959>\n<12D5> <6B66>\n<12D6> <6BCB>\n<12D7> <7121>\n<12D8> <73F7>\n<12D9> <755D>\n<12DA> <7E46>\n<12DB> <821E>\n<12DC> <8302>\n<12DD> <856A>\n<12DE> <8AA3>\n<12DF> <8CBF>\n<12E0> <9727>\n<12E1> <9D61>\n<12E2> <58A8>\n<12E3> <9ED8>\n<12E4> <5011>\n<12E5> <520E>\n<12E6> <543B>\n<12E7> <554F>\n<12E8> <6587>\n<12E9> <6C76>\n<12EC> <805E>\n<12ED> <868A>\n<12EE> <9580>\n<12EF> <96EF>\n<12F0> <52FF>\n<12F1> <6C95>\n<12F2> <7269>\n<12F3> <5473>\n<12F4> <5A9A>\n<12F5> <5C3E>\n<12F6> <5D4B>\n<12F7> <5F4C>\n<12F8> <5FAE>\n<12F9> <672A>\n<12FA> <68B6>\n<12FB> <6963>\n<12FC> <6E3C>\n<12FD> <6E44>\n<12FE> <7709>\n<12FF> <7C73>\n<1300> <7F8E>\n<1301> <8587>\n<1302> <8B0E>\n<1303> <8FF7>\n<1304> <9761>\n<1305> <9EF4>\n<1306> <5CB7>\n<1307> <60B6>\n<1308> <610D>\n<1309> <61AB>\n<130A> <654F>\n<130D> <6C11>\n<130E> <6CEF>\n<130F> <739F>\n<1310> <73C9>\n<1311> <7DE1>\nendbfchar\n\n100 beginbfchar\n<1312> <9594>\n<1313> <5BC6>\n<1314> <871C>\n<1315> <8B10>\n<1316> <525D>\n<1317> <535A>\n<1318> <62CD>\n<1319> <640F>\n<131A> <64B2>\n<131B> <6734>\n<131C> <6A38>\n<131D> <6CCA>\n<131E> <73C0>\n<131F> <749E>\n<1320> <7B94>\n<1321> <7C95>\n<1322> <7E1B>\n<1323> <818A>\n<1324> <8236>\n<1325> <8584>\n<1326> <8FEB>\n<1327> <96F9>\n<1328> <99C1>\n<1329> <4F34>\n<132A> <534A>\n<132B> <53CD>\n<132C> <53DB>\n<132D> <62CC>\n<132E> <642C>\n<132F> <6500>\n<1330> <6591>\n<1331> <69C3>\n<1332> <6CEE>\n<1333> <6F58>\n<1334> <73ED>\n<1335> <7554>\n<1336> <7622>\n<1337> <76E4>\n<1338> <76FC>\n<1339> <78D0>\n<133A> <78FB>\n<133B> <792C>\n<133C> <7D46>\n<133D> <822C>\n<133E> <87E0>\n<133F> <8FD4>\n<1340> <9812>\n<1341> <98EF>\n<1342> <52C3>\n<1343> <62D4>\n<1344> <64A5>\n<1345> <6E24>\n<1346> <6F51>\n<1347> <767C>\n<1348> <8DCB>\n<1349> <91B1>\n<134A> <9262>\n<134B> <9AEE>\n<134C> <9B43>\n<134D> <5023>\n<134E> <508D>\n<134F> <574A>\n<1350> <59A8>\n<1351> <5C28>\n<1352> <5E47>\n<1353> <5F77>\n<1354> <623F>\n<1355> <653E>\n<1356> <65B9>\n<1357> <65C1>\n<1358> <6609>\n<1359> <678B>\n<135A> <699C>\n<135B> <6EC2>\n<135C> <78C5>\n<135D> <7D21>\n<135E> <80AA>\n<135F> <8180>\n<1360> <822B>\n<1361> <82B3>\n<1362> <84A1>\n<1363> <868C>\n<1364> <8A2A>\n<1365> <8B17>\n<1366> <90A6>\n<1367> <9632>\n<1368> <9F90>\n<1369> <500D>\n<136A> <4FF3>\n<136B> <57F9>\n<136C> <5F98>\n<136D> <62DC>\n<136E> <6392>\n<136F> <676F>\n<1370> <6E43>\n<1371> <7119>\n<1372> <76C3>\n<1373> <80CC>\n<1374> <80DA>\n<1377> <8919>\nendbfchar\n\n100 beginbfchar\n<1378> <8CE0>\n<1379> <8F29>\n<137A> <914D>\n<137B> <966A>\n<137C> <4F2F>\n<137D> <4F70>\n<137E> <5E1B>\n<137F> <67CF>\n<1380> <6822>\n<1383> <9B44>\n<1384> <5E61>\n<1385> <6A0A>\n<1386> <7169>\n<1387> <71D4>\n<1388> <756A>\n<1389> <7E41>\n<138A> <8543>\n<138B> <85E9>\n<138C> <98DC>\n<138D> <4F10>\n<138E> <7B4F>\n<138F> <7F70>\n<1390> <95A5>\n<1391> <51E1>\n<1392> <5E06>\n<1393> <68B5>\n<1394> <6C3E>\n<1395> <6C4E>\n<1396> <6CDB>\n<1397> <72AF>\n<1398> <7BC4>\n<1399> <8303>\n<139A> <6CD5>\n<139B> <743A>\n<139C> <50FB>\n<139D> <5288>\n<139E> <58C1>\n<139F> <64D8>\n<13A0> <6A97>\n<13A1> <74A7>\n<13A2> <7656>\n<13A3> <78A7>\n<13A4> <8617>\n<13A5> <95E2>\n<13A6> <9739>\n<13A7> <535E>\n<13A8> <5F01>\n<13A9> <8B8A>\n<13AA> <8FA8>\n<13AB> <8FAF>\n<13AC> <908A>\n<13AD> <5225>\n<13AE> <77A5>\n<13AF> <9C49>\n<13B0> <9F08>\n<13B1> <4E19>\n<13B2> <5002>\n<13B3> <5175>\n<13B4> <5C5B>\n<13B5> <5E77>\n<13B6> <661E>\n<13B7> <663A>\n<13B8> <67C4>\n<13B9> <68C5>\n<13BA> <70B3>\n<13BB> <7501>\n<13BC> <75C5>\n<13BD> <79C9>\n<13BE> <7ADD>\n<13BF> <8F27>\n<13C0> <9920>\n<13C1> <9A08>\n<13C2> <4FDD>\n<13C3> <5821>\n<13C4> <5831>\n<13C5> <5BF6>\n<13C6> <666E>\n<13C7> <6B65>\n<13C8> <6D11>\n<13C9> <6E7A>\n<13CA> <6F7D>\n<13CB> <73E4>\n<13CC> <752B>\n<13CD> <83E9>\n<13CE> <88DC>\n<13CF> <8913>\n<13D0> <8B5C>\n<13D1> <8F14>\n<13D2> <4F0F>\n<13D3> <50D5>\n<13D4> <5310>\n<13D5> <535C>\n<13D6> <5B93>\n<13D7> <5FA9>\n<13D8> <670D>\n<13D9> <798F>\n<13DA> <8179>\n<13DB> <832F>\n<13DC> <8514>\n<13DD> <8907>\nendbfchar\n\n100 beginbfchar\n<13DE> <8986>\n<13DF> <8F39>\n<13E0> <8F3B>\n<13E1> <99A5>\n<13E2> <9C12>\n<13E3> <672C>\n<13E4> <4E76>\n<13E5> <4FF8>\n<13E6> <5949>\n<13E7> <5C01>\n<13EA> <6367>\n<13EB> <68D2>\n<13EC> <70FD>\n<13ED> <71A2>\n<13EE> <742B>\n<13EF> <7E2B>\n<13F0> <84EC>\n<13F1> <8702>\n<13F2> <9022>\n<13F3> <92D2>\n<13F4> <9CF3>\n<13F5> <4E0D>\n<13F6> <4ED8>\n<13F7> <4FEF>\n<13F8> <5085>\n<13F9> <5256>\n<13FA> <526F>\n<13FB> <5426>\n<13FC> <5490>\n<13FD> <57E0>\n<13FE> <592B>\n<13FF> <5A66>\n<1400> <5B5A>\n<1401> <5B75>\n<1402> <5BCC>\n<1403> <5E9C>\n<1404> <6276>\n<1405> <6577>\n<1406> <65A7>\n<1407> <6D6E>\n<1408> <6EA5>\n<1409> <7236>\n<140A> <7B26>\n<140B> <7C3F>\n<140C> <7F36>\n<140F> <819A>\n<1410> <8240>\n<1411> <8299>\n<1412> <83A9>\n<1413> <8A03>\n<1414> <8CA0>\n<1415> <8CE6>\n<1416> <8CFB>\n<1417> <8D74>\n<1418> <8DBA>\n<1419> <90E8>\n<141A> <91DC>\n<141B> <961C>\n<141C> <9644>\n<141D> <99D9>\n<141E> <9CE7>\n<141F> <5317>\n<1420> <5206>\n<1421> <5429>\n<1422> <5674>\n<1423> <58B3>\n<1424> <5954>\n<1425> <596E>\n<1426> <5FFF>\n<1427> <61A4>\n<1428> <626E>\n<1429> <6610>\n<142A> <6C7E>\n<142B> <711A>\n<142C> <76C6>\n<142D> <7C89>\n<142E> <7CDE>\n<142F> <7D1B>\n<1430> <82AC>\n<1431> <8CC1>\n<1432> <96F0>\n<1433> <4F5B>\n<1434> <5F17>\n<1435> <5F7F>\n<1436> <62C2>\n<1437> <5D29>\n<1438> <670B>\n<1439> <68DA>\n<143A> <787C>\n<143B> <7E43>\n<143C> <9D6C>\n<143D> <4E15>\n<143E> <5099>\n<143F> <5315>\n<1440> <532A>\n<1441> <5351>\n<1442> <5983>\n<1443> <5A62>\n<1444> <5E87>\n<1445> <60B2>\nendbfchar\n\n100 beginbfchar\n<1446> <618A>\n<1447> <6249>\n<1448> <6279>\n<1449> <6590>\n<144A> <6787>\n<144B> <69A7>\n<144C> <6BD4>\n<1450> <6CB8>\n<1451> <7435>\n<1452> <75FA>\n<1453> <7812>\n<1454> <7891>\n<1455> <79D5>\n<1456> <79D8>\n<1457> <7C83>\n<1458> <7DCB>\n<1459> <7FE1>\n<145A> <80A5>\n<145B> <813E>\n<145C> <81C2>\n<145D> <83F2>\n<145E> <871A>\n<145F> <88E8>\n<1460> <8AB9>\n<1461> <8B6C>\n<1462> <8CBB>\n<1463> <9119>\n<1464> <975E>\n<1465> <98DB>\n<1466> <9F3B>\n<1467> <56AC>\n<1468> <5B2A>\n<1469> <5F6C>\n<146A> <658C>\n<146B> <6AB3>\n<146C> <6BAF>\n<146D> <6D5C>\n<146E> <6FF1>\n<146F> <7015>\n<1470> <725D>\n<1471> <73AD>\n<1472> <8CA7>\n<1473> <8CD3>\n<1474> <983B>\n<1475> <6191>\n<1476> <6C37>\n<1477> <8058>\n<1478> <9A01>\n<1479> <4E4D>\n<147A> <4E8B>\n<147B> <4E9B>\n<147C> <4ED5>\n<147D> <4F3A>\n<147E> <4F3C>\n<147F> <4F7F>\n<1480> <4FDF>\n<1481> <50FF>\n<1482> <53F2>\n<1483> <53F8>\n<1484> <5506>\n<1485> <55E3>\n<1486> <56DB>\n<1487> <58EB>\n<1488> <5962>\n<1489> <5A11>\n<148A> <5BEB>\n<148B> <5BFA>\n<148C> <5C04>\n<148D> <5DF3>\n<148E> <5E2B>\n<148F> <5F99>\n<1490> <601D>\n<1491> <6368>\n<1492> <659C>\n<1493> <65AF>\n<1494> <67F6>\n<1495> <67FB>\n<1496> <68AD>\n<1497> <6B7B>\n<1498> <6C99>\n<1499> <6CD7>\n<149A> <6E23>\n<149B> <7009>\n<149C> <7345>\n<149D> <7802>\n<149E> <793E>\n<149F> <7940>\n<14A0> <7960>\n<14A1> <79C1>\n<14A2> <7BE9>\n<14A3> <7D17>\n<14A4> <7D72>\n<14A5> <8086>\n<14A6> <820D>\n<14A7> <838E>\n<14A8> <84D1>\n<14A9> <86C7>\n<14AA> <88DF>\n<14AB> <8A50>\n<14AC> <8A5E>\nendbfchar\n\n100 beginbfchar\n<14AD> <8B1D>\n<14AE> <8CDC>\n<14AF> <8D66>\n<14B0> <8FAD>\n<14B1> <90AA>\n<14B2> <98FC>\n<14B3> <99DF>\n<14B4> <9E9D>\n<14B5> <524A>\n<14B6> <6714>\n<14B7> <5098>\n<14B8> <522A>\n<14B9> <5C71>\n<14BA> <6563>\n<14BB> <6C55>\n<14BC> <73CA>\n<14BD> <7523>\n<14BE> <759D>\n<14BF> <7B97>\n<14C0> <849C>\n<14C1> <9178>\n<14C2> <9730>\n<14C3> <4E77>\n<14C4> <6492>\n<14C5> <6BBA>\n<14C6> <715E>\n<14C7> <85A9>\n<14C8> <4E09>\n<14C9> <6749>\n<14CA> <68EE>\n<14CB> <6E17>\n<14CC> <829F>\n<14CD> <8518>\n<14CE> <886B>\n<14CF> <63F7>\n<14D0> <6F81>\n<14D1> <9212>\n<14D2> <98AF>\n<14D3> <4E0A>\n<14D4> <50B7>\n<14D5> <50CF>\n<14D6> <511F>\n<14D7> <5546>\n<14D8> <55AA>\n<14D9> <5617>\n<14DA> <5B40>\n<14DB> <5C19>\n<14DC> <5CE0>\n<14DD> <5E38>\n<14DE> <5E8A>\n<14DF> <5EA0>\n<14E0> <5EC2>\n<14E1> <60F3>\n<14E2> <6851>\n<14E3> <6A61>\n<14E4> <6E58>\n<14E5> <723D>\n<14E6> <7240>\n<14E7> <72C0>\n<14E8> <76F8>\n<14E9> <7965>\n<14EA> <7BB1>\n<14EB> <7FD4>\n<14EC> <88F3>\n<14ED> <89F4>\n<14EE> <8A73>\n<14EF> <8C61>\n<14F0> <8CDE>\n<14F1> <971C>\n<14F2> <585E>\n<14F3> <74BD>\n<14F4> <8CFD>\n<14F5> <55C7>\n<14F6> <7A61>\n<14F7> <7D22>\n<14F8> <8272>\n<14F9> <7272>\n<14FA> <751F>\n<14FB> <7525>\n<14FC> <7B19>\n<14FD> <5885>\n<14FE> <58FB>\n<14FF> <5DBC>\n<1500> <5E8F>\n<1501> <5EB6>\n<1502> <5F90>\n<1503> <6055>\n<1504> <6292>\n<1505> <637F>\n<1506> <654D>\n<1507> <6691>\n<1508> <66D9>\n<1509> <66F8>\n<150A> <6816>\n<150B> <68F2>\n<150C> <7280>\n<150D> <745E>\n<150E> <7B6E>\n<150F> <7D6E>\n<1510> <7DD6>\nendbfchar\n\n100 beginbfchar\n<1511> <7F72>\n<1512> <80E5>\n<1513> <8212>\n<1514> <85AF>\n<1515> <897F>\n<1516> <8A93>\n<1517> <901D>\n<1518> <92E4>\n<1519> <9ECD>\n<151A> <9F20>\n<151B> <5915>\n<151C> <596D>\n<151D> <5E2D>\n<151E> <60DC>\n<151F> <6614>\n<1520> <6673>\n<1521> <6790>\n<1522> <6C50>\n<1523> <6DC5>\n<1524> <6F5F>\n<1525> <77F3>\n<1526> <78A9>\n<1527> <84C6>\n<1528> <91CB>\n<1529> <932B>\n<152A> <4ED9>\n<152B> <50CA>\n<152C> <5148>\n<152D> <5584>\n<152E> <5B0B>\n<152F> <5BA3>\n<1530> <6247>\n<1531> <657E>\n<1532> <65CB>\n<1533> <6E32>\n<1534> <717D>\n<1535> <7401>\n<1536> <7444>\n<1537> <7487>\n<1538> <74BF>\n<1539> <766C>\n<153A> <79AA>\n<153B> <7DDA>\n<153C> <7E55>\n<153D> <7FA8>\n<153E> <817A>\n<153F> <81B3>\n<1540> <8239>\n<1541> <861A>\n<1542> <87EC>\n<1543> <8A75>\n<1544> <8DE3>\n<1545> <9078>\n<1546> <9291>\n<1547> <9425>\n<1548> <994D>\n<1549> <9BAE>\n<154A> <5368>\n<154B> <5C51>\n<154C> <6954>\n<154D> <6CC4>\n<154E> <6D29>\n<154F> <6E2B>\n<1550> <820C>\n<1551> <859B>\n<1552> <893B>\n<1553> <8A2D>\n<1554> <8AAA>\n<1555> <96EA>\n<1556> <9F67>\n<1557> <5261>\n<1558> <66B9>\n<1559> <6BB2>\n<155A> <7E96>\n<155B> <87FE>\n<155C> <8D0D>\n<155D> <9583>\n<155E> <965D>\n<155F> <651D>\n<1560> <6D89>\n<1561> <71EE>\n<1562> <57CE>\n<1563> <59D3>\n<1564> <5BAC>\n<1565> <6027>\n<1566> <60FA>\n<1567> <6210>\n<1568> <661F>\n<1569> <665F>\n<156A> <7329>\n<156B> <73F9>\n<156C> <76DB>\n<156D> <7701>\n<156E> <7B6C>\n<156F> <8056>\n<1570> <8072>\n<1571> <8165>\n<1572> <8AA0>\n<1573> <9192>\n<1574> <4E16>\nendbfchar\n\n100 beginbfchar\n<1575> <52E2>\n<1576> <6B72>\n<1577> <6D17>\n<1578> <7A05>\n<1579> <7B39>\n<157A> <7D30>\n<157B> <8CB0>\n<157C> <53EC>\n<157D> <562F>\n<157E> <5851>\n<157F> <5BB5>\n<1580> <5C0F>\n<1581> <5C11>\n<1582> <5DE2>\n<1583> <6240>\n<1584> <6383>\n<1585> <6414>\n<1586> <662D>\n<1587> <68B3>\n<1588> <6CBC>\n<1589> <6D88>\n<158A> <6EAF>\n<158B> <701F>\n<158C> <70A4>\n<158D> <71D2>\n<158E> <7526>\n<158F> <758F>\n<1590> <758E>\n<1591> <7619>\n<1592> <7B11>\n<1593> <7BE0>\n<1594> <7C2B>\n<1595> <7D20>\n<1596> <7D39>\n<1597> <852C>\n<1598> <856D>\n<1599> <8607>\n<159A> <8A34>\n<159B> <900D>\n<159C> <9061>\n<159D> <90B5>\n<159E> <92B7>\n<159F> <97F6>\n<15A0> <9A37>\n<15A1> <4FD7>\n<15A2> <5C6C>\n<15A3> <675F>\n<15A4> <6D91>\n<15A5> <7C9F>\n<15A6> <7E8C>\n<15A7> <8B16>\n<15A8> <8D16>\n<15A9> <901F>\n<15AA> <5B6B>\n<15AB> <5DFD>\n<15AC> <640D>\n<15AD> <84C0>\n<15AE> <905C>\n<15AF> <98E1>\n<15B0> <7387>\n<15B1> <5B8B>\n<15B2> <609A>\n<15B3> <677E>\n<15B4> <6DDE>\n<15B5> <8A1F>\n<15B6> <8AA6>\n<15B7> <9001>\n<15B8> <980C>\n<15B9> <5237>\n<15BA> <7051>\n<15BB> <788E>\n<15BC> <9396>\n<15BD> <8870>\n<15BE> <91D7>\n<15BF> <4FEE>\n<15C0> <53D7>\n<15C1> <55FD>\n<15C2> <56DA>\n<15C3> <5782>\n<15C4> <58FD>\n<15C5> <5AC2>\n<15C6> <5B88>\n<15C7> <5CAB>\n<15C8> <5CC0>\n<15C9> <5E25>\n<15CA> <6101>\n<15CB> <620D>\n<15CC> <624B>\n<15CD> <6388>\n<15CE> <641C>\n<15CF> <6536>\n<15D0> <6578>\n<15D1> <6A39>\n<15D2> <6B8A>\n<15D3> <6C34>\n<15D4> <6D19>\n<15D5> <6F31>\n<15D6> <71E7>\n<15D7> <72E9>\n<15D8> <7378>\nendbfchar\n\n100 beginbfchar\n<15D9> <7407>\n<15DA> <74B2>\n<15DB> <7626>\n<15DC> <7761>\n<15DD> <79C0>\n<15DE> <7A57>\n<15DF> <7AEA>\n<15E0> <7CB9>\n<15E1> <7D8F>\n<15E2> <7DAC>\n<15E3> <7E61>\n<15E4> <7F9E>\n<15E5> <8129>\n<15E6> <8331>\n<15E7> <8490>\n<15E8> <84DA>\n<15E9> <85EA>\n<15EA> <8896>\n<15EB> <8AB0>\n<15EC> <8B90>\n<15ED> <8F38>\n<15EE> <9042>\n<15EF> <9083>\n<15F0> <916C>\n<15F1> <9296>\n<15F2> <92B9>\n<15F3> <968B>\n<15F6> <96D6>\n<15F7> <9700>\n<15F8> <9808>\n<15F9> <9996>\n<15FA> <9AD3>\n<15FB> <9B1A>\n<15FC> <53D4>\n<15FD> <587E>\n<15FE> <5919>\n<15FF> <5B70>\n<1600> <5BBF>\n<1601> <6DD1>\n<1602> <6F5A>\n<1603> <719F>\n<1604> <7421>\n<1605> <74B9>\n<1606> <8085>\n<1607> <83FD>\n<1608> <5DE1>\n<1609> <5F87>\n<160A> <5FAA>\n<160B> <6042>\n<160C> <65EC>\n<160D> <6812>\n<160E> <696F>\n<160F> <6A53>\n<1610> <6B89>\n<1611> <6D35>\n<1612> <6DF3>\n<1613> <73E3>\n<1614> <76FE>\n<1615> <77AC>\n<1616> <7B4D>\n<1617> <7D14>\n<1618> <8123>\n<1619> <821C>\n<161A> <8340>\n<161B> <84F4>\n<161C> <8563>\n<161D> <8A62>\n<161E> <8AC4>\n<161F> <9187>\n<1620> <931E>\n<1621> <9806>\n<1622> <99B4>\n<1623> <620C>\n<1624> <8853>\n<1625> <8FF0>\n<1626> <9265>\n<1627> <5D07>\n<1628> <5D27>\n<1629> <5D69>\n<162A> <745F>\n<162B> <819D>\n<162C> <8768>\n<162D> <6FD5>\n<162E> <62FE>\n<162F> <7FD2>\n<1630> <8936>\n<1631> <8972>\n<1632> <4E1E>\n<1633> <4E58>\n<1634> <50E7>\n<1635> <52DD>\n<1636> <5347>\n<1637> <627F>\n<1638> <6607>\n<1639> <7E69>\n<163A> <8805>\n<163B> <965E>\n<163C> <4F8D>\n<163D> <5319>\n<163E> <5636>\nendbfchar\n\n100 beginbfchar\n<163F> <59CB>\n<1640> <5AA4>\n<1641> <5C38>\n<1642> <5C4E>\n<1643> <5C4D>\n<1644> <5E02>\n<1645> <5F11>\n<1646> <6043>\n<1647> <65BD>\n<1648> <662F>\n<1649> <6642>\n<164A> <67BE>\n<164B> <67F4>\n<164C> <731C>\n<164D> <77E2>\n<164E> <793A>\n<164F> <7FC5>\n<1650> <8494>\n<1651> <84CD>\n<1652> <8996>\n<1653> <8A66>\n<1654> <8A69>\n<1655> <8AE1>\n<1656> <8C55>\n<1657> <8C7A>\n<1658> <57F4>\n<1659> <5BD4>\n<165A> <5F0F>\n<165B> <606F>\n<165C> <62ED>\n<165D> <690D>\n<165E> <6B96>\n<165F> <6E5C>\n<1660> <7184>\n<1661> <7BD2>\n<1662> <8755>\n<1663> <8B58>\n<1664> <8EFE>\n<1665> <98DF>\n<1666> <98FE>\n<1667> <4F38>\n<1668> <4F81>\n<1669> <4FE1>\n<166A> <547B>\n<166B> <5A20>\n<166C> <5BB8>\n<166D> <613C>\n<166E> <65B0>\n<166F> <6668>\n<1670> <71FC>\n<1671> <7533>\n<1672> <795E>\n<1673> <7D33>\n<1674> <814E>\n<1675> <81E3>\n<1676> <8398>\n<1677> <85AA>\n<1678> <85CE>\n<1679> <8703>\n<167A> <8A0A>\n<167B> <8EAB>\n<167C> <8F9B>\n<167D> <8FC5>\n<167E> <5931>\n<167F> <5BA4>\n<1680> <5BE6>\n<1681> <6089>\n<1682> <5BE9>\n<1683> <5C0B>\n<1684> <5FC3>\n<1685> <6C81>\n<1686> <6DF1>\n<1687> <700B>\n<1688> <751A>\n<1689> <82AF>\n<168A> <8AF6>\n<168B> <4EC0>\n<168C> <5341>\n<168D> <96D9>\n<168E> <6C0F>\n<168F> <4E9E>\n<1690> <4FC4>\n<1691> <5152>\n<1692> <555E>\n<1693> <5A25>\n<1694> <5CE8>\n<1695> <6211>\n<1696> <7259>\n<1697> <82BD>\n<1698> <83AA>\n<1699> <86FE>\n<169A> <8859>\n<169B> <8A1D>\n<169C> <963F>\n<169D> <96C5>\n<169E> <9913>\n<169F> <9D09>\n<16A0> <9D5D>\n<16A1> <580A>\n<16A2> <5CB3>\nendbfchar\n\n100 beginbfchar\n<16A3> <5DBD>\n<16A4> <5E44>\n<16A5> <60E1>\n<16A6> <6115>\n<16A7> <63E1>\n<16A8> <6A02>\n<16A9> <6E25>\n<16AA> <9102>\n<16AB> <9354>\n<16AC> <984E>\n<16AD> <9C10>\n<16AE> <9F77>\n<16AF> <5B89>\n<16B0> <5CB8>\n<16B1> <6309>\n<16B2> <664F>\n<16B3> <6848>\n<16B4> <773C>\n<16B5> <96C1>\n<16B6> <978D>\n<16B7> <9854>\n<16B8> <9B9F>\n<16B9> <65A1>\n<16BA> <8B01>\n<16BB> <8ECB>\n<16BC> <95BC>\n<16BD> <5535>\n<16BE> <5CA9>\n<16BF> <5DD6>\n<16C0> <5EB5>\n<16C1> <6697>\n<16C2> <764C>\n<16C3> <83F4>\n<16C4> <95C7>\n<16C5> <58D3>\n<16C6> <62BC>\n<16C7> <72CE>\n<16C8> <9D28>\n<16C9> <4EF0>\n<16CA> <592E>\n<16CB> <600F>\n<16CC> <663B>\n<16CD> <6B83>\n<16CE> <79E7>\n<16CF> <9D26>\n<16D0> <5393>\n<16D1> <54C0>\n<16D2> <57C3>\n<16D3> <5D16>\n<16D4> <611B>\n<16D5> <66D6>\n<16D6> <6DAF>\n<16D7> <788D>\n<16D8> <827E>\n<16D9> <9698>\n<16DA> <9744>\n<16DB> <5384>\n<16DC> <627C>\n<16DD> <6396>\n<16DE> <6DB2>\n<16DF> <7E0A>\n<16E0> <814B>\n<16E1> <984D>\n<16E2> <6AFB>\n<16E3> <7F4C>\n<16E4> <9DAF>\n<16E5> <9E1A>\n<16E6> <4E5F>\n<16E7> <503B>\n<16E8> <51B6>\n<16E9> <591C>\n<16EA> <60F9>\n<16EB> <63F6>\n<16EC> <6930>\n<16ED> <723A>\n<16EE> <8036>\n<16EF> <91CE>\n<16F0> <5F31>\n<16F1> <7D04>\n<16F2> <82E5>\n<16F3> <846F>\n<16F4> <84BB>\n<16F5> <85E5>\n<16F6> <8E8D>\n<16F7> <4F6F>\n<16F8> <58E4>\n<16F9> <5B43>\n<16FA> <6059>\n<16FB> <63DA>\n<16FC> <6518>\n<16FD> <656D>\n<16FE> <6698>\n<16FF> <694A>\n<1700> <6A23>\n<1701> <6D0B>\n<1702> <7001>\n<1703> <716C>\n<1704> <75D2>\n<1705> <760D>\n<1706> <79B3>\nendbfchar\n\n100 beginbfchar\n<1707> <7A70>\n<1708> <7F8A>\n<1709> <8944>\n<170A> <8B93>\n<170B> <91C0>\n<170C> <967D>\n<170D> <990A>\n<170E> <5704>\n<170F> <5FA1>\n<1710> <65BC>\n<1711> <6F01>\n<1712> <7600>\n<1713> <79A6>\n<1714> <8A9E>\n<1715> <99AD>\n<1716> <9B5A>\n<1717> <9F6C>\n<1718> <5104>\n<1719> <61B6>\n<171A> <6291>\n<171B> <6A8D>\n<171C> <81C6>\n<171D> <5043>\n<171E> <5830>\n<171F> <5F66>\n<1720> <7109>\n<1721> <8A00>\n<1722> <8AFA>\n<1723> <5B7C>\n<1724> <8616>\n<1725> <4FFA>\n<1726> <513C>\n<1727> <56B4>\n<1728> <5944>\n<1729> <63A9>\n<172A> <6DF9>\n<172B> <5DAA>\n<172C> <696D>\n<172D> <5186>\n<172E> <4E88>\n<172F> <4F59>\n<1730> <5982>\n<1731> <6B5F>\n<1732> <6C5D>\n<1733> <74B5>\n<1734> <7916>\n<1735> <8207>\n<1736> <8245>\n<1737> <8339>\n<1738> <8F3F>\n<1739> <8F5D>\n<173A> <9918>\n<173B> <4EA6>\n<173C> <57DF>\n<173D> <5F79>\n<173E> <6613>\n<173F> <75AB>\n<1740> <7E79>\n<1741> <8B6F>\n<1742> <9006>\n<1743> <9A5B>\n<1744> <56A5>\n<1745> <5827>\n<1746> <59F8>\n<1747> <5A1F>\n<1748> <5BB4>\n<1749> <5EF6>\n<174A> <6350>\n<174B> <633B>\n<174C> <693D>\n<174D> <6C87>\n<174E> <6CBF>\n<174F> <6D8E>\n<1750> <6D93>\n<1751> <6DF5>\n<1752> <6F14>\n<1753> <70DF>\n<1754> <7136>\n<1755> <7159>\n<1756> <71C3>\n<1757> <71D5>\n<1758> <784F>\n<1759> <786F>\n<175A> <7B75>\n<175B> <7DE3>\n<175C> <7E2F>\n<175D> <884D>\n<175E> <8EDF>\n<175F> <925B>\n<1760> <9CF6>\n<1761> <6085>\n<1762> <6D85>\n<1763> <71B1>\n<1764> <95B1>\n<1765> <53AD>\n<1766> <67D3>\n<1767> <708E>\n<1768> <7130>\n<1769> <7430>\n<176A> <8276>\nendbfchar\n\n100 beginbfchar\n<176B> <82D2>\n<176C> <95BB>\n<176D> <9AE5>\n<176E> <9E7D>\n<176F> <66C4>\n<1770> <71C1>\n<1771> <8449>\n<1772> <584B>\n<1773> <5DB8>\n<1774> <5F71>\n<1775> <6620>\n<1776> <668E>\n<1777> <6979>\n<1778> <69AE>\n<1779> <6C38>\n<177A> <6CF3>\n<177B> <6E36>\n<177C> <6F41>\n<177D> <6FDA>\n<177E> <701B>\n<177F> <702F>\n<1780> <7150>\n<1781> <71DF>\n<1782> <7370>\n<1783> <745B>\n<1784> <74D4>\n<1785> <76C8>\n<1786> <7A4E>\n<1787> <7E93>\n<1788> <82F1>\n<1789> <8A60>\n<178A> <8FCE>\n<178B> <9348>\n<178C> <9719>\n<178D> <4E42>\n<178E> <502A>\n<178F> <5208>\n<1790> <53E1>\n<1791> <66F3>\n<1792> <6C6D>\n<1793> <6FCA>\n<1794> <730A>\n<1795> <777F>\n<1796> <7A62>\n<1797> <82AE>\n<1798> <85DD>\n<1799> <8602>\n<179A> <88D4>\n<179B> <8A63>\n<179C> <8B7D>\n<179D> <8C6B>\n<179E> <92B3>\n<179F> <9713>\n<17A0> <9810>\n<17A1> <4E94>\n<17A2> <4F0D>\n<17A3> <4FC9>\n<17A4> <50B2>\n<17A5> <5348>\n<17A6> <543E>\n<17A7> <5433>\n<17A8> <55DA>\n<17A9> <5862>\n<17AA> <58BA>\n<17AB> <5967>\n<17AC> <5A1B>\n<17AD> <5BE4>\n<17AE> <609F>\n<17AF> <61CA>\n<17B0> <6556>\n<17B1> <65FF>\n<17B2> <6664>\n<17B3> <68A7>\n<17B4> <6C5A>\n<17B5> <6FB3>\n<17B6> <70CF>\n<17B7> <71AC>\n<17B8> <7352>\n<17B9> <7B7D>\n<17BA> <8708>\n<17BB> <8AA4>\n<17BC> <9C32>\n<17BD> <9F07>\n<17BE> <5C4B>\n<17BF> <6C83>\n<17C0> <7344>\n<17C1> <7389>\n<17C2> <923A>\n<17C3> <6EAB>\n<17C4> <7465>\n<17C5> <761F>\n<17C6> <7A69>\n<17C7> <7E15>\n<17C8> <860A>\n<17C9> <5140>\n<17CA> <58C5>\n<17CB> <64C1>\n<17CC> <74EE>\n<17CD> <7515>\n<17CE> <7670>\nendbfchar\n\n100 beginbfchar\n<17CF> <7FC1>\n<17D0> <9095>\n<17D1> <96CD>\n<17D2> <9954>\n<17D3> <6E26>\n<17D4> <74E6>\n<17D7> <81E5>\n<17D8> <86D9>\n<17D9> <8778>\n<17DA> <8A1B>\n<17DB> <5A49>\n<17DC> <5B8C>\n<17DD> <5B9B>\n<17DE> <68A1>\n<17DF> <6900>\n<17E0> <6D63>\n<17E1> <73A9>\n<17E2> <7413>\n<17E3> <742C>\n<17E4> <7897>\n<17E5> <7DE9>\n<17E6> <7FEB>\n<17E7> <8118>\n<17E8> <8155>\n<17E9> <839E>\n<17EA> <8C4C>\n<17EB> <962E>\n<17EC> <9811>\n<17ED> <66F0>\n<17EE> <5F80>\n<17EF> <65FA>\n<17F0> <6789>\n<17F1> <6C6A>\n<17F2> <738B>\n<17F3> <502D>\n<17F4> <5A03>\n<17F5> <6B6A>\n<17F6> <77EE>\n<17F7> <5916>\n<17F8> <5D6C>\n<17F9> <5DCD>\n<17FA> <7325>\n<17FB> <754F>\n<17FC> <50E5>\n<17FD> <51F9>\n<17FE> <582F>\n<17FF> <592D>\n<1800> <5996>\n<1801> <59DA>\n<1802> <5BE5>\n<1803> <5DA2>\n<1804> <62D7>\n<1805> <6416>\n<1806> <6493>\n<1807> <64FE>\n<1808> <66DC>\n<1809> <6A48>\n<180A> <71FF>\n<180B> <7464>\n<180C> <7A88>\n<180D> <7AAF>\n<180E> <7E47>\n<180F> <7E5E>\n<1810> <8000>\n<1811> <8170>\n<1812> <87EF>\n<1813> <8981>\n<1814> <8B20>\n<1815> <9059>\n<1816> <9080>\n<1817> <9952>\n<1818> <617E>\n<1819> <6B32>\n<181A> <6D74>\n<181B> <7E1F>\n<181C> <8925>\n<181D> <8FB1>\n<181E> <4FD1>\n<181F> <50AD>\n<1820> <5197>\n<1821> <52C7>\n<1822> <57C7>\n<1823> <5889>\n<1824> <5BB9>\n<1825> <5EB8>\n<1826> <6142>\n<1827> <6995>\n<1828> <6D8C>\n<1829> <6E67>\n<182A> <6EB6>\n<182B> <7194>\n<182C> <7462>\n<182D> <7528>\n<182E> <752C>\n<182F> <8073>\n<1830> <8338>\n<1831> <84C9>\n<1832> <8E0A>\n<1833> <9394>\n<1834> <93DE>\nendbfchar\n\n100 beginbfchar\n<1835> <4E8E>\n<1836> <4F51>\n<1837> <5076>\n<1838> <512A>\n<1839> <53C8>\n<183A> <53CB>\n<183B> <53F3>\n<183C> <5B87>\n<183D> <5BD3>\n<183E> <5C24>\n<183F> <611A>\n<1840> <6182>\n<1841> <65F4>\n<1842> <725B>\n<1843> <7397>\n<1844> <7440>\n<1845> <76C2>\n<1846> <7950>\n<1847> <7991>\n<1848> <79B9>\n<1849> <7D06>\n<184A> <7FBD>\n<184B> <828B>\n<184C> <85D5>\n<184D> <865E>\n<184E> <8FC2>\n<184F> <9047>\n<1850> <90F5>\n<1851> <91EA>\n<1852> <9685>\n<1855> <52D6>\n<1856> <5F67>\n<1857> <65ED>\n<1858> <6631>\n<1859> <682F>\n<185A> <715C>\n<185B> <7A36>\n<185C> <90C1>\n<185D> <980A>\n<185E> <4E91>\n<185F> <6A52>\n<1860> <6B9E>\n<1861> <6F90>\n<1862> <7189>\n<1863> <8018>\n<1864> <82B8>\n<1865> <8553>\n<1866> <904B>\n<1867> <9695>\n<1868> <96F2>\n<1869> <97FB>\n<186A> <851A>\n<186B> <9B31>\n<186C> <4E90>\n<186D> <718A>\n<186E> <96C4>\n<186F> <5143>\n<1870> <539F>\n<1871> <54E1>\n<1872> <5713>\n<1873> <5712>\n<1874> <57A3>\n<1875> <5A9B>\n<1876> <5AC4>\n<1877> <5BC3>\n<1878> <6028>\n<1879> <613F>\n<187A> <63F4>\n<187B> <6C85>\n<187C> <6D39>\n<187D> <6E72>\n<187E> <6E90>\n<187F> <7230>\n<1880> <733F>\n<1881> <7457>\n<1882> <82D1>\n<1883> <8881>\n<1884> <8F45>\n<1885> <9060>\n<1886> <9662>\n<1887> <9858>\n<1888> <9D1B>\n<1889> <6708>\n<188A> <8D8A>\n<188B> <925E>\n<188C> <4F4D>\n<188D> <5049>\n<188E> <50DE>\n<188F> <5371>\n<1890> <570D>\n<1891> <59D4>\n<1892> <5A01>\n<1893> <5C09>\n<1894> <6170>\n<1895> <6690>\n<1896> <6E2D>\n<1897> <7232>\n<1898> <744B>\n<1899> <7DEF>\n<189A> <80C3>\nendbfchar\n\n100 beginbfchar\n<189B> <840E>\n<189C> <8466>\n<189D> <853F>\n<189E> <875F>\n<189F> <885B>\n<18A0> <8918>\n<18A1> <8B02>\n<18A2> <9055>\n<18A3> <97CB>\n<18A4> <9B4F>\n<18A5> <4E73>\n<18A6> <4F91>\n<18A7> <5112>\n<18A8> <516A>\n<18A9> <552F>\n<18AA> <55A9>\n<18AB> <5B7A>\n<18AC> <5BA5>\n<18AF> <5EBE>\n<18B0> <60A0>\n<18B1> <60DF>\n<18B4> <63C4>\n<18B5> <6538>\n<18B6> <6709>\n<18B7> <67D4>\n<18B8> <67DA>\n<18BB> <6CB9>\n<18BC> <6D27>\n<18BD> <6E38>\n<18BE> <6FE1>\n<18C1> <745C>\n<18C2> <7531>\n<18C3> <7652>\n<18C4> <7DAD>\n<18C5> <81FE>\n<18C6> <8438>\n<18C7> <88D5>\n<18C8> <8A98>\n<18C9> <8ADB>\n<18CA> <8AED>\n<18CB> <8E30>\n<18CC> <8E42>\n<18CD> <904A>\n<18CE> <903E>\n<18CF> <907A>\n<18D0> <9149>\n<18D1> <91C9>\n<18D2> <936E>\n<18D3> <5809>\n<18D4> <6BD3>\n<18D5> <8089>\n<18D6> <80B2>\n<18D7> <5141>\n<18D8> <596B>\n<18D9> <5C39>\n<18DA> <6F64>\n<18DB> <73A7>\n<18DC> <80E4>\n<18DD> <8D07>\n<18DE> <9217>\n<18DF> <958F>\n<18E0> <807F>\n<18E1> <620E>\n<18E2> <701C>\n<18E3> <7D68>\n<18E4> <878D>\n<18E5> <57A0>\n<18E6> <6069>\n<18E7> <6147>\n<18E8> <6BB7>\n<18E9> <8ABE>\n<18EA> <9280>\n<18EB> <96B1>\n<18EC> <4E59>\n<18ED> <541F>\n<18EE> <6DEB>\n<18EF> <852D>\n<18F0> <9670>\n<18F1> <97F3>\n<18F2> <98EE>\n<18F3> <63D6>\n<18F4> <6CE3>\n<18F5> <9091>\n<18F6> <51DD>\n<18F7> <61C9>\n<18F8> <81BA>\n<18F9> <9DF9>\n<18FA> <4F9D>\n<18FB> <501A>\n<18FC> <5100>\n<18FD> <5B9C>\n<18FE> <610F>\n<18FF> <61FF>\n<1900> <64EC>\n<1901> <6905>\n<1902> <6BC5>\n<1903> <7591>\n<1904> <77E3>\n<1905> <7FA9>\n<1906> <8264>\nendbfchar\n\n100 beginbfchar\n<1907> <858F>\n<1908> <87FB>\n<1909> <8863>\n<190A> <8ABC>\n<190B> <8B70>\n<190C> <91AB>\n<190D> <4E8C>\n<190E> <4EE5>\n<190F> <4F0A>\n<1910> <5937>\n<1911> <59E8>\n<1912> <5DF2>\n<1913> <5F1B>\n<1914> <5F5B>\n<1915> <6021>\n<1916> <723E>\n<1917> <73E5>\n<1918> <7570>\n<1919> <75CD>\n<191A> <79FB>\n<191B> <800C>\n<191C> <8033>\n<191D> <8084>\n<191E> <82E1>\n<191F> <8351>\n<1920> <8CBD>\n<1921> <8CB3>\n<1922> <9087>\n<1923> <98F4>\n<1924> <990C>\n<1925> <7037>\n<1926> <76CA>\n<1927> <7FCA>\n<1928> <7FCC>\n<1929> <7FFC>\n<192A> <8B1A>\n<192B> <4EBA>\n<192C> <4EC1>\n<192D> <5203>\n<192E> <5370>\n<192F> <54BD>\n<1930> <56E0>\n<1931> <59FB>\n<1932> <5BC5>\n<1933> <5F15>\n<1934> <5FCD>\n<1935> <6E6E>\n<1936> <7D6A>\n<1937> <8335>\n<1938> <8693>\n<1939> <8A8D>\n<193A> <976D>\n<193B> <9777>\n<193C> <4E00>\n<193D> <4F5A>\n<193E> <4F7E>\n<193F> <58F9>\n<1940> <65E5>\n<1941> <6EA2>\n<1942> <9038>\n<1943> <93B0>\n<1944> <99B9>\n<1945> <4EFB>\n<1946> <58EC>\n<1947> <598A>\n<1948> <59D9>\n<1949> <6041>\n<194A> <7A14>\n<194B> <834F>\n<194C> <8CC3>\n<194D> <5165>\n<194E> <5344>\n<194F> <4ECD>\n<1950> <5269>\n<1951> <5B55>\n<1952> <82BF>\n<1953> <4ED4>\n<1954> <523A>\n<1955> <54A8>\n<1956> <59C9>\n<1957> <59FF>\n<1958> <5B50>\n<1959> <5B57>\n<195A> <5B5C>\n<195B> <6063>\n<195C> <6148>\n<195D> <6ECB>\n<195E> <7099>\n<195F> <716E>\n<1960> <7386>\n<1961> <74F7>\n<1962> <75B5>\n<1963> <78C1>\n<1964> <7D2B>\n<1965> <8005>\n<1966> <81EA>\n<1967> <8328>\n<1968> <8517>\n<1969> <85C9>\n<196A> <8AEE>\nendbfchar\n\n100 beginbfchar\n<196B> <8CC7>\n<196C> <96CC>\n<196D> <4F5C>\n<196E> <52FA>\n<196F> <56BC>\n<1970> <65AB>\n<1971> <6628>\n<1972> <707C>\n<1973> <70B8>\n<1974> <7235>\n<1975> <7DBD>\n<1976> <828D>\n<1977> <914C>\n<1978> <96C0>\n<1979> <9D72>\n<197A> <5B71>\n<197B> <68E7>\n<197C> <6B98>\n<197D> <6F7A>\n<197E> <76DE>\n<197F> <5C91>\n<1980> <66AB>\n<1981> <6F5B>\n<1982> <7BB4>\n<1983> <7C2A>\n<1984> <8836>\n<1985> <96DC>\n<1986> <4E08>\n<1987> <4ED7>\n<1988> <5320>\n<1989> <5834>\n<198A> <58BB>\n<198B> <58EF>\n<198C> <596C>\n<198D> <5C07>\n<198E> <5E33>\n<198F> <5E84>\n<1990> <5F35>\n<1991> <638C>\n<1992> <66B2>\n<1993> <6756>\n<1994> <6A1F>\n<1995> <6AA3>\n<1996> <6B0C>\n<1997> <6F3F>\n<1998> <7246>\n<1999> <7350>\n<199A> <748B>\n<199B> <7AE0>\n<199C> <7CA7>\n<199D> <8178>\n<199E> <81DF>\n<199F> <81E7>\n<19A0> <838A>\n<19A1> <846C>\n<19A2> <8523>\n<19A3> <8594>\n<19A4> <85CF>\n<19A5> <88DD>\n<19A6> <8D13>\n<19A7> <91AC>\n<19A8> <9577>\n<19A9> <969C>\n<19AA> <518D>\n<19AB> <54C9>\n<19AC> <5728>\n<19AD> <5BB0>\n<19AE> <624D>\n<19AF> <6750>\n<19B0> <683D>\n<19B1> <6893>\n<19B2> <6E3D>\n<19B3> <6ED3>\n<19B4> <707D>\n<19B5> <7E21>\n<19B6> <88C1>\n<19B7> <8CA1>\n<19B8> <8F09>\n<19B9> <9F4B>\n<19BA> <9F4E>\n<19BB> <722D>\n<19BC> <7B8F>\n<19BD> <8ACD>\n<19BE> <931A>\n<19BF> <4F47>\n<19C0> <4F4E>\n<19C1> <5132>\n<19C2> <5480>\n<19C3> <59D0>\n<19C4> <5E95>\n<19C5> <62B5>\n<19C6> <6775>\n<19C7> <696E>\n<19C8> <6A17>\n<19C9> <6CAE>\n<19CA> <6E1A>\n<19CB> <72D9>\n<19CC> <732A>\n<19CD> <75BD>\n<19CE> <7BB8>\nendbfchar\n\n100 beginbfchar\n<19CF> <7D35>\n<19D0> <82E7>\n<19D1> <83F9>\n<19D2> <8457>\n<19D3> <85F7>\n<19D4> <8A5B>\n<19D5> <8CAF>\n<19D6> <8E87>\n<19D7> <9019>\n<19D8> <90B8>\n<19D9> <96CE>\n<19DA> <9F5F>\n<19DB> <52E3>\n<19DC> <540A>\n<19DD> <5AE1>\n<19DE> <5BC2>\n<19DF> <6458>\n<19E0> <6575>\n<19E1> <6EF4>\n<19E2> <72C4>\n<19E3> <7684>\n<19E4> <7A4D>\n<19E5> <7B1B>\n<19E6> <7C4D>\n<19E7> <7E3E>\n<19E8> <7FDF>\n<19E9> <837B>\n<19EA> <8B2B>\n<19EB> <8CCA>\n<19EC> <8D64>\n<19ED> <8DE1>\n<19EE> <8E5F>\n<19EF> <8FEA>\n<19F0> <8FF9>\n<19F1> <9069>\n<19F2> <93D1>\n<19F3> <4F43>\n<19F4> <4F7A>\n<19F5> <50B3>\n<19F6> <5168>\n<19F7> <5178>\n<19F8> <524D>\n<19F9> <526A>\n<19FA> <5861>\n<19FB> <587C>\n<19FC> <5960>\n<19FD> <5C08>\n<19FE> <5C55>\n<19FF> <5EDB>\n<1A00> <609B>\n<1A01> <6230>\n<1A02> <6813>\n<1A03> <6BBF>\n<1A04> <6C08>\n<1A05> <6FB1>\n<1A06> <714E>\n<1A07> <7420>\n<1A08> <7530>\n<1A09> <7538>\n<1A0A> <7551>\n<1A0B> <7672>\n<1A0C> <7B4C>\n<1A0D> <7B8B>\n<1A0E> <7BAD>\n<1A0F> <7BC6>\n<1A10> <7E8F>\n<1A11> <8A6E>\n<1A12> <8F3E>\n<1A13> <8F49>\n<1A14> <923F>\n<1A15> <9293>\n<1A16> <9322>\n<1A17> <942B>\n<1A18> <96FB>\n<1A19> <985A>\n<1A1A> <986B>\n<1A1B> <991E>\n<1A1C> <5207>\n<1A1D> <622A>\n<1A1E> <6298>\n<1A1F> <6D59>\n<1A20> <7664>\n<1A21> <7ACA>\n<1A22> <7BC0>\n<1A23> <7D76>\n<1A24> <5360>\n<1A25> <5CBE>\n<1A26> <5E97>\n<1A27> <6F38>\n<1A28> <70B9>\n<1A29> <7C98>\n<1A2A> <9711>\n<1A2B> <9B8E>\n<1A2C> <9EDE>\n<1A2D> <63A5>\n<1A2E> <647A>\n<1A2F> <8776>\n<1A30> <4E01>\n<1A31> <4E95>\n<1A32> <4EAD>\nendbfchar\n\n100 beginbfchar\n<1A33> <505C>\n<1A34> <5075>\n<1A35> <5448>\n<1A36> <59C3>\n<1A37> <5B9A>\n<1A38> <5E40>\n<1A39> <5EAD>\n<1A3A> <5EF7>\n<1A3B> <5F81>\n<1A3C> <60C5>\n<1A3D> <633A>\n<1A3E> <653F>\n<1A3F> <6574>\n<1A40> <65CC>\n<1A41> <6676>\n<1A42> <6678>\n<1A43> <67FE>\n<1A44> <6968>\n<1A45> <6A89>\n<1A46> <6B63>\n<1A47> <6C40>\n<1A48> <6DC0>\n<1A49> <6DE8>\n<1A4A> <6E1F>\n<1A4B> <6E5E>\n<1A4C> <701E>\n<1A4D> <70A1>\n<1A4E> <738E>\n<1A4F> <73FD>\n<1A50> <753A>\n<1A51> <775B>\n<1A52> <7887>\n<1A53> <798E>\n<1A54> <7A0B>\n<1A55> <7A7D>\n<1A56> <7CBE>\n<1A57> <7D8E>\n<1A58> <8247>\n<1A59> <8A02>\n<1A5A> <8AEA>\n<1A5B> <8C9E>\n<1A5C> <912D>\n<1A5D> <914A>\n<1A5E> <91D8>\n<1A5F> <9266>\n<1A60> <92CC>\n<1A61> <9320>\n<1A62> <9706>\n<1A63> <9756>\n<1A64> <975C>\n<1A65> <9802>\n<1A66> <9F0E>\n<1A67> <5236>\n<1A68> <5291>\n<1A69> <557C>\n<1A6A> <5824>\n<1A6B> <5E1D>\n<1A6C> <5F1F>\n<1A6D> <608C>\n<1A6E> <63D0>\n<1A6F> <68AF>\n<1A70> <6FDF>\n<1A71> <796D>\n<1A72> <7B2C>\n<1A73> <81CD>\n<1A74> <85BA>\n<1A75> <88FD>\n<1A76> <8AF8>\n<1A77> <8E44>\n<1A78> <918D>\n<1A79> <9664>\n<1A7A> <969B>\n<1A7B> <973D>\n<1A7C> <984C>\n<1A7D> <9F4A>\n<1A7E> <4FCE>\n<1A7F> <5146>\n<1A80> <51CB>\n<1A81> <52A9>\n<1A82> <5632>\n<1A83> <5F14>\n<1A84> <5F6B>\n<1A85> <63AA>\n<1A86> <64CD>\n<1A87> <65E9>\n<1A88> <6641>\n<1A89> <66FA>\n<1A8A> <66F9>\n<1A8B> <671D>\n<1A8C> <689D>\n<1A8D> <68D7>\n<1A8E> <69FD>\n<1A8F> <6F15>\n<1A90> <6F6E>\n<1A91> <7167>\n<1A92> <71E5>\n<1A93> <722A>\n<1A94> <74AA>\n<1A95> <773A>\n<1A96> <7956>\nendbfchar\n\n100 beginbfchar\n<1A97> <795A>\n<1A98> <79DF>\n<1A99> <7A20>\n<1A9A> <7A95>\n<1A9B> <7C97>\n<1A9C> <7CDF>\n<1A9D> <7D44>\n<1A9E> <7E70>\n<1A9F> <8087>\n<1AA0> <85FB>\n<1AA1> <86A4>\n<1AA2> <8A54>\n<1AA3> <8ABF>\n<1AA4> <8D99>\n<1AA5> <8E81>\n<1AA6> <9020>\n<1AA7> <906D>\n<1AA8> <91E3>\n<1AA9> <963B>\n<1AAA> <96D5>\n<1AAB> <9CE5>\n<1AAC> <65CF>\n<1AAD> <7C07>\n<1AAE> <8DB3>\n<1AAF> <93C3>\n<1AB0> <5B58>\n<1AB1> <5C0A>\n<1AB2> <5352>\n<1AB3> <62D9>\n<1AB4> <731D>\n<1AB5> <5027>\n<1AB6> <5B97>\n<1AB7> <5F9E>\n<1AB8> <60B0>\n<1AB9> <616B>\n<1ABA> <68D5>\n<1ABB> <6DD9>\n<1ABC> <742E>\n<1ABD> <7A2E>\n<1ABE> <7D42>\n<1ABF> <7D9C>\n<1AC0> <7E31>\n<1AC1> <816B>\n<1AC2> <8E2A>\n<1AC3> <8E35>\n<1AC4> <937E>\n<1AC5> <9418>\n<1AC6> <4F50>\n<1AC7> <5750>\n<1AC8> <5DE6>\n<1AC9> <5EA7>\n<1ACA> <632B>\n<1ACB> <7F6A>\n<1ACC> <4E3B>\n<1ACD> <4F4F>\n<1ACE> <4F8F>\n<1ACF> <505A>\n<1AD0> <59DD>\n<1AD1> <80C4>\n<1AD2> <546A>\n<1AD3> <5468>\n<1AD4> <55FE>\n<1AD5> <594F>\n<1AD6> <5B99>\n<1AD7> <5DDE>\n<1AD8> <5EDA>\n<1AD9> <665D>\n<1ADA> <6731>\n<1ADB> <67F1>\n<1ADC> <682A>\n<1ADD> <6CE8>\n<1ADE> <6D32>\n<1ADF> <6E4A>\n<1AE0> <6F8D>\n<1AE1> <70B7>\n<1AE2> <73E0>\n<1AE3> <7587>\n<1AE4> <7C4C>\n<1AE5> <7D02>\n<1AE6> <7D2C>\n<1AE7> <7DA2>\n<1AE8> <821F>\n<1AE9> <86DB>\n<1AEA> <8A3B>\n<1AEB> <8A85>\n<1AEC> <8D70>\n<1AED> <8E8A>\n<1AEE> <8F33>\n<1AEF> <9031>\n<1AF0> <914E>\n<1AF1> <9152>\n<1AF2> <9444>\n<1AF3> <99D0>\n<1AF4> <7AF9>\n<1AF5> <7CA5>\n<1AF6> <4FCA>\n<1AF7> <5101>\n<1AF8> <51C6>\n<1AF9> <57C8>\n<1AFA> <5BEF>\nendbfchar\n\n100 beginbfchar\n<1AFB> <5CFB>\n<1AFC> <6659>\n<1AFD> <6A3D>\n<1AFE> <6D5A>\n<1AFF> <6E96>\n<1B00> <6FEC>\n<1B01> <710C>\n<1B02> <756F>\n<1B03> <7AE3>\n<1B04> <8822>\n<1B05> <9021>\n<1B06> <9075>\n<1B07> <96CB>\n<1B08> <99FF>\n<1B09> <8301>\n<1B0A> <4E2D>\n<1B0B> <4EF2>\n<1B0C> <8846>\n<1B0D> <91CD>\n<1B0E> <537D>\n<1B0F> <6ADB>\n<1B10> <696B>\n<1B11> <6C41>\n<1B12> <847A>\n<1B13> <589E>\n<1B14> <618E>\n<1B15> <66FE>\n<1B16> <62EF>\n<1B17> <70DD>\n<1B18> <7511>\n<1B19> <75C7>\n<1B1A> <7E52>\n<1B1B> <84B8>\n<1B1C> <8B49>\n<1B1D> <8D08>\n<1B1E> <4E4B>\n<1B1F> <53EA>\n<1B20> <54AB>\n<1B21> <5730>\n<1B22> <5740>\n<1B23> <5FD7>\n<1B24> <6301>\n<1B25> <6307>\n<1B26> <646F>\n<1B27> <652F>\n<1B28> <65E8>\n<1B29> <667A>\n<1B2A> <679D>\n<1B2B> <67B3>\n<1B2C> <6B62>\n<1B2D> <6C60>\n<1B2E> <6C9A>\n<1B2F> <6F2C>\n<1B30> <77E5>\n<1B31> <7825>\n<1B32> <7949>\n<1B33> <7957>\n<1B34> <7D19>\n<1B35> <80A2>\n<1B36> <8102>\n<1B37> <81F3>\n<1B38> <829D>\n<1B39> <82B7>\n<1B3A> <8718>\n<1B3B> <8A8C>\n<1B3C> <8D04>\n<1B3D> <8DBE>\n<1B3E> <9072>\n<1B3F> <76F4>\n<1B40> <7A19>\n<1B41> <7A37>\n<1B42> <7E54>\n<1B43> <8077>\n<1B44> <5507>\n<1B45> <55D4>\n<1B46> <5875>\n<1B47> <632F>\n<1B48> <6422>\n<1B49> <6649>\n<1B4A> <664B>\n<1B4B> <686D>\n<1B4C> <699B>\n<1B4D> <6B84>\n<1B4E> <6D25>\n<1B4F> <6EB1>\n<1B50> <73CD>\n<1B51> <7468>\n<1B52> <74A1>\n<1B53> <755B>\n<1B54> <75B9>\n<1B55> <76E1>\n<1B56> <771E>\n<1B57> <778B>\n<1B58> <79E6>\n<1B59> <7E09>\n<1B5A> <7E1D>\n<1B5B> <81FB>\n<1B5C> <852F>\n<1B5D> <8897>\n<1B5E> <8A3A>\nendbfchar\n\n100 beginbfchar\n<1B5F> <8CD1>\n<1B60> <8EEB>\n<1B61> <8FB0>\n<1B62> <9032>\n<1B63> <93AD>\n<1B64> <9663>\n<1B65> <9673>\n<1B66> <9707>\n<1B67> <4F84>\n<1B68> <53F1>\n<1B69> <59EA>\n<1B6A> <5AC9>\n<1B6B> <5E19>\n<1B6C> <684E>\n<1B6D> <74C6>\n<1B6E> <75BE>\n<1B6F> <79E9>\n<1B70> <7A92>\n<1B71> <81A3>\n<1B72> <86ED>\n<1B73> <8CEA>\n<1B74> <8DCC>\n<1B75> <8FED>\n<1B76> <659F>\n<1B77> <6715>\n<1B78> <57F7>\n<1B79> <6F57>\n<1B7A> <7DDD>\n<1B7B> <8F2F>\n<1B7C> <93F6>\n<1B7D> <96C6>\n<1B7E> <5FB5>\n<1B7F> <61F2>\n<1B80> <6F84>\n<1B81> <4E14>\n<1B82> <4F98>\n<1B83> <501F>\n<1B84> <53C9>\n<1B85> <55DF>\n<1B86> <5D6F>\n<1B87> <5DEE>\n<1B88> <6B21>\n<1B89> <6B64>\n<1B8A> <78CB>\n<1B8B> <7B9A>\n<1B8C> <8E49>\n<1B8D> <8ECA>\n<1B8E> <906E>\n<1B8F> <6349>\n<1B90> <643E>\n<1B91> <7740>\n<1B92> <7A84>\n<1B93> <932F>\n<1B94> <947F>\n<1B95> <9F6A>\n<1B96> <64B0>\n<1B97> <6FAF>\n<1B98> <71E6>\n<1B99> <74A8>\n<1B9A> <74DA>\n<1B9B> <7AC4>\n<1B9C> <7C12>\n<1B9D> <7E82>\n<1B9E> <7CB2>\n<1B9F> <7E98>\n<1BA0> <8B9A>\n<1BA1> <8D0A>\n<1BA2> <947D>\n<1BA3> <9910>\n<1BA4> <994C>\n<1BA5> <5239>\n<1BA6> <5BDF>\n<1BA7> <64E6>\n<1BA8> <672D>\n<1BA9> <7D2E>\n<1BAA> <50ED>\n<1BAB> <53C3>\n<1BAC> <5879>\n<1BAF> <61FA>\n<1BB0> <65AC>\n<1BB1> <7AD9>\n<1BB2> <8B92>\n<1BB3> <8B96>\n<1BB4> <5009>\n<1BB5> <5021>\n<1BB6> <5275>\n<1BB7> <5531>\n<1BB8> <5A3C>\n<1BB9> <5EE0>\n<1BBA> <5F70>\n<1BBB> <6134>\n<1BBC> <655E>\n<1BBD> <660C>\n<1BBE> <6636>\n<1BBF> <66A2>\n<1BC0> <69CD>\n<1BC1> <6EC4>\n<1BC2> <6F32>\n<1BC3> <7316>\n<1BC4> <7621>\nendbfchar\n\n100 beginbfchar\n<1BC5> <7A93>\n<1BC6> <8139>\n<1BC7> <8259>\n<1BC8> <83D6>\n<1BC9> <84BC>\n<1BCA> <50B5>\n<1BCB> <57F0>\n<1BCC> <5BC0>\n<1BCD> <5BE8>\n<1BCE> <5F69>\n<1BCF> <63A1>\n<1BD0> <7826>\n<1BD1> <7DB5>\n<1BD2> <83DC>\n<1BD3> <8521>\n<1BD4> <91C7>\n<1BD5> <91F5>\n<1BD6> <518A>\n<1BD7> <67F5>\n<1BD8> <7B56>\n<1BD9> <8CAC>\n<1BDA> <51C4>\n<1BDB> <59BB>\n<1BDC> <60BD>\n<1BDD> <8655>\n<1BDE> <501C>\n<1BDF> <5254>\n<1BE0> <5C3A>\n<1BE1> <617D>\n<1BE2> <621A>\n<1BE3> <62D3>\n<1BE4> <64F2>\n<1BE5> <65A5>\n<1BE6> <6ECC>\n<1BE7> <7620>\n<1BE8> <810A>\n<1BE9> <8E60>\n<1BEA> <965F>\n<1BEB> <96BB>\n<1BEC> <4EDF>\n<1BED> <5343>\n<1BEE> <5598>\n<1BEF> <5929>\n<1BF0> <5DDD>\n<1BF1> <64C5>\n<1BF2> <6CC9>\n<1BF3> <6DFA>\n<1BF4> <7394>\n<1BF5> <7A7F>\n<1BF6> <821B>\n<1BF7> <85A6>\n<1BF8> <8CE4>\n<1BF9> <8E10>\n<1BFA> <9077>\n<1BFB> <91E7>\n<1BFC> <95E1>\n<1BFD> <9621>\n<1BFE> <97C6>\n<1BFF> <51F8>\n<1C00> <54F2>\n<1C01> <5586>\n<1C02> <5FB9>\n<1C03> <64A4>\n<1C04> <6F88>\n<1C05> <7DB4>\n<1C06> <8F1F>\n<1C07> <8F4D>\n<1C08> <9435>\n<1C09> <50C9>\n<1C0A> <5C16>\n<1C0B> <6CBE>\n<1C0C> <6DFB>\n<1C0D> <751B>\n<1C0E> <77BB>\n<1C0F> <7C3D>\n<1C10> <7C64>\n<1C11> <8A79>\n<1C12> <8AC2>\n<1C13> <581E>\n<1C14> <59BE>\n<1C15> <5E16>\n<1C16> <6377>\n<1C17> <7252>\n<1C18> <758A>\n<1C19> <776B>\n<1C1A> <8ADC>\n<1C1B> <8CBC>\n<1C1C> <8F12>\n<1C1D> <5EF3>\n<1C1E> <6674>\n<1C1F> <6DF8>\n<1C20> <807D>\n<1C21> <83C1>\n<1C22> <8ACB>\n<1C23> <9751>\n<1C24> <9BD6>\n<1C25> <5243>\n<1C26> <66FF>\n<1C27> <6D95>\n<1C28> <6EEF>\nendbfchar\n\n100 beginbfchar\n<1C29> <7DE0>\n<1C2A> <8AE6>\n<1C2B> <902E>\n<1C2C> <905E>\n<1C2D> <9AD4>\n<1C2E> <521D>\n<1C2F> <527F>\n<1C30> <54E8>\n<1C31> <6194>\n<1C32> <6284>\n<1C33> <62DB>\n<1C34> <68A2>\n<1C35> <6912>\n<1C36> <695A>\n<1C37> <6A35>\n<1C38> <7092>\n<1C39> <7126>\n<1C3A> <785D>\n<1C3B> <7901>\n<1C3C> <790E>\n<1C3D> <79D2>\n<1C3E> <7A0D>\n<1C3F> <8096>\n<1C40> <8278>\n<1C41> <82D5>\n<1C42> <8349>\n<1C43> <8549>\n<1C44> <8C82>\n<1C45> <8D85>\n<1C46> <9162>\n<1C47> <918B>\n<1C48> <91AE>\n<1C49> <4FC3>\n<1C4A> <56D1>\n<1C4B> <71ED>\n<1C4C> <77D7>\n<1C4D> <8700>\n<1C4E> <89F8>\n<1C4F> <5BF8>\n<1C50> <5FD6>\n<1C51> <6751>\n<1C52> <90A8>\n<1C53> <53E2>\n<1C54> <585A>\n<1C55> <5BF5>\n<1C56> <60A4>\n<1C57> <6181>\n<1C58> <6460>\n<1C59> <7E3D>\n<1C5A> <8070>\n<1C5B> <8525>\n<1C5C> <9283>\n<1C5D> <64AE>\n<1C5E> <50AC>\n<1C5F> <5D14>\n<1C60> <6700>\n<1C61> <589C>\n<1C62> <62BD>\n<1C63> <63A8>\n<1C64> <690E>\n<1C65> <6978>\n<1C66> <6A1E>\n<1C67> <6E6B>\n<1C68> <76BA>\n<1C69> <79CB>\n<1C6A> <82BB>\n<1C6B> <8429>\n<1C6C> <8ACF>\n<1C6D> <8DA8>\n<1C6E> <8FFD>\n<1C6F> <9112>\n<1C70> <914B>\n<1C71> <919C>\n<1C72> <9310>\n<1C73> <9318>\n<1C74> <939A>\n<1C75> <96DB>\n<1C76> <9A36>\n<1C77> <9C0D>\n<1C78> <4E11>\n<1C79> <755C>\n<1C7A> <795D>\n<1C7B> <7AFA>\n<1C7C> <7B51>\n<1C7D> <7BC9>\n<1C7E> <7E2E>\n<1C7F> <84C4>\n<1C80> <8E59>\n<1C81> <8E74>\n<1C82> <8EF8>\n<1C83> <9010>\n<1C84> <6625>\n<1C85> <693F>\n<1C86> <7443>\n<1C87> <51FA>\n<1C88> <672E>\n<1C89> <9EDC>\n<1C8A> <5145>\n<1C8B> <5FE0>\n<1C8C> <6C96>\nendbfchar\n\n100 beginbfchar\n<1C8D> <87F2>\n<1C8E> <885D>\n<1C8F> <8877>\n<1C90> <60B4>\n<1C91> <81B5>\n<1C92> <8403>\n<1C93> <8D05>\n<1C94> <53D6>\n<1C95> <5439>\n<1C96> <5634>\n<1C97> <5A36>\n<1C98> <5C31>\n<1C99> <708A>\n<1C9A> <7FE0>\n<1C9B> <805A>\n<1C9C> <8106>\n<1C9D> <81ED>\n<1C9E> <8DA3>\n<1C9F> <9189>\n<1CA0> <9A5F>\n<1CA1> <9DF2>\n<1CA2> <5074>\n<1CA3> <4EC4>\n<1CA4> <53A0>\n<1CA5> <60FB>\n<1CA6> <6E2C>\n<1CA7> <5C64>\n<1CA8> <4F88>\n<1CA9> <5024>\n<1CAA> <55E4>\n<1CAB> <5CD9>\n<1CAC> <5E5F>\n<1CAD> <6065>\n<1CAE> <6894>\n<1CAF> <6CBB>\n<1CB0> <6DC4>\n<1CB1> <71BE>\n<1CB2> <75D4>\n<1CB3> <75F4>\n<1CB4> <7661>\n<1CB5> <7A1A>\n<1CB6> <7A49>\n<1CB7> <7DC7>\n<1CB8> <7DFB>\n<1CB9> <7F6E>\n<1CBA> <81F4>\n<1CBB> <86A9>\n<1CBC> <8F1C>\n<1CBD> <96C9>\n<1CBE> <99B3>\n<1CBF> <9F52>\n<1CC0> <5247>\n<1CC1> <52C5>\n<1CC2> <98ED>\n<1CC3> <89AA>\n<1CC4> <4E03>\n<1CC5> <67D2>\n<1CC6> <6F06>\n<1CC7> <4FB5>\n<1CC8> <5BE2>\n<1CC9> <6795>\n<1CCA> <6C88>\n<1CCB> <6D78>\n<1CCC> <741B>\n<1CCD> <7827>\n<1CCE> <91DD>\n<1CCF> <937C>\n<1CD0> <87C4>\n<1CD1> <79E4>\n<1CD2> <7A31>\n<1CD3> <5FEB>\n<1CD4> <4ED6>\n<1CD5> <54A4>\n<1CD6> <553E>\n<1CD7> <58AE>\n<1CD8> <59A5>\n<1CD9> <60F0>\n<1CDA> <6253>\n<1CDB> <62D6>\n<1CDC> <6736>\n<1CDD> <6955>\n<1CDE> <8235>\n<1CDF> <9640>\n<1CE0> <99B1>\n<1CE1> <99DD>\n<1CE2> <502C>\n<1CE3> <5353>\n<1CE4> <5544>\n<1CE5> <577C>\n<1CE6> <6258>\n<1CE7> <64E2>\n<1CE8> <666B>\n<1CE9> <67DD>\n<1CEA> <6FC1>\n<1CEB> <6FEF>\n<1CEC> <7422>\n<1CED> <7438>\n<1CEE> <8A17>\n<1CEF> <9438>\n<1CF0> <5451>\nendbfchar\n\n100 beginbfchar\n<1CF1> <5606>\n<1CF2> <5766>\n<1CF3> <5F48>\n<1CF4> <619A>\n<1CF5> <6B4E>\n<1CF6> <7058>\n<1CF7> <70AD>\n<1CF8> <7DBB>\n<1CF9> <8A95>\n<1CFA> <596A>\n<1CFB> <812B>\n<1CFC> <63A2>\n<1CFD> <7708>\n<1CFE> <803D>\n<1CFF> <8CAA>\n<1D00> <5854>\n<1D01> <642D>\n<1D02> <69BB>\n<1D03> <5B95>\n<1D04> <5E11>\n<1D05> <6E6F>\n<1D06> <8569>\n<1D07> <514C>\n<1D08> <53F0>\n<1D09> <592A>\n<1D0A> <6020>\n<1D0B> <614B>\n<1D0C> <6B86>\n<1D0D> <6C70>\n<1D0E> <6CF0>\n<1D0F> <7B1E>\n<1D10> <80CE>\n<1D11> <82D4>\n<1D12> <8DC6>\n<1D13> <90B0>\n<1D14> <98B1>\n<1D15> <64C7>\n<1D16> <6FA4>\n<1D17> <6491>\n<1D18> <6504>\n<1D19> <514E>\n<1D1A> <5410>\n<1D1B> <571F>\n<1D1C> <8A0E>\n<1D1D> <615F>\n<1D1E> <6876>\n<1D1F> <75DB>\n<1D20> <7B52>\n<1D21> <7D71>\n<1D22> <901A>\n<1D23> <5806>\n<1D24> <69CC>\n<1D25> <817F>\n<1D26> <892A>\n<1D27> <9000>\n<1D28> <9839>\n<1D29> <5078>\n<1D2A> <5957>\n<1D2B> <59AC>\n<1D2C> <6295>\n<1D2D> <900F>\n<1D2E> <9B2A>\n<1D2F> <615D>\n<1D30> <7279>\n<1D31> <95D6>\n<1D32> <5761>\n<1D33> <5A46>\n<1D34> <5DF4>\n<1D35> <628A>\n<1D36> <64AD>\n<1D37> <64FA>\n<1D38> <6777>\n<1D39> <6CE2>\n<1D3A> <6D3E>\n<1D3B> <722C>\n<1D3C> <7436>\n<1D3D> <7834>\n<1D3E> <7F77>\n<1D3F> <82AD>\n<1D40> <8DDB>\n<1D41> <9817>\n<1D42> <5224>\n<1D43> <5742>\n<1D44> <677F>\n<1D45> <7248>\n<1D46> <74E3>\n<1D47> <8CA9>\n<1D48> <8FA6>\n<1D49> <9211>\n<1D4A> <962A>\n<1D4B> <516B>\n<1D4C> <53ED>\n<1D4D> <634C>\n<1D4E> <4F69>\n<1D4F> <5504>\n<1D50> <6096>\n<1D51> <6557>\n<1D52> <6C9B>\n<1D53> <6D7F>\n<1D54> <724C>\nendbfchar\n\n100 beginbfchar\n<1D55> <72FD>\n<1D56> <7A17>\n<1D57> <8987>\n<1D58> <8C9D>\n<1D59> <5F6D>\n<1D5A> <6F8E>\n<1D5B> <70F9>\n<1D5C> <81A8>\n<1D5D> <610E>\n<1D5E> <4FBF>\n<1D5F> <504F>\n<1D60> <6241>\n<1D61> <7247>\n<1D62> <7BC7>\n<1D63> <7DE8>\n<1D64> <7FE9>\n<1D65> <904D>\n<1D66> <97AD>\n<1D67> <9A19>\n<1D68> <8CB6>\n<1D69> <576A>\n<1D6A> <5E73>\n<1D6B> <67B0>\n<1D6C> <840D>\n<1D6D> <8A55>\n<1D6E> <5420>\n<1D6F> <5B16>\n<1D70> <5E63>\n<1D71> <5EE2>\n<1D72> <5F0A>\n<1D73> <6583>\n<1D74> <80BA>\n<1D75> <853D>\n<1D76> <9589>\n<1D77> <965B>\n<1D78> <4F48>\n<1D79> <5305>\n<1D7A> <530D>\n<1D7B> <530F>\n<1D7C> <5486>\n<1D7D> <54FA>\n<1D7E> <5703>\n<1D7F> <5E03>\n<1D80> <6016>\n<1D81> <629B>\n<1D82> <62B1>\n<1D83> <6355>\n<1D84> <6CE1>\n<1D85> <6D66>\n<1D86> <75B1>\n<1D87> <7832>\n<1D88> <80DE>\n<1D89> <812F>\n<1D8A> <82DE>\n<1D8B> <8461>\n<1D8C> <84B2>\n<1D8D> <888D>\n<1D8E> <8912>\n<1D8F> <900B>\n<1D90> <92EA>\n<1D91> <98FD>\n<1D92> <9B91>\n<1D93> <5E45>\n<1D94> <66B4>\n<1D95> <66DD>\n<1D96> <7011>\n<1D97> <7206>\n<1D98> <4FF5>\n<1D99> <527D>\n<1D9A> <5F6A>\n<1D9B> <6153>\n<1D9C> <6753>\n<1D9D> <6A19>\n<1D9E> <6F02>\n<1D9F> <74E2>\n<1DA0> <7968>\n<1DA1> <8868>\n<1DA2> <8C79>\n<1DA3> <98C7>\n<1DA4> <98C4>\n<1DA5> <9A43>\n<1DA6> <54C1>\n<1DA7> <7A1F>\n<1DA8> <6953>\n<1DA9> <8AF7>\n<1DAA> <8C4A>\n<1DAB> <98A8>\n<1DAC> <99AE>\n<1DAD> <5F7C>\n<1DAE> <62AB>\n<1DAF> <75B2>\n<1DB0> <76AE>\n<1DB1> <88AB>\n<1DB2> <907F>\n<1DB3> <9642>\n<1DB4> <5339>\n<1DB5> <5F3C>\n<1DB6> <5FC5>\n<1DB7> <6CCC>\n<1DB8> <73CC>\nendbfchar\n\n100 beginbfchar\n<1DB9> <7562>\n<1DBA> <758B>\n<1DBB> <7B46>\n<1DBC> <82FE>\n<1DBD> <999D>\n<1DBE> <4E4F>\n<1DBF> <903C>\n<1DC0> <4E0B>\n<1DC1> <4F55>\n<1DC2> <53A6>\n<1DC3> <590F>\n<1DC4> <5EC8>\n<1DC5> <6630>\n<1DC6> <6CB3>\n<1DC7> <7455>\n<1DC8> <8377>\n<1DC9> <8766>\n<1DCA> <8CC0>\n<1DCB> <9050>\n<1DCC> <971E>\n<1DCD> <9C15>\n<1DCE> <58D1>\n<1DCF> <5B78>\n<1DD0> <8650>\n<1DD1> <8B14>\n<1DD2> <9DB4>\n<1DD3> <5BD2>\n<1DD4> <6068>\n<1DD5> <608D>\n<1DD6> <65F1>\n<1DD7> <6C57>\n<1DD8> <6F22>\n<1DD9> <6FA3>\n<1DDA> <701A>\n<1DDB> <7F55>\n<1DDC> <7FF0>\n<1DDF> <9650>\n<1DE0> <97D3>\n<1DE1> <5272>\n<1DE2> <8F44>\n<1DE3> <51FD>\n<1DE4> <542B>\n<1DE5> <54B8>\n<1DE6> <5563>\n<1DE7> <558A>\n<1DE8> <6ABB>\n<1DE9> <6DB5>\n<1DEA> <7DD8>\n<1DEB> <8266>\n<1DEC> <929C>\n<1DED> <9677>\n<1DEE> <9E79>\n<1DEF> <5408>\n<1DF0> <54C8>\n<1DF1> <76D2>\n<1DF2> <86E4>\n<1DF3> <95A4>\n<1DF4> <95D4>\n<1DF5> <965C>\n<1DF6> <4EA2>\n<1DF7> <4F09>\n<1DF8> <59EE>\n<1DF9> <5AE6>\n<1DFA> <5DF7>\n<1DFB> <6052>\n<1DFC> <6297>\n<1DFD> <676D>\n<1DFE> <6841>\n<1DFF> <6C86>\n<1E00> <6E2F>\n<1E01> <7F38>\n<1E02> <809B>\n<1E03> <822A>\n<1E04> <9805>\n<1E05> <4EA5>\n<1E06> <5055>\n<1E07> <54B3>\n<1E08> <5793>\n<1E09> <595A>\n<1E0A> <5B69>\n<1E0B> <5BB3>\n<1E0C> <61C8>\n<1E0D> <6977>\n<1E0E> <6D77>\n<1E0F> <7023>\n<1E10> <87F9>\n<1E11> <89E3>\n<1E12> <8A72>\n<1E13> <8AE7>\n<1E14> <9082>\n<1E15> <99ED>\n<1E16> <9AB8>\n<1E17> <52BE>\n<1E18> <6838>\n<1E19> <5016>\n<1E1A> <5E78>\n<1E1B> <674F>\n<1E1C> <8347>\n<1E1D> <884C>\n<1E1E> <4EAB>\nendbfchar\n\n100 beginbfchar\n<1E1F> <5411>\n<1E20> <56AE>\n<1E21> <73E6>\n<1E22> <9115>\n<1E23> <97FF>\n<1E24> <9909>\n<1E25> <9957>\n<1E26> <9999>\n<1E27> <5653>\n<1E28> <589F>\n<1E29> <865B>\n<1E2A> <8A31>\n<1E2B> <61B2>\n<1E2C> <6AF6>\n<1E2D> <737B>\n<1E2E> <8ED2>\n<1E2F> <6B47>\n<1E30> <96AA>\n<1E31> <9A57>\n<1E32> <5955>\n<1E33> <7200>\n<1E34> <8D6B>\n<1E35> <9769>\n<1E36> <4FD4>\n<1E37> <5CF4>\n<1E38> <5F26>\n<1E39> <61F8>\n<1E3A> <665B>\n<1E3B> <6CEB>\n<1E3C> <70AB>\n<1E3D> <7384>\n<1E3E> <73B9>\n<1E3F> <73FE>\n<1E40> <7729>\n<1E41> <774D>\n<1E42> <7D43>\n<1E43> <7D62>\n<1E44> <7E23>\n<1E45> <8237>\n<1E46> <8852>\n<1E47> <8CE2>\n<1E48> <9249>\n<1E49> <986F>\n<1E4A> <5B51>\n<1E4B> <7A74>\n<1E4C> <8840>\n<1E4D> <9801>\n<1E4E> <5ACC>\n<1E4F> <4FE0>\n<1E50> <5354>\n<1E51> <593E>\n<1E52> <5CFD>\n<1E53> <633E>\n<1E54> <6D79>\n<1E55> <72F9>\n<1E56> <8105>\n<1E57> <8107>\n<1E58> <83A2>\n<1E59> <92CF>\n<1E5A> <9830>\n<1E5B> <4EA8>\n<1E5C> <5144>\n<1E5D> <5211>\n<1E5E> <578B>\n<1E5F> <5F62>\n<1E60> <6CC2>\n<1E61> <6ECE>\n<1E62> <7005>\n<1E63> <7050>\n<1E64> <70AF>\n<1E65> <7192>\n<1E66> <73E9>\n<1E67> <7469>\n<1E68> <834A>\n<1E69> <87A2>\n<1E6A> <8861>\n<1E6B> <9008>\n<1E6C> <90A2>\n<1E6D> <93A3>\n<1E6E> <99A8>\n<1E6F> <516E>\n<1E70> <5F57>\n<1E71> <60E0>\n<1E72> <6167>\n<1E73> <66B3>\n<1E74> <8559>\n<1E75> <8E4A>\n<1E76> <91AF>\n<1E77> <978B>\n<1E78> <4E4E>\n<1E79> <4E92>\n<1E7A> <547C>\n<1E7B> <58D5>\n<1E7C> <58FA>\n<1E7D> <597D>\n<1E7E> <5CB5>\n<1E7F> <5F27>\n<1E80> <6236>\n<1E81> <6248>\n<1E82> <660A>\nendbfchar\n\n100 beginbfchar\n<1E83> <6667>\n<1E84> <6BEB>\n<1E85> <6D69>\n<1E86> <6DCF>\n<1E87> <6E56>\n<1E88> <6EF8>\n<1E89> <6F94>\n<1E8A> <6FE0>\n<1E8B> <6FE9>\n<1E8C> <705D>\n<1E8D> <72D0>\n<1E8E> <7425>\n<1E8F> <745A>\n<1E90> <74E0>\n<1E91> <7693>\n<1E92> <795C>\n<1E93> <7CCA>\n<1E94> <7E1E>\n<1E95> <80E1>\n<1E96> <82A6>\n<1E97> <846B>\n<1E98> <84BF>\n<1E99> <864E>\n<1E9A> <865F>\n<1E9B> <8774>\n<1E9C> <8B77>\n<1E9D> <8C6A>\n<1E9E> <93AC>\n<1E9F> <9800>\n<1EA0> <9865>\n<1EA1> <60D1>\n<1EA2> <6216>\n<1EA3> <9177>\n<1EA4> <5A5A>\n<1EA5> <660F>\n<1EA6> <6DF7>\n<1EA7> <6E3E>\n<1EA8> <743F>\n<1EA9> <9B42>\n<1EAA> <5FFD>\n<1EAB> <60DA>\n<1EAC> <7B0F>\n<1EAD> <54C4>\n<1EAE> <5F18>\n<1EAF> <6C5E>\n<1EB0> <6CD3>\n<1EB1> <6D2A>\n<1EB2> <70D8>\n<1EB3> <7D05>\n<1EB4> <8679>\n<1EB5> <8A0C>\n<1EB6> <9D3B>\n<1EB7> <5316>\n<1EB8> <548C>\n<1EB9> <5B05>\n<1EBA> <6A3A>\n<1EBB> <706B>\n<1EBC> <7575>\n<1EBD> <798D>\n<1EBE> <79BE>\n<1EBF> <82B1>\n<1EC0> <83EF>\n<1EC1> <8A71>\n<1EC2> <8B41>\n<1EC3> <8CA8>\n<1EC4> <9774>\n<1EC5> <64F4>\n<1EC6> <652B>\n<1EC9> <7A6B>\n<1ECA> <4E38>\n<1ECB> <559A>\n<1ECC> <5950>\n<1ECD> <5BA6>\n<1ECE> <5E7B>\n<1ECF> <60A3>\n<1ED0> <63DB>\n<1ED1> <6B61>\n<1ED2> <6665>\n<1ED3> <6853>\n<1ED4> <6E19>\n<1ED5> <7165>\n<1ED6> <74B0>\n<1ED7> <7D08>\n<1ED8> <9084>\n<1ED9> <9A69>\n<1EDA> <9C25>\n<1EDB> <6D3B>\n<1EDC> <6ED1>\n<1EDD> <733E>\n<1EDE> <8C41>\n<1EDF> <95CA>\n<1EE0> <51F0>\n<1EE1> <5E4C>\n<1EE2> <5FA8>\n<1EE3> <604D>\n<1EE4> <60F6>\n<1EE5> <6130>\n<1EE6> <614C>\n<1EE9> <69A5>\n<1EEA> <6CC1>\nendbfchar\n\n100 beginbfchar\n<1EEB> <6E5F>\n<1EEC> <6EC9>\n<1EED> <6F62>\n<1EEE> <714C>\n<1EEF> <749C>\n<1EF0> <7687>\n<1EF1> <7BC1>\n<1EF2> <7C27>\n<1EF3> <8352>\n<1EF4> <8757>\n<1EF5> <9051>\n<1EF6> <968D>\n<1EF7> <9EC3>\n<1EF8> <532F>\n<1EF9> <56DE>\n<1EFA> <5EFB>\n<1EFB> <5F8A>\n<1EFC> <6062>\n<1EFD> <6094>\n<1EFE> <61F7>\n<1EFF> <6666>\n<1F00> <6703>\n<1F01> <6A9C>\n<1F02> <6DEE>\n<1F03> <6FAE>\n<1F04> <7070>\n<1F05> <736A>\n<1F06> <7E6A>\n<1F07> <81BE>\n<1F08> <8334>\n<1F09> <86D4>\n<1F0A> <8AA8>\n<1F0B> <8CC4>\n<1F0C> <5283>\n<1F0D> <7372>\n<1F0E> <5B96>\n<1F0F> <6A6B>\n<1F10> <9404>\n<1F11> <54EE>\n<1F12> <5686>\n<1F13> <5B5D>\n<1F14> <6548>\n<1F15> <6585>\n<1F16> <66C9>\n<1F17> <689F>\n<1F18> <6D8D>\n<1F19> <6DC6>\n<1F1A> <723B>\n<1F1B> <80B4>\n<1F1C> <9175>\n<1F1D> <9A4D>\n<1F1E> <4FAF>\n<1F1F> <5019>\n<1F20> <539A>\n<1F21> <540E>\n<1F22> <543C>\n<1F23> <5589>\n<1F24> <55C5>\n<1F25> <5E3F>\n<1F26> <5F8C>\n<1F27> <673D>\n<1F28> <7166>\n<1F29> <73DD>\n<1F2A> <9005>\n<1F2B> <52DB>\n<1F2C> <52F3>\n<1F2D> <5864>\n<1F2E> <58CE>\n<1F2F> <7104>\n<1F30> <718F>\n<1F31> <71FB>\n<1F32> <85B0>\n<1F33> <8A13>\n<1F34> <6688>\n<1F35> <85A8>\n<1F36> <55A7>\n<1F37> <6684>\n<1F38> <714A>\n<1F39> <8431>\n<1F3A> <5349>\n<1F3B> <5599>\n<1F3C> <6BC1>\n<1F3D> <5F59>\n<1F3E> <5FBD>\n<1F3F> <63EE>\n<1F40> <6689>\n<1F41> <7147>\n<1F42> <8AF1>\n<1F43> <8F1D>\n<1F44> <9EBE>\n<1F45> <4F11>\n<1F46> <643A>\n<1F47> <70CB>\n<1F48> <7566>\n<1F49> <8667>\n<1F4A> <6064>\n<1F4B> <8B4E>\n<1F4C> <9DF8>\n<1F4D> <5147>\n<1F4E> <51F6>\nendbfchar\n\n100 beginbfchar\n<1F4F> <5308>\n<1F50> <6D36>\n<1F51> <80F8>\n<1F52> <9ED1>\n<1F53> <6615>\n<1F54> <6B23>\n<1F55> <7098>\n<1F56> <75D5>\n<1F57> <5403>\n<1F58> <5C79>\n<1F59> <7D07>\n<1F5A> <8A16>\n<1F5B> <6B20>\n<1F5C> <6B3D>\n<1F5D> <6B46>\n<1F5E> <5438>\n<1F5F> <6070>\n<1F60> <6D3D>\n<1F61> <7FD5>\n<1F62> <8208>\n<1F63> <50D6>\n<1F64> <51DE>\n<1F65> <559C>\n<1F66> <566B>\n<1F67> <56CD>\n<1F68> <59EC>\n<1F69> <5B09>\n<1F6A> <5E0C>\n<1F6B> <6199>\n<1F6C> <6198>\n<1F6D> <6231>\n<1F6E> <665E>\n<1F6F> <66E6>\n<1F70> <7199>\n<1F73> <72A7>\n<1F74> <79A7>\n<1F75> <7A00>\n<1F76> <7FB2>\n<1F77> <8A70>\n<1F7A> <2025>\n<1F7B> <00AD>\n<1F7C> <2015>\n<1F7D> <2225>\n<1F7E> <FF5E>\n<1F8B> <3013>\n<1F8C> <FF01>\n<1F8F> <FF0C>\n<1F90> <FF0E>\n<1F97> <FF3B>\n<1F98> <FF3D>\n<1F99> <FF3F>\n<1FFC> <203E>\n<1FFD> <007E>\n<1FFE> <005C>\n<1FFF> <231C>\n<2000> <231F>\n<200F> <00280028>\n<2010> <00290029>\n<2011> <00280028>\n<2012> <00290029>\n<201F> <005B>\n<2020> <005D>\n<2023> <263E>\n<2024> <263D>\n<2025> <2021>\n<2026> <2021>\n<202A> <2217>\n<202D> <201F>\n<202E> <201B>\n<2031> <00D7>\n<2032> <221E>\n<2034> <00B1>\n<2035> <2213>\n<2036> <003E>\n<2039> <2260>\n<203C> <007B>\n<203D> <007D>\n<2042> <2282>\n<2043> <2208>\n<2044> <03A3>\n<2045> <0021>\n<204D> <4E03>\n<2050> <5341>\n<2053> <0027>\n<2056> <002A>\n<2058> <2217>\n<2059> <002A>\n<205A> <CDCDCDCD>\n<205D> <00280028>\n<205E> <00290029>\n<205F> <00280028>\n<2060> <00290029>\n<2069> <003120DE>\n<206A> <003220DE>\n<206B> <003320DE>\n<206C> <003420DE>\n<206D> <003520DE>\n<206E> <003620DE>\n<206F> <003720DE>\n<2070> <003820DE>\nendbfchar\n\n100 beginbfchar\n<2071> <003920DE>\n<2072> <005B00310030005D>\n<2073> <005B00310031005D>\n<2074> <005B00310032005D>\n<2075> <005B00310033005D>\n<2076> <005B00310034005D>\n<2077> <005B00310035005D>\n<2078> <005B00310036005D>\n<2079> <005B00310037005D>\n<207A> <005B00310038005D>\n<207B> <005B00310039005D>\n<207C> <005B00320030005D>\n<207D> <00B6>\n<2080> <22EF>\n<2081> <2237>\n<2082> <003120DE>\n<2083> <003220DE>\n<2084> <003320DE>\n<2085> <003420DE>\n<2086> <003520DE>\n<2087> <003620DE>\n<2088> <003720DE>\n<2089> <003820DE>\n<208A> <003920DE>\n<208B> <005B00310030005D>\n<208C> <005B00310031005D>\n<208D> <005B00310032005D>\n<208E> <005B00310033005D>\n<208F> <005B00310034005D>\n<2090> <005B00310035005D>\n<2091> <005B00310036005D>\n<2092> <005B00310037005D>\n<2093> <005B00310038005D>\n<2094> <005B00310039005D>\n<2095> <005B00320030005D>\n<20AA> <002800410029>\n<20AB> <002800420029>\n<20AC> <002800430029>\n<20AD> <002800440029>\n<20AE> <002800450029>\n<20AF> <002800460029>\n<20B0> <002800470029>\n<20B1> <002800480029>\n<20B2> <002800490029>\n<20B3> <0028004A0029>\n<20B4> <0028004B0029>\n<20B5> <0028004C0029>\n<20B6> <0028004D0029>\n<20B7> <0028004E0029>\n<20B8> <0028004F0029>\n<20B9> <002800500029>\n<20BA> <002800510029>\n<20BB> <002800520029>\n<20BC> <002800530029>\n<20BD> <002800540029>\n<20BE> <002800550029>\n<20BF> <002800560029>\n<20C0> <002800570029>\n<20C1> <002800580029>\n<20C2> <002800590029>\n<20C3> <0028005A0029>\n<20DE> <003120DE>\n<20DF> <003220DE>\n<20E0> <003320DE>\n<20E1> <003420DE>\n<20E2> <003520DE>\n<20E3> <003620DE>\n<20E4> <003720DE>\n<20E5> <003820DE>\n<20E6> <003920DE>\n<20E7> <005B00310030005D>\n<20E8> <005B00310031005D>\n<20E9> <005B00310032005D>\n<20EA> <005B00310033005D>\n<20EB> <005B00310034005D>\n<20EC> <005B00310035005D>\n<20ED> <005B00310036005D>\n<20EE> <005B00310037005D>\n<20EF> <005B00310038005D>\n<20F0> <005B00310039005D>\n<20F1> <005B00320030005D>\n<20F2> <003120DE>\n<20F3> <003220DE>\n<20F4> <003320DE>\n<20F5> <003420DE>\n<20F6> <003520DE>\n<20F7> <003620DE>\n<20F8> <003720DE>\n<20F9> <003820DE>\n<20FA> <003920DE>\n<20FB> <005B00310030005D>\n<20FC> <005B00310031005D>\n<20FD> <005B00310032005D>\n<20FE> <005B00310033005D>\n<20FF> <005B00310034005D>\n<2100> <005B00310035005D>\n<2101> <005B00310036005D>\n<2102> <005B00310037005D>\n<2103> <005B00310038005D>\n<2104> <005B00310039005D>\nendbfchar\n\n100 beginbfchar\n<2105> <005B00320030005D>\n<211B> <22CF>\n<211E> <22CE>\n<2126> <228A>\n<2128> <228B>\n<212B> <2279>\n<2132> <2221>\n<2133> <2245>\n<2134> <2243>\n<2135> <2248>\n<2137> <22A4>\n<2138> <22AB>\n<213A> <003020DE>\n<213B> <003120DE>\n<213C> <003220DE>\n<213D> <003320DE>\n<213E> <003420DE>\n<213F> <003520DE>\n<2140> <003620DE>\n<2141> <003720DE>\n<2142> <003820DE>\n<2143> <003920DE>\n<214E> <00410029>\n<214F> <00420029>\n<2150> <00430029>\n<2151> <00440029>\n<2152> <00450029>\n<2153> <00460029>\n<2154> <00470029>\n<2155> <00480029>\n<2156> <00490029>\n<2157> <004A0029>\n<2158> <004B0029>\n<2159> <004C0029>\n<215A> <004D0029>\n<215B> <004E0029>\n<215C> <004F0029>\n<215D> <00500029>\n<215E> <00510029>\n<215F> <00520029>\n<2160> <00530029>\n<2161> <00540029>\n<2162> <00550029>\n<2163> <00560029>\n<2164> <00570029>\n<2165> <00580029>\n<2166> <00590029>\n<2167> <005A0029>\n<2168> <00610029>\n<2169> <00620029>\n<216A> <00630029>\n<216B> <00640029>\n<216C> <00650029>\n<216D> <00660029>\n<216E> <00670029>\n<216F> <00680029>\n<2170> <00690029>\n<2171> <006A0029>\n<2172> <006B0029>\n<2173> <006C0029>\n<2174> <006D0029>\n<2175> <006E0029>\n<2176> <006F0029>\n<2177> <00700029>\n<2178> <00710029>\n<2179> <00720029>\n<217A> <00730029>\n<217B> <00740029>\n<217C> <00750029>\n<217D> <00760029>\n<217E> <00770029>\n<217F> <00780029>\n<2180> <00790029>\n<2181> <007A0029>\n<2182> <0021>\n<2183> <00B0>\n<2184> <0027>\n<2185> <0022>\n<2186> <2034>\n<2187> <0028003200370029>\n<2188> <0028003200380029>\n<2189> <0028003200390029>\n<218A> <0028003300300029>\n<218D> <2020>\n<218E> <20202020>\n<218F> <20212021>\n<2190> <202020202020>\n<2191> <00A7>\n<2192> <0023>\n<2193> <002A>\n<2194> <002A>\n<2197> <2042>\n<2198> <002A>\n<219B> <2042>\n<219C> <002A>\n<219F> <2022>\n<21A0> <25A020DF>\n<21A1> <25C720DF>\n<21A3> <25A120DF>\n<21A8> <261C>\nendbfchar\n\n100 beginbfchar\n<21A9> <261E>\n<21AC> <25C720DE>\n<21AE> <25A120DE>\n<21AF> <25C620DE>\n<21B4> <25B320DD>\n<21B5> <25B220DD>\n<21B6> <271A>\n<21B7> <2716>\n<21B9> <25EF>\n<21BF> <25CC>\n<21D5> <20A9>\n<21D8> <262F>\n<21DA> <262F>\n<21DB> <262F>\n<21DF> <3020>\n<21F5> <0028003200310029>\n<21F6> <0028003200320029>\n<21F7> <0028003200330029>\n<21F8> <0028003200340029>\n<21F9> <0028003200350029>\n<21FA> <0028003200360029>\n<21FB> <2642>\n<21FC> <22A9>\n<21FD> <3036>\n<21FE> <25CB>\n<21FF> <25D3>\n<2200> <25A1>\n<2201> <2302>\n<2203> <25AD>\n<2204> <25AD>\n<2208> <25C7>\n<220B> <2206>\n<220C> <22BF>\n<220D> <231E>\n<2212> <2253>\n<2213> <2251>\n<2216> <2213>\n<221A> <00F720DD>\n<221B> <2314>\n<221E> <2262>\n<2220> <25B1>\n<2222> <2222>\n<2223> <2250>\n<2224> <00D8>\n<2225> <234A>\n<2226> <22A3>\n<2227> <22A50338>\n<222B> <2285>\n<222C> <2284>\n<222D> <2209>\n<222E> <220C>\n<222F> <22BB>\n<2230> <0016>\n<2231> <225A>\n<2232> <2306>\n<2233> <0024>\n<2239> <329E>\n<223B> <203C>\n<223C> <0021003F>\n<223E> <003F003F>\n<223F> <22C4>\n<2240> <25C7>\n<2241> <22C4>\n<2242> <25C6>\n<2243> <25AB>\n<2244> <25A1>\n<2245> <25AB>\n<2246> <25A0>\n<2247> <25E6>\n<2248> <25CB>\n<2249> <25E6>\n<224A> <25CF>\n<224B> <25BD>\n<224C> <25B3>\n<224D> <25B7>\n<224E> <25C1>\n<224F> <2726>\n<2250> <25CF>\n<2251> <25A0>\n<2253> <25CA>\n<2254> <3231>\n<2255> <3239>\n<2256> <33CB>\n<2257> <2483>\n<225C> <0028003200310029>\n<225D> <0028003200320029>\n<225E> <0028003200330029>\n<225F> <0028003200340029>\n<2260> <0028003200350029>\n<2261> <0028003200360029>\n<2262> <0028003200370029>\n<2263> <0028003200380029>\n<2264> <0028003200390029>\n<2265> <0028003300300029>\n<2266> <2192>\n<2269> <2193>\n<226E> <21D0>\n<226F> <21CF>\n<2270> <21CD>\n<2271> <21D4>\nendbfchar\n\n100 beginbfchar\n<2279> <2794>\n<2285> <279C>\n<2291> <27BA>\n<2296> <21D1>\n<2297> <21D3>\n<2299> <279E>\n<229D> <279E>\n<22A0> <21B5>\n<22A1> <21B1>\n<22A3> <21B4>\n<22A4> <21B0>\n<22A5> <21B3>\n<22B0> <21E6>\n<22B1> <21E8>\n<22B2> <21E7>\n<22B3> <21E9>\n<22B4> <21BC>\n<22B5> <21C0>\n<22BA> <21C0>\n<22BB> <21BC>\n<22C2> <0041002E>\n<22C3> <0042002E>\n<22C4> <0043002E>\n<22C5> <0044002E>\n<22C6> <0045002E>\n<22C7> <0046002E>\n<22C8> <0047002E>\n<22C9> <0048002E>\n<22CA> <0049002E>\n<22CB> <004A002E>\n<22CC> <004B002E>\n<22CD> <004C002E>\n<22CE> <004D002E>\n<22CF> <004E002E>\n<22D0> <004F002E>\n<22D1> <0050002E>\n<22D2> <0051002E>\n<22D3> <0052002E>\n<22D4> <0053002E>\n<22D5> <0054002E>\n<22D6> <0055002E>\n<22D7> <0056002E>\n<22D8> <0057002E>\n<22D9> <0058002E>\n<22DA> <0059002E>\n<22DB> <005A002E>\n<22DC> <0061002E>\n<22DD> <0062002E>\n<22DE> <0063002E>\n<22DF> <0064002E>\n<22E0> <0065002E>\n<22E1> <0066002E>\n<22E2> <0067002E>\n<22E3> <0068002E>\n<22E4> <0069002E>\n<22E5> <006A002E>\n<22E6> <006B002E>\n<22E7> <006C002E>\n<22E8> <006D002E>\n<22E9> <006E002E>\n<22EA> <006F002E>\n<22EB> <0070002E>\n<22EC> <0071002E>\n<22ED> <0072002E>\n<22EE> <0073002E>\n<22EF> <0074002E>\n<22F0> <0075002E>\n<22F1> <0076002E>\n<22F2> <0077002E>\n<22F3> <0078002E>\n<22F4> <0079002E>\n<22F5> <007A002E>\n<22F6> <C6B420DE>\n<22F7> <B2F520DE>\n<22F8> <C8FC20DE>\n<22F9> <BA8520DE>\n<22FA> <B30020DE>\n<22FB> <D61520DE>\n<22FC> <BD8020DE>\n<22FD> <C80420DE>\n<22FE> <C81120DE>\n<22FF> <C21820DE>\n<2300> <B3D920DE>\n<2301> <BE4420DE>\n<2302> <BC1820DE>\n<2303> <C79020DE>\n<2304> <D0C020DE>\n<2305> <AC1020DE>\n<2306> <C57D20DE>\n<2307> <C77820DE>\n<2308> <B73B20DE>\n<2309> <537020DE>\n<230A> <8A3B20DE>\n<230B> <C60820DE>\n<230C> <611F20DE>\n<230D> <51A020DE>\n<230E> <7B5420DE>\n<230F> <4EE320DE>\n<2310> <982D20DE>\n<2311> <52D520DE>\nendbfchar\n\n100 beginbfchar\n<2312> <540D20DE>\n<2313> <76EE20DE>\n<2314> <53CD20DE>\n<2315> <88DC20DE>\n<2316> <672C20DE>\n<2317> <526F20DE>\n<2318> <5E8F20DE>\n<2319> <902320DE>\n<231A> <5F7120DE>\n<231B> <4F8B20DE>\n<231C> <6E9020DE>\n<231D> <5B5020DE>\n<231E> <524D20DE>\n<231F> <7BC020DE>\n<2320> <63A520DE>\n<2321> <52A920DE>\n<2322> <630720DE>\n<2323> <4ED620DE>\n<2324> <6D3E20DE>\n<2325> <5F6220DE>\n<2326> <C87020DE>\n<2327> <BB3820DE>\n<2328> <B2F520DE>\n<2329> <C8FC20DE>\n<232A> <B73B20DE>\n<232B> <8A3B20DE>\n<232C> <AD5020DE>\n<232D> <C5ED20DE>\n<232E> <C74C20DE>\n<232F> <C81520DE>\n<2330> <D57420DE>\n<2331> <C60820DE>\n<2332> <C87420DD>\n<2333> <B77C20DD>\n<2334> <B9C820DD>\n<2335> <BC1420DD>\n<2336> <C0AC20DD>\n<2337> <C54420DD>\n<2338> <C79020DD>\n<2339> <CC2820DD>\n<233A> <CE7420DD>\n<233B> <D0C020DD>\n<233C> <D30C20DD>\n<233D> <B19220DD>\n<233E> <B0AE20DD>\n<233F> <BA8520DD>\n<2340> <B30020DD>\n<2341> <D61520DD>\n<2342> <BD8020DD>\n<2343> <C80420DD>\n<2344> <C81120DD>\n<2345> <C21820DD>\n<2346> <B3D920DD>\n<2347> <BE4420DD>\n<2348> <AC8C20DD>\n<2349> <BC1820DD>\n<234A> <C18D20DD>\n<234B> <C77820DD>\n<234C> <BCF820DD>\n<234D> <C57D20DD>\n<234E> <C21920DD>\n<234F> <C72020DD>\n<2350> <AD0020DD>\n<2351> <51A020DD>\n<2357> <0028003200310029>\n<2358> <0028003200320029>\n<2359> <0028003200330029>\n<235A> <0028003200340029>\n<235B> <0028003200350029>\n<235C> <0028003200360029>\n<235D> <C87020DD>\n<235E> <AD6D20DD>\n<235F> <AC1020DD>\n<2360> <537020DD>\n<2361> <886320DD>\n<2362> <672B20DD>\n<2363> <AC7020DD>\n<2364> <B2F520DD>\n<2365> <BCC020DD>\n<2366> <C0C120DD>\n<2367> <C13C20DD>\n<2368> <C2E020DD>\n<2369> <C5EC20DD>\n<236A> <C60820DD>\n<236B> <C6D020DD>\n<236C> <C79120DD>\n<236D> <C90020DD>\n<236E> <D0B920DD>\n<236F> <C67820DD>\n<2370> <D65C20DD>\n<2371> <AC0420DD>\n<2372> <AC1920DD>\n<2373> <C2E420DD>\n<2374> <611F20DD>\n<2375> <616320DD>\n<2376> <4EE320DD>\n<2377> <52D520DD>\n<2378> <3294>\n<2379> <53CD20DD>\n<237A> <526F20DD>\nendbfchar\n\n100 beginbfchar\n<237B> <81EA20DD>\n<237C> <524D20DD>\n<237D> <96FB20DD>\n<237E> <63A520DD>\n<237F> <52A920DD>\n<2380> <6CE820DD>\n<2381> <53C320DD>\n<2382> <672C20DD>\n<2383> <65B020DD>\n<2384> <73FE20DD>\n<2385> <5F6220DD>\n<2386> <959320DD>\n<2387> <570B20DD>\n<2388> <32A5>\n<2389> <4ED620DD>\n<238A> <BE6020DD>\n<238B> <C2DC20DD>\n<238C> <C78520DD>\n<238D> <C73C20DD>\n<238E> <C74C20DD>\n<238F> <C9C120DD>\n<2390> <D45C20DD>\n<2391> <AC0020DD>\n<2392> <B09820DD>\n<2393> <B2E420DD>\n<2394> <D55820DD>\n<2395> <B9C820DD>\n<2396> <BC1420DD>\n<2397> <C0AC20DD>\n<2398> <C54420DD>\n<2399> <C79020DD>\n<239A> <CC2820DD>\n<239B> <CE7420DD>\n<239C> <D0C020DD>\n<239D> <D30C20DD>\n<239E> <D55820DD>\n<239F> <BE4420DD>\n<23A0> <B2F520DD>\n<23A1> <BE6020DD>\n<23A2> <BCF820DD>\n<23A3> <B2E820DD>\n<23A4> <C13C20DD>\n<23A5> <C2DC20DD>\n<23A6> <C5EC20DD>\n<23A7> <C60820DD>\n<23A8> <C73C20DD>\n<23A9> <C74C20DD>\n<23AA> <C78520DD>\n<23AB> <C81C20DD>\n<23AC> <C87420DD>\n<23AD> <C90020DD>\n<23AE> <D45C20DD>\n<23AF> <D57420DD>\n<23B0> <B29020DD>\n<23B1> <B19220DD>\n<23B2> <B0AE20DD>\n<23B3> <BC1820DD>\n<23B4> <AC0020DD>\n<23B5> <B09820DD>\n<23B6> <B2E420DD>\n<23B7> <B77C20DD>\n<23B8> <C67820DD>\n<23B9> <0028003200370029>\n<23BA> <0028003200380029>\n<23BB> <0028003200390029>\n<23BC> <0028003300300029>\n<23DA> <2794>\n<23EB> <27A1>\n<23EE> <21E6>\n<23EF> <21E8>\n<23F0> <21E7>\n<23F1> <21E9>\n<2406> <261D>\n<2407> <261F>\n<240A> <B2E820DD>\n<240B> <CC3820DD>\n<240C> <C18C20DD>\n<240D> <C91120DD>\n<240E> <C77C20DD>\n<240F> <C77420DD>\n<2410> <D73420DD>\n<2411> <003120DE>\n<2412> <003220DE>\n<2413> <003320DE>\n<2414> <003420DE>\n<2415> <003520DE>\n<2416> <003620DE>\n<2417> <003720DE>\n<2418> <003820DE>\n<2419> <003920DE>\n<241A> <005B00310030005D>\n<241B> <005B00310031005D>\n<241C> <005B00310032005D>\n<241D> <005B00310033005D>\n<241E> <005B00310034005D>\n<241F> <005B00310035005D>\n<2420> <005B00310036005D>\n<2421> <005B00310037005D>\n<2422> <005B00310038005D>\n<2423> <005B00310039005D>\nendbfchar\n\n100 beginbfchar\n<2424> <005B00320030005D>\n<2425> <4E0020DE>\n<2426> <4E8C20DE>\n<2427> <4E0920DE>\n<2428> <56DB20DE>\n<2429> <4E9420DE>\n<242A> <516D20DE>\n<242B> <4E0320DE>\n<242C> <516B20DE>\n<242D> <4E5D20DE>\n<242E> <534120DE>\n<242F> <005B53414E00005D>\n<2430> <005B53414E8C005D>\n<2431> <005B53414E09005D>\n<2432> <005B534156DB005D>\n<2433> <005B53414E94005D>\n<2434> <005B5341516D005D>\n<2435> <005B53414E03005D>\n<2436> <005B5341516B005D>\n<2437> <005B53414E5D005D>\n<2438> <005B4E8C5341005D>\n<2439> <4E0020DE>\n<243A> <4E8C20DE>\n<243B> <4E0920DE>\n<243C> <56DB20DE>\n<243D> <4E9420DE>\n<243E> <516D20DE>\n<243F> <4E0320DE>\n<2440> <516B20DE>\n<2441> <4E5D20DE>\n<2442> <534120DE>\n<2443> <005B53414E00005D>\n<2444> <005B53414E8C005D>\n<2445> <005B53414E09005D>\n<2446> <005B534156DB005D>\n<2447> <005B53414E94005D>\n<2448> <005B5341516D005D>\n<2449> <005B53414E03005D>\n<244A> <005B5341516B005D>\n<244B> <005B53414E5D005D>\n<244C> <005B4E8C5341005D>\n<244D> <65E520DE>\n<244E> <670820DE>\n<244F> <706B20DE>\n<2450> <6C3420DE>\n<2451> <672820DE>\n<2452> <91D120DE>\n<2453> <571F20DE>\n<2454> <3290>\n<245B> <65E520DE>\n<245C> <670820DE>\n<245D> <706B20DE>\n<245E> <6C3420DE>\n<245F> <672820DE>\n<2460> <91D120DE>\n<2461> <571F20DE>\n<2466> <21E8>\n<2469> <21E9>\n<246A> <0022>\n<246B> <301F>\n<246C> <301D>\n<246D> <2036>\n<246E> <0060>\n<246F> <3001>\n<2471> <0021>\n<2472> <3021>\n<2473> <002C>\n<2474> <3002>\n<247E> <AC18>\n<248B> <AC2E>\n<24A1> <AC4C>\n<24C5> <AC79>\n<24CB> <AC82>\n<24DB> <AC9E>\n<24E2> <ACAB>\n<24EC> <ACBA>\n<2500> <ACD6>\n<250D> <ACE9>\n<250E> <ACEB>\n<2511> <ACF2>\n<2512> <ACF4>\n<251D> <AD05>\n<2523> <AD0E>\n<2524> <AD10>\n<254D> <AD46>\n<254E> <AD48>\n<2563> <AD62>\n<2574> <AD7E>\n<2575> <AD80>\n<25B7> <ADD2>\n<25E3> <AE0A>\n<25E4> <AE0C>\n<260A> <AE39>\n<2610> <AE42>\n<2611> <AE44>\n<2615> <AE4B>\n<2616> <AE4F>\n<261A> <AE55>\n<2620> <AE5E>\n<2632> <AE7A>\nendbfchar\n\n100 beginbfchar\n<266E> <AEBF>\n<2679> <AECE>\n<268F> <AEEC>\n<26C9> <AF31>\n<26CA> <AF33>\n<26D2> <AF3E>\n<26D3> <AF40>\n<2744> <AFCA>\n<2745> <AFCC>\n<27AC> <B049>\n<27AD> <B04B>\n<27AE> <B04D>\n<27B3> <B056>\n<27B4> <B058>\n<27E2> <B08E>\n<27E3> <B090>\n<27EA> <B09B>\n<27F2> <B0AA>\n<27F3> <B0B0>\n<27F4> <B0B2>\n<2800> <B0C3>\n<2801> <B0C6>\n<283A> <B10A>\n<283E> <B111>\n<2843> <B11A>\n<2855> <B136>\n<288E> <B181>\n<2894> <B18A>\n<2895> <B18C>\n<28DB> <B1DE>\n<28F1> <B1FA>\n<28F2> <B1FC>\n<2904> <B216>\n<2905> <B218>\n<2978> <B2A2>\n<2979> <B2A4>\n<297D> <B2AB>\n<299C> <B2D1>\n<29A2> <B2DA>\n<29A3> <B2DC>\n<29A8> <B2E3>\n<29A9> <B2E7>\n<29AF> <B2F6>\n<29BF> <B312>\n<29FD> <B357>\n<2A00> <B35D>\n<2A05> <B366>\n<2A06> <B368>\n<2A07> <B36A>\n<2A0A> <B36F>\n<2A17> <B382>\n<2A53> <B3CD>\n<2A54> <B3CF>\n<2A58> <B3D6>\n<2A59> <B3D8>\n<2A5A> <B3DA>\n<2A5B> <B3DC>\n<2A9E> <B42A>\n<2ACE> <B462>\n<2ACF> <B464>\n<2B18> <B4B6>\n<2B19> <B4B8>\n<2B3B> <B4E5>\n<2B41> <B4EE>\n<2B42> <B4F0>\n<2B6F> <B526>\n<2B81> <B542>\n<2B93> <B55E>\n<2BD7> <B5A9>\n<2BDC> <B5B2>\n<2BEE> <B5CE>\n<2CFF> <B6F9>\n<2D36> <B73A>\n<2D63> <B772>\n<2D64> <B774>\n<2D77> <B78E>\n<2D87> <B7AA>\n<2D9E> <B7C8>\n<2DCD> <B7FE>\n<2DDF> <B81A>\n<2DE0> <B81C>\n<2DF3> <B836>\n<2E09> <B852>\n<2E1E> <B86E>\n<2E1F> <B870>\n<2E67> <B8C2>\n<2E68> <B8C4>\n<2E7D> <B8DE>\n<2E7E> <B8E0>\n<2E91> <B8FA>\n<2E92> <B8FC>\n<2EDC> <B950>\n<2EEF> <B96A>\n<2EF0> <B96C>\n<2F03> <B986>\n<2F04> <B988>\n<2F30> <B9BE>\n<2F31> <B9C0>\n<2F3A> <B9CD>\n<2F40> <B9DA>\nendbfchar\n\n100 beginbfchar\n<2F41> <B9DC>\n<2F44> <B9E2>\n<2F51> <B9F6>\n<2F90> <BA41>\n<2F96> <BA4A>\n<2F97> <BA4C>\n<2FA8> <BA66>\n<2FBE> <BA86>\n<2FDE> <BAAA>\n<2FE2> <BAB1>\n<2FE8> <BABA>\n<2FE9> <BABC>\n<3032> <BB0E>\n<3033> <BB10>\n<3048> <BB2A>\n<3051> <BB37>\n<3059> <BB46>\n<305A> <BB48>\n<305E> <BB4E>\n<306D> <BB62>\n<30F8> <BC01>\n<30FE> <BC0A>\n<30FF> <BC0E>\n<3100> <BC10>\n<3109> <BC26>\n<310A> <BC28>\n<311C> <BC42>\n<315A> <BC8D>\n<3160> <BC96>\n<3161> <BC98>\n<3172> <BCB2>\n<3186> <BCCE>\n<31A6> <BCF7>\n<31B1> <BD06>\n<31B2> <BD08>\n<3225> <BD92>\n<3226> <BD94>\n<322A> <BD9B>\n<3285> <BE04>\n<3298> <BE1E>\n<32C2> <BE4D>\n<32C8> <BE56>\n<32C9> <BE58>\n<32D3> <BE69>\n<32D9> <BE72>\n<32EB> <BE8E>\n<3362> <BF1A>\n<3400> <BFC4>\n<3415> <BFE0>\n<34C9> <C0A2>\n<34CA> <C0A4>\n<34D1> <C0AE>\n<34D9> <C0BE>\n<34EB> <C0DA>\n<34FE> <C0F6>\n<34FF> <C0F8>\n<351F> <C125>\n<3524> <C12E>\n<3529> <C137>\n<3536> <C14A>\n<3549> <C166>\n<3568> <C18F>\n<356C> <C195>\n<3572> <C19E>\n<3573> <C1A0>\n<35B3> <C1F2>\n<35C8> <C20E>\n<35C9> <C210>\n<35DB> <C22A>\n<35DC> <C22C>\n<35DD> <C22E>\n<35DE> <C230>\n<35DF> <C233>\n<35FF> <C259>\n<361C> <C27E>\n<361D> <C280>\n<3633> <C29C>\n<3645> <C2B6>\n<3646> <C2B8>\n<3673> <C2EE>\n<3674> <C2F0>\n<3679> <C2F7>\n<367A> <C2FA>\n<36DC> <C371>\n<373E> <C3E1>\n<3835> <C4F9>\n<3868> <C53A>\n<3869> <C53C>\n<3872> <C54B>\n<3877> <C556>\n<387B> <C55F>\n<3888> <C572>\n<389A> <C58E>\n<389B> <C590>\n<389F> <C596>\n<38BA> <C5BA>\n<38C0> <C5CB>\n<38C1> <C5CD>\n<38C2> <C5CF>\n<38CF> <C5E2>\nendbfchar\n\n100 beginbfchar\n<38D0> <C5E4>\n<38D7> <C5EF>\n<38DB> <C5F5>\n<38F0> <C61A>\n<38FD> <C62F>\n<3900> <C636>\n<3901> <C638>\n<3902> <C63A>\n<3913> <C652>\n<3929> <C670>\n<393C> <C68A>\n<393D> <C68C>\n<3950> <C6A6>\n<3951> <C6A8>\n<3962> <C6C2>\n<3963> <C6C4>\n<399F> <C716>\n<39A0> <C718>\n<39B3> <C732>\n<39B4> <C734>\n<39B5> <C736>\n<39C4> <C74B>\n<39C5> <C74E>\n<39C6> <C750>\n<39E7> <C786>\n<39EB> <C78F>\n<39EE> <C795>\n<39EF> <C799>\n<39F5> <C7A2>\n<3A07> <C7BE>\n<3A10> <C7CD>\n<3A11> <C7CF>\n<3A41> <C809>\n<3A47> <C812>\n<3A48> <C814>\n<3A5A> <C82E>\n<3A5B> <C830>\n<3A97> <C879>\n<3A9D> <C882>\n<3A9E> <C884>\n<3AB0> <C89E>\n<3AB1> <C8A0>\n<3ADE> <C8D6>\n<3ADF> <C8D8>\n<3B08> <C90E>\n<3B09> <C910>\n<3B51> <C962>\n<3B7E> <C99A>\n<3B7F> <C99C>\n<3BA6> <C9C9>\n<3BAC> <C9D2>\n<3BAD> <C9D4>\n<3BB0> <C9DB>\n<3BB3> <C9E1>\n<3BB4> <C9E3>\n<3BBB> <C9EE>\n<3BCE> <CA0A>\n<3C16> <CA5E>\n<3C79> <CACE>\n<3C7A> <CAD0>\n<3C7B> <CAD2>\n<3D75> <CBE8>\n<3DAD> <CC2D>\n<3DAE> <CC2F>\n<3DB6> <CC3A>\n<3DC8> <CC56>\n<3DD2> <CC65>\n<3DD3> <CC67>\n<3E00> <CC97>\n<3E0D> <CCAA>\n<3E20> <CCC6>\n<3E21> <CCC8>\n<3E66> <CD1A>\n<3E67> <CD1C>\n<3EAF> <CD6E>\n<3EB0> <CD70>\n<3EDD> <CDA6>\n<3EDE> <CDA8>\n<3EFF> <CDCD>\n<3F26> <CDFA>\n<3F27> <CDFC>\n<3F51> <CE32>\n<3F52> <CE34>\n<3F7F> <CE6A>\n<3F80> <CE6C>\n<3F93> <CE86>\n<3F94> <CE88>\n<3FA7> <CEA2>\n<3FEE> <CEF6>\n<4000> <CF0F>\n<4001> <CF12>\n<4002> <CF14>\n<4016> <CF2E>\n<4044> <CF66>\n<4045> <CF68>\n<40BD> <CFF2>\n<40BE> <CFF4>\n<4103> <D046>\n<4104> <D048>\n<4160> <D0B6>\nendbfchar\n\n68 beginbfchar\n<4161> <D0B8>\n<4173> <D0D2>\n<4186> <D0EE>\n<41C8> <D139>\n<41CE> <D142>\n<41E1> <D15E>\n<41E2> <D160>\n<4228> <D1B2>\n<4229> <D1B4>\n<422E> <D1BB>\n<4275> <D208>\n<42A3> <D23E>\n<42A4> <D240>\n<4310> <D2C1>\n<4316> <D2CA>\n<4342> <D302>\n<4343> <D304>\n<434A> <D30F>\n<434E> <D315>\n<4354> <D31E>\n<4366> <D33A>\n<43AF> <D38E>\n<43C2> <D3AA>\n<43C3> <D3AC>\n<43EE> <D3E2>\n<4403> <D3FE>\n<4404> <D400>\n<4469> <D46E>\n<4476> <D481>\n<447C> <D48A>\n<447D> <D48C>\n<44E0> <D4FC>\n<44F4> <D516>\n<4525> <D54E>\n<4526> <D550>\n<4538> <D56A>\n<4539> <D56C>\n<454C> <D586>\n<458E> <D5D1>\n<4594> <D5DA>\n<4595> <D5DC>\n<45A8> <D5F6>\n<45A9> <D5F8>\n<45BC> <D612>\n<45E6> <D64A>\n<45E7> <D64C>\n<45FC> <D668>\n<4613> <D684>\n<4627> <D69E>\n<4628> <D6A0>\n<463D> <D6BA>\n<4653> <D6D8>\n<4694> <D72A>\n<4695> <D72C>\n<46AA> <D748>\n<46B3> <D755>\n<46BA> <D762>\n<46BB> <D764>\n<46E3> <D79A>\n<46E4> <D79C>\n<474A> <20A9>\n<474B> <2010>\n<474C> <00A9>\n<474D> <2122>\n<474E> <22EF>\n<47AD> <203E>\n<47AE> <007E>\n<47AF> <005C>\nendbfchar\n\n100 beginbfrange\n<0001> <005F> <0020>\n<0065> <0067> <3000>\n<0069> <006A> <2025>\n<006D> <006E> <2013>\n<0072> <0073> <2018>\n<0074> <0075> <201C>\n<0076> <0077> <3014>\n<0078> <0081> <3008>\n<0086> <0087> <2264>\n<008B> <008C> <2032>\n<008F> <0090> <FFE0>\n<00AB> <00AC> <2190>\n<00AD> <00AE> <2193>\n<00B0> <00B1> <226A>\n<00B6> <00B7> <222B>\n<00BA> <00BB> <2286>\n<00BC> <00BD> <2282>\n<00C0> <00C1> <2227>\n<00DE> <00DF> <2660>\n<00E6> <00E7> <25D0>\n<00E9> <00EA> <25A4>\n<00F5> <00F6> <2020>\n<00FD> <00FE> <2669>\n<0108> <0142> <FF01>\n<0144> <0164> <FF3D>\n<0166> <0198> <3131>\n<0199> <01C2> <3165>\n<01C3> <01CC> <2170>\n<01CD> <01D6> <2160>\n<01D7> <01E7> <0391>\n<01E8> <01EE> <03A3>\n<01EF> <01FF> <03B1>\n<0200> <0206> <03C3>\n<022F> <0230> <251E>\n<0231> <0232> <2521>\n<0233> <0234> <2526>\n<0235> <0236> <2529>\n<0237> <0238> <252D>\n<0239> <023A> <2531>\n<023B> <023C> <2535>\n<023D> <023E> <2539>\n<023F> <0240> <253D>\n<0241> <0242> <2540>\n<0243> <024A> <2543>\n<024B> <024D> <3395>\n<0251> <0254> <33A3>\n<0255> <025E> <3399>\n<0260> <0262> <338D>\n<0264> <0265> <3388>\n<0267> <0268> <33A7>\n<0269> <0272> <33B0>\n<0273> <0277> <3380>\n<0278> <027D> <33BA>\n<027E> <0282> <3390>\n<0284> <0285> <33C0>\n<0286> <0288> <338A>\n<028B> <028D> <33AD>\n<028F> <0292> <33A9>\n<02A7> <02C2> <3260>\n<02C3> <02DC> <24D0>\n<02DD> <02EB> <2460>\n<02ED> <02EE> <2153>\n<02F1> <02F4> <215B>\n<0305> <0320> <3200>\n<0321> <033A> <249C>\n<033B> <0349> <2474>\n<034B> <034C> <00B2>\n<034F> <0352> <2081>\n<0353> <03A5> <3041>\n<03A6> <03FB> <30A1>\n<03FC> <03FF> <0410>\n<0400> <0401> <0414>\n<0403> <0422> <0416>\n<0424> <043D> <0436>\n<043E> <043F> <AC00>\n<0441> <0444> <AC07>\n<0445> <044C> <AC10>\n<044D> <0451> <AC19>\n<0454> <0455> <AC2C>\n<0456> <0458> <AC2F>\n<0459> <045A> <AC38>\n<0462> <0463> <AC70>\n<0465> <0466> <AC77>\n<0468> <0469> <AC80>\n<046A> <046D> <AC83>\n<046E> <0471> <AC89>\n<0474> <0475> <AC9C>\n<0476> <0478> <AC9F>\n<0479> <047B> <ACA8>\n<047D> <047E> <ACAF>\n<047F> <0480> <ACB8>\n<0481> <0483> <ACBB>\n<048A> <048B> <ACE0>\n<048D> <048E> <ACE7>\n<0491> <0493> <ACEF>\n<0495> <0496> <ACF5>\n<0497> <0498> <ACFC>\n<049C> <049D> <AD0C>\n<04A4> <04A5> <AD2C>\n<04A6> <04A7> <AD34>\nendbfrange\n\n100 beginbfrange\n<04AA> <04AB> <AD44>\n<04B3> <04B4> <AD6C>\n<04B6> <04B9> <AD73>\n<04BA> <04BC> <AD7B>\n<04BE> <04BF> <AD81>\n<04C0> <04C1> <AD88>\n<04C4> <04C5> <AD9C>\n<04C8> <04C9> <ADC0>\n<04CC> <04CD> <ADD0>\n<04D2> <04D3> <ADF8>\n<04D5> <04D7> <ADFF>\n<04D8> <04D9> <AE08>\n<04DD> <04DE> <AE30>\n<04E0> <04E1> <AE37>\n<04E3> <04E4> <AE40>\n<04E6> <04E7> <AE45>\n<04E9> <04EB> <AE4C>\n<04EF> <04F0> <AE5C>\n<04F1> <04F3> <AE5F>\n<04F5> <04F6> <AE68>\n<04F9> <04FA> <AE78>\n<04FB> <04FD> <AE7B>\n<04FE> <04FF> <AE84>\n<0501> <0503> <AEBC>\n<0506> <0507> <AECC>\n<0508> <050A> <AECF>\n<050B> <050C> <AED8>\n<0514> <0515> <AF07>\n<0518> <0519> <AF2C>\n<051D> <051E> <AF3C>\n<0520> <0522> <AF41>\n<0523> <0524> <AF48>\n<0526> <0527> <AF5C>\n<0528> <0529> <AF64>\n<052E> <052F> <AF90>\n<0532> <0533> <AFB8>\n<0536> <0538> <AFC7>\n<053A> <053B> <AFCD>\n<053E> <053F> <AFE8>\n<0540> <0541> <AFF0>\n<0544> <0545> <B000>\n<054A> <054B> <B01C>\n<054D> <054E> <B044>\n<0553> <0555> <B053>\n<0559> <055A> <B07C>\n<055D> <055E> <B08C>\n<0561> <0563> <B098>\n<0565> <0568> <B09F>\n<0569> <056A> <B0A8>\n<056B> <056F> <B0AB>\n<0571> <0573> <B0B3>\n<0576> <0577> <B0C4>\n<0578> <057A> <B0C7>\n<057B> <057C> <B0D0>\n<0581> <0582> <B108>\n<0583> <0584> <B10B>\n<0586> <0587> <B112>\n<0588> <0589> <B118>\n<058A> <058C> <B11B>\n<058D> <058F> <B123>\n<0592> <0593> <B134>\n<0594> <0596> <B137>\n<0597> <0598> <B140>\n<059B> <059C> <B150>\n<059D> <059E> <B154>\n<05A2> <05A3> <B178>\n<05A7> <05A8> <B188>\n<05AB> <05AD> <B192>\n<05B4> <05B5> <B1DC>\n<05B7> <05B8> <B1E8>\n<05BE> <05BF> <B204>\n<05C1> <05C2> <B20B>\n<05C3> <05C4> <B214>\n<05CD> <05CE> <B268>\n<05CF> <05D0> <B274>\n<05D2> <05D3> <B284>\n<05D5> <05D6> <B290>\n<05D8> <05DA> <B298>\n<05DB> <05DC> <B2A0>\n<05DE> <05DF> <B2A5>\n<05E4> <05E5> <B2C8>\n<05E9> <05EA> <B2D8>\n<05EE> <05F0> <B2E4>\n<05F2> <05F6> <B2EB>\n<05F7> <05F9> <B2F3>\n<05FA> <05FE> <B2F7>\n<0600> <0601> <B300>\n<0604> <0605> <B310>\n<0606> <0608> <B313>\n<060A> <060C> <B354>\n<060E> <060F> <B35B>\n<0610> <0611> <B35E>\n<0612> <0613> <B364>\n<0618> <0619> <B370>\n<061C> <061D> <B380>\n<061E> <0620> <B383>\n<0624> <0625> <B3A0>\n<0628> <0629> <B3C4>\n<062B> <062C> <B3CB>\n<062F> <0630> <B3D4>\nendbfrange\n\n100 beginbfrange\n<063D> <063E> <B428>\n<0641> <0642> <B450>\n<0645> <0646> <B460>\n<0658> <0659> <B4DC>\n<065B> <065C> <B4E3>\n<065E> <065F> <B4EC>\n<0663> <0664> <B514>\n<0666> <0667> <B51B>\n<0668> <0669> <B524>\n<066A> <066D> <B527>\n<066E> <066F> <B530>\n<0672> <0673> <B540>\n<0674> <0676> <B543>\n<0677> <0679> <B54B>\n<067C> <067D> <B55C>\n<067E> <0680> <B55F>\n<0681> <0682> <B5A0>\n<0685> <0686> <B5AA>\n<0687> <0688> <B5B0>\n<0689> <068B> <B5B3>\n<068C> <068E> <B5BB>\n<0691> <0692> <B5CC>\n<0693> <0695> <B5CF>\n<0698> <0699> <B610>\n<06A2> <06A3> <B69C>\n<06A6> <06A7> <B6AB>\n<06AD> <06AE> <B700>\n<06B0> <06B1> <B728>\n<06B3> <06B4> <B72F>\n<06B5> <06B6> <B738>\n<06BB> <06BC> <B754>\n<06C0> <06C1> <B770>\n<06C4> <06C5> <B77C>\n<06C8> <06C9> <B78C>\n<06CA> <06CD> <B78F>\n<06CE> <06D1> <B796>\n<06D4> <06D5> <B7A8>\n<06D6> <06D8> <B7AB>\n<06D9> <06DA> <B7B4>\n<06DE> <06DF> <B7EC>\n<06E2> <06E3> <B7FC>\n<06E4> <06E6> <B7FF>\n<06E7> <06E9> <B807>\n<06EC> <06ED> <B818>\n<06F0> <06F1> <B824>\n<06F4> <06F5> <B834>\n<06F6> <06F8> <B837>\n<06FD> <06FE> <B85C>\n<0701> <0702> <B86C>\n<070C> <070D> <B8C0>\n<0716> <0717> <B8E8>\n<071A> <071B> <B8F8>\n<0721> <0722> <B93C>\n<0728> <0729> <B958>\n<072C> <072D> <B968>\n<0730> <0731> <B974>\n<0734> <0735> <B984>\n<0737> <0738> <B989>\n<0739> <073A> <B98D>\n<073B> <073C> <B9AC>\n<073F> <0740> <B9BC>\n<0743> <0744> <B9C8>\n<0746> <074A> <B9CE>\n<074B> <074C> <B9D8>\n<074E> <074F> <B9DD>\n<0751> <0753> <B9E3>\n<0756> <0757> <B9F4>\n<0758> <075B> <B9F7>\n<075C> <075D> <BA00>\n<0760> <0761> <BA38>\n<0765> <0766> <BA48>\n<0768> <0769> <BA4D>\n<076A> <076C> <BA53>\n<076F> <0770> <BA64>\n<0771> <0773> <BA67>\n<0774> <0775> <BA70>\n<0778> <077A> <BA83>\n<077D> <077E> <BAA8>\n<077F> <0780> <BAAB>\n<0783> <0784> <BAB8>\n<0789> <078A> <BAD8>\n<0796> <0798> <BB34>\n<079A> <079D> <BB3B>\n<079E> <079F> <BB44>\n<07A3> <07A4> <BB4F>\n<07B7> <07B8> <BBF8>\n<07BA> <07BB> <BBFF>\n<07BD> <07BE> <BC08>\n<07BF> <07C1> <BC0B>\n<07C4> <07C8> <BC14>\n<07C9> <07CD> <BC1B>\n<07CE> <07CF> <BC24>\n<07D3> <07D4> <BC30>\n<07D7> <07D8> <BC40>\n<07D9> <07DB> <BC43>\n<07DD> <07DE> <BC4C>\n<07E1> <07E2> <BC84>\n<07E4> <07E5> <BC8B>\n<07E7> <07E8> <BC94>\n<07EA> <07EB> <BC99>\nendbfrange\n\n100 beginbfrange\n<07EC> <07ED> <BCA0>\n<07EF> <07F0> <BCA7>\n<07F1> <07F2> <BCB0>\n<07F3> <07F5> <BCB3>\n<07F6> <07F7> <BCBC>\n<07FB> <07FD> <BCCF>\n<0801> <0803> <BCF4>\n<0806> <0807> <BD04>\n<080F> <0810> <BD48>\n<0813> <0814> <BD58>\n<0817> <0818> <BD80>\n<081A> <081D> <BD87>\n<081E> <081F> <BD90>\n<0822> <0823> <BD99>\n<0828> <0829> <BDD4>\n<0833> <0834> <BE0C>\n<0837> <0838> <BE1C>\n<083A> <083B> <BE44>\n<083F> <0840> <BE54>\n<0842> <0844> <BE59>\n<0845> <0846> <BE60>\n<084A> <084B> <BE70>\n<084C> <084E> <BE73>\n<084F> <0851> <BE7B>\n<0854> <0855> <BE8C>\n<0856> <0858> <BE8F>\n<0859> <085A> <BE98>\n<085C> <085D> <BED0>\n<085F> <0860> <BED7>\n<0862> <0864> <BEE3>\n<0867> <0868> <BF08>\n<0869> <086A> <BF18>\n<086B> <086D> <BF1B>\n<086E> <086F> <BF40>\n<0872> <0873> <BF50>\n<0878> <0879> <BFCC>\n<0884> <0885> <C068>\n<0886> <0887> <C090>\n<088A> <088B> <C0A0>\n<088E> <088F> <C0AC>\n<0890> <0891> <C0AF>\n<0892> <0895> <C0B3>\n<0896> <0897> <C0BC>\n<0898> <089A> <C0BF>\n<089C> <089D> <C0C8>\n<08A0> <08A1> <C0D8>\n<08A2> <08A4> <C0DB>\n<08A5> <08A6> <C0E4>\n<08A9> <08AA> <C0F4>\n<08B2> <08B6> <C11C>\n<08B7> <08B8> <C123>\n<08B9> <08BA> <C126>\n<08BB> <08BC> <C12C>\n<08BD> <08BF> <C12F>\n<08C1> <08C2> <C138>\n<08C5> <08C6> <C148>\n<08C7> <08C9> <C14B>\n<08CA> <08CB> <C154>\n<08CE> <08CF> <C164>\n<08D0> <08D2> <C167>\n<08D7> <08D9> <C18C>\n<08DD> <08DE> <C19C>\n<08E2> <08E3> <C1A8>\n<08EB> <08EC> <C1D7>\n<08F0> <08F1> <C1F0>\n<08F3> <08F4> <C1FC>\n<08F7> <08F8> <C20C>\n<08FB> <08FC> <C218>\n<08FE> <08FF> <C21F>\n<0900> <0901> <C228>\n<0905> <0906> <C231>\n<0909> <090A> <C250>\n<090F> <0910> <C26C>\n<0913> <0914> <C27C>\n<0917> <0918> <C288>\n<091D> <091E> <C2A4>\n<0920> <0921> <C2AC>\n<0922> <0923> <C2B4>\n<0926> <0927> <C2DC>\n<0929> <092A> <C2E3>\n<092B> <092D> <C2EB>\n<0931> <0932> <C2F8>\n<0933> <0934> <C2FB>\n<0936> <0937> <C308>\n<0938> <0939> <C30C>\n<093A> <093C> <C313>\n<093F> <0940> <C324>\n<0941> <0942> <C328>\n<0944> <0945> <C368>\n<0949> <094A> <C378>\n<094B> <094C> <C37C>\n<0951> <0952> <C3D8>\n<0954> <0955> <C3DF>\n<0957> <0958> <C3E8>\n<095A> <095B> <C3F4>\n<0963> <0964> <C43C>\n<0966> <0967> <C464>\n<096A> <096B> <C474>\n<0973> <0974> <C4F0>\n<0978> <097A> <C4FF>\nendbfrange\n\n100 beginbfrange\n<097F> <0980> <C528>\n<0983> <0984> <C538>\n<0987> <0988> <C544>\n<0989> <098B> <C548>\n<098C> <098E> <C54C>\n<098F> <0991> <C553>\n<0992> <0994> <C557>\n<0995> <0996> <C55D>\n<0997> <0998> <C560>\n<099B> <099C> <C570>\n<099D> <099F> <C573>\n<09A0> <09A1> <C57C>\n<09A5> <09A6> <C58C>\n<09AA> <09AB> <C597>\n<09AF> <09B0> <C5B4>\n<09B1> <09B2> <C5B8>\n<09B3> <09B6> <C5BB>\n<09B7> <09BD> <C5C4>\n<09C0> <09C1> <C5D0>\n<09C4> <09C5> <C5E0>\n<09C8> <09CA> <C5EC>\n<09CD> <09CE> <C5F6>\n<09CF> <09D4> <C5FC>\n<09D5> <09D8> <C605>\n<09DB> <09DC> <C618>\n<09DD> <09DE> <C61B>\n<09DF> <09E0> <C624>\n<09E2> <09E4> <C62C>\n<09E6> <09E8> <C633>\n<09EC> <09ED> <C640>\n<09F0> <09F1> <C650>\n<09F2> <09F4> <C653>\n<09F5> <09F6> <C65C>\n<09FB> <09FC> <C678>\n<0A03> <0A04> <C694>\n<0A07> <0A08> <C6A4>\n<0A0B> <0A0C> <C6B0>\n<0A0E> <0A10> <C6B8>\n<0A11> <0A12> <C6C0>\n<0A15> <0A16> <C6CC>\n<0A19> <0A1A> <C6DC>\n<0A1B> <0A1C> <C6E0>\n<0A1D> <0A1E> <C6E8>\n<0A21> <0A22> <C6F8>\n<0A24> <0A25> <C704>\n<0A28> <0A29> <C714>\n<0A2C> <0A2D> <C720>\n<0A30> <0A31> <C730>\n<0A35> <0A36> <C73C>\n<0A3A> <0A3B> <C74C>\n<0A3D> <0A44> <C751>\n<0A49> <0A4A> <C774>\n<0A4C> <0A4E> <C77C>\n<0A4F> <0A51> <C783>\n<0A52> <0A55> <C787>\n<0A57> <0A58> <C790>\n<0A5A> <0A5C> <C796>\n<0A5E> <0A5F> <C7A0>\n<0A60> <0A63> <C7A3>\n<0A64> <0A65> <C7AC>\n<0A68> <0A69> <C7BC>\n<0A6A> <0A6C> <C7BF>\n<0A6D> <0A6E> <C7C8>\n<0A77> <0A78> <C800>\n<0A7C> <0A7D> <C810>\n<0A7F> <0A80> <C815>\n<0A81> <0A82> <C81C>\n<0A85> <0A86> <C82C>\n<0A8C> <0A8D> <C848>\n<0A8E> <0A8F> <C84C>\n<0A91> <0A92> <C870>\n<0A96> <0A97> <C880>\n<0A99> <0A9B> <C885>\n<0A9C> <0A9E> <C88B>\n<0AA4> <0AA5> <C8BC>\n<0AA9> <0AAA> <C8D4>\n<0AAD> <0AAE> <C8E0>\n<0AB1> <0AB2> <C8FC>\n<0AB4> <0AB6> <C904>\n<0AB7> <0AB8> <C90C>\n<0ABE> <0ABF> <C950>\n<0AC2> <0AC3> <C960>\n<0AC9> <0ACA> <C988>\n<0ACD> <0ACE> <C998>\n<0AD1> <0AD2> <C9C0>\n<0AD4> <0AD5> <C9C7>\n<0AD7> <0AD8> <C9D0>\n<0ADA> <0ADB> <C9D5>\n<0ADC> <0ADD> <C9D9>\n<0ADE> <0ADF> <C9DC>\n<0AE4> <0AE5> <C9EC>\n<0AE6> <0AE8> <C9EF>\n<0AE9> <0AEA> <C9F8>\n<0AED> <0AEE> <CA08>\n<0AEF> <0AF1> <CA0B>\n<0AF5> <0AF6> <CA4C>\n<0AF9> <0AFA> <CA5C>\n<0AFB> <0AFD> <CA5F>\n<0B02> <0B03> <CABC>\n<0B06> <0B07> <CACC>\nendbfrange\n\n100 beginbfrange\n<0B0B> <0B0C> <CAD8>\n<0B14> <0B15> <CB20>\n<0B17> <0B18> <CB48>\n<0B1B> <0B1C> <CB58>\n<0B1F> <0B20> <CB78>\n<0B27> <0B28> <CC0C>\n<0B2B> <0B2C> <CC1C>\n<0B2D> <0B2E> <CC21>\n<0B2F> <0B31> <CC27>\n<0B35> <0B36> <CC38>\n<0B37> <0B3A> <CC3B>\n<0B3B> <0B3C> <CC44>\n<0B3F> <0B40> <CC54>\n<0B41> <0B43> <CC57>\n<0B4A> <0B4B> <CC98>\n<0B4E> <0B4F> <CCA8>\n<0B50> <0B52> <CCAB>\n<0B53> <0B54> <CCB4>\n<0B57> <0B58> <CCC4>\n<0B61> <0B62> <CD08>\n<0B65> <0B66> <CD18>\n<0B70> <0B71> <CD6C>\n<0B76> <0B77> <CD94>\n<0B7A> <0B7B> <CDA4>\n<0B85> <0B86> <CDF8>\n<0B8E> <0B8F> <CE20>\n<0B92> <0B93> <CE30>\n<0B96> <0B97> <CE58>\n<0B99> <0B9B> <CE5F>\n<0B9C> <0B9D> <CE68>\n<0BA0> <0BA1> <CE74>\n<0BA4> <0BA5> <CE84>\n<0BA8> <0BA9> <CE90>\n<0BAC> <0BAD> <CEA0>\n<0BAE> <0BB0> <CEA3>\n<0BB1> <0BB2> <CEAC>\n<0BB4> <0BB5> <CEE4>\n<0BB7> <0BB8> <CEEB>\n<0BB9> <0BBA> <CEF4>\n<0BBB> <0BBD> <CEF7>\n<0BBE> <0BBF> <CF00>\n<0BC2> <0BC3> <CF10>\n<0BC9> <0BCA> <CF2C>\n<0BCB> <0BCD> <CF2F>\n<0BCF> <0BD0> <CF54>\n<0BD3> <0BD4> <CF64>\n<0BD7> <0BD8> <CF70>\n<0BE2> <0BE3> <CFE0>\n<0BE6> <0BE7> <CFF0>\n<0BF0> <0BF1> <D034>\n<0BF4> <0BF5> <D044>\n<0BFC> <0BFD> <D06C>\n<0C00> <0C01> <D07C>\n<0C03> <0C04> <D0A4>\n<0C07> <0C08> <D0B4>\n<0C0B> <0C0C> <D0C0>\n<0C0E> <0C0F> <D0C8>\n<0C10> <0C11> <D0D0>\n<0C12> <0C14> <D0D3>\n<0C15> <0C16> <D0DC>\n<0C19> <0C1A> <D0EC>\n<0C1B> <0C1D> <D0EF>\n<0C20> <0C21> <D130>\n<0C25> <0C26> <D140>\n<0C27> <0C29> <D143>\n<0C2A> <0C2B> <D14C>\n<0C2E> <0C2F> <D15C>\n<0C37> <0C38> <D1A0>\n<0C3B> <0C3C> <D1B0>\n<0C48> <0C49> <D22C>\n<0C4C> <0C4D> <D23C>\n<0C53> <0C54> <D280>\n<0C57> <0C58> <D290>\n<0C5F> <0C60> <D2B8>\n<0C62> <0C63> <D2BF>\n<0C65> <0C66> <D2C8>\n<0C6B> <0C6C> <D2E4>\n<0C6D> <0C6E> <D2F0>\n<0C71> <0C72> <D300>\n<0C75> <0C77> <D30C>\n<0C7B> <0C7C> <D31C>\n<0C7D> <0C7F> <D31F>\n<0C81> <0C82> <D328>\n<0C85> <0C86> <D338>\n<0C87> <0C89> <D33B>\n<0C8A> <0C8B> <D344>\n<0C8C> <0C8D> <D37C>\n<0C90> <0C91> <D38C>\n<0C92> <0C94> <D38F>\n<0C95> <0C96> <D398>\n<0C99> <0C9A> <D3A8>\n<0CA0> <0CA1> <D3C4>\n<0CA2> <0CA3> <D3C8>\n<0CA8> <0CA9> <D3EC>\n<0CAC> <0CAD> <D3FC>\n<0CB9> <0CBA> <D478>\n<0CBC> <0CBD> <D47F>\n<0CBF> <0CC0> <D488>\n<0CD3> <0CD4> <D514>\n<0CD6> <0CD7> <D53C>\nendbfrange\n\n100 beginbfrange\n<0CDA> <0CDB> <D54C>\n<0CDE> <0CDF> <D558>\n<0CE3> <0CE4> <D568>\n<0CE7> <0CE8> <D574>\n<0CEB> <0CEC> <D584>\n<0CED> <0CEF> <D587>\n<0CF2> <0CF3> <D5C8>\n<0CF7> <0CF8> <D5D8>\n<0CFB> <0CFC> <D5E4>\n<0D03> <0D04> <D600>\n<0D07> <0D08> <D610>\n<0D09> <0D0B> <D613>\n<0D10> <0D11> <D638>\n<0D15> <0D16> <D648>\n<0D1A> <0D1B> <D654>\n<0D20> <0D21> <D670>\n<0D25> <0D26> <D68C>\n<0D31> <0D32> <D6C4>\n<0D3E> <0D3F> <D6FC>\n<0D43> <0D44> <D718>\n<0D47> <0D48> <D728>\n<0D4B> <0D4C> <D734>\n<0D52> <0D53> <D750>\n<0D55> <0D58> <D756>\n<0D59> <0D5A> <D760>\n<0D61> <0D62> <D77C>\n<0D64> <0D65> <D788>\n<0D68> <0D69> <D798>\n<0D78> <0D79> <67B6>\n<0DC7> <0DC8> <9451>\n<0FCF> <0FD0> <887E>\n<0FF3> <0FF4> <671E>\n<1008> <1009> <7947>\n<101A> <101B> <9A0E>\n<125A> <125B> <5FD8>\n<12A2> <12A3> <6478>\n<12EA> <12EB> <7D0A>\n<130B> <130C> <65FB>\n<1375> <1376> <88F4>\n<1381> <1382> <767D>\n<13E8> <13E9> <5CEF>\n<140D> <140E> <8150>\n<144D> <144F> <6BD6>\n<15F4> <15F5> <96A7>\n<17D5> <17D6> <7AA9>\n<1853> <1854> <96E8>\n<18AD> <18AE> <5E7C>\n<18B2> <18B3> <6108>\n<18B9> <18BA> <6961>\n<18BF> <18C0> <7336>\n<1BAD> <1BAE> <6158>\n<1DDD> <1DDE> <9591>\n<1EC7> <1EC8> <78BA>\n<1EE7> <1EE8> <6643>\n<1F71> <1F72> <71B9>\n<1F78> <1F79> <3001>\n<1F7F> <1F80> <3014>\n<1F81> <1F8A> <3008>\n<1F8D> <1F8E> <FF08>\n<1F91> <1F96> <FF1A>\n<1F9A> <1F9D> <FF5B>\n<1F9E> <1FFB> <0020>\n<2005> <2006> <300E>\n<2007> <2008> <300A>\n<2009> <200A> <3008>\n<200B> <200C> <0028>\n<2015> <2016> <0028>\n<2019> <201A> <3016>\n<201B> <201E> <3016>\n<2027> <2028> <2020>\n<202F> <2030> <02D6>\n<2037> <2038> <003C>\n<203A> <203B> <207D>\n<2040> <2041> <2229>\n<2047> <2049> <3021>\n<2054> <2055> <3014>\n<205B> <205C> <3001>\n<2061> <2062> <0028>\n<2063> <2064> <3016>\n<2065> <2066> <3010>\n<2096> <209F> <278A>\n<20C4> <20DD> <24B6>\n<211C> <211D> <22CE>\n<211F> <2120> <2280>\n<2121> <2124> <2270>\n<2129> <212A> <2276>\n<212C> <212D> <22DA>\n<2145> <214D> <2460>\n<21A4> <21A7> <3008>\n<21E1> <21EA> <2776>\n<220F> <2210> <2225>\n<2214> <2215> <2266>\n<2217> <2219> <2295>\n<2229> <222A> <226E>\n<2258> <225B> <2494>\n<2267> <2268> <2190>\n<226A> <226D> <2196>\n<22C0> <22C1> <21C4>\n<2352> <2356> <2483>\n<23E6> <23E9> <21E0>\nendbfrange\n\n100 beginbfrange\n<2455> <245A> <328A>\n<2462> <2465> <300C>\n<2467> <2468> <21E6>\n<2475> <2476> <AC02>\n<2477> <2478> <AC05>\n<2479> <247D> <AC0B>\n<247F> <2480> <AC1E>\n<2481> <2483> <AC21>\n<2484> <248A> <AC25>\n<248C> <2491> <AC32>\n<2492> <2493> <AC3A>\n<2494> <2496> <AC3D>\n<2497> <24A0> <AC41>\n<24A2> <24A7> <AC4E>\n<24A8> <24AA> <AC55>\n<24AB> <24AD> <AC59>\n<24AE> <24C0> <AC5D>\n<24C1> <24C2> <AC72>\n<24C3> <24C4> <AC75>\n<24C6> <24CA> <AC7B>\n<24CC> <24CD> <AC87>\n<24CE> <24D0> <AC8D>\n<24D1> <24D3> <AC91>\n<24D4> <24DA> <AC95>\n<24DC> <24E1> <ACA2>\n<24E3> <24E4> <ACAD>\n<24E5> <24EB> <ACB1>\n<24ED> <24EF> <ACBE>\n<24F0> <24F1> <ACC2>\n<24F2> <24F4> <ACC5>\n<24F5> <24F7> <ACC9>\n<24F8> <24FF> <ACCD>\n<2501> <2508> <ACD8>\n<2509> <250A> <ACE2>\n<250B> <250C> <ACE5>\n<250F> <2510> <ACED>\n<2513> <2517> <ACF7>\n<2518> <2519> <ACFE>\n<251A> <251C> <AD01>\n<251E> <2522> <AD07>\n<2525> <252A> <AD12>\n<252B> <252D> <AD19>\n<252E> <2530> <AD1D>\n<2531> <2538> <AD21>\n<2539> <253A> <AD2A>\n<253B> <2540> <AD2E>\n<2541> <2542> <AD36>\n<2543> <2545> <AD39>\n<2546> <254C> <AD3D>\n<254F> <2554> <AD4A>\n<2555> <2557> <AD51>\n<2558> <255A> <AD55>\n<255B> <2562> <AD59>\n<2564> <256B> <AD64>\n<256C> <256D> <AD6E>\n<256E> <256F> <AD71>\n<2570> <2573> <AD77>\n<2576> <257A> <AD83>\n<257B> <257C> <AD8A>\n<257D> <257F> <AD8D>\n<2580> <258A> <AD91>\n<258B> <2590> <AD9E>\n<2591> <25A2> <ADA5>\n<25A3> <25AA> <ADB8>\n<25AB> <25AC> <ADC2>\n<25AD> <25AF> <ADC5>\n<25B0> <25B6> <ADC9>\n<25B8> <25BF> <ADD4>\n<25C0> <25C2> <ADDD>\n<25C3> <25C5> <ADE1>\n<25C6> <25D8> <ADE5>\n<25D9> <25DA> <ADFA>\n<25DB> <25DC> <ADFD>\n<25DD> <25E2> <AE02>\n<25E5> <25EA> <AE0E>\n<25EB> <25FF> <AE15>\n<2600> <2605> <AE2A>\n<2606> <2607> <AE32>\n<2608> <2609> <AE35>\n<260B> <260F> <AE3B>\n<2612> <2614> <AE47>\n<2617> <2619> <AE51>\n<261B> <261F> <AE57>\n<2621> <2623> <AE62>\n<2624> <2625> <AE66>\n<2626> <2627> <AE6A>\n<2628> <262A> <AE6D>\n<262B> <2631> <AE71>\n<2633> <2638> <AE7E>\n<2639> <263E> <AE86>\n<263F> <266D> <AE8D>\n<266F> <2671> <AEC1>\n<2672> <2678> <AEC5>\n<267A> <267F> <AED2>\n<2680> <2681> <AEDA>\n<2682> <268C> <AEDD>\n<268D> <268E> <AEE9>\n<2690> <2695> <AEEE>\n<2696> <2698> <AEF5>\n<2699> <269B> <AEF9>\nendbfrange\n\n100 beginbfrange\n<269C> <26A5> <AEFD>\n<26A6> <26A9> <AF09>\n<26AA> <26AB> <AF0E>\n<26AC> <26C6> <AF11>\n<26C7> <26C8> <AF2E>\n<26CB> <26D1> <AF35>\n<26D4> <26D7> <AF44>\n<26D8> <26DD> <AF4A>\n<26DE> <26E8> <AF51>\n<26E9> <26EE> <AF5E>\n<26EF> <26FF> <AF66>\n<2700> <2701> <AF77>\n<2702> <2707> <AF7A>\n<2708> <270A> <AF81>\n<270B> <270D> <AF85>\n<270E> <2714> <AF89>\n<2715> <2717> <AF92>\n<2718> <271D> <AF96>\n<271E> <2738> <AF9D>\n<2739> <273A> <AFBA>\n<273B> <273D> <AFBD>\n<273E> <2743> <AFC1>\n<2746> <274A> <AFCF>\n<274B> <2751> <AFD5>\n<2752> <275C> <AFDD>\n<275D> <2762> <AFEA>\n<2763> <2764> <AFF2>\n<2765> <2767> <AFF5>\n<2768> <276E> <AFF9>\n<276F> <2770> <B002>\n<2771> <2777> <B005>\n<2778> <277A> <B00D>\n<277B> <277D> <B011>\n<277E> <2784> <B015>\n<2785> <278E> <B01E>\n<278F> <27A9> <B029>\n<27AA> <27AB> <B046>\n<27AF> <27B2> <B04F>\n<27B5> <27B7> <B05A>\n<27B8> <27D5> <B05E>\n<27D6> <27D7> <B07E>\n<27D8> <27DA> <B081>\n<27DB> <27E1> <B085>\n<27E4> <27E9> <B092>\n<27EB> <27EC> <B09D>\n<27ED> <27F1> <B0A3>\n<27F5> <27F6> <B0B6>\n<27F7> <27F9> <B0B9>\n<27FA> <27FF> <B0BD>\n<2802> <2807> <B0CA>\n<2808> <2809> <B0D2>\n<280A> <280C> <B0D5>\n<280D> <2813> <B0D9>\n<2814> <2817> <B0E1>\n<2818> <2839> <B0E6>\n<283B> <283D> <B10D>\n<283F> <2842> <B114>\n<2844> <2848> <B11E>\n<2849> <284A> <B126>\n<284B> <284D> <B129>\n<284E> <2854> <B12D>\n<2856> <285B> <B13A>\n<285C> <285D> <B142>\n<285E> <2860> <B145>\n<2861> <2867> <B149>\n<2868> <2869> <B152>\n<286A> <286B> <B156>\n<286C> <286E> <B159>\n<286F> <2871> <B15D>\n<2872> <2888> <B161>\n<2889> <288A> <B17A>\n<288B> <288D> <B17D>\n<288F> <2893> <B183>\n<2896> <2899> <B18E>\n<289A> <289C> <B195>\n<289D> <289F> <B199>\n<28A0> <28AA> <B19D>\n<28AB> <28CD> <B1A9>\n<28CE> <28D0> <B1CD>\n<28D1> <28D3> <B1D1>\n<28D4> <28DA> <B1D5>\n<28DC> <28E3> <B1E0>\n<28E4> <28E5> <B1EA>\n<28E6> <28E8> <B1ED>\n<28E9> <28F0> <B1F1>\n<28F3> <28F8> <B1FE>\n<28F9> <28FA> <B206>\n<28FB> <28FC> <B209>\n<28FD> <28FF> <B20D>\n<2900> <2903> <B210>\n<2906> <290B> <B21A>\n<290C> <291E> <B221>\n<291F> <2925> <B235>\n<2926> <2940> <B23D>\n<2941> <2943> <B259>\n<2944> <2946> <B25D>\n<2947> <294D> <B261>\n<294E> <2957> <B26A>\n<2958> <295D> <B276>\n<295E> <2964> <B27D>\nendbfrange\n\n100 beginbfrange\n<2965> <2967> <B286>\n<2968> <296D> <B28A>\n<296E> <296F> <B292>\n<2970> <2972> <B295>\n<2973> <2977> <B29B>\n<297A> <297C> <B2A7>\n<297E> <2980> <B2AD>\n<2981> <2983> <B2B1>\n<2984> <2996> <B2B5>\n<2997> <2998> <B2CA>\n<2999> <299B> <B2CD>\n<299D> <29A1> <B2D3>\n<29A4> <29A7> <B2DE>\n<29AA> <29AB> <B2E9>\n<29AC> <29AE> <B2F0>\n<29B0> <29B2> <B2FC>\n<29B3> <29B4> <B302>\n<29B5> <29B7> <B305>\n<29B8> <29BE> <B309>\n<29C0> <29C5> <B316>\n<29C6> <29FC> <B31D>\n<29FE> <29FF> <B359>\n<2A01> <2A04> <B360>\n<2A08> <2A09> <B36C>\n<2A0B> <2A0C> <B372>\n<2A0D> <2A0F> <B375>\n<2A10> <2A16> <B379>\n<2A18> <2A1D> <B386>\n<2A1E> <2A20> <B38D>\n<2A21> <2A23> <B391>\n<2A24> <2A2E> <B395>\n<2A2F> <2A34> <B3A2>\n<2A35> <2A37> <B3A9>\n<2A38> <2A4E> <B3AD>\n<2A4F> <2A50> <B3C6>\n<2A51> <2A52> <B3C9>\n<2A55> <2A57> <B3D1>\n<2A5C> <2A5D> <B3DE>\n<2A5E> <2A60> <B3E1>\n<2A61> <2A63> <B3E5>\n<2A64> <2A76> <B3E9>\n<2A77> <2A89> <B3FD>\n<2A8A> <2A90> <B411>\n<2A91> <2A93> <B419>\n<2A94> <2A96> <B41D>\n<2A97> <2A9D> <B421>\n<2A9F> <2AA6> <B42C>\n<2AA7> <2AC1> <B435>\n<2AC2> <2AC3> <B452>\n<2AC4> <2AC6> <B455>\n<2AC7> <2ACD> <B459>\n<2AD0> <2AD5> <B466>\n<2AD6> <2AE8> <B46D>\n<2AE9> <2AEF> <B481>\n<2AF0> <2AFF> <B489>\n<2B00> <2B03> <B499>\n<2B04> <2B09> <B49E>\n<2B0A> <2B0C> <B4A5>\n<2B0D> <2B0F> <B4A9>\n<2B10> <2B17> <B4AD>\n<2B1A> <2B1F> <B4BA>\n<2B20> <2B22> <B4C1>\n<2B23> <2B25> <B4C5>\n<2B26> <2B2C> <B4C9>\n<2B2D> <2B30> <B4D1>\n<2B31> <2B36> <B4D6>\n<2B37> <2B38> <B4DE>\n<2B39> <2B3A> <B4E1>\n<2B3C> <2B40> <B4E7>\n<2B43> <2B48> <B4F2>\n<2B49> <2B63> <B4F9>\n<2B64> <2B65> <B516>\n<2B66> <2B67> <B519>\n<2B68> <2B6E> <B51D>\n<2B70> <2B74> <B52B>\n<2B75> <2B76> <B532>\n<2B77> <2B79> <B535>\n<2B7A> <2B80> <B539>\n<2B82> <2B86> <B546>\n<2B87> <2B88> <B54E>\n<2B89> <2B8B> <B551>\n<2B8C> <2B92> <B555>\n<2B94> <2BD1> <B562>\n<2BD2> <2BD3> <B5A2>\n<2BD4> <2BD6> <B5A5>\n<2BD8> <2BDB> <B5AC>\n<2BDD> <2BE1> <B5B6>\n<2BE2> <2BE3> <B5BE>\n<2BE4> <2BE6> <B5C1>\n<2BE7> <2BED> <B5C5>\n<2BEF> <2BF4> <B5D2>\n<2BF5> <2BFF> <B5D9>\n<2C00> <2C07> <B5E4>\n<2C08> <2C2A> <B5ED>\n<2C2B> <2C2C> <B612>\n<2C2D> <2C2F> <B615>\n<2C30> <2C3B> <B619>\n<2C3C> <2C41> <B626>\n<2C42> <2C48> <B62D>\n<2C49> <2C5B> <B635>\nendbfrange\n\n100 beginbfrange\n<2C5C> <2C76> <B649>\n<2C77> <2C79> <B665>\n<2C7A> <2CAC> <B669>\n<2CAD> <2CAE> <B69E>\n<2CAF> <2CB1> <B6A1>\n<2CB2> <2CB7> <B6A5>\n<2CB8> <2CBB> <B6AD>\n<2CBC> <2CDD> <B6B2>\n<2CDE> <2CF8> <B6D5>\n<2CF9> <2CFB> <B6F1>\n<2CFC> <2CFE> <B6F5>\n<2D00> <2D05> <B6FA>\n<2D06> <2D08> <B702>\n<2D09> <2D2A> <B706>\n<2D2B> <2D2C> <B72A>\n<2D2D> <2D2E> <B72D>\n<2D2F> <2D35> <B731>\n<2D37> <2D3E> <B73C>\n<2D3F> <2D41> <B745>\n<2D42> <2D44> <B749>\n<2D45> <2D4B> <B74D>\n<2D4C> <2D55> <B756>\n<2D56> <2D58> <B761>\n<2D59> <2D5B> <B765>\n<2D5C> <2D62> <B769>\n<2D65> <2D6A> <B776>\n<2D6B> <2D6C> <B77E>\n<2D6D> <2D6F> <B781>\n<2D70> <2D76> <B785>\n<2D78> <2D7A> <B793>\n<2D7B> <2D7C> <B79A>\n<2D7D> <2D7F> <B79D>\n<2D80> <2D86> <B7A1>\n<2D88> <2D8D> <B7AE>\n<2D8E> <2D8F> <B7B6>\n<2D90> <2D9D> <B7B9>\n<2D9F> <2DC0> <B7CA>\n<2DC1> <2DC2> <B7EE>\n<2DC3> <2DC5> <B7F1>\n<2DC6> <2DCC> <B7F5>\n<2DCE> <2DD2> <B802>\n<2DD3> <2DD4> <B80A>\n<2DD5> <2DD7> <B80D>\n<2DD8> <2DDE> <B811>\n<2DE1> <2DE6> <B81E>\n<2DE7> <2DE8> <B826>\n<2DE9> <2DEB> <B829>\n<2DEC> <2DF2> <B82D>\n<2DF4> <2DF9> <B83A>\n<2DFA> <2DFC> <B841>\n<2DFD> <2DFF> <B845>\n<2E00> <2E08> <B848>\n<2E0A> <2E11> <B854>\n<2E12> <2E13> <B85E>\n<2E14> <2E16> <B861>\n<2E17> <2E1D> <B865>\n<2E20> <2E25> <B872>\n<2E26> <2E28> <B879>\n<2E29> <2E38> <B87D>\n<2E39> <2E52> <B88E>\n<2E53> <2E59> <B8A9>\n<2E5A> <2E5C> <B8B1>\n<2E5D> <2E5F> <B8B5>\n<2E60> <2E66> <B8B9>\n<2E69> <2E6E> <B8C6>\n<2E6F> <2E71> <B8CD>\n<2E72> <2E74> <B8D1>\n<2E75> <2E7C> <B8D5>\n<2E7F> <2E84> <B8E2>\n<2E85> <2E86> <B8EA>\n<2E87> <2E89> <B8ED>\n<2E8A> <2E90> <B8F1>\n<2E93> <2E98> <B8FE>\n<2E99> <2EAB> <B905>\n<2EAC> <2EB2> <B919>\n<2EB3> <2ECD> <B921>\n<2ECE> <2ECF> <B93E>\n<2ED0> <2ED2> <B941>\n<2ED3> <2ED9> <B945>\n<2EDA> <2EDB> <B94D>\n<2EDD> <2EE2> <B952>\n<2EE3> <2EE4> <B95A>\n<2EE5> <2EE7> <B95D>\n<2EE8> <2EEE> <B961>\n<2EF1> <2EF6> <B96E>\n<2EF7> <2EF8> <B976>\n<2EF9> <2EFB> <B979>\n<2EFC> <2EFF> <B97D>\n<2F00> <2F02> <B981>\n<2F05> <2F06> <B98B>\n<2F07> <2F23> <B98F>\n<2F24> <2F25> <B9AE>\n<2F26> <2F28> <B9B1>\n<2F29> <2F2F> <B9B5>\n<2F32> <2F37> <B9C2>\n<2F38> <2F39> <B9CA>\n<2F3B> <2F3F> <B9D3>\n<2F42> <2F43> <B9DF>\n<2F45> <2F46> <B9E6>\n<2F47> <2F49> <B9E9>\nendbfrange\n\n100 beginbfrange\n<2F4A> <2F50> <B9ED>\n<2F52> <2F56> <B9FB>\n<2F57> <2F5C> <BA02>\n<2F5D> <2F68> <BA09>\n<2F69> <2F8A> <BA16>\n<2F8B> <2F8C> <BA3A>\n<2F8D> <2F8F> <BA3D>\n<2F91> <2F95> <BA43>\n<2F98> <2F9B> <BA4F>\n<2F9C> <2F9D> <BA56>\n<2F9E> <2FA0> <BA59>\n<2FA1> <2FA7> <BA5D>\n<2FA9> <2FAE> <BA6A>\n<2FAF> <2FB0> <BA72>\n<2FB1> <2FB3> <BA75>\n<2FB4> <2FBD> <BA79>\n<2FBF> <2FC2> <BA88>\n<2FC3> <2FDD> <BA8D>\n<2FDF> <2FE1> <BAAD>\n<2FE3> <2FE7> <BAB3>\n<2FEA> <2FEF> <BABE>\n<2FF0> <2FF2> <BAC5>\n<2FF3> <2FFF> <BAC9>\n<3000> <3001> <BAD6>\n<3002> <3023> <BADA>\n<3024> <3026> <BAFD>\n<3027> <3029> <BB01>\n<302A> <3031> <BB05>\n<3034> <3039> <BB12>\n<303A> <303C> <BB19>\n<303D> <303F> <BB1D>\n<3040> <3047> <BB21>\n<3049> <3050> <BB2C>\n<3052> <3053> <BB39>\n<3054> <3058> <BB3F>\n<305B> <305D> <BB4A>\n<305F> <3061> <BB51>\n<3062> <3064> <BB55>\n<3065> <306C> <BB59>\n<306E> <3075> <BB64>\n<3076> <3090> <BB6D>\n<3091> <3093> <BB89>\n<3094> <3096> <BB8D>\n<3097> <30A9> <BB91>\n<30AA> <30AC> <BBA5>\n<30AD> <30AF> <BBA9>\n<30B0> <30B6> <BBAD>\n<30B7> <30B8> <BBB5>\n<30B9> <30C0> <BBB8>\n<30C1> <30C3> <BBC1>\n<30C4> <30C6> <BBC5>\n<30C7> <30CD> <BBC9>\n<30CE> <30CF> <BBD1>\n<30D0> <30F3> <BBD4>\n<30F4> <30F5> <BBFA>\n<30F6> <30F7> <BBFD>\n<30F9> <30FD> <BC03>\n<3101> <3102> <BC12>\n<3103> <3104> <BC19>\n<3105> <3108> <BC20>\n<310B> <310D> <BC2A>\n<310E> <310F> <BC2E>\n<3110> <3111> <BC32>\n<3112> <3114> <BC35>\n<3115> <311B> <BC39>\n<311D> <311F> <BC46>\n<3120> <3121> <BC4A>\n<3122> <3123> <BC4E>\n<3124> <312F> <BC51>\n<3130> <3155> <BC5E>\n<3156> <3157> <BC86>\n<3158> <3159> <BC89>\n<315B> <315F> <BC8F>\n<3162> <3166> <BC9B>\n<3167> <3168> <BCA2>\n<3169> <316A> <BCA5>\n<316B> <3171> <BCA9>\n<3173> <3178> <BCB6>\n<3179> <317A> <BCBE>\n<317B> <317D> <BCC1>\n<317E> <3185> <BCC5>\n<3187> <3189> <BCD2>\n<318A> <318B> <BCD6>\n<318C> <318E> <BCD9>\n<318F> <31A5> <BCDD>\n<31A7> <31A9> <BCF9>\n<31AA> <31B0> <BCFD>\n<31B3> <31B8> <BD0A>\n<31B9> <31BB> <BD11>\n<31BC> <31CA> <BD15>\n<31CB> <31D1> <BD25>\n<31D2> <31E4> <BD2D>\n<31E5> <31EB> <BD41>\n<31EC> <31ED> <BD4A>\n<31EE> <31F0> <BD4D>\n<31F1> <31F7> <BD51>\n<31F8> <31FF> <BD5A>\n<3200> <3201> <BD62>\n<3202> <3204> <BD65>\n<3205> <321B> <BD69>\nendbfrange\n\n100 beginbfrange\n<321C> <321D> <BD82>\n<321E> <321F> <BD85>\n<3220> <3224> <BD8B>\n<3227> <3229> <BD96>\n<322B> <3231> <BD9D>\n<3232> <323C> <BDA5>\n<323D> <3243> <BDB1>\n<3244> <325E> <BDB9>\n<325F> <3260> <BDD6>\n<3261> <3263> <BDD9>\n<3264> <326F> <BDDD>\n<3270> <3275> <BDEA>\n<3276> <3278> <BDF1>\n<3279> <327B> <BDF5>\n<327C> <3282> <BDF9>\n<3283> <3284> <BE01>\n<3286> <328B> <BE06>\n<328C> <328D> <BE0E>\n<328E> <3290> <BE11>\n<3291> <3297> <BE15>\n<3299> <32BC> <BE20>\n<32BD> <32BE> <BE46>\n<32BF> <32C1> <BE49>\n<32C3> <32C7> <BE4F>\n<32CA> <32CD> <BE5C>\n<32CE> <32CF> <BE62>\n<32D0> <32D2> <BE65>\n<32D4> <32D8> <BE6B>\n<32DA> <32DE> <BE76>\n<32DF> <32E0> <BE7E>\n<32E1> <32E3> <BE81>\n<32E4> <32EA> <BE85>\n<32EC> <32F1> <BE92>\n<32F2> <32FF> <BE9A>\n<3300> <3326> <BEA9>\n<3327> <3328> <BED2>\n<3329> <332A> <BED5>\n<332B> <3331> <BED9>\n<3332> <3333> <BEE1>\n<3334> <3339> <BEE6>\n<333A> <334D> <BEED>\n<334E> <3353> <BF02>\n<3354> <3361> <BF0A>\n<3363> <3384> <BF1E>\n<3385> <3386> <BF42>\n<3387> <3389> <BF45>\n<338A> <3390> <BF49>\n<3391> <3393> <BF52>\n<3394> <33D1> <BF56>\n<33D2> <33EC> <BF95>\n<33ED> <33FF> <BFB1>\n<3401> <3406> <BFC6>\n<3407> <3408> <BFCE>\n<3409> <340B> <BFD1>\n<340C> <3412> <BFD5>\n<3413> <3414> <BFDD>\n<3416> <346F> <BFE2>\n<3470> <3483> <C03D>\n<3484> <3489> <C052>\n<348A> <348C> <C059>\n<348D> <348F> <C05D>\n<3490> <3496> <C061>\n<3497> <34BC> <C06A>\n<34BD> <34BE> <C092>\n<34BF> <34C1> <C095>\n<34C2> <34C8> <C099>\n<34CB> <34D0> <C0A6>\n<34D2> <34D3> <C0B1>\n<34D4> <34D8> <C0B7>\n<34DA> <34DC> <C0C2>\n<34DD> <34DE> <C0C6>\n<34DF> <34E0> <C0CA>\n<34E1> <34E3> <C0CD>\n<34E4> <34EA> <C0D1>\n<34EC> <34F1> <C0DE>\n<34F2> <34F3> <C0E6>\n<34F4> <34F6> <C0E9>\n<34F7> <34FD> <C0ED>\n<3500> <3505> <C0FA>\n<3506> <3508> <C101>\n<3509> <350B> <C105>\n<350C> <3512> <C109>\n<3513> <3516> <C111>\n<3517> <351C> <C116>\n<351D> <351E> <C121>\n<3520> <3523> <C128>\n<3525> <3528> <C132>\n<352A> <352B> <C13A>\n<352C> <352E> <C13D>\n<352F> <3535> <C141>\n<3537> <353C> <C14E>\n<353D> <353E> <C156>\n<353F> <3541> <C159>\n<3542> <3548> <C15D>\n<354A> <354F> <C16A>\n<3550> <3552> <C171>\n<3553> <3555> <C175>\n<3556> <3561> <C179>\n<3562> <3567> <C186>\n<3569> <356B> <C191>\nendbfrange\n\n100 beginbfrange\n<356D> <3571> <C197>\n<3574> <3576> <C1A2>\n<3577> <3578> <C1A6>\n<3579> <357A> <C1AA>\n<357B> <357D> <C1AD>\n<357E> <3589> <C1B1>\n<358A> <358F> <C1BE>\n<3590> <3592> <C1C5>\n<3593> <3595> <C1C9>\n<3596> <359C> <C1CD>\n<359D> <359E> <C1D5>\n<359F> <35A5> <C1D9>\n<35A6> <35A8> <C1E1>\n<35A9> <35AB> <C1E5>\n<35AC> <35B2> <C1E9>\n<35B4> <35BB> <C1F4>\n<35BC> <35BD> <C1FE>\n<35BE> <35C0> <C201>\n<35C1> <35C7> <C205>\n<35CA> <35CF> <C212>\n<35D0> <35D1> <C21A>\n<35D2> <35D3> <C21D>\n<35D4> <35DA> <C221>\n<35E0> <35F2> <C235>\n<35F3> <35F9> <C249>\n<35FA> <35FB> <C252>\n<35FC> <35FE> <C255>\n<3600> <3605> <C25A>\n<3606> <3609> <C261>\n<360A> <360F> <C266>\n<3610> <3611> <C26E>\n<3612> <3614> <C271>\n<3615> <361B> <C275>\n<361E> <3623> <C282>\n<3624> <3629> <C28A>\n<362A> <3630> <C291>\n<3631> <3632> <C299>\n<3634> <3639> <C29E>\n<363A> <363B> <C2A6>\n<363C> <363E> <C2A9>\n<363F> <3644> <C2AE>\n<3647> <3668> <C2BA>\n<3669> <366A> <C2DE>\n<366B> <366C> <C2E1>\n<366D> <3672> <C2E5>\n<3675> <3678> <C2F2>\n<367B> <367D> <C2FD>\n<367E> <3684> <C301>\n<3685> <3686> <C30A>\n<3687> <368B> <C30E>\n<368C> <368D> <C316>\n<368E> <3690> <C319>\n<3691> <3697> <C31D>\n<3698> <3699> <C326>\n<369A> <36B4> <C32A>\n<36B5> <36D6> <C346>\n<36D7> <36D8> <C36A>\n<36D9> <36DB> <C36D>\n<36DD> <36E1> <C373>\n<36E2> <36E3> <C37A>\n<36E4> <36E9> <C37E>\n<36EA> <36EC> <C385>\n<36ED> <36EF> <C389>\n<36F0> <36FF> <C38D>\n<3700> <3722> <C39D>\n<3723> <3739> <C3C1>\n<373A> <373B> <C3DA>\n<373C> <373D> <C3DD>\n<373F> <3743> <C3E3>\n<3744> <3746> <C3EA>\n<3747> <374C> <C3EE>\n<374D> <374E> <C3F6>\n<374F> <375D> <C3F9>\n<375E> <3764> <C409>\n<3765> <3777> <C411>\n<3778> <377E> <C425>\n<377F> <3781> <C42D>\n<3782> <3784> <C431>\n<3785> <378B> <C435>\n<378C> <3795> <C43E>\n<3796> <37B0> <C449>\n<37B1> <37B2> <C466>\n<37B3> <37B5> <C469>\n<37B6> <37BC> <C46D>\n<37BD> <37BF> <C476>\n<37C0> <37C5> <C47A>\n<37C6> <37D8> <C481>\n<37D9> <37DF> <C495>\n<37E0> <37FA> <C49D>\n<37FB> <37FD> <C4B9>\n<37FE> <37FF> <C4BD>\n<3800> <3829> <C4BF>\n<382A> <382F> <C4EA>\n<3830> <3831> <C4F2>\n<3832> <3834> <C4F5>\n<3836> <3839> <C4FB>\n<383A> <3843> <C502>\n<3844> <3846> <C50D>\n<3847> <3849> <C511>\n<384A> <3850> <C515>\nendbfrange\n\n100 beginbfrange\n<3851> <385B> <C51D>\n<385C> <385D> <C52A>\n<385E> <3860> <C52D>\n<3861> <3867> <C531>\n<386A> <386F> <C53E>\n<3870> <3871> <C546>\n<3873> <3876> <C54F>\n<3878> <387A> <C55A>\n<387C> <387D> <C562>\n<387E> <3880> <C565>\n<3881> <3887> <C569>\n<3889> <388E> <C576>\n<388F> <3890> <C57E>\n<3891> <3893> <C581>\n<3894> <3895> <C585>\n<3896> <3899> <C588>\n<389C> <389E> <C592>\n<38A0> <38A2> <C599>\n<38A3> <38A5> <C59D>\n<38A6> <38AD> <C5A1>\n<38AE> <38B7> <C5AA>\n<38B8> <38B9> <C5B6>\n<38BB> <38BF> <C5BF>\n<38C3> <38C4> <C5D2>\n<38C5> <38C7> <C5D5>\n<38C8> <38CE> <C5D9>\n<38D1> <38D6> <C5E6>\n<38D8> <38DA> <C5F1>\n<38DC> <38DF> <C5F8>\n<38E0> <38E2> <C602>\n<38E3> <38E5> <C609>\n<38E6> <38E8> <C60D>\n<38E9> <38EF> <C611>\n<38F1> <38F7> <C61D>\n<38F8> <38F9> <C626>\n<38FA> <38FC> <C629>\n<38FE> <38FF> <C631>\n<3903> <3906> <C63C>\n<3907> <3908> <C642>\n<3909> <390B> <C645>\n<390C> <3912> <C649>\n<3914> <3919> <C656>\n<391A> <391B> <C65E>\n<391C> <3926> <C661>\n<3927> <3928> <C66D>\n<392A> <392F> <C672>\n<3930> <3931> <C67A>\n<3932> <3934> <C67D>\n<3935> <393B> <C681>\n<393E> <3943> <C68E>\n<3944> <3945> <C696>\n<3946> <3948> <C699>\n<3949> <394F> <C69D>\n<3952> <3957> <C6AA>\n<3958> <3959> <C6B2>\n<395A> <395C> <C6B5>\n<395D> <3961> <C6BB>\n<3964> <3969> <C6C6>\n<396A> <396B> <C6CE>\n<396C> <396E> <C6D1>\n<396F> <3975> <C6D5>\n<3976> <3977> <C6DE>\n<3978> <397D> <C6E2>\n<397E> <397F> <C6EA>\n<3980> <3982> <C6ED>\n<3983> <3989> <C6F1>\n<398A> <398C> <C6FA>\n<398D> <3992> <C6FE>\n<3993> <3994> <C706>\n<3995> <3997> <C709>\n<3998> <399E> <C70D>\n<39A1> <39A6> <C71A>\n<39A7> <39A8> <C722>\n<39A9> <39AB> <C725>\n<39AC> <39B2> <C729>\n<39B6> <39B9> <C738>\n<39BA> <39BB> <C73E>\n<39BC> <39BE> <C741>\n<39BF> <39C3> <C745>\n<39C7> <39C9> <C759>\n<39CA> <39CC> <C75D>\n<39CD> <39D3> <C761>\n<39D4> <39D5> <C769>\n<39D6> <39DD> <C76C>\n<39DE> <39DF> <C776>\n<39E0> <39E2> <C779>\n<39E3> <39E6> <C77F>\n<39E8> <39EA> <C78B>\n<39EC> <39ED> <C792>\n<39F0> <39F4> <C79B>\n<39F6> <39FA> <C7A7>\n<39FB> <39FC> <C7AE>\n<39FD> <39FF> <C7B1>\n<3A00> <3A06> <C7B5>\n<3A08> <3A0D> <C7C2>\n<3A0E> <3A0F> <C7CA>\n<3A12> <3A18> <C7D1>\n<3A19> <3A1C> <C7D9>\n<3A1D> <3A22> <C7DE>\n<3A23> <3A25> <C7E5>\nendbfrange\n\n100 beginbfrange\n<3A26> <3A28> <C7E9>\n<3A29> <3A3B> <C7ED>\n<3A3C> <3A3D> <C802>\n<3A3E> <3A40> <C805>\n<3A42> <3A46> <C80B>\n<3A49> <3A4D> <C817>\n<3A4E> <3A4F> <C81E>\n<3A50> <3A52> <C821>\n<3A53> <3A59> <C825>\n<3A5C> <3A61> <C832>\n<3A62> <3A64> <C839>\n<3A65> <3A67> <C83D>\n<3A68> <3A6E> <C841>\n<3A6F> <3A70> <C84A>\n<3A71> <3A76> <C84E>\n<3A77> <3A91> <C855>\n<3A92> <3A93> <C872>\n<3A94> <3A96> <C875>\n<3A98> <3A9C> <C87B>\n<3A9F> <3AA1> <C888>\n<3AA2> <3AA7> <C88E>\n<3AA8> <3AAF> <C895>\n<3AB2> <3AB7> <C8A2>\n<3AB8> <3ACA> <C8A9>\n<3ACB> <3AD0> <C8BE>\n<3AD1> <3AD3> <C8C5>\n<3AD4> <3AD6> <C8C9>\n<3AD7> <3ADD> <C8CD>\n<3AE0> <3AE5> <C8DA>\n<3AE6> <3AE7> <C8E2>\n<3AE8> <3AF7> <C8E5>\n<3AF8> <3AFD> <C8F6>\n<3AFE> <3AFF> <C8FE>\n<3B00> <3B02> <C901>\n<3B03> <3B07> <C907>\n<3B0A> <3B0F> <C912>\n<3B10> <3B22> <C919>\n<3B23> <3B29> <C92D>\n<3B2A> <3B44> <C935>\n<3B45> <3B46> <C952>\n<3B47> <3B49> <C955>\n<3B4A> <3B50> <C959>\n<3B52> <3B59> <C964>\n<3B5A> <3B5C> <C96D>\n<3B5D> <3B5F> <C971>\n<3B60> <3B66> <C975>\n<3B67> <3B71> <C97D>\n<3B72> <3B73> <C98A>\n<3B74> <3B76> <C98D>\n<3B77> <3B7D> <C991>\n<3B80> <3BA1> <C99E>\n<3BA2> <3BA3> <C9C2>\n<3BA4> <3BA5> <C9C5>\n<3BA7> <3BAB> <C9CB>\n<3BAE> <3BAF> <C9D7>\n<3BB1> <3BB2> <C9DE>\n<3BB5> <3BB6> <C9E5>\n<3BB7> <3BBA> <C9E8>\n<3BBC> <3BC1> <C9F2>\n<3BC2> <3BC3> <C9FA>\n<3BC4> <3BC6> <C9FD>\n<3BC7> <3BCD> <CA01>\n<3BCF> <3BD4> <CA0E>\n<3BD5> <3BD7> <CA15>\n<3BD8> <3BE7> <CA19>\n<3BE8> <3BFF> <CA2A>\n<3C00> <3C09> <CA42>\n<3C0A> <3C0B> <CA4E>\n<3C0C> <3C0E> <CA51>\n<3C0F> <3C15> <CA55>\n<3C17> <3C1C> <CA62>\n<3C1D> <3C30> <CA69>\n<3C31> <3C36> <CA7E>\n<3C37> <3C49> <CA85>\n<3C4A> <3C6C> <CA99>\n<3C6D> <3C6E> <CABE>\n<3C6F> <3C71> <CAC1>\n<3C72> <3C78> <CAC5>\n<3C7C> <3C7F> <CAD4>\n<3C80> <3C85> <CADA>\n<3C86> <3C90> <CAE1>\n<3C91> <3C97> <CAED>\n<3C98> <3CAA> <CAF5>\n<3CAB> <3CB1> <CB09>\n<3CB2> <3CB4> <CB11>\n<3CB5> <3CB7> <CB15>\n<3CB8> <3CBE> <CB19>\n<3CBF> <3CDD> <CB22>\n<3CDE> <3CE3> <CB42>\n<3CE4> <3CE5> <CB4A>\n<3CE6> <3CE8> <CB4D>\n<3CE9> <3CEF> <CB51>\n<3CF0> <3CF2> <CB5A>\n<3CF3> <3CF8> <CB5E>\n<3CF9> <3CFF> <CB65>\n<3D00> <3D0B> <CB6C>\n<3D0C> <3D2D> <CB7A>\n<3D2E> <3D48> <CB9D>\n<3D49> <3D63> <CBB9>\n<3D64> <3D72> <CBD5>\nendbfrange\n\n100 beginbfrange\n<3D73> <3D74> <CBE5>\n<3D76> <3D97> <CBEA>\n<3D98> <3D99> <CC0E>\n<3D9A> <3D9C> <CC11>\n<3D9D> <3DA3> <CC15>\n<3DA4> <3DA6> <CC1E>\n<3DA7> <3DAA> <CC23>\n<3DAB> <3DAC> <CC2A>\n<3DAF> <3DB5> <CC31>\n<3DB7> <3DBB> <CC3F>\n<3DBC> <3DBD> <CC46>\n<3DBE> <3DC0> <CC49>\n<3DC1> <3DC7> <CC4D>\n<3DC9> <3DCE> <CC5A>\n<3DCF> <3DD1> <CC61>\n<3DD4> <3DDA> <CC69>\n<3DDB> <3DDE> <CC71>\n<3DDF> <3DFF> <CC76>\n<3E01> <3E02> <CC9A>\n<3E03> <3E05> <CC9D>\n<3E06> <3E0C> <CCA1>\n<3E0E> <3E13> <CCAE>\n<3E14> <3E15> <CCB6>\n<3E16> <3E18> <CCB9>\n<3E19> <3E1F> <CCBD>\n<3E22> <3E27> <CCCA>\n<3E28> <3E2A> <CCD1>\n<3E2B> <3E39> <CCD5>\n<3E3A> <3E40> <CCE5>\n<3E41> <3E43> <CCED>\n<3E44> <3E53> <CCF1>\n<3E54> <3E59> <CD02>\n<3E5A> <3E5B> <CD0A>\n<3E5C> <3E5E> <CD0D>\n<3E5F> <3E65> <CD11>\n<3E68> <3E6D> <CD1E>\n<3E6E> <3E70> <CD25>\n<3E71> <3E73> <CD29>\n<3E74> <3E7F> <CD2D>\n<3E80> <3EA1> <CD3A>\n<3EA2> <3EA4> <CD5D>\n<3EA5> <3EA7> <CD61>\n<3EA8> <3EAE> <CD65>\n<3EB1> <3EB6> <CD72>\n<3EB7> <3EC5> <CD79>\n<3EC6> <3ED0> <CD89>\n<3ED1> <3ED2> <CD96>\n<3ED3> <3ED5> <CD99>\n<3ED6> <3EDC> <CD9D>\n<3EDF> <3EE4> <CDAA>\n<3EE5> <3EF7> <CDB1>\n<3EF8> <3EFE> <CDC5>\n<3F00> <3F01> <CDCE>\n<3F02> <3F18> <CDD1>\n<3F19> <3F1B> <CDE9>\n<3F1C> <3F1E> <CDED>\n<3F1F> <3F25> <CDF1>\n<3F28> <3F2D> <CDFE>\n<3F2E> <3F30> <CE05>\n<3F31> <3F33> <CE09>\n<3F34> <3F3A> <CE0D>\n<3F3B> <3F3E> <CE15>\n<3F3F> <3F44> <CE1A>\n<3F45> <3F46> <CE22>\n<3F47> <3F49> <CE25>\n<3F4A> <3F50> <CE29>\n<3F53> <3F74> <CE36>\n<3F75> <3F76> <CE5A>\n<3F77> <3F78> <CE5D>\n<3F79> <3F7E> <CE62>\n<3F81> <3F86> <CE6E>\n<3F87> <3F88> <CE76>\n<3F89> <3F8B> <CE79>\n<3F8C> <3F92> <CE7D>\n<3F95> <3F9A> <CE8A>\n<3F9B> <3F9C> <CE92>\n<3F9D> <3F9F> <CE95>\n<3FA0> <3FA6> <CE99>\n<3FA8> <3FAD> <CEA6>\n<3FAE> <3FC0> <CEAE>\n<3FC1> <3FE2> <CEC2>\n<3FE3> <3FE4> <CEE6>\n<3FE5> <3FE6> <CEE9>\n<3FE7> <3FED> <CEED>\n<3FEF> <3FF4> <CEFA>\n<3FF5> <3FF6> <CF02>\n<3FF7> <3FF9> <CF05>\n<3FFA> <3FFF> <CF09>\n<4003> <4008> <CF16>\n<4009> <400B> <CF1D>\n<400C> <400E> <CF21>\n<400F> <4015> <CF25>\n<4017> <401C> <CF32>\n<401D> <4037> <CF39>\n<4038> <4039> <CF56>\n<403A> <403C> <CF59>\n<403D> <4043> <CF5D>\n<4046> <404B> <CF6A>\n<404C> <404D> <CF72>\n<404E> <4050> <CF75>\nendbfrange\n\n100 beginbfrange\n<4051> <4057> <CF79>\n<4058> <405B> <CF81>\n<405C> <4061> <CF86>\n<4062> <4075> <CF8D>\n<4076> <407B> <CFA2>\n<407C> <4082> <CFA9>\n<4083> <4095> <CFB1>\n<4096> <40B0> <CFC5>\n<40B1> <40B2> <CFE2>\n<40B3> <40B5> <CFE5>\n<40B6> <40BC> <CFE9>\n<40BF> <40C4> <CFF6>\n<40C5> <40C7> <CFFD>\n<40C8> <40CA> <D001>\n<40CB> <40D6> <D005>\n<40D7> <40DC> <D012>\n<40DD> <40F0> <D019>\n<40F1> <40F6> <D02E>\n<40F7> <40F8> <D036>\n<40F9> <40FB> <D039>\n<40FC> <40FF> <D03D>\n<4100> <4102> <D041>\n<4105> <410A> <D04A>\n<410B> <410D> <D051>\n<410E> <4110> <D055>\n<4111> <4117> <D059>\n<4118> <4122> <D061>\n<4123> <4124> <D06E>\n<4125> <4127> <D071>\n<4128> <412E> <D075>\n<412F> <4131> <D07E>\n<4132> <4153> <D082>\n<4154> <4155> <D0A6>\n<4156> <4158> <D0A9>\n<4159> <415F> <D0AD>\n<4162> <4167> <D0BA>\n<4168> <4169> <D0C2>\n<416A> <416C> <D0C5>\n<416D> <4172> <D0CA>\n<4174> <4179> <D0D6>\n<417A> <417B> <D0DE>\n<417C> <417E> <D0E1>\n<417F> <4185> <D0E5>\n<4187> <418C> <D0F2>\n<418D> <41A0> <D0F9>\n<41A1> <41C2> <D10E>\n<41C3> <41C4> <D132>\n<41C5> <41C7> <D135>\n<41C9> <41CD> <D13B>\n<41CF> <41D4> <D146>\n<41D5> <41D6> <D14E>\n<41D7> <41D9> <D151>\n<41DA> <41E0> <D155>\n<41E3> <41E8> <D162>\n<41E9> <41EB> <D169>\n<41EC> <41FA> <D16D>\n<41FB> <41FF> <D17D>\n<4200> <4201> <D182>\n<4202> <4204> <D185>\n<4205> <421B> <D189>\n<421C> <421D> <D1A2>\n<421E> <4220> <D1A5>\n<4221> <4227> <D1A9>\n<422A> <422D> <D1B6>\n<422F> <4231> <D1BD>\n<4232> <4248> <D1C1>\n<4249> <4263> <D1D9>\n<4264> <4266> <D1F5>\n<4267> <4274> <D1F9>\n<4276> <427B> <D20A>\n<427C> <4296> <D211>\n<4297> <4298> <D22E>\n<4299> <429B> <D231>\n<429C> <42A2> <D235>\n<42A5> <42AA> <D242>\n<42AB> <42BD> <D249>\n<42BE> <42C4> <D25D>\n<42C5> <42DF> <D265>\n<42E0> <42E1> <D282>\n<42E2> <42E4> <D285>\n<42E5> <42EB> <D289>\n<42EC> <42EE> <D292>\n<42EF> <42F4> <D296>\n<42F5> <42F7> <D29D>\n<42F8> <42FA> <D2A1>\n<42FB> <42FF> <D2A5>\n<4300> <4301> <D2AA>\n<4302> <4305> <D2AD>\n<4306> <430B> <D2B2>\n<430C> <430D> <D2BA>\n<430E> <430F> <D2BD>\n<4311> <4315> <D2C3>\n<4317> <431E> <D2CC>\n<431F> <4321> <D2D5>\n<4322> <4324> <D2D9>\n<4325> <432B> <D2DD>\n<432C> <4335> <D2E6>\n<4336> <4337> <D2F2>\n<4338> <433A> <D2F5>\n<433B> <4341> <D2F9>\nendbfrange\n\n100 beginbfrange\n<4344> <4349> <D306>\n<434B> <434D> <D311>\n<434F> <4353> <D317>\n<4355> <4357> <D322>\n<4358> <4359> <D326>\n<435A> <435B> <D32A>\n<435C> <435E> <D32D>\n<435F> <4365> <D331>\n<4367> <436C> <D33E>\n<436D> <43A2> <D346>\n<43A3> <43A4> <D37E>\n<43A5> <43A7> <D381>\n<43A8> <43AE> <D385>\n<43B0> <43B5> <D392>\n<43B6> <43B7> <D39A>\n<43B8> <43BA> <D39D>\n<43BB> <43C1> <D3A1>\n<43C4> <43C9> <D3AE>\n<43CA> <43CC> <D3B5>\n<43CD> <43CF> <D3B9>\n<43D0> <43D6> <D3BD>\n<43D7> <43D8> <D3C6>\n<43D9> <43DE> <D3CA>\n<43DF> <43E5> <D3D1>\n<43E6> <43ED> <D3D9>\n<43EF> <43F6> <D3E4>\n<43F7> <43F8> <D3EE>\n<43F9> <43FB> <D3F1>\n<43FC> <43FF> <D3F5>\n<4400> <4402> <D3F9>\n<4405> <440A> <D402>\n<440B> <441E> <D409>\n<441F> <4440> <D41E>\n<4441> <4443> <D441>\n<4444> <445A> <D445>\n<445B> <445D> <D45D>\n<445E> <4460> <D461>\n<4461> <4468> <D465>\n<446A> <4471> <D470>\n<4472> <4473> <D47A>\n<4474> <4475> <D47D>\n<4477> <447B> <D483>\n<447E> <4483> <D48E>\n<4484> <4497> <D495>\n<4498> <44B9> <D4AA>\n<44BA> <44BC> <D4CD>\n<44BD> <44BF> <D4D1>\n<44C0> <44C6> <D4D5>\n<44C7> <44C8> <D4DD>\n<44C9> <44D0> <D4E0>\n<44D1> <44D3> <D4E9>\n<44D4> <44D6> <D4ED>\n<44D7> <44DD> <D4F1>\n<44DE> <44DF> <D4F9>\n<44E1> <44E6> <D4FE>\n<44E7> <44E9> <D505>\n<44EA> <44EC> <D509>\n<44ED> <44F3> <D50D>\n<44F5> <44FF> <D518>\n<4500> <4518> <D523>\n<4519> <451A> <D53E>\n<451B> <451D> <D541>\n<451E> <4524> <D545>\n<4527> <452C> <D552>\n<452D> <452E> <D55A>\n<452F> <4531> <D55D>\n<4532> <4535> <D561>\n<4536> <4537> <D566>\n<453A> <453F> <D56E>\n<4540> <4541> <D576>\n<4542> <4544> <D579>\n<4545> <454B> <D57D>\n<454D> <4552> <D58A>\n<4553> <4566> <D591>\n<4567> <4588> <D5A6>\n<4589> <458A> <D5CA>\n<458B> <458D> <D5CD>\n<458F> <4593> <D5D3>\n<4596> <459B> <D5DE>\n<459C> <459D> <D5E6>\n<459E> <45A0> <D5E9>\n<45A1> <45A7> <D5ED>\n<45AA> <45AF> <D5FA>\n<45B0> <45B1> <D602>\n<45B2> <45B4> <D605>\n<45B5> <45BB> <D609>\n<45BD> <45C2> <D616>\n<45C3> <45C5> <D61D>\n<45C6> <45C8> <D621>\n<45C9> <45D0> <D625>\n<45D1> <45DA> <D62E>\n<45DB> <45DC> <D63A>\n<45DD> <45DF> <D63D>\n<45E0> <45E3> <D641>\n<45E4> <45E5> <D646>\n<45E8> <45EA> <D64E>\n<45EB> <45EC> <D652>\n<45ED> <45EE> <D656>\n<45EF> <45F1> <D659>\n<45F2> <45FB> <D65D>\nendbfrange\n\n53 beginbfrange\n<45FD> <45FF> <D66A>\n<4600> <4602> <D66D>\n<4603> <4604> <D672>\n<4605> <4612> <D675>\n<4614> <4619> <D686>\n<461A> <461B> <D68E>\n<461C> <461E> <D691>\n<461F> <4626> <D695>\n<4629> <462E> <D6A2>\n<462F> <4631> <D6A9>\n<4632> <4634> <D6AD>\n<4635> <463C> <D6B1>\n<463E> <4645> <D6BC>\n<4646> <4647> <D6C6>\n<4648> <464A> <D6C9>\n<464B> <464E> <D6CD>\n<464F> <4650> <D6D2>\n<4651> <4652> <D6D5>\n<4654> <4659> <D6DA>\n<465A> <465C> <D6E1>\n<465D> <465F> <D6E5>\n<4660> <4666> <D6E9>\n<4667> <466A> <D6F1>\n<466B> <4670> <D6F6>\n<4671> <4672> <D6FE>\n<4673> <4675> <D701>\n<4676> <4681> <D705>\n<4682> <4687> <D712>\n<4688> <4689> <D71A>\n<468A> <468C> <D71D>\n<468D> <4693> <D721>\n<4696> <469B> <D72E>\n<469C> <469D> <D736>\n<469E> <46A0> <D739>\n<46A1> <46A7> <D73D>\n<46A8> <46A9> <D745>\n<46AB> <46B0> <D74A>\n<46B1> <46B2> <D752>\n<46B4> <46B9> <D75A>\n<46BC> <46BE> <D766>\n<46BF> <46C0> <D76A>\n<46C1> <46C3> <D76D>\n<46C4> <46C6> <D771>\n<46C7> <46CD> <D775>\n<46CE> <46D0> <D77E>\n<46D1> <46D6> <D782>\n<46D7> <46D8> <D78A>\n<46D9> <46DB> <D78D>\n<46DC> <46E2> <D791>\n<46E5> <46EA> <D79E>\n<46EB> <46FF> <0020>\n<4700> <4749> <0035>\n<474F> <47AC> <0020>\nendbfrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/KSC-EUC-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (KSC-EUC-H)\n%%Title: (KSC-EUC-H Adobe Korea1 0)\n%%Version: 9.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Korea1) def\n  /Supplement 0 def\nend def\n\n/CMapName /KSC-EUC-H def\n/CMapVersion 9.003 def\n/CMapType 1 def\n\n/UIDOffset 100 def\n/XUID [1 10 25400] def\n\n/WMode 0 def\n\n2 begincodespacerange\n  <00>   <80>\n  <A1A1> <FEFE>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 8094\nendnotdefrange\n\n100 begincidrange\n<20> <7e> 8094\n<a1a1> <a1fe> 101\n<a2a1> <a2e5> 195\n<a3a1> <a3fe> 264\n<a4a1> <a4d3> 358\n<a4d5> <a4fe> 409\n<a5a1> <a5aa> 451\n<a5b0> <a5b9> 461\n<a5c1> <a5d8> 471\n<a5e1> <a5f8> 495\n<a6a1> <a6e4> 519\n<a7a1> <a7ef> 587\n<a8a1> <a8a4> 666\n<a8a6> <a8a6> 670\n<a8a8> <a8af> 671\n<a8b1> <a8fe> 679\n<a9a1> <a9fe> 757\n<aaa1> <aaf3> 851\n<aba1> <abf6> 934\n<aca1> <acc1> 1020\n<acd1> <acf1> 1053\n<b0a1> <b0fe> 1086\n<b1a1> <b1fe> 1180\n<b2a1> <b2fe> 1274\n<b3a1> <b3fe> 1368\n<b4a1> <b4fe> 1462\n<b5a1> <b5fe> 1556\n<b6a1> <b6fe> 1650\n<b7a1> <b7fe> 1744\n<b8a1> <b8fe> 1838\n<b9a1> <b9fe> 1932\n<baa1> <bafe> 2026\n<bba1> <bbfe> 2120\n<bca1> <bcfe> 2214\n<bda1> <bdfe> 2308\n<bea1> <befe> 2402\n<bfa1> <bffe> 2496\n<c0a1> <c0fe> 2590\n<c1a1> <c1fe> 2684\n<c2a1> <c2fe> 2778\n<c3a1> <c3fe> 2872\n<c4a1> <c4fe> 2966\n<c5a1> <c5fe> 3060\n<c6a1> <c6fe> 3154\n<c7a1> <c7fe> 3248\n<c8a1> <c8fe> 3342\n<caa1> <cafe> 3436\n<cba1> <cbcf> 3530\n<cbd0> <cbd0> 4116\n<cbd1> <cbd5> 3577\n<cbd6> <cbd6> 3678\n<cbd7> <cbe6> 3582\n<cbe7> <cbe7> 7053\n<cbe8> <cbfe> 3598\n<cca1> <ccfe> 3621\n<cda1> <cdce> 3715\n<cdcf> <cdcf> 3460\n<cdd0> <cde7> 3761\n<cde8> <cde8> 7900\n<cde9> <cdfe> 3785\n<cea1> <ceac> 3807\n<cead> <cead> 3802\n<ceae> <cefe> 3819\n<cfa1> <cffa> 3900\n<cffb> <cffb> 3902\n<cffc> <cffe> 3990\n<d0a1> <d0a1> 3993\n<d0a2> <d0a2> 3946\n<d0a3> <d0b7> 3994\n<d0b8> <d0b8> 3946\n<d0b9> <d0cf> 4015\n<d0d0> <d0d0> 3708\n<d0d1> <d0dc> 4038\n<d0dd> <d0dd> 4131\n<d0de> <d0fe> 4050\n<d1a1> <d1d3> 4083\n<d1d4> <d1d4> 4374\n<d1d5> <d1d5> 4156\n<d1d6> <d1d7> 4134\n<d1d8> <d1d8> 4375\n<d1d9> <d1da> 4136\n<d1db> <d1e0> 4376\n<d1e1> <d1e1> 4138\n<d1e2> <d1e2> 5800\n<d1e3> <d1e5> 4382\n<d1e6> <d1e6> 4386\n<d1e7> <d1e7> 4139\n<d1e8> <d1eb> 4387\n<d1ec> <d1ec> 4140\n<d1ed> <d1ed> 4391\n<d1ee> <d1ee> 4141\n<d1ef> <d1f0> 4394\n<d1f1> <d1f1> 4142\n<d1f2> <d1f2> 4396\n<d1f3> <d1f5> 4143\n<d1f6> <d1f6> 4399\n<d1f7> <d1f9> 4146\n<d1fa> <d1fa> 4403\n<d1fb> <d1fb> 4149\n<d1fc> <d1fd> 4406\nendcidrange\n\n100 begincidrange\n<d1fe> <d1fe> 4409\n<d2a1> <d2a1> 4150\n<d2a2> <d2a3> 4410\n<d2a4> <d2a6> 4151\n<d2a7> <d2aa> 4412\n<d2ab> <d2ab> 4419\n<d2ac> <d2ac> 4154\n<d2ad> <d2ad> 4420\n<d2ae> <d2b1> 4155\n<d2b2> <d2b2> 4424\n<d2b3> <d2bd> 4159\n<d2be> <d2be> 4511\n<d2bf> <d2c1> 4170\n<d2c2> <d2c3> 4513\n<d2c4> <d2c4> 4517\n<d2c5> <d2c5> 4173\n<d2c6> <d2ca> 4518\n<d2cb> <d2cb> 4524\n<d2cc> <d2cc> 4174\n<d2cd> <d2ce> 4525\n<d2cf> <d2d4> 4528\n<d2d5> <d2d7> 4535\n<d2d8> <d2d8> 4175\n<d2d9> <d2da> 4541\n<d2db> <d2dd> 4176\n<d2de> <d2df> 4545\n<d2e0> <d2e0> 4179\n<d2e1> <d2e1> 4547\n<d2e2> <d2e2> 4550\n<d2e3> <d2e3> 4180\n<d2e4> <d2e4> 4564\n<d2e5> <d2e8> 4566\n<d2e9> <d2ea> 4571\n<d2eb> <d2eb> 4576\n<d2ec> <d2ef> 4181\n<d2f0> <d2f3> 4604\n<d2f4> <d2f5> 4609\n<d2f6> <d2f6> 4185\n<d2f7> <d2f8> 4611\n<d2f9> <d2fe> 4186\n<d3a1> <d3fe> 4192\n<d4a1> <d4e5> 4286\n<d4e6> <d4e6> 4318\n<d4e7> <d4fb> 4355\n<d4fc> <d4fc> 4136\n<d4fd> <d4fe> 4376\n<d5a1> <d5a4> 4378\n<d5a5> <d5a5> 5800\n<d5a6> <d5aa> 4382\n<d5ab> <d5ab> 4139\n<d5ac> <d5ad> 4387\n<d5ae> <d5ae> 4192\n<d5af> <d5fe> 4389\n<d6a1> <d6b7> 4469\n<d6b8> <d6b8> 4167\n<d6b9> <d6cc> 4492\n<d6cd> <d6cd> 4172\n<d6ce> <d6fe> 4512\n<d7a1> <d7ca> 4561\n<d7cb> <d7cb> 5552\n<d7cc> <d7e3> 4603\n<d7e4> <d7e4> 6424\n<d7e5> <d7fe> 4627\n<d8a1> <d8fe> 4653\n<d9a1> <d9fe> 4747\n<daa1> <dafe> 4841\n<dba1> <dbc4> 4935\n<dbc5> <dbc5> 5151\n<dbc6> <dbe3> 4971\n<dbe4> <dbe4> 4922\n<dbe5> <dbfe> 5001\n<dca1> <dca4> 5027\n<dca5> <dca5> 7518\n<dca6> <dcfe> 5031\n<dda1> <dda4> 5120\n<dda5> <dda5> 5079\n<dda6> <ddd4> 5124\n<ddd5> <ddd5> 5109\n<ddd6> <ddf3> 5171\n<ddf4> <ddf4> 7607\n<ddf5> <ddfe> 5201\n<dea1> <defb> 5211\n<defc> <defc> 5584\n<defd> <defd> 5302\n<defe> <defe> 5367\n<dfa1> <dfb2> 5303\n<dfb3> <dfb3> 7083\n<dfb4> <dfe0> 5321\n<dfe1> <dfe1> 5362\n<dfe2> <dfe7> 5366\n<dfe8> <dfe8> 5485\n<dfe9> <dffe> 5372\n<e0a1> <e0f0> 5394\n<e0f1> <e0f1> 6001\n<e0f2> <e0fe> 5474\n<e1a1> <e1ac> 5487\n<e1ad> <e1ad> 5460\n<e1ae> <e1ec> 5499\n<e1ed> <e1ed> 5317\n<e1ee> <e1fe> 5562\nendcidrange\n\n100 begincidrange\n<e2a1> <e2fe> 5579\n<e3a1> <e3f4> 5673\n<e3f5> <e3f5> 7009\n<e3f6> <e3fe> 5757\n<e4a1> <e4a1> 7370\n<e4a2> <e4a8> 5766\n<e4a9> <e4a9> 5678\n<e4aa> <e4fe> 5773\n<e5a1> <e5ad> 5858\n<e5ae> <e5ae> 5874\n<e5af> <e5b0> 5871\n<e5b1> <e5b2> 4425\n<e5b3> <e5b8> 5873\n<e5b9> <e5b9> 4427\n<e5ba> <e5ba> 5879\n<e5bb> <e5bc> 4429\n<e5bd> <e5c3> 5880\n<e5c4> <e5c4> 4431\n<e5c5> <e5cd> 5887\n<e5ce> <e5ce> 4435\n<e5cf> <e5cf> 5896\n<e5d0> <e5d0> 4436\n<e5d1> <e5d1> 5897\n<e5d2> <e5d2> 4437\n<e5d3> <e5d5> 5898\n<e5d6> <e5d6> 4439\n<e5d7> <e5f9> 5901\n<e5fa> <e5fb> 4442\n<e5fc> <e5fc> 4159\n<e5fd> <e5fd> 5936\n<e5fe> <e5fe> 4444\n<e6a1> <e6a1> 4447\n<e6a2> <e6a3> 5937\n<e6a4> <e6a4> 4449\n<e6a5> <e6a6> 5939\n<e6a7> <e6a7> 4450\n<e6a8> <e6ac> 5941\n<e6ad> <e6ad> 4453\n<e6ae> <e6ae> 5946\n<e6af> <e6b1> 4455\n<e6b2> <e6b2> 5947\n<e6b3> <e6b3> 4458\n<e6b4> <e6b6> 5948\n<e6b7> <e6b8> 4459\n<e6b9> <e6bb> 5951\n<e6bc> <e6bc> 4463\n<e6bd> <e6c3> 5954\n<e6c4> <e6c4> 4160\n<e6c5> <e6c5> 5961\n<e6c6> <e6c7> 4465\n<e6c8> <e6c9> 5962\n<e6ca> <e6ca> 4161\n<e6cb> <e6d1> 5964\n<e6d2> <e6d2> 4468\n<e6d3> <e6d5> 5971\n<e6d6> <e6d6> 4469\n<e6d7> <e6d8> 5974\n<e6d9> <e6d9> 4470\n<e6da> <e6db> 5976\n<e6dc> <e6dc> 4162\n<e6dd> <e6de> 5978\n<e6df> <e6df> 4471\n<e6e0> <e6e0> 5980\n<e6e1> <e6e1> 4472\n<e6e2> <e6e3> 5981\n<e6e4> <e6e4> 4474\n<e6e5> <e6e5> 4473\n<e6e6> <e6e6> 4475\n<e6e7> <e6e7> 5983\n<e6e8> <e6e8> 4476\n<e6e9> <e6e9> 5984\n<e6ea> <e6eb> 4478\n<e6ec> <e6ec> 6447\n<e6ed> <e6ee> 5985\n<e6ef> <e6ef> 4481\n<e6f0> <e6f0> 5987\n<e6f1> <e6f1> 4482\n<e6f2> <e6f2> 5460\n<e6f3> <e6f4> 5988\n<e6f5> <e6f5> 4483\n<e6f6> <e6f6> 4163\n<e6f7> <e6f7> 4166\n<e6f8> <e6f8> 5990\n<e6f9> <e6f9> 4485\n<e6fa> <e6fe> 5991\n<e7a1> <e7a1> 4487\n<e7a2> <e7a5> 5996\n<e7a6> <e7a6> 4488\n<e7a7> <e7a8> 6000\n<e7a9> <e7a9> 4489\n<e7aa> <e7aa> 4491\n<e7ab> <e7ab> 6002\n<e7ac> <e7ac> 4167\n<e7ad> <e7ad> 4493\n<e7ae> <e7af> 6003\n<e7b0> <e7b0> 4494\n<e7b1> <e7be> 6005\n<e7bf> <e7bf> 4495\n<e7c0> <e7c0> 6019\n<e7c1> <e7c1> 7783\nendcidrange\n\n100 begincidrange\n<e7c2> <e7c5> 6020\n<e7c6> <e7c6> 4497\n<e7c7> <e7c7> 4499\n<e7c8> <e7ca> 6024\n<e7cb> <e7cb> 4501\n<e7cc> <e7cc> 6027\n<e7cd> <e7cd> 4502\n<e7ce> <e7ce> 6028\n<e7cf> <e7d0> 4503\n<e7d1> <e7d2> 6029\n<e7d3> <e7d3> 4506\n<e7d4> <e7de> 6031\n<e7df> <e7df> 4508\n<e7e0> <e7e3> 6042\n<e7e4> <e7e4> 4509\n<e7e5> <e7e5> 6046\n<e7e6> <e7e6> 4510\n<e7e7> <e7f6> 6047\n<e7f7> <e7f7> 5797\n<e7f8> <e7fe> 6063\n<e8a1> <e8e6> 6070\n<e8e7> <e8e8> 4551\n<e8e9> <e8ef> 6140\n<e8f0> <e8f0> 4553\n<e8f1> <e8f1> 4180\n<e8f2> <e8f6> 6147\n<e8f7> <e8f7> 4555\n<e8f8> <e8f8> 6152\n<e8f9> <e8f9> 5800\n<e8fa> <e8fa> 6153\n<e8fb> <e8fb> 4556\n<e8fc> <e8fd> 6154\n<e8fe> <e8fe> 4557\n<e9a1> <e9a6> 6156\n<e9a7> <e9a7> 4560\n<e9a8> <e9ab> 6162\n<e9ac> <e9ac> 4561\n<e9ad> <e9cb> 6166\n<e9cc> <e9cc> 4563\n<e9cd> <e9f6> 6197\n<e9f7> <e9f7> 7988\n<e9f8> <e9fe> 6239\n<eaa1> <eac0> 6246\n<eac1> <eac1> 6123\n<eac2> <eae4> 6278\n<eae5> <eae5> 4577\n<eae6> <eaf3> 6313\n<eaf4> <eaf4> 4183\n<eaf5> <eaf6> 6327\n<eaf7> <eaf7> 4579\n<eaf8> <eafb> 6329\n<eafc> <eafc> 4581\n<eafd> <eafd> 6333\n<eafe> <eafe> 4582\n<eba1> <eba3> 6334\n<eba4> <eba4> 4584\n<eba5> <eba6> 6337\n<eba7> <eba7> 4586\n<eba8> <eba8> 6339\n<eba9> <eba9> 4588\n<ebaa> <ebaa> 4184\n<ebab> <ebb9> 6340\n<ebba> <ebbb> 4590\n<ebbc> <ebbc> 6355\n<ebbd> <ebbd> 4592\n<ebbe> <ebc0> 6356\n<ebc1> <ebc1> 4593\n<ebc2> <ebc2> 4595\n<ebc3> <ebc5> 6359\n<ebc6> <ebc7> 4596\n<ebc8> <ebcb> 6362\n<ebcc> <ebcc> 4599\n<ebcd> <ebce> 6366\n<ebcf> <ebd1> 4600\n<ebd2> <ebd2> 5552\n<ebd3> <ebd7> 6368\n<ebd8> <ebd8> 4603\n<ebd9> <ebfe> 6373\n<eca1> <eca5> 6411\n<eca6> <eca6> 4614\n<eca7> <eca7> 4616\n<eca8> <eca9> 6416\n<ecaa> <ecaa> 4618\n<ecab> <ecae> 6418\n<ecaf> <ecaf> 5950\n<ecb0> <ecb1> 4620\n<ecb2> <ecb2> 4187\n<ecb3> <ecb4> 6422\n<ecb5> <ecb5> 4625\n<ecb6> <ecb7> 6424\n<ecb8> <ecb8> 4627\n<ecb9> <ecb9> 6426\n<ecba> <ecba> 4629\n<ecbb> <ecbf> 6427\n<ecc0> <ecc1> 4632\n<ecc2> <ecc4> 6432\n<ecc5> <ecc5> 4634\n<ecc6> <ecc6> 4636\n<ecc7> <ecc8> 6435\n<ecc9> <ecca> 4188\nendcidrange\n\n67 begincidrange\n<eccb> <ecd4> 6437\n<ecd5> <ecd5> 4638\n<ecd6> <ecdc> 6447\n<ecdd> <ecde> 4640\n<ecdf> <ece0> 6454\n<ece1> <ece1> 4642\n<ece2> <ece3> 6456\n<ece4> <ece4> 4644\n<ece5> <ece6> 6458\n<ece7> <ece8> 4645\n<ece9> <ecf6> 6460\n<ecf7> <ecf8> 4647\n<ecf9> <ecf9> 6474\n<ecfa> <ecfa> 4650\n<ecfb> <ecfe> 6475\n<eda1> <eda3> 4653\n<eda4> <eded> 6479\n<edee> <edee> 5351\n<edef> <edfe> 6553\n<eea1> <eeda> 6569\n<eedb> <eedb> 6494\n<eedc> <eefe> 6627\n<efa1> <effe> 6662\n<f0a1> <f0fe> 6756\n<f1a1> <f1fe> 6850\n<f2a1> <f2bc> 6944\n<f2bd> <f2bd> 5731\n<f2be> <f2f9> 6972\n<f2fa> <f2fa> 5771\n<f2fb> <f2fe> 7032\n<f3a1> <f3b0> 7036\n<f3b1> <f3b1> 4191\n<f3b2> <f3fe> 7052\n<f4a1> <f4a6> 7129\n<f4a7> <f4a7> 6484\n<f4a8> <f4ed> 7135\n<f4ee> <f4ee> 6684\n<f4ef> <f4fe> 7205\n<f5a1> <f5fe> 7221\n<f6a1> <f6f3> 7315\n<f6f4> <f6f4> 4279\n<f6f5> <f6f5> 7398\n<f6f6> <f6f6> 7139\n<f6f7> <f6fe> 7399\n<f7a1> <f7b7> 7407\n<f7b8> <f7b8> 4247\n<f7b9> <f7c7> 7430\n<f7c8> <f7c8> 4266\n<f7c9> <f7d2> 7445\n<f7d3> <f7d3> 4340\n<f7d4> <f7fe> 7455\n<f8a1> <f8da> 7498\n<f8db> <f8db> 7572\n<f8dc> <f8ef> 7556\n<f8f0> <f8f0> 5088\n<f8f1> <f8fe> 7576\n<f9a1> <f9fe> 7590\n<faa1> <faa1> 7709\n<faa2> <faa2> 3558\n<faa3> <fae5> 7684\n<fae6> <fae6> 3644\n<fae7> <fafe> 7751\n<fba1> <fbfe> 7775\n<fca1> <fca8> 7869\n<fca9> <fca9> 3815\n<fcaa> <fcfe> 7877\n<fda1> <fdfe> 7962\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/KSC-EUC-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (KSC-EUC-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (KSC-EUC-H)\n%%BeginResource: CMap (KSC-EUC-V)\n%%Title: (KSC-EUC-V Adobe Korea1 0)\n%%Version: 9.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/KSC-EUC-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Korea1) def\n  /Supplement 0 def\nend def\n\n/CMapName /KSC-EUC-V def\n/CMapVersion 9.003 def\n/CMapType 1 def\n\n/UIDOffset 310 def\n/XUID [1 10 25401] def\n\n/WMode 1 def\n\n16 begincidrange\n<a1a2> <a1a3> 8056\n<a1a5> <a1a5> 8058\n<a1a6> <a1a6> 8320\n<a1a9> <a1ab> 8059\n<a1ad> <a1ad> 8062\n<a1b2> <a1bd> 8063\n<a1eb> <a1eb> 8075\n<a3a1> <a3a1> 8076\n<a3a8> <a3a9> 8077\n<a3ac> <a3ac> 8079\n<a3ae> <a3ae> 8080\n<a3ba> <a3bf> 8081\n<a3db> <a3db> 8087\n<a3dd> <a3dd> 8088\n<a3df> <a3df> 8089\n<a3fb> <a3fe> 8090\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/KSC-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (KSC-H)\n%%Title: (KSC-H Adobe Korea1 0)\n%%Version: 9.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Korea1) def\n  /Supplement 0 def\nend def\n\n/CMapName /KSC-H def\n/CMapVersion 9.003 def\n/CMapType 1 def\n\n/UIDOffset 200 def\n/XUID [1 10 25402] def\n\n/WMode 0 def\n\n1 begincodespacerange\n  <2121> <7E7E>\nendcodespacerange\n\n100 begincidrange\n<2121> <217e> 101\n<2221> <2265> 195\n<2321> <237e> 264\n<2421> <2453> 358\n<2455> <247e> 409\n<2521> <252a> 451\n<2530> <2539> 461\n<2541> <2558> 471\n<2561> <2578> 495\n<2621> <2664> 519\n<2721> <276f> 587\n<2821> <2824> 666\n<2826> <2826> 670\n<2828> <282f> 671\n<2831> <287e> 679\n<2921> <297e> 757\n<2a21> <2a73> 851\n<2b21> <2b76> 934\n<2c21> <2c41> 1020\n<2c51> <2c71> 1053\n<3021> <307e> 1086\n<3121> <317e> 1180\n<3221> <327e> 1274\n<3321> <337e> 1368\n<3421> <347e> 1462\n<3521> <357e> 1556\n<3621> <367e> 1650\n<3721> <377e> 1744\n<3821> <387e> 1838\n<3921> <397e> 1932\n<3a21> <3a7e> 2026\n<3b21> <3b7e> 2120\n<3c21> <3c7e> 2214\n<3d21> <3d7e> 2308\n<3e21> <3e7e> 2402\n<3f21> <3f7e> 2496\n<4021> <407e> 2590\n<4121> <417e> 2684\n<4221> <427e> 2778\n<4321> <437e> 2872\n<4421> <447e> 2966\n<4521> <457e> 3060\n<4621> <467e> 3154\n<4721> <477e> 3248\n<4821> <487e> 3342\n<4a21> <4a7e> 3436\n<4b21> <4b4f> 3530\n<4b50> <4b50> 4116\n<4b51> <4b55> 3577\n<4b56> <4b56> 3678\n<4b57> <4b66> 3582\n<4b67> <4b67> 7053\n<4b68> <4b7e> 3598\n<4c21> <4c7e> 3621\n<4d21> <4d4e> 3715\n<4d4f> <4d4f> 3460\n<4d50> <4d67> 3761\n<4d68> <4d68> 7900\n<4d69> <4d7e> 3785\n<4e21> <4e2c> 3807\n<4e2d> <4e2d> 3802\n<4e2e> <4e7e> 3819\n<4f21> <4f7a> 3900\n<4f7b> <4f7b> 3902\n<4f7c> <4f7e> 3990\n<5021> <5021> 3993\n<5022> <5022> 3946\n<5023> <5037> 3994\n<5038> <5038> 3946\n<5039> <504f> 4015\n<5050> <5050> 3708\n<5051> <505c> 4038\n<505d> <505d> 4131\n<505e> <507e> 4050\n<5121> <5153> 4083\n<5154> <5154> 4374\n<5155> <5155> 4156\n<5156> <5157> 4134\n<5158> <5158> 4375\n<5159> <515a> 4136\n<515b> <5160> 4376\n<5161> <5161> 4138\n<5162> <5162> 5800\n<5163> <5165> 4382\n<5166> <5166> 4386\n<5167> <5167> 4139\n<5168> <516b> 4387\n<516c> <516c> 4140\n<516d> <516d> 4391\n<516e> <516e> 4141\n<516f> <5170> 4394\n<5171> <5171> 4142\n<5172> <5172> 4396\n<5173> <5175> 4143\n<5176> <5176> 4399\n<5177> <5179> 4146\n<517a> <517a> 4403\n<517b> <517b> 4149\n<517c> <517d> 4406\n<517e> <517e> 4409\nendcidrange\n\n100 begincidrange\n<5221> <5221> 4150\n<5222> <5223> 4410\n<5224> <5226> 4151\n<5227> <522a> 4412\n<522b> <522b> 4419\n<522c> <522c> 4154\n<522d> <522d> 4420\n<522e> <5231> 4155\n<5232> <5232> 4424\n<5233> <523d> 4159\n<523e> <523e> 4511\n<523f> <5241> 4170\n<5242> <5243> 4513\n<5244> <5244> 4517\n<5245> <5245> 4173\n<5246> <524a> 4518\n<524b> <524b> 4524\n<524c> <524c> 4174\n<524d> <524e> 4525\n<524f> <5254> 4528\n<5255> <5257> 4535\n<5258> <5258> 4175\n<5259> <525a> 4541\n<525b> <525d> 4176\n<525e> <525f> 4545\n<5260> <5260> 4179\n<5261> <5261> 4547\n<5262> <5262> 4550\n<5263> <5263> 4180\n<5264> <5264> 4564\n<5265> <5268> 4566\n<5269> <526a> 4571\n<526b> <526b> 4576\n<526c> <526f> 4181\n<5270> <5273> 4604\n<5274> <5275> 4609\n<5276> <5276> 4185\n<5277> <5278> 4611\n<5279> <527e> 4186\n<5321> <537e> 4192\n<5421> <5465> 4286\n<5466> <5466> 4318\n<5467> <547b> 4355\n<547c> <547c> 4136\n<547d> <547e> 4376\n<5521> <5524> 4378\n<5525> <5525> 5800\n<5526> <552a> 4382\n<552b> <552b> 4139\n<552c> <552d> 4387\n<552e> <552e> 4192\n<552f> <557e> 4389\n<5621> <5637> 4469\n<5638> <5638> 4167\n<5639> <564c> 4492\n<564d> <564d> 4172\n<564e> <567e> 4512\n<5721> <574a> 4561\n<574b> <574b> 5552\n<574c> <5763> 4603\n<5764> <5764> 6424\n<5765> <577e> 4627\n<5821> <587e> 4653\n<5921> <597e> 4747\n<5a21> <5a7e> 4841\n<5b21> <5b44> 4935\n<5b45> <5b45> 5151\n<5b46> <5b63> 4971\n<5b64> <5b64> 4922\n<5b65> <5b7e> 5001\n<5c21> <5c24> 5027\n<5c25> <5c25> 7518\n<5c26> <5c7e> 5031\n<5d21> <5d24> 5120\n<5d25> <5d25> 5079\n<5d26> <5d54> 5124\n<5d55> <5d55> 5109\n<5d56> <5d73> 5171\n<5d74> <5d74> 7607\n<5d75> <5d7e> 5201\n<5e21> <5e7b> 5211\n<5e7c> <5e7c> 5584\n<5e7d> <5e7d> 5302\n<5e7e> <5e7e> 5367\n<5f21> <5f32> 5303\n<5f33> <5f33> 7083\n<5f34> <5f60> 5321\n<5f61> <5f61> 5362\n<5f62> <5f67> 5366\n<5f68> <5f68> 5485\n<5f69> <5f7e> 5372\n<6021> <6070> 5394\n<6071> <6071> 6001\n<6072> <607e> 5474\n<6121> <612c> 5487\n<612d> <612d> 5460\n<612e> <616c> 5499\n<616d> <616d> 5317\n<616e> <617e> 5562\n<6221> <627e> 5579\nendcidrange\n\n100 begincidrange\n<6321> <6374> 5673\n<6375> <6375> 7009\n<6376> <637e> 5757\n<6421> <6421> 7370\n<6422> <6428> 5766\n<6429> <6429> 5678\n<642a> <647e> 5773\n<6521> <652d> 5858\n<652e> <652e> 5874\n<652f> <6530> 5871\n<6531> <6532> 4425\n<6533> <6538> 5873\n<6539> <6539> 4427\n<653a> <653a> 5879\n<653b> <653c> 4429\n<653d> <6543> 5880\n<6544> <6544> 4431\n<6545> <654d> 5887\n<654e> <654e> 4435\n<654f> <654f> 5896\n<6550> <6550> 4436\n<6551> <6551> 5897\n<6552> <6552> 4437\n<6553> <6555> 5898\n<6556> <6556> 4439\n<6557> <6579> 5901\n<657a> <657b> 4442\n<657c> <657c> 4159\n<657d> <657d> 5936\n<657e> <657e> 4444\n<6621> <6621> 4447\n<6622> <6623> 5937\n<6624> <6624> 4449\n<6625> <6626> 5939\n<6627> <6627> 4450\n<6628> <662c> 5941\n<662d> <662d> 4453\n<662e> <662e> 5946\n<662f> <6631> 4455\n<6632> <6632> 5947\n<6633> <6633> 4458\n<6634> <6636> 5948\n<6637> <6638> 4459\n<6639> <663b> 5951\n<663c> <663c> 4463\n<663d> <6643> 5954\n<6644> <6644> 4160\n<6645> <6645> 5961\n<6646> <6647> 4465\n<6648> <6649> 5962\n<664a> <664a> 4161\n<664b> <6651> 5964\n<6652> <6652> 4468\n<6653> <6655> 5971\n<6656> <6656> 4469\n<6657> <6658> 5974\n<6659> <6659> 4470\n<665a> <665b> 5976\n<665c> <665c> 4162\n<665d> <665e> 5978\n<665f> <665f> 4471\n<6660> <6660> 5980\n<6661> <6661> 4472\n<6662> <6663> 5981\n<6664> <6664> 4474\n<6665> <6665> 4473\n<6666> <6666> 4475\n<6667> <6667> 5983\n<6668> <6668> 4476\n<6669> <6669> 5984\n<666a> <666b> 4478\n<666c> <666c> 6447\n<666d> <666e> 5985\n<666f> <666f> 4481\n<6670> <6670> 5987\n<6671> <6671> 4482\n<6672> <6672> 5460\n<6673> <6674> 5988\n<6675> <6675> 4483\n<6676> <6676> 4163\n<6677> <6677> 4166\n<6678> <6678> 5990\n<6679> <6679> 4485\n<667a> <667e> 5991\n<6721> <6721> 4487\n<6722> <6725> 5996\n<6726> <6726> 4488\n<6727> <6728> 6000\n<6729> <6729> 4489\n<672a> <672a> 4491\n<672b> <672b> 6002\n<672c> <672c> 4167\n<672d> <672d> 4493\n<672e> <672f> 6003\n<6730> <6730> 4494\n<6731> <673e> 6005\n<673f> <673f> 4495\n<6740> <6740> 6019\n<6741> <6741> 7783\n<6742> <6745> 6020\nendcidrange\n\n100 begincidrange\n<6746> <6746> 4497\n<6747> <6747> 4499\n<6748> <674a> 6024\n<674b> <674b> 4501\n<674c> <674c> 6027\n<674d> <674d> 4502\n<674e> <674e> 6028\n<674f> <6750> 4503\n<6751> <6752> 6029\n<6753> <6753> 4506\n<6754> <675e> 6031\n<675f> <675f> 4508\n<6760> <6763> 6042\n<6764> <6764> 4509\n<6765> <6765> 6046\n<6766> <6766> 4510\n<6767> <6776> 6047\n<6777> <6777> 5797\n<6778> <677e> 6063\n<6821> <6866> 6070\n<6867> <6868> 4551\n<6869> <686f> 6140\n<6870> <6870> 4553\n<6871> <6871> 4180\n<6872> <6876> 6147\n<6877> <6877> 4555\n<6878> <6878> 6152\n<6879> <6879> 5800\n<687a> <687a> 6153\n<687b> <687b> 4556\n<687c> <687d> 6154\n<687e> <687e> 4557\n<6921> <6926> 6156\n<6927> <6927> 4560\n<6928> <692b> 6162\n<692c> <692c> 4561\n<692d> <694b> 6166\n<694c> <694c> 4563\n<694d> <6976> 6197\n<6977> <6977> 7988\n<6978> <697e> 6239\n<6a21> <6a40> 6246\n<6a41> <6a41> 6123\n<6a42> <6a64> 6278\n<6a65> <6a65> 4577\n<6a66> <6a73> 6313\n<6a74> <6a74> 4183\n<6a75> <6a76> 6327\n<6a77> <6a77> 4579\n<6a78> <6a7b> 6329\n<6a7c> <6a7c> 4581\n<6a7d> <6a7d> 6333\n<6a7e> <6a7e> 4582\n<6b21> <6b23> 6334\n<6b24> <6b24> 4584\n<6b25> <6b26> 6337\n<6b27> <6b27> 4586\n<6b28> <6b28> 6339\n<6b29> <6b29> 4588\n<6b2a> <6b2a> 4184\n<6b2b> <6b39> 6340\n<6b3a> <6b3b> 4590\n<6b3c> <6b3c> 6355\n<6b3d> <6b3d> 4592\n<6b3e> <6b40> 6356\n<6b41> <6b41> 4593\n<6b42> <6b42> 4595\n<6b43> <6b45> 6359\n<6b46> <6b47> 4596\n<6b48> <6b4b> 6362\n<6b4c> <6b4c> 4599\n<6b4d> <6b4e> 6366\n<6b4f> <6b51> 4600\n<6b52> <6b52> 5552\n<6b53> <6b57> 6368\n<6b58> <6b58> 4603\n<6b59> <6b7e> 6373\n<6c21> <6c25> 6411\n<6c26> <6c26> 4614\n<6c27> <6c27> 4616\n<6c28> <6c29> 6416\n<6c2a> <6c2a> 4618\n<6c2b> <6c2e> 6418\n<6c2f> <6c2f> 5950\n<6c30> <6c31> 4620\n<6c32> <6c32> 4187\n<6c33> <6c34> 6422\n<6c35> <6c35> 4625\n<6c36> <6c37> 6424\n<6c38> <6c38> 4627\n<6c39> <6c39> 6426\n<6c3a> <6c3a> 4629\n<6c3b> <6c3f> 6427\n<6c40> <6c41> 4632\n<6c42> <6c44> 6432\n<6c45> <6c45> 4634\n<6c46> <6c46> 4636\n<6c47> <6c48> 6435\n<6c49> <6c4a> 4188\n<6c4b> <6c54> 6437\nendcidrange\n\n66 begincidrange\n<6c55> <6c55> 4638\n<6c56> <6c5c> 6447\n<6c5d> <6c5e> 4640\n<6c5f> <6c60> 6454\n<6c61> <6c61> 4642\n<6c62> <6c63> 6456\n<6c64> <6c64> 4644\n<6c65> <6c66> 6458\n<6c67> <6c68> 4645\n<6c69> <6c76> 6460\n<6c77> <6c78> 4647\n<6c79> <6c79> 6474\n<6c7a> <6c7a> 4650\n<6c7b> <6c7e> 6475\n<6d21> <6d23> 4653\n<6d24> <6d6d> 6479\n<6d6e> <6d6e> 5351\n<6d6f> <6d7e> 6553\n<6e21> <6e5a> 6569\n<6e5b> <6e5b> 6494\n<6e5c> <6e7e> 6627\n<6f21> <6f7e> 6662\n<7021> <707e> 6756\n<7121> <717e> 6850\n<7221> <723c> 6944\n<723d> <723d> 5731\n<723e> <7279> 6972\n<727a> <727a> 5771\n<727b> <727e> 7032\n<7321> <7330> 7036\n<7331> <7331> 4191\n<7332> <737e> 7052\n<7421> <7426> 7129\n<7427> <7427> 6484\n<7428> <746d> 7135\n<746e> <746e> 6684\n<746f> <747e> 7205\n<7521> <757e> 7221\n<7621> <7673> 7315\n<7674> <7674> 4279\n<7675> <7675> 7398\n<7676> <7676> 7139\n<7677> <767e> 7399\n<7721> <7737> 7407\n<7738> <7738> 4247\n<7739> <7747> 7430\n<7748> <7748> 4266\n<7749> <7752> 7445\n<7753> <7753> 4340\n<7754> <777e> 7455\n<7821> <785a> 7498\n<785b> <785b> 7572\n<785c> <786f> 7556\n<7870> <7870> 5088\n<7871> <787e> 7576\n<7921> <797e> 7590\n<7a21> <7a21> 7709\n<7a22> <7a22> 3558\n<7a23> <7a65> 7684\n<7a66> <7a66> 3644\n<7a67> <7a7e> 7751\n<7b21> <7b7e> 7775\n<7c21> <7c28> 7869\n<7c29> <7c29> 3815\n<7c2a> <7c7e> 7877\n<7d21> <7d7e> 7962\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/KSC-Johab-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (KSC-Johab-H)\n%%Title: (KSC-Johab-H Adobe Korea1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Korea1) def\n  /Supplement 1 def\nend def\n\n/CMapName /KSC-Johab-H def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 560 def\n/XUID [1 10 25411] def\n\n/WMode 0 def\n\n4 begincodespacerange\n  <00>   <80>\n  <8441> <D3FE>\n  <D831> <DEFE>\n  <E031> <F9FE>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 1\nendnotdefrange\n\n100 begincidrange\n<20> <7e> 1\n<8442> <8448> 358\n<8449> <8451> 366\n<8453> <8453> 375\n<8454> <8458> 377\n<8459> <845d> 383\n<8461> <8461> 388\n<8481> <8481> 389\n<84a1> <84a1> 390\n<84c1> <84c1> 391\n<84e1> <84e1> 392\n<8541> <8541> 393\n<8561> <8561> 394\n<8581> <8581> 395\n<85a1> <85a1> 396\n<85c1> <85c1> 397\n<85e1> <85e1> 398\n<8641> <8641> 399\n<8661> <8661> 400\n<8681> <8681> 401\n<86a1> <86a1> 402\n<86c1> <86c1> 403\n<86e1> <86e1> 404\n<8741> <8741> 405\n<8761> <8761> 406\n<8781> <8781> 407\n<87a1> <87a1> 408\n<8841> <8841> 358\n<8861> <8862> 1086\n<8863> <8864> 9333\n<8865> <8865> 1088\n<8866> <8867> 9335\n<8868> <886b> 1089\n<886c> <8870> 9337\n<8871> <8871> 1093\n<8873> <8879> 1094\n<887a> <887a> 9342\n<887b> <887d> 1101\n<8881> <8882> 1104\n<8883> <8884> 9343\n<8885> <8885> 1106\n<8886> <8888> 9345\n<8889> <8889> 1107\n<888a> <8890> 9348\n<8891> <8891> 1108\n<8893> <8893> 1109\n<8894> <8894> 9355\n<8895> <8897> 1110\n<8898> <889d> 9356\n<88a1> <88a2> 1113\n<88a3> <88a4> 9362\n<88a5> <88a5> 1115\n<88a6> <88a8> 9364\n<88a9> <88a9> 1116\n<88aa> <88b1> 9367\n<88b3> <88b4> 9375\n<88b5> <88b5> 1117\n<88b6> <88b6> 9377\n<88b7> <88b7> 1118\n<88b8> <88bd> 9378\n<88c1> <88c1> 1119\n<88c2> <88c4> 9384\n<88c5> <88c5> 1120\n<88c6> <88c8> 9387\n<88c9> <88c9> 1121\n<88ca> <88d1> 9390\n<88d3> <88dd> 9398\n<88e1> <88e2> 1122\n<88e3> <88e4> 9409\n<88e5> <88e5> 1124\n<88e6> <88e7> 9411\n<88e8> <88e9> 1125\n<88ea> <88ea> 9413\n<88eb> <88eb> 1127\n<88ec> <88f0> 9414\n<88f1> <88f1> 1128\n<88f3> <88f3> 1129\n<88f4> <88f4> 9419\n<88f5> <88f8> 1130\n<88f9> <88fa> 9420\n<88fb> <88fd> 1134\n<8941> <8941> 1137\n<8942> <8944> 9422\n<8945> <8945> 1138\n<8946> <8948> 9425\n<8949> <8949> 1139\n<894a> <8950> 9428\n<8951> <8951> 1140\n<8953> <8953> 1141\n<8954> <8954> 9435\n<8955> <8957> 1142\n<8958> <895d> 9436\n<8961> <8963> 1145\n<8964> <8964> 9442\n<8965> <8965> 1148\n<8966> <8967> 9443\n<8968> <8969> 1149\n<896a> <8970> 9445\n<8971> <8971> 1151\n<8973> <8973> 1152\nendcidrange\n\n100 begincidrange\n<8974> <8974> 9452\n<8975> <8977> 1153\n<8978> <897a> 9453\n<897b> <897b> 1156\n<897c> <897d> 9456\n<8981> <8981> 1157\n<8982> <8984> 9458\n<8985> <8985> 1158\n<8986> <8988> 9461\n<8989> <8989> 1159\n<898a> <8991> 9464\n<8993> <8993> 1160\n<8994> <8994> 9472\n<8995> <8995> 1161\n<8996> <899d> 9473\n<89a1> <89a2> 1162\n<89a3> <89a4> 9481\n<89a5> <89a5> 1164\n<89a6> <89a7> 9483\n<89a8> <89a9> 1165\n<89aa> <89aa> 9485\n<89ab> <89ab> 1167\n<89ac> <89ac> 9486\n<89ad> <89ad> 1168\n<89ae> <89af> 9487\n<89b0> <89b1> 1169\n<89b3> <89b3> 1171\n<89b4> <89b4> 9489\n<89b5> <89b5> 1172\n<89b6> <89b6> 9490\n<89b7> <89b8> 1173\n<89b9> <89bd> 9491\n<89c1> <89c2> 1175\n<89c3> <89c4> 9496\n<89c5> <89c5> 1177\n<89c6> <89c8> 9498\n<89c9> <89c9> 1178\n<89ca> <89ca> 9501\n<89cb> <89cb> 1179\n<89cc> <89d0> 9502\n<89d1> <89d1> 1180\n<89d3> <89d3> 1181\n<89d4> <89d4> 9507\n<89d5> <89d5> 1182\n<89d6> <89d6> 9508\n<89d7> <89d7> 1183\n<89d8> <89dd> 9509\n<89e1> <89e1> 1184\n<89e2> <89e4> 9515\n<89e5> <89e5> 1185\n<89e6> <89e8> 9518\n<89e9> <89e9> 1186\n<89ea> <89f1> 9521\n<89f3> <89f3> 1187\n<89f4> <89f5> 9529\n<89f6> <89f7> 1188\n<89f8> <89fd> 9531\n<8a41> <8a42> 1190\n<8a43> <8a44> 9537\n<8a45> <8a45> 1192\n<8a46> <8a48> 9539\n<8a49> <8a49> 1193\n<8a4a> <8a50> 9542\n<8a51> <8a51> 1194\n<8a53> <8a53> 1195\n<8a54> <8a54> 9549\n<8a55> <8a55> 1196\n<8a56> <8a56> 9550\n<8a57> <8a57> 1197\n<8a58> <8a5d> 9551\n<8a61> <8a61> 1198\n<8a62> <8a64> 9557\n<8a65> <8a65> 1199\n<8a66> <8a68> 9560\n<8a69> <8a69> 1200\n<8a6a> <8a71> 9563\n<8a73> <8a73> 1201\n<8a74> <8a74> 9571\n<8a75> <8a75> 1202\n<8a76> <8a7d> 9572\n<8a81> <8a82> 1203\n<8a83> <8a84> 9580\n<8a85> <8a85> 1205\n<8a86> <8a87> 9582\n<8a88> <8a8b> 1206\n<8a8c> <8a8f> 9584\n<8a90> <8a91> 1210\n<8a93> <8a93> 1212\n<8a94> <8a94> 9588\n<8a95> <8a95> 1213\n<8a96> <8a96> 9589\n<8a97> <8a98> 1214\n<8a99> <8a9d> 9590\n<8aa1> <8aa2> 1216\n<8aa3> <8aa4> 9595\n<8aa5> <8aa5> 1218\n<8aa6> <8aa8> 9597\n<8aa9> <8aa9> 1219\n<8aaa> <8ab1> 9600\n<8ab3> <8ab5> 9608\nendcidrange\n\n100 begincidrange\n<8ab6> <8ab7> 1220\n<8ab8> <8abd> 9611\n<8ac1> <8ac1> 1222\n<8ac2> <8ad1> 9617\n<8ad3> <8ad4> 9633\n<8ad5> <8ad5> 1223\n<8ad6> <8add> 9635\n<8ae1> <8ae2> 1224\n<8ae3> <8ae4> 9643\n<8ae5> <8ae5> 1226\n<8ae6> <8ae8> 9645\n<8ae9> <8ae9> 1227\n<8aea> <8af0> 9648\n<8af1> <8af1> 1228\n<8af3> <8af3> 1229\n<8af4> <8af4> 9655\n<8af5> <8af5> 1230\n<8af6> <8afd> 9656\n<8b41> <8b41> 1231\n<8b42> <8b44> 9664\n<8b45> <8b45> 1232\n<8b46> <8b48> 9667\n<8b49> <8b49> 1233\n<8b4a> <8b51> 9670\n<8b53> <8b5d> 9678\n<8b61> <8b62> 1234\n<8b63> <8b64> 9689\n<8b65> <8b65> 1236\n<8b66> <8b67> 9691\n<8b68> <8b6a> 1237\n<8b6b> <8b70> 9693\n<8b71> <8b71> 1240\n<8b73> <8b73> 1241\n<8b74> <8b74> 9699\n<8b75> <8b75> 1242\n<8b76> <8b76> 9700\n<8b77> <8b77> 1243\n<8b78> <8b7d> 9701\n<8b81> <8b81> 1244\n<8b82> <8b91> 9707\n<8b93> <8b9d> 9723\n<8ba1> <8ba2> 1245\n<8ba3> <8ba4> 9734\n<8ba5> <8ba5> 1247\n<8ba6> <8ba7> 9736\n<8ba8> <8ba9> 1248\n<8baa> <8baa> 9738\n<8bab> <8bab> 1250\n<8bac> <8bb0> 9739\n<8bb1> <8bb1> 1251\n<8bb3> <8bb3> 1252\n<8bb4> <8bb4> 9744\n<8bb5> <8bb5> 1253\n<8bb6> <8bb6> 9745\n<8bb7> <8bb8> 1254\n<8bb9> <8bbb> 9746\n<8bbc> <8bbc> 1256\n<8bbd> <8bbd> 9749\n<8c41> <8c41> 359\n<8c61> <8c63> 1257\n<8c64> <8c64> 9750\n<8c65> <8c65> 1260\n<8c66> <8c68> 9751\n<8c69> <8c69> 1261\n<8c6a> <8c6a> 9754\n<8c6b> <8c6b> 1262\n<8c6c> <8c70> 9755\n<8c71> <8c71> 1263\n<8c73> <8c73> 1264\n<8c74> <8c74> 9760\n<8c75> <8c77> 1265\n<8c78> <8c7a> 9761\n<8c7b> <8c7b> 1268\n<8c7c> <8c7d> 9764\n<8c81> <8c82> 1269\n<8c83> <8c84> 9766\n<8c85> <8c85> 1271\n<8c86> <8c88> 9768\n<8c89> <8c89> 1272\n<8c8a> <8c90> 9771\n<8c91> <8c91> 1273\n<8c93> <8c93> 1274\n<8c94> <8c94> 9778\n<8c95> <8c97> 1275\n<8c98> <8c9d> 9779\n<8ca1> <8ca2> 1278\n<8ca3> <8ca8> 9785\n<8ca9> <8ca9> 1280\n<8caa> <8cb1> 9791\n<8cb3> <8cbd> 9799\n<8cc1> <8cd1> 9810\n<8cd3> <8cdd> 9827\n<8ce1> <8ce3> 1281\n<8ce4> <8ce4> 9838\n<8ce5> <8ce5> 1284\n<8ce6> <8ce8> 9839\n<8ce9> <8ce9> 1285\n<8cea> <8cf0> 9842\n<8cf1> <8cf1> 1286\n<8cf3> <8cf3> 1287\nendcidrange\n\n100 begincidrange\n<8cf4> <8cf4> 9849\n<8cf5> <8cf7> 1288\n<8cf8> <8cfd> 9850\n<8d41> <8d42> 1291\n<8d43> <8d44> 9856\n<8d45> <8d45> 1293\n<8d46> <8d50> 9858\n<8d51> <8d51> 1294\n<8d53> <8d54> 9869\n<8d55> <8d55> 1295\n<8d56> <8d56> 9871\n<8d57> <8d57> 1296\n<8d58> <8d5d> 9872\n<8d61> <8d61> 1297\n<8d62> <8d64> 9878\n<8d65> <8d65> 1298\n<8d66> <8d68> 9881\n<8d69> <8d69> 1299\n<8d6a> <8d71> 9884\n<8d73> <8d74> 9892\n<8d75> <8d76> 1300\n<8d77> <8d7a> 9894\n<8d7b> <8d7b> 1302\n<8d7c> <8d7d> 9898\n<8d81> <8d81> 1303\n<8d82> <8d91> 9900\n<8d93> <8d9d> 9916\n<8da1> <8da2> 1304\n<8da3> <8da4> 9927\n<8da5> <8da5> 1306\n<8da6> <8da6> 9929\n<8da7> <8da7> 1307\n<8da8> <8da8> 9930\n<8da9> <8da9> 1308\n<8daa> <8db0> 9931\n<8db1> <8db1> 1309\n<8db3> <8db3> 1310\n<8db4> <8db4> 9938\n<8db5> <8db5> 1311\n<8db6> <8db6> 9939\n<8db7> <8db9> 1312\n<8dba> <8dbd> 9940\n<8dc1> <8dc2> 1315\n<8dc3> <8dc8> 9944\n<8dc9> <8dc9> 1317\n<8dca> <8dd1> 9950\n<8dd3> <8dd5> 9958\n<8dd6> <8dd7> 1318\n<8dd8> <8ddd> 9961\n<8de1> <8de2> 1320\n<8de3> <8df1> 9967\n<8df3> <8df6> 9982\n<8df7> <8df7> 1322\n<8df8> <8dfd> 9986\n<8e41> <8e41> 1323\n<8e42> <8e44> 9992\n<8e45> <8e45> 1324\n<8e46> <8e48> 9995\n<8e49> <8e49> 1325\n<8e4a> <8e50> 9998\n<8e51> <8e51> 1326\n<8e53> <8e53> 1327\n<8e54> <8e56> 10005\n<8e57> <8e57> 1328\n<8e58> <8e5d> 10008\n<8e61> <8e61> 1329\n<8e62> <8e71> 10014\n<8e73> <8e7d> 10030\n<8e81> <8e82> 1330\n<8e83> <8e84> 10041\n<8e85> <8e85> 1332\n<8e86> <8e88> 10043\n<8e89> <8e89> 1333\n<8e8a> <8e8f> 10046\n<8e90> <8e91> 1334\n<8e93> <8e93> 1336\n<8e94> <8e94> 10052\n<8e95> <8e95> 1337\n<8e96> <8e96> 10053\n<8e97> <8e98> 1338\n<8e99> <8e9d> 10054\n<8ea1> <8ea1> 1340\n<8ea2> <8ea8> 10059\n<8ea9> <8ea9> 1341\n<8eaa> <8eb1> 10066\n<8eb3> <8eb5> 10074\n<8eb6> <8eb7> 1342\n<8eb8> <8ebd> 10077\n<8ec1> <8ec2> 1344\n<8ec3> <8ec4> 10083\n<8ec5> <8ec5> 1346\n<8ec6> <8ec8> 10085\n<8ec9> <8ec9> 1347\n<8eca> <8ed0> 10088\n<8ed1> <8ed1> 1348\n<8ed3> <8ed3> 1349\n<8ed4> <8ed5> 10095\n<8ed6> <8ed6> 1350\n<8ed7> <8edd> 10097\n<8ee1> <8ee1> 1351\nendcidrange\n\n100 begincidrange\n<8ee2> <8ee4> 10104\n<8ee5> <8ee5> 1352\n<8ee6> <8ee8> 10107\n<8ee9> <8ee9> 1353\n<8eea> <8ef0> 10110\n<8ef1> <8ef1> 1354\n<8ef3> <8ef3> 1355\n<8ef4> <8efd> 10117\n<8f41> <8f41> 1356\n<8f42> <8f51> 10127\n<8f53> <8f5d> 10143\n<8f61> <8f62> 1357\n<8f63> <8f64> 10154\n<8f65> <8f65> 1359\n<8f66> <8f66> 10156\n<8f67> <8f67> 1360\n<8f68> <8f68> 10157\n<8f69> <8f69> 1361\n<8f6a> <8f6a> 10158\n<8f6b> <8f6b> 1362\n<8f6c> <8f6f> 10159\n<8f70> <8f71> 1363\n<8f73> <8f73> 1365\n<8f74> <8f74> 10163\n<8f75> <8f75> 1366\n<8f76> <8f76> 10164\n<8f77> <8f77> 1367\n<8f78> <8f7a> 10165\n<8f7b> <8f7b> 1368\n<8f7c> <8f7d> 10168\n<8f81> <8f91> 10170\n<8f93> <8f9d> 10187\n<8fa1> <8fa2> 1369\n<8fa3> <8fa4> 10198\n<8fa5> <8fa5> 1371\n<8fa6> <8fa8> 10200\n<8fa9> <8fa9> 1372\n<8faa> <8fb0> 10203\n<8fb1> <8fb1> 1373\n<8fb3> <8fb3> 1374\n<8fb4> <8fb4> 10210\n<8fb5> <8fb5> 1375\n<8fb6> <8fb6> 10211\n<8fb7> <8fb7> 1376\n<8fb8> <8fbd> 10212\n<9041> <9041> 361\n<9061> <9063> 1377\n<9064> <9064> 10218\n<9065> <9065> 1380\n<9066> <9067> 10219\n<9068> <906b> 1381\n<906c> <9070> 10221\n<9071> <9071> 1385\n<9073> <9073> 1386\n<9074> <9074> 10226\n<9075> <9079> 1387\n<907a> <907a> 10227\n<907b> <907b> 1392\n<907c> <907c> 10228\n<907d> <907d> 1393\n<9081> <9082> 1394\n<9083> <9084> 10229\n<9085> <9085> 1396\n<9086> <9088> 10231\n<9089> <9089> 1397\n<908a> <9090> 10234\n<9091> <9091> 1398\n<9093> <9093> 1399\n<9094> <9094> 10241\n<9095> <9097> 1400\n<9098> <909d> 10242\n<90a1> <90a2> 1403\n<90a3> <90a4> 10248\n<90a5> <90a5> 1405\n<90a6> <90a8> 10250\n<90a9> <90a9> 1406\n<90aa> <90b0> 10253\n<90b1> <90b1> 1407\n<90b3> <90b6> 10260\n<90b7> <90b7> 1408\n<90b8> <90bd> 10264\n<90c1> <90d1> 10270\n<90d3> <90dd> 10287\n<90e1> <90e2> 1409\n<90e3> <90e3> 10298\n<90e4> <90e5> 1411\n<90e6> <90e8> 10299\n<90e9> <90e9> 1413\n<90ea> <90ea> 10302\n<90eb> <90ec> 1414\n<90ed> <90f0> 10303\n<90f1> <90f1> 1416\n<90f3> <90f3> 1417\n<90f4> <90f4> 10307\n<90f5> <90f7> 1418\n<90f8> <90fc> 10308\n<90fd> <90fd> 1421\n<9141> <9142> 1422\n<9143> <9144> 10313\n<9145> <9145> 1424\nendcidrange\n\n100 begincidrange\n<9146> <9148> 10315\n<9149> <9149> 1425\n<914a> <9150> 10318\n<9151> <9151> 1426\n<9153> <9153> 1427\n<9154> <9154> 10325\n<9155> <9157> 1428\n<9158> <915d> 10326\n<9161> <9162> 1431\n<9163> <9164> 10332\n<9165> <9165> 1433\n<9166> <9168> 10334\n<9169> <9169> 1434\n<916a> <9170> 10337\n<9171> <9171> 1435\n<9173> <9173> 1436\n<9174> <9175> 10344\n<9176> <9177> 1437\n<9178> <9179> 10346\n<917a> <917a> 1439\n<917b> <917d> 10348\n<9181> <9181> 1440\n<9182> <9184> 10351\n<9185> <9185> 1441\n<9186> <9191> 10354\n<9193> <919d> 10366\n<91a1> <91a2> 1442\n<91a3> <91a4> 10377\n<91a5> <91a5> 1444\n<91a6> <91a8> 10379\n<91a9> <91a9> 1445\n<91aa> <91aa> 10382\n<91ab> <91ab> 1446\n<91ac> <91b0> 10383\n<91b1> <91b1> 1447\n<91b3> <91b3> 1448\n<91b4> <91b4> 10388\n<91b5> <91b5> 1449\n<91b6> <91b6> 10389\n<91b7> <91b7> 1450\n<91b8> <91bb> 10390\n<91bc> <91bd> 1451\n<91c1> <91c1> 1453\n<91c2> <91c4> 10394\n<91c5> <91c5> 1454\n<91c6> <91c8> 10397\n<91c9> <91c9> 1455\n<91ca> <91d1> 10400\n<91d3> <91d5> 10408\n<91d6> <91d6> 1456\n<91d7> <91dd> 10411\n<91e1> <91f1> 10418\n<91f3> <91fd> 10435\n<9241> <9241> 1457\n<9242> <9244> 10446\n<9245> <9245> 1458\n<9246> <9248> 10449\n<9249> <9249> 1459\n<924a> <9250> 10452\n<9251> <9251> 1460\n<9253> <9253> 1461\n<9254> <9254> 10459\n<9255> <9255> 1462\n<9256> <925d> 10460\n<9261> <9262> 1463\n<9263> <9264> 10468\n<9265> <9265> 1465\n<9266> <9268> 10470\n<9269> <9269> 1466\n<926a> <9271> 10473\n<9273> <9273> 1467\n<9274> <9274> 10481\n<9275> <9275> 1468\n<9276> <9276> 10482\n<9277> <9277> 1469\n<9278> <927d> 10483\n<9281> <9282> 1470\n<9283> <9284> 10489\n<9285> <9285> 1472\n<9286> <9287> 10491\n<9288> <9289> 1473\n<928a> <9290> 10493\n<9291> <9291> 1475\n<9293> <9293> 1476\n<9294> <9294> 10500\n<9295> <9295> 1477\n<9296> <9296> 10501\n<9297> <9297> 1478\n<9298> <929d> 10502\n<92a1> <92a1> 1479\n<92a2> <92b1> 10508\n<92b3> <92b5> 10524\n<92b6> <92b6> 1480\n<92b7> <92bd> 10527\n<92c1> <92c1> 1481\n<92c2> <92d1> 10534\n<92d3> <92dd> 10550\n<92e1> <92e1> 1482\n<92e2> <92e4> 10561\n<92e5> <92e5> 1483\nendcidrange\n\n100 begincidrange\n<92e6> <92e8> 10564\n<92e9> <92e9> 1484\n<92ea> <92f0> 10567\n<92f1> <92f1> 1485\n<92f3> <92f3> 1486\n<92f4> <92fd> 10574\n<9341> <9342> 1487\n<9343> <9348> 10584\n<9349> <9349> 1489\n<934a> <9350> 10590\n<9351> <9351> 1490\n<9353> <9353> 1491\n<9354> <9356> 10597\n<9357> <9357> 1492\n<9358> <935d> 10600\n<9361> <9362> 1493\n<9363> <9364> 10606\n<9365> <9365> 1495\n<9366> <9368> 10608\n<9369> <936b> 1496\n<936c> <9370> 10611\n<9371> <9371> 1499\n<9373> <9373> 1500\n<9374> <9374> 10616\n<9375> <9375> 1501\n<9376> <9376> 10617\n<9377> <9378> 1502\n<9379> <937b> 10618\n<937c> <937c> 1504\n<937d> <937d> 10621\n<9381> <9381> 1505\n<9382> <9384> 10622\n<9385> <9385> 1506\n<9386> <9388> 10625\n<9389> <9389> 1507\n<938a> <9391> 10628\n<9393> <939d> 10636\n<93a1> <93a2> 1508\n<93a3> <93a4> 10647\n<93a5> <93a5> 1510\n<93a6> <93a8> 10649\n<93a9> <93a9> 1511\n<93aa> <93aa> 10652\n<93ab> <93ab> 1512\n<93ac> <93b0> 10653\n<93b1> <93b1> 1513\n<93b3> <93b3> 1514\n<93b4> <93b4> 10658\n<93b5> <93b5> 1515\n<93b6> <93b6> 10659\n<93b7> <93b7> 1516\n<93b8> <93bb> 10660\n<93bc> <93bc> 1517\n<93bd> <93bd> 10664\n<9441> <9441> 364\n<9461> <9463> 1518\n<9464> <9464> 10665\n<9465> <9465> 1521\n<9466> <9467> 10666\n<9468> <946c> 1522\n<946d> <946f> 10668\n<9470> <9471> 1527\n<9473> <9473> 1529\n<9474> <9474> 10671\n<9475> <9479> 1530\n<947a> <947c> 10672\n<947d> <947d> 1535\n<9481> <9482> 1536\n<9483> <9484> 10675\n<9485> <9485> 1538\n<9486> <9488> 10677\n<9489> <9489> 1539\n<948a> <9490> 10680\n<9491> <9491> 1540\n<9493> <9493> 1541\n<9494> <9494> 10687\n<9495> <9497> 1542\n<9498> <949d> 10688\n<94a1> <94a1> 1545\n<94a2> <94b1> 10694\n<94b3> <94bd> 10710\n<94c1> <94d1> 10721\n<94d3> <94dd> 10738\n<94e1> <94e3> 1546\n<94e4> <94e4> 10749\n<94e5> <94e5> 1549\n<94e6> <94e7> 10750\n<94e8> <94e9> 1550\n<94ea> <94ea> 10752\n<94eb> <94ec> 1552\n<94ed> <94f0> 10753\n<94f1> <94f1> 1554\n<94f3> <94f3> 1555\n<94f4> <94f4> 10757\n<94f5> <94f5> 1556\n<94f6> <94f6> 10758\n<94f7> <94f7> 1557\n<94f8> <94f8> 10759\n<94f9> <94f9> 1558\n<94fa> <94fb> 10760\nendcidrange\n\n100 begincidrange\n<94fc> <94fc> 1559\n<94fd> <94fd> 10762\n<9541> <9542> 1560\n<9543> <9544> 10763\n<9545> <9545> 1562\n<9546> <9548> 10765\n<9549> <9549> 1563\n<954a> <9550> 10768\n<9551> <9551> 1564\n<9553> <9553> 1565\n<9554> <9554> 10775\n<9555> <9557> 1566\n<9558> <955d> 10776\n<9561> <9561> 1569\n<9562> <9564> 10782\n<9565> <9565> 1570\n<9566> <9568> 10785\n<9569> <9569> 1571\n<956a> <9571> 10788\n<9573> <9575> 10796\n<9576> <9577> 1572\n<9578> <957d> 10799\n<9581> <9581> 1574\n<9582> <9584> 10805\n<9585> <9585> 1575\n<9586> <9591> 10808\n<9593> <959d> 10820\n<95a1> <95a2> 1576\n<95a3> <95a4> 10831\n<95a5> <95a5> 1578\n<95a6> <95a7> 10833\n<95a8> <95a9> 1579\n<95aa> <95aa> 10835\n<95ab> <95ab> 1581\n<95ac> <95ac> 10836\n<95ad> <95ad> 1582\n<95ae> <95b0> 10837\n<95b1> <95b1> 1583\n<95b3> <95b3> 1584\n<95b4> <95b4> 10840\n<95b5> <95b5> 1585\n<95b6> <95b6> 10841\n<95b7> <95b7> 1586\n<95b8> <95b8> 10842\n<95b9> <95b9> 1587\n<95ba> <95ba> 10843\n<95bb> <95bb> 1588\n<95bc> <95bd> 10844\n<95c1> <95c1> 1589\n<95c2> <95c4> 10846\n<95c5> <95c5> 1590\n<95c6> <95c8> 10849\n<95c9> <95c9> 1591\n<95ca> <95d1> 10852\n<95d3> <95dd> 10860\n<95e1> <95e1> 1592\n<95e2> <95f1> 10871\n<95f3> <95f5> 10887\n<95f6> <95f6> 1593\n<95f7> <95fd> 10890\n<9641> <9641> 1594\n<9642> <9644> 10897\n<9645> <9645> 1595\n<9646> <9648> 10900\n<9649> <9649> 1596\n<964a> <9650> 10903\n<9651> <9651> 1597\n<9653> <9653> 1598\n<9654> <9654> 10910\n<9655> <9655> 1599\n<9656> <965d> 10911\n<9661> <9661> 1600\n<9662> <9671> 10919\n<9673> <967d> 10935\n<9681> <9682> 1601\n<9683> <9684> 10946\n<9685> <9685> 1603\n<9686> <9688> 10948\n<9689> <9689> 1604\n<968a> <9690> 10951\n<9691> <9691> 1605\n<9693> <9693> 1606\n<9694> <9694> 10958\n<9695> <9695> 1607\n<9696> <9696> 10959\n<9697> <9697> 1608\n<9698> <969d> 10960\n<96a1> <96a1> 1609\n<96a2> <96b1> 10966\n<96b3> <96b5> 10982\n<96b6> <96b6> 1610\n<96b7> <96bd> 10985\n<96c1> <96c1> 1611\n<96c2> <96d1> 10992\n<96d3> <96d6> 11008\n<96d7> <96d7> 1612\n<96d8> <96dd> 11012\n<96e1> <96e1> 1613\n<96e2> <96e4> 11018\n<96e5> <96e5> 1614\nendcidrange\n\n100 begincidrange\n<96e6> <96e8> 11021\n<96e9> <96e9> 1615\n<96ea> <96f1> 11024\n<96f3> <96f3> 1616\n<96f4> <96f4> 11032\n<96f5> <96f5> 1617\n<96f6> <96f6> 11033\n<96f7> <96f7> 1618\n<96f8> <96fd> 11034\n<9741> <9741> 1619\n<9742> <9744> 11040\n<9745> <9745> 1620\n<9746> <9748> 11043\n<9749> <9749> 1621\n<974a> <9750> 11046\n<9751> <9751> 1622\n<9753> <9756> 11053\n<9757> <9757> 1623\n<9758> <975d> 11057\n<9761> <9762> 1624\n<9763> <9764> 11063\n<9765> <9765> 1626\n<9766> <9767> 11065\n<9768> <9769> 1627\n<976a> <976a> 11067\n<976b> <976b> 1629\n<976c> <9770> 11068\n<9771> <9771> 1630\n<9773> <9773> 1631\n<9774> <9774> 11073\n<9775> <9775> 1632\n<9776> <9776> 11074\n<9777> <9777> 1633\n<9778> <977d> 11075\n<9781> <9781> 1634\n<9782> <9791> 11081\n<9793> <979d> 11097\n<97a1> <97a2> 1635\n<97a3> <97a4> 11108\n<97a5> <97a5> 1637\n<97a6> <97a7> 11110\n<97a8> <97a9> 1638\n<97aa> <97b0> 11112\n<97b1> <97b1> 1640\n<97b3> <97b3> 1641\n<97b4> <97b4> 11119\n<97b5> <97b8> 1642\n<97b9> <97bd> 11120\n<9841> <9841> 365\n<9861> <9862> 1646\n<9863> <9864> 11125\n<9865> <9865> 1648\n<9866> <9868> 11127\n<9869> <9869> 1649\n<986a> <9870> 11130\n<9871> <9871> 1650\n<9873> <9873> 1651\n<9874> <9874> 11137\n<9875> <9877> 1652\n<9878> <987c> 11138\n<987d> <987d> 1655\n<9881> <9882> 1656\n<9883> <9884> 11143\n<9885> <9885> 1658\n<9886> <9888> 11145\n<9889> <9889> 1659\n<988a> <9890> 11148\n<9891> <9891> 1660\n<9893> <9893> 1661\n<9894> <9894> 11155\n<9895> <9897> 1662\n<9898> <989d> 11156\n<98a1> <98b1> 11162\n<98b3> <98bd> 11179\n<98c1> <98d1> 11190\n<98d3> <98dd> 11207\n<98e1> <98e2> 1665\n<98e3> <98e4> 11218\n<98e5> <98e5> 1667\n<98e6> <98e8> 11220\n<98e9> <98e9> 1668\n<98ea> <98ea> 11223\n<98eb> <98ec> 1669\n<98ed> <98f0> 11224\n<98f1> <98f1> 1671\n<98f3> <98f3> 1672\n<98f4> <98f4> 11228\n<98f5> <98f7> 1673\n<98f8> <98fc> 11229\n<98fd> <98fd> 1676\n<9941> <9942> 1677\n<9943> <9944> 11234\n<9945> <9945> 1679\n<9946> <9948> 11236\n<9949> <9949> 1680\n<994a> <9950> 11239\n<9951> <9951> 1681\n<9953> <9953> 1682\n<9954> <9954> 11246\n<9955> <9957> 1683\nendcidrange\n\n100 begincidrange\n<9958> <995d> 11247\n<9961> <9961> 1686\n<9962> <9971> 11253\n<9973> <9975> 11269\n<9976> <9976> 1687\n<9977> <997d> 11272\n<9981> <9991> 11279\n<9993> <999d> 11296\n<99a1> <99a2> 1688\n<99a3> <99a4> 11307\n<99a5> <99a5> 1690\n<99a6> <99a8> 11309\n<99a9> <99a9> 1691\n<99aa> <99b1> 11312\n<99b3> <99b6> 11320\n<99b7> <99b7> 1692\n<99b8> <99bd> 11324\n<99c1> <99c1> 1693\n<99c2> <99c8> 11330\n<99c9> <99c9> 1694\n<99ca> <99d1> 11337\n<99d3> <99dd> 11345\n<99e1> <99e1> 1695\n<99e2> <99f1> 11356\n<99f3> <99fd> 11372\n<9a41> <9a41> 1696\n<9a42> <9a44> 11383\n<9a45> <9a45> 1697\n<9a46> <9a51> 11386\n<9a53> <9a5d> 11398\n<9a61> <9a71> 11409\n<9a73> <9a7d> 11426\n<9a81> <9a82> 1698\n<9a83> <9a84> 11437\n<9a85> <9a85> 1700\n<9a86> <9a88> 11439\n<9a89> <9a89> 1701\n<9a8a> <9a8f> 11442\n<9a90> <9a91> 1702\n<9a93> <9a96> 11448\n<9a97> <9a97> 1704\n<9a98> <9a9d> 11452\n<9aa1> <9ab1> 11458\n<9ab3> <9abd> 11475\n<9ac1> <9ac1> 1705\n<9ac2> <9ad1> 11486\n<9ad3> <9add> 11502\n<9ae1> <9ae1> 1706\n<9ae2> <9ae4> 11513\n<9ae5> <9ae5> 1707\n<9ae6> <9ae8> 11516\n<9ae9> <9ae9> 1708\n<9aea> <9af0> 11519\n<9af1> <9af1> 1709\n<9af3> <9af3> 1710\n<9af4> <9af6> 11526\n<9af7> <9af7> 1711\n<9af8> <9afd> 11529\n<9b41> <9b51> 11535\n<9b53> <9b5d> 11552\n<9b61> <9b62> 1712\n<9b63> <9b64> 11563\n<9b65> <9b65> 1714\n<9b66> <9b67> 11565\n<9b68> <9b69> 1715\n<9b6a> <9b70> 11567\n<9b71> <9b71> 1717\n<9b73> <9b73> 1718\n<9b74> <9b74> 11574\n<9b75> <9b75> 1719\n<9b76> <9b7d> 11575\n<9b81> <9b81> 1720\n<9b82> <9b84> 11583\n<9b85> <9b85> 1721\n<9b86> <9b88> 11586\n<9b89> <9b89> 1722\n<9b8a> <9b90> 11589\n<9b91> <9b91> 1723\n<9b93> <9b93> 1724\n<9b94> <9b9d> 11596\n<9ba1> <9ba1> 1725\n<9ba2> <9ba4> 11606\n<9ba5> <9ba5> 1726\n<9ba6> <9ba8> 11609\n<9ba9> <9ba9> 1727\n<9baa> <9bb0> 11612\n<9bb1> <9bb1> 1728\n<9bb3> <9bb3> 1729\n<9bb4> <9bb4> 11619\n<9bb5> <9bb5> 1730\n<9bb6> <9bb6> 11620\n<9bb7> <9bb7> 1731\n<9bb8> <9bbd> 11621\n<9c41> <9c41> 366\n<9c61> <9c62> 1732\n<9c63> <9c64> 11627\n<9c65> <9c65> 1734\n<9c66> <9c68> 11629\n<9c69> <9c69> 1735\n<9c6a> <9c70> 11632\nendcidrange\n\n100 begincidrange\n<9c71> <9c71> 1736\n<9c73> <9c73> 1737\n<9c74> <9c74> 11639\n<9c75> <9c78> 1738\n<9c79> <9c7b> 11640\n<9c7c> <9c7d> 1742\n<9c81> <9c82> 1744\n<9c83> <9c84> 11643\n<9c85> <9c85> 1746\n<9c86> <9c88> 11645\n<9c89> <9c89> 1747\n<9c8a> <9c90> 11648\n<9c91> <9c91> 1748\n<9c93> <9c93> 1749\n<9c94> <9c94> 11655\n<9c95> <9c97> 1750\n<9c98> <9c9d> 11656\n<9ca1> <9ca2> 1753\n<9ca3> <9ca4> 11662\n<9ca5> <9ca5> 1755\n<9ca6> <9cb1> 11664\n<9cb3> <9cb4> 11676\n<9cb5> <9cb5> 1756\n<9cb6> <9cb6> 11678\n<9cb7> <9cb7> 1757\n<9cb8> <9cbd> 11679\n<9cc1> <9cd1> 11685\n<9cd3> <9cdd> 11702\n<9ce1> <9ce2> 1758\n<9ce3> <9ce4> 11713\n<9ce5> <9ce5> 1760\n<9ce6> <9ce8> 11715\n<9ce9> <9ce9> 1761\n<9cea> <9cf0> 11718\n<9cf1> <9cf1> 1762\n<9cf3> <9cf3> 1763\n<9cf4> <9cf4> 11725\n<9cf5> <9cf7> 1764\n<9cf8> <9cfc> 11726\n<9cfd> <9cfd> 1767\n<9d41> <9d42> 1768\n<9d43> <9d44> 11731\n<9d45> <9d45> 1770\n<9d46> <9d48> 11733\n<9d49> <9d49> 1771\n<9d4a> <9d50> 11736\n<9d51> <9d51> 1772\n<9d53> <9d53> 1773\n<9d54> <9d54> 11743\n<9d55> <9d55> 1774\n<9d56> <9d56> 11744\n<9d57> <9d57> 1775\n<9d58> <9d5d> 11745\n<9d61> <9d62> 1776\n<9d63> <9d64> 11751\n<9d65> <9d65> 1778\n<9d66> <9d68> 11753\n<9d69> <9d69> 1779\n<9d6a> <9d70> 11756\n<9d71> <9d71> 1780\n<9d73> <9d73> 1781\n<9d74> <9d74> 11763\n<9d75> <9d77> 1782\n<9d78> <9d7d> 11764\n<9d81> <9d81> 1785\n<9d82> <9d84> 11770\n<9d85> <9d85> 1786\n<9d86> <9d91> 11773\n<9d93> <9d93> 1787\n<9d94> <9d94> 11785\n<9d95> <9d95> 1788\n<9d96> <9d9d> 11786\n<9da1> <9da2> 1789\n<9da3> <9da4> 11794\n<9da5> <9da5> 1791\n<9da6> <9da8> 11796\n<9da9> <9da9> 1792\n<9daa> <9db0> 11799\n<9db1> <9db1> 1793\n<9db3> <9db3> 1794\n<9db4> <9db4> 11806\n<9db5> <9db5> 1795\n<9db6> <9db6> 11807\n<9db7> <9db7> 1796\n<9db8> <9dbd> 11808\n<9dc1> <9dc1> 1797\n<9dc2> <9dc4> 11814\n<9dc5> <9dc5> 1798\n<9dc6> <9dd1> 11817\n<9dd3> <9dd6> 11829\n<9dd7> <9dd7> 1799\n<9dd8> <9ddd> 11833\n<9de1> <9df1> 11839\n<9df3> <9df5> 11856\n<9df6> <9df6> 1800\n<9df7> <9dfd> 11859\n<9e41> <9e41> 1801\n<9e42> <9e44> 11866\n<9e45> <9e45> 1802\n<9e46> <9e48> 11869\nendcidrange\n\n100 begincidrange\n<9e49> <9e49> 1803\n<9e4a> <9e50> 11872\n<9e51> <9e51> 1804\n<9e53> <9e53> 1805\n<9e54> <9e54> 11879\n<9e55> <9e55> 1806\n<9e56> <9e56> 11880\n<9e57> <9e57> 1807\n<9e58> <9e5d> 11881\n<9e61> <9e61> 1808\n<9e62> <9e64> 11887\n<9e65> <9e65> 1809\n<9e66> <9e68> 11890\n<9e69> <9e69> 1810\n<9e6a> <9e71> 11893\n<9e73> <9e73> 1811\n<9e74> <9e74> 11901\n<9e75> <9e75> 1812\n<9e76> <9e76> 11902\n<9e77> <9e77> 1813\n<9e78> <9e7d> 11903\n<9e81> <9e82> 1814\n<9e83> <9e84> 11909\n<9e85> <9e85> 1816\n<9e86> <9e88> 11911\n<9e89> <9e89> 1817\n<9e8a> <9e90> 11914\n<9e91> <9e91> 1818\n<9e93> <9e93> 1819\n<9e94> <9e94> 11921\n<9e95> <9e95> 1820\n<9e96> <9e96> 11922\n<9e97> <9e97> 1821\n<9e98> <9e9d> 11923\n<9ea1> <9ea1> 1822\n<9ea2> <9eb1> 11929\n<9eb3> <9eb5> 11945\n<9eb6> <9eb6> 1823\n<9eb7> <9ebd> 11948\n<9ec1> <9ec1> 1824\n<9ec2> <9ed1> 11955\n<9ed3> <9edd> 11971\n<9ee1> <9ee2> 1825\n<9ee3> <9ee4> 11982\n<9ee5> <9ee5> 1827\n<9ee6> <9ee8> 11984\n<9ee9> <9ee9> 1828\n<9eea> <9ef0> 11987\n<9ef1> <9ef1> 1829\n<9ef3> <9ef4> 11994\n<9ef5> <9ef5> 1830\n<9ef6> <9ef6> 11996\n<9ef7> <9ef7> 1831\n<9ef8> <9efd> 11997\n<9f41> <9f42> 1832\n<9f43> <9f44> 12003\n<9f45> <9f45> 1834\n<9f46> <9f48> 12005\n<9f49> <9f49> 1835\n<9f4a> <9f50> 12008\n<9f51> <9f51> 1836\n<9f53> <9f53> 1837\n<9f54> <9f54> 12015\n<9f55> <9f55> 1838\n<9f56> <9f56> 12016\n<9f57> <9f57> 1839\n<9f58> <9f5d> 12017\n<9f61> <9f62> 1840\n<9f63> <9f64> 12023\n<9f65> <9f65> 1842\n<9f66> <9f68> 12025\n<9f69> <9f69> 1843\n<9f6a> <9f70> 12028\n<9f71> <9f71> 1844\n<9f73> <9f73> 1845\n<9f74> <9f74> 12035\n<9f75> <9f75> 1846\n<9f76> <9f76> 12036\n<9f77> <9f78> 1847\n<9f79> <9f7a> 12037\n<9f7b> <9f7c> 1849\n<9f7d> <9f7d> 12039\n<9f81> <9f91> 12040\n<9f93> <9f9d> 12057\n<9fa1> <9fa2> 1851\n<9fa3> <9fa4> 12068\n<9fa5> <9fa5> 1853\n<9fa6> <9fa8> 12070\n<9fa9> <9fa9> 1854\n<9faa> <9fb0> 12073\n<9fb1> <9fb1> 1855\n<9fb3> <9fb3> 1856\n<9fb4> <9fb4> 12080\n<9fb5> <9fb5> 1857\n<9fb6> <9fb6> 12081\n<9fb7> <9fb7> 1858\n<9fb8> <9fbd> 12082\n<a041> <a041> 374\n<a061> <a062> 1859\n<a063> <a064> 12088\nendcidrange\n\n100 begincidrange\n<a065> <a065> 1861\n<a066> <a066> 12090\n<a067> <a06b> 1862\n<a06c> <a070> 12091\n<a071> <a071> 1867\n<a073> <a073> 1868\n<a074> <a074> 12096\n<a075> <a075> 1869\n<a076> <a076> 12097\n<a077> <a078> 1870\n<a079> <a07a> 12098\n<a07b> <a07b> 1872\n<a07c> <a07c> 12100\n<a07d> <a07d> 1873\n<a081> <a082> 1874\n<a083> <a084> 12101\n<a085> <a085> 1876\n<a086> <a088> 12103\n<a089> <a089> 1877\n<a08a> <a090> 12106\n<a091> <a091> 1878\n<a093> <a093> 1879\n<a094> <a094> 12113\n<a095> <a098> 1880\n<a099> <a09d> 12114\n<a0a1> <a0a2> 1884\n<a0a3> <a0a8> 12119\n<a0a9> <a0a9> 1886\n<a0aa> <a0b1> 12125\n<a0b3> <a0b6> 12133\n<a0b7> <a0b7> 1887\n<a0b8> <a0bd> 12137\n<a0c1> <a0d1> 12143\n<a0d3> <a0dd> 12160\n<a0e1> <a0e2> 1888\n<a0e3> <a0e4> 12171\n<a0e5> <a0e5> 1890\n<a0e6> <a0e8> 12173\n<a0e9> <a0e9> 1891\n<a0ea> <a0ea> 12176\n<a0eb> <a0eb> 1892\n<a0ec> <a0f0> 12177\n<a0f1> <a0f1> 1893\n<a0f3> <a0f3> 1894\n<a0f4> <a0f4> 12182\n<a0f5> <a0f5> 1895\n<a0f6> <a0f6> 12183\n<a0f7> <a0f8> 1896\n<a0f9> <a0fc> 12184\n<a0fd> <a0fd> 1898\n<a141> <a142> 1899\n<a143> <a144> 12188\n<a145> <a145> 1901\n<a146> <a148> 12190\n<a149> <a149> 1902\n<a14a> <a150> 12193\n<a151> <a151> 1903\n<a153> <a153> 1904\n<a154> <a154> 12200\n<a155> <a157> 1905\n<a158> <a15d> 12201\n<a161> <a162> 1908\n<a163> <a164> 12207\n<a165> <a165> 1910\n<a166> <a168> 12209\n<a169> <a169> 1911\n<a16a> <a171> 12212\n<a173> <a174> 12220\n<a175> <a177> 1912\n<a178> <a178> 12222\n<a179> <a179> 1915\n<a17a> <a17d> 12223\n<a181> <a181> 1916\n<a182> <a191> 12227\n<a193> <a19d> 12243\n<a1a1> <a1a2> 1917\n<a1a3> <a1a3> 12254\n<a1a4> <a1a5> 1919\n<a1a6> <a1a8> 12255\n<a1a9> <a1a9> 1921\n<a1aa> <a1aa> 12258\n<a1ab> <a1ab> 1922\n<a1ac> <a1b0> 12259\n<a1b1> <a1b1> 1923\n<a1b3> <a1b3> 1924\n<a1b4> <a1b4> 12264\n<a1b5> <a1b5> 1925\n<a1b6> <a1b6> 12265\n<a1b7> <a1b7> 1926\n<a1b8> <a1bd> 12266\n<a1c1> <a1c1> 1927\n<a1c2> <a1c4> 12272\n<a1c5> <a1c5> 1928\n<a1c6> <a1d1> 12275\n<a1d3> <a1d5> 12287\n<a1d6> <a1d7> 1929\n<a1d8> <a1dd> 12290\n<a1e1> <a1f1> 12296\n<a1f3> <a1fd> 12313\n<a241> <a241> 1931\nendcidrange\n\n100 begincidrange\n<a242> <a244> 12324\n<a245> <a245> 1932\n<a246> <a248> 12327\n<a249> <a249> 1933\n<a24a> <a251> 12330\n<a253> <a253> 1934\n<a254> <a254> 12338\n<a255> <a255> 1935\n<a256> <a256> 12339\n<a257> <a257> 1936\n<a258> <a25d> 12340\n<a261> <a261> 1937\n<a262> <a264> 12346\n<a265> <a265> 1938\n<a266> <a268> 12349\n<a269> <a269> 1939\n<a26a> <a271> 12352\n<a273> <a273> 1940\n<a274> <a274> 12360\n<a275> <a275> 1941\n<a276> <a27d> 12361\n<a281> <a283> 1942\n<a284> <a284> 12369\n<a285> <a285> 1945\n<a286> <a287> 12370\n<a288> <a28b> 1946\n<a28c> <a290> 12372\n<a291> <a291> 1950\n<a293> <a293> 1951\n<a294> <a294> 12377\n<a295> <a295> 1952\n<a296> <a296> 12378\n<a297> <a297> 1953\n<a298> <a29a> 12379\n<a29b> <a29b> 1954\n<a29c> <a29c> 12382\n<a29d> <a29d> 1955\n<a2a1> <a2a1> 1956\n<a2a2> <a2a4> 12383\n<a2a5> <a2a5> 1957\n<a2a6> <a2a8> 12386\n<a2a9> <a2a9> 1958\n<a2aa> <a2b1> 12389\n<a2b3> <a2b3> 1959\n<a2b4> <a2b4> 12397\n<a2b5> <a2b5> 1960\n<a2b6> <a2bd> 12398\n<a2c1> <a2c1> 1961\n<a2c2> <a2d1> 12406\n<a2d3> <a2dd> 12422\n<a2e1> <a2e1> 1962\n<a2e2> <a2e4> 12433\n<a2e5> <a2e5> 1963\n<a2e6> <a2e8> 12436\n<a2e9> <a2e9> 1964\n<a2ea> <a2f1> 12439\n<a2f3> <a2fd> 12447\n<a341> <a341> 1965\n<a342> <a344> 12458\n<a345> <a345> 1966\n<a346> <a348> 12461\n<a349> <a349> 1967\n<a34a> <a350> 12464\n<a351> <a351> 1968\n<a353> <a354> 12471\n<a355> <a355> 1969\n<a356> <a35d> 12473\n<a361> <a361> 1970\n<a362> <a364> 12481\n<a365> <a365> 1971\n<a366> <a368> 12484\n<a369> <a369> 1972\n<a36a> <a370> 12487\n<a371> <a371> 1973\n<a373> <a374> 12494\n<a375> <a375> 1974\n<a376> <a37d> 12496\n<a381> <a391> 12504\n<a393> <a39d> 12521\n<a3a1> <a3a2> 1975\n<a3a3> <a3a4> 12532\n<a3a5> <a3a5> 1977\n<a3a6> <a3a7> 12534\n<a3a8> <a3a9> 1978\n<a3aa> <a3aa> 12536\n<a3ab> <a3ab> 1980\n<a3ac> <a3b0> 12537\n<a3b1> <a3b1> 1981\n<a3b3> <a3b3> 1982\n<a3b4> <a3b4> 12542\n<a3b5> <a3b7> 1983\n<a3b8> <a3b8> 12543\n<a3b9> <a3b9> 1986\n<a3ba> <a3ba> 12544\n<a3bb> <a3bb> 1987\n<a3bc> <a3bd> 12545\n<a441> <a441> 375\n<a461> <a465> 1988\n<a466> <a467> 12547\n<a468> <a46c> 1993\nendcidrange\n\n100 begincidrange\n<a46d> <a470> 12549\n<a471> <a471> 1998\n<a473> <a473> 1999\n<a474> <a474> 12553\n<a475> <a475> 2000\n<a476> <a476> 12554\n<a477> <a477> 2001\n<a478> <a47a> 12555\n<a47b> <a47b> 2002\n<a47c> <a47d> 12558\n<a481> <a482> 2003\n<a483> <a484> 12560\n<a485> <a485> 2005\n<a486> <a488> 12562\n<a489> <a489> 2006\n<a48a> <a490> 12565\n<a491> <a491> 2007\n<a493> <a493> 2008\n<a494> <a494> 12572\n<a495> <a497> 2009\n<a498> <a49a> 12573\n<a49b> <a49b> 2012\n<a49c> <a49d> 12576\n<a4a1> <a4a2> 2013\n<a4a3> <a4a4> 12578\n<a4a5> <a4a5> 2015\n<a4a6> <a4b1> 12580\n<a4b3> <a4b3> 2016\n<a4b4> <a4bd> 12592\n<a4c1> <a4d1> 12602\n<a4d3> <a4dd> 12619\n<a4e1> <a4e2> 2017\n<a4e3> <a4e4> 12630\n<a4e5> <a4e5> 2019\n<a4e6> <a4e7> 12632\n<a4e8> <a4e9> 2020\n<a4ea> <a4ea> 12634\n<a4eb> <a4eb> 2022\n<a4ec> <a4f0> 12635\n<a4f1> <a4f1> 2023\n<a4f3> <a4f3> 2024\n<a4f4> <a4f4> 12640\n<a4f5> <a4f5> 2025\n<a4f6> <a4f6> 12641\n<a4f7> <a4f8> 2026\n<a4f9> <a4fd> 12642\n<a541> <a542> 2028\n<a543> <a544> 12647\n<a545> <a545> 2030\n<a546> <a547> 12649\n<a548> <a549> 2031\n<a54a> <a550> 12651\n<a551> <a551> 2033\n<a553> <a553> 2034\n<a554> <a554> 12658\n<a555> <a557> 2035\n<a558> <a55d> 12659\n<a561> <a562> 2038\n<a563> <a564> 12665\n<a565> <a565> 2040\n<a566> <a568> 12667\n<a569> <a569> 2041\n<a56a> <a571> 12670\n<a573> <a573> 2042\n<a574> <a574> 12678\n<a575> <a577> 2043\n<a578> <a57a> 12679\n<a57b> <a57b> 2046\n<a57c> <a57d> 12682\n<a581> <a581> 2047\n<a582> <a584> 12684\n<a585> <a585> 2048\n<a586> <a591> 12687\n<a593> <a59d> 12699\n<a5a1> <a5a3> 2049\n<a5a4> <a5a4> 12710\n<a5a5> <a5a5> 2052\n<a5a6> <a5a8> 12711\n<a5a9> <a5a9> 2053\n<a5aa> <a5b0> 12714\n<a5b1> <a5b1> 2054\n<a5b3> <a5b3> 2055\n<a5b4> <a5b4> 12721\n<a5b5> <a5b5> 2056\n<a5b6> <a5b6> 12722\n<a5b7> <a5b7> 2057\n<a5b8> <a5bd> 12723\n<a5c1> <a5c1> 2058\n<a5c2> <a5c4> 12729\n<a5c5> <a5c5> 2059\n<a5c6> <a5d1> 12732\n<a5d3> <a5d5> 12744\n<a5d6> <a5d6> 2060\n<a5d7> <a5dd> 12747\n<a5e1> <a5e1> 2061\n<a5e2> <a5f1> 12754\n<a5f3> <a5f5> 12770\n<a5f6> <a5f6> 2062\n<a5f7> <a5fd> 12773\n<a641> <a642> 2063\nendcidrange\n\n100 begincidrange\n<a643> <a644> 12780\n<a645> <a645> 2065\n<a646> <a648> 12782\n<a649> <a649> 2066\n<a64a> <a650> 12785\n<a651> <a651> 2067\n<a653> <a653> 2068\n<a654> <a65d> 12792\n<a661> <a661> 2069\n<a662> <a664> 12802\n<a665> <a665> 2070\n<a666> <a671> 12805\n<a673> <a67d> 12817\n<a681> <a682> 2071\n<a683> <a684> 12828\n<a685> <a685> 2073\n<a686> <a687> 12830\n<a688> <a68b> 2074\n<a68c> <a690> 12832\n<a691> <a691> 2078\n<a693> <a693> 2079\n<a694> <a694> 12837\n<a695> <a695> 2080\n<a696> <a696> 12838\n<a697> <a697> 2081\n<a698> <a69a> 12839\n<a69b> <a69c> 2082\n<a69d> <a69d> 12842\n<a6a1> <a6a1> 2084\n<a6a2> <a6a8> 12843\n<a6a9> <a6a9> 2085\n<a6aa> <a6b1> 12850\n<a6b3> <a6b5> 12858\n<a6b6> <a6b6> 2086\n<a6b7> <a6bd> 12861\n<a6c1> <a6c1> 2087\n<a6c2> <a6d1> 12868\n<a6d3> <a6dd> 12884\n<a6e1> <a6e2> 2088\n<a6e3> <a6e4> 12895\n<a6e5> <a6e5> 2090\n<a6e6> <a6e8> 12897\n<a6e9> <a6e9> 2091\n<a6ea> <a6f1> 12900\n<a6f3> <a6f6> 12908\n<a6f7> <a6f7> 2092\n<a6f8> <a6fd> 12912\n<a741> <a741> 2093\n<a742> <a744> 12918\n<a745> <a745> 2094\n<a746> <a748> 12921\n<a749> <a749> 2095\n<a74a> <a750> 12924\n<a751> <a751> 2096\n<a753> <a754> 12931\n<a755> <a755> 2097\n<a756> <a756> 12933\n<a757> <a757> 2098\n<a758> <a75d> 12934\n<a761> <a762> 2099\n<a763> <a764> 12940\n<a765> <a765> 2101\n<a766> <a768> 12942\n<a769> <a769> 2102\n<a76a> <a770> 12945\n<a771> <a771> 2103\n<a773> <a773> 2104\n<a774> <a774> 12952\n<a775> <a775> 2105\n<a776> <a77d> 12953\n<a781> <a791> 12961\n<a793> <a79d> 12978\n<a7a1> <a7a2> 2106\n<a7a3> <a7a4> 12989\n<a7a5> <a7a5> 2108\n<a7a6> <a7a8> 12991\n<a7a9> <a7a9> 2109\n<a7aa> <a7aa> 12994\n<a7ab> <a7ab> 2110\n<a7ac> <a7b0> 12995\n<a7b1> <a7b1> 2111\n<a7b3> <a7b3> 2112\n<a7b4> <a7b4> 13000\n<a7b5> <a7b5> 2113\n<a7b6> <a7b6> 13001\n<a7b7> <a7b9> 2114\n<a7ba> <a7bd> 13002\n<a841> <a841> 376\n<a861> <a862> 2117\n<a863> <a864> 13006\n<a865> <a865> 2119\n<a866> <a868> 13008\n<a869> <a869> 2120\n<a86a> <a86a> 13011\n<a86b> <a86b> 2121\n<a86c> <a870> 13012\n<a871> <a871> 2122\n<a873> <a873> 2123\n<a874> <a874> 13017\n<a875> <a877> 2124\nendcidrange\n\n100 begincidrange\n<a878> <a87c> 13018\n<a87d> <a87d> 2127\n<a881> <a882> 2128\n<a883> <a884> 13023\n<a885> <a885> 2130\n<a886> <a888> 13025\n<a889> <a889> 2131\n<a88a> <a890> 13028\n<a891> <a891> 2132\n<a893> <a893> 2133\n<a894> <a894> 13035\n<a895> <a897> 2134\n<a898> <a89d> 13036\n<a8a1> <a8a2> 2137\n<a8a3> <a8b0> 13042\n<a8b1> <a8b1> 2139\n<a8b3> <a8bd> 13056\n<a8c1> <a8d1> 13067\n<a8d3> <a8dd> 13084\n<a8e1> <a8e2> 2140\n<a8e3> <a8e4> 13095\n<a8e5> <a8e5> 2142\n<a8e6> <a8e7> 13097\n<a8e8> <a8e9> 2143\n<a8ea> <a8f0> 13099\n<a8f1> <a8f1> 2145\n<a8f3> <a8f4> 13106\n<a8f5> <a8f7> 2146\n<a8f8> <a8fd> 13108\n<a941> <a941> 2149\n<a942> <a951> 13114\n<a953> <a956> 13130\n<a957> <a957> 2150\n<a958> <a95d> 13134\n<a961> <a962> 2151\n<a963> <a970> 13140\n<a971> <a971> 2153\n<a973> <a973> 2154\n<a974> <a974> 13154\n<a975> <a977> 2155\n<a978> <a97d> 13155\n<a981> <a991> 13161\n<a993> <a99d> 13178\n<a9a1> <a9a2> 2158\n<a9a3> <a9a4> 13189\n<a9a5> <a9a5> 2160\n<a9a6> <a9a8> 13191\n<a9a9> <a9a9> 2161\n<a9aa> <a9b0> 13194\n<a9b1> <a9b1> 2162\n<a9b3> <a9b3> 2163\n<a9b4> <a9b6> 13201\n<a9b7> <a9b7> 2164\n<a9b8> <a9bd> 13204\n<a9c1> <a9d1> 13210\n<a9d3> <a9dd> 13227\n<a9e1> <a9f1> 13238\n<a9f3> <a9fd> 13255\n<aa41> <aa41> 2165\n<aa42> <aa51> 13266\n<aa53> <aa5d> 13282\n<aa61> <aa61> 2166\n<aa62> <aa71> 13293\n<aa73> <aa76> 13309\n<aa77> <aa77> 2167\n<aa78> <aa7d> 13313\n<aa81> <aa82> 2168\n<aa83> <aa84> 13319\n<aa85> <aa85> 2170\n<aa86> <aa88> 13321\n<aa89> <aa89> 2171\n<aa8a> <aa90> 13324\n<aa91> <aa91> 2172\n<aa93> <aa94> 13331\n<aa95> <aa95> 2173\n<aa96> <aa96> 13333\n<aa97> <aa97> 2174\n<aa98> <aa9d> 13334\n<aaa1> <aab1> 13340\n<aab3> <aabd> 13357\n<aac1> <aad1> 13368\n<aad3> <aadd> 13385\n<aae1> <aaf1> 13396\n<aaf3> <aafd> 13413\n<ab41> <ab41> 2175\n<ab42> <ab51> 13424\n<ab53> <ab56> 13440\n<ab57> <ab57> 2176\n<ab58> <ab5d> 13444\n<ab61> <ab61> 2177\n<ab62> <ab64> 13450\n<ab65> <ab65> 2178\n<ab66> <ab68> 13453\n<ab69> <ab69> 2179\n<ab6a> <ab70> 13456\n<ab71> <ab71> 2180\n<ab73> <ab73> 2181\n<ab74> <ab7d> 13463\n<ab81> <ab91> 13473\n<ab93> <ab9d> 13490\nendcidrange\n\n100 begincidrange\n<aba1> <aba2> 2182\n<aba3> <aba4> 13501\n<aba5> <aba5> 2184\n<aba6> <aba8> 13503\n<aba9> <aba9> 2185\n<abaa> <abb0> 13506\n<abb1> <abb1> 2186\n<abb3> <abb3> 2187\n<abb4> <abb4> 13513\n<abb5> <abb5> 2188\n<abb6> <abb6> 13514\n<abb7> <abb7> 2189\n<abb8> <abbd> 13515\n<ac41> <ac41> 378\n<ac61> <ac62> 2190\n<ac63> <ac63> 13521\n<ac64> <ac65> 2192\n<ac66> <ac67> 13522\n<ac68> <ac6b> 2194\n<ac6c> <ac70> 13524\n<ac71> <ac71> 2198\n<ac73> <ac73> 2199\n<ac74> <ac74> 13529\n<ac75> <ac77> 2200\n<ac78> <ac7a> 13530\n<ac7b> <ac7b> 2203\n<ac7c> <ac7d> 13533\n<ac81> <ac82> 2204\n<ac83> <ac84> 13535\n<ac85> <ac85> 2206\n<ac86> <ac88> 13537\n<ac89> <ac89> 2207\n<ac8a> <ac90> 13540\n<ac91> <ac91> 2208\n<ac93> <ac93> 2209\n<ac94> <ac94> 13547\n<ac95> <ac97> 2210\n<ac98> <ac9d> 13548\n<aca1> <aca2> 2213\n<aca3> <aca4> 13554\n<aca5> <aca5> 2215\n<aca6> <aca8> 13556\n<aca9> <aca9> 2216\n<acaa> <acb0> 13559\n<acb1> <acb1> 2217\n<acb3> <acb3> 2218\n<acb4> <acb4> 13566\n<acb5> <acb5> 2219\n<acb6> <acb6> 13567\n<acb7> <acb7> 2220\n<acb8> <acbd> 13568\n<acc1> <acc1> 2221\n<acc2> <acc4> 13574\n<acc5> <acc5> 2222\n<acc6> <acc8> 13577\n<acc9> <acc9> 2223\n<acca> <acd0> 13580\n<acd1> <acd1> 2224\n<acd3> <acd6> 13587\n<acd7> <acd7> 2225\n<acd8> <acdd> 13591\n<ace1> <ace5> 2226\n<ace6> <ace7> 13597\n<ace8> <ace9> 2231\n<acea> <acea> 13599\n<aceb> <acec> 2233\n<aced> <acf0> 13600\n<acf1> <acf1> 2235\n<acf3> <acf3> 2236\n<acf4> <acf4> 13604\n<acf5> <acf7> 2237\n<acf8> <acfb> 13605\n<acfc> <acfc> 2240\n<acfd> <acfd> 13609\n<ad41> <ad42> 2241\n<ad43> <ad44> 13610\n<ad45> <ad45> 2243\n<ad46> <ad48> 13612\n<ad49> <ad49> 2244\n<ad4a> <ad50> 13615\n<ad51> <ad51> 2245\n<ad53> <ad53> 2246\n<ad54> <ad54> 13622\n<ad55> <ad57> 2247\n<ad58> <ad5d> 13623\n<ad61> <ad62> 2250\n<ad63> <ad64> 13629\n<ad65> <ad65> 2252\n<ad66> <ad68> 13631\n<ad69> <ad69> 2253\n<ad6a> <ad70> 13634\n<ad71> <ad71> 2254\n<ad73> <ad73> 2255\n<ad74> <ad74> 13641\n<ad75> <ad77> 2256\n<ad78> <ad7d> 13642\n<ad81> <ad81> 2259\n<ad82> <ad84> 13648\n<ad85> <ad85> 2260\n<ad86> <ad88> 13651\nendcidrange\n\n100 begincidrange\n<ad89> <ad89> 2261\n<ad8a> <ad91> 13654\n<ad93> <ad96> 13662\n<ad97> <ad97> 2262\n<ad98> <ad9d> 13666\n<ada1> <ada3> 2263\n<ada4> <ada4> 13672\n<ada5> <ada5> 2266\n<ada6> <ada8> 13673\n<ada9> <ada9> 2267\n<adaa> <adaa> 13676\n<adab> <adab> 2268\n<adac> <adb0> 13677\n<adb1> <adb1> 2269\n<adb3> <adb3> 2270\n<adb4> <adb4> 13682\n<adb5> <adb5> 2271\n<adb6> <adb6> 13683\n<adb7> <adb7> 2272\n<adb8> <adba> 13684\n<adbb> <adbb> 2273\n<adbc> <adbd> 13687\n<adc1> <adc2> 2274\n<adc3> <adc4> 13689\n<adc5> <adc5> 2276\n<adc6> <adc8> 13691\n<adc9> <adc9> 2277\n<adca> <add1> 13694\n<add3> <add6> 13702\n<add7> <add7> 2278\n<add8> <addd> 13706\n<ade1> <ade1> 2279\n<ade2> <ade4> 13712\n<ade5> <ade5> 2280\n<ade6> <ade8> 13715\n<ade9> <ade9> 2281\n<adea> <adf0> 13718\n<adf1> <adf1> 2282\n<adf3> <adf4> 13725\n<adf5> <adf6> 2283\n<adf7> <adfd> 13727\n<ae41> <ae41> 2285\n<ae42> <ae44> 13734\n<ae45> <ae45> 2286\n<ae46> <ae48> 13737\n<ae49> <ae49> 2287\n<ae4a> <ae50> 13740\n<ae51> <ae51> 2288\n<ae53> <ae53> 2289\n<ae54> <ae54> 13747\n<ae55> <ae55> 2290\n<ae56> <ae5d> 13748\n<ae61> <ae62> 2291\n<ae63> <ae64> 13756\n<ae65> <ae65> 2293\n<ae66> <ae68> 13758\n<ae69> <ae69> 2294\n<ae6a> <ae70> 13761\n<ae71> <ae71> 2295\n<ae73> <ae73> 2296\n<ae74> <ae74> 13768\n<ae75> <ae75> 2297\n<ae76> <ae76> 13769\n<ae77> <ae77> 2298\n<ae78> <ae7d> 13770\n<ae81> <ae82> 2299\n<ae83> <ae84> 13776\n<ae85> <ae85> 2301\n<ae86> <ae87> 13778\n<ae88> <ae89> 2302\n<ae8a> <ae90> 13780\n<ae91> <ae91> 2304\n<ae93> <ae93> 2305\n<ae94> <ae94> 13787\n<ae95> <ae95> 2306\n<ae96> <ae96> 13788\n<ae97> <ae97> 2307\n<ae98> <ae98> 13789\n<ae99> <ae99> 2308\n<ae9a> <ae9a> 13790\n<ae9b> <ae9c> 2309\n<ae9d> <ae9d> 13791\n<aea1> <aea1> 2311\n<aea2> <aeb1> 13792\n<aeb3> <aeb5> 13808\n<aeb6> <aeb6> 2312\n<aeb7> <aebd> 13811\n<aec1> <aec2> 2313\n<aec3> <aec4> 13818\n<aec5> <aec5> 2315\n<aec6> <aec8> 13820\n<aec9> <aec9> 2316\n<aeca> <aed0> 13823\n<aed1> <aed1> 2317\n<aed3> <aed6> 13830\n<aed7> <aed7> 2318\n<aed8> <aedd> 13834\n<aee1> <aee2> 2319\n<aee3> <aee4> 13840\n<aee5> <aee5> 2321\nendcidrange\n\n100 begincidrange\n<aee6> <aee8> 13842\n<aee9> <aee9> 2322\n<aeea> <aef0> 13845\n<aef1> <aef1> 2323\n<aef3> <aef3> 2324\n<aef4> <aef4> 13852\n<aef5> <aef5> 2325\n<aef6> <aef6> 13853\n<aef7> <aef7> 2326\n<aef8> <aefd> 13854\n<af41> <af42> 2327\n<af43> <af48> 13860\n<af49> <af49> 2329\n<af4a> <af50> 13866\n<af51> <af51> 2330\n<af53> <af54> 13873\n<af55> <af55> 2331\n<af56> <af56> 13875\n<af57> <af57> 2332\n<af58> <af5d> 13876\n<af61> <af62> 2333\n<af63> <af64> 13882\n<af65> <af65> 2335\n<af66> <af68> 13884\n<af69> <af6a> 2336\n<af6b> <af70> 13887\n<af71> <af71> 2338\n<af73> <af73> 2339\n<af74> <af74> 13893\n<af75> <af75> 2340\n<af76> <af76> 13894\n<af77> <af77> 2341\n<af78> <af7d> 13895\n<af81> <af91> 13901\n<af93> <af9d> 13918\n<afa1> <afa2> 2342\n<afa3> <afa4> 13929\n<afa5> <afa5> 2344\n<afa6> <afa7> 13931\n<afa8> <afa9> 2345\n<afaa> <afaf> 13933\n<afb0> <afb1> 2347\n<afb3> <afb3> 2349\n<afb4> <afb4> 13939\n<afb5> <afb5> 2350\n<afb6> <afb6> 13940\n<afb7> <afb7> 2351\n<afb8> <afbb> 13941\n<afbc> <afbc> 2352\n<afbd> <afbd> 13945\n<b041> <b041> 379\n<b061> <b062> 2353\n<b063> <b063> 13946\n<b064> <b065> 2355\n<b066> <b068> 13947\n<b069> <b069> 2357\n<b06a> <b070> 13950\n<b071> <b071> 2358\n<b073> <b073> 2359\n<b074> <b075> 13957\n<b076> <b077> 2360\n<b078> <b07c> 13959\n<b07d> <b07d> 2362\n<b081> <b082> 2363\n<b083> <b084> 13964\n<b085> <b085> 2365\n<b086> <b088> 13966\n<b089> <b089> 2366\n<b08a> <b090> 13969\n<b091> <b091> 2367\n<b093> <b093> 2368\n<b094> <b095> 13976\n<b096> <b097> 2369\n<b098> <b09d> 13978\n<b0a1> <b0b1> 13984\n<b0b3> <b0b6> 14001\n<b0b7> <b0b7> 2371\n<b0b8> <b0bd> 14005\n<b0c1> <b0d1> 14011\n<b0d3> <b0dd> 14028\n<b0e1> <b0e2> 2372\n<b0e3> <b0e4> 14039\n<b0e5> <b0e5> 2374\n<b0e6> <b0e8> 14041\n<b0e9> <b0e9> 2375\n<b0ea> <b0ea> 14044\n<b0eb> <b0eb> 2376\n<b0ec> <b0f0> 14045\n<b0f1> <b0f1> 2377\n<b0f3> <b0f3> 2378\n<b0f4> <b0f5> 14050\n<b0f6> <b0f7> 2379\n<b0f8> <b0fd> 14052\n<b141> <b141> 2381\n<b142> <b144> 14058\n<b145> <b145> 2382\n<b146> <b148> 14061\n<b149> <b149> 2383\n<b14a> <b151> 14064\n<b153> <b15d> 14072\nendcidrange\n\n100 begincidrange\n<b161> <b171> 14083\n<b173> <b17d> 14100\n<b181> <b184> 14111\n<b185> <b185> 2384\n<b186> <b191> 14115\n<b193> <b19d> 14127\n<b1a1> <b1a2> 2385\n<b1a3> <b1a4> 14138\n<b1a5> <b1a5> 2387\n<b1a6> <b1a7> 14140\n<b1a8> <b1a9> 2388\n<b1aa> <b1aa> 14142\n<b1ab> <b1ab> 2390\n<b1ac> <b1b0> 14143\n<b1b1> <b1b1> 2391\n<b1b3> <b1b3> 2392\n<b1b4> <b1b6> 14148\n<b1b7> <b1b7> 2393\n<b1b8> <b1bd> 14151\n<b1c1> <b1c2> 2394\n<b1c3> <b1c4> 14157\n<b1c5> <b1c5> 2396\n<b1c6> <b1d1> 14159\n<b1d3> <b1d5> 14171\n<b1d6> <b1d6> 2397\n<b1d7> <b1dd> 14174\n<b1e1> <b1e1> 2398\n<b1e2> <b1f1> 14181\n<b1f3> <b1f5> 14197\n<b1f6> <b1f6> 2399\n<b1f7> <b1fd> 14200\n<b241> <b241> 2400\n<b242> <b244> 14207\n<b245> <b245> 2401\n<b246> <b248> 14210\n<b249> <b249> 2402\n<b24a> <b250> 14213\n<b251> <b251> 2403\n<b253> <b253> 2404\n<b254> <b25d> 14220\n<b261> <b261> 2405\n<b262> <b271> 14230\n<b273> <b27d> 14246\n<b281> <b282> 2406\n<b283> <b284> 14257\n<b285> <b285> 2408\n<b286> <b288> 14259\n<b289> <b289> 2409\n<b28a> <b290> 14262\n<b291> <b291> 2410\n<b293> <b293> 2411\n<b294> <b296> 14269\n<b297> <b297> 2412\n<b298> <b29d> 14272\n<b2a1> <b2a1> 2413\n<b2a2> <b2b1> 14278\n<b2b3> <b2b5> 14294\n<b2b6> <b2b6> 2414\n<b2b7> <b2bd> 14297\n<b2c1> <b2c1> 2415\n<b2c2> <b2d1> 14304\n<b2d3> <b2dd> 14320\n<b2e1> <b2e1> 2416\n<b2e2> <b2e4> 14331\n<b2e5> <b2e5> 2417\n<b2e6> <b2f1> 14334\n<b2f3> <b2fd> 14346\n<b341> <b351> 14357\n<b353> <b356> 14374\n<b357> <b357> 2418\n<b358> <b35d> 14378\n<b361> <b362> 2419\n<b363> <b364> 14384\n<b365> <b365> 2421\n<b366> <b368> 14386\n<b369> <b369> 2422\n<b36a> <b36a> 14389\n<b36b> <b36b> 2423\n<b36c> <b36f> 14390\n<b370> <b371> 2424\n<b373> <b373> 2426\n<b374> <b37d> 14394\n<b381> <b381> 2427\n<b382> <b384> 14404\n<b385> <b385> 2428\n<b386> <b388> 14407\n<b389> <b389> 2429\n<b38a> <b390> 14410\n<b391> <b391> 2430\n<b393> <b39d> 14417\n<b3a1> <b3a2> 2431\n<b3a3> <b3a4> 14428\n<b3a5> <b3a5> 2433\n<b3a6> <b3a8> 14430\n<b3a9> <b3a9> 2434\n<b3aa> <b3b0> 14433\n<b3b1> <b3b1> 2435\n<b3b3> <b3b3> 2436\n<b3b4> <b3b4> 14440\n<b3b5> <b3b5> 2437\nendcidrange\n\n100 begincidrange\n<b3b6> <b3b6> 14441\n<b3b7> <b3b7> 2438\n<b3b8> <b3bd> 14442\n<b441> <b441> 380\n<b461> <b462> 2439\n<b463> <b464> 14448\n<b465> <b467> 2441\n<b468> <b468> 14450\n<b469> <b46b> 2444\n<b46c> <b46f> 14451\n<b470> <b471> 2447\n<b473> <b473> 2449\n<b474> <b474> 14455\n<b475> <b477> 2450\n<b478> <b47a> 14456\n<b47b> <b47c> 2453\n<b47d> <b47d> 14459\n<b481> <b482> 2455\n<b483> <b484> 14460\n<b485> <b485> 2457\n<b486> <b488> 14462\n<b489> <b489> 2458\n<b48a> <b490> 14465\n<b491> <b491> 2459\n<b493> <b493> 2460\n<b494> <b494> 14472\n<b495> <b497> 2461\n<b498> <b49d> 14473\n<b4a1> <b4a2> 2464\n<b4a3> <b4a4> 14479\n<b4a5> <b4a5> 2466\n<b4a6> <b4a8> 14481\n<b4a9> <b4a9> 2467\n<b4aa> <b4ab> 14484\n<b4ac> <b4ac> 2468\n<b4ad> <b4b0> 14486\n<b4b1> <b4b1> 2469\n<b4b3> <b4b3> 2470\n<b4b4> <b4b4> 14490\n<b4b5> <b4b5> 2471\n<b4b6> <b4b6> 14491\n<b4b7> <b4b7> 2472\n<b4b8> <b4ba> 14492\n<b4bb> <b4bb> 2473\n<b4bc> <b4bc> 14495\n<b4bd> <b4bd> 2474\n<b4c1> <b4c1> 2475\n<b4c2> <b4c4> 14496\n<b4c5> <b4c5> 2476\n<b4c6> <b4c8> 14499\n<b4c9> <b4c9> 2477\n<b4ca> <b4d1> 14502\n<b4d3> <b4d3> 2478\n<b4d4> <b4dd> 14510\n<b4e1> <b4e2> 2479\n<b4e3> <b4e4> 14520\n<b4e5> <b4e6> 2481\n<b4e7> <b4e7> 14522\n<b4e8> <b4eb> 2483\n<b4ec> <b4f0> 14523\n<b4f1> <b4f1> 2487\n<b4f3> <b4f8> 2488\n<b4f9> <b4f9> 14528\n<b4fa> <b4fa> 2494\n<b4fb> <b4fb> 14529\n<b4fc> <b4fc> 2495\n<b4fd> <b4fd> 14530\n<b541> <b542> 2496\n<b543> <b544> 14531\n<b545> <b545> 2498\n<b546> <b548> 14533\n<b549> <b549> 2499\n<b54a> <b550> 14536\n<b551> <b551> 2500\n<b553> <b553> 2501\n<b554> <b554> 14543\n<b555> <b555> 2502\n<b556> <b556> 14544\n<b557> <b557> 2503\n<b558> <b55d> 14545\n<b561> <b563> 2504\n<b564> <b564> 14551\n<b565> <b565> 2507\n<b566> <b568> 14552\n<b569> <b569> 2508\n<b56a> <b56a> 14555\n<b56b> <b56c> 2509\n<b56d> <b570> 14556\n<b571> <b571> 2511\n<b573> <b577> 2512\n<b578> <b57a> 14560\n<b57b> <b57d> 2517\n<b581> <b581> 2520\n<b582> <b584> 14563\n<b585> <b585> 2521\n<b586> <b588> 14566\n<b589> <b589> 2522\n<b58a> <b590> 14569\n<b591> <b591> 2523\n<b593> <b593> 2524\nendcidrange\n\n100 begincidrange\n<b594> <b594> 14576\n<b595> <b596> 2525\n<b597> <b59d> 14577\n<b5a1> <b5a2> 2527\n<b5a3> <b5a4> 14584\n<b5a5> <b5a5> 2529\n<b5a6> <b5a8> 14586\n<b5a9> <b5ab> 2530\n<b5ac> <b5ac> 14589\n<b5ad> <b5ad> 2533\n<b5ae> <b5af> 14590\n<b5b0> <b5b1> 2534\n<b5b3> <b5b3> 2536\n<b5b4> <b5b4> 14592\n<b5b5> <b5b5> 2537\n<b5b6> <b5b6> 14593\n<b5b7> <b5b7> 2538\n<b5b8> <b5b8> 14594\n<b5b9> <b5b9> 2539\n<b5ba> <b5bd> 14595\n<b5c1> <b5c2> 2540\n<b5c3> <b5c4> 14599\n<b5c5> <b5c5> 2542\n<b5c6> <b5c8> 14601\n<b5c9> <b5c9> 2543\n<b5ca> <b5d0> 14604\n<b5d1> <b5d1> 2544\n<b5d3> <b5d3> 2545\n<b5d4> <b5d4> 14611\n<b5d5> <b5d7> 2546\n<b5d8> <b5dd> 14612\n<b5e1> <b5e2> 2549\n<b5e3> <b5e4> 14618\n<b5e5> <b5e5> 2551\n<b5e6> <b5f0> 14620\n<b5f1> <b5f1> 2552\n<b5f3> <b5f4> 14631\n<b5f5> <b5f5> 2553\n<b5f6> <b5f6> 14633\n<b5f7> <b5f7> 2554\n<b5f8> <b5fd> 14634\n<b641> <b642> 2555\n<b643> <b644> 14640\n<b645> <b645> 2557\n<b646> <b648> 14642\n<b649> <b649> 2558\n<b64a> <b650> 14645\n<b651> <b651> 2559\n<b653> <b653> 2560\n<b654> <b654> 14652\n<b655> <b655> 2561\n<b656> <b656> 14653\n<b657> <b657> 2562\n<b658> <b65d> 14654\n<b661> <b662> 2563\n<b663> <b664> 14660\n<b665> <b665> 2565\n<b666> <b668> 14662\n<b669> <b669> 2566\n<b66a> <b670> 14665\n<b671> <b671> 2567\n<b673> <b673> 2568\n<b674> <b674> 14672\n<b675> <b675> 2569\n<b676> <b676> 14673\n<b677> <b677> 2570\n<b678> <b67d> 14674\n<b681> <b682> 2571\n<b683> <b684> 14680\n<b685> <b685> 2573\n<b686> <b688> 14682\n<b689> <b68b> 2574\n<b68c> <b690> 14685\n<b691> <b691> 2577\n<b693> <b693> 2578\n<b694> <b694> 14690\n<b695> <b695> 2579\n<b696> <b696> 14691\n<b697> <b697> 2580\n<b698> <b69d> 14692\n<b6a1> <b6a2> 2581\n<b6a3> <b6a4> 14698\n<b6a5> <b6a5> 2583\n<b6a6> <b6a8> 14700\n<b6a9> <b6a9> 2584\n<b6aa> <b6b0> 14703\n<b6b1> <b6b1> 2585\n<b6b3> <b6b3> 2586\n<b6b4> <b6b5> 14710\n<b6b6> <b6b7> 2587\n<b6b8> <b6bd> 14712\n<b6c1> <b6c2> 2589\n<b6c3> <b6c4> 14718\n<b6c5> <b6c5> 2591\n<b6c6> <b6c8> 14720\n<b6c9> <b6c9> 2592\n<b6ca> <b6d0> 14723\n<b6d1> <b6d1> 2593\n<b6d3> <b6d3> 2594\n<b6d4> <b6d6> 14730\nendcidrange\n\n100 begincidrange\n<b6d7> <b6d7> 2595\n<b6d8> <b6dd> 14733\n<b6e1> <b6e2> 2596\n<b6e3> <b6e4> 14739\n<b6e5> <b6e5> 2598\n<b6e6> <b6e8> 14741\n<b6e9> <b6e9> 2599\n<b6ea> <b6f0> 14744\n<b6f1> <b6f1> 2600\n<b6f3> <b6f3> 2601\n<b6f4> <b6f4> 14751\n<b6f5> <b6f5> 2602\n<b6f6> <b6f6> 14752\n<b6f7> <b6f7> 2603\n<b6f8> <b6fd> 14753\n<b741> <b742> 2604\n<b743> <b744> 14759\n<b745> <b745> 2606\n<b746> <b748> 14761\n<b749> <b749> 2607\n<b74a> <b750> 14764\n<b751> <b751> 2608\n<b753> <b753> 2609\n<b754> <b754> 14771\n<b755> <b755> 2610\n<b756> <b756> 14772\n<b757> <b757> 2611\n<b758> <b758> 14773\n<b759> <b759> 2612\n<b75a> <b75d> 14774\n<b761> <b762> 2613\n<b763> <b764> 14778\n<b765> <b765> 2615\n<b766> <b768> 14780\n<b769> <b769> 2616\n<b76a> <b76e> 14783\n<b76f> <b76f> 2617\n<b770> <b770> 14788\n<b771> <b771> 2618\n<b773> <b773> 2619\n<b774> <b774> 14789\n<b775> <b775> 2620\n<b776> <b776> 14790\n<b777> <b77d> 2621\n<b781> <b781> 2628\n<b782> <b784> 14791\n<b785> <b785> 2629\n<b786> <b788> 14794\n<b789> <b789> 2630\n<b78a> <b790> 14797\n<b791> <b791> 2631\n<b793> <b794> 14804\n<b795> <b795> 2632\n<b796> <b79d> 14806\n<b7a1> <b7a2> 2633\n<b7a3> <b7a4> 14814\n<b7a5> <b7a5> 2635\n<b7a6> <b7a8> 14816\n<b7a9> <b7ab> 2636\n<b7ac> <b7af> 14819\n<b7b0> <b7b1> 2639\n<b7b3> <b7b3> 2641\n<b7b4> <b7b4> 14823\n<b7b5> <b7b8> 2642\n<b7b9> <b7bb> 14824\n<b7bc> <b7bc> 2646\n<b7bd> <b7bd> 14827\n<b841> <b841> 381\n<b861> <b862> 2647\n<b863> <b864> 14828\n<b865> <b865> 2649\n<b866> <b866> 14830\n<b867> <b869> 2650\n<b86a> <b86a> 14831\n<b86b> <b86b> 2653\n<b86c> <b870> 14832\n<b871> <b871> 2654\n<b873> <b873> 2655\n<b874> <b874> 14837\n<b875> <b878> 2656\n<b879> <b87d> 14838\n<b881> <b882> 2660\n<b883> <b884> 14843\n<b885> <b885> 2662\n<b886> <b888> 14845\n<b889> <b889> 2663\n<b88a> <b890> 14848\n<b891> <b891> 2664\n<b893> <b893> 2665\n<b894> <b894> 14855\n<b895> <b897> 2666\n<b898> <b89d> 14856\n<b8a1> <b8a2> 2669\n<b8a3> <b8a4> 14862\n<b8a5> <b8a5> 2671\n<b8a6> <b8a6> 14864\n<b8a7> <b8a7> 2672\n<b8a8> <b8a8> 14865\n<b8a9> <b8a9> 2673\n<b8aa> <b8b0> 14866\nendcidrange\n\n100 begincidrange\n<b8b1> <b8b1> 2674\n<b8b3> <b8b6> 14873\n<b8b7> <b8b7> 2675\n<b8b8> <b8bd> 14877\n<b8c1> <b8c1> 2676\n<b8c2> <b8c4> 14883\n<b8c5> <b8c5> 2677\n<b8c6> <b8c8> 14886\n<b8c9> <b8c9> 2678\n<b8ca> <b8d1> 14889\n<b8d3> <b8dd> 14897\n<b8e1> <b8e2> 2679\n<b8e3> <b8e4> 14908\n<b8e5> <b8e5> 2681\n<b8e6> <b8e8> 14910\n<b8e9> <b8e9> 2682\n<b8ea> <b8ea> 14913\n<b8eb> <b8eb> 2683\n<b8ec> <b8f0> 14914\n<b8f1> <b8f1> 2684\n<b8f3> <b8f3> 2685\n<b8f4> <b8f4> 14919\n<b8f5> <b8f5> 2686\n<b8f6> <b8f6> 14920\n<b8f7> <b8f8> 2687\n<b8f9> <b8fd> 14921\n<b941> <b942> 2689\n<b943> <b944> 14926\n<b945> <b945> 2691\n<b946> <b948> 14928\n<b949> <b949> 2692\n<b94a> <b950> 14931\n<b951> <b951> 2693\n<b953> <b953> 2694\n<b954> <b954> 14938\n<b955> <b955> 2695\n<b956> <b956> 14939\n<b957> <b957> 2696\n<b958> <b95d> 14940\n<b961> <b961> 2697\n<b962> <b964> 14946\n<b965> <b965> 2698\n<b966> <b968> 14949\n<b969> <b969> 2699\n<b96a> <b970> 14952\n<b971> <b971> 2700\n<b973> <b973> 2701\n<b974> <b975> 14959\n<b976> <b977> 2702\n<b978> <b97d> 14961\n<b981> <b981> 2704\n<b982> <b991> 14967\n<b993> <b99d> 14983\n<b9a1> <b9a2> 2705\n<b9a3> <b9a4> 14994\n<b9a5> <b9a5> 2707\n<b9a6> <b9a8> 14996\n<b9a9> <b9a9> 2708\n<b9aa> <b9aa> 14999\n<b9ab> <b9ab> 2709\n<b9ac> <b9b0> 15000\n<b9b1> <b9b1> 2710\n<b9b3> <b9b3> 2711\n<b9b4> <b9b4> 15005\n<b9b5> <b9b5> 2712\n<b9b6> <b9b6> 15006\n<b9b7> <b9b9> 2713\n<b9ba> <b9bc> 15007\n<b9bd> <b9bd> 2716\n<b9c1> <b9c2> 2717\n<b9c3> <b9c8> 15010\n<b9c9> <b9c9> 2719\n<b9ca> <b9d1> 15016\n<b9d3> <b9d3> 2720\n<b9d4> <b9d4> 15024\n<b9d5> <b9d5> 2721\n<b9d6> <b9d6> 15025\n<b9d7> <b9d7> 2722\n<b9d8> <b9dd> 15026\n<b9e1> <b9e1> 2723\n<b9e2> <b9f1> 15032\n<b9f3> <b9f5> 15048\n<b9f6> <b9f7> 2724\n<b9f8> <b9fd> 15051\n<ba41> <ba41> 2726\n<ba42> <ba44> 15057\n<ba45> <ba45> 2727\n<ba46> <ba48> 15060\n<ba49> <ba49> 2728\n<ba4a> <ba50> 15063\n<ba51> <ba51> 2729\n<ba53> <ba53> 2730\n<ba54> <ba54> 15070\n<ba55> <ba55> 2731\n<ba56> <ba56> 15071\n<ba57> <ba57> 2732\n<ba58> <ba5d> 15072\n<ba61> <ba62> 2733\n<ba63> <ba64> 15078\n<ba65> <ba65> 2735\nendcidrange\n\n100 begincidrange\n<ba66> <ba71> 15080\n<ba73> <ba76> 15092\n<ba77> <ba77> 2736\n<ba78> <ba7d> 15096\n<ba81> <ba82> 2737\n<ba83> <ba84> 15102\n<ba85> <ba85> 2739\n<ba86> <ba88> 15104\n<ba89> <ba8b> 2740\n<ba8c> <ba90> 15107\n<ba91> <ba91> 2743\n<ba93> <ba93> 2744\n<ba94> <ba94> 15112\n<ba95> <ba95> 2745\n<ba96> <ba96> 15113\n<ba97> <ba97> 2746\n<ba98> <ba9d> 15114\n<baa1> <baa1> 2747\n<baa2> <bab1> 15120\n<bab3> <bab5> 15136\n<bab6> <bab6> 2748\n<bab7> <babd> 15139\n<bac1> <bac1> 2749\n<bac2> <bad1> 15146\n<bad3> <badd> 15162\n<bae1> <bae2> 2750\n<bae3> <bae4> 15173\n<bae5> <bae5> 2752\n<bae6> <bae8> 15175\n<bae9> <bae9> 2753\n<baea> <baf0> 15178\n<baf1> <baf1> 2754\n<baf3> <baf3> 2755\n<baf4> <baf4> 15185\n<baf5> <baf5> 2756\n<baf6> <bafd> 15186\n<bb41> <bb41> 2757\n<bb42> <bb44> 15194\n<bb45> <bb45> 2758\n<bb46> <bb48> 15197\n<bb49> <bb49> 2759\n<bb4a> <bb50> 15200\n<bb51> <bb51> 2760\n<bb53> <bb5d> 15207\n<bb61> <bb62> 2761\n<bb63> <bb64> 15218\n<bb65> <bb65> 2763\n<bb66> <bb68> 15220\n<bb69> <bb69> 2764\n<bb6a> <bb70> 15223\n<bb71> <bb71> 2765\n<bb73> <bb73> 2766\n<bb74> <bb74> 15230\n<bb75> <bb75> 2767\n<bb76> <bb76> 15231\n<bb77> <bb77> 2768\n<bb78> <bb7d> 15232\n<bb81> <bb91> 15238\n<bb93> <bb9d> 15255\n<bba1> <bba2> 2769\n<bba3> <bba4> 15266\n<bba5> <bba5> 2771\n<bba6> <bba7> 15268\n<bba8> <bba9> 2772\n<bbaa> <bbaa> 15270\n<bbab> <bbab> 2774\n<bbac> <bbb0> 15271\n<bbb1> <bbb1> 2775\n<bbb3> <bbb3> 2776\n<bbb4> <bbb4> 15276\n<bbb5> <bbb5> 2777\n<bbb6> <bbb6> 15277\n<bbb7> <bbb8> 2778\n<bbb9> <bbba> 15278\n<bbbb> <bbbc> 2780\n<bbbd> <bbbd> 15280\n<bc41> <bc41> 382\n<bc61> <bc62> 2782\n<bc63> <bc64> 15281\n<bc65> <bc65> 2784\n<bc66> <bc66> 15283\n<bc67> <bc67> 2785\n<bc68> <bc68> 15284\n<bc69> <bc69> 2786\n<bc6a> <bc6b> 15285\n<bc6c> <bc6c> 2787\n<bc6d> <bc70> 15287\n<bc71> <bc71> 2788\n<bc73> <bc73> 2789\n<bc74> <bc74> 15291\n<bc75> <bc77> 2790\n<bc78> <bc7d> 15292\n<bc81> <bc82> 2793\n<bc83> <bc84> 15298\n<bc85> <bc85> 2795\n<bc86> <bc88> 15300\n<bc89> <bc89> 2796\n<bc8a> <bc90> 15303\n<bc91> <bc91> 2797\n<bc93> <bc93> 2798\nendcidrange\n\n100 begincidrange\n<bc94> <bc94> 15310\n<bc95> <bc97> 2799\n<bc98> <bc9d> 15311\n<bca1> <bca1> 2802\n<bca2> <bca4> 15317\n<bca5> <bca5> 2803\n<bca6> <bcb1> 15320\n<bcb3> <bcb6> 15332\n<bcb7> <bcb7> 2804\n<bcb8> <bcbd> 15336\n<bcc1> <bcd1> 15342\n<bcd3> <bcdd> 15359\n<bce1> <bce2> 2805\n<bce3> <bce4> 15370\n<bce5> <bce5> 2807\n<bce6> <bce8> 15372\n<bce9> <bce9> 2808\n<bcea> <bcf0> 15375\n<bcf1> <bcf1> 2809\n<bcf3> <bcf3> 2810\n<bcf4> <bcf4> 15382\n<bcf5> <bcf7> 2811\n<bcf8> <bcfd> 15383\n<bd41> <bd41> 2814\n<bd42> <bd51> 15389\n<bd53> <bd56> 15405\n<bd57> <bd57> 2815\n<bd58> <bd5d> 15409\n<bd61> <bd61> 2816\n<bd62> <bd71> 15415\n<bd73> <bd75> 15431\n<bd76> <bd76> 2817\n<bd77> <bd7d> 15434\n<bd81> <bd91> 15441\n<bd93> <bd9d> 15458\n<bda1> <bda2> 2818\n<bda3> <bda4> 15469\n<bda5> <bda5> 2820\n<bda6> <bda8> 15471\n<bda9> <bda9> 2821\n<bdaa> <bdb0> 15474\n<bdb1> <bdb1> 2822\n<bdb3> <bdb3> 2823\n<bdb4> <bdb4> 15481\n<bdb5> <bdb5> 2824\n<bdb6> <bdb6> 15482\n<bdb7> <bdb7> 2825\n<bdb8> <bdb8> 15483\n<bdb9> <bdb9> 2826\n<bdba> <bdbd> 15484\n<bdc1> <bdc2> 2827\n<bdc3> <bdc8> 15488\n<bdc9> <bdc9> 2829\n<bdca> <bdd1> 15494\n<bdd3> <bdd5> 15502\n<bdd6> <bdd6> 2830\n<bdd7> <bddd> 15505\n<bde1> <bde1> 2831\n<bde2> <bdf1> 15512\n<bdf3> <bdf5> 15528\n<bdf6> <bdf6> 2832\n<bdf7> <bdfd> 15531\n<be41> <be41> 2833\n<be42> <be44> 15538\n<be45> <be45> 2834\n<be46> <be48> 15541\n<be49> <be49> 2835\n<be4a> <be50> 15544\n<be51> <be51> 2836\n<be53> <be53> 2837\n<be54> <be5d> 15551\n<be61> <be71> 15561\n<be73> <be76> 15578\n<be77> <be77> 2838\n<be78> <be7d> 15582\n<be81> <be82> 2839\n<be83> <be84> 15588\n<be85> <be85> 2841\n<be86> <be88> 15590\n<be89> <be89> 2842\n<be8a> <be90> 15593\n<be91> <be91> 2843\n<be93> <be93> 2844\n<be94> <be96> 15600\n<be97> <be97> 2845\n<be98> <be9d> 15603\n<bea1> <bea1> 2846\n<bea2> <beb1> 15609\n<beb3> <beb5> 15625\n<beb6> <beb7> 2847\n<beb8> <bebd> 15628\n<bec1> <bed1> 15634\n<bed3> <bedd> 15651\n<bee1> <bee1> 2849\n<bee2> <bef1> 15662\n<bef3> <befd> 15678\n<bf41> <bf41> 2850\n<bf42> <bf51> 15689\n<bf53> <bf5d> 15705\n<bf61> <bf61> 2851\nendcidrange\n\n100 begincidrange\n<bf62> <bf70> 15716\n<bf71> <bf71> 2852\n<bf73> <bf74> 15731\n<bf75> <bf75> 2853\n<bf76> <bf76> 15733\n<bf77> <bf77> 2854\n<bf78> <bf7d> 15734\n<bf81> <bf91> 15740\n<bf93> <bf9d> 15757\n<bfa1> <bfa2> 2855\n<bfa3> <bfa4> 15768\n<bfa5> <bfa5> 2857\n<bfa6> <bfa8> 15770\n<bfa9> <bfa9> 2858\n<bfaa> <bfb0> 15773\n<bfb1> <bfb1> 2859\n<bfb3> <bfb3> 2860\n<bfb4> <bfb6> 15780\n<bfb7> <bfb8> 2861\n<bfb9> <bfbc> 15783\n<bfbd> <bfbd> 2863\n<c041> <c041> 383\n<c061> <c062> 2864\n<c063> <c064> 15787\n<c065> <c065> 2866\n<c066> <c066> 15789\n<c067> <c067> 2867\n<c068> <c068> 15790\n<c069> <c069> 2868\n<c06a> <c070> 15791\n<c071> <c071> 2869\n<c073> <c073> 2870\n<c074> <c074> 15798\n<c075> <c078> 2871\n<c079> <c07d> 15799\n<c081> <c082> 2875\n<c083> <c084> 15804\n<c085> <c085> 2877\n<c086> <c088> 15806\n<c089> <c089> 2878\n<c08a> <c090> 15809\n<c091> <c091> 2879\n<c093> <c093> 2880\n<c094> <c094> 15816\n<c095> <c097> 2881\n<c098> <c09d> 15817\n<c0a1> <c0a1> 2884\n<c0a2> <c0a4> 15823\n<c0a5> <c0a5> 2885\n<c0a6> <c0a6> 15826\n<c0a7> <c0a7> 2886\n<c0a8> <c0a8> 15827\n<c0a9> <c0a9> 2887\n<c0aa> <c0b0> 15828\n<c0b1> <c0b1> 2888\n<c0b3> <c0b6> 15835\n<c0b7> <c0b7> 2889\n<c0b8> <c0bd> 15839\n<c0c1> <c0d1> 15845\n<c0d3> <c0dd> 15862\n<c0e1> <c0e2> 2890\n<c0e3> <c0e4> 15873\n<c0e5> <c0e5> 2892\n<c0e6> <c0e8> 15875\n<c0e9> <c0e9> 2893\n<c0ea> <c0f0> 15878\n<c0f1> <c0f1> 2894\n<c0f3> <c0f3> 2895\n<c0f4> <c0f4> 15885\n<c0f5> <c0f7> 2896\n<c0f8> <c0fd> 15886\n<c141> <c142> 2899\n<c143> <c144> 15892\n<c145> <c145> 2901\n<c146> <c148> 15894\n<c149> <c149> 2902\n<c14a> <c150> 15897\n<c151> <c151> 2903\n<c153> <c153> 2904\n<c154> <c154> 15904\n<c155> <c155> 2905\n<c156> <c156> 15905\n<c157> <c157> 2906\n<c158> <c15d> 15906\n<c161> <c161> 2907\n<c162> <c164> 15912\n<c165> <c165> 2908\n<c166> <c171> 15915\n<c173> <c175> 15927\n<c176> <c176> 2909\n<c177> <c17d> 15930\n<c181> <c181> 2910\n<c182> <c184> 15937\n<c185> <c185> 2911\n<c186> <c191> 15940\n<c193> <c196> 15952\n<c197> <c197> 2912\n<c198> <c19d> 15956\n<c1a1> <c1a2> 2913\n<c1a3> <c1a4> 15962\nendcidrange\n\n100 begincidrange\n<c1a5> <c1a5> 2915\n<c1a6> <c1a8> 15964\n<c1a9> <c1a9> 2916\n<c1aa> <c1b0> 15967\n<c1b1> <c1b1> 2917\n<c1b3> <c1b3> 2918\n<c1b4> <c1b4> 15974\n<c1b5> <c1b5> 2919\n<c1b6> <c1b6> 15975\n<c1b7> <c1b7> 2920\n<c1b8> <c1bd> 15976\n<c1c1> <c1c1> 2921\n<c1c2> <c1c4> 15982\n<c1c5> <c1c5> 2922\n<c1c6> <c1c8> 15985\n<c1c9> <c1c9> 2923\n<c1ca> <c1d1> 15988\n<c1d3> <c1d6> 15996\n<c1d7> <c1d7> 2924\n<c1d8> <c1dd> 16000\n<c1e1> <c1f1> 16006\n<c1f3> <c1fd> 16023\n<c241> <c241> 2925\n<c242> <c244> 16034\n<c245> <c245> 2926\n<c246> <c248> 16037\n<c249> <c249> 2927\n<c24a> <c250> 16040\n<c251> <c251> 2928\n<c253> <c253> 2929\n<c254> <c254> 16047\n<c255> <c255> 2930\n<c256> <c256> 16048\n<c257> <c257> 2931\n<c258> <c25d> 16049\n<c261> <c261> 2932\n<c262> <c270> 16055\n<c271> <c271> 2933\n<c273> <c27d> 16070\n<c281> <c282> 2934\n<c283> <c284> 16081\n<c285> <c285> 2936\n<c286> <c288> 16083\n<c289> <c289> 2937\n<c28a> <c290> 16086\n<c291> <c291> 2938\n<c293> <c293> 2939\n<c294> <c294> 16093\n<c295> <c295> 2940\n<c296> <c296> 16094\n<c297> <c297> 2941\n<c298> <c29d> 16095\n<c2a1> <c2a1> 2942\n<c2a2> <c2b1> 16101\n<c2b3> <c2b5> 16117\n<c2b6> <c2b6> 2943\n<c2b7> <c2bd> 16120\n<c2c1> <c2c1> 2944\n<c2c2> <c2c4> 16127\n<c2c5> <c2c5> 2945\n<c2c6> <c2d1> 16130\n<c2d3> <c2dd> 16142\n<c2e1> <c2e1> 2946\n<c2e2> <c2e4> 16153\n<c2e5> <c2e5> 2947\n<c2e6> <c2e8> 16156\n<c2e9> <c2e9> 2948\n<c2ea> <c2f0> 16159\n<c2f1> <c2f1> 2949\n<c2f3> <c2f3> 2950\n<c2f4> <c2f4> 16166\n<c2f5> <c2f5> 2951\n<c2f6> <c2f6> 16167\n<c2f7> <c2f7> 2952\n<c2f8> <c2fd> 16168\n<c341> <c341> 2953\n<c342> <c344> 16174\n<c345> <c345> 2954\n<c346> <c348> 16177\n<c349> <c349> 2955\n<c34a> <c350> 16180\n<c351> <c351> 2956\n<c353> <c356> 16187\n<c357> <c357> 2957\n<c358> <c35d> 16191\n<c361> <c362> 2958\n<c363> <c364> 16197\n<c365> <c365> 2960\n<c366> <c368> 16199\n<c369> <c369> 2961\n<c36a> <c370> 16202\n<c371> <c371> 2962\n<c373> <c373> 2963\n<c374> <c374> 16209\n<c375> <c375> 2964\n<c376> <c376> 16210\n<c377> <c377> 2965\n<c378> <c37d> 16211\n<c381> <c391> 16217\n<c393> <c39d> 16234\nendcidrange\n\n100 begincidrange\n<c3a1> <c3a2> 2966\n<c3a3> <c3a4> 16245\n<c3a5> <c3a5> 2968\n<c3a6> <c3a7> 16247\n<c3a8> <c3aa> 2969\n<c3ab> <c3b0> 16249\n<c3b1> <c3b1> 2972\n<c3b3> <c3b3> 2973\n<c3b4> <c3b4> 16255\n<c3b5> <c3b5> 2974\n<c3b6> <c3b6> 16256\n<c3b7> <c3b7> 2975\n<c3b8> <c3bd> 16257\n<c441> <c441> 384\n<c461> <c462> 2976\n<c463> <c464> 16263\n<c465> <c465> 2978\n<c466> <c468> 16265\n<c469> <c469> 2979\n<c46a> <c470> 16268\n<c471> <c471> 2980\n<c473> <c473> 2981\n<c474> <c474> 16275\n<c475> <c475> 2982\n<c476> <c476> 16276\n<c477> <c477> 2983\n<c478> <c47d> 16277\n<c481> <c482> 2984\n<c483> <c484> 16283\n<c485> <c485> 2986\n<c486> <c488> 16285\n<c489> <c489> 2987\n<c48a> <c490> 16288\n<c491> <c491> 2988\n<c493> <c493> 2989\n<c494> <c494> 16295\n<c495> <c497> 2990\n<c498> <c49d> 16296\n<c4a1> <c4a2> 2993\n<c4a3> <c4b1> 16302\n<c4b3> <c4b6> 16317\n<c4b7> <c4b7> 2995\n<c4b8> <c4bd> 16321\n<c4c1> <c4d1> 16327\n<c4d3> <c4dd> 16344\n<c4e1> <c4e2> 2996\n<c4e3> <c4e4> 16355\n<c4e5> <c4e5> 2998\n<c4e6> <c4e7> 16357\n<c4e8> <c4e9> 2999\n<c4ea> <c4f0> 16359\n<c4f1> <c4f1> 3001\n<c4f3> <c4f3> 3002\n<c4f4> <c4f4> 16366\n<c4f5> <c4f7> 3003\n<c4f8> <c4fd> 16367\n<c541> <c542> 3006\n<c543> <c544> 16373\n<c545> <c545> 3008\n<c546> <c548> 16375\n<c549> <c549> 3009\n<c54a> <c550> 16378\n<c551> <c551> 3010\n<c553> <c553> 3011\n<c554> <c554> 16385\n<c555> <c555> 3012\n<c556> <c556> 16386\n<c557> <c557> 3013\n<c558> <c55d> 16387\n<c561> <c561> 3014\n<c562> <c564> 16393\n<c565> <c565> 3015\n<c566> <c568> 16396\n<c569> <c569> 3016\n<c56a> <c570> 16399\n<c571> <c571> 3017\n<c573> <c573> 3018\n<c574> <c574> 16406\n<c575> <c577> 3019\n<c578> <c57d> 16407\n<c581> <c581> 3022\n<c582> <c591> 16413\n<c593> <c59d> 16429\n<c5a1> <c5a2> 3023\n<c5a3> <c5a4> 16440\n<c5a5> <c5a5> 3025\n<c5a6> <c5a8> 16442\n<c5a9> <c5a9> 3026\n<c5aa> <c5b0> 16445\n<c5b1> <c5b1> 3027\n<c5b3> <c5b3> 3028\n<c5b4> <c5b4> 16452\n<c5b5> <c5b5> 3029\n<c5b6> <c5b6> 16453\n<c5b7> <c5b7> 3030\n<c5b8> <c5bd> 16454\n<c5c1> <c5c2> 3031\n<c5c3> <c5c4> 16460\n<c5c5> <c5c5> 3033\n<c5c6> <c5c8> 16462\nendcidrange\n\n100 begincidrange\n<c5c9> <c5c9> 3034\n<c5ca> <c5d0> 16465\n<c5d1> <c5d1> 3035\n<c5d3> <c5d6> 16472\n<c5d7> <c5d7> 3036\n<c5d8> <c5dd> 16476\n<c5e1> <c5e1> 3037\n<c5e2> <c5f1> 16482\n<c5f3> <c5f6> 16498\n<c5f7> <c5f7> 3038\n<c5f8> <c5fd> 16502\n<c641> <c641> 3039\n<c642> <c648> 16508\n<c649> <c649> 3040\n<c64a> <c651> 16515\n<c653> <c65d> 16523\n<c661> <c661> 3041\n<c662> <c671> 16534\n<c673> <c67d> 16550\n<c681> <c682> 3042\n<c683> <c684> 16561\n<c685> <c685> 3044\n<c686> <c688> 16563\n<c689> <c689> 3045\n<c68a> <c690> 16566\n<c691> <c691> 3046\n<c693> <c693> 3047\n<c694> <c694> 16573\n<c695> <c695> 3048\n<c696> <c696> 16574\n<c697> <c697> 3049\n<c698> <c69d> 16575\n<c6a1> <c6a1> 3050\n<c6a2> <c6a4> 16581\n<c6a5> <c6a5> 3051\n<c6a6> <c6a8> 16584\n<c6a9> <c6a9> 3052\n<c6aa> <c6b1> 16587\n<c6b3> <c6b6> 16595\n<c6b7> <c6b7> 3053\n<c6b8> <c6bd> 16599\n<c6c1> <c6c1> 3054\n<c6c2> <c6d1> 16605\n<c6d3> <c6d6> 16621\n<c6d7> <c6d7> 3055\n<c6d8> <c6dd> 16625\n<c6e1> <c6e2> 3056\n<c6e3> <c6e4> 16631\n<c6e5> <c6e5> 3058\n<c6e6> <c6e8> 16633\n<c6e9> <c6e9> 3059\n<c6ea> <c6f0> 16636\n<c6f1> <c6f1> 3060\n<c6f3> <c6f3> 3061\n<c6f4> <c6f4> 16643\n<c6f5> <c6f5> 3062\n<c6f6> <c6f6> 16644\n<c6f7> <c6f7> 3063\n<c6f8> <c6fd> 16645\n<c741> <c741> 3064\n<c742> <c744> 16651\n<c745> <c745> 3065\n<c746> <c748> 16654\n<c749> <c749> 3066\n<c74a> <c750> 16657\n<c751> <c751> 3067\n<c753> <c75d> 16664\n<c761> <c762> 3068\n<c763> <c764> 16675\n<c765> <c765> 3070\n<c766> <c768> 16677\n<c769> <c769> 3071\n<c76a> <c770> 16680\n<c771> <c771> 3072\n<c773> <c773> 3073\n<c774> <c776> 16687\n<c777> <c777> 3074\n<c778> <c77d> 16690\n<c781> <c791> 16696\n<c793> <c79d> 16713\n<c7a1> <c7a2> 3075\n<c7a3> <c7a4> 16724\n<c7a5> <c7a5> 3077\n<c7a6> <c7a8> 16726\n<c7a9> <c7a9> 3078\n<c7aa> <c7b0> 16729\n<c7b1> <c7b1> 3079\n<c7b3> <c7b3> 3080\n<c7b4> <c7b4> 16736\n<c7b5> <c7b5> 3081\n<c7b6> <c7b6> 16737\n<c7b7> <c7b7> 3082\n<c7b8> <c7bd> 16738\n<c841> <c841> 385\n<c861> <c862> 3083\n<c863> <c864> 16744\n<c865> <c865> 3085\n<c866> <c868> 16746\n<c869> <c86a> 3086\n<c86b> <c870> 16749\nendcidrange\n\n100 begincidrange\n<c871> <c871> 3088\n<c873> <c873> 3089\n<c874> <c874> 16755\n<c875> <c877> 3090\n<c878> <c87d> 16756\n<c881> <c882> 3093\n<c883> <c884> 16762\n<c885> <c885> 3095\n<c886> <c888> 16764\n<c889> <c889> 3096\n<c88a> <c890> 16767\n<c891> <c891> 3097\n<c893> <c893> 3098\n<c894> <c894> 16774\n<c895> <c897> 3099\n<c898> <c89d> 16775\n<c8a1> <c8a1> 3102\n<c8a2> <c8b1> 16781\n<c8b3> <c8b6> 16797\n<c8b7> <c8b7> 3103\n<c8b8> <c8bd> 16801\n<c8c1> <c8d1> 16807\n<c8d3> <c8dd> 16824\n<c8e1> <c8e2> 3104\n<c8e3> <c8e4> 16835\n<c8e5> <c8e5> 3106\n<c8e6> <c8e8> 16837\n<c8e9> <c8e9> 3107\n<c8ea> <c8ea> 16840\n<c8eb> <c8eb> 3108\n<c8ec> <c8f0> 16841\n<c8f1> <c8f1> 3109\n<c8f3> <c8f3> 3110\n<c8f4> <c8f4> 16846\n<c8f5> <c8f7> 3111\n<c8f8> <c8fd> 16847\n<c941> <c942> 3114\n<c943> <c944> 16853\n<c945> <c945> 3116\n<c946> <c948> 16855\n<c949> <c949> 3117\n<c94a> <c950> 16858\n<c951> <c951> 3118\n<c953> <c953> 3119\n<c954> <c954> 16865\n<c955> <c955> 3120\n<c956> <c956> 16866\n<c957> <c957> 3121\n<c958> <c95d> 16867\n<c961> <c961> 3122\n<c962> <c964> 16873\n<c965> <c965> 3123\n<c966> <c971> 16876\n<c973> <c975> 16888\n<c976> <c976> 3124\n<c977> <c97d> 16891\n<c981> <c981> 3125\n<c982> <c984> 16898\n<c985> <c985> 3126\n<c986> <c991> 16901\n<c993> <c99d> 16913\n<c9a1> <c9a2> 3127\n<c9a3> <c9a4> 16924\n<c9a5> <c9a5> 3129\n<c9a6> <c9a8> 16926\n<c9a9> <c9a9> 3130\n<c9aa> <c9b0> 16929\n<c9b1> <c9b1> 3131\n<c9b3> <c9b3> 3132\n<c9b4> <c9b4> 16936\n<c9b5> <c9b5> 3133\n<c9b6> <c9b6> 16937\n<c9b7> <c9b7> 3134\n<c9b8> <c9bb> 16938\n<c9bc> <c9bc> 3135\n<c9bd> <c9bd> 16942\n<c9c1> <c9c1> 3136\n<c9c2> <c9c4> 16943\n<c9c5> <c9c5> 3137\n<c9c6> <c9d1> 16946\n<c9d3> <c9dd> 16958\n<c9e1> <c9e1> 3138\n<c9e2> <c9f1> 16969\n<c9f3> <c9fd> 16985\n<ca41> <ca41> 3139\n<ca42> <ca44> 16996\n<ca45> <ca45> 3140\n<ca46> <ca51> 16999\n<ca53> <ca54> 17011\n<ca55> <ca55> 3141\n<ca56> <ca56> 17013\n<ca57> <ca57> 3142\n<ca58> <ca5d> 17014\n<ca61> <ca61> 3143\n<ca62> <ca71> 17020\n<ca73> <ca7d> 17036\n<ca81> <ca82> 3144\n<ca83> <ca84> 17047\n<ca85> <ca85> 3146\n<ca86> <ca88> 17049\nendcidrange\n\n100 begincidrange\n<ca89> <ca89> 3147\n<ca8a> <ca90> 17052\n<ca91> <ca91> 3148\n<ca93> <ca93> 3149\n<ca94> <ca94> 17059\n<ca95> <ca95> 3150\n<ca96> <ca96> 17060\n<ca97> <ca97> 3151\n<ca98> <ca9d> 17061\n<caa1> <caa1> 3152\n<caa2> <cab1> 17067\n<cab3> <cab5> 17083\n<cab6> <cab6> 3153\n<cab7> <cabd> 17086\n<cac1> <cac1> 3154\n<cac2> <cad1> 17093\n<cad3> <cadd> 17109\n<cae1> <cae2> 3155\n<cae3> <cae4> 17120\n<cae5> <cae5> 3157\n<cae6> <cae8> 17122\n<cae9> <cae9> 3158\n<caea> <caf0> 17125\n<caf1> <caf1> 3159\n<caf3> <caf3> 3160\n<caf4> <caf6> 17132\n<caf7> <caf7> 3161\n<caf8> <cafd> 17135\n<cb41> <cb41> 3162\n<cb42> <cb44> 17141\n<cb45> <cb45> 3163\n<cb46> <cb48> 17144\n<cb49> <cb49> 3164\n<cb4a> <cb50> 17147\n<cb51> <cb51> 3165\n<cb53> <cb56> 17154\n<cb57> <cb57> 3166\n<cb58> <cb5d> 17158\n<cb61> <cb62> 3167\n<cb63> <cb64> 17164\n<cb65> <cb65> 3169\n<cb66> <cb67> 17166\n<cb68> <cb69> 3170\n<cb6a> <cb6a> 17168\n<cb6b> <cb6b> 3172\n<cb6c> <cb70> 17169\n<cb71> <cb71> 3173\n<cb73> <cb73> 3174\n<cb74> <cb74> 17174\n<cb75> <cb75> 3175\n<cb76> <cb7d> 17175\n<cb81> <cb81> 3176\n<cb82> <cb84> 17183\n<cb85> <cb85> 3177\n<cb86> <cb88> 17186\n<cb89> <cb89> 3178\n<cb8a> <cb90> 17189\n<cb91> <cb91> 3179\n<cb93> <cb93> 3180\n<cb94> <cb9d> 17196\n<cba1> <cba2> 3181\n<cba3> <cba4> 17206\n<cba5> <cba5> 3183\n<cba6> <cba8> 17208\n<cba9> <cba9> 3184\n<cbaa> <cbb0> 17211\n<cbb1> <cbb1> 3185\n<cbb3> <cbb3> 3186\n<cbb4> <cbb4> 17218\n<cbb5> <cbb5> 3187\n<cbb6> <cbb6> 17219\n<cbb7> <cbb7> 3188\n<cbb8> <cbbd> 17220\n<cc41> <cc41> 386\n<cc61> <cc63> 3189\n<cc64> <cc64> 17226\n<cc65> <cc65> 3192\n<cc66> <cc68> 17227\n<cc69> <cc69> 3193\n<cc6a> <cc6a> 17230\n<cc6b> <cc6b> 3194\n<cc6c> <cc70> 17231\n<cc71> <cc71> 3195\n<cc73> <cc73> 3196\n<cc74> <cc74> 17236\n<cc75> <cc77> 3197\n<cc78> <cc7a> 17237\n<cc7b> <cc7b> 3200\n<cc7c> <cc7d> 17240\n<cc81> <cc82> 3201\n<cc83> <cc84> 17242\n<cc85> <cc85> 3203\n<cc86> <cc88> 17244\n<cc89> <cc89> 3204\n<cc8a> <cc90> 17247\n<cc91> <cc91> 3205\n<cc93> <cc93> 3206\n<cc94> <cc94> 17254\n<cc95> <cc97> 3207\n<cc98> <cc9d> 17255\nendcidrange\n\n100 begincidrange\n<cca1> <cca2> 3210\n<cca3> <ccb1> 17261\n<ccb3> <ccbd> 17276\n<ccc1> <ccd1> 17287\n<ccd3> <ccdd> 17304\n<cce1> <cce2> 3212\n<cce3> <cce4> 17315\n<cce5> <cce5> 3214\n<cce6> <cce8> 17317\n<cce9> <cce9> 3215\n<ccea> <ccf0> 17320\n<ccf1> <ccf1> 3216\n<ccf3> <ccf3> 3217\n<ccf4> <ccf4> 17327\n<ccf5> <ccf7> 3218\n<ccf8> <ccfd> 17328\n<cd41> <cd42> 3221\n<cd43> <cd44> 17334\n<cd45> <cd45> 3223\n<cd46> <cd48> 17336\n<cd49> <cd49> 3224\n<cd4a> <cd50> 17339\n<cd51> <cd51> 3225\n<cd53> <cd53> 3226\n<cd54> <cd54> 17346\n<cd55> <cd55> 3227\n<cd56> <cd56> 17347\n<cd57> <cd57> 3228\n<cd58> <cd5d> 17348\n<cd61> <cd61> 3229\n<cd62> <cd64> 17354\n<cd65> <cd65> 3230\n<cd66> <cd68> 17357\n<cd69> <cd69> 3231\n<cd6a> <cd70> 17360\n<cd71> <cd71> 3232\n<cd73> <cd73> 3233\n<cd74> <cd75> 17367\n<cd76> <cd77> 3234\n<cd78> <cd7d> 17369\n<cd81> <cd81> 3236\n<cd82> <cd88> 17375\n<cd89> <cd89> 3237\n<cd8a> <cd91> 17382\n<cd93> <cd93> 3238\n<cd94> <cd94> 17390\n<cd95> <cd95> 3239\n<cd96> <cd9d> 17391\n<cda1> <cda2> 3240\n<cda3> <cda4> 17399\n<cda5> <cda5> 3242\n<cda6> <cda8> 17401\n<cda9> <cda9> 3243\n<cdaa> <cdb0> 17404\n<cdb1> <cdb1> 3244\n<cdb3> <cdb3> 3245\n<cdb4> <cdb4> 17411\n<cdb5> <cdb5> 3246\n<cdb6> <cdb6> 17412\n<cdb7> <cdb7> 3247\n<cdb8> <cdbd> 17413\n<cdc1> <cdc1> 3248\n<cdc2> <cdd1> 17419\n<cdd3> <cdd6> 17435\n<cdd7> <cdd7> 3249\n<cdd8> <cddd> 17439\n<cde1> <cdf1> 17445\n<cdf3> <cdfd> 17462\n<ce41> <ce41> 3250\n<ce42> <ce44> 17473\n<ce45> <ce45> 3251\n<ce46> <ce51> 17476\n<ce53> <ce5d> 17488\n<ce61> <ce61> 3252\n<ce62> <ce64> 17499\n<ce65> <ce65> 3253\n<ce66> <ce68> 17502\n<ce69> <ce69> 3254\n<ce6a> <ce71> 17505\n<ce73> <ce73> 3255\n<ce74> <ce74> 17513\n<ce75> <ce75> 3256\n<ce76> <ce7d> 17514\n<ce81> <ce82> 3257\n<ce83> <ce84> 17522\n<ce85> <ce85> 3259\n<ce86> <ce87> 17524\n<ce88> <ce89> 3260\n<ce8a> <ce8a> 17526\n<ce8b> <ce8b> 3262\n<ce8c> <ce90> 17527\n<ce91> <ce91> 3263\n<ce93> <ce93> 3264\n<ce94> <ce94> 17532\n<ce95> <ce95> 3265\n<ce96> <ce96> 17533\n<ce97> <ce97> 3266\n<ce98> <ce9d> 17534\n<cea1> <cea1> 3267\n<cea2> <ceb1> 17540\nendcidrange\n\n100 begincidrange\n<ceb3> <ceb6> 17556\n<ceb7> <ceb7> 3268\n<ceb8> <cebd> 17560\n<cec1> <ced1> 17566\n<ced3> <cedd> 17583\n<cee1> <cee1> 3269\n<cee2> <cee4> 17594\n<cee5> <cee5> 3270\n<cee6> <cee8> 17597\n<cee9> <cee9> 3271\n<ceea> <cef0> 17600\n<cef1> <cef1> 3272\n<cef3> <cef4> 17607\n<cef5> <cef5> 3273\n<cef6> <cefd> 17609\n<cf41> <cf41> 3274\n<cf42> <cf44> 17617\n<cf45> <cf45> 3275\n<cf46> <cf48> 17620\n<cf49> <cf49> 3276\n<cf4a> <cf50> 17623\n<cf51> <cf51> 3277\n<cf53> <cf54> 17630\n<cf55> <cf55> 3278\n<cf56> <cf56> 17632\n<cf57> <cf57> 3279\n<cf58> <cf5d> 17633\n<cf61> <cf61> 3280\n<cf62> <cf64> 17639\n<cf65> <cf65> 3281\n<cf66> <cf68> 17642\n<cf69> <cf69> 3282\n<cf6a> <cf70> 17645\n<cf71> <cf71> 3283\n<cf73> <cf73> 3284\n<cf74> <cf74> 17652\n<cf75> <cf75> 3285\n<cf76> <cf7d> 17653\n<cf81> <cf91> 17661\n<cf93> <cf9d> 17678\n<cfa1> <cfa2> 3286\n<cfa3> <cfa4> 17689\n<cfa5> <cfa5> 3288\n<cfa6> <cfa8> 17691\n<cfa9> <cfa9> 3289\n<cfaa> <cfb0> 17694\n<cfb1> <cfb1> 3290\n<cfb3> <cfb3> 3291\n<cfb4> <cfb4> 17701\n<cfb5> <cfb5> 3292\n<cfb6> <cfb6> 17702\n<cfb7> <cfb7> 3293\n<cfb8> <cfbd> 17703\n<d041> <d041> 387\n<d061> <d062> 3294\n<d063> <d064> 17709\n<d065> <d065> 3296\n<d066> <d068> 17711\n<d069> <d069> 3297\n<d06a> <d06d> 17714\n<d06e> <d06e> 3298\n<d06f> <d070> 17718\n<d071> <d071> 3299\n<d073> <d073> 3300\n<d074> <d074> 17720\n<d075> <d075> 3301\n<d076> <d076> 17721\n<d077> <d077> 3302\n<d078> <d07d> 17722\n<d081> <d082> 3303\n<d083> <d084> 17728\n<d085> <d085> 3305\n<d086> <d088> 17730\n<d089> <d089> 3306\n<d08a> <d090> 17733\n<d091> <d091> 3307\n<d093> <d093> 3308\n<d094> <d094> 17740\n<d095> <d097> 3309\n<d098> <d09d> 17741\n<d0a1> <d0a1> 3312\n<d0a2> <d0b1> 17747\n<d0b3> <d0b6> 17763\n<d0b7> <d0b7> 3313\n<d0b8> <d0bd> 17767\n<d0c1> <d0d1> 17773\n<d0d3> <d0dd> 17790\n<d0e1> <d0e2> 3314\n<d0e3> <d0e4> 17801\n<d0e5> <d0e5> 3316\n<d0e6> <d0e8> 17803\n<d0e9> <d0e9> 3317\n<d0ea> <d0ea> 17806\n<d0eb> <d0eb> 3318\n<d0ec> <d0f0> 17807\n<d0f1> <d0f1> 3319\n<d0f3> <d0f3> 3320\n<d0f4> <d0f4> 17812\n<d0f5> <d0f5> 3321\n<d0f6> <d0f6> 17813\nendcidrange\n\n100 begincidrange\n<d0f7> <d0f7> 3322\n<d0f8> <d0fd> 17814\n<d141> <d142> 3323\n<d143> <d144> 17820\n<d145> <d145> 3325\n<d146> <d148> 17822\n<d149> <d149> 3326\n<d14a> <d150> 17825\n<d151> <d151> 3327\n<d153> <d153> 3328\n<d154> <d154> 17832\n<d155> <d155> 3329\n<d156> <d156> 17833\n<d157> <d157> 3330\n<d158> <d15d> 17834\n<d161> <d162> 3331\n<d163> <d164> 17840\n<d165> <d165> 3333\n<d166> <d168> 17842\n<d169> <d169> 3334\n<d16a> <d170> 17845\n<d171> <d171> 3335\n<d173> <d173> 3336\n<d174> <d174> 17852\n<d175> <d177> 3337\n<d178> <d17d> 17853\n<d181> <d181> 3340\n<d182> <d184> 17859\n<d185> <d185> 3341\n<d186> <d188> 17862\n<d189> <d189> 3342\n<d18a> <d191> 17865\n<d193> <d193> 3343\n<d194> <d19d> 17873\n<d1a1> <d1a2> 3344\n<d1a3> <d1a4> 17883\n<d1a5> <d1a5> 3346\n<d1a6> <d1a8> 17885\n<d1a9> <d1a9> 3347\n<d1aa> <d1ad> 17888\n<d1ae> <d1ae> 3348\n<d1af> <d1b0> 17892\n<d1b1> <d1b1> 3349\n<d1b3> <d1b3> 3350\n<d1b4> <d1b4> 17894\n<d1b5> <d1b5> 3351\n<d1b6> <d1b6> 17895\n<d1b7> <d1b7> 3352\n<d1b8> <d1ba> 17896\n<d1bb> <d1bb> 3353\n<d1bc> <d1bd> 17899\n<d1c1> <d1c2> 3354\n<d1c3> <d1c4> 17901\n<d1c5> <d1c5> 3356\n<d1c6> <d1c8> 17903\n<d1c9> <d1c9> 3357\n<d1ca> <d1d1> 17906\n<d1d3> <d1d4> 17914\n<d1d5> <d1d5> 3358\n<d1d6> <d1d6> 17916\n<d1d7> <d1d7> 3359\n<d1d8> <d1dd> 17917\n<d1e1> <d1e2> 3360\n<d1e3> <d1e4> 17923\n<d1e5> <d1e5> 3362\n<d1e6> <d1f1> 17925\n<d1f3> <d1f4> 17937\n<d1f5> <d1f5> 3363\n<d1f6> <d1f6> 17939\n<d1f7> <d1f7> 3364\n<d1f8> <d1fd> 17940\n<d241> <d242> 3365\n<d243> <d244> 17946\n<d245> <d245> 3367\n<d246> <d248> 17948\n<d249> <d249> 3368\n<d24a> <d251> 17951\n<d253> <d253> 3369\n<d254> <d254> 17959\n<d255> <d255> 3370\n<d256> <d256> 17960\n<d257> <d257> 3371\n<d258> <d25d> 17961\n<d261> <d261> 3372\n<d262> <d264> 17967\n<d265> <d265> 3373\n<d266> <d268> 17970\n<d269> <d269> 3374\n<d26a> <d271> 17973\n<d273> <d273> 3375\n<d274> <d274> 17981\n<d275> <d275> 3376\n<d276> <d27d> 17982\n<d281> <d282> 3377\n<d283> <d284> 17990\n<d285> <d285> 3379\n<d286> <d288> 17992\n<d289> <d289> 3380\n<d28a> <d28d> 17995\n<d28e> <d28e> 3381\nendcidrange\n\n100 begincidrange\n<d28f> <d290> 17999\n<d291> <d291> 3382\n<d293> <d294> 18001\n<d295> <d295> 3383\n<d296> <d296> 18003\n<d297> <d297> 3384\n<d298> <d29d> 18004\n<d2a1> <d2a1> 3385\n<d2a2> <d2a4> 18010\n<d2a5> <d2a5> 3386\n<d2a6> <d2a8> 18013\n<d2a9> <d2a9> 3387\n<d2aa> <d2b0> 18016\n<d2b1> <d2b1> 3388\n<d2b3> <d2b6> 18023\n<d2b7> <d2b7> 3389\n<d2b8> <d2bd> 18027\n<d2c1> <d2c2> 3390\n<d2c3> <d2c4> 18033\n<d2c5> <d2c5> 3392\n<d2c6> <d2c8> 18035\n<d2c9> <d2c9> 3393\n<d2ca> <d2d1> 18038\n<d2d3> <d2d6> 18046\n<d2d7> <d2d7> 3394\n<d2d8> <d2dd> 18050\n<d2e1> <d2e2> 3395\n<d2e3> <d2e4> 18056\n<d2e5> <d2e5> 3397\n<d2e6> <d2e8> 18058\n<d2e9> <d2e9> 3398\n<d2ea> <d2f0> 18061\n<d2f1> <d2f1> 3399\n<d2f3> <d2f3> 3400\n<d2f4> <d2f4> 18068\n<d2f5> <d2f5> 3401\n<d2f6> <d2f6> 18069\n<d2f7> <d2f7> 3402\n<d2f8> <d2fd> 18070\n<d341> <d342> 3403\n<d343> <d344> 18076\n<d345> <d345> 3405\n<d346> <d348> 18078\n<d349> <d349> 3406\n<d34a> <d350> 18081\n<d351> <d351> 3407\n<d353> <d354> 18088\n<d355> <d355> 3408\n<d356> <d356> 18090\n<d357> <d357> 3409\n<d358> <d35d> 18091\n<d361> <d362> 3410\n<d363> <d364> 18097\n<d365> <d365> 3412\n<d366> <d366> 18099\n<d367> <d36a> 3413\n<d36b> <d370> 18100\n<d371> <d371> 3417\n<d373> <d373> 3418\n<d374> <d374> 18106\n<d375> <d375> 3419\n<d376> <d376> 18107\n<d377> <d377> 3420\n<d378> <d37a> 18108\n<d37b> <d37b> 3421\n<d37c> <d37d> 18111\n<d381> <d381> 3422\n<d382> <d384> 18113\n<d385> <d385> 3423\n<d386> <d388> 18116\n<d389> <d389> 3424\n<d38a> <d390> 18119\n<d391> <d391> 3425\n<d393> <d393> 3426\n<d394> <d396> 18126\n<d397> <d397> 3427\n<d398> <d39d> 18129\n<d3a1> <d3a2> 3428\n<d3a3> <d3a4> 18135\n<d3a5> <d3a5> 3430\n<d3a6> <d3a8> 18137\n<d3a9> <d3a9> 3431\n<d3aa> <d3b0> 18140\n<d3b1> <d3b1> 3432\n<d3b3> <d3b3> 3433\n<d3b4> <d3b4> 18147\n<d3b5> <d3b5> 3434\n<d3b6> <d3b6> 18148\n<d3b7> <d3b7> 3435\n<d3b8> <d3bd> 18149\n<d931> <d97e> 101\n<d991> <d9e5> 179\n<da31> <da7e> 264\n<da91> <daa0> 342\n<dad5> <dafe> 409\n<db31> <db3a> 451\n<db40> <db49> 461\n<db51> <db68> 471\n<db71> <db7e> 495\n<db91> <db9a> 509\nendcidrange\n\n100 begincidrange\n<dba1> <dbe4> 519\n<dc31> <dc7e> 587\n<dc91> <dc91> 665\n<dca1> <dca4> 666\n<dca6> <dca6> 670\n<dca8> <dcaf> 671\n<dcb1> <dcfe> 679\n<dd31> <dd7e> 757\n<dd91> <ddf3> 835\n<de31> <de7e> 934\n<de91> <de98> 1012\n<dea1> <dec1> 1020\n<ded1> <def1> 1053\n<e031> <e07e> 3436\n<e091> <e0cf> 3514\n<e0d0> <e0d0> 4116\n<e0d1> <e0d5> 3577\n<e0d6> <e0d6> 3678\n<e0d7> <e0e6> 3582\n<e0e7> <e0e7> 7053\n<e0e8> <e0fe> 3598\n<e131> <e17e> 3621\n<e191> <e1ce> 3699\n<e1cf> <e1cf> 3460\n<e1d0> <e1e7> 3761\n<e1e8> <e1e8> 7900\n<e1e9> <e1fe> 3785\n<e231> <e23c> 3807\n<e23d> <e23d> 3802\n<e23e> <e27e> 3819\n<e291> <e2fa> 3884\n<e2fb> <e2fb> 3902\n<e2fc> <e2fe> 3990\n<e331> <e331> 3993\n<e332> <e332> 3946\n<e333> <e347> 3994\n<e348> <e348> 3946\n<e349> <e35f> 4015\n<e360> <e360> 3708\n<e361> <e36c> 4038\n<e36d> <e36d> 4131\n<e36e> <e37e> 4050\n<e391> <e3d3> 4067\n<e3d4> <e3d4> 4374\n<e3d5> <e3d5> 4156\n<e3d6> <e3d7> 4134\n<e3d8> <e3d8> 4375\n<e3d9> <e3da> 4136\n<e3db> <e3e0> 4376\n<e3e1> <e3e1> 4138\n<e3e2> <e3e2> 5800\n<e3e3> <e3e5> 4382\n<e3e6> <e3e6> 4386\n<e3e7> <e3e7> 4139\n<e3e8> <e3eb> 4387\n<e3ec> <e3ec> 4140\n<e3ed> <e3ed> 4391\n<e3ee> <e3ee> 4141\n<e3ef> <e3f0> 4394\n<e3f1> <e3f1> 4142\n<e3f2> <e3f2> 4396\n<e3f3> <e3f5> 4143\n<e3f6> <e3f6> 4399\n<e3f7> <e3f9> 4146\n<e3fa> <e3fa> 4403\n<e3fb> <e3fb> 4149\n<e3fc> <e3fd> 4406\n<e3fe> <e3fe> 4409\n<e431> <e431> 4150\n<e432> <e433> 4410\n<e434> <e436> 4151\n<e437> <e43a> 4412\n<e43b> <e43b> 4419\n<e43c> <e43c> 4154\n<e43d> <e43d> 4420\n<e43e> <e441> 4155\n<e442> <e442> 4424\n<e443> <e44d> 4159\n<e44e> <e44e> 4511\n<e44f> <e451> 4170\n<e452> <e453> 4513\n<e454> <e454> 4517\n<e455> <e455> 4173\n<e456> <e45a> 4518\n<e45b> <e45b> 4524\n<e45c> <e45c> 4174\n<e45d> <e45e> 4525\n<e45f> <e464> 4528\n<e465> <e467> 4535\n<e468> <e468> 4175\n<e469> <e46a> 4541\n<e46b> <e46d> 4176\n<e46e> <e46f> 4545\n<e470> <e470> 4179\n<e471> <e471> 4547\n<e472> <e472> 4550\n<e473> <e473> 4180\n<e474> <e474> 4564\n<e475> <e478> 4566\n<e479> <e47a> 4571\nendcidrange\n\n100 begincidrange\n<e47b> <e47b> 4576\n<e47c> <e47e> 4181\n<e491> <e491> 4184\n<e492> <e495> 4604\n<e496> <e497> 4609\n<e498> <e498> 4185\n<e499> <e49a> 4611\n<e49b> <e4fe> 4186\n<e531> <e575> 4286\n<e576> <e576> 4318\n<e577> <e57e> 4355\n<e591> <e59d> 4363\n<e59e> <e59e> 4136\n<e59f> <e5a4> 4376\n<e5a5> <e5a5> 5800\n<e5a6> <e5aa> 4382\n<e5ab> <e5ab> 4139\n<e5ac> <e5ad> 4387\n<e5ae> <e5ae> 4192\n<e5af> <e5fe> 4389\n<e631> <e647> 4469\n<e648> <e648> 4167\n<e649> <e65c> 4492\n<e65d> <e65d> 4172\n<e65e> <e67e> 4512\n<e691> <e6ca> 4545\n<e6cb> <e6cb> 5552\n<e6cc> <e6e3> 4603\n<e6e4> <e6e4> 6424\n<e6e5> <e6fe> 4627\n<e731> <e77e> 4653\n<e791> <e7fe> 4731\n<e831> <e87e> 4841\n<e891> <e8c4> 4919\n<e8c5> <e8c5> 5151\n<e8c6> <e8e3> 4971\n<e8e4> <e8e4> 4922\n<e8e5> <e8fe> 5001\n<e931> <e934> 5027\n<e935> <e935> 7518\n<e936> <e97e> 5031\n<e991> <e9a4> 5104\n<e9a5> <e9a5> 5079\n<e9a6> <e9d4> 5124\n<e9d5> <e9d5> 5109\n<e9d6> <e9f3> 5171\n<e9f4> <e9f4> 7607\n<e9f5> <e9fe> 5201\n<ea31> <ea7e> 5211\n<ea91> <ea9d> 5289\n<ea9e> <ea9e> 5584\n<ea9f> <ea9f> 5302\n<eaa0> <eaa0> 5367\n<eaa1> <eab2> 5303\n<eab3> <eab3> 7083\n<eab4> <eae0> 5321\n<eae1> <eae1> 5362\n<eae2> <eae7> 5366\n<eae8> <eae8> 5485\n<eae9> <eafe> 5372\n<eb31> <eb7e> 5394\n<eb91> <eb92> 5472\n<eb93> <eb93> 6001\n<eb94> <ebac> 5474\n<ebad> <ebad> 5460\n<ebae> <ebec> 5499\n<ebed> <ebed> 5317\n<ebee> <ebfe> 5562\n<ec31> <ec7e> 5579\n<ec91> <ecf4> 5657\n<ecf5> <ecf5> 7009\n<ecf6> <ecfe> 5757\n<ed31> <ed31> 7370\n<ed32> <ed38> 5766\n<ed39> <ed39> 5678\n<ed3a> <ed7e> 5773\n<ed91> <edad> 5842\n<edae> <edae> 5874\n<edaf> <edb0> 5871\n<edb1> <edb2> 4425\n<edb3> <edb8> 5873\n<edb9> <edb9> 4427\n<edba> <edba> 5879\n<edbb> <edbc> 4429\n<edbd> <edc3> 5880\n<edc4> <edc4> 4431\n<edc5> <edcd> 5887\n<edce> <edce> 4435\n<edcf> <edcf> 5896\n<edd0> <edd0> 4436\n<edd1> <edd1> 5897\n<edd2> <edd2> 4437\n<edd3> <edd5> 5898\n<edd6> <edd6> 4439\n<edd7> <edf9> 5901\n<edfa> <edfb> 4442\n<edfc> <edfc> 4159\n<edfd> <edfd> 5936\n<edfe> <edfe> 4444\n<ee31> <ee31> 4447\nendcidrange\n\n100 begincidrange\n<ee32> <ee33> 5937\n<ee34> <ee34> 4449\n<ee35> <ee36> 5939\n<ee37> <ee37> 4450\n<ee38> <ee3c> 5941\n<ee3d> <ee3d> 4453\n<ee3e> <ee3e> 5946\n<ee3f> <ee41> 4455\n<ee42> <ee42> 5947\n<ee43> <ee43> 4458\n<ee44> <ee46> 5948\n<ee47> <ee48> 4459\n<ee49> <ee4b> 5951\n<ee4c> <ee4c> 4463\n<ee4d> <ee53> 5954\n<ee54> <ee54> 4160\n<ee55> <ee55> 5961\n<ee56> <ee57> 4465\n<ee58> <ee59> 5962\n<ee5a> <ee5a> 4161\n<ee5b> <ee61> 5964\n<ee62> <ee62> 4468\n<ee63> <ee65> 5971\n<ee66> <ee66> 4469\n<ee67> <ee68> 5974\n<ee69> <ee69> 4470\n<ee6a> <ee6b> 5976\n<ee6c> <ee6c> 4162\n<ee6d> <ee6e> 5978\n<ee6f> <ee6f> 4471\n<ee70> <ee70> 5980\n<ee71> <ee71> 4472\n<ee72> <ee73> 5981\n<ee74> <ee74> 4474\n<ee75> <ee75> 4473\n<ee76> <ee76> 4475\n<ee77> <ee77> 5983\n<ee78> <ee78> 4476\n<ee79> <ee79> 5984\n<ee7a> <ee7b> 4478\n<ee7c> <ee7c> 6447\n<ee7d> <ee7e> 5985\n<ee91> <ee91> 4481\n<ee92> <ee92> 5987\n<ee93> <ee93> 4482\n<ee94> <ee94> 5460\n<ee95> <ee96> 5988\n<ee97> <ee97> 4483\n<ee98> <ee98> 4163\n<ee99> <ee99> 4166\n<ee9a> <ee9a> 5990\n<ee9b> <ee9b> 4485\n<ee9c> <eea0> 5991\n<eea1> <eea1> 4487\n<eea2> <eea5> 5996\n<eea6> <eea6> 4488\n<eea7> <eea8> 6000\n<eea9> <eea9> 4489\n<eeaa> <eeaa> 4491\n<eeab> <eeab> 6002\n<eeac> <eeac> 4167\n<eead> <eead> 4493\n<eeae> <eeaf> 6003\n<eeb0> <eeb0> 4494\n<eeb1> <eebe> 6005\n<eebf> <eebf> 4495\n<eec0> <eec0> 6019\n<eec1> <eec1> 7783\n<eec2> <eec5> 6020\n<eec6> <eec6> 4497\n<eec7> <eec7> 4499\n<eec8> <eeca> 6024\n<eecb> <eecb> 4501\n<eecc> <eecc> 6027\n<eecd> <eecd> 4502\n<eece> <eece> 6028\n<eecf> <eed0> 4503\n<eed1> <eed2> 6029\n<eed3> <eed3> 4506\n<eed4> <eede> 6031\n<eedf> <eedf> 4508\n<eee0> <eee3> 6042\n<eee4> <eee4> 4509\n<eee5> <eee5> 6046\n<eee6> <eee6> 4510\n<eee7> <eef6> 6047\n<eef7> <eef7> 5797\n<eef8> <eefe> 6063\n<ef31> <ef76> 6070\n<ef77> <ef78> 4551\n<ef79> <ef7e> 6140\n<ef91> <ef91> 6146\n<ef92> <ef92> 4553\n<ef93> <ef93> 4180\n<ef94> <ef98> 6147\n<ef99> <ef99> 4555\n<ef9a> <ef9a> 6152\n<ef9b> <ef9b> 5800\n<ef9c> <ef9c> 6153\n<ef9d> <ef9d> 4556\nendcidrange\n\n100 begincidrange\n<ef9e> <ef9f> 6154\n<efa0> <efa0> 4557\n<efa1> <efa6> 6156\n<efa7> <efa7> 4560\n<efa8> <efab> 6162\n<efac> <efac> 4561\n<efad> <efcb> 6166\n<efcc> <efcc> 4563\n<efcd> <eff6> 6197\n<eff7> <eff7> 7988\n<eff8> <effe> 6239\n<f031> <f050> 6246\n<f051> <f051> 6123\n<f052> <f074> 6278\n<f075> <f075> 4577\n<f076> <f07e> 6313\n<f091> <f095> 6322\n<f096> <f096> 4183\n<f097> <f098> 6327\n<f099> <f099> 4579\n<f09a> <f09d> 6329\n<f09e> <f09e> 4581\n<f09f> <f09f> 6333\n<f0a0> <f0a0> 4582\n<f0a1> <f0a3> 6334\n<f0a4> <f0a4> 4584\n<f0a5> <f0a6> 6337\n<f0a7> <f0a7> 4586\n<f0a8> <f0a8> 6339\n<f0a9> <f0a9> 4588\n<f0aa> <f0aa> 4184\n<f0ab> <f0b9> 6340\n<f0ba> <f0bb> 4590\n<f0bc> <f0bc> 6355\n<f0bd> <f0bd> 4592\n<f0be> <f0c0> 6356\n<f0c1> <f0c1> 4593\n<f0c2> <f0c2> 4595\n<f0c3> <f0c5> 6359\n<f0c6> <f0c7> 4596\n<f0c8> <f0cb> 6362\n<f0cc> <f0cc> 4599\n<f0cd> <f0ce> 6366\n<f0cf> <f0d1> 4600\n<f0d2> <f0d2> 5552\n<f0d3> <f0d7> 6368\n<f0d8> <f0d8> 4603\n<f0d9> <f0fe> 6373\n<f131> <f135> 6411\n<f136> <f136> 4614\n<f137> <f137> 4616\n<f138> <f139> 6416\n<f13a> <f13a> 4618\n<f13b> <f13e> 6418\n<f13f> <f13f> 5950\n<f140> <f141> 4620\n<f142> <f142> 4187\n<f143> <f144> 6422\n<f145> <f145> 4625\n<f146> <f147> 6424\n<f148> <f148> 4627\n<f149> <f149> 6426\n<f14a> <f14a> 4629\n<f14b> <f14f> 6427\n<f150> <f151> 4632\n<f152> <f154> 6432\n<f155> <f155> 4634\n<f156> <f156> 4636\n<f157> <f158> 6435\n<f159> <f15a> 4188\n<f15b> <f164> 6437\n<f165> <f165> 4638\n<f166> <f16c> 6447\n<f16d> <f16e> 4640\n<f16f> <f170> 6454\n<f171> <f171> 4642\n<f172> <f173> 6456\n<f174> <f174> 4644\n<f175> <f176> 6458\n<f177> <f178> 4645\n<f179> <f17e> 6460\n<f191> <f198> 6466\n<f199> <f19a> 4647\n<f19b> <f19b> 6474\n<f19c> <f19c> 4650\n<f19d> <f1a0> 6475\n<f1a1> <f1a3> 4653\n<f1a4> <f1ed> 6479\n<f1ee> <f1ee> 5351\n<f1ef> <f1fe> 6553\n<f231> <f26a> 6569\n<f26b> <f26b> 6494\n<f26c> <f27e> 6627\n<f291> <f2fe> 6646\n<f331> <f37e> 6756\n<f391> <f3fe> 6834\n<f431> <f44c> 6944\n<f44d> <f44d> 5731\n<f44e> <f47e> 6972\n<f491> <f49b> 7021\nendcidrange\n\n37 begincidrange\n<f49c> <f49c> 5771\n<f49d> <f4b0> 7032\n<f4b1> <f4b1> 4191\n<f4b2> <f4fe> 7052\n<f531> <f536> 7129\n<f537> <f537> 6484\n<f538> <f57d> 7135\n<f57e> <f57e> 6684\n<f591> <f5fe> 7205\n<f631> <f67e> 7315\n<f691> <f695> 7393\n<f696> <f696> 4279\n<f697> <f697> 7398\n<f698> <f698> 7139\n<f699> <f6b7> 7399\n<f6b8> <f6b8> 4247\n<f6b9> <f6c7> 7430\n<f6c8> <f6c8> 4266\n<f6c9> <f6d2> 7445\n<f6d3> <f6d3> 4340\n<f6d4> <f6fe> 7455\n<f731> <f76a> 7498\n<f76b> <f76b> 7572\n<f76c> <f77e> 7556\n<f791> <f791> 7575\n<f792> <f792> 5088\n<f793> <f7fe> 7576\n<f831> <f831> 7709\n<f832> <f832> 3558\n<f833> <f875> 7684\n<f876> <f876> 3644\n<f877> <f87e> 7751\n<f891> <f8fe> 7759\n<f931> <f938> 7869\n<f939> <f939> 3815\n<f93a> <f97e> 7877\n<f991> <f9fe> 7946\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/KSC-Johab-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (KSC-Johab-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (KSC-Johab-H)\n%%BeginResource: CMap (KSC-Johab-V)\n%%Title: (KSC-Johab-V Adobe Korea1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/KSC-Johab-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Korea1) def\n  /Supplement 1 def\nend def\n\n/CMapName /KSC-Johab-V def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 690 def\n/XUID [1 10 25412] def\n\n/WMode 1 def\n\n16 begincidrange\n<d932> <d933> 8056\n<d935> <d935> 8058\n<d936> <d936> 8320\n<d939> <d93b> 8059\n<d93d> <d93d> 8062\n<d942> <d94d> 8063\n<d97b> <d97b> 8075\n<da31> <da31> 8076\n<da38> <da39> 8077\n<da3c> <da3c> 8079\n<da3e> <da3e> 8080\n<da4a> <da4f> 8081\n<da6b> <da6b> 8087\n<da6d> <da6d> 8088\n<da6f> <da6f> 8089\n<da9d> <daa0> 8090\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/KSC-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (KSC-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (KSC-H)\n%%BeginResource: CMap (KSC-V)\n%%Title: (KSC-V Adobe Korea1 0)\n%%Version: 9.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/KSC-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Korea1) def\n  /Supplement 0 def\nend def\n\n/CMapName /KSC-V def\n/CMapVersion 9.003 def\n/CMapType 1 def\n\n/UIDOffset 320 def\n/XUID [1 10 25403] def\n\n/WMode 1 def\n\n16 begincidrange\n<2122> <2123> 8056\n<2125> <2125> 8058\n<2126> <2126> 8320\n<2129> <212b> 8059\n<212d> <212d> 8062\n<2132> <213d> 8063\n<216b> <216b> 8075\n<2321> <2321> 8076\n<2328> <2329> 8077\n<232c> <232c> 8079\n<232e> <232e> 8080\n<233a> <233f> 8081\n<235b> <235b> 8087\n<235d> <235d> 8088\n<235f> <235f> 8089\n<237b> <237e> 8090\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/KSCms-UHC-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (KSCms-UHC-H)\n%%Title: (KSCms-UHC-H Adobe Korea1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Korea1) def\n  /Supplement 1 def\nend def\n\n/CMapName /KSCms-UHC-H def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 430 def\n/XUID [1 10 25409] def\n\n/WMode 0 def\n\n2 begincodespacerange\n  <00>   <80>\n  <8141> <FEFE>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 1\nendnotdefrange\n\n100 begincidrange\n<20> <7e> 1\n<8141> <815a> 9333\n<8161> <817a> 9359\n<8181> <81fe> 9385\n<8241> <825a> 9511\n<8261> <827a> 9537\n<8281> <82fe> 9563\n<8341> <835a> 9689\n<8361> <837a> 9715\n<8381> <83fe> 9741\n<8441> <845a> 9867\n<8461> <847a> 9893\n<8481> <84fe> 9919\n<8541> <855a> 10045\n<8561> <857a> 10071\n<8581> <85fe> 10097\n<8641> <865a> 10223\n<8661> <867a> 10249\n<8681> <86fe> 10275\n<8741> <875a> 10401\n<8761> <877a> 10427\n<8781> <87fe> 10453\n<8841> <885a> 10579\n<8861> <887a> 10605\n<8881> <88fe> 10631\n<8941> <895a> 10757\n<8961> <897a> 10783\n<8981> <89fe> 10809\n<8a41> <8a5a> 10935\n<8a61> <8a7a> 10961\n<8a81> <8afe> 10987\n<8b41> <8b5a> 11113\n<8b61> <8b7a> 11139\n<8b81> <8bfe> 11165\n<8c41> <8c5a> 11291\n<8c61> <8c7a> 11317\n<8c81> <8cfe> 11343\n<8d41> <8d5a> 11469\n<8d61> <8d7a> 11495\n<8d81> <8dfe> 11521\n<8e41> <8e5a> 11647\n<8e61> <8e7a> 11673\n<8e81> <8efe> 11699\n<8f41> <8f5a> 11825\n<8f61> <8f7a> 11851\n<8f81> <8ffe> 11877\n<9041> <905a> 12003\n<9061> <907a> 12029\n<9081> <90fe> 12055\n<9141> <915a> 12181\n<9161> <917a> 12207\n<9181> <91fe> 12233\n<9241> <925a> 12359\n<9261> <927a> 12385\n<9281> <92fe> 12411\n<9341> <935a> 12537\n<9361> <937a> 12563\n<9381> <93fe> 12589\n<9441> <945a> 12715\n<9461> <947a> 12741\n<9481> <94fe> 12767\n<9541> <955a> 12893\n<9561> <957a> 12919\n<9581> <95fe> 12945\n<9641> <965a> 13071\n<9661> <967a> 13097\n<9681> <96fe> 13123\n<9741> <975a> 13249\n<9761> <977a> 13275\n<9781> <97fe> 13301\n<9841> <985a> 13427\n<9861> <987a> 13453\n<9881> <98fe> 13479\n<9941> <995a> 13605\n<9961> <997a> 13631\n<9981> <99fe> 13657\n<9a41> <9a5a> 13783\n<9a61> <9a7a> 13809\n<9a81> <9afe> 13835\n<9b41> <9b5a> 13961\n<9b61> <9b7a> 13987\n<9b81> <9bfe> 14013\n<9c41> <9c5a> 14139\n<9c61> <9c7a> 14165\n<9c81> <9cfe> 14191\n<9d41> <9d5a> 14317\n<9d61> <9d7a> 14343\n<9d81> <9dfe> 14369\n<9e41> <9e5a> 14495\n<9e61> <9e7a> 14521\n<9e81> <9efe> 14547\n<9f41> <9f5a> 14673\n<9f61> <9f7a> 14699\n<9f81> <9ffe> 14725\n<a041> <a05a> 14851\n<a061> <a07a> 14877\n<a081> <a0fe> 14903\n<a141> <a15a> 15029\n<a161> <a17a> 15055\n<a181> <a1a0> 15081\nendcidrange\n\n100 begincidrange\n<a1a1> <a1fe> 101\n<a241> <a25a> 15113\n<a261> <a27a> 15139\n<a281> <a2a0> 15165\n<a2a1> <a2e5> 195\n<a341> <a35a> 15197\n<a361> <a37a> 15223\n<a381> <a3a0> 15249\n<a3a1> <a3fe> 264\n<a441> <a45a> 15281\n<a461> <a47a> 15307\n<a481> <a4a0> 15333\n<a4a1> <a4d3> 358\n<a4d5> <a4fe> 409\n<a541> <a55a> 15365\n<a561> <a57a> 15391\n<a581> <a5a0> 15417\n<a5a1> <a5aa> 451\n<a5b0> <a5b9> 461\n<a5c1> <a5d8> 471\n<a5e1> <a5f8> 495\n<a641> <a65a> 15449\n<a661> <a67a> 15475\n<a681> <a6a0> 15501\n<a6a1> <a6e4> 519\n<a741> <a75a> 15533\n<a761> <a77a> 15559\n<a781> <a7a0> 15585\n<a7a1> <a7ef> 587\n<a841> <a85a> 15617\n<a861> <a87a> 15643\n<a881> <a8a0> 15669\n<a8a1> <a8a4> 666\n<a8a6> <a8a6> 670\n<a8a8> <a8af> 671\n<a8b1> <a8fe> 679\n<a941> <a95a> 15701\n<a961> <a97a> 15727\n<a981> <a9a0> 15753\n<a9a1> <a9fe> 757\n<aa41> <aa5a> 15785\n<aa61> <aa7a> 15811\n<aa81> <aaa0> 15837\n<aaa1> <aaf3> 851\n<ab41> <ab5a> 15869\n<ab61> <ab7a> 15895\n<ab81> <aba0> 15921\n<aba1> <abf6> 934\n<ac41> <ac5a> 15953\n<ac61> <ac7a> 15979\n<ac81> <aca0> 16005\n<aca1> <acc1> 1020\n<acd1> <acf1> 1053\n<ad41> <ad5a> 16037\n<ad61> <ad7a> 16063\n<ad81> <ada0> 16089\n<ae41> <ae5a> 16121\n<ae61> <ae7a> 16147\n<ae81> <aea0> 16173\n<af41> <af5a> 16205\n<af61> <af7a> 16231\n<af81> <afa0> 16257\n<b041> <b05a> 16289\n<b061> <b07a> 16315\n<b081> <b0a0> 16341\n<b0a1> <b0fe> 1086\n<b141> <b15a> 16373\n<b161> <b17a> 16399\n<b181> <b1a0> 16425\n<b1a1> <b1fe> 1180\n<b241> <b25a> 16457\n<b261> <b27a> 16483\n<b281> <b2a0> 16509\n<b2a1> <b2fe> 1274\n<b341> <b35a> 16541\n<b361> <b37a> 16567\n<b381> <b3a0> 16593\n<b3a1> <b3fe> 1368\n<b441> <b45a> 16625\n<b461> <b47a> 16651\n<b481> <b4a0> 16677\n<b4a1> <b4fe> 1462\n<b541> <b55a> 16709\n<b561> <b57a> 16735\n<b581> <b5a0> 16761\n<b5a1> <b5fe> 1556\n<b641> <b65a> 16793\n<b661> <b67a> 16819\n<b681> <b6a0> 16845\n<b6a1> <b6fe> 1650\n<b741> <b75a> 16877\n<b761> <b77a> 16903\n<b781> <b7a0> 16929\n<b7a1> <b7fe> 1744\n<b841> <b85a> 16961\n<b861> <b87a> 16987\n<b881> <b8a0> 17013\n<b8a1> <b8fe> 1838\n<b941> <b95a> 17045\n<b961> <b97a> 17071\nendcidrange\n\n100 begincidrange\n<b981> <b9a0> 17097\n<b9a1> <b9fe> 1932\n<ba41> <ba5a> 17129\n<ba61> <ba7a> 17155\n<ba81> <baa0> 17181\n<baa1> <bafe> 2026\n<bb41> <bb5a> 17213\n<bb61> <bb7a> 17239\n<bb81> <bba0> 17265\n<bba1> <bbfe> 2120\n<bc41> <bc5a> 17297\n<bc61> <bc7a> 17323\n<bc81> <bca0> 17349\n<bca1> <bcfe> 2214\n<bd41> <bd5a> 17381\n<bd61> <bd7a> 17407\n<bd81> <bda0> 17433\n<bda1> <bdfe> 2308\n<be41> <be5a> 17465\n<be61> <be7a> 17491\n<be81> <bea0> 17517\n<bea1> <befe> 2402\n<bf41> <bf5a> 17549\n<bf61> <bf7a> 17575\n<bf81> <bfa0> 17601\n<bfa1> <bffe> 2496\n<c041> <c05a> 17633\n<c061> <c07a> 17659\n<c081> <c0a0> 17685\n<c0a1> <c0fe> 2590\n<c141> <c15a> 17717\n<c161> <c17a> 17743\n<c181> <c1a0> 17769\n<c1a1> <c1fe> 2684\n<c241> <c25a> 17801\n<c261> <c27a> 17827\n<c281> <c2a0> 17853\n<c2a1> <c2fe> 2778\n<c341> <c35a> 17885\n<c361> <c37a> 17911\n<c381> <c3a0> 17937\n<c3a1> <c3fe> 2872\n<c441> <c45a> 17969\n<c461> <c47a> 17995\n<c481> <c4a0> 18021\n<c4a1> <c4fe> 2966\n<c541> <c55a> 18053\n<c561> <c57a> 18079\n<c581> <c5a0> 18105\n<c5a1> <c5fe> 3060\n<c641> <c652> 18137\n<c6a1> <c6fe> 3154\n<c7a1> <c7fe> 3248\n<c8a1> <c8fe> 3342\n<caa1> <cafe> 3436\n<cba1> <cbcf> 3530\n<cbd0> <cbd0> 4116\n<cbd1> <cbd5> 3577\n<cbd6> <cbd6> 3678\n<cbd7> <cbe6> 3582\n<cbe7> <cbe7> 7053\n<cbe8> <cbfe> 3598\n<cca1> <ccfe> 3621\n<cda1> <cdce> 3715\n<cdcf> <cdcf> 3460\n<cdd0> <cde7> 3761\n<cde8> <cde8> 7900\n<cde9> <cdfe> 3785\n<cea1> <ceac> 3807\n<cead> <cead> 3802\n<ceae> <cefe> 3819\n<cfa1> <cffa> 3900\n<cffb> <cffb> 3902\n<cffc> <cffe> 3990\n<d0a1> <d0a1> 3993\n<d0a2> <d0a2> 3946\n<d0a3> <d0b7> 3994\n<d0b8> <d0b8> 3946\n<d0b9> <d0cf> 4015\n<d0d0> <d0d0> 3708\n<d0d1> <d0dc> 4038\n<d0dd> <d0dd> 4131\n<d0de> <d0fe> 4050\n<d1a1> <d1d3> 4083\n<d1d4> <d1d4> 4374\n<d1d5> <d1d5> 4156\n<d1d6> <d1d7> 4134\n<d1d8> <d1d8> 4375\n<d1d9> <d1da> 4136\n<d1db> <d1e0> 4376\n<d1e1> <d1e1> 4138\n<d1e2> <d1e2> 5800\n<d1e3> <d1e5> 4382\n<d1e6> <d1e6> 4386\n<d1e7> <d1e7> 4139\n<d1e8> <d1eb> 4387\n<d1ec> <d1ec> 4140\n<d1ed> <d1ed> 4391\n<d1ee> <d1ee> 4141\n<d1ef> <d1f0> 4394\nendcidrange\n\n100 begincidrange\n<d1f1> <d1f1> 4142\n<d1f2> <d1f2> 4396\n<d1f3> <d1f5> 4143\n<d1f6> <d1f6> 4399\n<d1f7> <d1f9> 4146\n<d1fa> <d1fa> 4403\n<d1fb> <d1fb> 4149\n<d1fc> <d1fd> 4406\n<d1fe> <d1fe> 4409\n<d2a1> <d2a1> 4150\n<d2a2> <d2a3> 4410\n<d2a4> <d2a6> 4151\n<d2a7> <d2aa> 4412\n<d2ab> <d2ab> 4419\n<d2ac> <d2ac> 4154\n<d2ad> <d2ad> 4420\n<d2ae> <d2b1> 4155\n<d2b2> <d2b2> 4424\n<d2b3> <d2bd> 4159\n<d2be> <d2be> 4511\n<d2bf> <d2c1> 4170\n<d2c2> <d2c3> 4513\n<d2c4> <d2c4> 4517\n<d2c5> <d2c5> 4173\n<d2c6> <d2ca> 4518\n<d2cb> <d2cb> 4524\n<d2cc> <d2cc> 4174\n<d2cd> <d2ce> 4525\n<d2cf> <d2d4> 4528\n<d2d5> <d2d7> 4535\n<d2d8> <d2d8> 4175\n<d2d9> <d2da> 4541\n<d2db> <d2dd> 4176\n<d2de> <d2df> 4545\n<d2e0> <d2e0> 4179\n<d2e1> <d2e1> 4547\n<d2e2> <d2e2> 4550\n<d2e3> <d2e3> 4180\n<d2e4> <d2e4> 4564\n<d2e5> <d2e8> 4566\n<d2e9> <d2ea> 4571\n<d2eb> <d2eb> 4576\n<d2ec> <d2ef> 4181\n<d2f0> <d2f3> 4604\n<d2f4> <d2f5> 4609\n<d2f6> <d2f6> 4185\n<d2f7> <d2f8> 4611\n<d2f9> <d2fe> 4186\n<d3a1> <d3fe> 4192\n<d4a1> <d4e5> 4286\n<d4e6> <d4e6> 4318\n<d4e7> <d4fb> 4355\n<d4fc> <d4fc> 4136\n<d4fd> <d4fe> 4376\n<d5a1> <d5a4> 4378\n<d5a5> <d5a5> 5800\n<d5a6> <d5aa> 4382\n<d5ab> <d5ab> 4139\n<d5ac> <d5ad> 4387\n<d5ae> <d5ae> 4192\n<d5af> <d5fe> 4389\n<d6a1> <d6b7> 4469\n<d6b8> <d6b8> 4167\n<d6b9> <d6cc> 4492\n<d6cd> <d6cd> 4172\n<d6ce> <d6fe> 4512\n<d7a1> <d7ca> 4561\n<d7cb> <d7cb> 5552\n<d7cc> <d7e3> 4603\n<d7e4> <d7e4> 6424\n<d7e5> <d7fe> 4627\n<d8a1> <d8fe> 4653\n<d9a1> <d9fe> 4747\n<daa1> <dafe> 4841\n<dba1> <dbc4> 4935\n<dbc5> <dbc5> 5151\n<dbc6> <dbe3> 4971\n<dbe4> <dbe4> 4922\n<dbe5> <dbfe> 5001\n<dca1> <dca4> 5027\n<dca5> <dca5> 7518\n<dca6> <dcfe> 5031\n<dda1> <dda4> 5120\n<dda5> <dda5> 5079\n<dda6> <ddd4> 5124\n<ddd5> <ddd5> 5109\n<ddd6> <ddf3> 5171\n<ddf4> <ddf4> 7607\n<ddf5> <ddfe> 5201\n<dea1> <defb> 5211\n<defc> <defc> 5584\n<defd> <defd> 5302\n<defe> <defe> 5367\n<dfa1> <dfb2> 5303\n<dfb3> <dfb3> 7083\n<dfb4> <dfe0> 5321\n<dfe1> <dfe1> 5362\n<dfe2> <dfe7> 5366\n<dfe8> <dfe8> 5485\n<dfe9> <dffe> 5372\nendcidrange\n\n100 begincidrange\n<e0a1> <e0f0> 5394\n<e0f1> <e0f1> 6001\n<e0f2> <e0fe> 5474\n<e1a1> <e1ac> 5487\n<e1ad> <e1ad> 5460\n<e1ae> <e1ec> 5499\n<e1ed> <e1ed> 5317\n<e1ee> <e1fe> 5562\n<e2a1> <e2fe> 5579\n<e3a1> <e3f4> 5673\n<e3f5> <e3f5> 7009\n<e3f6> <e3fe> 5757\n<e4a1> <e4a1> 7370\n<e4a2> <e4a8> 5766\n<e4a9> <e4a9> 5678\n<e4aa> <e4fe> 5773\n<e5a1> <e5ad> 5858\n<e5ae> <e5ae> 5874\n<e5af> <e5b0> 5871\n<e5b1> <e5b2> 4425\n<e5b3> <e5b8> 5873\n<e5b9> <e5b9> 4427\n<e5ba> <e5ba> 5879\n<e5bb> <e5bc> 4429\n<e5bd> <e5c3> 5880\n<e5c4> <e5c4> 4431\n<e5c5> <e5cd> 5887\n<e5ce> <e5ce> 4435\n<e5cf> <e5cf> 5896\n<e5d0> <e5d0> 4436\n<e5d1> <e5d1> 5897\n<e5d2> <e5d2> 4437\n<e5d3> <e5d5> 5898\n<e5d6> <e5d6> 4439\n<e5d7> <e5f9> 5901\n<e5fa> <e5fb> 4442\n<e5fc> <e5fc> 4159\n<e5fd> <e5fd> 5936\n<e5fe> <e5fe> 4444\n<e6a1> <e6a1> 4447\n<e6a2> <e6a3> 5937\n<e6a4> <e6a4> 4449\n<e6a5> <e6a6> 5939\n<e6a7> <e6a7> 4450\n<e6a8> <e6ac> 5941\n<e6ad> <e6ad> 4453\n<e6ae> <e6ae> 5946\n<e6af> <e6b1> 4455\n<e6b2> <e6b2> 5947\n<e6b3> <e6b3> 4458\n<e6b4> <e6b6> 5948\n<e6b7> <e6b8> 4459\n<e6b9> <e6bb> 5951\n<e6bc> <e6bc> 4463\n<e6bd> <e6c3> 5954\n<e6c4> <e6c4> 4160\n<e6c5> <e6c5> 5961\n<e6c6> <e6c7> 4465\n<e6c8> <e6c9> 5962\n<e6ca> <e6ca> 4161\n<e6cb> <e6d1> 5964\n<e6d2> <e6d2> 4468\n<e6d3> <e6d5> 5971\n<e6d6> <e6d6> 4469\n<e6d7> <e6d8> 5974\n<e6d9> <e6d9> 4470\n<e6da> <e6db> 5976\n<e6dc> <e6dc> 4162\n<e6dd> <e6de> 5978\n<e6df> <e6df> 4471\n<e6e0> <e6e0> 5980\n<e6e1> <e6e1> 4472\n<e6e2> <e6e3> 5981\n<e6e4> <e6e4> 4474\n<e6e5> <e6e5> 4473\n<e6e6> <e6e6> 4475\n<e6e7> <e6e7> 5983\n<e6e8> <e6e8> 4476\n<e6e9> <e6e9> 5984\n<e6ea> <e6eb> 4478\n<e6ec> <e6ec> 6447\n<e6ed> <e6ee> 5985\n<e6ef> <e6ef> 4481\n<e6f0> <e6f0> 5987\n<e6f1> <e6f1> 4482\n<e6f2> <e6f2> 5460\n<e6f3> <e6f4> 5988\n<e6f5> <e6f5> 4483\n<e6f6> <e6f6> 4163\n<e6f7> <e6f7> 4166\n<e6f8> <e6f8> 5990\n<e6f9> <e6f9> 4485\n<e6fa> <e6fe> 5991\n<e7a1> <e7a1> 4487\n<e7a2> <e7a5> 5996\n<e7a6> <e7a6> 4488\n<e7a7> <e7a8> 6000\n<e7a9> <e7a9> 4489\n<e7aa> <e7aa> 4491\n<e7ab> <e7ab> 6002\nendcidrange\n\n100 begincidrange\n<e7ac> <e7ac> 4167\n<e7ad> <e7ad> 4493\n<e7ae> <e7af> 6003\n<e7b0> <e7b0> 4494\n<e7b1> <e7be> 6005\n<e7bf> <e7bf> 4495\n<e7c0> <e7c0> 6019\n<e7c1> <e7c1> 7783\n<e7c2> <e7c5> 6020\n<e7c6> <e7c6> 4497\n<e7c7> <e7c7> 4499\n<e7c8> <e7ca> 6024\n<e7cb> <e7cb> 4501\n<e7cc> <e7cc> 6027\n<e7cd> <e7cd> 4502\n<e7ce> <e7ce> 6028\n<e7cf> <e7d0> 4503\n<e7d1> <e7d2> 6029\n<e7d3> <e7d3> 4506\n<e7d4> <e7de> 6031\n<e7df> <e7df> 4508\n<e7e0> <e7e3> 6042\n<e7e4> <e7e4> 4509\n<e7e5> <e7e5> 6046\n<e7e6> <e7e6> 4510\n<e7e7> <e7f6> 6047\n<e7f7> <e7f7> 5797\n<e7f8> <e7fe> 6063\n<e8a1> <e8e6> 6070\n<e8e7> <e8e8> 4551\n<e8e9> <e8ef> 6140\n<e8f0> <e8f0> 4553\n<e8f1> <e8f1> 4180\n<e8f2> <e8f6> 6147\n<e8f7> <e8f7> 4555\n<e8f8> <e8f8> 6152\n<e8f9> <e8f9> 5800\n<e8fa> <e8fa> 6153\n<e8fb> <e8fb> 4556\n<e8fc> <e8fd> 6154\n<e8fe> <e8fe> 4557\n<e9a1> <e9a6> 6156\n<e9a7> <e9a7> 4560\n<e9a8> <e9ab> 6162\n<e9ac> <e9ac> 4561\n<e9ad> <e9cb> 6166\n<e9cc> <e9cc> 4563\n<e9cd> <e9f6> 6197\n<e9f7> <e9f7> 7988\n<e9f8> <e9fe> 6239\n<eaa1> <eac0> 6246\n<eac1> <eac1> 6123\n<eac2> <eae4> 6278\n<eae5> <eae5> 4577\n<eae6> <eaf3> 6313\n<eaf4> <eaf4> 4183\n<eaf5> <eaf6> 6327\n<eaf7> <eaf7> 4579\n<eaf8> <eafb> 6329\n<eafc> <eafc> 4581\n<eafd> <eafd> 6333\n<eafe> <eafe> 4582\n<eba1> <eba3> 6334\n<eba4> <eba4> 4584\n<eba5> <eba6> 6337\n<eba7> <eba7> 4586\n<eba8> <eba8> 6339\n<eba9> <eba9> 4588\n<ebaa> <ebaa> 4184\n<ebab> <ebb9> 6340\n<ebba> <ebbb> 4590\n<ebbc> <ebbc> 6355\n<ebbd> <ebbd> 4592\n<ebbe> <ebc0> 6356\n<ebc1> <ebc1> 4593\n<ebc2> <ebc2> 4595\n<ebc3> <ebc5> 6359\n<ebc6> <ebc7> 4596\n<ebc8> <ebcb> 6362\n<ebcc> <ebcc> 4599\n<ebcd> <ebce> 6366\n<ebcf> <ebd1> 4600\n<ebd2> <ebd2> 5552\n<ebd3> <ebd7> 6368\n<ebd8> <ebd8> 4603\n<ebd9> <ebfe> 6373\n<eca1> <eca5> 6411\n<eca6> <eca6> 4614\n<eca7> <eca7> 4616\n<eca8> <eca9> 6416\n<ecaa> <ecaa> 4618\n<ecab> <ecae> 6418\n<ecaf> <ecaf> 5950\n<ecb0> <ecb1> 4620\n<ecb2> <ecb2> 4187\n<ecb3> <ecb4> 6422\n<ecb5> <ecb5> 4625\n<ecb6> <ecb7> 6424\n<ecb8> <ecb8> 4627\n<ecb9> <ecb9> 6426\nendcidrange\n\n75 begincidrange\n<ecba> <ecba> 4629\n<ecbb> <ecbf> 6427\n<ecc0> <ecc1> 4632\n<ecc2> <ecc4> 6432\n<ecc5> <ecc5> 4634\n<ecc6> <ecc6> 4636\n<ecc7> <ecc8> 6435\n<ecc9> <ecca> 4188\n<eccb> <ecd4> 6437\n<ecd5> <ecd5> 4638\n<ecd6> <ecdc> 6447\n<ecdd> <ecde> 4640\n<ecdf> <ece0> 6454\n<ece1> <ece1> 4642\n<ece2> <ece3> 6456\n<ece4> <ece4> 4644\n<ece5> <ece6> 6458\n<ece7> <ece8> 4645\n<ece9> <ecf6> 6460\n<ecf7> <ecf8> 4647\n<ecf9> <ecf9> 6474\n<ecfa> <ecfa> 4650\n<ecfb> <ecfe> 6475\n<eda1> <eda3> 4653\n<eda4> <eded> 6479\n<edee> <edee> 5351\n<edef> <edfe> 6553\n<eea1> <eeda> 6569\n<eedb> <eedb> 6494\n<eedc> <eefe> 6627\n<efa1> <effe> 6662\n<f0a1> <f0fe> 6756\n<f1a1> <f1fe> 6850\n<f2a1> <f2bc> 6944\n<f2bd> <f2bd> 5731\n<f2be> <f2f9> 6972\n<f2fa> <f2fa> 5771\n<f2fb> <f2fe> 7032\n<f3a1> <f3b0> 7036\n<f3b1> <f3b1> 4191\n<f3b2> <f3fe> 7052\n<f4a1> <f4a6> 7129\n<f4a7> <f4a7> 6484\n<f4a8> <f4ed> 7135\n<f4ee> <f4ee> 6684\n<f4ef> <f4fe> 7205\n<f5a1> <f5fe> 7221\n<f6a1> <f6f3> 7315\n<f6f4> <f6f4> 4279\n<f6f5> <f6f5> 7398\n<f6f6> <f6f6> 7139\n<f6f7> <f6fe> 7399\n<f7a1> <f7b7> 7407\n<f7b8> <f7b8> 4247\n<f7b9> <f7c7> 7430\n<f7c8> <f7c8> 4266\n<f7c9> <f7d2> 7445\n<f7d3> <f7d3> 4340\n<f7d4> <f7fe> 7455\n<f8a1> <f8da> 7498\n<f8db> <f8db> 7572\n<f8dc> <f8ef> 7556\n<f8f0> <f8f0> 5088\n<f8f1> <f8fe> 7576\n<f9a1> <f9fe> 7590\n<faa1> <faa1> 7709\n<faa2> <faa2> 3558\n<faa3> <fae5> 7684\n<fae6> <fae6> 3644\n<fae7> <fafe> 7751\n<fba1> <fbfe> 7775\n<fca1> <fca8> 7869\n<fca9> <fca9> 3815\n<fcaa> <fcfe> 7877\n<fda1> <fdfe> 7962\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/KSCms-UHC-HW-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (KSCms-UHC-HW-H)\n%%Title: (KSCms-UHC-HW-H Adobe Korea1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Korea1) def\n  /Supplement 1 def\nend def\n\n/CMapName /KSCms-UHC-HW-H def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/XUID [1 10 25416] def\n\n/WMode 0 def\n\n2 begincodespacerange\n  <00>   <80>\n  <8141> <FEFE>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 8094\nendnotdefrange\n\n100 begincidrange\n<20> <7e> 8094\n<8141> <815a> 9333\n<8161> <817a> 9359\n<8181> <81fe> 9385\n<8241> <825a> 9511\n<8261> <827a> 9537\n<8281> <82fe> 9563\n<8341> <835a> 9689\n<8361> <837a> 9715\n<8381> <83fe> 9741\n<8441> <845a> 9867\n<8461> <847a> 9893\n<8481> <84fe> 9919\n<8541> <855a> 10045\n<8561> <857a> 10071\n<8581> <85fe> 10097\n<8641> <865a> 10223\n<8661> <867a> 10249\n<8681> <86fe> 10275\n<8741> <875a> 10401\n<8761> <877a> 10427\n<8781> <87fe> 10453\n<8841> <885a> 10579\n<8861> <887a> 10605\n<8881> <88fe> 10631\n<8941> <895a> 10757\n<8961> <897a> 10783\n<8981> <89fe> 10809\n<8a41> <8a5a> 10935\n<8a61> <8a7a> 10961\n<8a81> <8afe> 10987\n<8b41> <8b5a> 11113\n<8b61> <8b7a> 11139\n<8b81> <8bfe> 11165\n<8c41> <8c5a> 11291\n<8c61> <8c7a> 11317\n<8c81> <8cfe> 11343\n<8d41> <8d5a> 11469\n<8d61> <8d7a> 11495\n<8d81> <8dfe> 11521\n<8e41> <8e5a> 11647\n<8e61> <8e7a> 11673\n<8e81> <8efe> 11699\n<8f41> <8f5a> 11825\n<8f61> <8f7a> 11851\n<8f81> <8ffe> 11877\n<9041> <905a> 12003\n<9061> <907a> 12029\n<9081> <90fe> 12055\n<9141> <915a> 12181\n<9161> <917a> 12207\n<9181> <91fe> 12233\n<9241> <925a> 12359\n<9261> <927a> 12385\n<9281> <92fe> 12411\n<9341> <935a> 12537\n<9361> <937a> 12563\n<9381> <93fe> 12589\n<9441> <945a> 12715\n<9461> <947a> 12741\n<9481> <94fe> 12767\n<9541> <955a> 12893\n<9561> <957a> 12919\n<9581> <95fe> 12945\n<9641> <965a> 13071\n<9661> <967a> 13097\n<9681> <96fe> 13123\n<9741> <975a> 13249\n<9761> <977a> 13275\n<9781> <97fe> 13301\n<9841> <985a> 13427\n<9861> <987a> 13453\n<9881> <98fe> 13479\n<9941> <995a> 13605\n<9961> <997a> 13631\n<9981> <99fe> 13657\n<9a41> <9a5a> 13783\n<9a61> <9a7a> 13809\n<9a81> <9afe> 13835\n<9b41> <9b5a> 13961\n<9b61> <9b7a> 13987\n<9b81> <9bfe> 14013\n<9c41> <9c5a> 14139\n<9c61> <9c7a> 14165\n<9c81> <9cfe> 14191\n<9d41> <9d5a> 14317\n<9d61> <9d7a> 14343\n<9d81> <9dfe> 14369\n<9e41> <9e5a> 14495\n<9e61> <9e7a> 14521\n<9e81> <9efe> 14547\n<9f41> <9f5a> 14673\n<9f61> <9f7a> 14699\n<9f81> <9ffe> 14725\n<a041> <a05a> 14851\n<a061> <a07a> 14877\n<a081> <a0fe> 14903\n<a141> <a15a> 15029\n<a161> <a17a> 15055\n<a181> <a1a0> 15081\nendcidrange\n\n100 begincidrange\n<a1a1> <a1fe> 101\n<a241> <a25a> 15113\n<a261> <a27a> 15139\n<a281> <a2a0> 15165\n<a2a1> <a2e5> 195\n<a341> <a35a> 15197\n<a361> <a37a> 15223\n<a381> <a3a0> 15249\n<a3a1> <a3fe> 264\n<a441> <a45a> 15281\n<a461> <a47a> 15307\n<a481> <a4a0> 15333\n<a4a1> <a4d3> 358\n<a4d5> <a4fe> 409\n<a541> <a55a> 15365\n<a561> <a57a> 15391\n<a581> <a5a0> 15417\n<a5a1> <a5aa> 451\n<a5b0> <a5b9> 461\n<a5c1> <a5d8> 471\n<a5e1> <a5f8> 495\n<a641> <a65a> 15449\n<a661> <a67a> 15475\n<a681> <a6a0> 15501\n<a6a1> <a6e4> 519\n<a741> <a75a> 15533\n<a761> <a77a> 15559\n<a781> <a7a0> 15585\n<a7a1> <a7ef> 587\n<a841> <a85a> 15617\n<a861> <a87a> 15643\n<a881> <a8a0> 15669\n<a8a1> <a8a4> 666\n<a8a6> <a8a6> 670\n<a8a8> <a8af> 671\n<a8b1> <a8fe> 679\n<a941> <a95a> 15701\n<a961> <a97a> 15727\n<a981> <a9a0> 15753\n<a9a1> <a9fe> 757\n<aa41> <aa5a> 15785\n<aa61> <aa7a> 15811\n<aa81> <aaa0> 15837\n<aaa1> <aaf3> 851\n<ab41> <ab5a> 15869\n<ab61> <ab7a> 15895\n<ab81> <aba0> 15921\n<aba1> <abf6> 934\n<ac41> <ac5a> 15953\n<ac61> <ac7a> 15979\n<ac81> <aca0> 16005\n<aca1> <acc1> 1020\n<acd1> <acf1> 1053\n<ad41> <ad5a> 16037\n<ad61> <ad7a> 16063\n<ad81> <ada0> 16089\n<ae41> <ae5a> 16121\n<ae61> <ae7a> 16147\n<ae81> <aea0> 16173\n<af41> <af5a> 16205\n<af61> <af7a> 16231\n<af81> <afa0> 16257\n<b041> <b05a> 16289\n<b061> <b07a> 16315\n<b081> <b0a0> 16341\n<b0a1> <b0fe> 1086\n<b141> <b15a> 16373\n<b161> <b17a> 16399\n<b181> <b1a0> 16425\n<b1a1> <b1fe> 1180\n<b241> <b25a> 16457\n<b261> <b27a> 16483\n<b281> <b2a0> 16509\n<b2a1> <b2fe> 1274\n<b341> <b35a> 16541\n<b361> <b37a> 16567\n<b381> <b3a0> 16593\n<b3a1> <b3fe> 1368\n<b441> <b45a> 16625\n<b461> <b47a> 16651\n<b481> <b4a0> 16677\n<b4a1> <b4fe> 1462\n<b541> <b55a> 16709\n<b561> <b57a> 16735\n<b581> <b5a0> 16761\n<b5a1> <b5fe> 1556\n<b641> <b65a> 16793\n<b661> <b67a> 16819\n<b681> <b6a0> 16845\n<b6a1> <b6fe> 1650\n<b741> <b75a> 16877\n<b761> <b77a> 16903\n<b781> <b7a0> 16929\n<b7a1> <b7fe> 1744\n<b841> <b85a> 16961\n<b861> <b87a> 16987\n<b881> <b8a0> 17013\n<b8a1> <b8fe> 1838\n<b941> <b95a> 17045\n<b961> <b97a> 17071\nendcidrange\n\n100 begincidrange\n<b981> <b9a0> 17097\n<b9a1> <b9fe> 1932\n<ba41> <ba5a> 17129\n<ba61> <ba7a> 17155\n<ba81> <baa0> 17181\n<baa1> <bafe> 2026\n<bb41> <bb5a> 17213\n<bb61> <bb7a> 17239\n<bb81> <bba0> 17265\n<bba1> <bbfe> 2120\n<bc41> <bc5a> 17297\n<bc61> <bc7a> 17323\n<bc81> <bca0> 17349\n<bca1> <bcfe> 2214\n<bd41> <bd5a> 17381\n<bd61> <bd7a> 17407\n<bd81> <bda0> 17433\n<bda1> <bdfe> 2308\n<be41> <be5a> 17465\n<be61> <be7a> 17491\n<be81> <bea0> 17517\n<bea1> <befe> 2402\n<bf41> <bf5a> 17549\n<bf61> <bf7a> 17575\n<bf81> <bfa0> 17601\n<bfa1> <bffe> 2496\n<c041> <c05a> 17633\n<c061> <c07a> 17659\n<c081> <c0a0> 17685\n<c0a1> <c0fe> 2590\n<c141> <c15a> 17717\n<c161> <c17a> 17743\n<c181> <c1a0> 17769\n<c1a1> <c1fe> 2684\n<c241> <c25a> 17801\n<c261> <c27a> 17827\n<c281> <c2a0> 17853\n<c2a1> <c2fe> 2778\n<c341> <c35a> 17885\n<c361> <c37a> 17911\n<c381> <c3a0> 17937\n<c3a1> <c3fe> 2872\n<c441> <c45a> 17969\n<c461> <c47a> 17995\n<c481> <c4a0> 18021\n<c4a1> <c4fe> 2966\n<c541> <c55a> 18053\n<c561> <c57a> 18079\n<c581> <c5a0> 18105\n<c5a1> <c5fe> 3060\n<c641> <c652> 18137\n<c6a1> <c6fe> 3154\n<c7a1> <c7fe> 3248\n<c8a1> <c8fe> 3342\n<caa1> <cafe> 3436\n<cba1> <cbcf> 3530\n<cbd0> <cbd0> 4116\n<cbd1> <cbd5> 3577\n<cbd6> <cbd6> 3678\n<cbd7> <cbe6> 3582\n<cbe7> <cbe7> 7053\n<cbe8> <cbfe> 3598\n<cca1> <ccfe> 3621\n<cda1> <cdce> 3715\n<cdcf> <cdcf> 3460\n<cdd0> <cde7> 3761\n<cde8> <cde8> 7900\n<cde9> <cdfe> 3785\n<cea1> <ceac> 3807\n<cead> <cead> 3802\n<ceae> <cefe> 3819\n<cfa1> <cffa> 3900\n<cffb> <cffb> 3902\n<cffc> <cffe> 3990\n<d0a1> <d0a1> 3993\n<d0a2> <d0a2> 3946\n<d0a3> <d0b7> 3994\n<d0b8> <d0b8> 3946\n<d0b9> <d0cf> 4015\n<d0d0> <d0d0> 3708\n<d0d1> <d0dc> 4038\n<d0dd> <d0dd> 4131\n<d0de> <d0fe> 4050\n<d1a1> <d1d3> 4083\n<d1d4> <d1d4> 4374\n<d1d5> <d1d5> 4156\n<d1d6> <d1d7> 4134\n<d1d8> <d1d8> 4375\n<d1d9> <d1da> 4136\n<d1db> <d1e0> 4376\n<d1e1> <d1e1> 4138\n<d1e2> <d1e2> 5800\n<d1e3> <d1e5> 4382\n<d1e6> <d1e6> 4386\n<d1e7> <d1e7> 4139\n<d1e8> <d1eb> 4387\n<d1ec> <d1ec> 4140\n<d1ed> <d1ed> 4391\n<d1ee> <d1ee> 4141\n<d1ef> <d1f0> 4394\nendcidrange\n\n100 begincidrange\n<d1f1> <d1f1> 4142\n<d1f2> <d1f2> 4396\n<d1f3> <d1f5> 4143\n<d1f6> <d1f6> 4399\n<d1f7> <d1f9> 4146\n<d1fa> <d1fa> 4403\n<d1fb> <d1fb> 4149\n<d1fc> <d1fd> 4406\n<d1fe> <d1fe> 4409\n<d2a1> <d2a1> 4150\n<d2a2> <d2a3> 4410\n<d2a4> <d2a6> 4151\n<d2a7> <d2aa> 4412\n<d2ab> <d2ab> 4419\n<d2ac> <d2ac> 4154\n<d2ad> <d2ad> 4420\n<d2ae> <d2b1> 4155\n<d2b2> <d2b2> 4424\n<d2b3> <d2bd> 4159\n<d2be> <d2be> 4511\n<d2bf> <d2c1> 4170\n<d2c2> <d2c3> 4513\n<d2c4> <d2c4> 4517\n<d2c5> <d2c5> 4173\n<d2c6> <d2ca> 4518\n<d2cb> <d2cb> 4524\n<d2cc> <d2cc> 4174\n<d2cd> <d2ce> 4525\n<d2cf> <d2d4> 4528\n<d2d5> <d2d7> 4535\n<d2d8> <d2d8> 4175\n<d2d9> <d2da> 4541\n<d2db> <d2dd> 4176\n<d2de> <d2df> 4545\n<d2e0> <d2e0> 4179\n<d2e1> <d2e1> 4547\n<d2e2> <d2e2> 4550\n<d2e3> <d2e3> 4180\n<d2e4> <d2e4> 4564\n<d2e5> <d2e8> 4566\n<d2e9> <d2ea> 4571\n<d2eb> <d2eb> 4576\n<d2ec> <d2ef> 4181\n<d2f0> <d2f3> 4604\n<d2f4> <d2f5> 4609\n<d2f6> <d2f6> 4185\n<d2f7> <d2f8> 4611\n<d2f9> <d2fe> 4186\n<d3a1> <d3fe> 4192\n<d4a1> <d4e5> 4286\n<d4e6> <d4e6> 4318\n<d4e7> <d4fb> 4355\n<d4fc> <d4fc> 4136\n<d4fd> <d4fe> 4376\n<d5a1> <d5a4> 4378\n<d5a5> <d5a5> 5800\n<d5a6> <d5aa> 4382\n<d5ab> <d5ab> 4139\n<d5ac> <d5ad> 4387\n<d5ae> <d5ae> 4192\n<d5af> <d5fe> 4389\n<d6a1> <d6b7> 4469\n<d6b8> <d6b8> 4167\n<d6b9> <d6cc> 4492\n<d6cd> <d6cd> 4172\n<d6ce> <d6fe> 4512\n<d7a1> <d7ca> 4561\n<d7cb> <d7cb> 5552\n<d7cc> <d7e3> 4603\n<d7e4> <d7e4> 6424\n<d7e5> <d7fe> 4627\n<d8a1> <d8fe> 4653\n<d9a1> <d9fe> 4747\n<daa1> <dafe> 4841\n<dba1> <dbc4> 4935\n<dbc5> <dbc5> 5151\n<dbc6> <dbe3> 4971\n<dbe4> <dbe4> 4922\n<dbe5> <dbfe> 5001\n<dca1> <dca4> 5027\n<dca5> <dca5> 7518\n<dca6> <dcfe> 5031\n<dda1> <dda4> 5120\n<dda5> <dda5> 5079\n<dda6> <ddd4> 5124\n<ddd5> <ddd5> 5109\n<ddd6> <ddf3> 5171\n<ddf4> <ddf4> 7607\n<ddf5> <ddfe> 5201\n<dea1> <defb> 5211\n<defc> <defc> 5584\n<defd> <defd> 5302\n<defe> <defe> 5367\n<dfa1> <dfb2> 5303\n<dfb3> <dfb3> 7083\n<dfb4> <dfe0> 5321\n<dfe1> <dfe1> 5362\n<dfe2> <dfe7> 5366\n<dfe8> <dfe8> 5485\n<dfe9> <dffe> 5372\nendcidrange\n\n100 begincidrange\n<e0a1> <e0f0> 5394\n<e0f1> <e0f1> 6001\n<e0f2> <e0fe> 5474\n<e1a1> <e1ac> 5487\n<e1ad> <e1ad> 5460\n<e1ae> <e1ec> 5499\n<e1ed> <e1ed> 5317\n<e1ee> <e1fe> 5562\n<e2a1> <e2fe> 5579\n<e3a1> <e3f4> 5673\n<e3f5> <e3f5> 7009\n<e3f6> <e3fe> 5757\n<e4a1> <e4a1> 7370\n<e4a2> <e4a8> 5766\n<e4a9> <e4a9> 5678\n<e4aa> <e4fe> 5773\n<e5a1> <e5ad> 5858\n<e5ae> <e5ae> 5874\n<e5af> <e5b0> 5871\n<e5b1> <e5b2> 4425\n<e5b3> <e5b8> 5873\n<e5b9> <e5b9> 4427\n<e5ba> <e5ba> 5879\n<e5bb> <e5bc> 4429\n<e5bd> <e5c3> 5880\n<e5c4> <e5c4> 4431\n<e5c5> <e5cd> 5887\n<e5ce> <e5ce> 4435\n<e5cf> <e5cf> 5896\n<e5d0> <e5d0> 4436\n<e5d1> <e5d1> 5897\n<e5d2> <e5d2> 4437\n<e5d3> <e5d5> 5898\n<e5d6> <e5d6> 4439\n<e5d7> <e5f9> 5901\n<e5fa> <e5fb> 4442\n<e5fc> <e5fc> 4159\n<e5fd> <e5fd> 5936\n<e5fe> <e5fe> 4444\n<e6a1> <e6a1> 4447\n<e6a2> <e6a3> 5937\n<e6a4> <e6a4> 4449\n<e6a5> <e6a6> 5939\n<e6a7> <e6a7> 4450\n<e6a8> <e6ac> 5941\n<e6ad> <e6ad> 4453\n<e6ae> <e6ae> 5946\n<e6af> <e6b1> 4455\n<e6b2> <e6b2> 5947\n<e6b3> <e6b3> 4458\n<e6b4> <e6b6> 5948\n<e6b7> <e6b8> 4459\n<e6b9> <e6bb> 5951\n<e6bc> <e6bc> 4463\n<e6bd> <e6c3> 5954\n<e6c4> <e6c4> 4160\n<e6c5> <e6c5> 5961\n<e6c6> <e6c7> 4465\n<e6c8> <e6c9> 5962\n<e6ca> <e6ca> 4161\n<e6cb> <e6d1> 5964\n<e6d2> <e6d2> 4468\n<e6d3> <e6d5> 5971\n<e6d6> <e6d6> 4469\n<e6d7> <e6d8> 5974\n<e6d9> <e6d9> 4470\n<e6da> <e6db> 5976\n<e6dc> <e6dc> 4162\n<e6dd> <e6de> 5978\n<e6df> <e6df> 4471\n<e6e0> <e6e0> 5980\n<e6e1> <e6e1> 4472\n<e6e2> <e6e3> 5981\n<e6e4> <e6e4> 4474\n<e6e5> <e6e5> 4473\n<e6e6> <e6e6> 4475\n<e6e7> <e6e7> 5983\n<e6e8> <e6e8> 4476\n<e6e9> <e6e9> 5984\n<e6ea> <e6eb> 4478\n<e6ec> <e6ec> 6447\n<e6ed> <e6ee> 5985\n<e6ef> <e6ef> 4481\n<e6f0> <e6f0> 5987\n<e6f1> <e6f1> 4482\n<e6f2> <e6f2> 5460\n<e6f3> <e6f4> 5988\n<e6f5> <e6f5> 4483\n<e6f6> <e6f6> 4163\n<e6f7> <e6f7> 4166\n<e6f8> <e6f8> 5990\n<e6f9> <e6f9> 4485\n<e6fa> <e6fe> 5991\n<e7a1> <e7a1> 4487\n<e7a2> <e7a5> 5996\n<e7a6> <e7a6> 4488\n<e7a7> <e7a8> 6000\n<e7a9> <e7a9> 4489\n<e7aa> <e7aa> 4491\n<e7ab> <e7ab> 6002\nendcidrange\n\n100 begincidrange\n<e7ac> <e7ac> 4167\n<e7ad> <e7ad> 4493\n<e7ae> <e7af> 6003\n<e7b0> <e7b0> 4494\n<e7b1> <e7be> 6005\n<e7bf> <e7bf> 4495\n<e7c0> <e7c0> 6019\n<e7c1> <e7c1> 7783\n<e7c2> <e7c5> 6020\n<e7c6> <e7c6> 4497\n<e7c7> <e7c7> 4499\n<e7c8> <e7ca> 6024\n<e7cb> <e7cb> 4501\n<e7cc> <e7cc> 6027\n<e7cd> <e7cd> 4502\n<e7ce> <e7ce> 6028\n<e7cf> <e7d0> 4503\n<e7d1> <e7d2> 6029\n<e7d3> <e7d3> 4506\n<e7d4> <e7de> 6031\n<e7df> <e7df> 4508\n<e7e0> <e7e3> 6042\n<e7e4> <e7e4> 4509\n<e7e5> <e7e5> 6046\n<e7e6> <e7e6> 4510\n<e7e7> <e7f6> 6047\n<e7f7> <e7f7> 5797\n<e7f8> <e7fe> 6063\n<e8a1> <e8e6> 6070\n<e8e7> <e8e8> 4551\n<e8e9> <e8ef> 6140\n<e8f0> <e8f0> 4553\n<e8f1> <e8f1> 4180\n<e8f2> <e8f6> 6147\n<e8f7> <e8f7> 4555\n<e8f8> <e8f8> 6152\n<e8f9> <e8f9> 5800\n<e8fa> <e8fa> 6153\n<e8fb> <e8fb> 4556\n<e8fc> <e8fd> 6154\n<e8fe> <e8fe> 4557\n<e9a1> <e9a6> 6156\n<e9a7> <e9a7> 4560\n<e9a8> <e9ab> 6162\n<e9ac> <e9ac> 4561\n<e9ad> <e9cb> 6166\n<e9cc> <e9cc> 4563\n<e9cd> <e9f6> 6197\n<e9f7> <e9f7> 7988\n<e9f8> <e9fe> 6239\n<eaa1> <eac0> 6246\n<eac1> <eac1> 6123\n<eac2> <eae4> 6278\n<eae5> <eae5> 4577\n<eae6> <eaf3> 6313\n<eaf4> <eaf4> 4183\n<eaf5> <eaf6> 6327\n<eaf7> <eaf7> 4579\n<eaf8> <eafb> 6329\n<eafc> <eafc> 4581\n<eafd> <eafd> 6333\n<eafe> <eafe> 4582\n<eba1> <eba3> 6334\n<eba4> <eba4> 4584\n<eba5> <eba6> 6337\n<eba7> <eba7> 4586\n<eba8> <eba8> 6339\n<eba9> <eba9> 4588\n<ebaa> <ebaa> 4184\n<ebab> <ebb9> 6340\n<ebba> <ebbb> 4590\n<ebbc> <ebbc> 6355\n<ebbd> <ebbd> 4592\n<ebbe> <ebc0> 6356\n<ebc1> <ebc1> 4593\n<ebc2> <ebc2> 4595\n<ebc3> <ebc5> 6359\n<ebc6> <ebc7> 4596\n<ebc8> <ebcb> 6362\n<ebcc> <ebcc> 4599\n<ebcd> <ebce> 6366\n<ebcf> <ebd1> 4600\n<ebd2> <ebd2> 5552\n<ebd3> <ebd7> 6368\n<ebd8> <ebd8> 4603\n<ebd9> <ebfe> 6373\n<eca1> <eca5> 6411\n<eca6> <eca6> 4614\n<eca7> <eca7> 4616\n<eca8> <eca9> 6416\n<ecaa> <ecaa> 4618\n<ecab> <ecae> 6418\n<ecaf> <ecaf> 5950\n<ecb0> <ecb1> 4620\n<ecb2> <ecb2> 4187\n<ecb3> <ecb4> 6422\n<ecb5> <ecb5> 4625\n<ecb6> <ecb7> 6424\n<ecb8> <ecb8> 4627\n<ecb9> <ecb9> 6426\nendcidrange\n\n75 begincidrange\n<ecba> <ecba> 4629\n<ecbb> <ecbf> 6427\n<ecc0> <ecc1> 4632\n<ecc2> <ecc4> 6432\n<ecc5> <ecc5> 4634\n<ecc6> <ecc6> 4636\n<ecc7> <ecc8> 6435\n<ecc9> <ecca> 4188\n<eccb> <ecd4> 6437\n<ecd5> <ecd5> 4638\n<ecd6> <ecdc> 6447\n<ecdd> <ecde> 4640\n<ecdf> <ece0> 6454\n<ece1> <ece1> 4642\n<ece2> <ece3> 6456\n<ece4> <ece4> 4644\n<ece5> <ece6> 6458\n<ece7> <ece8> 4645\n<ece9> <ecf6> 6460\n<ecf7> <ecf8> 4647\n<ecf9> <ecf9> 6474\n<ecfa> <ecfa> 4650\n<ecfb> <ecfe> 6475\n<eda1> <eda3> 4653\n<eda4> <eded> 6479\n<edee> <edee> 5351\n<edef> <edfe> 6553\n<eea1> <eeda> 6569\n<eedb> <eedb> 6494\n<eedc> <eefe> 6627\n<efa1> <effe> 6662\n<f0a1> <f0fe> 6756\n<f1a1> <f1fe> 6850\n<f2a1> <f2bc> 6944\n<f2bd> <f2bd> 5731\n<f2be> <f2f9> 6972\n<f2fa> <f2fa> 5771\n<f2fb> <f2fe> 7032\n<f3a1> <f3b0> 7036\n<f3b1> <f3b1> 4191\n<f3b2> <f3fe> 7052\n<f4a1> <f4a6> 7129\n<f4a7> <f4a7> 6484\n<f4a8> <f4ed> 7135\n<f4ee> <f4ee> 6684\n<f4ef> <f4fe> 7205\n<f5a1> <f5fe> 7221\n<f6a1> <f6f3> 7315\n<f6f4> <f6f4> 4279\n<f6f5> <f6f5> 7398\n<f6f6> <f6f6> 7139\n<f6f7> <f6fe> 7399\n<f7a1> <f7b7> 7407\n<f7b8> <f7b8> 4247\n<f7b9> <f7c7> 7430\n<f7c8> <f7c8> 4266\n<f7c9> <f7d2> 7445\n<f7d3> <f7d3> 4340\n<f7d4> <f7fe> 7455\n<f8a1> <f8da> 7498\n<f8db> <f8db> 7572\n<f8dc> <f8ef> 7556\n<f8f0> <f8f0> 5088\n<f8f1> <f8fe> 7576\n<f9a1> <f9fe> 7590\n<faa1> <faa1> 7709\n<faa2> <faa2> 3558\n<faa3> <fae5> 7684\n<fae6> <fae6> 3644\n<fae7> <fafe> 7751\n<fba1> <fbfe> 7775\n<fca1> <fca8> 7869\n<fca9> <fca9> 3815\n<fcaa> <fcfe> 7877\n<fda1> <fdfe> 7962\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/KSCms-UHC-HW-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (KSCms-UHC-HW-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (KSCms-UHC-HW-H)\n%%BeginResource: CMap (KSCms-UHC-HW-V)\n%%Title: (KSCms-UHC-HW-V Adobe Korea1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/KSCms-UHC-HW-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Korea1) def\n  /Supplement 1 def\nend def\n\n/CMapName /KSCms-UHC-HW-V def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/XUID [1 10 25417] def\n\n/WMode 1 def\n\n16 begincidrange\n<a1a2> <a1a3> 8056\n<a1a5> <a1a5> 8058\n<a1a6> <a1a6> 8320\n<a1a9> <a1ab> 8059\n<a1ad> <a1ad> 8062\n<a1b2> <a1bd> 8063\n<a1eb> <a1eb> 8075\n<a3a1> <a3a1> 8076\n<a3a8> <a3a9> 8077\n<a3ac> <a3ac> 8079\n<a3ae> <a3ae> 8080\n<a3ba> <a3bf> 8081\n<a3db> <a3db> 8087\n<a3dd> <a3dd> 8088\n<a3df> <a3df> 8089\n<a3fb> <a3fe> 8090\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/KSCms-UHC-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (KSCms-UHC-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (KSCms-UHC-H)\n%%BeginResource: CMap (KSCms-UHC-V)\n%%Title: (KSCms-UHC-V Adobe Korea1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/KSCms-UHC-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Korea1) def\n  /Supplement 1 def\nend def\n\n/CMapName /KSCms-UHC-V def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/UIDOffset 680 def\n/XUID [1 10 25410] def\n\n/WMode 1 def\n\n16 begincidrange\n<a1a2> <a1a3> 8056\n<a1a5> <a1a5> 8058\n<a1a6> <a1a6> 8320\n<a1a9> <a1ab> 8059\n<a1ad> <a1ad> 8062\n<a1b2> <a1bd> 8063\n<a1eb> <a1eb> 8075\n<a3a1> <a3a1> 8076\n<a3a8> <a3a9> 8077\n<a3ac> <a3ac> 8079\n<a3ae> <a3ae> 8080\n<a3ba> <a3bf> 8081\n<a3db> <a3db> 8087\n<a3dd> <a3dd> 8088\n<a3df> <a3df> 8089\n<a3fb> <a3fe> 8090\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/KSCpc-EUC-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (KSCpc-EUC-H)\n%%Title: (KSCpc-EUC-H Adobe Korea1 0)\n%%Version: 9.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Korea1) def\n  /Supplement 0 def\nend def\n\n/CMapName /KSCpc-EUC-H def\n/CMapVersion 9.003 def\n/CMapType 1 def\n\n/UIDOffset 0 def\n/XUID [1 10 25404] def\n\n/WMode 0 def\n\n3 begincodespacerange\n  <00>   <84>\n  <A141> <FDFE>\n  <FE>   <FF>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 1\nendnotdefrange\n\n100 begincidrange\n<20> <7e> 1\n<81> <83> 96\n<a141> <a17d> 8191\n<a181> <a19a> 8252\n<a19c> <a1a0> 8278\n<a1a1> <a1a1> 101\n<a1a2> <a1a3> 8283\n<a1a4> <a1fe> 104\n<a241> <a24c> 8285\n<a2a1> <a2e5> 195\n<a2e6> <a2fe> 8297\n<a341> <a37d> 8322\n<a381> <a39f> 8383\n<a3a1> <a3fe> 264\n<a441> <a47d> 8414\n<a481> <a49f> 8475\n<a4a1> <a4d3> 358\n<a4d5> <a4fe> 409\n<a541> <a57d> 8506\n<a581> <a58b> 8567\n<a5a1> <a5aa> 451\n<a5b0> <a5b9> 461\n<a5c1> <a5d8> 471\n<a5da> <a5de> 8578\n<a5e1> <a5f8> 495\n<a5f9> <a5fc> 8583\n<a641> <a67d> 8587\n<a681> <a68a> 8648\n<a68d> <a693> 8658\n<a696> <a69b> 8665\n<a69e> <a69f> 8671\n<a6a1> <a6e4> 519\n<a6e5> <a6fe> 8673\n<a741> <a77d> 8699\n<a781> <a79f> 8760\n<a7a1> <a7ef> 587\n<a7f0> <a7fe> 8791\n<a841> <a87d> 8806\n<a881> <a89f> 8867\n<a8a1> <a8a4> 666\n<a8a6> <a8a6> 670\n<a8a8> <a8af> 671\n<a8b1> <a8fe> 679\n<a941> <a974> 8898\n<a9a1> <a9fe> 757\n<aa41> <aa7d> 8950\n<aa81> <aa9f> 9011\n<aaa1> <aaf3> 851\n<aaf4> <aafe> 9042\n<ab41> <ab7d> 9053\n<ab81> <ab9f> 9114\n<aba1> <abf6> 934\n<abf7> <abfa> 9145\n<abfb> <abfd> 9330\n<ac41> <ac7d> 9149\n<ac81> <ac97> 9210\n<aca1> <acc1> 1020\n<acc2> <acd0> 9233\n<acd1> <acf1> 1053\n<acf2> <acf6> 9248\n<ad41> <ad7d> 9253\n<ada1> <adb0> 9314\n<b0a1> <b0fe> 1086\n<b1a1> <b1fe> 1180\n<b2a1> <b2fe> 1274\n<b3a1> <b3fe> 1368\n<b4a1> <b4fe> 1462\n<b5a1> <b5fe> 1556\n<b6a1> <b6fe> 1650\n<b7a1> <b7fe> 1744\n<b8a1> <b8fe> 1838\n<b9a1> <b9fe> 1932\n<baa1> <bafe> 2026\n<bba1> <bbfe> 2120\n<bca1> <bcfe> 2214\n<bda1> <bdfe> 2308\n<bea1> <befe> 2402\n<bfa1> <bffe> 2496\n<c0a1> <c0fe> 2590\n<c1a1> <c1fe> 2684\n<c2a1> <c2fe> 2778\n<c3a1> <c3fe> 2872\n<c4a1> <c4fe> 2966\n<c5a1> <c5fe> 3060\n<c6a1> <c6fe> 3154\n<c7a1> <c7fe> 3248\n<c8a1> <c8fe> 3342\n<caa1> <cafe> 3436\n<cba1> <cbcf> 3530\n<cbd0> <cbd0> 4116\n<cbd1> <cbd5> 3577\n<cbd6> <cbd6> 3678\n<cbd7> <cbe6> 3582\n<cbe7> <cbe7> 7053\n<cbe8> <cbfe> 3598\n<cca1> <ccfe> 3621\n<cda1> <cdce> 3715\n<cdcf> <cdcf> 3460\n<cdd0> <cde7> 3761\n<cde8> <cde8> 7900\nendcidrange\n\n100 begincidrange\n<cde9> <cdfe> 3785\n<cea1> <ceac> 3807\n<cead> <cead> 3802\n<ceae> <cefe> 3819\n<cfa1> <cffa> 3900\n<cffb> <cffb> 3902\n<cffc> <cffe> 3990\n<d0a1> <d0a1> 3993\n<d0a2> <d0a2> 3946\n<d0a3> <d0b7> 3994\n<d0b8> <d0b8> 3946\n<d0b9> <d0cf> 4015\n<d0d0> <d0d0> 3708\n<d0d1> <d0dc> 4038\n<d0dd> <d0dd> 4131\n<d0de> <d0fe> 4050\n<d1a1> <d1d3> 4083\n<d1d4> <d1d4> 4374\n<d1d5> <d1d5> 4156\n<d1d6> <d1d7> 4134\n<d1d8> <d1d8> 4375\n<d1d9> <d1da> 4136\n<d1db> <d1e0> 4376\n<d1e1> <d1e1> 4138\n<d1e2> <d1e2> 5800\n<d1e3> <d1e5> 4382\n<d1e6> <d1e6> 4386\n<d1e7> <d1e7> 4139\n<d1e8> <d1eb> 4387\n<d1ec> <d1ec> 4140\n<d1ed> <d1ed> 4391\n<d1ee> <d1ee> 4141\n<d1ef> <d1f0> 4394\n<d1f1> <d1f1> 4142\n<d1f2> <d1f2> 4396\n<d1f3> <d1f5> 4143\n<d1f6> <d1f6> 4399\n<d1f7> <d1f9> 4146\n<d1fa> <d1fa> 4403\n<d1fb> <d1fb> 4149\n<d1fc> <d1fd> 4406\n<d1fe> <d1fe> 4409\n<d2a1> <d2a1> 4150\n<d2a2> <d2a3> 4410\n<d2a4> <d2a6> 4151\n<d2a7> <d2aa> 4412\n<d2ab> <d2ab> 4419\n<d2ac> <d2ac> 4154\n<d2ad> <d2ad> 4420\n<d2ae> <d2b1> 4155\n<d2b2> <d2b2> 4424\n<d2b3> <d2bd> 4159\n<d2be> <d2be> 4511\n<d2bf> <d2c1> 4170\n<d2c2> <d2c3> 4513\n<d2c4> <d2c4> 4517\n<d2c5> <d2c5> 4173\n<d2c6> <d2ca> 4518\n<d2cb> <d2cb> 4524\n<d2cc> <d2cc> 4174\n<d2cd> <d2ce> 4525\n<d2cf> <d2d4> 4528\n<d2d5> <d2d7> 4535\n<d2d8> <d2d8> 4175\n<d2d9> <d2da> 4541\n<d2db> <d2dd> 4176\n<d2de> <d2df> 4545\n<d2e0> <d2e0> 4179\n<d2e1> <d2e1> 4547\n<d2e2> <d2e2> 4550\n<d2e3> <d2e3> 4180\n<d2e4> <d2e4> 4564\n<d2e5> <d2e8> 4566\n<d2e9> <d2ea> 4571\n<d2eb> <d2eb> 4576\n<d2ec> <d2ef> 4181\n<d2f0> <d2f3> 4604\n<d2f4> <d2f5> 4609\n<d2f6> <d2f6> 4185\n<d2f7> <d2f8> 4611\n<d2f9> <d2fe> 4186\n<d3a1> <d3fe> 4192\n<d4a1> <d4e5> 4286\n<d4e6> <d4e6> 4318\n<d4e7> <d4fb> 4355\n<d4fc> <d4fc> 4136\n<d4fd> <d4fe> 4376\n<d5a1> <d5a4> 4378\n<d5a5> <d5a5> 5800\n<d5a6> <d5aa> 4382\n<d5ab> <d5ab> 4139\n<d5ac> <d5ad> 4387\n<d5ae> <d5ae> 4192\n<d5af> <d5fe> 4389\n<d6a1> <d6b7> 4469\n<d6b8> <d6b8> 4167\n<d6b9> <d6cc> 4492\n<d6cd> <d6cd> 4172\n<d6ce> <d6fe> 4512\n<d7a1> <d7ca> 4561\nendcidrange\n\n100 begincidrange\n<d7cb> <d7cb> 5552\n<d7cc> <d7e3> 4603\n<d7e4> <d7e4> 6424\n<d7e5> <d7fe> 4627\n<d8a1> <d8fe> 4653\n<d9a1> <d9fe> 4747\n<daa1> <dafe> 4841\n<dba1> <dbc4> 4935\n<dbc5> <dbc5> 5151\n<dbc6> <dbe3> 4971\n<dbe4> <dbe4> 4922\n<dbe5> <dbfe> 5001\n<dca1> <dca4> 5027\n<dca5> <dca5> 7518\n<dca6> <dcfe> 5031\n<dda1> <dda4> 5120\n<dda5> <dda5> 5079\n<dda6> <ddd4> 5124\n<ddd5> <ddd5> 5109\n<ddd6> <ddf3> 5171\n<ddf4> <ddf4> 7607\n<ddf5> <ddfe> 5201\n<dea1> <defb> 5211\n<defc> <defc> 5584\n<defd> <defd> 5302\n<defe> <defe> 5367\n<dfa1> <dfb2> 5303\n<dfb3> <dfb3> 7083\n<dfb4> <dfe0> 5321\n<dfe1> <dfe1> 5362\n<dfe2> <dfe7> 5366\n<dfe8> <dfe8> 5485\n<dfe9> <dffe> 5372\n<e0a1> <e0f0> 5394\n<e0f1> <e0f1> 6001\n<e0f2> <e0fe> 5474\n<e1a1> <e1ac> 5487\n<e1ad> <e1ad> 5460\n<e1ae> <e1ec> 5499\n<e1ed> <e1ed> 5317\n<e1ee> <e1fe> 5562\n<e2a1> <e2fe> 5579\n<e3a1> <e3f4> 5673\n<e3f5> <e3f5> 7009\n<e3f6> <e3fe> 5757\n<e4a1> <e4a1> 7370\n<e4a2> <e4a8> 5766\n<e4a9> <e4a9> 5678\n<e4aa> <e4fe> 5773\n<e5a1> <e5ad> 5858\n<e5ae> <e5ae> 5874\n<e5af> <e5b0> 5871\n<e5b1> <e5b2> 4425\n<e5b3> <e5b8> 5873\n<e5b9> <e5b9> 4427\n<e5ba> <e5ba> 5879\n<e5bb> <e5bc> 4429\n<e5bd> <e5c3> 5880\n<e5c4> <e5c4> 4431\n<e5c5> <e5cd> 5887\n<e5ce> <e5ce> 4435\n<e5cf> <e5cf> 5896\n<e5d0> <e5d0> 4436\n<e5d1> <e5d1> 5897\n<e5d2> <e5d2> 4437\n<e5d3> <e5d5> 5898\n<e5d6> <e5d6> 4439\n<e5d7> <e5f9> 5901\n<e5fa> <e5fb> 4442\n<e5fc> <e5fc> 4159\n<e5fd> <e5fd> 5936\n<e5fe> <e5fe> 4444\n<e6a1> <e6a1> 4447\n<e6a2> <e6a3> 5937\n<e6a4> <e6a4> 4449\n<e6a5> <e6a6> 5939\n<e6a7> <e6a7> 4450\n<e6a8> <e6ac> 5941\n<e6ad> <e6ad> 4453\n<e6ae> <e6ae> 5946\n<e6af> <e6b1> 4455\n<e6b2> <e6b2> 5947\n<e6b3> <e6b3> 4458\n<e6b4> <e6b6> 5948\n<e6b7> <e6b8> 4459\n<e6b9> <e6bb> 5951\n<e6bc> <e6bc> 4463\n<e6bd> <e6c3> 5954\n<e6c4> <e6c4> 4160\n<e6c5> <e6c5> 5961\n<e6c6> <e6c7> 4465\n<e6c8> <e6c9> 5962\n<e6ca> <e6ca> 4161\n<e6cb> <e6d1> 5964\n<e6d2> <e6d2> 4468\n<e6d3> <e6d5> 5971\n<e6d6> <e6d6> 4469\n<e6d7> <e6d8> 5974\n<e6d9> <e6d9> 4470\n<e6da> <e6db> 5976\nendcidrange\n\n100 begincidrange\n<e6dc> <e6dc> 4162\n<e6dd> <e6de> 5978\n<e6df> <e6df> 4471\n<e6e0> <e6e0> 5980\n<e6e1> <e6e1> 4472\n<e6e2> <e6e3> 5981\n<e6e4> <e6e4> 4474\n<e6e5> <e6e5> 4473\n<e6e6> <e6e6> 4475\n<e6e7> <e6e7> 5983\n<e6e8> <e6e8> 4476\n<e6e9> <e6e9> 5984\n<e6ea> <e6eb> 4478\n<e6ec> <e6ec> 6447\n<e6ed> <e6ee> 5985\n<e6ef> <e6ef> 4481\n<e6f0> <e6f0> 5987\n<e6f1> <e6f1> 4482\n<e6f2> <e6f2> 5460\n<e6f3> <e6f4> 5988\n<e6f5> <e6f5> 4483\n<e6f6> <e6f6> 4163\n<e6f7> <e6f7> 4166\n<e6f8> <e6f8> 5990\n<e6f9> <e6f9> 4485\n<e6fa> <e6fe> 5991\n<e7a1> <e7a1> 4487\n<e7a2> <e7a5> 5996\n<e7a6> <e7a6> 4488\n<e7a7> <e7a8> 6000\n<e7a9> <e7a9> 4489\n<e7aa> <e7aa> 4491\n<e7ab> <e7ab> 6002\n<e7ac> <e7ac> 4167\n<e7ad> <e7ad> 4493\n<e7ae> <e7af> 6003\n<e7b0> <e7b0> 4494\n<e7b1> <e7be> 6005\n<e7bf> <e7bf> 4495\n<e7c0> <e7c0> 6019\n<e7c1> <e7c1> 7783\n<e7c2> <e7c5> 6020\n<e7c6> <e7c6> 4497\n<e7c7> <e7c7> 4499\n<e7c8> <e7ca> 6024\n<e7cb> <e7cb> 4501\n<e7cc> <e7cc> 6027\n<e7cd> <e7cd> 4502\n<e7ce> <e7ce> 6028\n<e7cf> <e7d0> 4503\n<e7d1> <e7d2> 6029\n<e7d3> <e7d3> 4506\n<e7d4> <e7de> 6031\n<e7df> <e7df> 4508\n<e7e0> <e7e3> 6042\n<e7e4> <e7e4> 4509\n<e7e5> <e7e5> 6046\n<e7e6> <e7e6> 4510\n<e7e7> <e7f6> 6047\n<e7f7> <e7f7> 5797\n<e7f8> <e7fe> 6063\n<e8a1> <e8e6> 6070\n<e8e7> <e8e8> 4551\n<e8e9> <e8ef> 6140\n<e8f0> <e8f0> 4553\n<e8f1> <e8f1> 4180\n<e8f2> <e8f6> 6147\n<e8f7> <e8f7> 4555\n<e8f8> <e8f8> 6152\n<e8f9> <e8f9> 5800\n<e8fa> <e8fa> 6153\n<e8fb> <e8fb> 4556\n<e8fc> <e8fd> 6154\n<e8fe> <e8fe> 4557\n<e9a1> <e9a6> 6156\n<e9a7> <e9a7> 4560\n<e9a8> <e9ab> 6162\n<e9ac> <e9ac> 4561\n<e9ad> <e9cb> 6166\n<e9cc> <e9cc> 4563\n<e9cd> <e9f6> 6197\n<e9f7> <e9f7> 7988\n<e9f8> <e9fe> 6239\n<eaa1> <eac0> 6246\n<eac1> <eac1> 6123\n<eac2> <eae4> 6278\n<eae5> <eae5> 4577\n<eae6> <eaf3> 6313\n<eaf4> <eaf4> 4183\n<eaf5> <eaf6> 6327\n<eaf7> <eaf7> 4579\n<eaf8> <eafb> 6329\n<eafc> <eafc> 4581\n<eafd> <eafd> 6333\n<eafe> <eafe> 4582\n<eba1> <eba3> 6334\n<eba4> <eba4> 4584\n<eba5> <eba6> 6337\n<eba7> <eba7> 4586\n<eba8> <eba8> 6339\nendcidrange\n\n100 begincidrange\n<eba9> <eba9> 4588\n<ebaa> <ebaa> 4184\n<ebab> <ebb9> 6340\n<ebba> <ebbb> 4590\n<ebbc> <ebbc> 6355\n<ebbd> <ebbd> 4592\n<ebbe> <ebc0> 6356\n<ebc1> <ebc1> 4593\n<ebc2> <ebc2> 4595\n<ebc3> <ebc5> 6359\n<ebc6> <ebc7> 4596\n<ebc8> <ebcb> 6362\n<ebcc> <ebcc> 4599\n<ebcd> <ebce> 6366\n<ebcf> <ebd1> 4600\n<ebd2> <ebd2> 5552\n<ebd3> <ebd7> 6368\n<ebd8> <ebd8> 4603\n<ebd9> <ebfe> 6373\n<eca1> <eca5> 6411\n<eca6> <eca6> 4614\n<eca7> <eca7> 4616\n<eca8> <eca9> 6416\n<ecaa> <ecaa> 4618\n<ecab> <ecae> 6418\n<ecaf> <ecaf> 5950\n<ecb0> <ecb1> 4620\n<ecb2> <ecb2> 4187\n<ecb3> <ecb4> 6422\n<ecb5> <ecb5> 4625\n<ecb6> <ecb7> 6424\n<ecb8> <ecb8> 4627\n<ecb9> <ecb9> 6426\n<ecba> <ecba> 4629\n<ecbb> <ecbf> 6427\n<ecc0> <ecc1> 4632\n<ecc2> <ecc4> 6432\n<ecc5> <ecc5> 4634\n<ecc6> <ecc6> 4636\n<ecc7> <ecc8> 6435\n<ecc9> <ecca> 4188\n<eccb> <ecd4> 6437\n<ecd5> <ecd5> 4638\n<ecd6> <ecdc> 6447\n<ecdd> <ecde> 4640\n<ecdf> <ece0> 6454\n<ece1> <ece1> 4642\n<ece2> <ece3> 6456\n<ece4> <ece4> 4644\n<ece5> <ece6> 6458\n<ece7> <ece8> 4645\n<ece9> <ecf6> 6460\n<ecf7> <ecf8> 4647\n<ecf9> <ecf9> 6474\n<ecfa> <ecfa> 4650\n<ecfb> <ecfe> 6475\n<eda1> <eda3> 4653\n<eda4> <eded> 6479\n<edee> <edee> 5351\n<edef> <edfe> 6553\n<eea1> <eeda> 6569\n<eedb> <eedb> 6494\n<eedc> <eefe> 6627\n<efa1> <effe> 6662\n<f0a1> <f0fe> 6756\n<f1a1> <f1fe> 6850\n<f2a1> <f2bc> 6944\n<f2bd> <f2bd> 5731\n<f2be> <f2f9> 6972\n<f2fa> <f2fa> 5771\n<f2fb> <f2fe> 7032\n<f3a1> <f3b0> 7036\n<f3b1> <f3b1> 4191\n<f3b2> <f3fe> 7052\n<f4a1> <f4a6> 7129\n<f4a7> <f4a7> 6484\n<f4a8> <f4ed> 7135\n<f4ee> <f4ee> 6684\n<f4ef> <f4fe> 7205\n<f5a1> <f5fe> 7221\n<f6a1> <f6f3> 7315\n<f6f4> <f6f4> 4279\n<f6f5> <f6f5> 7398\n<f6f6> <f6f6> 7139\n<f6f7> <f6fe> 7399\n<f7a1> <f7b7> 7407\n<f7b8> <f7b8> 4247\n<f7b9> <f7c7> 7430\n<f7c8> <f7c8> 4266\n<f7c9> <f7d2> 7445\n<f7d3> <f7d3> 4340\n<f7d4> <f7fe> 7455\n<f8a1> <f8da> 7498\n<f8db> <f8db> 7572\n<f8dc> <f8ef> 7556\n<f8f0> <f8f0> 5088\n<f8f1> <f8fe> 7576\n<f9a1> <f9fe> 7590\n<faa1> <faa1> 7709\n<faa2> <faa2> 3558\nendcidrange\n\n9 begincidrange\n<faa3> <fae5> 7684\n<fae6> <fae6> 3644\n<fae7> <fafe> 7751\n<fba1> <fbfe> 7775\n<fca1> <fca8> 7869\n<fca9> <fca9> 3815\n<fcaa> <fcfe> 7877\n<fda1> <fdfe> 7962\n<fe> <ff> 99\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/KSCpc-EUC-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (KSCpc-EUC-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (KSCpc-EUC-H)\n%%BeginResource: CMap (KSCpc-EUC-V)\n%%Title: (KSCpc-EUC-V Adobe Korea1 0)\n%%Version: 9.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/KSCpc-EUC-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Korea1) def\n  /Supplement 0 def\nend def\n\n/CMapName /KSCpc-EUC-V def\n/CMapVersion 9.003 def\n/CMapType 1 def\n\n/UIDOffset 300 def\n/XUID [1 10 25405] def\n\n/WMode 1 def\n\n16 begincidrange\n<a1a2> <a1a3> 8056\n<a1a5> <a1a5> 8058\n<a1a6> <a1a6> 8320\n<a1a9> <a1ab> 8059\n<a1ad> <a1ad> 8062\n<a1b2> <a1bd> 8063\n<a1eb> <a1eb> 8075\n<a3a1> <a3a1> 8076\n<a3a8> <a3a9> 8077\n<a3ac> <a3ac> 8079\n<a3ae> <a3ae> 8080\n<a3ba> <a3bf> 8081\n<a3db> <a3db> 8087\n<a3dd> <a3dd> 8088\n<a3df> <a3df> 8089\n<a3fb> <a3fe> 8090\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/UniKS-UCS2-H",
    "content": "begincmap\n/CMapName /UniKS-UCS2-H def\n/WMode 0 def\n/UniKS-X usecmap\nbegincodespacerange\n<0000><d7ff>\n<e000><ffff>\nendcodespacerange\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/UniKS-UCS2-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap \n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniKS-UCS2-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniKS-UCS2-H)\n%%BeginResource: CMap (UniKS-UCS2-V)\n%%Title: (UniKS-UCS2-V Adobe Korea1 1)\n%%Version: 10.003\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniKS-UCS2-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Korea1) def\n  /Supplement 1 def\nend def\n\n/CMapName /UniKS-UCS2-V def\n/CMapVersion 10.003 def\n/CMapType 1 def\n\n/XUID [1 10 25407] def\n\n/WMode 1 def\n\n18 begincidrange\n<2013> <2014> 8059\n<2016> <2016> 8061\n<2025> <2025> 8058\n<3001> <3002> 8056\n<3008> <3011> 8065\n<3013> <3013> 8075\n<3014> <3015> 8063\n<ff01> <ff01> 8076\n<ff08> <ff09> 8077\n<ff0c> <ff0c> 8079\n<ff0e> <ff0e> 8080\n<ff1a> <ff1f> 8081\n<ff3b> <ff3b> 8087\n<ff3d> <ff3d> 8088\n<ff3f> <ff3f> 8089\n<ff5b> <ff5d> 8090\n<ff5e> <ff5e> 8062\n<ffe3> <ffe3> 8093\nendcidrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/UniKS-UTF16-H",
    "content": "begincmap\n/CMapName /UniKS-UTF16-H def\n/WMode 0 def\n/UniKS-X usecmap\nbegincodespacerange\n<0000><d7ff>\n<d800dc00><dbffdfff>\n<e000><ffff>\nendcodespacerange\nbegincidchar\n<a0>1\n<a9>98\n<b7>104\n<2010>97\n<20a9>96\n<2f00>6460\n<2f04>6380\n<2f06>6413\n<2f08>6443\n<2f0a>6477\n<2f0b>7499\n<2f11>4270\n<2f12>4458\n<2f14>5183\n<2f17>5772\n<2f18>5077\n<2f1c>6201\n<2f1d>3901\n<2f1f>7451\n<2f20>5255\n<2f23>5403\n<2f24>4253\n<2f25>4159\n<2f26>6488\n<2f28>7247\n<2f29>5504\n<2f2b>5697\n<2f2d>5305\n<2f2f>3791\n<2f30>4077\n<2f31>3604\n<2f32>3481\n<2f38>3964\n<2f3c>5764\n<2f3d>3804\n<2f3e>7808\n<2f3f>5580\n<2f40>6951\n<2f42>4840\n<2f43>4349\n<2f44>4027\n<2f45>4950\n<2f46>4819\n<2f47>6464\n<2f48>6125\n<2f49>6281\n<2f4a>4788\n<2f4b>8027\n<2f4c>6956\n<2f4f>4822\n<2f50>5196\n<2f51>4776\n<2f52>5774\n<2f54>5587\n<2f55>7867\n<2f56>6803\n<2f57>5129\n<2f58>7962\n<2f5a>7521\n<2f5b>5782\n<2f5c>6210\n<2f5d>3639\n<2f5e>7741\n<2f5f>6081\n<2f60>3806\n<2f61>6100\n<2f62>3521\n<2f63>5370\n<2f64>6189\n<2f65>6664\n<2f66>7610\n<2f69>4993\n<2f6a>7600\n<2f6b>4755\n<2f6c>4791\n<2f6d>4781\n<2f6e>5709\n<2f6f>5413\n<2f70>5710\n<2f72>7870\n<2f73>7755\n<2f74>4653\n<2f75>6900\n<2f76>4863\n<2f78>5132\n<2f7a>5896\n<2f7b>6218\n<2f7c>4519\n<2f7d>6427\n<2f7f>6428\n<2f80>6368\n<2f81>6357\n<2f82>5749\n<2f83>6502\n<2f84>6967\n<2f85>3930\n<2f86>5456\n<2f87>7158\n<2f88>6888\n<2f89>3496\n<2f8a>5368\n<2f8b>7232\n<2f8e>7756\n<2f8f>7709\n<2f90>6409\n<2f92>3644\n<2f93>3474\n<2f94>5921\n<2f95>3772\n<2f96>4355\n<2f97>5718\n<2f99>7512\n<2f9a>6636\n<2f9b>6892\n<2f9c>6830\n<2f9d>5755\n<2f9e>7053\n<2f9f>5756\n<2fa0>7009\n<2fa2>6389\n<2fa3>6352\n<2fa5>4634\n<2fa6>4131\n<2fa7>6568\n<2fa8>4846\n<2fa9>5147\n<2fac>6227\n<2fad>7203\n<2fae>5220\n<2faf>4744\n<2fb0>7733\n<2fb1>6307\n<2fb3>6385\n<2fb4>7757\n<2fb5>7595\n<2fb6>5221\n<2fb7>5733\n<2fb8>5625\n<2fb9>7718\n<2fba>4661\n<2fbb>3785\n<2fbc>3765\n<2fc1>3993\n<2fc2>5910\n<2fc3>6827\n<2fc4>4527\n<2fc5>4533\n<2fc6>4726\n<2fc7>4663\n<2fc8>7927\n<2fc9>5401\n<2fca>8018\n<2fcd>6758\n<2fce>3766\n<2fcf>5402\n<2fd0>5222\n<2fd1>6781\n<2fd2>7359\n<2fd3>4563\n<2fd4>3946\n<fa2e>4419\n<fa2f>4510\nendcidchar\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/UniKS-UTF16-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniKS-UTF16-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniKS-UTF16-H)\n%%BeginResource: CMap (UniKS-UTF16-V)\n%%Title: (UniKS-UTF16-V Adobe Korea1 1)\n%%Version: 1.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution. \n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission. \n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniKS-UTF16-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Korea1) def\n  /Supplement 1 def\nend def\n\n/CMapName /UniKS-UTF16-V def\n/CMapVersion 1.002 def\n/CMapType 1 def\n\n/XUID [1 10 25545] def\n\n/WMode 1 def\n\n11 begincidchar\n<2016> 8061\n<2025> 8058\n<3013> 8075\n<ff01> 8076\n<ff0c> 8079\n<ff0e> 8080\n<ff3b> 8087\n<ff3d> 8088\n<ff3f> 8089\n<ff5e> 8062\n<ffe3> 8093\nendcidchar\n\n7 begincidrange\n<2013> <2014> 8059\n<3001> <3002> 8056\n<3008> <3011> 8065\n<3014> <3015> 8063\n<ff08> <ff09> 8077\n<ff1a> <ff1f> 8081\n<ff5b> <ff5d> 8090\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/UniKS-UTF32-H",
    "content": "begincmap\n/CMapName /UniKS-UTF32-H def\n/WMode 0 def\n/UniKS-X usecmap\nbegincodespacerange\n<00000000><0010ffff>\nendcodespacerange\nbegincidchar\n<a0>1\n<a9>98\n<b7>104\n<2010>97\n<20a9>96\n<2f00>6460\n<2f04>6380\n<2f06>6413\n<2f08>6443\n<2f0a>6477\n<2f0b>7499\n<2f11>4270\n<2f12>4458\n<2f14>5183\n<2f17>5772\n<2f18>5077\n<2f1c>6201\n<2f1d>3901\n<2f1f>7451\n<2f20>5255\n<2f23>5403\n<2f24>4253\n<2f25>4159\n<2f26>6488\n<2f28>7247\n<2f29>5504\n<2f2b>5697\n<2f2d>5305\n<2f2f>3791\n<2f30>4077\n<2f31>3604\n<2f32>3481\n<2f38>3964\n<2f3c>5764\n<2f3d>3804\n<2f3e>7808\n<2f3f>5580\n<2f40>6951\n<2f42>4840\n<2f43>4349\n<2f44>4027\n<2f45>4950\n<2f46>4819\n<2f47>6464\n<2f48>6125\n<2f49>6281\n<2f4a>4788\n<2f4b>8027\n<2f4c>6956\n<2f4f>4822\n<2f50>5196\n<2f51>4776\n<2f52>5774\n<2f54>5587\n<2f55>7867\n<2f56>6803\n<2f57>5129\n<2f58>7962\n<2f5a>7521\n<2f5b>5782\n<2f5c>6210\n<2f5d>3639\n<2f5e>7741\n<2f5f>6081\n<2f60>3806\n<2f61>6100\n<2f62>3521\n<2f63>5370\n<2f64>6189\n<2f65>6664\n<2f66>7610\n<2f69>4993\n<2f6a>7600\n<2f6b>4755\n<2f6c>4791\n<2f6d>4781\n<2f6e>5709\n<2f6f>5413\n<2f70>5710\n<2f72>7870\n<2f73>7755\n<2f74>4653\n<2f75>6900\n<2f76>4863\n<2f78>5132\n<2f7a>5896\n<2f7b>6218\n<2f7c>4519\n<2f7d>6427\n<2f7f>6428\n<2f80>6368\n<2f81>6357\n<2f82>5749\n<2f83>6502\n<2f84>6967\n<2f85>3930\n<2f86>5456\n<2f87>7158\n<2f88>6888\n<2f89>3496\n<2f8a>5368\n<2f8b>7232\n<2f8e>7756\n<2f8f>7709\n<2f90>6409\n<2f92>3644\n<2f93>3474\n<2f94>5921\n<2f95>3772\n<2f96>4355\n<2f97>5718\n<2f99>7512\n<2f9a>6636\n<2f9b>6892\n<2f9c>6830\n<2f9d>5755\n<2f9e>7053\n<2f9f>5756\n<2fa0>7009\n<2fa2>6389\n<2fa3>6352\n<2fa5>4634\n<2fa6>4131\n<2fa7>6568\n<2fa8>4846\n<2fa9>5147\n<2fac>6227\n<2fad>7203\n<2fae>5220\n<2faf>4744\n<2fb0>7733\n<2fb1>6307\n<2fb3>6385\n<2fb4>7757\n<2fb5>7595\n<2fb6>5221\n<2fb7>5733\n<2fb8>5625\n<2fb9>7718\n<2fba>4661\n<2fbb>3785\n<2fbc>3765\n<2fc1>3993\n<2fc2>5910\n<2fc3>6827\n<2fc4>4527\n<2fc5>4533\n<2fc6>4726\n<2fc7>4663\n<2fc8>7927\n<2fc9>5401\n<2fca>8018\n<2fcd>6758\n<2fce>3766\n<2fcf>5402\n<2fd0>5222\n<2fd1>6781\n<2fd2>7359\n<2fd3>4563\n<2fd4>3946\n<fa2e>4419\n<fa2f>4510\nendcidchar\nendcmap\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/UniKS-UTF32-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniKS-UTF32-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniKS-UTF32-H)\n%%BeginResource: CMap (UniKS-UTF32-V)\n%%Title: (UniKS-UTF32-V Adobe Korea1 1)\n%%Version: 1.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution.\n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission.\n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniKS-UTF32-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Korea1) def\n  /Supplement 1 def\nend def\n\n/CMapName /UniKS-UTF32-V def\n/CMapVersion 1.002 def\n/CMapType 1 def\n\n/XUID [1 10 25543] def\n\n/WMode 1 def\n\n11 begincidchar\n<00002016> 8061\n<00002025> 8058\n<00003013> 8075\n<0000ff01> 8076\n<0000ff0c> 8079\n<0000ff0e> 8080\n<0000ff3b> 8087\n<0000ff3d> 8088\n<0000ff3f> 8089\n<0000ff5e> 8062\n<0000ffe3> 8093\nendcidchar\n\n7 begincidrange\n<00002013> <00002014> 8059\n<00003001> <00003002> 8056\n<00003008> <00003011> 8065\n<00003014> <00003015> 8063\n<0000ff08> <0000ff09> 8077\n<0000ff1a> <0000ff1f> 8081\n<0000ff5b> <0000ff5d> 8090\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/UniKS-UTF8-H",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%IncludeResource: ProcSet (CIDInit)\n%%BeginResource: CMap (UniKS-UTF8-H)\n%%Title: (UniKS-UTF8-H Adobe Korea1 1)\n%%Version: 11.005\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2012 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution.\n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission.\n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Korea1) def\n  /Supplement 1 def\nend def\n\n/CMapName /UniKS-UTF8-H def\n/CMapVersion 11.005 def\n/CMapType 1 def\n\n/XUID [1 10 25414] def\n\n/WMode 0 def\n\n4 begincodespacerange\n  <00>       <7F>\n  <C080>     <DFBF>\n  <E08080>   <EFBFBF>\n  <F0808080> <F7BFBFBF>\nendcodespacerange\n\n1 beginnotdefrange\n<00> <1f> 1\nendnotdefrange\n\n100 begincidchar\n<c2a0> 1\n<c2a1> 208\n<c2a4> 214\n<c2a7> 155\n<c2a8> 107\n<c2a9> 98\n<c2aa> 668\n<c2ab> 176\n<c2b0> 138\n<c2b1> 130\n<c2b4> 199\n<c2b6> 244\n<c2b7> 104\n<c2b8> 206\n<c2b9> 842\n<c2ba> 675\n<c2bb> 177\n<c2bc> 751\n<c2bd> 748\n<c2be> 752\n<c2bf> 209\n<c386> 666\n<c390> 667\n<c397> 131\n<c398> 673\n<c39e> 676\n<c39f> 768\n<c3a6> 757\n<c3b0> 759\n<c3b7> 132\n<c3b8> 766\n<c3be> 769\n<c491> 758\n<c4a6> 669\n<c4a7> 760\n<c4b1> 761\n<c4b2> 670\n<c4b3> 762\n<c4b8> 763\n<c4bf> 671\n<c580> 764\n<c581> 672\n<c582> 765\n<c589> 772\n<c58a> 678\n<c58b> 771\n<c592> 674\n<c593> 767\n<c5a6> 677\n<c5a7> 770\n<cabc> 8275\n<cb87> 201\n<cb98> 202\n<cb99> 205\n<cb9a> 204\n<cb9b> 207\n<cb9c> 200\n<cb9d> 203\n<d081> 1026\n<d191> 1059\n<e28090> 97\n<e28096> 111\n<e2809b> 8238\n<e2809f> 8237\n<e280a2> 8607\n<e280b0> 216\n<e280b4> 8582\n<e280b5> 9326\n<e280b6> 9324\n<e280bb> 156\n<e280bc> 8763\n<e28182> 8599\n<e281b4> 845\n<e281bc> 8248\n<e281bf> 846\n<e282a9> 96\n<e28483> 141\n<e28489> 215\n<e28493> 590\n<e28496> 258\n<e284a1> 263\n<e284a2> 260\n<e284a6> 643\n<e284ab> 142\n<e28692> 170\n<e28695> 247\n<e28696> 250\n<e28697> 248\n<e28698> 251\n<e28699> 249\n<e286b0> 8868\n<e286b1> 8865\n<e286b2> 8864\n<e286b3> 8869\n<e286b4> 8867\n<e286bc> 8884\n<e28780> 8885\n<e2878d> 8816\n<e2878f> 8815\n<e28790> 8814\nendcidchar\n\n100 begincidchar\n<e28791> 8854\n<e28792> 195\n<e28793> 8855\n<e28794> 196\n<e287a0> 9190\n<e287a1> 9192\n<e287a2> 9191\n<e287a3> 9193\n<e287a6> 9198\n<e287a7> 9200\n<e287a8> 9199\n<e287a9> 9201\n<e28880> 197\n<e28882> 151\n<e28883> 198\n<e28886> 8715\n<e28887> 152\n<e28888> 184\n<e28889> 8749\n<e2888b> 185\n<e2888c> 8750\n<e2888f> 213\n<e28891> 212\n<e28893> 8726\n<e2889a> 178\n<e2889d> 180\n<e2889e> 136\n<e2889f> 8717\n<e288a0> 148\n<e288a2> 8738\n<e288a9> 191\n<e288aa> 190\n<e288ae> 211\n<e288b4> 137\n<e288b5> 181\n<e288b6> 210\n<e288b7> 8321\n<e288bd> 179\n<e28983> 8500\n<e28985> 8499\n<e28988> 8501\n<e28990> 8739\n<e28991> 8723\n<e28992> 154\n<e28993> 8722\n<e2899a> 8753\n<e289a0> 133\n<e289a1> 153\n<e289a2> 8734\n<e289b9> 8491\n<e28a84> 8748\n<e28a85> 8747\n<e28a8a> 8486\n<e28a8b> 8488\n<e28aa3> 8742\n<e28aa4> 8503\n<e28aa5> 149\n<e28bae> 8320\n<e28baf> 106\n<e28c86> 8754\n<e28c92> 150\n<e28c94> 8731\n<e29480> 519\n<e29481> 530\n<e29482> 520\n<e29483> 531\n<e2948c> 521\n<e2948d> 558\n<e2948e> 557\n<e2948f> 532\n<e29490> 522\n<e29491> 552\n<e29492> 551\n<e29493> 533\n<e29494> 524\n<e29495> 556\n<e29496> 555\n<e29497> 535\n<e29498> 523\n<e29499> 554\n<e2949a> 553\n<e2949b> 534\n<e2949c> 525\n<e2949d> 546\n<e294a0> 541\n<e294a3> 536\n<e294a4> 527\n<e294a5> 548\n<e294a8> 543\n<e294ab> 538\n<e294ac> 526\n<e294af> 542\n<e294b0> 547\n<e294b3> 537\n<e294b4> 528\n<e294b7> 544\n<e294b8> 549\n<e294bb> 539\n<e294bc> 529\n<e294bf> 545\nendcidchar\n\n100 begincidchar\n<e29582> 550\n<e2958b> 540\n<e29692> 232\n<e296a0> 165\n<e296a1> 164\n<e296a3> 229\n<e296a6> 237\n<e296a7> 236\n<e296a8> 235\n<e296a9> 238\n<e296b1> 8736\n<e296b2> 167\n<e296b3> 166\n<e296b5> 8780\n<e296b6> 220\n<e296b7> 219\n<e296b9> 8781\n<e296bc> 169\n<e296bd> 168\n<e296bf> 8779\n<e29780> 218\n<e29781> 217\n<e29783> 8782\n<e29786> 163\n<e29787> 162\n<e29788> 228\n<e29789> 227\n<e2978a> 8787\n<e2978b> 159\n<e2978c> 8639\n<e2978e> 161\n<e2978f> 160\n<e297a6> 8775\n<e297af> 8633\n<e29885> 158\n<e29886> 157\n<e2988e> 241\n<e2988f> 240\n<e2989c> 242\n<e2989d> 9222\n<e2989e> 243\n<e2989f> 9223\n<e298af> 8664\n<e29980> 147\n<e29982> 146\n<e299a3> 226\n<e299a4> 221\n<e299a5> 224\n<e299a7> 225\n<e299a8> 239\n<e299ac> 255\n<e299ad> 252\n<e299af> 8594\n<e29c96> 8631\n<e29c9a> 8630\n<e29cbd> 8604\n<e29d96> 8637\n<e2bc80> 6460\n<e2bc84> 6380\n<e2bc86> 6413\n<e2bc88> 6443\n<e2bc8a> 6477\n<e2bc8b> 7499\n<e2bc91> 4270\n<e2bc92> 4458\n<e2bc94> 5183\n<e2bc97> 5772\n<e2bc98> 5077\n<e2bc9c> 6201\n<e2bc9d> 3901\n<e2bc9f> 7451\n<e2bca0> 5255\n<e2bca3> 5403\n<e2bca4> 4253\n<e2bca5> 4159\n<e2bca6> 6488\n<e2bca8> 7247\n<e2bca9> 5504\n<e2bcab> 5697\n<e2bcad> 5305\n<e2bcaf> 3791\n<e2bcb0> 4077\n<e2bcb1> 3604\n<e2bcb2> 3481\n<e2bcb8> 3964\n<e2bcbc> 5764\n<e2bcbd> 3804\n<e2bcbe> 7808\n<e2bcbf> 5580\n<e2bd80> 6951\n<e2bd82> 4840\n<e2bd83> 4349\n<e2bd84> 4027\n<e2bd85> 4950\n<e2bd86> 4819\n<e2bd87> 6464\n<e2bd88> 6125\n<e2bd89> 6281\n<e2bd8a> 4788\n<e2bd8b> 8027\nendcidchar\n\n100 begincidchar\n<e2bd8c> 6956\n<e2bd8f> 4822\n<e2bd90> 5196\n<e2bd91> 4776\n<e2bd92> 5774\n<e2bd94> 5587\n<e2bd95> 7867\n<e2bd96> 6803\n<e2bd97> 5129\n<e2bd98> 7962\n<e2bd9a> 7521\n<e2bd9b> 5782\n<e2bd9c> 6210\n<e2bd9d> 3639\n<e2bd9e> 7741\n<e2bd9f> 6081\n<e2bda0> 3806\n<e2bda1> 6100\n<e2bda2> 3521\n<e2bda3> 5370\n<e2bda4> 6189\n<e2bda5> 6664\n<e2bda6> 7610\n<e2bda9> 4993\n<e2bdaa> 7600\n<e2bdab> 4755\n<e2bdac> 4791\n<e2bdad> 4781\n<e2bdae> 5709\n<e2bdaf> 5413\n<e2bdb0> 5710\n<e2bdb2> 7870\n<e2bdb3> 7755\n<e2bdb4> 4653\n<e2bdb5> 6900\n<e2bdb6> 4863\n<e2bdb8> 5132\n<e2bdba> 5896\n<e2bdbb> 6218\n<e2bdbc> 4519\n<e2bdbd> 6427\n<e2bdbf> 6428\n<e2be80> 6368\n<e2be81> 6357\n<e2be82> 5749\n<e2be83> 6502\n<e2be84> 6967\n<e2be85> 3930\n<e2be86> 5456\n<e2be87> 7158\n<e2be88> 6888\n<e2be89> 3496\n<e2be8a> 5368\n<e2be8b> 7232\n<e2be8e> 7756\n<e2be8f> 7709\n<e2be90> 6409\n<e2be92> 3644\n<e2be93> 3474\n<e2be94> 5921\n<e2be95> 3772\n<e2be96> 4355\n<e2be97> 5718\n<e2be99> 7512\n<e2be9a> 6636\n<e2be9b> 6892\n<e2be9c> 6830\n<e2be9d> 5755\n<e2be9e> 7053\n<e2be9f> 5756\n<e2bea0> 7009\n<e2bea2> 6389\n<e2bea3> 6352\n<e2bea5> 4634\n<e2bea6> 4131\n<e2bea7> 6568\n<e2bea8> 4846\n<e2bea9> 5147\n<e2beac> 6227\n<e2bead> 7203\n<e2beae> 5220\n<e2beaf> 4744\n<e2beb0> 7733\n<e2beb1> 6307\n<e2beb3> 6385\n<e2beb4> 7757\n<e2beb5> 7595\n<e2beb6> 5221\n<e2beb7> 5733\n<e2beb8> 5625\n<e2beb9> 7718\n<e2beba> 4661\n<e2bebb> 3785\n<e2bebc> 3765\n<e2bf81> 3993\n<e2bf82> 5910\n<e2bf83> 6827\n<e2bf84> 4527\n<e2bf85> 4533\n<e2bf86> 4726\nendcidchar\n\n100 begincidchar\n<e2bf87> 4663\n<e2bf88> 7927\n<e2bf89> 5401\n<e2bf8a> 8018\n<e2bf8d> 6758\n<e2bf8e> 3766\n<e2bf8f> 5402\n<e2bf90> 5222\n<e2bf91> 6781\n<e2bf92> 7359\n<e2bf93> 4563\n<e2bf94> 3946\n<e38083> 108\n<e38092> 8700\n<e38093> 175\n<e380a0> 8671\n<e380b6> 8701\n<e383bb> 104\n<e383bc> 9330\n<e385a4> 101\n<e3889c> 257\n<e388b1> 8788\n<e388b9> 8789\n<e389bf> 256\n<e38a90> 9300\n<e38a94> 9080\n<e38a9e> 8761\n<e38aa5> 9096\n<e38e98> 591\n<e38f82> 261\n<e38f83> 662\n<e38f84> 592\n<e38f85> 650\n<e38f86> 665\n<e38f87> 259\n<e38f88> 614\n<e38f89> 663\n<e38f8a> 607\n<e38f8b> 8790\n<e38f8f> 611\n<e38f90> 660\n<e38f93> 661\n<e38f96> 649\n<e38f98> 262\n<e38f9b> 654\n<e38f9c> 664\n<e38f9d> 659\n<e4b880> 6460\n<e4b881> 6704\n<e4b883> 7364\n<e4b887> 4670\n<e4b888> 6534\n<e4b889> 5320\n<e4b88a> 5331\n<e4b88b> 7616\n<e4b88d> 5109\n<e4b891> 7288\n<e4b894> 7041\n<e4b895> 5181\n<e4b896> 5492\n<e4b898> 3893\n<e4b899> 5041\n<e4b89e> 5682\n<e4b8ad> 6922\n<e4b8b2> 3802\n<e4b8b8> 7882\n<e4b8b9> 4192\n<e4b8bb> 6860\n<e4b982> 6029\n<e4b983> 4154\n<e4b985> 3894\n<e4b98b> 6942\n<e4b98d> 5241\n<e4b98e> 7800\n<e4b98f> 7614\n<e4b996> 3855\n<e4b998> 5683\n<e4b999> 6380\n<e4b99d> 3895\n<e4b99e> 3613\n<e4b99f> 5862\n<e4b9ab> 3500\n<e4b9ad> 4329\n<e4b9b3> 6309\n<e4b9b6> 5092\n<e4b9b7> 5315\n<e4b9be> 3601\n<e4ba82> 4389\n<e4ba86> 4551\n<e4ba88> 5934\n<e4ba8b> 5242\n<e4ba8c> 6413\n<e4ba8e> 6197\n<e4ba90> 6252\n<e4ba91> 6238\n<e4ba92> 7801\n<e4ba94> 6049\n<e4ba95> 6705\n<e4ba98> 4058\n<e4ba9b> 5243\nendcidchar\n\n100 begincidchar\n<e4ba9e> 5775\n<e4baa1> 4696\n<e4baa2> 7670\n<e4baa4> 3868\n<e4baa5> 7685\n<e4baa6> 5947\n<e4baa8> 7771\n<e4baab> 7710\n<e4baac> 3660\n<e4baad> 6706\n<e4baae> 4427\n<e4bab6> 4193\n<e4baba> 6443\n<e4bb80> 5771\n<e4bb81> 6444\n<e4bb84> 7331\n<e4bb87> 3896\n<e4bb8a> 4038\n<e4bb8b> 3560\n<e4bb8d> 6479\n<e4bb94> 6483\n<e4bb95> 5244\n<e4bb96> 7380\n<e4bb97> 6535\n<e4bb98> 5110\n<e4bb99> 5418\n<e4bb9d> 4331\n<e4bb9f> 7148\n<e4bba3> 4250\n<e4bba4> 4489\n<e4bba5> 6414\n<e4bbb0> 5833\n<e4bbb2> 6923\n<e4bbb6> 3602\n<e4bbb7> 3561\n<e4bbbb> 6469\n<e4bc81> 4062\n<e4bc89> 7671\n<e4bc8a> 6415\n<e4bc8b> 4051\n<e4bc8d> 6050\n<e4bc8e> 4063\n<e4bc8f> 5074\n<e4bc90> 5005\n<e4bc91> 8005\n<e4bcaf> 4988\n<e4bcb4> 4905\n<e4bcb6> 4490\n<e4bcb8> 5735\n<e4bcba> 5245\n<e4bcbc> 5246\n<e4bcbd> 3436\n<e4bd83> 6643\n<e4bd86> 4194\n<e4bd87> 6591\n<e4bd88> 7544\n<e4bd8d> 6284\n<e4bd8e> 6592\n<e4bd8f> 6861\n<e4bd90> 6854\n<e4bd91> 6198\n<e4bd95> 7617\n<e4bd99> 5935\n<e4bd9a> 6461\n<e4bd9b> 5171\n<e4bd9c> 6509\n<e4bda9> 7502\n<e4bdaf> 5879\n<e4bdb0> 4989\n<e4bdb3> 3437\n<e4bdb6> 4127\n<e4bdba> 6644\n<e4bdbe> 6462\n<e4bdbf> 5247\n<e4be81> 5736\n<e4be83> 3476\n<e4be84> 7015\n<e4be86> 4420\n<e4be88> 7336\n<e4be8a> 3839\n<e4be8b> 4506\n<e4be8d> 5692\n<e4be8f> 6862\n<e4be91> 6310\n<e4be96> 4594\n<e4be98> 7042\n<e4be9b> 3786\n<e4be9d> 6394\n<e4beae> 4764\n<e4beaf> 7966\n<e4beb5> 7367\n<e4beb6> 4440\n<e4bebf> 7518\n<e4bf82> 3705\n<e4bf83> 7241\n<e4bf84> 5776\n<e4bf89> 6051\n<e4bf8a> 6902\n<e4bf8e> 6782\n<e4bf91> 6174\nendcidchar\n\n100 begincidchar\n<e4bf93> 3661\n<e4bf94> 7734\n<e4bf97> 5537\n<e4bf9a> 4613\n<e4bf9d> 5058\n<e4bf9f> 5248\n<e4bfa0> 7759\n<e4bfa1> 5737\n<e4bfae> 5567\n<e4bfaf> 5111\n<e4bfb1> 3897\n<e4bfb3> 4970\n<e4bfb5> 7576\n<e4bfb8> 5093\n<e4bfba> 5925\n<e58082> 5042\n<e58086> 4428\n<e58089> 7092\n<e5808b> 3562\n<e5808d> 4969\n<e58091> 4836\n<e58092> 4269\n<e58096> 7705\n<e58099> 7967\n<e5809a> 6395\n<e5809c> 7134\n<e5809e> 3662\n<e5809f> 7043\n<e580a1> 7093\n<e580a3> 4941\n<e580a4> 7337\n<e580a6> 3969\n<e580a7> 6837\n<e580a8> 3585\n<e580aa> 6030\n<e580ab> 4595\n<e580ac> 7394\n<e580ad> 6131\n<e580bb> 5863\n<e58183> 5917\n<e58187> 3438\n<e58188> 3627\n<e58189> 6285\n<e5818f> 7519\n<e58195> 7686\n<e5819a> 6863\n<e5819c> 6707\n<e581a5> 3603\n<e581b4> 7330\n<e581b5> 6708\n<e581b6> 6199\n<e581b8> 7465\n<e58280> 3856\n<e58285> 5112\n<e5828d> 4942\n<e58291> 3614\n<e58298> 5303\n<e58299> 5182\n<e582ac> 7262\n<e582ad> 6175\n<e582b2> 6052\n<e582b3> 6645\n<e582b5> 7114\n<e582b7> 5332\n<e582be> 3663\n<e58385> 4023\n<e58389> 7177\n<e5838a> 5419\n<e5838f> 5333\n<e58391> 3869\n<e58395> 5075\n<e58396> 8035\n<e5839a> 4552\n<e5839e> 6286\n<e583a5> 6140\n<e583a7> 5684\n<e583ad> 7082\n<e583b9> 3439\n<e583bb> 5020\n<e583bf> 5249\n<e58480> 6396\n<e58481> 6903\n<e58484> 5912\n<e58486> 3664\n<e58489> 3617\n<e58492> 6311\n<e5849f> 5334\n<e584a1> 4543\n<e584aa> 6200\n<e584b2> 6593\n<e584b7> 4441\n<e584ba> 4133\n<e584bc> 5926\n<e58580> 6089\n<e58581> 6359\n<e58583> 6255\n<e58584> 7772\n<e58585> 7306\n<e58586> 6783\n<e58587> 8013\nendcidchar\n\n100 begincidchar\n<e58588> 5420\n<e58589> 3840\n<e5858b> 4016\n<e5858c> 7431\n<e5858d> 4735\n<e5858e> 7449\n<e58592> 5777\n<e5859c> 4348\n<e585a2> 4059\n<e585a5> 6477\n<e585a7> 4155\n<e585a8> 6646\n<e585a9> 4429\n<e585aa> 6312\n<e585ab> 7499\n<e585ac> 3787\n<e585ad> 4591\n<e585ae> 7791\n<e585b1> 3788\n<e585b5> 5043\n<e585b6> 4064\n<e585b7> 3898\n<e585b8> 6647\n<e585bc> 3654\n<e58680> 4065\n<e58686> 5933\n<e5868a> 7126\n<e5868d> 6570\n<e58692> 4765\n<e58695> 4736\n<e58697> 6176\n<e586a0> 3819\n<e586a5> 4748\n<e586aa> 4733\n<e586ac> 4332\n<e586b6> 5864\n<e586b7> 4424\n<e586bd> 4477\n<e58784> 7130\n<e58786> 6904\n<e58789> 4430\n<e5878b> 6784\n<e5878c> 4607\n<e5878d> 4333\n<e5879c> 4606\n<e5879d> 6390\n<e5879e> 8036\n<e587a1> 5009\n<e587b0> 7904\n<e587b1> 3563\n<e587b6> 8014\n<e587b8> 7167\n<e587b9> 6141\n<e587ba> 7303\n<e587bd> 7651\n<e58880> 4270\n<e58883> 6445\n<e58886> 5152\n<e58887> 6684\n<e58888> 6031\n<e5888a> 3477\n<e5888e> 4837\n<e58891> 7773\n<e58897> 4478\n<e5889d> 7214\n<e588a4> 7490\n<e588a5> 5037\n<e588a9> 4614\n<e588aa> 5304\n<e588ae> 3835\n<e588b0> 4271\n<e588b6> 6759\n<e588b7> 5561\n<e588b8> 3970\n<e588b9> 7077\n<e588ba> 6484\n<e588bb> 3465\n<e58983> 7205\n<e58987> 7360\n<e5898a> 5301\n<e5898b> 4017\n<e5898c> 4397\n<e5898d> 6648\n<e58994> 7135\n<e58996> 5113\n<e5899b> 3536\n<e5899d> 4886\n<e589a1> 5463\n<e589a9> 6480\n<e589aa> 6649\n<e589af> 5114\n<e589b2> 7649\n<e589b5> 7094\n<e589bd> 7577\n<e589bf> 7215\n<e58a83> 7948\n<e58a87> 4018\n<e58a88> 5021\n<e58a89> 4577\n<e58a8d> 3618\nendcidchar\n\n100 begincidchar\n<e58a91> 6760\n<e58a92> 3619\n<e58a9b> 4458\n<e58a9f> 3789\n<e58aa0> 3440\n<e58aa3> 4479\n<e58aa4> 4024\n<e58aa9> 6785\n<e58aaa> 4169\n<e58aab> 3624\n<e58abe> 7703\n<e58b81> 3665\n<e58b83> 4930\n<e58b85> 7361\n<e58b87> 6177\n<e58b89> 4737\n<e58b8d> 3666\n<e58b92> 4604\n<e58b95> 4334\n<e58b96> 6229\n<e58b98> 3510\n<e58b99> 4812\n<e58b9b> 7979\n<e58b9d> 5685\n<e58b9e> 4511\n<e58b9f> 4766\n<e58ba2> 5493\n<e58ba3> 6619\n<e58ba4> 4025\n<e58bb3> 7980\n<e58bb5> 4442\n<e58bb8> 3971\n<e58bba> 6510\n<e58bbb> 4009\n<e58bbe> 3899\n<e58bbf> 4848\n<e58c85> 7545\n<e58c88> 8015\n<e58c8d> 7546\n<e58c8f> 7547\n<e58c90> 5076\n<e58c95> 5183\n<e58c96> 7863\n<e58c97> 5151\n<e58c99> 5693\n<e58ca0> 6536\n<e58ca1> 3841\n<e58ca3> 3530\n<e58caa> 5184\n<e58caf> 7928\n<e58cb9> 7604\n<e58cbf> 4188\n<e58d80> 3900\n<e58d81> 5772\n<e58d83> 7149\n<e58d84> 6478\n<e58d87> 5686\n<e58d88> 6053\n<e58d89> 7994\n<e58d8a> 4906\n<e58d8d> 4671\n<e58d91> 5185\n<e58d92> 6834\n<e58d93> 7395\n<e58d94> 7760\n<e58d97> 4145\n<e58d9a> 4887\n<e58d9c> 5077\n<e58d9e> 5031\n<e58da0> 6692\n<e58da6> 3852\n<e58da8> 5450\n<e58daf> 4800\n<e58db0> 6446\n<e58db1> 6287\n<e58db4> 3466\n<e58db5> 4390\n<e58db7> 3972\n<e58dbd> 6926\n<e58dbf> 3667\n<e58e84> 5851\n<e58e93> 5840\n<e58e98> 4615\n<e58e9a> 7968\n<e58e9f> 6256\n<e58ea0> 7332\n<e58ea5> 3979\n<e58ea6> 7618\n<e58ead> 5989\n<e58ebb> 3586\n<e58f83> 7083\n<e58f88> 6201\n<e58f89> 7044\n<e58f8a> 4052\n<e58f8b> 6202\n<e58f8d> 4907\n<e58f94> 5628\n<e58f96> 7316\n<e58f97> 5568\n<e58f9b> 4908\nendcidchar\n\n100 begincidchar\n<e58fa1> 6032\n<e58fa2> 7251\n<e58fa3> 3901\n<e58fa4> 3729\n<e58fa5> 3902\n<e58fa9> 3730\n<e58faa> 6943\n<e58fab> 3994\n<e58fac> 5500\n<e58fad> 7500\n<e58faf> 3441\n<e58fb0> 7432\n<e58fb1> 7016\n<e58fb2> 5250\n<e58fb3> 6203\n<e58fb8> 5251\n<e59083> 8023\n<e59084> 3467\n<e59088> 7663\n<e59089> 4128\n<e5908a> 6620\n<e5908c> 4335\n<e5908d> 4749\n<e5908e> 7969\n<e5908f> 4616\n<e59090> 7450\n<e59091> 7711\n<e5909b> 3953\n<e5909d> 4638\n<e5909f> 6381\n<e590a0> 7534\n<e590a6> 5115\n<e590a9> 5153\n<e590ab> 7652\n<e590b3> 6055\n<e590b8> 8030\n<e590b9> 7317\n<e590bb> 4838\n<e590bc> 7970\n<e590be> 6054\n<e59182> 4443\n<e59188> 6709\n<e5918a> 3731\n<e59191> 7408\n<e591a8> 6867\n<e591aa> 6866\n<e591b1> 3732\n<e591b3> 4851\n<e591b5> 3442\n<e591bb> 5738\n<e591bc> 7802\n<e591bd> 4750\n<e59280> 6594\n<e59286> 7548\n<e5928c> 7864\n<e5928e> 3903\n<e59290> 5116\n<e592a4> 7381\n<e592a8> 6485\n<e592ab> 6944\n<e592ac> 3870\n<e592b3> 7687\n<e592b8> 7653\n<e592bd> 6447\n<e59380> 5841\n<e59381> 7590\n<e59384> 7853\n<e59388> 7664\n<e59389> 6571\n<e593a1> 6257\n<e593a5> 3443\n<e593a8> 7216\n<e593ad> 3767\n<e593ae> 7953\n<e593b2> 7168\n<e593ba> 7549\n<e59484> 7503\n<e59486> 5252\n<e59487> 6980\n<e5948e> 4617\n<e59490> 4239\n<e5949c> 4689\n<e594af> 6313\n<e594b1> 7095\n<e594b5> 5821\n<e594be> 7382\n<e59584> 7396\n<e59586> 5335\n<e5958f> 4839\n<e59593> 3706\n<e59596> 4217\n<e5959e> 5778\n<e595a3> 7654\n<e595bc> 6761\n<e59680> 3579\n<e59684> 5421\n<e59686> 7169\n<e59687> 4374\n<e59689> 7971\n<e5968a> 7655\nendcidchar\n\n100 begincidchar\n<e59698> 7150\n<e59699> 7995\n<e5969a> 7883\n<e5969c> 8037\n<e5969d> 3501\n<e596a7> 7990\n<e596a9> 6314\n<e596aa> 5336\n<e596ab> 4132\n<e596ac> 3871\n<e596ae> 4195\n<e59785> 7972\n<e59787> 5365\n<e59794> 6981\n<e5979a> 6056\n<e5979c> 4066\n<e5979f> 7045\n<e597a3> 5253\n<e597a4> 7338\n<e597bd> 5569\n<e597be> 6868\n<e59886> 7409\n<e59889> 3444\n<e59894> 3904\n<e59897> 5337\n<e598af> 5501\n<e598b2> 6786\n<e598b4> 7318\n<e598b6> 5694\n<e59993> 7719\n<e599a8> 4067\n<e599ab> 8038\n<e599b4> 5154\n<e59a86> 7954\n<e59aa5> 5956\n<e59aac> 5223\n<e59aae> 7712\n<e59ab4> 5927\n<e59abc> 6511\n<e59b8a> 4152\n<e59b8d> 8039\n<e59b91> 7242\n<e59b9a> 5570\n<e59b9b> 5254\n<e59b9e> 7929\n<e59ba0> 6448\n<e59bb0> 3774\n<e59bb9> 4491\n<e59bba> 3733\n<e59c83> 7550\n<e59c84> 5902\n<e59c88> 3973\n<e59c8b> 3947\n<e59c8d> 6288\n<e59c92> 6259\n<e59c93> 6258\n<e59c96> 4272\n<e59c98> 4196\n<e59c9f> 7451\n<e59ca8> 6572\n<e59cad> 3995\n<e59cb0> 6945\n<e59cbb> 4068\n<e59d80> 6946\n<e59d82> 7491\n<e59d87> 4010\n<e59d8a> 4943\n<e59d8d> 4218\n<e59d8e> 3511\n<e59d90> 6855\n<e59d91> 3581\n<e59da1> 7474\n<e59da4> 3775\n<e59da6> 7410\n<e59daa> 7529\n<e59dae> 4252\n<e59db0> 3668\n<e59db5> 3905\n<e59dbc> 7397\n<e59e82> 5571\n<e59e88> 4251\n<e59e8b> 7774\n<e59e93> 7688\n<e59ea0> 6373\n<e59ea2> 3906\n<e59ea3> 6260\n<e59f83> 5842\n<e59f87> 6178\n<e59f88> 6905\n<e59f8b> 4708\n<e59f8e> 5474\n<e59f9f> 5948\n<e59fa0> 5117\n<e59fb0> 7115\n<e59fb4> 5720\n<e59fb7> 7032\n<e59fb9> 4971\n<e59fba> 4069\n<e59fbc> 4070\n<e5a080> 3959\nendcidchar\n\n100 begincidchar\n<e5a082> 4240\n<e5a085> 3637\n<e5a086> 7459\n<e5a088> 3537\n<e5a089> 6355\n<e5a08a> 5793\n<e5a09e> 7187\n<e5a0a1> 5059\n<e5a0a4> 6762\n<e5a0a7> 5957\n<e5a0aa> 3512\n<e5a0af> 6142\n<e5a0b0> 5918\n<e5a0b1> 5060\n<e5a0b4> 6537\n<e5a0b5> 4273\n<e5a0ba> 3707\n<e5a18a> 3857\n<e5a18b> 6002\n<e5a18f> 3564\n<e5a191> 5502\n<e5a194> 7424\n<e5a197> 4274\n<e5a198> 4241\n<e5a19a> 7252\n<e5a19e> 5362\n<e5a1a1> 6650\n<e5a1a2> 6057\n<e5a1a4> 7981\n<e5a1b5> 6982\n<e5a1b9> 7084\n<e5a1bc> 6651\n<e5a1be> 5629\n<e5a283> 3669\n<e5a285> 5373\n<e5a289> 6179\n<e5a293> 4801\n<e5a29c> 7265\n<e5a29e> 6931\n<e5a29f> 7720\n<e5a2a8> 4834\n<e5a2a9> 4319\n<e5a2ae> 7383\n<e5a2b3> 5155\n<e5a2ba> 6058\n<e5a2bb> 6538\n<e5a2be> 3478\n<e5a381> 5022\n<e5a385> 6090\n<e5a387> 4197\n<e5a38e> 7982\n<e5a391> 7630\n<e5a393> 5829\n<e5a395> 7803\n<e5a398> 4564\n<e5a399> 3842\n<e5a39e> 3858\n<e5a39f> 4536\n<e5a3a4> 5880\n<e5a3ab> 5255\n<e5a3ac> 6470\n<e5a3af> 6539\n<e5a3b9> 6463\n<e5a3ba> 7804\n<e5a3bb> 5374\n<e5a3bd> 5572\n<e5a48f> 7619\n<e5a494> 4071\n<e5a495> 5403\n<e5a496> 6135\n<e5a499> 5630\n<e5a49a> 4190\n<e5a49c> 5865\n<e5a4a2> 4797\n<e5a4a7> 4253\n<e5a4a9> 7151\n<e5a4aa> 7433\n<e5a4ab> 5118\n<e5a4ad> 6143\n<e5a4ae> 5834\n<e5a4b1> 5758\n<e5a4b7> 6416\n<e5a4be> 7761\n<e5a584> 5928\n<e5a587> 4072\n<e5a588> 4156\n<e5a589> 5094\n<e5a58e> 3996\n<e5a58f> 6869\n<e5a590> 7884\n<e5a591> 3708\n<e5a594> 5156\n<e5a595> 7730\n<e5a597> 7466\n<e5a59a> 7689\n<e5a5a0> 6652\n<e5a5a2> 5256\n<e5a5a7> 6059\n<e5a5aa> 7418\n<e5a5ab> 6360\nendcidchar\n\n100 begincidchar\n<e5a5ac> 6540\n<e5a5ad> 5404\n<e5a5ae> 5157\n<e5a5b3> 4159\n<e5a5b4> 4170\n<e5a5b8> 3479\n<e5a5bd> 7805\n<e5a682> 5936\n<e5a683> 5186\n<e5a684> 4697\n<e5a68a> 6471\n<e5a693> 4073\n<e5a696> 6144\n<e5a697> 4039\n<e5a699> 4802\n<e5a6a5> 7384\n<e5a6a8> 4944\n<e5a6ac> 7467\n<e5a6b9> 4709\n<e5a6bb> 7131\n<e5a6be> 7188\n<e5a783> 6710\n<e5a786> 4767\n<e5a789> 6486\n<e5a78b> 5695\n<e5a790> 6595\n<e5a791> 3734\n<e5a793> 5475\n<e5a794> 6289\n<e5a799> 6472\n<e5a79a> 6145\n<e5a79c> 3538\n<e5a79d> 6864\n<e5a7a6> 3480\n<e5a7a8> 6417\n<e5a7aa> 7017\n<e5a7ac> 8040\n<e5a7ae> 7672\n<e5a7b8> 5958\n<e5a7bb> 6449\n<e5a7bf> 6487\n<e5a881> 6290\n<e5a883> 6132\n<e5a891> 5257\n<e5a898> 4153\n<e5a89b> 6060\n<e5a89c> 4134\n<e5a89f> 5959\n<e5a8a0> 5739\n<e5a8a5> 5779\n<e5a8a9> 4672\n<e5a8b6> 7319\n<e5a8bc> 7096\n<e5a981> 4565\n<e5a986> 7475\n<e5a989> 6107\n<e5a99a> 7844\n<e5a9a2> 5187\n<e5a9a6> 5119\n<e5aa92> 4710\n<e5aa9a> 4852\n<e5aa9b> 6261\n<e5aaa4> 5696\n<e5ab81> 3445\n<e5ab82> 5573\n<e5ab84> 6262\n<e5ab89> 7018\n<e5ab8c> 7758\n<e5aba1> 6621\n<e5aba6> 7673\n<e5aba9> 4181\n<e5ac85> 7865\n<e5ac89> 8041\n<e5ac8b> 5422\n<e5ac8c> 3872\n<e5ac96> 7535\n<e5acaa> 5224\n<e5ad80> 5338\n<e5ad83> 5881\n<e5ad90> 6488\n<e5ad91> 7754\n<e5ad94> 3790\n<e5ad95> 6481\n<e5ad97> 6489\n<e5ad98> 6832\n<e5ad9a> 5120\n<e5ad9c> 6490\n<e5ad9d> 7955\n<e5ad9f> 4727\n<e5ada3> 3709\n<e5ada4> 3735\n<e5ada9> 7690\n<e5adab> 5546\n<e5adb0> 5631\n<e5adb1> 6522\n<e5adb5> 5121\n<e5adb8> 7631\n<e5adba> 6315\n<e5adbc> 5923\n<e5ae85> 4266\nendcidchar\n\n100 begincidchar\n<e5ae87> 6204\n<e5ae88> 5574\n<e5ae89> 5807\n<e5ae8b> 5553\n<e5ae8c> 6108\n<e5ae8f> 3864\n<e5ae93> 5078\n<e5ae95> 7427\n<e5ae96> 7950\n<e5ae97> 6838\n<e5ae98> 3820\n<e5ae99> 6870\n<e5ae9a> 6711\n<e5ae9b> 6109\n<e5ae9c> 6397\n<e5aea2> 3580\n<e5aea3> 5423\n<e5aea4> 5759\n<e5aea5> 6316\n<e5aea6> 7885\n<e5aeac> 5476\n<e5aeae> 3963\n<e5aeb0> 6573\n<e5aeb3> 7691\n<e5aeb4> 5960\n<e5aeb5> 5503\n<e5aeb6> 3446\n<e5aeb8> 5740\n<e5aeb9> 6180\n<e5aebf> 5632\n<e5af80> 7116\n<e5af82> 6622\n<e5af83> 6263\n<e5af84> 4074\n<e5af85> 6450\n<e5af86> 4883\n<e5af87> 3907\n<e5af8c> 5122\n<e5af90> 4711\n<e5af92> 7635\n<e5af93> 6205\n<e5af94> 5721\n<e5af97> 4168\n<e5af9e> 4664\n<e5af9f> 7078\n<e5afa1> 3803\n<e5afa2> 7368\n<e5afa4> 6061\n<e5afa5> 6146\n<e5afa6> 5760\n<e5afa7> 4167\n<e5afa8> 7117\n<e5afa9> 5762\n<e5afab> 5258\n<e5afac> 3821\n<e5afae> 4553\n<e5afaf> 6906\n<e5afb5> 7253\n<e5afb6> 5061\n<e5afb8> 7247\n<e5afba> 5259\n<e5b081> 5095\n<e5b084> 5260\n<e5b087> 6541\n<e5b088> 6653\n<e5b089> 6291\n<e5b08a> 6833\n<e5b08b> 5763\n<e5b08d> 4254\n<e5b08e> 4275\n<e5b08f> 5504\n<e5b091> 5505\n<e5b096> 7178\n<e5b099> 5339\n<e5b0a4> 6206\n<e5b0a8> 4945\n<e5b0b1> 7320\n<e5b0b8> 5697\n<e5b0b9> 6361\n<e5b0ba> 7136\n<e5b0bb> 3736\n<e5b0bc> 4186\n<e5b0be> 4853\n<e5b0bf> 4180\n<e5b180> 3948\n<e5b185> 3587\n<e5b186> 3710\n<e5b188> 3960\n<e5b18b> 6078\n<e5b18d> 5699\n<e5b18e> 5698\n<e5b191> 5451\n<e5b195> 6654\n<e5b19b> 5044\n<e5b1a0> 4276\n<e5b1a2> 4566\n<e5b1a4> 7335\n<e5b1a5> 4618\n<e5b1ac> 5538\n<e5b1af> 4358\nendcidchar\n\n100 begincidchar\n<e5b1b1> 5305\n<e5b1b9> 8024\n<e5b290> 4075\n<e5b291> 6527\n<e5b2a1> 3539\n<e5b2a9> 5822\n<e5b2ab> 5575\n<e5b2ac> 3531\n<e5b2b1> 4255\n<e5b2b3> 5794\n<e5b2b5> 7806\n<e5b2b7> 4870\n<e5b2b8> 5808\n<e5b2ba> 4492\n<e5b2be> 6693\n<e5b380> 5576\n<e5b399> 7339\n<e5b3a0> 5340\n<e5b3a8> 5780\n<e5b3b4> 7735\n<e5b3b6> 4277\n<e5b3bb> 6907\n<e5b3bd> 7762\n<e5b487> 5671\n<e5b48d> 4421\n<e5b48e> 4076\n<e5b491> 3776\n<e5b494> 7263\n<e5b496> 5843\n<e5b497> 3540\n<e5b499> 4596\n<e5b4a7> 5672\n<e5b4a9> 5175\n<e5b58b> 4854\n<e5b58c> 3513\n<e5b590> 4399\n<e5b5a9> 5673\n<e5b5ac> 6136\n<e5b5af> 7046\n<e5b687> 3908\n<e5b68b> 4278\n<e5b69d> 4365\n<e5b6a0> 3873\n<e5b6a2> 6147\n<e5b6aa> 5931\n<e5b6b8> 6003\n<e5b6ba> 4493\n<e5b6bc> 5375\n<e5b6bd> 5795\n<e5b78d> 6137\n<e5b792> 4673\n<e5b796> 5823\n<e5b79d> 7152\n<e5b79e> 6871\n<e5b7a1> 5640\n<e5b7a2> 5506\n<e5b7a5> 3791\n<e5b7a6> 6856\n<e5b7a7> 3874\n<e5b7a8> 3588\n<e5b7ab> 4813\n<e5b7ae> 7047\n<e5b7b1> 4077\n<e5b7b2> 6418\n<e5b7b3> 5261\n<e5b7b4> 7476\n<e5b7b7> 7674\n<e5b7bd> 5547\n<e5b7be> 3604\n<e5b882> 5700\n<e5b883> 7551\n<e5b886> 5010\n<e5b88c> 8042\n<e5b891> 7428\n<e5b896> 7189\n<e5b899> 7019\n<e5b89b> 4990\n<e5b89d> 6763\n<e5b8a5> 5577\n<e5b8ab> 5262\n<e5b8ad> 5405\n<e5b8b3> 6542\n<e5b8b6> 4256\n<e5b8b8> 5341\n<e5b8bd> 4768\n<e5b8bf> 7973\n<e5b980> 6712\n<e5b984> 5796\n<e5b985> 7571\n<e5b987> 4946\n<e5b98c> 7905\n<e5b995> 4665\n<e5b99f> 7340\n<e5b9a1> 4996\n<e5b9a2> 4242\n<e5b9a3> 7536\n<e5b9b2> 3481\n<e5b9b3> 7530\n<e5b9b4> 4160\n<e5b9b7> 5045\nendcidchar\n\n100 begincidchar\n<e5b9b8> 7706\n<e5b9b9> 3482\n<e5b9bb> 7886\n<e5b9be> 4078\n<e5ba84> 6543\n<e5ba87> 5188\n<e5ba8a> 5342\n<e5ba8f> 5376\n<e5ba95> 6596\n<e5ba97> 6694\n<e5ba9a> 3670\n<e5ba9c> 5123\n<e5baa0> 5343\n<e5baa6> 4279\n<e5baa7> 6857\n<e5baab> 3737\n<e5baad> 6713\n<e5bab5> 5824\n<e5bab6> 5377\n<e5bab7> 3541\n<e5bab8> 6181\n<e5babe> 6319\n<e5bb82> 5344\n<e5bb88> 7620\n<e5bb89> 4483\n<e5bb8a> 4412\n<e5bb90> 3909\n<e5bb93> 3815\n<e5bb96> 4554\n<e5bb9a> 6872\n<e5bb9b> 6655\n<e5bb9f> 4803\n<e5bba0> 7097\n<e5bba2> 7537\n<e5bba3> 3843\n<e5bbac> 4444\n<e5bbb3> 7197\n<e5bbb6> 5961\n<e5bbb7> 6714\n<e5bbba> 3605\n<e5bbbb> 7930\n<e5bc81> 5032\n<e5bc84> 4537\n<e5bc8a> 7538\n<e5bc8f> 5722\n<e5bc91> 5701\n<e5bc93> 3964\n<e5bc94> 6787\n<e5bc95> 6451\n<e5bc97> 5172\n<e5bc98> 7854\n<e5bc9b> 6419\n<e5bc9f> 6764\n<e5bca6> 7736\n<e5bca7> 7807\n<e5bca9> 4171\n<e5bcb1> 5872\n<e5bcb5> 6544\n<e5bcba> 3542\n<e5bcbc> 7605\n<e5bd88> 7411\n<e5bd8a> 3543\n<e5bd8c> 4855\n<e5bd8e> 4674\n<e5bd96> 4198\n<e5bd97> 7792\n<e5bd99> 7997\n<e5bd9b> 6420\n<e5bda2> 7775\n<e5bda6> 5919\n<e5bda7> 6230\n<e5bda9> 7118\n<e5bdaa> 7578\n<e5bdab> 6788\n<e5bdac> 5225\n<e5bdad> 7513\n<e5bdb0> 7098\n<e5bdb1> 6004\n<e5bdb7> 4947\n<e5bdb9> 5949\n<e5bdbc> 7597\n<e5bdbf> 5173\n<e5be80> 6126\n<e5be81> 6715\n<e5be85> 4257\n<e5be87> 5641\n<e5be8a> 7931\n<e5be8b> 4600\n<e5be8c> 7974\n<e5be90> 5378\n<e5be91> 3671\n<e5be92> 4280\n<e5be97> 4364\n<e5be98> 4972\n<e5be99> 5263\n<e5be9e> 6839\n<e5bea0> 4422\n<e5bea1> 5903\n<e5bea8> 7906\n<e5bea9> 5079\nendcidchar\n\n100 begincidchar\n<e5beaa> 5642\n<e5beae> 4856\n<e5beb5> 7038\n<e5beb7> 4267\n<e5beb9> 7170\n<e5bebd> 7998\n<e5bf83> 5764\n<e5bf85> 7606\n<e5bf8c> 4079\n<e5bf8d> 6452\n<e5bf96> 7248\n<e5bf97> 6947\n<e5bfa0> 7307\n<e5bfab> 7379\n<e5bfb5> 4163\n<e5bfbd> 7850\n<e5bfbf> 5158\n<e6808f> 5835\n<e68092> 4172\n<e68096> 7552\n<e6809c> 4494\n<e6809d> 5264\n<e680a0> 7434\n<e680a1> 6421\n<e680a5> 4053\n<e680a7> 5477\n<e680a8> 6264\n<e680aa> 3859\n<e680af> 3625\n<e68181> 6473\n<e68182> 5643\n<e68183> 5702\n<e6818d> 7907\n<e68190> 3792\n<e68192> 7675\n<e68195> 5379\n<e68199> 5882\n<e6819d> 3836\n<e681a2> 7932\n<e681a3> 6491\n<e681a4> 8010\n<e681a5> 7341\n<e681a8> 7636\n<e681a9> 6374\n<e681aa> 3468\n<e681ac> 4164\n<e681ad> 3793\n<e681af> 5723\n<e681b0> 8031\n<e68285> 5985\n<e68289> 5761\n<e6828c> 6765\n<e6828d> 7637\n<e68294> 7933\n<e68296> 7504\n<e6829a> 5554\n<e6829b> 6656\n<e6829f> 6062\n<e682a0> 6320\n<e682a3> 7887\n<e682a4> 7254\n<e682a7> 4619\n<e682b0> 6840\n<e682b2> 5189\n<e682b3> 4268\n<e682b4> 7312\n<e682b6> 4871\n<e682b8> 3711\n<e682bc> 4281\n<e682bd> 7132\n<e68385> 6716\n<e68387> 4320\n<e68391> 7841\n<e6839a> 7851\n<e6839c> 5406\n<e6839f> 6321\n<e683a0> 7793\n<e683a1> 5797\n<e683b0> 7385\n<e683b1> 4178\n<e683b3> 5345\n<e683b6> 7908\n<e683b9> 5866\n<e683ba> 5478\n<e683bb> 7333\n<e68481> 5578\n<e68486> 3606\n<e6848d> 4872\n<e6848e> 7517\n<e6848f> 6398\n<e68495> 5798\n<e6849a> 6207\n<e6849b> 5844\n<e6849f> 3514\n<e684a7> 3860\n<e684b0> 7909\n<e684b4> 7099\n<e684b7> 3565\n<e684bc> 5741\n<e684be> 3566\nendcidchar\n\n100 begincidchar\n<e684bf> 6265\n<e68582> 6182\n<e68584> 4601\n<e68587> 6375\n<e68588> 6492\n<e6858a> 3655\n<e6858b> 7435\n<e6858c> 7910\n<e68593> 7579\n<e68595> 4769\n<e6859d> 7471\n<e6859f> 7453\n<e685a2> 4675\n<e685a3> 3822\n<e685a4> 3469\n<e685a7> 7794\n<e685a8> 3567\n<e685ab> 6841\n<e685ae> 4445\n<e685b0> 6292\n<e685b6> 3672\n<e685b7> 3544\n<e685bd> 7137\n<e685be> 6168\n<e68681> 7255\n<e68682> 6208\n<e6868a> 5190\n<e6868e> 6932\n<e68690> 4465\n<e68691> 5237\n<e68694> 7217\n<e68698> 8044\n<e68699> 8043\n<e6869a> 7412\n<e686a4> 5159\n<e686a7> 4336\n<e686a9> 3628\n<e686ab> 4873\n<e686ac> 3673\n<e686ae> 4814\n<e686b2> 7723\n<e686b6> 5913\n<e686ba> 4219\n<e686be> 3515\n<e68783> 4026\n<e68787> 3483\n<e68788> 7692\n<e68789> 6391\n<e6878a> 6063\n<e6878b> 4815\n<e687a6> 4135\n<e687b2> 7039\n<e687b6> 4375\n<e687b7> 7934\n<e687b8> 7737\n<e687ba> 7087\n<e687bc> 3910\n<e687bf> 6399\n<e68880> 4466\n<e68887> 4243\n<e68888> 3804\n<e6888a> 4816\n<e6888c> 5667\n<e6888d> 5579\n<e6888e> 6369\n<e68890> 5479\n<e68891> 5781\n<e68892> 3712\n<e68896> 7842\n<e6889a> 7138\n<e6889f> 4019\n<e688a1> 3516\n<e688aa> 6685\n<e688ae> 4592\n<e688b0> 6657\n<e688b1> 8045\n<e688b4> 4258\n<e688b6> 7808\n<e688be> 4446\n<e688bf> 4948\n<e68980> 5507\n<e68981> 7520\n<e68987> 5424\n<e68988> 7809\n<e68989> 5191\n<e6898b> 5580\n<e6898d> 6574\n<e68993> 7386\n<e68998> 7398\n<e689ae> 5160\n<e689b1> 4054\n<e689b6> 5124\n<e689b9> 5192\n<e689bc> 5852\n<e689bf> 5687\n<e68a80> 4080\n<e68a84> 7218\n<e68a89> 3648\n<e68a8a> 7477\n<e68a91> 5914\nendcidchar\n\n100 begincidchar\n<e68a92> 5380\n<e68a95> 7468\n<e68a97> 7676\n<e68a98> 6686\n<e68a9b> 7553\n<e68aab> 7598\n<e68ab1> 7554\n<e68ab5> 6597\n<e68ab9> 4690\n<e68abc> 5830\n<e68abd> 7266\n<e68b82> 5174\n<e68b87> 4817\n<e68b88> 4165\n<e68b89> 4409\n<e68b8c> 4909\n<e68b8d> 4888\n<e68b8f> 4136\n<e68b90> 3861\n<e68b92> 3589\n<e68b93> 7139\n<e68b94> 4931\n<e68b96> 7387\n<e68b97> 6148\n<e68b98> 3911\n<e68b99> 6835\n<e68b9b> 7219\n<e68b9c> 4973\n<e68bac> 3837\n<e68bad> 5724\n<e68bae> 4129\n<e68baf> 6934\n<e68bb1> 3794\n<e68bb3> 3974\n<e68bb7> 3738\n<e68bbe> 5678\n<e68bbf> 4137\n<e68c81> 6948\n<e68c87> 6949\n<e68c89> 5809\n<e68c91> 4282\n<e68cab> 6858\n<e68caf> 6983\n<e68cba> 6717\n<e68cbb> 5963\n<e68cbd> 4676\n<e68cbe> 7763\n<e68d89> 7055\n<e68d8c> 7501\n<e68d8f> 4143\n<e68d90> 5962\n<e68d95> 7555\n<e68da7> 5098\n<e68da8> 5265\n<e68dae> 3590\n<e68db2> 3975\n<e68db7> 7190\n<e68dba> 4144\n<e68dbb> 4166\n<e68dbf> 5381\n<e68e83> 5508\n<e68e88> 5581\n<e68e89> 4283\n<e68e8c> 6545\n<e68e92> 4974\n<e68e96> 5853\n<e68e98> 3961\n<e68e9b> 3853\n<e68ea0> 4425\n<e68ea1> 7119\n<e68ea2> 7420\n<e68ea5> 6701\n<e68ea7> 3795\n<e68ea8> 7267\n<e68ea9> 5929\n<e68eaa> 6789\n<e68f80> 3484\n<e68f84> 6324\n<e68f86> 3997\n<e68f8f> 4804\n<e68f90> 6766\n<e68f96> 6387\n<e68f9a> 5883\n<e68f9b> 7888\n<e68fa1> 5799\n<e68fad> 3629\n<e68fae> 7999\n<e68fb4> 6266\n<e68fb6> 5867\n<e68fb7> 5327\n<e6908d> 5548\n<e6908f> 4889\n<e69094> 5509\n<e69096> 6149\n<e69097> 4284\n<e6909c> 5582\n<e690a2> 6984\n<e690ac> 4910\n<e690ad> 7425\n<e690ba> 8006\nendcidchar\n\n100 begincidchar\n<e690be> 7056\n<e69198> 6623\n<e691a0> 7256\n<e691a9> 4656\n<e691af> 6950\n<e691ba> 6702\n<e69288> 4512\n<e69291> 7447\n<e69292> 5316\n<e69293> 6150\n<e6929a> 4161\n<e6929e> 4244\n<e692a4> 7171\n<e692a5> 4932\n<e692ab> 4818\n<e692ad> 7478\n<e692ae> 7261\n<e692b0> 7062\n<e692b2> 4890\n<e692bb> 4212\n<e69381> 6091\n<e69384> 4513\n<e69385> 7153\n<e69387> 7445\n<e6938a> 3630\n<e6938d> 6790\n<e6938e> 3674\n<e69392> 4040\n<e69394> 4220\n<e69398> 5023\n<e6939a> 3591\n<e693a1> 4259\n<e693a2> 7399\n<e693a5> 4400\n<e693a6> 7079\n<e693a7> 3592\n<e693ac> 6400\n<e693b2> 7140\n<e693b4> 7877\n<e693ba> 7479\n<e693be> 6151\n<e69480> 4911\n<e69484> 7448\n<e69498> 5884\n<e6949d> 5471\n<e694a3> 4467\n<e694aa> 3875\n<e694ab> 7878\n<e694ac> 4401\n<e694af> 6951\n<e694b6> 5583\n<e694b7> 3739\n<e694b8> 6325\n<e694b9> 3568\n<e694bb> 3796\n<e694be> 4949\n<e694bf> 6718\n<e69585> 3740\n<e69588> 7956\n<e6958d> 5382\n<e6958e> 3876\n<e6958f> 4874\n<e69591> 3912\n<e69596> 6064\n<e69597> 7505\n<e6959e> 7100\n<e695a2> 3517\n<e695a3> 5306\n<e695a6> 4321\n<e695ac> 3675\n<e695ad> 5885\n<e695b2> 3741\n<e695b4> 6719\n<e695b5> 6624\n<e695b7> 5125\n<e695b8> 5584\n<e695be> 5425\n<e69682> 4484\n<e69683> 7539\n<e69685> 7957\n<e69687> 4840\n<e6968c> 5226\n<e69690> 5193\n<e69691> 4912\n<e69697> 4349\n<e69699> 4555\n<e6969b> 3768\n<e6969c> 5266\n<e6969f> 7030\n<e696a1> 5817\n<e696a4> 4027\n<e696a5> 7141\n<e696a7> 5126\n<e696ab> 6512\n<e696ac> 7088\n<e696af> 5267\n<e696b0> 5742\n<e696b7> 4199\n<e696b9> 4950\n<e696bc> 5904\nendcidchar\n\n100 begincidchar\n<e696bd> 5703\n<e69781> 4951\n<e69785> 4447\n<e6978b> 5426\n<e6978c> 6720\n<e6978f> 6828\n<e69792> 4578\n<e69797> 4081\n<e697a0> 4819\n<e697a3> 4082\n<e697a5> 6464\n<e697a6> 4200\n<e697a8> 6952\n<e697a9> 6791\n<e697ac> 5644\n<e697ad> 6231\n<e697b1> 7638\n<e697b4> 6209\n<e697ba> 6127\n<e697bd> 4322\n<e697bf> 6065\n<e69886> 3777\n<e69887> 5688\n<e69889> 4952\n<e6988a> 7810\n<e6988c> 7101\n<e6988e> 4751\n<e6988f> 7845\n<e69890> 5161\n<e69891> 4041\n<e69893> 5950\n<e69894> 5407\n<e69895> 8019\n<e6989e> 5046\n<e6989f> 5480\n<e698a0> 6005\n<e698a5> 7300\n<e698a7> 4712\n<e698a8> 6513\n<e698ad> 5510\n<e698af> 5704\n<e698b0> 7621\n<e698b1> 6232\n<e698b4> 4805\n<e698b6> 7102\n<e698ba> 5047\n<e698bb> 5836\n<e69981> 6792\n<e69982> 5705\n<e69989> 6985\n<e6998b> 6986\n<e6998f> 5810\n<e69999> 6908\n<e6999b> 7738\n<e6999d> 6873\n<e6999e> 8046\n<e6999f> 5481\n<e699a4> 6066\n<e699a5> 7890\n<e699a6> 7935\n<e699a7> 7811\n<e699a8> 5743\n<e699a9> 4677\n<e699ab> 7400\n<e699ae> 5062\n<e699af> 3676\n<e699b3> 5408\n<e699b4> 7198\n<e699b6> 6721\n<e699b7> 3990\n<e699b8> 6722\n<e699ba> 6953\n<e69a84> 7991\n<e69a87> 3447\n<e69a88> 7988\n<e69a89> 8000\n<e69a8e> 6006\n<e69a90> 6293\n<e69a91> 5383\n<e69a96> 4140\n<e69a97> 5825\n<e69a98> 5886\n<e69a9d> 4752\n<e69aa0> 3742\n<e69aa2> 7103\n<e69aab> 6528\n<e69aae> 4772\n<e69ab2> 6546\n<e69ab3> 7795\n<e69ab4> 7572\n<e69ab9> 5464\n<e69abb> 3677\n<e69abe> 4323\n<e69b84> 5999\n<e69b86> 4459\n<e69b87> 4221\n<e69b89> 7958\n<e69b96> 5845\n<e69b99> 5384\n<e69b9c> 6152\nendcidchar\n\n100 begincidchar\n<e69b9d> 7573\n<e69ba0> 3844\n<e69ba6> 8047\n<e69bb0> 6125\n<e69bb2> 3769\n<e69bb3> 6033\n<e69bb4> 3678\n<e69bb7> 3502\n<e69bb8> 5385\n<e69bb9> 6794\n<e69bba> 6793\n<e69bbc> 4678\n<e69bbe> 6933\n<e69bbf> 7206\n<e69c80> 7264\n<e69c83> 7936\n<e69c88> 6281\n<e69c89> 6326\n<e69c8b> 5176\n<e69c8d> 5080\n<e69c94> 5302\n<e69c95> 7031\n<e69c97> 4413\n<e69c9b> 4700\n<e69c9d> 6795\n<e69ca6> 4798\n<e69ca7> 4538\n<e69ca8> 4788\n<e69caa> 4857\n<e69cab> 4691\n<e69cac> 5091\n<e69cad> 7080\n<e69cae> 7304\n<e69cb1> 6874\n<e69cb4> 4891\n<e69cb6> 7388\n<e69cba> 3984\n<e69cbd> 7975\n<e69d86> 3485\n<e69d89> 5321\n<e69d8e> 4620\n<e69d8f> 7707\n<e69d90> 6575\n<e69d91> 7249\n<e69d93> 7580\n<e69d96> 6547\n<e69d9c> 4350\n<e69d9e> 4085\n<e69d9f> 5539\n<e69dad> 7677\n<e69daf> 4975\n<e69db0> 3615\n<e69db1> 4337\n<e69db3> 4806\n<e69db5> 6598\n<e69db7> 7480\n<e69dbb> 4183\n<e69dbe> 5555\n<e69dbf> 7492\n<e69e87> 5194\n<e69e89> 6128\n<e69e8b> 4953\n<e69e8f> 4146\n<e69e90> 5409\n<e69e93> 4351\n<e69e95> 7369\n<e69e97> 4647\n<e69e9a> 4713\n<e69e9c> 3805\n<e69e9d> 6954\n<e69eaf> 3743\n<e69eb0> 7531\n<e69eb3> 6955\n<e69eb8> 3913\n<e69ebe> 5706\n<e69f84> 5048\n<e69f8f> 4991\n<e69f90> 4773\n<e69f91> 3518\n<e69f92> 7365\n<e69f93> 5990\n<e69f94> 6327\n<e69f9a> 6328\n<e69f9d> 7401\n<e69fa9> 3914\n<e69fac> 3486\n<e69faf> 3450\n<e69fb0> 4157\n<e69fb1> 6875\n<e69fb3> 4579\n<e69fb4> 5707\n<e69fb5> 7127\n<e69fb6> 5268\n<e69fbb> 5269\n<e69fbe> 6723\n<e6a092> 5645\n<e6a093> 6658\n<e6a096> 5386\n<e6a097> 4602\n<e6a0a1> 3877\nendcidchar\n\n100 begincidchar\n<e6a0a2> 4992\n<e6a0aa> 6876\n<e6a0af> 6233\n<e6a0b8> 7704\n<e6a0b9> 4028\n<e6a0bc> 3631\n<e6a0bd> 6576\n<e6a180> 3616\n<e6a181> 7678\n<e6a182> 3713\n<e6a183> 4285\n<e6a188> 5811\n<e6a18e> 7020\n<e6a190> 4338\n<e6a191> 5346\n<e6a193> 7891\n<e6a194> 4130\n<e6a1ad> 6987\n<e6a1b6> 7454\n<e6a1bf> 3487\n<e6a281> 4431\n<e6a285> 4714\n<e6a28f> 3770\n<e6a293> 6577\n<e6a294> 7342\n<e6a297> 3679\n<e6a29d> 6796\n<e6a29f> 7959\n<e6a2a1> 6110\n<e6a2a2> 7220\n<e6a2a7> 6067\n<e6a2a8> 4621\n<e6a2ad> 5270\n<e6a2af> 6767\n<e6a2b0> 3714\n<e6a2b1> 3778\n<e6a2b3> 5511\n<e6a2b5> 5011\n<e6a2b6> 4858\n<e6a384> 4087\n<e6a385> 5049\n<e6a389> 4738\n<e6a38b> 4086\n<e6a38d> 3779\n<e6a392> 5099\n<e6a395> 6842\n<e6a397> 6797\n<e6a398> 4020\n<e6a39a> 5177\n<e6a39f> 4339\n<e6a3a0> 4245\n<e6a3a7> 6523\n<e6a3a8> 3715\n<e6a3ae> 5322\n<e6a3b2> 5387\n<e6a3b9> 4286\n<e6a3ba> 3823\n<e6a480> 6111\n<e6a485> 6401\n<e6a48d> 5725\n<e6a48e> 7268\n<e6a492> 7221\n<e6a4a7> 4753\n<e6a4b0> 5868\n<e6a4bd> 5964\n<e6a4bf> 7301\n<e6a58a> 5887\n<e6a593> 7592\n<e6a594> 5452\n<e6a595> 7389\n<e6a597> 3607\n<e6a599> 4820\n<e6a59a> 7222\n<e6a59e> 4608\n<e6a5a0> 4147\n<e6a5a3> 4859\n<e6a5a8> 6724\n<e6a5ab> 6928\n<e6a5ad> 5932\n<e6a5ae> 6599\n<e6a5af> 5646\n<e6a5b5> 4021\n<e6a5b7> 7693\n<e6a5b8> 7269\n<e6a5b9> 6007\n<e6a695> 6183\n<e6a69b> 6988\n<e6a69c> 4954\n<e6a6a5> 7913\n<e6a6a7> 5195\n<e6a6ae> 6008\n<e6a6b4> 4580\n<e6a6bb> 7426\n<e6a781> 3744\n<e6a783> 4913\n<e6a78b> 3915\n<e6a78c> 7460\n<e6a78d> 7104\n<e6a790> 3862\n<e6a7a8> 3816\nendcidchar\n\n100 begincidchar\n<e6a7aa> 3569\n<e6a7bb> 3998\n<e6a7bd> 6798\n<e6a7bf> 4029\n<e6a882> 5800\n<e6a88a> 4997\n<e6a891> 4432\n<e6a893> 4567\n<e6a897> 6600\n<e6a899> 7581\n<e6a89e> 7270\n<e6a89f> 6548\n<e6a8a1> 4774\n<e6a8a3> 5888\n<e6a8b5> 7223\n<e6a8b8> 4892\n<e6a8b9> 5585\n<e6a8ba> 7866\n<e6a8bd> 6909\n<e6a984> 3519\n<e6a988> 6153\n<e6a98b> 3878\n<e6a992> 6239\n<e6a993> 5647\n<e6a998> 4015\n<e6a999> 4366\n<e6a99f> 4088\n<e6a9a1> 5347\n<e6a9ab> 7951\n<e6aa80> 4201\n<e6aa84> 3632\n<e6aa89> 6725\n<e6aa8d> 5915\n<e6aa8e> 4042\n<e6aa97> 5024\n<e6aa9c> 7937\n<e6aaa2> 3620\n<e6aaa3> 6549\n<e6aab3> 5227\n<e6aabb> 7656\n<e6ab82> 4287\n<e6ab83> 3985\n<e6ab93> 4514\n<e6ab9a> 4448\n<e6ab9b> 6927\n<e6abb6> 7724\n<e6abbb> 5858\n<e6ac84> 4391\n<e6ac8a> 3976\n<e6ac8c> 6550\n<e6ac92> 4392\n<e6ac96> 4402\n<e6aca0> 8027\n<e6aca1> 7048\n<e6aca3> 8020\n<e6acb2> 6169\n<e6acba> 4089\n<e6acbd> 8028\n<e6acbe> 3824\n<e6ad86> 8029\n<e6ad87> 7727\n<e6ad8c> 3451\n<e6ad8e> 7413\n<e6ad90> 3916\n<e6ad9f> 5937\n<e6ada1> 7889\n<e6ada2> 6956\n<e6ada3> 6726\n<e6ada4> 7049\n<e6ada5> 5063\n<e6ada6> 4821\n<e6adaa> 6133\n<e6adb2> 5494\n<e6adb7> 4460\n<e6adb8> 3991\n<e6adbb> 5271\n<e6adbf> 4795\n<e6ae83> 5837\n<e6ae84> 6989\n<e6ae86> 7436\n<e6ae89> 5648\n<e6ae8a> 5586\n<e6ae96> 5726\n<e6ae98> 6524\n<e6ae9e> 6240\n<e6aeae> 4485\n<e6aeaf> 5228\n<e6aeb2> 5465\n<e6aeb5> 4202\n<e6aeb7> 6376\n<e6aeba> 5317\n<e6aebc> 3470\n<e6aebf> 6659\n<e6af81> 7996\n<e6af85> 6402\n<e6af86> 3917\n<e6af8b> 4822\n<e6af8d> 4775\n<e6af8f> 4715\n<e6af92> 4309\nendcidchar\n\n100 begincidchar\n<e6af93> 6356\n<e6af94> 5196\n<e6af9b> 4776\n<e6afab> 7812\n<e6afac> 3918\n<e6b088> 6660\n<e6b08f> 5774\n<e6b091> 4877\n<e6b093> 4728\n<e6b0a3> 4090\n<e6b0b4> 5587\n<e6b0b7> 5238\n<e6b0b8> 6009\n<e6b0be> 5012\n<e6b180> 6727\n<e6b181> 6929\n<e6b182> 3919\n<e6b18e> 5013\n<e6b190> 5410\n<e6b195> 5307\n<e6b197> 7639\n<e6b19a> 6068\n<e6b19d> 5938\n<e6b19e> 7855\n<e6b19f> 3545\n<e6b1a0> 6957\n<e6b1a8> 3784\n<e6b1aa> 6129\n<e6b1ad> 6034\n<e6b1b0> 7437\n<e6b1b2> 4055\n<e6b1b6> 4841\n<e6b1ba> 3649\n<e6b1bd> 4091\n<e6b1be> 5162\n<e6b281> 5765\n<e6b282> 4092\n<e6b283> 6079\n<e6b285> 6267\n<e6b286> 7679\n<e6b287> 5965\n<e6b288> 7370\n<e6b28c> 4324\n<e6b290> 4789\n<e6b292> 4796\n<e6b293> 4234\n<e6b294> 4739\n<e6b295> 4849\n<e6b296> 7308\n<e6b299> 5272\n<e6b29a> 6958\n<e6b29b> 7506\n<e6b2ab> 4692\n<e6b2ae> 6601\n<e6b2b3> 7622\n<e6b2b8> 5200\n<e6b2b9> 6331\n<e6b2bb> 7343\n<e6b2bc> 5512\n<e6b2bd> 3745\n<e6b2be> 7179\n<e6b2bf> 5966\n<e6b381> 7914\n<e6b382> 7776\n<e6b384> 5453\n<e6b389> 7154\n<e6b38a> 4893\n<e6b38c> 7607\n<e6b393> 7856\n<e6b395> 5018\n<e6b397> 5273\n<e6b39b> 5014\n<e6b3a1> 7556\n<e6b3a2> 7481\n<e6b3a3> 6388\n<e6b3a5> 4187\n<e6b3a8> 6877\n<e6b3ab> 7739\n<e6b3ae> 4914\n<e6b3af> 4878\n<e6b3b0> 7438\n<e6b3b3> 6010\n<e6b48b> 5889\n<e6b48c> 4480\n<e6b491> 5064\n<e6b497> 5495\n<e6b499> 5588\n<e6b49b> 4382\n<e6b49e> 4340\n<e6b4a5> 6990\n<e6b4a7> 6332\n<e6b4a9> 5454\n<e6b4aa> 7857\n<e6b4b2> 6878\n<e6b4b5> 5649\n<e6b4b6> 8016\n<e6b4b8> 3845\n<e6b4b9> 6268\n<e6b4bb> 7899\n<e6b4bd> 8032\nendcidchar\n\n100 begincidchar\n<e6b4be> 7482\n<e6b581> 4581\n<e6b599> 6687\n<e6b59a> 6910\n<e6b59c> 5229\n<e6b5a3> 6112\n<e6b5a6> 7557\n<e6b5a9> 7813\n<e6b5aa> 4414\n<e6b5ac> 4622\n<e6b5ae> 5127\n<e6b5b4> 6170\n<e6b5b7> 7694\n<e6b5b8> 7371\n<e6b5b9> 7764\n<e6b5bf> 7507\n<e6b685> 5986\n<e6b687> 3680\n<e6b688> 5513\n<e6b689> 5472\n<e6b68c> 6184\n<e6b68d> 7960\n<e6b68e> 5967\n<e6b691> 5540\n<e6b693> 5968\n<e6b695> 7207\n<e6b6af> 5846\n<e6b6b2> 5854\n<e6b6b5> 7657\n<e6b780> 6728\n<e6b783> 3977\n<e6b784> 7344\n<e6b785> 5411\n<e6b786> 7961\n<e6b787> 4093\n<e6b78b> 4648\n<e6b78f> 7814\n<e6b791> 5633\n<e6b798> 4288\n<e6b799> 6843\n<e6b79a> 4568\n<e6b79e> 5556\n<e6b7a1> 4222\n<e6b7a8> 6729\n<e6b7aa> 4597\n<e6b7ab> 6382\n<e6b7ae> 7938\n<e6b7b1> 5766\n<e6b7b3> 5650\n<e6b7b5> 5969\n<e6b7b7> 7846\n<e6b7b8> 7199\n<e6b7b9> 5930\n<e6b7ba> 7155\n<e6b7bb> 7180\n<e6b897> 5323\n<e6b899> 7892\n<e6b89a> 6602\n<e6b89b> 3520\n<e6b89f> 6730\n<e6b8a0> 3593\n<e6b8a1> 4289\n<e6b8a3> 5274\n<e6b8a4> 4933\n<e6b8a5> 5801\n<e6b8a6> 6099\n<e6b8ab> 5455\n<e6b8ac> 7334\n<e6b8ad> 6294\n<e6b8af> 7680\n<e6b8b2> 5427\n<e6b8b4> 3503\n<e6b8b6> 6011\n<e6b8b8> 6333\n<e6b8ba> 4807\n<e6b8bc> 4860\n<e6b8bd> 6578\n<e6b8be> 7847\n<e6b983> 4976\n<e6b984> 4861\n<e6b98a> 6879\n<e6b98d> 4203\n<e6b996> 7815\n<e6b998> 5348\n<e6b99b> 4223\n<e6b99c> 5727\n<e6b99e> 6731\n<e6b99f> 7915\n<e6b9a7> 6185\n<e6b9ab> 7271\n<e6b9ae> 6453\n<e6b9af> 7429\n<e6b9b2> 6269\n<e6b9b3> 4148\n<e6b9ba> 5065\n<e6ba90> 6270\n<e6ba96> 6911\n<e6ba9c> 4582\n<e6ba9d> 3920\n<e6ba9f> 4754\nendcidchar\n\n100 begincidchar\n<e6baa2> 6465\n<e6baa5> 5128\n<e6baaa> 3716\n<e6baab> 6083\n<e6baaf> 5514\n<e6bab1> 6991\n<e6bab6> 6186\n<e6baba> 4189\n<e6bb82> 4955\n<e6bb84> 7105\n<e6bb85> 4746\n<e6bb89> 7916\n<e6bb8b> 6493\n<e6bb8c> 7142\n<e6bb8e> 7777\n<e6bb91> 7900\n<e6bb93> 6579\n<e6bb94> 4290\n<e6bbaf> 7208\n<e6bbb4> 6625\n<e6bbb8> 7816\n<e6bbbe> 3780\n<e6bbbf> 4679\n<e6bc81> 5905\n<e6bc82> 7582\n<e6bc86> 7366\n<e6bc8f> 4569\n<e6bc91> 3570\n<e6bc94> 5970\n<e6bc95> 6799\n<e6bca0> 4666\n<e6bca2> 7640\n<e6bca3> 4468\n<e6bcab> 4680\n<e6bcac> 6959\n<e6bcb1> 5589\n<e6bcb2> 7106\n<e6bcb8> 6695\n<e6bcbf> 6551\n<e6bd81> 6012\n<e6bd91> 4934\n<e6bd94> 3650\n<e6bd97> 7033\n<e6bd98> 4915\n<e6bd9a> 5634\n<e6bd9b> 6529\n<e6bd9e> 4515\n<e6bd9f> 5412\n<e6bda2> 7917\n<e6bda4> 6362\n<e6bdad> 4224\n<e6bdae> 6800\n<e6bdb0> 3986\n<e6bdba> 6525\n<e6bdbc> 4341\n<e6bdbd> 5066\n<e6bdbe> 4639\n<e6be81> 5328\n<e6be84> 7040\n<e6be88> 7172\n<e6be8d> 6880\n<e6be8e> 7514\n<e6be90> 6241\n<e6be94> 7817\n<e6be97> 3488\n<e6bea3> 7641\n<e6bea4> 7446\n<e6bea7> 4507\n<e6beae> 7939\n<e6beaf> 7063\n<e6beb1> 6661\n<e6beb3> 6069\n<e6beb9> 4225\n<e6bebe> 4213\n<e6bf80> 3633\n<e6bf81> 7402\n<e6bf82> 4486\n<e6bf83> 4175\n<e6bf8a> 6035\n<e6bf95> 5677\n<e6bf9a> 6013\n<e6bf9f> 6768\n<e6bfa0> 7818\n<e6bfa1> 6334\n<e6bfa4> 4291\n<e6bfa9> 7819\n<e6bfab> 4403\n<e6bfac> 6912\n<e6bfaf> 7403\n<e6bfb1> 5230\n<e6bfbe> 4449\n<e78081> 5890\n<e78085> 7778\n<e78086> 4310\n<e78089> 5275\n<e7808b> 5767\n<e7808f> 4583\n<e78091> 7574\n<e78095> 5231\n<e78098> 4516\nendcidchar\n\n100 begincidchar\n<e7809a> 7642\n<e7809b> 6014\n<e7809c> 6370\n<e7809d> 4461\n<e7809e> 6732\n<e7809f> 5515\n<e780a3> 7695\n<e780a7> 4539\n<e780a8> 4544\n<e780af> 6015\n<e780b7> 6437\n<e780be> 4393\n<e7818c> 3825\n<e78190> 7779\n<e78191> 5562\n<e78198> 7414\n<e7819d> 7820\n<e781a3> 4681\n<e781ab> 7867\n<e781b0> 7940\n<e781b8> 3921\n<e781bc> 6514\n<e781bd> 6580\n<e78285> 3681\n<e7828a> 7321\n<e7828e> 5991\n<e78292> 7224\n<e78298> 8021\n<e78299> 6494\n<e7829a> 3846\n<e782a1> 6733\n<e782a4> 5516\n<e782ab> 7740\n<e782ac> 3594\n<e782ad> 7415\n<e782af> 7780\n<e782b3> 5050\n<e782b7> 6881\n<e782b8> 6515\n<e782b9> 6696\n<e78388> 4481\n<e7838b> 8007\n<e7838f> 6070\n<e78398> 7858\n<e78399> 4383\n<e7839d> 6935\n<e7839f> 5971\n<e783b1> 3682\n<e783b9> 7515\n<e783bd> 5100\n<e78484> 7983\n<e78489> 5920\n<e7848c> 6913\n<e78499> 4977\n<e7849a> 5163\n<e7849e> 4325\n<e784a1> 4823\n<e784a6> 7225\n<e784b0> 5992\n<e784b6> 5972\n<e78587> 8001\n<e78589> 4469\n<e7858a> 7992\n<e7858c> 7918\n<e7858e> 6662\n<e78590> 6016\n<e78596> 4141\n<e78599> 5973\n<e7859c> 6234\n<e7859e> 5318\n<e785a4> 4716\n<e785a5> 7893\n<e785a6> 7976\n<e785a7> 6801\n<e785a9> 4998\n<e785ac> 5891\n<e785ae> 6495\n<e785bd> 5428\n<e78684> 5728\n<e78689> 6242\n<e7868a> 6253\n<e7868f> 7984\n<e78692> 7781\n<e78694> 6187\n<e78699> 8048\n<e7869f> 5635\n<e786a2> 5101\n<e786ac> 6071\n<e786b1> 5987\n<e786be> 7345\n<e78781> 6000\n<e78783> 5974\n<e78788> 4367\n<e78789> 4326\n<e7878e> 4556\n<e78790> 4640\n<e78792> 5517\n<e78794> 4999\n<e78795> 5975\n<e7879f> 6017\nendcidchar\n\n100 begincidchar\n<e787a5> 6802\n<e787a6> 7064\n<e787a7> 5590\n<e787ad> 7243\n<e787ae> 5473\n<e787bb> 7985\n<e787bc> 5744\n<e787be> 4292\n<e787bf> 6154\n<e78880> 7731\n<e78886> 7575\n<e78890> 4517\n<e7889b> 4394\n<e788aa> 6803\n<e788ac> 7483\n<e788ad> 6587\n<e788b0> 6271\n<e788b2> 6295\n<e788b5> 6516\n<e788b6> 5129\n<e788ba> 5869\n<e788bb> 7962\n<e788bd> 5349\n<e788be> 6422\n<e78980> 5350\n<e78986> 6552\n<e78987> 7521\n<e78988> 7493\n<e7898c> 7508\n<e78992> 7191\n<e78998> 4311\n<e78999> 5782\n<e7899b> 6210\n<e7899d> 5232\n<e7899f> 4777\n<e789a1> 4778\n<e789a2> 4545\n<e789a7> 4790\n<e789a9> 4850\n<e789b2> 5369\n<e789b9> 7472\n<e789bd> 3638\n<e78a80> 5388\n<e78a81> 4623\n<e78aa2> 4312\n<e78aa7> 8051\n<e78aac> 3639\n<e78aaf> 5015\n<e78b80> 5351\n<e78b82> 3847\n<e78b84> 6626\n<e78b8e> 5831\n<e78b90> 7821\n<e78b97> 3922\n<e78b99> 6603\n<e78ba1> 3879\n<e78ba9> 5591\n<e78bb8> 4624\n<e78bb9> 7765\n<e78bbc> 4415\n<e78bbd> 7509\n<e78c8a> 6036\n<e78c96> 7107\n<e78c9b> 4729\n<e78c9c> 5708\n<e78c9d> 6836\n<e78ca5> 6138\n<e78ca9> 5482\n<e78caa> 6604\n<e78cab> 4808\n<e78cbe> 7901\n<e78cbf> 6272\n<e78d84> 6080\n<e78d85> 5276\n<e78d90> 6553\n<e78d92> 6072\n<e78d97> 3980\n<e78da8> 4313\n<e78daa> 7941\n<e78db0> 6018\n<e78db2> 7949\n<e78db5> 4488\n<e78db8> 5592\n<e78dba> 4214\n<e78dbb> 7725\n<e78e84> 7741\n<e78e86> 6496\n<e78e87> 5552\n<e78e89> 6081\n<e78e8b> 6130\n<e78e8e> 6734\n<e78e94> 7156\n<e78e96> 3923\n<e78e97> 6211\n<e78e98> 4094\n<e78e9f> 4879\n<e78ea7> 6363\n<e78ea9> 6113\n<e78ead> 5233\n<e78eb2> 4495\nendcidchar\n\n100 begincidchar\n<e78eb3> 4260\n<e78eb9> 7742\n<e78f80> 4894\n<e78f82> 3452\n<e78f89> 4880\n<e78f8a> 5308\n<e78f8c> 7608\n<e78f8d> 6992\n<e78f8f> 3471\n<e78f96> 3848\n<e78f99> 3797\n<e78f9d> 7977\n<e78f9e> 4384\n<e78fa0> 6882\n<e78fa3> 5651\n<e78fa4> 5067\n<e78fa5> 6423\n<e78fa6> 7713\n<e78fa9> 7782\n<e78faa> 3999\n<e78fad> 4916\n<e78fb7> 4824\n<e78fb9> 5483\n<e78fbd> 6735\n<e78fbe> 7743\n<e79081> 5429\n<e79083> 3924\n<e79085> 4416\n<e79086> 4625\n<e79087> 5593\n<e79089> 4584\n<e79093> 6114\n<e7909b> 7372\n<e790a0> 6663\n<e790a1> 5636\n<e790a2> 7404\n<e790a5> 7822\n<e790a6> 4095\n<e790a8> 3781\n<e790aa> 4096\n<e790ab> 5102\n<e790ac> 6115\n<e790ae> 6844\n<e790af> 3826\n<e790b0> 5993\n<e790b3> 4649\n<e790b4> 4043\n<e790b5> 5201\n<e790b6> 7484\n<e790b8> 7405\n<e790ba> 5019\n<e790bf> 7848\n<e79180> 6212\n<e79181> 4779\n<e79183> 7302\n<e79184> 5430\n<e7918b> 6296\n<e79195> 7623\n<e79197> 6273\n<e79199> 4173\n<e7919a> 7823\n<e7919b> 6019\n<e7919c> 6337\n<e7919e> 5389\n<e7919f> 5674\n<e791a0> 4585\n<e791a2> 6188\n<e791a4> 6155\n<e791a5> 6084\n<e791a8> 6993\n<e791a9> 7783\n<e791aa> 4657\n<e791af> 4417\n<e791be> 4030\n<e79282> 4097\n<e79283> 4626\n<e79287> 5431\n<e79289> 4470\n<e7928b> 6554\n<e79298> 4641\n<e7929c> 7919\n<e7929e> 4895\n<e7929f> 3683\n<e792a1> 6994\n<e792a3> 4098\n<e792a5> 3684\n<e792a7> 5025\n<e792a8> 7065\n<e792aa> 6804\n<e792b0> 7894\n<e792b2> 5594\n<e792b5> 5939\n<e792b9> 5637\n<e792bd> 5363\n<e792bf> 5432\n<e79386> 7021\n<e7938a> 3685\n<e7938f> 4540\n<e79394> 6020\n<e79398> 3827\nendcidchar\n\n100 begincidchar\n<e7939a> 7066\n<e7939c> 3806\n<e793a0> 7824\n<e793a2> 7583\n<e793a3> 7494\n<e793a6> 6100\n<e793ae> 6092\n<e793b7> 6497\n<e79481> 5051\n<e79484> 3640\n<e79491> 6936\n<e79495> 6093\n<e79498> 3521\n<e7949a> 5768\n<e7949b> 7181\n<e7949f> 5370\n<e794a3> 5309\n<e794a5> 5371\n<e794a6> 5518\n<e794a8> 6189\n<e794ab> 5068\n<e794ac> 6190\n<e794b0> 6664\n<e794b1> 6338\n<e794b2> 3532\n<e794b3> 5745\n<e794b7> 4149\n<e794b8> 6665\n<e794ba> 6736\n<e79587> 4011\n<e7958c> 3717\n<e7958f> 6139\n<e79591> 6666\n<e79593> 4235\n<e79594> 4917\n<e79599> 4586\n<e7959b> 6995\n<e7959c> 7289\n<e7959d> 4825\n<e795a2> 7609\n<e795a5> 4426\n<e795a6> 8008\n<e795aa> 5000\n<e795af> 6914\n<e795b0> 6424\n<e795b5> 7868\n<e795b6> 4246\n<e795b8> 4099\n<e795ba> 3546\n<e795bf> 4100\n<e79686> 3547\n<e79687> 6883\n<e7968a> 7192\n<e7968b> 7610\n<e7968e> 5520\n<e7968f> 5519\n<e79691> 6403\n<e7969d> 5310\n<e796a5> 3571\n<e796ab> 5951\n<e796b1> 7558\n<e796b2> 7599\n<e796b3> 3522\n<e796b5> 6498\n<e796b8> 4215\n<e796b9> 6996\n<e796bc> 4342\n<e796bd> 6605\n<e796be> 7022\n<e79782> 3453\n<e79785> 5052\n<e79787> 6937\n<e7978d> 6425\n<e79792> 5892\n<e79794> 7346\n<e79795> 8022\n<e79798> 4352\n<e79799> 3686\n<e7979b> 7455\n<e797a2> 4627\n<e797b0> 4226\n<e797b2> 4658\n<e797b4> 7347\n<e797ba> 5202\n<e797bc> 3746\n<e79880> 5906\n<e7988d> 5893\n<e79899> 5521\n<e7989f> 6085\n<e798a0> 7143\n<e798a1> 7108\n<e798a2> 4918\n<e798a4> 4587\n<e798a6> 5595\n<e798bb> 4570\n<e79982> 4557\n<e7998c> 5826\n<e7998e> 3489\n<e79992> 6339\n<e79996> 5026\nendcidchar\n\n100 begincidchar\n<e799a1> 7348\n<e799a4> 6688\n<e799a9> 4376\n<e799ac> 5433\n<e799b0> 6094\n<e799b2> 6667\n<e799b8> 3718\n<e799bb> 4368\n<e799bc> 4935\n<e79a84> 6627\n<e79a86> 3572\n<e79a87> 7920\n<e79a8e> 3880\n<e79a90> 3747\n<e79a93> 7825\n<e79aae> 7600\n<e79aba> 7272\n<e79abf> 4755\n<e79b82> 6213\n<e79b83> 4978\n<e79b86> 5164\n<e79b88> 6021\n<e79b8a> 6438\n<e79b92> 7665\n<e79b96> 3573\n<e79b9b> 5484\n<e79b9c> 4293\n<e79b9e> 6526\n<e79b9f> 4731\n<e79ba1> 6997\n<e79ba3> 3523\n<e79ba4> 4919\n<e79ba7> 4518\n<e79bae> 4791\n<e79bb2> 4730\n<e79bb4> 6975\n<e79bb8> 5352\n<e79bbc> 4920\n<e79bbe> 5652\n<e79c81> 5485\n<e79c84> 4740\n<e79c88> 7421\n<e79c89> 4862\n<e79c8b> 3490\n<e79c9e> 6998\n<e79ca0> 4741\n<e79ca9> 7744\n<e79cb7> 3978\n<e79cb8> 4780\n<e79cba> 6805\n<e79cbc> 5812\n<e79d80> 7057\n<e79d8d> 7745\n<e79d9b> 6737\n<e79da1> 5596\n<e79da3> 4314\n<e79da6> 4792\n<e79dab> 7193\n<e79db9> 4294\n<e79dbe> 3748\n<e79dbf> 6037\n<e79e8b> 6999\n<e79e91> 4756\n<e79e9e> 4682\n<e79ea5> 5038\n<e79eac> 5653\n<e79ead> 4558\n<e79eb0> 3524\n<e79eb3> 4343\n<e79ebb> 7182\n<e79ebc> 3621\n<e79ebf> 3925\n<e79f97> 7244\n<e79f9b> 4781\n<e79f9c> 4060\n<e79fa2> 5709\n<e79fa3> 6404\n<e79fa5> 6960\n<e79fa9> 3926\n<e79fad> 4204\n<e79fae> 6134\n<e79faf> 3881\n<e79fb3> 5413\n<e7a082> 5277\n<e7a092> 5203\n<e7a0a5> 6961\n<e7a0a6> 7120\n<e7a0a7> 7373\n<e7a0ac> 4652\n<e7a0b2> 7559\n<e7a0b4> 7485\n<e7a185> 4000\n<e7a18f> 5976\n<e7a19d> 7226\n<e7a1ab> 4588\n<e7a1ac> 3687\n<e7a1af> 5977\n<e7a1bc> 5178\n<e7a281> 4101\n<e7a287> 6738\nendcidchar\n\n100 begincidchar\n<e7a28c> 4528\n<e7a28d> 5847\n<e7a28e> 5563\n<e7a291> 5204\n<e7a297> 6116\n<e7a2a3> 3504\n<e7a2a7> 5027\n<e7a2a9> 5414\n<e7a2bc> 4659\n<e7a381> 6499\n<e7a385> 4956\n<e7a38a> 4546\n<e7a38b> 7050\n<e7a38e> 3719\n<e7a390> 4921\n<e7a3a8> 4660\n<e7a3ac> 3688\n<e7a3af> 4102\n<e7a3b5> 3491\n<e7a3bb> 4922\n<e7a481> 7227\n<e7a48e> 7228\n<e7a496> 5940\n<e7a4aa> 4450\n<e7a4ab> 4462\n<e7a4ac> 4923\n<e7a4ba> 5710\n<e7a4be> 5278\n<e7a580> 5279\n<e7a581> 4103\n<e7a589> 6962\n<e7a590> 6214\n<e7a596> 6806\n<e7a597> 6963\n<e7a59a> 6807\n<e7a59b> 3595\n<e7a59c> 7826\n<e7a59d> 7290\n<e7a59e> 5746\n<e7a5a0> 5280\n<e7a5a5> 5353\n<e7a5a8> 7584\n<e7a5ad> 6769\n<e7a5ba> 4106\n<e7a5bf> 4529\n<e7a681> 4044\n<e7a68d> 7869\n<e7a68e> 6739\n<e7a68f> 5081\n<e7a691> 6215\n<e7a6a6> 5907\n<e7a6a7> 8052\n<e7a6aa> 5434\n<e7a6ae> 4508\n<e7a6b1> 4295\n<e7a6b3> 5894\n<e7a6b9> 6216\n<e7a6bd> 4045\n<e7a6be> 7870\n<e7a6bf> 4315\n<e7a780> 5597\n<e7a781> 5281\n<e7a789> 5053\n<e7a78a> 4162\n<e7a78b> 7273\n<e7a791> 3807\n<e7a792> 7229\n<e7a795> 5205\n<e7a798> 5206\n<e7a79f> 6808\n<e7a7a4> 7377\n<e7a7a6> 7000\n<e7a7a7> 5838\n<e7a7a9> 7023\n<e7a7bb> 6426\n<e7a880> 8053\n<e7a885> 5496\n<e7a888> 3492\n<e7a88b> 6740\n<e7a88d> 7230\n<e7a894> 6474\n<e7a897> 7510\n<e7a899> 6976\n<e7a89a> 7349\n<e7a89c> 4609\n<e7a89f> 7591\n<e7a8a0> 6809\n<e7a8ae> 6845\n<e7a8b1> 7378\n<e7a8b6> 6235\n<e7a8b7> 6977\n<e7a8bb> 4296\n<e7a8bc> 3454\n<e7a8bd> 3720\n<e7a8bf> 3749\n<e7a980> 3771\n<e7a986> 4793\n<e7a989> 7350\n<e7a98d> 6628\n<e7a98e> 6022\nendcidchar\n\n100 begincidchar\n<e7a997> 5598\n<e7a9a1> 5366\n<e7a9a2> 6038\n<e7a9a9> 6086\n<e7a9ab> 7881\n<e7a9b0> 5895\n<e7a9b4> 7755\n<e7a9b6> 3927\n<e7a9b9> 3965\n<e7a9ba> 3798\n<e7a9bd> 6741\n<e7a9bf> 7157\n<e7aa81> 4330\n<e7aa84> 7058\n<e7aa88> 6156\n<e7aa92> 7024\n<e7aa93> 7109\n<e7aa95> 6810\n<e7aa98> 3954\n<e7aa9f> 3962\n<e7aaae> 3966\n<e7aaaf> 6157\n<e7aaba> 4001\n<e7ab84> 7067\n<e7ab85> 4002\n<e7ab87> 4353\n<e7ab8a> 6689\n<e7ab8b> 4653\n<e7ab97> 4809\n<e7ab99> 7089\n<e7ab9d> 5054\n<e7ab9f> 3689\n<e7aba0> 6555\n<e7aba3> 6915\n<e7aba5> 4344\n<e7abaa> 5599\n<e7abad> 3505\n<e7abaf> 4205\n<e7abb6> 3690\n<e7abb9> 6900\n<e7abba> 7291\n<e7abbf> 3493\n<e7ac8f> 7852\n<e7ac91> 5522\n<e7ac99> 5372\n<e7ac9b> 6629\n<e7ac9e> 7439\n<e7aca0> 4654\n<e7aca6> 5130\n<e7acac> 6770\n<e7acad> 4496\n<e7acb9> 5497\n<e7ad86> 7611\n<e7ad89> 4369\n<e7ad8b> 4031\n<e7ad8c> 6668\n<e7ad8d> 5654\n<e7ad8f> 5006\n<e7ad90> 3849\n<e7ad91> 7292\n<e7ad92> 7456\n<e7ad94> 4236\n<e7ad96> 7128\n<e7ada0> 4012\n<e7adac> 5486\n<e7adae> 5390\n<e7adb5> 5978\n<e7adbd> 6073\n<e7ae87> 3574\n<e7ae8b> 6669\n<e7ae8f> 6588\n<e7ae94> 4896\n<e7ae95> 4107\n<e7ae97> 5311\n<e7ae9a> 7051\n<e7ae9d> 3656\n<e7aea1> 3828\n<e7aead> 6670\n<e7aeb1> 5354\n<e7aeb4> 6530\n<e7aeb8> 6606\n<e7af80> 6690\n<e7af81> 7921\n<e7af84> 5016\n<e7af86> 6671\n<e7af87> 7522\n<e7af89> 7293\n<e7af92> 5729\n<e7afa0> 5523\n<e7afa4> 4316\n<e7afa9> 5282\n<e7b087> 6829\n<e7b092> 7068\n<e7b09e> 4206\n<e7b0a1> 3494\n<e7b0a7> 7922\n<e7b0aa> 6531\n<e7b0ab> 5524\n<e7b0bd> 7183\n<e7b0be> 4487\nendcidchar\n\n100 begincidchar\n<e7b0bf> 5131\n<e7b183> 4404\n<e7b18c> 6884\n<e7b18d> 6630\n<e7b1a0> 4541\n<e7b1a4> 7184\n<e7b1ac> 4628\n<e7b1b3> 4863\n<e7b283> 5207\n<e7b289> 5165\n<e7b292> 4655\n<e7b295> 4897\n<e7b297> 6811\n<e7b298> 6697\n<e7b29f> 5541\n<e7b2a5> 6901\n<e7b2a7> 6556\n<e7b2ae> 4433\n<e7b2b1> 4434\n<e7b2b2> 7070\n<e7b2b3> 3582\n<e7b2b9> 5600\n<e7b2be> 6742\n<e7b38a> 7827\n<e7b396> 4247\n<e7b39e> 5166\n<e7b39f> 6812\n<e7b3a0> 3548\n<e7b3a7> 4435\n<e7b3bb> 3721\n<e7b3be> 4003\n<e7b480> 4108\n<e7b482> 6885\n<e7b484> 5873\n<e7b485> 7859\n<e7b486> 6217\n<e7b487> 8025\n<e7b488> 7895\n<e7b48d> 4150\n<e7b490> 4184\n<e7b494> 5655\n<e7b497> 5283\n<e7b498> 3865\n<e7b499> 6964\n<e7b49a> 4056\n<e7b49b> 5167\n<e7b4a0> 5525\n<e7b4a1> 4957\n<e7b4a2> 5367\n<e7b4ab> 6500\n<e7b4ac> 6886\n<e7b4ae> 7081\n<e7b4af> 4571\n<e7b4b0> 5498\n<e7b4b3> 5747\n<e7b4b5> 6607\n<e7b4b9> 5526\n<e7b4ba> 3525\n<e7b582> 6846\n<e7b583> 7746\n<e7b584> 6813\n<e7b585> 3691\n<e7b586> 4924\n<e7b590> 3651\n<e7b59e> 3882\n<e7b5a1> 4385\n<e7b5a2> 7747\n<e7b5a6> 4057\n<e7b5a8> 6371\n<e7b5aa> 6454\n<e7b5ae> 5391\n<e7b5b1> 7457\n<e7b5b2> 5284\n<e7b5b3> 3549\n<e7b5b6> 6691\n<e7b5b9> 3641\n<e7b5bf> 3928\n<e7b68e> 6743\n<e7b68f> 5601\n<e7b693> 3692\n<e7b69c> 6847\n<e7b6a0> 4530\n<e7b6a2> 6887\n<e7b6ac> 5602\n<e7b6ad> 6340\n<e7b6b1> 3550\n<e7b6b2> 4701\n<e7b6b4> 7173\n<e7b6b5> 7121\n<e7b6b8> 4598\n<e7b6ba> 4109\n<e7b6bb> 7416\n<e7b6bd> 6517\n<e7b6be> 4610\n<e7b6bf> 4742\n<e7b787> 7351\n<e7b78a> 4126\n<e7b78b> 5208\n<e7b796> 5392\n<e7b798> 7658\nendcidchar\n\n100 begincidchar\n<e7b79a> 5435\n<e7b79d> 7034\n<e7b79e> 4207\n<e7b7a0> 7209\n<e7b7a1> 4881\n<e7b7a3> 5979\n<e7b7a8> 7523\n<e7b7a9> 6117\n<e7b7ac> 4743\n<e7b7af> 6297\n<e7b7b4> 4471\n<e7b7bb> 7352\n<e7b889> 7001\n<e7b88a> 5855\n<e7b895> 6087\n<e7b89b> 4898\n<e7b89d> 7002\n<e7b89e> 7828\n<e7b89f> 6171\n<e7b8a1> 6581\n<e7b8a3> 7748\n<e7b8ab> 5103\n<e7b8ae> 7294\n<e7b8af> 5980\n<e7b8b1> 6848\n<e7b8b7> 4572\n<e7b8bd> 7257\n<e7b8be> 6631\n<e7b981> 5001\n<e7b983> 5179\n<e7b986> 4826\n<e7b987> 6158\n<e7b992> 6938\n<e7b994> 6978\n<e7b995> 5436\n<e7b99e> 6159\n<e7b9a1> 5603\n<e7b9a9> 5689\n<e7b9aa> 7942\n<e7b9ab> 3722\n<e7b9ad> 3642\n<e7b9b0> 6814\n<e7b9b9> 5952\n<e7b9bc> 3723\n<e7ba82> 7069\n<e7ba8c> 5542\n<e7ba8f> 6672\n<e7ba93> 6023\n<e7ba96> 5466\n<e7ba98> 7071\n<e7ba9b> 4317\n<e7ba9c> 4405\n<e7bcb6> 5132\n<e7bcb8> 7681\n<e7bcba> 3652\n<e7bd8c> 5859\n<e7bd90> 3829\n<e7bd94> 4702\n<e7bd95> 7643\n<e7bdaa> 6859\n<e7bdab> 3854\n<e7bdae> 7353\n<e7bdb0> 5007\n<e7bdb2> 5393\n<e7bdb5> 4717\n<e7bdb7> 7486\n<e7bdb9> 4629\n<e7be85> 4377\n<e7be88> 4110\n<e7be8a> 5896\n<e7be8c> 3551\n<e7be8e> 4864\n<e7be94> 3750\n<e7be9a> 4497\n<e7be9e> 5604\n<e7bea4> 3955\n<e7bea8> 5437\n<e7bea9> 6405\n<e7beb2> 8054\n<e7beb8> 4630\n<e7beb9> 3583\n<e7bebd> 6218\n<e7bf81> 6095\n<e7bf85> 5711\n<e7bf8a> 6439\n<e7bf8c> 6440\n<e7bf8e> 4498\n<e7bf92> 5679\n<e7bf94> 5355\n<e7bf95> 8033\n<e7bf9f> 6632\n<e7bfa0> 7322\n<e7bfa1> 5209\n<e7bfa9> 7524\n<e7bfab> 6118\n<e7bfb0> 7644\n<e7bfb9> 3883\n<e7bfbc> 6441\n<e88080> 6160\n<e88081> 4519\nendcidchar\n\n100 begincidchar\n<e88083> 3751\n<e88085> 6501\n<e88086> 4111\n<e88089> 3929\n<e8808c> 6427\n<e88090> 4158\n<e88095> 3693\n<e88097> 4782\n<e88098> 6243\n<e880ad> 4112\n<e880b3> 6428\n<e880b6> 5870\n<e880bd> 7422\n<e880bf> 3694\n<e88183> 4227\n<e88186> 4499\n<e8818a> 4559\n<e88196> 5487\n<e88198> 5239\n<e8819a> 7323\n<e8819e> 4844\n<e881af> 4472\n<e881b0> 7258\n<e881b2> 5488\n<e881b3> 6191\n<e881b7> 6979\n<e881bd> 7200\n<e881be> 4542\n<e881bf> 6368\n<e88284> 6429\n<e88285> 5638\n<e88286> 5285\n<e88287> 6815\n<e88289> 6357\n<e8828b> 4605\n<e8828c> 4113\n<e88296> 7231\n<e8829b> 7682\n<e8829d> 3495\n<e882a1> 3752\n<e882a2> 6965\n<e882a5> 5210\n<e882a9> 3643\n<e882aa> 4958\n<e882af> 4061\n<e882b1> 3866\n<e882b2> 6358\n<e882b4> 7963\n<e882ba> 7540\n<e88383> 6298\n<e88384> 6865\n<e8838c> 4979\n<e8838e> 7440\n<e8839a> 4980\n<e8839b> 3533\n<e8839e> 7560\n<e883a1> 7829\n<e883a4> 6364\n<e883a5> 5394\n<e883b1> 3850\n<e883b4> 4345\n<e883b8> 8017\n<e883bd> 4185\n<e88482> 6966\n<e88485> 7766\n<e88486> 7324\n<e88487> 7767\n<e88488> 4722\n<e8848a> 7144\n<e88498> 6119\n<e8849a> 3472\n<e8849b> 3695\n<e884a3> 5656\n<e884a9> 5605\n<e884ab> 7419\n<e884af> 7561\n<e884b9> 7110\n<e884be> 5211\n<e8858b> 5856\n<e8858e> 5748\n<e88594> 3552\n<e88595> 6120\n<e885a5> 5489\n<e885a6> 4179\n<e885ab> 6849\n<e885b0> 6161\n<e885b1> 3608\n<e885b8> 6557\n<e885b9> 5082\n<e885ba> 5438\n<e885bf> 7461\n<e88680> 4959\n<e88688> 3634\n<e8868a> 4899\n<e8868f> 3753\n<e8869a> 5135\n<e8869c> 4667\n<e8869d> 5675\n<e886a0> 3884\n<e886a3> 7025\nendcidchar\n\n100 begincidchar\n<e886a8> 7516\n<e886b3> 5439\n<e886b5> 7313\n<e886ba> 6392\n<e886bd> 4228\n<e886be> 7943\n<e886bf> 4176\n<e88780> 4359\n<e88782> 5212\n<e88786> 5916\n<e8878d> 6771\n<e88798> 4410\n<e8879f> 6558\n<e887a3> 5749\n<e887a5> 6103\n<e887a7> 6559\n<e887a8> 4650\n<e887aa> 6502\n<e887ad> 7325\n<e887b3> 6967\n<e887b4> 7354\n<e887ba> 4261\n<e887bb> 7003\n<e887bc> 3930\n<e887be> 6341\n<e88885> 3931\n<e88887> 5941\n<e88888> 8034\n<e8888a> 3932\n<e8888c> 5456\n<e8888d> 5286\n<e88892> 5395\n<e8889b> 7158\n<e8889c> 5657\n<e8889e> 4827\n<e8889f> 6888\n<e888a1> 3553\n<e888aa> 7683\n<e888ab> 4960\n<e888ac> 4925\n<e888b5> 7390\n<e888b6> 4900\n<e888b7> 7749\n<e888b9> 5440\n<e88980> 5136\n<e88985> 5942\n<e88987> 6744\n<e88999> 7111\n<e889a4> 6406\n<e889a6> 7659\n<e889ae> 3496\n<e889af> 4436\n<e889b1> 3497\n<e889b2> 5368\n<e889b6> 5994\n<e889b8> 7232\n<e889be> 5848\n<e88a8b> 6219\n<e88a8d> 6518\n<e88a8e> 3967\n<e88a92> 4703\n<e88a99> 5137\n<e88a9a> 4360\n<e88a9d> 6968\n<e88a9f> 5324\n<e88aa5> 3575\n<e88aa6> 7830\n<e88aa9> 4046\n<e88aac> 5168\n<e88aad> 7487\n<e88aae> 6039\n<e88aaf> 5769\n<e88ab1> 7871\n<e88ab3> 4961\n<e88ab7> 6969\n<e88ab8> 6244\n<e88ab9> 4032\n<e88abb> 7274\n<e88abc> 4783\n<e88abd> 5783\n<e88abf> 6482\n<e88b91> 6274\n<e88b92> 5995\n<e88b94> 7441\n<e88b95> 7233\n<e88b97> 4810\n<e88b9b> 3455\n<e88b9e> 7562\n<e88b9f> 3933\n<e88ba1> 6430\n<e88ba5> 5874\n<e88ba6> 3754\n<e88ba7> 6608\n<e88bb1> 6024\n<e88bbd> 3755\n<e88bbe> 7612\n<e88c81> 6921\n<e88c82> 4828\n<e88c83> 5017\n<e88c84> 3456\nendcidchar\n\n100 begincidchar\n<e88c85> 4784\n<e88c89> 4693\n<e88c97> 4757\n<e88ca8> 6503\n<e88cab> 4704\n<e88caf> 5083\n<e88cb1> 5606\n<e88cb4> 7944\n<e88cb5> 6455\n<e88cb6> 4191\n<e88cb8> 6192\n<e88cb9> 5943\n<e88d80> 5658\n<e88d87> 7708\n<e88d89> 7234\n<e88d8a> 7784\n<e88d8f> 6475\n<e88d91> 6431\n<e88d92> 7923\n<e88db3> 4354\n<e88db7> 7624\n<e88dbb> 6633\n<e88e89> 4631\n<e88e8a> 6560\n<e88e8e> 5287\n<e88e96> 3696\n<e88e98> 5750\n<e88e9e> 6121\n<e88ea2> 7768\n<e88ea9> 5138\n<e88eaa> 5784\n<e88eab> 4668\n<e88ebd> 4705\n<e88f81> 7201\n<e88f85> 3830\n<e88f89> 4531\n<e88f8a> 3949\n<e88f8c> 4013\n<e88f93> 3808\n<e88f96> 7112\n<e88f9c> 7122\n<e88fa9> 5069\n<e88fab> 4033\n<e88faf> 7872\n<e88fb0> 3756\n<e88fb1> 4611\n<e88fb2> 5213\n<e88fb4> 5827\n<e88fb9> 6609\n<e88fbd> 5639\n<e89083> 7314\n<e89084> 4297\n<e8908a> 4423\n<e8908c> 4732\n<e8908d> 7532\n<e8908e> 6299\n<e890a9> 7275\n<e890ac> 4683\n<e890b1> 7993\n<e890b8> 6342\n<e890bd> 4386\n<e89189> 6001\n<e89197> 6610\n<e8919b> 3506\n<e891a1> 7563\n<e891a3> 4346\n<e891a6> 6300\n<e891ab> 7831\n<e891ac> 6561\n<e891af> 5875\n<e891b5> 4004\n<e891ba> 6930\n<e89290> 5607\n<e89294> 5712\n<e89299> 4799\n<e8929c> 5312\n<e892a1> 4962\n<e892b2> 7564\n<e892b8> 6939\n<e892bb> 5876\n<e892bc> 7113\n<e892bf> 7832\n<e89380> 5549\n<e89382> 4758\n<e89384> 7295\n<e89386> 5415\n<e89389> 6193\n<e8938b> 3576\n<e8938d> 5713\n<e89391> 5288\n<e8939a> 5608\n<e893ac> 5104\n<e893ae> 4473\n<e893b4> 5659\n<e893bc> 4560\n<e89491> 4747\n<e89493> 4684\n<e89494> 5084\n<e89497> 6504\n<e89498> 5325\nendcidchar\n\n100 begincidchar\n<e8949a> 6250\n<e8949e> 4573\n<e894a1> 7123\n<e894a3> 6562\n<e894a5> 7259\n<e894ac> 5527\n<e894ad> 6383\n<e894af> 7004\n<e894bd> 7541\n<e894bf> 6301\n<e89581> 4229\n<e89583> 5002\n<e89589> 7235\n<e8958e> 3885\n<e89593> 6245\n<e89599> 7796\n<e895a3> 5660\n<e895a8> 3981\n<e895a9> 7430\n<e895aa> 4829\n<e895ad> 5528\n<e89684> 4901\n<e89687> 4865\n<e8968f> 6407\n<e89691> 3554\n<e89694> 6563\n<e8969b> 5457\n<e896a6> 7159\n<e896a8> 7989\n<e896a9> 5319\n<e896aa> 5751\n<e896af> 5396\n<e896b0> 7986\n<e896ba> 6772\n<e89781> 3757\n<e89789> 6505\n<e8978d> 4406\n<e8978e> 5752\n<e8978f> 6564\n<e89795> 6220\n<e8979c> 4451\n<e8979d> 6040\n<e897a4> 4370\n<e897a5> 5877\n<e897a9> 5003\n<e897aa> 5609\n<e897b7> 6611\n<e897ba> 4642\n<e897bb> 6816\n<e897bf> 3817\n<e89882> 6041\n<e89886> 4520\n<e89887> 5529\n<e8988a> 6088\n<e89896> 5924\n<e89897> 5028\n<e8989a> 5441\n<e898ad> 4395\n<e898bf> 4378\n<e8998e> 7833\n<e89990> 7632\n<e89994> 3609\n<e89995> 7133\n<e8999b> 7721\n<e8999c> 4521\n<e8999e> 6221\n<e8999f> 7834\n<e899a7> 8009\n<e899b9> 7860\n<e89a8a> 4845\n<e89a8c> 4963\n<e89a93> 6456\n<e89aa3> 3799\n<e89aa4> 6817\n<e89aa9> 7355\n<e89b87> 5289\n<e89b8b> 4208\n<e89b94> 7945\n<e89b99> 6104\n<e89b9b> 6889\n<e89b9f> 3886\n<e89ba4> 7666\n<e89bad> 7026\n<e89bbe> 5785\n<e89c80> 7245\n<e89c82> 5105\n<e89c83> 5753\n<e89c88> 6074\n<e89c98> 6970\n<e89c9a> 5214\n<e89c9c> 4884\n<e89d8e> 3508\n<e89d95> 5730\n<e89d97> 7924\n<e89d9f> 6302\n<e89da6> 7625\n<e89da8> 5676\n<e89db4> 7835\n<e89db6> 6703\n<e89db8> 6105\nendcidchar\n\n100 begincidchar\n<e89e82> 4418\n<e89e8d> 6372\n<e89e9f> 4759\n<e89ea2> 7785\n<e89eb3> 4248\n<e89eba> 4379\n<e89f84> 7376\n<e89fa0> 4926\n<e89fac> 5442\n<e89faf> 6162\n<e89fb2> 7309\n<e89fb9> 7696\n<e89fbb> 6408\n<e89fbe> 5467\n<e8a085> 5690\n<e8a09f> 4411\n<e8a0a2> 6916\n<e8a0a3> 4452\n<e8a0b1> 3758\n<e8a0b6> 6532\n<e8a0bb> 4685\n<e8a180> 7756\n<e8a186> 6924\n<e8a18c> 7709\n<e8a18d> 5981\n<e8a192> 7750\n<e8a193> 5668\n<e8a197> 3457\n<e8a199> 5786\n<e8a19b> 6303\n<e8a19d> 7310\n<e8a1a1> 7786\n<e8a1a2> 3934\n<e8a1a3> 6409\n<e8a1a8> 7585\n<e8a1ab> 5326\n<e8a1b0> 5565\n<e8a1b2> 4151\n<e8a1b7> 7311\n<e8a281> 6275\n<e8a282> 4763\n<e8a288> 3458\n<e8a28b> 4262\n<e8a28d> 7565\n<e8a292> 4209\n<e8a296> 5610\n<e8a297> 7005\n<e8a29e> 3782\n<e8a2ab> 7601\n<e8a2b4> 3759\n<e8a381> 6582\n<e8a382> 4482\n<e8a38f> 4632\n<e8a394> 6042\n<e8a395> 6343\n<e8a399> 3956\n<e8a39c> 5070\n<e8a39d> 6565\n<e8a39f> 5290\n<e8a3a1> 4633\n<e8a3a8> 5215\n<e8a3b3> 5356\n<e8a3b8> 4380\n<e8a3bd> 6773\n<e8a487> 5085\n<e8a490> 3507\n<e8a492> 7566\n<e8a493> 5071\n<e8a498> 6304\n<e8a499> 4983\n<e8a4a5> 6172\n<e8a4aa> 7462\n<e8a4b6> 5680\n<e8a4b8> 4574\n<e8a4bb> 5458\n<e8a581> 3555\n<e8a584> 5897\n<e8a59f> 4049\n<e8a5a4> 4407\n<e8a5aa> 4694\n<e8a5b2> 5681\n<e8a5bf> 5397\n<e8a681> 6163\n<e8a683> 4230\n<e8a686> 5086\n<e8a687> 7511\n<e8a68b> 3644\n<e8a68f> 4005\n<e8a693> 4734\n<e8a696> 5714\n<e8a6a1> 3635\n<e8a6a9> 4298\n<e8a6aa> 7363\n<e8a6b2> 4034\n<e8a6ba> 3473\n<e8a6bd> 4408\n<e8a780> 3831\n<e8a792> 3474\n<e8a7a3> 7697\n<e8a7b4> 5357\nendcidchar\n\n100 begincidchar\n<e8a7b8> 7246\n<e8a880> 5921\n<e8a882> 6745\n<e8a883> 5139\n<e8a888> 3724\n<e8a88a> 5754\n<e8a88c> 7861\n<e8a88e> 7452\n<e8a893> 7987\n<e8a896> 8026\n<e8a897> 7406\n<e8a898> 4114\n<e8a89b> 6106\n<e8a89d> 5787\n<e8a89f> 5557\n<e8a8a3> 3653\n<e8a8a5> 4182\n<e8a8aa> 4964\n<e8a8ad> 5459\n<e8a8b1> 7722\n<e8a8b4> 5530\n<e8a8b6> 3459\n<e8a8ba> 7006\n<e8a8bb> 6890\n<e8a990> 5291\n<e8a994> 6818\n<e8a995> 7533\n<e8a99b> 6612\n<e8a99e> 5292\n<e8a9a0> 6025\n<e8a9a2> 5661\n<e8a9a3> 6043\n<e8a9a6> 5715\n<e8a9a9> 5716\n<e8a9ad> 3987\n<e8a9ae> 6673\n<e8a9b0> 8055\n<e8a9b1> 7873\n<e8a9b2> 7698\n<e8a9b3> 5358\n<e8a9b5> 5443\n<e8a9b9> 7185\n<e8aa85> 6891\n<e8aa87> 3809\n<e8aa8c> 6971\n<e8aa8d> 6457\n<e8aa93> 5398\n<e8aa95> 7417\n<e8aa98> 6344\n<e8aa9e> 5908\n<e8aaa0> 5490\n<e8aaa1> 3725\n<e8aaa3> 4830\n<e8aaa4> 6075\n<e8aaa5> 3760\n<e8aaa6> 5558\n<e8aaa8> 7946\n<e8aaaa> 5460\n<e8aab0> 5611\n<e8aab2> 3810\n<e8aab9> 5216\n<e8aabc> 6410\n<e8aabe> 6377\n<e8aabf> 6819\n<e8ab82> 7186\n<e8ab84> 5662\n<e8ab87> 4231\n<e8ab8b> 7202\n<e8ab8d> 6589\n<e8ab8f> 7276\n<e8ab92> 4437\n<e8ab96> 4535\n<e8ab9b> 6345\n<e8ab9c> 7194\n<e8aba1> 5717\n<e8aba6> 7210\n<e8aba7> 7699\n<e8abaa> 6746\n<e8abab> 3498\n<e8abad> 6346\n<e8abae> 6506\n<e8abb1> 8002\n<e8abb6> 5770\n<e8abb7> 7593\n<e8abb8> 6774\n<e8abba> 5922\n<e8abbe> 4139\n<e8ac80> 4785\n<e8ac81> 5818\n<e8ac82> 6305\n<e8ac84> 4371\n<e8ac8e> 4866\n<e8ac90> 4885\n<e8ac94> 7633\n<e8ac96> 5543\n<e8ac97> 4965\n<e8ac99> 3657\n<e8ac9a> 6442\n<e8ac9b> 3556\n<e8ac9d> 5293\nendcidchar\n\n100 begincidchar\n<e8aca0> 6164\n<e8aca8> 4786\n<e8acab> 6634\n<e8acac> 4589\n<e8acb3> 3935\n<e8acb9> 4035\n<e8ad81> 7874\n<e8ad89> 6940\n<e8ad8e> 8011\n<e8ad8f> 4115\n<e8ad98> 5731\n<e8ad9a> 4232\n<e8ad9c> 5072\n<e8ada6> 3697\n<e8adac> 5217\n<e8adaf> 5953\n<e8adb0> 6411\n<e8adb4> 3645\n<e8adb7> 7836\n<e8adbd> 6044\n<e8ae80> 4318\n<e8ae8a> 5033\n<e8ae90> 5612\n<e8ae92> 7090\n<e8ae93> 5898\n<e8ae96> 7091\n<e8ae9a> 7072\n<e8b0b7> 3772\n<e8b0bf> 3726\n<e8b181> 7902\n<e8b186> 4355\n<e8b188> 4116\n<e8b18a> 7594\n<e8b18c> 6122\n<e8b195> 5718\n<e8b19a> 4327\n<e8b1a1> 5359\n<e8b1aa> 7837\n<e8b1ab> 6045\n<e8b1b9> 7586\n<e8b1ba> 5719\n<e8b282> 7236\n<e8b28a> 4723\n<e8b28c> 4787\n<e8b29d> 7512\n<e8b29e> 6747\n<e8b2a0> 5140\n<e8b2a1> 6583\n<e8b2a2> 3800\n<e8b2a7> 5234\n<e8b2a8> 7875\n<e8b2a9> 7495\n<e8b2aa> 7423\n<e8b2ab> 3832\n<e8b2ac> 7129\n<e8b2af> 6613\n<e8b2b0> 5499\n<e8b2b3> 6433\n<e8b2b4> 3992\n<e8b2b6> 7528\n<e8b2b7> 4718\n<e8b2b8> 4263\n<e8b2bb> 5218\n<e8b2bc> 7195\n<e8b2bd> 6432\n<e8b2bf> 4831\n<e8b380> 7626\n<e8b381> 5169\n<e8b382> 4547\n<e8b383> 6476\n<e8b384> 7947\n<e8b387> 6507\n<e8b388> 3460\n<e8b38a> 6635\n<e8b391> 7007\n<e8b393> 5235\n<e8b39a> 4548\n<e8b39c> 5294\n<e8b39e> 5360\n<e8b3a0> 4984\n<e8b3a2> 7751\n<e8b3a3> 4719\n<e8b3a4> 7160\n<e8b3a6> 5141\n<e8b3aa> 7027\n<e8b3ad> 4299\n<e8b3b4> 4549\n<e8b3bb> 5142\n<e8b3bc> 3936\n<e8b3bd> 5364\n<e8b484> 6972\n<e8b485> 7315\n<e8b487> 6365\n<e8b488> 6941\n<e8b48a> 7073\n<e8b48d> 5468\n<e8b493> 6566\n<e8b496> 5544\n<e8b5a4> 6636\n<e8b5a6> 5295\nendcidchar\n\n100 begincidchar\n<e8b5ab> 7732\n<e8b5b0> 6892\n<e8b5b3> 4006\n<e8b5b4> 5143\n<e8b5b7> 4117\n<e8b685> 7237\n<e8b68a> 6282\n<e8b699> 6820\n<e8b6a3> 7326\n<e8b6a8> 7277\n<e8b6b3> 6830\n<e8b6ba> 5144\n<e8b6be> 6973\n<e8b786> 7442\n<e8b78b> 4936\n<e8b78c> 7028\n<e8b78f> 3461\n<e8b79b> 7488\n<e8b79d> 3596\n<e8b7a1> 6637\n<e8b7a3> 5444\n<e8b7a8> 3811\n<e8b7af> 4522\n<e8b7b3> 4300\n<e8b88a> 6194\n<e8b88f> 4237\n<e8b890> 7161\n<e8b89e> 3597\n<e8b8aa> 6850\n<e8b8b0> 6347\n<e8b8b5> 6851\n<e8b982> 6348\n<e8b984> 6775\n<e8b987> 3610\n<e8b988> 4301\n<e8b989> 7052\n<e8b98a> 7797\n<e8b999> 7296\n<e8b99f> 6638\n<e8b9a0> 7145\n<e8b9b4> 7297\n<e8b9b6> 3982\n<e8ba81> 6821\n<e8ba87> 6614\n<e8ba8a> 6893\n<e8ba8d> 5878\n<e8baaa> 4643\n<e8baab> 5755\n<e8baac> 3968\n<e8bb80> 3937\n<e8bb8a> 7053\n<e8bb8b> 5819\n<e8bb8c> 3988\n<e8bb8d> 3957\n<e8bb92> 7726\n<e8bb9f> 5982\n<e8bbab> 7008\n<e8bbb8> 7298\n<e8bbbb> 3462\n<e8bbbe> 5732\n<e8bc83> 3887\n<e8bc85> 4523\n<e8bc89> 6584\n<e8bc92> 7196\n<e8bc93> 4686\n<e8bc94> 5073\n<e8bc95> 3698\n<e8bc9b> 4438\n<e8bc9c> 7356\n<e8bc9d> 8003\n<e8bc9e> 4706\n<e8bc9f> 7174\n<e8bca6> 4474\n<e8bca7> 5055\n<e8bca9> 4985\n<e8bcaa> 4599\n<e8bcaf> 7035\n<e8bcb3> 6894\n<e8bcb8> 5613\n<e8bcb9> 5087\n<e8bcbb> 5088\n<e8bcbe> 6674\n<e8bcbf> 5944\n<e8bd84> 7650\n<e8bd85> 6276\n<e8bd89> 6675\n<e8bd8d> 7175\n<e8bd8e> 3888\n<e8bd9d> 5945\n<e8bd9f> 3867\n<e8bda2> 4463\n<e8be9b> 5756\n<e8be9c> 3761\n<e8bea3> 4398\n<e8bea6> 7496\n<e8bea8> 5034\n<e8bead> 5296\n<e8beaf> 5035\n<e8beb0> 7009\n<e8beb1> 6173\nendcidchar\n\n100 begincidchar\n<e8beb2> 4177\n<e8bf82> 6222\n<e8bf85> 5757\n<e8bf8e> 6026\n<e8bf91> 4036\n<e8bf94> 4927\n<e8bfa6> 3463\n<e8bfaa> 6639\n<e8bfab> 4902\n<e8bfad> 7029\n<e8bfb0> 5669\n<e8bfb2> 3626\n<e8bfb7> 4867\n<e8bfb9> 6640\n<e8bfbd> 7278\n<e98080> 7463\n<e98081> 5559\n<e98082> 3838\n<e98083> 4302\n<e98085> 7978\n<e98086> 5954\n<e98088> 7787\n<e9808b> 7567\n<e9808d> 5531\n<e9808f> 7469\n<e98090> 7299\n<e98091> 3938\n<e98094> 4303\n<e98095> 3699\n<e98097> 4356\n<e98099> 6615\n<e9809a> 7458\n<e9809d> 5399\n<e9809e> 4500\n<e9809f> 5545\n<e980a0> 6822\n<e980a1> 6917\n<e980a2> 5106\n<e980a3> 4475\n<e980ae> 7211\n<e980b1> 6895\n<e980b2> 7010\n<e980b5> 4007\n<e980b8> 6466\n<e980bc> 7615\n<e980be> 6350\n<e98181> 4361\n<e98182> 5614\n<e98187> 6223\n<e9818a> 6349\n<e9818b> 6246\n<e9818d> 7525\n<e9818e> 3812\n<e98190> 7627\n<e98191> 7925\n<e98193> 4304\n<e98194> 4216\n<e98195> 6306\n<e98199> 6165\n<e9819c> 5550\n<e9819d> 4238\n<e9819e> 7212\n<e981a0> 6277\n<e981a1> 5532\n<e981a3> 3646\n<e981a9> 6641\n<e981ad> 6823\n<e981ae> 7054\n<e981af> 4362\n<e981b2> 6974\n<e981b5> 6918\n<e981b7> 7162\n<e981b8> 5445\n<e981ba> 6351\n<e981bc> 4561\n<e981bd> 3598\n<e981bf> 7602\n<e98280> 6166\n<e98281> 4720\n<e98282> 7700\n<e98283> 5615\n<e98284> 7896\n<e98287> 6434\n<e98288> 4669\n<e9828a> 5036\n<e9828f> 4381\n<e98291> 6389\n<e98295> 6096\n<e98299> 4707\n<e982a2> 7788\n<e982a3> 4138\n<e982a6> 4966\n<e982a8> 7250\n<e982aa> 5297\n<e982af> 3526\n<e982b0> 7443\n<e982b1> 3939\n<e982b5> 5533\n<e982b8> 6616\n<e98381> 6236\nendcidchar\n\n100 begincidchar\n<e9838a> 3889\n<e9839e> 4419\n<e983a1> 3958\n<e983a8> 5145\n<e983ad> 3818\n<e983b5> 6224\n<e983bd> 4305\n<e98482> 5802\n<e98492> 7279\n<e98495> 7714\n<e98499> 5219\n<e984a7> 4372\n<e984ad> 6748\n<e984b2> 4210\n<e98589> 6352\n<e9858a> 6749\n<e9858b> 7280\n<e9858c> 6519\n<e9858d> 4986\n<e9858e> 6896\n<e98592> 6897\n<e985a2> 7238\n<e985a9> 4760\n<e985aa> 4387\n<e985ac> 5616\n<e985b5> 7964\n<e985b7> 7843\n<e985b8> 5313\n<e98687> 5663\n<e98689> 7327\n<e9868b> 7239\n<e9868d> 6776\n<e98692> 5491\n<e9869c> 7281\n<e986ab> 6412\n<e986ac> 6567\n<e986ae> 7240\n<e986af> 7798\n<e986b1> 4937\n<e986b4> 4509\n<e986b5> 3584\n<e98780> 5899\n<e98787> 7124\n<e98789> 6353\n<e9878b> 5416\n<e9878c> 4634\n<e9878d> 6925\n<e9878e> 5871\n<e9878f> 4439\n<e98790> 4635\n<e98791> 4131\n<e98797> 5566\n<e98798> 6750\n<e9879c> 5146\n<e9879d> 7374\n<e987a3> 6824\n<e987a7> 7163\n<e987aa> 6225\n<e987b5> 7125\n<e9888d> 4363\n<e98890> 3622\n<e98891> 7497\n<e98892> 5329\n<e98897> 6366\n<e9889e> 4014\n<e988b4> 4501\n<e988ba> 6082\n<e988bf> 6676\n<e98980> 3534\n<e98985> 3599\n<e98989> 7752\n<e98997> 3658\n<e9899b> 5983\n<e9899e> 6283\n<e989a2> 4938\n<e989a4> 3940\n<e989a5> 5670\n<e989a6> 6751\n<e98a80> 6378\n<e98a83> 7260\n<e98a85> 4347\n<e98a91> 5446\n<e98a93> 6677\n<e98a96> 5617\n<e98a98> 4761\n<e98a9c> 7660\n<e98ab3> 6046\n<e98ab6> 3941\n<e98ab7> 5534\n<e98ab9> 5618\n<e98b8c> 6752\n<e98b8f> 7769\n<e98b92> 5107\n<e98ba4> 5400\n<e98baa> 7568\n<e98bb8> 3600\n<e98bbc> 3557\n<e98c84> 4532\n<e98c90> 7282\n<e98c98> 7283\nendcidchar\n\n100 begincidchar\n<e98c9a> 6590\n<e98c9e> 5664\n<e98c9f> 4233\n<e98ca0> 6753\n<e98ca1> 4118\n<e98ca2> 6678\n<e98ca4> 4119\n<e98ca6> 4050\n<e98ca8> 4811\n<e98cab> 5417\n<e98cae> 3762\n<e98caf> 7059\n<e98d88> 6027\n<e98d8a> 4476\n<e98d8b> 3813\n<e98d8d> 4306\n<e98d94> 5803\n<e98d9b> 4211\n<e98dae> 6354\n<e98db5> 3611\n<e98dbc> 7375\n<e98dbe> 6852\n<e98e8c> 3659\n<e98e94> 6195\n<e98e96> 5564\n<e98e9a> 7284\n<e98ea3> 7789\n<e98ea7> 3577\n<e98eac> 7838\n<e98ead> 7011\n<e98eb0> 6467\n<e98f83> 6831\n<e98f91> 6642\n<e98f9e> 6196\n<e98fa1> 3700\n<e98fa4> 4575\n<e98fb6> 7036\n<e99084> 7952\n<e99098> 6853\n<e990a5> 5447\n<e990ab> 6679\n<e990b5> 7176\n<e990b8> 7407\n<e99184> 6898\n<e9919b> 3851\n<e991bd> 7074\n<e991bf> 7060\n<e995b7> 6568\n<e99680> 4846\n<e99683> 5469\n<e99689> 7542\n<e9968b> 3578\n<e9968f> 6367\n<e99693> 3499\n<e99694> 4882\n<e99698> 3535\n<e996a3> 3475\n<e996a4> 7667\n<e996a5> 5008\n<e996a8> 4008\n<e996ad> 4453\n<e996b1> 5988\n<e996bb> 5996\n<e996bc> 5820\n<e99787> 5828\n<e9978a> 7903\n<e99794> 7668\n<e99795> 3983\n<e99796> 7473\n<e9979c> 3833\n<e997a1> 7164\n<e997a2> 5029\n<e9989c> 5147\n<e998a1> 7165\n<e998aa> 7498\n<e998ae> 6123\n<e998b2> 4967\n<e998bb> 6825\n<e998bf> 5788\n<e99980> 7391\n<e99982> 7603\n<e99984> 5148\n<e9998b> 4576\n<e9998c> 4724\n<e9998d> 3558\n<e99990> 7647\n<e9999b> 7543\n<e9999c> 7669\n<e9999d> 5470\n<e9999e> 5691\n<e9999f> 7146\n<e999a2> 6278\n<e999a3> 7012\n<e999a4> 6777\n<e999aa> 4987\n<e999b0> 6384\n<e999b3> 7013\n<e999b5> 4612\n<e999b6> 4307\n<e999b7> 7661\nendcidchar\n\n100 begincidchar\n<e999b8> 4593\n<e999bd> 5900\n<e99a85> 6226\n<e99a86> 4603\n<e99a8a> 4264\n<e99a8b> 5619\n<e99a8d> 7926\n<e99a8e> 3727\n<e99a94> 3636\n<e99a95> 6247\n<e99a98> 5849\n<e99a99> 4022\n<e99a9b> 6778\n<e99a9c> 6569\n<e99aa3> 4644\n<e99aaa> 7728\n<e99ab1> 6379\n<e99ab7> 4510\n<e99abb> 7147\n<e99b80> 6520\n<e99b81> 5813\n<e99b84> 6254\n<e99b85> 5789\n<e99b86> 7037\n<e99b87> 3763\n<e99b89> 7357\n<e99b8b> 6919\n<e99b8c> 6508\n<e99b8d> 6097\n<e99b8e> 6617\n<e99b95> 6826\n<e99b96> 5622\n<e99b99> 5773\n<e99b9b> 7285\n<e99b9c> 6533\n<e99ba2> 4636\n<e99ba3> 4142\n<e99baa> 5461\n<e99baf> 4847\n<e99bb0> 5170\n<e99bb2> 6248\n<e99bb6> 4502\n<e99bb7> 4550\n<e99bb9> 4903\n<e99bbb> 6680\n<e99c80> 5623\n<e99c86> 6754\n<e99c87> 7014\n<e99c91> 6698\n<e99c93> 6047\n<e99c96> 4651\n<e99c99> 6028\n<e99c9c> 5361\n<e99c9e> 7628\n<e99ca7> 4832\n<e99cb0> 5314\n<e99cb2> 4524\n<e99cb9> 5030\n<e99cbd> 6779\n<e99d82> 4464\n<e99d84> 5850\n<e99d88> 4503\n<e99d91> 7203\n<e99d96> 6755\n<e99d9c> 6756\n<e99d9e> 5220\n<e99da1> 4868\n<e99da2> 4744\n<e99da9> 7733\n<e99dad> 6458\n<e99db4> 7876\n<e99db7> 6459\n<e99dba> 4695\n<e99e8b> 7799\n<e99e8d> 5814\n<e99e8f> 3801\n<e99ea0> 3950\n<e99ea8> 3509\n<e99eab> 3951\n<e99ead> 7526\n<e99f86> 7166\n<e99f8b> 6307\n<e99f93> 7648\n<e99f9c> 4308\n<e99fb3> 6385\n<e99fb6> 5535\n<e99fbb> 6249\n<e99fbf> 7715\n<e9a080> 7839\n<e9a081> 7757\n<e9a082> 6757\n<e9a083> 3701\n<e9a085> 7684\n<e9a086> 5665\n<e9a088> 5624\n<e9a08a> 6237\n<e9a08c> 5560\n<e9a090> 6048\n<e9a091> 6124\n<e9a092> 4928\nendcidchar\n\n100 begincidchar\n<e9a093> 4328\n<e9a097> 7489\n<e9a098> 4504\n<e9a0ad> 4357\n<e9a0b0> 7770\n<e9a0b8> 3702\n<e9a0b9> 7464\n<e9a0bb> 5236\n<e9a186> 3814\n<e9a18c> 6780\n<e9a18d> 5857\n<e9a18e> 5804\n<e9a194> 5815\n<e9a198> 6279\n<e9a19a> 6681\n<e9a19e> 4590\n<e9a1a5> 7840\n<e9a1a7> 3764\n<e9a1ab> 6682\n<e9a1af> 7753\n<e9a2a8> 7595\n<e9a2af> 5330\n<e9a2b1> 7444\n<e9a384> 7588\n<e9a387> 7587\n<e9a39b> 5221\n<e9a39c> 5004\n<e9a39f> 5733\n<e9a3a1> 5551\n<e9a3a2> 4120\n<e9a3ad> 7362\n<e9a3ae> 6386\n<e9a3af> 4929\n<e9a3b4> 6435\n<e9a3bc> 5298\n<e9a3bd> 7569\n<e9a3be> 5734\n<e9a483> 3890\n<e9a489> 7716\n<e9a48a> 5901\n<e9a48c> 6436\n<e9a490> 7075\n<e9a493> 5790\n<e9a498> 5946\n<e9a49e> 6683\n<e9a4a0> 5056\n<e9a4a8> 3834\n<e9a585> 4687\n<e9a589> 4037\n<e9a58b> 3989\n<e9a58c> 7076\n<e9a58d> 5448\n<e9a591> 4121\n<e9a592> 6167\n<e9a594> 6098\n<e9a597> 7717\n<e9a696> 5625\n<e9a699> 7718\n<e9a69d> 7613\n<e9a6a5> 5089\n<e9a6a8> 7790\n<e9a6ac> 4661\n<e9a6ad> 5909\n<e9a6ae> 7596\n<e9a6b1> 7392\n<e9a6b3> 7358\n<e9a6b4> 5666\n<e9a6b9> 6468\n<e9a781> 4904\n<e9a790> 6899\n<e9a791> 4174\n<e9a792> 3942\n<e9a795> 3464\n<e9a799> 5149\n<e9a79d> 7393\n<e9a79f> 5299\n<e9a7ad> 7701\n<e9a7b1> 4388\n<e9a7bf> 6920\n<e9a881> 5240\n<e9a888> 5057\n<e9a899> 7527\n<e9a8ab> 3612\n<e9a8b0> 4373\n<e9a8b6> 7286\n<e9a8b7> 5536\n<e9a980> 4725\n<e9a983> 7589\n<e9a985> 3943\n<e9a98d> 7965\n<e9a995> 3891\n<e9a997> 7729\n<e9a99a> 3703\n<e9a99b> 5955\n<e9a99f> 7328\n<e9a9a2> 4454\n<e9a9a5> 4124\n<e9a9a9> 7897\n<e9a9aa> 4455\n<e9aaa8> 3785\nendcidchar\n\n100 begincidchar\n<e9aab8> 7702\n<e9ab93> 5626\n<e9ab94> 7213\n<e9ab98> 3765\n<e9aba5> 5997\n<e9abae> 4939\n<e9ac9a> 5627\n<e9aca7> 4562\n<e9acaa> 7470\n<e9acb1> 6251\n<e9acbc> 3993\n<e9ad81> 3863\n<e9ad82> 7849\n<e9ad83> 4940\n<e9ad84> 4995\n<e9ad85> 4721\n<e9ad8f> 6308\n<e9ad94> 4662\n<e9ad9a> 5910\n<e9adaf> 4525\n<e9ae8e> 6699\n<e9ae91> 7570\n<e9ae9f> 5816\n<e9aeab> 3892\n<e9aeae> 5449\n<e9af89> 4637\n<e9af96> 7204\n<e9afa4> 3783\n<e9afa8> 3704\n<e9b08d> 7287\n<e9b090> 5805\n<e9b092> 5090\n<e9b095> 7629\n<e9b0a5> 7898\n<e9b0b2> 6076\n<e9b0bb> 4688\n<e9b187> 3559\n<e9b189> 5039\n<e9b197> 4645\n<e9b3a5> 6827\n<e9b3a7> 5150\n<e9b3a9> 3944\n<e9b3b3> 5108\n<e9b3b4> 4762\n<e9b3b6> 5984\n<e9b489> 5791\n<e9b49b> 6280\n<e9b4a6> 5839\n<e9b4a8> 5832\n<e9b4bb> 7862\n<e9b591> 3647\n<e9b59d> 5792\n<e9b5a0> 3773\n<e9b5a1> 4833\n<e9b5ac> 5180\n<e9b5b2> 6521\n<e9b6a9> 4794\n<e9b6af> 5860\n<e9b6b4> 7634\n<e9b784> 3728\n<e9b797> 3945\n<e9b7b2> 7329\n<e9b7b8> 8012\n<e9b7b9> 6393\n<e9b7ba> 4526\n<e9b89a> 5861\n<e9b89e> 4396\n<e9b9b5> 4527\n<e9b9b9> 7662\n<e9b9bd> 5998\n<e9b9bf> 4533\n<e9ba92> 4125\n<e9ba93> 4534\n<e9ba97> 4456\n<e9ba9d> 5300\n<e9ba9f> 4646\n<e9baa5> 4726\n<e9bab4> 3952\n<e9bab5> 4745\n<e9babb> 4663\n<e9babe> 8004\n<e9bb83> 7927\n<e9bb8d> 5401\n<e9bb8e> 4457\n<e9bb91> 8018\n<e9bb94> 3623\n<e9bb98> 4835\n<e9bb9b> 4265\n<e9bb9c> 7305\n<e9bb9e> 6700\n<e9bba8> 4249\n<e9bbb4> 4869\n<e9bc87> 6077\n<e9bc88> 5040\n<e9bc8e> 6758\n<e9bc93> 3766\n<e9bca0> 5402\n<e9bcbb> 5222\n<e9bd8a> 6781\n<e9bd8b> 6585\nendcidchar\n\n100 begincidchar\n<e9bd8e> 6586\n<e9bd92> 7359\n<e9bd9f> 6618\n<e9bda1> 4505\n<e9bda7> 5462\n<e9bdaa> 7061\n<e9bdac> 5911\n<e9bdb7> 5806\n<e9be8d> 4563\n<e9be90> 4968\n<e9be95> 3529\n<e9be9c> 3946\n<eab084> 1088\n<eab098> 9342\n<eab0a0> 1106\n<eab0a4> 1107\n<eab0ae> 9355\n<eab0bc> 1115\n<eab180> 1116\n<eab18b> 1117\n<eab18c> 9377\n<eab18d> 1118\n<eab194> 1119\n<eab198> 1120\n<eab19c> 1121\n<eab1b4> 1124\n<eab1b9> 9413\n<eab1ba> 1127\n<eab282> 9419\n<eab290> 1138\n<eab294> 1139\n<eab29e> 9435\n<eab2ab> 9442\n<eab2ac> 1148\n<eab2ba> 9452\n<eab380> 9455\n<eab381> 1156\n<eab384> 1157\n<eab388> 1158\n<eab38c> 1159\n<eab395> 1160\n<eab396> 9472\n<eab397> 1161\n<eab3a4> 1164\n<eab3a9> 9485\n<eab3aa> 1167\n<eab3ab> 9486\n<eab3ac> 1168\n<eab3b2> 9489\n<eab3b3> 1172\n<eab3b4> 9490\n<eab480> 1177\n<eab484> 1178\n<eab485> 9501\n<eab486> 1179\n<eab48e> 9507\n<eab48f> 1182\n<eab490> 9508\n<eab491> 1183\n<eab498> 1184\n<eab49c> 1185\n<eab4a0> 1186\n<eab4a9> 1187\n<eab4b8> 1192\n<eab4bc> 1193\n<eab586> 9549\n<eab587> 1196\n<eab588> 9550\n<eab589> 1197\n<eab590> 1198\n<eab594> 1199\n<eab598> 1200\n<eab5a1> 1201\n<eab5a2> 9571\n<eab5a3> 1202\n<eab5b0> 1205\n<eab5be> 9588\n<eab5bf> 1213\n<eab680> 9589\n<eab68c> 1218\n<eab690> 1219\n<eab6a4> 1222\n<eab6b7> 1223\n<eab784> 1226\n<eab788> 1227\n<eab792> 9655\n<eab793> 1230\n<eab79c> 1231\n<eab7a0> 1232\n<eab7a4> 1233\n<eab7bc> 1236\n<eab7bf> 1237\n<eab88a> 9699\n<eab88b> 1242\n<eab88c> 9700\n<eab88d> 1243\n<eab894> 1244\n<eab8b4> 1247\n<eab8b9> 9738\n<eab8ba> 1250\nendcidchar\n\n100 begincidchar\n<eab982> 9744\n<eab983> 1253\n<eab984> 9745\n<eab98a> 1256\n<eab98b> 9749\n<eab98f> 9750\n<eab990> 1260\n<eab994> 1261\n<eab995> 9754\n<eab996> 1262\n<eab99e> 9760\n<eab9a5> 1268\n<eab9ac> 1271\n<eab9b0> 1272\n<eab9ba> 9778\n<eaba8c> 1280\n<eababf> 9838\n<eabb80> 1284\n<eabb84> 1285\n<eabb8e> 9849\n<eabb9c> 1293\n<eabba8> 1294\n<eabbab> 1295\n<eabbac> 9871\n<eabbad> 1296\n<eabbb4> 1297\n<eabbb8> 1298\n<eabbbc> 1299\n<eabc8d> 1302\n<eabc90> 1303\n<eabcb0> 1306\n<eabcb1> 9929\n<eabcb2> 1307\n<eabcb3> 9930\n<eabcb4> 1308\n<eabcbe> 9938\n<eabcbf> 1311\n<eabd80> 9939\n<eabd90> 1317\n<eabdb9> 1322\n<eabe80> 1323\n<eabe84> 1324\n<eabe88> 1325\n<eabe95> 1328\n<eabe9c> 1329\n<eabebc> 1332\n<eabf80> 1333\n<eabf8a> 10052\n<eabf8b> 1337\n<eabf8c> 10053\n<eabf94> 1340\n<eabf9c> 1341\n<eabfb4> 1346\n<eabfb8> 1347\n<eb8084> 1350\n<eb808c> 1351\n<eb8090> 1352\n<eb8094> 1353\n<eb80a8> 1356\n<eb8188> 1359\n<eb8189> 10156\n<eb818a> 1360\n<eb818b> 10157\n<eb818c> 1361\n<eb818d> 10158\n<eb818e> 1362\n<eb8196> 10163\n<eb8197> 1366\n<eb8198> 10164\n<eb8199> 1367\n<eb819d> 1368\n<eb8280> 1371\n<eb8284> 1372\n<eb828e> 10210\n<eb828f> 1375\n<eb8290> 10211\n<eb8291> 1376\n<eb829b> 10218\n<eb829c> 1380\n<eb82aa> 10226\n<eb82b0> 10227\n<eb82b1> 1392\n<eb82b2> 10228\n<eb82b8> 1396\n<eb82bc> 1397\n<eb8386> 10241\n<eb8394> 1405\n<eb8398> 1406\n<eb83a0> 1407\n<eb83a5> 1408\n<eb848a> 10298\n<eb8490> 1413\n<eb8491> 10302\n<eb849a> 10307\n<eb84a8> 1424\n<eb84ac> 1425\n<eb84b6> 10325\n<eb8584> 1433\n<eb8588> 1434\n<eb8598> 1439\nendcidchar\n\n100 begincidchar\n<eb859c> 1440\n<eb85a0> 1441\n<eb85bc> 1444\n<eb8680> 1445\n<eb8681> 10382\n<eb8682> 1446\n<eb868a> 10388\n<eb868b> 1449\n<eb868c> 10389\n<eb868d> 1450\n<eb8698> 1454\n<eb869c> 1455\n<eb86a8> 1456\n<eb878c> 1457\n<eb8790> 1458\n<eb8794> 1459\n<eb879e> 10459\n<eb879f> 1462\n<eb87ac> 1465\n<eb87b0> 1466\n<eb87b9> 1467\n<eb87ba> 10481\n<eb87bb> 1468\n<eb87bc> 10482\n<eb87bd> 1469\n<eb8888> 1472\n<eb8896> 10500\n<eb8897> 1477\n<eb8898> 10501\n<eb8899> 1478\n<eb88a0> 1479\n<eb88b4> 1480\n<eb88bc> 1481\n<eb8998> 1482\n<eb899c> 1483\n<eb89a0> 1484\n<eb89bc> 1489\n<eb8a89> 1492\n<eb8a94> 1495\n<eb8aa2> 10616\n<eb8aa3> 1501\n<eb8aa4> 10617\n<eb8aaa> 1504\n<eb8aab> 10621\n<eb8aac> 1505\n<eb8ab0> 1506\n<eb8ab4> 1507\n<eb8b8c> 1510\n<eb8b90> 1511\n<eb8b91> 10652\n<eb8b92> 1512\n<eb8b9a> 10658\n<eb8b9b> 1515\n<eb8b9c> 10659\n<eb8b9d> 1516\n<eb8ba2> 1517\n<eb8ba3> 10664\n<eb8ba7> 10665\n<eb8ba8> 1521\n<eb8bb6> 10671\n<eb8bbf> 1535\n<eb8c84> 1538\n<eb8c88> 1539\n<eb8c92> 10687\n<eb8c9c> 1545\n<eb8d97> 10749\n<eb8d98> 1549\n<eb8d9d> 10752\n<eb8da6> 10757\n<eb8da7> 1556\n<eb8da8> 10758\n<eb8da9> 1557\n<eb8daa> 10759\n<eb8dab> 1558\n<eb8dae> 1559\n<eb8daf> 10762\n<eb8db4> 1562\n<eb8db8> 1563\n<eb8e82> 10775\n<eb8e8c> 1569\n<eb8e90> 1570\n<eb8e94> 1571\n<eb8ea8> 1574\n<eb8eac> 1575\n<eb8f88> 1578\n<eb8f8d> 10835\n<eb8f8e> 1581\n<eb8f8f> 10836\n<eb8f90> 1582\n<eb8f96> 10840\n<eb8f97> 1585\n<eb8f98> 10841\n<eb8f99> 1586\n<eb8f9a> 10842\n<eb8f9b> 1587\n<eb8f9c> 10843\n<eb8f9d> 1588\n<eb8fa0> 1589\n<eb8fa4> 1590\n<eb8fa8> 1591\nendcidchar\n\n100 begincidchar\n<eb8fbc> 1592\n<eb9090> 1593\n<eb9098> 1594\n<eb909c> 1595\n<eb90a0> 1596\n<eb90aa> 10910\n<eb90ab> 1599\n<eb90b4> 1600\n<eb9194> 1603\n<eb9198> 1604\n<eb91a2> 10958\n<eb91a3> 1607\n<eb91a4> 10959\n<eb91a5> 1608\n<eb91ac> 1609\n<eb9280> 1610\n<eb9288> 1611\n<eb929d> 1612\n<eb92a4> 1613\n<eb92a8> 1614\n<eb92ac> 1615\n<eb92b5> 1616\n<eb92b6> 11032\n<eb92b7> 1617\n<eb92b8> 11033\n<eb92b9> 1618\n<eb9380> 1619\n<eb9384> 1620\n<eb9388> 1621\n<eb9390> 1622\n<eb9395> 1623\n<eb93a0> 1626\n<eb93a5> 11067\n<eb93a6> 1629\n<eb93ae> 11073\n<eb93af> 1632\n<eb93b0> 11074\n<eb93b1> 1633\n<eb93b8> 1634\n<eb9498> 1637\n<eb94a6> 11119\n<eb94b4> 1648\n<eb94b8> 1649\n<eb9582> 11137\n<eb9590> 1658\n<eb9594> 1659\n<eb959e> 11155\n<eb96a4> 1667\n<eb96a8> 1668\n<eb96a9> 11223\n<eb96b2> 11228\n<eb9780> 1679\n<eb9784> 1680\n<eb978e> 11246\n<eb9798> 1686\n<eb97ac> 1687\n<eb9894> 1690\n<eb9898> 1691\n<eb98a5> 1692\n<eb98ac> 1693\n<eb98b4> 1694\n<eb9988> 1695\n<eb99a4> 1696\n<eb99a8> 1697\n<eb9aa0> 1700\n<eb9aa4> 1701\n<eb9ab1> 1704\n<eb9b94> 1705\n<eb9bb0> 1706\n<eb9bb4> 1707\n<eb9bb8> 1708\n<eb9c85> 1711\n<eb9cac> 1714\n<eb9cba> 11574\n<eb9cbb> 1719\n<eb9d84> 1720\n<eb9d88> 1721\n<eb9d8c> 1722\n<eb9da0> 1725\n<eb9da4> 1726\n<eb9da8> 1727\n<eb9db2> 11619\n<eb9db3> 1730\n<eb9db4> 11620\n<eb9db5> 1731\n<eb9e80> 1734\n<eb9e84> 1735\n<eb9e8e> 11639\n<eb9e9c> 1746\n<eb9ea0> 1747\n<eb9eaa> 11655\n<eb9eb8> 1755\n<eb9f87> 1756\n<eb9f88> 11678\n<eb9f89> 1757\n<eb9fb0> 1760\n<eb9fb4> 1761\n<eb9fbe> 11725\n<eb9fbf> 1764\n<eba08c> 1770\nendcidchar\n\n100 begincidchar\n<eba090> 1771\n<eba09a> 11743\n<eba09b> 1774\n<eba09c> 11744\n<eba09d> 1775\n<eba0a8> 1778\n<eba0ac> 1779\n<eba0b6> 11763\n<eba180> 1785\n<eba184> 1786\n<eba191> 1787\n<eba192> 11785\n<eba193> 1788\n<eba1a0> 1791\n<eba1a4> 1792\n<eba1ae> 11806\n<eba1af> 1795\n<eba1b0> 11807\n<eba1b1> 1796\n<eba1b8> 1797\n<eba1bc> 1798\n<eba28d> 1799\n<eba2a8> 1800\n<eba2b0> 1801\n<eba2b4> 1802\n<eba2b8> 1803\n<eba382> 11879\n<eba383> 1806\n<eba384> 11880\n<eba385> 1807\n<eba38c> 1808\n<eba390> 1809\n<eba394> 1810\n<eba39d> 1811\n<eba39e> 11901\n<eba39f> 1812\n<eba3a0> 11902\n<eba3a1> 1813\n<eba3ac> 1816\n<eba3b0> 1817\n<eba3ba> 11921\n<eba3bb> 1820\n<eba3bc> 11922\n<eba3bd> 1821\n<eba484> 1822\n<eba498> 1823\n<eba4a0> 1824\n<eba580> 1827\n<eba584> 1828\n<eba58c> 1829\n<eba58f> 1830\n<eba590> 11996\n<eba591> 1831\n<eba59c> 1834\n<eba5a0> 1835\n<eba5aa> 12015\n<eba5ab> 1838\n<eba5ac> 12016\n<eba5ad> 1839\n<eba5b8> 1842\n<eba5bc> 1843\n<eba686> 12035\n<eba687> 1846\n<eba688> 12036\n<eba6b0> 1853\n<eba6b4> 1854\n<eba6be> 12080\n<eba6bf> 1857\n<eba780> 12081\n<eba781> 1858\n<eba78c> 1861\n<eba78d> 12090\n<eba79a> 12096\n<eba79b> 1869\n<eba79c> 12097\n<eba7a1> 1872\n<eba7a2> 12100\n<eba7a8> 1876\n<eba7ac> 1877\n<eba7b6> 12113\n<eba888> 1886\n<eba895> 1887\n<eba8bc> 1890\n<eba980> 1891\n<eba981> 12176\n<eba982> 1892\n<eba98a> 12182\n<eba98b> 1895\n<eba98c> 12183\n<eba998> 1901\n<eba99c> 1902\n<eba9a6> 12200\n<eba9b4> 1910\n<eba9b8> 1911\n<ebaa86> 12222\n<ebaa87> 1915\n<ebaa8c> 1916\n<ebaaaa> 12254\n<ebaab0> 1921\n<ebaab1> 12258\nendcidchar\n\n100 begincidchar\n<ebaab2> 1922\n<ebaaba> 12264\n<ebaabb> 1925\n<ebaabc> 12265\n<ebaabd> 1926\n<ebab84> 1927\n<ebab88> 1928\n<ebabbc> 1931\n<ebac80> 1932\n<ebac84> 1933\n<ebac8d> 1934\n<ebac8e> 12338\n<ebac8f> 1935\n<ebac90> 12339\n<ebac91> 1936\n<ebac98> 1937\n<ebac9c> 1938\n<ebaca0> 1939\n<ebaca9> 1940\n<ebacaa> 12360\n<ebacab> 1941\n<ebacb7> 12369\n<ebacb8> 1945\n<ebacbf> 12372\n<ebad86> 12377\n<ebad87> 1952\n<ebad88> 12378\n<ebad89> 1953\n<ebad8d> 1954\n<ebad8e> 12382\n<ebad94> 1957\n<ebad98> 1958\n<ebada1> 1959\n<ebada2> 12397\n<ebada3> 1960\n<ebadac> 1961\n<ebae88> 1962\n<ebae8c> 1963\n<ebae90> 1964\n<ebaea4> 1965\n<ebaea8> 1966\n<ebaeac> 1967\n<ebaeb4> 1968\n<ebaeb7> 1969\n<ebaf80> 1970\n<ebaf84> 1971\n<ebaf88> 1972\n<ebaf90> 1973\n<ebaf93> 1974\n<ebafbc> 1977\n<ebafbf> 1978\n<ebb080> 1979\n<ebb081> 12536\n<ebb082> 1980\n<ebb08a> 12542\n<ebb08e> 12543\n<ebb08f> 1986\n<ebb090> 12544\n<ebb091> 1987\n<ebb0a6> 12553\n<ebb0a7> 2000\n<ebb0a8> 12554\n<ebb0a9> 2001\n<ebb0ad> 2002\n<ebb0b4> 2005\n<ebb0b8> 2006\n<ebb182> 12572\n<ebb189> 2012\n<ebb190> 2015\n<ebb19d> 2016\n<ebb288> 2019\n<ebb28d> 12634\n<ebb28e> 2022\n<ebb296> 12640\n<ebb297> 2025\n<ebb298> 12641\n<ebb2a4> 2030\n<ebb2b2> 12658\n<ebb380> 2040\n<ebb384> 2041\n<ebb38d> 2042\n<ebb38e> 12678\n<ebb395> 2046\n<ebb398> 2047\n<ebb39c> 2048\n<ebb3b7> 12710\n<ebb3b8> 2052\n<ebb3bc> 2053\n<ebb486> 12721\n<ebb487> 2056\n<ebb488> 12722\n<ebb489> 2057\n<ebb490> 2058\n<ebb494> 2059\n<ebb4a4> 2060\n<ebb4ac> 2061\n<ebb580> 2062\n<ebb58c> 2065\n<ebb590> 2066\n<ebb5a4> 2069\nendcidchar\n\n100 begincidchar\n<ebb5a8> 2070\n<ebb684> 2073\n<ebb692> 12837\n<ebb693> 2080\n<ebb694> 12838\n<ebb695> 2081\n<ebb69b> 12842\n<ebb69c> 2084\n<ebb6a4> 2085\n<ebb6b0> 2086\n<ebb6b8> 2087\n<ebb798> 2090\n<ebb79c> 2091\n<ebb7a9> 2092\n<ebb7b0> 2093\n<ebb7b4> 2094\n<ebb7b8> 2095\n<ebb880> 2096\n<ebb883> 2097\n<ebb884> 12933\n<ebb885> 2098\n<ebb890> 2101\n<ebb894> 2102\n<ebb89e> 12952\n<ebb89f> 2105\n<ebb988> 2108\n<ebb98c> 2109\n<ebb98d> 12994\n<ebb98e> 2110\n<ebb996> 13000\n<ebb997> 2113\n<ebb998> 13001\n<ebb9a4> 2119\n<ebb9a8> 2120\n<ebb9a9> 13011\n<ebb9aa> 2121\n<ebb9b2> 13017\n<ebba80> 2130\n<ebba84> 2131\n<ebba8e> 13035\n<ebbaa8> 2139\n<ebbb94> 2142\n<ebbba0> 2145\n<ebbbac> 2149\n<ebbc80> 13133\n<ebbc81> 2150\n<ebbc9a> 13154\n<ebbd84> 2160\n<ebbd88> 2161\n<ebbd95> 2164\n<ebbe94> 2165\n<ebbeb0> 2166\n<ebbf85> 2167\n<ebbf90> 2170\n<ebbf94> 2171\n<ebbf9c> 2172\n<ebbf9f> 2173\n<ebbfa0> 13333\n<ebbfa1> 2174\n<ec80bc> 2175\n<ec8191> 2176\n<ec8198> 2177\n<ec819c> 2178\n<ec81a0> 2179\n<ec8294> 2184\n<ec8298> 2185\n<ec82a2> 13513\n<ec82a3> 2188\n<ec82a4> 13514\n<ec82a5> 2189\n<ec82ae> 13521\n<ec82be> 13529\n<ec82bf> 2200\n<ec8385> 2203\n<ec838c> 2206\n<ec8390> 2207\n<ec839a> 13547\n<ec83a8> 2215\n<ec83ac> 2216\n<ec83b6> 13566\n<ec83b7> 2219\n<ec83b8> 13567\n<ec83b9> 2220\n<ec8480> 2221\n<ec8484> 2222\n<ec8488> 2223\n<ec8490> 2224\n<ec8495> 2225\n<ec84a5> 13599\n<ec84ae> 13604\n<ec84b6> 2240\n<ec84b7> 13609\n<ec84bc> 2243\n<ec8580> 2244\n<ec858a> 13622\n<ec8598> 2252\n<ec859c> 2253\n<ec85a6> 13641\n<ec85b0> 2259\n<ec85b4> 2260\nendcidchar\n\n100 begincidchar\n<ec85b8> 2261\n<ec8685> 2262\n<ec868f> 13672\n<ec8690> 2266\n<ec8694> 2267\n<ec8695> 13676\n<ec8696> 2268\n<ec869e> 13682\n<ec869f> 2271\n<ec86a0> 13683\n<ec86a1> 2272\n<ec86a5> 2273\n<ec86ac> 2276\n<ec86b0> 2277\n<ec86bd> 2278\n<ec8784> 2279\n<ec8788> 2280\n<ec878c> 2281\n<ec8794> 2282\n<ec87a0> 2285\n<ec87a4> 2286\n<ec87a8> 2287\n<ec87b2> 13747\n<ec87b3> 2290\n<ec8880> 2293\n<ec8884> 2294\n<ec888e> 13768\n<ec888f> 2297\n<ec8890> 13769\n<ec8891> 2298\n<ec889c> 2301\n<ec88aa> 13787\n<ec88ab> 2306\n<ec88ac> 13788\n<ec88ad> 2307\n<ec88ae> 13789\n<ec88af> 2308\n<ec88b0> 13790\n<ec88b3> 13791\n<ec88b4> 2311\n<ec8988> 2312\n<ec8994> 2315\n<ec8998> 2316\n<ec89a0> 2317\n<ec89a5> 2318\n<ec89b0> 2321\n<ec89b4> 2322\n<ec89be> 13852\n<ec89bf> 2325\n<ec8a80> 13853\n<ec8a81> 2326\n<ec8a90> 2329\n<ec8a98> 2330\n<ec8a9b> 2331\n<ec8a9c> 13875\n<ec8a9d> 2332\n<ec8aa8> 2335\n<ec8ab6> 13893\n<ec8ab7> 2340\n<ec8ab8> 13894\n<ec8ab9> 2341\n<ec8ba0> 2344\n<ec8bae> 13939\n<ec8baf> 2350\n<ec8bb0> 13940\n<ec8bb1> 2351\n<ec8bb6> 2352\n<ec8bb7> 13945\n<ec8bba> 13946\n<ec8c80> 2357\n<ec8c98> 2365\n<ec8c9c> 2366\n<ec8d85> 2371\n<ec8dac> 2374\n<ec8db0> 2375\n<ec8db1> 14044\n<ec8db2> 2376\n<ec8e84> 2381\n<ec8e88> 2382\n<ec8e8c> 2383\n<ec8f80> 2384\n<ec8f9c> 2387\n<ec8fa1> 14142\n<ec8fa2> 2390\n<ec8fad> 2393\n<ec8fb8> 2396\n<ec9088> 2397\n<ec9090> 2398\n<ec90a4> 2399\n<ec90ac> 2400\n<ec90b0> 2401\n<ec90b4> 2402\n<ec9188> 2405\n<ec91a8> 2408\n<ec91ac> 2409\n<ec91b9> 2412\n<ec9280> 2413\n<ec9294> 2414\n<ec929c> 2415\n<ec92b8> 2416\nendcidchar\n\n100 begincidchar\n<ec92bc> 2417\n<ec93a9> 2418\n<ec93b4> 2421\n<ec93b8> 2422\n<ec93b9> 14389\n<ec93ba> 2423\n<ec93bf> 2424\n<ec948c> 2427\n<ec9490> 2428\n<ec9494> 2429\n<ec949c> 2430\n<ec94ac> 2433\n<ec94b0> 2434\n<ec94ba> 14440\n<ec94bb> 2437\n<ec94bc> 14441\n<ec94bd> 2438\n<ec958b> 14450\n<ec9596> 14455\n<ec959f> 14459\n<ec95a4> 2457\n<ec95a8> 2458\n<ec95b2> 14472\n<ec9680> 2466\n<ec9684> 2467\n<ec9687> 2468\n<ec968e> 14490\n<ec968f> 2471\n<ec9690> 14491\n<ec9691> 2472\n<ec9695> 2473\n<ec9696> 14495\n<ec969c> 2476\n<ec96a0> 2477\n<ec96a9> 2478\n<ec96ba> 14522\n<ec96bf> 14523\n<ec978b> 14528\n<ec978c> 2494\n<ec978d> 14529\n<ec978e> 2495\n<ec978f> 14530\n<ec9794> 2498\n<ec9798> 2499\n<ec97a2> 14543\n<ec97a3> 2502\n<ec97a4> 14544\n<ec97a5> 2503\n<ec97af> 14551\n<ec97b0> 2507\n<ec97b4> 2508\n<ec97b5> 14555\n<ec988c> 2521\n<ec9890> 2522\n<ec989a> 14576\n<ec98a8> 2529\n<ec98af> 14589\n<ec98b0> 2533\n<ec98b6> 14592\n<ec98b7> 2537\n<ec98b8> 14593\n<ec98b9> 2538\n<ec98ba> 14594\n<ec98bb> 2539\n<ec9984> 2542\n<ec9988> 2543\n<ec9992> 14611\n<ec99a0> 2551\n<ec99ac> 2552\n<ec99af> 2553\n<ec99b0> 14633\n<ec99b1> 2554\n<ec99bc> 2557\n<ec9a80> 2558\n<ec9a8a> 14652\n<ec9a8b> 2561\n<ec9a8c> 14653\n<ec9a8d> 2562\n<ec9a98> 2565\n<ec9a9c> 2566\n<ec9aa6> 14672\n<ec9aa7> 2569\n<ec9aa8> 14673\n<ec9aa9> 2570\n<ec9ab4> 2573\n<ec9b82> 14690\n<ec9b83> 2579\n<ec9b84> 14691\n<ec9b85> 2580\n<ec9b90> 2583\n<ec9b94> 2584\n<ec9bac> 2591\n<ec9bb0> 2592\n<ec9bbd> 2595\n<ec9c88> 2598\n<ec9c8c> 2599\n<ec9c96> 14751\n<ec9c97> 2602\n<ec9c98> 14752\n<ec9c99> 2603\nendcidchar\n\n100 begincidchar\n<ec9ca4> 2606\n<ec9ca8> 2607\n<ec9cb2> 14771\n<ec9cb3> 2610\n<ec9cb4> 14772\n<ec9cb5> 2611\n<ec9cb6> 14773\n<ec9cb7> 2612\n<ec9d80> 2615\n<ec9d84> 2616\n<ec9d8a> 2617\n<ec9d8b> 14788\n<ec9d8e> 14789\n<ec9d8f> 2620\n<ec9d90> 14790\n<ec9d9c> 2629\n<ec9da0> 2630\n<ec9da8> 2631\n<ec9dab> 2632\n<ec9db8> 2635\n<ec9dbf> 14819\n<ec9e86> 14823\n<ec9e8e> 2646\n<ec9e8f> 14827\n<ec9e94> 2649\n<ec9e95> 14830\n<ec9e99> 14831\n<ec9e9a> 2653\n<ec9ea2> 14837\n<ec9eb0> 2662\n<ec9eb4> 2663\n<ec9ebe> 14855\n<ec9ebf> 2666\n<ec9f8c> 2671\n<ec9f8d> 14864\n<ec9f8e> 2672\n<ec9f8f> 14865\n<ec9f90> 2673\n<ec9f98> 2674\n<ec9f9d> 2675\n<ec9fa4> 2676\n<ec9fa8> 2677\n<ec9fac> 2678\n<eca084> 2681\n<eca088> 2682\n<eca089> 14913\n<eca08a> 2683\n<eca092> 14919\n<eca093> 2686\n<eca094> 14920\n<eca0a0> 2691\n<eca0a4> 2692\n<eca0ae> 14938\n<eca0af> 2695\n<eca0b0> 14939\n<eca0b1> 2696\n<eca0b8> 2697\n<eca0bc> 2698\n<eca180> 2699\n<eca194> 2704\n<eca1b4> 2707\n<eca1b8> 2708\n<eca1b9> 14999\n<eca1ba> 2709\n<eca282> 15005\n<eca283> 2712\n<eca284> 15006\n<eca294> 2719\n<eca29d> 2720\n<eca29e> 15024\n<eca29f> 2721\n<eca2a0> 15025\n<eca2a1> 2722\n<eca2a8> 2723\n<eca384> 2726\n<eca388> 2727\n<eca38c> 2728\n<eca396> 15070\n<eca397> 2731\n<eca398> 15071\n<eca399> 2732\n<eca3a4> 2735\n<eca3b5> 2736\n<eca480> 2739\n<eca48e> 15112\n<eca48f> 2745\n<eca490> 15113\n<eca491> 2746\n<eca498> 2747\n<eca4ac> 2748\n<eca4b4> 2749\n<eca594> 2752\n<eca598> 2753\n<eca5a2> 15185\n<eca5a3> 2756\n<eca5ac> 2757\n<eca5b0> 2758\n<eca5b4> 2759\n<eca5bc> 2760\n<eca68c> 2763\nendcidchar\n\n100 begincidchar\n<eca690> 2764\n<eca69a> 15230\n<eca69b> 2767\n<eca69c> 15231\n<eca69d> 2768\n<eca784> 2771\n<eca789> 15270\n<eca78a> 2774\n<eca792> 15276\n<eca793> 2777\n<eca794> 15277\n<eca79b> 15280\n<eca7a0> 2784\n<eca7a1> 15283\n<eca7a2> 2785\n<eca7a3> 15284\n<eca7a4> 2786\n<eca7a7> 2787\n<eca7ae> 15291\n<eca7bc> 2795\n<eca880> 2796\n<eca88a> 15310\n<eca894> 2802\n<eca898> 2803\n<eca8a9> 2804\n<eca990> 2807\n<eca994> 2808\n<eca99e> 15382\n<eca9a8> 2814\n<eca9bd> 2815\n<ecaa84> 2816\n<ecaa98> 2817\n<ecab80> 2820\n<ecab84> 2821\n<ecab8e> 15481\n<ecab8f> 2824\n<ecab90> 15482\n<ecab91> 2825\n<ecab92> 15483\n<ecab93> 2826\n<ecaba0> 2829\n<ecabac> 2830\n<ecabb4> 2831\n<ecac88> 2832\n<ecac90> 2833\n<ecac94> 2834\n<ecac98> 2835\n<ecad80> 15581\n<ecad81> 2838\n<ecad8c> 2841\n<ecad90> 2842\n<ecad9d> 2845\n<ecada4> 2846\n<ecae9c> 2849\n<ecaeb8> 2850\n<ecaf94> 2851\n<ecafa4> 2852\n<ecafa7> 2853\n<ecafa8> 15733\n<ecafa9> 2854\n<ecb090> 2857\n<ecb094> 2858\n<ecb0ac> 2866\n<ecb0ad> 15789\n<ecb0ae> 2867\n<ecb0af> 15790\n<ecb0b0> 2868\n<ecb0ba> 15798\n<ecb0bf> 15799\n<ecb188> 2877\n<ecb18c> 2878\n<ecb196> 15816\n<ecb1a0> 2884\n<ecb1a4> 2885\n<ecb1a5> 15826\n<ecb1a6> 2886\n<ecb1a7> 15827\n<ecb1a8> 2887\n<ecb1b0> 2888\n<ecb1b5> 2889\n<ecb29c> 2892\n<ecb2a0> 2893\n<ecb2aa> 15885\n<ecb2b8> 2901\n<ecb2bc> 2902\n<ecb386> 15904\n<ecb387> 2905\n<ecb388> 15905\n<ecb389> 2906\n<ecb390> 2907\n<ecb394> 2908\n<ecb3a4> 2909\n<ecb3ac> 2910\n<ecb3b0> 2911\n<ecb480> 15955\n<ecb481> 2912\n<ecb48c> 2915\n<ecb490> 2916\n<ecb49a> 15974\n<ecb49b> 2919\nendcidchar\n\n100 begincidchar\n<ecb49c> 15975\n<ecb49d> 2920\n<ecb4a4> 2921\n<ecb4a8> 2922\n<ecb4ac> 2923\n<ecb4b9> 2924\n<ecb59c> 2925\n<ecb5a0> 2926\n<ecb5a4> 2927\n<ecb5ae> 16047\n<ecb5af> 2930\n<ecb5b0> 16048\n<ecb5b1> 2931\n<ecb5b8> 2932\n<ecb688> 2933\n<ecb698> 2936\n<ecb69c> 2937\n<ecb6a6> 16093\n<ecb6a7> 2940\n<ecb6a8> 16094\n<ecb6a9> 2941\n<ecb6b0> 2942\n<ecb784> 2943\n<ecb78c> 2944\n<ecb790> 2945\n<ecb7a8> 2946\n<ecb7ac> 2947\n<ecb7b0> 2948\n<ecb7ba> 16166\n<ecb7bb> 2951\n<ecb7bc> 16167\n<ecb7bd> 2952\n<ecb884> 2953\n<ecb888> 2954\n<ecb88c> 2955\n<ecb894> 2956\n<ecb899> 2957\n<ecb8a4> 2960\n<ecb8a8> 2961\n<ecb8b2> 16209\n<ecb8b3> 2964\n<ecb8b4> 16210\n<ecb8b5> 2965\n<ecb99c> 2968\n<ecb9aa> 16255\n<ecb9ab> 2974\n<ecb9ac> 16256\n<ecb9ad> 2975\n<ecb9b8> 2978\n<ecb9bc> 2979\n<ecba86> 16275\n<ecba87> 2982\n<ecba88> 16276\n<ecba89> 2983\n<ecba94> 2986\n<ecba98> 2987\n<ecbaa2> 16295\n<ecbb80> 16320\n<ecbb81> 2995\n<ecbba8> 2998\n<ecbbb6> 16366\n<ecbc84> 3008\n<ecbc88> 3009\n<ecbc92> 16385\n<ecbc93> 3012\n<ecbc94> 16386\n<ecbc95> 3013\n<ecbc9c> 3014\n<ecbca0> 3015\n<ecbca4> 3016\n<ecbcae> 16406\n<ecbcb8> 3022\n<ecbd98> 3025\n<ecbd9c> 3026\n<ecbda6> 16452\n<ecbda7> 3029\n<ecbda8> 16453\n<ecbda9> 3030\n<ecbdb4> 3033\n<ecbdb8> 3034\n<ecbe80> 3035\n<ecbe85> 3036\n<ecbe8c> 3037\n<ecbea1> 3038\n<ecbea8> 3039\n<ecbeb0> 3040\n<ecbf84> 3041\n<ecbfa4> 3044\n<ecbfa8> 3045\n<ecbfb2> 16573\n<ecbfb3> 3048\n<ecbfb4> 16574\n<ecbfb5> 3049\n<ecbfbc> 3050\n<ed8080> 3051\n<ed8084> 3052\n<ed8091> 3053\n<ed8098> 3054\n<ed80ad> 3055\n<ed80b8> 3058\nendcidchar\n\n100 begincidchar\n<ed80bc> 3059\n<ed8186> 16643\n<ed8187> 3062\n<ed8188> 16644\n<ed8189> 3063\n<ed8190> 3064\n<ed8194> 3065\n<ed8198> 3066\n<ed81a0> 3067\n<ed81b0> 3070\n<ed81b4> 3071\n<ed8280> 16689\n<ed8281> 3074\n<ed82a8> 3077\n<ed82ac> 3078\n<ed82b6> 16736\n<ed82b7> 3081\n<ed82b8> 16737\n<ed82b9> 3082\n<ed8384> 3085\n<ed8392> 16755\n<ed83a0> 3095\n<ed83a4> 3096\n<ed83ae> 16774\n<ed83b8> 3102\n<ed848d> 3103\n<ed84b4> 3106\n<ed84b8> 3107\n<ed84b9> 16840\n<ed84ba> 3108\n<ed8582> 16846\n<ed8590> 3116\n<ed8594> 3117\n<ed859e> 16865\n<ed859f> 3120\n<ed85a0> 16866\n<ed85a1> 3121\n<ed85a8> 3122\n<ed85ac> 3123\n<ed85bc> 3124\n<ed8684> 3125\n<ed8688> 3126\n<ed86a4> 3129\n<ed86a8> 3130\n<ed86b2> 16936\n<ed86b3> 3133\n<ed86b4> 16937\n<ed86b5> 3134\n<ed86ba> 3135\n<ed86bb> 16942\n<ed86bc> 3136\n<ed8780> 3137\n<ed8798> 3138\n<ed87b4> 3139\n<ed87b8> 3140\n<ed8887> 3141\n<ed8888> 17013\n<ed8889> 3142\n<ed8890> 3143\n<ed88b0> 3146\n<ed88b4> 3147\n<ed88be> 17059\n<ed88bf> 3150\n<ed8980> 17060\n<ed8981> 3151\n<ed8988> 3152\n<ed899c> 3153\n<ed89a4> 3154\n<ed8a84> 3157\n<ed8a88> 3158\n<ed8a95> 3161\n<ed8a9c> 3162\n<ed8aa0> 3163\n<ed8aa4> 3164\n<ed8aac> 3165\n<ed8ab1> 3166\n<ed8abc> 3169\n<ed8abf> 3170\n<ed8b80> 3171\n<ed8b81> 17168\n<ed8b82> 3172\n<ed8b8a> 17174\n<ed8b8b> 3175\n<ed8b94> 3176\n<ed8b98> 3177\n<ed8b9c> 3178\n<ed8bb4> 3183\n<ed8bb8> 3184\n<ed8c82> 17218\n<ed8c83> 3187\n<ed8c84> 17219\n<ed8c85> 3188\n<ed8c8f> 17226\n<ed8c90> 3192\n<ed8c94> 3193\n<ed8c95> 17230\n<ed8c96> 3194\n<ed8c9e> 17236\n<ed8ca5> 3200\n<ed8cac> 3203\nendcidchar\n\n100 begincidchar\n<ed8cb0> 3204\n<ed8cba> 17254\n<ed8e80> 3214\n<ed8e84> 3215\n<ed8e8e> 17327\n<ed8e9c> 3223\n<ed8ea0> 3224\n<ed8eaa> 17346\n<ed8eab> 3227\n<ed8eac> 17347\n<ed8ead> 3228\n<ed8eb4> 3229\n<ed8eb8> 3230\n<ed8ebc> 3231\n<ed8f90> 3236\n<ed8f98> 3237\n<ed8fa1> 3238\n<ed8fa2> 17390\n<ed8fa3> 3239\n<ed8fb0> 3242\n<ed8fb4> 3243\n<ed8fbe> 17411\n<ed8fbf> 3246\n<ed9080> 17412\n<ed9081> 3247\n<ed9088> 3248\n<ed909d> 3249\n<ed9180> 3250\n<ed9184> 3251\n<ed919c> 3252\n<ed91a0> 3253\n<ed91a4> 3254\n<ed91ad> 3255\n<ed91ae> 17513\n<ed91af> 3256\n<ed91bc> 3259\n<ed91bf> 3260\n<ed9280> 3261\n<ed9281> 17526\n<ed9282> 3262\n<ed928a> 17532\n<ed928b> 3265\n<ed928c> 17533\n<ed928d> 3266\n<ed9294> 3267\n<ed92a9> 3268\n<ed938c> 3269\n<ed9390> 3270\n<ed9394> 3271\n<ed939c> 3272\n<ed939f> 3273\n<ed93a8> 3274\n<ed93ac> 3275\n<ed93b0> 3276\n<ed93b8> 3277\n<ed93bb> 3278\n<ed93bc> 17632\n<ed93bd> 3279\n<ed9484> 3280\n<ed9488> 3281\n<ed948c> 3282\n<ed9496> 17652\n<ed9497> 3285\n<ed9580> 3288\n<ed9584> 3289\n<ed958e> 17701\n<ed958f> 3292\n<ed9590> 17702\n<ed9591> 3293\n<ed959c> 3296\n<ed95a0> 3297\n<ed95a5> 3298\n<ed95aa> 17720\n<ed95ab> 3301\n<ed95ac> 17721\n<ed95ad> 3302\n<ed95b8> 3305\n<ed95bc> 3306\n<ed9686> 17740\n<ed9690> 3312\n<ed96a5> 3313\n<ed978c> 3316\n<ed9790> 3317\n<ed9791> 17806\n<ed9792> 3318\n<ed979a> 17812\n<ed979b> 3321\n<ed979c> 17813\n<ed979d> 3322\n<ed97a8> 3325\n<ed97ac> 3326\n<ed97b6> 17832\n<ed97b7> 3329\n<ed97b8> 17833\n<ed97b9> 3330\n<ed9884> 3333\n<ed9888> 3334\n<ed9892> 17852\n<ed989c> 3340\n<ed98a0> 3341\nendcidchar\n\n100 begincidchar\n<ed98a4> 3342\n<ed98ad> 3343\n<ed98bc> 3346\n<ed9980> 3347\n<ed9985> 3348\n<ed998a> 17894\n<ed998b> 3351\n<ed998c> 17895\n<ed998d> 3352\n<ed9991> 3353\n<ed9998> 3356\n<ed999c> 3357\n<ed99a7> 3358\n<ed99a8> 17916\n<ed99a9> 3359\n<ed99b4> 3362\n<ed9a83> 3363\n<ed9a84> 17939\n<ed9a85> 3364\n<ed9a90> 3367\n<ed9a94> 3368\n<ed9a9d> 3369\n<ed9a9e> 17959\n<ed9a9f> 3370\n<ed9aa0> 17960\n<ed9aa1> 3371\n<ed9aa8> 3372\n<ed9aac> 3373\n<ed9ab0> 3374\n<ed9ab9> 3375\n<ed9aba> 17981\n<ed9abb> 3376\n<ed9b88> 3379\n<ed9b8c> 3380\n<ed9b91> 3381\n<ed9b94> 3382\n<ed9b97> 3383\n<ed9b98> 18003\n<ed9b99> 3384\n<ed9ba0> 3385\n<ed9ba4> 3386\n<ed9ba8> 3387\n<ed9bb0> 3388\n<ed9bb5> 3389\n<ed9c80> 3392\n<ed9c84> 3393\n<ed9c91> 3394\n<ed9c9c> 3397\n<ed9ca0> 3398\n<ed9caa> 18068\n<ed9cab> 3401\n<ed9cac> 18069\n<ed9cad> 3402\n<ed9cb8> 3405\n<ed9cbc> 3406\n<ed9d84> 3407\n<ed9d87> 3408\n<ed9d88> 18090\n<ed9d89> 3409\n<ed9d94> 3412\n<ed9d95> 18099\n<ed9da2> 18106\n<ed9da3> 3419\n<ed9da4> 18107\n<ed9da5> 3420\n<ed9da9> 3421\n<ed9dac> 3422\n<ed9db0> 3423\n<ed9db4> 3424\n<ed9e80> 18128\n<ed9e81> 3427\n<ed9e8c> 3430\n<ed9e90> 3431\n<ed9e9a> 18147\n<ed9e9b> 3434\n<ed9e9c> 18148\n<ed9e9d> 3435\n<efa480> 4116\n<efa481> 3678\n<efa482> 7053\n<efa483> 3460\n<efa484> 7900\n<efa485> 3802\n<efa486> 3902\n<efa487> 3946\n<efa488> 3946\n<efa489> 3708\n<efa48a> 4131\n<efa48b> 4374\n<efa48c> 4156\n<efa494> 5800\n<efa4a1> 4399\n<efa4a2> 4403\n<efa4ae> 4424\n<efa4af> 4511\n<efa580> 4533\n<efa589> 4550\n<efa58a> 4564\n<efa591> 4576\n<efa59a> 4318\nendcidchar\n\n100 begincidchar\n<efa59b> 4136\n<efa59c> 5800\n<efa59d> 4139\n<efa59e> 4192\n<efa59f> 4167\n<efa5a0> 4172\n<efa5a1> 5552\n<efa5a2> 6424\n<efa5a3> 5151\n<efa5a4> 4922\n<efa5a5> 7518\n<efa5a6> 5079\n<efa5a7> 5109\n<efa5a8> 7607\n<efa5a9> 5584\n<efa5aa> 5367\n<efa5ab> 7083\n<efa5ac> 5362\n<efa5ad> 5485\n<efa5ae> 6001\n<efa5af> 5460\n<efa5b0> 5317\n<efa5b1> 7009\n<efa5b2> 7370\n<efa5b3> 5678\n<efa5b4> 5874\n<efa5be> 4439\n<efa5bf> 4442\n<efa680> 4443\n<efa681> 4159\n<efa682> 4444\n<efa683> 4447\n<efa686> 4453\n<efa68d> 4463\n<efa68e> 4160\n<efa691> 4161\n<efa695> 4162\n<efa698> 4474\n<efa699> 4473\n<efa69e> 6447\n<efa6a1> 5460\n<efa6a2> 4483\n<efa6a3> 4163\n<efa6a4> 4166\n<efa6a5> 4485\n<efa6a9> 4491\n<efa6aa> 4167\n<efa6ae> 7783\n<efa6af> 4497\n<efa6b0> 4499\n<efa6b5> 4506\n<efa6b9> 5797\n<efa6bd> 4180\n<efa6be> 4555\n<efa6bf> 5800\n<efa784> 4563\n<efa785> 7988\n<efa786> 6123\n<efa787> 4577\n<efa788> 4183\n<efa789> 4579\n<efa78c> 4584\n<efa78d> 4586\n<efa78e> 4588\n<efa78f> 4184\n<efa79b> 5552\n<efa79c> 4603\n<efa79d> 4614\n<efa79e> 4616\n<efa79f> 4618\n<efa7a0> 5950\n<efa7a3> 4187\n<efa7a4> 4625\n<efa7a5> 4627\n<efa7a6> 4629\n<efa7aa> 4636\n<efa7ad> 4638\n<efa7b6> 4650\n<efa7ba> 5351\n<efa7bb> 6494\n<efa7bc> 5731\n<efa7bd> 5771\n<efa7be> 4191\n<efa7bf> 6484\n<efa880> 6684\n<efa881> 4279\n<efa882> 7139\n<efa883> 4247\n<efa884> 4266\n<efa885> 4340\n<efa886> 7572\n<efa887> 5088\n<efa888> 7709\n<efa889> 3558\n<efa88a> 3644\n<efa88b> 3815\n<efa8ae> 4419\n<efa8af> 4510\n<efbcbc> 112\n<efbd9e> 113\nendcidchar\n\n4 begincidchar\n<efbfa2> 194\n<efbfa3> 357\n<efbfa5> 145\n<efbfa6> 323\nendcidchar\n\n100 begincidrange\n<20> <7e> 1\n<c2b2> <c2b3> 843\n<ce91> <cea1> 471\n<cea3> <cea9> 488\n<ceb1> <cebf> 495\n<cf80> <cf81> 510\n<cf83> <cf89> 512\n<d090> <d095> 1020\n<d096> <d0b5> 1027\n<d0b6> <d0bf> 1060\n<d180> <d18f> 1070\n<e28093> <e28094> 109\n<e28098> <e28099> 114\n<e2809c> <e2809d> 116\n<e280a0> <e280a1> 245\n<e280a5> <e280a6> 105\n<e280b2> <e280b3> 139\n<e280b9> <e280ba> 8612\n<e281ba> <e281bb> 8239\n<e281bd> <e281be> 8250\n<e28281> <e28284> 847\n<e28593> <e28594> 749\n<e2859b> <e2859e> 753\n<e285a0> <e285a9> 461\n<e285b0> <e285b9> 451\n<e28690> <e28691> 171\n<e28693> <e28694> 173\n<e28784> <e28785> 8896\n<e288a5> <e288a6> 8719\n<e288a7> <e288a8> 192\n<e288ab> <e288ac> 182\n<e289a4> <e289a5> 134\n<e289a6> <e289a7> 8724\n<e289ae> <e289af> 8745\n<e289b0> <e289b3> 8481\n<e289b6> <e289b7> 8489\n<e289ba> <e289bb> 8475\n<e28a80> <e28a81> 8479\n<e28a82> <e28a83> 188\n<e28a86> <e28a87> 186\n<e28a95> <e28a97> 8727\n<e28abb> <e28abc> 8751\n<e28b8e> <e28b8f> 8477\n<e28b9a> <e28b9b> 8492\n<e291a0> <e291ae> 733\n<e291af> <e291b3> 8791\n<e291b4> <e291bf> 827\n<e29280> <e29282> 839\n<e29283> <e29287> 9042\n<e2929c> <e292b5> 801\n<e292b6> <e292bf> 8388\n<e29380> <e2938f> 8398\n<e29390> <e293a9> 707\n<e2949e> <e2949f> 559\n<e294a1> <e294a2> 561\n<e294a6> <e294a7> 563\n<e294a9> <e294aa> 565\n<e294ad> <e294ae> 567\n<e294b1> <e294b2> 569\n<e294b5> <e294b6> 571\n<e294b9> <e294ba> 573\n<e294bd> <e294be> 575\n<e29580> <e29581> 577\n<e29583> <e2958a> 579\n<e296a4> <e296a5> 233\n<e29790> <e29791> 230\n<e299a0> <e299a1> 222\n<e299a9> <e299aa> 253\n<e29db6> <e29dbf> 8673\n<e29e8a> <e29e93> 8342\n<e38080> <e38082> 101\n<e38088> <e38091> 120\n<e38094> <e38095> 118\n<e38096> <e38099> 8219\n<e3809e> <e3809f> 9322\n<e38181> <e381bf> 851\n<e38280> <e38293> 914\n<e382a1> <e382bf> 934\n<e38380> <e383b6> 965\n<e384b1> <e384bf> 358\n<e38580> <e385a3> 373\n<e385a5> <e385bf> 409\n<e38680> <e3868e> 436\n<e38880> <e3889b> 773\n<e389a0> <e389bb> 679\n<e38a8a> <e38a8f> 9301\n<e38e80> <e38e84> 627\n<e38e88> <e38e89> 612\n<e38e8a> <e38e8c> 646\n<e38e8d> <e38e8f> 608\n<e38e90> <e38e94> 638\n<e38e95> <e38e97> 587\n<e38e99> <e38ea2> 597\n<e38ea3> <e38ea6> 593\n<e38ea7> <e38ea8> 615\n<e38ea9> <e38eac> 655\n<e38ead> <e38eaf> 651\n<e38eb0> <e38eb9> 617\n<e38eba> <e38ebf> 632\n<e38f80> <e38f81> 644\nendcidrange\n\n100 begincidrange\n<e5b3af> <e5b3b0> 5096\n<e5b9bc> <e5b9bd> 6317\n<e5bf98> <e5bf99> 4698\n<e68488> <e68489> 6322\n<e68598> <e68599> 7085\n<e691b8> <e691b9> 4770\n<e697bb> <e697bc> 4875\n<e69983> <e69984> 7911\n<e69c9e> <e69c9f> 4083\n<e69eb6> <e69eb7> 3448\n<e6a5a1> <e6a5a2> 6329\n<e6af96> <e6af98> 5197\n<e786b9> <e786ba> 8049\n<e78cb6> <e78cb7> 6335\n<e799bd> <e799be> 4993\n<e7a2ba> <e7a2bb> 7879\n<e7a587> <e7a588> 4104\n<e7aaa9> <e7aaaa> 6101\n<e7b48a> <e7b48b> 4842\n<e88590> <e88591> 5133\n<e8a1be> <e8a1bf> 4047\n<e8a3b4> <e8a3b5> 4981\n<e99191> <e99192> 3527\n<e99691> <e99692> 7645\n<e99aa7> <e99aa8> 5620\n<e99ba8> <e99ba9> 6227\n<e9a88e> <e9a88f> 4122\n<eab080> <eab081> 1086\n<eab082> <eab083> 9333\n<eab085> <eab086> 9335\n<eab087> <eab08a> 1089\n<eab08b> <eab08f> 9337\n<eab090> <eab097> 1093\n<eab099> <eab09d> 1101\n<eab09e> <eab09f> 9343\n<eab0a1> <eab0a3> 9345\n<eab0a5> <eab0ab> 9348\n<eab0ac> <eab0ad> 1108\n<eab0af> <eab0b1> 1110\n<eab0b2> <eab0b7> 9356\n<eab0b8> <eab0b9> 1113\n<eab0ba> <eab0bb> 9362\n<eab0bd> <eab0bf> 9364\n<eab181> <eab18a> 9367\n<eab18e> <eab193> 9378\n<eab195> <eab197> 9384\n<eab199> <eab19b> 9387\n<eab19d> <eab1af> 9390\n<eab1b0> <eab1b1> 1122\n<eab1b2> <eab1b3> 9409\n<eab1b5> <eab1b6> 9411\n<eab1b7> <eab1b8> 1125\n<eab1bb> <eab1bf> 9414\n<eab280> <eab281> 1128\n<eab283> <eab286> 1130\n<eab287> <eab288> 9420\n<eab289> <eab28c> 1134\n<eab28d> <eab28f> 9422\n<eab291> <eab293> 9425\n<eab295> <eab29b> 9428\n<eab29c> <eab29d> 1140\n<eab29f> <eab2a1> 1142\n<eab2a2> <eab2a7> 9436\n<eab2a8> <eab2aa> 1145\n<eab2ad> <eab2ae> 9443\n<eab2af> <eab2b0> 1149\n<eab2b1> <eab2b7> 9445\n<eab2b8> <eab2b9> 1151\n<eab2bb> <eab2bd> 1153\n<eab2be> <eab2bf> 9453\n<eab382> <eab383> 9456\n<eab385> <eab387> 9458\n<eab389> <eab38b> 9461\n<eab38d> <eab394> 9464\n<eab398> <eab39f> 9473\n<eab3a0> <eab3a1> 1162\n<eab3a2> <eab3a3> 9481\n<eab3a5> <eab3a6> 9483\n<eab3a7> <eab3a8> 1165\n<eab3ad> <eab3ae> 9487\n<eab3af> <eab3b1> 1169\n<eab3b5> <eab3b6> 1173\n<eab3b7> <eab3bb> 9491\n<eab3bc> <eab3bd> 1175\n<eab3be> <eab3bf> 9496\n<eab481> <eab483> 9498\n<eab487> <eab48b> 9502\n<eab48c> <eab48d> 1180\n<eab492> <eab497> 9509\n<eab499> <eab49b> 9515\n<eab49d> <eab49f> 9518\n<eab4a1> <eab4a8> 9521\n<eab4aa> <eab4ab> 9529\n<eab4ac> <eab4ad> 1188\n<eab4ae> <eab4b3> 9531\n<eab4b4> <eab4b5> 1190\n<eab4b6> <eab4b7> 9537\n<eab4b9> <eab4bb> 9539\n<eab4bd> <eab4bf> 9542\n<eab580> <eab583> 9545\nendcidrange\n\n100 begincidrange\n<eab584> <eab585> 1194\n<eab58a> <eab58f> 9551\n<eab591> <eab593> 9557\n<eab595> <eab597> 9560\n<eab599> <eab5a0> 9563\n<eab5a4> <eab5ab> 9572\n<eab5ac> <eab5ad> 1203\n<eab5ae> <eab5af> 9580\n<eab5b1> <eab5b2> 9582\n<eab5b3> <eab5b6> 1206\n<eab5b7> <eab5ba> 9584\n<eab5bb> <eab5bd> 1210\n<eab681> <eab682> 1214\n<eab683> <eab687> 9590\n<eab688> <eab689> 1216\n<eab68a> <eab68b> 9595\n<eab68d> <eab68f> 9597\n<eab691> <eab69b> 9600\n<eab69c> <eab69d> 1220\n<eab69e> <eab6a3> 9611\n<eab6a5> <eab6b6> 9617\n<eab6b8> <eab6bf> 9635\n<eab780> <eab781> 1224\n<eab782> <eab783> 9643\n<eab785> <eab787> 9645\n<eab789> <eab78f> 9648\n<eab790> <eab791> 1228\n<eab794> <eab79b> 9656\n<eab79d> <eab79f> 9664\n<eab7a1> <eab7a3> 9667\n<eab7a5> <eab7b7> 9670\n<eab7b8> <eab7b9> 1234\n<eab7ba> <eab7bb> 9689\n<eab7bd> <eab7be> 9691\n<eab880> <eab881> 1238\n<eab882> <eab887> 9693\n<eab888> <eab889> 1240\n<eab88e> <eab893> 9701\n<eab895> <eab8af> 9707\n<eab8b0> <eab8b1> 1245\n<eab8b2> <eab8b3> 9734\n<eab8b5> <eab8b6> 9736\n<eab8b7> <eab8b8> 1248\n<eab8bb> <eab8bf> 9739\n<eab980> <eab981> 1251\n<eab985> <eab986> 1254\n<eab987> <eab989> 9746\n<eab98c> <eab98e> 1257\n<eab991> <eab993> 9751\n<eab997> <eab99b> 9755\n<eab99c> <eab99d> 1263\n<eab99f> <eab9a1> 1265\n<eab9a2> <eab9a4> 9761\n<eab9a6> <eab9a7> 9764\n<eab9a8> <eab9a9> 1269\n<eab9aa> <eab9ab> 9766\n<eab9ad> <eab9af> 9768\n<eab9b1> <eab9b7> 9771\n<eab9b8> <eab9b9> 1273\n<eab9bb> <eab9bd> 1275\n<eab9be> <eab9bf> 9779\n<eaba80> <eaba83> 9781\n<eaba84> <eaba85> 1278\n<eaba86> <eaba8b> 9785\n<eaba8d> <eababb> 9791\n<eababc> <eababe> 1281\n<eabb81> <eabb83> 9839\n<eabb85> <eabb8b> 9842\n<eabb8c> <eabb8d> 1286\n<eabb8f> <eabb91> 1288\n<eabb92> <eabb97> 9850\n<eabb98> <eabb99> 1291\n<eabb9a> <eabb9b> 9856\n<eabb9d> <eabba7> 9858\n<eabba9> <eabbaa> 9869\n<eabbae> <eabbb3> 9872\n<eabbb5> <eabbb7> 9878\n<eabbb9> <eabbbb> 9881\n<eabbbd> <eabbbf> 9884\n<eabc80> <eabc86> 9887\n<eabc87> <eabc88> 1300\n<eabc89> <eabc8c> 9894\n<eabc8e> <eabc8f> 9898\n<eabc91> <eabcab> 9900\n<eabcac> <eabcad> 1304\n<eabcae> <eabcaf> 9927\n<eabcb5> <eabcbb> 9931\n<eabcbc> <eabcbd> 1309\n<eabd81> <eabd83> 1312\n<eabd84> <eabd87> 9940\n<eabd88> <eabd89> 1315\n<eabd8a> <eabd8f> 9944\n<eabd91> <eabd9b> 9950\n<eabd9c> <eabd9d> 1318\n<eabd9e> <eabda3> 9961\n<eabda4> <eabda5> 1320\n<eabda6> <eabdb8> 9967\n<eabdba> <eabdbf> 9986\n<eabe81> <eabe83> 9992\n<eabe85> <eabe87> 9995\nendcidrange\n\n100 begincidrange\n<eabe89> <eabe8f> 9998\n<eabe90> <eabe91> 1326\n<eabe92> <eabe94> 10005\n<eabe96> <eabe9b> 10008\n<eabe9d> <eabeb7> 10014\n<eabeb8> <eabeb9> 1330\n<eabeba> <eabebb> 10041\n<eabebd> <eabebf> 10043\n<eabf81> <eabf86> 10046\n<eabf87> <eabf89> 1334\n<eabf8d> <eabf8e> 1338\n<eabf8f> <eabf93> 10054\n<eabf95> <eabf9b> 10059\n<eabf9d> <eabfa7> 10066\n<eabfa8> <eabfa9> 1342\n<eabfaa> <eabfaf> 10077\n<eabfb0> <eabfb1> 1344\n<eabfb2> <eabfb3> 10083\n<eabfb5> <eabfb7> 10085\n<eabfb9> <eabfbf> 10088\n<eb8080> <eb8081> 1348\n<eb8082> <eb8083> 10095\n<eb8085> <eb808b> 10097\n<eb808d> <eb808f> 10104\n<eb8091> <eb8093> 10107\n<eb8095> <eb809b> 10110\n<eb809c> <eb809d> 1354\n<eb809e> <eb80a7> 10117\n<eb80a9> <eb80bf> 10127\n<eb8180> <eb8183> 10150\n<eb8184> <eb8185> 1357\n<eb8186> <eb8187> 10154\n<eb818f> <eb8192> 10159\n<eb8193> <eb8195> 1363\n<eb819a> <eb819c> 10165\n<eb819e> <eb81bb> 10168\n<eb81bc> <eb81bd> 1369\n<eb81be> <eb81bf> 10198\n<eb8281> <eb8283> 10200\n<eb8285> <eb828b> 10203\n<eb828c> <eb828d> 1373\n<eb8292> <eb8297> 10212\n<eb8298> <eb829a> 1377\n<eb829d> <eb829e> 10219\n<eb829f> <eb82a2> 1381\n<eb82a3> <eb82a7> 10221\n<eb82a8> <eb82a9> 1385\n<eb82ab> <eb82af> 1387\n<eb82b3> <eb82b5> 1393\n<eb82b6> <eb82b7> 10229\n<eb82b9> <eb82bb> 10231\n<eb82bd> <eb82bf> 10234\n<eb8380> <eb8383> 10237\n<eb8384> <eb8385> 1398\n<eb8387> <eb8389> 1400\n<eb838a> <eb838f> 10242\n<eb8390> <eb8391> 1403\n<eb8392> <eb8393> 10248\n<eb8395> <eb8397> 10250\n<eb8399> <eb839f> 10253\n<eb83a1> <eb83a4> 10260\n<eb83a6> <eb83bf> 10264\n<eb8480> <eb8487> 10290\n<eb8488> <eb8489> 1409\n<eb848b> <eb848c> 1411\n<eb848d> <eb848f> 10299\n<eb8492> <eb8493> 1414\n<eb8494> <eb8497> 10303\n<eb8498> <eb8499> 1416\n<eb849b> <eb849d> 1418\n<eb849e> <eb84a2> 10308\n<eb84a3> <eb84a5> 1421\n<eb84a6> <eb84a7> 10313\n<eb84a9> <eb84ab> 10315\n<eb84ad> <eb84b3> 10318\n<eb84b4> <eb84b5> 1426\n<eb84b7> <eb84b9> 1428\n<eb84ba> <eb84bf> 10326\n<eb8580> <eb8581> 1431\n<eb8582> <eb8583> 10332\n<eb8585> <eb8587> 10334\n<eb8589> <eb858f> 10337\n<eb8590> <eb8591> 1435\n<eb8592> <eb8593> 10344\n<eb8594> <eb8595> 1437\n<eb8596> <eb8597> 10346\n<eb8599> <eb859b> 10348\n<eb859d> <eb859f> 10351\n<eb85a1> <eb85b7> 10354\n<eb85b8> <eb85b9> 1442\n<eb85ba> <eb85bb> 10377\n<eb85bd> <eb85bf> 10379\n<eb8683> <eb8687> 10383\n<eb8688> <eb8689> 1447\n<eb868e> <eb8691> 10390\n<eb8692> <eb8694> 1451\n<eb8695> <eb8697> 10394\n<eb8699> <eb869b> 10397\n<eb869d> <eb86a7> 10400\n<eb86a9> <eb86bf> 10411\nendcidrange\n\n100 begincidrange\n<eb8780> <eb878b> 10434\n<eb878d> <eb878f> 10446\n<eb8791> <eb8793> 10449\n<eb8795> <eb879b> 10452\n<eb879c> <eb879d> 1460\n<eb87a0> <eb87a7> 10460\n<eb87a8> <eb87a9> 1463\n<eb87aa> <eb87ab> 10468\n<eb87ad> <eb87af> 10470\n<eb87b1> <eb87b8> 10473\n<eb87be> <eb87bf> 10483\n<eb8880> <eb8883> 10485\n<eb8884> <eb8885> 1470\n<eb8886> <eb8887> 10489\n<eb8889> <eb888a> 10491\n<eb888b> <eb888c> 1473\n<eb888d> <eb8893> 10493\n<eb8894> <eb8895> 1475\n<eb889a> <eb889f> 10502\n<eb88a1> <eb88b3> 10508\n<eb88b5> <eb88bb> 10527\n<eb88bd> <eb88bf> 10534\n<eb8980> <eb8997> 10537\n<eb8999> <eb899b> 10561\n<eb899d> <eb899f> 10564\n<eb89a1> <eb89a7> 10567\n<eb89a8> <eb89a9> 1485\n<eb89aa> <eb89b3> 10574\n<eb89b4> <eb89b5> 1487\n<eb89b6> <eb89bb> 10584\n<eb89bd> <eb89bf> 10590\n<eb8a80> <eb8a83> 10593\n<eb8a84> <eb8a85> 1490\n<eb8a86> <eb8a88> 10597\n<eb8a8a> <eb8a8f> 10600\n<eb8a90> <eb8a91> 1493\n<eb8a92> <eb8a93> 10606\n<eb8a95> <eb8a97> 10608\n<eb8a98> <eb8a9a> 1496\n<eb8a9b> <eb8a9f> 10611\n<eb8aa0> <eb8aa1> 1499\n<eb8aa5> <eb8aa6> 1502\n<eb8aa7> <eb8aa9> 10618\n<eb8aad> <eb8aaf> 10622\n<eb8ab1> <eb8ab3> 10625\n<eb8ab5> <eb8abf> 10628\n<eb8b80> <eb8b87> 10639\n<eb8b88> <eb8b89> 1508\n<eb8b8a> <eb8b8b> 10647\n<eb8b8d> <eb8b8f> 10649\n<eb8b93> <eb8b97> 10653\n<eb8b98> <eb8b99> 1513\n<eb8b9e> <eb8ba1> 10660\n<eb8ba4> <eb8ba6> 1518\n<eb8ba9> <eb8baa> 10666\n<eb8bab> <eb8baf> 1522\n<eb8bb0> <eb8bb2> 10668\n<eb8bb3> <eb8bb5> 1527\n<eb8bb7> <eb8bbb> 1530\n<eb8bbc> <eb8bbe> 10672\n<eb8c80> <eb8c81> 1536\n<eb8c82> <eb8c83> 10675\n<eb8c85> <eb8c87> 10677\n<eb8c89> <eb8c8f> 10680\n<eb8c90> <eb8c91> 1540\n<eb8c93> <eb8c95> 1542\n<eb8c96> <eb8c9b> 10688\n<eb8c9d> <eb8cbf> 10694\n<eb8d80> <eb8d93> 10729\n<eb8d94> <eb8d96> 1546\n<eb8d99> <eb8d9a> 10750\n<eb8d9b> <eb8d9c> 1550\n<eb8d9e> <eb8d9f> 1552\n<eb8da0> <eb8da3> 10753\n<eb8da4> <eb8da5> 1554\n<eb8dac> <eb8dad> 10760\n<eb8db0> <eb8db1> 1560\n<eb8db2> <eb8db3> 10763\n<eb8db5> <eb8db7> 10765\n<eb8db9> <eb8dbf> 10768\n<eb8e80> <eb8e81> 1564\n<eb8e83> <eb8e85> 1566\n<eb8e86> <eb8e8b> 10776\n<eb8e8d> <eb8e8f> 10782\n<eb8e91> <eb8e93> 10785\n<eb8e95> <eb8e9f> 10788\n<eb8ea0> <eb8ea1> 1572\n<eb8ea2> <eb8ea7> 10799\n<eb8ea9> <eb8eab> 10805\n<eb8ead> <eb8ebf> 10808\n<eb8f80> <eb8f83> 10827\n<eb8f84> <eb8f85> 1576\n<eb8f86> <eb8f87> 10831\n<eb8f89> <eb8f8a> 10833\n<eb8f8b> <eb8f8c> 1579\n<eb8f91> <eb8f93> 10837\n<eb8f94> <eb8f95> 1583\n<eb8f9e> <eb8f9f> 10844\n<eb8fa1> <eb8fa3> 10846\n<eb8fa5> <eb8fa7> 10849\nendcidrange\n\n100 begincidrange\n<eb8fa9> <eb8fbb> 10852\n<eb8fbd> <eb8fbf> 10871\n<eb9080> <eb908f> 10874\n<eb9091> <eb9097> 10890\n<eb9099> <eb909b> 10897\n<eb909d> <eb909f> 10900\n<eb90a1> <eb90a7> 10903\n<eb90a8> <eb90a9> 1597\n<eb90ac> <eb90b3> 10911\n<eb90b5> <eb90bf> 10919\n<eb9180> <eb918f> 10930\n<eb9190> <eb9191> 1601\n<eb9192> <eb9193> 10946\n<eb9195> <eb9197> 10948\n<eb9199> <eb919f> 10951\n<eb91a0> <eb91a1> 1605\n<eb91a6> <eb91ab> 10960\n<eb91ad> <eb91bf> 10966\n<eb9281> <eb9287> 10985\n<eb9289> <eb929c> 10992\n<eb929e> <eb92a3> 11012\n<eb92a5> <eb92a7> 11018\n<eb92a9> <eb92ab> 11021\n<eb92ad> <eb92b4> 11024\n<eb92ba> <eb92bf> 11034\n<eb9381> <eb9383> 11040\n<eb9385> <eb9387> 11043\n<eb9389> <eb938f> 11046\n<eb9391> <eb9394> 11053\n<eb9396> <eb939b> 11057\n<eb939c> <eb939d> 1624\n<eb939e> <eb939f> 11063\n<eb93a1> <eb93a2> 11065\n<eb93a3> <eb93a4> 1627\n<eb93a7> <eb93ab> 11068\n<eb93ac> <eb93ad> 1630\n<eb93b2> <eb93b7> 11075\n<eb93b9> <eb93bf> 11081\n<eb9480> <eb9493> 11088\n<eb9494> <eb9495> 1635\n<eb9496> <eb9497> 11108\n<eb9499> <eb949a> 11110\n<eb949b> <eb949c> 1638\n<eb949d> <eb94a3> 11112\n<eb94a4> <eb94a5> 1640\n<eb94a7> <eb94aa> 1642\n<eb94ab> <eb94af> 11120\n<eb94b0> <eb94b1> 1646\n<eb94b2> <eb94b3> 11125\n<eb94b5> <eb94b7> 11127\n<eb94b9> <eb94bf> 11130\n<eb9580> <eb9581> 1650\n<eb9583> <eb9585> 1652\n<eb9586> <eb958a> 11138\n<eb958b> <eb958d> 1655\n<eb958e> <eb958f> 11143\n<eb9591> <eb9593> 11145\n<eb9595> <eb959b> 11148\n<eb959c> <eb959d> 1660\n<eb959f> <eb95a1> 1662\n<eb95a2> <eb95bf> 11156\n<eb9680> <eb969f> 11186\n<eb96a0> <eb96a1> 1665\n<eb96a2> <eb96a3> 11218\n<eb96a5> <eb96a7> 11220\n<eb96aa> <eb96ab> 1669\n<eb96ac> <eb96af> 11224\n<eb96b0> <eb96b1> 1671\n<eb96b3> <eb96b5> 1673\n<eb96b6> <eb96ba> 11229\n<eb96bb> <eb96bd> 1676\n<eb96be> <eb96bf> 11234\n<eb9781> <eb9783> 11236\n<eb9785> <eb978b> 11239\n<eb978c> <eb978d> 1681\n<eb978f> <eb9791> 1683\n<eb9792> <eb9797> 11247\n<eb9799> <eb97ab> 11253\n<eb97ad> <eb97bf> 11272\n<eb9880> <eb988f> 11291\n<eb9890> <eb9891> 1688\n<eb9892> <eb9893> 11307\n<eb9895> <eb9897> 11309\n<eb9899> <eb98a4> 11312\n<eb98a6> <eb98ab> 11324\n<eb98ad> <eb98b3> 11330\n<eb98b5> <eb98bf> 11337\n<eb9980> <eb9987> 11348\n<eb9989> <eb99a3> 11356\n<eb99a5> <eb99a7> 11383\n<eb99a9> <eb99bf> 11386\n<eb9a80> <eb9a9b> 11409\n<eb9a9c> <eb9a9d> 1698\n<eb9a9e> <eb9a9f> 11437\n<eb9aa1> <eb9aa3> 11439\n<eb9aa5> <eb9aaa> 11442\n<eb9aab> <eb9aac> 1702\n<eb9aad> <eb9ab0> 11448\n<eb9ab2> <eb9abf> 11452\n<eb9b80> <eb9b93> 11466\nendcidrange\n\n100 begincidrange\n<eb9b95> <eb9baf> 11486\n<eb9bb1> <eb9bb3> 11513\n<eb9bb5> <eb9bb7> 11516\n<eb9bb9> <eb9bbf> 11519\n<eb9c80> <eb9c81> 1709\n<eb9c82> <eb9c84> 11526\n<eb9c86> <eb9ca7> 11529\n<eb9ca8> <eb9ca9> 1712\n<eb9caa> <eb9cab> 11563\n<eb9cad> <eb9cae> 11565\n<eb9caf> <eb9cb0> 1715\n<eb9cb1> <eb9cb7> 11567\n<eb9cb8> <eb9cb9> 1717\n<eb9cbc> <eb9cbf> 11575\n<eb9d80> <eb9d83> 11579\n<eb9d85> <eb9d87> 11583\n<eb9d89> <eb9d8b> 11586\n<eb9d8d> <eb9d93> 11589\n<eb9d94> <eb9d95> 1723\n<eb9d96> <eb9d9f> 11596\n<eb9da1> <eb9da3> 11606\n<eb9da5> <eb9da7> 11609\n<eb9da9> <eb9daf> 11612\n<eb9db0> <eb9db1> 1728\n<eb9db6> <eb9dbb> 11621\n<eb9dbc> <eb9dbd> 1732\n<eb9dbe> <eb9dbf> 11627\n<eb9e81> <eb9e83> 11629\n<eb9e85> <eb9e8b> 11632\n<eb9e8c> <eb9e8d> 1736\n<eb9e8f> <eb9e92> 1738\n<eb9e93> <eb9e95> 11640\n<eb9e96> <eb9e99> 1742\n<eb9e9a> <eb9e9b> 11643\n<eb9e9d> <eb9e9f> 11645\n<eb9ea1> <eb9ea7> 11648\n<eb9ea8> <eb9ea9> 1748\n<eb9eab> <eb9ead> 1750\n<eb9eae> <eb9eb3> 11656\n<eb9eb4> <eb9eb5> 1753\n<eb9eb6> <eb9eb7> 11662\n<eb9eb9> <eb9ebf> 11664\n<eb9f80> <eb9f86> 11671\n<eb9f8a> <eb9fab> 11679\n<eb9fac> <eb9fad> 1758\n<eb9fae> <eb9faf> 11713\n<eb9fb1> <eb9fb3> 11715\n<eb9fb5> <eb9fbb> 11718\n<eb9fbc> <eb9fbd> 1762\n<eba080> <eba081> 1765\n<eba082> <eba086> 11726\n<eba087> <eba089> 1767\n<eba08a> <eba08b> 11731\n<eba08d> <eba08f> 11733\n<eba091> <eba097> 11736\n<eba098> <eba099> 1772\n<eba09e> <eba0a3> 11745\n<eba0a4> <eba0a5> 1776\n<eba0a6> <eba0a7> 11751\n<eba0a9> <eba0ab> 11753\n<eba0ad> <eba0b3> 11756\n<eba0b4> <eba0b5> 1780\n<eba0b7> <eba0b9> 1782\n<eba0ba> <eba0bf> 11764\n<eba181> <eba183> 11770\n<eba185> <eba190> 11773\n<eba194> <eba19b> 11786\n<eba19c> <eba19d> 1789\n<eba19e> <eba19f> 11794\n<eba1a1> <eba1a3> 11796\n<eba1a5> <eba1ab> 11799\n<eba1ac> <eba1ad> 1793\n<eba1b2> <eba1b7> 11808\n<eba1b9> <eba1bb> 11814\n<eba1bd> <eba1bf> 11817\n<eba280> <eba28c> 11820\n<eba28e> <eba2a7> 11833\n<eba2a9> <eba2af> 11859\n<eba2b1> <eba2b3> 11866\n<eba2b5> <eba2b7> 11869\n<eba2b9> <eba2bf> 11872\n<eba380> <eba381> 1804\n<eba386> <eba38b> 11881\n<eba38d> <eba38f> 11887\n<eba391> <eba393> 11890\n<eba395> <eba39c> 11893\n<eba3a2> <eba3a7> 11903\n<eba3a8> <eba3a9> 1814\n<eba3aa> <eba3ab> 11909\n<eba3ad> <eba3af> 11911\n<eba3b1> <eba3b7> 11914\n<eba3b8> <eba3b9> 1818\n<eba3be> <eba3bf> 11923\n<eba480> <eba483> 11925\n<eba485> <eba497> 11929\n<eba499> <eba49f> 11948\n<eba4a1> <eba4bb> 11955\n<eba4bc> <eba4bd> 1825\n<eba4be> <eba4bf> 11982\n<eba581> <eba583> 11984\nendcidrange\n\n100 begincidrange\n<eba585> <eba58b> 11987\n<eba58d> <eba58e> 11994\n<eba592> <eba597> 11997\n<eba598> <eba599> 1832\n<eba59a> <eba59b> 12003\n<eba59d> <eba59f> 12005\n<eba5a1> <eba5a7> 12008\n<eba5a8> <eba5a9> 1836\n<eba5ae> <eba5b3> 12017\n<eba5b4> <eba5b5> 1840\n<eba5b6> <eba5b7> 12023\n<eba5b9> <eba5bb> 12025\n<eba5bd> <eba5bf> 12028\n<eba680> <eba683> 12031\n<eba684> <eba685> 1844\n<eba689> <eba68a> 1847\n<eba68b> <eba68c> 12037\n<eba68d> <eba68e> 1849\n<eba68f> <eba6ab> 12039\n<eba6ac> <eba6ad> 1851\n<eba6ae> <eba6af> 12068\n<eba6b1> <eba6b3> 12070\n<eba6b5> <eba6bb> 12073\n<eba6bc> <eba6bd> 1855\n<eba782> <eba787> 12082\n<eba788> <eba789> 1859\n<eba78a> <eba78b> 12088\n<eba78e> <eba792> 1862\n<eba793> <eba797> 12091\n<eba798> <eba799> 1867\n<eba79d> <eba79e> 1870\n<eba79f> <eba7a0> 12098\n<eba7a3> <eba7a5> 1873\n<eba7a6> <eba7a7> 12101\n<eba7a9> <eba7ab> 12103\n<eba7ad> <eba7b3> 12106\n<eba7b4> <eba7b5> 1878\n<eba7b7> <eba7ba> 1880\n<eba7bb> <eba7bf> 12114\n<eba880> <eba881> 1884\n<eba882> <eba887> 12119\n<eba889> <eba894> 12125\n<eba896> <eba8b7> 12137\n<eba8b8> <eba8b9> 1888\n<eba8ba> <eba8bb> 12171\n<eba8bd> <eba8bf> 12173\n<eba983> <eba987> 12177\n<eba988> <eba989> 1893\n<eba98d> <eba98e> 1896\n<eba98f> <eba992> 12184\n<eba993> <eba995> 1898\n<eba996> <eba997> 12188\n<eba999> <eba99b> 12190\n<eba99d> <eba9a3> 12193\n<eba9a4> <eba9a5> 1903\n<eba9a7> <eba9a9> 1905\n<eba9aa> <eba9af> 12201\n<eba9b0> <eba9b1> 1908\n<eba9b2> <eba9b3> 12207\n<eba9b5> <eba9b7> 12209\n<eba9b9> <eba9bf> 12212\n<ebaa80> <ebaa82> 12219\n<ebaa83> <ebaa85> 1912\n<ebaa88> <ebaa8b> 12223\n<ebaa8d> <ebaaa7> 12227\n<ebaaa8> <ebaaa9> 1917\n<ebaaab> <ebaaac> 1919\n<ebaaad> <ebaaaf> 12255\n<ebaab3> <ebaab7> 12259\n<ebaab8> <ebaab9> 1923\n<ebaabe> <ebaabf> 12266\n<ebab80> <ebab83> 12268\n<ebab85> <ebab87> 12272\n<ebab89> <ebab97> 12275\n<ebab98> <ebab99> 1929\n<ebab9a> <ebabbb> 12290\n<ebabbd> <ebabbf> 12324\n<ebac81> <ebac83> 12327\n<ebac85> <ebac8c> 12330\n<ebac92> <ebac97> 12340\n<ebac99> <ebac9b> 12346\n<ebac9d> <ebac9f> 12349\n<ebaca1> <ebaca8> 12352\n<ebacac> <ebacb3> 12361\n<ebacb4> <ebacb6> 1942\n<ebacb9> <ebacba> 12370\n<ebacbb> <ebacbe> 1946\n<ebad80> <ebad83> 12373\n<ebad84> <ebad85> 1950\n<ebad8a> <ebad8c> 12379\n<ebad8f> <ebad90> 1955\n<ebad91> <ebad93> 12383\n<ebad95> <ebad97> 12386\n<ebad99> <ebada0> 12389\n<ebada4> <ebadab> 12398\n<ebadad> <ebadbf> 12406\n<ebae80> <ebae87> 12425\n<ebae89> <ebae8b> 12433\n<ebae8d> <ebae8f> 12436\n<ebae91> <ebaea3> 12439\nendcidrange\n\n100 begincidrange\n<ebaea5> <ebaea7> 12458\n<ebaea9> <ebaeab> 12461\n<ebaead> <ebaeb3> 12464\n<ebaeb5> <ebaeb6> 12471\n<ebaeb8> <ebaebf> 12473\n<ebaf81> <ebaf83> 12481\n<ebaf85> <ebaf87> 12484\n<ebaf89> <ebaf8f> 12487\n<ebaf91> <ebaf92> 12494\n<ebaf94> <ebafb7> 12496\n<ebafb8> <ebafb9> 1975\n<ebafba> <ebafbb> 12532\n<ebafbd> <ebafbe> 12534\n<ebb083> <ebb087> 12537\n<ebb088> <ebb089> 1981\n<ebb08b> <ebb08d> 1983\n<ebb092> <ebb093> 12545\n<ebb094> <ebb098> 1988\n<ebb099> <ebb09a> 12547\n<ebb09b> <ebb09f> 1993\n<ebb0a0> <ebb0a3> 12549\n<ebb0a4> <ebb0a5> 1998\n<ebb0aa> <ebb0ac> 12555\n<ebb0ae> <ebb0af> 12558\n<ebb0b0> <ebb0b1> 2003\n<ebb0b2> <ebb0b3> 12560\n<ebb0b5> <ebb0b7> 12562\n<ebb0b9> <ebb0bf> 12565\n<ebb180> <ebb181> 2007\n<ebb183> <ebb185> 2009\n<ebb186> <ebb188> 12573\n<ebb18a> <ebb18b> 12576\n<ebb18c> <ebb18d> 2013\n<ebb18e> <ebb18f> 12578\n<ebb191> <ebb19c> 12580\n<ebb19e> <ebb1bf> 12592\n<ebb280> <ebb283> 12626\n<ebb284> <ebb285> 2017\n<ebb286> <ebb287> 12630\n<ebb289> <ebb28a> 12632\n<ebb28b> <ebb28c> 2020\n<ebb28f> <ebb293> 12635\n<ebb294> <ebb295> 2023\n<ebb299> <ebb29a> 2026\n<ebb29b> <ebb29f> 12642\n<ebb2a0> <ebb2a1> 2028\n<ebb2a2> <ebb2a3> 12647\n<ebb2a5> <ebb2a6> 12649\n<ebb2a7> <ebb2a8> 2031\n<ebb2a9> <ebb2af> 12651\n<ebb2b0> <ebb2b1> 2033\n<ebb2b3> <ebb2b5> 2035\n<ebb2b6> <ebb2bb> 12659\n<ebb2bc> <ebb2bd> 2038\n<ebb2be> <ebb2bf> 12665\n<ebb381> <ebb383> 12667\n<ebb385> <ebb38c> 12670\n<ebb38f> <ebb391> 2043\n<ebb392> <ebb394> 12679\n<ebb396> <ebb397> 12682\n<ebb399> <ebb39b> 12684\n<ebb39d> <ebb3b3> 12687\n<ebb3b4> <ebb3b6> 2049\n<ebb3b9> <ebb3bb> 12711\n<ebb3bd> <ebb3bf> 12714\n<ebb480> <ebb483> 12717\n<ebb484> <ebb485> 2054\n<ebb48a> <ebb48f> 12723\n<ebb491> <ebb493> 12729\n<ebb495> <ebb4a3> 12732\n<ebb4a5> <ebb4ab> 12747\n<ebb4ad> <ebb4bf> 12754\n<ebb581> <ebb587> 12773\n<ebb588> <ebb589> 2063\n<ebb58a> <ebb58b> 12780\n<ebb58d> <ebb58f> 12782\n<ebb591> <ebb597> 12785\n<ebb598> <ebb599> 2067\n<ebb59a> <ebb5a3> 12792\n<ebb5a5> <ebb5a7> 12802\n<ebb5a9> <ebb5bf> 12805\n<ebb680> <ebb681> 2071\n<ebb682> <ebb683> 12828\n<ebb685> <ebb686> 12830\n<ebb687> <ebb68a> 2074\n<ebb68b> <ebb68f> 12832\n<ebb690> <ebb691> 2078\n<ebb696> <ebb698> 12839\n<ebb699> <ebb69a> 2082\n<ebb69d> <ebb6a3> 12843\n<ebb6a5> <ebb6af> 12850\n<ebb6b1> <ebb6b7> 12861\n<ebb6b9> <ebb6bf> 12868\n<ebb780> <ebb793> 12875\n<ebb794> <ebb795> 2088\n<ebb796> <ebb797> 12895\n<ebb799> <ebb79b> 12897\n<ebb79d> <ebb7a8> 12900\n<ebb7aa> <ebb7af> 12912\n<ebb7b1> <ebb7b3> 12918\nendcidrange\n\n100 begincidrange\n<ebb7b5> <ebb7b7> 12921\n<ebb7b9> <ebb7bf> 12924\n<ebb881> <ebb882> 12931\n<ebb886> <ebb88b> 12934\n<ebb88c> <ebb88d> 2099\n<ebb88e> <ebb88f> 12940\n<ebb891> <ebb893> 12942\n<ebb895> <ebb89b> 12945\n<ebb89c> <ebb89d> 2103\n<ebb8a0> <ebb8bf> 12953\n<ebb980> <ebb983> 12985\n<ebb984> <ebb985> 2106\n<ebb986> <ebb987> 12989\n<ebb989> <ebb98b> 12991\n<ebb98f> <ebb993> 12995\n<ebb994> <ebb995> 2111\n<ebb999> <ebb99b> 2114\n<ebb99c> <ebb99f> 13002\n<ebb9a0> <ebb9a1> 2117\n<ebb9a2> <ebb9a3> 13006\n<ebb9a5> <ebb9a7> 13008\n<ebb9ab> <ebb9af> 13012\n<ebb9b0> <ebb9b1> 2122\n<ebb9b3> <ebb9b5> 2124\n<ebb9b6> <ebb9ba> 13018\n<ebb9bb> <ebb9bd> 2127\n<ebb9be> <ebb9bf> 13023\n<ebba81> <ebba83> 13025\n<ebba85> <ebba8b> 13028\n<ebba8c> <ebba8d> 2132\n<ebba8f> <ebba91> 2134\n<ebba92> <ebba97> 13036\n<ebba98> <ebba99> 2137\n<ebba9a> <ebbaa7> 13042\n<ebbaa9> <ebbabf> 13056\n<ebbb80> <ebbb8f> 13079\n<ebbb90> <ebbb91> 2140\n<ebbb92> <ebbb93> 13095\n<ebbb95> <ebbb96> 13097\n<ebbb97> <ebbb98> 2143\n<ebbb99> <ebbb9f> 13099\n<ebbba1> <ebbba2> 13106\n<ebbba3> <ebbba5> 2146\n<ebbba6> <ebbbab> 13108\n<ebbbad> <ebbbbf> 13114\n<ebbc82> <ebbc87> 13134\n<ebbc88> <ebbc89> 2151\n<ebbc8a> <ebbc97> 13140\n<ebbc98> <ebbc99> 2153\n<ebbc9b> <ebbc9d> 2155\n<ebbc9e> <ebbcbf> 13155\n<ebbd80> <ebbd81> 2158\n<ebbd82> <ebbd83> 13189\n<ebbd85> <ebbd87> 13191\n<ebbd89> <ebbd8f> 13194\n<ebbd90> <ebbd91> 2162\n<ebbd92> <ebbd94> 13201\n<ebbd96> <ebbdbf> 13204\n<ebbe80> <ebbe93> 13246\n<ebbe95> <ebbeaf> 13266\n<ebbeb1> <ebbebf> 13293\n<ebbf80> <ebbf84> 13308\n<ebbf86> <ebbf8b> 13313\n<ebbf8c> <ebbf8d> 2168\n<ebbf8e> <ebbf8f> 13319\n<ebbf91> <ebbf93> 13321\n<ebbf95> <ebbf9b> 13324\n<ebbf9d> <ebbf9e> 13331\n<ebbfa2> <ebbfbf> 13334\n<ec8080> <ec80bb> 13364\n<ec80bd> <ec80bf> 13424\n<ec8180> <ec8190> 13427\n<ec8192> <ec8197> 13444\n<ec8199> <ec819b> 13450\n<ec819d> <ec819f> 13453\n<ec81a1> <ec81a7> 13456\n<ec81a8> <ec81a9> 2180\n<ec81aa> <ec81bf> 13463\n<ec8280> <ec828f> 13485\n<ec8290> <ec8291> 2182\n<ec8292> <ec8293> 13501\n<ec8295> <ec8297> 13503\n<ec8299> <ec829f> 13506\n<ec82a0> <ec82a1> 2186\n<ec82a6> <ec82ab> 13515\n<ec82ac> <ec82ad> 2190\n<ec82af> <ec82b0> 2192\n<ec82b1> <ec82b2> 13522\n<ec82b3> <ec82b6> 2194\n<ec82b7> <ec82bb> 13524\n<ec82bc> <ec82bd> 2198\n<ec8380> <ec8381> 2201\n<ec8382> <ec8384> 13530\n<ec8386> <ec8387> 13533\n<ec8388> <ec8389> 2204\n<ec838a> <ec838b> 13535\n<ec838d> <ec838f> 13537\n<ec8391> <ec8397> 13540\n<ec8398> <ec8399> 2208\n<ec839b> <ec839d> 2210\nendcidrange\n\n100 begincidrange\n<ec839e> <ec83a3> 13548\n<ec83a4> <ec83a5> 2213\n<ec83a6> <ec83a7> 13554\n<ec83a9> <ec83ab> 13556\n<ec83ad> <ec83b3> 13559\n<ec83b4> <ec83b5> 2217\n<ec83ba> <ec83bf> 13568\n<ec8481> <ec8483> 13574\n<ec8485> <ec8487> 13577\n<ec8489> <ec848f> 13580\n<ec8491> <ec8494> 13587\n<ec8496> <ec849b> 13591\n<ec849c> <ec84a0> 2226\n<ec84a1> <ec84a2> 13597\n<ec84a3> <ec84a4> 2231\n<ec84a6> <ec84a7> 2233\n<ec84a8> <ec84ab> 13600\n<ec84ac> <ec84ad> 2235\n<ec84af> <ec84b1> 2237\n<ec84b2> <ec84b5> 13605\n<ec84b8> <ec84b9> 2241\n<ec84ba> <ec84bb> 13610\n<ec84bd> <ec84bf> 13612\n<ec8581> <ec8587> 13615\n<ec8588> <ec8589> 2245\n<ec858b> <ec858d> 2247\n<ec858e> <ec8593> 13623\n<ec8594> <ec8595> 2250\n<ec8596> <ec8597> 13629\n<ec8599> <ec859b> 13631\n<ec859d> <ec85a3> 13634\n<ec85a4> <ec85a5> 2254\n<ec85a7> <ec85a9> 2256\n<ec85aa> <ec85af> 13642\n<ec85b1> <ec85b3> 13648\n<ec85b5> <ec85b7> 13651\n<ec85b9> <ec85bf> 13654\n<ec8680> <ec8684> 13661\n<ec8686> <ec868b> 13666\n<ec868c> <ec868e> 2263\n<ec8691> <ec8693> 13673\n<ec8697> <ec869b> 13677\n<ec869c> <ec869d> 2269\n<ec86a2> <ec86a4> 13684\n<ec86a6> <ec86a7> 13687\n<ec86a8> <ec86a9> 2274\n<ec86aa> <ec86ab> 13689\n<ec86ad> <ec86af> 13691\n<ec86b1> <ec86bc> 13694\n<ec86be> <ec86bf> 13706\n<ec8780> <ec8783> 13708\n<ec8785> <ec8787> 13712\n<ec8789> <ec878b> 13715\n<ec878d> <ec8793> 13718\n<ec8795> <ec8796> 13725\n<ec8797> <ec8798> 2283\n<ec8799> <ec879f> 13727\n<ec87a1> <ec87a3> 13734\n<ec87a5> <ec87a7> 13737\n<ec87a9> <ec87af> 13740\n<ec87b0> <ec87b1> 2288\n<ec87b4> <ec87bb> 13748\n<ec87bc> <ec87bd> 2291\n<ec87be> <ec87bf> 13756\n<ec8881> <ec8883> 13758\n<ec8885> <ec888b> 13761\n<ec888c> <ec888d> 2295\n<ec8892> <ec8897> 13770\n<ec8898> <ec8899> 2299\n<ec889a> <ec889b> 13776\n<ec889d> <ec889e> 13778\n<ec889f> <ec88a0> 2302\n<ec88a1> <ec88a7> 13780\n<ec88a8> <ec88a9> 2304\n<ec88b1> <ec88b2> 2309\n<ec88b5> <ec88bf> 13792\n<ec8980> <ec8987> 13803\n<ec8989> <ec898f> 13811\n<ec8990> <ec8991> 2313\n<ec8992> <ec8993> 13818\n<ec8995> <ec8997> 13820\n<ec8999> <ec899f> 13823\n<ec89a1> <ec89a4> 13830\n<ec89a6> <ec89ab> 13834\n<ec89ac> <ec89ad> 2319\n<ec89ae> <ec89af> 13840\n<ec89b1> <ec89b3> 13842\n<ec89b5> <ec89bb> 13845\n<ec89bc> <ec89bd> 2323\n<ec8a82> <ec8a87> 13854\n<ec8a88> <ec8a89> 2327\n<ec8a8a> <ec8a8f> 13860\n<ec8a91> <ec8a97> 13866\n<ec8a99> <ec8a9a> 13873\n<ec8a9e> <ec8aa3> 13876\n<ec8aa4> <ec8aa5> 2333\n<ec8aa6> <ec8aa7> 13882\n<ec8aa9> <ec8aab> 13884\n<ec8aac> <ec8aad> 2336\n<ec8aae> <ec8ab3> 13887\nendcidrange\n\n100 begincidrange\n<ec8ab4> <ec8ab5> 2338\n<ec8aba> <ec8abf> 13895\n<ec8b80> <ec8b9b> 13901\n<ec8b9c> <ec8b9d> 2342\n<ec8b9e> <ec8b9f> 13929\n<ec8ba1> <ec8ba2> 13931\n<ec8ba3> <ec8ba4> 2345\n<ec8ba5> <ec8baa> 13933\n<ec8bab> <ec8bad> 2347\n<ec8bb2> <ec8bb5> 13941\n<ec8bb8> <ec8bb9> 2353\n<ec8bbb> <ec8bbc> 2355\n<ec8bbd> <ec8bbf> 13947\n<ec8c81> <ec8c87> 13950\n<ec8c88> <ec8c89> 2358\n<ec8c8a> <ec8c8b> 13957\n<ec8c8c> <ec8c8d> 2360\n<ec8c8e> <ec8c92> 13959\n<ec8c93> <ec8c95> 2362\n<ec8c96> <ec8c97> 13964\n<ec8c99> <ec8c9b> 13966\n<ec8c9d> <ec8ca3> 13969\n<ec8ca4> <ec8ca5> 2367\n<ec8ca6> <ec8ca7> 13976\n<ec8ca8> <ec8ca9> 2369\n<ec8caa> <ec8cbf> 13978\n<ec8d80> <ec8d84> 14000\n<ec8d86> <ec8da7> 14005\n<ec8da8> <ec8da9> 2372\n<ec8daa> <ec8dab> 14039\n<ec8dad> <ec8daf> 14041\n<ec8db3> <ec8db7> 14045\n<ec8db8> <ec8db9> 2377\n<ec8dba> <ec8dbb> 14050\n<ec8dbc> <ec8dbd> 2379\n<ec8dbe> <ec8dbf> 14052\n<ec8e80> <ec8e83> 14054\n<ec8e85> <ec8e87> 14058\n<ec8e89> <ec8e8b> 14061\n<ec8e8d> <ec8ebf> 14064\n<ec8f81> <ec8f97> 14115\n<ec8f98> <ec8f99> 2385\n<ec8f9a> <ec8f9b> 14138\n<ec8f9d> <ec8f9e> 14140\n<ec8f9f> <ec8fa0> 2388\n<ec8fa3> <ec8fa7> 14143\n<ec8fa8> <ec8fa9> 2391\n<ec8faa> <ec8fac> 14148\n<ec8fae> <ec8fb3> 14151\n<ec8fb4> <ec8fb5> 2394\n<ec8fb6> <ec8fb7> 14157\n<ec8fb9> <ec8fbf> 14159\n<ec9080> <ec9087> 14166\n<ec9089> <ec908f> 14174\n<ec9091> <ec90a3> 14181\n<ec90a5> <ec90ab> 14200\n<ec90ad> <ec90af> 14207\n<ec90b1> <ec90b3> 14210\n<ec90b5> <ec90bb> 14213\n<ec90bc> <ec90bd> 2403\n<ec90be> <ec90bf> 14220\n<ec9180> <ec9187> 14222\n<ec9189> <ec91a3> 14230\n<ec91a4> <ec91a5> 2406\n<ec91a6> <ec91a7> 14257\n<ec91a9> <ec91ab> 14259\n<ec91ad> <ec91b3> 14262\n<ec91b4> <ec91b5> 2410\n<ec91b6> <ec91b8> 14269\n<ec91ba> <ec91bf> 14272\n<ec9281> <ec9293> 14278\n<ec9295> <ec929b> 14297\n<ec929d> <ec92b7> 14304\n<ec92b9> <ec92bb> 14331\n<ec92bd> <ec92bf> 14334\n<ec9380> <ec93a8> 14337\n<ec93aa> <ec93af> 14378\n<ec93b0> <ec93b1> 2419\n<ec93b2> <ec93b3> 14384\n<ec93b5> <ec93b7> 14386\n<ec93bb> <ec93be> 14390\n<ec9480> <ec9481> 2425\n<ec9482> <ec948b> 14394\n<ec948d> <ec948f> 14404\n<ec9491> <ec9493> 14407\n<ec9495> <ec949b> 14410\n<ec949d> <ec94a7> 14417\n<ec94a8> <ec94a9> 2431\n<ec94aa> <ec94ab> 14428\n<ec94ad> <ec94af> 14430\n<ec94b1> <ec94b7> 14433\n<ec94b8> <ec94b9> 2435\n<ec94be> <ec94bf> 14442\n<ec9580> <ec9583> 14444\n<ec9584> <ec9585> 2439\n<ec9586> <ec9587> 14448\n<ec9588> <ec958a> 2441\n<ec958c> <ec958e> 2444\n<ec958f> <ec9592> 14451\n<ec9593> <ec9595> 2447\nendcidrange\n\n100 begincidrange\n<ec9597> <ec9599> 2450\n<ec959a> <ec959c> 14456\n<ec959d> <ec959e> 2453\n<ec95a0> <ec95a1> 2455\n<ec95a2> <ec95a3> 14460\n<ec95a5> <ec95a7> 14462\n<ec95a9> <ec95af> 14465\n<ec95b0> <ec95b1> 2459\n<ec95b3> <ec95b5> 2461\n<ec95b6> <ec95bb> 14473\n<ec95bc> <ec95bd> 2464\n<ec95be> <ec95bf> 14479\n<ec9681> <ec9683> 14481\n<ec9685> <ec9686> 14484\n<ec9688> <ec968b> 14486\n<ec968c> <ec968d> 2469\n<ec9692> <ec9694> 14492\n<ec9697> <ec9698> 2474\n<ec9699> <ec969b> 14496\n<ec969d> <ec969f> 14499\n<ec96a1> <ec96a8> 14502\n<ec96aa> <ec96b3> 14510\n<ec96b4> <ec96b5> 2479\n<ec96b6> <ec96b7> 14520\n<ec96b8> <ec96b9> 2481\n<ec96bb> <ec96be> 2483\n<ec9780> <ec9783> 14524\n<ec9784> <ec978a> 2487\n<ec9790> <ec9791> 2496\n<ec9792> <ec9793> 14531\n<ec9795> <ec9797> 14533\n<ec9799> <ec979f> 14536\n<ec97a0> <ec97a1> 2500\n<ec97a6> <ec97ab> 14545\n<ec97ac> <ec97ae> 2504\n<ec97b1> <ec97b3> 14552\n<ec97b6> <ec97b7> 2509\n<ec97b8> <ec97bb> 14556\n<ec97bc> <ec97bf> 2511\n<ec9880> <ec9881> 2515\n<ec9882> <ec9884> 14560\n<ec9885> <ec9888> 2517\n<ec9889> <ec988b> 14563\n<ec988d> <ec988f> 14566\n<ec9891> <ec9897> 14569\n<ec9898> <ec9899> 2523\n<ec989b> <ec989c> 2525\n<ec989d> <ec98a3> 14577\n<ec98a4> <ec98a5> 2527\n<ec98a6> <ec98a7> 14584\n<ec98a9> <ec98ab> 14586\n<ec98ac> <ec98ae> 2530\n<ec98b1> <ec98b2> 14590\n<ec98b3> <ec98b5> 2534\n<ec98bc> <ec98bf> 14595\n<ec9980> <ec9981> 2540\n<ec9982> <ec9983> 14599\n<ec9985> <ec9987> 14601\n<ec9989> <ec998f> 14604\n<ec9990> <ec9991> 2544\n<ec9993> <ec9995> 2546\n<ec9996> <ec999b> 14612\n<ec999c> <ec999d> 2549\n<ec999e> <ec999f> 14618\n<ec99a1> <ec99ab> 14620\n<ec99ad> <ec99ae> 14631\n<ec99b2> <ec99b7> 14634\n<ec99b8> <ec99b9> 2555\n<ec99ba> <ec99bb> 14640\n<ec99bd> <ec99bf> 14642\n<ec9a81> <ec9a87> 14645\n<ec9a88> <ec9a89> 2559\n<ec9a8e> <ec9a93> 14654\n<ec9a94> <ec9a95> 2563\n<ec9a96> <ec9a97> 14660\n<ec9a99> <ec9a9b> 14662\n<ec9a9d> <ec9aa3> 14665\n<ec9aa4> <ec9aa5> 2567\n<ec9aaa> <ec9aaf> 14674\n<ec9ab0> <ec9ab1> 2571\n<ec9ab2> <ec9ab3> 14680\n<ec9ab5> <ec9ab7> 14682\n<ec9ab8> <ec9aba> 2574\n<ec9abb> <ec9abf> 14685\n<ec9b80> <ec9b81> 2577\n<ec9b86> <ec9b8b> 14692\n<ec9b8c> <ec9b8d> 2581\n<ec9b8e> <ec9b8f> 14698\n<ec9b91> <ec9b93> 14700\n<ec9b95> <ec9b9b> 14703\n<ec9b9c> <ec9b9d> 2585\n<ec9b9e> <ec9b9f> 14710\n<ec9ba0> <ec9ba1> 2587\n<ec9ba2> <ec9ba7> 14712\n<ec9ba8> <ec9ba9> 2589\n<ec9baa> <ec9bab> 14718\n<ec9bad> <ec9baf> 14720\n<ec9bb1> <ec9bb7> 14723\n<ec9bb8> <ec9bb9> 2593\n<ec9bba> <ec9bbc> 14730\nendcidrange\n\n100 begincidrange\n<ec9bbe> <ec9bbf> 14733\n<ec9c80> <ec9c83> 14735\n<ec9c84> <ec9c85> 2596\n<ec9c86> <ec9c87> 14739\n<ec9c89> <ec9c8b> 14741\n<ec9c8d> <ec9c93> 14744\n<ec9c94> <ec9c95> 2600\n<ec9c9a> <ec9c9f> 14753\n<ec9ca0> <ec9ca1> 2604\n<ec9ca2> <ec9ca3> 14759\n<ec9ca5> <ec9ca7> 14761\n<ec9ca9> <ec9caf> 14764\n<ec9cb0> <ec9cb1> 2608\n<ec9cb8> <ec9cbb> 14774\n<ec9cbc> <ec9cbd> 2613\n<ec9cbe> <ec9cbf> 14778\n<ec9d81> <ec9d83> 14780\n<ec9d85> <ec9d89> 14783\n<ec9d8c> <ec9d8d> 2618\n<ec9d91> <ec9d98> 2621\n<ec9d99> <ec9d9b> 14791\n<ec9d9d> <ec9d9f> 14794\n<ec9da1> <ec9da7> 14797\n<ec9da9> <ec9daa> 14804\n<ec9dac> <ec9db3> 14806\n<ec9db4> <ec9db5> 2633\n<ec9db6> <ec9db7> 14814\n<ec9db9> <ec9dbb> 14816\n<ec9dbc> <ec9dbe> 2636\n<ec9e80> <ec9e82> 14820\n<ec9e83> <ec9e85> 2639\n<ec9e87> <ec9e8a> 2642\n<ec9e8b> <ec9e8d> 14824\n<ec9e90> <ec9e91> 2647\n<ec9e92> <ec9e93> 14828\n<ec9e96> <ec9e98> 2650\n<ec9e9b> <ec9e9f> 14832\n<ec9ea0> <ec9ea1> 2654\n<ec9ea3> <ec9ea6> 2656\n<ec9ea7> <ec9eab> 14838\n<ec9eac> <ec9ead> 2660\n<ec9eae> <ec9eaf> 14843\n<ec9eb1> <ec9eb3> 14845\n<ec9eb5> <ec9ebb> 14848\n<ec9ebc> <ec9ebd> 2664\n<ec9f80> <ec9f81> 2667\n<ec9f82> <ec9f87> 14856\n<ec9f88> <ec9f89> 2669\n<ec9f8a> <ec9f8b> 14862\n<ec9f91> <ec9f97> 14866\n<ec9f99> <ec9f9c> 14873\n<ec9f9e> <ec9fa3> 14877\n<ec9fa5> <ec9fa7> 14883\n<ec9fa9> <ec9fab> 14886\n<ec9fad> <ec9fbf> 14889\n<eca080> <eca081> 2679\n<eca082> <eca083> 14908\n<eca085> <eca087> 14910\n<eca08b> <eca08f> 14914\n<eca090> <eca091> 2684\n<eca095> <eca096> 2687\n<eca097> <eca09b> 14921\n<eca09c> <eca09d> 2689\n<eca09e> <eca09f> 14926\n<eca0a1> <eca0a3> 14928\n<eca0a5> <eca0ab> 14931\n<eca0ac> <eca0ad> 2693\n<eca0b2> <eca0b7> 14940\n<eca0b9> <eca0bb> 14946\n<eca0bd> <eca0bf> 14949\n<eca181> <eca187> 14952\n<eca188> <eca189> 2700\n<eca18a> <eca18b> 14959\n<eca18c> <eca18d> 2702\n<eca18e> <eca193> 14961\n<eca195> <eca1af> 14967\n<eca1b0> <eca1b1> 2705\n<eca1b2> <eca1b3> 14994\n<eca1b5> <eca1b7> 14996\n<eca1bb> <eca1bf> 15000\n<eca280> <eca281> 2710\n<eca285> <eca287> 2713\n<eca288> <eca28a> 15007\n<eca28b> <eca28d> 2716\n<eca28e> <eca293> 15010\n<eca295> <eca29c> 15016\n<eca2a2> <eca2a7> 15026\n<eca2a9> <eca2bb> 15032\n<eca2bc> <eca2bd> 2724\n<eca2be> <eca2bf> 15051\n<eca380> <eca383> 15053\n<eca385> <eca387> 15057\n<eca389> <eca38b> 15060\n<eca38d> <eca393> 15063\n<eca394> <eca395> 2729\n<eca39a> <eca39f> 15072\n<eca3a0> <eca3a1> 2733\n<eca3a2> <eca3a3> 15078\n<eca3a5> <eca3b4> 15080\n<eca3b6> <eca3bb> 15096\nendcidrange\n\n100 begincidrange\n<eca3bc> <eca3bd> 2737\n<eca3be> <eca3bf> 15102\n<eca481> <eca483> 15104\n<eca484> <eca486> 2740\n<eca487> <eca48b> 15107\n<eca48c> <eca48d> 2743\n<eca492> <eca497> 15114\n<eca499> <eca4ab> 15120\n<eca4ad> <eca4b3> 15139\n<eca4b5> <eca4bf> 15146\n<eca580> <eca58f> 15157\n<eca590> <eca591> 2750\n<eca592> <eca593> 15173\n<eca595> <eca597> 15175\n<eca599> <eca59f> 15178\n<eca5a0> <eca5a1> 2754\n<eca5a4> <eca5ab> 15186\n<eca5ad> <eca5af> 15194\n<eca5b1> <eca5b3> 15197\n<eca5b5> <eca5bb> 15200\n<eca5bd> <eca5bf> 15207\n<eca680> <eca687> 15210\n<eca688> <eca689> 2761\n<eca68a> <eca68b> 15218\n<eca68d> <eca68f> 15220\n<eca691> <eca697> 15223\n<eca698> <eca699> 2765\n<eca69e> <eca6bf> 15232\n<eca780> <eca781> 2769\n<eca782> <eca783> 15266\n<eca785> <eca786> 15268\n<eca787> <eca788> 2772\n<eca78b> <eca78f> 15271\n<eca790> <eca791> 2775\n<eca795> <eca796> 2778\n<eca797> <eca798> 15278\n<eca799> <eca79a> 2780\n<eca79c> <eca79d> 2782\n<eca79e> <eca79f> 15281\n<eca7a5> <eca7a6> 15285\n<eca7a8> <eca7ab> 15287\n<eca7ac> <eca7ad> 2788\n<eca7af> <eca7b1> 2790\n<eca7b2> <eca7b7> 15292\n<eca7b8> <eca7b9> 2793\n<eca7ba> <eca7bb> 15298\n<eca7bd> <eca7bf> 15300\n<eca881> <eca887> 15303\n<eca888> <eca889> 2797\n<eca88b> <eca88d> 2799\n<eca88e> <eca893> 15311\n<eca895> <eca897> 15317\n<eca899> <eca8a8> 15320\n<eca8aa> <eca8bf> 15336\n<eca980> <eca98b> 15358\n<eca98c> <eca98d> 2805\n<eca98e> <eca98f> 15370\n<eca991> <eca993> 15372\n<eca995> <eca99b> 15375\n<eca99c> <eca99d> 2809\n<eca99f> <eca9a1> 2811\n<eca9a2> <eca9a7> 15383\n<eca9a9> <eca9bc> 15389\n<eca9be> <eca9bf> 15409\n<ecaa80> <ecaa83> 15411\n<ecaa85> <ecaa97> 15415\n<ecaa99> <ecaabb> 15434\n<ecaabc> <ecaabd> 2818\n<ecaabe> <ecaabf> 15469\n<ecab81> <ecab83> 15471\n<ecab85> <ecab8b> 15474\n<ecab8c> <ecab8d> 2822\n<ecab94> <ecab97> 15484\n<ecab98> <ecab99> 2827\n<ecab9a> <ecab9f> 15488\n<ecaba1> <ecabab> 15494\n<ecabad> <ecabb3> 15505\n<ecabb5> <ecabbf> 15512\n<ecac80> <ecac87> 15523\n<ecac89> <ecac8f> 15531\n<ecac91> <ecac93> 15538\n<ecac95> <ecac97> 15541\n<ecac99> <ecac9f> 15544\n<ecaca0> <ecaca1> 2836\n<ecaca2> <ecacbf> 15551\n<ecad82> <ecad87> 15582\n<ecad88> <ecad89> 2839\n<ecad8a> <ecad8b> 15588\n<ecad8d> <ecad8f> 15590\n<ecad91> <ecad97> 15593\n<ecad98> <ecad99> 2843\n<ecad9a> <ecad9c> 15600\n<ecad9e> <ecada3> 15603\n<ecada5> <ecadb7> 15609\n<ecadb8> <ecadb9> 2847\n<ecadba> <ecadbf> 15628\n<ecae80> <ecae9b> 15634\n<ecae9d> <ecaeb7> 15662\n<ecaeb9> <ecaebf> 15689\n<ecaf80> <ecaf93> 15696\nendcidrange\n\n100 begincidrange\n<ecaf95> <ecafa3> 15716\n<ecafa5> <ecafa6> 15731\n<ecafaa> <ecafbf> 15734\n<ecb080> <ecb08b> 15756\n<ecb08c> <ecb08d> 2855\n<ecb08e> <ecb08f> 15768\n<ecb091> <ecb093> 15770\n<ecb095> <ecb09b> 15773\n<ecb09c> <ecb09d> 2859\n<ecb09e> <ecb0a0> 15780\n<ecb0a1> <ecb0a2> 2861\n<ecb0a3> <ecb0a6> 15783\n<ecb0a7> <ecb0a9> 2863\n<ecb0aa> <ecb0ab> 15787\n<ecb0b1> <ecb0b7> 15791\n<ecb0b8> <ecb0b9> 2869\n<ecb0bb> <ecb0be> 2871\n<ecb180> <ecb183> 15800\n<ecb184> <ecb185> 2875\n<ecb186> <ecb187> 15804\n<ecb189> <ecb18b> 15806\n<ecb18d> <ecb193> 15809\n<ecb194> <ecb195> 2879\n<ecb197> <ecb199> 2881\n<ecb19a> <ecb19f> 15817\n<ecb1a1> <ecb1a3> 15823\n<ecb1a9> <ecb1af> 15828\n<ecb1b1> <ecb1b4> 15835\n<ecb1b6> <ecb1bf> 15839\n<ecb280> <ecb297> 15849\n<ecb298> <ecb299> 2890\n<ecb29a> <ecb29b> 15873\n<ecb29d> <ecb29f> 15875\n<ecb2a1> <ecb2a7> 15878\n<ecb2a8> <ecb2a9> 2894\n<ecb2ab> <ecb2ad> 2896\n<ecb2ae> <ecb2b3> 15886\n<ecb2b4> <ecb2b5> 2899\n<ecb2b6> <ecb2b7> 15892\n<ecb2b9> <ecb2bb> 15894\n<ecb2bd> <ecb2bf> 15897\n<ecb380> <ecb383> 15900\n<ecb384> <ecb385> 2903\n<ecb38a> <ecb38f> 15906\n<ecb391> <ecb393> 15912\n<ecb395> <ecb3a3> 15915\n<ecb3a5> <ecb3ab> 15930\n<ecb3ad> <ecb3af> 15937\n<ecb3b1> <ecb3bf> 15940\n<ecb482> <ecb487> 15956\n<ecb488> <ecb489> 2913\n<ecb48a> <ecb48b> 15962\n<ecb48d> <ecb48f> 15964\n<ecb491> <ecb497> 15967\n<ecb498> <ecb499> 2917\n<ecb49e> <ecb4a3> 15976\n<ecb4a5> <ecb4a7> 15982\n<ecb4a9> <ecb4ab> 15985\n<ecb4ad> <ecb4b8> 15988\n<ecb4ba> <ecb4bf> 16000\n<ecb580> <ecb59b> 16006\n<ecb59d> <ecb59f> 16034\n<ecb5a1> <ecb5a3> 16037\n<ecb5a5> <ecb5ab> 16040\n<ecb5ac> <ecb5ad> 2928\n<ecb5b2> <ecb5b7> 16049\n<ecb5b9> <ecb5bf> 16055\n<ecb680> <ecb687> 16062\n<ecb689> <ecb693> 16070\n<ecb694> <ecb695> 2934\n<ecb696> <ecb697> 16081\n<ecb699> <ecb69b> 16083\n<ecb69d> <ecb6a3> 16086\n<ecb6a4> <ecb6a5> 2938\n<ecb6aa> <ecb6af> 16095\n<ecb6b1> <ecb6bf> 16101\n<ecb780> <ecb783> 16116\n<ecb785> <ecb78b> 16120\n<ecb78d> <ecb78f> 16127\n<ecb791> <ecb7a7> 16130\n<ecb7a9> <ecb7ab> 16153\n<ecb7ad> <ecb7af> 16156\n<ecb7b1> <ecb7b7> 16159\n<ecb7b8> <ecb7b9> 2949\n<ecb7be> <ecb7bf> 16168\n<ecb880> <ecb883> 16170\n<ecb885> <ecb887> 16174\n<ecb889> <ecb88b> 16177\n<ecb88d> <ecb893> 16180\n<ecb895> <ecb898> 16187\n<ecb89a> <ecb89f> 16191\n<ecb8a0> <ecb8a1> 2958\n<ecb8a2> <ecb8a3> 16197\n<ecb8a5> <ecb8a7> 16199\n<ecb8a9> <ecb8af> 16202\n<ecb8b0> <ecb8b1> 2962\n<ecb8b6> <ecb8bf> 16211\n<ecb980> <ecb997> 16221\n<ecb998> <ecb999> 2966\n<ecb99a> <ecb99b> 16245\nendcidrange\n\n100 begincidrange\n<ecb99d> <ecb99e> 16247\n<ecb99f> <ecb9a1> 2969\n<ecb9a2> <ecb9a7> 16249\n<ecb9a8> <ecb9a9> 2972\n<ecb9ae> <ecb9b3> 16257\n<ecb9b4> <ecb9b5> 2976\n<ecb9b6> <ecb9b7> 16263\n<ecb9b9> <ecb9bb> 16265\n<ecb9bd> <ecb9bf> 16268\n<ecba80> <ecba83> 16271\n<ecba84> <ecba85> 2980\n<ecba8a> <ecba8f> 16277\n<ecba90> <ecba91> 2984\n<ecba92> <ecba93> 16283\n<ecba95> <ecba97> 16285\n<ecba99> <ecba9f> 16288\n<ecbaa0> <ecbaa1> 2988\n<ecbaa3> <ecbaa5> 2990\n<ecbaa6> <ecbaab> 16296\n<ecbaac> <ecbaad> 2993\n<ecbaae> <ecbabf> 16302\n<ecbb82> <ecbba3> 16321\n<ecbba4> <ecbba5> 2996\n<ecbba6> <ecbba7> 16355\n<ecbba9> <ecbbaa> 16357\n<ecbbab> <ecbbac> 2999\n<ecbbad> <ecbbb3> 16359\n<ecbbb4> <ecbbb5> 3001\n<ecbbb7> <ecbbb9> 3003\n<ecbbba> <ecbbbf> 16367\n<ecbc80> <ecbc81> 3006\n<ecbc82> <ecbc83> 16373\n<ecbc85> <ecbc87> 16375\n<ecbc89> <ecbc8f> 16378\n<ecbc90> <ecbc91> 3010\n<ecbc96> <ecbc9b> 16387\n<ecbc9d> <ecbc9f> 16393\n<ecbca1> <ecbca3> 16396\n<ecbca5> <ecbcab> 16399\n<ecbcac> <ecbcad> 3017\n<ecbcaf> <ecbcb1> 3019\n<ecbcb2> <ecbcb7> 16407\n<ecbcb9> <ecbcbf> 16413\n<ecbd80> <ecbd93> 16420\n<ecbd94> <ecbd95> 3023\n<ecbd96> <ecbd97> 16440\n<ecbd99> <ecbd9b> 16442\n<ecbd9d> <ecbda3> 16445\n<ecbda4> <ecbda5> 3027\n<ecbdaa> <ecbdaf> 16454\n<ecbdb0> <ecbdb1> 3031\n<ecbdb2> <ecbdb3> 16460\n<ecbdb5> <ecbdb7> 16462\n<ecbdb9> <ecbdbf> 16465\n<ecbe81> <ecbe84> 16472\n<ecbe86> <ecbe8b> 16476\n<ecbe8d> <ecbea0> 16482\n<ecbea2> <ecbea7> 16502\n<ecbea9> <ecbeaf> 16508\n<ecbeb1> <ecbebf> 16515\n<ecbf80> <ecbf83> 16530\n<ecbf85> <ecbf9f> 16534\n<ecbfa0> <ecbfa1> 3042\n<ecbfa2> <ecbfa3> 16561\n<ecbfa5> <ecbfa7> 16563\n<ecbfa9> <ecbfaf> 16566\n<ecbfb0> <ecbfb1> 3046\n<ecbfb6> <ecbfbb> 16575\n<ecbfbd> <ecbfbf> 16581\n<ed8081> <ed8083> 16584\n<ed8085> <ed8090> 16587\n<ed8092> <ed8097> 16599\n<ed8099> <ed80ac> 16605\n<ed80ae> <ed80b3> 16625\n<ed80b4> <ed80b5> 3056\n<ed80b6> <ed80b7> 16631\n<ed80b9> <ed80bb> 16633\n<ed80bd> <ed80bf> 16636\n<ed8180> <ed8183> 16639\n<ed8184> <ed8185> 3060\n<ed818a> <ed818f> 16645\n<ed8191> <ed8193> 16651\n<ed8195> <ed8197> 16654\n<ed8199> <ed819f> 16657\n<ed81a1> <ed81ab> 16664\n<ed81ac> <ed81ad> 3068\n<ed81ae> <ed81af> 16675\n<ed81b1> <ed81b3> 16677\n<ed81b5> <ed81bb> 16680\n<ed81bc> <ed81bd> 3072\n<ed81be> <ed81bf> 16687\n<ed8282> <ed82a3> 16690\n<ed82a4> <ed82a5> 3075\n<ed82a6> <ed82a7> 16724\n<ed82a9> <ed82ab> 16726\n<ed82ad> <ed82b3> 16729\n<ed82b4> <ed82b5> 3079\n<ed82ba> <ed82bf> 16738\n<ed8380> <ed8381> 3083\n<ed8382> <ed8383> 16744\nendcidrange\n\n100 begincidrange\n<ed8385> <ed8387> 16746\n<ed8388> <ed8389> 3086\n<ed838a> <ed838f> 16749\n<ed8390> <ed8391> 3088\n<ed8393> <ed8395> 3090\n<ed8396> <ed839b> 16756\n<ed839c> <ed839d> 3093\n<ed839e> <ed839f> 16762\n<ed83a1> <ed83a3> 16764\n<ed83a5> <ed83ab> 16767\n<ed83ac> <ed83ad> 3097\n<ed83af> <ed83b1> 3099\n<ed83b2> <ed83b7> 16775\n<ed83b9> <ed83bf> 16781\n<ed8480> <ed848c> 16788\n<ed848e> <ed84af> 16801\n<ed84b0> <ed84b1> 3104\n<ed84b2> <ed84b3> 16835\n<ed84b5> <ed84b7> 16837\n<ed84bb> <ed84bf> 16841\n<ed8580> <ed8581> 3109\n<ed8583> <ed8585> 3111\n<ed8586> <ed858b> 16847\n<ed858c> <ed858d> 3114\n<ed858e> <ed858f> 16853\n<ed8591> <ed8593> 16855\n<ed8595> <ed859b> 16858\n<ed859c> <ed859d> 3118\n<ed85a2> <ed85a7> 16867\n<ed85a9> <ed85ab> 16873\n<ed85ad> <ed85bb> 16876\n<ed85bd> <ed85bf> 16891\n<ed8680> <ed8683> 16894\n<ed8685> <ed8687> 16898\n<ed8689> <ed869f> 16901\n<ed86a0> <ed86a1> 3127\n<ed86a2> <ed86a3> 16924\n<ed86a5> <ed86a7> 16926\n<ed86a9> <ed86af> 16929\n<ed86b0> <ed86b1> 3131\n<ed86b6> <ed86b9> 16938\n<ed86bd> <ed86bf> 16943\n<ed8781> <ed8797> 16946\n<ed8799> <ed87b3> 16969\n<ed87b5> <ed87b7> 16996\n<ed87b9> <ed87bf> 16999\n<ed8880> <ed8886> 17006\n<ed888a> <ed888f> 17014\n<ed8891> <ed88ab> 17020\n<ed88ac> <ed88ad> 3144\n<ed88ae> <ed88af> 17047\n<ed88b1> <ed88b3> 17049\n<ed88b5> <ed88bb> 17052\n<ed88bc> <ed88bd> 3148\n<ed8982> <ed8987> 17061\n<ed8989> <ed899b> 17067\n<ed899d> <ed89a3> 17086\n<ed89a5> <ed89bf> 17093\n<ed8a80> <ed8a81> 3155\n<ed8a82> <ed8a83> 17120\n<ed8a85> <ed8a87> 17122\n<ed8a89> <ed8a8f> 17125\n<ed8a90> <ed8a91> 3159\n<ed8a92> <ed8a94> 17132\n<ed8a96> <ed8a9b> 17135\n<ed8a9d> <ed8a9f> 17141\n<ed8aa1> <ed8aa3> 17144\n<ed8aa5> <ed8aab> 17147\n<ed8aad> <ed8ab0> 17154\n<ed8ab2> <ed8ab7> 17158\n<ed8ab8> <ed8ab9> 3167\n<ed8aba> <ed8abb> 17164\n<ed8abd> <ed8abe> 17166\n<ed8b83> <ed8b87> 17169\n<ed8b88> <ed8b89> 3173\n<ed8b8c> <ed8b93> 17175\n<ed8b95> <ed8b97> 17183\n<ed8b99> <ed8b9b> 17186\n<ed8b9d> <ed8ba3> 17189\n<ed8ba4> <ed8ba5> 3179\n<ed8ba6> <ed8baf> 17196\n<ed8bb0> <ed8bb1> 3181\n<ed8bb2> <ed8bb3> 17206\n<ed8bb5> <ed8bb7> 17208\n<ed8bb9> <ed8bbf> 17211\n<ed8c80> <ed8c81> 3185\n<ed8c86> <ed8c8b> 17220\n<ed8c8c> <ed8c8e> 3189\n<ed8c91> <ed8c93> 17227\n<ed8c97> <ed8c9b> 17231\n<ed8c9c> <ed8c9d> 3195\n<ed8c9f> <ed8ca1> 3197\n<ed8ca2> <ed8ca4> 17237\n<ed8ca6> <ed8ca7> 17240\n<ed8ca8> <ed8ca9> 3201\n<ed8caa> <ed8cab> 17242\n<ed8cad> <ed8caf> 17244\n<ed8cb1> <ed8cb7> 17247\n<ed8cb8> <ed8cb9> 3205\n<ed8cbb> <ed8cbd> 3207\nendcidrange\n\n100 begincidrange\n<ed8cbe> <ed8cbf> 17255\n<ed8d80> <ed8d83> 17257\n<ed8d84> <ed8d85> 3210\n<ed8d86> <ed8dbb> 17261\n<ed8dbc> <ed8dbd> 3212\n<ed8dbe> <ed8dbf> 17315\n<ed8e81> <ed8e83> 17317\n<ed8e85> <ed8e8b> 17320\n<ed8e8c> <ed8e8d> 3216\n<ed8e8f> <ed8e91> 3218\n<ed8e92> <ed8e97> 17328\n<ed8e98> <ed8e99> 3221\n<ed8e9a> <ed8e9b> 17334\n<ed8e9d> <ed8e9f> 17336\n<ed8ea1> <ed8ea7> 17339\n<ed8ea8> <ed8ea9> 3225\n<ed8eae> <ed8eb3> 17348\n<ed8eb5> <ed8eb7> 17354\n<ed8eb9> <ed8ebb> 17357\n<ed8ebd> <ed8ebf> 17360\n<ed8f80> <ed8f83> 17363\n<ed8f84> <ed8f85> 3232\n<ed8f86> <ed8f87> 17367\n<ed8f88> <ed8f89> 3234\n<ed8f8a> <ed8f8f> 17369\n<ed8f91> <ed8f97> 17375\n<ed8f99> <ed8fa0> 17382\n<ed8fa4> <ed8fab> 17391\n<ed8fac> <ed8fad> 3240\n<ed8fae> <ed8faf> 17399\n<ed8fb1> <ed8fb3> 17401\n<ed8fb5> <ed8fbb> 17404\n<ed8fbc> <ed8fbd> 3244\n<ed9082> <ed9087> 17413\n<ed9089> <ed909c> 17419\n<ed909e> <ed90bf> 17439\n<ed9181> <ed9183> 17473\n<ed9185> <ed919b> 17476\n<ed919d> <ed919f> 17499\n<ed91a1> <ed91a3> 17502\n<ed91a5> <ed91ac> 17505\n<ed91b0> <ed91b7> 17514\n<ed91b8> <ed91b9> 3257\n<ed91ba> <ed91bb> 17522\n<ed91bd> <ed91be> 17524\n<ed9283> <ed9287> 17527\n<ed9288> <ed9289> 3263\n<ed928e> <ed9293> 17534\n<ed9295> <ed92a8> 17540\n<ed92aa> <ed92bf> 17560\n<ed9380> <ed938b> 17582\n<ed938d> <ed938f> 17594\n<ed9391> <ed9393> 17597\n<ed9395> <ed939b> 17600\n<ed939d> <ed939e> 17607\n<ed93a0> <ed93a7> 17609\n<ed93a9> <ed93ab> 17617\n<ed93ad> <ed93af> 17620\n<ed93b1> <ed93b7> 17623\n<ed93b9> <ed93ba> 17630\n<ed93be> <ed93bf> 17633\n<ed9480> <ed9483> 17635\n<ed9485> <ed9487> 17639\n<ed9489> <ed948b> 17642\n<ed948d> <ed9493> 17645\n<ed9494> <ed9495> 3283\n<ed9498> <ed94bb> 17653\n<ed94bc> <ed94bd> 3286\n<ed94be> <ed94bf> 17689\n<ed9581> <ed9583> 17691\n<ed9585> <ed958b> 17694\n<ed958c> <ed958d> 3290\n<ed9592> <ed9597> 17703\n<ed9598> <ed9599> 3294\n<ed959a> <ed959b> 17709\n<ed959d> <ed959f> 17711\n<ed95a1> <ed95a4> 17714\n<ed95a6> <ed95a7> 17718\n<ed95a8> <ed95a9> 3299\n<ed95ae> <ed95b3> 17722\n<ed95b4> <ed95b5> 3303\n<ed95b6> <ed95b7> 17728\n<ed95b9> <ed95bb> 17730\n<ed95bd> <ed95bf> 17733\n<ed9680> <ed9683> 17736\n<ed9684> <ed9685> 3307\n<ed9687> <ed9689> 3309\n<ed968a> <ed968f> 17741\n<ed9691> <ed96a4> 17747\n<ed96a6> <ed96bf> 17767\n<ed9780> <ed9787> 17793\n<ed9788> <ed9789> 3314\n<ed978a> <ed978b> 17801\n<ed978d> <ed978f> 17803\n<ed9793> <ed9797> 17807\n<ed9798> <ed9799> 3319\n<ed979e> <ed97a3> 17814\n<ed97a4> <ed97a5> 3323\n<ed97a6> <ed97a7> 17820\n<ed97a9> <ed97ab> 17822\nendcidrange\n\n100 begincidrange\n<ed97ad> <ed97b3> 17825\n<ed97b4> <ed97b5> 3327\n<ed97ba> <ed97bf> 17834\n<ed9880> <ed9881> 3331\n<ed9882> <ed9883> 17840\n<ed9885> <ed9887> 17842\n<ed9889> <ed988f> 17845\n<ed9890> <ed9891> 3335\n<ed9893> <ed9895> 3337\n<ed9896> <ed989b> 17853\n<ed989d> <ed989f> 17859\n<ed98a1> <ed98a3> 17862\n<ed98a5> <ed98ac> 17865\n<ed98ae> <ed98b7> 17873\n<ed98b8> <ed98b9> 3344\n<ed98ba> <ed98bb> 17883\n<ed98bd> <ed98bf> 17885\n<ed9981> <ed9984> 17888\n<ed9986> <ed9987> 17892\n<ed9988> <ed9989> 3349\n<ed998e> <ed9990> 17896\n<ed9992> <ed9993> 17899\n<ed9994> <ed9995> 3354\n<ed9996> <ed9997> 17901\n<ed9999> <ed999b> 17903\n<ed999d> <ed99a6> 17906\n<ed99aa> <ed99af> 17917\n<ed99b0> <ed99b1> 3360\n<ed99b2> <ed99b3> 17923\n<ed99b5> <ed99bf> 17925\n<ed9a80> <ed9a82> 17936\n<ed9a86> <ed9a8b> 17940\n<ed9a8c> <ed9a8d> 3365\n<ed9a8e> <ed9a8f> 17946\n<ed9a91> <ed9a93> 17948\n<ed9a95> <ed9a9c> 17951\n<ed9aa2> <ed9aa7> 17961\n<ed9aa9> <ed9aab> 17967\n<ed9aad> <ed9aaf> 17970\n<ed9ab1> <ed9ab8> 17973\n<ed9abc> <ed9abf> 17982\n<ed9b80> <ed9b83> 17986\n<ed9b84> <ed9b85> 3377\n<ed9b86> <ed9b87> 17990\n<ed9b89> <ed9b8b> 17992\n<ed9b8d> <ed9b90> 17995\n<ed9b92> <ed9b93> 17999\n<ed9b95> <ed9b96> 18001\n<ed9b9a> <ed9b9f> 18004\n<ed9ba1> <ed9ba3> 18010\n<ed9ba5> <ed9ba7> 18013\n<ed9ba9> <ed9baf> 18016\n<ed9bb1> <ed9bb4> 18023\n<ed9bb6> <ed9bbb> 18027\n<ed9bbc> <ed9bbd> 3390\n<ed9bbe> <ed9bbf> 18033\n<ed9c81> <ed9c83> 18035\n<ed9c85> <ed9c90> 18038\n<ed9c92> <ed9c97> 18050\n<ed9c98> <ed9c99> 3395\n<ed9c9a> <ed9c9b> 18056\n<ed9c9d> <ed9c9f> 18058\n<ed9ca1> <ed9ca7> 18061\n<ed9ca8> <ed9ca9> 3399\n<ed9cae> <ed9cb3> 18070\n<ed9cb4> <ed9cb5> 3403\n<ed9cb6> <ed9cb7> 18076\n<ed9cb9> <ed9cbb> 18078\n<ed9cbd> <ed9cbf> 18081\n<ed9d80> <ed9d83> 18084\n<ed9d85> <ed9d86> 18088\n<ed9d8a> <ed9d8f> 18091\n<ed9d90> <ed9d91> 3410\n<ed9d92> <ed9d93> 18097\n<ed9d96> <ed9d99> 3413\n<ed9d9a> <ed9d9f> 18100\n<ed9da0> <ed9da1> 3417\n<ed9da6> <ed9da8> 18108\n<ed9daa> <ed9dab> 18111\n<ed9dad> <ed9daf> 18113\n<ed9db1> <ed9db3> 18116\n<ed9db5> <ed9dbb> 18119\n<ed9dbc> <ed9dbd> 3425\n<ed9dbe> <ed9dbf> 18126\n<ed9e82> <ed9e87> 18129\n<ed9e88> <ed9e89> 3428\n<ed9e8a> <ed9e8b> 18135\n<ed9e8d> <ed9e8f> 18137\n<ed9e91> <ed9e97> 18140\n<ed9e98> <ed9e99> 3432\n<ed9e9e> <ed9ea3> 18149\n<efa48d> <efa493> 4375\n<efa495> <efa497> 4382\n<efa498> <efa49d> 4386\n<efa49e> <efa4a0> 4394\n<efa4a3> <efa4a4> 4406\n<efa4a5> <efa4ab> 4409\n<efa4ac> <efa4ad> 4419\n<efa4b0> <efa4b1> 4513\n<efa4b2> <efa4b7> 4517\nendcidrange\n\n41 begincidrange\n<efa4b8> <efa4ba> 4524\n<efa4bb> <efa4bf> 4528\n<efa581> <efa583> 4535\n<efa584> <efa585> 4541\n<efa586> <efa588> 4545\n<efa58b> <efa58e> 4566\n<efa58f> <efa590> 4571\n<efa592> <efa595> 4604\n<efa596> <efa599> 4609\n<efa5b5> <efa5b7> 4425\n<efa5b8> <efa5ba> 4429\n<efa5bb> <efa5bd> 4435\n<efa684> <efa685> 4449\n<efa687> <efa68c> 4455\n<efa68f> <efa690> 4465\n<efa692> <efa694> 4468\n<efa696> <efa697> 4471\n<efa69a> <efa69b> 4475\n<efa69c> <efa69d> 4478\n<efa69f> <efa6a0> 4481\n<efa6a6> <efa6a8> 4487\n<efa6ab> <efa6ad> 4493\n<efa6b1> <efa6b4> 4501\n<efa6b6> <efa6b8> 4508\n<efa6ba> <efa6bc> 4551\n<efa780> <efa781> 4556\n<efa782> <efa783> 4560\n<efa78a> <efa78b> 4581\n<efa790> <efa793> 4590\n<efa794> <efa796> 4595\n<efa797> <efa79a> 4599\n<efa7a1> <efa7a2> 4620\n<efa7a7> <efa7a9> 4632\n<efa7ab> <efa7ac> 4188\n<efa7ae> <efa7b0> 4640\n<efa7b1> <efa7b5> 4644\n<efa7b7> <efa7b9> 4653\n<efbc81> <efbcbb> 264\n<efbcbd> <efbcbf> 324\n<efbd80> <efbd9d> 327\n<efbfa0> <efbfa1> 143\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/UniKS-UTF8-V",
    "content": "%!PS-Adobe-3.0 Resource-CMap\n%%DocumentNeededResources: ProcSet (CIDInit)\n%%DocumentNeededResources: CMap (UniKS-UTF8-H)\n%%IncludeResource: ProcSet (CIDInit)\n%%IncludeResource: CMap (UniKS-UTF8-H)\n%%BeginResource: CMap (UniKS-UTF8-V)\n%%Title: (UniKS-UTF8-V Adobe Korea1 1)\n%%Version: 11.002\n%%Copyright: -----------------------------------------------------------\n%%Copyright: Copyright 1990-2009 Adobe Systems Incorporated.\n%%Copyright: All rights reserved.\n%%Copyright:\n%%Copyright: Redistribution and use in source and binary forms, with or\n%%Copyright: without modification, are permitted provided that the\n%%Copyright: following conditions are met:\n%%Copyright:\n%%Copyright: Redistributions of source code must retain the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer.\n%%Copyright:\n%%Copyright: Redistributions in binary form must reproduce the above\n%%Copyright: copyright notice, this list of conditions and the following\n%%Copyright: disclaimer in the documentation and/or other materials\n%%Copyright: provided with the distribution.\n%%Copyright:\n%%Copyright: Neither the name of Adobe Systems Incorporated nor the names\n%%Copyright: of its contributors may be used to endorse or promote\n%%Copyright: products derived from this software without specific prior\n%%Copyright: written permission.\n%%Copyright:\n%%Copyright: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n%%Copyright: CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n%%Copyright: INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n%%Copyright: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n%%Copyright: DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n%%Copyright: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n%%Copyright: SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n%%Copyright: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n%%Copyright: LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n%%Copyright: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n%%Copyright: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n%%Copyright: OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n%%Copyright: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n%%Copyright: -----------------------------------------------------------\n%%EndComments\n\n/CIDInit /ProcSet findresource begin\n\n12 dict begin\n\nbegincmap\n\n/UniKS-UTF8-H usecmap\n\n/CIDSystemInfo 3 dict dup begin\n  /Registry (Adobe) def\n  /Ordering (Korea1) def\n  /Supplement 1 def\nend def\n\n/CMapName /UniKS-UTF8-V def\n/CMapVersion 11.002 def\n/CMapType 1 def\n\n/XUID [1 10 25415] def\n\n/WMode 1 def\n\n11 begincidchar\n<e28096> 8061\n<e280a5> 8058\n<e38093> 8075\n<efbc81> 8076\n<efbc8c> 8079\n<efbc8e> 8080\n<efbcbb> 8087\n<efbcbd> 8088\n<efbcbf> 8089\n<efbd9e> 8062\n<efbfa3> 8093\nendcidchar\n\n7 begincidrange\n<e28093> <e28094> 8059\n<e38081> <e38082> 8056\n<e38088> <e38091> 8065\n<e38094> <e38095> 8063\n<efbc88> <efbc89> 8077\n<efbc9a> <efbc9f> 8081\n<efbd9b> <efbd9d> 8090\nendcidrange\n\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend\n\n%%EndResource\n%%EOF\n"
  },
  {
    "path": "mupdf/resources/cmaps/korea/UniKS-X",
    "content": "begincmap\n/CMapName /UniKS-X def\n/WMode 0 def\nbegincidchar\n<a1>208\n<a4>214\n<a7>155\n<a8>107\n<aa>668\n<ab>176\n<b0>138\n<b1>130\n<b4>199\n<b6>244\n<b8>206\n<b9>842\n<ba>675\n<bb>177\n<bc>751\n<bd>748\n<be>752\n<bf>209\n<c6>666\n<d0>667\n<d7>131\n<d8>673\n<de>676\n<df>768\n<e6>757\n<f0>759\n<f7>132\n<f8>766\n<fe>769\n<0111>758\n<0126>669\n<0127>760\n<0131>761\n<0132>670\n<0133>762\n<0138>763\n<013f>671\n<0140>764\n<0141>672\n<0142>765\n<0149>772\n<014a>678\n<014b>771\n<0152>674\n<0153>767\n<0166>677\n<0167>770\n<02bc>8275\n<02c7>201\n<02d8>202\n<02d9>205\n<02da>204\n<02db>207\n<02dc>200\n<02dd>203\n<0401>1026\n<0451>1059\n<2016>111\n<201b>8238\n<201f>8237\n<2022>8607\n<2030>216\n<2034>8582\n<2035>9326\n<2036>9324\n<203b>156\n<203c>8763\n<2042>8599\n<2074>845\n<207c>8248\n<207f>846\n<2103>141\n<2109>215\n<2113>590\n<2116>258\n<2121>263\n<2122>260\n<2126>643\n<212b>142\n<2192>170\n<2195>247\n<2196>250\n<2197>248\n<2198>251\n<2199>249\n<21b0>8868\n<21b1>8865\n<21b2>8864\n<21b3>8869\n<21b4>8867\n<21bc>8884\n<21c0>8885\n<21cd>8816\n<21cf>8815\n<21d0>8814\n<21d1>8854\n<21d2>195\n<21d3>8855\n<21d4>196\n<21e0>9190\n<21e1>9192\n<21e2>9191\n<21e3>9193\n<21e6>9198\n<21e7>9200\n<21e8>9199\n<21e9>9201\n<2200>197\n<2202>151\n<2203>198\n<2206>8715\n<2207>152\n<2208>184\n<2209>8749\n<220b>185\n<220c>8750\n<220f>213\n<2211>212\n<2213>8726\n<221a>178\n<221d>180\n<221e>136\n<221f>8717\n<2220>148\n<2222>8738\n<2229>191\n<222a>190\n<222e>211\n<2234>137\n<2235>181\n<2236>210\n<2237>8321\n<223d>179\n<2243>8500\n<2245>8499\n<2248>8501\n<2250>8739\n<2251>8723\n<2252>154\n<2253>8722\n<225a>8753\n<2260>133\n<2261>153\n<2262>8734\n<2279>8491\n<2284>8748\n<2285>8747\n<228a>8486\n<228b>8488\n<22a3>8742\n<22a4>8503\n<22a5>149\n<22ee>8320\n<22ef>106\n<2306>8754\n<2312>150\n<2314>8731\n<2500>519\n<2501>530\n<2502>520\n<2503>531\n<250c>521\n<250d>558\n<250e>557\n<250f>532\n<2510>522\n<2511>552\n<2512>551\n<2513>533\n<2514>524\n<2515>556\n<2516>555\n<2517>535\n<2518>523\n<2519>554\n<251a>553\n<251b>534\n<251c>525\n<251d>546\n<2520>541\n<2523>536\n<2524>527\n<2525>548\n<2528>543\n<252b>538\n<252c>526\n<252f>542\n<2530>547\n<2533>537\n<2534>528\n<2537>544\n<2538>549\n<253b>539\n<253c>529\n<253f>545\n<2542>550\n<254b>540\n<2592>232\n<25a0>165\n<25a1>164\n<25a3>229\n<25a6>237\n<25a7>236\n<25a8>235\n<25a9>238\n<25b1>8736\n<25b2>167\n<25b3>166\n<25b5>8780\n<25b6>220\n<25b7>219\n<25b9>8781\n<25bc>169\n<25bd>168\n<25bf>8779\n<25c0>218\n<25c1>217\n<25c3>8782\n<25c6>163\n<25c7>162\n<25c8>228\n<25c9>227\n<25ca>8787\n<25cb>159\n<25cc>8639\n<25ce>161\n<25cf>160\n<25e6>8775\n<25ef>8633\n<2605>158\n<2606>157\n<260e>241\n<260f>240\n<261c>242\n<261d>9222\n<261e>243\n<261f>9223\n<262f>8664\n<2640>147\n<2642>146\n<2663>226\n<2664>221\n<2665>224\n<2667>225\n<2668>239\n<266c>255\n<266d>252\n<266f>8594\n<2716>8631\n<271a>8630\n<273d>8604\n<2756>8637\n<3003>108\n<3012>8700\n<3013>175\n<3020>8671\n<3036>8701\n<30fb>104\n<30fc>9330\n<3164>101\n<321c>257\n<3231>8788\n<3239>8789\n<327f>256\n<3290>9300\n<3294>9080\n<329e>8761\n<32a5>9096\n<3398>591\n<33c2>261\n<33c3>662\n<33c4>592\n<33c5>650\n<33c6>665\n<33c7>259\n<33c8>614\n<33c9>663\n<33ca>607\n<33cb>8790\n<33cf>611\n<33d0>660\n<33d3>661\n<33d6>649\n<33d8>262\n<33db>654\n<33dc>664\n<33dd>659\n<4e00>6460\n<4e01>6704\n<4e03>7364\n<4e07>4670\n<4e08>6534\n<4e09>5320\n<4e0a>5331\n<4e0b>7616\n<4e0d>5109\n<4e11>7288\n<4e14>7041\n<4e15>5181\n<4e16>5492\n<4e18>3893\n<4e19>5041\n<4e1e>5682\n<4e2d>6922\n<4e32>3802\n<4e38>7882\n<4e39>4192\n<4e3b>6860\n<4e42>6029\n<4e43>4154\n<4e45>3894\n<4e4b>6942\n<4e4d>5241\n<4e4e>7800\n<4e4f>7614\n<4e56>3855\n<4e58>5683\n<4e59>6380\n<4e5d>3895\n<4e5e>3613\n<4e5f>5862\n<4e6b>3500\n<4e6d>4329\n<4e73>6309\n<4e76>5092\n<4e77>5315\n<4e7e>3601\n<4e82>4389\n<4e86>4551\n<4e88>5934\n<4e8b>5242\n<4e8c>6413\n<4e8e>6197\n<4e90>6252\n<4e91>6238\n<4e92>7801\n<4e94>6049\n<4e95>6705\n<4e98>4058\n<4e9b>5243\n<4e9e>5775\n<4ea1>4696\n<4ea2>7670\n<4ea4>3868\n<4ea5>7685\n<4ea6>5947\n<4ea8>7771\n<4eab>7710\n<4eac>3660\n<4ead>6706\n<4eae>4427\n<4eb6>4193\n<4eba>6443\n<4ec0>5771\n<4ec1>6444\n<4ec4>7331\n<4ec7>3896\n<4eca>4038\n<4ecb>3560\n<4ecd>6479\n<4ed4>6483\n<4ed5>5244\n<4ed6>7380\n<4ed7>6535\n<4ed8>5110\n<4ed9>5418\n<4edd>4331\n<4edf>7148\n<4ee3>4250\n<4ee4>4489\n<4ee5>6414\n<4ef0>5833\n<4ef2>6923\n<4ef6>3602\n<4ef7>3561\n<4efb>6469\n<4f01>4062\n<4f09>7671\n<4f0a>6415\n<4f0b>4051\n<4f0d>6050\n<4f0e>4063\n<4f0f>5074\n<4f10>5005\n<4f11>8005\n<4f2f>4988\n<4f34>4905\n<4f36>4490\n<4f38>5735\n<4f3a>5245\n<4f3c>5246\n<4f3d>3436\n<4f43>6643\n<4f46>4194\n<4f47>6591\n<4f48>7544\n<4f4d>6284\n<4f4e>6592\n<4f4f>6861\n<4f50>6854\n<4f51>6198\n<4f55>7617\n<4f59>5935\n<4f5a>6461\n<4f5b>5171\n<4f5c>6509\n<4f69>7502\n<4f6f>5879\n<4f70>4989\n<4f73>3437\n<4f76>4127\n<4f7a>6644\n<4f7e>6462\n<4f7f>5247\n<4f81>5736\n<4f83>3476\n<4f84>7015\n<4f86>4420\n<4f88>7336\n<4f8a>3839\n<4f8b>4506\n<4f8d>5692\n<4f8f>6862\n<4f91>6310\n<4f96>4594\n<4f98>7042\n<4f9b>3786\n<4f9d>6394\n<4fae>4764\n<4faf>7966\n<4fb5>7367\n<4fb6>4440\n<4fbf>7518\n<4fc2>3705\n<4fc3>7241\n<4fc4>5776\n<4fc9>6051\n<4fca>6902\n<4fce>6782\n<4fd1>6174\n<4fd3>3661\n<4fd4>7734\n<4fd7>5537\n<4fda>4613\n<4fdd>5058\n<4fdf>5248\n<4fe0>7759\n<4fe1>5737\n<4fee>5567\n<4fef>5111\n<4ff1>3897\n<4ff3>4970\n<4ff5>7576\n<4ff8>5093\n<4ffa>5925\n<5002>5042\n<5006>4428\n<5009>7092\n<500b>3562\n<500d>4969\n<5011>4836\n<5012>4269\n<5016>7705\n<5019>7967\n<501a>6395\n<501c>7134\n<501e>3662\n<501f>7043\n<5021>7093\n<5023>4941\n<5024>7337\n<5026>3969\n<5027>6837\n<5028>3585\n<502a>6030\n<502b>4595\n<502c>7394\n<502d>6131\n<503b>5863\n<5043>5917\n<5047>3438\n<5048>3627\n<5049>6285\n<504f>7519\n<5055>7686\n<505a>6863\n<505c>6707\n<5065>3603\n<5074>7330\n<5075>6708\n<5076>6199\n<5078>7465\n<5080>3856\n<5085>5112\n<508d>4942\n<5091>3614\n<5098>5303\n<5099>5182\n<50ac>7262\n<50ad>6175\n<50b2>6052\n<50b3>6645\n<50b5>7114\n<50b7>5332\n<50be>3663\n<50c5>4023\n<50c9>7177\n<50ca>5419\n<50cf>5333\n<50d1>3869\n<50d5>5075\n<50d6>8035\n<50da>4552\n<50de>6286\n<50e5>6140\n<50e7>5684\n<50ed>7082\n<50f9>3439\n<50fb>5020\n<50ff>5249\n<5100>6396\n<5101>6903\n<5104>5912\n<5106>3664\n<5109>3617\n<5112>6311\n<511f>5334\n<5121>4543\n<512a>6200\n<5132>6593\n<5137>4441\n<513a>4133\n<513c>5926\n<5140>6089\n<5141>6359\n<5143>6255\n<5144>7772\n<5145>7306\n<5146>6783\n<5147>8013\n<5148>5420\n<5149>3840\n<514b>4016\n<514c>7431\n<514d>4735\n<514e>7449\n<5152>5777\n<515c>4348\n<5162>4059\n<5165>6477\n<5167>4155\n<5168>6646\n<5169>4429\n<516a>6312\n<516b>7499\n<516c>3787\n<516d>4591\n<516e>7791\n<5171>3788\n<5175>5043\n<5176>4064\n<5177>3898\n<5178>6647\n<517c>3654\n<5180>4065\n<5186>5933\n<518a>7126\n<518d>6570\n<5192>4765\n<5195>4736\n<5197>6176\n<51a0>3819\n<51a5>4748\n<51aa>4733\n<51ac>4332\n<51b6>5864\n<51b7>4424\n<51bd>4477\n<51c4>7130\n<51c6>6904\n<51c9>4430\n<51cb>6784\n<51cc>4607\n<51cd>4333\n<51dc>4606\n<51dd>6390\n<51de>8036\n<51e1>5009\n<51f0>7904\n<51f1>3563\n<51f6>8014\n<51f8>7167\n<51f9>6141\n<51fa>7303\n<51fd>7651\n<5200>4270\n<5203>6445\n<5206>5152\n<5207>6684\n<5208>6031\n<520a>3477\n<520e>4837\n<5211>7773\n<5217>4478\n<521d>7214\n<5224>7490\n<5225>5037\n<5229>4614\n<522a>5304\n<522e>3835\n<5230>4271\n<5236>6759\n<5237>5561\n<5238>3970\n<5239>7077\n<523a>6484\n<523b>3465\n<5243>7205\n<5247>7360\n<524a>5301\n<524b>4017\n<524c>4397\n<524d>6648\n<5254>7135\n<5256>5113\n<525b>3536\n<525d>4886\n<5261>5463\n<5269>6480\n<526a>6649\n<526f>5114\n<5272>7649\n<5275>7094\n<527d>7577\n<527f>7215\n<5283>7948\n<5287>4018\n<5288>5021\n<5289>4577\n<528d>3618\n<5291>6760\n<5292>3619\n<529b>4458\n<529f>3789\n<52a0>3440\n<52a3>4479\n<52a4>4024\n<52a9>6785\n<52aa>4169\n<52ab>3624\n<52be>7703\n<52c1>3665\n<52c3>4930\n<52c5>7361\n<52c7>6177\n<52c9>4737\n<52cd>3666\n<52d2>4604\n<52d5>4334\n<52d6>6229\n<52d8>3510\n<52d9>4812\n<52db>7979\n<52dd>5685\n<52de>4511\n<52df>4766\n<52e2>5493\n<52e3>6619\n<52e4>4025\n<52f3>7980\n<52f5>4442\n<52f8>3971\n<52fa>6510\n<52fb>4009\n<52fe>3899\n<52ff>4848\n<5305>7545\n<5308>8015\n<530d>7546\n<530f>7547\n<5310>5076\n<5315>5183\n<5316>7863\n<5317>5151\n<5319>5693\n<5320>6536\n<5321>3841\n<5323>3530\n<532a>5184\n<532f>7928\n<5339>7604\n<533f>4188\n<5340>3900\n<5341>5772\n<5343>7149\n<5344>6478\n<5347>5686\n<5348>6053\n<5349>7994\n<534a>4906\n<534d>4671\n<5351>5185\n<5352>6834\n<5353>7395\n<5354>7760\n<5357>4145\n<535a>4887\n<535c>5077\n<535e>5031\n<5360>6692\n<5366>3852\n<5368>5450\n<536f>4800\n<5370>6446\n<5371>6287\n<5374>3466\n<5375>4390\n<5377>3972\n<537d>6926\n<537f>3667\n<5384>5851\n<5393>5840\n<5398>4615\n<539a>7968\n<539f>6256\n<53a0>7332\n<53a5>3979\n<53a6>7618\n<53ad>5989\n<53bb>3586\n<53c3>7083\n<53c8>6201\n<53c9>7044\n<53ca>4052\n<53cb>6202\n<53cd>4907\n<53d4>5628\n<53d6>7316\n<53d7>5568\n<53db>4908\n<53e1>6032\n<53e2>7251\n<53e3>3901\n<53e4>3729\n<53e5>3902\n<53e9>3730\n<53ea>6943\n<53eb>3994\n<53ec>5500\n<53ed>7500\n<53ef>3441\n<53f0>7432\n<53f1>7016\n<53f2>5250\n<53f3>6203\n<53f8>5251\n<5403>8023\n<5404>3467\n<5408>7663\n<5409>4128\n<540a>6620\n<540c>4335\n<540d>4749\n<540e>7969\n<540f>4616\n<5410>7450\n<5411>7711\n<541b>3953\n<541d>4638\n<541f>6381\n<5420>7534\n<5426>5115\n<5429>5153\n<542b>7652\n<5433>6055\n<5438>8030\n<5439>7317\n<543b>4838\n<543c>7970\n<543e>6054\n<5442>4443\n<5448>6709\n<544a>3731\n<5451>7408\n<5468>6867\n<546a>6866\n<5471>3732\n<5473>4851\n<5475>3442\n<547b>5738\n<547c>7802\n<547d>4750\n<5480>6594\n<5486>7548\n<548c>7864\n<548e>3903\n<5490>5116\n<54a4>7381\n<54a8>6485\n<54ab>6944\n<54ac>3870\n<54b3>7687\n<54b8>7653\n<54bd>6447\n<54c0>5841\n<54c1>7590\n<54c4>7853\n<54c8>7664\n<54c9>6571\n<54e1>6257\n<54e5>3443\n<54e8>7216\n<54ed>3767\n<54ee>7953\n<54f2>7168\n<54fa>7549\n<5504>7503\n<5506>5252\n<5507>6980\n<550e>4617\n<5510>4239\n<551c>4689\n<552f>6313\n<5531>7095\n<5535>5821\n<553e>7382\n<5544>7396\n<5546>5335\n<554f>4839\n<5553>3706\n<5556>4217\n<555e>5778\n<5563>7654\n<557c>6761\n<5580>3579\n<5584>5421\n<5586>7169\n<5587>4374\n<5589>7971\n<558a>7655\n<5598>7150\n<5599>7995\n<559a>7883\n<559c>8037\n<559d>3501\n<55a7>7990\n<55a9>6314\n<55aa>5336\n<55ab>4132\n<55ac>3871\n<55ae>4195\n<55c5>7972\n<55c7>5365\n<55d4>6981\n<55da>6056\n<55dc>4066\n<55df>7045\n<55e3>5253\n<55e4>7338\n<55fd>5569\n<55fe>6868\n<5606>7409\n<5609>3444\n<5614>3904\n<5617>5337\n<562f>5501\n<5632>6786\n<5634>7318\n<5636>5694\n<5653>7719\n<5668>4067\n<566b>8038\n<5674>5154\n<5686>7954\n<56a5>5956\n<56ac>5223\n<56ae>7712\n<56b4>5927\n<56bc>6511\n<56ca>4152\n<56cd>8039\n<56d1>7242\n<56da>5570\n<56db>5254\n<56de>7929\n<56e0>6448\n<56f0>3774\n<56f9>4491\n<56fa>3733\n<5703>7550\n<5704>5902\n<5708>3973\n<570b>3947\n<570d>6288\n<5712>6259\n<5713>6258\n<5716>4272\n<5718>4196\n<571f>7451\n<5728>6572\n<572d>3995\n<5730>6945\n<573b>4068\n<5740>6946\n<5742>7491\n<5747>4010\n<574a>4943\n<574d>4218\n<574e>3511\n<5750>6855\n<5751>3581\n<5761>7474\n<5764>3775\n<5766>7410\n<576a>7529\n<576e>4252\n<5770>3668\n<5775>3905\n<577c>7397\n<5782>5571\n<5788>4251\n<578b>7774\n<5793>7688\n<57a0>6373\n<57a2>3906\n<57a3>6260\n<57c3>5842\n<57c7>6178\n<57c8>6905\n<57cb>4708\n<57ce>5474\n<57df>5948\n<57e0>5117\n<57f0>7115\n<57f4>5720\n<57f7>7032\n<57f9>4971\n<57fa>4069\n<57fc>4070\n<5800>3959\n<5802>4240\n<5805>3637\n<5806>7459\n<5808>3537\n<5809>6355\n<580a>5793\n<581e>7187\n<5821>5059\n<5824>6762\n<5827>5957\n<582a>3512\n<582f>6142\n<5830>5918\n<5831>5060\n<5834>6537\n<5835>4273\n<583a>3707\n<584a>3857\n<584b>6002\n<584f>3564\n<5851>5502\n<5854>7424\n<5857>4274\n<5858>4241\n<585a>7252\n<585e>5362\n<5861>6650\n<5862>6057\n<5864>7981\n<5875>6982\n<5879>7084\n<587c>6651\n<587e>5629\n<5883>3669\n<5885>5373\n<5889>6179\n<5893>4801\n<589c>7265\n<589e>6931\n<589f>7720\n<58a8>4834\n<58a9>4319\n<58ae>7383\n<58b3>5155\n<58ba>6058\n<58bb>6538\n<58be>3478\n<58c1>5022\n<58c5>6090\n<58c7>4197\n<58ce>7982\n<58d1>7630\n<58d3>5829\n<58d5>7803\n<58d8>4564\n<58d9>3842\n<58de>3858\n<58df>4536\n<58e4>5880\n<58eb>5255\n<58ec>6470\n<58ef>6539\n<58f9>6463\n<58fa>7804\n<58fb>5374\n<58fd>5572\n<590f>7619\n<5914>4071\n<5915>5403\n<5916>6135\n<5919>5630\n<591a>4190\n<591c>5865\n<5922>4797\n<5927>4253\n<5929>7151\n<592a>7433\n<592b>5118\n<592d>6143\n<592e>5834\n<5931>5758\n<5937>6416\n<593e>7761\n<5944>5928\n<5947>4072\n<5948>4156\n<5949>5094\n<594e>3996\n<594f>6869\n<5950>7884\n<5951>3708\n<5954>5156\n<5955>7730\n<5957>7466\n<595a>7689\n<5960>6652\n<5962>5256\n<5967>6059\n<596a>7418\n<596b>6360\n<596c>6540\n<596d>5404\n<596e>5157\n<5973>4159\n<5974>4170\n<5978>3479\n<597d>7805\n<5982>5936\n<5983>5186\n<5984>4697\n<598a>6471\n<5993>4073\n<5996>6144\n<5997>4039\n<5999>4802\n<59a5>7384\n<59a8>4944\n<59ac>7467\n<59b9>4709\n<59bb>7131\n<59be>7188\n<59c3>6710\n<59c6>4767\n<59c9>6486\n<59cb>5695\n<59d0>6595\n<59d1>3734\n<59d3>5475\n<59d4>6289\n<59d9>6472\n<59da>6145\n<59dc>3538\n<59dd>6864\n<59e6>3480\n<59e8>6417\n<59ea>7017\n<59ec>8040\n<59ee>7672\n<59f8>5958\n<59fb>6449\n<59ff>6487\n<5a01>6290\n<5a03>6132\n<5a11>5257\n<5a18>4153\n<5a1b>6060\n<5a1c>4134\n<5a1f>5959\n<5a20>5739\n<5a25>5779\n<5a29>4672\n<5a36>7319\n<5a3c>7096\n<5a41>4565\n<5a46>7475\n<5a49>6107\n<5a5a>7844\n<5a62>5187\n<5a66>5119\n<5a92>4710\n<5a9a>4852\n<5a9b>6261\n<5aa4>5696\n<5ac1>3445\n<5ac2>5573\n<5ac4>6262\n<5ac9>7018\n<5acc>7758\n<5ae1>6621\n<5ae6>7673\n<5ae9>4181\n<5b05>7865\n<5b09>8041\n<5b0b>5422\n<5b0c>3872\n<5b16>7535\n<5b2a>5224\n<5b40>5338\n<5b43>5881\n<5b50>6488\n<5b51>7754\n<5b54>3790\n<5b55>6481\n<5b57>6489\n<5b58>6832\n<5b5a>5120\n<5b5c>6490\n<5b5d>7955\n<5b5f>4727\n<5b63>3709\n<5b64>3735\n<5b69>7690\n<5b6b>5546\n<5b70>5631\n<5b71>6522\n<5b75>5121\n<5b78>7631\n<5b7a>6315\n<5b7c>5923\n<5b85>4266\n<5b87>6204\n<5b88>5574\n<5b89>5807\n<5b8b>5553\n<5b8c>6108\n<5b8f>3864\n<5b93>5078\n<5b95>7427\n<5b96>7950\n<5b97>6838\n<5b98>3820\n<5b99>6870\n<5b9a>6711\n<5b9b>6109\n<5b9c>6397\n<5ba2>3580\n<5ba3>5423\n<5ba4>5759\n<5ba5>6316\n<5ba6>7885\n<5bac>5476\n<5bae>3963\n<5bb0>6573\n<5bb3>7691\n<5bb4>5960\n<5bb5>5503\n<5bb6>3446\n<5bb8>5740\n<5bb9>6180\n<5bbf>5632\n<5bc0>7116\n<5bc2>6622\n<5bc3>6263\n<5bc4>4074\n<5bc5>6450\n<5bc6>4883\n<5bc7>3907\n<5bcc>5122\n<5bd0>4711\n<5bd2>7635\n<5bd3>6205\n<5bd4>5721\n<5bd7>4168\n<5bde>4664\n<5bdf>7078\n<5be1>3803\n<5be2>7368\n<5be4>6061\n<5be5>6146\n<5be6>5760\n<5be7>4167\n<5be8>7117\n<5be9>5762\n<5beb>5258\n<5bec>3821\n<5bee>4553\n<5bef>6906\n<5bf5>7253\n<5bf6>5061\n<5bf8>7247\n<5bfa>5259\n<5c01>5095\n<5c04>5260\n<5c07>6541\n<5c08>6653\n<5c09>6291\n<5c0a>6833\n<5c0b>5763\n<5c0d>4254\n<5c0e>4275\n<5c0f>5504\n<5c11>5505\n<5c16>7178\n<5c19>5339\n<5c24>6206\n<5c28>4945\n<5c31>7320\n<5c38>5697\n<5c39>6361\n<5c3a>7136\n<5c3b>3736\n<5c3c>4186\n<5c3e>4853\n<5c3f>4180\n<5c40>3948\n<5c45>3587\n<5c46>3710\n<5c48>3960\n<5c4b>6078\n<5c4d>5699\n<5c4e>5698\n<5c51>5451\n<5c55>6654\n<5c5b>5044\n<5c60>4276\n<5c62>4566\n<5c64>7335\n<5c65>4618\n<5c6c>5538\n<5c6f>4358\n<5c71>5305\n<5c79>8024\n<5c90>4075\n<5c91>6527\n<5ca1>3539\n<5ca9>5822\n<5cab>5575\n<5cac>3531\n<5cb1>4255\n<5cb3>5794\n<5cb5>7806\n<5cb7>4870\n<5cb8>5808\n<5cba>4492\n<5cbe>6693\n<5cc0>5576\n<5cd9>7339\n<5ce0>5340\n<5ce8>5780\n<5cf4>7735\n<5cf6>4277\n<5cfb>6907\n<5cfd>7762\n<5d07>5671\n<5d0d>4421\n<5d0e>4076\n<5d11>3776\n<5d14>7263\n<5d16>5843\n<5d17>3540\n<5d19>4596\n<5d27>5672\n<5d29>5175\n<5d4b>4854\n<5d4c>3513\n<5d50>4399\n<5d69>5673\n<5d6c>6136\n<5d6f>7046\n<5d87>3908\n<5d8b>4278\n<5d9d>4365\n<5da0>3873\n<5da2>6147\n<5daa>5931\n<5db8>6003\n<5dba>4493\n<5dbc>5375\n<5dbd>5795\n<5dcd>6137\n<5dd2>4673\n<5dd6>5823\n<5ddd>7152\n<5dde>6871\n<5de1>5640\n<5de2>5506\n<5de5>3791\n<5de6>6856\n<5de7>3874\n<5de8>3588\n<5deb>4813\n<5dee>7047\n<5df1>4077\n<5df2>6418\n<5df3>5261\n<5df4>7476\n<5df7>7674\n<5dfd>5547\n<5dfe>3604\n<5e02>5700\n<5e03>7551\n<5e06>5010\n<5e0c>8042\n<5e11>7428\n<5e16>7189\n<5e19>7019\n<5e1b>4990\n<5e1d>6763\n<5e25>5577\n<5e2b>5262\n<5e2d>5405\n<5e33>6542\n<5e36>4256\n<5e38>5341\n<5e3d>4768\n<5e3f>7973\n<5e40>6712\n<5e44>5796\n<5e45>7571\n<5e47>4946\n<5e4c>7905\n<5e55>4665\n<5e5f>7340\n<5e61>4996\n<5e62>4242\n<5e63>7536\n<5e72>3481\n<5e73>7530\n<5e74>4160\n<5e77>5045\n<5e78>7706\n<5e79>3482\n<5e7b>7886\n<5e7e>4078\n<5e84>6543\n<5e87>5188\n<5e8a>5342\n<5e8f>5376\n<5e95>6596\n<5e97>6694\n<5e9a>3670\n<5e9c>5123\n<5ea0>5343\n<5ea6>4279\n<5ea7>6857\n<5eab>3737\n<5ead>6713\n<5eb5>5824\n<5eb6>5377\n<5eb7>3541\n<5eb8>6181\n<5ebe>6319\n<5ec2>5344\n<5ec8>7620\n<5ec9>4483\n<5eca>4412\n<5ed0>3909\n<5ed3>3815\n<5ed6>4554\n<5eda>6872\n<5edb>6655\n<5edf>4803\n<5ee0>7097\n<5ee2>7537\n<5ee3>3843\n<5eec>4444\n<5ef3>7197\n<5ef6>5961\n<5ef7>6714\n<5efa>3605\n<5efb>7930\n<5f01>5032\n<5f04>4537\n<5f0a>7538\n<5f0f>5722\n<5f11>5701\n<5f13>3964\n<5f14>6787\n<5f15>6451\n<5f17>5172\n<5f18>7854\n<5f1b>6419\n<5f1f>6764\n<5f26>7736\n<5f27>7807\n<5f29>4171\n<5f31>5872\n<5f35>6544\n<5f3a>3542\n<5f3c>7605\n<5f48>7411\n<5f4a>3543\n<5f4c>4855\n<5f4e>4674\n<5f56>4198\n<5f57>7792\n<5f59>7997\n<5f5b>6420\n<5f62>7775\n<5f66>5919\n<5f67>6230\n<5f69>7118\n<5f6a>7578\n<5f6b>6788\n<5f6c>5225\n<5f6d>7513\n<5f70>7098\n<5f71>6004\n<5f77>4947\n<5f79>5949\n<5f7c>7597\n<5f7f>5173\n<5f80>6126\n<5f81>6715\n<5f85>4257\n<5f87>5641\n<5f8a>7931\n<5f8b>4600\n<5f8c>7974\n<5f90>5378\n<5f91>3671\n<5f92>4280\n<5f97>4364\n<5f98>4972\n<5f99>5263\n<5f9e>6839\n<5fa0>4422\n<5fa1>5903\n<5fa8>7906\n<5fa9>5079\n<5faa>5642\n<5fae>4856\n<5fb5>7038\n<5fb7>4267\n<5fb9>7170\n<5fbd>7998\n<5fc3>5764\n<5fc5>7606\n<5fcc>4079\n<5fcd>6452\n<5fd6>7248\n<5fd7>6947\n<5fe0>7307\n<5feb>7379\n<5ff5>4163\n<5ffd>7850\n<5fff>5158\n<600f>5835\n<6012>4172\n<6016>7552\n<601c>4494\n<601d>5264\n<6020>7434\n<6021>6421\n<6025>4053\n<6027>5477\n<6028>6264\n<602a>3859\n<602f>3625\n<6041>6473\n<6042>5643\n<6043>5702\n<604d>7907\n<6050>3792\n<6052>7675\n<6055>5379\n<6059>5882\n<605d>3836\n<6062>7932\n<6063>6491\n<6064>8010\n<6065>7341\n<6068>7636\n<6069>6374\n<606a>3468\n<606c>4164\n<606d>3793\n<606f>5723\n<6070>8031\n<6085>5985\n<6089>5761\n<608c>6765\n<608d>7637\n<6094>7933\n<6096>7504\n<609a>5554\n<609b>6656\n<609f>6062\n<60a0>6320\n<60a3>7887\n<60a4>7254\n<60a7>4619\n<60b0>6840\n<60b2>5189\n<60b3>4268\n<60b4>7312\n<60b6>4871\n<60b8>3711\n<60bc>4281\n<60bd>7132\n<60c5>6716\n<60c7>4320\n<60d1>7841\n<60da>7851\n<60dc>5406\n<60df>6321\n<60e0>7793\n<60e1>5797\n<60f0>7385\n<60f1>4178\n<60f3>5345\n<60f6>7908\n<60f9>5866\n<60fa>5478\n<60fb>7333\n<6101>5578\n<6106>3606\n<610d>4872\n<610e>7517\n<610f>6398\n<6115>5798\n<611a>6207\n<611b>5844\n<611f>3514\n<6127>3860\n<6130>7909\n<6134>7099\n<6137>3565\n<613c>5741\n<613e>3566\n<613f>6265\n<6142>6182\n<6144>4601\n<6147>6375\n<6148>6492\n<614a>3655\n<614b>7435\n<614c>7910\n<6153>7579\n<6155>4769\n<615d>7471\n<615f>7453\n<6162>4675\n<6163>3822\n<6164>3469\n<6167>7794\n<6168>3567\n<616b>6841\n<616e>4445\n<6170>6292\n<6176>3672\n<6177>3544\n<617d>7137\n<617e>6168\n<6181>7255\n<6182>6208\n<618a>5190\n<618e>6932\n<6190>4465\n<6191>5237\n<6194>7217\n<6198>8044\n<6199>8043\n<619a>7412\n<61a4>5159\n<61a7>4336\n<61a9>3628\n<61ab>4873\n<61ac>3673\n<61ae>4814\n<61b2>7723\n<61b6>5913\n<61ba>4219\n<61be>3515\n<61c3>4026\n<61c7>3483\n<61c8>7692\n<61c9>6391\n<61ca>6063\n<61cb>4815\n<61e6>4135\n<61f2>7039\n<61f6>4375\n<61f7>7934\n<61f8>7737\n<61fa>7087\n<61fc>3910\n<61ff>6399\n<6200>4466\n<6207>4243\n<6208>3804\n<620a>4816\n<620c>5667\n<620d>5579\n<620e>6369\n<6210>5479\n<6211>5781\n<6212>3712\n<6216>7842\n<621a>7138\n<621f>4019\n<6221>3516\n<622a>6685\n<622e>4592\n<6230>6657\n<6231>8045\n<6234>4258\n<6236>7808\n<623e>4446\n<623f>4948\n<6240>5507\n<6241>7520\n<6247>5424\n<6248>7809\n<6249>5191\n<624b>5580\n<624d>6574\n<6253>7386\n<6258>7398\n<626e>5160\n<6271>4054\n<6276>5124\n<6279>5192\n<627c>5852\n<627f>5687\n<6280>4080\n<6284>7218\n<6289>3648\n<628a>7477\n<6291>5914\n<6292>5380\n<6295>7468\n<6297>7676\n<6298>6686\n<629b>7553\n<62ab>7598\n<62b1>7554\n<62b5>6597\n<62b9>4690\n<62bc>5830\n<62bd>7266\n<62c2>5174\n<62c7>4817\n<62c8>4165\n<62c9>4409\n<62cc>4909\n<62cd>4888\n<62cf>4136\n<62d0>3861\n<62d2>3589\n<62d3>7139\n<62d4>4931\n<62d6>7387\n<62d7>6148\n<62d8>3911\n<62d9>6835\n<62db>7219\n<62dc>4973\n<62ec>3837\n<62ed>5724\n<62ee>4129\n<62ef>6934\n<62f1>3794\n<62f3>3974\n<62f7>3738\n<62fe>5678\n<62ff>4137\n<6301>6948\n<6307>6949\n<6309>5809\n<6311>4282\n<632b>6858\n<632f>6983\n<633a>6717\n<633b>5963\n<633d>4676\n<633e>7763\n<6349>7055\n<634c>7501\n<634f>4143\n<6350>5962\n<6355>7555\n<6367>5098\n<6368>5265\n<636e>3590\n<6372>3975\n<6377>7190\n<637a>4144\n<637b>4166\n<637f>5381\n<6383>5508\n<6388>5581\n<6389>4283\n<638c>6545\n<6392>4974\n<6396>5853\n<6398>3961\n<639b>3853\n<63a0>4425\n<63a1>7119\n<63a2>7420\n<63a5>6701\n<63a7>3795\n<63a8>7267\n<63a9>5929\n<63aa>6789\n<63c0>3484\n<63c4>6324\n<63c6>3997\n<63cf>4804\n<63d0>6766\n<63d6>6387\n<63da>5883\n<63db>7888\n<63e1>5799\n<63ed>3629\n<63ee>7999\n<63f4>6266\n<63f6>5867\n<63f7>5327\n<640d>5548\n<640f>4889\n<6414>5509\n<6416>6149\n<6417>4284\n<641c>5582\n<6422>6984\n<642c>4910\n<642d>7425\n<643a>8006\n<643e>7056\n<6458>6623\n<6460>7256\n<6469>4656\n<646f>6950\n<647a>6702\n<6488>4512\n<6491>7447\n<6492>5316\n<6493>6150\n<649a>4161\n<649e>4244\n<64a4>7171\n<64a5>4932\n<64ab>4818\n<64ad>7478\n<64ae>7261\n<64b0>7062\n<64b2>4890\n<64bb>4212\n<64c1>6091\n<64c4>4513\n<64c5>7153\n<64c7>7445\n<64ca>3630\n<64cd>6790\n<64ce>3674\n<64d2>4040\n<64d4>4220\n<64d8>5023\n<64da>3591\n<64e1>4259\n<64e2>7399\n<64e5>4400\n<64e6>7079\n<64e7>3592\n<64ec>6400\n<64f2>7140\n<64f4>7877\n<64fa>7479\n<64fe>6151\n<6500>4911\n<6504>7448\n<6518>5884\n<651d>5471\n<6523>4467\n<652a>3875\n<652b>7878\n<652c>4401\n<652f>6951\n<6536>5583\n<6537>3739\n<6538>6325\n<6539>3568\n<653b>3796\n<653e>4949\n<653f>6718\n<6545>3740\n<6548>7956\n<654d>5382\n<654e>3876\n<654f>4874\n<6551>3912\n<6556>6064\n<6557>7505\n<655e>7100\n<6562>3517\n<6563>5306\n<6566>4321\n<656c>3675\n<656d>5885\n<6572>3741\n<6574>6719\n<6575>6624\n<6577>5125\n<6578>5584\n<657e>5425\n<6582>4484\n<6583>7539\n<6585>7957\n<6587>4840\n<658c>5226\n<6590>5193\n<6591>4912\n<6597>4349\n<6599>4555\n<659b>3768\n<659c>5266\n<659f>7030\n<65a1>5817\n<65a4>4027\n<65a5>7141\n<65a7>5126\n<65ab>6512\n<65ac>7088\n<65af>5267\n<65b0>5742\n<65b7>4199\n<65b9>4950\n<65bc>5904\n<65bd>5703\n<65c1>4951\n<65c5>4447\n<65cb>5426\n<65cc>6720\n<65cf>6828\n<65d2>4578\n<65d7>4081\n<65e0>4819\n<65e3>4082\n<65e5>6464\n<65e6>4200\n<65e8>6952\n<65e9>6791\n<65ec>5644\n<65ed>6231\n<65f1>7638\n<65f4>6209\n<65fa>6127\n<65fd>4322\n<65ff>6065\n<6606>3777\n<6607>5688\n<6609>4952\n<660a>7810\n<660c>7101\n<660e>4751\n<660f>7845\n<6610>5161\n<6611>4041\n<6613>5950\n<6614>5407\n<6615>8019\n<661e>5046\n<661f>5480\n<6620>6005\n<6625>7300\n<6627>4712\n<6628>6513\n<662d>5510\n<662f>5704\n<6630>7621\n<6631>6232\n<6634>4805\n<6636>7102\n<663a>5047\n<663b>5836\n<6641>6792\n<6642>5705\n<6649>6985\n<664b>6986\n<664f>5810\n<6659>6908\n<665b>7738\n<665d>6873\n<665e>8046\n<665f>5481\n<6664>6066\n<6665>7890\n<6666>7935\n<6667>7811\n<6668>5743\n<6669>4677\n<666b>7400\n<666e>5062\n<666f>3676\n<6673>5408\n<6674>7198\n<6676>6721\n<6677>3990\n<6678>6722\n<667a>6953\n<6684>7991\n<6687>3447\n<6688>7988\n<6689>8000\n<668e>6006\n<6690>6293\n<6691>5383\n<6696>4140\n<6697>5825\n<6698>5886\n<669d>4752\n<66a0>3742\n<66a2>7103\n<66ab>6528\n<66ae>4772\n<66b2>6546\n<66b3>7795\n<66b4>7572\n<66b9>5464\n<66bb>3677\n<66be>4323\n<66c4>5999\n<66c6>4459\n<66c7>4221\n<66c9>7958\n<66d6>5845\n<66d9>5384\n<66dc>6152\n<66dd>7573\n<66e0>3844\n<66e6>8047\n<66f0>6125\n<66f2>3769\n<66f3>6033\n<66f4>3678\n<66f7>3502\n<66f8>5385\n<66f9>6794\n<66fa>6793\n<66fc>4678\n<66fe>6933\n<66ff>7206\n<6700>7264\n<6703>7936\n<6708>6281\n<6709>6326\n<670b>5176\n<670d>5080\n<6714>5302\n<6715>7031\n<6717>4413\n<671b>4700\n<671d>6795\n<6726>4798\n<6727>4538\n<6728>4788\n<672a>4857\n<672b>4691\n<672c>5091\n<672d>7080\n<672e>7304\n<6731>6874\n<6734>4891\n<6736>7388\n<673a>3984\n<673d>7975\n<6746>3485\n<6749>5321\n<674e>4620\n<674f>7707\n<6750>6575\n<6751>7249\n<6753>7580\n<6756>6547\n<675c>4350\n<675e>4085\n<675f>5539\n<676d>7677\n<676f>4975\n<6770>3615\n<6771>4337\n<6773>4806\n<6775>6598\n<6777>7480\n<677b>4183\n<677e>5555\n<677f>7492\n<6787>5194\n<6789>6128\n<678b>4953\n<678f>4146\n<6790>5409\n<6793>4351\n<6795>7369\n<6797>4647\n<679a>4713\n<679c>3805\n<679d>6954\n<67af>3743\n<67b0>7531\n<67b3>6955\n<67b8>3913\n<67be>5706\n<67c4>5048\n<67cf>4991\n<67d0>4773\n<67d1>3518\n<67d2>7365\n<67d3>5990\n<67d4>6327\n<67da>6328\n<67dd>7401\n<67e9>3914\n<67ec>3486\n<67ef>3450\n<67f0>4157\n<67f1>6875\n<67f3>4579\n<67f4>5707\n<67f5>7127\n<67f6>5268\n<67fb>5269\n<67fe>6723\n<6812>5645\n<6813>6658\n<6816>5386\n<6817>4602\n<6821>3877\n<6822>4992\n<682a>6876\n<682f>6233\n<6838>7704\n<6839>4028\n<683c>3631\n<683d>6576\n<6840>3616\n<6841>7678\n<6842>3713\n<6843>4285\n<6848>5811\n<684e>7020\n<6850>4338\n<6851>5346\n<6853>7891\n<6854>4130\n<686d>6987\n<6876>7454\n<687f>3487\n<6881>4431\n<6885>4714\n<688f>3770\n<6893>6577\n<6894>7342\n<6897>3679\n<689d>6796\n<689f>7959\n<68a1>6110\n<68a2>7220\n<68a7>6067\n<68a8>4621\n<68ad>5270\n<68af>6767\n<68b0>3714\n<68b1>3778\n<68b3>5511\n<68b5>5011\n<68b6>4858\n<68c4>4087\n<68c5>5049\n<68c9>4738\n<68cb>4086\n<68cd>3779\n<68d2>5099\n<68d5>6842\n<68d7>6797\n<68d8>4020\n<68da>5177\n<68df>4339\n<68e0>4245\n<68e7>6523\n<68e8>3715\n<68ee>5322\n<68f2>5387\n<68f9>4286\n<68fa>3823\n<6900>6111\n<6905>6401\n<690d>5725\n<690e>7268\n<6912>7221\n<6927>4753\n<6930>5868\n<693d>5964\n<693f>7301\n<694a>5887\n<6953>7592\n<6954>5452\n<6955>7389\n<6957>3607\n<6959>4820\n<695a>7222\n<695e>4608\n<6960>4147\n<6963>4859\n<6968>6724\n<696b>6928\n<696d>5932\n<696e>6599\n<696f>5646\n<6975>4021\n<6977>7693\n<6978>7269\n<6979>6007\n<6995>6183\n<699b>6988\n<699c>4954\n<69a5>7913\n<69a7>5195\n<69ae>6008\n<69b4>4580\n<69bb>7426\n<69c1>3744\n<69c3>4913\n<69cb>3915\n<69cc>7460\n<69cd>7104\n<69d0>3862\n<69e8>3816\n<69ea>3569\n<69fb>3998\n<69fd>6798\n<69ff>4029\n<6a02>5800\n<6a0a>4997\n<6a11>4432\n<6a13>4567\n<6a17>6600\n<6a19>7581\n<6a1e>7270\n<6a1f>6548\n<6a21>4774\n<6a23>5888\n<6a35>7223\n<6a38>4892\n<6a39>5585\n<6a3a>7866\n<6a3d>6909\n<6a44>3519\n<6a48>6153\n<6a4b>3878\n<6a52>6239\n<6a53>5647\n<6a58>4015\n<6a59>4366\n<6a5f>4088\n<6a61>5347\n<6a6b>7951\n<6a80>4201\n<6a84>3632\n<6a89>6725\n<6a8d>5915\n<6a8e>4042\n<6a97>5024\n<6a9c>7937\n<6aa2>3620\n<6aa3>6549\n<6ab3>5227\n<6abb>7656\n<6ac2>4287\n<6ac3>3985\n<6ad3>4514\n<6ada>4448\n<6adb>6927\n<6af6>7724\n<6afb>5858\n<6b04>4391\n<6b0a>3976\n<6b0c>6550\n<6b12>4392\n<6b16>4402\n<6b20>8027\n<6b21>7048\n<6b23>8020\n<6b32>6169\n<6b3a>4089\n<6b3d>8028\n<6b3e>3824\n<6b46>8029\n<6b47>7727\n<6b4c>3451\n<6b4e>7413\n<6b50>3916\n<6b5f>5937\n<6b61>7889\n<6b62>6956\n<6b63>6726\n<6b64>7049\n<6b65>5063\n<6b66>4821\n<6b6a>6133\n<6b72>5494\n<6b77>4460\n<6b78>3991\n<6b7b>5271\n<6b7f>4795\n<6b83>5837\n<6b84>6989\n<6b86>7436\n<6b89>5648\n<6b8a>5586\n<6b96>5726\n<6b98>6524\n<6b9e>6240\n<6bae>4485\n<6baf>5228\n<6bb2>5465\n<6bb5>4202\n<6bb7>6376\n<6bba>5317\n<6bbc>3470\n<6bbf>6659\n<6bc1>7996\n<6bc5>6402\n<6bc6>3917\n<6bcb>4822\n<6bcd>4775\n<6bcf>4715\n<6bd2>4309\n<6bd3>6356\n<6bd4>5196\n<6bdb>4776\n<6beb>7812\n<6bec>3918\n<6c08>6660\n<6c0f>5774\n<6c11>4877\n<6c13>4728\n<6c23>4090\n<6c34>5587\n<6c37>5238\n<6c38>6009\n<6c3e>5012\n<6c40>6727\n<6c41>6929\n<6c42>3919\n<6c4e>5013\n<6c50>5410\n<6c55>5307\n<6c57>7639\n<6c5a>6068\n<6c5d>5938\n<6c5e>7855\n<6c5f>3545\n<6c60>6957\n<6c68>3784\n<6c6a>6129\n<6c6d>6034\n<6c70>7437\n<6c72>4055\n<6c76>4841\n<6c7a>3649\n<6c7d>4091\n<6c7e>5162\n<6c81>5765\n<6c82>4092\n<6c83>6079\n<6c85>6267\n<6c86>7679\n<6c87>5965\n<6c88>7370\n<6c8c>4324\n<6c90>4789\n<6c92>4796\n<6c93>4234\n<6c94>4739\n<6c95>4849\n<6c96>7308\n<6c99>5272\n<6c9a>6958\n<6c9b>7506\n<6cab>4692\n<6cae>6601\n<6cb3>7622\n<6cb8>5200\n<6cb9>6331\n<6cbb>7343\n<6cbc>5512\n<6cbd>3745\n<6cbe>7179\n<6cbf>5966\n<6cc1>7914\n<6cc2>7776\n<6cc4>5453\n<6cc9>7154\n<6cca>4893\n<6ccc>7607\n<6cd3>7856\n<6cd5>5018\n<6cd7>5273\n<6cdb>5014\n<6ce1>7556\n<6ce2>7481\n<6ce3>6388\n<6ce5>4187\n<6ce8>6877\n<6ceb>7739\n<6cee>4914\n<6cef>4878\n<6cf0>7438\n<6cf3>6010\n<6d0b>5889\n<6d0c>4480\n<6d11>5064\n<6d17>5495\n<6d19>5588\n<6d1b>4382\n<6d1e>4340\n<6d25>6990\n<6d27>6332\n<6d29>5454\n<6d2a>7857\n<6d32>6878\n<6d35>5649\n<6d36>8016\n<6d38>3845\n<6d39>6268\n<6d3b>7899\n<6d3d>8032\n<6d3e>7482\n<6d41>4581\n<6d59>6687\n<6d5a>6910\n<6d5c>5229\n<6d63>6112\n<6d66>7557\n<6d69>7813\n<6d6a>4414\n<6d6c>4622\n<6d6e>5127\n<6d74>6170\n<6d77>7694\n<6d78>7371\n<6d79>7764\n<6d7f>7507\n<6d85>5986\n<6d87>3680\n<6d88>5513\n<6d89>5472\n<6d8c>6184\n<6d8d>7960\n<6d8e>5967\n<6d91>5540\n<6d93>5968\n<6d95>7207\n<6daf>5846\n<6db2>5854\n<6db5>7657\n<6dc0>6728\n<6dc3>3977\n<6dc4>7344\n<6dc5>5411\n<6dc6>7961\n<6dc7>4093\n<6dcb>4648\n<6dcf>7814\n<6dd1>5633\n<6dd8>4288\n<6dd9>6843\n<6dda>4568\n<6dde>5556\n<6de1>4222\n<6de8>6729\n<6dea>4597\n<6deb>6382\n<6dee>7938\n<6df1>5766\n<6df3>5650\n<6df5>5969\n<6df7>7846\n<6df8>7199\n<6df9>5930\n<6dfa>7155\n<6dfb>7180\n<6e17>5323\n<6e19>7892\n<6e1a>6602\n<6e1b>3520\n<6e1f>6730\n<6e20>3593\n<6e21>4289\n<6e23>5274\n<6e24>4933\n<6e25>5801\n<6e26>6099\n<6e2b>5455\n<6e2c>7334\n<6e2d>6294\n<6e2f>7680\n<6e32>5427\n<6e34>3503\n<6e36>6011\n<6e38>6333\n<6e3a>4807\n<6e3c>4860\n<6e3d>6578\n<6e3e>7847\n<6e43>4976\n<6e44>4861\n<6e4a>6879\n<6e4d>4203\n<6e56>7815\n<6e58>5348\n<6e5b>4223\n<6e5c>5727\n<6e5e>6731\n<6e5f>7915\n<6e67>6185\n<6e6b>7271\n<6e6e>6453\n<6e6f>7429\n<6e72>6269\n<6e73>4148\n<6e7a>5065\n<6e90>6270\n<6e96>6911\n<6e9c>4582\n<6e9d>3920\n<6e9f>4754\n<6ea2>6465\n<6ea5>5128\n<6eaa>3716\n<6eab>6083\n<6eaf>5514\n<6eb1>6991\n<6eb6>6186\n<6eba>4189\n<6ec2>4955\n<6ec4>7105\n<6ec5>4746\n<6ec9>7916\n<6ecb>6493\n<6ecc>7142\n<6ece>7777\n<6ed1>7900\n<6ed3>6579\n<6ed4>4290\n<6eef>7208\n<6ef4>6625\n<6ef8>7816\n<6efe>3780\n<6eff>4679\n<6f01>5905\n<6f02>7582\n<6f06>7366\n<6f0f>4569\n<6f11>3570\n<6f14>5970\n<6f15>6799\n<6f20>4666\n<6f22>7640\n<6f23>4468\n<6f2b>4680\n<6f2c>6959\n<6f31>5589\n<6f32>7106\n<6f38>6695\n<6f3f>6551\n<6f41>6012\n<6f51>4934\n<6f54>3650\n<6f57>7033\n<6f58>4915\n<6f5a>5634\n<6f5b>6529\n<6f5e>4515\n<6f5f>5412\n<6f62>7917\n<6f64>6362\n<6f6d>4224\n<6f6e>6800\n<6f70>3986\n<6f7a>6525\n<6f7c>4341\n<6f7d>5066\n<6f7e>4639\n<6f81>5328\n<6f84>7040\n<6f88>7172\n<6f8d>6880\n<6f8e>7514\n<6f90>6241\n<6f94>7817\n<6f97>3488\n<6fa3>7641\n<6fa4>7446\n<6fa7>4507\n<6fae>7939\n<6faf>7063\n<6fb1>6661\n<6fb3>6069\n<6fb9>4225\n<6fbe>4213\n<6fc0>3633\n<6fc1>7402\n<6fc2>4486\n<6fc3>4175\n<6fca>6035\n<6fd5>5677\n<6fda>6013\n<6fdf>6768\n<6fe0>7818\n<6fe1>6334\n<6fe4>4291\n<6fe9>7819\n<6feb>4403\n<6fec>6912\n<6fef>7403\n<6ff1>5230\n<6ffe>4449\n<7001>5890\n<7005>7778\n<7006>4310\n<7009>5275\n<700b>5767\n<700f>4583\n<7011>7574\n<7015>5231\n<7018>4516\n<701a>7642\n<701b>6014\n<701c>6370\n<701d>4461\n<701e>6732\n<701f>5515\n<7023>7695\n<7027>4539\n<7028>4544\n<702f>6015\n<7037>6437\n<703e>4393\n<704c>3825\n<7050>7779\n<7051>5562\n<7058>7414\n<705d>7820\n<7063>4681\n<706b>7867\n<7070>7940\n<7078>3921\n<707c>6514\n<707d>6580\n<7085>3681\n<708a>7321\n<708e>5991\n<7092>7224\n<7098>8021\n<7099>6494\n<709a>3846\n<70a1>6733\n<70a4>5516\n<70ab>7740\n<70ac>3594\n<70ad>7415\n<70af>7780\n<70b3>5050\n<70b7>6881\n<70b8>6515\n<70b9>6696\n<70c8>4481\n<70cb>8007\n<70cf>6070\n<70d8>7858\n<70d9>4383\n<70dd>6935\n<70df>5971\n<70f1>3682\n<70f9>7515\n<70fd>5100\n<7104>7983\n<7109>5920\n<710c>6913\n<7119>4977\n<711a>5163\n<711e>4325\n<7121>4823\n<7126>7225\n<7130>5992\n<7136>5972\n<7147>8001\n<7149>4469\n<714a>7992\n<714c>7918\n<714e>6662\n<7150>6016\n<7156>4141\n<7159>5973\n<715c>6234\n<715e>5318\n<7164>4716\n<7165>7893\n<7166>7976\n<7167>6801\n<7169>4998\n<716c>5891\n<716e>6495\n<717d>5428\n<7184>5728\n<7189>6242\n<718a>6253\n<718f>7984\n<7192>7781\n<7194>6187\n<7199>8048\n<719f>5635\n<71a2>5101\n<71ac>6071\n<71b1>5987\n<71be>7345\n<71c1>6000\n<71c3>5974\n<71c8>4367\n<71c9>4326\n<71ce>4556\n<71d0>4640\n<71d2>5517\n<71d4>4999\n<71d5>5975\n<71df>6017\n<71e5>6802\n<71e6>7064\n<71e7>5590\n<71ed>7243\n<71ee>5473\n<71fb>7985\n<71fc>5744\n<71fe>4292\n<71ff>6154\n<7200>7731\n<7206>7575\n<7210>4517\n<721b>4394\n<722a>6803\n<722c>7483\n<722d>6587\n<7230>6271\n<7232>6295\n<7235>6516\n<7236>5129\n<723a>5869\n<723b>7962\n<723d>5349\n<723e>6422\n<7240>5350\n<7246>6552\n<7247>7521\n<7248>7493\n<724c>7508\n<7252>7191\n<7258>4311\n<7259>5782\n<725b>6210\n<725d>5232\n<725f>4777\n<7261>4778\n<7262>4545\n<7267>4790\n<7269>4850\n<7272>5369\n<7279>7472\n<727d>3638\n<7280>5388\n<7281>4623\n<72a2>4312\n<72a7>8051\n<72ac>3639\n<72af>5015\n<72c0>5351\n<72c2>3847\n<72c4>6626\n<72ce>5831\n<72d0>7821\n<72d7>3922\n<72d9>6603\n<72e1>3879\n<72e9>5591\n<72f8>4624\n<72f9>7765\n<72fc>4415\n<72fd>7509\n<730a>6036\n<7316>7107\n<731b>4729\n<731c>5708\n<731d>6836\n<7325>6138\n<7329>5482\n<732a>6604\n<732b>4808\n<733e>7901\n<733f>6272\n<7344>6080\n<7345>5276\n<7350>6553\n<7352>6072\n<7357>3980\n<7368>4313\n<736a>7941\n<7370>6018\n<7372>7949\n<7375>4488\n<7378>5592\n<737a>4214\n<737b>7725\n<7384>7741\n<7386>6496\n<7387>5552\n<7389>6081\n<738b>6130\n<738e>6734\n<7394>7156\n<7396>3923\n<7397>6211\n<7398>4094\n<739f>4879\n<73a7>6363\n<73a9>6113\n<73ad>5233\n<73b2>4495\n<73b3>4260\n<73b9>7742\n<73c0>4894\n<73c2>3452\n<73c9>4880\n<73ca>5308\n<73cc>7608\n<73cd>6992\n<73cf>3471\n<73d6>3848\n<73d9>3797\n<73dd>7977\n<73de>4384\n<73e0>6882\n<73e3>5651\n<73e4>5067\n<73e5>6423\n<73e6>7713\n<73e9>7782\n<73ea>3999\n<73ed>4916\n<73f7>4824\n<73f9>5483\n<73fd>6735\n<73fe>7743\n<7401>5429\n<7403>3924\n<7405>4416\n<7406>4625\n<7407>5593\n<7409>4584\n<7413>6114\n<741b>7372\n<7420>6663\n<7421>5636\n<7422>7404\n<7425>7822\n<7426>4095\n<7428>3781\n<742a>4096\n<742b>5102\n<742c>6115\n<742e>6844\n<742f>3826\n<7430>5993\n<7433>4649\n<7434>4043\n<7435>5201\n<7436>7484\n<7438>7405\n<743a>5019\n<743f>7848\n<7440>6212\n<7441>4779\n<7443>7302\n<7444>5430\n<744b>6296\n<7455>7623\n<7457>6273\n<7459>4173\n<745a>7823\n<745b>6019\n<745c>6337\n<745e>5389\n<745f>5674\n<7460>4585\n<7462>6188\n<7464>6155\n<7465>6084\n<7468>6993\n<7469>7783\n<746a>4657\n<746f>4417\n<747e>4030\n<7482>4097\n<7483>4626\n<7487>5431\n<7489>4470\n<748b>6554\n<7498>4641\n<749c>7919\n<749e>4895\n<749f>3683\n<74a1>6994\n<74a3>4098\n<74a5>3684\n<74a7>5025\n<74a8>7065\n<74aa>6804\n<74b0>7894\n<74b2>5594\n<74b5>5939\n<74b9>5637\n<74bd>5363\n<74bf>5432\n<74c6>7021\n<74ca>3685\n<74cf>4540\n<74d4>6020\n<74d8>3827\n<74da>7066\n<74dc>3806\n<74e0>7824\n<74e2>7583\n<74e3>7494\n<74e6>6100\n<74ee>6092\n<74f7>6497\n<7501>5051\n<7504>3640\n<7511>6936\n<7515>6093\n<7518>3521\n<751a>5768\n<751b>7181\n<751f>5370\n<7523>5309\n<7525>5371\n<7526>5518\n<7528>6189\n<752b>5068\n<752c>6190\n<7530>6664\n<7531>6338\n<7532>3532\n<7533>5745\n<7537>4149\n<7538>6665\n<753a>6736\n<7547>4011\n<754c>3717\n<754f>6139\n<7551>6666\n<7553>4235\n<7554>4917\n<7559>4586\n<755b>6995\n<755c>7289\n<755d>4825\n<7562>7609\n<7565>4426\n<7566>8008\n<756a>5000\n<756f>6914\n<7570>6424\n<7575>7868\n<7576>4246\n<7578>4099\n<757a>3546\n<757f>4100\n<7586>3547\n<7587>6883\n<758a>7192\n<758b>7610\n<758e>5520\n<758f>5519\n<7591>6403\n<759d>5310\n<75a5>3571\n<75ab>5951\n<75b1>7558\n<75b2>7599\n<75b3>3522\n<75b5>6498\n<75b8>4215\n<75b9>6996\n<75bc>4342\n<75bd>6605\n<75be>7022\n<75c2>3453\n<75c5>5052\n<75c7>6937\n<75cd>6425\n<75d2>5892\n<75d4>7346\n<75d5>8022\n<75d8>4352\n<75d9>3686\n<75db>7455\n<75e2>4627\n<75f0>4226\n<75f2>4658\n<75f4>7347\n<75fa>5202\n<75fc>3746\n<7600>5906\n<760d>5893\n<7619>5521\n<761f>6085\n<7620>7143\n<7621>7108\n<7622>4918\n<7624>4587\n<7626>5595\n<763b>4570\n<7642>4557\n<764c>5826\n<764e>3489\n<7652>6339\n<7656>5026\n<7661>7348\n<7664>6688\n<7669>4376\n<766c>5433\n<7670>6094\n<7672>6667\n<7678>3718\n<767b>4368\n<767c>4935\n<7684>6627\n<7686>3572\n<7687>7920\n<768e>3880\n<7690>3747\n<7693>7825\n<76ae>7600\n<76ba>7272\n<76bf>4755\n<76c2>6213\n<76c3>4978\n<76c6>5164\n<76c8>6021\n<76ca>6438\n<76d2>7665\n<76d6>3573\n<76db>5484\n<76dc>4293\n<76de>6526\n<76df>4731\n<76e1>6997\n<76e3>3523\n<76e4>4919\n<76e7>4518\n<76ee>4791\n<76f2>4730\n<76f4>6975\n<76f8>5352\n<76fc>4920\n<76fe>5652\n<7701>5485\n<7704>4740\n<7708>7421\n<7709>4862\n<770b>3490\n<771e>6998\n<7720>4741\n<7729>7744\n<7737>3978\n<7738>4780\n<773a>6805\n<773c>5812\n<7740>7057\n<774d>7745\n<775b>6737\n<7761>5596\n<7763>4314\n<7766>4792\n<776b>7193\n<7779>4294\n<777e>3748\n<777f>6037\n<778b>6999\n<7791>4756\n<779e>4682\n<77a5>5038\n<77ac>5653\n<77ad>4558\n<77b0>3524\n<77b3>4343\n<77bb>7182\n<77bc>3621\n<77bf>3925\n<77d7>7244\n<77db>4781\n<77dc>4060\n<77e2>5709\n<77e3>6404\n<77e5>6960\n<77e9>3926\n<77ed>4204\n<77ee>6134\n<77ef>3881\n<77f3>5413\n<7802>5277\n<7812>5203\n<7825>6961\n<7826>7120\n<7827>7373\n<782c>4652\n<7832>7559\n<7834>7485\n<7845>4000\n<784f>5976\n<785d>7226\n<786b>4588\n<786c>3687\n<786f>5977\n<787c>5178\n<7881>4101\n<7887>6738\n<788c>4528\n<788d>5847\n<788e>5563\n<7891>5204\n<7897>6116\n<78a3>3504\n<78a7>5027\n<78a9>5414\n<78bc>4659\n<78c1>6499\n<78c5>4956\n<78ca>4546\n<78cb>7050\n<78ce>3719\n<78d0>4921\n<78e8>4660\n<78ec>3688\n<78ef>4102\n<78f5>3491\n<78fb>4922\n<7901>7227\n<790e>7228\n<7916>5940\n<792a>4450\n<792b>4462\n<792c>4923\n<793a>5710\n<793e>5278\n<7940>5279\n<7941>4103\n<7949>6962\n<7950>6214\n<7956>6806\n<7957>6963\n<795a>6807\n<795b>3595\n<795c>7826\n<795d>7290\n<795e>5746\n<7960>5280\n<7965>5353\n<7968>7584\n<796d>6769\n<797a>4106\n<797f>4529\n<7981>4044\n<798d>7869\n<798e>6739\n<798f>5081\n<7991>6215\n<79a6>5907\n<79a7>8052\n<79aa>5434\n<79ae>4508\n<79b1>4295\n<79b3>5894\n<79b9>6216\n<79bd>4045\n<79be>7870\n<79bf>4315\n<79c0>5597\n<79c1>5281\n<79c9>5053\n<79ca>4162\n<79cb>7273\n<79d1>3807\n<79d2>7229\n<79d5>5205\n<79d8>5206\n<79df>6808\n<79e4>7377\n<79e6>7000\n<79e7>5838\n<79e9>7023\n<79fb>6426\n<7a00>8053\n<7a05>5496\n<7a08>3492\n<7a0b>6740\n<7a0d>7230\n<7a14>6474\n<7a17>7510\n<7a19>6976\n<7a1a>7349\n<7a1c>4609\n<7a1f>7591\n<7a20>6809\n<7a2e>6845\n<7a31>7378\n<7a36>6235\n<7a37>6977\n<7a3b>4296\n<7a3c>3454\n<7a3d>3720\n<7a3f>3749\n<7a40>3771\n<7a46>4793\n<7a49>7350\n<7a4d>6628\n<7a4e>6022\n<7a57>5598\n<7a61>5366\n<7a62>6038\n<7a69>6086\n<7a6b>7881\n<7a70>5895\n<7a74>7755\n<7a76>3927\n<7a79>3965\n<7a7a>3798\n<7a7d>6741\n<7a7f>7157\n<7a81>4330\n<7a84>7058\n<7a88>6156\n<7a92>7024\n<7a93>7109\n<7a95>6810\n<7a98>3954\n<7a9f>3962\n<7aae>3966\n<7aaf>6157\n<7aba>4001\n<7ac4>7067\n<7ac5>4002\n<7ac7>4353\n<7aca>6689\n<7acb>4653\n<7ad7>4809\n<7ad9>7089\n<7add>5054\n<7adf>3689\n<7ae0>6555\n<7ae3>6915\n<7ae5>4344\n<7aea>5599\n<7aed>3505\n<7aef>4205\n<7af6>3690\n<7af9>6900\n<7afa>7291\n<7aff>3493\n<7b0f>7852\n<7b11>5522\n<7b19>5372\n<7b1b>6629\n<7b1e>7439\n<7b20>4654\n<7b26>5130\n<7b2c>6770\n<7b2d>4496\n<7b39>5497\n<7b46>7611\n<7b49>4369\n<7b4b>4031\n<7b4c>6668\n<7b4d>5654\n<7b4f>5006\n<7b50>3849\n<7b51>7292\n<7b52>7456\n<7b54>4236\n<7b56>7128\n<7b60>4012\n<7b6c>5486\n<7b6e>5390\n<7b75>5978\n<7b7d>6073\n<7b87>3574\n<7b8b>6669\n<7b8f>6588\n<7b94>4896\n<7b95>4107\n<7b97>5311\n<7b9a>7051\n<7b9d>3656\n<7ba1>3828\n<7bad>6670\n<7bb1>5354\n<7bb4>6530\n<7bb8>6606\n<7bc0>6690\n<7bc1>7921\n<7bc4>5016\n<7bc6>6671\n<7bc7>7522\n<7bc9>7293\n<7bd2>5729\n<7be0>5523\n<7be4>4316\n<7be9>5282\n<7c07>6829\n<7c12>7068\n<7c1e>4206\n<7c21>3494\n<7c27>7922\n<7c2a>6531\n<7c2b>5524\n<7c3d>7183\n<7c3e>4487\n<7c3f>5131\n<7c43>4404\n<7c4c>6884\n<7c4d>6630\n<7c60>4541\n<7c64>7184\n<7c6c>4628\n<7c73>4863\n<7c83>5207\n<7c89>5165\n<7c92>4655\n<7c95>4897\n<7c97>6811\n<7c98>6697\n<7c9f>5541\n<7ca5>6901\n<7ca7>6556\n<7cae>4433\n<7cb1>4434\n<7cb2>7070\n<7cb3>3582\n<7cb9>5600\n<7cbe>6742\n<7cca>7827\n<7cd6>4247\n<7cde>5166\n<7cdf>6812\n<7ce0>3548\n<7ce7>4435\n<7cfb>3721\n<7cfe>4003\n<7d00>4108\n<7d02>6885\n<7d04>5873\n<7d05>7859\n<7d06>6217\n<7d07>8025\n<7d08>7895\n<7d0d>4150\n<7d10>4184\n<7d14>5655\n<7d17>5283\n<7d18>3865\n<7d19>6964\n<7d1a>4056\n<7d1b>5167\n<7d20>5525\n<7d21>4957\n<7d22>5367\n<7d2b>6500\n<7d2c>6886\n<7d2e>7081\n<7d2f>4571\n<7d30>5498\n<7d33>5747\n<7d35>6607\n<7d39>5526\n<7d3a>3525\n<7d42>6846\n<7d43>7746\n<7d44>6813\n<7d45>3691\n<7d46>4924\n<7d50>3651\n<7d5e>3882\n<7d61>4385\n<7d62>7747\n<7d66>4057\n<7d68>6371\n<7d6a>6454\n<7d6e>5391\n<7d71>7457\n<7d72>5284\n<7d73>3549\n<7d76>6691\n<7d79>3641\n<7d7f>3928\n<7d8e>6743\n<7d8f>5601\n<7d93>3692\n<7d9c>6847\n<7da0>4530\n<7da2>6887\n<7dac>5602\n<7dad>6340\n<7db1>3550\n<7db2>4701\n<7db4>7173\n<7db5>7121\n<7db8>4598\n<7dba>4109\n<7dbb>7416\n<7dbd>6517\n<7dbe>4610\n<7dbf>4742\n<7dc7>7351\n<7dca>4126\n<7dcb>5208\n<7dd6>5392\n<7dd8>7658\n<7dda>5435\n<7ddd>7034\n<7dde>4207\n<7de0>7209\n<7de1>4881\n<7de3>5979\n<7de8>7523\n<7de9>6117\n<7dec>4743\n<7def>6297\n<7df4>4471\n<7dfb>7352\n<7e09>7001\n<7e0a>5855\n<7e15>6087\n<7e1b>4898\n<7e1d>7002\n<7e1e>7828\n<7e1f>6171\n<7e21>6581\n<7e23>7748\n<7e2b>5103\n<7e2e>7294\n<7e2f>5980\n<7e31>6848\n<7e37>4572\n<7e3d>7257\n<7e3e>6631\n<7e41>5001\n<7e43>5179\n<7e46>4826\n<7e47>6158\n<7e52>6938\n<7e54>6978\n<7e55>5436\n<7e5e>6159\n<7e61>5603\n<7e69>5689\n<7e6a>7942\n<7e6b>3722\n<7e6d>3642\n<7e70>6814\n<7e79>5952\n<7e7c>3723\n<7e82>7069\n<7e8c>5542\n<7e8f>6672\n<7e93>6023\n<7e96>5466\n<7e98>7071\n<7e9b>4317\n<7e9c>4405\n<7f36>5132\n<7f38>7681\n<7f3a>3652\n<7f4c>5859\n<7f50>3829\n<7f54>4702\n<7f55>7643\n<7f6a>6859\n<7f6b>3854\n<7f6e>7353\n<7f70>5007\n<7f72>5393\n<7f75>4717\n<7f77>7486\n<7f79>4629\n<7f85>4377\n<7f88>4110\n<7f8a>5896\n<7f8c>3551\n<7f8e>4864\n<7f94>3750\n<7f9a>4497\n<7f9e>5604\n<7fa4>3955\n<7fa8>5437\n<7fa9>6405\n<7fb2>8054\n<7fb8>4630\n<7fb9>3583\n<7fbd>6218\n<7fc1>6095\n<7fc5>5711\n<7fca>6439\n<7fcc>6440\n<7fce>4498\n<7fd2>5679\n<7fd4>5355\n<7fd5>8033\n<7fdf>6632\n<7fe0>7322\n<7fe1>5209\n<7fe9>7524\n<7feb>6118\n<7ff0>7644\n<7ff9>3883\n<7ffc>6441\n<8000>6160\n<8001>4519\n<8003>3751\n<8005>6501\n<8006>4111\n<8009>3929\n<800c>6427\n<8010>4158\n<8015>3693\n<8017>4782\n<8018>6243\n<802d>4112\n<8033>6428\n<8036>5870\n<803d>7422\n<803f>3694\n<8043>4227\n<8046>4499\n<804a>4559\n<8056>5487\n<8058>5239\n<805a>7323\n<805e>4844\n<806f>4472\n<8070>7258\n<8072>5488\n<8073>6191\n<8077>6979\n<807d>7200\n<807e>4542\n<807f>6368\n<8084>6429\n<8085>5638\n<8086>5285\n<8087>6815\n<8089>6357\n<808b>4605\n<808c>4113\n<8096>7231\n<809b>7682\n<809d>3495\n<80a1>3752\n<80a2>6965\n<80a5>5210\n<80a9>3643\n<80aa>4958\n<80af>4061\n<80b1>3866\n<80b2>6358\n<80b4>7963\n<80ba>7540\n<80c3>6298\n<80c4>6865\n<80cc>4979\n<80ce>7440\n<80da>4980\n<80db>3533\n<80de>7560\n<80e1>7829\n<80e4>6364\n<80e5>5394\n<80f1>3850\n<80f4>4345\n<80f8>8017\n<80fd>4185\n<8102>6966\n<8105>7766\n<8106>7324\n<8107>7767\n<8108>4722\n<810a>7144\n<8118>6119\n<811a>3472\n<811b>3695\n<8123>5656\n<8129>5605\n<812b>7419\n<812f>7561\n<8139>7110\n<813e>5211\n<814b>5856\n<814e>5748\n<8154>3552\n<8155>6120\n<8165>5489\n<8166>4179\n<816b>6849\n<8170>6161\n<8171>3608\n<8178>6557\n<8179>5082\n<817a>5438\n<817f>7461\n<8180>4959\n<8188>3634\n<818a>4899\n<818f>3753\n<819a>5135\n<819c>4667\n<819d>5675\n<81a0>3884\n<81a3>7025\n<81a8>7516\n<81b3>5439\n<81b5>7313\n<81ba>6392\n<81bd>4228\n<81be>7943\n<81bf>4176\n<81c0>4359\n<81c2>5212\n<81c6>5916\n<81cd>6771\n<81d8>4410\n<81df>6558\n<81e3>5749\n<81e5>6103\n<81e7>6559\n<81e8>4650\n<81ea>6502\n<81ed>7325\n<81f3>6967\n<81f4>7354\n<81fa>4261\n<81fb>7003\n<81fc>3930\n<81fe>6341\n<8205>3931\n<8207>5941\n<8208>8034\n<820a>3932\n<820c>5456\n<820d>5286\n<8212>5395\n<821b>7158\n<821c>5657\n<821e>4827\n<821f>6888\n<8221>3553\n<822a>7683\n<822b>4960\n<822c>4925\n<8235>7390\n<8236>4900\n<8237>7749\n<8239>5440\n<8240>5136\n<8245>5942\n<8247>6744\n<8259>7111\n<8264>6406\n<8266>7659\n<826e>3496\n<826f>4436\n<8271>3497\n<8272>5368\n<8276>5994\n<8278>7232\n<827e>5848\n<828b>6219\n<828d>6518\n<828e>3967\n<8292>4703\n<8299>5137\n<829a>4360\n<829d>6968\n<829f>5324\n<82a5>3575\n<82a6>7830\n<82a9>4046\n<82ac>5168\n<82ad>7487\n<82ae>6039\n<82af>5769\n<82b1>7871\n<82b3>4961\n<82b7>6969\n<82b8>6244\n<82b9>4032\n<82bb>7274\n<82bc>4783\n<82bd>5783\n<82bf>6482\n<82d1>6274\n<82d2>5995\n<82d4>7441\n<82d5>7233\n<82d7>4810\n<82db>3455\n<82de>7562\n<82df>3933\n<82e1>6430\n<82e5>5874\n<82e6>3754\n<82e7>6608\n<82f1>6024\n<82fd>3755\n<82fe>7612\n<8301>6921\n<8302>4828\n<8303>5017\n<8304>3456\n<8305>4784\n<8309>4693\n<8317>4757\n<8328>6503\n<832b>4704\n<832f>5083\n<8331>5606\n<8334>7944\n<8335>6455\n<8336>4191\n<8338>6192\n<8339>5943\n<8340>5658\n<8347>7708\n<8349>7234\n<834a>7784\n<834f>6475\n<8351>6431\n<8352>7923\n<8373>4354\n<8377>7624\n<837b>6633\n<8389>4631\n<838a>6560\n<838e>5287\n<8396>3696\n<8398>5750\n<839e>6121\n<83a2>7768\n<83a9>5138\n<83aa>5784\n<83ab>4668\n<83bd>4705\n<83c1>7201\n<83c5>3830\n<83c9>4531\n<83ca>3949\n<83cc>4013\n<83d3>3808\n<83d6>7112\n<83dc>7122\n<83e9>5069\n<83eb>4033\n<83ef>7872\n<83f0>3756\n<83f1>4611\n<83f2>5213\n<83f4>5827\n<83f9>6609\n<83fd>5639\n<8403>7314\n<8404>4297\n<840a>4423\n<840c>4732\n<840d>7532\n<840e>6299\n<8429>7275\n<842c>4683\n<8431>7993\n<8438>6342\n<843d>4386\n<8449>6001\n<8457>6610\n<845b>3506\n<8461>7563\n<8463>4346\n<8466>6300\n<846b>7831\n<846c>6561\n<846f>5875\n<8475>4004\n<847a>6930\n<8490>5607\n<8494>5712\n<8499>4799\n<849c>5312\n<84a1>4962\n<84b2>7564\n<84b8>6939\n<84bb>5876\n<84bc>7113\n<84bf>7832\n<84c0>5549\n<84c2>4758\n<84c4>7295\n<84c6>5415\n<84c9>6193\n<84cb>3576\n<84cd>5713\n<84d1>5288\n<84da>5608\n<84ec>5104\n<84ee>4473\n<84f4>5659\n<84fc>4560\n<8511>4747\n<8513>4684\n<8514>5084\n<8517>6504\n<8518>5325\n<851a>6250\n<851e>4573\n<8521>7123\n<8523>6562\n<8525>7259\n<852c>5527\n<852d>6383\n<852f>7004\n<853d>7541\n<853f>6301\n<8541>4229\n<8543>5002\n<8549>7235\n<854e>3885\n<8553>6245\n<8559>7796\n<8563>5660\n<8568>3981\n<8569>7430\n<856a>4829\n<856d>5528\n<8584>4901\n<8587>4865\n<858f>6407\n<8591>3554\n<8594>6563\n<859b>5457\n<85a6>7159\n<85a8>7989\n<85a9>5319\n<85aa>5751\n<85af>5396\n<85b0>7986\n<85ba>6772\n<85c1>3757\n<85c9>6505\n<85cd>4406\n<85ce>5752\n<85cf>6564\n<85d5>6220\n<85dc>4451\n<85dd>6040\n<85e4>4370\n<85e5>5877\n<85e9>5003\n<85ea>5609\n<85f7>6611\n<85fa>4642\n<85fb>6816\n<85ff>3817\n<8602>6041\n<8606>4520\n<8607>5529\n<860a>6088\n<8616>5924\n<8617>5028\n<861a>5441\n<862d>4395\n<863f>4378\n<864e>7833\n<8650>7632\n<8654>3609\n<8655>7133\n<865b>7721\n<865c>4521\n<865e>6221\n<865f>7834\n<8667>8009\n<8679>7860\n<868a>4845\n<868c>4963\n<8693>6456\n<86a3>3799\n<86a4>6817\n<86a9>7355\n<86c7>5289\n<86cb>4208\n<86d4>7945\n<86d9>6104\n<86db>6889\n<86df>3886\n<86e4>7666\n<86ed>7026\n<86fe>5785\n<8700>7245\n<8702>5105\n<8703>5753\n<8708>6074\n<8718>6970\n<871a>5214\n<871c>4884\n<874e>3508\n<8755>5730\n<8757>7924\n<875f>6302\n<8766>7625\n<8768>5676\n<8774>7835\n<8776>6703\n<8778>6105\n<8782>4418\n<878d>6372\n<879f>4759\n<87a2>7785\n<87b3>4248\n<87ba>4379\n<87c4>7376\n<87e0>4926\n<87ec>5442\n<87ef>6162\n<87f2>7309\n<87f9>7696\n<87fb>6408\n<87fe>5467\n<8805>5690\n<881f>4411\n<8822>6916\n<8823>4452\n<8831>3758\n<8836>6532\n<883b>4685\n<8840>7756\n<8846>6924\n<884c>7709\n<884d>5981\n<8852>7750\n<8853>5668\n<8857>3457\n<8859>5786\n<885b>6303\n<885d>7310\n<8861>7786\n<8862>3934\n<8863>6409\n<8868>7585\n<886b>5326\n<8870>5565\n<8872>4151\n<8877>7311\n<8881>6275\n<8882>4763\n<8888>3458\n<888b>4262\n<888d>7565\n<8892>4209\n<8896>5610\n<8897>7005\n<889e>3782\n<88ab>7601\n<88b4>3759\n<88c1>6582\n<88c2>4482\n<88cf>4632\n<88d4>6042\n<88d5>6343\n<88d9>3956\n<88dc>5070\n<88dd>6565\n<88df>5290\n<88e1>4633\n<88e8>5215\n<88f3>5356\n<88f8>4380\n<88fd>6773\n<8907>5085\n<8910>3507\n<8912>7566\n<8913>5071\n<8918>6304\n<8919>4983\n<8925>6172\n<892a>7462\n<8936>5680\n<8938>4574\n<893b>5458\n<8941>3555\n<8944>5897\n<895f>4049\n<8964>4407\n<896a>4694\n<8972>5681\n<897f>5397\n<8981>6163\n<8983>4230\n<8986>5086\n<8987>7511\n<898b>3644\n<898f>4005\n<8993>4734\n<8996>5714\n<89a1>3635\n<89a9>4298\n<89aa>7363\n<89b2>4034\n<89ba>3473\n<89bd>4408\n<89c0>3831\n<89d2>3474\n<89e3>7697\n<89f4>5357\n<89f8>7246\n<8a00>5921\n<8a02>6745\n<8a03>5139\n<8a08>3724\n<8a0a>5754\n<8a0c>7861\n<8a0e>7452\n<8a13>7987\n<8a16>8026\n<8a17>7406\n<8a18>4114\n<8a1b>6106\n<8a1d>5787\n<8a1f>5557\n<8a23>3653\n<8a25>4182\n<8a2a>4964\n<8a2d>5459\n<8a31>7722\n<8a34>5530\n<8a36>3459\n<8a3a>7006\n<8a3b>6890\n<8a50>5291\n<8a54>6818\n<8a55>7533\n<8a5b>6612\n<8a5e>5292\n<8a60>6025\n<8a62>5661\n<8a63>6043\n<8a66>5715\n<8a69>5716\n<8a6d>3987\n<8a6e>6673\n<8a70>8055\n<8a71>7873\n<8a72>7698\n<8a73>5358\n<8a75>5443\n<8a79>7185\n<8a85>6891\n<8a87>3809\n<8a8c>6971\n<8a8d>6457\n<8a93>5398\n<8a95>7417\n<8a98>6344\n<8a9e>5908\n<8aa0>5490\n<8aa1>3725\n<8aa3>4830\n<8aa4>6075\n<8aa5>3760\n<8aa6>5558\n<8aa8>7946\n<8aaa>5460\n<8ab0>5611\n<8ab2>3810\n<8ab9>5216\n<8abc>6410\n<8abe>6377\n<8abf>6819\n<8ac2>7186\n<8ac4>5662\n<8ac7>4231\n<8acb>7202\n<8acd>6589\n<8acf>7276\n<8ad2>4437\n<8ad6>4535\n<8adb>6345\n<8adc>7194\n<8ae1>5717\n<8ae6>7210\n<8ae7>7699\n<8aea>6746\n<8aeb>3498\n<8aed>6346\n<8aee>6506\n<8af1>8002\n<8af6>5770\n<8af7>7593\n<8af8>6774\n<8afa>5922\n<8afe>4139\n<8b00>4785\n<8b01>5818\n<8b02>6305\n<8b04>4371\n<8b0e>4866\n<8b10>4885\n<8b14>7633\n<8b16>5543\n<8b17>4965\n<8b19>3657\n<8b1a>6442\n<8b1b>3556\n<8b1d>5293\n<8b20>6164\n<8b28>4786\n<8b2b>6634\n<8b2c>4589\n<8b33>3935\n<8b39>4035\n<8b41>7874\n<8b49>6940\n<8b4e>8011\n<8b4f>4115\n<8b58>5731\n<8b5a>4232\n<8b5c>5072\n<8b66>3697\n<8b6c>5217\n<8b6f>5953\n<8b70>6411\n<8b74>3645\n<8b77>7836\n<8b7d>6044\n<8b80>4318\n<8b8a>5033\n<8b90>5612\n<8b92>7090\n<8b93>5898\n<8b96>7091\n<8b9a>7072\n<8c37>3772\n<8c3f>3726\n<8c41>7902\n<8c46>4355\n<8c48>4116\n<8c4a>7594\n<8c4c>6122\n<8c55>5718\n<8c5a>4327\n<8c61>5359\n<8c6a>7837\n<8c6b>6045\n<8c79>7586\n<8c7a>5719\n<8c82>7236\n<8c8a>4723\n<8c8c>4787\n<8c9d>7512\n<8c9e>6747\n<8ca0>5140\n<8ca1>6583\n<8ca2>3800\n<8ca7>5234\n<8ca8>7875\n<8ca9>7495\n<8caa>7423\n<8cab>3832\n<8cac>7129\n<8caf>6613\n<8cb0>5499\n<8cb3>6433\n<8cb4>3992\n<8cb6>7528\n<8cb7>4718\n<8cb8>4263\n<8cbb>5218\n<8cbc>7195\n<8cbd>6432\n<8cbf>4831\n<8cc0>7626\n<8cc1>5169\n<8cc2>4547\n<8cc3>6476\n<8cc4>7947\n<8cc7>6507\n<8cc8>3460\n<8cca>6635\n<8cd1>7007\n<8cd3>5235\n<8cda>4548\n<8cdc>5294\n<8cde>5360\n<8ce0>4984\n<8ce2>7751\n<8ce3>4719\n<8ce4>7160\n<8ce6>5141\n<8cea>7027\n<8ced>4299\n<8cf4>4549\n<8cfb>5142\n<8cfc>3936\n<8cfd>5364\n<8d04>6972\n<8d05>7315\n<8d07>6365\n<8d08>6941\n<8d0a>7073\n<8d0d>5468\n<8d13>6566\n<8d16>5544\n<8d64>6636\n<8d66>5295\n<8d6b>7732\n<8d70>6892\n<8d73>4006\n<8d74>5143\n<8d77>4117\n<8d85>7237\n<8d8a>6282\n<8d99>6820\n<8da3>7326\n<8da8>7277\n<8db3>6830\n<8dba>5144\n<8dbe>6973\n<8dc6>7442\n<8dcb>4936\n<8dcc>7028\n<8dcf>3461\n<8ddb>7488\n<8ddd>3596\n<8de1>6637\n<8de3>5444\n<8de8>3811\n<8def>4522\n<8df3>4300\n<8e0a>6194\n<8e0f>4237\n<8e10>7161\n<8e1e>3597\n<8e2a>6850\n<8e30>6347\n<8e35>6851\n<8e42>6348\n<8e44>6775\n<8e47>3610\n<8e48>4301\n<8e49>7052\n<8e4a>7797\n<8e59>7296\n<8e5f>6638\n<8e60>7145\n<8e74>7297\n<8e76>3982\n<8e81>6821\n<8e87>6614\n<8e8a>6893\n<8e8d>5878\n<8eaa>4643\n<8eab>5755\n<8eac>3968\n<8ec0>3937\n<8eca>7053\n<8ecb>5819\n<8ecc>3988\n<8ecd>3957\n<8ed2>7726\n<8edf>5982\n<8eeb>7008\n<8ef8>7298\n<8efb>3462\n<8efe>5732\n<8f03>3887\n<8f05>4523\n<8f09>6584\n<8f12>7196\n<8f13>4686\n<8f14>5073\n<8f15>3698\n<8f1b>4438\n<8f1c>7356\n<8f1d>8003\n<8f1e>4706\n<8f1f>7174\n<8f26>4474\n<8f27>5055\n<8f29>4985\n<8f2a>4599\n<8f2f>7035\n<8f33>6894\n<8f38>5613\n<8f39>5087\n<8f3b>5088\n<8f3e>6674\n<8f3f>5944\n<8f44>7650\n<8f45>6276\n<8f49>6675\n<8f4d>7175\n<8f4e>3888\n<8f5d>5945\n<8f5f>3867\n<8f62>4463\n<8f9b>5756\n<8f9c>3761\n<8fa3>4398\n<8fa6>7496\n<8fa8>5034\n<8fad>5296\n<8faf>5035\n<8fb0>7009\n<8fb1>6173\n<8fb2>4177\n<8fc2>6222\n<8fc5>5757\n<8fce>6026\n<8fd1>4036\n<8fd4>4927\n<8fe6>3463\n<8fea>6639\n<8feb>4902\n<8fed>7029\n<8ff0>5669\n<8ff2>3626\n<8ff7>4867\n<8ff9>6640\n<8ffd>7278\n<9000>7463\n<9001>5559\n<9002>3838\n<9003>4302\n<9005>7978\n<9006>5954\n<9008>7787\n<900b>7567\n<900d>5531\n<900f>7469\n<9010>7299\n<9011>3938\n<9014>4303\n<9015>3699\n<9017>4356\n<9019>6615\n<901a>7458\n<901d>5399\n<901e>4500\n<901f>5545\n<9020>6822\n<9021>6917\n<9022>5106\n<9023>4475\n<902e>7211\n<9031>6895\n<9032>7010\n<9035>4007\n<9038>6466\n<903c>7615\n<903e>6350\n<9041>4361\n<9042>5614\n<9047>6223\n<904a>6349\n<904b>6246\n<904d>7525\n<904e>3812\n<9050>7627\n<9051>7925\n<9053>4304\n<9054>4216\n<9055>6306\n<9059>6165\n<905c>5550\n<905d>4238\n<905e>7212\n<9060>6277\n<9061>5532\n<9063>3646\n<9069>6641\n<906d>6823\n<906e>7054\n<906f>4362\n<9072>6974\n<9075>6918\n<9077>7162\n<9078>5445\n<907a>6351\n<907c>4561\n<907d>3598\n<907f>7602\n<9080>6166\n<9081>4720\n<9082>7700\n<9083>5615\n<9084>7896\n<9087>6434\n<9088>4669\n<908a>5036\n<908f>4381\n<9091>6389\n<9095>6096\n<9099>4707\n<90a2>7788\n<90a3>4138\n<90a6>4966\n<90a8>7250\n<90aa>5297\n<90af>3526\n<90b0>7443\n<90b1>3939\n<90b5>5533\n<90b8>6616\n<90c1>6236\n<90ca>3889\n<90de>4419\n<90e1>3958\n<90e8>5145\n<90ed>3818\n<90f5>6224\n<90fd>4305\n<9102>5802\n<9112>7279\n<9115>7714\n<9119>5219\n<9127>4372\n<912d>6748\n<9132>4210\n<9149>6352\n<914a>6749\n<914b>7280\n<914c>6519\n<914d>4986\n<914e>6896\n<9152>6897\n<9162>7238\n<9169>4760\n<916a>4387\n<916c>5616\n<9175>7964\n<9177>7843\n<9178>5313\n<9187>5663\n<9189>7327\n<918b>7239\n<918d>6776\n<9192>5491\n<919c>7281\n<91ab>6412\n<91ac>6567\n<91ae>7240\n<91af>7798\n<91b1>4937\n<91b4>4509\n<91b5>3584\n<91c0>5899\n<91c7>7124\n<91c9>6353\n<91cb>5416\n<91cc>4634\n<91cd>6925\n<91ce>5871\n<91cf>4439\n<91d0>4635\n<91d1>4131\n<91d7>5566\n<91d8>6750\n<91dc>5146\n<91dd>7374\n<91e3>6824\n<91e7>7163\n<91ea>6225\n<91f5>7125\n<920d>4363\n<9210>3622\n<9211>7497\n<9212>5329\n<9217>6366\n<921e>4014\n<9234>4501\n<923a>6082\n<923f>6676\n<9240>3534\n<9245>3599\n<9249>7752\n<9257>3658\n<925b>5983\n<925e>6283\n<9262>4938\n<9264>3940\n<9265>5670\n<9266>6751\n<9280>6378\n<9283>7260\n<9285>4347\n<9291>5446\n<9293>6677\n<9296>5617\n<9298>4761\n<929c>7660\n<92b3>6046\n<92b6>3941\n<92b7>5534\n<92b9>5618\n<92cc>6752\n<92cf>7769\n<92d2>5107\n<92e4>5400\n<92ea>7568\n<92f8>3600\n<92fc>3557\n<9304>4532\n<9310>7282\n<9318>7283\n<931a>6590\n<931e>5664\n<931f>4233\n<9320>6753\n<9321>4118\n<9322>6678\n<9324>4119\n<9326>4050\n<9328>4811\n<932b>5417\n<932e>3762\n<932f>7059\n<9348>6027\n<934a>4476\n<934b>3813\n<934d>4306\n<9354>5803\n<935b>4211\n<936e>6354\n<9375>3611\n<937c>7375\n<937e>6852\n<938c>3659\n<9394>6195\n<9396>5564\n<939a>7284\n<93a3>7789\n<93a7>3577\n<93ac>7838\n<93ad>7011\n<93b0>6467\n<93c3>6831\n<93d1>6642\n<93de>6196\n<93e1>3700\n<93e4>4575\n<93f6>7036\n<9404>7952\n<9418>6853\n<9425>5447\n<942b>6679\n<9435>7176\n<9438>7407\n<9444>6898\n<945b>3851\n<947d>7074\n<947f>7060\n<9577>6568\n<9580>4846\n<9583>5469\n<9589>7542\n<958b>3578\n<958f>6367\n<9593>3499\n<9594>4882\n<9598>3535\n<95a3>3475\n<95a4>7667\n<95a5>5008\n<95a8>4008\n<95ad>4453\n<95b1>5988\n<95bb>5996\n<95bc>5820\n<95c7>5828\n<95ca>7903\n<95d4>7668\n<95d5>3983\n<95d6>7473\n<95dc>3833\n<95e1>7164\n<95e2>5029\n<961c>5147\n<9621>7165\n<962a>7498\n<962e>6123\n<9632>4967\n<963b>6825\n<963f>5788\n<9640>7391\n<9642>7603\n<9644>5148\n<964b>4576\n<964c>4724\n<964d>3558\n<9650>7647\n<965b>7543\n<965c>7669\n<965d>5470\n<965e>5691\n<965f>7146\n<9662>6278\n<9663>7012\n<9664>6777\n<966a>4987\n<9670>6384\n<9673>7013\n<9675>4612\n<9676>4307\n<9677>7661\n<9678>4593\n<967d>5900\n<9685>6226\n<9686>4603\n<968a>4264\n<968b>5619\n<968d>7926\n<968e>3727\n<9694>3636\n<9695>6247\n<9698>5849\n<9699>4022\n<969b>6778\n<969c>6569\n<96a3>4644\n<96aa>7728\n<96b1>6379\n<96b7>4510\n<96bb>7147\n<96c0>6520\n<96c1>5813\n<96c4>6254\n<96c5>5789\n<96c6>7037\n<96c7>3763\n<96c9>7357\n<96cb>6919\n<96cc>6508\n<96cd>6097\n<96ce>6617\n<96d5>6826\n<96d6>5622\n<96d9>5773\n<96db>7285\n<96dc>6533\n<96e2>4636\n<96e3>4142\n<96ea>5461\n<96ef>4847\n<96f0>5170\n<96f2>6248\n<96f6>4502\n<96f7>4550\n<96f9>4903\n<96fb>6680\n<9700>5623\n<9706>6754\n<9707>7014\n<9711>6698\n<9713>6047\n<9716>4651\n<9719>6028\n<971c>5361\n<971e>7628\n<9727>4832\n<9730>5314\n<9732>4524\n<9739>5030\n<973d>6779\n<9742>4464\n<9744>5850\n<9748>4503\n<9751>7203\n<9756>6755\n<975c>6756\n<975e>5220\n<9761>4868\n<9762>4744\n<9769>7733\n<976d>6458\n<9774>7876\n<9777>6459\n<977a>4695\n<978b>7799\n<978d>5814\n<978f>3801\n<97a0>3950\n<97a8>3509\n<97ab>3951\n<97ad>7526\n<97c6>7166\n<97cb>6307\n<97d3>7648\n<97dc>4308\n<97f3>6385\n<97f6>5535\n<97fb>6249\n<97ff>7715\n<9800>7839\n<9801>7757\n<9802>6757\n<9803>3701\n<9805>7684\n<9806>5665\n<9808>5624\n<980a>6237\n<980c>5560\n<9810>6048\n<9811>6124\n<9812>4928\n<9813>4328\n<9817>7489\n<9818>4504\n<982d>4357\n<9830>7770\n<9838>3702\n<9839>7464\n<983b>5236\n<9846>3814\n<984c>6780\n<984d>5857\n<984e>5804\n<9854>5815\n<9858>6279\n<985a>6681\n<985e>4590\n<9865>7840\n<9867>3764\n<986b>6682\n<986f>7753\n<98a8>7595\n<98af>5330\n<98b1>7444\n<98c4>7588\n<98c7>7587\n<98db>5221\n<98dc>5004\n<98df>5733\n<98e1>5551\n<98e2>4120\n<98ed>7362\n<98ee>6386\n<98ef>4929\n<98f4>6435\n<98fc>5298\n<98fd>7569\n<98fe>5734\n<9903>3890\n<9909>7716\n<990a>5901\n<990c>6436\n<9910>7075\n<9913>5790\n<9918>5946\n<991e>6683\n<9920>5056\n<9928>3834\n<9945>4687\n<9949>4037\n<994b>3989\n<994c>7076\n<994d>5448\n<9951>4121\n<9952>6167\n<9954>6098\n<9957>7717\n<9996>5625\n<9999>7718\n<999d>7613\n<99a5>5089\n<99a8>7790\n<99ac>4661\n<99ad>5909\n<99ae>7596\n<99b1>7392\n<99b3>7358\n<99b4>5666\n<99b9>6468\n<99c1>4904\n<99d0>6899\n<99d1>4174\n<99d2>3942\n<99d5>3464\n<99d9>5149\n<99dd>7393\n<99df>5299\n<99ed>7701\n<99f1>4388\n<99ff>6920\n<9a01>5240\n<9a08>5057\n<9a19>7527\n<9a2b>3612\n<9a30>4373\n<9a36>7286\n<9a37>5536\n<9a40>4725\n<9a43>7589\n<9a45>3943\n<9a4d>7965\n<9a55>3891\n<9a57>7729\n<9a5a>3703\n<9a5b>5955\n<9a5f>7328\n<9a62>4454\n<9a65>4124\n<9a69>7897\n<9a6a>4455\n<9aa8>3785\n<9ab8>7702\n<9ad3>5626\n<9ad4>7213\n<9ad8>3765\n<9ae5>5997\n<9aee>4939\n<9b1a>5627\n<9b27>4562\n<9b2a>7470\n<9b31>6251\n<9b3c>3993\n<9b41>3863\n<9b42>7849\n<9b43>4940\n<9b44>4995\n<9b45>4721\n<9b4f>6308\n<9b54>4662\n<9b5a>5910\n<9b6f>4525\n<9b8e>6699\n<9b91>7570\n<9b9f>5816\n<9bab>3892\n<9bae>5449\n<9bc9>4637\n<9bd6>7204\n<9be4>3783\n<9be8>3704\n<9c0d>7287\n<9c10>5805\n<9c12>5090\n<9c15>7629\n<9c25>7898\n<9c32>6076\n<9c3b>4688\n<9c47>3559\n<9c49>5039\n<9c57>4645\n<9ce5>6827\n<9ce7>5150\n<9ce9>3944\n<9cf3>5108\n<9cf4>4762\n<9cf6>5984\n<9d09>5791\n<9d1b>6280\n<9d26>5839\n<9d28>5832\n<9d3b>7862\n<9d51>3647\n<9d5d>5792\n<9d60>3773\n<9d61>4833\n<9d6c>5180\n<9d72>6521\n<9da9>4794\n<9daf>5860\n<9db4>7634\n<9dc4>3728\n<9dd7>3945\n<9df2>7329\n<9df8>8012\n<9df9>6393\n<9dfa>4526\n<9e1a>5861\n<9e1e>4396\n<9e75>4527\n<9e79>7662\n<9e7d>5998\n<9e7f>4533\n<9e92>4125\n<9e93>4534\n<9e97>4456\n<9e9d>5300\n<9e9f>4646\n<9ea5>4726\n<9eb4>3952\n<9eb5>4745\n<9ebb>4663\n<9ebe>8004\n<9ec3>7927\n<9ecd>5401\n<9ece>4457\n<9ed1>8018\n<9ed4>3623\n<9ed8>4835\n<9edb>4265\n<9edc>7305\n<9ede>6700\n<9ee8>4249\n<9ef4>4869\n<9f07>6077\n<9f08>5040\n<9f0e>6758\n<9f13>3766\n<9f20>5402\n<9f3b>5222\n<9f4a>6781\n<9f4b>6585\n<9f4e>6586\n<9f52>7359\n<9f5f>6618\n<9f61>4505\n<9f67>5462\n<9f6a>7061\n<9f6c>5911\n<9f77>5806\n<9f8d>4563\n<9f90>4968\n<9f95>3529\n<9f9c>3946\n<ac04>1088\n<ac18>9342\n<ac20>1106\n<ac24>1107\n<ac2e>9355\n<ac3c>1115\n<ac40>1116\n<ac4b>1117\n<ac4c>9377\n<ac4d>1118\n<ac54>1119\n<ac58>1120\n<ac5c>1121\n<ac74>1124\n<ac79>9413\n<ac7a>1127\n<ac82>9419\n<ac90>1138\n<ac94>1139\n<ac9e>9435\n<acab>9442\n<acac>1148\n<acba>9452\n<acc1>1156\n<acc4>1157\n<acc8>1158\n<accc>1159\n<acd5>1160\n<acd6>9472\n<acd7>1161\n<ace4>1164\n<ace9>9485\n<acea>1167\n<aceb>9486\n<acec>1168\n<acf2>9489\n<acf3>1172\n<acf4>9490\n<ad00>1177\n<ad04>1178\n<ad05>9501\n<ad06>1179\n<ad0e>9507\n<ad0f>1182\n<ad10>9508\n<ad11>1183\n<ad18>1184\n<ad1c>1185\n<ad20>1186\n<ad29>1187\n<ad38>1192\n<ad3c>1193\n<ad46>9549\n<ad47>1196\n<ad48>9550\n<ad49>1197\n<ad50>1198\n<ad54>1199\n<ad58>1200\n<ad61>1201\n<ad62>9571\n<ad63>1202\n<ad70>1205\n<ad7e>9588\n<ad7f>1213\n<ad80>9589\n<ad8c>1218\n<ad90>1219\n<ada4>1222\n<adb7>1223\n<adc4>1226\n<adc8>1227\n<add2>9655\n<add3>1230\n<addc>1231\n<ade0>1232\n<ade4>1233\n<adfc>1236\n<ae0a>9699\n<ae0b>1242\n<ae0c>9700\n<ae0d>1243\n<ae14>1244\n<ae34>1247\n<ae39>9738\n<ae3a>1250\n<ae42>9744\n<ae43>1253\n<ae44>9745\n<ae4a>1256\n<ae4b>9749\n<ae4f>9750\n<ae50>1260\n<ae54>1261\n<ae55>9754\n<ae56>1262\n<ae5e>9760\n<ae65>1268\n<ae6c>1271\n<ae70>1272\n<ae7a>9778\n<ae8c>1280\n<aebf>9838\n<aec0>1284\n<aec4>1285\n<aece>9849\n<aedc>1293\n<aee8>1294\n<aeeb>1295\n<aeec>9871\n<aeed>1296\n<aef4>1297\n<aef8>1298\n<aefc>1299\n<af0d>1302\n<af10>1303\n<af30>1306\n<af31>9929\n<af32>1307\n<af33>9930\n<af34>1308\n<af3e>9938\n<af3f>1311\n<af40>9939\n<af50>1317\n<af79>1322\n<af80>1323\n<af84>1324\n<af88>1325\n<af95>1328\n<af9c>1329\n<afbc>1332\n<afc0>1333\n<afca>10052\n<afcb>1337\n<afcc>10053\n<afd4>1340\n<afdc>1341\n<aff4>1346\n<aff8>1347\n<b004>1350\n<b00c>1351\n<b010>1352\n<b014>1353\n<b028>1356\n<b048>1359\n<b049>10156\n<b04a>1360\n<b04b>10157\n<b04c>1361\n<b04d>10158\n<b04e>1362\n<b056>10163\n<b057>1366\n<b058>10164\n<b059>1367\n<b05d>1368\n<b080>1371\n<b084>1372\n<b08e>10210\n<b08f>1375\n<b090>10211\n<b091>1376\n<b09b>10218\n<b09c>1380\n<b0aa>10226\n<b0b0>10227\n<b0b1>1392\n<b0b2>10228\n<b0b8>1396\n<b0bc>1397\n<b0c6>10241\n<b0d4>1405\n<b0d8>1406\n<b0e0>1407\n<b0e5>1408\n<b10a>10298\n<b110>1413\n<b111>10302\n<b11a>10307\n<b128>1424\n<b12c>1425\n<b136>10325\n<b144>1433\n<b148>1434\n<b158>1439\n<b15c>1440\n<b160>1441\n<b17c>1444\n<b180>1445\n<b181>10382\n<b182>1446\n<b18a>10388\n<b18b>1449\n<b18c>10389\n<b18d>1450\n<b198>1454\n<b19c>1455\n<b1a8>1456\n<b1cc>1457\n<b1d0>1458\n<b1d4>1459\n<b1de>10459\n<b1df>1462\n<b1ec>1465\n<b1f0>1466\n<b1f9>1467\n<b1fa>10481\n<b1fb>1468\n<b1fc>10482\n<b1fd>1469\n<b208>1472\n<b216>10500\n<b217>1477\n<b218>10501\n<b219>1478\n<b220>1479\n<b234>1480\n<b23c>1481\n<b258>1482\n<b25c>1483\n<b260>1484\n<b27c>1489\n<b289>1492\n<b294>1495\n<b2a2>10616\n<b2a3>1501\n<b2a4>10617\n<b2aa>1504\n<b2ab>10621\n<b2ac>1505\n<b2b0>1506\n<b2b4>1507\n<b2cc>1510\n<b2d0>1511\n<b2d1>10652\n<b2d2>1512\n<b2da>10658\n<b2db>1515\n<b2dc>10659\n<b2dd>1516\n<b2e2>1517\n<b2e3>10664\n<b2e7>10665\n<b2e8>1521\n<b2f6>10671\n<b304>1538\n<b308>1539\n<b312>10687\n<b31c>1545\n<b357>10749\n<b358>1549\n<b35d>10752\n<b366>10757\n<b367>1556\n<b368>10758\n<b369>1557\n<b36a>10759\n<b36b>1558\n<b36e>1559\n<b36f>10762\n<b374>1562\n<b378>1563\n<b382>10775\n<b38c>1569\n<b390>1570\n<b394>1571\n<b3a8>1574\n<b3ac>1575\n<b3c8>1578\n<b3cd>10835\n<b3ce>1581\n<b3cf>10836\n<b3d0>1582\n<b3d6>10840\n<b3d7>1585\n<b3d8>10841\n<b3d9>1586\n<b3da>10842\n<b3db>1587\n<b3dc>10843\n<b3dd>1588\n<b3e0>1589\n<b3e4>1590\n<b3e8>1591\n<b3fc>1592\n<b410>1593\n<b418>1594\n<b41c>1595\n<b420>1596\n<b42a>10910\n<b42b>1599\n<b434>1600\n<b454>1603\n<b458>1604\n<b462>10958\n<b463>1607\n<b464>10959\n<b465>1608\n<b46c>1609\n<b480>1610\n<b488>1611\n<b49d>1612\n<b4a4>1613\n<b4a8>1614\n<b4ac>1615\n<b4b5>1616\n<b4b6>11032\n<b4b7>1617\n<b4b8>11033\n<b4b9>1618\n<b4c0>1619\n<b4c4>1620\n<b4c8>1621\n<b4d0>1622\n<b4d5>1623\n<b4e0>1626\n<b4e5>11067\n<b4e6>1629\n<b4ee>11073\n<b4ef>1632\n<b4f0>11074\n<b4f1>1633\n<b4f8>1634\n<b518>1637\n<b526>11119\n<b534>1648\n<b538>1649\n<b542>11137\n<b550>1658\n<b554>1659\n<b55e>11155\n<b5a4>1667\n<b5a8>1668\n<b5a9>11223\n<b5b2>11228\n<b5c0>1679\n<b5c4>1680\n<b5ce>11246\n<b5d8>1686\n<b5ec>1687\n<b614>1690\n<b618>1691\n<b625>1692\n<b62c>1693\n<b634>1694\n<b648>1695\n<b664>1696\n<b668>1697\n<b6a0>1700\n<b6a4>1701\n<b6b1>1704\n<b6d4>1705\n<b6f0>1706\n<b6f4>1707\n<b6f8>1708\n<b705>1711\n<b72c>1714\n<b73a>11574\n<b73b>1719\n<b744>1720\n<b748>1721\n<b74c>1722\n<b760>1725\n<b764>1726\n<b768>1727\n<b772>11619\n<b773>1730\n<b774>11620\n<b775>1731\n<b780>1734\n<b784>1735\n<b78e>11639\n<b79c>1746\n<b7a0>1747\n<b7aa>11655\n<b7b8>1755\n<b7c7>1756\n<b7c8>11678\n<b7c9>1757\n<b7f0>1760\n<b7f4>1761\n<b7fe>11725\n<b80c>1770\n<b810>1771\n<b81a>11743\n<b81b>1774\n<b81c>11744\n<b81d>1775\n<b828>1778\n<b82c>1779\n<b836>11763\n<b840>1785\n<b844>1786\n<b851>1787\n<b852>11785\n<b853>1788\n<b860>1791\n<b864>1792\n<b86e>11806\n<b86f>1795\n<b870>11807\n<b871>1796\n<b878>1797\n<b87c>1798\n<b88d>1799\n<b8a8>1800\n<b8b0>1801\n<b8b4>1802\n<b8b8>1803\n<b8c2>11879\n<b8c3>1806\n<b8c4>11880\n<b8c5>1807\n<b8cc>1808\n<b8d0>1809\n<b8d4>1810\n<b8dd>1811\n<b8de>11901\n<b8df>1812\n<b8e0>11902\n<b8e1>1813\n<b8ec>1816\n<b8f0>1817\n<b8fa>11921\n<b8fb>1820\n<b8fc>11922\n<b8fd>1821\n<b904>1822\n<b918>1823\n<b920>1824\n<b940>1827\n<b944>1828\n<b94c>1829\n<b94f>1830\n<b950>11996\n<b951>1831\n<b95c>1834\n<b960>1835\n<b96a>12015\n<b96b>1838\n<b96c>12016\n<b96d>1839\n<b978>1842\n<b97c>1843\n<b986>12035\n<b987>1846\n<b988>12036\n<b9b0>1853\n<b9b4>1854\n<b9be>12080\n<b9bf>1857\n<b9c0>12081\n<b9c1>1858\n<b9cc>1861\n<b9cd>12090\n<b9da>12096\n<b9db>1869\n<b9dc>12097\n<b9e1>1872\n<b9e2>12100\n<b9e8>1876\n<b9ec>1877\n<b9f6>12113\n<ba08>1886\n<ba15>1887\n<ba3c>1890\n<ba40>1891\n<ba41>12176\n<ba42>1892\n<ba4a>12182\n<ba4b>1895\n<ba4c>12183\n<ba58>1901\n<ba5c>1902\n<ba66>12200\n<ba74>1910\n<ba78>1911\n<ba86>12222\n<ba87>1915\n<ba8c>1916\n<baaa>12254\n<bab0>1921\n<bab1>12258\n<bab2>1922\n<baba>12264\n<babb>1925\n<babc>12265\n<babd>1926\n<bac4>1927\n<bac8>1928\n<bafc>1931\n<bb00>1932\n<bb04>1933\n<bb0d>1934\n<bb0e>12338\n<bb0f>1935\n<bb10>12339\n<bb11>1936\n<bb18>1937\n<bb1c>1938\n<bb20>1939\n<bb29>1940\n<bb2a>12360\n<bb2b>1941\n<bb37>12369\n<bb38>1945\n<bb46>12377\n<bb47>1952\n<bb48>12378\n<bb49>1953\n<bb4d>1954\n<bb4e>12382\n<bb54>1957\n<bb58>1958\n<bb61>1959\n<bb62>12397\n<bb63>1960\n<bb6c>1961\n<bb88>1962\n<bb8c>1963\n<bb90>1964\n<bba4>1965\n<bba8>1966\n<bbac>1967\n<bbb4>1968\n<bbb7>1969\n<bbc0>1970\n<bbc4>1971\n<bbc8>1972\n<bbd0>1973\n<bbd3>1974\n<bbfc>1977\n<bc01>12536\n<bc02>1980\n<bc0a>12542\n<bc0e>12543\n<bc0f>1986\n<bc10>12544\n<bc11>1987\n<bc26>12553\n<bc27>2000\n<bc28>12554\n<bc29>2001\n<bc2d>2002\n<bc34>2005\n<bc38>2006\n<bc42>12572\n<bc49>2012\n<bc50>2015\n<bc5d>2016\n<bc88>2019\n<bc8d>12634\n<bc8e>2022\n<bc96>12640\n<bc97>2025\n<bc98>12641\n<bca4>2030\n<bcb2>12658\n<bcc0>2040\n<bcc4>2041\n<bccd>2042\n<bcce>12678\n<bcd5>2046\n<bcd8>2047\n<bcdc>2048\n<bcf7>12710\n<bcf8>2052\n<bcfc>2053\n<bd06>12721\n<bd07>2056\n<bd08>12722\n<bd09>2057\n<bd10>2058\n<bd14>2059\n<bd24>2060\n<bd2c>2061\n<bd40>2062\n<bd4c>2065\n<bd50>2066\n<bd64>2069\n<bd68>2070\n<bd84>2073\n<bd92>12837\n<bd93>2080\n<bd94>12838\n<bd95>2081\n<bd9b>12842\n<bd9c>2084\n<bda4>2085\n<bdb0>2086\n<bdb8>2087\n<bdd8>2090\n<bddc>2091\n<bde9>2092\n<bdf0>2093\n<bdf4>2094\n<bdf8>2095\n<be00>2096\n<be03>2097\n<be04>12933\n<be05>2098\n<be10>2101\n<be14>2102\n<be1e>12952\n<be1f>2105\n<be48>2108\n<be4c>2109\n<be4d>12994\n<be4e>2110\n<be56>13000\n<be57>2113\n<be58>13001\n<be64>2119\n<be68>2120\n<be69>13011\n<be6a>2121\n<be72>13017\n<be80>2130\n<be84>2131\n<be8e>13035\n<bea8>2139\n<bed4>2142\n<bee0>2145\n<beec>2149\n<bf01>2150\n<bf1a>13154\n<bf44>2160\n<bf48>2161\n<bf55>2164\n<bf94>2165\n<bfb0>2166\n<bfc5>2167\n<bfd0>2170\n<bfd4>2171\n<bfdc>2172\n<bfdf>2173\n<bfe0>13333\n<bfe1>2174\n<c03c>2175\n<c051>2176\n<c058>2177\n<c05c>2178\n<c060>2179\n<c094>2184\n<c098>2185\n<c0a2>13513\n<c0a3>2188\n<c0a4>13514\n<c0a5>2189\n<c0ae>13521\n<c0be>13529\n<c0c5>2203\n<c0cc>2206\n<c0d0>2207\n<c0da>13547\n<c0e8>2215\n<c0ec>2216\n<c0f6>13566\n<c0f7>2219\n<c0f8>13567\n<c0f9>2220\n<c100>2221\n<c104>2222\n<c108>2223\n<c110>2224\n<c115>2225\n<c125>13599\n<c12e>13604\n<c136>2240\n<c137>13609\n<c13c>2243\n<c140>2244\n<c14a>13622\n<c158>2252\n<c15c>2253\n<c166>13641\n<c170>2259\n<c174>2260\n<c178>2261\n<c185>2262\n<c18f>13672\n<c190>2266\n<c194>2267\n<c195>13676\n<c196>2268\n<c19e>13682\n<c19f>2271\n<c1a0>13683\n<c1a1>2272\n<c1a5>2273\n<c1ac>2276\n<c1b0>2277\n<c1bd>2278\n<c1c4>2279\n<c1c8>2280\n<c1cc>2281\n<c1d4>2282\n<c1e0>2285\n<c1e4>2286\n<c1e8>2287\n<c1f2>13747\n<c1f3>2290\n<c200>2293\n<c204>2294\n<c20e>13768\n<c20f>2297\n<c210>13769\n<c211>2298\n<c21c>2301\n<c22a>13787\n<c22b>2306\n<c22c>13788\n<c22d>2307\n<c22e>13789\n<c22f>2308\n<c230>13790\n<c233>13791\n<c234>2311\n<c248>2312\n<c254>2315\n<c258>2316\n<c260>2317\n<c265>2318\n<c270>2321\n<c274>2322\n<c27e>13852\n<c27f>2325\n<c280>13853\n<c281>2326\n<c290>2329\n<c298>2330\n<c29b>2331\n<c29c>13875\n<c29d>2332\n<c2a8>2335\n<c2b6>13893\n<c2b7>2340\n<c2b8>13894\n<c2b9>2341\n<c2e0>2344\n<c2ee>13939\n<c2ef>2350\n<c2f0>13940\n<c2f1>2351\n<c2f6>2352\n<c2f7>13945\n<c2fa>13946\n<c300>2357\n<c318>2365\n<c31c>2366\n<c345>2371\n<c36c>2374\n<c370>2375\n<c371>14044\n<c372>2376\n<c384>2381\n<c388>2382\n<c38c>2383\n<c3c0>2384\n<c3dc>2387\n<c3e1>14142\n<c3e2>2390\n<c3ed>2393\n<c3f8>2396\n<c408>2397\n<c410>2398\n<c424>2399\n<c42c>2400\n<c430>2401\n<c434>2402\n<c448>2405\n<c468>2408\n<c46c>2409\n<c479>2412\n<c480>2413\n<c494>2414\n<c49c>2415\n<c4b8>2416\n<c4bc>2417\n<c4e9>2418\n<c4f4>2421\n<c4f8>2422\n<c4f9>14389\n<c4fa>2423\n<c50c>2427\n<c510>2428\n<c514>2429\n<c51c>2430\n<c52c>2433\n<c530>2434\n<c53a>14440\n<c53b>2437\n<c53c>14441\n<c53d>2438\n<c54b>14450\n<c556>14455\n<c55f>14459\n<c564>2457\n<c568>2458\n<c572>14472\n<c580>2466\n<c584>2467\n<c587>2468\n<c58e>14490\n<c58f>2471\n<c590>14491\n<c591>2472\n<c595>2473\n<c596>14495\n<c59c>2476\n<c5a0>2477\n<c5a9>2478\n<c5ba>14522\n<c5cb>14528\n<c5cc>2494\n<c5cd>14529\n<c5ce>2495\n<c5cf>14530\n<c5d4>2498\n<c5d8>2499\n<c5e2>14543\n<c5e3>2502\n<c5e4>14544\n<c5e5>2503\n<c5ef>14551\n<c5f0>2507\n<c5f4>2508\n<c5f5>14555\n<c60c>2521\n<c610>2522\n<c61a>14576\n<c628>2529\n<c62f>14589\n<c630>2533\n<c636>14592\n<c637>2537\n<c638>14593\n<c639>2538\n<c63a>14594\n<c63b>2539\n<c644>2542\n<c648>2543\n<c652>14611\n<c660>2551\n<c66c>2552\n<c66f>2553\n<c670>14633\n<c671>2554\n<c67c>2557\n<c680>2558\n<c68a>14652\n<c68b>2561\n<c68c>14653\n<c68d>2562\n<c698>2565\n<c69c>2566\n<c6a6>14672\n<c6a7>2569\n<c6a8>14673\n<c6a9>2570\n<c6b4>2573\n<c6c2>14690\n<c6c3>2579\n<c6c4>14691\n<c6c5>2580\n<c6d0>2583\n<c6d4>2584\n<c6ec>2591\n<c6f0>2592\n<c6fd>2595\n<c708>2598\n<c70c>2599\n<c716>14751\n<c717>2602\n<c718>14752\n<c719>2603\n<c724>2606\n<c728>2607\n<c732>14771\n<c733>2610\n<c734>14772\n<c735>2611\n<c736>14773\n<c737>2612\n<c740>2615\n<c744>2616\n<c74a>2617\n<c74b>14788\n<c74e>14789\n<c74f>2620\n<c750>14790\n<c75c>2629\n<c760>2630\n<c768>2631\n<c76b>2632\n<c778>2635\n<c786>14823\n<c78e>2646\n<c78f>14827\n<c794>2649\n<c795>14830\n<c799>14831\n<c79a>2653\n<c7a2>14837\n<c7b0>2662\n<c7b4>2663\n<c7be>14855\n<c7cc>2671\n<c7cd>14864\n<c7ce>2672\n<c7cf>14865\n<c7d0>2673\n<c7d8>2674\n<c7dd>2675\n<c7e4>2676\n<c7e8>2677\n<c7ec>2678\n<c804>2681\n<c808>2682\n<c809>14913\n<c80a>2683\n<c812>14919\n<c813>2686\n<c814>14920\n<c820>2691\n<c824>2692\n<c82e>14938\n<c82f>2695\n<c830>14939\n<c831>2696\n<c838>2697\n<c83c>2698\n<c840>2699\n<c854>2704\n<c874>2707\n<c878>2708\n<c879>14999\n<c87a>2709\n<c882>15005\n<c883>2712\n<c884>15006\n<c894>2719\n<c89d>2720\n<c89e>15024\n<c89f>2721\n<c8a0>15025\n<c8a1>2722\n<c8a8>2723\n<c8c4>2726\n<c8c8>2727\n<c8cc>2728\n<c8d6>15070\n<c8d7>2731\n<c8d8>15071\n<c8d9>2732\n<c8e4>2735\n<c8f5>2736\n<c900>2739\n<c90e>15112\n<c90f>2745\n<c910>15113\n<c911>2746\n<c918>2747\n<c92c>2748\n<c934>2749\n<c954>2752\n<c958>2753\n<c962>15185\n<c963>2756\n<c96c>2757\n<c970>2758\n<c974>2759\n<c97c>2760\n<c98c>2763\n<c990>2764\n<c99a>15230\n<c99b>2767\n<c99c>15231\n<c99d>2768\n<c9c4>2771\n<c9c9>15270\n<c9ca>2774\n<c9d2>15276\n<c9d3>2777\n<c9d4>15277\n<c9db>15280\n<c9e0>2784\n<c9e1>15283\n<c9e2>2785\n<c9e3>15284\n<c9e4>2786\n<c9e7>2787\n<c9ee>15291\n<c9fc>2795\n<ca00>2796\n<ca0a>15310\n<ca14>2802\n<ca18>2803\n<ca29>2804\n<ca50>2807\n<ca54>2808\n<ca5e>15382\n<ca68>2814\n<ca7d>2815\n<ca84>2816\n<ca98>2817\n<cac0>2820\n<cac4>2821\n<cace>15481\n<cacf>2824\n<cad0>15482\n<cad1>2825\n<cad2>15483\n<cad3>2826\n<cae0>2829\n<caec>2830\n<caf4>2831\n<cb08>2832\n<cb10>2833\n<cb14>2834\n<cb18>2835\n<cb41>2838\n<cb4c>2841\n<cb50>2842\n<cb5d>2845\n<cb64>2846\n<cb9c>2849\n<cbb8>2850\n<cbd4>2851\n<cbe4>2852\n<cbe7>2853\n<cbe8>15733\n<cbe9>2854\n<cc10>2857\n<cc14>2858\n<cc2c>2866\n<cc2d>15789\n<cc2e>2867\n<cc2f>15790\n<cc30>2868\n<cc3a>15798\n<cc48>2877\n<cc4c>2878\n<cc56>15816\n<cc60>2884\n<cc64>2885\n<cc65>15826\n<cc66>2886\n<cc67>15827\n<cc68>2887\n<cc70>2888\n<cc75>2889\n<cc9c>2892\n<cca0>2893\n<ccaa>15885\n<ccb8>2901\n<ccbc>2902\n<ccc6>15904\n<ccc7>2905\n<ccc8>15905\n<ccc9>2906\n<ccd0>2907\n<ccd4>2908\n<cce4>2909\n<ccec>2910\n<ccf0>2911\n<cd01>2912\n<cd0c>2915\n<cd10>2916\n<cd1a>15974\n<cd1b>2919\n<cd1c>15975\n<cd1d>2920\n<cd24>2921\n<cd28>2922\n<cd2c>2923\n<cd39>2924\n<cd5c>2925\n<cd60>2926\n<cd64>2927\n<cd6e>16047\n<cd6f>2930\n<cd70>16048\n<cd71>2931\n<cd78>2932\n<cd88>2933\n<cd98>2936\n<cd9c>2937\n<cda6>16093\n<cda7>2940\n<cda8>16094\n<cda9>2941\n<cdb0>2942\n<cdc4>2943\n<cdcc>2944\n<cdd0>2945\n<cde8>2946\n<cdec>2947\n<cdf0>2948\n<cdfa>16166\n<cdfb>2951\n<cdfc>16167\n<cdfd>2952\n<ce04>2953\n<ce08>2954\n<ce0c>2955\n<ce14>2956\n<ce19>2957\n<ce24>2960\n<ce28>2961\n<ce32>16209\n<ce33>2964\n<ce34>16210\n<ce35>2965\n<ce5c>2968\n<ce6a>16255\n<ce6b>2974\n<ce6c>16256\n<ce6d>2975\n<ce78>2978\n<ce7c>2979\n<ce86>16275\n<ce87>2982\n<ce88>16276\n<ce89>2983\n<ce94>2986\n<ce98>2987\n<cea2>16295\n<cec1>2995\n<cee8>2998\n<cef6>16366\n<cf04>3008\n<cf08>3009\n<cf12>16385\n<cf13>3012\n<cf14>16386\n<cf15>3013\n<cf1c>3014\n<cf20>3015\n<cf24>3016\n<cf2e>16406\n<cf38>3022\n<cf58>3025\n<cf5c>3026\n<cf66>16452\n<cf67>3029\n<cf68>16453\n<cf69>3030\n<cf74>3033\n<cf78>3034\n<cf80>3035\n<cf85>3036\n<cf8c>3037\n<cfa1>3038\n<cfa8>3039\n<cfb0>3040\n<cfc4>3041\n<cfe4>3044\n<cfe8>3045\n<cff2>16573\n<cff3>3048\n<cff4>16574\n<cff5>3049\n<cffc>3050\n<d000>3051\n<d004>3052\n<d011>3053\n<d018>3054\n<d02d>3055\n<d038>3058\n<d03c>3059\n<d046>16643\n<d047>3062\n<d048>16644\n<d049>3063\n<d050>3064\n<d054>3065\n<d058>3066\n<d060>3067\n<d070>3070\n<d074>3071\n<d081>3074\n<d0a8>3077\n<d0ac>3078\n<d0b6>16736\n<d0b7>3081\n<d0b8>16737\n<d0b9>3082\n<d0c4>3085\n<d0d2>16755\n<d0e0>3095\n<d0e4>3096\n<d0ee>16774\n<d0f8>3102\n<d10d>3103\n<d134>3106\n<d138>3107\n<d139>16840\n<d13a>3108\n<d142>16846\n<d150>3116\n<d154>3117\n<d15e>16865\n<d15f>3120\n<d160>16866\n<d161>3121\n<d168>3122\n<d16c>3123\n<d17c>3124\n<d184>3125\n<d188>3126\n<d1a4>3129\n<d1a8>3130\n<d1b2>16936\n<d1b3>3133\n<d1b4>16937\n<d1b5>3134\n<d1ba>3135\n<d1bb>16942\n<d1bc>3136\n<d1c0>3137\n<d1d8>3138\n<d1f4>3139\n<d1f8>3140\n<d207>3141\n<d208>17013\n<d209>3142\n<d210>3143\n<d230>3146\n<d234>3147\n<d23e>17059\n<d23f>3150\n<d240>17060\n<d241>3151\n<d248>3152\n<d25c>3153\n<d264>3154\n<d284>3157\n<d288>3158\n<d295>3161\n<d29c>3162\n<d2a0>3163\n<d2a4>3164\n<d2ac>3165\n<d2b1>3166\n<d2bc>3169\n<d2c1>17168\n<d2c2>3172\n<d2ca>17174\n<d2cb>3175\n<d2d4>3176\n<d2d8>3177\n<d2dc>3178\n<d2f4>3183\n<d2f8>3184\n<d302>17218\n<d303>3187\n<d304>17219\n<d305>3188\n<d30f>17226\n<d310>3192\n<d314>3193\n<d315>17230\n<d316>3194\n<d31e>17236\n<d325>3200\n<d32c>3203\n<d330>3204\n<d33a>17254\n<d380>3214\n<d384>3215\n<d38e>17327\n<d39c>3223\n<d3a0>3224\n<d3aa>17346\n<d3ab>3227\n<d3ac>17347\n<d3ad>3228\n<d3b4>3229\n<d3b8>3230\n<d3bc>3231\n<d3d0>3236\n<d3d8>3237\n<d3e1>3238\n<d3e2>17390\n<d3e3>3239\n<d3f0>3242\n<d3f4>3243\n<d3fe>17411\n<d3ff>3246\n<d400>17412\n<d401>3247\n<d408>3248\n<d41d>3249\n<d440>3250\n<d444>3251\n<d45c>3252\n<d460>3253\n<d464>3254\n<d46d>3255\n<d46e>17513\n<d46f>3256\n<d47c>3259\n<d481>17526\n<d482>3262\n<d48a>17532\n<d48b>3265\n<d48c>17533\n<d48d>3266\n<d494>3267\n<d4a9>3268\n<d4cc>3269\n<d4d0>3270\n<d4d4>3271\n<d4dc>3272\n<d4df>3273\n<d4e8>3274\n<d4ec>3275\n<d4f0>3276\n<d4f8>3277\n<d4fb>3278\n<d4fc>17632\n<d4fd>3279\n<d504>3280\n<d508>3281\n<d50c>3282\n<d516>17652\n<d517>3285\n<d540>3288\n<d544>3289\n<d54e>17701\n<d54f>3292\n<d550>17702\n<d551>3293\n<d55c>3296\n<d560>3297\n<d565>3298\n<d56a>17720\n<d56b>3301\n<d56c>17721\n<d56d>3302\n<d578>3305\n<d57c>3306\n<d586>17740\n<d590>3312\n<d5a5>3313\n<d5cc>3316\n<d5d0>3317\n<d5d1>17806\n<d5d2>3318\n<d5da>17812\n<d5db>3321\n<d5dc>17813\n<d5dd>3322\n<d5e8>3325\n<d5ec>3326\n<d5f6>17832\n<d5f7>3329\n<d5f8>17833\n<d5f9>3330\n<d604>3333\n<d608>3334\n<d612>17852\n<d61c>3340\n<d620>3341\n<d624>3342\n<d62d>3343\n<d63c>3346\n<d640>3347\n<d645>3348\n<d64a>17894\n<d64b>3351\n<d64c>17895\n<d64d>3352\n<d651>3353\n<d658>3356\n<d65c>3357\n<d667>3358\n<d668>17916\n<d669>3359\n<d674>3362\n<d683>3363\n<d684>17939\n<d685>3364\n<d690>3367\n<d694>3368\n<d69d>3369\n<d69e>17959\n<d69f>3370\n<d6a0>17960\n<d6a1>3371\n<d6a8>3372\n<d6ac>3373\n<d6b0>3374\n<d6b9>3375\n<d6ba>17981\n<d6bb>3376\n<d6c8>3379\n<d6cc>3380\n<d6d1>3381\n<d6d4>3382\n<d6d7>3383\n<d6d8>18003\n<d6d9>3384\n<d6e0>3385\n<d6e4>3386\n<d6e8>3387\n<d6f0>3388\n<d6f5>3389\n<d700>3392\n<d704>3393\n<d711>3394\n<d71c>3397\n<d720>3398\n<d72a>18068\n<d72b>3401\n<d72c>18069\n<d72d>3402\n<d738>3405\n<d73c>3406\n<d744>3407\n<d747>3408\n<d748>18090\n<d749>3409\n<d754>3412\n<d755>18099\n<d762>18106\n<d763>3419\n<d764>18107\n<d765>3420\n<d769>3421\n<d76c>3422\n<d770>3423\n<d774>3424\n<d781>3427\n<d78c>3430\n<d790>3431\n<d79a>18147\n<d79b>3434\n<d79c>18148\n<d79d>3435\n<f900>4116\n<f901>3678\n<f902>7053\n<f903>3460\n<f904>7900\n<f905>3802\n<f906>3902\n<f907>3946\n<f908>3946\n<f909>3708\n<f90a>4131\n<f90b>4374\n<f90c>4156\n<f914>5800\n<f921>4399\n<f922>4403\n<f92e>4424\n<f92f>4511\n<f949>4550\n<f94a>4564\n<f951>4576\n<f95a>4318\n<f95b>4136\n<f95c>5800\n<f95d>4139\n<f95e>4192\n<f95f>4167\n<f960>4172\n<f961>5552\n<f962>6424\n<f963>5151\n<f964>4922\n<f965>7518\n<f966>5079\n<f967>5109\n<f968>7607\n<f969>5584\n<f96a>5367\n<f96b>7083\n<f96c>5362\n<f96d>5485\n<f96e>6001\n<f96f>5460\n<f970>5317\n<f971>7009\n<f972>7370\n<f973>5678\n<f974>5874\n<f97e>4439\n<f981>4159\n<f982>4444\n<f983>4447\n<f986>4453\n<f98d>4463\n<f98e>4160\n<f991>4161\n<f995>4162\n<f998>4474\n<f999>4473\n<f99e>6447\n<f9a1>5460\n<f9a2>4483\n<f9a3>4163\n<f9a4>4166\n<f9a5>4485\n<f9a9>4491\n<f9aa>4167\n<f9ae>7783\n<f9af>4497\n<f9b0>4499\n<f9b5>4506\n<f9b9>5797\n<f9bd>4180\n<f9be>4555\n<f9bf>5800\n<f9c4>4563\n<f9c5>7988\n<f9c6>6123\n<f9c7>4577\n<f9c8>4183\n<f9c9>4579\n<f9cc>4584\n<f9cd>4586\n<f9ce>4588\n<f9cf>4184\n<f9db>5552\n<f9dc>4603\n<f9dd>4614\n<f9de>4616\n<f9df>4618\n<f9e0>5950\n<f9e3>4187\n<f9e4>4625\n<f9e5>4627\n<f9e6>4629\n<f9ea>4636\n<f9ed>4638\n<f9f6>4650\n<f9fa>5351\n<f9fb>6494\n<f9fc>5731\n<f9fd>5771\n<f9fe>4191\n<f9ff>6484\n<fa00>6684\n<fa01>4279\n<fa02>7139\n<fa03>4247\n<fa04>4266\n<fa05>4340\n<fa06>7572\n<fa07>5088\n<fa08>7709\n<fa09>3558\n<fa0a>3644\n<fa0b>3815\n<ff3c>112\n<ff5e>113\n<ffe2>194\n<ffe3>357\n<ffe5>145\n<ffe6>323\nendcidchar\nbegincidrange\n<20><7e>1\n<b2><b3>843\n<0391><03a1>471\n<03a3><03a9>488\n<03b1><03c1>495\n<03c3><03c9>512\n<0410><0415>1020\n<0416><0435>1027\n<0436><044f>1060\n<2013><2014>109\n<2018><2019>114\n<201c><201d>116\n<2020><2021>245\n<2025><2026>105\n<2032><2033>139\n<2039><203a>8612\n<207a><207b>8239\n<207d><207e>8250\n<2081><2084>847\n<2153><2154>749\n<215b><215e>753\n<2160><2169>461\n<2170><2179>451\n<2190><2191>171\n<2193><2194>173\n<21c4><21c5>8896\n<2225><2226>8719\n<2227><2228>192\n<222b><222c>182\n<2264><2265>134\n<2266><2267>8724\n<226e><226f>8745\n<2270><2273>8481\n<2276><2277>8489\n<227a><227b>8475\n<2280><2281>8479\n<2282><2283>188\n<2286><2287>186\n<2295><2297>8727\n<22bb><22bc>8751\n<22ce><22cf>8477\n<22da><22db>8492\n<2460><246e>733\n<246f><2473>8791\n<2474><2482>827\n<2483><2487>9042\n<249c><24b5>801\n<24b6><24cf>8388\n<24d0><24e9>707\n<251e><251f>559\n<2521><2522>561\n<2526><2527>563\n<2529><252a>565\n<252d><252e>567\n<2531><2532>569\n<2535><2536>571\n<2539><253a>573\n<253d><253e>575\n<2540><2541>577\n<2543><254a>579\n<25a4><25a5>233\n<25d0><25d1>230\n<2660><2661>222\n<2669><266a>253\n<2776><277f>8673\n<278a><2793>8342\n<3000><3002>101\n<3008><3011>120\n<3014><3015>118\n<3016><3019>8219\n<301e><301f>9322\n<3041><3093>851\n<30a1><30f6>934\n<3131><3163>358\n<3165><318e>409\n<3200><321b>773\n<3260><327b>679\n<328a><328f>9301\n<3380><3384>627\n<3388><3389>612\n<338a><338c>646\n<338d><338f>608\n<3390><3394>638\n<3395><3397>587\n<3399><33a2>597\n<33a3><33a6>593\n<33a7><33a8>615\n<33a9><33ac>655\n<33ad><33af>651\n<33b0><33b9>617\n<33ba><33bf>632\n<33c0><33c1>644\n<5cef><5cf0>5096\n<5e7c><5e7d>6317\n<5fd8><5fd9>4698\n<6108><6109>6322\n<6158><6159>7085\n<6478><6479>4770\n<65fb><65fc>4875\n<6643><6644>7911\n<671e><671f>4083\n<67b6><67b7>3448\n<6961><6962>6329\n<6bd6><6bd8>5197\n<71b9><71ba>8049\n<7336><7337>6335\n<767d><767e>4993\n<78ba><78bb>7879\n<7947><7948>4104\n<7aa9><7aaa>6101\n<7d0a><7d0b>4842\n<8150><8151>5133\n<887e><887f>4047\n<88f4><88f5>4981\n<9451><9452>3527\n<9591><9592>7645\n<96a7><96a8>5620\n<96e8><96e9>6227\n<9a0e><9a0f>4122\n<ac00><ac01>1086\n<ac02><ac03>9333\n<ac05><ac06>9335\n<ac07><ac0a>1089\n<ac0b><ac0f>9337\n<ac10><ac17>1093\n<ac19><ac1d>1101\n<ac1e><ac1f>9343\n<ac21><ac23>9345\n<ac25><ac2b>9348\n<ac2c><ac2d>1108\n<ac2f><ac31>1110\n<ac32><ac37>9356\n<ac38><ac39>1113\n<ac3a><ac3b>9362\n<ac3d><ac3f>9364\n<ac41><ac4a>9367\n<ac4e><ac53>9378\n<ac55><ac57>9384\n<ac59><ac5b>9387\n<ac5d><ac6f>9390\n<ac70><ac71>1122\n<ac72><ac73>9409\n<ac75><ac76>9411\n<ac77><ac78>1125\n<ac7b><ac7f>9414\n<ac80><ac81>1128\n<ac83><ac86>1130\n<ac87><ac88>9420\n<ac89><ac8c>1134\n<ac8d><ac8f>9422\n<ac91><ac93>9425\n<ac95><ac9b>9428\n<ac9c><ac9d>1140\n<ac9f><aca1>1142\n<aca2><aca7>9436\n<aca8><acaa>1145\n<acad><acae>9443\n<acaf><acb0>1149\n<acb1><acb7>9445\n<acb8><acb9>1151\n<acbb><acbd>1153\n<acbe><acc0>9453\n<acc2><acc3>9456\n<acc5><acc7>9458\n<acc9><accb>9461\n<accd><acd4>9464\n<acd8><acdf>9473\n<ace0><ace1>1162\n<ace2><ace3>9481\n<ace5><ace6>9483\n<ace7><ace8>1165\n<aced><acee>9487\n<acef><acf1>1169\n<acf5><acf6>1173\n<acf7><acfb>9491\n<acfc><acfd>1175\n<acfe><acff>9496\n<ad01><ad03>9498\n<ad07><ad0b>9502\n<ad0c><ad0d>1180\n<ad12><ad17>9509\n<ad19><ad1b>9515\n<ad1d><ad1f>9518\n<ad21><ad28>9521\n<ad2a><ad2b>9529\n<ad2c><ad2d>1188\n<ad2e><ad33>9531\n<ad34><ad35>1190\n<ad36><ad37>9537\n<ad39><ad3b>9539\n<ad3d><ad43>9542\n<ad44><ad45>1194\n<ad4a><ad4f>9551\n<ad51><ad53>9557\n<ad55><ad57>9560\n<ad59><ad60>9563\n<ad64><ad6b>9572\n<ad6c><ad6d>1203\n<ad6e><ad6f>9580\n<ad71><ad72>9582\n<ad73><ad76>1206\n<ad77><ad7a>9584\n<ad7b><ad7d>1210\n<ad81><ad82>1214\n<ad83><ad87>9590\n<ad88><ad89>1216\n<ad8a><ad8b>9595\n<ad8d><ad8f>9597\n<ad91><ad9b>9600\n<ad9c><ad9d>1220\n<ad9e><ada3>9611\n<ada5><adb6>9617\n<adb8><adbf>9635\n<adc0><adc1>1224\n<adc2><adc3>9643\n<adc5><adc7>9645\n<adc9><adcf>9648\n<add0><add1>1228\n<add4><addb>9656\n<addd><addf>9664\n<ade1><ade3>9667\n<ade5><adf7>9670\n<adf8><adf9>1234\n<adfa><adfb>9689\n<adfd><adfe>9691\n<adff><ae01>1237\n<ae02><ae07>9693\n<ae08><ae09>1240\n<ae0e><ae13>9701\n<ae15><ae2f>9707\n<ae30><ae31>1245\n<ae32><ae33>9734\n<ae35><ae36>9736\n<ae37><ae38>1248\n<ae3b><ae3f>9739\n<ae40><ae41>1251\n<ae45><ae46>1254\n<ae47><ae49>9746\n<ae4c><ae4e>1257\n<ae51><ae53>9751\n<ae57><ae5b>9755\n<ae5c><ae5d>1263\n<ae5f><ae61>1265\n<ae62><ae64>9761\n<ae66><ae67>9764\n<ae68><ae69>1269\n<ae6a><ae6b>9766\n<ae6d><ae6f>9768\n<ae71><ae77>9771\n<ae78><ae79>1273\n<ae7b><ae7d>1275\n<ae7e><ae83>9779\n<ae84><ae85>1278\n<ae86><ae8b>9785\n<ae8d><aebb>9791\n<aebc><aebe>1281\n<aec1><aec3>9839\n<aec5><aecb>9842\n<aecc><aecd>1286\n<aecf><aed1>1288\n<aed2><aed7>9850\n<aed8><aed9>1291\n<aeda><aedb>9856\n<aedd><aee7>9858\n<aee9><aeea>9869\n<aeee><aef3>9872\n<aef5><aef7>9878\n<aef9><aefb>9881\n<aefd><af06>9884\n<af07><af08>1300\n<af09><af0c>9894\n<af0e><af0f>9898\n<af11><af2b>9900\n<af2c><af2d>1304\n<af2e><af2f>9927\n<af35><af3b>9931\n<af3c><af3d>1309\n<af41><af43>1312\n<af44><af47>9940\n<af48><af49>1315\n<af4a><af4f>9944\n<af51><af5b>9950\n<af5c><af5d>1318\n<af5e><af63>9961\n<af64><af65>1320\n<af66><af78>9967\n<af7a><af7f>9986\n<af81><af83>9992\n<af85><af87>9995\n<af89><af8f>9998\n<af90><af91>1326\n<af92><af94>10005\n<af96><af9b>10008\n<af9d><afb7>10014\n<afb8><afb9>1330\n<afba><afbb>10041\n<afbd><afbf>10043\n<afc1><afc6>10046\n<afc7><afc9>1334\n<afcd><afce>1338\n<afcf><afd3>10054\n<afd5><afdb>10059\n<afdd><afe7>10066\n<afe8><afe9>1342\n<afea><afef>10077\n<aff0><aff1>1344\n<aff2><aff3>10083\n<aff5><aff7>10085\n<aff9><afff>10088\n<b000><b001>1348\n<b002><b003>10095\n<b005><b00b>10097\n<b00d><b00f>10104\n<b011><b013>10107\n<b015><b01b>10110\n<b01c><b01d>1354\n<b01e><b027>10117\n<b029><b043>10127\n<b044><b045>1357\n<b046><b047>10154\n<b04f><b052>10159\n<b053><b055>1363\n<b05a><b05c>10165\n<b05e><b07b>10168\n<b07c><b07d>1369\n<b07e><b07f>10198\n<b081><b083>10200\n<b085><b08b>10203\n<b08c><b08d>1373\n<b092><b097>10212\n<b098><b09a>1377\n<b09d><b09e>10219\n<b09f><b0a2>1381\n<b0a3><b0a7>10221\n<b0a8><b0a9>1385\n<b0ab><b0af>1387\n<b0b3><b0b5>1393\n<b0b6><b0b7>10229\n<b0b9><b0bb>10231\n<b0bd><b0c3>10234\n<b0c4><b0c5>1398\n<b0c7><b0c9>1400\n<b0ca><b0cf>10242\n<b0d0><b0d1>1403\n<b0d2><b0d3>10248\n<b0d5><b0d7>10250\n<b0d9><b0df>10253\n<b0e1><b0e4>10260\n<b0e6><b107>10264\n<b108><b109>1409\n<b10b><b10c>1411\n<b10d><b10f>10299\n<b112><b113>1414\n<b114><b117>10303\n<b118><b119>1416\n<b11b><b11d>1418\n<b11e><b122>10308\n<b123><b125>1421\n<b126><b127>10313\n<b129><b12b>10315\n<b12d><b133>10318\n<b134><b135>1426\n<b137><b139>1428\n<b13a><b13f>10326\n<b140><b141>1431\n<b142><b143>10332\n<b145><b147>10334\n<b149><b14f>10337\n<b150><b151>1435\n<b152><b153>10344\n<b154><b155>1437\n<b156><b157>10346\n<b159><b15b>10348\n<b15d><b15f>10351\n<b161><b177>10354\n<b178><b179>1442\n<b17a><b17b>10377\n<b17d><b17f>10379\n<b183><b187>10383\n<b188><b189>1447\n<b18e><b191>10390\n<b192><b194>1451\n<b195><b197>10394\n<b199><b19b>10397\n<b19d><b1a7>10400\n<b1a9><b1cb>10411\n<b1cd><b1cf>10446\n<b1d1><b1d3>10449\n<b1d5><b1db>10452\n<b1dc><b1dd>1460\n<b1e0><b1e7>10460\n<b1e8><b1e9>1463\n<b1ea><b1eb>10468\n<b1ed><b1ef>10470\n<b1f1><b1f8>10473\n<b1fe><b203>10483\n<b204><b205>1470\n<b206><b207>10489\n<b209><b20a>10491\n<b20b><b20c>1473\n<b20d><b213>10493\n<b214><b215>1475\n<b21a><b21f>10502\n<b221><b233>10508\n<b235><b23b>10527\n<b23d><b257>10534\n<b259><b25b>10561\n<b25d><b25f>10564\n<b261><b267>10567\n<b268><b269>1485\n<b26a><b273>10574\n<b274><b275>1487\n<b276><b27b>10584\n<b27d><b283>10590\n<b284><b285>1490\n<b286><b288>10597\n<b28a><b28f>10600\n<b290><b291>1493\n<b292><b293>10606\n<b295><b297>10608\n<b298><b29a>1496\n<b29b><b29f>10611\n<b2a0><b2a1>1499\n<b2a5><b2a6>1502\n<b2a7><b2a9>10618\n<b2ad><b2af>10622\n<b2b1><b2b3>10625\n<b2b5><b2c7>10628\n<b2c8><b2c9>1508\n<b2ca><b2cb>10647\n<b2cd><b2cf>10649\n<b2d3><b2d7>10653\n<b2d8><b2d9>1513\n<b2de><b2e1>10660\n<b2e4><b2e6>1518\n<b2e9><b2ea>10666\n<b2eb><b2ef>1522\n<b2f0><b2f2>10668\n<b2f3><b2f5>1527\n<b2f7><b2fb>1530\n<b2fc><b2fe>10672\n<b2ff><b301>1535\n<b302><b303>10675\n<b305><b307>10677\n<b309><b30f>10680\n<b310><b311>1540\n<b313><b315>1542\n<b316><b31b>10688\n<b31d><b353>10694\n<b354><b356>1546\n<b359><b35a>10750\n<b35b><b35c>1550\n<b35e><b35f>1552\n<b360><b363>10753\n<b364><b365>1554\n<b36c><b36d>10760\n<b370><b371>1560\n<b372><b373>10763\n<b375><b377>10765\n<b379><b37f>10768\n<b380><b381>1564\n<b383><b385>1566\n<b386><b38b>10776\n<b38d><b38f>10782\n<b391><b393>10785\n<b395><b39f>10788\n<b3a0><b3a1>1572\n<b3a2><b3a7>10799\n<b3a9><b3ab>10805\n<b3ad><b3c3>10808\n<b3c4><b3c5>1576\n<b3c6><b3c7>10831\n<b3c9><b3ca>10833\n<b3cb><b3cc>1579\n<b3d1><b3d3>10837\n<b3d4><b3d5>1583\n<b3de><b3df>10844\n<b3e1><b3e3>10846\n<b3e5><b3e7>10849\n<b3e9><b3fb>10852\n<b3fd><b40f>10871\n<b411><b417>10890\n<b419><b41b>10897\n<b41d><b41f>10900\n<b421><b427>10903\n<b428><b429>1597\n<b42c><b433>10911\n<b435><b44f>10919\n<b450><b451>1601\n<b452><b453>10946\n<b455><b457>10948\n<b459><b45f>10951\n<b460><b461>1605\n<b466><b46b>10960\n<b46d><b47f>10966\n<b481><b487>10985\n<b489><b49c>10992\n<b49e><b4a3>11012\n<b4a5><b4a7>11018\n<b4a9><b4ab>11021\n<b4ad><b4b4>11024\n<b4ba><b4bf>11034\n<b4c1><b4c3>11040\n<b4c5><b4c7>11043\n<b4c9><b4cf>11046\n<b4d1><b4d4>11053\n<b4d6><b4db>11057\n<b4dc><b4dd>1624\n<b4de><b4df>11063\n<b4e1><b4e2>11065\n<b4e3><b4e4>1627\n<b4e7><b4eb>11068\n<b4ec><b4ed>1630\n<b4f2><b4f7>11075\n<b4f9><b513>11081\n<b514><b515>1635\n<b516><b517>11108\n<b519><b51a>11110\n<b51b><b51c>1638\n<b51d><b523>11112\n<b524><b525>1640\n<b527><b52a>1642\n<b52b><b52f>11120\n<b530><b531>1646\n<b532><b533>11125\n<b535><b537>11127\n<b539><b53f>11130\n<b540><b541>1650\n<b543><b545>1652\n<b546><b54a>11138\n<b54b><b54d>1655\n<b54e><b54f>11143\n<b551><b553>11145\n<b555><b55b>11148\n<b55c><b55d>1660\n<b55f><b561>1662\n<b562><b59f>11156\n<b5a0><b5a1>1665\n<b5a2><b5a3>11218\n<b5a5><b5a7>11220\n<b5aa><b5ab>1669\n<b5ac><b5af>11224\n<b5b0><b5b1>1671\n<b5b3><b5b5>1673\n<b5b6><b5ba>11229\n<b5bb><b5bd>1676\n<b5be><b5bf>11234\n<b5c1><b5c3>11236\n<b5c5><b5cb>11239\n<b5cc><b5cd>1681\n<b5cf><b5d1>1683\n<b5d2><b5d7>11247\n<b5d9><b5eb>11253\n<b5ed><b60f>11272\n<b610><b611>1688\n<b612><b613>11307\n<b615><b617>11309\n<b619><b624>11312\n<b626><b62b>11324\n<b62d><b633>11330\n<b635><b647>11337\n<b649><b663>11356\n<b665><b667>11383\n<b669><b69b>11386\n<b69c><b69d>1698\n<b69e><b69f>11437\n<b6a1><b6a3>11439\n<b6a5><b6aa>11442\n<b6ab><b6ac>1702\n<b6ad><b6b0>11448\n<b6b2><b6d3>11452\n<b6d5><b6ef>11486\n<b6f1><b6f3>11513\n<b6f5><b6f7>11516\n<b6f9><b6ff>11519\n<b700><b701>1709\n<b702><b704>11526\n<b706><b727>11529\n<b728><b729>1712\n<b72a><b72b>11563\n<b72d><b72e>11565\n<b72f><b730>1715\n<b731><b737>11567\n<b738><b739>1717\n<b73c><b743>11575\n<b745><b747>11583\n<b749><b74b>11586\n<b74d><b753>11589\n<b754><b755>1723\n<b756><b75f>11596\n<b761><b763>11606\n<b765><b767>11609\n<b769><b76f>11612\n<b770><b771>1728\n<b776><b77b>11621\n<b77c><b77d>1732\n<b77e><b77f>11627\n<b781><b783>11629\n<b785><b78b>11632\n<b78c><b78d>1736\n<b78f><b792>1738\n<b793><b795>11640\n<b796><b799>1742\n<b79a><b79b>11643\n<b79d><b79f>11645\n<b7a1><b7a7>11648\n<b7a8><b7a9>1748\n<b7ab><b7ad>1750\n<b7ae><b7b3>11656\n<b7b4><b7b5>1753\n<b7b6><b7b7>11662\n<b7b9><b7c6>11664\n<b7ca><b7eb>11679\n<b7ec><b7ed>1758\n<b7ee><b7ef>11713\n<b7f1><b7f3>11715\n<b7f5><b7fb>11718\n<b7fc><b7fd>1762\n<b7ff><b801>1764\n<b802><b806>11726\n<b807><b809>1767\n<b80a><b80b>11731\n<b80d><b80f>11733\n<b811><b817>11736\n<b818><b819>1772\n<b81e><b823>11745\n<b824><b825>1776\n<b826><b827>11751\n<b829><b82b>11753\n<b82d><b833>11756\n<b834><b835>1780\n<b837><b839>1782\n<b83a><b83f>11764\n<b841><b843>11770\n<b845><b850>11773\n<b854><b85b>11786\n<b85c><b85d>1789\n<b85e><b85f>11794\n<b861><b863>11796\n<b865><b86b>11799\n<b86c><b86d>1793\n<b872><b877>11808\n<b879><b87b>11814\n<b87d><b88c>11817\n<b88e><b8a7>11833\n<b8a9><b8af>11859\n<b8b1><b8b3>11866\n<b8b5><b8b7>11869\n<b8b9><b8bf>11872\n<b8c0><b8c1>1804\n<b8c6><b8cb>11881\n<b8cd><b8cf>11887\n<b8d1><b8d3>11890\n<b8d5><b8dc>11893\n<b8e2><b8e7>11903\n<b8e8><b8e9>1814\n<b8ea><b8eb>11909\n<b8ed><b8ef>11911\n<b8f1><b8f7>11914\n<b8f8><b8f9>1818\n<b8fe><b903>11923\n<b905><b917>11929\n<b919><b91f>11948\n<b921><b93b>11955\n<b93c><b93d>1825\n<b93e><b93f>11982\n<b941><b943>11984\n<b945><b94b>11987\n<b94d><b94e>11994\n<b952><b957>11997\n<b958><b959>1832\n<b95a><b95b>12003\n<b95d><b95f>12005\n<b961><b967>12008\n<b968><b969>1836\n<b96e><b973>12017\n<b974><b975>1840\n<b976><b977>12023\n<b979><b97b>12025\n<b97d><b983>12028\n<b984><b985>1844\n<b989><b98a>1847\n<b98b><b98c>12037\n<b98d><b98e>1849\n<b98f><b9ab>12039\n<b9ac><b9ad>1851\n<b9ae><b9af>12068\n<b9b1><b9b3>12070\n<b9b5><b9bb>12073\n<b9bc><b9bd>1855\n<b9c2><b9c7>12082\n<b9c8><b9c9>1859\n<b9ca><b9cb>12088\n<b9ce><b9d2>1862\n<b9d3><b9d7>12091\n<b9d8><b9d9>1867\n<b9dd><b9de>1870\n<b9df><b9e0>12098\n<b9e3><b9e5>1873\n<b9e6><b9e7>12101\n<b9e9><b9eb>12103\n<b9ed><b9f3>12106\n<b9f4><b9f5>1878\n<b9f7><b9fa>1880\n<b9fb><b9ff>12114\n<ba00><ba01>1884\n<ba02><ba07>12119\n<ba09><ba14>12125\n<ba16><ba37>12137\n<ba38><ba39>1888\n<ba3a><ba3b>12171\n<ba3d><ba3f>12173\n<ba43><ba47>12177\n<ba48><ba49>1893\n<ba4d><ba4e>1896\n<ba4f><ba52>12184\n<ba53><ba55>1898\n<ba56><ba57>12188\n<ba59><ba5b>12190\n<ba5d><ba63>12193\n<ba64><ba65>1903\n<ba67><ba69>1905\n<ba6a><ba6f>12201\n<ba70><ba71>1908\n<ba72><ba73>12207\n<ba75><ba77>12209\n<ba79><ba82>12212\n<ba83><ba85>1912\n<ba88><ba8b>12223\n<ba8d><baa7>12227\n<baa8><baa9>1917\n<baab><baac>1919\n<baad><baaf>12255\n<bab3><bab7>12259\n<bab8><bab9>1923\n<babe><bac3>12266\n<bac5><bac7>12272\n<bac9><bad7>12275\n<bad8><bad9>1929\n<bada><bafb>12290\n<bafd><baff>12324\n<bb01><bb03>12327\n<bb05><bb0c>12330\n<bb12><bb17>12340\n<bb19><bb1b>12346\n<bb1d><bb1f>12349\n<bb21><bb28>12352\n<bb2c><bb33>12361\n<bb34><bb36>1942\n<bb39><bb3a>12370\n<bb3b><bb3e>1946\n<bb3f><bb43>12372\n<bb44><bb45>1950\n<bb4a><bb4c>12379\n<bb4f><bb50>1955\n<bb51><bb53>12383\n<bb55><bb57>12386\n<bb59><bb60>12389\n<bb64><bb6b>12398\n<bb6d><bb87>12406\n<bb89><bb8b>12433\n<bb8d><bb8f>12436\n<bb91><bba3>12439\n<bba5><bba7>12458\n<bba9><bbab>12461\n<bbad><bbb3>12464\n<bbb5><bbb6>12471\n<bbb8><bbbf>12473\n<bbc1><bbc3>12481\n<bbc5><bbc7>12484\n<bbc9><bbcf>12487\n<bbd1><bbd2>12494\n<bbd4><bbf7>12496\n<bbf8><bbf9>1975\n<bbfa><bbfb>12532\n<bbfd><bbfe>12534\n<bbff><bc00>1978\n<bc03><bc07>12537\n<bc08><bc09>1981\n<bc0b><bc0d>1983\n<bc12><bc13>12545\n<bc14><bc18>1988\n<bc19><bc1a>12547\n<bc1b><bc1f>1993\n<bc20><bc23>12549\n<bc24><bc25>1998\n<bc2a><bc2c>12555\n<bc2e><bc2f>12558\n<bc30><bc31>2003\n<bc32><bc33>12560\n<bc35><bc37>12562\n<bc39><bc3f>12565\n<bc40><bc41>2007\n<bc43><bc45>2009\n<bc46><bc48>12573\n<bc4a><bc4b>12576\n<bc4c><bc4d>2013\n<bc4e><bc4f>12578\n<bc51><bc5c>12580\n<bc5e><bc83>12592\n<bc84><bc85>2017\n<bc86><bc87>12630\n<bc89><bc8a>12632\n<bc8b><bc8c>2020\n<bc8f><bc93>12635\n<bc94><bc95>2023\n<bc99><bc9a>2026\n<bc9b><bc9f>12642\n<bca0><bca1>2028\n<bca2><bca3>12647\n<bca5><bca6>12649\n<bca7><bca8>2031\n<bca9><bcaf>12651\n<bcb0><bcb1>2033\n<bcb3><bcb5>2035\n<bcb6><bcbb>12659\n<bcbc><bcbd>2038\n<bcbe><bcbf>12665\n<bcc1><bcc3>12667\n<bcc5><bccc>12670\n<bccf><bcd1>2043\n<bcd2><bcd4>12679\n<bcd6><bcd7>12682\n<bcd9><bcdb>12684\n<bcdd><bcf3>12687\n<bcf4><bcf6>2049\n<bcf9><bcfb>12711\n<bcfd><bd03>12714\n<bd04><bd05>2054\n<bd0a><bd0f>12723\n<bd11><bd13>12729\n<bd15><bd23>12732\n<bd25><bd2b>12747\n<bd2d><bd3f>12754\n<bd41><bd47>12773\n<bd48><bd49>2063\n<bd4a><bd4b>12780\n<bd4d><bd4f>12782\n<bd51><bd57>12785\n<bd58><bd59>2067\n<bd5a><bd63>12792\n<bd65><bd67>12802\n<bd69><bd7f>12805\n<bd80><bd81>2071\n<bd82><bd83>12828\n<bd85><bd86>12830\n<bd87><bd8a>2074\n<bd8b><bd8f>12832\n<bd90><bd91>2078\n<bd96><bd98>12839\n<bd99><bd9a>2082\n<bd9d><bda3>12843\n<bda5><bdaf>12850\n<bdb1><bdb7>12861\n<bdb9><bdd3>12868\n<bdd4><bdd5>2088\n<bdd6><bdd7>12895\n<bdd9><bddb>12897\n<bddd><bde8>12900\n<bdea><bdef>12912\n<bdf1><bdf3>12918\n<bdf5><bdf7>12921\n<bdf9><bdff>12924\n<be01><be02>12931\n<be06><be0b>12934\n<be0c><be0d>2099\n<be0e><be0f>12940\n<be11><be13>12942\n<be15><be1b>12945\n<be1c><be1d>2103\n<be20><be43>12953\n<be44><be45>2106\n<be46><be47>12989\n<be49><be4b>12991\n<be4f><be53>12995\n<be54><be55>2111\n<be59><be5b>2114\n<be5c><be5f>13002\n<be60><be61>2117\n<be62><be63>13006\n<be65><be67>13008\n<be6b><be6f>13012\n<be70><be71>2122\n<be73><be75>2124\n<be76><be7a>13018\n<be7b><be7d>2127\n<be7e><be7f>13023\n<be81><be83>13025\n<be85><be8b>13028\n<be8c><be8d>2132\n<be8f><be91>2134\n<be92><be97>13036\n<be98><be99>2137\n<be9a><bea7>13042\n<bea9><becf>13056\n<bed0><bed1>2140\n<bed2><bed3>13095\n<bed5><bed6>13097\n<bed7><bed8>2143\n<bed9><bedf>13099\n<bee1><bee2>13106\n<bee3><bee5>2146\n<bee6><beeb>13108\n<beed><bf00>13114\n<bf02><bf07>13134\n<bf08><bf09>2151\n<bf0a><bf17>13140\n<bf18><bf19>2153\n<bf1b><bf1d>2155\n<bf1e><bf3f>13155\n<bf40><bf41>2158\n<bf42><bf43>13189\n<bf45><bf47>13191\n<bf49><bf4f>13194\n<bf50><bf51>2162\n<bf52><bf54>13201\n<bf56><bf93>13204\n<bf95><bfaf>13266\n<bfb1><bfc4>13293\n<bfc6><bfcb>13313\n<bfcc><bfcd>2168\n<bfce><bfcf>13319\n<bfd1><bfd3>13321\n<bfd5><bfdb>13324\n<bfdd><bfde>13331\n<bfe2><c03b>13334\n<c03d><c050>13424\n<c052><c057>13444\n<c059><c05b>13450\n<c05d><c05f>13453\n<c061><c067>13456\n<c068><c069>2180\n<c06a><c08f>13463\n<c090><c091>2182\n<c092><c093>13501\n<c095><c097>13503\n<c099><c09f>13506\n<c0a0><c0a1>2186\n<c0a6><c0ab>13515\n<c0ac><c0ad>2190\n<c0af><c0b0>2192\n<c0b1><c0b2>13522\n<c0b3><c0b6>2194\n<c0b7><c0bb>13524\n<c0bc><c0bd>2198\n<c0bf><c0c1>2200\n<c0c2><c0c4>13530\n<c0c6><c0c7>13533\n<c0c8><c0c9>2204\n<c0ca><c0cb>13535\n<c0cd><c0cf>13537\n<c0d1><c0d7>13540\n<c0d8><c0d9>2208\n<c0db><c0dd>2210\n<c0de><c0e3>13548\n<c0e4><c0e5>2213\n<c0e6><c0e7>13554\n<c0e9><c0eb>13556\n<c0ed><c0f3>13559\n<c0f4><c0f5>2217\n<c0fa><c0ff>13568\n<c101><c103>13574\n<c105><c107>13577\n<c109><c10f>13580\n<c111><c114>13587\n<c116><c11b>13591\n<c11c><c120>2226\n<c121><c122>13597\n<c123><c124>2231\n<c126><c127>2233\n<c128><c12b>13600\n<c12c><c12d>2235\n<c12f><c131>2237\n<c132><c135>13605\n<c138><c139>2241\n<c13a><c13b>13610\n<c13d><c13f>13612\n<c141><c147>13615\n<c148><c149>2245\n<c14b><c14d>2247\n<c14e><c153>13623\n<c154><c155>2250\n<c156><c157>13629\n<c159><c15b>13631\n<c15d><c163>13634\n<c164><c165>2254\n<c167><c169>2256\n<c16a><c16f>13642\n<c171><c173>13648\n<c175><c177>13651\n<c179><c184>13654\n<c186><c18b>13666\n<c18c><c18e>2263\n<c191><c193>13673\n<c197><c19b>13677\n<c19c><c19d>2269\n<c1a2><c1a4>13684\n<c1a6><c1a7>13687\n<c1a8><c1a9>2274\n<c1aa><c1ab>13689\n<c1ad><c1af>13691\n<c1b1><c1bc>13694\n<c1be><c1c3>13706\n<c1c5><c1c7>13712\n<c1c9><c1cb>13715\n<c1cd><c1d3>13718\n<c1d5><c1d6>13725\n<c1d7><c1d8>2283\n<c1d9><c1df>13727\n<c1e1><c1e3>13734\n<c1e5><c1e7>13737\n<c1e9><c1ef>13740\n<c1f0><c1f1>2288\n<c1f4><c1fb>13748\n<c1fc><c1fd>2291\n<c1fe><c1ff>13756\n<c201><c203>13758\n<c205><c20b>13761\n<c20c><c20d>2295\n<c212><c217>13770\n<c218><c219>2299\n<c21a><c21b>13776\n<c21d><c21e>13778\n<c21f><c220>2302\n<c221><c227>13780\n<c228><c229>2304\n<c231><c232>2309\n<c235><c247>13792\n<c249><c24f>13811\n<c250><c251>2313\n<c252><c253>13818\n<c255><c257>13820\n<c259><c25f>13823\n<c261><c264>13830\n<c266><c26b>13834\n<c26c><c26d>2319\n<c26e><c26f>13840\n<c271><c273>13842\n<c275><c27b>13845\n<c27c><c27d>2323\n<c282><c287>13854\n<c288><c289>2327\n<c28a><c28f>13860\n<c291><c297>13866\n<c299><c29a>13873\n<c29e><c2a3>13876\n<c2a4><c2a5>2333\n<c2a6><c2a7>13882\n<c2a9><c2ab>13884\n<c2ac><c2ad>2336\n<c2ae><c2b3>13887\n<c2b4><c2b5>2338\n<c2ba><c2db>13895\n<c2dc><c2dd>2342\n<c2de><c2df>13929\n<c2e1><c2e2>13931\n<c2e3><c2e4>2345\n<c2e5><c2ea>13933\n<c2eb><c2ed>2347\n<c2f2><c2f5>13941\n<c2f8><c2f9>2353\n<c2fb><c2fc>2355\n<c2fd><c2ff>13947\n<c301><c307>13950\n<c308><c309>2358\n<c30a><c30b>13957\n<c30c><c30d>2360\n<c30e><c312>13959\n<c313><c315>2362\n<c316><c317>13964\n<c319><c31b>13966\n<c31d><c323>13969\n<c324><c325>2367\n<c326><c327>13976\n<c328><c329>2369\n<c32a><c344>13978\n<c346><c367>14005\n<c368><c369>2372\n<c36a><c36b>14039\n<c36d><c36f>14041\n<c373><c377>14045\n<c378><c379>2377\n<c37a><c37b>14050\n<c37c><c37d>2379\n<c37e><c383>14052\n<c385><c387>14058\n<c389><c38b>14061\n<c38d><c3bf>14064\n<c3c1><c3d7>14115\n<c3d8><c3d9>2385\n<c3da><c3db>14138\n<c3dd><c3de>14140\n<c3df><c3e0>2388\n<c3e3><c3e7>14143\n<c3e8><c3e9>2391\n<c3ea><c3ec>14148\n<c3ee><c3f3>14151\n<c3f4><c3f5>2394\n<c3f6><c3f7>14157\n<c3f9><c407>14159\n<c409><c40f>14174\n<c411><c423>14181\n<c425><c42b>14200\n<c42d><c42f>14207\n<c431><c433>14210\n<c435><c43b>14213\n<c43c><c43d>2403\n<c43e><c447>14220\n<c449><c463>14230\n<c464><c465>2406\n<c466><c467>14257\n<c469><c46b>14259\n<c46d><c473>14262\n<c474><c475>2410\n<c476><c478>14269\n<c47a><c47f>14272\n<c481><c493>14278\n<c495><c49b>14297\n<c49d><c4b7>14304\n<c4b9><c4bb>14331\n<c4bd><c4e8>14334\n<c4ea><c4ef>14378\n<c4f0><c4f1>2419\n<c4f2><c4f3>14384\n<c4f5><c4f7>14386\n<c4fb><c4fe>14390\n<c4ff><c501>2424\n<c502><c50b>14394\n<c50d><c50f>14404\n<c511><c513>14407\n<c515><c51b>14410\n<c51d><c527>14417\n<c528><c529>2431\n<c52a><c52b>14428\n<c52d><c52f>14430\n<c531><c537>14433\n<c538><c539>2435\n<c53e><c543>14442\n<c544><c545>2439\n<c546><c547>14448\n<c548><c54a>2441\n<c54c><c54e>2444\n<c54f><c552>14451\n<c553><c555>2447\n<c557><c559>2450\n<c55a><c55c>14456\n<c55d><c55e>2453\n<c560><c561>2455\n<c562><c563>14460\n<c565><c567>14462\n<c569><c56f>14465\n<c570><c571>2459\n<c573><c575>2461\n<c576><c57b>14473\n<c57c><c57d>2464\n<c57e><c57f>14479\n<c581><c583>14481\n<c585><c586>14484\n<c588><c58b>14486\n<c58c><c58d>2469\n<c592><c594>14492\n<c597><c598>2474\n<c599><c59b>14496\n<c59d><c59f>14499\n<c5a1><c5a8>14502\n<c5aa><c5b3>14510\n<c5b4><c5b5>2479\n<c5b6><c5b7>14520\n<c5b8><c5b9>2481\n<c5bb><c5be>2483\n<c5bf><c5c3>14523\n<c5c4><c5ca>2487\n<c5d0><c5d1>2496\n<c5d2><c5d3>14531\n<c5d5><c5d7>14533\n<c5d9><c5df>14536\n<c5e0><c5e1>2500\n<c5e6><c5eb>14545\n<c5ec><c5ee>2504\n<c5f1><c5f3>14552\n<c5f6><c5f7>2509\n<c5f8><c5fb>14556\n<c5fc><c601>2511\n<c602><c604>14560\n<c605><c608>2517\n<c609><c60b>14563\n<c60d><c60f>14566\n<c611><c617>14569\n<c618><c619>2523\n<c61b><c61c>2525\n<c61d><c623>14577\n<c624><c625>2527\n<c626><c627>14584\n<c629><c62b>14586\n<c62c><c62e>2530\n<c631><c632>14590\n<c633><c635>2534\n<c63c><c63f>14595\n<c640><c641>2540\n<c642><c643>14599\n<c645><c647>14601\n<c649><c64f>14604\n<c650><c651>2544\n<c653><c655>2546\n<c656><c65b>14612\n<c65c><c65d>2549\n<c65e><c65f>14618\n<c661><c66b>14620\n<c66d><c66e>14631\n<c672><c677>14634\n<c678><c679>2555\n<c67a><c67b>14640\n<c67d><c67f>14642\n<c681><c687>14645\n<c688><c689>2559\n<c68e><c693>14654\n<c694><c695>2563\n<c696><c697>14660\n<c699><c69b>14662\n<c69d><c6a3>14665\n<c6a4><c6a5>2567\n<c6aa><c6af>14674\n<c6b0><c6b1>2571\n<c6b2><c6b3>14680\n<c6b5><c6b7>14682\n<c6b8><c6ba>2574\n<c6bb><c6bf>14685\n<c6c0><c6c1>2577\n<c6c6><c6cb>14692\n<c6cc><c6cd>2581\n<c6ce><c6cf>14698\n<c6d1><c6d3>14700\n<c6d5><c6db>14703\n<c6dc><c6dd>2585\n<c6de><c6df>14710\n<c6e0><c6e1>2587\n<c6e2><c6e7>14712\n<c6e8><c6e9>2589\n<c6ea><c6eb>14718\n<c6ed><c6ef>14720\n<c6f1><c6f7>14723\n<c6f8><c6f9>2593\n<c6fa><c6fc>14730\n<c6fe><c703>14733\n<c704><c705>2596\n<c706><c707>14739\n<c709><c70b>14741\n<c70d><c713>14744\n<c714><c715>2600\n<c71a><c71f>14753\n<c720><c721>2604\n<c722><c723>14759\n<c725><c727>14761\n<c729><c72f>14764\n<c730><c731>2608\n<c738><c73b>14774\n<c73c><c73d>2613\n<c73e><c73f>14778\n<c741><c743>14780\n<c745><c749>14783\n<c74c><c74d>2618\n<c751><c758>2621\n<c759><c75b>14791\n<c75d><c75f>14794\n<c761><c767>14797\n<c769><c76a>14804\n<c76c><c773>14806\n<c774><c775>2633\n<c776><c777>14814\n<c779><c77b>14816\n<c77c><c77e>2636\n<c77f><c782>14819\n<c783><c785>2639\n<c787><c78a>2642\n<c78b><c78d>14824\n<c790><c791>2647\n<c792><c793>14828\n<c796><c798>2650\n<c79b><c79f>14832\n<c7a0><c7a1>2654\n<c7a3><c7a6>2656\n<c7a7><c7ab>14838\n<c7ac><c7ad>2660\n<c7ae><c7af>14843\n<c7b1><c7b3>14845\n<c7b5><c7bb>14848\n<c7bc><c7bd>2664\n<c7bf><c7c1>2666\n<c7c2><c7c7>14856\n<c7c8><c7c9>2669\n<c7ca><c7cb>14862\n<c7d1><c7d7>14866\n<c7d9><c7dc>14873\n<c7de><c7e3>14877\n<c7e5><c7e7>14883\n<c7e9><c7eb>14886\n<c7ed><c7ff>14889\n<c800><c801>2679\n<c802><c803>14908\n<c805><c807>14910\n<c80b><c80f>14914\n<c810><c811>2684\n<c815><c816>2687\n<c817><c81b>14921\n<c81c><c81d>2689\n<c81e><c81f>14926\n<c821><c823>14928\n<c825><c82b>14931\n<c82c><c82d>2693\n<c832><c837>14940\n<c839><c83b>14946\n<c83d><c83f>14949\n<c841><c847>14952\n<c848><c849>2700\n<c84a><c84b>14959\n<c84c><c84d>2702\n<c84e><c853>14961\n<c855><c86f>14967\n<c870><c871>2705\n<c872><c873>14994\n<c875><c877>14996\n<c87b><c87f>15000\n<c880><c881>2710\n<c885><c887>2713\n<c888><c88a>15007\n<c88b><c88d>2716\n<c88e><c893>15010\n<c895><c89c>15016\n<c8a2><c8a7>15026\n<c8a9><c8bb>15032\n<c8bc><c8bd>2724\n<c8be><c8c3>15051\n<c8c5><c8c7>15057\n<c8c9><c8cb>15060\n<c8cd><c8d3>15063\n<c8d4><c8d5>2729\n<c8da><c8df>15072\n<c8e0><c8e1>2733\n<c8e2><c8e3>15078\n<c8e5><c8f4>15080\n<c8f6><c8fb>15096\n<c8fc><c8fd>2737\n<c8fe><c8ff>15102\n<c901><c903>15104\n<c904><c906>2740\n<c907><c90b>15107\n<c90c><c90d>2743\n<c912><c917>15114\n<c919><c92b>15120\n<c92d><c933>15139\n<c935><c94f>15146\n<c950><c951>2750\n<c952><c953>15173\n<c955><c957>15175\n<c959><c95f>15178\n<c960><c961>2754\n<c964><c96b>15186\n<c96d><c96f>15194\n<c971><c973>15197\n<c975><c97b>15200\n<c97d><c987>15207\n<c988><c989>2761\n<c98a><c98b>15218\n<c98d><c98f>15220\n<c991><c997>15223\n<c998><c999>2765\n<c99e><c9bf>15232\n<c9c0><c9c1>2769\n<c9c2><c9c3>15266\n<c9c5><c9c6>15268\n<c9c7><c9c8>2772\n<c9cb><c9cf>15271\n<c9d0><c9d1>2775\n<c9d5><c9d6>2778\n<c9d7><c9d8>15278\n<c9d9><c9da>2780\n<c9dc><c9dd>2782\n<c9de><c9df>15281\n<c9e5><c9e6>15285\n<c9e8><c9eb>15287\n<c9ec><c9ed>2788\n<c9ef><c9f1>2790\n<c9f2><c9f7>15292\n<c9f8><c9f9>2793\n<c9fa><c9fb>15298\n<c9fd><c9ff>15300\n<ca01><ca07>15303\n<ca08><ca09>2797\n<ca0b><ca0d>2799\n<ca0e><ca13>15311\n<ca15><ca17>15317\n<ca19><ca28>15320\n<ca2a><ca4b>15336\n<ca4c><ca4d>2805\n<ca4e><ca4f>15370\n<ca51><ca53>15372\n<ca55><ca5b>15375\n<ca5c><ca5d>2809\n<ca5f><ca61>2811\n<ca62><ca67>15383\n<ca69><ca7c>15389\n<ca7e><ca83>15409\n<ca85><ca97>15415\n<ca99><cabb>15434\n<cabc><cabd>2818\n<cabe><cabf>15469\n<cac1><cac3>15471\n<cac5><cacb>15474\n<cacc><cacd>2822\n<cad4><cad7>15484\n<cad8><cad9>2827\n<cada><cadf>15488\n<cae1><caeb>15494\n<caed><caf3>15505\n<caf5><cb07>15512\n<cb09><cb0f>15531\n<cb11><cb13>15538\n<cb15><cb17>15541\n<cb19><cb1f>15544\n<cb20><cb21>2836\n<cb22><cb40>15551\n<cb42><cb47>15582\n<cb48><cb49>2839\n<cb4a><cb4b>15588\n<cb4d><cb4f>15590\n<cb51><cb57>15593\n<cb58><cb59>2843\n<cb5a><cb5c>15600\n<cb5e><cb63>15603\n<cb65><cb77>15609\n<cb78><cb79>2847\n<cb7a><cb9b>15628\n<cb9d><cbb7>15662\n<cbb9><cbd3>15689\n<cbd5><cbe3>15716\n<cbe5><cbe6>15731\n<cbea><cc0b>15734\n<cc0c><cc0d>2855\n<cc0e><cc0f>15768\n<cc11><cc13>15770\n<cc15><cc1b>15773\n<cc1c><cc1d>2859\n<cc1e><cc20>15780\n<cc21><cc22>2861\n<cc23><cc26>15783\n<cc27><cc29>2863\n<cc2a><cc2b>15787\n<cc31><cc37>15791\n<cc38><cc39>2869\n<cc3b><cc3e>2871\n<cc3f><cc43>15799\n<cc44><cc45>2875\n<cc46><cc47>15804\n<cc49><cc4b>15806\n<cc4d><cc53>15809\n<cc54><cc55>2879\n<cc57><cc59>2881\n<cc5a><cc5f>15817\n<cc61><cc63>15823\n<cc69><cc6f>15828\n<cc71><cc74>15835\n<cc76><cc97>15839\n<cc98><cc99>2890\n<cc9a><cc9b>15873\n<cc9d><cc9f>15875\n<cca1><cca7>15878\n<cca8><cca9>2894\n<ccab><ccad>2896\n<ccae><ccb3>15886\n<ccb4><ccb5>2899\n<ccb6><ccb7>15892\n<ccb9><ccbb>15894\n<ccbd><ccc3>15897\n<ccc4><ccc5>2903\n<ccca><cccf>15906\n<ccd1><ccd3>15912\n<ccd5><cce3>15915\n<cce5><cceb>15930\n<cced><ccef>15937\n<ccf1><cd00>15940\n<cd02><cd07>15956\n<cd08><cd09>2913\n<cd0a><cd0b>15962\n<cd0d><cd0f>15964\n<cd11><cd17>15967\n<cd18><cd19>2917\n<cd1e><cd23>15976\n<cd25><cd27>15982\n<cd29><cd2b>15985\n<cd2d><cd38>15988\n<cd3a><cd5b>16000\n<cd5d><cd5f>16034\n<cd61><cd63>16037\n<cd65><cd6b>16040\n<cd6c><cd6d>2928\n<cd72><cd77>16049\n<cd79><cd87>16055\n<cd89><cd93>16070\n<cd94><cd95>2934\n<cd96><cd97>16081\n<cd99><cd9b>16083\n<cd9d><cda3>16086\n<cda4><cda5>2938\n<cdaa><cdaf>16095\n<cdb1><cdc3>16101\n<cdc5><cdcb>16120\n<cdcd><cdcf>16127\n<cdd1><cde7>16130\n<cde9><cdeb>16153\n<cded><cdef>16156\n<cdf1><cdf7>16159\n<cdf8><cdf9>2949\n<cdfe><ce03>16168\n<ce05><ce07>16174\n<ce09><ce0b>16177\n<ce0d><ce13>16180\n<ce15><ce18>16187\n<ce1a><ce1f>16191\n<ce20><ce21>2958\n<ce22><ce23>16197\n<ce25><ce27>16199\n<ce29><ce2f>16202\n<ce30><ce31>2962\n<ce36><ce57>16211\n<ce58><ce59>2966\n<ce5a><ce5b>16245\n<ce5d><ce5e>16247\n<ce5f><ce61>2969\n<ce62><ce67>16249\n<ce68><ce69>2972\n<ce6e><ce73>16257\n<ce74><ce75>2976\n<ce76><ce77>16263\n<ce79><ce7b>16265\n<ce7d><ce83>16268\n<ce84><ce85>2980\n<ce8a><ce8f>16277\n<ce90><ce91>2984\n<ce92><ce93>16283\n<ce95><ce97>16285\n<ce99><ce9f>16288\n<cea0><cea1>2988\n<cea3><cea5>2990\n<cea6><ceab>16296\n<ceac><cead>2993\n<ceae><cec0>16302\n<cec2><cee3>16321\n<cee4><cee5>2996\n<cee6><cee7>16355\n<cee9><ceea>16357\n<ceeb><ceec>2999\n<ceed><cef3>16359\n<cef4><cef5>3001\n<cef7><cef9>3003\n<cefa><ceff>16367\n<cf00><cf01>3006\n<cf02><cf03>16373\n<cf05><cf07>16375\n<cf09><cf0f>16378\n<cf10><cf11>3010\n<cf16><cf1b>16387\n<cf1d><cf1f>16393\n<cf21><cf23>16396\n<cf25><cf2b>16399\n<cf2c><cf2d>3017\n<cf2f><cf31>3019\n<cf32><cf37>16407\n<cf39><cf53>16413\n<cf54><cf55>3023\n<cf56><cf57>16440\n<cf59><cf5b>16442\n<cf5d><cf63>16445\n<cf64><cf65>3027\n<cf6a><cf6f>16454\n<cf70><cf71>3031\n<cf72><cf73>16460\n<cf75><cf77>16462\n<cf79><cf7f>16465\n<cf81><cf84>16472\n<cf86><cf8b>16476\n<cf8d><cfa0>16482\n<cfa2><cfa7>16502\n<cfa9><cfaf>16508\n<cfb1><cfc3>16515\n<cfc5><cfdf>16534\n<cfe0><cfe1>3042\n<cfe2><cfe3>16561\n<cfe5><cfe7>16563\n<cfe9><cfef>16566\n<cff0><cff1>3046\n<cff6><cffb>16575\n<cffd><cfff>16581\n<d001><d003>16584\n<d005><d010>16587\n<d012><d017>16599\n<d019><d02c>16605\n<d02e><d033>16625\n<d034><d035>3056\n<d036><d037>16631\n<d039><d03b>16633\n<d03d><d043>16636\n<d044><d045>3060\n<d04a><d04f>16645\n<d051><d053>16651\n<d055><d057>16654\n<d059><d05f>16657\n<d061><d06b>16664\n<d06c><d06d>3068\n<d06e><d06f>16675\n<d071><d073>16677\n<d075><d07b>16680\n<d07c><d07d>3072\n<d07e><d080>16687\n<d082><d0a3>16690\n<d0a4><d0a5>3075\n<d0a6><d0a7>16724\n<d0a9><d0ab>16726\n<d0ad><d0b3>16729\n<d0b4><d0b5>3079\n<d0ba><d0bf>16738\n<d0c0><d0c1>3083\n<d0c2><d0c3>16744\n<d0c5><d0c7>16746\n<d0c8><d0c9>3086\n<d0ca><d0cf>16749\n<d0d0><d0d1>3088\n<d0d3><d0d5>3090\n<d0d6><d0db>16756\n<d0dc><d0dd>3093\n<d0de><d0df>16762\n<d0e1><d0e3>16764\n<d0e5><d0eb>16767\n<d0ec><d0ed>3097\n<d0ef><d0f1>3099\n<d0f2><d0f7>16775\n<d0f9><d10c>16781\n<d10e><d12f>16801\n<d130><d131>3104\n<d132><d133>16835\n<d135><d137>16837\n<d13b><d13f>16841\n<d140><d141>3109\n<d143><d145>3111\n<d146><d14b>16847\n<d14c><d14d>3114\n<d14e><d14f>16853\n<d151><d153>16855\n<d155><d15b>16858\n<d15c><d15d>3118\n<d162><d167>16867\n<d169><d16b>16873\n<d16d><d17b>16876\n<d17d><d183>16891\n<d185><d187>16898\n<d189><d19f>16901\n<d1a0><d1a1>3127\n<d1a2><d1a3>16924\n<d1a5><d1a7>16926\n<d1a9><d1af>16929\n<d1b0><d1b1>3131\n<d1b6><d1b9>16938\n<d1bd><d1bf>16943\n<d1c1><d1d7>16946\n<d1d9><d1f3>16969\n<d1f5><d1f7>16996\n<d1f9><d206>16999\n<d20a><d20f>17014\n<d211><d22b>17020\n<d22c><d22d>3144\n<d22e><d22f>17047\n<d231><d233>17049\n<d235><d23b>17052\n<d23c><d23d>3148\n<d242><d247>17061\n<d249><d25b>17067\n<d25d><d263>17086\n<d265><d27f>17093\n<d280><d281>3155\n<d282><d283>17120\n<d285><d287>17122\n<d289><d28f>17125\n<d290><d291>3159\n<d292><d294>17132\n<d296><d29b>17135\n<d29d><d29f>17141\n<d2a1><d2a3>17144\n<d2a5><d2ab>17147\n<d2ad><d2b0>17154\n<d2b2><d2b7>17158\n<d2b8><d2b9>3167\n<d2ba><d2bb>17164\n<d2bd><d2be>17166\n<d2bf><d2c0>3170\n<d2c3><d2c7>17169\n<d2c8><d2c9>3173\n<d2cc><d2d3>17175\n<d2d5><d2d7>17183\n<d2d9><d2db>17186\n<d2dd><d2e3>17189\n<d2e4><d2e5>3179\n<d2e6><d2ef>17196\n<d2f0><d2f1>3181\n<d2f2><d2f3>17206\n<d2f5><d2f7>17208\n<d2f9><d2ff>17211\n<d300><d301>3185\n<d306><d30b>17220\n<d30c><d30e>3189\n<d311><d313>17227\n<d317><d31b>17231\n<d31c><d31d>3195\n<d31f><d321>3197\n<d322><d324>17237\n<d326><d327>17240\n<d328><d329>3201\n<d32a><d32b>17242\n<d32d><d32f>17244\n<d331><d337>17247\n<d338><d339>3205\n<d33b><d33d>3207\n<d33e><d343>17255\n<d344><d345>3210\n<d346><d37b>17261\n<d37c><d37d>3212\n<d37e><d37f>17315\n<d381><d383>17317\n<d385><d38b>17320\n<d38c><d38d>3216\n<d38f><d391>3218\n<d392><d397>17328\n<d398><d399>3221\n<d39a><d39b>17334\n<d39d><d39f>17336\n<d3a1><d3a7>17339\n<d3a8><d3a9>3225\n<d3ae><d3b3>17348\n<d3b5><d3b7>17354\n<d3b9><d3bb>17357\n<d3bd><d3c3>17360\n<d3c4><d3c5>3232\n<d3c6><d3c7>17367\n<d3c8><d3c9>3234\n<d3ca><d3cf>17369\n<d3d1><d3d7>17375\n<d3d9><d3e0>17382\n<d3e4><d3eb>17391\n<d3ec><d3ed>3240\n<d3ee><d3ef>17399\n<d3f1><d3f3>17401\n<d3f5><d3fb>17404\n<d3fc><d3fd>3244\n<d402><d407>17413\n<d409><d41c>17419\n<d41e><d43f>17439\n<d441><d443>17473\n<d445><d45b>17476\n<d45d><d45f>17499\n<d461><d463>17502\n<d465><d46c>17505\n<d470><d477>17514\n<d478><d479>3257\n<d47a><d47b>17522\n<d47d><d47e>17524\n<d47f><d480>3260\n<d483><d487>17527\n<d488><d489>3263\n<d48e><d493>17534\n<d495><d4a8>17540\n<d4aa><d4cb>17560\n<d4cd><d4cf>17594\n<d4d1><d4d3>17597\n<d4d5><d4db>17600\n<d4dd><d4de>17607\n<d4e0><d4e7>17609\n<d4e9><d4eb>17617\n<d4ed><d4ef>17620\n<d4f1><d4f7>17623\n<d4f9><d4fa>17630\n<d4fe><d503>17633\n<d505><d507>17639\n<d509><d50b>17642\n<d50d><d513>17645\n<d514><d515>3283\n<d518><d53b>17653\n<d53c><d53d>3286\n<d53e><d53f>17689\n<d541><d543>17691\n<d545><d54b>17694\n<d54c><d54d>3290\n<d552><d557>17703\n<d558><d559>3294\n<d55a><d55b>17709\n<d55d><d55f>17711\n<d561><d564>17714\n<d566><d567>17718\n<d568><d569>3299\n<d56e><d573>17722\n<d574><d575>3303\n<d576><d577>17728\n<d579><d57b>17730\n<d57d><d583>17733\n<d584><d585>3307\n<d587><d589>3309\n<d58a><d58f>17741\n<d591><d5a4>17747\n<d5a6><d5c7>17767\n<d5c8><d5c9>3314\n<d5ca><d5cb>17801\n<d5cd><d5cf>17803\n<d5d3><d5d7>17807\n<d5d8><d5d9>3319\n<d5de><d5e3>17814\n<d5e4><d5e5>3323\n<d5e6><d5e7>17820\n<d5e9><d5eb>17822\n<d5ed><d5f3>17825\n<d5f4><d5f5>3327\n<d5fa><d5ff>17834\n<d600><d601>3331\n<d602><d603>17840\n<d605><d607>17842\n<d609><d60f>17845\n<d610><d611>3335\n<d613><d615>3337\n<d616><d61b>17853\n<d61d><d61f>17859\n<d621><d623>17862\n<d625><d62c>17865\n<d62e><d637>17873\n<d638><d639>3344\n<d63a><d63b>17883\n<d63d><d63f>17885\n<d641><d644>17888\n<d646><d647>17892\n<d648><d649>3349\n<d64e><d650>17896\n<d652><d653>17899\n<d654><d655>3354\n<d656><d657>17901\n<d659><d65b>17903\n<d65d><d666>17906\n<d66a><d66f>17917\n<d670><d671>3360\n<d672><d673>17923\n<d675><d682>17925\n<d686><d68b>17940\n<d68c><d68d>3365\n<d68e><d68f>17946\n<d691><d693>17948\n<d695><d69c>17951\n<d6a2><d6a7>17961\n<d6a9><d6ab>17967\n<d6ad><d6af>17970\n<d6b1><d6b8>17973\n<d6bc><d6c3>17982\n<d6c4><d6c5>3377\n<d6c6><d6c7>17990\n<d6c9><d6cb>17992\n<d6cd><d6d0>17995\n<d6d2><d6d3>17999\n<d6d5><d6d6>18001\n<d6da><d6df>18004\n<d6e1><d6e3>18010\n<d6e5><d6e7>18013\n<d6e9><d6ef>18016\n<d6f1><d6f4>18023\n<d6f6><d6fb>18027\n<d6fc><d6fd>3390\n<d6fe><d6ff>18033\n<d701><d703>18035\n<d705><d710>18038\n<d712><d717>18050\n<d718><d719>3395\n<d71a><d71b>18056\n<d71d><d71f>18058\n<d721><d727>18061\n<d728><d729>3399\n<d72e><d733>18070\n<d734><d735>3403\n<d736><d737>18076\n<d739><d73b>18078\n<d73d><d743>18081\n<d745><d746>18088\n<d74a><d74f>18091\n<d750><d751>3410\n<d752><d753>18097\n<d756><d759>3413\n<d75a><d75f>18100\n<d760><d761>3417\n<d766><d768>18108\n<d76a><d76b>18111\n<d76d><d76f>18113\n<d771><d773>18116\n<d775><d77b>18119\n<d77c><d77d>3425\n<d77e><d780>18126\n<d782><d787>18129\n<d788><d789>3428\n<d78a><d78b>18135\n<d78d><d78f>18137\n<d791><d797>18140\n<d798><d799>3432\n<d79e><d7a3>18149\n<f90d><f913>4375\n<f915><f917>4382\n<f918><f91d>4386\n<f91e><f920>4394\n<f923><f924>4406\n<f925><f92b>4409\n<f92c><f92d>4419\n<f930><f931>4513\n<f932><f937>4517\n<f938><f93a>4524\n<f93b><f940>4528\n<f941><f943>4535\n<f944><f945>4541\n<f946><f948>4545\n<f94b><f94e>4566\n<f94f><f950>4571\n<f952><f955>4604\n<f956><f959>4609\n<f975><f977>4425\n<f978><f97a>4429\n<f97b><f97d>4435\n<f97f><f980>4442\n<f984><f985>4449\n<f987><f98c>4455\n<f98f><f990>4465\n<f992><f994>4468\n<f996><f997>4471\n<f99a><f99b>4475\n<f99c><f99d>4478\n<f99f><f9a0>4481\n<f9a6><f9a8>4487\n<f9ab><f9ad>4493\n<f9b1><f9b4>4501\n<f9b6><f9b8>4508\n<f9ba><f9bc>4551\n<f9c0><f9c1>4556\n<f9c2><f9c3>4560\n<f9ca><f9cb>4581\n<f9d0><f9d3>4590\n<f9d4><f9d6>4595\n<f9d7><f9da>4599\n<f9e1><f9e2>4620\n<f9e7><f9e9>4632\n<f9eb><f9ec>4188\n<f9ee><f9f0>4640\n<f9f1><f9f5>4644\n<f9f7><f9f9>4653\n<ff01><ff3b>264\n<ff3d><ff5d>324\n<ffe0><ffe1>143\nendcidrange\nendcmap\n"
  },
  {
    "path": "mupdf/resources/fonts/droid/NOTICE",
    "content": "\n   Copyright (c) 2005-2008, The Android Open Source Project\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n\n\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n"
  },
  {
    "path": "mupdf/resources/fonts/urw/COPYING",
    "content": "                    GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  Developers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\n  A secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate.  Many developers of free software are heartened and\nencouraged by the resulting cooperation.  However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\n  The GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community.  It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server.  Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\n  An older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals.  This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU Affero General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Remote Network Interaction; Use with the GNU General Public License.\n\n  Notwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software.  This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time.  Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Affero General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Affero General Public License for more details.\n\n    You should have received a copy of the GNU Affero General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source.  For example, if your program is a web application, its\ninterface could display a \"Source\" link that leads users to an archive\nof the code.  There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n<http://www.gnu.org/licenses/>.\n"
  },
  {
    "path": "mupdf/resources/fonts/urw/LICENSE",
    "content": "The font and related files in this directory are distributed under the\nGNU AFFERO GENERAL PUBLIC LICENSE Version 3 (see the file COPYING), with\nthe following exemption:\n\nAs a special exception, permission is granted to include these font\nprograms in a Postscript or PDF file that consists of a document that\ncontains text to be displayed or printed using this font, regardless\nof the conditions or license applying to the document itself.\n\n"
  },
  {
    "path": "mupdf/scripts/archive.sh",
    "content": "#!/bin/bash\n\nREV=$(git describe --tags)\nO=mupdf-$REV-source\n\necho git archive $O.tar\ngit archive --format=tar --prefix=$O/ HEAD > $O.tar\n\ngit submodule | while read R P T\ndo\n\tM=$(basename $P)\n\techo git archive $O.$M.tar\n\tgit archive --format=tar --remote=$P --prefix=$O/$P/ HEAD > $O.$M.tar\n\ttar Af $O.tar $O.$M.tar\n\trm -f $O.$M.tar\ndone\n\necho gzip $O.tar\ngzip -f $O.tar\n"
  },
  {
    "path": "mupdf/scripts/bin2hex.c",
    "content": "/* bin2hex.c -- Turn the contents of a file into an array of unsigned chars */\n\n#include <stdio.h>\n#include <string.h>\n\n/* We never want to build memento versions of the cquote util */\n#undef MEMENTO\n\nstatic void\nclean(char *p)\n{\n\twhile (*p)\n\t{\n\t\tif ((*p == '/') || (*p == '.') || (*p == '\\\\') || (*p == '-'))\n\t\t\t*p = '_';\n\t\tp ++;\n\t}\n}\n\nint\nmain(int argc, char **argv)\n{\n\tFILE *fi, *fo;\n\tchar name[256];\n\tchar *realname;\n\tint i, j, c;\n\n\tif (argc < 3)\n\t{\n\t\tfprintf(stderr, \"usage: bin2hex output.h lots of text files\\n\");\n\t\treturn 1;\n\t}\n\n\tfo = fopen(argv[1], \"wb\");\n\tif (!fo)\n\t{\n\t\tfprintf(stderr, \"cquote: could not open output file '%s'\\n\", argv[1]);\n\t\treturn 1;\n\t}\n\n\tfprintf(fo, \"/* This is an automatically generated file. Do not edit. */\\n\");\n\n\tfor (i = 2; i < argc; i++)\n\t{\n\t\trealname = strrchr(argv[i], '/');\n\t\tif (!realname)\n\t\t\trealname = strrchr(argv[i], '\\\\');\n\t\tif (realname)\n\t\t\trealname ++;\n\t\telse\n\t\t\trealname = argv[i];\n\n\t\tif (strlen(realname) > (sizeof name - 1))\n\t\t{\n\t\t\tfprintf(stderr, \"bin2hex: file name too long\\n\");\n\t\t\tif (fclose(fo))\n\t\t\t{\n\t\t\t\tfprintf(stderr, \"bin2hex: could not close output file '%s'\\n\", argv[1]);\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 1;\n\t\t}\n\n\t\tstrcpy(name, realname);\n\t\tclean(name);\n\n\t\tfi = fopen(argv[i], \"rb\");\n\n\t\tj = 0;\n\t\twhile ((c = fgetc(fi)) != EOF)\n\t\t{\n\t\t\tif (j != 0)\n\t\t\t{\n\t\t\t\tfputc(',', fo);\n\t\t\t\tfputc(j%8 == 0 ? '\\n' : ' ', fo);\n\t\t\t}\n\n\t\t\tfprintf(fo, \"0x%02x\", c);\n\t\t\tj++;\n\t\t}\n\n\t\tfputc('\\n', fo);\n\n\t\tif (fclose(fi))\n\t\t{\n\t\t\tfprintf(stderr, \"bin2hex: could not close input file '%s'\\n\", argv[i]);\n\t\t\treturn 1;\n\t\t}\n\n\t}\n\n\tif (fclose(fo))\n\t{\n\t\tfprintf(stderr, \"bin2hex: could not close output file '%s'\\n\", argv[1]);\n\t\treturn 1;\n\t}\n\n\treturn 0;\n}\n"
  },
  {
    "path": "mupdf/scripts/cmapcleanx.c",
    "content": "/* cmapclean.c -- parse a CMap file and write it back out */\n\n#include <stdio.h>\n#include <string.h>\n\n/* We never want to build memento versions of the cmapdump util */\n#undef MEMENTO\n\n#include \"mupdf/pdf.h\"\n\n#include \"../source/fitz/context.c\"\n#include \"../source/fitz/error.c\"\n#include \"../source/fitz/memory.c\"\n#include \"../source/fitz/string.c\"\n#include \"../source/fitz/buffer.c\"\n#include \"../source/fitz/stream-open.c\"\n#include \"../source/fitz/stream-read.c\"\n#include \"../source/fitz/printf.c\"\n\n#include \"../source/pdf/pdf-lex.c\"\n#include \"../source/pdf/pdf-cmap.c\"\n#include \"../source/pdf/pdf-cmap-parse.c\"\n\nstruct cidrange {\n\tunsigned int lo, hi, v;\n};\n\nstatic int cmpcidrange(const void *va, const void *vb)\n{\n\tunsigned int a = ((const struct cidrange *)va)->lo;\n\tunsigned int b = ((const struct cidrange *)vb)->lo;\n\treturn a < b ? -1 : a > b ? 1 : 0;\n}\n\nstatic void pc(unsigned int c)\n{\n\tif (c <= 0xff) printf(\"<%02x>\", c);\n\telse if (c <= 0xffff) printf(\"<%04x>\", c);\n\telse if (c <= 0xffffff) printf(\"<%06x>\", c);\n\telse printf(\"<%010x>\", c);\n}\n\nint\nmain(int argc, char **argv)\n{\n\tfz_context *ctx;\n\tfz_stream *fi;\n\tpdf_cmap *cmap;\n\tint k, m, n, i;\n\tstruct cidrange *r;\n\n\tif (argc != 2)\n\t{\n\t\tfprintf(stderr, \"usage: cmapclean input.cmap\\n\");\n\t\treturn 1;\n\t}\n\n\tctx = fz_new_context(NULL, NULL, FZ_STORE_UNLIMITED);\n\tif (!ctx)\n\t{\n\t\tfprintf(stderr, \"cannot initialise context\\n\");\n\t\treturn 1;\n\t}\n\n\tfi = fz_open_file(ctx, argv[1]);\n\tcmap = pdf_load_cmap(ctx, fi);\n\tfz_close(fi);\n\n\tprintf(\"begincmap\\n\");\n\tprintf(\"/CMapName /%s def\\n\", cmap->cmap_name);\n\tprintf(\"/WMode %d def\\n\", cmap->wmode);\n\tif (cmap->usecmap_name[0])\n\t\tprintf(\"/%s usecmap\\n\", cmap->usecmap_name);\n\n\tif (cmap->codespace_len)\n\t{\n\t\tprintf(\"begincodespacerange\\n\");\n\t\tfor (k = 0; k < cmap->codespace_len; k++)\n\t\t{\n\t\t\tif (cmap->codespace[k].n == 1)\n\t\t\t\tprintf(\"<%02x> <%02x>\\n\", cmap->codespace[k].low, cmap->codespace[k].high);\n\t\t\telse if (cmap->codespace[k].n == 2)\n\t\t\t\tprintf(\"<%04x> <%04x>\\n\", cmap->codespace[k].low, cmap->codespace[k].high);\n\t\t\telse if (cmap->codespace[k].n == 3)\n\t\t\t\tprintf(\"<%06x> <%06x>\\n\", cmap->codespace[k].low, cmap->codespace[k].high);\n\t\t\telse if (cmap->codespace[k].n == 4)\n\t\t\t\tprintf(\"<%08x> <%08x>\\n\", cmap->codespace[k].low, cmap->codespace[k].high);\n\t\t\telse\n\t\t\t\tprintf(\"<%x> <%x>\\n\", cmap->codespace[k].low, cmap->codespace[k].high);\n\t\t}\n\t\tprintf(\"endcodespacerange\\n\");\n\t}\n\n\tn = cmap->rlen + cmap->xlen;\n\tr = malloc(n * sizeof *r);\n\ti = 0;\n\n\tfor (k = 0; k < cmap->rlen; k++) {\n\t\tr[i].lo = cmap->ranges[k].low;\n\t\tr[i].hi = cmap->ranges[k].high;\n\t\tr[i].v = cmap->ranges[k].out;\n\t\t++i;\n\t}\n\n\tfor (k = 0; k < cmap->xlen; k++) {\n\t\tr[i].lo = cmap->xranges[k].low;\n\t\tr[i].hi = cmap->xranges[k].high;\n\t\tr[i].v = cmap->xranges[k].out;\n\t\t++i;\n\t}\n\n\tqsort(r, n, sizeof *r, cmpcidrange);\n\n\tif (n)\n\t{\n\t\tprintf(\"begincidchar\\n\");\n\t\tfor (i = 0; i < n; ++i)\n\t\t{\n\t\t\tfor (k = r[i].lo, m = r[i].v; k <= r[i].hi; ++k, ++m)\n\t\t\t{\n\t\t\t\tpc(k);\n\t\t\t\tprintf(\"%u\\n\", m);\n\t\t\t}\n\t\t}\n\t\tprintf(\"endcidchar\\n\");\n\t}\n\n\tif (cmap->mlen > 0)\n\t{\n\t\tprintf(\"beginbfchar\\n\");\n\t\tfor (k = 0; k < cmap->mlen; k++)\n\t\t{\n\t\t\tpc(cmap->mranges[k].low);\n\n\t\t\tprintf(\"<\");\n\t\t\tfor (m = 0; m < cmap->mranges[k].len; ++m)\n\t\t\t\tprintf(\"%04x\", cmap->mranges[k].out[m]);\n\t\t\tprintf(\">\\n\");\n\t\t}\n\t\tprintf(\"endbfchar\\n\");\n\t}\n\n\tprintf(\"endcmap\\n\");\n\n\tfz_free_context(ctx);\n\treturn 0;\n}\n\nvoid fz_new_font_context(fz_context *ctx)\n{\n}\n\nvoid fz_drop_font_context(fz_context *ctx)\n{\n}\n\nfz_font_context *fz_keep_font_context(fz_context *ctx)\n{\n\treturn NULL;\n}\n\nvoid fz_new_colorspace_context(fz_context *ctx)\n{\n}\n\nvoid fz_drop_colorspace_context(fz_context *ctx)\n{\n}\n\nfz_colorspace_context *fz_keep_colorspace_context(fz_context *ctx)\n{\n\treturn NULL;\n}\n\nvoid fz_new_aa_context(fz_context *ctx)\n{\n}\n\nvoid fz_free_aa_context(fz_context *ctx)\n{\n}\n\nvoid fz_copy_aa_context(fz_context *dst, fz_context *src)\n{\n}\n\nvoid *fz_keep_storable(fz_context *ctx, fz_storable *s)\n{\n\treturn s;\n}\n\nvoid fz_drop_storable(fz_context *ctx, fz_storable *s)\n{\n}\n\nvoid fz_new_store_context(fz_context *ctx, unsigned int max)\n{\n}\n\nvoid fz_drop_store_context(fz_context *ctx)\n{\n}\n\nfz_store *fz_keep_store_context(fz_context *ctx)\n{\n\treturn NULL;\n}\n\nint fz_store_scavenge(fz_context *ctx, unsigned int size, int *phase)\n{\n\treturn 0;\n}\n\nvoid fz_new_glyph_cache_context(fz_context *ctx)\n{\n}\n\nvoid fz_drop_glyph_cache_context(fz_context *ctx)\n{\n}\n\nfz_glyph_cache *fz_keep_glyph_cache(fz_context *ctx)\n{\n\treturn NULL;\n}\n\nvoid fz_new_document_handler_context(fz_context *ctx)\n{\n}\n\nvoid fz_drop_document_handler_context(fz_context *ctx)\n{\n}\n\nfz_document_handler_context *fz_keep_document_handler_context(fz_context *ctx)\n{\n\treturn NULL;\n}\n"
  },
  {
    "path": "mupdf/scripts/cmapcleanz.c",
    "content": "/* cmapclean.c -- parse a CMap file and write it back out */\n\n#include <stdio.h>\n#include <string.h>\n\n/* We never want to build memento versions of the cmapdump util */\n#undef MEMENTO\n\n#include \"mupdf/pdf.h\"\n\n#include \"../source/fitz/context.c\"\n#include \"../source/fitz/error.c\"\n#include \"../source/fitz/memory.c\"\n#include \"../source/fitz/string.c\"\n#include \"../source/fitz/buffer.c\"\n#include \"../source/fitz/stream-open.c\"\n#include \"../source/fitz/stream-read.c\"\n#include \"../source/fitz/printf.c\"\n\n#include \"../source/pdf/pdf-lex.c\"\n#include \"../source/pdf/pdf-cmap.c\"\n#include \"../source/pdf/pdf-cmap-parse.c\"\n\nvoid pc(unsigned int c)\n{\n\tif (c <= 0xff) printf(\"<%02x>\", c);\n\telse if (c <= 0xffff) printf(\"<%04x>\", c);\n\telse if (c <= 0xffffff) printf(\"<%06x>\", c);\n\telse printf(\"<%08x>\", c);\n}\n\nint\nmain(int argc, char **argv)\n{\n\tfz_context *ctx;\n\tfz_stream *fi;\n\tpdf_cmap *cmap;\n\tint k, m;\n\tint ns, nr;\n\n\tif (argc != 2)\n\t{\n\t\tfprintf(stderr, \"usage: cmapclean input.cmap\\n\");\n\t\treturn 1;\n\t}\n\n\tctx = fz_new_context(NULL, NULL, FZ_STORE_UNLIMITED);\n\tif (!ctx)\n\t{\n\t\tfprintf(stderr, \"cannot initialise context\\n\");\n\t\treturn 1;\n\t}\n\n\tfi = fz_open_file(ctx, argv[1]);\n\tcmap = pdf_load_cmap(ctx, fi);\n\tfz_close(fi);\n\n\tprintf(\"begincmap\\n\");\n\tprintf(\"/CMapName /%s def\\n\", cmap->cmap_name);\n\tprintf(\"/WMode %d def\\n\", cmap->wmode);\n\tif (cmap->usecmap_name[0])\n\t\tprintf(\"/%s usecmap\\n\", cmap->usecmap_name);\n\n\tif (cmap->codespace_len)\n\t{\n\t\tprintf(\"begincodespacerange\\n\");\n\t\tfor (k = 0; k < cmap->codespace_len; k++)\n\t\t{\n\t\t\tif (cmap->codespace[k].n == 1)\n\t\t\t\tprintf(\"<%02x><%02x>\\n\", cmap->codespace[k].low, cmap->codespace[k].high);\n\t\t\telse if (cmap->codespace[k].n == 2)\n\t\t\t\tprintf(\"<%04x><%04x>\\n\", cmap->codespace[k].low, cmap->codespace[k].high);\n\t\t\telse if (cmap->codespace[k].n == 3)\n\t\t\t\tprintf(\"<%06x><%06x>\\n\", cmap->codespace[k].low, cmap->codespace[k].high);\n\t\t\telse if (cmap->codespace[k].n == 4)\n\t\t\t\tprintf(\"<%08x><%08x>\\n\", cmap->codespace[k].low, cmap->codespace[k].high);\n\t\t\telse\n\t\t\t\tprintf(\"<%x><%x>\\n\", cmap->codespace[k].low, cmap->codespace[k].high);\n\t\t}\n\t\tprintf(\"endcodespacerange\\n\");\n\t}\n\n\t/* 16-bit ranges */\n\n\tns = nr = 0;\n\tfor (k = 0; k < cmap->rlen; k++)\n\t\tif (cmap->ranges[k].high - cmap->ranges[k].low > 0)\n\t\t\t++nr;\n\t\telse\n\t\t\t++ns;\n\n\tif (ns)\n\t{\n\t\tprintf(\"begincidchar\\n\");\n\t\tfor (k = 0; k < cmap->rlen; k++) {\n\t\t\tif (cmap->ranges[k].high - cmap->ranges[k].low == 0) {\n\t\t\t\tpc(cmap->ranges[k].low);\n\t\t\t\tprintf(\"%u\\n\", cmap->ranges[k].out);\n\t\t\t}\n\t\t}\n\t\tprintf(\"endcidchar\\n\");\n\t}\n\n\tif (nr)\n\t{\n\t\tprintf(\"begincidrange\\n\");\n\t\tfor (k = 0; k < cmap->rlen; k++) {\n\t\t\tif (cmap->ranges[k].high - cmap->ranges[k].low > 0) {\n\t\t\t\tpc(cmap->ranges[k].low);\n\t\t\t\tpc(cmap->ranges[k].high);\n\t\t\t\tprintf(\"%u\\n\", cmap->ranges[k].out);\n\t\t\t}\n\t\t}\n\t\tprintf(\"endcidrange\\n\");\n\t}\n\n\t/* 32-bit ranges */\n\n\tns = nr = 0;\n\tfor (k = 0; k < cmap->xlen; k++)\n\t\tif (cmap->xranges[k].high - cmap->xranges[k].low > 0)\n\t\t\t++nr;\n\t\telse\n\t\t\t++ns;\n\n\tif (ns)\n\t{\n\t\tprintf(\"begincidchar\\n\");\n\t\tfor (k = 0; k < cmap->xlen; k++) {\n\t\t\tif (cmap->xranges[k].high - cmap->xranges[k].low == 0) {\n\t\t\t\tpc(cmap->xranges[k].low);\n\t\t\t\tprintf(\"%u\\n\", cmap->xranges[k].out);\n\t\t\t}\n\t\t}\n\t\tprintf(\"endcidchar\\n\");\n\t}\n\n\tif (nr)\n\t{\n\t\tprintf(\"begincidrange\\n\");\n\t\tfor (k = 0; k < cmap->xlen; k++) {\n\t\t\tif (cmap->xranges[k].high - cmap->xranges[k].low > 0) {\n\t\t\t\tpc(cmap->xranges[k].low);\n\t\t\t\tpc(cmap->xranges[k].high);\n\t\t\t\tprintf(\"%u\\n\", cmap->xranges[k].out);\n\t\t\t}\n\t\t}\n\t\tprintf(\"endcidrange\\n\");\n\t}\n\n\t/* 1-to-many */\n\n\tif (cmap->mlen > 0)\n\t{\n\t\tprintf(\"beginbfchar\\n\");\n\t\tfor (k = 0; k < cmap->mlen; k++)\n\t\t{\n\t\t\tpc(cmap->mranges[k].low);\n\t\t\tprintf(\"<\");\n\t\t\tfor (m = 0; m < cmap->mranges[k].len; ++m)\n\t\t\t\tprintf(\"%04x\", cmap->mranges[k].out[m]);\n\t\t\tprintf(\">\\n\");\n\t\t}\n\t\tprintf(\"endbfchar\\n\");\n\t}\n\n\tprintf(\"endcmap\\n\");\n\n\tfz_free_context(ctx);\n\treturn 0;\n}\n\nvoid fz_new_font_context(fz_context *ctx)\n{\n}\n\nvoid fz_drop_font_context(fz_context *ctx)\n{\n}\n\nfz_font_context *fz_keep_font_context(fz_context *ctx)\n{\n\treturn NULL;\n}\n\nvoid fz_new_colorspace_context(fz_context *ctx)\n{\n}\n\nvoid fz_drop_colorspace_context(fz_context *ctx)\n{\n}\n\nfz_colorspace_context *fz_keep_colorspace_context(fz_context *ctx)\n{\n\treturn NULL;\n}\n\nvoid fz_new_aa_context(fz_context *ctx)\n{\n}\n\nvoid fz_free_aa_context(fz_context *ctx)\n{\n}\n\nvoid fz_copy_aa_context(fz_context *dst, fz_context *src)\n{\n}\n\nvoid *fz_keep_storable(fz_context *ctx, fz_storable *s)\n{\n\treturn s;\n}\n\nvoid fz_drop_storable(fz_context *ctx, fz_storable *s)\n{\n}\n\nvoid fz_new_store_context(fz_context *ctx, unsigned int max)\n{\n}\n\nvoid fz_drop_store_context(fz_context *ctx)\n{\n}\n\nfz_store *fz_keep_store_context(fz_context *ctx)\n{\n\treturn NULL;\n}\n\nint fz_store_scavenge(fz_context *ctx, unsigned int size, int *phase)\n{\n\treturn 0;\n}\n\nvoid fz_new_glyph_cache_context(fz_context *ctx)\n{\n}\n\nvoid fz_drop_glyph_cache_context(fz_context *ctx)\n{\n}\n\nfz_glyph_cache *fz_keep_glyph_cache(fz_context *ctx)\n{\n\treturn NULL;\n}\n\nvoid fz_new_document_handler_context(fz_context *ctx)\n{\n}\n\nvoid fz_drop_document_handler_context(fz_context *ctx)\n{\n}\n\nfz_document_handler_context *fz_keep_document_handler_context(fz_context *ctx)\n{\n\treturn NULL;\n}\n"
  },
  {
    "path": "mupdf/scripts/cmapdump.c",
    "content": "/* cmapdump.c -- parse a CMap file and dump it as a c-struct */\n\n#include <stdio.h>\n#include <string.h>\n\n/* We never want to build memento versions of the cmapdump util */\n#undef MEMENTO\n\n#include \"mupdf/pdf.h\"\n\n#include \"../source/fitz/context.c\"\n#include \"../source/fitz/error.c\"\n#include \"../source/fitz/memory.c\"\n#include \"../source/fitz/string.c\"\n#include \"../source/fitz/buffer.c\"\n#include \"../source/fitz/stream-open.c\"\n#include \"../source/fitz/stream-read.c\"\n#include \"../source/fitz/strtod.c\"\n#include \"../source/fitz/ftoa.c\"\n#include \"../source/fitz/printf.c\"\n\n#include \"../source/pdf/pdf-lex.c\"\n#include \"../source/pdf/pdf-cmap.c\"\n#include \"../source/pdf/pdf-cmap-parse.c\"\n\nstatic void\nclean(char *p)\n{\n\twhile (*p)\n\t{\n\t\tif ((*p == '/') || (*p == '.') || (*p == '\\\\') || (*p == '-'))\n\t\t\t*p = '_';\n\t\tp ++;\n\t}\n}\n\nint\nmain(int argc, char **argv)\n{\n\tpdf_cmap *cmap;\n\tfz_stream *fi;\n\tFILE *fo;\n\tchar name[256];\n\tchar *realname;\n\tint i, k, m;\n\tfz_context *ctx;\n\n\tif (argc < 3)\n\t{\n\t\tfprintf(stderr, \"usage: cmapdump output.c lots of cmap files\\n\");\n\t\treturn 1;\n\t}\n\n\tctx = fz_new_context(NULL, NULL, FZ_STORE_UNLIMITED);\n\tif (!ctx)\n\t{\n\t\tfprintf(stderr, \"cannot initialise context\\n\");\n\t\treturn 1;\n\t}\n\n#undef fopen\n\tfo = fopen(argv[1], \"wb\");\n\tif (!fo)\n\t{\n\t\tfprintf(stderr, \"cmapdump: could not open output file '%s'\\n\", argv[1]);\n\t\treturn 1;\n\t}\n\n\tfprintf(fo, \"/* This is an automatically generated file. Do not edit. */\\n\");\n\n\tfor (i = 2; i < argc; i++)\n\t{\n\t\trealname = strrchr(argv[i], '/');\n\t\tif (!realname)\n\t\t\trealname = strrchr(argv[i], '\\\\');\n\t\tif (realname)\n\t\t\trealname ++;\n\t\telse\n\t\t\trealname = argv[i];\n\n\t\t/* ignore VCS folders (such as .svn) */\n\t\tif (*realname == '.')\n\t\t\tcontinue;\n\n\t\tif (strlen(realname) > (sizeof name - 1))\n\t\t{\n\t\t\tfprintf(stderr, \"cmapdump: file name too long\\n\");\n\t\t\tif (fclose(fo))\n\t\t\t{\n\t\t\t\tfprintf(stderr, \"cmapdump: could not close output file '%s'\\n\", argv[1]);\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 1;\n\t\t}\n\n\t\tstrcpy(name, realname);\n\t\tclean(name);\n\n\t\tfi = fz_open_file(ctx, argv[i]);\n\t\tcmap = pdf_load_cmap(ctx, fi);\n\t\tfz_close(fi);\n\n\t\tfprintf(fo, \"\\n/* %s */\\n\\n\", cmap->cmap_name);\n\n\t\tif (cmap->rlen)\n\t\t{\n\t\t\tfprintf(fo, \"static const pdf_range cmap_%s_ranges[] = {\", name);\n\t\t\tfor (k = 0; k < cmap->rlen; k++)\n\t\t\t{\n\t\t\t\tif (k % 4 == 0)\n\t\t\t\t\tfprintf(fo, \"\\n\");\n\t\t\t\tfprintf(fo, \"{%uu,%uu,%uu},\", cmap->ranges[k].low, cmap->ranges[k].high, cmap->ranges[k].out);\n\t\t\t}\n\t\t\tfprintf(fo, \"\\n};\\n\\n\");\n\t\t}\n\n\t\tif (cmap->xlen)\n\t\t{\n\t\t\tfprintf(fo, \"static const pdf_xrange cmap_%s_xranges[] = {\", name);\n\t\t\tfor (k = 0; k < cmap->xlen; k++)\n\t\t\t{\n\t\t\t\tif (k % 4 == 0)\n\t\t\t\t\tfprintf(fo, \"\\n\");\n\t\t\t\tfprintf(fo, \"{%uu,%uu,%uu},\", cmap->xranges[k].low, cmap->xranges[k].high, cmap->xranges[k].out);\n\t\t\t}\n\t\t\tfprintf(fo, \"\\n};\\n\\n\");\n\t\t}\n\n\t\tif (cmap->mlen > 0)\n\t\t{\n\t\t\tfprintf(fo, \"static const pdf_mrange cmap_%s_mranges[] = {\", name);\n\t\t\tfor (k = 0; k < cmap->mlen; k++)\n\t\t\t{\n\t\t\t\tfprintf(fo, \"\\n{%uu,%uu,{\", cmap->mranges[k].low, cmap->mranges[k].len);\n\t\t\t\tfor (m = 0; m < PDF_MRANGE_CAP; ++m)\n\t\t\t\t\tfprintf(fo, \"%uu,\", cmap->mranges[k].out[m]);\n\t\t\t\tfprintf(fo, \"}},\");\n\t\t\t}\n\t\t\tfprintf(fo, \"\\n};\\n\\n\");\n\t\t}\n\n\t\tfprintf(fo, \"static pdf_cmap cmap_%s = {\\n\", name);\n\t\tfprintf(fo, \"\\t{-1, pdf_free_cmap_imp}, \");\n\t\tfprintf(fo, \"\\\"%s\\\", \", cmap->cmap_name);\n\t\tfprintf(fo, \"\\\"%s\\\", 0, \", cmap->usecmap_name);\n\t\tfprintf(fo, \"%u, \", cmap->wmode);\n\t\tfprintf(fo, \"%u,\\n\\t{ \", cmap->codespace_len);\n\t\tif (cmap->codespace_len == 0)\n\t\t{\n\t\t\tfprintf(fo, \"{0,0,0},\");\n\t\t}\n\t\tfor (k = 0; k < cmap->codespace_len; k++)\n\t\t{\n\t\t\tfprintf(fo, \"{%u,%uu,%uu},\", cmap->codespace[k].n, cmap->codespace[k].low, cmap->codespace[k].high);\n\t\t}\n\t\tfprintf(fo, \" },\\n\");\n\n\t\tif (cmap->rlen)\n\t\t\tfprintf(fo, \"\\t%u, %u, (pdf_range*) cmap_%s_ranges,\\n\", cmap->rlen, cmap->rlen, name);\n\t\telse\n\t\t\tfprintf(fo, \"\\t0, 0, NULL,\\n\");\n\t\tif (cmap->xlen)\n\t\t\tfprintf(fo, \"\\t%u, %u, (pdf_xrange*) cmap_%s_xranges,\\n\", cmap->xlen, cmap->xlen, name);\n\t\telse\n\t\t\tfprintf(fo, \"\\t0, 0, NULL,\\n\");\n\t\tif (cmap->mlen)\n\t\t\tfprintf(fo, \"\\t%u, %u, (pdf_mrange*) cmap_%s_mranges,\\n\", cmap->mlen, cmap->mlen, name);\n\t\telse\n\t\t\tfprintf(fo, \"\\t0, 0, NULL,\\n\");\n\n\t\tfprintf(fo, \"};\\n\");\n\n\t\tif (getenv(\"verbose\"))\n\t\t\tprintf(\"\\t{\\\"%s\\\",&cmap_%s},\\n\", cmap->cmap_name, name);\n\t}\n\n\tif (fclose(fo))\n\t{\n\t\tfprintf(stderr, \"cmapdump: could not close output file '%s'\\n\", argv[1]);\n\t\treturn 1;\n\t}\n\n\tfz_free_context(ctx);\n\treturn 0;\n}\n\nvoid fz_new_font_context(fz_context *ctx)\n{\n}\n\nvoid fz_drop_font_context(fz_context *ctx)\n{\n}\n\nfz_font_context *fz_keep_font_context(fz_context *ctx)\n{\n\treturn NULL;\n}\n\nvoid fz_new_colorspace_context(fz_context *ctx)\n{\n}\n\nvoid fz_drop_colorspace_context(fz_context *ctx)\n{\n}\n\nfz_colorspace_context *fz_keep_colorspace_context(fz_context *ctx)\n{\n\treturn NULL;\n}\n\nvoid fz_new_aa_context(fz_context *ctx)\n{\n}\n\nvoid fz_free_aa_context(fz_context *ctx)\n{\n}\n\nvoid fz_copy_aa_context(fz_context *dst, fz_context *src)\n{\n}\n\nvoid *fz_keep_storable(fz_context *ctx, fz_storable *s)\n{\n\treturn s;\n}\n\nvoid fz_drop_storable(fz_context *ctx, fz_storable *s)\n{\n}\n\nvoid fz_new_store_context(fz_context *ctx, unsigned int max)\n{\n}\n\nvoid fz_drop_store_context(fz_context *ctx)\n{\n}\n\nfz_store *fz_keep_store_context(fz_context *ctx)\n{\n\treturn NULL;\n}\n\nint fz_store_scavenge(fz_context *ctx, unsigned int size, int *phase)\n{\n\treturn 0;\n}\n\nvoid fz_new_glyph_cache_context(fz_context *ctx)\n{\n}\n\nvoid fz_drop_glyph_cache_context(fz_context *ctx)\n{\n}\n\nfz_glyph_cache *fz_keep_glyph_cache(fz_context *ctx)\n{\n\treturn NULL;\n}\n\nvoid fz_new_document_handler_context(fz_context *ctx)\n{\n}\n\nvoid fz_drop_document_handler_context(fz_context *ctx)\n{\n}\n\nfz_document_handler_context *fz_keep_document_handler_context(fz_context *ctx)\n{\n\treturn NULL;\n}\n"
  },
  {
    "path": "mupdf/scripts/cquote.c",
    "content": "/* cquote.c -- Turn the contents of a file into a quoted string */\n\n#include <stdio.h>\n#include <string.h>\n\n/* We never want to build memento versions of the cquote util */\n#undef MEMENTO\n\nstatic void\nclean(char *p)\n{\n\twhile (*p)\n\t{\n\t\tif ((*p == '/') || (*p == '.') || (*p == '\\\\') || (*p == '-'))\n\t\t\t*p = '_';\n\t\tp ++;\n\t}\n}\n\nint\nmain(int argc, char **argv)\n{\n\tFILE *fi, *fo;\n\tchar name[256];\n\tchar *realname;\n\tint i, c;\n\tint bol = 1;\n\n\tif (argc < 3)\n\t{\n\t\tfprintf(stderr, \"usage: cquote output.c lots of text files\\n\");\n\t\treturn 1;\n\t}\n\n\tfo = fopen(argv[1], \"wb\");\n\tif (!fo)\n\t{\n\t\tfprintf(stderr, \"cquote: could not open output file '%s'\\n\", argv[1]);\n\t\treturn 1;\n\t}\n\n\tfprintf(fo, \"/* This is an automatically generated file. Do not edit. */\\n\");\n\n\tfor (i = 2; i < argc; i++)\n\t{\n\t\trealname = strrchr(argv[i], '/');\n\t\tif (!realname)\n\t\t\trealname = strrchr(argv[i], '\\\\');\n\t\tif (realname)\n\t\t\trealname ++;\n\t\telse\n\t\t\trealname = argv[i];\n\n\t\tif (strlen(realname) > (sizeof name - 1))\n\t\t{\n\t\t\tfprintf(stderr, \"cquote: file name too long\\n\");\n\t\t\tif (fclose(fo))\n\t\t\t{\n\t\t\t\tfprintf(stderr, \"cquote: could not close output file '%s'\\n\", argv[1]);\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 1;\n\t\t}\n\n\t\tstrcpy(name, realname);\n\t\tclean(name);\n\n\t\tfi = fopen(argv[i], \"rb\");\n\n\t\tfprintf(fo, \"\\n/* %s */\\n\\n\", name);\n\n\t\tc = fgetc(fi);\n\t\twhile (c != EOF)\n\t\t{\n\t\t\tint eol = 0;\n\n\t\t\tif (bol)\n\t\t\t{\n\t\t\t\tfputc('\\\"', fo);\n\t\t\t\tbol = 0;\n\t\t\t}\n\n\t\t\tswitch (c)\n\t\t\t{\n\t\t\t\tcase '\\\"':\n\t\t\t\t\tfprintf(fo, \"\\\\\\\"\");\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tfprintf(fo, \"\\\\\\\\\");\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '\\r':\n\t\t\t\tcase '\\n':\n\t\t\t\t\teol = 1;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tfputc(c, fo);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (eol)\n\t\t\t{\n\t\t\t\tfprintf(fo, \"\\\\n\\\"\\n\");\n\t\t\t\twhile ((c = fgetc(fi)) == '\\r' || c == '\\n')\n\t\t\t\t\t;\n\t\t\t\tbol = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tc = fgetc(fi);\n\t\t\t}\n\t\t}\n\n\t\tif (!bol)\n\t\t\tfprintf(fo, \"\\\\n\\\"\\n\");\n\n\t\tif (fclose(fi))\n\t\t{\n\t\t\tfprintf(stderr, \"cquote: could not close input file '%s'\\n\", argv[i]);\n\t\t\treturn 1;\n\t\t}\n\n\t}\n\n\tif (fclose(fo))\n\t{\n\t\tfprintf(stderr, \"cquote: could not close output file '%s'\\n\", argv[1]);\n\t\treturn 1;\n\t}\n\n\treturn 0;\n}\n"
  },
  {
    "path": "mupdf/scripts/fontdump.c",
    "content": "/* fontdump.c -- an \"xxd -i\" workalike for dumping binary fonts as source code */\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\nstatic int\nhexdump(FILE *fo, FILE *fi)\n{\n\tint c, n;\n\n\tn = 0;\n\tc = fgetc(fi);\n\twhile (c != -1)\n\t{\n\t\tn += fprintf(fo, \"%d,\", c);\n\t\tif (n > 72) {\n\t\t\tfprintf(fo, \"\\n\");\n\t\t\tn = 0;\n\t\t}\n\t\tc = fgetc(fi);\n\t}\n\n\treturn n;\n}\n\nint\nmain(int argc, char **argv)\n{\n\tFILE *fo;\n\tFILE *fi;\n\tchar fontname[256];\n\tchar origname[256];\n\tchar *basename;\n\tchar *p;\n\tint i, len;\n\n\tif (argc < 3)\n\t{\n\t\tfprintf(stderr, \"usage: fontdump output.c input.dat\\n\");\n\t\treturn 1;\n\t}\n\n\tfo = fopen(argv[1], \"wb\");\n\tif (!fo)\n\t{\n\t\tfprintf(stderr, \"fontdump: could not open output file '%s'\\n\", argv[1]);\n\t\treturn 1;\n\t}\n\n\tfprintf(fo, \"#ifndef __STRICT_ANSI__\\n\");\n\tfprintf(fo, \"#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)\\n\");\n\tfprintf(fo, \"#if !defined(__clang__) && !defined(__ICC)\\n\");\n\tfprintf(fo, \"#define HAVE_INCBIN\\n\");\n\tfprintf(fo, \"#endif\\n\");\n\tfprintf(fo, \"#endif\\n\");\n\tfprintf(fo, \"#endif\\n\");\n\n\tfor (i = 2; i < argc; i++)\n\t{\n\t\tfi = fopen(argv[i], \"rb\");\n\t\tif (!fi)\n\t\t{\n\t\t\tfclose(fo);\n\t\t\tfprintf(stderr, \"fontdump: could not open input file '%s'\\n\", argv[i]);\n\t\t\treturn 1;\n\t\t}\n\n\t\tbasename = strrchr(argv[i], '/');\n\t\tif (!basename)\n\t\t\tbasename = strrchr(argv[i], '\\\\');\n\t\tif (basename)\n\t\t\tbasename++;\n\t\telse\n\t\t\tbasename = argv[i];\n\n\t\tstrcpy(origname, basename);\n\t\tp = strrchr(origname, '.');\n\t\tif (p) *p = 0;\n\t\tstrcpy(fontname, origname);\n\n\t\tp = fontname;\n\t\twhile (*p)\n\t\t{\n\t\t\tif (*p == '/' || *p == '.' || *p == '\\\\' || *p == '-')\n\t\t\t\t*p = '_';\n\t\t\tp ++;\n\t\t}\n\n\t\tfseek(fi, 0, SEEK_END);\n\t\tlen = ftell(fi);\n\t\tfseek(fi, 0, SEEK_SET);\n\n\t\tif (getenv(\"verbose\"))\n\t\t\tprintf(\"\\t{\\\"%s\\\",pdf_font_%s,%d},\\n\", origname, fontname, len);\n\n\t\tfprintf(fo, \"\\n#ifdef HAVE_INCBIN\\n\");\n\t\tfprintf(fo, \"extern const unsigned char pdf_font_%s[%d];\\n\", fontname, len);\n\t\tfprintf(fo, \"asm(\\\".globl pdf_font_%s\\\");\\n\", fontname);\n\t\tfprintf(fo, \"asm(\\\".balign 8\\\");\\n\");\n\t\tfprintf(fo, \"asm(\\\"pdf_font_%s:\\\");\\n\", fontname);\n\t\tfprintf(fo, \"asm(\\\".incbin \\\\\\\"%s\\\\\\\"\\\");\\n\", argv[i]);\n\t\tfprintf(fo, \"#else\\n\");\n\t\tfprintf(fo, \"static const unsigned char pdf_font_%s[%d] = {\\n\", fontname, len);\n\t\thexdump(fo, fi);\n\t\tfprintf(fo, \"};\\n\");\n\t\tfprintf(fo, \"#endif\\n\");\n\n\t\tfclose(fi);\n\t}\n\n\tif (fclose(fo))\n\t{\n\t\tfprintf(stderr, \"fontdump: could not close output file '%s'\\n\", argv[1]);\n\t\treturn 1;\n\t}\n\n\treturn 0;\n}\n"
  },
  {
    "path": "mupdf/scripts/freetype/slimftmodules.h",
    "content": "/* custom ftmodule.h which selects the minimum features required by mupdf */\n\n// FT_USE_MODULE( FT_Module_Class, autofit_module_class )\nFT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class )\nFT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )\n// FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )\n// FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )\n// FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )\n// FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )\nFT_USE_MODULE( FT_Module_Class, psaux_module_class )\nFT_USE_MODULE( FT_Module_Class, psnames_module_class )\nFT_USE_MODULE( FT_Module_Class, pshinter_module_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )\nFT_USE_MODULE( FT_Module_Class, sfnt_module_class )\nFT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )\n// FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class )\n// FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class )\n// FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )\n"
  },
  {
    "path": "mupdf/scripts/freetype/slimftoptions.h",
    "content": "/* custom ftoption.h which selects the minimum features needed by mupdf */\n\n#include <freetype/config/ftoption.h>\n#undef FT_CONFIG_OPTION_USE_LZW\n#undef FT_CONFIG_OPTION_USE_ZLIB\n#undef FT_CONFIG_OPTION_MAC_FONTS\n#undef FT_CONFIG_OPTION_INCREMENTAL\n#undef TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n#undef TT_CONFIG_OPTION_GX_VAR_SUPPORT\n#undef TT_CONFIG_OPTION_BDF\n#undef T1_CONFIG_OPTION_NO_AFM\n#undef T1_CONFIG_OPTION_NO_MM_SUPPORT\n\n#undef FT_CONFIG_OPTION_OLD_INTERNALS\n"
  },
  {
    "path": "mupdf/scripts/gitsetup.sh",
    "content": "#!/bin/bash\n\n# Tell git to fix whitespace errors automatically\ngit config apply.whitespace fix\n\n# Set up useful aliases:\ngit config alias.wsfix \"! git diff HEAD >P.diff && git apply -R P.diff && git apply --whitespace=fix P.diff && rm P.diff\"\ngit config alias.wsfixi \"! git diff --cached >P.diff && git apply --cached -R P.diff && git apply --cached --whitespace=fix P.diff && rm P.diff\"\n\n# Copy hooks:\ncp scripts/githooks/* .git/hooks/\n"
  },
  {
    "path": "mupdf/scripts/glyphdump.py",
    "content": "#!/usr/bin/python\n\nimport sys\n\nagl = []\nagltab = []\naglmap = {}\n\nprint \"/*\"\n\nf = open(\"glyphlist.txt\", \"r\")\nfor line in f.readlines():\n\tif line[0] == '#':\n\t\tprint line.strip()\n\t\tcontinue\n\tline = line[:-1]\n\tname, list = line.split(';')\n\tlist = map(lambda x: int(x, 16), list.split(' '))\n\tagl.append((name, list))\n\nfor name, ucslist in agl:\n\tnum = len(ucslist)\n\tucs = ucslist[0]\n\tagltab.append((name, ucs))\n\tif ucs not in aglmap:\n\t\taglmap[ucs] = []\n\taglmap[ucs].append(name)\n\nprint \"*/\"\nprint\n\ndef dumplist(list):\n\tn = 0;\n\tfor item in list:\n\t\tn += len(item) + 1\n\t\tif n > 78:\n\t\t\tsys.stdout.write(\"\\n\")\n\t\t\tn = len(item) + 1\n\t\tsys.stdout.write(item)\n\t\tsys.stdout.write(\",\")\n\tsys.stdout.write(\"\\n\")\n\nagltab.sort()\nnamelist = []\ncodelist = []\nfor name, ucs in agltab:\n\tnamelist.append(\"\\\"%s\\\"\" % name)\n\tcodelist.append(\"%d\" % ucs)\n\nkeys = aglmap.keys()\nkeys.sort()\ndupoffsets = []\ndupnames = []\nfor ucs in keys:\n\tlist = aglmap[ucs]\n\tofs = len(dupnames)\n\tif len(list) > 1:\n\t\tdupoffsets.append(\"%d,%d\" % (ucs, ofs))\n\t\tfor name in list:\n\t\t\tdupnames.append(\"\\\"%s\\\"\" % name)\n\t\tdupnames.append(\"0\")\n\nprint \"static const char *agl_name_list[] = {\"\ndumplist(namelist)\nprint \"};\"\nprint\nprint \"static const unsigned short agl_code_list[] = {\"\ndumplist(codelist)\nprint \"};\"\nprint\nprint \"static const unsigned short agl_dup_offsets[] = {\"\ndumplist(dupoffsets)\nprint \"};\"\nprint\nprint \"static const char *agl_dup_names[] = {\"\ndumplist(dupnames)\nprint \"};\"\n"
  },
  {
    "path": "mupdf/scripts/glyphlist.txt",
    "content": "# Name: Adobe Glyph List\n# Table version: 2.0\n# Date: September 20, 2002\n#\n# See http://partners.adobe.com/asn/developer/typeforum/unicodegn.html\n#\n# Format: Semicolon-delimited fields:\n#\t(1) glyph name\n#\t(2) Unicode scalar value\nA;0041\nAE;00C6\nAEacute;01FC\nAEmacron;01E2\nAEsmall;F7E6\nAacute;00C1\nAacutesmall;F7E1\nAbreve;0102\nAbreveacute;1EAE\nAbrevecyrillic;04D0\nAbrevedotbelow;1EB6\nAbrevegrave;1EB0\nAbrevehookabove;1EB2\nAbrevetilde;1EB4\nAcaron;01CD\nAcircle;24B6\nAcircumflex;00C2\nAcircumflexacute;1EA4\nAcircumflexdotbelow;1EAC\nAcircumflexgrave;1EA6\nAcircumflexhookabove;1EA8\nAcircumflexsmall;F7E2\nAcircumflextilde;1EAA\nAcute;F6C9\nAcutesmall;F7B4\nAcyrillic;0410\nAdblgrave;0200\nAdieresis;00C4\nAdieresiscyrillic;04D2\nAdieresismacron;01DE\nAdieresissmall;F7E4\nAdotbelow;1EA0\nAdotmacron;01E0\nAgrave;00C0\nAgravesmall;F7E0\nAhookabove;1EA2\nAiecyrillic;04D4\nAinvertedbreve;0202\nAlpha;0391\nAlphatonos;0386\nAmacron;0100\nAmonospace;FF21\nAogonek;0104\nAring;00C5\nAringacute;01FA\nAringbelow;1E00\nAringsmall;F7E5\nAsmall;F761\nAtilde;00C3\nAtildesmall;F7E3\nAybarmenian;0531\nB;0042\nBcircle;24B7\nBdotaccent;1E02\nBdotbelow;1E04\nBecyrillic;0411\nBenarmenian;0532\nBeta;0392\nBhook;0181\nBlinebelow;1E06\nBmonospace;FF22\nBrevesmall;F6F4\nBsmall;F762\nBtopbar;0182\nC;0043\nCaarmenian;053E\nCacute;0106\nCaron;F6CA\nCaronsmall;F6F5\nCcaron;010C\nCcedilla;00C7\nCcedillaacute;1E08\nCcedillasmall;F7E7\nCcircle;24B8\nCcircumflex;0108\nCdot;010A\nCdotaccent;010A\nCedillasmall;F7B8\nChaarmenian;0549\nCheabkhasiancyrillic;04BC\nChecyrillic;0427\nChedescenderabkhasiancyrillic;04BE\nChedescendercyrillic;04B6\nChedieresiscyrillic;04F4\nCheharmenian;0543\nChekhakassiancyrillic;04CB\nCheverticalstrokecyrillic;04B8\nChi;03A7\nChook;0187\nCircumflexsmall;F6F6\nCmonospace;FF23\nCoarmenian;0551\nCsmall;F763\nD;0044\nDZ;01F1\nDZcaron;01C4\nDaarmenian;0534\nDafrican;0189\nDcaron;010E\nDcedilla;1E10\nDcircle;24B9\nDcircumflexbelow;1E12\nDcroat;0110\nDdotaccent;1E0A\nDdotbelow;1E0C\nDecyrillic;0414\nDeicoptic;03EE\nDelta;2206\nDeltagreek;0394\nDhook;018A\nDieresis;F6CB\nDieresisAcute;F6CC\nDieresisGrave;F6CD\nDieresissmall;F7A8\nDigammagreek;03DC\nDjecyrillic;0402\nDlinebelow;1E0E\nDmonospace;FF24\nDotaccentsmall;F6F7\nDslash;0110\nDsmall;F764\nDtopbar;018B\nDz;01F2\nDzcaron;01C5\nDzeabkhasiancyrillic;04E0\nDzecyrillic;0405\nDzhecyrillic;040F\nE;0045\nEacute;00C9\nEacutesmall;F7E9\nEbreve;0114\nEcaron;011A\nEcedillabreve;1E1C\nEcharmenian;0535\nEcircle;24BA\nEcircumflex;00CA\nEcircumflexacute;1EBE\nEcircumflexbelow;1E18\nEcircumflexdotbelow;1EC6\nEcircumflexgrave;1EC0\nEcircumflexhookabove;1EC2\nEcircumflexsmall;F7EA\nEcircumflextilde;1EC4\nEcyrillic;0404\nEdblgrave;0204\nEdieresis;00CB\nEdieresissmall;F7EB\nEdot;0116\nEdotaccent;0116\nEdotbelow;1EB8\nEfcyrillic;0424\nEgrave;00C8\nEgravesmall;F7E8\nEharmenian;0537\nEhookabove;1EBA\nEightroman;2167\nEinvertedbreve;0206\nEiotifiedcyrillic;0464\nElcyrillic;041B\nElevenroman;216A\nEmacron;0112\nEmacronacute;1E16\nEmacrongrave;1E14\nEmcyrillic;041C\nEmonospace;FF25\nEncyrillic;041D\nEndescendercyrillic;04A2\nEng;014A\nEnghecyrillic;04A4\nEnhookcyrillic;04C7\nEogonek;0118\nEopen;0190\nEpsilon;0395\nEpsilontonos;0388\nErcyrillic;0420\nEreversed;018E\nEreversedcyrillic;042D\nEscyrillic;0421\nEsdescendercyrillic;04AA\nEsh;01A9\nEsmall;F765\nEta;0397\nEtarmenian;0538\nEtatonos;0389\nEth;00D0\nEthsmall;F7F0\nEtilde;1EBC\nEtildebelow;1E1A\nEuro;20AC\nEzh;01B7\nEzhcaron;01EE\nEzhreversed;01B8\nF;0046\nFcircle;24BB\nFdotaccent;1E1E\nFeharmenian;0556\nFeicoptic;03E4\nFhook;0191\nFitacyrillic;0472\nFiveroman;2164\nFmonospace;FF26\nFourroman;2163\nFsmall;F766\nG;0047\nGBsquare;3387\nGacute;01F4\nGamma;0393\nGammaafrican;0194\nGangiacoptic;03EA\nGbreve;011E\nGcaron;01E6\nGcedilla;0122\nGcircle;24BC\nGcircumflex;011C\nGcommaaccent;0122\nGdot;0120\nGdotaccent;0120\nGecyrillic;0413\nGhadarmenian;0542\nGhemiddlehookcyrillic;0494\nGhestrokecyrillic;0492\nGheupturncyrillic;0490\nGhook;0193\nGimarmenian;0533\nGjecyrillic;0403\nGmacron;1E20\nGmonospace;FF27\nGrave;F6CE\nGravesmall;F760\nGsmall;F767\nGsmallhook;029B\nGstroke;01E4\nH;0048\nH18533;25CF\nH18543;25AA\nH18551;25AB\nH22073;25A1\nHPsquare;33CB\nHaabkhasiancyrillic;04A8\nHadescendercyrillic;04B2\nHardsigncyrillic;042A\nHbar;0126\nHbrevebelow;1E2A\nHcedilla;1E28\nHcircle;24BD\nHcircumflex;0124\nHdieresis;1E26\nHdotaccent;1E22\nHdotbelow;1E24\nHmonospace;FF28\nHoarmenian;0540\nHoricoptic;03E8\nHsmall;F768\nHungarumlaut;F6CF\nHungarumlautsmall;F6F8\nHzsquare;3390\nI;0049\nIAcyrillic;042F\nIJ;0132\nIUcyrillic;042E\nIacute;00CD\nIacutesmall;F7ED\nIbreve;012C\nIcaron;01CF\nIcircle;24BE\nIcircumflex;00CE\nIcircumflexsmall;F7EE\nIcyrillic;0406\nIdblgrave;0208\nIdieresis;00CF\nIdieresisacute;1E2E\nIdieresiscyrillic;04E4\nIdieresissmall;F7EF\nIdot;0130\nIdotaccent;0130\nIdotbelow;1ECA\nIebrevecyrillic;04D6\nIecyrillic;0415\nIfraktur;2111\nIgrave;00CC\nIgravesmall;F7EC\nIhookabove;1EC8\nIicyrillic;0418\nIinvertedbreve;020A\nIishortcyrillic;0419\nImacron;012A\nImacroncyrillic;04E2\nImonospace;FF29\nIniarmenian;053B\nIocyrillic;0401\nIogonek;012E\nIota;0399\nIotaafrican;0196\nIotadieresis;03AA\nIotatonos;038A\nIsmall;F769\nIstroke;0197\nItilde;0128\nItildebelow;1E2C\nIzhitsacyrillic;0474\nIzhitsadblgravecyrillic;0476\nJ;004A\nJaarmenian;0541\nJcircle;24BF\nJcircumflex;0134\nJecyrillic;0408\nJheharmenian;054B\nJmonospace;FF2A\nJsmall;F76A\nK;004B\nKBsquare;3385\nKKsquare;33CD\nKabashkircyrillic;04A0\nKacute;1E30\nKacyrillic;041A\nKadescendercyrillic;049A\nKahookcyrillic;04C3\nKappa;039A\nKastrokecyrillic;049E\nKaverticalstrokecyrillic;049C\nKcaron;01E8\nKcedilla;0136\nKcircle;24C0\nKcommaaccent;0136\nKdotbelow;1E32\nKeharmenian;0554\nKenarmenian;053F\nKhacyrillic;0425\nKheicoptic;03E6\nKhook;0198\nKjecyrillic;040C\nKlinebelow;1E34\nKmonospace;FF2B\nKoppacyrillic;0480\nKoppagreek;03DE\nKsicyrillic;046E\nKsmall;F76B\nL;004C\nLJ;01C7\nLL;F6BF\nLacute;0139\nLambda;039B\nLcaron;013D\nLcedilla;013B\nLcircle;24C1\nLcircumflexbelow;1E3C\nLcommaaccent;013B\nLdot;013F\nLdotaccent;013F\nLdotbelow;1E36\nLdotbelowmacron;1E38\nLiwnarmenian;053C\nLj;01C8\nLjecyrillic;0409\nLlinebelow;1E3A\nLmonospace;FF2C\nLslash;0141\nLslashsmall;F6F9\nLsmall;F76C\nM;004D\nMBsquare;3386\nMacron;F6D0\nMacronsmall;F7AF\nMacute;1E3E\nMcircle;24C2\nMdotaccent;1E40\nMdotbelow;1E42\nMenarmenian;0544\nMmonospace;FF2D\nMsmall;F76D\nMturned;019C\nMu;039C\nN;004E\nNJ;01CA\nNacute;0143\nNcaron;0147\nNcedilla;0145\nNcircle;24C3\nNcircumflexbelow;1E4A\nNcommaaccent;0145\nNdotaccent;1E44\nNdotbelow;1E46\nNhookleft;019D\nNineroman;2168\nNj;01CB\nNjecyrillic;040A\nNlinebelow;1E48\nNmonospace;FF2E\nNowarmenian;0546\nNsmall;F76E\nNtilde;00D1\nNtildesmall;F7F1\nNu;039D\nO;004F\nOE;0152\nOEsmall;F6FA\nOacute;00D3\nOacutesmall;F7F3\nObarredcyrillic;04E8\nObarreddieresiscyrillic;04EA\nObreve;014E\nOcaron;01D1\nOcenteredtilde;019F\nOcircle;24C4\nOcircumflex;00D4\nOcircumflexacute;1ED0\nOcircumflexdotbelow;1ED8\nOcircumflexgrave;1ED2\nOcircumflexhookabove;1ED4\nOcircumflexsmall;F7F4\nOcircumflextilde;1ED6\nOcyrillic;041E\nOdblacute;0150\nOdblgrave;020C\nOdieresis;00D6\nOdieresiscyrillic;04E6\nOdieresissmall;F7F6\nOdotbelow;1ECC\nOgoneksmall;F6FB\nOgrave;00D2\nOgravesmall;F7F2\nOharmenian;0555\nOhm;2126\nOhookabove;1ECE\nOhorn;01A0\nOhornacute;1EDA\nOhorndotbelow;1EE2\nOhorngrave;1EDC\nOhornhookabove;1EDE\nOhorntilde;1EE0\nOhungarumlaut;0150\nOi;01A2\nOinvertedbreve;020E\nOmacron;014C\nOmacronacute;1E52\nOmacrongrave;1E50\nOmega;2126\nOmegacyrillic;0460\nOmegagreek;03A9\nOmegaroundcyrillic;047A\nOmegatitlocyrillic;047C\nOmegatonos;038F\nOmicron;039F\nOmicrontonos;038C\nOmonospace;FF2F\nOneroman;2160\nOogonek;01EA\nOogonekmacron;01EC\nOopen;0186\nOslash;00D8\nOslashacute;01FE\nOslashsmall;F7F8\nOsmall;F76F\nOstrokeacute;01FE\nOtcyrillic;047E\nOtilde;00D5\nOtildeacute;1E4C\nOtildedieresis;1E4E\nOtildesmall;F7F5\nP;0050\nPacute;1E54\nPcircle;24C5\nPdotaccent;1E56\nPecyrillic;041F\nPeharmenian;054A\nPemiddlehookcyrillic;04A6\nPhi;03A6\nPhook;01A4\nPi;03A0\nPiwrarmenian;0553\nPmonospace;FF30\nPsi;03A8\nPsicyrillic;0470\nPsmall;F770\nQ;0051\nQcircle;24C6\nQmonospace;FF31\nQsmall;F771\nR;0052\nRaarmenian;054C\nRacute;0154\nRcaron;0158\nRcedilla;0156\nRcircle;24C7\nRcommaaccent;0156\nRdblgrave;0210\nRdotaccent;1E58\nRdotbelow;1E5A\nRdotbelowmacron;1E5C\nReharmenian;0550\nRfraktur;211C\nRho;03A1\nRingsmall;F6FC\nRinvertedbreve;0212\nRlinebelow;1E5E\nRmonospace;FF32\nRsmall;F772\nRsmallinverted;0281\nRsmallinvertedsuperior;02B6\nS;0053\nSF010000;250C\nSF020000;2514\nSF030000;2510\nSF040000;2518\nSF050000;253C\nSF060000;252C\nSF070000;2534\nSF080000;251C\nSF090000;2524\nSF100000;2500\nSF110000;2502\nSF190000;2561\nSF200000;2562\nSF210000;2556\nSF220000;2555\nSF230000;2563\nSF240000;2551\nSF250000;2557\nSF260000;255D\nSF270000;255C\nSF280000;255B\nSF360000;255E\nSF370000;255F\nSF380000;255A\nSF390000;2554\nSF400000;2569\nSF410000;2566\nSF420000;2560\nSF430000;2550\nSF440000;256C\nSF450000;2567\nSF460000;2568\nSF470000;2564\nSF480000;2565\nSF490000;2559\nSF500000;2558\nSF510000;2552\nSF520000;2553\nSF530000;256B\nSF540000;256A\nSacute;015A\nSacutedotaccent;1E64\nSampigreek;03E0\nScaron;0160\nScarondotaccent;1E66\nScaronsmall;F6FD\nScedilla;015E\nSchwa;018F\nSchwacyrillic;04D8\nSchwadieresiscyrillic;04DA\nScircle;24C8\nScircumflex;015C\nScommaaccent;0218\nSdotaccent;1E60\nSdotbelow;1E62\nSdotbelowdotaccent;1E68\nSeharmenian;054D\nSevenroman;2166\nShaarmenian;0547\nShacyrillic;0428\nShchacyrillic;0429\nSheicoptic;03E2\nShhacyrillic;04BA\nShimacoptic;03EC\nSigma;03A3\nSixroman;2165\nSmonospace;FF33\nSoftsigncyrillic;042C\nSsmall;F773\nStigmagreek;03DA\nT;0054\nTau;03A4\nTbar;0166\nTcaron;0164\nTcedilla;0162\nTcircle;24C9\nTcircumflexbelow;1E70\nTcommaaccent;0162\nTdotaccent;1E6A\nTdotbelow;1E6C\nTecyrillic;0422\nTedescendercyrillic;04AC\nTenroman;2169\nTetsecyrillic;04B4\nTheta;0398\nThook;01AC\nThorn;00DE\nThornsmall;F7FE\nThreeroman;2162\nTildesmall;F6FE\nTiwnarmenian;054F\nTlinebelow;1E6E\nTmonospace;FF34\nToarmenian;0539\nTonefive;01BC\nTonesix;0184\nTonetwo;01A7\nTretroflexhook;01AE\nTsecyrillic;0426\nTshecyrillic;040B\nTsmall;F774\nTwelveroman;216B\nTworoman;2161\nU;0055\nUacute;00DA\nUacutesmall;F7FA\nUbreve;016C\nUcaron;01D3\nUcircle;24CA\nUcircumflex;00DB\nUcircumflexbelow;1E76\nUcircumflexsmall;F7FB\nUcyrillic;0423\nUdblacute;0170\nUdblgrave;0214\nUdieresis;00DC\nUdieresisacute;01D7\nUdieresisbelow;1E72\nUdieresiscaron;01D9\nUdieresiscyrillic;04F0\nUdieresisgrave;01DB\nUdieresismacron;01D5\nUdieresissmall;F7FC\nUdotbelow;1EE4\nUgrave;00D9\nUgravesmall;F7F9\nUhookabove;1EE6\nUhorn;01AF\nUhornacute;1EE8\nUhorndotbelow;1EF0\nUhorngrave;1EEA\nUhornhookabove;1EEC\nUhorntilde;1EEE\nUhungarumlaut;0170\nUhungarumlautcyrillic;04F2\nUinvertedbreve;0216\nUkcyrillic;0478\nUmacron;016A\nUmacroncyrillic;04EE\nUmacrondieresis;1E7A\nUmonospace;FF35\nUogonek;0172\nUpsilon;03A5\nUpsilon1;03D2\nUpsilonacutehooksymbolgreek;03D3\nUpsilonafrican;01B1\nUpsilondieresis;03AB\nUpsilondieresishooksymbolgreek;03D4\nUpsilonhooksymbol;03D2\nUpsilontonos;038E\nUring;016E\nUshortcyrillic;040E\nUsmall;F775\nUstraightcyrillic;04AE\nUstraightstrokecyrillic;04B0\nUtilde;0168\nUtildeacute;1E78\nUtildebelow;1E74\nV;0056\nVcircle;24CB\nVdotbelow;1E7E\nVecyrillic;0412\nVewarmenian;054E\nVhook;01B2\nVmonospace;FF36\nVoarmenian;0548\nVsmall;F776\nVtilde;1E7C\nW;0057\nWacute;1E82\nWcircle;24CC\nWcircumflex;0174\nWdieresis;1E84\nWdotaccent;1E86\nWdotbelow;1E88\nWgrave;1E80\nWmonospace;FF37\nWsmall;F777\nX;0058\nXcircle;24CD\nXdieresis;1E8C\nXdotaccent;1E8A\nXeharmenian;053D\nXi;039E\nXmonospace;FF38\nXsmall;F778\nY;0059\nYacute;00DD\nYacutesmall;F7FD\nYatcyrillic;0462\nYcircle;24CE\nYcircumflex;0176\nYdieresis;0178\nYdieresissmall;F7FF\nYdotaccent;1E8E\nYdotbelow;1EF4\nYericyrillic;042B\nYerudieresiscyrillic;04F8\nYgrave;1EF2\nYhook;01B3\nYhookabove;1EF6\nYiarmenian;0545\nYicyrillic;0407\nYiwnarmenian;0552\nYmonospace;FF39\nYsmall;F779\nYtilde;1EF8\nYusbigcyrillic;046A\nYusbigiotifiedcyrillic;046C\nYuslittlecyrillic;0466\nYuslittleiotifiedcyrillic;0468\nZ;005A\nZaarmenian;0536\nZacute;0179\nZcaron;017D\nZcaronsmall;F6FF\nZcircle;24CF\nZcircumflex;1E90\nZdot;017B\nZdotaccent;017B\nZdotbelow;1E92\nZecyrillic;0417\nZedescendercyrillic;0498\nZedieresiscyrillic;04DE\nZeta;0396\nZhearmenian;053A\nZhebrevecyrillic;04C1\nZhecyrillic;0416\nZhedescendercyrillic;0496\nZhedieresiscyrillic;04DC\nZlinebelow;1E94\nZmonospace;FF3A\nZsmall;F77A\nZstroke;01B5\na;0061\naabengali;0986\naacute;00E1\naadeva;0906\naagujarati;0A86\naagurmukhi;0A06\naamatragurmukhi;0A3E\naarusquare;3303\naavowelsignbengali;09BE\naavowelsigndeva;093E\naavowelsigngujarati;0ABE\nabbreviationmarkarmenian;055F\nabbreviationsigndeva;0970\nabengali;0985\nabopomofo;311A\nabreve;0103\nabreveacute;1EAF\nabrevecyrillic;04D1\nabrevedotbelow;1EB7\nabrevegrave;1EB1\nabrevehookabove;1EB3\nabrevetilde;1EB5\nacaron;01CE\nacircle;24D0\nacircumflex;00E2\nacircumflexacute;1EA5\nacircumflexdotbelow;1EAD\nacircumflexgrave;1EA7\nacircumflexhookabove;1EA9\nacircumflextilde;1EAB\nacute;00B4\nacutebelowcmb;0317\nacutecmb;0301\nacutecomb;0301\nacutedeva;0954\nacutelowmod;02CF\nacutetonecmb;0341\nacyrillic;0430\nadblgrave;0201\naddakgurmukhi;0A71\nadeva;0905\nadieresis;00E4\nadieresiscyrillic;04D3\nadieresismacron;01DF\nadotbelow;1EA1\nadotmacron;01E1\nae;00E6\naeacute;01FD\naekorean;3150\naemacron;01E3\nafii00208;2015\nafii08941;20A4\nafii10017;0410\nafii10018;0411\nafii10019;0412\nafii10020;0413\nafii10021;0414\nafii10022;0415\nafii10023;0401\nafii10024;0416\nafii10025;0417\nafii10026;0418\nafii10027;0419\nafii10028;041A\nafii10029;041B\nafii10030;041C\nafii10031;041D\nafii10032;041E\nafii10033;041F\nafii10034;0420\nafii10035;0421\nafii10036;0422\nafii10037;0423\nafii10038;0424\nafii10039;0425\nafii10040;0426\nafii10041;0427\nafii10042;0428\nafii10043;0429\nafii10044;042A\nafii10045;042B\nafii10046;042C\nafii10047;042D\nafii10048;042E\nafii10049;042F\nafii10050;0490\nafii10051;0402\nafii10052;0403\nafii10053;0404\nafii10054;0405\nafii10055;0406\nafii10056;0407\nafii10057;0408\nafii10058;0409\nafii10059;040A\nafii10060;040B\nafii10061;040C\nafii10062;040E\nafii10063;F6C4\nafii10064;F6C5\nafii10065;0430\nafii10066;0431\nafii10067;0432\nafii10068;0433\nafii10069;0434\nafii10070;0435\nafii10071;0451\nafii10072;0436\nafii10073;0437\nafii10074;0438\nafii10075;0439\nafii10076;043A\nafii10077;043B\nafii10078;043C\nafii10079;043D\nafii10080;043E\nafii10081;043F\nafii10082;0440\nafii10083;0441\nafii10084;0442\nafii10085;0443\nafii10086;0444\nafii10087;0445\nafii10088;0446\nafii10089;0447\nafii10090;0448\nafii10091;0449\nafii10092;044A\nafii10093;044B\nafii10094;044C\nafii10095;044D\nafii10096;044E\nafii10097;044F\nafii10098;0491\nafii10099;0452\nafii10100;0453\nafii10101;0454\nafii10102;0455\nafii10103;0456\nafii10104;0457\nafii10105;0458\nafii10106;0459\nafii10107;045A\nafii10108;045B\nafii10109;045C\nafii10110;045E\nafii10145;040F\nafii10146;0462\nafii10147;0472\nafii10148;0474\nafii10192;F6C6\nafii10193;045F\nafii10194;0463\nafii10195;0473\nafii10196;0475\nafii10831;F6C7\nafii10832;F6C8\nafii10846;04D9\nafii299;200E\nafii300;200F\nafii301;200D\nafii57381;066A\nafii57388;060C\nafii57392;0660\nafii57393;0661\nafii57394;0662\nafii57395;0663\nafii57396;0664\nafii57397;0665\nafii57398;0666\nafii57399;0667\nafii57400;0668\nafii57401;0669\nafii57403;061B\nafii57407;061F\nafii57409;0621\nafii57410;0622\nafii57411;0623\nafii57412;0624\nafii57413;0625\nafii57414;0626\nafii57415;0627\nafii57416;0628\nafii57417;0629\nafii57418;062A\nafii57419;062B\nafii57420;062C\nafii57421;062D\nafii57422;062E\nafii57423;062F\nafii57424;0630\nafii57425;0631\nafii57426;0632\nafii57427;0633\nafii57428;0634\nafii57429;0635\nafii57430;0636\nafii57431;0637\nafii57432;0638\nafii57433;0639\nafii57434;063A\nafii57440;0640\nafii57441;0641\nafii57442;0642\nafii57443;0643\nafii57444;0644\nafii57445;0645\nafii57446;0646\nafii57448;0648\nafii57449;0649\nafii57450;064A\nafii57451;064B\nafii57452;064C\nafii57453;064D\nafii57454;064E\nafii57455;064F\nafii57456;0650\nafii57457;0651\nafii57458;0652\nafii57470;0647\nafii57505;06A4\nafii57506;067E\nafii57507;0686\nafii57508;0698\nafii57509;06AF\nafii57511;0679\nafii57512;0688\nafii57513;0691\nafii57514;06BA\nafii57519;06D2\nafii57534;06D5\nafii57636;20AA\nafii57645;05BE\nafii57658;05C3\nafii57664;05D0\nafii57665;05D1\nafii57666;05D2\nafii57667;05D3\nafii57668;05D4\nafii57669;05D5\nafii57670;05D6\nafii57671;05D7\nafii57672;05D8\nafii57673;05D9\nafii57674;05DA\nafii57675;05DB\nafii57676;05DC\nafii57677;05DD\nafii57678;05DE\nafii57679;05DF\nafii57680;05E0\nafii57681;05E1\nafii57682;05E2\nafii57683;05E3\nafii57684;05E4\nafii57685;05E5\nafii57686;05E6\nafii57687;05E7\nafii57688;05E8\nafii57689;05E9\nafii57690;05EA\nafii57694;FB2A\nafii57695;FB2B\nafii57700;FB4B\nafii57705;FB1F\nafii57716;05F0\nafii57717;05F1\nafii57718;05F2\nafii57723;FB35\nafii57793;05B4\nafii57794;05B5\nafii57795;05B6\nafii57796;05BB\nafii57797;05B8\nafii57798;05B7\nafii57799;05B0\nafii57800;05B2\nafii57801;05B1\nafii57802;05B3\nafii57803;05C2\nafii57804;05C1\nafii57806;05B9\nafii57807;05BC\nafii57839;05BD\nafii57841;05BF\nafii57842;05C0\nafii57929;02BC\nafii61248;2105\nafii61289;2113\nafii61352;2116\nafii61573;202C\nafii61574;202D\nafii61575;202E\nafii61664;200C\nafii63167;066D\nafii64937;02BD\nagrave;00E0\nagujarati;0A85\nagurmukhi;0A05\nahiragana;3042\nahookabove;1EA3\naibengali;0990\naibopomofo;311E\naideva;0910\naiecyrillic;04D5\naigujarati;0A90\naigurmukhi;0A10\naimatragurmukhi;0A48\nainarabic;0639\nainfinalarabic;FECA\naininitialarabic;FECB\nainmedialarabic;FECC\nainvertedbreve;0203\naivowelsignbengali;09C8\naivowelsigndeva;0948\naivowelsigngujarati;0AC8\nakatakana;30A2\nakatakanahalfwidth;FF71\nakorean;314F\nalef;05D0\nalefarabic;0627\nalefdageshhebrew;FB30\naleffinalarabic;FE8E\nalefhamzaabovearabic;0623\nalefhamzaabovefinalarabic;FE84\nalefhamzabelowarabic;0625\nalefhamzabelowfinalarabic;FE88\nalefhebrew;05D0\naleflamedhebrew;FB4F\nalefmaddaabovearabic;0622\nalefmaddaabovefinalarabic;FE82\nalefmaksuraarabic;0649\nalefmaksurafinalarabic;FEF0\nalefmaksurainitialarabic;FEF3\nalefmaksuramedialarabic;FEF4\nalefpatahhebrew;FB2E\nalefqamatshebrew;FB2F\naleph;2135\nallequal;224C\nalpha;03B1\nalphatonos;03AC\namacron;0101\namonospace;FF41\nampersand;0026\nampersandmonospace;FF06\nampersandsmall;F726\namsquare;33C2\nanbopomofo;3122\nangbopomofo;3124\nangkhankhuthai;0E5A\nangle;2220\nanglebracketleft;3008\nanglebracketleftvertical;FE3F\nanglebracketright;3009\nanglebracketrightvertical;FE40\nangleleft;2329\nangleright;232A\nangstrom;212B\nanoteleia;0387\nanudattadeva;0952\nanusvarabengali;0982\nanusvaradeva;0902\nanusvaragujarati;0A82\naogonek;0105\napaatosquare;3300\naparen;249C\napostrophearmenian;055A\napostrophemod;02BC\napple;F8FF\napproaches;2250\napproxequal;2248\napproxequalorimage;2252\napproximatelyequal;2245\naraeaekorean;318E\naraeakorean;318D\narc;2312\narighthalfring;1E9A\naring;00E5\naringacute;01FB\naringbelow;1E01\narrowboth;2194\narrowdashdown;21E3\narrowdashleft;21E0\narrowdashright;21E2\narrowdashup;21E1\narrowdblboth;21D4\narrowdbldown;21D3\narrowdblleft;21D0\narrowdblright;21D2\narrowdblup;21D1\narrowdown;2193\narrowdownleft;2199\narrowdownright;2198\narrowdownwhite;21E9\narrowheaddownmod;02C5\narrowheadleftmod;02C2\narrowheadrightmod;02C3\narrowheadupmod;02C4\narrowhorizex;F8E7\narrowleft;2190\narrowleftdbl;21D0\narrowleftdblstroke;21CD\narrowleftoverright;21C6\narrowleftwhite;21E6\narrowright;2192\narrowrightdblstroke;21CF\narrowrightheavy;279E\narrowrightoverleft;21C4\narrowrightwhite;21E8\narrowtableft;21E4\narrowtabright;21E5\narrowup;2191\narrowupdn;2195\narrowupdnbse;21A8\narrowupdownbase;21A8\narrowupleft;2196\narrowupleftofdown;21C5\narrowupright;2197\narrowupwhite;21E7\narrowvertex;F8E6\nasciicircum;005E\nasciicircummonospace;FF3E\nasciitilde;007E\nasciitildemonospace;FF5E\nascript;0251\nascriptturned;0252\nasmallhiragana;3041\nasmallkatakana;30A1\nasmallkatakanahalfwidth;FF67\nasterisk;002A\nasteriskaltonearabic;066D\nasteriskarabic;066D\nasteriskmath;2217\nasteriskmonospace;FF0A\nasterisksmall;FE61\nasterism;2042\nasuperior;F6E9\nasymptoticallyequal;2243\nat;0040\natilde;00E3\natmonospace;FF20\natsmall;FE6B\naturned;0250\naubengali;0994\naubopomofo;3120\naudeva;0914\naugujarati;0A94\naugurmukhi;0A14\naulengthmarkbengali;09D7\naumatragurmukhi;0A4C\nauvowelsignbengali;09CC\nauvowelsigndeva;094C\nauvowelsigngujarati;0ACC\navagrahadeva;093D\naybarmenian;0561\nayin;05E2\nayinaltonehebrew;FB20\nayinhebrew;05E2\nb;0062\nbabengali;09AC\nbackslash;005C\nbackslashmonospace;FF3C\nbadeva;092C\nbagujarati;0AAC\nbagurmukhi;0A2C\nbahiragana;3070\nbahtthai;0E3F\nbakatakana;30D0\nbar;007C\nbarmonospace;FF5C\nbbopomofo;3105\nbcircle;24D1\nbdotaccent;1E03\nbdotbelow;1E05\nbeamedsixteenthnotes;266C\nbecause;2235\nbecyrillic;0431\nbeharabic;0628\nbehfinalarabic;FE90\nbehinitialarabic;FE91\nbehiragana;3079\nbehmedialarabic;FE92\nbehmeeminitialarabic;FC9F\nbehmeemisolatedarabic;FC08\nbehnoonfinalarabic;FC6D\nbekatakana;30D9\nbenarmenian;0562\nbet;05D1\nbeta;03B2\nbetasymbolgreek;03D0\nbetdagesh;FB31\nbetdageshhebrew;FB31\nbethebrew;05D1\nbetrafehebrew;FB4C\nbhabengali;09AD\nbhadeva;092D\nbhagujarati;0AAD\nbhagurmukhi;0A2D\nbhook;0253\nbihiragana;3073\nbikatakana;30D3\nbilabialclick;0298\nbindigurmukhi;0A02\nbirusquare;3331\nblackcircle;25CF\nblackdiamond;25C6\nblackdownpointingtriangle;25BC\nblackleftpointingpointer;25C4\nblackleftpointingtriangle;25C0\nblacklenticularbracketleft;3010\nblacklenticularbracketleftvertical;FE3B\nblacklenticularbracketright;3011\nblacklenticularbracketrightvertical;FE3C\nblacklowerlefttriangle;25E3\nblacklowerrighttriangle;25E2\nblackrectangle;25AC\nblackrightpointingpointer;25BA\nblackrightpointingtriangle;25B6\nblacksmallsquare;25AA\nblacksmilingface;263B\nblacksquare;25A0\nblackstar;2605\nblackupperlefttriangle;25E4\nblackupperrighttriangle;25E5\nblackuppointingsmalltriangle;25B4\nblackuppointingtriangle;25B2\nblank;2423\nblinebelow;1E07\nblock;2588\nbmonospace;FF42\nbobaimaithai;0E1A\nbohiragana;307C\nbokatakana;30DC\nbparen;249D\nbqsquare;33C3\nbraceex;F8F4\nbraceleft;007B\nbraceleftbt;F8F3\nbraceleftmid;F8F2\nbraceleftmonospace;FF5B\nbraceleftsmall;FE5B\nbracelefttp;F8F1\nbraceleftvertical;FE37\nbraceright;007D\nbracerightbt;F8FE\nbracerightmid;F8FD\nbracerightmonospace;FF5D\nbracerightsmall;FE5C\nbracerighttp;F8FC\nbracerightvertical;FE38\nbracketleft;005B\nbracketleftbt;F8F0\nbracketleftex;F8EF\nbracketleftmonospace;FF3B\nbracketlefttp;F8EE\nbracketright;005D\nbracketrightbt;F8FB\nbracketrightex;F8FA\nbracketrightmonospace;FF3D\nbracketrighttp;F8F9\nbreve;02D8\nbrevebelowcmb;032E\nbrevecmb;0306\nbreveinvertedbelowcmb;032F\nbreveinvertedcmb;0311\nbreveinverteddoublecmb;0361\nbridgebelowcmb;032A\nbridgeinvertedbelowcmb;033A\nbrokenbar;00A6\nbstroke;0180\nbsuperior;F6EA\nbtopbar;0183\nbuhiragana;3076\nbukatakana;30D6\nbullet;2022\nbulletinverse;25D8\nbulletoperator;2219\nbullseye;25CE\nc;0063\ncaarmenian;056E\ncabengali;099A\ncacute;0107\ncadeva;091A\ncagujarati;0A9A\ncagurmukhi;0A1A\ncalsquare;3388\ncandrabindubengali;0981\ncandrabinducmb;0310\ncandrabindudeva;0901\ncandrabindugujarati;0A81\ncapslock;21EA\ncareof;2105\ncaron;02C7\ncaronbelowcmb;032C\ncaroncmb;030C\ncarriagereturn;21B5\ncbopomofo;3118\nccaron;010D\nccedilla;00E7\nccedillaacute;1E09\nccircle;24D2\nccircumflex;0109\nccurl;0255\ncdot;010B\ncdotaccent;010B\ncdsquare;33C5\ncedilla;00B8\ncedillacmb;0327\ncent;00A2\ncentigrade;2103\ncentinferior;F6DF\ncentmonospace;FFE0\ncentoldstyle;F7A2\ncentsuperior;F6E0\nchaarmenian;0579\nchabengali;099B\nchadeva;091B\nchagujarati;0A9B\nchagurmukhi;0A1B\nchbopomofo;3114\ncheabkhasiancyrillic;04BD\ncheckmark;2713\nchecyrillic;0447\nchedescenderabkhasiancyrillic;04BF\nchedescendercyrillic;04B7\nchedieresiscyrillic;04F5\ncheharmenian;0573\nchekhakassiancyrillic;04CC\ncheverticalstrokecyrillic;04B9\nchi;03C7\nchieuchacirclekorean;3277\nchieuchaparenkorean;3217\nchieuchcirclekorean;3269\nchieuchkorean;314A\nchieuchparenkorean;3209\nchochangthai;0E0A\nchochanthai;0E08\nchochingthai;0E09\nchochoethai;0E0C\nchook;0188\ncieucacirclekorean;3276\ncieucaparenkorean;3216\ncieuccirclekorean;3268\ncieuckorean;3148\ncieucparenkorean;3208\ncieucuparenkorean;321C\ncircle;25CB\ncirclemultiply;2297\ncircleot;2299\ncircleplus;2295\ncirclepostalmark;3036\ncirclewithlefthalfblack;25D0\ncirclewithrighthalfblack;25D1\ncircumflex;02C6\ncircumflexbelowcmb;032D\ncircumflexcmb;0302\nclear;2327\nclickalveolar;01C2\nclickdental;01C0\nclicklateral;01C1\nclickretroflex;01C3\nclub;2663\nclubsuitblack;2663\nclubsuitwhite;2667\ncmcubedsquare;33A4\ncmonospace;FF43\ncmsquaredsquare;33A0\ncoarmenian;0581\ncolon;003A\ncolonmonetary;20A1\ncolonmonospace;FF1A\ncolonsign;20A1\ncolonsmall;FE55\ncolontriangularhalfmod;02D1\ncolontriangularmod;02D0\ncomma;002C\ncommaabovecmb;0313\ncommaaboverightcmb;0315\ncommaaccent;F6C3\ncommaarabic;060C\ncommaarmenian;055D\ncommainferior;F6E1\ncommamonospace;FF0C\ncommareversedabovecmb;0314\ncommareversedmod;02BD\ncommasmall;FE50\ncommasuperior;F6E2\ncommaturnedabovecmb;0312\ncommaturnedmod;02BB\ncompass;263C\ncongruent;2245\ncontourintegral;222E\ncontrol;2303\ncontrolACK;0006\ncontrolBEL;0007\ncontrolBS;0008\ncontrolCAN;0018\ncontrolCR;000D\ncontrolDC1;0011\ncontrolDC2;0012\ncontrolDC3;0013\ncontrolDC4;0014\ncontrolDEL;007F\ncontrolDLE;0010\ncontrolEM;0019\ncontrolENQ;0005\ncontrolEOT;0004\ncontrolESC;001B\ncontrolETB;0017\ncontrolETX;0003\ncontrolFF;000C\ncontrolFS;001C\ncontrolGS;001D\ncontrolHT;0009\ncontrolLF;000A\ncontrolNAK;0015\ncontrolRS;001E\ncontrolSI;000F\ncontrolSO;000E\ncontrolSOT;0002\ncontrolSTX;0001\ncontrolSUB;001A\ncontrolSYN;0016\ncontrolUS;001F\ncontrolVT;000B\ncopyright;00A9\ncopyrightsans;F8E9\ncopyrightserif;F6D9\ncornerbracketleft;300C\ncornerbracketlefthalfwidth;FF62\ncornerbracketleftvertical;FE41\ncornerbracketright;300D\ncornerbracketrighthalfwidth;FF63\ncornerbracketrightvertical;FE42\ncorporationsquare;337F\ncosquare;33C7\ncoverkgsquare;33C6\ncparen;249E\ncruzeiro;20A2\ncstretched;0297\ncurlyand;22CF\ncurlyor;22CE\ncurrency;00A4\ncyrBreve;F6D1\ncyrFlex;F6D2\ncyrbreve;F6D4\ncyrflex;F6D5\nd;0064\ndaarmenian;0564\ndabengali;09A6\ndadarabic;0636\ndadeva;0926\ndadfinalarabic;FEBE\ndadinitialarabic;FEBF\ndadmedialarabic;FEC0\ndagesh;05BC\ndageshhebrew;05BC\ndagger;2020\ndaggerdbl;2021\ndagujarati;0AA6\ndagurmukhi;0A26\ndahiragana;3060\ndakatakana;30C0\ndalarabic;062F\ndalet;05D3\ndaletdagesh;FB33\ndaletdageshhebrew;FB33\ndalethatafpatah;05D3 05B2\ndalethatafpatahhebrew;05D3 05B2\ndalethatafsegol;05D3 05B1\ndalethatafsegolhebrew;05D3 05B1\ndalethebrew;05D3\ndalethiriq;05D3 05B4\ndalethiriqhebrew;05D3 05B4\ndaletholam;05D3 05B9\ndaletholamhebrew;05D3 05B9\ndaletpatah;05D3 05B7\ndaletpatahhebrew;05D3 05B7\ndaletqamats;05D3 05B8\ndaletqamatshebrew;05D3 05B8\ndaletqubuts;05D3 05BB\ndaletqubutshebrew;05D3 05BB\ndaletsegol;05D3 05B6\ndaletsegolhebrew;05D3 05B6\ndaletsheva;05D3 05B0\ndaletshevahebrew;05D3 05B0\ndalettsere;05D3 05B5\ndalettserehebrew;05D3 05B5\ndalfinalarabic;FEAA\ndammaarabic;064F\ndammalowarabic;064F\ndammatanaltonearabic;064C\ndammatanarabic;064C\ndanda;0964\ndargahebrew;05A7\ndargalefthebrew;05A7\ndasiapneumatacyrilliccmb;0485\ndblGrave;F6D3\ndblanglebracketleft;300A\ndblanglebracketleftvertical;FE3D\ndblanglebracketright;300B\ndblanglebracketrightvertical;FE3E\ndblarchinvertedbelowcmb;032B\ndblarrowleft;21D4\ndblarrowright;21D2\ndbldanda;0965\ndblgrave;F6D6\ndblgravecmb;030F\ndblintegral;222C\ndbllowline;2017\ndbllowlinecmb;0333\ndbloverlinecmb;033F\ndblprimemod;02BA\ndblverticalbar;2016\ndblverticallineabovecmb;030E\ndbopomofo;3109\ndbsquare;33C8\ndcaron;010F\ndcedilla;1E11\ndcircle;24D3\ndcircumflexbelow;1E13\ndcroat;0111\nddabengali;09A1\nddadeva;0921\nddagujarati;0AA1\nddagurmukhi;0A21\nddalarabic;0688\nddalfinalarabic;FB89\ndddhadeva;095C\nddhabengali;09A2\nddhadeva;0922\nddhagujarati;0AA2\nddhagurmukhi;0A22\nddotaccent;1E0B\nddotbelow;1E0D\ndecimalseparatorarabic;066B\ndecimalseparatorpersian;066B\ndecyrillic;0434\ndegree;00B0\ndehihebrew;05AD\ndehiragana;3067\ndeicoptic;03EF\ndekatakana;30C7\ndeleteleft;232B\ndeleteright;2326\ndelta;03B4\ndeltaturned;018D\ndenominatorminusonenumeratorbengali;09F8\ndezh;02A4\ndhabengali;09A7\ndhadeva;0927\ndhagujarati;0AA7\ndhagurmukhi;0A27\ndhook;0257\ndialytikatonos;0385\ndialytikatonoscmb;0344\ndiamond;2666\ndiamondsuitwhite;2662\ndieresis;00A8\ndieresisacute;F6D7\ndieresisbelowcmb;0324\ndieresiscmb;0308\ndieresisgrave;F6D8\ndieresistonos;0385\ndihiragana;3062\ndikatakana;30C2\ndittomark;3003\ndivide;00F7\ndivides;2223\ndivisionslash;2215\ndjecyrillic;0452\ndkshade;2593\ndlinebelow;1E0F\ndlsquare;3397\ndmacron;0111\ndmonospace;FF44\ndnblock;2584\ndochadathai;0E0E\ndodekthai;0E14\ndohiragana;3069\ndokatakana;30C9\ndollar;0024\ndollarinferior;F6E3\ndollarmonospace;FF04\ndollaroldstyle;F724\ndollarsmall;FE69\ndollarsuperior;F6E4\ndong;20AB\ndorusquare;3326\ndotaccent;02D9\ndotaccentcmb;0307\ndotbelowcmb;0323\ndotbelowcomb;0323\ndotkatakana;30FB\ndotlessi;0131\ndotlessj;F6BE\ndotlessjstrokehook;0284\ndotmath;22C5\ndottedcircle;25CC\ndoubleyodpatah;FB1F\ndoubleyodpatahhebrew;FB1F\ndowntackbelowcmb;031E\ndowntackmod;02D5\ndparen;249F\ndsuperior;F6EB\ndtail;0256\ndtopbar;018C\nduhiragana;3065\ndukatakana;30C5\ndz;01F3\ndzaltone;02A3\ndzcaron;01C6\ndzcurl;02A5\ndzeabkhasiancyrillic;04E1\ndzecyrillic;0455\ndzhecyrillic;045F\ne;0065\neacute;00E9\nearth;2641\nebengali;098F\nebopomofo;311C\nebreve;0115\necandradeva;090D\necandragujarati;0A8D\necandravowelsigndeva;0945\necandravowelsigngujarati;0AC5\necaron;011B\necedillabreve;1E1D\necharmenian;0565\nechyiwnarmenian;0587\necircle;24D4\necircumflex;00EA\necircumflexacute;1EBF\necircumflexbelow;1E19\necircumflexdotbelow;1EC7\necircumflexgrave;1EC1\necircumflexhookabove;1EC3\necircumflextilde;1EC5\necyrillic;0454\nedblgrave;0205\nedeva;090F\nedieresis;00EB\nedot;0117\nedotaccent;0117\nedotbelow;1EB9\neegurmukhi;0A0F\neematragurmukhi;0A47\nefcyrillic;0444\negrave;00E8\negujarati;0A8F\neharmenian;0567\nehbopomofo;311D\nehiragana;3048\nehookabove;1EBB\neibopomofo;311F\neight;0038\neightarabic;0668\neightbengali;09EE\neightcircle;2467\neightcircleinversesansserif;2791\neightdeva;096E\neighteencircle;2471\neighteenparen;2485\neighteenperiod;2499\neightgujarati;0AEE\neightgurmukhi;0A6E\neighthackarabic;0668\neighthangzhou;3028\neighthnotebeamed;266B\neightideographicparen;3227\neightinferior;2088\neightmonospace;FF18\neightoldstyle;F738\neightparen;247B\neightperiod;248F\neightpersian;06F8\neightroman;2177\neightsuperior;2078\neightthai;0E58\neinvertedbreve;0207\neiotifiedcyrillic;0465\nekatakana;30A8\nekatakanahalfwidth;FF74\nekonkargurmukhi;0A74\nekorean;3154\nelcyrillic;043B\nelement;2208\nelevencircle;246A\nelevenparen;247E\nelevenperiod;2492\nelevenroman;217A\nellipsis;2026\nellipsisvertical;22EE\nemacron;0113\nemacronacute;1E17\nemacrongrave;1E15\nemcyrillic;043C\nemdash;2014\nemdashvertical;FE31\nemonospace;FF45\nemphasismarkarmenian;055B\nemptyset;2205\nenbopomofo;3123\nencyrillic;043D\nendash;2013\nendashvertical;FE32\nendescendercyrillic;04A3\neng;014B\nengbopomofo;3125\nenghecyrillic;04A5\nenhookcyrillic;04C8\nenspace;2002\neogonek;0119\neokorean;3153\neopen;025B\neopenclosed;029A\neopenreversed;025C\neopenreversedclosed;025E\neopenreversedhook;025D\neparen;24A0\nepsilon;03B5\nepsilontonos;03AD\nequal;003D\nequalmonospace;FF1D\nequalsmall;FE66\nequalsuperior;207C\nequivalence;2261\nerbopomofo;3126\nercyrillic;0440\nereversed;0258\nereversedcyrillic;044D\nescyrillic;0441\nesdescendercyrillic;04AB\nesh;0283\neshcurl;0286\neshortdeva;090E\neshortvowelsigndeva;0946\neshreversedloop;01AA\neshsquatreversed;0285\nesmallhiragana;3047\nesmallkatakana;30A7\nesmallkatakanahalfwidth;FF6A\nestimated;212E\nesuperior;F6EC\neta;03B7\netarmenian;0568\netatonos;03AE\neth;00F0\netilde;1EBD\netildebelow;1E1B\netnahtafoukhhebrew;0591\netnahtafoukhlefthebrew;0591\netnahtahebrew;0591\netnahtalefthebrew;0591\neturned;01DD\neukorean;3161\neuro;20AC\nevowelsignbengali;09C7\nevowelsigndeva;0947\nevowelsigngujarati;0AC7\nexclam;0021\nexclamarmenian;055C\nexclamdbl;203C\nexclamdown;00A1\nexclamdownsmall;F7A1\nexclammonospace;FF01\nexclamsmall;F721\nexistential;2203\nezh;0292\nezhcaron;01EF\nezhcurl;0293\nezhreversed;01B9\nezhtail;01BA\nf;0066\nfadeva;095E\nfagurmukhi;0A5E\nfahrenheit;2109\nfathaarabic;064E\nfathalowarabic;064E\nfathatanarabic;064B\nfbopomofo;3108\nfcircle;24D5\nfdotaccent;1E1F\nfeharabic;0641\nfeharmenian;0586\nfehfinalarabic;FED2\nfehinitialarabic;FED3\nfehmedialarabic;FED4\nfeicoptic;03E5\nfemale;2640\nff;FB00\nffi;FB03\nffl;FB04\nfi;FB01\nfifteencircle;246E\nfifteenparen;2482\nfifteenperiod;2496\nfiguredash;2012\nfilledbox;25A0\nfilledrect;25AC\nfinalkaf;05DA\nfinalkafdagesh;FB3A\nfinalkafdageshhebrew;FB3A\nfinalkafhebrew;05DA\nfinalkafqamats;05DA 05B8\nfinalkafqamatshebrew;05DA 05B8\nfinalkafsheva;05DA 05B0\nfinalkafshevahebrew;05DA 05B0\nfinalmem;05DD\nfinalmemhebrew;05DD\nfinalnun;05DF\nfinalnunhebrew;05DF\nfinalpe;05E3\nfinalpehebrew;05E3\nfinaltsadi;05E5\nfinaltsadihebrew;05E5\nfirsttonechinese;02C9\nfisheye;25C9\nfitacyrillic;0473\nfive;0035\nfivearabic;0665\nfivebengali;09EB\nfivecircle;2464\nfivecircleinversesansserif;278E\nfivedeva;096B\nfiveeighths;215D\nfivegujarati;0AEB\nfivegurmukhi;0A6B\nfivehackarabic;0665\nfivehangzhou;3025\nfiveideographicparen;3224\nfiveinferior;2085\nfivemonospace;FF15\nfiveoldstyle;F735\nfiveparen;2478\nfiveperiod;248C\nfivepersian;06F5\nfiveroman;2174\nfivesuperior;2075\nfivethai;0E55\nfl;FB02\nflorin;0192\nfmonospace;FF46\nfmsquare;3399\nfofanthai;0E1F\nfofathai;0E1D\nfongmanthai;0E4F\nforall;2200\nfour;0034\nfourarabic;0664\nfourbengali;09EA\nfourcircle;2463\nfourcircleinversesansserif;278D\nfourdeva;096A\nfourgujarati;0AEA\nfourgurmukhi;0A6A\nfourhackarabic;0664\nfourhangzhou;3024\nfourideographicparen;3223\nfourinferior;2084\nfourmonospace;FF14\nfournumeratorbengali;09F7\nfouroldstyle;F734\nfourparen;2477\nfourperiod;248B\nfourpersian;06F4\nfourroman;2173\nfoursuperior;2074\nfourteencircle;246D\nfourteenparen;2481\nfourteenperiod;2495\nfourthai;0E54\nfourthtonechinese;02CB\nfparen;24A1\nfraction;2044\nfranc;20A3\ng;0067\ngabengali;0997\ngacute;01F5\ngadeva;0917\ngafarabic;06AF\ngaffinalarabic;FB93\ngafinitialarabic;FB94\ngafmedialarabic;FB95\ngagujarati;0A97\ngagurmukhi;0A17\ngahiragana;304C\ngakatakana;30AC\ngamma;03B3\ngammalatinsmall;0263\ngammasuperior;02E0\ngangiacoptic;03EB\ngbopomofo;310D\ngbreve;011F\ngcaron;01E7\ngcedilla;0123\ngcircle;24D6\ngcircumflex;011D\ngcommaaccent;0123\ngdot;0121\ngdotaccent;0121\ngecyrillic;0433\ngehiragana;3052\ngekatakana;30B2\ngeometricallyequal;2251\ngereshaccenthebrew;059C\ngereshhebrew;05F3\ngereshmuqdamhebrew;059D\ngermandbls;00DF\ngershayimaccenthebrew;059E\ngershayimhebrew;05F4\ngetamark;3013\nghabengali;0998\nghadarmenian;0572\nghadeva;0918\nghagujarati;0A98\nghagurmukhi;0A18\nghainarabic;063A\nghainfinalarabic;FECE\nghaininitialarabic;FECF\nghainmedialarabic;FED0\nghemiddlehookcyrillic;0495\nghestrokecyrillic;0493\ngheupturncyrillic;0491\nghhadeva;095A\nghhagurmukhi;0A5A\nghook;0260\nghzsquare;3393\ngihiragana;304E\ngikatakana;30AE\ngimarmenian;0563\ngimel;05D2\ngimeldagesh;FB32\ngimeldageshhebrew;FB32\ngimelhebrew;05D2\ngjecyrillic;0453\nglottalinvertedstroke;01BE\nglottalstop;0294\nglottalstopinverted;0296\nglottalstopmod;02C0\nglottalstopreversed;0295\nglottalstopreversedmod;02C1\nglottalstopreversedsuperior;02E4\nglottalstopstroke;02A1\nglottalstopstrokereversed;02A2\ngmacron;1E21\ngmonospace;FF47\ngohiragana;3054\ngokatakana;30B4\ngparen;24A2\ngpasquare;33AC\ngradient;2207\ngrave;0060\ngravebelowcmb;0316\ngravecmb;0300\ngravecomb;0300\ngravedeva;0953\ngravelowmod;02CE\ngravemonospace;FF40\ngravetonecmb;0340\ngreater;003E\ngreaterequal;2265\ngreaterequalorless;22DB\ngreatermonospace;FF1E\ngreaterorequivalent;2273\ngreaterorless;2277\ngreateroverequal;2267\ngreatersmall;FE65\ngscript;0261\ngstroke;01E5\nguhiragana;3050\nguillemotleft;00AB\nguillemotright;00BB\nguilsinglleft;2039\nguilsinglright;203A\ngukatakana;30B0\nguramusquare;3318\ngysquare;33C9\nh;0068\nhaabkhasiancyrillic;04A9\nhaaltonearabic;06C1\nhabengali;09B9\nhadescendercyrillic;04B3\nhadeva;0939\nhagujarati;0AB9\nhagurmukhi;0A39\nhaharabic;062D\nhahfinalarabic;FEA2\nhahinitialarabic;FEA3\nhahiragana;306F\nhahmedialarabic;FEA4\nhaitusquare;332A\nhakatakana;30CF\nhakatakanahalfwidth;FF8A\nhalantgurmukhi;0A4D\nhamzaarabic;0621\nhamzadammaarabic;0621 064F\nhamzadammatanarabic;0621 064C\nhamzafathaarabic;0621 064E\nhamzafathatanarabic;0621 064B\nhamzalowarabic;0621\nhamzalowkasraarabic;0621 0650\nhamzalowkasratanarabic;0621 064D\nhamzasukunarabic;0621 0652\nhangulfiller;3164\nhardsigncyrillic;044A\nharpoonleftbarbup;21BC\nharpoonrightbarbup;21C0\nhasquare;33CA\nhatafpatah;05B2\nhatafpatah16;05B2\nhatafpatah23;05B2\nhatafpatah2f;05B2\nhatafpatahhebrew;05B2\nhatafpatahnarrowhebrew;05B2\nhatafpatahquarterhebrew;05B2\nhatafpatahwidehebrew;05B2\nhatafqamats;05B3\nhatafqamats1b;05B3\nhatafqamats28;05B3\nhatafqamats34;05B3\nhatafqamatshebrew;05B3\nhatafqamatsnarrowhebrew;05B3\nhatafqamatsquarterhebrew;05B3\nhatafqamatswidehebrew;05B3\nhatafsegol;05B1\nhatafsegol17;05B1\nhatafsegol24;05B1\nhatafsegol30;05B1\nhatafsegolhebrew;05B1\nhatafsegolnarrowhebrew;05B1\nhatafsegolquarterhebrew;05B1\nhatafsegolwidehebrew;05B1\nhbar;0127\nhbopomofo;310F\nhbrevebelow;1E2B\nhcedilla;1E29\nhcircle;24D7\nhcircumflex;0125\nhdieresis;1E27\nhdotaccent;1E23\nhdotbelow;1E25\nhe;05D4\nheart;2665\nheartsuitblack;2665\nheartsuitwhite;2661\nhedagesh;FB34\nhedageshhebrew;FB34\nhehaltonearabic;06C1\nheharabic;0647\nhehebrew;05D4\nhehfinalaltonearabic;FBA7\nhehfinalalttwoarabic;FEEA\nhehfinalarabic;FEEA\nhehhamzaabovefinalarabic;FBA5\nhehhamzaaboveisolatedarabic;FBA4\nhehinitialaltonearabic;FBA8\nhehinitialarabic;FEEB\nhehiragana;3078\nhehmedialaltonearabic;FBA9\nhehmedialarabic;FEEC\nheiseierasquare;337B\nhekatakana;30D8\nhekatakanahalfwidth;FF8D\nhekutaarusquare;3336\nhenghook;0267\nherutusquare;3339\nhet;05D7\nhethebrew;05D7\nhhook;0266\nhhooksuperior;02B1\nhieuhacirclekorean;327B\nhieuhaparenkorean;321B\nhieuhcirclekorean;326D\nhieuhkorean;314E\nhieuhparenkorean;320D\nhihiragana;3072\nhikatakana;30D2\nhikatakanahalfwidth;FF8B\nhiriq;05B4\nhiriq14;05B4\nhiriq21;05B4\nhiriq2d;05B4\nhiriqhebrew;05B4\nhiriqnarrowhebrew;05B4\nhiriqquarterhebrew;05B4\nhiriqwidehebrew;05B4\nhlinebelow;1E96\nhmonospace;FF48\nhoarmenian;0570\nhohipthai;0E2B\nhohiragana;307B\nhokatakana;30DB\nhokatakanahalfwidth;FF8E\nholam;05B9\nholam19;05B9\nholam26;05B9\nholam32;05B9\nholamhebrew;05B9\nholamnarrowhebrew;05B9\nholamquarterhebrew;05B9\nholamwidehebrew;05B9\nhonokhukthai;0E2E\nhookabovecomb;0309\nhookcmb;0309\nhookpalatalizedbelowcmb;0321\nhookretroflexbelowcmb;0322\nhoonsquare;3342\nhoricoptic;03E9\nhorizontalbar;2015\nhorncmb;031B\nhotsprings;2668\nhouse;2302\nhparen;24A3\nhsuperior;02B0\nhturned;0265\nhuhiragana;3075\nhuiitosquare;3333\nhukatakana;30D5\nhukatakanahalfwidth;FF8C\nhungarumlaut;02DD\nhungarumlautcmb;030B\nhv;0195\nhyphen;002D\nhypheninferior;F6E5\nhyphenmonospace;FF0D\nhyphensmall;FE63\nhyphensuperior;F6E6\nhyphentwo;2010\ni;0069\niacute;00ED\niacyrillic;044F\nibengali;0987\nibopomofo;3127\nibreve;012D\nicaron;01D0\nicircle;24D8\nicircumflex;00EE\nicyrillic;0456\nidblgrave;0209\nideographearthcircle;328F\nideographfirecircle;328B\nideographicallianceparen;323F\nideographiccallparen;323A\nideographiccentrecircle;32A5\nideographicclose;3006\nideographiccomma;3001\nideographiccommaleft;FF64\nideographiccongratulationparen;3237\nideographiccorrectcircle;32A3\nideographicearthparen;322F\nideographicenterpriseparen;323D\nideographicexcellentcircle;329D\nideographicfestivalparen;3240\nideographicfinancialcircle;3296\nideographicfinancialparen;3236\nideographicfireparen;322B\nideographichaveparen;3232\nideographichighcircle;32A4\nideographiciterationmark;3005\nideographiclaborcircle;3298\nideographiclaborparen;3238\nideographicleftcircle;32A7\nideographiclowcircle;32A6\nideographicmedicinecircle;32A9\nideographicmetalparen;322E\nideographicmoonparen;322A\nideographicnameparen;3234\nideographicperiod;3002\nideographicprintcircle;329E\nideographicreachparen;3243\nideographicrepresentparen;3239\nideographicresourceparen;323E\nideographicrightcircle;32A8\nideographicsecretcircle;3299\nideographicselfparen;3242\nideographicsocietyparen;3233\nideographicspace;3000\nideographicspecialparen;3235\nideographicstockparen;3231\nideographicstudyparen;323B\nideographicsunparen;3230\nideographicsuperviseparen;323C\nideographicwaterparen;322C\nideographicwoodparen;322D\nideographiczero;3007\nideographmetalcircle;328E\nideographmooncircle;328A\nideographnamecircle;3294\nideographsuncircle;3290\nideographwatercircle;328C\nideographwoodcircle;328D\nideva;0907\nidieresis;00EF\nidieresisacute;1E2F\nidieresiscyrillic;04E5\nidotbelow;1ECB\niebrevecyrillic;04D7\niecyrillic;0435\nieungacirclekorean;3275\nieungaparenkorean;3215\nieungcirclekorean;3267\nieungkorean;3147\nieungparenkorean;3207\nigrave;00EC\nigujarati;0A87\nigurmukhi;0A07\nihiragana;3044\nihookabove;1EC9\niibengali;0988\niicyrillic;0438\niideva;0908\niigujarati;0A88\niigurmukhi;0A08\niimatragurmukhi;0A40\niinvertedbreve;020B\niishortcyrillic;0439\niivowelsignbengali;09C0\niivowelsigndeva;0940\niivowelsigngujarati;0AC0\nij;0133\nikatakana;30A4\nikatakanahalfwidth;FF72\nikorean;3163\nilde;02DC\niluyhebrew;05AC\nimacron;012B\nimacroncyrillic;04E3\nimageorapproximatelyequal;2253\nimatragurmukhi;0A3F\nimonospace;FF49\nincrement;2206\ninfinity;221E\niniarmenian;056B\nintegral;222B\nintegralbottom;2321\nintegralbt;2321\nintegralex;F8F5\nintegraltop;2320\nintegraltp;2320\nintersection;2229\nintisquare;3305\ninvbullet;25D8\ninvcircle;25D9\ninvsmileface;263B\niocyrillic;0451\niogonek;012F\niota;03B9\niotadieresis;03CA\niotadieresistonos;0390\niotalatin;0269\niotatonos;03AF\niparen;24A4\nirigurmukhi;0A72\nismallhiragana;3043\nismallkatakana;30A3\nismallkatakanahalfwidth;FF68\nissharbengali;09FA\nistroke;0268\nisuperior;F6ED\niterationhiragana;309D\niterationkatakana;30FD\nitilde;0129\nitildebelow;1E2D\niubopomofo;3129\niucyrillic;044E\nivowelsignbengali;09BF\nivowelsigndeva;093F\nivowelsigngujarati;0ABF\nizhitsacyrillic;0475\nizhitsadblgravecyrillic;0477\nj;006A\njaarmenian;0571\njabengali;099C\njadeva;091C\njagujarati;0A9C\njagurmukhi;0A1C\njbopomofo;3110\njcaron;01F0\njcircle;24D9\njcircumflex;0135\njcrossedtail;029D\njdotlessstroke;025F\njecyrillic;0458\njeemarabic;062C\njeemfinalarabic;FE9E\njeeminitialarabic;FE9F\njeemmedialarabic;FEA0\njeharabic;0698\njehfinalarabic;FB8B\njhabengali;099D\njhadeva;091D\njhagujarati;0A9D\njhagurmukhi;0A1D\njheharmenian;057B\njis;3004\njmonospace;FF4A\njparen;24A5\njsuperior;02B2\nk;006B\nkabashkircyrillic;04A1\nkabengali;0995\nkacute;1E31\nkacyrillic;043A\nkadescendercyrillic;049B\nkadeva;0915\nkaf;05DB\nkafarabic;0643\nkafdagesh;FB3B\nkafdageshhebrew;FB3B\nkaffinalarabic;FEDA\nkafhebrew;05DB\nkafinitialarabic;FEDB\nkafmedialarabic;FEDC\nkafrafehebrew;FB4D\nkagujarati;0A95\nkagurmukhi;0A15\nkahiragana;304B\nkahookcyrillic;04C4\nkakatakana;30AB\nkakatakanahalfwidth;FF76\nkappa;03BA\nkappasymbolgreek;03F0\nkapyeounmieumkorean;3171\nkapyeounphieuphkorean;3184\nkapyeounpieupkorean;3178\nkapyeounssangpieupkorean;3179\nkaroriisquare;330D\nkashidaautoarabic;0640\nkashidaautonosidebearingarabic;0640\nkasmallkatakana;30F5\nkasquare;3384\nkasraarabic;0650\nkasratanarabic;064D\nkastrokecyrillic;049F\nkatahiraprolongmarkhalfwidth;FF70\nkaverticalstrokecyrillic;049D\nkbopomofo;310E\nkcalsquare;3389\nkcaron;01E9\nkcedilla;0137\nkcircle;24DA\nkcommaaccent;0137\nkdotbelow;1E33\nkeharmenian;0584\nkehiragana;3051\nkekatakana;30B1\nkekatakanahalfwidth;FF79\nkenarmenian;056F\nkesmallkatakana;30F6\nkgreenlandic;0138\nkhabengali;0996\nkhacyrillic;0445\nkhadeva;0916\nkhagujarati;0A96\nkhagurmukhi;0A16\nkhaharabic;062E\nkhahfinalarabic;FEA6\nkhahinitialarabic;FEA7\nkhahmedialarabic;FEA8\nkheicoptic;03E7\nkhhadeva;0959\nkhhagurmukhi;0A59\nkhieukhacirclekorean;3278\nkhieukhaparenkorean;3218\nkhieukhcirclekorean;326A\nkhieukhkorean;314B\nkhieukhparenkorean;320A\nkhokhaithai;0E02\nkhokhonthai;0E05\nkhokhuatthai;0E03\nkhokhwaithai;0E04\nkhomutthai;0E5B\nkhook;0199\nkhorakhangthai;0E06\nkhzsquare;3391\nkihiragana;304D\nkikatakana;30AD\nkikatakanahalfwidth;FF77\nkiroguramusquare;3315\nkiromeetorusquare;3316\nkirosquare;3314\nkiyeokacirclekorean;326E\nkiyeokaparenkorean;320E\nkiyeokcirclekorean;3260\nkiyeokkorean;3131\nkiyeokparenkorean;3200\nkiyeoksioskorean;3133\nkjecyrillic;045C\nklinebelow;1E35\nklsquare;3398\nkmcubedsquare;33A6\nkmonospace;FF4B\nkmsquaredsquare;33A2\nkohiragana;3053\nkohmsquare;33C0\nkokaithai;0E01\nkokatakana;30B3\nkokatakanahalfwidth;FF7A\nkooposquare;331E\nkoppacyrillic;0481\nkoreanstandardsymbol;327F\nkoroniscmb;0343\nkparen;24A6\nkpasquare;33AA\nksicyrillic;046F\nktsquare;33CF\nkturned;029E\nkuhiragana;304F\nkukatakana;30AF\nkukatakanahalfwidth;FF78\nkvsquare;33B8\nkwsquare;33BE\nl;006C\nlabengali;09B2\nlacute;013A\nladeva;0932\nlagujarati;0AB2\nlagurmukhi;0A32\nlakkhangyaothai;0E45\nlamaleffinalarabic;FEFC\nlamalefhamzaabovefinalarabic;FEF8\nlamalefhamzaaboveisolatedarabic;FEF7\nlamalefhamzabelowfinalarabic;FEFA\nlamalefhamzabelowisolatedarabic;FEF9\nlamalefisolatedarabic;FEFB\nlamalefmaddaabovefinalarabic;FEF6\nlamalefmaddaaboveisolatedarabic;FEF5\nlamarabic;0644\nlambda;03BB\nlambdastroke;019B\nlamed;05DC\nlameddagesh;FB3C\nlameddageshhebrew;FB3C\nlamedhebrew;05DC\nlamedholam;05DC 05B9\nlamedholamdagesh;05DC 05B9 05BC\nlamedholamdageshhebrew;05DC 05B9 05BC\nlamedholamhebrew;05DC 05B9\nlamfinalarabic;FEDE\nlamhahinitialarabic;FCCA\nlaminitialarabic;FEDF\nlamjeeminitialarabic;FCC9\nlamkhahinitialarabic;FCCB\nlamlamhehisolatedarabic;FDF2\nlammedialarabic;FEE0\nlammeemhahinitialarabic;FD88\nlammeeminitialarabic;FCCC\nlammeemjeeminitialarabic;FEDF FEE4 FEA0\nlammeemkhahinitialarabic;FEDF FEE4 FEA8\nlargecircle;25EF\nlbar;019A\nlbelt;026C\nlbopomofo;310C\nlcaron;013E\nlcedilla;013C\nlcircle;24DB\nlcircumflexbelow;1E3D\nlcommaaccent;013C\nldot;0140\nldotaccent;0140\nldotbelow;1E37\nldotbelowmacron;1E39\nleftangleabovecmb;031A\nlefttackbelowcmb;0318\nless;003C\nlessequal;2264\nlessequalorgreater;22DA\nlessmonospace;FF1C\nlessorequivalent;2272\nlessorgreater;2276\nlessoverequal;2266\nlesssmall;FE64\nlezh;026E\nlfblock;258C\nlhookretroflex;026D\nlira;20A4\nliwnarmenian;056C\nlj;01C9\nljecyrillic;0459\nll;F6C0\nlladeva;0933\nllagujarati;0AB3\nllinebelow;1E3B\nllladeva;0934\nllvocalicbengali;09E1\nllvocalicdeva;0961\nllvocalicvowelsignbengali;09E3\nllvocalicvowelsigndeva;0963\nlmiddletilde;026B\nlmonospace;FF4C\nlmsquare;33D0\nlochulathai;0E2C\nlogicaland;2227\nlogicalnot;00AC\nlogicalnotreversed;2310\nlogicalor;2228\nlolingthai;0E25\nlongs;017F\nlowlinecenterline;FE4E\nlowlinecmb;0332\nlowlinedashed;FE4D\nlozenge;25CA\nlparen;24A7\nlslash;0142\nlsquare;2113\nlsuperior;F6EE\nltshade;2591\nluthai;0E26\nlvocalicbengali;098C\nlvocalicdeva;090C\nlvocalicvowelsignbengali;09E2\nlvocalicvowelsigndeva;0962\nlxsquare;33D3\nm;006D\nmabengali;09AE\nmacron;00AF\nmacronbelowcmb;0331\nmacroncmb;0304\nmacronlowmod;02CD\nmacronmonospace;FFE3\nmacute;1E3F\nmadeva;092E\nmagujarati;0AAE\nmagurmukhi;0A2E\nmahapakhhebrew;05A4\nmahapakhlefthebrew;05A4\nmahiragana;307E\nmaichattawalowleftthai;F895\nmaichattawalowrightthai;F894\nmaichattawathai;0E4B\nmaichattawaupperleftthai;F893\nmaieklowleftthai;F88C\nmaieklowrightthai;F88B\nmaiekthai;0E48\nmaiekupperleftthai;F88A\nmaihanakatleftthai;F884\nmaihanakatthai;0E31\nmaitaikhuleftthai;F889\nmaitaikhuthai;0E47\nmaitholowleftthai;F88F\nmaitholowrightthai;F88E\nmaithothai;0E49\nmaithoupperleftthai;F88D\nmaitrilowleftthai;F892\nmaitrilowrightthai;F891\nmaitrithai;0E4A\nmaitriupperleftthai;F890\nmaiyamokthai;0E46\nmakatakana;30DE\nmakatakanahalfwidth;FF8F\nmale;2642\nmansyonsquare;3347\nmaqafhebrew;05BE\nmars;2642\nmasoracirclehebrew;05AF\nmasquare;3383\nmbopomofo;3107\nmbsquare;33D4\nmcircle;24DC\nmcubedsquare;33A5\nmdotaccent;1E41\nmdotbelow;1E43\nmeemarabic;0645\nmeemfinalarabic;FEE2\nmeeminitialarabic;FEE3\nmeemmedialarabic;FEE4\nmeemmeeminitialarabic;FCD1\nmeemmeemisolatedarabic;FC48\nmeetorusquare;334D\nmehiragana;3081\nmeizierasquare;337E\nmekatakana;30E1\nmekatakanahalfwidth;FF92\nmem;05DE\nmemdagesh;FB3E\nmemdageshhebrew;FB3E\nmemhebrew;05DE\nmenarmenian;0574\nmerkhahebrew;05A5\nmerkhakefulahebrew;05A6\nmerkhakefulalefthebrew;05A6\nmerkhalefthebrew;05A5\nmhook;0271\nmhzsquare;3392\nmiddledotkatakanahalfwidth;FF65\nmiddot;00B7\nmieumacirclekorean;3272\nmieumaparenkorean;3212\nmieumcirclekorean;3264\nmieumkorean;3141\nmieumpansioskorean;3170\nmieumparenkorean;3204\nmieumpieupkorean;316E\nmieumsioskorean;316F\nmihiragana;307F\nmikatakana;30DF\nmikatakanahalfwidth;FF90\nminus;2212\nminusbelowcmb;0320\nminuscircle;2296\nminusmod;02D7\nminusplus;2213\nminute;2032\nmiribaarusquare;334A\nmirisquare;3349\nmlonglegturned;0270\nmlsquare;3396\nmmcubedsquare;33A3\nmmonospace;FF4D\nmmsquaredsquare;339F\nmohiragana;3082\nmohmsquare;33C1\nmokatakana;30E2\nmokatakanahalfwidth;FF93\nmolsquare;33D6\nmomathai;0E21\nmoverssquare;33A7\nmoverssquaredsquare;33A8\nmparen;24A8\nmpasquare;33AB\nmssquare;33B3\nmsuperior;F6EF\nmturned;026F\nmu;00B5\nmu1;00B5\nmuasquare;3382\nmuchgreater;226B\nmuchless;226A\nmufsquare;338C\nmugreek;03BC\nmugsquare;338D\nmuhiragana;3080\nmukatakana;30E0\nmukatakanahalfwidth;FF91\nmulsquare;3395\nmultiply;00D7\nmumsquare;339B\nmunahhebrew;05A3\nmunahlefthebrew;05A3\nmusicalnote;266A\nmusicalnotedbl;266B\nmusicflatsign;266D\nmusicsharpsign;266F\nmussquare;33B2\nmuvsquare;33B6\nmuwsquare;33BC\nmvmegasquare;33B9\nmvsquare;33B7\nmwmegasquare;33BF\nmwsquare;33BD\nn;006E\nnabengali;09A8\nnabla;2207\nnacute;0144\nnadeva;0928\nnagujarati;0AA8\nnagurmukhi;0A28\nnahiragana;306A\nnakatakana;30CA\nnakatakanahalfwidth;FF85\nnapostrophe;0149\nnasquare;3381\nnbopomofo;310B\nnbspace;00A0\nncaron;0148\nncedilla;0146\nncircle;24DD\nncircumflexbelow;1E4B\nncommaaccent;0146\nndotaccent;1E45\nndotbelow;1E47\nnehiragana;306D\nnekatakana;30CD\nnekatakanahalfwidth;FF88\nnewsheqelsign;20AA\nnfsquare;338B\nngabengali;0999\nngadeva;0919\nngagujarati;0A99\nngagurmukhi;0A19\nngonguthai;0E07\nnhiragana;3093\nnhookleft;0272\nnhookretroflex;0273\nnieunacirclekorean;326F\nnieunaparenkorean;320F\nnieuncieuckorean;3135\nnieuncirclekorean;3261\nnieunhieuhkorean;3136\nnieunkorean;3134\nnieunpansioskorean;3168\nnieunparenkorean;3201\nnieunsioskorean;3167\nnieuntikeutkorean;3166\nnihiragana;306B\nnikatakana;30CB\nnikatakanahalfwidth;FF86\nnikhahitleftthai;F899\nnikhahitthai;0E4D\nnine;0039\nninearabic;0669\nninebengali;09EF\nninecircle;2468\nninecircleinversesansserif;2792\nninedeva;096F\nninegujarati;0AEF\nninegurmukhi;0A6F\nninehackarabic;0669\nninehangzhou;3029\nnineideographicparen;3228\nnineinferior;2089\nninemonospace;FF19\nnineoldstyle;F739\nnineparen;247C\nnineperiod;2490\nninepersian;06F9\nnineroman;2178\nninesuperior;2079\nnineteencircle;2472\nnineteenparen;2486\nnineteenperiod;249A\nninethai;0E59\nnj;01CC\nnjecyrillic;045A\nnkatakana;30F3\nnkatakanahalfwidth;FF9D\nnlegrightlong;019E\nnlinebelow;1E49\nnmonospace;FF4E\nnmsquare;339A\nnnabengali;09A3\nnnadeva;0923\nnnagujarati;0AA3\nnnagurmukhi;0A23\nnnnadeva;0929\nnohiragana;306E\nnokatakana;30CE\nnokatakanahalfwidth;FF89\nnonbreakingspace;00A0\nnonenthai;0E13\nnonuthai;0E19\nnoonarabic;0646\nnoonfinalarabic;FEE6\nnoonghunnaarabic;06BA\nnoonghunnafinalarabic;FB9F\nnoonhehinitialarabic;FEE7 FEEC\nnooninitialarabic;FEE7\nnoonjeeminitialarabic;FCD2\nnoonjeemisolatedarabic;FC4B\nnoonmedialarabic;FEE8\nnoonmeeminitialarabic;FCD5\nnoonmeemisolatedarabic;FC4E\nnoonnoonfinalarabic;FC8D\nnotcontains;220C\nnotelement;2209\nnotelementof;2209\nnotequal;2260\nnotgreater;226F\nnotgreaternorequal;2271\nnotgreaternorless;2279\nnotidentical;2262\nnotless;226E\nnotlessnorequal;2270\nnotparallel;2226\nnotprecedes;2280\nnotsubset;2284\nnotsucceeds;2281\nnotsuperset;2285\nnowarmenian;0576\nnparen;24A9\nnssquare;33B1\nnsuperior;207F\nntilde;00F1\nnu;03BD\nnuhiragana;306C\nnukatakana;30CC\nnukatakanahalfwidth;FF87\nnuktabengali;09BC\nnuktadeva;093C\nnuktagujarati;0ABC\nnuktagurmukhi;0A3C\nnumbersign;0023\nnumbersignmonospace;FF03\nnumbersignsmall;FE5F\nnumeralsigngreek;0374\nnumeralsignlowergreek;0375\nnumero;2116\nnun;05E0\nnundagesh;FB40\nnundageshhebrew;FB40\nnunhebrew;05E0\nnvsquare;33B5\nnwsquare;33BB\nnyabengali;099E\nnyadeva;091E\nnyagujarati;0A9E\nnyagurmukhi;0A1E\no;006F\noacute;00F3\noangthai;0E2D\nobarred;0275\nobarredcyrillic;04E9\nobarreddieresiscyrillic;04EB\nobengali;0993\nobopomofo;311B\nobreve;014F\nocandradeva;0911\nocandragujarati;0A91\nocandravowelsigndeva;0949\nocandravowelsigngujarati;0AC9\nocaron;01D2\nocircle;24DE\nocircumflex;00F4\nocircumflexacute;1ED1\nocircumflexdotbelow;1ED9\nocircumflexgrave;1ED3\nocircumflexhookabove;1ED5\nocircumflextilde;1ED7\nocyrillic;043E\nodblacute;0151\nodblgrave;020D\nodeva;0913\nodieresis;00F6\nodieresiscyrillic;04E7\nodotbelow;1ECD\noe;0153\noekorean;315A\nogonek;02DB\nogonekcmb;0328\nograve;00F2\nogujarati;0A93\noharmenian;0585\nohiragana;304A\nohookabove;1ECF\nohorn;01A1\nohornacute;1EDB\nohorndotbelow;1EE3\nohorngrave;1EDD\nohornhookabove;1EDF\nohorntilde;1EE1\nohungarumlaut;0151\noi;01A3\noinvertedbreve;020F\nokatakana;30AA\nokatakanahalfwidth;FF75\nokorean;3157\nolehebrew;05AB\nomacron;014D\nomacronacute;1E53\nomacrongrave;1E51\nomdeva;0950\nomega;03C9\nomega1;03D6\nomegacyrillic;0461\nomegalatinclosed;0277\nomegaroundcyrillic;047B\nomegatitlocyrillic;047D\nomegatonos;03CE\nomgujarati;0AD0\nomicron;03BF\nomicrontonos;03CC\nomonospace;FF4F\none;0031\nonearabic;0661\nonebengali;09E7\nonecircle;2460\nonecircleinversesansserif;278A\nonedeva;0967\nonedotenleader;2024\noneeighth;215B\nonefitted;F6DC\nonegujarati;0AE7\nonegurmukhi;0A67\nonehackarabic;0661\nonehalf;00BD\nonehangzhou;3021\noneideographicparen;3220\noneinferior;2081\nonemonospace;FF11\nonenumeratorbengali;09F4\noneoldstyle;F731\noneparen;2474\noneperiod;2488\nonepersian;06F1\nonequarter;00BC\noneroman;2170\nonesuperior;00B9\nonethai;0E51\nonethird;2153\noogonek;01EB\noogonekmacron;01ED\noogurmukhi;0A13\noomatragurmukhi;0A4B\noopen;0254\noparen;24AA\nopenbullet;25E6\noption;2325\nordfeminine;00AA\nordmasculine;00BA\northogonal;221F\noshortdeva;0912\noshortvowelsigndeva;094A\noslash;00F8\noslashacute;01FF\nosmallhiragana;3049\nosmallkatakana;30A9\nosmallkatakanahalfwidth;FF6B\nostrokeacute;01FF\nosuperior;F6F0\notcyrillic;047F\notilde;00F5\notildeacute;1E4D\notildedieresis;1E4F\noubopomofo;3121\noverline;203E\noverlinecenterline;FE4A\noverlinecmb;0305\noverlinedashed;FE49\noverlinedblwavy;FE4C\noverlinewavy;FE4B\noverscore;00AF\novowelsignbengali;09CB\novowelsigndeva;094B\novowelsigngujarati;0ACB\np;0070\npaampssquare;3380\npaasentosquare;332B\npabengali;09AA\npacute;1E55\npadeva;092A\npagedown;21DF\npageup;21DE\npagujarati;0AAA\npagurmukhi;0A2A\npahiragana;3071\npaiyannoithai;0E2F\npakatakana;30D1\npalatalizationcyrilliccmb;0484\npalochkacyrillic;04C0\npansioskorean;317F\nparagraph;00B6\nparallel;2225\nparenleft;0028\nparenleftaltonearabic;FD3E\nparenleftbt;F8ED\nparenleftex;F8EC\nparenleftinferior;208D\nparenleftmonospace;FF08\nparenleftsmall;FE59\nparenleftsuperior;207D\nparenlefttp;F8EB\nparenleftvertical;FE35\nparenright;0029\nparenrightaltonearabic;FD3F\nparenrightbt;F8F8\nparenrightex;F8F7\nparenrightinferior;208E\nparenrightmonospace;FF09\nparenrightsmall;FE5A\nparenrightsuperior;207E\nparenrighttp;F8F6\nparenrightvertical;FE36\npartialdiff;2202\npaseqhebrew;05C0\npashtahebrew;0599\npasquare;33A9\npatah;05B7\npatah11;05B7\npatah1d;05B7\npatah2a;05B7\npatahhebrew;05B7\npatahnarrowhebrew;05B7\npatahquarterhebrew;05B7\npatahwidehebrew;05B7\npazerhebrew;05A1\npbopomofo;3106\npcircle;24DF\npdotaccent;1E57\npe;05E4\npecyrillic;043F\npedagesh;FB44\npedageshhebrew;FB44\npeezisquare;333B\npefinaldageshhebrew;FB43\npeharabic;067E\npeharmenian;057A\npehebrew;05E4\npehfinalarabic;FB57\npehinitialarabic;FB58\npehiragana;307A\npehmedialarabic;FB59\npekatakana;30DA\npemiddlehookcyrillic;04A7\nperafehebrew;FB4E\npercent;0025\npercentarabic;066A\npercentmonospace;FF05\npercentsmall;FE6A\nperiod;002E\nperiodarmenian;0589\nperiodcentered;00B7\nperiodhalfwidth;FF61\nperiodinferior;F6E7\nperiodmonospace;FF0E\nperiodsmall;FE52\nperiodsuperior;F6E8\nperispomenigreekcmb;0342\nperpendicular;22A5\nperthousand;2030\npeseta;20A7\npfsquare;338A\nphabengali;09AB\nphadeva;092B\nphagujarati;0AAB\nphagurmukhi;0A2B\nphi;03C6\nphi1;03D5\nphieuphacirclekorean;327A\nphieuphaparenkorean;321A\nphieuphcirclekorean;326C\nphieuphkorean;314D\nphieuphparenkorean;320C\nphilatin;0278\nphinthuthai;0E3A\nphisymbolgreek;03D5\nphook;01A5\nphophanthai;0E1E\nphophungthai;0E1C\nphosamphaothai;0E20\npi;03C0\npieupacirclekorean;3273\npieupaparenkorean;3213\npieupcieuckorean;3176\npieupcirclekorean;3265\npieupkiyeokkorean;3172\npieupkorean;3142\npieupparenkorean;3205\npieupsioskiyeokkorean;3174\npieupsioskorean;3144\npieupsiostikeutkorean;3175\npieupthieuthkorean;3177\npieuptikeutkorean;3173\npihiragana;3074\npikatakana;30D4\npisymbolgreek;03D6\npiwrarmenian;0583\nplus;002B\nplusbelowcmb;031F\npluscircle;2295\nplusminus;00B1\nplusmod;02D6\nplusmonospace;FF0B\nplussmall;FE62\nplussuperior;207A\npmonospace;FF50\npmsquare;33D8\npohiragana;307D\npointingindexdownwhite;261F\npointingindexleftwhite;261C\npointingindexrightwhite;261E\npointingindexupwhite;261D\npokatakana;30DD\npoplathai;0E1B\npostalmark;3012\npostalmarkface;3020\npparen;24AB\nprecedes;227A\nprescription;211E\nprimemod;02B9\nprimereversed;2035\nproduct;220F\nprojective;2305\nprolongedkana;30FC\npropellor;2318\npropersubset;2282\npropersuperset;2283\nproportion;2237\nproportional;221D\npsi;03C8\npsicyrillic;0471\npsilipneumatacyrilliccmb;0486\npssquare;33B0\npuhiragana;3077\npukatakana;30D7\npvsquare;33B4\npwsquare;33BA\nq;0071\nqadeva;0958\nqadmahebrew;05A8\nqafarabic;0642\nqaffinalarabic;FED6\nqafinitialarabic;FED7\nqafmedialarabic;FED8\nqamats;05B8\nqamats10;05B8\nqamats1a;05B8\nqamats1c;05B8\nqamats27;05B8\nqamats29;05B8\nqamats33;05B8\nqamatsde;05B8\nqamatshebrew;05B8\nqamatsnarrowhebrew;05B8\nqamatsqatanhebrew;05B8\nqamatsqatannarrowhebrew;05B8\nqamatsqatanquarterhebrew;05B8\nqamatsqatanwidehebrew;05B8\nqamatsquarterhebrew;05B8\nqamatswidehebrew;05B8\nqarneyparahebrew;059F\nqbopomofo;3111\nqcircle;24E0\nqhook;02A0\nqmonospace;FF51\nqof;05E7\nqofdagesh;FB47\nqofdageshhebrew;FB47\nqofhatafpatah;05E7 05B2\nqofhatafpatahhebrew;05E7 05B2\nqofhatafsegol;05E7 05B1\nqofhatafsegolhebrew;05E7 05B1\nqofhebrew;05E7\nqofhiriq;05E7 05B4\nqofhiriqhebrew;05E7 05B4\nqofholam;05E7 05B9\nqofholamhebrew;05E7 05B9\nqofpatah;05E7 05B7\nqofpatahhebrew;05E7 05B7\nqofqamats;05E7 05B8\nqofqamatshebrew;05E7 05B8\nqofqubuts;05E7 05BB\nqofqubutshebrew;05E7 05BB\nqofsegol;05E7 05B6\nqofsegolhebrew;05E7 05B6\nqofsheva;05E7 05B0\nqofshevahebrew;05E7 05B0\nqoftsere;05E7 05B5\nqoftserehebrew;05E7 05B5\nqparen;24AC\nquarternote;2669\nqubuts;05BB\nqubuts18;05BB\nqubuts25;05BB\nqubuts31;05BB\nqubutshebrew;05BB\nqubutsnarrowhebrew;05BB\nqubutsquarterhebrew;05BB\nqubutswidehebrew;05BB\nquestion;003F\nquestionarabic;061F\nquestionarmenian;055E\nquestiondown;00BF\nquestiondownsmall;F7BF\nquestiongreek;037E\nquestionmonospace;FF1F\nquestionsmall;F73F\nquotedbl;0022\nquotedblbase;201E\nquotedblleft;201C\nquotedblmonospace;FF02\nquotedblprime;301E\nquotedblprimereversed;301D\nquotedblright;201D\nquoteleft;2018\nquoteleftreversed;201B\nquotereversed;201B\nquoteright;2019\nquoterightn;0149\nquotesinglbase;201A\nquotesingle;0027\nquotesinglemonospace;FF07\nr;0072\nraarmenian;057C\nrabengali;09B0\nracute;0155\nradeva;0930\nradical;221A\nradicalex;F8E5\nradoverssquare;33AE\nradoverssquaredsquare;33AF\nradsquare;33AD\nrafe;05BF\nrafehebrew;05BF\nragujarati;0AB0\nragurmukhi;0A30\nrahiragana;3089\nrakatakana;30E9\nrakatakanahalfwidth;FF97\nralowerdiagonalbengali;09F1\nramiddlediagonalbengali;09F0\nramshorn;0264\nratio;2236\nrbopomofo;3116\nrcaron;0159\nrcedilla;0157\nrcircle;24E1\nrcommaaccent;0157\nrdblgrave;0211\nrdotaccent;1E59\nrdotbelow;1E5B\nrdotbelowmacron;1E5D\nreferencemark;203B\nreflexsubset;2286\nreflexsuperset;2287\nregistered;00AE\nregistersans;F8E8\nregisterserif;F6DA\nreharabic;0631\nreharmenian;0580\nrehfinalarabic;FEAE\nrehiragana;308C\nrehyehaleflamarabic;0631 FEF3 FE8E 0644\nrekatakana;30EC\nrekatakanahalfwidth;FF9A\nresh;05E8\nreshdageshhebrew;FB48\nreshhatafpatah;05E8 05B2\nreshhatafpatahhebrew;05E8 05B2\nreshhatafsegol;05E8 05B1\nreshhatafsegolhebrew;05E8 05B1\nreshhebrew;05E8\nreshhiriq;05E8 05B4\nreshhiriqhebrew;05E8 05B4\nreshholam;05E8 05B9\nreshholamhebrew;05E8 05B9\nreshpatah;05E8 05B7\nreshpatahhebrew;05E8 05B7\nreshqamats;05E8 05B8\nreshqamatshebrew;05E8 05B8\nreshqubuts;05E8 05BB\nreshqubutshebrew;05E8 05BB\nreshsegol;05E8 05B6\nreshsegolhebrew;05E8 05B6\nreshsheva;05E8 05B0\nreshshevahebrew;05E8 05B0\nreshtsere;05E8 05B5\nreshtserehebrew;05E8 05B5\nreversedtilde;223D\nreviahebrew;0597\nreviamugrashhebrew;0597\nrevlogicalnot;2310\nrfishhook;027E\nrfishhookreversed;027F\nrhabengali;09DD\nrhadeva;095D\nrho;03C1\nrhook;027D\nrhookturned;027B\nrhookturnedsuperior;02B5\nrhosymbolgreek;03F1\nrhotichookmod;02DE\nrieulacirclekorean;3271\nrieulaparenkorean;3211\nrieulcirclekorean;3263\nrieulhieuhkorean;3140\nrieulkiyeokkorean;313A\nrieulkiyeoksioskorean;3169\nrieulkorean;3139\nrieulmieumkorean;313B\nrieulpansioskorean;316C\nrieulparenkorean;3203\nrieulphieuphkorean;313F\nrieulpieupkorean;313C\nrieulpieupsioskorean;316B\nrieulsioskorean;313D\nrieulthieuthkorean;313E\nrieultikeutkorean;316A\nrieulyeorinhieuhkorean;316D\nrightangle;221F\nrighttackbelowcmb;0319\nrighttriangle;22BF\nrihiragana;308A\nrikatakana;30EA\nrikatakanahalfwidth;FF98\nring;02DA\nringbelowcmb;0325\nringcmb;030A\nringhalfleft;02BF\nringhalfleftarmenian;0559\nringhalfleftbelowcmb;031C\nringhalfleftcentered;02D3\nringhalfright;02BE\nringhalfrightbelowcmb;0339\nringhalfrightcentered;02D2\nrinvertedbreve;0213\nrittorusquare;3351\nrlinebelow;1E5F\nrlongleg;027C\nrlonglegturned;027A\nrmonospace;FF52\nrohiragana;308D\nrokatakana;30ED\nrokatakanahalfwidth;FF9B\nroruathai;0E23\nrparen;24AD\nrrabengali;09DC\nrradeva;0931\nrragurmukhi;0A5C\nrreharabic;0691\nrrehfinalarabic;FB8D\nrrvocalicbengali;09E0\nrrvocalicdeva;0960\nrrvocalicgujarati;0AE0\nrrvocalicvowelsignbengali;09C4\nrrvocalicvowelsigndeva;0944\nrrvocalicvowelsigngujarati;0AC4\nrsuperior;F6F1\nrtblock;2590\nrturned;0279\nrturnedsuperior;02B4\nruhiragana;308B\nrukatakana;30EB\nrukatakanahalfwidth;FF99\nrupeemarkbengali;09F2\nrupeesignbengali;09F3\nrupiah;F6DD\nruthai;0E24\nrvocalicbengali;098B\nrvocalicdeva;090B\nrvocalicgujarati;0A8B\nrvocalicvowelsignbengali;09C3\nrvocalicvowelsigndeva;0943\nrvocalicvowelsigngujarati;0AC3\ns;0073\nsabengali;09B8\nsacute;015B\nsacutedotaccent;1E65\nsadarabic;0635\nsadeva;0938\nsadfinalarabic;FEBA\nsadinitialarabic;FEBB\nsadmedialarabic;FEBC\nsagujarati;0AB8\nsagurmukhi;0A38\nsahiragana;3055\nsakatakana;30B5\nsakatakanahalfwidth;FF7B\nsallallahoualayhewasallamarabic;FDFA\nsamekh;05E1\nsamekhdagesh;FB41\nsamekhdageshhebrew;FB41\nsamekhhebrew;05E1\nsaraaathai;0E32\nsaraaethai;0E41\nsaraaimaimalaithai;0E44\nsaraaimaimuanthai;0E43\nsaraamthai;0E33\nsaraathai;0E30\nsaraethai;0E40\nsaraiileftthai;F886\nsaraiithai;0E35\nsaraileftthai;F885\nsaraithai;0E34\nsaraothai;0E42\nsaraueeleftthai;F888\nsaraueethai;0E37\nsaraueleftthai;F887\nsarauethai;0E36\nsarauthai;0E38\nsarauuthai;0E39\nsbopomofo;3119\nscaron;0161\nscarondotaccent;1E67\nscedilla;015F\nschwa;0259\nschwacyrillic;04D9\nschwadieresiscyrillic;04DB\nschwahook;025A\nscircle;24E2\nscircumflex;015D\nscommaaccent;0219\nsdotaccent;1E61\nsdotbelow;1E63\nsdotbelowdotaccent;1E69\nseagullbelowcmb;033C\nsecond;2033\nsecondtonechinese;02CA\nsection;00A7\nseenarabic;0633\nseenfinalarabic;FEB2\nseeninitialarabic;FEB3\nseenmedialarabic;FEB4\nsegol;05B6\nsegol13;05B6\nsegol1f;05B6\nsegol2c;05B6\nsegolhebrew;05B6\nsegolnarrowhebrew;05B6\nsegolquarterhebrew;05B6\nsegoltahebrew;0592\nsegolwidehebrew;05B6\nseharmenian;057D\nsehiragana;305B\nsekatakana;30BB\nsekatakanahalfwidth;FF7E\nsemicolon;003B\nsemicolonarabic;061B\nsemicolonmonospace;FF1B\nsemicolonsmall;FE54\nsemivoicedmarkkana;309C\nsemivoicedmarkkanahalfwidth;FF9F\nsentisquare;3322\nsentosquare;3323\nseven;0037\nsevenarabic;0667\nsevenbengali;09ED\nsevencircle;2466\nsevencircleinversesansserif;2790\nsevendeva;096D\nseveneighths;215E\nsevengujarati;0AED\nsevengurmukhi;0A6D\nsevenhackarabic;0667\nsevenhangzhou;3027\nsevenideographicparen;3226\nseveninferior;2087\nsevenmonospace;FF17\nsevenoldstyle;F737\nsevenparen;247A\nsevenperiod;248E\nsevenpersian;06F7\nsevenroman;2176\nsevensuperior;2077\nseventeencircle;2470\nseventeenparen;2484\nseventeenperiod;2498\nseventhai;0E57\nsfthyphen;00AD\nshaarmenian;0577\nshabengali;09B6\nshacyrillic;0448\nshaddaarabic;0651\nshaddadammaarabic;FC61\nshaddadammatanarabic;FC5E\nshaddafathaarabic;FC60\nshaddafathatanarabic;0651 064B\nshaddakasraarabic;FC62\nshaddakasratanarabic;FC5F\nshade;2592\nshadedark;2593\nshadelight;2591\nshademedium;2592\nshadeva;0936\nshagujarati;0AB6\nshagurmukhi;0A36\nshalshelethebrew;0593\nshbopomofo;3115\nshchacyrillic;0449\nsheenarabic;0634\nsheenfinalarabic;FEB6\nsheeninitialarabic;FEB7\nsheenmedialarabic;FEB8\nsheicoptic;03E3\nsheqel;20AA\nsheqelhebrew;20AA\nsheva;05B0\nsheva115;05B0\nsheva15;05B0\nsheva22;05B0\nsheva2e;05B0\nshevahebrew;05B0\nshevanarrowhebrew;05B0\nshevaquarterhebrew;05B0\nshevawidehebrew;05B0\nshhacyrillic;04BB\nshimacoptic;03ED\nshin;05E9\nshindagesh;FB49\nshindageshhebrew;FB49\nshindageshshindot;FB2C\nshindageshshindothebrew;FB2C\nshindageshsindot;FB2D\nshindageshsindothebrew;FB2D\nshindothebrew;05C1\nshinhebrew;05E9\nshinshindot;FB2A\nshinshindothebrew;FB2A\nshinsindot;FB2B\nshinsindothebrew;FB2B\nshook;0282\nsigma;03C3\nsigma1;03C2\nsigmafinal;03C2\nsigmalunatesymbolgreek;03F2\nsihiragana;3057\nsikatakana;30B7\nsikatakanahalfwidth;FF7C\nsiluqhebrew;05BD\nsiluqlefthebrew;05BD\nsimilar;223C\nsindothebrew;05C2\nsiosacirclekorean;3274\nsiosaparenkorean;3214\nsioscieuckorean;317E\nsioscirclekorean;3266\nsioskiyeokkorean;317A\nsioskorean;3145\nsiosnieunkorean;317B\nsiosparenkorean;3206\nsiospieupkorean;317D\nsiostikeutkorean;317C\nsix;0036\nsixarabic;0666\nsixbengali;09EC\nsixcircle;2465\nsixcircleinversesansserif;278F\nsixdeva;096C\nsixgujarati;0AEC\nsixgurmukhi;0A6C\nsixhackarabic;0666\nsixhangzhou;3026\nsixideographicparen;3225\nsixinferior;2086\nsixmonospace;FF16\nsixoldstyle;F736\nsixparen;2479\nsixperiod;248D\nsixpersian;06F6\nsixroman;2175\nsixsuperior;2076\nsixteencircle;246F\nsixteencurrencydenominatorbengali;09F9\nsixteenparen;2483\nsixteenperiod;2497\nsixthai;0E56\nslash;002F\nslashmonospace;FF0F\nslong;017F\nslongdotaccent;1E9B\nsmileface;263A\nsmonospace;FF53\nsofpasuqhebrew;05C3\nsofthyphen;00AD\nsoftsigncyrillic;044C\nsohiragana;305D\nsokatakana;30BD\nsokatakanahalfwidth;FF7F\nsoliduslongoverlaycmb;0338\nsolidusshortoverlaycmb;0337\nsorusithai;0E29\nsosalathai;0E28\nsosothai;0E0B\nsosuathai;0E2A\nspace;0020\nspacehackarabic;0020\nspade;2660\nspadesuitblack;2660\nspadesuitwhite;2664\nsparen;24AE\nsquarebelowcmb;033B\nsquarecc;33C4\nsquarecm;339D\nsquarediagonalcrosshatchfill;25A9\nsquarehorizontalfill;25A4\nsquarekg;338F\nsquarekm;339E\nsquarekmcapital;33CE\nsquareln;33D1\nsquarelog;33D2\nsquaremg;338E\nsquaremil;33D5\nsquaremm;339C\nsquaremsquared;33A1\nsquareorthogonalcrosshatchfill;25A6\nsquareupperlefttolowerrightfill;25A7\nsquareupperrighttolowerleftfill;25A8\nsquareverticalfill;25A5\nsquarewhitewithsmallblack;25A3\nsrsquare;33DB\nssabengali;09B7\nssadeva;0937\nssagujarati;0AB7\nssangcieuckorean;3149\nssanghieuhkorean;3185\nssangieungkorean;3180\nssangkiyeokkorean;3132\nssangnieunkorean;3165\nssangpieupkorean;3143\nssangsioskorean;3146\nssangtikeutkorean;3138\nssuperior;F6F2\nsterling;00A3\nsterlingmonospace;FFE1\nstrokelongoverlaycmb;0336\nstrokeshortoverlaycmb;0335\nsubset;2282\nsubsetnotequal;228A\nsubsetorequal;2286\nsucceeds;227B\nsuchthat;220B\nsuhiragana;3059\nsukatakana;30B9\nsukatakanahalfwidth;FF7D\nsukunarabic;0652\nsummation;2211\nsun;263C\nsuperset;2283\nsupersetnotequal;228B\nsupersetorequal;2287\nsvsquare;33DC\nsyouwaerasquare;337C\nt;0074\ntabengali;09A4\ntackdown;22A4\ntackleft;22A3\ntadeva;0924\ntagujarati;0AA4\ntagurmukhi;0A24\ntaharabic;0637\ntahfinalarabic;FEC2\ntahinitialarabic;FEC3\ntahiragana;305F\ntahmedialarabic;FEC4\ntaisyouerasquare;337D\ntakatakana;30BF\ntakatakanahalfwidth;FF80\ntatweelarabic;0640\ntau;03C4\ntav;05EA\ntavdages;FB4A\ntavdagesh;FB4A\ntavdageshhebrew;FB4A\ntavhebrew;05EA\ntbar;0167\ntbopomofo;310A\ntcaron;0165\ntccurl;02A8\ntcedilla;0163\ntcheharabic;0686\ntchehfinalarabic;FB7B\ntchehinitialarabic;FB7C\ntchehmedialarabic;FB7D\ntchehmeeminitialarabic;FB7C FEE4\ntcircle;24E3\ntcircumflexbelow;1E71\ntcommaaccent;0163\ntdieresis;1E97\ntdotaccent;1E6B\ntdotbelow;1E6D\ntecyrillic;0442\ntedescendercyrillic;04AD\nteharabic;062A\ntehfinalarabic;FE96\ntehhahinitialarabic;FCA2\ntehhahisolatedarabic;FC0C\ntehinitialarabic;FE97\ntehiragana;3066\ntehjeeminitialarabic;FCA1\ntehjeemisolatedarabic;FC0B\ntehmarbutaarabic;0629\ntehmarbutafinalarabic;FE94\ntehmedialarabic;FE98\ntehmeeminitialarabic;FCA4\ntehmeemisolatedarabic;FC0E\ntehnoonfinalarabic;FC73\ntekatakana;30C6\ntekatakanahalfwidth;FF83\ntelephone;2121\ntelephoneblack;260E\ntelishagedolahebrew;05A0\ntelishaqetanahebrew;05A9\ntencircle;2469\ntenideographicparen;3229\ntenparen;247D\ntenperiod;2491\ntenroman;2179\ntesh;02A7\ntet;05D8\ntetdagesh;FB38\ntetdageshhebrew;FB38\ntethebrew;05D8\ntetsecyrillic;04B5\ntevirhebrew;059B\ntevirlefthebrew;059B\nthabengali;09A5\nthadeva;0925\nthagujarati;0AA5\nthagurmukhi;0A25\nthalarabic;0630\nthalfinalarabic;FEAC\nthanthakhatlowleftthai;F898\nthanthakhatlowrightthai;F897\nthanthakhatthai;0E4C\nthanthakhatupperleftthai;F896\ntheharabic;062B\nthehfinalarabic;FE9A\nthehinitialarabic;FE9B\nthehmedialarabic;FE9C\nthereexists;2203\ntherefore;2234\ntheta;03B8\ntheta1;03D1\nthetasymbolgreek;03D1\nthieuthacirclekorean;3279\nthieuthaparenkorean;3219\nthieuthcirclekorean;326B\nthieuthkorean;314C\nthieuthparenkorean;320B\nthirteencircle;246C\nthirteenparen;2480\nthirteenperiod;2494\nthonangmonthothai;0E11\nthook;01AD\nthophuthaothai;0E12\nthorn;00FE\nthothahanthai;0E17\nthothanthai;0E10\nthothongthai;0E18\nthothungthai;0E16\nthousandcyrillic;0482\nthousandsseparatorarabic;066C\nthousandsseparatorpersian;066C\nthree;0033\nthreearabic;0663\nthreebengali;09E9\nthreecircle;2462\nthreecircleinversesansserif;278C\nthreedeva;0969\nthreeeighths;215C\nthreegujarati;0AE9\nthreegurmukhi;0A69\nthreehackarabic;0663\nthreehangzhou;3023\nthreeideographicparen;3222\nthreeinferior;2083\nthreemonospace;FF13\nthreenumeratorbengali;09F6\nthreeoldstyle;F733\nthreeparen;2476\nthreeperiod;248A\nthreepersian;06F3\nthreequarters;00BE\nthreequartersemdash;F6DE\nthreeroman;2172\nthreesuperior;00B3\nthreethai;0E53\nthzsquare;3394\ntihiragana;3061\ntikatakana;30C1\ntikatakanahalfwidth;FF81\ntikeutacirclekorean;3270\ntikeutaparenkorean;3210\ntikeutcirclekorean;3262\ntikeutkorean;3137\ntikeutparenkorean;3202\ntilde;02DC\ntildebelowcmb;0330\ntildecmb;0303\ntildecomb;0303\ntildedoublecmb;0360\ntildeoperator;223C\ntildeoverlaycmb;0334\ntildeverticalcmb;033E\ntimescircle;2297\ntipehahebrew;0596\ntipehalefthebrew;0596\ntippigurmukhi;0A70\ntitlocyrilliccmb;0483\ntiwnarmenian;057F\ntlinebelow;1E6F\ntmonospace;FF54\ntoarmenian;0569\ntohiragana;3068\ntokatakana;30C8\ntokatakanahalfwidth;FF84\ntonebarextrahighmod;02E5\ntonebarextralowmod;02E9\ntonebarhighmod;02E6\ntonebarlowmod;02E8\ntonebarmidmod;02E7\ntonefive;01BD\ntonesix;0185\ntonetwo;01A8\ntonos;0384\ntonsquare;3327\ntopatakthai;0E0F\ntortoiseshellbracketleft;3014\ntortoiseshellbracketleftsmall;FE5D\ntortoiseshellbracketleftvertical;FE39\ntortoiseshellbracketright;3015\ntortoiseshellbracketrightsmall;FE5E\ntortoiseshellbracketrightvertical;FE3A\ntotaothai;0E15\ntpalatalhook;01AB\ntparen;24AF\ntrademark;2122\ntrademarksans;F8EA\ntrademarkserif;F6DB\ntretroflexhook;0288\ntriagdn;25BC\ntriaglf;25C4\ntriagrt;25BA\ntriagup;25B2\nts;02A6\ntsadi;05E6\ntsadidagesh;FB46\ntsadidageshhebrew;FB46\ntsadihebrew;05E6\ntsecyrillic;0446\ntsere;05B5\ntsere12;05B5\ntsere1e;05B5\ntsere2b;05B5\ntserehebrew;05B5\ntserenarrowhebrew;05B5\ntserequarterhebrew;05B5\ntserewidehebrew;05B5\ntshecyrillic;045B\ntsuperior;F6F3\nttabengali;099F\nttadeva;091F\nttagujarati;0A9F\nttagurmukhi;0A1F\ntteharabic;0679\nttehfinalarabic;FB67\nttehinitialarabic;FB68\nttehmedialarabic;FB69\ntthabengali;09A0\ntthadeva;0920\ntthagujarati;0AA0\ntthagurmukhi;0A20\ntturned;0287\ntuhiragana;3064\ntukatakana;30C4\ntukatakanahalfwidth;FF82\ntusmallhiragana;3063\ntusmallkatakana;30C3\ntusmallkatakanahalfwidth;FF6F\ntwelvecircle;246B\ntwelveparen;247F\ntwelveperiod;2493\ntwelveroman;217B\ntwentycircle;2473\ntwentyhangzhou;5344\ntwentyparen;2487\ntwentyperiod;249B\ntwo;0032\ntwoarabic;0662\ntwobengali;09E8\ntwocircle;2461\ntwocircleinversesansserif;278B\ntwodeva;0968\ntwodotenleader;2025\ntwodotleader;2025\ntwodotleadervertical;FE30\ntwogujarati;0AE8\ntwogurmukhi;0A68\ntwohackarabic;0662\ntwohangzhou;3022\ntwoideographicparen;3221\ntwoinferior;2082\ntwomonospace;FF12\ntwonumeratorbengali;09F5\ntwooldstyle;F732\ntwoparen;2475\ntwoperiod;2489\ntwopersian;06F2\ntworoman;2171\ntwostroke;01BB\ntwosuperior;00B2\ntwothai;0E52\ntwothirds;2154\nu;0075\nuacute;00FA\nubar;0289\nubengali;0989\nubopomofo;3128\nubreve;016D\nucaron;01D4\nucircle;24E4\nucircumflex;00FB\nucircumflexbelow;1E77\nucyrillic;0443\nudattadeva;0951\nudblacute;0171\nudblgrave;0215\nudeva;0909\nudieresis;00FC\nudieresisacute;01D8\nudieresisbelow;1E73\nudieresiscaron;01DA\nudieresiscyrillic;04F1\nudieresisgrave;01DC\nudieresismacron;01D6\nudotbelow;1EE5\nugrave;00F9\nugujarati;0A89\nugurmukhi;0A09\nuhiragana;3046\nuhookabove;1EE7\nuhorn;01B0\nuhornacute;1EE9\nuhorndotbelow;1EF1\nuhorngrave;1EEB\nuhornhookabove;1EED\nuhorntilde;1EEF\nuhungarumlaut;0171\nuhungarumlautcyrillic;04F3\nuinvertedbreve;0217\nukatakana;30A6\nukatakanahalfwidth;FF73\nukcyrillic;0479\nukorean;315C\numacron;016B\numacroncyrillic;04EF\numacrondieresis;1E7B\numatragurmukhi;0A41\numonospace;FF55\nunderscore;005F\nunderscoredbl;2017\nunderscoremonospace;FF3F\nunderscorevertical;FE33\nunderscorewavy;FE4F\nunion;222A\nuniversal;2200\nuogonek;0173\nuparen;24B0\nupblock;2580\nupperdothebrew;05C4\nupsilon;03C5\nupsilondieresis;03CB\nupsilondieresistonos;03B0\nupsilonlatin;028A\nupsilontonos;03CD\nuptackbelowcmb;031D\nuptackmod;02D4\nuragurmukhi;0A73\nuring;016F\nushortcyrillic;045E\nusmallhiragana;3045\nusmallkatakana;30A5\nusmallkatakanahalfwidth;FF69\nustraightcyrillic;04AF\nustraightstrokecyrillic;04B1\nutilde;0169\nutildeacute;1E79\nutildebelow;1E75\nuubengali;098A\nuudeva;090A\nuugujarati;0A8A\nuugurmukhi;0A0A\nuumatragurmukhi;0A42\nuuvowelsignbengali;09C2\nuuvowelsigndeva;0942\nuuvowelsigngujarati;0AC2\nuvowelsignbengali;09C1\nuvowelsigndeva;0941\nuvowelsigngujarati;0AC1\nv;0076\nvadeva;0935\nvagujarati;0AB5\nvagurmukhi;0A35\nvakatakana;30F7\nvav;05D5\nvavdagesh;FB35\nvavdagesh65;FB35\nvavdageshhebrew;FB35\nvavhebrew;05D5\nvavholam;FB4B\nvavholamhebrew;FB4B\nvavvavhebrew;05F0\nvavyodhebrew;05F1\nvcircle;24E5\nvdotbelow;1E7F\nvecyrillic;0432\nveharabic;06A4\nvehfinalarabic;FB6B\nvehinitialarabic;FB6C\nvehmedialarabic;FB6D\nvekatakana;30F9\nvenus;2640\nverticalbar;007C\nverticallineabovecmb;030D\nverticallinebelowcmb;0329\nverticallinelowmod;02CC\nverticallinemod;02C8\nvewarmenian;057E\nvhook;028B\nvikatakana;30F8\nviramabengali;09CD\nviramadeva;094D\nviramagujarati;0ACD\nvisargabengali;0983\nvisargadeva;0903\nvisargagujarati;0A83\nvmonospace;FF56\nvoarmenian;0578\nvoicediterationhiragana;309E\nvoicediterationkatakana;30FE\nvoicedmarkkana;309B\nvoicedmarkkanahalfwidth;FF9E\nvokatakana;30FA\nvparen;24B1\nvtilde;1E7D\nvturned;028C\nvuhiragana;3094\nvukatakana;30F4\nw;0077\nwacute;1E83\nwaekorean;3159\nwahiragana;308F\nwakatakana;30EF\nwakatakanahalfwidth;FF9C\nwakorean;3158\nwasmallhiragana;308E\nwasmallkatakana;30EE\nwattosquare;3357\nwavedash;301C\nwavyunderscorevertical;FE34\nwawarabic;0648\nwawfinalarabic;FEEE\nwawhamzaabovearabic;0624\nwawhamzaabovefinalarabic;FE86\nwbsquare;33DD\nwcircle;24E6\nwcircumflex;0175\nwdieresis;1E85\nwdotaccent;1E87\nwdotbelow;1E89\nwehiragana;3091\nweierstrass;2118\nwekatakana;30F1\nwekorean;315E\nweokorean;315D\nwgrave;1E81\nwhitebullet;25E6\nwhitecircle;25CB\nwhitecircleinverse;25D9\nwhitecornerbracketleft;300E\nwhitecornerbracketleftvertical;FE43\nwhitecornerbracketright;300F\nwhitecornerbracketrightvertical;FE44\nwhitediamond;25C7\nwhitediamondcontainingblacksmalldiamond;25C8\nwhitedownpointingsmalltriangle;25BF\nwhitedownpointingtriangle;25BD\nwhiteleftpointingsmalltriangle;25C3\nwhiteleftpointingtriangle;25C1\nwhitelenticularbracketleft;3016\nwhitelenticularbracketright;3017\nwhiterightpointingsmalltriangle;25B9\nwhiterightpointingtriangle;25B7\nwhitesmallsquare;25AB\nwhitesmilingface;263A\nwhitesquare;25A1\nwhitestar;2606\nwhitetelephone;260F\nwhitetortoiseshellbracketleft;3018\nwhitetortoiseshellbracketright;3019\nwhiteuppointingsmalltriangle;25B5\nwhiteuppointingtriangle;25B3\nwihiragana;3090\nwikatakana;30F0\nwikorean;315F\nwmonospace;FF57\nwohiragana;3092\nwokatakana;30F2\nwokatakanahalfwidth;FF66\nwon;20A9\nwonmonospace;FFE6\nwowaenthai;0E27\nwparen;24B2\nwring;1E98\nwsuperior;02B7\nwturned;028D\nwynn;01BF\nx;0078\nxabovecmb;033D\nxbopomofo;3112\nxcircle;24E7\nxdieresis;1E8D\nxdotaccent;1E8B\nxeharmenian;056D\nxi;03BE\nxmonospace;FF58\nxparen;24B3\nxsuperior;02E3\ny;0079\nyaadosquare;334E\nyabengali;09AF\nyacute;00FD\nyadeva;092F\nyaekorean;3152\nyagujarati;0AAF\nyagurmukhi;0A2F\nyahiragana;3084\nyakatakana;30E4\nyakatakanahalfwidth;FF94\nyakorean;3151\nyamakkanthai;0E4E\nyasmallhiragana;3083\nyasmallkatakana;30E3\nyasmallkatakanahalfwidth;FF6C\nyatcyrillic;0463\nycircle;24E8\nycircumflex;0177\nydieresis;00FF\nydotaccent;1E8F\nydotbelow;1EF5\nyeharabic;064A\nyehbarreearabic;06D2\nyehbarreefinalarabic;FBAF\nyehfinalarabic;FEF2\nyehhamzaabovearabic;0626\nyehhamzaabovefinalarabic;FE8A\nyehhamzaaboveinitialarabic;FE8B\nyehhamzaabovemedialarabic;FE8C\nyehinitialarabic;FEF3\nyehmedialarabic;FEF4\nyehmeeminitialarabic;FCDD\nyehmeemisolatedarabic;FC58\nyehnoonfinalarabic;FC94\nyehthreedotsbelowarabic;06D1\nyekorean;3156\nyen;00A5\nyenmonospace;FFE5\nyeokorean;3155\nyeorinhieuhkorean;3186\nyerahbenyomohebrew;05AA\nyerahbenyomolefthebrew;05AA\nyericyrillic;044B\nyerudieresiscyrillic;04F9\nyesieungkorean;3181\nyesieungpansioskorean;3183\nyesieungsioskorean;3182\nyetivhebrew;059A\nygrave;1EF3\nyhook;01B4\nyhookabove;1EF7\nyiarmenian;0575\nyicyrillic;0457\nyikorean;3162\nyinyang;262F\nyiwnarmenian;0582\nymonospace;FF59\nyod;05D9\nyoddagesh;FB39\nyoddageshhebrew;FB39\nyodhebrew;05D9\nyodyodhebrew;05F2\nyodyodpatahhebrew;FB1F\nyohiragana;3088\nyoikorean;3189\nyokatakana;30E8\nyokatakanahalfwidth;FF96\nyokorean;315B\nyosmallhiragana;3087\nyosmallkatakana;30E7\nyosmallkatakanahalfwidth;FF6E\nyotgreek;03F3\nyoyaekorean;3188\nyoyakorean;3187\nyoyakthai;0E22\nyoyingthai;0E0D\nyparen;24B4\nypogegrammeni;037A\nypogegrammenigreekcmb;0345\nyr;01A6\nyring;1E99\nysuperior;02B8\nytilde;1EF9\nyturned;028E\nyuhiragana;3086\nyuikorean;318C\nyukatakana;30E6\nyukatakanahalfwidth;FF95\nyukorean;3160\nyusbigcyrillic;046B\nyusbigiotifiedcyrillic;046D\nyuslittlecyrillic;0467\nyuslittleiotifiedcyrillic;0469\nyusmallhiragana;3085\nyusmallkatakana;30E5\nyusmallkatakanahalfwidth;FF6D\nyuyekorean;318B\nyuyeokorean;318A\nyyabengali;09DF\nyyadeva;095F\nz;007A\nzaarmenian;0566\nzacute;017A\nzadeva;095B\nzagurmukhi;0A5B\nzaharabic;0638\nzahfinalarabic;FEC6\nzahinitialarabic;FEC7\nzahiragana;3056\nzahmedialarabic;FEC8\nzainarabic;0632\nzainfinalarabic;FEB0\nzakatakana;30B6\nzaqefgadolhebrew;0595\nzaqefqatanhebrew;0594\nzarqahebrew;0598\nzayin;05D6\nzayindagesh;FB36\nzayindageshhebrew;FB36\nzayinhebrew;05D6\nzbopomofo;3117\nzcaron;017E\nzcircle;24E9\nzcircumflex;1E91\nzcurl;0291\nzdot;017C\nzdotaccent;017C\nzdotbelow;1E93\nzecyrillic;0437\nzedescendercyrillic;0499\nzedieresiscyrillic;04DF\nzehiragana;305C\nzekatakana;30BC\nzero;0030\nzeroarabic;0660\nzerobengali;09E6\nzerodeva;0966\nzerogujarati;0AE6\nzerogurmukhi;0A66\nzerohackarabic;0660\nzeroinferior;2080\nzeromonospace;FF10\nzerooldstyle;F730\nzeropersian;06F0\nzerosuperior;2070\nzerothai;0E50\nzerowidthjoiner;FEFF\nzerowidthnonjoiner;200C\nzerowidthspace;200B\nzeta;03B6\nzhbopomofo;3113\nzhearmenian;056A\nzhebrevecyrillic;04C2\nzhecyrillic;0436\nzhedescendercyrillic;0497\nzhedieresiscyrillic;04DD\nzihiragana;3058\nzikatakana;30B8\nzinorhebrew;05AE\nzlinebelow;1E95\nzmonospace;FF5A\nzohiragana;305E\nzokatakana;30BE\nzparen;24B5\nzretroflexhook;0290\nzstroke;01B6\nzuhiragana;305A\nzukatakana;30BA\n#--end\n"
  },
  {
    "path": "mupdf/scripts/jpeg/jconfig.h",
    "content": "/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 95 or NT. */\n/* see jconfig.txt for explanations */\n\n#define HAVE_PROTOTYPES\n#define HAVE_UNSIGNED_CHAR\n#define HAVE_UNSIGNED_SHORT\n/* #define void char */\n/* #define const */\n#undef CHAR_IS_UNSIGNED\n#define HAVE_STDDEF_H\n#define HAVE_STDLIB_H\n#undef NEED_BSD_STRINGS\n#undef NEED_SYS_TYPES_H\n#undef NEED_FAR_POINTERS\t/* we presume a 32-bit flat memory model */\n#undef NEED_SHORT_EXTERNAL_NAMES\n#undef INCOMPLETE_TYPES_BROKEN\n\n/* Define \"boolean\" as unsigned char, not int, per Windows custom */\n#ifndef __RPCNDR_H__\t\t/* don't conflict if rpcndr.h already read */\ntypedef unsigned char boolean;\n#endif\n#define HAVE_BOOLEAN\t\t/* prevent jmorecfg.h from redefining it */\n\n\n#ifdef JPEG_INTERNALS\n\n#undef RIGHT_SHIFT_IS_UNSIGNED\n\n#endif /* JPEG_INTERNALS */\n\n#ifdef JPEG_CJPEG_DJPEG\n\n#define BMP_SUPPORTED\t\t/* BMP image file format */\n#define GIF_SUPPORTED\t\t/* GIF image file format */\n#define PPM_SUPPORTED\t\t/* PBMPLUS PPM/PGM image file format */\n#undef RLE_SUPPORTED\t\t/* Utah RLE image file format */\n#define TARGA_SUPPORTED\t\t/* Targa image file format */\n\n#define TWO_FILE_COMMANDLINE\t/* optional */\n#define USE_SETMODE\t\t/* Microsoft has setmode() */\n#undef NEED_SIGNAL_CATCHER\n#undef DONT_USE_B_MODE\n#undef PROGRESS_REPORT\t\t/* optional */\n\n#endif /* JPEG_CJPEG_DJPEG */\n"
  },
  {
    "path": "mupdf/scripts/openjpeg/opj_config.h",
    "content": "/* If you want to build the library manually without using\n * 'configure' or 'CMake'\n * then copy this file\n * 'opj_config.h.cmake.in'\n *\tto\n * 'opj_config.h'\n *\n * Open 'opj_config.h' and change the file contents\n * if you want to define something because you know you have\n * BOTH installed the library AND the header file(s).\n * Then e.g. write\n#define HAVE_LIBPNG 1\n *\n *\n * The file 'opj_config.h' will be included in some source files.\n * ==== YOU CAN NOT COMPILE WITHOUT IT. ====\n * === DO NOT FORGET TO CHANGE 'config.nix' APPROPRIATELY. ====\n*/\n#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__\n#define OPJ_BIG_ENDIAN 1\n#endif\n"
  },
  {
    "path": "mupdf/scripts/openjpeg/opj_config_private.h",
    "content": "/* If you want to build the library manually without using\n * 'configure' or 'CMake'\n * then copy this file\n * 'opj_config_private.h.cmake.in'\n *\tto\n * 'opj_config_private.h'\n *\n * Open 'opj_config_private.h' and change the file contents\n * if you want to define something because you know you have\n * BOTH installed the library AND the header file(s).\n * Then e.g. write\n#define HAVE_LIBPNG 1\n *\n *\n * The file 'opj_config_private.h' will be included in some source files.\n * ==== YOU CAN NOT COMPILE WITHOUT IT. ====\n * === DO NOT FORGET TO CHANGE 'config.nix' APPROPRIATELY. ====\n*/\n\n#ifndef _WIN32\n#define OPJ_HAVE_INTTYPES_H 1\n#else\n#undef OPJ_HAVE_INTTYPES_H\n#endif\n\n#define USE_JPIP\n#define OPJ_PACKAGE_VERSION \"2.0.0\"\n\n/* DO NOT DEFINE BOTH VERSIONS OF LCMS */\n/* define to 1 if you have both liblcms and lcms.h installed */\n#undef OPJ_HAVE_LIBLCMS1\n/* #define OPJ_HAVE_LIBLCMS1 1 */\n\n/* define to 1 if you have both liblcms2 and lcms2.h installed */\n#undef OPJ_HAVE_LIBLCMS2\n/* #define OPJ_HAVE_LIBLCMS2 1 */\n\n/* define to 1 if you have both libpng and png.h installed */\n#undef OPJ_HAVE_LIBPNG\n/* #define OPJ_HAVE_LIBPNG 1 */\n\n/* define to 1 if you have both libtiff and tiff.h installed */\n#undef OPJ_HAVE_LIBTIFF\n/* #define OPJ_HAVE_LIBTIFF 1 */\n\n/*---------------- DO NOT CHANGE BELOW THIS LINE ----------------*/\n#define PACKAGE_URL \"http://www.openjpeg.org/\"\n#define PACKAGE_BUGREPORT \"http://code.google.com/p/openjpeg/\"\n"
  },
  {
    "path": "mupdf/scripts/runtohtml.sh",
    "content": "#!/bin/bash\n\nrm -rf docs/browse\n\nFILES=$(find include source platform -name '*.[ch]')\n\necho running ctags to make xref\nctags -x $FILES > tags-xref\n\nfor input in $FILES\ndo\n\toutput=docs/browse/$input.html\n\tmkdir -p $(dirname $output)\n\techo $input $output\n\tpython scripts/tohtml.py < $input > $output\ndone\n\nrm tags-xref\n"
  },
  {
    "path": "mupdf/scripts/tohtml.py",
    "content": "import sys, os, re\n\nHEADER=\"\"\"<head>\n<style>\nbody { background-color:#fffff0; color:black; margin:16pt; }\na { text-decoration:none; color:darkblue; }\na.line { position:relative; padding-top:300px; }\n.comment { color:green; font-style:italic; }\n.comment a { color:darkgreen; }\n</style>\n</head>\n<body><pre><pre>\"\"\"\n\nFOOTER=\"\"\"</pre></body>\"\"\"\n\nprefixes = [ 'fz_', 'pdf_', 'xps_', 'cbz_', 'pdfapp_' ]\n\ndef is_public(s):\n\tfor prefix in prefixes:\n\t\tif s.startswith(prefix):\n\t\t\treturn True\n\treturn False\n\ndef load_tags():\n\ttags = {}\n\tfor line in open(\"tags-xref\").readlines():\n\t\tident, type, line, file, text = line.split(None, 4)\n\t\tif not is_public(ident):\n\t\t\tcontinue\n\t\tif type == 'function':\n\t\t\ttags[ident] = '<a class=\"function\" href=\"%s#%s\">%s</a>' % (\"/docs/browse/\" + file, line, ident)\n\t\tif type == 'typedef' or type == 'struct':\n\t\t\ttags[ident] = '<a class=\"typedef\" href=\"%s#%s\">%s</a>' % (\"/docs/browse/\" + file, line, ident)\n\treturn tags\n\ntags = load_tags()\n\ndef quote(s):\n\treturn s.replace('&','&amp;').replace('<','&lt;').replace('>','&gt;')\n\nprint HEADER\n\nN = 1\nfor line in sys.stdin.readlines():\n\t# expand tabs, html-quote special characters and colorize comments\n\tline = line.replace('\\t', '    ').rstrip()\n\tline = quote(line)\n\tline = line.replace(\"/*\", '<span class=\"comment\">/*')\n\tline = line.replace(\"*/\", '*/</span>')\n\n\tline = re.sub('^#include \"([a-z-/]*\\.h)\"', '#include \"<a href=\"/docs/browse/include/\\\\1\">\\\\1</a>\"', line)\n\n\t# find identifiers and hyperlink to their definitions\n\twords = re.split(\"(\\W+)\", line)\n\tline = \"\"\n\tfor word in words:\n\t\tif word in tags:\n\t\t\tword = tags[word]\n\t\tline += word\n\n\t#print('<a class=\"line\" name=\"%d\">%4d</a> %s' % (N, N, line))\n\tprint('<a class=\"line\" name=\"%d\"></a>%s' % (N, line))\n\n\tN = N + 1\n\nprint FOOTER\n"
  },
  {
    "path": "mupdf/source/cbz/mucbz.c",
    "content": "#include \"mupdf/cbz.h\"\n\n#define DPI 72.0f\n\nstatic void cbz_init_document(cbz_document *doc);\n\nstatic const char *cbz_ext_list[] = {\n\t\".jpg\", \".jpeg\", \".png\",\n\t\".JPG\", \".JPEG\", \".PNG\",\n\tNULL\n};\n\nstruct cbz_page_s\n{\n\tfz_image *image;\n};\n\nstruct cbz_document_s\n{\n\tfz_document super;\n\tfz_context *ctx;\n\tfz_archive *zip;\n\tint page_count;\n\tconst char **page;\n};\n\nstatic inline int cbz_isdigit(int c)\n{\n\treturn c >= '0' && c <= '9';\n}\n\nstatic inline int cbz_toupper(int c)\n{\n\tif (c >= 'a' && c <= 'z')\n\t\treturn c - 'a' + 'A';\n\treturn c;\n}\n\nstatic inline int\ncbz_strnatcmp(const char *a, const char *b)\n{\n\tint x, y;\n\n\twhile (*a || *b)\n\t{\n\t\tif (cbz_isdigit(*a) && cbz_isdigit(*b))\n\t\t{\n\t\t\tx = *a++ - '0';\n\t\t\twhile (cbz_isdigit(*a))\n\t\t\t\tx = x * 10 + *a++ - '0';\n\t\t\ty = *b++ - '0';\n\t\t\twhile (cbz_isdigit(*b))\n\t\t\t\ty = y * 10 + *b++ - '0';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tx = cbz_toupper(*a++);\n\t\t\ty = cbz_toupper(*b++);\n\t\t}\n\t\tif (x < y)\n\t\t\treturn -1;\n\t\tif (x > y)\n\t\t\treturn 1;\n\t}\n\n\treturn 0;\n}\n\nstatic int\ncbz_compare_page_names(const void *a, const void *b)\n{\n\treturn cbz_strnatcmp(*(const char **)a, *(const char **)b);\n}\n\nstatic void\ncbz_create_page_list(cbz_document *doc)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_archive *zip = doc->zip;\n\tint i, k, count;\n\n\tcount = fz_count_archive_entries(ctx, zip);\n\n\tdoc->page_count = 0;\n\tdoc->page = fz_malloc_array(ctx, count, sizeof *doc->page);\n\n\tfor (i = 0; i < count; i++)\n\t{\n\t\tfor (k = 0; cbz_ext_list[k]; k++)\n\t\t{\n\t\t\tconst char *name = fz_list_archive_entry(ctx, zip, i);\n\t\t\tif (strstr(name, cbz_ext_list[k]))\n\t\t\t{\n\t\t\t\tdoc->page[doc->page_count++] = name;\nprintf(\"found page %d = '%s'\\n\", i, name);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tqsort((char **)doc->page, doc->page_count, sizeof *doc->page, cbz_compare_page_names);\n\n\tfor (i = 0; i < doc->page_count; ++i)\n\t\tprintf(\"  %d = %s\\n\", i, doc->page[i]);\n}\n\ncbz_document *\ncbz_open_document_with_stream(fz_context *ctx, fz_stream *file)\n{\n\tcbz_document *doc;\n\n\tdoc = fz_malloc_struct(ctx, cbz_document);\n\tcbz_init_document(doc);\n\tdoc->ctx = ctx;\n\tdoc->page_count = 0;\n\tdoc->page = NULL;\n\n\tfz_try(ctx)\n\t{\n\t\tdoc->zip = fz_open_archive_with_stream(ctx, file);\n\t\tcbz_create_page_list(doc);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tcbz_close_document(doc);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn doc;\n}\n\ncbz_document *\ncbz_open_document(fz_context *ctx, const char *filename)\n{\n\tfz_stream *file;\n\tcbz_document *doc;\n\n\tfile = fz_open_file(ctx, filename);\n\tif (!file)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot open file '%s': %s\", filename, strerror(errno));\n\n\tfz_try(ctx)\n\t{\n\t\tdoc = cbz_open_document_with_stream(ctx, file);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(file);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn doc;\n}\n\nvoid\ncbz_close_document(cbz_document *doc)\n{\n\tfz_close_archive(doc->ctx, doc->zip);\n\tfz_free(doc->ctx, (char **)doc->page);\n\tfz_free(doc->ctx, doc);\n}\n\nint\ncbz_count_pages(cbz_document *doc)\n{\n\treturn doc->page_count;\n}\n\ncbz_page *\ncbz_load_page(cbz_document *doc, int number)\n{\n\tfz_context *ctx = doc->ctx;\n\tunsigned char *data = NULL;\n\tcbz_page *page = NULL;\n\tfz_buffer *buf;\n\n\tif (number < 0 || number >= doc->page_count)\n\t\treturn NULL;\n\n\tfz_var(data);\n\tfz_var(page);\n\n\tbuf = fz_read_archive_entry(doc->ctx, doc->zip, doc->page[number]);\n\tfz_try(ctx)\n\t{\n\t\tpage = fz_malloc_struct(ctx, cbz_page);\n\t\tpage->image = fz_new_image_from_buffer(ctx, buf);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_buffer(doc->ctx, buf);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, data);\n\t\tcbz_free_page(doc, page);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn page;\n}\n\nvoid\ncbz_free_page(cbz_document *doc, cbz_page *page)\n{\n\tif (!page)\n\t\treturn;\n\tfz_drop_image(doc->ctx, page->image);\n\tfz_free(doc->ctx, page);\n}\n\nfz_rect *\ncbz_bound_page(cbz_document *doc, cbz_page *page, fz_rect *bbox)\n{\n\tfz_image *image = page->image;\n\tbbox->x0 = bbox->y0 = 0;\n\tbbox->x1 = image->w * DPI / image->xres;\n\tbbox->y1 = image->h * DPI / image->yres;\n\treturn bbox;\n}\n\nvoid\ncbz_run_page(cbz_document *doc, cbz_page *page, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie)\n{\n\tfz_matrix local_ctm = *ctm;\n\tfz_image *image = page->image;\n\tfloat w = image->w * DPI / image->xres;\n\tfloat h = image->h * DPI / image->yres;\n\tfz_pre_scale(&local_ctm, w, h);\n\tfz_fill_image(dev, image, &local_ctm, 1);\n}\n\nstatic int\ncbz_meta(cbz_document *doc, int key, void *ptr, int size)\n{\n\tswitch (key)\n\t{\n\tcase FZ_META_FORMAT_INFO:\n\t\tsprintf((char *)ptr, \"CBZ\");\n\t\treturn FZ_META_OK;\n\tdefault:\n\t\treturn FZ_META_UNKNOWN_KEY;\n\t}\n}\n\nstatic void\ncbz_rebind(cbz_document *doc, fz_context *ctx)\n{\n\tdoc->ctx = ctx;\n\tfz_rebind_archive(doc->zip, ctx);\n}\n\nstatic void\ncbz_init_document(cbz_document *doc)\n{\n\tdoc->super.close = (fz_document_close_fn *)cbz_close_document;\n\tdoc->super.count_pages = (fz_document_count_pages_fn *)cbz_count_pages;\n\tdoc->super.load_page = (fz_document_load_page_fn *)cbz_load_page;\n\tdoc->super.bound_page = (fz_document_bound_page_fn *)cbz_bound_page;\n\tdoc->super.run_page_contents = (fz_document_run_page_contents_fn *)cbz_run_page;\n\tdoc->super.free_page = (fz_document_free_page_fn *)cbz_free_page;\n\tdoc->super.meta = (fz_document_meta_fn *)cbz_meta;\n\tdoc->super.rebind = (fz_document_rebind_fn *)cbz_rebind;\n}\n\nstatic int\ncbz_recognize(fz_context *doc, const char *magic)\n{\n\tchar *ext = strrchr(magic, '.');\n\n\tif (ext)\n\t{\n\t\tif (!fz_strcasecmp(ext, \".cbz\") || !fz_strcasecmp(ext, \".zip\"))\n\t\t\treturn 100;\n\t}\n\tif (!strcmp(magic, \"cbz\") || !strcmp(magic, \"application/x-cbz\"))\n\t\treturn 100;\n\n\treturn 0;\n}\n\nfz_document_handler cbz_document_handler =\n{\n\t(fz_document_recognize_fn *)&cbz_recognize,\n\t(fz_document_open_fn *)&cbz_open_document,\n\t(fz_document_open_with_stream_fn *)&cbz_open_document_with_stream\n};\n"
  },
  {
    "path": "mupdf/source/fitz/bbox-device.c",
    "content": "#include \"mupdf/fitz.h\"\n\n#define STACK_SIZE 96\n\ntypedef struct fz_bbox_data_s\n{\n\tfz_rect *result;\n\tint top;\n\tfz_rect stack[STACK_SIZE];\n\t/* mask content and tiles are ignored */\n\tint ignore;\n} fz_bbox_data;\n\nstatic void\nfz_bbox_add_rect(fz_device *dev, const fz_rect *rect, int clip)\n{\n\tfz_bbox_data *data = dev->user;\n\tfz_rect r = *rect;\n\n\tif (0 < data->top && data->top <= STACK_SIZE)\n\t{\n\t\tfz_intersect_rect(&r, &data->stack[data->top-1]);\n\t}\n\tif (!clip && data->top <= STACK_SIZE && !data->ignore)\n\t{\n\t\tfz_union_rect(data->result, &r);\n\t}\n\tif (clip && ++data->top <= STACK_SIZE)\n\t{\n\t\tdata->stack[data->top-1] = r;\n\t}\n}\n\nstatic void\nfz_bbox_fill_path(fz_device *dev, fz_path *path, int even_odd, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tfz_rect r;\n\tfz_bbox_add_rect(dev, fz_bound_path(dev->ctx, path, NULL, ctm, &r), 0);\n}\n\nstatic void\nfz_bbox_stroke_path(fz_device *dev, fz_path *path, fz_stroke_state *stroke,\n\tconst fz_matrix *ctm, fz_colorspace *colorspace, float *color, float alpha)\n{\n\tfz_rect r;\n\tfz_bbox_add_rect(dev, fz_bound_path(dev->ctx, path, stroke, ctm, &r), 0);\n}\n\nstatic void\nfz_bbox_fill_text(fz_device *dev, fz_text *text, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tfz_rect r;\n\tfz_bbox_add_rect(dev, fz_bound_text(dev->ctx, text, NULL, ctm, &r), 0);\n}\n\nstatic void\nfz_bbox_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke,\n\tconst fz_matrix *ctm, fz_colorspace *colorspace, float *color, float alpha)\n{\n\tfz_rect r;\n\tfz_bbox_add_rect(dev, fz_bound_text(dev->ctx, text, stroke, ctm, &r), 0);\n}\n\nstatic void\nfz_bbox_fill_shade(fz_device *dev, fz_shade *shade, const fz_matrix *ctm, float alpha)\n{\n\tfz_rect r;\n\tfz_bbox_add_rect(dev, fz_bound_shade(dev->ctx, shade, ctm, &r), 0);\n}\n\nstatic void\nfz_bbox_fill_image(fz_device *dev, fz_image *image, const fz_matrix *ctm, float alpha)\n{\n\tfz_rect r = fz_unit_rect;\n\tfz_bbox_add_rect(dev, fz_transform_rect(&r, ctm), 0);\n}\n\nstatic void\nfz_bbox_fill_image_mask(fz_device *dev, fz_image *image, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tfz_rect r = fz_unit_rect;\n\tfz_bbox_add_rect(dev, fz_transform_rect(&r, ctm), 0);\n}\n\nstatic void\nfz_bbox_clip_path(fz_device *dev, fz_path *path, const fz_rect *rect, int even_odd, const fz_matrix *ctm)\n{\n\tfz_rect r;\n\tfz_bbox_add_rect(dev, fz_bound_path(dev->ctx, path, NULL, ctm, &r), 1);\n}\n\nstatic void\nfz_bbox_clip_stroke_path(fz_device *dev, fz_path *path, const fz_rect *rect, fz_stroke_state *stroke, const fz_matrix *ctm)\n{\n\tfz_rect r;\n\tfz_bbox_add_rect(dev, fz_bound_path(dev->ctx, path, stroke, ctm, &r), 1);\n}\n\nstatic void\nfz_bbox_clip_text(fz_device *dev, fz_text *text, const fz_matrix *ctm, int accumulate)\n{\n\tfz_rect r = fz_infinite_rect;\n\tif (accumulate)\n\t\tfz_bbox_add_rect(dev, &r, accumulate != 2);\n\telse\n\t\tfz_bbox_add_rect(dev, fz_bound_text(dev->ctx, text, NULL, ctm, &r), 1);\n}\n\nstatic void\nfz_bbox_clip_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, const fz_matrix *ctm)\n{\n\tfz_rect r;\n\tfz_bbox_add_rect(dev, fz_bound_text(dev->ctx, text, stroke, ctm, &r), 1);\n}\n\nstatic void\nfz_bbox_clip_image_mask(fz_device *dev, fz_image *image, const fz_rect *rect, const fz_matrix *ctm)\n{\n\tfz_rect r = fz_unit_rect;\n\tfz_bbox_add_rect(dev, fz_transform_rect(&r, ctm), 1);\n}\n\nstatic void\nfz_bbox_pop_clip(fz_device *dev)\n{\n\tfz_bbox_data *data = dev->user;\n\tif (data->top > 0)\n\t\tdata->top--;\n\telse\n\t\tfz_warn(dev->ctx, \"unexpected pop clip\");\n}\n\nstatic void\nfz_bbox_begin_mask(fz_device *dev, const fz_rect *rect, int luminosity, fz_colorspace *colorspace, float *color)\n{\n\tfz_bbox_data *data = dev->user;\n\tfz_bbox_add_rect(dev, rect, 1);\n\tdata->ignore++;\n}\n\nstatic void\nfz_bbox_end_mask(fz_device *dev)\n{\n\tfz_bbox_data *data = dev->user;\n\tassert(data->ignore > 0);\n\tdata->ignore--;\n}\n\nstatic void\nfz_bbox_begin_group(fz_device *dev, const fz_rect *rect, int isolated, int knockout, int blendmode, float alpha)\n{\n\tfz_bbox_add_rect(dev, rect, 1);\n}\n\nstatic void\nfz_bbox_end_group(fz_device *dev)\n{\n\tfz_bbox_pop_clip(dev);\n}\n\nstatic int\nfz_bbox_begin_tile(fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, const fz_matrix *ctm, int id)\n{\n\tfz_bbox_data *data = dev->user;\n\tfz_rect r = *area;\n\tfz_bbox_add_rect(dev, fz_transform_rect(&r, ctm), 0);\n\tdata->ignore++;\n\treturn 0;\n}\n\nstatic void\nfz_bbox_end_tile(fz_device *dev)\n{\n\tfz_bbox_data *data = dev->user;\n\tassert(data->ignore > 0);\n\tdata->ignore--;\n}\n\nstatic void\nfz_bbox_free_user(fz_device *dev)\n{\n\tfz_bbox_data *data = dev->user;\n\tif (data->top > 0)\n\t\tfz_warn(dev->ctx, \"items left on stack in bbox device: %d\", data->top);\n\tfz_free(dev->ctx, dev->user);\n}\n\nfz_device *\nfz_new_bbox_device(fz_context *ctx, fz_rect *result)\n{\n\tfz_device *dev;\n\n\tfz_bbox_data *user = fz_malloc_struct(ctx, fz_bbox_data);\n\tuser->result = result;\n\tuser->top = 0;\n\tuser->ignore = 0;\n\tdev = fz_new_device(ctx, user);\n\tdev->free_user = fz_bbox_free_user;\n\n\tdev->fill_path = fz_bbox_fill_path;\n\tdev->stroke_path = fz_bbox_stroke_path;\n\tdev->clip_path = fz_bbox_clip_path;\n\tdev->clip_stroke_path = fz_bbox_clip_stroke_path;\n\n\tdev->fill_text = fz_bbox_fill_text;\n\tdev->stroke_text = fz_bbox_stroke_text;\n\tdev->clip_text = fz_bbox_clip_text;\n\tdev->clip_stroke_text = fz_bbox_clip_stroke_text;\n\n\tdev->fill_shade = fz_bbox_fill_shade;\n\tdev->fill_image = fz_bbox_fill_image;\n\tdev->fill_image_mask = fz_bbox_fill_image_mask;\n\tdev->clip_image_mask = fz_bbox_clip_image_mask;\n\n\tdev->pop_clip = fz_bbox_pop_clip;\n\n\tdev->begin_mask = fz_bbox_begin_mask;\n\tdev->end_mask = fz_bbox_end_mask;\n\tdev->begin_group = fz_bbox_begin_group;\n\tdev->end_group = fz_bbox_end_group;\n\n\tdev->begin_tile = fz_bbox_begin_tile;\n\tdev->end_tile = fz_bbox_end_tile;\n\n\t*result = fz_empty_rect;\n\n\treturn dev;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/bitmap.c",
    "content": "#include \"mupdf/fitz.h\"\n\nfz_bitmap *\nfz_new_bitmap(fz_context *ctx, int w, int h, int n, int xres, int yres)\n{\n\tfz_bitmap *bit;\n\n\tbit = fz_malloc_struct(ctx, fz_bitmap);\n\tbit->refs = 1;\n\tbit->w = w;\n\tbit->h = h;\n\tbit->n = n;\n\tbit->xres = xres;\n\tbit->yres = yres;\n\t/* Span is 32 bit aligned. We may want to make this 64 bit if we\n\t * use SSE2 etc. */\n\tbit->stride = ((n * w + 31) & ~31) >> 3;\n\n\tbit->samples = fz_malloc_array(ctx, h, bit->stride);\n\n\treturn bit;\n}\n\nfz_bitmap *\nfz_keep_bitmap(fz_context *ctx, fz_bitmap *bit)\n{\n\tif (bit)\n\t\tbit->refs++;\n\treturn bit;\n}\n\nvoid\nfz_drop_bitmap(fz_context *ctx, fz_bitmap *bit)\n{\n\tif (bit && --bit->refs == 0)\n\t{\n\t\tfz_free(ctx, bit->samples);\n\t\tfz_free(ctx, bit);\n\t}\n}\n\nvoid\nfz_clear_bitmap(fz_context *ctx, fz_bitmap *bit)\n{\n\tmemset(bit->samples, 0, bit->stride * bit->h);\n}\n\n/*\n * Write bitmap to PBM file\n */\n\nvoid\nfz_write_pbm(fz_context *ctx, fz_bitmap *bitmap, char *filename)\n{\n\tFILE *fp;\n\tunsigned char *p;\n\tint h, bytestride;\n\n\tfp = fopen(filename, \"wb\");\n\tif (!fp)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot open file '%s': %s\", filename, strerror(errno));\n\n\tassert(bitmap->n == 1);\n\n\tfprintf(fp, \"P4\\n%d %d\\n\", bitmap->w, bitmap->h);\n\n\tp = bitmap->samples;\n\n\th = bitmap->h;\n\tbytestride = (bitmap->w + 7) >> 3;\n\twhile (h--)\n\t{\n\t\tfwrite(p, 1, bytestride, fp);\n\t\tp += bitmap->stride;\n\t}\n\n\tfclose(fp);\n}\n\nfz_colorspace *fz_pixmap_colorspace(fz_context *ctx, fz_pixmap *pix)\n{\n\tif (!pix)\n\t\treturn NULL;\n\treturn pix->colorspace;\n}\n\nint fz_pixmap_components(fz_context *ctx, fz_pixmap *pix)\n{\n\tif (!pix)\n\t\treturn 0;\n\treturn pix->n;\n}\n\nunsigned char *fz_pixmap_samples(fz_context *ctx, fz_pixmap *pix)\n{\n\tif (!pix)\n\t\treturn NULL;\n\treturn pix->samples;\n}\n\nvoid fz_bitmap_details(fz_bitmap *bit, int *w, int *h, int *n, int *stride)\n{\n\tif (!bit)\n\t{\n\t\tif (w)\n\t\t\t*w = 0;\n\t\tif (h)\n\t\t\t*h = 0;\n\t\tif (n)\n\t\t\t*n = 0;\n\t\tif (stride)\n\t\t\t*stride = 0;\n\t\treturn;\n\t}\n\tif (w)\n\t\t*w = bit->w;\n\tif (h)\n\t\t*h = bit->h;\n\tif (n)\n\t\t*n = bit->n;\n\tif (stride)\n\t\t*stride = bit->stride;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/buffer.c",
    "content": "#include \"mupdf/fitz.h\"\n\nfz_buffer *\nfz_new_buffer(fz_context *ctx, int size)\n{\n\tfz_buffer *b;\n\n\tsize = size > 1 ? size : 16;\n\n\tb = fz_malloc_struct(ctx, fz_buffer);\n\tb->refs = 1;\n\tfz_try(ctx)\n\t{\n\t\tb->data = fz_malloc(ctx, size);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, b);\n\t\tfz_rethrow(ctx);\n\t}\n\tb->cap = size;\n\tb->len = 0;\n\tb->unused_bits = 0;\n\n\treturn b;\n}\n\nfz_buffer *\nfz_new_buffer_from_data(fz_context *ctx, unsigned char *data, int size)\n{\n\tfz_buffer *b;\n\n\tb = fz_malloc_struct(ctx, fz_buffer);\n\tb->refs = 1;\n\tb->data = data;\n\tb->cap = size;\n\tb->len = size;\n\tb->unused_bits = 0;\n\n\treturn b;\n}\n\nfz_buffer *\nfz_keep_buffer(fz_context *ctx, fz_buffer *buf)\n{\n\tif (buf)\n\t\tbuf->refs ++;\n\treturn buf;\n}\n\nvoid\nfz_drop_buffer(fz_context *ctx, fz_buffer *buf)\n{\n\tif (!buf)\n\t\treturn;\n\tif (--buf->refs == 0)\n\t{\n\t\tfz_free(ctx, buf->data);\n\t\tfz_free(ctx, buf);\n\t}\n}\n\nvoid\nfz_resize_buffer(fz_context *ctx, fz_buffer *buf, int size)\n{\n\t/* SumatraPDF: prevent integer overflows in fz_grow_buffer and fz_trim_buffer */\n\tif (size < 0)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"size %d indicates integer overflow\", size);\n\tbuf->data = fz_resize_array(ctx, buf->data, size, 1);\n\tbuf->cap = size;\n\tif (buf->len > buf->cap)\n\t\tbuf->len = buf->cap;\n}\n\nvoid\nfz_grow_buffer(fz_context *ctx, fz_buffer *buf)\n{\n\tint newsize = (buf->cap * 3) / 2;\n\tif (newsize == 0)\n\t\tnewsize = 256;\n\tfz_resize_buffer(ctx, buf, newsize);\n}\n\nstatic void\nfz_ensure_buffer(fz_context *ctx, fz_buffer *buf, int min)\n{\n\tint newsize = buf->cap;\n\tif (newsize < 16)\n\t\tnewsize = 16;\n\twhile (newsize < min)\n\t{\n\t\tnewsize = (newsize * 3) / 2;\n\t}\n\tfz_resize_buffer(ctx, buf, newsize);\n}\n\nvoid\nfz_trim_buffer(fz_context *ctx, fz_buffer *buf)\n{\n\tif (buf->cap > buf->len+1)\n\t\tfz_resize_buffer(ctx, buf, buf->len);\n}\n\nint\nfz_buffer_storage(fz_context *ctx, fz_buffer *buf, unsigned char **datap)\n{\n\tif (datap)\n\t\t*datap = (buf ? buf->data : NULL);\n\treturn (buf ? buf->len : 0);\n}\n\nvoid\nfz_buffer_cat(fz_context *ctx, fz_buffer *buf, fz_buffer *extra)\n{\n\tif (buf->cap - buf->len < extra->len)\n\t{\n\t\tbuf->data = fz_resize_array(ctx, buf->data, buf->len + extra->len, 1);\n\t\tbuf->cap = buf->len + extra->len;\n\t}\n\n\tmemcpy(buf->data + buf->len, extra->data, extra->len);\n\tbuf->len += extra->len;\n}\n\nvoid fz_write_buffer(fz_context *ctx, fz_buffer *buf, const void *data, int len)\n{\n\tif (buf->len + len > buf->cap)\n\t\tfz_ensure_buffer(ctx, buf, buf->len + len);\n\tmemcpy(buf->data + buf->len, data, len);\n\tbuf->len += len;\n\tbuf->unused_bits = 0;\n}\n\nvoid fz_write_buffer_byte(fz_context *ctx, fz_buffer *buf, int val)\n{\n\tif (buf->len + 1 > buf->cap)\n\t\tfz_grow_buffer(ctx, buf);\n\tbuf->data[buf->len++] = val;\n\tbuf->unused_bits = 0;\n}\n\nvoid fz_write_buffer_rune(fz_context *ctx, fz_buffer *buf, int c)\n{\n\tchar data[10];\n\tint len = fz_runetochar(data, c);\n\tif (buf->len + len > buf->cap)\n\t\tfz_ensure_buffer(ctx, buf, buf->len + len);\n\tmemcpy(buf->data + buf->len, data, len);\n\tbuf->len += len;\n\tbuf->unused_bits = 0;\n}\n\nvoid fz_write_buffer_bits(fz_context *ctx, fz_buffer *buf, int val, int bits)\n{\n\tint shift;\n\n\t/* Throughout this code, the invariant is that we need to write the\n\t * bottom 'bits' bits of 'val' into the stream. On entry we assume\n\t * that val & ((1<<bits)-1) == val, but we do not rely on this after\n\t * having written the first partial byte. */\n\n\tif (bits == 0)\n\t\treturn;\n\n\t/* buf->len always covers all the bits in the buffer, including\n\t * any unused ones in the last byte, which will always be 0.\n\t * buf->unused_bits = the number of unused bits in the last byte.\n\t */\n\n\t/* Find the amount we need to shift val up by so that it will be in\n\t * the correct position to be inserted into any existing data byte. */\n\tshift = (buf->unused_bits - bits);\n\n\t/* Extend the buffer as required before we start; that way we never\n\t * fail part way during writing. If shift < 0, then we'll need -shift\n\t * more bits. */\n\tif (shift < 0)\n\t{\n\t\tint extra = (7-shift)>>3; /* Round up to bytes */\n\t\tfz_ensure_buffer(ctx, buf, buf->len + extra);\n\t}\n\n\t/* Write any bits that will fit into the existing byte */\n\tif (buf->unused_bits)\n\t{\n\t\tbuf->data[buf->len-1] |= (shift >= 0 ? (((unsigned int)val)<<shift) : (((unsigned int)val)>>-shift));\n\t\tif (shift >= 0)\n\t\t{\n\t\t\t/* If we were shifting up, we're done. */\n\t\t\tbuf->unused_bits -= bits;\n\t\t\treturn;\n\t\t}\n\t\t/* The number of bits left to write is the number that didn't\n\t\t * fit in this first byte. */\n\t\tbits = -shift;\n\t}\n\n\t/* Write any whole bytes */\n\twhile (bits >= 8)\n\t{\n\t\tbits -= 8;\n\t\tbuf->data[buf->len++] = val>>bits;\n\t}\n\n\t/* Write trailing bits (with 0's in unused bits) */\n\tif (bits > 0)\n\t{\n\t\tbits = 8-bits;\n\t\tbuf->data[buf->len++] = val<<bits;\n\t}\n\tbuf->unused_bits = bits;\n}\n\nvoid fz_write_buffer_pad(fz_context *ctx, fz_buffer *buf)\n{\n\tbuf->unused_bits = 0;\n}\n\nint\nfz_buffer_printf(fz_context *ctx, fz_buffer *buffer, const char *fmt, ...)\n{\n\tint ret;\n\tva_list args;\n\tva_start(args, fmt);\n\tret = fz_buffer_vprintf(ctx, buffer, fmt, args);\n\tva_end(args);\n\treturn ret;\n}\n\nint\nfz_buffer_vprintf(fz_context *ctx, fz_buffer *buffer, const char *fmt, va_list old_args)\n{\n\tint slack;\n\tint len;\n\tva_list args;\n\n\tslack = buffer->cap - buffer->len;\n\tva_copy(args, old_args);\n\tlen = fz_vsnprintf((char *)buffer->data + buffer->len, slack, fmt, args);\n\tva_copy_end(args);\n\n\t/* len = number of chars written, not including the terminating\n\t * NULL, so len+1 > slack means \"truncated\". */\n\tif (len+1 > slack)\n\t{\n\t\t/* Grow the buffer and retry */\n\t\tfz_ensure_buffer(ctx, buffer, buffer->len + len);\n\t\tslack = buffer->cap - buffer->len;\n\n\t\tva_copy(args, old_args);\n\t\tlen = fz_vsnprintf((char *)buffer->data + buffer->len, slack, fmt, args);\n\t\tva_copy_end(args);\n\t}\n\n\tbuffer->len += len;\n\n\treturn len;\n}\n\nvoid\nfz_buffer_cat_pdf_string(fz_context *ctx, fz_buffer *buffer, const char *text)\n{\n\tint len = 2;\n\tconst char *s = text;\n\tchar *d;\n\tchar c;\n\n\twhile ((c = *s++) != 0)\n\t{\n\t\tswitch (c)\n\t\t{\n\t\tcase '\\n':\n\t\tcase '\\r':\n\t\tcase '\\t':\n\t\tcase '\\b':\n\t\tcase '\\f':\n\t\tcase '(':\n\t\tcase ')':\n\t\tcase '\\\\':\n\t\t\tlen++;\n\t\t\tbreak;\n\t\t}\n\t\tlen++;\n\t}\n\n\twhile(buffer->cap - buffer->len < len)\n\t\tfz_grow_buffer(ctx, buffer);\n\n\ts = text;\n\td = (char *)buffer->data + buffer->len;\n\t*d++ = '(';\n\twhile ((c = *s++) != 0)\n\t{\n\t\tswitch (c)\n\t\t{\n\t\tcase '\\n':\n\t\t\t*d++ = '\\\\';\n\t\t\t*d++ = 'n';\n\t\t\tbreak;\n\t\tcase '\\r':\n\t\t\t*d++ = '\\\\';\n\t\t\t*d++ = 'r';\n\t\t\tbreak;\n\t\tcase '\\t':\n\t\t\t*d++ = '\\\\';\n\t\t\t*d++ = 't';\n\t\t\tbreak;\n\t\tcase '\\b':\n\t\t\t*d++ = '\\\\';\n\t\t\t*d++ = 'b';\n\t\t\tbreak;\n\t\tcase '\\f':\n\t\t\t*d++ = '\\\\';\n\t\t\t*d++ = 'f';\n\t\t\tbreak;\n\t\tcase '(':\n\t\t\t*d++ = '\\\\';\n\t\t\t*d++ = '(';\n\t\t\tbreak;\n\t\tcase ')':\n\t\t\t*d++ = '\\\\';\n\t\t\t*d++ = ')';\n\t\t\tbreak;\n\t\tcase '\\\\':\n\t\t\t*d++ = '\\\\';\n\t\t\t*d++ = '\\\\';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t*d++ = c;\n\t\t}\n\t}\n\t*d = ')';\n\tbuffer->len += len;\n}\n\n#ifdef TEST_BUFFER_WRITE\n\n#define TEST_LEN 1024\n\nvoid\nfz_test_buffer_write(fz_context *ctx)\n{\n\tfz_buffer *master = fz_new_buffer(ctx, TEST_LEN);\n\tfz_buffer *copy = fz_new_buffer(ctx, TEST_LEN);\n\tfz_stream *stm;\n\tint i, j, k;\n\n\t/* Make us a dummy buffer */\n\tfor (i = 0; i < TEST_LEN; i++)\n\t{\n\t\tmaster->data[i] = rand();\n\t}\n\tmaster->len = TEST_LEN;\n\n\t/* Now copy that buffer several times, checking it for validity */\n\tstm = fz_open_buffer(ctx, master);\n\tfor (i = 0; i < 256; i++)\n\t{\n\t\tmemset(copy->data, i, TEST_LEN);\n\t\tcopy->len = 0;\n\t\tj = TEST_LEN * 8;\n\t\tdo\n\t\t{\n\t\t\tk = (rand() & 31)+1;\n\t\t\tif (k > j)\n\t\t\t\tk = j;\n\t\t\tfz_write_buffer_bits(ctx, copy, fz_read_bits(stm, k), k);\n\t\t\tj -= k;\n\t\t}\n\t\twhile (j);\n\n\t\tif (memcmp(copy->data, master->data, TEST_LEN) != 0)\n\t\t\tfprintf(stderr, \"Copied buffer is different!\\n\");\n\t\tfz_seek(stm, 0, 0);\n\t}\n\tfz_close(stm);\n\tfz_drop_buffer(ctx, master);\n\tfz_drop_buffer(ctx, copy);\n}\n#endif\n"
  },
  {
    "path": "mupdf/source/fitz/colorspace.c",
    "content": "#include \"mupdf/fitz.h\"\n\n#define SLOWCMYK\n\nvoid\nfz_free_colorspace_imp(fz_context *ctx, fz_storable *cs_)\n{\n\tfz_colorspace *cs = (fz_colorspace *)cs_;\n\n\tif (cs->free_data && cs->data)\n\t\tcs->free_data(ctx, cs);\n\tfz_free(ctx, cs);\n}\n\nfz_colorspace *\nfz_new_colorspace(fz_context *ctx, char *name, int n)\n{\n\tfz_colorspace *cs = fz_malloc(ctx, sizeof(fz_colorspace));\n\tFZ_INIT_STORABLE(cs, 1, fz_free_colorspace_imp);\n\tcs->size = sizeof(fz_colorspace);\n\tfz_strlcpy(cs->name, name, sizeof cs->name);\n\tcs->n = n;\n\tcs->to_rgb = NULL;\n\tcs->from_rgb = NULL;\n\tcs->free_data = NULL;\n\tcs->data = NULL;\n\treturn cs;\n}\n\nfz_colorspace *\nfz_keep_colorspace(fz_context *ctx, fz_colorspace *cs)\n{\n\treturn (fz_colorspace *)fz_keep_storable(ctx, &cs->storable);\n}\n\nvoid\nfz_drop_colorspace(fz_context *ctx, fz_colorspace *cs)\n{\n\tfz_drop_storable(ctx, &cs->storable);\n}\n\n/* Device colorspace definitions */\n\nstatic void gray_to_rgb(fz_context *ctx, fz_colorspace *cs, const float *gray, float *rgb)\n{\n\trgb[0] = gray[0];\n\trgb[1] = gray[0];\n\trgb[2] = gray[0];\n}\n\nstatic void rgb_to_gray(fz_context *ctx, fz_colorspace *cs, const float *rgb, float *gray)\n{\n\tfloat r = rgb[0];\n\tfloat g = rgb[1];\n\tfloat b = rgb[2];\n\tgray[0] = r * 0.3f + g * 0.59f + b * 0.11f;\n}\n\nstatic void rgb_to_rgb(fz_context *ctx, fz_colorspace *cs, const float *rgb, float *xyz)\n{\n\txyz[0] = rgb[0];\n\txyz[1] = rgb[1];\n\txyz[2] = rgb[2];\n}\n\nstatic void bgr_to_rgb(fz_context *ctx, fz_colorspace *cs, const float *bgr, float *rgb)\n{\n\trgb[0] = bgr[2];\n\trgb[1] = bgr[1];\n\trgb[2] = bgr[0];\n}\n\nstatic void rgb_to_bgr(fz_context *ctx, fz_colorspace *cs, const float *rgb, float *bgr)\n{\n\tbgr[0] = rgb[2];\n\tbgr[1] = rgb[1];\n\tbgr[2] = rgb[0];\n}\n\nstatic void cmyk_to_rgb(fz_context *ctx, fz_colorspace *cs, const float *cmyk, float *rgb)\n{\n#ifdef SLOWCMYK /* from poppler */\n\tfloat c = cmyk[0], m = cmyk[1], y = cmyk[2], k = cmyk[3];\n\tfloat r, g, b, x;\n\tfloat cm = c * m;\n\tfloat c1m = m - cm;\n\tfloat cm1 = c - cm;\n\tfloat c1m1 = 1 - m - cm1;\n\tfloat c1m1y = c1m1 * y;\n\tfloat c1m1y1 = c1m1 - c1m1y;\n\tfloat c1my = c1m * y;\n\tfloat c1my1 = c1m - c1my;\n\tfloat cm1y = cm1 * y;\n\tfloat cm1y1 = cm1 - cm1y;\n\tfloat cmy = cm * y;\n\tfloat cmy1 = cm - cmy;\n\n\t/* this is a matrix multiplication, unrolled for performance */\n\tx = c1m1y1 * k;\t\t/* 0 0 0 1 */\n\tr = g = b = c1m1y1 - x;\t/* 0 0 0 0 */\n\tr += 0.1373 * x;\n\tg += 0.1216 * x;\n\tb += 0.1255 * x;\n\n\tx = c1m1y * k;\t\t/* 0 0 1 1 */\n\tr += 0.1098 * x;\n\tg += 0.1020 * x;\n\tx = c1m1y - x;\t\t/* 0 0 1 0 */\n\tr += x;\n\tg += 0.9490 * x;\n\n\tx = c1my1 * k;\t\t/* 0 1 0 1 */\n\tr += 0.1412 * x;\n\tx = c1my1 - x;\t\t/* 0 1 0 0 */\n\tr += 0.9255 * x;\n\tb += 0.5490 * x;\n\n\tx = c1my * k;\t\t/* 0 1 1 1 */\n\tr += 0.1333 * x;\n\tx = c1my - x;\t\t/* 0 1 1 0 */\n\tr += 0.9294 * x;\n\tg += 0.1098 * x;\n\tb += 0.1412 * x;\n\n\tx = cm1y1 * k;\t\t/* 1 0 0 1 */\n\tg += 0.0588 * x;\n\tb += 0.1412 * x;\n\tx = cm1y1 - x;\t\t/* 1 0 0 0 */\n\tg += 0.6784 * x;\n\tb += 0.9373 * x;\n\n\tx = cm1y * k;\t\t/* 1 0 1 1 */\n\tg += 0.0745 * x;\n\tx = cm1y - x;\t\t/* 1 0 1 0 */\n\tg += 0.6510 * x;\n\tb += 0.3137 * x;\n\n\tx = cmy1 * k;\t\t/* 1 1 0 1 */\n\tb += 0.0078 * x;\n\tx = cmy1 - x;\t\t/* 1 1 0 0 */\n\tr += 0.1804 * x;\n\tg += 0.1922 * x;\n\tb += 0.5725 * x;\n\n\tx = cmy * (1-k);\t/* 1 1 1 0 */\n\tr += 0.2118 * x;\n\tg += 0.2119 * x;\n\tb += 0.2235 * x;\n\trgb[0] = fz_clamp(r, 0, 1);\n\trgb[1] = fz_clamp(g, 0, 1);\n\trgb[2] = fz_clamp(b, 0, 1);\n#else\n\trgb[0] = 1 - fz_min(1, cmyk[0] + cmyk[3]);\n\trgb[1] = 1 - fz_min(1, cmyk[1] + cmyk[3]);\n\trgb[2] = 1 - fz_min(1, cmyk[2] + cmyk[3]);\n#endif\n}\n\nstatic void rgb_to_cmyk(fz_context *ctx, fz_colorspace *cs, const float *rgb, float *cmyk)\n{\n\tfloat c, m, y, k;\n\tc = 1 - rgb[0];\n\tm = 1 - rgb[1];\n\ty = 1 - rgb[2];\n\tk = fz_min(c, fz_min(m, y));\n\tcmyk[0] = c - k;\n\tcmyk[1] = m - k;\n\tcmyk[2] = y - k;\n\tcmyk[3] = k;\n}\n\nstatic fz_colorspace k_default_gray = { {-1, fz_free_colorspace_imp}, 0, \"DeviceGray\", 1, gray_to_rgb, rgb_to_gray };\nstatic fz_colorspace k_default_rgb = { {-1, fz_free_colorspace_imp}, 0, \"DeviceRGB\", 3, rgb_to_rgb, rgb_to_rgb };\nstatic fz_colorspace k_default_bgr = { {-1, fz_free_colorspace_imp}, 0, \"DeviceBGR\", 3, bgr_to_rgb, rgb_to_bgr };\nstatic fz_colorspace k_default_cmyk = { {-1, fz_free_colorspace_imp}, 0, \"DeviceCMYK\", 4, cmyk_to_rgb, rgb_to_cmyk };\n\nstatic fz_colorspace *fz_default_gray = &k_default_gray;\nstatic fz_colorspace *fz_default_rgb = &k_default_rgb;\nstatic fz_colorspace *fz_default_bgr = &k_default_bgr;\nstatic fz_colorspace *fz_default_cmyk = &k_default_cmyk;\n\nstruct fz_colorspace_context_s\n{\n\tint ctx_refs;\n\tfz_colorspace *gray, *rgb, *bgr, *cmyk;\n};\n\nvoid fz_new_colorspace_context(fz_context *ctx)\n{\n\tctx->colorspace = fz_malloc_struct(ctx, fz_colorspace_context);\n\tctx->colorspace->ctx_refs = 1;\n\tctx->colorspace->gray = fz_default_gray;\n\tctx->colorspace->rgb = fz_default_rgb;\n\tctx->colorspace->bgr = fz_default_bgr;\n\tctx->colorspace->cmyk = fz_default_cmyk;\n}\n\nfz_colorspace_context *\nfz_keep_colorspace_context(fz_context *ctx)\n{\n\tif (!ctx || !ctx->colorspace)\n\t\treturn NULL;\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tctx->colorspace->ctx_refs++;\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\treturn ctx->colorspace;\n}\n\nvoid fz_drop_colorspace_context(fz_context *ctx)\n{\n\tint drop;\n\tif (!ctx || !ctx->colorspace)\n\t\treturn;\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tdrop = --ctx->colorspace->ctx_refs;\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\tif (drop == 0)\n\t\tfz_free(ctx, ctx->colorspace);\n}\n\nfz_colorspace *\nfz_device_gray(fz_context *ctx)\n{\n\treturn ctx->colorspace->gray;\n}\n\nfz_colorspace *\nfz_device_rgb(fz_context *ctx)\n{\n\treturn ctx->colorspace->rgb;\n}\n\nfz_colorspace *\nfz_device_bgr(fz_context *ctx)\n{\n\treturn ctx->colorspace->bgr;\n}\n\nfz_colorspace *\nfz_device_cmyk(fz_context *ctx)\n{\n\treturn ctx->colorspace->cmyk;\n}\n\nfz_colorspace *\nfz_lookup_device_colorspace(fz_context *ctx, char *name)\n{\n\tif (!strcmp(name, \"DeviceGray\"))\n\t\treturn fz_device_gray(ctx);\n\tif (!strcmp(name, \"DeviceRGB\"))\n\t\treturn fz_device_rgb(ctx);\n\tif (!strcmp(name, \"DeviceBGR\"))\n\t\treturn fz_device_bgr(ctx);\n\tif (!strcmp(name, \"DeviceCMYK\"))\n\t\treturn fz_device_cmyk(ctx);\n\tassert(!\"unknown device colorspace\");\n\treturn NULL;\n}\n\nvoid\nfz_set_device_gray(fz_context *ctx, fz_colorspace *cs)\n{\n\tfz_drop_colorspace(ctx, ctx->colorspace->gray);\n\tctx->colorspace->gray = fz_keep_colorspace(ctx, cs);\n}\n\nvoid\nfz_set_device_rgb(fz_context *ctx, fz_colorspace *cs)\n{\n\tfz_drop_colorspace(ctx, ctx->colorspace->rgb);\n\tctx->colorspace->rgb = fz_keep_colorspace(ctx, cs);\n}\n\nvoid\nfz_set_device_bgr(fz_context *ctx, fz_colorspace *cs)\n{\n\tfz_drop_colorspace(ctx, ctx->colorspace->bgr);\n\tctx->colorspace->bgr = fz_keep_colorspace(ctx, cs);\n}\n\nvoid\nfz_set_device_cmyk(fz_context *ctx, fz_colorspace *cs)\n{\n\tfz_drop_colorspace(ctx, ctx->colorspace->cmyk);\n\tctx->colorspace->cmyk = fz_keep_colorspace(ctx, cs);\n}\n\nint\nfz_colorspace_is_indexed(fz_colorspace *cs)\n{\n\treturn (cs && !strcmp(cs->name, \"Indexed\"));\n}\n\n/* Fast pixmap color conversions */\n\nstatic void fast_gray_to_rgb(fz_pixmap *dst, fz_pixmap *src)\n{\n\tunsigned char *s = src->samples;\n\tunsigned char *d = dst->samples;\n\tint n = src->w * src->h;\n\twhile (n--)\n\t{\n\t\td[0] = s[0];\n\t\td[1] = s[0];\n\t\td[2] = s[0];\n\t\td[3] = s[1];\n\t\ts += 2;\n\t\td += 4;\n\t}\n}\n\nstatic void fast_gray_to_cmyk(fz_pixmap *dst, fz_pixmap *src)\n{\n\tunsigned char *s = src->samples;\n\tunsigned char *d = dst->samples;\n\tint n = src->w * src->h;\n\twhile (n--)\n\t{\n\t\td[0] = 0;\n\t\td[1] = 0;\n\t\td[2] = 0;\n\t\td[3] = 255 - s[0];\n\t\td[4] = s[1];\n\t\ts += 2;\n\t\td += 5;\n\t}\n}\n\nstatic void fast_rgb_to_gray(fz_pixmap *dst, fz_pixmap *src)\n{\n\tunsigned char *s = src->samples;\n\tunsigned char *d = dst->samples;\n\tint n = src->w * src->h;\n\twhile (n--)\n\t{\n\t\td[0] = ((s[0]+1) * 77 + (s[1]+1) * 150 + (s[2]+1) * 28) >> 8;\n\t\td[1] = s[3];\n\t\ts += 4;\n\t\td += 2;\n\t}\n}\n\nstatic void fast_bgr_to_gray(fz_pixmap *dst, fz_pixmap *src)\n{\n\tunsigned char *s = src->samples;\n\tunsigned char *d = dst->samples;\n\tint n = src->w * src->h;\n\twhile (n--)\n\t{\n\t\td[0] = ((s[0]+1) * 28 + (s[1]+1) * 150 + (s[2]+1) * 77) >> 8;\n\t\td[1] = s[3];\n\t\ts += 4;\n\t\td += 2;\n\t}\n}\n\nstatic void fast_rgb_to_cmyk(fz_pixmap *dst, fz_pixmap *src)\n{\n\tunsigned char *s = src->samples;\n\tunsigned char *d = dst->samples;\n\tint n = src->w * src->h;\n\twhile (n--)\n\t{\n\t\tunsigned char c = 255 - s[0];\n\t\tunsigned char m = 255 - s[1];\n\t\tunsigned char y = 255 - s[2];\n\t\tunsigned char k = (unsigned char)fz_mini(c, fz_mini(m, y));\n\t\td[0] = c - k;\n\t\td[1] = m - k;\n\t\td[2] = y - k;\n\t\td[3] = k;\n\t\td[4] = s[3];\n\t\ts += 4;\n\t\td += 5;\n\t}\n}\n\nstatic void fast_bgr_to_cmyk(fz_pixmap *dst, fz_pixmap *src)\n{\n\tunsigned char *s = src->samples;\n\tunsigned char *d = dst->samples;\n\tint n = src->w * src->h;\n\twhile (n--)\n\t{\n\t\tunsigned char c = 255 - s[2];\n\t\tunsigned char m = 255 - s[1];\n\t\tunsigned char y = 255 - s[0];\n\t\tunsigned char k = (unsigned char)fz_mini(c, fz_mini(m, y));\n\t\td[0] = c - k;\n\t\td[1] = m - k;\n\t\td[2] = y - k;\n\t\td[3] = k;\n\t\td[4] = s[3];\n\t\ts += 4;\n\t\td += 5;\n\t}\n}\n\nstatic void fast_cmyk_to_gray(fz_pixmap *dst, fz_pixmap *src)\n{\n\tunsigned char *s = src->samples;\n\tunsigned char *d = dst->samples;\n\tint n = src->w * src->h;\n\twhile (n--)\n\t{\n\t\tunsigned char c = fz_mul255(s[0], 77);\n\t\tunsigned char m = fz_mul255(s[1], 150);\n\t\tunsigned char y = fz_mul255(s[2], 28);\n\t\td[0] = 255 - (unsigned char)fz_mini(c + m + y + s[3], 255);\n\t\td[1] = s[4];\n\t\ts += 5;\n\t\td += 2;\n\t}\n}\n\n#ifdef ARCH_ARM\nstatic void\nfast_cmyk_to_rgb_ARM(unsigned char *dst, unsigned char *src, int n)\n__attribute__((naked));\n\nstatic void\nfast_cmyk_to_rgb_ARM(unsigned char *dst, unsigned char *src, int n)\n{\n\tasm volatile(\n\tENTER_ARM\n\t\"stmfd\tr13!,{r4-r11,r14}\t\t\t\t\t\\n\"\n\t\"@ r0 = dst\t\t\t\t\t\t\t\\n\"\n\t\"@ r1 = src\t\t\t\t\t\t\t\\n\"\n\t\"@ r2 = n\t\t\t\t\t\t\t\\n\"\n\t\"mov\tr12, #0\t\t\t@ r12= CMYK = 0\t\t\t\\n\"\n\t\"b\t2f\t\t\t@ enter loop\t\t\t\\n\"\n\t\"1:\t\t\t\t@ White or Black\t\t\\n\"\n\t\"@ Cunning trick: On entry r11 = 0 if black, r11 = FF if white\t\\n\"\n\t\"eor    r12,r11,#0xFF           @ r12= FF if black, 0 if white  \\n\"\n\t\"ldrb\tr7, [r1],#1\t\t@ r8 = s[4]\t\t\t\\n\"\n\t\"strb\tr11,[r0],#1\t\t@ d[0] = r\t\t\t\\n\"\n\t\"strb\tr11,[r0],#1\t\t@ d[1] = g\t\t\t\\n\"\n\t\"strb\tr11,[r0],#1\t\t@ d[2] = b\t\t\t\\n\"\n\t\"strb\tr7, [r0],#1\t\t@ d[3] = s[4]\t\t\t\\n\"\n\t\"mov    r12,r12,LSL #24         @ r12 = CMYK                    \\n\"\n\t\"subs\tr2, r2, #1\t\t@ r2 = n--\t\t\t\\n\"\n\t\"beq\t9f\t\t\t\t\t\t\t\\n\"\n\t\"2:\t\t\t\t@ Main loop starts here\t\t\\n\"\n\t\"ldrb\tr3, [r1], #4\t\t@ r3 = c\t\t\t\\n\"\n\t\"ldrb\tr6, [r1, #-1]\t\t@ r6 = k\t\t\t\\n\"\n\t\"ldrb\tr5, [r1, #-2]\t\t@ r5 = y\t\t\t\\n\"\n\t\"ldrb\tr4, [r1, #-3]\t\t@ r4 = m\t\t\t\\n\"\n\t\"eors\tr11,r6, #0xFF\t\t@ if (k == 255)\t\t\t\\n\"\n\t\"beq\t1b\t\t\t@   goto black\t\t\t\\n\"\n\t\"orr\tr7, r3, r4, LSL #8\t\t\t\t\t\\n\"\n\t\"orr\tr14,r5, r6, LSL #8\t\t\t\t\t\\n\"\n\t\"orrs\tr7, r7, r14,LSL #16\t@ r7 = cmyk\t\t\t\\n\"\n\t\"beq\t1b\t\t\t@ if (cmyk == 0) white\t\t\\n\"\n\t\"@ At this point, we have to decode a new pixel\t\t\t\\n\"\n\t\"@ r0 = dst  r1 = src  r2 = n  r7 = cmyk\t\t\t\\n\"\n\t\"3:\t\t\t\t@ unmatched\t\t\t\\n\"\n\t\"stmfd\tr13!,{r0-r1,r7}\t\t@ stash regs for space\t\t\\n\"\n\t\"add\tr3, r3, r3, LSR #7\t@ r3 = c += c>>7\t\t\\n\"\n\t\"add\tr4, r4, r4, LSR #7\t@ r4 = m += m>>7\t\t\\n\"\n\t\"add\tr5, r5, r5, LSR #7\t@ r5 = y += y>>7\t\t\\n\"\n\t\"add\tr6, r6, r6, LSR #7\t@ r6 = k += k>>7\t\t\\n\"\n\t\"mov\tr5, r5, LSR #1\t\t@ sacrifice 1 bit of Y\t\t\\n\"\n\t\"mul\tr8, r3, r4\t\t@ r8 = cm     = c * m\t\t\\n\"\n\t\"rsb\tr9, r8, r4, LSL #8\t@ r9 = c1m    = (m<<8) - cm\t\\n\"\n\t\"rsb\tr3, r8, r3, LSL #8\t@ r3 = cm1    = (c<<8) - cm\t\\n\"\n\t\"rsb\tr4, r4, #0x100\t\t@ r4 = 256-m\t\t\t\\n\"\n\t\"rsb\tr4, r3, r4, LSL #8\t@ r4 = c1m1   =((256-m)<<8)-cm1\t\\n\"\n\t\"mul\tr7, r4, r5\t\t@ r7 = c1m1y  = c1m1 * y\t\\n\"\n\t\"rsb\tr4, r7, r4, LSL #7\t@ r4 = c1m1y1 = (c1m1<<7)-c1m1y\t\\n\"\n\t\"mul\tr10,r9, r5\t\t@ r10= c1my   = c1m * y\t\t\\n\"\n\t\"rsb\tr9, r10,r9, LSL #7\t@ r9 = c1my1  = (c1m<<7) - c1my \\n\"\n\t\"mul\tr11,r3, r5\t\t@ r11= cm1y   = cm1 * y\t\t\\n\"\n\t\"rsb\tr3, r11,r3, LSL #7\t@ r3 = cm1y1  = (cm1<<7) - cm1y\t\\n\"\n\t\"mul\tr5, r8, r5\t\t@ r5 = cmy    = cm * y\t\t\\n\"\n\t\"rsb\tr8, r5, r8, LSL #7\t@ r8 = cmy1   = (cm<<7) - cmy\t\\n\"\n\t\"@ Register recap:\t\t\t\t\t\t\\n\"\n\t\"@ r3 = cm1y1\t\t\t\t\t\t\t\\n\"\n\t\"@ r4 = c1m1y1\t\t\t\t\t\t\t\\n\"\n\t\"@ r5 = cmy\t\t\t\t\t\t\t\\n\"\n\t\"@ r6 = k\t\t\t\t\t\t\t\\n\"\n\t\"@ r7 = c1m1y\t\t\t\t\t\t\t\\n\"\n\t\"@ r8 = cmy1\t\t\t\t\t\t\t\\n\"\n\t\"@ r9 = c1my1\t\t\t\t\t\t\t\\n\"\n\t\"@ r10= c1my\t\t\t\t\t\t\t\\n\"\n\t\"@ r11= cm1y\t\t\t\t\t\t\t\\n\"\n\t\"@ The actual matrix multiplication\t\t\t\t\\n\"\n\t\"mul\tr14,r4, r6\t\t@ r14= x1 = c1m1y1 * k\t\t\\n\"\n\t\"rsb\tr4, r14,r4, LSL #8\t@ r4 = x0 = (c1m1y1<<8) - x1\t\\n\"\n\t\"add\tr4, r4, r14,LSR #8-5\t@ r4 = b = x0 + 32*(x1>>8)\t\\n\"\n\t\"sub\tr1, r4, r14,LSR #8\t@ r1 = g = x0 + 31*(x1>>8)\t\\n\"\n\t\"add\tr0, r1, r14,LSR #8-2\t@ r0 = r = x0 + 35*(x1>>8)\t\\n\"\n\t\"\t\t\t\t\t\t\t\t\\n\"\n\t\"mul\tr14,r7, r6\t\t@ r14= x1 = c1m1y * k\t\t\\n\"\n\t\"rsb\tr7, r14,r7, LSL #8\t@ r7 = x0 = (c1m1y<<8) - x1\t\\n\"\n\t\"add\tr0, r0, r7\t\t@ r0 = r += x0\t\t\t\\n\"\n\t\"add\tr1, r1, r7\t\t@ r1 = g += (x0>>8 * 256)\t\\n\"\n\t\"sub\tr1, r1, r7, LSR #8-3\t@                    248\t\\n\"\n\t\"sub\tr1, r1, r7, LSR #8-2\t@                    244\t\\n\"\n\t\"sub\tr1, r1, r7, LSR #8\t@                    243\t\\n\"\n\t\"sub\tr7, r14,r14,LSR #3\t@ r7 = 28*(x1>>5)\t\t\\n\"\n\t\"add\tr0, r0, r7, LSR #8-5\t@ r0 = r += 28 * x1\t\t\\n\"\n\t\"sub\tr7, r7, r14,LSR #4\t@ r7 = 26*(x1>>5)\t\t\\n\"\n\t\"add\tr1, r1, r7, LSR #8-5\t@ r1 = g += 26 * x1\t\t\\n\"\n\t\"\t\t\t\t\t\t\t\t\\n\"\n\t\"mul\tr14,r9, r6\t\t@ r14= x1 = c1my1 * k\t\t\\n\"\n\t\"sub\tr9, r9, r14,LSR #8\t@ r9 = x0>>8 = c1my1 - (x1>>8)\t\\n\"\n\t\"add\tr0, r0, r14,LSR #8-5\t@ r0 = r += (x1>>8)*32\t\t\\n\"\n\t\"add\tr0, r0, r14,LSR #8-2\t@ r0 = r += (x1>>8)*36\t\t\\n\"\n\t\"mov\tr14,#237\t\t@ r14= 237\t\t\t\\n\"\n\t\"mla\tr0,r14,r9,r0\t\t@ r14= r += x0*237\t\t\\n\"\n\t\"mov\tr14,#141\t\t@ r14= 141\t\t\t\\n\"\n\t\"mla\tr4,r14,r9,r4\t\t@ r14= b += x0*141\t\t\\n\"\n\t\"\t\t\t\t\t\t\t\t\\n\"\n\t\"mul\tr14,r10,r6\t\t@ r14= x1 = c1my * k\t\t\\n\"\n\t\"sub\tr10,r10,r14,LSR #8\t@ r10= x0>>8 = c1my - (x1>>8)\t\\n\"\n\t\"add\tr0, r0, r14,LSR #8-5\t@ r0 = r += 32 * x1\t\t\\n\"\n\t\"add\tr0, r0, r14,LSR #8-1\t@ r0 = r += 34 * x1\t\t\\n\"\n\t\"mov\tr14,#238\t\t@ r14= 238\t\t\t\\n\"\n\t\"mla\tr0,r14,r10,r0\t\t@ r0 = r += 238 * x0\t\t\\n\"\n\t\"mov\tr14,#28\t\t\t@ r14= 28\t\t\t\\n\"\n\t\"mla\tr1,r14,r10,r1\t\t@ r1 = g += 28 * x0\t\t\\n\"\n\t\"mov\tr14,#36\t\t\t@ r14= 36\t\t\t\\n\"\n\t\"mla\tr4,r14,r10,r4\t\t@ r4 = b += 36 * x0\t\t\\n\"\n\t\"\t\t\t\t\t\t\t\t\\n\"\n\t\"mul\tr14,r3, r6\t\t@ r14= x1 = cm1y1 * k\t\t\\n\"\n\t\"sub\tr3, r3, r14,LSR #8\t@ r3 = x1>>8 = cm1y1 - (x1>>8)\t\\n\"\n\t\"add\tr1, r1, r14,LSR #8-4\t@ r1 = g += 16*x1\t\t\\n\"\n\t\"sub\tr1, r1, r14,LSR #8\t@           15*x1\t\t\\n\"\n\t\"add\tr4, r4, r14,LSR #8-5\t@ r4 = b += 32*x1\t\t\\n\"\n\t\"add\tr4, r4, r14,LSR #8-2\t@           36*x1\t\t\\n\"\n\t\"mov\tr14,#174\t\t@ r14= 174\t\t\t\\n\"\n\t\"mla\tr1, r14,r3, r1\t\t@ r1 = g += 174 * x0\t\t\\n\"\n\t\"mov\tr14,#240\t\t@ r14= 240\t\t\t\\n\"\n\t\"mla\tr4, r14,r3, r4\t\t@ r4 = b += 240 * x0\t\t\\n\"\n\t\"\t\t\t\t\t\t\t\t\\n\"\n\t\"mul\tr14,r11,r6\t\t@ r14= x1 = cm1y * k\t\t\\n\"\n\t\"sub\tr11,r11,r14,LSR #8\t@ r11= x0>>8 = cm1y - (x1>>8)\t\\n\"\n\t\"add\tr1, r1, r14,LSR #8-4\t@ r1 = g += x1 * 16\t\t\\n\"\n\t\"add\tr1, r1, r14,LSR #8\t@           x1 * 17\t\t\\n\"\n\t\"add\tr1, r1, r14,LSR #8-1\t@           x1 * 19\t\t\\n\"\n\t\"mov\tr14,#167\t\t@ r14 = 167\t\t\t\\n\"\n\t\"mla\tr1, r14,r11,r1\t\t@ r1 = g += 167 * x0\t\t\\n\"\n\t\"mov\tr14,#80\t\t\t@ r14 = 80\t\t\t\\n\"\n\t\"mla\tr4, r14,r11,r4\t\t@ r4 = b += 80 * x0\t\t\\n\"\n\t\"\t\t\t\t\t\t\t\t\\n\"\n\t\"mul\tr14,r8, r6\t\t@ r14= x1 = cmy1 * k\t\t\\n\"\n\t\"sub\tr8, r8, r14,LSR #8\t@ r8 = x0>>8 = cmy1 - (x1>>8)\t\\n\"\n\t\"add\tr4, r4, r14,LSR #8-1\t@ r4 = b += x1 * 2\t\t\\n\"\n\t\"mov\tr14,#46\t\t\t@ r14=46\t\t\t\\n\"\n\t\"mla\tr0, r14,r8, r0\t\t@ r0 = r += 46 * x0\t\t\\n\"\n\t\"mov\tr14,#49\t\t\t@ r14=49\t\t\t\\n\"\n\t\"mla\tr1, r14,r8, r1\t\t@ r1 = g += 49 * x0\t\t\\n\"\n\t\"mov\tr14,#147\t\t@ r14=147\t\t\t\\n\"\n\t\"mla\tr4, r14,r8, r4\t\t@ r4 = b += 147 * x0\t\t\\n\"\n\t\"\t\t\t\t\t\t\t\t\\n\"\n\t\"rsb\tr6, r6, #256\t\t@ r6 = k = 256-k\t\t\\n\"\n\t\"mul\tr14,r5, r6\t\t@ r14= x0 = cmy * (256-k)\t\\n\"\n\t\"mov\tr11,#54\t\t\t@ r11= 54\t\t\t\\n\"\n\t\"mov\tr14,r14,LSR #8\t\t@ r14= (x0>>8)\t\t\t\\n\"\n\t\"mov\tr8,#57\t\t\t@ r8 = 57\t\t\t\\n\"\n\t\"mla\tr0,r14,r11,r0\t\t@ r0 = r += 54*x0\t\t\\n\"\n\t\"mla\tr1,r14,r11,r1\t\t@ r1 = g += 54*x0\t\t\\n\"\n\t\"mla\tr4,r14,r8, r4\t\t@ r4 = b += 57*x0\t\t\\n\"\n\t\"\t\t\t\t\t\t\t\t\\n\"\n\t\"sub\tr8, r0, r0, LSR #8\t@ r8 = r -= (r>>8)\t\t\\n\"\n\t\"sub\tr9, r1, r1, LSR #8\t@ r9 = g -= (r>>8)\t\t\\n\"\n\t\"sub\tr10,r4, r4, LSR #8\t@ r10= b -= (r>>8)\t\t\\n\"\n\t\"ldmfd\tr13!,{r0-r1,r12}\t\t\t\t\t\\n\"\n\t\"mov\tr8, r8, LSR #23\t\t@ r8 = r>>23\t\t\t\\n\"\n\t\"mov\tr9, r9, LSR #23\t\t@ r9 = g>>23\t\t\t\\n\"\n\t\"mov\tr10,r10,LSR #23\t\t@ r10= b>>23\t\t\t\\n\"\n\t\"ldrb\tr14,[r1],#1\t\t@ r8 = s[4]\t\t\t\\n\"\n\t\"strb\tr8, [r0],#1\t\t@ d[0] = r\t\t\t\\n\"\n\t\"strb\tr9, [r0],#1\t\t@ d[1] = g\t\t\t\\n\"\n\t\"strb\tr10,[r0],#1\t\t@ d[2] = b\t\t\t\\n\"\n\t\"strb\tr14,[r0],#1\t\t@ d[3] = s[4]\t\t\t\\n\"\n\t\"subs\tr2, r2, #1\t\t@ r2 = n--\t\t\t\\n\"\n\t\"beq\t9f\t\t\t\t\t\t\t\\n\"\n\t\"@ At this point, we've just decoded a pixel\t\t\t\\n\"\n\t\"@ r0 = dst  r1 = src  r2 = n  r8 = r  r9 = g  r10= b r12= CMYK \\n\"\n\t\"4:\t\t\t\t\t\t\t\t\\n\"\n\t\"ldrb\tr3, [r1], #4\t\t@ r3 = c\t\t\t\\n\"\n\t\"ldrb\tr6, [r1, #-1]\t\t@ r6 = k\t\t\t\\n\"\n\t\"ldrb\tr5, [r1, #-2]\t\t@ r5 = y\t\t\t\\n\"\n\t\"ldrb\tr4, [r1, #-3]\t\t@ r4 = m\t\t\t\\n\"\n\t\"eors\tr11,r6, #0xFF\t\t@ if (k == 255)\t\t\t\\n\"\n\t\"beq\t1b\t\t\t@   goto black\t\t\t\\n\"\n\t\"orr\tr7, r3, r4, LSL #8\t\t\t\t\t\\n\"\n\t\"orr\tr14,r5, r6, LSL #8\t\t\t\t\t\\n\"\n\t\"orrs\tr7, r7, r14,LSL #16\t@ r7 = cmyk\t\t\t\\n\"\n\t\"beq\t1b\t\t\t@ if (cmyk == 0) white\t\t\\n\"\n\t\"cmp\tr7, r12\t\t\t@ if (cmyk != CMYK)\t\t\\n\"\n\t\"bne\t3b\t\t\t@   not the same, loop\t\t\\n\"\n\t\"@ If we get here, we just matched a pixel we have just decoded \\n\"\n\t\"ldrb\tr3, [r1],#1\t\t@ r8 = s[4]\t\t\t\\n\"\n\t\"strb\tr8, [r0],#1\t\t@ d[0] = r\t\t\t\\n\"\n\t\"strb\tr9, [r0],#1\t\t@ d[1] = g\t\t\t\\n\"\n\t\"strb\tr10,[r0],#1\t\t@ d[2] = b\t\t\t\\n\"\n\t\"strb\tr3, [r0],#1\t\t@ d[3] = s[4]\t\t\t\\n\"\n\t\"subs\tr2, r2, #1\t\t@ r2 = n--\t\t\t\\n\"\n\t\"bne\t4b\t\t\t\t\t\t\t\\n\"\n\t\"9:\t\t\t\t\t\t\t\t\\n\"\n\t\"ldmfd\tr13!,{r4-r11,PC}\t@ pop, return to thumb\t\t\\n\"\n\tENTER_THUMB\n\t);\n}\n#endif\n\nstatic void fast_cmyk_to_rgb(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src)\n{\n\tunsigned char *s = src->samples;\n\tunsigned char *d = dst->samples;\n\tint n = src->w * src->h;\n#ifdef ARCH_ARM\n\tfast_cmyk_to_rgb_ARM(d, s, n);\n#else\n\tunsigned int C,M,Y,K,r,g,b;\n\n\tC = 0;\n\tM = 0;\n\tY = 0;\n\tK = 0;\n\tr = 255;\n\tg = 255;\n\tb = 255;\n\n\twhile (n--)\n\t{\n#ifdef SLOWCMYK\n\t\tunsigned int c = s[0];\n\t\tunsigned int m = s[1];\n\t\tunsigned int y = s[2];\n\t\tunsigned int k = s[3];\n\t\tunsigned int cm, c1m, cm1, c1m1, c1m1y, c1m1y1, c1my, c1my1, cm1y, cm1y1, cmy, cmy1;\n\t\tunsigned int x0, x1;\n\n\t\tif (c == C && m == M && y == Y && k == K)\n\t\t{\n\t\t\t/* Nothing to do */\n\t\t}\n\t\telse if (k == 0 && c == 0 && m == 0 && y == 0)\n\t\t{\n\t\t\tr = g = b = 255;\n\t\t\tC = 0;\n\t\t\tM = 0;\n\t\t\tY = 0;\n\t\t\tK = 0;\n\t\t}\n\t\telse if (k == 255)\n\t\t{\n\t\t\tr = g = b = 0;\n\t\t\tC = 0;\n\t\t\tM = 0;\n\t\t\tY = 0;\n\t\t\tK = 255;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tc += c>>7;\n\t\t\tm += m>>7;\n\t\t\ty += y>>7;\n\t\t\tk += k>>7;\n\t\t\ty >>= 1; /* Ditch 1 bit of Y to avoid overflow */\n\t\t\tcm = c * m;\n\t\t\tc1m = (m<<8) - cm;\n\t\t\tcm1 = (c<<8) - cm;\n\t\t\tc1m1 = ((256 - m)<<8) - cm1;\n\t\t\tc1m1y = c1m1 * y;\n\t\t\tc1m1y1 = (c1m1<<7) - c1m1y;\n\t\t\tc1my = c1m * y;\n\t\t\tc1my1 = (c1m<<7) - c1my;\n\t\t\tcm1y = cm1 * y;\n\t\t\tcm1y1 = (cm1<<7) - cm1y;\n\t\t\tcmy = cm * y;\n\t\t\tcmy1 = (cm<<7) - cmy;\n\n\t\t\t/* this is a matrix multiplication, unrolled for performance */\n\t\t\tx1 = c1m1y1 * k;\t/* 0 0 0 1 */\n\t\t\tx0 = (c1m1y1<<8) - x1;\t/* 0 0 0 0 */\n\t\t\tx1 = x1>>8;\t\t/* From 23 fractional bits to 15 */\n\t\t\tr = g = b = x0;\n\t\t\tr += 35 * x1;\t/* 0.1373 */\n\t\t\tg += 31 * x1;\t/* 0.1216 */\n\t\t\tb += 32 * x1;\t/* 0.1255 */\n\n\t\t\tx1 = c1m1y * k;\t\t/* 0 0 1 1 */\n\t\t\tx0 = (c1m1y<<8) - x1;\t/* 0 0 1 0 */\n\t\t\tx1 >>= 8;\t\t/* From 23 fractional bits to 15 */\n\t\t\tr += 28 * x1;\t/* 0.1098 */\n\t\t\tg += 26 * x1;\t/* 0.1020 */\n\t\t\tr += x0;\n\t\t\tx0 >>= 8;\t\t/* From 23 fractional bits to 15 */\n\t\t\tg += 243 * x0;\t/* 0.9490 */\n\n\t\t\tx1 = c1my1 * k;\t\t/* 0 1 0 1 */\n\t\t\tx0 = (c1my1<<8) - x1;\t/* 0 1 0 0 */\n\t\t\tx1 >>= 8;\t\t/* From 23 fractional bits to 15 */\n\t\t\tx0 >>= 8;\t\t/* From 23 fractional bits to 15 */\n\t\t\tr += 36 * x1;\t/* 0.1412 */\n\t\t\tr += 237 * x0;\t/* 0.9255 */\n\t\t\tb += 141 * x0;\t/* 0.5490 */\n\n\t\t\tx1 = c1my * k;\t\t/* 0 1 1 1 */\n\t\t\tx0 = (c1my<<8) - x1;\t/* 0 1 1 0 */\n\t\t\tx1 >>= 8;\t\t/* From 23 fractional bits to 15 */\n\t\t\tx0 >>= 8;\t\t/* From 23 fractional bits to 15 */\n\t\t\tr += 34 * x1;\t/* 0.1333 */\n\t\t\tr += 238 * x0;\t/* 0.9294 */\n\t\t\tg += 28 * x0;\t/* 0.1098 */\n\t\t\tb += 36 * x0;\t/* 0.1412 */\n\n\t\t\tx1 = cm1y1 * k;\t\t/* 1 0 0 1 */\n\t\t\tx0 = (cm1y1<<8) - x1;\t/* 1 0 0 0 */\n\t\t\tx1 >>= 8;\t\t/* From 23 fractional bits to 15 */\n\t\t\tx0 >>= 8;\t\t/* From 23 fractional bits to 15 */\n\t\t\tg += 15 * x1;\t/* 0.0588 */\n\t\t\tb += 36 * x1;\t/* 0.1412 */\n\t\t\tg += 174 * x0;\t/* 0.6784 */\n\t\t\tb += 240 * x0;\t/* 0.9373 */\n\n\t\t\tx1 = cm1y * k;\t\t/* 1 0 1 1 */\n\t\t\tx0 = (cm1y<<8) - x1;\t/* 1 0 1 0 */\n\t\t\tx1 >>= 8;\t\t/* From 23 fractional bits to 15 */\n\t\t\tx0 >>= 8;\t\t/* From 23 fractional bits to 15 */\n\t\t\tg += 19 * x1;\t/* 0.0745 */\n\t\t\tg += 167 * x0;\t/* 0.6510 */\n\t\t\tb += 80 * x0;\t/* 0.3137 */\n\n\t\t\tx1 = cmy1 * k;\t\t/* 1 1 0 1 */\n\t\t\tx0 = (cmy1<<8) - x1;\t/* 1 1 0 0 */\n\t\t\tx1 >>= 8;\t\t/* From 23 fractional bits to 15 */\n\t\t\tx0 >>= 8;\t\t/* From 23 fractional bits to 15 */\n\t\t\tb += 2 * x1;\t/* 0.0078 */\n\t\t\tr += 46 * x0;\t/* 0.1804 */\n\t\t\tg += 49 * x0;\t/* 0.1922 */\n\t\t\tb += 147 * x0;\t/* 0.5725 */\n\n\t\t\tx0 = cmy * (256-k);\t/* 1 1 1 0 */\n\t\t\tx0 >>= 8;\t\t/* From 23 fractional bits to 15 */\n\t\t\tr += 54 * x0;\t/* 0.2118 */\n\t\t\tg += 54 * x0;\t/* 0.2119 */\n\t\t\tb += 57 * x0;\t/* 0.2235 */\n\n\t\t\tr -= (r>>8);\n\t\t\tg -= (g>>8);\n\t\t\tb -= (b>>8);\n\t\t\tr = r>>23;\n\t\t\tg = g>>23;\n\t\t\tb = b>>23;\n\t\t\tC = c;\n\t\t\tM = m;\n\t\t\tY = y;\n\t\t\tK = k;\n\t\t}\n\t\td[0] = r;\n\t\td[1] = g;\n\t\td[2] = b;\n#else\n\t\td[0] = 255 - (unsigned char)fz_mini(s[0] + s[3], 255);\n\t\td[1] = 255 - (unsigned char)fz_mini(s[1] + s[3], 255);\n\t\td[2] = 255 - (unsigned char)fz_mini(s[2] + s[3], 255);\n#endif\n\t\td[3] = s[4];\n\t\ts += 5;\n\t\td += 4;\n\t}\n#endif\n}\n\nstatic void fast_cmyk_to_bgr(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src)\n{\n\tunsigned char *s = src->samples;\n\tunsigned char *d = dst->samples;\n\tint n = src->w * src->h;\n\twhile (n--)\n\t{\n#ifdef SLOWCMYK\n\t\tfloat cmyk[4], rgb[3];\n\t\tcmyk[0] = s[0] / 255.0f;\n\t\tcmyk[1] = s[1] / 255.0f;\n\t\tcmyk[2] = s[2] / 255.0f;\n\t\tcmyk[3] = s[3] / 255.0f;\n\t\tcmyk_to_rgb(ctx, NULL, cmyk, rgb);\n\t\td[0] = rgb[2] * 255;\n\t\td[1] = rgb[1] * 255;\n\t\td[2] = rgb[0] * 255;\n#else\n\t\td[0] = 255 - (unsigned char)fz_mini(s[2] + s[3], 255);\n\t\td[1] = 255 - (unsigned char)fz_mini(s[1] + s[3], 255);\n\t\td[2] = 255 - (unsigned char)fz_mini(s[0] + s[3], 255);\n#endif\n\t\td[3] = s[4];\n\t\ts += 5;\n\t\td += 4;\n\t}\n}\n\nstatic void fast_rgb_to_bgr(fz_pixmap *dst, fz_pixmap *src)\n{\n\tunsigned char *s = src->samples;\n\tunsigned char *d = dst->samples;\n\tint n = src->w * src->h;\n\twhile (n--)\n\t{\n\t\td[0] = s[2];\n\t\td[1] = s[1];\n\t\td[2] = s[0];\n\t\td[3] = s[3];\n\t\ts += 4;\n\t\td += 4;\n\t}\n}\n\nstatic void\nfz_std_conv_pixmap(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src)\n{\n\tfloat srcv[FZ_MAX_COLORS];\n\tfloat dstv[FZ_MAX_COLORS];\n\tint srcn, dstn;\n\tint k, i;\n\tunsigned int xy;\n\n\tfz_colorspace *ss = src->colorspace;\n\tfz_colorspace *ds = dst->colorspace;\n\n\tunsigned char *s = src->samples;\n\tunsigned char *d = dst->samples;\n\n\tassert(src->w == dst->w && src->h == dst->h);\n\tassert(src->n == ss->n + 1);\n\tassert(dst->n == ds->n + 1);\n\n\tsrcn = ss->n;\n\tdstn = ds->n;\n\n\txy = (unsigned int)(src->w * src->h);\n\n\t/* Special case for Lab colorspace (scaling of components to float) */\n\tif (!strcmp(ss->name, \"Lab\") && srcn == 3)\n\t{\n\t\tfz_color_converter cc;\n\n\t\tfz_lookup_color_converter(&cc, ctx, ds, ss);\n\t\tfor (; xy > 0; xy--)\n\t\t{\n\t\t\tsrcv[0] = *s++ / 255.0f * 100;\n\t\t\tsrcv[1] = *s++ - 128;\n\t\t\tsrcv[2] = *s++ - 128;\n\n\t\t\tcc.convert(&cc, dstv, srcv);\n\n\t\t\tfor (k = 0; k < dstn; k++)\n\t\t\t\t*d++ = dstv[k] * 255;\n\n\t\t\t*d++ = *s++;\n\t\t}\n\t}\n\n\t/* Brute-force for small images */\n\telse if (xy < 256)\n\t{\n\t\tfz_color_converter cc;\n\n\t\tfz_lookup_color_converter(&cc, ctx, ds, ss);\n\t\tfor (; xy > 0; xy--)\n\t\t{\n\t\t\tfor (k = 0; k < srcn; k++)\n\t\t\t\tsrcv[k] = *s++ / 255.0f;\n\n\t\t\tcc.convert(&cc, dstv, srcv);\n\n\t\t\tfor (k = 0; k < dstn; k++)\n\t\t\t\t*d++ = dstv[k] * 255;\n\n\t\t\t*d++ = *s++;\n\t\t}\n\t}\n\n\t/* 1-d lookup table for separation and similar colorspaces */\n\telse if (srcn == 1)\n\t{\n\t\tunsigned char lookup[FZ_MAX_COLORS * 256];\n\t\tfz_color_converter cc;\n\n\t\tfz_lookup_color_converter(&cc, ctx, ds, ss);\n\t\tfor (i = 0; i < 256; i++)\n\t\t{\n\t\t\tsrcv[0] = i / 255.0f;\n\t\t\tcc.convert(&cc, dstv, srcv);\n\t\t\tfor (k = 0; k < dstn; k++)\n\t\t\t\tlookup[i * dstn + k] = dstv[k] * 255;\n\t\t}\n\n\t\tfor (; xy > 0; xy--)\n\t\t{\n\t\t\ti = *s++;\n\t\t\tfor (k = 0; k < dstn; k++)\n\t\t\t\t*d++ = lookup[i * dstn + k];\n\t\t\t*d++ = *s++;\n\t\t}\n\t}\n\n\t/* Memoize colors using a hash table for the general case */\n\telse\n\t{\n\t\tfz_hash_table *lookup;\n\t\tunsigned char *color;\n\t\tunsigned char dummy = s[0] ^ 255;\n\t\tunsigned char *sold = &dummy;\n\t\tfz_color_converter cc;\n\n\t\tfz_lookup_color_converter(&cc, ctx, ds, ss);\n\t\tlookup = fz_new_hash_table(ctx, 509, srcn, -1);\n\n\t\tfor (; xy > 0; xy--)\n\t\t{\n\t\t\tif (*s == *sold && memcmp(sold,s,srcn) == 0)\n\t\t\t{\n\t\t\t\tsold = s;\n\t\t\t\tmemcpy(d, d-dstn-1, dstn);\n\t\t\t\td += dstn;\n\t\t\t\ts += srcn;\n\t\t\t\t*d++ = *s++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsold = s;\n\t\t\t\tcolor = fz_hash_find(ctx, lookup, s);\n\t\t\t\tif (color)\n\t\t\t\t{\n\t\t\t\t\tmemcpy(d, color, dstn);\n\t\t\t\t\ts += srcn;\n\t\t\t\t\td += dstn;\n\t\t\t\t\t*d++ = *s++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfor (k = 0; k < srcn; k++)\n\t\t\t\t\t\tsrcv[k] = *s++ / 255.0f;\n\t\t\t\t\tcc.convert(&cc, dstv, srcv);\n\t\t\t\t\tfor (k = 0; k < dstn; k++)\n\t\t\t\t\t\t*d++ = dstv[k] * 255;\n\n\t\t\t\t\tfz_hash_insert(ctx, lookup, s - srcn, d - dstn);\n\n\t\t\t\t\t*d++ = *s++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfz_free_hash(ctx, lookup);\n\t}\n}\n\nvoid\nfz_convert_pixmap(fz_context *ctx, fz_pixmap *dp, fz_pixmap *sp)\n{\n\tfz_colorspace *ss = sp->colorspace;\n\tfz_colorspace *ds = dp->colorspace;\n\n\tassert(ss && ds);\n\n\tdp->interpolate = sp->interpolate;\n\n\tif (ss == fz_default_gray)\n\t{\n\t\tif (ds == fz_default_rgb) fast_gray_to_rgb(dp, sp);\n\t\telse if (ds == fz_default_bgr) fast_gray_to_rgb(dp, sp); /* bgr == rgb here */\n\t\telse if (ds == fz_default_cmyk) fast_gray_to_cmyk(dp, sp);\n\t\telse fz_std_conv_pixmap(ctx, dp, sp);\n\t}\n\n\telse if (ss == fz_default_rgb)\n\t{\n\t\tif (ds == fz_default_gray) fast_rgb_to_gray(dp, sp);\n\t\telse if (ds == fz_default_bgr) fast_rgb_to_bgr(dp, sp);\n\t\telse if (ds == fz_default_cmyk) fast_rgb_to_cmyk(dp, sp);\n\t\telse fz_std_conv_pixmap(ctx, dp, sp);\n\t}\n\n\telse if (ss == fz_default_bgr)\n\t{\n\t\tif (ds == fz_default_gray) fast_bgr_to_gray(dp, sp);\n\t\telse if (ds == fz_default_rgb) fast_rgb_to_bgr(dp, sp); /* bgr = rgb here */\n\t\telse if (ds == fz_default_cmyk) fast_bgr_to_cmyk(sp, dp);\n\t\telse fz_std_conv_pixmap(ctx, dp, sp);\n\t}\n\n\telse if (ss == fz_default_cmyk)\n\t{\n\t\tif (ds == fz_default_gray) fast_cmyk_to_gray(dp, sp);\n\t\telse if (ds == fz_default_bgr) fast_cmyk_to_bgr(ctx, dp, sp);\n\t\telse if (ds == fz_default_rgb) fast_cmyk_to_rgb(ctx, dp, sp);\n\t\telse fz_std_conv_pixmap(ctx, dp, sp);\n\t}\n\n\telse fz_std_conv_pixmap(ctx, dp, sp);\n}\n\n/* Convert a single color */\n\nstatic void\nstd_conv_color(fz_color_converter *cc, float *dstv, const float *srcv)\n{\n\tfloat rgb[3];\n\tint i;\n\tfz_colorspace *srcs = cc->ss;\n\tfz_colorspace *dsts = cc->ds;\n\tfz_context *ctx = cc->ctx;\n\n\tif (srcs != dsts)\n\t{\n\t\tassert(srcs->to_rgb && dsts->from_rgb);\n\t\tsrcs->to_rgb(ctx, srcs, srcv, rgb);\n\t\tdsts->from_rgb(ctx, dsts, rgb, dstv);\n\t\tfor (i = 0; i < dsts->n; i++)\n\t\t\tdstv[i] = fz_clamp(dstv[i], 0, 1);\n\t}\n\telse\n\t{\n\t\tfor (i = 0; i < srcs->n; i++)\n\t\t\tdstv[i] = srcv[i];\n\t}\n}\n\nstatic void\ng2rgb(fz_color_converter *cc, float *dv, const float *sv)\n{\n\tdv[0] = sv[0];\n\tdv[1] = sv[0];\n\tdv[2] = sv[0];\n}\n\nstatic void\ng2cmyk(fz_color_converter *cc, float *dv, const float *sv)\n{\n\tdv[0] = 0;\n\tdv[1] = 0;\n\tdv[2] = 0;\n\tdv[3] = 1 - sv[0];\n}\n\nstatic void\nrgb2g(fz_color_converter *cc, float *dv, const float *sv)\n{\n\tdv[0] = sv[0] * 0.3f + sv[1] * 0.59f + sv[2] * 0.11f;\n}\n\nstatic void\nrgb2bgr(fz_color_converter *cc, float *dv, const float *sv)\n{\n\tdv[0] = sv[2];\n\tdv[1] = sv[1];\n\tdv[2] = sv[0];\n}\n\nstatic void\nrgb2cmyk(fz_color_converter *cc, float *dv, const float *sv)\n{\n\tfloat c = 1 - sv[0];\n\tfloat m = 1 - sv[1];\n\tfloat y = 1 - sv[2];\n\tfloat k = fz_min(c, fz_min(m, y));\n\tdv[0] = c - k;\n\tdv[1] = m - k;\n\tdv[2] = y - k;\n\tdv[3] = k;\n}\n\nstatic void\nbgr2g(fz_color_converter *cc, float *dv, const float *sv)\n{\n\tdv[0] = sv[0] * 0.11f + sv[1] * 0.59f + sv[2] * 0.3f;\n}\n\nstatic void\nbgr2cmyk(fz_color_converter *cc, float *dv, const float *sv)\n{\n\tfloat c = 1 - sv[2];\n\tfloat m = 1 - sv[1];\n\tfloat y = 1 - sv[0];\n\tfloat k = fz_min(c, fz_min(m, y));\n\tdv[0] = c - k;\n\tdv[1] = m - k;\n\tdv[2] = y - k;\n\tdv[3] = k;\n}\n\nstatic void\ncmyk2g(fz_color_converter *cc, float *dv, const float *sv)\n{\n\tfloat c = sv[0] * 0.3f;\n\tfloat m = sv[1] * 0.59f;\n\tfloat y = sv[2] * 0.11f;\n\tdv[0] = 1 - fz_min(c + m + y + sv[3], 1);\n}\n\nstatic void\ncmyk2rgb(fz_color_converter *cc, float *dv, const float *sv)\n{\n#ifdef SLOWCMYK\n\tcmyk_to_rgb(cc->ctx, NULL, sv, dv);\n#else\n\tdv[0] = 1 - fz_min(sv[0] + sv[3], 1);\n\tdv[1] = 1 - fz_min(sv[1] + sv[3], 1);\n\tdv[2] = 1 - fz_min(sv[2] + sv[3], 1);\n#endif\n}\n\nstatic void\ncmyk2bgr(fz_color_converter *cc, float *dv, const float *sv)\n{\n#ifdef SLOWCMYK\n\tfloat rgb[3];\n\tcmyk_to_rgb(cc->ctx, NULL, sv, rgb);\n\tdv[0] = rgb[2];\n\tdv[1] = rgb[1];\n\tdv[2] = rgb[0];\n#else\n\tdv[0] = 1 - fz_min(sv[2] + sv[3], 1);\n\tdv[1] = 1 - fz_min(sv[1] + sv[3], 1);\n\tdv[2] = 1 - fz_min(sv[0] + sv[3], 1);\n#endif\n}\n\nvoid fz_lookup_color_converter(fz_color_converter *cc, fz_context *ctx, fz_colorspace *ds, fz_colorspace *ss)\n{\n\tcc->ctx = ctx;\n\tcc->ds = ds;\n\tcc->ss = ss;\n\tif (ss == fz_default_gray)\n\t{\n\t\tif ((ds == fz_default_rgb) || (ds == fz_default_bgr))\n\t\t\tcc->convert = g2rgb;\n\t\telse if (ds == fz_default_cmyk)\n\t\t\tcc->convert = g2cmyk;\n\t\telse\n\t\t\tcc->convert = std_conv_color;\n\t}\n\n\telse if (ss == fz_default_rgb)\n\t{\n\t\tif (ds == fz_default_gray)\n\t\t\tcc->convert = rgb2g;\n\t\telse if (ds == fz_default_bgr)\n\t\t\tcc->convert = rgb2bgr;\n\t\telse if (ds == fz_default_cmyk)\n\t\t\tcc->convert = rgb2cmyk;\n\t\telse\n\t\t\tcc->convert = std_conv_color;\n\t}\n\n\telse if (ss == fz_default_bgr)\n\t{\n\t\tif (ds == fz_default_gray)\n\t\t\tcc->convert = bgr2g;\n\t\telse if (ds == fz_default_rgb)\n\t\t\tcc->convert = rgb2bgr;\n\t\telse if (ds == fz_default_cmyk)\n\t\t\tcc->convert = bgr2cmyk;\n\t\telse\n\t\t\tcc->convert = std_conv_color;\n\t}\n\n\telse if (ss == fz_default_cmyk)\n\t{\n\t\tif (ds == fz_default_gray)\n\t\t\tcc->convert = cmyk2g;\n\t\telse if (ds == fz_default_rgb)\n\t\t\tcc->convert = cmyk2rgb;\n\t\telse if (ds == fz_default_bgr)\n\t\t\tcc->convert = cmyk2bgr;\n\t\telse\n\t\t\tcc->convert = std_conv_color;\n\t}\n\n\telse\n\t\tcc->convert = std_conv_color;\n}\n\nvoid\nfz_convert_color(fz_context *ctx, fz_colorspace *ds, float *dv, fz_colorspace *ss, const float *sv)\n{\n\tfz_color_converter cc;\n\tfz_lookup_color_converter(&cc, ctx, ds, ss);\n\tcc.convert(&cc, dv, sv);\n}\n\n/* Indexed */\n\nstruct indexed\n{\n\tfz_colorspace *base;\n\tint high;\n\tunsigned char *lookup;\n};\n\nstatic void\nindexed_to_rgb(fz_context *ctx, fz_colorspace *cs, const float *color, float *rgb)\n{\n\tstruct indexed *idx = cs->data;\n\tfloat alt[FZ_MAX_COLORS];\n\tint i, k;\n\ti = color[0] * 255;\n\ti = fz_clampi(i, 0, idx->high);\n\tfor (k = 0; k < idx->base->n; k++)\n\t\talt[k] = idx->lookup[i * idx->base->n + k] / 255.0f;\n\tidx->base->to_rgb(ctx, idx->base, alt, rgb);\n}\n\nstatic void\nfree_indexed(fz_context *ctx, fz_colorspace *cs)\n{\n\tstruct indexed *idx = cs->data;\n\tif (idx->base)\n\t\tfz_drop_colorspace(ctx, idx->base);\n\tfz_free(ctx, idx->lookup);\n\tfz_free(ctx, idx);\n}\n\nfz_colorspace *\nfz_new_indexed_colorspace(fz_context *ctx, fz_colorspace *base, int high, unsigned char *lookup)\n{\n\tfz_colorspace *cs;\n\tstruct indexed *idx;\n\n\tidx = fz_malloc_struct(ctx, struct indexed);\n\tidx->lookup = lookup;\n\tidx->base = base;\n\tidx->high = high;\n\n\tfz_try(ctx)\n\t{\n\t\tcs = fz_new_colorspace(ctx, \"Indexed\", 1);\n\t\tcs->to_rgb = indexed_to_rgb;\n\t\tcs->free_data = free_indexed;\n\t\tcs->data = idx;\n\t\tcs->size += sizeof(*idx) + (base->n * (idx->high + 1)) + base->size;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, idx);\n\t\tfz_rethrow_message(ctx, \"failed to create indexed colorspace\");\n\t}\n\treturn cs;\n}\n\nfz_pixmap *\nfz_expand_indexed_pixmap(fz_context *ctx, fz_pixmap *src)\n{\n\tstruct indexed *idx;\n\tfz_pixmap *dst;\n\tunsigned char *s, *d;\n\tint y, x, k, n, high;\n\tunsigned char *lookup;\n\tfz_irect bbox;\n\n\tassert(src->colorspace->to_rgb == indexed_to_rgb);\n\tassert(src->n == 2);\n\n\tidx = src->colorspace->data;\n\thigh = idx->high;\n\tlookup = idx->lookup;\n\tn = idx->base->n;\n\n\tdst = fz_new_pixmap_with_bbox(ctx, idx->base, fz_pixmap_bbox(ctx, src, &bbox));\n\ts = src->samples;\n\td = dst->samples;\n\n\tfor (y = 0; y < src->h; y++)\n\t{\n\t\tfor (x = 0; x < src->w; x++)\n\t\t{\n\t\t\tint v = *s++;\n\t\t\tint a = *s++;\n\t\t\tv = fz_mini(v, high);\n\t\t\tfor (k = 0; k < n; k++)\n\t\t\t\t*d++ = fz_mul255(lookup[v * n + k], a);\n\t\t\t*d++ = a;\n\t\t}\n\t}\n\n\tdst->interpolate = src->interpolate;\n\n\treturn dst;\n}\n\ntypedef struct fz_cached_color_converter\n{\n\tfz_color_converter base;\n\tfz_hash_table *hash;\n\n}\nfz_cached_color_converter;\n\nstatic void fz_cached_color_convert(fz_color_converter *cc_, float *ds, const float *ss)\n{\n\tfz_cached_color_converter *cc = cc_->opaque;\n\tfz_context *ctx = cc->base.ctx;\n\tvoid *val = fz_hash_find(ctx, cc->hash, ss);\n\tint n = cc->base.ds->n * sizeof(float);\n\tfz_color_converter *base_cc = &cc->base;\n\n\tif (val)\n\t{\n\t\tmemcpy(ds, val, n);\n\t\treturn;\n\t}\n\n\tbase_cc->convert(base_cc, ds, ss);\n\tval = fz_malloc(ctx, n);\n\tmemcpy(val, ds, n);\n\tfz_try(ctx)\n\t{\n\t\tfz_hash_insert(ctx, cc->hash, ss, val);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, val);\n\t}\n}\n\nvoid fz_init_cached_color_converter(fz_context *ctx, fz_color_converter *cc, fz_colorspace *ds, fz_colorspace *ss)\n{\n\tint n = ss->n;\n\tfz_cached_color_converter *cached = fz_malloc_struct(ctx, fz_cached_color_converter);\n\n\tfz_try(ctx)\n\t{\n\t\tfz_lookup_color_converter(&cached->base, ctx, ds, ss);\n\t\tcached->hash = fz_new_hash_table(ctx, 256, n * sizeof(float), -1);\n\t\tcc->convert = fz_cached_color_convert;\n\t\tcc->ctx = ctx;\n\t\tcc->ds = ds;\n\t\tcc->ss = ss;\n\t\tcc->opaque = cached;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free_hash(ctx, cached->hash);\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nvoid fz_fin_cached_color_converter(fz_color_converter *cc_)\n{\n\tfz_cached_color_converter *cc;\n\tfz_context *ctx;\n\tint i, n;\n\n\tif (cc_ == NULL)\n\t\treturn;\n\tcc = cc_->opaque;\n\tif (cc == NULL)\n\t\treturn;\n\tcc_->opaque = NULL;\n\tctx = cc_->ctx;\n\n\tn = fz_hash_len(ctx, cc->hash);\n\tfor (i = 0; i < n; i++)\n\t{\n\t\tvoid *v = fz_hash_get_val(ctx, cc->hash, i);\n\t\tif (v)\n\t\t\tfz_free(ctx, v);\n\t}\n\tfz_free_hash(ctx, cc->hash);\n\tfz_free(ctx, cc);\n}\n\n/* SumatraPDF: support transfer functions */\nfz_transfer_function *\nfz_keep_transfer_function(fz_context *ctx, fz_transfer_function *tr)\n{\n\treturn fz_keep_storable(ctx, &tr->storable);\n}\n\nvoid\nfz_drop_transfer_function(fz_context *ctx, fz_transfer_function *tr)\n{\n\tfz_drop_storable(ctx, &tr->storable);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/compressed-buffer.c",
    "content": "#include \"mupdf/fitz.h\"\n\n/* This code needs to be kept out of stm_buffer.c to avoid it being\n * pulled into cmapdump.c */\n\nvoid\nfz_free_compressed_buffer(fz_context *ctx, fz_compressed_buffer *buf)\n{\n\tif (!buf)\n\t\treturn;\n\n\tfz_drop_buffer(ctx, buf->buffer);\n\tfz_free(ctx, buf);\n}\n\nfz_stream *\nfz_open_image_decomp_stream_from_buffer(fz_context *ctx, fz_compressed_buffer *buffer, int *l2factor)\n{\n\tfz_stream *chain = fz_open_buffer(ctx, buffer->buffer);\n\n\treturn fz_open_image_decomp_stream(ctx, chain, &buffer->params, l2factor);\n}\n\nfz_stream *\nfz_open_image_decomp_stream(fz_context *ctx, fz_stream *chain, fz_compression_params *params, int *l2factor)\n{\n\tswitch (params->type)\n\t{\n\tcase FZ_IMAGE_FAX:\n\t\t*l2factor = 0;\n\t\treturn fz_open_faxd(chain,\n\t\t\t\tparams->u.fax.k,\n\t\t\t\tparams->u.fax.end_of_line,\n\t\t\t\tparams->u.fax.encoded_byte_align,\n\t\t\t\tparams->u.fax.columns,\n\t\t\t\tparams->u.fax.rows,\n\t\t\t\tparams->u.fax.end_of_block,\n\t\t\t\tparams->u.fax.black_is_1);\n\tcase FZ_IMAGE_JPEG:\n\t\tif (*l2factor > 3)\n\t\t\t*l2factor = 3;\n\t\treturn fz_open_dctd(chain, params->u.jpeg.color_transform, *l2factor, NULL);\n\tcase FZ_IMAGE_RLD:\n\t\t*l2factor = 0;\n\t\treturn fz_open_rld(chain);\n\tcase FZ_IMAGE_FLATE:\n\t\t*l2factor = 0;\n\t\tchain = fz_open_flated(chain, 15);\n\t\tif (params->u.flate.predictor > 1)\n\t\t\tchain = fz_open_predict(chain, params->u.flate.predictor, params->u.flate.columns, params->u.flate.colors, params->u.flate.bpc);\n\t\treturn chain;\n\tcase FZ_IMAGE_LZW:\n\t\t*l2factor = 0;\n\t\tchain = fz_open_lzwd(chain, params->u.lzw.early_change);\n\t\tif (params->u.lzw.predictor > 1)\n\t\t\tchain = fz_open_predict(chain, params->u.lzw.predictor, params->u.lzw.columns, params->u.lzw.colors, params->u.lzw.bpc);\n\t\treturn chain;\n\tdefault:\n\t\t*l2factor = 0;\n\t\tbreak;\n\t}\n\n\treturn chain;\n}\n\nfz_stream *\nfz_open_compressed_buffer(fz_context *ctx, fz_compressed_buffer *buffer)\n{\n\tint l2factor = 0;\n\n\treturn fz_open_image_decomp_stream_from_buffer(ctx, buffer, &l2factor);\n}\n\nunsigned int\nfz_compressed_buffer_size(fz_compressed_buffer *buffer)\n{\n\tif (!buffer || !buffer->buffer)\n\t\treturn 0;\n\treturn (unsigned int)buffer->buffer->cap;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/context.c",
    "content": "#include \"mupdf/fitz.h\"\n\nstruct fz_id_context_s\n{\n\tint refs;\n\tint id;\n};\n\nstatic void\nfz_drop_id_context(fz_context *ctx)\n{\n\tint refs;\n\tfz_id_context *id = ctx->id;\n\n\tif (id == NULL)\n\t\treturn;\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\trefs = --id->refs;\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\tif (refs == 0)\n\t\tfz_free(ctx, id);\n}\n\nstatic void\nfz_new_id_context(fz_context *ctx)\n{\n\tctx->id = fz_malloc_struct(ctx, fz_id_context);\n\tctx->id->refs = 1;\n\tctx->id->id = 0;\n}\n\nstatic fz_id_context *\nfz_keep_id_context(fz_context *ctx)\n{\n\tfz_id_context *id = ctx->id;\n\n\tif (id == NULL)\n\t\treturn NULL;\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\t++id->refs;\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\treturn id;\n}\n\nvoid\nfz_free_context(fz_context *ctx)\n{\n\tif (!ctx)\n\t\treturn;\n\n\t/* Other finalisation calls go here (in reverse order) */\n\tfz_drop_document_handler_context(ctx);\n\tfz_drop_glyph_cache_context(ctx);\n\tfz_drop_store_context(ctx);\n\tfz_free_aa_context(ctx);\n\tfz_drop_colorspace_context(ctx);\n\tfz_drop_font_context(ctx);\n\tfz_drop_id_context(ctx);\n\n\tif (ctx->warn)\n\t{\n\t\tfz_flush_warnings(ctx);\n\t\tfz_free(ctx, ctx->warn);\n\t}\n\n\tif (ctx->error)\n\t{\n\t\tassert(ctx->error->top == -1);\n\t\tfz_free(ctx, ctx->error);\n\t}\n\n\t/* Free the context itself */\n\tctx->alloc->free(ctx->alloc->user, ctx);\n}\n\n/* Allocate new context structure, and initialise allocator, and sections\n * that aren't shared between contexts.\n */\nstatic fz_context *\nnew_context_phase1(fz_alloc_context *alloc, fz_locks_context *locks)\n{\n\tfz_context *ctx;\n\n\tctx = alloc->malloc(alloc->user, sizeof(fz_context));\n\tif (!ctx)\n\t\treturn NULL;\n\tmemset(ctx, 0, sizeof *ctx);\n\tctx->alloc = alloc;\n\tctx->locks = locks;\n\n\tctx->glyph_cache = NULL;\n\n\tctx->error = fz_malloc_no_throw(ctx, sizeof(fz_error_context));\n\tif (!ctx->error)\n\t\tgoto cleanup;\n\tctx->error->top = -1;\n\tctx->error->errcode = FZ_ERROR_NONE;\n\tctx->error->message[0] = 0;\n\n\tctx->warn = fz_malloc_no_throw(ctx, sizeof(fz_warn_context));\n\tif (!ctx->warn)\n\t\tgoto cleanup;\n\tctx->warn->message[0] = 0;\n\tctx->warn->count = 0;\n\n\t/* New initialisation calls for context entries go here */\n\tfz_try(ctx)\n\t{\n\t\tfz_new_aa_context(ctx);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tgoto cleanup;\n\t}\n\n\treturn ctx;\n\ncleanup:\n\tfprintf(stderr, \"cannot create context (phase 1)\\n\");\n\tfz_free_context(ctx);\n\treturn NULL;\n}\n\nfz_context *\nfz_new_context_imp(fz_alloc_context *alloc, fz_locks_context *locks, unsigned int max_store, const char *version)\n{\n\tfz_context *ctx;\n\n\tif (strcmp(version, FZ_VERSION))\n\t{\n\t\tfprintf(stderr, \"cannot create context: incompatible header (%s) and library (%s) versions\\n\", version, FZ_VERSION);\n\t\treturn NULL;\n\t}\n\n\tif (!alloc)\n\t\talloc = &fz_alloc_default;\n\n\tif (!locks)\n\t\tlocks = &fz_locks_default;\n\n\tctx = new_context_phase1(alloc, locks);\n\tif (!ctx)\n\t\treturn NULL;\n\n\t/* Now initialise sections that are shared */\n\tfz_try(ctx)\n\t{\n\t\tfz_new_store_context(ctx, max_store);\n\t\tfz_new_glyph_cache_context(ctx);\n\t\tfz_new_colorspace_context(ctx);\n\t\tfz_new_font_context(ctx);\n\t\tfz_new_id_context(ctx);\n\t\tfz_new_document_handler_context(ctx);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfprintf(stderr, \"cannot create context (phase 2)\\n\");\n\t\tfz_free_context(ctx);\n\t\treturn NULL;\n\t}\n\treturn ctx;\n}\n\nfz_context *\nfz_clone_context(fz_context *ctx)\n{\n\t/* We cannot safely clone the context without having locking/\n\t * unlocking functions. */\n\tif (ctx == NULL || ctx->locks == &fz_locks_default)\n\t\treturn NULL;\n\treturn fz_clone_context_internal(ctx);\n}\n\nfz_context *\nfz_clone_context_internal(fz_context *ctx)\n{\n\tfz_context *new_ctx;\n\n\tif (ctx == NULL || ctx->alloc == NULL)\n\t\treturn NULL;\n\n\tnew_ctx = new_context_phase1(ctx->alloc, ctx->locks);\n\tif (!new_ctx)\n\t\treturn NULL;\n\n\t/* Inherit AA defaults from old context. */\n\tfz_copy_aa_context(new_ctx, ctx);\n\n\t/* Keep thread lock checking happy by copying pointers first and locking under new context */\n\tnew_ctx->store = ctx->store;\n\tnew_ctx->store = fz_keep_store_context(new_ctx);\n\tnew_ctx->glyph_cache = ctx->glyph_cache;\n\tnew_ctx->glyph_cache = fz_keep_glyph_cache(new_ctx);\n\tnew_ctx->colorspace = ctx->colorspace;\n\tnew_ctx->colorspace = fz_keep_colorspace_context(new_ctx);\n\tnew_ctx->font = ctx->font;\n\tnew_ctx->font = fz_keep_font_context(new_ctx);\n\tnew_ctx->id = ctx->id;\n\tnew_ctx->id = fz_keep_id_context(new_ctx);\n\tnew_ctx->handler = ctx->handler;\n\tnew_ctx->handler = fz_keep_document_handler_context(new_ctx);\n\n\treturn new_ctx;\n}\n\nint\nfz_gen_id(fz_context *ctx)\n{\n\tint id;\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\t/* We'll never wrap around in normal use, but if we *do*, then avoid\n\t * 0. */\n\tdo\n\t{\n\t\tid = ++ctx->id->id;\n\t}\n\twhile (id == 0);\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\treturn id;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/crypt-aes.c",
    "content": "/*\n *\tFIPS-197 compliant AES implementation\n *\n *\tCopyright (C) 2006-2007 Christophe Devine\n *\n *\tRedistribution and use in source and binary forms, with or without\n *\tmodification, are permitted provided that the following conditions\n *\tare met:\n *\n *\t* Redistributions of source code _must_ retain the above copyright\n *\t\tnotice, this list of conditions and the following disclaimer.\n *\t* Redistributions in binary form may or may not reproduce the above\n *\t\tcopyright notice, this list of conditions and the following\n *\t\tdisclaimer in the documentation and/or other materials provided\n *\t\twith the distribution.\n *\t* Neither the name of XySSL nor the names of its contributors may be\n *\t\tused to endorse or promote products derived from this software\n *\t\twithout specific prior written permission.\n *\n *\tTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n *\t\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n *\tLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n *\tFOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n *\tOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n *\tSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n *\tTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n *\tPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n *\tLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n *\tNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n *\tSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/*\n *\tThe AES block cipher was designed by Vincent Rijmen and Joan Daemen.\n *\n *\thttp://csrc.nist.gov/encryption/aes/rijndael/Rijndael.pdf\n *\thttp://csrc.nist.gov/publications/fips/fips197/fips-197.pdf\n */\n\n#include \"mupdf/fitz.h\"\n\n#define aes_context fz_aes\n\n/* AES block cipher implementation from XYSSL */\n\n/*\n * 32-bit integer manipulation macros (little endian)\n */\n#ifndef GET_ULONG_LE\n#define GET_ULONG_LE(n,b,i)\t\t\t\t\t\\\n{\t\t\t\t\t\t\t\t\\\n\t(n) = ( (unsigned long) (b)[(i)] )\t\t\t\\\n\t\t| ( (unsigned long) (b)[(i) + 1] << 8 )\t\t\\\n\t\t| ( (unsigned long) (b)[(i) + 2] << 16 )\t\\\n\t\t| ( (unsigned long) (b)[(i) + 3] << 24 );\t\\\n}\n#endif\n\n#ifndef PUT_ULONG_LE\n#define PUT_ULONG_LE(n,b,i)\t\t\t\t\\\n{\t\t\t\t\t\t\t\\\n\t(b)[(i) ] = (unsigned char) ( (n) );\t\t\\\n\t(b)[(i) + 1] = (unsigned char) ( (n) >> 8 );\t\\\n\t(b)[(i) + 2] = (unsigned char) ( (n) >> 16 );\t\\\n\t(b)[(i) + 3] = (unsigned char) ( (n) >> 24 );\t\\\n}\n#endif\n\n/*\n * Forward S-box & tables\n */\nstatic unsigned char FSb[256];\nstatic unsigned long FT0[256];\nstatic unsigned long FT1[256];\nstatic unsigned long FT2[256];\nstatic unsigned long FT3[256];\n\n/*\n * Reverse S-box & tables\n */\nstatic unsigned char RSb[256];\nstatic unsigned long RT0[256];\nstatic unsigned long RT1[256];\nstatic unsigned long RT2[256];\nstatic unsigned long RT3[256];\n\n/*\n * Round constants\n */\nstatic unsigned long RCON[10];\n\n/*\n * Tables generation code\n */\n#define ROTL8(x) ( ( x << 8 ) & 0xFFFFFFFF ) | ( x >> 24 )\n#define XTIME(x) ( ( x << 1 ) ^ ( ( x & 0x80 ) ? 0x1B : 0x00 ) )\n#define MUL(x,y) ( ( x && y ) ? pow[(log[x]+log[y]) % 255] : 0 )\n\nstatic int aes_init_done = 0;\n\nstatic void aes_gen_tables( void )\n{\n\tint i, x, y, z;\n\tint pow[256];\n\tint log[256];\n\n\t/*\n\t * compute pow and log tables over GF(2^8)\n\t */\n\tfor( i = 0, x = 1; i < 256; i++ )\n\t{\n\t\tpow[i] = x;\n\t\tlog[x] = i;\n\t\tx = ( x ^ XTIME( x ) ) & 0xFF;\n\t}\n\n\t/*\n\t * calculate the round constants\n\t */\n\tfor( i = 0, x = 1; i < 10; i++ )\n\t{\n\t\tRCON[i] = (unsigned long) x;\n\t\tx = XTIME( x ) & 0xFF;\n\t}\n\n\t/*\n\t * generate the forward and reverse S-boxes\n\t */\n\tFSb[0x00] = 0x63;\n\tRSb[0x63] = 0x00;\n\n\tfor( i = 1; i < 256; i++ )\n\t{\n\t\tx = pow[255 - log[i]];\n\n\t\ty = x; y = ( (y << 1) | (y >> 7) ) & 0xFF;\n\t\tx ^= y; y = ( (y << 1) | (y >> 7) ) & 0xFF;\n\t\tx ^= y; y = ( (y << 1) | (y >> 7) ) & 0xFF;\n\t\tx ^= y; y = ( (y << 1) | (y >> 7) ) & 0xFF;\n\t\tx ^= y ^ 0x63;\n\n\t\tFSb[i] = (unsigned char) x;\n\t\tRSb[x] = (unsigned char) i;\n\t}\n\n\t/*\n\t * generate the forward and reverse tables\n\t */\n\tfor( i = 0; i < 256; i++ )\n\t{\n\t\tx = FSb[i];\n\t\ty = XTIME( x ) & 0xFF;\n\t\tz = ( y ^ x ) & 0xFF;\n\n\t\tFT0[i] = ( (unsigned long) y ) ^\n\t\t( (unsigned long) x <<\t8 ) ^\n\t\t( (unsigned long) x << 16 ) ^\n\t\t( (unsigned long) z << 24 );\n\n\t\tFT1[i] = ROTL8( FT0[i] );\n\t\tFT2[i] = ROTL8( FT1[i] );\n\t\tFT3[i] = ROTL8( FT2[i] );\n\n\t\tx = RSb[i];\n\n\t\tRT0[i] = ( (unsigned long) MUL( 0x0E, x ) ) ^\n\t\t( (unsigned long) MUL( 0x09, x ) << 8 ) ^\n\t\t( (unsigned long) MUL( 0x0D, x ) << 16 ) ^\n\t\t( (unsigned long) MUL( 0x0B, x ) << 24 );\n\n\t\tRT1[i] = ROTL8( RT0[i] );\n\t\tRT2[i] = ROTL8( RT1[i] );\n\t\tRT3[i] = ROTL8( RT2[i] );\n\t}\n}\n\n/*\n * AES key schedule (encryption)\n */\nint aes_setkey_enc( aes_context *ctx, const unsigned char *key, int keysize )\n{\n\tint i;\n\tunsigned long *RK;\n\n#if !defined(XYSSL_AES_ROM_TABLES)\n\tif( aes_init_done == 0 )\n\t{\n\t\taes_gen_tables();\n\t\taes_init_done = 1;\n\t}\n#endif\n\n\tswitch( keysize )\n\t{\n\tcase 128: ctx->nr = 10; break;\n\tcase 192: ctx->nr = 12; break;\n\tcase 256: ctx->nr = 14; break;\n\tdefault : return 1;\n\t}\n\n#if defined(PADLOCK_ALIGN16)\n\tctx->rk = RK = PADLOCK_ALIGN16( ctx->buf );\n#else\n\tctx->rk = RK = ctx->buf;\n#endif\n\n\tfor( i = 0; i < (keysize >> 5); i++ )\n\t{\n\t\tGET_ULONG_LE( RK[i], key, i << 2 );\n\t}\n\n\tswitch( ctx->nr )\n\t{\n\tcase 10:\n\n\t\tfor( i = 0; i < 10; i++, RK += 4 )\n\t\t{\n\t\t\tRK[4] = RK[0] ^ RCON[i] ^\n\t\t\t\t( FSb[ ( RK[3] >> 8 ) & 0xFF ] ) ^\n\t\t\t\t( FSb[ ( RK[3] >> 16 ) & 0xFF ] << 8 ) ^\n\t\t\t\t( FSb[ ( RK[3] >> 24 ) & 0xFF ] << 16 ) ^\n\t\t\t\t( FSb[ ( RK[3] ) & 0xFF ] << 24 );\n\n\t\t\tRK[5] = RK[1] ^ RK[4];\n\t\t\tRK[6] = RK[2] ^ RK[5];\n\t\t\tRK[7] = RK[3] ^ RK[6];\n\t\t}\n\t\tbreak;\n\n\tcase 12:\n\n\t\tfor( i = 0; i < 8; i++, RK += 6 )\n\t\t{\n\t\t\tRK[6] = RK[0] ^ RCON[i] ^\n\t\t\t\t( FSb[ ( RK[5] >> 8 ) & 0xFF ] ) ^\n\t\t\t\t( FSb[ ( RK[5] >> 16 ) & 0xFF ] << 8 ) ^\n\t\t\t\t( FSb[ ( RK[5] >> 24 ) & 0xFF ] << 16 ) ^\n\t\t\t\t( FSb[ ( RK[5] ) & 0xFF ] << 24 );\n\n\t\t\tRK[7] = RK[1] ^ RK[6];\n\t\t\tRK[8] = RK[2] ^ RK[7];\n\t\t\tRK[9] = RK[3] ^ RK[8];\n\t\t\tRK[10] = RK[4] ^ RK[9];\n\t\t\tRK[11] = RK[5] ^ RK[10];\n\t\t}\n\t\tbreak;\n\n\tcase 14:\n\n\t\tfor( i = 0; i < 7; i++, RK += 8 )\n\t\t{\n\t\t\tRK[8] = RK[0] ^ RCON[i] ^\n\t\t\t\t( FSb[ ( RK[7] >> 8 ) & 0xFF ] ) ^\n\t\t\t\t( FSb[ ( RK[7] >> 16 ) & 0xFF ] << 8 ) ^\n\t\t\t\t( FSb[ ( RK[7] >> 24 ) & 0xFF ] << 16 ) ^\n\t\t\t\t( FSb[ ( RK[7] ) & 0xFF ] << 24 );\n\n\t\t\tRK[9] = RK[1] ^ RK[8];\n\t\t\tRK[10] = RK[2] ^ RK[9];\n\t\t\tRK[11] = RK[3] ^ RK[10];\n\n\t\t\tRK[12] = RK[4] ^\n\t\t\t\t( FSb[ ( RK[11] ) & 0xFF ] ) ^\n\t\t\t\t( FSb[ ( RK[11] >> 8 ) & 0xFF ] << 8 ) ^\n\t\t\t\t( FSb[ ( RK[11] >> 16 ) & 0xFF ] << 16 ) ^\n\t\t\t\t( FSb[ ( RK[11] >> 24 ) & 0xFF ] << 24 );\n\n\t\t\tRK[13] = RK[5] ^ RK[12];\n\t\t\tRK[14] = RK[6] ^ RK[13];\n\t\t\tRK[15] = RK[7] ^ RK[14];\n\t\t}\n\t\tbreak;\n\n\tdefault:\n\n\t\tbreak;\n\t}\n\treturn 0;\n}\n\n/*\n * AES key schedule (decryption)\n */\nint aes_setkey_dec(aes_context *ctx, const unsigned char *key, int keysize)\n{\n\tint i, j;\n\taes_context cty;\n\tunsigned long *RK;\n\tunsigned long *SK;\n\n\tswitch( keysize )\n\t{\n\tcase 128: ctx->nr = 10; break;\n\tcase 192: ctx->nr = 12; break;\n\tcase 256: ctx->nr = 14; break;\n\tdefault: return 1;\n\t}\n\n#if defined(PADLOCK_ALIGN16)\n\tctx->rk = RK = PADLOCK_ALIGN16( ctx->buf );\n#else\n\tctx->rk = RK = ctx->buf;\n#endif\n\n\ti = aes_setkey_enc( &cty, key, keysize );\n\tif (i)\n\t\treturn i;\n\tSK = cty.rk + cty.nr * 4;\n\n\t*RK++ = *SK++;\n\t*RK++ = *SK++;\n\t*RK++ = *SK++;\n\t*RK++ = *SK++;\n\n\tfor( i = ctx->nr - 1, SK -= 8; i > 0; i--, SK -= 8 )\n\t{\n\t\tfor( j = 0; j < 4; j++, SK++ )\n\t\t{\n\t\t\t*RK++ = RT0[ FSb[ ( *SK ) & 0xFF ] ] ^\n\t\t\t\tRT1[ FSb[ ( *SK >> 8 ) & 0xFF ] ] ^\n\t\t\t\tRT2[ FSb[ ( *SK >> 16 ) & 0xFF ] ] ^\n\t\t\t\tRT3[ FSb[ ( *SK >> 24 ) & 0xFF ] ];\n\t\t}\n\t}\n\n\t*RK++ = *SK++;\n\t*RK++ = *SK++;\n\t*RK++ = *SK++;\n\t*RK = *SK;\n\n\tmemset( &cty, 0, sizeof( aes_context ) );\n\treturn 0;\n}\n\n#define AES_FROUND(X0,X1,X2,X3,Y0,Y1,Y2,Y3)\t\\\n{\t\t\t\t\t\t\\\n\tX0 = *RK++ ^ FT0[ ( Y0 ) & 0xFF ] ^\t\\\n\t\tFT1[ ( Y1 >> 8 ) & 0xFF ] ^\t\\\n\t\tFT2[ ( Y2 >> 16 ) & 0xFF ] ^\t\\\n\t\tFT3[ ( Y3 >> 24 ) & 0xFF ];\t\\\n\t\t\t\t\t\t\\\n\tX1 = *RK++ ^ FT0[ ( Y1 ) & 0xFF ] ^\t\\\n\t\tFT1[ ( Y2 >> 8 ) & 0xFF ] ^\t\\\n\t\tFT2[ ( Y3 >> 16 ) & 0xFF ] ^\t\\\n\t\tFT3[ ( Y0 >> 24 ) & 0xFF ];\t\\\n\t\t\t\t\t\t\\\n\tX2 = *RK++ ^ FT0[ ( Y2 ) & 0xFF ] ^\t\\\n\t\tFT1[ ( Y3 >> 8 ) & 0xFF ] ^\t\\\n\t\tFT2[ ( Y0 >> 16 ) & 0xFF ] ^\t\\\n\t\tFT3[ ( Y1 >> 24 ) & 0xFF ];\t\\\n\t\t\t\t\t\t\\\n\tX3 = *RK++ ^ FT0[ ( Y3 ) & 0xFF ] ^\t\\\n\t\tFT1[ ( Y0 >> 8 ) & 0xFF ] ^\t\\\n\t\tFT2[ ( Y1 >> 16 ) & 0xFF ] ^\t\\\n\t\tFT3[ ( Y2 >> 24 ) & 0xFF ];\t\\\n}\n\n#define AES_RROUND(X0,X1,X2,X3,Y0,Y1,Y2,Y3)\t\\\n{\t\t\t\t\t\t\\\n\tX0 = *RK++ ^ RT0[ ( Y0 ) & 0xFF ] ^\t\\\n\t\tRT1[ ( Y3 >> 8 ) & 0xFF ] ^\t\\\n\t\tRT2[ ( Y2 >> 16 ) & 0xFF ] ^\t\\\n\t\tRT3[ ( Y1 >> 24 ) & 0xFF ];\t\\\n\t\t\t\t\t\t\\\n\tX1 = *RK++ ^ RT0[ ( Y1 ) & 0xFF ] ^\t\\\n\t\tRT1[ ( Y0 >> 8 ) & 0xFF ] ^\t\\\n\t\tRT2[ ( Y3 >> 16 ) & 0xFF ] ^\t\\\n\t\tRT3[ ( Y2 >> 24 ) & 0xFF ];\t\\\n\t\t\t\t\t\t\\\n\tX2 = *RK++ ^ RT0[ ( Y2 ) & 0xFF ] ^\t\\\n\t\tRT1[ ( Y1 >> 8 ) & 0xFF ] ^\t\\\n\t\tRT2[ ( Y0 >> 16 ) & 0xFF ] ^\t\\\n\t\tRT3[ ( Y3 >> 24 ) & 0xFF ];\t\\\n\t\t\t\t\t\t\\\n\tX3 = *RK++ ^ RT0[ ( Y3 ) & 0xFF ] ^\t\\\n\t\tRT1[ ( Y2 >> 8 ) & 0xFF ] ^\t\\\n\t\tRT2[ ( Y1 >> 16 ) & 0xFF ] ^\t\\\n\t\tRT3[ ( Y0 >> 24 ) & 0xFF ];\t\\\n}\n\n/*\n * AES-ECB block encryption/decryption\n */\nvoid aes_crypt_ecb( aes_context *ctx,\n\tint mode,\n\tconst unsigned char input[16],\n\tunsigned char output[16] )\n{\n\tint i;\n\tunsigned long *RK, X0, X1, X2, X3, Y0, Y1, Y2, Y3;\n\n#if defined(XYSSL_PADLOCK_C) && defined(XYSSL_HAVE_X86)\n\tif( padlock_supports( PADLOCK_ACE ) )\n\t{\n\t\tif( padlock_xcryptecb( ctx, mode, input, output ) == 0 )\n\t\t\treturn;\n\t}\n#endif\n\n\tRK = ctx->rk;\n\n\tGET_ULONG_LE( X0, input, 0 ); X0 ^= *RK++;\n\tGET_ULONG_LE( X1, input, 4 ); X1 ^= *RK++;\n\tGET_ULONG_LE( X2, input, 8 ); X2 ^= *RK++;\n\tGET_ULONG_LE( X3, input, 12 ); X3 ^= *RK++;\n\n\tif( mode == AES_DECRYPT )\n\t{\n\t\tfor( i = (ctx->nr >> 1) - 1; i > 0; i-- )\n\t\t{\n\t\t\tAES_RROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 );\n\t\t\tAES_RROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 );\n\t\t}\n\n\t\tAES_RROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 );\n\n\t\tX0 = *RK++ ^ ( RSb[ ( Y0 ) & 0xFF ] ) ^\n\t\t\t( RSb[ ( Y3 >> 8 ) & 0xFF ] << 8 ) ^\n\t\t\t( RSb[ ( Y2 >> 16 ) & 0xFF ] << 16 ) ^\n\t\t\t( RSb[ ( Y1 >> 24 ) & 0xFF ] << 24 );\n\n\t\tX1 = *RK++ ^ ( RSb[ ( Y1 ) & 0xFF ] ) ^\n\t\t\t( RSb[ ( Y0 >>8 ) & 0xFF ] << 8 ) ^\n\t\t\t( RSb[ ( Y3 >> 16 ) & 0xFF ] << 16 ) ^\n\t\t\t( RSb[ ( Y2 >> 24 ) & 0xFF ] << 24 );\n\n\t\tX2 = *RK++ ^ ( RSb[ ( Y2 ) & 0xFF ] ) ^\n\t\t\t( RSb[ ( Y1 >> 8 ) & 0xFF ] << 8 ) ^\n\t\t\t( RSb[ ( Y0 >> 16 ) & 0xFF ] << 16 ) ^\n\t\t\t( RSb[ ( Y3 >> 24 ) & 0xFF ] << 24 );\n\n\t\tX3 = *RK ^ ( RSb[ ( Y3 ) & 0xFF ] ) ^\n\t\t\t( RSb[ ( Y2 >> 8 ) & 0xFF ] << 8 ) ^\n\t\t\t( RSb[ ( Y1 >> 16 ) & 0xFF ] << 16 ) ^\n\t\t\t( RSb[ ( Y0 >> 24 ) & 0xFF ] << 24 );\n\t}\n\telse /* AES_ENCRYPT */\n\t{\n\t\tfor( i = (ctx->nr >> 1) - 1; i > 0; i-- )\n\t\t{\n\t\t\tAES_FROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 );\n\t\t\tAES_FROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 );\n\t\t}\n\n\t\tAES_FROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 );\n\n\t\tX0 = *RK++ ^ ( FSb[ ( Y0 ) & 0xFF ] ) ^\n\t\t\t( FSb[ ( Y1 >> 8 ) & 0xFF ] << 8 ) ^\n\t\t\t( FSb[ ( Y2 >> 16 ) & 0xFF ] << 16 ) ^\n\t\t\t( FSb[ ( Y3 >> 24 ) & 0xFF ] << 24 );\n\n\t\tX1 = *RK++ ^ ( FSb[ ( Y1 ) & 0xFF ] ) ^\n\t\t\t( FSb[ ( Y2 >> 8 ) & 0xFF ] << 8 ) ^\n\t\t\t( FSb[ ( Y3 >> 16 ) & 0xFF ] << 16 ) ^\n\t\t\t( FSb[ ( Y0 >> 24 ) & 0xFF ] << 24 );\n\n\t\tX2 = *RK++ ^ ( FSb[ ( Y2 ) & 0xFF ] ) ^\n\t\t\t( FSb[ ( Y3 >> 8 ) & 0xFF ] << 8 ) ^\n\t\t\t( FSb[ ( Y0 >> 16 ) & 0xFF ] << 16 ) ^\n\t\t\t( FSb[ ( Y1 >> 24 ) & 0xFF ] << 24 );\n\n\t\tX3 = *RK ^ ( FSb[ ( Y3 ) & 0xFF ] ) ^\n\t\t\t( FSb[ ( Y0 >> 8 ) & 0xFF ] << 8 ) ^\n\t\t\t( FSb[ ( Y1 >> 16 ) & 0xFF ] << 16 ) ^\n\t\t\t( FSb[ ( Y2 >> 24 ) & 0xFF ] << 24 );\n\t}\n\n\tPUT_ULONG_LE( X0, output, 0 );\n\tPUT_ULONG_LE( X1, output, 4 );\n\tPUT_ULONG_LE( X2, output, 8 );\n\tPUT_ULONG_LE( X3, output, 12 );\n}\n\n/*\n * AES-CBC buffer encryption/decryption\n */\nvoid aes_crypt_cbc( aes_context *ctx,\n\tint mode,\n\tint length,\n\tunsigned char iv[16],\n\tconst unsigned char *input,\n\tunsigned char *output )\n{\n\tint i;\n\tunsigned char temp[16];\n\n#if defined(XYSSL_PADLOCK_C) && defined(XYSSL_HAVE_X86)\n\tif( padlock_supports( PADLOCK_ACE ) )\n\t{\n\t\tif( padlock_xcryptcbc( ctx, mode, length, iv, input, output ) == 0 )\n\t\t\treturn;\n\t}\n#endif\n\n\tif( mode == AES_DECRYPT )\n\t{\n\t\twhile( length > 0 )\n\t\t{\n\t\t\tmemcpy( temp, input, 16 );\n\t\t\taes_crypt_ecb( ctx, mode, input, output );\n\n\t\t\tfor( i = 0; i < 16; i++ )\n\t\t\t\toutput[i] = (unsigned char)( output[i] ^ iv[i] );\n\n\t\t\tmemcpy( iv, temp, 16 );\n\n\t\t\tinput += 16;\n\t\t\toutput += 16;\n\t\t\tlength -= 16;\n\t\t}\n\t}\n\telse\n\t{\n\t\twhile( length > 0 )\n\t\t{\n\t\t\tfor( i = 0; i < 16; i++ )\n\t\t\t\toutput[i] = (unsigned char)( input[i] ^ iv[i] );\n\n\t\t\taes_crypt_ecb( ctx, mode, output, output );\n\t\t\tmemcpy( iv, output, 16 );\n\n\t\t\tinput += 16;\n\t\t\toutput += 16;\n\t\t\tlength -= 16;\n\t\t}\n\t}\n}\n\n/*\n * AES-CFB buffer encryption/decryption\n */\nvoid aes_crypt_cfb( aes_context *ctx,\n\tint mode,\n\tint length,\n\tint *iv_off,\n\tunsigned char iv[16],\n\tconst unsigned char *input,\n\tunsigned char *output )\n{\n\tint c, n = *iv_off;\n\n\tif( mode == AES_DECRYPT )\n\t{\n\t\twhile( length-- )\n\t\t{\n\t\t\tif( n == 0 )\n\t\t\t\taes_crypt_ecb( ctx, AES_ENCRYPT, iv, iv );\n\n\t\t\tc = *input++;\n\t\t\t*output++ = (unsigned char)( c ^ iv[n] );\n\t\t\tiv[n] = (unsigned char) c;\n\n\t\t\tn = (n + 1) & 0x0F;\n\t\t}\n\t}\n\telse\n\t{\n\t\twhile( length-- )\n\t\t{\n\t\t\tif( n == 0 )\n\t\t\t\taes_crypt_ecb( ctx, AES_ENCRYPT, iv, iv );\n\n\t\t\tiv[n] = *output++ = (unsigned char)( iv[n] ^ *input++ );\n\n\t\t\tn = (n + 1) & 0x0F;\n\t\t}\n\t}\n\n\t*iv_off = n;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/crypt-arc4.c",
    "content": "/* This code illustrates a sample implementation\n * of the Arcfour algorithm\n * Copyright (c) April 29, 1997 Kalle Kaukonen.\n * All Rights Reserved.\n *\n * Redistribution and use in source and binary forms, with or\n * without modification, are permitted provided that this copyright\n * notice and disclaimer are retained.\n *\n * THIS SOFTWARE IS PROVIDED BY KALLE KAUKONEN AND CONTRIBUTORS ``AS\n * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KALLE\n * KAUKONEN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#include \"mupdf/fitz.h\"\n\nvoid\nfz_arc4_init(fz_arc4 *arc4, const unsigned char *key, unsigned keylen)\n{\n\tunsigned int t, u;\n\tunsigned int keyindex;\n\tunsigned int stateindex;\n\tunsigned char *state;\n\tunsigned int counter;\n\n\tstate = arc4->state;\n\n\tarc4->x = 0;\n\tarc4->y = 0;\n\n\tfor (counter = 0; counter < 256; counter++)\n\t{\n\t\tstate[counter] = counter;\n\t}\n\n\tkeyindex = 0;\n\tstateindex = 0;\n\n\tfor (counter = 0; counter < 256; counter++)\n\t{\n\t\tt = state[counter];\n\t\tstateindex = (stateindex + key[keyindex] + t) & 0xff;\n\t\tu = state[stateindex];\n\n\t\tstate[stateindex] = t;\n\t\tstate[counter] = u;\n\n\t\tif (++keyindex >= keylen)\n\t\t{\n\t\t\tkeyindex = 0;\n\t\t}\n\t}\n}\n\nstatic unsigned char\nfz_arc4_next(fz_arc4 *arc4)\n{\n\tunsigned int x;\n\tunsigned int y;\n\tunsigned int sx, sy;\n\tunsigned char *state;\n\n\tstate = arc4->state;\n\n\tx = (arc4->x + 1) & 0xff;\n\tsx = state[x];\n\ty = (sx + arc4->y) & 0xff;\n\tsy = state[y];\n\n\tarc4->x = x;\n\tarc4->y = y;\n\n\tstate[y] = sx;\n\tstate[x] = sy;\n\n\treturn state[(sx + sy) & 0xff];\n}\n\nvoid\nfz_arc4_encrypt(fz_arc4 *arc4, unsigned char *dest, const unsigned char *src, unsigned len)\n{\n\tunsigned int i;\n\tfor (i = 0; i < len; i++)\n\t{\n\t\tunsigned char x;\n\t\tx = fz_arc4_next(arc4);\n\t\tdest[i] = src[i] ^ x;\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/fitz/crypt-md5.c",
    "content": "/*\nMD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm\n\nCopyright (C) 1991-2, RSA Data Security, Inc. Created 1991.\nAll rights reserved.\n\nLicense to copy and use this software is granted provided that it\nis identified as the \"RSA Data Security, Inc. MD5 Message-Digest\nAlgorithm\" in all material mentioning or referencing this software\nor this function.\n\nLicense is also granted to make and use derivative works provided\nthat such works are identified as \"derived from the RSA Data\nSecurity, Inc. MD5 Message-Digest Algorithm\" in all material\nmentioning or referencing the derived work.\n\nRSA Data Security, Inc. makes no representations concerning either\nthe merchantability of this software or the suitability of this\nsoftware for any particular purpose. It is provided \"as is\"\nwithout express or implied warranty of any kind.\n\nThese notices must be retained in any copies of any part of this\ndocumentation and/or software.\n*/\n\n#include \"mupdf/fitz.h\"\n\n/* Constants for MD5Transform routine */\nenum\n{\n\tS11 = 7, S12 = 12, S13 = 17, S14 = 22,\n\tS21 = 5, S22 = 9, S23 = 14, S24 = 20,\n\tS31 = 4, S32 = 11, S33 = 16, S34 = 23,\n\tS41 = 6, S42 = 10, S43 = 15, S44 = 21\n};\n\nstatic void encode(unsigned char *, const unsigned int *, const unsigned);\nstatic void decode(unsigned int *, const unsigned char *, const unsigned);\nstatic void transform(unsigned int state[4], const unsigned char block[64]);\n\nstatic unsigned char padding[64] =\n{\n\t0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n};\n\n/* F, G, H and I are basic MD5 functions */\n#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))\n#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))\n#define H(x, y, z) ((x) ^ (y) ^ (z))\n#define I(x, y, z) ((y) ^ ((x) | (~z)))\n\n/* ROTATE rotates x left n bits */\n#define ROTATE(x, n) (((x) << (n)) | ((x) >> (32-(n))))\n\n/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.\n * Rotation is separate from addition to prevent recomputation.\n */\n#define FF(a, b, c, d, x, s, ac) { \\\n\t(a) += F ((b), (c), (d)) + (x) + (unsigned int)(ac); \\\n\t(a) = ROTATE ((a), (s)); \\\n\t(a) += (b); \\\n\t}\n#define GG(a, b, c, d, x, s, ac) { \\\n\t(a) += G ((b), (c), (d)) + (x) + (unsigned int)(ac); \\\n\t(a) = ROTATE ((a), (s)); \\\n\t(a) += (b); \\\n\t}\n#define HH(a, b, c, d, x, s, ac) { \\\n\t(a) += H ((b), (c), (d)) + (x) + (unsigned int)(ac); \\\n\t(a) = ROTATE ((a), (s)); \\\n\t(a) += (b); \\\n\t}\n#define II(a, b, c, d, x, s, ac) { \\\n\t(a) += I ((b), (c), (d)) + (x) + (unsigned int)(ac); \\\n\t(a) = ROTATE ((a), (s)); \\\n\t(a) += (b); \\\n\t}\n\nstatic void encode(unsigned char *output, const unsigned int *input, const unsigned len)\n{\n\tunsigned i, j;\n\n\tfor (i = 0, j = 0; j < len; i++, j += 4)\n\t{\n\t\toutput[j] = (unsigned char)(input[i] & 0xff);\n\t\toutput[j+1] = (unsigned char)((input[i] >> 8) & 0xff);\n\t\toutput[j+2] = (unsigned char)((input[i] >> 16) & 0xff);\n\t\toutput[j+3] = (unsigned char)((input[i] >> 24) & 0xff);\n\t}\n}\n\nstatic void decode(unsigned int *output, const unsigned char *input, const unsigned len)\n{\n\tunsigned i, j;\n\n\tfor (i = 0, j = 0; j < len; i++, j += 4)\n\t{\n\t\toutput[i] = ((unsigned int)input[j]) |\n\t\t(((unsigned int)input[j+1]) << 8) |\n\t\t(((unsigned int)input[j+2]) << 16) |\n\t\t(((unsigned int)input[j+3]) << 24);\n\t}\n}\n\nstatic void transform(unsigned int state[4], const unsigned char block[64])\n{\n\tunsigned int a = state[0];\n\tunsigned int b = state[1];\n\tunsigned int c = state[2];\n\tunsigned int d = state[3];\n\tunsigned int x[16];\n\n\tdecode(x, block, 64);\n\n\t/* Round 1 */\n\tFF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */\n\tFF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */\n\tFF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */\n\tFF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */\n\tFF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */\n\tFF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */\n\tFF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */\n\tFF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */\n\tFF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */\n\tFF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */\n\tFF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */\n\tFF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */\n\tFF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */\n\tFF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */\n\tFF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */\n\tFF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */\n\n\t/* Round 2 */\n\tGG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */\n\tGG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */\n\tGG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */\n\tGG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */\n\tGG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */\n\tGG (d, a, b, c, x[10], S22, 0x02441453); /* 22 */\n\tGG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */\n\tGG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */\n\tGG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */\n\tGG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */\n\tGG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */\n\tGG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */\n\tGG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */\n\tGG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */\n\tGG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */\n\tGG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */\n\n\t/* Round 3 */\n\tHH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */\n\tHH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */\n\tHH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */\n\tHH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */\n\tHH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */\n\tHH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */\n\tHH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */\n\tHH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */\n\tHH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */\n\tHH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */\n\tHH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */\n\tHH (b, c, d, a, x[ 6], S34, 0x04881d05); /* 44 */\n\tHH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */\n\tHH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */\n\tHH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */\n\tHH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */\n\n\t/* Round 4 */\n\tII (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */\n\tII (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */\n\tII (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */\n\tII (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */\n\tII (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */\n\tII (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */\n\tII (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */\n\tII (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */\n\tII (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */\n\tII (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */\n\tII (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */\n\tII (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */\n\tII (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */\n\tII (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */\n\tII (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */\n\tII (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */\n\n\tstate[0] += a;\n\tstate[1] += b;\n\tstate[2] += c;\n\tstate[3] += d;\n\n\t/* Zeroize sensitive information */\n\tmemset(x, 0, sizeof (x));\n}\n\n/* MD5 initialization. Begins an MD5 operation, writing a new context. */\nvoid fz_md5_init(fz_md5 *context)\n{\n\tcontext->count[0] = context->count[1] = 0;\n\n\t/* Load magic initialization constants */\n\tcontext->state[0] = 0x67452301;\n\tcontext->state[1] = 0xefcdab89;\n\tcontext->state[2] = 0x98badcfe;\n\tcontext->state[3] = 0x10325476;\n}\n\n/* MD5 block update operation. Continues an MD5 message-digest operation,\n * processing another message block, and updating the context.\n */\nvoid fz_md5_update(fz_md5 *context, const unsigned char *input, unsigned inlen)\n{\n\tunsigned i, index, partlen;\n\n\t/* Compute number of bytes mod 64 */\n\tindex = (unsigned)((context->count[0] >> 3) & 0x3F);\n\n\t/* Update number of bits */\n\tcontext->count[0] += (unsigned int) inlen << 3;\n\tif (context->count[0] < (unsigned int) inlen << 3)\n\t\tcontext->count[1] ++;\n\tcontext->count[1] += (unsigned int) inlen >> 29;\n\n\tpartlen = 64 - index;\n\n\t/* Transform as many times as possible. */\n\tif (inlen >= partlen)\n\t{\n\t\tmemcpy(context->buffer + index, input, partlen);\n\t\ttransform(context->state, context->buffer);\n\n\t\tfor (i = partlen; i + 63 < inlen; i += 64)\n\t\t\ttransform(context->state, input + i);\n\n\t\tindex = 0;\n\t}\n\telse\n\t{\n\t\ti = 0;\n\t}\n\n\t/* Buffer remaining input */\n\tmemcpy(context->buffer + index, input + i, inlen - i);\n}\n\n/* MD5 finalization. Ends an MD5 message-digest operation, writing the\n * the message digest and zeroizing the context.\n */\nvoid fz_md5_final(fz_md5 *context, unsigned char digest[16])\n{\n\tunsigned char bits[8];\n\tunsigned index, padlen;\n\n\t/* Save number of bits */\n\tencode(bits, context->count, 8);\n\n\t/* Pad out to 56 mod 64 */\n\tindex = (unsigned)((context->count[0] >> 3) & 0x3f);\n\tpadlen = index < 56 ? 56 - index : 120 - index;\n\tfz_md5_update(context, padding, padlen);\n\n\t/* Append length (before padding) */\n\tfz_md5_update(context, bits, 8);\n\n\t/* Store state in digest */\n\tencode(digest, context->state, 16);\n\n\t/* Zeroize sensitive information */\n\tmemset(context, 0, sizeof(fz_md5));\n}\n"
  },
  {
    "path": "mupdf/source/fitz/crypt-sha2.c",
    "content": "/*\nThis code is based on the code found from 7-Zip, which has a modified\nversion of the SHA-256 found from Crypto++ <http://www.cryptopp.com/>.\nThe code was modified a little to fit into liblzma and fitz.\n\nThis file has been put into the public domain.\nYou can do whatever you want with this file.\n\nSHA-384 and SHA-512 were also taken from Crypto++ and adapted for fitz.\n*/\n\n#include \"mupdf/fitz.h\"\n\nstatic inline int isbigendian(void)\n{\n\tstatic const int one = 1;\n\treturn *(char*)&one == 0;\n}\n\nstatic inline unsigned int bswap32(unsigned int num)\n{\n\treturn\t( (((num) << 24))\n\t\t| (((num) << 8) & 0x00FF0000)\n\t\t| (((num) >> 8) & 0x0000FF00)\n\t\t| (((num) >> 24)) );\n}\n\nstatic inline uint64_t bswap64(uint64_t num)\n{\n\treturn ( (((num) << 56))\n\t\t| (((num) << 40) & 0x00FF000000000000ULL)\n\t\t| (((num) << 24) & 0x0000FF0000000000ULL)\n\t\t| (((num) << 8) & 0x000000FF00000000ULL)\n\t\t| (((num) >> 8) & 0x00000000FF000000ULL)\n\t\t| (((num) >> 24) & 0x0000000000FF0000ULL)\n\t\t| (((num) >> 40) & 0x000000000000FF00ULL)\n\t\t| (((num) >> 56)) );\n}\n\n/* At least on x86, GCC is able to optimize this to a rotate instruction. */\n#define rotr(num, amount) ((num) >> (amount) | (num) << (8 * sizeof(num) - (amount)))\n\n#define blk0(i) (W[i] = data[i])\n#define blk2(i) (W[i & 15] += s1(W[(i - 2) & 15]) + W[(i - 7) & 15] \\\n\t\t+ s0(W[(i - 15) & 15]))\n\n#define Ch(x, y, z) (z ^ (x & (y ^ z)))\n#define Maj(x, y, z) ((x & y) | (z & (x | y)))\n\n#define a(i) T[(0 - i) & 7]\n#define b(i) T[(1 - i) & 7]\n#define c(i) T[(2 - i) & 7]\n#define d(i) T[(3 - i) & 7]\n#define e(i) T[(4 - i) & 7]\n#define f(i) T[(5 - i) & 7]\n#define g(i) T[(6 - i) & 7]\n#define h(i) T[(7 - i) & 7]\n\n#define R(i) \\\n\th(i) += S1(e(i)) + Ch(e(i), f(i), g(i)) + K[i + j] \\\n\t\t+ (j ? blk2(i) : blk0(i)); \\\n\td(i) += h(i); \\\n\th(i) += S0(a(i)) + Maj(a(i), b(i), c(i))\n\n/* For SHA256 */\n\n#define S0(x) (rotr(x, 2) ^ rotr(x, 13) ^ rotr(x, 22))\n#define S1(x) (rotr(x, 6) ^ rotr(x, 11) ^ rotr(x, 25))\n#define s0(x) (rotr(x, 7) ^ rotr(x, 18) ^ (x >> 3))\n#define s1(x) (rotr(x, 17) ^ rotr(x, 19) ^ (x >> 10))\n\nstatic const unsigned int SHA256_K[64] = {\n\t0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,\n\t0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,\n\t0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,\n\t0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,\n\t0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,\n\t0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,\n\t0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,\n\t0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,\n\t0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,\n\t0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,\n\t0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,\n\t0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,\n\t0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,\n\t0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,\n\t0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,\n\t0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2,\n};\n\nstatic void\ntransform256(unsigned int state[8], unsigned int data[16])\n{\n\tconst unsigned int *K = SHA256_K;\n\tunsigned int W[16];\n\tunsigned int T[8];\n\tunsigned int j;\n\n\t/* ensure big-endian integers */\n\tif (!isbigendian())\n\t\tfor (j = 0; j < 16; j++)\n\t\t\tdata[j] = bswap32(data[j]);\n\n\t/* Copy state[] to working vars. */\n\tmemcpy(T, state, sizeof(T));\n\n\t/* 64 operations, partially loop unrolled */\n\tfor (j = 0; j < 64; j += 16) {\n\t\tR( 0); R( 1); R( 2); R( 3);\n\t\tR( 4); R( 5); R( 6); R( 7);\n\t\tR( 8); R( 9); R(10); R(11);\n\t\tR(12); R(13); R(14); R(15);\n\t}\n\n\t/* Add the working vars back into state[]. */\n\tstate[0] += a(0);\n\tstate[1] += b(0);\n\tstate[2] += c(0);\n\tstate[3] += d(0);\n\tstate[4] += e(0);\n\tstate[5] += f(0);\n\tstate[6] += g(0);\n\tstate[7] += h(0);\n}\n\n#undef S0\n#undef S1\n#undef s0\n#undef s1\n\nvoid fz_sha256_init(fz_sha256 *context)\n{\n\tcontext->count[0] = context->count[1] = 0;\n\n\tcontext->state[0] = 0x6A09E667;\n\tcontext->state[1] = 0xBB67AE85;\n\tcontext->state[2] = 0x3C6EF372;\n\tcontext->state[3] = 0xA54FF53A;\n\tcontext->state[4] = 0x510E527F;\n\tcontext->state[5] = 0x9B05688C;\n\tcontext->state[6] = 0x1F83D9AB;\n\tcontext->state[7] = 0x5BE0CD19;\n}\n\nvoid fz_sha256_update(fz_sha256 *context, const unsigned char *input, unsigned int inlen)\n{\n\t/* Copy the input data into a properly aligned temporary buffer.\n\t * This way we can be called with arbitrarily sized buffers\n\t * (no need to be multiple of 64 bytes), and the code works also\n\t * on architectures that don't allow unaligned memory access. */\n\twhile (inlen > 0)\n\t{\n\t\tconst unsigned int copy_start = context->count[0] & 0x3F;\n\t\tunsigned int copy_size = 64 - copy_start;\n\t\tif (copy_size > inlen)\n\t\t\tcopy_size = inlen;\n\n\t\tmemcpy(context->buffer.u8 + copy_start, input, copy_size);\n\n\t\tinput += copy_size;\n\t\tinlen -= copy_size;\n\t\tcontext->count[0] += copy_size;\n\t\t/* carry overflow from low to high */\n\t\tif (context->count[0] < copy_size)\n\t\t\tcontext->count[1]++;\n\n\t\tif ((context->count[0] & 0x3F) == 0)\n\t\t\ttransform256(context->state, context->buffer.u32);\n\t}\n}\n\nvoid fz_sha256_final(fz_sha256 *context, unsigned char digest[32])\n{\n\t/* Add padding as described in RFC 3174 (it describes SHA-1 but\n\t * the same padding style is used for SHA-256 too). */\n\tunsigned int j = context->count[0] & 0x3F;\n\tcontext->buffer.u8[j++] = 0x80;\n\n\twhile (j != 56)\n\t{\n\t\tif (j == 64)\n\t\t{\n\t\t\ttransform256(context->state, context->buffer.u32);\n\t\t\tj = 0;\n\t\t}\n\t\tcontext->buffer.u8[j++] = 0x00;\n\t}\n\n\t/* Convert the message size from bytes to bits. */\n\tcontext->count[1] = (context->count[1] << 3) + (context->count[0] >> 29);\n\tcontext->count[0] = context->count[0] << 3;\n\n\tif (!isbigendian())\n\t{\n\t\tcontext->buffer.u32[14] = bswap32(context->count[1]);\n\t\tcontext->buffer.u32[15] = bswap32(context->count[0]);\n\t}\n\telse\n\t{\n\t\tcontext->buffer.u32[14] = context->count[1];\n\t\tcontext->buffer.u32[15] = context->count[0];\n\t}\n\ttransform256(context->state, context->buffer.u32);\n\n\tif (!isbigendian())\n\t\tfor (j = 0; j < 8; j++)\n\t\t\tcontext->state[j] = bswap32(context->state[j]);\n\n\tmemcpy(digest, &context->state[0], 32);\n\tmemset(context, 0, sizeof(fz_sha256));\n}\n\n/* For SHA512 */\n\n#define S0(x) (rotr(x, 28) ^ rotr(x, 34) ^ rotr(x, 39))\n#define S1(x) (rotr(x, 14) ^ rotr(x, 18) ^ rotr(x, 41))\n#define s0(x) (rotr(x, 1) ^ rotr(x, 8) ^ (x >> 7))\n#define s1(x) (rotr(x, 19) ^ rotr(x, 61) ^ (x >> 6))\n\nstatic const uint64_t SHA512_K[80] = {\n\t0x428A2F98D728AE22ULL, 0x7137449123EF65CDULL,\n\t0xB5C0FBCFEC4D3B2FULL, 0xE9B5DBA58189DBBCULL,\n\t0x3956C25BF348B538ULL, 0x59F111F1B605D019ULL,\n\t0x923F82A4AF194F9BULL, 0xAB1C5ED5DA6D8118ULL,\n\t0xD807AA98A3030242ULL, 0x12835B0145706FBEULL,\n\t0x243185BE4EE4B28CULL, 0x550C7DC3D5FFB4E2ULL,\n\t0x72BE5D74F27B896FULL, 0x80DEB1FE3B1696B1ULL,\n\t0x9BDC06A725C71235ULL, 0xC19BF174CF692694ULL,\n\t0xE49B69C19EF14AD2ULL, 0xEFBE4786384F25E3ULL,\n\t0x0FC19DC68B8CD5B5ULL, 0x240CA1CC77AC9C65ULL,\n\t0x2DE92C6F592B0275ULL, 0x4A7484AA6EA6E483ULL,\n\t0x5CB0A9DCBD41FBD4ULL, 0x76F988DA831153B5ULL,\n\t0x983E5152EE66DFABULL, 0xA831C66D2DB43210ULL,\n\t0xB00327C898FB213FULL, 0xBF597FC7BEEF0EE4ULL,\n\t0xC6E00BF33DA88FC2ULL, 0xD5A79147930AA725ULL,\n\t0x06CA6351E003826FULL, 0x142929670A0E6E70ULL,\n\t0x27B70A8546D22FFCULL, 0x2E1B21385C26C926ULL,\n\t0x4D2C6DFC5AC42AEDULL, 0x53380D139D95B3DFULL,\n\t0x650A73548BAF63DEULL, 0x766A0ABB3C77B2A8ULL,\n\t0x81C2C92E47EDAEE6ULL, 0x92722C851482353BULL,\n\t0xA2BFE8A14CF10364ULL, 0xA81A664BBC423001ULL,\n\t0xC24B8B70D0F89791ULL, 0xC76C51A30654BE30ULL,\n\t0xD192E819D6EF5218ULL, 0xD69906245565A910ULL,\n\t0xF40E35855771202AULL, 0x106AA07032BBD1B8ULL,\n\t0x19A4C116B8D2D0C8ULL, 0x1E376C085141AB53ULL,\n\t0x2748774CDF8EEB99ULL, 0x34B0BCB5E19B48A8ULL,\n\t0x391C0CB3C5C95A63ULL, 0x4ED8AA4AE3418ACBULL,\n\t0x5B9CCA4F7763E373ULL, 0x682E6FF3D6B2B8A3ULL,\n\t0x748F82EE5DEFB2FCULL, 0x78A5636F43172F60ULL,\n\t0x84C87814A1F0AB72ULL, 0x8CC702081A6439ECULL,\n\t0x90BEFFFA23631E28ULL, 0xA4506CEBDE82BDE9ULL,\n\t0xBEF9A3F7B2C67915ULL, 0xC67178F2E372532BULL,\n\t0xCA273ECEEA26619CULL, 0xD186B8C721C0C207ULL,\n\t0xEADA7DD6CDE0EB1EULL, 0xF57D4F7FEE6ED178ULL,\n\t0x06F067AA72176FBAULL, 0x0A637DC5A2C898A6ULL,\n\t0x113F9804BEF90DAEULL, 0x1B710B35131C471BULL,\n\t0x28DB77F523047D84ULL, 0x32CAAB7B40C72493ULL,\n\t0x3C9EBE0A15C9BEBCULL, 0x431D67C49C100D4CULL,\n\t0x4CC5D4BECB3E42B6ULL, 0x597F299CFC657E2AULL,\n\t0x5FCB6FAB3AD6FAECULL, 0x6C44198C4A475817ULL,\n};\n\nstatic void\ntransform512(uint64_t state[8], uint64_t data[16])\n{\n\tconst uint64_t *K = SHA512_K;\n\tuint64_t W[16];\n\tuint64_t T[8];\n\tunsigned int j;\n\n\t/* ensure big-endian integers */\n\tif (!isbigendian())\n\t\tfor (j = 0; j < 16; j++)\n\t\t\tdata[j] = bswap64(data[j]);\n\n\t/* Copy state[] to working vars. */\n\tmemcpy(T, state, sizeof(T));\n\n\t/* 80 operations, partially loop unrolled */\n\tfor (j = 0; j < 80; j+= 16) {\n\t\tR( 0); R( 1); R( 2); R( 3);\n\t\tR( 4); R( 5); R( 6); R( 7);\n\t\tR( 8); R( 9); R(10); R(11);\n\t\tR(12); R(13); R(14); R(15);\n\t}\n\n\t/* Add the working vars back into state[]. */\n\tstate[0] += a(0);\n\tstate[1] += b(0);\n\tstate[2] += c(0);\n\tstate[3] += d(0);\n\tstate[4] += e(0);\n\tstate[5] += f(0);\n\tstate[6] += g(0);\n\tstate[7] += h(0);\n}\n\n#undef S0\n#undef S1\n#undef s0\n#undef s1\n\nvoid fz_sha512_init(fz_sha512 *context)\n{\n\tcontext->count[0] = context->count[1] = 0;\n\n\tcontext->state[0] = 0x6A09E667F3BCC908ull;\n\tcontext->state[1] = 0xBB67AE8584CAA73Bull;\n\tcontext->state[2] = 0x3C6EF372FE94F82Bull;\n\tcontext->state[3] = 0xA54FF53A5F1D36F1ull;\n\tcontext->state[4] = 0x510E527FADE682D1ull;\n\tcontext->state[5] = 0x9B05688C2B3E6C1Full;\n\tcontext->state[6] = 0x1F83D9ABFB41BD6Bull;\n\tcontext->state[7] = 0x5BE0CD19137E2179ull;\n}\n\nvoid fz_sha512_update(fz_sha512 *context, const unsigned char *input, unsigned int inlen)\n{\n\t/* Copy the input data into a properly aligned temporary buffer.\n\t * This way we can be called with arbitrarily sized buffers\n\t * (no need to be multiple of 128 bytes), and the code works also\n\t * on architectures that don't allow unaligned memory access. */\n\twhile (inlen > 0)\n\t{\n\t\tconst unsigned int copy_start = context->count[0] & 0x7F;\n\t\tunsigned int copy_size = 128 - copy_start;\n\t\tif (copy_size > inlen)\n\t\t\tcopy_size = inlen;\n\n\t\tmemcpy(context->buffer.u8 + copy_start, input, copy_size);\n\n\t\tinput += copy_size;\n\t\tinlen -= copy_size;\n\t\tcontext->count[0] += copy_size;\n\t\t/* carry overflow from low to high */\n\t\tif (context->count[0] < copy_size)\n\t\t\tcontext->count[1]++;\n\n\t\tif ((context->count[0] & 0x7F) == 0)\n\t\t\ttransform512(context->state, context->buffer.u64);\n\t}\n}\n\nvoid fz_sha512_final(fz_sha512 *context, unsigned char digest[64])\n{\n\t/* Add padding as described in RFC 3174 (it describes SHA-1 but\n\t * the same padding style is used for SHA-512 too). */\n\tunsigned int j = context->count[0] & 0x7F;\n\tcontext->buffer.u8[j++] = 0x80;\n\n\twhile (j != 112)\n\t{\n\t\tif (j == 128)\n\t\t{\n\t\t\ttransform512(context->state, context->buffer.u64);\n\t\t\tj = 0;\n\t\t}\n\t\tcontext->buffer.u8[j++] = 0x00;\n\t}\n\n\t/* Convert the message size from bytes to bits. */\n\tcontext->count[1] = (context->count[1] << 3) + (context->count[0] >> 29);\n\tcontext->count[0] = context->count[0] << 3;\n\n\tif (!isbigendian())\n\t{\n\t\tcontext->buffer.u64[14] = bswap64(context->count[1]);\n\t\tcontext->buffer.u64[15] = bswap64(context->count[0]);\n\t}\n\telse\n\t{\n\t\tcontext->buffer.u64[14] = context->count[1];\n\t\tcontext->buffer.u64[15] = context->count[0];\n\t}\n\ttransform512(context->state, context->buffer.u64);\n\n\tif (!isbigendian())\n\t\tfor (j = 0; j < 8; j++)\n\t\t\tcontext->state[j] = bswap64(context->state[j]);\n\n\tmemcpy(digest, &context->state[0], 64);\n\tmemset(context, 0, sizeof(fz_sha512));\n}\n\nvoid fz_sha384_init(fz_sha384 *context)\n{\n\tcontext->count[0] = context->count[1] = 0;\n\n\tcontext->state[0] = 0xCBBB9D5DC1059ED8ull;\n\tcontext->state[1] = 0x629A292A367CD507ull;\n\tcontext->state[2] = 0x9159015A3070DD17ull;\n\tcontext->state[3] = 0x152FECD8F70E5939ull;\n\tcontext->state[4] = 0x67332667FFC00B31ull;\n\tcontext->state[5] = 0x8EB44A8768581511ull;\n\tcontext->state[6] = 0xDB0C2E0D64F98FA7ull;\n\tcontext->state[7] = 0x47B5481DBEFA4FA4ull;\n}\n\nvoid fz_sha384_update(fz_sha384 *context, const unsigned char *input, unsigned int inlen)\n{\n\tfz_sha512_update(context, input, inlen);\n}\n\nvoid fz_sha384_final(fz_sha384 *context, unsigned char digest[64])\n{\n\tfz_sha512_final(context, digest);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/device.c",
    "content": "#include \"mupdf/fitz.h\"\n\nfz_device *\nfz_new_device(fz_context *ctx, void *user)\n{\n\tfz_device *dev = fz_malloc_struct(ctx, fz_device);\n\tdev->hints = 0;\n\tdev->flags = 0;\n\tdev->user = user;\n\tdev->ctx = ctx;\n\tdev->error_depth = 0;\n\treturn dev;\n}\n\nvoid\nfz_free_device(fz_device *dev)\n{\n\tif (dev == NULL)\n\t\treturn;\n\tif (dev->free_user)\n\t\tdev->free_user(dev);\n\tfz_free(dev->ctx, dev->container);\n\tfz_free(dev->ctx, dev);\n}\n\nvoid\nfz_enable_device_hints(fz_device *dev, int hints)\n{\n\tdev->hints |= hints;\n}\n\nvoid\nfz_disable_device_hints(fz_device *dev, int hints)\n{\n\tdev->hints &= ~hints;\n}\n\nvoid\nfz_rebind_device(fz_device *dev, fz_context *ctx)\n{\n\tif (dev == NULL)\n\t\treturn;\n\tdev->ctx = ctx;\n\tif (dev->rebind)\n\t\tdev->rebind(dev);\n}\n\nvoid\nfz_begin_page(fz_device *dev, const fz_rect *rect, const fz_matrix *ctm)\n{\n\tif (dev->begin_page)\n\t\tdev->begin_page(dev, rect, ctm);\n}\n\nvoid\nfz_end_page(fz_device *dev)\n{\n\tif (dev->end_page)\n\t\tdev->end_page(dev);\n}\n\nstatic void\npush_clip_stack(fz_device *dev, const fz_rect *rect, int flags)\n{\n\tif (dev->container_len == dev->container_cap)\n\t{\n\t\tint newmax = dev->container_cap * 2;\n\t\tif (newmax == 0)\n\t\t\tnewmax = 4;\n\t\tdev->container = fz_resize_array(dev->ctx, dev->container, newmax, sizeof(*dev->container));\n\t\tdev->container_cap = newmax;\n\t}\n\tif (dev->container_len == 0)\n\t\tdev->container[0].scissor = *rect;\n\telse\n\t{\n\t\tdev->container[dev->container_len].scissor = dev->container[dev->container_len-1].scissor;\n\t\tfz_intersect_rect(&dev->container[dev->container_len].scissor, rect);\n\t}\n\tdev->container[dev->container_len].flags = flags;\n\tdev->container[dev->container_len].user = 0;\n\tdev->container_len++;\n}\n\nstatic void\npush_clip_stack_accumulate(fz_device *dev, const fz_rect *rect, int accumulate)\n{\n\tif (accumulate <= 1)\n\t{\n\t\tdev->scissor_accumulator = *rect;\n\t\tif (dev->container_len == dev->container_cap)\n\t\t{\n\t\t\tint newmax = dev->container_cap * 2;\n\t\t\tif (newmax == 0)\n\t\t\t\tnewmax = 4;\n\t\t\tdev->container = fz_resize_array(dev->ctx, dev->container, newmax, sizeof(*dev->container));\n\t\t\tdev->container_cap = newmax;\n\t\t}\n\t\tif (dev->container_len > 0)\n\t\t\tdev->container[dev->container_len].scissor = dev->container[dev->container_len-1].scissor;\n\t\telse\n\t\t\tdev->container[dev->container_len].scissor = fz_infinite_rect;\n\t\tfz_intersect_rect(&dev->container[dev->container_len].scissor, rect);\n\t\tdev->container[dev->container_len].flags = fz_device_container_stack_is_clip_text;\n\t\tdev->container[dev->container_len].user = 0;\n\t\tdev->container_len++;\n\t}\n\telse\n\t{\n\t\tif (dev->container_len <= 0)\n\t\t\treturn;\n\t\tfz_union_rect(&dev->scissor_accumulator, rect);\n\t\tfz_intersect_rect(&dev->container[dev->container_len-1].scissor, &dev->scissor_accumulator);\n\t}\n}\n\nstatic void\npop_clip_stack(fz_device *dev)\n{\n\tif (dev->container_len > 0)\n\t\tdev->container_len--;\n}\n\nvoid\nfz_fill_path(fz_device *dev, fz_path *path, int even_odd, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tif (dev->error_depth)\n\t\treturn;\n\tif (dev->fill_path)\n\t\tdev->fill_path(dev, path, even_odd, ctm, colorspace, color, alpha);\n}\n\nvoid\nfz_stroke_path(fz_device *dev, fz_path *path, fz_stroke_state *stroke, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tif (dev->error_depth)\n\t\treturn;\n\tif (dev->stroke_path)\n\t\tdev->stroke_path(dev, path, stroke, ctm, colorspace, color, alpha);\n}\n\nvoid\nfz_clip_path(fz_device *dev, fz_path *path, const fz_rect *rect, int even_odd, const fz_matrix *ctm)\n{\n\tfz_context *ctx = dev->ctx;\n\n\tif (dev->error_depth)\n\t{\n\t\tdev->error_depth++;\n\t\treturn;\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tif (dev->hints & FZ_MAINTAIN_CONTAINER_STACK)\n\t\t{\n\t\t\tif (rect == NULL)\n\t\t\t{\n\t\t\t\tfz_rect bbox;\n\t\t\t\tfz_bound_path(ctx, path, NULL, ctm, &bbox);\n\t\t\t\tpush_clip_stack(dev, &bbox, fz_device_container_stack_is_clip_path);\n\t\t\t}\n\t\t\telse\n\t\t\t\tpush_clip_stack(dev, rect, fz_device_container_stack_is_clip_path);\n\t\t}\n\t\tif (dev->clip_path)\n\t\t\tdev->clip_path(dev, path, rect, even_odd, ctm);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tdev->error_depth = 1;\n\t\tstrcpy(dev->errmess, fz_caught_message(ctx));\n\t\t/* Error swallowed */\n\t}\n}\n\nvoid\nfz_clip_stroke_path(fz_device *dev, fz_path *path, const fz_rect *rect, fz_stroke_state *stroke, const fz_matrix *ctm)\n{\n\tfz_context *ctx = dev->ctx;\n\n\tif (dev->error_depth)\n\t{\n\t\tdev->error_depth++;\n\t\treturn;\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tif (dev->hints & FZ_MAINTAIN_CONTAINER_STACK)\n\t\t{\n\t\t\tif (rect == NULL)\n\t\t\t{\n\t\t\t\tfz_rect bbox;\n\t\t\t\tfz_bound_path(ctx, path, stroke, ctm, &bbox);\n\t\t\t\tpush_clip_stack(dev, &bbox, fz_device_container_stack_is_clip_stroke_path);\n\t\t\t}\n\t\t\telse\n\t\t\t\tpush_clip_stack(dev, rect, fz_device_container_stack_is_clip_stroke_path);\n\t\t}\n\t\tif (dev->clip_stroke_path)\n\t\t\tdev->clip_stroke_path(dev, path, rect, stroke, ctm);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tdev->error_depth = 1;\n\t\tstrcpy(dev->errmess, fz_caught_message(ctx));\n\t\t/* Error swallowed */\n\t}\n}\n\nvoid\nfz_fill_text(fz_device *dev, fz_text *text, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tif (dev->error_depth)\n\t\treturn;\n\tif (dev->fill_text)\n\t\tdev->fill_text(dev, text, ctm, colorspace, color, alpha);\n}\n\nvoid\nfz_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tif (dev->error_depth)\n\t\treturn;\n\tif (dev->stroke_text)\n\t\tdev->stroke_text(dev, text, stroke, ctm, colorspace, color, alpha);\n}\n\nvoid\nfz_clip_text(fz_device *dev, fz_text *text, const fz_matrix *ctm, int accumulate)\n{\n\tfz_context *ctx = dev->ctx;\n\n\tif (dev->error_depth)\n\t{\n\t\tif (accumulate == 0 || accumulate == 1)\n\t\t\tdev->error_depth++;\n\t\treturn;\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tif (dev->hints & FZ_MAINTAIN_CONTAINER_STACK)\n\t\t{\n\t\t\tfz_rect bbox;\n\t\t\tfz_bound_text(ctx, text, NULL, ctm, &bbox);\n\t\t\tpush_clip_stack_accumulate(dev, &bbox, accumulate);\n\t\t}\n\t\tif (dev->clip_text)\n\t\t\tdev->clip_text(dev, text, ctm, accumulate);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tif (accumulate == 2)\n\t\t\tfz_rethrow(ctx);\n\t\tdev->error_depth = 1;\n\t\tstrcpy(dev->errmess, fz_caught_message(ctx));\n\t\t/* Error swallowed */\n\t}\n}\n\nvoid\nfz_clip_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, const fz_matrix *ctm)\n{\n\tfz_context *ctx = dev->ctx;\n\n\tif (dev->error_depth)\n\t{\n\t\tdev->error_depth++;\n\t\treturn;\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tif (dev->hints & FZ_MAINTAIN_CONTAINER_STACK)\n\t\t{\n\t\t\tfz_rect bbox;\n\t\t\tfz_bound_text(ctx, text, stroke, ctm, &bbox);\n\t\t\tpush_clip_stack(dev, &bbox, fz_device_container_stack_is_clip_stroke_text);\n\t\t}\n\t\tif (dev->clip_stroke_text)\n\t\t\tdev->clip_stroke_text(dev, text, stroke, ctm);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tdev->error_depth = 1;\n\t\tstrcpy(dev->errmess, fz_caught_message(ctx));\n\t\t/* Error swallowed */\n\t}\n}\n\nvoid\nfz_ignore_text(fz_device *dev, fz_text *text, const fz_matrix *ctm)\n{\n\tif (dev->error_depth)\n\t\treturn;\n\tif (dev->ignore_text)\n\t\tdev->ignore_text(dev, text, ctm);\n}\n\nvoid\nfz_pop_clip(fz_device *dev)\n{\n\tif (dev->error_depth)\n\t{\n\t\tdev->error_depth--;\n\t\tif (dev->error_depth == 0)\n\t\t\tfz_throw(dev->ctx, FZ_ERROR_GENERIC, \"%s\", dev->errmess);\n\t\treturn;\n\t}\n\tif (dev->hints & FZ_MAINTAIN_CONTAINER_STACK)\n\t\tpop_clip_stack(dev);\n\tif (dev->pop_clip)\n\t\tdev->pop_clip(dev);\n}\n\nvoid\nfz_fill_shade(fz_device *dev, fz_shade *shade, const fz_matrix *ctm, float alpha)\n{\n\tif (dev->error_depth)\n\t\treturn;\n\tif (dev->fill_shade)\n\t\tdev->fill_shade(dev, shade, ctm, alpha);\n}\n\nvoid\nfz_fill_image(fz_device *dev, fz_image *image, const fz_matrix *ctm, float alpha)\n{\n\tif (dev->error_depth)\n\t\treturn;\n\tif (dev->fill_image)\n\t\tdev->fill_image(dev, image, ctm, alpha);\n}\n\nvoid\nfz_fill_image_mask(fz_device *dev, fz_image *image, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tif (dev->error_depth)\n\t\treturn;\n\tif (dev->fill_image_mask)\n\t\tdev->fill_image_mask(dev, image, ctm, colorspace, color, alpha);\n}\n\nvoid\nfz_clip_image_mask(fz_device *dev, fz_image *image, const fz_rect *rect, const fz_matrix *ctm)\n{\n\tfz_context *ctx = dev->ctx;\n\n\tif (dev->error_depth)\n\t{\n\t\tdev->error_depth++;\n\t\treturn;\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tif (dev->hints & FZ_MAINTAIN_CONTAINER_STACK)\n\t\t\tpush_clip_stack(dev, rect, fz_device_container_stack_is_clip_image_mask);\n\t\tif (dev->clip_image_mask)\n\t\t\tdev->clip_image_mask(dev, image, rect, ctm);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tdev->error_depth = 1;\n\t\tstrcpy(dev->errmess, fz_caught_message(ctx));\n\t\t/* Error swallowed */\n\t}\n}\n\nvoid\nfz_begin_mask(fz_device *dev, const fz_rect *area, int luminosity, fz_colorspace *colorspace, float *bc)\n{\n\tfz_context *ctx = dev->ctx;\n\n\tif (dev->error_depth)\n\t{\n\t\tdev->error_depth++;\n\t\treturn;\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tif (dev->hints & FZ_MAINTAIN_CONTAINER_STACK)\n\t\t\tpush_clip_stack(dev, area, fz_device_container_stack_in_mask);\n\t\tif (dev->begin_mask)\n\t\t\tdev->begin_mask(dev, area, luminosity, colorspace, bc);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tdev->error_depth = 1;\n\t\tstrcpy(dev->errmess, fz_caught_message(ctx));\n\t\t/* Error swallowed */\n\t}\n}\n\nvoid\nfz_end_mask(fz_device *dev)\n{\n\tfz_context *ctx = dev->ctx;\n\n\tif (dev->error_depth)\n\t{\n\t\t/* Converts from mask to clip, so no change in stack depth */\n\t\treturn;\n\t}\n\tif (dev->hints & FZ_MAINTAIN_CONTAINER_STACK)\n\t{\n\t\tdev->container[dev->container_len-1].flags &= ~fz_device_container_stack_in_mask;\n\t\tdev->container[dev->container_len-1].flags |= fz_device_container_stack_is_mask;\n\t}\n\tfz_try(ctx)\n\t{\n\t\tif (dev->end_mask)\n\t\t\tdev->end_mask(dev);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tdev->error_depth = 1;\n\t\tstrcpy(dev->errmess, fz_caught_message(ctx));\n\t\t/* Error swallowed */\n\t}\n}\n\nvoid\nfz_begin_group(fz_device *dev, const fz_rect *area, int isolated, int knockout, int blendmode, float alpha)\n{\n\tfz_context *ctx = dev->ctx;\n\n\tif (dev->error_depth)\n\t{\n\t\tdev->error_depth++;\n\t\treturn;\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tif (dev->hints & FZ_MAINTAIN_CONTAINER_STACK)\n\t\t\tpush_clip_stack(dev, area, fz_device_container_stack_is_group);\n\t\tif (dev->begin_group)\n\t\t\tdev->begin_group(dev, area, isolated, knockout, blendmode, alpha);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tdev->error_depth = 1;\n\t\tstrcpy(dev->errmess, fz_caught_message(ctx));\n\t\t/* Error swallowed */\n\t}\n}\n\nvoid\nfz_end_group(fz_device *dev)\n{\n\tif (dev->error_depth)\n\t{\n\t\tdev->error_depth--;\n\t\tif (dev->error_depth == 0)\n\t\t\tfz_throw(dev->ctx, FZ_ERROR_GENERIC, \"%s\", dev->errmess);\n\t\treturn;\n\t}\n\tif (dev->end_group)\n\t\tdev->end_group(dev);\n\tif (dev->hints & FZ_MAINTAIN_CONTAINER_STACK)\n\t\tpop_clip_stack(dev);\n}\n\nvoid\nfz_begin_tile(fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, const fz_matrix *ctm)\n{\n\t(void)fz_begin_tile_id(dev, area, view, xstep, ystep, ctm, 0);\n}\n\nint\nfz_begin_tile_id(fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, const fz_matrix *ctm, int id)\n{\n\tfz_context *ctx = dev->ctx;\n\tint ret = 0;\n\n\tif (dev->error_depth)\n\t{\n\t\tdev->error_depth++;\n\t\treturn 0;\n\t}\n\n\tif (xstep < 0)\n\t\txstep = -xstep;\n\tif (ystep < 0)\n\t\tystep = -ystep;\n\n\tfz_try(ctx)\n\t{\n\t\tif (dev->begin_tile)\n\t\t\tret = dev->begin_tile(dev, area, view, xstep, ystep, ctm, id);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tdev->error_depth = 1;\n\t\tstrcpy(dev->errmess, fz_caught_message(ctx));\n\t\t/* Error swallowed */\n\t}\n\treturn ret;\n}\n\nvoid\nfz_end_tile(fz_device *dev)\n{\n\tif (dev->error_depth)\n\t{\n\t\tdev->error_depth--;\n\t\tif (dev->error_depth == 0)\n\t\t\tfz_throw(dev->ctx, FZ_ERROR_GENERIC, \"%s\", dev->errmess);\n\t\treturn;\n\t}\n\tif (dev->end_tile)\n\t\tdev->end_tile(dev);\n}\n\n/* SumatraPDF: support transfer functions */\nvoid\nfz_apply_transfer_function(fz_device *dev, fz_transfer_function *tr, int for_mask)\n{\n\tif (dev->apply_transfer_function)\n\t\tdev->apply_transfer_function(dev, tr, for_mask);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/document-all.c",
    "content": "#include \"mupdf/fitz.h\"\n\nvoid fz_register_document_handlers(fz_context *ctx)\n{\n\tfz_register_document_handler(ctx, &pdf_document_handler);\n\tfz_register_document_handler(ctx, &xps_document_handler);\n\tfz_register_document_handler(ctx, &cbz_document_handler);\n\tfz_register_document_handler(ctx, &img_document_handler);\n\tfz_register_document_handler(ctx, &tiff_document_handler);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/document-no-run.c",
    "content": "#include \"mupdf/fitz.h\"\n\nvoid fz_register_no_run_document_handlers(fz_context *ctx)\n{\n\tfz_register_document_handler(ctx, &pdf_no_run_document_handler);\n\tfz_register_document_handler(ctx, &xps_document_handler);\n\tfz_register_document_handler(ctx, &cbz_document_handler);\n\tfz_register_document_handler(ctx, &img_document_handler);\n\tfz_register_document_handler(ctx, &tiff_document_handler);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/document.c",
    "content": "#include \"mupdf/fitz.h\"\n\nenum\n{\n\tFZ_DOCUMENT_HANDLER_MAX = 10\n};\n\nstruct fz_document_handler_context_s\n{\n\tint refs;\n\tint count;\n\tconst fz_document_handler *handler[FZ_DOCUMENT_HANDLER_MAX];\n};\n\nvoid fz_new_document_handler_context(fz_context *ctx)\n{\n\tctx->handler = fz_malloc_struct(ctx, fz_document_handler_context);\n\tctx->handler->refs = 1;\n}\n\nfz_document_handler_context *fz_keep_document_handler_context(fz_context *ctx)\n{\n\tif (!ctx || !ctx->handler)\n\t\treturn NULL;\n\tctx->handler->refs++;\n\treturn ctx->handler;\n}\n\nvoid fz_drop_document_handler_context(fz_context *ctx)\n{\n\tif (!ctx || !ctx->handler)\n\t\treturn;\n\n\tif (--ctx->handler->refs != 0)\n\t\treturn;\n\n\tfz_free(ctx, ctx->handler);\n\tctx->handler = NULL;\n}\n\nvoid fz_register_document_handler(fz_context *ctx, const fz_document_handler *handler)\n{\n\tfz_document_handler_context *dc;\n\tint i;\n\n\tif (!ctx || !handler)\n\t\treturn;\n\n\tdc = ctx->handler;\n\tif (dc == NULL)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Document handler list not found\");\n\n\tfor (i = 0; i < dc->count; i++)\n\t\tif (dc->handler[i] == handler)\n\t\t\treturn;\n\n\tif (dc->count >= FZ_DOCUMENT_HANDLER_MAX)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Too many document handlers\");\n\n\tdc->handler[dc->count++] = handler;\n}\n\nstatic inline int fz_tolower(int c)\n{\n\tif (c >= 'A' && c <= 'Z')\n\t\treturn c + 32;\n\treturn c;\n}\n\nint fz_strcasecmp(const char *a, const char *b)\n{\n\twhile (fz_tolower(*a) == fz_tolower(*b))\n\t{\n\t\tif (*a++ == 0)\n\t\t\treturn 0;\n\t\tb++;\n\t}\n\treturn fz_tolower(*a) - fz_tolower(*b);\n}\n\nfz_document *\nfz_open_document_with_stream(fz_context *ctx, const char *magic, fz_stream *stream)\n{\n\tint i, score;\n\tint best_i, best_score;\n\tfz_document_handler_context *dc;\n\n\tif (ctx == NULL || magic == NULL || stream == NULL)\n\t\treturn NULL;\n\n\tdc = ctx->handler;\n\tif (dc->count == 0)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"No document handlers registered\");\n\n\tbest_i = -1;\n\tbest_score = 0;\n\tfor (i = 0; i < dc->count; i++)\n\t{\n\t\tscore = dc->handler[i]->recognize(ctx, magic);\n\t\tif (best_score < score)\n\t\t{\n\t\t\tbest_score = score;\n\t\t\tbest_i = i;\n\t\t}\n\t}\n\n\tif (best_i >= 0)\n\t\treturn dc->handler[best_i]->open_with_stream(ctx, stream);\n\n\treturn NULL;\n}\n\nfz_document *\nfz_open_document(fz_context *ctx, const char *filename)\n{\n\tint i, score;\n\tint best_i, best_score;\n\tfz_document_handler_context *dc;\n\n\tif (ctx == NULL || filename == NULL)\n\t\treturn NULL;\n\n\tdc = ctx->handler;\n\tif (dc->count == 0)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"No document handlers registered\");\n\n\tbest_i = -1;\n\tbest_score = 0;\n\tfor (i = 0; i < dc->count; i++)\n\t{\n\t\tscore = dc->handler[i]->recognize(ctx, filename);\n\t\tif (best_score < score)\n\t\t{\n\t\t\tbest_score = score;\n\t\t\tbest_i = i;\n\t\t}\n\t}\n\n\tif (best_i >= 0)\n\t\treturn dc->handler[best_i]->open(ctx, filename);\n\n\treturn NULL;\n}\n\nvoid\nfz_close_document(fz_document *doc)\n{\n\tif (doc && doc->close)\n\t\tdoc->close(doc);\n}\n\nvoid\nfz_rebind_document(fz_document *doc, fz_context *ctx)\n{\n\tif (doc != NULL && doc->rebind != NULL)\n\t\tdoc->rebind(doc, ctx);\n}\n\nint\nfz_needs_password(fz_document *doc)\n{\n\tif (doc && doc->needs_password)\n\t\treturn doc->needs_password(doc);\n\treturn 0;\n}\n\nint\nfz_authenticate_password(fz_document *doc, const char *password)\n{\n\tif (doc && doc->authenticate_password)\n\t\treturn doc->authenticate_password(doc, password);\n\treturn 1;\n}\n\nfz_outline *\nfz_load_outline(fz_document *doc)\n{\n\tif (doc && doc->load_outline)\n\t\treturn doc->load_outline(doc);\n\treturn NULL;\n}\n\nvoid\nfz_layout_document(fz_document *doc, float w, float h, float em)\n{\n\tif (doc && doc->layout)\n\t\tdoc->layout(doc, w, h, em);\n}\n\nint\nfz_count_pages(fz_document *doc)\n{\n\tif (doc && doc->count_pages)\n\t\treturn doc->count_pages(doc);\n\treturn 0;\n}\n\nfz_page *\nfz_load_page(fz_document *doc, int number)\n{\n\tif (doc && doc->load_page)\n\t\treturn doc->load_page(doc, number);\n\treturn NULL;\n}\n\nfz_link *\nfz_load_links(fz_document *doc, fz_page *page)\n{\n\tif (doc && doc->load_links && page)\n\t\treturn doc->load_links(doc, page);\n\treturn NULL;\n}\n\nfz_rect *\nfz_bound_page(fz_document *doc, fz_page *page, fz_rect *r)\n{\n\tif (doc && doc->bound_page && page && r)\n\t\treturn doc->bound_page(doc, page, r);\n\tif (r)\n\t\t*r = fz_empty_rect;\n\treturn r;\n}\n\nfz_annot *\nfz_first_annot(fz_document *doc, fz_page *page)\n{\n\tif (doc && doc->first_annot && page)\n\t\treturn doc->first_annot(doc, page);\n\treturn NULL;\n}\n\nfz_annot *\nfz_next_annot(fz_document *doc, fz_annot *annot)\n{\n\tif (doc && doc->next_annot && annot)\n\t\treturn doc->next_annot(doc, annot);\n\treturn NULL;\n}\n\nfz_rect *\nfz_bound_annot(fz_document *doc, fz_annot *annot, fz_rect *rect)\n{\n\tif (doc && doc->bound_annot && annot && rect)\n\t\treturn doc->bound_annot(doc, annot, rect);\n\tif (rect)\n\t\t*rect = fz_empty_rect;\n\treturn rect;\n}\n\nvoid\nfz_run_page_contents(fz_document *doc, fz_page *page, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie)\n{\n\tif (doc && doc->run_page_contents && page)\n\t{\n\t\tfz_context *ctx = dev->ctx;\n\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tdoc->run_page_contents(doc, page, dev, transform, cookie);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tif (fz_caught(ctx) != FZ_ERROR_ABORT)\n\t\t\t\tfz_rethrow(ctx);\n\t\t}\n\t}\n}\n\nvoid\nfz_run_annot(fz_document *doc, fz_page *page, fz_annot *annot, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie)\n{\n\tif (doc && doc->run_annot && page && annot)\n\t{\n\t\tfz_context *ctx = dev->ctx;\n\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tdoc->run_annot(doc, page, annot, dev, transform, cookie);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tif (fz_caught(ctx) != FZ_ERROR_ABORT)\n\t\t\t\tfz_rethrow(ctx);\n\t\t}\n\t}\n}\n\nvoid\nfz_run_page(fz_document *doc, fz_page *page, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie)\n{\n\tfz_annot *annot;\n\tfz_rect mediabox;\n\n\tfz_bound_page(doc, page, &mediabox);\n\tfz_begin_page(dev, &mediabox, transform);\n\n\tfz_run_page_contents(doc, page, dev, transform, cookie);\n\n\tif (cookie && cookie->progress_max != -1)\n\t{\n\t\tint count = 1;\n\t\tfor (annot = fz_first_annot(doc, page); annot; annot = fz_next_annot(doc, annot))\n\t\t\tcount++;\n\t\tcookie->progress_max += count;\n\t}\n\n\tfor (annot = fz_first_annot(doc, page); annot; annot = fz_next_annot(doc, annot))\n\t{\n\t\t/* Check the cookie for aborting */\n\t\tif (cookie)\n\t\t{\n\t\t\tif (cookie->abort)\n\t\t\t\tbreak;\n\t\t\tcookie->progress++;\n\t\t}\n\n\t\tfz_run_annot(doc, page, annot, dev, transform, cookie);\n\t}\n\n\tfz_end_page(dev);\n}\n\nvoid\nfz_free_page(fz_document *doc, fz_page *page)\n{\n\tif (doc && doc->free_page && page)\n\t\tdoc->free_page(doc, page);\n}\n\nint\nfz_meta(fz_document *doc, int key, void *ptr, int size)\n{\n\tif (doc && doc->meta)\n\t\treturn doc->meta(doc, key, ptr, size);\n\treturn FZ_META_UNKNOWN_KEY;\n}\n\nfz_transition *\nfz_page_presentation(fz_document *doc, fz_page *page, float *duration)\n{\n\tfloat dummy;\n\tif (duration)\n\t\t*duration = 0;\n\telse\n\t\tduration = &dummy;\n\tif (doc && doc->page_presentation && page)\n\t\treturn doc->page_presentation(doc, page, duration);\n\treturn NULL;\n}\n\nvoid\nfz_write_document(fz_document *doc, char *filename, fz_write_options *opts)\n{\n\tif (doc && doc->write)\n\t\tdoc->write(doc, filename, opts);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/draw-affine.c",
    "content": "#include \"mupdf/fitz.h\"\n#include \"draw-imp.h\"\n\ntypedef unsigned char byte;\n\nstatic inline float roundup(float x)\n{\n\treturn (x < 0) ? floorf(x) : ceilf(x);\n}\n\nstatic inline int lerp(int a, int b, int t)\n{\n\treturn a + (((b - a) * t) >> 16);\n}\n\nstatic inline int bilerp(int a, int b, int c, int d, int u, int v)\n{\n\treturn lerp(lerp(a, b, u), lerp(c, d, u), v);\n}\n\nstatic inline byte *sample_nearest(byte *s, int w, int h, int n, int u, int v)\n{\n\tif (u < 0) u = 0;\n\tif (v < 0) v = 0;\n\tif (u >= w) u = w - 1;\n\tif (v >= h) v = h - 1;\n\treturn s + (v * w + u) * n;\n}\n\n/* Blend premultiplied source image in constant alpha over destination */\n\nstatic inline void\nfz_paint_affine_alpha_N_lerp(byte *dp, byte *sp, int sw, int sh, int u, int v, int fa, int fb, int w, int n, int alpha, byte *hp)\n{\n\tint k;\n\tint n1 = n-1;\n\n\twhile (w--)\n\t{\n\t\tint ui = u >> 16;\n\t\tint vi = v >> 16;\n\t\tif (ui >= 0 && ui < sw && vi >= 0 && vi < sh)\n\t\t{\n\t\t\tint uf = u & 0xffff;\n\t\t\tint vf = v & 0xffff;\n\t\t\tbyte *a = sample_nearest(sp, sw, sh, n, ui, vi);\n\t\t\tbyte *b = sample_nearest(sp, sw, sh, n, ui+1, vi);\n\t\t\tbyte *c = sample_nearest(sp, sw, sh, n, ui, vi+1);\n\t\t\tbyte *d = sample_nearest(sp, sw, sh, n, ui+1, vi+1);\n\t\t\tint xa = bilerp(a[n1], b[n1], c[n1], d[n1], uf, vf);\n\t\t\tint t;\n\t\t\txa = fz_mul255(xa, alpha);\n\t\t\tt = 255 - xa;\n\t\t\tfor (k = 0; k < n1; k++)\n\t\t\t{\n\t\t\t\tint x = bilerp(a[k], b[k], c[k], d[k], uf, vf);\n\t\t\t\tdp[k] = fz_mul255(x, alpha) + fz_mul255(dp[k], t);\n\t\t\t}\n\t\t\tdp[n1] = xa + fz_mul255(dp[n1], t);\n\t\t\tif (hp)\n\t\t\t\thp[0] = xa + fz_mul255(hp[0], t);\n\t\t}\n\t\tdp += n;\n\t\tif (hp)\n\t\t\thp++;\n\t\tu += fa;\n\t\tv += fb;\n\t}\n}\n\n/* Special case code for gray -> rgb */\nstatic inline void\nfz_paint_affine_alpha_g2rgb_lerp(byte *dp, byte *sp, int sw, int sh, int u, int v, int fa, int fb, int w, int alpha, byte *hp)\n{\n\twhile (w--)\n\t{\n\t\tint ui = u >> 16;\n\t\tint vi = v >> 16;\n\t\tif (ui >= 0 && ui < sw && vi >= 0 && vi < sh)\n\t\t{\n\t\t\tint uf = u & 0xffff;\n\t\t\tint vf = v & 0xffff;\n\t\t\tbyte *a = sample_nearest(sp, sw, sh, 2, ui, vi);\n\t\t\tbyte *b = sample_nearest(sp, sw, sh, 2, ui+1, vi);\n\t\t\tbyte *c = sample_nearest(sp, sw, sh, 2, ui, vi+1);\n\t\t\tbyte *d = sample_nearest(sp, sw, sh, 2, ui+1, vi+1);\n\t\t\tint y = bilerp(a[1], b[1], c[1], d[1], uf, vf);\n\t\t\tint x = bilerp(a[0], b[0], c[0], d[0], uf, vf);\n\t\t\tint t;\n\t\t\tx = fz_mul255(x, alpha);\n\t\t\ty = fz_mul255(y, alpha);\n\t\t\tt = 255 - y;\n\t\t\tdp[0] = x + fz_mul255(dp[0], t);\n\t\t\tdp[1] = x + fz_mul255(dp[1], t);\n\t\t\tdp[2] = x + fz_mul255(dp[2], t);\n\t\t\tdp[3] = y + fz_mul255(dp[3], t);\n\t\t\tif (hp)\n\t\t\t\thp[0] = y + fz_mul255(hp[0], t);\n\t\t}\n\t\tdp += 4;\n\t\tif (hp)\n\t\t\thp++;\n\t\tu += fa;\n\t\tv += fb;\n\t}\n}\n\nstatic inline void\nfz_paint_affine_alpha_N_near(byte *dp, byte *sp, int sw, int sh, int u, int v, int fa, int fb, int w, int n, int alpha, byte *hp)\n{\n\tint k;\n\tint n1 = n-1;\n\n\tif (fa == 0)\n\t{\n\t\tint ui = u >> 16;\n\t\tif (ui < 0 || ui >= sw)\n\t\t\treturn;\n\t\tsp += ui * n;\n\t\tsw *= n;\n\t\twhile (w--)\n\t\t{\n\t\t\tint vi = v >> 16;\n\t\t\tif (vi >= 0 && vi < sh)\n\t\t\t{\n\t\t\t\tbyte *sample = sp + (vi * sw);\n\t\t\t\tint a = fz_mul255(sample[n-1], alpha);\n\t\t\t\tint t = 255 - a;\n\t\t\t\tfor (k = 0; k < n1; k++)\n\t\t\t\t\tdp[k] = fz_mul255(sample[k], alpha) + fz_mul255(dp[k], t);\n\t\t\t\tdp[n1] = a + fz_mul255(dp[n1], t);\n\t\t\t\tif (hp)\n\t\t\t\t\thp[0] = a + fz_mul255(hp[0], t);\n\t\t\t}\n\t\t\tdp += n;\n\t\t\tif (hp)\n\t\t\t\thp++;\n\t\t\tv += fb;\n\t\t}\n\t}\n\telse if (fb == 0)\n\t{\n\t\tint vi = v >> 16;\n\t\tif (vi < 0 || vi >= sh)\n\t\t\treturn;\n\t\tsp += vi * sw * n;\n\t\twhile (w--)\n\t\t{\n\t\t\tint ui = u >> 16;\n\t\t\tif (ui >= 0 && ui < sw)\n\t\t\t{\n\t\t\t\tbyte *sample = sp + (ui * n);\n\t\t\t\tint a = fz_mul255(sample[n-1], alpha);\n\t\t\t\tint t = 255 - a;\n\t\t\t\tfor (k = 0; k < n1; k++)\n\t\t\t\t\tdp[k] = fz_mul255(sample[k], alpha) + fz_mul255(dp[k], t);\n\t\t\t\tdp[n1] = a + fz_mul255(dp[n1], t);\n\t\t\t\tif (hp)\n\t\t\t\t\thp[0] = a + fz_mul255(hp[0], t);\n\t\t\t}\n\t\t\tdp += n;\n\t\t\tif (hp)\n\t\t\t\thp++;\n\t\t\tu += fa;\n\t\t}\n\t}\n\telse\n\t{\n\t\twhile (w--)\n\t\t{\n\t\t\tint ui = u >> 16;\n\t\t\tint vi = v >> 16;\n\t\t\tif (ui >= 0 && ui < sw && vi >= 0 && vi < sh)\n\t\t\t{\n\t\t\t\tbyte *sample = sp + ((vi * sw + ui) * n);\n\t\t\t\tint a = fz_mul255(sample[n-1], alpha);\n\t\t\t\tint t = 255 - a;\n\t\t\t\tfor (k = 0; k < n1; k++)\n\t\t\t\t\tdp[k] = fz_mul255(sample[k], alpha) + fz_mul255(dp[k], t);\n\t\t\t\tdp[n1] = a + fz_mul255(dp[n1], t);\n\t\t\t\tif (hp)\n\t\t\t\t\thp[0] = a + fz_mul255(hp[0], t);\n\t\t\t}\n\t\t\tdp += n;\n\t\t\tif (hp)\n\t\t\t\thp++;\n\t\t\tu += fa;\n\t\t\tv += fb;\n\t\t}\n\t}\n}\n\nstatic inline void\nfz_paint_affine_alpha_g2rgb_near(byte *dp, byte *sp, int sw, int sh, int u, int v, int fa, int fb, int w, int alpha, byte *hp)\n{\n\tif (fa == 0)\n\t{\n\t\tint ui = u >> 16;\n\t\tif (ui < 0 || ui >= sw)\n\t\t\treturn;\n\t\tsp += ui * 2;\n\t\tsw *= 2;\n\t\twhile (w--)\n\t\t{\n\t\t\tint vi = v >> 16;\n\t\t\tif (vi >= 0 && vi < sh)\n\t\t\t{\n\t\t\t\tbyte *sample = sp + (vi * sw);\n\t\t\t\tint x = fz_mul255(sample[0], alpha);\n\t\t\t\tint a = fz_mul255(sample[1], alpha);\n\t\t\t\tint t = 255 - a;\n\t\t\t\tdp[0] = x + fz_mul255(dp[0], t);\n\t\t\t\tdp[1] = x + fz_mul255(dp[1], t);\n\t\t\t\tdp[2] = x + fz_mul255(dp[2], t);\n\t\t\t\tdp[3] = a + fz_mul255(dp[3], t);\n\t\t\t\tif (hp)\n\t\t\t\t\thp[0] = a + fz_mul255(hp[0], t);\n\t\t\t}\n\t\t\tdp += 4;\n\t\t\tif (hp)\n\t\t\t\thp++;\n\t\t\tv += fb;\n\t\t}\n\t}\n\telse if (fb == 0)\n\t{\n\t\tint vi = v >> 16;\n\t\tif (vi < 0 || vi >= sh)\n\t\t\treturn;\n\t\tsp += vi * sw * 2;\n\t\twhile (w--)\n\t\t{\n\t\t\tint ui = u >> 16;\n\t\t\tif (ui >= 0 && ui < sw)\n\t\t\t{\n\t\t\t\tbyte *sample = sp + (ui * 2);\n\t\t\t\tint x = fz_mul255(sample[0], alpha);\n\t\t\t\tint a = fz_mul255(sample[1], alpha);\n\t\t\t\tint t = 255 - a;\n\t\t\t\tdp[0] = x + fz_mul255(dp[0], t);\n\t\t\t\tdp[1] = x + fz_mul255(dp[1], t);\n\t\t\t\tdp[2] = x + fz_mul255(dp[2], t);\n\t\t\t\tdp[3] = a + fz_mul255(dp[3], t);\n\t\t\t\tif (hp)\n\t\t\t\t\thp[0] = a + fz_mul255(hp[0], t);\n\t\t\t}\n\t\t\tdp += 4;\n\t\t\tif (hp)\n\t\t\t\thp++;\n\t\t\tu += fa;\n\t\t}\n\t}\n\telse\n\t{\n\t\twhile (w--)\n\t\t{\n\t\t\tint ui = u >> 16;\n\t\t\tint vi = v >> 16;\n\t\t\tif (ui >= 0 && ui < sw && vi >= 0 && vi < sh)\n\t\t\t{\n\t\t\t\tbyte *sample = sp + ((vi * sw + ui) * 2);\n\t\t\t\tint x = fz_mul255(sample[0], alpha);\n\t\t\t\tint a = fz_mul255(sample[1], alpha);\n\t\t\t\tint t = 255 - a;\n\t\t\t\tdp[0] = x + fz_mul255(dp[0], t);\n\t\t\t\tdp[1] = x + fz_mul255(dp[1], t);\n\t\t\t\tdp[2] = x + fz_mul255(dp[2], t);\n\t\t\t\tdp[3] = a + fz_mul255(dp[3], t);\n\t\t\t\tif (hp)\n\t\t\t\t\thp[0] = a + fz_mul255(hp[0], t);\n\t\t\t}\n\t\t\tdp += 4;\n\t\t\tif (hp)\n\t\t\t\thp++;\n\t\t\tu += fa;\n\t\t\tv += fb;\n\t\t}\n\t}\n}\n\n/* Blend premultiplied source image over destination */\n\nstatic inline void\nfz_paint_affine_N_lerp(byte *dp, byte *sp, int sw, int sh, int u, int v, int fa, int fb, int w, int n, byte *hp)\n{\n\tint k;\n\tint n1 = n-1;\n\n\twhile (w--)\n\t{\n\t\tint ui = u >> 16;\n\t\tint vi = v >> 16;\n\t\tif (ui >= 0 && ui < sw && vi >= 0 && vi < sh)\n\t\t{\n\t\t\tint uf = u & 0xffff;\n\t\t\tint vf = v & 0xffff;\n\t\t\tbyte *a = sample_nearest(sp, sw, sh, n, ui, vi);\n\t\t\tbyte *b = sample_nearest(sp, sw, sh, n, ui+1, vi);\n\t\t\tbyte *c = sample_nearest(sp, sw, sh, n, ui, vi+1);\n\t\t\tbyte *d = sample_nearest(sp, sw, sh, n, ui+1, vi+1);\n\t\t\tint y = bilerp(a[n1], b[n1], c[n1], d[n1], uf, vf);\n\t\t\tint t = 255 - y;\n\t\t\tfor (k = 0; k < n1; k++)\n\t\t\t{\n\t\t\t\tint x = bilerp(a[k], b[k], c[k], d[k], uf, vf);\n\t\t\t\tdp[k] = x + fz_mul255(dp[k], t);\n\t\t\t}\n\t\t\tdp[n1] = y + fz_mul255(dp[n1], t);\n\t\t\tif (hp)\n\t\t\t\thp[0] = y + fz_mul255(hp[0], t);\n\t\t}\n\t\tdp += n;\n\t\tif (hp)\n\t\t\thp++;\n\t\tu += fa;\n\t\tv += fb;\n\t}\n}\n\nstatic inline void\nfz_paint_affine_solid_g2rgb_lerp(byte *dp, byte *sp, int sw, int sh, int u, int v, int fa, int fb, int w, byte *hp)\n{\n\twhile (w--)\n\t{\n\t\tint ui = u >> 16;\n\t\tint vi = v >> 16;\n\t\tif (ui >= 0 && ui < sw && vi >= 0 && vi < sh)\n\t\t{\n\t\t\tint uf = u & 0xffff;\n\t\t\tint vf = v & 0xffff;\n\t\t\tbyte *a = sample_nearest(sp, sw, sh, 2, ui, vi);\n\t\t\tbyte *b = sample_nearest(sp, sw, sh, 2, ui+1, vi);\n\t\t\tbyte *c = sample_nearest(sp, sw, sh, 2, ui, vi+1);\n\t\t\tbyte *d = sample_nearest(sp, sw, sh, 2, ui+1, vi+1);\n\t\t\tint y = bilerp(a[1], b[1], c[1], d[1], uf, vf);\n\t\t\tint t = 255 - y;\n\t\t\tint x = bilerp(a[0], b[0], c[0], d[0], uf, vf);\n\t\t\tdp[0] = x + fz_mul255(dp[0], t);\n\t\t\tdp[1] = x + fz_mul255(dp[1], t);\n\t\t\tdp[2] = x + fz_mul255(dp[2], t);\n\t\t\tdp[3] = y + fz_mul255(dp[3], t);\n\t\t\tif (hp)\n\t\t\t\thp[0] = y + fz_mul255(hp[0], t);\n\t\t}\n\t\tdp += 4;\n\t\tif (hp)\n\t\t\thp++;\n\t\tu += fa;\n\t\tv += fb;\n\t}\n}\n\nstatic inline void\nfz_paint_affine_N_near(byte *dp, byte *sp, int sw, int sh, int u, int v, int fa, int fb, int w, int n, byte *hp)\n{\n\tint k;\n\tint n1 = n-1;\n\n\tif (fa == 0)\n\t{\n\t\tint ui = u >> 16;\n\t\tif (ui < 0 || ui >= sw)\n\t\t\treturn;\n\t\tsp += ui*n;\n\t\tsw *= n;\n\t\twhile (w--)\n\t\t{\n\t\t\tint vi = v >> 16;\n\t\t\tif (vi >= 0 && vi < sh)\n\t\t\t{\n\t\t\t\tbyte *sample = sp + (vi * sw);\n\t\t\t\tint a = sample[n1];\n\t\t\t\t/* If a is 0, then sample[k] = 0 for all k, as premultiplied */\n\t\t\t\tif (a != 0)\n\t\t\t\t{\n\t\t\t\t\tint t = 255 - a;\n\t\t\t\t\tif (t == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (n == 4)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t*(int *)dp = *(int *)sample;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (k = 0; k < n1; k++)\n\t\t\t\t\t\t\t\tdp[k] = sample[k];\n\t\t\t\t\t\t\tdp[n1] = a;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hp)\n\t\t\t\t\t\t\thp[0] = a;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (k = 0; k < n1; k++)\n\t\t\t\t\t\t\tdp[k] = sample[k] + fz_mul255(dp[k], t);\n\t\t\t\t\t\tdp[n1] = a + fz_mul255(dp[n1], t);\n\t\t\t\t\t\tif (hp)\n\t\t\t\t\t\t\thp[0] = a + fz_mul255(hp[0], t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tdp += n;\n\t\t\tif (hp)\n\t\t\t\thp++;\n\t\t\tv += fb;\n\t\t}\n\t}\n\telse if (fb == 0)\n\t{\n\t\tint vi = v >> 16;\n\t\tif (vi < 0 || vi >= sh)\n\t\t\treturn;\n\t\tsp += vi * sw * n;\n\t\twhile (w--)\n\t\t{\n\t\t\tint ui = u >> 16;\n\t\t\tif (ui >= 0 && ui < sw)\n\t\t\t{\n\t\t\t\tbyte *sample = sp + (ui * n);\n\t\t\t\tint a = sample[n1];\n\t\t\t\t/* If a is 0, then sample[k] = 0 for all k, as premultiplied */\n\t\t\t\tif (a != 0)\n\t\t\t\t{\n\t\t\t\t\tint t = 255 - a;\n\t\t\t\t\tif (t == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (n == 4)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t*(int *)dp = *(int *)sample;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (k = 0; k < n1; k++)\n\t\t\t\t\t\t\t\tdp[k] = sample[k];\n\t\t\t\t\t\t\tdp[n1] = a;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hp)\n\t\t\t\t\t\t\thp[0] = a;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (k = 0; k < n1; k++)\n\t\t\t\t\t\t\tdp[k] = sample[k] + fz_mul255(dp[k], t);\n\t\t\t\t\t\tdp[n1] = a + fz_mul255(dp[n1], t);\n\t\t\t\t\t\tif (hp)\n\t\t\t\t\t\t\thp[0] = a + fz_mul255(hp[0], t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tdp += n;\n\t\t\tif (hp)\n\t\t\t\thp++;\n\t\t\tu += fa;\n\t\t}\n\t}\n\telse\n\t{\n\t\twhile (w--)\n\t\t{\n\t\t\tint ui = u >> 16;\n\t\t\tint vi = v >> 16;\n\t\t\tif (ui >= 0 && ui < sw && vi >= 0 && vi < sh)\n\t\t\t{\n\t\t\t\tbyte *sample = sp + ((vi * sw + ui) * n);\n\t\t\t\tint a = sample[n1];\n\t\t\t\t/* If a is 0, then sample[k] = 0 for all k, as premultiplied */\n\t\t\t\tif (a != 0)\n\t\t\t\t{\n\t\t\t\t\tint t = 255 - a;\n\t\t\t\t\tif (t == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (n == 4)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t*(int *)dp = *(int *)sample;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (k = 0; k < n1; k++)\n\t\t\t\t\t\t\t\tdp[k] = sample[k];\n\t\t\t\t\t\t\tdp[n1] = a;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hp)\n\t\t\t\t\t\t\thp[0] = a;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (k = 0; k < n1; k++)\n\t\t\t\t\t\t\tdp[k] = sample[k] + fz_mul255(dp[k], t);\n\t\t\t\t\t\tdp[n1] = a + fz_mul255(dp[n1], t);\n\t\t\t\t\t\tif (hp)\n\t\t\t\t\t\t\thp[0] = a + fz_mul255(hp[0], t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tdp += n;\n\t\t\tif (hp)\n\t\t\t\thp++;\n\t\t\tu += fa;\n\t\t\tv += fb;\n\t\t}\n\t}\n}\n\nstatic inline void\nfz_paint_affine_solid_g2rgb_near(byte *dp, byte *sp, int sw, int sh, int u, int v, int fa, int fb, int w, byte *hp)\n{\n\tif (fa == 0)\n\t{\n\t\tint ui = u >> 16;\n\t\tif (ui < 0 || ui >= sw)\n\t\t\treturn;\n\t\tsp += ui * 2;\n\t\tsw *= 2;\n\t\twhile (w--)\n\t\t{\n\t\t\tint vi = v >> 16;\n\t\t\tif (vi >= 0 && vi < sh)\n\t\t\t{\n\t\t\t\tbyte *sample = sp + (vi * sw);\n\t\t\t\tint a = sample[1];\n\t\t\t\tif (a != 0)\n\t\t\t\t{\n\t\t\t\t\tint x = sample[0];\n\t\t\t\t\tint t = 255 - a;\n\t\t\t\t\tif (t == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdp[0] = x;\n\t\t\t\t\t\tdp[1] = x;\n\t\t\t\t\t\tdp[2] = x;\n\t\t\t\t\t\tdp[3] = a;\n\t\t\t\t\t\tif (hp)\n\t\t\t\t\t\t\thp[0] = a;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdp[0] = x + fz_mul255(dp[0], t);\n\t\t\t\t\t\tdp[1] = x + fz_mul255(dp[1], t);\n\t\t\t\t\t\tdp[2] = x + fz_mul255(dp[2], t);\n\t\t\t\t\t\tdp[3] = a + fz_mul255(dp[3], t);\n\t\t\t\t\t\tif (hp)\n\t\t\t\t\t\t\thp[0] = a + fz_mul255(hp[0], t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tdp += 4;\n\t\t\tif (hp)\n\t\t\t\thp++;\n\t\t\tv += fb;\n\t\t}\n\t}\n\telse if (fb == 0)\n\t{\n\t\tint vi = v >> 16;\n\t\tif (vi < 0 || vi >= sh)\n\t\t\treturn;\n\t\tsp += vi * sw * 2;\n\t\twhile (w--)\n\t\t{\n\t\t\tint ui = u >> 16;\n\t\t\tif (ui >= 0 && ui < sw)\n\t\t\t{\n\t\t\t\tbyte *sample = sp + (ui * 2);\n\t\t\t\tint a = sample[1];\n\t\t\t\tif (a != 0)\n\t\t\t\t{\n\t\t\t\t\tint x = sample[0];\n\t\t\t\t\tint t = 255 - a;\n\t\t\t\t\tif (t == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdp[0] = x;\n\t\t\t\t\t\tdp[1] = x;\n\t\t\t\t\t\tdp[2] = x;\n\t\t\t\t\t\tdp[3] = a;\n\t\t\t\t\t\tif (hp)\n\t\t\t\t\t\t\thp[0] = a;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdp[0] = x + fz_mul255(dp[0], t);\n\t\t\t\t\t\tdp[1] = x + fz_mul255(dp[1], t);\n\t\t\t\t\t\tdp[2] = x + fz_mul255(dp[2], t);\n\t\t\t\t\t\tdp[3] = a + fz_mul255(dp[3], t);\n\t\t\t\t\t\tif (hp)\n\t\t\t\t\t\t\thp[0] = a + fz_mul255(hp[0], t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tdp += 4;\n\t\t\tif (hp)\n\t\t\t\thp++;\n\t\t\tu += fa;\n\t\t}\n\t}\n\telse\n\t{\n\t\twhile (w--)\n\t\t{\n\t\t\tint ui = u >> 16;\n\t\t\tint vi = v >> 16;\n\t\t\tif (ui >= 0 && ui < sw && vi >= 0 && vi < sh)\n\t\t\t{\n\t\t\t\tbyte *sample = sp + ((vi * sw + ui) * 2);\n\t\t\t\tint a = sample[1];\n\t\t\t\tif (a != 0)\n\t\t\t\t{\n\t\t\t\t\tint x = sample[0];\n\t\t\t\t\tint t = 255 - a;\n\t\t\t\t\tif (t == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tdp[0] = x;\n\t\t\t\t\t\tdp[1] = x;\n\t\t\t\t\t\tdp[2] = x;\n\t\t\t\t\t\tdp[3] = a;\n\t\t\t\t\t\tif (hp)\n\t\t\t\t\t\t\thp[0] = a;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tdp[0] = x + fz_mul255(dp[0], t);\n\t\t\t\t\t\tdp[1] = x + fz_mul255(dp[1], t);\n\t\t\t\t\t\tdp[2] = x + fz_mul255(dp[2], t);\n\t\t\t\t\t\tdp[3] = a + fz_mul255(dp[3], t);\n\t\t\t\t\t\tif (hp)\n\t\t\t\t\t\t\thp[0] = a + fz_mul255(hp[0], t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tdp += 4;\n\t\t\tif (hp)\n\t\t\t\thp++;\n\t\t\tu += fa;\n\t\t\tv += fb;\n\t\t}\n\t}\n}\n\n/* Blend non-premultiplied color in source image mask over destination */\n\nstatic inline void\nfz_paint_affine_color_N_lerp(byte *dp, byte *sp, int sw, int sh, int u, int v, int fa, int fb, int w, int n, byte *color, byte *hp)\n{\n\tint n1 = n - 1;\n\tint sa = color[n1];\n\tint k;\n\n\twhile (w--)\n\t{\n\t\tint ui = u >> 16;\n\t\tint vi = v >> 16;\n\t\tif (ui >= 0 && ui < sw && vi >= 0 && vi < sh)\n\t\t{\n\t\t\tint uf = u & 0xffff;\n\t\t\tint vf = v & 0xffff;\n\t\t\tbyte *a = sample_nearest(sp, sw, sh, 1, ui, vi);\n\t\t\tbyte *b = sample_nearest(sp, sw, sh, 1, ui+1, vi);\n\t\t\tbyte *c = sample_nearest(sp, sw, sh, 1, ui, vi+1);\n\t\t\tbyte *d = sample_nearest(sp, sw, sh, 1, ui+1, vi+1);\n\t\t\tint ma = bilerp(a[0], b[0], c[0], d[0], uf, vf);\n\t\t\tint masa = FZ_COMBINE(FZ_EXPAND(ma), sa);\n\t\t\tfor (k = 0; k < n1; k++)\n\t\t\t\tdp[k] = FZ_BLEND(color[k], dp[k], masa);\n\t\t\tdp[n1] = FZ_BLEND(255, dp[n1], masa);\n\t\t\tif (hp)\n\t\t\t\thp[0] = FZ_BLEND(255, hp[0], masa);\n\t\t}\n\t\tdp += n;\n\t\tif (hp)\n\t\t\thp++;\n\t\tu += fa;\n\t\tv += fb;\n\t}\n}\n\nstatic inline void\nfz_paint_affine_color_N_near(byte *dp, byte *sp, int sw, int sh, int u, int v, int fa, int fb, int w, int n, byte *color, byte *hp)\n{\n\tint n1 = n-1;\n\tint sa = color[n1];\n\tint k;\n\n\twhile (w--)\n\t{\n\t\tint ui = u >> 16;\n\t\tint vi = v >> 16;\n\t\tif (ui >= 0 && ui < sw && vi >= 0 && vi < sh)\n\t\t{\n\t\t\tint ma = sp[vi * sw + ui];\n\t\t\tint masa = FZ_COMBINE(FZ_EXPAND(ma), sa);\n\t\t\tfor (k = 0; k < n1; k++)\n\t\t\t\tdp[k] = FZ_BLEND(color[k], dp[k], masa);\n\t\t\tdp[n1] = FZ_BLEND(255, dp[n1], masa);\n\t\t\tif (hp)\n\t\t\t\thp[0] = FZ_BLEND(255, hp[0], masa);\n\t\t}\n\t\tdp += n;\n\t\tif (hp)\n\t\t\thp++;\n\t\tu += fa;\n\t\tv += fb;\n\t}\n}\n\nstatic void\nfz_paint_affine_lerp(byte *dp, byte *sp, int sw, int sh, int u, int v, int fa, int fb, int w, int n, int alpha, byte *color/*unused*/, byte *hp)\n{\n\tif (alpha == 255)\n\t{\n\t\tswitch (n)\n\t\t{\n\t\tcase 1: fz_paint_affine_N_lerp(dp, sp, sw, sh, u, v, fa, fb, w, 1, hp); break;\n\t\tcase 2: fz_paint_affine_N_lerp(dp, sp, sw, sh, u, v, fa, fb, w, 2, hp); break;\n\t\tcase 4: fz_paint_affine_N_lerp(dp, sp, sw, sh, u, v, fa, fb, w, 4, hp); break;\n\t\tdefault: fz_paint_affine_N_lerp(dp, sp, sw, sh, u, v, fa, fb, w, n, hp); break;\n\t\t}\n\t}\n\telse if (alpha > 0)\n\t{\n\t\tswitch (n)\n\t\t{\n\t\tcase 1: fz_paint_affine_alpha_N_lerp(dp, sp, sw, sh, u, v, fa, fb, w, 1, alpha, hp); break;\n\t\tcase 2: fz_paint_affine_alpha_N_lerp(dp, sp, sw, sh, u, v, fa, fb, w, 2, alpha, hp); break;\n\t\tcase 4: fz_paint_affine_alpha_N_lerp(dp, sp, sw, sh, u, v, fa, fb, w, 4, alpha, hp); break;\n\t\tdefault: fz_paint_affine_alpha_N_lerp(dp, sp, sw, sh, u, v, fa, fb, w, n, alpha, hp); break;\n\t\t}\n\t}\n}\n\nstatic void\nfz_paint_affine_g2rgb_lerp(byte *dp, byte *sp, int sw, int sh, int u, int v, int fa, int fb, int w, int n, int alpha, byte *color/*unused*/, byte *hp)\n{\n\tif (alpha == 255)\n\t{\n\t\tfz_paint_affine_solid_g2rgb_lerp(dp, sp, sw, sh, u, v, fa, fb, w, hp);\n\t}\n\telse if (alpha > 0)\n\t{\n\t\tfz_paint_affine_alpha_g2rgb_lerp(dp, sp, sw, sh, u, v, fa, fb, w, alpha, hp);\n\t}\n}\n\nstatic void\nfz_paint_affine_near(byte *dp, byte *sp, int sw, int sh, int u, int v, int fa, int fb, int w, int n, int alpha, byte *color/*unused */, byte *hp)\n{\n\tif (alpha == 255)\n\t{\n\t\tswitch (n)\n\t\t{\n\t\tcase 1: fz_paint_affine_N_near(dp, sp, sw, sh, u, v, fa, fb, w, 1, hp); break;\n\t\tcase 2: fz_paint_affine_N_near(dp, sp, sw, sh, u, v, fa, fb, w, 2, hp); break;\n\t\tcase 4: fz_paint_affine_N_near(dp, sp, sw, sh, u, v, fa, fb, w, 4, hp); break;\n\t\tdefault: fz_paint_affine_N_near(dp, sp, sw, sh, u, v, fa, fb, w, n, hp); break;\n\t\t}\n\t}\n\telse if (alpha > 0)\n\t{\n\t\tswitch (n)\n\t\t{\n\t\tcase 1: fz_paint_affine_alpha_N_near(dp, sp, sw, sh, u, v, fa, fb, w, 1, alpha, hp); break;\n\t\tcase 2: fz_paint_affine_alpha_N_near(dp, sp, sw, sh, u, v, fa, fb, w, 2, alpha, hp); break;\n\t\tcase 4: fz_paint_affine_alpha_N_near(dp, sp, sw, sh, u, v, fa, fb, w, 4, alpha, hp); break;\n\t\tdefault: fz_paint_affine_alpha_N_near(dp, sp, sw, sh, u, v, fa, fb, w, n, alpha, hp); break;\n\t\t}\n\t}\n}\n\nstatic void\nfz_paint_affine_g2rgb_near(byte *dp, byte *sp, int sw, int sh, int u, int v, int fa, int fb, int w, int n, int alpha, byte *color/*unused*/, byte *hp)\n{\n\tif (alpha == 255)\n\t{\n\t\tfz_paint_affine_solid_g2rgb_near(dp, sp, sw, sh, u, v, fa, fb, w, hp);\n\t}\n\telse if (alpha > 0)\n\t{\n\t\tfz_paint_affine_alpha_g2rgb_near(dp, sp, sw, sh, u, v, fa, fb, w, alpha, hp);\n\t}\n}\n\nstatic void\nfz_paint_affine_color_lerp(byte *dp, byte *sp, int sw, int sh, int u, int v, int fa, int fb, int w, int n, int alpha/*unused*/, byte *color, byte *hp)\n{\n\tswitch (n)\n\t{\n\tcase 2: fz_paint_affine_color_N_lerp(dp, sp, sw, sh, u, v, fa, fb, w, 2, color, hp); break;\n\tcase 4: fz_paint_affine_color_N_lerp(dp, sp, sw, sh, u, v, fa, fb, w, 4, color, hp); break;\n\tdefault: fz_paint_affine_color_N_lerp(dp, sp, sw, sh, u, v, fa, fb, w, n, color, hp); break;\n\t}\n}\n\nstatic void\nfz_paint_affine_color_near(byte *dp, byte *sp, int sw, int sh, int u, int v, int fa, int fb, int w, int n, int alpha/*unused*/, byte *color, byte *hp)\n{\n\tswitch (n)\n\t{\n\tcase 2: fz_paint_affine_color_N_near(dp, sp, sw, sh, u, v, fa, fb, w, 2, color, hp); break;\n\tcase 4: fz_paint_affine_color_N_near(dp, sp, sw, sh, u, v, fa, fb, w, 4, color, hp); break;\n\tdefault: fz_paint_affine_color_N_near(dp, sp, sw, sh, u, v, fa, fb, w, n, color, hp); break;\n\t}\n}\n\n/* RJW: The following code was originally written to be sensitive to\n * FLT_EPSILON. Given the way the 'minimum representable difference'\n * between 2 floats changes size as we scale, we now pick a larger\n * value to ensure idempotency even with rounding problems. The\n * value we pick is still far smaller than would ever show up with\n * antialiasing.\n */\n#define MY_EPSILON 0.001\n\nvoid\nfz_gridfit_matrix(fz_matrix *m)\n{\n\tif (fabsf(m->b) < FLT_EPSILON && fabsf(m->c) < FLT_EPSILON)\n\t{\n\t\tif (m->a > 0)\n\t\t{\n\t\t\tfloat f;\n\t\t\t/* Adjust left hand side onto pixel boundary */\n\t\t\tf = (float)(int)(m->e);\n\t\t\tif (f - m->e > MY_EPSILON)\n\t\t\t\tf -= 1.0; /* Ensure it moves left */\n\t\t\tm->a += m->e - f; /* width gets wider as f <= m.e */\n\t\t\tm->e = f;\n\t\t\t/* Adjust right hand side onto pixel boundary */\n\t\t\tf = (float)(int)(m->a);\n\t\t\tif (m->a - f > MY_EPSILON)\n\t\t\t\tf += 1.0; /* Ensure it moves right */\n\t\t\tm->a = f;\n\t\t}\n\t\telse if (m->a < 0)\n\t\t{\n\t\t\tfloat f;\n\t\t\t/* Adjust right hand side onto pixel boundary */\n\t\t\tf = (float)(int)(m->e);\n\t\t\tif (m->e - f > MY_EPSILON)\n\t\t\t\tf += 1.0; /* Ensure it moves right */\n\t\t\tm->a += m->e - f; /* width gets wider (more -ve) */\n\t\t\tm->e = f;\n\t\t\t/* Adjust left hand side onto pixel boundary */\n\t\t\tf = (float)(int)(m->a);\n\t\t\tif (f - m->a > MY_EPSILON)\n\t\t\t\tf -= 1.0; /* Ensure it moves left */\n\t\t\tm->a = f;\n\t\t}\n\t\tif (m->d > 0)\n\t\t{\n\t\t\tfloat f;\n\t\t\t/* Adjust top onto pixel boundary */\n\t\t\tf = (float)(int)(m->f);\n\t\t\tif (f - m->f > MY_EPSILON)\n\t\t\t\tf -= 1.0; /* Ensure it moves upwards */\n\t\t\tm->d += m->f - f; /* width gets wider as f <= m.f */\n\t\t\tm->f = f;\n\t\t\t/* Adjust bottom onto pixel boundary */\n\t\t\tf = (float)(int)(m->d);\n\t\t\tif (m->d - f > MY_EPSILON)\n\t\t\t\tf += 1.0; /* Ensure it moves down */\n\t\t\tm->d = f;\n\t\t}\n\t\telse if (m->d < 0)\n\t\t{\n\t\t\tfloat f;\n\t\t\t/* Adjust bottom onto pixel boundary */\n\t\t\tf = (float)(int)(m->f);\n\t\t\tif (m->f - f > MY_EPSILON)\n\t\t\t\tf += 1.0; /* Ensure it moves down */\n\t\t\tm->d += m->f - f; /* width gets wider (more -ve) */\n\t\t\tm->f = f;\n\t\t\t/* Adjust top onto pixel boundary */\n\t\t\tf = (float)(int)(m->d);\n\t\t\tif (f - m->d > MY_EPSILON)\n\t\t\t\tf -= 1.0; /* Ensure it moves up */\n\t\t\tm->d = f;\n\t\t}\n\t}\n\telse if (fabsf(m->a) < FLT_EPSILON && fabsf(m->d) < FLT_EPSILON)\n\t{\n\t\tif (m->b > 0)\n\t\t{\n\t\t\tfloat f;\n\t\t\t/* Adjust left hand side onto pixel boundary */\n\t\t\tf = (float)(int)(m->f);\n\t\t\tif (f - m->f > MY_EPSILON)\n\t\t\t\tf -= 1.0; /* Ensure it moves left */\n\t\t\tm->b += m->f - f; /* width gets wider as f <= m.f */\n\t\t\tm->f = f;\n\t\t\t/* Adjust right hand side onto pixel boundary */\n\t\t\tf = (float)(int)(m->b);\n\t\t\tif (m->b - f > MY_EPSILON)\n\t\t\t\tf += 1.0; /* Ensure it moves right */\n\t\t\tm->b = f;\n\t\t}\n\t\telse if (m->b < 0)\n\t\t{\n\t\t\tfloat f;\n\t\t\t/* Adjust right hand side onto pixel boundary */\n\t\t\tf = (float)(int)(m->f);\n\t\t\tif (m->f - f > MY_EPSILON)\n\t\t\t\tf += 1.0; /* Ensure it moves right */\n\t\t\tm->b += m->f - f; /* width gets wider (more -ve) */\n\t\t\tm->f = f;\n\t\t\t/* Adjust left hand side onto pixel boundary */\n\t\t\tf = (float)(int)(m->b);\n\t\t\tif (f - m->b > MY_EPSILON)\n\t\t\t\tf -= 1.0; /* Ensure it moves left */\n\t\t\tm->b = f;\n\t\t}\n\t\tif (m->c > 0)\n\t\t{\n\t\t\tfloat f;\n\t\t\t/* Adjust top onto pixel boundary */\n\t\t\tf = (float)(int)(m->e);\n\t\t\tif (f - m->e > MY_EPSILON)\n\t\t\t\tf -= 1.0; /* Ensure it moves upwards */\n\t\t\tm->c += m->e - f; /* width gets wider as f <= m.e */\n\t\t\tm->e = f;\n\t\t\t/* Adjust bottom onto pixel boundary */\n\t\t\tf = (float)(int)(m->c);\n\t\t\tif (m->c - f > MY_EPSILON)\n\t\t\t\tf += 1.0; /* Ensure it moves down */\n\t\t\tm->c = f;\n\t\t}\n\t\telse if (m->c < 0)\n\t\t{\n\t\t\tfloat f;\n\t\t\t/* Adjust bottom onto pixel boundary */\n\t\t\tf = (float)(int)(m->e);\n\t\t\tif (m->e - f > MY_EPSILON)\n\t\t\t\tf += 1.0; /* Ensure it moves down */\n\t\t\tm->c += m->e - f; /* width gets wider (more -ve) */\n\t\t\tm->e = f;\n\t\t\t/* Adjust top onto pixel boundary */\n\t\t\tf = (float)(int)(m->c);\n\t\t\tif (f - m->c > MY_EPSILON)\n\t\t\t\tf -= 1.0; /* Ensure it moves up */\n\t\t\tm->c = f;\n\t\t}\n\t}\n}\n\n/* Draw an image with an affine transform on destination */\n\nstatic void\nfz_paint_image_imp(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz_pixmap *img, const fz_matrix *ctm, byte *color, int alpha, int lerp_allowed)\n{\n\tbyte *dp, *sp, *hp;\n\tint u, v, fa, fb, fc, fd;\n\tint x, y, w, h;\n\tint sw, sh, n, hw;\n\tfz_irect bbox;\n\tint dolerp;\n\tvoid (*paintfn)(byte *dp, byte *sp, int sw, int sh, int u, int v, int fa, int fb, int w, int n, int alpha, byte *color, byte *hp);\n\tfz_matrix local_ctm = *ctm;\n\tfz_rect rect;\n\tint is_rectilinear;\n\n\t/* grid fit the image */\n\tfz_gridfit_matrix(&local_ctm);\n\n\t/* turn on interpolation for upscaled and non-rectilinear transforms */\n\tdolerp = 0;\n\tis_rectilinear = fz_is_rectilinear(&local_ctm);\n\tif (!is_rectilinear)\n\t\tdolerp = lerp_allowed;\n\tif (sqrtf(local_ctm.a * local_ctm.a + local_ctm.b * local_ctm.b) > img->w)\n\t\tdolerp = lerp_allowed;\n\tif (sqrtf(local_ctm.c * local_ctm.c + local_ctm.d * local_ctm.d) > img->h)\n\t\tdolerp = lerp_allowed;\n\n\t/* except when we shouldn't, at large magnifications */\n\tif (!img->interpolate)\n\t{\n\t\tif (sqrtf(local_ctm.a * local_ctm.a + local_ctm.b * local_ctm.b) > img->w * 2)\n\t\t\tdolerp = 0;\n\t\tif (sqrtf(local_ctm.c * local_ctm.c + local_ctm.d * local_ctm.d) > img->h * 2)\n\t\t\tdolerp = 0;\n\t}\n\n\trect = fz_unit_rect;\n\tfz_irect_from_rect(&bbox, fz_transform_rect(&rect, &local_ctm));\n\tfz_intersect_irect(&bbox, scissor);\n\n\tx = bbox.x0;\n\tif (shape && shape->x > x)\n\t\tx = shape->x;\n\ty = bbox.y0;\n\tif (shape && shape->y > y)\n\t\ty = shape->y;\n\tw = bbox.x1;\n\tif (shape && shape->x + shape->w < w)\n\t\tw = shape->x + shape->w;\n\tw -= x;\n\th = bbox.y1;\n\tif (shape && shape->y + shape->h < h)\n\t\th = shape->y + shape->h;\n\th -= y;\n\tif (w < 0 || h < 0)\n\t\treturn;\n\n\t/* map from screen space (x,y) to image space (u,v) */\n\tfz_pre_scale(&local_ctm, 1.0f / img->w, 1.0f / img->h);\n\tfz_invert_matrix(&local_ctm, &local_ctm);\n\n\tfa = (int)(local_ctm.a *= 65536.0f);\n\tfb = (int)(local_ctm.b *= 65536.0f);\n\tfc = (int)(local_ctm.c *= 65536.0f);\n\tfd = (int)(local_ctm.d *= 65536.0f);\n\tlocal_ctm.e *= 65536.0f;\n\tlocal_ctm.f *= 65536.0f;\n\n\t/* Calculate initial texture positions. Do a half step to start. */\n\t/* Bug 693021: Keep calculation in float for as long as possible to\n\t * avoid overflow. */\n\tu = (int)((local_ctm.a * x) + (local_ctm.c * y) + local_ctm.e + ((local_ctm.a + local_ctm.c) * .5f));\n\tv = (int)((local_ctm.b * x) + (local_ctm.d * y) + local_ctm.f + ((local_ctm.b + local_ctm.d) * .5f));\n\n\t/* RJW: The following is voodoo. No idea why it works, but it gives\n\t * the best match between scaled/unscaled/interpolated/non-interpolated\n\t * that we have found. */\n\tif (dolerp && 0 /* SumatraPDF: this voodoo fails for several XPS documents */)\n\t{\n\t\tu -= 32768;\n\t\tv -= 32768;\n\t\tif (is_rectilinear)\n\t\t{\n\t\t\tif (u < 0)\n\t\t\t\tu = 0;\n\t\t\tif (v < 0)\n\t\t\t\tv = 0;\n\t\t}\n\t}\n\n\tdp = dst->samples + (unsigned int)(((y - dst->y) * dst->w + (x - dst->x)) * dst->n);\n\tn = dst->n;\n\tsp = img->samples;\n\tsw = img->w;\n\tsh = img->h;\n\tif (shape)\n\t{\n\t\thw = shape->w;\n\t\thp = shape->samples + (unsigned int)(((y - shape->y) * hw) + x - shape->x);\n\t}\n\telse\n\t{\n\t\thw = 0;\n\t\thp = NULL;\n\t}\n\n\t/* TODO: if (fb == 0 && fa == 1) call fz_paint_span */\n\n\tif (dst->n == 4 && img->n == 2)\n\t{\n\t\tassert(!color);\n\t\tif (dolerp)\n\t\t\tpaintfn = fz_paint_affine_g2rgb_lerp;\n\t\telse\n\t\t\tpaintfn = fz_paint_affine_g2rgb_near;\n\t}\n\telse\n\t{\n\t\tif (dolerp)\n\t\t{\n\t\t\tif (color)\n\t\t\t\tpaintfn = fz_paint_affine_color_lerp;\n\t\t\telse\n\t\t\t\tpaintfn = fz_paint_affine_lerp;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (color)\n\t\t\t\tpaintfn = fz_paint_affine_color_near;\n\t\t\telse\n\t\t\t\tpaintfn = fz_paint_affine_near;\n\t\t}\n\t}\n\n\twhile (h--)\n\t{\n\t\tpaintfn(dp, sp, sw, sh, u, v, fa, fb, w, n, alpha, color, hp);\n\t\tdp += dst->w * n;\n\t\thp += hw;\n\t\tu += fc;\n\t\tv += fd;\n\t}\n}\n\nvoid\nfz_paint_image_with_color(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz_pixmap *img, const fz_matrix *ctm, byte *color, int lerp_allowed)\n{\n\tassert(img->n == 1);\n\tfz_paint_image_imp(dst, scissor, shape, img, ctm, color, 255, lerp_allowed);\n}\n\nvoid\nfz_paint_image(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz_pixmap *img, const fz_matrix *ctm, int alpha, int lerp_allowed)\n{\n\tassert(dst->n == img->n || (dst->n == 4 && img->n == 2));\n\tfz_paint_image_imp(dst, scissor, shape, img, ctm, NULL, alpha, lerp_allowed);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/draw-blend.c",
    "content": "#include \"mupdf/fitz.h\"\n#include \"draw-imp.h\"\n\n/* PDF 1.4 blend modes. These are slow. */\n\ntypedef unsigned char byte;\n\nstatic const char *fz_blendmode_names[] =\n{\n\t\"Normal\",\n\t\"Multiply\",\n\t\"Screen\",\n\t\"Overlay\",\n\t\"Darken\",\n\t\"Lighten\",\n\t\"ColorDodge\",\n\t\"ColorBurn\",\n\t\"HardLight\",\n\t\"SoftLight\",\n\t\"Difference\",\n\t\"Exclusion\",\n\t\"Hue\",\n\t\"Saturation\",\n\t\"Color\",\n\t\"Luminosity\",\n};\n\nint fz_lookup_blendmode(char *name)\n{\n\tint i;\n\tfor (i = 0; i < nelem(fz_blendmode_names); i++)\n\t\tif (!strcmp(name, fz_blendmode_names[i]))\n\t\t\treturn i;\n\treturn FZ_BLEND_NORMAL;\n}\n\nchar *fz_blendmode_name(int blendmode)\n{\n\tif (blendmode >= 0 && blendmode < nelem(fz_blendmode_names))\n\t\treturn (char*)fz_blendmode_names[blendmode];\n\treturn \"Normal\";\n}\n\n/* Separable blend modes */\n\nstatic inline int fz_screen_byte(int b, int s)\n{\n\treturn b + s - fz_mul255(b, s);\n}\n\nstatic inline int fz_hard_light_byte(int b, int s)\n{\n\tint s2 = s << 1;\n\tif (s <= 127)\n\t\treturn fz_mul255(b, s2);\n\telse\n\t\treturn fz_screen_byte(b, s2 - 255);\n}\n\nstatic inline int fz_overlay_byte(int b, int s)\n{\n\treturn fz_hard_light_byte(s, b); /* note swapped order */\n}\n\nstatic inline int fz_darken_byte(int b, int s)\n{\n\treturn fz_mini(b, s);\n}\n\nstatic inline int fz_lighten_byte(int b, int s)\n{\n\treturn fz_maxi(b, s);\n}\n\nstatic inline int fz_color_dodge_byte(int b, int s)\n{\n\ts = 255 - s;\n\tif (b <= 0)\n\t\treturn 0;\n\telse if (b >= s)\n\t\treturn 255;\n\telse\n\t\treturn (0x1fe * b + s) / (s << 1);\n}\n\nstatic inline int fz_color_burn_byte(int b, int s)\n{\n\tb = 255 - b;\n\tif (b <= 0)\n\t\treturn 255;\n\telse if (b >= s)\n\t\treturn 0;\n\telse\n\t\treturn 0xff - (0x1fe * b + s) / (s << 1);\n}\n\nstatic inline int fz_soft_light_byte(int b, int s)\n{\n\t/* review this */\n\tif (s < 128) {\n\t\treturn b - fz_mul255(fz_mul255((255 - (s<<1)), b), 255 - b);\n\t}\n\telse {\n\t\tint dbd;\n\t\tif (b < 64)\n\t\t\tdbd = fz_mul255(fz_mul255((b << 4) - 12, b) + 4, b);\n\t\telse\n\t\t\tdbd = (int)sqrtf(255.0f * b);\n\t\treturn b + fz_mul255(((s<<1) - 255), (dbd - b));\n\t}\n}\n\nstatic inline int fz_difference_byte(int b, int s)\n{\n\treturn fz_absi(b - s);\n}\n\nstatic inline int fz_exclusion_byte(int b, int s)\n{\n\treturn b + s - (fz_mul255(b, s)<<1);\n}\n\n/* Non-separable blend modes */\n\nstatic void\nfz_luminosity_rgb(unsigned char *rd, unsigned char *gd, unsigned char *bd, int rb, int gb, int bb, int rs, int gs, int bs)\n{\n\tint delta, scale;\n\tint r, g, b, y;\n\n\t/* 0.3, 0.59, 0.11 in fixed point */\n\tdelta = ((rs - rb) * 77 + (gs - gb) * 151 + (bs - bb) * 28 + 0x80) >> 8;\n\tr = rb + delta;\n\tg = gb + delta;\n\tb = bb + delta;\n\n\tif ((r | g | b) & 0x100)\n\t{\n\t\ty = (rs * 77 + gs * 151 + bs * 28 + 0x80) >> 8;\n\t\tif (delta > 0)\n\t\t{\n\t\t\tint max;\n\t\t\tmax = fz_maxi(r, fz_maxi(g, b));\n\t\t\tscale = (max == y ? 0 : ((255 - y) << 16) / (max - y));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tint min;\n\t\t\tmin = fz_mini(r, fz_mini(g, b));\n\t\t\tscale = (y == min ? 0 : (y << 16) / (y - min));\n\t\t}\n\t\tr = y + (((r - y) * scale + 0x8000) >> 16);\n\t\tg = y + (((g - y) * scale + 0x8000) >> 16);\n\t\tb = y + (((b - y) * scale + 0x8000) >> 16);\n\t}\n\n\t*rd = fz_clampi(r, 0, 255);\n\t*gd = fz_clampi(g, 0, 255);\n\t*bd = fz_clampi(b, 0, 255);\n}\n\nstatic void\nfz_saturation_rgb(unsigned char *rd, unsigned char *gd, unsigned char *bd, int rb, int gb, int bb, int rs, int gs, int bs)\n{\n\tint minb, maxb;\n\tint mins, maxs;\n\tint y;\n\tint scale;\n\tint r, g, b;\n\n\tminb = fz_mini(rb, fz_mini(gb, bb));\n\tmaxb = fz_maxi(rb, fz_maxi(gb, bb));\n\tif (minb == maxb)\n\t{\n\t\t/* backdrop has zero saturation, avoid divide by 0 */\n\t\tgb = fz_clampi(gb, 0, 255);\n\t\t*rd = gb;\n\t\t*gd = gb;\n\t\t*bd = gb;\n\t\treturn;\n\t}\n\n\tmins = fz_mini(rs, fz_mini(gs, bs));\n\tmaxs = fz_maxi(rs, fz_maxi(gs, bs));\n\n\tscale = ((maxs - mins) << 16) / (maxb - minb);\n\ty = (rb * 77 + gb * 151 + bb * 28 + 0x80) >> 8;\n\tr = y + ((((rb - y) * scale) + 0x8000) >> 16);\n\tg = y + ((((gb - y) * scale) + 0x8000) >> 16);\n\tb = y + ((((bb - y) * scale) + 0x8000) >> 16);\n\n\tif ((r | g | b) & 0x100)\n\t{\n\t\tint scalemin, scalemax;\n\t\tint min, max;\n\n\t\tmin = fz_mini(r, fz_mini(g, b));\n\t\tmax = fz_maxi(r, fz_maxi(g, b));\n\n\t\tif (min < 0)\n\t\t\tscalemin = (y << 16) / (y - min);\n\t\telse\n\t\t\tscalemin = 0x10000;\n\n\t\tif (max > 255)\n\t\t\tscalemax = ((255 - y) << 16) / (max - y);\n\t\telse\n\t\t\tscalemax = 0x10000;\n\n\t\tscale = fz_mini(scalemin, scalemax);\n\t\tr = y + (((r - y) * scale + 0x8000) >> 16);\n\t\tg = y + (((g - y) * scale + 0x8000) >> 16);\n\t\tb = y + (((b - y) * scale + 0x8000) >> 16);\n\t}\n\n\t*rd = fz_clampi(r, 0, 255);\n\t*gd = fz_clampi(g, 0, 255);\n\t*bd = fz_clampi(b, 0, 255);\n}\n\nstatic void\nfz_color_rgb(unsigned char *rr, unsigned char *rg, unsigned char *rb, int br, int bg, int bb, int sr, int sg, int sb)\n{\n\tfz_luminosity_rgb(rr, rg, rb, sr, sg, sb, br, bg, bb);\n}\n\nstatic void\nfz_hue_rgb(unsigned char *rr, unsigned char *rg, unsigned char *rb, int br, int bg, int bb, int sr, int sg, int sb)\n{\n\tunsigned char tr, tg, tb;\n\tfz_luminosity_rgb(&tr, &tg, &tb, sr, sg, sb, br, bg, bb);\n\tfz_saturation_rgb(rr, rg, rb, tr, tg, tb, br, bg, bb);\n}\n\nvoid\nfz_blend_pixel(unsigned char dp[3], unsigned char bp[3], unsigned char sp[3], int blendmode)\n{\n\tint k;\n\t/* non-separable blend modes */\n\tswitch (blendmode)\n\t{\n\tcase FZ_BLEND_HUE: fz_hue_rgb(&dp[0], &dp[1], &dp[2], bp[0], bp[1], bp[2], sp[0], sp[1], sp[2]); return;\n\tcase FZ_BLEND_SATURATION: fz_saturation_rgb(&dp[0], &dp[1], &dp[2], bp[0], bp[1], bp[2], sp[0], sp[1], sp[2]); return;\n\tcase FZ_BLEND_COLOR: fz_color_rgb(&dp[0], &dp[1], &dp[2], bp[0], bp[1], bp[2], sp[0], sp[1], sp[2]); return;\n\tcase FZ_BLEND_LUMINOSITY: fz_luminosity_rgb(&dp[0], &dp[1], &dp[2], bp[0], bp[1], bp[2], sp[0], sp[1], sp[2]); return;\n\t}\n\t/* separable blend modes */\n\tfor (k = 0; k < 3; k++)\n\t{\n\t\tswitch (blendmode)\n\t\t{\n\t\tdefault:\n\t\tcase FZ_BLEND_NORMAL: dp[k] = sp[k]; break;\n\t\tcase FZ_BLEND_MULTIPLY: dp[k] = fz_mul255(bp[k], sp[k]); break;\n\t\tcase FZ_BLEND_SCREEN: dp[k] = fz_screen_byte(bp[k], sp[k]); break;\n\t\tcase FZ_BLEND_OVERLAY: dp[k] = fz_overlay_byte(bp[k], sp[k]); break;\n\t\tcase FZ_BLEND_DARKEN: dp[k] = fz_darken_byte(bp[k], sp[k]); break;\n\t\tcase FZ_BLEND_LIGHTEN: dp[k] = fz_lighten_byte(bp[k], sp[k]); break;\n\t\tcase FZ_BLEND_COLOR_DODGE: dp[k] = fz_color_dodge_byte(bp[k], sp[k]); break;\n\t\tcase FZ_BLEND_COLOR_BURN: dp[k] = fz_color_burn_byte(bp[k], sp[k]); break;\n\t\tcase FZ_BLEND_HARD_LIGHT: dp[k] = fz_hard_light_byte(bp[k], sp[k]); break;\n\t\tcase FZ_BLEND_SOFT_LIGHT: dp[k] = fz_soft_light_byte(bp[k], sp[k]); break;\n\t\tcase FZ_BLEND_DIFFERENCE: dp[k] = fz_difference_byte(bp[k], sp[k]); break;\n\t\tcase FZ_BLEND_EXCLUSION: dp[k] = fz_exclusion_byte(bp[k], sp[k]); break;\n\t\t}\n\t}\n}\n\n/* Blending loops */\n\nvoid\nfz_blend_separable(byte * restrict bp, byte * restrict sp, int n, int w, int blendmode)\n{\n\tint k;\n\tint n1 = n - 1;\n\twhile (w--)\n\t{\n\t\tint sa = sp[n1];\n\t\tint ba = bp[n1];\n\t\tint saba = fz_mul255(sa, ba);\n\n\t\t/* ugh, division to get non-premul components */\n\t\tint invsa = sa ? 255 * 256 / sa : 0;\n\t\tint invba = ba ? 255 * 256 / ba : 0;\n\n\t\tfor (k = 0; k < n1; k++)\n\t\t{\n\t\t\tint sc = (sp[k] * invsa) >> 8;\n\t\t\tint bc = (bp[k] * invba) >> 8;\n\t\t\tint rc;\n\n\t\t\tswitch (blendmode)\n\t\t\t{\n\t\t\tdefault:\n\t\t\tcase FZ_BLEND_NORMAL: rc = sc; break;\n\t\t\tcase FZ_BLEND_MULTIPLY: rc = fz_mul255(bc, sc); break;\n\t\t\tcase FZ_BLEND_SCREEN: rc = fz_screen_byte(bc, sc); break;\n\t\t\tcase FZ_BLEND_OVERLAY: rc = fz_overlay_byte(bc, sc); break;\n\t\t\tcase FZ_BLEND_DARKEN: rc = fz_darken_byte(bc, sc); break;\n\t\t\tcase FZ_BLEND_LIGHTEN: rc = fz_lighten_byte(bc, sc); break;\n\t\t\tcase FZ_BLEND_COLOR_DODGE: rc = fz_color_dodge_byte(bc, sc); break;\n\t\t\tcase FZ_BLEND_COLOR_BURN: rc = fz_color_burn_byte(bc, sc); break;\n\t\t\tcase FZ_BLEND_HARD_LIGHT: rc = fz_hard_light_byte(bc, sc); break;\n\t\t\tcase FZ_BLEND_SOFT_LIGHT: rc = fz_soft_light_byte(bc, sc); break;\n\t\t\tcase FZ_BLEND_DIFFERENCE: rc = fz_difference_byte(bc, sc); break;\n\t\t\tcase FZ_BLEND_EXCLUSION: rc = fz_exclusion_byte(bc, sc); break;\n\t\t\t}\n\n\t\t\tbp[k] = fz_mul255(255 - sa, bp[k]) + fz_mul255(255 - ba, sp[k]) + fz_mul255(saba, rc);\n\t\t}\n\n\t\tbp[k] = ba + sa - saba;\n\n\t\tsp += n;\n\t\tbp += n;\n\t}\n}\n\nvoid\nfz_blend_nonseparable(byte * restrict bp, byte * restrict sp, int w, int blendmode)\n{\n\twhile (w--)\n\t{\n\t\tunsigned char rr, rg, rb;\n\n\t\tint sa = sp[3];\n\t\tint ba = bp[3];\n\t\tint saba = fz_mul255(sa, ba);\n\n\t\t/* ugh, division to get non-premul components */\n\t\tint invsa = sa ? 255 * 256 / sa : 0;\n\t\tint invba = ba ? 255 * 256 / ba : 0;\n\n\t\tint sr = (sp[0] * invsa) >> 8;\n\t\tint sg = (sp[1] * invsa) >> 8;\n\t\tint sb = (sp[2] * invsa) >> 8;\n\n\t\tint br = (bp[0] * invba) >> 8;\n\t\tint bg = (bp[1] * invba) >> 8;\n\t\tint bb = (bp[2] * invba) >> 8;\n\n\t\tswitch (blendmode)\n\t\t{\n\t\tdefault:\n\t\tcase FZ_BLEND_HUE:\n\t\t\tfz_hue_rgb(&rr, &rg, &rb, br, bg, bb, sr, sg, sb);\n\t\t\tbreak;\n\t\tcase FZ_BLEND_SATURATION:\n\t\t\tfz_saturation_rgb(&rr, &rg, &rb, br, bg, bb, sr, sg, sb);\n\t\t\tbreak;\n\t\tcase FZ_BLEND_COLOR:\n\t\t\tfz_color_rgb(&rr, &rg, &rb, br, bg, bb, sr, sg, sb);\n\t\t\tbreak;\n\t\tcase FZ_BLEND_LUMINOSITY:\n\t\t\tfz_luminosity_rgb(&rr, &rg, &rb, br, bg, bb, sr, sg, sb);\n\t\t\tbreak;\n\t\t}\n\n\t\tbp[0] = fz_mul255(255 - sa, bp[0]) + fz_mul255(255 - ba, sp[0]) + fz_mul255(saba, rr);\n\t\tbp[1] = fz_mul255(255 - sa, bp[1]) + fz_mul255(255 - ba, sp[1]) + fz_mul255(saba, rg);\n\t\tbp[2] = fz_mul255(255 - sa, bp[2]) + fz_mul255(255 - ba, sp[2]) + fz_mul255(saba, rb);\n\t\tbp[3] = ba + sa - saba;\n\n\t\tsp += 4;\n\t\tbp += 4;\n\t}\n}\n\nstatic void\nfz_blend_separable_nonisolated(byte * restrict bp, byte * restrict sp, int n, int w, int blendmode, byte * restrict hp, int alpha)\n{\n\tint k;\n\tint n1 = n - 1;\n\n\tif (alpha == 255 && blendmode == 0)\n\t{\n\t\t/* In this case, the uncompositing and the recompositing\n\t\t * cancel one another out, and it's just a simple copy. */\n\t\t/* FIXME: Maybe we can avoid using the shape plane entirely\n\t\t * and just copy? */\n\t\twhile (w--)\n\t\t{\n\t\t\tint ha = fz_mul255(*hp++, alpha); /* ha = shape_alpha */\n\t\t\t/* If ha == 0 then leave everything unchanged */\n\t\t\tif (ha != 0)\n\t\t\t{\n\t\t\t\tfor (k = 0; k < n; k++)\n\t\t\t\t{\n\t\t\t\t\tbp[k] = sp[k];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsp += n;\n\t\t\tbp += n;\n\t\t}\n\t\treturn;\n\t}\n\twhile (w--)\n\t{\n\t\tint ha = *hp++;\n\t\tint haa = fz_mul255(ha, alpha); /* ha = shape_alpha */\n\t\t/* If haa == 0 then leave everything unchanged */\n\t\twhile (haa != 0) /* Use while, so we can break out */\n\t\t{\n\t\t\tint sa, ba, bahaa, ra, invsa, invba, invha, invra;\n\t\t\tsa = sp[n1];\n\t\t\tif (sa == 0)\n\t\t\t\tbreak; /* No change! */\n\t\t\tinvsa = sa ? 255 * 256 / sa : 0;\n\t\t\tba = bp[n1];\n\t\t\tif (ba == 0)\n\t\t\t{\n\t\t\t\t/* Just copy pixels (allowing for change in\n\t\t\t\t * premultiplied alphas) */\n\t\t\t\tfor (k = 0; k < n1; k++)\n\t\t\t\t{\n\t\t\t\t\tbp[k] = fz_mul255((sp[k] * invsa) >> 8, haa);\n\t\t\t\t}\n\t\t\t\tbp[n1] = haa;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbahaa = fz_mul255(ba, haa);\n\n\t\t\t/* ugh, division to get non-premul components */\n\t\t\tinvba = ba ? 255 * 256 / ba : 0;\n\n\t\t\t/* Calculate result_alpha - a combination of the\n\t\t\t * background alpha, and 'shape' */\n\t\t\tra = bp[n1] = ba - bahaa + haa;\n\t\t\tif (ra == 0)\n\t\t\t\tbreak;\n\t\t\t/* Because we are a non-isolated group, we need to\n\t\t\t * 'uncomposite' before we blend (recomposite).\n\t\t\t * We assume that normal blending has been done inside\n\t\t\t * the group, so: rc = (1-ha).bc + ha.sc\n\t\t\t * A bit of rearrangement, and that gives us that:\n\t\t\t * sc = (rc - bc)/ha + bc\n\t\t\t * Now, the result of the blend (rc) was stored in src, so\n\t\t\t * we actually want to calculate:\n\t\t\t * sc = (sc-bc)/ha + bc\n\t\t\t */\n\t\t\tinvha = ha ? 255 * 256 / ha : 0;\n\t\t\tinvra = ra ? 255 * 256 / ra : 0;\n\n\t\t\t/* sa = the final alpha to blend with - this\n\t\t\t * is calculated from the shape + alpha,\n\t\t\t * divided by ra. */\n\t\t\tsa = (haa*invra + 128)>>8;\n\t\t\tif (sa < 0) sa = 0;\n\t\t\tif (sa > 255) sa = 255;\n\n\t\t\tfor (k = 0; k < n1; k++)\n\t\t\t{\n\t\t\t\t/* Read pixels (and convert to non-premultiplied form) */\n\t\t\t\tint sc = (sp[k] * invsa + 128) >> 8;\n\t\t\t\tint bc = (bp[k] * invba + 128) >> 8;\n\t\t\t\tint rc;\n\n\t\t\t\t/* Uncomposite (see above) */\n\t\t\t\tsc = (((sc-bc) * invha + 128)>>8) + bc;\n\t\t\t\tif (sc < 0) sc = 0;\n\t\t\t\tif (sc > 255) sc = 255;\n\n\t\t\t\tswitch (blendmode)\n\t\t\t\t{\n\t\t\t\tdefault:\n\t\t\t\tcase FZ_BLEND_NORMAL: rc = sc; break;\n\t\t\t\tcase FZ_BLEND_MULTIPLY: rc = fz_mul255(bc, sc); break;\n\t\t\t\tcase FZ_BLEND_SCREEN: rc = fz_screen_byte(bc, sc); break;\n\t\t\t\tcase FZ_BLEND_OVERLAY: rc = fz_overlay_byte(bc, sc); break;\n\t\t\t\tcase FZ_BLEND_DARKEN: rc = fz_darken_byte(bc, sc); break;\n\t\t\t\tcase FZ_BLEND_LIGHTEN: rc = fz_lighten_byte(bc, sc); break;\n\t\t\t\tcase FZ_BLEND_COLOR_DODGE: rc = fz_color_dodge_byte(bc, sc); break;\n\t\t\t\tcase FZ_BLEND_COLOR_BURN: rc = fz_color_burn_byte(bc, sc); break;\n\t\t\t\tcase FZ_BLEND_HARD_LIGHT: rc = fz_hard_light_byte(bc, sc); break;\n\t\t\t\tcase FZ_BLEND_SOFT_LIGHT: rc = fz_soft_light_byte(bc, sc); break;\n\t\t\t\tcase FZ_BLEND_DIFFERENCE: rc = fz_difference_byte(bc, sc); break;\n\t\t\t\tcase FZ_BLEND_EXCLUSION: rc = fz_exclusion_byte(bc, sc); break;\n\t\t\t\t}\n\t\t\t\t/* Composition formula, as given in pdf_reference17.pdf:\n\t\t\t\t * rc = ( 1 - (ha/ra)) * bc + (ha/ra) * ((1-ba)*sc + ba * rc)\n\t\t\t\t */\n\t\t\t\trc = bc + fz_mul255(sa, fz_mul255(255 - ba, sc) + fz_mul255(ba, rc) - bc);\n\t\t\t\tif (rc < 0) rc = 0;\n\t\t\t\tif (rc > 255) rc = 255;\n\t\t\t\tbp[k] = fz_mul255(rc, ra);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tsp += n;\n\t\tbp += n;\n\t}\n}\n\nstatic void\nfz_blend_nonseparable_nonisolated(byte * restrict bp, byte * restrict sp, int w, int blendmode, byte * restrict hp, int alpha)\n{\n\twhile (w--)\n\t{\n\t\tint ha = *hp++;\n\t\tint haa = fz_mul255(ha, alpha);\n\t\tif (haa != 0)\n\t\t{\n\t\t\tint sa = sp[3];\n\t\t\tint ba = bp[3];\n\t\t\tint baha = fz_mul255(ba, haa);\n\n\t\t\t/* Calculate result_alpha */\n\t\t\tint ra = bp[3] = ba - baha + haa;\n\t\t\tif (ra != 0)\n\t\t\t{\n\t\t\t\t/* Because we are a non-isolated group, we\n\t\t\t\t * need to 'uncomposite' before we blend\n\t\t\t\t * (recomposite). We assume that normal\n\t\t\t\t * blending has been done inside the group,\n\t\t\t\t * so: ra.rc = (1-ha).bc + ha.sc\n\t\t\t\t * A bit of rearrangement, and that gives us\n\t\t\t\t * that: sc = (ra.rc - bc)/ha + bc\n\t\t\t\t * Now, the result of the blend was stored in\n\t\t\t\t * src, so: */\n\t\t\t\tint invha = ha ? 255 * 256 / ha : 0;\n\n\t\t\t\tunsigned char rr, rg, rb;\n\n\t\t\t\t/* ugh, division to get non-premul components */\n\t\t\t\tint invsa = sa ? 255 * 256 / sa : 0;\n\t\t\t\tint invba = ba ? 255 * 256 / ba : 0;\n\n\t\t\t\tint sr = (sp[0] * invsa) >> 8;\n\t\t\t\tint sg = (sp[1] * invsa) >> 8;\n\t\t\t\tint sb = (sp[2] * invsa) >> 8;\n\n\t\t\t\tint br = (bp[0] * invba) >> 8;\n\t\t\t\tint bg = (bp[1] * invba) >> 8;\n\t\t\t\tint bb = (bp[2] * invba) >> 8;\n\n\t\t\t\t/* Uncomposite */\n\t\t\t\tsr = (((sr-br)*invha)>>8) + br;\n\t\t\t\tsg = (((sg-bg)*invha)>>8) + bg;\n\t\t\t\tsb = (((sb-bb)*invha)>>8) + bb;\n\n\t\t\t\tswitch (blendmode)\n\t\t\t\t{\n\t\t\t\tdefault:\n\t\t\t\tcase FZ_BLEND_HUE:\n\t\t\t\t\tfz_hue_rgb(&rr, &rg, &rb, br, bg, bb, sr, sg, sb);\n\t\t\t\t\tbreak;\n\t\t\t\tcase FZ_BLEND_SATURATION:\n\t\t\t\t\tfz_saturation_rgb(&rr, &rg, &rb, br, bg, bb, sr, sg, sb);\n\t\t\t\t\tbreak;\n\t\t\t\tcase FZ_BLEND_COLOR:\n\t\t\t\t\tfz_color_rgb(&rr, &rg, &rb, br, bg, bb, sr, sg, sb);\n\t\t\t\t\tbreak;\n\t\t\t\tcase FZ_BLEND_LUMINOSITY:\n\t\t\t\t\tfz_luminosity_rgb(&rr, &rg, &rb, br, bg, bb, sr, sg, sb);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\trr = fz_mul255(255 - haa, bp[0]) + fz_mul255(fz_mul255(255 - ba, sr), haa) + fz_mul255(baha, rr);\n\t\t\t\trg = fz_mul255(255 - haa, bp[1]) + fz_mul255(fz_mul255(255 - ba, sg), haa) + fz_mul255(baha, rg);\n\t\t\t\trb = fz_mul255(255 - haa, bp[2]) + fz_mul255(fz_mul255(255 - ba, sb), haa) + fz_mul255(baha, rb);\n\t\t\t\tbp[0] = fz_mul255(ra, rr);\n\t\t\t\tbp[1] = fz_mul255(ra, rg);\n\t\t\t\tbp[2] = fz_mul255(ra, rb);\n\t\t\t}\n\t\t}\n\n\t\tsp += 4;\n\t\tbp += 4;\n\t}\n}\n\nvoid\nfz_blend_pixmap(fz_pixmap *dst, fz_pixmap *src, int alpha, int blendmode, int isolated, fz_pixmap *shape)\n{\n\tunsigned char *sp, *dp;\n\tfz_irect bbox;\n\tfz_irect bbox2;\n\tint x, y, w, h, n;\n\n\t/* TODO: fix this hack! */\n\tif (isolated && alpha < 255)\n\t{\n\t\tsp = src->samples;\n\t\tn = src->w * src->h * src->n;\n\t\twhile (n--)\n\t\t{\n\t\t\t*sp = fz_mul255(*sp, alpha);\n\t\t\tsp++;\n\t\t}\n\t}\n\n\tfz_pixmap_bbox_no_ctx(dst, &bbox);\n\tfz_pixmap_bbox_no_ctx(src, &bbox2);\n\tfz_intersect_irect(&bbox, &bbox2);\n\n\tx = bbox.x0;\n\ty = bbox.y0;\n\tw = bbox.x1 - bbox.x0;\n\th = bbox.y1 - bbox.y0;\n\n\tn = src->n;\n\tsp = src->samples + (unsigned int)(((y - src->y) * src->w + (x - src->x)) * n);\n\tdp = dst->samples + (unsigned int)(((y - dst->y) * dst->w + (x - dst->x)) * n);\n\n\tassert(src->n == dst->n);\n\n\tif (!isolated)\n\t{\n\t\tunsigned char *hp = shape->samples + (unsigned int)((y - shape->y) * shape->w + (x - shape->x));\n\n\t\twhile (h--)\n\t\t{\n\t\t\tif (n == 4 && blendmode >= FZ_BLEND_HUE)\n\t\t\t\tfz_blend_nonseparable_nonisolated(dp, sp, w, blendmode, hp, alpha);\n\t\t\telse\n\t\t\t\tfz_blend_separable_nonisolated(dp, sp, n, w, blendmode, hp, alpha);\n\t\t\tsp += src->w * n;\n\t\t\tdp += dst->w * n;\n\t\t\thp += shape->w;\n\t\t}\n\t}\n\telse\n\t{\n\t\twhile (h--)\n\t\t{\n\t\t\tif (n == 4 && blendmode >= FZ_BLEND_HUE)\n\t\t\t\tfz_blend_nonseparable(dp, sp, w, blendmode);\n\t\t\telse\n\t\t\t\tfz_blend_separable(dp, sp, n, w, blendmode);\n\t\t\tsp += src->w * n;\n\t\t\tdp += dst->w * n;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/fitz/draw-device.c",
    "content": "#include \"mupdf/fitz.h\"\n#include \"draw-imp.h\"\n\n#define STACK_SIZE 96\n\n/* Enable the following to attempt to support knockout and/or isolated\n * blending groups. */\n#define ATTEMPT_KNOCKOUT_AND_ISOLATED\n\n/* Enable the following to help debug group blending. */\n#undef DUMP_GROUP_BLENDS\n\n/* Enable the following to help debug graphics stack pushes/pops */\n#undef DUMP_STACK_CHANGES\n\ntypedef struct fz_draw_device_s fz_draw_device;\n\nenum {\n\tFZ_DRAWDEV_FLAGS_TYPE3 = 1,\n};\n\ntypedef struct fz_draw_state_s fz_draw_state;\n\nstruct fz_draw_state_s {\n\tfz_irect scissor;\n\tfz_pixmap *dest;\n\tfz_pixmap *mask;\n\tfz_pixmap *shape;\n\tint blendmode;\n\tint luminosity;\n\tint id;\n\tfloat alpha;\n\tfz_matrix ctm;\n\tfloat xstep, ystep;\n\tfz_irect area;\n};\n\nstruct fz_draw_device_s\n{\n\tfz_gel *gel;\n\tfz_context *ctx;\n\tint flags;\n\tint top;\n\tfz_scale_cache *cache_x;\n\tfz_scale_cache *cache_y;\n\tfz_draw_state *stack;\n\tint stack_cap;\n\tfz_draw_state init_stack[STACK_SIZE];\n};\n\n#ifdef DUMP_GROUP_BLENDS\nstatic int group_dump_count = 0;\n\nstatic void fz_dump_blend(fz_context *ctx, fz_pixmap *pix, const char *s)\n{\n\tchar name[80];\n\n\tif (!pix)\n\t\treturn;\n\n\tsprintf(name, \"dump%02d.png\", group_dump_count);\n\tif (s)\n\t\tprintf(\"%s%02d\", s, group_dump_count);\n\tgroup_dump_count++;\n\n\tfz_write_png(ctx, pix, name, (pix->n > 1));\n}\n\nstatic void dump_spaces(int x, const char *s)\n{\n\tint i;\n\tfor (i = 0; i < x; i++)\n\t\tprintf(\" \");\n\tprintf(\"%s\", s);\n}\n\n#endif\n\n#ifdef DUMP_STACK_CHANGES\n#define STACK_PUSHED(A) stack_change(dev, \">\" ## A)\n#define STACK_POPPED(A) stack_change(dev, \"<\" ## A)\n#define STACK_CONVERT(A) stack_change(dev, A)\n\nstatic void stack_change(fz_draw_device *dev, char *s)\n{\n\tint depth = dev->top;\n\tint n;\n\n\tif (*s != '<')\n\t\tdepth--;\n\tn = depth;\n\twhile (n--)\n\t\tfputc(' ', stderr);\n\tfprintf(stderr, \"%s (%d)\\n\", s, depth);\n}\n#else\n#define STACK_PUSHED(A) do {} while (0)\n#define STACK_POPPED(A) do {} while (0)\n#define STACK_CONVERT(A) do {} while (0)\n#endif\n\n\nstatic void fz_grow_stack(fz_draw_device *dev)\n{\n\tint max = dev->stack_cap * 2;\n\tfz_draw_state *stack;\n\n\tif (dev->stack == &dev->init_stack[0])\n\t{\n\t\tstack = fz_malloc(dev->ctx, sizeof(*stack) * max);\n\t\tmemcpy(stack, dev->stack, sizeof(*stack) * dev->stack_cap);\n\t}\n\telse\n\t{\n\t\tstack = fz_resize_array(dev->ctx, dev->stack, max, sizeof(*stack));\n\t}\n\tdev->stack = stack;\n\tdev->stack_cap = max;\n}\n\n/* 'Push' the stack. Returns a pointer to the current state, with state[1]\n * already having been initialised to contain the same thing. Simply\n * change any contents of state[1] that you want to and continue. */\nstatic fz_draw_state *\npush_stack(fz_draw_device *dev)\n{\n\tfz_draw_state *state;\n\n\tif (dev->top == dev->stack_cap-1)\n\t\tfz_grow_stack(dev);\n\tstate = &dev->stack[dev->top];\n\tdev->top++;\n\tmemcpy(&state[1], state, sizeof(*state));\n\treturn state;\n}\n\nstatic void emergency_pop_stack(fz_draw_device *dev, fz_draw_state *state)\n{\n\tfz_context *ctx = dev->ctx;\n\n\tif (state[1].mask != state[0].mask)\n\t\tfz_drop_pixmap(ctx, state[1].mask);\n\tif (state[1].dest != state[0].dest)\n\t\tfz_drop_pixmap(ctx, state[1].dest);\n\tif (state[1].shape != state[0].shape)\n\t\tfz_drop_pixmap(ctx, state[1].shape);\n\tdev->top--;\n\tSTACK_POPPED(\"emergency\");\n\tfz_rethrow(ctx);\n}\n\nstatic fz_draw_state *\nfz_knockout_begin(fz_draw_device *dev)\n{\n\tfz_context *ctx = dev->ctx;\n\tfz_irect bbox;\n\tfz_pixmap *dest, *shape;\n\tfz_draw_state *state = &dev->stack[dev->top];\n\tint isolated = state->blendmode & FZ_BLEND_ISOLATED;\n\n\tif ((state->blendmode & FZ_BLEND_KNOCKOUT) == 0)\n\t\treturn state;\n\n\tstate = push_stack(dev);\n\tSTACK_PUSHED(\"knockout\");\n\n\tfz_pixmap_bbox(dev->ctx, state->dest, &bbox);\n\tfz_intersect_irect(&bbox, &state->scissor);\n\tdest = fz_new_pixmap_with_bbox(dev->ctx, state->dest->colorspace, &bbox);\n\n\tif (isolated)\n\t{\n\t\tfz_clear_pixmap(ctx, dest);\n\t}\n\telse\n\t{\n\t\t/* Find the last but one destination to copy */\n\t\tint i = dev->top-1; /* i = the one on entry (i.e. the last one) */\n\t\tfz_pixmap *prev = state->dest;\n\t\twhile (i > 0)\n\t\t{\n\t\t\tprev = dev->stack[--i].dest;\n\t\t\tif (prev != state->dest)\n\t\t\t\tbreak;\n\t\t}\n\t\tif (prev)\n\t\t\tfz_copy_pixmap_rect(ctx, dest, prev, &bbox);\n\t\telse\n\t\t\tfz_clear_pixmap(ctx, dest);\n\t}\n\n\tif ((state->blendmode & FZ_BLEND_MODEMASK) == 0 && isolated)\n\t{\n\t\t/* We can render direct to any existing shape plane. If there\n\t\t * isn't one, we don't need to make one. */\n\t\tshape = state->shape;\n\t}\n\telse\n\t{\n\t\tshape = fz_new_pixmap_with_bbox(dev->ctx, NULL, &bbox);\n\t\tfz_clear_pixmap(dev->ctx, shape);\n\t}\n#ifdef DUMP_GROUP_BLENDS\n\tdump_spaces(dev->top-1, \"Knockout begin\\n\");\n#endif\n\tstate[1].scissor = bbox;\n\tstate[1].dest = dest;\n\tstate[1].shape = shape;\n\tstate[1].blendmode &= ~FZ_BLEND_MODEMASK;\n\n\treturn &state[1];\n}\n\nstatic void fz_knockout_end(fz_draw_device *dev)\n{\n\tfz_draw_state *state;\n\tint blendmode;\n\tint isolated;\n\tfz_context *ctx = dev->ctx;\n\n\tif (dev->top == 0)\n\t{\n\t\tfz_warn(ctx, \"unexpected knockout end\");\n\t\treturn;\n\t}\n\tstate = &dev->stack[--dev->top];\n\tSTACK_POPPED(\"knockout\");\n\tif ((state[0].blendmode & FZ_BLEND_KNOCKOUT) == 0)\n\t\treturn;\n\n\tblendmode = state->blendmode & FZ_BLEND_MODEMASK;\n\tisolated = state->blendmode & FZ_BLEND_ISOLATED;\n\n#ifdef DUMP_GROUP_BLENDS\n\tdump_spaces(dev->top, \"\");\n\tfz_dump_blend(dev->ctx, state[1].dest, \"Knockout end: blending \");\n\tif (state[1].shape)\n\t\tfz_dump_blend(dev->ctx, state[1].shape, \"/\");\n\tfz_dump_blend(dev->ctx, state[0].dest, \" onto \");\n\tif (state[0].shape)\n\t\tfz_dump_blend(dev->ctx, state[0].shape, \"/\");\n\tif (blendmode != 0)\n\t\tprintf(\" (blend %d)\", blendmode);\n\tif (isolated != 0)\n\t\tprintf(\" (isolated)\");\n\tprintf(\" (knockout)\");\n#endif\n\tif ((blendmode == 0) && (state[0].shape == state[1].shape))\n\t\tfz_paint_pixmap(state[0].dest, state[1].dest, 255);\n\telse\n\t\tfz_blend_pixmap(state[0].dest, state[1].dest, 255, blendmode, isolated, state[1].shape);\n\n\t/* The following test should not be required, but just occasionally\n\t * errors can cause the stack to get out of sync, and this saves our\n\t * bacon. */\n\tif (state[0].dest != state[1].dest)\n\t\tfz_drop_pixmap(dev->ctx, state[1].dest);\n\tif (state[0].shape != state[1].shape)\n\t{\n\t\tif (state[0].shape)\n\t\t\tfz_paint_pixmap(state[0].shape, state[1].shape, 255);\n\t\tfz_drop_pixmap(dev->ctx, state[1].shape);\n\t}\n#ifdef DUMP_GROUP_BLENDS\n\tfz_dump_blend(dev->ctx, state[0].dest, \" to get \");\n\tif (state[0].shape)\n\t\tfz_dump_blend(dev->ctx, state[0].shape, \"/\");\n\tprintf(\"\\n\");\n#endif\n}\n\nstatic void\nfz_draw_fill_path(fz_device *devp, fz_path *path, int even_odd, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tfz_draw_device *dev = devp->user;\n\tfloat expansion = fz_matrix_expansion(ctm);\n\tfloat flatness = 0.3f / expansion;\n\tunsigned char colorbv[FZ_MAX_COLORS + 1];\n\tfloat colorfv[FZ_MAX_COLORS];\n\tfz_irect bbox;\n\tint i;\n\tfz_draw_state *state = &dev->stack[dev->top];\n\tfz_colorspace *model = state->dest->colorspace;\n\n\tif (model == NULL)\n\t\tmodel = fz_device_gray(dev->ctx);\n\n\tif (flatness < 0.001f)\n\t\tflatness = 0.001f;\n\n\tfz_reset_gel(dev->gel, &state->scissor);\n\tfz_flatten_fill_path(dev->gel, path, ctm, flatness);\n\tfz_sort_gel(dev->gel);\n\n\tfz_intersect_irect(fz_bound_gel(dev->gel, &bbox), &state->scissor);\n\n\tif (fz_is_empty_irect(&bbox))\n\t\treturn;\n\n\tif (state->blendmode & FZ_BLEND_KNOCKOUT)\n\t\tstate = fz_knockout_begin(dev);\n\n\tfz_convert_color(dev->ctx, model, colorfv, colorspace, color);\n\tfor (i = 0; i < model->n; i++)\n\t\tcolorbv[i] = colorfv[i] * 255;\n\tcolorbv[i] = alpha * 255;\n\n\tfz_scan_convert(dev->gel, even_odd, &bbox, state->dest, colorbv);\n\tif (state->shape)\n\t{\n\t\tfz_reset_gel(dev->gel, &state->scissor);\n\t\tfz_flatten_fill_path(dev->gel, path, ctm, flatness);\n\t\tfz_sort_gel(dev->gel);\n\n\t\tcolorbv[0] = alpha * 255;\n\t\tfz_scan_convert(dev->gel, even_odd, &bbox, state->shape, colorbv);\n\t}\n\n\tif (state->blendmode & FZ_BLEND_KNOCKOUT)\n\t\tfz_knockout_end(dev);\n}\n\nstatic void\nfz_draw_stroke_path(fz_device *devp, fz_path *path, fz_stroke_state *stroke, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tfz_draw_device *dev = devp->user;\n\tfloat expansion = fz_matrix_expansion(ctm);\n\tfloat flatness = 0.3f / expansion;\n\tfloat linewidth = stroke->linewidth;\n\tunsigned char colorbv[FZ_MAX_COLORS + 1];\n\tfloat colorfv[FZ_MAX_COLORS];\n\tfz_irect bbox;\n\tint i;\n\tfz_draw_state *state = &dev->stack[dev->top];\n\tfz_colorspace *model = state->dest->colorspace;\n\n\tif (model == NULL)\n\t\tmodel = fz_device_gray(dev->ctx);\n\n\t/* cf. https://code.google.com/p/sumatrapdf/issues/detail?id=2260 */\n\tif (linewidth * expansion < FLT_EPSILON)\n\t\tlinewidth = 1 / expansion;\n\tif (flatness < 0.001f)\n\t\tflatness = 0.001f;\n\n\tfz_reset_gel(dev->gel, &state->scissor);\n\tif (stroke->dash_len > 0)\n\t\tfz_flatten_dash_path(dev->gel, path, stroke, ctm, flatness, linewidth);\n\telse\n\t\tfz_flatten_stroke_path(dev->gel, path, stroke, ctm, flatness, linewidth);\n\tfz_sort_gel(dev->gel);\n\n\tfz_intersect_irect(fz_bound_gel(dev->gel, &bbox), &state->scissor);\n\n\tif (fz_is_empty_irect(&bbox))\n\t\treturn;\n\n\tif (state->blendmode & FZ_BLEND_KNOCKOUT)\n\t\tstate = fz_knockout_begin(dev);\n\n\tfz_convert_color(dev->ctx, model, colorfv, colorspace, color);\n\tfor (i = 0; i < model->n; i++)\n\t\tcolorbv[i] = colorfv[i] * 255;\n\tcolorbv[i] = alpha * 255;\n\n\tfz_scan_convert(dev->gel, 0, &bbox, state->dest, colorbv);\n\tif (state->shape)\n\t{\n\t\tfz_reset_gel(dev->gel, &state->scissor);\n\t\tif (stroke->dash_len > 0)\n\t\t\tfz_flatten_dash_path(dev->gel, path, stroke, ctm, flatness, linewidth);\n\t\telse\n\t\t\tfz_flatten_stroke_path(dev->gel, path, stroke, ctm, flatness, linewidth);\n\t\tfz_sort_gel(dev->gel);\n\n\t\tcolorbv[0] = 255;\n\t\tfz_scan_convert(dev->gel, 0, &bbox, state->shape, colorbv);\n\t}\n\n\tif (state->blendmode & FZ_BLEND_KNOCKOUT)\n\t\tfz_knockout_end(dev);\n}\n\nstatic void\nfz_draw_clip_path(fz_device *devp, fz_path *path, const fz_rect *rect, int even_odd, const fz_matrix *ctm)\n{\n\tfz_draw_device *dev = devp->user;\n\tfloat expansion = fz_matrix_expansion(ctm);\n\tfloat flatness = 0.3f / expansion;\n\tfz_irect bbox;\n\tfz_draw_state *state = &dev->stack[dev->top];\n\tfz_colorspace *model;\n\tfz_context *ctx = dev->ctx;\n\n\tif (flatness < 0.001f)\n\t\tflatness = 0.001f;\n\n\tfz_reset_gel(dev->gel, &state->scissor);\n\tfz_flatten_fill_path(dev->gel, path, ctm, flatness);\n\tfz_sort_gel(dev->gel);\n\n\tstate = push_stack(dev);\n\tSTACK_PUSHED(\"clip path\");\n\tmodel = state->dest->colorspace;\n\n\tfz_intersect_irect(fz_bound_gel(dev->gel, &bbox), &state->scissor);\n\tif (rect)\n\t{\n\t\tfz_irect bbox2;\n\t\tfz_intersect_irect(&bbox, fz_irect_from_rect(&bbox2, rect));\n\t}\n\n\tif (fz_is_empty_irect(&bbox) || fz_is_rect_gel(dev->gel))\n\t{\n\t\tstate[1].scissor = bbox;\n\t\tstate[1].mask = NULL;\n#ifdef DUMP_GROUP_BLENDS\n\t\tdump_spaces(dev->top-1, \"Clip (rectangular) begin\\n\");\n#endif\n\t\treturn;\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tstate[1].mask = fz_new_pixmap_with_bbox(dev->ctx, NULL, &bbox);\n\t\tfz_clear_pixmap(dev->ctx, state[1].mask);\n\t\tstate[1].dest = fz_new_pixmap_with_bbox(dev->ctx, model, &bbox);\n\t\tfz_clear_pixmap(dev->ctx, state[1].dest);\n\t\tif (state[1].shape)\n\t\t{\n\t\t\tstate[1].shape = fz_new_pixmap_with_bbox(dev->ctx, NULL, &bbox);\n\t\t\tfz_clear_pixmap(dev->ctx, state[1].shape);\n\t\t}\n\n\t\tfz_scan_convert(dev->gel, even_odd, &bbox, state[1].mask, NULL);\n\n\t\tstate[1].blendmode |= FZ_BLEND_ISOLATED;\n\t\tstate[1].scissor = bbox;\n#ifdef DUMP_GROUP_BLENDS\n\t\tdump_spaces(dev->top-1, \"Clip (non-rectangular) begin\\n\");\n#endif\n\t}\n\tfz_catch(ctx)\n\t{\n\t\temergency_pop_stack(dev, state);\n\t}\n}\n\nstatic void\nfz_draw_clip_stroke_path(fz_device *devp, fz_path *path, const fz_rect *rect, fz_stroke_state *stroke, const fz_matrix *ctm)\n{\n\tfz_draw_device *dev = devp->user;\n\tfloat expansion = fz_matrix_expansion(ctm);\n\tfloat flatness = 0.3f / expansion;\n\tfloat linewidth = stroke->linewidth;\n\tfz_irect bbox;\n\tfz_draw_state *state = &dev->stack[dev->top];\n\tfz_colorspace *model;\n\tfz_context *ctx = dev->ctx;\n\n\t/* cf. https://code.google.com/p/sumatrapdf/issues/detail?id=2260 */\n\tif (linewidth * expansion < FLT_EPSILON)\n\t\tlinewidth = 1 / expansion;\n\tif (flatness < 0.001f)\n\t\tflatness = 0.001f;\n\n\tfz_reset_gel(dev->gel, &state->scissor);\n\tif (stroke->dash_len > 0)\n\t\tfz_flatten_dash_path(dev->gel, path, stroke, ctm, flatness, linewidth);\n\telse\n\t\tfz_flatten_stroke_path(dev->gel, path, stroke, ctm, flatness, linewidth);\n\tfz_sort_gel(dev->gel);\n\n\tstate = push_stack(dev);\n\tSTACK_PUSHED(\"clip stroke\");\n\tmodel = state->dest->colorspace;\n\n\tfz_intersect_irect(fz_bound_gel(dev->gel, &bbox), &state->scissor);\n\tif (rect)\n\t{\n\t\tfz_irect bbox2;\n\t\tfz_intersect_irect(&bbox, fz_irect_from_rect(&bbox2, rect));\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tstate[1].mask = fz_new_pixmap_with_bbox(dev->ctx, NULL, &bbox);\n\t\tfz_clear_pixmap(dev->ctx, state[1].mask);\n\t\tstate[1].dest = fz_new_pixmap_with_bbox(dev->ctx, model, &bbox);\n\t\tfz_clear_pixmap(dev->ctx, state[1].dest);\n\t\tif (state->shape)\n\t\t{\n\t\t\tstate[1].shape = fz_new_pixmap_with_bbox(dev->ctx, NULL, &bbox);\n\t\t\tfz_clear_pixmap(dev->ctx, state[1].shape);\n\t\t}\n\n\t\tif (!fz_is_empty_irect(&bbox))\n\t\t\tfz_scan_convert(dev->gel, 0, &bbox, state[1].mask, NULL);\n\n\t\tstate[1].blendmode |= FZ_BLEND_ISOLATED;\n\t\tstate[1].scissor = bbox;\n#ifdef DUMP_GROUP_BLENDS\n\t\tdump_spaces(dev->top-1, \"Clip (stroke) begin\\n\");\n#endif\n\t}\n\tfz_catch(ctx)\n\t{\n\t\temergency_pop_stack(dev, state);\n\t}\n}\n\n\nstatic void\ndraw_glyph(unsigned char *colorbv, fz_pixmap *dst, fz_glyph *glyph,\n\tint xorig, int yorig, const fz_irect *scissor)\n{\n\tunsigned char *dp;\n\tfz_irect bbox, bbox2;\n\tint x, y, w, h;\n\tint skip_x, skip_y;\n\tfz_pixmap *msk;\n\n\tfz_glyph_bbox_no_ctx(glyph, &bbox);\n\tfz_translate_irect(&bbox, xorig, yorig);\n\tfz_intersect_irect(&bbox, scissor); /* scissor < dst */\n\n\tif (fz_is_empty_irect(fz_intersect_irect(&bbox, fz_pixmap_bbox_no_ctx(dst, &bbox2))))\n\t\treturn;\n\n\tx = bbox.x0;\n\ty = bbox.y0;\n\tw = bbox.x1 - bbox.x0;\n\th = bbox.y1 - bbox.y0;\n\n\tskip_x = x - glyph->x - xorig;\n\tskip_y = y - glyph->y - yorig;\n\n\tdp = dst->samples + (unsigned int)(((y - dst->y) * dst->w + (x - dst->x)) * dst->n);\n\n\tmsk = glyph->pixmap;\n\tif (msk == NULL)\n\t{\n\t\tfz_paint_glyph(colorbv, dst, dp, glyph, w, h, skip_x, skip_y);\n\t}\n\telse\n\t{\n\t\tunsigned char *mp = msk->samples + skip_y * msk->w + skip_x;\n\t\twhile (h--)\n\t\t{\n\t\t\tif (dst->colorspace)\n\t\t\t\tfz_paint_span_with_color(dp, mp, dst->n, w, colorbv);\n\t\t\telse\n\t\t\t\tfz_paint_span(dp, mp, 1, w, 255);\n\t\t\tdp += dst->w * dst->n;\n\t\t\tmp += msk->w;\n\t\t}\n\t}\n}\n\nstatic void\nfz_draw_fill_text(fz_device *devp, fz_text *text, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tfz_draw_device *dev = devp->user;\n\tunsigned char colorbv[FZ_MAX_COLORS + 1];\n\tunsigned char shapebv;\n\tfloat colorfv[FZ_MAX_COLORS];\n\tfz_matrix tm, trm;\n\tfz_glyph *glyph;\n\tint i, gid;\n\tfz_draw_state *state = &dev->stack[dev->top];\n\tfz_colorspace *model = state->dest->colorspace;\n\n\tif (state->blendmode & FZ_BLEND_KNOCKOUT)\n\t\tstate = fz_knockout_begin(dev);\n\n\tfz_convert_color(dev->ctx, model, colorfv, colorspace, color);\n\tfor (i = 0; i < model->n; i++)\n\t\tcolorbv[i] = colorfv[i] * 255;\n\tcolorbv[i] = alpha * 255;\n\tshapebv = 255;\n\n\ttm = text->trm;\n\n\tfor (i = 0; i < text->len; i++)\n\t{\n\t\tgid = text->items[i].gid;\n\t\tif (gid < 0)\n\t\t\tcontinue;\n\n\t\ttm.e = text->items[i].x;\n\t\ttm.f = text->items[i].y;\n\t\tfz_concat(&trm, &tm, ctm);\n\n\t\tglyph = fz_render_glyph(dev->ctx, text->font, gid, &trm, model, &state->scissor);\n\t\tif (glyph)\n\t\t{\n\t\t\tfz_pixmap *pixmap = glyph->pixmap;\n\t\t\tint x = floorf(trm.e);\n\t\t\tint y = floorf(trm.f);\n\t\t\tif (pixmap == NULL || pixmap->n == 1)\n\t\t\t{\n\t\t\t\tdraw_glyph(colorbv, state->dest, glyph, x, y, &state->scissor);\n\t\t\t\tif (state->shape)\n\t\t\t\t\tdraw_glyph(&shapebv, state->shape, glyph, x, y, &state->scissor);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfz_matrix mat;\n\t\t\t\tmat.a = pixmap->w; mat.b = mat.c = 0; mat.d = pixmap->h;\n\t\t\t\tmat.e = x + pixmap->x; mat.f = y + pixmap->y;\n\t\t\t\tfz_paint_image(state->dest, &state->scissor, state->shape, pixmap, &mat, alpha * 255, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES));\n\t\t\t}\n\t\t\tfz_drop_glyph(dev->ctx, glyph);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_path *path = fz_outline_glyph(dev->ctx, text->font, gid, &tm);\n\t\t\tif (path)\n\t\t\t{\n\t\t\t\tfz_draw_fill_path(devp, path, 0, ctm, colorspace, color, alpha);\n\t\t\t\tfz_free_path(dev->ctx, path);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfz_warn(dev->ctx, \"cannot render glyph\");\n\t\t\t}\n\t\t}\n\t}\n\n\tif (state->blendmode & FZ_BLEND_KNOCKOUT)\n\t\tfz_knockout_end(dev);\n}\n\nstatic void\nfz_draw_stroke_text(fz_device *devp, fz_text *text, fz_stroke_state *stroke,\n\tconst fz_matrix *ctm, fz_colorspace *colorspace,\n\tfloat *color, float alpha)\n{\n\tfz_draw_device *dev = devp->user;\n\tunsigned char colorbv[FZ_MAX_COLORS + 1];\n\tfloat colorfv[FZ_MAX_COLORS];\n\tfz_matrix tm, trm;\n\tfz_glyph *glyph;\n\tint i, gid;\n\tfz_draw_state *state = &dev->stack[dev->top];\n\tfz_colorspace *model = state->dest->colorspace;\n\n\tif (state->blendmode & FZ_BLEND_KNOCKOUT)\n\t\tstate = fz_knockout_begin(dev);\n\n\tfz_convert_color(dev->ctx, model, colorfv, colorspace, color);\n\tfor (i = 0; i < model->n; i++)\n\t\tcolorbv[i] = colorfv[i] * 255;\n\tcolorbv[i] = alpha * 255;\n\n\ttm = text->trm;\n\n\tfor (i = 0; i < text->len; i++)\n\t{\n\t\tgid = text->items[i].gid;\n\t\tif (gid < 0)\n\t\t\tcontinue;\n\n\t\ttm.e = text->items[i].x;\n\t\ttm.f = text->items[i].y;\n\t\tfz_concat(&trm, &tm, ctm);\n\n\t\tglyph = fz_render_stroked_glyph(dev->ctx, text->font, gid, &trm, ctm, stroke, &state->scissor);\n\t\tif (glyph)\n\t\t{\n\t\t\tint x = (int)trm.e;\n\t\t\tint y = (int)trm.f;\n\t\t\tdraw_glyph(colorbv, state->dest, glyph, x, y, &state->scissor);\n\t\t\tif (state->shape)\n\t\t\t\tdraw_glyph(colorbv, state->shape, glyph, x, y, &state->scissor);\n\t\t\tfz_drop_glyph(dev->ctx, glyph);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_path *path = fz_outline_glyph(dev->ctx, text->font, gid, &tm);\n\t\t\tif (path)\n\t\t\t{\n\t\t\t\tfz_draw_stroke_path(devp, path, stroke, ctm, colorspace, color, alpha);\n\t\t\t\tfz_free_path(dev->ctx, path);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfz_warn(dev->ctx, \"cannot render glyph\");\n\t\t\t}\n\t\t}\n\t}\n\n\tif (state->blendmode & FZ_BLEND_KNOCKOUT)\n\t\tfz_knockout_end(dev);\n}\n\nstatic void\nfz_draw_clip_text(fz_device *devp, fz_text *text, const fz_matrix *ctm, int accumulate)\n{\n\tfz_draw_device *dev = devp->user;\n\tfz_context *ctx = dev->ctx;\n\tfz_irect bbox;\n\tfz_pixmap *mask, *dest, *shape;\n\tfz_matrix tm, trm;\n\tfz_glyph *glyph;\n\tint i, gid;\n\tfz_draw_state *state;\n\tfz_colorspace *model;\n\n\t/* If accumulate == 0 then this text object is guaranteed complete */\n\t/* If accumulate == 1 then this text object is the first (or only) in a sequence */\n\t/* If accumulate == 2 then this text object is a continuation */\n\n\tstate = push_stack(dev);\n\tSTACK_PUSHED(\"clip text\");\n\tmodel = state->dest->colorspace;\n\n\tif (accumulate == 0)\n\t{\n\t\t/* make the mask the exact size needed */\n\t\tfz_rect rect;\n\n\t\tfz_irect_from_rect(&bbox, fz_bound_text(dev->ctx, text, NULL, ctm, &rect));\n\t\tfz_intersect_irect(&bbox, &state->scissor);\n\t}\n\telse\n\t{\n\t\t/* be conservative about the size of the mask needed */\n\t\tbbox = state->scissor;\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tif (accumulate == 0 || accumulate == 1)\n\t\t{\n\t\t\tmask = fz_new_pixmap_with_bbox(dev->ctx, NULL, &bbox);\n\t\t\tfz_clear_pixmap(dev->ctx, mask);\n\t\t\tdest = fz_new_pixmap_with_bbox(dev->ctx, model, &bbox);\n\t\t\tfz_clear_pixmap(dev->ctx, dest);\n\t\t\tif (state->shape)\n\t\t\t{\n\t\t\t\tshape = fz_new_pixmap_with_bbox(dev->ctx, NULL, &bbox);\n\t\t\t\tfz_clear_pixmap(dev->ctx, shape);\n\t\t\t}\n\t\t\telse\n\t\t\t\tshape = NULL;\n\n\t\t\tstate[1].blendmode |= FZ_BLEND_ISOLATED;\n\t\t\tstate[1].scissor = bbox;\n\t\t\tstate[1].dest = dest;\n\t\t\tstate[1].mask = mask;\n\t\t\tstate[1].shape = shape;\n#ifdef DUMP_GROUP_BLENDS\n\t\t\tdump_spaces(dev->top-1, \"Clip (text) begin\\n\");\n#endif\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmask = state->mask;\n\t\t\tdev->top--;\n\t\t\tSTACK_POPPED(\"clip text\");\n\t\t}\n\n\t\tif (!fz_is_empty_irect(&bbox) && mask)\n\t\t{\n\t\t\ttm = text->trm;\n\n\t\t\tfor (i = 0; i < text->len; i++)\n\t\t\t{\n\t\t\t\tgid = text->items[i].gid;\n\t\t\t\tif (gid < 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\ttm.e = text->items[i].x;\n\t\t\t\ttm.f = text->items[i].y;\n\t\t\t\tfz_concat(&trm, &tm, ctm);\n\n\t\t\t\tglyph = fz_render_glyph(dev->ctx, text->font, gid, &trm, model, &state->scissor);\n\t\t\t\tif (glyph)\n\t\t\t\t{\n\t\t\t\t\tint x = (int)trm.e;\n\t\t\t\t\tint y = (int)trm.f;\n\t\t\t\t\tdraw_glyph(NULL, mask, glyph, x, y, &bbox);\n\t\t\t\t\tif (state[1].shape)\n\t\t\t\t\t\tdraw_glyph(NULL, state[1].shape, glyph, x, y, &bbox);\n\t\t\t\t\tfz_drop_glyph(dev->ctx, glyph);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfz_path *path = fz_outline_glyph(dev->ctx, text->font, gid, &tm);\n\t\t\t\t\tif (path)\n\t\t\t\t\t{\n\t\t\t\t\t\tfz_pixmap *old_dest;\n\t\t\t\t\t\tfloat white = 1;\n\n\t\t\t\t\t\told_dest = state[1].dest;\n\t\t\t\t\t\tstate[1].dest = state[1].mask;\n\t\t\t\t\t\tstate[1].mask = NULL;\n\t\t\t\t\t\tfz_try(ctx)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfz_draw_fill_path(devp, path, 0, ctm, fz_device_gray(ctx), &white, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfz_always(ctx)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstate[1].mask = state[1].dest;\n\t\t\t\t\t\t\tstate[1].dest = old_dest;\n\t\t\t\t\t\t\tfz_free_path(dev->ctx, path);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfz_catch(ctx)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfz_rethrow(ctx);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfz_warn(dev->ctx, \"cannot render glyph for clipping\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tif (accumulate == 0 || accumulate == 1)\n\t\t\temergency_pop_stack(dev, state);\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void\nfz_draw_clip_stroke_text(fz_device *devp, fz_text *text, fz_stroke_state *stroke, const fz_matrix *ctm)\n{\n\tfz_draw_device *dev = devp->user;\n\tfz_context *ctx = dev->ctx;\n\tfz_irect bbox;\n\tfz_pixmap *mask, *dest, *shape;\n\tfz_matrix tm, trm;\n\tfz_glyph *glyph;\n\tint i, gid;\n\tfz_draw_state *state = push_stack(dev);\n\tfz_colorspace *model = state->dest->colorspace;\n\tfz_rect rect;\n\n\tSTACK_PUSHED(\"clip stroke text\");\n\t/* make the mask the exact size needed */\n\tfz_irect_from_rect(&bbox, fz_bound_text(dev->ctx, text, stroke, ctm, &rect));\n\tfz_intersect_irect(&bbox, &state->scissor);\n\n\tfz_try(ctx)\n\t{\n\t\tstate[1].mask = mask = fz_new_pixmap_with_bbox(dev->ctx, NULL, &bbox);\n\t\tfz_clear_pixmap(dev->ctx, mask);\n\t\tstate[1].dest = dest = fz_new_pixmap_with_bbox(dev->ctx, model, &bbox);\n\t\tfz_clear_pixmap(dev->ctx, dest);\n\t\tif (state->shape)\n\t\t{\n\t\t\tstate[1].shape = shape = fz_new_pixmap_with_bbox(dev->ctx, NULL, &bbox);\n\t\t\tfz_clear_pixmap(dev->ctx, shape);\n\t\t}\n\t\telse\n\t\t\tshape = state->shape;\n\n\t\tstate[1].blendmode |= FZ_BLEND_ISOLATED;\n\t\tstate[1].scissor = bbox;\n#ifdef DUMP_GROUP_BLENDS\n\t\tdump_spaces(dev->top-1, \"Clip (stroke text) begin\\n\");\n#endif\n\n\t\tif (!fz_is_empty_irect(&bbox))\n\t\t{\n\t\t\ttm = text->trm;\n\n\t\t\tfor (i = 0; i < text->len; i++)\n\t\t\t{\n\t\t\t\tgid = text->items[i].gid;\n\t\t\t\tif (gid < 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\ttm.e = text->items[i].x;\n\t\t\t\ttm.f = text->items[i].y;\n\t\t\t\tfz_concat(&trm, &tm, ctm);\n\n\t\t\t\tglyph = fz_render_stroked_glyph(dev->ctx, text->font, gid, &trm, ctm, stroke, &state->scissor);\n\t\t\t\tif (glyph)\n\t\t\t\t{\n\t\t\t\t\tint x = (int)trm.e;\n\t\t\t\t\tint y = (int)trm.f;\n\t\t\t\t\tdraw_glyph(NULL, mask, glyph, x, y, &bbox);\n\t\t\t\t\tif (shape)\n\t\t\t\t\t\tdraw_glyph(NULL, shape, glyph, x, y, &bbox);\n\t\t\t\t\tfz_drop_glyph(dev->ctx, glyph);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfz_path *path = fz_outline_glyph(dev->ctx, text->font, gid, &tm);\n\t\t\t\t\tif (path)\n\t\t\t\t\t{\n\t\t\t\t\t\tfz_pixmap *old_dest;\n\t\t\t\t\t\tfloat white = 1;\n\n\t\t\t\t\t\tstate = &dev->stack[dev->top];\n\t\t\t\t\t\told_dest = state[0].dest;\n\t\t\t\t\t\tstate[0].dest = state[0].mask;\n\t\t\t\t\t\tstate[0].mask = NULL;\n\t\t\t\t\t\tfz_try(ctx)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfz_draw_stroke_path(devp, path, stroke, ctm, fz_device_gray(ctx), &white, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfz_always(ctx)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstate[0].mask = state[0].dest;\n\t\t\t\t\t\t\tstate[0].dest = old_dest;\n\t\t\t\t\t\t\tfz_free_path(dev->ctx, path);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfz_catch(ctx)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfz_rethrow(ctx);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfz_warn(dev->ctx, \"cannot render glyph for stroked clipping\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\temergency_pop_stack(dev, state);\n\t}\n}\n\nstatic void\nfz_draw_ignore_text(fz_device *dev, fz_text *text, const fz_matrix *ctm)\n{\n}\n\nstatic void\nfz_draw_fill_shade(fz_device *devp, fz_shade *shade, const fz_matrix *ctm, float alpha)\n{\n\tfz_draw_device *dev = devp->user;\n\tfz_rect bounds;\n\tfz_irect bbox, scissor;\n\tfz_pixmap *dest, *shape;\n\tfloat colorfv[FZ_MAX_COLORS];\n\tunsigned char colorbv[FZ_MAX_COLORS + 1];\n\tfz_draw_state *state = &dev->stack[dev->top];\n\tfz_colorspace *model = state->dest->colorspace;\n\n\tfz_bound_shade(dev->ctx, shade, ctm, &bounds);\n\tscissor = state->scissor;\n\tfz_intersect_irect(fz_irect_from_rect(&bbox, &bounds), &scissor);\n\n\tif (fz_is_empty_irect(&bbox))\n\t\treturn;\n\n\tif (!model)\n\t{\n\t\tfz_warn(dev->ctx, \"cannot render shading directly to an alpha mask\");\n\t\treturn;\n\t}\n\n\tif (state->blendmode & FZ_BLEND_KNOCKOUT)\n\t\tstate = fz_knockout_begin(dev);\n\n\tdest = state->dest;\n\tshape = state->shape;\n\n\tif (alpha < 1)\n\t{\n\t\tdest = fz_new_pixmap_with_bbox(dev->ctx, state->dest->colorspace, &bbox);\n\t\tfz_clear_pixmap(dev->ctx, dest);\n\t\tif (shape)\n\t\t{\n\t\t\tshape = fz_new_pixmap_with_bbox(dev->ctx, NULL, &bbox);\n\t\t\tfz_clear_pixmap(dev->ctx, shape);\n\t\t}\n\t}\n\n\tif (shade->use_background)\n\t{\n\t\tunsigned char *s;\n\t\tint x, y, n, i;\n\t\tfz_convert_color(dev->ctx, model, colorfv, shade->colorspace, shade->background);\n\t\tfor (i = 0; i < model->n; i++)\n\t\t\tcolorbv[i] = colorfv[i] * 255;\n\t\tcolorbv[i] = 255;\n\n\t\tn = dest->n;\n\t\tfor (y = scissor.y0; y < scissor.y1; y++)\n\t\t{\n\t\t\ts = dest->samples + (unsigned int)(((scissor.x0 - dest->x) + (y - dest->y) * dest->w) * dest->n);\n\t\t\tfor (x = scissor.x0; x < scissor.x1; x++)\n\t\t\t{\n\t\t\t\tfor (i = 0; i < n; i++)\n\t\t\t\t\t*s++ = colorbv[i];\n\t\t\t}\n\t\t}\n\t\tif (shape)\n\t\t{\n\t\t\tfor (y = scissor.y0; y < scissor.y1; y++)\n\t\t\t{\n\t\t\t\ts = shape->samples + (unsigned int)((scissor.x0 - shape->x) + (y - shape->y) * shape->w);\n\t\t\t\tfor (x = scissor.x0; x < scissor.x1; x++)\n\t\t\t\t{\n\t\t\t\t\t*s++ = 255;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfz_paint_shade(dev->ctx, shade, ctm, dest, &bbox);\n\tif (shape)\n\t\tfz_clear_pixmap_rect_with_value(dev->ctx, shape, 255, &bbox);\n\n\tif (alpha < 1)\n\t{\n\t\tfz_paint_pixmap(state->dest, dest, alpha * 255);\n\t\tfz_drop_pixmap(dev->ctx, dest);\n\t\tif (shape)\n\t\t{\n\t\t\tfz_paint_pixmap(state->shape, shape, alpha * 255);\n\t\t\tfz_drop_pixmap(dev->ctx, shape);\n\t\t}\n\t}\n\n\tif (state->blendmode & FZ_BLEND_KNOCKOUT)\n\t\tfz_knockout_end(dev);\n}\n\nstatic fz_pixmap *\nfz_transform_pixmap(fz_draw_device *dev, fz_pixmap *image, fz_matrix *ctm, int x, int y, int dx, int dy, int gridfit, const fz_irect *clip)\n{\n\tfz_pixmap *scaled;\n\tfz_context *ctx = dev->ctx;\n\n\tif (ctm->a != 0 && ctm->b == 0 && ctm->c == 0 && ctm->d != 0)\n\t{\n\t\t/* Unrotated or X-flip or Y-flip or XY-flip */\n\t\tfz_matrix m = *ctm;\n\t\tif (gridfit)\n\t\t\tfz_gridfit_matrix(&m);\n\t\tscaled = fz_scale_pixmap_cached(ctx, image, m.e, m.f, m.a, m.d, clip, dev->cache_x, dev->cache_y);\n\t\tif (!scaled)\n\t\t\treturn NULL;\n\t\tctm->a = scaled->w;\n\t\tctm->d = scaled->h;\n\t\tctm->e = scaled->x;\n\t\tctm->f = scaled->y;\n\t\treturn scaled;\n\t}\n\n\tif (ctm->a == 0 && ctm->b != 0 && ctm->c != 0 && ctm->d == 0)\n\t{\n\t\t/* Other orthogonal flip/rotation cases */\n\t\tfz_matrix m = *ctm;\n\t\tfz_irect rclip;\n\t\tif (gridfit)\n\t\t\tfz_gridfit_matrix(&m);\n\t\tif (clip)\n\t\t{\n\t\t\trclip.x0 = clip->y0;\n\t\t\trclip.y0 = clip->x0;\n\t\t\trclip.x1 = clip->y1;\n\t\t\trclip.y1 = clip->x1;\n\t\t}\n\t\tscaled = fz_scale_pixmap_cached(ctx, image, m.f, m.e, m.b, m.c, (clip ? &rclip : NULL), dev->cache_x, dev->cache_y);\n\t\tif (!scaled)\n\t\t\treturn NULL;\n\t\tctm->b = scaled->w;\n\t\tctm->c = scaled->h;\n\t\tctm->f = scaled->x;\n\t\tctm->e = scaled->y;\n\t\treturn scaled;\n\t}\n\n\t/* Downscale, non rectilinear case */\n\tif (dx > 0 && dy > 0)\n\t{\n\t\tscaled = fz_scale_pixmap_cached(ctx, image, 0, 0, (float)dx, (float)dy, NULL, dev->cache_x, dev->cache_y);\n\t\treturn scaled;\n\t}\n\n\treturn NULL;\n}\n\nstatic void\nfz_draw_fill_image(fz_device *devp, fz_image *image, const fz_matrix *ctm, float alpha)\n{\n\tfz_draw_device *dev = devp->user;\n\tfz_pixmap *converted = NULL;\n\tfz_pixmap *scaled = NULL;\n\tfz_pixmap *pixmap;\n\tfz_pixmap *orig_pixmap;\n\tint after;\n\tint dx, dy;\n\tfz_context *ctx = dev->ctx;\n\tfz_draw_state *state = &dev->stack[dev->top];\n\tfz_colorspace *model = state->dest->colorspace;\n\tfz_irect clip;\n\tfz_matrix local_ctm = *ctm;\n\n\tfz_intersect_irect(fz_pixmap_bbox(ctx, state->dest, &clip), &state->scissor);\n\n\tfz_var(scaled);\n\n\tif (!model)\n\t{\n\t\tfz_warn(dev->ctx, \"cannot render image directly to an alpha mask\");\n\t\treturn;\n\t}\n\n\tif (image->w == 0 || image->h == 0)\n\t\treturn;\n\n\tdx = sqrtf(local_ctm.a * local_ctm.a + local_ctm.b * local_ctm.b);\n\tdy = sqrtf(local_ctm.c * local_ctm.c + local_ctm.d * local_ctm.d);\n\n\tpixmap = fz_new_pixmap_from_image(ctx, image, dx, dy);\n\torig_pixmap = pixmap;\n\n\t/* convert images with more components (cmyk->rgb) before scaling */\n\t/* convert images with fewer components (gray->rgb after scaling */\n\t/* convert images with expensive colorspace transforms after scaling */\n\n\tfz_try(ctx)\n\t{\n\t\tif (state->blendmode & FZ_BLEND_KNOCKOUT)\n\t\t\tstate = fz_knockout_begin(dev);\n\n\t\tafter = 0;\n\t\tif (pixmap->colorspace == fz_device_gray(ctx))\n\t\t\tafter = 1;\n\n\t\tif (pixmap->colorspace != model && !after)\n\t\t{\n\t\t\tfz_irect bbox;\n\t\t\tfz_pixmap_bbox(ctx, pixmap, &bbox);\n\t\t\tconverted = fz_new_pixmap_with_bbox(ctx, model, &bbox);\n\t\t\tfz_convert_pixmap(ctx, converted, pixmap);\n\t\t\tpixmap = converted;\n\t\t}\n\n\t\tif (dx < pixmap->w && dy < pixmap->h && !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES))\n\t\t{\n\t\t\tint gridfit = alpha == 1.0f && !(dev->flags & FZ_DRAWDEV_FLAGS_TYPE3);\n\t\t\tscaled = fz_transform_pixmap(dev, pixmap, &local_ctm, state->dest->x, state->dest->y, dx, dy, gridfit, &clip);\n\t\t\tif (!scaled)\n\t\t\t{\n\t\t\t\tif (dx < 1)\n\t\t\t\t\tdx = 1;\n\t\t\t\tif (dy < 1)\n\t\t\t\t\tdy = 1;\n\t\t\t\tscaled = fz_scale_pixmap_cached(ctx, pixmap, pixmap->x, pixmap->y, dx, dy, NULL, dev->cache_x, dev->cache_y);\n\t\t\t}\n\t\t\tif (scaled)\n\t\t\t\tpixmap = scaled;\n\t\t}\n\n\t\tif (pixmap->colorspace != model)\n\t\t{\n\t\t\tif ((pixmap->colorspace == fz_device_gray(ctx) && model == fz_device_rgb(ctx)) ||\n\t\t\t\t(pixmap->colorspace == fz_device_gray(ctx) && model == fz_device_bgr(ctx)))\n\t\t\t{\n\t\t\t\t/* We have special case rendering code for gray -> rgb/bgr */\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfz_irect bbox;\n\t\t\t\tfz_pixmap_bbox(ctx, pixmap, &bbox);\n\t\t\t\tconverted = fz_new_pixmap_with_bbox(ctx, model, &bbox);\n\t\t\t\tfz_convert_pixmap(ctx, converted, pixmap);\n\t\t\t\tpixmap = converted;\n\t\t\t}\n\t\t}\n\n\t\tfz_paint_image(state->dest, &state->scissor, state->shape, pixmap, &local_ctm, alpha * 255, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES));\n\n\t\tif (state->blendmode & FZ_BLEND_KNOCKOUT)\n\t\t\tfz_knockout_end(dev);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_pixmap(ctx, scaled);\n\t\tfz_drop_pixmap(ctx, converted);\n\t\tfz_drop_pixmap(ctx, orig_pixmap);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void\nfz_draw_fill_image_mask(fz_device *devp, fz_image *image, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tfz_draw_device *dev = devp->user;\n\tunsigned char colorbv[FZ_MAX_COLORS + 1];\n\tfloat colorfv[FZ_MAX_COLORS];\n\tfz_pixmap *scaled = NULL;\n\tfz_pixmap *pixmap;\n\tfz_pixmap *orig_pixmap;\n\tint dx, dy;\n\tint i;\n\tfz_context *ctx = dev->ctx;\n\tfz_draw_state *state = &dev->stack[dev->top];\n\tfz_colorspace *model = state->dest->colorspace;\n\tfz_irect clip;\n\tfz_matrix local_ctm = *ctm;\n\n\tfz_pixmap_bbox(ctx, state->dest, &clip);\n\tfz_intersect_irect(&clip, &state->scissor);\n\n\tif (image->w == 0 || image->h == 0)\n\t\treturn;\n\n\tdx = sqrtf(local_ctm.a * local_ctm.a + local_ctm.b * local_ctm.b);\n\tdy = sqrtf(local_ctm.c * local_ctm.c + local_ctm.d * local_ctm.d);\n\tpixmap = fz_new_pixmap_from_image(ctx, image, dx, dy);\n\torig_pixmap = pixmap;\n\n\tfz_try(ctx)\n\t{\n\t\tif (state->blendmode & FZ_BLEND_KNOCKOUT)\n\t\t\tstate = fz_knockout_begin(dev);\n\n\t\tif (dx < pixmap->w && dy < pixmap->h)\n\t\t{\n\t\t\tint gridfit = alpha == 1.0f && !(dev->flags & FZ_DRAWDEV_FLAGS_TYPE3);\n\t\t\tscaled = fz_transform_pixmap(dev, pixmap, &local_ctm, state->dest->x, state->dest->y, dx, dy, gridfit, &clip);\n\t\t\tif (!scaled)\n\t\t\t{\n\t\t\t\tif (dx < 1)\n\t\t\t\t\tdx = 1;\n\t\t\t\tif (dy < 1)\n\t\t\t\t\tdy = 1;\n\t\t\t\tscaled = fz_scale_pixmap_cached(dev->ctx, pixmap, pixmap->x, pixmap->y, dx, dy, NULL, dev->cache_x, dev->cache_y);\n\t\t\t}\n\t\t\tif (scaled)\n\t\t\t\tpixmap = scaled;\n\t\t}\n\n\t\tfz_convert_color(dev->ctx, model, colorfv, colorspace, color);\n\t\tfor (i = 0; i < model->n; i++)\n\t\t\tcolorbv[i] = colorfv[i] * 255;\n\t\tcolorbv[i] = alpha * 255;\n\n\t\tfz_paint_image_with_color(state->dest, &state->scissor, state->shape, pixmap, &local_ctm, colorbv, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES));\n\n\t\tif (scaled)\n\t\t\tfz_drop_pixmap(dev->ctx, scaled);\n\n\t\tif (state->blendmode & FZ_BLEND_KNOCKOUT)\n\t\t\tfz_knockout_end(dev);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_pixmap(dev->ctx, orig_pixmap);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void\nfz_draw_clip_image_mask(fz_device *devp, fz_image *image, const fz_rect *rect, const fz_matrix *ctm)\n{\n\tfz_draw_device *dev = devp->user;\n\tfz_context *ctx = dev->ctx;\n\tfz_irect bbox;\n\tfz_pixmap *mask = NULL;\n\tfz_pixmap *dest = NULL;\n\tfz_pixmap *shape = NULL;\n\tfz_pixmap *scaled = NULL;\n\tfz_pixmap *pixmap = NULL;\n\tfz_pixmap *orig_pixmap = NULL;\n\tint dx, dy;\n\tfz_draw_state *state = push_stack(dev);\n\tfz_colorspace *model = state->dest->colorspace;\n\tfz_irect clip;\n\tfz_matrix local_ctm = *ctm;\n\tfz_rect urect;\n\n\tSTACK_PUSHED(\"clip image mask\");\n\tfz_pixmap_bbox(ctx, state->dest, &clip);\n\tfz_intersect_irect(&clip, &state->scissor);\n\n\tfz_var(mask);\n\tfz_var(dest);\n\tfz_var(shape);\n\tfz_var(pixmap);\n\tfz_var(orig_pixmap);\n\n\tif (image->w == 0 || image->h == 0)\n\t{\n#ifdef DUMP_GROUP_BLENDS\n\t\tdump_spaces(dev->top-1, \"Clip (image mask) (empty) begin\\n\");\n#endif\n\t\tstate[1].scissor = fz_empty_irect;\n\t\tstate[1].mask = NULL;\n\t\treturn;\n\t}\n\n#ifdef DUMP_GROUP_BLENDS\n\tdump_spaces(dev->top-1, \"Clip (image mask) begin\\n\");\n#endif\n\n\turect = fz_unit_rect;\n\tfz_irect_from_rect(&bbox, fz_transform_rect(&urect, &local_ctm));\n\tfz_intersect_irect(&bbox, &state->scissor);\n\tif (rect)\n\t{\n\t\tfz_irect bbox2;\n\t\tfz_intersect_irect(&bbox, fz_irect_from_rect(&bbox2, rect));\n\t}\n\n\tdx = sqrtf(local_ctm.a * local_ctm.a + local_ctm.b * local_ctm.b);\n\tdy = sqrtf(local_ctm.c * local_ctm.c + local_ctm.d * local_ctm.d);\n\n\tfz_try(ctx)\n\t{\n\t\tpixmap = fz_new_pixmap_from_image(ctx, image, dx, dy);\n\t\torig_pixmap = pixmap;\n\n\t\tstate[1].mask = mask = fz_new_pixmap_with_bbox(dev->ctx, NULL, &bbox);\n\t\tfz_clear_pixmap(dev->ctx, mask);\n\n\t\tstate[1].dest = dest = fz_new_pixmap_with_bbox(dev->ctx, model, &bbox);\n\t\tfz_clear_pixmap(dev->ctx, dest);\n\t\tif (state->shape)\n\t\t{\n\t\t\tstate[1].shape = shape = fz_new_pixmap_with_bbox(dev->ctx, NULL, &bbox);\n\t\t\tfz_clear_pixmap(dev->ctx, shape);\n\t\t}\n\n\t\tstate[1].blendmode |= FZ_BLEND_ISOLATED;\n\t\tstate[1].scissor = bbox;\n\n\t\tif (dx < pixmap->w && dy < pixmap->h)\n\t\t{\n\t\t\tint gridfit = !(dev->flags & FZ_DRAWDEV_FLAGS_TYPE3);\n\t\t\tscaled = fz_transform_pixmap(dev, pixmap, &local_ctm, state->dest->x, state->dest->y, dx, dy, gridfit, &clip);\n\t\t\tif (!scaled)\n\t\t\t{\n\t\t\t\tif (dx < 1)\n\t\t\t\t\tdx = 1;\n\t\t\t\tif (dy < 1)\n\t\t\t\t\tdy = 1;\n\t\t\t\tscaled = fz_scale_pixmap_cached(dev->ctx, pixmap, pixmap->x, pixmap->y, dx, dy, NULL, dev->cache_x, dev->cache_y);\n\t\t\t}\n\t\t\tif (scaled)\n\t\t\t\tpixmap = scaled;\n\t\t}\n\t\tfz_paint_image(mask, &bbox, state->shape, pixmap, &local_ctm, 255, !(devp->hints & FZ_DONT_INTERPOLATE_IMAGES));\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_pixmap(ctx, scaled);\n\t\tfz_drop_pixmap(ctx, orig_pixmap);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\temergency_pop_stack(dev, state);\n\t}\n}\n\nstatic void\nfz_draw_pop_clip(fz_device *devp)\n{\n\tfz_draw_device *dev = devp->user;\n\tfz_context *ctx = dev->ctx;\n\tfz_draw_state *state;\n\n\tif (dev->top == 0)\n\t{\n\t\tfz_warn(ctx, \"Unexpected pop clip\");\n\t\treturn;\n\t}\n\tstate = &dev->stack[--dev->top];\n\tSTACK_POPPED(\"clip\");\n\n\t/* We can get here with state[1].mask == NULL if the clipping actually\n\t * resolved to a rectangle earlier.\n\t */\n\tif (state[1].mask)\n\t{\n#ifdef DUMP_GROUP_BLENDS\n\t\tdump_spaces(dev->top, \"\");\n\t\tfz_dump_blend(dev->ctx, state[1].dest, \"Clipping \");\n\t\tif (state[1].shape)\n\t\t\tfz_dump_blend(dev->ctx, state[1].shape, \"/\");\n\t\tfz_dump_blend(dev->ctx, state[0].dest, \" onto \");\n\t\tif (state[0].shape)\n\t\t\tfz_dump_blend(dev->ctx, state[0].shape, \"/\");\n\t\tfz_dump_blend(dev->ctx, state[1].mask, \" with \");\n#endif\n\t\tfz_paint_pixmap_with_mask(state[0].dest, state[1].dest, state[1].mask);\n\t\tif (state[0].shape != state[1].shape)\n\t\t{\n\t\t\tfz_paint_pixmap_with_mask(state[0].shape, state[1].shape, state[1].mask);\n\t\t\tfz_drop_pixmap(dev->ctx, state[1].shape);\n\t\t}\n\t\t/* The following tests should not be required, but just occasionally\n\t\t * errors can cause the stack to get out of sync, and this might save\n\t\t * our bacon. */\n\t\tif (state[0].mask != state[1].mask)\n\t\t\tfz_drop_pixmap(dev->ctx, state[1].mask);\n\t\tif (state[0].dest != state[1].dest)\n\t\t\tfz_drop_pixmap(dev->ctx, state[1].dest);\n#ifdef DUMP_GROUP_BLENDS\n\t\tfz_dump_blend(dev->ctx, state[0].dest, \" to get \");\n\t\tif (state[0].shape)\n\t\t\tfz_dump_blend(dev->ctx, state[0].shape, \"/\");\n\t\tprintf(\"\\n\");\n#endif\n\t}\n\telse\n\t{\n#ifdef DUMP_GROUP_BLENDS\n\t\tdump_spaces(dev->top, \"Clip end\\n\");\n#endif\n\t}\n}\n\nstatic void\nfz_draw_begin_mask(fz_device *devp, const fz_rect *rect, int luminosity, fz_colorspace *colorspace, float *colorfv)\n{\n\tfz_draw_device *dev = devp->user;\n\tfz_pixmap *dest;\n\tfz_irect bbox;\n\tfz_draw_state *state = push_stack(dev);\n\tfz_pixmap *shape = state->shape;\n\tfz_context *ctx = dev->ctx;\n\n\tSTACK_PUSHED(\"mask\");\n\tfz_intersect_irect(fz_irect_from_rect(&bbox, rect), &state->scissor);\n\n\tfz_try(ctx)\n\t{\n\t\tstate[1].dest = dest = fz_new_pixmap_with_bbox(dev->ctx, fz_device_gray(ctx), &bbox);\n\t\tif (state->shape)\n\t\t{\n\t\t\t/* FIXME: If we ever want to support AIS true, then\n\t\t\t * we probably want to create a shape pixmap here,\n\t\t\t * using: shape = fz_new_pixmap_with_bbox(NULL, bbox);\n\t\t\t * then, in the end_mask code, we create the mask\n\t\t\t * from this rather than dest.\n\t\t\t */\n\t\t\tstate[1].shape = shape = NULL;\n\t\t}\n\n\t\tif (luminosity)\n\t\t{\n\t\t\tfloat bc;\n\t\t\tif (!colorspace)\n\t\t\t\tcolorspace = fz_device_gray(ctx);\n\t\t\tfz_convert_color(dev->ctx, fz_device_gray(ctx), &bc, colorspace, colorfv);\n\t\t\tfz_clear_pixmap_with_value(dev->ctx, dest, bc * 255);\n\t\t\tif (shape)\n\t\t\t\tfz_clear_pixmap_with_value(dev->ctx, shape, 255);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_clear_pixmap(dev->ctx, dest);\n\t\t\tif (shape)\n\t\t\t\tfz_clear_pixmap(dev->ctx, shape);\n\t\t}\n\n#ifdef DUMP_GROUP_BLENDS\n\t\tdump_spaces(dev->top-1, \"Mask begin\\n\");\n#endif\n\t\tstate[1].scissor = bbox;\n\t\tstate[1].luminosity = luminosity;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\temergency_pop_stack(dev, state);\n\t}\n}\n\nstatic void\nfz_draw_end_mask(fz_device *devp)\n{\n\tfz_draw_device *dev = devp->user;\n\tfz_pixmap *temp, *dest;\n\tfz_irect bbox;\n\tint luminosity;\n\tfz_context *ctx = dev->ctx;\n\tfz_draw_state *state;\n\n\tif (dev->top == 0)\n\t{\n\t\tfz_warn(ctx, \"Unexpected draw_end_mask\");\n\t\treturn;\n\t}\n\tstate = &dev->stack[dev->top-1];\n\tSTACK_CONVERT(\"(mask)\");\n\t/* pop soft mask buffer */\n\tluminosity = state[1].luminosity;\n\n#ifdef DUMP_GROUP_BLENDS\n\tdump_spaces(dev->top-1, \"Mask -> Clip\\n\");\n#endif\n\tfz_try(ctx)\n\t{\n\t\t/* convert to alpha mask */\n\t\ttemp = fz_alpha_from_gray(dev->ctx, state[1].dest, luminosity);\n\t\tif (state[1].mask != state[0].mask)\n\t\t\tfz_drop_pixmap(dev->ctx, state[1].mask);\n\t\tstate[1].mask = temp;\n\t\tif (state[1].dest != state[0].dest)\n\t\t\tfz_drop_pixmap(dev->ctx, state[1].dest);\n\t\tstate[1].dest = NULL;\n\t\tif (state[1].shape != state[0].shape)\n\t\t\tfz_drop_pixmap(dev->ctx, state[1].shape);\n\t\tstate[1].shape = NULL;\n\n\t\t/* create new dest scratch buffer */\n\t\tfz_pixmap_bbox(ctx, temp, &bbox);\n\t\tdest = fz_new_pixmap_with_bbox(dev->ctx, state->dest->colorspace, &bbox);\n\t\tfz_clear_pixmap(dev->ctx, dest);\n\n\t\t/* push soft mask as clip mask */\n\t\tstate[1].dest = dest;\n\t\tstate[1].blendmode |= FZ_BLEND_ISOLATED;\n\t\t/* If we have a shape, then it'll need to be masked with the\n\t\t * clip mask when we pop. So create a new shape now. */\n\t\tif (state[0].shape)\n\t\t{\n\t\t\tstate[1].shape = fz_new_pixmap_with_bbox(dev->ctx, NULL, &bbox);\n\t\t\tfz_clear_pixmap(dev->ctx, state[1].shape);\n\t\t}\n\t\tstate[1].scissor = bbox;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\temergency_pop_stack(dev, state);\n\t}\n}\n\nstatic void\nfz_draw_begin_group(fz_device *devp, const fz_rect *rect, int isolated, int knockout, int blendmode, float alpha)\n{\n\tfz_draw_device *dev = devp->user;\n\tfz_irect bbox;\n\tfz_pixmap *dest;\n\tfz_context *ctx = dev->ctx;\n\tfz_draw_state *state = &dev->stack[dev->top];\n\tfz_colorspace *model = state->dest->colorspace;\n\n\tif (state->blendmode & FZ_BLEND_KNOCKOUT)\n\t\tfz_knockout_begin(dev);\n\n\tstate = push_stack(dev);\n\tSTACK_PUSHED(\"group\");\n\tfz_intersect_irect(fz_irect_from_rect(&bbox, rect), &state->scissor);\n\n\tfz_try(ctx)\n\t{\n\t\tstate[1].dest = dest = fz_new_pixmap_with_bbox(ctx, model, &bbox);\n\n#ifndef ATTEMPT_KNOCKOUT_AND_ISOLATED\n\t\tknockout = 0;\n\t\tisolated = 1;\n#endif\n\n\t\tif (isolated)\n\t\t{\n\t\t\tfz_clear_pixmap(dev->ctx, dest);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_copy_pixmap_rect(dev->ctx, dest, state[0].dest, &bbox);\n\t\t}\n\n\t\tif (blendmode == 0 && alpha == 1.0 && isolated)\n\t\t{\n\t\t\t/* We can render direct to any existing shape plane.\n\t\t\t * If there isn't one, we don't need to make one. */\n\t\t\tstate[1].shape = state[0].shape;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tstate[1].shape = fz_new_pixmap_with_bbox(ctx, NULL, &bbox);\n\t\t\tfz_clear_pixmap(dev->ctx, state[1].shape);\n\t\t}\n\n\t\tstate[1].alpha = alpha;\n#ifdef DUMP_GROUP_BLENDS\n\t\tdump_spaces(dev->top-1, \"Group begin\\n\");\n#endif\n\n\t\tstate[1].scissor = bbox;\n\t\tstate[1].blendmode = blendmode | (isolated ? FZ_BLEND_ISOLATED : 0) | (knockout ? FZ_BLEND_KNOCKOUT : 0);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\temergency_pop_stack(dev, state);\n\t}\n}\n\nstatic void\nfz_draw_end_group(fz_device *devp)\n{\n\tfz_draw_device *dev = devp->user;\n\tint blendmode;\n\tint isolated;\n\tfloat alpha;\n\tfz_context *ctx = dev->ctx;\n\tfz_draw_state *state;\n\n\tif (dev->top == 0)\n\t{\n\t\tfz_warn(ctx, \"Unexpected end_group\");\n\t\treturn;\n\t}\n\n\tstate = &dev->stack[--dev->top];\n\tSTACK_POPPED(\"group\");\n\talpha = state[1].alpha;\n\tblendmode = state[1].blendmode & FZ_BLEND_MODEMASK;\n\tisolated = state[1].blendmode & FZ_BLEND_ISOLATED;\n#ifdef DUMP_GROUP_BLENDS\n\tdump_spaces(dev->top, \"\");\n\tfz_dump_blend(dev->ctx, state[1].dest, \"Group end: blending \");\n\tif (state[1].shape)\n\t\tfz_dump_blend(dev->ctx, state[1].shape, \"/\");\n\tfz_dump_blend(dev->ctx, state[0].dest, \" onto \");\n\tif (state[0].shape)\n\t\tfz_dump_blend(dev->ctx, state[0].shape, \"/\");\n\tif (alpha != 1.0f)\n\t\tprintf(\" (alpha %g)\", alpha);\n\tif (blendmode != 0)\n\t\tprintf(\" (blend %d)\", blendmode);\n\tif (isolated != 0)\n\t\tprintf(\" (isolated)\");\n\tif (state[1].blendmode & FZ_BLEND_KNOCKOUT)\n\t\tprintf(\" (knockout)\");\n#endif\n\tif ((blendmode == 0) && (state[0].shape == state[1].shape))\n\t\tfz_paint_pixmap(state[0].dest, state[1].dest, alpha * 255);\n\telse\n\t\tfz_blend_pixmap(state[0].dest, state[1].dest, alpha * 255, blendmode, isolated, state[1].shape);\n\n\t/* The following test should not be required, but just occasionally\n\t * errors can cause the stack to get out of sync, and this might save\n\t * our bacon. */\n\tif (state[0].dest != state[1].dest)\n\t\tfz_drop_pixmap(dev->ctx, state[1].dest);\n\tif (state[0].shape != state[1].shape)\n\t{\n\t\tif (state[0].shape)\n\t\t\tfz_paint_pixmap(state[0].shape, state[1].shape, alpha * 255);\n\t\tfz_drop_pixmap(dev->ctx, state[1].shape);\n\t}\n#ifdef DUMP_GROUP_BLENDS\n\tfz_dump_blend(dev->ctx, state[0].dest, \" to get \");\n\tif (state[0].shape)\n\t\tfz_dump_blend(dev->ctx, state[0].shape, \"/\");\n\tprintf(\"\\n\");\n#endif\n\n\tif (state[0].blendmode & FZ_BLEND_KNOCKOUT)\n\t\tfz_knockout_end(dev);\n}\n\ntypedef struct\n{\n\tint refs;\n\tfloat ctm[4];\n\tint id;\n} tile_key;\n\ntypedef struct\n{\n\tfz_storable storable;\n\tfz_pixmap *dest;\n\tfz_pixmap *shape;\n} tile_record;\n\nstatic int\nfz_make_hash_tile_key(fz_store_hash *hash, void *key_)\n{\n\ttile_key *key = (tile_key *)key_;\n\n\thash->u.im.id = key->id;\n\thash->u.im.m[0] = key->ctm[0];\n\thash->u.im.m[1] = key->ctm[1];\n\thash->u.im.m[2] = key->ctm[2];\n\thash->u.im.m[3] = key->ctm[3];\n\treturn 1;\n}\n\nstatic void *\nfz_keep_tile_key(fz_context *ctx, void *key_)\n{\n\ttile_key *key = (tile_key *)key_;\n\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tkey->refs++;\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\n\treturn (void *)key;\n}\n\nstatic void\nfz_drop_tile_key(fz_context *ctx, void *key_)\n{\n\ttile_key *key = (tile_key *)key_;\n\tint drop;\n\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tdrop = --key->refs;\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\tif (drop == 0)\n\t{\n\t\tfz_free(ctx, key);\n\t}\n}\n\nstatic int\nfz_cmp_tile_key(void *k0_, void *k1_)\n{\n\ttile_key *k0 = (tile_key *)k0_;\n\ttile_key *k1 = (tile_key *)k1_;\n\n\treturn k0->id == k1->id && k0->ctm[0] == k1->ctm[0] && k0->ctm[1] == k1->ctm[1] && k0->ctm[2] == k1->ctm[2] && k0->ctm[3] == k1->ctm[3];\n}\n\n#ifndef NDEBUG\nstatic void\nfz_debug_tile(FILE *out, void *key_)\n{\n\ttile_key *key = (tile_key *)key_;\n\n\tfprintf(out, \"(tile id=%x, ctm=%g %g %g %g) \", key->id, key->ctm[0], key->ctm[1], key->ctm[2], key->ctm[3]);\n}\n#endif\n\nstatic fz_store_type fz_tile_store_type =\n{\n\tfz_make_hash_tile_key,\n\tfz_keep_tile_key,\n\tfz_drop_tile_key,\n\tfz_cmp_tile_key,\n#ifndef NDEBUG\n\tfz_debug_tile\n#endif\n};\n\nstatic void\nfz_free_tile_record_imp(fz_context *ctx, fz_storable *storable)\n{\n\ttile_record *tr = (tile_record *)(void *)storable;\n\n\tif (tr == NULL)\n\t\treturn;\n\tfz_drop_pixmap(ctx, tr->dest);\n\tfz_drop_pixmap(ctx, tr->shape);\n\tfz_free(ctx, tr);\n}\n\nstatic void\nfz_drop_tile_record(fz_context *ctx, tile_record *tile)\n{\n\tfz_drop_storable(ctx, &tile->storable);\n}\n\nstatic tile_record *\nfz_new_tile_record(fz_context *ctx, fz_pixmap *dest, fz_pixmap *shape)\n{\n\ttile_record *tile = fz_malloc_struct(ctx, tile_record);\n\tFZ_INIT_STORABLE(tile, 1, fz_free_tile_record_imp);\n\ttile->dest = fz_keep_pixmap(ctx, dest);\n\ttile->shape = fz_keep_pixmap(ctx, shape);\n\treturn tile;\n}\n\nunsigned int\nfz_tile_size(fz_context *ctx, tile_record *tile)\n{\n\tif (!tile)\n\t\treturn 0;\n\treturn sizeof(*tile) + fz_pixmap_size(ctx, tile->dest) + fz_pixmap_size(ctx, tile->shape);\n}\n\nstatic int\nfz_draw_begin_tile(fz_device *devp, const fz_rect *area, const fz_rect *view, float xstep, float ystep, const fz_matrix *ctm, int id)\n{\n\tfz_draw_device *dev = devp->user;\n\tfz_pixmap *dest = NULL;\n\tfz_pixmap *shape;\n\tfz_irect bbox;\n\tfz_context *ctx = dev->ctx;\n\tfz_draw_state *state = &dev->stack[dev->top];\n\tfz_colorspace *model = state->dest->colorspace;\n\tfz_rect local_view = *view;\n\n\t/* area, view, xstep, ystep are in pattern space */\n\t/* ctm maps from pattern space to device space */\n\n\tif (state->blendmode & FZ_BLEND_KNOCKOUT)\n\t\tfz_knockout_begin(dev);\n\n\tstate = push_stack(dev);\n\tSTACK_PUSHED(\"tile\");\n\tfz_irect_from_rect(&bbox, fz_transform_rect(&local_view, ctm));\n\t/* We should never have a bbox that entirely covers our destination.\n\t * If we do, then the check for only 1 tile being visible above has\n\t * failed. Actually, this *can* fail due to the round_rect, at extreme\n\t * resolutions, so disable this assert.\n\t * assert(bbox.x0 > state->dest->x || bbox.x1 < state->dest->x + state->dest->w ||\n\t *\tbbox.y0 > state->dest->y || bbox.y1 < state->dest->y + state->dest->h);\n\t */\n\n\t/* Check to see if we have one cached */\n\tif (id)\n\t{\n\t\ttile_key tk;\n\t\ttile_record *tile;\n\t\ttk.ctm[0] = ctm->a;\n\t\ttk.ctm[1] = ctm->b;\n\t\ttk.ctm[2] = ctm->c;\n\t\ttk.ctm[3] = ctm->d;\n\t\ttk.id = id;\n\n\t\ttile = fz_find_item(ctx, fz_free_tile_record_imp, &tk, &fz_tile_store_type);\n\t\tif (tile)\n\t\t{\n\t\t\tstate[1].dest = fz_keep_pixmap(ctx, tile->dest);\n\t\t\tstate[1].shape = fz_keep_pixmap(ctx, tile->shape);\n\t\t\tstate[1].blendmode |= FZ_BLEND_ISOLATED;\n\t\t\tstate[1].xstep = xstep;\n\t\t\tstate[1].ystep = ystep;\n\t\t\tstate[1].id = id;\n\t\t\tfz_irect_from_rect(&state[1].area, area);\n\t\t\tstate[1].ctm = *ctm;\n#ifdef DUMP_GROUP_BLENDS\n\t\t\tdump_spaces(dev->top-1, \"Tile begin (cached)\\n\");\n#endif\n\n\t\t\tstate[1].scissor = bbox;\n\t\t\tfz_drop_tile_record(ctx, tile);\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tstate[1].dest = dest = fz_new_pixmap_with_bbox(dev->ctx, model, &bbox);\n\t\tfz_clear_pixmap(ctx, dest);\n\t\tshape = state[0].shape;\n\t\tif (shape)\n\t\t{\n\t\t\tstate[1].shape = shape = fz_new_pixmap_with_bbox(dev->ctx, NULL, &bbox);\n\t\t\tfz_clear_pixmap(ctx, shape);\n\t\t}\n\t\tstate[1].blendmode |= FZ_BLEND_ISOLATED;\n\t\tstate[1].xstep = xstep;\n\t\tstate[1].ystep = ystep;\n\t\tstate[1].id = id;\n\t\tfz_irect_from_rect(&state[1].area, area);\n\t\tstate[1].ctm = *ctm;\n#ifdef DUMP_GROUP_BLENDS\n\t\tdump_spaces(dev->top-1, \"Tile begin\\n\");\n#endif\n\n\t\tstate[1].scissor = bbox;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\temergency_pop_stack(dev, state);\n\t}\n\n\treturn 0;\n}\n\nstatic void\nfz_draw_end_tile(fz_device *devp)\n{\n\tfz_draw_device *dev = devp->user;\n\tfloat xstep, ystep;\n\tfz_matrix ttm, ctm, shapectm;\n\tfz_irect area, scissor;\n\tfz_rect scissor_tmp;\n\tint x0, y0, x1, y1, x, y;\n\tfz_context *ctx = dev->ctx;\n\tfz_draw_state *state;\n\ttile_record *tile;\n\ttile_key *key;\n\n\tif (dev->top == 0)\n\t{\n\t\tfz_warn(ctx, \"Unexpected end_tile\");\n\t\treturn;\n\t}\n\n\tstate = &dev->stack[--dev->top];\n\tSTACK_PUSHED(\"tile\");\n\txstep = state[1].xstep;\n\tystep = state[1].ystep;\n\tarea = state[1].area;\n\tctm = state[1].ctm;\n\n\t/* Fudge the scissor bbox a little to allow for inaccuracies in the\n\t * matrix inversion. */\n\t/* SumatraPDF: modify calculations to accommodate XPS tiling */\n\tscissor_tmp.x0 = fz_max(state[0].dest->x, state[0].scissor.x0) - state[1].dest->w;\n\tscissor_tmp.y0 = fz_max(state[0].dest->y, state[0].scissor.y0) - state[1].dest->h;\n\tscissor_tmp.x1 = fz_min(state[0].dest->x + state[0].dest->w, state[0].scissor.x1) + state[1].dest->w;\n\tscissor_tmp.y1 = fz_min(state[0].dest->y + state[0].dest->h, state[0].scissor.y1) + state[1].dest->h;\n\tctm.e = state[1].dest->x; ctm.f = state[1].dest->y;\n\tfz_transform_rect(&scissor_tmp, fz_invert_matrix(&ttm, &ctm));\n\tfz_intersect_irect(&area, fz_irect_from_rect(&scissor, &scissor_tmp));\n\n\t/* FIXME: area is a bbox, so FP not appropriate here */\n\t/* In PDF files xstep/ystep can be smaller than view (the area of a\n\t * single tile) (see fts_15_1506.pdf for an example). This means that\n\t * we have to bias the left hand/bottom edge calculations by the\n\t * difference between the step and the width/height of the tile. */\n\t/* scissor, xstep and area are all in pattern space. */\n\tx0 = xstep - scissor.x1 + scissor.x0;\n\tif (x0 > 0)\n\t\tx0 = 0;\n\ty0 = ystep - scissor.y1 + scissor.y0;\n\tif (y0 > 0)\n\t\ty0 = 0;\n\tx0 = floorf((area.x0 + x0) / xstep);\n\ty0 = floorf((area.y0 + y0) / ystep);\n\t/* SumatraPDF: fix rounding issue in pattern_with_extra_q.pdf */\n\tx1 = ceilf(area.x1 / xstep + 0.001f);\n\ty1 = ceilf(area.y1 / ystep + 0.001f);\n\n\tctm.e = state[1].dest->x;\n\tctm.f = state[1].dest->y;\n\tif (state[1].shape)\n\t{\n\t\tshapectm = ctm;\n\t\tshapectm.e = state[1].shape->x;\n\t\tshapectm.f = state[1].shape->y;\n\t}\n\n#ifdef DUMP_GROUP_BLENDS\n\tdump_spaces(dev->top, \"\");\n\tfz_dump_blend(dev->ctx, state[1].dest, \"Tiling \");\n\tif (state[1].shape)\n\t\tfz_dump_blend(dev->ctx, state[1].shape, \"/\");\n\tfz_dump_blend(dev->ctx, state[0].dest, \" onto \");\n\tif (state[0].shape)\n\t\tfz_dump_blend(dev->ctx, state[0].shape, \"/\");\n#endif\n\n\tfor (y = y0; y < y1; y++)\n\t{\n\t\tfor (x = x0; x < x1; x++)\n\t\t{\n\t\t\tttm = ctm;\n\t\t\tfz_pre_translate(&ttm, x * xstep, y * ystep);\n\t\t\tstate[1].dest->x = ttm.e;\n\t\t\tstate[1].dest->y = ttm.f;\n\t\t\tif (state[1].dest->x > 0 && state[1].dest->x + state[1].dest->w < 0)\n\t\t\t\tcontinue;\n\t\t\tif (state[1].dest->y > 0 && state[1].dest->y + state[1].dest->h < 0)\n\t\t\t\tcontinue;\n\t\t\tfz_paint_pixmap_with_bbox(state[0].dest, state[1].dest, 255, state[0].scissor);\n\t\t\tif (state[1].shape)\n\t\t\t{\n\t\t\t\t/* SumatraPDF: dest and shape have the same coordinates during tiling */\n\t\t\t\tassert(ctm.e == shapectm.e && ctm.f == shapectm.f);\n\t\t\t\tstate[1].shape->x = state[1].dest->x;\n\t\t\t\tstate[1].shape->y = state[1].dest->y;\n\t\t\t\tfz_paint_pixmap_with_bbox(state[0].shape, state[1].shape, 255, state[0].scissor);\n\t\t\t}\n\t\t}\n\t}\n\n\tstate[1].dest->x = ctm.e;\n\tstate[1].dest->y = ctm.f;\n\tif (state[1].shape)\n\t{\n\t\tstate[1].shape->x = shapectm.e;\n\t\tstate[1].shape->y = shapectm.f;\n\t}\n\n\t/* Now we try to cache the tiles. Any failure here will just result\n\t * in us not caching. */\n\ttile = NULL;\n\tkey = NULL;\n\tfz_var(tile);\n\tfz_var(key);\n\tfz_try(ctx)\n\t{\n\t\ttile_record *existing_tile;\n\n\t\ttile = fz_new_tile_record(ctx, state[1].dest, state[1].shape);\n\n\t\tkey = fz_malloc_struct(ctx, tile_key);\n\t\tkey->refs = 1;\n\t\tkey->id = state[1].id;\n\t\tkey->ctm[0] = ctm.a;\n\t\tkey->ctm[1] = ctm.b;\n\t\tkey->ctm[2] = ctm.c;\n\t\tkey->ctm[3] = ctm.d;\n\t\texisting_tile = fz_store_item(ctx, key, tile, fz_tile_size(ctx, tile), &fz_tile_store_type);\n\t\tif (existing_tile)\n\t\t{\n\t\t\t/* We already have a tile. This will either have been\n\t\t\t * produced by a racing thread, or there is already\n\t\t\t * an entry for this one in the store. */\n\t\t\tfz_drop_tile_record(ctx, tile);\n\t\t\ttile = existing_tile;\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_tile_key(ctx, key);\n\t\tfz_drop_tile_record(ctx, tile);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\t/* Do nothing */\n\t}\n\n\t/* The following tests should not be required, but just occasionally\n\t * errors can cause the stack to get out of sync, and this might save\n\t * our bacon. */\n\tif (state[0].dest != state[1].dest)\n\t\tfz_drop_pixmap(dev->ctx, state[1].dest);\n\tif (state[0].shape != state[1].shape)\n\t\tfz_drop_pixmap(dev->ctx, state[1].shape);\n#ifdef DUMP_GROUP_BLENDS\n\tfz_dump_blend(dev->ctx, state[0].dest, \" to get \");\n\tif (state[0].shape)\n\t\tfz_dump_blend(dev->ctx, state[0].shape, \"/\");\n\tprintf(\"\\n\");\n#endif\n\n\tif (state->blendmode & FZ_BLEND_KNOCKOUT)\n\t\tfz_knockout_end(dev);\n}\n\n/* SumatraPDF: support transfer functions */\nstatic void\nfz_draw_apply_transfer_function(fz_device *devp, fz_transfer_function *tr, int for_mask)\n{\n\tfz_draw_device *dev = devp->user;\n\tfz_pixmap *dest = dev->stack[dev->top].dest;\n\tunsigned char *s;\n\tint i, n;\n\n\tif (dest->n > 5)\n\t{\n\t\tfz_warn(dev->ctx, \"destination colorspace has more than 4 channels (%d)\", dest->colorspace->n - 1);\n\t\treturn;\n\t}\n#ifdef DUMP_GROUP_BLENDS\n\tdump_spaces(dev->top, \"\");\n\tfz_dump_blend(dev->ctx, dest, \"Transfer function: \");\n#endif\n\ts = dest->samples;\n\tfor (i = 0; i < dest->w * dest->h; i++)\n\t{\n\t\tif (dest->n == 2)\n\t\t\t*s++ = tr->function[3][*s];\n\t\telse if (dest->n > 2)\n\t\t\tfor (n = 0; n < dest->n - 1; n++)\n\t\t\t\t*s++ = tr->function[n][*s];\n\t\tif (for_mask && !dev->stack[dev->top].luminosity)\n\t\t\t*s++ = tr->function[3][*s];\n\t\telse\n\t\t\ts++;\n\t}\n#ifdef DUMP_GROUP_BLENDS\n\tfz_dump_blend(dev->ctx, dest, \" mapped to \");\n\tprintf(\"\\n\");\n#endif\n}\n\nstatic void\nfz_draw_free_user(fz_device *devp)\n{\n\tfz_draw_device *dev = devp->user;\n\tfz_context *ctx = dev->ctx;\n\t/* pop and free the stacks */\n\tif (dev->top > 0)\n\t\tfz_warn(ctx, \"items left on stack in draw device: %d\", dev->top+1);\n\n\twhile(dev->top-- > 0)\n\t{\n\t\tfz_draw_state *state = &dev->stack[dev->top];\n\t\tif (state[1].mask != state[0].mask)\n\t\t\tfz_drop_pixmap(ctx, state[1].mask);\n\t\tif (state[1].dest != state[0].dest)\n\t\t\tfz_drop_pixmap(ctx, state[1].dest);\n\t\tif (state[1].shape != state[0].shape)\n\t\t\tfz_drop_pixmap(ctx, state[1].shape);\n\t}\n\t/* We never free the dest/mask/shape at level 0, as:\n\t * 1) dest is passed in and ownership remains with the caller.\n\t * 2) shape and mask are NULL at level 0.\n\t */\n\tif (dev->stack != &dev->init_stack[0])\n\t\tfz_free(ctx, dev->stack);\n\tfz_free_scale_cache(ctx, dev->cache_x);\n\tfz_free_scale_cache(ctx, dev->cache_y);\n\tfz_free_gel(dev->gel);\n\tfz_free(ctx, dev);\n}\n\nfz_device *\nfz_new_draw_device(fz_context *ctx, fz_pixmap *dest)\n{\n\tfz_device *dev = NULL;\n\tfz_draw_device *ddev = fz_malloc_struct(ctx, fz_draw_device);\n\n\tfz_var(dev);\n\tfz_try(ctx)\n\t{\n\t\tddev->gel = fz_new_gel(ctx);\n\t\tddev->flags = 0;\n\t\tddev->ctx = ctx;\n\t\tddev->top = 0;\n\t\tddev->cache_x = fz_new_scale_cache(ctx);\n\t\tddev->cache_y = fz_new_scale_cache(ctx);\n\t\tddev->stack = &ddev->init_stack[0];\n\t\tddev->stack_cap = STACK_SIZE;\n\t\tddev->stack[0].dest = dest;\n\t\tddev->stack[0].shape = NULL;\n\t\tddev->stack[0].mask = NULL;\n\t\tddev->stack[0].blendmode = 0;\n\t\tddev->stack[0].scissor.x0 = dest->x;\n\t\tddev->stack[0].scissor.y0 = dest->y;\n\t\tddev->stack[0].scissor.x1 = dest->x + dest->w;\n\t\tddev->stack[0].scissor.y1 = dest->y + dest->h;\n\n\t\tdev = fz_new_device(ctx, ddev);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free_scale_cache(ctx, ddev->cache_x);\n\t\tfz_free_scale_cache(ctx, ddev->cache_y);\n\t\tfz_free_gel(ddev->gel);\n\t\tfz_free(ctx, ddev);\n\t\tfz_rethrow(ctx);\n\t}\n\tdev->free_user = fz_draw_free_user;\n\n\tdev->fill_path = fz_draw_fill_path;\n\tdev->stroke_path = fz_draw_stroke_path;\n\tdev->clip_path = fz_draw_clip_path;\n\tdev->clip_stroke_path = fz_draw_clip_stroke_path;\n\n\tdev->fill_text = fz_draw_fill_text;\n\tdev->stroke_text = fz_draw_stroke_text;\n\tdev->clip_text = fz_draw_clip_text;\n\tdev->clip_stroke_text = fz_draw_clip_stroke_text;\n\tdev->ignore_text = fz_draw_ignore_text;\n\n\tdev->fill_image_mask = fz_draw_fill_image_mask;\n\tdev->clip_image_mask = fz_draw_clip_image_mask;\n\tdev->fill_image = fz_draw_fill_image;\n\tdev->fill_shade = fz_draw_fill_shade;\n\n\tdev->pop_clip = fz_draw_pop_clip;\n\n\tdev->begin_mask = fz_draw_begin_mask;\n\tdev->end_mask = fz_draw_end_mask;\n\tdev->begin_group = fz_draw_begin_group;\n\tdev->end_group = fz_draw_end_group;\n\n\tdev->begin_tile = fz_draw_begin_tile;\n\tdev->end_tile = fz_draw_end_tile;\n\n\t/* SumatraPDF: support transfer functions */\n\tdev->apply_transfer_function = fz_draw_apply_transfer_function;\n\n\treturn dev;\n}\n\nfz_device *\nfz_new_draw_device_with_bbox(fz_context *ctx, fz_pixmap *dest, const fz_irect *clip)\n{\n\tfz_device *dev = fz_new_draw_device(ctx, dest);\n\tfz_draw_device *ddev = dev->user;\n\n\tif (clip->x0 > ddev->stack[0].scissor.x0)\n\t\tddev->stack[0].scissor.x0 = clip->x0;\n\tif (clip->x1 < ddev->stack[0].scissor.x1)\n\t\tddev->stack[0].scissor.x1 = clip->x1;\n\tif (clip->y0 > ddev->stack[0].scissor.y0)\n\t\tddev->stack[0].scissor.y0 = clip->y0;\n\tif (clip->y1 < ddev->stack[0].scissor.y1)\n\t\tddev->stack[0].scissor.y1 = clip->y1;\n\treturn dev;\n}\n\nfz_device *\nfz_new_draw_device_type3(fz_context *ctx, fz_pixmap *dest)\n{\n\tfz_device *dev = fz_new_draw_device(ctx, dest);\n\tfz_draw_device *ddev = dev->user;\n\tddev->flags |= FZ_DRAWDEV_FLAGS_TYPE3;\n\treturn dev;\n}\n\nfz_irect *\nfz_bound_path_accurate(fz_context *ctx, fz_irect *bbox, const fz_irect *scissor, fz_path *path, const fz_stroke_state *stroke, const fz_matrix *ctm, float flatness, float linewidth)\n{\n\tfz_gel *gel = fz_new_gel(ctx);\n\n\tfz_reset_gel(gel, scissor);\n\tif (stroke)\n\t{\n\t\tif (stroke->dash_len > 0)\n\t\t\tfz_flatten_dash_path(gel, path, stroke, ctm, flatness, linewidth);\n\t\telse\n\t\t\tfz_flatten_stroke_path(gel, path, stroke, ctm, flatness, linewidth);\n\t}\n\telse\n\t\tfz_flatten_fill_path(gel, path, ctm, flatness);\n\tfz_bound_gel(gel, bbox);\n\tfz_free_gel(gel);\n\n\treturn bbox;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/draw-edge.c",
    "content": "#include \"mupdf/fitz.h\"\n#include \"draw-imp.h\"\n\n#define BBOX_MIN -(1<<20)\n#define BBOX_MAX (1<<20)\n\n/* divide and floor towards -inf */\nstatic inline int fz_idiv(int a, int b)\n{\n\treturn a < 0 ? (a - b + 1) / b : a / b;\n}\n\n/* If AA_BITS is defined, then we assume constant N bits of antialiasing. We\n * will attempt to provide at least that number of bits of accuracy in the\n * antialiasing (to a maximum of 8). If it is defined to be 0 then no\n * antialiasing is done. If it is undefined to we will leave the antialiasing\n * accuracy as a run time choice.\n */\nstruct fz_aa_context_s\n{\n\tint hscale;\n\tint vscale;\n\tint scale;\n\tint bits;\n};\n\nvoid fz_new_aa_context(fz_context *ctx)\n{\n#ifndef AA_BITS\n\tctx->aa = fz_malloc_struct(ctx, fz_aa_context);\n\tctx->aa->hscale = 17;\n\tctx->aa->vscale = 15;\n\tctx->aa->scale = 256;\n\tctx->aa->bits = 8;\n\n#define fz_aa_hscale ((ctxaa)->hscale)\n#define fz_aa_vscale ((ctxaa)->vscale)\n#define fz_aa_scale ((ctxaa)->scale)\n#define fz_aa_bits ((ctxaa)->bits)\n#define AA_SCALE(x) ((x * fz_aa_scale) >> 8)\n\n#endif\n}\n\nvoid fz_copy_aa_context(fz_context *dst, fz_context *src)\n{\n\tif (dst && dst->aa && src && src->aa)\n\t\tmemcpy(dst->aa, src->aa, sizeof(*src->aa));\n}\n\nvoid fz_free_aa_context(fz_context *ctx)\n{\n#ifndef AA_BITS\n\tfz_free(ctx, ctx->aa);\n\tctx->aa = NULL;\n#endif\n}\n\n#ifdef AA_BITS\n\n#if AA_BITS > 6\n#define AA_SCALE(x) (x)\n#define fz_aa_hscale 17\n#define fz_aa_vscale 15\n#define fz_aa_bits 8\n\n#elif AA_BITS > 4\n#define AA_SCALE(x) ((x * 255) >> 6)\n#define fz_aa_hscale 8\n#define fz_aa_vscale 8\n#define fz_aa_bits 6\n\n#elif AA_BITS > 2\n#define AA_SCALE(x) (x * 17)\n#define fz_aa_hscale 5\n#define fz_aa_vscale 3\n#define fz_aa_bits 4\n\n#elif AA_BITS > 0\n#define AA_SCALE(x) ((x * 255) >> 2)\n#define fz_aa_hscale 2\n#define fz_aa_vscale 2\n#define fz_aa_bits 2\n\n#else\n#define AA_SCALE(x) (x * 255)\n#define fz_aa_hscale 1\n#define fz_aa_vscale 1\n#define fz_aa_bits 0\n\n#endif\n#endif\n\nint\nfz_aa_level(fz_context *ctx)\n{\n\tfz_aa_context *ctxaa = ctx->aa;\n\treturn fz_aa_bits;\n}\n\nvoid\nfz_set_aa_level(fz_context *ctx, int level)\n{\n\tfz_aa_context *ctxaa = ctx->aa;\n#ifdef AA_BITS\n\tfz_warn(ctx, \"anti-aliasing was compiled with a fixed precision of %d bits\", fz_aa_bits);\n#else\n\tif (level > 6)\n\t{\n\t\tfz_aa_hscale = 17;\n\t\tfz_aa_vscale = 15;\n\t\tfz_aa_bits = 8;\n\t}\n\telse if (level > 4)\n\t{\n\t\tfz_aa_hscale = 8;\n\t\tfz_aa_vscale = 8;\n\t\tfz_aa_bits = 6;\n\t}\n\telse if (level > 2)\n\t{\n\t\tfz_aa_hscale = 5;\n\t\tfz_aa_vscale = 3;\n\t\tfz_aa_bits = 4;\n\t}\n\telse if (level > 0)\n\t{\n\t\tfz_aa_hscale = 2;\n\t\tfz_aa_vscale = 2;\n\t\tfz_aa_bits = 2;\n\t}\n\telse\n\t{\n\t\tfz_aa_hscale = 1;\n\t\tfz_aa_vscale = 1;\n\t\tfz_aa_bits = 0;\n\t}\n\tfz_aa_scale = 0xFF00 / (fz_aa_hscale * fz_aa_vscale);\n#endif\n}\n\n/*\n * Global Edge List -- list of straight path segments for scan conversion\n *\n * Stepping along the edges is with Bresenham's line algorithm.\n *\n * See Mike Abrash -- Graphics Programming Black Book (notably chapter 40)\n */\n\ntypedef struct fz_edge_s fz_edge;\n\nstruct fz_edge_s\n{\n\tint x, e, h, y;\n\tint adj_up, adj_down;\n\tint xmove;\n\tint xdir, ydir; /* -1 or +1 */\n};\n\nstruct fz_gel_s\n{\n\tfz_rect clip;\n\tfz_irect bbox;\n\tint cap, len;\n\tfz_edge *edges;\n\tint acap, alen;\n\tfz_edge **active;\n\tfz_context *ctx;\n};\n\nfz_gel *\nfz_new_gel(fz_context *ctx)\n{\n\tfz_gel *gel;\n\n\tgel = fz_malloc_struct(ctx, fz_gel);\n\tfz_try(ctx)\n\t{\n\t\tgel->edges = NULL;\n\t\tgel->ctx = ctx;\n\t\tgel->cap = 512;\n\t\tgel->len = 0;\n\t\tgel->edges = fz_malloc_array(ctx, gel->cap, sizeof(fz_edge));\n\n\t\tgel->clip.x0 = gel->clip.y0 = BBOX_MIN;\n\t\tgel->clip.x1 = gel->clip.y1 = BBOX_MAX;\n\n\t\tgel->bbox.x0 = gel->bbox.y0 = BBOX_MAX;\n\t\tgel->bbox.x1 = gel->bbox.y1 = BBOX_MIN;\n\n\t\tgel->acap = 64;\n\t\tgel->alen = 0;\n\t\tgel->active = fz_malloc_array(ctx, gel->acap, sizeof(fz_edge*));\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tif (gel)\n\t\t\tfz_free(ctx, gel->edges);\n\t\tfz_free(ctx, gel);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn gel;\n}\n\nvoid\nfz_reset_gel(fz_gel *gel, const fz_irect *clip)\n{\n\tfz_aa_context *ctxaa = gel->ctx->aa;\n\n\tif (fz_is_infinite_irect(clip))\n\t{\n\t\tgel->clip.x0 = gel->clip.y0 = BBOX_MIN;\n\t\tgel->clip.x1 = gel->clip.y1 = BBOX_MAX;\n\t}\n\telse {\n\t\tgel->clip.x0 = clip->x0 * fz_aa_hscale;\n\t\tgel->clip.x1 = clip->x1 * fz_aa_hscale;\n\t\tgel->clip.y0 = clip->y0 * fz_aa_vscale;\n\t\tgel->clip.y1 = clip->y1 * fz_aa_vscale;\n\t}\n\n\tgel->bbox.x0 = gel->bbox.y0 = BBOX_MAX;\n\tgel->bbox.x1 = gel->bbox.y1 = BBOX_MIN;\n\n\tgel->len = 0;\n\tgel->alen = 0;\n}\n\nvoid\nfz_free_gel(fz_gel *gel)\n{\n\tif (gel == NULL)\n\t\treturn;\n\tfz_free(gel->ctx, gel->active);\n\tfz_free(gel->ctx, gel->edges);\n\tfz_free(gel->ctx, gel);\n}\n\nfz_irect *\nfz_bound_gel(const fz_gel *gel, fz_irect *bbox)\n{\n\tfz_aa_context *ctxaa = gel->ctx->aa;\n\tif (gel->len == 0)\n\t{\n\t\t*bbox = fz_empty_irect;\n\t}\n\telse\n\t{\n\t\tbbox->x0 = fz_idiv(gel->bbox.x0, fz_aa_hscale);\n\t\tbbox->y0 = fz_idiv(gel->bbox.y0, fz_aa_vscale);\n\t\tbbox->x1 = fz_idiv(gel->bbox.x1, fz_aa_hscale) + 1;\n\t\tbbox->y1 = fz_idiv(gel->bbox.y1, fz_aa_vscale) + 1;\n\t}\n\treturn bbox;\n}\n\nfz_rect *\nfz_gel_scissor(const fz_gel *gel, fz_rect *r)\n{\n\tfz_aa_context *ctxaa = gel->ctx->aa;\n\n\tr->x0 = gel->clip.x0 / fz_aa_hscale;\n\tr->x1 = gel->clip.x1 / fz_aa_vscale;\n\tr->y0 = gel->clip.y0 / fz_aa_hscale;\n\tr->y1 = gel->clip.y1 / fz_aa_vscale;\n\n\treturn r;\n}\n\nenum { INSIDE, OUTSIDE, LEAVE, ENTER };\n\n#define clip_lerp_y(v,m,x0,y0,x1,y1,t) clip_lerp_x(v,m,y0,x0,y1,x1,t)\n\nstatic int\nclip_lerp_x(int val, int m, int x0, int y0, int x1, int y1, int *out)\n{\n\tint v0out = m ? x0 > val : x0 < val;\n\tint v1out = m ? x1 > val : x1 < val;\n\n\tif (v0out + v1out == 0)\n\t\treturn INSIDE;\n\n\tif (v0out + v1out == 2)\n\t\treturn OUTSIDE;\n\n\tif (v1out)\n\t{\n\t\t*out = y0 + (int)(((float)(y1 - y0)) * (val - x0) / (x1 - x0));\n\t\treturn LEAVE;\n\t}\n\n\telse\n\t{\n\t\t*out = y1 + (int)(((float)(y0 - y1)) * (val - x1) / (x0 - x1));\n\t\treturn ENTER;\n\t}\n}\n\nstatic void\nfz_insert_gel_raw(fz_gel *gel, int x0, int y0, int x1, int y1)\n{\n\tfz_edge *edge;\n\tint dx, dy;\n\tint winding;\n\tint width;\n\tint tmp;\n\n\tif (y0 == y1)\n\t\treturn;\n\n\tif (y0 > y1) {\n\t\twinding = -1;\n\t\ttmp = x0; x0 = x1; x1 = tmp;\n\t\ttmp = y0; y0 = y1; y1 = tmp;\n\t}\n\telse\n\t\twinding = 1;\n\n\tif (x0 < gel->bbox.x0) gel->bbox.x0 = x0;\n\tif (x0 > gel->bbox.x1) gel->bbox.x1 = x0;\n\tif (x1 < gel->bbox.x0) gel->bbox.x0 = x1;\n\tif (x1 > gel->bbox.x1) gel->bbox.x1 = x1;\n\n\tif (y0 < gel->bbox.y0) gel->bbox.y0 = y0;\n\tif (y1 > gel->bbox.y1) gel->bbox.y1 = y1;\n\n\tif (gel->len + 1 == gel->cap) {\n\t\tint new_cap = gel->cap * 2;\n\t\tgel->edges = fz_resize_array(gel->ctx, gel->edges, new_cap, sizeof(fz_edge));\n\t\tgel->cap = new_cap;\n\t}\n\n\tedge = &gel->edges[gel->len++];\n\n\tdy = y1 - y0;\n\tdx = x1 - x0;\n\twidth = fz_absi(dx);\n\n\tedge->xdir = dx > 0 ? 1 : -1;\n\tedge->ydir = winding;\n\tedge->x = x0;\n\tedge->y = y0;\n\tedge->h = dy;\n\tedge->adj_down = dy;\n\n\t/* initial error term going l->r and r->l */\n\tif (dx >= 0)\n\t\tedge->e = 0;\n\telse\n\t\tedge->e = -dy + 1;\n\n\t/* y-major edge */\n\tif (dy >= width) {\n\t\tedge->xmove = 0;\n\t\tedge->adj_up = width;\n\t}\n\n\t/* x-major edge */\n\telse {\n\t\tedge->xmove = (width / dy) * edge->xdir;\n\t\tedge->adj_up = width % dy;\n\t}\n}\n\nvoid\nfz_insert_gel(fz_gel *gel, float fx0, float fy0, float fx1, float fy1)\n{\n\tint x0, y0, x1, y1;\n\tint d, v;\n\tfz_aa_context *ctxaa = gel->ctx->aa;\n\n\tfx0 = floorf(fx0 * fz_aa_hscale);\n\tfx1 = floorf(fx1 * fz_aa_hscale);\n\tfy0 = floorf(fy0 * fz_aa_vscale);\n\tfy1 = floorf(fy1 * fz_aa_vscale);\n\n\t/* Call fz_clamp so that clamping is done in the float domain, THEN\n\t * cast down to an int. Calling fz_clampi causes problems due to the\n\t * implicit cast down from float to int of the first argument\n\t * over/underflowing and flipping sign at extreme values. */\n\tx0 = (int)fz_clamp(fx0, BBOX_MIN * fz_aa_hscale, BBOX_MAX * fz_aa_hscale);\n\ty0 = (int)fz_clamp(fy0, BBOX_MIN * fz_aa_vscale, BBOX_MAX * fz_aa_vscale);\n\tx1 = (int)fz_clamp(fx1, BBOX_MIN * fz_aa_hscale, BBOX_MAX * fz_aa_hscale);\n\ty1 = (int)fz_clamp(fy1, BBOX_MIN * fz_aa_vscale, BBOX_MAX * fz_aa_vscale);\n\n\td = clip_lerp_y(gel->clip.y0, 0, x0, y0, x1, y1, &v);\n\tif (d == OUTSIDE) return;\n\tif (d == LEAVE) { y1 = gel->clip.y0; x1 = v; }\n\tif (d == ENTER) { y0 = gel->clip.y0; x0 = v; }\n\n\td = clip_lerp_y(gel->clip.y1, 1, x0, y0, x1, y1, &v);\n\tif (d == OUTSIDE) return;\n\tif (d == LEAVE) { y1 = gel->clip.y1; x1 = v; }\n\tif (d == ENTER) { y0 = gel->clip.y1; x0 = v; }\n\n\td = clip_lerp_x(gel->clip.x0, 0, x0, y0, x1, y1, &v);\n\tif (d == OUTSIDE) {\n\t\tx0 = x1 = gel->clip.x0;\n\t}\n\tif (d == LEAVE) {\n\t\tfz_insert_gel_raw(gel, gel->clip.x0, v, gel->clip.x0, y1);\n\t\tx1 = gel->clip.x0;\n\t\ty1 = v;\n\t}\n\tif (d == ENTER) {\n\t\tfz_insert_gel_raw(gel, gel->clip.x0, y0, gel->clip.x0, v);\n\t\tx0 = gel->clip.x0;\n\t\ty0 = v;\n\t}\n\n\td = clip_lerp_x(gel->clip.x1, 1, x0, y0, x1, y1, &v);\n\tif (d == OUTSIDE) {\n\t\tx0 = x1 = gel->clip.x1;\n\t}\n\tif (d == LEAVE) {\n\t\tfz_insert_gel_raw(gel, gel->clip.x1, v, gel->clip.x1, y1);\n\t\tx1 = gel->clip.x1;\n\t\ty1 = v;\n\t}\n\tif (d == ENTER) {\n\t\tfz_insert_gel_raw(gel, gel->clip.x1, y0, gel->clip.x1, v);\n\t\tx0 = gel->clip.x1;\n\t\ty0 = v;\n\t}\n\n\tfz_insert_gel_raw(gel, x0, y0, x1, y1);\n}\n\nstatic int cmpedge(const void *va, const void *vb)\n{\n\tconst fz_edge *a = va;\n\tconst fz_edge *b = vb;\n\treturn a->y - b->y;\n}\n\nvoid\nfz_sort_gel(fz_gel *gel)\n{\n\tfz_edge *a = gel->edges;\n\tint n = gel->len;\n\tint h, i, k;\n\tfz_edge t;\n\n\n\t/* quick sort for long lists */\n\tif (n > 10000)\n\t{\n\t\tqsort(a, n, sizeof *a, cmpedge);\n\t\treturn;\n\t}\n\n\t/* shell sort for short lists */\n\th = 1;\n\tif (n < 14) {\n\t\th = 1;\n\t}\n\telse {\n\t\twhile (h < n)\n\t\t\th = 3 * h + 1;\n\t\th /= 3;\n\t\th /= 3;\n\t}\n\n\twhile (h > 0)\n\t{\n\t\tfor (i = 0; i < n; i++) {\n\t\t\tt = a[i];\n\t\t\tk = i - h;\n\t\t\t/* TODO: sort on y major, x minor */\n\t\t\twhile (k >= 0 && a[k].y > t.y) {\n\t\t\t\ta[k + h] = a[k];\n\t\t\t\tk -= h;\n\t\t\t}\n\t\t\ta[k + h] = t;\n\t\t}\n\t\th /= 3;\n\t}\n}\n\nint\nfz_is_rect_gel(fz_gel *gel)\n{\n\t/* a rectangular path is converted into two vertical edges of identical height */\n\tif (gel->len == 2)\n\t{\n\t\tfz_edge *a = gel->edges + 0;\n\t\tfz_edge *b = gel->edges + 1;\n\t\treturn a->y == b->y && a->h == b->h &&\n\t\t\ta->xmove == 0 && a->adj_up == 0 &&\n\t\t\tb->xmove == 0 && b->adj_up == 0;\n\t}\n\treturn 0;\n}\n\n/*\n * Active Edge List -- keep track of active edges while sweeping\n */\n\nstatic void\nsort_active(fz_edge **a, int n)\n{\n\tint h, i, k;\n\tfz_edge *t;\n\n\th = 1;\n\tif (n < 14) {\n\t\th = 1;\n\t}\n\telse {\n\t\twhile (h < n)\n\t\t\th = 3 * h + 1;\n\t\th /= 3;\n\t\th /= 3;\n\t}\n\n\twhile (h > 0)\n\t{\n\t\tfor (i = 0; i < n; i++) {\n\t\t\tt = a[i];\n\t\t\tk = i - h;\n\t\t\twhile (k >= 0 && a[k]->x > t->x) {\n\t\t\t\ta[k + h] = a[k];\n\t\t\t\tk -= h;\n\t\t\t}\n\t\t\ta[k + h] = t;\n\t\t}\n\n\t\th /= 3;\n\t}\n}\n\nstatic int\ninsert_active(fz_gel *gel, int y, int *e_)\n{\n\tint h_min = INT_MAX;\n\tint e = *e_;\n\n\t/* insert edges that start here */\n\tif (e < gel->len && gel->edges[e].y == y)\n\t{\n\t\tdo {\n\t\t\tif (gel->alen + 1 == gel->acap) {\n\t\t\t\tint newcap = gel->acap + 64;\n\t\t\t\tfz_edge **newactive = fz_resize_array(gel->ctx, gel->active, newcap, sizeof(fz_edge*));\n\t\t\t\tgel->active = newactive;\n\t\t\t\tgel->acap = newcap;\n\t\t\t}\n\t\t\tgel->active[gel->alen++] = &gel->edges[e++];\n\t\t} while (e < gel->len && gel->edges[e].y == y);\n\t\t*e_ = e;\n\t}\n\n\tif (e < gel->len)\n\t\th_min = gel->edges[e].y - y;\n\n\tfor (e=0; e < gel->alen; e++)\n\t{\n\t\tif (gel->active[e]->xmove != 0 || gel->active[e]->adj_up != 0)\n\t\t{\n\t\t\th_min = 1;\n\t\t\tbreak;\n\t\t}\n\t\tif (gel->active[e]->h < h_min)\n\t\t{\n\t\t\th_min = gel->active[e]->h;\n\t\t\tif (h_min == 1)\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/* shell-sort the edges by increasing x */\n\tsort_active(gel->active, gel->alen);\n\n\treturn h_min;\n}\n\nstatic void\nadvance_active(fz_gel *gel, int inc)\n{\n\tfz_edge *edge;\n\tint i = 0;\n\n\twhile (i < gel->alen)\n\t{\n\t\tedge = gel->active[i];\n\n\t\tedge->h -= inc;\n\n\t\t/* terminator! */\n\t\tif (edge->h == 0) {\n\t\t\tgel->active[i] = gel->active[--gel->alen];\n\t\t}\n\n\t\telse {\n\t\t\tedge->x += edge->xmove;\n\t\t\tedge->e += edge->adj_up;\n\t\t\tif (edge->e > 0) {\n\t\t\t\tedge->x += edge->xdir;\n\t\t\t\tedge->e -= edge->adj_down;\n\t\t\t}\n\t\t\ti ++;\n\t\t}\n\t}\n}\n\n/*\n * Anti-aliased scan conversion.\n */\n\nstatic inline void add_span_aa(fz_aa_context *ctxaa, int *list, int x0, int x1, int xofs, int h)\n{\n\tint x0pix, x0sub;\n\tint x1pix, x1sub;\n\n\tif (x0 == x1)\n\t\treturn;\n\n\t/* x between 0 and width of bbox */\n\tx0 -= xofs;\n\tx1 -= xofs;\n\n\t/* The cast to unsigned below helps the compiler produce faster\n\t * code on ARMs as the multiply by reciprocal trick it uses does not\n\t * need to correct for signedness. */\n\tx0pix = ((unsigned int)x0) / fz_aa_hscale;\n\tx0sub = ((unsigned int)x0) % fz_aa_hscale;\n\tx1pix = ((unsigned int)x1) / fz_aa_hscale;\n\tx1sub = ((unsigned int)x1) % fz_aa_hscale;\n\n\tif (x0pix == x1pix)\n\t{\n\t\tlist[x0pix] += h*(x1sub - x0sub);\n\t\tlist[x0pix+1] += h*(x0sub - x1sub);\n\t}\n\n\telse\n\t{\n\t\tlist[x0pix] += h*(fz_aa_hscale - x0sub);\n\t\tlist[x0pix+1] += h*x0sub;\n\t\tlist[x1pix] += h*(x1sub - fz_aa_hscale);\n\t\tlist[x1pix+1] += h*-x1sub;\n\t}\n}\n\nstatic inline void non_zero_winding_aa(fz_gel *gel, int *list, int xofs, int h)\n{\n\tint winding = 0;\n\tint x = 0;\n\tint i;\n\tfz_aa_context *ctxaa = gel->ctx->aa;\n\n\tfor (i = 0; i < gel->alen; i++)\n\t{\n\t\tif (!winding && (winding + gel->active[i]->ydir))\n\t\t\tx = gel->active[i]->x;\n\t\tif (winding && !(winding + gel->active[i]->ydir))\n\t\t\tadd_span_aa(ctxaa, list, x, gel->active[i]->x, xofs, h);\n\t\twinding += gel->active[i]->ydir;\n\t}\n}\n\nstatic inline void even_odd_aa(fz_gel *gel, int *list, int xofs, int h)\n{\n\tint even = 0;\n\tint x = 0;\n\tint i;\n\tfz_aa_context *ctxaa = gel->ctx->aa;\n\n\tfor (i = 0; i < gel->alen; i++)\n\t{\n\t\tif (!even)\n\t\t\tx = gel->active[i]->x;\n\t\telse\n\t\t\tadd_span_aa(ctxaa, list, x, gel->active[i]->x, xofs, h);\n\t\teven = !even;\n\t}\n}\n\nstatic inline void undelta_aa(fz_aa_context *ctxaa, unsigned char * restrict out, int * restrict in, int n)\n{\n\tint d = 0;\n\twhile (n--)\n\t{\n\t\td += *in++;\n\t\t*out++ = AA_SCALE(d);\n\t}\n}\n\nstatic inline void blit_aa(fz_pixmap *dst, int x, int y,\n\tunsigned char *mp, int w, unsigned char *color)\n{\n\tunsigned char *dp;\n\tdp = dst->samples + (unsigned int)(( (y - dst->y) * dst->w + (x - dst->x) ) * dst->n);\n\tif (color)\n\t\tfz_paint_span_with_color(dp, mp, dst->n, w, color);\n\telse\n\t\tfz_paint_span(dp, mp, 1, w, 255);\n}\n\nstatic void\nfz_scan_convert_aa(fz_gel *gel, int eofill, const fz_irect *clip,\n\tfz_pixmap *dst, unsigned char *color)\n{\n\tunsigned char *alphas;\n\tint *deltas;\n\tint y, e;\n\tint yd, yc;\n\tfz_context *ctx = gel->ctx;\n\tfz_aa_context *ctxaa = ctx->aa;\n\tint height, h0, rh;\n\n\tint xmin = fz_idiv(gel->bbox.x0, fz_aa_hscale);\n\tint xmax = fz_idiv(gel->bbox.x1, fz_aa_hscale) + 1;\n\n\tint xofs = xmin * fz_aa_hscale;\n\n\tint skipx = clip->x0 - xmin;\n\tint clipn = clip->x1 - clip->x0;\n\n\tif (gel->len == 0)\n\t\treturn;\n\n\tassert(clip->x0 >= xmin);\n\tassert(clip->x1 <= xmax);\n\n\talphas = fz_malloc_no_throw(ctx, xmax - xmin + 1);\n\tdeltas = fz_malloc_no_throw(ctx, (xmax - xmin + 1) * sizeof(int));\n\tif (alphas == NULL || deltas == NULL)\n\t{\n\t\tfz_free(ctx, alphas);\n\t\tfz_free(ctx, deltas);\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"scan conversion failed (malloc failure)\");\n\t}\n\tmemset(deltas, 0, (xmax - xmin + 1) * sizeof(int));\n\tgel->alen = 0;\n\n\t/* The theory here is that we have a list of the edges (gel) of length\n\t * gel->len. We have an initially empty list of 'active' edges (of\n\t * length gel->alen). As we increase y, we move any edge that is\n\t * active at this point into the active list. We know that any edge\n\t * before index 'e' is either active, or has been retired.\n\t * Once the length of the active list is 0, and e has reached gel->len\n\t * we know we are finished.\n\t *\n\t * As we move through the list, we group fz_aa_vscale 'sub scanlines'\n\t * into single scanlines, and we blit them.\n\t */\n\n\te = 0;\n\ty = gel->edges[0].y;\n\tyd = fz_idiv(y, fz_aa_vscale);\n\n\t/* Quickly skip to the start of the clip region */\n\twhile (yd < clip->y0 && (gel->alen > 0 || e < gel->len))\n\t{\n\t\t/* rh = remaining height = number of subscanlines left to be\n\t\t * inserted into the current scanline, which will be plotted\n\t\t * at yd. */\n\t\trh = (yd+1)*fz_aa_vscale - y;\n\n\t\t/* height = The number of subscanlines with identical edge\n\t\t * positions (i.e. 1 if we have any non vertical edges). */\n\t\theight = insert_active(gel, y, &e);\n\t\th0 = height;\n\t\tif (h0 >= rh)\n\t\t{\n\t\t\t/* We have enough subscanlines to skip to the next\n\t\t\t * scanline. */\n\t\t\th0 -= rh;\n\t\t\tyd++;\n\t\t}\n\t\t/* Skip any whole scanlines we can */\n\t\twhile (yd < clip->y0 && h0 >= fz_aa_vscale)\n\t\t{\n\t\t\th0 -= fz_aa_vscale;\n\t\t\tyd++;\n\t\t}\n\t\t/* If we haven't hit the start of the clip region, then we\n\t\t * have less than a scanline left. */\n\t\tif (yd < clip->y0)\n\t\t{\n\t\t\th0 = 0;\n\t\t}\n\t\theight -= h0;\n\t\tadvance_active(gel, height);\n\n\t\ty += height;\n\t}\n\n\t/* Now do the active lines */\n\twhile (gel->alen > 0 || e < gel->len)\n\t{\n\t\tyc = fz_idiv(y, fz_aa_vscale);\t/* yc = current scanline */\n\t\t/* rh = remaining height = number of subscanlines left to be\n\t\t * inserted into the current scanline, which will be plotted\n\t\t * at yd. */\n\t\trh = (yc+1)*fz_aa_vscale - y;\n\t\tif (yc != yd)\n\t\t{\n\t\t\tundelta_aa(ctxaa, alphas, deltas, skipx + clipn);\n\t\t\tblit_aa(dst, xmin + skipx, yd, alphas + skipx, clipn, color);\n\t\t\tmemset(deltas, 0, (skipx + clipn) * sizeof(int));\n\t\t}\n\t\tyd = yc;\n\t\tif (yd >= clip->y1)\n\t\t\tbreak;\n\n\t\t/* height = The number of subscanlines with identical edge\n\t\t * positions (i.e. 1 if we have any non vertical edges). */\n\t\theight = insert_active(gel, y, &e);\n\t\th0 = height;\n\t\tif (h0 > rh)\n\t\t{\n\t\t\tif (rh < fz_aa_vscale)\n\t\t\t{\n\t\t\t\t/* We have to finish a scanline off, and we\n\t\t\t\t * have more sub scanlines than will fit into\n\t\t\t\t * it. */\n\t\t\t\tif (eofill)\n\t\t\t\t\teven_odd_aa(gel, deltas, xofs, rh);\n\t\t\t\telse\n\t\t\t\t\tnon_zero_winding_aa(gel, deltas, xofs, rh);\n\t\t\t\tundelta_aa(ctxaa, alphas, deltas, skipx + clipn);\n\t\t\t\tblit_aa(dst, xmin + skipx, yd, alphas + skipx, clipn, color);\n\t\t\t\tmemset(deltas, 0, (skipx + clipn) * sizeof(int));\n\t\t\t\tyd++;\n\t\t\t\tif (yd >= clip->y1)\n\t\t\t\t\tbreak;\n\t\t\t\th0 -= rh;\n\t\t\t}\n\t\t\tif (h0 > fz_aa_vscale)\n\t\t\t{\n\t\t\t\t/* Calculate the deltas for any completely full\n\t\t\t\t * scanlines. */\n\t\t\t\th0 -= fz_aa_vscale;\n\t\t\t\tif (eofill)\n\t\t\t\t\teven_odd_aa(gel, deltas, xofs, fz_aa_vscale);\n\t\t\t\telse\n\t\t\t\t\tnon_zero_winding_aa(gel, deltas, xofs, fz_aa_vscale);\n\t\t\t\tundelta_aa(ctxaa, alphas, deltas, skipx + clipn);\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\t/* Do any successive whole scanlines - no need\n\t\t\t\t\t * to recalculate deltas here. */\n\t\t\t\t\tblit_aa(dst, xmin + skipx, yd, alphas + skipx, clipn, color);\n\t\t\t\t\tyd++;\n\t\t\t\t\tif (yd >= clip->y1)\n\t\t\t\t\t\tgoto clip_ended;\n\t\t\t\t\th0 -= fz_aa_vscale;\n\t\t\t\t}\n\t\t\t\twhile (h0 > 0);\n\t\t\t\t/* If we have exactly one full scanline left\n\t\t\t\t * to go, then the deltas/alphas are set up\n\t\t\t\t * already. */\n\t\t\t\tif (h0 == 0)\n\t\t\t\t\tgoto advance;\n\t\t\t\tmemset(deltas, 0, (skipx + clipn) * sizeof(int));\n\t\t\t\th0 += fz_aa_vscale;\n\t\t\t}\n\t\t}\n\t\tif (eofill)\n\t\t\teven_odd_aa(gel, deltas, xofs, h0);\n\t\telse\n\t\t\tnon_zero_winding_aa(gel, deltas, xofs, h0);\nadvance:\n\t\tadvance_active(gel, height);\n\n\t\ty += height;\n\t}\n\n\tif (yd < clip->y1)\n\t{\n\t\tundelta_aa(ctxaa, alphas, deltas, skipx + clipn);\n\t\tblit_aa(dst, xmin + skipx, yd, alphas + skipx, clipn, color);\n\t}\nclip_ended:\n\tfz_free(ctx, deltas);\n\tfz_free(ctx, alphas);\n}\n\n/*\n * Sharp (not anti-aliased) scan conversion\n */\n\nstatic inline void blit_sharp(int x0, int x1, int y,\n\tconst fz_irect *clip, fz_pixmap *dst, unsigned char *color)\n{\n\tunsigned char *dp;\n\tx0 = fz_clampi(x0, dst->x, dst->x + dst->w);\n\tx1 = fz_clampi(x1, dst->x, dst->x + dst->w);\n\tif (x0 < x1)\n\t{\n\t\tdp = dst->samples + (unsigned int)(( (y - dst->y) * dst->w + (x0 - dst->x) ) * dst->n);\n\t\tif (color)\n\t\t\tfz_paint_solid_color(dp, dst->n, x1 - x0, color);\n\t\telse\n\t\t\tfz_paint_solid_alpha(dp, x1 - x0, 255);\n\t}\n}\n\nstatic inline void non_zero_winding_sharp(fz_gel *gel, int y,\n\tconst fz_irect *clip, fz_pixmap *dst, unsigned char *color)\n{\n\tint winding = 0;\n\tint x = 0;\n\tint i;\n\tfor (i = 0; i < gel->alen; i++)\n\t{\n\t\tif (!winding && (winding + gel->active[i]->ydir))\n\t\t\tx = gel->active[i]->x;\n\t\tif (winding && !(winding + gel->active[i]->ydir))\n\t\t\tblit_sharp(x, gel->active[i]->x, y, clip, dst, color);\n\t\twinding += gel->active[i]->ydir;\n\t}\n}\n\nstatic inline void even_odd_sharp(fz_gel *gel, int y,\n\tconst fz_irect *clip, fz_pixmap *dst, unsigned char *color)\n{\n\tint even = 0;\n\tint x = 0;\n\tint i;\n\tfor (i = 0; i < gel->alen; i++)\n\t{\n\t\tif (!even)\n\t\t\tx = gel->active[i]->x;\n\t\telse\n\t\t\tblit_sharp(x, gel->active[i]->x, y, clip, dst, color);\n\t\teven = !even;\n\t}\n}\n\nstatic void\nfz_scan_convert_sharp(fz_gel *gel, int eofill, const fz_irect *clip,\n\tfz_pixmap *dst, unsigned char *color)\n{\n\tint e = 0;\n\tint y = gel->edges[0].y;\n\tint height;\n\n\tgel->alen = 0;\n\n\t/* Skip any lines before the clip region */\n\tif (y < clip->y0)\n\t{\n\t\twhile (gel->alen > 0 || e < gel->len)\n\t\t{\n\t\t\theight = insert_active(gel, y, &e);\n\t\t\ty += height;\n\t\t\tif (y >= clip->y0)\n\t\t\t{\n\t\t\t\ty = clip->y0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Now process as lines within the clip region */\n\twhile (gel->alen > 0 || e < gel->len)\n\t{\n\t\theight = insert_active(gel, y, &e);\n\n\t\tif (gel->alen == 0)\n\t\t\ty += height;\n\t\telse\n\t\t{\n\t\t\tint h;\n\t\t\tif (height >= clip->y1 - y)\n\t\t\t\theight = clip->y1 - y;\n\n\t\t\th = height;\n\t\t\twhile (h--)\n\t\t\t{\n\t\t\t\tif (eofill)\n\t\t\t\t\teven_odd_sharp(gel, y, clip, dst, color);\n\t\t\t\telse\n\t\t\t\t\tnon_zero_winding_sharp(gel, y, clip, dst, color);\n\t\t\t\ty++;\n\t\t\t}\n\t\t}\n\t\tif (y >= clip->y1)\n\t\t\tbreak;\n\n\t\tadvance_active(gel, height);\n\t}\n}\n\nvoid\nfz_scan_convert(fz_gel *gel, int eofill, const fz_irect *clip,\n\tfz_pixmap *dst, unsigned char *color)\n{\n\tfz_aa_context *ctxaa = gel->ctx->aa;\n\tfz_irect local_clip;\n\n\tif (fz_is_empty_irect(fz_intersect_irect(fz_pixmap_bbox_no_ctx(dst, &local_clip), clip)))\n\t\treturn;\n\n\tif (fz_aa_bits > 0)\n\t\tfz_scan_convert_aa(gel, eofill, &local_clip, dst, color);\n\telse\n\t\tfz_scan_convert_sharp(gel, eofill, &local_clip, dst, color);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/draw-glyph.c",
    "content": "#include \"mupdf/fitz.h\"\n#include \"draw-imp.h\"\n\n#define MAX_GLYPH_SIZE 256\n#define MAX_CACHE_SIZE (1024*1024)\n\n#define GLYPH_HASH_LEN 509\n\ntypedef struct fz_glyph_cache_entry_s fz_glyph_cache_entry;\ntypedef struct fz_glyph_key_s fz_glyph_key;\n\nstruct fz_glyph_key_s\n{\n\tfz_font *font;\n\tint a, b;\n\tint c, d;\n\tunsigned short gid;\n\tunsigned char e, f;\n\tint aa;\n};\n\nstruct fz_glyph_cache_entry_s\n{\n\tfz_glyph_key key;\n\tunsigned hash;\n\tfz_glyph_cache_entry *lru_prev;\n\tfz_glyph_cache_entry *lru_next;\n\tfz_glyph_cache_entry *bucket_next;\n\tfz_glyph_cache_entry *bucket_prev;\n\tfz_glyph *val;\n};\n\nstruct fz_glyph_cache_s\n{\n\tint refs;\n\tint total;\n#ifndef NDEBUG\n\tint num_evictions;\n\tint evicted;\n#endif\n\tfz_glyph_cache_entry *entry[GLYPH_HASH_LEN];\n\tfz_glyph_cache_entry *lru_head;\n\tfz_glyph_cache_entry *lru_tail;\n};\n\nvoid\nfz_new_glyph_cache_context(fz_context *ctx)\n{\n\tfz_glyph_cache *cache;\n\n\tcache = fz_malloc_struct(ctx, fz_glyph_cache);\n\tcache->total = 0;\n\tcache->refs = 1;\n\n\tctx->glyph_cache = cache;\n}\n\nstatic void\ndrop_glyph_cache_entry(fz_context *ctx, fz_glyph_cache_entry *entry)\n{\n\tfz_glyph_cache *cache = ctx->glyph_cache;\n\n\tif (entry->lru_next)\n\t\tentry->lru_next->lru_prev = entry->lru_prev;\n\telse\n\t\tcache->lru_tail = entry->lru_prev;\n\tif (entry->lru_prev)\n\t\tentry->lru_prev->lru_next = entry->lru_next;\n\telse\n\t\tcache->lru_head = entry->lru_next;\n\tcache->total -= fz_glyph_size(ctx, entry->val);\n\tif (entry->bucket_next)\n\t\tentry->bucket_next->bucket_prev = entry->bucket_prev;\n\tif (entry->bucket_prev)\n\t\tentry->bucket_prev->bucket_next = entry->bucket_next;\n\telse\n\t\tcache->entry[entry->hash] = entry->bucket_next;\n\tfz_drop_font(ctx, entry->key.font);\n\tfz_drop_glyph(ctx, entry->val);\n\tfz_free(ctx, entry);\n}\n\n/* The glyph cache lock is always held when this function is called. */\nstatic void\ndo_purge(fz_context *ctx)\n{\n\tfz_glyph_cache *cache = ctx->glyph_cache;\n\tint i;\n\n\tfor (i = 0; i < GLYPH_HASH_LEN; i++)\n\t{\n\t\twhile (cache->entry[i])\n\t\t\tdrop_glyph_cache_entry(ctx, cache->entry[i]);\n\t}\n\n\tcache->total = 0;\n}\n\nvoid\nfz_purge_glyph_cache(fz_context *ctx)\n{\n\tfz_lock(ctx, FZ_LOCK_GLYPHCACHE);\n\tdo_purge(ctx);\n\tfz_unlock(ctx, FZ_LOCK_GLYPHCACHE);\n}\n\nvoid\nfz_drop_glyph_cache_context(fz_context *ctx)\n{\n\tif (!ctx->glyph_cache)\n\t\treturn;\n\n\tfz_lock(ctx, FZ_LOCK_GLYPHCACHE);\n\tctx->glyph_cache->refs--;\n\tif (ctx->glyph_cache->refs == 0)\n\t{\n\t\tdo_purge(ctx);\n\t\tfz_free(ctx, ctx->glyph_cache);\n\t\tctx->glyph_cache = NULL;\n\t}\n\tfz_unlock(ctx, FZ_LOCK_GLYPHCACHE);\n}\n\nfz_glyph_cache *\nfz_keep_glyph_cache(fz_context *ctx)\n{\n\tfz_lock(ctx, FZ_LOCK_GLYPHCACHE);\n\tctx->glyph_cache->refs++;\n\tfz_unlock(ctx, FZ_LOCK_GLYPHCACHE);\n\treturn ctx->glyph_cache;\n}\n\nfloat\nfz_subpixel_adjust(fz_matrix *ctm, fz_matrix *subpix_ctm, unsigned char *qe, unsigned char *qf)\n{\n\tfloat size = fz_matrix_expansion(ctm);\n\tint q;\n\tfloat pix_e, pix_f, r;\n\n\t/* Quantise the subpixel positions. */\n\t/* We never need more than 4 subpixel positions for glyphs - arguably\n\t * even that is too much. */\n\tif (size >= 48)\n\t\tq = 0, r = 0.5f;\n\telse if (size >= 24)\n\t\tq = 128, r = 0.25f;\n\telse\n\t\tq = 192, r = 0.125f;\n\n\t/* Split translation into pixel and subpixel parts */\n\tsubpix_ctm->a = ctm->a;\n\tsubpix_ctm->b = ctm->b;\n\tsubpix_ctm->c = ctm->c;\n\tsubpix_ctm->d = ctm->d;\n\tsubpix_ctm->e = ctm->e + r;\n\tpix_e = floorf(subpix_ctm->e);\n\tsubpix_ctm->e -= pix_e;\n\tsubpix_ctm->f = ctm->f + r;\n\tpix_f = floorf(subpix_ctm->f);\n\tsubpix_ctm->f -= pix_f;\n\n\t/* Quantise the subpixel part */\n\t*qe = (int)(subpix_ctm->e * 256) & q;\n\tsubpix_ctm->e = *qe / 256.0f;\n\t*qf = (int)(subpix_ctm->f * 256) & q;\n\tsubpix_ctm->f = *qf / 256.0f;\n\n\t/* Reassemble the complete translation */\n\tctm->e = subpix_ctm->e + pix_e;\n\tctm->f = subpix_ctm->f + pix_f;\n\n\treturn size;\n}\n\nfz_glyph *\nfz_render_stroked_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix *trm, const fz_matrix *ctm, fz_stroke_state *stroke, const fz_irect *scissor)\n{\n\tif (font->ft_face)\n\t{\n\t\tfz_matrix subpix_trm;\n\t\tunsigned char qe, qf;\n\n\t\tif (stroke->dash_len > 0)\n\t\t\treturn NULL;\n\t\t(void)fz_subpixel_adjust(trm, &subpix_trm, &qe, &qf);\n\t\treturn fz_render_ft_stroked_glyph(ctx, font, gid, &subpix_trm, ctm, stroke);\n\t}\n\treturn fz_render_glyph(ctx, font, gid, trm, NULL, scissor);\n}\n\nfz_pixmap *\nfz_render_stroked_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, fz_matrix *trm, const fz_matrix *ctm, fz_stroke_state *stroke, const fz_irect *scissor)\n{\n\tif (font->ft_face)\n\t{\n\t\tfz_matrix subpix_trm;\n\t\tunsigned char qe, qf;\n\n\t\tif (stroke->dash_len > 0)\n\t\t\treturn NULL;\n\t\t(void)fz_subpixel_adjust(trm, &subpix_trm, &qe, &qf);\n\t\treturn fz_render_ft_stroked_glyph_pixmap(ctx, font, gid, &subpix_trm, ctm, stroke);\n\t}\n\treturn fz_render_glyph_pixmap(ctx, font, gid, trm, NULL, scissor);\n}\n\nstatic unsigned do_hash(unsigned char *s, int len)\n{\n\tunsigned val = 0;\n\tint i;\n\tfor (i = 0; i < len; i++)\n\t{\n\t\tval += s[i];\n\t\tval += (val << 10);\n\t\tval ^= (val >> 6);\n\t}\n\tval += (val << 3);\n\tval ^= (val >> 11);\n\tval += (val << 15);\n\treturn val;\n}\n\nstatic inline void\nmove_to_front(fz_glyph_cache *cache, fz_glyph_cache_entry *entry)\n{\n\tif (entry->lru_prev == NULL)\n\t\treturn; /* At front already */\n\n\t/* Unlink */\n\tentry->lru_prev->lru_next = entry->lru_next;\n\tif (entry->lru_next)\n\t\tentry->lru_next->lru_prev = entry->lru_prev;\n\telse\n\t\tcache->lru_tail = entry->lru_prev;\n\t/* Relink */\n\tentry->lru_next = cache->lru_head;\n\tif (entry->lru_next)\n\t\tentry->lru_next->lru_prev = entry;\n\tcache->lru_head = entry;\n\tentry->lru_prev = NULL;\n}\n\nfz_glyph *\nfz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix *ctm, fz_colorspace *model, const fz_irect *scissor)\n{\n\tfz_glyph_cache *cache;\n\tfz_glyph_key key;\n\tfz_matrix subpix_ctm;\n\tfz_irect subpix_scissor;\n\tfloat size;\n\tfz_glyph *val;\n\tint do_cache, locked, caching;\n\tfz_glyph_cache_entry *entry;\n\tunsigned hash;\n\n\tfz_var(locked);\n\tfz_var(caching);\n\tfz_var(val);\n\n\tmemset(&key, 0, sizeof key);\n\tsize = fz_subpixel_adjust(ctm, &subpix_ctm, &key.e, &key.f);\n\tif (size <= MAX_GLYPH_SIZE)\n\t{\n\t\tscissor = &fz_infinite_irect;\n\t\tdo_cache = 1;\n\t}\n\telse\n\t{\n\t\t/* SumatraPDF: don't break clipping by larger glyphs */\n\t\tif (font->ft_face && size > 3000)\n\t\t\treturn NULL;\n\t\tsubpix_scissor.x0 = scissor->x0 - floorf(ctm->e);\n\t\tsubpix_scissor.y0 = scissor->y0 - floorf(ctm->f);\n\t\tsubpix_scissor.x1 = scissor->x1 - floorf(ctm->e);\n\t\tsubpix_scissor.y1 = scissor->y1 - floorf(ctm->f);\n\t\tscissor = &subpix_scissor;\n\t\tdo_cache = 0;\n\t}\n\n\tcache = ctx->glyph_cache;\n\n\tkey.font = font;\n\tkey.gid = gid;\n\tkey.a = subpix_ctm.a * 65536;\n\tkey.b = subpix_ctm.b * 65536;\n\tkey.c = subpix_ctm.c * 65536;\n\tkey.d = subpix_ctm.d * 65536;\n\tkey.aa = fz_aa_level(ctx);\n\n\tfz_lock(ctx, FZ_LOCK_GLYPHCACHE);\n\thash = do_hash((unsigned char *)&key, sizeof(key)) % GLYPH_HASH_LEN;\n\tentry = cache->entry[hash];\n\twhile (entry)\n\t{\n\t\tif (memcmp(&entry->key, &key, sizeof(key)) == 0)\n\t\t{\n\t\t\tmove_to_front(cache, entry);\n\t\t\tval = fz_keep_glyph(ctx, entry->val);\n\t\t\tfz_unlock(ctx, FZ_LOCK_GLYPHCACHE);\n\t\t\treturn val;\n\t\t}\n\t\tentry = entry->bucket_next;\n\t}\n\n\tlocked = 1;\n\tcaching = 0;\n\tval = NULL;\n\n\tfz_try(ctx)\n\t{\n\t\tif (font->ft_face)\n\t\t{\n\t\t\tval = fz_render_ft_glyph(ctx, font, gid, &subpix_ctm, key.aa);\n\t\t}\n\t\telse if (font->t3procs)\n\t\t{\n\t\t\t/* We drop the glyphcache here, and execute the t3\n\t\t\t * glyph code. The danger here is that some other\n\t\t\t * thread will come along, and want the same glyph\n\t\t\t * too. If it does, we may both end up rendering\n\t\t\t * pixmaps. We cope with this later on, by ensuring\n\t\t\t * that only one gets inserted into the cache. If\n\t\t\t * we insert ours to find one already there, we\n\t\t\t * abandon ours, and use the one there already.\n\t\t\t */\n\t\t\tfz_unlock(ctx, FZ_LOCK_GLYPHCACHE);\n\t\t\tlocked = 0;\n\t\t\tval = fz_render_t3_glyph(ctx, font, gid, &subpix_ctm, model, scissor);\n\t\t\tfz_lock(ctx, FZ_LOCK_GLYPHCACHE);\n\t\t\tlocked = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_warn(ctx, \"assert: uninitialized font structure\");\n\t\t}\n\t\tif (val && do_cache)\n\t\t{\n\t\t\tif (val->w < MAX_GLYPH_SIZE && val->h < MAX_GLYPH_SIZE)\n\t\t\t{\n\t\t\t\t/* If we throw an exception whilst caching,\n\t\t\t\t * just ignore the exception and carry on. */\n\t\t\t\tcaching = 1;\n\t\t\t\tif (!font->ft_face)\n\t\t\t\t{\n\t\t\t\t\t/* We had to unlock. Someone else might\n\t\t\t\t\t * have rendered in the meantime */\n\t\t\t\t\tentry = cache->entry[hash];\n\t\t\t\t\twhile (entry)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (memcmp(&entry->key, &key, sizeof(key)) == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfz_drop_glyph(ctx, val);\n\t\t\t\t\t\t\tmove_to_front(cache, entry);\n\t\t\t\t\t\t\tval = fz_keep_glyph(ctx, entry->val);\n\t\t\t\t\t\t\tgoto unlock_and_return_val;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tentry = entry->bucket_next;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tentry = fz_malloc_struct(ctx, fz_glyph_cache_entry);\n\t\t\t\tentry->key = key;\n\t\t\t\tentry->hash = hash;\n\t\t\t\tentry->bucket_next = cache->entry[hash];\n\t\t\t\tif (entry->bucket_next)\n\t\t\t\t\tentry->bucket_next->bucket_prev = entry;\n\t\t\t\tcache->entry[hash] = entry;\n\t\t\t\tentry->val = fz_keep_glyph(ctx, val);\n\t\t\t\tfz_keep_font(ctx, key.font);\n\n\t\t\t\tentry->lru_next = cache->lru_head;\n\t\t\t\tif (entry->lru_next)\n\t\t\t\t\tentry->lru_next->lru_prev = entry;\n\t\t\t\telse\n\t\t\t\t\tcache->lru_tail = entry;\n\t\t\t\tcache->lru_head = entry;\n\n\t\t\t\tcache->total += fz_glyph_size(ctx, val);\n\t\t\t\twhile (cache->total > MAX_CACHE_SIZE)\n\t\t\t\t{\n#ifndef NDEBUG\n\t\t\t\t\tcache->num_evictions++;\n\t\t\t\t\tcache->evicted += fz_glyph_size(ctx, cache->lru_tail->val);\n#endif\n\t\t\t\t\tdrop_glyph_cache_entry(ctx, cache->lru_tail);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\nunlock_and_return_val:\n\t\t{\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tif (locked)\n\t\t\tfz_unlock(ctx, FZ_LOCK_GLYPHCACHE);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tif (caching)\n\t\t\tfz_warn(ctx, \"cannot encache glyph; continuing\");\n\t\telse\n\t\t\tfz_rethrow(ctx);\n\t}\n\n\treturn val;\n}\n\nfz_pixmap *\nfz_render_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, fz_matrix *ctm, fz_colorspace *model, const fz_irect *scissor)\n{\n\tfz_pixmap *val;\n\tunsigned char qe, qf;\n\tfz_matrix subpix_ctm;\n\tfloat size = fz_subpixel_adjust(ctm, &subpix_ctm, &qe, &qf);\n\n\tif (size <= MAX_GLYPH_SIZE)\n\t{\n\t\tscissor = &fz_infinite_irect;\n\t}\n\telse\n\t{\n\t\tif (font->ft_face)\n\t\t\treturn NULL;\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tif (font->ft_face)\n\t\t{\n\t\t\tval = fz_render_ft_glyph_pixmap(ctx, font, gid, &subpix_ctm, fz_aa_level(ctx));\n\t\t}\n\t\telse if (font->t3procs)\n\t\t{\n\t\t\tval = fz_render_t3_glyph_pixmap(ctx, font, gid, &subpix_ctm, model, scissor);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_warn(ctx, \"assert: uninitialized font structure\");\n\t\t\tval = NULL;\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn val;\n}\n\nvoid\nfz_dump_glyph_cache_stats(fz_context *ctx)\n{\n\tfz_glyph_cache *cache = ctx->glyph_cache;\n\n\tprintf(\"Glyph Cache Size: %d\\n\", cache->total);\n#ifndef NDEBUG\n\tprintf(\"Glyph Cache Evictions: %d (%d bytes)\\n\", cache->num_evictions, cache->evicted);\n#endif\n}\n"
  },
  {
    "path": "mupdf/source/fitz/draw-imp.h",
    "content": "#ifndef MUPDF_DRAW_IMP_H\n#define MUPDF_DRAW_IMP_H\n\n/*\n * Scan converter\n */\n\ntypedef struct fz_gel_s fz_gel;\n\nfz_gel *fz_new_gel(fz_context *ctx);\nvoid fz_insert_gel(fz_gel *gel, float x0, float y0, float x1, float y1);\nvoid fz_reset_gel(fz_gel *gel, const fz_irect *clip);\nvoid fz_sort_gel(fz_gel *gel);\nfz_irect *fz_bound_gel(const fz_gel *gel, fz_irect *bbox);\nvoid fz_free_gel(fz_gel *gel);\nint fz_is_rect_gel(fz_gel *gel);\nfz_rect *fz_gel_scissor(const fz_gel *gel, fz_rect *rect);\n\nvoid fz_scan_convert(fz_gel *gel, int eofill, const fz_irect *clip, fz_pixmap *pix, unsigned char *colorbv);\n\nvoid fz_flatten_fill_path(fz_gel *gel, fz_path *path, const fz_matrix *ctm, float flatness);\nvoid fz_flatten_stroke_path(fz_gel *gel, fz_path *path, const fz_stroke_state *stroke, const fz_matrix *ctm, float flatness, float linewidth);\nvoid fz_flatten_dash_path(fz_gel *gel, fz_path *path, const fz_stroke_state *stroke, const fz_matrix *ctm, float flatness, float linewidth);\n\nfz_irect *fz_bound_path_accurate(fz_context *ctx, fz_irect *bbox, const fz_irect *scissor, fz_path *path, const fz_stroke_state *stroke, const fz_matrix *ctm, float flatness, float linewidth);\n\n/*\n * Plotting functions.\n */\n\nvoid fz_paint_solid_alpha(unsigned char * restrict dp, int w, int alpha);\nvoid fz_paint_solid_color(unsigned char * restrict dp, int n, int w, unsigned char *color);\n\nvoid fz_paint_span(unsigned char * restrict dp, unsigned char * restrict sp, int n, int w, int alpha);\nvoid fz_paint_span_with_color(unsigned char * restrict dp, unsigned char * restrict mp, int n, int w, unsigned char *color);\n\nvoid fz_paint_image(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz_pixmap *img, const fz_matrix *ctm, int alpha, int lerp_allowed);\nvoid fz_paint_image_with_color(fz_pixmap *dst, const fz_irect *scissor, fz_pixmap *shape, fz_pixmap *img, const fz_matrix *ctm, unsigned char *colorbv, int lerp_allowed);\n\nvoid fz_paint_pixmap(fz_pixmap *dst, fz_pixmap *src, int alpha);\nvoid fz_paint_pixmap_with_mask(fz_pixmap *dst, fz_pixmap *src, fz_pixmap *msk);\nvoid fz_paint_pixmap_with_bbox(fz_pixmap *dst, fz_pixmap *src, int alpha, fz_irect bbox);\n\nvoid fz_blend_pixmap(fz_pixmap *dst, fz_pixmap *src, int alpha, int blendmode, int isolated, fz_pixmap *shape);\nvoid fz_blend_pixel(unsigned char dp[3], unsigned char bp[3], unsigned char sp[3], int blendmode);\n\nvoid fz_paint_glyph(unsigned char *colorbv, fz_pixmap *dst, unsigned char *dp, fz_glyph *glyph, int w, int h, int skip_x, int skip_y);\n\n#endif\n"
  },
  {
    "path": "mupdf/source/fitz/draw-mesh.c",
    "content": "#include \"mupdf/fitz.h\"\n#include \"draw-imp.h\"\n\nenum { MAXN = 2 + FZ_MAX_COLORS };\n\nstatic void paint_scan(fz_pixmap *restrict pix, int y, int fx0, int fx1, int cx0, int cx1, const int *restrict v0, const int *restrict v1, int n)\n{\n\tunsigned char *p;\n\tint c[MAXN], dc[MAXN];\n\tint k, w;\n\tfloat div, mul;\n\tint x0, x1;\n\n\t/* Ensure that fx0 is left edge, and fx1 is right */\n\tif (fx0 > fx1)\n\t{\n\t\tconst int *v;\n\t\tint t = fx0; fx0 = fx1; fx1 = t;\n\t\tv = v0; v0 = v1; v1 = v;\n\t}\n\telse if (fx0 == fx1)\n\t\treturn;\n\n\t/* Clip fx0, fx1 to range */\n\tif (fx0 >= cx1)\n\t\treturn;\n\tif (fx1 <= cx0)\n\t\treturn;\n\tx0 = (fx0 > cx0 ? fx0 : cx0);\n\tx1 = (fx1 < cx1 ? fx1 : cx1);\n\n\tw = x1 - x0;\n\tif (w == 0)\n\t\treturn;\n\n\tdiv = 1.0f / (fx1 - fx0);\n\tmul = (x0 - fx0);\n\tfor (k = 0; k < n; k++)\n\t{\n\t\tdc[k] = (v1[k] - v0[k]) * div;\n\t\tc[k] = v0[k] + dc[k] * mul;\n\t}\n\n\tp = pix->samples + ((x0 - pix->x) + (y - pix->y) * pix->w) * pix->n;\n\twhile (w--)\n\t{\n\t\tfor (k = 0; k < n; k++)\n\t\t{\n\t\t\t*p++ = c[k]>>16;\n\t\t\tc[k] += dc[k];\n\t\t}\n\t\t*p++ = 255;\n\t}\n}\n\ntypedef struct edge_data_s edge_data;\n\nstruct edge_data_s\n{\n\tfloat x;\n\tfloat dx;\n\tint v[2*MAXN];\n};\n\nstatic inline void prepare_edge(const float *restrict vtop, const float *restrict vbot, edge_data *restrict edge, float y, int n)\n{\n\tfloat r = 1.0f / (vbot[1] - vtop[1]);\n\tfloat t = (y - vtop[1]) * r;\n\tfloat diff = vbot[0] - vtop[0];\n\tint i;\n\n\tedge->x = vtop[0] + diff * t;\n\tedge->dx = diff * r;\n\n\tfor (i = 0; i < n; i++)\n\t{\n\t\tdiff = vbot[i+2] - vtop[i+2];\n\t\tedge->v[i] = (int)(65536.0f * (vtop[i+2] + diff * t));\n\t\tedge->v[i+MAXN] = (int)(65536.0f * diff * r);\n\t}\n}\n\nstatic inline void step_edge(edge_data *edge, int n)\n{\n\tint i;\n\n\tedge->x += edge->dx;\n\n\tfor (i = 0; i < n; i++)\n\t{\n\t\tedge->v[i] += edge->v[i + MAXN];\n\t}\n}\n\nstatic void\nfz_paint_triangle(fz_pixmap *pix, float *v[3], int n, const fz_irect *bbox)\n{\n\tedge_data e0, e1;\n\tint top, mid, bot;\n\tfloat y, y1;\n\tint minx, maxx;\n\n\ttop = bot = 0;\n\tif (v[1][1] < v[0][1]) top = 1; else bot = 1;\n\tif (v[2][1] < v[top][1]) top = 2;\n\telse if (v[2][1] > v[bot][1]) bot = 2;\n\tif (v[top][1] == v[bot][1]) return;\n\n\t/* Test if the triangle is completely outside the scissor rect */\n\tif (v[bot][1] < bbox->y0) return;\n\tif (v[top][1] > bbox->y1) return;\n\n\t/* Magic! Ensure that mid/top/bot are all different */\n\tmid = 3^top^bot;\n\n\tassert(top != bot && top != mid && mid != bot);\n\n\tminx = fz_maxi(bbox->x0, pix->x);\n\tmaxx = fz_mini(bbox->x1, pix->x + pix->w);\n\n\ty = ceilf(fz_max(bbox->y0, v[top][1]));\n\ty1 = ceilf(fz_min(bbox->y1, v[mid][1]));\n\n\tn -= 2;\n\tprepare_edge(v[top], v[bot], &e0, y, n);\n\tif (y < y1)\n\t{\n\t\tprepare_edge(v[top], v[mid], &e1, y, n);\n\n\t\tdo\n\t\t{\n\t\t\tpaint_scan(pix, y, (int)e0.x, (int)e1.x, minx, maxx, &e0.v[0], &e1.v[0], n);\n\t\t\tstep_edge(&e0, n);\n\t\t\tstep_edge(&e1, n);\n\t\t\ty ++;\n\t\t}\n\t\twhile (y < y1);\n\t}\n\n\ty1 = ceilf(fz_min(bbox->y1, v[bot][1]));\n\tif (y < y1)\n\t{\n\t\tprepare_edge(v[mid], v[bot], &e1, y, n);\n\n\t\tdo\n\t\t{\n\t\t\tpaint_scan(pix, y, (int)e0.x, (int)e1.x, minx, maxx, &e0.v[0], &e1.v[0], n);\n\t\t\ty ++;\n\t\t\tif (y >= y1)\n\t\t\t\tbreak;\n\t\t\tstep_edge(&e0, n);\n\t\t\tstep_edge(&e1, n);\n\t\t}\n\t\twhile (1);\n\t}\n}\n\nstruct paint_tri_data\n{\n\tfz_context *ctx;\n\tfz_shade *shade;\n\tfz_pixmap *dest;\n\tconst fz_irect *bbox;\n\tfz_color_converter cc;\n};\n\nstatic void\nprepare_vertex(void *arg, fz_vertex *v, const float *input)\n{\n\tstruct paint_tri_data *ptd = (struct paint_tri_data *)arg;\n\tfz_shade *shade = ptd->shade;\n\tfz_pixmap *dest = ptd->dest;\n\tfloat *output = v->c;\n\tint i;\n\n\tif (shade->use_function)\n\t\toutput[0] = input[0] * 255;\n\telse\n\t{\n\t\tptd->cc.convert(&ptd->cc, output, input);\n\t\tfor (i = 0; i < dest->colorspace->n; i++)\n\t\t\toutput[i] *= 255;\n\t}\n}\n\nstatic void\ndo_paint_tri(void *arg, fz_vertex *av, fz_vertex *bv, fz_vertex *cv)\n{\n\tstruct paint_tri_data *ptd = (struct paint_tri_data *)arg;\n\tfloat *vertices[3];\n\tfz_pixmap *dest;\n\n\tvertices[0] = (float *)av;\n\tvertices[1] = (float *)bv;\n\tvertices[2] = (float *)cv;\n\n\tdest = ptd->dest;\n\tfz_paint_triangle(dest, vertices, 2 + dest->colorspace->n, ptd->bbox);\n}\n\nvoid\nfz_paint_shade(fz_context *ctx, fz_shade *shade, const fz_matrix *ctm, fz_pixmap *dest, const fz_irect *bbox)\n{\n\tunsigned char clut[256][FZ_MAX_COLORS];\n\tfz_pixmap *temp = NULL;\n\tfz_pixmap *conv = NULL;\n\tfloat color[FZ_MAX_COLORS];\n\tstruct paint_tri_data ptd = { 0 };\n\tint i, k;\n\tfz_matrix local_ctm;\n\n\tfz_var(temp);\n\tfz_var(conv);\n\n\tfz_try(ctx)\n\t{\n\t\tfz_concat(&local_ctm, &shade->matrix, ctm);\n\n\t\tif (shade->use_function)\n\t\t{\n\t\t\tfz_color_converter cc;\n\t\t\tfz_lookup_color_converter(&cc, ctx, dest->colorspace, shade->colorspace);\n\t\t\tfor (i = 0; i < 256; i++)\n\t\t\t{\n\t\t\t\tcc.convert(&cc, color, shade->function[i]);\n\t\t\t\tfor (k = 0; k < dest->colorspace->n; k++)\n\t\t\t\t\tclut[i][k] = color[k] * 255;\n\t\t\t\tclut[i][k] = shade->function[i][shade->colorspace->n] * 255;\n\t\t\t}\n\t\t\tconv = fz_new_pixmap_with_bbox(ctx, dest->colorspace, bbox);\n\t\t\ttemp = fz_new_pixmap_with_bbox(ctx, fz_device_gray(ctx), bbox);\n\t\t\tfz_clear_pixmap(ctx, temp);\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttemp = dest;\n\t\t}\n\n\t\tptd.ctx = ctx;\n\t\tptd.dest = temp;\n\t\tptd.shade = shade;\n\t\tptd.bbox = bbox;\n\n\t\tfz_init_cached_color_converter(ctx, &ptd.cc, temp->colorspace, shade->colorspace);\n\t\tfz_process_mesh(ctx, shade, &local_ctm, &prepare_vertex, &do_paint_tri, &ptd);\n\n\t\tif (shade->use_function)\n\t\t{\n\t\t\tunsigned char *s = temp->samples;\n\t\t\tunsigned char *d = conv->samples;\n\t\t\tint len = temp->w * temp->h;\n\t\t\twhile (len--)\n\t\t\t{\n\t\t\t\tint v = *s++;\n\t\t\t\tint a = fz_mul255(*s++, clut[v][conv->n - 1]);\n\t\t\t\tfor (k = 0; k < conv->n - 1; k++)\n\t\t\t\t\t*d++ = fz_mul255(clut[v][k], a);\n\t\t\t\t*d++ = a;\n\t\t\t}\n\t\t\tfz_paint_pixmap(dest, conv, 255);\n\t\t\tfz_drop_pixmap(ctx, conv);\n\t\t\tfz_drop_pixmap(ctx, temp);\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_fin_cached_color_converter(&ptd.cc);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_drop_pixmap(ctx, conv);\n\t\tfz_drop_pixmap(ctx, temp);\n\t\tfz_rethrow(ctx);\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/fitz/draw-paint.c",
    "content": "#include \"mupdf/fitz.h\"\n#include \"draw-imp.h\"\n\n/*\n\nThe functions in this file implement various flavours of Porter-Duff blending.\n\nWe take the following as definitions:\n\n\tCx = Color (from plane x)\n\tax = Alpha (from plane x)\n\tcx = Cx.ax = Premultiplied color (from plane x)\n\nThe general PorterDuff blending equation is:\n\n\tBlend Z = X op Y\tcz = Fx.cx + Fy. cy\twhere Fx and Fy depend on op\n\nThe two operations we use in this file are: '(X in Y) over Z' and\n'S over Z'. The definitions of the 'over' and 'in' operations are as\nfollows:\n\n\tFor S over Z,\tFs = 1, Fz = 1-as\n\tFor X in Y,\tFx = ay, Fy = 0\n\nWe have 2 choices; we can either work with premultiplied data, or non\npremultiplied data. Our\n\nFirst the premultiplied case:\n\n\tLet S = (X in Y)\n\tLet R = (X in Y) over Z = S over Z\n\n\tcs\t= cx.Fx + cy.Fy\t(where Fx = ay, Fy = 0)\n\t\t= cx.ay\n\tas\t= ax.Fx + ay.Fy\n\t\t= ax.ay\n\n\tcr\t= cs.Fs + cz.Fz\t(where Fs = 1, Fz = 1-as)\n\t\t= cs + cz.(1-as)\n\t\t= cx.ay + cz.(1-ax.ay)\n\tar\t= as.Fs + az.Fz\n\t\t= as + az.(1-as)\n\t\t= ax.ay + az.(1-ax.ay)\n\nThis has various nice properties, like not needing any divisions, and\nbeing symmetric in color and alpha, so this is what we use. Because we\nwent through the pain of deriving the non premultiplied forms, we list\nthem here too, though they are not used.\n\nNon Pre-multiplied case:\n\n\tCs.as\t= Fx.Cx.ax + Fy.Cy.ay\t(where Fx = ay, Fy = 0)\n\t\t= Cx.ay.ax\n\tCs\t= (Cx.ay.ax)/(ay.ax)\n\t\t= Cx\n\tCr.ar\t= Fs.Cs.as + Fz.Cz.az\t(where Fs = 1, Fz = 1-as)\n\t\t= Cs.as\t+ (1-as).Cz.az\n\t\t= Cx.ax.ay + Cz.az.(1-ax.ay)\n\tCr\t= (Cx.ax.ay + Cz.az.(1-ax.ay))/(ax.ay + az.(1-ax-ay))\n\nMuch more complex, it seems. However, if we could restrict ourselves to\nthe case where we were always plotting onto an opaque background (i.e.\naz = 1), then:\n\n\tCr\t= Cx.(ax.ay) + Cz.(1-ax.ay)\n\t\t= (Cx-Cz)*(1-ax.ay) + Cz\t(a single MLA operation)\n\tar\t= 1\n\nSadly, this is not true in the general case, so we abandon this effort\nand stick to using the premultiplied form.\n\n*/\n\ntypedef unsigned char byte;\n\n/* These are used by the non-aa scan converter */\n\nvoid\nfz_paint_solid_alpha(byte * restrict dp, int w, int alpha)\n{\n\tint t = FZ_EXPAND(255 - alpha);\n\twhile (w--)\n\t{\n\t\t*dp = alpha + FZ_COMBINE(*dp, t);\n\t\tdp ++;\n\t}\n}\n\nstatic inline void\nfz_paint_solid_color_2(byte * restrict dp, int w, byte *color)\n{\n\tint sa = FZ_EXPAND(color[1]);\n\tif (sa == 0)\n\t\treturn;\n\tif (sa == 256)\n\t{\n\t\twhile (w--)\n\t\t{\n\t\t\tdp[0] = color[0];\n\t\t\tdp[1] = 255;\n\t\t\tdp += 2;\n\t\t}\n\t}\n\telse\n\t{\n\t\twhile (w--)\n\t\t{\n\t\t\tdp[0] = FZ_BLEND(color[0], dp[0], sa);\n\t\t\tdp[1] = FZ_BLEND(255, dp[1], sa);\n\t\t\tdp += 2;\n\t\t}\n\t}\n}\n\nstatic inline int isbigendian(void)\n{\n\tunion { int i; char c[sizeof(int)]; } u = {1};\n\treturn u.c[0] != 1;\n}\n\nstatic inline void\nfz_paint_solid_color_4(byte * restrict dp, int w, byte *color)\n{\n\tunsigned int rgba = *(int *)color;\n\tint sa = FZ_EXPAND(color[3]);\n\tif (sa == 0)\n\t\treturn;\n\tif (isbigendian())\n\t\trgba |= 0x000000FF;\n\telse\n\t\trgba |= 0xFF000000;\n\tif (sa == 256)\n\t{\n\t\twhile (w--)\n\t\t{\n\t\t\t*(unsigned int *)dp = rgba;\n\t\t\tdp += 4;\n\t\t}\n\t}\n\telse\n\t{\n\t\tunsigned int mask = 0xFF00FF00;\n\t\tunsigned int rb = rgba & (mask>>8);\n\t\tunsigned int ga = (rgba & mask)>>8;\n\t\twhile (w--)\n\t\t{\n\t\t\tunsigned int RGBA = *(unsigned int *)dp;\n\t\t\tunsigned int RB = (RGBA<<8) & mask;\n\t\t\tunsigned int GA = RGBA & mask;\n\t\t\tRB += (rb-(RB>>8))*sa;\n\t\t\tGA += (ga-(GA>>8))*sa;\n\t\t\tRB &= mask;\n\t\t\tGA &= mask;\n\t\t\t*(unsigned int *)dp = (RB>>8) | GA;\n\t\t\tdp += 4;\n\t\t}\n\t}\n}\n\nstatic inline void\nfz_paint_solid_color_N(byte * restrict dp, int n, int w, byte *color)\n{\n\tint k;\n\tint n1 = n - 1;\n\tint sa = FZ_EXPAND(color[n1]);\n\tif (sa == 0)\n\t\treturn;\n\tif (sa == 256)\n\t{\n\t\twhile (w--)\n\t\t{\n\t\t\tfor (k = 0; k < n1; k++)\n\t\t\t\tdp[k] = color[k];\n\t\t\tdp[k] = 255;\n\t\t\tdp += n;\n\t\t}\n\t}\n\telse\n\t{\n\t\twhile (w--)\n\t\t{\n\t\t\tfor (k = 0; k < n1; k++)\n\t\t\t\tdp[k] = FZ_BLEND(color[k], dp[k], sa);\n\t\t\tdp[k] = FZ_BLEND(255, dp[k], sa);\n\t\t\tdp += n;\n\t\t}\n\t}\n}\n\nvoid\nfz_paint_solid_color(byte * restrict dp, int n, int w, byte *color)\n{\n\tswitch (n)\n\t{\n\tcase 2: fz_paint_solid_color_2(dp, w, color); break;\n\tcase 4: fz_paint_solid_color_4(dp, w, color); break;\n\tdefault: fz_paint_solid_color_N(dp, n, w, color); break;\n\t}\n}\n\n/* Blend a non-premultiplied color in mask over destination */\n\nstatic inline void\nfz_paint_span_with_color_2(byte * restrict dp, byte * restrict mp, int w, byte *color)\n{\n\tint sa = FZ_EXPAND(color[1]);\n\tint g = color[0];\n\tif (sa == 256)\n\t{\n\t\twhile (w--)\n\t\t{\n\t\t\tint ma = *mp++;\n\t\t\tma = FZ_EXPAND(ma);\n\t\t\tif (ma == 0)\n\t\t\t{\n\t\t\t}\n\t\t\telse if (ma == 256)\n\t\t\t{\n\t\t\t\tdp[0] = g;\n\t\t\t\tdp[1] = 255;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdp[0] = FZ_BLEND(g, dp[0], ma);\n\t\t\t\tdp[1] = FZ_BLEND(255, dp[1], ma);\n\t\t\t}\n\t\t\tdp += 2;\n\t\t}\n\t}\n\telse\n\t{\n\t\twhile (w--)\n\t\t{\n\t\t\tint ma = *mp++;\n\t\t\tma = FZ_EXPAND(ma);\n\t\t\tif (ma == 0)\n\t\t\t{\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tma = FZ_COMBINE(ma, sa);\n\t\t\t\tdp[0] = FZ_BLEND(g, dp[0], ma);\n\t\t\t\tdp[1] = FZ_BLEND(255, dp[1], ma);\n\t\t\t}\n\t\t\tdp += 2;\n\t\t}\n\t}\n}\n\nstatic inline void\nfz_paint_span_with_color_4(byte * restrict dp, byte * restrict mp, int w, byte *color)\n{\n\tunsigned int rgba = *((unsigned int *)color);\n\tunsigned int mask, rb, ga;\n\tint sa = FZ_EXPAND(color[3]);\n\tif (sa == 0)\n\t\treturn;\n\tif (isbigendian())\n\t\trgba |= 0x000000FF;\n\telse\n\t\trgba |= 0xFF000000;\n\tmask = 0xFF00FF00;\n\trb = rgba & (mask>>8);\n\tga = (rgba & mask)>>8;\n\tif (sa == 256)\n\t{\n\t\twhile (w--)\n\t\t{\n\t\t\tunsigned int ma = *mp++;\n\t\t\tdp += 4;\n\t\t\tma = FZ_EXPAND(ma);\n\t\t\tif (ma == 0)\n\t\t\t{\n\t\t\t}\n\t\t\telse if (ma == 256)\n\t\t\t{\n\t\t\t\t((unsigned int *)dp)[-1] = rgba;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tunsigned int RGBA = ((unsigned int *)dp)[-1];\n\t\t\t\tunsigned int RB = (RGBA<<8) & mask;\n\t\t\t\tunsigned int GA = RGBA & mask;\n\t\t\t\tRB += (rb-(RB>>8))*ma;\n\t\t\t\tGA += (ga-(GA>>8))*ma;\n\t\t\t\tRB &= mask;\n\t\t\t\tGA &= mask;\n\t\t\t\t((unsigned int *)dp)[-1] = (RB>>8) | GA;\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\twhile (w--)\n\t\t{\n\t\t\tunsigned int ma = *mp++;\n\t\t\tma = FZ_COMBINE(FZ_EXPAND(ma), sa);\n\t\t\tdp += 4;\n\t\t\tif (ma != 0)\n \t\t\t{\n\t\t\t\tunsigned int RGBA = ((unsigned int*)dp)[-1];\n\t\t\t\tunsigned int RB = (RGBA<<8) & mask;\n\t\t\t\tunsigned int GA = RGBA & mask;\n\t\t\t\tRB += (rb-(RB>>8))*ma;\n\t\t\t\tGA += (ga-(GA>>8))*ma;\n\t\t\t\tRB &= mask;\n\t\t\t\tGA &= mask;\n\t\t\t\t((unsigned int *)dp)[-1] = (RB>>8) | GA;\n\t\t\t}\n\t\t}\n\t}\n}\n\nstatic inline void\nfz_paint_span_with_color_N(byte * restrict dp, byte * restrict mp, int n, int w, byte *color)\n{\n\tint k;\n\tint n1 = n - 1;\n\tint sa = FZ_EXPAND(color[n1]);\n\tif (sa == 0)\n\t\treturn;\n\tif (sa == 256)\n\t{\n\t\twhile (w--)\n\t\t{\n\t\t\tint ma = *mp++;\n\t\t\tma = FZ_EXPAND(ma);\n\t\t\tif (ma == 0)\n\t\t\t{\n\t\t\t}\n\t\t\telse if (ma == 256)\n\t\t\t{\n\t\t\t\tfor (k = 0; k < n1; k++)\n\t\t\t\t\tdp[k] = color[k];\n\t\t\t\tdp[k] = 255;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfor (k = 0; k < n1; k++)\n\t\t\t\t\tdp[k] = FZ_BLEND(color[k], dp[k], ma);\n\t\t\t\tdp[k] = FZ_BLEND(255, dp[k], ma);\n\t\t\t}\n\t\t\tdp += n;\n\t\t}\n\t}\n\telse\n\t{\n\t\twhile (w--)\n\t\t{\n\t\t\tint ma = *mp++;\n\t\t\tma = FZ_COMBINE(FZ_EXPAND(ma), sa);\n\t\t\tfor (k = 0; k < n1; k++)\n\t\t\t\tdp[k] = FZ_BLEND(color[k], dp[k], ma);\n\t\t\tdp[k] = FZ_BLEND(255, dp[k], ma);\n\t\t\tdp += n;\n\t\t}\n\t}\n}\n\nvoid\nfz_paint_span_with_color(byte * restrict dp, byte * restrict mp, int n, int w, byte *color)\n{\n\tswitch (n)\n\t{\n\tcase 2: fz_paint_span_with_color_2(dp, mp, w, color); break;\n\tcase 4: fz_paint_span_with_color_4(dp, mp, w, color); break;\n\tdefault: fz_paint_span_with_color_N(dp, mp, n, w, color); break;\n\t}\n}\n\n/* Blend source in mask over destination */\n\n/* FIXME: There is potential for SWAR optimisation here */\nstatic inline void\nfz_paint_span_with_mask_2(byte * restrict dp, byte * restrict sp, byte * restrict mp, int w)\n{\n\twhile (w--)\n\t{\n\t\tint masa;\n\t\tint ma = *mp++;\n\t\tma = FZ_EXPAND(ma);\n\t\tif (ma == 0)\n\t\t{\n\t\t\tdp += 2;\n\t\t\tsp += 2;\n\t\t}\n\t\telse if (ma == 256)\n\t\t{\n\t\t\tmasa = 255 - sp[1];\n\t\t\tif (masa == 0)\n\t\t\t{\n\t\t\t\t*dp++ = *sp++;\n\t\t\t\t*dp++ = *sp++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmasa = FZ_EXPAND(masa);\n\t\t\t\t*dp = *sp + FZ_COMBINE(*dp, masa);\n\t\t\t\tsp++; dp++;\n\t\t\t\t*dp = *sp + FZ_COMBINE(*dp, masa);\n\t\t\t\tsp++; dp++;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmasa = FZ_COMBINE(sp[1], ma);\n\t\t\tmasa = 255 - masa;\n\t\t\tmasa = FZ_EXPAND(masa);\n\t\t\t*dp = FZ_COMBINE2(*sp, ma, *dp, masa);\n\t\t\tsp++; dp++;\n\t\t\t*dp = FZ_COMBINE2(*sp, ma, *dp, masa);\n\t\t\tsp++; dp++;\n\t\t}\n\t}\n}\n\n/* FIXME: There is potential for SWAR optimisation here */\nstatic inline void\nfz_paint_span_with_mask_4(byte * restrict dp, byte * restrict sp, byte * restrict mp, int w)\n{\n\twhile (w--)\n\t{\n\t\tint masa;\n\t\tint ma = *mp++;\n\t\tma = FZ_EXPAND(ma);\n\t\tif (ma == 0)\n\t\t{\n\t\t\tdp += 4;\n\t\t\tsp += 4;\n\t\t}\n\t\telse if (ma == 256)\n\t\t{\n\t\t\tmasa = 255 - sp[3];\n\t\t\tif (masa == 0)\n\t\t\t{\n\t\t\t\t*(int*)dp = *(int *)sp;\n\t\t\t\tsp += 4; dp += 4;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmasa = FZ_EXPAND(masa);\n\t\t\t\t*dp = *sp + FZ_COMBINE(*dp, masa);\n\t\t\t\tsp++; dp++;\n\t\t\t\t*dp = *sp + FZ_COMBINE(*dp, masa);\n\t\t\t\tsp++; dp++;\n\t\t\t\t*dp = *sp + FZ_COMBINE(*dp, masa);\n\t\t\t\tsp++; dp++;\n\t\t\t\t*dp = *sp + FZ_COMBINE(*dp, masa);\n\t\t\t\tsp++; dp++;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* FIXME: There is potential for SWAR optimisation here */\n\t\t\tmasa = FZ_COMBINE(sp[3], ma);\n\t\t\tmasa = 255 - masa;\n\t\t\tmasa = FZ_EXPAND(masa);\n\t\t\t*dp = FZ_COMBINE2(*sp, ma, *dp, masa);\n\t\t\tsp++; dp++;\n\t\t\t*dp = FZ_COMBINE2(*sp, ma, *dp, masa);\n\t\t\tsp++; dp++;\n\t\t\t*dp = FZ_COMBINE2(*sp, ma, *dp, masa);\n\t\t\tsp++; dp++;\n\t\t\t*dp = FZ_COMBINE2(*sp, ma, *dp, masa);\n\t\t\tsp++; dp++;\n\t\t}\n\t}\n}\n\nstatic inline void\nfz_paint_span_with_mask_N(byte * restrict dp, byte * restrict sp, byte * restrict mp, int n, int w)\n{\n\twhile (w--)\n\t{\n\t\tint ma = *mp++;\n\t\tma = FZ_EXPAND(ma);\n\t\tif (ma == 0)\n\t\t{\n\t\t\tdp += n;\n\t\t\tsp += n;\n\t\t}\n\t\telse if (ma == 256)\n\t\t{\n\t\t\tint k = n;\n\t\t\tint masa = 255 - sp[n-1];\n\t\t\tif (masa == 0)\n\t\t\t{\n\t\t\t\twhile (k--)\n\t\t\t\t{\n\t\t\t\t\t*dp++ = *sp++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmasa = FZ_EXPAND(masa);\n\t\t\t\twhile (k--)\n\t\t\t\t{\n\t\t\t\t\t*dp = *sp + FZ_COMBINE(*dp, masa);\n\t\t\t\t\tsp++; dp++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tint k = n;\n\t\t\tint masa = FZ_COMBINE(sp[n-1], ma);\n\t\t\tmasa = 255-masa;\n\t\t\tmasa = FZ_EXPAND(masa);\n\t\t\twhile (k--)\n\t\t\t{\n\t\t\t\t*dp = FZ_COMBINE2(*sp, ma, *dp, masa);\n\t\t\t\tsp++; dp++;\n\t\t\t}\n\t\t}\n\t}\n}\n\nstatic void\nfz_paint_span_with_mask(byte * restrict dp, byte * restrict sp, byte * restrict mp, int n, int w)\n{\n\tswitch (n)\n\t{\n\tcase 2: fz_paint_span_with_mask_2(dp, sp, mp, w); break;\n\tcase 4: fz_paint_span_with_mask_4(dp, sp, mp, w); break;\n\tdefault: fz_paint_span_with_mask_N(dp, sp, mp, n, w); break;\n\t}\n}\n\n/* Blend source in constant alpha over destination */\n\nstatic inline void\nfz_paint_span_2_with_alpha(byte * restrict dp, byte * restrict sp, int w, int alpha)\n{\n\talpha = FZ_EXPAND(alpha);\n\twhile (w--)\n\t{\n\t\tint masa = FZ_COMBINE(sp[1], alpha);\n\t\t*dp = FZ_BLEND(*sp, *dp, masa);\n\t\tdp++; sp++;\n\t\t*dp = FZ_BLEND(*sp, *dp, masa);\n\t\tdp++; sp++;\n\t}\n}\n\nstatic inline void\nfz_paint_span_4_with_alpha(byte * restrict dp, byte * restrict sp, int w, int alpha)\n{\n\talpha = FZ_EXPAND(alpha);\n\twhile (w--)\n\t{\n\t\tint masa = FZ_COMBINE(sp[3], alpha);\n\t\t*dp = FZ_BLEND(*sp, *dp, masa);\n\t\tsp++; dp++;\n\t\t*dp = FZ_BLEND(*sp, *dp, masa);\n\t\tsp++; dp++;\n\t\t*dp = FZ_BLEND(*sp, *dp, masa);\n\t\tsp++; dp++;\n\t\t*dp = FZ_BLEND(*sp, *dp, masa);\n\t\tsp++; dp++;\n\t}\n}\n\nstatic inline void\nfz_paint_span_N_with_alpha(byte * restrict dp, byte * restrict sp, int n, int w, int alpha)\n{\n\talpha = FZ_EXPAND(alpha);\n\twhile (w--)\n\t{\n\t\tint masa = FZ_COMBINE(sp[n-1], alpha);\n\t\tint k = n;\n\t\twhile (k--)\n\t\t{\n\t\t\t*dp = FZ_BLEND(*sp++, *dp, masa);\n\t\t\tdp++;\n\t\t}\n\t}\n}\n\n/* Blend source over destination */\n\nstatic inline void\nfz_paint_span_1(byte * restrict dp, byte * restrict sp, int w)\n{\n\twhile (w--)\n\t{\n\t\tint t = FZ_EXPAND(255 - sp[0]);\n\t\t*dp = *sp++ + FZ_COMBINE(*dp, t);\n\t\tdp ++;\n\t}\n}\n\nstatic inline void\nfz_paint_span_2(byte * restrict dp, byte * restrict sp, int w)\n{\n\twhile (w--)\n\t{\n\t\tint t = FZ_EXPAND(sp[1]);\n\t\tif (t == 0)\n\t\t{\n\t\t\tdp += 2; sp += 2;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tt = 256 - t;\n\t\t\tif (t == 0)\n\t\t\t{\n\t\t\t\t*dp++ = *sp++;\n\t\t\t\t*dp++ = *sp++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t*dp = *sp++ + FZ_COMBINE(*dp, t);\n\t\t\t\tdp++;\n\t\t\t\t*dp = *sp++ + FZ_COMBINE(*dp, t);\n\t\t\t\tdp++;\n\t\t\t}\n\t\t}\n\t}\n}\n\nstatic inline void\nfz_paint_span_4(byte * restrict dp, byte * restrict sp, int w)\n{\n\twhile (w--)\n\t{\n\t\tint t = FZ_EXPAND(sp[3]);\n\t\tif (t == 0)\n\t\t{\n\t\t\tdp += 4; sp += 4;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tt = 256 - t;\n\t\t\tif (t == 0)\n\t\t\t{\n\t\t\t\t*(int *)dp = *(int *)sp;\n\t\t\t\tdp += 4; sp += 4;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t*dp = *sp++ + FZ_COMBINE(*dp, t);\n\t\t\t\tdp++;\n\t\t\t\t*dp = *sp++ + FZ_COMBINE(*dp, t);\n\t\t\t\tdp++;\n\t\t\t\t*dp = *sp++ + FZ_COMBINE(*dp, t);\n\t\t\t\tdp++;\n\t\t\t\t*dp = *sp++ + FZ_COMBINE(*dp, t);\n\t\t\t\tdp++;\n\t\t\t}\n\t\t}\n\t}\n}\n\nstatic inline void\nfz_paint_span_N(byte * restrict dp, byte * restrict sp, int n, int w)\n{\n\twhile (w--)\n\t{\n\t\tint t = FZ_EXPAND(sp[n-1]);\n\t\tif (t == 0)\n\t\t{\n\t\t\tdp += n; sp += n;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tt = 256 - t;\n\t\t\tif (t == 0)\n\t\t\t{\n\t\t\t\tint k = n;\n\t\t\t\twhile (k--)\n\t\t\t\t{\n\t\t\t\t\t*dp++ = *sp++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tint k = n;\n\t\t\t\twhile (k--)\n\t\t\t\t{\n\t\t\t\t\t*dp = *sp++ + FZ_COMBINE(*dp, t);\n\t\t\t\t\tdp++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nvoid\nfz_paint_span(byte * restrict dp, byte * restrict sp, int n, int w, int alpha)\n{\n\tif (alpha == 255)\n\t{\n\t\tswitch (n)\n\t\t{\n\t\tcase 1: fz_paint_span_1(dp, sp, w); break;\n\t\tcase 2: fz_paint_span_2(dp, sp, w); break;\n\t\tcase 4: fz_paint_span_4(dp, sp, w); break;\n\t\tdefault: fz_paint_span_N(dp, sp, n, w); break;\n\t\t}\n\t}\n\telse if (alpha > 0)\n\t{\n\t\tswitch (n)\n\t\t{\n\t\tcase 2: fz_paint_span_2_with_alpha(dp, sp, w, alpha); break;\n\t\tcase 4: fz_paint_span_4_with_alpha(dp, sp, w, alpha); break;\n\t\tdefault: fz_paint_span_N_with_alpha(dp, sp, n, w, alpha); break;\n\t\t}\n\t}\n}\n\n/*\n * Pixmap blending functions\n */\n\nvoid\nfz_paint_pixmap_with_bbox(fz_pixmap *dst, fz_pixmap *src, int alpha, fz_irect bbox)\n{\n\tunsigned char *sp, *dp;\n\tint x, y, w, h, n;\n\tfz_irect bbox2;\n\n\tassert(dst->n == src->n);\n\n\tfz_pixmap_bbox_no_ctx(dst, &bbox2);\n\tfz_intersect_irect(&bbox, &bbox2);\n\tfz_pixmap_bbox_no_ctx(src, &bbox2);\n\tfz_intersect_irect(&bbox, &bbox2);\n\n\tx = bbox.x0;\n\ty = bbox.y0;\n\tw = bbox.x1 - bbox.x0;\n\th = bbox.y1 - bbox.y0;\n\tif ((w | h) == 0)\n\t\treturn;\n\n\tn = src->n;\n\tsp = src->samples + (unsigned int)(((y - src->y) * src->w + (x - src->x)) * src->n);\n\tdp = dst->samples + (unsigned int)(((y - dst->y) * dst->w + (x - dst->x)) * dst->n);\n\n\twhile (h--)\n\t{\n\t\tfz_paint_span(dp, sp, n, w, alpha);\n\t\tsp += src->w * n;\n\t\tdp += dst->w * n;\n\t}\n}\n\nvoid\nfz_paint_pixmap(fz_pixmap *dst, fz_pixmap *src, int alpha)\n{\n\tunsigned char *sp, *dp;\n\tfz_irect bbox;\n\tfz_irect bbox2;\n\tint x, y, w, h, n;\n\n\tassert(dst->n == src->n);\n\n\tfz_pixmap_bbox_no_ctx(dst, &bbox);\n\tfz_pixmap_bbox_no_ctx(src, &bbox2);\n\tfz_intersect_irect(&bbox, &bbox2);\n\n\tx = bbox.x0;\n\ty = bbox.y0;\n\tw = bbox.x1 - bbox.x0;\n\th = bbox.y1 - bbox.y0;\n\tif ((w | h) == 0)\n\t\treturn;\n\n\tn = src->n;\n\tsp = src->samples + (unsigned int)(((y - src->y) * src->w + (x - src->x)) * src->n);\n\tdp = dst->samples + (unsigned int)(((y - dst->y) * dst->w + (x - dst->x)) * dst->n);\n\n\twhile (h--)\n\t{\n\t\tfz_paint_span(dp, sp, n, w, alpha);\n\t\tsp += src->w * n;\n\t\tdp += dst->w * n;\n\t}\n}\n\nvoid\nfz_paint_pixmap_with_mask(fz_pixmap *dst, fz_pixmap *src, fz_pixmap *msk)\n{\n\tunsigned char *sp, *dp, *mp;\n\tfz_irect bbox, bbox2;\n\tint x, y, w, h, n;\n\n\tassert(dst->n == src->n);\n\tassert(msk->n == 1);\n\n\tfz_pixmap_bbox_no_ctx(dst, &bbox);\n\tfz_pixmap_bbox_no_ctx(src, &bbox2);\n\tfz_intersect_irect(&bbox, &bbox2);\n\tfz_pixmap_bbox_no_ctx(msk, &bbox2);\n\tfz_intersect_irect(&bbox, &bbox2);\n\n\tx = bbox.x0;\n\ty = bbox.y0;\n\tw = bbox.x1 - bbox.x0;\n\th = bbox.y1 - bbox.y0;\n\tif ((w | h) == 0)\n\t\treturn;\n\n\tn = src->n;\n\tsp = src->samples + (unsigned int)(((y - src->y) * src->w + (x - src->x)) * src->n);\n\tmp = msk->samples + (unsigned int)(((y - msk->y) * msk->w + (x - msk->x)) * msk->n);\n\tdp = dst->samples + (unsigned int)(((y - dst->y) * dst->w + (x - dst->x)) * dst->n);\n\n\twhile (h--)\n\t{\n\t\tfz_paint_span_with_mask(dp, sp, mp, n, w);\n\t\tsp += src->w * n;\n\t\tdp += dst->w * n;\n\t\tmp += msk->w;\n\t}\n}\n\nstatic inline void\nfz_paint_glyph_mask(int span, unsigned char *dp, fz_glyph *glyph, int w, int h, int skip_x, int skip_y)\n{\n\twhile (h--)\n\t{\n\t\tint skip_xx, ww, len, extend;\n\t\tunsigned char *runp;\n\t\tunsigned char *ddp = dp;\n\t\tint offset = ((int *)(glyph->data))[skip_y++];\n\t\tif (offset >= 0)\n\t\t{\n\t\t\tint eol = 0;\n\t\t\trunp = &glyph->data[offset];\n\t\t\textend = 0;\n\t\t\tww = w;\n\t\t\tskip_xx = skip_x;\n\t\t\twhile (skip_xx)\n\t\t\t{\n\t\t\t\tint v = *runp++;\n\t\t\t\tswitch (v & 3)\n\t\t\t\t{\n\t\t\t\tcase 0: /* Extend */\n\t\t\t\t\textend = v>>2;\n\t\t\t\t\tlen = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1: /* Transparent */\n\t\t\t\t\tlen = (v>>2) + 1 + (extend<<6);\n\t\t\t\t\textend = 0;\n\t\t\t\t\tif (len > skip_xx)\n\t\t\t\t\t{\n\t\t\t\t\t\tlen -= skip_xx;\n\t\t\t\t\t\tgoto transparent_run;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2: /* Solid */\n\t\t\t\t\teol = v & 4;\n\t\t\t\t\tlen = (v>>3) + 1 + (extend<<5);\n\t\t\t\t\textend = 0;\n\t\t\t\t\tif (len > skip_xx)\n\t\t\t\t\t{\n\t\t\t\t\t\tlen -= skip_xx;\n\t\t\t\t\t\tgoto solid_run;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: /* Intermediate */\n\t\t\t\t\teol = v & 4;\n\t\t\t\t\tlen = (v>>3) + 1 + (extend<<5);\n\t\t\t\t\textend = 0;\n\t\t\t\t\tif (len > skip_xx)\n\t\t\t\t\t{\n\t\t\t\t\t\trunp += skip_xx;\n\t\t\t\t\t\tlen -= skip_xx;\n\t\t\t\t\t\tgoto intermediate_run;\n\t\t\t\t\t}\n\t\t\t\t\trunp += len;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (eol)\n\t\t\t\t{\n\t\t\t\t\tww = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tskip_xx -= len;\n\t\t\t}\n\t\t\twhile (ww > 0)\n\t\t\t{\n\t\t\t\tint v = *runp++;\n\t\t\t\tswitch(v & 3)\n\t\t\t\t{\n\t\t\t\tcase 0: /* Extend */\n\t\t\t\t\textend = v>>2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1: /* Transparent */\n\t\t\t\t\tlen = (v>>2) + 1 + (extend<<6);\n\t\t\t\t\textend = 0;\ntransparent_run:\n\t\t\t\t\tif (len > ww)\n\t\t\t\t\t\tlen = ww;\n\t\t\t\t\tww -= len;\n\t\t\t\t\tddp += len;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2: /* Solid */\n\t\t\t\t\teol = v & 4;\n\t\t\t\t\tlen = (v>>3) + 1 + (extend<<5);\n\t\t\t\t\textend = 0;\nsolid_run:\n\t\t\t\t\tif (len > ww)\n\t\t\t\t\t\tlen = ww;\n\t\t\t\t\tww -= len;\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\t*ddp++ = 0xFF;\n\t\t\t\t\t}\n\t\t\t\t\twhile (--len);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: /* Intermediate */\n\t\t\t\t\teol = v & 4;\n\t\t\t\t\tlen = (v>>3) + 1 + (extend<<5);\n\t\t\t\t\textend = 0;\nintermediate_run:\n\t\t\t\t\tif (len > ww)\n\t\t\t\t\t\tlen = ww;\n\t\t\t\t\tww -= len;\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\tint v = *ddp;\n\t\t\t\t\t\tint a = *runp++;\n\t\t\t\t\t\tif (v == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t*ddp++ = a;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ta = FZ_EXPAND(a);\n\t\t\t\t\t\t\t*ddp = FZ_BLEND(0xFF, v, a);\n\t\t\t\t\t\t\tddp++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\twhile (--len);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (eol)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tdp += span;\n\t}\n}\n\nstatic inline void\nfz_paint_glyph_alpha_N(unsigned char *colorbv, int n, int span, unsigned char *dp, fz_glyph *glyph, int w, int h, int skip_x, int skip_y)\n{\n\tint sa = FZ_EXPAND(colorbv[n-1]);\n\twhile (h--)\n\t{\n\t\tint skip_xx, ww, len, extend;\n\t\tunsigned char *runp;\n\t\tunsigned char *ddp = dp;\n\t\tint offset = ((int *)(glyph->data))[skip_y++];\n\t\tif (offset >= 0)\n\t\t{\n\t\t\tint eol = 0;\n\t\t\trunp = &glyph->data[offset];\n\t\t\textend = 0;\n\t\t\tww = w;\n\t\t\tskip_xx = skip_x;\n\t\t\twhile (skip_xx)\n\t\t\t{\n\t\t\t\tint v = *runp++;\n\t\t\t\tswitch (v & 3)\n\t\t\t\t{\n\t\t\t\tcase 0: /* Extend */\n\t\t\t\t\textend = v>>2;\n\t\t\t\t\tlen = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1: /* Transparent */\n\t\t\t\t\tlen = (v>>2) + 1 + (extend<<6);\n\t\t\t\t\textend = 0;\n\t\t\t\t\tif (len > skip_xx)\n\t\t\t\t\t{\n\t\t\t\t\t\tlen -= skip_xx;\n\t\t\t\t\t\tgoto transparent_run;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2: /* Solid */\n\t\t\t\t\teol = v & 4;\n\t\t\t\t\tlen = (v>>3) + 1 + (extend<<5);\n\t\t\t\t\textend = 0;\n\t\t\t\t\tif (len > skip_xx)\n\t\t\t\t\t{\n\t\t\t\t\t\tlen -= skip_xx;\n\t\t\t\t\t\tgoto solid_run;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: /* Intermediate */\n\t\t\t\t\teol = v & 4;\n\t\t\t\t\tlen = (v>>3) + 1 + (extend<<5);\n\t\t\t\t\textend = 0;\n\t\t\t\t\tif (len > skip_xx)\n\t\t\t\t\t{\n\t\t\t\t\t\trunp += skip_xx;\n\t\t\t\t\t\tlen -= skip_xx;\n\t\t\t\t\t\tgoto intermediate_run;\n\t\t\t\t\t}\n\t\t\t\t\trunp += len;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (eol)\n\t\t\t\t{\n\t\t\t\t\tww = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tskip_xx -= len;\n\t\t\t}\n\t\t\twhile (ww > 0)\n\t\t\t{\n\t\t\t\tint v = *runp++;\n\t\t\t\tswitch(v & 3)\n\t\t\t\t{\n\t\t\t\tcase 0: /* Extend */\n\t\t\t\t\textend = v>>2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1: /* Transparent */\n\t\t\t\t\tlen = (v>>2) + 1 + (extend<<6);\n\t\t\t\t\textend = 0;\ntransparent_run:\n\t\t\t\t\tif (len > ww)\n\t\t\t\t\t\tlen = ww;\n\t\t\t\t\tww -= len;\n\t\t\t\t\tddp += len * n;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2: /* Solid */\n\t\t\t\t\teol = v & 4;\n\t\t\t\t\tlen = (v>>3) + 1 + (extend<<5);\n\t\t\t\t\textend = 0;\nsolid_run:\n\t\t\t\t\tif (len > ww)\n\t\t\t\t\t\tlen = ww;\n\t\t\t\t\tww -= len;\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\tint k = 0;\n\t\t\t\t\t\tdo\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t*ddp = FZ_BLEND(colorbv[k++], *ddp, sa);\n\t\t\t\t\t\t\tddp++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\twhile (k != n-1);\n\t\t\t\t\t\t*ddp = FZ_BLEND(0xFF, *ddp, sa);\n\t\t\t\t\t\tddp++;\n\t\t\t\t\t}\n\t\t\t\t\twhile (--len);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: /* Intermediate */\n\t\t\t\t\teol = v & 4;\n\t\t\t\t\tlen = (v>>3) + 1 + (extend<<5);\n\t\t\t\t\textend = 0;\nintermediate_run:\n\t\t\t\t\tif (len > ww)\n\t\t\t\t\t\tlen = ww;\n\t\t\t\t\tww -= len;\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\tint k = 0;\n\t\t\t\t\t\tint a = *runp++;\n\t\t\t\t\t\ta = FZ_COMBINE(sa, FZ_EXPAND(a));\n\t\t\t\t\t\tdo\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t*ddp = FZ_BLEND(colorbv[k++], *ddp, a);\n\t\t\t\t\t\t\tddp++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\twhile (k != n-1);\n\t\t\t\t\t\t*ddp = FZ_BLEND(0xFF, *ddp, a);\n\t\t\t\t\t\tddp++;\n\t\t\t\t\t}\n\t\t\t\t\twhile (--len);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (eol)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tdp += span;\n\t}\n}\n\nstatic inline void\nfz_paint_glyph_solid_N(unsigned char *colorbv, int n, int span, unsigned char *dp, fz_glyph *glyph, int w, int h, int skip_x, int skip_y)\n{\n\twhile (h--)\n\t{\n\t\tint skip_xx, ww, len, extend;\n\t\tunsigned char *runp;\n\t\tunsigned char *ddp = dp;\n\t\tint offset = ((int *)(glyph->data))[skip_y++];\n\t\tif (offset >= 0)\n\t\t{\n\t\t\tint eol = 0;\n\t\t\trunp = &glyph->data[offset];\n\t\t\textend = 0;\n\t\t\tww = w;\n\t\t\tskip_xx = skip_x;\n\t\t\twhile (skip_xx)\n\t\t\t{\n\t\t\t\tint v = *runp++;\n\t\t\t\tswitch (v & 3)\n\t\t\t\t{\n\t\t\t\tcase 0: /* Extend */\n\t\t\t\t\textend = v>>2;\n\t\t\t\t\tlen = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1: /* Transparent */\n\t\t\t\t\tlen = (v>>2) + 1 + (extend<<6);\n\t\t\t\t\textend = 0;\n\t\t\t\t\tif (len > skip_xx)\n\t\t\t\t\t{\n\t\t\t\t\t\tlen -= skip_xx;\n\t\t\t\t\t\tgoto transparent_run;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2: /* Solid */\n\t\t\t\t\teol = v & 4;\n\t\t\t\t\tlen = (v>>3) + 1 + (extend<<5);\n\t\t\t\t\textend = 0;\n\t\t\t\t\tif (len > skip_xx)\n\t\t\t\t\t{\n\t\t\t\t\t\tlen -= skip_xx;\n\t\t\t\t\t\tgoto solid_run;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: /* Intermediate */\n\t\t\t\t\teol = v & 4;\n\t\t\t\t\tlen = (v>>3) + 1 + (extend<<5);\n\t\t\t\t\textend = 0;\n\t\t\t\t\tif (len > skip_xx)\n\t\t\t\t\t{\n\t\t\t\t\t\trunp += skip_xx;\n\t\t\t\t\t\tlen -= skip_xx;\n\t\t\t\t\t\tgoto intermediate_run;\n\t\t\t\t\t}\n\t\t\t\t\trunp += len;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (eol)\n\t\t\t\t{\n\t\t\t\t\tww = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tskip_xx -= len;\n\t\t\t}\n\t\t\twhile (ww > 0)\n\t\t\t{\n\t\t\t\tint v = *runp++;\n\t\t\t\tswitch(v & 3)\n\t\t\t\t{\n\t\t\t\tcase 0: /* Extend */\n\t\t\t\t\textend = v>>2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1: /* Transparent */\n\t\t\t\t\tlen = (v>>2) + 1 + (extend<<6);\n\t\t\t\t\textend = 0;\ntransparent_run:\n\t\t\t\t\tif (len > ww)\n\t\t\t\t\t\tlen = ww;\n\t\t\t\t\tww -= len;\n\t\t\t\t\tddp += len * n;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2: /* Solid */\n\t\t\t\t\teol = v & 4;\n\t\t\t\t\tlen = (v>>3) + 1 + (extend<<5);\n\t\t\t\t\textend = 0;\nsolid_run:\n\t\t\t\t\tif (len > ww)\n\t\t\t\t\t\tlen = ww;\n\t\t\t\t\tww -= len;\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\tint k = 0;\n\t\t\t\t\t\tdo\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t*ddp++ = colorbv[k++];\n\t\t\t\t\t\t}\n\t\t\t\t\t\twhile (k != n);\n\t\t\t\t\t}\n\t\t\t\t\twhile (--len);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: /* Intermediate */\n\t\t\t\t\teol = v & 4;\n\t\t\t\t\tlen = (v>>3) + 1 + (extend<<5);\n\t\t\t\t\textend = 0;\nintermediate_run:\n\t\t\t\t\tif (len > ww)\n\t\t\t\t\t\tlen = ww;\n\t\t\t\t\tww -= len;\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\tint k = 0;\n\t\t\t\t\t\tint a = *runp++;\n\t\t\t\t\t\ta = FZ_EXPAND(a);\n\t\t\t\t\t\tdo\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t*ddp = FZ_BLEND(colorbv[k++], *ddp, a);\n\t\t\t\t\t\t\tddp++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\twhile (k != n-1);\n\t\t\t\t\t\t*ddp = FZ_BLEND(0xFF, *ddp, a);\n\t\t\t\t\t\tddp++;\n\t\t\t\t\t}\n\t\t\t\t\twhile (--len);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (eol)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tdp += span;\n\t}\n}\n\nstatic inline void\nfz_paint_glyph_alpha(unsigned char *colorbv, int n, int span, unsigned char *dp, fz_glyph *glyph, int w, int h, int skip_x, int skip_y)\n{\n\tswitch (n)\n\t{\n\tcase 4:\n\t\tfz_paint_glyph_alpha_N(colorbv, 4, span, dp, glyph, w, h, skip_x, skip_y);\n\t\tbreak;\n\tcase 2:\n\t\tfz_paint_glyph_alpha_N(colorbv, 2, span, dp, glyph, w, h, skip_x, skip_y);\n\t\tbreak;\n\tdefault:\n\t\tfz_paint_glyph_alpha_N(colorbv, n, span, dp, glyph, w, h, skip_x, skip_y);\n\t\tbreak;\n\t}\n}\n\nstatic inline void\nfz_paint_glyph_solid(unsigned char *colorbv, int n, int span, unsigned char *dp, fz_glyph *glyph, int w, int h, int skip_x, int skip_y)\n{\n\tswitch (n)\n\t{\n\tcase 4:\n\t\tfz_paint_glyph_solid_N(colorbv, 4, span, dp, glyph, w, h, skip_x, skip_y);\n\t\tbreak;\n\tcase 2:\n\t\tfz_paint_glyph_solid_N(colorbv, 2, span, dp, glyph, w, h, skip_x, skip_y);\n\t\tbreak;\n\tdefault:\n\t\tfz_paint_glyph_solid_N(colorbv, n, span, dp, glyph, w, h, skip_x, skip_y);\n\t\tbreak;\n\t}\n}\n\nvoid\nfz_paint_glyph(unsigned char *colorbv, fz_pixmap *dst, unsigned char *dp, fz_glyph *glyph, int w, int h, int skip_x, int skip_y)\n{\n\tif (dst->colorspace)\n\t{\n\t\tif (colorbv[dst->n-1] == 255)\n\t\t\tfz_paint_glyph_solid(colorbv, dst->n, dst->w * dst->n, dp, glyph, w, h, skip_x, skip_y);\n\t\telse if (colorbv[dst->n-1] != 0)\n\t\t\tfz_paint_glyph_alpha(colorbv, dst->n, dst->w * dst->n, dp, glyph, w, h, skip_x, skip_y);\n\t}\n\telse\n\t\tfz_paint_glyph_mask(dst->w, dp, glyph, w, h, skip_x, skip_y);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/draw-path.c",
    "content": "#include \"mupdf/fitz.h\"\n#include \"draw-imp.h\"\n\n#define MAX_DEPTH 8\n\nstatic void\nline(fz_gel *gel, const fz_matrix *ctm, float x0, float y0, float x1, float y1)\n{\n\tfloat tx0 = ctm->a * x0 + ctm->c * y0 + ctm->e;\n\tfloat ty0 = ctm->b * x0 + ctm->d * y0 + ctm->f;\n\tfloat tx1 = ctm->a * x1 + ctm->c * y1 + ctm->e;\n\tfloat ty1 = ctm->b * x1 + ctm->d * y1 + ctm->f;\n\tfz_insert_gel(gel, tx0, ty0, tx1, ty1);\n}\n\nstatic void\nbezier(fz_gel *gel, const fz_matrix *ctm, float flatness,\n\tfloat xa, float ya,\n\tfloat xb, float yb,\n\tfloat xc, float yc,\n\tfloat xd, float yd, int depth)\n{\n\tfloat dmax;\n\tfloat xab, yab;\n\tfloat xbc, ybc;\n\tfloat xcd, ycd;\n\tfloat xabc, yabc;\n\tfloat xbcd, ybcd;\n\tfloat xabcd, yabcd;\n\n\t/* termination check */\n\tdmax = fz_abs(xa - xb);\n\tdmax = fz_max(dmax, fz_abs(ya - yb));\n\tdmax = fz_max(dmax, fz_abs(xd - xc));\n\tdmax = fz_max(dmax, fz_abs(yd - yc));\n\tif (dmax < flatness || depth >= MAX_DEPTH)\n\t{\n\t\tline(gel, ctm, xa, ya, xd, yd);\n\t\treturn;\n\t}\n\n\txab = xa + xb;\n\tyab = ya + yb;\n\txbc = xb + xc;\n\tybc = yb + yc;\n\txcd = xc + xd;\n\tycd = yc + yd;\n\n\txabc = xab + xbc;\n\tyabc = yab + ybc;\n\txbcd = xbc + xcd;\n\tybcd = ybc + ycd;\n\n\txabcd = xabc + xbcd;\n\tyabcd = yabc + ybcd;\n\n\txab *= 0.5f; yab *= 0.5f;\n\t/* xbc *= 0.5f; ybc *= 0.5f; */\n\txcd *= 0.5f; ycd *= 0.5f;\n\n\txabc *= 0.25f; yabc *= 0.25f;\n\txbcd *= 0.25f; ybcd *= 0.25f;\n\n\txabcd *= 0.125f; yabcd *= 0.125f;\n\n\tbezier(gel, ctm, flatness, xa, ya, xab, yab, xabc, yabc, xabcd, yabcd, depth + 1);\n\tbezier(gel, ctm, flatness, xabcd, yabcd, xbcd, ybcd, xcd, ycd, xd, yd, depth + 1);\n}\n\nvoid\nfz_flatten_fill_path(fz_gel *gel, fz_path *path, const fz_matrix *ctm, float flatness)\n{\n\tfloat x1, y1, x2, y2, x3, y3;\n\tfloat cx = 0;\n\tfloat cy = 0;\n\tfloat bx = 0;\n\tfloat by = 0;\n\tint i = 0, k = 0;\n\n\twhile (i < path->cmd_len)\n\t{\n\t\tswitch (path->cmds[i++])\n\t\t{\n\t\tcase FZ_MOVETO:\n\t\t\t/* implicit closepath before moveto */\n\t\t\tif (cx != bx || cy != by)\n\t\t\t\tline(gel, ctm, cx, cy, bx, by);\n\t\t\tx1 = path->coords[k++];\n\t\t\ty1 = path->coords[k++];\n\t\t\tcx = bx = x1;\n\t\t\tcy = by = y1;\n\t\t\tbreak;\n\n\t\tcase FZ_LINETO:\n\t\t\tx1 = path->coords[k++];\n\t\t\ty1 = path->coords[k++];\n\t\t\tline(gel, ctm, cx, cy, x1, y1);\n\t\t\tcx = x1;\n\t\t\tcy = y1;\n\t\t\tbreak;\n\n\t\tcase FZ_CURVETO:\n\t\t\tx1 = path->coords[k++];\n\t\t\ty1 = path->coords[k++];\n\t\t\tx2 = path->coords[k++];\n\t\t\ty2 = path->coords[k++];\n\t\t\tx3 = path->coords[k++];\n\t\t\ty3 = path->coords[k++];\n\t\t\tbezier(gel, ctm, flatness, cx, cy, x1, y1, x2, y2, x3, y3, 0);\n\t\t\tcx = x3;\n\t\t\tcy = y3;\n\t\t\tbreak;\n\n\t\tcase FZ_CLOSE_PATH:\n\t\t\tline(gel, ctm, cx, cy, bx, by);\n\t\t\tcx = bx;\n\t\t\tcy = by;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (cx != bx || cy != by)\n\t\tline(gel, ctm, cx, cy, bx, by);\n}\n\nstruct sctx\n{\n\tfz_gel *gel;\n\tconst fz_matrix *ctm;\n\tfloat flatness;\n\n\tint linejoin;\n\tfloat linewidth;\n\tfloat miterlimit;\n\tfz_point beg[2];\n\tfz_point seg[2];\n\tint sn;\n\tint dot;\n\tint from_bezier;\n\n\tfz_rect rect;\n\tconst float *dash_list;\n\tfloat dash_phase;\n\tint dash_len;\n\tfloat dash_total;\n\tint toggle, cap;\n\tint offset;\n\tfloat phase;\n\tfz_point cur;\n};\n\nstatic void\nfz_add_line(struct sctx *s, float x0, float y0, float x1, float y1)\n{\n\tfloat tx0 = s->ctm->a * x0 + s->ctm->c * y0 + s->ctm->e;\n\tfloat ty0 = s->ctm->b * x0 + s->ctm->d * y0 + s->ctm->f;\n\tfloat tx1 = s->ctm->a * x1 + s->ctm->c * y1 + s->ctm->e;\n\tfloat ty1 = s->ctm->b * x1 + s->ctm->d * y1 + s->ctm->f;\n\tfz_insert_gel(s->gel, tx0, ty0, tx1, ty1);\n}\n\nstatic void\nfz_add_arc(struct sctx *s,\n\tfloat xc, float yc,\n\tfloat x0, float y0,\n\tfloat x1, float y1)\n{\n\tfloat th0, th1, r;\n\tfloat theta;\n\tfloat ox, oy, nx, ny;\n\tint n, i;\n\n\tr = fabsf(s->linewidth);\n\ttheta = 2 * (float)M_SQRT2 * sqrtf(s->flatness / r);\n\tth0 = atan2f(y0, x0);\n\tth1 = atan2f(y1, x1);\n\n\tif (r > 0)\n\t{\n\t\tif (th0 < th1)\n\t\t\tth0 += (float)M_PI * 2;\n\t\tn = ceilf((th0 - th1) / theta);\n\t}\n\telse\n\t{\n\t\tif (th1 < th0)\n\t\t\tth1 += (float)M_PI * 2;\n\t\tn = ceilf((th1 - th0) / theta);\n\t}\n\n\tox = x0;\n\toy = y0;\n\tfor (i = 1; i < n; i++)\n\t{\n\t\ttheta = th0 + (th1 - th0) * i / n;\n\t\tnx = cosf(theta) * r;\n\t\tny = sinf(theta) * r;\n\t\tfz_add_line(s, xc + ox, yc + oy, xc + nx, yc + ny);\n\t\tox = nx;\n\t\toy = ny;\n\t}\n\n\tfz_add_line(s, xc + ox, yc + oy, xc + x1, yc + y1);\n}\n\nstatic void\nfz_add_line_stroke(struct sctx *s, fz_point a, fz_point b)\n{\n\tfloat dx = b.x - a.x;\n\tfloat dy = b.y - a.y;\n\tfloat scale = s->linewidth / sqrtf(dx * dx + dy * dy);\n\tfloat dlx = dy * scale;\n\tfloat dly = -dx * scale;\n\tfz_add_line(s, a.x - dlx, a.y - dly, b.x - dlx, b.y - dly);\n\tfz_add_line(s, b.x + dlx, b.y + dly, a.x + dlx, a.y + dly);\n}\n\nstatic void\nfz_add_line_join(struct sctx *s, fz_point a, fz_point b, fz_point c, int join_under)\n{\n\tfloat miterlimit = s->miterlimit;\n\tfloat linewidth = s->linewidth;\n\tfz_linejoin linejoin = s->linejoin;\n\tfloat dx0, dy0;\n\tfloat dx1, dy1;\n\tfloat dlx0, dly0;\n\tfloat dlx1, dly1;\n\tfloat dmx, dmy;\n\tfloat dmr2;\n\tfloat scale;\n\tfloat cross;\n\tfloat len0, len1;\n\n\tdx0 = b.x - a.x;\n\tdy0 = b.y - a.y;\n\n\tdx1 = c.x - b.x;\n\tdy1 = c.y - b.y;\n\n\tcross = dx1 * dy0 - dx0 * dy1;\n\t/* Ensure that cross >= 0 */\n\tif (cross < 0)\n\t{\n\t\tfloat tmp;\n\t\ttmp = dx1; dx1 = -dx0; dx0 = -tmp;\n\t\ttmp = dy1; dy1 = -dy0; dy0 = -tmp;\n\t\tcross = -cross;\n\t}\n\n\tlen0 = dx0 * dx0 + dy0 * dy0;\n\tif (len0 < FLT_EPSILON)\n\t{\n\t\tlinejoin = FZ_LINEJOIN_BEVEL;\n\t\tdlx0 = 0;\n\t\tdly0 = 0;\n\t}\n\telse\n\t{\n\t\tscale = linewidth / sqrtf(len0);\n\t\tdlx0 = dy0 * scale;\n\t\tdly0 = -dx0 * scale;\n\t}\n\n\tlen1 = dx1 * dx1 + dy1 * dy1;\n\tif (len1 < FLT_EPSILON)\n\t{\n\t\tlinejoin = FZ_LINEJOIN_BEVEL;\n\t\tdlx1 = 0;\n\t\tdly1 = 0;\n\t}\n\telse\n\t{\n\t\tscale = linewidth / sqrtf(len1);\n\t\tdlx1 = dy1 * scale;\n\t\tdly1 = -dx1 * scale;\n\t}\n\n\tdmx = (dlx0 + dlx1) * 0.5f;\n\tdmy = (dly0 + dly1) * 0.5f;\n\tdmr2 = dmx * dmx + dmy * dmy;\n\n\tif (cross * cross < FLT_EPSILON && dx0 * dx1 + dy0 * dy1 >= 0)\n\t\tlinejoin = FZ_LINEJOIN_BEVEL;\n\n\tif (join_under)\n\t{\n\t\tfz_add_line(s, b.x + dlx1, b.y + dly1, b.x + dlx0, b.y + dly0);\n\t}\n\telse\n\t{\n\t\tfz_add_line(s, b.x + dlx1, b.y + dly1, b.x, b.y);\n\t\tfz_add_line(s, b.x, b.y, b.x + dlx0, b.y + dly0);\n\t}\n\n\t/* XPS miter joins are clipped at miterlength, rather than simply\n\t * being converted to bevelled joins. */\n\tif (linejoin == FZ_LINEJOIN_MITER_XPS)\n\t{\n\t\tif (cross == 0)\n\t\t\tlinejoin = FZ_LINEJOIN_BEVEL;\n\t\telse if (dmr2 * miterlimit * miterlimit >= linewidth * linewidth)\n\t\t\tlinejoin = FZ_LINEJOIN_MITER;\n\t\telse\n\t\t{\n\t\t\tfloat k, t0x, t0y, t1x, t1y;\n\t\t\tscale = linewidth * linewidth / dmr2;\n\t\t\tdmx *= scale;\n\t\t\tdmy *= scale;\n\t\t\tk = (scale - linewidth * miterlimit / sqrtf(dmr2)) / (scale - 1);\n\t\t\tt0x = b.x - dmx + k * (dmx - dlx0);\n\t\t\tt0y = b.y - dmy + k * (dmy - dly0);\n\t\t\tt1x = b.x - dmx + k * (dmx - dlx1);\n\t\t\tt1y = b.y - dmy + k * (dmy - dly1);\n\n\t\t\tfz_add_line(s, b.x - dlx0, b.y - dly0, t0x, t0y);\n\t\t\tfz_add_line(s, t0x, t0y, t1x, t1y);\n\t\t\tfz_add_line(s, t1x, t1y, b.x - dlx1, b.y - dly1);\n\t\t}\n\t}\n\telse if (linejoin == FZ_LINEJOIN_MITER)\n\t\tif (dmr2 * miterlimit * miterlimit < linewidth * linewidth)\n\t\t\tlinejoin = FZ_LINEJOIN_BEVEL;\n\n\tif (linejoin == FZ_LINEJOIN_MITER)\n\t{\n\t\tscale = linewidth * linewidth / dmr2;\n\t\tdmx *= scale;\n\t\tdmy *= scale;\n\n\t\tfz_add_line(s, b.x - dlx0, b.y - dly0, b.x - dmx, b.y - dmy);\n\t\tfz_add_line(s, b.x - dmx, b.y - dmy, b.x - dlx1, b.y - dly1);\n\t}\n\n\tif (linejoin == FZ_LINEJOIN_BEVEL)\n\t{\n\t\tfz_add_line(s, b.x - dlx0, b.y - dly0, b.x - dlx1, b.y - dly1);\n\t}\n\n\tif (linejoin == FZ_LINEJOIN_ROUND)\n\t{\n\t\tfz_add_arc(s, b.x, b.y, -dlx0, -dly0, -dlx1, -dly1);\n\t}\n}\n\nstatic void\nfz_add_line_cap(struct sctx *s, fz_point a, fz_point b, fz_linecap linecap)\n{\n\tfloat flatness = s->flatness;\n\tfloat linewidth = s->linewidth;\n\n\tfloat dx = b.x - a.x;\n\tfloat dy = b.y - a.y;\n\n\tfloat scale = linewidth / sqrtf(dx * dx + dy * dy);\n\tfloat dlx = dy * scale;\n\tfloat dly = -dx * scale;\n\n\tif (linecap == FZ_LINECAP_BUTT)\n\t\tfz_add_line(s, b.x - dlx, b.y - dly, b.x + dlx, b.y + dly);\n\n\tif (linecap == FZ_LINECAP_ROUND)\n\t{\n\t\tint i;\n\t\tint n = ceilf((float)M_PI / (2.0f * (float)M_SQRT2 * sqrtf(flatness / linewidth)));\n\t\tfloat ox = b.x - dlx;\n\t\tfloat oy = b.y - dly;\n\t\tfor (i = 1; i < n; i++)\n\t\t{\n\t\t\tfloat theta = (float)M_PI * i / n;\n\t\t\tfloat cth = cosf(theta);\n\t\t\tfloat sth = sinf(theta);\n\t\t\tfloat nx = b.x - dlx * cth - dly * sth;\n\t\t\tfloat ny = b.y - dly * cth + dlx * sth;\n\t\t\tfz_add_line(s, ox, oy, nx, ny);\n\t\t\tox = nx;\n\t\t\toy = ny;\n\t\t}\n\t\tfz_add_line(s, ox, oy, b.x + dlx, b.y + dly);\n\t}\n\n\tif (linecap == FZ_LINECAP_SQUARE)\n\t{\n\t\tfz_add_line(s, b.x - dlx, b.y - dly,\n\t\t\tb.x - dlx - dly, b.y - dly + dlx);\n\t\tfz_add_line(s, b.x - dlx - dly, b.y - dly + dlx,\n\t\t\tb.x + dlx - dly, b.y + dly + dlx);\n\t\tfz_add_line(s, b.x + dlx - dly, b.y + dly + dlx,\n\t\t\tb.x + dlx, b.y + dly);\n\t}\n\n\tif (linecap == FZ_LINECAP_TRIANGLE)\n\t{\n\t\tfloat mx = -dly;\n\t\tfloat my = dlx;\n\t\tfz_add_line(s, b.x - dlx, b.y - dly, b.x + mx, b.y + my);\n\t\tfz_add_line(s, b.x + mx, b.y + my, b.x + dlx, b.y + dly);\n\t}\n}\n\nstatic void\nfz_add_line_dot(struct sctx *s, fz_point a)\n{\n\tfloat flatness = s->flatness;\n\tfloat linewidth = s->linewidth;\n\tint n = ceilf((float)M_PI / ((float)M_SQRT2 * sqrtf(flatness / linewidth)));\n\tfloat ox = a.x - linewidth;\n\tfloat oy = a.y;\n\tint i;\n\n\tfor (i = 1; i < n; i++)\n\t{\n\t\tfloat theta = (float)M_PI * 2 * i / n;\n\t\tfloat cth = cosf(theta);\n\t\tfloat sth = sinf(theta);\n\t\tfloat nx = a.x - cth * linewidth;\n\t\tfloat ny = a.y + sth * linewidth;\n\t\tfz_add_line(s, ox, oy, nx, ny);\n\t\tox = nx;\n\t\toy = ny;\n\t}\n\n\tfz_add_line(s, ox, oy, a.x - linewidth, a.y);\n}\n\nstatic void\nfz_stroke_flush(struct sctx *s, fz_linecap start_cap, fz_linecap end_cap)\n{\n\tif (s->sn == 2)\n\t{\n\t\tfz_add_line_cap(s, s->beg[1], s->beg[0], start_cap);\n\t\tfz_add_line_cap(s, s->seg[0], s->seg[1], end_cap);\n\t}\n\telse if (s->dot)\n\t{\n\t\tfz_add_line_dot(s, s->beg[0]);\n\t}\n}\n\nstatic void\nfz_stroke_moveto(struct sctx *s, fz_point cur)\n{\n\ts->seg[0] = cur;\n\ts->beg[0] = cur;\n\ts->sn = 1;\n\ts->dot = 0;\n\ts->from_bezier = 0;\n}\n\nstatic void\nfz_stroke_lineto(struct sctx *s, fz_point cur, int from_bezier)\n{\n\tfloat dx = cur.x - s->seg[s->sn-1].x;\n\tfloat dy = cur.y - s->seg[s->sn-1].y;\n\n\tif (dx * dx + dy * dy < FLT_EPSILON)\n\t{\n\t\tif (s->cap == FZ_LINECAP_ROUND || s->dash_list)\n\t\t\ts->dot = 1;\n\t\treturn;\n\t}\n\n\tfz_add_line_stroke(s, s->seg[s->sn-1], cur);\n\n\tif (s->sn == 2)\n\t{\n\t\tfz_add_line_join(s, s->seg[0], s->seg[1], cur, s->from_bezier & from_bezier);\n\t\ts->seg[0] = s->seg[1];\n\t\ts->seg[1] = cur;\n\t}\n\telse\n\t{\n\t\ts->seg[1] = cur;\n\t\ts->beg[1] = cur;\n\t\ts->sn = 2;\n\t}\n\ts->from_bezier = from_bezier;\n}\n\nstatic void\nfz_stroke_closepath(struct sctx *s)\n{\n\tif (s->sn == 2)\n\t{\n\t\tfz_stroke_lineto(s, s->beg[0], 0);\n\t\tif (s->seg[1].x == s->beg[0].x && s->seg[1].y == s->beg[0].y)\n\t\t\tfz_add_line_join(s, s->seg[0], s->beg[0], s->beg[1], 0);\n\t\telse\n\t\t\tfz_add_line_join(s, s->seg[1], s->beg[0], s->beg[1], 0);\n\t}\n\telse if (s->dot)\n\t{\n\t\tfz_add_line_dot(s, s->beg[0]);\n\t}\n\n\ts->seg[0] = s->beg[0];\n\ts->sn = 1;\n\ts->dot = 0;\n\ts->from_bezier = 0;\n}\n\nstatic void\nfz_stroke_bezier(struct sctx *s,\n\tfloat xa, float ya,\n\tfloat xb, float yb,\n\tfloat xc, float yc,\n\tfloat xd, float yd, int depth)\n{\n\tfloat dmax;\n\tfloat xab, yab;\n\tfloat xbc, ybc;\n\tfloat xcd, ycd;\n\tfloat xabc, yabc;\n\tfloat xbcd, ybcd;\n\tfloat xabcd, yabcd;\n\n\t/* termination check */\n\tdmax = fz_abs(xa - xb);\n\tdmax = fz_max(dmax, fz_abs(ya - yb));\n\tdmax = fz_max(dmax, fz_abs(xd - xc));\n\tdmax = fz_max(dmax, fz_abs(yd - yc));\n\tif (dmax < s->flatness || depth >= MAX_DEPTH)\n\t{\n\t\tfz_point p;\n\t\tp.x = xd;\n\t\tp.y = yd;\n\t\tfz_stroke_lineto(s, p, 1);\n\t\treturn;\n\t}\n\n\txab = xa + xb;\n\tyab = ya + yb;\n\txbc = xb + xc;\n\tybc = yb + yc;\n\txcd = xc + xd;\n\tycd = yc + yd;\n\n\txabc = xab + xbc;\n\tyabc = yab + ybc;\n\txbcd = xbc + xcd;\n\tybcd = ybc + ycd;\n\n\txabcd = xabc + xbcd;\n\tyabcd = yabc + ybcd;\n\n\txab *= 0.5f; yab *= 0.5f;\n\t/* xbc *= 0.5f; ybc *= 0.5f; */\n\txcd *= 0.5f; ycd *= 0.5f;\n\n\txabc *= 0.25f; yabc *= 0.25f;\n\txbcd *= 0.25f; ybcd *= 0.25f;\n\n\txabcd *= 0.125f; yabcd *= 0.125f;\n\n\tfz_stroke_bezier(s, xa, ya, xab, yab, xabc, yabc, xabcd, yabcd, depth + 1);\n\tfz_stroke_bezier(s, xabcd, yabcd, xbcd, ybcd, xcd, ycd, xd, yd, depth + 1);\n}\n\nvoid\nfz_flatten_stroke_path(fz_gel *gel, fz_path *path, const fz_stroke_state *stroke, const fz_matrix *ctm, float flatness, float linewidth)\n{\n\tstruct sctx s;\n\tfz_point p0, p1, p2, p3;\n\tint i, k;\n\n\ts.gel = gel;\n\ts.ctm = ctm;\n\ts.flatness = flatness;\n\n\ts.linejoin = stroke->linejoin;\n\ts.linewidth = linewidth * 0.5f; /* hairlines use a different value from the path value */\n\ts.miterlimit = stroke->miterlimit;\n\ts.sn = 0;\n\ts.dot = 0;\n\n\ts.dash_list = NULL;\n\ts.dash_phase = 0;\n\ts.dash_len = 0;\n\ts.toggle = 0;\n\ts.offset = 0;\n\ts.phase = 0;\n\n\ts.cap = stroke->start_cap;\n\n\tif (path->cmd_len > 0 && path->cmds[0] != FZ_MOVETO)\n\t\treturn;\n\n\tp0.x = p0.y = 0;\n\n\ti = k = 0;\n\twhile (i < path->cmd_len)\n\t{\n\t\tswitch (path->cmds[i++])\n\t\t{\n\t\tcase FZ_MOVETO:\n\t\t\tp1.x = path->coords[k++];\n\t\t\tp1.y = path->coords[k++];\n\t\t\tfz_stroke_flush(&s, stroke->start_cap, stroke->end_cap);\n\t\t\tfz_stroke_moveto(&s, p1);\n\t\t\tp0 = p1;\n\t\t\tbreak;\n\n\t\tcase FZ_LINETO:\n\t\t\tp1.x = path->coords[k++];\n\t\t\tp1.y = path->coords[k++];\n\t\t\tfz_stroke_lineto(&s, p1, 0);\n\t\t\tp0 = p1;\n\t\t\tbreak;\n\n\t\tcase FZ_CURVETO:\n\t\t\tp1.x = path->coords[k++];\n\t\t\tp1.y = path->coords[k++];\n\t\t\tp2.x = path->coords[k++];\n\t\t\tp2.y = path->coords[k++];\n\t\t\tp3.x = path->coords[k++];\n\t\t\tp3.y = path->coords[k++];\n\t\t\tfz_stroke_bezier(&s, p0.x, p0.y, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, 0);\n\t\t\tp0 = p3;\n\t\t\tbreak;\n\n\t\tcase FZ_CLOSE_PATH:\n\t\t\tfz_stroke_closepath(&s);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tfz_stroke_flush(&s, stroke->start_cap, stroke->end_cap);\n}\n\nstatic void\nfz_dash_moveto(struct sctx *s, fz_point a, fz_linecap start_cap, fz_linecap end_cap)\n{\n\ts->toggle = 1;\n\ts->offset = 0;\n\ts->phase = s->dash_phase;\n\n\twhile (s->phase >= s->dash_list[s->offset])\n\t{\n\t\ts->toggle = !s->toggle;\n\t\ts->phase -= s->dash_list[s->offset];\n\t\ts->offset ++;\n\t\tif (s->offset == s->dash_len)\n\t\t\ts->offset = 0;\n\t}\n\n\ts->cur = a;\n\n\tif (s->toggle)\n\t{\n\t\tfz_stroke_flush(s, s->cap, end_cap);\n\t\ts->cap = start_cap;\n\t\tfz_stroke_moveto(s, a);\n\t}\n}\n\nstatic void\nfz_dash_lineto(struct sctx *s, fz_point b, int dash_cap, int from_bezier)\n{\n\tfloat dx, dy, d;\n\tfloat total, used, ratio, tail;\n\tfz_point a;\n\tfz_point m;\n\tfz_point old_b;\n\tint n;\n\n\ta = s->cur;\n\tdx = b.x - a.x;\n\tdy = b.y - a.y;\n\tused = 0;\n\ttail = 0;\n\ttotal = sqrtf(dx * dx + dy * dy);\n\n\t/* If a is off screen, bring it onto the screen. First\n\t * horizontally... */\n\tif ((d = s->rect.x0 - a.x) > 0)\n\t{\n\t\tif (b.x < s->rect.x0)\n\t\t{\n\t\t\t/* Entirely off screen */\n\t\t\ttail = total;\n\t\t\told_b = b;\n\t\t\tgoto adjust_for_tail;\n\t\t}\n\t\ta.x = s->rect.x0;\t/* d > 0, dx > 0 */\n\t\tgoto a_moved_horizontally;\n\t}\n\telse if (d < 0 && (d = (s->rect.x1 - a.x)) < 0)\n\t{\n\t\tif (b.x > s->rect.x1)\n\t\t{\n\t\t\t/* Entirely off screen */\n\t\t\ttail = total;\n\t\t\told_b = b;\n\t\t\tgoto adjust_for_tail;\n\t\t}\n\t\ta.x = s->rect.x1;\t/* d < 0, dx < 0 */\na_moved_horizontally:\t/* d and dx have the same sign */\n\t\ta.y += dy * d/dx;\n\t\tused = total * d/dx;\n\t\ttotal -= used;\n\t\tdx = b.x - a.x;\n\t\tdy = b.y - a.y;\n\t}\n\t/* Then vertically... */\n\tif ((d = s->rect.y0 - a.y) > 0)\n\t{\n\t\tif (b.y < s->rect.y0)\n\t\t{\n\t\t\t/* Entirely off screen */\n\t\t\ttail = total;\n\t\t\told_b = b;\n\t\t\tgoto adjust_for_tail;\n\t\t}\n\t\ta.y = s->rect.y0;\t/* d > 0, dy > 0 */\n\t\tgoto a_moved_vertically;\n\t}\n\telse if (d < 0 && (d = (s->rect.y1 - a.y)) < 0)\n\t{\n\t\tif (b.y > s->rect.y1)\n\t\t{\n\t\t\t/* Entirely off screen */\n\t\t\ttail = total;\n\t\t\told_b = b;\n\t\t\tgoto adjust_for_tail;\n\t\t}\n\t\ta.y = s->rect.y1;\t/* d < 0, dy < 0 */\na_moved_vertically:\t/* d and dy have the same sign */\n\t\ta.x += dx * d/dy;\n\t\td = total * d/dy;\n\t\ttotal -= d;\n\t\tused += d;\n\t\tdx = b.x - a.x;\n\t\tdy = b.y - a.y;\n\t}\n\tif (used != 0.0f)\n\t{\n\t\t/* Update the position in the dash array */\n\t\tif (s->toggle)\n\t\t{\n\t\t\tfz_stroke_lineto(s, a, from_bezier);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_stroke_flush(s, s->cap, dash_cap);\n\t\t\ts->cap = dash_cap;\n\t\t\tfz_stroke_moveto(s, a);\n\t\t}\n\t\tused += s->phase;\n\t\tn = used/s->dash_total;\n\t\tused -= n*s->dash_total;\n\t\tif (n & s->dash_len & 1)\n\t\t\ts->toggle = !s->toggle;\n\t\twhile (used >= s->dash_list[s->offset])\n\t\t{\n\t\t\tused -= s->dash_list[s->offset];\n\t\t\ts->offset++;\n\t\t\tif (s->offset == s->dash_len)\n\t\t\t\ts->offset = 0;\n\t\t\ts->toggle = !s->toggle;\n\t\t}\n\t\tif (s->toggle)\n\t\t{\n\t\t\tfz_stroke_lineto(s, a, from_bezier);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_stroke_flush(s, s->cap, dash_cap);\n\t\t\ts->cap = dash_cap;\n\t\t\tfz_stroke_moveto(s, a);\n\t\t}\n\t\ts->phase = used;\n\t\tused = 0;\n\t}\n\n\t/* Now if b.x is off screen, bring it back */\n\tif ((d = b.x - s->rect.x0) < 0)\n\t{\n\t\told_b = b;\n\t\tb.x = s->rect.x0;\t/* d < 0, dx < 0 */\n\t\tgoto b_moved_horizontally;\n\t}\n\telse if (d > 0 && (d = (b.x - s->rect.x1)) > 0)\n\t{\n\t\told_b = b;\n\t\tb.x = s->rect.x1;\t/* d > 0, dx > 0 */\nb_moved_horizontally:\t/* d and dx have the same sign */\n\t\tb.y -= dy * d/dx;\n\t\ttail = total * d/dx;\n\t\ttotal -= tail;\n\t\tdx = b.x - a.x;\n\t\tdy = b.y - a.y;\n\t}\n\t/* Then vertically... */\n\tif ((d = b.y - s->rect.y0) < 0)\n\t{\n\t\told_b = b;\n\t\tb.y = s->rect.y0;\t/* d < 0, dy < 0 */\n\t\tgoto b_moved_vertically;\n\t}\n\telse if (d > 0 && (d = (b.y - s->rect.y1)) > 0)\n\t{\n\t\tfloat t;\n\t\told_b = b;\n\t\tb.y = s->rect.y1;\t/* d > 0, dy > 0 */\nb_moved_vertically:\t/* d and dy have the same sign */\n\t\tb.x -= dx * d/dy;\n\t\tt = total * d/dy;\n\t\ttail += t;\n\t\ttotal -= t;\n\t\tdx = b.x - a.x;\n\t\tdy = b.y - a.y;\n\t}\n\n\twhile (total - used > s->dash_list[s->offset] - s->phase)\n\t{\n\t\tused += s->dash_list[s->offset] - s->phase;\n\t\tratio = used / total;\n\t\tm.x = a.x + ratio * dx;\n\t\tm.y = a.y + ratio * dy;\n\n\t\tif (s->toggle)\n\t\t{\n\t\t\tfz_stroke_lineto(s, m, from_bezier);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_stroke_flush(s, s->cap, dash_cap);\n\t\t\ts->cap = dash_cap;\n\t\t\tfz_stroke_moveto(s, m);\n\t\t}\n\n\t\ts->toggle = !s->toggle;\n\t\ts->phase = 0;\n\t\ts->offset ++;\n\t\tif (s->offset == s->dash_len)\n\t\t\ts->offset = 0;\n\t}\n\n\ts->phase += total - used;\n\n\tif (tail == 0.0f)\n\t{\n\t\ts->cur = b;\n\n\t\tif (s->toggle)\n\t\t{\n\t\t\tfz_stroke_lineto(s, b, from_bezier);\n\t\t}\n\t}\n\telse\n\t{\nadjust_for_tail:\n\t\ts->cur = old_b;\n\t\t/* Update the position in the dash array */\n\t\tif (s->toggle)\n\t\t{\n\t\t\tfz_stroke_lineto(s, old_b, from_bezier);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_stroke_flush(s, s->cap, dash_cap);\n\t\t\ts->cap = dash_cap;\n\t\t\tfz_stroke_moveto(s, old_b);\n\t\t}\n\t\ttail += s->phase;\n\t\tn = tail/s->dash_total;\n\t\ttail -= n*s->dash_total;\n\t\tif (n & s->dash_len & 1)\n\t\t\ts->toggle = !s->toggle;\n\t\twhile (tail > s->dash_list[s->offset])\n\t\t{\n\t\t\ttail -= s->dash_list[s->offset];\n\t\t\ts->offset++;\n\t\t\tif (s->offset == s->dash_len)\n\t\t\t\ts->offset = 0;\n\t\t\ts->toggle = !s->toggle;\n\t\t}\n\t\tif (s->toggle)\n\t\t{\n\t\t\tfz_stroke_lineto(s, old_b, from_bezier);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_stroke_flush(s, s->cap, dash_cap);\n\t\t\ts->cap = dash_cap;\n\t\t\tfz_stroke_moveto(s, old_b);\n\t\t}\n\t\ts->phase = tail;\n\t}\n}\n\nstatic void\nfz_dash_bezier(struct sctx *s,\n\tfloat xa, float ya,\n\tfloat xb, float yb,\n\tfloat xc, float yc,\n\tfloat xd, float yd, int depth,\n\tint dash_cap)\n{\n\tfloat dmax;\n\tfloat xab, yab;\n\tfloat xbc, ybc;\n\tfloat xcd, ycd;\n\tfloat xabc, yabc;\n\tfloat xbcd, ybcd;\n\tfloat xabcd, yabcd;\n\n\t/* termination check */\n\tdmax = fz_abs(xa - xb);\n\tdmax = fz_max(dmax, fz_abs(ya - yb));\n\tdmax = fz_max(dmax, fz_abs(xd - xc));\n\tdmax = fz_max(dmax, fz_abs(yd - yc));\n\tif (dmax < s->flatness || depth >= MAX_DEPTH)\n\t{\n\t\tfz_point p;\n\t\tp.x = xd;\n\t\tp.y = yd;\n\t\tfz_dash_lineto(s, p, dash_cap, 1);\n\t\treturn;\n\t}\n\n\txab = xa + xb;\n\tyab = ya + yb;\n\txbc = xb + xc;\n\tybc = yb + yc;\n\txcd = xc + xd;\n\tycd = yc + yd;\n\n\txabc = xab + xbc;\n\tyabc = yab + ybc;\n\txbcd = xbc + xcd;\n\tybcd = ybc + ycd;\n\n\txabcd = xabc + xbcd;\n\tyabcd = yabc + ybcd;\n\n\txab *= 0.5f; yab *= 0.5f;\n\t/* xbc *= 0.5f; ybc *= 0.5f; */\n\txcd *= 0.5f; ycd *= 0.5f;\n\n\txabc *= 0.25f; yabc *= 0.25f;\n\txbcd *= 0.25f; ybcd *= 0.25f;\n\n\txabcd *= 0.125f; yabcd *= 0.125f;\n\n\tfz_dash_bezier(s, xa, ya, xab, yab, xabc, yabc, xabcd, yabcd, depth + 1, dash_cap);\n\tfz_dash_bezier(s, xabcd, yabcd, xbcd, ybcd, xcd, ycd, xd, yd, depth + 1, dash_cap);\n}\n\nvoid\nfz_flatten_dash_path(fz_gel *gel, fz_path *path, const fz_stroke_state *stroke, const fz_matrix *ctm, float flatness, float linewidth)\n{\n\tstruct sctx s;\n\tfz_point p0, p1, p2, p3, beg;\n\tfloat phase_len, max_expand;\n\tint i, k;\n\tfz_matrix inv;\n\n\ts.gel = gel;\n\ts.ctm = ctm;\n\ts.flatness = flatness;\n\n\ts.linejoin = stroke->linejoin;\n\ts.linewidth = linewidth * 0.5f;\n\ts.miterlimit = stroke->miterlimit;\n\ts.sn = 0;\n\ts.dot = 0;\n\n\ts.dash_list = stroke->dash_list;\n\ts.dash_phase = stroke->dash_phase;\n\ts.dash_len = stroke->dash_len;\n\ts.toggle = 0;\n\ts.offset = 0;\n\ts.phase = 0;\n\n\ts.cap = stroke->start_cap;\n\n\tif (path->cmd_len > 0 && path->cmds[0] != FZ_MOVETO)\n\t\treturn;\n\n\tphase_len = 0;\n\tfor (i = 0; i < stroke->dash_len; i++)\n\t\tphase_len += stroke->dash_list[i];\n\tif (stroke->dash_len > 0 && phase_len == 0)\n\t\treturn;\n\tfz_gel_scissor(gel, &s.rect);\n\tif (fz_try_invert_matrix(&inv, ctm))\n\t\treturn;\n\tfz_transform_rect(&s.rect, &inv);\n\ts.rect.x0 -= linewidth;\n\ts.rect.x1 += linewidth;\n\ts.rect.y0 -= linewidth;\n\ts.rect.y1 += linewidth;\n\n\tmax_expand = fz_matrix_max_expansion(ctm);\n\tif (phase_len < 1.0f && phase_len * max_expand < 0.5f)\n\t{\n\t\tfz_flatten_stroke_path(gel, path, stroke, ctm, flatness, linewidth);\n\t\treturn;\n\t}\n\ts.dash_total = phase_len;\n\n\t/* cf. http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=fd54bf89f2adfd5545202a6df87076fb7269f62c */\n\ts.dash_phase = fmodf(s.dash_phase, s.dash_total);\n\n\tp0.x = p0.y = 0;\n\ti = k = 0;\n\n\twhile (i < path->cmd_len)\n\t{\n\t\tswitch (path->cmds[i++])\n\t\t{\n\t\tcase FZ_MOVETO:\n\t\t\tp1.x = path->coords[k++];\n\t\t\tp1.y = path->coords[k++];\n\t\t\tfz_dash_moveto(&s, p1, stroke->start_cap, stroke->end_cap);\n\t\t\tbeg = p0 = p1;\n\t\t\tbreak;\n\n\t\tcase FZ_LINETO:\n\t\t\tp1.x = path->coords[k++];\n\t\t\tp1.y = path->coords[k++];\n\t\t\tfz_dash_lineto(&s, p1, stroke->dash_cap, 0);\n\t\t\tp0 = p1;\n\t\t\tbreak;\n\n\t\tcase FZ_CURVETO:\n\t\t\tp1.x = path->coords[k++];\n\t\t\tp1.y = path->coords[k++];\n\t\t\tp2.x = path->coords[k++];\n\t\t\tp2.y = path->coords[k++];\n\t\t\tp3.x = path->coords[k++];\n\t\t\tp3.y = path->coords[k++];\n\t\t\tfz_dash_bezier(&s, p0.x, p0.y, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, 0, stroke->dash_cap);\n\t\t\tp0 = p3;\n\t\t\tbreak;\n\n\t\tcase FZ_CLOSE_PATH:\n\t\t\tfz_dash_lineto(&s, beg, stroke->dash_cap, 0);\n\t\t\tp0 = p1 = beg;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tfz_stroke_flush(&s, s.cap, stroke->end_cap);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/draw-scale-simple.c",
    "content": "/*\nThis code does smooth scaling of a pixmap.\n\nThis function returns a new pixmap representing the area starting at (0,0)\ngiven by taking the source pixmap src, scaling it to width w, and height h,\nand then positioning it at (frac(x),frac(y)).\n\nThis is a cut-down version of draw_scale.c that only copes with filters\nthat return values strictly in the 0..1 range, and uses bytes for\nintermediate results rather than ints.\n*/\n\n#include \"mupdf/fitz.h\"\n#include \"draw-imp.h\"\n\n/* Do we special case handling of single pixel high/wide images? The\n * 'purest' handling is given by not special casing them, but certain\n * files that use such images 'stack' them to give full images. Not\n * special casing them results in then being fainter and giving noticeable\n * rounding errors.\n */\n#define SINGLE_PIXEL_SPECIALS\n\n#ifdef DEBUG_SCALING\n#ifdef WIN32\n#include <windows.h>\nstatic void debug_print(const char *fmt, ...)\n{\n\tva_list args;\n\tchar text[256];\n\tva_start(args, fmt);\n\tvsprintf(text, fmt, args);\n\tva_end(args);\n\tOutputDebugStringA(text);\n\tprintf(text);\n}\n#else\nstatic void debug_print(const char *fmt, ...)\n{\n\tva_list args;\n\tva_start(args, fmt);\n\tvfprintf(stderr, fmt, args);\n\tva_end(args);\n}\n#endif\n#endif\n#ifdef DEBUG_SCALING\n#define DBUG(A) debug_print A\n#else\n#define DBUG(A) do {} while(0==1)\n#endif\n\n/*\nConsider a row of source samples, src, of width src_w, positioned at x,\nscaled to width dst_w.\n\nsrc[i] is centred at: x + (i + 0.5)*dst_w/src_w\n\nTherefore the distance between the centre of the jth output pixel and\nthe centre of the ith source sample is:\n\ndist[j,i] = j + 0.5 - (x + (i + 0.5)*dst_w/src_w)\n\nWhen scaling up, therefore:\n\ndst[j] = SUM(filter(dist[j,i]) * src[i])\n\t(for all ints i)\n\nThis can be simplified by noticing that filters are only non zero within\na given filter width (henceforth called W). So:\n\ndst[j] = SUM(filter(dist[j,i]) * src[i])\n\t(for ints i, s.t. (j*src_w/dst_w)-W < i < (j*src_w/dst_w)+W)\n\nWhen scaling down, each filtered source sample is stretched to be wider\nto avoid aliasing issues. This effectively reduces the distance between\ncentres.\n\ndst[j] = SUM(filter(dist[j,i] * F) * F * src[i])\n\t(where F = dst_w/src_w)\n\t(for ints i, s.t. (j-W)/F < i < (j+W)/F)\n\n*/\n\ntypedef struct fz_scale_filter_s fz_scale_filter;\n\nstruct fz_scale_filter_s\n{\n\tint width;\n\tfloat (*fn)(fz_scale_filter *, float);\n};\n\n/* Image scale filters */\n\nstatic float\ntriangle(fz_scale_filter *filter, float f)\n{\n\tif (f >= 1)\n\t\treturn 0;\n\treturn 1-f;\n}\n\nstatic float\nbox(fz_scale_filter *filter, float f)\n{\n\tif (f >= 0.5f)\n\t\treturn 0;\n\treturn 1;\n}\n\nstatic float\nsimple(fz_scale_filter *filter, float x)\n{\n\tif (x >= 1)\n\t\treturn 0;\n\treturn 1 + (2*x - 3)*x*x;\n}\n\nfz_scale_filter fz_scale_filter_box = { 1, box };\nfz_scale_filter fz_scale_filter_triangle = { 1, triangle };\nfz_scale_filter fz_scale_filter_simple = { 1, simple };\n\n/*\nWe build ourselves a set of tables to contain the precalculated weights\nfor a given set of scale settings.\n\nThe first dst_w entries in index are the index into index of the\nsets of weight for each destination pixel.\n\nEach of the sets of weights is a set of values consisting of:\n\tthe minimum source pixel index used for this destination pixel\n\tthe number of weights used for this destination pixel\n\tthe weights themselves\n\nSo to calculate dst[i] we do the following:\n\n\tweights = &index[index[i]];\n\tmin = *weights++;\n\tlen = *weights++;\n\tdst[i] = 0;\n\twhile (--len > 0)\n\t\tdst[i] += src[min++] * *weights++\n\nin addition, we guarantee that at the end of this process weights will now\npoint to the weights value for dst pixel i+1.\n\nIn the simplest version of this algorithm, we would scale the whole image\nhorizontally first into a temporary buffer, then scale that temporary\nbuffer again vertically to give us our result. Using such a simple\nalgorithm would mean that could use the same style of weights for both\nhorizontal and vertical scaling.\n\nUnfortunately, this would also require a large temporary buffer,\nparticularly in the case where we are scaling up.\n\nWe therefore modify the algorithm as follows; we scale scanlines from the\nsource image horizontally into a temporary buffer, until we have all the\ncontributors for a given output scanline. We then produce that output\nscanline from the temporary buffer. In this way we restrict the height\nof the temporary buffer to a small fraction of the final size.\n\nUnfortunately, this means that the pseudo code for recombining a\nscanline of fully scaled pixels is as follows:\n\n\tweights = &index[index[y]];\n\tmin = *weights++;\n\tlen = *weights++;\n\tfor (x=0 to dst_w)\n\t\tmin2 = min\n\t\tlen2 = len\n\t\tweights2 = weights\n\t\tdst[x] = 0;\n\t\twhile (--len2 > 0)\n\t\t\tdst[x] += temp[x][(min2++) % tmp_buf_height] * *weights2++\n\ni.e. it requires a % operation for every source pixel - this is typically\nexpensive.\n\nTo avoid this, we alter the order in which vertical weights are stored,\nso that they are ordered in the same order as the temporary buffer lines\nwould appear. This simplifies the algorithm to:\n\n\tweights = &index[index[y]];\n\tmin = *weights++;\n\tlen = *weights++;\n\tfor (x=0 to dst_w)\n\t\tmin2 = 0\n\t\tlen2 = len\n\t\tweights2 = weights\n\t\tdst[x] = 0;\n\t\twhile (--len2 > 0)\n\t\t\tdst[x] += temp[i][min2++] * *weights2++\n\nThis means that len may be larger than it needs to be (due to the\npossible inclusion of a zero weight row or two), but in practise this\nis only an increase of 1 or 2 at worst.\n\nWe implement this by generating the weights as normal (but ensuring we\nleave enough space) and then reordering afterwards.\n\n*/\n\ntypedef struct fz_weights_s fz_weights;\n\n/* This structure is accessed from ARM code - bear this in mind before\n * altering it! */\nstruct fz_weights_s\n{\n\tint flip;\t/* true if outputting reversed */\n\tint count;\t/* number of output pixels we have records for in this table */\n\tint max_len;\t/* Maximum number of weights for any one output pixel */\n\tint n;\t\t/* number of components (src->n) */\n\tint new_line;\t/* True if no weights for the current output pixel */\n\tint patch_l;\t/* How many output pixels we skip over */\n\tint index[1];\n};\n\nstruct fz_scale_cache_s\n{\n\tint src_w;\n\tfloat x;\n\tfloat dst_w;\n\tfz_scale_filter *filter;\n\tint vertical;\n\tint dst_w_int;\n\tint patch_l;\n\tint patch_r;\n\tint n;\n\tint flip;\n\tfz_weights *weights;\n};\n\nstatic fz_weights *\nnew_weights(fz_context *ctx, fz_scale_filter *filter, int src_w, float dst_w, int patch_w, int n, int flip, int patch_l)\n{\n\tint max_len;\n\tfz_weights *weights;\n\n\tif (src_w > dst_w)\n\t{\n\t\t/* Scaling down, so there will be a maximum of\n\t\t * 2*filterwidth*src_w/dst_w src pixels\n\t\t * contributing to each dst pixel. */\n\t\tmax_len = (int)ceilf((2 * filter->width * src_w)/dst_w);\n\t\tif (max_len > src_w)\n\t\t\tmax_len = src_w;\n\t}\n\telse\n\t{\n\t\t/* Scaling up, so there will be a maximum of\n\t\t * 2*filterwidth src pixels contributing to each dst pixel.\n\t\t */\n\t\tmax_len = 2 * filter->width;\n\t}\n\t/* We need the size of the struct,\n\t * plus patch_w*sizeof(int) for the index\n\t * plus (2+max_len)*sizeof(int) for the weights\n\t * plus room for an extra set of weights for reordering.\n\t */\n\tweights = fz_malloc(ctx, sizeof(*weights)+(max_len+3)*(patch_w+1)*sizeof(int));\n\tif (!weights)\n\t\treturn NULL;\n\tweights->count = -1;\n\tweights->max_len = max_len;\n\tweights->index[0] = patch_w;\n\tweights->n = n;\n\tweights->patch_l = patch_l;\n\tweights->flip = flip;\n\treturn weights;\n}\n\n/* j is destination pixel in the patch_l..patch_l+patch_w range */\nstatic void\ninit_weights(fz_weights *weights, int j)\n{\n\tint index;\n\n\tj -= weights->patch_l;\n\tassert(weights->count == j-1);\n\tweights->count++;\n\tweights->new_line = 1;\n\tif (j == 0)\n\t\tindex = weights->index[0];\n\telse\n\t{\n\t\tindex = weights->index[j-1];\n\t\tindex += 2 + weights->index[index+1];\n\t}\n\tweights->index[j] = index; /* row pointer */\n\tweights->index[index] = 0; /* min */\n\tweights->index[index+1] = 0; /* len */\n}\n\nstatic void\nadd_weight(fz_weights *weights, int j, int i, fz_scale_filter *filter,\n\tfloat x, float F, float G, int src_w, float dst_w)\n{\n\tfloat dist = j - x + 0.5f - ((i + 0.5f)*dst_w/src_w);\n\tfloat f;\n\tint min, len, index, weight;\n\n\tdist *= G;\n\tif (dist < 0)\n\t\tdist = -dist;\n\tf = filter->fn(filter, dist)*F;\n\tweight = (int)(256*f+0.5f);\n\n\t/* Ensure i is in range */\n\tif (i < 0 || i >= src_w)\n\t\treturn;\n\tif (weight == 0)\n\t{\n\t\t/* We add a fudge factor here to allow for extreme downscales\n\t\t * where all the weights round to 0. Ensure that at least one\n\t\t * (arbitrarily the first one) is non zero. */\n\t\tif (weights->new_line && f > 0)\n\t\t\tweight = 1;\n\t\telse\n\t\t\treturn;\n\t}\n\n\tDBUG((\"add_weight[%d][%d] = %d(%g) dist=%g\\n\",j,i,weight,f,dist));\n\n\t/* Move j from patch_l...patch_l+patch_w range to 0..patch_w range */\n\tj -= weights->patch_l;\n\tif (weights->new_line)\n\t{\n\t\t/* New line */\n\t\tweights->new_line = 0;\n\t\tindex = weights->index[j]; /* row pointer */\n\t\tweights->index[index] = i; /* min */\n\t\tweights->index[index+1] = 0; /* len */\n\t}\n\tindex = weights->index[j];\n\tmin = weights->index[index++];\n\tlen = weights->index[index++];\n\twhile (i < min)\n\t{\n\t\t/* This only happens in rare cases, but we need to insert\n\t\t * one earlier. In exceedingly rare cases we may need to\n\t\t * insert more than one earlier. */\n\t\tint k;\n\n\t\tfor (k = len; k > 0; k--)\n\t\t{\n\t\t\tweights->index[index+k] = weights->index[index+k-1];\n\t\t}\n\t\tweights->index[index] = 0;\n\t\tmin--;\n\t\tlen++;\n\t\tweights->index[index-2] = min;\n\t\tweights->index[index-1] = len;\n\t}\n\tif (i-min >= len)\n\t{\n\t\t/* The usual case */\n\t\twhile (i-min >= ++len)\n\t\t{\n\t\t\tweights->index[index+len-1] = 0;\n\t\t}\n\t\tassert(len-1 == i-min);\n\t\tweights->index[index+i-min] = weight;\n\t\tweights->index[index-1] = len;\n\t\tassert(len <= weights->max_len);\n\t}\n\telse\n\t{\n\t\t/* Infrequent case */\n\t\tweights->index[index+i-min] += weight;\n\t}\n}\n\nstatic void\nreorder_weights(fz_weights *weights, int j, int src_w)\n{\n\tint idx = weights->index[j - weights->patch_l];\n\tint min = weights->index[idx++];\n\tint len = weights->index[idx++];\n\tint max = weights->max_len;\n\tint tmp = idx+max;\n\tint i, off;\n\n\t/* Copy into the temporary area */\n\tmemcpy(&weights->index[tmp], &weights->index[idx], sizeof(int)*len);\n\n\t/* Pad out if required */\n\tassert(len <= max);\n\tassert(min+len <= src_w);\n\toff = 0;\n\tif (len < max)\n\t{\n\t\tmemset(&weights->index[tmp+len], 0, sizeof(int)*(max-len));\n\t\tlen = max;\n\t\tif (min + len > src_w)\n\t\t{\n\t\t\toff = min + len - src_w;\n\t\t\tmin = src_w - len;\n\t\t\tweights->index[idx-2] = min;\n\t\t}\n\t\tweights->index[idx-1] = len;\n\t}\n\n\t/* Copy back into the proper places */\n\tfor (i = 0; i < len; i++)\n\t{\n\t\tweights->index[idx+((min+i+off) % max)] = weights->index[tmp+i];\n\t}\n}\n\n/* Due to rounding and edge effects, the sums for the weights sometimes don't\n * add up to 256. This causes visible rendering effects. Therefore, we take\n * pains to ensure that they 1) never exceed 256, and 2) add up to exactly\n * 256 for all pixels that are completely covered. See bug #691629. */\nstatic void\ncheck_weights(fz_weights *weights, int j, int w, float x, float wf)\n{\n\tint idx, len;\n\tint sum = 0;\n\tint max = -256;\n\tint maxidx = 0;\n\tint i;\n\n\tidx = weights->index[j - weights->patch_l];\n\tidx++; /* min */\n\tlen = weights->index[idx++];\n\n\tfor(i=0; i < len; i++)\n\t{\n\t\tint v = weights->index[idx++];\n\t\tsum += v;\n\t\tif (v > max)\n\t\t{\n\t\t\tmax = v;\n\t\t\tmaxidx = idx;\n\t\t}\n\t}\n\t/* If we aren't the first or last pixel, OR if the sum is too big\n\t * then adjust it. */\n\tif (((j != 0) && (j != w-1)) || (sum > 256))\n\t\tweights->index[maxidx-1] += 256-sum;\n\t/* Otherwise, if we are the first pixel, and it's fully covered, then\n\t * adjust it. */\n\telse if ((j == 0) && (x < 0.0001F) && (sum != 256))\n\t\tweights->index[maxidx-1] += 256-sum;\n\t/* Finally, if we are the last pixel, and it's fully covered, then\n\t * adjust it. */\n\telse if ((j == w-1) && ((float)w-wf < 0.0001F) && (sum != 256))\n\t\tweights->index[maxidx-1] += 256-sum;\n\tDBUG((\"total weight %d = %d\\n\", j, sum));\n}\n\nstatic fz_weights *\nmake_weights(fz_context *ctx, int src_w, float x, float dst_w, fz_scale_filter *filter, int vertical, int dst_w_int, int patch_l, int patch_r, int n, int flip, fz_scale_cache *cache)\n{\n\tfz_weights *weights;\n\tfloat F, G;\n\tfloat window;\n\tint j;\n\n\tif (cache)\n\t{\n\t\tif (cache->src_w == src_w && cache->x == x && cache->dst_w == dst_w &&\n\t\t\tcache->filter == filter && cache->vertical == vertical &&\n\t\t\tcache->dst_w_int == dst_w_int &&\n\t\t\tcache->patch_l == patch_l && cache->patch_r == patch_r &&\n\t\t\tcache->n == n && cache->flip == flip)\n\t\t{\n\t\t\treturn cache->weights;\n\t\t}\n\t\tcache->src_w = src_w;\n\t\tcache->x = x;\n\t\tcache->dst_w = dst_w;\n\t\tcache->filter = filter;\n\t\tcache->vertical = vertical;\n\t\tcache->dst_w_int = dst_w_int;\n\t\tcache->patch_l = patch_l;\n\t\tcache->patch_r = patch_r;\n\t\tcache->n = n;\n\t\tcache->flip = flip;\n\t\tfz_free(ctx, cache->weights);\n\t\tcache->weights = NULL;\n\t}\n\n\tif (dst_w < src_w)\n\t{\n\t\t/* Scaling down */\n\t\tF = dst_w / src_w;\n\t\tG = 1;\n\t}\n\telse\n\t{\n\t\t/* Scaling up */\n\t\tF = 1;\n\t\tG = src_w / dst_w;\n\t}\n\twindow = filter->width / F;\n\tDBUG((\"make_weights src_w=%d x=%g dst_w=%g patch_l=%d patch_r=%d F=%g window=%g\\n\", src_w, x, dst_w, patch_l, patch_r, F, window));\n\tweights\t= new_weights(ctx, filter, src_w, dst_w, patch_r-patch_l, n, flip, patch_l);\n\tif (!weights)\n\t\treturn NULL;\n\tfor (j = patch_l; j < patch_r; j++)\n\t{\n\t\t/* find the position of the centre of dst[j] in src space */\n\t\tfloat centre = (j - x + 0.5f)*src_w/dst_w - 0.5f;\n\t\tint l, r;\n\t\tl = ceilf(centre - window);\n\t\tr = floorf(centre + window);\n\t\tDBUG((\"%d: centre=%g l=%d r=%d\\n\", j, centre, l, r));\n\t\tinit_weights(weights, j);\n\t\tfor (; l <= r; l++)\n\t\t{\n\t\t\tadd_weight(weights, j, l, filter, x, F, G, src_w, dst_w);\n\t\t}\n\t\tcheck_weights(weights, j, dst_w_int, x, dst_w);\n\t\tif (vertical)\n\t\t{\n\t\t\treorder_weights(weights, j, src_w);\n\t\t}\n\t}\n\tweights->count++; /* weights->count = dst_w_int now */\n\tif (cache)\n\t{\n\t\tcache->weights = weights;\n\t}\n\treturn weights;\n}\n\nstatic void\nscale_row_to_temp(unsigned char *dst, unsigned char *src, fz_weights *weights)\n{\n\tint *contrib = &weights->index[weights->index[0]];\n\tint len, i, j, n;\n\tunsigned char *min;\n\tint tmp[FZ_MAX_COLORS];\n\tint *t = tmp;\n\n\tn = weights->n;\n\tfor (j = 0; j < n; j++)\n\t\ttmp[j] = 128;\n\tif (weights->flip)\n\t{\n\t\tdst += (weights->count-1)*n;\n\t\tfor (i=weights->count; i > 0; i--)\n\t\t{\n\t\t\tmin = &src[n * *contrib++];\n\t\t\tlen = *contrib++;\n\t\t\twhile (len-- > 0)\n\t\t\t{\n\t\t\t\tfor (j = n; j > 0; j--)\n\t\t\t\t\t*t++ += *min++ * *contrib;\n\t\t\t\tt -= n;\n\t\t\t\tcontrib++;\n\t\t\t}\n\t\t\tfor (j = n; j > 0; j--)\n\t\t\t{\n\t\t\t\t*dst++ = (unsigned char)(*t>>8);\n\t\t\t\t*t++ = 128;\n\t\t\t}\n\t\t\tt -= n;\n\t\t\tdst -= n*2;\n\t\t}\n\t}\n\telse\n\t{\n\t\tfor (i=weights->count; i > 0; i--)\n\t\t{\n\t\t\tmin = &src[n * *contrib++];\n\t\t\tlen = *contrib++;\n\t\t\twhile (len-- > 0)\n\t\t\t{\n\t\t\t\tfor (j = n; j > 0; j--)\n\t\t\t\t\t*t++ += *min++ * *contrib;\n\t\t\t\tt -= n;\n\t\t\t\tcontrib++;\n\t\t\t}\n\t\t\tfor (j = n; j > 0; j--)\n\t\t\t{\n\t\t\t\t*dst++ = (unsigned char)(*t>>8);\n\t\t\t\t*t++ = 128;\n\t\t\t}\n\t\t\tt -= n;\n\t\t}\n\t}\n}\n\n#ifdef ARCH_ARM\n\nstatic void\nscale_row_to_temp1(unsigned char *dst, unsigned char *src, fz_weights *weights)\n__attribute__((naked));\n\nstatic void\nscale_row_to_temp2(unsigned char *dst, unsigned char *src, fz_weights *weights)\n__attribute__((naked));\n\nstatic void\nscale_row_to_temp4(unsigned char *dst, unsigned char *src, fz_weights *weights)\n__attribute__((naked));\n\nstatic void\nscale_row_from_temp(unsigned char *dst, unsigned char *src, fz_weights *weights, int width, int row)\n__attribute__((naked));\n\nstatic void\nscale_row_to_temp1(unsigned char *dst, unsigned char *src, fz_weights *weights)\n{\n\tasm volatile(\n\tENTER_ARM\n\t\"stmfd\tr13!,{r4-r7,r9,r14}\t\t\t\t\\n\"\n\t\"@ r0 = dst\t\t\t\t\t\t\\n\"\n\t\"@ r1 = src\t\t\t\t\t\t\\n\"\n\t\"@ r2 = weights\t\t\t\t\t\t\\n\"\n\t\"ldr\tr12,[r2],#4\t\t@ r12= flip\t\t\\n\"\n\t\"ldr\tr3, [r2],#20\t\t@ r3 = count r2 = &index\\n\"\n\t\"ldr\tr4, [r2]\t\t@ r4 = index[0]\t\t\\n\"\n\t\"cmp\tr12,#0\t\t\t@ if (flip)\t\t\\n\"\n\t\"beq\t5f\t\t\t@ {\t\t\t\\n\"\n\t\"add\tr2, r2, r4, LSL #2\t@ r2 = &index[index[0]] \\n\"\n\t\"add\tr0, r0, r3\t\t@ dst += count\t\t\\n\"\n\t\"1:\t\t\t\t\t\t\t\\n\"\n\t\"ldr\tr4, [r2], #4\t\t@ r4 = *contrib++\t\\n\"\n\t\"ldr\tr9, [r2], #4\t\t@ r9 = len = *contrib++\t\\n\"\n\t\"mov\tr5, #128\t\t@ r5 = a = 128\t\t\\n\"\n\t\"add\tr4, r1, r4\t\t@ r4 = min = &src[r4]\t\\n\"\n\t\"subs\tr9, r9, #1\t\t@ len--\t\t\t\\n\"\n\t\"blt\t3f\t\t\t@ while (len >= 0)\t\\n\"\n\t\"2:\t\t\t\t@ {\t\t\t\\n\"\n\t\"ldrgt\tr6, [r2], #4\t\t@ r6 = *contrib++\t\\n\"\n\t\"ldrgtb\tr7, [r4], #1\t\t@ r7 = *min++\t\t\\n\"\n\t\"ldr\tr12,[r2], #4\t\t@ r12 = *contrib++\t\\n\"\n\t\"ldrb\tr14,[r4], #1\t\t@ r14 = *min++\t\t\\n\"\n\t\"mlagt\tr5, r6, r7, r5\t\t@ g += r6 * r7\t\t\\n\"\n\t\"subs\tr9, r9, #2\t\t@ r9 = len -= 2\t\t\\n\"\n\t\"mla\tr5, r12,r14,r5\t\t@ g += r14 * r12\t\\n\"\n\t\"bge\t2b\t\t\t@ }\t\t\t\\n\"\n\t\"3:\t\t\t\t\t\t\t\\n\"\n\t\"mov\tr5, r5, lsr #8\t\t@ g >>= 8\t\t\\n\"\n\t\"strb\tr5,[r0, #-1]!\t\t@ *--dst=a\t\t\\n\"\n\t\"subs\tr3, r3, #1\t\t@ i--\t\t\t\\n\"\n\t\"bgt\t1b\t\t\t@ \t\t\t\\n\"\n\t\"ldmfd\tr13!,{r4-r7,r9,PC}\t@ pop, return to thumb\t\\n\"\n\t\"5:\"\n\t\"add\tr2, r2, r4, LSL #2\t@ r2 = &index[index[0]] \\n\"\n\t\"6:\"\n\t\"ldr\tr4, [r2], #4\t\t@ r4 = *contrib++\t\\n\"\n\t\"ldr\tr9, [r2], #4\t\t@ r9 = len = *contrib++\t\\n\"\n\t\"mov\tr5, #128\t\t@ r5 = a = 128\t\t\\n\"\n\t\"add\tr4, r1, r4\t\t@ r4 = min = &src[r4]\t\\n\"\n\t\"subs\tr9, r9, #1\t\t@ len--\t\t\t\\n\"\n\t\"blt\t9f\t\t\t@ while (len > 0)\t\\n\"\n\t\"7:\t\t\t\t@ {\t\t\t\\n\"\n\t\"ldrgt\tr6, [r2], #4\t\t@ r6 = *contrib++\t\\n\"\n\t\"ldrgtb\tr7, [r4], #1\t\t@ r7 = *min++\t\t\\n\"\n\t\"ldr\tr12,[r2], #4\t\t@ r12 = *contrib++\t\\n\"\n\t\"ldrb\tr14,[r4], #1\t\t@ r14 = *min++\t\t\\n\"\n\t\"mlagt\tr5, r6,r7,r5\t\t@ a += r6 * r7\t\t\\n\"\n\t\"subs\tr9, r9, #2\t\t@ r9 = len -= 2\t\t\\n\"\n\t\"mla\tr5, r12,r14,r5\t\t@ a += r14 * r12\t\\n\"\n\t\"bge\t7b\t\t\t@ }\t\t\t\\n\"\n\t\"9:\t\t\t\t\t\t\t\\n\"\n\t\"mov\tr5, r5, LSR #8\t\t@ a >>= 8\t\t\\n\"\n\t\"strb\tr5, [r0], #1\t\t@ *dst++=a\t\t\\n\"\n\t\"subs\tr3, r3, #1\t\t@ i--\t\t\t\\n\"\n\t\"bgt\t6b\t\t\t@ \t\t\t\\n\"\n\t\"ldmfd\tr13!,{r4-r7,r9,PC}\t@ pop, return to thumb\t\\n\"\n\tENTER_THUMB\n\t);\n}\n\nstatic void\nscale_row_to_temp2(unsigned char *dst, unsigned char *src, fz_weights *weights)\n{\n\tasm volatile(\n\tENTER_ARM\n\t\"stmfd\tr13!,{r4-r6,r9-r11,r14}\t\t\t\t\\n\"\n\t\"@ r0 = dst\t\t\t\t\t\t\\n\"\n\t\"@ r1 = src\t\t\t\t\t\t\\n\"\n\t\"@ r2 = weights\t\t\t\t\t\t\\n\"\n\t\"ldr\tr12,[r2],#4\t\t@ r12= flip\t\t\\n\"\n\t\"ldr\tr3, [r2],#20\t\t@ r3 = count r2 = &index\\n\"\n\t\"ldr\tr4, [r2]\t\t@ r4 = index[0]\t\t\\n\"\n\t\"cmp\tr12,#0\t\t\t@ if (flip)\t\t\\n\"\n\t\"beq\t4f\t\t\t@ {\t\t\t\\n\"\n\t\"add\tr2, r2, r4, LSL #2\t@ r2 = &index[index[0]] \\n\"\n\t\"add\tr0, r0, r3, LSL #1\t@ dst += 2*count\t\\n\"\n\t\"1:\t\t\t\t\t\t\t\\n\"\n\t\"ldr\tr4, [r2], #4\t\t@ r4 = *contrib++\t\\n\"\n\t\"ldr\tr9, [r2], #4\t\t@ r9 = len = *contrib++\t\\n\"\n\t\"mov\tr5, #128\t\t@ r5 = g = 128\t\t\\n\"\n\t\"mov\tr6, #128\t\t@ r6 = a = 128\t\t\\n\"\n\t\"add\tr4, r1, r4, LSL #1\t@ r4 = min = &src[2*r4]\t\\n\"\n\t\"cmp\tr9, #0\t\t\t@ while (len-- > 0)\t\\n\"\n\t\"beq\t3f\t\t\t@ {\t\t\t\\n\"\n\t\"2:\t\t\t\t\t\t\t\\n\"\n\t\"ldr\tr14,[r2], #4\t\t@ r14 = *contrib++\t\\n\"\n\t\"ldrb\tr11,[r4], #1\t\t@ r11 = *min++\t\t\\n\"\n\t\"ldrb\tr12,[r4], #1\t\t@ r12 = *min++\t\t\\n\"\n\t\"subs\tr9, r9, #1\t\t@ r9 = len--\t\t\\n\"\n\t\"mla\tr5, r14,r11,r5\t\t@ g += r11 * r14\t\\n\"\n\t\"mla\tr6, r14,r12,r6\t\t@ a += r12 * r14\t\\n\"\n\t\"bgt\t2b\t\t\t@ }\t\t\t\\n\"\n\t\"3:\t\t\t\t\t\t\t\\n\"\n\t\"mov\tr5, r5, lsr #8\t\t@ g >>= 8\t\t\\n\"\n\t\"mov\tr6, r6, lsr #8\t\t@ a >>= 8\t\t\\n\"\n\t\"strb\tr5, [r0, #-2]!\t\t@ *--dst=a\t\t\\n\"\n\t\"strb\tr6, [r0, #1]\t\t@ *--dst=g\t\t\\n\"\n\t\"subs\tr3, r3, #1\t\t@ i--\t\t\t\\n\"\n\t\"bgt\t1b\t\t\t@ \t\t\t\\n\"\n\t\"ldmfd\tr13!,{r4-r6,r9-r11,PC}\t@ pop, return to thumb\t\\n\"\n\t\"4:\"\n\t\"add\tr2, r2, r4, LSL #2\t@ r2 = &index[index[0]] \\n\"\n\t\"5:\"\n\t\"ldr\tr4, [r2], #4\t\t@ r4 = *contrib++\t\\n\"\n\t\"ldr\tr9, [r2], #4\t\t@ r9 = len = *contrib++\t\\n\"\n\t\"mov\tr5, #128\t\t@ r5 = g = 128\t\t\\n\"\n\t\"mov\tr6, #128\t\t@ r6 = a = 128\t\t\\n\"\n\t\"add\tr4, r1, r4, LSL #1\t@ r4 = min = &src[2*r4]\t\\n\"\n\t\"cmp\tr9, #0\t\t\t@ while (len-- > 0)\t\\n\"\n\t\"beq\t7f\t\t\t@ {\t\t\t\\n\"\n\t\"6:\t\t\t\t\t\t\t\\n\"\n\t\"ldr\tr14,[r2], #4\t\t@ r10 = *contrib++\t\\n\"\n\t\"ldrb\tr11,[r4], #1\t\t@ r11 = *min++\t\t\\n\"\n\t\"ldrb\tr12,[r4], #1\t\t@ r12 = *min++\t\t\\n\"\n\t\"subs\tr9, r9, #1\t\t@ r9 = len--\t\t\\n\"\n\t\"mla\tr5, r14,r11,r5\t\t@ g += r11 * r14\t\\n\"\n\t\"mla\tr6, r14,r12,r6\t\t@ a += r12 * r14\t\\n\"\n\t\"bgt\t6b\t\t\t@ }\t\t\t\\n\"\n\t\"7:\t\t\t\t\t\t\t\\n\"\n\t\"mov\tr5, r5, lsr #8\t\t@ g >>= 8\t\t\\n\"\n\t\"mov\tr6, r6, lsr #8\t\t@ a >>= 8\t\t\\n\"\n\t\"strb\tr5, [r0], #1\t\t@ *dst++=g\t\t\\n\"\n\t\"strb\tr6, [r0], #1\t\t@ *dst++=a\t\t\\n\"\n\t\"subs\tr3, r3, #1\t\t@ i--\t\t\t\\n\"\n\t\"bgt\t5b\t\t\t@ \t\t\t\\n\"\n\t\"ldmfd\tr13!,{r4-r6,r9-r11,PC}\t@ pop, return to thumb\t\\n\"\n\tENTER_THUMB\n\t);\n}\n\nstatic void\nscale_row_to_temp4(unsigned char *dst, unsigned char *src, fz_weights *weights)\n{\n\tasm volatile(\n\tENTER_ARM\n\t\"stmfd\tr13!,{r4-r11,r14}\t\t\t\t\\n\"\n\t\"@ r0 = dst\t\t\t\t\t\t\\n\"\n\t\"@ r1 = src\t\t\t\t\t\t\\n\"\n\t\"@ r2 = weights\t\t\t\t\t\t\\n\"\n\t\"ldr\tr12,[r2],#4\t\t@ r12= flip\t\t\\n\"\n\t\"ldr\tr3, [r2],#20\t\t@ r3 = count r2 = &index\\n\"\n\t\"ldr\tr4, [r2]\t\t@ r4 = index[0]\t\t\\n\"\n\t\"ldr\tr5,=0x00800080\t\t@ r5 = rounding\t\t\\n\"\n\t\"ldr\tr6,=0x00FF00FF\t\t@ r7 = 0x00FF00FF\t\\n\"\n\t\"cmp\tr12,#0\t\t\t@ if (flip)\t\t\\n\"\n\t\"beq\t4f\t\t\t@ {\t\t\t\\n\"\n\t\"add\tr2, r2, r4, LSL #2\t@ r2 = &index[index[0]] \\n\"\n\t\"add\tr0, r0, r3, LSL #2\t@ dst += 4*count\t\\n\"\n\t\"1:\t\t\t\t\t\t\t\\n\"\n\t\"ldr\tr4, [r2], #4\t\t@ r4 = *contrib++\t\\n\"\n\t\"ldr\tr9, [r2], #4\t\t@ r9 = len = *contrib++\t\\n\"\n\t\"mov\tr7, r5\t\t\t@ r7 = b = rounding\t\\n\"\n\t\"mov\tr8, r5\t\t\t@ r8 = a = rounding\t\\n\"\n\t\"add\tr4, r1, r4, LSL #2\t@ r4 = min = &src[4*r4]\t\\n\"\n\t\"cmp\tr9, #0\t\t\t@ while (len-- > 0)\t\\n\"\n\t\"beq\t3f\t\t\t@ {\t\t\t\\n\"\n\t\"2:\t\t\t\t\t\t\t\\n\"\n\t\"ldr\tr11,[r4], #4\t\t@ r11 = *min++\t\t\\n\"\n\t\"ldr\tr10,[r2], #4\t\t@ r10 = *contrib++\t\\n\"\n\t\"subs\tr9, r9, #1\t\t@ r9 = len--\t\t\\n\"\n\t\"and\tr12,r6, r11\t\t@ r12 = __22__00\t\\n\"\n\t\"and\tr11,r6, r11,LSR #8\t@ r11 = __33__11\t\\n\"\n\t\"mla\tr7, r10,r12,r7\t\t@ b += r14 * r10\t\\n\"\n\t\"mla\tr8, r10,r11,r8\t\t@ a += r11 * r10\t\\n\"\n\t\"bgt\t2b\t\t\t@ }\t\t\t\\n\"\n\t\"3:\t\t\t\t\t\t\t\\n\"\n\t\"and\tr7, r6, r7, lsr #8\t@ r7 = __22__00\t\t\\n\"\n\t\"bic\tr8, r8, r6\t\t@ r8 = 33__11__\t\t\\n\"\n\t\"orr\tr7, r7, r8\t\t@ r7 = 33221100\t\t\\n\"\n\t\"str\tr7, [r0, #-4]!\t\t@ *--dst=r\t\t\\n\"\n\t\"subs\tr3, r3, #1\t\t@ i--\t\t\t\\n\"\n\t\"bgt\t1b\t\t\t@ \t\t\t\\n\"\n\t\"ldmfd\tr13!,{r4-r11,PC}\t@ pop, return to thumb\t\\n\"\n\t\"4:\t\t\t\t\t\t\t\\n\"\n\t\"add\tr2, r2, r4, LSL #2\t@ r2 = &index[index[0]] \\n\"\n\t\"5:\t\t\t\t\t\t\t\\n\"\n\t\"ldr\tr4, [r2], #4\t\t@ r4 = *contrib++\t\\n\"\n\t\"ldr\tr9, [r2], #4\t\t@ r9 = len = *contrib++\t\\n\"\n\t\"mov\tr7, r5\t\t\t@ r7 = b = rounding\t\\n\"\n\t\"mov\tr8, r5\t\t\t@ r8 = a = rounding\t\\n\"\n\t\"add\tr4, r1, r4, LSL #2\t@ r4 = min = &src[4*r4]\t\\n\"\n\t\"cmp\tr9, #0\t\t\t@ while (len-- > 0)\t\\n\"\n\t\"beq\t7f\t\t\t@ {\t\t\t\\n\"\n\t\"6:\t\t\t\t\t\t\t\\n\"\n\t\"ldr\tr11,[r4], #4\t\t@ r11 = *min++\t\t\\n\"\n\t\"ldr\tr10,[r2], #4\t\t@ r10 = *contrib++\t\\n\"\n\t\"subs\tr9, r9, #1\t\t@ r9 = len--\t\t\\n\"\n\t\"and\tr12,r6, r11\t\t@ r12 = __22__00\t\\n\"\n\t\"and\tr11,r6, r11,LSR #8\t@ r11 = __33__11\t\\n\"\n\t\"mla\tr7, r10,r12,r7\t\t@ b += r14 * r10\t\\n\"\n\t\"mla\tr8, r10,r11,r8\t\t@ a += r11 * r10\t\\n\"\n\t\"bgt\t6b\t\t\t@ }\t\t\t\\n\"\n\t\"7:\t\t\t\t\t\t\t\\n\"\n\t\"and\tr7, r6, r7, lsr #8\t@ r7 = __22__00\t\t\\n\"\n\t\"bic\tr8, r8, r6\t\t@ r8 = 33__11__\t\t\\n\"\n\t\"orr\tr7, r7, r8\t\t@ r7 = 33221100\t\t\\n\"\n\t\"str\tr7, [r0], #4\t\t@ *dst++=r\t\t\\n\"\n\t\"subs\tr3, r3, #1\t\t@ i--\t\t\t\\n\"\n\t\"bgt\t5b\t\t\t@ \t\t\t\\n\"\n\t\"ldmfd\tr13!,{r4-r11,PC}\t@ pop, return to thumb\t\\n\"\n\tENTER_THUMB\n\t);\n}\n\nstatic void\nscale_row_from_temp(unsigned char *dst, unsigned char *src, fz_weights *weights, int width, int row)\n{\n\tasm volatile(\n\tENTER_ARM\n\t\"ldr\tr12,[r13]\t\t@ r12= row\t\t\\n\"\n\t\"add\tr2, r2, #24\t\t@ r2 = weights->index\t\\n\"\n\t\"stmfd\tr13!,{r4-r11,r14}\t\t\t\t\\n\"\n\t\"@ r0 = dst\t\t\t\t\t\t\\n\"\n\t\"@ r1 = src\t\t\t\t\t\t\\n\"\n\t\"@ r2 = &weights->index[0]\t\t\t\t\\n\"\n\t\"@ r3 = width\t\t\t\t\t\t\\n\"\n\t\"@ r12= row\t\t\t\t\t\t\\n\"\n\t\"ldr\tr4, [r2, r12, LSL #2]\t@ r4 = index[row]\t\\n\"\n\t\"add\tr2, r2, #4\t\t@ r2 = &index[1]\t\\n\"\n\t\"subs\tr6, r3, #4\t\t@ r6 = x = width-4\t\\n\"\n\t\"ldr\tr14,[r2, r4, LSL #2]!\t@ r2 = contrib = index[index[row]+1]\\n\"\n\t\"\t\t\t\t@ r14= len = *contrib\t\\n\"\n\t\"blt\t4f\t\t\t@ while (x >= 0) {\t\\n\"\n#ifndef ARCH_ARM_CAN_LOAD_UNALIGNED\n\t\"tst\tr3, #3\t\t\t@ if ((r3 & 3)\t\t\\n\"\n\t\"tsteq\tr1, #3\t\t\t@\t|| (r1 & 3))\t\\n\"\n\t\"bne\t4f\t\t\t@ can't do fast code\t\\n\"\n#endif\n\t\"ldr\tr9, =0x00FF00FF\t\t@ r9 = 0x00FF00FF\t\\n\"\n\t\"1:\t\t\t\t\t\t\t\\n\"\n\t\"ldr\tr7, =0x00800080\t\t@ r5 = val0 = round\t\\n\"\n\t\"stmfd\tr13!,{r1,r2,r7}\t\t@ stash r1,r2,r5\t\\n\"\n\t\"\t\t\t\t@ r1 = min = src\t\\n\"\n\t\"\t\t\t\t@ r2 = contrib2-4\t\\n\"\n\t\"movs\tr8, r14\t\t\t@ r8 = len2 = len\t\\n\"\n\t\"mov\tr5, r7\t\t\t@ r7 = val1 = round\t\\n\"\n\t\"ble\t3f\t\t\t@ while (len2-- > 0) {\t\\n\"\n\t\"2:\t\t\t\t\t\t\t\\n\"\n\t\"ldr\tr12,[r1], r3\t\t@ r12 = *min\tr5 = min += width\\n\"\n\t\"ldr\tr10,[r2, #4]!\t\t@ r10 = *contrib2++\t\\n\"\n\t\"subs\tr8, r8, #1\t\t@ len2--\t\t\\n\"\n\t\"and\tr11,r9, r12\t\t@ r11= __22__00\t\t\\n\"\n\t\"and\tr12,r9, r12,LSR #8\t@ r12= __33__11\t\t\\n\"\n\t\"mla\tr5, r10,r11,r5\t\t@ r5 = val0 += r11 * r10\\n\"\n\t\"mla\tr7, r10,r12,r7\t\t@ r7 = val1 += r12 * r10\\n\"\n\t\"bgt\t2b\t\t\t@ }\t\t\t\\n\"\n\t\"and\tr5, r9, r5, LSR #8\t@ r5 = __22__00\t\t\\n\"\n\t\"and\tr7, r7, r9, LSL #8\t@ r7 = 33__11__\t\t\\n\"\n\t\"orr\tr5, r5, r7\t\t@ r5 = 33221100\t\t\\n\"\n\t\"3:\t\t\t\t\t\t\t\\n\"\n\t\"ldmfd\tr13!,{r1,r2,r7}\t\t@ restore r1,r2,r7\t\\n\"\n\t\"subs\tr6, r6, #4\t\t@ x--\t\t\t\\n\"\n\t\"add\tr1, r1, #4\t\t@ src++\t\t\t\\n\"\n\t\"str\tr5, [r0], #4\t\t@ *dst++ = val\t\t\\n\"\n\t\"bge\t1b\t\t\t@ \t\t\t\\n\"\n\t\"4:\t\t\t\t@ } (Less than 4 to go)\t\\n\"\n\t\"adds\tr6, r6, #4\t\t@ r6 = x += 4\t\t\\n\"\n\t\"beq\t8f\t\t\t@ if (x == 0) done\t\\n\"\n\t\"5:\t\t\t\t\t\t\t\\n\"\n\t\"mov\tr5, r1\t\t\t@ r5 = min = src\t\\n\"\n\t\"mov\tr7, #128\t\t@ r7 = val = 128\t\\n\"\n\t\"movs\tr8, r14\t\t\t@ r8 = len2 = len\t\\n\"\n\t\"add\tr9, r2, #4\t\t@ r9 = contrib2\t\t\\n\"\n\t\"ble\t7f\t\t\t@ while (len2-- > 0) {\t\\n\"\n\t\"6:\t\t\t\t\t\t\t\\n\"\n\t\"ldr\tr10,[r9], #4\t\t@ r10 = *contrib2++\t\\n\"\n\t\"ldrb\tr12,[r5], r3\t\t@ r12 = *min\tr5 = min += width\\n\"\n\t\"subs\tr8, r8, #1\t\t@ len2--\t\t\\n\"\n\t\"@ stall r12\t\t\t\t\t\t\\n\"\n\t\"mla\tr7, r10,r12,r7\t\t@ val += r12 * r10\t\\n\"\n\t\"bgt\t6b\t\t\t@ }\t\t\t\\n\"\n\t\"7:\t\t\t\t\t\t\t\\n\"\n\t\"mov\tr7, r7, asr #8\t\t@ r7 = val >>= 8\t\\n\"\n\t\"subs\tr6, r6, #1\t\t@ x--\t\t\t\\n\"\n\t\"add\tr1, r1, #1\t\t@ src++\t\t\t\\n\"\n\t\"strb\tr7, [r0], #1\t\t@ *dst++ = val\t\t\\n\"\n\t\"bgt\t5b\t\t\t@ \t\t\t\\n\"\n\t\"8:\t\t\t\t\t\t\t\\n\"\n\t\"ldmfd\tr13!,{r4-r11,PC}\t@ pop, return to thumb\t\\n\"\n\t\".ltorg\t\t\t\t\t\t\t\\n\"\n\tENTER_THUMB\n\t);\n}\n#else\n\nstatic void\nscale_row_to_temp1(unsigned char *dst, unsigned char *src, fz_weights *weights)\n{\n\tint *contrib = &weights->index[weights->index[0]];\n\tint len, i;\n\tunsigned char *min;\n\n\tassert(weights->n == 1);\n\tif (weights->flip)\n\t{\n\t\tdst += weights->count;\n\t\tfor (i=weights->count; i > 0; i--)\n\t\t{\n\t\t\tint val = 128;\n\t\t\tmin = &src[*contrib++];\n\t\t\tlen = *contrib++;\n\t\t\twhile (len-- > 0)\n\t\t\t{\n\t\t\t\tval += *min++ * *contrib++;\n\t\t\t}\n\t\t\t*--dst = (unsigned char)(val>>8);\n\t\t}\n\t}\n\telse\n\t{\n\t\tfor (i=weights->count; i > 0; i--)\n\t\t{\n\t\t\tint val = 128;\n\t\t\tmin = &src[*contrib++];\n\t\t\tlen = *contrib++;\n\t\t\twhile (len-- > 0)\n\t\t\t{\n\t\t\t\tval += *min++ * *contrib++;\n\t\t\t}\n\t\t\t*dst++ = (unsigned char)(val>>8);\n\t\t}\n\t}\n}\n\nstatic void\nscale_row_to_temp2(unsigned char *dst, unsigned char *src, fz_weights *weights)\n{\n\tint *contrib = &weights->index[weights->index[0]];\n\tint len, i;\n\tunsigned char *min;\n\n\tassert(weights->n == 2);\n\tif (weights->flip)\n\t{\n\t\tdst += 2*weights->count;\n\t\tfor (i=weights->count; i > 0; i--)\n\t\t{\n\t\t\tint c1 = 128;\n\t\t\tint c2 = 128;\n\t\t\tmin = &src[2 * *contrib++];\n\t\t\tlen = *contrib++;\n\t\t\twhile (len-- > 0)\n\t\t\t{\n\t\t\t\tc1 += *min++ * *contrib;\n\t\t\t\tc2 += *min++ * *contrib++;\n\t\t\t}\n\t\t\t*--dst = (unsigned char)(c2>>8);\n\t\t\t*--dst = (unsigned char)(c1>>8);\n\t\t}\n\t}\n\telse\n\t{\n\t\tfor (i=weights->count; i > 0; i--)\n\t\t{\n\t\t\tint c1 = 128;\n\t\t\tint c2 = 128;\n\t\t\tmin = &src[2 * *contrib++];\n\t\t\tlen = *contrib++;\n\t\t\twhile (len-- > 0)\n\t\t\t{\n\t\t\t\tc1 += *min++ * *contrib;\n\t\t\t\tc2 += *min++ * *contrib++;\n\t\t\t}\n\t\t\t*dst++ = (unsigned char)(c1>>8);\n\t\t\t*dst++ = (unsigned char)(c2>>8);\n\t\t}\n\t}\n}\n\nstatic void\nscale_row_to_temp4(unsigned char *dst, unsigned char *src, fz_weights *weights)\n{\n\tint *contrib = &weights->index[weights->index[0]];\n\tint len, i;\n\tunsigned char *min;\n\n\tassert(weights->n == 4);\n\tif (weights->flip)\n\t{\n\t\tdst += 4*weights->count;\n\t\tfor (i=weights->count; i > 0; i--)\n\t\t{\n\t\t\tint r = 128;\n\t\t\tint g = 128;\n\t\t\tint b = 128;\n\t\t\tint a = 128;\n\t\t\tmin = &src[4 * *contrib++];\n\t\t\tlen = *contrib++;\n\t\t\twhile (len-- > 0)\n\t\t\t{\n\t\t\t\tr += *min++ * *contrib;\n\t\t\t\tg += *min++ * *contrib;\n\t\t\t\tb += *min++ * *contrib;\n\t\t\t\ta += *min++ * *contrib++;\n\t\t\t}\n\t\t\t*--dst = (unsigned char)(a>>8);\n\t\t\t*--dst = (unsigned char)(b>>8);\n\t\t\t*--dst = (unsigned char)(g>>8);\n\t\t\t*--dst = (unsigned char)(r>>8);\n\t\t}\n\t}\n\telse\n\t{\n\t\tfor (i=weights->count; i > 0; i--)\n\t\t{\n\t\t\tint r = 128;\n\t\t\tint g = 128;\n\t\t\tint b = 128;\n\t\t\tint a = 128;\n\t\t\tmin = &src[4 * *contrib++];\n\t\t\tlen = *contrib++;\n\t\t\twhile (len-- > 0)\n\t\t\t{\n\t\t\t\tr += *min++ * *contrib;\n\t\t\t\tg += *min++ * *contrib;\n\t\t\t\tb += *min++ * *contrib;\n\t\t\t\ta += *min++ * *contrib++;\n\t\t\t}\n\t\t\t*dst++ = (unsigned char)(r>>8);\n\t\t\t*dst++ = (unsigned char)(g>>8);\n\t\t\t*dst++ = (unsigned char)(b>>8);\n\t\t\t*dst++ = (unsigned char)(a>>8);\n\t\t}\n\t}\n}\n\nstatic void\nscale_row_from_temp(unsigned char *dst, unsigned char *src, fz_weights *weights, int width, int row)\n{\n\tint *contrib = &weights->index[weights->index[row]];\n\tint len, x;\n\n\tcontrib++; /* Skip min */\n\tlen = *contrib++;\n\tfor (x=width; x > 0; x--)\n\t{\n\t\tunsigned char *min = src;\n\t\tint val = 128;\n\t\tint len2 = len;\n\t\tint *contrib2 = contrib;\n\n\t\twhile (len2-- > 0)\n\t\t{\n\t\t\tval += *min * *contrib2++;\n\t\t\tmin += width;\n\t\t}\n\t\t*dst++ = (unsigned char)(val>>8);\n\t\tsrc++;\n\t}\n}\n#endif\n\n#ifdef SINGLE_PIXEL_SPECIALS\nstatic void\nduplicate_single_pixel(unsigned char *dst, unsigned char *src, int n, int w, int h)\n{\n\tint i;\n\n\tfor (i = n; i > 0; i--)\n\t\t*dst++ = *src++;\n\tfor (i = (w*h-1)*n; i > 0; i--)\n\t{\n\t\t*dst = dst[-n];\n\t\tdst++;\n\t}\n}\n\nstatic void\nscale_single_row(unsigned char *dst, unsigned char *src, fz_weights *weights, int src_w, int h)\n{\n\tint *contrib = &weights->index[weights->index[0]];\n\tint min, len, i, j, n;\n\tint tmp[FZ_MAX_COLORS];\n\n\tn = weights->n;\n\t/* Scale a single row */\n\tfor (j = 0; j < n; j++)\n\t\ttmp[j] = 128;\n\tif (weights->flip)\n\t{\n\t\tdst += (weights->count-1)*n;\n\t\tfor (i=weights->count; i > 0; i--)\n\t\t{\n\t\t\tmin = *contrib++;\n\t\t\tlen = *contrib++;\n\t\t\tmin *= n;\n\t\t\twhile (len-- > 0)\n\t\t\t{\n\t\t\t\tfor (j = 0; j < n; j++)\n\t\t\t\t\ttmp[j] += src[min++] * *contrib;\n\t\t\t\tcontrib++;\n\t\t\t}\n\t\t\tfor (j = 0; j < n; j++)\n\t\t\t{\n\t\t\t\t*dst++ = (unsigned char)(tmp[j]>>8);\n\t\t\t\ttmp[j] = 128;\n\t\t\t}\n\t\t\tdst -= 2*n;\n\t\t}\n\t\tdst += n * (weights->count+1);\n\t}\n\telse\n\t{\n\t\tfor (i=weights->count; i > 0; i--)\n\t\t{\n\t\t\tmin = *contrib++;\n\t\t\tlen = *contrib++;\n\t\t\tmin *= n;\n\t\t\twhile (len-- > 0)\n\t\t\t{\n\t\t\t\tfor (j = 0; j < n; j++)\n\t\t\t\t\ttmp[j] += src[min++] * *contrib;\n\t\t\t\tcontrib++;\n\t\t\t}\n\t\t\tfor (j = 0; j < n; j++)\n\t\t\t{\n\t\t\t\t*dst++ = (unsigned char)(tmp[j]>>8);\n\t\t\t\ttmp[j] = 128;\n\t\t\t}\n\t\t}\n\t}\n\t/* And then duplicate it h times */\n\tn *= weights->count;\n\twhile (--h > 0)\n\t{\n\t\tmemcpy(dst, dst-n, n);\n\t\tdst += n;\n\t}\n}\n\nstatic void\nscale_single_col(unsigned char *dst, unsigned char *src, fz_weights *weights, int src_w, int n, int w, int flip_y)\n{\n\tint *contrib = &weights->index[weights->index[0]];\n\tint min, len, i, j;\n\tint tmp[FZ_MAX_COLORS];\n\n\tfor (j = 0; j < n; j++)\n\t\ttmp[j] = 128;\n\tif (flip_y)\n\t{\n\t\tsrc_w = (src_w-1)*n;\n\t\tw = (w-1)*n;\n\t\tfor (i=weights->count; i > 0; i--)\n\t\t{\n\t\t\t/* Scale the next pixel in the column */\n\t\t\tmin = *contrib++;\n\t\t\tlen = *contrib++;\n\t\t\tmin = src_w-min*n;\n\t\t\twhile (len-- > 0)\n\t\t\t{\n\t\t\t\tfor (j = 0; j < n; j++)\n\t\t\t\t\ttmp[j] += src[src_w-min+j] * *contrib;\n\t\t\t\tcontrib++;\n\t\t\t}\n\t\t\tfor (j = 0; j < n; j++)\n\t\t\t{\n\t\t\t\t*dst++ = (unsigned char)(tmp[j]>>8);\n\t\t\t\ttmp[j] = 128;\n\t\t\t}\n\t\t\t/* And then duplicate it across the row */\n\t\t\tfor (j = w; j > 0; j--)\n\t\t\t{\n\t\t\t\t*dst = dst[-n];\n\t\t\t\tdst++;\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\tw = (w-1)*n;\n\t\tfor (i=weights->count; i > 0; i--)\n\t\t{\n\t\t\t/* Scale the next pixel in the column */\n\t\t\tmin = *contrib++;\n\t\t\tlen = *contrib++;\n\t\t\tmin *= n;\n\t\t\twhile (len-- > 0)\n\t\t\t{\n\t\t\t\tfor (j = 0; j < n; j++)\n\t\t\t\t\ttmp[j] += src[min++] * *contrib;\n\t\t\t\tcontrib++;\n\t\t\t}\n\t\t\tfor (j = 0; j < n; j++)\n\t\t\t{\n\t\t\t\t*dst++ = (unsigned char)(tmp[j]>>8);\n\t\t\t\ttmp[j] = 128;\n\t\t\t}\n\t\t\t/* And then duplicate it across the row */\n\t\t\tfor (j = w; j > 0; j--)\n\t\t\t{\n\t\t\t\t*dst = dst[-n];\n\t\t\t\tdst++;\n\t\t\t}\n\t\t}\n\t}\n}\n#endif /* SINGLE_PIXEL_SPECIALS */\n\nfz_pixmap *\nfz_scale_pixmap(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, fz_irect *clip)\n{\n\treturn fz_scale_pixmap_cached(ctx, src, x, y, w, h, clip, NULL, NULL);\n}\n\nfz_pixmap *\nfz_scale_pixmap_cached(fz_context *ctx, fz_pixmap *src, float x, float y, float w, float h, const fz_irect *clip, fz_scale_cache *cache_x, fz_scale_cache *cache_y)\n{\n\tfz_scale_filter *filter = &fz_scale_filter_simple;\n\tfz_weights *contrib_rows = NULL;\n\tfz_weights *contrib_cols = NULL;\n\tfz_pixmap *output = NULL;\n\tunsigned char *temp = NULL;\n\tint max_row, temp_span, temp_rows, row;\n\tint dst_w_int, dst_h_int, dst_x_int, dst_y_int;\n\tint flip_x, flip_y;\n\tfz_rect patch;\n\n\tfz_var(contrib_cols);\n\tfz_var(contrib_rows);\n\n\tDBUG((\"Scale: (%d,%d) to (%g,%g) at (%g,%g)\\n\",src->w,src->h,w,h,x,y));\n\n\t/* Avoid extreme scales where overflows become problematic. */\n\tif (w > (1<<24) || h > (1<<24) || w < -(1<<24) || h < -(1<<24))\n\t\treturn NULL;\n\tif (x > (1<<24) || y > (1<<24) || x < -(1<<24) || y < -(1<<24))\n\t\treturn NULL;\n\n\t/* Clamp small ranges of w and h */\n\tif (w <= -1)\n\t{\n\t}\n\telse if (w < 0)\n\t{\n\t\tw = -1;\n\t}\n\telse if (w < 1)\n\t{\n\t\tw = 1;\n\t}\n\tif (h <= -1)\n\t{\n\t}\n\telse if (h < 0)\n\t{\n\t\th = -1;\n\t}\n\telse if (h < 1)\n\t{\n\t\th = 1;\n\t}\n\n\t/* Find the destination bbox, width/height, and sub pixel offset,\n\t * allowing for whether we're flipping or not. */\n\t/* The (x,y) position given describes where the top left corner\n\t * of the source image should be mapped to (i.e. where (0,0) in image\n\t * space ends up). Also there are differences in the way we scale\n\t * horizontally and vertically. When scaling rows horizontally, we\n\t * always read forwards through the source, and store either forwards\n\t * or in reverse as required. When scaling vertically, we always store\n\t * out forwards, but may feed source rows in in a different order.\n\t *\n\t * Consider the image rectangle 'r' to which the image is mapped,\n\t * and the (possibly) larger rectangle 'R', given by expanding 'r' to\n\t * complete pixels.\n\t *\n\t * x can either be r.xmin-R.xmin or R.xmax-r.xmax depending on whether\n\t * the image is x flipped or not. Whatever happens 0 <= x < 1.\n\t * y is always R.ymax - r.ymax.\n\t */\n\t/* dst_x_int is calculated to be the left of the scaled image, and\n\t * x (the sub pixel offset) is the distance in from either the left\n\t * or right pixel expanded edge. */\n\tflip_x = (w < 0);\n\tif (flip_x)\n\t{\n\t\tfloat tmp;\n\t\tw = -w;\n\t\tdst_x_int = floorf(x-w);\n\t\ttmp = ceilf(x);\n\t\tdst_w_int = (int)tmp;\n\t\tx = tmp - x;\n\t\tdst_w_int -= dst_x_int;\n\t}\n\telse\n\t{\n\t\tdst_x_int = floorf(x);\n\t\tx -= (float)dst_x_int;\n\t\tdst_w_int = (int)ceilf(x + w);\n\t}\n\t/* dst_y_int is calculated to be the top of the scaled image, and\n\t * y (the sub pixel offset) is the distance in from either the top\n\t * or bottom pixel expanded edge.\n\t */\n\tflip_y = (h < 0);\n\tif (flip_y)\n\t{\n\t\tfloat tmp;\n\t\th = -h;\n\t\tdst_y_int = floorf(y-h);\n\t\ttmp = ceilf(y);\n\t\tdst_h_int = (int)tmp;\n\t\ty = tmp - y;\n\t\tdst_h_int -= dst_y_int;\n\t}\n\telse\n\t{\n\t\tdst_y_int = floorf(y);\n\t\ty -= (float)dst_y_int;\n\t\tdst_h_int = (int)ceilf(y + h);\n\t}\n\n\tDBUG((\"Result image: (%d,%d) at (%d,%d) (subpix=%g,%g)\\n\", dst_w_int, dst_h_int, dst_x_int, dst_y_int, x, y));\n\n\t/* Step 0: Calculate the patch */\n\tpatch.x0 = 0;\n\tpatch.y0 = 0;\n\tpatch.x1 = dst_w_int;\n\tpatch.y1 = dst_h_int;\n\tif (clip)\n\t{\n\t\tDBUG((\"Clip: (%d,%d) -> (%d,%d)\\n\", clip->x0, clip->y0, clip->x1, clip->y1));\n\t\tif (flip_x)\n\t\t{\n\t\t\tif (dst_x_int + dst_w_int > clip->x1)\n\t\t\t\tpatch.x0 = dst_x_int + dst_w_int - clip->x1;\n\t\t\tif (clip->x0 > dst_x_int)\n\t\t\t{\n\t\t\t\tpatch.x1 = dst_w_int - (clip->x0 - dst_x_int);\n\t\t\t\tdst_x_int = clip->x0;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (dst_x_int + dst_w_int > clip->x1)\n\t\t\t\tpatch.x1 = clip->x1 - dst_x_int;\n\t\t\tif (clip->x0 > dst_x_int)\n\t\t\t{\n\t\t\t\tpatch.x0 = clip->x0 - dst_x_int;\n\t\t\t\tdst_x_int += patch.x0;\n\t\t\t}\n\t\t}\n\n\t\tif (flip_y)\n\t\t{\n\t\t\tif (dst_y_int + dst_h_int > clip->y1)\n\t\t\t\tpatch.y1 = clip->y1 - dst_y_int;\n\t\t\tif (clip->y0 > dst_y_int)\n\t\t\t{\n\t\t\t\tpatch.y0 = clip->y0 - dst_y_int;\n\t\t\t\tdst_y_int = clip->y0;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (dst_y_int + dst_h_int > clip->y1)\n\t\t\t\tpatch.y1 = clip->y1 - dst_y_int;\n\t\t\tif (clip->y0 > dst_y_int)\n\t\t\t{\n\t\t\t\tpatch.y0 = clip->y0 - dst_y_int;\n\t\t\t\tdst_y_int += patch.y0;\n\t\t\t}\n\t\t}\n\t}\n\tDBUG((\"Patch: (%g,%g) -> (%g,%g)\\n\", patch.x0, patch.y0, patch.x1, patch.y1));\n\tif (patch.x0 >= patch.x1 || patch.y0 >= patch.y1)\n\t\treturn NULL;\n\n\tfz_try(ctx)\n\t{\n\t\t/* Step 1: Calculate the weights for columns and rows */\n#ifdef SINGLE_PIXEL_SPECIALS\n\t\tif (src->w == 1)\n\t\t\tcontrib_cols = NULL;\n\t\telse\n#endif /* SINGLE_PIXEL_SPECIALS */\n\t\t\tcontrib_cols = make_weights(ctx, src->w, x, w, filter, 0, dst_w_int, patch.x0, patch.x1, src->n, flip_x, cache_x);\n#ifdef SINGLE_PIXEL_SPECIALS\n\t\tif (src->h == 1)\n\t\t\tcontrib_rows = NULL;\n\t\telse\n#endif /* SINGLE_PIXEL_SPECIALS */\n\t\t\tcontrib_rows = make_weights(ctx, src->h, y, h, filter, 1, dst_h_int, patch.y0, patch.y1, src->n, flip_y, cache_y);\n\n\t\toutput = fz_new_pixmap(ctx, src->colorspace, patch.x1 - patch.x0, patch.y1 - patch.y0);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tif (!cache_x)\n\t\t\tfz_free(ctx, contrib_cols);\n\t\tif (!cache_y)\n\t\t\tfz_free(ctx, contrib_rows);\n\t\tfz_rethrow(ctx);\n\t}\n\toutput->x = dst_x_int;\n\toutput->y = dst_y_int;\n\n\t/* Step 2: Apply the weights */\n#ifdef SINGLE_PIXEL_SPECIALS\n\tif (!contrib_rows)\n\t{\n\t\t/* Only 1 source pixel high. */\n\t\tif (!contrib_cols)\n\t\t{\n\t\t\t/* Only 1 pixel in the entire image! */\n\t\t\tduplicate_single_pixel(output->samples, src->samples, src->n, patch.x1-patch.x0, patch.y1-patch.y0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* Scale the row once, then copy it. */\n\t\t\tscale_single_row(output->samples, src->samples, contrib_cols, src->w, patch.y1-patch.y0);\n\t\t}\n\t}\n\telse if (!contrib_cols)\n\t{\n\t\t/* Only 1 source pixel wide. Scale the col and duplicate. */\n\t\tscale_single_col(output->samples, src->samples, contrib_rows, src->h, src->n, patch.x1-patch.x0, flip_y);\n\t}\n\telse\n#endif /* SINGLE_PIXEL_SPECIALS */\n\t{\n\t\tvoid (*row_scale)(unsigned char *dst, unsigned char *src, fz_weights *weights);\n\n\t\ttemp_span = contrib_cols->count * src->n;\n\t\ttemp_rows = contrib_rows->max_len;\n\t\tif (temp_span <= 0 || temp_rows > INT_MAX / temp_span)\n\t\t\tgoto cleanup;\n\t\tfz_try(ctx)\n\t\t{\n\t\t\ttemp = fz_calloc(ctx, temp_span*temp_rows, sizeof(unsigned char));\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_drop_pixmap(ctx, output);\n\t\t\tif (!cache_x)\n\t\t\t\tfz_free(ctx, contrib_cols);\n\t\t\tif (!cache_y)\n\t\t\t\tfz_free(ctx, contrib_rows);\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t\tswitch (src->n)\n\t\t{\n\t\tdefault:\n\t\t\trow_scale = scale_row_to_temp;\n\t\t\tbreak;\n\t\tcase 1: /* Image mask case */\n\t\t\trow_scale = scale_row_to_temp1;\n\t\t\tbreak;\n\t\tcase 2: /* Greyscale with alpha case */\n\t\t\trow_scale = scale_row_to_temp2;\n\t\t\tbreak;\n\t\tcase 4: /* RGBA */\n\t\t\trow_scale = scale_row_to_temp4;\n\t\t\tbreak;\n\t\t}\n\t\tmax_row = contrib_rows->index[contrib_rows->index[0]];\n\t\tfor (row = 0; row < contrib_rows->count; row++)\n\t\t{\n\t\t\t/*\n\t\t\tWhich source rows do we need to have scaled into the\n\t\t\ttemporary buffer in order to be able to do the final\n\t\t\tscale?\n\t\t\t*/\n\t\t\tint row_index = contrib_rows->index[row];\n\t\t\tint row_min = contrib_rows->index[row_index++];\n\t\t\tint row_len = contrib_rows->index[row_index];\n\t\t\twhile (max_row < row_min+row_len)\n\t\t\t{\n\t\t\t\t/* Scale another row */\n\t\t\t\tassert(max_row < src->h);\n\t\t\t\tDBUG((\"scaling row %d to temp\\n\", max_row));\n\t\t\t\t(*row_scale)(&temp[temp_span*(max_row % temp_rows)], &src->samples[(flip_y ? (src->h-1-max_row): max_row)*src->w*src->n], contrib_cols);\n\t\t\t\tmax_row++;\n\t\t\t}\n\n\t\t\tDBUG((\"scaling row %d from temp\\n\", row));\n\t\t\tscale_row_from_temp(&output->samples[row*output->w*output->n], temp, contrib_rows, temp_span, row);\n\t\t}\n\t\tfz_free(ctx, temp);\n\t}\n\ncleanup:\n\tif (!cache_y)\n\t\tfz_free(ctx, contrib_rows);\n\tif (!cache_x)\n\t\tfz_free(ctx, contrib_cols);\n\treturn output;\n}\n\nvoid\nfz_free_scale_cache(fz_context *ctx, fz_scale_cache *sc)\n{\n\tif (!sc)\n\t\treturn;\n\tfz_free(ctx, sc->weights);\n\tfz_free(ctx, sc);\n}\n\nfz_scale_cache *\nfz_new_scale_cache(fz_context *ctx)\n{\n\treturn fz_malloc_struct(ctx, fz_scale_cache);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/draw-unpack.c",
    "content": "#include \"mupdf/fitz.h\"\n#include \"draw-imp.h\"\n\n/* Unpack image samples and optionally pad pixels with opaque alpha */\n\n#define get1(buf,x) ((buf[x >> 3] >> ( 7 - (x & 7) ) ) & 1 )\n#define get2(buf,x) ((buf[x >> 2] >> ( ( 3 - (x & 3) ) << 1 ) ) & 3 )\n#define get4(buf,x) ((buf[x >> 1] >> ( ( 1 - (x & 1) ) << 2 ) ) & 15 )\n#define get8(buf,x) (buf[x])\n#define get16(buf,x) (buf[x << 1])\n\nstatic unsigned char get1_tab_1[256][8];\nstatic unsigned char get1_tab_1p[256][16];\nstatic unsigned char get1_tab_255[256][8];\nstatic unsigned char get1_tab_255p[256][16];\n\nstatic void\ninit_get1_tables(void)\n{\n\tstatic int once = 0;\n\tunsigned char bits[1];\n\tint i, k, x;\n\n\t/* TODO: mutex lock here */\n\n\tif (once)\n\t\treturn;\n\n\tfor (i = 0; i < 256; i++)\n\t{\n\t\tbits[0] = i;\n\t\tfor (k = 0; k < 8; k++)\n\t\t{\n\t\t\tx = get1(bits, k);\n\n\t\t\tget1_tab_1[i][k] = x;\n\t\t\tget1_tab_1p[i][k * 2] = x;\n\t\t\tget1_tab_1p[i][k * 2 + 1] = 255;\n\n\t\t\tget1_tab_255[i][k] = x * 255;\n\t\t\tget1_tab_255p[i][k * 2] = x * 255;\n\t\t\tget1_tab_255p[i][k * 2 + 1] = 255;\n\t\t}\n\t}\n\n\tonce = 1;\n}\n\nvoid\nfz_unpack_tile(fz_pixmap *dst, unsigned char * restrict src, int n, int depth, int stride, int scale)\n{\n\tint pad, x, y, k;\n\tint w = dst->w;\n\n\tpad = 0;\n\tif (dst->n > n)\n\t\tpad = 255;\n\n\tif (depth == 1)\n\t\tinit_get1_tables();\n\n\tif (scale == 0)\n\t{\n\t\tswitch (depth)\n\t\t{\n\t\tcase 1: scale = 255; break;\n\t\tcase 2: scale = 85; break;\n\t\tcase 4: scale = 17; break;\n\t\t}\n\t}\n\n\tfor (y = 0; y < dst->h; y++)\n\t{\n\t\tunsigned char *sp = src + (unsigned int)(y * stride);\n\t\tunsigned char *dp = dst->samples + (unsigned int)(y * dst->w * dst->n);\n\n\t\t/* Specialized loops */\n\n\t\tif (n == 1 && depth == 1 && scale == 1 && !pad)\n\t\t{\n\t\t\tint w3 = w >> 3;\n\t\t\tfor (x = 0; x < w3; x++)\n\t\t\t{\n\t\t\t\tmemcpy(dp, get1_tab_1[*sp++], 8);\n\t\t\t\tdp += 8;\n\t\t\t}\n\t\t\tx = x << 3;\n\t\t\tif (x < w)\n\t\t\t\tmemcpy(dp, get1_tab_1[*sp], w - x);\n\t\t}\n\n\t\telse if (n == 1 && depth == 1 && scale == 255 && !pad)\n\t\t{\n\t\t\tint w3 = w >> 3;\n\t\t\tfor (x = 0; x < w3; x++)\n\t\t\t{\n\t\t\t\tmemcpy(dp, get1_tab_255[*sp++], 8);\n\t\t\t\tdp += 8;\n\t\t\t}\n\t\t\tx = x << 3;\n\t\t\tif (x < w)\n\t\t\t\tmemcpy(dp, get1_tab_255[*sp], w - x);\n\t\t}\n\n\t\telse if (n == 1 && depth == 1 && scale == 1 && pad)\n\t\t{\n\t\t\tint w3 = w >> 3;\n\t\t\tfor (x = 0; x < w3; x++)\n\t\t\t{\n\t\t\t\tmemcpy(dp, get1_tab_1p[*sp++], 16);\n\t\t\t\tdp += 16;\n\t\t\t}\n\t\t\tx = x << 3;\n\t\t\tif (x < w)\n\t\t\t\tmemcpy(dp, get1_tab_1p[*sp], (w - x) << 1);\n\t\t}\n\n\t\telse if (n == 1 && depth == 1 && scale == 255 && pad)\n\t\t{\n\t\t\tint w3 = w >> 3;\n\t\t\tfor (x = 0; x < w3; x++)\n\t\t\t{\n\t\t\t\tmemcpy(dp, get1_tab_255p[*sp++], 16);\n\t\t\t\tdp += 16;\n\t\t\t}\n\t\t\tx = x << 3;\n\t\t\tif (x < w)\n\t\t\t\tmemcpy(dp, get1_tab_255p[*sp], (w - x) << 1);\n\t\t}\n\n\t\telse if (depth == 8 && !pad)\n\t\t{\n\t\t\tint len = w * n;\n\t\t\twhile (len--)\n\t\t\t\t*dp++ = *sp++;\n\t\t}\n\n\t\telse if (depth == 8 && pad)\n\t\t{\n\t\t\tfor (x = 0; x < w; x++)\n\t\t\t{\n\t\t\t\tfor (k = 0; k < n; k++)\n\t\t\t\t\t*dp++ = *sp++;\n\t\t\t\t*dp++ = 255;\n\t\t\t}\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\tint b = 0;\n\t\t\tfor (x = 0; x < w; x++)\n\t\t\t{\n\t\t\t\tfor (k = 0; k < n; k++)\n\t\t\t\t{\n\t\t\t\t\tswitch (depth)\n\t\t\t\t\t{\n\t\t\t\t\tcase 1: *dp++ = get1(sp, b) * scale; break;\n\t\t\t\t\tcase 2: *dp++ = get2(sp, b) * scale; break;\n\t\t\t\t\tcase 4: *dp++ = get4(sp, b) * scale; break;\n\t\t\t\t\tcase 8: *dp++ = get8(sp, b); break;\n\t\t\t\t\tcase 16: *dp++ = get16(sp, b); break;\n\t\t\t\t\t}\n\t\t\t\t\tb++;\n\t\t\t\t}\n\t\t\t\tif (pad)\n\t\t\t\t\t*dp++ = 255;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/* Apply decode array */\n\nvoid\nfz_decode_indexed_tile(fz_pixmap *pix, float *decode, int maxval)\n{\n\tint add[FZ_MAX_COLORS];\n\tint mul[FZ_MAX_COLORS];\n\tunsigned char *p = pix->samples;\n\tint len = pix->w * pix->h;\n\tint n = pix->n - 1;\n\tint needed;\n\tint k;\n\n\tneeded = 0;\n\tfor (k = 0; k < n; k++)\n\t{\n\t\tint min = decode[k * 2] * 256;\n\t\tint max = decode[k * 2 + 1] * 256;\n\t\tadd[k] = min;\n\t\tmul[k] = (max - min) / maxval;\n\t\tneeded |= min != 0 || max != maxval * 256;\n\t}\n\n\tif (!needed)\n\t\treturn;\n\n\twhile (len--)\n\t{\n\t\tfor (k = 0; k < n; k++)\n\t\t{\n\t\t\tint value = (add[k] + (((p[k] << 8) * mul[k]) >> 8)) >> 8;\n\t\t\tp[k] = fz_clampi(value, 0, 255);\n\t\t}\n\t\tp += n + 1;\n\t}\n}\n\nvoid\nfz_decode_tile(fz_pixmap *pix, float *decode)\n{\n\tint add[FZ_MAX_COLORS];\n\tint mul[FZ_MAX_COLORS];\n\tunsigned char *p = pix->samples;\n\tint len = pix->w * pix->h;\n\tint n = fz_maxi(1, pix->n - 1);\n\tint needed;\n\tint k;\n\n\tneeded = 0;\n\tfor (k = 0; k < n; k++)\n\t{\n\t\tint min = decode[k * 2] * 255;\n\t\tint max = decode[k * 2 + 1] * 255;\n\t\tadd[k] = min;\n\t\tmul[k] = max - min;\n\t\tneeded |= min != 0 || max != 255;\n\t}\n\n\tif (!needed)\n\t\treturn;\n\n\twhile (len--)\n\t{\n\t\tfor (k = 0; k < n; k++)\n\t\t{\n\t\t\tint value = add[k] + fz_mul255(p[k], mul[k]);\n\t\t\tp[k] = fz_clampi(value, 0, 255);\n\t\t}\n\t\tp += pix->n;\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/fitz/error.c",
    "content": "#include \"mupdf/fitz.h\"\n\n#ifdef USE_OUTPUT_DEBUG_STRING\n#include <windows.h>\n#endif\n\n/* Warning context */\n\nvoid fz_var_imp(void *var)\n{\n\tUNUSED(var); /* Do nothing */\n}\n\nvoid fz_flush_warnings(fz_context *ctx)\n{\n\tif (ctx->warn->count > 1)\n\t{\n\t\tfprintf(stderr, \"warning: ... repeated %d times ...\\n\", ctx->warn->count);\n\t\tLOGE(\"warning: ... repeated %d times ...\\n\", ctx->warn->count);\n\t}\n\tctx->warn->message[0] = 0;\n\tctx->warn->count = 0;\n}\n\n/* SumatraPDF: add filename and line number to errors and warnings */\nstatic inline char *get_base_name(char *path)\n{\n#ifdef _WIN32\n\tchar *last_sep = strrchr(path, '\\\\');\n#else\n\tchar *last_sep = strrchr(path, '/');\n#endif\n\treturn last_sep ? last_sep + 1 : path;\n}\n\nvoid fz_warn_imp(fz_context *ctx, char *file, int line, const char *fmt, ...)\n{\n\tva_list ap;\n\tchar buf[sizeof ctx->warn->message];\n\n\tva_start(ap, fmt);\n\tvsnprintf(buf, sizeof buf, fmt, ap);\n\tva_end(ap);\n#ifdef USE_OUTPUT_DEBUG_STRING\n\tOutputDebugStringA(buf);\n\tOutputDebugStringA(\"\\n\");\n#endif\n\n\tif (!strcmp(buf, ctx->warn->message))\n\t{\n\t\tctx->warn->count++;\n\t}\n\telse\n\t{\n\t\tfz_flush_warnings(ctx);\n\t\tfprintf(stderr, \"- %s:%d: %s\\n\", get_base_name(file), line, buf);\n\t\tLOGE(\"warning: %s\\n\", buf);\n\t\tfz_strlcpy(ctx->warn->message, buf, sizeof ctx->warn->message);\n\t\tctx->warn->count = 1;\n\t}\n}\n\n/* Error context */\n\n/* When we first setjmp, code is set to 0. Whenever we throw, we add 2 to\n * this code. Whenever we enter the always block, we add 1.\n *\n * fz_push_try sets code to 0.\n * If (fz_throw called within fz_try)\n *     fz_throw makes code = 2.\n *     If (no always block present)\n *         enter catch region with code = 2. OK.\n *     else\n *         fz_always entered as code < 3; Makes code = 3;\n *         if (fz_throw called within fz_always)\n *             fz_throw makes code = 5\n *             fz_always is not reentered.\n *             catch region entered with code = 5. OK.\n *         else\n *             catch region entered with code = 3. OK\n * else\n *     if (no always block present)\n *         catch region not entered as code = 0. OK.\n *     else\n *         fz_always entered as code < 3. makes code = 1\n *         if (fz_throw called within fz_always)\n *             fz_throw makes code = 3;\n *             fz_always NOT entered as code >= 3\n *             catch region entered with code = 3. OK.\n *         else\n *             catch region entered with code = 1.\n */\n\n/* SumatraPDF: force crash so that we get crash report */\ninline void fz_crash_abort()\n{\n\tchar *p = NULL;\n\t*p = 0;\n}\n\nFZ_NORETURN static void throw(fz_error_context *ex)\n{\n\tif (ex->top >= 0)\n\t{\n\t\tfz_longjmp(ex->stack[ex->top].buffer, ex->stack[ex->top].code + 2);\n\t}\n\telse\n\t{\n\t\tfprintf(stderr, \"uncaught exception: %s\\n\", ex->message);\n\t\tLOGE(\"uncaught exception: %s\\n\", ex->message);\n#ifdef USE_OUTPUT_DEBUG_STRING\n\t\tOutputDebugStringA(\"uncaught exception: \");\n\t\tOutputDebugStringA(ex->message);\n\t\tOutputDebugStringA(\"\\n\");\n#endif\n\t\tfz_crash_abort();\n\t}\n}\n\nint fz_push_try(fz_error_context *ex)\n{\n\tassert(ex);\n\tex->top++;\n\t/* Normal case, get out of here quick */\n\tif (ex->top < nelem(ex->stack)-1)\n\t\treturn 1; /* We exit here, and the setjmp sets the code to 0 */\n\t/* We reserve the top slot on the exception stack purely to cope with\n\t * the case when we overflow. If we DO hit this, then we 'throw'\n\t * immediately - returning 0 stops the setjmp happening and takes us\n\t * direct to the always/catch clauses. */\n\tassert(ex->top == nelem(ex->stack)-1);\n\tstrcpy(ex->message, \"exception stack overflow!\");\n\tex->stack[ex->top].code = 2;\n\t/* SumatraPDF: add filename and line number to errors and warnings */\n\tfprintf(stderr, \"! %s:%d: %s\\n\", get_base_name(__FILE__), __LINE__, ex->message);\n\tLOGE(\"error: %s\\n\", ex->message);\n\t/* cf. http://bugs.ghostscript.com/show_bug.cgi?id=695948 */\n\t/* cf. http://git.ghostscript.com/?p=user/robin/mupdf.git;a=commitdiff;h=3decd1bbaeba261943fc2ff5a731deeb0c18e0b9 */\n\tex->errcode = FZ_ERROR_GENERIC;\n\tex->top--;\n\tthrow(ex);\n}\n\nint fz_caught(fz_context *ctx)\n{\n\tassert(ctx && ctx->error && ctx->error->errcode >= FZ_ERROR_NONE);\n\treturn ctx->error->errcode;\n}\n\nconst char *fz_caught_message(fz_context *ctx)\n{\n\tassert(ctx && ctx->error && ctx->error->errcode >= FZ_ERROR_NONE);\n\treturn ctx->error->message;\n}\n\n/* SumatraPDF: add filename and line number to errors and warnings */\nvoid fz_throw_imp(fz_context *ctx, char *file, int line, int code, const char *fmt, ...)\n{\n\tva_list args;\n\tctx->error->errcode = code;\n\tva_start(args, fmt);\n\tvsnprintf(ctx->error->message, sizeof ctx->error->message, fmt, args);\n\tva_end(args);\n\n\tif (code != FZ_ERROR_ABORT)\n\t{\n\t\tfz_flush_warnings(ctx);\n\t\tfprintf(stderr, \"! %s:%d: %s\\n\", get_base_name(file), line, ctx->error->message);\n\t\tLOGE(\"error: %s\\n\", ctx->error->message);\n#ifdef USE_OUTPUT_DEBUG_STRING\n\t\tOutputDebugStringA(\"error: \");\n\t\tOutputDebugStringA(ctx->error->message);\n\t\tOutputDebugStringA(\"\\n\");\n#endif\n\t}\n\n\tthrow(ctx->error);\n}\n\nvoid fz_rethrow(fz_context *ctx)\n{\n\tassert(ctx && ctx->error && ctx->error->errcode >= FZ_ERROR_NONE);\n\tthrow(ctx->error);\n}\n\n/* SumatraPDF: add filename and line number to errors and warnings */\nvoid fz_rethrow_message_imp(fz_context *ctx, char *file, int line, const char *fmt, ...)\n{\n\tva_list args;\n\n\tassert(ctx && ctx->error && ctx->error->errcode >= FZ_ERROR_NONE);\n\n\tva_start(args, fmt);\n\tvsnprintf(ctx->error->message, sizeof ctx->error->message, fmt, args);\n\tva_end(args);\n\n\tif (ctx->error->errcode != FZ_ERROR_ABORT)\n\t{\n\t\tfz_flush_warnings(ctx);\n\t\tfprintf(stderr, \"! %s:%d: %s\\n\", get_base_name(file), line, ctx->error->message);\n\t\tLOGE(\"error: %s\\n\", ctx->error->message);\n#ifdef USE_OUTPUT_DEBUG_STRING\n\t\tOutputDebugStringA(\"error: \");\n\t\tOutputDebugStringA(ctx->error->message);\n\t\tOutputDebugStringA(\"\\n\");\n#endif\n\t}\n\n\tthrow(ctx->error);\n}\n\nvoid fz_rethrow_if(fz_context *ctx, int err)\n{\n\tassert(ctx && ctx->error && ctx->error->errcode >= FZ_ERROR_NONE);\n\tif (ctx->error->errcode == err)\n\t\tfz_rethrow(ctx);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/filter-basic.c",
    "content": "#include \"mupdf/fitz.h\"\n\n/* Pretend we have a filter that just copies data forever */\n\nfz_stream *\nfz_open_copy(fz_stream *chain)\n{\n\treturn fz_keep_stream(chain);\n}\n\n/* Null filter copies a specified amount of data */\n\nstruct null_filter\n{\n\tfz_stream *chain;\n\tint remain;\n\tint offset;\n\tunsigned char buffer[4096];\n};\n\nstatic int\nnext_null(fz_stream *stm, int max)\n{\n\tstruct null_filter *state = stm->state;\n\tint n;\n\n\tif (state->remain == 0)\n\t\treturn EOF;\n\tfz_seek(state->chain, state->offset, 0);\n\tn = fz_available(state->chain, max);\n\tif (n > state->remain)\n\t\tn = state->remain;\n\tif (n > sizeof(state->buffer))\n\t\tn = sizeof(state->buffer);\n\tmemcpy(state->buffer, state->chain->rp, n);\n\tstm->rp = state->buffer;\n\tstm->wp = stm->rp + n;\n\tif (n == 0)\n\t\treturn EOF;\n\tstate->chain->rp += n;\n\tstate->remain -= n;\n\tstate->offset += n;\n\tstm->pos += n;\n\treturn *stm->rp++;\n}\n\nstatic void\nclose_null(fz_context *ctx, void *state_)\n{\n\tstruct null_filter *state = (struct null_filter *)state_;\n\tfz_stream *chain = state->chain;\n\tfz_free(ctx, state);\n\tfz_close(chain);\n}\n\nstatic fz_stream *\nrebind_null(fz_stream *s)\n{\n\tstruct null_filter *state = s->state;\n\treturn state->chain;\n}\n\nfz_stream *\nfz_open_null(fz_stream *chain, int len, int offset)\n{\n\tstruct null_filter *state;\n\tfz_context *ctx = chain->ctx;\n\n\tif (len < 0)\n\t\tlen = 0;\n\tfz_try(ctx)\n\t{\n\t\tstate = fz_malloc_struct(ctx, struct null_filter);\n\t\tstate->chain = chain;\n\t\tstate->remain = len;\n\t\tstate->offset = offset;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_close(chain);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn fz_new_stream(ctx, state, next_null, close_null, rebind_null);\n}\n\n/* Concat filter concatenates several streams into one */\n\nstruct concat_filter\n{\n\tint max;\n\tint count;\n\tint current;\n\tint pad; /* 1 if we should add whitespace padding between streams */\n\tunsigned char ws_buf;\n\tfz_stream *chain[1];\n};\n\nstatic int\nnext_concat(fz_stream *stm, int max)\n{\n\tstruct concat_filter *state = (struct concat_filter *)stm->state;\n\tint n;\n\n\twhile (state->current < state->count)\n\t{\n\t\t/* Read the next block of underlying data. */\n\t\tif (stm->wp == state->chain[state->current]->wp)\n\t\t\tstate->chain[state->current]->rp = stm->wp;\n\t\tn = fz_available(state->chain[state->current], max);\n\t\tif (n)\n\t\t{\n\t\t\tstm->rp = state->chain[state->current]->rp;\n\t\t\tstm->wp = state->chain[state->current]->wp;\n\t\t\tstm->pos += n;\n\t\t\treturn *stm->rp++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (state->chain[state->current]->error)\n\t\t\t{\n\t\t\t\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=1239 */\n\t\t\t\tfz_warn(stm->ctx, \"skipping to next stream part on error\");\n\t\t\t}\n\t\t\tstate->current++;\n\t\t\tfz_close(state->chain[state->current-1]);\n\t\t\tif (state->pad)\n\t\t\t{\n\t\t\t\t/* SumatraPDF: force-close strings at PDF stream boundaries */\n\t\t\t\tif (state->pad == 5)\n\t\t\t\t{\n\t\t\t\t\tstm->rp = (unsigned char *)\"\\n%)>\\n\";\n\t\t\t\t\tstm->wp = stm->rp + 5;\n\t\t\t\t\tstm->pos += 5;\n\t\t\t\t\treturn *stm->rp++;\n\t\t\t\t}\n\t\t\t\tstm->rp = (&state->ws_buf)+1;\n\t\t\t\tstm->wp = stm->rp + 1;\n\t\t\t\tstm->pos++;\n\t\t\t\treturn 32;\n\t\t\t}\n\t\t}\n\t}\n\n\tstm->rp = stm->wp;\n\n\treturn EOF;\n}\n\nstatic void\nclose_concat(fz_context *ctx, void *state_)\n{\n\tstruct concat_filter *state = (struct concat_filter *)state_;\n\tint i;\n\n\tfor (i = state->current; i < state->count; i++)\n\t{\n\t\tfz_close(state->chain[i]);\n\t}\n\tfz_free(ctx, state);\n}\n\nstatic fz_stream *\nrebind_concat(fz_stream *s)\n{\n\tstruct concat_filter *state = s->state;\n\tint i;\n\n\tif (state->current >= state->count)\n\t\treturn NULL;\n\tfor (i = state->current; i < state->count-1; i++)\n\t{\n\t\tfz_rebind_stream(state->chain[i], s->ctx);\n\t}\n\treturn state->chain[i];\n}\n\nfz_stream *\nfz_open_concat(fz_context *ctx, int len, int pad)\n{\n\tstruct concat_filter *state;\n\n\tstate = fz_calloc(ctx, 1, sizeof(struct concat_filter) + (len-1)*sizeof(fz_stream *));\n\tstate->max = len;\n\tstate->count = 0;\n\tstate->current = 0;\n\tstate->pad = pad;\n\tstate->ws_buf = 32;\n\n\treturn fz_new_stream(ctx, state, next_concat, close_concat, rebind_concat);\n}\n\nvoid\nfz_concat_push(fz_stream *concat, fz_stream *chain)\n{\n\tstruct concat_filter *state = (struct concat_filter *)concat->state;\n\n\tif (state->count == state->max)\n\t\tfz_throw(concat->ctx, FZ_ERROR_GENERIC, \"Concat filter size exceeded\");\n\n\tstate->chain[state->count++] = chain;\n}\n\n/* ASCII Hex Decode */\n\ntypedef struct fz_ahxd_s fz_ahxd;\n\nstruct fz_ahxd_s\n{\n\tfz_stream *chain;\n\tint eod;\n\tunsigned char buffer[256];\n};\n\nstatic inline int iswhite(int a)\n{\n\tswitch (a) {\n\tcase '\\n': case '\\r': case '\\t': case ' ':\n\tcase '\\0': case '\\f': case '\\b': case 0177:\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\nstatic inline int ishex(int a)\n{\n\treturn (a >= 'A' && a <= 'F') ||\n\t\t(a >= 'a' && a <= 'f') ||\n\t\t(a >= '0' && a <= '9');\n}\n\nstatic inline int unhex(int a)\n{\n\tif (a >= 'A' && a <= 'F') return a - 'A' + 0xA;\n\tif (a >= 'a' && a <= 'f') return a - 'a' + 0xA;\n\tif (a >= '0' && a <= '9') return a - '0';\n\treturn 0;\n}\n\nstatic int\nnext_ahxd(fz_stream *stm, int max)\n{\n\tfz_ahxd *state = stm->state;\n\tunsigned char *p = state->buffer;\n\tunsigned char *ep;\n\tint a, b, c, odd;\n\n\tif (max > sizeof(state->buffer))\n\t\tmax = sizeof(state->buffer);\n\tep = p + max;\n\n\todd = 0;\n\n\twhile (p < ep)\n\t{\n\t\tif (state->eod)\n\t\t\tbreak;\n\n\t\tc = fz_read_byte(state->chain);\n\t\tif (c < 0)\n\t\t\tbreak;\n\n\t\tif (ishex(c))\n\t\t{\n\t\t\tif (!odd)\n\t\t\t{\n\t\t\t\ta = unhex(c);\n\t\t\t\todd = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tb = unhex(c);\n\t\t\t\t*p++ = (a << 4) | b;\n\t\t\t\todd = 0;\n\t\t\t}\n\t\t}\n\t\telse if (c == '>')\n\t\t{\n\t\t\tif (odd)\n\t\t\t\t*p++ = (a << 4);\n\t\t\tstate->eod = 1;\n\t\t\tbreak;\n\t\t}\n\t\telse if (!iswhite(c))\n\t\t{\n\t\t\tfz_throw(stm->ctx, FZ_ERROR_GENERIC, \"bad data in ahxd: '%c'\", c);\n\t\t}\n\t}\n\tstm->rp = state->buffer;\n\tstm->wp = p;\n\tstm->pos += p - state->buffer;\n\n\tif (stm->rp != p)\n\t\treturn *stm->rp++;\n\treturn EOF;\n}\n\nstatic void\nclose_ahxd(fz_context *ctx, void *state_)\n{\n\tfz_ahxd *state = (fz_ahxd *)state_;\n\tfz_stream *chain = state->chain;\n\tfz_free(ctx, state);\n\tfz_close(chain);\n}\n\nstatic fz_stream *\nrebind_ahxd(fz_stream *s)\n{\n\tfz_ahxd *state = s->state;\n\treturn state->chain;\n}\n\nfz_stream *\nfz_open_ahxd(fz_stream *chain)\n{\n\tfz_ahxd *state;\n\tfz_context *ctx = chain->ctx;\n\n\tfz_try(ctx)\n\t{\n\t\tstate = fz_malloc_struct(ctx, fz_ahxd);\n\t\tstate->chain = chain;\n\t\tstate->eod = 0;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_close(chain);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn fz_new_stream(ctx, state, next_ahxd, close_ahxd, rebind_ahxd);\n}\n\n/* ASCII 85 Decode */\n\ntypedef struct fz_a85d_s fz_a85d;\n\nstruct fz_a85d_s\n{\n\tfz_stream *chain;\n\tunsigned char buffer[256];\n\tint eod;\n};\n\nstatic int\nnext_a85d(fz_stream *stm, int max)\n{\n\tfz_a85d *state = stm->state;\n\tunsigned char *p = state->buffer;\n\tunsigned char *ep;\n\tint count = 0;\n\tint word = 0;\n\tint c;\n\n\tif (state->eod)\n\t\treturn EOF;\n\n\tif (max > sizeof(state->buffer))\n\t\tmax = sizeof(state->buffer);\n\n\tep = p + max;\n\twhile (p < ep)\n\t{\n\t\tc = fz_read_byte(state->chain);\n\t\tif (c < 0)\n\t\t\tbreak;\n\n\t\tif (c >= '!' && c <= 'u')\n\t\t{\n\t\t\tif (count == 4)\n\t\t\t{\n\t\t\t\tword = word * 85 + (c - '!');\n\n\t\t\t\t*p++ = (word >> 24) & 0xff;\n\t\t\t\t*p++ = (word >> 16) & 0xff;\n\t\t\t\t*p++ = (word >> 8) & 0xff;\n\t\t\t\t*p++ = (word) & 0xff;\n\n\t\t\t\tword = 0;\n\t\t\t\tcount = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tword = word * 85 + (c - '!');\n\t\t\t\tcount ++;\n\t\t\t}\n\t\t}\n\n\t\telse if (c == 'z' && count == 0)\n\t\t{\n\t\t\t*p++ = 0;\n\t\t\t*p++ = 0;\n\t\t\t*p++ = 0;\n\t\t\t*p++ = 0;\n\t\t}\n\n\t\telse if (c == '~')\n\t\t{\n\t\t\tc = fz_read_byte(state->chain);\n\t\t\tif (c != '>')\n\t\t\t\tfz_warn(stm->ctx, \"bad eod marker in a85d\");\n\n\t\t\tswitch (count) {\n\t\t\tcase 0:\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t/* Specifically illegal in the spec, but adobe\n\t\t\t\t * and gs both cope. See normal_87.pdf for a\n\t\t\t\t * case where this matters. */\n\t\t\t\tfz_warn(stm->ctx, \"partial final byte in a85d\");\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tword = word * (85 * 85 * 85) + 0xffffff;\n\t\t\t\t*p++ = word >> 24;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tword = word * (85 * 85) + 0xffff;\n\t\t\t\t*p++ = word >> 24;\n\t\t\t\t*p++ = word >> 16;\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tword = word * 85 + 0xff;\n\t\t\t\t*p++ = word >> 24;\n\t\t\t\t*p++ = word >> 16;\n\t\t\t\t*p++ = word >> 8;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tstate->eod = 1;\n\t\t\tbreak;\n\t\t}\n\n\t\telse if (!iswhite(c))\n\t\t{\n\t\t\tfz_throw(stm->ctx, FZ_ERROR_GENERIC, \"bad data in a85d: '%c'\", c);\n\t\t}\n\t}\n\n\tstm->rp = state->buffer;\n\tstm->wp = p;\n\tstm->pos += p - state->buffer;\n\n\tif (p == stm->rp)\n\t\treturn EOF;\n\n\treturn *stm->rp++;\n}\n\nstatic void\nclose_a85d(fz_context *ctx, void *state_)\n{\n\tfz_a85d *state = (fz_a85d *)state_;\n\tfz_stream *chain = state->chain;\n\n\tfz_free(ctx, state);\n\tfz_close(chain);\n}\n\nstatic fz_stream *\nrebind_a85d(fz_stream *s)\n{\n\tfz_a85d *state = s->state;\n\treturn state->chain;\n}\n\nfz_stream *\nfz_open_a85d(fz_stream *chain)\n{\n\tfz_a85d *state;\n\tfz_context *ctx = chain->ctx;\n\n\tfz_try(ctx)\n\t{\n\t\tstate = fz_malloc_struct(ctx, fz_a85d);\n\t\tstate->chain = chain;\n\t\tstate->eod = 0;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_close(chain);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn fz_new_stream(ctx, state, next_a85d, close_a85d, rebind_a85d);\n}\n\n/* Run Length Decode */\n\ntypedef struct fz_rld_s fz_rld;\n\nstruct fz_rld_s\n{\n\tfz_stream *chain;\n\tint run, n, c;\n\tunsigned char buffer[256];\n};\n\nstatic int\nnext_rld(fz_stream *stm, int max)\n{\n\tfz_rld *state = stm->state;\n\tunsigned char *p = state->buffer;\n\tunsigned char *ep;\n\n\tif (state->run == 128)\n\t\treturn EOF;\n\n\tif (max > sizeof(state->buffer))\n\t\tmax = sizeof(state->buffer);\n\tep = p + max;\n\n\twhile (p < ep)\n\t{\n\t\tif (state->run == 128)\n\t\t\tbreak;\n\n\t\tif (state->n == 0)\n\t\t{\n\t\t\tstate->run = fz_read_byte(state->chain);\n\t\t\tif (state->run < 0)\n\t\t\t{\n\t\t\t\tstate->run = 128;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (state->run < 128)\n\t\t\t\tstate->n = state->run + 1;\n\t\t\tif (state->run > 128)\n\t\t\t{\n\t\t\t\tstate->n = 257 - state->run;\n\t\t\t\tstate->c = fz_read_byte(state->chain);\n\t\t\t\tif (state->c < 0)\n\t\t\t\t\tfz_throw(stm->ctx, FZ_ERROR_GENERIC, \"premature end of data in run length decode\");\n\t\t\t}\n\t\t}\n\n\t\tif (state->run < 128)\n\t\t{\n\t\t\twhile (p < ep && state->n)\n\t\t\t{\n\t\t\t\tint c = fz_read_byte(state->chain);\n\t\t\t\tif (c < 0)\n\t\t\t\t\tfz_throw(stm->ctx, FZ_ERROR_GENERIC, \"premature end of data in run length decode\");\n\t\t\t\t*p++ = c;\n\t\t\t\tstate->n--;\n\t\t\t}\n\t\t}\n\n\t\tif (state->run > 128)\n\t\t{\n\t\t\twhile (p < ep && state->n)\n\t\t\t{\n\t\t\t\t*p++ = state->c;\n\t\t\t\tstate->n--;\n\t\t\t}\n\t\t}\n\t}\n\n\tstm->rp = state->buffer;\n\tstm->wp = p;\n\tstm->pos += p - state->buffer;\n\n\tif (p == stm->rp)\n\t\treturn EOF;\n\n\treturn *stm->rp++;\n}\n\nstatic void\nclose_rld(fz_context *ctx, void *state_)\n{\n\tfz_rld *state = (fz_rld *)state_;\n\tfz_stream *chain = state->chain;\n\n\tfz_free(ctx, state);\n\tfz_close(chain);\n}\n\nstatic fz_stream *\nrebind_rld(fz_stream *s)\n{\n\tfz_rld *state = s->state;\n\treturn state->chain;\n}\n\nfz_stream *\nfz_open_rld(fz_stream *chain)\n{\n\tfz_rld *state;\n\tfz_context *ctx = chain->ctx;\n\n\tfz_try(ctx)\n\t{\n\t\tstate = fz_malloc_struct(ctx, fz_rld);\n\t\tstate->chain = chain;\n\t\tstate->run = 0;\n\t\tstate->n = 0;\n\t\tstate->c = 0;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_close(chain);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn fz_new_stream(ctx, state, next_rld, close_rld, rebind_rld);\n}\n\n/* RC4 Filter */\n\ntypedef struct fz_arc4c_s fz_arc4c;\n\nstruct fz_arc4c_s\n{\n\tfz_stream *chain;\n\tfz_arc4 arc4;\n\tunsigned char buffer[256];\n};\n\nstatic int\nnext_arc4(fz_stream *stm, int max)\n{\n\tfz_arc4c *state = stm->state;\n\tint n = fz_available(state->chain, max);\n\n\tif (n == 0)\n\t\treturn EOF;\n\tif (n > sizeof(state->buffer))\n\t\tn = sizeof(state->buffer);\n\n\tstm->rp = state->buffer;\n\tstm->wp = state->buffer + n;\n\tfz_arc4_encrypt(&state->arc4, stm->rp, state->chain->rp, n);\n\tstate->chain->rp += n;\n\tstm->pos += n;\n\n\treturn *stm->rp++;\n}\n\nstatic void\nclose_arc4(fz_context *ctx, void *state_)\n{\n\tfz_arc4c *state = (fz_arc4c *)state_;\n\tfz_stream *chain = state->chain;\n\n\tfz_free(ctx, state);\n\tfz_close(chain);\n}\n\nstatic fz_stream *\nrebind_arc4c(fz_stream *s)\n{\n\tfz_arc4c *state = s->state;\n\treturn state->chain;\n}\n\nfz_stream *\nfz_open_arc4(fz_stream *chain, unsigned char *key, unsigned keylen)\n{\n\tfz_arc4c *state;\n\tfz_context *ctx = chain->ctx;\n\n\tfz_try(ctx)\n\t{\n\t\tstate = fz_malloc_struct(ctx, fz_arc4c);\n\t\tstate->chain = chain;\n\t\tfz_arc4_init(&state->arc4, key, keylen);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_close(chain);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn fz_new_stream(ctx, state, next_arc4, close_arc4, rebind_arc4c);\n}\n\n/* AES Filter */\n\ntypedef struct fz_aesd_s fz_aesd;\n\nstruct fz_aesd_s\n{\n\tfz_stream *chain;\n\tfz_aes aes;\n\tunsigned char iv[16];\n\tint ivcount;\n\tunsigned char bp[16];\n\tunsigned char *rp, *wp;\n\tunsigned char buffer[256];\n};\n\nstatic int\nnext_aesd(fz_stream *stm, int max)\n{\n\tfz_aesd *state = stm->state;\n\tunsigned char *p = state->buffer;\n\tunsigned char *ep;\n\n\tif (max > sizeof(state->buffer))\n\t\tmax = sizeof(state->buffer);\n\tep = p + max;\n\n\twhile (state->ivcount < 16)\n\t{\n\t\tint c = fz_read_byte(state->chain);\n\t\tif (c < 0)\n\t\t\tfz_throw(stm->ctx, FZ_ERROR_GENERIC, \"premature end in aes filter\");\n\t\tstate->iv[state->ivcount++] = c;\n\t}\n\n\twhile (state->rp < state->wp && p < ep)\n\t\t*p++ = *state->rp++;\n\n\twhile (p < ep)\n\t{\n\t\tint n = fz_read(state->chain, state->bp, 16);\n\t\tif (n == 0)\n\t\t\tbreak;\n\t\telse if (n < 16)\n\t\t\tfz_throw(stm->ctx, FZ_ERROR_GENERIC, \"partial block in aes filter\");\n\n\t\taes_crypt_cbc(&state->aes, AES_DECRYPT, 16, state->iv, state->bp, state->bp);\n\t\tstate->rp = state->bp;\n\t\tstate->wp = state->bp + 16;\n\n\t\t/* strip padding at end of file */\n\t\tif (fz_is_eof(state->chain))\n\t\t{\n\t\t\tint pad = state->bp[15];\n\t\t\tif (pad < 1 || pad > 16)\n\t\t\t\tfz_throw(stm->ctx, FZ_ERROR_GENERIC, \"aes padding out of range: %d\", pad);\n\t\t\tstate->wp -= pad;\n\t\t}\n\n\t\twhile (state->rp < state->wp && p < ep)\n\t\t\t*p++ = *state->rp++;\n\t}\n\n\tstm->rp = state->buffer;\n\tstm->wp = p;\n\tstm->pos += p - state->buffer;\n\n\tif (p == stm->rp)\n\t\treturn EOF;\n\n\treturn *stm->rp++;\n}\n\nstatic void\nclose_aesd(fz_context *ctx, void *state_)\n{\n\tfz_aesd *state = (fz_aesd *)state_;\n\tfz_stream *chain = state->chain;\n\n\tfz_free(ctx, state);\n\tfz_close(chain);\n}\n\nstatic fz_stream *\nrebind_aesd(fz_stream *s)\n{\n\tfz_aesd *state = s->state;\n\treturn state->chain;\n}\n\nfz_stream *\nfz_open_aesd(fz_stream *chain, unsigned char *key, unsigned keylen)\n{\n\tfz_aesd *state = NULL;\n\tfz_context *ctx = chain->ctx;\n\n\tfz_var(state);\n\n\tfz_try(ctx)\n\t{\n\t\tstate = fz_malloc_struct(ctx, fz_aesd);\n\t\tstate->chain = chain;\n\t\tif (aes_setkey_dec(&state->aes, key, keylen * 8))\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"AES key init failed (keylen=%d)\", keylen * 8);\n\t\tstate->ivcount = 0;\n\t\tstate->rp = state->bp;\n\t\tstate->wp = state->bp;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, state);\n\t\tfz_close(chain);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn fz_new_stream(ctx, state, next_aesd, close_aesd, rebind_aesd);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/filter-dct.c",
    "content": "#include \"mupdf/fitz.h\"\n\n#include <jpeglib.h>\n#include <setjmp.h>\n\n#ifndef SHARE_JPEG\ntypedef void * backing_store_ptr;\n#include \"jmemcust.h\"\n#endif\n\ntypedef struct fz_dctd_s fz_dctd;\n\nstruct fz_dctd_s\n{\n\tfz_stream *chain;\n\tfz_stream *jpegtables;\n\tfz_stream *curr_stm;\n\tfz_context *ctx;\n\tint color_transform;\n\tint init;\n\tint stride;\n\tint l2factor;\n\tunsigned char *scanline;\n\tunsigned char *rp, *wp;\n\tstruct jpeg_decompress_struct cinfo;\n\tstruct jpeg_source_mgr srcmgr;\n\tstruct jpeg_error_mgr errmgr;\n\tjmp_buf jb;\n\tchar msg[JMSG_LENGTH_MAX];\n\n\tunsigned char buffer[4096];\n};\n\n#ifdef SHARE_JPEG\n\n#define JZ_DCT_STATE_FROM_CINFO(c) (fz_dctd *)(c->client_data)\n\n#define fz_dct_mem_init(st)\n#define fz_dct_mem_term(st)\n\n#else /* SHARE_JPEG */\n\n#define JZ_DCT_STATE_FROM_CINFO(c) (fz_dctd *)(GET_CUST_MEM_DATA(c)->priv)\n\nstatic void *\nfz_dct_mem_alloc(j_common_ptr cinfo, size_t size)\n{\n\tfz_dctd *state = JZ_DCT_STATE_FROM_CINFO(cinfo);\n\treturn fz_malloc(state->ctx, size);\n}\n\nstatic void\nfz_dct_mem_free(j_common_ptr cinfo, void *object, size_t size)\n{\n\tfz_dctd *state = JZ_DCT_STATE_FROM_CINFO(cinfo);\n\tUNUSED(size);\n\tfz_free(state->ctx, object);\n}\n\nstatic void\nfz_dct_mem_init(fz_dctd *state)\n{\n\tj_common_ptr cinfo = (j_common_ptr)&state->cinfo;\n\tjpeg_cust_mem_data *custmptr;\n\n\tcustmptr = fz_malloc_struct(state->ctx, jpeg_cust_mem_data);\n\n\tif (!jpeg_cust_mem_init(custmptr, (void *) state, NULL, NULL, NULL,\n\t\t\t\tfz_dct_mem_alloc, fz_dct_mem_free,\n\t\t\t\tfz_dct_mem_alloc, fz_dct_mem_free, NULL))\n\t{\n\t\tfz_free(state->ctx, custmptr);\n\t\tfz_throw(state->ctx, FZ_ERROR_GENERIC, \"cannot initialize custom JPEG memory handler\");\n\t}\n\n\tcinfo->client_data = custmptr;\n}\n\nstatic void\nfz_dct_mem_term(fz_dctd *state)\n{\n\tif(state->cinfo.client_data)\n\t{\n\t\tfz_free(state->ctx, state->cinfo.client_data);\n\t\tstate->cinfo.client_data = NULL;\n\t}\n}\n\n#endif /* SHARE_JPEG */\n\nstatic void error_exit(j_common_ptr cinfo)\n{\n\tfz_dctd *state = JZ_DCT_STATE_FROM_CINFO(cinfo);\n\tcinfo->err->format_message(cinfo, state->msg);\n\tlongjmp(state->jb, 1);\n}\n\nstatic void init_source(j_decompress_ptr cinfo)\n{\n\t/* nothing to do */\n}\n\nstatic void term_source(j_decompress_ptr cinfo)\n{\n\t/* nothing to do */\n}\n\nstatic boolean fill_input_buffer(j_decompress_ptr cinfo)\n{\n\tstruct jpeg_source_mgr *src = cinfo->src;\n\tfz_dctd *state = JZ_DCT_STATE_FROM_CINFO(cinfo);\n\tfz_stream *curr_stm = state->curr_stm;\n\tfz_context *ctx = curr_stm->ctx;\n\n\tcurr_stm->rp = curr_stm->wp;\n\tfz_try(ctx)\n\t{\n\t\tsrc->bytes_in_buffer = fz_available(curr_stm, 1);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\treturn 0;\n\t}\n\tsrc->next_input_byte = curr_stm->rp;\n\n\tif (src->bytes_in_buffer == 0)\n\t{\n\t\tstatic unsigned char eoi[2] = { 0xFF, JPEG_EOI };\n\t\tfz_warn(state->ctx, \"premature end of file in jpeg\");\n\t\tsrc->next_input_byte = eoi;\n\t\tsrc->bytes_in_buffer = 2;\n\t}\n\n\treturn 1;\n}\n\nstatic void skip_input_data(j_decompress_ptr cinfo, long num_bytes)\n{\n\tstruct jpeg_source_mgr *src = cinfo->src;\n\tif (num_bytes > 0)\n\t{\n\t\twhile ((size_t)num_bytes > src->bytes_in_buffer)\n\t\t{\n\t\t\tnum_bytes -= src->bytes_in_buffer;\n\t\t\t(void) src->fill_input_buffer(cinfo);\n\t\t}\n\t\tsrc->next_input_byte += num_bytes;\n\t\tsrc->bytes_in_buffer -= num_bytes;\n\t}\n}\n\nstatic int\nnext_dctd(fz_stream *stm, int max)\n{\n\tfz_dctd *state = stm->state;\n\tj_decompress_ptr cinfo = &state->cinfo;\n\tunsigned char *p = state->buffer;\n\tunsigned char *ep;\n\n\tif (max > sizeof(state->buffer))\n\t\tmax = sizeof(state->buffer);\n\tep = state->buffer + max;\n\n\tif (setjmp(state->jb))\n\t{\n\t\tif (cinfo->src)\n\t\t\tstate->curr_stm->rp = state->curr_stm->wp - cinfo->src->bytes_in_buffer;\n\t\tfz_throw(stm->ctx, FZ_ERROR_GENERIC, \"jpeg error: %s\", state->msg);\n\t}\n\n\tif (!state->init)\n\t{\n\t\tint c;\n\t\tcinfo->client_data = state;\n\t\tcinfo->err = &state->errmgr;\n\t\tjpeg_std_error(cinfo->err);\n\t\tcinfo->err->error_exit = error_exit;\n\n\t\tfz_dct_mem_init(state);\n\n\t\tjpeg_create_decompress(cinfo);\n\t\tstate->init = 1;\n\n\t\t/* Skip over any stray returns at the start of the stream */\n\t\twhile ((c = fz_peek_byte(state->chain)) == '\\n' || c == '\\r')\n\t\t\t(void)fz_read_byte(state->chain);\n\n\t\tcinfo->src = &state->srcmgr;\n\t\tcinfo->src->init_source = init_source;\n\t\tcinfo->src->fill_input_buffer = fill_input_buffer;\n\t\tcinfo->src->skip_input_data = skip_input_data;\n\t\tcinfo->src->resync_to_restart = jpeg_resync_to_restart;\n\t\tcinfo->src->term_source = term_source;\n\n\t\t/* optionally load additional JPEG tables first */\n\t\tif (state->jpegtables)\n\t\t{\n\t\t\tstate->curr_stm = state->jpegtables;\n\t\t\tcinfo->src->next_input_byte = state->curr_stm->rp;\n\t\t\tcinfo->src->bytes_in_buffer = state->curr_stm->wp - state->curr_stm->rp;\n\t\t\tjpeg_read_header(cinfo, 0);\n\t\t\tstate->curr_stm->rp = state->curr_stm->wp - state->cinfo.src->bytes_in_buffer;\n\t\t\tstate->curr_stm = state->chain;\n\t\t}\n\n\t\tcinfo->src->next_input_byte = state->curr_stm->rp;\n\t\tcinfo->src->bytes_in_buffer = state->curr_stm->wp - state->curr_stm->rp;\n\n\t\tjpeg_read_header(cinfo, 1);\n\n\t\t/* default value if ColorTransform is not set */\n\t\tif (state->color_transform == -1)\n\t\t{\n\t\t\tif (state->cinfo.num_components == 3)\n\t\t\t\tstate->color_transform = 1;\n\t\t\telse\n\t\t\t\tstate->color_transform = 0;\n\t\t}\n\n\t\tif (cinfo->saw_Adobe_marker)\n\t\t\tstate->color_transform = cinfo->Adobe_transform;\n\n\t\t/* Guess the input colorspace, and set output colorspace accordingly */\n\t\tswitch (cinfo->num_components)\n\t\t{\n\t\tcase 3:\n\t\t\tif (state->color_transform)\n\t\t\t\tcinfo->jpeg_color_space = JCS_YCbCr;\n\t\t\telse\n\t\t\t\tcinfo->jpeg_color_space = JCS_RGB;\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tif (state->color_transform)\n\t\t\t\tcinfo->jpeg_color_space = JCS_YCCK;\n\t\t\telse\n\t\t\t\tcinfo->jpeg_color_space = JCS_CMYK;\n\t\t\tbreak;\n\t\t}\n\n\t\tcinfo->scale_num = 8/(1<<state->l2factor);\n\t\tcinfo->scale_denom = 8;\n\n\t\tjpeg_start_decompress(cinfo);\n\n\t\tstate->stride = cinfo->output_width * cinfo->output_components;\n\t\tstate->scanline = fz_malloc(state->ctx, state->stride);\n\t\tstate->rp = state->scanline;\n\t\tstate->wp = state->scanline;\n\t}\n\n\twhile (state->rp < state->wp && p < ep)\n\t\t*p++ = *state->rp++;\n\n\twhile (p < ep)\n\t{\n\t\tif (cinfo->output_scanline == cinfo->output_height)\n\t\t\tbreak;\n\n\t\tif (p + state->stride <= ep)\n\t\t{\n\t\t\tjpeg_read_scanlines(cinfo, &p, 1);\n\t\t\tp += state->stride;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tjpeg_read_scanlines(cinfo, &state->scanline, 1);\n\t\t\tstate->rp = state->scanline;\n\t\t\tstate->wp = state->scanline + state->stride;\n\t\t}\n\n\t\twhile (state->rp < state->wp && p < ep)\n\t\t\t*p++ = *state->rp++;\n\t}\n\tstm->rp = state->buffer;\n\tstm->wp = p;\n\tstm->pos += (p - state->buffer);\n\tif (p == stm->rp)\n\t\treturn EOF;\n\n\treturn *stm->rp++;\n}\n\nstatic void\nclose_dctd(fz_context *ctx, void *state_)\n{\n\tfz_dctd *state = (fz_dctd *)state_;\n\n\tif (setjmp(state->jb))\n\t{\n\t\tfz_warn(ctx, \"jpeg error: %s\", state->msg);\n\t\tgoto skip;\n\t}\n\n\t/* We call jpeg_abort rather than the more usual\n\t * jpeg_finish_decompress here. This has the same effect,\n\t * but doesn't spew warnings if we didn't read enough data etc.\n\t */\n\tif (state->init)\n\t\tjpeg_abort((j_common_ptr)&state->cinfo);\n\nskip:\n\tif (state->cinfo.src)\n\t\tstate->curr_stm->rp = state->curr_stm->wp - state->cinfo.src->bytes_in_buffer;\n\tif (state->init)\n\t\tjpeg_destroy_decompress(&state->cinfo);\n\n\tfz_dct_mem_term(state);\n\n\tfz_free(ctx, state->scanline);\n\tfz_close(state->chain);\n\tfz_close(state->jpegtables);\n\tfz_free(ctx, state);\n}\n\nstatic fz_stream *\nrebind_dctd(fz_stream *s)\n{\n\tfz_dctd *state = s->state;\n\treturn state->chain;\n}\n\n/* Default: color_transform = -1 (unset), l2factor = 0, jpegtables = NULL */\nfz_stream *\nfz_open_dctd(fz_stream *chain, int color_transform, int l2factor, fz_stream *jpegtables)\n{\n\tfz_context *ctx = chain->ctx;\n\tfz_dctd *state = NULL;\n\n\tfz_var(state);\n\n\tfz_try(ctx)\n\t{\n\t\tstate = fz_malloc_struct(chain->ctx, fz_dctd);\n\t\tstate->ctx = ctx;\n\t\tstate->chain = chain;\n\t\tstate->jpegtables = jpegtables;\n\t\tstate->curr_stm = chain;\n\t\tstate->color_transform = color_transform;\n\t\tstate->init = 0;\n\t\tstate->l2factor = l2factor;\n\t\tstate->cinfo.client_data = NULL;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, state);\n\t\tfz_close(chain);\n\t\tfz_close(jpegtables);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn fz_new_stream(ctx, state, next_dctd, close_dctd, rebind_dctd);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/filter-fax.c",
    "content": "#include \"mupdf/fitz.h\"\n\n/* Fax G3/G4 decoder */\n\n/* TODO: uncompressed */\n\n/*\n<raph> the first 2^(initialbits) entries map bit patterns to decodes\n<raph> let's say initial_bits is 8 for the sake of example\n<raph> and that the code is 1001\n<raph> that means that entries 0x90 .. 0x9f have the entry { val, 4 }\n<raph> because those are all the bytes that start with the code\n<raph> and the 4 is the length of the code\n... if (n_bits > initial_bits) ...\n<raph> anyway, in that case, it basically points to a mini table\n<raph> the n_bits is the maximum length of all codes beginning with that byte\n<raph> so 2^(n_bits - initial_bits) is the size of the mini-table\n<raph> peter came up with this, and it makes sense\n*/\n\ntypedef struct cfd_node_s cfd_node;\n\nstruct cfd_node_s\n{\n\tshort val;\n\tshort nbits;\n};\n\nenum\n{\n\tcfd_white_initial_bits = 8,\n\tcfd_black_initial_bits = 7,\n\tcfd_2d_initial_bits = 7,\n\tcfd_uncompressed_initial_bits = 6 /* must be 6 */\n};\n\n/* non-run codes in tables */\nenum\n{\n\tERROR = -1,\n\tZEROS = -2, /* EOL follows, possibly with more padding first */\n\tUNCOMPRESSED = -3\n};\n\n/* semantic codes for cf_2d_decode */\nenum\n{\n\tP = -4,\n\tH = -5,\n\tVR3 = 0,\n\tVR2 = 1,\n\tVR1 = 2,\n\tV0 = 3,\n\tVL1 = 4,\n\tVL2 = 5,\n\tVL3 = 6\n};\n\n/* White decoding table. */\nstatic const cfd_node cf_white_decode[] = {\n\t{256,12},{272,12},{29,8},{30,8},{45,8},{46,8},{22,7},{22,7},\n\t{23,7},{23,7},{47,8},{48,8},{13,6},{13,6},{13,6},{13,6},{20,7},\n\t{20,7},{33,8},{34,8},{35,8},{36,8},{37,8},{38,8},{19,7},{19,7},\n\t{31,8},{32,8},{1,6},{1,6},{1,6},{1,6},{12,6},{12,6},{12,6},{12,6},\n\t{53,8},{54,8},{26,7},{26,7},{39,8},{40,8},{41,8},{42,8},{43,8},\n\t{44,8},{21,7},{21,7},{28,7},{28,7},{61,8},{62,8},{63,8},{0,8},\n\t{320,8},{384,8},{10,5},{10,5},{10,5},{10,5},{10,5},{10,5},{10,5},\n\t{10,5},{11,5},{11,5},{11,5},{11,5},{11,5},{11,5},{11,5},{11,5},\n\t{27,7},{27,7},{59,8},{60,8},{288,9},{290,9},{18,7},{18,7},{24,7},\n\t{24,7},{49,8},{50,8},{51,8},{52,8},{25,7},{25,7},{55,8},{56,8},\n\t{57,8},{58,8},{192,6},{192,6},{192,6},{192,6},{1664,6},{1664,6},\n\t{1664,6},{1664,6},{448,8},{512,8},{292,9},{640,8},{576,8},{294,9},\n\t{296,9},{298,9},{300,9},{302,9},{256,7},{256,7},{2,4},{2,4},{2,4},\n\t{2,4},{2,4},{2,4},{2,4},{2,4},{2,4},{2,4},{2,4},{2,4},{2,4},{2,4},\n\t{2,4},{2,4},{3,4},{3,4},{3,4},{3,4},{3,4},{3,4},{3,4},{3,4},{3,4},\n\t{3,4},{3,4},{3,4},{3,4},{3,4},{3,4},{3,4},{128,5},{128,5},{128,5},\n\t{128,5},{128,5},{128,5},{128,5},{128,5},{8,5},{8,5},{8,5},{8,5},\n\t{8,5},{8,5},{8,5},{8,5},{9,5},{9,5},{9,5},{9,5},{9,5},{9,5},{9,5},\n\t{9,5},{16,6},{16,6},{16,6},{16,6},{17,6},{17,6},{17,6},{17,6},\n\t{4,4},{4,4},{4,4},{4,4},{4,4},{4,4},{4,4},{4,4},{4,4},{4,4},{4,4},\n\t{4,4},{4,4},{4,4},{4,4},{4,4},{5,4},{5,4},{5,4},{5,4},{5,4},{5,4},\n\t{5,4},{5,4},{5,4},{5,4},{5,4},{5,4},{5,4},{5,4},{5,4},{5,4},\n\t{14,6},{14,6},{14,6},{14,6},{15,6},{15,6},{15,6},{15,6},{64,5},\n\t{64,5},{64,5},{64,5},{64,5},{64,5},{64,5},{64,5},{6,4},{6,4},\n\t{6,4},{6,4},{6,4},{6,4},{6,4},{6,4},{6,4},{6,4},{6,4},{6,4},{6,4},\n\t{6,4},{6,4},{6,4},{7,4},{7,4},{7,4},{7,4},{7,4},{7,4},{7,4},{7,4},\n\t{7,4},{7,4},{7,4},{7,4},{7,4},{7,4},{7,4},{7,4},{-2,3},{-2,3},\n\t{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},\n\t{-1,0},{-1,0},{-1,0},{-1,0},{-3,4},{1792,3},{1792,3},{1984,4},\n\t{2048,4},{2112,4},{2176,4},{2240,4},{2304,4},{1856,3},{1856,3},\n\t{1920,3},{1920,3},{2368,4},{2432,4},{2496,4},{2560,4},{1472,1},\n\t{1536,1},{1600,1},{1728,1},{704,1},{768,1},{832,1},{896,1},\n\t{960,1},{1024,1},{1088,1},{1152,1},{1216,1},{1280,1},{1344,1},\n\t{1408,1}\n};\n\n/* Black decoding table. */\nstatic const cfd_node cf_black_decode[] = {\n\t{128,12},{160,13},{224,12},{256,12},{10,7},{11,7},{288,12},{12,7},\n\t{9,6},{9,6},{8,6},{8,6},{7,5},{7,5},{7,5},{7,5},{6,4},{6,4},{6,4},\n\t{6,4},{6,4},{6,4},{6,4},{6,4},{5,4},{5,4},{5,4},{5,4},{5,4},{5,4},\n\t{5,4},{5,4},{1,3},{1,3},{1,3},{1,3},{1,3},{1,3},{1,3},{1,3},{1,3},\n\t{1,3},{1,3},{1,3},{1,3},{1,3},{1,3},{1,3},{4,3},{4,3},{4,3},{4,3},\n\t{4,3},{4,3},{4,3},{4,3},{4,3},{4,3},{4,3},{4,3},{4,3},{4,3},{4,3},\n\t{4,3},{3,2},{3,2},{3,2},{3,2},{3,2},{3,2},{3,2},{3,2},{3,2},{3,2},\n\t{3,2},{3,2},{3,2},{3,2},{3,2},{3,2},{3,2},{3,2},{3,2},{3,2},{3,2},\n\t{3,2},{3,2},{3,2},{3,2},{3,2},{3,2},{3,2},{3,2},{3,2},{3,2},{3,2},\n\t{2,2},{2,2},{2,2},{2,2},{2,2},{2,2},{2,2},{2,2},{2,2},{2,2},{2,2},\n\t{2,2},{2,2},{2,2},{2,2},{2,2},{2,2},{2,2},{2,2},{2,2},{2,2},{2,2},\n\t{2,2},{2,2},{2,2},{2,2},{2,2},{2,2},{2,2},{2,2},{2,2},{2,2},\n\t{-2,4},{-2,4},{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},\n\t{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},{-3,5},{1792,4},\n\t{1792,4},{1984,5},{2048,5},{2112,5},{2176,5},{2240,5},{2304,5},\n\t{1856,4},{1856,4},{1920,4},{1920,4},{2368,5},{2432,5},{2496,5},\n\t{2560,5},{18,3},{18,3},{18,3},{18,3},{18,3},{18,3},{18,3},{18,3},\n\t{52,5},{52,5},{640,6},{704,6},{768,6},{832,6},{55,5},{55,5},\n\t{56,5},{56,5},{1280,6},{1344,6},{1408,6},{1472,6},{59,5},{59,5},\n\t{60,5},{60,5},{1536,6},{1600,6},{24,4},{24,4},{24,4},{24,4},\n\t{25,4},{25,4},{25,4},{25,4},{1664,6},{1728,6},{320,5},{320,5},\n\t{384,5},{384,5},{448,5},{448,5},{512,6},{576,6},{53,5},{53,5},\n\t{54,5},{54,5},{896,6},{960,6},{1024,6},{1088,6},{1152,6},{1216,6},\n\t{64,3},{64,3},{64,3},{64,3},{64,3},{64,3},{64,3},{64,3},{13,1},\n\t{13,1},{13,1},{13,1},{13,1},{13,1},{13,1},{13,1},{13,1},{13,1},\n\t{13,1},{13,1},{13,1},{13,1},{13,1},{13,1},{23,4},{23,4},{50,5},\n\t{51,5},{44,5},{45,5},{46,5},{47,5},{57,5},{58,5},{61,5},{256,5},\n\t{16,3},{16,3},{16,3},{16,3},{17,3},{17,3},{17,3},{17,3},{48,5},\n\t{49,5},{62,5},{63,5},{30,5},{31,5},{32,5},{33,5},{40,5},{41,5},\n\t{22,4},{22,4},{14,1},{14,1},{14,1},{14,1},{14,1},{14,1},{14,1},\n\t{14,1},{14,1},{14,1},{14,1},{14,1},{14,1},{14,1},{14,1},{14,1},\n\t{15,2},{15,2},{15,2},{15,2},{15,2},{15,2},{15,2},{15,2},{128,5},\n\t{192,5},{26,5},{27,5},{28,5},{29,5},{19,4},{19,4},{20,4},{20,4},\n\t{34,5},{35,5},{36,5},{37,5},{38,5},{39,5},{21,4},{21,4},{42,5},\n\t{43,5},{0,3},{0,3},{0,3},{0,3}\n};\n\n/* 2-D decoding table. */\nstatic const cfd_node cf_2d_decode[] = {\n\t{128,11},{144,10},{6,7},{0,7},{5,6},{5,6},{1,6},{1,6},{-4,4},\n\t{-4,4},{-4,4},{-4,4},{-4,4},{-4,4},{-4,4},{-4,4},{-5,3},{-5,3},\n\t{-5,3},{-5,3},{-5,3},{-5,3},{-5,3},{-5,3},{-5,3},{-5,3},{-5,3},\n\t{-5,3},{-5,3},{-5,3},{-5,3},{-5,3},{4,3},{4,3},{4,3},{4,3},{4,3},\n\t{4,3},{4,3},{4,3},{4,3},{4,3},{4,3},{4,3},{4,3},{4,3},{4,3},{4,3},\n\t{2,3},{2,3},{2,3},{2,3},{2,3},{2,3},{2,3},{2,3},{2,3},{2,3},{2,3},\n\t{2,3},{2,3},{2,3},{2,3},{2,3},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},\n\t{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},\n\t{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},\n\t{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},\n\t{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},\n\t{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},\n\t{3,1},{3,1},{3,1},{-2,4},{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},\n\t{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},\n\t{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},{-1,0},{-3,3}\n};\n\n/* Uncompressed decoding table. */\nstatic const cfd_node cf_uncompressed_decode[] = {\n\t{64,12},{5,6},{4,5},{4,5},{3,4},{3,4},{3,4},{3,4},{2,3},{2,3},\n\t{2,3},{2,3},{2,3},{2,3},{2,3},{2,3},{1,2},{1,2},{1,2},{1,2},{1,2},\n\t{1,2},{1,2},{1,2},{1,2},{1,2},{1,2},{1,2},{1,2},{1,2},{1,2},{1,2},\n\t{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},\n\t{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},\n\t{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},{0,1},\n\t{-1,0},{-1,0},{8,6},{9,6},{6,5},{6,5},{7,5},{7,5},{4,4},{4,4},\n\t{4,4},{4,4},{5,4},{5,4},{5,4},{5,4},{2,3},{2,3},{2,3},{2,3},{2,3},\n\t{2,3},{2,3},{2,3},{3,3},{3,3},{3,3},{3,3},{3,3},{3,3},{3,3},{3,3},\n\t{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},\n\t{0,2},{0,2},{0,2},{0,2},{0,2},{1,2},{1,2},{1,2},{1,2},{1,2},{1,2},\n\t{1,2},{1,2},{1,2},{1,2},{1,2},{1,2},{1,2},{1,2},{1,2},{1,2}\n};\n\n/* bit magic */\n\nstatic inline int getbit(const unsigned char *buf, int x)\n{\n\treturn ( buf[x >> 3] >> ( 7 - (x & 7) ) ) & 1;\n}\n\nstatic const unsigned char mask[8] = {\n\t0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0x01, 0\n};\n\nstatic const unsigned char clz[256] = {\n\t8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,\n\t3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,\n\t2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n\t2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,\n\t1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n\t1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n\t1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n\t1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n};\n\nstatic inline int\nfind_changing(const unsigned char *line, int x, int w)\n{\n\tint a, b, m, W;\n\n\tif (!line)\n\t\treturn w;\n\n\t/* We assume w > 0, -1 <= x < w */\n\tif (x < 0)\n\t{\n\t\tx = 0;\n\t\tm = 0xFF;\n\t}\n\telse\n\t{\n\t\t/* Mask out the bits we've already used (including the one\n\t\t * we started from) */\n\t\tm = mask[x & 7];\n\t}\n\t/* We have 'w' pixels (bits) in line. The last pixel that can be\n\t * safely accessed is the (w-1)th bit of line.\n\t * By taking W = w>>3, we know that the first W bytes of line are\n\t * full, with w&7 stray bits following. */\n\tW = w>>3;\n\tx >>= 3;\n\ta = line[x]; /* Safe as x < w => x <= w-1 => x>>3 <= (w-1)>>3 */\n\tb = a ^ (a>>1);\n\tb &= m;\n\tif (x >= W)\n\t{\n\t\t/* Within the last byte already */\n\t\tx = (x<<3) + clz[b];\n\t\tif (x > w)\n\t\t\tx = w;\n\t\treturn x;\n\t}\n\twhile (b == 0)\n\t{\n\t\tif (++x >= W)\n\t\t\tgoto nearend;\n\t\tb = a & 1;\n\t\ta = line[x];\n\t\tb = (b<<7) ^ a ^ (a>>1);\n\t}\n\treturn (x<<3) + clz[b];\nnearend:\n\t/* We have less than a byte to go. If no stray bits, exit now. */\n\tif ((x<<3) == w)\n\t\treturn w;\n\tb = a&1;\n\ta = line[x];\n\tb = (b<<7) ^ a ^ (a>>1);\n\tx = (x<<3) + clz[b];\n\tif (x > w)\n\t\tx = w;\n\treturn x;\n}\n\nstatic inline int\nfind_changing_color(const unsigned char *line, int x, int w, int color)\n{\n\tif (!line || x >= w)\n\t\treturn w;\n\n\tx = find_changing(line, (x > 0 || !color) ? x : -1, w);\n\n\tif (x < w && getbit(line, x) != color)\n\t\tx = find_changing(line, x, w);\n\n\treturn x;\n}\n\nstatic const unsigned char lm[8] = {\n\t0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0x01\n};\n\nstatic const unsigned char rm[8] = {\n\t0x00, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE\n};\n\nstatic inline void setbits(unsigned char *line, int x0, int x1)\n{\n\tint a0, a1, b0, b1, a;\n\n\tif (x1 <= x0)\n\t\treturn;\n\n\ta0 = x0 >> 3;\n\ta1 = x1 >> 3;\n\n\tb0 = x0 & 7;\n\tb1 = x1 & 7;\n\n\tif (a0 == a1)\n\t{\n\t\tif (b1)\n\t\t\tline[a0] |= lm[b0] & rm[b1];\n\t}\n\telse\n\t{\n\t\tline[a0] |= lm[b0];\n\t\tfor (a = a0 + 1; a < a1; a++)\n\t\t\tline[a] = 0xFF;\n\t\tif (b1)\n\t\t\tline[a1] |= rm[b1];\n\t}\n}\n\ntypedef struct fz_faxd_s fz_faxd;\n\nenum\n{\n\tSTATE_INIT,\t\t/* initial state, optionally waiting for EOL */\n\tSTATE_NORMAL,\t/* neutral state, waiting for any code */\n\tSTATE_MAKEUP,\t/* got a 1d makeup code, waiting for terminating code */\n\tSTATE_EOL,\t\t/* at eol, needs output buffer space */\n\tSTATE_H1, STATE_H2,\t/* in H part 1 and 2 (both makeup and terminating codes) */\n\tSTATE_DONE\t\t/* all done */\n};\n\nstruct fz_faxd_s\n{\n\tfz_context *ctx;\n\tfz_stream *chain;\n\n\tint k;\n\tint end_of_line;\n\tint encoded_byte_align;\n\tint columns;\n\tint rows;\n\tint end_of_block;\n\tint black_is_1;\n\n\tint stride;\n\tint ridx;\n\n\tint bidx;\n\tunsigned int word;\n\n\tint stage;\n\n\tint a, c, dim, eolc;\n\tunsigned char *ref;\n\tunsigned char *dst;\n\tunsigned char *rp, *wp;\n\n\tunsigned char buffer[4096];\n};\n\nstatic inline void eat_bits(fz_faxd *fax, int nbits)\n{\n\tfax->word <<= nbits;\n\tfax->bidx += nbits;\n}\n\nstatic int\nfill_bits(fz_faxd *fax)\n{\n\t/* The longest length of bits we'll ever need is 13. Never read more\n\t * than we need to avoid unnecessary overreading of the end of the\n\t * stream. */\n\twhile (fax->bidx > (32-13))\n\t{\n\t\tint c = fz_read_byte(fax->chain);\n\t\tif (c == EOF)\n\t\t\treturn EOF;\n\t\tfax->bidx -= 8;\n\t\tfax->word |= c << fax->bidx;\n\t}\n\treturn 0;\n}\n\nstatic int\nget_code(fz_faxd *fax, const cfd_node *table, int initialbits)\n{\n\tunsigned int word = fax->word;\n\tint tidx = word >> (32 - initialbits);\n\tint val = table[tidx].val;\n\tint nbits = table[tidx].nbits;\n\n\tif (nbits > initialbits)\n\t{\n\t\tint mask = (1 << (32 - initialbits)) - 1;\n\t\ttidx = val + ((word & mask) >> (32 - nbits));\n\t\tval = table[tidx].val;\n\t\tnbits = initialbits + table[tidx].nbits;\n\t}\n\n\teat_bits(fax, nbits);\n\n\treturn val;\n}\n\n/* decode one 1d code */\nstatic void\ndec1d(fz_context *ctx, fz_faxd *fax)\n{\n\tint code;\n\n\tif (fax->a == -1)\n\t\tfax->a = 0;\n\n\tif (fax->c)\n\t\tcode = get_code(fax, cf_black_decode, cfd_black_initial_bits);\n\telse\n\t\tcode = get_code(fax, cf_white_decode, cfd_white_initial_bits);\n\n\tif (code == UNCOMPRESSED)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"uncompressed data in faxd\");\n\n\tif (code < 0)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"negative code in 1d faxd\");\n\n\tif (fax->a + code > fax->columns)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"overflow in 1d faxd\");\n\n\tif (fax->c)\n\t\tsetbits(fax->dst, fax->a, fax->a + code);\n\n\tfax->a += code;\n\n\tif (code < 64)\n\t{\n\t\tfax->c = !fax->c;\n\t\tfax->stage = STATE_NORMAL;\n\t}\n\telse\n\t\tfax->stage = STATE_MAKEUP;\n}\n\n/* decode one 2d code */\nstatic void\ndec2d(fz_context *ctx, fz_faxd *fax)\n{\n\tint code, b1, b2;\n\n\tif (fax->stage == STATE_H1 || fax->stage == STATE_H2)\n\t{\n\t\tif (fax->a == -1)\n\t\t\tfax->a = 0;\n\n\t\tif (fax->c)\n\t\t\tcode = get_code(fax, cf_black_decode, cfd_black_initial_bits);\n\t\telse\n\t\t\tcode = get_code(fax, cf_white_decode, cfd_white_initial_bits);\n\n\t\tif (code == UNCOMPRESSED)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"uncompressed data in faxd\");\n\n\t\tif (code < 0)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"negative code in 2d faxd\");\n\n\t\tif (fax->a + code > fax->columns)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"overflow in 2d faxd\");\n\n\t\tif (fax->c)\n\t\t\tsetbits(fax->dst, fax->a, fax->a + code);\n\n\t\tfax->a += code;\n\n\t\tif (code < 64)\n\t\t{\n\t\t\tfax->c = !fax->c;\n\t\t\tif (fax->stage == STATE_H1)\n\t\t\t\tfax->stage = STATE_H2;\n\t\t\telse if (fax->stage == STATE_H2)\n\t\t\t\tfax->stage = STATE_NORMAL;\n\t\t}\n\n\t\treturn;\n\t}\n\n\tcode = get_code(fax, cf_2d_decode, cfd_2d_initial_bits);\n\n\tswitch (code)\n\t{\n\tcase H:\n\t\tfax->stage = STATE_H1;\n\t\tbreak;\n\n\tcase P:\n\t\tb1 = find_changing_color(fax->ref, fax->a, fax->columns, !fax->c);\n\t\tif (b1 >= fax->columns)\n\t\t\tb2 = fax->columns;\n\t\telse\n\t\t\tb2 = find_changing(fax->ref, b1, fax->columns);\n\t\tif (fax->c) setbits(fax->dst, fax->a, b2);\n\t\tfax->a = b2;\n\t\tbreak;\n\n\tcase V0:\n\t\tb1 = find_changing_color(fax->ref, fax->a, fax->columns, !fax->c);\n\t\tif (fax->c) setbits(fax->dst, fax->a, b1);\n\t\tfax->a = b1;\n\t\tfax->c = !fax->c;\n\t\tbreak;\n\n\tcase VR1:\n\t\tb1 = 1 + find_changing_color(fax->ref, fax->a, fax->columns, !fax->c);\n\t\tif (b1 >= fax->columns) b1 = fax->columns;\n\t\tif (fax->c) setbits(fax->dst, fax->a, b1);\n\t\tfax->a = b1;\n\t\tfax->c = !fax->c;\n\t\tbreak;\n\n\tcase VR2:\n\t\tb1 = 2 + find_changing_color(fax->ref, fax->a, fax->columns, !fax->c);\n\t\tif (b1 >= fax->columns) b1 = fax->columns;\n\t\tif (fax->c) setbits(fax->dst, fax->a, b1);\n\t\tfax->a = b1;\n\t\tfax->c = !fax->c;\n\t\tbreak;\n\n\tcase VR3:\n\t\tb1 = 3 + find_changing_color(fax->ref, fax->a, fax->columns, !fax->c);\n\t\tif (b1 >= fax->columns) b1 = fax->columns;\n\t\tif (fax->c) setbits(fax->dst, fax->a, b1);\n\t\tfax->a = b1;\n\t\tfax->c = !fax->c;\n\t\tbreak;\n\n\tcase VL1:\n\t\tb1 = -1 + find_changing_color(fax->ref, fax->a, fax->columns, !fax->c);\n\t\tif (b1 < 0) b1 = 0;\n\t\tif (fax->c) setbits(fax->dst, fax->a, b1);\n\t\tfax->a = b1;\n\t\tfax->c = !fax->c;\n\t\tbreak;\n\n\tcase VL2:\n\t\tb1 = -2 + find_changing_color(fax->ref, fax->a, fax->columns, !fax->c);\n\t\tif (b1 < 0) b1 = 0;\n\t\tif (fax->c) setbits(fax->dst, fax->a, b1);\n\t\tfax->a = b1;\n\t\tfax->c = !fax->c;\n\t\tbreak;\n\n\tcase VL3:\n\t\tb1 = -3 + find_changing_color(fax->ref, fax->a, fax->columns, !fax->c);\n\t\tif (b1 < 0) b1 = 0;\n\t\tif (fax->c) setbits(fax->dst, fax->a, b1);\n\t\tfax->a = b1;\n\t\tfax->c = !fax->c;\n\t\tbreak;\n\n\tcase UNCOMPRESSED:\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"uncompressed data in faxd\");\n\n\tcase ERROR:\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"invalid code in 2d faxd\");\n\n\tdefault:\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"invalid code in 2d faxd (%d)\", code);\n\t}\n}\n\nstatic int\nnext_faxd(fz_stream *stm, int max)\n{\n\tfz_context *ctx = stm->ctx;\n\tfz_faxd *fax = stm->state;\n\tunsigned char *p = fax->buffer;\n\tunsigned char *ep;\n\tunsigned char *tmp;\n\n\tif (max > sizeof(fax->buffer))\n\t\tmax = sizeof(fax->buffer);\n\tep = p + max;\n\tif (fax->stage == STATE_INIT && fax->end_of_line)\n\t{\n\t\tfill_bits(fax);\n\t\tif ((fax->word >> (32 - 12)) != 1)\n\t\t{\n\t\t\tfz_warn(ctx, \"faxd stream doesn't start with EOL\");\n\t\t\twhile (!fill_bits(fax) && (fax->word >> (32 - 12)) != 1)\n\t\t\t\teat_bits(fax, 1);\n\t\t}\n\t\tif ((fax->word >> (32 - 12)) != 1)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"initial EOL not found\");\n\t}\n\n\tif (fax->stage == STATE_INIT)\n\t\tfax->stage = STATE_NORMAL;\n\n\tif (fax->stage == STATE_DONE)\n\t\treturn EOF;\n\n\tif (fax->stage == STATE_EOL)\n\t\tgoto eol;\n\nloop:\n\n\tif (fill_bits(fax))\n\t{\n\t\tif (fax->bidx > 31)\n\t\t{\n\t\t\tif (fax->a > 0)\n\t\t\t\tgoto eol;\n\t\t\tgoto rtc;\n\t\t}\n\t}\n\n\tif ((fax->word >> (32 - 12)) == 0)\n\t{\n\t\teat_bits(fax, 1);\n\t\tgoto loop;\n\t}\n\n\tif ((fax->word >> (32 - 12)) == 1)\n\t{\n\t\teat_bits(fax, 12);\n\t\tfax->eolc ++;\n\n\t\tif (fax->k > 0)\n\t\t{\n\t\t\tif (fax->a == -1)\n\t\t\t\tfax->a = 0;\n\t\t\tif ((fax->word >> (32 - 1)) == 1)\n\t\t\t\tfax->dim = 1;\n\t\t\telse\n\t\t\t\tfax->dim = 2;\n\t\t\teat_bits(fax, 1);\n\t\t}\n\t}\n\telse if (fax->k > 0 && fax->a == -1)\n\t{\n\t\tfax->a = 0;\n\t\tif ((fax->word >> (32 - 1)) == 1)\n\t\t\tfax->dim = 1;\n\t\telse\n\t\t\tfax->dim = 2;\n\t\teat_bits(fax, 1);\n\t}\n\telse if (fax->dim == 1)\n\t{\n\t\tfax->eolc = 0;\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tdec1d(ctx, fax);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tgoto error;\n\t\t}\n\t}\n\telse if (fax->dim == 2)\n\t{\n\t\tfax->eolc = 0;\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tdec2d(ctx, fax);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tgoto error;\n\t\t}\n\t}\n\n\t/* no eol check after makeup codes nor in the middle of an H code */\n\tif (fax->stage == STATE_MAKEUP || fax->stage == STATE_H1 || fax->stage == STATE_H2)\n\t\tgoto loop;\n\n\t/* check for eol conditions */\n\tif (fax->eolc || fax->a >= fax->columns)\n\t{\n\t\tif (fax->a > 0)\n\t\t\tgoto eol;\n\t\tif (fax->eolc == (fax->k < 0 ? 2 : 6))\n\t\t\tgoto rtc;\n\t}\n\n\tgoto loop;\n\neol:\n\tfax->stage = STATE_EOL;\n\n\tif (fax->black_is_1)\n\t{\n\t\twhile (fax->rp < fax->wp && p < ep)\n\t\t\t*p++ = *fax->rp++;\n\t}\n\telse\n\t{\n\t\twhile (fax->rp < fax->wp && p < ep)\n\t\t\t*p++ = *fax->rp++ ^ 0xff;\n\t}\n\n\tif (fax->rp < fax->wp)\n\t{\n\t\tstm->rp = fax->buffer;\n\t\tstm->wp = p;\n\t\tstm->pos += (p - fax->buffer);\n\t\tif (p == fax->buffer)\n\t\t\treturn EOF;\n\t\treturn *stm->rp++;\n\t}\n\n\ttmp = fax->ref;\n\tfax->ref = fax->dst;\n\tfax->dst = tmp;\n\tmemset(fax->dst, 0, fax->stride);\n\n\tfax->rp = fax->dst;\n\tfax->wp = fax->dst + fax->stride;\n\n\tfax->stage = STATE_NORMAL;\n\tfax->c = 0;\n\tfax->a = -1;\n\tfax->ridx ++;\n\n\tif (!fax->end_of_block && fax->rows && fax->ridx >= fax->rows)\n\t\tgoto rtc;\n\n\t/* we have not read dim from eol, make a guess */\n\tif (fax->k > 0 && !fax->eolc && fax->a == -1)\n\t{\n\t\tif (fax->ridx % fax->k == 0)\n\t\t\tfax->dim = 1;\n\t\telse\n\t\t\tfax->dim = 2;\n\t}\n\n\t/* if end_of_line & encoded_byte_align, EOLs are *not* optional */\n\tif (fax->encoded_byte_align)\n\t{\n\t\tif (fax->end_of_line)\n\t\t\teat_bits(fax, (12 - fax->bidx) & 7);\n\t\telse\n\t\t\teat_bits(fax, (8 - fax->bidx) & 7);\n\t}\n\n\t/* no more space in output, don't decode the next row yet */\n\tif (p == fax->buffer + max)\n\t{\n\t\tstm->rp = fax->buffer;\n\t\tstm->wp = p;\n\t\tstm->pos += (p - fax->buffer);\n\t\tif (p == fax->buffer)\n\t\t\treturn EOF;\n\t\treturn *stm->rp++;\n\t}\n\n\tgoto loop;\n\nerror:\n\t/* decode the remaining pixels up to where the error occurred */\n\tif (fax->black_is_1)\n\t{\n\t\twhile (fax->rp < fax->wp && p < ep)\n\t\t\t*p++ = *fax->rp++;\n\t}\n\telse\n\t{\n\t\twhile (fax->rp < fax->wp && p < ep)\n\t\t\t*p++ = *fax->rp++ ^ 0xff;\n\t}\n\t/* fallthrough */\n\nrtc:\n\tfax->stage = STATE_DONE;\n\tstm->rp = fax->buffer;\n\tstm->wp = p;\n\tstm->pos += (p - fax->buffer);\n\tif (p == fax->buffer)\n\t\treturn EOF;\n\treturn *stm->rp++;\n}\n\nstatic void\nclose_faxd(fz_context *ctx, void *state_)\n{\n\tfz_faxd *fax = (fz_faxd *)state_;\n\tint i;\n\n\t/* if we read any extra bytes, try to put them back */\n\ti = (32 - fax->bidx) / 8;\n\twhile (i--)\n\t\tfz_unread_byte(fax->chain);\n\n\tfz_close(fax->chain);\n\tfz_free(ctx, fax->ref);\n\tfz_free(ctx, fax->dst);\n\tfz_free(ctx, fax);\n}\n\nstatic fz_stream *\nrebind_faxd(fz_stream *s)\n{\n\tfz_faxd *state = s->state;\n\treturn state->chain;\n}\n\n/* Default: columns = 1728, end_of_block = 1, the rest = 0 */\nfz_stream *\nfz_open_faxd(fz_stream *chain,\n\tint k, int end_of_line, int encoded_byte_align,\n\tint columns, int rows, int end_of_block, int black_is_1)\n{\n\tfz_context *ctx = chain->ctx;\n\tfz_faxd *fax = NULL;\n\n\tfz_var(fax);\n\n\tfz_try(ctx)\n\t{\n\t\tif (columns < 0 || columns >= INT_MAX - 7)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"too many columns lead to an integer overflow (%d)\", columns);\n\n\t\tfax = fz_malloc_struct(ctx, fz_faxd);\n\t\tfax->chain = chain;\n\n\t\tfax->ref = NULL;\n\t\tfax->dst = NULL;\n\n\t\tfax->k = k;\n\t\tfax->end_of_line = end_of_line;\n\t\tfax->encoded_byte_align = encoded_byte_align;\n\t\tfax->columns = columns;\n\t\tfax->rows = rows;\n\t\tfax->end_of_block = end_of_block;\n\t\tfax->black_is_1 = black_is_1;\n\n\t\tfax->stride = ((fax->columns - 1) >> 3) + 1;\n\t\tfax->ridx = 0;\n\t\tfax->bidx = 32;\n\t\tfax->word = 0;\n\n\t\tfax->stage = STATE_INIT;\n\t\tfax->a = -1;\n\t\tfax->c = 0;\n\t\tfax->dim = fax->k < 0 ? 2 : 1;\n\t\tfax->eolc = 0;\n\n\t\tfax->ref = fz_malloc(ctx, fax->stride);\n\t\tfax->dst = fz_malloc(ctx, fax->stride);\n\t\tfax->rp = fax->dst;\n\t\tfax->wp = fax->dst + fax->stride;\n\n\t\tmemset(fax->ref, 0, fax->stride);\n\t\tmemset(fax->dst, 0, fax->stride);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tif (fax)\n\t\t{\n\t\t\tfz_free(ctx, fax->dst);\n\t\t\tfz_free(ctx, fax->ref);\n\t\t}\n\t\tfz_free(ctx, fax);\n\t\tfz_close(chain);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn fz_new_stream(ctx, fax, next_faxd, close_faxd, rebind_faxd);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/filter-flate.c",
    "content": "#include \"mupdf/fitz.h\"\n\n#include <zlib.h>\n\ntypedef struct fz_flate_s fz_flate;\n\nstruct fz_flate_s\n{\n\tfz_stream *chain;\n\tz_stream z;\n\tunsigned char buffer[4096];\n};\n\nstatic void *zalloc(void *opaque, unsigned int items, unsigned int size)\n{\n\treturn fz_malloc_array_no_throw(opaque, items, size);\n}\n\nstatic void zfree(void *opaque, void *ptr)\n{\n\tfz_free(opaque, ptr);\n}\n\nstatic int\nnext_flated(fz_stream *stm, int required)\n{\n\tfz_flate *state = stm->state;\n\tfz_stream *chain = state->chain;\n\tz_streamp zp = &state->z;\n\tint code;\n\tunsigned char *outbuf = state->buffer;\n\tint outlen = sizeof(state->buffer);\n\n\tif (stm->eof)\n\t\treturn EOF;\n\n\tzp->next_out = outbuf;\n\tzp->avail_out = outlen;\n\n\twhile (zp->avail_out > 0)\n\t{\n\t\tzp->avail_in = fz_available(chain, 1);\n\t\tzp->next_in = chain->rp;\n\n\t\tcode = inflate(zp, Z_SYNC_FLUSH);\n\n\t\tchain->rp = chain->wp - zp->avail_in;\n\n\t\tif (code == Z_STREAM_END)\n\t\t{\n\t\t\tbreak;\n\t\t}\n\t\telse if (code == Z_BUF_ERROR)\n\t\t{\n\t\t\tfz_warn(stm->ctx, \"premature end of data in flate filter\");\n\t\t\tbreak;\n\t\t}\n\t\telse if (code == Z_DATA_ERROR && zp->avail_in == 0)\n\t\t{\n\t\t\tfz_warn(stm->ctx, \"ignoring zlib error: %s\", zp->msg);\n\t\t\tbreak;\n\t\t}\n\t\telse if (code == Z_DATA_ERROR && !strcmp(zp->msg, \"incorrect data check\"))\n\t\t{\n\t\t\tfz_warn(stm->ctx, \"ignoring zlib error: %s\", zp->msg);\n\t\t\tchain->rp = chain->wp;\n\t\t\tbreak;\n\t\t}\n\t\telse if (code != Z_OK)\n\t\t{\n\t\t\tfz_throw(stm->ctx, FZ_ERROR_GENERIC, \"zlib error: %s\", zp->msg);\n\t\t}\n\t}\n\n\tstm->rp = state->buffer;\n\tstm->wp = state->buffer + outlen - zp->avail_out;\n\tstm->pos += outlen - zp->avail_out;\n\tif (stm->rp == stm->wp)\n\t{\n\t\tstm->eof = 1;\n\t\treturn EOF;\n\t}\n\treturn *stm->rp++;\n}\n\nstatic void\nclose_flated(fz_context *ctx, void *state_)\n{\n\tfz_flate *state = (fz_flate *)state_;\n\tint code;\n\n\tcode = inflateEnd(&state->z);\n\tif (code != Z_OK)\n\t\tfz_warn(ctx, \"zlib error: inflateEnd: %s\", state->z.msg);\n\n\tfz_close(state->chain);\n\tfz_free(ctx, state);\n}\n\nstatic fz_stream *\nrebind_flated(fz_stream *s)\n{\n\tfz_flate *state = s->state;\n\treturn state->chain;\n}\n\nfz_stream *\nfz_open_flated(fz_stream *chain, int window_bits)\n{\n\tfz_flate *state = NULL;\n\tint code = Z_OK;\n\tfz_context *ctx = chain->ctx;\n\n\tfz_var(code);\n\tfz_var(state);\n\n\tfz_try(ctx)\n\t{\n\t\tstate = fz_malloc_struct(ctx, fz_flate);\n\t\tstate->chain = chain;\n\n\t\tstate->z.zalloc = zalloc;\n\t\tstate->z.zfree = zfree;\n\t\tstate->z.opaque = ctx;\n\t\tstate->z.next_in = NULL;\n\t\tstate->z.avail_in = 0;\n\n\t\tcode = inflateInit2(&state->z, window_bits);\n\t\tif (code != Z_OK)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"zlib error: inflateInit: %s\", state->z.msg);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tif (state && code == Z_OK)\n\t\t\tinflateEnd(&state->z);\n\t\tfz_free(ctx, state);\n\t\tfz_close(chain);\n\t\tfz_rethrow(ctx);\n\t}\n\treturn fz_new_stream(ctx, state, next_flated, close_flated, rebind_flated);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/filter-jbig2.c",
    "content": "#include \"mupdf/fitz.h\"\n\n#include <jbig2.h>\n\ntypedef struct fz_jbig2d_s fz_jbig2d;\n\nstruct fz_jbig2_globals_s\n{\n\tfz_storable storable;\n\tJbig2GlobalCtx *gctx;\n};\n\nstruct fz_jbig2d_s\n{\n\tfz_stream *chain;\n\tJbig2Ctx *ctx;\n\tfz_jbig2_globals *gctx;\n\tJbig2Image *page;\n\tint idx;\n\tunsigned char buffer[4096];\n};\n\nstatic void\nfz_drop_jbig2_globals(fz_context *ctx, fz_jbig2_globals *globals)\n{\n\tfz_drop_storable(ctx, &globals->storable);\n}\n\nstatic void\nclose_jbig2d(fz_context *ctx, void *state_)\n{\n\tfz_jbig2d *state = (fz_jbig2d *)state_;\n\tif (state->page)\n\t\tjbig2_release_page(state->ctx, state->page);\n\tif (state->gctx)\n\t\tfz_drop_jbig2_globals(ctx, state->gctx);\n\tjbig2_ctx_free(state->ctx);\n\tfz_close(state->chain);\n\tfz_free(ctx, state);\n}\n\nstatic int\nnext_jbig2d(fz_stream *stm, int len)\n{\n\tfz_jbig2d *state = stm->state;\n\tunsigned char tmp[4096];\n\tunsigned char *buf = state->buffer;\n\tunsigned char *p = buf;\n\tunsigned char *ep;\n\tunsigned char *s;\n\tint x, w, n;\n\n\tif (len > sizeof(state->buffer))\n\t\tlen = sizeof(state->buffer);\n\tep = buf + len;\n\n\tif (!state->page)\n\t{\n\t\twhile (1)\n\t\t{\n\t\t\tn = fz_read(state->chain, tmp, sizeof tmp);\n\t\t\tif (n == 0)\n\t\t\t\tbreak;\n\t\t\tjbig2_data_in(state->ctx, tmp, n);\n\t\t}\n\n\t\tjbig2_complete_page(state->ctx);\n\n\t\tstate->page = jbig2_page_out(state->ctx);\n\t\tif (!state->page)\n\t\t\tfz_throw(stm->ctx, FZ_ERROR_GENERIC, \"jbig2_page_out failed\");\n\t}\n\n\ts = state->page->data;\n\tw = state->page->height * state->page->stride;\n\tx = state->idx;\n\twhile (p < ep && x < w)\n\t\t*p++ = s[x++] ^ 0xff;\n\tstate->idx = x;\n\n\tstm->rp = buf;\n\tstm->wp = p;\n\tif (p == buf)\n\t\treturn EOF;\n\tstm->pos += p - buf;\n\treturn *stm->rp++;\n}\n\nstatic fz_stream *\nrebind_jbig2d(fz_stream *s)\n{\n\tfz_jbig2d *state = s->state;\n\treturn state->chain;\n}\n\nstatic int\nerror_callback(void *data, const char *msg, Jbig2Severity severity, int32_t seg_idx)\n{\n\tfz_context *ctx = data;\n\tif (severity == JBIG2_SEVERITY_FATAL)\n\t\tfz_warn(ctx, \"jbig2dec error: %s (segment %d)\", msg, seg_idx);\n\telse if (severity == JBIG2_SEVERITY_WARNING)\n\t\tfz_warn(ctx, \"jbig2dec warning: %s (segment %d)\", msg, seg_idx);\n\treturn 0;\n}\n\nfz_jbig2_globals *\nfz_load_jbig2_globals(fz_context *ctx, unsigned char *data, int size)\n{\n\tfz_jbig2_globals *globals = fz_malloc_struct(ctx, fz_jbig2_globals);\n\n\tJbig2Ctx *jctx = jbig2_ctx_new(NULL, JBIG2_OPTIONS_EMBEDDED, NULL, error_callback, ctx);\n\tjbig2_data_in(jctx, data, size);\n\n\tFZ_INIT_STORABLE(globals, 1, fz_free_jbig2_globals_imp);\n\tglobals->gctx = jbig2_make_global_ctx(jctx);\n\n\treturn globals;\n}\n\nvoid\nfz_free_jbig2_globals_imp(fz_context *ctx, fz_storable *globals_)\n{\n\tfz_jbig2_globals *globals = (fz_jbig2_globals *)globals_;\n\tjbig2_global_ctx_free(globals->gctx);\n\tfz_free(ctx, globals);\n}\n\nfz_stream *\nfz_open_jbig2d(fz_stream *chain, fz_jbig2_globals *globals)\n{\n\tfz_jbig2d *state = NULL;\n\tfz_context *ctx = chain->ctx;\n\n\tfz_var(state);\n\n\tfz_try(ctx)\n\t{\n\t\tstate = fz_malloc_struct(chain->ctx, fz_jbig2d);\n\t\tstate->ctx = NULL;\n\t\tstate->gctx = globals;\n\t\tstate->chain = chain;\n\t\tstate->ctx = jbig2_ctx_new(NULL, JBIG2_OPTIONS_EMBEDDED, globals ? globals->gctx : NULL, error_callback, ctx);\n\t\tstate->page = NULL;\n\t\tstate->idx = 0;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tif (state)\n\t\t{\n\t\t\tfz_drop_jbig2_globals(ctx, state->gctx);\n\t\t\tif (state->ctx)\n\t\t\t\tjbig2_ctx_free(state->ctx);\n\t\t}\n\t\tfz_free(ctx, state);\n\t\tfz_close(chain);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn fz_new_stream(ctx, state, next_jbig2d, close_jbig2d, rebind_jbig2d);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/filter-leech.c",
    "content": "#include \"mupdf/fitz.h\"\n\n#include <zlib.h>\n\ntypedef struct fz_leech_s fz_leech;\n\nstruct fz_leech_s\n{\n\tfz_stream *chain;\n\tfz_buffer *buffer;\n};\n\nstatic int\nnext_leech(fz_stream *stm, int max)\n{\n\tfz_leech *state = stm->state;\n\tfz_buffer *buffer = state->buffer;\n\tint n = fz_available(state->chain, max);\n\n\tif (n > max)\n\t\tn = max;\n\n\twhile (buffer->cap < buffer->len + n)\n\t{\n\t\tfz_grow_buffer(stm->ctx, state->buffer);\n\t}\n\tmemcpy(buffer->data + buffer->len, state->chain->rp, n);\n\tstm->rp = buffer->data + buffer->len;\n\tstm->wp = buffer->data + buffer->len + n;\n\tstate->chain->rp += n;\n\tbuffer->len += n;\n\n\tif (n == 0)\n\t\treturn EOF;\n\treturn *stm->rp++;\n}\n\nstatic void\nclose_leech(fz_context *ctx, void *state_)\n{\n\tfz_leech *state = (fz_leech *)state_;\n\n\tfz_close(state->chain);\n\tfz_free(ctx, state);\n}\n\nstatic fz_stream *\nrebind_leech(fz_stream *s)\n{\n\tfz_leech *state = s->state;\n\treturn state->chain;\n}\n\nfz_stream *\nfz_open_leecher(fz_stream *chain, fz_buffer *buffer)\n{\n\tfz_leech *state = NULL;\n\tfz_context *ctx = chain->ctx;\n\n\tfz_var(state);\n\n\tfz_try(ctx)\n\t{\n\t\tstate = fz_malloc_struct(ctx, fz_leech);\n\t\tstate->chain = chain;\n\t\tstate->buffer = buffer;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, state);\n\t\tfz_close(chain);\n\t\tfz_rethrow(ctx);\n\t}\n\treturn fz_new_stream(ctx, state, next_leech, close_leech, rebind_leech);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/filter-lzw.c",
    "content": "#include \"mupdf/fitz.h\"\n\n/* TODO: error checking */\n\nenum\n{\n\tMIN_BITS = 9,\n\tMAX_BITS = 12,\n\tNUM_CODES = (1 << MAX_BITS),\n\tLZW_CLEAR = 256,\n\tLZW_EOD = 257,\n\tLZW_FIRST = 258,\n\tMAX_LENGTH = 4097\n};\n\ntypedef struct lzw_code_s lzw_code;\n\nstruct lzw_code_s\n{\n\tint prev;\t\t\t/* prev code (in string) */\n\tunsigned short length;\t\t/* string len, including this token */\n\tunsigned char value;\t\t/* data value */\n\tunsigned char first_char;\t/* first token of string */\n};\n\ntypedef struct fz_lzwd_s fz_lzwd;\n\nstruct fz_lzwd_s\n{\n\tfz_stream *chain;\n\tint eod;\n\n\tint early_change;\n\n\tint code_bits;\t\t\t/* num bits/code */\n\tint code;\t\t\t/* current code */\n\tint old_code;\t\t\t/* previously recognized code */\n\tint next_code;\t\t\t/* next free entry */\n\n\tlzw_code table[NUM_CODES];\n\n\tunsigned char bp[MAX_LENGTH];\n\tunsigned char *rp, *wp;\n\n\tunsigned char buffer[4096];\n};\n\nstatic int\nnext_lzwd(fz_stream *stm, int len)\n{\n\tfz_lzwd *lzw = stm->state;\n\tlzw_code *table = lzw->table;\n\tunsigned char *buf = lzw->buffer;\n\tunsigned char *p = buf;\n\tunsigned char *ep;\n\tunsigned char *s;\n\tint codelen;\n\n\tint code_bits = lzw->code_bits;\n\tint code = lzw->code;\n\tint old_code = lzw->old_code;\n\tint next_code = lzw->next_code;\n\n\tif (len > sizeof(lzw->buffer))\n\t\tlen = sizeof(lzw->buffer);\n\tep = buf + len;\n\n\twhile (lzw->rp < lzw->wp && p < ep)\n\t\t*p++ = *lzw->rp++;\n\n\twhile (p < ep)\n\t{\n\t\tif (lzw->eod)\n\t\t\treturn EOF;\n\n\t\tcode = fz_read_bits(lzw->chain, code_bits);\n\n\t\tif (fz_is_eof_bits(lzw->chain))\n\t\t{\n\t\t\tlzw->eod = 1;\n\t\t\tbreak;\n\t\t}\n\n\t\tif (code == LZW_EOD)\n\t\t{\n\t\t\tlzw->eod = 1;\n\t\t\tbreak;\n\t\t}\n\n\t\tif (next_code > NUM_CODES && code != LZW_CLEAR)\n\t\t{\n\t\t\tfz_warn(stm->ctx, \"missing clear code in lzw decode\");\n\t\t\tcode = LZW_CLEAR;\n\t\t}\n\n\t\tif (code == LZW_CLEAR)\n\t\t{\n\t\t\tcode_bits = MIN_BITS;\n\t\t\tnext_code = LZW_FIRST;\n\t\t\told_code = -1;\n\t\t\tcontinue;\n\t\t}\n\n\t\t/* if stream starts without a clear code, old_code is undefined... */\n\t\tif (old_code == -1)\n\t\t{\n\t\t\told_code = code;\n\t\t}\n\t\telse if (next_code == NUM_CODES)\n\t\t{\n\t\t\t/* TODO: Ghostscript checks for a following LZW_CLEAR before tolerating */\n\t\t\tfz_warn(stm->ctx, \"tolerating a single out of range code in lzw decode\");\n\t\t\tnext_code++;\n\t\t}\n\t\telse if (code > next_code || next_code >= NUM_CODES)\n\t\t{\n\t\t\tfz_warn(stm->ctx, \"out of range code encountered in lzw decode\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* add new entry to the code table */\n\t\t\ttable[next_code].prev = old_code;\n\t\t\ttable[next_code].first_char = table[old_code].first_char;\n\t\t\ttable[next_code].length = table[old_code].length + 1;\n\t\t\tif (code < next_code)\n\t\t\t\ttable[next_code].value = table[code].first_char;\n\t\t\telse if (code == next_code)\n\t\t\t\ttable[next_code].value = table[next_code].first_char;\n\t\t\telse\n\t\t\t\tfz_warn(stm->ctx, \"out of range code encountered in lzw decode\");\n\n\t\t\tnext_code ++;\n\n\t\t\tif (next_code > (1 << code_bits) - lzw->early_change - 1)\n\t\t\t{\n\t\t\t\tcode_bits ++;\n\t\t\t\tif (code_bits > MAX_BITS)\n\t\t\t\t\tcode_bits = MAX_BITS;\n\t\t\t}\n\n\t\t\told_code = code;\n\t\t}\n\n\t\t/* code maps to a string, copy to output (in reverse...) */\n\t\tif (code > 255)\n\t\t{\n\t\t\tcodelen = table[code].length;\n\t\t\tlzw->rp = lzw->bp;\n\t\t\tlzw->wp = lzw->bp + codelen;\n\n\t\t\tassert(codelen < MAX_LENGTH);\n\n\t\t\ts = lzw->wp;\n\t\t\tdo {\n\t\t\t\t*(--s) = table[code].value;\n\t\t\t\tcode = table[code].prev;\n\t\t\t} while (code >= 0 && s > lzw->bp);\n\t\t}\n\n\t\t/* ... or just a single character */\n\t\telse\n\t\t{\n\t\t\tlzw->bp[0] = code;\n\t\t\tlzw->rp = lzw->bp;\n\t\t\tlzw->wp = lzw->bp + 1;\n\t\t}\n\n\t\t/* copy to output */\n\t\twhile (lzw->rp < lzw->wp && p < ep)\n\t\t\t*p++ = *lzw->rp++;\n\t}\n\n\tlzw->code_bits = code_bits;\n\tlzw->code = code;\n\tlzw->old_code = old_code;\n\tlzw->next_code = next_code;\n\n\tstm->rp = buf;\n\tstm->wp = p;\n\tif (buf == p)\n\t\treturn EOF;\n\tstm->pos += p - buf;\n\n\treturn *stm->rp++;\n}\n\nstatic void\nclose_lzwd(fz_context *ctx, void *state_)\n{\n\tfz_lzwd *lzw = (fz_lzwd *)state_;\n\tfz_sync_bits(lzw->chain);\n\tfz_close(lzw->chain);\n\tfz_free(ctx, lzw);\n}\n\nstatic fz_stream *\nrebind_lzwd(fz_stream *s)\n{\n\tfz_lzwd *state = s->state;\n\treturn state->chain;\n}\n\n/* Default: early_change = 1 */\nfz_stream *\nfz_open_lzwd(fz_stream *chain, int early_change)\n{\n\tfz_context *ctx = chain->ctx;\n\tfz_lzwd *lzw = NULL;\n\tint i;\n\n\tfz_var(lzw);\n\n\tfz_try(ctx)\n\t{\n\t\tlzw = fz_malloc_struct(ctx, fz_lzwd);\n\t\tlzw->chain = chain;\n\t\tlzw->eod = 0;\n\t\tlzw->early_change = early_change;\n\n\t\tfor (i = 0; i < 256; i++)\n\t\t{\n\t\t\tlzw->table[i].value = i;\n\t\t\tlzw->table[i].first_char = i;\n\t\t\tlzw->table[i].length = 1;\n\t\t\tlzw->table[i].prev = -1;\n\t\t}\n\n\t\tfor (i = 256; i < NUM_CODES; i++)\n\t\t{\n\t\t\tlzw->table[i].value = 0;\n\t\t\tlzw->table[i].first_char = 0;\n\t\t\tlzw->table[i].length = 0;\n\t\t\tlzw->table[i].prev = -1;\n\t\t}\n\n\t\tlzw->code_bits = MIN_BITS;\n\t\tlzw->code = -1;\n\t\tlzw->next_code = LZW_FIRST;\n\t\tlzw->old_code = -1;\n\t\tlzw->rp = lzw->bp;\n\t\tlzw->wp = lzw->bp;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, lzw);\n\t\tfz_close(chain);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn fz_new_stream(ctx, lzw, next_lzwd, close_lzwd, rebind_lzwd);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/filter-predict.c",
    "content": "#include \"mupdf/fitz.h\"\n\n/* TODO: check if this works with 16bpp images */\n\ntypedef struct fz_predict_s fz_predict;\n\nstruct fz_predict_s\n{\n\tfz_stream *chain;\n\n\tint predictor;\n\tint columns;\n\tint colors;\n\tint bpc;\n\n\tint stride;\n\tint bpp;\n\tunsigned char *in;\n\tunsigned char *out;\n\tunsigned char *ref;\n\tunsigned char *rp, *wp;\n\n\tunsigned char buffer[4096];\n};\n\nstatic inline int getcomponent(unsigned char *line, int x, int bpc)\n{\n\tswitch (bpc)\n\t{\n\tcase 1: return (line[x >> 3] >> ( 7 - (x & 7) ) ) & 1;\n\tcase 2: return (line[x >> 2] >> ( ( 3 - (x & 3) ) << 1 ) ) & 3;\n\tcase 4: return (line[x >> 1] >> ( ( 1 - (x & 1) ) << 2 ) ) & 15;\n\tcase 8: return line[x];\n\tcase 16: return (line[x<<1]<<8)+line[(x<<1)+1];\n\t}\n\treturn 0;\n}\n\nstatic inline void putcomponent(unsigned char *buf, int x, int bpc, int value)\n{\n\tswitch (bpc)\n\t{\n\tcase 1: buf[x >> 3] |= value << (7 - (x & 7)); break;\n\tcase 2: buf[x >> 2] |= value << ((3 - (x & 3)) << 1); break;\n\tcase 4: buf[x >> 1] |= value << ((1 - (x & 1)) << 2); break;\n\tcase 8: buf[x] = value; break;\n\tcase 16: buf[x<<1] = value>>8; buf[(x<<1)+1] = value; break;\n\t}\n}\n\nstatic inline int paeth(int a, int b, int c)\n{\n\t/* The definitions of ac and bc are correct, not a typo. */\n\tint ac = b - c, bc = a - c, abcc = ac + bc;\n\tint pa = fz_absi(ac);\n\tint pb = fz_absi(bc);\n\tint pc = fz_absi(abcc);\n\treturn pa <= pb && pa <= pc ? a : pb <= pc ? b : c;\n}\n\nstatic void\nfz_predict_tiff(fz_predict *state, unsigned char *out, unsigned char *in, int len)\n{\n\tint left[FZ_MAX_COLORS];\n\tint i, k;\n\tconst int mask = (1 << state->bpc)-1;\n\n\tfor (k = 0; k < state->colors; k++)\n\t\tleft[k] = 0;\n\n\t/* special fast case */\n\tif (state->bpc == 8)\n\t{\n\t\tfor (i = 0; i < state->columns; i++)\n\t\t\tfor (k = 0; k < state->colors; k++)\n\t\t\t\t*out++ = left[k] = (*in++ + left[k]) & 0xFF;\n\t\treturn;\n\t}\n\n\t/* putcomponent assumes zeroed memory for bpc < 8 */\n\tif (state->bpc < 8)\n\t\tmemset(out, 0, state->stride);\n\n\tfor (i = 0; i < state->columns; i++)\n\t{\n\t\tfor (k = 0; k < state->colors; k++)\n\t\t{\n\t\t\tint a = getcomponent(in, i * state->colors + k, state->bpc);\n\t\t\tint b = a + left[k];\n\t\t\tint c = b & mask;\n\t\t\tputcomponent(out, i * state->colors + k, state->bpc, c);\n\t\t\tleft[k] = c;\n\t\t}\n\t}\n}\n\nstatic void\nfz_predict_png(fz_predict *state, unsigned char *out, unsigned char *in, int len, int predictor)\n{\n\tint bpp = state->bpp;\n\tint i;\n\tunsigned char *ref = state->ref;\n\n\tif (bpp > len)\n\t\tbpp = len;\n\n\tswitch (predictor)\n\t{\n\tcase 0:\n\t\tmemcpy(out, in, len);\n\t\tbreak;\n\tcase 1:\n\t\tfor (i = bpp; i > 0; i--)\n\t\t{\n\t\t\t*out++ = *in++;\n\t\t}\n\t\tfor (i = len - bpp; i > 0; i--)\n\t\t{\n\t\t\t*out = *in++ + out[-bpp];\n\t\t\tout++;\n\t\t}\n\t\tbreak;\n\tcase 2:\n\t\tfor (i = bpp; i > 0; i--)\n\t\t{\n\t\t\t*out++ = *in++ + *ref++;\n\t\t}\n\t\tfor (i = len - bpp; i > 0; i--)\n\t\t{\n\t\t\t*out++ = *in++ + *ref++;\n\t\t}\n\t\tbreak;\n\tcase 3:\n\t\tfor (i = bpp; i > 0; i--)\n\t\t{\n\t\t\t*out++ = *in++ + (*ref++) / 2;\n\t\t}\n\t\tfor (i = len - bpp; i > 0; i--)\n\t\t{\n\t\t\t*out = *in++ + (out[-bpp] + *ref++) / 2;\n\t\t\tout++;\n\t\t}\n\t\tbreak;\n\tcase 4:\n\t\tfor (i = bpp; i > 0; i--)\n\t\t{\n\t\t\t*out++ = *in++ + paeth(0, *ref++, 0);\n\t\t}\n\t\tfor (i = len - bpp; i > 0; i --)\n\t\t{\n\t\t\t*out = *in++ + paeth(out[-bpp], *ref, ref[-bpp]);\n\t\t\tref++;\n\t\t\tout++;\n\t\t}\n\t\tbreak;\n\t}\n}\n\nstatic int\nnext_predict(fz_stream *stm, int len)\n{\n\tfz_predict *state = stm->state;\n\tunsigned char *buf = state->buffer;\n\tunsigned char *p = buf;\n\tunsigned char *ep;\n\tint ispng = state->predictor >= 10;\n\tint n;\n\n\tif (len >= sizeof(state->buffer))\n\t\tlen = sizeof(state->buffer);\n\tep = buf + len;\n\n\twhile (state->rp < state->wp && p < ep)\n\t\t*p++ = *state->rp++;\n\n\twhile (p < ep)\n\t{\n\t\tn = fz_read(state->chain, state->in, state->stride + ispng);\n\t\tif (n == 0)\n\t\t\tbreak;\n\n\t\tif (state->predictor == 1)\n\t\t\tmemcpy(state->out, state->in, n);\n\t\telse if (state->predictor == 2)\n\t\t\tfz_predict_tiff(state, state->out, state->in, n);\n\t\telse\n\t\t{\n\t\t\tfz_predict_png(state, state->out, state->in + 1, n - 1, state->in[0]);\n\t\t\tmemcpy(state->ref, state->out, state->stride);\n\t\t}\n\n\t\tstate->rp = state->out;\n\t\tstate->wp = state->out + n - ispng;\n\n\t\t/* cf. https://code.google.com/p/sumatrapdf/issues/detail?id=2518 */\n\t\tn = fz_mini(state->wp - state->rp, ep - p);\n\t\tmemcpy(p, state->rp, n);\n\t\tp += n;\n\t\tstate->rp += n;\n\t}\n\n\tstm->rp = buf;\n\tstm->wp = p;\n\tif (stm->rp == stm->wp)\n\t\treturn EOF;\n\tstm->pos += p - buf;\n\n\treturn *stm->rp++;\n}\n\nstatic void\nclose_predict(fz_context *ctx, void *state_)\n{\n\tfz_predict *state = (fz_predict *)state_;\n\tfz_close(state->chain);\n\tfz_free(ctx, state->in);\n\tfz_free(ctx, state->out);\n\tfz_free(ctx, state->ref);\n\tfz_free(ctx, state);\n}\n\nstatic fz_stream *\nrebind_predict(fz_stream *s)\n{\n\tfz_predict *state = s->state;\n\treturn state->chain;\n}\n\n/* Default values: predictor = 1, columns = 1, colors = 1, bpc = 8 */\nfz_stream *\nfz_open_predict(fz_stream *chain, int predictor, int columns, int colors, int bpc)\n{\n\tfz_context *ctx = chain->ctx;\n\tfz_predict *state = NULL;\n\n\tfz_var(state);\n\n\tif (predictor < 1)\n\t\tpredictor = 1;\n\tif (columns < 1)\n\t\tcolumns = 1;\n\tif (colors < 1)\n\t\tcolors = 1;\n\tif (bpc < 1)\n\t\tbpc = 8;\n\n\tfz_try(ctx)\n\t{\n\t\tif (bpc != 1 && bpc != 2 && bpc != 4 && bpc != 8 && bpc != 16)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"invalid number of bits per component: %d\", bpc);\n\t\tif (colors > FZ_MAX_COLORS)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"too many color components (%d > %d)\", colors, FZ_MAX_COLORS);\n\t\tif (columns >= INT_MAX / (bpc * colors))\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"too many columns lead to an integer overflow (%d)\", columns);\n\n\t\tstate = fz_malloc_struct(ctx, fz_predict);\n\t\tstate->in = NULL;\n\t\tstate->out = NULL;\n\t\tstate->chain = chain;\n\n\t\tstate->predictor = predictor;\n\t\tstate->columns = columns;\n\t\tstate->colors = colors;\n\t\tstate->bpc = bpc;\n\n\t\tif (state->predictor != 1 && state->predictor != 2 &&\n\t\t\tstate->predictor != 10 && state->predictor != 11 &&\n\t\t\tstate->predictor != 12 && state->predictor != 13 &&\n\t\t\tstate->predictor != 14 && state->predictor != 15)\n\t\t{\n\t\t\tfz_warn(ctx, \"invalid predictor: %d\", state->predictor);\n\t\t\tstate->predictor = 1;\n\t\t}\n\n\t\tstate->stride = (state->bpc * state->colors * state->columns + 7) / 8;\n\t\tstate->bpp = (state->bpc * state->colors + 7) / 8;\n\n\t\tstate->in = fz_malloc(ctx, state->stride + 1);\n\t\tstate->out = fz_malloc(ctx, state->stride);\n\t\tstate->ref = fz_malloc(ctx, state->stride);\n\t\tstate->rp = state->out;\n\t\tstate->wp = state->out;\n\n\t\tmemset(state->ref, 0, state->stride);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tif (state)\n\t\t{\n\t\t\tfz_free(ctx, state->in);\n\t\t\tfz_free(ctx, state->out);\n\t\t}\n\t\tfz_free(ctx, state);\n\t\tfz_close(chain);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn fz_new_stream(ctx, state, next_predict, close_predict, rebind_predict);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/font.c",
    "content": "#include \"mupdf/fitz.h\"\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_ADVANCES_H\n#include FT_STROKER_H\n\n#define MAX_BBOX_TABLE_SIZE 4096\n\n/* 20 degrees */\n#define SHEAR 0.36397f\n\nstatic void fz_drop_freetype(fz_context *ctx);\n\nstatic fz_font *\nfz_new_font(fz_context *ctx, const char *name, int use_glyph_bbox, int glyph_count)\n{\n\tfz_font *font;\n\tint i;\n\n\tfont = fz_malloc_struct(ctx, fz_font);\n\tfont->refs = 1;\n\n\tif (name)\n\t\tfz_strlcpy(font->name, name, sizeof font->name);\n\telse\n\t\tfz_strlcpy(font->name, \"(null)\", sizeof font->name);\n\n\tfont->ft_face = NULL;\n\tfont->ft_substitute = 0;\n\tfont->ft_bold = 0;\n\tfont->ft_italic = 0;\n\tfont->ft_hint = 0;\n\n\tfont->ft_buffer = NULL;\n\tfont->ft_filepath = NULL;\n\n\tfont->t3matrix = fz_identity;\n\tfont->t3resources = NULL;\n\tfont->t3procs = NULL;\n\tfont->t3lists = NULL;\n\tfont->t3widths = NULL;\n\tfont->t3flags = NULL;\n\tfont->t3doc = NULL;\n\tfont->t3run = NULL;\n\n\tfont->bbox.x0 = 0;\n\tfont->bbox.y0 = 0;\n\tfont->bbox.x1 = 1;\n\tfont->bbox.y1 = 1;\n\n\tfont->use_glyph_bbox = use_glyph_bbox;\n\tif (use_glyph_bbox && glyph_count <= MAX_BBOX_TABLE_SIZE)\n\t{\n\t\tfont->bbox_count = glyph_count;\n\t\tfont->bbox_table = fz_malloc_array(ctx, glyph_count, sizeof(fz_rect));\n\t\tfor (i = 0; i < glyph_count; i++)\n\t\t\tfont->bbox_table[i] = fz_infinite_rect;\n\t}\n\telse\n\t{\n\t\tif (use_glyph_bbox)\n\t\t\tfz_warn(ctx, \"not building glyph bbox table for font '%s' with %d glyphs\", font->name, glyph_count);\n\t\tfont->bbox_count = 0;\n\t\tfont->bbox_table = NULL;\n\t}\n\n\tfont->width_count = 0;\n\tfont->width_table = NULL;\n\n\treturn font;\n}\n\nfz_font *\nfz_keep_font(fz_context *ctx, fz_font *font)\n{\n\tif (!font)\n\t\treturn NULL;\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tfont->refs ++;\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\treturn font;\n}\n\nstatic void\nfree_resources(fz_context *ctx, fz_font *font)\n{\n\tint i;\n\n\tif (font->t3resources)\n\t{\n\t\tfont->t3freeres(font->t3doc, font->t3resources);\n\t\tfont->t3resources = NULL;\n\t}\n\n\tif (font->t3procs)\n\t{\n\t\tfor (i = 0; i < 256; i++)\n\t\t\tif (font->t3procs[i])\n\t\t\t\tfz_drop_buffer(ctx, font->t3procs[i]);\n\t}\n\tfz_free(ctx, font->t3procs);\n\tfont->t3procs = NULL;\n}\n\nvoid fz_decouple_type3_font(fz_context *ctx, fz_font *font, void *t3doc)\n{\n\tif (!ctx || !font || !t3doc || font->t3doc == NULL)\n\t\treturn;\n\n\tif (font->t3doc != t3doc)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"can't decouple type3 font from a different doc\");\n\n\tfont->t3doc = NULL;\n\tfree_resources(ctx, font);\n}\n\nvoid\nfz_drop_font(fz_context *ctx, fz_font *font)\n{\n\tint fterr;\n\tint i, drop;\n\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tdrop = (font && --font->refs == 0);\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\tif (!drop)\n\t\treturn;\n\n\tfree_resources(ctx, font);\n\tif (font->t3lists)\n\t{\n\t\tfor (i = 0; i < 256; i++)\n\t\t{\n\t\t\tif (font->t3lists[i])\n\t\t\t\tfz_drop_display_list(ctx, font->t3lists[i]);\n\t\t}\n\t\tfz_free(ctx, font->t3procs);\n\t\tfz_free(ctx, font->t3lists);\n\t\tfz_free(ctx, font->t3widths);\n\t\tfz_free(ctx, font->t3flags);\n\t}\n\n\tif (font->ft_face)\n\t{\n\t\tfz_lock(ctx, FZ_LOCK_FREETYPE);\n\t\tfterr = FT_Done_Face((FT_Face)font->ft_face);\n\t\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\t\tif (fterr)\n\t\t\tfz_warn(ctx, \"freetype finalizing face: %s\", ft_error_string(fterr));\n\t\tfz_drop_freetype(ctx);\n\t}\n\n\tfz_drop_buffer(ctx, font->ft_buffer);\n\tfz_free(ctx, font->ft_filepath);\n\tfz_free(ctx, font->bbox_table);\n\tfz_free(ctx, font->width_table);\n\tfz_free(ctx, font);\n}\n\nvoid\nfz_set_font_bbox(fz_context *ctx, fz_font *font, float xmin, float ymin, float xmax, float ymax)\n{\n\tif (xmin >= xmax || ymin >= ymax)\n\t{\n\t\t/* Invalid bbox supplied. It would be prohibitively slow to\n\t\t * measure the true one, so make one up. */\n\t\tfont->bbox.x0 = -1;\n\t\tfont->bbox.y0 = -1;\n\t\tfont->bbox.x1 = 2;\n\t\tfont->bbox.y1 = 2;\n\t}\n\telse\n\t{\n\t\tfont->bbox.x0 = xmin;\n\t\tfont->bbox.y0 = ymin;\n\t\tfont->bbox.x1 = xmax;\n\t\tfont->bbox.y1 = ymax;\n\t}\n\t/* SumatraPDF: some fonts seem to use oversized bboxes (Ghostscript issue?) */\n\tif (xmax - xmin == 1000 && ymax - ymin == 1000)\n\t{\n\t\tfz_matrix ctm;\n\t\tfz_transform_rect(&font->bbox, fz_scale(&ctm, 0.001f, 0.001f));\n\t}\n}\n\n/*\n * Freetype hooks\n */\n\nstruct fz_font_context_s {\n\tint ctx_refs;\n\tFT_Library ftlib;\n\tint ftlib_refs;\n\tfz_load_system_font_func load_font;\n\tfz_load_system_cjk_font_func load_cjk_font;\n};\n\n#undef __FTERRORS_H__\n#define FT_ERRORDEF(e, v, s) { (e), (s) },\n#define FT_ERROR_START_LIST\n#define FT_ERROR_END_LIST { 0, NULL }\n\nstruct ft_error\n{\n\tint err;\n\tchar *str;\n};\n\nvoid fz_new_font_context(fz_context *ctx)\n{\n\tctx->font = fz_malloc_struct(ctx, fz_font_context);\n\tctx->font->ctx_refs = 1;\n\tctx->font->ftlib = NULL;\n\tctx->font->ftlib_refs = 0;\n\tctx->font->load_font = NULL;\n}\n\nfz_font_context *\nfz_keep_font_context(fz_context *ctx)\n{\n\tif (!ctx || !ctx->font)\n\t\treturn NULL;\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tctx->font->ctx_refs++;\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\treturn ctx->font;\n}\n\nvoid fz_drop_font_context(fz_context *ctx)\n{\n\tint drop;\n\tif (!ctx || !ctx->font)\n\t\treturn;\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tdrop = --ctx->font->ctx_refs;\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\tif (drop == 0)\n\t\tfz_free(ctx, ctx->font);\n}\n\nvoid fz_install_load_system_font_funcs(fz_context *ctx, fz_load_system_font_func f, fz_load_system_cjk_font_func f_cjk)\n{\n\tctx->font->load_font = f;\n\tctx->font->load_cjk_font = f_cjk;\n}\n\nfz_font *fz_load_system_font(fz_context *ctx, const char *name, int bold, int italic, int needs_exact_metrics)\n{\n\tfz_font *font = NULL;\n\n\tif (ctx->font->load_font)\n\t{\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tfont = ctx->font->load_font(ctx, name, bold, italic, needs_exact_metrics);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfont = NULL;\n\t\t}\n\t}\n\n\treturn font;\n}\n\nfz_font *fz_load_system_cjk_font(fz_context *ctx, const char *name, int ros, int serif)\n{\n\tfz_font *font = NULL;\n\n\tif (ctx->font->load_cjk_font)\n\t{\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tfont = ctx->font->load_cjk_font(ctx, name, ros, serif);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfont = NULL;\n\t\t}\n\t}\n\n\treturn font;\n}\n\nstatic const struct ft_error ft_errors[] =\n{\n#include FT_ERRORS_H\n};\n\nchar *ft_error_string(int err)\n{\n\tconst struct ft_error *e;\n\n\tfor (e = ft_errors; e->str; e++)\n\t\tif (e->err == err)\n\t\t\treturn e->str;\n\n\treturn \"Unknown error\";\n}\n\nstatic void\nfz_keep_freetype(fz_context *ctx)\n{\n\tint fterr;\n\tint maj, min, pat;\n\tfz_font_context *fct = ctx->font;\n\n\tfz_lock(ctx, FZ_LOCK_FREETYPE);\n\tif (fct->ftlib)\n\t{\n\t\tfct->ftlib_refs++;\n\t\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\t\treturn;\n\t}\n\n\tfterr = FT_Init_FreeType(&fct->ftlib);\n\tif (fterr)\n\t{\n\t\tchar *mess = ft_error_string(fterr);\n\t\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot init freetype: %s\", mess);\n\t}\n\n\tFT_Library_Version(fct->ftlib, &maj, &min, &pat);\n\tif (maj == 2 && min == 1 && pat < 7)\n\t{\n\t\tfterr = FT_Done_FreeType(fct->ftlib);\n\t\tif (fterr)\n\t\t\tfz_warn(ctx, \"freetype finalizing: %s\", ft_error_string(fterr));\n\t\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"freetype version too old: %d.%d.%d\", maj, min, pat);\n\t}\n\n\tfct->ftlib_refs++;\n\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n}\n\nstatic void\nfz_drop_freetype(fz_context *ctx)\n{\n\tint fterr;\n\tfz_font_context *fct = ctx->font;\n\n\tfz_lock(ctx, FZ_LOCK_FREETYPE);\n\tif (--fct->ftlib_refs == 0)\n\t{\n\t\tfterr = FT_Done_FreeType(fct->ftlib);\n\t\tif (fterr)\n\t\t\tfz_warn(ctx, \"freetype finalizing: %s\", ft_error_string(fterr));\n\t\tfct->ftlib = NULL;\n\t}\n\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n}\n\n/* SumatraPDF: some Chinese fonts seem to wrongly use pre-devided units */\nstatic void\nfz_check_font_dimensions(FT_Face face)\n{\n\t/* prevent broken fonts from causing a division by zero */\n\tif (face->units_per_EM == 0)\n\t\tface->units_per_EM = 1000;\n\n\tif (face->bbox.xMin == 0 && face->bbox.yMin == 0 &&\n\t\tface->bbox.xMax == 1 && face->bbox.yMax == 1 &&\n\t\tface->ascender == 1 && face->descender == 0)\n\t{\n\t\tface->bbox.xMax = face->units_per_EM;\n\t\tface->bbox.yMax = face->units_per_EM;\n\t\tface->ascender = face->units_per_EM;\n\t}\n\n\t/* use default values for fonts with an empty glyph bbox */\n\tif (face->bbox.xMin == 0 && face->bbox.yMin == 0 &&\n\t\tface->bbox.xMax == 0 && face->bbox.yMax == 0 &&\n\t\tface->ascender == 0 && face->descender == 0)\n\t{\n\t\tface->bbox.xMax = face->units_per_EM;\n\t\tface->bbox.yMax = face->units_per_EM;\n\t\tface->ascender = 0.8f * face->units_per_EM;\n\t\tface->descender = -0.2f * face->units_per_EM;\n\t}\n}\n\nfz_font *\nfz_new_font_from_file(fz_context *ctx, const char *name, const char *path, int index, int use_glyph_bbox)\n{\n\tFT_Face face;\n\tfz_font *font;\n\tint fterr;\n\n\tfz_keep_freetype(ctx);\n\n\tfz_lock(ctx, FZ_LOCK_FREETYPE);\n\tfterr = FT_New_Face(ctx->font->ftlib, path, index, &face);\n\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\tif (fterr)\n\t{\n\t\tfz_drop_freetype(ctx);\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"freetype: cannot load font: %s\", ft_error_string(fterr));\n\t}\n\tfz_check_font_dimensions(face);\n\n\tif (!name)\n\t\tname = face->family_name;\n\n\tfont = fz_new_font(ctx, name, use_glyph_bbox, face->num_glyphs);\n\tfont->ft_face = face;\n\tfz_set_font_bbox(ctx, font,\n\t\t(float) face->bbox.xMin / face->units_per_EM,\n\t\t(float) face->bbox.yMin / face->units_per_EM,\n\t\t(float) face->bbox.xMax / face->units_per_EM,\n\t\t(float) face->bbox.yMax / face->units_per_EM);\n\tfont->ft_filepath = fz_strdup(ctx, path);\n\n\treturn font;\n}\n\nfz_font *\nfz_new_font_from_memory(fz_context *ctx, const char *name, unsigned char *data, int len, int index, int use_glyph_bbox)\n{\n\tFT_Face face;\n\tfz_font *font;\n\tint fterr;\n\n\tfz_keep_freetype(ctx);\n\n\tfz_lock(ctx, FZ_LOCK_FREETYPE);\n\tfterr = FT_New_Memory_Face(ctx->font->ftlib, data, len, index, &face);\n\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\tif (fterr)\n\t{\n\t\tfz_drop_freetype(ctx);\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"freetype: cannot load font: %s\", ft_error_string(fterr));\n\t}\n\tfz_check_font_dimensions(face);\n\n\tif (!name)\n\t\tname = face->family_name;\n\n\tfont = fz_new_font(ctx, name, use_glyph_bbox, face->num_glyphs);\n\tfont->ft_face = face;\n\tfz_set_font_bbox(ctx, font,\n\t\t(float) face->bbox.xMin / face->units_per_EM,\n\t\t(float) face->bbox.yMin / face->units_per_EM,\n\t\t(float) face->bbox.xMax / face->units_per_EM,\n\t\t(float) face->bbox.yMax / face->units_per_EM);\n\n\treturn font;\n}\n\nfz_font *\nfz_new_font_from_buffer(fz_context *ctx, const char *name, fz_buffer *buffer, int index, int use_glyph_bbox)\n{\n\tfz_font *font = fz_new_font_from_memory(ctx, name, buffer->data, buffer->len, index, use_glyph_bbox);\n\tfont->ft_buffer = fz_keep_buffer(ctx, buffer); /* remember buffer so we can drop it when we free the font */\n\treturn font;\n}\n\nstatic fz_matrix *\nfz_adjust_ft_glyph_width(fz_context *ctx, fz_font *font, int gid, fz_matrix *trm)\n{\n\t/* Fudge the font matrix to stretch the glyph if we've substituted the font. */\n\tif (font->ft_substitute && font->width_table && gid < font->width_count)\n\t{\n\t\tFT_Error fterr;\n\t\tint subw;\n\t\tint realw;\n\t\tfloat scale;\n\n\t\tfz_lock(ctx, FZ_LOCK_FREETYPE);\n\t\t/* TODO: use FT_Get_Advance */\n\t\tfterr = FT_Set_Char_Size(font->ft_face, 1000, 1000, 72, 72);\n\t\tif (fterr)\n\t\t\tfz_warn(ctx, \"freetype setting character size: %s\", ft_error_string(fterr));\n\n\t\tfterr = FT_Load_Glyph(font->ft_face, gid,\n\t\t\tFT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP | FT_LOAD_IGNORE_TRANSFORM);\n\t\tif (fterr)\n\t\t\tfz_warn(ctx, \"freetype failed to load glyph: %s\", ft_error_string(fterr));\n\n\t\trealw = ((FT_Face)font->ft_face)->glyph->metrics.horiAdvance;\n\t\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\t\tsubw = font->width_table[gid];\n\t\tif (realw)\n\t\t\tscale = (float) subw / realw;\n\t\telse\n\t\t\tscale = 1;\n\n\t\tfz_pre_scale(trm, scale, 1);\n\t}\n\n\treturn trm;\n}\n\nstatic fz_glyph *\nglyph_from_ft_bitmap(fz_context *ctx, int left, int top, FT_Bitmap *bitmap)\n{\n\tif (bitmap->pixel_mode == FT_PIXEL_MODE_MONO)\n\t\treturn fz_new_glyph_from_1bpp_data(ctx, left, top - bitmap->rows, bitmap->width, bitmap->rows, bitmap->buffer + (bitmap->rows-1)*bitmap->pitch, -bitmap->pitch);\n\telse\n\t\treturn fz_new_glyph_from_8bpp_data(ctx, left, top - bitmap->rows, bitmap->width, bitmap->rows, bitmap->buffer + (bitmap->rows-1)*bitmap->pitch, -bitmap->pitch);\n}\n\nstatic fz_pixmap *\npixmap_from_ft_bitmap(fz_context *ctx, int left, int top, FT_Bitmap *bitmap)\n{\n\tif (bitmap->pixel_mode == FT_PIXEL_MODE_MONO)\n\t\treturn fz_new_pixmap_from_1bpp_data(ctx, left, top - bitmap->rows, bitmap->width, bitmap->rows, bitmap->buffer + (bitmap->rows-1)*bitmap->pitch, -bitmap->pitch);\n\telse\n\t\treturn fz_new_pixmap_from_8bpp_data(ctx, left, top - bitmap->rows, bitmap->width, bitmap->rows, bitmap->buffer + (bitmap->rows-1)*bitmap->pitch, -bitmap->pitch);\n}\n\n/* Takes the freetype lock, and returns with it held */\nstatic FT_GlyphSlot\ndo_ft_render_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, int aa)\n{\n\tFT_Face face = font->ft_face;\n\tFT_Matrix m;\n\tFT_Vector v;\n\tFT_Error fterr;\n\tfz_matrix local_trm = *trm;\n\n\tfloat strength = fz_matrix_expansion(trm) * 0.02f;\n\n\tfz_adjust_ft_glyph_width(ctx, font, gid, &local_trm);\n\n\tif (font->ft_italic)\n\t\tfz_pre_shear(&local_trm, SHEAR, 0);\n\n\t/*\n\tFreetype mutilates complex glyphs if they are loaded\n\twith FT_Set_Char_Size 1.0. it rounds the coordinates\n\tbefore applying transformation. to get more precision in\n\tfreetype, we shift part of the scale in the matrix\n\tinto FT_Set_Char_Size instead\n\t*/\n\n\tm.xx = local_trm.a * 64; /* should be 65536 */\n\tm.yx = local_trm.b * 64;\n\tm.xy = local_trm.c * 64;\n\tm.yy = local_trm.d * 64;\n\tv.x = local_trm.e * 64;\n\tv.y = local_trm.f * 64;\n\n\tfz_lock(ctx, FZ_LOCK_FREETYPE);\n\tfterr = FT_Set_Char_Size(face, 65536, 65536, 72, 72); /* should be 64, 64 */\n\tif (fterr)\n\t\tfz_warn(ctx, \"freetype setting character size: %s\", ft_error_string(fterr));\n\tFT_Set_Transform(face, &m, &v);\n\n\tif (aa == 0)\n\t{\n\t\t/* enable grid fitting for non-antialiased rendering */\n\t\tfloat scale = fz_matrix_expansion(&local_trm);\n\t\tm.xx = local_trm.a * 65536 / scale;\n\t\tm.yx = local_trm.b * 65536 / scale;\n\t\tm.xy = local_trm.c * 65536 / scale;\n\t\tm.yy = local_trm.d * 65536 / scale;\n\t\tv.x = 0;\n\t\tv.y = 0;\n\n\t\tfterr = FT_Set_Char_Size(face, 64 * scale, 64 * scale, 72, 72);\n\t\tif (fterr)\n\t\t\tfz_warn(ctx, \"freetype setting character size: %s\", ft_error_string(fterr));\n\t\tFT_Set_Transform(face, &m, &v);\n\t\tfterr = FT_Load_Glyph(face, gid, FT_LOAD_NO_BITMAP | FT_LOAD_TARGET_MONO);\n\t\tif (fterr) {\n\t\t\tfz_warn(ctx, \"freetype load hinted glyph (gid %d): %s\", gid, ft_error_string(fterr));\n\t\t\tgoto retry_unhinted;\n\t\t}\n\t}\n\telse if (font->ft_hint)\n\t{\n\t\t/*\n\t\tEnable hinting, but keep the huge char size so that\n\t\tit is hinted for a character. This will in effect nullify\n\t\tthe effect of grid fitting. This form of hinting should\n\t\tonly be used for DynaLab and similar tricky TrueType fonts,\n\t\tso that we get the correct outline shape.\n\t\t*/\n\t\tfterr = FT_Load_Glyph(face, gid, FT_LOAD_NO_BITMAP);\n\t\tif (fterr) {\n\t\t\tfz_warn(ctx, \"freetype load hinted glyph (gid %d): %s\", gid, ft_error_string(fterr));\n\t\t\tgoto retry_unhinted;\n\t\t}\n\t}\n\telse\n\t{\nretry_unhinted:\n\t\tfterr = FT_Load_Glyph(face, gid, FT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING);\n\t\tif (fterr)\n\t\t{\n\t\t\tfz_warn(ctx, \"freetype load glyph (gid %d): %s\", gid, ft_error_string(fterr));\n\t\t\treturn NULL;\n\t\t}\n\t}\n\n\tif (font->ft_bold)\n\t{\n\t\tFT_Outline_Embolden(&face->glyph->outline, strength * 64);\n\t\tFT_Outline_Translate(&face->glyph->outline, -strength * 32, -strength * 32);\n\t}\n\n\tfterr = FT_Render_Glyph(face->glyph, fz_aa_level(ctx) > 0 ? FT_RENDER_MODE_NORMAL : FT_RENDER_MODE_MONO);\n\tif (fterr)\n\t{\n\t\tfz_warn(ctx, \"freetype render glyph (gid %d): %s\", gid, ft_error_string(fterr));\n\t\treturn NULL;\n\t}\n\treturn face->glyph;\n}\n\nfz_pixmap *\nfz_render_ft_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, int aa)\n{\n\tFT_GlyphSlot slot = do_ft_render_glyph(ctx, font, gid, trm, aa);\n\tfz_pixmap *pixmap;\n\n\tif (slot == NULL)\n\t{\n\t\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\t\treturn NULL;\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tpixmap = pixmap_from_ft_bitmap(ctx, slot->bitmap_left, slot->bitmap_top, &slot->bitmap);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn pixmap;\n}\n\n/* The glyph cache lock is always taken when this is called. */\nfz_glyph *\nfz_render_ft_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, int aa)\n{\n\tFT_GlyphSlot slot = do_ft_render_glyph(ctx, font, gid, trm, aa);\n\tfz_glyph *glyph;\n\n\tif (slot == NULL)\n\t{\n\t\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\t\treturn NULL;\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tglyph = glyph_from_ft_bitmap(ctx, slot->bitmap_left, slot->bitmap_top, &slot->bitmap);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn glyph;\n}\n\n/* Takes the freetype lock, and returns with it held */\nstatic FT_Glyph\ndo_render_ft_stroked_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, const fz_matrix *ctm, fz_stroke_state *state)\n{\n\tFT_Face face = font->ft_face;\n\tfloat expansion = fz_matrix_expansion(ctm);\n\tint linewidth = state->linewidth * expansion * 64 / 2;\n\tFT_Matrix m;\n\tFT_Vector v;\n\tFT_Error fterr;\n\tFT_Stroker stroker;\n\tFT_Glyph glyph;\n\tFT_Stroker_LineJoin line_join;\n\tfz_matrix local_trm = *trm;\n\n\tfz_adjust_ft_glyph_width(ctx, font, gid, &local_trm);\n\n\tif (font->ft_italic)\n\t\tfz_pre_shear(&local_trm, SHEAR, 0);\n\n\tm.xx = local_trm.a * 64; /* should be 65536 */\n\tm.yx = local_trm.b * 64;\n\tm.xy = local_trm.c * 64;\n\tm.yy = local_trm.d * 64;\n\tv.x = local_trm.e * 64;\n\tv.y = local_trm.f * 64;\n\n\tfz_lock(ctx, FZ_LOCK_FREETYPE);\n\tfterr = FT_Set_Char_Size(face, 65536, 65536, 72, 72); /* should be 64, 64 */\n\tif (fterr)\n\t{\n\t\tfz_warn(ctx, \"FT_Set_Char_Size: %s\", ft_error_string(fterr));\n\t\treturn NULL;\n\t}\n\n\tFT_Set_Transform(face, &m, &v);\n\n\tfterr = FT_Load_Glyph(face, gid, FT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING);\n\tif (fterr)\n\t{\n\t\tfz_warn(ctx, \"FT_Load_Glyph(gid %d): %s\", gid, ft_error_string(fterr));\n\t\treturn NULL;\n\t}\n\n\tfterr = FT_Stroker_New(ctx->font->ftlib, &stroker);\n\tif (fterr)\n\t{\n\t\tfz_warn(ctx, \"FT_Stroker_New: %s\", ft_error_string(fterr));\n\t\treturn NULL;\n\t}\n\n#if FREETYPE_MAJOR * 10000 + FREETYPE_MINOR * 100 + FREETYPE_PATCH > 20405\n\t/* New freetype */\n\tline_join =\n\t\tstate->linejoin == FZ_LINEJOIN_MITER ? FT_STROKER_LINEJOIN_MITER_FIXED :\n\t\tstate->linejoin == FZ_LINEJOIN_ROUND ? FT_STROKER_LINEJOIN_ROUND :\n\t\tstate->linejoin == FZ_LINEJOIN_BEVEL ? FT_STROKER_LINEJOIN_BEVEL :\n\t\tFT_STROKER_LINEJOIN_MITER_VARIABLE;\n#else\n\t/* Old freetype */\n\tline_join =\n\t\tstate->linejoin == FZ_LINEJOIN_MITER ? FT_STROKER_LINEJOIN_MITER :\n\t\tstate->linejoin == FZ_LINEJOIN_ROUND ? FT_STROKER_LINEJOIN_ROUND :\n\t\tstate->linejoin == FZ_LINEJOIN_BEVEL ? FT_STROKER_LINEJOIN_BEVEL :\n\t\tFT_STROKER_LINEJOIN_MITER;\n#endif\n\tFT_Stroker_Set(stroker, linewidth, (FT_Stroker_LineCap)state->start_cap, line_join, state->miterlimit * 65536);\n\n\tfterr = FT_Get_Glyph(face->glyph, &glyph);\n\tif (fterr)\n\t{\n\t\tfz_warn(ctx, \"FT_Get_Glyph: %s\", ft_error_string(fterr));\n\t\tFT_Stroker_Done(stroker);\n\t\treturn NULL;\n\t}\n\n\tfterr = FT_Glyph_Stroke(&glyph, stroker, 1);\n\tif (fterr)\n\t{\n\t\tfz_warn(ctx, \"FT_Glyph_Stroke: %s\", ft_error_string(fterr));\n\t\tFT_Done_Glyph(glyph);\n\t\tFT_Stroker_Done(stroker);\n\t\treturn NULL;\n\t}\n\n\tFT_Stroker_Done(stroker);\n\n\tfterr = FT_Glyph_To_Bitmap(&glyph, fz_aa_level(ctx) > 0 ? FT_RENDER_MODE_NORMAL : FT_RENDER_MODE_MONO, 0, 1);\n\tif (fterr)\n\t{\n\t\tfz_warn(ctx, \"FT_Glyph_To_Bitmap: %s\", ft_error_string(fterr));\n\t\tFT_Done_Glyph(glyph);\n\t\treturn NULL;\n\t}\n\treturn glyph;\n}\n\nfz_pixmap *\nfz_render_ft_stroked_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, const fz_matrix *ctm, fz_stroke_state *state)\n{\n\tFT_Glyph glyph = do_render_ft_stroked_glyph(ctx, font, gid, trm, ctm, state);\n\tFT_BitmapGlyph bitmap = (FT_BitmapGlyph)glyph;\n\tfz_pixmap *pixmap;\n\n\tif (bitmap == NULL)\n\t{\n\t\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\t\treturn NULL;\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tpixmap = pixmap_from_ft_bitmap(ctx, bitmap->left, bitmap->top, &bitmap->bitmap);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tFT_Done_Glyph(glyph);\n\t\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn pixmap;\n}\n\nfz_glyph *\nfz_render_ft_stroked_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, const fz_matrix *ctm, fz_stroke_state *state)\n{\n\tFT_Glyph glyph = do_render_ft_stroked_glyph(ctx, font, gid, trm, ctm, state);\n\tFT_BitmapGlyph bitmap = (FT_BitmapGlyph)glyph;\n\tfz_glyph *result;\n\n\tif (bitmap == NULL)\n\t{\n\t\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\t\treturn NULL;\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tresult = glyph_from_ft_bitmap(ctx, bitmap->left, bitmap->top, &bitmap->bitmap);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tFT_Done_Glyph(glyph);\n\t\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn result;\n}\n\nstatic fz_rect *\nfz_bound_ft_glyph(fz_context *ctx, fz_font *font, int gid, fz_rect *bounds)\n{\n\tFT_Face face = font->ft_face;\n\tFT_Error fterr;\n\tFT_BBox cbox;\n\tFT_Matrix m;\n\tFT_Vector v;\n\tint ft_flags;\n\n\t// TODO: refactor loading into fz_load_ft_glyph\n\t// TODO: cache results\n\n\tconst int scale = face->units_per_EM;\n\tconst float recip = 1 / (float)scale;\n\tconst float strength = 0.02f;\n\tfz_matrix local_trm = fz_identity;\n\n\tfz_adjust_ft_glyph_width(ctx, font, gid, &local_trm);\n\n\tif (font->ft_italic)\n\t\tfz_pre_shear(&local_trm, SHEAR, 0);\n\n\tm.xx = local_trm.a * 65536;\n\tm.yx = local_trm.b * 65536;\n\tm.xy = local_trm.c * 65536;\n\tm.yy = local_trm.d * 65536;\n\tv.x = local_trm.e * 65536;\n\tv.y = local_trm.f * 65536;\n\n\tif (font->ft_hint)\n\t{\n\t\tft_flags = FT_LOAD_NO_BITMAP;\n\t}\n\telse\n\t{\n\t\tft_flags = FT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING;\n\t}\n\n\tfz_lock(ctx, FZ_LOCK_FREETYPE);\n\t/* Set the char size to scale=face->units_per_EM to effectively give\n\t * us unscaled results. This avoids quantisation. We then apply the\n\t * scale ourselves below. */\n\tfterr = FT_Set_Char_Size(face, scale, scale, 72, 72);\n\tif (fterr)\n\t\tfz_warn(ctx, \"freetype setting character size: %s\", ft_error_string(fterr));\n\tFT_Set_Transform(face, &m, &v);\n\n\tfterr = FT_Load_Glyph(face, gid, ft_flags);\n\tif (fterr)\n\t{\n\t\tfz_warn(ctx, \"freetype load glyph (gid %d): %s\", gid, ft_error_string(fterr));\n\t\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\t\tbounds->x0 = bounds->x1 = local_trm.e;\n\t\tbounds->y0 = bounds->y1 = local_trm.f;\n\t\treturn bounds;\n\t}\n\n\tif (font->ft_bold)\n\t{\n\t\tFT_Outline_Embolden(&face->glyph->outline, strength * scale);\n\t\tFT_Outline_Translate(&face->glyph->outline, -strength * 0.5 * scale, -strength * 0.5 * scale);\n\t}\n\n\tFT_Outline_Get_CBox(&face->glyph->outline, &cbox);\n\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\tbounds->x0 = cbox.xMin * recip;\n\tbounds->y0 = cbox.yMin * recip;\n\tbounds->x1 = cbox.xMax * recip;\n\tbounds->y1 = cbox.yMax * recip;\n\n\tif (fz_is_empty_rect(bounds))\n\t{\n\t\tbounds->x0 = bounds->x1 = local_trm.e;\n\t\tbounds->y0 = bounds->y1 = local_trm.f;\n\t}\n\n\treturn bounds;\n}\n\n/* Turn FT_Outline into a fz_path */\n\nstruct closure {\n\tfz_context *ctx;\n\tfz_path *path;\n\tfz_matrix trm;\n};\n\nstatic int move_to(const FT_Vector *p, void *cc_)\n{\n\tstruct closure *cc = (struct closure *)cc_;\n\tfz_context *ctx = cc->ctx;\n\tfz_path *path = cc->path;\n\tfz_point pt;\n\n\tfz_transform_point_xy(&pt, &cc->trm, p->x, p->y);\n\tfz_moveto(ctx, path, pt.x, pt.y);\n\treturn 0;\n}\n\nstatic int line_to(const FT_Vector *p, void *cc_)\n{\n\tstruct closure *cc = (struct closure *)cc_;\n\tfz_context *ctx = cc->ctx;\n\tfz_path *path = cc->path;\n\tfz_point pt;\n\n\tfz_transform_point_xy(&pt, &cc->trm, p->x, p->y);\n\tfz_lineto(ctx, path, pt.x, pt.y);\n\treturn 0;\n}\n\nstatic int conic_to(const FT_Vector *c, const FT_Vector *p, void *cc_)\n{\n\tstruct closure *cc = (struct closure *)cc_;\n\tfz_context *ctx = cc->ctx;\n\tfz_path *path = cc->path;\n\tfz_point ct, pt;\n\tfz_point s, c1, c2;\n\n\tfz_transform_point_xy(&ct, &cc->trm, c->x, c->y);\n\tfz_transform_point_xy(&pt, &cc->trm, p->x, p->y);\n\n\ts = fz_currentpoint(ctx, path);\n\tc1.x = (s.x + ct.x * 2) / 3;\n\tc1.y = (s.y + ct.y * 2) / 3;\n\tc2.x = (pt.x + ct.x * 2) / 3;\n\tc2.y = (pt.y + ct.y * 2) / 3;\n\n\tfz_curveto(ctx, path, c1.x, c1.y, c2.x, c2.y, pt.x, pt.y);\n\treturn 0;\n}\n\nstatic int cubic_to(const FT_Vector *c1, const FT_Vector *c2, const FT_Vector *p, void *cc_)\n{\n\tstruct closure *cc = (struct closure *)cc_;\n\tfz_context *ctx = cc->ctx;\n\tfz_path *path = cc->path;\n\tfz_point c1t, c2t, pt;\n\n\tfz_transform_point_xy(&c1t, &cc->trm, c1->x, c1->y);\n\tfz_transform_point_xy(&c2t, &cc->trm, c2->x, c2->y);\n\tfz_transform_point_xy(&pt, &cc->trm, p->x, p->y);\n\n\tfz_curveto(ctx, path, c1t.x, c1t.y, c2t.x, c2t.y, pt.x, pt.y);\n\treturn 0;\n}\n\nstatic const FT_Outline_Funcs outline_funcs = {\n\tmove_to, line_to, conic_to, cubic_to, 0, 0\n};\n\nfz_path *\nfz_outline_ft_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm)\n{\n\tstruct closure cc;\n\tFT_Face face = font->ft_face;\n\tint fterr;\n\tfz_matrix local_trm = *trm;\n\tint ft_flags;\n\n\tconst int scale = face->units_per_EM;\n\tconst float recip = 1 / (float)scale;\n\tconst float strength = 0.02f;\n\n\tfz_adjust_ft_glyph_width(ctx, font, gid, &local_trm);\n\n\tif (font->ft_italic)\n\t\tfz_pre_shear(&local_trm, SHEAR, 0);\n\n\tfz_lock(ctx, FZ_LOCK_FREETYPE);\n\n\tif (font->ft_hint)\n\t{\n\t\tft_flags = FT_LOAD_NO_BITMAP | FT_LOAD_IGNORE_TRANSFORM;\n\t\tfterr = FT_Set_Char_Size(face, scale, scale, 72, 72);\n\t\tif (fterr)\n\t\t\tfz_warn(ctx, \"freetype setting character size: %s\", ft_error_string(fterr));\n\t}\n\telse\n\t{\n\t\tft_flags = FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM;\n\t}\n\n\tfterr = FT_Load_Glyph(face, gid, ft_flags);\n\tif (fterr)\n\t{\n\t\tfz_warn(ctx, \"freetype load glyph (gid %d): %s\", gid, ft_error_string(fterr));\n\t\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\t\treturn NULL;\n\t}\n\n\tif (font->ft_bold)\n\t{\n\t\tFT_Outline_Embolden(&face->glyph->outline, strength * scale);\n\t\tFT_Outline_Translate(&face->glyph->outline, -strength * 0.5 * scale, -strength * 0.5 * scale);\n\t}\n\n\tcc.path = NULL;\n\tfz_try(ctx)\n\t{\n\t\tcc.ctx = ctx;\n\t\tcc.path = fz_new_path(ctx);\n\t\tfz_concat(&cc.trm, fz_scale(&cc.trm, recip, recip), &local_trm);\n\t\tfz_moveto(ctx, cc.path, cc.trm.e, cc.trm.f);\n\t\tFT_Outline_Decompose(&face->glyph->outline, &outline_funcs, &cc);\n\t\tfz_closepath(ctx, cc.path);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_warn(ctx, \"freetype cannot decompose outline\");\n\t\tfz_free(ctx, cc.path);\n\t\treturn NULL;\n\t}\n\n\treturn cc.path;\n}\n\n/*\n * Type 3 fonts...\n */\n\nfz_font *\nfz_new_type3_font(fz_context *ctx, const char *name, const fz_matrix *matrix)\n{\n\tfz_font *font;\n\tint i;\n\n\tfont = fz_new_font(ctx, name, 1, 256);\n\tfont->t3procs = fz_malloc_array(ctx, 256, sizeof(fz_buffer*));\n\tfont->t3lists = fz_malloc_array(ctx, 256, sizeof(fz_display_list*));\n\tfont->t3widths = fz_malloc_array(ctx, 256, sizeof(float));\n\tfont->t3flags = fz_malloc_array(ctx, 256, sizeof(char));\n\n\tfont->t3matrix = *matrix;\n\tfor (i = 0; i < 256; i++)\n\t{\n\t\tfont->t3procs[i] = NULL;\n\t\tfont->t3lists[i] = NULL;\n\t\tfont->t3widths[i] = 0;\n\t\tfont->t3flags[i] = 0;\n\t}\n\n\treturn font;\n}\n\nvoid\nfz_prepare_t3_glyph(fz_context *ctx, fz_font *font, int gid, int nested_depth)\n{\n\tfz_buffer *contents;\n\tfz_device *dev;\n\n\tcontents = font->t3procs[gid];\n\tif (!contents)\n\t\treturn;\n\n\t/* We've not already loaded this one! */\n\tassert(font->t3lists[gid] == NULL);\n\n\tfont->t3lists[gid] = fz_new_display_list(ctx);\n\n\tdev = fz_new_list_device(ctx, font->t3lists[gid]);\n\tdev->flags = FZ_DEVFLAG_FILLCOLOR_UNDEFINED |\n\t\t\tFZ_DEVFLAG_STROKECOLOR_UNDEFINED |\n\t\t\tFZ_DEVFLAG_STARTCAP_UNDEFINED |\n\t\t\tFZ_DEVFLAG_DASHCAP_UNDEFINED |\n\t\t\tFZ_DEVFLAG_ENDCAP_UNDEFINED |\n\t\t\tFZ_DEVFLAG_LINEJOIN_UNDEFINED |\n\t\t\tFZ_DEVFLAG_MITERLIMIT_UNDEFINED |\n\t\t\tFZ_DEVFLAG_LINEWIDTH_UNDEFINED;\n\tfont->t3run(font->t3doc, font->t3resources, contents, dev, &fz_identity, NULL, 0);\n\tfont->t3flags[gid] = dev->flags;\n\tfz_free_device(dev);\n}\n\nstatic fz_rect *\nfz_bound_t3_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, fz_rect *bounds)\n{\n\tfz_display_list *list;\n\tfz_matrix ctm;\n\tfz_device *dev;\n\tfz_rect big;\n\n\tlist = font->t3lists[gid];\n\tif (!list)\n\t{\n\t\t*bounds = fz_empty_rect;\n\t\treturn fz_transform_rect(bounds, trm);\n\t}\n\n\tfz_concat(&ctm, &font->t3matrix, trm);\n\tdev = fz_new_bbox_device(ctx, bounds);\n\tfz_try(ctx)\n\t{\n\t\tfz_run_display_list(list, dev, &ctm, &fz_infinite_rect, NULL);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_free_device(dev);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\t/* clip the bbox size to a reasonable maximum for degenerate glyphs */\n\tbig = font->bbox;\n\t/* SumatraPDF: this collides with the bbox resizing fix in fz_set_font_bbox above\n\tfz_expand_rect(&big, fz_max(fz_matrix_expansion(&ctm) * 2, fz_max(big.x1 - big.x0, big.y1 - big.y0)));\n\tfz_intersect_rect(bounds, &big);\n\t*/\n\n\treturn bounds;\n}\n\nvoid\nfz_run_t3_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, fz_device *dev)\n{\n\tfz_display_list *list;\n\tfz_matrix ctm;\n\n\tlist = font->t3lists[gid];\n\tif (!list)\n\t\treturn;\n\n\tfz_concat(&ctm, &font->t3matrix, trm);\n\tfz_run_display_list(list, dev, &ctm, &fz_infinite_rect, NULL);\n}\n\nfz_pixmap *\nfz_render_t3_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, fz_colorspace *model, const fz_irect *scissor)\n{\n\tfz_display_list *list;\n\tfz_rect bounds;\n\tfz_irect bbox;\n\tfz_device *dev;\n\tfz_pixmap *glyph;\n\tfz_pixmap *result;\n\n\tif (gid < 0 || gid > 255)\n\t\treturn NULL;\n\n\tlist = font->t3lists[gid];\n\tif (!list)\n\t\treturn NULL;\n\n\tif (font->t3flags[gid] & FZ_DEVFLAG_MASK)\n\t{\n\t\tif (font->t3flags[gid] & FZ_DEVFLAG_COLOR)\n\t\t\tfz_warn(ctx, \"type3 glyph claims to be both masked and colored\");\n\t\tmodel = NULL;\n\t}\n\telse if (font->t3flags[gid] & FZ_DEVFLAG_COLOR)\n\t{\n\t\tif (!model)\n\t\t\tfz_warn(ctx, \"colored type3 glyph wanted in masked context\");\n\t}\n\telse\n\t{\n\t\tfz_warn(ctx, \"type3 glyph doesn't specify masked or colored\");\n\t\tmodel = NULL; /* Treat as masked */\n\t}\n\n\tfz_expand_rect(fz_bound_glyph(ctx, font, gid, trm, &bounds), 1);\n\tfz_irect_from_rect(&bbox, &bounds);\n\tfz_intersect_irect(&bbox, scissor);\n\n\tglyph = fz_new_pixmap_with_bbox(ctx, model ? model : fz_device_gray(ctx), &bbox);\n\tfz_clear_pixmap(ctx, glyph);\n\n\tdev = fz_new_draw_device_type3(ctx, glyph);\n\tfz_try(ctx)\n\t{\n\t\tfz_run_t3_glyph(ctx, font, gid, trm, dev);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_free_device(dev);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\tif (!model)\n\t{\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tresult = fz_alpha_from_gray(ctx, glyph, 0);\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tfz_drop_pixmap(ctx, glyph);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t}\n\telse\n\t\tresult = glyph;\n\n\treturn result;\n}\n\nfz_glyph *\nfz_render_t3_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, fz_colorspace *model, const fz_irect *scissor)\n{\n\tfz_pixmap *pixmap = fz_render_t3_glyph_pixmap(ctx, font, gid, trm, model, scissor);\n\treturn fz_new_glyph_from_pixmap(ctx, pixmap);\n}\n\nvoid\nfz_render_t3_glyph_direct(fz_context *ctx, fz_device *dev, fz_font *font, int gid, const fz_matrix *trm, void *gstate, int nested_depth)\n{\n\tfz_matrix ctm;\n\tvoid *contents;\n\n\tif (gid < 0 || gid > 255)\n\t\treturn;\n\n\tcontents = font->t3procs[gid];\n\tif (!contents)\n\t\treturn;\n\n\tif (font->t3flags[gid] & FZ_DEVFLAG_MASK)\n\t{\n\t\tif (font->t3flags[gid] & FZ_DEVFLAG_COLOR)\n\t\t\tfz_warn(ctx, \"type3 glyph claims to be both masked and colored\");\n\t}\n\telse if (font->t3flags[gid] & FZ_DEVFLAG_COLOR)\n\t{\n\t}\n\telse\n\t{\n\t\tfz_warn(ctx, \"type3 glyph doesn't specify masked or colored\");\n\t}\n\n\tfz_concat(&ctm, &font->t3matrix, trm);\n\tfont->t3run(font->t3doc, font->t3resources, contents, dev, &ctm, gstate, nested_depth);\n}\n\n#ifndef NDEBUG\nvoid\nfz_print_font(fz_context *ctx, FILE *out, fz_font *font)\n{\n\tfprintf(out, \"font '%s' {\\n\", font->name);\n\n\tif (font->ft_face)\n\t{\n\t\tfprintf(out, \"\\tfreetype face %p\\n\", font->ft_face);\n\t\tif (font->ft_substitute)\n\t\t\tfprintf(out, \"\\tsubstitute font\\n\");\n\t}\n\n\tif (font->t3procs)\n\t{\n\t\tfprintf(out, \"\\ttype3 matrix [%g %g %g %g]\\n\",\n\t\t\tfont->t3matrix.a, font->t3matrix.b,\n\t\t\tfont->t3matrix.c, font->t3matrix.d);\n\n\t\tfprintf(out, \"\\ttype3 bbox [%g %g %g %g]\\n\",\n\t\t\tfont->bbox.x0, font->bbox.y0,\n\t\t\tfont->bbox.x1, font->bbox.y1);\n\t}\n\n\tfprintf(out, \"}\\n\");\n}\n#endif\n\nfz_rect *\nfz_bound_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, fz_rect *rect)\n{\n\tif (font->bbox_table && gid < font->bbox_count)\n\t{\n\t\tif (fz_is_infinite_rect(&font->bbox_table[gid]))\n\t\t{\n\t\t\tif (font->ft_face)\n\t\t\t\tfz_bound_ft_glyph(ctx, font, gid, &font->bbox_table[gid]);\n\t\t\telse if (font->t3lists)\n\t\t\t\tfz_bound_t3_glyph(ctx, font, gid, &fz_identity, &font->bbox_table[gid]);\n\t\t\telse\n\t\t\t\tfont->bbox_table[gid] = fz_empty_rect;\n\t\t}\n\t\t*rect = font->bbox_table[gid];\n\t}\n\telse\n\t{\n\t\t/* fall back to font bbox */\n\t\t*rect = font->bbox;\n\t}\n\n\treturn fz_transform_rect(rect, trm);\n}\n\nfz_path *\nfz_outline_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *ctm)\n{\n\tif (!font->ft_face)\n\t\treturn NULL;\n\treturn fz_outline_ft_glyph(ctx, font, gid, ctm);\n}\n\nint fz_glyph_cacheable(fz_context *ctx, fz_font *font, int gid)\n{\n\tif (!font->t3procs || !font->t3flags || gid < 0 || gid >= font->bbox_count)\n\t\treturn 1;\n\treturn (font->t3flags[gid] & FZ_DEVFLAG_UNCACHEABLE) == 0;\n}\n\nstatic float\nfz_advance_ft_glyph(fz_context *ctx, fz_font *font, int gid)\n{\n\tFT_Fixed adv;\n\tint mask = FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM;\n\n\tif (font->ft_substitute && font->width_table && gid < font->width_count)\n\t\treturn font->width_table[gid];\n\n\tFT_Get_Advance(font->ft_face, gid, mask, &adv);\n\treturn (float) adv / ((FT_Face)font->ft_face)->units_per_EM;\n}\n\nstatic float\nfz_advance_t3_glyph(fz_context *ctx, fz_font *font, int gid)\n{\n\tif (gid < 0 || gid > 255)\n\t\treturn 0;\n\treturn font->t3widths[gid];\n}\n\nfloat\nfz_advance_glyph(fz_context *ctx, fz_font *font, int gid)\n{\n\tif (font->ft_face)\n\t\treturn fz_advance_ft_glyph(ctx, font, gid);\n\tif (font->t3procs)\n\t\treturn fz_advance_t3_glyph(ctx, font, gid);\n\treturn 0;\n}\n\nstatic int\nfz_encode_ft_character(fz_context *ctx, fz_font *font, int ucs)\n{\n\treturn FT_Get_Char_Index(font->ft_face, ucs);\n}\n\nint\nfz_encode_character(fz_context *ctx, fz_font *font, int ucs)\n{\n\tif (font->ft_face)\n\t\treturn fz_encode_ft_character(ctx, font, ucs);\n\treturn ucs;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/ftoa.c",
    "content": "/* The authors of this software are Rob Pike and Ken Thompson.\n * Copyright (c) 2002 by Lucent Technologies.\n * Permission to use, copy, modify, and distribute this software for any\n * purpose without fee is hereby granted, provided that this entire notice\n * is included in all copies of any software which is or includes a copy\n * or modification of this software and in all copies of the supporting\n * documentation for such software.\n * THIS SOFTWARE IS BEING PROVIDED \"AS IS\", WITHOUT ANY EXPRESS OR IMPLIED\n * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE ANY\n * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY\n * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.\n */\n\n#include \"mupdf/fitz.h\"\n\n#include <stdio.h>\n#include <math.h>\n#include <float.h>\n#include <string.h>\n#include <stdlib.h>\n#include <errno.h>\n\n#ifndef INFINITY\n#define INFINITY (DBL_MAX+DBL_MAX)\n#endif\n#ifndef NAN\n#define NAN (INFINITY-INFINITY)\n#endif\n\n#ifndef DEFINED_ULONG\n#define DEFINED_ULONG\ntypedef unsigned long ulong;\n#endif\n\nenum { NSIGNIF\t= 9 };\n\n/*\n * first few powers of 10\n */\nstatic float pows10[] =\n{\n\t1e0f,\t1e1f,\t1e2f,\t1e3f,\t1e4f,\t1e5f,\t1e6f,\t1e7f,\t1e8f,\t1e9f,\n\t1e10f,\t1e11f,\t1e12f,\t1e13f,\t1e14f,\t1e15f,\t1e16f,\t1e17f,\t1e18f,\t1e19f,\n\t1e20f,\t1e21f,\t1e22f,\t1e23f,\t1e24f,\t1e25f,\t1e26f,\t1e27f,\t1e28f,\t1e29f,\n\t1e30f,\t1e31f,\t1e32f,\t1e33f,\t1e34f,\t1e35f,\t1e36f,\t1e37f,\t1e38f\n};\n#define\tnpows10 ((int)(sizeof(pows10)/sizeof(pows10[0])))\n#define\tpow10(x) fmtpow10(x)\n\nstatic float\npow10(int n)\n{\n\tfloat d;\n\tint neg;\n\n\tneg = 0;\n\tif(n < 0){\n\t\tneg = 1;\n\t\tn = -n;\n\t}\n\n\tif(n < npows10)\n\t\td = pows10[n];\n\telse{\n\t\td = pows10[npows10-1];\n\t\tfor(;;){\n\t\t\tn -= npows10 - 1;\n\t\t\tif(n < npows10){\n\t\t\t\td *= pows10[n];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\td *= pows10[npows10 - 1];\n\t\t}\n\t}\n\tif(neg)\n\t\treturn 1./d;\n\treturn d;\n}\n\n/*\n * add 1 to the decimal integer string a of length n.\n * if 99999 overflows into 10000, return 1 to tell caller\n * to move the virtual decimal point.\n */\nstatic int\nxadd1(char *a, int n)\n{\n\tchar *b;\n\tint c;\n\n\tif(n < 0 || n > NSIGNIF)\n\t\treturn 0;\n\tfor(b = a+n-1; b >= a; b--) {\n\t\tc = *b + 1;\n\t\tif(c <= '9') {\n\t\t\t*b = c;\n\t\t\treturn 0;\n\t\t}\n\t\t*b = '0';\n\t}\n\t/*\n\t * need to overflow adding digit.\n\t * shift number down and insert 1 at beginning.\n\t * decimal is known to be 0s or we wouldn't\n\t * have gotten this far. (e.g., 99999+1 => 00000)\n\t */\n\ta[0] = '1';\n\treturn 1;\n}\n\n/*\n * subtract 1 from the decimal integer string a.\n * if 10000 underflows into 09999, make it 99999\n * and return 1 to tell caller to move the virtual\n * decimal point. this way, xsub1 is inverse of xadd1.\n */\nstatic int\nxsub1(char *a, int n)\n{\n\tchar *b;\n\tint c;\n\n\tif(n < 0 || n > NSIGNIF)\n\t\treturn 0;\n\tfor(b = a+n-1; b >= a; b--) {\n\t\tc = *b - 1;\n\t\tif(c >= '0') {\n\t\t\tif(c == '0' && b == a) {\n\t\t\t\t/*\n\t\t\t\t * just zeroed the top digit; shift everyone up.\n\t\t\t\t * decimal is known to be 9s or we wouldn't\n\t\t\t\t * have gotten this far. (e.g., 10000-1 => 09999)\n\t\t\t\t */\n\t\t\t\t*b = '9';\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\t*b = c;\n\t\t\treturn 0;\n\t\t}\n\t\t*b = '9';\n\t}\n\t/*\n\t * can't get here. the number a is always normalized\n\t * so that it has a nonzero first digit.\n\t */\n\treturn 0;\n}\n\n/*\n * format exponent like sprintf(p, \"e%+d\", e)\n */\nstatic void\nfmtexp(char *p, int e)\n{\n\tchar se[9];\n\tint i;\n\n\t*p++ = 'e';\n\tif(e < 0) {\n\t\t*p++ = '-';\n\t\te = -e;\n\t} else\n\t\t*p++ = '+';\n\ti = 0;\n\twhile(e) {\n\t\tse[i++] = e % 10 + '0';\n\t\te /= 10;\n\t}\n\twhile(i < 1)\n\t\tse[i++] = '0';\n\twhile(i > 0)\n\t\t*p++ = se[--i];\n\t*p++ = '\\0';\n}\n\n/*\n * compute decimal integer m, exp such that:\n *\tf = m*10^exp\n *\tm is as short as possible with losing exactness\n * assumes special cases (NaN, +Inf, -Inf) have been handled.\n */\nvoid\nfz_ftoa(float f, char *s, int *exp, int *neg, int *ns)\n{\n\tint c, d, e2, e, ee, i, ndigit, oerrno;\n\tchar tmp[NSIGNIF+10];\n\tfloat g;\n\n\toerrno = errno; /* in case strtod smashes errno */\n\n\t/*\n\t * make f non-negative.\n\t */\n\t*neg = 0;\n\tif(f < 0) {\n\t\tf = -f;\n\t\t*neg = 1;\n\t}\n\n\t/*\n\t * must handle zero specially.\n\t */\n\tif(f == 0){\n\t\t*exp = 0;\n\t\ts[0] = '0';\n\t\ts[1] = '\\0';\n\t\t*ns = 1;\n\t\treturn;\n\t}\n\n\t/*\n\t * find g,e such that f = g*10^e.\n\t * guess 10-exponent using 2-exponent, then fine tune.\n\t */\n\tfrexpf(f, &e2);\n\te = (int)(e2 * .301029995664f);\n\tg = f * pow10(-e);\n\twhile(g < 1) {\n\t\te--;\n\t\tg = f * pow10(-e);\n\t}\n\twhile(g >= 10) {\n\t\te++;\n\t\tg = f * pow10(-e);\n\t}\n\n\t/*\n\t * convert NSIGNIF digits as a first approximation.\n\t */\n\tfor(i=0; i<NSIGNIF; i++) {\n\t\td = (int)g;\n\t\ts[i] = d+'0';\n\t\tg = (g-d) * 10;\n\t}\n\ts[i] = 0;\n\n\t/*\n\t * adjust e because s is 314159... not 3.14159...\n\t */\n\te -= NSIGNIF-1;\n\tfmtexp(s+NSIGNIF, e);\n\n\t/*\n\t * adjust conversion until strtod(s) == f exactly.\n\t */\n\tfor(i=0; i<10; i++) {\n\t\tg = fz_strtod(s, NULL);\n\t\tif(f > g) {\n\t\t\tif(xadd1(s, NSIGNIF)) {\n\t\t\t\t/* gained a digit */\n\t\t\t\te--;\n\t\t\t\tfmtexp(s+NSIGNIF, e);\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\tif(f < g) {\n\t\t\tif(xsub1(s, NSIGNIF)) {\n\t\t\t\t/* lost a digit */\n\t\t\t\te++;\n\t\t\t\tfmtexp(s+NSIGNIF, e);\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\n\t/*\n\t * play with the decimal to try to simplify.\n\t */\n\n\t/*\n\t * bump last few digits up to 9 if we can\n\t */\n\tfor(i=NSIGNIF-1; i>=NSIGNIF-3; i--) {\n\t\tc = s[i];\n\t\tif(c != '9') {\n\t\t\ts[i] = '9';\n\t\t\tg = fz_strtod(s, NULL);\n\t\t\tif(g != f) {\n\t\t\t\ts[i] = c;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/*\n\t * add 1 in hopes of turning 9s to 0s\n\t */\n\tif(s[NSIGNIF-1] == '9') {\n\t\tstrcpy(tmp, s);\n\t\tee = e;\n\t\tif(xadd1(tmp, NSIGNIF)) {\n\t\t\tee--;\n\t\t\tfmtexp(tmp+NSIGNIF, ee);\n\t\t}\n\t\tg = fz_strtod(tmp, NULL);\n\t\tif(g == f) {\n\t\t\tstrcpy(s, tmp);\n\t\t\te = ee;\n\t\t}\n\t}\n\n\t/*\n\t * bump last few digits down to 0 as we can.\n\t */\n\tfor(i=NSIGNIF-1; i>=NSIGNIF-3; i--) {\n\t\tc = s[i];\n\t\tif(c != '0') {\n\t\t\ts[i] = '0';\n\t\t\tg = fz_strtod(s, NULL);\n\t\t\tif(g != f) {\n\t\t\t\ts[i] = c;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/*\n\t * remove trailing zeros.\n\t */\n\tndigit = NSIGNIF;\n\twhile(ndigit > 1 && s[ndigit-1] == '0'){\n\t\te++;\n\t\t--ndigit;\n\t}\n\ts[ndigit] = 0;\n\t*exp = e;\n\t*ns = ndigit;\n\terrno = oerrno;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/function.c",
    "content": "#include \"mupdf/fitz.h\"\n\nvoid\nfz_eval_function(fz_context *ctx, fz_function *func, const float *in, int inlen, float *out, int outlen)\n{\n\tfloat fakein[FZ_FN_MAXM];\n\tfloat fakeout[FZ_FN_MAXN];\n\tint i;\n\n\tif (inlen < func->m)\n\t{\n\t\t/* cf. http://bugs.ghostscript.com/show_bug.cgi?id=696012 */\n\t\tfor (i = 0; i < inlen; ++i)\n\t\t\tfakein[i] = in[i];\n\t\tfor (; i < func->m; ++i)\n\t\t\tfakein[i] = 0;\n\t\tin = fakein;\n\t}\n\n\tif (outlen < func->n)\n\t{\n\t\tfunc->evaluate(ctx, func, in, fakeout);\n\t\t/* cf. http://bugs.ghostscript.com/show_bug.cgi?id=696012 */\n\t\tfor (i = 0; i < outlen; ++i)\n\t\t\tout[i] = fakeout[i];\n\t}\n\telse\n\t{\n\t\tfunc->evaluate(ctx, func, in, out);\n\t\tfor (i = func->n; i < outlen; ++i)\n\t\t\tout[i] = 0;\n\t}\n}\n\nfz_function *\nfz_keep_function(fz_context *ctx, fz_function *func)\n{\n\treturn (fz_function *)fz_keep_storable(ctx, &func->storable);\n}\n\nvoid\nfz_drop_function(fz_context *ctx, fz_function *func)\n{\n\tfz_drop_storable(ctx, &func->storable);\n}\n\nunsigned int\nfz_function_size(fz_function *func)\n{\n\treturn (func ? func->size : 0);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/geometry.c",
    "content": "#include \"mupdf/fitz.h\"\n\n#define MAX4(a,b,c,d) fz_max(fz_max(a,b), fz_max(c,d))\n#define MIN4(a,b,c,d) fz_min(fz_min(a,b), fz_min(c,d))\n\n/*\tA useful macro to add with overflow detection and clamping.\n\n\tWe want to do \"b = a + x\", but to allow for overflow. Consider the\n\ttop bits, and the cases in which overflow occurs:\n\n\toverflow    a   x   b ~a^x  a^b   (~a^x)&(a^b)\n\t   no       0   0   0   1    0          0\n\t   yes      0   0   1   1    1          1\n\t   no       0   1   0   0    0          0\n\t   no       0   1   1   0    1          0\n\t   no       1   0   0   0    1          0\n\t   no       1   0   1   0    0          0\n\t   yes      1   1   0   1    1          1\n\t   no       1   1   1   1    0          0\n*/\n#define ADD_WITH_SAT(b,a,x) \\\n\t((b) = (a) + (x), (b) = (((~(a)^(x))&((a)^(b))) < 0 ? ((x) < 0 ? INT_MIN : INT_MAX) : (b)))\n\n/* Matrices, points and affine transformations */\n\nconst fz_matrix fz_identity = { 1, 0, 0, 1, 0, 0 };\n\nfz_matrix *\nfz_concat(fz_matrix *dst, const fz_matrix *one, const fz_matrix *two)\n{\n\tfz_matrix dst2;\n\tdst2.a = one->a * two->a + one->b * two->c;\n\tdst2.b = one->a * two->b + one->b * two->d;\n\tdst2.c = one->c * two->a + one->d * two->c;\n\tdst2.d = one->c * two->b + one->d * two->d;\n\tdst2.e = one->e * two->a + one->f * two->c + two->e;\n\tdst2.f = one->e * two->b + one->f * two->d + two->f;\n\t*dst = dst2;\n\treturn dst;\n}\n\nfz_matrix *\nfz_scale(fz_matrix *m, float sx, float sy)\n{\n\tm->a = sx; m->b = 0;\n\tm->c = 0; m->d = sy;\n\tm->e = 0; m->f = 0;\n\treturn m;\n}\n\nfz_matrix *\nfz_pre_scale(fz_matrix *mat, float sx, float sy)\n{\n\tmat->a *= sx;\n\tmat->b *= sx;\n\tmat->c *= sy;\n\tmat->d *= sy;\n\treturn mat;\n}\n\nfz_matrix *\nfz_shear(fz_matrix *mat, float h, float v)\n{\n\tmat->a = 1; mat->b = v;\n\tmat->c = h; mat->d = 1;\n\tmat->e = 0; mat->f = 0;\n\treturn mat;\n}\n\nfz_matrix *\nfz_pre_shear(fz_matrix *mat, float h, float v)\n{\n\tfloat a = mat->a;\n\tfloat b = mat->b;\n\tmat->a += v * mat->c;\n\tmat->b += v * mat->d;\n\tmat->c += h * a;\n\tmat->d += h * b;\n\treturn mat;\n}\n\nfz_matrix *\nfz_rotate(fz_matrix *m, float theta)\n{\n\tfloat s;\n\tfloat c;\n\n\twhile (theta < 0)\n\t\ttheta += 360;\n\twhile (theta >= 360)\n\t\ttheta -= 360;\n\n\tif (fabsf(0 - theta) < FLT_EPSILON)\n\t{\n\t\ts = 0;\n\t\tc = 1;\n\t}\n\telse if (fabsf(90.0f - theta) < FLT_EPSILON)\n\t{\n\t\ts = 1;\n\t\tc = 0;\n\t}\n\telse if (fabsf(180.0f - theta) < FLT_EPSILON)\n\t{\n\t\ts = 0;\n\t\tc = -1;\n\t}\n\telse if (fabsf(270.0f - theta) < FLT_EPSILON)\n\t{\n\t\ts = -1;\n\t\tc = 0;\n\t}\n\telse\n\t{\n\t\ts = sinf(theta * (float)M_PI / 180);\n\t\tc = cosf(theta * (float)M_PI / 180);\n\t}\n\n\tm->a = c; m->b = s;\n\tm->c = -s; m->d = c;\n\tm->e = 0; m->f = 0;\n\treturn m;\n}\n\nfz_matrix *\nfz_pre_rotate(fz_matrix *m, float theta)\n{\n\twhile (theta < 0)\n\t\ttheta += 360;\n\twhile (theta >= 360)\n\t\ttheta -= 360;\n\n\tif (fabsf(0 - theta) < FLT_EPSILON)\n\t{\n\t\t/* Nothing to do */\n\t}\n\telse if (fabsf(90.0f - theta) < FLT_EPSILON)\n\t{\n\t\tfloat a = m->a;\n\t\tfloat b = m->b;\n\t\tm->a = m->c;\n\t\tm->b = m->d;\n\t\tm->c = -a;\n\t\tm->d = -b;\n\t}\n\telse if (fabsf(180.0f - theta) < FLT_EPSILON)\n\t{\n\t\tm->a = -m->a;\n\t\tm->b = -m->b;\n\t\tm->c = -m->c;\n\t\tm->d = -m->d;\n\t}\n\telse if (fabsf(270.0f - theta) < FLT_EPSILON)\n\t{\n\t\tfloat a = m->a;\n\t\tfloat b = m->b;\n\t\tm->a = -m->c;\n\t\tm->b = -m->d;\n\t\tm->c = a;\n\t\tm->d = b;\n\t}\n\telse\n\t{\n\t\tfloat s = sinf(theta * (float)M_PI / 180);\n\t\tfloat c = cosf(theta * (float)M_PI / 180);\n\t\tfloat a = m->a;\n\t\tfloat b = m->b;\n\t\tm->a = c * a + s * m->c;\n\t\tm->b = c * b + s * m->d;\n\t\tm->c =-s * a + c * m->c;\n\t\tm->d =-s * b + c * m->d;\n\t}\n\n\treturn m;\n}\n\nfz_matrix *\nfz_translate(fz_matrix *m, float tx, float ty)\n{\n\tm->a = 1; m->b = 0;\n\tm->c = 0; m->d = 1;\n\tm->e = tx; m->f = ty;\n\treturn m;\n}\n\nfz_matrix *\nfz_pre_translate(fz_matrix *mat, float tx, float ty)\n{\n\tmat->e += tx * mat->a + ty * mat->c;\n\tmat->f += tx * mat->b + ty * mat->d;\n\treturn mat;\n}\n\nfz_matrix *\nfz_invert_matrix(fz_matrix *dst, const fz_matrix *src)\n{\n\t/* Be careful to cope with dst == src */\n\tfloat a = src->a;\n\tfloat det = a * src->d - src->b * src->c;\n\tif (det < -FLT_EPSILON || det > FLT_EPSILON)\n\t{\n\t\tfloat rdet = 1 / det;\n\t\tdst->a = src->d * rdet;\n\t\tdst->b = -src->b * rdet;\n\t\tdst->c = -src->c * rdet;\n\t\tdst->d = a * rdet;\n\t\ta = -src->e * dst->a - src->f * dst->c;\n\t\tdst->f = -src->e * dst->b - src->f * dst->d;\n\t\tdst->e = a;\n\t}\n\telse\n\t\t*dst = *src;\n\treturn dst;\n}\n\nint\nfz_try_invert_matrix(fz_matrix *dst, const fz_matrix *src)\n{\n\t/* Be careful to cope with dst == src */\n\tdouble sa = (double)src->a;\n\tdouble sb = (double)src->b;\n\tdouble sc = (double)src->c;\n\tdouble sd = (double)src->d;\n\tdouble da, db, dc, dd;\n\tdouble det = sa * sd - sb * sc;\n\tif (det >= -DBL_EPSILON && det <= DBL_EPSILON)\n\t\treturn 1;\n\tdet = 1 / det;\n\tda = sd * det;\n\tdst->a = (float)da;\n\tdb = -sb * det;\n\tdst->b = (float)db;\n\tdc = -sc * det;\n\tdst->c = (float)dc;\n\tdd = sa * det;\n\tdst->d = (float)dd;\n\tda = -src->e * da - src->f * dc;\n\tdst->f = (float)(-src->e * db - src->f * dd);\n\tdst->e = (float)da;\n\treturn 0;\n}\n\nint\nfz_is_rectilinear(const fz_matrix *m)\n{\n\treturn (fabsf(m->b) < FLT_EPSILON && fabsf(m->c) < FLT_EPSILON) ||\n\t\t(fabsf(m->a) < FLT_EPSILON && fabsf(m->d) < FLT_EPSILON);\n}\n\nfloat\nfz_matrix_expansion(const fz_matrix *m)\n{\n\treturn sqrtf(fabsf(m->a * m->d - m->b * m->c));\n}\n\nfloat\nfz_matrix_max_expansion(const fz_matrix *m)\n{\n\tfloat max = fabsf(m->a);\n\tfloat x = fabsf(m->b);\n\tif (max < x)\n\t\tmax = x;\n\tx = fabsf(m->c);\n\tif (max < x)\n\t\tmax = x;\n\tx = fabsf(m->d);\n\tif (max < x)\n\t\tmax = x;\n\treturn max;\n}\n\nfz_point *\nfz_transform_point(fz_point *restrict p, const fz_matrix *restrict m)\n{\n\tfloat x = p->x;\n\tp->x = x * m->a + p->y * m->c + m->e;\n\tp->y = x * m->b + p->y * m->d + m->f;\n\treturn p;\n}\n\nfz_point *\nfz_transform_point_xy(fz_point *restrict p, const fz_matrix *restrict m, float x, float y)\n{\n\tp->x = x * m->a + y * m->c + m->e;\n\tp->y = x * m->b + y * m->d + m->f;\n\treturn p;\n}\n\nfz_point *\nfz_transform_vector(fz_point *restrict p, const fz_matrix *restrict m)\n{\n\tfloat x = p->x;\n\tp->x = x * m->a + p->y * m->c;\n\tp->y = x * m->b + p->y * m->d;\n\treturn p;\n}\n\nvoid\nfz_normalize_vector(fz_point *p)\n{\n\tfloat len = p->x * p->x + p->y * p->y;\n\tif (len != 0)\n\t{\n\t\tlen = sqrtf(len);\n\t\tp->x /= len;\n\t\tp->y /= len;\n\t}\n}\n\n/* Rectangles and bounding boxes */\n\n/* biggest and smallest integers that a float can represent perfectly (i.e. 24 bits) */\n#define MAX_SAFE_INT 16777216\n#define MIN_SAFE_INT -16777216\n\nconst fz_rect fz_infinite_rect = { 1, 1, -1, -1 };\nconst fz_rect fz_empty_rect = { 0, 0, 0, 0 };\nconst fz_rect fz_unit_rect = { 0, 0, 1, 1 };\n\nconst fz_irect fz_infinite_irect = { 1, 1, -1, -1 };\nconst fz_irect fz_empty_irect = { 0, 0, 0, 0 };\nconst fz_irect fz_unit_bbox = { 0, 0, 1, 1 };\n\nfz_irect *\nfz_irect_from_rect(fz_irect *restrict b, const fz_rect *restrict r)\n{\n\tb->x0 = fz_clamp(floorf(r->x0), MIN_SAFE_INT, MAX_SAFE_INT);\n\tb->y0 = fz_clamp(floorf(r->y0), MIN_SAFE_INT, MAX_SAFE_INT);\n\tb->x1 = fz_clamp(ceilf(r->x1), MIN_SAFE_INT, MAX_SAFE_INT);\n\tb->y1 = fz_clamp(ceilf(r->y1), MIN_SAFE_INT, MAX_SAFE_INT);\n\treturn b;\n}\n\nfz_rect *\nfz_rect_from_irect(fz_rect *restrict r, const fz_irect *restrict a)\n{\n\tr->x0 = a->x0;\n\tr->y0 = a->y0;\n\tr->x1 = a->x1;\n\tr->y1 = a->y1;\n\treturn r;\n}\n\nfz_irect *\nfz_round_rect(fz_irect * restrict b, const fz_rect *restrict r)\n{\n\tint i;\n\n\ti = floorf(r->x0 + 0.001);\n\tb->x0 = fz_clamp(i, MIN_SAFE_INT, MAX_SAFE_INT);\n\ti = floorf(r->y0 + 0.001);\n\tb->y0 = fz_clamp(i, MIN_SAFE_INT, MAX_SAFE_INT);\n\ti = ceilf(r->x1 - 0.001);\n\tb->x1 = fz_clamp(i, MIN_SAFE_INT, MAX_SAFE_INT);\n\ti = ceilf(r->y1 - 0.001);\n\tb->y1 = fz_clamp(i, MIN_SAFE_INT, MAX_SAFE_INT);\n\n\treturn b;\n}\n\nfz_rect *\nfz_intersect_rect(fz_rect *restrict a, const fz_rect *restrict b)\n{\n\t/* Check for empty box before infinite box */\n\tif (fz_is_empty_rect(a)) return a;\n\tif (fz_is_empty_rect(b)) {\n\t\t*a = fz_empty_rect;\n\t\treturn a;\n\t}\n\tif (fz_is_infinite_rect(b)) return a;\n\tif (fz_is_infinite_rect(a)) {\n\t\t*a = *b;\n\t\treturn a;\n\t}\n\tif (a->x0 < b->x0)\n\t\ta->x0 = b->x0;\n\tif (a->y0 < b->y0)\n\t\ta->y0 = b->y0;\n\tif (a->x1 > b->x1)\n\t\ta->x1 = b->x1;\n\tif (a->y1 > b->y1)\n\t\ta->y1 = b->y1;\n\tif (a->x1 < a->x0 || a->y1 < a->y0)\n\t\t*a = fz_empty_rect;\n\treturn a;\n}\n\nfz_irect *\nfz_intersect_irect(fz_irect *restrict a, const fz_irect *restrict b)\n{\n\t/* Check for empty box before infinite box */\n\tif (fz_is_empty_irect(a)) return a;\n\tif (fz_is_empty_irect(b))\n\t{\n\t\t*a = fz_empty_irect;\n\t\treturn a;\n\t}\n\tif (fz_is_infinite_irect(b)) return a;\n\tif (fz_is_infinite_irect(a))\n\t{\n\t\t*a = *b;\n\t\treturn a;\n\t}\n\tif (a->x0 < b->x0)\n\t\ta->x0 = b->x0;\n\tif (a->y0 < b->y0)\n\t\ta->y0 = b->y0;\n\tif (a->x1 > b->x1)\n\t\ta->x1 = b->x1;\n\tif (a->y1 > b->y1)\n\t\ta->y1 = b->y1;\n\tif (a->x1 < a->x0 || a->y1 < a->y0)\n\t\t*a = fz_empty_irect;\n\treturn a;\n}\n\nfz_rect *\nfz_union_rect(fz_rect *restrict a, const fz_rect *restrict b)\n{\n\t/* Check for empty box before infinite box */\n\tif (fz_is_empty_rect(b)) return a;\n\tif (fz_is_empty_rect(a)) {\n\t\t*a = *b;\n\t\treturn a;\n\t}\n\tif (fz_is_infinite_rect(a)) return a;\n\tif (fz_is_infinite_rect(b)) {\n\t\t*a = *b;\n\t\treturn a;\n\t}\n\tif (a->x0 > b->x0)\n\t\ta->x0 = b->x0;\n\tif (a->y0 > b->y0)\n\t\ta->y0 = b->y0;\n\tif (a->x1 < b->x1)\n\t\ta->x1 = b->x1;\n\tif (a->y1 < b->y1)\n\t\ta->y1 = b->y1;\n\treturn a;\n}\n\nfz_irect *\nfz_translate_irect(fz_irect *a, int xoff, int yoff)\n{\n\tint t;\n\n\tif (fz_is_empty_irect(a)) return a;\n\tif (fz_is_infinite_irect(a)) return a;\n\ta->x0 = ADD_WITH_SAT(t, a->x0, xoff);\n\ta->y0 = ADD_WITH_SAT(t, a->y0, yoff);\n\ta->x1 = ADD_WITH_SAT(t, a->x1, xoff);\n\ta->y1 = ADD_WITH_SAT(t, a->y1, yoff);\n\treturn a;\n}\n\nfz_rect *\nfz_transform_rect(fz_rect *restrict r, const fz_matrix *restrict m)\n{\n\tfz_point s, t, u, v;\n\n\tif (fz_is_infinite_rect(r))\n\t\treturn r;\n\n\tif (fabsf(m->b) < FLT_EPSILON && fabsf(m->c) < FLT_EPSILON)\n\t{\n\t\tif (m->a < 0)\n\t\t{\n\t\t\tfloat f = r->x0;\n\t\t\tr->x0 = r->x1;\n\t\t\tr->x1 = f;\n\t\t}\n\t\tif (m->d < 0)\n\t\t{\n\t\t\tfloat f = r->y0;\n\t\t\tr->y0 = r->y1;\n\t\t\tr->y1 = f;\n\t\t}\n\t\tfz_transform_point(fz_rect_min(r), m);\n\t\tfz_transform_point(fz_rect_max(r), m);\n\t\treturn r;\n\t}\n\n\ts.x = r->x0; s.y = r->y0;\n\tt.x = r->x0; t.y = r->y1;\n\tu.x = r->x1; u.y = r->y1;\n\tv.x = r->x1; v.y = r->y0;\n\tfz_transform_point(&s, m);\n\tfz_transform_point(&t, m);\n\tfz_transform_point(&u, m);\n\tfz_transform_point(&v, m);\n\tr->x0 = MIN4(s.x, t.x, u.x, v.x);\n\tr->y0 = MIN4(s.y, t.y, u.y, v.y);\n\tr->x1 = MAX4(s.x, t.x, u.x, v.x);\n\tr->y1 = MAX4(s.y, t.y, u.y, v.y);\n\treturn r;\n}\n\nfz_rect *\nfz_expand_rect(fz_rect *a, float expand)\n{\n\tif (fz_is_empty_rect(a)) return a;\n\tif (fz_is_infinite_rect(a)) return a;\n\ta->x0 -= expand;\n\ta->y0 -= expand;\n\ta->x1 += expand;\n\ta->y1 += expand;\n\treturn a;\n}\n\nfz_rect *fz_include_point_in_rect(fz_rect *r, const fz_point *p)\n{\n\tif (p->x < r->x0) r->x0 = p->x;\n\tif (p->x > r->x1) r->x1 = p->x;\n\tif (p->y < r->y0) r->y0 = p->y;\n\tif (p->y > r->y1) r->y1 = p->y;\n\n\treturn r;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/getopt.c",
    "content": "/*\n * This is a version of the public domain getopt implementation by\n * Henry Spencer originally posted to net.sources.\n *\n * This file is in the public domain.\n */\n\n#include <stdio.h>\n#include <string.h>\n\n#define getopt fz_getopt\n#define optarg fz_optarg\n#define optind fz_optind\n\nchar *optarg; /* Global argument pointer. */\nint optind = 0; /* Global argv index. */\n\nstatic char *scan = NULL; /* Private scan pointer. */\n\nint\ngetopt(int argc, char *argv[], char *optstring)\n{\n\tchar c;\n\tchar *place;\n\n\toptarg = NULL;\n\n\tif (!scan || *scan == '\\0') {\n\t\tif (optind == 0)\n\t\t\toptind++;\n\n\t\tif (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\\0')\n\t\t\treturn EOF;\n\t\tif (argv[optind][1] == '-' && argv[optind][2] == '\\0') {\n\t\t\toptind++;\n\t\t\treturn EOF;\n\t\t}\n\n\t\tscan = argv[optind]+1;\n\t\toptind++;\n\t}\n\n\tc = *scan++;\n\tplace = strchr(optstring, c);\n\n\tif (!place || c == ':') {\n\t\tfprintf(stderr, \"%s: unknown option -%c\\n\", argv[0], c);\n\t\treturn '?';\n\t}\n\n\tplace++;\n\tif (*place == ':') {\n\t\tif (*scan != '\\0') {\n\t\t\toptarg = scan;\n\t\t\tscan = NULL;\n\t\t} else if( optind < argc ) {\n\t\t\toptarg = argv[optind];\n\t\t\toptind++;\n\t\t} else {\n\t\t\tfprintf(stderr, \"%s: option requires argument -%c\\n\", argv[0], c);\n\t\t\treturn ':';\n\t\t}\n\t}\n\n\treturn c;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/glyph.c",
    "content": "#include \"mupdf/fitz.h\"\n\n#define RLE_THRESHOLD 256\n\nfz_glyph *\nfz_keep_glyph(fz_context *ctx, fz_glyph *glyph)\n{\n\treturn (fz_glyph *)fz_keep_storable(ctx, &glyph->storable);\n}\n\nvoid\nfz_drop_glyph(fz_context *ctx, fz_glyph *glyph)\n{\n\tfz_drop_storable(ctx, &glyph->storable);\n}\n\nstatic void\nfz_free_glyph_imp(fz_context *ctx, fz_storable *glyph_)\n{\n\tfz_glyph *glyph = (fz_glyph *)glyph_;\n\n\tif (glyph == NULL)\n\t\treturn;\n\tfz_drop_pixmap(ctx, glyph->pixmap);\n\tfz_free(ctx, glyph);\n}\n\nfz_irect *\nfz_glyph_bbox(fz_context *ctx, fz_glyph *glyph, fz_irect *bbox)\n{\n\tbbox->x0 = glyph->x;\n\tbbox->y0 = glyph->y;\n\tbbox->x1 = glyph->x + glyph->w;\n\tbbox->y1 = glyph->y + glyph->h;\n\treturn bbox;\n}\n\nfz_irect *\nfz_glyph_bbox_no_ctx(fz_glyph *glyph, fz_irect *bbox)\n{\n\tbbox->x0 = glyph->x;\n\tbbox->y0 = glyph->y;\n\tbbox->x1 = glyph->x + glyph->w;\n\tbbox->y1 = glyph->y + glyph->h;\n\treturn bbox;\n}\n\nint\nfz_glyph_width(fz_context *ctx, fz_glyph *glyph)\n{\n\treturn glyph->w;\n}\n\nint\nfz_glyph_height(fz_context *ctx, fz_glyph *glyph)\n{\n\treturn glyph->h;\n}\n\n#ifndef NDEBUG\nvoid\nfz_dump_glyph(fz_glyph *glyph)\n{\n\tint x, y;\n\n\tif (glyph->pixmap)\n\t{\n\t\tprintf(\"pixmap glyph\\n\");\n\t\treturn;\n\t}\n\tprintf(\"glyph: %dx%d @ (%d,%d)\\n\", glyph->w, glyph->h, glyph->x, glyph->y);\n\n\tfor (y = 0; y < glyph->h; y++)\n\t{\n\t\tint offset = ((int *)(glyph->data))[y];\n\t\tif (offset >= 0)\n\t\t{\n\t\t\tint extend = 0;\n\t\t\tint eol = 0;\n\t\t\tx = glyph->w;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tint v = glyph->data[offset++];\n\t\t\t\tint len;\n\t\t\t\tchar c;\n\t\t\t\tswitch(v&3)\n\t\t\t\t{\n\t\t\t\tcase 0: /* extend */\n\t\t\t\t\textend = v>>2;\n\t\t\t\t\tlen = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1: /* Transparent pixels */\n\t\t\t\t\tlen = 1 + (v>>2) + (extend<<6);\n\t\t\t\t\textend = 0;\n\t\t\t\t\tc = '.';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2: /* Solid pixels */\n\t\t\t\t\tlen = 1 + (v>>3) + (extend<<5);\n\t\t\t\t\textend = 0;\n\t\t\t\t\teol = v & 4;\n\t\t\t\t\tc = (eol ? '$' :'#');\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: /* Intermediate pixels */\n\t\t\t\t\tlen = 1 + (v>>3) + (extend<<5);\n\t\t\t\t\textend = 0;\n\t\t\t\t\toffset += len;\n\t\t\t\t\teol = v & 4;\n\t\t\t\t\tc = (eol ? '!' : '?');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tx -= len;\n\t\t\t\twhile (len--)\n\t\t\t\t\tfputc(c, stdout);\n\t\t\t\tif (eol)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\twhile (x > 0);\n\t\t}\n\t\tprintf(\"\\n\");\n\t}\n}\n#endif\n\nfz_glyph *\nfz_new_glyph_from_pixmap(fz_context *ctx, fz_pixmap *pix)\n{\n\tfz_glyph *glyph = NULL;\n\n\tif (pix == NULL)\n\t\treturn NULL;\n\n\tfz_var(glyph);\n\n\tfz_try(ctx)\n\t{\n\t\tif (pix->n != 1 || pix->w * pix->h < RLE_THRESHOLD)\n\t\t{\n\t\t\tglyph = fz_malloc_struct(ctx, fz_glyph);\n\t\t\tFZ_INIT_STORABLE(glyph, 1, fz_free_glyph_imp);\n\t\t\tglyph->x = pix->x;\n\t\t\tglyph->y = pix->y;\n\t\t\tglyph->w = pix->w;\n\t\t\tglyph->h = pix->h;\n\t\t\tglyph->size = fz_pixmap_size(ctx, pix);\n\t\t\tglyph->pixmap = fz_keep_pixmap(ctx, pix);\n\t\t}\n\t\telse\n\t\t\tglyph = fz_new_glyph_from_8bpp_data(ctx, pix->x, pix->y, pix->w, pix->h, pix->samples, pix->w);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_pixmap(ctx, pix);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn glyph;\n}\n\nfz_glyph *\nfz_new_glyph_from_8bpp_data(fz_context *ctx, int x, int y, int w, int h, unsigned char *sp, int span)\n{\n\tfz_glyph *glyph = NULL;\n\tfz_pixmap *pix = NULL;\n\tint size, fill, yy;\n\tunsigned char *orig_sp = sp;\n\n\tfz_var(glyph);\n\tfz_var(pix);\n\n\tfz_try(ctx)\n\t{\n\t\t/* We start out by allocating space as large as the pixmap.\n\t\t * If we need more than that give up on using RLE. We can\n\t\t * never hope to beat the pixmap for really small sizes. */\n\t\tif (w <= 6 || w * h < RLE_THRESHOLD)\n\t\t\tgoto try_pixmap;\n\n\t\tsize = h * w;\n\t\tfill = h * sizeof(int);\n\t\tglyph = fz_malloc(ctx, sizeof(fz_glyph) + size);\n\t\tFZ_INIT_STORABLE(glyph, 1, fz_free_glyph_imp);\n\t\tglyph->x = x;\n\t\tglyph->y = y;\n\t\tglyph->w = w;\n\t\tglyph->h = h;\n\t\tglyph->pixmap = NULL;\n\t\tif (w == 0 || h == 0)\n\t\t{\n\t\t\tglyph->size = 0;\n\t\t\tbreak;\n\t\t}\n\t\tfor (yy=0; yy < h; yy++)\n\t\t{\n\t\t\tint nonblankfill = fill;\n\t\t\tint nonblankfill_end = fill;\n\t\t\tint linefill = fill;\n\t\t\tint ww = w;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tint code;\n\t\t\t\tint len = ww;\n\t\t\t\tint needed;\n\t\t\t\tunsigned char *ep;\n\t\t\t\tswitch (*sp)\n\t\t\t\t{\n\t\t\t\tcase 0:\n\t\t\t\t\tif (len > 0x1000)\n\t\t\t\t\t\tlen = 0x1000;\n\t\t\t\t\tep = sp+len;\n\t\t\t\t\twhile (++sp != ep && *sp == 0);\n\t\t\t\t\tcode = 1;\n\t\t\t\t\tlen -= ep-sp;\n\t\t\t\t\tww -= len;\n\t\t\t\t\tneeded = fill + 1 + (len > 0x40);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 255:\n\t\t\t\t\tif (len > 0x800)\n\t\t\t\t\t\tlen = 0x800;\n\t\t\t\t\tep = sp+len;\n\t\t\t\t\twhile (++sp != ep && *sp == 255);\n\t\t\t\t\tcode = 2;\n\t\t\t\t\tlen -= ep-sp;\n\t\t\t\t\tww -= len;\n\t\t\t\t\tneeded = fill + 1 + (len > 0x20);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t{\n\t\t\t\t\tunsigned char c;\n\t\t\t\t\tif (len > 0x800)\n\t\t\t\t\t\tlen = 0x800;\n\t\t\t\t\tep = sp+len;\n\t\t\t\t\twhile (++sp != ep && (c = *sp) != 255 && c != 0);\n\t\t\t\t\tlen -= ep-sp;\n\t\t\t\t\tww -= len;\n\t\t\t\t\tneeded = fill + 1 + len + (len > 0x20);\n\t\t\t\t\tcode = 3;\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (needed > size)\n\t\t\t\t\tgoto try_pixmap;\n\t\t\t\tif (code == 1)\n\t\t\t\t{\n\t\t\t\t\tif (len > 0x40)\n\t\t\t\t\t\tglyph->data[fill++] = ((len-1)>>6)<<2;\n\t\t\t\t\tglyph->data[fill++] = 1 | (((len-1)&63)<<2);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (len > 0x20)\n\t\t\t\t\t\tglyph->data[fill++] = ((len-1)>>5)<<2;\n\t\t\t\t\tnonblankfill = fill;\n\t\t\t\t\tglyph->data[fill++] = code | (((len-1)&31)<<3);\n\t\t\t\t\tif (code == 3)\n\t\t\t\t\t{\n\t\t\t\t\t\tmemcpy(&glyph->data[fill], sp - len, len);\n\t\t\t\t\t\tfill += len;\n\t\t\t\t\t}\n\t\t\t\t\tnonblankfill_end = fill;\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (ww > 0);\n\t\t\tif (nonblankfill_end == linefill)\n\t\t\t{\n\t\t\t\t((int *)(glyph->data))[yy] = -1;\n\t\t\t\tfill = linefill;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tglyph->data[nonblankfill] |= 4;\n\t\t\t\tfill = nonblankfill_end;\n\t\t\t\t((int *)(glyph->data))[yy] = linefill;\n\t\t\t}\n\t\t\tsp += span - w;\n\t\t}\n\t\tif (fill != size)\n\t\t{\n\t\t\tglyph = fz_resize_array(ctx, glyph, 1, sizeof(fz_glyph) + fill);\n\t\t\tsize = fill;\n\t\t}\n\t\tglyph->size = size;\n\t\tbreak;\n\n\t\t/* Nasty use of a goto here, but it saves us having to exit\n\t\t * and reenter the try context, and this routine is speed\n\t\t * critical. */\ntry_pixmap:\n\t\tglyph = fz_resize_array(ctx, glyph, 1, sizeof(fz_glyph));\n\t\tFZ_INIT_STORABLE(glyph, 1, fz_free_glyph_imp);\n\t\tpix = fz_new_pixmap_from_8bpp_data(ctx, x, y, w, h, orig_sp, span);\n\t\tglyph->x = pix->x;\n\t\tglyph->y = pix->y;\n\t\tglyph->w = pix->w;\n\t\tglyph->h = pix->h;\n\t\tglyph->size = fz_pixmap_size(ctx, pix);\n\t\tglyph->pixmap = pix;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_drop_pixmap(ctx, pix);\n\t\tfz_free(ctx, glyph);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn glyph;\n}\n\nfz_glyph *\nfz_new_glyph_from_1bpp_data(fz_context *ctx, int x, int y, int w, int h, unsigned char *sp, int span)\n{\n\tfz_pixmap *pix = NULL;\n\tfz_glyph *glyph = NULL;\n\tint size, fill, yy;\n\tunsigned char *orig_sp = sp;\n\n\tfz_var(glyph);\n\tfz_var(pix);\n\n\tfz_try(ctx)\n\t{\n\t\t/* We start out by allocating space as large as the pixmap.\n\t\t * If we need more than that give up on using RLE. We can\n\t\t * never hope to beat the pixmap for really small sizes. */\n\t\tif (w <= 6 || w * h < RLE_THRESHOLD)\n\t\t\tgoto try_pixmap;\n\n\t\tsize = h * w;\n\t\tfill = h * sizeof(int);\n\t\tglyph = fz_malloc(ctx, sizeof(fz_glyph) + size);\n\t\tFZ_INIT_STORABLE(glyph, 1, fz_free_glyph_imp);\n\t\tglyph->x = x;\n\t\tglyph->y = y;\n\t\tglyph->w = w;\n\t\tglyph->h = h;\n\t\tglyph->pixmap = NULL;\n\t\tif (w == 0 || h == 0)\n\t\t{\n\t\t\tglyph->size = 0;\n\t\t\tbreak;\n\t\t}\n\t\tfor (yy=0; yy < h; yy++)\n\t\t{\n\t\t\tint nonblankfill = fill;\n\t\t\tint nonblankfill_end = fill;\n\t\t\tint linefill = fill;\n\t\t\tint ww = w;\n\t\t\tint bit = 0x80;\n\t\t\tdo\n\t\t\t{\n\t\t\t\tint len = 0;\n\t\t\t\tint needed;\n\t\t\t\tint b = *sp & bit;\n\t\t\t\tbit >>= 1;\n\t\t\t\tif (bit == 0)\n\t\t\t\t\tbit = 0x80, sp++;\n\t\t\t\tww--;\n\t\t\t\tif (b == 0)\n\t\t\t\t{\n\t\t\t\t\twhile (ww > 0 && len < 0xfff && (*sp & bit) == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tbit >>= 1;\n\t\t\t\t\t\tif (bit == 0)\n\t\t\t\t\t\t\tbit = 0x80, sp++;\n\t\t\t\t\t\tlen++;\n\t\t\t\t\t\tww--;\n\t\t\t\t\t}\n\t\t\t\t\tneeded = fill + (len >= 0x40) + 1;\n\t\t\t\t\tif (needed > size)\n\t\t\t\t\t\tgoto try_pixmap;\n\t\t\t\t\tif (len >= 0x40)\n\t\t\t\t\t\tglyph->data[fill++] = (len>>6)<<2;\n\t\t\t\t\tglyph->data[fill++] = 1 | ((len&63)<<2);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\twhile (ww > 0 && len < 0x7ff && (*sp & bit) != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tbit >>= 1;\n\t\t\t\t\t\tif (bit == 0)\n\t\t\t\t\t\t\tbit = 0x80, sp++;\n\t\t\t\t\t\tlen++;\n\t\t\t\t\t\tww--;\n\t\t\t\t\t}\n\t\t\t\t\tneeded = fill + (len >= 0x20) + 1;\n\t\t\t\t\tif (needed > size)\n\t\t\t\t\t\tgoto try_pixmap;\n\t\t\t\t\tif (len >= 0x20)\n\t\t\t\t\t\tglyph->data[fill++] = (len>>5)<<2;\n\t\t\t\t\tnonblankfill = fill;\n\t\t\t\t\tglyph->data[fill++] = 2 | ((len&31)<<3);\n\t\t\t\t\tnonblankfill_end = fill;\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (ww > 0);\n\t\t\tif (nonblankfill_end == linefill)\n\t\t\t{\n\t\t\t\t((int *)(glyph->data))[yy] = -1;\n\t\t\t\tfill = linefill;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tglyph->data[nonblankfill] |= 4;\n\t\t\t\tfill = nonblankfill_end;\n\t\t\t\t((int *)(glyph->data))[yy] = linefill;\n\t\t\t}\n\t\t\tsp += span - (w>>3);\n\t\t}\n\t\tif (fill != size)\n\t\t{\n\t\t\tglyph = fz_resize_array(ctx, glyph, 1, sizeof(fz_glyph) + fill);\n\t\t\tsize = fill;\n\t\t}\n\t\tglyph->size = size;\n\t\tbreak;\n\n\t\t/* Nasty use of a goto here, but it saves us having to exit\n\t\t * and reenter the try context, and this routine is speed\n\t\t * critical. */\ntry_pixmap:\n\t\tglyph = fz_resize_array(ctx, glyph, 1, sizeof(fz_glyph));\n\t\tFZ_INIT_STORABLE(glyph, 1, fz_free_glyph_imp);\n\t\tpix = fz_new_pixmap_from_1bpp_data(ctx, x, y, w, h, orig_sp, span);\n\t\tglyph->x = pix->x;\n\t\tglyph->y = pix->y;\n\t\tglyph->w = pix->w;\n\t\tglyph->h = pix->h;\n\t\tglyph->size = fz_pixmap_size(ctx, pix);\n\t\tglyph->pixmap = pix;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_drop_pixmap(ctx, pix);\n\t\tfz_free(ctx, glyph);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn glyph;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/halftone.c",
    "content": "#include \"mupdf/fitz.h\"\n\nfz_halftone *\nfz_new_halftone(fz_context *ctx, int comps)\n{\n\tfz_halftone *ht;\n\tint i;\n\n\tht = fz_malloc(ctx, sizeof(fz_halftone) + (comps-1)*sizeof(fz_pixmap *));\n\tht->refs = 1;\n\tht->n = comps;\n\tfor (i = 0; i < comps; i++)\n\t\tht->comp[i] = NULL;\n\n\treturn ht;\n}\n\nfz_halftone *\nfz_keep_halftone(fz_context *ctx, fz_halftone *ht)\n{\n\tif (ht)\n\t\tht->refs++;\n\treturn ht;\n}\n\nvoid\nfz_drop_halftone(fz_context *ctx, fz_halftone *ht)\n{\n\tint i;\n\n\tif (!ht || --ht->refs != 0)\n\t\treturn;\n\tfor (i = 0; i < ht->n; i++)\n\t\tfz_drop_pixmap(ctx, ht->comp[i]);\n\tfz_free(ctx, ht);\n}\n\n/* Default mono halftone, lifted from Ghostscript. */\n/* The 0x00 entry has been changed to 0x01 to avoid problems with white\n * pixels appearing in the output; as we use < 0 should not appear in the\n * array. I think that gs scales this slighly and hence never actually uses\n * the raw values here. */\nstatic unsigned char mono_ht[] =\n{\n\t0x0E, 0x8E, 0x2E, 0xAE, 0x06, 0x86, 0x26, 0xA6, 0x0C, 0x8C, 0x2C, 0xAC, 0x04, 0x84, 0x24, 0xA4,\n\t0xCE, 0x4E, 0xEE, 0x6E, 0xC6, 0x46, 0xE6, 0x66, 0xCC, 0x4C, 0xEC, 0x6C, 0xC4, 0x44, 0xE4, 0x64,\n\t0x3E, 0xBE, 0x1E, 0x9E, 0x36, 0xB6, 0x16, 0x96, 0x3C, 0xBC, 0x1C, 0x9C, 0x34, 0xB4, 0x14, 0x94,\n\t0xFE, 0x7E, 0xDE, 0x5E, 0xF6, 0x76, 0xD6, 0x56, 0xFC, 0x7C, 0xDC, 0x5C, 0xF4, 0x74, 0xD4, 0x54,\n\t0x01, 0x81, 0x21, 0xA1, 0x09, 0x89, 0x29, 0xA9, 0x03, 0x83, 0x23, 0xA3, 0x0B, 0x8B, 0x2B, 0xAB,\n\t0xC1, 0x41, 0xE1, 0x61, 0xC9, 0x49, 0xE9, 0x69, 0xC3, 0x43, 0xE3, 0x63, 0xCB, 0x4B, 0xEB, 0x6B,\n\t0x31, 0xB1, 0x11, 0x91, 0x39, 0xB9, 0x19, 0x99, 0x33, 0xB3, 0x13, 0x93, 0x3B, 0xBB, 0x1B, 0x9B,\n\t0xF1, 0x71, 0xD1, 0x51, 0xF9, 0x79, 0xD9, 0x59, 0xF3, 0x73, 0xD3, 0x53, 0xFB, 0x7B, 0xDB, 0x5B,\n\t0x0D, 0x8D, 0x2D, 0xAD, 0x05, 0x85, 0x25, 0xA5, 0x0F, 0x8F, 0x2F, 0xAF, 0x07, 0x87, 0x27, 0xA7,\n\t0xCD, 0x4D, 0xED, 0x6D, 0xC5, 0x45, 0xE5, 0x65, 0xCF, 0x4F, 0xEF, 0x6F, 0xC7, 0x47, 0xE7, 0x67,\n\t0x3D, 0xBD, 0x1D, 0x9D, 0x35, 0xB5, 0x15, 0x95, 0x3F, 0xBF, 0x1F, 0x9F, 0x37, 0xB7, 0x17, 0x97,\n\t0xFD, 0x7D, 0xDD, 0x5D, 0xF5, 0x75, 0xD5, 0x55, 0xFF, 0x7F, 0xDF, 0x5F, 0xF7, 0x77, 0xD7, 0x57,\n\t0x02, 0x82, 0x22, 0xA2, 0x0A, 0x8A, 0x2A, 0xAA, 0x01 /*0x00*/, 0x80, 0x20, 0xA0, 0x08, 0x88, 0x28, 0xA8,\n\t0xC2, 0x42, 0xE2, 0x62, 0xCA, 0x4A, 0xEA, 0x6A, 0xC0, 0x40, 0xE0, 0x60, 0xC8, 0x48, 0xE8, 0x68,\n\t0x32, 0xB2, 0x12, 0x92, 0x3A, 0xBA, 0x1A, 0x9A, 0x30, 0xB0, 0x10, 0x90, 0x38, 0xB8, 0x18, 0x98,\n\t0xF2, 0x72, 0xD2, 0x52, 0xFA, 0x7A, 0xDA, 0x5A, 0xF0, 0x70, 0xD0, 0x50, 0xF8, 0x78, 0xD8, 0x58\n};\n\nfz_halftone *fz_default_halftone(fz_context *ctx, int num_comps)\n{\n\tfz_halftone *ht = fz_new_halftone(ctx, num_comps);\n\tassert(num_comps == 1); /* Only support 1 component for now */\n\tht->comp[0] = fz_new_pixmap_with_data(ctx, NULL, 16, 16, mono_ht);\n\treturn ht;\n}\n\n/* Finally, code to actually perform halftoning. */\nstatic void make_ht_line(unsigned char *buf, fz_halftone *ht, int x, int y, int w)\n{\n\t/* FIXME: There is a potential optimisation here; in the case where\n\t * the LCM of the halftone tile widths is smaller than w, we could\n\t * form just one 'LCM' run, then copy it repeatedly.\n\t */\n\tint k, n;\n\tn = ht->n;\n\tfor (k = 0; k < n; k++)\n\t{\n\t\tfz_pixmap *tile = ht->comp[k];\n\t\tunsigned char *b = buf++;\n\t\tunsigned char *t;\n\t\tunsigned char *tbase;\n\t\tint px = x + tile->x;\n\t\tint py = y + tile->y;\n\t\tint tw = tile->w;\n\t\tint th = tile->h;\n\t\tint w2 = w;\n\t\tint len;\n\t\tpx = px % tw;\n\t\tif (px < 0)\n\t\t\tpx += tw;\n\t\tpy = py % th;\n\t\tif (py < 0)\n\t\t\tpy += th;\n\n\t\tassert(tile->n == 1);\n\n\t\t/* Left hand section; from x to tile width */\n\t\ttbase = tile->samples + (unsigned int)(py * tw);\n\t\tt = tbase + px;\n\t\tlen = tw - px;\n\t\tif (len > w2)\n\t\t\tlen = w2;\n\t\tw2 -= len;\n\t\twhile (len--)\n\t\t{\n\t\t\t*b = *t++;\n\t\t\tb += n;\n\t\t}\n\n\t\t/* Centre section - complete copies */\n\t\tw2 -= tw;\n\t\twhile (w2 >= 0)\n\t\t{\n\t\t\tlen = tw;\n\t\t\tt = tbase;\n\t\t\twhile (len--)\n\t\t\t{\n\t\t\t\t*b = *t++;\n\t\t\t\tb += n;\n\t\t\t}\n\t\t\tw2 -= tw;\n\t\t}\n\t\tw2 += tw;\n\n\t\t/* Right hand section - stragglers */\n\t\tt = tbase;\n\t\twhile (w2--)\n\t\t{\n\t\t\t*b = *t++;\n\t\t\tb += n;\n\t\t}\n\t}\n}\n\n/* Inner mono thresholding code */\nstatic void do_threshold_1(unsigned char *ht_line, unsigned char *pixmap, unsigned char *out, int w)\n{\n\tint bit = 0x80;\n\tint h = 0;\n\n\tdo\n\t{\n\t\tif (*pixmap < *ht_line++)\n\t\t\th |= bit;\n\t\tpixmap += 2; /* Skip the alpha */\n\t\tbit >>= 1;\n\t\tif (bit == 0)\n\t\t{\n\t\t\t*out++ = h;\n\t\t\th = 0;\n\t\t\tbit = 0x80;\n\t\t}\n\n\t}\n\twhile (--w);\n\tif (bit != 0x80)\n\t\t*out = h;\n}\n\nfz_bitmap *fz_halftone_pixmap(fz_context *ctx, fz_pixmap *pix, fz_halftone *ht)\n{\n\tfz_bitmap *out;\n\tunsigned char *ht_line, *o, *p;\n\tint w, h, x, y, n, pstride, ostride;\n\tfz_halftone *ht_orig = ht;\n\n\tif (!pix)\n\t\treturn NULL;\n\n\tassert(pix->n == 2); /* Mono + Alpha */\n\n\tn = pix->n-1; /* Remove alpha */\n\tif (ht == NULL)\n\t{\n\t\tht = fz_default_halftone(ctx, n);\n\t}\n\tht_line = fz_malloc(ctx, pix->w * n);\n\tout = fz_new_bitmap(ctx, pix->w, pix->h, n, pix->xres, pix->yres);\n\to = out->samples;\n\tp = pix->samples;\n\n\th = pix->h;\n\tx = pix->x;\n\ty = pix->y;\n\tw = pix->w;\n\tostride = out->stride;\n\tpstride = pix->w * pix->n;\n\twhile (h--)\n\t{\n\t\tmake_ht_line(ht_line, ht, x, y++, w);\n\t\tdo_threshold_1(ht_line, p, o, w);\n\t\to += ostride;\n\t\tp += pstride;\n\t}\n\tif (!ht_orig)\n\t\tfz_drop_halftone(ctx, ht);\n\treturn out;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/hash.c",
    "content": "#include \"mupdf/fitz.h\"\n\n/*\nSimple hashtable with open addressing linear probe.\nUnlike text book examples, removing entries works\ncorrectly in this implementation, so it wont start\nexhibiting bad behaviour if entries are inserted\nand removed frequently.\n*/\n\nenum { MAX_KEY_LEN = 48 };\ntypedef struct fz_hash_entry_s fz_hash_entry;\n\nstruct fz_hash_entry_s\n{\n\tunsigned char key[MAX_KEY_LEN];\n\tvoid *val;\n};\n\nstruct fz_hash_table_s\n{\n\tint keylen;\n\tint size;\n\tint load;\n\tint lock; /* -1 or the lock used to protect this hash table */\n\tfz_hash_entry *ents;\n};\n\nstatic unsigned hash(const unsigned char *s, int len)\n{\n\tunsigned val = 0;\n\tint i;\n\tfor (i = 0; i < len; i++)\n\t{\n\t\tval += s[i];\n\t\tval += (val << 10);\n\t\tval ^= (val >> 6);\n\t}\n\tval += (val << 3);\n\tval ^= (val >> 11);\n\tval += (val << 15);\n\treturn val;\n}\n\nfz_hash_table *\nfz_new_hash_table(fz_context *ctx, int initialsize, int keylen, int lock)\n{\n\tfz_hash_table *table;\n\n\tassert(keylen <= MAX_KEY_LEN);\n\n\ttable = fz_malloc_struct(ctx, fz_hash_table);\n\ttable->keylen = keylen;\n\ttable->size = initialsize;\n\ttable->load = 0;\n\ttable->lock = lock;\n\tfz_try(ctx)\n\t{\n\t\ttable->ents = fz_malloc_array(ctx, table->size, sizeof(fz_hash_entry));\n\t\tmemset(table->ents, 0, sizeof(fz_hash_entry) * table->size);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, table);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn table;\n}\n\nvoid\nfz_empty_hash(fz_context *ctx, fz_hash_table *table)\n{\n\ttable->load = 0;\n\tmemset(table->ents, 0, sizeof(fz_hash_entry) * table->size);\n}\n\nint\nfz_hash_len(fz_context *ctx, fz_hash_table *table)\n{\n\treturn table->size;\n}\n\nvoid *\nfz_hash_get_key(fz_context *ctx, fz_hash_table *table, int idx)\n{\n\treturn table->ents[idx].key;\n}\n\nvoid *\nfz_hash_get_val(fz_context *ctx, fz_hash_table *table, int idx)\n{\n\treturn table->ents[idx].val;\n}\n\nvoid\nfz_free_hash(fz_context *ctx, fz_hash_table *table)\n{\n\tfz_free(ctx, table->ents);\n\tfz_free(ctx, table);\n}\n\nstatic void *\ndo_hash_insert(fz_context *ctx, fz_hash_table *table, const void *key, void *val, unsigned *pos_ptr)\n{\n\tfz_hash_entry *ents;\n\tunsigned size;\n\tunsigned pos;\n\n\tents = table->ents;\n\tsize = table->size;\n\tpos = hash(key, table->keylen) % size;\n\n\tif (table->lock >= 0)\n\t\tfz_assert_lock_held(ctx, table->lock);\n\n\twhile (1)\n\t{\n\t\tif (!ents[pos].val)\n\t\t{\n\t\t\tmemcpy(ents[pos].key, key, table->keylen);\n\t\t\tents[pos].val = val;\n\t\t\ttable->load ++;\n\t\t\tif (pos_ptr)\n\t\t\t\t*pos_ptr = pos;\n\t\t\treturn NULL;\n\t\t}\n\n\t\tif (memcmp(key, ents[pos].key, table->keylen) == 0)\n\t\t{\n\t\t\t/* This is legal, but should happen rarely in the non\n\t\t\t * pos_ptr case. */\n\t\t\tif (pos_ptr)\n\t\t\t\t*pos_ptr = pos;\n\t\t\telse\n\t\t\t\tfz_warn(ctx, \"assert: overwrite hash slot\");\n\t\t\treturn ents[pos].val;\n\t\t}\n\n\t\tpos = (pos + 1) % size;\n\t}\n}\n\n/* Entered with the lock taken, held throughout and at exit, UNLESS the lock\n * is the alloc lock in which case it may be momentarily dropped. */\nstatic void\nfz_resize_hash(fz_context *ctx, fz_hash_table *table, int newsize)\n{\n\tfz_hash_entry *oldents = table->ents;\n\tfz_hash_entry *newents;\n\tint oldsize = table->size;\n\tint oldload = table->load;\n\tint i;\n\n\tif (newsize < oldload * 8 / 10)\n\t{\n\t\tfz_warn(ctx, \"assert: resize hash too small\");\n\t\treturn;\n\t}\n\n\tif (table->lock == FZ_LOCK_ALLOC)\n\t\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\tnewents = fz_malloc_array_no_throw(ctx, newsize, sizeof(fz_hash_entry));\n\tif (table->lock == FZ_LOCK_ALLOC)\n\t\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tif (table->lock >= 0)\n\t{\n\t\tif (table->size >= newsize)\n\t\t{\n\t\t\t/* Someone else fixed it before we could lock! */\n\t\t\tif (table->lock == FZ_LOCK_ALLOC)\n\t\t\t\tfz_unlock(ctx, table->lock);\n\t\t\tfz_free(ctx, newents);\n\t\t\tif (table->lock == FZ_LOCK_ALLOC)\n\t\t\t\tfz_lock(ctx, table->lock);\n\t\t\treturn;\n\t\t}\n\t}\n\tif (newents == NULL)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"hash table resize failed; out of memory (%d entries)\", newsize);\n\ttable->ents = newents;\n\tmemset(table->ents, 0, sizeof(fz_hash_entry) * newsize);\n\ttable->size = newsize;\n\ttable->load = 0;\n\n\tfor (i = 0; i < oldsize; i++)\n\t{\n\t\tif (oldents[i].val)\n\t\t{\n\t\t\tdo_hash_insert(ctx, table, oldents[i].key, oldents[i].val, NULL);\n\t\t}\n\t}\n\n\tif (table->lock == FZ_LOCK_ALLOC)\n\t\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\tfz_free(ctx, oldents);\n\tif (table->lock == FZ_LOCK_ALLOC)\n\t\tfz_lock(ctx, FZ_LOCK_ALLOC);\n}\n\nvoid *\nfz_hash_find(fz_context *ctx, fz_hash_table *table, const void *key)\n{\n\tfz_hash_entry *ents = table->ents;\n\tunsigned size = table->size;\n\tunsigned pos = hash(key, table->keylen) % size;\n\n\tif (table->lock >= 0)\n\t\tfz_assert_lock_held(ctx, table->lock);\n\n\twhile (1)\n\t{\n\t\tif (!ents[pos].val)\n\t\t\treturn NULL;\n\n\t\tif (memcmp(key, ents[pos].key, table->keylen) == 0)\n\t\t\treturn ents[pos].val;\n\n\t\tpos = (pos + 1) % size;\n\t}\n}\n\nvoid *\nfz_hash_insert(fz_context *ctx, fz_hash_table *table, const void *key, void *val)\n{\n\tif (table->load > table->size * 8 / 10)\n\t{\n\t\tfz_resize_hash(ctx, table, table->size * 2);\n\t}\n\n\treturn do_hash_insert(ctx, table, key, val, NULL);\n}\n\nvoid *\nfz_hash_insert_with_pos(fz_context *ctx, fz_hash_table *table, const void *key, void *val, unsigned *pos)\n{\n\tif (table->load > table->size * 8 / 10)\n\t{\n\t\tfz_resize_hash(ctx, table, table->size * 2);\n\t}\n\n\treturn do_hash_insert(ctx, table, key, val, pos);\n}\n\nstatic void\ndo_removal(fz_context *ctx, fz_hash_table *table, const void *key, unsigned hole)\n{\n\tfz_hash_entry *ents = table->ents;\n\tunsigned size = table->size;\n\tunsigned look, code;\n\n\tif (table->lock >= 0)\n\t\tfz_assert_lock_held(ctx, table->lock);\n\n\tents[hole].val = NULL;\n\n\tlook = hole + 1;\n\tif (look == size)\n\t\tlook = 0;\n\n\twhile (ents[look].val)\n\t{\n\t\tcode = hash(ents[look].key, table->keylen) % size;\n\t\tif ((code <= hole && hole < look) ||\n\t\t\t(look < code && code <= hole) ||\n\t\t\t(hole < look && look < code))\n\t\t{\n\t\t\tents[hole] = ents[look];\n\t\t\tents[look].val = NULL;\n\t\t\thole = look;\n\t\t}\n\n\t\tlook++;\n\t\tif (look == size)\n\t\t\tlook = 0;\n\t}\n\n\ttable->load --;\n}\n\nvoid\nfz_hash_remove(fz_context *ctx, fz_hash_table *table, const void *key)\n{\n\tfz_hash_entry *ents = table->ents;\n\tunsigned size = table->size;\n\tunsigned pos = hash(key, table->keylen) % size;\n\n\tif (table->lock >= 0)\n\t\tfz_assert_lock_held(ctx, table->lock);\n\n\twhile (1)\n\t{\n\t\tif (!ents[pos].val)\n\t\t{\n\t\t\tfz_warn(ctx, \"assert: remove non-existent hash entry\");\n\t\t\treturn;\n\t\t}\n\n\t\tif (memcmp(key, ents[pos].key, table->keylen) == 0)\n\t\t{\n\t\t\tdo_removal(ctx, table, key, pos);\n\t\t\treturn;\n\t\t}\n\n\t\tpos++;\n\t\tif (pos == size)\n\t\t\tpos = 0;\n\t}\n}\n\nvoid\nfz_hash_remove_fast(fz_context *ctx, fz_hash_table *table, const void *key, unsigned pos)\n{\n\tfz_hash_entry *ents = table->ents;\n\n\tif (ents[pos].val == NULL || memcmp(key, ents[pos].key, table->keylen) != 0)\n\t{\n\t\t/* The value isn't there, or the key didn't match! The table\n\t\t * must have been rebuilt (or the contents moved) in the\n\t\t * meantime. Do the removal the slow way. */\n\t\tfz_hash_remove(ctx, table, key);\n\t}\n\telse\n\t\tdo_removal(ctx, table, key, pos);\n}\n\n#ifndef NDEBUG\nvoid\nfz_print_hash(fz_context *ctx, FILE *out, fz_hash_table *table)\n{\n\tfz_print_hash_details(ctx, out, table, NULL);\n}\n\nvoid\nfz_print_hash_details(fz_context *ctx, FILE *out, fz_hash_table *table, void (*details)(FILE *,void*))\n{\n\tint i, k;\n\n\tfprintf(out, \"cache load %d / %d\\n\", table->load, table->size);\n\n\tfor (i = 0; i < table->size; i++)\n\t{\n\t\tif (!table->ents[i].val)\n\t\t\tfprintf(out, \"table % 4d: empty\\n\", i);\n\t\telse\n\t\t{\n\t\t\tfprintf(out, \"table % 4d: key=\", i);\n\t\t\tfor (k = 0; k < MAX_KEY_LEN; k++)\n\t\t\t\tfprintf(out, \"%02x\", ((char*)table->ents[i].key)[k]);\n\t\t\tif (details)\n\t\t\t\tdetails(out, table->ents[i].val);\n\t\t\telse\n\t\t\t\tfprintf(out, \" val=$%p\\n\", table->ents[i].val);\n\t\t}\n\t}\n}\n#endif\n"
  },
  {
    "path": "mupdf/source/fitz/image.c",
    "content": "#include \"mupdf/fitz.h\"\n\nfz_pixmap *\nfz_new_pixmap_from_image(fz_context *ctx, fz_image *image, int w, int h)\n{\n\t/* SumatraPDF: try preventing a strange NULL-pointer dereference due to image->get_pixmap failing without throwing */\n\tfz_pixmap *pix;\n\tassert(image);\n\tif (image == NULL)\n\t\treturn NULL;\n\tpix = image->get_pixmap(ctx, image, w, h);\n\tif (!pix)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"image->get_pixmap failed - why? (%d x %d)\", w, h);\n\treturn pix;\n}\n\nfz_image *\nfz_keep_image(fz_context *ctx, fz_image *image)\n{\n\treturn (fz_image *)fz_keep_storable(ctx, &image->storable);\n}\n\nvoid\nfz_drop_image(fz_context *ctx, fz_image *image)\n{\n\tfz_drop_storable(ctx, &image->storable);\n}\n\ntypedef struct fz_image_key_s fz_image_key;\n\nstruct fz_image_key_s {\n\tint refs;\n\tfz_image *image;\n\tint l2factor;\n};\n\nstatic int\nfz_make_hash_image_key(fz_store_hash *hash, void *key_)\n{\n\tfz_image_key *key = (fz_image_key *)key_;\n\n\thash->u.pi.ptr = key->image;\n\thash->u.pi.i = key->l2factor;\n\treturn 1;\n}\n\nstatic void *\nfz_keep_image_key(fz_context *ctx, void *key_)\n{\n\tfz_image_key *key = (fz_image_key *)key_;\n\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tkey->refs++;\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\n\treturn (void *)key;\n}\n\nstatic void\nfz_drop_image_key(fz_context *ctx, void *key_)\n{\n\tfz_image_key *key = (fz_image_key *)key_;\n\tint drop;\n\n\tif (key == NULL)\n\t\treturn;\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tdrop = --key->refs;\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\tif (drop == 0)\n\t{\n\t\tfz_drop_image(ctx, key->image);\n\t\tfz_free(ctx, key);\n\t}\n}\n\nstatic int\nfz_cmp_image_key(void *k0_, void *k1_)\n{\n\tfz_image_key *k0 = (fz_image_key *)k0_;\n\tfz_image_key *k1 = (fz_image_key *)k1_;\n\n\treturn k0->image == k1->image && k0->l2factor == k1->l2factor;\n}\n\n#ifndef NDEBUG\nstatic void\nfz_debug_image(FILE *out, void *key_)\n{\n\tfz_image_key *key = (fz_image_key *)key_;\n\n\tfprintf(out, \"(image %d x %d sf=%d) \", key->image->w, key->image->h, key->l2factor);\n}\n#endif\n\nstatic fz_store_type fz_image_store_type =\n{\n\tfz_make_hash_image_key,\n\tfz_keep_image_key,\n\tfz_drop_image_key,\n\tfz_cmp_image_key,\n#ifndef NDEBUG\n\tfz_debug_image\n#endif\n};\n\nstatic void\nfz_mask_color_key(fz_pixmap *pix, int n, int *colorkey)\n{\n\tunsigned char *p = pix->samples;\n\tint len = pix->w * pix->h;\n\tint k, t;\n\twhile (len--)\n\t{\n\t\tt = 1;\n\t\tfor (k = 0; k < n; k++)\n\t\t\tif (p[k] < colorkey[k * 2] || p[k] > colorkey[k * 2 + 1])\n\t\t\t\tt = 0;\n\t\tif (t)\n\t\t\tfor (k = 0; k < pix->n; k++)\n\t\t\t\tp[k] = 0;\n\t\tp += pix->n;\n\t}\n}\n\nstatic void\nfz_unblend_masked_tile(fz_context *ctx, fz_pixmap *tile, fz_image *image)\n{\n\t/* SumatraPDF: fz_image_get_pixmap tends to return overly large tiles */\n\tint min_w = 1 << (int)floorf(logf(tile->w) / logf(2));\n\tint min_h = 1 << (int)floorf(logf(tile->h) / logf(2));\n\tfz_pixmap *mask = image->mask->get_pixmap(ctx, image->mask, min_w, min_h);\n\tunsigned char *s = mask->samples, *end = s + mask->w * mask->h;\n\tunsigned char *d = tile->samples;\n\tint k;\n\n\tif (tile->w != mask->w || tile->h != mask->h)\n\t{\n\t\tfz_warn(ctx, \"mask must be of same size as image for /Matte\");\n\t\tfz_drop_pixmap(ctx, mask);\n\t\treturn;\n\t}\n\n\tfor (; s < end; s++, d += tile->n)\n\t{\n\t\tif (*s == 0)\n\t\t\tfor (k = 0; k < image->n; k++)\n\t\t\t\td[k] = image->colorkey[k];\n\t\telse\n\t\t\tfor (k = 0; k < image->n; k++)\n\t\t\t\td[k] = fz_clampi(image->colorkey[k] + (d[k] - image->colorkey[k]) * 255 / *s, 0, 255);\n\t}\n\n\tfz_drop_pixmap(ctx, mask);\n}\n\n/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=1333 */\nstatic fz_pixmap *\ndecomp_image_banded(fz_context *ctx, fz_stream *stm, fz_image *image, int indexed, int l2factor, int native_l2factor)\n{\n\tfz_pixmap *tile = NULL, *part = NULL;\n\tint w = (image->w + (1 << l2factor) - 1) >> l2factor;\n\tint h = (image->h + (1 << l2factor) - 1) >> l2factor;\n\tint part_h, orig_h = image->h;\n\tint band = 1 << fz_maxi(8, l2factor);\n\n\tfz_var(tile);\n\tfz_var(part);\n\n\tfz_try(ctx)\n\t{\n\t\tfz_colorspace *cs = image->colorspace;\n\t\tif (indexed)\n\t\t\tcs = *(fz_colorspace **)cs->data; // cf. struct indexed in res_colorspace.c\n\t\ttile = fz_new_pixmap(ctx, cs, w, h);\n\t\ttile->interpolate = image->interpolate;\n\t\t/* decompress the image in bands of 256 lines */\n\t\tfor (part_h = h; part_h > 0; part_h -= band >> l2factor)\n\t\t{\n\t\t\timage->h = part_h > band >> l2factor ? band : ((orig_h - 1) % band) + 1;\n\t\t\tpart = fz_decomp_image_from_stream(ctx, fz_keep_stream(stm), image, -1 - indexed, l2factor, native_l2factor);\n\t\t\tmemcpy(tile->samples + (h - part_h) * tile->w * tile->n, part->samples, part->h * part->w * part->n);\n\t\t\tfz_drop_pixmap(ctx, part);\n\t\t\tpart = NULL;\n\t\t}\n\t\t/* pre-blended matte color */\n\t\tif (image->usecolorkey && image->mask)\n\t\t\tfz_unblend_masked_tile(ctx, tile, image);\n\t}\n\tfz_always(ctx)\n\t{\n\t\timage->h = orig_h;\n\t\tfz_close(stm);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_drop_pixmap(ctx, part);\n\t\tfz_drop_pixmap(ctx, tile);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn tile;\n}\n\n\nfz_pixmap *\nfz_decomp_image_from_stream(fz_context *ctx, fz_stream *stm, fz_image *image, int indexed, int l2factor, int native_l2factor)\n{\n\tfz_pixmap *tile = NULL;\n\tint stride, len, i;\n\tunsigned char *samples = NULL;\n\tint f = 1<<native_l2factor;\n\tint w = (image->w + f-1) >> native_l2factor;\n\tint h = (image->h + f-1) >> native_l2factor;\n\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=1333 */\n\tint is_banded = indexed < 0;\n\n\tfz_var(tile);\n\tfz_var(samples);\n\n\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=1333 */\n\tif (is_banded)\n\t\tindexed = -1 - indexed;\n\telse if (l2factor - native_l2factor > 0 && image->w > (1 << 8))\n\t\treturn decomp_image_banded(ctx, stm, image, indexed, l2factor, native_l2factor);\n\n\tfz_try(ctx)\n\t{\n\t\ttile = fz_new_pixmap(ctx, image->colorspace, w, h);\n\t\ttile->interpolate = image->interpolate;\n\n\t\tstride = (w * image->n * image->bpc + 7) / 8;\n\n\t\tsamples = fz_malloc_array(ctx, h, stride);\n\n\t\tlen = fz_read(stm, samples, h * stride);\n\n\t\t/* Pad truncated images */\n\t\tif (len < stride * h)\n\t\t{\n\t\t\tfz_warn(ctx, \"padding truncated image\");\n\t\t\tmemset(samples + len, 0, stride * h - len);\n\t\t}\n\n\t\t/* Invert 1-bit image masks */\n\t\tif (image->imagemask)\n\t\t{\n\t\t\t/* 0=opaque and 1=transparent so we need to invert */\n\t\t\tunsigned char *p = samples;\n\t\t\tlen = h * stride;\n\t\t\tfor (i = 0; i < len; i++)\n\t\t\t\tp[i] = ~p[i];\n\t\t}\n\n\t\tfz_unpack_tile(tile, samples, image->n, image->bpc, stride, indexed);\n\n\t\tfz_free(ctx, samples);\n\t\tsamples = NULL;\n\n\t\t/* color keyed transparency */\n\t\tif (image->usecolorkey && !image->mask)\n\t\t\tfz_mask_color_key(tile, image->n, image->colorkey);\n\n\t\tif (indexed)\n\t\t{\n\t\t\tfz_pixmap *conv;\n\t\t\tfz_decode_indexed_tile(tile, image->decode, (1 << image->bpc) - 1);\n\t\t\tconv = fz_expand_indexed_pixmap(ctx, tile);\n\t\t\tfz_drop_pixmap(ctx, tile);\n\t\t\ttile = conv;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_decode_tile(tile, image->decode);\n\t\t}\n\n\t\t/* pre-blended matte color */\n\t\tif (image->usecolorkey && image->mask && !is_banded)\n\t\t\tfz_unblend_masked_tile(ctx, tile, image);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(stm);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tif (tile)\n\t\t\tfz_drop_pixmap(ctx, tile);\n\t\tfz_free(ctx, samples);\n\n\t\tfz_rethrow(ctx);\n\t}\n\n\t/* Now apply any extra subsampling required */\n\tif (l2factor - native_l2factor > 0)\n\t{\n\t\tif (l2factor - native_l2factor > 8)\n\t\t\tl2factor = native_l2factor + 8;\n\t\tfz_subsample_pixmap(ctx, tile, l2factor - native_l2factor);\n\t}\n\n\treturn tile;\n}\n\nvoid\nfz_free_image(fz_context *ctx, fz_storable *image_)\n{\n\tfz_image *image = (fz_image *)image_;\n\n\tif (image == NULL)\n\t\treturn;\n\tfz_drop_pixmap(ctx, image->tile);\n\tfz_free_compressed_buffer(ctx, image->buffer);\n\tfz_drop_colorspace(ctx, image->colorspace);\n\tfz_drop_image(ctx, image->mask);\n\tfz_free(ctx, image);\n}\n\nfz_pixmap *\nfz_image_get_pixmap(fz_context *ctx, fz_image *image, int w, int h)\n{\n\tfz_pixmap *tile;\n\tfz_stream *stm;\n\tint l2factor;\n\tfz_image_key key;\n\tint native_l2factor;\n\tint indexed;\n\tfz_image_key *keyp;\n\n\t/* Check for 'simple' images which are just pixmaps */\n\tif (image->buffer == NULL)\n\t{\n\t\ttile = image->tile;\n\t\tif (!tile)\n\t\t\treturn NULL;\n\t\treturn fz_keep_pixmap(ctx, tile); /* That's all we can give you! */\n\t}\n\n\t/* Ensure our expectations for tile size are reasonable */\n\tif (w < 0 || w > image->w)\n\t\tw = image->w;\n\tif (h < 0 || h > image->h)\n\t\th = image->h;\n\n\t/* What is our ideal factor? We search for the largest factor where\n\t * we can subdivide and stay larger than the required size. We add\n\t * a fudge factor of +2 here to allow for the possibility of\n\t * expansion due to grid fitting. */\n\tif (w == 0 || h == 0)\n\t\tl2factor = 0;\n\telse\n\t\tfor (l2factor=0; image->w>>(l2factor+1) >= w+2 && image->h>>(l2factor+1) >= h+2 && l2factor < 8; l2factor++);\n\n\t/* Can we find any suitable tiles in the cache? */\n\tkey.refs = 1;\n\tkey.image = image;\n\tkey.l2factor = l2factor;\n\tdo\n\t{\n\t\ttile = fz_find_item(ctx, fz_free_pixmap_imp, &key, &fz_image_store_type);\n\t\tif (tile)\n\t\t\treturn tile;\n\t\tkey.l2factor--;\n\t}\n\twhile (key.l2factor >= 0);\n\n\t/* We need to make a new one. */\n\t/* First check for ones that we can't decode using streams */\n\tswitch (image->buffer->params.type)\n\t{\n\tcase FZ_IMAGE_PNG:\n\t\ttile = fz_load_png(ctx, image->buffer->buffer->data, image->buffer->buffer->len);\n\t\tbreak;\n\tcase FZ_IMAGE_TIFF:\n\t\ttile = fz_load_tiff(ctx, image->buffer->buffer->data, image->buffer->buffer->len);\n\t\tbreak;\n\tcase FZ_IMAGE_JXR:\n\t\ttile = fz_load_jxr(ctx, image->buffer->buffer->data, image->buffer->buffer->len);\n\t\tbreak;\n\tcase FZ_IMAGE_JPEG:\n\t\t/* Scan JPEG stream and patch missing height values in header */\n\t\t{\n\t\t\tunsigned char *s = image->buffer->buffer->data;\n\t\t\tunsigned char *e = s + image->buffer->buffer->len;\n\t\t\tunsigned char *d;\n\t\t\tfor (d = s + 2; s < d && d < e - 9 && d[0] == 0xFF; d += (d[2] << 8 | d[3]) + 2)\n\t\t\t{\n\t\t\t\tif (d[1] < 0xC0 || (0xC3 < d[1] && d[1] < 0xC9) || 0xCB < d[1])\n\t\t\t\t\tcontinue;\n\t\t\t\tif ((d[5] == 0 && d[6] == 0) || ((d[5] << 8) | d[6]) > image->h)\n\t\t\t\t{\n\t\t\t\t\td[5] = (image->h >> 8) & 0xFF;\n\t\t\t\t\td[6] = image->h & 0xFF;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/* fall through */\n\n\tdefault:\n\t\tnative_l2factor = l2factor;\n\t\tstm = fz_open_image_decomp_stream_from_buffer(ctx, image->buffer, &native_l2factor);\n\n\t\tindexed = fz_colorspace_is_indexed(image->colorspace);\n\t\ttile = fz_decomp_image_from_stream(ctx, stm, image, indexed, l2factor, native_l2factor);\n\n\t\t/* CMYK JPEGs in XPS documents have to be inverted */\n\t\tif (image->invert_cmyk_jpeg &&\n\t\t\timage->buffer->params.type == FZ_IMAGE_JPEG &&\n\t\t\timage->colorspace == fz_device_cmyk(ctx) &&\n\t\t\timage->buffer->params.u.jpeg.color_transform)\n\t\t{\n\t\t\tfz_invert_pixmap(ctx, tile);\n\t\t}\n\n\t\tbreak;\n\t}\n\n\t/* Now we try to cache the pixmap. Any failure here will just result\n\t * in us not caching. */\n\tfz_var(keyp);\n\tfz_try(ctx)\n\t{\n\t\tfz_pixmap *existing_tile;\n\n\t\tkeyp = fz_malloc_struct(ctx, fz_image_key);\n\t\tkeyp->refs = 1;\n\t\tkeyp->image = fz_keep_image(ctx, image);\n\t\tkeyp->l2factor = l2factor;\n\t\texisting_tile = fz_store_item(ctx, keyp, tile, fz_pixmap_size(ctx, tile), &fz_image_store_type);\n\t\tif (existing_tile)\n\t\t{\n\t\t\t/* We already have a tile. This must have been produced by a\n\t\t\t * racing thread. We'll throw away ours and use that one. */\n\t\t\tfz_drop_pixmap(ctx, tile);\n\t\t\ttile = existing_tile;\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_image_key(ctx, keyp);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\t/* Do nothing */\n\t}\n\n\treturn tile;\n}\n\nfz_image *\nfz_new_image_from_pixmap(fz_context *ctx, fz_pixmap *pixmap, fz_image *mask)\n{\n\tfz_image *image;\n\n\tassert(mask == NULL || mask->mask == NULL);\n\n\tfz_try(ctx)\n\t{\n\t\timage = fz_malloc_struct(ctx, fz_image);\n\t\tFZ_INIT_STORABLE(image, 1, fz_free_image);\n\t\timage->w = pixmap->w;\n\t\timage->h = pixmap->h;\n\t\timage->n = pixmap->n;\n\t\timage->colorspace = fz_keep_colorspace(ctx, pixmap->colorspace);\n\t\timage->bpc = 8;\n\t\timage->buffer = NULL;\n\t\timage->get_pixmap = fz_image_get_pixmap;\n\t\timage->xres = pixmap->xres;\n\t\timage->yres = pixmap->yres;\n\t\timage->tile = pixmap;\n\t\timage->mask = mask;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_drop_pixmap(ctx, pixmap);\n\t\tfz_drop_image(ctx, mask);\n\t\tfz_rethrow(ctx);\n\t}\n\treturn image;\n}\n\nfz_image *\nfz_new_image(fz_context *ctx, int w, int h, int bpc, fz_colorspace *colorspace,\n\tint xres, int yres, int interpolate, int imagemask, float *decode,\n\tint *colorkey, fz_compressed_buffer *buffer, fz_image *mask)\n{\n\tfz_image *image;\n\n\tassert(mask == NULL || mask->mask == NULL);\n\n\tfz_try(ctx)\n\t{\n\t\timage = fz_malloc_struct(ctx, fz_image);\n\t\tFZ_INIT_STORABLE(image, 1, fz_free_image);\n\t\timage->get_pixmap = fz_image_get_pixmap;\n\t\timage->w = w;\n\t\timage->h = h;\n\t\timage->xres = xres;\n\t\timage->yres = yres;\n\t\timage->bpc = bpc;\n\t\timage->n = (colorspace ? colorspace->n : 1);\n\t\timage->colorspace = colorspace;\n\t\timage->interpolate = interpolate;\n\t\timage->imagemask = imagemask;\n\t\timage->usecolorkey = (colorkey != NULL);\n\t\tif (colorkey)\n\t\t\tmemcpy(image->colorkey, colorkey, sizeof(int)*image->n*2);\n\t\tif (decode)\n\t\t\tmemcpy(image->decode, decode, sizeof(float)*image->n*2);\n\t\telse\n\t\t{\n\t\t\tfloat maxval = fz_colorspace_is_indexed(colorspace) ? (1 << bpc) - 1 : 1;\n\t\t\tint i;\n\t\t\tfor (i = 0; i < image->n; i++)\n\t\t\t{\n\t\t\t\timage->decode[2*i] = 0;\n\t\t\t\timage->decode[2*i+1] = maxval;\n\t\t\t}\n\t\t}\n\t\timage->mask = mask;\n\t\timage->buffer = buffer;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free_compressed_buffer(ctx, buffer);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn image;\n}\n\nfz_image *\nfz_new_image_from_data(fz_context *ctx, unsigned char *data, int len)\n{\n\tfz_buffer *buffer = NULL;\n\tfz_image *image;\n\n\tfz_var(buffer);\n\tfz_var(data);\n\n\tfz_try(ctx)\n\t{\n\t\tbuffer = fz_new_buffer_from_data(ctx, data, len);\n\t\tdata = NULL;\n\t\timage = fz_new_image_from_buffer(ctx, buffer);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, buffer);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, data);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn image;\n}\n\nfz_image *\nfz_new_image_from_buffer(fz_context *ctx, fz_buffer *buffer)\n{\n\tfz_compressed_buffer *bc = NULL;\n\tint w, h, xres, yres;\n\tfz_colorspace *cspace;\n\tint len = buffer->len;\n\tunsigned char *buf = buffer->data;\n\n\tfz_var(bc);\n\n\tfz_try(ctx)\n\t{\n\t\tif (len < 8)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"unknown image file format\");\n\n\t\tbc = fz_malloc_struct(ctx, fz_compressed_buffer);\n\t\tbc->buffer = fz_keep_buffer(ctx, buffer);\n\n\t\tif (buf[0] == 0xff && buf[1] == 0xd8)\n\t\t{\n\t\t\tbc->params.type = FZ_IMAGE_JPEG;\n\t\t\tbc->params.u.jpeg.color_transform = -1;\n\t\t\tfz_load_jpeg_info(ctx, buf, len, &w, &h, &xres, &yres, &cspace);\n\t\t}\n\t\telse if (memcmp(buf, \"\\211PNG\\r\\n\\032\\n\", 8) == 0)\n\t\t{\n\t\t\tbc->params.type = FZ_IMAGE_PNG;\n\t\t\tfz_load_png_info(ctx, buf, len, &w, &h, &xres, &yres, &cspace);\n\t\t}\n\t\telse if (memcmp(buf, \"II\", 2) == 0 && buf[2] == 0xBC)\n\t\t{\n\t\t\tbc->params.type = FZ_IMAGE_JXR;\n\t\t\tfz_load_jxr_info(ctx, buf, len, &w, &h, &xres, &yres, &cspace);\n\t\t}\n\t\telse if (memcmp(buf, \"MM\", 2) == 0 || memcmp(buf, \"II\", 2) == 0)\n\t\t{\n\t\t\tbc->params.type = FZ_IMAGE_TIFF;\n\t\t\tfz_load_tiff_info(ctx, buf, len, &w, &h, &xres, &yres, &cspace);\n\t\t}\n\t\telse\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"unknown image file format\");\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free_compressed_buffer(ctx, bc);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn fz_new_image(ctx, w, h, 8, cspace, xres, yres, 0, 0, NULL, NULL, bc, NULL);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/link.c",
    "content": "#include \"mupdf/fitz.h\"\n\nvoid\nfz_free_link_dest(fz_context *ctx, fz_link_dest *dest)\n{\n\tswitch (dest->kind)\n\t{\n\tcase FZ_LINK_NONE:\n\t\tbreak;\n\tcase FZ_LINK_GOTO:\n\t\t/* SumatraPDF: extended link support for MuXPS */\n\t\tfz_free(ctx, dest->ld.gotor.dest);\n\t\tbreak;\n\tcase FZ_LINK_URI:\n\t\tfz_free(ctx, dest->ld.uri.uri);\n\t\tbreak;\n\tcase FZ_LINK_LAUNCH:\n\t\tfz_free(ctx, dest->ld.launch.file_spec);\n\t\tbreak;\n\tcase FZ_LINK_NAMED:\n\t\tfz_free(ctx, dest->ld.named.named);\n\t\tbreak;\n\tcase FZ_LINK_GOTOR:\n\t\tfz_free(ctx, dest->ld.gotor.file_spec);\n\t\t/* SumatraPDF: expose dest as UTF-8 string */\n\t\tfz_free(ctx, dest->ld.gotor.dest);\n\t\tbreak;\n\t}\n}\n\nfz_link *\nfz_new_link(fz_context *ctx, const fz_rect *bbox, fz_link_dest dest)\n{\n\tfz_link *link;\n\n\tfz_try(ctx)\n\t{\n\t\tlink = fz_malloc_struct(ctx, fz_link);\n\t\tlink->refs = 1;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free_link_dest(ctx, &dest);\n\t\tfz_rethrow(ctx);\n\t}\n\tlink->dest = dest;\n\tlink->rect = *bbox;\n\tlink->next = NULL;\n\treturn link;\n}\n\nfz_link *\nfz_keep_link(fz_context *ctx, fz_link *link)\n{\n\tif (link)\n\t\tlink->refs++;\n\treturn link;\n}\n\nvoid\nfz_drop_link(fz_context *ctx, fz_link *link)\n{\n\twhile (link && --link->refs == 0)\n\t{\n\t\tfz_link *next = link->next;\n\t\tfz_free_link_dest(ctx, &link->dest);\n\t\tfz_free(ctx, link);\n\t\tlink = next;\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/fitz/list-device.c",
    "content": "#include \"mupdf/fitz.h\"\n\ntypedef struct fz_display_node_s fz_display_node;\n\n#define STACK_SIZE 96\n\ntypedef enum fz_display_command_e\n{\n\tFZ_CMD_BEGIN_PAGE,\n\tFZ_CMD_END_PAGE,\n\tFZ_CMD_FILL_PATH,\n\tFZ_CMD_STROKE_PATH,\n\tFZ_CMD_CLIP_PATH,\n\tFZ_CMD_CLIP_STROKE_PATH,\n\tFZ_CMD_FILL_TEXT,\n\tFZ_CMD_STROKE_TEXT,\n\tFZ_CMD_CLIP_TEXT,\n\tFZ_CMD_CLIP_STROKE_TEXT,\n\tFZ_CMD_IGNORE_TEXT,\n\tFZ_CMD_FILL_SHADE,\n\tFZ_CMD_FILL_IMAGE,\n\tFZ_CMD_FILL_IMAGE_MASK,\n\tFZ_CMD_CLIP_IMAGE_MASK,\n\tFZ_CMD_POP_CLIP,\n\tFZ_CMD_BEGIN_MASK,\n\tFZ_CMD_END_MASK,\n\tFZ_CMD_BEGIN_GROUP,\n\tFZ_CMD_END_GROUP,\n\tFZ_CMD_BEGIN_TILE,\n\tFZ_CMD_END_TILE\n\t, FZ_CMD_APPLY_TRANSFER_FUNCTION, /* SumatraPDF: support transfer functions */\n} fz_display_command;\n\nstruct fz_display_node_s\n{\n\tfz_display_command cmd;\n\tfz_display_node *next;\n\tfz_rect rect;\n\tunion {\n\t\tfz_path *path;\n\t\tfz_text *text;\n\t\tfz_shade *shade;\n\t\tfz_image *image;\n\t\tint blendmode;\n\t\tfz_transfer_function *tr; /* SumatraPDF: support transfer functions */\n\t} item;\n\tfz_stroke_state *stroke;\n\tint flag; /* even_odd, accumulate, isolated/knockout... */\n\tfz_matrix ctm;\n\tfz_colorspace *colorspace;\n\tfloat alpha;\n\tfloat color[FZ_MAX_COLORS];\n};\n\nstruct fz_display_list_s\n{\n\tfz_storable storable;\n\tfz_display_node *first;\n\tfz_display_node *last;\n\tint len;\n\n\tint top;\n\tstruct {\n\t\tfz_rect *update;\n\t\tfz_rect rect;\n\t} stack[STACK_SIZE];\n\tint tiled;\n};\n\nenum { ISOLATED = 1, KNOCKOUT = 2 };\n\nstatic fz_display_node *\nfz_new_display_node(fz_context *ctx, fz_display_command cmd, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tfz_display_node *node;\n\tint i;\n\n\tnode = fz_malloc_struct(ctx, fz_display_node);\n\tnode->cmd = cmd;\n\tnode->next = NULL;\n\tnode->rect = fz_empty_rect;\n\tnode->item.path = NULL;\n\tnode->stroke = NULL;\n\tnode->flag = (cmd == FZ_CMD_BEGIN_TILE ? fz_gen_id(ctx) : 0);\n\tnode->ctm = *ctm;\n\tif (colorspace)\n\t{\n\t\tnode->colorspace = fz_keep_colorspace(ctx, colorspace);\n\t\tif (color)\n\t\t{\n\t\t\tfor (i = 0; i < node->colorspace->n; i++)\n\t\t\t\tnode->color[i] = color[i];\n\t\t}\n\t}\n\telse\n\t{\n\t\tnode->colorspace = NULL;\n\t}\n\tnode->alpha = alpha;\n\n\treturn node;\n}\n\nstatic void\nfz_append_display_node(fz_display_list *list, fz_display_node *node)\n{\n\tswitch (node->cmd)\n\t{\n\tcase FZ_CMD_CLIP_PATH:\n\tcase FZ_CMD_CLIP_STROKE_PATH:\n\tcase FZ_CMD_CLIP_IMAGE_MASK:\n\t\tif (list->top < STACK_SIZE)\n\t\t{\n\t\t\tlist->stack[list->top].update = &node->rect;\n\t\t\tlist->stack[list->top].rect = fz_empty_rect;\n\t\t}\n\t\tlist->top++;\n\t\tbreak;\n\tcase FZ_CMD_CLIP_TEXT:\n\t\t/* don't reset the clip rect for accumulated text */\n\t\tif (node->flag == 2)\n\t\t\tbreak;\n\t\t/* fallthrough */\n\tcase FZ_CMD_END_MASK:\n\tcase FZ_CMD_CLIP_STROKE_TEXT:\n\t\tif (list->top < STACK_SIZE)\n\t\t{\n\t\t\tlist->stack[list->top].update = NULL;\n\t\t\tlist->stack[list->top].rect = fz_empty_rect;\n\t\t}\n\t\tlist->top++;\n\t\tbreak;\n\tcase FZ_CMD_BEGIN_TILE:\n\t\tlist->tiled++;\n\t\tif (list->top > 0 && list->top <= STACK_SIZE)\n\t\t{\n\t\t\tlist->stack[list->top-1].rect = fz_infinite_rect;\n\t\t}\n\t\tbreak;\n\tcase FZ_CMD_END_TILE:\n\t\tlist->tiled--;\n\t\tbreak;\n\tcase FZ_CMD_END_GROUP:\n\t\tbreak;\n\tcase FZ_CMD_POP_CLIP:\n\t\tif (list->top > STACK_SIZE)\n\t\t{\n\t\t\tlist->top--;\n\t\t\tnode->rect = fz_infinite_rect;\n\t\t}\n\t\telse if (list->top > 0)\n\t\t{\n\t\t\tfz_rect *update;\n\t\t\tlist->top--;\n\t\t\tupdate = list->stack[list->top].update;\n\t\t\tif (list->tiled == 0)\n\t\t\t{\n\t\t\t\tif (update)\n\t\t\t\t{\n\t\t\t\t\tfz_intersect_rect(update, &list->stack[list->top].rect);\n\t\t\t\t\tnode->rect = *update;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tnode->rect = list->stack[list->top].rect;\n\t\t\t}\n\t\t\telse\n\t\t\t\tnode->rect = fz_infinite_rect;\n\t\t}\n\t\t/* fallthrough */\n\tdefault:\n\t\tif (list->top > 0 && list->tiled == 0 && list->top <= STACK_SIZE)\n\t\t\tfz_union_rect(&list->stack[list->top-1].rect, &node->rect);\n\t\tbreak;\n\t}\n\tif (!list->first)\n\t{\n\t\tlist->first = node;\n\t\tlist->last = node;\n\t}\n\telse\n\t{\n\t\tlist->last->next = node;\n\t\tlist->last = node;\n\t}\n\tlist->len++;\n}\n\nstatic void\nfz_free_display_node(fz_context *ctx, fz_display_node *node)\n{\n\tswitch (node->cmd)\n\t{\n\tcase FZ_CMD_FILL_PATH:\n\tcase FZ_CMD_STROKE_PATH:\n\tcase FZ_CMD_CLIP_PATH:\n\tcase FZ_CMD_CLIP_STROKE_PATH:\n\t\tfz_free_path(ctx, node->item.path);\n\t\tbreak;\n\tcase FZ_CMD_FILL_TEXT:\n\tcase FZ_CMD_STROKE_TEXT:\n\tcase FZ_CMD_CLIP_TEXT:\n\tcase FZ_CMD_CLIP_STROKE_TEXT:\n\tcase FZ_CMD_IGNORE_TEXT:\n\t\tfz_free_text(ctx, node->item.text);\n\t\tbreak;\n\tcase FZ_CMD_FILL_SHADE:\n\t\tfz_drop_shade(ctx, node->item.shade);\n\t\tbreak;\n\tcase FZ_CMD_FILL_IMAGE:\n\tcase FZ_CMD_FILL_IMAGE_MASK:\n\tcase FZ_CMD_CLIP_IMAGE_MASK:\n\t\tfz_drop_image(ctx, node->item.image);\n\t\tbreak;\n\tcase FZ_CMD_POP_CLIP:\n\tcase FZ_CMD_BEGIN_MASK:\n\tcase FZ_CMD_END_MASK:\n\tcase FZ_CMD_BEGIN_GROUP:\n\tcase FZ_CMD_END_GROUP:\n\tcase FZ_CMD_BEGIN_TILE:\n\tcase FZ_CMD_END_TILE:\n\tcase FZ_CMD_BEGIN_PAGE:\n\tcase FZ_CMD_END_PAGE:\n\t\tbreak;\n\t/* SumatraPDF: support transfer functions */\n\tcase FZ_CMD_APPLY_TRANSFER_FUNCTION:\n\t\tfz_drop_transfer_function(ctx, node->item.tr);\n\t\tbreak;\n\t}\n\tif (node->stroke)\n\t\tfz_drop_stroke_state(ctx, node->stroke);\n\tif (node->colorspace)\n\t\tfz_drop_colorspace(ctx, node->colorspace);\n\tfz_free(ctx, node);\n}\n\nstatic void\nfz_list_begin_page(fz_device *dev, const fz_rect *mediabox, const fz_matrix *ctm)\n{\n\tfz_context *ctx = dev->ctx;\n\tfz_display_node *node = fz_new_display_node(ctx, FZ_CMD_BEGIN_PAGE, ctm, NULL, NULL, 0);\n\tnode->rect = *mediabox;\n\tfz_transform_rect(&node->rect, ctm);\n\tfz_append_display_node(dev->user, node);\n}\n\nstatic void\nfz_list_end_page(fz_device *dev)\n{\n\tfz_context *ctx = dev->ctx;\n\tfz_display_node *node = fz_new_display_node(ctx, FZ_CMD_END_PAGE, &fz_identity, NULL, NULL, 0);\n\tfz_append_display_node(dev->user, node);\n}\n\nstatic void\nfz_list_fill_path(fz_device *dev, fz_path *path, int even_odd, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tfz_display_node *node;\n\tfz_context *ctx = dev->ctx;\n\tnode = fz_new_display_node(ctx, FZ_CMD_FILL_PATH, ctm, colorspace, color, alpha);\n\tfz_try(ctx)\n\t{\n\t\tfz_bound_path(dev->ctx, path, NULL, ctm, &node->rect);\n\t\tnode->item.path = fz_clone_path(dev->ctx, path);\n\t\tnode->flag = even_odd;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free_display_node(ctx, node);\n\t\tfz_rethrow(ctx);\n\t}\n\tfz_append_display_node(dev->user, node);\n}\n\nstatic void\nfz_list_stroke_path(fz_device *dev, fz_path *path, fz_stroke_state *stroke,\n\tconst fz_matrix *ctm, fz_colorspace *colorspace, float *color, float alpha)\n{\n\tfz_display_node *node;\n\tfz_context *ctx = dev->ctx;\n\tnode = fz_new_display_node(ctx, FZ_CMD_STROKE_PATH, ctm, colorspace, color, alpha);\n\tfz_try(ctx)\n\t{\n\t\tfz_bound_path(dev->ctx, path, stroke, ctm, &node->rect);\n\t\tnode->item.path = fz_clone_path(dev->ctx, path);\n\t\tnode->stroke = fz_keep_stroke_state(dev->ctx, stroke);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free_display_node(ctx, node);\n\t\tfz_rethrow(ctx);\n\t}\n\tfz_append_display_node(dev->user, node);\n}\n\nstatic void\nfz_list_clip_path(fz_device *dev, fz_path *path, const fz_rect *rect, int even_odd, const fz_matrix *ctm)\n{\n\tfz_display_node *node;\n\tfz_context *ctx = dev->ctx;\n\tnode = fz_new_display_node(ctx, FZ_CMD_CLIP_PATH, ctm, NULL, NULL, 0);\n\tfz_try(ctx)\n\t{\n\t\tfz_bound_path(dev->ctx, path, NULL, ctm, &node->rect);\n\t\tif (rect)\n\t\t\tfz_intersect_rect(&node->rect, rect);\n\t\tnode->item.path = fz_clone_path(dev->ctx, path);\n\t\tnode->flag = even_odd;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free_display_node(ctx, node);\n\t\tfz_rethrow(ctx);\n\t}\n\tfz_append_display_node(dev->user, node);\n}\n\nstatic void\nfz_list_clip_stroke_path(fz_device *dev, fz_path *path, const fz_rect *rect, fz_stroke_state *stroke, const fz_matrix *ctm)\n{\n\tfz_display_node *node;\n\tfz_context *ctx = dev->ctx;\n\tnode = fz_new_display_node(ctx, FZ_CMD_CLIP_STROKE_PATH, ctm, NULL, NULL, 0);\n\tfz_try(ctx)\n\t{\n\t\tfz_bound_path(dev->ctx, path, stroke, ctm, &node->rect);\n\t\tif (rect)\n\t\t\tfz_intersect_rect(&node->rect, rect);\n\t\tnode->item.path = fz_clone_path(dev->ctx, path);\n\t\tnode->stroke = fz_keep_stroke_state(dev->ctx, stroke);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free_display_node(ctx, node);\n\t\tfz_rethrow(ctx);\n\t}\n\tfz_append_display_node(dev->user, node);\n}\n\nstatic void\nfz_list_fill_text(fz_device *dev, fz_text *text, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tfz_display_node *node;\n\tfz_context *ctx = dev->ctx;\n\tnode = fz_new_display_node(ctx, FZ_CMD_FILL_TEXT, ctm, colorspace, color, alpha);\n\tfz_try(ctx)\n\t{\n\t\tfz_bound_text(dev->ctx, text, NULL, ctm, &node->rect);\n\t\tnode->item.text = fz_clone_text(dev->ctx, text);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free_display_node(ctx, node);\n\t\tfz_rethrow(ctx);\n\t}\n\tfz_append_display_node(dev->user, node);\n}\n\nstatic void\nfz_list_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tfz_display_node *node;\n\tfz_context *ctx = dev->ctx;\n\tnode = fz_new_display_node(ctx, FZ_CMD_STROKE_TEXT, ctm, colorspace, color, alpha);\n\tnode->item.text = NULL;\n\tfz_try(ctx)\n\t{\n\t\tfz_bound_text(dev->ctx, text, stroke, ctm, &node->rect);\n\t\tnode->item.text = fz_clone_text(dev->ctx, text);\n\t\tnode->stroke = fz_keep_stroke_state(dev->ctx, stroke);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free_display_node(ctx, node);\n\t\tfz_rethrow(ctx);\n\t}\n\tfz_append_display_node(dev->user, node);\n}\n\nstatic void\nfz_list_clip_text(fz_device *dev, fz_text *text, const fz_matrix *ctm, int accumulate)\n{\n\tfz_display_node *node;\n\tfz_context *ctx = dev->ctx;\n\tnode = fz_new_display_node(ctx, FZ_CMD_CLIP_TEXT, ctm, NULL, NULL, 0);\n\tfz_try(ctx)\n\t{\n\t\tfz_bound_text(dev->ctx, text, NULL, ctm, &node->rect);\n\t\tnode->item.text = fz_clone_text(dev->ctx, text);\n\t\tnode->flag = accumulate;\n\t\t/* when accumulating, be conservative about culling */\n\t\tif (accumulate)\n\t\t\tnode->rect = fz_infinite_rect;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free_display_node(ctx, node);\n\t\tfz_rethrow(ctx);\n\t}\n\tfz_append_display_node(dev->user, node);\n}\n\nstatic void\nfz_list_clip_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, const fz_matrix *ctm)\n{\n\tfz_display_node *node;\n\tfz_context *ctx = dev->ctx;\n\tnode = fz_new_display_node(ctx, FZ_CMD_CLIP_STROKE_TEXT, ctm, NULL, NULL, 0);\n\tfz_try(ctx)\n\t{\n\t\tfz_bound_text(dev->ctx, text, stroke, ctm, &node->rect);\n\t\tnode->item.text = fz_clone_text(dev->ctx, text);\n\t\tnode->stroke = fz_keep_stroke_state(dev->ctx, stroke);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free_display_node(ctx, node);\n\t\tfz_rethrow(ctx);\n\t}\n\tfz_append_display_node(dev->user, node);\n}\n\nstatic void\nfz_list_ignore_text(fz_device *dev, fz_text *text, const fz_matrix *ctm)\n{\n\tfz_display_node *node;\n\tfz_context *ctx = dev->ctx;\n\tnode = fz_new_display_node(ctx, FZ_CMD_IGNORE_TEXT, ctm, NULL, NULL, 0);\n\tfz_try(ctx)\n\t{\n\t\tfz_bound_text(dev->ctx, text, NULL, ctm, &node->rect);\n\t\tnode->item.text = fz_clone_text(dev->ctx, text);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free_display_node(ctx, node);\n\t\tfz_rethrow(ctx);\n\t}\n\tfz_append_display_node(dev->user, node);\n}\n\nstatic void\nfz_list_pop_clip(fz_device *dev)\n{\n\tfz_display_node *node;\n\tnode = fz_new_display_node(dev->ctx, FZ_CMD_POP_CLIP, &fz_identity, NULL, NULL, 0);\n\tfz_append_display_node(dev->user, node);\n}\n\nstatic void\nfz_list_fill_shade(fz_device *dev, fz_shade *shade, const fz_matrix *ctm, float alpha)\n{\n\tfz_display_node *node;\n\tfz_context *ctx = dev->ctx;\n\tnode = fz_new_display_node(ctx, FZ_CMD_FILL_SHADE, ctm, NULL, NULL, alpha);\n\tfz_bound_shade(ctx, shade, ctm, &node->rect);\n\tnode->item.shade = fz_keep_shade(ctx, shade);\n\tfz_append_display_node(dev->user, node);\n}\n\nstatic void\nfz_list_fill_image(fz_device *dev, fz_image *image, const fz_matrix *ctm, float alpha)\n{\n\tfz_display_node *node;\n\tnode = fz_new_display_node(dev->ctx, FZ_CMD_FILL_IMAGE, ctm, NULL, NULL, alpha);\n\tnode->rect = fz_unit_rect;\n\tfz_transform_rect(&node->rect, ctm);\n\tnode->item.image = fz_keep_image(dev->ctx, image);\n\tfz_append_display_node(dev->user, node);\n}\n\nstatic void\nfz_list_fill_image_mask(fz_device *dev, fz_image *image, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tfz_display_node *node;\n\tnode = fz_new_display_node(dev->ctx, FZ_CMD_FILL_IMAGE_MASK, ctm, colorspace, color, alpha);\n\tnode->rect = fz_unit_rect;\n\tfz_transform_rect(&node->rect, ctm);\n\tnode->item.image = fz_keep_image(dev->ctx, image);\n\tfz_append_display_node(dev->user, node);\n}\n\nstatic void\nfz_list_clip_image_mask(fz_device *dev, fz_image *image, const fz_rect *rect, const fz_matrix *ctm)\n{\n\tfz_display_node *node;\n\tnode = fz_new_display_node(dev->ctx, FZ_CMD_CLIP_IMAGE_MASK, ctm, NULL, NULL, 0);\n\tnode->rect = fz_unit_rect;\n\tfz_transform_rect(&node->rect, ctm);\n\tif (rect)\n\t\tfz_intersect_rect(&node->rect, rect);\n\tnode->item.image = fz_keep_image(dev->ctx, image);\n\tfz_append_display_node(dev->user, node);\n}\n\nstatic void\nfz_list_begin_mask(fz_device *dev, const fz_rect *rect, int luminosity, fz_colorspace *colorspace, float *color)\n{\n\tfz_display_node *node;\n\tnode = fz_new_display_node(dev->ctx, FZ_CMD_BEGIN_MASK, &fz_identity, colorspace, color, 0);\n\tnode->rect = *rect;\n\tnode->flag = luminosity;\n\tfz_append_display_node(dev->user, node);\n}\n\nstatic void\nfz_list_end_mask(fz_device *dev)\n{\n\tfz_display_node *node;\n\tnode = fz_new_display_node(dev->ctx, FZ_CMD_END_MASK, &fz_identity, NULL, NULL, 0);\n\tfz_append_display_node(dev->user, node);\n}\n\nstatic void\nfz_list_begin_group(fz_device *dev, const fz_rect *rect, int isolated, int knockout, int blendmode, float alpha)\n{\n\tfz_display_node *node;\n\tnode = fz_new_display_node(dev->ctx, FZ_CMD_BEGIN_GROUP, &fz_identity, NULL, NULL, alpha);\n\tnode->rect = *rect;\n\tnode->item.blendmode = blendmode;\n\tnode->flag |= isolated ? ISOLATED : 0;\n\tnode->flag |= knockout ? KNOCKOUT : 0;\n\tfz_append_display_node(dev->user, node);\n}\n\nstatic void\nfz_list_end_group(fz_device *dev)\n{\n\tfz_display_node *node;\n\tnode = fz_new_display_node(dev->ctx, FZ_CMD_END_GROUP, &fz_identity, NULL, NULL, 0);\n\tfz_append_display_node(dev->user, node);\n}\n\nstatic int\nfz_list_begin_tile(fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, const fz_matrix *ctm, int id)\n{\n\t/* We ignore id here, as we will pass on our own id */\n\tfz_display_node *node;\n\tnode = fz_new_display_node(dev->ctx, FZ_CMD_BEGIN_TILE, ctm, NULL, NULL, 0);\n\tnode->rect = *area;\n\tnode->color[0] = xstep;\n\tnode->color[1] = ystep;\n\tnode->color[2] = view->x0;\n\tnode->color[3] = view->y0;\n\tnode->color[4] = view->x1;\n\tnode->color[5] = view->y1;\n\tfz_append_display_node(dev->user, node);\n\treturn 0;\n}\n\nstatic void\nfz_list_end_tile(fz_device *dev)\n{\n\tfz_display_node *node;\n\tnode = fz_new_display_node(dev->ctx, FZ_CMD_END_TILE, &fz_identity, NULL, NULL, 0);\n\tfz_append_display_node(dev->user, node);\n}\n\n/* SumatraPDF: support transfer functions */\nstatic void\nfz_list_apply_transfer_function(fz_device *dev, fz_transfer_function *tr, int for_mask)\n{\n\tfz_display_node *node;\n\tnode = fz_new_display_node(dev->ctx, FZ_CMD_APPLY_TRANSFER_FUNCTION, &fz_identity, NULL, NULL, 0);\n\tnode->item.tr = fz_keep_transfer_function(dev->ctx, tr);\n\tnode->flag = for_mask;\n\tnode->rect = fz_infinite_rect;\n\tfz_append_display_node(dev->user, node);\n}\n\nfz_device *\nfz_new_list_device(fz_context *ctx, fz_display_list *list)\n{\n\tfz_device *dev = fz_new_device(ctx, list);\n\n\tdev->begin_page = fz_list_begin_page;\n\tdev->end_page = fz_list_end_page;\n\n\tdev->fill_path = fz_list_fill_path;\n\tdev->stroke_path = fz_list_stroke_path;\n\tdev->clip_path = fz_list_clip_path;\n\tdev->clip_stroke_path = fz_list_clip_stroke_path;\n\n\tdev->fill_text = fz_list_fill_text;\n\tdev->stroke_text = fz_list_stroke_text;\n\tdev->clip_text = fz_list_clip_text;\n\tdev->clip_stroke_text = fz_list_clip_stroke_text;\n\tdev->ignore_text = fz_list_ignore_text;\n\n\tdev->fill_shade = fz_list_fill_shade;\n\tdev->fill_image = fz_list_fill_image;\n\tdev->fill_image_mask = fz_list_fill_image_mask;\n\tdev->clip_image_mask = fz_list_clip_image_mask;\n\n\tdev->pop_clip = fz_list_pop_clip;\n\n\tdev->begin_mask = fz_list_begin_mask;\n\tdev->end_mask = fz_list_end_mask;\n\tdev->begin_group = fz_list_begin_group;\n\tdev->end_group = fz_list_end_group;\n\n\tdev->begin_tile = fz_list_begin_tile;\n\tdev->end_tile = fz_list_end_tile;\n\n\t/* SumatraPDF: support transfer functions */\n\tdev->apply_transfer_function = fz_list_apply_transfer_function;\n\n\treturn dev;\n}\n\nstatic void\nfz_free_display_list(fz_context *ctx, fz_storable *list_)\n{\n\tfz_display_list *list = (fz_display_list *)list_;\n\tfz_display_node *node;\n\n\tif (list == NULL)\n\t\treturn;\n\tnode = list->first;\n\twhile (node)\n\t{\n\t\tfz_display_node *next = node->next;\n\t\tfz_free_display_node(ctx, node);\n\t\tnode = next;\n\t}\n\tfz_free(ctx, list);\n}\n\nfz_display_list *\nfz_new_display_list(fz_context *ctx)\n{\n\tfz_display_list *list = fz_malloc_struct(ctx, fz_display_list);\n\tFZ_INIT_STORABLE(list, 1, fz_free_display_list);\n\tlist->first = NULL;\n\tlist->last = NULL;\n\tlist->len = 0;\n\tlist->top = 0;\n\tlist->tiled = 0;\n\treturn list;\n}\n\nfz_display_list *\nfz_keep_display_list(fz_context *ctx, fz_display_list *list)\n{\n\treturn (fz_display_list *)fz_keep_storable(ctx, &list->storable);\n}\n\nvoid\nfz_drop_display_list(fz_context *ctx, fz_display_list *list)\n{\n\tfz_drop_storable(ctx, &list->storable);\n}\n\nstatic fz_display_node *\nskip_to_end_tile(fz_display_node *node, int *progress)\n{\n\tfz_display_node *next;\n\tint depth = 1;\n\n\t/* Skip through until we find the matching end_tile. Note that\n\t * (somewhat nastily) we return the PREVIOUS node to this to help\n\t * the calling routine. */\n\tdo\n\t{\n\t\tnext = node->next;\n\t\tif (next == NULL)\n\t\t\tbreak;\n\t\tif (next->cmd == FZ_CMD_BEGIN_TILE)\n\t\t\tdepth++;\n\t\telse if (next->cmd == FZ_CMD_END_TILE)\n\t\t{\n\t\t\tdepth--;\n\t\t\tif (depth == 0)\n\t\t\t\treturn node;\n\t\t}\n\t\t(*progress)++;\n\t\tnode = next;\n\t}\n\twhile (1);\n\n\treturn NULL;\n}\n\nvoid\nfz_run_display_list(fz_display_list *list, fz_device *dev, const fz_matrix *top_ctm, const fz_rect *scissor, fz_cookie *cookie)\n{\n\tfz_display_node *node;\n\tfz_matrix ctm;\n\tint clipped = 0;\n\tint tiled = 0;\n\tint progress = 0;\n\tfz_context *ctx = dev->ctx;\n\n\tif (!scissor)\n\t\tscissor = &fz_infinite_rect;\n\n\tif (cookie)\n\t{\n\t\tcookie->progress_max = list->len;\n\t\tcookie->progress = 0;\n\t}\n\n\tfor (node = list->first; node; node = node->next)\n\t{\n\t\tint empty;\n\n\t\tfz_rect node_rect = node->rect;\n\t\tfz_transform_rect(&node_rect, top_ctm);\n\n\t\t/* Check the cookie for aborting */\n\t\tif (cookie)\n\t\t{\n\t\t\tif (cookie->abort)\n\t\t\t\tbreak;\n\t\t\tcookie->progress = progress++;\n\t\t}\n\n\t\t/* cull objects to draw using a quick visibility test */\n\n\t\tif (tiled ||\n\t\t\tnode->cmd == FZ_CMD_BEGIN_TILE || node->cmd == FZ_CMD_END_TILE ||\n\t\t\tnode->cmd == FZ_CMD_BEGIN_PAGE || node->cmd == FZ_CMD_END_PAGE)\n\t\t{\n\t\t\tempty = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_rect rect = node_rect;\n\t\t\tfz_intersect_rect(&rect, scissor);\n\t\t\tempty = fz_is_empty_rect(&rect);\n\t\t}\n\n\t\tif (clipped || empty)\n\t\t{\n\t\t\tswitch (node->cmd)\n\t\t\t{\n\t\t\tcase FZ_CMD_CLIP_PATH:\n\t\t\tcase FZ_CMD_CLIP_STROKE_PATH:\n\t\t\tcase FZ_CMD_CLIP_STROKE_TEXT:\n\t\t\tcase FZ_CMD_CLIP_IMAGE_MASK:\n\t\t\tcase FZ_CMD_BEGIN_MASK:\n\t\t\tcase FZ_CMD_BEGIN_GROUP:\n\t\t\t\tclipped++;\n\t\t\t\tcontinue;\n\t\t\tcase FZ_CMD_CLIP_TEXT:\n\t\t\t\t/* Accumulated text has no extra pops */\n\t\t\t\tif (node->flag != 2)\n\t\t\t\t\tclipped++;\n\t\t\t\tcontinue;\n\t\t\tcase FZ_CMD_POP_CLIP:\n\t\t\tcase FZ_CMD_END_GROUP:\n\t\t\t\tif (!clipped)\n\t\t\t\t\tgoto visible;\n\t\t\t\tclipped--;\n\t\t\t\tcontinue;\n\t\t\tcase FZ_CMD_END_MASK:\n\t\t\t\tif (!clipped)\n\t\t\t\t\tgoto visible;\n\t\t\t\tcontinue;\n\t\t\tdefault:\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\nvisible:\n\t\tfz_concat(&ctm, &node->ctm, top_ctm);\n\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tswitch (node->cmd)\n\t\t\t{\n\t\t\tcase FZ_CMD_BEGIN_PAGE:\n\t\t\t\tfz_begin_page(dev, &node_rect, &ctm);\n\t\t\t\tbreak;\n\t\t\tcase FZ_CMD_END_PAGE:\n\t\t\t\tfz_end_page(dev);\n\t\t\t\tbreak;\n\t\t\tcase FZ_CMD_FILL_PATH:\n\t\t\t\tfz_fill_path(dev, node->item.path, node->flag, &ctm,\n\t\t\t\t\tnode->colorspace, node->color, node->alpha);\n\t\t\t\tbreak;\n\t\t\tcase FZ_CMD_STROKE_PATH:\n\t\t\t\tfz_stroke_path(dev, node->item.path, node->stroke, &ctm,\n\t\t\t\t\tnode->colorspace, node->color, node->alpha);\n\t\t\t\tbreak;\n\t\t\tcase FZ_CMD_CLIP_PATH:\n\t\t\t\tfz_clip_path(dev, node->item.path, &node_rect, node->flag, &ctm);\n\t\t\t\tbreak;\n\t\t\tcase FZ_CMD_CLIP_STROKE_PATH:\n\t\t\t\tfz_clip_stroke_path(dev, node->item.path, &node_rect, node->stroke, &ctm);\n\t\t\t\tbreak;\n\t\t\tcase FZ_CMD_FILL_TEXT:\n\t\t\t\tfz_fill_text(dev, node->item.text, &ctm,\n\t\t\t\t\tnode->colorspace, node->color, node->alpha);\n\t\t\t\tbreak;\n\t\t\tcase FZ_CMD_STROKE_TEXT:\n\t\t\t\tfz_stroke_text(dev, node->item.text, node->stroke, &ctm,\n\t\t\t\t\tnode->colorspace, node->color, node->alpha);\n\t\t\t\tbreak;\n\t\t\tcase FZ_CMD_CLIP_TEXT:\n\t\t\t\tfz_clip_text(dev, node->item.text, &ctm, node->flag);\n\t\t\t\tbreak;\n\t\t\tcase FZ_CMD_CLIP_STROKE_TEXT:\n\t\t\t\tfz_clip_stroke_text(dev, node->item.text, node->stroke, &ctm);\n\t\t\t\tbreak;\n\t\t\tcase FZ_CMD_IGNORE_TEXT:\n\t\t\t\tfz_ignore_text(dev, node->item.text, &ctm);\n\t\t\t\tbreak;\n\t\t\tcase FZ_CMD_FILL_SHADE:\n\t\t\t\tif ((dev->hints & FZ_IGNORE_SHADE) == 0)\n\t\t\t\t\tfz_fill_shade(dev, node->item.shade, &ctm, node->alpha);\n\t\t\t\tbreak;\n\t\t\tcase FZ_CMD_FILL_IMAGE:\n\t\t\t\tif ((dev->hints & FZ_IGNORE_IMAGE) == 0)\n\t\t\t\t\tfz_fill_image(dev, node->item.image, &ctm, node->alpha);\n\t\t\t\tbreak;\n\t\t\tcase FZ_CMD_FILL_IMAGE_MASK:\n\t\t\t\tif ((dev->hints & FZ_IGNORE_IMAGE) == 0)\n\t\t\t\t\tfz_fill_image_mask(dev, node->item.image, &ctm,\n\t\t\t\t\t\tnode->colorspace, node->color, node->alpha);\n\t\t\t\tbreak;\n\t\t\tcase FZ_CMD_CLIP_IMAGE_MASK:\n\t\t\t\tif ((dev->hints & FZ_IGNORE_IMAGE) == 0)\n\t\t\t\t\tfz_clip_image_mask(dev, node->item.image, &node_rect, &ctm);\n\t\t\t\tbreak;\n\t\t\tcase FZ_CMD_POP_CLIP:\n\t\t\t\tfz_pop_clip(dev);\n\t\t\t\tbreak;\n\t\t\tcase FZ_CMD_BEGIN_MASK:\n\t\t\t\tfz_begin_mask(dev, &node_rect, node->flag, node->colorspace, node->color);\n\t\t\t\tbreak;\n\t\t\tcase FZ_CMD_END_MASK:\n\t\t\t\tfz_end_mask(dev);\n\t\t\t\tbreak;\n\t\t\tcase FZ_CMD_BEGIN_GROUP:\n\t\t\t\tfz_begin_group(dev, &node_rect,\n\t\t\t\t\t(node->flag & ISOLATED) != 0, (node->flag & KNOCKOUT) != 0,\n\t\t\t\t\tnode->item.blendmode, node->alpha);\n\t\t\t\tbreak;\n\t\t\tcase FZ_CMD_END_GROUP:\n\t\t\t\tfz_end_group(dev);\n\t\t\t\tbreak;\n\t\t\tcase FZ_CMD_BEGIN_TILE:\n\t\t\t{\n\t\t\t\tint cached;\n\t\t\t\tfz_rect tile_rect;\n\t\t\t\ttiled++;\n\t\t\t\ttile_rect.x0 = node->color[2];\n\t\t\t\ttile_rect.y0 = node->color[3];\n\t\t\t\ttile_rect.x1 = node->color[4];\n\t\t\t\ttile_rect.y1 = node->color[5];\n\t\t\t\tcached = fz_begin_tile_id(dev, &node->rect, &tile_rect, node->color[0], node->color[1], &ctm, node->flag);\n\t\t\t\tif (cached)\n\t\t\t\t\tnode = skip_to_end_tile(node, &progress);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase FZ_CMD_END_TILE:\n\t\t\t\ttiled--;\n\t\t\t\tfz_end_tile(dev);\n\t\t\t\tbreak;\n\t\t\t/* SumatraPDF: support transfer functions */\n\t\t\tcase FZ_CMD_APPLY_TRANSFER_FUNCTION:\n\t\t\t\tfz_apply_transfer_function(dev, node->item.tr, node->flag);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\t/* Swallow the error */\n\t\t\tif (cookie)\n\t\t\t\tcookie->errors++;\n\t\t\tif (fz_caught(ctx) == FZ_ERROR_ABORT)\n\t\t\t\tbreak;\n\t\t\tfz_warn(ctx, \"Ignoring error during interpretation\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/fitz/load-jpeg.c",
    "content": "#include \"mupdf/fitz.h\"\n\n#include <jpeglib.h>\n\n#ifdef SHARE_JPEG\n\n#define JZ_CTX_FROM_CINFO(c) (fz_context *)(c->client_data)\n\n#define fz_jpg_mem_init(ctx, cinfo)\n#define fz_jpg_mem_term(cinfo)\n\n#else /* SHARE_JPEG */\n\ntypedef void * backing_store_ptr;\n#include \"jmemcust.h\"\n\n#define JZ_CTX_FROM_CINFO(c) (fz_context *)(GET_CUST_MEM_DATA(c)->priv)\n\nstatic void *\nfz_jpg_mem_alloc(j_common_ptr cinfo, size_t size)\n{\n\tfz_context *ctx = JZ_CTX_FROM_CINFO(cinfo);\n\treturn fz_malloc(ctx, size);\n}\n\nstatic void\nfz_jpg_mem_free(j_common_ptr cinfo, void *object, size_t size)\n{\n\tfz_context *ctx = JZ_CTX_FROM_CINFO(cinfo);\n\tUNUSED(size);\n\tfz_free(ctx, object);\n}\n\nstatic void\nfz_jpg_mem_init(fz_context *ctx, struct jpeg_decompress_struct *cinfo)\n{\n\tjpeg_cust_mem_data *custmptr;\n\n\tcustmptr = fz_malloc_struct(ctx, jpeg_cust_mem_data);\n\n\tif (!jpeg_cust_mem_init(custmptr, (void *) ctx, NULL, NULL, NULL,\n\t\t\t\tfz_jpg_mem_alloc, fz_jpg_mem_free,\n\t\t\t\tfz_jpg_mem_alloc, fz_jpg_mem_free, NULL))\n\t{\n\t\tfz_free(ctx, custmptr);\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot initialize custom JPEG memory handler\");\n\t}\n\n\tcinfo->client_data = custmptr;\n}\n\nstatic void\nfz_jpg_mem_term(struct jpeg_decompress_struct *cinfo)\n{\n\tif(cinfo->client_data)\n\t{\n\t\tfz_context *ctx = JZ_CTX_FROM_CINFO(cinfo);\n\t\tfz_free(ctx, cinfo->client_data);\n\t\tcinfo->client_data = NULL;\n\t}\n}\n\n#endif /* SHARE_JPEG */\n\nstatic void error_exit(j_common_ptr cinfo)\n{\n\tchar msg[JMSG_LENGTH_MAX];\n\tfz_context *ctx = (fz_context *)cinfo->client_data;\n\n\tcinfo->err->format_message(cinfo, msg);\n\tfz_throw(ctx, FZ_ERROR_GENERIC, \"jpeg error: %s\", msg);\n}\n\nstatic void init_source(j_decompress_ptr cinfo)\n{\n\t/* nothing to do */\n}\n\nstatic void term_source(j_decompress_ptr cinfo)\n{\n\t/* nothing to do */\n}\n\nstatic boolean fill_input_buffer(j_decompress_ptr cinfo)\n{\n\tstatic unsigned char eoi[2] = { 0xFF, JPEG_EOI };\n\tstruct jpeg_source_mgr *src = cinfo->src;\n\tsrc->next_input_byte = eoi;\n\tsrc->bytes_in_buffer = 2;\n\treturn 1;\n}\n\nstatic void skip_input_data(j_decompress_ptr cinfo, long num_bytes)\n{\n\tstruct jpeg_source_mgr *src = cinfo->src;\n\tif (num_bytes > 0)\n\t{\n\t\tsize_t skip = (size_t)num_bytes; /* size_t may be 64bit */\n\t\tif (skip > src->bytes_in_buffer)\n\t\t\tskip = (size_t)src->bytes_in_buffer;\n\t\tsrc->next_input_byte += skip;\n\t\tsrc->bytes_in_buffer -= skip;\n\t}\n}\n\nstatic inline int read_value(const unsigned char *data, int bytes, int is_big_endian)\n{\n\tint value = 0;\n\tif (!is_big_endian)\n\t\tdata += bytes;\n\tfor (; bytes > 0; bytes--)\n\t\tvalue = (value << 8) | (is_big_endian ? *data++ : *--data);\n\treturn value;\n}\n\nstatic int extract_exif_resolution(jpeg_saved_marker_ptr marker, int *xres, int *yres)\n{\n\tint is_big_endian;\n\tconst unsigned char *data;\n\tunsigned int offset, ifd_len, res_type = 0;\n\tfloat x_res = 0, y_res = 0;\n\n\tif (!marker || marker->marker != JPEG_APP0 + 1 || marker->data_length < 14)\n\t\treturn 0;\n\tdata = (const unsigned char *)marker->data;\n\tif (read_value(data, 4, 1) != 0x45786966 /* Exif */ || read_value(data + 4, 2, 1) != 0x0000)\n\t\treturn 0;\n\tif (read_value(data + 6, 4, 1) == 0x49492A00)\n\t\tis_big_endian = 0;\n\telse if (read_value(data + 6, 4, 1) == 0x4D4D002A)\n\t\tis_big_endian = 1;\n\telse\n\t\treturn 0;\n\n\toffset = read_value(data + 10, 4, is_big_endian) + 6;\n\tif (offset < 14 || offset > marker->data_length - 2)\n\t\treturn 0;\n\tifd_len = read_value(data + offset, 2, is_big_endian);\n\tfor (offset += 2; ifd_len > 0 && offset + 12 < marker->data_length; ifd_len--, offset += 12)\n\t{\n\t\tint tag = read_value(data + offset, 2, is_big_endian);\n\t\tint type = read_value(data + offset + 2, 2, is_big_endian);\n\t\tint count = read_value(data + offset + 4, 4, is_big_endian);\n\t\tunsigned int value_off = read_value(data + offset + 8, 4, is_big_endian) + 6;\n\t\tswitch (tag)\n\t\t{\n\t\tcase 0x11A:\n\t\t\tif (type == 5 && value_off > offset && value_off <= marker->data_length - 8)\n\t\t\t\tx_res = 1.0f * read_value(data + value_off, 4, is_big_endian) / read_value(data + value_off + 4, 4, is_big_endian);\n\t\t\tbreak;\n\t\tcase 0x11B:\n\t\t\tif (type == 5 && value_off > offset && value_off <= marker->data_length - 8)\n\t\t\t\ty_res = 1.0f * read_value(data + value_off, 4, is_big_endian) / read_value(data + value_off + 4, 4, is_big_endian);\n\t\t\tbreak;\n\t\tcase 0x128:\n\t\t\tif (type == 3 && count == 1)\n\t\t\t\tres_type = read_value(data + offset + 8, 2, is_big_endian);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (x_res <= 0 || x_res > INT_MAX || y_res <= 0 || y_res > INT_MAX)\n\t\treturn 0;\n\tif (res_type == 2)\n\t{\n\t\t*xres = (int)x_res;\n\t\t*yres = (int)y_res;\n\t}\n\telse if (res_type == 3)\n\t{\n\t\t*xres = (int)(x_res * 254 / 100);\n\t\t*yres = (int)(y_res * 254 / 100);\n\t}\n\telse\n\t{\n\t\t*xres = 0;\n\t\t*yres = 0;\n\t}\n\treturn 1;\n}\n\nstatic int extract_app13_resolution(jpeg_saved_marker_ptr marker, int *xres, int *yres)\n{\n\tconst unsigned char *data, *data_end;\n\n\tif (!marker || marker->marker != JPEG_APP0 + 13 || marker->data_length < 42 ||\n\t\tstrcmp((const char *)marker->data, \"Photoshop 3.0\") != 0)\n\t{\n\t\treturn 0;\n\t}\n\n\tdata = (const unsigned char *)marker->data;\n\tdata_end = data + marker->data_length;\n\tfor (data += 14; data + 12 < data_end; ) {\n\t\tint data_size = -1;\n\t\tint tag = read_value(data + 4, 2, 1);\n\t\tint value_off = 11 + read_value(data + 6, 2, 1);\n\t\tif (value_off % 2 == 1)\n\t\t\tvalue_off++;\n\t\tif (read_value(data, 4, 1) == 0x3842494D /* 8BIM */ && value_off <= data_end - data)\n\t\t\tdata_size = read_value(data + value_off - 4, 4, 1);\n\t\tif (data_size < 0 || data_size > data_end - data - value_off)\n\t\t\treturn 0;\n\t\tif (tag == 0x3ED && data_size == 16)\n\t\t{\n\t\t\t*xres = read_value(data + value_off, 2, 1);\n\t\t\t*yres = read_value(data + value_off + 8, 2, 1);\n\t\t\treturn 1;\n\t\t}\n\t\tif (data_size % 2 == 1)\n\t\t\tdata_size++;\n\t\tdata += value_off + data_size;\n\t}\n\n\treturn 0;\n}\n\nvoid\nfz_load_jpeg_info(fz_context *ctx, unsigned char *rbuf, int rlen, int *xp, int *yp, int *xresp, int *yresp, fz_colorspace **cspacep)\n{\n\tstruct jpeg_decompress_struct cinfo;\n\tstruct jpeg_error_mgr err;\n\tstruct jpeg_source_mgr src;\n\n\tfz_try(ctx)\n\t{\n\t\tcinfo.client_data = ctx;\n\t\tcinfo.err = jpeg_std_error(&err);\n\t\terr.error_exit = error_exit;\n\n\t\tfz_jpg_mem_init(ctx, &cinfo);\n\n\t\tjpeg_create_decompress(&cinfo);\n\n\t\tcinfo.src = &src;\n\t\tsrc.init_source = init_source;\n\t\tsrc.fill_input_buffer = fill_input_buffer;\n\t\tsrc.skip_input_data = skip_input_data;\n\t\tsrc.resync_to_restart = jpeg_resync_to_restart;\n\t\tsrc.term_source = term_source;\n\t\tsrc.next_input_byte = rbuf;\n\t\tsrc.bytes_in_buffer = rlen;\n\n\t\tjpeg_save_markers(&cinfo, JPEG_APP0+1, 0xffff);\n\t\tjpeg_save_markers(&cinfo, JPEG_APP0+13, 0xffff);\n\n\t\tjpeg_read_header(&cinfo, 1);\n\n\t\tif (cinfo.num_components == 1)\n\t\t\t*cspacep = fz_device_gray(ctx);\n\t\telse if (cinfo.num_components == 3)\n\t\t\t*cspacep = fz_device_rgb(ctx);\n\t\telse if (cinfo.num_components == 4)\n\t\t\t*cspacep = fz_device_cmyk(ctx);\n\t\telse\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"bad number of components in jpeg: %d\", cinfo.num_components);\n\n\t\t*xp = cinfo.image_width;\n\t\t*yp = cinfo.image_height;\n\n\t\tif (extract_exif_resolution(cinfo.marker_list, xresp, yresp))\n\t\t\t/* XPS prefers EXIF resolution to JFIF density */;\n\t\telse if (extract_app13_resolution(cinfo.marker_list, xresp, yresp))\n\t\t\t/* XPS prefers APP13 resolution to JFIF density */;\n\t\telse if (cinfo.density_unit == 1)\n\t\t{\n\t\t\t*xresp = cinfo.X_density;\n\t\t\t*yresp = cinfo.Y_density;\n\t\t}\n\t\telse if (cinfo.density_unit == 2)\n\t\t{\n\t\t\t*xresp = cinfo.X_density * 254 / 100;\n\t\t\t*yresp = cinfo.Y_density * 254 / 100;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t*xresp = 0;\n\t\t\t*yresp = 0;\n\t\t}\n\n\t\tif (*xresp <= 0) *xresp = 96;\n\t\tif (*yresp <= 0) *yresp = 96;\n\t}\n\tfz_always(ctx)\n\t{\n\t\tjpeg_destroy_decompress(&cinfo);\n\t\tfz_jpg_mem_term(&cinfo);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/fitz/load-jpx.c",
    "content": "#include \"mupdf/fitz.h\"\n\n/* Without the definition of OPJ_STATIC, compilation fails on windows\n * due to the use of __stdcall. We believe it is required on some\n * linux toolchains too. */\n#define OPJ_STATIC\n#ifndef _MSC_VER\n#define OPJ_HAVE_STDINT_H\n#endif\n\n#include <openjpeg.h>\n\nstatic void fz_opj_error_callback(const char *msg, void *client_data)\n{\n\tfz_context *ctx = (fz_context *)client_data;\n\tfz_warn(ctx, \"openjpeg error: %s\", msg);\n}\n\nstatic void fz_opj_warning_callback(const char *msg, void *client_data)\n{\n\tfz_context *ctx = (fz_context *)client_data;\n\tfz_warn(ctx, \"openjpeg warning: %s\", msg);\n}\n\nstatic void fz_opj_info_callback(const char *msg, void *client_data)\n{\n\t/* fz_warn(\"openjpeg info: %s\", msg); */\n}\n\ntypedef struct stream_block_s\n{\n\tunsigned char *data;\n\tint size;\n\tint pos;\n} stream_block;\n\nstatic OPJ_SIZE_T fz_opj_stream_read(void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data)\n{\n\tstream_block *sb = (stream_block *)p_user_data;\n\tint len;\n\n\tlen = sb->size - sb->pos;\n\tif (len < 0)\n\t\tlen = 0;\n\tif (len == 0)\n\t\treturn (OPJ_SIZE_T)-1; /* End of file! */\n\tif ((OPJ_SIZE_T)len > p_nb_bytes)\n\t\tlen = p_nb_bytes;\n\tmemcpy(p_buffer, sb->data + sb->pos, len);\n\tsb->pos += len;\n\treturn len;\n}\n\nstatic OPJ_OFF_T fz_opj_stream_skip(OPJ_OFF_T skip, void * p_user_data)\n{\n\tstream_block *sb = (stream_block *)p_user_data;\n\n\tif (skip > sb->size - sb->pos)\n\t\tskip = sb->size - sb->pos;\n\tsb->pos += skip;\n\treturn sb->pos;\n}\n\nstatic OPJ_BOOL fz_opj_stream_seek(OPJ_OFF_T seek_pos, void * p_user_data)\n{\n\tstream_block *sb = (stream_block *)p_user_data;\n\n\tif (seek_pos > sb->size)\n\t\treturn OPJ_FALSE;\n\tsb->pos = seek_pos;\n\treturn OPJ_TRUE;\n}\n\nstatic inline unsigned int read_value(const unsigned char *data, int bytes)\n{\n\tunsigned int value = 0;\n\tfor (; bytes > 0; bytes--)\n\t\tvalue = (value << 8) | *data++;\n\treturn value;\n}\n\nfz_pixmap *\nfz_load_jpx(fz_context *ctx, unsigned char *data, int size, fz_colorspace *defcs, int indexed)\n{\n\tfz_pixmap *img;\n\topj_dparameters_t params;\n\topj_codec_t *codec;\n\topj_image_t *jpx;\n\topj_stream_t *stream;\n\tfz_colorspace *colorspace;\n\tunsigned char *p;\n\tOPJ_CODEC_FORMAT format;\n\tint a, n, w, h, depth, sgnd;\n\tint x, y, k, v;\n\tstream_block sb;\n\n\tif (size < 2)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"not enough data to determine image format\");\n\n\t/* Check for SOC marker -- if found we have a bare J2K stream */\n\tif (data[0] == 0xFF && data[1] == 0x4F)\n\t\tformat = OPJ_CODEC_J2K;\n\telse\n\t\tformat = OPJ_CODEC_JP2;\n\n\topj_set_default_decoder_parameters(&params);\n\tif (indexed)\n\t\tparams.flags |= OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG;\n\n\tcodec = opj_create_decompress(format);\n\topj_set_info_handler(codec, fz_opj_info_callback, ctx);\n\topj_set_warning_handler(codec, fz_opj_warning_callback, ctx);\n\topj_set_error_handler(codec, fz_opj_error_callback, ctx);\n\tif (!opj_setup_decoder(codec, &params))\n\t{\n\t\topj_destroy_codec(codec);\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"j2k decode failed\");\n\t}\n\n\tstream = opj_stream_default_create(OPJ_TRUE);\n\tsb.data = data;\n\tsb.pos = 0;\n\tsb.size = size;\n\n\topj_stream_set_read_function(stream, fz_opj_stream_read);\n\topj_stream_set_skip_function(stream, fz_opj_stream_skip);\n\topj_stream_set_seek_function(stream, fz_opj_stream_seek);\n\topj_stream_set_user_data(stream, &sb, NULL);\n\t/* Set the length to avoid an assert */\n\topj_stream_set_user_data_length(stream, size);\n\n\tif (!opj_read_header(stream, codec, &jpx))\n\t{\n\t\topj_stream_destroy(stream);\n\t\topj_destroy_codec(codec);\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Failed to read JPX header\");\n\t}\n\n\tif (!opj_decode(codec, stream, jpx))\n\t{\n\t\topj_stream_destroy(stream);\n\t\topj_destroy_codec(codec);\n\t\topj_image_destroy(jpx);\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Failed to decode JPX image\");\n\t}\n\n\topj_stream_destroy(stream);\n\topj_destroy_codec(codec);\n\n\t/* jpx should never be NULL here, but check anyway */\n\tif (!jpx)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"opj_decode failed\");\n\n\tfor (k = 1; k < (int)jpx->numcomps; k++)\n\t{\n\t\tif (!jpx->comps[k].data)\n\t\t{\n\t\t\topj_image_destroy(jpx);\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"image components are missing data\");\n\t\t}\n\t\tif (jpx->comps[k].w != jpx->comps[0].w)\n\t\t{\n\t\t\topj_image_destroy(jpx);\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"image components have different width\");\n\t\t}\n\t\tif (jpx->comps[k].h != jpx->comps[0].h)\n\t\t{\n\t\t\topj_image_destroy(jpx);\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"image components have different height\");\n\t\t}\n\t\tif (jpx->comps[k].prec != jpx->comps[0].prec)\n\t\t{\n\t\t\topj_image_destroy(jpx);\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"image components have different precision\");\n\t\t}\n\t}\n\n\tn = jpx->numcomps;\n\tw = jpx->comps[0].w;\n\th = jpx->comps[0].h;\n\tdepth = jpx->comps[0].prec;\n\tsgnd = jpx->comps[0].sgnd;\n\n\tif (jpx->color_space == OPJ_CLRSPC_SRGB && n == 4) { n = 3; a = 1; }\n\telse if (jpx->color_space == OPJ_CLRSPC_SYCC && n == 4) { n = 3; a = 1; }\n\telse if (n == 2) { n = 1; a = 1; }\n\telse if (n > 4) { n = 4; a = 1; }\n\telse { a = 0; }\n\n\tif (defcs)\n\t{\n\t\tif (defcs->n == n)\n\t\t{\n\t\t\tcolorspace = defcs;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_warn(ctx, \"jpx file and dict colorspaces do not match\");\n\t\t\tdefcs = NULL;\n\t\t}\n\t}\n\n\tif (!defcs)\n\t{\n\t\tswitch (n)\n\t\t{\n\t\tcase 1: colorspace = fz_device_gray(ctx); break;\n\t\tcase 3: colorspace = fz_device_rgb(ctx); break;\n\t\tcase 4: colorspace = fz_device_cmyk(ctx); break;\n\t\t}\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\timg = fz_new_pixmap(ctx, colorspace, w, h);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\topj_image_destroy(jpx);\n\t\tfz_rethrow_message(ctx, \"out of memory loading jpx\");\n\t}\n\n\tp = img->samples;\n\tfor (y = 0; y < h; y++)\n\t{\n\t\tfor (x = 0; x < w; x++)\n\t\t{\n\t\t\tfor (k = 0; k < n + a; k++)\n\t\t\t{\n\t\t\t\tv = jpx->comps[k].data[y * w + x];\n\t\t\t\tif (sgnd)\n\t\t\t\t\tv = v + (1 << (depth - 1));\n\t\t\t\tif (depth > 8)\n\t\t\t\t\tv = v >> (depth - 8);\n\t\t\t\t/* cf. http://git.ghostscript.com/?p=mupdf.git;a=commitdiff;h=3722dcf128a98e9e92774b3f8f7326ee2ad98e84 */\n\t\t\t\telse if (depth < 8)\n\t\t\t\t\tv = v << (8 - depth);\n\t\t\t\t*p++ = v;\n\t\t\t}\n\t\t\tif (!a)\n\t\t\t\t*p++ = 255;\n\t\t}\n\t}\n\n\topj_image_destroy(jpx);\n\n\tif (a)\n\t{\n\t\tif (n == 4)\n\t\t{\n\t\t\tfz_pixmap *tmp = fz_new_pixmap(ctx, fz_device_rgb(ctx), w, h);\n\t\t\tfz_convert_pixmap(ctx, tmp, img);\n\t\t\tfz_drop_pixmap(ctx, img);\n\t\t\timg = tmp;\n\t\t}\n\t\tfz_premultiply_pixmap(ctx, img);\n\t}\n\n\t/* SumatraPDF: extract image resolution (TODO: make openjpeg do this) */\n\tif (format == OPJ_CODEC_JP2)\n\t{\n\t\tunsigned char *base = data;\n\t\tint rest = size, ix = 0, level = 0;\n\t\twhile (ix < rest - 8)\n\t\t{\n\t\t\tint lbox = read_value(base + ix, 4);\n\t\t\tunsigned int tbox = read_value(base + ix + 4, 4);\n\t\t\tif (lbox < 8 || lbox > rest - ix)\n\t\t\t{\n\t\t\t\tfz_warn(ctx, \"impossibly small or large JP2 box (%x, %d)\", tbox, lbox);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (level == 0 && tbox == 0x6A703268 /* jp2h */ || level == 1 && tbox == 0x72657320 /* res  */)\n\t\t\t{\n\t\t\t\tbase += ix + 8;\n\t\t\t\trest = lbox - 8;\n\t\t\t\tix = 0;\n\t\t\t\tlevel++;\n\t\t\t}\n\t\t\telse if (level == 2 && tbox == 0x72657363 /* resc */ && lbox == 18 && rest - ix >= 18)\n\t\t\t{\n\t\t\t\tint vrn = read_value((base += ix + 8), 2);\n\t\t\t\tint vrd = read_value(base + 2, 2);\n\t\t\t\tint hrn = read_value(base + 4, 2);\n\t\t\t\tint hrd = read_value(base + 6, 2);\n\t\t\t\tint vre = (char)base[8], hre = (char)base[9];\n\t\t\t\timg->xres = (int)((float)hrn / hrd * pow(10, hre - 2) * 2.54f);\n\t\t\t\timg->yres = (int)((float)vrn / vrd * pow(10, vre - 2) * 2.54f);\n\t\t\t\tif (img->xres <= 0 || img->yres <= 0)\n\t\t\t\t{\n\t\t\t\t\tfz_warn(ctx, \"invalid image resolution (%d, %d)\", img->xres, img->yres);\n\t\t\t\t\timg->xres = img->yres = 96;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tix += lbox;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn img;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/load-jxr.c",
    "content": "#include \"mupdf/fitz.h\"\n\n/* SumatraPDF: support JPEG-XR images */\n\n#ifdef _WIN32\n#define COBJMACROS\n#include <wincodec.h>\n#endif\n\nstatic fz_pixmap *\nfz_load_jxr_or_info(fz_context *ctx, unsigned char *data, int size, int *wp, int *hp, int *xresp, int *yresp, fz_colorspace **cspacep)\n{\n#ifdef _WIN32\n\tint info_only = wp && hp && xresp && yresp && cspacep;\n\tfz_pixmap *pix = NULL;\n\tIStream *stream = NULL;\n\tIWICImagingFactory *factory = NULL;\n\tIWICBitmapDecoder *decoder = NULL;\n\tIWICFormatConverter *converter = NULL;\n\tIWICBitmapFrameDecode *src_frame = NULL;\n\tIWICBitmapSource *src_bitmap = NULL;\n\tint codec_available = 0;\n\tLARGE_INTEGER zero = { 0 };\n\tUINT width, height;\n\tdouble xres, yres;\n\tULONG written;\n\tHRESULT hr;\n\n\thr = CoInitialize(NULL);\n\tif (FAILED(hr))\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"JPEG-XR codec is not available\");\n#define Check(hr) if (FAILED(hr)) goto CleanUp\n\tCheck(CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_ALL, &IID_IWICImagingFactory, (void **)&factory));\n\tCheck(CreateStreamOnHGlobal(NULL, TRUE, &stream));\n\tCheck(IStream_Write(stream, data, (ULONG)size, &written));\n\tCheck(IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL));\n\tCheck(IWICImagingFactory_CreateDecoderFromStream(factory, stream, NULL, WICDecodeMetadataCacheOnDemand, &decoder));\n\tCheck(IWICImagingFactory_CreateFormatConverter(factory, &converter));\n\tCheck(IWICBitmapDecoder_GetFrame(decoder, 0, &src_frame));\n\tCheck(IUnknown_QueryInterface(src_frame, &IID_IWICBitmapSource, &src_bitmap));\n\tCheck(IWICFormatConverter_Initialize(converter, src_bitmap, &GUID_WICPixelFormat32bppBGRA, WICBitmapDitherTypeNone, NULL, 0.f, WICBitmapPaletteTypeCustom));\n\tCheck(IWICFormatConverter_GetSize(converter, &width, &height));\n\tCheck(IWICFormatConverter_GetResolution(converter, &xres, &yres));\n#undef Check\n\tcodec_available = 1;\n\n\tif (info_only)\n\t{\n\t\t*cspacep = fz_device_bgr(ctx);\n\t\t*wp = width;\n\t\t*hp = height;\n\t\t*xresp = (int)(xres + 0.5);\n\t\t*yresp = (int)(yres + 0.5);\n\t}\n\telse\n\t{\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tpix = fz_new_pixmap(ctx, fz_device_bgr(ctx), width, height);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tpix = NULL;\n\t\t\tgoto CleanUp;\n\t\t}\n\t\thr = IWICFormatConverter_CopyPixels(converter, NULL, pix->w * pix->n, pix->w * pix->h * pix->n, pix->samples);\n\t\tif (FAILED(hr))\n\t\t{\n\t\t\tfz_drop_pixmap(ctx, pix);\n\t\t\tpix = NULL;\n\t\t\tgoto CleanUp;\n\t\t}\n\t\tpix->xres = (int)(xres + 0.5);\n\t\tpix->yres = (int)(yres + 0.5);\n\t}\n\nCleanUp:\n#define Release(unk) if (unk) IUnknown_Release(unk)\n\tRelease(src_bitmap);\n\tRelease(converter);\n\tRelease(src_frame);\n\tRelease(decoder);\n\tRelease(factory);\n\tRelease(stream);\n#undef Release\n\tCoUninitialize();\n\n\tif (codec_available)\n\t{\n\t\tif (!pix && !info_only)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"JPEG-XR codec failed to decode the image\");\n\t\treturn pix;\n\t}\n#endif\n\tfz_throw(ctx, FZ_ERROR_GENERIC, \"JPEG-XR codec is not available\");\n}\n\nfz_pixmap *\nfz_load_jxr(fz_context *ctx, unsigned char *data, int size)\n{\n\treturn fz_load_jxr_or_info(ctx, data, size, NULL, NULL, NULL, NULL, NULL);\n}\n\nvoid\nfz_load_jxr_info(fz_context *ctx, unsigned char *data, int size, int *wp, int *hp, int *xresp, int *yresp, fz_colorspace **cspacep)\n{\n\tfz_load_jxr_or_info(ctx, data, size, wp, hp, xresp, yresp, cspacep);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/load-png.c",
    "content": "#include \"mupdf/fitz.h\"\n\n#include <zlib.h>\n\nstruct info\n{\n\tfz_context *ctx;\n\tunsigned int width, height, depth, n;\n\tint interlace, indexed;\n\tunsigned int size;\n\tunsigned char *samples;\n\tunsigned char palette[256*4];\n\tint transparency;\n\tint trns[3];\n\tint xres, yres;\n};\n\nstatic inline unsigned int getuint(unsigned char *p)\n{\n\treturn p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3];\n}\n\nstatic inline int getcomp(unsigned char *line, int x, int bpc)\n{\n\tswitch (bpc)\n\t{\n\tcase 1: return (line[x >> 3] >> ( 7 - (x & 7) ) ) & 1;\n\tcase 2: return (line[x >> 2] >> ( ( 3 - (x & 3) ) << 1 ) ) & 3;\n\tcase 4: return (line[x >> 1] >> ( ( 1 - (x & 1) ) << 2 ) ) & 15;\n\tcase 8: return line[x];\n\tcase 16: return line[x << 1] << 8 | line[(x << 1) + 1];\n\t}\n\treturn 0;\n}\n\nstatic inline void putcomp(unsigned char *line, int x, int bpc, int value)\n{\n\tint maxval = (1 << bpc) - 1;\n\n\tswitch (bpc)\n\t{\n\tcase 1: line[x >> 3] &= ~(maxval << (7 - (x & 7))); break;\n\tcase 2: line[x >> 2] &= ~(maxval << ((3 - (x & 3)) << 1)); break;\n\tcase 4: line[x >> 1] &= ~(maxval << ((1 - (x & 1)) << 2)); break;\n\t}\n\n\tswitch (bpc)\n\t{\n\tcase 1: line[x >> 3] |= value << (7 - (x & 7)); break;\n\tcase 2: line[x >> 2] |= value << ((3 - (x & 3)) << 1); break;\n\tcase 4: line[x >> 1] |= value << ((1 - (x & 1)) << 2); break;\n\tcase 8: line[x] = value; break;\n\tcase 16: line[x << 1] = value >> 8; line[(x << 1) + 1] = value & 0xFF; break;\n\t}\n}\n\nstatic const unsigned char png_signature[8] =\n{\n\t137, 80, 78, 71, 13, 10, 26, 10\n};\n\nstatic void *zalloc(void *opaque, unsigned int items, unsigned int size)\n{\n\treturn fz_malloc_array(opaque, items, size);\n}\n\nstatic void zfree(void *opaque, void *address)\n{\n\tfz_free(opaque, address);\n}\n\nstatic inline int paeth(int a, int b, int c)\n{\n\t/* The definitions of ac and bc are correct, not a typo. */\n\tint ac = b - c, bc = a - c, abcc = ac + bc;\n\tint pa = (ac < 0 ? -ac : ac);\n\tint pb = (bc < 0 ? -bc : bc);\n\tint pc = (abcc < 0 ? -abcc : abcc);\n\treturn pa <= pb && pa <= pc ? a : pb <= pc ? b : c;\n}\n\nstatic void\npng_predict(unsigned char *samples, unsigned int width, unsigned int height, unsigned int n, unsigned int depth)\n{\n\tunsigned int stride = (width * n * depth + 7) / 8;\n\tunsigned int bpp = (n * depth + 7) / 8;\n\tunsigned int i, row;\n\n\tfor (row = 0; row < height; row ++)\n\t{\n\t\tunsigned char *src = samples + (unsigned int)((stride + 1) * row);\n\t\tunsigned char *dst = samples + (unsigned int)(stride * row);\n\n\t\tunsigned char *a = dst;\n\t\tunsigned char *b = dst - stride;\n\t\tunsigned char *c = dst - stride;\n\n\t\tswitch (*src++)\n\t\t{\n\t\tdefault:\n\t\tcase 0: /* None */\n\t\t\tfor (i = 0; i < stride; i++)\n\t\t\t\t*dst++ = *src++;\n\t\t\tbreak;\n\n\t\tcase 1: /* Sub */\n\t\t\tfor (i = 0; i < bpp; i++)\n\t\t\t\t*dst++ = *src++;\n\t\t\tfor (i = bpp; i < stride; i++)\n\t\t\t\t*dst++ = *src++ + *a++;\n\t\t\tbreak;\n\n\t\tcase 2: /* Up */\n\t\t\tif (row == 0)\n\t\t\t\tfor (i = 0; i < stride; i++)\n\t\t\t\t\t*dst++ = *src++;\n\t\t\telse\n\t\t\t\tfor (i = 0; i < stride; i++)\n\t\t\t\t\t*dst++ = *src++ + *b++;\n\t\t\tbreak;\n\n\t\tcase 3: /* Average */\n\t\t\tif (row == 0)\n\t\t\t{\n\t\t\t\tfor (i = 0; i < bpp; i++)\n\t\t\t\t\t*dst++ = *src++;\n\t\t\t\tfor (i = bpp; i < stride; i++)\n\t\t\t\t\t*dst++ = *src++ + (*a++ >> 1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfor (i = 0; i < bpp; i++)\n\t\t\t\t\t*dst++ = *src++ + (*b++ >> 1);\n\t\t\t\tfor (i = bpp; i < stride; i++)\n\t\t\t\t\t*dst++ = *src++ + ((*b++ + *a++) >> 1);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 4: /* Paeth */\n\t\t\tif (row == 0)\n\t\t\t{\n\t\t\t\tfor (i = 0; i < bpp; i++)\n\t\t\t\t\t*dst++ = *src++ + paeth(0, 0, 0);\n\t\t\t\tfor (i = bpp; i < stride; i++)\n\t\t\t\t\t*dst++ = *src++ + paeth(*a++, 0, 0);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfor (i = 0; i < bpp; i++)\n\t\t\t\t\t*dst++ = *src++ + paeth(0, *b++, 0);\n\t\t\t\tfor (i = bpp; i < stride; i++)\n\t\t\t\t\t*dst++ = *src++ + paeth(*a++, *b++, *c++);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\nstatic const unsigned int adam7_ix[7] = { 0, 4, 0, 2, 0, 1, 0 };\nstatic const unsigned int adam7_dx[7] = { 8, 8, 4, 4, 2, 2, 1 };\nstatic const unsigned int adam7_iy[7] = { 0, 0, 4, 0, 2, 0, 1 };\nstatic const unsigned int adam7_dy[7] = { 8, 8, 8, 4, 4, 2, 2 };\n\nstatic void\npng_deinterlace_passes(struct info *info, unsigned int *w, unsigned int *h, unsigned int *ofs)\n{\n\tint p, bpp = info->depth * info->n;\n\tofs[0] = 0;\n\tfor (p = 0; p < 7; p++)\n\t{\n\t\tw[p] = (info->width + adam7_dx[p] - adam7_ix[p] - 1) / adam7_dx[p];\n\t\th[p] = (info->height + adam7_dy[p] - adam7_iy[p] - 1) / adam7_dy[p];\n\t\tif (w[p] == 0) h[p] = 0;\n\t\tif (h[p] == 0) w[p] = 0;\n\t\tif (w[p] && h[p])\n\t\t\tofs[p + 1] = ofs[p] + h[p] * (1 + (w[p] * bpp + 7) / 8);\n\t\telse\n\t\t\tofs[p + 1] = ofs[p];\n\t}\n}\n\nstatic void\npng_deinterlace(struct info *info, unsigned int *passw, unsigned int *passh, unsigned int *passofs)\n{\n\tunsigned int n = info->n;\n\tunsigned int depth = info->depth;\n\tunsigned int stride = (info->width * n * depth + 7) / 8;\n\tunsigned char *output;\n\tunsigned int p, x, y, k;\n\n\toutput = fz_malloc_array(info->ctx, info->height, stride);\n\n\tfor (p = 0; p < 7; p++)\n\t{\n\t\tunsigned char *sp = info->samples + (passofs[p]);\n\t\tunsigned int w = passw[p];\n\t\tunsigned int h = passh[p];\n\n\t\tpng_predict(sp, w, h, n, depth);\n\t\tfor (y = 0; y < h; y++)\n\t\t{\n\t\t\tfor (x = 0; x < w; x++)\n\t\t\t{\n\t\t\t\tint outx = x * adam7_dx[p] + adam7_ix[p];\n\t\t\t\tint outy = y * adam7_dy[p] + adam7_iy[p];\n\t\t\t\tunsigned char *dp = output + outy * stride;\n\t\t\t\tfor (k = 0; k < n; k++)\n\t\t\t\t{\n\t\t\t\t\tint v = getcomp(sp, x * n + k, depth);\n\t\t\t\t\tputcomp(dp, outx * n + k, depth, v);\n\t\t\t\t}\n\t\t\t}\n\t\t\tsp += (w * depth * n + 7) / 8;\n\t\t}\n\t}\n\n\tfz_free(info->ctx, info->samples);\n\tinfo->samples = output;\n}\n\nstatic void\npng_read_ihdr(struct info *info, unsigned char *p, unsigned int size)\n{\n\tint color, compression, filter;\n\n\tif (size != 13)\n\t\tfz_throw(info->ctx, FZ_ERROR_GENERIC, \"IHDR chunk is the wrong size\");\n\n\tinfo->width = getuint(p + 0);\n\tinfo->height = getuint(p + 4);\n\tinfo->depth = p[8];\n\n\tcolor = p[9];\n\tcompression = p[10];\n\tfilter = p[11];\n\tinfo->interlace = p[12];\n\n\tif (info->width <= 0)\n\t\tfz_throw(info->ctx, FZ_ERROR_GENERIC, \"image width must be > 0\");\n\tif (info->height <= 0)\n\t\tfz_throw(info->ctx, FZ_ERROR_GENERIC, \"image height must be > 0\");\n\n\tif (info->depth != 1 && info->depth != 2 && info->depth != 4 &&\n\t\t\tinfo->depth != 8 && info->depth != 16)\n\t\tfz_throw(info->ctx, FZ_ERROR_GENERIC, \"image bit depth must be one of 1, 2, 4, 8, 16\");\n\tif (color == 2 && info->depth < 8)\n\t\tfz_throw(info->ctx, FZ_ERROR_GENERIC, \"illegal bit depth for truecolor\");\n\tif (color == 3 && info->depth > 8)\n\t\tfz_throw(info->ctx, FZ_ERROR_GENERIC, \"illegal bit depth for indexed\");\n\tif (color == 4 && info->depth < 8)\n\t\tfz_throw(info->ctx, FZ_ERROR_GENERIC, \"illegal bit depth for grayscale with alpha\");\n\tif (color == 6 && info->depth < 8)\n\t\tfz_throw(info->ctx, FZ_ERROR_GENERIC, \"illegal bit depth for truecolor with alpha\");\n\n\tinfo->indexed = 0;\n\tif (color == 0) /* gray */\n\t\tinfo->n = 1;\n\telse if (color == 2) /* rgb */\n\t\tinfo->n = 3;\n\telse if (color == 4) /* gray alpha */\n\t\tinfo->n = 2;\n\telse if (color == 6) /* rgb alpha */\n\t\tinfo->n = 4;\n\telse if (color == 3) /* indexed */\n\t{\n\t\tinfo->indexed = 1;\n\t\tinfo->n = 1;\n\t}\n\telse\n\t\tfz_throw(info->ctx, FZ_ERROR_GENERIC, \"unknown color type\");\n\n\tif (compression != 0)\n\t\tfz_throw(info->ctx, FZ_ERROR_GENERIC, \"unknown compression method\");\n\tif (filter != 0)\n\t\tfz_throw(info->ctx, FZ_ERROR_GENERIC, \"unknown filter method\");\n\tif (info->interlace != 0 && info->interlace != 1)\n\t\tfz_throw(info->ctx, FZ_ERROR_GENERIC, \"interlace method not supported\");\n\t/* SumatraPDF: prevent integer overflow */\n\tif (info->height > UINT_MAX / info->width / info->n / (info->depth / 8 + 1))\n\t\tfz_throw(info->ctx, FZ_ERROR_GENERIC, \"image dimensions might overflow\");\n}\n\nstatic void\npng_read_plte(struct info *info, unsigned char *p, unsigned int size)\n{\n\tint n = size / 3;\n\tint i;\n\n\tif (n > 256)\n\t{\n\t\tfz_warn(info->ctx, \"too many samples in palette\");\n\t\tn = 256;\n\t}\n\n\tfor (i = 0; i < n; i++)\n\t{\n\t\tinfo->palette[i * 4] = p[i * 3];\n\t\tinfo->palette[i * 4 + 1] = p[i * 3 + 1];\n\t\tinfo->palette[i * 4 + 2] = p[i * 3 + 2];\n\t}\n\n\t/* Fill in any missing palette entries */\n\tfor (; i < 256; i++)\n\t{\n\t\tinfo->palette[i * 4] = 0;\n\t\tinfo->palette[i * 4 + 1] = 0;\n\t\tinfo->palette[i * 4 + 2] = 0;\n\t}\n}\n\nstatic void\npng_read_trns(struct info *info, unsigned char *p, unsigned int size)\n{\n\tunsigned int i;\n\n\tinfo->transparency = 1;\n\n\tif (info->indexed)\n\t{\n\t\tif (size > 256)\n\t\t{\n\t\t\tfz_warn(info->ctx, \"too many samples in transparency table\");\n\t\t\tsize = 256;\n\t\t}\n\t\tfor (i = 0; i < size; i++)\n\t\t\tinfo->palette[i * 4 + 3] = p[i];\n\t\t/* Fill in any missing entries */\n\t\tfor (; i < 256; i++)\n\t\t\tinfo->palette[i * 4 + 3] = 255;\n\t}\n\telse\n\t{\n\t\tif (size != info->n * 2)\n\t\t\tfz_throw(info->ctx, FZ_ERROR_GENERIC, \"tRNS chunk is the wrong size\");\n\t\tfor (i = 0; i < info->n; i++)\n\t\t\tinfo->trns[i] = (p[i * 2] << 8 | p[i * 2 + 1]) & ((1 << info->depth) - 1);\n\t}\n}\n\nstatic void\npng_read_idat(struct info *info, unsigned char *p, unsigned int size, z_stream *stm)\n{\n\tint code;\n\n\tstm->next_in = p;\n\tstm->avail_in = size;\n\n\tcode = inflate(stm, Z_SYNC_FLUSH);\n\tif (code != Z_OK && code != Z_STREAM_END)\n\t\tfz_throw(info->ctx, FZ_ERROR_GENERIC, \"zlib error: %s\", stm->msg);\n\tif (stm->avail_in != 0)\n\t{\n\t\tif (stm->avail_out == 0)\n\t\t\tfz_throw(info->ctx, FZ_ERROR_GENERIC, \"ran out of output before input\");\n\t\tfz_throw(info->ctx, FZ_ERROR_GENERIC, \"inflate did not consume buffer (%d remaining)\", stm->avail_in);\n\t}\n}\n\nstatic void\npng_read_phys(struct info *info, unsigned char *p, unsigned int size)\n{\n\tif (size != 9)\n\t\tfz_throw(info->ctx, FZ_ERROR_GENERIC, \"pHYs chunk is the wrong size\");\n\tif (p[8] == 1)\n\t{\n\t\tinfo->xres = (getuint(p) * 254 + 5000) / 10000;\n\t\tinfo->yres = (getuint(p + 4) * 254 + 5000) / 10000;\n\t}\n}\n\nstatic void\npng_read_image(fz_context *ctx, struct info *info, unsigned char *p, unsigned int total)\n{\n\tunsigned int passw[7], passh[7], passofs[8];\n\tunsigned int code, size;\n\tz_stream stm;\n\n\tmemset(info, 0, sizeof (struct info));\n\tinfo->ctx = ctx;\n\tmemset(info->palette, 255, sizeof(info->palette));\n\tinfo->xres = 96;\n\tinfo->yres = 96;\n\n\t/* Read signature */\n\n\tif (total < 8 + 12 || memcmp(p, png_signature, 8))\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"not a png image (wrong signature)\");\n\n\tp += 8;\n\ttotal -= 8;\n\n\t/* Read IHDR chunk (must come first) */\n\n\tsize = getuint(p);\n\tif (total < 12 || size > total - 12)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"premature end of data in png image\");\n\n\tif (!memcmp(p + 4, \"IHDR\", 4))\n\t\tpng_read_ihdr(info, p + 8, size);\n\telse\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"png file must start with IHDR chunk\");\n\n\tp += size + 12;\n\ttotal -= size + 12;\n\n\t/* Prepare output buffer */\n\n\tif (!info->interlace)\n\t{\n\t\tinfo->size = info->height * (1 + (info->width * info->n * info->depth + 7) / 8);\n\t}\n\telse\n\t{\n\t\tpng_deinterlace_passes(info, passw, passh, passofs);\n\t\tinfo->size = passofs[7];\n\t}\n\n\tinfo->samples = fz_malloc(ctx, info->size);\n\n\tstm.zalloc = zalloc;\n\tstm.zfree = zfree;\n\tstm.opaque = ctx;\n\n\tstm.next_out = info->samples;\n\tstm.avail_out = info->size;\n\n\tcode = inflateInit(&stm);\n\tif (code != Z_OK)\n\t{\n\t\tfz_free(ctx, info->samples);\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"zlib error: %s\", stm.msg);\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\t/* Read remaining chunks until IEND */\n\t\twhile (total > 8)\n\t\t{\n\t\t\tsize = getuint(p);\n\n\t\t\tif (total < 12 || size > total - 12)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"premature end of data in png image\");\n\n\t\t\tif (!memcmp(p + 4, \"PLTE\", 4))\n\t\t\t\tpng_read_plte(info, p + 8, size);\n\t\t\tif (!memcmp(p + 4, \"tRNS\", 4))\n\t\t\t\tpng_read_trns(info, p + 8, size);\n\t\t\tif (!memcmp(p + 4, \"pHYs\", 4))\n\t\t\t\tpng_read_phys(info, p + 8, size);\n\t\t\tif (!memcmp(p + 4, \"IDAT\", 4))\n\t\t\t\tpng_read_idat(info, p + 8, size, &stm);\n\t\t\tif (!memcmp(p + 4, \"IEND\", 4))\n\t\t\t\tbreak;\n\n\t\t\tp += size + 12;\n\t\t\ttotal -= size + 12;\n\t\t}\n\t\tif (stm.avail_out != 0)\n\t\t{\n\t\t\tmemset(stm.next_out, 0xff, stm.avail_out);\n\t\t\tfz_warn(ctx, \"missing pixel data in png image; possibly truncated\");\n\t\t}\n\t\telse if (total <= 8)\n\t\t\tfz_warn(ctx, \"missing IEND chunk in png image; possibly truncated\");\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tinflateEnd(&stm);\n\t\tfz_free(ctx, info->samples);\n\t\tfz_rethrow(ctx);\n\t}\n\n\tcode = inflateEnd(&stm);\n\tif (code != Z_OK)\n\t{\n\t\tfz_free(ctx, info->samples);\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"zlib error: %s\", stm.msg);\n\t}\n\n\t/* Apply prediction filter and deinterlacing */\n\tfz_try(ctx)\n\t{\n\t\tif (!info->interlace)\n\t\t\tpng_predict(info->samples, info->width, info->height, info->n, info->depth);\n\t\telse\n\t\t\tpng_deinterlace(info, passw, passh, passofs);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, info->samples);\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic fz_pixmap *\npng_expand_palette(fz_context *ctx, struct info *info, fz_pixmap *src)\n{\n\tfz_pixmap *dst = fz_new_pixmap(ctx, fz_device_rgb(ctx), src->w, src->h);\n\tunsigned char *sp = src->samples;\n\tunsigned char *dp = dst->samples;\n\tunsigned int x, y;\n\n\tdst->xres = src->xres;\n\tdst->yres = src->yres;\n\n\tfor (y = info->height; y > 0; y--)\n\t{\n\t\tfor (x = info->width; x > 0; x--)\n\t\t{\n\t\t\tint v = *sp << 2;\n\t\t\t*dp++ = info->palette[v];\n\t\t\t*dp++ = info->palette[v + 1];\n\t\t\t*dp++ = info->palette[v + 2];\n\t\t\t*dp++ = info->palette[v + 3];\n\t\t\tsp += 2;\n\t\t}\n\t}\n\n\tfz_drop_pixmap(info->ctx, src);\n\treturn dst;\n}\n\nstatic void\npng_mask_transparency(struct info *info, fz_pixmap *dst)\n{\n\tunsigned int stride = (info->width * info->n * info->depth + 7) / 8;\n\tunsigned int depth = info->depth;\n\tunsigned int n = info->n;\n\tunsigned int x, y, k, t;\n\n\tfor (y = 0; y < info->height; y++)\n\t{\n\t\tunsigned char *sp = info->samples + (unsigned int)(y * stride);\n\t\tunsigned char *dp = dst->samples + (unsigned int)(y * dst->w * dst->n);\n\t\tfor (x = 0; x < info->width; x++)\n\t\t{\n\t\t\tt = 1;\n\t\t\tfor (k = 0; k < n; k++)\n\t\t\t\tif (getcomp(sp, x * n + k, depth) != info->trns[k])\n\t\t\t\t\tt = 0;\n\t\t\tif (t)\n\t\t\t\tdp[x * dst->n + dst->n - 1] = 0;\n\t\t}\n\t}\n}\n\nfz_pixmap *\nfz_load_png(fz_context *ctx, unsigned char *p, int total)\n{\n\tfz_pixmap *image;\n\tfz_colorspace *colorspace;\n\tstruct info png;\n\tint stride;\n\n\tpng_read_image(ctx, &png, p, total);\n\n\tif (png.n == 3 || png.n == 4)\n\t\tcolorspace = fz_device_rgb(ctx);\n\telse\n\t\tcolorspace = fz_device_gray(ctx);\n\n\tstride = (png.width * png.n * png.depth + 7) / 8;\n\n\tfz_try(ctx)\n\t{\n\t\timage = fz_new_pixmap(ctx, colorspace, png.width, png.height);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(png.ctx, png.samples);\n\t\tfz_rethrow_message(ctx, \"out of memory loading png\");\n\t}\n\n\timage->xres = png.xres;\n\timage->yres = png.yres;\n\n\tfz_unpack_tile(image, png.samples, png.n, png.depth, stride, png.indexed);\n\n\tif (png.indexed)\n\t{\n\t\t/* SumatraPDF: fix memory leak */\n\t\tfz_try(ctx)\n\t\t{\n\t\timage = png_expand_palette(ctx, &png, image);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_free(png.ctx, png.samples);\n\t\t\tfz_drop_pixmap(ctx, image);\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t}\n\telse if (png.transparency)\n\t\tpng_mask_transparency(&png, image);\n\n\tif (png.transparency || png.n == 2 || png.n == 4)\n\t\tfz_premultiply_pixmap(png.ctx, image);\n\n\tfz_free(png.ctx, png.samples);\n\n\treturn image;\n}\n\nvoid\nfz_load_png_info(fz_context *ctx, unsigned char *p, int total, int *wp, int *hp, int *xresp, int *yresp, fz_colorspace **cspacep)\n{\n\tstruct info png;\n\n\tpng_read_image(ctx, &png, p, total);\n\n\tif (png.n == 3 || png.n == 4)\n\t\t*cspacep = fz_device_rgb(ctx);\n\telse\n\t\t*cspacep = fz_device_gray(ctx);\n\n\t*wp = png.width;\n\t*hp = png.height;\n\t*xresp = png.xres;\n\t*yresp = png.xres;\n\tfz_free(png.ctx, png.samples);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/load-tiff.c",
    "content": "#include \"mupdf/fitz.h\"\n\n/*\n * TIFF image loader. Should be enough to support TIFF files in XPS.\n * Baseline TIFF 6.0 plus CMYK, LZW, Flate and JPEG support.\n * Limited bit depths (1,2,4,8).\n * Limited planar configurations (1=chunky).\n * No tiles (easy fix if necessary).\n * TODO: RGBPal images\n */\n\nstruct tiff\n{\n\tfz_context *ctx;\n\n\t/* \"file\" */\n\tunsigned char *bp, *rp, *ep;\n\n\t/* byte order */\n\tunsigned order;\n\n\t/* offset of first ifd */\n\tunsigned ifd_offset;\n\n\t/* where we can find the strips of image data */\n\tunsigned rowsperstrip;\n\tunsigned *stripoffsets;\n\tunsigned *stripbytecounts;\n\n\t/* colormap */\n\tunsigned *colormap;\n\n\tunsigned stripoffsetslen;\n\tunsigned stripbytecountslen;\n\tunsigned colormaplen;\n\n\t/* assorted tags */\n\tunsigned subfiletype;\n\tunsigned photometric;\n\tunsigned compression;\n\tunsigned imagewidth;\n\tunsigned imagelength;\n\tunsigned samplesperpixel;\n\tunsigned bitspersample;\n\tunsigned planar;\n\tunsigned extrasamples;\n\tunsigned xresolution;\n\tunsigned yresolution;\n\tunsigned resolutionunit;\n\tunsigned fillorder;\n\tunsigned g3opts;\n\tunsigned g4opts;\n\tunsigned predictor;\n\n\tunsigned ycbcrsubsamp[2];\n\n\tunsigned char *jpegtables; /* point into \"file\" buffer */\n\tunsigned jpegtableslen;\n\n\tunsigned char *profile;\n\tint profilesize;\n\n\t/* decoded data */\n\tfz_colorspace *colorspace;\n\tunsigned char *samples;\n\tint stride;\n};\n\nenum\n{\n\tTII = 0x4949, /* 'II' */\n\tTMM = 0x4d4d, /* 'MM' */\n\tTBYTE = 1,\n\tTASCII = 2,\n\tTSHORT = 3,\n\tTLONG = 4,\n\tTRATIONAL = 5\n};\n\n#define NewSubfileType 254\n#define ImageWidth 256\n#define ImageLength 257\n#define BitsPerSample 258\n#define Compression 259\n#define PhotometricInterpretation 262\n#define FillOrder 266\n#define StripOffsets 273\n#define SamplesPerPixel 277\n#define RowsPerStrip 278\n#define StripByteCounts 279\n#define XResolution 282\n#define YResolution 283\n#define PlanarConfiguration 284\n#define T4Options 292\n#define T6Options 293\n#define ResolutionUnit 296\n#define Predictor 317\n#define ColorMap 320\n#define TileWidth 322\n#define TileLength 323\n#define TileOffsets 324\n#define TileByteCounts 325\n#define ExtraSamples 338\n#define JPEGTables 347\n#define YCbCrSubSampling 520\n#define ICCProfile 34675\n\nstatic const unsigned char bitrev[256] =\n{\n\t0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,\n\t0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,\n\t0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,\n\t0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,\n\t0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,\n\t0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,\n\t0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,\n\t0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,\n\t0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,\n\t0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,\n\t0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,\n\t0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,\n\t0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,\n\t0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,\n\t0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,\n\t0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,\n\t0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,\n\t0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,\n\t0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,\n\t0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,\n\t0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,\n\t0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,\n\t0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,\n\t0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,\n\t0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,\n\t0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,\n\t0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,\n\t0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,\n\t0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,\n\t0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,\n\t0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,\n\t0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff\n};\n\nstatic void\nfz_decode_tiff_uncompressed(struct tiff *tiff, fz_stream *stm, unsigned char *wp, int wlen)\n{\n\tfz_read(stm, wp, wlen);\n\tfz_close(stm);\n}\n\nstatic void\nfz_decode_tiff_packbits(struct tiff *tiff, fz_stream *chain, unsigned char *wp, int wlen)\n{\n\tfz_stream *stm = fz_open_rld(chain);\n\tfz_read(stm, wp, wlen);\n\tfz_close(stm);\n}\n\nstatic void\nfz_decode_tiff_lzw(struct tiff *tiff, fz_stream *chain, unsigned char *wp, int wlen)\n{\n\tfz_stream *stm = fz_open_lzwd(chain, 1);\n\tfz_read(stm, wp, wlen);\n\tfz_close(stm);\n}\n\nstatic void\nfz_decode_tiff_flate(struct tiff *tiff, fz_stream *chain, unsigned char *wp, int wlen)\n{\n\tfz_stream *stm = fz_open_flated(chain, 15);\n\tfz_read(stm, wp, wlen);\n\tfz_close(stm);\n}\n\nstatic void\nfz_decode_tiff_fax(struct tiff *tiff, int comp, fz_stream *chain, unsigned char *wp, int wlen)\n{\n\tfz_stream *stm;\n\tint black_is_1 = tiff->photometric == 0;\n\tint k = comp == 4 ? -1 : 0;\n\tint encoded_byte_align = comp == 2;\n\tstm = fz_open_faxd(chain,\n\t\t\tk, 0, encoded_byte_align,\n\t\t\ttiff->imagewidth, tiff->imagelength, 0, black_is_1);\n\tfz_read(stm, wp, wlen);\n\tfz_close(stm);\n}\n\nstatic void\nfz_decode_tiff_jpeg(struct tiff *tiff, fz_stream *chain, unsigned char *wp, int wlen)\n{\n\tfz_stream *stm;\n\tfz_stream *jpegtables = NULL;\n\tint color_transform = -1; /* unset */\n\tif (tiff->jpegtables && (int)tiff->jpegtableslen > 0)\n\t\tjpegtables = fz_open_memory(tiff->ctx, tiff->jpegtables, (int)tiff->jpegtableslen);\n\tif (tiff->photometric == 2 /* RGB */ || tiff->photometric == 3 /* RGBPal */)\n\t\tcolor_transform = 0;\n\tstm = fz_open_dctd(chain, color_transform, 0, jpegtables);\n\tfz_read(stm, wp, wlen);\n\tfz_close(stm);\n}\n\nstatic inline int getcomp(unsigned char *line, int x, int bpc)\n{\n\tswitch (bpc)\n\t{\n\tcase 1: return (line[x >> 3] >> ( 7 - (x & 7) ) ) & 1;\n\tcase 2: return (line[x >> 2] >> ( ( 3 - (x & 3) ) << 1 ) ) & 3;\n\tcase 4: return (line[x >> 1] >> ( ( 1 - (x & 1) ) << 2 ) ) & 15;\n\tcase 8: return line[x];\n\tcase 16: return line[x << 1] << 8 | line[(x << 1) + 1];\n\t}\n\treturn 0;\n}\n\nstatic inline void putcomp(unsigned char *line, int x, int bpc, int value)\n{\n\tint maxval = (1 << bpc) - 1;\n\n\tswitch (bpc)\n\t{\n\tcase 1: line[x >> 3] &= ~(maxval << (7 - (x & 7))); break;\n\tcase 2: line[x >> 2] &= ~(maxval << ((3 - (x & 3)) << 1)); break;\n\tcase 4: line[x >> 1] &= ~(maxval << ((1 - (x & 1)) << 2)); break;\n\t}\n\n\tswitch (bpc)\n\t{\n\tcase 1: line[x >> 3] |= value << (7 - (x & 7)); break;\n\tcase 2: line[x >> 2] |= value << ((3 - (x & 3)) << 1); break;\n\tcase 4: line[x >> 1] |= value << ((1 - (x & 1)) << 2); break;\n\tcase 8: line[x] = value; break;\n\tcase 16: line[x << 1] = value >> 8; line[(x << 1) + 1] = value & 0xFF; break;\n\t}\n}\n\nstatic void\nfz_unpredict_tiff(unsigned char *line, int width, int comps, int bits)\n{\n\tunsigned char left[32];\n\tint i, k, v;\n\n\tfor (k = 0; k < comps; k++)\n\t\tleft[k] = 0;\n\n\tfor (i = 0; i < width; i++)\n\t{\n\t\tfor (k = 0; k < comps; k++)\n\t\t{\n\t\t\tv = getcomp(line, i * comps + k, bits);\n\t\t\tv = v + left[k];\n\t\t\tv = v % (1 << bits);\n\t\t\tputcomp(line, i * comps + k, bits, v);\n\t\t\tleft[k] = v;\n\t\t}\n\t}\n}\n\nstatic void\nfz_invert_tiff(unsigned char *line, int width, int comps, int bits, int alpha)\n{\n\tint i, k, v;\n\tint m = (1 << bits) - 1;\n\n\tfor (i = 0; i < width; i++)\n\t{\n\t\tfor (k = 0; k < comps; k++)\n\t\t{\n\t\t\tv = getcomp(line, i * comps + k, bits);\n\t\t\tif (!alpha || k < comps - 1)\n\t\t\t\tv = m - v;\n\t\t\tputcomp(line, i * comps + k, bits, v);\n\t\t}\n\t}\n}\n\nstatic void\nfz_expand_tiff_colormap(struct tiff *tiff)\n{\n\tint maxval = 1 << tiff->bitspersample;\n\tunsigned char *samples;\n\tunsigned char *src, *dst;\n\tunsigned int x, y;\n\tunsigned int stride;\n\n\t/* colormap has first all red, then all green, then all blue values */\n\t/* colormap values are 0..65535, bits is 4 or 8 */\n\t/* image can be with or without extrasamples: comps is 1 or 2 */\n\n\tif (tiff->samplesperpixel != 1 && tiff->samplesperpixel != 2)\n\t\tfz_throw(tiff->ctx, FZ_ERROR_GENERIC, \"invalid number of samples for RGBPal\");\n\n\tif (tiff->bitspersample != 1 && tiff->bitspersample != 4 && tiff->bitspersample != 8)\n\t\tfz_throw(tiff->ctx, FZ_ERROR_GENERIC, \"invalid number of bits for RGBPal\");\n\n\tif (tiff->colormaplen < (unsigned)maxval * 3)\n\t\tfz_throw(tiff->ctx, FZ_ERROR_GENERIC, \"insufficient colormap data\");\n\n\t/* SumatraPDF: prevent integer overflow */\n\tif (tiff->imagelength > UINT_MAX / tiff->imagewidth / (tiff->samplesperpixel + 2))\n\t\tfz_throw(tiff->ctx, FZ_ERROR_GENERIC, \"image dimensions might overflow\");\n\n\tstride = tiff->imagewidth * (tiff->samplesperpixel + 2);\n\n\tsamples = fz_malloc(tiff->ctx, stride * tiff->imagelength);\n\n\tfor (y = 0; y < tiff->imagelength; y++)\n\t{\n\t\tsrc = tiff->samples + (unsigned int)(tiff->stride * y);\n\t\tdst = samples + (unsigned int)(stride * y);\n\n\t\tfor (x = 0; x < tiff->imagewidth; x++)\n\t\t{\n\t\t\tif (tiff->extrasamples)\n\t\t\t{\n\t\t\t\tint c = getcomp(src, x * 2, tiff->bitspersample);\n\t\t\t\tint a = getcomp(src, x * 2 + 1, tiff->bitspersample);\n\t\t\t\t*dst++ = tiff->colormap[c + 0] >> 8;\n\t\t\t\t*dst++ = tiff->colormap[c + maxval] >> 8;\n\t\t\t\t*dst++ = tiff->colormap[c + maxval * 2] >> 8;\n\t\t\t\t*dst++ = a << (8 - tiff->bitspersample);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tint c = getcomp(src, x, tiff->bitspersample);\n\t\t\t\t*dst++ = tiff->colormap[c + 0] >> 8;\n\t\t\t\t*dst++ = tiff->colormap[c + maxval] >> 8;\n\t\t\t\t*dst++ = tiff->colormap[c + maxval * 2] >> 8;\n\t\t\t}\n\t\t}\n\t}\n\n\ttiff->samplesperpixel += 2;\n\ttiff->bitspersample = 8;\n\ttiff->stride = stride;\n\tfz_free(tiff->ctx, tiff->samples);\n\ttiff->samples = samples;\n}\n\nstatic void\nfz_decode_tiff_strips(struct tiff *tiff)\n{\n\tfz_stream *stm;\n\n\t/* switch on compression to create a filter */\n\t/* feed each strip to the filter */\n\t/* read out the data and pack the samples into a pixmap */\n\n\t/* type 32773 / packbits -- nothing special (same row-padding as PDF) */\n\t/* type 2 / ccitt rle -- no EOL, no RTC, rows are byte-aligned */\n\t/* type 3 and 4 / g3 and g4 -- each strip starts new section */\n\t/* type 5 / lzw -- each strip is handled separately */\n\n\tunsigned char *wp;\n\tunsigned row;\n\tunsigned strip;\n\tunsigned i;\n\n\tif (!tiff->rowsperstrip || !tiff->stripoffsets || !tiff->stripbytecounts)\n\t\tfz_throw(tiff->ctx, FZ_ERROR_GENERIC, \"no image data in tiff; maybe it is tiled\");\n\n\tif (tiff->stripoffsetslen < (tiff->imagelength - 1) / tiff->rowsperstrip + 1 ||\n\t\ttiff->stripbytecountslen < (tiff->imagelength - 1) / tiff->rowsperstrip + 1)\n\t\tfz_throw(tiff->ctx, FZ_ERROR_GENERIC, \"insufficient strip offset data\");\n\n\tif (tiff->planar != 1)\n\t\tfz_throw(tiff->ctx, FZ_ERROR_GENERIC, \"image data is not in chunky format\");\n\n\t/* SumatraPDF: prevent integer overflow */\n\tif (tiff->imagelength > UINT_MAX / tiff->imagewidth / tiff->samplesperpixel / (tiff->bitspersample / 8 + 1))\n\t\tfz_throw(tiff->ctx, FZ_ERROR_GENERIC, \"image dimensions might overflow\");\n\n\ttiff->stride = (tiff->imagewidth * tiff->samplesperpixel * tiff->bitspersample + 7) / 8;\n\n\tswitch (tiff->photometric)\n\t{\n\tcase 0: /* WhiteIsZero -- inverted */\n\t\ttiff->colorspace = fz_device_gray(tiff->ctx);\n\t\tbreak;\n\tcase 1: /* BlackIsZero */\n\t\ttiff->colorspace = fz_device_gray(tiff->ctx);\n\t\tbreak;\n\tcase 2: /* RGB */\n\t\ttiff->colorspace = fz_device_rgb(tiff->ctx);\n\t\tbreak;\n\tcase 3: /* RGBPal */\n\t\ttiff->colorspace = fz_device_rgb(tiff->ctx);\n\t\tbreak;\n\tcase 5: /* CMYK */\n\t\ttiff->colorspace = fz_device_cmyk(tiff->ctx);\n\t\tbreak;\n\tcase 6: /* YCbCr */\n\t\t/* it's probably a jpeg ... we let jpeg convert to rgb */\n\t\ttiff->colorspace = fz_device_rgb(tiff->ctx);\n\t\tbreak;\n\tdefault:\n\t\tfz_throw(tiff->ctx, FZ_ERROR_GENERIC, \"unknown photometric: %d\", tiff->photometric);\n\t}\n\n\tswitch (tiff->resolutionunit)\n\t{\n\tcase 2:\n\t\t/* no unit conversion needed */\n\t\tbreak;\n\tcase 3:\n\t\ttiff->xresolution = tiff->xresolution * 254 / 100;\n\t\ttiff->yresolution = tiff->yresolution * 254 / 100;\n\t\tbreak;\n\tdefault:\n\t\ttiff->xresolution = 96;\n\t\ttiff->yresolution = 96;\n\t\tbreak;\n\t}\n\n\t/* Note xres and yres could be 0 even if unit was set. If so default to 96dpi. */\n\tif (tiff->xresolution == 0 || tiff->yresolution == 0)\n\t{\n\t\ttiff->xresolution = 96;\n\t\ttiff->yresolution = 96;\n\t}\n\n\ttiff->samples = fz_malloc_array(tiff->ctx, tiff->imagelength, tiff->stride);\n\tmemset(tiff->samples, 0x55, tiff->imagelength * tiff->stride);\n\twp = tiff->samples;\n\n\tstrip = 0;\n\tfor (row = 0; row < tiff->imagelength; row += tiff->rowsperstrip)\n\t{\n\t\tunsigned offset = tiff->stripoffsets[strip];\n\t\tunsigned rlen = tiff->stripbytecounts[strip];\n\t\tunsigned wlen = tiff->stride * tiff->rowsperstrip;\n\t\tunsigned char *rp = tiff->bp + offset;\n\n\t\tif (wp + wlen > tiff->samples + (unsigned int)(tiff->stride * tiff->imagelength))\n\t\t\twlen = tiff->samples + (unsigned int)(tiff->stride * tiff->imagelength) - wp;\n\n\t\tif (rp + rlen > tiff->ep)\n\t\t\tfz_throw(tiff->ctx, FZ_ERROR_GENERIC, \"strip extends beyond the end of the file\");\n\n\t\t/* the bits are in un-natural order */\n\t\tif (tiff->fillorder == 2)\n\t\t\tfor (i = 0; i < rlen; i++)\n\t\t\t\trp[i] = bitrev[rp[i]];\n\n\t\t/* the strip decoders will close this */\n\t\tstm = fz_open_memory(tiff->ctx, rp, rlen);\n\n\t\t/* SumatraPDF: TODO: if any of the following throws, the stream is leaked (including any chained streams) */\n\t\tswitch (tiff->compression)\n\t\t{\n\t\tcase 1:\n\t\t\tfz_decode_tiff_uncompressed(tiff, stm, wp, wlen);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tfz_decode_tiff_fax(tiff, 2, stm, wp, wlen);\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tfz_decode_tiff_fax(tiff, 3, stm, wp, wlen);\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tfz_decode_tiff_fax(tiff, 4, stm, wp, wlen);\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tfz_decode_tiff_lzw(tiff, stm, wp, wlen);\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tfz_warn(tiff->ctx, \"deprecated JPEG in TIFF compression not fully supported\");\n\t\t\t/* fall through */\n\t\tcase 7:\n\t\t\tfz_decode_tiff_jpeg(tiff, stm, wp, wlen);\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tfz_decode_tiff_flate(tiff, stm, wp, wlen);\n\t\t\tbreak;\n\t\tcase 32773:\n\t\t\tfz_decode_tiff_packbits(tiff, stm, wp, wlen);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tfz_throw(tiff->ctx, FZ_ERROR_GENERIC, \"unknown TIFF compression: %d\", tiff->compression);\n\t\t}\n\n\t\t/* scramble the bits back into original order */\n\t\tif (tiff->fillorder == 2)\n\t\t\tfor (i = 0; i < rlen; i++)\n\t\t\t\trp[i] = bitrev[rp[i]];\n\n\t\twp += tiff->stride * tiff->rowsperstrip;\n\t\tstrip ++;\n\t}\n\n\t/* Predictor (only for LZW and Flate) */\n\tif ((tiff->compression == 5 || tiff->compression == 8) && tiff->predictor == 2)\n\t{\n\t\tunsigned char *p = tiff->samples;\n\t\tfor (i = 0; i < tiff->imagelength; i++)\n\t\t{\n\t\t\tfz_unpredict_tiff(p, tiff->imagewidth, tiff->samplesperpixel, tiff->bitspersample);\n\t\t\tp += tiff->stride;\n\t\t}\n\t}\n\n\t/* RGBPal */\n\tif (tiff->photometric == 3 && tiff->colormap)\n\t\tfz_expand_tiff_colormap(tiff);\n\n\t/* WhiteIsZero .. invert */\n\tif (tiff->photometric == 0)\n\t{\n\t\tunsigned char *p = tiff->samples;\n\t\tfor (i = 0; i < tiff->imagelength; i++)\n\t\t{\n\t\t\tfz_invert_tiff(p, tiff->imagewidth, tiff->samplesperpixel, tiff->bitspersample, tiff->extrasamples);\n\t\t\tp += tiff->stride;\n\t\t}\n\t}\n\n\t/* Premultiplied transparency */\n\tif (tiff->extrasamples == 1)\n\t{\n\t\t/* In GhostXPS we undo the premultiplication here; muxps holds\n\t\t * all our images premultiplied by default, so nothing to do.\n\t\t */\n\t}\n\n\t/* Non-premultiplied transparency */\n\tif (tiff->extrasamples == 2)\n\t{\n\t\t/* Premultiplied files are corrected for elsewhere */\n\t}\n}\n\nstatic inline int readbyte(struct tiff *tiff)\n{\n\tif (tiff->rp < tiff->ep)\n\t\treturn *tiff->rp++;\n\treturn EOF;\n}\n\nstatic inline unsigned readshort(struct tiff *tiff)\n{\n\tunsigned a = readbyte(tiff);\n\tunsigned b = readbyte(tiff);\n\tif (tiff->order == TII)\n\t\treturn (b << 8) | a;\n\treturn (a << 8) | b;\n}\n\nstatic inline unsigned readlong(struct tiff *tiff)\n{\n\tunsigned a = readbyte(tiff);\n\tunsigned b = readbyte(tiff);\n\tunsigned c = readbyte(tiff);\n\tunsigned d = readbyte(tiff);\n\tif (tiff->order == TII)\n\t\treturn (d << 24) | (c << 16) | (b << 8) | a;\n\treturn (a << 24) | (b << 16) | (c << 8) | d;\n}\n\nstatic void\nfz_read_tiff_bytes(unsigned char *p, struct tiff *tiff, unsigned ofs, unsigned n)\n{\n\ttiff->rp = tiff->bp + ofs;\n\tif (tiff->rp > tiff->ep)\n\t\ttiff->rp = tiff->bp;\n\n\twhile (n--)\n\t\t*p++ = readbyte(tiff);\n}\n\nstatic void\nfz_read_tiff_tag_value(unsigned *p, struct tiff *tiff, unsigned type, unsigned ofs, unsigned n)\n{\n\ttiff->rp = tiff->bp + ofs;\n\tif (tiff->rp > tiff->ep)\n\t\ttiff->rp = tiff->bp;\n\n\twhile (n--)\n\t{\n\t\tswitch (type)\n\t\t{\n\t\tcase TRATIONAL:\n\t\t\t*p = readlong(tiff);\n\t\t\t*p = *p / readlong(tiff);\n\t\t\tp ++;\n\t\t\tbreak;\n\t\tcase TBYTE: *p++ = readbyte(tiff); break;\n\t\tcase TSHORT: *p++ = readshort(tiff); break;\n\t\tcase TLONG: *p++ = readlong(tiff); break;\n\t\tdefault: *p++ = 0; break;\n\t\t}\n\t}\n}\n\nstatic void\nfz_read_tiff_tag(struct tiff *tiff, unsigned offset)\n{\n\tunsigned tag;\n\tunsigned type;\n\tunsigned count;\n\tunsigned value;\n\n\ttiff->rp = tiff->bp + offset;\n\n\ttag = readshort(tiff);\n\ttype = readshort(tiff);\n\tcount = readlong(tiff);\n\n\tif ((type == TBYTE && count <= 4) ||\n\t\t\t(type == TSHORT && count <= 2) ||\n\t\t\t(type == TLONG && count <= 1))\n\t\tvalue = tiff->rp - tiff->bp;\n\telse\n\t\tvalue = readlong(tiff);\n\n\tswitch (tag)\n\t{\n\tcase NewSubfileType:\n\t\tfz_read_tiff_tag_value(&tiff->subfiletype, tiff, type, value, 1);\n\t\tbreak;\n\tcase ImageWidth:\n\t\tfz_read_tiff_tag_value(&tiff->imagewidth, tiff, type, value, 1);\n\t\tbreak;\n\tcase ImageLength:\n\t\tfz_read_tiff_tag_value(&tiff->imagelength, tiff, type, value, 1);\n\t\tbreak;\n\tcase BitsPerSample:\n\t\tfz_read_tiff_tag_value(&tiff->bitspersample, tiff, type, value, 1);\n\t\tbreak;\n\tcase Compression:\n\t\tfz_read_tiff_tag_value(&tiff->compression, tiff, type, value, 1);\n\t\tbreak;\n\tcase PhotometricInterpretation:\n\t\tfz_read_tiff_tag_value(&tiff->photometric, tiff, type, value, 1);\n\t\tbreak;\n\tcase FillOrder:\n\t\tfz_read_tiff_tag_value(&tiff->fillorder, tiff, type, value, 1);\n\t\tbreak;\n\tcase SamplesPerPixel:\n\t\tfz_read_tiff_tag_value(&tiff->samplesperpixel, tiff, type, value, 1);\n\t\tbreak;\n\tcase RowsPerStrip:\n\t\tfz_read_tiff_tag_value(&tiff->rowsperstrip, tiff, type, value, 1);\n\t\tbreak;\n\tcase XResolution:\n\t\tfz_read_tiff_tag_value(&tiff->xresolution, tiff, type, value, 1);\n\t\tbreak;\n\tcase YResolution:\n\t\tfz_read_tiff_tag_value(&tiff->yresolution, tiff, type, value, 1);\n\t\tbreak;\n\tcase PlanarConfiguration:\n\t\tfz_read_tiff_tag_value(&tiff->planar, tiff, type, value, 1);\n\t\tbreak;\n\tcase T4Options:\n\t\tfz_read_tiff_tag_value(&tiff->g3opts, tiff, type, value, 1);\n\t\tbreak;\n\tcase T6Options:\n\t\tfz_read_tiff_tag_value(&tiff->g4opts, tiff, type, value, 1);\n\t\tbreak;\n\tcase Predictor:\n\t\tfz_read_tiff_tag_value(&tiff->predictor, tiff, type, value, 1);\n\t\tbreak;\n\tcase ResolutionUnit:\n\t\tfz_read_tiff_tag_value(&tiff->resolutionunit, tiff, type, value, 1);\n\t\tbreak;\n\tcase YCbCrSubSampling:\n\t\tfz_read_tiff_tag_value(tiff->ycbcrsubsamp, tiff, type, value, 2);\n\t\tbreak;\n\tcase ExtraSamples:\n\t\tfz_read_tiff_tag_value(&tiff->extrasamples, tiff, type, value, 1);\n\t\tbreak;\n\n\tcase ICCProfile:\n\t\ttiff->profile = fz_malloc(tiff->ctx, count);\n\t\t/* ICC profile data type is set to UNDEFINED.\n\t\t * TBYTE reading not correct in fz_read_tiff_tag_value */\n\t\tfz_read_tiff_bytes(tiff->profile, tiff, value, count);\n\t\ttiff->profilesize = count;\n\t\tbreak;\n\n\tcase JPEGTables:\n\t\ttiff->jpegtables = tiff->bp + value;\n\t\ttiff->jpegtableslen = count;\n\t\tbreak;\n\n\tcase StripOffsets:\n\t\ttiff->stripoffsets = fz_malloc_array(tiff->ctx, count, sizeof(unsigned));\n\t\tfz_read_tiff_tag_value(tiff->stripoffsets, tiff, type, value, count);\n\t\ttiff->stripoffsetslen = count;\n\t\tbreak;\n\n\tcase StripByteCounts:\n\t\ttiff->stripbytecounts = fz_malloc_array(tiff->ctx, count, sizeof(unsigned));\n\t\tfz_read_tiff_tag_value(tiff->stripbytecounts, tiff, type, value, count);\n\t\ttiff->stripbytecountslen = count;\n\t\tbreak;\n\n\tcase ColorMap:\n\t\ttiff->colormap = fz_malloc_array(tiff->ctx, count, sizeof(unsigned));\n\t\tfz_read_tiff_tag_value(tiff->colormap, tiff, type, value, count);\n\t\ttiff->colormaplen = count;\n\t\tbreak;\n\n\tcase TileWidth:\n\tcase TileLength:\n\tcase TileOffsets:\n\tcase TileByteCounts:\n\t\tfz_throw(tiff->ctx, FZ_ERROR_GENERIC, \"tiled tiffs not supported\");\n\n\tdefault:\n\t\t/* fz_warn(tiff->ctx, \"unknown tag: %d t=%d n=%d\", tag, type, count); */\n\t\tbreak;\n\t}\n}\n\nstatic void\nfz_swap_tiff_byte_order(unsigned char *buf, int n)\n{\n\tint i, t;\n\tfor (i = 0; i < n; i++)\n\t{\n\t\tt = buf[i * 2 + 0];\n\t\tbuf[i * 2 + 0] = buf[i * 2 + 1];\n\t\tbuf[i * 2 + 1] = t;\n\t}\n}\n\nstatic void\nfz_decode_tiff_header(fz_context *ctx, struct tiff *tiff, unsigned char *buf, int len)\n{\n\tunsigned version;\n\n\tmemset(tiff, 0, sizeof(struct tiff));\n\ttiff->ctx = ctx;\n\ttiff->bp = buf;\n\ttiff->rp = buf;\n\ttiff->ep = buf + len;\n\n\t/* tag defaults, where applicable */\n\ttiff->bitspersample = 1;\n\ttiff->compression = 1;\n\ttiff->samplesperpixel = 1;\n\ttiff->resolutionunit = 2;\n\ttiff->rowsperstrip = 0xFFFFFFFF;\n\ttiff->fillorder = 1;\n\ttiff->planar = 1;\n\ttiff->subfiletype = 0;\n\ttiff->predictor = 1;\n\ttiff->ycbcrsubsamp[0] = 2;\n\ttiff->ycbcrsubsamp[1] = 2;\n\n\t/*\n\t * Read IFH\n\t */\n\n\t/* get byte order marker */\n\ttiff->order = TII;\n\ttiff->order = readshort(tiff);\n\tif (tiff->order != TII && tiff->order != TMM)\n\t\tfz_throw(tiff->ctx, FZ_ERROR_GENERIC, \"not a TIFF file, wrong magic marker\");\n\n\t/* check version */\n\tversion = readshort(tiff);\n\tif (version != 42)\n\t\tfz_throw(tiff->ctx, FZ_ERROR_GENERIC, \"not a TIFF file, wrong version marker\");\n\n\t/* get offset of IFD */\n\ttiff->ifd_offset = readlong(tiff);\n}\n\nstatic unsigned\nfz_next_ifd(fz_context *ctx, struct tiff *tiff, unsigned offset)\n{\n\tunsigned count;\n\n\ttiff->rp = tiff->bp + offset;\n\n\tif (tiff->rp <= tiff->bp || tiff->rp > tiff->ep)\n\t\tfz_throw(tiff->ctx, FZ_ERROR_GENERIC, \"invalid IFD offset %u\", offset);\n\n\tcount = readshort(tiff);\n\n\tif (count * 12 > (unsigned)(tiff->ep - tiff->rp))\n\t\tfz_throw(tiff->ctx, FZ_ERROR_GENERIC, \"overlarge IFD entry count %u\", count);\n\n\ttiff->rp += count * 12;\n\toffset = readlong(tiff);\n\n\treturn offset;\n}\n\nstatic void\nfz_seek_ifd(fz_context *ctx, struct tiff *tiff, int subimage)\n{\n\tunsigned offset = tiff->ifd_offset;\n\n\twhile (subimage--)\n\t{\n\t\toffset = fz_next_ifd(ctx, tiff, offset);\n\n\t\tif (offset == 0)\n\t\t\tfz_throw(tiff->ctx, FZ_ERROR_GENERIC, \"subimage index %i out of range\", subimage);\n\t}\n\n\ttiff->rp = tiff->bp + offset;\n\n\tif (tiff->rp < tiff->bp || tiff->rp > tiff->ep)\n\t\tfz_throw(tiff->ctx, FZ_ERROR_GENERIC, \"invalid IFD offset %u\", tiff->ifd_offset);\n}\n\nstatic void\nfz_decode_tiff_ifd(fz_context *ctx, struct tiff *tiff)\n{\n\tunsigned offset;\n\tunsigned count;\n\tunsigned i;\n\n\toffset = tiff->rp - tiff->bp;\n\n\tcount = readshort(tiff);\n\n\tif (count * 12 > (unsigned)(tiff->ep - tiff->rp))\n\t\tfz_throw(tiff->ctx, FZ_ERROR_GENERIC, \"overlarge IFD entry count %u\", count);\n\n\toffset += 2;\n\tfor (i = 0; i < count; i++)\n\t{\n\t\tfz_read_tiff_tag(tiff, offset);\n\t\toffset += 12;\n\t}\n}\n\nfz_pixmap *\nfz_load_tiff_subimage(fz_context *ctx, unsigned char *buf, int len, int subimage)\n{\n\tfz_pixmap *image;\n\tstruct tiff tiff = { 0 };\n\n\tfz_try(ctx)\n\t{\n\t\tfz_decode_tiff_header(ctx, &tiff, buf, len);\n\t\tfz_seek_ifd(ctx, &tiff, subimage);\n\t\tfz_decode_tiff_ifd(ctx, &tiff);\n\n\t\t/* Decode the image strips */\n\n\t\tif (tiff.rowsperstrip > tiff.imagelength)\n\t\t\ttiff.rowsperstrip = tiff.imagelength;\n\n\t\tfz_decode_tiff_strips(&tiff);\n\n\t\t/* Byte swap 16-bit images to big endian if necessary */\n\t\tif (tiff.bitspersample == 16)\n\t\t\tif (tiff.order == TII)\n\t\t\t\tfz_swap_tiff_byte_order(tiff.samples, tiff.imagewidth * tiff.imagelength * tiff.samplesperpixel);\n\n\t\t/* Expand into fz_pixmap struct */\n\t\timage = fz_new_pixmap(tiff.ctx, tiff.colorspace, tiff.imagewidth, tiff.imagelength);\n\t\timage->xres = tiff.xresolution;\n\t\timage->yres = tiff.yresolution;\n\n\t\tfz_unpack_tile(image, tiff.samples, tiff.samplesperpixel, tiff.bitspersample, tiff.stride, 0);\n\n\t\t/* We should only do this on non-pre-multiplied images, but files in the wild are bad */\n\t\tif (tiff.extrasamples /* == 2 */)\n\t\t{\n\t\t\t/* CMYK is a subtractive colorspace, we want additive for premul alpha */\n\t\t\tif (image->n == 5)\n\t\t\t{\n\t\t\t\tfz_pixmap *rgb = fz_new_pixmap(tiff.ctx, fz_device_rgb(ctx), image->w, image->h);\n\t\t\t\tfz_convert_pixmap(tiff.ctx, rgb, image);\n\t\t\t\trgb->xres = image->xres;\n\t\t\t\trgb->yres = image->yres;\n\t\t\t\tfz_drop_pixmap(ctx, image);\n\t\t\t\timage = rgb;\n\t\t\t}\n\t\t\tfz_premultiply_pixmap(ctx, image);\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\t/* Clean up scratch memory */\n\t\tif (tiff.colormap) fz_free(ctx, tiff.colormap);\n\t\tif (tiff.stripoffsets) fz_free(ctx, tiff.stripoffsets);\n\t\tif (tiff.stripbytecounts) fz_free(ctx, tiff.stripbytecounts);\n\t\tif (tiff.samples) fz_free(ctx, tiff.samples);\n\t\tif (tiff.profile) fz_free(ctx, tiff.profile);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_message(ctx, \"out of memory loading tiff\");\n\t}\n\n\treturn image;\n}\n\nfz_pixmap *\nfz_load_tiff(fz_context *ctx, unsigned char *buf, int len)\n{\n\treturn fz_load_tiff_subimage(ctx, buf, len, 0);\n}\n\nvoid\nfz_load_tiff_info_subimage(fz_context *ctx, unsigned char *buf, int len, int *wp, int *hp, int *xresp, int *yresp, fz_colorspace **cspacep, int subimage)\n{\n\tstruct tiff tiff = { 0 };\n\n\tfz_try(ctx)\n\t{\n\t\tfz_decode_tiff_header(ctx, &tiff, buf, len);\n\t\tfz_seek_ifd(ctx, &tiff, subimage);\n\t\tfz_decode_tiff_ifd(ctx, &tiff);\n\n\t\t*wp = tiff.imagewidth;\n\t\t*hp = tiff.imagelength;\n\t\t*xresp = (tiff.xresolution ? tiff.xresolution : 96);\n\t\t*yresp = (tiff.yresolution ? tiff.yresolution : 96);\n\t\t*cspacep = tiff.colorspace;\n\t}\n\tfz_always(ctx)\n\t{\n\t\t/* Clean up scratch memory */\n\t\tif (tiff.colormap) fz_free(ctx, tiff.colormap);\n\t\tif (tiff.stripoffsets) fz_free(ctx, tiff.stripoffsets);\n\t\tif (tiff.stripbytecounts) fz_free(ctx, tiff.stripbytecounts);\n\t\tif (tiff.samples) fz_free(ctx, tiff.samples);\n\t\tif (tiff.profile) fz_free(ctx, tiff.profile);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_message(ctx, \"out of memory loading tiff\");\n\t}\n}\n\nvoid\nfz_load_tiff_info(fz_context *ctx, unsigned char *buf, int len, int *wp, int *hp, int *xresp, int *yresp, fz_colorspace **cspacep)\n{\n\tfz_load_tiff_info_subimage(ctx, buf, len, wp, hp, xresp, yresp, cspacep, 0);\n}\n\nint\nfz_load_tiff_subimage_count(fz_context *ctx, unsigned char *buf, int len)\n{\n\tunsigned offset;\n\tunsigned subimage_count = 0;\n\tstruct tiff tiff = { 0 };\n\n\tfz_try(ctx)\n\t{\n\t\tfz_decode_tiff_header(ctx, &tiff, buf, len);\n\n\t\toffset = tiff.ifd_offset;\n\n\t\tdo {\n\t\t\tsubimage_count++;\n\t\t\toffset = fz_next_ifd(ctx, &tiff, offset);\n\t\t} while (offset != 0);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_message(ctx, \"error while counting subimages in tiff\");\n\t}\n\n\treturn subimage_count;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/memory.c",
    "content": "/* SumatraPDF: enable MSVCRT's memory debugging in debug builds */\n#if defined(_MSC_VER) && defined(_DEBUG)\n#define _CRTDBG_MAP_ALLOC\n#endif\n\n#include \"mupdf/fitz.h\"\n\n/* Enable FITZ_DEBUG_LOCKING_TIMES below if you want to check the times\n * for which locks are held too. */\n#ifdef FITZ_DEBUG_LOCKING\n#undef FITZ_DEBUG_LOCKING_TIMES\n#endif\n\nstatic void *\ndo_scavenging_malloc(fz_context *ctx, unsigned int size)\n{\n\tvoid *p;\n\tint phase = 0;\n\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tdo {\n\t\tp = ctx->alloc->malloc(ctx->alloc->user, size);\n\t\tif (p != NULL)\n\t\t{\n\t\t\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\t\t\treturn p;\n\t\t}\n\t} while (fz_store_scavenge(ctx, size, &phase));\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\n\treturn NULL;\n}\n\nstatic void *\ndo_scavenging_realloc(fz_context *ctx, void *p, unsigned int size)\n{\n\tvoid *q;\n\tint phase = 0;\n\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tdo {\n\t\tq = ctx->alloc->realloc(ctx->alloc->user, p, size);\n\t\tif (q != NULL)\n\t\t{\n\t\t\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\t\t\treturn q;\n\t\t}\n\t} while (fz_store_scavenge(ctx, size, &phase));\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\n\treturn NULL;\n}\n\nvoid *\nfz_malloc(fz_context *ctx, unsigned int size)\n{\n\tvoid *p;\n\n\tif (size == 0)\n\t\treturn NULL;\n\n\tp = do_scavenging_malloc(ctx, size);\n\tif (!p)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"malloc of %d bytes failed\", size);\n\treturn p;\n}\n\nvoid *\nfz_malloc_no_throw(fz_context *ctx, unsigned int size)\n{\n\treturn do_scavenging_malloc(ctx, size);\n}\n\nvoid *\nfz_malloc_array(fz_context *ctx, unsigned int count, unsigned int size)\n{\n\tvoid *p;\n\n\tif (count == 0 || size == 0)\n\t\treturn 0;\n\n\tif (count > UINT_MAX / size)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"malloc of array (%d x %d bytes) failed (integer overflow)\", count, size);\n\n\tp = do_scavenging_malloc(ctx, count * size);\n\tif (!p)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"malloc of array (%d x %d bytes) failed\", count, size);\n\treturn p;\n}\n\nvoid *\nfz_malloc_array_no_throw(fz_context *ctx, unsigned int count, unsigned int size)\n{\n\tif (count == 0 || size == 0)\n\t\treturn 0;\n\n\tif (count > UINT_MAX / size)\n\t{\n\t\tfprintf(stderr, \"error: malloc of array (%d x %d bytes) failed (integer overflow)\", count, size);\n\t\treturn NULL;\n\t}\n\n\treturn do_scavenging_malloc(ctx, count * size);\n}\n\nvoid *\nfz_calloc(fz_context *ctx, unsigned int count, unsigned int size)\n{\n\tvoid *p;\n\n\tif (count == 0 || size == 0)\n\t\treturn 0;\n\n\tif (count > UINT_MAX / size)\n\t{\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"calloc (%d x %d bytes) failed (integer overflow)\", count, size);\n\t}\n\n\tp = do_scavenging_malloc(ctx, count * size);\n\tif (!p)\n\t{\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"calloc (%d x %d bytes) failed\", count, size);\n\t}\n\tmemset(p, 0, count*size);\n\treturn p;\n}\n\nvoid *\nfz_calloc_no_throw(fz_context *ctx, unsigned int count, unsigned int size)\n{\n\tvoid *p;\n\n\tif (count == 0 || size == 0)\n\t\treturn 0;\n\n\tif (count > UINT_MAX / size)\n\t{\n\t\tfprintf(stderr, \"error: calloc (%d x %d bytes) failed (integer overflow)\\n\", count, size);\n\t\treturn NULL;\n\t}\n\n\tp = do_scavenging_malloc(ctx, count * size);\n\tif (p)\n\t{\n\t\tmemset(p, 0, count*size);\n\t}\n\treturn p;\n}\n\nvoid *\nfz_resize_array(fz_context *ctx, void *p, unsigned int count, unsigned int size)\n{\n\tvoid *np;\n\n\tif (count == 0 || size == 0)\n\t{\n\t\tfz_free(ctx, p);\n\t\treturn 0;\n\t}\n\n\tif (count > UINT_MAX / size)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"resize array (%d x %d bytes) failed (integer overflow)\", count, size);\n\n\tnp = do_scavenging_realloc(ctx, p, count * size);\n\tif (!np)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"resize array (%d x %d bytes) failed\", count, size);\n\treturn np;\n}\n\nvoid *\nfz_resize_array_no_throw(fz_context *ctx, void *p, unsigned int count, unsigned int size)\n{\n\tif (count == 0 || size == 0)\n\t{\n\t\tfz_free(ctx, p);\n\t\treturn 0;\n\t}\n\n\tif (count > UINT_MAX / size)\n\t{\n\t\tfprintf(stderr, \"error: resize array (%d x %d bytes) failed (integer overflow)\\n\", count, size);\n\t\treturn NULL;\n\t}\n\n\treturn do_scavenging_realloc(ctx, p, count * size);\n}\n\nvoid\nfz_free(fz_context *ctx, void *p)\n{\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tctx->alloc->free(ctx->alloc->user, p);\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n}\n\nchar *\nfz_strdup(fz_context *ctx, const char *s)\n{\n\tint len = strlen(s) + 1;\n\tchar *ns = fz_malloc(ctx, len);\n\tmemcpy(ns, s, len);\n\treturn ns;\n}\n\nchar *\nfz_strdup_no_throw(fz_context *ctx, const char *s)\n{\n\tint len = strlen(s) + 1;\n\tchar *ns = fz_malloc_no_throw(ctx, len);\n\tif (ns)\n\t\tmemcpy(ns, s, len);\n\treturn ns;\n}\n\n/* SumatraPDF: enable MSVCRT's memory debugging in debug builds */\n#ifdef _CRTDBG_MAP_ALLOC\n#include <crtdbg.h>\n#endif\n\nstatic void *\nfz_malloc_default(void *opaque, unsigned int size)\n{\n\treturn malloc(size);\n}\n\nstatic void *\nfz_realloc_default(void *opaque, void *old, unsigned int size)\n{\n\treturn realloc(old, size);\n}\n\nstatic void\nfz_free_default(void *opaque, void *ptr)\n{\n\tfree(ptr);\n}\n\nfz_alloc_context fz_alloc_default =\n{\n\tNULL,\n\tfz_malloc_default,\n\tfz_realloc_default,\n\tfz_free_default\n};\n\nstatic void\nfz_lock_default(void *user, int lock)\n{\n}\n\nstatic void\nfz_unlock_default(void *user, int lock)\n{\n}\n\nfz_locks_context fz_locks_default =\n{\n\tNULL,\n\tfz_lock_default,\n\tfz_unlock_default\n};\n\n#ifdef FITZ_DEBUG_LOCKING\n\nenum\n{\n\tFZ_LOCK_DEBUG_CONTEXT_MAX = 100\n};\n\nfz_context *fz_lock_debug_contexts[FZ_LOCK_DEBUG_CONTEXT_MAX];\nint fz_locks_debug[FZ_LOCK_DEBUG_CONTEXT_MAX][FZ_LOCK_MAX];\n#ifdef FITZ_DEBUG_LOCKING_TIMES\nint fz_debug_locking_inited = 0;\nint fz_lock_program_start;\nint fz_lock_time[FZ_LOCK_DEBUG_CONTEXT_MAX][FZ_LOCK_MAX] = { { 0 } };\nint fz_lock_taken[FZ_LOCK_DEBUG_CONTEXT_MAX][FZ_LOCK_MAX] = { { 0 } };\n\n/* We implement our own millisecond clock, as clock() cannot be trusted\n * when threads are involved. */\nstatic int ms_clock(void)\n{\n#ifdef _WIN32\n\treturn (int)GetTickCount();\n#else\n\tstruct timeval tp;\n\tgettimeofday(&tp, NULL);\n\treturn (tp.tv_sec*1000) + (tp.tv_usec/1000);\n#endif\n}\n\nstatic void dump_lock_times(void)\n{\n\tint i, j;\n\tint prog_time = ms_clock() - fz_lock_program_start;\n\n\tfor (j = 0; j < FZ_LOCK_MAX; j++)\n\t{\n\t\tint total = 0;\n\t\tfor (i = 0; i < FZ_LOCK_DEBUG_CONTEXT_MAX; i++)\n\t\t{\n\t\t\ttotal += fz_lock_time[i][j];\n\t\t}\n\t\tprintf(\"Lock %d held for %g seconds (%g%%)\\n\", j, ((double)total)/1000, 100.0*total/prog_time);\n\t}\n\tprintf(\"Total program time %g seconds\\n\", ((double)prog_time)/1000);\n}\n\n#endif\n\nstatic int find_context(fz_context *ctx)\n{\n\tint i;\n\n\tfor (i = 0; i < FZ_LOCK_DEBUG_CONTEXT_MAX; i++)\n\t{\n\t\tif (fz_lock_debug_contexts[i] == ctx)\n\t\t\treturn i;\n\t\tif (fz_lock_debug_contexts[i] == NULL)\n\t\t{\n\t\t\tint gottit = 0;\n\t\t\t/* We've not locked on this context before, so use\n\t\t\t * this one for this new context. We might have other\n\t\t\t * threads trying here too though so, so claim it\n\t\t\t * atomically. No one has locked on this context\n\t\t\t * before, so we are safe to take the ALLOC lock. */\n\t\t\tctx->locks->lock(ctx->locks->user, FZ_LOCK_ALLOC);\n\t\t\t/* If it's still free, then claim it as ours,\n\t\t\t * otherwise we'll keep hunting. */\n\t\t\tif (fz_lock_debug_contexts[i] == NULL)\n\t\t\t{\n\t\t\t\tgottit = 1;\n\t\t\t\tfz_lock_debug_contexts[i] = ctx;\n#ifdef FITZ_DEBUG_LOCKING_TIMES\n\t\t\t\tif (fz_debug_locking_inited == 0)\n\t\t\t\t{\n\t\t\t\t\tfz_debug_locking_inited = 1;\n\t\t\t\t\tfz_lock_program_start = ms_clock();\n\t\t\t\t\tatexit(dump_lock_times);\n\t\t\t\t}\n#endif\n\t\t\t}\n\t\t\tctx->locks->unlock(ctx->locks->user, FZ_LOCK_ALLOC);\n\t\t\tif (gottit)\n\t\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\nvoid\nfz_assert_lock_held(fz_context *ctx, int lock)\n{\n\tint idx = find_context(ctx);\n\tif (idx < 0)\n\t\treturn;\n\n\tif (fz_locks_debug[idx][lock] == 0)\n\t\tfprintf(stderr, \"Lock %d not held when expected\\n\", lock);\n}\n\nvoid\nfz_assert_lock_not_held(fz_context *ctx, int lock)\n{\n\tint idx = find_context(ctx);\n\tif (idx < 0)\n\t\treturn;\n\n\tif (fz_locks_debug[idx][lock] != 0)\n\t\tfprintf(stderr, \"Lock %d held when not expected\\n\", lock);\n}\n\nvoid fz_lock_debug_lock(fz_context *ctx, int lock)\n{\n\tint i;\n\tint idx = find_context(ctx);\n\tif (idx < 0)\n\t\treturn;\n\n\tif (fz_locks_debug[idx][lock] != 0)\n\t{\n\t\tfprintf(stderr, \"Attempt to take lock %d when held already!\\n\", lock);\n\t}\n\tfor (i = lock-1; i >= 0; i--)\n\t{\n\t\tif (fz_locks_debug[idx][i] != 0)\n\t\t{\n\t\t\tfprintf(stderr, \"Lock ordering violation: Attempt to take lock %d when %d held already!\\n\", lock, i);\n\t\t}\n\t}\n\tfz_locks_debug[idx][lock] = 1;\n#ifdef FITZ_DEBUG_LOCKING_TIMES\n\tfz_lock_taken[idx][lock] = clock();\n#endif\n}\n\nvoid fz_lock_debug_unlock(fz_context *ctx, int lock)\n{\n\tint idx = find_context(ctx);\n\tif (idx < 0)\n\t\treturn;\n\n\tif (fz_locks_debug[idx][lock] == 0)\n\t{\n\t\tfprintf(stderr, \"Attempt to release lock %d when not held!\\n\", lock);\n\t}\n\tfz_locks_debug[idx][lock] = 0;\n#ifdef FITZ_DEBUG_LOCKING_TIMES\n\tfz_lock_time[idx][lock] += clock() - fz_lock_taken[idx][lock];\n#endif\n}\n\n#endif\n"
  },
  {
    "path": "mupdf/source/fitz/outline.c",
    "content": "#include \"mupdf/fitz.h\"\n\nvoid\nfz_free_outline(fz_context *ctx, fz_outline *outline)\n{\n\twhile (outline)\n\t{\n\t\tfz_outline *next = outline->next;\n\t\tfz_free_outline(ctx, outline->down);\n\t\tfz_free(ctx, outline->title);\n\t\tfz_free_link_dest(ctx, &outline->dest);\n\t\tfz_free(ctx, outline);\n\t\toutline = next;\n\t}\n}\n\nstatic void\ndo_debug_outline_xml(fz_output *out, fz_outline *outline, int level)\n{\n\twhile (outline)\n\t{\n\t\tfz_printf(out, \"<outline title=\\\"%s\\\" page=\\\"%d\\\"\", outline->title, outline->dest.kind == FZ_LINK_GOTO ? outline->dest.ld.gotor.page + 1 : 0);\n\t\tif (outline->down)\n\t\t{\n\t\t\tfz_printf(out, \">\\n\");\n\t\t\tdo_debug_outline_xml(out, outline->down, level + 1);\n\t\t\tfz_printf(out, \"</outline>\\n\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_printf(out, \" />\\n\");\n\t\t}\n\t\toutline = outline->next;\n\t}\n}\n\nvoid\nfz_print_outline_xml(fz_context *ctx, fz_output *out, fz_outline *outline)\n{\n\tdo_debug_outline_xml(out, outline, 0);\n}\n\nstatic void\ndo_debug_outline(fz_output *out, fz_outline *outline, int level)\n{\n\tint i;\n\twhile (outline)\n\t{\n\t\tfor (i = 0; i < level; i++)\n\t\t\tfz_printf(out, \"\\t\");\n\t\tfz_printf(out, \"%s\\t%d\\n\", outline->title, outline->dest.kind == FZ_LINK_GOTO ? outline->dest.ld.gotor.page + 1 : 0);\n\t\tif (outline->down)\n\t\t\tdo_debug_outline(out, outline->down, level + 1);\n\t\toutline = outline->next;\n\t}\n}\n\nvoid\nfz_print_outline(fz_context *ctx, fz_output *out, fz_outline *outline)\n{\n\tdo_debug_outline(out, outline, 0);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/output-pcl.c",
    "content": "#include \"mupdf/fitz.h\"\n\n/* Lifted from ghostscript gdevjlm.h */\n/*\n * The notion that there is such a thing as a \"PCL printer\" is a fiction: no\n * two \"PCL\" printers, even at the same PCL level, have identical command\n * sets. (The H-P documentation isn't fully accurate either; for example,\n * it doesn't reveal that the DeskJet printers implement anything beyond PCL\n * 3.)\n *\n * This file contains feature definitions for a generic monochrome PCL\n * driver (gdevdljm.c), and the specific feature values for all such\n * printers that Ghostscript currently supports.\n */\n\n/* Printer spacing capabilities. Include at most one of these. */\n#define PCL_NO_SPACING\t0\t/* no vertical spacing capability, must be 0 */\n#define PCL3_SPACING\t1\t/* <ESC>*p+<n>Y (PCL 3) */\n#define PCL4_SPACING\t2\t/* <ESC>*b<n>Y (PCL 4) */\n#define PCL5_SPACING\t4\t/* <ESC>*b<n>Y and clear seed row (PCL 5) */\n/* The following is only used internally. */\n#define PCL_ANY_SPACING \\\n\t(PCL3_SPACING | PCL4_SPACING | PCL5_SPACING)\n\n/* Individual printer properties. Any subset of these may be included. */\n#define PCL_MODE_2_COMPRESSION\t\t8\t/* compression mode 2 supported */\n\t\t\t\t\t\t/* (PCL 4) */\n#define PCL_MODE_3_COMPRESSION\t\t16\t/* compression modes 2 & 3 supported */\n\t\t\t\t\t\t/* (PCL 5) */\n#define PCL_END_GRAPHICS_DOES_RESET\t32\t/* <esc>*rB resets all parameters */\n#define PCL_HAS_DUPLEX\t\t\t64\t/* <esc>&l<duplex>S supported */\n#define PCL_CAN_SET_PAPER_SIZE\t\t128\t/* <esc>&l<sizecode>A supported */\n#define PCL_CAN_PRINT_COPIES\t\t256\t/* <esc>&l<copies>X supported */\n#define HACK__IS_A_LJET4PJL\t\t512\n#define HACK__IS_A_OCE9050\t\t1024\n\n/* Shorthands for the most common spacing/compression combinations. */\n#define PCL_MODE0 PCL3_SPACING\n#define PCL_MODE0NS PCL_NO_SPACING\n#define PCL_MODE2 (PCL4_SPACING | PCL_MODE_2_COMPRESSION)\n#define PCL_MODE2P (PCL_NO_SPACING | PCL_MODE_2_COMPRESSION)\n#define PCL_MODE3 (PCL5_SPACING | PCL_MODE_3_COMPRESSION)\n#define PCL_MODE3NS (PCL_NO_SPACING | PCL_MODE_3_COMPRESSION)\n\n#define MIN_SKIP_LINES 7\nstatic const char *const from2to3 = \"\\033*b3M\";\nstatic const char *const from3to2 = \"\\033*b2M\";\nstatic const int penalty_from2to3 = 5; /* strlen(from2to3); */\nstatic const int penalty_from3to2 = 5; /* strlen(from3to2); */\n\n/* H-P DeskJet */\nstatic const fz_pcl_options fz_pcl_options_ljet4 =\n{\n\t(PCL_MODE2 | PCL_END_GRAPHICS_DOES_RESET | PCL_CAN_SET_PAPER_SIZE),\n\t\"\\033&k1W\\033*b2M\",\n\t\"\\033&k1W\\033*b2M\"\n};\n\n/* H-P DeskJet 500 */\nstatic const fz_pcl_options fz_pcl_options_dj500 =\n{\n\t(PCL_MODE3 | PCL_END_GRAPHICS_DOES_RESET | PCL_CAN_SET_PAPER_SIZE),\n\t\"\\033&k1W\",\n\t\"\\033&k1W\"\n};\n\n/* Kyocera FS-600 */\nstatic const fz_pcl_options fz_pcl_options_fs600 =\n{\n\t(PCL_MODE3 | PCL_CAN_SET_PAPER_SIZE | PCL_CAN_PRINT_COPIES),\n\t\"\\033*r0F\\033&u%dD\",\n\t\"\\033*r0F\\033&u%dD\"\n};\n\n/* H-P original LaserJet */\n/* H-P LaserJet Plus */\nstatic const fz_pcl_options fz_pcl_options_lj =\n{\n\t(PCL_MODE0),\n\t\"\\033*b0M\",\n\t\"\\033*b0M\"\n};\n\n/* H-P LaserJet IIp, IId */\nstatic const fz_pcl_options fz_pcl_options_lj2 =\n{\n\t(PCL_MODE2P | PCL_CAN_SET_PAPER_SIZE),\n\t\"\\033*r0F\\033*b2M\",\n\t\"\\033*r0F\\033*b2M\"\n};\n\n/* H-P LaserJet III* */\nstatic const fz_pcl_options fz_pcl_options_lj3 =\n{\n\t(PCL_MODE3 | PCL_CAN_SET_PAPER_SIZE | PCL_CAN_PRINT_COPIES),\n\t\"\\033&l-180u36Z\\033*r0F\",\n\t\"\\033&l-180u36Z\\033*r0F\"\n};\n\n/* H-P LaserJet IIId */\nstatic const fz_pcl_options fz_pcl_options_lj3d =\n{\n\t(PCL_MODE3 | PCL_HAS_DUPLEX | PCL_CAN_SET_PAPER_SIZE | PCL_CAN_PRINT_COPIES),\n\t\"\\033&l-180u36Z\\033*r0F\",\n\t\"\\033&l180u36Z\\033*r0F\"\n};\n\n/* H-P LaserJet 4 */\nstatic const fz_pcl_options fz_pcl_options_lj4 =\n{\n\t(PCL_MODE3 | PCL_CAN_SET_PAPER_SIZE | PCL_CAN_PRINT_COPIES),\n\t\"\\033&l-180u36Z\\033*r0F\\033&u%dD\",\n\t\"\\033&l-180u36Z\\033*r0F\\033&u%dD\"\n};\n\n/* H-P LaserJet 4 PL */\nstatic const fz_pcl_options fz_pcl_options_lj4pl =\n{\n\t(PCL_MODE3 | PCL_CAN_SET_PAPER_SIZE | PCL_CAN_PRINT_COPIES | HACK__IS_A_LJET4PJL),\n\t\"\\033&l-180u36Z\\033*r0F\\033&u%dD\",\n\t\"\\033&l-180u36Z\\033*r0F\\033&u%dD\"\n};\n\n/* H-P LaserJet 4d */\nstatic const fz_pcl_options fz_pcl_options_lj4d =\n{\n\t(PCL_MODE3 | PCL_HAS_DUPLEX | PCL_CAN_SET_PAPER_SIZE | PCL_CAN_PRINT_COPIES),\n\t\"\\033&l-180u36Z\\033*r0F\\033&u%dD\",\n\t\"\\033&l180u36Z\\033*r0F\\033&u%dD\"\n};\n\n/* H-P 2563B line printer */\nstatic const fz_pcl_options fz_pcl_options_lp2563b =\n{\n\t(PCL_MODE0NS | PCL_CAN_SET_PAPER_SIZE),\n\t\"\\033*b0M\",\n\t\"\\033*b0M\"\n};\n\n/* OCE 9050 line printer */\nstatic const fz_pcl_options fz_pcl_options_oce9050 =\n{\n\t(PCL_MODE3NS | PCL_CAN_SET_PAPER_SIZE | HACK__IS_A_OCE9050),\n\t\"\\033*b0M\",\n\t\"\\033*b0M\"\n};\n\nstatic void copy_opts(fz_pcl_options *dst, const fz_pcl_options *src)\n{\n\tif (dst)\n\t\t*dst = *src;\n}\n\nvoid fz_pcl_preset(fz_context *ctx, fz_pcl_options *opts, const char *preset)\n{\n\tif (preset == NULL || *preset == 0 || !strcmp(preset, \"ljet4\"))\n\t\tcopy_opts(opts, &fz_pcl_options_ljet4);\n\telse if (!strcmp(preset, \"dj500\"))\n\t\tcopy_opts(opts, &fz_pcl_options_dj500);\n\telse if (!strcmp(preset, \"fs600\"))\n\t\tcopy_opts(opts, &fz_pcl_options_fs600);\n\telse if (!strcmp(preset, \"lj\"))\n\t\tcopy_opts(opts, &fz_pcl_options_lj);\n\telse if (!strcmp(preset, \"lj2\"))\n\t\tcopy_opts(opts, &fz_pcl_options_lj2);\n\telse if (!strcmp(preset, \"lj3\"))\n\t\tcopy_opts(opts, &fz_pcl_options_lj3);\n\telse if (!strcmp(preset, \"lj3d\"))\n\t\tcopy_opts(opts, &fz_pcl_options_lj3d);\n\telse if (!strcmp(preset, \"lj4\"))\n\t\tcopy_opts(opts, &fz_pcl_options_lj4);\n\telse if (!strcmp(preset, \"lj4pl\"))\n\t\tcopy_opts(opts, &fz_pcl_options_lj4pl);\n\telse if (!strcmp(preset, \"lj4d\"))\n\t\tcopy_opts(opts, &fz_pcl_options_lj4d);\n\telse if (!strcmp(preset, \"lp2563b\"))\n\t\tcopy_opts(opts, &fz_pcl_options_lp2563b);\n\telse if (!strcmp(preset, \"oce9050\"))\n\t\tcopy_opts(opts, &fz_pcl_options_oce9050);\n\telse\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Unknown preset '%s'\", preset);\n}\n\nvoid fz_pcl_option(fz_context *ctx, fz_pcl_options *opts, const char *option, int val)\n{\n\tif (opts == NULL)\n\t\treturn;\n\n\tif (!strcmp(option, \"spacing\"))\n\t{\n\t\tswitch (val)\n\t\t{\n\t\tcase 0:\n\t\t\topts->features &= ~PCL_ANY_SPACING;\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\topts->features = (opts->features & ~PCL_ANY_SPACING) | PCL3_SPACING;\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\topts->features = (opts->features & ~PCL_ANY_SPACING) | PCL4_SPACING;\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\topts->features = (opts->features & ~PCL_ANY_SPACING) | PCL5_SPACING;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Unsupported PCL spacing %d (0-3 only)\", val);\n\t\t}\n\t}\n\telse if (!strcmp(option, \"mode2\"))\n\t{\n\t\tif (val == 0)\n\t\t\topts->features &= ~PCL_MODE_2_COMPRESSION;\n\t\telse if (val == 1)\n\t\t\topts->features |= PCL_MODE_2_COMPRESSION;\n\t\telse\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Expected 0 or 1 for mode2 value\");\n\t}\n\telse if (!strcmp(option, \"mode3\"))\n\t{\n\t\tif (val == 0)\n\t\t\topts->features &= ~PCL_MODE_3_COMPRESSION;\n\t\telse if (val == 1)\n\t\t\topts->features |= PCL_MODE_3_COMPRESSION;\n\t\telse\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Expected 0 or 1 for mode3 value\");\n\t}\n\telse if (!strcmp(option, \"eog_reset\"))\n\t{\n\t\tif (val == 0)\n\t\t\topts->features &= ~PCL_END_GRAPHICS_DOES_RESET;\n\t\telse if (val == 1)\n\t\t\topts->features |= PCL_END_GRAPHICS_DOES_RESET;\n\t\telse\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Expected 0 or 1 for eog_reset value\");\n\t}\n\telse if (!strcmp(option, \"has_duplex\"))\n\t{\n\t\tif (val == 0)\n\t\t\topts->features &= ~PCL_HAS_DUPLEX;\n\t\telse if (val == 1)\n\t\t\topts->features |= PCL_HAS_DUPLEX;\n\t\telse\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Expected 0 or 1 for has_duplex value\");\n\t}\n\telse if (!strcmp(option, \"has_papersize\"))\n\t{\n\t\tif (val == 0)\n\t\t\topts->features &= ~PCL_CAN_SET_PAPER_SIZE;\n\t\telse if (val == 1)\n\t\t\topts->features |= PCL_CAN_SET_PAPER_SIZE;\n\t\telse\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Expected 0 or 1 for has_papersize value\");\n\t}\n\telse if (!strcmp(option, \"has_copies\"))\n\t{\n\t\tif (val == 0)\n\t\t\topts->features &= ~PCL_CAN_PRINT_COPIES;\n\t\telse if (val == 1)\n\t\t\topts->features |= PCL_CAN_PRINT_COPIES;\n\t\telse\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Expected 0 or 1 for has_papersize value\");\n\t}\n\telse if (!strcmp(option, \"is_ljet4pjl\"))\n\t{\n\t\tif (val == 0)\n\t\t\topts->features &= ~HACK__IS_A_LJET4PJL;\n\t\telse if (val == 1)\n\t\t\topts->features |= HACK__IS_A_LJET4PJL;\n\t\telse\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Expected 0 or 1 for is_ljet4pjl value\");\n\t}\n\telse if (!strcmp(option, \"is_oce9050\"))\n\t{\n\t\tif (val == 0)\n\t\t\topts->features &= ~HACK__IS_A_OCE9050;\n\t\telse if (val == 1)\n\t\t\topts->features |= HACK__IS_A_OCE9050;\n\t\telse\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Expected 0 or 1 for is_oce9050 value\");\n\t}\n\telse\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Unknown pcl option '%s'\", option);\n}\n\nstatic void\nmake_init(fz_pcl_options *pcl, char *buf, unsigned long len, const char *str, int res)\n{\n\tint paper_source = -1;\n\n\tsnprintf(buf, len, str, res);\n\n\tif (pcl->manual_feed_set && pcl->manual_feed)\n\t\tpaper_source = 2;\n\telse if (pcl->media_position_set && pcl->media_position >= 0)\n\t\tpaper_source = pcl->media_position;\n\tif (paper_source >= 0)\n\t{\n\t\tchar buf2[40];\n\t\tsnprintf(buf2, sizeof(buf2), \"\\033&l%dH\", paper_source);\n\t\tstrncat(buf, buf2, len);\n\t}\n}\n\nstatic void\npcl_header(fz_output *out, fz_pcl_options *pcl, int num_copies, int xres)\n{\n\tchar odd_page_init[80];\n\tchar even_page_init[80];\n\n\tmake_init(pcl, odd_page_init, sizeof(odd_page_init), pcl->odd_page_init, xres);\n\tmake_init(pcl, even_page_init, sizeof(even_page_init), pcl->even_page_init, xres);\n\n\tif (pcl->page_count == 0)\n\t{\n\t\tif (pcl->features & HACK__IS_A_LJET4PJL)\n\t\t\tfz_puts(out, \"\\033%-12345X@PJL\\r\\n@PJL ENTER LANGUAGE = PCL\\r\\n\");\n\t\tfz_puts(out, \"\\033E\"); /* reset printer */\n\t\t/* If the printer supports it, set the paper size */\n\t\t/* based on the actual requested size. */\n\t\tif (pcl->features & PCL_CAN_SET_PAPER_SIZE)\n\t\t\tfz_printf(out, \"\\033&l%dA\", pcl->paper_size);\n\t\t/* If printer can duplex, set duplex mode appropriately. */\n\t\tif (pcl->features & PCL_HAS_DUPLEX)\n\t\t{\n\t\t\tif (pcl->duplex_set)\n\t\t\t{\n\t\t\t\tif (pcl->duplex)\n\t\t\t\t{\n\t\t\t\t\tif (!pcl->tumble)\n\t\t\t\t\t\tfz_puts(out, \"\\033&l1S\");\n\t\t\t\t\telse\n\t\t\t\t\t\tfz_puts(out, \"\\033&l2S\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tfz_puts(out, \"\\033&l0S\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/* default to duplex for this printer */\n\t\t\t\tfz_puts(out, \"\\033&l1S\");\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Put out per-page initialization. */\n\t/* in duplex mode the sheet is already in process, so there are some\n\t * commands which must not be sent to the printer for the 2nd page,\n\t * as this commands will cause the printer to eject the sheet with\n\t * only the 1st page printed. This commands are:\n\t * \\033&l%dA (setting paper size)\n\t * \\033&l%dH (setting paper tray)\n\t * in simplex mode we set this parameters for each page,\n\t * in duplex mode we set this parameters for each odd page\n\t */\n\n\tif ((pcl->features & PCL_HAS_DUPLEX) && pcl->duplex_set && pcl->duplex)\n\t{\n\t\t/* We are printing duplex, so change margins as needed */\n\t\tif (((pcl->page_count/num_copies)%2) == 0)\n\t\t{\n\t\t\tif (pcl->page_count != 0 && (pcl->features & PCL_CAN_SET_PAPER_SIZE))\n\t\t\t{\n\t\t\t\tfz_printf(out, \"\\033&l%dA\", pcl->paper_size);\n\t\t\t}\n\t\t\tfz_puts(out, \"\\033&l0o0l0E\");\n\t\t\tfz_puts(out, pcl->odd_page_init);\n\t\t}\n\t\telse\n\t\t\tfz_puts(out, pcl->even_page_init);\n\t}\n\telse\n\t{\n\t\tif (pcl->features & PCL_CAN_SET_PAPER_SIZE)\n\t\t{\n\t\t\tfz_printf(out, \"\\033&l%dA\", pcl->paper_size);\n\t\t}\n\t\tfz_puts(out, \"\\033&l0o0l0E\");\n\t\tfz_puts(out, pcl->odd_page_init);\n\t}\n\n\tfz_printf(out, \"\\033&l%dX\", num_copies); /* # of copies */\n\n\t/* End raster graphics, position cursor at top. */\n\tfz_puts(out, \"\\033*rB\\033*p0x0Y\");\n\n\t/* The DeskJet and DeskJet Plus reset everything upon */\n\t/* receiving \\033*rB, so we must reinitialize graphics mode. */\n\tif (pcl->features & PCL_END_GRAPHICS_DOES_RESET)\n\t{\n\t\tfz_puts(out, pcl->odd_page_init); /* Assume this does the right thing */\n\t\tfz_printf(out, \"\\033&l%dX\", num_copies); /* # of copies */\n\t}\n\n\t/* Set resolution. */\n\tfz_printf(out, \"\\033*t%dR\", xres);\n\tpcl->page_count++;\n}\n\nvoid\nfz_output_pcl(fz_output *out, const fz_pixmap *pixmap, fz_pcl_options *pcl)\n{\n\t//unsigned char *sp;\n\t//int y, x, sn, dn, ss;\n\tfz_context *ctx;\n\n\tif (!out || !pixmap)\n\t\treturn;\n\n\tctx = out->ctx;\n\n\tif (pixmap->n != 1 && pixmap->n != 2 && pixmap->n != 4)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"pixmap must be grayscale or rgb to write as pcl\");\n\n\tpcl_header(out, pcl, 1, pixmap->xres);\n\n#if 0\n\tsn = pixmap->n;\n\tdn = pixmap->n;\n\tif (dn == 2 || dn == 4)\n\t\tdn--;\n\n\t/* Now output the actual bitmap, using a packbits like compression */\n\tsp = pixmap->samples;\n\tss = pixmap->w * sn;\n\ty = 0;\n\twhile (y < pixmap->h)\n\t{\n\t\tint yrep;\n\n\t\tassert(sp == pixmap->samples + y * ss);\n\n\t\t/* Count the number of times this line is repeated */\n\t\tfor (yrep = 1; yrep < 256 && y+yrep < pixmap->h; yrep++)\n\t\t{\n\t\t\tif (memcmp(sp, sp + yrep * ss, ss) != 0)\n\t\t\t\tbreak;\n\t\t}\n\t\tfz_write_byte(out, yrep-1);\n\n\t\t/* Encode the line */\n\t\tx = 0;\n\t\twhile (x < pixmap->w)\n\t\t{\n\t\t\tint d;\n\n\t\t\tassert(sp == pixmap->samples + y * ss + x * sn);\n\n\t\t\t/* How far do we have to look to find a repeated value? */\n\t\t\tfor (d = 1; d < 128 && x+d < pixmap->w; d++)\n\t\t\t{\n\t\t\t\tif (memcmp(sp + (d-1)*sn, sp + d*sn, sn) == 0)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (d == 1)\n\t\t\t{\n\t\t\t\tint xrep;\n\n\t\t\t\t/* We immediately have a repeat (or we've hit\n\t\t\t\t * the end of the line). Count the number of\n\t\t\t\t * times this value is repeated. */\n\t\t\t\tfor (xrep = 1; xrep < 128 && x+xrep < pixmap->w; xrep++)\n\t\t\t\t{\n\t\t\t\t\tif (memcmp(sp, sp + xrep*sn, sn) != 0)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tfz_write_byte(out, xrep-1);\n\t\t\t\tfz_write(out, sp, dn);\n\t\t\t\tsp += sn*xrep;\n\t\t\t\tx += xrep;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfz_write_byte(out, 257-d);\n\t\t\t\tx += d;\n\t\t\t\twhile (d > 0)\n\t\t\t\t{\n\t\t\t\t\tfz_write(out, sp, dn);\n\t\t\t\t\tsp += sn;\n\t\t\t\t\td--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* Move to the next line */\n\t\tsp += ss*(yrep-1);\n\t\ty += yrep;\n\t}\n#endif\n}\n\n/*\n * Mode 2 Row compression routine for the HP DeskJet & LaserJet IIp.\n * Compresses data from row up to end_row, storing the result\n * starting at compressed. Returns the number of bytes stored.\n * Runs of K<=127 literal bytes are encoded as K-1 followed by\n * the bytes; runs of 2<=K<=127 identical bytes are encoded as\n * 257-K followed by the byte.\n * In the worst case, the result is N+(N/127)+1 bytes long,\n * where N is the original byte count (end_row - row).\n */\nint\nmode2compress(unsigned char *out, unsigned char *in, int in_len)\n{\n\tint x;\n\tint out_len = 0;\n\tint run;\n\n\tfor (x = 0; x < in_len; x += run)\n\t{\n\t\t/* How far do we have to look to find a value that isn't repeated? */\n\t\tfor (run = 1; run < 127 && x+run < in_len; run++)\n\t\t\tif (in[0] != in[run])\n\t\t\t\tbreak;\n\t\tif (run > 1)\n\t\t{\n\t\t\t/* We have a run of matching bytes */\n\t\t\tout[out_len++] = 257-run;\n\t\t\tout[out_len++] = in[0];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tint i;\n\n\t\t\t/* How many literals do we need to copy? */\n\t\t\tfor (run = 1; run < 127 && x+run < in_len; run++)\n\t\t\t\tif (in[run] == in[run+1])\n\t\t\t\t\tbreak;\n\t\t\tout[out_len++] = run-1;\n\t\t\tfor (i = 0; i < run; i++)\n\t\t\t\tout[out_len++] = in[i];\n\t\t}\n\t\tin += run;\n\t}\n\treturn out_len;\n}\n\n/*\n * Mode 3 compression routine for the HP LaserJet III family.\n * Compresses bytecount bytes starting at current, storing the result\n * in compressed, comparing against and updating previous.\n * Returns the number of bytes stored.\tIn the worst case,\n * the number of bytes is bytecount+(bytecount/8)+1.\n */\nint\nmode3compress(unsigned char *out, const unsigned char *in, unsigned char *prev, int in_len)\n{\n\tunsigned char *compressed = out;\n\tconst unsigned char *cur = in;\n\tconst unsigned char *end = in + in_len;\n\n\twhile (cur < end) {\t\t/* Detect a maximum run of unchanged bytes. */\n\t\tconst unsigned char *run = cur;\n\t\tconst unsigned char *diff;\n\t\tconst unsigned char *stop;\n\t\tint offset, cbyte;\n\n\t\twhile (cur < end && *cur == *prev) {\n\t\t\tcur++, prev++;\n\t\t}\n\t\tif (cur == end)\n\t\t\tbreak;\t\t/* rest of row is unchanged */\n\t\t/* Detect a run of up to 8 changed bytes. */\n\t\t/* We know that *cur != *prev. */\n\t\tdiff = cur;\n\t\tstop = (end - cur > 8 ? cur + 8 : end);\n\t\tdo\n\t\t{\n\t\t\t*prev++ = *cur++;\n\t\t}\n\t\twhile (cur < stop && *cur != *prev);\n\t\t/* Now [run..diff) are unchanged, and */\n\t\t/* [diff..cur) are changed. */\n\t\t/* Generate the command byte(s). */\n\t\toffset = diff - run;\n\t\tcbyte = (cur - diff - 1) << 5;\n\t\tif (offset < 31)\n\t\t\t*out++ = cbyte + offset;\n\t\telse {\n\t\t\t*out++ = cbyte + 31;\n\t\t\toffset -= 31;\n\t\t\twhile (offset >= 255)\n\t\t\t\t*out++ = 255, offset -= 255;\n\t\t\t*out++ = offset;\n\t\t}\n\t\t/* Copy the changed data. */\n\t\twhile (diff < cur)\n\t\t\t*out++ = *diff++;\n\t}\n\treturn out - compressed;\n}\n\nvoid wind(void)\n{}\n\nvoid\nfz_output_pcl_bitmap(fz_output *out, const fz_bitmap *bitmap, fz_pcl_options *pcl)\n{\n\tunsigned char *data, *out_data;\n\tint y, ss, rmask, line_size;\n\tfz_context *ctx;\n\tint num_blank_lines;\n\tint compression = -1;\n\tunsigned char *prev_row = NULL;\n\tunsigned char *out_row_mode_2 = NULL;\n\tunsigned char *out_row_mode_3 = NULL;\n\tint out_count;\n\tint max_mode_2_size;\n\tint max_mode_3_size;\n\n\tif (!out || !bitmap)\n\t\treturn;\n\n\tctx = out->ctx;\n\n\tif (pcl->features & HACK__IS_A_OCE9050)\n\t{\n\t\t/* Enter HPGL/2 mode, begin plot, Initialise (start plot), Enter PCL mode */\n\t\tfz_puts(out, \"\\033%1BBPIN;\\033%1A\");\n\t}\n\n\tpcl_header(out, pcl, 1, bitmap->xres);\n\n\tfz_var(prev_row);\n\tfz_var(out_row_mode_2);\n\tfz_var(out_row_mode_3);\n\n\tfz_try(ctx)\n\t{\n\t\tnum_blank_lines = 0;\n\t\trmask = ~0 << (-bitmap->w & 7);\n\t\tline_size = (bitmap->w + 7)/8;\n\t\tmax_mode_2_size = line_size + (line_size/127) + 1;\n\t\tmax_mode_3_size = line_size + (line_size/8) + 1;\n\t\tprev_row = fz_calloc(ctx, line_size, sizeof(unsigned char));\n\t\tout_row_mode_2 = fz_calloc(ctx, max_mode_2_size, sizeof(unsigned char));\n\t\tout_row_mode_3 = fz_calloc(ctx, max_mode_3_size, sizeof(unsigned char));\n\n\t\t/* Transfer raster graphics. */\n\t\tdata = bitmap->samples;\n\t\tss = bitmap->stride;\n\t\tfor (y = 0; y < bitmap->h; y++, data += ss)\n\t\t{\n\t\t\tunsigned char *end_data = data + line_size;\n\n\t\t\tif ((end_data[-1] & rmask) == 0)\n\t\t\t{\n\t\t\t\tend_data--;\n\t\t\t\twhile (end_data > data && end_data[-1] == 0)\n\t\t\t\t\tend_data--;\n\t\t\t}\n\t\t\tif (end_data == data)\n\t\t\t{\n\t\t\t\t/* Blank line */\n\t\t\t\tnum_blank_lines++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\twind();\n\n\t\t\t/* We've reached a non-blank line. */\n\t\t\t/* Put out a spacing command if necessary. */\n\t\t\tif (num_blank_lines == y) {\n\t\t\t\t/* We're at the top of a page. */\n\t\t\t\tif (pcl->features & PCL_ANY_SPACING)\n\t\t\t\t{\n\t\t\t\t\tif (num_blank_lines > 0)\n\t\t\t\t\t\tfz_printf(out, \"\\033*p+%dY\", num_blank_lines * bitmap->yres);\n\t\t\t\t\t/* Start raster graphics. */\n\t\t\t\t\tfz_puts(out, \"\\033*r1A\");\n\t\t\t\t}\n\t\t\t\telse if (pcl->features & PCL_MODE_3_COMPRESSION)\n\t\t\t\t{\n\t\t\t\t\t/* Start raster graphics. */\n\t\t\t\t\tfz_puts(out, \"\\033*r1A\");\n\t\t\t\t\tfor (; num_blank_lines; num_blank_lines--)\n\t\t\t\t\t\tfz_puts(out, \"\\033*b0W\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t/* Start raster graphics. */\n\t\t\t\t\tfz_puts(out, \"\\033*r1A\");\n\t\t\t\t\tfor (; num_blank_lines; num_blank_lines--)\n\t\t\t\t\t\tfz_puts(out, \"\\033*bW\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Skip blank lines if any */\n\t\t\telse if (num_blank_lines != 0)\n\t\t\t{\n\t\t\t\t/* Moving down from current position causes head\n\t\t\t\t * motion on the DeskJet, so if the number of lines\n\t\t\t\t * is small, we're better off printing blanks.\n\t\t\t\t *\n\t\t\t\t * For Canon LBP4i and some others, <ESC>*b<n>Y\n\t\t\t\t * doesn't properly clear the seed row if we are in\n\t\t\t\t * compression mode 3.\n\t\t\t\t */\n\t\t\t\tif ((num_blank_lines < MIN_SKIP_LINES && compression != 3) ||\n\t\t\t\t\t\t!(pcl->features & PCL_ANY_SPACING))\n\t\t\t\t{\n\t\t\t\t\tint mode_3ns = ((pcl->features & PCL_MODE_3_COMPRESSION) && !(pcl->features & PCL_ANY_SPACING));\n\t\t\t\t\tif (mode_3ns && compression != 2)\n\t\t\t\t\t{\n\t\t\t\t\t\t/* Switch to mode 2 */\n\t\t\t\t\t\tfz_puts(out, from3to2);\n\t\t\t\t\t\tcompression = 2;\n\t\t\t\t\t}\n\t\t\t\t\tif (pcl->features & PCL_MODE_3_COMPRESSION)\n\t\t\t\t\t{\n\t\t\t\t\t\t/* Must clear the seed row. */\n\t\t\t\t\t\tfz_puts(out, \"\\033*b1Y\");\n\t\t\t\t\t\tnum_blank_lines--;\n\t\t\t\t\t}\n\t\t\t\t\tif (mode_3ns)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (; num_blank_lines; num_blank_lines--)\n\t\t\t\t\t\t\tfz_puts(out, \"\\033*b0W\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (; num_blank_lines; num_blank_lines--)\n\t\t\t\t\t\t\tfz_puts(out, \"\\033*bW\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (pcl->features & PCL3_SPACING)\n\t\t\t\t\tfz_printf(out, \"\\033*p+%dY\", num_blank_lines * bitmap->yres);\n\t\t\t\telse\n\t\t\t\t\tfz_printf(out, \"\\033*b%dY\", num_blank_lines);\n\t\t\t\t/* Clear the seed row (only matters for mode 3 compression). */\n\t\t\t\tmemset(prev_row, 0, line_size);\n\t\t\t}\n\t\t\tnum_blank_lines = 0;\n\n\t\t\t/* Choose the best compression mode for this particular line. */\n\t\t\tif (pcl->features & PCL_MODE_3_COMPRESSION)\n\t\t\t{\n\t\t\t\t/* Compression modes 2 and 3 are both available. Try\n\t\t\t\t * both and see which produces the least output data.\n\t\t\t\t */\n\t\t\t\tint count3 = mode3compress(out_row_mode_3, data, prev_row, line_size);\n\t\t\t\tint count2 = mode2compress(out_row_mode_2, data, line_size);\n\t\t\t\tint penalty3 = (compression == 3 ? 0 : penalty_from2to3);\n\t\t\t\tint penalty2 = (compression == 2 ? 0 : penalty_from3to2);\n\n\t\t\t\tif (count3 + penalty3 < count2 + penalty2)\n\t\t\t\t{\n\t\t\t\t\tif (compression != 3)\n\t\t\t\t\t\tfz_puts(out, from2to3);\n\t\t\t\t\tcompression = 3;\n\t\t\t\t\tout_data = (unsigned char *)out_row_mode_3;\n\t\t\t\t\tout_count = count3;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (compression != 2)\n\t\t\t\t\t\tfz_puts(out, from3to2);\n\t\t\t\t\tcompression = 2;\n\t\t\t\t\tout_data = (unsigned char *)out_row_mode_2;\n\t\t\t\t\tout_count = count2;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (pcl->features & PCL_MODE_2_COMPRESSION)\n\t\t\t{\n\t\t\t\tout_data = out_row_mode_2;\n\t\t\t\tout_count = mode2compress(out_row_mode_2, data, line_size);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tout_data = data;\n\t\t\t\tout_count = line_size;\n\t\t\t}\n\n\t\t\t/* Transfer the data */\n\t\t\tfz_printf(out, \"\\033*b%dW\", out_count);\n\t\t\tfz_write(out, out_data, out_count);\n\t\t}\n\n\t\t/* end raster graphics and eject page */\n\t\tfz_puts(out, \"\\033*rB\\f\");\n\n\t\tif (pcl->features & HACK__IS_A_OCE9050)\n\t\t{\n\t\t\t/* Pen up, pen select, advance full page, reset */\n\t\t\tfz_puts(out, \"\\033%1BPUSP0PG;\\033E\");\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_free(ctx, prev_row);\n\t\tfz_free(ctx, out_row_mode_2);\n\t\tfz_free(ctx, out_row_mode_3);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nvoid\nfz_write_pcl(fz_context *ctx, fz_pixmap *pixmap, char *filename, int append, fz_pcl_options *pcl)\n{\n\tFILE *fp;\n\tfz_output *out = NULL;\n\n\tfp = fopen(filename, append ? \"ab\" : \"wb\");\n\tif (!fp)\n\t{\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot open file '%s': %s\", filename, strerror(errno));\n\t}\n\n\tfz_var(out);\n\n\tfz_try(ctx)\n\t{\n\t\tout = fz_new_output_with_file(ctx, fp);\n\t\tfz_output_pcl(out, pixmap, pcl);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close_output(out);\n\t\tfclose(fp);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nvoid\nfz_write_pcl_bitmap(fz_context *ctx, fz_bitmap *bitmap, char *filename, int append, fz_pcl_options *pcl)\n{\n\tFILE *fp;\n\tfz_output *out = NULL;\n\n\tfp = fopen(filename, append ? \"ab\" : \"wb\");\n\tif (!fp)\n\t{\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot open file '%s': %s\", filename, strerror(errno));\n\t}\n\n\tfz_var(out);\n\n\tfz_try(ctx)\n\t{\n\t\tout = fz_new_output_with_file(ctx, fp);\n\t\tfz_output_pcl_bitmap(out, bitmap, pcl);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close_output(out);\n\t\tfclose(fp);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/fitz/output-pwg.c",
    "content": "#include \"mupdf/fitz.h\"\n\nvoid\nfz_output_pwg_file_header(fz_output *out)\n{\n\tstatic const unsigned char pwgsig[4] = { 'R', 'a', 'S', '2' };\n\n\t/* Sync word */\n\tfz_write(out, pwgsig, 4);\n}\n\nstatic void\noutput_header(fz_output *out, const fz_pwg_options *pwg, int xres, int yres, int w, int h, int bpp)\n{\n\tstatic const char zero[64] = { 0 };\n\tint i;\n\n\t/* Page Header: */\n\tfz_write(out, pwg ? pwg->media_class : zero, 64);\n\tfz_write(out, pwg ? pwg->media_color : zero, 64);\n\tfz_write(out, pwg ? pwg->media_type : zero, 64);\n\tfz_write(out, pwg ? pwg->output_type : zero, 64);\n\tfz_write_int32be(out, pwg ? pwg->advance_distance : 0);\n\tfz_write_int32be(out, pwg ? pwg->advance_media : 0);\n\tfz_write_int32be(out, pwg ? pwg->collate : 0);\n\tfz_write_int32be(out, pwg ? pwg->cut_media : 0);\n\tfz_write_int32be(out, pwg ? pwg->duplex : 0);\n\tfz_write_int32be(out, xres);\n\tfz_write_int32be(out, yres);\n\t/* CUPS format says that 284->300 are supposed to be the bbox of the\n\t * page in points. PWG says 'Reserved'. */\n\tfor (i=284; i < 300; i += 4)\n\t\tfz_write(out, zero, 4);\n\tfz_write_int32be(out, pwg ? pwg->insert_sheet : 0);\n\tfz_write_int32be(out, pwg ? pwg->jog : 0);\n\tfz_write_int32be(out, pwg ? pwg->leading_edge : 0);\n\t/* CUPS format says that 312->320 are supposed to be the margins of\n\t * the lower left hand edge of page in points. PWG says 'Reserved'. */\n\tfor (i=312; i < 320; i += 4)\n\t\tfz_write(out, zero, 4);\n\tfz_write_int32be(out, pwg ? pwg->manual_feed : 0);\n\tfz_write_int32be(out, pwg ? pwg->media_position : 0);\n\tfz_write_int32be(out, pwg ? pwg->media_weight : 0);\n\tfz_write_int32be(out, pwg ? pwg->mirror_print : 0);\n\tfz_write_int32be(out, pwg ? pwg->negative_print : 0);\n\tfz_write_int32be(out, pwg ? pwg->num_copies : 0);\n\tfz_write_int32be(out, pwg ? pwg->orientation : 0);\n\tfz_write_int32be(out, pwg ? pwg->output_face_up : 0);\n\tfz_write_int32be(out, w * 72/ xres);\t/* Page size in points */\n\tfz_write_int32be(out, h * 72/ yres);\n\tfz_write_int32be(out, pwg ? pwg->separations : 0);\n\tfz_write_int32be(out, pwg ? pwg->tray_switch : 0);\n\tfz_write_int32be(out, pwg ? pwg->tumble : 0);\n\tfz_write_int32be(out, w); /* Page image in pixels */\n\tfz_write_int32be(out, h);\n\tfz_write_int32be(out, pwg ? pwg->media_type_num : 0);\n\tfz_write_int32be(out, bpp < 8 ? 1 : 8); /* Bits per color */\n\tfz_write_int32be(out, bpp); /* Bits per pixel */\n\tfz_write_int32be(out, (w * bpp + 7)/8); /* Bytes per line */\n\tfz_write_int32be(out, 0); /* Chunky pixels */\n\tswitch (bpp)\n\t{\n\tcase 1: fz_write_int32be(out, 3); /* Black */ break;\n\tcase 8: fz_write_int32be(out, 18); /* Sgray */ break;\n\tcase 24: fz_write_int32be(out, 19); /* Srgb */ break;\n\tcase 32: fz_write_int32be(out, 6); /* Cmyk */ break;\n\tdefault: fz_throw(out->ctx, FZ_ERROR_GENERIC, \"pixmap bpp must be 1, 8, 24 or 32 to write as pwg\");\n\t}\n\tfz_write_int32be(out, pwg ? pwg->compression : 0);\n\tfz_write_int32be(out, pwg ? pwg->row_count : 0);\n\tfz_write_int32be(out, pwg ? pwg->row_feed : 0);\n\tfz_write_int32be(out, pwg ? pwg->row_step : 0);\n\tfz_write_int32be(out, bpp <= 8 ? 1 : 3); /* Num Colors */\n\tfor (i=424; i < 452; i += 4)\n\t\tfz_write(out, zero, 4);\n\tfz_write_int32be(out, 1); /* TotalPageCount */\n\tfz_write_int32be(out, 1); /* CrossFeedTransform */\n\tfz_write_int32be(out, 1); /* FeedTransform */\n\tfz_write_int32be(out, 0); /* ImageBoxLeft */\n\tfz_write_int32be(out, 0); /* ImageBoxTop */\n\tfz_write_int32be(out, w); /* ImageBoxRight */\n\tfz_write_int32be(out, h); /* ImageBoxBottom */\n\tfor (i=480; i < 1668; i += 4)\n\t\tfz_write(out, zero, 4);\n\tfz_write(out, pwg ? pwg->rendering_intent : zero, 64);\n\tfz_write(out, pwg ? pwg->page_size_name : zero, 64);\n}\n\nvoid\nfz_output_pwg_page(fz_output *out, const fz_pixmap *pixmap, const fz_pwg_options *pwg)\n{\n\tunsigned char *sp;\n\tint y, x, sn, dn, ss;\n\tfz_context *ctx;\n\n\tif (!out || !pixmap)\n\t\treturn;\n\n\tctx = out->ctx;\n\n\tif (pixmap->n != 1 && pixmap->n != 2 && pixmap->n != 4 && pixmap->n != 5)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"pixmap must be grayscale, rgb or cmyk to write as pwg\");\n\n\tsn = pixmap->n;\n\tdn = pixmap->n;\n\tif (dn > 1)\n\t\tdn--;\n\n\toutput_header(out, pwg, pixmap->xres, pixmap->yres, pixmap->w, pixmap->h, dn*8);\n\n\t/* Now output the actual bitmap, using a packbits like compression */\n\tsp = pixmap->samples;\n\tss = pixmap->w * sn;\n\ty = 0;\n\twhile (y < pixmap->h)\n\t{\n\t\tint yrep;\n\n\t\tassert(sp == pixmap->samples + y * ss);\n\n\t\t/* Count the number of times this line is repeated */\n\t\tfor (yrep = 1; yrep < 256 && y+yrep < pixmap->h; yrep++)\n\t\t{\n\t\t\tif (memcmp(sp, sp + yrep * ss, ss) != 0)\n\t\t\t\tbreak;\n\t\t}\n\t\tfz_write_byte(out, yrep-1);\n\n\t\t/* Encode the line */\n\t\tx = 0;\n\t\twhile (x < pixmap->w)\n\t\t{\n\t\t\tint d;\n\n\t\t\tassert(sp == pixmap->samples + y * ss + x * sn);\n\n\t\t\t/* How far do we have to look to find a repeated value? */\n\t\t\tfor (d = 1; d < 128 && x+d < pixmap->w; d++)\n\t\t\t{\n\t\t\t\tif (memcmp(sp + (d-1)*sn, sp + d*sn, sn) == 0)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (d == 1)\n\t\t\t{\n\t\t\t\tint xrep;\n\n\t\t\t\t/* We immediately have a repeat (or we've hit\n\t\t\t\t * the end of the line). Count the number of\n\t\t\t\t * times this value is repeated. */\n\t\t\t\tfor (xrep = 1; xrep < 128 && x+xrep < pixmap->w; xrep++)\n\t\t\t\t{\n\t\t\t\t\tif (memcmp(sp, sp + xrep*sn, sn) != 0)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tfz_write_byte(out, xrep-1);\n\t\t\t\tfz_write(out, sp, dn);\n\t\t\t\tsp += sn*xrep;\n\t\t\t\tx += xrep;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfz_write_byte(out, 257-d);\n\t\t\t\tx += d;\n\t\t\t\twhile (d > 0)\n\t\t\t\t{\n\t\t\t\t\tfz_write(out, sp, dn);\n\t\t\t\t\tsp += sn;\n\t\t\t\t\td--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* Move to the next line */\n\t\tsp += ss*(yrep-1);\n\t\ty += yrep;\n\t}\n}\n\nvoid\nfz_output_pwg_bitmap_page(fz_output *out, const fz_bitmap *bitmap, const fz_pwg_options *pwg)\n{\n\tunsigned char *sp;\n\tint y, x, ss;\n\tint byte_width;\n\n\tif (!out || !bitmap)\n\t\treturn;\n\n\toutput_header(out, pwg, bitmap->xres, bitmap->yres, bitmap->w, bitmap->h, 1);\n\n\t/* Now output the actual bitmap, using a packbits like compression */\n\tsp = bitmap->samples;\n\tss = bitmap->stride;\n\tbyte_width = (bitmap->w+7)/8;\n\ty = 0;\n\twhile (y < bitmap->h)\n\t{\n\t\tint yrep;\n\n\t\tassert(sp == bitmap->samples + y * ss);\n\n\t\t/* Count the number of times this line is repeated */\n\t\tfor (yrep = 1; yrep < 256 && y+yrep < bitmap->h; yrep++)\n\t\t{\n\t\t\tif (memcmp(sp, sp + yrep * ss, byte_width) != 0)\n\t\t\t\tbreak;\n\t\t}\n\t\tfz_write_byte(out, yrep-1);\n\n\t\t/* Encode the line */\n\t\tx = 0;\n\t\twhile (x < byte_width)\n\t\t{\n\t\t\tint d;\n\n\t\t\tassert(sp == bitmap->samples + y * ss + x);\n\n\t\t\t/* How far do we have to look to find a repeated value? */\n\t\t\tfor (d = 1; d < 128 && x+d < byte_width; d++)\n\t\t\t{\n\t\t\t\tif (sp[d-1] == sp[d])\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (d == 1)\n\t\t\t{\n\t\t\t\tint xrep;\n\n\t\t\t\t/* We immediately have a repeat (or we've hit\n\t\t\t\t * the end of the line). Count the number of\n\t\t\t\t * times this value is repeated. */\n\t\t\t\tfor (xrep = 1; xrep < 128 && x+xrep < byte_width; xrep++)\n\t\t\t\t{\n\t\t\t\t\tif (sp[0] != sp[xrep])\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tfz_write_byte(out, xrep-1);\n\t\t\t\tfz_write(out, sp, 1);\n\t\t\t\tsp += xrep;\n\t\t\t\tx += xrep;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfz_write_byte(out, 257-d);\n\t\t\t\tfz_write(out, sp, d);\n\t\t\t\tsp += d;\n\t\t\t\tx += d;\n\t\t\t}\n\t\t}\n\n\t\t/* Move to the next line */\n\t\tsp += ss*yrep - byte_width;\n\t\ty += yrep;\n\t}\n}\n\nvoid\nfz_output_pwg(fz_output *out, const fz_pixmap *pixmap, const fz_pwg_options *pwg)\n{\n\tfz_output_pwg_file_header(out);\n\tfz_output_pwg_page(out, pixmap, pwg);\n}\n\nvoid\nfz_write_pwg(fz_context *ctx, fz_pixmap *pixmap, char *filename, int append, const fz_pwg_options *pwg)\n{\n\tFILE *fp;\n\tfz_output *out = NULL;\n\n\tfp = fopen(filename, append ? \"ab\" : \"wb\");\n\tif (!fp)\n\t{\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot open file '%s': %s\", filename, strerror(errno));\n\t}\n\n\tfz_var(out);\n\n\tfz_try(ctx)\n\t{\n\t\tout = fz_new_output_with_file(ctx, fp);\n\t\tif (!append)\n\t\t\tfz_output_pwg_file_header(out);\n\t\tfz_output_pwg_page(out, pixmap, pwg);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close_output(out);\n\t\tfclose(fp);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nvoid\nfz_write_pwg_bitmap(fz_context *ctx, fz_bitmap *bitmap, char *filename, int append, const fz_pwg_options *pwg)\n{\n\tFILE *fp;\n\tfz_output *out = NULL;\n\n\tfp = fopen(filename, append ? \"ab\" : \"wb\");\n\tif (!fp)\n\t{\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot open file '%s': %s\", filename, strerror(errno));\n\t}\n\n\tfz_var(out);\n\n\tfz_try(ctx)\n\t{\n\t\tout = fz_new_output_with_file(ctx, fp);\n\t\tif (!append)\n\t\t\tfz_output_pwg_file_header(out);\n\t\tfz_output_pwg_bitmap_page(out, bitmap, pwg);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close_output(out);\n\t\tfclose(fp);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/fitz/output.c",
    "content": "#include \"mupdf/fitz.h\"\n\nvoid fz_rebind_output(fz_output *out, fz_context *ctx)\n{\n\tif (out != NULL)\n\t\tout->ctx = ctx;\n}\n\nstatic int\nfile_printf(fz_output *out, const char *fmt, va_list ap)\n{\n\tFILE *file = (FILE *)out->opaque;\n\n\treturn fz_vfprintf(out->ctx, file, fmt, ap);\n}\n\nstatic int\nfile_write(fz_output *out, const void *buffer, int count)\n{\n\tFILE *file = (FILE *)out->opaque;\n\n\treturn fwrite(buffer, 1, count, file);\n}\n\nstatic void\nfile_close(fz_output *out)\n{\n\tFILE *file = (FILE *)out->opaque;\n\n\tfclose(file);\n}\n\nfz_output *\nfz_new_output_with_file(fz_context *ctx, FILE *file)\n{\n\tfz_output *out = fz_malloc_struct(ctx, fz_output);\n\tout->ctx = ctx;\n\tout->opaque = file;\n\tout->printf = file_printf;\n\tout->write = file_write;\n\tout->close = NULL;\n\treturn out;\n}\n\nfz_output *\nfz_new_output_to_filename(fz_context *ctx, const char *filename)\n{\n\tfz_output *out = NULL;\n\n\tFILE *file = fopen(filename, \"wb\");\n\tif (!file)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot open file '%s': %s\", filename, strerror(errno));\n\n\tfz_var(ctx);\n\n\tfz_try(ctx)\n\t{\n\t\tout = fz_malloc_struct(ctx, fz_output);\n\t\tout->ctx = ctx;\n\t\tout->opaque = file;\n\t\tout->printf = file_printf;\n\t\tout->write = file_write;\n\t\tout->close = file_close;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfclose(file);\n\t\tfz_rethrow(ctx);\n\t}\n\treturn out;\n}\n\nvoid\nfz_close_output(fz_output *out)\n{\n\tif (!out)\n\t\treturn;\n\tif (out->close)\n\t\tout->close(out);\n\tfz_free(out->ctx, out);\n}\n\nint\nfz_printf(fz_output *out, const char *fmt, ...)\n{\n\tint ret;\n\tva_list ap;\n\n\tif (!out)\n\t\treturn 0;\n\n\tva_start(ap, fmt);\n\tret = out->printf(out, fmt, ap);\n\tva_end(ap);\n\n\treturn ret;\n}\n\nint\nfz_write(fz_output *out, const void *data, int len)\n{\n\tif (!out)\n\t\treturn 0;\n\treturn out->write(out, data, len);\n}\n\nvoid\nfz_putc(fz_output *out, char c)\n{\n\tif (out)\n\t\t(void)out->write(out, &c, 1);\n}\n\nint\nfz_puts(fz_output *out, const char *str)\n{\n\tif (!out)\n\t\treturn 0;\n\treturn out->write(out, str, strlen(str));\n}\n\nstatic int\nbuffer_printf(fz_output *out, const char *fmt, va_list list)\n{\n\tfz_buffer *buffer = (fz_buffer *)out->opaque;\n\n\treturn fz_buffer_vprintf(out->ctx, buffer, fmt, list);\n}\n\nstatic int\nbuffer_write(fz_output *out, const void *data, int len)\n{\n\tfz_buffer *buffer = (fz_buffer *)out->opaque;\n\n\tfz_write_buffer(out->ctx, buffer, (unsigned char *)data, len);\n\treturn len;\n}\n\nfz_output *\nfz_new_output_with_buffer(fz_context *ctx, fz_buffer *buf)\n{\n\tfz_output *out = fz_malloc_struct(ctx, fz_output);\n\tout->ctx = ctx;\n\tout->opaque = buf;\n\tout->printf = buffer_printf;\n\tout->write = buffer_write;\n\tout->close = NULL;\n\treturn out;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/path.c",
    "content": "#include <assert.h>\n#include \"mupdf/fitz.h\"\n\nfz_path *\nfz_new_path(fz_context *ctx)\n{\n\tfz_path *path;\n\n\tpath = fz_malloc_struct(ctx, fz_path);\n\tpath->last_cmd = 0;\n\tpath->current.x = 0;\n\tpath->current.y = 0;\n\tpath->begin.x = 0;\n\tpath->begin.y = 0;\n\n\treturn path;\n}\n\nfz_path *\nfz_clone_path(fz_context *ctx, fz_path *old)\n{\n\tfz_path *path;\n\n\tassert(old);\n\tpath = fz_malloc_struct(ctx, fz_path);\n\tfz_try(ctx)\n\t{\n\t\tpath->cmd_len = old->cmd_len;\n\t\tpath->cmd_cap = old->cmd_len;\n\t\tpath->cmds = fz_malloc_array(ctx, path->cmd_cap, sizeof(unsigned char));\n\t\tmemcpy(path->cmds, old->cmds, sizeof(unsigned char) * path->cmd_len);\n\n\t\tpath->coord_len = old->coord_len;\n\t\tpath->coord_cap = old->coord_len;\n\t\tpath->coords = fz_malloc_array(ctx, path->coord_cap, sizeof(float));\n\t\tmemcpy(path->coords, old->coords, sizeof(float) * path->coord_len);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, path->cmds);\n\t\tfz_free(ctx, path->coords);\n\t\tfz_free(ctx, path);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn path;\n}\n\nvoid\nfz_free_path(fz_context *ctx, fz_path *path)\n{\n\tif (path == NULL)\n\t\treturn;\n\tfz_free(ctx, path->cmds);\n\tfz_free(ctx, path->coords);\n\tfz_free(ctx, path);\n}\n\nstatic void\npush_cmd(fz_context *ctx, fz_path *path, int cmd)\n{\n\tif (path->cmd_len + 1 >= path->cmd_cap)\n\t{\n\t\tint new_cmd_cap = fz_maxi(16, path->cmd_cap * 2);\n\t\tpath->cmds = fz_resize_array(ctx, path->cmds, new_cmd_cap, sizeof(unsigned char));\n\t\tpath->cmd_cap = new_cmd_cap;\n\t}\n\n\tpath->cmds[path->cmd_len++] = cmd;\n\tpath->last_cmd = cmd;\n}\n\nstatic void\npush_coord(fz_context *ctx, fz_path *path, float x, float y)\n{\n\tif (path->coord_len + 2 >= path->coord_cap)\n\t{\n\t\tint new_coord_cap = fz_maxi(32, path->coord_cap * 2);\n\t\tpath->coords = fz_resize_array(ctx, path->coords, new_coord_cap, sizeof(float));\n\t\tpath->coord_cap = new_coord_cap;\n\t}\n\n\tpath->coords[path->coord_len++] = x;\n\tpath->coords[path->coord_len++] = y;\n\n\tpath->current.x = x;\n\tpath->current.y = y;\n}\n\nfz_point\nfz_currentpoint(fz_context *ctx, fz_path *path)\n{\n\treturn path->current;\n}\n\nvoid\nfz_moveto(fz_context *ctx, fz_path *path, float x, float y)\n{\n\tif (path->cmd_len > 0 && path->last_cmd == FZ_MOVETO)\n\t{\n\t\t/* Collapse moveto followed by moveto. */\n\t\tpath->coords[path->coord_len-2] = x;\n\t\tpath->coords[path->coord_len-1] = y;\n\t\tpath->current.x = x;\n\t\tpath->current.y = y;\n\t\tpath->begin = path->current;\n\t\treturn;\n\t}\n\n\tpush_cmd(ctx, path, FZ_MOVETO);\n\tpush_coord(ctx, path, x, y);\n\n\tpath->begin = path->current;\n}\n\nvoid\nfz_lineto(fz_context *ctx, fz_path *path, float x, float y)\n{\n\tfloat x0 = path->current.x;\n\tfloat y0 = path->current.y;\n\n\tif (path->cmd_len == 0)\n\t{\n\t\tfz_warn(ctx, \"lineto with no current point\");\n\t\treturn;\n\t}\n\n\t/* Anything other than MoveTo followed by LineTo the same place is a nop */\n\tif (path->last_cmd != FZ_MOVETO && x0 == x && y0 == y)\n\t\treturn;\n\n\tpush_cmd(ctx, path, FZ_LINETO);\n\tpush_coord(ctx, path, x, y);\n}\n\nvoid\nfz_curveto(fz_context *ctx, fz_path *path,\n\tfloat x1, float y1,\n\tfloat x2, float y2,\n\tfloat x3, float y3)\n{\n\tfloat x0 = path->current.x;\n\tfloat y0 = path->current.y;\n\n\tif (path->cmd_len == 0)\n\t{\n\t\tfz_warn(ctx, \"curveto with no current point\");\n\t\treturn;\n\t}\n\n\t/* Check for degenerate cases: */\n\tif (x0 == x1 && y0 == y1)\n\t{\n\t\tif (x2 == x3 && y2 == y3)\n\t\t{\n\t\t\t/* If (x1,y1)==(x2,y2) and prev wasn't a moveto, then skip */\n\t\t\tif (x1 == x2 && y1 == y2 && path->last_cmd != FZ_MOVETO)\n\t\t\t\treturn;\n\t\t\t/* Otherwise a line will suffice */\n\t\t\tfz_lineto(ctx, path, x3, y3);\n\t\t\treturn;\n\t\t}\n\t\tif (x1 == x2 && y1 == y2)\n\t\t{\n\t\t\t/* A line will suffice */\n\t\t\tfz_lineto(ctx, path, x3, y3);\n\t\t\treturn;\n\t\t}\n\t}\n\telse if (x1 == x2 && y1 == y2 && x2 == x3 && y2 == y3)\n\t{\n\t\t/* A line will suffice */\n\t\tfz_lineto(ctx, path, x3, y3);\n\t\treturn;\n\t}\n\n\tpush_cmd(ctx, path, FZ_CURVETO);\n\tpush_coord(ctx, path, x1, y1);\n\tpush_coord(ctx, path, x2, y2);\n\tpush_coord(ctx, path, x3, y3);\n}\n\nvoid\nfz_curvetov(fz_context *ctx, fz_path *path, float x2, float y2, float x3, float y3)\n{\n\tfloat x1 = path->current.x;\n\tfloat y1 = path->current.y;\n\n\tif (path->cmd_len == 0)\n\t{\n\t\tfz_warn(ctx, \"curvetov with no current point\");\n\t\treturn;\n\t}\n\n\tfz_curveto(ctx, path, x1, y1, x2, y2, x3, y3);\n}\n\nvoid\nfz_curvetoy(fz_context *ctx, fz_path *path, float x1, float y1, float x3, float y3)\n{\n\tfz_curveto(ctx, path, x1, y1, x3, y3, x3, y3);\n}\n\nvoid\nfz_closepath(fz_context *ctx, fz_path *path)\n{\n\tif (path->cmd_len == 0)\n\t{\n\t\tfz_warn(ctx, \"closepath with no current point\");\n\t\treturn;\n\t}\n\n\t/* CLOSE following a CLOSE is a NOP */\n\tif (path->last_cmd == FZ_CLOSE_PATH)\n\t\treturn;\n\n\tpush_cmd(ctx, path, FZ_CLOSE_PATH);\n\n\tpath->current = path->begin;\n}\n\nstatic inline fz_rect *bound_expand(fz_rect *r, const fz_point *p)\n{\n\tif (p->x < r->x0) r->x0 = p->x;\n\tif (p->y < r->y0) r->y0 = p->y;\n\tif (p->x > r->x1) r->x1 = p->x;\n\tif (p->y > r->y1) r->y1 = p->y;\n\treturn r;\n}\n\nfz_rect *\nfz_bound_path(fz_context *ctx, fz_path *path, const fz_stroke_state *stroke, const fz_matrix *ctm, fz_rect *r)\n{\n\tfz_point p;\n\tint i = 0, k = 0;\n\n\t/* If the path is empty, return the empty rectangle here - don't wait\n\t * for it to be expanded in the stroked case below.\n\t * A path must start with a moveto - and if that's all there is\n\t * then the path is empty. */\n\tif (path->cmd_len == 0 || path->cmd_len == 1)\n\t{\n\t\t*r = fz_empty_rect;\n\t\treturn r;\n\t}\n\n\t/* Initial moveto point */\n\tp.x = path->coords[0];\n\tp.y = path->coords[1];\n\tfz_transform_point(&p, ctm);\n\tr->x0 = r->x1 = p.x;\n\tr->y0 = r->y1 = p.y;\n\n\twhile (i < path->cmd_len)\n\t{\n\t\tswitch (path->cmds[i++])\n\t\t{\n\t\tcase FZ_CURVETO:\n\t\t\tp.x = path->coords[k++];\n\t\t\tp.y = path->coords[k++];\n\t\t\tbound_expand(r, fz_transform_point(&p, ctm));\n\t\t\tp.x = path->coords[k++];\n\t\t\tp.y = path->coords[k++];\n\t\t\tbound_expand(r, fz_transform_point(&p, ctm));\n\t\t\tp.x = path->coords[k++];\n\t\t\tp.y = path->coords[k++];\n\t\t\tbound_expand(r, fz_transform_point(&p, ctm));\n\t\t\tbreak;\n\t\tcase FZ_MOVETO:\n\t\t\tif (k + 2 == path->coord_len)\n\t\t\t{\n\t\t\t\t/* Trailing Moveto - cannot affect bbox */\n\t\t\t\tk += 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t/* fallthrough */\n\t\tcase FZ_LINETO:\n\t\t\tp.x = path->coords[k++];\n\t\t\tp.y = path->coords[k++];\n\t\t\tbound_expand(r, fz_transform_point(&p, ctm));\n\t\t\tbreak;\n\t\tcase FZ_CLOSE_PATH:\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (stroke)\n\t{\n\t\tfz_adjust_rect_for_stroke(r, stroke, ctm);\n\t}\n\n\treturn r;\n}\n\nfz_rect *\nfz_adjust_rect_for_stroke(fz_rect *r, const fz_stroke_state *stroke, const fz_matrix *ctm)\n{\n\tfloat expand;\n\n\tif (!stroke)\n\t\treturn r;\n\n\texpand = stroke->linewidth;\n\texpand *= 0.5; /* SumatraPDF: expansion happens from the middle of the line */\n\tif (expand == 0)\n\t\texpand = 1.0f;\n\texpand *= fz_matrix_max_expansion(ctm);\n\tif ((stroke->linejoin == FZ_LINEJOIN_MITER || stroke->linejoin == FZ_LINEJOIN_MITER_XPS) && stroke->miterlimit > 1)\n\t\texpand *= stroke->miterlimit;\n\n\tr->x0 -= expand;\n\tr->y0 -= expand;\n\tr->x1 += expand;\n\tr->y1 += expand;\n\treturn r;\n}\n\nvoid\nfz_transform_path(fz_context *ctx, fz_path *path, const fz_matrix *ctm)\n{\n\tint i;\n\tfor (i = 0; i < path->coord_len; i += 2)\n\t\tfz_transform_point((fz_point *)&path->coords[i], ctm);\n}\n\n#ifndef NDEBUG\nvoid\nfz_print_path(fz_context *ctx, FILE *out, fz_path *path, int indent)\n{\n\tfloat x, y;\n\tint i = 0, k = 0;\n\tint n;\n\twhile (i < path->cmd_len)\n\t{\n\t\tfor (n = 0; n < indent; n++)\n\t\t\tfputc(' ', out);\n\t\tswitch (path->cmds[i++])\n\t\t{\n\t\tcase FZ_MOVETO:\n\t\t\tx = path->coords[k++];\n\t\t\ty = path->coords[k++];\n\t\t\tfprintf(out, \"%g %g m\\n\", x, y);\n\t\t\tbreak;\n\t\tcase FZ_LINETO:\n\t\t\tx = path->coords[k++];\n\t\t\ty = path->coords[k++];\n\t\t\tfprintf(out, \"%g %g l\\n\", x, y);\n\t\t\tbreak;\n\t\tcase FZ_CURVETO:\n\t\t\tx = path->coords[k++];\n\t\t\ty = path->coords[k++];\n\t\t\tfprintf(out, \"%g %g \", x, y);\n\t\t\tx = path->coords[k++];\n\t\t\ty = path->coords[k++];\n\t\t\tfprintf(out, \"%g %g \", x, y);\n\t\t\tx = path->coords[k++];\n\t\t\ty = path->coords[k++];\n\t\t\tfprintf(out, \"%g %g c\\n\", x, y);\n\t\t\tbreak;\n\t\tcase FZ_CLOSE_PATH:\n\t\t\tfprintf(out, \"h\\n\");\n\t\t\tbreak;\n\t\t}\n\t}\n}\n#endif\n\nconst fz_stroke_state fz_default_stroke_state = {\n\t-2, /* -2 is the magic number we use when we have stroke states stored on the stack */\n\tFZ_LINECAP_BUTT, FZ_LINECAP_BUTT, FZ_LINECAP_BUTT,\n\tFZ_LINEJOIN_MITER,\n\t1, 10,\n\t0, 0, { 0 }\n};\n\nfz_stroke_state *\nfz_keep_stroke_state(fz_context *ctx, fz_stroke_state *stroke)\n{\n\tif (!stroke)\n\t\treturn NULL;\n\n\t/* -2 is the magic number we use when we have stroke states stored on the stack */\n\tif (stroke->refs == -2)\n\t\treturn fz_clone_stroke_state(ctx, stroke);\n\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tif (stroke->refs > 0)\n\t\tstroke->refs++;\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\treturn stroke;\n}\n\nvoid\nfz_drop_stroke_state(fz_context *ctx, fz_stroke_state *stroke)\n{\n\tint drop;\n\n\tif (!stroke)\n\t\treturn;\n\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tdrop = (stroke->refs > 0 ? --stroke->refs == 0 : 0);\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\tif (drop)\n\t\tfz_free(ctx, stroke);\n}\n\nfz_stroke_state *\nfz_new_stroke_state_with_dash_len(fz_context *ctx, int len)\n{\n\tfz_stroke_state *state;\n\n\tlen -= nelem(state->dash_list);\n\tif (len < 0)\n\t\tlen = 0;\n\n\tstate = Memento_label(fz_malloc(ctx, sizeof(*state) + sizeof(state->dash_list[0]) * len), \"fz_stroke_state\");\n\tstate->refs = 1;\n\tstate->start_cap = FZ_LINECAP_BUTT;\n\tstate->dash_cap = FZ_LINECAP_BUTT;\n\tstate->end_cap = FZ_LINECAP_BUTT;\n\tstate->linejoin = FZ_LINEJOIN_MITER;\n\tstate->linewidth = 1;\n\tstate->miterlimit = 10;\n\tstate->dash_phase = 0;\n\tstate->dash_len = 0;\n\tmemset(state->dash_list, 0, sizeof(state->dash_list[0]) * (len + nelem(state->dash_list)));\n\n\treturn state;\n}\n\nfz_stroke_state *\nfz_new_stroke_state(fz_context *ctx)\n{\n\treturn fz_new_stroke_state_with_dash_len(ctx, 0);\n}\n\nfz_stroke_state *\nfz_clone_stroke_state(fz_context *ctx, fz_stroke_state *stroke)\n{\n\tfz_stroke_state *clone = fz_new_stroke_state_with_dash_len(ctx, stroke->dash_len);\n\tint extra = stroke->dash_len - nelem(stroke->dash_list);\n\tint size = sizeof(*stroke) + sizeof(stroke->dash_list[0]) * extra;\n\tmemcpy(clone, stroke, size);\n\tclone->refs = 1;\n\treturn clone;\n}\n\nfz_stroke_state *\nfz_unshare_stroke_state_with_dash_len(fz_context *ctx, fz_stroke_state *shared, int len)\n{\n\tint single, unsize, shsize, shlen, drop;\n\tfz_stroke_state *unshared;\n\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tsingle = (shared->refs == 1);\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\n\tshlen = shared->dash_len - nelem(shared->dash_list);\n\tif (shlen < 0)\n\t\tshlen = 0;\n\tshsize = sizeof(*shared) + sizeof(shared->dash_list[0]) * shlen;\n\tlen -= nelem(shared->dash_list);\n\tif (len < 0)\n\t\tlen = 0;\n\tif (single && shlen >= len)\n\t\treturn shared;\n\tunsize = sizeof(*unshared) + sizeof(unshared->dash_list[0]) * len;\n\tunshared = Memento_label(fz_malloc(ctx, unsize), \"fz_stroke_state\");\n\tmemcpy(unshared, shared, (shsize > unsize ? unsize : shsize));\n\tunshared->refs = 1;\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tdrop = (shared->refs > 0 ? --shared->refs == 0 : 0);\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\tif (drop)\n\t\tfz_free(ctx, shared);\n\treturn unshared;\n}\n\nfz_stroke_state *\nfz_unshare_stroke_state(fz_context *ctx, fz_stroke_state *shared)\n{\n\treturn fz_unshare_stroke_state_with_dash_len(ctx, shared, shared->dash_len);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/pixmap.c",
    "content": "#include \"mupdf/fitz.h\"\n\nfz_pixmap *\nfz_keep_pixmap(fz_context *ctx, fz_pixmap *pix)\n{\n\treturn (fz_pixmap *)fz_keep_storable(ctx, &pix->storable);\n}\n\nvoid\nfz_drop_pixmap(fz_context *ctx, fz_pixmap *pix)\n{\n\tfz_drop_storable(ctx, &pix->storable);\n}\n\nvoid\nfz_free_pixmap_imp(fz_context *ctx, fz_storable *pix_)\n{\n\tfz_pixmap *pix = (fz_pixmap *)pix_;\n\n\tif (pix->colorspace)\n\t\tfz_drop_colorspace(ctx, pix->colorspace);\n\tif (pix->free_samples)\n\t\tfz_free(ctx, pix->samples);\n\tfz_free(ctx, pix);\n}\n\nfz_pixmap *\nfz_new_pixmap_with_data(fz_context *ctx, fz_colorspace *colorspace, int w, int h, unsigned char *samples)\n{\n\tfz_pixmap *pix;\n\n\tif (w < 0 || h < 0)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Illegal dimensions for pixmap %d %d\", w, h);\n\n\tpix = fz_malloc_struct(ctx, fz_pixmap);\n\tFZ_INIT_STORABLE(pix, 1, fz_free_pixmap_imp);\n\tpix->x = 0;\n\tpix->y = 0;\n\tpix->w = w;\n\tpix->h = h;\n\tpix->interpolate = 1;\n\tpix->xres = 96;\n\tpix->yres = 96;\n\tpix->colorspace = NULL;\n\tpix->n = 1;\n\n\tif (colorspace)\n\t{\n\t\tpix->colorspace = fz_keep_colorspace(ctx, colorspace);\n\t\tpix->n = 1 + colorspace->n;\n\t}\n\n\tpix->samples = samples;\n\tif (samples)\n\t{\n\t\tpix->free_samples = 0;\n\t}\n\telse\n\t{\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tif (pix->w + pix->n - 1 > INT_MAX / pix->n)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"overly wide image\");\n\t\t\tpix->samples = fz_malloc_array(ctx, pix->h, pix->w * pix->n);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tif (colorspace)\n\t\t\t\tfz_drop_colorspace(ctx, colorspace);\n\t\t\tfz_free(ctx, pix);\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t\tpix->free_samples = 1;\n\t}\n\n\treturn pix;\n}\n\nfz_pixmap *\nfz_new_pixmap(fz_context *ctx, fz_colorspace *colorspace, int w, int h)\n{\n\treturn fz_new_pixmap_with_data(ctx, colorspace, w, h, NULL);\n}\n\nfz_pixmap *\nfz_new_pixmap_with_bbox(fz_context *ctx, fz_colorspace *colorspace, const fz_irect *r)\n{\n\tfz_pixmap *pixmap;\n\tpixmap = fz_new_pixmap(ctx, colorspace, r->x1 - r->x0, r->y1 - r->y0);\n\tpixmap->x = r->x0;\n\tpixmap->y = r->y0;\n\treturn pixmap;\n}\n\nfz_pixmap *\nfz_new_pixmap_with_bbox_and_data(fz_context *ctx, fz_colorspace *colorspace, const fz_irect *r, unsigned char *samples)\n{\n\tfz_pixmap *pixmap = fz_new_pixmap_with_data(ctx, colorspace, r->x1 - r->x0, r->y1 - r->y0, samples);\n\tpixmap->x = r->x0;\n\tpixmap->y = r->y0;\n\treturn pixmap;\n}\n\nfz_irect *\nfz_pixmap_bbox(fz_context *ctx, fz_pixmap *pix, fz_irect *bbox)\n{\n\tbbox->x0 = pix->x;\n\tbbox->y0 = pix->y;\n\tbbox->x1 = pix->x + pix->w;\n\tbbox->y1 = pix->y + pix->h;\n\treturn bbox;\n}\n\nfz_irect *\nfz_pixmap_bbox_no_ctx(fz_pixmap *pix, fz_irect *bbox)\n{\n\tbbox->x0 = pix->x;\n\tbbox->y0 = pix->y;\n\tbbox->x1 = pix->x + pix->w;\n\tbbox->y1 = pix->y + pix->h;\n\treturn bbox;\n}\n\nint\nfz_pixmap_width(fz_context *ctx, fz_pixmap *pix)\n{\n\treturn pix->w;\n}\n\nint\nfz_pixmap_height(fz_context *ctx, fz_pixmap *pix)\n{\n\treturn pix->h;\n}\n\nvoid\nfz_clear_pixmap(fz_context *ctx, fz_pixmap *pix)\n{\n\tmemset(pix->samples, 0, (unsigned int)(pix->w * pix->h * pix->n));\n}\n\nvoid\nfz_clear_pixmap_with_value(fz_context *ctx, fz_pixmap *pix, int value)\n{\n\t/* CMYK needs special handling (and potentially any other subtractive colorspaces) */\n\tif (pix->colorspace && pix->colorspace->n == 4)\n\t{\n\t\tint x, y;\n\t\tunsigned char *s = pix->samples;\n\n\t\tvalue = 255 - value;\n\t\tfor (y = 0; y < pix->h; y++)\n\t\t{\n\t\t\tfor (x = 0; x < pix->w; x++)\n\t\t\t{\n\t\t\t\t*s++ = 0;\n\t\t\t\t*s++ = 0;\n\t\t\t\t*s++ = 0;\n\t\t\t\t*s++ = value;\n\t\t\t\t*s++ = 255;\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}\n\n\tif (value == 255)\n\t{\n\t\tmemset(pix->samples, 255, (unsigned int)(pix->w * pix->h * pix->n));\n\t}\n\telse\n\t{\n\t\tint k, x, y;\n\t\tunsigned char *s = pix->samples;\n\t\tfor (y = 0; y < pix->h; y++)\n\t\t{\n\t\t\tfor (x = 0; x < pix->w; x++)\n\t\t\t{\n\t\t\t\tfor (k = 0; k < pix->n - 1; k++)\n\t\t\t\t\t*s++ = value;\n\t\t\t\t*s++ = 255;\n\t\t\t}\n\t\t}\n\t}\n}\n\nvoid\nfz_copy_pixmap_rect(fz_context *ctx, fz_pixmap *dest, fz_pixmap *src, const fz_irect *b)\n{\n\tconst unsigned char *srcp;\n\tunsigned char *destp;\n\tint x, y, w, destspan, srcspan;\n\tfz_irect local_b, bb;\n\n\tlocal_b = *b;\n\tfz_intersect_irect(&local_b, fz_pixmap_bbox(ctx, dest, &bb));\n\tfz_intersect_irect(&local_b, fz_pixmap_bbox(ctx, src, &bb));\n\tw = local_b.x1 - local_b.x0;\n\ty = local_b.y1 - local_b.y0;\n\tif (w <= 0 || y <= 0)\n\t\treturn;\n\n\tsrcspan = src->w * src->n;\n\tsrcp = src->samples + (unsigned int)(srcspan * (local_b.y0 - src->y) + src->n * (local_b.x0 - src->x));\n\tdestspan = dest->w * dest->n;\n\tdestp = dest->samples + (unsigned int)(destspan * (local_b.y0 - dest->y) + dest->n * (local_b.x0 - dest->x));\n\n\tif (src->n == dest->n)\n\t{\n\t\tw *= src->n;\n\t\tdo\n\t\t{\n\t\t\tmemcpy(destp, srcp, w);\n\t\t\tsrcp += srcspan;\n\t\t\tdestp += destspan;\n\t\t}\n\t\twhile (--y);\n\t}\n\telse if (src->n == 2 && dest->n == 4)\n\t{\n\t\t/* Copy, and convert from grey+alpha to rgb+alpha */\n\t\tsrcspan -= w*2;\n\t\tdestspan -= w*4;\n\t\tdo\n\t\t{\n\t\t\tfor (x = w; x > 0; x--)\n\t\t\t{\n\t\t\t\tunsigned char v = *srcp++;\n\t\t\t\tunsigned char a = *srcp++;\n\t\t\t\t*destp++ = v;\n\t\t\t\t*destp++ = v;\n\t\t\t\t*destp++ = v;\n\t\t\t\t*destp++ = a;\n\t\t\t}\n\t\t\tsrcp += srcspan;\n\t\t\tdestp += destspan;\n\t\t}\n\t\twhile (--y);\n\t}\n\telse if (src->n == 4 && dest->n == 2)\n\t{\n\t\t/* Copy, and convert from rgb+alpha to grey+alpha */\n\t\tsrcspan -= w*4;\n\t\tdestspan -= w*2;\n\t\tdo\n\t\t{\n\t\t\tfor (x = w; x > 0; x--)\n\t\t\t{\n\t\t\t\tint v;\n\t\t\t\tv = *srcp++;\n\t\t\t\tv += *srcp++;\n\t\t\t\tv += *srcp++;\n\t\t\t\t*destp++ = (unsigned char)((v+1)/3);\n\t\t\t\t*destp++ = *srcp++;\n\t\t\t}\n\t\t\tsrcp += srcspan;\n\t\t\tdestp += destspan;\n\t\t}\n\t\twhile (--y);\n\t}\n\telse\n\t{\n\t\t/* FIXME: Crap conversion */\n\t\tint z;\n\t\tint sn = src->n-1;\n\t\tint dn = dest->n-1;\n\n\t\tsrcspan -= w*src->n;\n\t\tdestspan -= w*dest->n;\n\t\tdo\n\t\t{\n\t\t\tfor (x = w; x > 0; x--)\n\t\t\t{\n\t\t\t\tint v = 0;\n\t\t\t\tfor (z = sn; z > 0; z--)\n\t\t\t\t\tv += *srcp++;\n\t\t\t\tv = (v * dn + (sn>>1)) / sn;\n\t\t\t\tfor (z = dn; z > 0; z--)\n\t\t\t\t\t*destp++ = (unsigned char)v;\n\t\t\t\t*destp++ = *srcp++;\n\t\t\t}\n\t\t\tsrcp += srcspan;\n\t\t\tdestp += destspan;\n\t\t}\n\t\twhile (--y);\n\t}\n}\n\nvoid\nfz_clear_pixmap_rect_with_value(fz_context *ctx, fz_pixmap *dest, int value, const fz_irect *b)\n{\n\tunsigned char *destp;\n\tint x, y, w, k, destspan;\n\tfz_irect bb;\n\tfz_irect local_b = *b;\n\n\tfz_intersect_irect(&local_b, fz_pixmap_bbox(ctx, dest, &bb));\n\tw = local_b.x1 - local_b.x0;\n\ty = local_b.y1 - local_b.y0;\n\tif (w <= 0 || y <= 0)\n\t\treturn;\n\n\tdestspan = dest->w * dest->n;\n\tdestp = dest->samples + (unsigned int)(destspan * (local_b.y0 - dest->y) + dest->n * (local_b.x0 - dest->x));\n\n\t/* CMYK needs special handling (and potentially any other subtractive colorspaces) */\n\tif (dest->colorspace && dest->colorspace->n == 4)\n\t{\n\t\tvalue = 255 - value;\n\t\tdo\n\t\t{\n\t\t\tunsigned char *s = destp;\n\t\t\tfor (x = 0; x < w; x++)\n\t\t\t{\n\t\t\t\t*s++ = 0;\n\t\t\t\t*s++ = 0;\n\t\t\t\t*s++ = 0;\n\t\t\t\t*s++ = value;\n\t\t\t\t*s++ = 255;\n\t\t\t}\n\t\t\tdestp += destspan;\n\t\t}\n\t\twhile (--y);\n\t\treturn;\n\t}\n\n\tif (value == 255)\n\t{\n\t\tdo\n\t\t{\n\t\t\tmemset(destp, 255, (unsigned int)(w * dest->n));\n\t\t\tdestp += destspan;\n\t\t}\n\t\twhile (--y);\n\t}\n\telse\n\t{\n\t\tdo\n\t\t{\n\t\t\tunsigned char *s = destp;\n\t\t\tfor (x = 0; x < w; x++)\n\t\t\t{\n\t\t\t\tfor (k = 0; k < dest->n - 1; k++)\n\t\t\t\t\t*s++ = value;\n\t\t\t\t*s++ = 255;\n\t\t\t}\n\t\t\tdestp += destspan;\n\t\t}\n\t\twhile (--y);\n\t}\n}\n\nvoid\nfz_premultiply_pixmap(fz_context *ctx, fz_pixmap *pix)\n{\n\tunsigned char *s = pix->samples;\n\tunsigned char a;\n\tint k, x, y;\n\n\tfor (y = 0; y < pix->h; y++)\n\t{\n\t\tfor (x = 0; x < pix->w; x++)\n\t\t{\n\t\t\ta = s[pix->n - 1];\n\t\t\tfor (k = 0; k < pix->n - 1; k++)\n\t\t\t\ts[k] = fz_mul255(s[k], a);\n\t\t\ts += pix->n;\n\t\t}\n\t}\n}\n\nvoid\nfz_unmultiply_pixmap(fz_context *ctx, fz_pixmap *pix)\n{\n\tunsigned char *s = pix->samples;\n\tint a, inva;\n\tint k, x, y;\n\n\tfor (y = 0; y < pix->h; y++)\n\t{\n\t\tfor (x = 0; x < pix->w; x++)\n\t\t{\n\t\t\ta = s[pix->n - 1];\n\t\t\tinva = a ? 255 * 256 / a : 0;\n\t\t\tfor (k = 0; k < pix->n - 1; k++)\n\t\t\t\ts[k] = (s[k] * inva) >> 8;\n\t\t\ts += pix->n;\n\t\t}\n\t}\n}\n\nfz_pixmap *\nfz_alpha_from_gray(fz_context *ctx, fz_pixmap *gray, int luminosity)\n{\n\tfz_pixmap *alpha;\n\tunsigned char *sp, *dp;\n\tint len;\n\tfz_irect bbox;\n\n\tassert(gray->n == 2);\n\n\talpha = fz_new_pixmap_with_bbox(ctx, NULL, fz_pixmap_bbox(ctx, gray, &bbox));\n\tdp = alpha->samples;\n\tsp = gray->samples;\n\tif (!luminosity)\n\t\tsp ++;\n\n\tlen = gray->w * gray->h;\n\twhile (len--)\n\t{\n\t\t*dp++ = sp[0];\n\t\tsp += 2;\n\t}\n\n\treturn alpha;\n}\n\nvoid\nfz_tint_pixmap(fz_context *ctx, fz_pixmap *pix, int r, int g, int b)\n{\n\tunsigned char *s = pix->samples;\n\tint x, y;\n\n\tif (pix->colorspace == fz_device_bgr(ctx))\n\t{\n\t\tint save = r;\n\t\tr = b;\n\t\tb = save;\n\t}\n\telse if (pix->colorspace == fz_device_gray(ctx))\n\t{\n\t\tg = (r + g + b) / 3;\n\t}\n\telse if (pix->colorspace != fz_device_rgb(ctx))\n\t{\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"can only tint RGB, BGR and Gray pixmaps\");\n\t}\n\n\tif (pix->n == 4)\n\t{\n\t\tfor (x = 0; x < pix->w; x++)\n\t\t{\n\t\t\tfor (y = 0; y < pix->h; y++)\n\t\t\t{\n\t\t\t\ts[0] = fz_mul255(s[0], r);\n\t\t\t\ts[1] = fz_mul255(s[1], g);\n\t\t\t\ts[2] = fz_mul255(s[2], b);\n\t\t\t\ts += 4;\n\t\t\t}\n\t\t}\n\t}\n\telse if (pix->n == 2)\n\t{\n\t\tfor (x = 0; x < pix->w; x++)\n\t\t{\n\t\t\tfor (y = 0; y < pix->h; y++)\n\t\t\t{\n\t\t\t\t*s = fz_mul255(*s, g);\n\t\t\t\ts += 2;\n\t\t\t}\n\t\t}\n\t}\n}\n\nvoid\nfz_invert_pixmap(fz_context *ctx, fz_pixmap *pix)\n{\n\tunsigned char *s = pix->samples;\n\tint k, x, y;\n\n\tfor (y = 0; y < pix->h; y++)\n\t{\n\t\tfor (x = 0; x < pix->w; x++)\n\t\t{\n\t\t\tfor (k = 0; k < pix->n - 1; k++)\n\t\t\t\ts[k] = 255 - s[k];\n\t\t\ts += pix->n;\n\t\t}\n\t}\n}\n\nvoid fz_invert_pixmap_rect(fz_pixmap *image, const fz_irect *rect)\n{\n\tunsigned char *p;\n\tint x, y, n;\n\n\tint x0 = fz_clampi(rect->x0 - image->x, 0, image->w - 1);\n\tint x1 = fz_clampi(rect->x1 - image->x, 0, image->w - 1);\n\tint y0 = fz_clampi(rect->y0 - image->y, 0, image->h - 1);\n\tint y1 = fz_clampi(rect->y1 - image->y, 0, image->h - 1);\n\n\tfor (y = y0; y < y1; y++)\n\t{\n\t\tp = image->samples + (unsigned int)((y * image->w + x0) * image->n);\n\t\tfor (x = x0; x < x1; x++)\n\t\t{\n\t\t\tfor (n = image->n; n > 1; n--, p++)\n\t\t\t\t*p = 255 - *p;\n\t\t\tp++;\n\t\t}\n\t}\n}\n\nvoid\nfz_gamma_pixmap(fz_context *ctx, fz_pixmap *pix, float gamma)\n{\n\tunsigned char gamma_map[256];\n\tunsigned char *s = pix->samples;\n\tint k, x, y;\n\n\tfor (k = 0; k < 256; k++)\n\t\tgamma_map[k] = pow(k / 255.0f, gamma) * 255;\n\n\tfor (y = 0; y < pix->h; y++)\n\t{\n\t\tfor (x = 0; x < pix->w; x++)\n\t\t{\n\t\t\tfor (k = 0; k < pix->n - 1; k++)\n\t\t\t\ts[k] = gamma_map[s[k]];\n\t\t\ts += pix->n;\n\t\t}\n\t}\n}\n\n/*\n * Write pixmap to PNM file (without alpha channel)\n */\n\nvoid\nfz_output_pnm_header(fz_output *out, int w, int h, int n)\n{\n\tfz_context *ctx = out->ctx;\n\n\tif (n != 1 && n != 2 && n != 4)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"pixmap must be grayscale or rgb to write as pnm\");\n\n\tif (n == 1 || n == 2)\n\t\tfz_printf(out, \"P5\\n\");\n\tif (n == 4)\n\t\tfz_printf(out, \"P6\\n\");\n\tfz_printf(out, \"%d %d\\n\", w, h);\n\tfz_printf(out, \"255\\n\");\n}\n\nvoid\nfz_output_pnm_band(fz_output *out, int w, int h, int n, int band, int bandheight, unsigned char *p)\n{\n\tint len;\n\tint start = band * bandheight;\n\tint end = start + bandheight;\n\n\tif (end > h)\n\t\tend = h;\n\tend -= start;\n\n\tlen = w * end;\n\n\tswitch (n)\n\t{\n\tcase 1:\n\t\tfz_write(out, p, len);\n\t\tbreak;\n\tcase 2:\n\t\twhile (len--)\n\t\t{\n\t\t\tfz_putc(out, p[0]);\n\t\t\tp += 2;\n\t\t}\n\t\tbreak;\n\tcase 4:\n\t\twhile (len--)\n\t\t{\n\t\t\tfz_putc(out, p[0]);\n\t\t\tfz_putc(out, p[1]);\n\t\t\tfz_putc(out, p[2]);\n\t\t\tp += 4;\n\t\t}\n\t}\n}\n\nvoid\nfz_write_pnm(fz_context *ctx, fz_pixmap *pixmap, char *filename)\n{\n\tfz_output *out = fz_new_output_to_filename(ctx, filename);\n\tfz_output_pnm_header(out, pixmap->w, pixmap->h, pixmap->n);\n\tfz_output_pnm_band(out, pixmap->w, pixmap->h, pixmap->n, 0, pixmap->h, pixmap->samples);\n\tfz_close_output(out);\n}\n\n/*\n * Write pixmap to PAM file (with or without alpha channel)\n */\n\nvoid\nfz_output_pam_header(fz_output *out, int w, int h, int n, int savealpha)\n{\n\tint sn = n;\n\tint dn = n;\n\tif (!savealpha && dn > 1)\n\t\tdn--;\n\n\tfz_printf(out, \"P7\\n\");\n\tfz_printf(out, \"WIDTH %d\\n\", w);\n\tfz_printf(out, \"HEIGHT %d\\n\", h);\n\tfz_printf(out, \"DEPTH %d\\n\", dn);\n\tfz_printf(out, \"MAXVAL 255\\n\");\n\tif (dn == 1) fz_printf(out, \"TUPLTYPE GRAYSCALE\\n\");\n\telse if (dn == 2 && sn == 2) fz_printf(out, \"TUPLTYPE GRAYSCALE_ALPHA\\n\");\n\telse if (dn == 3 && sn == 4) fz_printf(out, \"TUPLTYPE RGB\\n\");\n\telse if (dn == 4 && sn == 4) fz_printf(out, \"TUPLTYPE RGB_ALPHA\\n\");\n\telse if (dn == 4 && sn == 5) fz_printf(out, \"TUPLTYPE CMYK\\n\");\n\telse if (dn == 5 && sn == 5) fz_printf(out, \"TUPLTYPE CMYK_ALPHA\\n\");\n\tfz_printf(out, \"ENDHDR\\n\");\n}\n\nvoid\nfz_output_pam_band(fz_output *out, int w, int h, int n, int band, int bandheight, unsigned char *sp, int savealpha)\n{\n\tint y, x, k;\n\tint start = band * bandheight;\n\tint end = start + bandheight;\n\tint sn = n;\n\tint dn = n;\n\tif (!savealpha && dn > 1)\n\t\tdn--;\n\n\tif (end > h)\n\t\tend = h;\n\tend -= start;\n\n\tfor (y = 0; y < end; y++)\n\t{\n\t\tx = w;\n\t\twhile (x--)\n\t\t{\n\t\t\tfor (k = 0; k < dn; k++)\n\t\t\t\tfz_putc(out, sp[k]);\n\t\t\tsp += sn;\n\t\t}\n\t}\n}\n\nvoid\nfz_write_pam(fz_context *ctx, fz_pixmap *pixmap, char *filename, int savealpha)\n{\n\tfz_output *out = fz_new_output_to_filename(ctx, filename);\n\tfz_output_pam_header(out, pixmap->w, pixmap->h, pixmap->n, savealpha);\n\tfz_output_pam_band(out, pixmap->w, pixmap->h, pixmap->n, 0, pixmap->h, pixmap->samples, savealpha);\n\tfz_close_output(out);\n}\n\n/*\n * Write pixmap to PNG file (with or without alpha channel)\n */\n\n#include <zlib.h>\n\nstatic inline void big32(unsigned char *buf, unsigned int v)\n{\n\tbuf[0] = (v >> 24) & 0xff;\n\tbuf[1] = (v >> 16) & 0xff;\n\tbuf[2] = (v >> 8) & 0xff;\n\tbuf[3] = (v) & 0xff;\n}\n\nstatic void putchunk(char *tag, unsigned char *data, int size, fz_output *out)\n{\n\tunsigned int sum;\n\tfz_write_int32be(out, size);\n\tfz_write(out, tag, 4);\n\tfz_write(out, data, size);\n\tsum = crc32(0, NULL, 0);\n\tsum = crc32(sum, (unsigned char*)tag, 4);\n\tsum = crc32(sum, data, size);\n\tfz_write_int32be(out, sum);\n}\n\nvoid\nfz_write_png(fz_context *ctx, fz_pixmap *pixmap, char *filename, int savealpha)\n{\n\tfz_output *out = fz_new_output_to_filename(ctx, filename);\n\tfz_png_output_context *poc = NULL;\n\n\tfz_var(poc);\n\n\tfz_try(ctx)\n\t{\n\t\tpoc = fz_output_png_header(out, pixmap->w, pixmap->h, pixmap->n, savealpha);\n\t\tfz_output_png_band(out, pixmap->w, pixmap->h, pixmap->n, 0, pixmap->h, pixmap->samples, savealpha, poc);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_output_png_trailer(out, poc);\n\t\tfz_close_output(out);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nvoid\nfz_output_png(fz_output *out, const fz_pixmap *pixmap, int savealpha)\n{\n\tfz_png_output_context *poc;\n\tfz_context *ctx;\n\n\tif (!out)\n\t\treturn;\n\n\tctx = out->ctx;\n\tpoc = fz_output_png_header(out, pixmap->w, pixmap->h, pixmap->n, savealpha);\n\n\tfz_try(ctx)\n\t{\n\t\tfz_output_png_band(out, pixmap->w, pixmap->h, pixmap->n, 0, pixmap->h, pixmap->samples, savealpha, poc);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_output_png_trailer(out, poc);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstruct fz_png_output_context_s\n{\n\tunsigned char *udata;\n\tunsigned char *cdata;\n\tuLong usize, csize;\n\tz_stream stream;\n};\n\nfz_png_output_context *\nfz_output_png_header(fz_output *out, int w, int h, int n, int savealpha)\n{\n\tstatic const unsigned char pngsig[8] = { 137, 80, 78, 71, 13, 10, 26, 10 };\n\tunsigned char head[13];\n\tfz_context *ctx;\n\tint color;\n\tfz_png_output_context *poc;\n\n\tif (!out)\n\t\treturn NULL;\n\n\tctx = out->ctx;\n\n\tif (n != 1 && n != 2 && n != 4)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"pixmap must be grayscale or rgb to write as png\");\n\n\tpoc = fz_malloc_struct(ctx, fz_png_output_context);\n\n\tif (!savealpha && n > 1)\n\t\tn--;\n\n\tswitch (n)\n\t{\n\tdefault:\n\tcase 1: color = 0; break;\n\tcase 2: color = 4; break;\n\tcase 3: color = 2; break;\n\tcase 4: color = 6; break;\n\t}\n\n\tbig32(head+0, w);\n\tbig32(head+4, h);\n\thead[8] = 8; /* depth */\n\thead[9] = color;\n\thead[10] = 0; /* compression */\n\thead[11] = 0; /* filter */\n\thead[12] = 0; /* interlace */\n\n\tfz_write(out, pngsig, 8);\n\tputchunk(\"IHDR\", head, 13, out);\n\n\treturn poc;\n}\n\nvoid\nfz_output_png_band(fz_output *out, int w, int h, int n, int band, int bandheight, unsigned char *sp, int savealpha, fz_png_output_context *poc)\n{\n\tunsigned char *dp;\n\tint y, x, k, sn, dn, err, finalband;\n\tfz_context *ctx;\n\n\tif (!out || !sp || !poc)\n\t\treturn;\n\n\tctx = out->ctx;\n\n\tif (n != 1 && n != 2 && n != 4)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"pixmap must be grayscale or rgb to write as png\");\n\n\tband *= bandheight;\n\tfinalband = (band+bandheight >= h);\n\tif (finalband)\n\t\tbandheight = h - band;\n\n\tsn = n;\n\tdn = n;\n\tif (!savealpha && dn > 1)\n\t\tdn--;\n\n\tif (poc->udata == NULL)\n\t{\n\t\tpoc->usize = (w * dn + 1) * bandheight;\n\t\t/* Sadly the bound returned by compressBound is just for a\n\t\t * single usize chunk; if you compress a sequence of them\n\t\t * the buffering can result in you suddenly getting a block\n\t\t * larger than compressBound outputted in one go, even if you\n\t\t * take all the data out each time. */\n\t\tpoc->csize = compressBound(poc->usize);\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tpoc->udata = fz_malloc(ctx, poc->usize);\n\t\t\tpoc->cdata = fz_malloc(ctx, poc->csize);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_free(ctx, poc->udata);\n\t\t\tpoc->udata = NULL;\n\t\t\tpoc->cdata = NULL;\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t\terr = deflateInit(&poc->stream, Z_DEFAULT_COMPRESSION);\n\t\tif (err != Z_OK)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"compression error %d\", err);\n\t}\n\n\tdp = poc->udata;\n\tfor (y = 0; y < bandheight; y++)\n\t{\n\t\t*dp++ = 1; /* sub prediction filter */\n\t\tfor (x = 0; x < w; x++)\n\t\t{\n\t\t\tfor (k = 0; k < dn; k++)\n\t\t\t{\n\t\t\t\tif (x == 0)\n\t\t\t\t\tdp[k] = sp[k];\n\t\t\t\telse\n\t\t\t\t\tdp[k] = sp[k] - sp[k-sn];\n\t\t\t}\n\t\t\tsp += sn;\n\t\t\tdp += dn;\n\t\t}\n\t}\n\n\tpoc->stream.next_in = (Bytef*)poc->udata;\n\tpoc->stream.avail_in = (uInt)(dp - poc->udata);\n\tdo\n\t{\n\t\tpoc->stream.next_out = poc->cdata;\n\t\tpoc->stream.avail_out = (uInt)poc->csize;\n\n\t\tif (!finalband)\n\t\t{\n\t\t\terr = deflate(&poc->stream, Z_NO_FLUSH);\n\t\t\tif (err != Z_OK)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"compression error %d\", err);\n\t\t}\n\t\telse\n\t\t{\n\t\t\terr = deflate(&poc->stream, Z_FINISH);\n\t\t\tif (err != Z_STREAM_END)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"compression error %d\", err);\n\t\t}\n\n\t\tif (poc->stream.next_out != poc->cdata)\n\t\t\tputchunk(\"IDAT\", poc->cdata, poc->stream.next_out - poc->cdata, out);\n\t}\n\twhile (poc->stream.avail_out == 0);\n}\n\nvoid\nfz_output_png_trailer(fz_output *out, fz_png_output_context *poc)\n{\n\tunsigned char block[1];\n\tint err;\n\tfz_context *ctx;\n\n\tif (!out || !poc)\n\t\treturn;\n\n\tctx = out->ctx;\n\n\terr = deflateEnd(&poc->stream);\n\tif (err != Z_OK)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"compression error %d\", err);\n\n\tfz_free(ctx, poc->cdata);\n\tfz_free(ctx, poc->udata);\n\tfz_free(ctx, poc);\n\n\tputchunk(\"IEND\", block, 0, out);\n}\n\n/* We use an auxiliary function to do pixmap_as_png, as it can enable us to\n * drop pix early in the case where we have to convert, potentially saving\n * us having to have 2 copies of the pixmap and a buffer open at once. */\nstatic fz_buffer *\npng_from_pixmap(fz_context *ctx, fz_pixmap *pix, int drop)\n{\n\tfz_buffer *buf = NULL;\n\tfz_output *out;\n\tfz_pixmap *pix2 = NULL;\n\n\tfz_var(buf);\n\tfz_var(out);\n\tfz_var(pix2);\n\n\tif (pix->w == 0 || pix->h == 0)\n\t\treturn NULL;\n\n\tfz_try(ctx)\n\t{\n\t\tif (pix->colorspace && pix->colorspace != fz_device_gray(ctx) && pix->colorspace != fz_device_rgb(ctx))\n\t\t{\n\t\t\tpix2 = fz_new_pixmap(ctx, fz_device_rgb(ctx), pix->w, pix->h);\n\t\t\tfz_convert_pixmap(ctx, pix2, pix);\n\t\t\tif (drop)\n\t\t\t\tfz_drop_pixmap(ctx, pix);\n\t\t\tpix = pix2;\n\t\t}\n\t\tbuf = fz_new_buffer(ctx, 1024);\n\t\tout = fz_new_output_with_buffer(ctx, buf);\n\t\tfz_output_png(out, pix, 1);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_pixmap(ctx, drop ? pix : pix2);\n\t\tfz_close_output(out);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, buf);\n\t\tfz_rethrow(ctx);\n\t}\n\treturn buf;\n}\n\nfz_buffer *\nfz_new_png_from_image(fz_context *ctx, fz_image *image, int w, int h)\n{\n\tfz_pixmap *pix = fz_image_get_pixmap(ctx, image, image->w, image->h);\n\n\treturn png_from_pixmap(ctx, pix, 1);\n}\n\nfz_buffer *\nfz_new_png_from_pixmap(fz_context *ctx, fz_pixmap *pix)\n{\n\treturn png_from_pixmap(ctx, pix, 0);\n}\n\n/*\n * Write pixmap to TGA file (with or without alpha channel)\n */\n\nstatic inline void tga_put_pixel(unsigned char *data, int n, int is_bgr, fz_output *out)\n{\n\tif (n >= 3 && !is_bgr)\n\t{\n\t\tfz_putc(out, data[2]);\n\t\tfz_putc(out, data[1]);\n\t\tfz_putc(out, data[0]);\n\t\tif (n == 4)\n\t\t\tfz_putc(out, data[3]);\n\t\treturn;\n\t}\n\tif (n == 2)\n\t{\n\t\tfz_putc(out, data[0]);\n\t\tfz_putc(out, data[0]);\n\t}\n\tfz_write(out, data, n);\n}\n\nvoid\nfz_write_tga(fz_context *ctx, fz_pixmap *pixmap, const char *filename, int savealpha)\n{\n\tfz_output *out;\n\tunsigned char head[18];\n\tint n = pixmap->n;\n\tint d = savealpha || n == 1 ? n : n - 1;\n\tint is_bgr = pixmap->colorspace == fz_device_bgr(ctx);\n\tint k;\n\n\tif (pixmap->colorspace && pixmap->colorspace != fz_device_gray(ctx) &&\n\t\tpixmap->colorspace != fz_device_rgb(ctx) && pixmap->colorspace != fz_device_bgr(ctx))\n\t{\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"pixmap must be grayscale or rgb to write as tga\");\n\t}\n\n\tout = fz_new_output_to_filename(ctx, filename);\n\n\tmemset(head, 0, sizeof(head));\n\thead[2] = n == 4 ? 10 : 11;\n\thead[12] = pixmap->w & 0xFF; head[13] = (pixmap->w >> 8) & 0xFF;\n\thead[14] = pixmap->h & 0xFF; head[15] = (pixmap->h >> 8) & 0xFF;\n\thead[16] = d * 8;\n\thead[17] = savealpha && n > 1 ? 8 : 0;\n\tif (savealpha && d == 2)\n\t\thead[16] = 32;\n\n\tfz_write(out, head, sizeof(head));\n\tfor (k = 1; k <= pixmap->h; k++)\n\t{\n\t\tint i, j;\n\t\tunsigned char *line = pixmap->samples + pixmap->w * n * (pixmap->h - k);\n\t\tfor (i = 0, j = 1; i < pixmap->w; i += j, j = 1)\n\t\t{\n\t\t\tfor (; i + j < pixmap->w && j < 128 && !memcmp(line + i * n, line + (i + j) * n, d); j++);\n\t\t\tif (j > 1)\n\t\t\t{\n\t\t\t\tfz_putc(out, j - 1 + 128);\n\t\t\t\ttga_put_pixel(line + i * n, d, is_bgr, out);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfor (; i + j < pixmap->w && j <= 128 && memcmp(line + (i + j - 1) * n, line + (i + j) * n, d) != 0; j++);\n\t\t\t\tif (i + j < pixmap->w || j > 128)\n\t\t\t\t\tj--;\n\t\t\t\tfz_putc(out, j - 1);\n\t\t\t\tfor (; j > 0; j--, i++)\n\t\t\t\t\ttga_put_pixel(line + i * n, d, is_bgr, out);\n\t\t\t}\n\t\t}\n\t}\n\tfz_write(out, \"\\0\\0\\0\\0\\0\\0\\0\\0TRUEVISION-XFILE.\\0\", 26);\n\n\tfz_close_output(out);\n}\n\nunsigned int\nfz_pixmap_size(fz_context *ctx, fz_pixmap * pix)\n{\n\tif (pix == NULL)\n\t\treturn 0;\n\treturn sizeof(*pix) + pix->n * pix->w * pix->h;\n}\n\nfz_pixmap *\nfz_new_pixmap_from_8bpp_data(fz_context *ctx, int x, int y, int w, int h, unsigned char *sp, int span)\n{\n\tfz_pixmap *pixmap = fz_new_pixmap(ctx, NULL, w, h);\n\tpixmap->x = x;\n\tpixmap->y = y;\n\n\tfor (y = 0; y < h; y++)\n\t\tmemcpy(pixmap->samples + y * w, sp + y * span, w);\n\n\treturn pixmap;\n}\n\nfz_pixmap *\nfz_new_pixmap_from_1bpp_data(fz_context *ctx, int x, int y, int w, int h, unsigned char *sp, int span)\n{\n\tfz_pixmap *pixmap = fz_new_pixmap(ctx, NULL, w, h);\n\tpixmap->x = x;\n\tpixmap->y = y;\n\n\tfor (y = 0; y < h; y++)\n\t{\n\t\tunsigned char *out = pixmap->samples + y * w;\n\t\tunsigned char *in = sp + y * span;\n\t\tunsigned char bit = 0x80;\n\t\tint ww = w;\n\t\twhile (ww--)\n\t\t{\n\t\t\t*out++ = (*in & bit) ? 255 : 0;\n\t\t\tbit >>= 1;\n\t\t\tif (bit == 0)\n\t\t\t\tbit = 0x80, in++;\n\t\t}\n\t}\n\n\treturn pixmap;\n}\n\n#ifdef ARCH_ARM\nstatic void\nfz_subsample_pixmap_ARM(unsigned char *ptr, int w, int h, int f, int factor,\n\t\t\tint n, int fwd, int back, int back2, int fwd2,\n\t\t\tint divX, int back4, int fwd4, int fwd3,\n\t\t\tint divY, int back5, int divXY)\n__attribute__((naked));\n\nstatic void\nfz_subsample_pixmap_ARM(unsigned char *ptr, int w, int h, int f, int factor,\n\t\t\tint n, int fwd, int back, int back2, int fwd2,\n\t\t\tint divX, int back4, int fwd4, int fwd3,\n\t\t\tint divY, int back5, int divXY)\n{\n\tasm volatile(\n\tENTER_ARM\n\t\"stmfd\tr13!,{r1,r4-r11,r14}\t\t\t\t\t\\n\"\n\t\"@STACK:r1,<9>,factor,n,fwd,back,back2,fwd2,divX,back4,fwd4,fwd3,divY,back5,divXY\\n\"\n\t\"@ r0 = src = ptr\t\t\t\t\t\t\\n\"\n\t\"@ r1 = w\t\t\t\t\t\t\t\\n\"\n\t\"@ r2 = h\t\t\t\t\t\t\t\\n\"\n\t\"@ r3 = f\t\t\t\t\t\t\t\\n\"\n\t\"mov\tr9, r0\t\t\t@ r9 = dst = ptr\t\t\\n\"\n\t\"ldr\tr6, [r13,#4*12]\t\t@ r6 = fwd\t\t\t\\n\"\n\t\"ldr\tr7, [r13,#4*13]\t\t@ r7 = back\t\t\t\\n\"\n\t\"subs\tr2, r2, r3\t\t@ r2 = h -= f\t\t\t\\n\"\n\t\"blt\t11f\t\t\t@ Skip if less than a full row\t\\n\"\n\t\"1:\t\t\t\t@ for (y = h; y > 0; y--) {\t\\n\"\n\t\"ldr\tr1, [r13]\t\t@ r1 = w\t\t\t\\n\"\n\t\"subs\tr1, r1, r3\t\t@ r1 = w -= f\t\t\t\\n\"\n\t\"blt\t6f\t\t\t@ Skip if less than a full col\t\\n\"\n\t\"ldr\tr4, [r13,#4*10]\t\t@ r4 = factor\t\t\t\\n\"\n\t\"ldr\tr8, [r13,#4*14]\t\t@ r8 = back2\t\t\t\\n\"\n\t\"ldr\tr12,[r13,#4*15]\t\t@ r12= fwd2\t\t\t\\n\"\n\t\"2:\t\t\t\t@ for (x = w; x > 0; x--) {\t\\n\"\n\t\"ldr\tr5, [r13,#4*11]\t\t@ for (nn = n; nn > 0; n--) {\t\\n\"\n\t\"3:\t\t\t\t@\t\t\t\t\\n\"\n\t\"mov\tr14,#0\t\t\t@ r14= v = 0\t\t\t\\n\"\n\t\"sub\tr5, r5, r3, LSL #8\t@ for (xx = f; xx > 0; x--) {\t\\n\"\n\t\"4:\t\t\t\t@\t\t\t\t\\n\"\n\t\"add\tr5, r5, r3, LSL #16\t@ for (yy = f; yy > 0; y--) {\t\\n\"\n\t\"5:\t\t\t\t@\t\t\t\t\\n\"\n\t\"ldrb\tr11,[r0], r6\t\t@ r11= *src\tsrc += fwd\t\\n\"\n\t\"subs\tr5, r5, #1<<16\t\t@ xx--\t\t\t\t\\n\"\n\t\"add\tr14,r14,r11\t\t@ v += r11\t\t\t\\n\"\n\t\"bgt\t5b\t\t\t@ }\t\t\t\t\\n\"\n\t\"sub\tr0, r0, r7\t\t@ src -= back\t\t\t\\n\"\n\t\"adds\tr5, r5, #1<<8\t\t@ yy--\t\t\t\t\\n\"\n\t\"blt\t4b\t\t\t@ }\t\t\t\t\\n\"\n\t\"mov\tr14,r14,LSR r4\t\t@ r14 = v >>= factor\t\t\\n\"\n\t\"strb\tr14,[r9], #1\t\t@ *d++ = r14\t\t\t\\n\"\n\t\"sub\tr0, r0, r8\t\t@ s -= back2\t\t\t\\n\"\n\t\"subs\tr5, r5, #1\t\t@ n--\t\t\t\t\\n\"\n\t\"bgt\t3b\t\t\t@ }\t\t\t\t\\n\"\n\t\"add\tr0, r0, r12\t\t@ s += fwd2\t\t\t\\n\"\n\t\"subs\tr1, r1, r3\t\t@ x -= f\t\t\t\\n\"\n\t\"bge\t2b\t\t\t@ }\t\t\t\t\\n\"\n\t\"6:\t\t\t\t@ Less than a full column left\t\\n\"\n\t\"adds\tr1, r1, r3\t\t@ x += f\t\t\t\\n\"\n\t\"beq\t11f\t\t\t@ if (x == 0) next row\t\t\\n\"\n\t\"@ r0 = src\t\t\t\t\t\t\t\\n\"\n\t\"@ r1 = x\t\t\t\t\t\t\t\\n\"\n\t\"@ r2 = y\t\t\t\t\t\t\t\\n\"\n\t\"@ r3 = f\t\t\t\t\t\t\t\\n\"\n\t\"@ r4 = factor\t\t\t\t\t\t\t\\n\"\n\t\"@ r6 = fwd\t\t\t\t\t\t\t\\n\"\n\t\"@ r7 = back\t\t\t\t\t\t\t\\n\"\n\t\"@STACK:r1,<9>,factor,n,fwd,back,back2,fwd2,divX,back4,fwd4,fwd3,divY,back5,divXY\\n\"\n\t\"ldr\tr5, [r13,#4*11]\t\t@ for (nn = n; nn > 0; n--) {\t\\n\"\n\t\"ldr\tr4, [r13,#4*16]\t\t@ r4 = divX\t\t\t\\n\"\n\t\"ldr\tr8, [r13,#4*17]\t\t@ r8 = back4\t\t\t\\n\"\n\t\"ldr\tr12,[r13,#4*18]\t\t@ r12= fwd4\t\t\t\\n\"\n\t\"8:\t\t\t\t@\t\t\t\t\\n\"\n\t\"mov\tr14,#0\t\t\t@ r14= v = 0\t\t\t\\n\"\n\t\"sub\tr5, r5, r1, LSL #8\t@ for (xx = x; xx > 0; x--) {\t\\n\"\n\t\"9:\t\t\t\t@\t\t\t\t\\n\"\n\t\"add\tr5, r5, r3, LSL #16\t@ for (yy = f; yy > 0; y--) {\t\\n\"\n\t\"10:\t\t\t\t@\t\t\t\t\\n\"\n\t\"ldrb\tr11,[r0], r6\t\t@ r11= *src\tsrc += fwd\t\\n\"\n\t\"subs\tr5, r5, #1<<16\t\t@ xx--\t\t\t\t\\n\"\n\t\"add\tr14,r14,r11\t\t@ v += r11\t\t\t\\n\"\n\t\"bgt\t10b\t\t\t@ }\t\t\t\t\\n\"\n\t\"sub\tr0, r0, r7\t\t@ src -= back\t\t\t\\n\"\n\t\"adds\tr5, r5, #1<<8\t\t@ yy--\t\t\t\t\\n\"\n\t\"blt\t9b\t\t\t@ }\t\t\t\t\\n\"\n\t\"mul\tr14,r4, r14\t\t@ r14= v *= divX\t\t\\n\"\n\t\"mov\tr14,r14,LSR #16\t\t@ r14= v >>= 16\t\t\t\\n\"\n\t\"strb\tr14,[r9], #1\t\t@ *d++ = r14\t\t\t\\n\"\n\t\"sub\tr0, r0, r8\t\t@ s -= back4\t\t\t\\n\"\n\t\"subs\tr5, r5, #1\t\t@ n--\t\t\t\t\\n\"\n\t\"bgt\t8b\t\t\t@ }\t\t\t\t\\n\"\n\t\"add\tr0, r0, r12\t\t@ s += fwd4\t\t\t\\n\"\n\t\"11:\t\t\t\t@\t\t\t\t\\n\"\n\t\"ldr\tr14,[r13,#4*19]\t\t@ r14 = fwd3\t\t\t\\n\"\n\t\"subs\tr2, r2, r3\t\t@ h -= f\t\t\t\\n\"\n\t\"add\tr0, r0, r14\t\t@ s += fwd3\t\t\t\\n\"\n\t\"bge\t1b\t\t\t@ }\t\t\t\t\\n\"\n\t\"adds\tr2, r2, r3\t\t@ h += f\t\t\t\\n\"\n\t\"beq\t21f\t\t\t@ if no stray row, end\t\t\\n\"\n\t\"@ So doing one last (partial) row\t\t\t\t\\n\"\n\t\"@STACK:r1,<9>,factor,n,fwd,back,back2,fwd2,divX,back4,fwd4,fwd3,divY,back5,divXY\\n\"\n\t\"@ r0 = src = ptr\t\t\t\t\t\t\\n\"\n\t\"@ r1 = w\t\t\t\t\t\t\t\\n\"\n\t\"@ r2 = h\t\t\t\t\t\t\t\\n\"\n\t\"@ r3 = f\t\t\t\t\t\t\t\\n\"\n\t\"@ r4 = factor\t\t\t\t\t\t\t\\n\"\n\t\"@ r5 = n\t\t\t\t\t\t\t\\n\"\n\t\"@ r6 = fwd\t\t\t\t\t\t\t\\n\"\n\t\"12:\t\t\t\t@ for (y = h; y > 0; y--) {\t\\n\"\n\t\"ldr\tr1, [r13]\t\t@ r1 = w\t\t\t\\n\"\n\t\"ldr\tr7, [r13,#4*21]\t\t@ r7 = back5\t\t\t\\n\"\n\t\"ldr\tr8, [r13,#4*14]\t\t@ r8 = back2\t\t\t\\n\"\n\t\"subs\tr1, r1, r3\t\t@ r1 = w -= f\t\t\t\\n\"\n\t\"blt\t17f\t\t\t@ Skip if less than a full col\t\\n\"\n\t\"ldr\tr4, [r13,#4*20]\t\t@ r4 = divY\t\t\t\\n\"\n\t\"ldr\tr12,[r13,#4*15]\t\t@ r12= fwd2\t\t\t\\n\"\n\t\"13:\t\t\t\t@ for (x = w; x > 0; x--) {\t\\n\"\n\t\"ldr\tr5, [r13,#4*11]\t\t@ for (nn = n; nn > 0; n--) {\t\\n\"\n\t\"14:\t\t\t\t@\t\t\t\t\\n\"\n\t\"mov\tr14,#0\t\t\t@ r14= v = 0\t\t\t\\n\"\n\t\"sub\tr5, r5, r3, LSL #8\t@ for (xx = f; xx > 0; x--) {\t\\n\"\n\t\"15:\t\t\t\t@\t\t\t\t\\n\"\n\t\"add\tr5, r5, r2, LSL #16\t@ for (yy = y; yy > 0; y--) {\t\\n\"\n\t\"16:\t\t\t\t@\t\t\t\t\\n\"\n\t\"ldrb\tr11,[r0], r6\t\t@ r11= *src\tsrc += fwd\t\\n\"\n\t\"subs\tr5, r5, #1<<16\t\t@ xx--\t\t\t\t\\n\"\n\t\"add\tr14,r14,r11\t\t@ v += r11\t\t\t\\n\"\n\t\"bgt\t16b\t\t\t@ }\t\t\t\t\\n\"\n\t\"sub\tr0, r0, r7\t\t@ src -= back5\t\t\t\\n\"\n\t\"adds\tr5, r5, #1<<8\t\t@ yy--\t\t\t\t\\n\"\n\t\"blt\t15b\t\t\t@ }\t\t\t\t\\n\"\n\t\"mul\tr14,r4, r14\t\t@ r14 = x *= divY\t\t\\n\"\n\t\"mov\tr14,r14,LSR #16\t\t@ r14 = v >>= 16\t\t\\n\"\n\t\"strb\tr14,[r9], #1\t\t@ *d++ = r14\t\t\t\\n\"\n\t\"sub\tr0, r0, r8\t\t@ s -= back2\t\t\t\\n\"\n\t\"subs\tr5, r5, #1\t\t@ n--\t\t\t\t\\n\"\n\t\"bgt\t14b\t\t\t@ }\t\t\t\t\\n\"\n\t\"add\tr0, r0, r12\t\t@ s += fwd2\t\t\t\\n\"\n\t\"subs\tr1, r1, r3\t\t@ x -= f\t\t\t\\n\"\n\t\"bge\t13b\t\t\t@ }\t\t\t\t\\n\"\n\t\"17:\t\t\t\t@ Less than a full column left\t\\n\"\n\t\"adds\tr1, r1, r3\t\t@ x += f\t\t\t\\n\"\n\t\"beq\t21f\t\t\t@ if (x == 0) end\t\t\\n\"\n\t\"@ r0 = src\t\t\t\t\t\t\t\\n\"\n\t\"@ r1 = x\t\t\t\t\t\t\t\\n\"\n\t\"@ r2 = y\t\t\t\t\t\t\t\\n\"\n\t\"@ r3 = f\t\t\t\t\t\t\t\\n\"\n\t\"@ r4 = factor\t\t\t\t\t\t\t\\n\"\n\t\"@ r6 = fwd\t\t\t\t\t\t\t\\n\"\n\t\"@ r7 = back5\t\t\t\t\t\t\t\\n\"\n\t\"@ r8 = back2\t\t\t\t\t\t\t\\n\"\n\t\"@STACK:r1,<9>,factor,n,fwd,back,back2,fwd2,divX,back4,fwd4,fwd3,divY,back5,divXY\\n\"\n\t\"ldr\tr4, [r13,#4*22]\t\t@ r4 = divXY\t\t\t\\n\"\n\t\"ldr\tr5, [r13,#4*11]\t\t@ for (nn = n; nn > 0; n--) {\t\\n\"\n\t\"18:\t\t\t\t@\t\t\t\t\\n\"\n\t\"mov\tr14,#0\t\t\t@ r14= v = 0\t\t\t\\n\"\n\t\"sub\tr5, r5, r1, LSL #8\t@ for (xx = x; xx > 0; x--) {\t\\n\"\n\t\"19:\t\t\t\t@\t\t\t\t\\n\"\n\t\"add\tr5, r5, r2, LSL #16\t@ for (yy = y; yy > 0; y--) {\t\\n\"\n\t\"20:\t\t\t\t@\t\t\t\t\\n\"\n\t\"ldrb\tr11,[r0],r6\t\t@ r11= *src\tsrc += fwd\t\\n\"\n\t\"subs\tr5, r5, #1<<16\t\t@ xx--\t\t\t\t\\n\"\n\t\"add\tr14,r14,r11\t\t@ v += r11\t\t\t\\n\"\n\t\"bgt\t20b\t\t\t@ }\t\t\t\t\\n\"\n\t\"sub\tr0, r0, r7\t\t@ src -= back5\t\t\t\\n\"\n\t\"adds\tr5, r5, #1<<8\t\t@ yy--\t\t\t\t\\n\"\n\t\"blt\t19b\t\t\t@ }\t\t\t\t\\n\"\n\t\"mul\tr14,r4, r14\t\t@ r14= v *= divX\t\t\\n\"\n\t\"mov\tr14,r14,LSR #16\t\t@ r14= v >>= 16\t\t\t\\n\"\n\t\"strb\tr14,[r9], #1\t\t@ *d++ = r14\t\t\t\\n\"\n\t\"sub\tr0, r0, r8\t\t@ s -= back2\t\t\t\\n\"\n\t\"subs\tr5, r5, #1\t\t@ n--\t\t\t\t\\n\"\n\t\"bgt\t18b\t\t\t@ }\t\t\t\t\\n\"\n\t\"21:\t\t\t\t@\t\t\t\t\\n\"\n\t\"ldmfd\tr13!,{r1,r4-r11,PC}\t@ pop, return to thumb\t\t\\n\"\n\tENTER_THUMB\n\t);\n}\n\n#endif\n\nvoid\nfz_subsample_pixmap(fz_context *ctx, fz_pixmap *tile, int factor)\n{\n\tint dst_w, dst_h, w, h, fwd, fwd2, fwd3, back, back2, x, y, n, xx, yy, nn, f;\n\tunsigned char *s, *d;\n\n\tif (!tile)\n\t\treturn;\n\ts = d = tile->samples;\n\tf = 1<<factor;\n\tw = tile->w;\n\th = tile->h;\n\tn = tile->n;\n\tdst_w = (w + f-1)>>factor;\n\tdst_h = (h + f-1)>>factor;\n\tfwd = w*n;\n\tback = f*fwd-n;\n\tback2 = f*n-1;\n\tfwd2 = (f-1)*n;\n\tfwd3 = (f-1)*fwd;\n\tfactor *= 2;\n#ifdef ARCH_ARM\n\t{\n\t\tint strayX = w%f;\n\t\tint divX = (strayX ? 65536/(strayX*f) : 0);\n\t\tint fwd4 = (strayX-1) * n;\n\t\tint back4 = strayX*n-1;\n\t\tint strayY = h%f;\n\t\tint divY = (strayY ? 65536/(strayY*f) : 0);\n\t\tint back5 = fwd * strayY - n;\n\t\tint divXY = (strayY*strayX ? 65536/(strayX*strayY) : 0);\n\t\tfz_subsample_pixmap_ARM(s, w, h, f, factor, n, fwd, back,\n\t\t\t\t\tback2, fwd2, divX, back4, fwd4, fwd3,\n\t\t\t\t\tdivY, back5, divXY);\n\t}\n#else\n\tfor (y = h - f; y >= 0; y -= f)\n\t{\n\t\tfor (x = w - f; x >= 0; x -= f)\n\t\t{\n\t\t\tfor (nn = n; nn > 0; nn--)\n\t\t\t{\n\t\t\t\tint v = 0;\n\t\t\t\tfor (xx = f; xx > 0; xx--)\n\t\t\t\t{\n\t\t\t\t\tfor (yy = f; yy > 0; yy--)\n\t\t\t\t\t{\n\t\t\t\t\t\tv += *s;\n\t\t\t\t\t\ts += fwd;\n\t\t\t\t\t}\n\t\t\t\t\ts -= back;\n\t\t\t\t}\n\t\t\t\t*d++ = v >> factor;\n\t\t\t\ts -= back2;\n\t\t\t}\n\t\t\ts += fwd2;\n\t\t}\n\t\t/* Do any strays */\n\t\tx += f;\n\t\tif (x > 0)\n\t\t{\n\t\t\tint div = x * f;\n\t\t\tint fwd4 = (x-1) * n;\n\t\t\tint back4 = x*n-1;\n\t\t\tfor (nn = n; nn > 0; nn--)\n\t\t\t{\n\t\t\t\tint v = 0;\n\t\t\t\tfor (xx = x; xx > 0; xx--)\n\t\t\t\t{\n\t\t\t\t\tfor (yy = f; yy > 0; yy--)\n\t\t\t\t\t{\n\t\t\t\t\t\tv += *s;\n\t\t\t\t\t\ts += fwd;\n\t\t\t\t\t}\n\t\t\t\t\ts -= back;\n\t\t\t\t}\n\t\t\t\t*d++ = v / div;\n\t\t\t\ts -= back4;\n\t\t\t}\n\t\t\ts += fwd4;\n\t\t}\n\t\ts += fwd3;\n\t}\n\t/* Do any stray line */\n\ty += f;\n\tif (y > 0)\n\t{\n\t\tint div = y * f;\n\t\tint back5 = fwd * y - n;\n\t\tfor (x = w - f; x >= 0; x -= f)\n\t\t{\n\t\t\tfor (nn = n; nn > 0; nn--)\n\t\t\t{\n\t\t\t\tint v = 0;\n\t\t\t\tfor (xx = f; xx > 0; xx--)\n\t\t\t\t{\n\t\t\t\t\tfor (yy = y; yy > 0; yy--)\n\t\t\t\t\t{\n\t\t\t\t\t\tv += *s;\n\t\t\t\t\t\ts += fwd;\n\t\t\t\t\t}\n\t\t\t\t\ts -= back5;\n\t\t\t\t}\n\t\t\t\t*d++ = v / div;\n\t\t\t\ts -= back2;\n\t\t\t}\n\t\t\ts += fwd2;\n\t\t}\n\t\t/* Do any stray at the end of the stray line */\n\t\tx += f;\n\t\tif (x > 0)\n\t\t{\n\t\t\tdiv = x * y;\n\t\t\tfor (nn = n; nn > 0; nn--)\n\t\t\t{\n\t\t\t\tint v = 0;\n\t\t\t\tfor (xx = x; xx > 0; xx--)\n\t\t\t\t{\n\t\t\t\t\tfor (yy = y; yy > 0; yy--)\n\t\t\t\t\t{\n\t\t\t\t\t\tv += *s;\n\t\t\t\t\t\ts += fwd;\n\t\t\t\t\t}\n\t\t\t\t\ts -= back5;\n\t\t\t\t}\n\t\t\t\t*d++ = v / div;\n\t\t\t\ts -= back2;\n\t\t\t}\n\t\t}\n\t}\n#endif\n\ttile->w = dst_w;\n\ttile->h = dst_h;\n\ttile->samples = fz_resize_array(ctx, tile->samples, dst_w * n, dst_h);\n}\n\nvoid\nfz_pixmap_set_resolution(fz_pixmap *pix, int res)\n{\n\tpix->xres = res;\n\tpix->yres = res;\n}\n\nvoid\nfz_md5_pixmap(fz_pixmap *pix, unsigned char digest[16])\n{\n\tfz_md5 md5;\n\n\tfz_md5_init(&md5);\n\tif (pix)\n\t\tfz_md5_update(&md5, pix->samples, pix->w * pix->h * pix->n);\n\tfz_md5_final(&md5, digest);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/printf.c",
    "content": "#include \"mupdf/fitz.h\"\n\nstruct fmtbuf\n{\n\tchar *p;\n\tint s;\n\tint n;\n};\n\nstatic void fmtputc(struct fmtbuf *out, int c)\n{\n\tif (out->n < out->s)\n\t\tout->p[out->n] = c;\n\t++(out->n);\n}\n\n/*\n * Convert float to shortest possible string that won't lose precision, except:\n * NaN to 0, +Inf to FLT_MAX, -Inf to -FLT_MAX.\n */\nstatic void fmtfloat(struct fmtbuf *out, float f)\n{\n\tchar digits[40], *s = digits;\n\tint exp, neg, ndigits, point;\n\n\tif (isnan(f)) f = 0;\n\tif (isinf(f)) f = f < 0 ? -FLT_MAX : FLT_MAX;\n\n\tfz_ftoa(f, digits, &exp, &neg, &ndigits);\n\tpoint = exp + ndigits;\n\n\tif (neg)\n\t\tfmtputc(out, '-');\n\n\tif (point <= 0)\n\t{\n\t\tfmtputc(out, '.');\n\t\twhile (point++ < 0)\n\t\t\tfmtputc(out, '0');\n\t\twhile (ndigits-- > 0)\n\t\t\tfmtputc(out, *s++);\n\t}\n\n\telse\n\t{\n\t\twhile (ndigits-- > 0)\n\t\t{\n\t\t\tfmtputc(out, *s++);\n\t\t\tif (--point == 0 && ndigits > 0)\n\t\t\t\tfmtputc(out, '.');\n\t\t}\n\t\twhile (point-- > 0)\n\t\t\tfmtputc(out, '0');\n\t}\n}\n\nstatic void fmtint(struct fmtbuf *out, int value, int z, int base)\n{\n\tstatic const char *digits = \"0123456789abcdef\";\n\tchar buf[40];\n\tunsigned int a;\n\tint i;\n\n\tif (value < 0)\n\t{\n\t\tfmtputc(out, '-');\n\t\ta = -value;\n\t}\n\telse\n\t\ta = value;\n\n\ti = 0;\n\twhile (a) {\n\t\tbuf[i++] = digits[a % base];\n\t\ta /= base;\n\t}\n\twhile (i < z)\n\t\tbuf[i++] = '0';\n\twhile (i > 0)\n\t\tfmtputc(out, buf[--i]);\n}\n\nstatic void fmtquote(struct fmtbuf *out, const char *s, int sq, int eq)\n{\n\tint c;\n\tfmtputc(out, sq);\n\twhile ((c = *s++) != 0) {\n\t\tswitch (c) {\n\t\tdefault:\n\t\t\tif (c < 32 || c > 127) {\n\t\t\t\tfmtputc(out, '\\\\');\n\t\t\t\tfmtputc(out, '0' + ((c >> 6) & 7));\n\t\t\t\tfmtputc(out, '0' + ((c >> 3) & 7));\n\t\t\t\tfmtputc(out, '0' + ((c) & 7));\n\t\t\t} else {\n\t\t\t\tif (c == sq || c == eq)\n\t\t\t\t\tfmtputc(out, '\\\\');\n\t\t\t\tfmtputc(out, c);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '\\\\': fmtputc(out, '\\\\'); fmtputc(out, '\\\\'); break;\n\t\tcase '\\b': fmtputc(out, '\\\\'); fmtputc(out, 'b'); break;\n\t\tcase '\\f': fmtputc(out, '\\\\'); fmtputc(out, 'f'); break;\n\t\tcase '\\n': fmtputc(out, '\\\\'); fmtputc(out, 'n'); break;\n\t\tcase '\\r': fmtputc(out, '\\\\'); fmtputc(out, 'r'); break;\n\t\tcase '\\t': fmtputc(out, '\\\\'); fmtputc(out, 't'); break;\n\t\t}\n\t}\n\tfmtputc(out, eq);\n}\n\nint\nfz_vsnprintf(char *buffer, int space, const char *fmt, va_list args)\n{\n\tstruct fmtbuf out;\n\tfz_matrix *m;\n\tfz_rect *r;\n\tfz_point *p;\n\tint c, i, n, z;\n\tdouble f;\n\tchar *s;\n\n\tout.p = buffer;\n\tout.s = space;\n\tout.n = 0;\n\n\twhile ((c = *fmt++) != 0)\n\t{\n\t\tif (c == '%') {\n\t\t\tc = *fmt++;\n\t\t\tif (c == 0)\n\t\t\t\tbreak;\n\t\t\tz = 1;\n\t\t\tif (c == '0' && fmt[0] && fmt[1]) {\n\t\t\t\tz = *fmt++ - '0';\n\t\t\t\tc = *fmt++;\n\t\t\t}\n\t\t\tswitch (c) {\n\t\t\tdefault:\n\t\t\t\tfmtputc(&out, '%');\n\t\t\t\tfmtputc(&out, c);\n\t\t\t\tbreak;\n\t\t\tcase '%':\n\t\t\t\tfmtputc(&out, '%');\n\t\t\t\tbreak;\n\t\t\tcase 'M':\n\t\t\t\tm = va_arg(args, fz_matrix*);\n\t\t\t\tfmtfloat(&out, m->a); fmtputc(&out, ' ');\n\t\t\t\tfmtfloat(&out, m->b); fmtputc(&out, ' ');\n\t\t\t\tfmtfloat(&out, m->c); fmtputc(&out, ' ');\n\t\t\t\tfmtfloat(&out, m->d); fmtputc(&out, ' ');\n\t\t\t\tfmtfloat(&out, m->e); fmtputc(&out, ' ');\n\t\t\t\tfmtfloat(&out, m->f);\n\t\t\t\tbreak;\n\t\t\tcase 'R':\n\t\t\t\tr = va_arg(args, fz_rect*);\n\t\t\t\tfmtfloat(&out, r->x0); fmtputc(&out, ' ');\n\t\t\t\tfmtfloat(&out, r->y0); fmtputc(&out, ' ');\n\t\t\t\tfmtfloat(&out, r->x1); fmtputc(&out, ' ');\n\t\t\t\tfmtfloat(&out, r->y1);\n\t\t\t\tbreak;\n\t\t\tcase 'P':\n\t\t\t\tp = va_arg(args, fz_point*);\n\t\t\t\tfmtfloat(&out, p->x); fmtputc(&out, ' ');\n\t\t\t\tfmtfloat(&out, p->y);\n\t\t\t\tbreak;\n\t\t\tcase 'C':\n\t\t\t\tc = va_arg(args, int);\n\t\t\t\tif (c < 128)\n\t\t\t\t\tfmtputc(&out, c);\n\t\t\t\telse {\n\t\t\t\t\tchar buf[10];\n\t\t\t\t\tn = fz_runetochar(buf, c);\n\t\t\t\t\tfor (i=0; i < n; ++i)\n\t\t\t\t\t\tfmtputc(&out, buf[i]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'c':\n\t\t\t\tc = va_arg(args, int);\n\t\t\t\tfmtputc(&out, c);\n\t\t\t\tbreak;\n\t\t\tcase 'f':\n\t\t\tcase 'g':\n\t\t\t\tf = va_arg(args, double);\n\t\t\t\tfmtfloat(&out, f);\n\t\t\t\tbreak;\n\t\t\tcase 'x':\n\t\t\t\ti = va_arg(args, int);\n\t\t\t\tfmtint(&out, i, z, 16);\n\t\t\t\tbreak;\n\t\t\tcase 'd':\n\t\t\t\ti = va_arg(args, int);\n\t\t\t\tfmtint(&out, i, z, 10);\n\t\t\t\tbreak;\n\t\t\tcase 'o':\n\t\t\t\ti = va_arg(args, int);\n\t\t\t\tfmtint(&out, i, z, 8);\n\t\t\t\tbreak;\n\t\t\tcase 's':\n\t\t\t\ts = va_arg(args, char*);\n\t\t\t\tif (!s)\n\t\t\t\t\ts = \"(null)\";\n\t\t\t\twhile ((c = *s++) != 0)\n\t\t\t\t\tfmtputc(&out, c);\n\t\t\t\tbreak;\n\t\t\tcase 'q':\n\t\t\t\ts = va_arg(args, char*);\n\t\t\t\tif (!s) s = \"\";\n\t\t\t\tfmtquote(&out, s, '\"', '\"');\n\t\t\t\tbreak;\n\t\t\tcase '(':\n\t\t\t\ts = va_arg(args, char*);\n\t\t\t\tif (!s) s = \"\";\n\t\t\t\tfmtquote(&out, s, '(', ')');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tfmtputc(&out, c);\n\t\t}\n\t}\n\n\tfmtputc(&out, 0);\n\treturn out.n - 1;\n}\n\nint\nfz_vfprintf(fz_context *ctx, FILE *file, const char *fmt, va_list old_args)\n{\n\tchar buffer[256];\n\tint l;\n\tva_list args;\n\tchar *b = buffer;\n\n\t/* First try using our fixed size buffer */\n\tva_copy(args, old_args);\n\tl = fz_vsnprintf(buffer, sizeof buffer, fmt, args);\n\tva_copy_end(args);\n\n\t/* If that failed, allocate the right size buffer dynamically */\n\tif (l >= sizeof buffer)\n\t{\n\t\tb = fz_malloc(ctx, l + 1);\n\t\tva_copy(args, old_args);\n\t\tfz_vsnprintf(b, l + 1, fmt, args);\n\t\tva_copy_end(args);\n\t}\n\n\tl = fwrite(b, 1, l, file);\n\n\tif (b != buffer)\n\t\tfz_free(ctx, b);\n\n\treturn l;\n}\n\nint\nfz_snprintf(char *buffer, int space, const char *fmt, ...)\n{\n\tint n;\n\tva_list ap;\n\tva_start(ap, fmt);\n\tn = fz_vsnprintf(buffer, space, fmt, ap);\n\tva_end(ap);\n\treturn n;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/shade.c",
    "content": "#include \"mupdf/fitz.h\"\n\n#define SWAP(a,b) {fz_vertex *t = (a); (a) = (b); (b) = t;}\n\nstatic inline void\npaint_tri(fz_mesh_processor *painter, fz_vertex *v0, fz_vertex *v1, fz_vertex *v2)\n{\n\tif (painter->process)\n\t{\n\t\tpainter->process(painter->process_arg, v0, v1, v2);\n\t}\n}\n\nstatic inline void\npaint_quad(fz_mesh_processor *painter, fz_vertex *v0, fz_vertex *v1, fz_vertex *v2, fz_vertex *v3)\n{\n\t/* For a quad with corners (in clockwise or anticlockwise order) are\n\t * v0, v1, v2, v3. We can choose to split in in various different ways.\n\t * Arbitrarily we can pick v0, v1, v3 for the first triangle. We then\n\t * have to choose between v1, v2, v3 or v3, v2, v1 (or their equivalent\n\t * rotations) for the second triangle.\n\t *\n\t * v1, v2, v3 has the property that both triangles share the same\n\t * winding (useful if we were ever doing simple back face culling).\n\t *\n\t * v3, v2, v1 has the property that all the 'shared' edges (both\n\t * within this quad, and with adjacent quads) are walked in the same\n\t * direction every time. This can be useful in that depending on the\n\t * implementation/rounding etc walking from A -> B can hit different\n\t * pixels than walking from B->A.\n\t *\n\t * In the event neither of these things matter at the moment, as all\n\t * the process functions where it matters order the edges from top to\n\t * bottom before walking them.\n\t */\n\tif (painter->process)\n\t{\n\t\tpainter->process(painter->process_arg, v0, v1, v3);\n\t\tpainter->process(painter->process_arg, v3, v2, v1);\n\t}\n}\n\nstatic inline void\nfz_prepare_color(fz_mesh_processor *painter, fz_vertex *v, float *c)\n{\n\tif (painter->prepare)\n\t{\n\t\tpainter->prepare(painter->process_arg, v, c);\n\t}\n}\n\nstatic inline void\nfz_prepare_vertex(fz_mesh_processor *painter, fz_vertex *v, const fz_matrix *ctm, float x, float y, float *c)\n{\n\tfz_transform_point_xy(&v->p, ctm, x, y);\n\tif (painter->prepare)\n\t{\n\t\tpainter->prepare(painter->process_arg, v, c);\n\t}\n}\n\nstatic void\nfz_process_mesh_type1(fz_context *ctx, fz_shade *shade, const fz_matrix *ctm, fz_mesh_processor *painter)\n{\n\tfloat *p = shade->u.f.fn_vals;\n\tint xdivs = shade->u.f.xdivs;\n\tint ydivs = shade->u.f.ydivs;\n\tfloat x0 = shade->u.f.domain[0][0];\n\tfloat y0 = shade->u.f.domain[0][1];\n\tfloat x1 = shade->u.f.domain[1][0];\n\tfloat y1 = shade->u.f.domain[1][1];\n\tint xx, yy;\n\tfloat y, yn, x;\n\tfz_vertex vs[2][2];\n\tfz_vertex *v = vs[0];\n\tfz_vertex *vn = vs[1];\n\tint n = shade->colorspace->n;\n\tfz_matrix local_ctm;\n\n\tfz_concat(&local_ctm, &shade->u.f.matrix, ctm);\n\n\ty = y0;\n\tfor (yy = 0; yy < ydivs; yy++)\n\t{\n\t\tyn = y0 + (y1 - y0) * (yy + 1) / ydivs;\n\n\t\tx = x0;\n\n\t\tfz_prepare_vertex(painter, &v[0], &local_ctm, x, y, p);\n\t\tp += n;\n\t\tfz_prepare_vertex(painter, &v[1], &local_ctm, x, yn, p + xdivs * n);\n\n\t\tfor (xx = 0; xx < xdivs; xx++)\n\t\t{\n\t\t\tx = x0 + (x1 - x0) * (xx + 1) / xdivs;\n\n\t\t\tfz_prepare_vertex(painter, &vn[0], &local_ctm, x, y, p);\n\t\t\tp += n;\n\t\t\tfz_prepare_vertex(painter, &vn[1], &local_ctm, x, yn, p + xdivs * n);\n\n\t\t\tpaint_quad(painter, &v[0], &vn[0], &vn[1], &v[1]);\n\t\t\tSWAP(v,vn);\n\t\t}\n\t\ty = yn;\n\t}\n}\n\n/* FIXME: Nasty */\n#define HUGENUM 32000 /* how far to extend linear/radial shadings */\n\nstatic fz_point\nfz_point_on_circle(fz_point p, float r, float theta)\n{\n\tp.x = p.x + cosf(theta) * r;\n\tp.y = p.y + sinf(theta) * r;\n\treturn p;\n}\n\nstatic void\nfz_process_mesh_type2(fz_context *ctx, fz_shade *shade, const fz_matrix *ctm, fz_mesh_processor *painter)\n{\n\tfz_point p0, p1, dir;\n\tfz_vertex v0, v1, v2, v3;\n\tfz_vertex e0, e1;\n\tfloat theta;\n\tfloat zero = 0;\n\tfloat one = 1;\n\n\tp0.x = shade->u.l_or_r.coords[0][0];\n\tp0.y = shade->u.l_or_r.coords[0][1];\n\tp1.x = shade->u.l_or_r.coords[1][0];\n\tp1.y = shade->u.l_or_r.coords[1][1];\n\tdir.x = p0.y - p1.y;\n\tdir.y = p1.x - p0.x;\n\tfz_transform_point(&p0, ctm);\n\tfz_transform_point(&p1, ctm);\n\tfz_transform_vector(&dir, ctm);\n\ttheta = atan2f(dir.y, dir.x);\n\n\tv0.p = fz_point_on_circle(p0, HUGENUM, theta);\n\tv1.p = fz_point_on_circle(p1, HUGENUM, theta);\n\tv2.p = fz_point_on_circle(p0, -HUGENUM, theta);\n\tv3.p = fz_point_on_circle(p1, -HUGENUM, theta);\n\n\tfz_prepare_color(painter, &v0, &zero);\n\tfz_prepare_color(painter, &v1, &one);\n\tfz_prepare_color(painter, &v2, &zero);\n\tfz_prepare_color(painter, &v3, &one);\n\n\tpaint_quad(painter, &v0, &v2, &v3, &v1);\n\n\tif (shade->u.l_or_r.extend[0])\n\t{\n\t\te0.p.x = v0.p.x - (p1.x - p0.x) * HUGENUM;\n\t\te0.p.y = v0.p.y - (p1.y - p0.y) * HUGENUM;\n\t\tfz_prepare_color(painter, &e0, &zero);\n\n\t\te1.p.x = v2.p.x - (p1.x - p0.x) * HUGENUM;\n\t\te1.p.y = v2.p.y - (p1.y - p0.y) * HUGENUM;\n\t\tfz_prepare_color(painter, &e1, &zero);\n\n\t\tpaint_quad(painter, &e0, &v0, &v2, &e1);\n\t}\n\n\tif (shade->u.l_or_r.extend[1])\n\t{\n\t\te0.p.x = v1.p.x + (p1.x - p0.x) * HUGENUM;\n\t\te0.p.y = v1.p.y + (p1.y - p0.y) * HUGENUM;\n\t\tfz_prepare_color(painter, &e0, &one);\n\n\t\te1.p.x = v3.p.x + (p1.x - p0.x) * HUGENUM;\n\t\te1.p.y = v3.p.y + (p1.y - p0.y) * HUGENUM;\n\t\tfz_prepare_color(painter, &e1, &one);\n\n\t\tpaint_quad(painter, &e0, &v1, &v3, &e1);\n\t}\n}\n\nstatic void\nfz_paint_annulus(const fz_matrix *ctm,\n\t\tfz_point p0, float r0, float c0,\n\t\tfz_point p1, float r1, float c1,\n\t\tint count,\n\t\tfz_mesh_processor *painter)\n{\n\tfz_vertex t0, t1, t2, t3, b0, b1, b2, b3;\n\tfloat theta, step, a, b;\n\tint i;\n\n\ttheta = atan2f(p1.y - p0.y, p1.x - p0.x);\n\tstep = (float)M_PI / count;\n\n\ta = 0;\n\tfor (i = 1; i <= count; i++)\n\t{\n\t\tb = i * step;\n\n\t\tt0.p = fz_point_on_circle(p0, r0, theta + a);\n\t\tt1.p = fz_point_on_circle(p0, r0, theta + b);\n\t\tt2.p = fz_point_on_circle(p1, r1, theta + a);\n\t\tt3.p = fz_point_on_circle(p1, r1, theta + b);\n\t\tb0.p = fz_point_on_circle(p0, r0, theta - a);\n\t\tb1.p = fz_point_on_circle(p0, r0, theta - b);\n\t\tb2.p = fz_point_on_circle(p1, r1, theta - a);\n\t\tb3.p = fz_point_on_circle(p1, r1, theta - b);\n\n\t\tfz_transform_point(&t0.p, ctm);\n\t\tfz_transform_point(&t1.p, ctm);\n\t\tfz_transform_point(&t2.p, ctm);\n\t\tfz_transform_point(&t3.p, ctm);\n\t\tfz_transform_point(&b0.p, ctm);\n\t\tfz_transform_point(&b1.p, ctm);\n\t\tfz_transform_point(&b2.p, ctm);\n\t\tfz_transform_point(&b3.p, ctm);\n\n\t\tfz_prepare_color(painter, &t0, &c0);\n\t\tfz_prepare_color(painter, &t1, &c0);\n\t\tfz_prepare_color(painter, &t2, &c1);\n\t\tfz_prepare_color(painter, &t3, &c1);\n\t\tfz_prepare_color(painter, &b0, &c0);\n\t\tfz_prepare_color(painter, &b1, &c0);\n\t\tfz_prepare_color(painter, &b2, &c1);\n\t\tfz_prepare_color(painter, &b3, &c1);\n\n\t\tpaint_quad(painter, &t0, &t2, &t3, &t1);\n\t\tpaint_quad(painter, &b0, &b2, &b3, &b1);\n\n\t\ta = b;\n\t}\n}\n\nstatic void\nfz_process_mesh_type3(fz_context *ctx, fz_shade *shade, const fz_matrix *ctm, fz_mesh_processor *painter)\n{\n\tfz_point p0, p1;\n\tfloat r0, r1;\n\tfz_point e;\n\tfloat er, rs;\n\tint count;\n\n\tp0.x = shade->u.l_or_r.coords[0][0];\n\tp0.y = shade->u.l_or_r.coords[0][1];\n\tr0 = shade->u.l_or_r.coords[0][2];\n\n\tp1.x = shade->u.l_or_r.coords[1][0];\n\tp1.y = shade->u.l_or_r.coords[1][1];\n\tr1 = shade->u.l_or_r.coords[1][2];\n\n\t/* number of segments for a half-circle */\n\tcount = 4 * sqrtf(fz_matrix_expansion(ctm) * fz_max(r0, r1));\n\tif (count < 3)\n\t\tcount = 3;\n\tif (count > 1024)\n\t\tcount = 1024;\n\n\tif (shade->u.l_or_r.extend[0])\n\t{\n\t\tif (r0 < r1)\n\t\t\trs = r0 / (r0 - r1);\n\t\telse\n\t\t\trs = -HUGENUM;\n\n\t\te.x = p0.x + (p1.x - p0.x) * rs;\n\t\te.y = p0.y + (p1.y - p0.y) * rs;\n\t\ter = r0 + (r1 - r0) * rs;\n\n\t\tfz_paint_annulus(ctm, e, er, 0, p0, r0, 0, count, painter);\n\t}\n\n\tfz_paint_annulus(ctm, p0, r0, 0, p1, r1, 1, count, painter);\n\n\tif (shade->u.l_or_r.extend[1])\n\t{\n\t\tif (r0 > r1)\n\t\t\trs = r1 / (r1 - r0);\n\t\telse\n\t\t\trs = -HUGENUM;\n\n\t\te.x = p1.x + (p0.x - p1.x) * rs;\n\t\te.y = p1.y + (p0.y - p1.y) * rs;\n\t\ter = r1 + (r0 - r1) * rs;\n\n\t\tfz_paint_annulus(ctm, p1, r1, 1, e, er, 1, count, painter);\n\t}\n}\n\nstatic inline float read_sample(fz_stream *stream, int bits, float min, float max)\n{\n\t/* we use pow(2,x) because (1<<x) would overflow the math on 32-bit samples */\n\tfloat bitscale = 1 / (powf(2, bits) - 1);\n\treturn min + fz_read_bits(stream, bits) * (max - min) * bitscale;\n}\n\nstatic void\nfz_process_mesh_type4(fz_context *ctx, fz_shade *shade, const fz_matrix *ctm, fz_mesh_processor *painter)\n{\n\tfz_stream *stream = fz_open_compressed_buffer(ctx, shade->buffer);\n\tfz_vertex v[4];\n\tfz_vertex *va = &v[0];\n\tfz_vertex *vb = &v[1];\n\tfz_vertex *vc = &v[2];\n\tfz_vertex *vd = &v[3];\n\tint flag, i, ncomp = painter->ncomp;\n\tint bpflag = shade->u.m.bpflag;\n\tint bpcoord = shade->u.m.bpcoord;\n\tint bpcomp = shade->u.m.bpcomp;\n\tfloat x0 = shade->u.m.x0;\n\tfloat x1 = shade->u.m.x1;\n\tfloat y0 = shade->u.m.y0;\n\tfloat y1 = shade->u.m.y1;\n\tfloat *c0 = shade->u.m.c0;\n\tfloat *c1 = shade->u.m.c1;\n\tfloat x, y, c[FZ_MAX_COLORS];\n\n\tfz_try(ctx)\n\t{\n\t\twhile (!fz_is_eof_bits(stream))\n\t\t{\n\t\t\tflag = fz_read_bits(stream, bpflag);\n\t\t\tx = read_sample(stream, bpcoord, x0, x1);\n\t\t\ty = read_sample(stream, bpcoord, y0, y1);\n\t\t\tfor (i = 0; i < ncomp; i++)\n\t\t\t\tc[i] = read_sample(stream, bpcomp, c0[i], c1[i]);\n\t\t\tfz_prepare_vertex(painter, vd, ctm, x, y, c);\n\n\t\t\tswitch (flag)\n\t\t\t{\n\t\t\tcase 0: /* start new triangle */\n\t\t\t\tSWAP(va, vd);\n\n\t\t\t\tfz_read_bits(stream, bpflag);\n\t\t\t\tx = read_sample(stream, bpcoord, x0, x1);\n\t\t\t\ty = read_sample(stream, bpcoord, y0, y1);\n\t\t\t\tfor (i = 0; i < ncomp; i++)\n\t\t\t\t\tc[i] = read_sample(stream, bpcomp, c0[i], c1[i]);\n\t\t\t\tfz_prepare_vertex(painter, vb, ctm, x, y, c);\n\n\t\t\t\tfz_read_bits(stream, bpflag);\n\t\t\t\tx = read_sample(stream, bpcoord, x0, x1);\n\t\t\t\ty = read_sample(stream, bpcoord, y0, y1);\n\t\t\t\tfor (i = 0; i < ncomp; i++)\n\t\t\t\t\tc[i] = read_sample(stream, bpcomp, c0[i], c1[i]);\n\t\t\t\tfz_prepare_vertex(painter, vc, ctm, x, y, c);\n\n\t\t\t\tpaint_tri(painter, va, vb, vc);\n\t\t\t\tbreak;\n\n\t\t\tcase 1: /* Vb, Vc, Vd */\n\t\t\t\tSWAP(va, vb);\n\t\t\t\tSWAP(vb, vc);\n\t\t\t\tSWAP(vc, vd);\n\t\t\t\tpaint_tri(painter, va, vb, vc);\n\t\t\t\tbreak;\n\n\t\t\tcase 2: /* Va, Vc, Vd */\n\t\t\t\tSWAP(vb, vc);\n\t\t\t\tSWAP(vc, vd);\n\t\t\t\tpaint_tri(painter, va, vb, vc);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(stream);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void\nfz_process_mesh_type5(fz_context *ctx, fz_shade *shade, const fz_matrix *ctm, fz_mesh_processor *painter)\n{\n\tfz_stream *stream = fz_open_compressed_buffer(ctx, shade->buffer);\n\tfz_vertex *buf = NULL;\n\tfz_vertex *ref = NULL;\n\tint first;\n\tint ncomp = painter->ncomp;\n\tint i, k;\n\tint vprow = shade->u.m.vprow;\n\tint bpcoord = shade->u.m.bpcoord;\n\tint bpcomp = shade->u.m.bpcomp;\n\tfloat x0 = shade->u.m.x0;\n\tfloat x1 = shade->u.m.x1;\n\tfloat y0 = shade->u.m.y0;\n\tfloat y1 = shade->u.m.y1;\n\tfloat *c0 = shade->u.m.c0;\n\tfloat *c1 = shade->u.m.c1;\n\tfloat x, y, c[FZ_MAX_COLORS];\n\n\tfz_var(buf);\n\tfz_var(ref);\n\n\tfz_try(ctx)\n\t{\n\t\tref = fz_malloc_array(ctx, vprow, sizeof(fz_vertex));\n\t\tbuf = fz_malloc_array(ctx, vprow, sizeof(fz_vertex));\n\t\tfirst = 1;\n\n\t\twhile (!fz_is_eof_bits(stream))\n\t\t{\n\t\t\tfor (i = 0; i < vprow; i++)\n\t\t\t{\n\t\t\t\tx = read_sample(stream, bpcoord, x0, x1);\n\t\t\t\ty = read_sample(stream, bpcoord, y0, y1);\n\t\t\t\tfor (k = 0; k < ncomp; k++)\n\t\t\t\t\tc[k] = read_sample(stream, bpcomp, c0[k], c1[k]);\n\t\t\t\tfz_prepare_vertex(painter, &buf[i], ctm, x, y, c);\n\t\t\t}\n\n\t\t\tif (!first)\n\t\t\t\tfor (i = 0; i < vprow - 1; i++)\n\t\t\t\t\tpaint_quad(painter, &ref[i], &ref[i+1], &buf[i+1], &buf[i]);\n\n\t\t\tSWAP(ref,buf);\n\t\t\tfirst = 0;\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_free(ctx, ref);\n\t\tfz_free(ctx, buf);\n\t\tfz_close(stream);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\n/* Subdivide and tessellate tensor-patches */\n\ntypedef struct tensor_patch_s tensor_patch;\n\nstruct tensor_patch_s\n{\n\tfz_point pole[4][4];\n\tfloat color[4][FZ_MAX_COLORS];\n};\n\nstatic void\ntriangulate_patch(fz_mesh_processor *painter, tensor_patch p)\n{\n\tfz_vertex v0, v1, v2, v3;\n\n\tv0.p = p.pole[0][0];\n\tv1.p = p.pole[0][3];\n\tv2.p = p.pole[3][3];\n\tv3.p = p.pole[3][0];\n\n\tfz_prepare_color(painter, &v0, p.color[0]);\n\tfz_prepare_color(painter, &v1, p.color[1]);\n\tfz_prepare_color(painter, &v2, p.color[2]);\n\tfz_prepare_color(painter, &v3, p.color[3]);\n\n\tpaint_quad(painter, &v0, &v1, &v2, &v3);\n}\n\nstatic inline void midcolor(float *c, float *c1, float *c2, int n)\n{\n\tint i;\n\tfor (i = 0; i < n; i++)\n\t\tc[i] = (c1[i] + c2[i]) * 0.5f;\n}\n\nstatic void\nsplit_curve(fz_point *pole, fz_point *q0, fz_point *q1, int polestep)\n{\n\t/*\n\tsplit bezier curve given by control points pole[0]..pole[3]\n\tusing de casteljau algo at midpoint and build two new\n\tbezier curves q0[0]..q0[3] and q1[0]..q1[3]. all indices\n\tshould be multiplies by polestep == 1 for vertical bezier\n\tcurves in patch and == 4 for horizontal bezier curves due\n\tto C's multi-dimensional matrix memory layout.\n\t*/\n\n\tfloat x12 = (pole[1 * polestep].x + pole[2 * polestep].x) * 0.5f;\n\tfloat y12 = (pole[1 * polestep].y + pole[2 * polestep].y) * 0.5f;\n\n\tq0[1 * polestep].x = (pole[0 * polestep].x + pole[1 * polestep].x) * 0.5f;\n\tq0[1 * polestep].y = (pole[0 * polestep].y + pole[1 * polestep].y) * 0.5f;\n\tq1[2 * polestep].x = (pole[2 * polestep].x + pole[3 * polestep].x) * 0.5f;\n\tq1[2 * polestep].y = (pole[2 * polestep].y + pole[3 * polestep].y) * 0.5f;\n\n\tq0[2 * polestep].x = (q0[1 * polestep].x + x12) * 0.5f;\n\tq0[2 * polestep].y = (q0[1 * polestep].y + y12) * 0.5f;\n\tq1[1 * polestep].x = (x12 + q1[2 * polestep].x) * 0.5f;\n\tq1[1 * polestep].y = (y12 + q1[2 * polestep].y) * 0.5f;\n\n\tq0[3 * polestep].x = (q0[2 * polestep].x + q1[1 * polestep].x) * 0.5f;\n\tq0[3 * polestep].y = (q0[2 * polestep].y + q1[1 * polestep].y) * 0.5f;\n\tq1[0 * polestep].x = (q0[2 * polestep].x + q1[1 * polestep].x) * 0.5f;\n\tq1[0 * polestep].y = (q0[2 * polestep].y + q1[1 * polestep].y) * 0.5f;\n\n\tq0[0 * polestep].x = pole[0 * polestep].x;\n\tq0[0 * polestep].y = pole[0 * polestep].y;\n\tq1[3 * polestep].x = pole[3 * polestep].x;\n\tq1[3 * polestep].y = pole[3 * polestep].y;\n}\n\nstatic void\nsplit_stripe(tensor_patch *p, tensor_patch *s0, tensor_patch *s1, int n)\n{\n\t/*\n\tsplit all horizontal bezier curves in patch,\n\tcreating two new patches with half the width.\n\t*/\n\tsplit_curve(&p->pole[0][0], &s0->pole[0][0], &s1->pole[0][0], 4);\n\tsplit_curve(&p->pole[0][1], &s0->pole[0][1], &s1->pole[0][1], 4);\n\tsplit_curve(&p->pole[0][2], &s0->pole[0][2], &s1->pole[0][2], 4);\n\tsplit_curve(&p->pole[0][3], &s0->pole[0][3], &s1->pole[0][3], 4);\n\n\t/* interpolate the colors for the two new patches. */\n\tmemcpy(s0->color[0], p->color[0], n * sizeof(s0->color[0][0]));\n\tmemcpy(s0->color[1], p->color[1], n * sizeof(s0->color[1][0]));\n\tmidcolor(s0->color[2], p->color[1], p->color[2], n);\n\tmidcolor(s0->color[3], p->color[0], p->color[3], n);\n\n\tmemcpy(s1->color[0], s0->color[3], n * sizeof(s1->color[0][0]));\n\tmemcpy(s1->color[1], s0->color[2], n * sizeof(s1->color[1][0]));\n\tmemcpy(s1->color[2], p->color[2], n * sizeof(s1->color[2][0]));\n\tmemcpy(s1->color[3], p->color[3], n * sizeof(s1->color[3][0]));\n}\n\nstatic void\ndraw_stripe(fz_mesh_processor *painter, tensor_patch *p, int depth)\n{\n\ttensor_patch s0, s1;\n\n\t/* split patch into two half-height patches */\n\tsplit_stripe(p, &s0, &s1, painter->ncomp);\n\n\tdepth--;\n\tif (depth == 0)\n\t{\n\t\t/* if no more subdividing, draw two new patches... */\n\t\ttriangulate_patch(painter, s1);\n\t\ttriangulate_patch(painter, s0);\n\t}\n\telse\n\t{\n\t\t/* ...otherwise, continue subdividing. */\n\t\tdraw_stripe(painter, &s1, depth);\n\t\tdraw_stripe(painter, &s0, depth);\n\t}\n}\n\nstatic void\nsplit_patch(tensor_patch *p, tensor_patch *s0, tensor_patch *s1, int n)\n{\n\t/*\n\tsplit all vertical bezier curves in patch,\n\tcreating two new patches with half the height.\n\t*/\n\tsplit_curve(p->pole[0], s0->pole[0], s1->pole[0], 1);\n\tsplit_curve(p->pole[1], s0->pole[1], s1->pole[1], 1);\n\tsplit_curve(p->pole[2], s0->pole[2], s1->pole[2], 1);\n\tsplit_curve(p->pole[3], s0->pole[3], s1->pole[3], 1);\n\n\t/* interpolate the colors for the two new patches. */\n\tmemcpy(s0->color[0], p->color[0], n * sizeof(s0->color[0][0]));\n\tmidcolor(s0->color[1], p->color[0], p->color[1], n);\n\tmidcolor(s0->color[2], p->color[2], p->color[3], n);\n\tmemcpy(s0->color[3], p->color[3], n * sizeof(s0->color[3][0]));\n\n\tmemcpy(s1->color[0], s0->color[1], n * sizeof(s1->color[0][0]));\n\tmemcpy(s1->color[1], p->color[1], n * sizeof(s1->color[1][0]));\n\tmemcpy(s1->color[2], p->color[2], n * sizeof(s1->color[2][0]));\n\tmemcpy(s1->color[3], s0->color[2], n * sizeof(s1->color[3][0]));\n}\n\nstatic void\ndraw_patch(fz_mesh_processor *painter, tensor_patch *p, int depth, int origdepth)\n{\n\ttensor_patch s0, s1;\n\n\t/* split patch into two half-width patches */\n\tsplit_patch(p, &s0, &s1, painter->ncomp);\n\n\tdepth--;\n\tif (depth == 0)\n\t{\n\t\t/* if no more subdividing, draw two new patches... */\n\t\tdraw_stripe(painter, &s0, origdepth);\n\t\tdraw_stripe(painter, &s1, origdepth);\n\t}\n\telse\n\t{\n\t\t/* ...otherwise, continue subdividing. */\n\t\tdraw_patch(painter, &s0, depth, origdepth);\n\t\tdraw_patch(painter, &s1, depth, origdepth);\n\t}\n}\n\nstatic fz_point\ncompute_tensor_interior(\n\tfz_point a, fz_point b, fz_point c, fz_point d,\n\tfz_point e, fz_point f, fz_point g, fz_point h)\n{\n\tfz_point pt;\n\n\t/* see equations at page 330 in pdf 1.7 */\n\n\tpt.x = -4 * a.x;\n\tpt.x += 6 * (b.x + c.x);\n\tpt.x += -2 * (d.x + e.x);\n\tpt.x += 3 * (f.x + g.x);\n\tpt.x += -1 * h.x;\n\tpt.x /= 9;\n\n\tpt.y = -4 * a.y;\n\tpt.y += 6 * (b.y + c.y);\n\tpt.y += -2 * (d.y + e.y);\n\tpt.y += 3 * (f.y + g.y);\n\tpt.y += -1 * h.y;\n\tpt.y /= 9;\n\n\treturn pt;\n}\n\nstatic void\nmake_tensor_patch(tensor_patch *p, int type, fz_point *pt)\n{\n\tif (type == 6)\n\t{\n\t\t/* see control point stream order at page 325 in pdf 1.7 */\n\n\t\tp->pole[0][0] = pt[0];\n\t\tp->pole[0][1] = pt[1];\n\t\tp->pole[0][2] = pt[2];\n\t\tp->pole[0][3] = pt[3];\n\t\tp->pole[1][3] = pt[4];\n\t\tp->pole[2][3] = pt[5];\n\t\tp->pole[3][3] = pt[6];\n\t\tp->pole[3][2] = pt[7];\n\t\tp->pole[3][1] = pt[8];\n\t\tp->pole[3][0] = pt[9];\n\t\tp->pole[2][0] = pt[10];\n\t\tp->pole[1][0] = pt[11];\n\n\t\t/* see equations at page 330 in pdf 1.7 */\n\n\t\tp->pole[1][1] = compute_tensor_interior(\n\t\t\tp->pole[0][0], p->pole[0][1], p->pole[1][0], p->pole[0][3],\n\t\t\tp->pole[3][0], p->pole[3][1], p->pole[1][3], p->pole[3][3]);\n\n\t\tp->pole[1][2] = compute_tensor_interior(\n\t\t\tp->pole[0][3], p->pole[0][2], p->pole[1][3], p->pole[0][0],\n\t\t\tp->pole[3][3], p->pole[3][2], p->pole[1][0], p->pole[3][0]);\n\n\t\tp->pole[2][1] = compute_tensor_interior(\n\t\t\tp->pole[3][0], p->pole[3][1], p->pole[2][0], p->pole[3][3],\n\t\t\tp->pole[0][0], p->pole[0][1], p->pole[2][3], p->pole[0][3]);\n\n\t\tp->pole[2][2] = compute_tensor_interior(\n\t\t\tp->pole[3][3], p->pole[3][2], p->pole[2][3], p->pole[3][0],\n\t\t\tp->pole[0][3], p->pole[0][2], p->pole[2][0], p->pole[0][0]);\n\t}\n\telse if (type == 7)\n\t{\n\t\t/* see control point stream order at page 330 in pdf 1.7 */\n\n\t\tp->pole[0][0] = pt[0];\n\t\tp->pole[0][1] = pt[1];\n\t\tp->pole[0][2] = pt[2];\n\t\tp->pole[0][3] = pt[3];\n\t\tp->pole[1][3] = pt[4];\n\t\tp->pole[2][3] = pt[5];\n\t\tp->pole[3][3] = pt[6];\n\t\tp->pole[3][2] = pt[7];\n\t\tp->pole[3][1] = pt[8];\n\t\tp->pole[3][0] = pt[9];\n\t\tp->pole[2][0] = pt[10];\n\t\tp->pole[1][0] = pt[11];\n\t\tp->pole[1][1] = pt[12];\n\t\tp->pole[1][2] = pt[13];\n\t\tp->pole[2][2] = pt[14];\n\t\tp->pole[2][1] = pt[15];\n\t}\n}\n\n/* FIXME: Nasty */\n#define SUBDIV 3 /* how many levels to subdivide patches */\n\nstatic void\nfz_process_mesh_type6(fz_context *ctx, fz_shade *shade, const fz_matrix *ctm, fz_mesh_processor *painter)\n{\n\tfz_stream *stream = fz_open_compressed_buffer(ctx, shade->buffer);\n\tfloat color_storage[2][4][FZ_MAX_COLORS];\n\tfz_point point_storage[2][12];\n\tint store = 0;\n\tint ncomp = painter->ncomp;\n\tint i, k;\n\tint bpflag = shade->u.m.bpflag;\n\tint bpcoord = shade->u.m.bpcoord;\n\tint bpcomp = shade->u.m.bpcomp;\n\tfloat x0 = shade->u.m.x0;\n\tfloat x1 = shade->u.m.x1;\n\tfloat y0 = shade->u.m.y0;\n\tfloat y1 = shade->u.m.y1;\n\tfloat *c0 = shade->u.m.c0;\n\tfloat *c1 = shade->u.m.c1;\n\n\tfz_try(ctx)\n\t{\n\t\tfloat (*prevc)[FZ_MAX_COLORS] = NULL;\n\t\tfz_point *prevp = NULL;\n\t\twhile (!fz_is_eof_bits(stream))\n\t\t{\n\t\t\tfloat (*c)[FZ_MAX_COLORS] = color_storage[store];\n\t\t\tfz_point *v = point_storage[store];\n\t\t\tint startcolor;\n\t\t\tint startpt;\n\t\t\tint flag;\n\t\t\ttensor_patch patch;\n\n\t\t\tflag = fz_read_bits(stream, bpflag);\n\n\t\t\tif (flag == 0)\n\t\t\t{\n\t\t\t\tstartpt = 0;\n\t\t\t\tstartcolor = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstartpt = 4;\n\t\t\t\tstartcolor = 2;\n\t\t\t}\n\n\t\t\tfor (i = startpt; i < 12; i++)\n\t\t\t{\n\t\t\t\tv[i].x = read_sample(stream, bpcoord, x0, x1);\n\t\t\t\tv[i].y = read_sample(stream, bpcoord, y0, y1);\n\t\t\t\tfz_transform_point(&v[i], ctm);\n\t\t\t}\n\n\t\t\tfor (i = startcolor; i < 4; i++)\n\t\t\t{\n\t\t\t\tfor (k = 0; k < ncomp; k++)\n\t\t\t\t\tc[i][k] = read_sample(stream, bpcomp, c0[k], c1[k]);\n\t\t\t}\n\n\t\t\tif (flag == 0)\n\t\t\t{\n\t\t\t}\n\t\t\telse if (flag == 1 && prevc)\n\t\t\t{\n\t\t\t\tv[0] = prevp[3];\n\t\t\t\tv[1] = prevp[4];\n\t\t\t\tv[2] = prevp[5];\n\t\t\t\tv[3] = prevp[6];\n\t\t\t\tmemcpy(c[0], prevc[1], ncomp * sizeof(float));\n\t\t\t\tmemcpy(c[1], prevc[2], ncomp * sizeof(float));\n\t\t\t}\n\t\t\telse if (flag == 2 && prevc)\n\t\t\t{\n\t\t\t\tv[0] = prevp[6];\n\t\t\t\tv[1] = prevp[7];\n\t\t\t\tv[2] = prevp[8];\n\t\t\t\tv[3] = prevp[9];\n\t\t\t\tmemcpy(c[0], prevc[2], ncomp * sizeof(float));\n\t\t\t\tmemcpy(c[1], prevc[3], ncomp * sizeof(float));\n\t\t\t}\n\t\t\telse if (flag == 3 && prevc)\n\t\t\t{\n\t\t\t\tv[0] = prevp[ 9];\n\t\t\t\tv[1] = prevp[10];\n\t\t\t\tv[2] = prevp[11];\n\t\t\t\tv[3] = prevp[ 0];\n\t\t\t\tmemcpy(c[0], prevc[3], ncomp * sizeof(float));\n\t\t\t\tmemcpy(c[1], prevc[0], ncomp * sizeof(float));\n\t\t\t}\n\t\t\telse\n\t\t\t\tcontinue;\n\n\t\t\tmake_tensor_patch(&patch, 6, v);\n\n\t\t\tfor (i = 0; i < 4; i++)\n\t\t\t\tmemcpy(patch.color[i], c[i], ncomp * sizeof(float));\n\n\t\t\tdraw_patch(painter, &patch, SUBDIV, SUBDIV);\n\n\t\t\tprevp = v;\n\t\t\tprevc = c;\n\t\t\tstore ^= 1;\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(stream);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void\nfz_process_mesh_type7(fz_context *ctx, fz_shade *shade, const fz_matrix *ctm, fz_mesh_processor *painter)\n{\n\tfz_stream *stream = fz_open_compressed_buffer(ctx, shade->buffer);\n\tint bpflag = shade->u.m.bpflag;\n\tint bpcoord = shade->u.m.bpcoord;\n\tint bpcomp = shade->u.m.bpcomp;\n\tfloat x0 = shade->u.m.x0;\n\tfloat x1 = shade->u.m.x1;\n\tfloat y0 = shade->u.m.y0;\n\tfloat y1 = shade->u.m.y1;\n\tfloat *c0 = shade->u.m.c0;\n\tfloat *c1 = shade->u.m.c1;\n\tfloat color_storage[2][4][FZ_MAX_COLORS];\n\tfz_point point_storage[2][16];\n\tint store = 0;\n\tint ncomp = painter->ncomp;\n\tint i, k;\n\tfloat (*prevc)[FZ_MAX_COLORS] = NULL;\n\tfz_point (*prevp) = NULL;\n\n\tfz_try(ctx)\n\t{\n\t\twhile (!fz_is_eof_bits(stream))\n\t\t{\n\t\t\tfloat (*c)[FZ_MAX_COLORS] = color_storage[store];\n\t\t\tfz_point *v = point_storage[store];\n\t\t\tint startcolor;\n\t\t\tint startpt;\n\t\t\tint flag;\n\t\t\ttensor_patch patch;\n\n\t\t\tflag = fz_read_bits(stream, bpflag);\n\n\t\t\tif (flag == 0)\n\t\t\t{\n\t\t\t\tstartpt = 0;\n\t\t\t\tstartcolor = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstartpt = 4;\n\t\t\t\tstartcolor = 2;\n\t\t\t}\n\n\t\t\tfor (i = startpt; i < 16; i++)\n\t\t\t{\n\t\t\t\tv[i].x = read_sample(stream, bpcoord, x0, x1);\n\t\t\t\tv[i].y = read_sample(stream, bpcoord, y0, y1);\n\t\t\t\tfz_transform_point(&v[i], ctm);\n\t\t\t}\n\n\t\t\tfor (i = startcolor; i < 4; i++)\n\t\t\t{\n\t\t\t\tfor (k = 0; k < ncomp; k++)\n\t\t\t\t\tc[i][k] = read_sample(stream, bpcomp, c0[k], c1[k]);\n\t\t\t}\n\n\t\t\tif (flag == 0)\n\t\t\t{\n\t\t\t}\n\t\t\telse if (flag == 1 && prevc)\n\t\t\t{\n\t\t\t\tv[0] = prevp[3];\n\t\t\t\tv[1] = prevp[4];\n\t\t\t\tv[2] = prevp[5];\n\t\t\t\tv[3] = prevp[6];\n\t\t\t\tmemcpy(c[0], prevc[1], ncomp * sizeof(float));\n\t\t\t\tmemcpy(c[1], prevc[2], ncomp * sizeof(float));\n\t\t\t}\n\t\t\telse if (flag == 2 && prevc)\n\t\t\t{\n\t\t\t\tv[0] = prevp[6];\n\t\t\t\tv[1] = prevp[7];\n\t\t\t\tv[2] = prevp[8];\n\t\t\t\tv[3] = prevp[9];\n\t\t\t\tmemcpy(c[0], prevc[2], ncomp * sizeof(float));\n\t\t\t\tmemcpy(c[1], prevc[3], ncomp * sizeof(float));\n\t\t\t}\n\t\t\telse if (flag == 3 && prevc)\n\t\t\t{\n\t\t\t\tv[0] = prevp[ 9];\n\t\t\t\tv[1] = prevp[10];\n\t\t\t\tv[2] = prevp[11];\n\t\t\t\tv[3] = prevp[ 0];\n\t\t\t\tmemcpy(c[0], prevc[3], ncomp * sizeof(float));\n\t\t\t\tmemcpy(c[1], prevc[0], ncomp * sizeof(float));\n\t\t\t}\n\t\t\telse\n\t\t\t\tcontinue; /* We have no patch! */\n\n\t\t\tmake_tensor_patch(&patch, 7, v);\n\n\t\t\tfor (i = 0; i < 4; i++)\n\t\t\t\tmemcpy(patch.color[i], c[i], ncomp * sizeof(float));\n\n\t\t\tdraw_patch(painter, &patch, SUBDIV, SUBDIV);\n\n\t\t\tprevp = v;\n\t\t\tprevc = c;\n\t\t\tstore ^= 1;\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(stream);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nvoid\nfz_process_mesh(fz_context *ctx, fz_shade *shade, const fz_matrix *ctm,\n\t\tfz_mesh_prepare_fn *prepare, fz_mesh_process_fn *process, void *process_arg)\n{\n\tfz_mesh_processor painter;\n\n\tpainter.ctx = ctx;\n\tpainter.shade = shade;\n\tpainter.prepare = prepare;\n\tpainter.process = process;\n\tpainter.process_arg = process_arg;\n\tpainter.ncomp = (shade->use_function > 0 ? 1 : shade->colorspace->n);\n\n\tif (shade->type == FZ_FUNCTION_BASED)\n\t\tfz_process_mesh_type1(ctx, shade, ctm, &painter);\n\telse if (shade->type == FZ_LINEAR)\n\t\tfz_process_mesh_type2(ctx, shade, ctm, &painter);\n\telse if (shade->type == FZ_RADIAL)\n\t\tfz_process_mesh_type3(ctx, shade, ctm, &painter);\n\telse if (shade->type == FZ_MESH_TYPE4)\n\t\tfz_process_mesh_type4(ctx, shade, ctm, &painter);\n\telse if (shade->type == FZ_MESH_TYPE5)\n\t\tfz_process_mesh_type5(ctx, shade, ctm, &painter);\n\telse if (shade->type == FZ_MESH_TYPE6)\n\t\tfz_process_mesh_type6(ctx, shade, ctm, &painter);\n\telse if (shade->type == FZ_MESH_TYPE7)\n\t\tfz_process_mesh_type7(ctx, shade, ctm, &painter);\n\telse\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Unexpected mesh type %d\\n\", shade->type);\n}\n\nstatic fz_rect *\nfz_bound_mesh_type1(fz_context *ctx, fz_shade *shade, fz_rect *bbox)\n{\n\tbbox->x0 = shade->u.f.domain[0][0];\n\tbbox->y0 = shade->u.f.domain[0][1];\n\tbbox->x1 = shade->u.f.domain[1][0];\n\tbbox->y1 = shade->u.f.domain[1][1];\n\treturn fz_transform_rect(bbox, &shade->u.f.matrix);\n}\n\nstatic fz_rect *\nfz_bound_mesh_type2(fz_context *ctx, fz_shade *shade, fz_rect *bbox)\n{\n\t/* FIXME: If axis aligned and not extended, the bbox may only be\n\t * infinite in one direction */\n\t*bbox = fz_infinite_rect;\n\treturn bbox;\n}\n\nstatic fz_rect *\nfz_bound_mesh_type3(fz_context *ctx, fz_shade *shade, fz_rect *bbox)\n{\n\tfz_point p0, p1;\n\tfloat r0, r1;\n\n\tr0 = shade->u.l_or_r.coords[0][2];\n\tr1 = shade->u.l_or_r.coords[1][2];\n\n\tif (shade->u.l_or_r.extend[0])\n\t{\n\t\tif (r0 >= r1)\n\t\t{\n\t\t\t*bbox = fz_infinite_rect;\n\t\t\treturn bbox;\n\t\t}\n\t}\n\n\tif (shade->u.l_or_r.extend[1])\n\t{\n\t\tif (r0 <= r1)\n\t\t{\n\t\t\t*bbox = fz_infinite_rect;\n\t\t\treturn bbox;\n\t\t}\n\t}\n\n\tp0.x = shade->u.l_or_r.coords[0][0];\n\tp0.y = shade->u.l_or_r.coords[0][1];\n\tp1.x = shade->u.l_or_r.coords[1][0];\n\tp1.y = shade->u.l_or_r.coords[1][1];\n\n\tbbox->x0 = p0.x - r0; bbox->y0 = p0.y - r0;\n\tbbox->x1 = p0.x + r0; bbox->y1 = p0.x + r0;\n\tif (bbox->x0 > p1.x - r1)\n\t\tbbox->x0 = p1.x - r1;\n\tif (bbox->x1 < p1.x + r1)\n\t\tbbox->x1 = p1.x + r1;\n\tif (bbox->y0 > p1.y - r1)\n\t\tbbox->y0 = p1.y - r1;\n\tif (bbox->y1 < p1.y + r1)\n\t\tbbox->y1 = p1.y + r1;\n\treturn bbox;\n}\n\nstatic fz_rect *\nfz_bound_mesh_type4567(fz_context *ctx, fz_shade *shade, fz_rect *bbox)\n{\n\tbbox->x0 = shade->u.m.x0;\n\tbbox->y0 = shade->u.m.y0;\n\tbbox->x1 = shade->u.m.x1;\n\tbbox->y1 = shade->u.m.y1;\n\treturn bbox;\n}\n\nstatic fz_rect *\nfz_bound_mesh(fz_context *ctx, fz_shade *shade, fz_rect *bbox)\n{\n\tif (shade->type == FZ_FUNCTION_BASED)\n\t\tfz_bound_mesh_type1(ctx, shade, bbox);\n\telse if (shade->type == FZ_LINEAR)\n\t\tfz_bound_mesh_type2(ctx, shade, bbox);\n\telse if (shade->type == FZ_RADIAL)\n\t\tfz_bound_mesh_type3(ctx, shade, bbox);\n\telse if (shade->type == FZ_MESH_TYPE4 ||\n\t\tshade->type == FZ_MESH_TYPE5 ||\n\t\tshade->type == FZ_MESH_TYPE6 ||\n\t\tshade->type == FZ_MESH_TYPE7)\n\t\tfz_bound_mesh_type4567(ctx, shade, bbox);\n\telse\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Unexpected mesh type %d\\n\", shade->type);\n\n\treturn bbox;\n}\n\nfz_shade *\nfz_keep_shade(fz_context *ctx, fz_shade *shade)\n{\n\treturn (fz_shade *)fz_keep_storable(ctx, &shade->storable);\n}\n\nvoid\nfz_free_shade_imp(fz_context *ctx, fz_storable *shade_)\n{\n\tfz_shade *shade = (fz_shade *)shade_;\n\n\tif (shade->colorspace)\n\t\tfz_drop_colorspace(ctx, shade->colorspace);\n\tif (shade->type == FZ_FUNCTION_BASED)\n\t\tfz_free(ctx, shade->u.f.fn_vals);\n\tfz_free_compressed_buffer(ctx, shade->buffer);\n\tfz_free(ctx, shade);\n}\n\nvoid\nfz_drop_shade(fz_context *ctx, fz_shade *shade)\n{\n\tfz_drop_storable(ctx, &shade->storable);\n}\n\nfz_rect *\nfz_bound_shade(fz_context *ctx, fz_shade *shade, const fz_matrix *ctm, fz_rect *s)\n{\n\tfz_matrix local_ctm;\n\tfz_rect rect;\n\n\tfz_concat(&local_ctm, &shade->matrix, ctm);\n\t*s = shade->bbox;\n\tif (shade->type != FZ_LINEAR && shade->type != FZ_RADIAL)\n\t{\n\t\tfz_bound_mesh(ctx, shade, &rect);\n\t\tfz_intersect_rect(s, &rect);\n\t}\n\treturn fz_transform_rect(s, &local_ctm);\n}\n\n#ifndef NDEBUG\nvoid\nfz_print_shade(fz_context *ctx, FILE *out, fz_shade *shade)\n{\n\tint i;\n\n\tfprintf(out, \"shading {\\n\");\n\n\tswitch (shade->type)\n\t{\n\tcase FZ_FUNCTION_BASED: fprintf(out, \"\\ttype function_based\\n\"); break;\n\tcase FZ_LINEAR: fprintf(out, \"\\ttype linear\\n\"); break;\n\tcase FZ_RADIAL: fprintf(out, \"\\ttype radial\\n\"); break;\n\tdefault: /* MESH */ fprintf(out, \"\\ttype mesh\\n\"); break;\n\t}\n\n\tfprintf(out, \"\\tbbox [%g %g %g %g]\\n\",\n\t\tshade->bbox.x0, shade->bbox.y0,\n\t\tshade->bbox.x1, shade->bbox.y1);\n\n\tfprintf(out, \"\\tcolorspace %s\\n\", shade->colorspace->name);\n\n\tfprintf(out, \"\\tmatrix [%g %g %g %g %g %g]\\n\",\n\t\t\tshade->matrix.a, shade->matrix.b, shade->matrix.c,\n\t\t\tshade->matrix.d, shade->matrix.e, shade->matrix.f);\n\n\tif (shade->use_background)\n\t{\n\t\tfprintf(out, \"\\tbackground [\");\n\t\tfor (i = 0; i < shade->colorspace->n; i++)\n\t\t\tfprintf(out, \"%s%g\", i == 0 ? \"\" : \" \", shade->background[i]);\n\t\tfprintf(out, \"]\\n\");\n\t}\n\n\tif (shade->use_function)\n\t{\n\t\tfprintf(out, \"\\tfunction\\n\");\n\t}\n\n\tfprintf(out, \"}\\n\");\n}\n#endif\n"
  },
  {
    "path": "mupdf/source/fitz/stext-device.c",
    "content": "#include \"mupdf/fitz.h\"\n#include \"ucdn.h\"\n\n/* Extract text into an unsorted span soup. */\n\n#define LINE_DIST 0.9f\n#define SPACE_DIST 0.2f\n#define SPACE_MAX_DIST 0.8f\n#define PARAGRAPH_DIST 0.5f\n\n#undef DEBUG_SPANS\n#undef DEBUG_INTERNALS\n#undef DEBUG_LINE_HEIGHTS\n#undef DEBUG_MASKS\n#undef DEBUG_ALIGN\n#undef DEBUG_INDENTS\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_ADVANCES_H\n\ntypedef struct fz_text_device_s fz_text_device;\n\ntypedef struct span_soup_s span_soup;\n\nstruct fz_text_device_s\n{\n\tfz_text_sheet *sheet;\n\tfz_text_page *page;\n\tspan_soup *spans;\n\tfz_text_span *cur_span;\n\tint lastchar;\n};\n\nstatic fz_rect *\nadd_point_to_rect(fz_rect *a, const fz_point *p)\n{\n\tif (p->x < a->x0)\n\t\ta->x0 = p->x;\n\tif (p->x > a->x1)\n\t\ta->x1 = p->x;\n\tif (p->y < a->y0)\n\t\ta->y0 = p->y;\n\tif (p->y > a->y1)\n\t\ta->y1 = p->y;\n\treturn a;\n}\n\nfz_rect *\nfz_text_char_bbox(fz_rect *bbox, fz_text_span *span, int i)\n{\n\tfz_point a, d;\n\tconst fz_point *max;\n\tfz_text_char *ch;\n\n\tif (!span || i >= span->len)\n\t{\n\t\t*bbox = fz_empty_rect;\n\t\treturn bbox;\n\t}\n\tch = &span->text[i];\n\tif (i == span->len-1)\n\t\tmax = &span->max;\n\telse\n\t\tmax = &span->text[i+1].p;\n\ta.x = 0;\n\ta.y = span->ascender_max;\n\tfz_transform_vector(&a, &span->transform);\n\td.x = 0;\n\td.y = span->descender_min;\n\tfz_transform_vector(&d, &span->transform);\n\tbbox->x0 = bbox->x1 = ch->p.x + a.x;\n\tbbox->y0 = bbox->y1 = ch->p.y + a.y;\n\ta.x += max->x;\n\ta.y += max->y;\n\tadd_point_to_rect(bbox, &a);\n\ta.x = ch->p.x + d.x;\n\ta.y = ch->p.y + d.y;\n\tadd_point_to_rect(bbox, &a);\n\ta.x = max->x + d.x;\n\ta.y = max->y + d.y;\n\tadd_point_to_rect(bbox, &a);\n\treturn bbox;\n}\n\nstatic void\nadd_bbox_to_span(fz_text_span *span)\n{\n\tfz_point a, d;\n\tfz_rect *bbox = &span->bbox;\n\n\tif (!span)\n\t\treturn;\n\ta.x = 0;\n\ta.y = span->ascender_max;\n\tfz_transform_vector(&a, &span->transform);\n\td.x = 0;\n\td.y = span->descender_min;\n\tfz_transform_vector(&d, &span->transform);\n\tbbox->x0 = bbox->x1 = span->min.x + a.x;\n\tbbox->y0 = bbox->y1 = span->min.y + a.y;\n\ta.x += span->max.x;\n\ta.y += span->max.y;\n\tadd_point_to_rect(bbox, &a);\n\ta.x = span->min.x + d.x;\n\ta.y = span->min.y + d.y;\n\tadd_point_to_rect(bbox, &a);\n\ta.x = span->max.x + d.x;\n\ta.y = span->max.y + d.y;\n\tadd_point_to_rect(bbox, &a);\n}\n\nstruct span_soup_s\n{\n\tfz_context *ctx;\n\tint len, cap;\n\tfz_text_span **spans;\n};\n\nstatic span_soup *\nnew_span_soup(fz_context *ctx)\n{\n\tspan_soup *soup = fz_malloc_struct(ctx, span_soup);\n\tsoup->ctx = ctx;\n\tsoup->len = 0;\n\tsoup->cap = 0;\n\tsoup->spans = NULL;\n\treturn soup;\n}\n\nstatic void\nfree_span_soup(span_soup *soup)\n{\n\tint i;\n\n\tif (soup == NULL)\n\t\treturn;\n\tfor (i = 0; i < soup->len; i++)\n\t{\n\t\tfz_free(soup->ctx, soup->spans[i]);\n\t}\n\tfz_free(soup->ctx, soup->spans);\n\tfz_free(soup->ctx, soup);\n}\n\nstatic void\nadd_span_to_soup(span_soup *soup, fz_text_span *span)\n{\n\tif (span == NULL)\n\t\treturn;\n\tif (soup->len == soup->cap)\n\t{\n\t\tint newcap = (soup->cap ? soup->cap * 2 : 16);\n\t\tsoup->spans = fz_resize_array(soup->ctx, soup->spans, newcap, sizeof(*soup->spans));\n\t\tsoup->cap = newcap;\n\t}\n\tadd_bbox_to_span(span);\n\tsoup->spans[soup->len++] = span;\n}\n\nstatic fz_text_line *\npush_span(fz_context *ctx, fz_text_device *tdev, fz_text_span *span, int new_line, float distance)\n{\n\tfz_text_line *line;\n\tfz_text_block *block;\n\tfz_text_page *page = tdev->page;\n\tint prev_not_text = 0;\n\n\tif (page->len == 0 || page->blocks[page->len-1].type != FZ_PAGE_BLOCK_TEXT)\n\t\tprev_not_text = 1;\n\n\tif (new_line || prev_not_text)\n\t{\n\t\t/* SumatraPDF: fixup_text_page doesn't handle multiple blocks yet * /\n\t\tfloat size = fz_matrix_expansion(&span->transform);\n\t\t/* So, a new line. Part of the same block or not? */\n\t\tif (/* distance == 0 || distance > size * 1.5 || distance < -size * PARAGRAPH_DIST || page->len == 0 || */ prev_not_text)\n\t\t{\n\t\t\t/* New block */\n\t\t\tif (page->len == page->cap)\n\t\t\t{\n\t\t\t\tint newcap = (page->cap ? page->cap*2 : 4);\n\t\t\t\tpage->blocks = fz_resize_array(ctx, page->blocks, newcap, sizeof(*page->blocks));\n\t\t\t\tpage->cap = newcap;\n\t\t\t}\n\t\t\tblock = fz_malloc_struct(ctx, fz_text_block);\n\t\t\tpage->blocks[page->len].type = FZ_PAGE_BLOCK_TEXT;\n\t\t\tpage->blocks[page->len].u.text = block;\n\t\t\tblock->cap = 0;\n\t\t\tblock->len = 0;\n\t\t\tblock->lines = 0;\n\t\t\tblock->bbox = fz_empty_rect;\n\t\t\tpage->len++;\n\t\t\tdistance = 0;\n\t\t}\n\n\t\t/* New line */\n\t\tblock = page->blocks[page->len-1].u.text;\n\t\tif (block->len == block->cap)\n\t\t{\n\t\t\tint newcap = (block->cap ? block->cap*2 : 4);\n\t\t\tblock->lines = fz_resize_array(ctx, block->lines, newcap, sizeof(*block->lines));\n\t\t\tblock->cap = newcap;\n\t\t}\n\t\tblock->lines[block->len].first_span = NULL;\n\t\tblock->lines[block->len].last_span = NULL;\n\t\tblock->lines[block->len].distance = distance;\n\t\tblock->lines[block->len].bbox = fz_empty_rect;\n\t\tblock->len++;\n\t}\n\n\t/* Find last line and append to it */\n\tblock = page->blocks[page->len-1].u.text;\n\tline = &block->lines[block->len-1];\n\n\tfz_union_rect(&block->lines[block->len-1].bbox, &span->bbox);\n\tfz_union_rect(&block->bbox, &span->bbox);\n\tspan->base_offset = (new_line ? 0 : distance);\n\n\tif (!line->first_span)\n\t{\n\t\tline->first_span = line->last_span = span;\n\t\tspan->next = NULL;\n\t}\n\telse\n\t{\n\t\tline->last_span->next = span;\n\t\tline->last_span = span;\n\t}\n\n\treturn line;\n}\n\n#if defined(DEBUG_SPANS) || defined(DEBUG_ALIGN) || defined(DEBUG_INDENTS)\nstatic void\ndump_span(fz_text_span *s)\n{\n\tint i;\n\tfor (i=0; i < s->len; i++)\n\t{\n\t\tprintf(\"%c\", s->text[i].c);\n\t}\n}\n#endif\n\n#ifdef DEBUG_ALIGN\nstatic void\ndump_line(fz_text_line *line)\n{\n\tint i;\n\tfor (i=0; i < line->len; i++)\n\t{\n\t\tfz_text_span *s = line->spans[i];\n\t\tif (s->spacing > 1)\n\t\t\tprintf(\" \");\n\t\tdump_span(s);\n\t}\n\tprintf(\"\\n\");\n}\n#endif\n\nstatic void\nstrain_soup(fz_context *ctx, fz_text_device *tdev)\n{\n\tspan_soup *soup = tdev->spans;\n\tfz_text_line *last_line = NULL;\n\tfz_text_span *last_span = NULL;\n\tint span_num;\n\n\t/* Really dumb implementation to match what we had before */\n\tfor (span_num=0; span_num < soup->len; span_num++)\n\t{\n\t\tfz_text_span *span = soup->spans[span_num];\n\t\tint new_line = 1;\n\t\tfloat distance = 0;\n\t\tfloat spacing = 0;\n\t\tsoup->spans[span_num] = NULL;\n\t\tif (last_span)\n\t\t{\n\t\t\t/* If we have a last_span, we must have a last_line */\n\t\t\t/* Do span and last_line share the same baseline? */\n\t\t\tfz_point p, q, perp_r;\n\t\t\tfloat dot;\n\t\t\tfloat size = fz_matrix_expansion(&span->transform);\n\n#ifdef DEBUG_SPANS\n\t\t\t{\n\t\t\t\tprintf(\"Comparing: \\\"\");\n\t\t\t\tdump_span(last_span);\n\t\t\t\tprintf(\"\\\" and \\\"\");\n\t\t\t\tdump_span(span);\n\t\t\t\tprintf(\"\\\"\\n\");\n\t\t\t}\n#endif\n\n\t\t\tp.x = last_line->first_span->max.x - last_line->first_span->min.x;\n\t\t\tp.y = last_line->first_span->max.y - last_line->first_span->min.y;\n\t\t\tfz_normalize_vector(&p);\n\t\t\tq.x = span->max.x - span->min.x;\n\t\t\tq.y = span->max.y - span->min.y;\n\t\t\tfz_normalize_vector(&q);\n#ifdef DEBUG_SPANS\n\t\t\tprintf(\"last_span=%g %g -> %g %g = %g %g\\n\", last_span->min.x, last_span->min.y, last_span->max.x, last_span->max.y, p.x, p.y);\n\t\t\tprintf(\"span     =%g %g -> %g %g = %g %g\\n\", span->min.x, span->min.y, span->max.x, span->max.y, q.x, q.y);\n#endif\n\t\t\tperp_r.y = last_line->first_span->min.x - span->min.x;\n\t\t\tperp_r.x = -(last_line->first_span->min.y - span->min.y);\n\t\t\t/* Check if p and q are parallel. If so, then this\n\t\t\t * line is parallel with the last one. */\n\t\t\tdot = p.x * q.x + p.y * q.y;\n\t\t\tif (fabsf(dot) > 0.9995)\n\t\t\t{\n\t\t\t\t/* If we take the dot product of normalised(p) and\n\t\t\t\t * perp(r), we get the perpendicular distance from\n\t\t\t\t * one line to the next (assuming they are parallel). */\n\t\t\t\tdistance = p.x * perp_r.x + p.y * perp_r.y;\n\t\t\t\t/* We allow 'small' distances of baseline changes\n\t\t\t\t * to cope with super/subscript. FIXME: We should\n\t\t\t\t * gather subscript/superscript information here. */\n\t\t\t\tnew_line = (fabsf(distance) > size * LINE_DIST);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tnew_line = 1;\n\t\t\t\tdistance = 0;\n\t\t\t}\n\t\t\tif (!new_line)\n\t\t\t{\n\t\t\t\tfz_point delta;\n\n\t\t\t\tdelta.x = span->min.x - last_span->max.x;\n\t\t\t\tdelta.y = span->min.y - last_span->max.y;\n\n\t\t\t\tspacing = (p.x * delta.x + p.y * delta.y);\n\t\t\t\tspacing = fabsf(spacing);\n\t\t\t\t/* Only allow changes in baseline (subscript/superscript etc)\n\t\t\t\t * when the spacing is small. */\n\t\t\t\tif (spacing * fabsf(distance) > size * LINE_DIST && fabsf(distance) > size * 0.1f)\n\t\t\t\t{\n\t\t\t\t\tnew_line = 1;\n\t\t\t\t\tdistance = 0;\n\t\t\t\t\tspacing = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tspacing /= size * SPACE_DIST;\n\t\t\t\t\t/* Apply the same logic here as when we're adding chars to build spans. */\n\t\t\t\t\tif (spacing >= 1 && spacing < (SPACE_MAX_DIST/SPACE_DIST))\n\t\t\t\t\t\tspacing = 1;\n\t\t\t\t}\n\t\t\t}\n#ifdef DEBUG_SPANS\n\t\t\tprintf(\"dot=%g new_line=%d distance=%g size=%g spacing=%g\\n\", dot, new_line, distance, size, spacing);\n#endif\n\t\t}\n\t\tspan->spacing = spacing;\n\t\tlast_line = push_span(ctx, tdev, span, new_line, distance);\n\t\tlast_span = span;\n\t}\n}\n\nfz_text_sheet *\nfz_new_text_sheet(fz_context *ctx)\n{\n\tfz_text_sheet *sheet = fz_malloc(ctx, sizeof *sheet);\n\tsheet->maxid = 0;\n\tsheet->style = NULL;\n\treturn sheet;\n}\n\nvoid\nfz_free_text_sheet(fz_context *ctx, fz_text_sheet *sheet)\n{\n\tfz_text_style *style;\n\n\tif (sheet == NULL)\n\t\treturn;\n\n\tstyle = sheet->style;\n\twhile (style)\n\t{\n\t\tfz_text_style *next = style->next;\n\t\tfz_drop_font(ctx, style->font);\n\t\tfz_free(ctx, style);\n\t\tstyle = next;\n\t}\n\tfz_free(ctx, sheet);\n}\n\nstatic fz_text_style *\nfz_lookup_text_style_imp(fz_context *ctx, fz_text_sheet *sheet,\n\tfloat size, fz_font *font, int wmode, int script)\n{\n\tfz_text_style *style;\n\n\tfor (style = sheet->style; style; style = style->next)\n\t{\n\t\tif (style->font == font &&\n\t\t\tstyle->size == size &&\n\t\t\tstyle->wmode == wmode &&\n\t\t\tstyle->script == script) /* FIXME: others */\n\t\t{\n\t\t\treturn style;\n\t\t}\n\t}\n\n\t/* Better make a new one and add it to our list */\n\tstyle = fz_malloc(ctx, sizeof *style);\n\tstyle->id = sheet->maxid++;\n\tstyle->font = fz_keep_font(ctx, font);\n\tstyle->size = size;\n\tstyle->wmode = wmode;\n\tstyle->script = script;\n\tstyle->next = sheet->style;\n\tsheet->style = style;\n\treturn style;\n}\n\nstatic fz_text_style *\nfz_lookup_text_style(fz_context *ctx, fz_text_sheet *sheet, fz_text *text, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha, fz_stroke_state *stroke)\n{\n\tfloat size = 1.0f;\n\tfz_font *font = text ? text->font : NULL;\n\tint wmode = text ? text->wmode : 0;\n\tif (ctm && text)\n\t{\n\t\tfz_matrix tm = text->trm;\n\t\tfz_matrix trm;\n\t\ttm.e = 0;\n\t\ttm.f = 0;\n\t\tfz_concat(&trm, &tm, ctm);\n\t\tsize = fz_matrix_expansion(&trm);\n\t}\n\treturn fz_lookup_text_style_imp(ctx, sheet, size, font, wmode, 0);\n}\n\nfz_text_page *\nfz_new_text_page(fz_context *ctx)\n{\n\tfz_text_page *page = fz_malloc(ctx, sizeof(*page));\n\tpage->mediabox = fz_empty_rect;\n\tpage->len = 0;\n\tpage->cap = 0;\n\tpage->blocks = NULL;\n\tpage->next = NULL;\n\treturn page;\n}\n\nstatic void\nfz_free_text_line_contents(fz_context *ctx, fz_text_line *line)\n{\n\tfz_text_span *span, *next;\n\tfor (span = line->first_span; span; span=next)\n\t{\n\t\tnext = span->next;\n\t\tfz_free(ctx, span->text);\n\t\tfz_free(ctx, span);\n\t}\n}\n\nstatic void\nfz_free_text_block(fz_context *ctx, fz_text_block *block)\n{\n\tfz_text_line *line;\n\tif (block == NULL)\n\t\treturn;\n\tfor (line = block->lines; line < block->lines + block->len; line++)\n\t\tfz_free_text_line_contents(ctx, line);\n\tfz_free(ctx, block->lines);\n\tfz_free(ctx, block);\n}\n\nstatic void\nfz_free_image_block(fz_context *ctx, fz_image_block *block)\n{\n\tif (block == NULL)\n\t\treturn;\n\tfz_drop_image(ctx, block->image);\n\tfz_drop_colorspace(ctx, block->cspace);\n\tfz_free(ctx, block);\n}\n\nvoid\nfz_free_text_page(fz_context *ctx, fz_text_page *page)\n{\n\tfz_page_block *block;\n\tif (page == NULL)\n\t\treturn;\n\tfor (block = page->blocks; block < page->blocks + page->len; block++)\n\t{\n\t\tswitch (block->type)\n\t\t{\n\t\tcase FZ_PAGE_BLOCK_TEXT:\n\t\t\tfz_free_text_block(ctx, block->u.text);\n\t\t\tbreak;\n\t\tcase FZ_PAGE_BLOCK_IMAGE:\n\t\t\tfz_free_image_block(ctx, block->u.image);\n\t\t\tbreak;\n\t\t}\n\t}\n\tfz_free(ctx, page->blocks);\n\tfz_free(ctx, page);\n}\n\nstatic fz_text_span *\nfz_new_text_span(fz_context *ctx, const fz_point *p, int wmode, const fz_matrix *trm)\n{\n\tfz_text_span *span = fz_malloc_struct(ctx, fz_text_span);\n\tspan->ascender_max = 0;\n\tspan->descender_min = 0;\n\tspan->cap = 0;\n\tspan->len = 0;\n\tspan->min = *p;\n\tspan->max = *p;\n\tspan->wmode = wmode;\n\tspan->transform.a = trm->a;\n\tspan->transform.b = trm->b;\n\tspan->transform.c = trm->c;\n\tspan->transform.d = trm->d;\n\tspan->transform.e = 0;\n\tspan->transform.f = 0;\n\tspan->text = NULL;\n\tspan->next = NULL;\n\treturn span;\n}\n\nstatic void\nadd_char_to_span(fz_context *ctx, fz_text_span *span, int c, fz_point *p, fz_point *max, fz_text_style *style)\n{\n\tif (span->len == span->cap)\n\t{\n\t\tint newcap = (span->cap ? span->cap * 2 : 16);\n\t\tspan->text = fz_resize_array(ctx, span->text, newcap, sizeof(fz_text_char));\n\t\tspan->cap = newcap;\n\t\tspan->bbox = fz_empty_rect;\n\t}\n\tspan->max = *max;\n\tif (style->ascender > span->ascender_max)\n\t\tspan->ascender_max = style->ascender;\n\tif (style->descender < span->descender_min)\n\t\tspan->descender_min = style->descender;\n\tspan->text[span->len].c = c;\n\tspan->text[span->len].p = *p;\n\tspan->text[span->len].style = style;\n\tspan->len++;\n}\n\n/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=2776 */\nstatic inline int is_character_composing(int c) { return 0x0300 <= c && c <= 0x036F; }\nstatic int is_character_ornate(int c);\n\nstatic void\nfz_add_text_char_imp(fz_context *ctx, fz_text_device *dev, fz_text_style *style, int c, fz_matrix *trm, float adv, int wmode)\n{\n\tint can_append = 1;\n\tint add_space = 0;\n\tfz_point dir, ndir, p, q;\n\tfloat size;\n\tfz_point delta;\n\tfloat spacing = 0;\n\tfloat base_offset = 0;\n\n\t/* SumatraPDF: TODO: make this depend on the per-glyph displacement vector */\n\tif (wmode == 0)\n\t{\n\t\tdir.x = 1;\n\t\tdir.y = 0;\n\t}\n\telse\n\t{\n\t\tdir.x = 0;\n\t\tdir.y = 1;\n\t}\n\tfz_transform_vector(&dir, trm);\n\tndir = dir;\n\tfz_normalize_vector(&ndir);\n\t/* dir = direction vector for motion. ndir = normalised(dir) */\n\n\tsize = fz_matrix_expansion(trm);\n\n\tif (dev->cur_span == NULL ||\n\t\ttrm->a != dev->cur_span->transform.a || trm->b != dev->cur_span->transform.b ||\n\t\ttrm->c != dev->cur_span->transform.c || trm->d != dev->cur_span->transform.d)\n\t{\n\t\t/* If the matrix has changed (or if we don't have a span at\n\t\t * all), then we can't append. */\n#ifdef DEBUG_SPANS\n\t\tprintf(\"Transform changed\\n\");\n#endif\n\t\tcan_append = 0;\n\t}\n\telse\n\t{\n\t\t/* Calculate how far we've moved since the end of the current\n\t\t * span. */\n\t\tdelta.x = trm->e - dev->cur_span->max.x;\n\t\tdelta.y = trm->f - dev->cur_span->max.y;\n\n\t\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=2486 */\n\t\tif (delta.x < 0 && delta.x > (dev->cur_span->text[dev->cur_span->len-1].p.x - dev->cur_span->max.x) * 0.85)\n\t\t\tdelta.x = 0;\n\t\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=2776 */\n\t\tif (-0.01 < delta.x && delta.x < 0.01 && (is_character_composing(c) || is_character_ornate(c)))\n\t\t\tdelta.y = 0;\n\n\t\t/* The transform has not changed, so we know we're in the same\n\t\t * direction. Calculate 2 distances; how far off the previous\n\t\t * baseline we are, together with how far along the baseline\n\t\t * we are from the expected position. */\n\t\tspacing = ndir.x * delta.x + ndir.y * delta.y;\n\t\tbase_offset = -ndir.y * delta.x + ndir.x * delta.y;\n\n\t\tspacing /= size * SPACE_DIST;\n\t\tspacing = fabsf(spacing);\n\t\tif (fabsf(base_offset) < size * 0.1)\n\t\t{\n\t\t\t/* Only a small amount off the baseline - we'll take this */\n\t\t\tif (spacing < 1.0)\n\t\t\t{\n\t\t\t\t/* Motion is in line, and small. */\n\t\t\t}\n\t\t\telse if (spacing >= 1 && spacing < (SPACE_MAX_DIST/SPACE_DIST))\n\t\t\t{\n\t\t\t\t/* Motion is in line, but large enough\n\t\t\t\t * to warrant us adding a space */\n\t\t\t\tif (dev->lastchar != ' ' && wmode == 0)\n\t\t\t\t\tadd_space = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/* Motion is in line, but too large - split to a new span */\n\t\t\t\tcan_append = 0;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcan_append = 0;\n#ifdef DEBUG_SPANS\n\t\t\tspacing = 0;\n#endif\n\t\t}\n\t}\n\n#ifdef DEBUG_SPANS\n\tprintf(\"%c%c append=%d space=%d size=%g spacing=%g base_offset=%g\\n\", dev->lastchar, c, can_append, add_space, size, spacing, base_offset);\n#endif\n\n\tp.x = trm->e;\n\tp.y = trm->f;\n\tif (can_append == 0)\n\t{\n\t\t/* Start a new span */\n\t\tadd_span_to_soup(dev->spans, dev->cur_span);\n\t\tdev->cur_span = NULL;\n\t\tdev->cur_span = fz_new_text_span(ctx, &p, wmode, trm);\n\t\tdev->cur_span->spacing = 0;\n\t}\n\t/* SumatraPDF: don't add spaces before spaces */\n\tif (add_space && c != 32)\n\t{\n\t\tq.x = - 0.2f;\n\t\tq.y = 0;\n\t\tfz_transform_point(&q, trm);\n\t\tadd_char_to_span(ctx, dev->cur_span, ' ', &p, &q, style);\n\t}\n\t/* Advance the matrix */\n\tq.x = trm->e += adv * dir.x;\n\tq.y = trm->f += adv * dir.y;\n\tadd_char_to_span(ctx, dev->cur_span, c, &p, &q, style);\n}\n\nstatic void\nfz_add_text_char(fz_context *ctx, fz_text_device *dev, fz_text_style *style, int c, fz_matrix *trm, float adv, int wmode)\n{\n\tswitch (c)\n\t{\n\tcase -1: /* ignore when one unicode character maps to multiple glyphs */\n\t\tbreak;\n\tcase 0xFB00: /* ff */\n\t\tfz_add_text_char_imp(ctx, dev, style, 'f', trm, adv/2, wmode);\n\t\tfz_add_text_char_imp(ctx, dev, style, 'f', trm, adv/2, wmode);\n\t\tbreak;\n\tcase 0xFB01: /* fi */\n\t\tfz_add_text_char_imp(ctx, dev, style, 'f', trm, adv/2, wmode);\n\t\tfz_add_text_char_imp(ctx, dev, style, 'i', trm, adv/2, wmode);\n\t\tbreak;\n\tcase 0xFB02: /* fl */\n\t\tfz_add_text_char_imp(ctx, dev, style, 'f', trm, adv/2, wmode);\n\t\tfz_add_text_char_imp(ctx, dev, style, 'l', trm, adv/2, wmode);\n\t\tbreak;\n\tcase 0xFB03: /* ffi */\n\t\tfz_add_text_char_imp(ctx, dev, style, 'f', trm, adv/3, wmode);\n\t\tfz_add_text_char_imp(ctx, dev, style, 'f', trm, adv/3, wmode);\n\t\tfz_add_text_char_imp(ctx, dev, style, 'i', trm, adv/3, wmode);\n\t\tbreak;\n\tcase 0xFB04: /* ffl */\n\t\tfz_add_text_char_imp(ctx, dev, style, 'f', trm, adv/3, wmode);\n\t\tfz_add_text_char_imp(ctx, dev, style, 'f', trm, adv/3, wmode);\n\t\tfz_add_text_char_imp(ctx, dev, style, 'l', trm, adv/3, wmode);\n\t\tbreak;\n\tcase 0xFB05: /* long st */\n\tcase 0xFB06: /* st */\n\t\tfz_add_text_char_imp(ctx, dev, style, 's', trm, adv/2, wmode);\n\t\tfz_add_text_char_imp(ctx, dev, style, 't', trm, adv/2, wmode);\n\t\tbreak;\n\tdefault:\n\t\tfz_add_text_char_imp(ctx, dev, style, c, trm, adv, wmode);\n\t\tbreak;\n\t}\n}\n\nstatic void\nfz_text_extract(fz_context *ctx, fz_text_device *dev, fz_text *text, const fz_matrix *ctm, fz_text_style *style)\n{\n\tfz_font *font = text->font;\n\tFT_Face face = font->ft_face;\n\tfz_matrix tm = text->trm;\n\tfz_matrix trm;\n\tfloat adv = -1;\n\tfloat ascender = 1;\n\tfloat descender = 0;\n\tint multi;\n\tint i, j, err;\n\n\tif (text->len == 0)\n\t\treturn;\n\n\tif (font->ft_face)\n\t{\n\t\tfz_lock(ctx, FZ_LOCK_FREETYPE);\n\t\terr = FT_Set_Char_Size(font->ft_face, 64, 64, 72, 72);\n\t\tif (err)\n\t\t\tfz_warn(ctx, \"freetype set character size: %s\", ft_error_string(err));\n\t\tascender = (float)face->ascender / face->units_per_EM;\n\t\tdescender = (float)face->descender / face->units_per_EM;\n\t\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\t}\n\telse if (font->t3procs && !fz_is_empty_rect(&font->bbox))\n\t{\n\t\tascender = font->bbox.y1;\n\t\tdescender = font->bbox.y0;\n\t}\n\tstyle->ascender = ascender;\n\tstyle->descender = descender;\n\n\ttm.e = 0;\n\ttm.f = 0;\n\tfz_concat(&trm, &tm, ctm);\n\n\tfor (i = 0; i < text->len; i++)\n\t{\n\t\t/* Calculate new pen location and delta */\n\t\ttm.e = text->items[i].x;\n\t\ttm.f = text->items[i].y;\n\t\tfz_concat(&trm, &tm, ctm);\n\n\t\t/* Calculate bounding box and new pen position based on font metrics */\n\t\tif (font->ft_face)\n\t\t{\n\t\t\tFT_Fixed ftadv = 0;\n\t\t\tint mask = FT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING | FT_LOAD_IGNORE_TRANSFORM;\n\n\t\t\t/* TODO: freetype returns broken vertical metrics */\n\t\t\t/* if (text->wmode) mask |= FT_LOAD_VERTICAL_LAYOUT; */\n\n\t\t\tfz_lock(ctx, FZ_LOCK_FREETYPE);\n\t\t\terr = FT_Set_Char_Size(font->ft_face, 64, 64, 72, 72);\n\t\t\tif (err)\n\t\t\t\tfz_warn(ctx, \"freetype set character size: %s\", ft_error_string(err));\n\t\t\tFT_Get_Advance(font->ft_face, text->items[i].gid, mask, &ftadv);\n\t\t\tadv = ftadv / 65536.0f;\n\t\t\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\t\t}\n\t\t/* SumatraPDF: TODO: this check might no longer be needed */\n\t\telse if (text->items[i].gid < 256)\n\t\t{\n\t\t\tadv = font->t3widths[text->items[i].gid];\n\t\t}\n\n\t\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=1839 */\n\t\tif (font->ft_face)\n\t\t{\n\t\t\tfz_rect bbox;\n\t\t\tfz_bound_glyph(ctx, font, text->items[i].gid, &fz_identity, &bbox);\n\t\t\tstyle->ascender = fz_max(style->ascender, bbox.y1);\n\t\t\tstyle->descender = fz_min(style->descender, bbox.y0);\n\t\t}\n\n\t\t/* Check for one glyph to many char mapping */\n\t\tfor (j = i + 1; j < text->len; j++)\n\t\t\tif (text->items[j].gid >= 0)\n\t\t\t\tbreak;\n\t\tmulti = j - i;\n\n\t\tif (multi == 1)\n\t\t{\n\t\t\tfz_add_text_char(ctx, dev, style, text->items[i].ucs, &trm, adv, text->wmode);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor (j = 0; j < multi; j++)\n\t\t\t{\n\t\t\t\tfz_add_text_char(ctx, dev, style, text->items[i + j].ucs, &trm, adv/multi, text->wmode);\n\t\t\t}\n\t\t\ti += j - 1;\n\t\t}\n\n\t\tdev->lastchar = text->items[i].ucs;\n\t}\n}\n\n/***** SumatraPDF: various string fixups *****/\n\nstatic void\ndelete_character(fz_text_span *span, int i)\n{\n\tmemmove(&span->text[i], &span->text[i + 1], (span->len - (i + 1)) * sizeof(fz_text_char));\n\tspan->len--;\n}\n\nstatic void\ninsert_character(fz_context *ctx, fz_text_span *span, fz_text_char *c, int i)\n{\n\tadd_char_to_span(ctx, span, span->text[span->len - 1].c, &span->text[span->len - 1].p, &span->max, span->text[span->len - 1].style);\n\tmemmove(&span->text[i + 1], &span->text[i], (span->len - (i - 1)) * sizeof(fz_text_char));\n\tspan->text[i] = *c;\n}\n\nstatic void\nreverse_characters(fz_text_span *span, int i, int j)\n{\n\twhile (i < j)\n\t{\n\t\tfz_text_char tc = span->text[i];\n\t\tspan->text[i] = span->text[j];\n\t\tspan->text[j] = tc;\n\t\ti++; j--;\n\t}\n}\n\nstatic int\nis_character_ornate(int c)\n{\n\tswitch (c)\n\t{\n\tcase 0x00A8: /* diaeresis/umlaut */\n\tcase 0x00B4: /* accute accent */\n\tcase 0x0060: /* grave accent */\n\tcase 0x005E: case 0x02C6: /* circumflex accent */\n\tcase 0x02DA: /* ring above */\n\t\treturn 1;\n\tdefault:\n\t\treturn 0;\n\t}\n}\n\nstatic int\nornate_character(fz_text_span *span, int ornate, int character)\n{\n\tstatic wchar_t *ornates[] = {\n\t\tL\" \\xA8\\xB4\\x60\\x5E\\u02C6\\u02DA\",\n\t\tL\"a\\xE4\\xE1\\xE0\\xE2\\xE2\\xE5\", L\"A\\xC4\\xC1\\xC0\\xC2\\xC2\\0\",\n\t\tL\"e\\xEB\\xE9\\xE8\\xEA\\xEA\\0\", L\"E\\xCB\\xC9\\xC8\\xCA\\xCA\\0\",\n\t\tL\"i\\xEF\\xED\\xEC\\xEE\\xEE\\0\", L\"I\\xCF\\xCD\\xCC\\xCE\\xCE\\0\",\n\t\tL\"\\u0131\\xEF\\xED\\xEC\\xEE\\xEE\\0\", L\"\\u0130\\xCF\\xCD\\xCC\\xCE\\xCE\\0\",\n\t\tL\"o\\xF6\\xF3\\xF2\\xF4\\xF4\\0\", L\"O\\xD6\\xD3\\xD2\\xD4\\xD4\\0\",\n\t\tL\"u\\xFC\\xFA\\xF9\\xFB\\xFB\\0\", L\"U\\xDC\\xDA\\xD9\\xDB\\xDB\\0\",\n\t\tNULL\n\t};\n\tint i = 1, j = 1;\n\tfz_rect bbox1, bbox2;\n\tfz_text_char_bbox(&bbox1, span, ornate);\n\tif ((bbox1.x0 + bbox1.x1) / 2 < fz_text_char_bbox(&bbox2, span, character)->x0)\n\t\treturn 0;\n\twhile (ornates[0][i] && ornates[0][i] != (wchar_t)span->text[ornate].c)\n\t\ti++;\n\twhile (ornates[j] && ornates[j][0] != (wchar_t)span->text[character].c)\n\t\tj++;\n\tif (!ornates[0][i] || !ornates[j])\n\t\treturn 0;\n\treturn ornates[j][i];\n}\n\n/* TODO: Complete these lists... */\n#define ISLEFTTORIGHTCHAR(c) ((0x0041 <= (c) && (c) <= 0x005A) || (0x0061 <= (c) && (c) <= 0x007A) || (0xFB00 <= (c) && (c) <= 0xFB06))\n#define ISRIGHTTOLEFTCHAR(c) ((0x0590 <= (c) && (c) <= 0x05FF) || (0x0600 <= (c) && (c) <= 0x06FF) || (0x0750 <= (c) && (c) <= 0x077F) || (0xFB50 <= (c) && (c) <= 0xFDFF) || (0xFE70 <= (c) && (c) <= 0xFEFF))\n\nstatic void\nfixup_text_span(fz_text_span *span)\n{\n\tint i;\n\tfor (i = 0; i < span->len; i++)\n\t{\n\t\tif (is_character_ornate(span->text[i].c) && i + 1 < span->len)\n\t\t{\n\t\t\t/* recombine characters and their accents */\n\t\t\tint newC = 0;\n\t\t\tif (span->text[i + 1].c != 32 || i + 2 == span->len)\n\t\t\t\tnewC = ornate_character(span, i, i + 1);\n\t\t\telse if ((newC = ornate_character(span, i, i + 2)) != 0)\n\t\t\t\tdelete_character(span, i + 1);\n\t\t\tif (newC)\n\t\t\t{\n\t\t\t\tdelete_character(span, i);\n\t\t\t\tspan->text[i].c = newC;\n\t\t\t}\n\t\t}\n\t\telse if (ISRIGHTTOLEFTCHAR(span->text[i].c))\n\t\t{\n\t\t\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=733 */\n\t\t\t/* reverse words written in RTL languages */\n\t\t\tfz_rect a, b;\n\t\t\tint j = i + 1;\n\t\t\twhile (j < span->len && fz_text_char_bbox(&a, span, j - 1)->x0 <= fz_text_char_bbox(&b, span, j)->x0 && !ISLEFTTORIGHTCHAR(span->text[i].c))\n\t\t\t\tj++;\n\t\t\treverse_characters(span, i, j - 1);\n\t\t\ti = j;\n\t\t}\n\t}\n}\n\nstatic float\ncalc_bbox_overlap(fz_text_span *span, int i, fz_text_span *span2, int j)\n{\n\tfloat area1, area2, area3;\n\tfz_rect bbox1, bbox2, intersect;\n\n\tintersect = *fz_text_char_bbox(&bbox1, span, i);\n\tfz_intersect_rect(&intersect, fz_text_char_bbox(&bbox2, span2, j));\n\tif (fz_is_empty_rect(&intersect))\n\t\treturn 0;\n\n\tarea1 = (bbox1.x1 - bbox1.x0) * (bbox1.y1 - bbox1.y0);\n\tarea2 = (bbox2.x1 - bbox2.x0) * (bbox2.y1 - bbox2.y0);\n\tarea3 = (intersect.x1 - intersect.x0) * (intersect.y1 - intersect.y0);\n\n\treturn area3 / fz_max(area1, area2);\n}\n\nstatic inline int\nis_same_c(fz_text_span *span, int i, fz_text_span *span2, int j)\n{\n\treturn i < span->len && j < span2->len && span->text[i].c == span2->text[j].c;\n}\n\nstatic int\ndo_glyphs_overlap(fz_text_span *span, int i, fz_text_span *span2, int j, int start)\n{\n\treturn\n\t\tis_same_c(span, i, span2, j) &&\n\t\t// calc_bbox_overlap is too imprecise for small glyphs\n\t\t(!start || span->text[i].style->size >= 5 && span2->text[j].style->size >= 5) &&\n\t\t(calc_bbox_overlap(span, i, span2, j) >\n\t\t // if only a single glyph overlaps, require slightly more overlapping\n\t\t (start && !is_same_c(span, i + 1, span2, j + 1) ? 0.8f : 0.7f) ||\n\t\t // bboxes of slim glyphs sometimes don't overlap enough, so\n\t\t // check if the overlapping continues with the following two glyphs\n\t\t is_same_c(span, i + 1, span2, j + 1) &&\n\t\t (calc_bbox_overlap(span, i + 1, span2, j + 1) > 0.7f ||\n\t\t  is_same_c(span, i + 2, span2, j + 2) &&\n\t\t  calc_bbox_overlap(span, i + 2, span2, j + 2) > 0.7f));\n}\n\nstatic void\nmerge_lines(fz_context *ctx, fz_text_block *block, fz_text_line *line)\n{\n\tif (line == block->lines + block->len - 1)\n\t\treturn;\n\twhile ((line + 1)->first_span)\n\t{\n\t\tfz_union_rect(&line->bbox, &(line + 1)->first_span->bbox);\n\t\tline->last_span = line->last_span->next = (line + 1)->first_span;\n\t\t(line + 1)->first_span = (line + 1)->first_span->next;\n\t}\n\tmemmove(line + 1, line + 2, (block->lines + block->len - (line + 2)) * sizeof(fz_text_line));\n\tblock->len--;\n}\n\nstatic void\nfixup_text_block(fz_context *ctx, fz_text_block *block)\n{\n\tfz_text_line *line;\n\tfz_text_span *span;\n\tint i;\n\n\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=734 */\n\t/* remove duplicate character sequences in (almost) the same spot */\n\tfor (line = block->lines; line < block->lines + block->len; line++)\n\t{\n\t\tfor (span = line->first_span; span; span = span->next)\n\t\t{\n\t\t\tfor (i = 0; i < span->len && i < 512; i++)\n\t\t\t{\n\t\t\t\tfz_text_line *line2 = line;\n\t\t\t\tfz_text_span *span2 = span;\n\t\t\t\tint j = i + 1;\n\t\t\t\tfor (;;)\n\t\t\t\t{\n\t\t\t\t\tif (!span2)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (line2 + 1 == block->lines + block->len || line2 != line || !(line2 + 1)->first_span)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tline2++;\n\t\t\t\t\t\tspan2 = line2->first_span;\n\t\t\t\t\t}\n\t\t\t\t\tfor (; j < span2->len && j < 512; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tint c = span->text[i].c;\n\t\t\t\t\t\tif (c != 32 && c == span2->text[j].c && do_glyphs_overlap(span, i, span2, j, 1))\n\t\t\t\t\t\t\tgoto fixup_delete_duplicates;\n\t\t\t\t\t}\n\t\t\t\t\tspan2 = span2->next;\n\t\t\t\t\tj = 0;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\nfixup_delete_duplicates:\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tdelete_character(span, i);\n\t\t\t\t\tif (span != span2)\n\t\t\t\t\t\tj++;\n\t\t\t\t} while (do_glyphs_overlap(span, i, span2, j, 0));\n\n\t\t\t\tif (i < span->len && span->text[i].c == 32)\n\t\t\t\t\tdelete_character(span, i);\n\t\t\t\telse if (i == span->len && !span->next)\n\t\t\t\t\tmerge_lines(ctx, block, line);\n\t\t\t}\n\t\t}\n\t}\n}\n\nstatic void\nfixup_text_page(fz_context *ctx, fz_text_page *page)\n{\n\tfz_page_block *block;\n\tfz_text_line *line;\n\tfz_text_span *span;\n\n\tfor (block = page->blocks; block < page->blocks + page->len; block++)\n\t{\n\t\tif (block->type != FZ_PAGE_BLOCK_TEXT)\n\t\t\tcontinue;\n\t\tfor (line = block->u.text->lines; line < block->u.text->lines + block->u.text->len; line++)\n\t\t{\n\t\t\tfor (span = line->first_span; span; span = span->next)\n\t\t\t\tfixup_text_span(span);\n\t\t}\n\t\tfixup_text_block(ctx, block->u.text);\n\t}\n}\n\n/***** various string fixups *****/\n\nstatic void\nfz_text_fill_text(fz_device *dev, fz_text *text, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tfz_text_device *tdev = dev->user;\n\tfz_text_style *style;\n\tstyle = fz_lookup_text_style(dev->ctx, tdev->sheet, text, ctm, colorspace, color, alpha, NULL);\n\tfz_text_extract(dev->ctx, tdev, text, ctm, style);\n}\n\nstatic void\nfz_text_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tfz_text_device *tdev = dev->user;\n\tfz_text_style *style;\n\tstyle = fz_lookup_text_style(dev->ctx, tdev->sheet, text, ctm, colorspace, color, alpha, stroke);\n\tfz_text_extract(dev->ctx, tdev, text, ctm, style);\n}\n\nstatic void\nfz_text_clip_text(fz_device *dev, fz_text *text, const fz_matrix *ctm, int accumulate)\n{\n\tfz_text_device *tdev = dev->user;\n\tfz_text_style *style;\n\tstyle = fz_lookup_text_style(dev->ctx, tdev->sheet, text, ctm, NULL, NULL, 0, NULL);\n\tfz_text_extract(dev->ctx, tdev, text, ctm, style);\n}\n\nstatic void\nfz_text_clip_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, const fz_matrix *ctm)\n{\n\tfz_text_device *tdev = dev->user;\n\tfz_text_style *style;\n\tstyle = fz_lookup_text_style(dev->ctx, tdev->sheet, text, ctm, NULL, NULL, 0, stroke);\n\tfz_text_extract(dev->ctx, tdev, text, ctm, style);\n}\n\nstatic void\nfz_text_ignore_text(fz_device *dev, fz_text *text, const fz_matrix *ctm)\n{\n\tfz_text_device *tdev = dev->user;\n\tfz_text_style *style;\n\tstyle = fz_lookup_text_style(dev->ctx, tdev->sheet, text, ctm, NULL, NULL, 0, NULL);\n\tfz_text_extract(dev->ctx, tdev, text, ctm, style);\n}\n\nstatic void\nfz_text_fill_image_mask(fz_device *dev, fz_image *img, const fz_matrix *ctm,\n\t\tfz_colorspace *cspace, float *color, float alpha)\n{\n\t/* SumatraPDF: fixup_text_page doesn't handle multiple blocks yet */\n#if 0\n\n\tfz_text_device *tdev = dev->user;\n\tfz_text_page *page = tdev->page;\n\tfz_image_block *block;\n\tfz_context *ctx = dev->ctx;\n\n\t/* If the alpha is less than 50% then it's probably a watermark or\n\t * effect or something. Skip it */\n\tif (alpha < 0.5)\n\t\treturn;\n\n\t/* New block */\n\tif (page->len == page->cap)\n\t{\n\t\tint newcap = (page->cap ? page->cap*2 : 4);\n\t\tpage->blocks = fz_resize_array(ctx, page->blocks, newcap, sizeof(*page->blocks));\n\t\tpage->cap = newcap;\n\t}\n\tblock = fz_malloc_struct(ctx, fz_image_block);\n\tpage->blocks[page->len].type = FZ_PAGE_BLOCK_IMAGE;\n\tpage->blocks[page->len].u.image = block;\n\tblock->image = fz_keep_image(ctx, img);\n\tblock->cspace = fz_keep_colorspace(ctx, cspace);\n\tif (cspace)\n\t\tmemcpy(block->colors, color, sizeof(block->colors[0])*cspace->n);\n\tpage->len++;\n\n#endif\n}\n\nstatic void\nfz_text_fill_image(fz_device *dev, fz_image *img, const fz_matrix *ctm, float alpha)\n{\n\tfz_text_fill_image_mask(dev, img, ctm, NULL, NULL, alpha);\n}\n\nstatic int\nfz_bidi_direction(int bidiclass, int curdir)\n{\n\tswitch (bidiclass)\n\t{\n\t/* strong */\n\tcase UCDN_BIDI_CLASS_L: return 1;\n\tcase UCDN_BIDI_CLASS_R: return -1;\n\tcase UCDN_BIDI_CLASS_AL: return -1;\n\n\t/* weak */\n\tcase UCDN_BIDI_CLASS_EN:\n\tcase UCDN_BIDI_CLASS_ES:\n\tcase UCDN_BIDI_CLASS_ET:\n\tcase UCDN_BIDI_CLASS_AN:\n\tcase UCDN_BIDI_CLASS_CS:\n\tcase UCDN_BIDI_CLASS_NSM:\n\tcase UCDN_BIDI_CLASS_BN:\n\t\treturn curdir;\n\n\t/* neutral */\n\tcase UCDN_BIDI_CLASS_B:\n\tcase UCDN_BIDI_CLASS_S:\n\tcase UCDN_BIDI_CLASS_WS:\n\tcase UCDN_BIDI_CLASS_ON:\n\t\treturn curdir;\n\n\t/* embedding, override, pop ... we don't support them */\n\tdefault:\n\t\treturn 0;\n\t}\n}\n\nstatic void\nfz_bidi_reorder_run(fz_text_span *span, int a, int b, int dir)\n{\n\tif (a < b && dir == -1)\n\t{\n\t\tfz_text_char c;\n\t\tint m = a + (b - a) / 2;\n\t\twhile (a < m)\n\t\t{\n\t\t\tb--;\n\t\t\tc = span->text[a];\n\t\t\tspan->text[a] = span->text[b];\n\t\t\tspan->text[b] = c;\n\t\t\ta++;\n\t\t}\n\t}\n}\n\nstatic void\nfz_bidi_reorder_span(fz_text_span *span)\n{\n\tint a, b, dir, curdir;\n\n\ta = 0;\n\tcurdir = 1;\n\tfor (b = 0; b < span->len; b++)\n\t{\n\t\tdir = fz_bidi_direction(ucdn_get_bidi_class(span->text[b].c), curdir);\n\t\tif (dir != curdir)\n\t\t{\n\t\t\tfz_bidi_reorder_run(span, a, b, curdir);\n\t\t\tcurdir = dir;\n\t\t\ta = b;\n\t\t}\n\t}\n\tfz_bidi_reorder_run(span, a, b, curdir);\n}\n\nstatic void\nfz_bidi_reorder_text_page(fz_context *ctx, fz_text_page *page)\n{\n\tfz_page_block *pageblock;\n\tfz_text_block *block;\n\tfz_text_line *line;\n\tfz_text_span *span;\n\n\tfor (pageblock = page->blocks; pageblock < page->blocks + page->len; pageblock++)\n\t\tif (pageblock->type == FZ_PAGE_BLOCK_TEXT)\n\t\t\tfor (block = pageblock->u.text, line = block->lines; line < block->lines + block->len; line++)\n\t\t\t\tfor (span = line->first_span; span; span = span->next)\n\t\t\t\t\tfz_bidi_reorder_span(span);\n}\n\nstatic void\nfz_text_begin_page(fz_device *dev, const fz_rect *mediabox, const fz_matrix *ctm)\n{\n\tfz_context *ctx = dev->ctx;\n\tfz_text_device *tdev = dev->user;\n\n\tif (tdev->page->len)\n\t{\n\t\ttdev->page->next = fz_new_text_page(ctx);\n\t\ttdev->page = tdev->page->next;\n\t}\n\n\ttdev->page->mediabox = *mediabox;\n\tfz_transform_rect(&tdev->page->mediabox, ctm);\n\n\ttdev->spans = new_span_soup(ctx);\n}\n\nstatic void\nfz_text_end_page(fz_device *dev)\n{\n\tfz_context *ctx = dev->ctx;\n\tfz_text_device *tdev = dev->user;\n\n\tadd_span_to_soup(tdev->spans, tdev->cur_span);\n\ttdev->cur_span = NULL;\n\n\tstrain_soup(ctx, tdev);\n\tfree_span_soup(tdev->spans);\n\ttdev->spans = NULL;\n\n\t/* TODO: smart sorting of blocks in reading order */\n\t/* TODO: unicode NFC normalization */\n\n\tfz_bidi_reorder_text_page(ctx, tdev->page);\n\n\t/* SumatraPDF: various string fixups */\n\tfixup_text_page(dev->ctx, tdev->page);\n}\n\nstatic void\nfz_text_free_user(fz_device *dev)\n{\n\tfz_text_device *tdev = dev->user;\n\tfree_span_soup(tdev->spans);\n\tfz_free(dev->ctx, tdev);\n}\n\nfz_device *\nfz_new_text_device(fz_context *ctx, fz_text_sheet *sheet, fz_text_page *page)\n{\n\tfz_device *dev;\n\n\tfz_text_device *tdev = fz_malloc_struct(ctx, fz_text_device);\n\ttdev->sheet = sheet;\n\ttdev->page = page;\n\ttdev->spans = NULL;\n\ttdev->cur_span = NULL;\n\ttdev->lastchar = ' ';\n\n\tdev = fz_new_device(ctx, tdev);\n\tdev->hints = FZ_IGNORE_IMAGE | FZ_IGNORE_SHADE;\n\tdev->begin_page = fz_text_begin_page;\n\tdev->end_page = fz_text_end_page;\n\tdev->free_user = fz_text_free_user;\n\tdev->fill_text = fz_text_fill_text;\n\tdev->stroke_text = fz_text_stroke_text;\n\tdev->clip_text = fz_text_clip_text;\n\tdev->clip_stroke_text = fz_text_clip_stroke_text;\n\tdev->ignore_text = fz_text_ignore_text;\n\tdev->fill_image = fz_text_fill_image;\n\tdev->fill_image_mask = fz_text_fill_image_mask;\n\n\treturn dev;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/stext-output.c",
    "content": "#include \"mupdf/fitz.h\"\n\n#define SUBSCRIPT_OFFSET 0.2f\n#define SUPERSCRIPT_OFFSET -0.2f\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n/* XML, HTML and plain-text output */\n\nstatic int font_is_bold(fz_font *font)\n{\n\tFT_Face face = font->ft_face;\n\tif (face && (face->style_flags & FT_STYLE_FLAG_BOLD))\n\t\treturn 1;\n\tif (strstr(font->name, \"Bold\"))\n\t\treturn 1;\n\treturn 0;\n}\n\nstatic int font_is_italic(fz_font *font)\n{\n\tFT_Face face = font->ft_face;\n\tif (face && (face->style_flags & FT_STYLE_FLAG_ITALIC))\n\t\treturn 1;\n\tif (strstr(font->name, \"Italic\") || strstr(font->name, \"Oblique\"))\n\t\treturn 1;\n\treturn 0;\n}\n\nstatic void\nfz_print_style_begin(fz_output *out, fz_text_style *style)\n{\n\tint script = style->script;\n\tfz_printf(out, \"<span class=\\\"s%d\\\">\", style->id);\n\twhile (script-- > 0)\n\t\tfz_printf(out, \"<sup>\");\n\twhile (++script < 0)\n\t\tfz_printf(out, \"<sub>\");\n}\n\nstatic void\nfz_print_style_end(fz_output *out, fz_text_style *style)\n{\n\tint script = style->script;\n\twhile (script-- > 0)\n\t\tfz_printf(out, \"</sup>\");\n\twhile (++script < 0)\n\t\tfz_printf(out, \"</sub>\");\n\tfz_printf(out, \"</span>\");\n}\n\nstatic void\nfz_print_style(fz_output *out, fz_text_style *style)\n{\n\tchar *s = strchr(style->font->name, '+');\n\ts = s ? s + 1 : style->font->name;\n\tfz_printf(out, \"span.s%d{font-family:\\\"%s\\\";font-size:%gpt;\",\n\t\tstyle->id, s, style->size);\n\tif (font_is_italic(style->font))\n\t\tfz_printf(out, \"font-style:italic;\");\n\tif (font_is_bold(style->font))\n\t\tfz_printf(out, \"font-weight:bold;\");\n\tfz_printf(out, \"}\\n\");\n}\n\nvoid\nfz_print_text_sheet(fz_context *ctx, fz_output *out, fz_text_sheet *sheet)\n{\n\tfz_text_style *style;\n\tfor (style = sheet->style; style; style = style->next)\n\t\tfz_print_style(out, style);\n}\n\nstatic void\nsend_data_base64(fz_output *out, fz_buffer *buffer)\n{\n\tint i, len;\n\tstatic const char set[] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n\tlen = buffer->len/3;\n\tfor (i = 0; i < len; i++)\n\t{\n\t\tint c = buffer->data[3*i];\n\t\tint d = buffer->data[3*i+1];\n\t\tint e = buffer->data[3*i+2];\n\t\tif ((i & 15) == 0)\n\t\t\tfz_printf(out, \"\\n\");\n\t\tfz_printf(out, \"%c%c%c%c\", set[c>>2], set[((c&3)<<4)|(d>>4)], set[((d&15)<<2)|(e>>6)], set[e & 63]);\n\t}\n\ti *= 3;\n\tswitch (buffer->len-i)\n\t{\n\t\tcase 2:\n\t\t{\n\t\t\tint c = buffer->data[i];\n\t\t\tint d = buffer->data[i+1];\n\t\t\tfz_printf(out, \"%c%c%c=\", set[c>>2], set[((c&3)<<4)|(d>>4)], set[((d&15)<<2)]);\n\t\t\tbreak;\n\t\t}\n\tcase 1:\n\t\t{\n\t\t\tint c = buffer->data[i];\n\t\t\tfz_printf(out, \"%c%c==\", set[c>>2], set[(c&3)<<4]);\n\t\t\tbreak;\n\t\t}\n\tdefault:\n\tcase 0:\n\t\tbreak;\n\t}\n}\n\nvoid\nfz_print_text_page_html(fz_context *ctx, fz_output *out, fz_text_page *page)\n{\n\tint block_n, line_n, ch_n;\n\tfz_text_style *style = NULL;\n\tfz_text_line *line;\n\tfz_text_span *span;\n\tvoid *last_region = NULL;\n\n\tfz_printf(out, \"<div class=\\\"page\\\">\\n\");\n\n\tfor (block_n = 0; block_n < page->len; block_n++)\n\t{\n\t\tswitch (page->blocks[block_n].type)\n\t\t{\n\t\tcase FZ_PAGE_BLOCK_TEXT:\n\t\t{\n\t\t\tfz_text_block * block = page->blocks[block_n].u.text;\n\t\t\tfz_printf(out, \"<div class=\\\"block\\\"><p>\\n\");\n\t\t\tfor (line_n = 0; line_n < block->len; line_n++)\n\t\t\t{\n\t\t\t\tint lastcol=-1;\n\t\t\t\tline = &block->lines[line_n];\n\t\t\t\tstyle = NULL;\n\n\t\t\t\tif (line->region != last_region)\n\t\t\t\t{\n\t\t\t\t\tif (last_region)\n\t\t\t\t\t\tfz_printf(out, \"</div>\");\n\t\t\t\t\tfz_printf(out, \"<div class=\\\"metaline\\\">\");\n\t\t\t\t\tlast_region = line->region;\n\t\t\t\t}\n\t\t\t\tfz_printf(out, \"<div class=\\\"line\\\"\");\n#ifdef DEBUG_INTERNALS\n\t\t\t\tif (line->region)\n\t\t\t\t\tfz_printf(out, \" region=\\\"%x\\\"\", line->region);\n#endif\n\t\t\t\tfz_printf(out, \">\");\n\t\t\t\tfor (span = line->first_span; span; span = span->next)\n\t\t\t\t{\n\t\t\t\t\tfloat size = fz_matrix_expansion(&span->transform);\n\t\t\t\t\tfloat base_offset = span->base_offset / size;\n\n\t\t\t\t\tif (lastcol != span->column)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (lastcol >= 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfz_printf(out, \"</div>\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/* If we skipped any columns then output some spacer spans */\n\t\t\t\t\t\twhile (lastcol < span->column-1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfz_printf(out, \"<div class=\\\"cell\\\"></div>\");\n\t\t\t\t\t\t\tlastcol++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlastcol++;\n\t\t\t\t\t\t/* Now output the span to contain this entire column */\n\t\t\t\t\t\tfz_printf(out, \"<div class=\\\"cell\\\" style=\\\"\");\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfz_text_span *sn;\n\t\t\t\t\t\t\tfor (sn = span->next; sn; sn = sn->next)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (sn->column != lastcol)\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfz_printf(out, \"width:%g%%;align:%s\", span->column_width, (span->align == 0 ? \"left\" : (span->align == 1 ? \"center\" : \"right\")));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (span->indent > 1)\n\t\t\t\t\t\t\tfz_printf(out, \";padding-left:1em;text-indent:-1em\");\n\t\t\t\t\t\tif (span->indent < -1)\n\t\t\t\t\t\t\tfz_printf(out, \";text-indent:1em\");\n\t\t\t\t\t\tfz_printf(out, \"\\\">\");\n\t\t\t\t\t}\n#ifdef DEBUG_INTERNALS\n\t\t\t\t\tfz_printf(out, \"<span class=\\\"internal_span\\\"\");\n\t\t\t\t\tif (span->column)\n\t\t\t\t\t\tfz_printf(out, \" col=\\\"%x\\\"\", span->column);\n\t\t\t\t\tfz_printf(out, \">\");\n#endif\n\t\t\t\t\tif (span->spacing >= 1)\n\t\t\t\t\t\tfz_printf(out, \" \");\n\t\t\t\t\tif (base_offset > SUBSCRIPT_OFFSET)\n\t\t\t\t\t\tfz_printf(out, \"<sub>\");\n\t\t\t\t\telse if (base_offset < SUPERSCRIPT_OFFSET)\n\t\t\t\t\t\tfz_printf(out, \"<sup>\");\n\t\t\t\t\tfor (ch_n = 0; ch_n < span->len; ch_n++)\n\t\t\t\t\t{\n\t\t\t\t\t\tfz_text_char *ch = &span->text[ch_n];\n\t\t\t\t\t\tif (style != ch->style)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (style)\n\t\t\t\t\t\t\t\tfz_print_style_end(out, style);\n\t\t\t\t\t\t\tfz_print_style_begin(out, ch->style);\n\t\t\t\t\t\t\tstyle = ch->style;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (ch->c == '<')\n\t\t\t\t\t\t\tfz_printf(out, \"&lt;\");\n\t\t\t\t\t\telse if (ch->c == '>')\n\t\t\t\t\t\t\tfz_printf(out, \"&gt;\");\n\t\t\t\t\t\telse if (ch->c == '&')\n\t\t\t\t\t\t\tfz_printf(out, \"&amp;\");\n\t\t\t\t\t\telse if (ch->c >= 32 && ch->c <= 127)\n\t\t\t\t\t\t\tfz_printf(out, \"%c\", ch->c);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tfz_printf(out, \"&#x%x;\", ch->c);\n\t\t\t\t\t}\n\t\t\t\t\tif (style)\n\t\t\t\t\t{\n\t\t\t\t\t\tfz_print_style_end(out, style);\n\t\t\t\t\t\tstyle = NULL;\n\t\t\t\t\t}\n\t\t\t\t\tif (base_offset > SUBSCRIPT_OFFSET)\n\t\t\t\t\t\tfz_printf(out, \"</sub>\");\n\t\t\t\t\telse if (base_offset < SUPERSCRIPT_OFFSET)\n\t\t\t\t\t\tfz_printf(out, \"</sup>\");\n#ifdef DEBUG_INTERNALS\n\t\t\t\t\tfz_printf(out, \"</span>\");\n#endif\n\t\t\t\t}\n\t\t\t\t/* Close our floating span */\n\t\t\t\tfz_printf(out, \"</div>\");\n\t\t\t\t/* Close the line */\n\t\t\t\tfz_printf(out, \"</div>\");\n\t\t\t\tfz_printf(out, \"\\n\");\n\t\t\t}\n\t\t\t/* Close the metaline */\n\t\t\tfz_printf(out, \"</div>\");\n\t\t\tlast_region = NULL;\n\t\t\tfz_printf(out, \"</p></div>\\n\");\n\t\t\tbreak;\n\t\t}\n\t\tcase FZ_PAGE_BLOCK_IMAGE:\n\t\t{\n\t\t\tfz_image_block *image = page->blocks[block_n].u.image;\n\t\t\tfz_printf(out, \"<img width=%d height=%d src=\\\"data:\", image->image->w, image->image->h);\n\t\t\tswitch (image->image->buffer == NULL ? FZ_IMAGE_JPX : image->image->buffer->params.type)\n\t\t\t{\n\t\t\tcase FZ_IMAGE_JPEG:\n\t\t\t\tfz_printf(out, \"image/jpeg;base64,\");\n\t\t\t\tsend_data_base64(out, image->image->buffer->buffer);\n\t\t\t\tbreak;\n\t\t\tcase FZ_IMAGE_PNG:\n\t\t\t\tfz_printf(out, \"image/png;base64,\");\n\t\t\t\tsend_data_base64(out, image->image->buffer->buffer);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t{\n\t\t\t\t\tfz_buffer *buf = fz_new_png_from_image(ctx, image->image, image->image->w, image->image->h);\n\t\t\t\t\tfz_printf(out, \"image/png;base64,\");\n\t\t\t\t\tsend_data_base64(out, buf);\n\t\t\t\t\tfz_drop_buffer(ctx, buf);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfz_printf(out, \"\\\">\\n\");\n\t\t\tbreak;\n\t\t}\n\t\t}\n\t}\n\n\tfz_printf(out, \"</div>\\n\");\n}\n\nvoid\nfz_print_text_page_xml(fz_context *ctx, fz_output *out, fz_text_page *page)\n{\n\tint block_n;\n\n\tfz_printf(out, \"<page width=\\\"%g\\\" height=\\\"%g\\\">\\n\",\n\t\tpage->mediabox.x1 - page->mediabox.x0,\n\t\tpage->mediabox.y1 - page->mediabox.y0);\n\n\tfor (block_n = 0; block_n < page->len; block_n++)\n\t{\n\t\tswitch (page->blocks[block_n].type)\n\t\t{\n\t\tcase FZ_PAGE_BLOCK_TEXT:\n\t\t{\n\t\t\tfz_text_block *block = page->blocks[block_n].u.text;\n\t\t\tfz_text_line *line;\n\t\t\tchar *s;\n\n\t\t\tfz_printf(out, \"<block bbox=\\\"%g %g %g %g\\\">\\n\",\n\t\t\t\tblock->bbox.x0, block->bbox.y0, block->bbox.x1, block->bbox.y1);\n\t\t\tfor (line = block->lines; line < block->lines + block->len; line++)\n\t\t\t{\n\t\t\t\tfz_text_span *span;\n\t\t\t\tfz_printf(out, \"<line bbox=\\\"%g %g %g %g\\\">\\n\",\n\t\t\t\t\tline->bbox.x0, line->bbox.y0, line->bbox.x1, line->bbox.y1);\n\t\t\t\tfor (span = line->first_span; span; span = span->next)\n\t\t\t\t{\n\t\t\t\t\tfz_text_style *style = NULL;\n\t\t\t\t\tint char_num;\n\t\t\t\t\tfor (char_num = 0; char_num < span->len; char_num++)\n\t\t\t\t\t{\n\t\t\t\t\t\tfz_text_char *ch = &span->text[char_num];\n\t\t\t\t\t\tif (ch->style != style)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (style)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfz_printf(out, \"</span>\\n\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstyle = ch->style;\n\t\t\t\t\t\t\ts = strchr(style->font->name, '+');\n\t\t\t\t\t\t\ts = s ? s + 1 : style->font->name;\n\t\t\t\t\t\t\tfz_printf(out, \"<span bbox=\\\"%g %g %g %g\\\" font=\\\"%s\\\" size=\\\"%g\\\">\\n\",\n\t\t\t\t\t\t\t\tspan->bbox.x0, span->bbox.y0, span->bbox.x1, span->bbox.y1,\n\t\t\t\t\t\t\t\ts, style->size);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfz_rect rect;\n\t\t\t\t\t\t\tfz_text_char_bbox(&rect, span, char_num);\n\t\t\t\t\t\t\tfz_printf(out, \"<char bbox=\\\"%g %g %g %g\\\" x=\\\"%g\\\" y=\\\"%g\\\" c=\\\"\",\n\t\t\t\t\t\t\t\trect.x0, rect.y0, rect.x1, rect.y1, ch->p.x, ch->p.y);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tswitch (ch->c)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tcase '<': fz_printf(out, \"&lt;\"); break;\n\t\t\t\t\t\tcase '>': fz_printf(out, \"&gt;\"); break;\n\t\t\t\t\t\tcase '&': fz_printf(out, \"&amp;\"); break;\n\t\t\t\t\t\tcase '\"': fz_printf(out, \"&quot;\"); break;\n\t\t\t\t\t\tcase '\\'': fz_printf(out, \"&apos;\"); break;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (ch->c >= 32 && ch->c <= 127)\n\t\t\t\t\t\t\t\tfz_printf(out, \"%c\", ch->c);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tfz_printf(out, \"&#x%x;\", ch->c);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfz_printf(out, \"\\\"/>\\n\");\n\t\t\t\t\t}\n\t\t\t\t\tif (style)\n\t\t\t\t\t\tfz_printf(out, \"</span>\\n\");\n\t\t\t\t}\n\t\t\t\tfz_printf(out, \"</line>\\n\");\n\t\t\t}\n\t\t\tfz_printf(out, \"</block>\\n\");\n\t\t\tbreak;\n\t\t}\n\t\tcase FZ_PAGE_BLOCK_IMAGE:\n\t\t{\n\t\t\tbreak;\n\t\t}\n\t}\n\t}\n\tfz_printf(out, \"</page>\\n\");\n}\n\nvoid\nfz_print_text_page(fz_context *ctx, fz_output *out, fz_text_page *page)\n{\n\tint block_n;\n\n\tfor (block_n = 0; block_n < page->len; block_n++)\n\t{\n\t\tswitch (page->blocks[block_n].type)\n\t\t{\n\t\tcase FZ_PAGE_BLOCK_TEXT:\n\t\t{\n\t\t\tfz_text_block *block = page->blocks[block_n].u.text;\n\t\t\tfz_text_line *line;\n\t\t\tfz_text_char *ch;\n\t\t\tchar utf[10];\n\t\t\tint i, n;\n\n\t\t\tfor (line = block->lines; line < block->lines + block->len; line++)\n\t\t\t{\n\t\t\t\tfz_text_span *span;\n\t\t\t\tfor (span = line->first_span; span; span = span->next)\n\t\t\t\t{\n\t\t\t\t\tfor (ch = span->text; ch < span->text + span->len; ch++)\n\t\t\t\t\t{\n\t\t\t\t\t\tn = fz_runetochar(utf, ch->c);\n\t\t\t\t\t\tfor (i = 0; i < n; i++)\n\t\t\t\t\t\t\tfz_printf(out, \"%c\", utf[i]);\n\t\t\t\t\t}\n\t\t\t\t\t/* SumatraPDF: separate spans with spaces */\n\t\t\t\t\tif (span->next && span->len > 0 && span->text[span->len - 1].c != ' ')\n\t\t\t\t\t\tfz_printf(out, \" \");\n\t\t\t\t}\n\t\t\t\tfz_printf(out, \"\\n\");\n\t\t\t}\n\t\t\tfz_printf(out, \"\\n\");\n\t\t\tbreak;\n\t\t}\n\t\tcase FZ_PAGE_BLOCK_IMAGE:\n\t\t\tbreak;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/fitz/stext-paragraph.c",
    "content": "#include \"mupdf/fitz.h\"\n\n/* Assemble span soup into blocks and lines. */\n\n#define MY_EPSILON 0.001f\n\n#undef DEBUG_LINE_HEIGHTS\n#undef DEBUG_MASKS\n#undef DEBUG_ALIGN\n#undef DEBUG_INDENTS\n\n#undef SPOT_LINE_NUMBERS\n\ntypedef struct line_height_s\n{\n\tfloat height;\n\tint count;\n\tfz_text_style *style;\n} line_height;\n\ntypedef struct line_heights_s\n{\n\tfz_context *ctx;\n\tint cap;\n\tint len;\n\tline_height *lh;\n} line_heights;\n\nstatic line_heights *\nnew_line_heights(fz_context *ctx)\n{\n\tline_heights *lh = fz_malloc_struct(ctx, line_heights);\n\tlh->ctx = ctx;\n\treturn lh;\n}\n\nstatic void\nfree_line_heights(line_heights *lh)\n{\n\tif (!lh)\n\t\treturn;\n\tfz_free(lh->ctx, lh->lh);\n\tfz_free(lh->ctx, lh);\n}\n\nstatic void\ninsert_line_height(line_heights *lh, fz_text_style *style, float height)\n{\n\tint i;\n\n#ifdef DEBUG_LINE_HEIGHTS\n\tprintf(\"style=%x height=%g\\n\", style, height);\n#endif\n\n\t/* If we have one already, add it in */\n\tfor (i=0; i < lh->len; i++)\n\t{\n\t\t/* Match if we are within 5% */\n\t\tif (lh->lh[i].style == style && lh->lh[i].height * 0.95 <= height && lh->lh[i].height * 1.05 >= height)\n\t\t{\n\t\t\t/* Ensure that the average height is correct */\n\t\t\tlh->lh[i].height = (lh->lh[i].height * lh->lh[i].count + height) / (lh->lh[i].count+1);\n\t\t\tlh->lh[i].count++;\n\t\t\treturn;\n\t\t}\n\t}\n\n\t/* Otherwise extend (if required) and add it */\n\tif (lh->cap == lh->len)\n\t{\n\t\tint newcap = (lh->cap ? lh->cap * 2 : 4);\n\t\tlh->lh = fz_resize_array(lh->ctx, lh->lh, newcap, sizeof(line_height));\n\t\tlh->cap = newcap;\n\t}\n\n\tlh->lh[lh->len].count = 1;\n\tlh->lh[lh->len].height = height;\n\tlh->lh[lh->len].style = style;\n\tlh->len++;\n}\n\nstatic void\ncull_line_heights(line_heights *lh)\n{\n\tint i, j, k;\n\n#ifdef DEBUG_LINE_HEIGHTS\n\tprintf(\"Before culling:\\n\");\n\tfor (i = 0; i < lh->len; i++)\n\t{\n\t\tfz_text_style *style = lh->lh[i].style;\n\t\tprintf(\"style=%x height=%g count=%d\\n\", style, lh->lh[i].height, lh->lh[i].count);\n\t}\n#endif\n\tfor (i = 0; i < lh->len; i++)\n\t{\n\t\tfz_text_style *style = lh->lh[i].style;\n\t\tint count = lh->lh[i].count;\n\t\tint max = i;\n\n\t\t/* Find the max for this style */\n\t\tfor (j = i+1; j < lh->len; j++)\n\t\t{\n\t\t\tif (lh->lh[j].style == style && lh->lh[j].count > count)\n\t\t\t{\n\t\t\t\tmax = j;\n\t\t\t\tcount = lh->lh[j].count;\n\t\t\t}\n\t\t}\n\n\t\t/* Destroy all the ones other than the max */\n\t\tif (max != i)\n\t\t{\n\t\t\tlh->lh[i].count = count;\n\t\t\tlh->lh[i].height = lh->lh[max].height;\n\t\t\tlh->lh[max].count = 0;\n\t\t}\n\t\tj = i+1;\n\t\tfor (k = j; k < lh->len; k++)\n\t\t{\n\t\t\tif (lh->lh[k].style != style)\n\t\t\t\tlh->lh[j++] = lh->lh[k];\n\t\t}\n\t\tlh->len = j;\n\t}\n#ifdef DEBUG_LINE_HEIGHTS\n\tprintf(\"After culling:\\n\");\n\tfor (i = 0; i < lh->len; i++)\n\t{\n\t\tfz_text_style *style = lh->lh[i].style;\n\t\tprintf(\"style=%x height=%g count=%d\\n\", style, lh->lh[i].height, lh->lh[i].count);\n\t}\n#endif\n}\n\nstatic float\nline_height_for_style(line_heights *lh, fz_text_style *style)\n{\n\tint i;\n\n\tfor (i=0; i < lh->len; i++)\n\t{\n\t\tif (lh->lh[i].style == style)\n\t\t\treturn lh->lh[i].height;\n\t}\n\treturn 0.0; /* Never reached */\n}\n\nstatic void\nsplit_block(fz_context *ctx, fz_text_page *page, int block_num, int linenum)\n{\n\tint split_len;\n\tfz_text_block *block, *block2;\n\n\tif (page->len == page->cap)\n\t{\n\t\tint new_cap = fz_maxi(16, page->cap * 2);\n\t\tpage->blocks = fz_resize_array(ctx, page->blocks, new_cap, sizeof(*page->blocks));\n\t\tpage->cap = new_cap;\n\t}\n\n\tmemmove(page->blocks+block_num+1, page->blocks+block_num, (page->len - block_num)*sizeof(*page->blocks));\n\tpage->len++;\n\n\tblock2 = fz_malloc_struct(ctx, fz_text_block);\n\tblock = page->blocks[block_num].u.text;\n\n\tpage->blocks[block_num+1].type = FZ_PAGE_BLOCK_TEXT;\n\tpage->blocks[block_num+1].u.text = block2;\n\tsplit_len = block->len - linenum;\n\tblock2->bbox = block->bbox; /* FIXME! */\n\tblock2->cap = 0;\n\tblock2->len = 0;\n\tblock2->lines = NULL;\n\tblock2->lines = fz_malloc_array(ctx, split_len, sizeof(fz_text_line));\n\tblock2->cap = block2->len;\n\tblock2->len = split_len;\n\tblock->len = linenum;\n\tmemcpy(block2->lines, block->lines + linenum, split_len * sizeof(fz_text_line));\n\tblock2->lines[0].distance = 0;\n}\n\nstatic inline int\nis_unicode_wspace(int c)\n{\n\treturn (c == 9 || /* TAB */\n\t\tc == 0x0a || /* HT */\n\t\tc == 0x0b || /* LF */\n\t\tc == 0x0c || /* VT */\n\t\tc == 0x0d || /* FF */\n\t\tc == 0x20 || /* CR */\n\t\tc == 0x85 || /* NEL */\n\t\tc == 0xA0 || /* No break space */\n\t\tc == 0x1680 || /* Ogham space mark */\n\t\tc == 0x180E || /* Mongolian Vowel Separator */\n\t\tc == 0x2000 || /* En quad */\n\t\tc == 0x2001 || /* Em quad */\n\t\tc == 0x2002 || /* En space */\n\t\tc == 0x2003 || /* Em space */\n\t\tc == 0x2004 || /* Three-per-Em space */\n\t\tc == 0x2005 || /* Four-per-Em space */\n\t\tc == 0x2006 || /* Five-per-Em space */\n\t\tc == 0x2007 || /* Figure space */\n\t\tc == 0x2008 || /* Punctuation space */\n\t\tc == 0x2009 || /* Thin space */\n\t\tc == 0x200A || /* Hair space */\n\t\tc == 0x2028 || /* Line separator */\n\t\tc == 0x2029 || /* Paragraph separator */\n\t\tc == 0x202F || /* Narrow no-break space */\n\t\tc == 0x205F || /* Medium mathematical space */\n\t\tc == 0x3000); /* Ideographic space */\n}\n\nstatic inline int\nis_unicode_bullet(int c)\n{\n\t/* The last 2 aren't strictly bullets, but will do for our usage here */\n\treturn (c == 0x2022 || /* Bullet */\n\t\tc == 0x2023 || /* Triangular bullet */\n\t\tc == 0x25e6 || /* White bullet */\n\t\tc == 0x2043 || /* Hyphen bullet */\n\t\tc == 0x2219 || /* Bullet operator */\n\t\tc == 149 || /* Ascii bullet */\n\t\tc == '*');\n}\n\nstatic inline int\nis_number(int c)\n{\n\treturn ((c >= '0' && c <= '9') ||\n\t\t(c == '.'));\n}\n\nstatic inline int\nis_latin_char(int c)\n{\n\treturn ((c >= 'A' && c <= 'Z') ||\n\t\t(c >= 'a' && c <= 'z'));\n}\n\nstatic inline int\nis_roman(int c)\n{\n\treturn (c == 'i' || c == 'I' ||\n\t\tc == 'v' || c == 'V' ||\n\t\tc == 'x' || c == 'X' ||\n\t\tc == 'l' || c == 'L' ||\n\t\tc == 'c' || c == 'C' ||\n\t\tc == 'm' || c == 'M');\n}\n\nstatic int\nis_list_entry(fz_text_line *line, fz_text_span *span, int *char_num_ptr)\n{\n\tint char_num;\n\tfz_text_char *chr;\n\n\t/* First, skip over any whitespace */\n\tfor (char_num = 0; char_num < span->len; char_num++)\n\t{\n\t\tchr = &span->text[char_num];\n\t\tif (!is_unicode_wspace(chr->c))\n\t\t\tbreak;\n\t}\n\t*char_num_ptr = char_num;\n\n\tif (span != line->first_span || char_num >= span->len)\n\t\treturn 0;\n\n\t/* Now we check for various special cases, which we consider to mean\n\t * that this is probably a list entry and therefore should always count\n\t * as a separate paragraph (and hence not be entered in the line height\n\t * table). */\n\tchr = &span->text[char_num];\n\n\t/* Is the first char on the line, a bullet point? */\n\tif (is_unicode_bullet(chr->c))\n\t\treturn 1;\n\n#ifdef SPOT_LINE_NUMBERS\n\t/* Is the entire first span a number? Or does it start with a number\n\t * followed by ) or : ? Allow to involve single latin chars too. */\n\tif (is_number(chr->c) || is_latin_char(chr->c))\n\t{\n\t\tint cn = char_num;\n\t\tint met_char = is_latin_char(chr->c);\n\t\tfor (cn = char_num+1; cn < span->len; cn++)\n\t\t{\n\t\t\tfz_text_char *chr2 = &span->text[cn];\n\n\t\t\tif (is_latin_char(chr2->c) && !met_char)\n\t\t\t{\n\t\t\t\tmet_char = 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tmet_char = 0;\n\t\t\tif (!is_number(chr2->c) && !is_unicode_wspace(chr2->c))\n\t\t\t\tbreak;\n\t\t\telse if (chr2->c == ')' || chr2->c == ':')\n\t\t\t{\n\t\t\t\tcn = span->len;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (cn == span->len)\n\t\t\treturn 1;\n\t}\n\n\t/* Is the entire first span a roman numeral? Or does it start with\n\t * a roman numeral followed by ) or : ? */\n\tif (is_roman(chr->c))\n\t{\n\t\tint cn = char_num;\n\t\tfor (cn = char_num+1; cn < span->len; cn++)\n\t\t{\n\t\t\tfz_text_char *chr2 = &span->text[cn];\n\n\t\t\tif (!is_roman(chr2->c) && !is_unicode_wspace(chr2->c))\n\t\t\t\tbreak;\n\t\t\telse if (chr2->c == ')' || chr2->c == ':')\n\t\t\t{\n\t\t\t\tcn = span->len;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (cn == span->len)\n\t\t\treturn 1;\n\t}\n#endif\n\treturn 0;\n}\n\ntypedef struct region_masks_s region_masks;\n\ntypedef struct region_mask_s region_mask;\n\ntypedef struct region_s region;\n\nstruct region_s\n{\n\tfloat start;\n\tfloat stop;\n\tfloat ave_start;\n\tfloat ave_stop;\n\tint align;\n\tfloat colw;\n};\n\nstruct region_mask_s\n{\n\tfz_context *ctx;\n\tint freq;\n\tfz_point blv;\n\tint cap;\n\tint len;\n\tfloat size;\n\tregion *mask;\n};\n\nstruct region_masks_s\n{\n\tfz_context *ctx;\n\tint cap;\n\tint len;\n\tregion_mask **mask;\n};\n\nstatic region_masks *\nnew_region_masks(fz_context *ctx)\n{\n\tregion_masks *rms = fz_malloc_struct(ctx, region_masks);\n\trms->ctx = ctx;\n\trms->cap = 0;\n\trms->len = 0;\n\trms->mask = NULL;\n\treturn rms;\n}\n\nstatic void\nfree_region_mask(region_mask *rm)\n{\n\tif (!rm)\n\t\treturn;\n\tfz_free(rm->ctx, rm->mask);\n\tfz_free(rm->ctx, rm);\n}\n\nstatic void\nfree_region_masks(region_masks *rms)\n{\n\tint i;\n\n\tif (!rms)\n\t\treturn;\n\tfor (i=0; i < rms->len; i++)\n\t{\n\t\tfree_region_mask(rms->mask[i]);\n\t}\n\tfz_free(rms->ctx, rms->mask);\n\tfz_free(rms->ctx, rms);\n}\n\nstatic int region_masks_mergeable(const region_mask *rm1, const region_mask *rm2, float *score)\n{\n\tint i1, i2;\n\tint count = 0;\n\n\t*score = 0;\n\tif (fabsf(rm1->blv.x-rm2->blv.x) >= MY_EPSILON || fabsf(rm1->blv.y-rm2->blv.y) >= MY_EPSILON)\n\t\treturn 0;\n\n\tfor (i1 = 0, i2 = 0; i1 < rm1->len && i2 < rm2->len; )\n\t{\n\t\tif (rm1->mask[i1].stop < rm2->mask[i2].start)\n\t\t{\n\t\t\t/* rm1's region is entirely before rm2's */\n\t\t\t*score += rm1->mask[i1].stop - rm1->mask[i1].start;\n\t\t\ti1++;\n\t\t}\n\t\telse if (rm1->mask[i1].start > rm2->mask[i2].stop)\n\t\t{\n\t\t\t/* rm2's region is entirely before rm1's */\n\t\t\t*score += rm2->mask[i2].stop - rm2->mask[i2].start;\n\t\t\ti2++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfloat lscore, rscore;\n\t\t\tif (rm1->mask[i1].start < rm2->mask[i2].start)\n\t\t\t{\n\t\t\t\tif (i2 > 0 && rm2->mask[i2-1].stop >= rm1->mask[i1].start)\n\t\t\t\t\treturn 0; /* Not compatible */\n\t\t\t\tlscore = rm2->mask[i2].start - rm1->mask[i1].start;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (i1 > 0 && rm1->mask[i1-1].stop >= rm2->mask[i2].start)\n\t\t\t\t\treturn 0; /* Not compatible */\n\t\t\t\tlscore = rm1->mask[i1].start - rm2->mask[i2].start;\n\t\t\t}\n\t\t\tif (rm1->mask[i1].stop > rm2->mask[i2].stop)\n\t\t\t{\n\t\t\t\tif (i2+1 < rm2->len && rm2->mask[i2+1].start <= rm1->mask[i1].stop)\n\t\t\t\t\treturn 0; /* Not compatible */\n\t\t\t\trscore = rm1->mask[i1].stop - rm2->mask[i2].stop;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (i1+1 < rm1->len && rm1->mask[i1+1].start <= rm2->mask[i2].stop)\n\t\t\t\t\treturn 0; /* Not compatible */\n\t\t\t\trscore = rm2->mask[i2].stop - rm1->mask[i1].stop;\n\t\t\t}\n\t\t\t/* In order to allow a region to merge, either the\n\t\t\t * left, the right, or the centre must agree */\n\t\t\tif (lscore < 1)\n\t\t\t{\n\t\t\t\tif (rscore < 1)\n\t\t\t\t{\n\t\t\t\t\trscore = 0;\n\t\t\t\t}\n\t\t\t\tlscore = 0;\n\t\t\t}\n\t\t\telse if (rscore < 1)\n\t\t\t{\n\t\t\t\trscore = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/* Neither Left or right agree. Does the centre? */\n\t\t\t\tfloat ave1 = rm1->mask[i1].start + rm1->mask[i1].stop;\n\t\t\t\tfloat ave2 = rm2->mask[i2].start + rm2->mask[i2].stop;\n\t\t\t\tif (fabsf(ave1-ave2) > 1)\n\t\t\t\t{\n\t\t\t\t\t/* Nothing agrees, so don't merge */\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tlscore = 0;\n\t\t\t\trscore = 0;\n\t\t\t}\n\t\t\t*score += lscore + rscore;\n\t\t\t/* These two regions could be merged */\n\t\t\ti1++;\n\t\t\ti2++;\n\t\t}\n\t\tcount++;\n\t}\n\tcount += rm1->len-i1 + rm2->len-i2;\n\treturn count;\n}\n\nstatic int region_mask_matches(const region_mask *rm1, const region_mask *rm2, float *score)\n{\n\tint i1, i2;\n\tint close = 1;\n\n\t*score = 0;\n\tif (fabsf(rm1->blv.x-rm2->blv.x) >= MY_EPSILON || fabsf(rm1->blv.y-rm2->blv.y) >= MY_EPSILON)\n\t\treturn 0;\n\n\tfor (i1 = 0, i2 = 0; i1 < rm1->len && i2 < rm2->len; )\n\t{\n\t\tif (rm1->mask[i1].stop < rm2->mask[i2].start)\n\t\t{\n\t\t\t/* rm1's region is entirely before rm2's */\n\t\t\t*score += rm1->mask[i1].stop - rm1->mask[i1].start;\n\t\t\ti1++;\n\t\t}\n\t\telse if (rm1->mask[i1].start > rm2->mask[i2].stop)\n\t\t{\n\t\t\t/* Not compatible */\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfloat lscore, rscore;\n\t\t\tif (rm1->mask[i1].start > rm2->mask[i2].start)\n\t\t\t{\n\t\t\t\t/* Not compatible */\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tif (rm1->mask[i1].stop < rm2->mask[i2].stop)\n\t\t\t{\n\t\t\t\t/* Not compatible */\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tlscore = rm2->mask[i2].start - rm1->mask[i1].start;\n\t\t\trscore = rm1->mask[i1].stop - rm2->mask[i2].stop;\n\t\t\tif (lscore < 1)\n\t\t\t{\n\t\t\t\tif (rscore < 1)\n\t\t\t\t\tclose++;\n\t\t\t\tclose++;\n\t\t\t}\n\t\t\telse if (rscore < 1)\n\t\t\t\tclose++;\n\t\t\telse if (fabsf(lscore - rscore) < 1)\n\t\t\t{\n\t\t\t\tlscore = fabsf(lscore-rscore);\n\t\t\t\trscore = 0;\n\t\t\t\tclose++;\n\t\t\t}\n\t\t\t*score += lscore + rscore;\n\t\t\ti1++;\n\t\t\ti2++;\n\t\t}\n\t}\n\tif (i1 < rm1->len)\n\t{\n\t\t/* Still more to go in rm1 */\n\t\tif (rm1->mask[i1].start < rm2->mask[rm2->len-1].stop)\n\t\t\treturn 0;\n\t}\n\telse if (i2 < rm2->len)\n\t{\n\t\t/* Still more to go in rm2 */\n\t\tif (rm2->mask[i2].start < rm1->mask[rm1->len-1].stop)\n\t\t\treturn 0;\n\t}\n\n\treturn close;\n}\n\nstatic void region_mask_merge(region_mask *rm1, const region_mask *rm2, int newlen)\n{\n\tint o, i1, i2;\n\n\t/* First, ensure that rm1 is long enough */\n\tif (rm1->cap < newlen)\n\t{\n\t\tint newcap = rm1->cap ? rm1->cap : 2;\n\t\tdo\n\t\t{\n\t\t\tnewcap *= 2;\n\t\t}\n\t\twhile (newcap < newlen);\n\t\trm1->mask = fz_resize_array(rm1->ctx, rm1->mask, newcap, sizeof(*rm1->mask));\n\t\trm1->cap = newcap;\n\t}\n\n\t/* Now run backwards along rm1, filling it out with the merged regions */\n\tfor (o = newlen-1, i1 = rm1->len-1, i2 = rm2->len-1; o >= 0; o--)\n\t{\n\t\t/* So we read from i1 and i2 and store in o */\n\t\tif (i1 < 0)\n\t\t{\n\t\t\t/* Just copy i2 */\n\t\t\trm1->mask[o] = rm2->mask[i2];\n\t\t\ti2--;\n\t\t}\n\t\telse if (i2 < 0)\n\t\t{\n\t\t\t/* Just copy i1 */\n\t\t\trm1->mask[o] = rm1->mask[i1];\n\t\t\ti1--;\n\t\t}\n\t\telse if (rm1->mask[i1].stop < rm2->mask[i2].start)\n\t\t{\n\t\t\t/* rm1's region is entirely before rm2's - copy rm2's */\n\t\t\trm1->mask[o] = rm2->mask[i2];\n\t\t\ti2--;\n\t\t}\n\t\telse if (rm2->mask[i2].stop < rm1->mask[i1].start)\n\t\t{\n\t\t\t/* rm2's region is entirely before rm1's - copy rm1's */\n\t\t\trm1->mask[o] = rm1->mask[i1];\n\t\t\ti1--;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* We must be merging */\n\t\t\trm1->mask[o].ave_start = (rm1->mask[i1].start * rm1->freq + rm2->mask[i2].start * rm2->freq)/(rm1->freq + rm2->freq);\n\t\t\trm1->mask[o].ave_stop = (rm1->mask[i1].stop * rm1->freq + rm2->mask[i2].stop * rm2->freq)/(rm1->freq + rm2->freq);\n\t\t\trm1->mask[o].start = fz_min(rm1->mask[i1].start, rm2->mask[i2].start);\n\t\t\trm1->mask[o].stop = fz_max(rm1->mask[i1].stop, rm2->mask[i2].stop);\n\t\t\ti1--;\n\t\t\ti2--;\n\t\t}\n\t}\n\trm1->freq += rm2->freq;\n\trm1->len = newlen;\n}\n\nstatic region_mask *region_masks_match(const region_masks *rms, const region_mask *rm, fz_text_line *line, region_mask *prev_match)\n{\n\tint i;\n\tfloat best_score = 9999999;\n\tfloat score;\n\tint best = -1;\n\tint best_count = 0;\n\n\t/* If the 'previous match' matches, use it regardless. */\n\tif (prev_match && region_mask_matches(prev_match, rm, &score))\n\t{\n\t\treturn prev_match;\n\t}\n\n\t/* Run through and find the 'most compatible' region mask. We are\n\t * guaranteed that there will always be at least one compatible one!\n\t */\n\tfor (i=0; i < rms->len; i++)\n\t{\n\t\tint count = region_mask_matches(rms->mask[i], rm, &score);\n\t\tif (count > best_count || (count == best_count && (score < best_score || best == -1)))\n\t\t{\n\t\t\tbest = i;\n\t\t\tbest_score = score;\n\t\t\tbest_count = count;\n\t\t}\n\t}\n\tassert(best >= 0 && best < rms->len);\n\n\t/* So we have the matching mask. */\n\treturn rms->mask[best];\n}\n\n#ifdef DEBUG_MASKS\nstatic void\ndump_region_mask(const region_mask *rm)\n{\n\tint j;\n\tfor (j = 0; j < rm->len; j++)\n\t{\n\t\tprintf(\"%g->%g \", rm->mask[j].start, rm->mask[j].stop);\n\t}\n\tprintf(\"* %d\\n\", rm->freq);\n}\n\nstatic void\ndump_region_masks(const region_masks *rms)\n{\n\tint i;\n\n\tfor (i = 0; i < rms->len; i++)\n\t{\n\t\tregion_mask *rm = rms->mask[i];\n\t\tdump_region_mask(rm);\n\t}\n}\n#endif\n\nstatic void region_masks_add(region_masks *rms, region_mask *rm)\n{\n\t/* Add rm to rms */\n\tif (rms->len == rms->cap)\n\t{\n\t\tint newcap = (rms->cap ? rms->cap * 2 : 4);\n\t\trms->mask = fz_resize_array(rms->ctx, rms->mask, newcap, sizeof(*rms->mask));\n\t\trms->cap = newcap;\n\t}\n\trms->mask[rms->len] = rm;\n\trms->len++;\n}\n\nstatic void region_masks_sort(region_masks *rms)\n{\n\tint i, j;\n\n\t/* First calculate sizes */\n\tfor (i=0; i < rms->len; i++)\n\t{\n\t\tregion_mask *rm = rms->mask[i];\n\t\tfloat size = 0;\n\t\tfor (j=0; j < rm->len; j++)\n\t\t{\n\t\t\tsize += rm->mask[j].stop - rm->mask[j].start;\n\t\t}\n\t\trm->size = size;\n\t}\n\n\t/* Now, sort on size */\n\t/* FIXME: bubble sort - use heapsort for efficiency */\n\tfor (i=0; i < rms->len-1; i++)\n\t{\n\t\tfor (j=i+1; j < rms->len; j++)\n\t\t{\n\t\t\tif (rms->mask[i]->size < rms->mask[j]->size)\n\t\t\t{\n\t\t\t\tregion_mask *tmp = rms->mask[i];\n\t\t\t\trms->mask[i] = rms->mask[j];\n\t\t\t\trms->mask[j] = tmp;\n\t\t\t}\n\t\t}\n\t}\n}\n\nstatic void region_masks_merge(region_masks *rms, region_mask *rm)\n{\n\tint i;\n\tfloat best_score = 9999999;\n\tfloat score;\n\tint best = -1;\n\tint best_count = 0;\n\n#ifdef DEBUG_MASKS\n\tprintf(\"\\nAdding:\\n\");\n\tdump_region_mask(rm);\n\tprintf(\"To:\\n\");\n\tdump_region_masks(rms);\n#endif\n\tfor (i=0; i < rms->len; i++)\n\t{\n\t\tint count = region_masks_mergeable(rms->mask[i], rm, &score);\n\t\tif (count && (score < best_score || best == -1))\n\t\t{\n\t\t\tbest = i;\n\t\t\tbest_count = count;\n\t\t\tbest_score = score;\n\t\t}\n\t}\n\tif (best != -1)\n\t{\n\t\tregion_mask_merge(rms->mask[best], rm, best_count);\n#ifdef DEBUG_MASKS\n\t\tprintf(\"Merges to give:\\n\");\n\t\tdump_region_masks(rms);\n#endif\n\t\tfree_region_mask(rm);\n\t\treturn;\n\t}\n\tregion_masks_add(rms, rm);\n#ifdef DEBUG_MASKS\n\tprintf(\"Adding new one to give:\\n\");\n\tdump_region_masks(rms);\n#endif\n}\n\nstatic region_mask *\nnew_region_mask(fz_context *ctx, const fz_point *blv)\n{\n\tregion_mask *rm = fz_malloc_struct(ctx, region_mask);\n\trm->ctx = ctx;\n\trm->freq = 1;\n\trm->blv = *blv;\n\trm->cap = 0;\n\trm->len = 0;\n\trm->mask = NULL;\n\treturn rm;\n}\n\nstatic void\nregion_mask_project(const region_mask *rm, const fz_point *min, const fz_point *max, float *start, float *end)\n{\n\t/* We project min and max down onto the blv */\n\tfloat s = min->x * rm->blv.x + min->y * rm->blv.y;\n\tfloat e = max->x * rm->blv.x + max->y * rm->blv.y;\n\tif (s > e)\n\t{\n\t\t*start = e;\n\t\t*end = s;\n\t}\n\telse\n\t{\n\t\t*start = s;\n\t\t*end = e;\n\t}\n}\n\nstatic void\nregion_mask_add(region_mask *rm, const fz_point *min, const fz_point *max)\n{\n\tfloat start, end;\n\tint i, j;\n\n\tregion_mask_project(rm, min, max, &start, &end);\n\n\t/* Now add start/end into our region list. Typically we will be adding\n\t * to the end of the region list, so search from there backwards. */\n\tfor (i = rm->len; i > 0;)\n\t{\n\t\tif (start > rm->mask[i-1].stop)\n\t\t\tbreak;\n\t\ti--;\n\t}\n\t/* So we know that our interval can only affect list items >= i.\n\t * We know that start is after our previous end. */\n\tif (i == rm->len || end < rm->mask[i].start)\n\t{\n\t\t/* Insert new one. No overlap. No merging */\n\t\tif (rm->len == rm->cap)\n\t\t{\n\t\t\tint newcap = (rm->cap ? rm->cap * 2 : 4);\n\t\t\trm->mask = fz_resize_array(rm->ctx, rm->mask, newcap, sizeof(*rm->mask));\n\t\t\trm->cap = newcap;\n\t\t}\n\t\tif (rm->len > i)\n\t\t\tmemmove(&rm->mask[i+1], &rm->mask[i], (rm->len - i) * sizeof(*rm->mask));\n\t\trm->mask[i].ave_start = start;\n\t\trm->mask[i].ave_stop = end;\n\t\trm->mask[i].start = start;\n\t\trm->mask[i].stop = end;\n\t\trm->len++;\n\t}\n\telse\n\t{\n\t\t/* Extend current one down. */\n\t\trm->mask[i].ave_start = start;\n\t\trm->mask[i].start = start;\n\t\tif (rm->mask[i].stop < end)\n\t\t{\n\t\t\trm->mask[i].stop = end;\n\t\t\trm->mask[i].ave_stop = end;\n\t\t\t/* Our region may now extend upwards too far */\n\t\t\ti++;\n\t\t\tj = i;\n\t\t\twhile (j < rm->len && rm->mask[j].start <= end)\n\t\t\t{\n\t\t\t\trm->mask[i-1].stop = end = rm->mask[j].stop;\n\t\t\t\tj++;\n\t\t\t}\n\t\t\tif (i != j)\n\t\t\t{\n\t\t\t\t/* Move everything from j down to i */\n\t\t\t\twhile (j < rm->len)\n\t\t\t\t{\n\t\t\t\t\trm->mask[i++] = rm->mask[j++];\n\t\t\t\t}\n\t\t\t}\n\t\t\trm->len -= j-i;\n\t\t}\n\t}\n}\n\nstatic int\nregion_mask_column(region_mask *rm, const fz_point *min, const fz_point *max, int *align, float *colw, float *left_)\n{\n\tfloat start, end, left, right;\n\tint i;\n\n\tregion_mask_project(rm, min, max, &start, &end);\n\n\tfor (i = 0; i < rm->len; i++)\n\t{\n\t\t/* The use of MY_EPSILON here is because we might be matching\n\t\t * start/end values calculated with slightly different blv's */\n\t\tif (rm->mask[i].start - MY_EPSILON <= start && rm->mask[i].stop + MY_EPSILON >= end)\n\t\t\tbreak;\n\t}\n\tif (i >= rm->len)\n\t{\n\t\t*align = 0;\n\t\t*colw = 0;\n\t\treturn 0;\n\t}\n\tleft = start - rm->mask[i].start;\n\tright = rm->mask[i].stop - end;\n\tif (left < 1 && right < 1)\n\t\t*align = rm->mask[i].align;\n\telse if (left*2 <= right)\n\t\t*align = 0; /* Left */\n\telse if (right * 2 < left)\n\t\t*align = 2; /* Right */\n\telse\n\t\t*align = 1;\n\t*left_ = left;\n\t*colw = rm->mask[i].colw;\n\treturn i;\n}\n\nstatic void\nregion_mask_alignment(region_mask *rm)\n{\n\tint i;\n\tfloat width = 0;\n\n\tfor (i = 0; i < rm->len; i++)\n\t{\n\t\twidth += rm->mask[i].stop - rm->mask[i].start;\n\t}\n\tfor (i = 0; i < rm->len; i++)\n\t{\n\t\tregion *r = &rm->mask[i];\n\t\tfloat left = r->ave_start - r->start;\n\t\tfloat right = r->stop - r->ave_stop;\n\t\tif (left*2 <= right)\n\t\t\tr->align = 0; /* Left */\n\t\telse if (right * 2 < left)\n\t\t\tr->align = 2; /* Right */\n\t\telse\n\t\t\tr->align = 1;\n\t\tr->colw = 100 * (rm->mask[i].stop - rm->mask[i].start) / width;\n\t}\n}\n\nstatic void\nregion_masks_alignment(region_masks *rms)\n{\n\tint i;\n\n\tfor (i = 0; i < rms->len; i++)\n\t{\n\t\tregion_mask_alignment(rms->mask[i]);\n\t}\n}\n\nstatic int\nis_unicode_hyphen(int c)\n{\n\t/* We omit 0x2011 (Non breaking hyphen) and 0x2043 (Hyphen Bullet)\n\t * from this list. */\n\treturn (c == '-' ||\n\t\tc == 0x2010 || /* Hyphen */\n\t\tc == 0x002d || /* Hyphen-Minus */\n\t\tc == 0x00ad || /* Soft hyphen */\n\t\tc == 0x058a || /* Armenian Hyphen */\n\t\tc == 0x1400 || /* Canadian Syllabive Hyphen */\n\t\tc == 0x1806); /* Mongolian Todo soft hyphen */\n}\n\nstatic int\nis_unicode_hyphenatable(int c)\n{\n\t/* This is a pretty ad-hoc collection. It may need tuning. */\n\treturn ((c >= 'A' && c <= 'Z') ||\n\t\t(c >= 'a' && c <= 'z') ||\n\t\t(c >= 0x00c0 && c <= 0x00d6) ||\n\t\t(c >= 0x00d8 && c <= 0x00f6) ||\n\t\t(c >= 0x00f8 && c <= 0x02af) ||\n\t\t(c >= 0x1d00 && c <= 0x1dbf) ||\n\t\t(c >= 0x1e00 && c <= 0x1eff) ||\n\t\t(c >= 0x2c60 && c <= 0x2c7f) ||\n\t\t(c >= 0xa722 && c <= 0xa78e) ||\n\t\t(c >= 0xa790 && c <= 0xa793) ||\n\t\t(c >= 0xa7a8 && c <= 0xa7af) ||\n\t\t(c >= 0xfb00 && c <= 0xfb07) ||\n\t\t(c >= 0xff21 && c <= 0xff3a) ||\n\t\t(c >= 0xff41 && c <= 0xff5a));\n}\n\nstatic void\ndehyphenate(fz_text_span *s1, fz_text_span *s2)\n{\n\tint i;\n\n\tfor (i = s1->len-1; i > 0; i--)\n\t\tif (!is_unicode_wspace(s1->text[i].c))\n\t\t\tbreak;\n\t/* Can't leave an empty span. */\n\tif (i == 0)\n\t\treturn;\n\n\tif (!is_unicode_hyphen(s1->text[i].c))\n\t\treturn;\n\tif (!is_unicode_hyphenatable(s1->text[i-1].c))\n\t\treturn;\n\tif (!is_unicode_hyphenatable(s2->text[0].c))\n\t\treturn;\n\ts1->len = i;\n\ts2->spacing = 0;\n}\n\n#ifdef DEBUG_ALIGN\nstatic void\ndump_span(fz_text_span *span)\n{\n}\n\nstatic void\ndump_line(fz_text_line *line)\n{\n\tfz_text_span *span;\n\n\tif (!line)\n\t\treturn;\n\tprintf(\"d=%g: \", line->distance);\n\n\tspan = line->first_span;\n\twhile (span)\n\t{\n\t\tdump_span(span);\n\t\tspan = span->next;\n\t}\n\n\tprintf(\"\\n\");\n}\n#endif\n\nvoid\nfz_analyze_text(fz_context *ctx, fz_text_sheet *sheet, fz_text_page *page)\n{\n\tfz_text_line *line;\n\tfz_text_span *span;\n\tline_heights *lh;\n\tregion_masks *rms;\n\tint block_num;\n\n\t/* Simple paragraph analysis; look for the most common 'inter line'\n\t * spacing. This will be assumed to be our line spacing. Anything\n\t * more than 25% wider than this will be assumed to be a paragraph\n\t * space. */\n\n\t/* Step 1: Gather the line height information */\n\tlh = new_line_heights(ctx);\n\tfor (block_num = 0; block_num < page->len; block_num++)\n\t{\n\t\tfz_text_block *block;\n\n\t\tif (page->blocks[block_num].type != FZ_PAGE_BLOCK_TEXT)\n\t\t\tcontinue;\n\t\tblock = page->blocks[block_num].u.text;\n\n\t\tfor (line = block->lines; line < block->lines + block->len; line++)\n\t\t{\n\t\t\t/* For every style in the line, add lineheight to the\n\t\t\t * record for that style. FIXME: This is a nasty n^2\n\t\t\t * algorithm at the moment. */\n\t\t\tfz_text_style *style = NULL;\n\n\t\t\tif (line->distance == 0)\n\t\t\t\tcontinue;\n\n\t\t\tfor (span = line->first_span; span; span = span->next)\n\t\t\t{\n\t\t\t\tint char_num;\n\n\t\t\t\tif (is_list_entry(line, span, &char_num))\n\t\t\t\t\tgoto list_entry;\n\n\t\t\t\tfor (; char_num < span->len; char_num++)\n\t\t\t\t{\n\t\t\t\t\tfz_text_char *chr = &span->text[char_num];\n\n\t\t\t\t\t/* Ignore any whitespace chars */\n\t\t\t\t\tif (is_unicode_wspace(chr->c))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (chr->style != style)\n\t\t\t\t\t{\n\t\t\t\t\t\t/* Have we had this style before? */\n\t\t\t\t\t\tint match = 0;\n\t\t\t\t\t\tfz_text_span *span2;\n\t\t\t\t\t\tfor (span2 = line->first_span; span2 != span; span2 = span2->next)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint char_num2;\n\t\t\t\t\t\t\tfor (char_num2 = 0; char_num2 < span2->len; char_num2++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfz_text_char *chr2 = &span2->text[char_num2];\n\t\t\t\t\t\t\t\tif (chr2->style == chr->style)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmatch = 1;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (char_num > 0 && match == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfz_text_span *span2 = span;\n\t\t\t\t\t\t\tint char_num2;\n\t\t\t\t\t\t\tfor (char_num2 = 0; char_num2 < char_num; char_num2++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfz_text_char *chr2 = &span2->text[char_num2];\n\t\t\t\t\t\t\t\tif (chr2->style == chr->style)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmatch = 1;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (match == 0)\n\t\t\t\t\t\t\tinsert_line_height(lh, chr->style, line->distance);\n\t\t\t\t\t\tstyle = chr->style;\n\t\t\t\t\t}\n\t\t\t\t}\nlist_entry:\n\t\t\t\t{}\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Step 2: Find the most popular line height for each style */\n\tcull_line_heights(lh);\n\n\t/* Step 3: Run through the blocks, breaking each block into two if\n\t * the line height isn't right. */\n\tfor (block_num = 0; block_num < page->len; block_num++)\n\t{\n\t\tint line_num;\n\t\tfz_text_block *block;\n\n\t\tif (page->blocks[block_num].type != FZ_PAGE_BLOCK_TEXT)\n\t\t\tcontinue;\n\t\tblock = page->blocks[block_num].u.text;\n\n\t\tfor (line_num = 0; line_num < block->len; line_num++)\n\t\t{\n\t\t\t/* For every style in the line, check to see if lineheight\n\t\t\t * is correct for that style. FIXME: We check each style\n\t\t\t * more than once, currently. */\n\t\t\tint ok = 0; /* -1 = early exit, split now. 0 = split. 1 = don't split. */\n\t\t\tfz_text_style *style = NULL;\n\t\t\tline = &block->lines[line_num];\n\n\t\t\tif (line->distance == 0)\n\t\t\t\tcontinue;\n\n#ifdef DEBUG_LINE_HEIGHTS\n\t\t\tprintf(\"line height=%g\\n\", line->distance);\n#endif\n\t\t\tfor (span = line->first_span; span; span = span->next)\n\t\t\t{\n\t\t\t\tint char_num;\n\n\t\t\t\tif (is_list_entry(line, span, &char_num))\n\t\t\t\t\tgoto force_paragraph;\n\n\t\t\t\t/* Now we do the rest of the line */\n\t\t\t\tfor (; char_num < span->len; char_num++)\n\t\t\t\t{\n\t\t\t\t\tfz_text_char *chr = &span->text[char_num];\n\n\t\t\t\t\t/* Ignore any whitespace chars */\n\t\t\t\t\tif (is_unicode_wspace(chr->c))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (chr->style != style)\n\t\t\t\t\t{\n\t\t\t\t\t\tfloat proper_step = line_height_for_style(lh, chr->style);\n\t\t\t\t\t\tif (proper_step * 0.95 <= line->distance && line->distance <= proper_step * 1.05)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tok = 1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstyle = chr->style;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (ok)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!ok)\n\t\t\t{\nforce_paragraph:\n\t\t\t\tsplit_block(ctx, page, block_num, line_num);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tfree_line_heights(lh);\n\n\t/* Simple line region analysis:\n\t * For each line:\n\t *\tform a list of 'start/stop' points (henceforth a 'region mask')\n\t *\tfind the normalised baseline vector for the line.\n\t *\tStore the region mask and baseline vector.\n\t * Collate lines that have compatible region masks and identical\n\t * baseline vectors.\n\t * If the collated masks are column-like, then split into columns.\n\t * Otherwise split into tables.\n\t */\n\trms = new_region_masks(ctx);\n\n\t/* Step 1: Form the region masks and store them into a list with the\n\t * normalised baseline vectors. */\n\tfor (block_num = 0; block_num < page->len; block_num++)\n\t{\n\t\tfz_text_block *block;\n\n\t\tif (page->blocks[block_num].type != FZ_PAGE_BLOCK_TEXT)\n\t\t\tcontinue;\n\t\tblock = page->blocks[block_num].u.text;\n\n\t\tfor (line = block->lines; line < block->lines + block->len; line++)\n\t\t{\n\t\t\tfz_point blv;\n\t\t\tregion_mask *rm;\n\n#ifdef DEBUG_MASKS\n\t\t\tprintf(\"Line: \");\n\t\t\tdump_line(line);\n#endif\n\t\t\tblv = line->first_span->max;\n\t\t\tblv.x -= line->first_span->min.x;\n\t\t\tblv.y -= line->first_span->min.y;\n\t\t\tfz_normalize_vector(&blv);\n\n\t\t\trm = new_region_mask(ctx, &blv);\n\t\t\tfor (span = line->first_span; span; span = span->next)\n\t\t\t{\n\t\t\t\tfz_point *region_min = &span->min;\n\t\t\t\tfz_point *region_max = &span->max;\n\n\t\t\t\t/* Treat adjacent spans as one big region */\n\t\t\t\twhile (span->next && span->next->spacing < 1.5)\n\t\t\t\t{\n\t\t\t\t\tspan = span->next;\n\t\t\t\t\tregion_max = &span->max;\n\t\t\t\t}\n\n\t\t\t\tregion_mask_add(rm, region_min, region_max);\n\t\t\t}\n#ifdef DEBUG_MASKS\n\t\t\tdump_region_mask(rm);\n#endif\n\t\t\tregion_masks_add(rms, rm);\n\t\t}\n\t}\n\n\t/* Step 2: Sort the region_masks by size of masked region */\n\tregion_masks_sort(rms);\n\n#ifdef DEBUG_MASKS\n\tprintf(\"Sorted list of regions:\\n\");\n\tdump_region_masks(rms);\n#endif\n\t/* Step 3: Merge the region masks where possible (large ones first) */\n\t{\n\t\tint i;\n\t\tregion_masks *rms2;\n\t\trms2 = new_region_masks(ctx);\n\t\tfor (i=0; i < rms->len; i++)\n\t\t{\n\t\t\tregion_mask *rm = rms->mask[i];\n\t\t\trms->mask[i] = NULL;\n\t\t\tregion_masks_merge(rms2, rm);\n\t\t}\n\t\tfree_region_masks(rms);\n\t\trms = rms2;\n\t}\n\n#ifdef DEBUG_MASKS\n\tprintf(\"Merged list of regions:\\n\");\n\tdump_region_masks(rms);\n#endif\n\n\t/* Step 4: Figure out alignment */\n\tregion_masks_alignment(rms);\n\n\t/* Step 5: At this point, we should probably look at the region masks\n\t * to try to guess which ones represent columns on the page. With our\n\t * current code, we could only get blocks of lines that span 2 or more\n\t * columns if the PDF producer wrote text out horizontally across 2\n\t * or more columns, and we've never seen that (yet!). So we skip this\n\t * step for now. */\n\n\t/* Step 6: Run through the lines again, deciding which ones fit into\n\t * which region mask. */\n\t{\n\tregion_mask *prev_match = NULL;\n\tfor (block_num = 0; block_num < page->len; block_num++)\n\t{\n\t\tfz_text_block *block;\n\n\t\tif (page->blocks[block_num].type != FZ_PAGE_BLOCK_TEXT)\n\t\t\tcontinue;\n\t\tblock = page->blocks[block_num].u.text;\n\n\t\tfor (line = block->lines; line < block->lines + block->len; line++)\n\t\t{\n\t\t\tfz_point blv;\n\t\t\tregion_mask *rm;\n\t\t\tregion_mask *match;\n\n\t\t\tblv = line->first_span->max;\n\t\t\tblv.x -= line->first_span->min.x;\n\t\t\tblv.y -= line->first_span->min.y;\n\t\t\tfz_normalize_vector(&blv);\n\n#ifdef DEBUG_MASKS\n\t\t\tdump_line(line);\n#endif\n\t\t\trm = new_region_mask(ctx, &blv);\n\t\t\tfor (span = line->first_span; span; span = span->next)\n\t\t\t{\n\t\t\t\tfz_point *region_min = &span->min;\n\t\t\t\tfz_point *region_max = &span->max;\n\n\t\t\t\t/* Treat adjacent spans as one big region */\n\t\t\t\twhile (span->next && span->next->spacing < 1.5)\n\t\t\t\t{\n\t\t\t\t\tspan = span->next;\n\t\t\t\t\tregion_max = &span->max;\n\t\t\t\t}\n\n\t\t\t\tregion_mask_add(rm, region_min, region_max);\n\t\t\t}\n#ifdef DEBUG_MASKS\n\t\t\tprintf(\"Mask: \");\n\t\t\tdump_region_mask(rm);\n#endif\n\t\t\tmatch = region_masks_match(rms, rm, line, prev_match);\n\t\t\tprev_match = match;\n#ifdef DEBUG_MASKS\n\t\t\tprintf(\"Matches: \");\n\t\t\tdump_region_mask(match);\n#endif\n\t\t\tfree_region_mask(rm);\n\t\t\tspan = line->first_span;\n\t\t\twhile (span)\n\t\t\t{\n\t\t\t\tfz_point *region_min = &span->min;\n\t\t\t\tfz_point *region_max = &span->max;\n\t\t\t\tfz_text_span *sn;\n\t\t\t\tint col, align;\n\t\t\t\tfloat colw, left;\n\n\t\t\t\t/* Treat adjacent spans as one big region */\n#ifdef DEBUG_ALIGN\n\t\t\t\tdump_span(span);\n#endif\n\t\t\t\tfor (sn = span->next; sn && sn->spacing < 1.5; sn = sn->next)\n\t\t\t\t{\n\t\t\t\t\tregion_max = &sn->max;\n#ifdef DEBUG_ALIGN\n\t\t\t\t\tdump_span(sn);\n#endif\n\t\t\t\t}\n\t\t\t\tcol = region_mask_column(match, region_min, region_max, &align, &colw, &left);\n#ifdef DEBUG_ALIGN\n\t\t\t\tprintf(\" = col%d colw=%g align=%d\\n\", col, colw, align);\n#endif\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tspan->column = col;\n\t\t\t\t\tspan->align = align;\n\t\t\t\t\tspan->indent = left;\n\t\t\t\t\tspan->column_width = colw;\n\t\t\t\t\tspan = span->next;\n\t\t\t\t}\n\t\t\t\twhile (span != sn);\n\n\t\t\t\tif (span)\n\t\t\t\t\tspan = span->next;\n\t\t\t}\n\t\t\tline->region = match;\n\t\t}\n\t}\n\tfree_region_masks(rms);\n\t}\n\n\t/* Step 7: Collate lines within a block that share the same region\n\t * mask. */\n\tfor (block_num = 0; block_num < page->len; block_num++)\n\t{\n\t\tint line_num;\n\t\tint prev_line_num;\n\n\t\tfz_text_block *block;\n\n\t\tif (page->blocks[block_num].type != FZ_PAGE_BLOCK_TEXT)\n\t\t\tcontinue;\n\t\tblock = page->blocks[block_num].u.text;\n\n\t\t/* First merge lines. This may leave empty lines behind. */\n\t\tfor (prev_line_num = 0, line_num = 1; line_num < block->len; line_num++)\n\t\t{\n\t\t\tfz_text_line *prev_line;\n\t\t\tline = &block->lines[line_num];\n\t\t\tif (!line->first_span)\n\t\t\t\tcontinue;\n\t\t\tprev_line = &block->lines[prev_line_num];\n\t\t\tif (prev_line->region == line->region)\n\t\t\t{\n\t\t\t\t/* We only merge lines if the second line\n\t\t\t\t * only uses 1 of the columns. */\n\t\t\t\tint col = line->first_span->column;\n\t\t\t\t/* Copy the left value for the first span\n\t\t\t\t * in the first column in this line forward\n\t\t\t\t * for all the rest of the spans in the same\n\t\t\t\t * column. */\n\t\t\t\tfloat indent = line->first_span->indent;\n\t\t\t\tfor (span = line->first_span->next; span; span = span->next)\n\t\t\t\t{\n\t\t\t\t\tif (col != span->column)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tspan->indent = indent;\n\t\t\t\t}\n\t\t\t\tif (span)\n\t\t\t\t{\n\t\t\t\t\tprev_line_num = line_num;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t/* Merge line into prev_line */\n\t\t\t\t{\n\t\t\t\t\tfz_text_span **prev_line_span = &prev_line->first_span;\n\t\t\t\t\tint try_dehyphen = -1;\n\t\t\t\t\tfz_text_span *prev_span = NULL;\n\t\t\t\t\tspan = line->first_span;\n\t\t\t\t\twhile (span && *prev_line_span)\n\t\t\t\t\t{\n\t\t\t\t\t\t/* Skip forwards through the original\n\t\t\t\t\t\t * line, until we find a place where\n\t\t\t\t\t\t * span should go. */\n\t\t\t\t\t\tif ((*prev_line_span)->column <= span->column)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/* The current span we are considering\n\t\t\t\t\t\t\t * in prev_line is earlier than span.\n\t\t\t\t\t\t\t * Just skip forwards in prev_line. */\n\t\t\t\t\t\t\tprev_span = (*prev_line_span);\n\t\t\t\t\t\t\tprev_line_span = &prev_span->next;\n\t\t\t\t\t\t\ttry_dehyphen = span->column;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/* We want to copy span into prev_line. */\n\t\t\t\t\t\t\tfz_text_span *next = (*prev_line_span)->next;\n\n\t\t\t\t\t\t\tif (prev_line_span == &prev_line->first_span)\n\t\t\t\t\t\t\t\tprev_line->first_span = span;\n\t\t\t\t\t\t\tif (next == NULL)\n\t\t\t\t\t\t\t\tprev_line->last_span = span;\n\t\t\t\t\t\t\tif (try_dehyphen == span->column)\n\t\t\t\t\t\t\t\tdehyphenate(prev_span, span);\n\t\t\t\t\t\t\ttry_dehyphen = -1;\n\t\t\t\t\t\t\tprev_span = *prev_line_span = span;\n\t\t\t\t\t\t\tspan = span->next;\n\t\t\t\t\t\t\t(*prev_line_span)->next = next;\n\t\t\t\t\t\t\tprev_line_span = &(*prev_line_span)->next;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (span)\n\t\t\t\t\t{\n\t\t\t\t\t\t*prev_line_span = span;\n\t\t\t\t\t\tprev_line->last_span = line->last_span;\n\t\t\t\t\t}\n\n\t\t\t\t\tline->first_span = NULL;\n\t\t\t\t\tline->last_span = NULL;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\tprev_line_num = line_num;\n\t\t}\n\n\t\t/* Now get rid of the empty lines */\n\t\tfor (prev_line_num = 0, line_num = 0; line_num < block->len; line_num++)\n\t\t{\n\t\t\tline = &block->lines[line_num];\n\t\t\tif (line->first_span)\n\t\t\t\tblock->lines[prev_line_num++] = *line;\n\t\t}\n\t\tblock->len = prev_line_num;\n\n\t\t/* Now try to spot indents */\n\t\tfor (line_num = 0; line_num < block->len; line_num++)\n\t\t{\n\t\t\tfz_text_span *span_num, *sn;\n\t\t\tint col, count;\n\t\t\tline = &block->lines[line_num];\n\n\t\t\t/* Run through the spans... */\n\t\t\tspan_num = line->first_span;\n\t\t\t{\n\t\t\t\tfloat indent = 0;\n\t\t\t\t/* For each set of spans that share the same\n\t\t\t\t * column... */\n\t\t\t\tcol = span_num->column;\n#ifdef DEBUG_INDENTS\n\t\t\t\tprintf(\"Indent %g: \", span_num->indent);\n\t\t\t\tdump_span(span_num);\n\t\t\t\tprintf(\"\\n\");\n#endif\n\n\t\t\t\t/* find the average indent of all but the first.. */\n\t\t\t\tfor (sn = span_num->next, count = 0; sn && sn->column == col; sn = sn->next, count++)\n\t\t\t\t{\n#ifdef DEBUG_INDENTS\n\t\t\t\t\tprintf(\"Indent %g: \", sn->indent);\n\t\t\t\t\tdump_span(sn);\n\t\t\t\tprintf(\"\\n\");\n#endif\n\t\t\t\t\tindent += sn->indent;\n\t\t\t\t\tsn->indent = 0;\n\t\t\t\t}\n\t\t\t\tif (sn != span_num->next)\n\t\t\t\t\tindent /= count;\n\n\t\t\t\t/* And compare this indent with the first one... */\n#ifdef DEBUG_INDENTS\n\t\t\t\tprintf(\"Average indent %g \", indent);\n#endif\n\t\t\t\tindent -= span_num->indent;\n#ifdef DEBUG_INDENTS\n\t\t\t\tprintf(\"delta %g \", indent);\n#endif\n\t\t\t\tif (fabsf(indent) < 1)\n\t\t\t\t{\n\t\t\t\t\t/* No indent worth speaking of */\n\t\t\t\t\tindent = 0;\n\t\t\t\t}\n#ifdef DEBUG_INDENTS\n\t\t\t\tprintf(\"recorded %g\\n\", indent);\n#endif\n\t\t\t\tspan_num->indent = indent;\n\t\t\t\tspan_num = sn;\n\t\t\t}\n\t\t\tfor (; span_num; span_num = span_num->next)\n\t\t\t{\n\t\t\t\tspan_num->indent = 0;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/fitz/stext-search.c",
    "content": "#include \"mupdf/fitz.h\"\n\nstatic inline int fz_tolower(int c)\n{\n\t/* TODO: proper unicode case folding */\n\t/* TODO: character equivalence (a matches ä, etc) */\n\tif (c >= 'A' && c <= 'Z')\n\t\treturn c - 'A' + 'a';\n\treturn c;\n}\n\nstatic inline int iswhite(int c)\n{\n\treturn c == ' ' || c == '\\r' || c == '\\n' || c == '\\t' || c == 0xA0 || c == 0x2028 || c == 0x2029;\n}\n\nfz_char_and_box *fz_text_char_at(fz_char_and_box *cab, fz_text_page *page, int idx)\n{\n\tint block_num;\n\tint ofs = 0;\n\n\tfor (block_num = 0; block_num < page->len; block_num++)\n\t{\n\t\tfz_text_block *block;\n\t\tfz_text_line *line;\n\t\tfz_text_span *span;\n\n\t\tif (page->blocks[block_num].type != FZ_PAGE_BLOCK_TEXT)\n\t\t\tcontinue;\n\t\tblock = page->blocks[block_num].u.text;\n\t\tfor (line = block->lines; line < block->lines + block->len; line++)\n\t\t{\n\t\t\tfor (span = line->first_span; span; span = span->next)\n\t\t\t{\n\t\t\t\tif (idx < ofs + span->len)\n\t\t\t\t{\n\t\t\t\t\tcab->c = span->text[idx - ofs].c;\n\t\t\t\t\tfz_text_char_bbox(&cab->bbox, span, idx - ofs);\n\t\t\t\t\treturn cab;\n\t\t\t\t}\n\t\t\t\tofs += span->len;\n\t\t\t}\n\t\t\t/* pseudo-newline */\n\t\t\tif (idx == ofs)\n\t\t\t{\n\t\t\t\tcab->bbox = fz_empty_rect;\n\t\t\t\tcab->c = ' ';\n\t\t\t\treturn cab;\n\t\t\t}\n\t\t\tofs++;\n\t\t}\n\t}\n\tcab->bbox = fz_empty_rect;\n\tcab->c = 0;\n\treturn cab;\n}\n\nstatic int charat(fz_text_page *page, int idx)\n{\n\tfz_char_and_box cab;\n\treturn fz_text_char_at(&cab, page, idx)->c;\n}\n\nstatic fz_rect *bboxat(fz_text_page *page, int idx, fz_rect *bbox)\n{\n\tfz_char_and_box cab;\n\t/* FIXME: Nasty extra copy */\n\t*bbox = fz_text_char_at(&cab, page, idx)->bbox;\n\treturn bbox;\n}\n\nstatic int textlen(fz_text_page *page)\n{\n\tint len = 0;\n\tint block_num;\n\n\tfor (block_num = 0; block_num < page->len; block_num++)\n\t{\n\t\tfz_text_block *block;\n\t\tfz_text_line *line;\n\t\tfz_text_span *span;\n\n\t\tif (page->blocks[block_num].type != FZ_PAGE_BLOCK_TEXT)\n\t\t\tcontinue;\n\t\tblock = page->blocks[block_num].u.text;\n\t\tfor (line = block->lines; line < block->lines + block->len; line++)\n\t\t{\n\t\t\tfor (span = line->first_span; span; span = span->next)\n\t\t\t{\n\t\t\t\tlen += span->len;\n\t\t\t}\n\t\t\tlen++; /* pseudo-newline */\n\t\t}\n\t}\n\treturn len;\n}\n\nstatic int match(fz_text_page *page, const char *s, int n)\n{\n\tint orig = n;\n\tint c;\n\twhile (*s)\n\t{\n\t\ts += fz_chartorune(&c, (char *)s);\n\t\tif (iswhite(c) && iswhite(charat(page, n)))\n\t\t{\n\t\t\tconst char *s_next;\n\n\t\t\t/* Skip over whitespace in the document */\n\t\t\tdo\n\t\t\t\tn++;\n\t\t\twhile (iswhite(charat(page, n)));\n\n\t\t\t/* Skip over multiple whitespace in the search string */\n\t\t\twhile (s_next = s + fz_chartorune(&c, (char *)s), iswhite(c))\n\t\t\t\ts = s_next;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (fz_tolower(c) != fz_tolower(charat(page, n)))\n\t\t\t\treturn 0;\n\t\t\tn++;\n\t\t}\n\t}\n\treturn n - orig;\n}\n\nint\nfz_search_text_page(fz_context *ctx, fz_text_page *text, const char *needle, fz_rect *hit_bbox, int hit_max)\n{\n\tint pos, len, i, n, hit_count;\n\n\tif (strlen(needle) == 0)\n\t\treturn 0;\n\n\thit_count = 0;\n\tlen = textlen(text);\n\tfor (pos = 0; pos < len; pos++)\n\t{\n\t\tn = match(text, needle, pos);\n\t\tif (n)\n\t\t{\n\t\t\tfz_rect linebox = fz_empty_rect;\n\t\t\tfor (i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\tfz_rect charbox;\n\t\t\t\tbboxat(text, pos + i, &charbox);\n\t\t\t\tif (!fz_is_empty_rect(&charbox))\n\t\t\t\t{\n\t\t\t\t\tif (charbox.y0 != linebox.y0 || fz_abs(charbox.x0 - linebox.x1) > 5)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!fz_is_empty_rect(&linebox) && hit_count < hit_max)\n\t\t\t\t\t\t\thit_bbox[hit_count++] = linebox;\n\t\t\t\t\t\tlinebox = charbox;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfz_union_rect(&linebox, &charbox);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!fz_is_empty_rect(&linebox) && hit_count < hit_max)\n\t\t\t\thit_bbox[hit_count++] = linebox;\n\t\t}\n\t}\n\n\treturn hit_count;\n}\n\nint\nfz_highlight_selection(fz_context *ctx, fz_text_page *page, fz_rect rect, fz_rect *hit_bbox, int hit_max)\n{\n\tfz_rect linebox, charbox;\n\tfz_text_block *block;\n\tfz_text_line *line;\n\tfz_text_span *span;\n\tint i, block_num, hit_count;\n\n\tfloat x0 = rect.x0;\n\tfloat x1 = rect.x1;\n\tfloat y0 = rect.y0;\n\tfloat y1 = rect.y1;\n\n\thit_count = 0;\n\n\tfor (block_num = 0; block_num < page->len; block_num++)\n\t{\n\t\tif (page->blocks[block_num].type != FZ_PAGE_BLOCK_TEXT)\n\t\t\tcontinue;\n\t\tblock = page->blocks[block_num].u.text;\n\t\tfor (line = block->lines; line < block->lines + block->len; line++)\n\t\t{\n\t\t\tlinebox = fz_empty_rect;\n\t\t\tfor (span = line->first_span; span; span = span->next)\n\t\t\t{\n\t\t\t\tfor (i = 0; i < span->len; i++)\n\t\t\t\t{\n\t\t\t\t\tfz_text_char_bbox(&charbox, span, i);\n\t\t\t\t\tif (charbox.x1 >= x0 && charbox.x0 <= x1 && charbox.y1 >= y0 && charbox.y0 <= y1)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (charbox.y0 != linebox.y0 || fz_abs(charbox.x0 - linebox.x1) > 5)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!fz_is_empty_rect(&linebox) && hit_count < hit_max)\n\t\t\t\t\t\t\t\thit_bbox[hit_count++] = linebox;\n\t\t\t\t\t\t\tlinebox = charbox;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfz_union_rect(&linebox, &charbox);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!fz_is_empty_rect(&linebox) && hit_count < hit_max)\n\t\t\t\thit_bbox[hit_count++] = linebox;\n\t\t}\n\t}\n\n\treturn hit_count;\n}\n\nchar *\nfz_copy_selection(fz_context *ctx, fz_text_page *page, fz_rect rect)\n{\n\tfz_buffer *buffer;\n\tfz_rect hitbox;\n\tint c, i, block_num, seen = 0;\n\tchar *s;\n\n\tfloat x0 = rect.x0;\n\tfloat x1 = rect.x1;\n\tfloat y0 = rect.y0;\n\tfloat y1 = rect.y1;\n\n\tbuffer = fz_new_buffer(ctx, 1024);\n\n\tfor (block_num = 0; block_num < page->len; block_num++)\n\t{\n\t\tfz_text_block *block;\n\t\tfz_text_line *line;\n\t\tfz_text_span *span;\n\n\t\tif (page->blocks[block_num].type != FZ_PAGE_BLOCK_TEXT)\n\t\t\tcontinue;\n\t\tblock = page->blocks[block_num].u.text;\n\t\tfor (line = block->lines; line < block->lines + block->len; line++)\n\t\t{\n\t\t\tfor (span = line->first_span; span; span = span->next)\n\t\t\t{\n\t\t\t\tif (seen)\n\t\t\t\t{\n\t\t\t\t\tfz_write_buffer_byte(ctx, buffer, '\\n');\n\t\t\t\t}\n\n\t\t\t\tseen = 0;\n\n\t\t\t\tfor (i = 0; i < span->len; i++)\n\t\t\t\t{\n\t\t\t\t\tfz_text_char_bbox(&hitbox, span, i);\n\t\t\t\t\tc = span->text[i].c;\n\t\t\t\t\tif (c < 32)\n\t\t\t\t\t\tc = '?';\n\t\t\t\t\tif (hitbox.x1 >= x0 && hitbox.x0 <= x1 && hitbox.y1 >= y0 && hitbox.y0 <= y1)\n\t\t\t\t\t{\n\t\t\t\t\t\tfz_write_buffer_rune(ctx, buffer, c);\n\t\t\t\t\t\tseen = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tseen = (seen && span == line->last_span);\n\t\t\t}\n\t\t}\n\t}\n\n\tfz_write_buffer_byte(ctx, buffer, 0);\n\n\ts = (char*)buffer->data;\n\tfz_free(ctx, buffer);\n\treturn s;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/store.c",
    "content": "#include \"mupdf/fitz.h\"\n\ntypedef struct fz_item_s fz_item;\n\nstruct fz_item_s\n{\n\tvoid *key;\n\tfz_storable *val;\n\tunsigned int size;\n\tfz_item *next;\n\tfz_item *prev;\n\tfz_store *store;\n\tfz_store_type *type;\n};\n\nstruct fz_store_s\n{\n\tint refs;\n\n\t/* Every item in the store is kept in a doubly linked list, ordered\n\t * by usage (so LRU entries are at the end). */\n\tfz_item *head;\n\tfz_item *tail;\n\n\t/* We have a hash table that allows to quickly find a subset of the\n\t * entries (those whose keys are indirect objects). */\n\tfz_hash_table *hash;\n\n\t/* We keep track of the size of the store, and keep it below max. */\n\tunsigned int max;\n\tunsigned int size;\n};\n\nvoid\nfz_new_store_context(fz_context *ctx, unsigned int max)\n{\n\tfz_store *store;\n\tstore = fz_malloc_struct(ctx, fz_store);\n\tfz_try(ctx)\n\t{\n\t\tstore->hash = fz_new_hash_table(ctx, 4096, sizeof(fz_store_hash), FZ_LOCK_ALLOC);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, store);\n\t\tfz_rethrow(ctx);\n\t}\n\tstore->refs = 1;\n\tstore->head = NULL;\n\tstore->tail = NULL;\n\tstore->size = 0;\n\tstore->max = max;\n\tctx->store = store;\n}\n\nvoid *\nfz_keep_storable(fz_context *ctx, fz_storable *s)\n{\n\tif (s == NULL)\n\t\treturn NULL;\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tif (s->refs > 0)\n\t\ts->refs++;\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\treturn s;\n}\n\nvoid\nfz_drop_storable(fz_context *ctx, fz_storable *s)\n{\n\tint do_free = 0;\n\n\tif (s == NULL)\n\t\treturn;\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tif (s->refs < 0)\n\t{\n\t\t/* It's a static object. Dropping does nothing. */\n\t}\n\telse if (--s->refs == 0)\n\t{\n\t\t/* If we are dropping the last reference to an object, then\n\t\t * it cannot possibly be in the store (as the store always\n\t\t * keeps a ref to everything in it, and doesn't drop via\n\t\t * this method. So we can simply drop the storable object\n\t\t * itself without any operations on the fz_store. */\n\t\tdo_free = 1;\n\t}\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\tif (do_free)\n\t\ts->free(ctx, s);\n}\n\nstatic void\nevict(fz_context *ctx, fz_item *item)\n{\n\tfz_store *store = ctx->store;\n\tint drop;\n\n\tstore->size -= item->size;\n\t/* Unlink from the linked list */\n\tif (item->next)\n\t\titem->next->prev = item->prev;\n\telse\n\t\tstore->tail = item->prev;\n\tif (item->prev)\n\t\titem->prev->next = item->next;\n\telse\n\t\tstore->head = item->next;\n\t/* Drop a reference to the value (freeing if required) */\n\tdrop = (item->val->refs > 0 && --item->val->refs == 0);\n\t/* Remove from the hash table */\n\tif (item->type->make_hash_key)\n\t{\n\t\tfz_store_hash hash = { NULL };\n\t\thash.free = item->val->free;\n\t\tif (item->type->make_hash_key(&hash, item->key))\n\t\t\tfz_hash_remove(ctx, store->hash, &hash);\n\t}\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\tif (drop)\n\t\titem->val->free(ctx, item->val);\n\t/* Always drops the key and free the item */\n\titem->type->drop_key(ctx, item->key);\n\tfz_free(ctx, item);\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n}\n\nstatic int\nensure_space(fz_context *ctx, unsigned int tofree)\n{\n\tfz_item *item, *prev;\n\tunsigned int count;\n\tfz_store *store = ctx->store;\n\n\tfz_assert_lock_held(ctx, FZ_LOCK_ALLOC);\n\n\t/* First check that we *can* free tofree; if not, we'd rather not\n\t * cache this. */\n\tcount = 0;\n\tfor (item = store->tail; item; item = item->prev)\n\t{\n\t\tif (item->val->refs == 1)\n\t\t{\n\t\t\tcount += item->size;\n\t\t\tif (count >= tofree)\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/* If we ran out of items to search, then we can never free enough */\n\tif (item == NULL)\n\t{\n\t\treturn 0;\n\t}\n\n\t/* Actually free the items */\n\tcount = 0;\n\tfor (item = store->tail; item; item = prev)\n\t{\n\t\tprev = item->prev;\n\t\tif (item->val->refs == 1)\n\t\t{\n\t\t\t/* Free this item. Evict has to drop the lock to\n\t\t\t * manage that, which could cause prev to be removed\n\t\t\t * in the meantime. To avoid that we bump its reference\n\t\t\t * count here. This may cause another simultaneous\n\t\t\t * evict process to fail to make enough space as prev is\n\t\t\t * pinned - but that will only happen if we're near to\n\t\t\t * the limit anyway, and it will only cause something to\n\t\t\t * not be cached. */\n\t\t\tcount += item->size;\n\t\t\tif (prev)\n\t\t\t\tprev->val->refs++;\n\t\t\tevict(ctx, item); /* Drops then retakes lock */\n\t\t\t/* So the store has 1 reference to prev, as do we, so\n\t\t\t * no other evict process can have thrown prev away in\n\t\t\t * the meantime. So we are safe to just decrement its\n\t\t\t * reference count here. */\n\t\t\tif (prev)\n\t\t\t\t--prev->val->refs;\n\n\t\t\tif (count >= tofree)\n\t\t\t\treturn count;\n\t\t}\n\t}\n\n\treturn count;\n}\n\nstatic void\ntouch(fz_store *store, fz_item *item)\n{\n\tif (item->next != item)\n\t{\n\t\t/* Already in the list - unlink it */\n\t\tif (item->next)\n\t\t\titem->next->prev = item->prev;\n\t\telse\n\t\t\tstore->tail = item->prev;\n\t\tif (item->prev)\n\t\t\titem->prev->next = item->next;\n\t\telse\n\t\t\tstore->head = item->next;\n\t}\n\t/* Now relink it at the start of the LRU chain */\n\titem->next = store->head;\n\tif (item->next)\n\t\titem->next->prev = item;\n\telse\n\t\tstore->tail = item;\n\tstore->head = item;\n\titem->prev = NULL;\n}\n\nvoid *\nfz_store_item(fz_context *ctx, void *key, void *val_, unsigned int itemsize, fz_store_type *type)\n{\n\tfz_item *item = NULL;\n\tunsigned int size;\n\tfz_storable *val = (fz_storable *)val_;\n\tfz_store *store = ctx->store;\n\tfz_store_hash hash = { NULL };\n\tint use_hash = 0;\n\tunsigned pos;\n\n\tif (!store)\n\t\treturn NULL;\n\n\tfz_var(item);\n\n\tif (store->max != FZ_STORE_UNLIMITED && store->max < itemsize)\n\t{\n\t\t/* Our item would take up more room than we can ever\n\t\t * possibly have in the store. Just give up now. */\n\t\treturn NULL;\n\t}\n\n\t/* If we fail for any reason, we swallow the exception and continue.\n\t * All that the above program will see is that we failed to store\n\t * the item. */\n\tfz_try(ctx)\n\t{\n\t\titem = fz_malloc_struct(ctx, fz_item);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\treturn NULL;\n\t}\n\n\tif (type->make_hash_key)\n\t{\n\t\thash.free = val->free;\n\t\tuse_hash = type->make_hash_key(&hash, key);\n\t}\n\n\ttype->keep_key(ctx, key);\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\n\t/* Fill out the item. To start with, we always set item->next == item\n\t * and item->prev == item. This is so that we can spot items that have\n\t * been put into the hash table without having made it into the linked\n\t * list yet. */\n\titem->key = key;\n\titem->val = val;\n\titem->size = itemsize;\n\titem->next = item;\n\titem->prev = item;\n\titem->type = type;\n\n\t/* If we can index it fast, put it into the hash table. This serves\n\t * to check whether we have one there already. */\n\tif (use_hash)\n\t{\n\t\tfz_item *existing;\n\n\t\tfz_try(ctx)\n\t\t{\n\t\t\t/* May drop and retake the lock */\n\t\t\texisting = fz_hash_insert_with_pos(ctx, store->hash, &hash, item, &pos);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\t/* Any error here means that item never made it into the\n\t\t\t * hash - so no one else can have a reference. */\n\t\t\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\t\t\tfz_free(ctx, item);\n\t\t\ttype->drop_key(ctx, key);\n\t\t\treturn NULL;\n\t\t}\n\t\tif (existing)\n\t\t{\n\t\t\t/* There was one there already! Take a new reference\n\t\t\t * to the existing one, and drop our current one. */\n\t\t\ttouch(store, existing);\n\t\t\tif (existing->val->refs > 0)\n\t\t\t\texisting->val->refs++;\n\t\t\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\t\t\tfz_free(ctx, item);\n\t\t\ttype->drop_key(ctx, key);\n\t\t\treturn existing->val;\n\t\t}\n\t}\n\t/* Now bump the ref */\n\tif (val->refs > 0)\n\t\tval->refs++;\n\t/* If we haven't got an infinite store, check for space within it */\n\tif (store->max != FZ_STORE_UNLIMITED)\n\t{\n\t\tsize = store->size + itemsize;\n\t\twhile (size > store->max)\n\t\t{\n\t\t\t/* ensure_space may drop, then retake the lock */\n\t\t\tint saved = ensure_space(ctx, size - store->max);\n\t\t\tif (saved == 0)\n\t\t\t{\n\t\t\t\t/* Failed to free any space. */\n\t\t\t\t/* If we are using the hash table, then we've already\n\t\t\t\t * inserted item - remove it. */\n\t\t\t\tif (use_hash)\n\t\t\t\t{\n\t\t\t\t\t/* If someone else has already picked up a reference\n\t\t\t\t\t * to item, then we cannot remove it. Leave it in the\n\t\t\t\t\t * store, and we'll live with being over budget. We\n\t\t\t\t\t * know this is the case, if it's in the linked list. */\n\t\t\t\t\tif (item->next != item)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tfz_hash_remove_fast(ctx, store->hash, &hash, pos);\n\t\t\t\t}\n\t\t\t\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\t\t\t\tfz_free(ctx, item);\n\t\t\t\ttype->drop_key(ctx, key);\n\t\t\t\tif (val->refs > 0)\n\t\t\t\t\tval->refs--;\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tsize -= saved;\n\t\t}\n\t}\n\tstore->size += itemsize;\n\n\t/* Regardless of whether it's indexed, it goes into the linked list */\n\ttouch(store, item);\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\n\treturn NULL;\n}\n\nvoid *\nfz_find_item(fz_context *ctx, fz_store_free_fn *free, void *key, fz_store_type *type)\n{\n\tfz_item *item;\n\tfz_store *store = ctx->store;\n\tfz_store_hash hash = { NULL };\n\tint use_hash = 0;\n\n\tif (!store)\n\t\treturn NULL;\n\n\tif (!key)\n\t\treturn NULL;\n\n\tif (type->make_hash_key)\n\t{\n\t\thash.free = free;\n\t\tuse_hash = type->make_hash_key(&hash, key);\n\t}\n\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tif (use_hash)\n\t{\n\t\t/* We can find objects keyed on indirected objects quickly */\n\t\titem = fz_hash_find(ctx, store->hash, &hash);\n\t}\n\telse\n\t{\n\t\t/* Others we have to hunt for slowly */\n\t\tfor (item = store->head; item; item = item->next)\n\t\t{\n\t\t\tif (item->val->free == free && !type->cmp_key(item->key, key))\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tif (item)\n\t{\n\t\t/* LRU the block. This also serves to ensure that any item\n\t\t * picked up from the hash before it has made it into the\n\t\t * linked list does not get whipped out again due to the\n\t\t * store being full. */\n\t\ttouch(store, item);\n\t\t/* And bump the refcount before returning */\n\t\tif (item->val->refs > 0)\n\t\t\titem->val->refs++;\n\t\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\t\treturn (void *)item->val;\n\t}\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\n\treturn NULL;\n}\n\nvoid\nfz_remove_item(fz_context *ctx, fz_store_free_fn *free, void *key, fz_store_type *type)\n{\n\tfz_item *item;\n\tfz_store *store = ctx->store;\n\tint drop;\n\tfz_store_hash hash = { NULL };\n\tint use_hash = 0;\n\n\tif (type->make_hash_key)\n\t{\n\t\thash.free = free;\n\t\tuse_hash = type->make_hash_key(&hash, key);\n\t}\n\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tif (use_hash)\n\t{\n\t\t/* We can find objects keyed on indirect objects quickly */\n\t\titem = fz_hash_find(ctx, store->hash, &hash);\n\t\tif (item)\n\t\t\tfz_hash_remove(ctx, store->hash, &hash);\n\t}\n\telse\n\t{\n\t\t/* Others we have to hunt for slowly */\n\t\tfor (item = store->head; item; item = item->next)\n\t\t\tif (item->val->free == free && !type->cmp_key(item->key, key))\n\t\t\t\tbreak;\n\t}\n\tif (item)\n\t{\n\t\t/* Momentarily things can be in the hash table without being\n\t\t * in the list. Don't attempt to unlink these. We indicate\n\t\t * such items by setting item->next == item. */\n\t\tif (item->next != item)\n\t\t{\n\t\t\tif (item->next)\n\t\t\t\titem->next->prev = item->prev;\n\t\t\telse\n\t\t\t\tstore->tail = item->prev;\n\t\t\tif (item->prev)\n\t\t\t\titem->prev->next = item->next;\n\t\t\telse\n\t\t\t\tstore->head = item->next;\n\t\t}\n\t\tdrop = (item->val->refs > 0 && --item->val->refs == 0);\n\t\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\t\tif (drop)\n\t\t\titem->val->free(ctx, item->val);\n\t\ttype->drop_key(ctx, item->key);\n\t\tfz_free(ctx, item);\n\t}\n\telse\n\t\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n}\n\nvoid\nfz_empty_store(fz_context *ctx)\n{\n\tfz_store *store = ctx->store;\n\n\tif (store == NULL)\n\t\treturn;\n\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\t/* Run through all the items in the store */\n\twhile (store->head)\n\t{\n\t\tevict(ctx, store->head); /* Drops then retakes lock */\n\t}\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n}\n\nfz_store *\nfz_keep_store_context(fz_context *ctx)\n{\n\tif (ctx == NULL || ctx->store == NULL)\n\t\treturn NULL;\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tctx->store->refs++;\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\treturn ctx->store;\n}\n\nvoid\nfz_drop_store_context(fz_context *ctx)\n{\n\tint refs;\n\tif (ctx == NULL || ctx->store == NULL)\n\t\treturn;\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\trefs = --ctx->store->refs;\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\tif (refs != 0)\n\t\treturn;\n\n\tfz_empty_store(ctx);\n\tfz_free_hash(ctx, ctx->store->hash);\n\tfz_free(ctx, ctx->store);\n\tctx->store = NULL;\n}\n\n#ifndef NDEBUG\nstatic void\nprint_item(FILE *out, void *item_)\n{\n\tfz_item *item = (fz_item *)item_;\n\tfprintf(out, \" val=%p item=%p\\n\", item->val, item);\n\tfflush(out);\n}\n\nvoid\nfz_print_store_locked(fz_context *ctx, FILE *out)\n{\n\tfz_item *item, *next;\n\tfz_store *store = ctx->store;\n\n\tfprintf(out, \"-- resource store contents --\\n\");\n\tfflush(out);\n\n\tfor (item = store->head; item; item = next)\n\t{\n\t\tnext = item->next;\n\t\tif (next)\n\t\t\tnext->val->refs++;\n\t\tfprintf(out, \"store[*][refs=%d][size=%d] \", item->val->refs, item->size);\n\t\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n\t\titem->type->debug(out, item->key);\n\t\tfprintf(out, \" = %p\\n\", item->val);\n\t\tfflush(out);\n\t\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\t\tif (next)\n\t\t\tnext->val->refs--;\n\t}\n\tfprintf(out, \"-- resource store hash contents --\\n\");\n\tfz_print_hash_details(ctx, out, store->hash, print_item);\n\tfprintf(out, \"-- end --\\n\");\n\tfflush(out);\n}\n\nvoid\nfz_print_store(fz_context *ctx, FILE *out)\n{\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\tfz_print_store_locked(ctx, out);\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n}\n#endif\n\n/* This is now an n^2 algorithm - not ideal, but it'll only be bad if we are\n * actually managing to scavenge lots of blocks back. */\nstatic int\nscavenge(fz_context *ctx, unsigned int tofree)\n{\n\tfz_store *store = ctx->store;\n\tunsigned int count = 0;\n\tfz_item *item, *prev;\n\n\t/* Free the items */\n\tfor (item = store->tail; item; item = prev)\n\t{\n\t\tprev = item->prev;\n\t\tif (item->val->refs == 1)\n\t\t{\n\t\t\t/* Free this item */\n\t\t\tcount += item->size;\n\t\t\tevict(ctx, item); /* Drops then retakes lock */\n\n\t\t\tif (count >= tofree)\n\t\t\t\tbreak;\n\n\t\t\t/* Have to restart search again, as prev may no longer\n\t\t\t * be valid due to release of lock in evict. */\n\t\t\tprev = store->tail;\n\t\t}\n\t}\n\t/* Success is managing to evict any blocks */\n\treturn count != 0;\n}\n\nint fz_store_scavenge(fz_context *ctx, unsigned int size, int *phase)\n{\n\tfz_store *store;\n\tunsigned int max;\n\n\tif (ctx == NULL)\n\t\treturn 0;\n\tstore = ctx->store;\n\tif (store == NULL)\n\t\treturn 0;\n\n#ifdef DEBUG_SCAVENGING\n\tprintf(\"Scavenging: store=%d size=%d phase=%d\\n\", store->size, size, *phase);\n\tfz_print_store_locked(ctx, stderr);\n\tMemento_stats();\n#endif\n\tdo\n\t{\n\t\tunsigned int tofree;\n\n\t\t/* Calculate 'max' as the maximum size of the store for this phase */\n\t\tif (*phase >= 16)\n\t\t\tmax = 0;\n\t\telse if (store->max != FZ_STORE_UNLIMITED)\n\t\t\tmax = store->max / 16 * (16 - *phase);\n\t\telse\n\t\t\tmax = store->size / (16 - *phase) * (15 - *phase);\n\t\t(*phase)++;\n\n\t\t/* Slightly baroque calculations to avoid overflow */\n\t\tif (size > UINT_MAX - store->size)\n\t\t\ttofree = UINT_MAX - max;\n\t\telse if (size + store->size > max)\n\t\t\tcontinue;\n\t\telse\n\t\t\ttofree = size + store->size - max;\n\n\t\tif (scavenge(ctx, tofree))\n\t\t{\n#ifdef DEBUG_SCAVENGING\n\t\t\tprintf(\"scavenged: store=%d\\n\", store->size);\n\t\t\tfz_print_store(ctx, stderr);\n\t\t\tMemento_stats();\n#endif\n\t\t\treturn 1;\n\t\t}\n\t}\n\twhile (max > 0);\n\n#ifdef DEBUG_SCAVENGING\n\tprintf(\"scavenging failed\\n\");\n\tfz_print_store(ctx, stderr);\n\tMemento_listBlocks();\n#endif\n\treturn 0;\n}\n\nint\nfz_shrink_store(fz_context *ctx, unsigned int percent)\n{\n\tint success;\n\tfz_store *store;\n\tunsigned int new_size;\n\n\tif (ctx == NULL)\n\t\treturn 0;\n\n\tif (percent >= 100)\n\t\treturn 1;\n\n\tstore = ctx->store;\n\tif (store == NULL)\n\t\treturn 0;\n\n#ifdef DEBUG_SCAVENGING\n\tfprintf(stderr, \"fz_shrink_store: %d\\n\", store->size/(1024*1024));\n#endif\n\tfz_lock(ctx, FZ_LOCK_ALLOC);\n\n\tnew_size = (unsigned int)(((uint64_t)store->size * percent) / 100);\n\tif (store->size > new_size)\n\t\tscavenge(ctx, store->size - new_size);\n\n\tsuccess = (store->size <= new_size) ? 1 : 0;\n\tfz_unlock(ctx, FZ_LOCK_ALLOC);\n#ifdef DEBUG_SCAVENGING\n\tfprintf(stderr, \"fz_shrink_store after: %d\\n\", store->size/(1024*1024));\n#endif\n\n\treturn success;\n}\n\n"
  },
  {
    "path": "mupdf/source/fitz/stream-open.c",
    "content": "#include \"mupdf/fitz.h\"\n\nvoid fz_rebind_stream(fz_stream *stm, fz_context *ctx)\n{\n\tif (stm == NULL || stm->ctx == ctx)\n\t\treturn;\n\tdo {\n\t\tstm->ctx = ctx;\n\t\tstm = (stm->rebind == NULL ? NULL : stm->rebind(stm));\n\t} while (stm != NULL);\n}\n\nfz_stream *\nfz_new_stream(fz_context *ctx, void *state,\n\tfz_stream_next_fn *next,\n\tfz_stream_close_fn *close,\n\tfz_stream_rebind_fn *rebind)\n{\n\tfz_stream *stm;\n\n\tfz_try(ctx)\n\t{\n\t\tstm = fz_malloc_struct(ctx, fz_stream);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tclose(ctx, state);\n\t\tfz_rethrow(ctx);\n\t}\n\n\tstm->refs = 1;\n\tstm->error = 0;\n\tstm->eof = 0;\n\tstm->pos = 0;\n\n\tstm->bits = 0;\n\tstm->avail = 0;\n\n\tstm->rp = NULL;\n\tstm->wp = NULL;\n\n\tstm->state = state;\n\tstm->next = next;\n\tstm->close = close;\n\tstm->seek = NULL;\n\tstm->rebind = rebind;\n\tstm->reopen = NULL;\n\tstm->ctx = ctx;\n\n\treturn stm;\n}\n\nfz_stream *\nfz_keep_stream(fz_stream *stm)\n{\n\tif (stm)\n\t\tstm->refs ++;\n\treturn stm;\n}\n\nvoid\nfz_close(fz_stream *stm)\n{\n\tif (!stm)\n\t\treturn;\n\tstm->refs --;\n\tif (stm->refs == 0)\n\t{\n\t\tif (stm->close)\n\t\t\tstm->close(stm->ctx, stm->state);\n\t\tfz_free(stm->ctx, stm);\n\t}\n}\n\n/* SumatraPDF: allow to clone a stream */\nfz_stream *\nfz_clone_stream(fz_context *ctx, fz_stream *stm)\n{\n\tfz_stream *clone;\n\tif (!stm->reopen)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"can't clone stream without reopening\");\n\tclone = stm->reopen(ctx, stm);\n\tfz_seek(clone, fz_tell(stm), 0);\n\treturn clone;\n}\n\n/* File stream */\n\ntypedef struct fz_file_stream_s\n{\n\tint file;\n\tunsigned char buffer[4096];\n} fz_file_stream;\n\nstatic int next_file(fz_stream *stm, int n)\n{\n\tfz_file_stream *state = stm->state;\n\n\t/* n is only a hint, that we can safely ignore */\n\tn = read(state->file, state->buffer, sizeof(state->buffer));\n\tif (n < 0)\n\t\tfz_throw(stm->ctx, FZ_ERROR_GENERIC, \"read error: %s\", strerror(errno));\n\tstm->rp = state->buffer;\n\tstm->wp = state->buffer + n;\n\tstm->pos += n;\n\n\tif (n == 0)\n\t\treturn EOF;\n\treturn *stm->rp++;\n}\n\nstatic void seek_file(fz_stream *stm, int offset, int whence)\n{\n\tfz_file_stream *state = stm->state;\n\tint n = lseek(state->file, offset, whence);\n\tif (n < 0)\n\t\tfz_throw(stm->ctx, FZ_ERROR_GENERIC, \"cannot lseek: %s\", strerror(errno));\n\tstm->pos = n;\n\tstm->rp = state->buffer;\n\tstm->wp = state->buffer;\n}\n\nstatic void close_file(fz_context *ctx, void *state_)\n{\n\tfz_file_stream *state = state_;\n\tint n = close(state->file);\n\tif (n < 0)\n\t\tfz_warn(ctx, \"close error: %s\", strerror(errno));\n\tfz_free(ctx, state);\n}\n\nfz_stream *\nfz_open_fd(fz_context *ctx, int fd)\n{\n\tfz_stream *stm;\n\tfz_file_stream *state = fz_malloc_struct(ctx, fz_file_stream);\n\tstate->file = fd;\n\n\tfz_try(ctx)\n\t{\n\t\tstm = fz_new_stream(ctx, state, next_file, close_file, NULL);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, state);\n\t\tfz_rethrow(ctx);\n\t}\n\tstm->seek = seek_file;\n\t/* SumatraPDF: TODO: can't reliably clone a file descriptor */\n\n\treturn stm;\n}\n\nfz_stream *\nfz_open_file(fz_context *ctx, const char *name)\n{\n#ifdef _WIN32\n\tchar *s = (char*)name;\n\twchar_t *wname, *d;\n\tint c, fd;\n\t/* SumatraPDF: prefer ANSI to UTF-8 for consistency with remaining API */\n\tfd = open(name, O_BINARY | O_RDONLY, 0);\n\tif (fd == -1)\n\t{\n\n\td = wname = fz_malloc(ctx, (strlen(name)+1) * sizeof(wchar_t));\n\twhile (*s) {\n\t\ts += fz_chartorune(&c, s);\n\t\t*d++ = c;\n\t}\n\t*d = 0;\n\tfd = _wopen(wname, O_BINARY | O_RDONLY, 0);\n\tfz_free(ctx, wname);\n\n\t}\n#else\n\tint fd = open(name, O_BINARY | O_RDONLY, 0);\n#endif\n\tif (fd == -1)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot open %s\", name);\n\treturn fz_open_fd(ctx, fd);\n}\n\n#ifdef _WIN32\nfz_stream *\nfz_open_file_w(fz_context *ctx, const wchar_t *name)\n{\n\tint fd = _wopen(name, O_BINARY | O_RDONLY, 0);\n\tif (fd == -1)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot open file %ls\", name);\n\treturn fz_open_fd(ctx, fd);\n}\n#endif\n\n/* Memory stream */\n\nstatic int next_buffer(fz_stream *stm, int max)\n{\n\treturn EOF;\n}\n\nstatic void seek_buffer(fz_stream *stm, int offset, int whence)\n{\n\tint pos = stm->pos - (stm->wp - stm->rp);\n\t/* Convert to absolute pos */\n\tif (whence == 1)\n\t{\n\t\toffset += pos; /* Was relative to current pos */\n\t}\n\telse if (whence == 2)\n\t{\n\t\toffset += stm->pos; /* Was relative to end */\n\t}\n\n\tif (offset < 0)\n\t\toffset = 0;\n\tif (offset > stm->pos)\n\t\toffset = stm->pos;\n\tstm->rp += offset - pos;\n}\n\nstatic void close_buffer(fz_context *ctx, void *state_)\n{\n\tfz_buffer *state = (fz_buffer *)state_;\n\tif (state)\n\t\tfz_drop_buffer(ctx, state);\n}\n\n/* SumatraPDF: allow to clone a stream */\nstatic fz_stream *reopen_buffer(fz_context *ctx, fz_stream *stm)\n{\n\tfz_stream *clone;\n\n\tfz_buffer *orig = stm->state;\n\tfz_buffer *buf = fz_new_buffer_from_data(ctx, orig->data, orig->len);\n\tclone = fz_open_buffer(ctx, buf);\n\tfz_drop_buffer(ctx, buf);\n\n\treturn clone;\n}\n\nfz_stream *\nfz_open_buffer(fz_context *ctx, fz_buffer *buf)\n{\n\tfz_stream *stm;\n\n\tfz_keep_buffer(ctx, buf);\n\tstm = fz_new_stream(ctx, buf, next_buffer, close_buffer, NULL);\n\tstm->seek = seek_buffer;\n\tstm->reopen = reopen_buffer;\n\n\tstm->rp = buf->data;\n\tstm->wp = buf->data + buf->len;\n\n\tstm->pos = buf->len;\n\n\treturn stm;\n}\n\nfz_stream *\nfz_open_memory(fz_context *ctx, unsigned char *data, int len)\n{\n\tfz_stream *stm;\n\n\tstm = fz_new_stream(ctx, NULL, next_buffer, close_buffer, NULL);\n\tstm->seek = seek_buffer;\n\tstm->reopen = reopen_buffer;\n\n\tstm->rp = data;\n\tstm->wp = data + len;\n\n\tstm->pos = len;\n\n\treturn stm;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/stream-prog.c",
    "content": "#include \"mupdf/fitz/stream.h\"\n#include \"mupdf/fitz/string.h\"\n\n#if defined(_WIN32) && !defined(NDEBUG)\n#include \"windows.h\"\n\nstatic void\nshow_progress(int av, int pos)\n{\n\tchar text[80];\n\tsprintf(text, \"Have %d, Want %d\\n\", av, pos);\n\tOutputDebugStringA(text);\n}\n#else\n#define show_progress(A,B) do {} while (0)\n#endif\n\n/* File stream - progressive reading to simulate http download */\n\ntypedef struct prog_state\n{\n\tint fd;\n\tint length;\n\tint available;\n\tint bps;\n\tclock_t start_time;\n\tunsigned char buffer[4096];\n} prog_state;\n\nstatic int next_prog(fz_stream *stm, int len)\n{\n\tprog_state *ps = (prog_state *)stm->state;\n\tint n;\n\tunsigned char *buf = ps->buffer;\n\n\tif (len > sizeof(ps->buffer))\n\t\tlen = sizeof(ps->buffer);\n\n\t/* Simulate more data having arrived */\n\tif (ps->available < ps->length)\n\t{\n\t\tint av = (int)((float)(clock() - ps->start_time) * ps->bps / (CLOCKS_PER_SEC*8));\n\t\tif (av > ps->length)\n\t\t\tav = ps->length;\n\t\tps->available = av;\n\t\t/* Limit any fetches to be within the data we have */\n\t\tif (av < ps->length && len + stm->pos > av)\n\t\t{\n\t\t\tlen = av - stm->pos;\n\t\t\tif (len <= 0)\n\t\t\t{\n\t\t\t\tshow_progress(av, stm->pos);\n\t\t\t\tfz_throw(stm->ctx, FZ_ERROR_TRYLATER, \"Not enough data yet\");\n\t\t\t}\n\t\t}\n\t}\n\n\tn = (len > 0 ? read(ps->fd, buf, len) : 0);\n\tif (n < 0)\n\t\tfz_throw(stm->ctx, FZ_ERROR_GENERIC, \"read error: %s\", strerror(errno));\n\tstm->rp = ps->buffer + stm->pos;\n\tstm->wp = ps->buffer + stm->pos + n;\n\tstm->pos += n;\n\tif (n == 0)\n\t\treturn EOF;\n\treturn *stm->rp++;\n}\n\nstatic void seek_prog(fz_stream *stm, int offset, int whence)\n{\n\tprog_state *ps = (prog_state *)stm->state;\n\tint n;\n\n\t/* Simulate more data having arrived */\n\tif (ps->available < ps->length)\n\t{\n\t\tint av = (int)((float)(clock() - ps->start_time) * ps->bps / (CLOCKS_PER_SEC*8));\n\t\tif (av > ps->length)\n\t\t\tav = ps->length;\n\t\tps->available = av;\n\t}\n\tif (ps->available < ps->length)\n\t{\n\t\tif (whence == SEEK_END)\n\t\t{\n\t\t\tshow_progress(ps->available, ps->length);\n\t\t\tfz_throw(stm->ctx, FZ_ERROR_TRYLATER, \"Not enough data to seek to end yet\");\n\t\t}\n\t}\n\tif (whence == SEEK_CUR)\n\t{\n\t\twhence = SEEK_SET;\n\t\toffset += stm->pos;\n\t\tif (offset > ps->available)\n\t\t{\n\t\t\tshow_progress(ps->available, offset);\n\t\t\tfz_throw(stm->ctx, FZ_ERROR_TRYLATER, \"Not enough data to seek (relatively) to offset yet\");\n\t\t}\n\t}\n\tif (whence == SEEK_SET)\n\t{\n\t\tif (offset > ps->available)\n\t\t{\n\t\t\tshow_progress(ps->available, offset);\n\t\t\tfz_throw(stm->ctx, FZ_ERROR_TRYLATER, \"Not enough data to seek to offset yet\");\n\t\t}\n\t}\n\n\tn = lseek(ps->fd, offset, whence);\n\tif (n < 0)\n\t\tfz_throw(stm->ctx, FZ_ERROR_GENERIC, \"cannot lseek: %s\", strerror(errno));\n\tstm->pos = n;\n\tstm->wp = stm->rp;\n}\n\nstatic void close_prog(fz_context *ctx, void *state)\n{\n\tprog_state *ps = (prog_state *)state;\n\tint n = close(ps->fd);\n\tif (n < 0)\n\t\tfz_warn(ctx, \"close error: %s\", strerror(errno));\n\tfz_free(ctx, state);\n}\n\nstatic int meta_prog(fz_stream *stm, int key, int size, void *ptr)\n{\n\tprog_state *ps = (prog_state *)stm->state;\n\tswitch(key)\n\t{\n\tcase FZ_STREAM_META_PROGRESSIVE:\n\t\treturn 1;\n\t\tbreak;\n\tcase FZ_STREAM_META_LENGTH:\n\t\treturn ps->length;\n\t}\n\treturn -1;\n}\n\nfz_stream *\nfz_open_fd_progressive(fz_context *ctx, int fd, int bps)\n{\n\tfz_stream *stm;\n\tprog_state *state;\n\n\tstate = fz_malloc_struct(ctx, prog_state);\n\tstate->fd = fd;\n\tstate->bps = bps;\n\tstate->start_time = clock();\n\tstate->available = 0;\n\n\tstate->length = lseek(state->fd, 0, SEEK_END);\n\tlseek(state->fd, 0, SEEK_SET);\n\n\tfz_try(ctx)\n\t{\n\t\tstm = fz_new_stream(ctx, state, next_prog, close_prog, NULL);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, state);\n\t\tfz_rethrow(ctx);\n\t}\n\tstm->seek = seek_prog;\n\tstm->meta = meta_prog;\n\n\treturn stm;\n}\n\nfz_stream *\nfz_open_file_progressive(fz_context *ctx, const char *name, int bps)\n{\n#ifdef _WIN32\n\tchar *s = (char*)name;\n\twchar_t *wname, *d;\n\tint c, fd;\n\td = wname = fz_malloc(ctx, (strlen(name)+1) * sizeof(wchar_t));\n\twhile (*s) {\n\t\ts += fz_chartorune(&c, s);\n\t\t*d++ = c;\n\t}\n\t*d = 0;\n\tfd = _wopen(wname, O_BINARY | O_RDONLY, 0);\n\tfz_free(ctx, wname);\n#else\n\tint fd = open(name, O_BINARY | O_RDONLY, 0);\n#endif\n\tif (fd == -1)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot open %s\", name);\n\treturn fz_open_fd_progressive(ctx, fd, bps);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/stream-read.c",
    "content": "#include \"mupdf/fitz.h\"\n\n#define MIN_BOMB (100 << 20)\n\nint\nfz_read(fz_stream *stm, unsigned char *buf, int len)\n{\n\tint count, n;\n\n\tcount = 0;\n\tdo\n\t{\n\t\tn = fz_available(stm, len);\n\t\tif (n > len)\n\t\t\tn = len;\n\t\tif (n == 0)\n\t\t\tbreak;\n\n\t\tmemcpy(buf, stm->rp, n);\n\t\tstm->rp += n;\n\t\tbuf += n;\n\t\tcount += n;\n\t\tlen -= n;\n\t}\n\twhile (len > 0);\n\n\treturn count;\n}\n\nfz_buffer *\nfz_read_all(fz_stream *stm, int initial)\n{\n\treturn fz_read_best(stm, initial, NULL);\n}\n\nfz_buffer *\nfz_read_best(fz_stream *stm, int initial, int *truncated)\n{\n\tfz_buffer *buf = NULL;\n\tint n;\n\tfz_context *ctx = stm->ctx;\n\n\tfz_var(buf);\n\n\tif (truncated)\n\t\t*truncated = 0;\n\n\tfz_try(ctx)\n\t{\n\t\tif (initial < 1024)\n\t\t\tinitial = 1024;\n\n\t\tbuf = fz_new_buffer(ctx, initial+1);\n\n\t\twhile (1)\n\t\t{\n\t\t\tif (buf->len == buf->cap)\n\t\t\t\tfz_grow_buffer(ctx, buf);\n\n\t\t\tif (buf->len >= MIN_BOMB && buf->len / 200 > initial)\n\t\t\t{\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"compression bomb detected\");\n\t\t\t}\n\n\t\t\tn = fz_read(stm, buf->data + buf->len, buf->cap - buf->len);\n\t\t\tif (n == 0)\n\t\t\t\tbreak;\n\n\t\t\tbuf->len += n;\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tif (fz_caught(ctx) == FZ_ERROR_TRYLATER)\n\t\t{\n\t\t\tfz_drop_buffer(ctx, buf);\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t\tif (truncated)\n\t\t{\n\t\t\t*truncated = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_drop_buffer(ctx, buf);\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t}\n\n\treturn buf;\n}\n\nvoid\nfz_read_line(fz_stream *stm, char *mem, int n)\n{\n\tchar *s = mem;\n\tint c = EOF;\n\twhile (n > 1)\n\t{\n\t\tc = fz_read_byte(stm);\n\t\tif (c == EOF)\n\t\t\tbreak;\n\t\tif (c == '\\r') {\n\t\t\tc = fz_peek_byte(stm);\n\t\t\tif (c == '\\n')\n\t\t\t\tfz_read_byte(stm);\n\t\t\tbreak;\n\t\t}\n\t\tif (c == '\\n')\n\t\t\tbreak;\n\t\t*s++ = c;\n\t\tn--;\n\t}\n\tif (n)\n\t\t*s = '\\0';\n}\n\nint\nfz_tell(fz_stream *stm)\n{\n\treturn stm->pos - (stm->wp - stm->rp);\n}\n\nvoid\nfz_seek(fz_stream *stm, int offset, int whence)\n{\n\tstm->avail = 0; /* Reset bit reading */\n\tif (stm->seek)\n\t{\n\t\tif (whence == 1)\n\t\t{\n\t\t\toffset = fz_tell(stm) + offset;\n\t\t\twhence = 0;\n\t\t}\n\t\tstm->seek(stm, offset, whence);\n\t\tstm->eof = 0;\n\t}\n\telse if (whence != 2)\n\t{\n\t\tif (whence == 0)\n\t\t\toffset -= fz_tell(stm);\n\t\tif (offset < 0)\n\t\t\tfz_warn(stm->ctx, \"cannot seek backwards\");\n\t\t/* dog slow, but rare enough */\n\t\twhile (offset-- > 0)\n\t\t{\n\t\t\tif (fz_read_byte(stm) == EOF)\n\t\t\t{\n\t\t\t\tfz_warn(stm->ctx, \"seek failed\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t\tfz_warn(stm->ctx, \"cannot seek\");\n}\n\nint fz_stream_meta(fz_stream *stm, int key, int size, void *ptr)\n{\n\tif (!stm || !stm->meta)\n\t\treturn -1;\n\treturn stm->meta(stm, key, size, ptr);\n}\n\nfz_buffer *\nfz_read_file(fz_context *ctx, const char *filename)\n{\n\tfz_stream *stm;\n\tfz_buffer *buf = NULL;\n\n\tfz_var(buf);\n\n\tstm = fz_open_file(ctx, filename);\n\tfz_try(ctx)\n\t{\n\t\tbuf = fz_read_all(stm, 0);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(stm);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn buf;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/string.c",
    "content": "#include \"mupdf/fitz.h\"\n\nchar *\nfz_strsep(char **stringp, const char *delim)\n{\n\tchar *ret = *stringp;\n\tif (!ret) return NULL;\n\tif ((*stringp = strpbrk(*stringp, delim)) != NULL)\n\t\t*((*stringp)++) = '\\0';\n\treturn ret;\n}\n\nint\nfz_strlcpy(char *dst, const char *src, int siz)\n{\n\tregister char *d = dst;\n\tregister const char *s = src;\n\tregister int n = siz;\n\n\t/* Copy as many bytes as will fit */\n\tif (n != 0 && --n != 0) {\n\t\tdo {\n\t\t\tif ((*d++ = *s++) == 0)\n\t\t\t\tbreak;\n\t\t} while (--n != 0);\n\t}\n\n\t/* Not enough room in dst, add NUL and traverse rest of src */\n\tif (n == 0) {\n\t\tif (siz != 0)\n\t\t\t*d = '\\0';\t\t/* NUL-terminate dst */\n\t\twhile (*s++)\n\t\t\t;\n\t}\n\n\treturn(s - src - 1);\t/* count does not include NUL */\n}\n\nint\nfz_strlcat(char *dst, const char *src, int siz)\n{\n\tregister char *d = dst;\n\tregister const char *s = src;\n\tregister int n = siz;\n\tint dlen;\n\n\t/* Find the end of dst and adjust bytes left but don't go past end */\n\twhile (*d != '\\0' && n-- != 0)\n\t\td++;\n\tdlen = d - dst;\n\tn = siz - dlen;\n\n\tif (n == 0)\n\t\treturn dlen + strlen(s);\n\twhile (*s != '\\0') {\n\t\tif (n != 1) {\n\t\t\t*d++ = *s;\n\t\t\tn--;\n\t\t}\n\t\ts++;\n\t}\n\t*d = '\\0';\n\n\treturn dlen + (s - src);\t/* count does not include NUL */\n}\n\nvoid\nfz_dirname(char *dir, const char *path, int n)\n{\n\tint i;\n\n\tif (!path || !path[0])\n\t{\n\t\tfz_strlcpy(dir, \".\", n);\n\t\treturn;\n\t}\n\n\tfz_strlcpy(dir, path, n);\n\n\ti = strlen(dir);\n\tfor(; dir[i] == '/'; --i) if (!i) { fz_strlcpy(dir, \"/\", n); return; }\n\tfor(; dir[i] != '/'; --i) if (!i) { fz_strlcpy(dir, \".\", n); return; }\n\tfor(; dir[i] == '/'; --i) if (!i) { fz_strlcpy(dir, \"/\", n); return; }\n\tdir[i+1] = 0;\n}\n\n#define SEP(x) ((x)=='/' || (x) == 0)\n\nchar *\nfz_cleanname(char *name)\n{\n\tchar *p, *q, *dotdot;\n\tint rooted;\n\n\trooted = name[0] == '/';\n\n\t/*\n\t * invariants:\n\t *\t\tp points at beginning of path element we're considering.\n\t *\t\tq points just past the last path element we wrote (no slash).\n\t *\t\tdotdot points just past the point where .. cannot backtrack\n\t *\t\t\t\tany further (no slash).\n\t */\n\tp = q = dotdot = name + rooted;\n\twhile (*p)\n\t{\n\t\tif(p[0] == '/') /* null element */\n\t\t\tp++;\n\t\telse if (p[0] == '.' && SEP(p[1]))\n\t\t\tp += 1; /* don't count the separator in case it is nul */\n\t\telse if (p[0] == '.' && p[1] == '.' && SEP(p[2]))\n\t\t{\n\t\t\tp += 2;\n\t\t\tif (q > dotdot) /* can backtrack */\n\t\t\t{\n\t\t\t\twhile(--q > dotdot && *q != '/')\n\t\t\t\t\t;\n\t\t\t}\n\t\t\telse if (!rooted) /* /.. is / but ./../ is .. */\n\t\t\t{\n\t\t\t\tif (q != name)\n\t\t\t\t\t*q++ = '/';\n\t\t\t\t*q++ = '.';\n\t\t\t\t*q++ = '.';\n\t\t\t\tdotdot = q;\n\t\t\t}\n\t\t}\n\t\telse /* real path element */\n\t\t{\n\t\t\tif (q != name+rooted)\n\t\t\t\t*q++ = '/';\n\t\t\twhile ((*q = *p) != '/' && *q != 0)\n\t\t\t\tp++, q++;\n\t\t}\n\t}\n\n\tif (q == name) /* empty string is really \".\" */\n\t\t*q++ = '.';\n\t*q = '\\0';\n\treturn name;\n}\nenum\n{\n\tUTFmax = 4, /* maximum bytes per rune */\n\tRunesync = 0x80, /* cannot represent part of a UTF sequence (<) */\n\tRuneself = 0x80, /* rune and UTF sequences are the same (<) */\n\tRuneerror = 0xFFFD, /* decoding error in UTF */\n\tRunemax = 0x10FFFF, /* maximum rune value */\n};\n\nenum\n{\n\tBit1 = 7,\n\tBitx = 6,\n\tBit2 = 5,\n\tBit3 = 4,\n\tBit4 = 3,\n\tBit5 = 2,\n\n\tT1 = ((1<<(Bit1+1))-1) ^ 0xFF, /* 0000 0000 */\n\tTx = ((1<<(Bitx+1))-1) ^ 0xFF, /* 1000 0000 */\n\tT2 = ((1<<(Bit2+1))-1) ^ 0xFF, /* 1100 0000 */\n\tT3 = ((1<<(Bit3+1))-1) ^ 0xFF, /* 1110 0000 */\n\tT4 = ((1<<(Bit4+1))-1) ^ 0xFF, /* 1111 0000 */\n\tT5 = ((1<<(Bit5+1))-1) ^ 0xFF, /* 1111 1000 */\n\n\tRune1 = (1<<(Bit1+0*Bitx))-1, /* 0000 0000 0111 1111 */\n\tRune2 = (1<<(Bit2+1*Bitx))-1, /* 0000 0111 1111 1111 */\n\tRune3 = (1<<(Bit3+2*Bitx))-1, /* 1111 1111 1111 1111 */\n\tRune4 = (1<<(Bit4+3*Bitx))-1, /* 0001 1111 1111 1111 1111 1111 */\n\n\tMaskx = (1<<Bitx)-1,\t/* 0011 1111 */\n\tTestx = Maskx ^ 0xFF,\t/* 1100 0000 */\n\n\tBad = Runeerror,\n};\n\nint\nfz_chartorune(int *rune, const char *str)\n{\n\tint c, c1, c2, c3;\n\tlong l;\n\n\t/*\n\t * one character sequence\n\t *\t00000-0007F => T1\n\t */\n\tc = *(const unsigned char*)str;\n\tif(c < Tx) {\n\t\t*rune = c;\n\t\treturn 1;\n\t}\n\n\t/*\n\t * two character sequence\n\t *\t0080-07FF => T2 Tx\n\t */\n\tc1 = *(const unsigned char*)(str+1) ^ Tx;\n\tif(c1 & Testx)\n\t\tgoto bad;\n\tif(c < T3) {\n\t\tif(c < T2)\n\t\t\tgoto bad;\n\t\tl = ((c << Bitx) | c1) & Rune2;\n\t\tif(l <= Rune1)\n\t\t\tgoto bad;\n\t\t*rune = l;\n\t\treturn 2;\n\t}\n\n\t/*\n\t * three character sequence\n\t *\t0800-FFFF => T3 Tx Tx\n\t */\n\tc2 = *(const unsigned char*)(str+2) ^ Tx;\n\tif(c2 & Testx)\n\t\tgoto bad;\n\tif(c < T4) {\n\t\tl = ((((c << Bitx) | c1) << Bitx) | c2) & Rune3;\n\t\tif(l <= Rune2)\n\t\t\tgoto bad;\n\t\t*rune = l;\n\t\treturn 3;\n\t}\n\n\t/*\n\t * four character sequence (21-bit value)\n\t *\t10000-1FFFFF => T4 Tx Tx Tx\n\t */\n\tc3 = *(const unsigned char*)(str+3) ^ Tx;\n\tif (c3 & Testx)\n\t\tgoto bad;\n\tif (c < T5) {\n\t\tl = ((((((c << Bitx) | c1) << Bitx) | c2) << Bitx) | c3) & Rune4;\n\t\tif (l <= Rune3)\n\t\t\tgoto bad;\n\t\t*rune = l;\n\t\treturn 4;\n\t}\n\t/*\n\t * Support for 5-byte or longer UTF-8 would go here, but\n\t * since we don't have that, we'll just fall through to bad.\n\t */\n\n\t/*\n\t * bad decoding\n\t */\nbad:\n\t*rune = Bad;\n\treturn 1;\n}\n\nint\nfz_runetochar(char *str, int rune)\n{\n\t/* Runes are signed, so convert to unsigned for range check. */\n\tunsigned long c = (unsigned long)rune;\n\n\t/*\n\t * one character sequence\n\t *\t00000-0007F => 00-7F\n\t */\n\tif(c <= Rune1) {\n\t\tstr[0] = c;\n\t\treturn 1;\n\t}\n\n\t/*\n\t * two character sequence\n\t *\t0080-07FF => T2 Tx\n\t */\n\tif(c <= Rune2) {\n\t\tstr[0] = T2 | (c >> 1*Bitx);\n\t\tstr[1] = Tx | (c & Maskx);\n\t\treturn 2;\n\t}\n\n\t/*\n\t * If the Rune is out of range, convert it to the error rune.\n\t * Do this test here because the error rune encodes to three bytes.\n\t * Doing it earlier would duplicate work, since an out of range\n\t * Rune wouldn't have fit in one or two bytes.\n\t */\n\tif (c > Runemax)\n\t\tc = Runeerror;\n\n\t/*\n\t * three character sequence\n\t *\t0800-FFFF => T3 Tx Tx\n\t */\n\tif (c <= Rune3) {\n\t\tstr[0] = T3 | (c >> 2*Bitx);\n\t\tstr[1] = Tx | ((c >> 1*Bitx) & Maskx);\n\t\tstr[2] = Tx | (c & Maskx);\n\t\treturn 3;\n\t}\n\n\t/*\n\t * four character sequence (21-bit value)\n\t *\t10000-1FFFFF => T4 Tx Tx Tx\n\t */\n\tstr[0] = T4 | (c >> 3*Bitx);\n\tstr[1] = Tx | ((c >> 2*Bitx) & Maskx);\n\tstr[2] = Tx | ((c >> 1*Bitx) & Maskx);\n\tstr[3] = Tx | (c & Maskx);\n\treturn 4;\n}\n\nint\nfz_runelen(int c)\n{\n\tchar str[10];\n\treturn fz_runetochar(str, c);\n}\n\nfloat fz_atof(const char *s)\n{\n\tdouble d;\n\n\t/* The errno voodoo here checks for us reading numbers that are too\n\t * big to fit into a double. The checks for FLT_MAX ensure that we\n\t * don't read a number that's OK as a double and then become invalid\n\t * as we convert to a float. */\n\terrno = 0;\n\td = fz_strtod(s, NULL);\n\tif (errno == ERANGE || isnan(d)) {\n\t\t/* Return 1.0, as it's a small known value that won't cause a divide by 0. */\n\t\treturn 1.0;\n\t}\n\td = fz_clampd(d, -FLT_MAX, FLT_MAX);\n\treturn (float)d;\n}\n\nint fz_atoi(const char *s)\n{\n\tif (s == NULL)\n\t\treturn 0;\n\treturn atoi(s);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/strtod.c",
    "content": "/* The authors of this software are Rob Pike and Ken Thompson.\n * Copyright (c) 2002 by Lucent Technologies.\n * Permission to use, copy, modify, and distribute this software for any\n * purpose without fee is hereby granted, provided that this entire notice\n * is included in all copies of any software which is or includes a copy\n * or modification of this software and in all copies of the supporting\n * documentation for such software.\n * THIS SOFTWARE IS BEING PROVIDED \"AS IS\", WITHOUT ANY EXPRESS OR IMPLIED\n * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE ANY\n * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY\n * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.\n */\n\n#include \"mupdf/fitz.h\"\n\n#include <stdio.h>\n#include <math.h>\n#include <float.h>\n#include <string.h>\n#include <stdlib.h>\n#include <errno.h>\n\n#ifndef INFINITY\n#define INFINITY (DBL_MAX+DBL_MAX)\n#endif\n#ifndef NAN\n#define NAN (INFINITY-INFINITY)\n#endif\n\n#ifndef DEFINED_ULONG\n#define DEFINED_ULONG\ntypedef unsigned long ulong;\n#endif\n\nstatic ulong\numuldiv(ulong a, ulong b, ulong c)\n{\n\tdouble d;\n\n\td = ((double)a * (double)b) / (double)c;\n\tif(d >= 4294967295.)\n\t\td = 4294967295.;\n\treturn (ulong)d;\n}\n\n/*\n * This routine will convert to arbitrary precision\n * floating point entirely in multi-precision fixed.\n * The answer is the closest floating point number to\n * the given decimal number. Exactly half way are\n * rounded ala ieee rules.\n * Method is to scale input decimal between .500 and .999...\n * with external power of 2, then binary search for the\n * closest mantissa to this decimal number.\n * Nmant is is the required precision. (53 for ieee dp)\n * Nbits is the max number of bits/word. (must be <= 28)\n * Prec is calculated - the number of words of fixed mantissa.\n */\nenum\n{\n\tNbits\t= 28,\t\t\t\t/* bits safely represented in a ulong */\n\tNmant\t= 53,\t\t\t\t/* bits of precision required */\n\tPrec\t= (Nmant+Nbits+1)/Nbits,\t/* words of Nbits each to represent mantissa */\n\tSigbit\t= 1<<(Prec*Nbits-Nmant),\t/* first significant bit of Prec-th word */\n\tNdig\t= 1500,\n\tOne\t= (ulong)(1<<Nbits),\n\tHalf\t= (ulong)(One>>1),\n\tMaxe\t= 310,\n\n\tFsign\t= 1<<0,\t\t/* found - */\n\tFesign\t= 1<<1,\t\t/* found e- */\n\tFdpoint\t= 1<<2,\t\t/* found . */\n\n\tS0\t= 0,\t\t/* _\t\t_S0\t+S1\t#S2\t.S3 */\n\tS1,\t\t\t/* _+\t\t#S2\t.S3 */\n\tS2,\t\t\t/* _+#\t\t#S2\t.S4\teS5 */\n\tS3,\t\t\t/* _+.\t\t#S4 */\n\tS4,\t\t\t/* _+#.#\t#S4\teS5 */\n\tS5,\t\t\t/* _+#.#e\t+S6\t#S7 */\n\tS6,\t\t\t/* _+#.#e+\t#S7 */\n\tS7\t\t\t/* _+#.#e+#\t#S7 */\n};\n\nstatic\tint\txcmp(char*, char*);\nstatic\tint\tfpcmp(char*, ulong*);\nstatic\tvoid\tfrnorm(ulong*);\nstatic\tvoid\tdivascii(char*, int*, int*, int*);\nstatic\tvoid\tmulascii(char*, int*, int*, int*);\n\ntypedef\tstruct\tTab\tTab;\nstruct\tTab\n{\n\tint\tbp;\n\tint\tsiz;\n\tchar*\tcmp;\n};\n\ndouble\nfz_strtod(const char *as, char **aas)\n{\n\tint na, ex, dp, bp, c, i, flag, state;\n\tulong low[Prec], hig[Prec], mid[Prec];\n\tdouble d;\n\tchar *s, a[Ndig];\n\n\tflag = 0;\t/* Fsign, Fesign, Fdpoint */\n\tna = 0;\t\t/* number of digits of a[] */\n\tdp = 0;\t\t/* na of decimal point */\n\tex = 0;\t\t/* exonent */\n\n\tstate = S0;\n\tfor(s=(char*)as;; s++) {\n\t\tc = *s;\n\t\tif(c >= '0' && c <= '9') {\n\t\t\tswitch(state) {\n\t\t\tcase S0:\n\t\t\tcase S1:\n\t\t\tcase S2:\n\t\t\t\tstate = S2;\n\t\t\t\tbreak;\n\t\t\tcase S3:\n\t\t\tcase S4:\n\t\t\t\tstate = S4;\n\t\t\t\tbreak;\n\n\t\t\tcase S5:\n\t\t\tcase S6:\n\t\t\tcase S7:\n\t\t\t\tstate = S7;\n\t\t\t\tex = ex*10 + (c-'0');\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(na == 0 && c == '0') {\n\t\t\t\tdp--;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(na < Ndig-50)\n\t\t\t\ta[na++] = c;\n\t\t\tcontinue;\n\t\t}\n\t\tswitch(c) {\n\t\tcase '\\t':\n\t\tcase '\\n':\n\t\tcase '\\v':\n\t\tcase '\\f':\n\t\tcase '\\r':\n\t\tcase ' ':\n\t\t\tif(state == S0)\n\t\t\t\tcontinue;\n\t\t\tbreak;\n\t\tcase '-':\n\t\t\tif(state == S0)\n\t\t\t\tflag |= Fsign;\n\t\t\telse\n\t\t\t\tflag |= Fesign;\n\t\tcase '+':\n\t\t\tif(state == S0)\n\t\t\t\tstate = S1;\n\t\t\telse\n\t\t\tif(state == S5)\n\t\t\t\tstate = S6;\n\t\t\telse\n\t\t\t\tbreak;\t/* syntax */\n\t\t\tcontinue;\n\t\tcase '.':\n\t\t\tflag |= Fdpoint;\n\t\t\tdp = na;\n\t\t\tif(state == S0 || state == S1) {\n\t\t\t\tstate = S3;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(state == S2) {\n\t\t\t\tstate = S4;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'e':\n\t\tcase 'E':\n\t\t\tif(state == S2 || state == S4) {\n\t\t\t\tstate = S5;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tbreak;\n\t}\n\n\t/*\n\t * clean up return char-pointer\n\t */\n\tswitch(state) {\n\tcase S0:\n\t\tif(xcmp(s, \"nan\") == 0) {\n\t\t\tif(aas != NULL)\n\t\t\t\t*aas = s+3;\n\t\t\tgoto retnan;\n\t\t}\n\tcase S1:\n\t\tif(xcmp(s, \"infinity\") == 0) {\n\t\t\tif(aas != NULL)\n\t\t\t\t*aas = s+8;\n\t\t\tgoto retinf;\n\t\t}\n\t\tif(xcmp(s, \"inf\") == 0) {\n\t\t\tif(aas != NULL)\n\t\t\t\t*aas = s+3;\n\t\t\tgoto retinf;\n\t\t}\n\tcase S3:\n\t\tif(aas != NULL)\n\t\t\t*aas = (char*)as;\n\t\tgoto ret0;\t/* no digits found */\n\tcase S6:\n\t\ts--;\t\t/* back over +- */\n\tcase S5:\n\t\ts--;\t\t/* back over e */\n\t\tbreak;\n\t}\n\tif(aas != NULL)\n\t\t*aas = s;\n\n\tif(flag & Fdpoint)\n\twhile(na > 0 && a[na-1] == '0')\n\t\tna--;\n\tif(na == 0)\n\t\tgoto ret0;\t/* zero */\n\ta[na] = 0;\n\tif(!(flag & Fdpoint))\n\t\tdp = na;\n\tif(flag & Fesign)\n\t\tex = -ex;\n\tdp += ex;\n\tif(dp < -Maxe){\n\t\terrno = ERANGE;\n\t\tgoto ret0;\t/* underflow by exp */\n\t} else\n\tif(dp > +Maxe)\n\t\tgoto retinf;\t/* overflow by exp */\n\n\t/*\n\t * normalize the decimal ascii number\n\t * to range .[5-9][0-9]* e0\n\t */\n\tbp = 0;\t\t/* binary exponent */\n\twhile(dp > 0)\n\t\tdivascii(a, &na, &dp, &bp);\n\twhile(dp < 0 || a[0] < '5')\n\t\tmulascii(a, &na, &dp, &bp);\n\n\t/* close approx by naive conversion */\n\tmid[0] = 0;\n\tmid[1] = 1;\n\tfor(i=0; (c=a[i]) != '\\0'; i++) {\n\t\tmid[0] = mid[0]*10 + (c-'0');\n\t\tmid[1] = mid[1]*10;\n\t\tif(i >= 8)\n\t\t\tbreak;\n\t}\n\tlow[0] = umuldiv(mid[0], One, mid[1]);\n\thig[0] = umuldiv(mid[0]+1, One, mid[1]);\n\tfor(i=1; i<Prec; i++) {\n\t\tlow[i] = 0;\n\t\thig[i] = One-1;\n\t}\n\n\t/* binary search for closest mantissa */\n\tfor(;;) {\n\t\t/* mid = (hig + low) / 2 */\n\t\tc = 0;\n\t\tfor(i=0; i<Prec; i++) {\n\t\t\tmid[i] = hig[i] + low[i];\n\t\t\tif(c)\n\t\t\t\tmid[i] += One;\n\t\t\tc = mid[i] & 1;\n\t\t\tmid[i] >>= 1;\n\t\t}\n\t\tfrnorm(mid);\n\n\t\t/* compare */\n\t\tc = fpcmp(a, mid);\n\t\tif(c > 0) {\n\t\t\tc = 1;\n\t\t\tfor(i=0; i<Prec; i++)\n\t\t\t\tif(low[i] != mid[i]) {\n\t\t\t\t\tc = 0;\n\t\t\t\t\tlow[i] = mid[i];\n\t\t\t\t}\n\t\t\tif(c)\n\t\t\t\tbreak;\t/* between mid and hig */\n\t\t\tcontinue;\n\t\t}\n\t\tif(c < 0) {\n\t\t\tfor(i=0; i<Prec; i++)\n\t\t\t\thig[i] = mid[i];\n\t\t\tcontinue;\n\t\t}\n\n\t\t/* only hard part is if even/odd roundings wants to go up */\n\t\tc = mid[Prec-1] & (Sigbit-1);\n\t\tif(c == Sigbit/2 && (mid[Prec-1]&Sigbit) == 0)\n\t\t\tmid[Prec-1] -= c;\n\t\tbreak;\t/* exactly mid */\n\t}\n\n\t/* normal rounding applies */\n\tc = mid[Prec-1] & (Sigbit-1);\n\tmid[Prec-1] -= c;\n\tif(c >= Sigbit/2) {\n\t\tmid[Prec-1] += Sigbit;\n\t\tfrnorm(mid);\n\t}\n\tgoto out;\n\nret0:\n\treturn 0;\n\nretnan:\n\treturn NAN;\n\nretinf:\n\t/*\n\t * Unix strtod requires these. Plan 9 would return Inf(0) or Inf(-1). */\n\terrno = ERANGE;\n\tif(flag & Fsign)\n\t\treturn -HUGE_VAL;\n\treturn HUGE_VAL;\n\nout:\n\td = 0;\n\tfor(i=0; i<Prec; i++)\n\t\td = d*One + mid[i];\n\tif(flag & Fsign)\n\t\td = -d;\n\td = ldexp(d, bp - Prec*Nbits);\n\tif(d == 0){\t/* underflow */\n\t\terrno = ERANGE;\n\t}\n\treturn d;\n}\n\nstatic void\nfrnorm(ulong *f)\n{\n\tint i, c;\n\n\tc = 0;\n\tfor(i=Prec-1; i>0; i--) {\n\t\tf[i] += c;\n\t\tc = f[i] >> Nbits;\n\t\tf[i] &= One-1;\n\t}\n\tf[0] += c;\n}\n\nstatic int\nfpcmp(char *a, ulong* f)\n{\n\tulong tf[Prec];\n\tint i, d, c;\n\n\tfor(i=0; i<Prec; i++)\n\t\ttf[i] = f[i];\n\n\tfor(;;) {\n\t\t/* tf *= 10 */\n\t\tfor(i=0; i<Prec; i++)\n\t\t\ttf[i] = tf[i]*10;\n\t\tfrnorm(tf);\n\t\td = (tf[0] >> Nbits) + '0';\n\t\ttf[0] &= One-1;\n\n\t\t/* compare next digit */\n\t\tc = *a;\n\t\tif(c == 0) {\n\t\t\tif('0' < d)\n\t\t\t\treturn -1;\n\t\t\tif(tf[0] != 0)\n\t\t\t\tgoto cont;\n\t\t\tfor(i=1; i<Prec; i++)\n\t\t\t\tif(tf[i] != 0)\n\t\t\t\t\tgoto cont;\n\t\t\treturn 0;\n\t\t}\n\t\tif(c > d)\n\t\t\treturn +1;\n\t\tif(c < d)\n\t\t\treturn -1;\n\t\ta++;\n\tcont:;\n\t}\n}\n\nstatic void\ndivby(char *a, int *na, int b)\n{\n\tint n, c;\n\tchar *p;\n\n\tp = a;\n\tn = 0;\n\twhile(n>>b == 0) {\n\t\tc = *a++;\n\t\tif(c == 0) {\n\t\t\twhile(n) {\n\t\t\t\tc = n*10;\n\t\t\t\tif(c>>b)\n\t\t\t\t\tbreak;\n\t\t\t\tn = c;\n\t\t\t}\n\t\t\tgoto xx;\n\t\t}\n\t\tn = n*10 + c-'0';\n\t\t(*na)--;\n\t}\n\tfor(;;) {\n\t\tc = n>>b;\n\t\tn -= c<<b;\n\t\t*p++ = c + '0';\n\t\tc = *a++;\n\t\tif(c == 0)\n\t\t\tbreak;\n\t\tn = n*10 + c-'0';\n\t}\n\t(*na)++;\nxx:\n\twhile(n) {\n\t\tn = n*10;\n\t\tc = n>>b;\n\t\tn -= c<<b;\n\t\t*p++ = c + '0';\n\t\t(*na)++;\n\t}\n\t*p = 0;\n}\n\nstatic\tTab\ttab1[] =\n{\n\t{ 1, 0, \"\" },\n\t{ 3, 1, \"7\" },\n\t{ 6, 2, \"63\" },\n\t{ 9, 3, \"511\" },\n\t{ 13, 4, \"8191\" },\n\t{ 16, 5, \"65535\" },\n\t{ 19, 6, \"524287\" },\n\t{ 23, 7, \"8388607\" },\n\t{ 26, 8, \"67108863\" },\n\t{ 27, 9, \"134217727\" },\n};\n\nstatic void\ndivascii(char *a, int *na, int *dp, int *bp)\n{\n\tint b, d;\n\tTab *t;\n\n\td = *dp;\n\tif(d >= (int)(nelem(tab1)))\n\t\td = (int)(nelem(tab1))-1;\n\tt = tab1 + d;\n\tb = t->bp;\n\tif(memcmp(a, t->cmp, t->siz) > 0)\n\t\td--;\n\t*dp -= d;\n\t*bp += b;\n\tdivby(a, na, b);\n}\n\nstatic void\nmulby(char *a, char *p, char *q, int b)\n{\n\tint n, c;\n\n\tn = 0;\n\t*p = 0;\n\tfor(;;) {\n\t\tq--;\n\t\tif(q < a)\n\t\t\tbreak;\n\t\tc = *q - '0';\n\t\tc = (c<<b) + n;\n\t\tn = c/10;\n\t\tc -= n*10;\n\t\tp--;\n\t\t*p = c + '0';\n\t}\n\twhile(n) {\n\t\tc = n;\n\t\tn = c/10;\n\t\tc -= n*10;\n\t\tp--;\n\t\t*p = c + '0';\n\t}\n}\n\nstatic\tTab\ttab2[] =\n{\n\t{ 1, 1, \"\" },\t\t\t\t/* dp = 0-0 */\n\t{ 3, 3, \"125\" },\n\t{ 6, 5, \"15625\" },\n\t{ 9, 7, \"1953125\" },\n\t{ 13, 10, \"1220703125\" },\n\t{ 16, 12, \"152587890625\" },\n\t{ 19, 14, \"19073486328125\" },\n\t{ 23, 17, \"11920928955078125\" },\n\t{ 26, 19, \"1490116119384765625\" },\n\t{ 27, 19, \"7450580596923828125\" },\t\t/* dp 8-9 */\n};\n\nstatic void\nmulascii(char *a, int *na, int *dp, int *bp)\n{\n\tchar *p;\n\tint d, b;\n\tTab *t;\n\n\td = -*dp;\n\tif(d >= (int)(nelem(tab2)))\n\t\td = (int)(nelem(tab2))-1;\n\tt = tab2 + d;\n\tb = t->bp;\n\tif(memcmp(a, t->cmp, t->siz) < 0)\n\t\td--;\n\tp = a + *na;\n\t*bp -= b;\n\t*dp += d;\n\t*na += d;\n\tmulby(a, p+d, p, b);\n}\n\nstatic int\nxcmp(char *a, char *b)\n{\n\tint c1, c2;\n\n\twhile((c1 = *b++) != '\\0') {\n\t\tc2 = *a++;\n\t\tif(c2 >= 'A' && c2 <= 'Z')\n\t\t\tc2 = c2 - 'A' + 'a';\n\t\tif(c1 != c2)\n\t\t\treturn 1;\n\t}\n\treturn 0;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/svg-device.c",
    "content": "#include \"mupdf/fitz.h\"\n\ntypedef struct svg_device_s svg_device;\n\ntypedef struct tile_s tile;\ntypedef struct font_s font;\ntypedef struct glyph_s glyph;\n\nstruct tile_s\n{\n\tint pattern;\n\tfz_matrix ctm;\n\tfz_rect view;\n\tfz_rect area;\n\tfz_point step;\n};\n\nstruct glyph_s\n{\n\tfloat x_off;\n\tfloat y_off;\n};\n\nstruct font_s\n{\n\tint id;\n\tfz_font *font;\n\tint max_sentlist;\n\tglyph *sentlist;\n};\n\nstruct svg_device_s\n{\n\tfz_context *ctx;\n\tfz_output *out;\n\tfz_output *out_store;\n\tfz_output *defs;\n\tfz_buffer *defs_buffer;\n\tint def_count;\n\n\tint id;\n\n\tint num_tiles;\n\tint max_tiles;\n\ttile *tiles;\n\n\tint num_fonts;\n\tint max_fonts;\n\tfont *fonts;\n};\n\n/* SVG is awkward about letting us define things within symbol definitions\n * so we have to delay definitions until after the symbol definition ends. */\n\nstatic fz_output *\nstart_def(svg_device *sdev)\n{\n\tsdev->def_count++;\n\tif (sdev->def_count == 2)\n\t{\n\t\tif (sdev->defs == NULL)\n\t\t{\n\t\t\tif (sdev->defs_buffer == NULL)\n\t\t\t\tsdev->defs_buffer = fz_new_buffer(sdev->ctx, 1024);\n\t\t\tsdev->defs = fz_new_output_with_buffer(sdev->ctx, sdev->defs_buffer);\n\t\t}\n\t\tsdev->out = sdev->defs;\n\t}\n\treturn sdev->out;\n}\n\nstatic fz_output *\nend_def(svg_device *sdev)\n{\n\tif (sdev->def_count > 0)\n\t\tsdev->def_count--;\n\tif (sdev->def_count == 1)\n\t\tsdev->out = sdev->out_store;\n\tif (sdev->def_count == 0 && sdev->defs_buffer != NULL)\n\t{\n\t\tfz_write(sdev->out, sdev->defs_buffer->data, sdev->defs_buffer->len);\n\t\tsdev->defs_buffer->len = 0;\n\t}\n\treturn sdev->out;\n}\n\n/* Helper functions */\n\nstatic void\nsvg_dev_path(svg_device *sdev, fz_path *path)\n{\n\tfz_output *out = sdev->out;\n\tfloat x, y;\n\tint i, k;\n\tfz_printf(out, \" d=\\\"\");\n\tfor (i = 0, k = 0; i < path->cmd_len; i++)\n\t{\n\t\tswitch (path->cmds[i])\n\t\t{\n\t\tcase FZ_MOVETO:\n\t\t\tx = path->coords[k++];\n\t\t\ty = path->coords[k++];\n\t\t\tfz_printf(out, \"M %g %g \", x, y);\n\t\t\tbreak;\n\t\tcase FZ_LINETO:\n\t\t\tx = path->coords[k++];\n\t\t\ty = path->coords[k++];\n\t\t\tfz_printf(out, \"L %g %g \", x, y);\n\t\t\tbreak;\n\t\tcase FZ_CURVETO:\n\t\t\tx = path->coords[k++];\n\t\t\ty = path->coords[k++];\n\t\t\tfz_printf(out, \"C %g %g \", x, y);\n\t\t\tx = path->coords[k++];\n\t\t\ty = path->coords[k++];\n\t\t\tfz_printf(out, \"%g %g \", x, y);\n\t\t\tx = path->coords[k++];\n\t\t\ty = path->coords[k++];\n\t\t\tfz_printf(out, \"%g %g \", x, y);\n\t\t\tbreak;\n\t\tcase FZ_CLOSE_PATH:\n\t\t\tfz_printf(out, \"Z \");\n\t\t\tbreak;\n\t\t}\n\t}\n\tfz_printf(out, \"\\\"\");\n}\n\nstatic void\nsvg_dev_ctm(svg_device *sdev, const fz_matrix *ctm)\n{\n\tfz_output *out = sdev->out;\n\n\tif (ctm->a != 1.0 || ctm->b != 0 || ctm->c != 0 || ctm->d != 1.0 || ctm->e != 0 || ctm->f != 0)\n\t{\n\t\tfz_printf(out, \" transform=\\\"matrix(%g,%g,%g,%g,%g,%g)\\\"\",\n\t\t\tctm->a, ctm->b, ctm->c, ctm->d, ctm->e, ctm->f);\n\t}\n}\n\nstatic void\nsvg_dev_stroke_state(svg_device *sdev, fz_stroke_state *stroke_state, const fz_matrix *ctm)\n{\n\tfz_output *out = sdev->out;\n\tfloat exp;\n\n\texp = fz_matrix_expansion(ctm);\n\tif (exp == 0)\n\t\texp = 1;\n\n\tfz_printf(out, \" stroke-width=\\\"%g\\\"\", stroke_state->linewidth/exp);\n\tfz_printf(out, \" stroke-linecap=\\\"%s\\\"\",\n\t\t(stroke_state->start_cap == FZ_LINECAP_SQUARE ? \"square\" :\n\t\t\t(stroke_state->start_cap == FZ_LINECAP_ROUND ? \"round\" : \"butt\")));\n\tif (stroke_state->dash_len != 0)\n\t{\n\t\tint i;\n\t\tfz_printf(out, \" stroke-dasharray=\");\n\t\tfor (i = 0; i < stroke_state->dash_len; i++)\n\t\t\tfz_printf(out, \"%c%g\", (i == 0 ? '\\\"' : ','), stroke_state->dash_list[i]);\n\t\tfz_printf(out, \"\\\"\");\n\t\tif (stroke_state->dash_phase != 0)\n\t\t\tfz_printf(out, \" stroke-dashoffset=\\\"%g\\\"\", stroke_state->dash_phase);\n\t}\n\tif (stroke_state->linejoin == FZ_LINEJOIN_MITER || stroke_state->linejoin == FZ_LINEJOIN_MITER_XPS)\n\t\tfz_printf(out, \" stroke-miterlimit=\\\"%g\\\"\", stroke_state->miterlimit);\n\tfz_printf(out, \" stroke-linejoin=\\\"%s\\\"\",\n\t\t(stroke_state->linejoin == FZ_LINEJOIN_BEVEL ? \"bevel\" :\n\t\t\t(stroke_state->linejoin == FZ_LINEJOIN_ROUND ? \"round\" : \"miter\")));\n}\n\nstatic void\nsvg_dev_fill_color(svg_device *sdev, fz_colorspace *colorspace, float *color, float alpha)\n{\n\tfz_context *ctx = sdev->ctx;\n\tfz_output *out = sdev->out;\n\tfloat rgb[FZ_MAX_COLORS];\n\n\tif (colorspace != fz_device_rgb(ctx))\n\t{\n\t\t/* If it's not rgb, make it rgb */\n\t\tcolorspace->to_rgb(ctx, colorspace, color, rgb);\n\t\tcolor = rgb;\n\t}\n\n\tif (color[0] == 0 && color[1] == 0 && color[2] == 0)\n\t{\n\t\t/* don't send a fill, as it will be assumed to be black */\n\t}\n\telse\n\t\tfz_printf(out, \" fill=\\\"rgb(%d,%d,%d)\\\"\", (int)(255*color[0] + 0.5), (int)(255*color[1] + 0.5), (int)(255*color[2]+0.5));\n\tif (alpha != 1)\n\t\tfz_printf(out, \" fill-opacity=\\\"%g\\\"\", alpha);\n}\n\nstatic void\nsvg_dev_stroke_color(svg_device *sdev, fz_colorspace *colorspace, float *color, float alpha)\n{\n\tfz_context *ctx = sdev->ctx;\n\tfz_output *out = sdev->out;\n\tfloat rgb[FZ_MAX_COLORS];\n\n\tif (colorspace != fz_device_rgb(ctx))\n\t{\n\t\t/* If it's not rgb, make it rgb */\n\t\tcolorspace->to_rgb(ctx, colorspace, color, rgb);\n\t\tcolor = rgb;\n\t}\n\n\tfz_printf(out, \" fill=\\\"none\\\" stroke=\\\"rgb(%d,%d,%d)\\\"\", (int)(255*color[0] + 0.5), (int)(255*color[1] + 0.5), (int)(255*color[2]+0.5));\n\tif (alpha != 1)\n\t\tfz_printf(out, \" stroke-opacity=\\\"%g\\\"\", alpha);\n}\n\nstatic inline int\nis_xml_wspace(int c)\n{\n\treturn (c == 9 || /* TAB */\n\t\tc == 0x0a || /* HT */\n\t\tc == 0x0b || /* LF */\n\t\tc == 0x20);\n}\n\nstatic void\nsvg_dev_text(svg_device *sdev, const fz_matrix *ctm, fz_text *text)\n{\n\tfz_output *out = sdev->out;\n\tint i;\n\tfz_matrix inverse;\n\tfz_matrix local_trm;\n\tfloat size;\n\tint start, is_wspace, was_wspace;\n\n\t/* Rely on the fact that trm.{e,f} == 0 */\n\tsize = fz_matrix_expansion(&text->trm);\n\tlocal_trm.a = text->trm.a / size;\n\tlocal_trm.b = text->trm.b / size;\n\tlocal_trm.c = -text->trm.c / size;\n\tlocal_trm.d = -text->trm.d / size;\n\tlocal_trm.e = 0;\n\tlocal_trm.f = 0;\n\tfz_invert_matrix(&inverse, &local_trm);\n\tfz_concat(&local_trm, &local_trm, ctm);\n\n\tfz_printf(out, \" transform=\\\"matrix(%g,%g,%g,%g,%g,%g)\\\"\",\n\t\tlocal_trm.a, local_trm.b, local_trm.c, local_trm.d, local_trm.e, local_trm.f);\n\tfz_printf(out, \" font-size=\\\"%g\\\"\", size);\n\tfz_printf(out, \" font-family=\\\"%s\\\"\", text->font->name);\n\n\t/* Leading (and repeated) whitespace presents a problem for SVG\n\t * text, so elide it here. */\n\tfor (start=0; start < text->len; start++)\n\t{\n\t\tfz_text_item *it = &text->items[start];\n\t\tif (!is_xml_wspace(it->ucs))\n\t\t\tbreak;\n\t}\n\n\tfz_printf(out, \" x=\");\n\twas_wspace = 0;\n\tfor (i=start; i < text->len; i++)\n\t{\n\t\tfz_text_item *it = &text->items[i];\n\t\tfz_point p;\n\t\tis_wspace = is_xml_wspace(it->ucs);\n\t\tif (is_wspace && was_wspace)\n\t\t\tcontinue;\n\t\twas_wspace = is_wspace;\n\t\tp.x = it->x;\n\t\tp.y = it->y;\n\t\tfz_transform_point(&p, &inverse);\n\t\tfz_printf(out, \"%c%g\", i == start ? '\\\"' : ' ', p.x);\n\t}\n\tfz_printf(out, \"\\\" y=\");\n\twas_wspace = 0;\n\tfor (i=start; i < text->len; i++)\n\t{\n\t\tfz_text_item *it = &text->items[i];\n\t\tfz_point p;\n\t\tis_wspace = is_xml_wspace(it->ucs);\n\t\tif (is_wspace && was_wspace)\n\t\t\tcontinue;\n\t\twas_wspace = is_wspace;\n\t\tp.x = it->x;\n\t\tp.y = it->y;\n\t\tfz_transform_point(&p, &inverse);\n\t\tfz_printf(out, \"%c%g\", i == start ? '\\\"' : ' ', p.y);\n\t}\n\tfz_printf(out, \"\\\">\\n\");\n\twas_wspace = 0;\n\tfor (i=start; i < text->len; i++)\n\t{\n\t\tfz_text_item *it = &text->items[i];\n\t\tint c = it->ucs;\n\t\tis_wspace = is_xml_wspace(c);\n\t\tif (is_wspace && was_wspace)\n\t\t\tcontinue;\n\t\twas_wspace = is_wspace;\n\t\tif (c >= 32 && c <= 127 && c != '<' && c != '&')\n\t\t\tfz_printf(out, \"%c\", c);\n\t\telse\n\t\t\tfz_printf(out, \"&#x%04x;\", c);\n\t}\n\tfz_printf(out, \"\\n</text>\\n\");\n}\n\nstatic font *\nsvg_dev_text_as_paths_defs(fz_device *dev, fz_text *text, const fz_matrix *ctm)\n{\n\tsvg_device *sdev = dev->user;\n\tfz_context *ctx = sdev->ctx;\n\tfz_output *out = sdev->out;\n\tint i, font_idx;\n\tfont *fnt;\n\tfz_matrix shift = fz_identity;\n\n\tfor (font_idx = 0; font_idx < sdev->num_fonts; font_idx++)\n\t{\n\t\tif (sdev->fonts[font_idx].font == text->font)\n\t\t\tbreak;\n\t}\n\tif (font_idx == sdev->num_fonts)\n\t{\n\t\t/* New font */\n\t\tif (font_idx == sdev->max_fonts)\n\t\t{\n\t\t\tint newmax = sdev->max_fonts * 2;\n\t\t\tif (newmax == 0)\n\t\t\t\tnewmax = 4;\n\t\t\tsdev->fonts = fz_resize_array(ctx, sdev->fonts, newmax, sizeof(*sdev->fonts));\n\t\t\tmemset(&sdev->fonts[font_idx], 0, (newmax - font_idx) * sizeof(sdev->fonts[0]));\n\t\t\tsdev->max_fonts = newmax;\n\t\t}\n\t\tsdev->fonts[font_idx].id = sdev->id++;\n\t\tsdev->fonts[font_idx].font = fz_keep_font(ctx, text->font);\n\t\tsdev->num_fonts++;\n\t}\n\tfnt = &sdev->fonts[font_idx];\n\n\tfor (i=0; i < text->len; i++)\n\t{\n\t\tfz_text_item *it = &text->items[i];\n\t\tint gid = it->gid;\n\n\t\tif (gid < 0)\n\t\t\tcontinue;\n\t\tif (gid >= fnt->max_sentlist)\n\t\t{\n\t\t\tint j;\n\t\t\tfnt->sentlist = fz_resize_array(ctx, fnt->sentlist, gid+1, sizeof(fnt->sentlist[0]));\n\t\t\tfor (j = fnt->max_sentlist; j <= gid; j++)\n\t\t\t{\n\t\t\t\tfnt->sentlist[j].x_off = FLT_MIN;\n\t\t\t\tfnt->sentlist[j].y_off = FLT_MIN;\n\t\t\t}\n\t\t\tfnt->max_sentlist = gid+1;\n\t\t}\n\t\tif (fnt->sentlist[gid].x_off == FLT_MIN)\n\t\t{\n\t\t\t/* Need to send this one */\n\t\t\tfz_rect rect;\n\t\t\tfz_path *path;\n\t\t\tpath = fz_outline_glyph(sdev->ctx, text->font, gid, &fz_identity);\n\t\t\tif (path)\n\t\t\t{\n\t\t\t\tfz_bound_path(ctx, path, NULL, &fz_identity, &rect);\n\t\t\t\tshift.e = -rect.x0;\n\t\t\t\tshift.f = -rect.y0;\n\t\t\t\tfz_transform_path(ctx, path, &shift);\n\t\t\t\tout = start_def(sdev);\n\t\t\t\tfz_printf(out, \"<symbol id=\\\"font_%x_%x\\\">\", fnt->id, gid);\n\t\t\t\tfz_printf(out, \"<path\");\n\t\t\t\tsvg_dev_path(sdev, path);\n\t\t\t\tfz_printf(out, \"/>\\n\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfz_bound_glyph(ctx, text->font, gid, &fz_identity, &rect);\n\t\t\t\tshift.e = -rect.x0;\n\t\t\t\tshift.f = -rect.y0;\n\t\t\t\tout = start_def(sdev);\n\t\t\t\tfz_printf(out, \"<symbol id=\\\"font_%x_%x\\\">\", fnt->id, gid);\n\t\t\t\tfz_run_t3_glyph(ctx, text->font, gid, &shift, dev);\n\t\t\t}\n\t\t\tfz_printf(out, \"</symbol>\");\n\t\t\tout = end_def(sdev);\n\t\t\tfnt->sentlist[gid].x_off = rect.x0;\n\t\t\tfnt->sentlist[gid].y_off = rect.y0;\n\t\t}\n\t}\n\treturn fnt;\n}\n\nstatic void\nsvg_dev_text_as_paths_fill(fz_device *dev, fz_text *text, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha, font *fnt)\n{\n\tsvg_device *sdev = dev->user;\n\tfz_output *out = sdev->out;\n\tfz_matrix local_trm, local_trm2;\n\tint i;\n\tfz_matrix shift = { 1, 0, 0, 1, 0, 0};\n\n\t/* Rely on the fact that trm.{e,f} == 0 */\n\tlocal_trm.a = text->trm.a;\n\tlocal_trm.b = text->trm.b;\n\tlocal_trm.c = text->trm.c;\n\tlocal_trm.d = text->trm.d;\n\tlocal_trm.e = 0;\n\tlocal_trm.f = 0;\n\n\tfor (i=0; i < text->len; i++)\n\t{\n\t\tfz_text_item *it = &text->items[i];\n\t\tint gid = it->gid;\n\n\t\tif (gid < 0)\n\t\t\tcontinue;\n\n\t\tshift.e = fnt->sentlist[gid].x_off;\n\t\tshift.f = fnt->sentlist[gid].y_off;\n\t\tlocal_trm.e = it->x;\n\t\tlocal_trm.f = it->y;\n\t\tfz_concat(&local_trm2, &local_trm, ctm);\n\t\tfz_concat(&local_trm2, &shift, &local_trm2);\n\t\tfz_printf(out, \"<use xlink:href=\\\"#font_%x_%x\\\"\", fnt->id, gid);\n\t\tsvg_dev_ctm(sdev, &local_trm2);\n\t\tsvg_dev_fill_color(sdev, colorspace, color, alpha);\n\t\tfz_printf(out, \"/>\\n\");\n\t}\n}\n\nstatic void\nsvg_dev_text_as_paths_stroke(fz_device *dev, fz_text *text,\n\tfz_stroke_state *stroke, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha, font *fnt)\n{\n\tsvg_device *sdev = dev->user;\n\tfz_output *out = sdev->out;\n\tfz_matrix local_trm, local_trm2;\n\tint i;\n\tfz_matrix shift = { 1, 0, 0, 1, 0, 0};\n\n\t/* Rely on the fact that trm.{e,f} == 0 */\n\tlocal_trm.a = text->trm.a;\n\tlocal_trm.b = text->trm.b;\n\tlocal_trm.c = text->trm.c;\n\tlocal_trm.d = text->trm.d;\n\tlocal_trm.e = 0;\n\tlocal_trm.f = 0;\n\n\tfor (i=0; i < text->len; i++)\n\t{\n\t\tfz_text_item *it = &text->items[i];\n\t\tint gid = it->gid;\n\n\t\tif (gid < 0)\n\t\t\tcontinue;\n\n\t\tshift.e = fnt->sentlist[gid].x_off;\n\t\tshift.f = fnt->sentlist[gid].y_off;\n\t\tlocal_trm.e = it->x;\n\t\tlocal_trm.f = it->y;\n\t\tfz_concat(&local_trm2, &local_trm, ctm);\n\t\tfz_concat(&local_trm2, &shift, &local_trm2);\n\t\tfz_printf(out, \"<use xlink:href=\\\"#font_%x_%x\\\"\", fnt->id, gid);\n\t\tsvg_dev_stroke_state(sdev, stroke, &local_trm2);\n\t\tsvg_dev_ctm(sdev, &local_trm2);\n\t\tsvg_dev_stroke_color(sdev, colorspace, color, alpha);\n\t\tfz_printf(out, \"/>\\n\");\n\t}\n}\n\n/* Entry points */\n\nstatic void\nsvg_dev_fill_path(fz_device *dev, fz_path *path, int even_odd, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tsvg_device *sdev = dev->user;\n\tfz_output *out = sdev->out;\n\n\tfz_printf(out, \"<path\");\n\tsvg_dev_ctm(sdev, ctm);\n\tsvg_dev_path(sdev, path);\n\tsvg_dev_fill_color(sdev, colorspace, color, alpha);\n\tif (even_odd)\n\t\tfz_printf(out, \" fill-rule=\\\"evenodd\\\"\");\n\tfz_printf(out, \"/>\\n\");\n}\n\nstatic void\nsvg_dev_stroke_path(fz_device *dev, fz_path *path, fz_stroke_state *stroke, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tsvg_device *sdev = dev->user;\n\tfz_output *out = sdev->out;\n\n\tfz_printf(out, \"<path\");\n\tsvg_dev_ctm(sdev, ctm);\n\tsvg_dev_stroke_state(sdev, stroke, &fz_identity);\n\tsvg_dev_stroke_color(sdev, colorspace, color, alpha);\n\tsvg_dev_path(sdev, path);\n\tfz_printf(out, \"/>\\n\");\n}\n\nstatic void\nsvg_dev_clip_path(fz_device *dev, fz_path *path, const fz_rect *rect, int even_odd, const fz_matrix *ctm)\n{\n\tsvg_device *sdev = dev->user;\n\tfz_output *out;\n\tint num = sdev->id++;\n\n\tout = start_def(sdev);\n\tfz_printf(out, \"<clipPath id=\\\"cp%d\\\">\\n\", num);\n\tfz_printf(out, \"<path\");\n\tsvg_dev_ctm(sdev, ctm);\n\tsvg_dev_path(sdev, path);\n\tif (even_odd)\n\t\tfz_printf(out, \" fill-rule=\\\"evenodd\\\"\");\n\tfz_printf(out, \"/>\\n</clipPath>\\n\");\n\tout = end_def(sdev);\n\tfz_printf(out, \"<g clip-path=\\\"url(#cp%d)\\\">\\n\", num);\n}\n\nstatic void\nsvg_dev_clip_stroke_path(fz_device *dev, fz_path *path, const fz_rect *rect, fz_stroke_state *stroke, const fz_matrix *ctm)\n{\n\tsvg_device *sdev = dev->user;\n\tfz_output *out;\n\tfz_context *ctx = dev->ctx;\n\tfz_rect bounds;\n\tint num = sdev->id++;\n\tfloat white[3] = { 1, 1, 1 };\n\n\tfz_bound_path(ctx, path, stroke, ctm, &bounds);\n\n\tout = start_def(sdev);\n\tfz_printf(out, \"<mask id=\\\"ma%d\\\" x=\\\"%g\\\" y=\\\"%g\\\" width=\\\"%g\\\" height=\\\"%g\\\" maskUnits=\\\"userSpaceOnUse\\\" maskContentUnits=\\\"userSpaceOnUse\\\">\\n\",\n\t\tnum, bounds.x0, bounds.y0, bounds.x1 - bounds.x0, bounds.y1 - bounds.y0);\n\tfz_printf(out, \"<path\");\n\tsvg_dev_ctm(sdev, ctm);\n\tsvg_dev_stroke_state(sdev, stroke, &fz_identity);\n\tsvg_dev_stroke_color(sdev, fz_device_rgb(ctx), white, 1);\n\tsvg_dev_path(sdev, path);\n\tfz_printf(out, \"/>\\n</mask>\\n\");\n\tout = end_def(sdev);\n\tfz_printf(out, \"<g mask=\\\"url(#ma%d)\\\">\\n\", num);\n}\n\nstatic void\nsvg_dev_fill_text(fz_device *dev, fz_text *text, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tsvg_device *sdev = dev->user;\n\tfz_output *out = sdev->out;\n\tfont *fnt;\n\n\tfz_printf(out, \"<text\");\n\tsvg_dev_fill_color(sdev, colorspace, color, 0.0f);\n\tsvg_dev_text(sdev, ctm, text);\n\tfnt = svg_dev_text_as_paths_defs(dev, text, ctm);\n\tsvg_dev_text_as_paths_fill(dev, text, ctm, colorspace, color, alpha, fnt);\n}\n\nstatic void\nsvg_dev_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tsvg_device *sdev = dev->user;\n\tfz_output *out = sdev->out;\n\tfont *fnt;\n\n\tfz_printf(out, \"<text\");\n\tsvg_dev_fill_color(sdev, colorspace, color, 0.0f);\n\tsvg_dev_text(sdev, ctm, text);\n\tfnt = svg_dev_text_as_paths_defs(dev, text, ctm);\n\tsvg_dev_text_as_paths_stroke(dev, text, stroke, ctm, colorspace, color, alpha, fnt);\n}\n\nstatic void\nsvg_dev_clip_text(fz_device *dev, fz_text *text, const fz_matrix *ctm, int accumulate)\n{\n\tsvg_device *sdev = dev->user;\n\tfz_output *out = sdev->out;\n\tfz_context *ctx = dev->ctx;\n\tfz_rect bounds;\n\tint num = sdev->id++;\n\tfloat white[3] = { 1, 1, 1 };\n\tfont *fnt;\n\n\tfz_bound_text(ctx, text, NULL, ctm, &bounds);\n\n\tout = start_def(sdev);\n\tfz_printf(out, \"<mask id=\\\"ma%d\\\" x=\\\"%g\\\" y=\\\"%g\\\" width=\\\"%g\\\" height=\\\"%g\\\" maskUnits=\\\"userSpaceOnUse\\\" maskContentUnits=\\\"userSpaceOnUse\\\">\\n\",\n\t\tnum, bounds.x0, bounds.y0, bounds.x1 - bounds.x0, bounds.y1 - bounds.y0);\n\tfz_printf(out, \"<text\");\n\tsvg_dev_fill_color(sdev, fz_device_rgb(ctx), white, 0.0f);\n\tsvg_dev_text(sdev, ctm, text);\n\tfnt = svg_dev_text_as_paths_defs(dev, text, ctm);\n\tsvg_dev_text_as_paths_fill(dev, text, ctm, fz_device_rgb(ctx), white, 1.0f, fnt);\n\tfz_printf(out, \"</mask>\\n\");\n\tout = end_def(sdev);\n\tfz_printf(out, \"<g mask=\\\"url(#ma%d)\\\">\\n\", num);\n}\n\nstatic void\nsvg_dev_clip_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, const fz_matrix *ctm)\n{\n\tsvg_device *sdev = dev->user;\n\tfz_output *out;\n\tfz_context *ctx = dev->ctx;\n\tfz_rect bounds;\n\tint num = sdev->id++;\n\tfloat white[3] = { 255, 255, 255 };\n\tfont *fnt;\n\n\tfz_bound_text(ctx, text, NULL, ctm, &bounds);\n\n\tout = start_def(sdev);\n\tfz_printf(out, \"<mask id=\\\"ma%d\\\" x=\\\"%g\\\" y=\\\"%g\\\" width=\\\"%g\\\" height=\\\"%g\\\" maskUnits=\\\"userSpaceOnUse\\\" maskContentUnits=\\\"userSpaceOnUse\\\">\\n\",\n\t\tnum, bounds.x0, bounds.y0, bounds.x1 - bounds.x0, bounds.y1 - bounds.y0);\n\tfz_printf(out, \"<text\");\n\tsvg_dev_stroke_state(sdev, stroke, &fz_identity);\n\tsvg_dev_stroke_color(sdev, fz_device_rgb(ctx), white, 0.0f);\n\tsvg_dev_text(sdev, ctm, text);\n\tfnt = svg_dev_text_as_paths_defs(dev, text, ctm);\n\tsvg_dev_text_as_paths_stroke(dev, text, stroke, ctm, fz_device_rgb(ctx), white, 1.0f, fnt);\n\tfz_printf(out, \"</mask>\\n\");\n\tout = end_def(sdev);\n\tfz_printf(out, \"<g mask=\\\"url(#ma%d)\\\">\\n\", num);\n}\n\nstatic void\nsvg_dev_ignore_text(fz_device *dev, fz_text *text, const fz_matrix *ctm)\n{\n\tsvg_device *sdev = dev->user;\n\tfz_output *out = sdev->out;\n\tfloat black[3] = { 0, 0, 0};\n\n\tfz_printf(out, \"<text\");\n\tsvg_dev_fill_color(sdev, fz_device_rgb(sdev->ctx), black, 0.0f);\n\tsvg_dev_text(sdev, ctm, text);\n}\n\nstatic void\nsend_data_base64(fz_output *out, fz_buffer *buffer)\n{\n\tint i, len;\n\tstatic const char set[] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n\tlen = buffer->len/3;\n\tfor (i = 0; i < len; i++)\n\t{\n\t\tint c = buffer->data[3*i];\n\t\tint d = buffer->data[3*i+1];\n\t\tint e = buffer->data[3*i+2];\n\t\tif ((i & 15) == 0)\n\t\t\tfz_printf(out, \"\\n\");\n\t\tfz_printf(out, \"%c%c%c%c\", set[c>>2], set[((c&3)<<4)|(d>>4)], set[((d&15)<<2)|(e>>6)], set[e & 63]);\n\t}\n\ti *= 3;\n\tswitch (buffer->len-i)\n\t{\n\t\tcase 2:\n\t\t{\n\t\t\tint c = buffer->data[i];\n\t\t\tint d = buffer->data[i+1];\n\t\t\tfz_printf(out, \"%c%c%c=\", set[c>>2], set[((c&3)<<4)|(d>>4)], set[((d&15)<<2)]);\n\t\t\tbreak;\n\t\t}\n\tcase 1:\n\t\t{\n\t\t\tint c = buffer->data[i];\n\t\t\tfz_printf(out, \"%c%c==\", set[c>>2], set[(c&3)<<4]);\n\t\t\tbreak;\n\t\t}\n\tdefault:\n\tcase 0:\n\t\tbreak;\n\t}\n}\n\nstatic void\nsvg_dev_fill_image(fz_device *dev, fz_image *image, const fz_matrix *ctm, float alpha)\n{\n\tsvg_device *sdev = (svg_device *)dev->user;\n\tfz_context *ctx = dev->ctx;\n\tfz_output *out = sdev->out;\n\tfz_matrix local_ctm = *ctm;\n\tfz_matrix scale = { 0 };\n\n\tscale.a = 1.0f / image->w;\n\tscale.d = 1.0f / image->h;\n\n\tfz_concat(&local_ctm, &scale, ctm);\n\tif (alpha != 1.0f)\n\t\tfz_printf(out, \"<g opacity=\\\"%g\\\">\", alpha);\n\tfz_printf(out, \"<image\");\n\tsvg_dev_ctm(sdev, &local_ctm);\n\tfz_printf(out, \" width=\\\"%dpx\\\" height=\\\"%dpx\\\" xlink:href=\\\"data:\", image->w, image->h);\n\tswitch (image->buffer == NULL ? FZ_IMAGE_JPX : image->buffer->params.type)\n\t{\n\tcase FZ_IMAGE_JPEG:\n\t\tfz_printf(out, \"image/jpeg;base64,\");\n\t\tsend_data_base64(out, image->buffer->buffer);\n\t\tbreak;\n\tcase FZ_IMAGE_PNG:\n\t\tfz_printf(out, \"image/png;base64,\");\n\t\tsend_data_base64(out, image->buffer->buffer);\n\t\tbreak;\n\tdefault:\n\t\t{\n\t\t\tfz_buffer *buf = fz_new_png_from_image(ctx, image, image->w, image->h);\n\t\t\tfz_printf(out, \"image/png;base64,\");\n\t\t\tsend_data_base64(out, buf);\n\t\t\tfz_drop_buffer(ctx, buf);\n\t\t\tbreak;\n\t\t}\n\t}\n\tfz_printf(out, \"\\\"/>\\n\");\n\tif (alpha != 1.0f)\n\t\tfz_printf(out, \"</g>\");\n}\n\nstatic void\nsvg_dev_fill_shade(fz_device *dev, fz_shade *shade, const fz_matrix *ctm, float alpha)\n{\n\tsvg_device *sdev = (svg_device *)dev->user;\n\tfz_context *ctx = dev->ctx;\n\tfz_output *out = sdev->out;\n\tfz_rect rect;\n\tfz_irect bbox;\n\tfz_pixmap *pix;\n\tfz_buffer *buf = NULL;\n\n\tfz_var(buf);\n\n\tif (dev->container_len == 0)\n\t\treturn;\n\n\tfz_round_rect(&bbox, fz_intersect_rect(fz_bound_shade(ctx, shade, ctm, &rect), &dev->container[dev->container_len-1].scissor));\n\tif (fz_is_empty_irect(&bbox))\n\t\treturn;\n\tpix = fz_new_pixmap_with_bbox(ctx, fz_device_rgb(ctx), &bbox);\n\tfz_clear_pixmap(ctx, pix);\n\n\tfz_try(ctx)\n\t{\n\t\tfz_paint_shade(ctx, shade, ctm, pix, &bbox);\n\t\tbuf = fz_new_png_from_pixmap(ctx, pix);\n\t\tif (alpha != 1.0f)\n\t\t\tfz_printf(out, \"<g opacity=\\\"%g\\\">\", alpha);\n\t\tfz_printf(out, \"<image x=\\\"%dpx\\\" y=\\\"%dpx\\\" width=\\\"%dpx\\\" height=\\\"%dpx\\\" xlink:href=\\\"data:image/png;base64,\", pix->x, pix->y, pix->w, pix->h);\n\t\tsend_data_base64(out, buf);\n\t\tfz_printf(out, \"\\\"/>\\n\");\n\t\tif (alpha != 1.0f)\n\t\t\tfz_printf(out, \"</g>\");\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, buf);\n\t\tfz_drop_pixmap(ctx, pix);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void\nsvg_dev_fill_image_mask(fz_device *dev, fz_image *image, const fz_matrix *ctm,\nfz_colorspace *colorspace, float *color, float alpha)\n{\n\tsvg_device *sdev = (svg_device *)dev->user;\n\tfz_context *ctx = dev->ctx;\n\tfz_output *out;\n\tfz_matrix local_ctm = *ctm;\n\tfz_matrix scale = { 0 };\n\tint mask = sdev->id++;\n\n\tscale.a = 1.0f / image->w;\n\tscale.d = 1.0f / image->h;\n\n\tfz_concat(&local_ctm, &scale, ctm);\n\tout = start_def(sdev);\n\tfz_printf(out, \"<mask id=\\\"ma%d\\\"><image\", mask);\n\tfz_printf(out, \" width=\\\"%dpx\\\" height=\\\"%dpx\\\" xlink:href=\\\"data:\", image->w, image->h);\n\tswitch (image->buffer == NULL ? FZ_IMAGE_JPX : image->buffer->params.type)\n\t{\n\tcase FZ_IMAGE_JPEG:\n\t\tfz_printf(out, \"image/jpeg;base64,\");\n\t\tsend_data_base64(out, image->buffer->buffer);\n\t\tbreak;\n\tcase FZ_IMAGE_PNG:\n\t\tfz_printf(out, \"image/png;base64,\");\n\t\tsend_data_base64(out, image->buffer->buffer);\n\t\tbreak;\n\tdefault:\n\t\t{\n\t\t\tfz_buffer *buf = fz_new_png_from_image(ctx, image, image->w, image->h);\n\t\t\tfz_printf(out, \"image/png;base64,\");\n\t\t\tsend_data_base64(out, buf);\n\t\t\tfz_drop_buffer(ctx, buf);\n\t\t\tbreak;\n\t\t}\n\t}\n\tfz_printf(out, \"\\\"/></mask>\\n\");\n\tout = end_def(sdev);\n\tfz_printf(out, \"<rect x=\\\"0\\\" y=\\\"0\\\" width=\\\"%d\\\" height=\\\"%d\\\"\", image->w, image->h);\n\tsvg_dev_fill_color(sdev, colorspace, color, alpha);\n\tsvg_dev_ctm(sdev, &local_ctm);\n\tfz_printf(out, \" mask=\\\"url(#ma%d)\\\"/>\\n\", mask);\n}\n\nstatic void\nsvg_dev_clip_image_mask(fz_device *dev, fz_image *image, const fz_rect *rect, const fz_matrix *ctm)\n{\n\tsvg_device *sdev = (svg_device *)dev->user;\n\tfz_context *ctx = dev->ctx;\n\tfz_output *out;\n\tfz_matrix local_ctm = *ctm;\n\tfz_matrix scale = { 0 };\n\tint mask = sdev->id++;\n\n\tscale.a = 1.0f / image->w;\n\tscale.d = 1.0f / image->h;\n\n\tfz_concat(&local_ctm, &scale, ctm);\n\tout = start_def(sdev);\n\tfz_printf(out, \"<mask id=\\\"ma%d\\\"><image\", mask);\n\tsvg_dev_ctm(sdev, &local_ctm);\n\tfz_printf(out, \" width=\\\"%dpx\\\" height=\\\"%dpx\\\" xlink:href=\\\"data:\", image->w, image->h);\n\tswitch (image->buffer == NULL ? FZ_IMAGE_JPX : image->buffer->params.type)\n\t{\n\tcase FZ_IMAGE_JPEG:\n\t\tfz_printf(out, \"image/jpeg;base64,\");\n\t\tsend_data_base64(out, image->buffer->buffer);\n\t\tbreak;\n\tcase FZ_IMAGE_PNG:\n\t\tfz_printf(out, \"image/png;base64,\");\n\t\tsend_data_base64(out, image->buffer->buffer);\n\t\tbreak;\n\tdefault:\n\t\t{\n\t\t\tfz_buffer *buf = fz_new_png_from_image(ctx, image, image->w, image->h);\n\t\t\tfz_printf(out, \"image/png;base64,\");\n\t\t\tsend_data_base64(out, buf);\n\t\t\tfz_drop_buffer(ctx, buf);\n\t\t\tbreak;\n\t\t}\n\t}\n\tfz_printf(out, \"\\\"/></mask>\\n\");\n\tout = end_def(sdev);\n\tfz_printf(out, \"<g mask=\\\"url(#ma%d)\\\">\\n\", mask);\n}\n\nstatic void\nsvg_dev_pop_clip(fz_device *dev)\n{\n\tsvg_device *sdev = (svg_device *)dev->user;\n\tfz_output *out = sdev->out;\n\n\t/* FIXME */\n\tfz_printf(out, \"</g>\\n\");\n}\n\nstatic void\nsvg_dev_begin_mask(fz_device *dev, const fz_rect *bbox, int luminosity, fz_colorspace *colorspace, float *color)\n{\n\tsvg_device *sdev = (svg_device *)dev->user;\n\tfz_output *out;\n\tint mask = sdev->id++;\n\n\tout = start_def(sdev);\n\tfz_printf(out, \"<mask id=\\\"ma%d\\\">\", mask);\n\n\tif (dev->container_len > 0)\n\t\tdev->container[dev->container_len-1].user = mask;\n}\n\nstatic void\nsvg_dev_end_mask(fz_device *dev)\n{\n\tsvg_device *sdev = (svg_device *)dev->user;\n\tfz_output *out = sdev->out;\n\tint mask = 0;\n\n\tif (dev->container_len > 0)\n\t\tmask = (int)dev->container[dev->container_len-1].user;\n\n\tfz_printf(out, \"\\\"/></mask>\\n\");\n\tout = end_def(sdev);\n\tfz_printf(out, \"<g mask=\\\"url(#ma%d)\\\">\\n\", mask);\n\n}\n\nstatic void\nsvg_dev_begin_group(fz_device *dev, const fz_rect *bbox, int isolated, int knockout, int blendmode, float alpha)\n{\n\tsvg_device *sdev = (svg_device *)dev->user;\n\tfz_output *out = sdev->out;\n\n\t/* SVG 1.1 doesn't support adequate blendmodes/knockout etc, so just ignore it for now */\n\tfz_printf(out, \"<g>\\n\");\n}\n\nstatic void\nsvg_dev_end_group(fz_device *dev)\n{\n\tsvg_device *sdev = (svg_device *)dev->user;\n\tfz_output *out = sdev->out;\n\n\tfz_printf(out, \"</g>\\n\");\n}\n\nstatic int\nsvg_dev_begin_tile(fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, const fz_matrix *ctm, int id)\n{\n\tsvg_device *sdev = (svg_device *)dev->user;\n\tfz_output *out;\n\tfz_context *ctx = dev->ctx;\n\tint num;\n\ttile *t;\n\n\tif (sdev->num_tiles == sdev->max_tiles)\n\t{\n\t\tint n = (sdev->num_tiles == 0 ? 4 : sdev->num_tiles * 2);\n\n\t\tsdev->tiles = fz_resize_array(ctx, sdev->tiles, n, sizeof(tile));\n\t\tsdev->max_tiles = n;\n\t}\n\tnum = sdev->num_tiles++;\n\tt = &sdev->tiles[num];\n\tt->area = *area;\n\tt->view = *view;\n\tt->ctm = *ctm;\n\tt->pattern = sdev->id++;\n\tt->step.x = xstep;\n\tt->step.y = ystep;\n\n\t/* view = area of our reference tile in pattern space.\n\t * area = area to tile into in pattern space.\n\t * xstep/ystep = pattern repeat step in pattern space.\n\t * All of these need to be transformed by ctm to get to device space.\n\t * SVG only allows us to specify pattern tiles as axis aligned\n\t * rectangles, so we send these through as is, and ensure that the\n\t * correct matrix is used on the fill.\n\t */\n\n\t/* The first thing we do is to capture the contents of the pattern\n\t * as a symbol we can reuse. */\n\tout = start_def(sdev);\n\tfz_printf(out, \"<symbol id=\\\"pac%d\\\">\\n\", t->pattern);\n\n\treturn 0;\n}\n\nstatic void\nsvg_dev_end_tile(fz_device *dev)\n{\n\tsvg_device *sdev = (svg_device *)dev->user;\n\tfz_output *out = sdev->out;\n\tint num, cp = -1;\n\ttile *t;\n\tfz_matrix inverse;\n\tfloat x, y, w, h;\n\n\tif (sdev->num_tiles == 0)\n\t\treturn;\n\tnum = --sdev->num_tiles;\n\tt = &sdev->tiles[num];\n\n\tfz_printf(out, \"</symbol>\\n\");\n\n\t/* In svg, the reference tile is taken from (x,y) to (x+width,y+height)\n\t * and is repeated at (x+n*width,y+m*height) for all integer n and m.\n\t * This means that width and height generally correspond to xstep and\n\t * ystep. There are exceptional cases where we have to break this\n\t * though; when xstep/ystep are smaller than the width/height of the\n\t * pattern tile, we need to render the pattern contents several times\n\t * to ensure that the pattern tile contains everything. */\n\n\tfz_printf(out, \"<pattern id=\\\"pa%d\\\" patternUnits=\\\"userSpaceOnUse\\\" patternContentUnits=\\\"userSpaceOnUse\\\"\",\n\t\tt->pattern);\n\tfz_printf(out, \" x=\\\"0\\\" y=\\\"0\\\" width=\\\"%g\\\" height=\\\"%g\\\">\\n\",\n\t\tt->step.x, t->step.y);\n\n\tif (t->view.x0 > 0 || t->step.x < t->view.x1 || t->view.y0 > 0 || t->step.y < t->view.y1)\n\t{\n\t\tcp = sdev->id++;\n\t\tfz_printf(out, \"<clipPath id=\\\"cp%d\\\">\\n\", cp);\n\t\tfz_printf(out, \"<path d=\\\"M %g %g L %g %g L %g %g L %g %g Z\\\"/>\",\n\t\t\tt->view.x0, t->view.y0,\n\t\t\tt->view.x1, t->view.y0,\n\t\t\tt->view.x1, t->view.y1,\n\t\t\tt->view.x0, t->view.y1);\n\t\tfz_printf(out, \"</clipPath>\\n\");\n\t\tfz_printf(out, \"<g clip-path=\\\"url(#cp%d)\\\">\\n\", cp);\n\t}\n\n\t/* All the pattern contents will have their own ctm applied. Let's\n\t * undo the current one to allow for this */\n\tfz_invert_matrix(&inverse, &t->ctm);\n\tfz_printf(out, \"<g\");\n\tsvg_dev_ctm(sdev, &inverse);\n\tfz_printf(out, \">\\n\");\n\n\tw = t->view.x1 - t->view.x0;\n\th = t->view.y1 - t->view.y0;\n\n\tfor (x = 0; x > -w; x -= t->step.x)\n\t\tfor (y = 0; y > -h; y -= t->step.y)\n\t\t\tfz_printf(out, \"<use x=\\\"%g\\\" y=\\\"%g\\\" xlink:href=\\\"#pac%d\\\"/>\", x, y, t->pattern);\n\n\tfz_printf(out, \"</g>\\n\");\n\tif (cp != -1)\n\t\tfz_printf(out, \"</g>\\n\");\n\tfz_printf(out, \"</pattern>\\n\");\n\tout = end_def(sdev);\n\n\t/* Finally, fill a rectangle with the pattern. */\n\tfz_printf(out, \"<rect\");\n\tsvg_dev_ctm(sdev, &t->ctm);\n\tfz_printf(out, \" fill=\\\"url(#pa%d)\\\" x=\\\"%g\\\" y=\\\"%g\\\" width=\\\"%g\\\" height=\\\"%g\\\"/>\\n\",\n\t\tt->pattern, t->area.x0, t->area.y0, t->area.x1 - t->area.x0, t->area.y1 - t->area.y0);\n}\n\nstatic void\nsvg_dev_free_user(fz_device *dev)\n{\n\tsvg_device *sdev = dev->user;\n\tfz_context *ctx = sdev->ctx;\n\tfz_output *out = sdev->out;\n\n\tfz_free(ctx, sdev->tiles);\n\tfz_drop_buffer(ctx, sdev->defs_buffer);\n\tfz_close_output(sdev->defs);\n\n\tfz_printf(out, \"</svg>\\n\");\n\n\tfz_free(ctx, sdev);\n}\n\nvoid svg_rebind(fz_device *dev)\n{\n\tsvg_device *sdev = dev->user;\n\n\tsdev->ctx = dev->ctx;\n\tfz_rebind_output(sdev->out, sdev->ctx);\n\tfz_rebind_output(sdev->out_store, sdev->ctx);\n}\n\nfz_device *fz_new_svg_device(fz_context *ctx, fz_output *out, float page_width, float page_height)\n{\n\tsvg_device *sdev = fz_malloc_struct(ctx, svg_device);\n\tfz_device *dev;\n\n\tfz_try(ctx)\n\t{\n\t\tsdev->ctx = ctx;\n\t\tsdev->out = out;\n\t\tsdev->out_store = out;\n\t\tsdev->id = 0;\n\n\t\tdev = fz_new_device(ctx, sdev);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, sdev);\n\t\tfz_rethrow(ctx);\n\t}\n\n\tdev->rebind = svg_rebind;\n\tdev->free_user = svg_dev_free_user;\n\n\tdev->fill_path = svg_dev_fill_path;\n\tdev->stroke_path = svg_dev_stroke_path;\n\tdev->clip_path = svg_dev_clip_path;\n\tdev->clip_stroke_path = svg_dev_clip_stroke_path;\n\n\tdev->fill_text = svg_dev_fill_text;\n\tdev->stroke_text = svg_dev_stroke_text;\n\tdev->clip_text = svg_dev_clip_text;\n\tdev->clip_stroke_text = svg_dev_clip_stroke_text;\n\tdev->ignore_text = svg_dev_ignore_text;\n\n\tdev->fill_shade = svg_dev_fill_shade;\n\tdev->fill_image = svg_dev_fill_image;\n\tdev->fill_image_mask = svg_dev_fill_image_mask;\n\tdev->clip_image_mask = svg_dev_clip_image_mask;\n\n\tdev->pop_clip = svg_dev_pop_clip;\n\n\tdev->begin_mask = svg_dev_begin_mask;\n\tdev->end_mask = svg_dev_end_mask;\n\tdev->begin_group = svg_dev_begin_group;\n\tdev->end_group = svg_dev_end_group;\n\n\tdev->begin_tile = svg_dev_begin_tile;\n\tdev->end_tile = svg_dev_end_tile;\n\n\tdev->hints |= FZ_MAINTAIN_CONTAINER_STACK;\n\n\tfz_printf(out, \"<?xml version=\\\"1.0\\\" standalone=\\\"no\\\"?>\\n\");\n\tfz_printf(out, \"<!DOCTYPE svg PUBLIC \\\"-//W3C//DTD SVG 1.1//EN\\\" \\\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\\\">\\n\");\n\tfz_printf(out, \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" \"\n\t\t\"xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\" version=\\\"1.1\\\" \"\n\t\t\"width=\\\"%gcm\\\" height=\\\"%gcm\\\" viewBox=\\\"0 0 %g %g\\\">\\n\",\n\t\tpage_width*2.54/72, page_height*2.54/72, page_width, page_height);\n\n\treturn dev;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/test-device.c",
    "content": "#include <mupdf/fitz.h>\n\nstruct test\n{\n\tint *is_color;\n\tfloat threshold;\n};\n\nstatic int\nis_rgb_color(float threshold, float r, float g, float b)\n{\n\tfloat rg_diff = fz_abs(r - g);\n\tfloat rb_diff = fz_abs(r - b);\n\tfloat gb_diff = fz_abs(g - b);\n\treturn rg_diff > threshold || rb_diff > threshold || gb_diff > threshold;\n}\n\nstatic int\nis_rgb_color_u8(int threshold_u8, int r, int g, int b)\n{\n\tint rg_diff = fz_absi(r - g);\n\tint rb_diff = fz_absi(r - b);\n\tint gb_diff = fz_absi(g - b);\n\treturn rg_diff > threshold_u8 || rb_diff > threshold_u8 || gb_diff > threshold_u8;\n}\n\nstatic void\nfz_test_color(fz_device *dev, fz_colorspace *colorspace, const float *color)\n{\n\tfz_context *ctx = dev->ctx;\n\tstruct test *t = dev->user;\n\n\tif (!*t->is_color && colorspace && colorspace != fz_device_gray(ctx))\n\t{\n\t\tif (colorspace == fz_device_rgb(ctx))\n\t\t{\n\t\t\tif (is_rgb_color(t->threshold, color[0], color[1], color[2]))\n\t\t\t{\n\t\t\t\t*t->is_color = 1;\n\t\t\t\tdev->hints |= FZ_IGNORE_IMAGE;\n\t\t\t\tfz_throw(ctx, FZ_ERROR_ABORT, \"Page found as color; stopping interpretation\");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfloat rgb[3];\n\t\t\tfz_convert_color(ctx, fz_device_rgb(ctx), rgb, colorspace, color);\n\t\t\tif (is_rgb_color(t->threshold, rgb[0], rgb[1], rgb[2]))\n\t\t\t{\n\t\t\t\t*t->is_color = 1;\n\t\t\t\tdev->hints |= FZ_IGNORE_IMAGE;\n\t\t\t\tfz_throw(ctx, FZ_ERROR_ABORT, \"Page found as color; stopping interpretation\");\n\t\t\t}\n\t\t}\n\t}\n}\n\nstatic void\nfz_test_fill_path(fz_device *dev, fz_path *path, int even_odd, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tif (alpha != 0.0f)\n\t\tfz_test_color(dev, colorspace, color);\n}\n\nstatic void\nfz_test_stroke_path(fz_device *dev, fz_path *path, fz_stroke_state *stroke,\n\tconst fz_matrix *ctm, fz_colorspace *colorspace, float *color, float alpha)\n{\n\tif (alpha != 0.0f)\n\t\tfz_test_color(dev, colorspace, color);\n}\n\nstatic void\nfz_test_fill_text(fz_device *dev, fz_text *text, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tif (alpha != 0.0f)\n\t\tfz_test_color(dev, colorspace, color);\n}\n\nstatic void\nfz_test_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke,\n\tconst fz_matrix *ctm, fz_colorspace *colorspace, float *color, float alpha)\n{\n\tif (alpha != 0.0f)\n\t\tfz_test_color(dev, colorspace, color);\n}\n\nstruct shadearg\n{\n\tfz_device *dev;\n\tfz_shade *shade;\n};\n\nstatic void\nprepare_vertex(void *arg0, fz_vertex *v, const float *color)\n{\n\tstruct shadearg *arg = arg0;\n\tfz_device *dev = arg->dev;\n\tfz_shade *shade = arg->shade;\n\tif (!shade->use_function)\n\t\tfz_test_color(dev, shade->colorspace, color);\n}\n\nstatic void\nfz_test_fill_shade(fz_device *dev, fz_shade *shade, const fz_matrix *ctm, float alpha)\n{\n\tfz_context *ctx = dev->ctx;\n\n\tif (shade->use_function)\n\t{\n\t\tint i;\n\t\tfor (i = 0; i < 256; i++)\n\t\t\tfz_test_color(dev, shade->colorspace, shade->function[i]);\n\t}\n\telse\n\t{\n\t\tstruct shadearg arg;\n\t\targ.dev = dev;\n\t\targ.shade = shade;\n\t\tfz_process_mesh(ctx, shade, ctm, prepare_vertex, NULL, &arg);\n\t}\n}\n\nstatic void\nfz_test_fill_image(fz_device *dev, fz_image *image, const fz_matrix *ctm, float alpha)\n{\n\tfz_context *ctx = dev->ctx;\n\tstruct test *t = dev->user;\n\n\tfz_pixmap *pix;\n\tunsigned int count, i, k;\n\tunsigned char *s;\n\n\tif (*t->is_color || !image->colorspace || image->colorspace == fz_device_gray(ctx))\n\t\treturn;\n\n\tif (image->buffer && image->bpc == 8)\n\t{\n\t\tfz_stream *stream = fz_open_compressed_buffer(ctx, image->buffer);\n\t\tcount = (unsigned int)image->w * (unsigned int)image->h;\n\t\tif (image->colorspace == fz_device_rgb(ctx))\n\t\t{\n\t\t\tint threshold_u8 = t->threshold * 255;\n\t\t\tfor (i = 0; i < count; i++)\n\t\t\t{\n\t\t\t\tint r = fz_read_byte(stream);\n\t\t\t\tint g = fz_read_byte(stream);\n\t\t\t\tint b = fz_read_byte(stream);\n\t\t\t\tif (is_rgb_color_u8(threshold_u8, r, g, b))\n\t\t\t\t{\n\t\t\t\t\t*t->is_color = 1;\n\t\t\t\t\tdev->hints |= FZ_IGNORE_IMAGE;\n\t\t\t\t\tfz_close(stream);\n\t\t\t\t\tfz_throw(ctx, FZ_ERROR_ABORT, \"Page found as color; stopping interpretation\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_color_converter cc;\n\t\t\tunsigned int n = (unsigned int)image->n;\n\n\t\t\tfz_init_cached_color_converter(ctx, &cc, fz_device_rgb(ctx), image->colorspace);\n\t\t\tfor (i = 0; i < count; i++)\n\t\t\t{\n\t\t\t\tfloat cs[FZ_MAX_COLORS];\n\t\t\t\tfloat ds[FZ_MAX_COLORS];\n\n\t\t\t\tfor (k = 0; k < n; k++)\n\t\t\t\t\tcs[k] = fz_read_byte(stream) / 255.0f;\n\n\t\t\t\tcc.convert(&cc, ds, cs);\n\n\t\t\t\tif (is_rgb_color(t->threshold, ds[0], ds[1], ds[2]))\n\t\t\t\t{\n\t\t\t\t\t*t->is_color = 1;\n\t\t\t\t\tdev->hints |= FZ_IGNORE_IMAGE;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfz_fin_cached_color_converter(&cc);\n\t\t}\n\t\tfz_close(stream);\n\t\treturn;\n\t}\n\n\tpix = fz_new_pixmap_from_image(ctx, image, 0, 0);\n\tif (pix == NULL) /* Should never happen really, but... */\n\t\treturn;\n\n\tcount = (unsigned int)pix->w * (unsigned int)pix->h;\n\ts = pix->samples;\n\n\tif (pix->colorspace == fz_device_rgb(ctx))\n\t{\n\t\tint threshold_u8 = t->threshold * 255;\n\t\tfor (i = 0; i < count; i++)\n\t\t{\n\t\t\tif (s[3] != 0 && is_rgb_color_u8(threshold_u8, s[0], s[1], s[2]))\n\t\t\t{\n\t\t\t\t*t->is_color = 1;\n\t\t\t\tdev->hints |= FZ_IGNORE_IMAGE;\n\t\t\t\tfz_drop_pixmap(ctx, pix);\n\t\t\t\tfz_throw(ctx, FZ_ERROR_ABORT, \"Page found as color; stopping interpretation\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\ts += 4;\n\t\t}\n\t}\n\telse\n\t{\n\t\tfz_color_converter cc;\n\t\tunsigned int n = (unsigned int)pix->n-1;\n\n\t\tfz_init_cached_color_converter(ctx, &cc, fz_device_rgb(ctx), pix->colorspace);\n\t\tfor (i = 0; i < count; i++)\n\t\t{\n\t\t\tfloat cs[FZ_MAX_COLORS];\n\t\t\tfloat ds[FZ_MAX_COLORS];\n\n\t\t\tfor (k = 0; k < n; k++)\n\t\t\t\tcs[k] = (*s++) / 255.0f;\n\t\t\tif (*s++ == 0)\n\t\t\t\tcontinue;\n\n\t\t\tcc.convert(&cc, ds, cs);\n\n\t\t\tif (is_rgb_color(t->threshold, ds[0], ds[1], ds[2]))\n\t\t\t{\n\t\t\t\t*t->is_color = 1;\n\t\t\t\tdev->hints |= FZ_IGNORE_IMAGE;\n\t\t\t\tfz_drop_pixmap(ctx, pix);\n\t\t\t\tfz_throw(ctx, FZ_ERROR_ABORT, \"Page found as color; stopping interpretation\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfz_fin_cached_color_converter(&cc);\n\t}\n\n\tfz_drop_pixmap(ctx, pix);\n}\n\nstatic void\nfz_test_fill_image_mask(fz_device *dev, fz_image *image, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\t/* We assume that at least some of the image pixels are non-zero */\n\tfz_test_color(dev, colorspace, color);\n}\n\nstatic void\nfz_test_free(fz_device *dev)\n{\n\tif (dev == NULL)\n\t\treturn;\n\tfz_free(dev->ctx, dev->user);\n\tdev->user = NULL;\n}\n\nfz_device *\nfz_new_test_device(fz_context *ctx, int *is_color, float threshold)\n{\n\tstruct test *t;\n\tfz_device *dev;\n\n\tt = fz_malloc_struct(ctx, struct test);\n\tt->is_color = is_color;\n\tt->threshold = threshold;\n\n\tfz_try(ctx)\n\t{\n\t\tdev = fz_new_device(ctx, t);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, t);\n\t\tfz_rethrow(ctx);\n\t}\n\n\tdev->fill_path = fz_test_fill_path;\n\tdev->stroke_path = fz_test_stroke_path;\n\tdev->fill_text = fz_test_fill_text;\n\tdev->stroke_text = fz_test_stroke_text;\n\tdev->fill_shade = fz_test_fill_shade;\n\tdev->fill_image = fz_test_fill_image;\n\tdev->fill_image_mask = fz_test_fill_image_mask;\n\tdev->free_user = fz_test_free;\n\n\t*t->is_color = 0;\n\n\treturn dev;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/text.c",
    "content": "#include \"mupdf/fitz.h\"\n\nfz_text *\nfz_new_text(fz_context *ctx, fz_font *font, const fz_matrix *trm, int wmode)\n{\n\tfz_text *text;\n\n\ttext = fz_malloc_struct(ctx, fz_text);\n\ttext->font = fz_keep_font(ctx, font);\n\ttext->trm = *trm;\n\ttext->wmode = wmode;\n\ttext->len = 0;\n\ttext->cap = 0;\n\ttext->items = NULL;\n\n\treturn text;\n}\n\nvoid\nfz_free_text(fz_context *ctx, fz_text *text)\n{\n\tif (text != NULL)\n\t{\n\t\tfz_drop_font(ctx, text->font);\n\t\tfz_free(ctx, text->items);\n\t}\n\tfz_free(ctx, text);\n}\n\nfz_text *\nfz_clone_text(fz_context *ctx, fz_text *old)\n{\n\tfz_text *text;\n\n\ttext = fz_malloc_struct(ctx, fz_text);\n\ttext->len = old->len;\n\tfz_try(ctx)\n\t{\n\t\ttext->items = fz_malloc_array(ctx, text->len, sizeof(fz_text_item));\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, text);\n\t\tfz_rethrow(ctx);\n\t}\n\tmemcpy(text->items, old->items, text->len * sizeof(fz_text_item));\n\ttext->font = fz_keep_font(ctx, old->font);\n\ttext->trm = old->trm;\n\ttext->wmode = old->wmode;\n\ttext->cap = text->len;\n\n\treturn text;\n}\n\nfz_rect *\nfz_bound_text(fz_context *ctx, fz_text *text, const fz_stroke_state *stroke, const fz_matrix *ctm, fz_rect *bbox)\n{\n\tfz_matrix tm, trm;\n\tfz_rect gbox;\n\tint i;\n\n\tif (text->len == 0)\n\t{\n\t\t*bbox = fz_empty_rect;\n\t\treturn bbox;\n\t}\n\n\t// TODO: stroke state\n\n\ttm = text->trm;\n\n\ttm.e = text->items[0].x;\n\ttm.f = text->items[0].y;\n\tfz_concat(&trm, &tm, ctm);\n\tfz_bound_glyph(ctx, text->font, text->items[0].gid, &trm, bbox);\n\n\tfor (i = 1; i < text->len; i++)\n\t{\n\t\tif (text->items[i].gid >= 0)\n\t\t{\n\t\t\ttm.e = text->items[i].x;\n\t\t\ttm.f = text->items[i].y;\n\t\t\tfz_concat(&trm, &tm, ctm);\n\t\t\tfz_bound_glyph(ctx, text->font, text->items[i].gid, &trm, &gbox);\n\n\t\t\tbbox->x0 = fz_min(bbox->x0, gbox.x0);\n\t\t\tbbox->y0 = fz_min(bbox->y0, gbox.y0);\n\t\t\tbbox->x1 = fz_max(bbox->x1, gbox.x1);\n\t\t\tbbox->y1 = fz_max(bbox->y1, gbox.y1);\n\t\t}\n\t}\n\n\tif (stroke)\n\t\tfz_adjust_rect_for_stroke(bbox, stroke, ctm);\n\n\t/* Compensate for the glyph cache limited positioning precision */\n\tbbox->x0 -= 1;\n\tbbox->y0 -= 1;\n\tbbox->x1 += 1;\n\tbbox->y1 += 1;\n\n\treturn bbox;\n}\n\nstatic void\nfz_grow_text(fz_context *ctx, fz_text *text, int n)\n{\n\tint new_cap = text->cap;\n\tif (text->len + n < new_cap)\n\t\treturn;\n\twhile (text->len + n > new_cap)\n\t\tnew_cap = new_cap + 36;\n\ttext->items = fz_resize_array(ctx, text->items, new_cap, sizeof(fz_text_item));\n\ttext->cap = new_cap;\n}\n\nvoid\nfz_add_text(fz_context *ctx, fz_text *text, int gid, int ucs, float x, float y)\n{\n\tfz_grow_text(ctx, text, 1);\n\ttext->items[text->len].ucs = ucs;\n\ttext->items[text->len].gid = gid;\n\ttext->items[text->len].x = x;\n\ttext->items[text->len].y = y;\n\ttext->len++;\n}\n\nstatic int\nisxmlmeta(int c)\n{\n\treturn c < 32 || c >= 128 || c == '&' || c == '<' || c == '>' || c == '\\'' || c == '\"';\n}\n\nstatic void\ndo_print_text(FILE *out, fz_text *text, int indent)\n{\n\tint i, n;\n\tfor (i = 0; i < text->len; i++)\n\t{\n\t\tfor (n = 0; n < indent; n++)\n\t\t\tfputc(' ', out);\n\t\tif (!isxmlmeta(text->items[i].ucs))\n\t\t\tfprintf(out, \"<g ucs=\\\"%c\\\" gid=\\\"%d\\\" x=\\\"%g\\\" y=\\\"%g\\\" />\\n\",\n\t\t\t\ttext->items[i].ucs, text->items[i].gid, text->items[i].x, text->items[i].y);\n\t\telse\n\t\t\tfprintf(out, \"<g ucs=\\\"U+%04X\\\" gid=\\\"%d\\\" x=\\\"%g\\\" y=\\\"%g\\\" />\\n\",\n\t\t\t\ttext->items[i].ucs, text->items[i].gid, text->items[i].x, text->items[i].y);\n\t}\n}\n\nvoid fz_print_text(fz_context *ctx, FILE *out, fz_text *text)\n{\n\tdo_print_text(out, text, 0);\n}\n"
  },
  {
    "path": "mupdf/source/fitz/time.c",
    "content": "#ifdef _MSC_VER\n\n#include \"mupdf/fitz.h\"\n\n#include <time.h>\n#include <windows.h>\n\n#ifndef _WINRT\n\n#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64\n\nint gettimeofday(struct timeval *tv, struct timezone *tz)\n{\n\tFILETIME ft;\n\tunsigned __int64 tmpres = 0;\n\n\tif (tv)\n\t{\n\t\tGetSystemTimeAsFileTime(&ft);\n\n\t\ttmpres |= ft.dwHighDateTime;\n\t\ttmpres <<= 32;\n\t\ttmpres |= ft.dwLowDateTime;\n\n\t\ttmpres /= 10; /*convert into microseconds*/\n\t\t/*converting file time to unix epoch*/\n\t\ttmpres -= DELTA_EPOCH_IN_MICROSECS;\n\t\ttv->tv_sec = (long)(tmpres / 1000000UL);\n\t\ttv->tv_usec = (long)(tmpres % 1000000UL);\n\t}\n\n\treturn 0;\n}\n\n#endif /* !_WINRT */\n\nchar *\nfz_utf8_from_wchar(const wchar_t *s)\n{\n\tconst wchar_t *src = s;\n\tchar *d;\n\tchar *dst;\n\tint len = 1;\n\n\twhile (*src)\n\t{\n\t\tlen += fz_runelen(*src++);\n\t}\n\n\td = malloc(len);\n\tif (d != NULL)\n\t{\n\t\tdst = d;\n\t\tsrc = s;\n\t\twhile (*src)\n\t\t{\n\t\t\tdst += fz_runetochar(dst, *src++);\n\t\t}\n\t\t*dst = 0;\n\t}\n\treturn d;\n}\n\nwchar_t *\nfz_wchar_from_utf8(const char *s)\n{\n\twchar_t *d, *r;\n\tint c;\n\tr = d = malloc((strlen(s) + 1) * sizeof(wchar_t));\n\tif (!r)\n\t\treturn NULL;\n\twhile (*s) {\n\t\ts += fz_chartorune(&c, s);\n\t\t*d++ = c;\n\t}\n\t*d = 0;\n\treturn r;\n}\n\nFILE *\nfz_fopen_utf8(const char *name, const char *mode)\n{\n\twchar_t *wname, *wmode;\n\tFILE *file;\n\n\t/* SumatraPDF: prefer ANSI to UTF-8 for reading for consistency with remaining API */\n#undef fopen\n\tif (strchr(mode, 'r') && (file = fopen(name, mode)) != NULL)\n\t\treturn file;\n\n\twname = fz_wchar_from_utf8(name);\n\tif (wname == NULL)\n\t{\n\t\treturn NULL;\n\t}\n\n\twmode = fz_wchar_from_utf8(mode);\n\tif (wmode == NULL)\n\t{\n\t\tfree(wname);\n\t\treturn NULL;\n\t}\n\n\tfile = _wfopen(wname, wmode);\n\n\tfree(wname);\n\tfree(wmode);\n\treturn file;\n}\n\nchar **\nfz_argv_from_wargv(int argc, wchar_t **wargv)\n{\n\tchar **argv;\n\tint i;\n\n\targv = calloc(argc, sizeof(char *));\n\tif (argv == NULL)\n\t{\n\t\tfprintf(stderr, \"Out of memory while processing command line args!\\n\");\n\t\texit(1);\n\t}\n\n\tfor (i = 0; i < argc; i++)\n\t{\n\t\targv[i] = fz_utf8_from_wchar(wargv[i]);\n\t\tif (argv[i] == NULL)\n\t\t{\n\t\t\tfprintf(stderr, \"Out of memory while processing command line args!\\n\");\n\t\t\texit(1);\n\t\t}\n\t}\n\n\treturn argv;\n}\n\nvoid\nfz_free_argv(int argc, char **argv)\n{\n\tint i;\n\tfor (i = 0; i < argc; i++)\n\t\tfree(argv[i]);\n\tfree(argv);\n}\n\n#endif /* _MSC_VER */\n\n/* SumatraPDF: better support for libmupdf.dll */\n#ifdef _WIN32\n#ifndef _MSC_VER\n#include \"mupdf/fitz.h\"\n#include <windows.h>\n#endif\n\nvoid\nfz_redirect_io_to_console()\n{\n\t// redirect unbuffered STDOUT to the console\n#if _MSC_VER < 1900\n\tint hConHandle = _open_osfhandle((intptr_t)GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT);\n\t*stdout = *_fdopen(hConHandle, \"w\");\n#else\n\tFILE *con;\n\tfreopen_s(&con, \"CONOUT$\", \"w\", stdout);\n#endif\n\tsetvbuf(stdout, NULL, _IONBF, 0);\n\t// redirect unbuffered STDERR to the console\n#if _MSC_VER < 1900\n\thConHandle = _open_osfhandle((intptr_t)GetStdHandle(STD_ERROR_HANDLE), _O_TEXT);\n\t*stderr = *_fdopen(hConHandle, \"w\");\n#else\n\tfreopen_s(&con, \"CONOUT$\", \"w\", stderr);\n#endif\n\tsetvbuf(stderr, NULL, _IONBF, 0);\n\t// redirect unbuffered STDIN to the console\n#if _MSC_VER < 1900\n\thConHandle = _open_osfhandle((intptr_t)GetStdHandle(STD_INPUT_HANDLE), _O_TEXT);\n\t*stdin = *_fdopen(hConHandle, \"r\");\n#else\n\tfreopen_s(&con, \"CONIN$\", \"r\", stdin);\n#endif\n\tsetvbuf(stdin, NULL, _IONBF, 0);\n}\n\n/* replace this function with one calling fz_redirect_io_to_console when building libmupdf.dll */\nvoid fz_redirect_dll_io_to_console() { }\n#endif\n"
  },
  {
    "path": "mupdf/source/fitz/trace-device.c",
    "content": "#include \"mupdf/fitz.h\"\n\nstatic void\nfz_trace_matrix(const fz_matrix *ctm)\n{\n\tprintf(\" matrix=\\\"%g %g %g %g %g %g\\\"\",\n\t\tctm->a, ctm->b, ctm->c, ctm->d, ctm->e, ctm->f);\n}\n\nstatic void\nfz_trace_trm(const fz_matrix *trm)\n{\n\tprintf(\" trm=\\\"%g %g %g %g\\\"\",\n\t\ttrm->a, trm->b, trm->c, trm->d);\n}\n\nstatic void\nfz_trace_color(fz_colorspace *colorspace, float *color, float alpha)\n{\n\tint i;\n\tprintf(\" colorspace=\\\"%s\\\" color=\\\"\", colorspace->name);\n\tfor (i = 0; i < colorspace->n; i++)\n\t\tprintf(\"%s%g\", i == 0 ? \"\" : \" \", color[i]);\n\tprintf(\"\\\"\");\n\tif (alpha < 1)\n\t\tprintf(\" alpha=\\\"%g\\\"\", alpha);\n}\n\nstatic void\nfz_trace_path(fz_path *path, int indent)\n{\n\tfloat x, y;\n\tint i = 0, k = 0, n;\n\twhile (i < path->cmd_len)\n\t{\n\t\tfor (n = 0; n < indent; n++)\n\t\t\tputchar(' ');\n\t\tswitch (path->cmds[i++])\n\t\t{\n\t\tcase FZ_MOVETO:\n\t\t\tx = path->coords[k++];\n\t\t\ty = path->coords[k++];\n\t\t\tprintf(\"<moveto x=\\\"%g\\\" y=\\\"%g\\\"/>\\n\", x, y);\n\t\t\tbreak;\n\t\tcase FZ_LINETO:\n\t\t\tx = path->coords[k++];\n\t\t\ty = path->coords[k++];\n\t\t\tprintf(\"<lineto x=\\\"%g\\\" y=\\\"%g\\\"/>\\n\", x, y);\n\t\t\tbreak;\n\t\tcase FZ_CURVETO:\n\t\t\tx = path->coords[k++];\n\t\t\ty = path->coords[k++];\n\t\t\tprintf(\"<curveto x1=\\\"%g\\\" y1=\\\"%g\\\"\", x, y);\n\t\t\tx = path->coords[k++];\n\t\t\ty = path->coords[k++];\n\t\t\tprintf(\" x2=\\\"%g\\\" y2=\\\"%g\\\"\", x, y);\n\t\t\tx = path->coords[k++];\n\t\t\ty = path->coords[k++];\n\t\t\tprintf(\" x3=\\\"%g\\\" y3=\\\"%g\\\"/>\\n\", x, y);\n\t\t\tbreak;\n\t\tcase FZ_CLOSE_PATH:\n\t\t\tprintf(\"<closepath/>\\n\");\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\nstatic void\nfz_trace_begin_page(fz_device *dev, const fz_rect *rect, const fz_matrix *ctm)\n{\n\tprintf(\"<page mediabox=\\\"%g %g %g %g\\\"\", rect->x0, rect->y0, rect->x1, rect->y1);\n\tfz_trace_matrix(ctm);\n\tprintf(\">\\n\");\n}\n\nstatic void\nfz_trace_end_page(fz_device *dev)\n{\n\tprintf(\"</page>\\n\");\n}\n\nstatic void\nfz_trace_fill_path(fz_device *dev, fz_path *path, int even_odd, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tprintf(\"<fill_path\");\n\tif (even_odd)\n\t\tprintf(\" winding=\\\"eofill\\\"\");\n\telse\n\t\tprintf(\" winding=\\\"nonzero\\\"\");\n\tfz_trace_color(colorspace, color, alpha);\n\tfz_trace_matrix(ctm);\n\tprintf(\">\\n\");\n\tfz_trace_path(path, 0);\n\tprintf(\"</fill_path>\\n\");\n}\n\nstatic void\nfz_trace_stroke_path(fz_device *dev, fz_path *path, fz_stroke_state *stroke, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tint i;\n\n\tprintf(\"<stroke_path\");\n\tprintf(\" linewidth=\\\"%g\\\"\", stroke->linewidth);\n\tprintf(\" miterlimit=\\\"%g\\\"\", stroke->miterlimit);\n\tprintf(\" linecap=\\\"%d,%d,%d\\\"\", stroke->start_cap, stroke->dash_cap, stroke->end_cap);\n\tprintf(\" linejoin=\\\"%d\\\"\", stroke->linejoin);\n\n\tif (stroke->dash_len)\n\t{\n\t\tprintf(\" dash_phase=\\\"%g\\\" dash=\\\"\", stroke->dash_phase);\n\t\tfor (i = 0; i < stroke->dash_len; i++)\n\t\t\tprintf(\"%s%g\", i > 0 ? \" \" : \"\", stroke->dash_list[i]);\n\t\tprintf(\"\\\"\");\n\t}\n\n\tfz_trace_color(colorspace, color, alpha);\n\tfz_trace_matrix(ctm);\n\tprintf(\">\\n\");\n\n\tfz_trace_path(path, 0);\n\n\tprintf(\"</stroke_path>\\n\");\n}\n\nstatic void\nfz_trace_clip_path(fz_device *dev, fz_path *path, const fz_rect *rect, int even_odd, const fz_matrix *ctm)\n{\n\tprintf(\"<clip_path\");\n\tif (even_odd)\n\t\tprintf(\" winding=\\\"eofill\\\"\");\n\telse\n\t\tprintf(\" winding=\\\"nonzero\\\"\");\n\tfz_trace_matrix(ctm);\n\tif (rect)\n\t\tprintf(\" contentbbox=\\\"%g %g %g %g\\\">\\n\", rect->x0, rect->y0, rect->x1, rect->y1);\n\telse\n\t\tprintf(\">\\n\");\n\tfz_trace_path(path, 0);\n\tprintf(\"</clip_path>\\n\");\n}\n\nstatic void\nfz_trace_clip_stroke_path(fz_device *dev, fz_path *path, const fz_rect *rect, fz_stroke_state *stroke, const fz_matrix *ctm)\n{\n\tprintf(\"<clip_stroke_path\");\n\tfz_trace_matrix(ctm);\n\tprintf(\">\\n\");\n\tfz_trace_path(path, 0);\n\tprintf(\"</clip_stroke_path>\\n\");\n}\n\nstatic void\nfz_trace_fill_text(fz_device *dev, fz_text *text, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tprintf(\"<fill_text font=\\\"%s\\\" wmode=\\\"%d\\\"\", text->font->name, text->wmode);\n\tfz_trace_color(colorspace, color, alpha);\n\tfz_trace_matrix(ctm);\n\tfz_trace_trm(&text->trm);\n\tprintf(\">\\n\");\n\tfz_print_text(dev->ctx, stdout, text);\n\tprintf(\"</fill_text>\\n\");\n}\n\nstatic void\nfz_trace_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tprintf(\"<stroke_text font=\\\"%s\\\" wmode=\\\"%d\\\"\", text->font->name, text->wmode);\n\tfz_trace_color(colorspace, color, alpha);\n\tfz_trace_matrix(ctm);\n\tfz_trace_trm(&text->trm);\n\tprintf(\">\\n\");\n\tfz_print_text(dev->ctx, stdout, text);\n\tprintf(\"</stroke_text>\\n\");\n}\n\nstatic void\nfz_trace_clip_text(fz_device *dev, fz_text *text, const fz_matrix *ctm, int accumulate)\n{\n\tprintf(\"<clip_text font=\\\"%s\\\" wmode=\\\"%d\\\"\", text->font->name, text->wmode);\n\tprintf(\" accumulate=\\\"%d\\\"\", accumulate);\n\tfz_trace_matrix(ctm);\n\tfz_trace_trm(&text->trm);\n\tprintf(\">\\n\");\n\tfz_print_text(dev->ctx, stdout, text);\n\tprintf(\"</clip_text>\\n\");\n}\n\nstatic void\nfz_trace_clip_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, const fz_matrix *ctm)\n{\n\tprintf(\"<clip_stroke_text font=\\\"%s\\\" wmode=\\\"%d\\\"\", text->font->name, text->wmode);\n\tfz_trace_matrix(ctm);\n\tfz_trace_trm(&text->trm);\n\tprintf(\">\\n\");\n\tfz_print_text(dev->ctx, stdout, text);\n\tprintf(\"</clip_stroke_text>\\n\");\n}\n\nstatic void\nfz_trace_ignore_text(fz_device *dev, fz_text *text, const fz_matrix *ctm)\n{\n\tprintf(\"<ignore_text font=\\\"%s\\\" wmode=\\\"%d\\\"\", text->font->name, text->wmode);\n\tfz_trace_matrix(ctm);\n\tfz_trace_trm(&text->trm);\n\tprintf(\">\\n\");\n\tfz_print_text(dev->ctx, stdout, text);\n\tprintf(\"</ignore_text>\\n\");\n}\n\nstatic void\nfz_trace_fill_image(fz_device *dev, fz_image *image, const fz_matrix *ctm, float alpha)\n{\n\tprintf(\"<fill_image alpha=\\\"%g\\\"\", alpha);\n\tfz_trace_matrix(ctm);\n\tprintf(\" width=\\\"%d\\\" height=\\\"%d\\\"\", image->w, image->h);\n\tprintf(\"/>\\n\");\n}\n\nstatic void\nfz_trace_fill_shade(fz_device *dev, fz_shade *shade, const fz_matrix *ctm, float alpha)\n{\n\tprintf(\"<fill_shade alpha=\\\"%g\\\"\", alpha);\n\tfz_trace_matrix(ctm);\n\tprintf(\"/>\\n\");\n}\n\nstatic void\nfz_trace_fill_image_mask(fz_device *dev, fz_image *image, const fz_matrix *ctm,\nfz_colorspace *colorspace, float *color, float alpha)\n{\n\tprintf(\"<fill_image_mask\");\n\tfz_trace_matrix(ctm);\n\tfz_trace_color(colorspace, color, alpha);\n\tprintf(\" width=\\\"%d\\\" height=\\\"%d\\\"\", image->w, image->h);\n\tprintf(\"/>\\n\");\n}\n\nstatic void\nfz_trace_clip_image_mask(fz_device *dev, fz_image *image, const fz_rect *rect, const fz_matrix *ctm)\n{\n\tprintf(\"<clip_image_mask\");\n\tfz_trace_matrix(ctm);\n\tprintf(\" width=\\\"%d\\\" height=\\\"%d\\\"\", image->w, image->h);\n\tprintf(\"/>\\n\");\n}\n\nstatic void\nfz_trace_pop_clip(fz_device *dev)\n{\n\tprintf(\"<pop_clip/>\\n\");\n}\n\nstatic void\nfz_trace_begin_mask(fz_device *dev, const fz_rect *bbox, int luminosity, fz_colorspace *colorspace, float *color)\n{\n\tprintf(\"<mask bbox=\\\"%g %g %g %g\\\" s=\\\"%s\\\"\",\n\t\tbbox->x0, bbox->y0, bbox->x1, bbox->y1,\n\t\tluminosity ? \"luminosity\" : \"alpha\");\n\tprintf(\">\\n\");\n}\n\nstatic void\nfz_trace_end_mask(fz_device *dev)\n{\n\tprintf(\"</mask>\\n\");\n}\n\nstatic void\nfz_trace_begin_group(fz_device *dev, const fz_rect *bbox, int isolated, int knockout, int blendmode, float alpha)\n{\n\tprintf(\"<group bbox=\\\"%g %g %g %g\\\" isolated=\\\"%d\\\" knockout=\\\"%d\\\" blendmode=\\\"%s\\\" alpha=\\\"%g\\\">\\n\",\n\t\tbbox->x0, bbox->y0, bbox->x1, bbox->y1,\n\t\tisolated, knockout, fz_blendmode_name(blendmode), alpha);\n}\n\nstatic void\nfz_trace_end_group(fz_device *dev)\n{\n\tprintf(\"</group>\\n\");\n}\n\nstatic int\nfz_trace_begin_tile(fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, const fz_matrix *ctm, int id)\n{\n\tprintf(\"<tile\");\n\tprintf(\" area=\\\"%g %g %g %g\\\"\", area->x0, area->y0, area->x1, area->y1);\n\tprintf(\" view=\\\"%g %g %g %g\\\"\", view->x0, view->y0, view->x1, view->y1);\n\tprintf(\" xstep=\\\"%g\\\" ystep=\\\"%g\\\"\", xstep, ystep);\n\tfz_trace_matrix(ctm);\n\tprintf(\">\\n\");\n\treturn 0;\n}\n\nstatic void\nfz_trace_end_tile(fz_device *dev)\n{\n\tprintf(\"</tile>\\n\");\n}\n\n/* SumatraPDF: support transfer functions */\nstatic void\nfz_trace_apply_transfer_function(fz_device *devp, fz_transfer_function *tr, int for_mask)\n{\n\tprintf(\"<transfer_function from=\\\"%g %g %g %g\\\" to=\\\"%g %g %g %g\\\"/>\\n\",\n\t\ttr->function[0][0] / 255.0f, tr->function[1][0] / 255.0f,\n\t\ttr->function[2][0] / 255.0f, tr->function[3][0] / 255.0f,\n\t\ttr->function[0][255] / 255.0f, tr->function[1][255] / 255.0f,\n\t\ttr->function[2][255] / 255.0f, tr->function[3][255] / 255.0f);\n}\n\nfz_device *fz_new_trace_device(fz_context *ctx)\n{\n\tfz_device *dev = fz_new_device(ctx, NULL);\n\n\tdev->begin_page = fz_trace_begin_page;\n\tdev->end_page = fz_trace_end_page;\n\n\tdev->fill_path = fz_trace_fill_path;\n\tdev->stroke_path = fz_trace_stroke_path;\n\tdev->clip_path = fz_trace_clip_path;\n\tdev->clip_stroke_path = fz_trace_clip_stroke_path;\n\n\tdev->fill_text = fz_trace_fill_text;\n\tdev->stroke_text = fz_trace_stroke_text;\n\tdev->clip_text = fz_trace_clip_text;\n\tdev->clip_stroke_text = fz_trace_clip_stroke_text;\n\tdev->ignore_text = fz_trace_ignore_text;\n\n\tdev->fill_shade = fz_trace_fill_shade;\n\tdev->fill_image = fz_trace_fill_image;\n\tdev->fill_image_mask = fz_trace_fill_image_mask;\n\tdev->clip_image_mask = fz_trace_clip_image_mask;\n\n\tdev->pop_clip = fz_trace_pop_clip;\n\n\tdev->begin_mask = fz_trace_begin_mask;\n\tdev->end_mask = fz_trace_end_mask;\n\tdev->begin_group = fz_trace_begin_group;\n\tdev->end_group = fz_trace_end_group;\n\n\tdev->begin_tile = fz_trace_begin_tile;\n\tdev->end_tile = fz_trace_end_tile;\n\n\t/* SumatraPDF: support transfer functions */\n\tdev->apply_transfer_function = fz_trace_apply_transfer_function;\n\n\treturn dev;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/transition.c",
    "content": "#include \"mupdf/fitz.h\"\n\nstatic int\nfade(fz_pixmap *tpix, fz_pixmap *opix, fz_pixmap *npix, int time)\n{\n\tunsigned char *t, *o, *n;\n\tint size;\n\n\tif (!tpix || !opix || !npix || tpix->w != opix->w || opix->w != npix->w || tpix->h != opix->h || opix->h != npix->h || tpix->n != opix->n || opix->n != npix->n)\n\t\treturn 0;\n\tsize = tpix->w * tpix->h * tpix->n;\n\tt = tpix->samples;\n\to = opix->samples;\n\tn = npix->samples;\n\twhile (size-- > 0)\n\t{\n\t\tint op = *o++;\n\t\tint np = *n++;\n\t\t*t++ = ((op<<8) + ((np-op) * time) + 0x80)>>8;\n\t}\n\treturn 1;\n}\n\nstatic int\nblind_horiz(fz_pixmap *tpix, fz_pixmap *opix, fz_pixmap *npix, int time)\n{\n\tunsigned char *t, *o, *n;\n\tint blind_height, span, position, y;\n\n\tif (!tpix || !opix || !npix || tpix->w != opix->w || opix->w != npix->w || tpix->h != opix->h || opix->h != npix->h || tpix->n != opix->n || opix->n != npix->n)\n\t\treturn 0;\n\tspan = tpix->w * tpix->n;\n\tblind_height = (tpix->h+7) / 8;\n\tposition = blind_height * time / 256;\n\tt = tpix->samples;\n\to = opix->samples;\n\tn = npix->samples;\n\tfor (y = 0; y < tpix->h; y++)\n\t{\n\t\tmemcpy(t, ((y % blind_height) <= position ? n : o), span);\n\t\tt += span;\n\t\to += span;\n\t\tn += span;\n\t}\n\treturn 1;\n}\n\nstatic int\nblind_vertical(fz_pixmap *tpix, fz_pixmap *opix, fz_pixmap *npix, int time)\n{\n\tunsigned char *t, *o, *n;\n\tint blind_width, span, position, y;\n\n\tif (!tpix || !opix || !npix || tpix->w != opix->w || opix->w != npix->w || tpix->h != opix->h || opix->h != npix->h || tpix->n != opix->n || opix->n != npix->n)\n\t\treturn 0;\n\tspan = tpix->w * tpix->n;\n\tblind_width = (tpix->w+7) / 8;\n\tposition = blind_width * time / 256;\n\tblind_width *= tpix->n;\n\tposition *= tpix->n;\n\tt = tpix->samples;\n\to = opix->samples;\n\tn = npix->samples;\n\tfor (y = 0; y < tpix->h; y++)\n\t{\n\t\tint w, x;\n\t\tx = 0;\n\t\twhile ((w = span - x) > 0)\n\t\t{\n\t\t\tint p;\n\t\t\tif (w > blind_width)\n\t\t\t\tw = blind_width;\n\t\t\tp = position;\n\t\t\tif (p > w)\n\t\t\t\tp = w;\n\t\t\tmemcpy(t, n, p);\n\t\t\tmemcpy(t+position, o+position, w - p);\n\t\t\tx += blind_width;\n\t\t\tt += w;\n\t\t\to += w;\n\t\t\tn += w;\n\t\t}\n\t}\n\treturn 1;\n}\n\nstatic int\nwipe_tb(fz_pixmap *tpix, fz_pixmap *opix, fz_pixmap *npix, int time)\n{\n\tunsigned char *t, *o, *n;\n\tint span, position, y;\n\n\tif (!tpix || !opix || !npix || tpix->w != opix->w || opix->w != npix->w || tpix->h != opix->h || opix->h != npix->h || tpix->n != opix->n || opix->n != npix->n)\n\t\treturn 0;\n\tspan = tpix->w * tpix->n;\n\tposition = tpix->h * time / 256;\n\tt = tpix->samples;\n\to = opix->samples;\n\tn = npix->samples;\n\tfor (y = 0; y < position; y++)\n\t{\n\t\tmemcpy(t, n, span);\n\t\tt += span;\n\t\to += span;\n\t\tn += span;\n\t}\n\tfor (; y < tpix->h; y++)\n\t{\n\t\tmemcpy(t, o, span);\n\t\tt += span;\n\t\to += span;\n\t\tn += span;\n\t}\n\treturn 1;\n}\n\nstatic int\nwipe_lr(fz_pixmap *tpix, fz_pixmap *opix, fz_pixmap *npix, int time)\n{\n\tunsigned char *t, *o, *n;\n\tint span, position, y;\n\n\tif (!tpix || !opix || !npix || tpix->w != opix->w || opix->w != npix->w || tpix->h != opix->h || opix->h != npix->h || tpix->n != opix->n || opix->n != npix->n)\n\t\treturn 0;\n\tspan = tpix->w * tpix->n;\n\tposition = tpix->w * time / 256;\n\tposition *= tpix->n;\n\tt = tpix->samples;\n\to = opix->samples + position;\n\tn = npix->samples;\n\tfor (y = 0; y < tpix->h; y++)\n\t{\n\t\tmemcpy(t, n, position);\n\t\tmemcpy(t+position, o, span-position);\n\t\tt += span;\n\t\to += span;\n\t\tn += span;\n\t}\n\treturn 1;\n}\n\nint fz_generate_transition(fz_pixmap *tpix, fz_pixmap *opix, fz_pixmap *npix, int time, fz_transition *trans)\n{\n\tswitch (trans->type)\n\t{\n\tdefault:\n\tcase FZ_TRANSITION_FADE:\n\t\treturn fade(tpix, opix, npix, time);\n\tcase FZ_TRANSITION_BLINDS:\n\t\tif (trans->vertical)\n\t\t\treturn blind_vertical(tpix, opix, npix, time);\n\t\telse\n\t\t\treturn blind_horiz(tpix, opix, npix, time);\n\tcase FZ_TRANSITION_WIPE:\n\t\tswitch (((trans->direction + 45 + 360) % 360) / 90)\n\t\t{\n\t\tdefault:\n\t\tcase 0: return wipe_lr(tpix, opix, npix, time);\n\t\tcase 1: return wipe_tb(tpix, npix, opix, 256-time);\n\t\tcase 2: return wipe_lr(tpix, npix, opix, 256-time);\n\t\tcase 3: return wipe_tb(tpix, opix, npix, time);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/fitz/tree.c",
    "content": "#include \"mupdf/fitz.h\"\n\n/* AA-tree */\n\nstruct fz_tree_s\n{\n\tchar *key;\n\tvoid *value;\n\tfz_tree *left, *right;\n\tint level;\n};\n\nstatic fz_tree sentinel = { \"\", NULL, &sentinel, &sentinel, 0 };\n\nstatic fz_tree *fz_tree_new_node(fz_context *ctx, const char *key, void *value)\n{\n\tfz_tree *node = fz_malloc_struct(ctx, fz_tree);\n\tnode->key = fz_strdup(ctx, key);\n\tnode->value = value;\n\tnode->left = node->right = &sentinel;\n\tnode->level = 1;\n\treturn node;\n}\n\nvoid *fz_tree_lookup(fz_context *ctx, fz_tree *node, const char *key)\n{\n\tif (node)\n\t{\n\t\twhile (node != &sentinel)\n\t\t{\n\t\t\tint c = strcmp(key, node->key);\n\t\t\tif (c == 0)\n\t\t\t\treturn node->value;\n\t\t\telse if (c < 0)\n\t\t\t\tnode = node->left;\n\t\t\telse\n\t\t\t\tnode = node->right;\n\t\t}\n\t}\n\treturn NULL;\n}\n\nstatic fz_tree *fz_tree_skew(fz_tree *node)\n{\n\tif (node->level != 0)\n\t{\n\t\tif (node->left->level == node->level)\n\t\t{\n\t\t\tfz_tree *save = node;\n\t\t\tnode = node->left;\n\t\t\tsave->left = node->right;\n\t\t\tnode->right = save;\n\t\t}\n\t\tnode->right = fz_tree_skew(node->right);\n\t}\n\treturn node;\n}\n\nstatic fz_tree *fz_tree_split(fz_tree *node)\n{\n\tif (node->level != 0 && node->right->right->level == node->level)\n\t{\n\t\tfz_tree *save = node;\n\t\tnode = node->right;\n\t\tsave->right = node->left;\n\t\tnode->left = save;\n\t\tnode->level++;\n\t\tnode->right = fz_tree_split(node->right);\n\t}\n\treturn node;\n}\n\nfz_tree *fz_tree_insert(fz_context *ctx, fz_tree *node, const char *key, void *value)\n{\n\tif (node && node != &sentinel)\n\t{\n\t\tint c = strcmp(key, node->key);\n\t\tif (c < 0)\n\t\t\tnode->left = fz_tree_insert(ctx, node->left, key, value);\n\t\telse\n\t\t\tnode->right = fz_tree_insert(ctx, node->right, key, value);\n\t\tnode = fz_tree_skew(node);\n\t\tnode = fz_tree_split(node);\n\t\treturn node;\n\t}\n\telse\n\t{\n\t\treturn fz_tree_new_node(ctx, key, value);\n\t}\n}\n\nvoid fz_free_tree(fz_context *ctx, fz_tree *node, void (*freefunc)(fz_context *ctx, void *value))\n{\n\tif (node)\n\t{\n\t\tif (node->left != &sentinel)\n\t\t\tfz_free_tree(ctx, node->left, freefunc);\n\t\tif (node->right != &sentinel)\n\t\t\tfz_free_tree(ctx, node->right, freefunc);\n\t\tfz_free(ctx, node->key);\n\t\tif (freefunc)\n\t\t\tfreefunc(ctx, node->value);\n\t}\n}\n\nstatic void print_tree_imp(fz_context *ctx, fz_tree *node, int level)\n{\n\tint i;\n\tif (node->left != &sentinel)\n\t\tprint_tree_imp(ctx, node->left, level + 1);\n\tfor (i = 0; i < level; i++)\n\t\tputchar(' ');\n\tprintf(\"%s = %p (%d)\\n\", node->key, node->value, node->level);\n\tif (node->right != &sentinel)\n\t\tprint_tree_imp(ctx, node->right, level + 1);\n}\n\nvoid fz_debug_tree(fz_context *ctx, fz_tree *root)\n{\n\tprintf(\"--- tree dump ---\\n\");\n\tif (root && root != &sentinel)\n\t\tprint_tree_imp(ctx, root, 0);\n\tprintf(\"---\\n\");\n}\n"
  },
  {
    "path": "mupdf/source/fitz/ucdn.c",
    "content": "/*\n * Copyright (C) 2012 Grigori Goronzy <greg@kinoho.net>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n#include <stdio.h>\n#include <stdlib.h>\n#include \"ucdn.h\"\n\ntypedef struct {\n\tunsigned char category;\n\tunsigned char combining;\n\tunsigned char bidi_class;\n\tunsigned char mirrored;\n\tunsigned char east_asian_width;\n\tunsigned char normalization_check;\n\tunsigned char script;\n} UCDRecord;\n\ntypedef struct {\n\tunsigned short from, to;\n} MirrorPair;\n\ntypedef struct {\n\tunsigned int start;\n\tshort count, index;\n} Reindex;\n\n#include \"unicodedata_db.h\"\n\n/* constants required for Hangul (de)composition */\n#define SBASE 0xAC00\n#define LBASE 0x1100\n#define VBASE 0x1161\n#define TBASE 0x11A7\n#define SCOUNT 11172\n#define LCOUNT 19\n#define VCOUNT 21\n#define TCOUNT 28\n#define NCOUNT (VCOUNT * TCOUNT)\n\nstatic const UCDRecord *get_ucd_record(unsigned int code)\n{\n\tint index, offset;\n\n\tif (code >= 0x110000)\n\t\tindex = 0;\n\telse {\n\t\tindex = index0[code >> (SHIFT1+SHIFT2)] << SHIFT1;\n\t\toffset = (code >> SHIFT2) & ((1<<SHIFT1) - 1);\n\t\tindex = index1[index + offset] << SHIFT2;\n\t\toffset = code & ((1<<SHIFT2) - 1);\n\t\tindex = index2[index + offset];\n\t}\n\n\treturn &ucd_records[index];\n}\n\nstatic const unsigned short *get_decomp_record(unsigned int code)\n{\n\tint index, offset;\n\n\tif (code >= 0x110000)\n\t\tindex = 0;\n\telse {\n\t\tindex = decomp_index0[code >> (DECOMP_SHIFT1+DECOMP_SHIFT2)]\n\t\t\t<< DECOMP_SHIFT1;\n\t\toffset = (code >> DECOMP_SHIFT2) & ((1<<DECOMP_SHIFT1) - 1);\n\t\tindex = decomp_index1[index + offset] << DECOMP_SHIFT2;\n\t\toffset = code & ((1<<DECOMP_SHIFT2) - 1);\n\t\tindex = decomp_index2[index + offset];\n\t}\n\n\treturn &decomp_data[index];\n}\n\nstatic int get_comp_index(unsigned int code, const Reindex *idx)\n{\n\tint i;\n\n\tfor (i = 0; idx[i].start; i++) {\n\t\tconst Reindex *cur = &idx[i];\n\t\tif (code < cur->start)\n\t\t\treturn -1;\n\t\tif (code <= cur->start + cur->count) {\n\t\t\treturn cur->index + (code - cur->start);\n\t\t}\n\t}\n\n\treturn -1;\n}\n\nstatic int compare_mp(const void *a, const void *b)\n{\n\tMirrorPair *mpa = (MirrorPair *)a;\n\tMirrorPair *mpb = (MirrorPair *)b;\n\treturn mpa->from - mpb->from;\n}\n\nstatic int hangul_pair_decompose(unsigned int code, unsigned int *a, unsigned int *b)\n{\n\tint si = code - SBASE;\n\n\tif (si < 0 || si >= SCOUNT)\n\t\treturn 0;\n\n\tif (si % TCOUNT) {\n\t\t/* LV,T */\n\t\t*a = SBASE + (si / TCOUNT) * TCOUNT;\n\t\t*b = TBASE + (si % TCOUNT);\n\t\treturn 3;\n\t} else {\n\t\t/* L,V */\n\t\t*a = LBASE + (si / NCOUNT);\n\t\t*b = VBASE + (si % NCOUNT) / TCOUNT;\n\t\treturn 2;\n\t}\n}\n\nstatic int hangul_pair_compose(unsigned int *code, unsigned int a, unsigned int b)\n{\n\tif (b < VBASE || b >= (TBASE + TCOUNT))\n\t\treturn 0;\n\n\tif ((a < LBASE || a >= (LBASE + LCOUNT))\n\t\t\t&& (a < SBASE || a >= (SBASE + SCOUNT)))\n\t\treturn 0;\n\n\tif (a >= SBASE) {\n\t\t/* LV,T */\n\t\t*code = a + (b - TBASE);\n\t\treturn 3;\n\t} else {\n\t\t/* L,V */\n\t\tint li = a - LBASE;\n\t\tint vi = b - VBASE;\n\t\t*code = SBASE + li * NCOUNT + vi * TCOUNT;\n\t\treturn 2;\n\t}\n}\n\nstatic unsigned int decode_utf16(const unsigned short **code_ptr)\n{\n\tconst unsigned short *code = *code_ptr;\n\n\tif ((code[0] & 0xd800) != 0xd800) {\n\t\t*code_ptr += 1;\n\t\treturn (unsigned int)code[0];\n\t} else {\n\t\t*code_ptr += 2;\n\t\treturn 0x10000 + ((unsigned int)code[1] - 0xdc00) +\n\t\t\t(((unsigned int)code[0] - 0xd800) << 10);\n\t}\n}\n\nconst char *ucdn_get_unicode_version(void)\n{\n\treturn UNIDATA_VERSION;\n}\n\nint ucdn_get_combining_class(unsigned int code)\n{\n\treturn get_ucd_record(code)->combining;\n}\n\nint ucdn_get_east_asian_width(unsigned int code)\n{\n\treturn get_ucd_record(code)->east_asian_width;\n}\n\nint ucdn_get_general_category(unsigned int code)\n{\n\treturn get_ucd_record(code)->category;\n}\n\nint ucdn_get_bidi_class(unsigned int code)\n{\n\treturn get_ucd_record(code)->bidi_class;\n}\n\nint ucdn_get_mirrored(unsigned int code)\n{\n\treturn get_ucd_record(code)->mirrored;\n}\n\nint ucdn_get_script(unsigned int code)\n{\n\treturn get_ucd_record(code)->script;\n}\n\nunsigned int ucdn_mirror(unsigned int code)\n{\n\tMirrorPair mp = {0};\n\tMirrorPair *res;\n\n\tif (get_ucd_record(code)->mirrored == 0)\n\t\treturn code;\n\n\tmp.from = (unsigned short)code;\n\tres = bsearch(&mp, mirror_pairs, BIDI_MIRROR_LEN, sizeof(MirrorPair),\n\t\t\tcompare_mp);\n\n\tif (res == NULL)\n\t\treturn code;\n\telse\n\t\treturn res->to;\n}\n\nint ucdn_decompose(unsigned int code, unsigned int *a, unsigned int *b)\n{\n\tconst unsigned short *rec;\n\tint len;\n\n\tif (hangul_pair_decompose(code, a, b))\n\t\treturn 1;\n\n\trec = get_decomp_record(code);\n\tlen = rec[0] >> 8;\n\n\tif ((rec[0] & 0xff) != 0 || len == 0)\n\t\treturn 0;\n\n\trec++;\n\t*a = decode_utf16(&rec);\n\tif (len > 1)\n\t\t*b = decode_utf16(&rec);\n\telse\n\t\t*b = 0;\n\n\treturn 1;\n}\n\nint ucdn_compose(unsigned int *code, unsigned int a, unsigned int b)\n{\n\tint l, r, index, indexi, offset;\n\n\tif (hangul_pair_compose(code, a, b))\n\t\treturn 1;\n\n\tl = get_comp_index(a, nfc_first);\n\tr = get_comp_index(b, nfc_last);\n\n\tif (l < 0 || r < 0)\n\t\treturn 0;\n\n\tindexi = l * TOTAL_LAST + r;\n\tindex = comp_index0[indexi >> (COMP_SHIFT1+COMP_SHIFT2)] << COMP_SHIFT1;\n\toffset = (indexi >> COMP_SHIFT2) & ((1<<COMP_SHIFT1) - 1);\n\tindex = comp_index1[index + offset] << COMP_SHIFT2;\n\toffset = indexi & ((1<<COMP_SHIFT2) - 1);\n\t*code = comp_data[index + offset];\n\n\treturn *code != 0;\n}\n\nint ucdn_compat_decompose(unsigned int code, unsigned int *decomposed)\n{\n\tint i, len;\n\tconst unsigned short *rec = get_decomp_record(code);\n\tlen = rec[0] >> 8;\n\n\tif (len == 0)\n\t\treturn 0;\n\n\trec++;\n\tfor (i = 0; i < len; i++)\n\t\tdecomposed[i] = decode_utf16(&rec);\n\n\treturn len;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/ucdn.h",
    "content": "/*\n * Copyright (C) 2012 Grigori Goronzy <greg@kinoho.net>\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n#ifndef UCDN_H\n#define UCDN_H\n\n#define UCDN_EAST_ASIAN_F 0\n#define UCDN_EAST_ASIAN_H 1\n#define UCDN_EAST_ASIAN_W 2\n#define UCDN_EAST_ASIAN_NA 3\n#define UCDN_EAST_ASIAN_A 4\n#define UCDN_EAST_ASIAN_N 5\n\n#define UCDN_SCRIPT_COMMON 0\n#define UCDN_SCRIPT_LATIN 1\n#define UCDN_SCRIPT_GREEK 2\n#define UCDN_SCRIPT_CYRILLIC 3\n#define UCDN_SCRIPT_ARMENIAN 4\n#define UCDN_SCRIPT_HEBREW 5\n#define UCDN_SCRIPT_ARABIC 6\n#define UCDN_SCRIPT_SYRIAC 7\n#define UCDN_SCRIPT_THAANA 8\n#define UCDN_SCRIPT_DEVANAGARI 9\n#define UCDN_SCRIPT_BENGALI 10\n#define UCDN_SCRIPT_GURMUKHI 11\n#define UCDN_SCRIPT_GUJARATI 12\n#define UCDN_SCRIPT_ORIYA 13\n#define UCDN_SCRIPT_TAMIL 14\n#define UCDN_SCRIPT_TELUGU 15\n#define UCDN_SCRIPT_KANNADA 16\n#define UCDN_SCRIPT_MALAYALAM 17\n#define UCDN_SCRIPT_SINHALA 18\n#define UCDN_SCRIPT_THAI 19\n#define UCDN_SCRIPT_LAO 20\n#define UCDN_SCRIPT_TIBETAN 21\n#define UCDN_SCRIPT_MYANMAR 22\n#define UCDN_SCRIPT_GEORGIAN 23\n#define UCDN_SCRIPT_HANGUL 24\n#define UCDN_SCRIPT_ETHIOPIC 25\n#define UCDN_SCRIPT_CHEROKEE 26\n#define UCDN_SCRIPT_CANADIAN_ABORIGINAL 27\n#define UCDN_SCRIPT_OGHAM 28\n#define UCDN_SCRIPT_RUNIC 29\n#define UCDN_SCRIPT_KHMER 30\n#define UCDN_SCRIPT_MONGOLIAN 31\n#define UCDN_SCRIPT_HIRAGANA 32\n#define UCDN_SCRIPT_KATAKANA 33\n#define UCDN_SCRIPT_BOPOMOFO 34\n#define UCDN_SCRIPT_HAN 35\n#define UCDN_SCRIPT_YI 36\n#define UCDN_SCRIPT_OLD_ITALIC 37\n#define UCDN_SCRIPT_GOTHIC 38\n#define UCDN_SCRIPT_DESERET 39\n#define UCDN_SCRIPT_INHERITED 40\n#define UCDN_SCRIPT_TAGALOG 41\n#define UCDN_SCRIPT_HANUNOO 42\n#define UCDN_SCRIPT_BUHID 43\n#define UCDN_SCRIPT_TAGBANWA 44\n#define UCDN_SCRIPT_LIMBU 45\n#define UCDN_SCRIPT_TAI_LE 46\n#define UCDN_SCRIPT_LINEAR_B 47\n#define UCDN_SCRIPT_UGARITIC 48\n#define UCDN_SCRIPT_SHAVIAN 49\n#define UCDN_SCRIPT_OSMANYA 50\n#define UCDN_SCRIPT_CYPRIOT 51\n#define UCDN_SCRIPT_BRAILLE 52\n#define UCDN_SCRIPT_BUGINESE 53\n#define UCDN_SCRIPT_COPTIC 54\n#define UCDN_SCRIPT_NEW_TAI_LUE 55\n#define UCDN_SCRIPT_GLAGOLITIC 56\n#define UCDN_SCRIPT_TIFINAGH 57\n#define UCDN_SCRIPT_SYLOTI_NAGRI 58\n#define UCDN_SCRIPT_OLD_PERSIAN 59\n#define UCDN_SCRIPT_KHAROSHTHI 60\n#define UCDN_SCRIPT_BALINESE 61\n#define UCDN_SCRIPT_CUNEIFORM 62\n#define UCDN_SCRIPT_PHOENICIAN 63\n#define UCDN_SCRIPT_PHAGS_PA 64\n#define UCDN_SCRIPT_NKO 65\n#define UCDN_SCRIPT_SUNDANESE 66\n#define UCDN_SCRIPT_LEPCHA 67\n#define UCDN_SCRIPT_OL_CHIKI 68\n#define UCDN_SCRIPT_VAI 69\n#define UCDN_SCRIPT_SAURASHTRA 70\n#define UCDN_SCRIPT_KAYAH_LI 71\n#define UCDN_SCRIPT_REJANG 72\n#define UCDN_SCRIPT_LYCIAN 73\n#define UCDN_SCRIPT_CARIAN 74\n#define UCDN_SCRIPT_LYDIAN 75\n#define UCDN_SCRIPT_CHAM 76\n#define UCDN_SCRIPT_TAI_THAM 77\n#define UCDN_SCRIPT_TAI_VIET 78\n#define UCDN_SCRIPT_AVESTAN 79\n#define UCDN_SCRIPT_EGYPTIAN_HIEROGLYPHS 80\n#define UCDN_SCRIPT_SAMARITAN 81\n#define UCDN_SCRIPT_LISU 82\n#define UCDN_SCRIPT_BAMUM 83\n#define UCDN_SCRIPT_JAVANESE 84\n#define UCDN_SCRIPT_MEETEI_MAYEK 85\n#define UCDN_SCRIPT_IMPERIAL_ARAMAIC 86\n#define UCDN_SCRIPT_OLD_SOUTH_ARABIAN 87\n#define UCDN_SCRIPT_INSCRIPTIONAL_PARTHIAN 88\n#define UCDN_SCRIPT_INSCRIPTIONAL_PAHLAVI 89\n#define UCDN_SCRIPT_OLD_TURKIC 90\n#define UCDN_SCRIPT_KAITHI 91\n#define UCDN_SCRIPT_BATAK 92\n#define UCDN_SCRIPT_BRAHMI 93\n#define UCDN_SCRIPT_MANDAIC 94\n#define UCDN_SCRIPT_CHAKMA 95\n#define UCDN_SCRIPT_MEROITIC_CURSIVE 96\n#define UCDN_SCRIPT_MEROITIC_HIEROGLYPHS 97\n#define UCDN_SCRIPT_MIAO 98\n#define UCDN_SCRIPT_SHARADA 99\n#define UCDN_SCRIPT_SORA_SOMPENG 100\n#define UCDN_SCRIPT_TAKRI 101\n#define UCDN_SCRIPT_UNKNOWN 102\n\n#define UCDN_GENERAL_CATEGORY_CC 0\n#define UCDN_GENERAL_CATEGORY_CF 1\n#define UCDN_GENERAL_CATEGORY_CN 2\n#define UCDN_GENERAL_CATEGORY_CO 3\n#define UCDN_GENERAL_CATEGORY_CS 4\n#define UCDN_GENERAL_CATEGORY_LL 5\n#define UCDN_GENERAL_CATEGORY_LM 6\n#define UCDN_GENERAL_CATEGORY_LO 7\n#define UCDN_GENERAL_CATEGORY_LT 8\n#define UCDN_GENERAL_CATEGORY_LU 9\n#define UCDN_GENERAL_CATEGORY_MC 10\n#define UCDN_GENERAL_CATEGORY_ME 11\n#define UCDN_GENERAL_CATEGORY_MN 12\n#define UCDN_GENERAL_CATEGORY_ND 13\n#define UCDN_GENERAL_CATEGORY_NL 14\n#define UCDN_GENERAL_CATEGORY_NO 15\n#define UCDN_GENERAL_CATEGORY_PC 16\n#define UCDN_GENERAL_CATEGORY_PD 17\n#define UCDN_GENERAL_CATEGORY_PE 18\n#define UCDN_GENERAL_CATEGORY_PF 19\n#define UCDN_GENERAL_CATEGORY_PI 20\n#define UCDN_GENERAL_CATEGORY_PO 21\n#define UCDN_GENERAL_CATEGORY_PS 22\n#define UCDN_GENERAL_CATEGORY_SC 23\n#define UCDN_GENERAL_CATEGORY_SK 24\n#define UCDN_GENERAL_CATEGORY_SM 25\n#define UCDN_GENERAL_CATEGORY_SO 26\n#define UCDN_GENERAL_CATEGORY_ZL 27\n#define UCDN_GENERAL_CATEGORY_ZP 28\n#define UCDN_GENERAL_CATEGORY_ZS 29\n\n#define UCDN_BIDI_CLASS_L 0\n#define UCDN_BIDI_CLASS_LRE 1\n#define UCDN_BIDI_CLASS_LRO 2\n#define UCDN_BIDI_CLASS_R 3\n#define UCDN_BIDI_CLASS_AL 4\n#define UCDN_BIDI_CLASS_RLE 5\n#define UCDN_BIDI_CLASS_RLO 6\n#define UCDN_BIDI_CLASS_PDF 7\n#define UCDN_BIDI_CLASS_EN 8\n#define UCDN_BIDI_CLASS_ES 9\n#define UCDN_BIDI_CLASS_ET 10\n#define UCDN_BIDI_CLASS_AN 11\n#define UCDN_BIDI_CLASS_CS 12\n#define UCDN_BIDI_CLASS_NSM 13\n#define UCDN_BIDI_CLASS_BN 14\n#define UCDN_BIDI_CLASS_B 15\n#define UCDN_BIDI_CLASS_S 16\n#define UCDN_BIDI_CLASS_WS 17\n#define UCDN_BIDI_CLASS_ON 18\n\n/**\n * Return version of the Unicode database.\n *\n * @return Unicode database version\n */\nconst char *ucdn_get_unicode_version(void);\n\n/**\n * Get combining class of a codepoint.\n *\n * @param code Unicode codepoint\n * @return combining class value, as defined in UAX#44\n */\nint ucdn_get_combining_class(unsigned int code);\n\n/**\n * Get east-asian width of a codepoint.\n *\n * @param code Unicode codepoint\n * @return value according to UCDN_EAST_ASIAN_* and as defined in UAX#11.\n */\nint ucdn_get_east_asian_width(unsigned int code);\n\n/**\n * Get general category of a codepoint.\n *\n * @param code Unicode codepoint\n * @return value according to UCDN_GENERAL_CATEGORY_* and as defined in\n * UAX#44.\n */\nint ucdn_get_general_category(unsigned int code);\n\n/**\n * Get bidirectional class of a codepoint.\n *\n * @param code Unicode codepoint\n * @return value according to UCDN_BIDI_CLASS_* and as defined in UAX#44.\n */\nint ucdn_get_bidi_class(unsigned int code);\n\n/**\n * Get script of a codepoint.\n *\n * @param code Unicode codepoint\n * @return value according to UCDN_SCRIPT_* and as defined in UAX#24.\n */\nint ucdn_get_script(unsigned int code);\n\n/**\n * Check if codepoint can be mirrored.\n *\n * @param code Unicode codepoint\n * @return 1 if mirrored character exists, otherwise 0\n */\nint ucdn_get_mirrored(unsigned int code);\n\n/**\n * Mirror a codepoint.\n *\n * @param code Unicode codepoint\n * @return mirrored codepoint or the original codepoint if no\n * mirrored character exists\n */\nunsigned int ucdn_mirror(unsigned int code);\n\n/**\n * Pairwise canonical decomposition of a codepoint. This includes\n * Hangul Jamo decomposition (see chapter 3.12 of the Unicode core\n * specification).\n *\n * Hangul is decomposed into L and V jamos for LV forms, and an\n * LV precomposed syllable and a T jamo for LVT forms.\n *\n * @param code Unicode codepoint\n * @param a filled with first codepoint of decomposition\n * @param b filled with second codepoint of decomposition, or 0\n * @return success\n */\nint ucdn_decompose(unsigned int code, unsigned int *a, unsigned int *b);\n\n/**\n * Compatibility decomposition of a codepoint.\n *\n * @param code Unicode codepoint\n * @param decomposed filled with decomposition, must be able to hold 18\n * characters\n * @return length of decomposition or 0 in case none exists\n */\nint ucdn_compat_decompose(unsigned int code, unsigned int *decomposed);\n\n/**\n * Pairwise canonical composition of two codepoints. This includes\n * Hangul Jamo composition (see chapter 3.12 of the Unicode core\n * specification).\n *\n * Hangul composition expects either L and V jamos, or an LV\n * precomposed syllable and a T jamo. This is exactly the inverse\n * of pairwise Hangul decomposition.\n *\n * @param code filled with composition\n * @param a first codepoint\n * @param b second codepoint\n * @return success\n */\nint ucdn_compose(unsigned int *code, unsigned int a, unsigned int b);\n\n#endif\n"
  },
  {
    "path": "mupdf/source/fitz/unicodedata_db.h",
    "content": "/* this file was generated by makeunicodedata.py 3.2 */\n\n#define UNIDATA_VERSION \"6.2.0\"\n/* a list of unique database records */\nstatic const UCDRecord ucd_records[] = {\n\t{2, 0, 18, 0, 5, 0, 102},\n\t{0, 0, 14, 0, 5, 0, 0},\n\t{0, 0, 16, 0, 5, 0, 0},\n\t{0, 0, 15, 0, 5, 0, 0},\n\t{0, 0, 17, 0, 5, 0, 0},\n\t{29, 0, 17, 0, 3, 0, 0},\n\t{21, 0, 18, 0, 3, 0, 0},\n\t{21, 0, 10, 0, 3, 0, 0},\n\t{23, 0, 10, 0, 3, 0, 0},\n\t{22, 0, 18, 1, 3, 0, 0},\n\t{18, 0, 18, 1, 3, 0, 0},\n\t{25, 0, 9, 0, 3, 0, 0},\n\t{21, 0, 12, 0, 3, 0, 0},\n\t{17, 0, 9, 0, 3, 0, 0},\n\t{13, 0, 8, 0, 3, 0, 0},\n\t{25, 0, 18, 1, 3, 0, 0},\n\t{25, 0, 18, 0, 3, 0, 0},\n\t{9, 0, 0, 0, 3, 0, 1},\n\t{24, 0, 18, 0, 3, 0, 0},\n\t{16, 0, 18, 0, 3, 0, 0},\n\t{5, 0, 0, 0, 3, 0, 1},\n\t{29, 0, 12, 0, 5, 0, 0},\n\t{21, 0, 18, 0, 4, 0, 0},\n\t{23, 0, 10, 0, 4, 0, 0},\n\t{26, 0, 18, 0, 3, 0, 0},\n\t{24, 0, 18, 0, 4, 0, 0},\n\t{26, 0, 18, 0, 5, 0, 0},\n\t{7, 0, 0, 0, 4, 0, 1},\n\t{20, 0, 18, 1, 5, 0, 0},\n\t{1, 0, 14, 0, 4, 0, 0},\n\t{26, 0, 18, 0, 4, 0, 0},\n\t{26, 0, 10, 0, 4, 0, 0},\n\t{25, 0, 10, 0, 4, 0, 0},\n\t{15, 0, 8, 0, 4, 0, 0},\n\t{5, 0, 0, 0, 5, 0, 0},\n\t{19, 0, 18, 1, 5, 0, 0},\n\t{15, 0, 18, 0, 4, 0, 0},\n\t{9, 0, 0, 0, 5, 0, 1},\n\t{9, 0, 0, 0, 4, 0, 1},\n\t{25, 0, 18, 0, 4, 0, 0},\n\t{5, 0, 0, 0, 4, 0, 1},\n\t{5, 0, 0, 0, 5, 0, 1},\n\t{7, 0, 0, 0, 5, 0, 1},\n\t{8, 0, 0, 0, 5, 0, 1},\n\t{6, 0, 0, 0, 5, 0, 1},\n\t{6, 0, 18, 0, 5, 0, 0},\n\t{6, 0, 0, 0, 5, 0, 0},\n\t{24, 0, 18, 0, 5, 0, 0},\n\t{6, 0, 18, 0, 4, 0, 0},\n\t{6, 0, 0, 0, 4, 0, 0},\n\t{24, 0, 18, 0, 5, 0, 34},\n\t{12, 230, 13, 0, 4, 0, 40},\n\t{12, 232, 13, 0, 4, 0, 40},\n\t{12, 220, 13, 0, 4, 0, 40},\n\t{12, 216, 13, 0, 4, 0, 40},\n\t{12, 202, 13, 0, 4, 0, 40},\n\t{12, 1, 13, 0, 4, 0, 40},\n\t{12, 240, 13, 0, 4, 0, 40},\n\t{12, 0, 13, 0, 4, 0, 40},\n\t{12, 233, 13, 0, 4, 0, 40},\n\t{12, 234, 13, 0, 4, 0, 40},\n\t{9, 0, 0, 0, 5, 0, 2},\n\t{5, 0, 0, 0, 5, 0, 2},\n\t{24, 0, 18, 0, 5, 0, 2},\n\t{2, 0, 18, 0, 5, 0, 102},\n\t{6, 0, 0, 0, 5, 0, 2},\n\t{21, 0, 18, 0, 5, 0, 0},\n\t{9, 0, 0, 0, 4, 0, 2},\n\t{5, 0, 0, 0, 4, 0, 2},\n\t{9, 0, 0, 0, 5, 0, 54},\n\t{5, 0, 0, 0, 5, 0, 54},\n\t{25, 0, 18, 0, 5, 0, 2},\n\t{9, 0, 0, 0, 5, 0, 3},\n\t{9, 0, 0, 0, 4, 0, 3},\n\t{5, 0, 0, 0, 4, 0, 3},\n\t{5, 0, 0, 0, 5, 0, 3},\n\t{26, 0, 0, 0, 5, 0, 3},\n\t{12, 230, 13, 0, 5, 0, 3},\n\t{12, 230, 13, 0, 5, 0, 40},\n\t{11, 0, 13, 0, 5, 0, 3},\n\t{9, 0, 0, 0, 5, 0, 4},\n\t{6, 0, 0, 0, 5, 0, 4},\n\t{21, 0, 0, 0, 5, 0, 4},\n\t{5, 0, 0, 0, 5, 0, 4},\n\t{21, 0, 0, 0, 5, 0, 0},\n\t{17, 0, 18, 0, 5, 0, 4},\n\t{23, 0, 10, 0, 5, 0, 4},\n\t{12, 220, 13, 0, 5, 0, 5},\n\t{12, 230, 13, 0, 5, 0, 5},\n\t{12, 222, 13, 0, 5, 0, 5},\n\t{12, 228, 13, 0, 5, 0, 5},\n\t{12, 10, 13, 0, 5, 0, 5},\n\t{12, 11, 13, 0, 5, 0, 5},\n\t{12, 12, 13, 0, 5, 0, 5},\n\t{12, 13, 13, 0, 5, 0, 5},\n\t{12, 14, 13, 0, 5, 0, 5},\n\t{12, 15, 13, 0, 5, 0, 5},\n\t{12, 16, 13, 0, 5, 0, 5},\n\t{12, 17, 13, 0, 5, 0, 5},\n\t{12, 18, 13, 0, 5, 0, 5},\n\t{12, 19, 13, 0, 5, 0, 5},\n\t{12, 20, 13, 0, 5, 0, 5},\n\t{12, 21, 13, 0, 5, 0, 5},\n\t{12, 22, 13, 0, 5, 0, 5},\n\t{17, 0, 3, 0, 5, 0, 5},\n\t{12, 23, 13, 0, 5, 0, 5},\n\t{21, 0, 3, 0, 5, 0, 5},\n\t{12, 24, 13, 0, 5, 0, 5},\n\t{12, 25, 13, 0, 5, 0, 5},\n\t{7, 0, 3, 0, 5, 0, 5},\n\t{1, 0, 11, 0, 5, 0, 6},\n\t{25, 0, 18, 0, 5, 0, 6},\n\t{25, 0, 4, 0, 5, 0, 6},\n\t{21, 0, 10, 0, 5, 0, 6},\n\t{23, 0, 4, 0, 5, 0, 6},\n\t{21, 0, 12, 0, 5, 0, 0},\n\t{21, 0, 4, 0, 5, 0, 6},\n\t{26, 0, 18, 0, 5, 0, 6},\n\t{12, 230, 13, 0, 5, 0, 6},\n\t{12, 30, 13, 0, 5, 0, 6},\n\t{12, 31, 13, 0, 5, 0, 6},\n\t{12, 32, 13, 0, 5, 0, 6},\n\t{21, 0, 4, 0, 5, 0, 0},\n\t{7, 0, 4, 0, 5, 0, 6},\n\t{6, 0, 4, 0, 5, 0, 0},\n\t{12, 27, 13, 0, 5, 0, 40},\n\t{12, 28, 13, 0, 5, 0, 40},\n\t{12, 29, 13, 0, 5, 0, 40},\n\t{12, 30, 13, 0, 5, 0, 40},\n\t{12, 31, 13, 0, 5, 0, 40},\n\t{12, 32, 13, 0, 5, 0, 40},\n\t{12, 33, 13, 0, 5, 0, 40},\n\t{12, 34, 13, 0, 5, 0, 40},\n\t{12, 220, 13, 0, 5, 0, 40},\n\t{12, 220, 13, 0, 5, 0, 6},\n\t{13, 0, 11, 0, 5, 0, 0},\n\t{21, 0, 11, 0, 5, 0, 6},\n\t{12, 35, 13, 0, 5, 0, 40},\n\t{1, 0, 11, 0, 5, 0, 0},\n\t{6, 0, 4, 0, 5, 0, 6},\n\t{13, 0, 8, 0, 5, 0, 6},\n\t{26, 0, 4, 0, 5, 0, 6},\n\t{21, 0, 4, 0, 5, 0, 7},\n\t{1, 0, 4, 0, 5, 0, 7},\n\t{7, 0, 4, 0, 5, 0, 7},\n\t{12, 36, 13, 0, 5, 0, 7},\n\t{12, 230, 13, 0, 5, 0, 7},\n\t{12, 220, 13, 0, 5, 0, 7},\n\t{7, 0, 4, 0, 5, 0, 8},\n\t{12, 0, 13, 0, 5, 0, 8},\n\t{13, 0, 3, 0, 5, 0, 65},\n\t{7, 0, 3, 0, 5, 0, 65},\n\t{12, 230, 13, 0, 5, 0, 65},\n\t{12, 220, 13, 0, 5, 0, 65},\n\t{6, 0, 3, 0, 5, 0, 65},\n\t{26, 0, 18, 0, 5, 0, 65},\n\t{21, 0, 18, 0, 5, 0, 65},\n\t{7, 0, 3, 0, 5, 0, 81},\n\t{12, 230, 13, 0, 5, 0, 81},\n\t{6, 0, 3, 0, 5, 0, 81},\n\t{21, 0, 3, 0, 5, 0, 81},\n\t{7, 0, 3, 0, 5, 0, 94},\n\t{12, 220, 13, 0, 5, 0, 94},\n\t{21, 0, 3, 0, 5, 0, 94},\n\t{12, 27, 13, 0, 5, 0, 6},\n\t{12, 28, 13, 0, 5, 0, 6},\n\t{12, 29, 13, 0, 5, 0, 6},\n\t{12, 0, 13, 0, 5, 0, 9},\n\t{10, 0, 0, 0, 5, 0, 9},\n\t{7, 0, 0, 0, 5, 0, 9},\n\t{12, 7, 13, 0, 5, 0, 9},\n\t{12, 9, 13, 0, 5, 0, 9},\n\t{12, 230, 13, 0, 5, 0, 9},\n\t{13, 0, 0, 0, 5, 0, 9},\n\t{21, 0, 0, 0, 5, 0, 9},\n\t{6, 0, 0, 0, 5, 0, 9},\n\t{12, 0, 13, 0, 5, 0, 10},\n\t{10, 0, 0, 0, 5, 0, 10},\n\t{7, 0, 0, 0, 5, 0, 10},\n\t{12, 7, 13, 0, 5, 0, 10},\n\t{12, 9, 13, 0, 5, 0, 10},\n\t{13, 0, 0, 0, 5, 0, 10},\n\t{23, 0, 10, 0, 5, 0, 10},\n\t{15, 0, 0, 0, 5, 0, 10},\n\t{26, 0, 0, 0, 5, 0, 10},\n\t{12, 0, 13, 0, 5, 0, 11},\n\t{10, 0, 0, 0, 5, 0, 11},\n\t{7, 0, 0, 0, 5, 0, 11},\n\t{12, 7, 13, 0, 5, 0, 11},\n\t{12, 9, 13, 0, 5, 0, 11},\n\t{13, 0, 0, 0, 5, 0, 11},\n\t{12, 0, 13, 0, 5, 0, 12},\n\t{10, 0, 0, 0, 5, 0, 12},\n\t{7, 0, 0, 0, 5, 0, 12},\n\t{12, 7, 13, 0, 5, 0, 12},\n\t{12, 9, 13, 0, 5, 0, 12},\n\t{13, 0, 0, 0, 5, 0, 12},\n\t{21, 0, 0, 0, 5, 0, 12},\n\t{23, 0, 10, 0, 5, 0, 12},\n\t{12, 0, 13, 0, 5, 0, 13},\n\t{10, 0, 0, 0, 5, 0, 13},\n\t{7, 0, 0, 0, 5, 0, 13},\n\t{12, 7, 13, 0, 5, 0, 13},\n\t{12, 9, 13, 0, 5, 0, 13},\n\t{13, 0, 0, 0, 5, 0, 13},\n\t{26, 0, 0, 0, 5, 0, 13},\n\t{15, 0, 0, 0, 5, 0, 13},\n\t{12, 0, 13, 0, 5, 0, 14},\n\t{7, 0, 0, 0, 5, 0, 14},\n\t{10, 0, 0, 0, 5, 0, 14},\n\t{12, 9, 13, 0, 5, 0, 14},\n\t{13, 0, 0, 0, 5, 0, 14},\n\t{15, 0, 0, 0, 5, 0, 14},\n\t{26, 0, 18, 0, 5, 0, 14},\n\t{23, 0, 10, 0, 5, 0, 14},\n\t{10, 0, 0, 0, 5, 0, 15},\n\t{7, 0, 0, 0, 5, 0, 15},\n\t{12, 0, 13, 0, 5, 0, 15},\n\t{12, 9, 13, 0, 5, 0, 15},\n\t{12, 84, 13, 0, 5, 0, 15},\n\t{12, 91, 13, 0, 5, 0, 15},\n\t{13, 0, 0, 0, 5, 0, 15},\n\t{15, 0, 18, 0, 5, 0, 15},\n\t{26, 0, 0, 0, 5, 0, 15},\n\t{10, 0, 0, 0, 5, 0, 16},\n\t{7, 0, 0, 0, 5, 0, 16},\n\t{12, 7, 13, 0, 5, 0, 16},\n\t{12, 0, 0, 0, 5, 0, 16},\n\t{12, 0, 13, 0, 5, 0, 16},\n\t{12, 9, 13, 0, 5, 0, 16},\n\t{13, 0, 0, 0, 5, 0, 16},\n\t{10, 0, 0, 0, 5, 0, 17},\n\t{7, 0, 0, 0, 5, 0, 17},\n\t{12, 0, 13, 0, 5, 0, 17},\n\t{12, 9, 13, 0, 5, 0, 17},\n\t{13, 0, 0, 0, 5, 0, 17},\n\t{15, 0, 0, 0, 5, 0, 17},\n\t{26, 0, 0, 0, 5, 0, 17},\n\t{10, 0, 0, 0, 5, 0, 18},\n\t{7, 0, 0, 0, 5, 0, 18},\n\t{12, 9, 13, 0, 5, 0, 18},\n\t{12, 0, 13, 0, 5, 0, 18},\n\t{21, 0, 0, 0, 5, 0, 18},\n\t{7, 0, 0, 0, 5, 0, 19},\n\t{12, 0, 13, 0, 5, 0, 19},\n\t{12, 103, 13, 0, 5, 0, 19},\n\t{12, 9, 13, 0, 5, 0, 19},\n\t{23, 0, 10, 0, 5, 0, 0},\n\t{6, 0, 0, 0, 5, 0, 19},\n\t{12, 107, 13, 0, 5, 0, 19},\n\t{21, 0, 0, 0, 5, 0, 19},\n\t{13, 0, 0, 0, 5, 0, 19},\n\t{7, 0, 0, 0, 5, 0, 20},\n\t{12, 0, 13, 0, 5, 0, 20},\n\t{12, 118, 13, 0, 5, 0, 20},\n\t{6, 0, 0, 0, 5, 0, 20},\n\t{12, 122, 13, 0, 5, 0, 20},\n\t{13, 0, 0, 0, 5, 0, 20},\n\t{7, 0, 0, 0, 5, 0, 21},\n\t{26, 0, 0, 0, 5, 0, 21},\n\t{21, 0, 0, 0, 5, 0, 21},\n\t{12, 220, 13, 0, 5, 0, 21},\n\t{13, 0, 0, 0, 5, 0, 21},\n\t{15, 0, 0, 0, 5, 0, 21},\n\t{12, 216, 13, 0, 5, 0, 21},\n\t{22, 0, 18, 1, 5, 0, 21},\n\t{18, 0, 18, 1, 5, 0, 21},\n\t{10, 0, 0, 0, 5, 0, 21},\n\t{12, 129, 13, 0, 5, 0, 21},\n\t{12, 130, 13, 0, 5, 0, 21},\n\t{12, 0, 13, 0, 5, 0, 21},\n\t{12, 132, 13, 0, 5, 0, 21},\n\t{12, 230, 13, 0, 5, 0, 21},\n\t{12, 9, 13, 0, 5, 0, 21},\n\t{26, 0, 0, 0, 5, 0, 0},\n\t{7, 0, 0, 0, 5, 0, 22},\n\t{10, 0, 0, 0, 5, 0, 22},\n\t{12, 0, 13, 0, 5, 0, 22},\n\t{12, 7, 13, 0, 5, 0, 22},\n\t{12, 9, 13, 0, 5, 0, 22},\n\t{13, 0, 0, 0, 5, 0, 22},\n\t{21, 0, 0, 0, 5, 0, 22},\n\t{12, 220, 13, 0, 5, 0, 22},\n\t{26, 0, 0, 0, 5, 0, 22},\n\t{9, 0, 0, 0, 5, 0, 23},\n\t{7, 0, 0, 0, 5, 0, 23},\n\t{6, 0, 0, 0, 5, 0, 23},\n\t{7, 0, 0, 0, 2, 0, 24},\n\t{7, 0, 0, 0, 5, 0, 24},\n\t{7, 0, 0, 0, 5, 0, 25},\n\t{12, 230, 13, 0, 5, 0, 25},\n\t{21, 0, 0, 0, 5, 0, 25},\n\t{15, 0, 0, 0, 5, 0, 25},\n\t{26, 0, 18, 0, 5, 0, 25},\n\t{7, 0, 0, 0, 5, 0, 26},\n\t{17, 0, 18, 0, 5, 0, 27},\n\t{7, 0, 0, 0, 5, 0, 27},\n\t{21, 0, 0, 0, 5, 0, 27},\n\t{29, 0, 17, 0, 5, 0, 28},\n\t{7, 0, 0, 0, 5, 0, 28},\n\t{22, 0, 18, 1, 5, 0, 28},\n\t{18, 0, 18, 1, 5, 0, 28},\n\t{7, 0, 0, 0, 5, 0, 29},\n\t{14, 0, 0, 0, 5, 0, 29},\n\t{7, 0, 0, 0, 5, 0, 41},\n\t{12, 0, 13, 0, 5, 0, 41},\n\t{12, 9, 13, 0, 5, 0, 41},\n\t{7, 0, 0, 0, 5, 0, 42},\n\t{12, 0, 13, 0, 5, 0, 42},\n\t{12, 9, 13, 0, 5, 0, 42},\n\t{7, 0, 0, 0, 5, 0, 43},\n\t{12, 0, 13, 0, 5, 0, 43},\n\t{7, 0, 0, 0, 5, 0, 44},\n\t{12, 0, 13, 0, 5, 0, 44},\n\t{7, 0, 0, 0, 5, 0, 30},\n\t{12, 0, 13, 0, 5, 0, 30},\n\t{10, 0, 0, 0, 5, 0, 30},\n\t{12, 9, 13, 0, 5, 0, 30},\n\t{21, 0, 0, 0, 5, 0, 30},\n\t{6, 0, 0, 0, 5, 0, 30},\n\t{23, 0, 10, 0, 5, 0, 30},\n\t{12, 230, 13, 0, 5, 0, 30},\n\t{13, 0, 0, 0, 5, 0, 30},\n\t{15, 0, 18, 0, 5, 0, 30},\n\t{21, 0, 18, 0, 5, 0, 31},\n\t{17, 0, 18, 0, 5, 0, 31},\n\t{12, 0, 13, 0, 5, 0, 31},\n\t{29, 0, 17, 0, 5, 0, 31},\n\t{13, 0, 0, 0, 5, 0, 31},\n\t{7, 0, 0, 0, 5, 0, 31},\n\t{6, 0, 0, 0, 5, 0, 31},\n\t{12, 228, 13, 0, 5, 0, 31},\n\t{7, 0, 0, 0, 5, 0, 45},\n\t{12, 0, 13, 0, 5, 0, 45},\n\t{10, 0, 0, 0, 5, 0, 45},\n\t{12, 222, 13, 0, 5, 0, 45},\n\t{12, 230, 13, 0, 5, 0, 45},\n\t{12, 220, 13, 0, 5, 0, 45},\n\t{26, 0, 18, 0, 5, 0, 45},\n\t{21, 0, 18, 0, 5, 0, 45},\n\t{13, 0, 0, 0, 5, 0, 45},\n\t{7, 0, 0, 0, 5, 0, 46},\n\t{7, 0, 0, 0, 5, 0, 55},\n\t{10, 0, 0, 0, 5, 0, 55},\n\t{13, 0, 0, 0, 5, 0, 55},\n\t{15, 0, 0, 0, 5, 0, 55},\n\t{26, 0, 18, 0, 5, 0, 55},\n\t{26, 0, 18, 0, 5, 0, 30},\n\t{7, 0, 0, 0, 5, 0, 53},\n\t{12, 230, 13, 0, 5, 0, 53},\n\t{12, 220, 13, 0, 5, 0, 53},\n\t{10, 0, 0, 0, 5, 0, 53},\n\t{21, 0, 0, 0, 5, 0, 53},\n\t{7, 0, 0, 0, 5, 0, 77},\n\t{10, 0, 0, 0, 5, 0, 77},\n\t{12, 0, 13, 0, 5, 0, 77},\n\t{12, 9, 13, 0, 5, 0, 77},\n\t{12, 230, 13, 0, 5, 0, 77},\n\t{12, 220, 13, 0, 5, 0, 77},\n\t{13, 0, 0, 0, 5, 0, 77},\n\t{21, 0, 0, 0, 5, 0, 77},\n\t{6, 0, 0, 0, 5, 0, 77},\n\t{12, 0, 13, 0, 5, 0, 61},\n\t{10, 0, 0, 0, 5, 0, 61},\n\t{7, 0, 0, 0, 5, 0, 61},\n\t{12, 7, 13, 0, 5, 0, 61},\n\t{10, 9, 0, 0, 5, 0, 61},\n\t{13, 0, 0, 0, 5, 0, 61},\n\t{21, 0, 0, 0, 5, 0, 61},\n\t{26, 0, 0, 0, 5, 0, 61},\n\t{12, 230, 13, 0, 5, 0, 61},\n\t{12, 220, 13, 0, 5, 0, 61},\n\t{12, 0, 13, 0, 5, 0, 66},\n\t{10, 0, 0, 0, 5, 0, 66},\n\t{7, 0, 0, 0, 5, 0, 66},\n\t{10, 9, 0, 0, 5, 0, 66},\n\t{12, 9, 13, 0, 5, 0, 66},\n\t{13, 0, 0, 0, 5, 0, 66},\n\t{7, 0, 0, 0, 5, 0, 92},\n\t{12, 7, 13, 0, 5, 0, 92},\n\t{10, 0, 0, 0, 5, 0, 92},\n\t{12, 0, 13, 0, 5, 0, 92},\n\t{10, 9, 0, 0, 5, 0, 92},\n\t{21, 0, 0, 0, 5, 0, 92},\n\t{7, 0, 0, 0, 5, 0, 67},\n\t{10, 0, 0, 0, 5, 0, 67},\n\t{12, 0, 13, 0, 5, 0, 67},\n\t{12, 7, 13, 0, 5, 0, 67},\n\t{21, 0, 0, 0, 5, 0, 67},\n\t{13, 0, 0, 0, 5, 0, 67},\n\t{13, 0, 0, 0, 5, 0, 68},\n\t{7, 0, 0, 0, 5, 0, 68},\n\t{6, 0, 0, 0, 5, 0, 68},\n\t{21, 0, 0, 0, 5, 0, 68},\n\t{21, 0, 0, 0, 5, 0, 66},\n\t{12, 1, 13, 0, 5, 0, 40},\n\t{10, 0, 0, 0, 5, 0, 0},\n\t{7, 0, 0, 0, 5, 0, 0},\n\t{6, 0, 0, 0, 5, 0, 3},\n\t{12, 234, 13, 0, 5, 0, 40},\n\t{12, 214, 13, 0, 5, 0, 40},\n\t{12, 202, 13, 0, 5, 0, 40},\n\t{12, 233, 13, 0, 5, 0, 40},\n\t{8, 0, 0, 0, 5, 0, 2},\n\t{29, 0, 17, 0, 5, 0, 0},\n\t{1, 0, 14, 0, 5, 0, 0},\n\t{1, 0, 14, 0, 5, 0, 40},\n\t{1, 0, 0, 0, 5, 0, 0},\n\t{1, 0, 3, 0, 5, 0, 0},\n\t{17, 0, 18, 0, 4, 0, 0},\n\t{17, 0, 18, 0, 5, 0, 0},\n\t{20, 0, 18, 0, 4, 0, 0},\n\t{19, 0, 18, 0, 4, 0, 0},\n\t{22, 0, 18, 0, 5, 0, 0},\n\t{20, 0, 18, 0, 5, 0, 0},\n\t{27, 0, 17, 0, 5, 0, 0},\n\t{28, 0, 15, 0, 5, 0, 0},\n\t{1, 0, 1, 0, 5, 0, 0},\n\t{1, 0, 5, 0, 5, 0, 0},\n\t{1, 0, 7, 0, 5, 0, 0},\n\t{1, 0, 2, 0, 5, 0, 0},\n\t{1, 0, 6, 0, 5, 0, 0},\n\t{21, 0, 10, 0, 4, 0, 0},\n\t{21, 0, 10, 0, 5, 0, 0},\n\t{16, 0, 18, 0, 5, 0, 0},\n\t{25, 0, 12, 0, 5, 0, 0},\n\t{22, 0, 18, 1, 5, 0, 0},\n\t{18, 0, 18, 1, 5, 0, 0},\n\t{25, 0, 18, 0, 5, 0, 0},\n\t{15, 0, 8, 0, 5, 0, 0},\n\t{25, 0, 9, 0, 5, 0, 0},\n\t{6, 0, 0, 0, 4, 0, 1},\n\t{23, 0, 10, 0, 1, 0, 0},\n\t{11, 0, 13, 0, 5, 0, 40},\n\t{9, 0, 0, 0, 5, 0, 0},\n\t{5, 0, 0, 0, 4, 0, 0},\n\t{26, 0, 10, 0, 5, 0, 0},\n\t{25, 0, 18, 1, 5, 0, 0},\n\t{15, 0, 18, 0, 5, 0, 0},\n\t{14, 0, 0, 0, 4, 0, 1},\n\t{14, 0, 0, 0, 5, 0, 1},\n\t{25, 0, 18, 1, 4, 0, 0},\n\t{25, 0, 10, 0, 5, 0, 0},\n\t{22, 0, 18, 1, 2, 0, 0},\n\t{18, 0, 18, 1, 2, 0, 0},\n\t{26, 0, 0, 0, 4, 0, 0},\n\t{26, 0, 0, 0, 5, 0, 52},\n\t{9, 0, 0, 0, 5, 0, 56},\n\t{5, 0, 0, 0, 5, 0, 56},\n\t{26, 0, 18, 0, 5, 0, 54},\n\t{12, 230, 13, 0, 5, 0, 54},\n\t{21, 0, 18, 0, 5, 0, 54},\n\t{15, 0, 18, 0, 5, 0, 54},\n\t{5, 0, 0, 0, 5, 0, 23},\n\t{7, 0, 0, 0, 5, 0, 57},\n\t{6, 0, 0, 0, 5, 0, 57},\n\t{21, 0, 0, 0, 5, 0, 57},\n\t{12, 9, 13, 0, 5, 0, 57},\n\t{26, 0, 18, 0, 2, 0, 35},\n\t{26, 0, 18, 0, 2, 0, 0},\n\t{29, 0, 17, 0, 0, 0, 0},\n\t{21, 0, 18, 0, 2, 0, 0},\n\t{6, 0, 0, 0, 2, 0, 35},\n\t{7, 0, 0, 0, 2, 0, 0},\n\t{14, 0, 0, 0, 2, 0, 35},\n\t{17, 0, 18, 0, 2, 0, 0},\n\t{22, 0, 18, 0, 2, 0, 0},\n\t{18, 0, 18, 0, 2, 0, 0},\n\t{12, 218, 13, 0, 2, 0, 40},\n\t{12, 228, 13, 0, 2, 0, 40},\n\t{12, 232, 13, 0, 2, 0, 40},\n\t{12, 222, 13, 0, 2, 0, 40},\n\t{10, 224, 0, 0, 2, 0, 24},\n\t{6, 0, 0, 0, 2, 0, 0},\n\t{7, 0, 0, 0, 2, 0, 32},\n\t{12, 8, 13, 0, 2, 0, 40},\n\t{24, 0, 18, 0, 2, 0, 0},\n\t{6, 0, 0, 0, 2, 0, 32},\n\t{7, 0, 0, 0, 2, 0, 33},\n\t{6, 0, 0, 0, 2, 0, 33},\n\t{7, 0, 0, 0, 2, 0, 34},\n\t{26, 0, 0, 0, 2, 0, 0},\n\t{15, 0, 0, 0, 2, 0, 0},\n\t{26, 0, 0, 0, 2, 0, 24},\n\t{26, 0, 18, 0, 2, 0, 24},\n\t{15, 0, 0, 0, 4, 0, 0},\n\t{15, 0, 18, 0, 2, 0, 0},\n\t{26, 0, 0, 0, 2, 0, 33},\n\t{7, 0, 0, 0, 2, 0, 35},\n\t{2, 0, 18, 0, 2, 0, 35},\n\t{2, 0, 18, 0, 2, 0, 102},\n\t{7, 0, 0, 0, 2, 0, 36},\n\t{6, 0, 0, 0, 2, 0, 36},\n\t{26, 0, 18, 0, 2, 0, 36},\n\t{7, 0, 0, 0, 5, 0, 82},\n\t{6, 0, 0, 0, 5, 0, 82},\n\t{21, 0, 0, 0, 5, 0, 82},\n\t{7, 0, 0, 0, 5, 0, 69},\n\t{6, 0, 0, 0, 5, 0, 69},\n\t{21, 0, 18, 0, 5, 0, 69},\n\t{13, 0, 0, 0, 5, 0, 69},\n\t{7, 0, 0, 0, 5, 0, 3},\n\t{21, 0, 18, 0, 5, 0, 3},\n\t{6, 0, 18, 0, 5, 0, 3},\n\t{7, 0, 0, 0, 5, 0, 83},\n\t{14, 0, 0, 0, 5, 0, 83},\n\t{12, 230, 13, 0, 5, 0, 83},\n\t{21, 0, 0, 0, 5, 0, 83},\n\t{24, 0, 0, 0, 5, 0, 0},\n\t{7, 0, 0, 0, 5, 0, 58},\n\t{12, 0, 13, 0, 5, 0, 58},\n\t{12, 9, 13, 0, 5, 0, 58},\n\t{10, 0, 0, 0, 5, 0, 58},\n\t{26, 0, 18, 0, 5, 0, 58},\n\t{15, 0, 0, 0, 5, 0, 0},\n\t{7, 0, 0, 0, 5, 0, 64},\n\t{21, 0, 18, 0, 5, 0, 64},\n\t{10, 0, 0, 0, 5, 0, 70},\n\t{7, 0, 0, 0, 5, 0, 70},\n\t{12, 9, 13, 0, 5, 0, 70},\n\t{21, 0, 0, 0, 5, 0, 70},\n\t{13, 0, 0, 0, 5, 0, 70},\n\t{13, 0, 0, 0, 5, 0, 71},\n\t{7, 0, 0, 0, 5, 0, 71},\n\t{12, 0, 13, 0, 5, 0, 71},\n\t{12, 220, 13, 0, 5, 0, 71},\n\t{21, 0, 0, 0, 5, 0, 71},\n\t{7, 0, 0, 0, 5, 0, 72},\n\t{12, 0, 13, 0, 5, 0, 72},\n\t{10, 0, 0, 0, 5, 0, 72},\n\t{10, 9, 0, 0, 5, 0, 72},\n\t{21, 0, 0, 0, 5, 0, 72},\n\t{12, 0, 13, 0, 5, 0, 84},\n\t{10, 0, 0, 0, 5, 0, 84},\n\t{7, 0, 0, 0, 5, 0, 84},\n\t{12, 7, 13, 0, 5, 0, 84},\n\t{10, 9, 0, 0, 5, 0, 84},\n\t{21, 0, 0, 0, 5, 0, 84},\n\t{6, 0, 0, 0, 5, 0, 84},\n\t{13, 0, 0, 0, 5, 0, 84},\n\t{7, 0, 0, 0, 5, 0, 76},\n\t{12, 0, 13, 0, 5, 0, 76},\n\t{10, 0, 0, 0, 5, 0, 76},\n\t{13, 0, 0, 0, 5, 0, 76},\n\t{21, 0, 0, 0, 5, 0, 76},\n\t{6, 0, 0, 0, 5, 0, 22},\n\t{7, 0, 0, 0, 5, 0, 78},\n\t{12, 230, 13, 0, 5, 0, 78},\n\t{12, 220, 13, 0, 5, 0, 78},\n\t{6, 0, 0, 0, 5, 0, 78},\n\t{21, 0, 0, 0, 5, 0, 78},\n\t{7, 0, 0, 0, 5, 0, 85},\n\t{10, 0, 0, 0, 5, 0, 85},\n\t{12, 0, 13, 0, 5, 0, 85},\n\t{21, 0, 0, 0, 5, 0, 85},\n\t{6, 0, 0, 0, 5, 0, 85},\n\t{12, 9, 13, 0, 5, 0, 85},\n\t{13, 0, 0, 0, 5, 0, 85},\n\t{2, 0, 18, 0, 2, 0, 24},\n\t{4, 0, 0, 0, 5, 0, 102},\n\t{3, 0, 0, 0, 4, 0, 102},\n\t{2, 0, 18, 0, 4, 0, 102},\n\t{12, 26, 13, 0, 5, 0, 5},\n\t{25, 0, 9, 0, 5, 0, 5},\n\t{24, 0, 4, 0, 5, 0, 6},\n\t{18, 0, 18, 0, 5, 0, 0},\n\t{16, 0, 18, 0, 2, 0, 0},\n\t{21, 0, 12, 0, 2, 0, 0},\n\t{21, 0, 10, 0, 2, 0, 0},\n\t{25, 0, 9, 0, 2, 0, 0},\n\t{17, 0, 9, 0, 2, 0, 0},\n\t{25, 0, 18, 1, 2, 0, 0},\n\t{25, 0, 18, 0, 2, 0, 0},\n\t{23, 0, 10, 0, 2, 0, 0},\n\t{21, 0, 18, 0, 0, 0, 0},\n\t{21, 0, 10, 0, 0, 0, 0},\n\t{23, 0, 10, 0, 0, 0, 0},\n\t{22, 0, 18, 1, 0, 0, 0},\n\t{18, 0, 18, 1, 0, 0, 0},\n\t{25, 0, 9, 0, 0, 0, 0},\n\t{21, 0, 12, 0, 0, 0, 0},\n\t{17, 0, 9, 0, 0, 0, 0},\n\t{13, 0, 8, 0, 0, 0, 0},\n\t{25, 0, 18, 1, 0, 0, 0},\n\t{25, 0, 18, 0, 0, 0, 0},\n\t{9, 0, 0, 0, 0, 0, 1},\n\t{24, 0, 18, 0, 0, 0, 0},\n\t{16, 0, 18, 0, 0, 0, 0},\n\t{5, 0, 0, 0, 0, 0, 1},\n\t{21, 0, 18, 0, 1, 0, 0},\n\t{22, 0, 18, 1, 1, 0, 0},\n\t{18, 0, 18, 1, 1, 0, 0},\n\t{7, 0, 0, 0, 1, 0, 33},\n\t{6, 0, 0, 0, 1, 0, 0},\n\t{7, 0, 0, 0, 1, 0, 24},\n\t{26, 0, 18, 0, 0, 0, 0},\n\t{26, 0, 18, 0, 1, 0, 0},\n\t{25, 0, 18, 0, 1, 0, 0},\n\t{1, 0, 18, 0, 5, 0, 0},\n\t{7, 0, 0, 0, 5, 0, 47},\n\t{14, 0, 18, 0, 5, 0, 2},\n\t{15, 0, 18, 0, 5, 0, 2},\n\t{26, 0, 18, 0, 5, 0, 2},\n\t{7, 0, 0, 0, 5, 0, 73},\n\t{7, 0, 0, 0, 5, 0, 74},\n\t{7, 0, 0, 0, 5, 0, 37},\n\t{15, 0, 0, 0, 5, 0, 37},\n\t{7, 0, 0, 0, 5, 0, 38},\n\t{14, 0, 0, 0, 5, 0, 38},\n\t{7, 0, 0, 0, 5, 0, 48},\n\t{21, 0, 0, 0, 5, 0, 48},\n\t{7, 0, 0, 0, 5, 0, 59},\n\t{21, 0, 0, 0, 5, 0, 59},\n\t{14, 0, 0, 0, 5, 0, 59},\n\t{9, 0, 0, 0, 5, 0, 39},\n\t{5, 0, 0, 0, 5, 0, 39},\n\t{7, 0, 0, 0, 5, 0, 49},\n\t{7, 0, 0, 0, 5, 0, 50},\n\t{13, 0, 0, 0, 5, 0, 50},\n\t{7, 0, 3, 0, 5, 0, 51},\n\t{7, 0, 3, 0, 5, 0, 86},\n\t{21, 0, 3, 0, 5, 0, 86},\n\t{15, 0, 3, 0, 5, 0, 86},\n\t{7, 0, 3, 0, 5, 0, 63},\n\t{15, 0, 3, 0, 5, 0, 63},\n\t{21, 0, 18, 0, 5, 0, 63},\n\t{7, 0, 3, 0, 5, 0, 75},\n\t{21, 0, 3, 0, 5, 0, 75},\n\t{7, 0, 3, 0, 5, 0, 97},\n\t{7, 0, 3, 0, 5, 0, 96},\n\t{7, 0, 3, 0, 5, 0, 60},\n\t{12, 0, 13, 0, 5, 0, 60},\n\t{12, 220, 13, 0, 5, 0, 60},\n\t{12, 230, 13, 0, 5, 0, 60},\n\t{12, 1, 13, 0, 5, 0, 60},\n\t{12, 9, 13, 0, 5, 0, 60},\n\t{15, 0, 3, 0, 5, 0, 60},\n\t{21, 0, 3, 0, 5, 0, 60},\n\t{7, 0, 3, 0, 5, 0, 87},\n\t{15, 0, 3, 0, 5, 0, 87},\n\t{21, 0, 3, 0, 5, 0, 87},\n\t{7, 0, 3, 0, 5, 0, 79},\n\t{21, 0, 18, 0, 5, 0, 79},\n\t{7, 0, 3, 0, 5, 0, 88},\n\t{15, 0, 3, 0, 5, 0, 88},\n\t{7, 0, 3, 0, 5, 0, 89},\n\t{15, 0, 3, 0, 5, 0, 89},\n\t{7, 0, 3, 0, 5, 0, 90},\n\t{15, 0, 11, 0, 5, 0, 6},\n\t{10, 0, 0, 0, 5, 0, 93},\n\t{12, 0, 13, 0, 5, 0, 93},\n\t{7, 0, 0, 0, 5, 0, 93},\n\t{12, 9, 13, 0, 5, 0, 93},\n\t{21, 0, 0, 0, 5, 0, 93},\n\t{15, 0, 18, 0, 5, 0, 93},\n\t{13, 0, 0, 0, 5, 0, 93},\n\t{12, 0, 13, 0, 5, 0, 91},\n\t{10, 0, 0, 0, 5, 0, 91},\n\t{7, 0, 0, 0, 5, 0, 91},\n\t{12, 9, 13, 0, 5, 0, 91},\n\t{12, 7, 13, 0, 5, 0, 91},\n\t{21, 0, 0, 0, 5, 0, 91},\n\t{1, 0, 0, 0, 5, 0, 91},\n\t{7, 0, 0, 0, 5, 0, 100},\n\t{13, 0, 0, 0, 5, 0, 100},\n\t{12, 230, 13, 0, 5, 0, 95},\n\t{7, 0, 0, 0, 5, 0, 95},\n\t{12, 0, 13, 0, 5, 0, 95},\n\t{10, 0, 0, 0, 5, 0, 95},\n\t{12, 9, 13, 0, 5, 0, 95},\n\t{13, 0, 0, 0, 5, 0, 95},\n\t{21, 0, 0, 0, 5, 0, 95},\n\t{12, 0, 13, 0, 5, 0, 99},\n\t{10, 0, 0, 0, 5, 0, 99},\n\t{7, 0, 0, 0, 5, 0, 99},\n\t{10, 9, 0, 0, 5, 0, 99},\n\t{21, 0, 0, 0, 5, 0, 99},\n\t{13, 0, 0, 0, 5, 0, 99},\n\t{7, 0, 0, 0, 5, 0, 101},\n\t{12, 0, 13, 0, 5, 0, 101},\n\t{10, 0, 0, 0, 5, 0, 101},\n\t{10, 9, 0, 0, 5, 0, 101},\n\t{12, 7, 13, 0, 5, 0, 101},\n\t{13, 0, 0, 0, 5, 0, 101},\n\t{7, 0, 0, 0, 5, 0, 62},\n\t{14, 0, 0, 0, 5, 0, 62},\n\t{21, 0, 0, 0, 5, 0, 62},\n\t{7, 0, 0, 0, 5, 0, 80},\n\t{7, 0, 0, 0, 5, 0, 98},\n\t{10, 0, 0, 0, 5, 0, 98},\n\t{12, 0, 13, 0, 5, 0, 98},\n\t{6, 0, 0, 0, 5, 0, 98},\n\t{10, 216, 0, 0, 5, 0, 0},\n\t{10, 226, 0, 0, 5, 0, 0},\n\t{12, 230, 13, 0, 5, 0, 2},\n\t{25, 0, 0, 0, 5, 0, 0},\n\t{13, 0, 8, 0, 5, 0, 0},\n\t{26, 0, 0, 0, 2, 0, 32},\n};\n\n#define BIDI_MIRROR_LEN 364\nstatic const MirrorPair mirror_pairs[] = {\n\t{40, 41},\n\t{41, 40},\n\t{60, 62},\n\t{62, 60},\n\t{91, 93},\n\t{93, 91},\n\t{123, 125},\n\t{125, 123},\n\t{171, 187},\n\t{187, 171},\n\t{3898, 3899},\n\t{3899, 3898},\n\t{3900, 3901},\n\t{3901, 3900},\n\t{5787, 5788},\n\t{5788, 5787},\n\t{8249, 8250},\n\t{8250, 8249},\n\t{8261, 8262},\n\t{8262, 8261},\n\t{8317, 8318},\n\t{8318, 8317},\n\t{8333, 8334},\n\t{8334, 8333},\n\t{8712, 8715},\n\t{8713, 8716},\n\t{8714, 8717},\n\t{8715, 8712},\n\t{8716, 8713},\n\t{8717, 8714},\n\t{8725, 10741},\n\t{8764, 8765},\n\t{8765, 8764},\n\t{8771, 8909},\n\t{8786, 8787},\n\t{8787, 8786},\n\t{8788, 8789},\n\t{8789, 8788},\n\t{8804, 8805},\n\t{8805, 8804},\n\t{8806, 8807},\n\t{8807, 8806},\n\t{8808, 8809},\n\t{8809, 8808},\n\t{8810, 8811},\n\t{8811, 8810},\n\t{8814, 8815},\n\t{8815, 8814},\n\t{8816, 8817},\n\t{8817, 8816},\n\t{8818, 8819},\n\t{8819, 8818},\n\t{8820, 8821},\n\t{8821, 8820},\n\t{8822, 8823},\n\t{8823, 8822},\n\t{8824, 8825},\n\t{8825, 8824},\n\t{8826, 8827},\n\t{8827, 8826},\n\t{8828, 8829},\n\t{8829, 8828},\n\t{8830, 8831},\n\t{8831, 8830},\n\t{8832, 8833},\n\t{8833, 8832},\n\t{8834, 8835},\n\t{8835, 8834},\n\t{8836, 8837},\n\t{8837, 8836},\n\t{8838, 8839},\n\t{8839, 8838},\n\t{8840, 8841},\n\t{8841, 8840},\n\t{8842, 8843},\n\t{8843, 8842},\n\t{8847, 8848},\n\t{8848, 8847},\n\t{8849, 8850},\n\t{8850, 8849},\n\t{8856, 10680},\n\t{8866, 8867},\n\t{8867, 8866},\n\t{8870, 10974},\n\t{8872, 10980},\n\t{8873, 10979},\n\t{8875, 10981},\n\t{8880, 8881},\n\t{8881, 8880},\n\t{8882, 8883},\n\t{8883, 8882},\n\t{8884, 8885},\n\t{8885, 8884},\n\t{8886, 8887},\n\t{8887, 8886},\n\t{8905, 8906},\n\t{8906, 8905},\n\t{8907, 8908},\n\t{8908, 8907},\n\t{8909, 8771},\n\t{8912, 8913},\n\t{8913, 8912},\n\t{8918, 8919},\n\t{8919, 8918},\n\t{8920, 8921},\n\t{8921, 8920},\n\t{8922, 8923},\n\t{8923, 8922},\n\t{8924, 8925},\n\t{8925, 8924},\n\t{8926, 8927},\n\t{8927, 8926},\n\t{8928, 8929},\n\t{8929, 8928},\n\t{8930, 8931},\n\t{8931, 8930},\n\t{8932, 8933},\n\t{8933, 8932},\n\t{8934, 8935},\n\t{8935, 8934},\n\t{8936, 8937},\n\t{8937, 8936},\n\t{8938, 8939},\n\t{8939, 8938},\n\t{8940, 8941},\n\t{8941, 8940},\n\t{8944, 8945},\n\t{8945, 8944},\n\t{8946, 8954},\n\t{8947, 8955},\n\t{8948, 8956},\n\t{8950, 8957},\n\t{8951, 8958},\n\t{8954, 8946},\n\t{8955, 8947},\n\t{8956, 8948},\n\t{8957, 8950},\n\t{8958, 8951},\n\t{8968, 8969},\n\t{8969, 8968},\n\t{8970, 8971},\n\t{8971, 8970},\n\t{9001, 9002},\n\t{9002, 9001},\n\t{10088, 10089},\n\t{10089, 10088},\n\t{10090, 10091},\n\t{10091, 10090},\n\t{10092, 10093},\n\t{10093, 10092},\n\t{10094, 10095},\n\t{10095, 10094},\n\t{10096, 10097},\n\t{10097, 10096},\n\t{10098, 10099},\n\t{10099, 10098},\n\t{10100, 10101},\n\t{10101, 10100},\n\t{10179, 10180},\n\t{10180, 10179},\n\t{10181, 10182},\n\t{10182, 10181},\n\t{10184, 10185},\n\t{10185, 10184},\n\t{10187, 10189},\n\t{10189, 10187},\n\t{10197, 10198},\n\t{10198, 10197},\n\t{10205, 10206},\n\t{10206, 10205},\n\t{10210, 10211},\n\t{10211, 10210},\n\t{10212, 10213},\n\t{10213, 10212},\n\t{10214, 10215},\n\t{10215, 10214},\n\t{10216, 10217},\n\t{10217, 10216},\n\t{10218, 10219},\n\t{10219, 10218},\n\t{10220, 10221},\n\t{10221, 10220},\n\t{10222, 10223},\n\t{10223, 10222},\n\t{10627, 10628},\n\t{10628, 10627},\n\t{10629, 10630},\n\t{10630, 10629},\n\t{10631, 10632},\n\t{10632, 10631},\n\t{10633, 10634},\n\t{10634, 10633},\n\t{10635, 10636},\n\t{10636, 10635},\n\t{10637, 10640},\n\t{10638, 10639},\n\t{10639, 10638},\n\t{10640, 10637},\n\t{10641, 10642},\n\t{10642, 10641},\n\t{10643, 10644},\n\t{10644, 10643},\n\t{10645, 10646},\n\t{10646, 10645},\n\t{10647, 10648},\n\t{10648, 10647},\n\t{10680, 8856},\n\t{10688, 10689},\n\t{10689, 10688},\n\t{10692, 10693},\n\t{10693, 10692},\n\t{10703, 10704},\n\t{10704, 10703},\n\t{10705, 10706},\n\t{10706, 10705},\n\t{10708, 10709},\n\t{10709, 10708},\n\t{10712, 10713},\n\t{10713, 10712},\n\t{10714, 10715},\n\t{10715, 10714},\n\t{10741, 8725},\n\t{10744, 10745},\n\t{10745, 10744},\n\t{10748, 10749},\n\t{10749, 10748},\n\t{10795, 10796},\n\t{10796, 10795},\n\t{10797, 10798},\n\t{10798, 10797},\n\t{10804, 10805},\n\t{10805, 10804},\n\t{10812, 10813},\n\t{10813, 10812},\n\t{10852, 10853},\n\t{10853, 10852},\n\t{10873, 10874},\n\t{10874, 10873},\n\t{10877, 10878},\n\t{10878, 10877},\n\t{10879, 10880},\n\t{10880, 10879},\n\t{10881, 10882},\n\t{10882, 10881},\n\t{10883, 10884},\n\t{10884, 10883},\n\t{10891, 10892},\n\t{10892, 10891},\n\t{10897, 10898},\n\t{10898, 10897},\n\t{10899, 10900},\n\t{10900, 10899},\n\t{10901, 10902},\n\t{10902, 10901},\n\t{10903, 10904},\n\t{10904, 10903},\n\t{10905, 10906},\n\t{10906, 10905},\n\t{10907, 10908},\n\t{10908, 10907},\n\t{10913, 10914},\n\t{10914, 10913},\n\t{10918, 10919},\n\t{10919, 10918},\n\t{10920, 10921},\n\t{10921, 10920},\n\t{10922, 10923},\n\t{10923, 10922},\n\t{10924, 10925},\n\t{10925, 10924},\n\t{10927, 10928},\n\t{10928, 10927},\n\t{10931, 10932},\n\t{10932, 10931},\n\t{10939, 10940},\n\t{10940, 10939},\n\t{10941, 10942},\n\t{10942, 10941},\n\t{10943, 10944},\n\t{10944, 10943},\n\t{10945, 10946},\n\t{10946, 10945},\n\t{10947, 10948},\n\t{10948, 10947},\n\t{10949, 10950},\n\t{10950, 10949},\n\t{10957, 10958},\n\t{10958, 10957},\n\t{10959, 10960},\n\t{10960, 10959},\n\t{10961, 10962},\n\t{10962, 10961},\n\t{10963, 10964},\n\t{10964, 10963},\n\t{10965, 10966},\n\t{10966, 10965},\n\t{10974, 8870},\n\t{10979, 8873},\n\t{10980, 8872},\n\t{10981, 8875},\n\t{10988, 10989},\n\t{10989, 10988},\n\t{10999, 11000},\n\t{11000, 10999},\n\t{11001, 11002},\n\t{11002, 11001},\n\t{11778, 11779},\n\t{11779, 11778},\n\t{11780, 11781},\n\t{11781, 11780},\n\t{11785, 11786},\n\t{11786, 11785},\n\t{11788, 11789},\n\t{11789, 11788},\n\t{11804, 11805},\n\t{11805, 11804},\n\t{11808, 11809},\n\t{11809, 11808},\n\t{11810, 11811},\n\t{11811, 11810},\n\t{11812, 11813},\n\t{11813, 11812},\n\t{11814, 11815},\n\t{11815, 11814},\n\t{11816, 11817},\n\t{11817, 11816},\n\t{12296, 12297},\n\t{12297, 12296},\n\t{12298, 12299},\n\t{12299, 12298},\n\t{12300, 12301},\n\t{12301, 12300},\n\t{12302, 12303},\n\t{12303, 12302},\n\t{12304, 12305},\n\t{12305, 12304},\n\t{12308, 12309},\n\t{12309, 12308},\n\t{12310, 12311},\n\t{12311, 12310},\n\t{12312, 12313},\n\t{12313, 12312},\n\t{12314, 12315},\n\t{12315, 12314},\n\t{65113, 65114},\n\t{65114, 65113},\n\t{65115, 65116},\n\t{65116, 65115},\n\t{65117, 65118},\n\t{65118, 65117},\n\t{65124, 65125},\n\t{65125, 65124},\n\t{65288, 65289},\n\t{65289, 65288},\n\t{65308, 65310},\n\t{65310, 65308},\n\t{65339, 65341},\n\t{65341, 65339},\n\t{65371, 65373},\n\t{65373, 65371},\n\t{65375, 65376},\n\t{65376, 65375},\n\t{65378, 65379},\n\t{65379, 65378},\n};\n\n/* Reindexing of NFC first characters. */\n#define TOTAL_FIRST 372\n#define TOTAL_LAST 56\nstatic const Reindex nfc_first[] = {\n\t{ 60, 2, 0},\n\t{ 65, 15, 3},\n\t{ 82, 8, 19},\n\t{ 97, 15, 28},\n\t{ 114, 8, 44},\n\t{ 168, 0, 53},\n\t{ 194, 0, 54},\n\t{ 196, 3, 55},\n\t{ 202, 0, 59},\n\t{ 207, 0, 60},\n\t{ 212, 2, 61},\n\t{ 216, 0, 64},\n\t{ 220, 0, 65},\n\t{ 226, 0, 66},\n\t{ 228, 3, 67},\n\t{ 234, 0, 71},\n\t{ 239, 0, 72},\n\t{ 244, 2, 73},\n\t{ 248, 0, 76},\n\t{ 252, 0, 77},\n\t{ 258, 1, 78},\n\t{ 274, 1, 80},\n\t{ 332, 1, 82},\n\t{ 346, 1, 84},\n\t{ 352, 1, 86},\n\t{ 360, 3, 88},\n\t{ 383, 0, 92},\n\t{ 416, 1, 93},\n\t{ 431, 1, 95},\n\t{ 439, 0, 97},\n\t{ 490, 1, 98},\n\t{ 550, 3, 100},\n\t{ 558, 1, 104},\n\t{ 658, 0, 106},\n\t{ 913, 0, 107},\n\t{ 917, 0, 108},\n\t{ 919, 0, 109},\n\t{ 921, 0, 110},\n\t{ 927, 0, 111},\n\t{ 929, 0, 112},\n\t{ 933, 0, 113},\n\t{ 937, 0, 114},\n\t{ 940, 0, 115},\n\t{ 942, 0, 116},\n\t{ 945, 0, 117},\n\t{ 949, 0, 118},\n\t{ 951, 0, 119},\n\t{ 953, 0, 120},\n\t{ 959, 0, 121},\n\t{ 961, 0, 122},\n\t{ 965, 0, 123},\n\t{ 969, 2, 124},\n\t{ 974, 0, 127},\n\t{ 978, 0, 128},\n\t{ 1030, 0, 129},\n\t{ 1040, 0, 130},\n\t{ 1043, 0, 131},\n\t{ 1045, 3, 132},\n\t{ 1050, 0, 136},\n\t{ 1054, 0, 137},\n\t{ 1059, 0, 138},\n\t{ 1063, 0, 139},\n\t{ 1067, 0, 140},\n\t{ 1069, 0, 141},\n\t{ 1072, 0, 142},\n\t{ 1075, 0, 143},\n\t{ 1077, 3, 144},\n\t{ 1082, 0, 148},\n\t{ 1086, 0, 149},\n\t{ 1091, 0, 150},\n\t{ 1095, 0, 151},\n\t{ 1099, 0, 152},\n\t{ 1101, 0, 153},\n\t{ 1110, 0, 154},\n\t{ 1140, 1, 155},\n\t{ 1240, 1, 157},\n\t{ 1256, 1, 159},\n\t{ 1575, 0, 161},\n\t{ 1608, 0, 162},\n\t{ 1610, 0, 163},\n\t{ 1729, 0, 164},\n\t{ 1746, 0, 165},\n\t{ 1749, 0, 166},\n\t{ 2344, 0, 167},\n\t{ 2352, 0, 168},\n\t{ 2355, 0, 169},\n\t{ 2503, 0, 170},\n\t{ 2887, 0, 171},\n\t{ 2962, 0, 172},\n\t{ 3014, 1, 173},\n\t{ 3142, 0, 175},\n\t{ 3263, 0, 176},\n\t{ 3270, 0, 177},\n\t{ 3274, 0, 178},\n\t{ 3398, 1, 179},\n\t{ 3545, 0, 181},\n\t{ 3548, 0, 182},\n\t{ 4133, 0, 183},\n\t{ 6917, 0, 184},\n\t{ 6919, 0, 185},\n\t{ 6921, 0, 186},\n\t{ 6923, 0, 187},\n\t{ 6925, 0, 188},\n\t{ 6929, 0, 189},\n\t{ 6970, 0, 190},\n\t{ 6972, 0, 191},\n\t{ 6974, 1, 192},\n\t{ 6978, 0, 194},\n\t{ 7734, 1, 195},\n\t{ 7770, 1, 197},\n\t{ 7778, 1, 199},\n\t{ 7840, 1, 201},\n\t{ 7864, 1, 203},\n\t{ 7884, 1, 205},\n\t{ 7936, 17, 207},\n\t{ 7960, 1, 225},\n\t{ 7968, 17, 227},\n\t{ 7992, 1, 245},\n\t{ 8000, 1, 247},\n\t{ 8008, 1, 249},\n\t{ 8016, 1, 251},\n\t{ 8025, 0, 253},\n\t{ 8032, 16, 254},\n\t{ 8052, 0, 271},\n\t{ 8060, 0, 272},\n\t{ 8118, 0, 273},\n\t{ 8127, 0, 274},\n\t{ 8134, 0, 275},\n\t{ 8182, 0, 276},\n\t{ 8190, 0, 277},\n\t{ 8592, 0, 278},\n\t{ 8594, 0, 279},\n\t{ 8596, 0, 280},\n\t{ 8656, 0, 281},\n\t{ 8658, 0, 282},\n\t{ 8660, 0, 283},\n\t{ 8707, 0, 284},\n\t{ 8712, 0, 285},\n\t{ 8715, 0, 286},\n\t{ 8739, 0, 287},\n\t{ 8741, 0, 288},\n\t{ 8764, 0, 289},\n\t{ 8771, 0, 290},\n\t{ 8773, 0, 291},\n\t{ 8776, 0, 292},\n\t{ 8781, 0, 293},\n\t{ 8801, 0, 294},\n\t{ 8804, 1, 295},\n\t{ 8818, 1, 297},\n\t{ 8822, 1, 299},\n\t{ 8826, 3, 301},\n\t{ 8834, 1, 305},\n\t{ 8838, 1, 307},\n\t{ 8849, 1, 309},\n\t{ 8866, 0, 311},\n\t{ 8872, 1, 312},\n\t{ 8875, 0, 314},\n\t{ 8882, 3, 315},\n\t{ 12358, 0, 319},\n\t{ 12363, 0, 320},\n\t{ 12365, 0, 321},\n\t{ 12367, 0, 322},\n\t{ 12369, 0, 323},\n\t{ 12371, 0, 324},\n\t{ 12373, 0, 325},\n\t{ 12375, 0, 326},\n\t{ 12377, 0, 327},\n\t{ 12379, 0, 328},\n\t{ 12381, 0, 329},\n\t{ 12383, 0, 330},\n\t{ 12385, 0, 331},\n\t{ 12388, 0, 332},\n\t{ 12390, 0, 333},\n\t{ 12392, 0, 334},\n\t{ 12399, 0, 335},\n\t{ 12402, 0, 336},\n\t{ 12405, 0, 337},\n\t{ 12408, 0, 338},\n\t{ 12411, 0, 339},\n\t{ 12445, 0, 340},\n\t{ 12454, 0, 341},\n\t{ 12459, 0, 342},\n\t{ 12461, 0, 343},\n\t{ 12463, 0, 344},\n\t{ 12465, 0, 345},\n\t{ 12467, 0, 346},\n\t{ 12469, 0, 347},\n\t{ 12471, 0, 348},\n\t{ 12473, 0, 349},\n\t{ 12475, 0, 350},\n\t{ 12477, 0, 351},\n\t{ 12479, 0, 352},\n\t{ 12481, 0, 353},\n\t{ 12484, 0, 354},\n\t{ 12486, 0, 355},\n\t{ 12488, 0, 356},\n\t{ 12495, 0, 357},\n\t{ 12498, 0, 358},\n\t{ 12501, 0, 359},\n\t{ 12504, 0, 360},\n\t{ 12507, 0, 361},\n\t{ 12527, 3, 362},\n\t{ 12541, 0, 366},\n\t{ 69785, 0, 367},\n\t{ 69787, 0, 368},\n\t{ 69797, 0, 369},\n\t{ 69937, 1, 370},\n\t{0,0,0}\n};\n\nstatic const Reindex nfc_last[] = {\n\t{ 768, 4, 0},\n\t{ 774, 6, 5},\n\t{ 783, 0, 12},\n\t{ 785, 0, 13},\n\t{ 787, 1, 14},\n\t{ 795, 0, 16},\n\t{ 803, 5, 17},\n\t{ 813, 1, 23},\n\t{ 816, 1, 25},\n\t{ 824, 0, 27},\n\t{ 834, 0, 28},\n\t{ 837, 0, 29},\n\t{ 1619, 2, 30},\n\t{ 2364, 0, 33},\n\t{ 2494, 0, 34},\n\t{ 2519, 0, 35},\n\t{ 2878, 0, 36},\n\t{ 2902, 1, 37},\n\t{ 3006, 0, 39},\n\t{ 3031, 0, 40},\n\t{ 3158, 0, 41},\n\t{ 3266, 0, 42},\n\t{ 3285, 1, 43},\n\t{ 3390, 0, 45},\n\t{ 3415, 0, 46},\n\t{ 3530, 0, 47},\n\t{ 3535, 0, 48},\n\t{ 3551, 0, 49},\n\t{ 4142, 0, 50},\n\t{ 6965, 0, 51},\n\t{ 12441, 1, 52},\n\t{ 69818, 0, 54},\n\t{ 69927, 0, 55},\n\t{0,0,0}\n};\n\n#define UCDN_EAST_ASIAN_F 0\n#define UCDN_EAST_ASIAN_H 1\n#define UCDN_EAST_ASIAN_W 2\n#define UCDN_EAST_ASIAN_NA 3\n#define UCDN_EAST_ASIAN_A 4\n#define UCDN_EAST_ASIAN_N 5\n\n#define UCDN_SCRIPT_COMMON 0\n#define UCDN_SCRIPT_LATIN 1\n#define UCDN_SCRIPT_GREEK 2\n#define UCDN_SCRIPT_CYRILLIC 3\n#define UCDN_SCRIPT_ARMENIAN 4\n#define UCDN_SCRIPT_HEBREW 5\n#define UCDN_SCRIPT_ARABIC 6\n#define UCDN_SCRIPT_SYRIAC 7\n#define UCDN_SCRIPT_THAANA 8\n#define UCDN_SCRIPT_DEVANAGARI 9\n#define UCDN_SCRIPT_BENGALI 10\n#define UCDN_SCRIPT_GURMUKHI 11\n#define UCDN_SCRIPT_GUJARATI 12\n#define UCDN_SCRIPT_ORIYA 13\n#define UCDN_SCRIPT_TAMIL 14\n#define UCDN_SCRIPT_TELUGU 15\n#define UCDN_SCRIPT_KANNADA 16\n#define UCDN_SCRIPT_MALAYALAM 17\n#define UCDN_SCRIPT_SINHALA 18\n#define UCDN_SCRIPT_THAI 19\n#define UCDN_SCRIPT_LAO 20\n#define UCDN_SCRIPT_TIBETAN 21\n#define UCDN_SCRIPT_MYANMAR 22\n#define UCDN_SCRIPT_GEORGIAN 23\n#define UCDN_SCRIPT_HANGUL 24\n#define UCDN_SCRIPT_ETHIOPIC 25\n#define UCDN_SCRIPT_CHEROKEE 26\n#define UCDN_SCRIPT_CANADIAN_ABORIGINAL 27\n#define UCDN_SCRIPT_OGHAM 28\n#define UCDN_SCRIPT_RUNIC 29\n#define UCDN_SCRIPT_KHMER 30\n#define UCDN_SCRIPT_MONGOLIAN 31\n#define UCDN_SCRIPT_HIRAGANA 32\n#define UCDN_SCRIPT_KATAKANA 33\n#define UCDN_SCRIPT_BOPOMOFO 34\n#define UCDN_SCRIPT_HAN 35\n#define UCDN_SCRIPT_YI 36\n#define UCDN_SCRIPT_OLD_ITALIC 37\n#define UCDN_SCRIPT_GOTHIC 38\n#define UCDN_SCRIPT_DESERET 39\n#define UCDN_SCRIPT_INHERITED 40\n#define UCDN_SCRIPT_TAGALOG 41\n#define UCDN_SCRIPT_HANUNOO 42\n#define UCDN_SCRIPT_BUHID 43\n#define UCDN_SCRIPT_TAGBANWA 44\n#define UCDN_SCRIPT_LIMBU 45\n#define UCDN_SCRIPT_TAI_LE 46\n#define UCDN_SCRIPT_LINEAR_B 47\n#define UCDN_SCRIPT_UGARITIC 48\n#define UCDN_SCRIPT_SHAVIAN 49\n#define UCDN_SCRIPT_OSMANYA 50\n#define UCDN_SCRIPT_CYPRIOT 51\n#define UCDN_SCRIPT_BRAILLE 52\n#define UCDN_SCRIPT_BUGINESE 53\n#define UCDN_SCRIPT_COPTIC 54\n#define UCDN_SCRIPT_NEW_TAI_LUE 55\n#define UCDN_SCRIPT_GLAGOLITIC 56\n#define UCDN_SCRIPT_TIFINAGH 57\n#define UCDN_SCRIPT_SYLOTI_NAGRI 58\n#define UCDN_SCRIPT_OLD_PERSIAN 59\n#define UCDN_SCRIPT_KHAROSHTHI 60\n#define UCDN_SCRIPT_BALINESE 61\n#define UCDN_SCRIPT_CUNEIFORM 62\n#define UCDN_SCRIPT_PHOENICIAN 63\n#define UCDN_SCRIPT_PHAGS_PA 64\n#define UCDN_SCRIPT_NKO 65\n#define UCDN_SCRIPT_SUNDANESE 66\n#define UCDN_SCRIPT_LEPCHA 67\n#define UCDN_SCRIPT_OL_CHIKI 68\n#define UCDN_SCRIPT_VAI 69\n#define UCDN_SCRIPT_SAURASHTRA 70\n#define UCDN_SCRIPT_KAYAH_LI 71\n#define UCDN_SCRIPT_REJANG 72\n#define UCDN_SCRIPT_LYCIAN 73\n#define UCDN_SCRIPT_CARIAN 74\n#define UCDN_SCRIPT_LYDIAN 75\n#define UCDN_SCRIPT_CHAM 76\n#define UCDN_SCRIPT_TAI_THAM 77\n#define UCDN_SCRIPT_TAI_VIET 78\n#define UCDN_SCRIPT_AVESTAN 79\n#define UCDN_SCRIPT_EGYPTIAN_HIEROGLYPHS 80\n#define UCDN_SCRIPT_SAMARITAN 81\n#define UCDN_SCRIPT_LISU 82\n#define UCDN_SCRIPT_BAMUM 83\n#define UCDN_SCRIPT_JAVANESE 84\n#define UCDN_SCRIPT_MEETEI_MAYEK 85\n#define UCDN_SCRIPT_IMPERIAL_ARAMAIC 86\n#define UCDN_SCRIPT_OLD_SOUTH_ARABIAN 87\n#define UCDN_SCRIPT_INSCRIPTIONAL_PARTHIAN 88\n#define UCDN_SCRIPT_INSCRIPTIONAL_PAHLAVI 89\n#define UCDN_SCRIPT_OLD_TURKIC 90\n#define UCDN_SCRIPT_KAITHI 91\n#define UCDN_SCRIPT_BATAK 92\n#define UCDN_SCRIPT_BRAHMI 93\n#define UCDN_SCRIPT_MANDAIC 94\n#define UCDN_SCRIPT_CHAKMA 95\n#define UCDN_SCRIPT_MEROITIC_CURSIVE 96\n#define UCDN_SCRIPT_MEROITIC_HIEROGLYPHS 97\n#define UCDN_SCRIPT_MIAO 98\n#define UCDN_SCRIPT_SHARADA 99\n#define UCDN_SCRIPT_SORA_SOMPENG 100\n#define UCDN_SCRIPT_TAKRI 101\n#define UCDN_SCRIPT_UNKNOWN 102\n\n#define UCDN_GENERAL_CATEGORY_CC 0\n#define UCDN_GENERAL_CATEGORY_CF 1\n#define UCDN_GENERAL_CATEGORY_CN 2\n#define UCDN_GENERAL_CATEGORY_CO 3\n#define UCDN_GENERAL_CATEGORY_CS 4\n#define UCDN_GENERAL_CATEGORY_LL 5\n#define UCDN_GENERAL_CATEGORY_LM 6\n#define UCDN_GENERAL_CATEGORY_LO 7\n#define UCDN_GENERAL_CATEGORY_LT 8\n#define UCDN_GENERAL_CATEGORY_LU 9\n#define UCDN_GENERAL_CATEGORY_MC 10\n#define UCDN_GENERAL_CATEGORY_ME 11\n#define UCDN_GENERAL_CATEGORY_MN 12\n#define UCDN_GENERAL_CATEGORY_ND 13\n#define UCDN_GENERAL_CATEGORY_NL 14\n#define UCDN_GENERAL_CATEGORY_NO 15\n#define UCDN_GENERAL_CATEGORY_PC 16\n#define UCDN_GENERAL_CATEGORY_PD 17\n#define UCDN_GENERAL_CATEGORY_PE 18\n#define UCDN_GENERAL_CATEGORY_PF 19\n#define UCDN_GENERAL_CATEGORY_PI 20\n#define UCDN_GENERAL_CATEGORY_PO 21\n#define UCDN_GENERAL_CATEGORY_PS 22\n#define UCDN_GENERAL_CATEGORY_SC 23\n#define UCDN_GENERAL_CATEGORY_SK 24\n#define UCDN_GENERAL_CATEGORY_SM 25\n#define UCDN_GENERAL_CATEGORY_SO 26\n#define UCDN_GENERAL_CATEGORY_ZL 27\n#define UCDN_GENERAL_CATEGORY_ZP 28\n#define UCDN_GENERAL_CATEGORY_ZS 29\n\n#define UCDN_BIDI_CLASS_L 0\n#define UCDN_BIDI_CLASS_LRE 1\n#define UCDN_BIDI_CLASS_LRO 2\n#define UCDN_BIDI_CLASS_R 3\n#define UCDN_BIDI_CLASS_AL 4\n#define UCDN_BIDI_CLASS_RLE 5\n#define UCDN_BIDI_CLASS_RLO 6\n#define UCDN_BIDI_CLASS_PDF 7\n#define UCDN_BIDI_CLASS_EN 8\n#define UCDN_BIDI_CLASS_ES 9\n#define UCDN_BIDI_CLASS_ET 10\n#define UCDN_BIDI_CLASS_AN 11\n#define UCDN_BIDI_CLASS_CS 12\n#define UCDN_BIDI_CLASS_NSM 13\n#define UCDN_BIDI_CLASS_BN 14\n#define UCDN_BIDI_CLASS_B 15\n#define UCDN_BIDI_CLASS_S 16\n#define UCDN_BIDI_CLASS_WS 17\n#define UCDN_BIDI_CLASS_ON 18\n\n/* index tables for the database records */\n#define SHIFT1 5\n#define SHIFT2 3\nstatic const unsigned char index0[] = {\n\t0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n\t21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,\n\t39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 53, 53, 53,\n\t53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,\n\t53, 53, 54, 52, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,\n\t53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,\n\t53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,\n\t53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,\n\t53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 55, 56, 57, 57, 57, 58,\n\t59, 60, 61, 62, 63, 64, 65, 66, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67,\n\t67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67,\n\t67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 68, 69, 70, 70,\n\t71, 69, 70, 70, 72, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 75, 76, 77, 78, 79, 80, 81,\n\t82, 83, 84, 85, 86, 87, 70, 70, 70, 88, 89, 90, 91, 92, 70, 93, 70, 94,\n\t95, 70, 70, 70, 70, 96, 70, 70, 70, 70, 70, 70, 70, 70, 70, 97, 97, 97,\n\t98, 99, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 100, 100, 100, 100,\n\t101, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 102, 102,\n\t103, 70, 70, 70, 70, 104, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 105, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 106, 107, 108, 109, 110,\n\t111, 112, 113, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 114, 70, 115, 116, 117, 118, 119, 120,\n\t121, 122, 70, 70, 70, 70, 70, 70, 70, 70, 52, 53, 53, 53, 53, 53, 53, 53,\n\t53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,\n\t53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,\n\t53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,\n\t53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,\n\t53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,\n\t53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,\n\t53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,\n\t53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,\n\t53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 123, 52, 53, 53,\n\t53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 124, 125, 126, 126,\n\t126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,\n\t126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,\n\t126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,\n\t126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,\n\t126, 126, 126, 126, 126, 76, 76, 127, 126, 126, 126, 126, 128, 126, 126,\n\t126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,\n\t126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,\n\t126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,\n\t126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,\n\t126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,\n\t126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,\n\t126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,\n\t126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,\n\t126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,\n\t126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,\n\t126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,\n\t126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,\n\t126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,\n\t126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,\n\t126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,\n\t126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,\n\t126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,\n\t126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,\n\t126, 128, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 129, 130, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,\n\t70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 73, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 131, 73, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,\n\t74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 131,\n};\n\nstatic const unsigned short index1[] = {\n\t0, 1, 0, 2, 3, 4, 5, 6, 7, 8, 8, 9, 10, 11, 11, 12, 13, 0, 0, 0, 14, 15,\n\t16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 29, 31, 32,\n\t33, 34, 35, 27, 30, 29, 27, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,\n\t47, 48, 27, 27, 49, 27, 27, 27, 27, 27, 27, 27, 50, 51, 52, 27, 53, 54,\n\t53, 54, 54, 54, 54, 54, 55, 54, 54, 54, 56, 57, 58, 59, 60, 61, 62, 63,\n\t64, 64, 65, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 65, 77, 78,\n\t79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,\n\t97, 97, 97, 97, 98, 98, 98, 98, 99, 100, 101, 101, 101, 101, 102, 103,\n\t101, 101, 101, 101, 101, 101, 104, 105, 101, 101, 101, 101, 101, 101,\n\t101, 101, 101, 101, 101, 106, 107, 108, 108, 108, 109, 110, 111, 112,\n\t112, 112, 112, 113, 114, 115, 116, 117, 118, 119, 120, 106, 121, 121,\n\t121, 122, 123, 106, 124, 125, 126, 127, 128, 128, 128, 128, 129, 130,\n\t131, 132, 133, 134, 135, 128, 128, 128, 128, 128, 128, 128, 128, 128,\n\t128, 128, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 145, 145,\n\t146, 147, 148, 149, 128, 128, 128, 128, 128, 128, 150, 150, 150, 150,\n\t151, 152, 153, 106, 154, 155, 156, 156, 156, 157, 158, 159, 160, 160,\n\t161, 162, 163, 164, 165, 166, 167, 167, 167, 168, 106, 106, 106, 106,\n\t106, 106, 106, 106, 169, 170, 106, 106, 106, 106, 106, 106, 171, 172,\n\t173, 174, 175, 176, 176, 176, 176, 176, 176, 177, 178, 179, 180, 176,\n\t181, 182, 183, 184, 185, 186, 187, 188, 188, 189, 190, 191, 192, 193,\n\t194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 203, 204, 205, 206,\n\t207, 208, 209, 210, 211, 212, 213, 106, 214, 215, 216, 217, 217, 218,\n\t219, 220, 221, 222, 223, 106, 224, 225, 226, 106, 227, 228, 229, 230,\n\t230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 106, 241, 242,\n\t243, 244, 245, 242, 246, 247, 248, 249, 250, 106, 251, 252, 253, 254,\n\t255, 256, 257, 258, 258, 257, 259, 260, 261, 262, 263, 264, 265, 266,\n\t106, 267, 268, 269, 270, 271, 271, 270, 272, 273, 274, 275, 276, 277,\n\t278, 279, 280, 106, 281, 282, 283, 284, 284, 284, 284, 285, 286, 287,\n\t288, 106, 289, 290, 291, 292, 293, 294, 295, 296, 294, 294, 297, 298,\n\t295, 299, 300, 301, 106, 106, 302, 106, 303, 304, 304, 304, 304, 304,\n\t305, 306, 307, 308, 309, 310, 106, 106, 106, 106, 311, 312, 313, 314,\n\t315, 316, 317, 318, 319, 320, 321, 322, 106, 106, 106, 106, 323, 324,\n\t325, 326, 327, 328, 329, 330, 331, 332, 331, 331, 331, 333, 334, 335,\n\t336, 337, 338, 339, 338, 338, 338, 340, 341, 342, 343, 344, 106, 106,\n\t106, 106, 345, 345, 345, 345, 345, 346, 347, 348, 349, 350, 351, 352,\n\t353, 354, 355, 345, 356, 357, 349, 358, 359, 359, 359, 359, 360, 361,\n\t362, 362, 362, 362, 362, 363, 364, 364, 364, 364, 364, 364, 364, 364,\n\t364, 364, 364, 364, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365,\n\t365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 366, 366, 366, 366,\n\t366, 366, 366, 366, 366, 367, 368, 367, 366, 366, 366, 366, 366, 367,\n\t366, 366, 366, 366, 367, 368, 367, 366, 368, 366, 366, 366, 366, 366,\n\t366, 366, 367, 366, 366, 366, 366, 366, 366, 366, 366, 369, 370, 371,\n\t372, 373, 366, 366, 374, 375, 376, 376, 376, 376, 376, 376, 376, 376,\n\t376, 376, 377, 106, 378, 379, 379, 379, 379, 379, 379, 379, 379, 379,\n\t379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,\n\t379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,\n\t379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,\n\t379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379,\n\t379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 379, 380, 379, 379,\n\t381, 382, 382, 383, 384, 384, 384, 384, 384, 384, 384, 384, 384, 385,\n\t386, 106, 387, 388, 389, 106, 390, 390, 391, 106, 392, 392, 393, 106,\n\t394, 395, 396, 106, 397, 397, 397, 397, 397, 397, 398, 399, 400, 401,\n\t402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 412, 412, 412,\n\t413, 412, 412, 412, 412, 412, 412, 106, 412, 412, 412, 412, 412, 414,\n\t379, 379, 379, 379, 379, 379, 379, 379, 415, 106, 416, 416, 416, 417,\n\t418, 419, 420, 421, 422, 423, 424, 424, 424, 425, 426, 106, 427, 427,\n\t427, 427, 427, 428, 429, 429, 430, 431, 432, 433, 434, 434, 434, 434,\n\t435, 435, 436, 437, 438, 438, 438, 438, 438, 438, 439, 440, 441, 442,\n\t443, 444, 445, 446, 445, 446, 447, 448, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 449, 450, 450, 450, 450, 450, 451, 452, 453, 454,\n\t455, 456, 457, 458, 459, 460, 461, 462, 462, 462, 463, 464, 465, 466,\n\t467, 467, 467, 467, 468, 469, 470, 471, 472, 472, 472, 472, 473, 474,\n\t475, 476, 477, 478, 479, 480, 481, 481, 481, 482, 106, 106, 106, 106,\n\t106, 106, 106, 106, 483, 106, 484, 485, 486, 487, 488, 106, 54, 54, 54,\n\t54, 489, 490, 56, 56, 56, 56, 56, 491, 492, 493, 54, 494, 54, 54, 54,\n\t495, 56, 56, 56, 496, 497, 498, 499, 500, 501, 106, 106, 502, 27, 27, 27,\n\t27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 503, 504, 27,\n\t27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 505, 506, 507, 508, 505, 506,\n\t505, 506, 507, 508, 505, 509, 505, 506, 505, 507, 505, 510, 505, 510,\n\t505, 510, 511, 512, 513, 514, 515, 516, 505, 517, 518, 519, 520, 521,\n\t522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535,\n\t536, 537, 56, 538, 539, 540, 539, 541, 106, 106, 542, 543, 544, 545, 546,\n\t106, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559,\n\t560, 559, 561, 562, 563, 564, 565, 566, 567, 568, 569, 568, 570, 571,\n\t568, 572, 568, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583,\n\t584, 585, 586, 587, 588, 583, 583, 589, 590, 591, 592, 593, 583, 583,\n\t594, 574, 595, 596, 583, 583, 597, 583, 583, 568, 598, 599, 568, 600,\n\t601, 602, 603, 603, 603, 603, 603, 603, 603, 603, 604, 568, 568, 605,\n\t606, 574, 574, 607, 568, 568, 568, 568, 573, 608, 568, 609, 106, 568,\n\t568, 568, 568, 610, 106, 106, 106, 568, 611, 106, 106, 612, 612, 612,\n\t612, 612, 613, 613, 614, 615, 615, 615, 615, 615, 615, 615, 615, 615,\n\t616, 612, 612, 617, 617, 617, 617, 617, 617, 617, 617, 617, 618, 617,\n\t617, 617, 617, 618, 568, 617, 617, 619, 568, 620, 569, 621, 622, 623,\n\t624, 569, 568, 619, 572, 568, 574, 625, 626, 622, 627, 568, 568, 568,\n\t568, 628, 568, 568, 568, 629, 630, 568, 568, 568, 568, 568, 631, 568,\n\t632, 568, 631, 633, 634, 617, 617, 635, 617, 617, 617, 636, 568, 568,\n\t568, 568, 568, 568, 637, 568, 568, 572, 568, 568, 638, 639, 612, 640,\n\t640, 641, 568, 568, 568, 568, 568, 642, 643, 644, 645, 646, 647, 574,\n\t574, 648, 648, 648, 648, 648, 648, 648, 648, 648, 648, 648, 648, 648,\n\t648, 648, 648, 648, 648, 648, 648, 648, 648, 648, 648, 648, 648, 648,\n\t648, 648, 648, 648, 648, 574, 574, 574, 574, 574, 574, 574, 574, 574,\n\t574, 574, 574, 574, 574, 574, 574, 649, 650, 650, 651, 583, 583, 574,\n\t652, 597, 653, 654, 655, 656, 657, 658, 659, 574, 660, 583, 661, 662,\n\t663, 664, 645, 574, 574, 586, 652, 664, 665, 666, 667, 583, 583, 583,\n\t583, 668, 669, 583, 583, 583, 583, 670, 671, 672, 645, 673, 674, 568,\n\t568, 568, 568, 568, 568, 574, 574, 675, 676, 677, 678, 106, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 679, 679, 679, 679, 679, 680, 681, 681, 681, 681, 681,\n\t682, 683, 684, 685, 686, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,\n\t687, 688, 689, 690, 691, 691, 691, 691, 692, 693, 694, 694, 694, 694,\n\t694, 694, 694, 695, 696, 697, 366, 366, 368, 106, 368, 368, 368, 368,\n\t368, 368, 368, 368, 698, 698, 698, 698, 699, 700, 701, 702, 703, 704,\n\t529, 705, 106, 106, 106, 106, 106, 106, 106, 106, 706, 706, 706, 707,\n\t706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 708, 106, 706, 706,\n\t706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 706,\n\t706, 706, 706, 706, 706, 706, 706, 706, 706, 706, 709, 106, 106, 106,\n\t710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 721, 721,\n\t721, 721, 721, 721, 721, 721, 722, 723, 724, 725, 725, 725, 725, 725,\n\t725, 725, 725, 725, 725, 726, 727, 728, 728, 728, 728, 729, 730, 364,\n\t364, 364, 364, 364, 364, 364, 364, 364, 364, 731, 732, 733, 728, 728,\n\t728, 734, 710, 710, 710, 710, 711, 106, 725, 725, 735, 735, 735, 736,\n\t737, 738, 733, 733, 733, 739, 740, 741, 735, 735, 735, 742, 737, 738,\n\t733, 733, 733, 733, 743, 741, 733, 744, 745, 745, 745, 745, 745, 746,\n\t745, 745, 745, 745, 745, 745, 745, 745, 745, 745, 745, 733, 733, 733,\n\t747, 748, 733, 733, 733, 733, 733, 733, 733, 733, 733, 733, 733, 749,\n\t733, 733, 733, 747, 750, 751, 751, 751, 751, 751, 751, 751, 751, 751,\n\t751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751,\n\t751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751,\n\t751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751,\n\t751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751,\n\t751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751,\n\t751, 751, 751, 751, 751, 751, 752, 753, 568, 568, 568, 568, 568, 568,\n\t568, 568, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751,\n\t751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 754,\n\t753, 753, 753, 753, 753, 753, 755, 755, 756, 755, 755, 755, 755, 755,\n\t755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755,\n\t755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755,\n\t755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755,\n\t755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755,\n\t755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755,\n\t755, 755, 755, 757, 758, 758, 758, 758, 758, 758, 759, 106, 760, 760,\n\t760, 760, 760, 761, 762, 762, 762, 762, 762, 762, 762, 762, 762, 762,\n\t762, 762, 762, 762, 762, 762, 762, 762, 762, 762, 762, 762, 762, 762,\n\t762, 762, 762, 762, 762, 762, 762, 762, 762, 763, 762, 762, 764, 765,\n\t106, 106, 101, 101, 101, 101, 101, 766, 767, 768, 101, 101, 101, 769,\n\t770, 770, 770, 770, 770, 770, 770, 770, 771, 772, 773, 106, 64, 64, 774,\n\t775, 776, 27, 777, 27, 27, 27, 27, 27, 27, 27, 778, 779, 27, 780, 781,\n\t106, 27, 782, 106, 106, 106, 106, 106, 106, 106, 106, 106, 783, 784, 785,\n\t786, 786, 787, 788, 789, 790, 791, 791, 791, 791, 791, 791, 792, 106,\n\t793, 794, 794, 794, 794, 794, 795, 796, 797, 798, 799, 800, 801, 801,\n\t802, 803, 804, 805, 806, 806, 807, 808, 809, 809, 810, 811, 812, 813,\n\t364, 364, 364, 814, 815, 816, 816, 816, 816, 816, 817, 818, 819, 820,\n\t821, 822, 106, 106, 106, 106, 823, 823, 823, 823, 823, 824, 825, 106,\n\t826, 827, 828, 829, 345, 345, 830, 831, 832, 832, 832, 832, 832, 832,\n\t833, 834, 835, 106, 106, 836, 837, 838, 839, 106, 840, 840, 840, 106,\n\t368, 368, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 106, 837, 837, 837, 837, 841, 842, 843, 844,\n\t845, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846,\n\t846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846,\n\t846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846,\n\t846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846,\n\t846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846,\n\t846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846,\n\t847, 106, 365, 365, 848, 849, 365, 365, 365, 365, 365, 850, 851, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 852, 851, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 852, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 852,\n\t853, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854,\n\t854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854,\n\t854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854,\n\t854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854,\n\t854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854,\n\t854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854,\n\t854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 855, 856, 856,\n\t856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856,\n\t856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856,\n\t856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856,\n\t856, 857, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856,\n\t856, 858, 753, 753, 753, 753, 859, 106, 860, 861, 121, 862, 863, 864,\n\t865, 121, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,\n\t866, 867, 868, 106, 869, 128, 128, 128, 128, 128, 128, 128, 128, 128,\n\t128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,\n\t128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128,\n\t128, 128, 128, 128, 128, 128, 128, 870, 106, 106, 128, 128, 128, 128,\n\t128, 128, 128, 128, 871, 128, 128, 128, 128, 128, 128, 106, 106, 106,\n\t106, 106, 128, 872, 873, 873, 874, 875, 501, 106, 876, 877, 878, 879,\n\t880, 881, 882, 883, 884, 128, 128, 128, 128, 128, 128, 128, 128, 128,\n\t128, 128, 128, 128, 128, 128, 128, 885, 886, 887, 888, 889, 890, 891,\n\t891, 892, 893, 894, 894, 895, 896, 897, 898, 897, 897, 897, 897, 899,\n\t900, 900, 900, 901, 902, 902, 902, 903, 904, 905, 106, 906, 907, 908,\n\t907, 907, 909, 907, 907, 910, 907, 911, 907, 911, 106, 106, 106, 106,\n\t907, 907, 907, 907, 907, 907, 907, 907, 907, 907, 907, 907, 907, 907,\n\t907, 912, 913, 914, 914, 914, 914, 914, 915, 603, 916, 916, 916, 916,\n\t916, 916, 917, 918, 919, 920, 568, 609, 106, 106, 106, 106, 106, 106,\n\t603, 603, 603, 603, 603, 921, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 922, 922, 922, 923, 924, 924,\n\t924, 924, 924, 924, 925, 106, 106, 106, 106, 106, 926, 926, 926, 927,\n\t928, 106, 929, 929, 930, 931, 106, 106, 106, 106, 106, 106, 932, 932,\n\t932, 933, 934, 934, 934, 934, 935, 934, 936, 106, 106, 106, 106, 106,\n\t937, 937, 937, 937, 937, 938, 938, 938, 938, 938, 939, 939, 939, 939,\n\t939, 939, 940, 940, 940, 941, 942, 943, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 944, 945, 946, 946, 946, 946, 947, 948, 949, 949,\n\t950, 951, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 952, 952, 953, 954, 955, 955,\n\t955, 956, 106, 106, 106, 106, 106, 106, 106, 106, 957, 957, 957, 957,\n\t958, 958, 958, 959, 106, 106, 106, 106, 106, 106, 106, 106, 960, 961,\n\t962, 963, 964, 964, 965, 966, 967, 106, 968, 969, 970, 970, 970, 971,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 972, 972, 972, 972, 972, 972, 973, 974, 975, 975, 976, 977,\n\t978, 978, 979, 980, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 106, 981, 981, 981, 981, 981, 981, 981, 981,\n\t981, 982, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 983, 983, 983, 984, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t985, 986, 986, 986, 986, 986, 986, 987, 988, 989, 990, 991, 992, 993,\n\t106, 106, 994, 995, 995, 995, 995, 995, 996, 997, 998, 106, 999, 999,\n\t999, 1000, 1001, 1002, 1003, 1004, 1004, 1004, 1005, 1006, 1007, 1008,\n\t1009, 106, 106, 106, 106, 106, 106, 106, 1010, 1011, 1011, 1011, 1011,\n\t1011, 1012, 1013, 1014, 1015, 1016, 1017, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t1018, 1018, 1018, 1018, 1018, 1019, 1020, 106, 1021, 1022, 106, 106, 106,\n\t106, 106, 106, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023,\n\t1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023,\n\t1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023,\n\t1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023,\n\t1024, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025,\n\t1025, 1025, 1025, 1025, 1026, 106, 1027, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 1028, 1028, 1028,\n\t1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028,\n\t1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028,\n\t1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028, 1029, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 770, 770, 770,\n\t770, 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, 770,\n\t770, 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, 770, 770,\n\t770, 770, 770, 770, 770, 770, 770, 770, 1030, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031,\n\t1032, 106, 1033, 1034, 1034, 1034, 1034, 1035, 106, 1036, 1037, 1038,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 1039, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 603, 603, 603, 603, 603, 603, 603, 603, 603, 603, 603, 603,\n\t603, 603, 603, 603, 603, 603, 603, 603, 603, 603, 603, 603, 603, 603,\n\t603, 603, 603, 603, 1040, 106, 603, 603, 603, 603, 1041, 1042, 603, 603,\n\t603, 603, 603, 603, 1043, 1044, 1045, 1046, 1047, 1048, 603, 603, 603,\n\t1049, 603, 603, 603, 603, 603, 1040, 106, 106, 106, 106, 919, 919, 919,\n\t919, 919, 919, 919, 919, 1050, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 568, 568, 568, 568, 568, 568, 568, 568, 568, 568, 610, 106, 914,\n\t914, 1051, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 1052, 1052, 1052, 1053, 1054, 1054, 1055, 1052,\n\t1052, 1056, 1057, 1054, 1054, 1052, 1052, 1052, 1053, 1054, 1054, 1058,\n\t1059, 1060, 1056, 1061, 1062, 1054, 1052, 1052, 1052, 1053, 1054, 1054,\n\t1063, 1064, 1065, 1066, 1054, 1054, 1054, 1067, 1068, 1069, 1070, 1054,\n\t1054, 1055, 1052, 1052, 1056, 1054, 1054, 1054, 1052, 1052, 1052, 1053,\n\t1054, 1054, 1055, 1052, 1052, 1056, 1054, 1054, 1054, 1052, 1052, 1052,\n\t1053, 1054, 1054, 1055, 1052, 1052, 1056, 1054, 1054, 1054, 1052, 1052,\n\t1052, 1053, 1054, 1054, 1071, 1052, 1052, 1052, 1072, 1054, 1054, 1073,\n\t1074, 1052, 1052, 1075, 1054, 1054, 1076, 1055, 1052, 1052, 1077, 1054,\n\t1054, 1078, 1079, 1052, 1052, 1080, 1054, 1054, 1054, 1081, 1052, 1052,\n\t1052, 1072, 1054, 1054, 1073, 1082, 1083, 1083, 1083, 1083, 1083, 1083,\n\t1084, 128, 128, 128, 1085, 1086, 1087, 1088, 1089, 1090, 1085, 1091,\n\t1085, 1087, 1087, 1092, 128, 1093, 128, 1094, 1095, 1093, 128, 1094, 106,\n\t106, 106, 106, 106, 106, 1096, 106, 568, 568, 568, 568, 568, 609, 568,\n\t568, 568, 568, 568, 568, 568, 568, 568, 568, 568, 568, 609, 106, 568,\n\t610, 636, 610, 636, 568, 636, 568, 106, 106, 106, 106, 613, 1097, 615,\n\t615, 615, 1098, 615, 615, 615, 615, 615, 615, 615, 1099, 615, 615, 615,\n\t615, 615, 1100, 106, 106, 106, 106, 106, 106, 106, 106, 1101, 603, 603,\n\t603, 1102, 106, 733, 733, 733, 733, 733, 1103, 733, 1104, 1105, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 568, 568, 568, 568, 1106, 106, 1107, 568, 568,\n\t568, 568, 568, 568, 568, 568, 1108, 568, 568, 609, 106, 568, 568, 568,\n\t568, 1109, 611, 106, 106, 568, 568, 1106, 106, 568, 568, 568, 568, 568,\n\t568, 568, 610, 1110, 568, 568, 568, 568, 568, 568, 568, 568, 568, 568,\n\t568, 568, 568, 568, 568, 568, 568, 568, 568, 568, 568, 568, 1111, 568,\n\t568, 568, 568, 568, 568, 568, 1112, 609, 106, 568, 568, 568, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t106, 106, 1113, 568, 568, 568, 568, 568, 568, 568, 568, 1114, 568, 106,\n\t106, 106, 106, 106, 106, 568, 568, 568, 568, 568, 568, 568, 568, 1112,\n\t106, 106, 106, 106, 106, 106, 106, 568, 568, 568, 568, 568, 568, 568,\n\t568, 568, 568, 568, 568, 568, 568, 609, 106, 106, 106, 106, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 751, 751, 751,\n\t751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751,\n\t751, 751, 751, 751, 751, 751, 751, 751, 751, 1115, 753, 753, 753, 753,\n\t753, 751, 751, 751, 751, 751, 751, 754, 753, 750, 751, 751, 751, 751,\n\t751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751,\n\t751, 751, 751, 751, 751, 751, 751, 751, 752, 753, 753, 753, 753, 753,\n\t753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753,\n\t753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753,\n\t753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753,\n\t753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 856,\n\t856, 856, 857, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753,\n\t753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753,\n\t753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753,\n\t753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753, 753,\n\t753, 753, 753, 753, 753, 753, 1116, 1117, 106, 106, 106, 1118, 1118,\n\t1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 106, 106,\n\t106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,\n\t873, 873, 873, 873, 873, 873, 873, 873, 873, 873, 873, 873, 873, 873,\n\t873, 873, 873, 873, 873, 873, 873, 873, 873, 873, 873, 873, 873, 873,\n\t873, 873, 106, 106, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854,\n\t854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854,\n\t854, 854, 854, 854, 854, 854, 854, 1119,\n};\n\nstatic const unsigned short index2[] = {\n\t1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 4, 3, 1, 1, 1, 1, 1, 1, 3, 3, 3, 2,\n\t5, 6, 6, 7, 8, 7, 6, 6, 9, 10, 6, 11, 12, 13, 12, 12, 14, 14, 14, 14, 14,\n\t14, 14, 14, 14, 14, 12, 6, 15, 16, 15, 6, 6, 17, 17, 17, 17, 17, 17, 17,\n\t17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 9, 6, 10, 18, 19, 18, 20, 20,\n\t20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 9, 16,\n\t10, 16, 1, 1, 1, 1, 1, 1, 3, 1, 1, 21, 22, 8, 8, 23, 8, 24, 22, 25, 26,\n\t27, 28, 16, 29, 30, 18, 31, 32, 33, 33, 25, 34, 22, 22, 25, 33, 27, 35,\n\t36, 36, 36, 22, 37, 37, 37, 37, 37, 37, 38, 37, 37, 37, 37, 37, 37, 37,\n\t37, 37, 38, 37, 37, 37, 37, 37, 37, 39, 38, 37, 37, 37, 37, 37, 38, 40,\n\t40, 40, 41, 41, 41, 41, 40, 41, 40, 40, 40, 41, 40, 40, 41, 41, 40, 41,\n\t40, 40, 41, 41, 41, 39, 40, 40, 40, 41, 40, 41, 40, 41, 37, 40, 37, 41,\n\t37, 41, 37, 41, 37, 41, 37, 41, 37, 41, 37, 41, 37, 40, 37, 40, 37, 41,\n\t37, 41, 37, 41, 37, 40, 37, 41, 37, 41, 37, 41, 37, 41, 37, 41, 38, 40,\n\t37, 40, 38, 40, 37, 41, 37, 41, 40, 37, 41, 37, 41, 37, 41, 38, 40, 38,\n\t40, 37, 40, 37, 41, 37, 40, 40, 38, 40, 37, 40, 37, 41, 37, 41, 38, 40,\n\t37, 41, 37, 41, 37, 37, 41, 37, 41, 37, 41, 41, 41, 37, 37, 41, 37, 41,\n\t37, 37, 41, 37, 37, 37, 41, 41, 37, 37, 37, 37, 41, 37, 37, 41, 37, 37,\n\t37, 41, 41, 41, 37, 37, 41, 37, 37, 41, 37, 41, 37, 41, 37, 37, 41, 37,\n\t41, 41, 37, 41, 37, 37, 41, 37, 37, 37, 41, 37, 41, 37, 37, 41, 41, 42,\n\t37, 41, 41, 41, 42, 42, 42, 42, 37, 43, 41, 37, 43, 41, 37, 43, 41, 37,\n\t40, 37, 40, 37, 40, 37, 40, 37, 40, 37, 40, 37, 40, 37, 40, 41, 37, 41,\n\t41, 37, 43, 41, 37, 41, 37, 37, 37, 41, 37, 41, 41, 41, 41, 41, 41, 41,\n\t37, 37, 41, 37, 37, 41, 41, 37, 41, 37, 37, 37, 37, 41, 41, 40, 41, 41,\n\t41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 42, 41,\n\t41, 41, 44, 44, 44, 44, 44, 44, 44, 44, 44, 45, 45, 46, 46, 46, 46, 46,\n\t46, 46, 47, 47, 25, 47, 45, 48, 45, 48, 48, 48, 45, 48, 45, 45, 49, 46,\n\t47, 47, 47, 47, 47, 47, 25, 25, 25, 25, 47, 25, 47, 25, 44, 44, 44, 44,\n\t44, 47, 47, 47, 47, 47, 50, 50, 45, 47, 46, 47, 47, 47, 47, 47, 47, 47,\n\t47, 47, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 52, 53, 53,\n\t53, 53, 52, 54, 53, 53, 53, 53, 53, 55, 55, 53, 53, 53, 53, 55, 55, 53,\n\t53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 56, 56, 56, 56, 56, 53, 53, 53,\n\t53, 51, 51, 51, 51, 51, 51, 51, 51, 57, 51, 53, 53, 53, 51, 51, 51, 53,\n\t53, 58, 51, 51, 51, 53, 53, 53, 53, 51, 52, 53, 53, 51, 59, 60, 60, 59,\n\t60, 60, 59, 51, 51, 51, 51, 51, 61, 62, 61, 62, 45, 63, 61, 62, 64, 64,\n\t65, 62, 62, 62, 66, 64, 64, 64, 64, 64, 63, 47, 61, 66, 61, 61, 61, 64,\n\t61, 64, 61, 61, 62, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67,\n\t67, 67, 67, 67, 64, 67, 67, 67, 67, 67, 67, 67, 61, 61, 62, 62, 62, 62,\n\t62, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,\n\t62, 68, 68, 68, 68, 68, 68, 68, 62, 62, 62, 62, 62, 61, 62, 62, 61, 61,\n\t61, 62, 62, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 69, 70, 69, 70,\n\t69, 70, 69, 70, 69, 70, 69, 70, 69, 70, 62, 62, 62, 62, 61, 62, 71, 61,\n\t62, 61, 61, 62, 62, 61, 61, 61, 72, 73, 72, 72, 72, 72, 72, 72, 72, 72,\n\t72, 72, 72, 72, 72, 72, 73, 73, 73, 73, 73, 73, 73, 73, 74, 74, 74, 74,\n\t74, 74, 74, 74, 75, 74, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,\n\t75, 75, 72, 75, 72, 75, 72, 75, 72, 75, 72, 75, 76, 77, 77, 78, 78, 77,\n\t79, 79, 72, 75, 72, 75, 72, 75, 72, 72, 75, 72, 75, 72, 75, 72, 75, 72,\n\t75, 72, 75, 72, 75, 75, 64, 64, 64, 64, 64, 64, 64, 64, 64, 80, 80, 80,\n\t80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,\n\t80, 64, 64, 81, 82, 82, 82, 82, 82, 82, 64, 83, 83, 83, 83, 83, 83, 83,\n\t83, 83, 83, 83, 83, 83, 83, 83, 64, 84, 85, 64, 64, 64, 64, 86, 64, 87,\n\t88, 88, 88, 88, 87, 88, 88, 88, 89, 87, 88, 88, 88, 88, 88, 88, 87, 87,\n\t87, 87, 87, 87, 88, 88, 87, 88, 88, 89, 90, 88, 91, 92, 93, 94, 95, 96,\n\t97, 98, 99, 100, 100, 101, 102, 103, 104, 105, 106, 107, 108, 106, 88,\n\t87, 106, 99, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 64,\n\t64, 64, 64, 64, 109, 109, 109, 106, 106, 64, 64, 64, 110, 110, 110, 110,\n\t110, 64, 111, 111, 112, 113, 113, 114, 115, 116, 117, 117, 118, 118, 118,\n\t118, 118, 118, 118, 118, 119, 120, 121, 122, 64, 64, 116, 122, 123, 123,\n\t123, 123, 123, 123, 123, 123, 124, 123, 123, 123, 123, 123, 123, 123,\n\t123, 123, 123, 125, 126, 127, 128, 129, 130, 131, 132, 78, 78, 133, 134,\n\t118, 118, 118, 118, 118, 134, 118, 118, 134, 135, 135, 135, 135, 135,\n\t135, 135, 135, 135, 135, 113, 136, 136, 116, 123, 123, 137, 123, 123,\n\t123, 123, 123, 123, 123, 123, 123, 123, 123, 116, 123, 118, 118, 118,\n\t118, 118, 118, 118, 138, 117, 118, 118, 118, 118, 134, 118, 139, 139,\n\t118, 118, 117, 134, 118, 118, 134, 123, 123, 140, 140, 140, 140, 140,\n\t140, 140, 140, 140, 140, 123, 123, 123, 141, 141, 123, 142, 142, 142,\n\t142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 64, 143, 144, 145,\n\t144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,\n\t146, 147, 146, 146, 147, 146, 146, 147, 147, 147, 146, 147, 147, 146,\n\t147, 146, 146, 146, 147, 146, 147, 146, 147, 146, 147, 146, 146, 64, 64,\n\t144, 144, 144, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148,\n\t148, 148, 148, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149,\n\t148, 64, 64, 64, 64, 64, 64, 150, 150, 150, 150, 150, 150, 150, 150, 150,\n\t150, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,\n\t151, 151, 151, 151, 152, 152, 152, 152, 152, 152, 152, 153, 152, 154,\n\t154, 155, 156, 156, 156, 154, 64, 64, 64, 64, 64, 157, 157, 157, 157,\n\t157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 158, 158, 158, 158,\n\t159, 158, 158, 158, 158, 158, 158, 158, 158, 158, 159, 158, 158, 158,\n\t159, 158, 158, 158, 158, 158, 64, 64, 160, 160, 160, 160, 160, 160, 160,\n\t160, 160, 160, 160, 160, 160, 160, 160, 64, 161, 161, 161, 161, 161, 161,\n\t161, 161, 161, 162, 162, 162, 64, 64, 163, 64, 123, 64, 123, 123, 123,\n\t123, 123, 123, 123, 123, 123, 123, 123, 64, 64, 64, 64, 64, 64, 64, 118,\n\t118, 134, 118, 118, 134, 118, 118, 118, 134, 134, 134, 164, 165, 166,\n\t118, 118, 118, 134, 118, 118, 134, 134, 118, 118, 118, 118, 64, 167, 167,\n\t167, 168, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,\n\t169, 169, 167, 168, 170, 169, 168, 168, 168, 167, 167, 167, 167, 167,\n\t167, 167, 167, 168, 168, 168, 168, 171, 168, 168, 169, 78, 133, 172, 172,\n\t167, 167, 167, 169, 169, 167, 167, 84, 84, 173, 173, 173, 173, 173, 173,\n\t173, 173, 173, 173, 174, 175, 169, 169, 169, 169, 169, 169, 64, 169, 169,\n\t169, 169, 169, 169, 169, 64, 176, 177, 177, 64, 178, 178, 178, 178, 178,\n\t178, 178, 178, 64, 64, 178, 178, 64, 64, 178, 178, 178, 178, 178, 178,\n\t178, 178, 178, 178, 178, 178, 178, 178, 64, 178, 178, 178, 178, 178, 178,\n\t178, 64, 178, 64, 64, 64, 178, 178, 178, 178, 64, 64, 179, 178, 177, 177,\n\t177, 176, 176, 176, 176, 64, 64, 177, 177, 64, 64, 177, 177, 180, 178,\n\t64, 64, 64, 64, 64, 64, 64, 64, 177, 64, 64, 64, 64, 178, 178, 64, 178,\n\t178, 178, 176, 176, 64, 64, 181, 181, 181, 181, 181, 181, 181, 181, 181,\n\t181, 178, 178, 182, 182, 183, 183, 183, 183, 183, 183, 184, 182, 64, 64,\n\t64, 64, 64, 185, 185, 186, 64, 187, 187, 187, 187, 187, 187, 64, 64, 64,\n\t64, 187, 187, 64, 64, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187,\n\t187, 187, 187, 187, 64, 187, 187, 187, 187, 187, 187, 187, 64, 187, 187,\n\t64, 187, 187, 64, 187, 187, 64, 64, 188, 64, 186, 186, 186, 185, 185, 64,\n\t64, 64, 64, 185, 185, 64, 64, 185, 185, 189, 64, 64, 64, 185, 64, 64, 64,\n\t64, 64, 64, 64, 187, 187, 187, 187, 64, 187, 64, 64, 64, 64, 64, 64, 64,\n\t190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 185, 185, 187, 187,\n\t187, 185, 64, 64, 64, 191, 191, 192, 64, 193, 193, 193, 193, 193, 193,\n\t193, 193, 193, 64, 193, 193, 193, 64, 193, 193, 193, 193, 193, 193, 193,\n\t193, 193, 193, 193, 193, 193, 193, 64, 193, 193, 193, 193, 193, 193, 193,\n\t64, 193, 193, 64, 193, 193, 193, 193, 193, 64, 64, 194, 193, 192, 192,\n\t192, 191, 191, 191, 191, 191, 64, 191, 191, 192, 64, 192, 192, 195, 64,\n\t64, 193, 64, 64, 64, 64, 64, 64, 64, 193, 193, 191, 191, 64, 64, 196,\n\t196, 196, 196, 196, 196, 196, 196, 196, 196, 197, 198, 64, 64, 64, 64,\n\t64, 64, 64, 199, 200, 200, 64, 201, 201, 201, 201, 201, 201, 201, 201,\n\t64, 64, 201, 201, 64, 64, 201, 201, 201, 201, 201, 201, 201, 201, 201,\n\t201, 201, 201, 201, 201, 64, 201, 201, 201, 201, 201, 201, 201, 64, 201,\n\t201, 64, 201, 201, 201, 201, 201, 64, 64, 202, 201, 200, 199, 200, 199,\n\t199, 199, 199, 64, 64, 200, 200, 64, 64, 200, 200, 203, 64, 64, 64, 64,\n\t64, 64, 64, 64, 199, 200, 64, 64, 64, 64, 201, 201, 64, 201, 201, 201,\n\t199, 199, 64, 64, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 205,\n\t201, 206, 206, 206, 206, 206, 206, 64, 64, 207, 208, 64, 208, 208, 208,\n\t208, 208, 208, 64, 64, 64, 208, 208, 208, 64, 208, 208, 208, 208, 64, 64,\n\t64, 208, 208, 64, 208, 64, 208, 208, 64, 64, 64, 208, 208, 64, 64, 64,\n\t208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 64, 64, 64, 64, 209,\n\t209, 207, 209, 209, 64, 64, 64, 209, 209, 209, 64, 209, 209, 209, 210,\n\t64, 64, 208, 64, 64, 64, 64, 64, 64, 209, 64, 64, 64, 64, 64, 64, 211,\n\t211, 211, 211, 211, 211, 211, 211, 211, 211, 212, 212, 212, 213, 213,\n\t213, 213, 213, 213, 214, 213, 64, 64, 64, 64, 64, 64, 215, 215, 215, 64,\n\t216, 216, 216, 216, 216, 216, 216, 216, 64, 216, 216, 216, 64, 216, 216,\n\t216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216,\n\t216, 216, 64, 216, 216, 216, 216, 216, 64, 64, 64, 216, 217, 217, 217,\n\t215, 215, 215, 215, 64, 217, 217, 217, 64, 217, 217, 217, 218, 64, 64,\n\t64, 64, 64, 64, 64, 219, 220, 64, 216, 216, 64, 64, 64, 64, 64, 64, 216,\n\t216, 217, 217, 64, 64, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,\n\t222, 222, 222, 222, 222, 222, 222, 223, 64, 64, 224, 224, 64, 225, 225,\n\t225, 225, 225, 225, 225, 225, 64, 225, 225, 225, 64, 225, 225, 225, 225,\n\t225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 64,\n\t225, 225, 225, 225, 225, 64, 64, 226, 225, 224, 227, 224, 224, 224, 224,\n\t224, 64, 227, 224, 224, 64, 224, 224, 228, 229, 64, 64, 64, 64, 64, 64,\n\t64, 224, 224, 64, 64, 64, 64, 64, 64, 64, 225, 64, 225, 225, 228, 228,\n\t64, 64, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 64, 225, 225,\n\t64, 64, 64, 64, 64, 64, 64, 231, 231, 64, 232, 232, 232, 232, 232, 232,\n\t232, 232, 64, 232, 232, 232, 64, 232, 232, 232, 232, 232, 232, 232, 232,\n\t232, 232, 232, 232, 232, 232, 232, 232, 232, 64, 64, 232, 231, 231, 231,\n\t233, 233, 233, 233, 64, 231, 231, 231, 64, 231, 231, 231, 234, 232, 64,\n\t64, 64, 64, 64, 64, 64, 64, 231, 232, 232, 233, 233, 64, 64, 235, 235,\n\t235, 235, 235, 235, 235, 235, 235, 235, 236, 236, 236, 236, 236, 236, 64,\n\t64, 64, 237, 232, 232, 232, 232, 232, 232, 64, 64, 238, 238, 64, 239,\n\t239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,\n\t239, 239, 239, 64, 64, 64, 239, 239, 239, 239, 239, 239, 239, 239, 64,\n\t239, 239, 239, 239, 239, 239, 239, 239, 239, 64, 239, 64, 64, 64, 64,\n\t240, 64, 64, 64, 64, 238, 238, 238, 241, 241, 241, 64, 241, 64, 238, 238,\n\t238, 238, 238, 238, 238, 238, 64, 64, 238, 238, 242, 64, 64, 64, 64, 243,\n\t243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,\n\t243, 244, 243, 243, 244, 244, 244, 244, 245, 245, 246, 64, 64, 64, 64,\n\t247, 243, 243, 243, 243, 243, 243, 248, 244, 249, 249, 249, 249, 244,\n\t244, 244, 250, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 250,\n\t250, 64, 64, 64, 64, 64, 252, 252, 64, 252, 64, 64, 252, 252, 64, 252,\n\t64, 64, 252, 64, 64, 64, 64, 64, 64, 252, 252, 252, 252, 64, 252, 252,\n\t252, 252, 252, 252, 252, 64, 252, 252, 252, 64, 252, 64, 252, 64, 64,\n\t252, 252, 64, 252, 252, 252, 252, 253, 252, 252, 253, 253, 253, 253, 254,\n\t254, 64, 253, 253, 252, 64, 64, 252, 252, 252, 252, 252, 64, 255, 64,\n\t256, 256, 256, 256, 253, 253, 64, 64, 257, 257, 257, 257, 257, 257, 257,\n\t257, 257, 257, 64, 64, 252, 252, 252, 252, 258, 259, 259, 259, 260, 260,\n\t260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 259,\n\t260, 259, 259, 259, 261, 261, 259, 259, 259, 259, 259, 259, 262, 262,\n\t262, 262, 262, 262, 262, 262, 262, 262, 263, 263, 263, 263, 263, 263,\n\t263, 263, 263, 263, 259, 261, 259, 261, 259, 264, 265, 266, 265, 266,\n\t267, 267, 258, 258, 258, 258, 258, 258, 258, 258, 64, 258, 258, 258, 258,\n\t258, 258, 258, 258, 258, 258, 258, 258, 64, 64, 64, 64, 268, 269, 270,\n\t271, 270, 270, 270, 270, 270, 269, 269, 269, 269, 270, 267, 269, 270,\n\t272, 272, 273, 260, 272, 272, 258, 258, 258, 258, 258, 270, 270, 270,\n\t270, 270, 270, 270, 270, 270, 270, 270, 64, 270, 270, 270, 270, 270, 270,\n\t270, 270, 270, 270, 270, 270, 64, 259, 259, 259, 259, 259, 259, 259, 259,\n\t261, 259, 259, 259, 259, 259, 259, 64, 259, 259, 260, 260, 260, 260, 260,\n\t274, 274, 274, 274, 260, 260, 64, 64, 64, 64, 64, 275, 275, 275, 275,\n\t275, 275, 275, 275, 275, 275, 275, 276, 276, 277, 277, 277, 277, 276,\n\t277, 277, 277, 277, 277, 278, 276, 279, 279, 276, 276, 277, 277, 275,\n\t280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 281, 281, 281, 281,\n\t281, 281, 275, 275, 275, 275, 275, 275, 276, 276, 277, 277, 275, 275,\n\t275, 275, 277, 277, 277, 275, 276, 276, 276, 275, 275, 276, 276, 276,\n\t276, 276, 276, 276, 275, 275, 275, 277, 277, 277, 277, 275, 275, 275,\n\t275, 275, 277, 276, 276, 277, 277, 276, 276, 276, 276, 276, 276, 282,\n\t275, 276, 280, 280, 276, 276, 276, 277, 283, 283, 284, 284, 284, 284,\n\t284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 64, 284, 64, 64, 64,\n\t64, 64, 284, 64, 64, 285, 285, 285, 285, 285, 285, 285, 285, 285, 285,\n\t285, 84, 286, 285, 285, 285, 287, 287, 287, 287, 287, 287, 287, 287, 288,\n\t288, 288, 288, 288, 288, 288, 288, 289, 289, 289, 289, 289, 289, 289,\n\t289, 289, 64, 289, 289, 289, 289, 64, 64, 289, 289, 289, 289, 289, 289,\n\t289, 64, 289, 289, 289, 64, 64, 290, 290, 290, 291, 291, 291, 291, 291,\n\t291, 291, 291, 291, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292,\n\t292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 64, 64, 64, 293, 293,\n\t293, 293, 293, 293, 293, 293, 293, 293, 64, 64, 64, 64, 64, 64, 294, 294,\n\t294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 64, 64, 64, 295,\n\t296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296,\n\t296, 296, 296, 296, 296, 296, 297, 297, 296, 298, 299, 299, 299, 299,\n\t299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299,\n\t300, 301, 64, 64, 64, 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,\n\t302, 84, 84, 84, 303, 303, 303, 64, 64, 64, 64, 64, 64, 64, 304, 304,\n\t304, 304, 304, 304, 304, 304, 304, 304, 304, 304, 304, 64, 304, 304, 304,\n\t304, 305, 305, 306, 64, 64, 64, 307, 307, 307, 307, 307, 307, 307, 307,\n\t307, 307, 308, 308, 309, 84, 84, 64, 310, 310, 310, 310, 310, 310, 310,\n\t310, 310, 310, 311, 311, 64, 64, 64, 64, 312, 312, 312, 312, 312, 312,\n\t312, 312, 312, 312, 312, 312, 312, 64, 312, 312, 312, 64, 313, 313, 64,\n\t64, 64, 64, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314,\n\t315, 315, 316, 315, 315, 315, 315, 315, 315, 315, 316, 316, 316, 316,\n\t316, 316, 316, 316, 315, 316, 316, 315, 315, 315, 315, 315, 315, 315,\n\t315, 315, 317, 315, 318, 318, 318, 319, 318, 318, 318, 320, 314, 321, 64,\n\t64, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 64, 64, 64, 64, 64,\n\t64, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 64, 64, 64, 64, 64,\n\t64, 324, 324, 66, 66, 324, 66, 325, 324, 324, 324, 324, 326, 326, 326,\n\t327, 64, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 64, 64, 64,\n\t64, 64, 64, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 329, 330,\n\t329, 329, 329, 329, 329, 331, 329, 64, 64, 64, 64, 64, 296, 296, 296,\n\t296, 296, 296, 64, 64, 332, 332, 332, 332, 332, 332, 332, 332, 332, 332,\n\t332, 332, 332, 64, 64, 64, 333, 333, 333, 334, 334, 334, 334, 333, 333,\n\t334, 334, 334, 64, 64, 64, 64, 334, 334, 333, 334, 334, 334, 334, 334,\n\t334, 335, 336, 337, 64, 64, 64, 64, 338, 64, 64, 64, 339, 339, 340, 340,\n\t340, 340, 340, 340, 340, 340, 340, 340, 341, 341, 341, 341, 341, 341,\n\t341, 341, 341, 341, 341, 341, 341, 341, 64, 64, 341, 341, 341, 341, 341,\n\t64, 64, 64, 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, 342, 342,\n\t64, 64, 64, 64, 343, 343, 343, 343, 343, 343, 343, 343, 343, 342, 342,\n\t342, 342, 342, 342, 342, 343, 343, 64, 64, 64, 64, 64, 64, 344, 344, 344,\n\t344, 344, 344, 344, 344, 344, 344, 345, 64, 64, 64, 346, 346, 347, 347,\n\t347, 347, 347, 347, 347, 347, 348, 348, 348, 348, 348, 348, 348, 348,\n\t348, 348, 348, 348, 348, 348, 348, 349, 350, 351, 351, 351, 64, 64, 352,\n\t352, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353, 353,\n\t354, 355, 354, 355, 355, 355, 355, 355, 355, 355, 64, 356, 354, 355, 354,\n\t354, 355, 355, 355, 355, 355, 355, 355, 355, 354, 354, 354, 354, 354,\n\t354, 355, 355, 357, 357, 357, 357, 357, 357, 357, 357, 64, 64, 358, 359,\n\t359, 359, 359, 359, 359, 359, 359, 359, 359, 64, 64, 64, 64, 64, 64, 360,\n\t360, 360, 360, 360, 360, 360, 361, 360, 360, 360, 360, 360, 360, 64, 64,\n\t362, 362, 362, 362, 363, 364, 364, 364, 364, 364, 364, 364, 364, 364,\n\t364, 364, 364, 364, 364, 364, 365, 363, 362, 362, 362, 362, 362, 363,\n\t362, 363, 363, 363, 363, 363, 362, 363, 366, 364, 364, 364, 364, 364,\n\t364, 364, 64, 64, 64, 64, 367, 367, 367, 367, 367, 367, 367, 367, 367,\n\t367, 368, 368, 368, 368, 368, 368, 368, 369, 369, 369, 369, 369, 369,\n\t369, 369, 369, 369, 370, 371, 370, 370, 370, 370, 370, 370, 370, 369,\n\t369, 369, 369, 369, 369, 369, 369, 369, 64, 64, 64, 372, 372, 373, 374,\n\t374, 374, 374, 374, 374, 374, 374, 374, 374, 374, 374, 374, 374, 373,\n\t372, 372, 372, 372, 373, 373, 372, 372, 375, 376, 373, 373, 374, 374,\n\t377, 377, 377, 377, 377, 377, 377, 377, 377, 377, 374, 374, 374, 374,\n\t374, 374, 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, 378,\n\t378, 378, 379, 380, 381, 381, 380, 380, 380, 381, 380, 381, 381, 381,\n\t382, 382, 64, 64, 64, 64, 64, 64, 64, 64, 383, 383, 383, 383, 384, 384,\n\t384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 385, 385, 385, 385,\n\t385, 385, 385, 385, 386, 386, 386, 386, 386, 386, 386, 386, 385, 385,\n\t386, 387, 64, 64, 64, 388, 388, 388, 388, 388, 389, 389, 389, 389, 389,\n\t389, 389, 389, 389, 389, 64, 64, 64, 384, 384, 384, 390, 390, 390, 390,\n\t390, 390, 390, 390, 390, 390, 391, 391, 391, 391, 391, 391, 391, 391,\n\t391, 391, 391, 391, 391, 391, 392, 392, 392, 392, 392, 392, 393, 393,\n\t394, 394, 394, 394, 394, 394, 394, 394, 78, 78, 78, 84, 395, 133, 133,\n\t133, 133, 133, 78, 78, 133, 133, 133, 133, 78, 396, 395, 395, 395, 395,\n\t395, 395, 395, 397, 397, 397, 397, 133, 397, 397, 397, 397, 396, 396, 78,\n\t397, 397, 64, 41, 41, 41, 41, 41, 41, 62, 62, 62, 62, 62, 75, 44, 44, 44,\n\t44, 44, 44, 44, 44, 44, 65, 65, 65, 65, 65, 44, 44, 44, 44, 65, 65, 65,\n\t65, 65, 41, 41, 41, 41, 41, 398, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,\n\t44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 65, 78, 78, 133, 78, 78,\n\t78, 78, 78, 78, 78, 133, 78, 78, 399, 400, 133, 401, 78, 78, 78, 78, 78,\n\t78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 64,\n\t64, 64, 64, 64, 402, 133, 78, 133, 37, 41, 37, 41, 37, 41, 41, 41, 41,\n\t41, 41, 41, 41, 41, 37, 41, 62, 62, 62, 62, 62, 62, 62, 62, 61, 61, 61,\n\t61, 61, 61, 61, 61, 62, 62, 62, 62, 62, 62, 64, 64, 61, 61, 61, 61, 61,\n\t61, 64, 64, 64, 61, 64, 61, 64, 61, 64, 61, 403, 403, 403, 403, 403, 403,\n\t403, 403, 62, 62, 62, 62, 62, 64, 62, 62, 61, 61, 61, 61, 403, 63, 62,\n\t63, 63, 63, 62, 62, 62, 64, 62, 62, 61, 61, 61, 61, 403, 63, 63, 63, 62,\n\t62, 62, 62, 64, 64, 62, 62, 61, 61, 61, 61, 64, 63, 63, 63, 61, 61, 61,\n\t61, 61, 63, 63, 63, 64, 64, 62, 62, 62, 64, 62, 62, 61, 61, 61, 61, 403,\n\t63, 63, 64, 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, 404, 405,\n\t406, 406, 407, 408, 409, 410, 410, 409, 409, 409, 22, 66, 411, 412, 413,\n\t414, 411, 412, 413, 414, 22, 22, 22, 66, 22, 22, 22, 22, 415, 416, 417,\n\t418, 419, 420, 421, 21, 422, 423, 422, 422, 423, 22, 66, 66, 66, 28, 35,\n\t22, 66, 66, 22, 424, 424, 66, 66, 66, 425, 426, 427, 66, 66, 66, 66, 66,\n\t66, 66, 66, 66, 66, 66, 428, 66, 424, 66, 66, 66, 66, 66, 66, 66, 66, 66,\n\t66, 404, 405, 405, 405, 405, 405, 64, 64, 64, 64, 64, 405, 405, 405, 405,\n\t405, 405, 429, 44, 64, 64, 33, 429, 429, 429, 429, 429, 430, 430, 428,\n\t426, 427, 431, 429, 33, 33, 33, 33, 429, 429, 429, 429, 429, 430, 430,\n\t428, 426, 427, 64, 44, 44, 44, 44, 44, 64, 64, 64, 247, 247, 247, 247,\n\t247, 247, 247, 247, 247, 432, 247, 247, 23, 247, 247, 247, 247, 247, 247,\n\t64, 64, 64, 64, 64, 78, 78, 395, 395, 78, 78, 78, 78, 395, 395, 395, 78,\n\t78, 433, 433, 433, 433, 78, 433, 433, 433, 395, 395, 78, 133, 78, 395,\n\t395, 133, 133, 133, 133, 78, 64, 64, 64, 64, 64, 64, 64, 26, 26, 434, 30,\n\t26, 30, 26, 434, 26, 30, 34, 434, 434, 434, 34, 34, 434, 434, 434, 435,\n\t26, 434, 30, 26, 428, 434, 434, 434, 434, 434, 26, 26, 26, 30, 30, 26,\n\t434, 26, 67, 26, 434, 26, 37, 38, 434, 434, 436, 34, 434, 434, 37, 434,\n\t34, 397, 397, 397, 397, 34, 26, 26, 34, 34, 434, 434, 437, 428, 428, 428,\n\t428, 434, 34, 34, 34, 34, 26, 428, 26, 26, 41, 274, 438, 438, 438, 36,\n\t36, 438, 438, 438, 438, 438, 438, 36, 36, 36, 36, 438, 439, 439, 439,\n\t439, 439, 439, 439, 439, 439, 439, 439, 439, 440, 440, 440, 440, 439,\n\t439, 440, 440, 440, 440, 440, 440, 440, 440, 440, 37, 41, 440, 440, 440,\n\t440, 36, 64, 64, 64, 64, 64, 64, 39, 39, 39, 39, 39, 30, 30, 30, 30, 30,\n\t428, 428, 26, 26, 26, 26, 428, 26, 26, 428, 26, 26, 428, 26, 26, 26, 26,\n\t26, 26, 26, 428, 26, 26, 26, 26, 26, 26, 26, 26, 26, 30, 30, 26, 26, 26,\n\t26, 26, 26, 26, 26, 26, 26, 26, 26, 428, 428, 26, 26, 39, 26, 39, 26, 26,\n\t26, 26, 26, 26, 26, 26, 26, 26, 30, 26, 26, 26, 26, 428, 428, 428, 428,\n\t428, 428, 428, 428, 428, 428, 428, 428, 39, 437, 441, 441, 437, 428, 428,\n\t39, 441, 437, 437, 441, 437, 437, 428, 39, 428, 441, 430, 442, 428, 441,\n\t437, 428, 428, 428, 441, 437, 437, 441, 39, 441, 441, 437, 437, 39, 437,\n\t39, 437, 39, 39, 39, 39, 441, 441, 437, 441, 437, 437, 437, 437, 437, 39,\n\t39, 39, 39, 428, 437, 428, 437, 441, 441, 437, 437, 437, 437, 437, 437,\n\t437, 437, 437, 437, 441, 437, 437, 437, 441, 428, 428, 428, 428, 428,\n\t441, 437, 437, 437, 428, 428, 428, 428, 428, 428, 428, 428, 428, 437,\n\t441, 39, 437, 428, 441, 441, 441, 441, 437, 437, 441, 441, 428, 428, 441,\n\t441, 437, 437, 441, 441, 437, 437, 441, 441, 437, 437, 437, 437, 437,\n\t428, 428, 437, 437, 437, 437, 428, 428, 39, 428, 428, 437, 39, 428, 428,\n\t428, 428, 428, 428, 428, 428, 437, 437, 428, 39, 437, 437, 437, 428, 428,\n\t428, 428, 428, 437, 441, 428, 437, 437, 437, 437, 437, 428, 428, 437,\n\t437, 428, 428, 428, 428, 437, 437, 437, 437, 437, 437, 437, 437, 428,\n\t428, 437, 437, 437, 437, 26, 26, 26, 26, 26, 26, 30, 26, 26, 26, 26, 26,\n\t437, 437, 26, 26, 26, 26, 26, 26, 26, 443, 444, 26, 26, 26, 26, 26, 26,\n\t26, 26, 26, 26, 26, 274, 274, 274, 274, 274, 274, 274, 274, 274, 274,\n\t274, 274, 274, 26, 428, 26, 26, 26, 26, 26, 26, 26, 26, 274, 26, 26, 26,\n\t26, 26, 428, 428, 428, 428, 428, 428, 428, 428, 428, 26, 26, 26, 26, 428,\n\t428, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 64, 64, 64, 64, 26, 26, 26,\n\t26, 26, 26, 26, 64, 26, 26, 26, 64, 64, 64, 64, 64, 36, 36, 36, 36, 36,\n\t36, 36, 36, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 445, 445,\n\t445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, 438, 36, 36,\n\t36, 36, 36, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 26, 26, 26,\n\t26, 26, 26, 30, 30, 30, 30, 26, 26, 30, 30, 26, 30, 30, 30, 30, 30, 26,\n\t26, 30, 30, 26, 26, 30, 39, 26, 26, 26, 26, 30, 30, 26, 26, 30, 39, 26,\n\t26, 26, 26, 30, 30, 30, 26, 26, 30, 26, 26, 30, 30, 26, 26, 26, 26, 26,\n\t30, 30, 26, 26, 30, 26, 26, 26, 26, 30, 30, 26, 26, 26, 26, 30, 26, 30,\n\t26, 30, 26, 30, 26, 26, 26, 26, 26, 30, 30, 26, 30, 30, 30, 26, 30, 30,\n\t30, 30, 26, 30, 30, 26, 39, 26, 26, 26, 26, 26, 26, 30, 30, 26, 26, 26,\n\t26, 274, 26, 26, 26, 26, 26, 26, 26, 30, 30, 30, 30, 30, 30, 30, 30, 30,\n\t30, 26, 30, 30, 30, 26, 30, 26, 26, 26, 26, 64, 26, 26, 26, 26, 26, 26,\n\t26, 26, 26, 26, 26, 26, 30, 26, 26, 426, 427, 426, 427, 426, 427, 426,\n\t427, 426, 427, 426, 427, 426, 427, 36, 36, 438, 438, 438, 438, 438, 438,\n\t438, 438, 438, 438, 438, 438, 26, 26, 26, 26, 437, 428, 428, 437, 437,\n\t426, 427, 428, 437, 437, 428, 437, 437, 437, 428, 428, 428, 428, 428,\n\t437, 437, 437, 437, 428, 428, 428, 428, 428, 437, 437, 437, 428, 428,\n\t428, 437, 437, 437, 437, 9, 10, 9, 10, 9, 10, 9, 10, 426, 427, 446, 446,\n\t446, 446, 446, 446, 446, 446, 428, 428, 428, 426, 427, 9, 10, 426, 427,\n\t426, 427, 426, 427, 426, 427, 426, 427, 428, 428, 437, 437, 437, 437,\n\t437, 437, 428, 428, 428, 428, 428, 428, 428, 428, 437, 428, 428, 428,\n\t428, 437, 437, 437, 437, 437, 428, 437, 437, 428, 428, 426, 427, 426,\n\t427, 437, 428, 428, 428, 428, 437, 428, 437, 437, 437, 428, 428, 437,\n\t437, 428, 428, 428, 428, 428, 428, 428, 428, 428, 428, 437, 437, 437,\n\t437, 437, 437, 428, 428, 426, 427, 428, 428, 428, 428, 437, 437, 437,\n\t437, 437, 437, 437, 437, 437, 437, 437, 428, 437, 437, 437, 437, 428,\n\t428, 437, 428, 437, 428, 428, 437, 428, 437, 437, 437, 437, 428, 428,\n\t428, 428, 428, 437, 437, 428, 428, 428, 428, 437, 437, 437, 437, 428,\n\t437, 437, 428, 428, 437, 437, 428, 428, 428, 428, 437, 437, 437, 437,\n\t437, 437, 437, 437, 437, 437, 437, 428, 428, 437, 437, 437, 437, 437,\n\t437, 437, 437, 428, 437, 437, 437, 437, 437, 437, 437, 437, 428, 428,\n\t428, 428, 428, 437, 428, 437, 428, 428, 428, 437, 437, 437, 437, 437,\n\t428, 428, 428, 428, 437, 428, 428, 428, 437, 437, 437, 437, 437, 428,\n\t437, 428, 428, 428, 428, 428, 428, 428, 26, 26, 428, 428, 428, 428, 428,\n\t428, 64, 64, 64, 26, 26, 26, 26, 26, 30, 30, 30, 30, 30, 64, 64, 64, 64,\n\t64, 64, 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, 447,\n\t447, 447, 64, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, 448,\n\t448, 448, 448, 64, 37, 41, 37, 37, 37, 41, 41, 37, 41, 37, 41, 37, 41,\n\t37, 37, 37, 37, 41, 37, 41, 41, 37, 41, 41, 41, 41, 41, 41, 44, 44, 37,\n\t37, 69, 70, 69, 70, 70, 449, 449, 449, 449, 449, 449, 69, 70, 69, 70,\n\t450, 450, 450, 69, 70, 64, 64, 64, 64, 64, 451, 451, 451, 451, 452, 451,\n\t451, 453, 453, 453, 453, 453, 453, 453, 453, 453, 453, 453, 453, 453,\n\t453, 64, 453, 64, 64, 64, 64, 64, 453, 64, 64, 454, 454, 454, 454, 454,\n\t454, 454, 454, 64, 64, 64, 64, 64, 64, 64, 455, 456, 64, 64, 64, 64, 64,\n\t64, 64, 64, 64, 64, 64, 64, 64, 64, 457, 77, 77, 77, 77, 77, 77, 77, 77,\n\t66, 66, 28, 35, 28, 35, 66, 66, 66, 28, 35, 66, 28, 35, 66, 66, 66, 66,\n\t66, 66, 66, 66, 66, 410, 66, 66, 410, 66, 28, 35, 66, 66, 28, 35, 426,\n\t427, 426, 427, 426, 427, 426, 427, 66, 66, 66, 66, 66, 45, 66, 66, 410,\n\t410, 64, 64, 64, 64, 458, 458, 458, 458, 458, 458, 458, 458, 458, 458,\n\t64, 458, 458, 458, 458, 458, 458, 458, 458, 458, 64, 64, 64, 64, 458,\n\t458, 458, 458, 458, 458, 64, 64, 459, 459, 459, 459, 459, 459, 459, 459,\n\t459, 459, 459, 459, 64, 64, 64, 64, 460, 461, 461, 461, 459, 462, 463,\n\t464, 443, 444, 443, 444, 443, 444, 443, 444, 443, 444, 459, 459, 443,\n\t444, 443, 444, 443, 444, 443, 444, 465, 466, 467, 467, 459, 464, 464,\n\t464, 464, 464, 464, 464, 464, 464, 468, 469, 470, 471, 472, 472, 465,\n\t473, 473, 473, 473, 473, 459, 459, 464, 464, 464, 462, 463, 461, 459, 26,\n\t64, 474, 474, 474, 474, 474, 474, 474, 474, 474, 474, 474, 474, 474, 474,\n\t474, 474, 474, 474, 474, 474, 474, 474, 64, 64, 475, 475, 476, 476, 477,\n\t477, 474, 465, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478, 478,\n\t478, 478, 478, 478, 478, 478, 478, 461, 473, 479, 479, 478, 64, 64, 64,\n\t64, 64, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, 480,\n\t480, 480, 480, 480, 64, 64, 64, 287, 287, 287, 287, 287, 287, 287, 287,\n\t287, 287, 287, 287, 287, 287, 64, 481, 481, 482, 482, 482, 482, 481, 481,\n\t481, 481, 481, 481, 481, 481, 481, 481, 480, 480, 480, 64, 64, 64, 64,\n\t64, 483, 483, 483, 483, 483, 483, 483, 483, 483, 483, 483, 483, 483, 484,\n\t484, 64, 482, 482, 482, 482, 482, 482, 482, 482, 482, 482, 481, 481, 481,\n\t481, 481, 481, 485, 485, 485, 485, 485, 485, 485, 485, 459, 486, 486,\n\t486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 483,\n\t483, 483, 483, 484, 484, 484, 481, 481, 486, 486, 486, 486, 486, 486,\n\t486, 481, 481, 481, 481, 459, 459, 459, 459, 487, 487, 487, 487, 487,\n\t487, 487, 487, 487, 487, 487, 487, 487, 487, 487, 64, 481, 481, 481, 481,\n\t481, 481, 481, 459, 459, 459, 459, 481, 481, 481, 481, 481, 481, 481,\n\t481, 481, 481, 481, 459, 459, 488, 489, 489, 489, 489, 489, 489, 489,\n\t489, 489, 489, 489, 489, 489, 489, 489, 489, 489, 489, 489, 489, 488,\n\t490, 490, 490, 490, 490, 490, 490, 490, 490, 490, 489, 489, 489, 489,\n\t488, 490, 490, 490, 491, 491, 491, 491, 491, 491, 491, 491, 491, 491,\n\t491, 491, 491, 492, 491, 491, 491, 491, 491, 491, 491, 64, 64, 64, 493,\n\t493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, 64,\n\t494, 494, 494, 494, 494, 494, 494, 494, 495, 495, 495, 495, 495, 495,\n\t496, 496, 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, 497, 497,\n\t498, 499, 499, 499, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500,\n\t497, 497, 64, 64, 64, 64, 72, 75, 72, 75, 72, 75, 501, 77, 79, 79, 79,\n\t502, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 502, 503, 64, 64, 64, 64,\n\t64, 64, 64, 77, 504, 504, 504, 504, 504, 504, 504, 504, 504, 504, 504,\n\t504, 504, 504, 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, 506,\n\t506, 507, 507, 507, 507, 507, 507, 47, 47, 47, 47, 47, 47, 47, 45, 45,\n\t45, 45, 45, 45, 45, 45, 45, 47, 47, 37, 41, 37, 41, 37, 41, 41, 41, 37,\n\t41, 37, 41, 37, 41, 44, 41, 41, 41, 41, 41, 41, 41, 41, 37, 41, 37, 41,\n\t37, 37, 41, 45, 508, 508, 37, 41, 37, 41, 64, 37, 41, 37, 41, 64, 64, 64,\n\t64, 37, 41, 37, 64, 64, 64, 64, 64, 44, 44, 41, 42, 42, 42, 42, 42, 509,\n\t509, 510, 509, 509, 509, 511, 509, 509, 509, 509, 510, 509, 509, 509,\n\t509, 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, 512, 512,\n\t510, 510, 512, 513, 513, 513, 513, 64, 64, 64, 64, 514, 514, 514, 514,\n\t514, 514, 274, 274, 247, 436, 64, 64, 64, 64, 64, 64, 515, 515, 515, 515,\n\t515, 515, 515, 515, 515, 515, 515, 515, 516, 516, 516, 516, 517, 517,\n\t518, 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, 518, 518,\n\t518, 518, 518, 518, 517, 517, 517, 517, 517, 517, 517, 517, 517, 517,\n\t517, 517, 517, 517, 517, 517, 519, 64, 64, 64, 64, 64, 64, 64, 64, 64,\n\t520, 520, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 64, 64, 64,\n\t64, 64, 64, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 169, 169,\n\t169, 169, 169, 169, 174, 174, 174, 169, 64, 64, 64, 64, 522, 522, 522,\n\t522, 522, 522, 522, 522, 522, 522, 523, 523, 523, 523, 523, 523, 523,\n\t523, 523, 523, 523, 523, 523, 523, 523, 523, 523, 523, 523, 523, 524,\n\t524, 524, 524, 524, 525, 525, 525, 526, 526, 527, 527, 527, 527, 527,\n\t527, 527, 527, 527, 527, 527, 527, 527, 527, 527, 528, 528, 528, 528,\n\t528, 528, 528, 528, 528, 528, 528, 529, 530, 64, 64, 64, 64, 64, 64, 64,\n\t64, 64, 64, 64, 531, 287, 287, 287, 287, 287, 64, 64, 64, 532, 532, 532,\n\t533, 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, 534,\n\t534, 534, 535, 533, 533, 532, 532, 532, 532, 533, 533, 532, 533, 533,\n\t533, 536, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537, 537,\n\t537, 64, 538, 539, 539, 539, 539, 539, 539, 539, 539, 539, 539, 64, 64,\n\t64, 64, 537, 537, 540, 540, 540, 540, 540, 540, 540, 540, 540, 541, 541,\n\t541, 541, 541, 541, 542, 542, 541, 541, 542, 542, 541, 541, 64, 540, 540,\n\t540, 541, 540, 540, 540, 540, 540, 540, 540, 540, 541, 542, 64, 64, 543,\n\t543, 543, 543, 543, 543, 543, 543, 543, 543, 64, 64, 544, 544, 544, 544,\n\t545, 275, 275, 275, 275, 275, 275, 283, 283, 283, 275, 276, 64, 64, 64,\n\t64, 546, 546, 546, 546, 546, 546, 546, 546, 547, 546, 547, 547, 548, 546,\n\t546, 547, 547, 546, 546, 546, 546, 546, 547, 547, 546, 547, 546, 64, 64,\n\t64, 64, 64, 64, 64, 64, 546, 546, 549, 550, 550, 551, 551, 551, 551, 551,\n\t551, 551, 551, 551, 551, 551, 552, 553, 553, 552, 552, 554, 554, 551,\n\t555, 555, 552, 556, 64, 64, 289, 289, 289, 289, 289, 289, 64, 551, 551,\n\t551, 552, 552, 553, 552, 552, 553, 552, 552, 554, 552, 556, 64, 64, 557,\n\t557, 557, 557, 557, 557, 557, 557, 557, 557, 64, 64, 64, 64, 64, 64, 287,\n\t558, 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, 558,\n\t558, 558, 558, 558, 287, 64, 64, 64, 64, 288, 288, 288, 288, 288, 288,\n\t288, 64, 64, 64, 64, 288, 288, 288, 288, 288, 288, 288, 288, 288, 64, 64,\n\t64, 64, 559, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 559,\n\t560, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,\n\t561, 561, 561, 561, 561, 561, 561, 561, 561, 560, 488, 488, 488, 488,\n\t488, 488, 488, 488, 488, 488, 488, 488, 488, 488, 490, 490, 488, 488,\n\t490, 490, 490, 490, 490, 490, 41, 41, 41, 41, 41, 41, 41, 64, 64, 64, 64,\n\t83, 83, 83, 83, 83, 64, 64, 64, 64, 64, 109, 562, 109, 109, 563, 109,\n\t109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 64, 109, 109,\n\t109, 109, 109, 64, 109, 64, 109, 109, 64, 109, 109, 64, 109, 109, 123,\n\t123, 564, 564, 564, 564, 564, 564, 564, 564, 564, 564, 564, 564, 564,\n\t564, 564, 564, 64, 64, 64, 64, 64, 64, 64, 64, 64, 123, 123, 123, 123,\n\t123, 123, 123, 123, 123, 123, 123, 413, 565, 64, 64, 123, 123, 123, 123,\n\t123, 123, 123, 123, 123, 123, 114, 26, 64, 64, 58, 58, 58, 58, 58, 58,\n\t58, 58, 461, 461, 461, 461, 461, 461, 461, 466, 467, 461, 64, 64, 64, 64,\n\t64, 64, 461, 465, 465, 566, 566, 466, 467, 466, 467, 466, 467, 466, 467,\n\t466, 467, 466, 467, 466, 467, 466, 467, 461, 461, 466, 467, 461, 461,\n\t461, 461, 566, 566, 566, 567, 461, 567, 64, 461, 567, 461, 461, 465, 443,\n\t444, 443, 444, 443, 444, 568, 461, 461, 569, 570, 571, 571, 572, 64, 461,\n\t573, 568, 461, 64, 64, 64, 64, 123, 123, 123, 123, 123, 64, 123, 123,\n\t123, 123, 123, 123, 123, 64, 64, 405, 64, 574, 574, 575, 576, 575, 574,\n\t574, 577, 578, 574, 579, 580, 581, 580, 580, 582, 582, 582, 582, 582,\n\t582, 582, 582, 582, 582, 580, 574, 583, 584, 583, 574, 574, 585, 585,\n\t585, 585, 585, 585, 585, 585, 585, 585, 585, 585, 585, 585, 585, 585,\n\t585, 585, 577, 574, 578, 586, 587, 586, 588, 588, 588, 588, 588, 588,\n\t588, 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, 577, 584,\n\t578, 584, 577, 578, 589, 590, 591, 589, 589, 592, 592, 592, 592, 592,\n\t592, 592, 592, 592, 592, 593, 592, 592, 592, 592, 592, 592, 592, 592,\n\t592, 592, 592, 592, 592, 593, 593, 594, 594, 594, 594, 594, 594, 594,\n\t594, 594, 594, 594, 594, 594, 594, 594, 64, 64, 64, 594, 594, 594, 594,\n\t594, 594, 64, 64, 594, 594, 594, 64, 64, 64, 576, 576, 584, 586, 595,\n\t576, 576, 64, 596, 597, 597, 597, 597, 596, 596, 64, 64, 598, 598, 598,\n\t26, 30, 64, 64, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599,\n\t599, 64, 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, 64, 599, 599,\n\t599, 64, 599, 599, 64, 599, 599, 599, 599, 599, 599, 599, 64, 64, 599,\n\t599, 599, 64, 64, 64, 64, 64, 84, 66, 84, 64, 64, 64, 64, 514, 514, 514,\n\t514, 514, 514, 514, 514, 514, 514, 514, 514, 514, 64, 64, 64, 274, 600,\n\t600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 601, 601,\n\t601, 601, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602,\n\t602, 602, 602, 602, 602, 601, 64, 64, 64, 64, 64, 274, 274, 274, 274,\n\t274, 133, 64, 64, 603, 603, 603, 603, 603, 603, 603, 603, 603, 603, 603,\n\t603, 603, 64, 64, 64, 604, 604, 604, 604, 604, 604, 604, 604, 604, 64,\n\t64, 64, 64, 64, 64, 64, 605, 605, 605, 605, 605, 605, 605, 605, 605, 605,\n\t605, 605, 605, 605, 605, 64, 606, 606, 606, 606, 64, 64, 64, 64, 607,\n\t607, 607, 607, 607, 607, 607, 607, 607, 608, 607, 607, 607, 607, 607,\n\t607, 607, 607, 608, 64, 64, 64, 64, 64, 609, 609, 609, 609, 609, 609,\n\t609, 609, 609, 609, 609, 609, 609, 609, 64, 610, 611, 611, 611, 611, 611,\n\t611, 611, 611, 611, 611, 611, 611, 64, 64, 64, 64, 612, 613, 613, 613,\n\t613, 613, 64, 64, 614, 614, 614, 614, 614, 614, 614, 614, 615, 615, 615,\n\t615, 615, 615, 615, 615, 616, 616, 616, 616, 616, 616, 616, 616, 617,\n\t617, 617, 617, 617, 617, 617, 617, 617, 617, 617, 617, 617, 617, 64, 64,\n\t618, 618, 618, 618, 618, 618, 618, 618, 618, 618, 64, 64, 64, 64, 64, 64,\n\t619, 619, 619, 619, 619, 619, 64, 64, 619, 64, 619, 619, 619, 619, 619,\n\t619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619,\n\t619, 64, 619, 619, 64, 64, 64, 619, 64, 64, 619, 620, 620, 620, 620, 620,\n\t620, 620, 620, 620, 620, 620, 620, 620, 620, 64, 621, 622, 622, 622, 622,\n\t622, 622, 622, 622, 623, 623, 623, 623, 623, 623, 623, 623, 623, 623,\n\t623, 623, 623, 623, 624, 624, 624, 624, 624, 624, 64, 64, 64, 625, 626,\n\t626, 626, 626, 626, 626, 626, 626, 626, 626, 64, 64, 64, 64, 64, 627,\n\t628, 628, 628, 628, 628, 628, 628, 628, 629, 629, 629, 629, 629, 629,\n\t629, 629, 64, 64, 64, 64, 64, 64, 629, 629, 630, 631, 631, 631, 64, 631,\n\t631, 64, 64, 64, 64, 64, 631, 632, 631, 633, 630, 630, 630, 630, 64, 630,\n\t630, 630, 64, 630, 630, 630, 630, 630, 630, 630, 630, 630, 630, 630, 630,\n\t630, 630, 630, 630, 630, 630, 630, 64, 64, 64, 64, 633, 634, 632, 64, 64,\n\t64, 64, 635, 636, 636, 636, 636, 636, 636, 636, 636, 637, 637, 637, 637,\n\t637, 637, 637, 637, 637, 64, 64, 64, 64, 64, 64, 64, 638, 638, 638, 638,\n\t638, 638, 638, 638, 638, 638, 638, 638, 638, 639, 639, 640, 641, 641,\n\t641, 641, 641, 641, 641, 641, 641, 641, 641, 641, 641, 641, 64, 64, 64,\n\t642, 642, 642, 642, 642, 642, 642, 643, 643, 643, 643, 643, 643, 643,\n\t643, 643, 643, 643, 643, 643, 643, 64, 64, 644, 644, 644, 644, 644, 644,\n\t644, 644, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 645, 64, 64,\n\t64, 64, 64, 646, 646, 646, 646, 646, 646, 646, 646, 647, 647, 647, 647,\n\t647, 647, 647, 647, 647, 64, 64, 64, 64, 64, 64, 64, 648, 648, 648, 648,\n\t648, 648, 648, 648, 648, 648, 648, 648, 648, 648, 648, 64, 649, 650, 649,\n\t651, 651, 651, 651, 651, 651, 651, 651, 651, 651, 651, 651, 651, 650,\n\t650, 650, 650, 650, 650, 650, 650, 650, 650, 650, 650, 650, 650, 652,\n\t653, 653, 653, 653, 653, 653, 653, 64, 64, 64, 64, 654, 654, 654, 654,\n\t654, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654,\n\t654, 654, 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, 656, 656,\n\t657, 658, 658, 658, 658, 658, 658, 658, 658, 658, 658, 658, 658, 658,\n\t657, 657, 657, 656, 656, 656, 656, 657, 657, 659, 660, 661, 661, 662,\n\t661, 661, 661, 661, 64, 64, 64, 64, 64, 64, 663, 663, 663, 663, 663, 663,\n\t663, 663, 663, 64, 64, 64, 64, 64, 64, 64, 664, 664, 664, 664, 664, 664,\n\t664, 664, 664, 664, 64, 64, 64, 64, 64, 64, 665, 665, 665, 666, 666, 666,\n\t666, 666, 666, 666, 666, 666, 666, 666, 666, 666, 666, 666, 666, 666,\n\t666, 666, 666, 667, 667, 667, 667, 667, 668, 667, 667, 667, 667, 667,\n\t667, 669, 669, 64, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 671,\n\t671, 671, 671, 64, 64, 64, 64, 672, 672, 673, 674, 674, 674, 674, 674,\n\t674, 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, 673, 673, 673,\n\t672, 672, 672, 672, 672, 672, 672, 672, 672, 673, 675, 674, 674, 674,\n\t674, 676, 676, 676, 676, 64, 64, 64, 64, 64, 64, 64, 677, 677, 677, 677,\n\t677, 677, 677, 677, 677, 677, 64, 64, 64, 64, 64, 64, 678, 678, 678, 678,\n\t678, 678, 678, 678, 678, 678, 678, 679, 680, 679, 680, 680, 679, 679,\n\t679, 679, 679, 679, 681, 682, 683, 683, 683, 683, 683, 683, 683, 683,\n\t683, 683, 64, 64, 64, 64, 64, 64, 684, 684, 684, 684, 684, 684, 684, 684,\n\t684, 684, 684, 684, 684, 684, 684, 64, 685, 685, 685, 685, 685, 685, 685,\n\t685, 685, 685, 685, 64, 64, 64, 64, 64, 686, 686, 686, 686, 64, 64, 64,\n\t64, 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, 687, 687,\n\t687, 64, 504, 64, 64, 64, 64, 64, 64, 64, 688, 688, 688, 688, 688, 688,\n\t688, 688, 688, 688, 688, 688, 688, 64, 64, 64, 688, 689, 689, 689, 689,\n\t689, 689, 689, 689, 689, 689, 689, 689, 689, 689, 689, 689, 689, 689,\n\t689, 689, 689, 689, 64, 64, 64, 64, 64, 64, 64, 64, 690, 690, 690, 690,\n\t691, 691, 691, 691, 691, 691, 691, 691, 691, 691, 691, 691, 691, 478,\n\t474, 64, 64, 64, 64, 64, 64, 274, 274, 274, 274, 274, 274, 64, 64, 274,\n\t274, 274, 274, 274, 274, 274, 64, 64, 274, 274, 274, 274, 274, 274, 274,\n\t274, 274, 274, 274, 274, 692, 692, 395, 395, 395, 274, 274, 274, 693,\n\t692, 692, 692, 692, 692, 405, 405, 405, 405, 405, 405, 405, 405, 133,\n\t133, 133, 133, 133, 133, 133, 133, 274, 274, 78, 78, 78, 78, 78, 133,\n\t133, 274, 274, 274, 274, 274, 274, 78, 78, 78, 78, 274, 274, 602, 602,\n\t694, 694, 694, 602, 64, 64, 514, 514, 64, 64, 64, 64, 64, 64, 434, 434,\n\t434, 434, 434, 434, 434, 434, 434, 434, 34, 34, 34, 34, 34, 34, 34, 34,\n\t34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 434, 434, 434, 434, 434, 434,\n\t434, 434, 434, 434, 34, 34, 34, 34, 34, 34, 34, 64, 34, 34, 34, 34, 34,\n\t34, 434, 64, 434, 434, 64, 64, 434, 64, 64, 434, 434, 64, 64, 434, 434,\n\t434, 434, 64, 434, 434, 34, 34, 64, 34, 64, 34, 34, 34, 34, 34, 34, 34,\n\t64, 34, 34, 34, 34, 34, 34, 34, 434, 434, 64, 434, 434, 434, 434, 64, 64,\n\t434, 434, 434, 434, 434, 434, 434, 434, 64, 434, 434, 434, 434, 434, 434,\n\t434, 64, 34, 34, 434, 434, 64, 434, 434, 434, 434, 64, 434, 434, 434,\n\t434, 434, 64, 434, 64, 64, 64, 434, 434, 434, 434, 434, 434, 434, 64, 34,\n\t34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 64, 64, 434, 695, 34, 34, 34,\n\t34, 34, 34, 34, 34, 34, 437, 34, 34, 34, 34, 34, 34, 434, 434, 434, 434,\n\t434, 434, 434, 434, 434, 695, 34, 34, 34, 34, 34, 34, 34, 34, 34, 437,\n\t34, 34, 434, 434, 434, 434, 434, 695, 34, 34, 34, 34, 34, 34, 34, 34, 34,\n\t437, 34, 34, 34, 34, 34, 34, 434, 434, 434, 434, 434, 434, 434, 434, 434,\n\t695, 34, 437, 34, 34, 34, 34, 34, 34, 34, 34, 434, 34, 64, 64, 696, 696,\n\t696, 696, 696, 696, 696, 696, 696, 696, 123, 123, 123, 123, 64, 123, 123,\n\t123, 64, 123, 123, 64, 123, 64, 64, 123, 64, 123, 123, 123, 123, 123,\n\t123, 123, 123, 123, 123, 64, 123, 123, 123, 123, 64, 123, 64, 123, 64,\n\t64, 64, 64, 64, 64, 123, 64, 64, 64, 64, 123, 64, 123, 64, 123, 64, 123,\n\t123, 123, 64, 123, 64, 123, 64, 123, 64, 123, 64, 123, 123, 123, 123, 64,\n\t123, 64, 123, 123, 64, 123, 123, 123, 123, 123, 123, 123, 123, 123, 64,\n\t64, 64, 64, 64, 123, 123, 123, 64, 123, 123, 123, 111, 111, 64, 64, 64,\n\t64, 64, 64, 33, 33, 33, 64, 64, 64, 64, 64, 445, 445, 445, 445, 445, 445,\n\t274, 64, 445, 445, 26, 26, 64, 64, 64, 64, 445, 445, 445, 64, 64, 64, 64,\n\t64, 64, 64, 64, 64, 64, 64, 274, 274, 697, 481, 481, 64, 64, 64, 64, 64,\n\t481, 481, 481, 64, 64, 64, 64, 64, 481, 64, 64, 64, 64, 64, 64, 64, 481,\n\t481, 64, 64, 64, 64, 64, 64, 26, 64, 64, 64, 64, 64, 64, 64, 26, 26, 26,\n\t26, 26, 26, 64, 26, 26, 26, 26, 26, 26, 64, 64, 64, 26, 26, 26, 26, 26,\n\t64, 26, 26, 26, 64, 26, 26, 26, 26, 26, 26, 64, 26, 26, 26, 26, 64, 64,\n\t64, 26, 26, 26, 26, 26, 26, 64, 64, 64, 64, 64, 26, 26, 26, 26, 26, 26,\n\t64, 64, 64, 64, 26, 26, 26, 489, 489, 489, 489, 489, 489, 488, 490, 490,\n\t490, 490, 490, 490, 490, 64, 64, 64, 405, 64, 64, 64, 64, 64, 64, 405,\n\t405, 405, 405, 405, 405, 405, 405, 561, 561, 561, 561, 561, 560, 64, 64,\n};\n\n/* decomposition data */\nstatic const unsigned short decomp_data[] = {\n\t0, 257, 32, 514, 32, 776, 259, 97, 514, 32, 772, 259, 50, 259, 51, 514,\n\t32, 769, 258, 956, 514, 32, 807, 259, 49, 259, 111, 772, 49, 8260, 52,\n\t772, 49, 8260, 50, 772, 51, 8260, 52, 512, 65, 768, 512, 65, 769, 512,\n\t65, 770, 512, 65, 771, 512, 65, 776, 512, 65, 778, 512, 67, 807, 512, 69,\n\t768, 512, 69, 769, 512, 69, 770, 512, 69, 776, 512, 73, 768, 512, 73,\n\t769, 512, 73, 770, 512, 73, 776, 512, 78, 771, 512, 79, 768, 512, 79,\n\t769, 512, 79, 770, 512, 79, 771, 512, 79, 776, 512, 85, 768, 512, 85,\n\t769, 512, 85, 770, 512, 85, 776, 512, 89, 769, 512, 97, 768, 512, 97,\n\t769, 512, 97, 770, 512, 97, 771, 512, 97, 776, 512, 97, 778, 512, 99,\n\t807, 512, 101, 768, 512, 101, 769, 512, 101, 770, 512, 101, 776, 512,\n\t105, 768, 512, 105, 769, 512, 105, 770, 512, 105, 776, 512, 110, 771,\n\t512, 111, 768, 512, 111, 769, 512, 111, 770, 512, 111, 771, 512, 111,\n\t776, 512, 117, 768, 512, 117, 769, 512, 117, 770, 512, 117, 776, 512,\n\t121, 769, 512, 121, 776, 512, 65, 772, 512, 97, 772, 512, 65, 774, 512,\n\t97, 774, 512, 65, 808, 512, 97, 808, 512, 67, 769, 512, 99, 769, 512, 67,\n\t770, 512, 99, 770, 512, 67, 775, 512, 99, 775, 512, 67, 780, 512, 99,\n\t780, 512, 68, 780, 512, 100, 780, 512, 69, 772, 512, 101, 772, 512, 69,\n\t774, 512, 101, 774, 512, 69, 775, 512, 101, 775, 512, 69, 808, 512, 101,\n\t808, 512, 69, 780, 512, 101, 780, 512, 71, 770, 512, 103, 770, 512, 71,\n\t774, 512, 103, 774, 512, 71, 775, 512, 103, 775, 512, 71, 807, 512, 103,\n\t807, 512, 72, 770, 512, 104, 770, 512, 73, 771, 512, 105, 771, 512, 73,\n\t772, 512, 105, 772, 512, 73, 774, 512, 105, 774, 512, 73, 808, 512, 105,\n\t808, 512, 73, 775, 514, 73, 74, 514, 105, 106, 512, 74, 770, 512, 106,\n\t770, 512, 75, 807, 512, 107, 807, 512, 76, 769, 512, 108, 769, 512, 76,\n\t807, 512, 108, 807, 512, 76, 780, 512, 108, 780, 514, 76, 183, 514, 108,\n\t183, 512, 78, 769, 512, 110, 769, 512, 78, 807, 512, 110, 807, 512, 78,\n\t780, 512, 110, 780, 514, 700, 110, 512, 79, 772, 512, 111, 772, 512, 79,\n\t774, 512, 111, 774, 512, 79, 779, 512, 111, 779, 512, 82, 769, 512, 114,\n\t769, 512, 82, 807, 512, 114, 807, 512, 82, 780, 512, 114, 780, 512, 83,\n\t769, 512, 115, 769, 512, 83, 770, 512, 115, 770, 512, 83, 807, 512, 115,\n\t807, 512, 83, 780, 512, 115, 780, 512, 84, 807, 512, 116, 807, 512, 84,\n\t780, 512, 116, 780, 512, 85, 771, 512, 117, 771, 512, 85, 772, 512, 117,\n\t772, 512, 85, 774, 512, 117, 774, 512, 85, 778, 512, 117, 778, 512, 85,\n\t779, 512, 117, 779, 512, 85, 808, 512, 117, 808, 512, 87, 770, 512, 119,\n\t770, 512, 89, 770, 512, 121, 770, 512, 89, 776, 512, 90, 769, 512, 122,\n\t769, 512, 90, 775, 512, 122, 775, 512, 90, 780, 512, 122, 780, 258, 115,\n\t512, 79, 795, 512, 111, 795, 512, 85, 795, 512, 117, 795, 514, 68, 381,\n\t514, 68, 382, 514, 100, 382, 514, 76, 74, 514, 76, 106, 514, 108, 106,\n\t514, 78, 74, 514, 78, 106, 514, 110, 106, 512, 65, 780, 512, 97, 780,\n\t512, 73, 780, 512, 105, 780, 512, 79, 780, 512, 111, 780, 512, 85, 780,\n\t512, 117, 780, 512, 220, 772, 512, 252, 772, 512, 220, 769, 512, 252,\n\t769, 512, 220, 780, 512, 252, 780, 512, 220, 768, 512, 252, 768, 512,\n\t196, 772, 512, 228, 772, 512, 550, 772, 512, 551, 772, 512, 198, 772,\n\t512, 230, 772, 512, 71, 780, 512, 103, 780, 512, 75, 780, 512, 107, 780,\n\t512, 79, 808, 512, 111, 808, 512, 490, 772, 512, 491, 772, 512, 439, 780,\n\t512, 658, 780, 512, 106, 780, 514, 68, 90, 514, 68, 122, 514, 100, 122,\n\t512, 71, 769, 512, 103, 769, 512, 78, 768, 512, 110, 768, 512, 197, 769,\n\t512, 229, 769, 512, 198, 769, 512, 230, 769, 512, 216, 769, 512, 248,\n\t769, 512, 65, 783, 512, 97, 783, 512, 65, 785, 512, 97, 785, 512, 69,\n\t783, 512, 101, 783, 512, 69, 785, 512, 101, 785, 512, 73, 783, 512, 105,\n\t783, 512, 73, 785, 512, 105, 785, 512, 79, 783, 512, 111, 783, 512, 79,\n\t785, 512, 111, 785, 512, 82, 783, 512, 114, 783, 512, 82, 785, 512, 114,\n\t785, 512, 85, 783, 512, 117, 783, 512, 85, 785, 512, 117, 785, 512, 83,\n\t806, 512, 115, 806, 512, 84, 806, 512, 116, 806, 512, 72, 780, 512, 104,\n\t780, 512, 65, 775, 512, 97, 775, 512, 69, 807, 512, 101, 807, 512, 214,\n\t772, 512, 246, 772, 512, 213, 772, 512, 245, 772, 512, 79, 775, 512, 111,\n\t775, 512, 558, 772, 512, 559, 772, 512, 89, 772, 512, 121, 772, 259, 104,\n\t259, 614, 259, 106, 259, 114, 259, 633, 259, 635, 259, 641, 259, 119,\n\t259, 121, 514, 32, 774, 514, 32, 775, 514, 32, 778, 514, 32, 808, 514,\n\t32, 771, 514, 32, 779, 259, 611, 259, 108, 259, 115, 259, 120, 259, 661,\n\t256, 768, 256, 769, 256, 787, 512, 776, 769, 256, 697, 514, 32, 837, 256,\n\t59, 514, 32, 769, 512, 168, 769, 512, 913, 769, 256, 183, 512, 917, 769,\n\t512, 919, 769, 512, 921, 769, 512, 927, 769, 512, 933, 769, 512, 937,\n\t769, 512, 970, 769, 512, 921, 776, 512, 933, 776, 512, 945, 769, 512,\n\t949, 769, 512, 951, 769, 512, 953, 769, 512, 971, 769, 512, 953, 776,\n\t512, 965, 776, 512, 959, 769, 512, 965, 769, 512, 969, 769, 258, 946,\n\t258, 952, 258, 933, 512, 978, 769, 512, 978, 776, 258, 966, 258, 960,\n\t258, 954, 258, 961, 258, 962, 258, 920, 258, 949, 258, 931, 512, 1045,\n\t768, 512, 1045, 776, 512, 1043, 769, 512, 1030, 776, 512, 1050, 769, 512,\n\t1048, 768, 512, 1059, 774, 512, 1048, 774, 512, 1080, 774, 512, 1077,\n\t768, 512, 1077, 776, 512, 1075, 769, 512, 1110, 776, 512, 1082, 769, 512,\n\t1080, 768, 512, 1091, 774, 512, 1140, 783, 512, 1141, 783, 512, 1046,\n\t774, 512, 1078, 774, 512, 1040, 774, 512, 1072, 774, 512, 1040, 776, 512,\n\t1072, 776, 512, 1045, 774, 512, 1077, 774, 512, 1240, 776, 512, 1241,\n\t776, 512, 1046, 776, 512, 1078, 776, 512, 1047, 776, 512, 1079, 776, 512,\n\t1048, 772, 512, 1080, 772, 512, 1048, 776, 512, 1080, 776, 512, 1054,\n\t776, 512, 1086, 776, 512, 1256, 776, 512, 1257, 776, 512, 1069, 776, 512,\n\t1101, 776, 512, 1059, 772, 512, 1091, 772, 512, 1059, 776, 512, 1091,\n\t776, 512, 1059, 779, 512, 1091, 779, 512, 1063, 776, 512, 1095, 776, 512,\n\t1067, 776, 512, 1099, 776, 514, 1381, 1410, 512, 1575, 1619, 512, 1575,\n\t1620, 512, 1608, 1620, 512, 1575, 1621, 512, 1610, 1620, 514, 1575, 1652,\n\t514, 1608, 1652, 514, 1735, 1652, 514, 1610, 1652, 512, 1749, 1620, 512,\n\t1729, 1620, 512, 1746, 1620, 512, 2344, 2364, 512, 2352, 2364, 512, 2355,\n\t2364, 512, 2325, 2364, 512, 2326, 2364, 512, 2327, 2364, 512, 2332, 2364,\n\t512, 2337, 2364, 512, 2338, 2364, 512, 2347, 2364, 512, 2351, 2364, 512,\n\t2503, 2494, 512, 2503, 2519, 512, 2465, 2492, 512, 2466, 2492, 512, 2479,\n\t2492, 512, 2610, 2620, 512, 2616, 2620, 512, 2582, 2620, 512, 2583, 2620,\n\t512, 2588, 2620, 512, 2603, 2620, 512, 2887, 2902, 512, 2887, 2878, 512,\n\t2887, 2903, 512, 2849, 2876, 512, 2850, 2876, 512, 2962, 3031, 512, 3014,\n\t3006, 512, 3015, 3006, 512, 3014, 3031, 512, 3142, 3158, 512, 3263, 3285,\n\t512, 3270, 3285, 512, 3270, 3286, 512, 3270, 3266, 512, 3274, 3285, 512,\n\t3398, 3390, 512, 3399, 3390, 512, 3398, 3415, 512, 3545, 3530, 512, 3545,\n\t3535, 512, 3548, 3530, 512, 3545, 3551, 514, 3661, 3634, 514, 3789, 3762,\n\t514, 3755, 3737, 514, 3755, 3745, 257, 3851, 512, 3906, 4023, 512, 3916,\n\t4023, 512, 3921, 4023, 512, 3926, 4023, 512, 3931, 4023, 512, 3904, 4021,\n\t512, 3953, 3954, 512, 3953, 3956, 512, 4018, 3968, 514, 4018, 3969, 512,\n\t4019, 3968, 514, 4019, 3969, 512, 3953, 3968, 512, 3986, 4023, 512, 3996,\n\t4023, 512, 4001, 4023, 512, 4006, 4023, 512, 4011, 4023, 512, 3984, 4021,\n\t512, 4133, 4142, 259, 4316, 512, 6917, 6965, 512, 6919, 6965, 512, 6921,\n\t6965, 512, 6923, 6965, 512, 6925, 6965, 512, 6929, 6965, 512, 6970, 6965,\n\t512, 6972, 6965, 512, 6974, 6965, 512, 6975, 6965, 512, 6978, 6965, 259,\n\t65, 259, 198, 259, 66, 259, 68, 259, 69, 259, 398, 259, 71, 259, 72, 259,\n\t73, 259, 74, 259, 75, 259, 76, 259, 77, 259, 78, 259, 79, 259, 546, 259,\n\t80, 259, 82, 259, 84, 259, 85, 259, 87, 259, 97, 259, 592, 259, 593, 259,\n\t7426, 259, 98, 259, 100, 259, 101, 259, 601, 259, 603, 259, 604, 259,\n\t103, 259, 107, 259, 109, 259, 331, 259, 111, 259, 596, 259, 7446, 259,\n\t7447, 259, 112, 259, 116, 259, 117, 259, 7453, 259, 623, 259, 118, 259,\n\t7461, 259, 946, 259, 947, 259, 948, 259, 966, 259, 967, 261, 105, 261,\n\t114, 261, 117, 261, 118, 261, 946, 261, 947, 261, 961, 261, 966, 261,\n\t967, 259, 1085, 259, 594, 259, 99, 259, 597, 259, 240, 259, 604, 259,\n\t102, 259, 607, 259, 609, 259, 613, 259, 616, 259, 617, 259, 618, 259,\n\t7547, 259, 669, 259, 621, 259, 7557, 259, 671, 259, 625, 259, 624, 259,\n\t626, 259, 627, 259, 628, 259, 629, 259, 632, 259, 642, 259, 643, 259,\n\t427, 259, 649, 259, 650, 259, 7452, 259, 651, 259, 652, 259, 122, 259,\n\t656, 259, 657, 259, 658, 259, 952, 512, 65, 805, 512, 97, 805, 512, 66,\n\t775, 512, 98, 775, 512, 66, 803, 512, 98, 803, 512, 66, 817, 512, 98,\n\t817, 512, 199, 769, 512, 231, 769, 512, 68, 775, 512, 100, 775, 512, 68,\n\t803, 512, 100, 803, 512, 68, 817, 512, 100, 817, 512, 68, 807, 512, 100,\n\t807, 512, 68, 813, 512, 100, 813, 512, 274, 768, 512, 275, 768, 512, 274,\n\t769, 512, 275, 769, 512, 69, 813, 512, 101, 813, 512, 69, 816, 512, 101,\n\t816, 512, 552, 774, 512, 553, 774, 512, 70, 775, 512, 102, 775, 512, 71,\n\t772, 512, 103, 772, 512, 72, 775, 512, 104, 775, 512, 72, 803, 512, 104,\n\t803, 512, 72, 776, 512, 104, 776, 512, 72, 807, 512, 104, 807, 512, 72,\n\t814, 512, 104, 814, 512, 73, 816, 512, 105, 816, 512, 207, 769, 512, 239,\n\t769, 512, 75, 769, 512, 107, 769, 512, 75, 803, 512, 107, 803, 512, 75,\n\t817, 512, 107, 817, 512, 76, 803, 512, 108, 803, 512, 7734, 772, 512,\n\t7735, 772, 512, 76, 817, 512, 108, 817, 512, 76, 813, 512, 108, 813, 512,\n\t77, 769, 512, 109, 769, 512, 77, 775, 512, 109, 775, 512, 77, 803, 512,\n\t109, 803, 512, 78, 775, 512, 110, 775, 512, 78, 803, 512, 110, 803, 512,\n\t78, 817, 512, 110, 817, 512, 78, 813, 512, 110, 813, 512, 213, 769, 512,\n\t245, 769, 512, 213, 776, 512, 245, 776, 512, 332, 768, 512, 333, 768,\n\t512, 332, 769, 512, 333, 769, 512, 80, 769, 512, 112, 769, 512, 80, 775,\n\t512, 112, 775, 512, 82, 775, 512, 114, 775, 512, 82, 803, 512, 114, 803,\n\t512, 7770, 772, 512, 7771, 772, 512, 82, 817, 512, 114, 817, 512, 83,\n\t775, 512, 115, 775, 512, 83, 803, 512, 115, 803, 512, 346, 775, 512, 347,\n\t775, 512, 352, 775, 512, 353, 775, 512, 7778, 775, 512, 7779, 775, 512,\n\t84, 775, 512, 116, 775, 512, 84, 803, 512, 116, 803, 512, 84, 817, 512,\n\t116, 817, 512, 84, 813, 512, 116, 813, 512, 85, 804, 512, 117, 804, 512,\n\t85, 816, 512, 117, 816, 512, 85, 813, 512, 117, 813, 512, 360, 769, 512,\n\t361, 769, 512, 362, 776, 512, 363, 776, 512, 86, 771, 512, 118, 771, 512,\n\t86, 803, 512, 118, 803, 512, 87, 768, 512, 119, 768, 512, 87, 769, 512,\n\t119, 769, 512, 87, 776, 512, 119, 776, 512, 87, 775, 512, 119, 775, 512,\n\t87, 803, 512, 119, 803, 512, 88, 775, 512, 120, 775, 512, 88, 776, 512,\n\t120, 776, 512, 89, 775, 512, 121, 775, 512, 90, 770, 512, 122, 770, 512,\n\t90, 803, 512, 122, 803, 512, 90, 817, 512, 122, 817, 512, 104, 817, 512,\n\t116, 776, 512, 119, 778, 512, 121, 778, 514, 97, 702, 512, 383, 775, 512,\n\t65, 803, 512, 97, 803, 512, 65, 777, 512, 97, 777, 512, 194, 769, 512,\n\t226, 769, 512, 194, 768, 512, 226, 768, 512, 194, 777, 512, 226, 777,\n\t512, 194, 771, 512, 226, 771, 512, 7840, 770, 512, 7841, 770, 512, 258,\n\t769, 512, 259, 769, 512, 258, 768, 512, 259, 768, 512, 258, 777, 512,\n\t259, 777, 512, 258, 771, 512, 259, 771, 512, 7840, 774, 512, 7841, 774,\n\t512, 69, 803, 512, 101, 803, 512, 69, 777, 512, 101, 777, 512, 69, 771,\n\t512, 101, 771, 512, 202, 769, 512, 234, 769, 512, 202, 768, 512, 234,\n\t768, 512, 202, 777, 512, 234, 777, 512, 202, 771, 512, 234, 771, 512,\n\t7864, 770, 512, 7865, 770, 512, 73, 777, 512, 105, 777, 512, 73, 803,\n\t512, 105, 803, 512, 79, 803, 512, 111, 803, 512, 79, 777, 512, 111, 777,\n\t512, 212, 769, 512, 244, 769, 512, 212, 768, 512, 244, 768, 512, 212,\n\t777, 512, 244, 777, 512, 212, 771, 512, 244, 771, 512, 7884, 770, 512,\n\t7885, 770, 512, 416, 769, 512, 417, 769, 512, 416, 768, 512, 417, 768,\n\t512, 416, 777, 512, 417, 777, 512, 416, 771, 512, 417, 771, 512, 416,\n\t803, 512, 417, 803, 512, 85, 803, 512, 117, 803, 512, 85, 777, 512, 117,\n\t777, 512, 431, 769, 512, 432, 769, 512, 431, 768, 512, 432, 768, 512,\n\t431, 777, 512, 432, 777, 512, 431, 771, 512, 432, 771, 512, 431, 803,\n\t512, 432, 803, 512, 89, 768, 512, 121, 768, 512, 89, 803, 512, 121, 803,\n\t512, 89, 777, 512, 121, 777, 512, 89, 771, 512, 121, 771, 512, 945, 787,\n\t512, 945, 788, 512, 7936, 768, 512, 7937, 768, 512, 7936, 769, 512, 7937,\n\t769, 512, 7936, 834, 512, 7937, 834, 512, 913, 787, 512, 913, 788, 512,\n\t7944, 768, 512, 7945, 768, 512, 7944, 769, 512, 7945, 769, 512, 7944,\n\t834, 512, 7945, 834, 512, 949, 787, 512, 949, 788, 512, 7952, 768, 512,\n\t7953, 768, 512, 7952, 769, 512, 7953, 769, 512, 917, 787, 512, 917, 788,\n\t512, 7960, 768, 512, 7961, 768, 512, 7960, 769, 512, 7961, 769, 512, 951,\n\t787, 512, 951, 788, 512, 7968, 768, 512, 7969, 768, 512, 7968, 769, 512,\n\t7969, 769, 512, 7968, 834, 512, 7969, 834, 512, 919, 787, 512, 919, 788,\n\t512, 7976, 768, 512, 7977, 768, 512, 7976, 769, 512, 7977, 769, 512,\n\t7976, 834, 512, 7977, 834, 512, 953, 787, 512, 953, 788, 512, 7984, 768,\n\t512, 7985, 768, 512, 7984, 769, 512, 7985, 769, 512, 7984, 834, 512,\n\t7985, 834, 512, 921, 787, 512, 921, 788, 512, 7992, 768, 512, 7993, 768,\n\t512, 7992, 769, 512, 7993, 769, 512, 7992, 834, 512, 7993, 834, 512, 959,\n\t787, 512, 959, 788, 512, 8000, 768, 512, 8001, 768, 512, 8000, 769, 512,\n\t8001, 769, 512, 927, 787, 512, 927, 788, 512, 8008, 768, 512, 8009, 768,\n\t512, 8008, 769, 512, 8009, 769, 512, 965, 787, 512, 965, 788, 512, 8016,\n\t768, 512, 8017, 768, 512, 8016, 769, 512, 8017, 769, 512, 8016, 834, 512,\n\t8017, 834, 512, 933, 788, 512, 8025, 768, 512, 8025, 769, 512, 8025, 834,\n\t512, 969, 787, 512, 969, 788, 512, 8032, 768, 512, 8033, 768, 512, 8032,\n\t769, 512, 8033, 769, 512, 8032, 834, 512, 8033, 834, 512, 937, 787, 512,\n\t937, 788, 512, 8040, 768, 512, 8041, 768, 512, 8040, 769, 512, 8041, 769,\n\t512, 8040, 834, 512, 8041, 834, 512, 945, 768, 256, 940, 512, 949, 768,\n\t256, 941, 512, 951, 768, 256, 942, 512, 953, 768, 256, 943, 512, 959,\n\t768, 256, 972, 512, 965, 768, 256, 973, 512, 969, 768, 256, 974, 512,\n\t7936, 837, 512, 7937, 837, 512, 7938, 837, 512, 7939, 837, 512, 7940,\n\t837, 512, 7941, 837, 512, 7942, 837, 512, 7943, 837, 512, 7944, 837, 512,\n\t7945, 837, 512, 7946, 837, 512, 7947, 837, 512, 7948, 837, 512, 7949,\n\t837, 512, 7950, 837, 512, 7951, 837, 512, 7968, 837, 512, 7969, 837, 512,\n\t7970, 837, 512, 7971, 837, 512, 7972, 837, 512, 7973, 837, 512, 7974,\n\t837, 512, 7975, 837, 512, 7976, 837, 512, 7977, 837, 512, 7978, 837, 512,\n\t7979, 837, 512, 7980, 837, 512, 7981, 837, 512, 7982, 837, 512, 7983,\n\t837, 512, 8032, 837, 512, 8033, 837, 512, 8034, 837, 512, 8035, 837, 512,\n\t8036, 837, 512, 8037, 837, 512, 8038, 837, 512, 8039, 837, 512, 8040,\n\t837, 512, 8041, 837, 512, 8042, 837, 512, 8043, 837, 512, 8044, 837, 512,\n\t8045, 837, 512, 8046, 837, 512, 8047, 837, 512, 945, 774, 512, 945, 772,\n\t512, 8048, 837, 512, 945, 837, 512, 940, 837, 512, 945, 834, 512, 8118,\n\t837, 512, 913, 774, 512, 913, 772, 512, 913, 768, 256, 902, 512, 913,\n\t837, 514, 32, 787, 256, 953, 514, 32, 787, 514, 32, 834, 512, 168, 834,\n\t512, 8052, 837, 512, 951, 837, 512, 942, 837, 512, 951, 834, 512, 8134,\n\t837, 512, 917, 768, 256, 904, 512, 919, 768, 256, 905, 512, 919, 837,\n\t512, 8127, 768, 512, 8127, 769, 512, 8127, 834, 512, 953, 774, 512, 953,\n\t772, 512, 970, 768, 256, 912, 512, 953, 834, 512, 970, 834, 512, 921,\n\t774, 512, 921, 772, 512, 921, 768, 256, 906, 512, 8190, 768, 512, 8190,\n\t769, 512, 8190, 834, 512, 965, 774, 512, 965, 772, 512, 971, 768, 256,\n\t944, 512, 961, 787, 512, 961, 788, 512, 965, 834, 512, 971, 834, 512,\n\t933, 774, 512, 933, 772, 512, 933, 768, 256, 910, 512, 929, 788, 512,\n\t168, 768, 256, 901, 256, 96, 512, 8060, 837, 512, 969, 837, 512, 974,\n\t837, 512, 969, 834, 512, 8182, 837, 512, 927, 768, 256, 908, 512, 937,\n\t768, 256, 911, 512, 937, 837, 256, 180, 514, 32, 788, 256, 8194, 256,\n\t8195, 258, 32, 258, 32, 258, 32, 258, 32, 258, 32, 257, 32, 258, 32, 258,\n\t32, 258, 32, 257, 8208, 514, 32, 819, 258, 46, 514, 46, 46, 770, 46, 46,\n\t46, 257, 32, 514, 8242, 8242, 770, 8242, 8242, 8242, 514, 8245, 8245,\n\t770, 8245, 8245, 8245, 514, 33, 33, 514, 32, 773, 514, 63, 63, 514, 63,\n\t33, 514, 33, 63, 1026, 8242, 8242, 8242, 8242, 258, 32, 259, 48, 259,\n\t105, 259, 52, 259, 53, 259, 54, 259, 55, 259, 56, 259, 57, 259, 43, 259,\n\t8722, 259, 61, 259, 40, 259, 41, 259, 110, 261, 48, 261, 49, 261, 50,\n\t261, 51, 261, 52, 261, 53, 261, 54, 261, 55, 261, 56, 261, 57, 261, 43,\n\t261, 8722, 261, 61, 261, 40, 261, 41, 261, 97, 261, 101, 261, 111, 261,\n\t120, 261, 601, 261, 104, 261, 107, 261, 108, 261, 109, 261, 110, 261,\n\t112, 261, 115, 261, 116, 514, 82, 115, 770, 97, 47, 99, 770, 97, 47, 115,\n\t262, 67, 514, 176, 67, 770, 99, 47, 111, 770, 99, 47, 117, 258, 400, 514,\n\t176, 70, 262, 103, 262, 72, 262, 72, 262, 72, 262, 104, 262, 295, 262,\n\t73, 262, 73, 262, 76, 262, 108, 262, 78, 514, 78, 111, 262, 80, 262, 81,\n\t262, 82, 262, 82, 262, 82, 515, 83, 77, 770, 84, 69, 76, 515, 84, 77,\n\t262, 90, 256, 937, 262, 90, 256, 75, 256, 197, 262, 66, 262, 67, 262,\n\t101, 262, 69, 262, 70, 262, 77, 262, 111, 258, 1488, 258, 1489, 258,\n\t1490, 258, 1491, 262, 105, 770, 70, 65, 88, 262, 960, 262, 947, 262, 915,\n\t262, 928, 262, 8721, 262, 68, 262, 100, 262, 101, 262, 105, 262, 106,\n\t772, 49, 8260, 55, 772, 49, 8260, 57, 1028, 49, 8260, 49, 48, 772, 49,\n\t8260, 51, 772, 50, 8260, 51, 772, 49, 8260, 53, 772, 50, 8260, 53, 772,\n\t51, 8260, 53, 772, 52, 8260, 53, 772, 49, 8260, 54, 772, 53, 8260, 54,\n\t772, 49, 8260, 56, 772, 51, 8260, 56, 772, 53, 8260, 56, 772, 55, 8260,\n\t56, 516, 49, 8260, 258, 73, 514, 73, 73, 770, 73, 73, 73, 514, 73, 86,\n\t258, 86, 514, 86, 73, 770, 86, 73, 73, 1026, 86, 73, 73, 73, 514, 73, 88,\n\t258, 88, 514, 88, 73, 770, 88, 73, 73, 258, 76, 258, 67, 258, 68, 258,\n\t77, 258, 105, 514, 105, 105, 770, 105, 105, 105, 514, 105, 118, 258, 118,\n\t514, 118, 105, 770, 118, 105, 105, 1026, 118, 105, 105, 105, 514, 105,\n\t120, 258, 120, 514, 120, 105, 770, 120, 105, 105, 258, 108, 258, 99, 258,\n\t100, 258, 109, 772, 48, 8260, 51, 512, 8592, 824, 512, 8594, 824, 512,\n\t8596, 824, 512, 8656, 824, 512, 8660, 824, 512, 8658, 824, 512, 8707,\n\t824, 512, 8712, 824, 512, 8715, 824, 512, 8739, 824, 512, 8741, 824, 514,\n\t8747, 8747, 770, 8747, 8747, 8747, 514, 8750, 8750, 770, 8750, 8750,\n\t8750, 512, 8764, 824, 512, 8771, 824, 512, 8773, 824, 512, 8776, 824,\n\t512, 61, 824, 512, 8801, 824, 512, 8781, 824, 512, 60, 824, 512, 62, 824,\n\t512, 8804, 824, 512, 8805, 824, 512, 8818, 824, 512, 8819, 824, 512,\n\t8822, 824, 512, 8823, 824, 512, 8826, 824, 512, 8827, 824, 512, 8834,\n\t824, 512, 8835, 824, 512, 8838, 824, 512, 8839, 824, 512, 8866, 824, 512,\n\t8872, 824, 512, 8873, 824, 512, 8875, 824, 512, 8828, 824, 512, 8829,\n\t824, 512, 8849, 824, 512, 8850, 824, 512, 8882, 824, 512, 8883, 824, 512,\n\t8884, 824, 512, 8885, 824, 256, 12296, 256, 12297, 263, 49, 263, 50, 263,\n\t51, 263, 52, 263, 53, 263, 54, 263, 55, 263, 56, 263, 57, 519, 49, 48,\n\t519, 49, 49, 519, 49, 50, 519, 49, 51, 519, 49, 52, 519, 49, 53, 519, 49,\n\t54, 519, 49, 55, 519, 49, 56, 519, 49, 57, 519, 50, 48, 770, 40, 49, 41,\n\t770, 40, 50, 41, 770, 40, 51, 41, 770, 40, 52, 41, 770, 40, 53, 41, 770,\n\t40, 54, 41, 770, 40, 55, 41, 770, 40, 56, 41, 770, 40, 57, 41, 1026, 40,\n\t49, 48, 41, 1026, 40, 49, 49, 41, 1026, 40, 49, 50, 41, 1026, 40, 49, 51,\n\t41, 1026, 40, 49, 52, 41, 1026, 40, 49, 53, 41, 1026, 40, 49, 54, 41,\n\t1026, 40, 49, 55, 41, 1026, 40, 49, 56, 41, 1026, 40, 49, 57, 41, 1026,\n\t40, 50, 48, 41, 514, 49, 46, 514, 50, 46, 514, 51, 46, 514, 52, 46, 514,\n\t53, 46, 514, 54, 46, 514, 55, 46, 514, 56, 46, 514, 57, 46, 770, 49, 48,\n\t46, 770, 49, 49, 46, 770, 49, 50, 46, 770, 49, 51, 46, 770, 49, 52, 46,\n\t770, 49, 53, 46, 770, 49, 54, 46, 770, 49, 55, 46, 770, 49, 56, 46, 770,\n\t49, 57, 46, 770, 50, 48, 46, 770, 40, 97, 41, 770, 40, 98, 41, 770, 40,\n\t99, 41, 770, 40, 100, 41, 770, 40, 101, 41, 770, 40, 102, 41, 770, 40,\n\t103, 41, 770, 40, 104, 41, 770, 40, 105, 41, 770, 40, 106, 41, 770, 40,\n\t107, 41, 770, 40, 108, 41, 770, 40, 109, 41, 770, 40, 110, 41, 770, 40,\n\t111, 41, 770, 40, 112, 41, 770, 40, 113, 41, 770, 40, 114, 41, 770, 40,\n\t115, 41, 770, 40, 116, 41, 770, 40, 117, 41, 770, 40, 118, 41, 770, 40,\n\t119, 41, 770, 40, 120, 41, 770, 40, 121, 41, 770, 40, 122, 41, 263, 65,\n\t263, 66, 263, 67, 263, 68, 263, 69, 263, 70, 263, 71, 263, 72, 263, 73,\n\t263, 74, 263, 75, 263, 76, 263, 77, 263, 78, 263, 79, 263, 80, 263, 81,\n\t263, 82, 263, 83, 263, 84, 263, 85, 263, 86, 263, 87, 263, 88, 263, 89,\n\t263, 90, 263, 97, 263, 98, 263, 99, 263, 100, 263, 101, 263, 102, 263,\n\t103, 263, 104, 263, 105, 263, 106, 263, 107, 263, 108, 263, 109, 263,\n\t110, 263, 111, 263, 112, 263, 113, 263, 114, 263, 115, 263, 116, 263,\n\t117, 263, 118, 263, 119, 263, 120, 263, 121, 263, 122, 263, 48, 1026,\n\t8747, 8747, 8747, 8747, 770, 58, 58, 61, 514, 61, 61, 770, 61, 61, 61,\n\t512, 10973, 824, 261, 106, 259, 86, 259, 11617, 258, 27597, 258, 40863,\n\t258, 19968, 258, 20008, 258, 20022, 258, 20031, 258, 20057, 258, 20101,\n\t258, 20108, 258, 20128, 258, 20154, 258, 20799, 258, 20837, 258, 20843,\n\t258, 20866, 258, 20886, 258, 20907, 258, 20960, 258, 20981, 258, 20992,\n\t258, 21147, 258, 21241, 258, 21269, 258, 21274, 258, 21304, 258, 21313,\n\t258, 21340, 258, 21353, 258, 21378, 258, 21430, 258, 21448, 258, 21475,\n\t258, 22231, 258, 22303, 258, 22763, 258, 22786, 258, 22794, 258, 22805,\n\t258, 22823, 258, 22899, 258, 23376, 258, 23424, 258, 23544, 258, 23567,\n\t258, 23586, 258, 23608, 258, 23662, 258, 23665, 258, 24027, 258, 24037,\n\t258, 24049, 258, 24062, 258, 24178, 258, 24186, 258, 24191, 258, 24308,\n\t258, 24318, 258, 24331, 258, 24339, 258, 24400, 258, 24417, 258, 24435,\n\t258, 24515, 258, 25096, 258, 25142, 258, 25163, 258, 25903, 258, 25908,\n\t258, 25991, 258, 26007, 258, 26020, 258, 26041, 258, 26080, 258, 26085,\n\t258, 26352, 258, 26376, 258, 26408, 258, 27424, 258, 27490, 258, 27513,\n\t258, 27571, 258, 27595, 258, 27604, 258, 27611, 258, 27663, 258, 27668,\n\t258, 27700, 258, 28779, 258, 29226, 258, 29238, 258, 29243, 258, 29247,\n\t258, 29255, 258, 29273, 258, 29275, 258, 29356, 258, 29572, 258, 29577,\n\t258, 29916, 258, 29926, 258, 29976, 258, 29983, 258, 29992, 258, 30000,\n\t258, 30091, 258, 30098, 258, 30326, 258, 30333, 258, 30382, 258, 30399,\n\t258, 30446, 258, 30683, 258, 30690, 258, 30707, 258, 31034, 258, 31160,\n\t258, 31166, 258, 31348, 258, 31435, 258, 31481, 258, 31859, 258, 31992,\n\t258, 32566, 258, 32593, 258, 32650, 258, 32701, 258, 32769, 258, 32780,\n\t258, 32786, 258, 32819, 258, 32895, 258, 32905, 258, 33251, 258, 33258,\n\t258, 33267, 258, 33276, 258, 33292, 258, 33307, 258, 33311, 258, 33390,\n\t258, 33394, 258, 33400, 258, 34381, 258, 34411, 258, 34880, 258, 34892,\n\t258, 34915, 258, 35198, 258, 35211, 258, 35282, 258, 35328, 258, 35895,\n\t258, 35910, 258, 35925, 258, 35960, 258, 35997, 258, 36196, 258, 36208,\n\t258, 36275, 258, 36523, 258, 36554, 258, 36763, 258, 36784, 258, 36789,\n\t258, 37009, 258, 37193, 258, 37318, 258, 37324, 258, 37329, 258, 38263,\n\t258, 38272, 258, 38428, 258, 38582, 258, 38585, 258, 38632, 258, 38737,\n\t258, 38750, 258, 38754, 258, 38761, 258, 38859, 258, 38893, 258, 38899,\n\t258, 38913, 258, 39080, 258, 39131, 258, 39135, 258, 39318, 258, 39321,\n\t258, 39340, 258, 39592, 258, 39640, 258, 39647, 258, 39717, 258, 39727,\n\t258, 39730, 258, 39740, 258, 39770, 258, 40165, 258, 40565, 258, 40575,\n\t258, 40613, 258, 40635, 258, 40643, 258, 40653, 258, 40657, 258, 40697,\n\t258, 40701, 258, 40718, 258, 40723, 258, 40736, 258, 40763, 258, 40778,\n\t258, 40786, 258, 40845, 258, 40860, 258, 40864, 264, 32, 258, 12306, 258,\n\t21313, 258, 21316, 258, 21317, 512, 12363, 12441, 512, 12365, 12441, 512,\n\t12367, 12441, 512, 12369, 12441, 512, 12371, 12441, 512, 12373, 12441,\n\t512, 12375, 12441, 512, 12377, 12441, 512, 12379, 12441, 512, 12381,\n\t12441, 512, 12383, 12441, 512, 12385, 12441, 512, 12388, 12441, 512,\n\t12390, 12441, 512, 12392, 12441, 512, 12399, 12441, 512, 12399, 12442,\n\t512, 12402, 12441, 512, 12402, 12442, 512, 12405, 12441, 512, 12405,\n\t12442, 512, 12408, 12441, 512, 12408, 12442, 512, 12411, 12441, 512,\n\t12411, 12442, 512, 12358, 12441, 514, 32, 12441, 514, 32, 12442, 512,\n\t12445, 12441, 521, 12424, 12426, 512, 12459, 12441, 512, 12461, 12441,\n\t512, 12463, 12441, 512, 12465, 12441, 512, 12467, 12441, 512, 12469,\n\t12441, 512, 12471, 12441, 512, 12473, 12441, 512, 12475, 12441, 512,\n\t12477, 12441, 512, 12479, 12441, 512, 12481, 12441, 512, 12484, 12441,\n\t512, 12486, 12441, 512, 12488, 12441, 512, 12495, 12441, 512, 12495,\n\t12442, 512, 12498, 12441, 512, 12498, 12442, 512, 12501, 12441, 512,\n\t12501, 12442, 512, 12504, 12441, 512, 12504, 12442, 512, 12507, 12441,\n\t512, 12507, 12442, 512, 12454, 12441, 512, 12527, 12441, 512, 12528,\n\t12441, 512, 12529, 12441, 512, 12530, 12441, 512, 12541, 12441, 521,\n\t12467, 12488, 258, 4352, 258, 4353, 258, 4522, 258, 4354, 258, 4524, 258,\n\t4525, 258, 4355, 258, 4356, 258, 4357, 258, 4528, 258, 4529, 258, 4530,\n\t258, 4531, 258, 4532, 258, 4533, 258, 4378, 258, 4358, 258, 4359, 258,\n\t4360, 258, 4385, 258, 4361, 258, 4362, 258, 4363, 258, 4364, 258, 4365,\n\t258, 4366, 258, 4367, 258, 4368, 258, 4369, 258, 4370, 258, 4449, 258,\n\t4450, 258, 4451, 258, 4452, 258, 4453, 258, 4454, 258, 4455, 258, 4456,\n\t258, 4457, 258, 4458, 258, 4459, 258, 4460, 258, 4461, 258, 4462, 258,\n\t4463, 258, 4464, 258, 4465, 258, 4466, 258, 4467, 258, 4468, 258, 4469,\n\t258, 4448, 258, 4372, 258, 4373, 258, 4551, 258, 4552, 258, 4556, 258,\n\t4558, 258, 4563, 258, 4567, 258, 4569, 258, 4380, 258, 4573, 258, 4575,\n\t258, 4381, 258, 4382, 258, 4384, 258, 4386, 258, 4387, 258, 4391, 258,\n\t4393, 258, 4395, 258, 4396, 258, 4397, 258, 4398, 258, 4399, 258, 4402,\n\t258, 4406, 258, 4416, 258, 4423, 258, 4428, 258, 4593, 258, 4594, 258,\n\t4439, 258, 4440, 258, 4441, 258, 4484, 258, 4485, 258, 4488, 258, 4497,\n\t258, 4498, 258, 4500, 258, 4510, 258, 4513, 259, 19968, 259, 20108, 259,\n\t19977, 259, 22235, 259, 19978, 259, 20013, 259, 19979, 259, 30002, 259,\n\t20057, 259, 19993, 259, 19969, 259, 22825, 259, 22320, 259, 20154, 770,\n\t40, 4352, 41, 770, 40, 4354, 41, 770, 40, 4355, 41, 770, 40, 4357, 41,\n\t770, 40, 4358, 41, 770, 40, 4359, 41, 770, 40, 4361, 41, 770, 40, 4363,\n\t41, 770, 40, 4364, 41, 770, 40, 4366, 41, 770, 40, 4367, 41, 770, 40,\n\t4368, 41, 770, 40, 4369, 41, 770, 40, 4370, 41, 1026, 40, 4352, 4449, 41,\n\t1026, 40, 4354, 4449, 41, 1026, 40, 4355, 4449, 41, 1026, 40, 4357, 4449,\n\t41, 1026, 40, 4358, 4449, 41, 1026, 40, 4359, 4449, 41, 1026, 40, 4361,\n\t4449, 41, 1026, 40, 4363, 4449, 41, 1026, 40, 4364, 4449, 41, 1026, 40,\n\t4366, 4449, 41, 1026, 40, 4367, 4449, 41, 1026, 40, 4368, 4449, 41, 1026,\n\t40, 4369, 4449, 41, 1026, 40, 4370, 4449, 41, 1026, 40, 4364, 4462, 41,\n\t1794, 40, 4363, 4457, 4364, 4453, 4523, 41, 1538, 40, 4363, 4457, 4370,\n\t4462, 41, 770, 40, 19968, 41, 770, 40, 20108, 41, 770, 40, 19977, 41,\n\t770, 40, 22235, 41, 770, 40, 20116, 41, 770, 40, 20845, 41, 770, 40,\n\t19971, 41, 770, 40, 20843, 41, 770, 40, 20061, 41, 770, 40, 21313, 41,\n\t770, 40, 26376, 41, 770, 40, 28779, 41, 770, 40, 27700, 41, 770, 40,\n\t26408, 41, 770, 40, 37329, 41, 770, 40, 22303, 41, 770, 40, 26085, 41,\n\t770, 40, 26666, 41, 770, 40, 26377, 41, 770, 40, 31038, 41, 770, 40,\n\t21517, 41, 770, 40, 29305, 41, 770, 40, 36001, 41, 770, 40, 31069, 41,\n\t770, 40, 21172, 41, 770, 40, 20195, 41, 770, 40, 21628, 41, 770, 40,\n\t23398, 41, 770, 40, 30435, 41, 770, 40, 20225, 41, 770, 40, 36039, 41,\n\t770, 40, 21332, 41, 770, 40, 31085, 41, 770, 40, 20241, 41, 770, 40,\n\t33258, 41, 770, 40, 33267, 41, 263, 21839, 263, 24188, 263, 25991, 263,\n\t31631, 778, 80, 84, 69, 519, 50, 49, 519, 50, 50, 519, 50, 51, 519, 50,\n\t52, 519, 50, 53, 519, 50, 54, 519, 50, 55, 519, 50, 56, 519, 50, 57, 519,\n\t51, 48, 519, 51, 49, 519, 51, 50, 519, 51, 51, 519, 51, 52, 519, 51, 53,\n\t263, 4352, 263, 4354, 263, 4355, 263, 4357, 263, 4358, 263, 4359, 263,\n\t4361, 263, 4363, 263, 4364, 263, 4366, 263, 4367, 263, 4368, 263, 4369,\n\t263, 4370, 519, 4352, 4449, 519, 4354, 4449, 519, 4355, 4449, 519, 4357,\n\t4449, 519, 4358, 4449, 519, 4359, 4449, 519, 4361, 4449, 519, 4363, 4449,\n\t519, 4364, 4449, 519, 4366, 4449, 519, 4367, 4449, 519, 4368, 4449, 519,\n\t4369, 4449, 519, 4370, 4449, 1287, 4366, 4449, 4535, 4352, 4457, 1031,\n\t4364, 4462, 4363, 4468, 519, 4363, 4462, 263, 19968, 263, 20108, 263,\n\t19977, 263, 22235, 263, 20116, 263, 20845, 263, 19971, 263, 20843, 263,\n\t20061, 263, 21313, 263, 26376, 263, 28779, 263, 27700, 263, 26408, 263,\n\t37329, 263, 22303, 263, 26085, 263, 26666, 263, 26377, 263, 31038, 263,\n\t21517, 263, 29305, 263, 36001, 263, 31069, 263, 21172, 263, 31192, 263,\n\t30007, 263, 22899, 263, 36969, 263, 20778, 263, 21360, 263, 27880, 263,\n\t38917, 263, 20241, 263, 20889, 263, 27491, 263, 19978, 263, 20013, 263,\n\t19979, 263, 24038, 263, 21491, 263, 21307, 263, 23447, 263, 23398, 263,\n\t30435, 263, 20225, 263, 36039, 263, 21332, 263, 22812, 519, 51, 54, 519,\n\t51, 55, 519, 51, 56, 519, 51, 57, 519, 52, 48, 519, 52, 49, 519, 52, 50,\n\t519, 52, 51, 519, 52, 52, 519, 52, 53, 519, 52, 54, 519, 52, 55, 519, 52,\n\t56, 519, 52, 57, 519, 53, 48, 514, 49, 26376, 514, 50, 26376, 514, 51,\n\t26376, 514, 52, 26376, 514, 53, 26376, 514, 54, 26376, 514, 55, 26376,\n\t514, 56, 26376, 514, 57, 26376, 770, 49, 48, 26376, 770, 49, 49, 26376,\n\t770, 49, 50, 26376, 522, 72, 103, 778, 101, 114, 103, 522, 101, 86, 778,\n\t76, 84, 68, 263, 12450, 263, 12452, 263, 12454, 263, 12456, 263, 12458,\n\t263, 12459, 263, 12461, 263, 12463, 263, 12465, 263, 12467, 263, 12469,\n\t263, 12471, 263, 12473, 263, 12475, 263, 12477, 263, 12479, 263, 12481,\n\t263, 12484, 263, 12486, 263, 12488, 263, 12490, 263, 12491, 263, 12492,\n\t263, 12493, 263, 12494, 263, 12495, 263, 12498, 263, 12501, 263, 12504,\n\t263, 12507, 263, 12510, 263, 12511, 263, 12512, 263, 12513, 263, 12514,\n\t263, 12516, 263, 12518, 263, 12520, 263, 12521, 263, 12522, 263, 12523,\n\t263, 12524, 263, 12525, 263, 12527, 263, 12528, 263, 12529, 263, 12530,\n\t1034, 12450, 12497, 12540, 12488, 1034, 12450, 12523, 12501, 12449, 1034,\n\t12450, 12531, 12506, 12450, 778, 12450, 12540, 12523, 1034, 12452, 12491,\n\t12531, 12464, 778, 12452, 12531, 12481, 778, 12454, 12457, 12531, 1290,\n\t12456, 12473, 12463, 12540, 12489, 1034, 12456, 12540, 12459, 12540, 778,\n\t12458, 12531, 12473, 778, 12458, 12540, 12512, 778, 12459, 12452, 12522,\n\t1034, 12459, 12521, 12483, 12488, 1034, 12459, 12525, 12522, 12540, 778,\n\t12460, 12525, 12531, 778, 12460, 12531, 12510, 522, 12462, 12460, 778,\n\t12462, 12491, 12540, 1034, 12461, 12517, 12522, 12540, 1034, 12462,\n\t12523, 12480, 12540, 522, 12461, 12525, 1290, 12461, 12525, 12464, 12521,\n\t12512, 1546, 12461, 12525, 12513, 12540, 12488, 12523, 1290, 12461,\n\t12525, 12527, 12483, 12488, 778, 12464, 12521, 12512, 1290, 12464, 12521,\n\t12512, 12488, 12531, 1290, 12463, 12523, 12476, 12452, 12525, 1034,\n\t12463, 12525, 12540, 12493, 778, 12465, 12540, 12473, 778, 12467, 12523,\n\t12490, 778, 12467, 12540, 12509, 1034, 12469, 12452, 12463, 12523, 1290,\n\t12469, 12531, 12481, 12540, 12512, 1034, 12471, 12522, 12531, 12464, 778,\n\t12475, 12531, 12481, 778, 12475, 12531, 12488, 778, 12480, 12540, 12473,\n\t522, 12487, 12471, 522, 12489, 12523, 522, 12488, 12531, 522, 12490,\n\t12494, 778, 12494, 12483, 12488, 778, 12495, 12452, 12484, 1290, 12497,\n\t12540, 12475, 12531, 12488, 778, 12497, 12540, 12484, 1034, 12496, 12540,\n\t12524, 12523, 1290, 12500, 12450, 12473, 12488, 12523, 778, 12500, 12463,\n\t12523, 522, 12500, 12467, 522, 12499, 12523, 1290, 12501, 12449, 12521,\n\t12483, 12489, 1034, 12501, 12451, 12540, 12488, 1290, 12502, 12483,\n\t12471, 12455, 12523, 778, 12501, 12521, 12531, 1290, 12504, 12463, 12479,\n\t12540, 12523, 522, 12506, 12477, 778, 12506, 12491, 12498, 778, 12504,\n\t12523, 12484, 778, 12506, 12531, 12473, 778, 12506, 12540, 12472, 778,\n\t12505, 12540, 12479, 1034, 12509, 12452, 12531, 12488, 778, 12508, 12523,\n\t12488, 522, 12507, 12531, 778, 12509, 12531, 12489, 778, 12507, 12540,\n\t12523, 778, 12507, 12540, 12531, 1034, 12510, 12452, 12463, 12525, 778,\n\t12510, 12452, 12523, 778, 12510, 12483, 12495, 778, 12510, 12523, 12463,\n\t1290, 12510, 12531, 12471, 12519, 12531, 1034, 12511, 12463, 12525,\n\t12531, 522, 12511, 12522, 1290, 12511, 12522, 12496, 12540, 12523, 522,\n\t12513, 12460, 1034, 12513, 12460, 12488, 12531, 1034, 12513, 12540,\n\t12488, 12523, 778, 12516, 12540, 12489, 778, 12516, 12540, 12523, 778,\n\t12518, 12450, 12531, 1034, 12522, 12483, 12488, 12523, 522, 12522, 12521,\n\t778, 12523, 12500, 12540, 1034, 12523, 12540, 12502, 12523, 522, 12524,\n\t12512, 1290, 12524, 12531, 12488, 12466, 12531, 778, 12527, 12483, 12488,\n\t514, 48, 28857, 514, 49, 28857, 514, 50, 28857, 514, 51, 28857, 514, 52,\n\t28857, 514, 53, 28857, 514, 54, 28857, 514, 55, 28857, 514, 56, 28857,\n\t514, 57, 28857, 770, 49, 48, 28857, 770, 49, 49, 28857, 770, 49, 50,\n\t28857, 770, 49, 51, 28857, 770, 49, 52, 28857, 770, 49, 53, 28857, 770,\n\t49, 54, 28857, 770, 49, 55, 28857, 770, 49, 56, 28857, 770, 49, 57,\n\t28857, 770, 50, 48, 28857, 770, 50, 49, 28857, 770, 50, 50, 28857, 770,\n\t50, 51, 28857, 770, 50, 52, 28857, 778, 104, 80, 97, 522, 100, 97, 522,\n\t65, 85, 778, 98, 97, 114, 522, 111, 86, 522, 112, 99, 522, 100, 109, 778,\n\t100, 109, 178, 778, 100, 109, 179, 522, 73, 85, 522, 24179, 25104, 522,\n\t26157, 21644, 522, 22823, 27491, 522, 26126, 27835, 1034, 26666, 24335,\n\t20250, 31038, 522, 112, 65, 522, 110, 65, 522, 956, 65, 522, 109, 65,\n\t522, 107, 65, 522, 75, 66, 522, 77, 66, 522, 71, 66, 778, 99, 97, 108,\n\t1034, 107, 99, 97, 108, 522, 112, 70, 522, 110, 70, 522, 956, 70, 522,\n\t956, 103, 522, 109, 103, 522, 107, 103, 522, 72, 122, 778, 107, 72, 122,\n\t778, 77, 72, 122, 778, 71, 72, 122, 778, 84, 72, 122, 522, 956, 8467,\n\t522, 109, 8467, 522, 100, 8467, 522, 107, 8467, 522, 102, 109, 522, 110,\n\t109, 522, 956, 109, 522, 109, 109, 522, 99, 109, 522, 107, 109, 778, 109,\n\t109, 178, 778, 99, 109, 178, 522, 109, 178, 778, 107, 109, 178, 778, 109,\n\t109, 179, 778, 99, 109, 179, 522, 109, 179, 778, 107, 109, 179, 778, 109,\n\t8725, 115, 1034, 109, 8725, 115, 178, 522, 80, 97, 778, 107, 80, 97, 778,\n\t77, 80, 97, 778, 71, 80, 97, 778, 114, 97, 100, 1290, 114, 97, 100, 8725,\n\t115, 1546, 114, 97, 100, 8725, 115, 178, 522, 112, 115, 522, 110, 115,\n\t522, 956, 115, 522, 109, 115, 522, 112, 86, 522, 110, 86, 522, 956, 86,\n\t522, 109, 86, 522, 107, 86, 522, 77, 86, 522, 112, 87, 522, 110, 87, 522,\n\t956, 87, 522, 109, 87, 522, 107, 87, 522, 77, 87, 522, 107, 937, 522, 77,\n\t937, 1034, 97, 46, 109, 46, 522, 66, 113, 522, 99, 99, 522, 99, 100,\n\t1034, 67, 8725, 107, 103, 778, 67, 111, 46, 522, 100, 66, 522, 71, 121,\n\t522, 104, 97, 522, 72, 80, 522, 105, 110, 522, 75, 75, 522, 75, 77, 522,\n\t107, 116, 522, 108, 109, 522, 108, 110, 778, 108, 111, 103, 522, 108,\n\t120, 522, 109, 98, 778, 109, 105, 108, 778, 109, 111, 108, 522, 80, 72,\n\t1034, 112, 46, 109, 46, 778, 80, 80, 77, 522, 80, 82, 522, 115, 114, 522,\n\t83, 118, 522, 87, 98, 778, 86, 8725, 109, 778, 65, 8725, 109, 514, 49,\n\t26085, 514, 50, 26085, 514, 51, 26085, 514, 52, 26085, 514, 53, 26085,\n\t514, 54, 26085, 514, 55, 26085, 514, 56, 26085, 514, 57, 26085, 770, 49,\n\t48, 26085, 770, 49, 49, 26085, 770, 49, 50, 26085, 770, 49, 51, 26085,\n\t770, 49, 52, 26085, 770, 49, 53, 26085, 770, 49, 54, 26085, 770, 49, 55,\n\t26085, 770, 49, 56, 26085, 770, 49, 57, 26085, 770, 50, 48, 26085, 770,\n\t50, 49, 26085, 770, 50, 50, 26085, 770, 50, 51, 26085, 770, 50, 52,\n\t26085, 770, 50, 53, 26085, 770, 50, 54, 26085, 770, 50, 55, 26085, 770,\n\t50, 56, 26085, 770, 50, 57, 26085, 770, 51, 48, 26085, 770, 51, 49,\n\t26085, 778, 103, 97, 108, 259, 42863, 259, 294, 259, 339, 256, 35912,\n\t256, 26356, 256, 36554, 256, 36040, 256, 28369, 256, 20018, 256, 21477,\n\t256, 40860, 256, 40860, 256, 22865, 256, 37329, 256, 21895, 256, 22856,\n\t256, 25078, 256, 30313, 256, 32645, 256, 34367, 256, 34746, 256, 35064,\n\t256, 37007, 256, 27138, 256, 27931, 256, 28889, 256, 29662, 256, 33853,\n\t256, 37226, 256, 39409, 256, 20098, 256, 21365, 256, 27396, 256, 29211,\n\t256, 34349, 256, 40478, 256, 23888, 256, 28651, 256, 34253, 256, 35172,\n\t256, 25289, 256, 33240, 256, 34847, 256, 24266, 256, 26391, 256, 28010,\n\t256, 29436, 256, 37070, 256, 20358, 256, 20919, 256, 21214, 256, 25796,\n\t256, 27347, 256, 29200, 256, 30439, 256, 32769, 256, 34310, 256, 34396,\n\t256, 36335, 256, 38706, 256, 39791, 256, 40442, 256, 30860, 256, 31103,\n\t256, 32160, 256, 33737, 256, 37636, 256, 40575, 256, 35542, 256, 22751,\n\t256, 24324, 256, 31840, 256, 32894, 256, 29282, 256, 30922, 256, 36034,\n\t256, 38647, 256, 22744, 256, 23650, 256, 27155, 256, 28122, 256, 28431,\n\t256, 32047, 256, 32311, 256, 38475, 256, 21202, 256, 32907, 256, 20956,\n\t256, 20940, 256, 31260, 256, 32190, 256, 33777, 256, 38517, 256, 35712,\n\t256, 25295, 256, 27138, 256, 35582, 256, 20025, 256, 23527, 256, 24594,\n\t256, 29575, 256, 30064, 256, 21271, 256, 30971, 256, 20415, 256, 24489,\n\t256, 19981, 256, 27852, 256, 25976, 256, 32034, 256, 21443, 256, 22622,\n\t256, 30465, 256, 33865, 256, 35498, 256, 27578, 256, 36784, 256, 27784,\n\t256, 25342, 256, 33509, 256, 25504, 256, 30053, 256, 20142, 256, 20841,\n\t256, 20937, 256, 26753, 256, 31975, 256, 33391, 256, 35538, 256, 37327,\n\t256, 21237, 256, 21570, 256, 22899, 256, 24300, 256, 26053, 256, 28670,\n\t256, 31018, 256, 38317, 256, 39530, 256, 40599, 256, 40654, 256, 21147,\n\t256, 26310, 256, 27511, 256, 36706, 256, 24180, 256, 24976, 256, 25088,\n\t256, 25754, 256, 28451, 256, 29001, 256, 29833, 256, 31178, 256, 32244,\n\t256, 32879, 256, 36646, 256, 34030, 256, 36899, 256, 37706, 256, 21015,\n\t256, 21155, 256, 21693, 256, 28872, 256, 35010, 256, 35498, 256, 24265,\n\t256, 24565, 256, 25467, 256, 27566, 256, 31806, 256, 29557, 256, 20196,\n\t256, 22265, 256, 23527, 256, 23994, 256, 24604, 256, 29618, 256, 29801,\n\t256, 32666, 256, 32838, 256, 37428, 256, 38646, 256, 38728, 256, 38936,\n\t256, 20363, 256, 31150, 256, 37300, 256, 38584, 256, 24801, 256, 20102,\n\t256, 20698, 256, 23534, 256, 23615, 256, 26009, 256, 27138, 256, 29134,\n\t256, 30274, 256, 34044, 256, 36988, 256, 40845, 256, 26248, 256, 38446,\n\t256, 21129, 256, 26491, 256, 26611, 256, 27969, 256, 28316, 256, 29705,\n\t256, 30041, 256, 30827, 256, 32016, 256, 39006, 256, 20845, 256, 25134,\n\t256, 38520, 256, 20523, 256, 23833, 256, 28138, 256, 36650, 256, 24459,\n\t256, 24900, 256, 26647, 256, 29575, 256, 38534, 256, 21033, 256, 21519,\n\t256, 23653, 256, 26131, 256, 26446, 256, 26792, 256, 27877, 256, 29702,\n\t256, 30178, 256, 32633, 256, 35023, 256, 35041, 256, 37324, 256, 38626,\n\t256, 21311, 256, 28346, 256, 21533, 256, 29136, 256, 29848, 256, 34298,\n\t256, 38563, 256, 40023, 256, 40607, 256, 26519, 256, 28107, 256, 33256,\n\t256, 31435, 256, 31520, 256, 31890, 256, 29376, 256, 28825, 256, 35672,\n\t256, 20160, 256, 33590, 256, 21050, 256, 20999, 256, 24230, 256, 25299,\n\t256, 31958, 256, 23429, 256, 27934, 256, 26292, 256, 36667, 256, 34892,\n\t256, 38477, 256, 35211, 256, 24275, 256, 20800, 256, 21952, 256, 22618,\n\t256, 26228, 256, 20958, 256, 29482, 256, 30410, 256, 31036, 256, 31070,\n\t256, 31077, 256, 31119, 256, 38742, 256, 31934, 256, 32701, 256, 34322,\n\t256, 35576, 256, 36920, 256, 37117, 256, 39151, 256, 39164, 256, 39208,\n\t256, 40372, 256, 37086, 256, 38583, 256, 20398, 256, 20711, 256, 20813,\n\t256, 21193, 256, 21220, 256, 21329, 256, 21917, 256, 22022, 256, 22120,\n\t256, 22592, 256, 22696, 256, 23652, 256, 23662, 256, 24724, 256, 24936,\n\t256, 24974, 256, 25074, 256, 25935, 256, 26082, 256, 26257, 256, 26757,\n\t256, 28023, 256, 28186, 256, 28450, 256, 29038, 256, 29227, 256, 29730,\n\t256, 30865, 256, 31038, 256, 31049, 256, 31048, 256, 31056, 256, 31062,\n\t256, 31069, 256, 31117, 256, 31118, 256, 31296, 256, 31361, 256, 31680,\n\t256, 32244, 256, 32265, 256, 32321, 256, 32626, 256, 32773, 256, 33261,\n\t256, 33401, 256, 33401, 256, 33879, 256, 35088, 256, 35222, 256, 35585,\n\t256, 35641, 256, 36051, 256, 36104, 256, 36790, 256, 36920, 256, 38627,\n\t256, 38911, 256, 38971, 256, 24693, 256, 55376, 57070, 256, 33304, 256,\n\t20006, 256, 20917, 256, 20840, 256, 20352, 256, 20805, 256, 20864, 256,\n\t21191, 256, 21242, 256, 21917, 256, 21845, 256, 21913, 256, 21986, 256,\n\t22618, 256, 22707, 256, 22852, 256, 22868, 256, 23138, 256, 23336, 256,\n\t24274, 256, 24281, 256, 24425, 256, 24493, 256, 24792, 256, 24910, 256,\n\t24840, 256, 24974, 256, 24928, 256, 25074, 256, 25140, 256, 25540, 256,\n\t25628, 256, 25682, 256, 25942, 256, 26228, 256, 26391, 256, 26395, 256,\n\t26454, 256, 27513, 256, 27578, 256, 27969, 256, 28379, 256, 28363, 256,\n\t28450, 256, 28702, 256, 29038, 256, 30631, 256, 29237, 256, 29359, 256,\n\t29482, 256, 29809, 256, 29958, 256, 30011, 256, 30237, 256, 30239, 256,\n\t30410, 256, 30427, 256, 30452, 256, 30538, 256, 30528, 256, 30924, 256,\n\t31409, 256, 31680, 256, 31867, 256, 32091, 256, 32244, 256, 32574, 256,\n\t32773, 256, 33618, 256, 33775, 256, 34681, 256, 35137, 256, 35206, 256,\n\t35222, 256, 35519, 256, 35576, 256, 35531, 256, 35585, 256, 35582, 256,\n\t35565, 256, 35641, 256, 35722, 256, 36104, 256, 36664, 256, 36978, 256,\n\t37273, 256, 37494, 256, 38524, 256, 38627, 256, 38742, 256, 38875, 256,\n\t38911, 256, 38923, 256, 38971, 256, 39698, 256, 40860, 256, 55370, 56394,\n\t256, 55370, 56388, 256, 55372, 57301, 256, 15261, 256, 16408, 256, 16441,\n\t256, 55380, 56905, 256, 55383, 56528, 256, 55391, 57043, 256, 40771, 256,\n\t40846, 514, 102, 102, 514, 102, 105, 514, 102, 108, 770, 102, 102, 105,\n\t770, 102, 102, 108, 514, 383, 116, 514, 115, 116, 514, 1396, 1398, 514,\n\t1396, 1381, 514, 1396, 1387, 514, 1406, 1398, 514, 1396, 1389, 512, 1497,\n\t1460, 512, 1522, 1463, 262, 1506, 262, 1488, 262, 1491, 262, 1492, 262,\n\t1499, 262, 1500, 262, 1501, 262, 1512, 262, 1514, 262, 43, 512, 1513,\n\t1473, 512, 1513, 1474, 512, 64329, 1473, 512, 64329, 1474, 512, 1488,\n\t1463, 512, 1488, 1464, 512, 1488, 1468, 512, 1489, 1468, 512, 1490, 1468,\n\t512, 1491, 1468, 512, 1492, 1468, 512, 1493, 1468, 512, 1494, 1468, 512,\n\t1496, 1468, 512, 1497, 1468, 512, 1498, 1468, 512, 1499, 1468, 512, 1500,\n\t1468, 512, 1502, 1468, 512, 1504, 1468, 512, 1505, 1468, 512, 1507, 1468,\n\t512, 1508, 1468, 512, 1510, 1468, 512, 1511, 1468, 512, 1512, 1468, 512,\n\t1513, 1468, 512, 1514, 1468, 512, 1493, 1465, 512, 1489, 1471, 512, 1499,\n\t1471, 512, 1508, 1471, 514, 1488, 1500, 267, 1649, 268, 1649, 267, 1659,\n\t268, 1659, 269, 1659, 270, 1659, 267, 1662, 268, 1662, 269, 1662, 270,\n\t1662, 267, 1664, 268, 1664, 269, 1664, 270, 1664, 267, 1658, 268, 1658,\n\t269, 1658, 270, 1658, 267, 1663, 268, 1663, 269, 1663, 270, 1663, 267,\n\t1657, 268, 1657, 269, 1657, 270, 1657, 267, 1700, 268, 1700, 269, 1700,\n\t270, 1700, 267, 1702, 268, 1702, 269, 1702, 270, 1702, 267, 1668, 268,\n\t1668, 269, 1668, 270, 1668, 267, 1667, 268, 1667, 269, 1667, 270, 1667,\n\t267, 1670, 268, 1670, 269, 1670, 270, 1670, 267, 1671, 268, 1671, 269,\n\t1671, 270, 1671, 267, 1677, 268, 1677, 267, 1676, 268, 1676, 267, 1678,\n\t268, 1678, 267, 1672, 268, 1672, 267, 1688, 268, 1688, 267, 1681, 268,\n\t1681, 267, 1705, 268, 1705, 269, 1705, 270, 1705, 267, 1711, 268, 1711,\n\t269, 1711, 270, 1711, 267, 1715, 268, 1715, 269, 1715, 270, 1715, 267,\n\t1713, 268, 1713, 269, 1713, 270, 1713, 267, 1722, 268, 1722, 267, 1723,\n\t268, 1723, 269, 1723, 270, 1723, 267, 1728, 268, 1728, 267, 1729, 268,\n\t1729, 269, 1729, 270, 1729, 267, 1726, 268, 1726, 269, 1726, 270, 1726,\n\t267, 1746, 268, 1746, 267, 1747, 268, 1747, 267, 1709, 268, 1709, 269,\n\t1709, 270, 1709, 267, 1735, 268, 1735, 267, 1734, 268, 1734, 267, 1736,\n\t268, 1736, 267, 1655, 267, 1739, 268, 1739, 267, 1733, 268, 1733, 267,\n\t1737, 268, 1737, 267, 1744, 268, 1744, 269, 1744, 270, 1744, 269, 1609,\n\t270, 1609, 523, 1574, 1575, 524, 1574, 1575, 523, 1574, 1749, 524, 1574,\n\t1749, 523, 1574, 1608, 524, 1574, 1608, 523, 1574, 1735, 524, 1574, 1735,\n\t523, 1574, 1734, 524, 1574, 1734, 523, 1574, 1736, 524, 1574, 1736, 523,\n\t1574, 1744, 524, 1574, 1744, 525, 1574, 1744, 523, 1574, 1609, 524, 1574,\n\t1609, 525, 1574, 1609, 267, 1740, 268, 1740, 269, 1740, 270, 1740, 523,\n\t1574, 1580, 523, 1574, 1581, 523, 1574, 1605, 523, 1574, 1609, 523, 1574,\n\t1610, 523, 1576, 1580, 523, 1576, 1581, 523, 1576, 1582, 523, 1576, 1605,\n\t523, 1576, 1609, 523, 1576, 1610, 523, 1578, 1580, 523, 1578, 1581, 523,\n\t1578, 1582, 523, 1578, 1605, 523, 1578, 1609, 523, 1578, 1610, 523, 1579,\n\t1580, 523, 1579, 1605, 523, 1579, 1609, 523, 1579, 1610, 523, 1580, 1581,\n\t523, 1580, 1605, 523, 1581, 1580, 523, 1581, 1605, 523, 1582, 1580, 523,\n\t1582, 1581, 523, 1582, 1605, 523, 1587, 1580, 523, 1587, 1581, 523, 1587,\n\t1582, 523, 1587, 1605, 523, 1589, 1581, 523, 1589, 1605, 523, 1590, 1580,\n\t523, 1590, 1581, 523, 1590, 1582, 523, 1590, 1605, 523, 1591, 1581, 523,\n\t1591, 1605, 523, 1592, 1605, 523, 1593, 1580, 523, 1593, 1605, 523, 1594,\n\t1580, 523, 1594, 1605, 523, 1601, 1580, 523, 1601, 1581, 523, 1601, 1582,\n\t523, 1601, 1605, 523, 1601, 1609, 523, 1601, 1610, 523, 1602, 1581, 523,\n\t1602, 1605, 523, 1602, 1609, 523, 1602, 1610, 523, 1603, 1575, 523, 1603,\n\t1580, 523, 1603, 1581, 523, 1603, 1582, 523, 1603, 1604, 523, 1603, 1605,\n\t523, 1603, 1609, 523, 1603, 1610, 523, 1604, 1580, 523, 1604, 1581, 523,\n\t1604, 1582, 523, 1604, 1605, 523, 1604, 1609, 523, 1604, 1610, 523, 1605,\n\t1580, 523, 1605, 1581, 523, 1605, 1582, 523, 1605, 1605, 523, 1605, 1609,\n\t523, 1605, 1610, 523, 1606, 1580, 523, 1606, 1581, 523, 1606, 1582, 523,\n\t1606, 1605, 523, 1606, 1609, 523, 1606, 1610, 523, 1607, 1580, 523, 1607,\n\t1605, 523, 1607, 1609, 523, 1607, 1610, 523, 1610, 1580, 523, 1610, 1581,\n\t523, 1610, 1582, 523, 1610, 1605, 523, 1610, 1609, 523, 1610, 1610, 523,\n\t1584, 1648, 523, 1585, 1648, 523, 1609, 1648, 779, 32, 1612, 1617, 779,\n\t32, 1613, 1617, 779, 32, 1614, 1617, 779, 32, 1615, 1617, 779, 32, 1616,\n\t1617, 779, 32, 1617, 1648, 524, 1574, 1585, 524, 1574, 1586, 524, 1574,\n\t1605, 524, 1574, 1606, 524, 1574, 1609, 524, 1574, 1610, 524, 1576, 1585,\n\t524, 1576, 1586, 524, 1576, 1605, 524, 1576, 1606, 524, 1576, 1609, 524,\n\t1576, 1610, 524, 1578, 1585, 524, 1578, 1586, 524, 1578, 1605, 524, 1578,\n\t1606, 524, 1578, 1609, 524, 1578, 1610, 524, 1579, 1585, 524, 1579, 1586,\n\t524, 1579, 1605, 524, 1579, 1606, 524, 1579, 1609, 524, 1579, 1610, 524,\n\t1601, 1609, 524, 1601, 1610, 524, 1602, 1609, 524, 1602, 1610, 524, 1603,\n\t1575, 524, 1603, 1604, 524, 1603, 1605, 524, 1603, 1609, 524, 1603, 1610,\n\t524, 1604, 1605, 524, 1604, 1609, 524, 1604, 1610, 524, 1605, 1575, 524,\n\t1605, 1605, 524, 1606, 1585, 524, 1606, 1586, 524, 1606, 1605, 524, 1606,\n\t1606, 524, 1606, 1609, 524, 1606, 1610, 524, 1609, 1648, 524, 1610, 1585,\n\t524, 1610, 1586, 524, 1610, 1605, 524, 1610, 1606, 524, 1610, 1609, 524,\n\t1610, 1610, 525, 1574, 1580, 525, 1574, 1581, 525, 1574, 1582, 525, 1574,\n\t1605, 525, 1574, 1607, 525, 1576, 1580, 525, 1576, 1581, 525, 1576, 1582,\n\t525, 1576, 1605, 525, 1576, 1607, 525, 1578, 1580, 525, 1578, 1581, 525,\n\t1578, 1582, 525, 1578, 1605, 525, 1578, 1607, 525, 1579, 1605, 525, 1580,\n\t1581, 525, 1580, 1605, 525, 1581, 1580, 525, 1581, 1605, 525, 1582, 1580,\n\t525, 1582, 1605, 525, 1587, 1580, 525, 1587, 1581, 525, 1587, 1582, 525,\n\t1587, 1605, 525, 1589, 1581, 525, 1589, 1582, 525, 1589, 1605, 525, 1590,\n\t1580, 525, 1590, 1581, 525, 1590, 1582, 525, 1590, 1605, 525, 1591, 1581,\n\t525, 1592, 1605, 525, 1593, 1580, 525, 1593, 1605, 525, 1594, 1580, 525,\n\t1594, 1605, 525, 1601, 1580, 525, 1601, 1581, 525, 1601, 1582, 525, 1601,\n\t1605, 525, 1602, 1581, 525, 1602, 1605, 525, 1603, 1580, 525, 1603, 1581,\n\t525, 1603, 1582, 525, 1603, 1604, 525, 1603, 1605, 525, 1604, 1580, 525,\n\t1604, 1581, 525, 1604, 1582, 525, 1604, 1605, 525, 1604, 1607, 525, 1605,\n\t1580, 525, 1605, 1581, 525, 1605, 1582, 525, 1605, 1605, 525, 1606, 1580,\n\t525, 1606, 1581, 525, 1606, 1582, 525, 1606, 1605, 525, 1606, 1607, 525,\n\t1607, 1580, 525, 1607, 1605, 525, 1607, 1648, 525, 1610, 1580, 525, 1610,\n\t1581, 525, 1610, 1582, 525, 1610, 1605, 525, 1610, 1607, 526, 1574, 1605,\n\t526, 1574, 1607, 526, 1576, 1605, 526, 1576, 1607, 526, 1578, 1605, 526,\n\t1578, 1607, 526, 1579, 1605, 526, 1579, 1607, 526, 1587, 1605, 526, 1587,\n\t1607, 526, 1588, 1605, 526, 1588, 1607, 526, 1603, 1604, 526, 1603, 1605,\n\t526, 1604, 1605, 526, 1606, 1605, 526, 1606, 1607, 526, 1610, 1605, 526,\n\t1610, 1607, 782, 1600, 1614, 1617, 782, 1600, 1615, 1617, 782, 1600,\n\t1616, 1617, 523, 1591, 1609, 523, 1591, 1610, 523, 1593, 1609, 523, 1593,\n\t1610, 523, 1594, 1609, 523, 1594, 1610, 523, 1587, 1609, 523, 1587, 1610,\n\t523, 1588, 1609, 523, 1588, 1610, 523, 1581, 1609, 523, 1581, 1610, 523,\n\t1580, 1609, 523, 1580, 1610, 523, 1582, 1609, 523, 1582, 1610, 523, 1589,\n\t1609, 523, 1589, 1610, 523, 1590, 1609, 523, 1590, 1610, 523, 1588, 1580,\n\t523, 1588, 1581, 523, 1588, 1582, 523, 1588, 1605, 523, 1588, 1585, 523,\n\t1587, 1585, 523, 1589, 1585, 523, 1590, 1585, 524, 1591, 1609, 524, 1591,\n\t1610, 524, 1593, 1609, 524, 1593, 1610, 524, 1594, 1609, 524, 1594, 1610,\n\t524, 1587, 1609, 524, 1587, 1610, 524, 1588, 1609, 524, 1588, 1610, 524,\n\t1581, 1609, 524, 1581, 1610, 524, 1580, 1609, 524, 1580, 1610, 524, 1582,\n\t1609, 524, 1582, 1610, 524, 1589, 1609, 524, 1589, 1610, 524, 1590, 1609,\n\t524, 1590, 1610, 524, 1588, 1580, 524, 1588, 1581, 524, 1588, 1582, 524,\n\t1588, 1605, 524, 1588, 1585, 524, 1587, 1585, 524, 1589, 1585, 524, 1590,\n\t1585, 525, 1588, 1580, 525, 1588, 1581, 525, 1588, 1582, 525, 1588, 1605,\n\t525, 1587, 1607, 525, 1588, 1607, 525, 1591, 1605, 526, 1587, 1580, 526,\n\t1587, 1581, 526, 1587, 1582, 526, 1588, 1580, 526, 1588, 1581, 526, 1588,\n\t1582, 526, 1591, 1605, 526, 1592, 1605, 524, 1575, 1611, 523, 1575, 1611,\n\t781, 1578, 1580, 1605, 780, 1578, 1581, 1580, 781, 1578, 1581, 1580, 781,\n\t1578, 1581, 1605, 781, 1578, 1582, 1605, 781, 1578, 1605, 1580, 781,\n\t1578, 1605, 1581, 781, 1578, 1605, 1582, 780, 1580, 1605, 1581, 781,\n\t1580, 1605, 1581, 780, 1581, 1605, 1610, 780, 1581, 1605, 1609, 781,\n\t1587, 1581, 1580, 781, 1587, 1580, 1581, 780, 1587, 1580, 1609, 780,\n\t1587, 1605, 1581, 781, 1587, 1605, 1581, 781, 1587, 1605, 1580, 780,\n\t1587, 1605, 1605, 781, 1587, 1605, 1605, 780, 1589, 1581, 1581, 781,\n\t1589, 1581, 1581, 780, 1589, 1605, 1605, 780, 1588, 1581, 1605, 781,\n\t1588, 1581, 1605, 780, 1588, 1580, 1610, 780, 1588, 1605, 1582, 781,\n\t1588, 1605, 1582, 780, 1588, 1605, 1605, 781, 1588, 1605, 1605, 780,\n\t1590, 1581, 1609, 780, 1590, 1582, 1605, 781, 1590, 1582, 1605, 780,\n\t1591, 1605, 1581, 781, 1591, 1605, 1581, 781, 1591, 1605, 1605, 780,\n\t1591, 1605, 1610, 780, 1593, 1580, 1605, 780, 1593, 1605, 1605, 781,\n\t1593, 1605, 1605, 780, 1593, 1605, 1609, 780, 1594, 1605, 1605, 780,\n\t1594, 1605, 1610, 780, 1594, 1605, 1609, 780, 1601, 1582, 1605, 781,\n\t1601, 1582, 1605, 780, 1602, 1605, 1581, 780, 1602, 1605, 1605, 780,\n\t1604, 1581, 1605, 780, 1604, 1581, 1610, 780, 1604, 1581, 1609, 781,\n\t1604, 1580, 1580, 780, 1604, 1580, 1580, 780, 1604, 1582, 1605, 781,\n\t1604, 1582, 1605, 780, 1604, 1605, 1581, 781, 1604, 1605, 1581, 781,\n\t1605, 1581, 1580, 781, 1605, 1581, 1605, 780, 1605, 1581, 1610, 781,\n\t1605, 1580, 1581, 781, 1605, 1580, 1605, 781, 1605, 1582, 1580, 781,\n\t1605, 1582, 1605, 781, 1605, 1580, 1582, 781, 1607, 1605, 1580, 781,\n\t1607, 1605, 1605, 781, 1606, 1581, 1605, 780, 1606, 1581, 1609, 780,\n\t1606, 1580, 1605, 781, 1606, 1580, 1605, 780, 1606, 1580, 1609, 780,\n\t1606, 1605, 1610, 780, 1606, 1605, 1609, 780, 1610, 1605, 1605, 781,\n\t1610, 1605, 1605, 780, 1576, 1582, 1610, 780, 1578, 1580, 1610, 780,\n\t1578, 1580, 1609, 780, 1578, 1582, 1610, 780, 1578, 1582, 1609, 780,\n\t1578, 1605, 1610, 780, 1578, 1605, 1609, 780, 1580, 1605, 1610, 780,\n\t1580, 1581, 1609, 780, 1580, 1605, 1609, 780, 1587, 1582, 1609, 780,\n\t1589, 1581, 1610, 780, 1588, 1581, 1610, 780, 1590, 1581, 1610, 780,\n\t1604, 1580, 1610, 780, 1604, 1605, 1610, 780, 1610, 1581, 1610, 780,\n\t1610, 1580, 1610, 780, 1610, 1605, 1610, 780, 1605, 1605, 1610, 780,\n\t1602, 1605, 1610, 780, 1606, 1581, 1610, 781, 1602, 1605, 1581, 781,\n\t1604, 1581, 1605, 780, 1593, 1605, 1610, 780, 1603, 1605, 1610, 781,\n\t1606, 1580, 1581, 780, 1605, 1582, 1610, 781, 1604, 1580, 1605, 780,\n\t1603, 1605, 1605, 780, 1604, 1580, 1605, 780, 1606, 1580, 1581, 780,\n\t1580, 1581, 1610, 780, 1581, 1580, 1610, 780, 1605, 1580, 1610, 780,\n\t1601, 1605, 1610, 780, 1576, 1581, 1610, 781, 1603, 1605, 1605, 781,\n\t1593, 1580, 1605, 781, 1589, 1605, 1605, 780, 1587, 1582, 1610, 780,\n\t1606, 1580, 1610, 779, 1589, 1604, 1746, 779, 1602, 1604, 1746, 1035,\n\t1575, 1604, 1604, 1607, 1035, 1575, 1603, 1576, 1585, 1035, 1605, 1581,\n\t1605, 1583, 1035, 1589, 1604, 1593, 1605, 1035, 1585, 1587, 1608, 1604,\n\t1035, 1593, 1604, 1610, 1607, 1035, 1608, 1587, 1604, 1605, 779, 1589,\n\t1604, 1609, 4619, 1589, 1604, 1609, 32, 1575, 1604, 1604, 1607, 32, 1593,\n\t1604, 1610, 1607, 32, 1608, 1587, 1604, 1605, 2059, 1580, 1604, 32, 1580,\n\t1604, 1575, 1604, 1607, 1035, 1585, 1740, 1575, 1604, 265, 44, 265,\n\t12289, 265, 12290, 265, 58, 265, 59, 265, 33, 265, 63, 265, 12310, 265,\n\t12311, 265, 8230, 265, 8229, 265, 8212, 265, 8211, 265, 95, 265, 95, 265,\n\t40, 265, 41, 265, 123, 265, 125, 265, 12308, 265, 12309, 265, 12304, 265,\n\t12305, 265, 12298, 265, 12299, 265, 12296, 265, 12297, 265, 12300, 265,\n\t12301, 265, 12302, 265, 12303, 265, 91, 265, 93, 258, 8254, 258, 8254,\n\t258, 8254, 258, 8254, 258, 95, 258, 95, 258, 95, 271, 44, 271, 12289,\n\t271, 46, 271, 59, 271, 58, 271, 63, 271, 33, 271, 8212, 271, 40, 271, 41,\n\t271, 123, 271, 125, 271, 12308, 271, 12309, 271, 35, 271, 38, 271, 42,\n\t271, 43, 271, 45, 271, 60, 271, 62, 271, 61, 271, 92, 271, 36, 271, 37,\n\t271, 64, 523, 32, 1611, 526, 1600, 1611, 523, 32, 1612, 523, 32, 1613,\n\t523, 32, 1614, 526, 1600, 1614, 523, 32, 1615, 526, 1600, 1615, 523, 32,\n\t1616, 526, 1600, 1616, 523, 32, 1617, 526, 1600, 1617, 523, 32, 1618,\n\t526, 1600, 1618, 267, 1569, 267, 1570, 268, 1570, 267, 1571, 268, 1571,\n\t267, 1572, 268, 1572, 267, 1573, 268, 1573, 267, 1574, 268, 1574, 269,\n\t1574, 270, 1574, 267, 1575, 268, 1575, 267, 1576, 268, 1576, 269, 1576,\n\t270, 1576, 267, 1577, 268, 1577, 267, 1578, 268, 1578, 269, 1578, 270,\n\t1578, 267, 1579, 268, 1579, 269, 1579, 270, 1579, 267, 1580, 268, 1580,\n\t269, 1580, 270, 1580, 267, 1581, 268, 1581, 269, 1581, 270, 1581, 267,\n\t1582, 268, 1582, 269, 1582, 270, 1582, 267, 1583, 268, 1583, 267, 1584,\n\t268, 1584, 267, 1585, 268, 1585, 267, 1586, 268, 1586, 267, 1587, 268,\n\t1587, 269, 1587, 270, 1587, 267, 1588, 268, 1588, 269, 1588, 270, 1588,\n\t267, 1589, 268, 1589, 269, 1589, 270, 1589, 267, 1590, 268, 1590, 269,\n\t1590, 270, 1590, 267, 1591, 268, 1591, 269, 1591, 270, 1591, 267, 1592,\n\t268, 1592, 269, 1592, 270, 1592, 267, 1593, 268, 1593, 269, 1593, 270,\n\t1593, 267, 1594, 268, 1594, 269, 1594, 270, 1594, 267, 1601, 268, 1601,\n\t269, 1601, 270, 1601, 267, 1602, 268, 1602, 269, 1602, 270, 1602, 267,\n\t1603, 268, 1603, 269, 1603, 270, 1603, 267, 1604, 268, 1604, 269, 1604,\n\t270, 1604, 267, 1605, 268, 1605, 269, 1605, 270, 1605, 267, 1606, 268,\n\t1606, 269, 1606, 270, 1606, 267, 1607, 268, 1607, 269, 1607, 270, 1607,\n\t267, 1608, 268, 1608, 267, 1609, 268, 1609, 267, 1610, 268, 1610, 269,\n\t1610, 270, 1610, 523, 1604, 1570, 524, 1604, 1570, 523, 1604, 1571, 524,\n\t1604, 1571, 523, 1604, 1573, 524, 1604, 1573, 523, 1604, 1575, 524, 1604,\n\t1575, 264, 33, 264, 34, 264, 35, 264, 36, 264, 37, 264, 38, 264, 39, 264,\n\t40, 264, 41, 264, 42, 264, 43, 264, 44, 264, 45, 264, 46, 264, 47, 264,\n\t48, 264, 49, 264, 50, 264, 51, 264, 52, 264, 53, 264, 54, 264, 55, 264,\n\t56, 264, 57, 264, 58, 264, 59, 264, 60, 264, 61, 264, 62, 264, 63, 264,\n\t64, 264, 65, 264, 66, 264, 67, 264, 68, 264, 69, 264, 70, 264, 71, 264,\n\t72, 264, 73, 264, 74, 264, 75, 264, 76, 264, 77, 264, 78, 264, 79, 264,\n\t80, 264, 81, 264, 82, 264, 83, 264, 84, 264, 85, 264, 86, 264, 87, 264,\n\t88, 264, 89, 264, 90, 264, 91, 264, 92, 264, 93, 264, 94, 264, 95, 264,\n\t96, 264, 97, 264, 98, 264, 99, 264, 100, 264, 101, 264, 102, 264, 103,\n\t264, 104, 264, 105, 264, 106, 264, 107, 264, 108, 264, 109, 264, 110,\n\t264, 111, 264, 112, 264, 113, 264, 114, 264, 115, 264, 116, 264, 117,\n\t264, 118, 264, 119, 264, 120, 264, 121, 264, 122, 264, 123, 264, 124,\n\t264, 125, 264, 126, 264, 10629, 264, 10630, 272, 12290, 272, 12300, 272,\n\t12301, 272, 12289, 272, 12539, 272, 12530, 272, 12449, 272, 12451, 272,\n\t12453, 272, 12455, 272, 12457, 272, 12515, 272, 12517, 272, 12519, 272,\n\t12483, 272, 12540, 272, 12450, 272, 12452, 272, 12454, 272, 12456, 272,\n\t12458, 272, 12459, 272, 12461, 272, 12463, 272, 12465, 272, 12467, 272,\n\t12469, 272, 12471, 272, 12473, 272, 12475, 272, 12477, 272, 12479, 272,\n\t12481, 272, 12484, 272, 12486, 272, 12488, 272, 12490, 272, 12491, 272,\n\t12492, 272, 12493, 272, 12494, 272, 12495, 272, 12498, 272, 12501, 272,\n\t12504, 272, 12507, 272, 12510, 272, 12511, 272, 12512, 272, 12513, 272,\n\t12514, 272, 12516, 272, 12518, 272, 12520, 272, 12521, 272, 12522, 272,\n\t12523, 272, 12524, 272, 12525, 272, 12527, 272, 12531, 272, 12441, 272,\n\t12442, 272, 12644, 272, 12593, 272, 12594, 272, 12595, 272, 12596, 272,\n\t12597, 272, 12598, 272, 12599, 272, 12600, 272, 12601, 272, 12602, 272,\n\t12603, 272, 12604, 272, 12605, 272, 12606, 272, 12607, 272, 12608, 272,\n\t12609, 272, 12610, 272, 12611, 272, 12612, 272, 12613, 272, 12614, 272,\n\t12615, 272, 12616, 272, 12617, 272, 12618, 272, 12619, 272, 12620, 272,\n\t12621, 272, 12622, 272, 12623, 272, 12624, 272, 12625, 272, 12626, 272,\n\t12627, 272, 12628, 272, 12629, 272, 12630, 272, 12631, 272, 12632, 272,\n\t12633, 272, 12634, 272, 12635, 272, 12636, 272, 12637, 272, 12638, 272,\n\t12639, 272, 12640, 272, 12641, 272, 12642, 272, 12643, 264, 162, 264,\n\t163, 264, 172, 264, 175, 264, 166, 264, 165, 264, 8361, 272, 9474, 272,\n\t8592, 272, 8593, 272, 8594, 272, 8595, 272, 9632, 272, 9675, 512, 55300,\n\t56473, 55300, 56506, 512, 55300, 56475, 55300, 56506, 512, 55300, 56485,\n\t55300, 56506, 512, 55300, 56625, 55300, 56615, 512, 55300, 56626, 55300,\n\t56615, 512, 55348, 56663, 55348, 56677, 512, 55348, 56664, 55348, 56677,\n\t512, 55348, 56671, 55348, 56686, 512, 55348, 56671, 55348, 56687, 512,\n\t55348, 56671, 55348, 56688, 512, 55348, 56671, 55348, 56689, 512, 55348,\n\t56671, 55348, 56690, 512, 55348, 56761, 55348, 56677, 512, 55348, 56762,\n\t55348, 56677, 512, 55348, 56763, 55348, 56686, 512, 55348, 56764, 55348,\n\t56686, 512, 55348, 56763, 55348, 56687, 512, 55348, 56764, 55348, 56687,\n\t262, 65, 262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262, 72,\n\t262, 73, 262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262, 80,\n\t262, 81, 262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88,\n\t262, 89, 262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262,\n\t102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107, 262, 108, 262,\n\t109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115, 262,\n\t116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65,\n\t262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262, 72, 262, 73,\n\t262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262, 80, 262, 81,\n\t262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262, 89,\n\t262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262, 102, 262,\n\t103, 262, 105, 262, 106, 262, 107, 262, 108, 262, 109, 262, 110, 262,\n\t111, 262, 112, 262, 113, 262, 114, 262, 115, 262, 116, 262, 117, 262,\n\t118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65, 262, 66, 262, 67,\n\t262, 68, 262, 69, 262, 70, 262, 71, 262, 72, 262, 73, 262, 74, 262, 75,\n\t262, 76, 262, 77, 262, 78, 262, 79, 262, 80, 262, 81, 262, 82, 262, 83,\n\t262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262, 89, 262, 90, 262, 97,\n\t262, 98, 262, 99, 262, 100, 262, 101, 262, 102, 262, 103, 262, 104, 262,\n\t105, 262, 106, 262, 107, 262, 108, 262, 109, 262, 110, 262, 111, 262,\n\t112, 262, 113, 262, 114, 262, 115, 262, 116, 262, 117, 262, 118, 262,\n\t119, 262, 120, 262, 121, 262, 122, 262, 65, 262, 67, 262, 68, 262, 71,\n\t262, 74, 262, 75, 262, 78, 262, 79, 262, 80, 262, 81, 262, 83, 262, 84,\n\t262, 85, 262, 86, 262, 87, 262, 88, 262, 89, 262, 90, 262, 97, 262, 98,\n\t262, 99, 262, 100, 262, 102, 262, 104, 262, 105, 262, 106, 262, 107, 262,\n\t108, 262, 109, 262, 110, 262, 112, 262, 113, 262, 114, 262, 115, 262,\n\t116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65,\n\t262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262, 72, 262, 73,\n\t262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262, 80, 262, 81,\n\t262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262, 89,\n\t262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262, 102, 262,\n\t103, 262, 104, 262, 105, 262, 106, 262, 107, 262, 108, 262, 109, 262,\n\t110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115, 262, 116, 262,\n\t117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65, 262, 66,\n\t262, 68, 262, 69, 262, 70, 262, 71, 262, 74, 262, 75, 262, 76, 262, 77,\n\t262, 78, 262, 79, 262, 80, 262, 81, 262, 83, 262, 84, 262, 85, 262, 86,\n\t262, 87, 262, 88, 262, 89, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101,\n\t262, 102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107, 262, 108,\n\t262, 109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115,\n\t262, 116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122,\n\t262, 65, 262, 66, 262, 68, 262, 69, 262, 70, 262, 71, 262, 73, 262, 74,\n\t262, 75, 262, 76, 262, 77, 262, 79, 262, 83, 262, 84, 262, 85, 262, 86,\n\t262, 87, 262, 88, 262, 89, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101,\n\t262, 102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107, 262, 108,\n\t262, 109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115,\n\t262, 116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122,\n\t262, 65, 262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262, 72,\n\t262, 73, 262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262, 80,\n\t262, 81, 262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88,\n\t262, 89, 262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262,\n\t102, 262, 103, 262, 104, 262, 105, 262, 106, 262, 107, 262, 108, 262,\n\t109, 262, 110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115, 262,\n\t116, 262, 117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65,\n\t262, 66, 262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262, 72, 262, 73,\n\t262, 74, 262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262, 80, 262, 81,\n\t262, 82, 262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262, 89,\n\t262, 90, 262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262, 102, 262,\n\t103, 262, 104, 262, 105, 262, 106, 262, 107, 262, 108, 262, 109, 262,\n\t110, 262, 111, 262, 112, 262, 113, 262, 114, 262, 115, 262, 116, 262,\n\t117, 262, 118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65, 262, 66,\n\t262, 67, 262, 68, 262, 69, 262, 70, 262, 71, 262, 72, 262, 73, 262, 74,\n\t262, 75, 262, 76, 262, 77, 262, 78, 262, 79, 262, 80, 262, 81, 262, 82,\n\t262, 83, 262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262, 89, 262, 90,\n\t262, 97, 262, 98, 262, 99, 262, 100, 262, 101, 262, 102, 262, 103, 262,\n\t104, 262, 105, 262, 106, 262, 107, 262, 108, 262, 109, 262, 110, 262,\n\t111, 262, 112, 262, 113, 262, 114, 262, 115, 262, 116, 262, 117, 262,\n\t118, 262, 119, 262, 120, 262, 121, 262, 122, 262, 65, 262, 66, 262, 67,\n\t262, 68, 262, 69, 262, 70, 262, 71, 262, 72, 262, 73, 262, 74, 262, 75,\n\t262, 76, 262, 77, 262, 78, 262, 79, 262, 80, 262, 81, 262, 82, 262, 83,\n\t262, 84, 262, 85, 262, 86, 262, 87, 262, 88, 262, 89, 262, 90, 262, 97,\n\t262, 98, 262, 99, 262, 100, 262, 101, 262, 102, 262, 103, 262, 104, 262,\n\t105, 262, 106, 262, 107, 262, 108, 262, 109, 262, 110, 262, 111, 262,\n\t112, 262, 113, 262, 114, 262, 115, 262, 116, 262, 117, 262, 118, 262,\n\t119, 262, 120, 262, 121, 262, 122, 262, 65, 262, 66, 262, 67, 262, 68,\n\t262, 69, 262, 70, 262, 71, 262, 72, 262, 73, 262, 74, 262, 75, 262, 76,\n\t262, 77, 262, 78, 262, 79, 262, 80, 262, 81, 262, 82, 262, 83, 262, 84,\n\t262, 85, 262, 86, 262, 87, 262, 88, 262, 89, 262, 90, 262, 97, 262, 98,\n\t262, 99, 262, 100, 262, 101, 262, 102, 262, 103, 262, 104, 262, 105, 262,\n\t106, 262, 107, 262, 108, 262, 109, 262, 110, 262, 111, 262, 112, 262,\n\t113, 262, 114, 262, 115, 262, 116, 262, 117, 262, 118, 262, 119, 262,\n\t120, 262, 121, 262, 122, 262, 65, 262, 66, 262, 67, 262, 68, 262, 69,\n\t262, 70, 262, 71, 262, 72, 262, 73, 262, 74, 262, 75, 262, 76, 262, 77,\n\t262, 78, 262, 79, 262, 80, 262, 81, 262, 82, 262, 83, 262, 84, 262, 85,\n\t262, 86, 262, 87, 262, 88, 262, 89, 262, 90, 262, 97, 262, 98, 262, 99,\n\t262, 100, 262, 101, 262, 102, 262, 103, 262, 104, 262, 105, 262, 106,\n\t262, 107, 262, 108, 262, 109, 262, 110, 262, 111, 262, 112, 262, 113,\n\t262, 114, 262, 115, 262, 116, 262, 117, 262, 118, 262, 119, 262, 120,\n\t262, 121, 262, 122, 262, 305, 262, 567, 262, 913, 262, 914, 262, 915,\n\t262, 916, 262, 917, 262, 918, 262, 919, 262, 920, 262, 921, 262, 922,\n\t262, 923, 262, 924, 262, 925, 262, 926, 262, 927, 262, 928, 262, 929,\n\t262, 1012, 262, 931, 262, 932, 262, 933, 262, 934, 262, 935, 262, 936,\n\t262, 937, 262, 8711, 262, 945, 262, 946, 262, 947, 262, 948, 262, 949,\n\t262, 950, 262, 951, 262, 952, 262, 953, 262, 954, 262, 955, 262, 956,\n\t262, 957, 262, 958, 262, 959, 262, 960, 262, 961, 262, 962, 262, 963,\n\t262, 964, 262, 965, 262, 966, 262, 967, 262, 968, 262, 969, 262, 8706,\n\t262, 1013, 262, 977, 262, 1008, 262, 981, 262, 1009, 262, 982, 262, 913,\n\t262, 914, 262, 915, 262, 916, 262, 917, 262, 918, 262, 919, 262, 920,\n\t262, 921, 262, 922, 262, 923, 262, 924, 262, 925, 262, 926, 262, 927,\n\t262, 928, 262, 929, 262, 1012, 262, 931, 262, 932, 262, 933, 262, 934,\n\t262, 935, 262, 936, 262, 937, 262, 8711, 262, 945, 262, 946, 262, 947,\n\t262, 948, 262, 949, 262, 950, 262, 951, 262, 952, 262, 953, 262, 954,\n\t262, 955, 262, 956, 262, 957, 262, 958, 262, 959, 262, 960, 262, 961,\n\t262, 962, 262, 963, 262, 964, 262, 965, 262, 966, 262, 967, 262, 968,\n\t262, 969, 262, 8706, 262, 1013, 262, 977, 262, 1008, 262, 981, 262, 1009,\n\t262, 982, 262, 913, 262, 914, 262, 915, 262, 916, 262, 917, 262, 918,\n\t262, 919, 262, 920, 262, 921, 262, 922, 262, 923, 262, 924, 262, 925,\n\t262, 926, 262, 927, 262, 928, 262, 929, 262, 1012, 262, 931, 262, 932,\n\t262, 933, 262, 934, 262, 935, 262, 936, 262, 937, 262, 8711, 262, 945,\n\t262, 946, 262, 947, 262, 948, 262, 949, 262, 950, 262, 951, 262, 952,\n\t262, 953, 262, 954, 262, 955, 262, 956, 262, 957, 262, 958, 262, 959,\n\t262, 960, 262, 961, 262, 962, 262, 963, 262, 964, 262, 965, 262, 966,\n\t262, 967, 262, 968, 262, 969, 262, 8706, 262, 1013, 262, 977, 262, 1008,\n\t262, 981, 262, 1009, 262, 982, 262, 913, 262, 914, 262, 915, 262, 916,\n\t262, 917, 262, 918, 262, 919, 262, 920, 262, 921, 262, 922, 262, 923,\n\t262, 924, 262, 925, 262, 926, 262, 927, 262, 928, 262, 929, 262, 1012,\n\t262, 931, 262, 932, 262, 933, 262, 934, 262, 935, 262, 936, 262, 937,\n\t262, 8711, 262, 945, 262, 946, 262, 947, 262, 948, 262, 949, 262, 950,\n\t262, 951, 262, 952, 262, 953, 262, 954, 262, 955, 262, 956, 262, 957,\n\t262, 958, 262, 959, 262, 960, 262, 961, 262, 962, 262, 963, 262, 964,\n\t262, 965, 262, 966, 262, 967, 262, 968, 262, 969, 262, 8706, 262, 1013,\n\t262, 977, 262, 1008, 262, 981, 262, 1009, 262, 982, 262, 913, 262, 914,\n\t262, 915, 262, 916, 262, 917, 262, 918, 262, 919, 262, 920, 262, 921,\n\t262, 922, 262, 923, 262, 924, 262, 925, 262, 926, 262, 927, 262, 928,\n\t262, 929, 262, 1012, 262, 931, 262, 932, 262, 933, 262, 934, 262, 935,\n\t262, 936, 262, 937, 262, 8711, 262, 945, 262, 946, 262, 947, 262, 948,\n\t262, 949, 262, 950, 262, 951, 262, 952, 262, 953, 262, 954, 262, 955,\n\t262, 956, 262, 957, 262, 958, 262, 959, 262, 960, 262, 961, 262, 962,\n\t262, 963, 262, 964, 262, 965, 262, 966, 262, 967, 262, 968, 262, 969,\n\t262, 8706, 262, 1013, 262, 977, 262, 1008, 262, 981, 262, 1009, 262, 982,\n\t262, 988, 262, 989, 262, 48, 262, 49, 262, 50, 262, 51, 262, 52, 262, 53,\n\t262, 54, 262, 55, 262, 56, 262, 57, 262, 48, 262, 49, 262, 50, 262, 51,\n\t262, 52, 262, 53, 262, 54, 262, 55, 262, 56, 262, 57, 262, 48, 262, 49,\n\t262, 50, 262, 51, 262, 52, 262, 53, 262, 54, 262, 55, 262, 56, 262, 57,\n\t262, 48, 262, 49, 262, 50, 262, 51, 262, 52, 262, 53, 262, 54, 262, 55,\n\t262, 56, 262, 57, 262, 48, 262, 49, 262, 50, 262, 51, 262, 52, 262, 53,\n\t262, 54, 262, 55, 262, 56, 262, 57, 262, 1575, 262, 1576, 262, 1580, 262,\n\t1583, 262, 1608, 262, 1586, 262, 1581, 262, 1591, 262, 1610, 262, 1603,\n\t262, 1604, 262, 1605, 262, 1606, 262, 1587, 262, 1593, 262, 1601, 262,\n\t1589, 262, 1602, 262, 1585, 262, 1588, 262, 1578, 262, 1579, 262, 1582,\n\t262, 1584, 262, 1590, 262, 1592, 262, 1594, 262, 1646, 262, 1722, 262,\n\t1697, 262, 1647, 262, 1576, 262, 1580, 262, 1607, 262, 1581, 262, 1610,\n\t262, 1603, 262, 1604, 262, 1605, 262, 1606, 262, 1587, 262, 1593, 262,\n\t1601, 262, 1589, 262, 1602, 262, 1588, 262, 1578, 262, 1579, 262, 1582,\n\t262, 1590, 262, 1594, 262, 1580, 262, 1581, 262, 1610, 262, 1604, 262,\n\t1606, 262, 1587, 262, 1593, 262, 1589, 262, 1602, 262, 1588, 262, 1582,\n\t262, 1590, 262, 1594, 262, 1722, 262, 1647, 262, 1576, 262, 1580, 262,\n\t1607, 262, 1581, 262, 1591, 262, 1610, 262, 1603, 262, 1605, 262, 1606,\n\t262, 1587, 262, 1593, 262, 1601, 262, 1589, 262, 1602, 262, 1588, 262,\n\t1578, 262, 1579, 262, 1582, 262, 1590, 262, 1592, 262, 1594, 262, 1646,\n\t262, 1697, 262, 1575, 262, 1576, 262, 1580, 262, 1583, 262, 1607, 262,\n\t1608, 262, 1586, 262, 1581, 262, 1591, 262, 1610, 262, 1604, 262, 1605,\n\t262, 1606, 262, 1587, 262, 1593, 262, 1601, 262, 1589, 262, 1602, 262,\n\t1585, 262, 1588, 262, 1578, 262, 1579, 262, 1582, 262, 1584, 262, 1590,\n\t262, 1592, 262, 1594, 262, 1576, 262, 1580, 262, 1583, 262, 1608, 262,\n\t1586, 262, 1581, 262, 1591, 262, 1610, 262, 1604, 262, 1605, 262, 1606,\n\t262, 1587, 262, 1593, 262, 1601, 262, 1589, 262, 1602, 262, 1585, 262,\n\t1588, 262, 1578, 262, 1579, 262, 1582, 262, 1584, 262, 1590, 262, 1592,\n\t262, 1594, 514, 48, 46, 514, 48, 44, 514, 49, 44, 514, 50, 44, 514, 51,\n\t44, 514, 52, 44, 514, 53, 44, 514, 54, 44, 514, 55, 44, 514, 56, 44, 514,\n\t57, 44, 770, 40, 65, 41, 770, 40, 66, 41, 770, 40, 67, 41, 770, 40, 68,\n\t41, 770, 40, 69, 41, 770, 40, 70, 41, 770, 40, 71, 41, 770, 40, 72, 41,\n\t770, 40, 73, 41, 770, 40, 74, 41, 770, 40, 75, 41, 770, 40, 76, 41, 770,\n\t40, 77, 41, 770, 40, 78, 41, 770, 40, 79, 41, 770, 40, 80, 41, 770, 40,\n\t81, 41, 770, 40, 82, 41, 770, 40, 83, 41, 770, 40, 84, 41, 770, 40, 85,\n\t41, 770, 40, 86, 41, 770, 40, 87, 41, 770, 40, 88, 41, 770, 40, 89, 41,\n\t770, 40, 90, 41, 770, 12308, 83, 12309, 263, 67, 263, 82, 519, 67, 68,\n\t519, 87, 90, 266, 65, 266, 66, 266, 67, 266, 68, 266, 69, 266, 70, 266,\n\t71, 266, 72, 266, 73, 266, 74, 266, 75, 266, 76, 266, 77, 266, 78, 266,\n\t79, 266, 80, 266, 81, 266, 82, 266, 83, 266, 84, 266, 85, 266, 86, 266,\n\t87, 266, 88, 266, 89, 266, 90, 522, 72, 86, 522, 77, 86, 522, 83, 68,\n\t522, 83, 83, 778, 80, 80, 86, 522, 87, 67, 515, 77, 67, 515, 77, 68, 522,\n\t68, 74, 522, 12411, 12363, 522, 12467, 12467, 266, 12469, 266, 25163,\n\t266, 23383, 266, 21452, 266, 12487, 266, 20108, 266, 22810, 266, 35299,\n\t266, 22825, 266, 20132, 266, 26144, 266, 28961, 266, 26009, 266, 21069,\n\t266, 24460, 266, 20877, 266, 26032, 266, 21021, 266, 32066, 266, 29983,\n\t266, 36009, 266, 22768, 266, 21561, 266, 28436, 266, 25237, 266, 25429,\n\t266, 19968, 266, 19977, 266, 36938, 266, 24038, 266, 20013, 266, 21491,\n\t266, 25351, 266, 36208, 266, 25171, 266, 31105, 266, 31354, 266, 21512,\n\t266, 28288, 266, 26377, 266, 26376, 266, 30003, 266, 21106, 266, 21942,\n\t770, 12308, 26412, 12309, 770, 12308, 19977, 12309, 770, 12308, 20108,\n\t12309, 770, 12308, 23433, 12309, 770, 12308, 28857, 12309, 770, 12308,\n\t25171, 12309, 770, 12308, 30423, 12309, 770, 12308, 21213, 12309, 770,\n\t12308, 25943, 12309, 263, 24471, 263, 21487, 256, 20029, 256, 20024, 256,\n\t20033, 256, 55360, 56610, 256, 20320, 256, 20398, 256, 20411, 256, 20482,\n\t256, 20602, 256, 20633, 256, 20711, 256, 20687, 256, 13470, 256, 55361,\n\t56890, 256, 20813, 256, 20820, 256, 20836, 256, 20855, 256, 55361, 56604,\n\t256, 13497, 256, 20839, 256, 20877, 256, 55361, 56651, 256, 20887, 256,\n\t20900, 256, 20172, 256, 20908, 256, 20917, 256, 55396, 56799, 256, 20981,\n\t256, 20995, 256, 13535, 256, 21051, 256, 21062, 256, 21106, 256, 21111,\n\t256, 13589, 256, 21191, 256, 21193, 256, 21220, 256, 21242, 256, 21253,\n\t256, 21254, 256, 21271, 256, 21321, 256, 21329, 256, 21338, 256, 21363,\n\t256, 21373, 256, 21375, 256, 21375, 256, 21375, 256, 55362, 56876, 256,\n\t28784, 256, 21450, 256, 21471, 256, 55362, 57187, 256, 21483, 256, 21489,\n\t256, 21510, 256, 21662, 256, 21560, 256, 21576, 256, 21608, 256, 21666,\n\t256, 21750, 256, 21776, 256, 21843, 256, 21859, 256, 21892, 256, 21892,\n\t256, 21913, 256, 21931, 256, 21939, 256, 21954, 256, 22294, 256, 22022,\n\t256, 22295, 256, 22097, 256, 22132, 256, 20999, 256, 22766, 256, 22478,\n\t256, 22516, 256, 22541, 256, 22411, 256, 22578, 256, 22577, 256, 22700,\n\t256, 55365, 56548, 256, 22770, 256, 22775, 256, 22790, 256, 22810, 256,\n\t22818, 256, 22882, 256, 55365, 57000, 256, 55365, 57066, 256, 23020, 256,\n\t23067, 256, 23079, 256, 23000, 256, 23142, 256, 14062, 256, 14076, 256,\n\t23304, 256, 23358, 256, 23358, 256, 55366, 56776, 256, 23491, 256, 23512,\n\t256, 23527, 256, 23539, 256, 55366, 57112, 256, 23551, 256, 23558, 256,\n\t24403, 256, 23586, 256, 14209, 256, 23648, 256, 23662, 256, 23744, 256,\n\t23693, 256, 55367, 56804, 256, 23875, 256, 55367, 56806, 256, 23918, 256,\n\t23915, 256, 23932, 256, 24033, 256, 24034, 256, 14383, 256, 24061, 256,\n\t24104, 256, 24125, 256, 24169, 256, 14434, 256, 55368, 56707, 256, 14460,\n\t256, 24240, 256, 24243, 256, 24246, 256, 24266, 256, 55400, 57234, 256,\n\t24318, 256, 55368, 57137, 256, 55368, 57137, 256, 33281, 256, 24354, 256,\n\t24354, 256, 14535, 256, 55372, 57016, 256, 55384, 56794, 256, 24418, 256,\n\t24427, 256, 14563, 256, 24474, 256, 24525, 256, 24535, 256, 24569, 256,\n\t24705, 256, 14650, 256, 14620, 256, 24724, 256, 55369, 57044, 256, 24775,\n\t256, 24904, 256, 24908, 256, 24910, 256, 24908, 256, 24954, 256, 24974,\n\t256, 25010, 256, 24996, 256, 25007, 256, 25054, 256, 25074, 256, 25078,\n\t256, 25104, 256, 25115, 256, 25181, 256, 25265, 256, 25300, 256, 25424,\n\t256, 55370, 57100, 256, 25405, 256, 25340, 256, 25448, 256, 25475, 256,\n\t25572, 256, 55370, 57329, 256, 25634, 256, 25541, 256, 25513, 256, 14894,\n\t256, 25705, 256, 25726, 256, 25757, 256, 25719, 256, 14956, 256, 25935,\n\t256, 25964, 256, 55372, 56330, 256, 26083, 256, 26360, 256, 26185, 256,\n\t15129, 256, 26257, 256, 15112, 256, 15076, 256, 20882, 256, 20885, 256,\n\t26368, 256, 26268, 256, 32941, 256, 17369, 256, 26391, 256, 26395, 256,\n\t26401, 256, 26462, 256, 26451, 256, 55372, 57283, 256, 15177, 256, 26618,\n\t256, 26501, 256, 26706, 256, 26757, 256, 55373, 56429, 256, 26766, 256,\n\t26655, 256, 26900, 256, 15261, 256, 26946, 256, 27043, 256, 27114, 256,\n\t27304, 256, 55373, 56995, 256, 27355, 256, 15384, 256, 27425, 256, 55374,\n\t56487, 256, 27476, 256, 15438, 256, 27506, 256, 27551, 256, 27578, 256,\n\t27579, 256, 55374, 56973, 256, 55367, 56587, 256, 55374, 57082, 256,\n\t27726, 256, 55375, 56508, 256, 27839, 256, 27853, 256, 27751, 256, 27926,\n\t256, 27966, 256, 28023, 256, 27969, 256, 28009, 256, 28024, 256, 28037,\n\t256, 55375, 56606, 256, 27956, 256, 28207, 256, 28270, 256, 15667, 256,\n\t28363, 256, 28359, 256, 55375, 57041, 256, 28153, 256, 28526, 256, 55375,\n\t57182, 256, 55375, 57230, 256, 28614, 256, 28729, 256, 28702, 256, 28699,\n\t256, 15766, 256, 28746, 256, 28797, 256, 28791, 256, 28845, 256, 55361,\n\t56613, 256, 28997, 256, 55376, 56931, 256, 29084, 256, 55376, 57259, 256,\n\t29224, 256, 29237, 256, 29264, 256, 55377, 56840, 256, 29312, 256, 29333,\n\t256, 55377, 57141, 256, 55378, 56340, 256, 29562, 256, 29579, 256, 16044,\n\t256, 29605, 256, 16056, 256, 16056, 256, 29767, 256, 29788, 256, 29809,\n\t256, 29829, 256, 29898, 256, 16155, 256, 29988, 256, 55379, 56374, 256,\n\t30014, 256, 55379, 56466, 256, 30064, 256, 55368, 56735, 256, 30224, 256,\n\t55379, 57249, 256, 55379, 57272, 256, 55380, 56388, 256, 16380, 256,\n\t16392, 256, 30452, 256, 55380, 56563, 256, 55380, 56562, 256, 55380,\n\t56601, 256, 55380, 56627, 256, 30494, 256, 30495, 256, 30495, 256, 30538,\n\t256, 16441, 256, 30603, 256, 16454, 256, 16534, 256, 55381, 56349, 256,\n\t30798, 256, 30860, 256, 30924, 256, 16611, 256, 55381, 56870, 256, 31062,\n\t256, 55381, 56986, 256, 55381, 57029, 256, 31119, 256, 31211, 256, 16687,\n\t256, 31296, 256, 31306, 256, 31311, 256, 55382, 56700, 256, 55382, 56999,\n\t256, 55382, 56999, 256, 31470, 256, 16898, 256, 55382, 57259, 256, 31686,\n\t256, 31689, 256, 16935, 256, 55383, 56448, 256, 31954, 256, 17056, 256,\n\t31976, 256, 31971, 256, 32000, 256, 55383, 57222, 256, 32099, 256, 17153,\n\t256, 32199, 256, 32258, 256, 32325, 256, 17204, 256, 55384, 56872, 256,\n\t55384, 56903, 256, 17241, 256, 55384, 57049, 256, 32634, 256, 55384,\n\t57150, 256, 32661, 256, 32762, 256, 32773, 256, 55385, 56538, 256, 55385,\n\t56611, 256, 32864, 256, 55385, 56744, 256, 32880, 256, 55372, 57183, 256,\n\t17365, 256, 32946, 256, 33027, 256, 17419, 256, 33086, 256, 23221, 256,\n\t55385, 57255, 256, 55385, 57269, 256, 55372, 57235, 256, 55372, 57244,\n\t256, 33281, 256, 33284, 256, 36766, 256, 17515, 256, 33425, 256, 33419,\n\t256, 33437, 256, 21171, 256, 33457, 256, 33459, 256, 33469, 256, 33510,\n\t256, 55386, 57148, 256, 33509, 256, 33565, 256, 33635, 256, 33709, 256,\n\t33571, 256, 33725, 256, 33767, 256, 33879, 256, 33619, 256, 33738, 256,\n\t33740, 256, 33756, 256, 55387, 56374, 256, 55387, 56683, 256, 55387,\n\t56533, 256, 17707, 256, 34033, 256, 34035, 256, 34070, 256, 55388, 57290,\n\t256, 34148, 256, 55387, 57132, 256, 17757, 256, 17761, 256, 55387, 57265,\n\t256, 55388, 56530, 256, 17771, 256, 34384, 256, 34396, 256, 34407, 256,\n\t34409, 256, 34473, 256, 34440, 256, 34574, 256, 34530, 256, 34681, 256,\n\t34600, 256, 34667, 256, 34694, 256, 17879, 256, 34785, 256, 34817, 256,\n\t17913, 256, 34912, 256, 34915, 256, 55389, 56935, 256, 35031, 256, 35038,\n\t256, 17973, 256, 35066, 256, 13499, 256, 55390, 56494, 256, 55390, 56678,\n\t256, 18110, 256, 18119, 256, 35488, 256, 35565, 256, 35722, 256, 35925,\n\t256, 55391, 56488, 256, 36011, 256, 36033, 256, 36123, 256, 36215, 256,\n\t55391, 57135, 256, 55362, 56324, 256, 36299, 256, 36284, 256, 36336, 256,\n\t55362, 56542, 256, 36564, 256, 36664, 256, 55393, 56786, 256, 55393,\n\t56813, 256, 37012, 256, 37105, 256, 37137, 256, 55393, 57134, 256, 37147,\n\t256, 37432, 256, 37591, 256, 37592, 256, 37500, 256, 37881, 256, 37909,\n\t256, 55394, 57338, 256, 38283, 256, 18837, 256, 38327, 256, 55395, 56695,\n\t256, 18918, 256, 38595, 256, 23986, 256, 38691, 256, 55396, 56645, 256,\n\t55396, 56858, 256, 19054, 256, 19062, 256, 38880, 256, 55397, 56330, 256,\n\t19122, 256, 55397, 56470, 256, 38923, 256, 38923, 256, 38953, 256, 55397,\n\t56758, 256, 39138, 256, 19251, 256, 39209, 256, 39335, 256, 39362, 256,\n\t39422, 256, 19406, 256, 55398, 57136, 256, 39698, 256, 40000, 256, 40189,\n\t256, 19662, 256, 19693, 256, 40295, 256, 55400, 56526, 256, 19704, 256,\n\t55400, 56581, 256, 55400, 56846, 256, 55400, 56977, 256, 40635, 256,\n\t19798, 256, 40697, 256, 40702, 256, 40709, 256, 40719, 256, 40726, 256,\n\t40763, 256, 55401, 56832,\n};\n\n/* index tables for the decomposition data */\n#define DECOMP_SHIFT1 6\n#define DECOMP_SHIFT2 4\nstatic const unsigned char decomp_index0[] = {\n\t0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 13, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 14, 15, 5, 5, 5, 5, 16, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 17, 18,\n\t5, 5, 5, 5, 5, 19, 20, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t21, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n\t5, 5, 5, 5, 5, 5, 5, 5, 5, 5,\n};\n\nstatic const unsigned short decomp_index1[] = {\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,\n\t14, 0, 0, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 0, 0, 0, 0, 0, 0, 0,\n\t25, 0, 26, 27, 0, 0, 0, 0, 0, 28, 0, 0, 29, 30, 31, 32, 33, 34, 35, 0,\n\t36, 37, 38, 0, 39, 0, 40, 0, 41, 0, 0, 0, 0, 42, 43, 44, 45, 0, 0, 0, 0,\n\t0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 48, 0, 0, 0,\n\t0, 49, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 52, 0, 53, 0, 0, 0, 0,\n\t0, 0, 54, 55, 0, 0, 0, 0, 0, 56, 0, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 58, 59, 0, 0, 0, 60, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0,\n\t0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0,\n\t0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 67, 0, 68, 0, 0, 69, 0, 0, 0, 70,\n\t71, 72, 73, 74, 75, 76, 77, 0, 0, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 0,\n\t82, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 84, 85, 86, 87, 88, 89, 0, 90, 91, 92, 0, 0, 0, 0,\n\t93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,\n\t109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,\n\t123, 124, 125, 126, 127, 128, 129, 130, 0, 131, 132, 133, 134, 0, 0, 0,\n\t0, 0, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 0, 146, 0,\n\t0, 0, 147, 0, 148, 149, 150, 0, 151, 152, 153, 0, 154, 0, 0, 0, 155, 0,\n\t0, 0, 156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 157,\n\t158, 159, 160, 161, 162, 163, 164, 165, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 166, 0,\n\t0, 0, 0, 0, 0, 167, 0, 0, 0, 0, 0, 168, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 169, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t171, 0, 0, 0, 0, 0, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,\n\t182, 183, 184, 185, 186, 0, 0, 187, 0, 0, 188, 189, 190, 191, 192, 0,\n\t193, 194, 195, 196, 197, 0, 198, 0, 0, 0, 199, 200, 201, 202, 203, 204,\n\t205, 0, 0, 0, 0, 0, 0, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215,\n\t216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229,\n\t230, 231, 232, 233, 234, 235, 236, 237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 238, 0, 0, 0,\n\t0, 0, 0, 0, 239, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240,\n\t241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254,\n\t255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268,\n\t269, 0, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 0,\n\t282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295,\n\t296, 297, 298, 299, 300, 301, 302, 303, 304, 0, 305, 306, 307, 308, 309,\n\t310, 311, 312, 0, 0, 313, 0, 314, 0, 315, 316, 317, 318, 319, 320, 321,\n\t322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335,\n\t336, 337, 338, 339, 340, 341, 342, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 343,\n\t344, 0, 0, 0, 0, 0, 0, 0, 345, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 346, 347, 0, 0, 0, 0, 348, 349, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363,\n\t364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377,\n\t378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391,\n\t392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405,\n\t406, 407, 408, 409, 410, 411, 412, 413, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 414, 415,\n\t416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 426, 427, 428, 429, 430, 0, 431, 0, 0, 432, 0, 0, 0, 0, 0, 0,\n\t433, 434, 435, 436, 437, 438, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 439, 440, 441, 442, 443, 444, 445,\n\t446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459,\n\t460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0,\n};\n\nstatic const unsigned short decomp_index2[] = {\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,\n\t3, 0, 6, 0, 0, 0, 0, 8, 0, 0, 11, 13, 15, 18, 0, 0, 20, 23, 25, 0, 27,\n\t31, 35, 0, 39, 42, 45, 48, 51, 54, 0, 57, 60, 63, 66, 69, 72, 75, 78, 81,\n\t0, 84, 87, 90, 93, 96, 99, 0, 0, 102, 105, 108, 111, 114, 0, 0, 117, 120,\n\t123, 126, 129, 132, 0, 135, 138, 141, 144, 147, 150, 153, 156, 159, 0,\n\t162, 165, 168, 171, 174, 177, 0, 0, 180, 183, 186, 189, 192, 0, 195, 198,\n\t201, 204, 207, 210, 213, 216, 219, 222, 225, 228, 231, 234, 237, 240,\n\t243, 0, 0, 246, 249, 252, 255, 258, 261, 264, 267, 270, 273, 276, 279,\n\t282, 285, 288, 291, 294, 297, 300, 303, 0, 0, 306, 309, 312, 315, 318,\n\t321, 324, 327, 330, 0, 333, 336, 339, 342, 345, 348, 0, 351, 354, 357,\n\t360, 363, 366, 369, 372, 0, 0, 375, 378, 381, 384, 387, 390, 393, 0, 0,\n\t396, 399, 402, 405, 408, 411, 0, 0, 414, 417, 420, 423, 426, 429, 432,\n\t435, 438, 441, 444, 447, 450, 453, 456, 459, 462, 465, 0, 0, 468, 471,\n\t474, 477, 480, 483, 486, 489, 492, 495, 498, 501, 504, 507, 510, 513,\n\t516, 519, 522, 525, 528, 531, 534, 537, 539, 542, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 545, 548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 551, 554, 557, 560, 563, 566, 569, 572, 575, 578, 581, 584, 587,\n\t590, 593, 596, 599, 602, 605, 608, 611, 614, 617, 620, 623, 0, 626, 629,\n\t632, 635, 638, 641, 0, 0, 644, 647, 650, 653, 656, 659, 662, 665, 668,\n\t671, 674, 677, 680, 683, 686, 689, 0, 0, 692, 695, 698, 701, 704, 707,\n\t710, 713, 716, 719, 722, 725, 728, 731, 734, 737, 740, 743, 746, 749,\n\t752, 755, 758, 761, 764, 767, 770, 773, 776, 779, 782, 785, 788, 791,\n\t794, 797, 0, 0, 800, 803, 0, 0, 0, 0, 0, 0, 806, 809, 812, 815, 818, 821,\n\t824, 827, 830, 833, 836, 839, 842, 845, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 848, 850, 852, 854, 856, 858, 860, 862, 864, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 866, 869, 872, 875, 878, 881, 0, 0, 884, 886, 888,\n\t890, 892, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 894, 896, 0, 898, 900, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 903, 0, 0, 0, 0, 0, 905, 0, 0, 0,\n\t908, 0, 0, 0, 0, 0, 910, 913, 916, 919, 921, 924, 927, 0, 930, 0, 933,\n\t936, 939, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 942, 945, 948, 951, 954, 957, 960, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 963, 966, 969, 972, 975,\n\t0, 978, 980, 982, 984, 987, 990, 992, 0, 0, 0, 0, 0, 0, 0, 0, 0, 994,\n\t996, 998, 0, 1000, 1002, 0, 0, 0, 1004, 0, 0, 0, 0, 0, 0, 1006, 1009, 0,\n\t1012, 0, 0, 0, 1015, 0, 0, 0, 0, 1018, 1021, 1024, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 1027, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1030, 0, 0,\n\t0, 0, 0, 0, 1033, 1036, 0, 1039, 0, 0, 0, 1042, 0, 0, 0, 0, 1045, 1048,\n\t1051, 0, 0, 0, 0, 0, 0, 0, 1054, 1057, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1060,\n\t1063, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1066, 1069, 1072, 1075, 0,\n\t0, 1078, 1081, 0, 0, 1084, 1087, 1090, 1093, 1096, 1099, 0, 0, 1102,\n\t1105, 1108, 1111, 1114, 1117, 0, 0, 1120, 1123, 1126, 1129, 1132, 1135,\n\t1138, 1141, 1144, 1147, 1150, 1153, 0, 0, 1156, 1159, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 1162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1165, 1168,\n\t1171, 1174, 1177, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1180, 1183,\n\t1186, 1189, 0, 0, 0, 0, 0, 0, 0, 1192, 0, 1195, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 1198, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 1201, 0, 0, 0, 0, 0, 0, 0, 1204, 0, 0, 1207, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1210, 1213, 1216,\n\t1219, 1222, 1225, 1228, 1231, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1234,\n\t1237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1240, 1243, 0, 1246,\n\t0, 0, 0, 1249, 0, 0, 1252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 1255, 1258, 1261, 0, 0, 1264, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1267,\n\t0, 0, 1270, 1273, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1276,\n\t1279, 0, 0, 0, 0, 0, 0, 1282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 1285, 1288, 1291, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t1294, 0, 0, 0, 0, 0, 0, 0, 1297, 0, 0, 0, 0, 0, 0, 1300, 1303, 0, 1306,\n\t1309, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1312, 1315, 1318, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1321, 0, 1324, 1327, 1330, 0, 0, 0, 0,\n\t1333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1336, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1339, 1342, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1345, 0, 0, 0, 0, 0, 0, 1347, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 1350, 0, 0, 0, 0, 1353, 0, 0, 0, 0, 1356, 0, 0,\n\t0, 0, 1359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1362, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 1365, 0, 1368, 1371, 1374, 1377, 1380, 0, 0, 0, 0, 0, 0, 0,\n\t1383, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1386, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 1389, 0, 0, 0, 0, 1392, 0, 0, 0, 0, 1395, 0, 0, 0, 0,\n\t1398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1401, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 1404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 1407, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1409, 0, 1412, 0, 1415, 0,\n\t1418, 0, 1421, 0, 0, 0, 1424, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1427, 0, 1430, 0, 0, 1433, 1436, 0, 1439,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t1442, 1444, 1446, 0, 1448, 1450, 1452, 1454, 1456, 1458, 1460, 1462,\n\t1464, 1466, 1468, 0, 1470, 1472, 1474, 1476, 1478, 1480, 1482, 1484,\n\t1486, 1488, 1490, 1492, 1494, 1496, 1498, 1500, 1502, 1504, 0, 1506,\n\t1508, 1510, 1512, 1514, 1516, 1518, 1520, 1522, 1524, 1526, 1528, 1530,\n\t1532, 1534, 1536, 1538, 1540, 1542, 1544, 1546, 1548, 1550, 1552, 1554,\n\t1556, 1558, 1560, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1562, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1564, 1566, 1568, 1570,\n\t1572, 1574, 1576, 1578, 1580, 1582, 1584, 1586, 1588, 1590, 1592, 1594,\n\t1596, 1598, 1600, 1602, 1604, 1606, 1608, 1610, 1612, 1614, 1616, 1618,\n\t1620, 1622, 1624, 1626, 1628, 1630, 1632, 1634, 1636, 1638, 1641, 1644,\n\t1647, 1650, 1653, 1656, 1659, 1662, 1665, 1668, 1671, 1674, 1677, 1680,\n\t1683, 1686, 1689, 1692, 1695, 1698, 1701, 1704, 1707, 1710, 1713, 1716,\n\t1719, 1722, 1725, 1728, 1731, 1734, 1737, 1740, 1743, 1746, 1749, 1752,\n\t1755, 1758, 1761, 1764, 1767, 1770, 1773, 1776, 1779, 1782, 1785, 1788,\n\t1791, 1794, 1797, 1800, 1803, 1806, 1809, 1812, 1815, 1818, 1821, 1824,\n\t1827, 1830, 1833, 1836, 1839, 1842, 1845, 1848, 1851, 1854, 1857, 1860,\n\t1863, 1866, 1869, 1872, 1875, 1878, 1881, 1884, 1887, 1890, 1893, 1896,\n\t1899, 1902, 1905, 1908, 1911, 1914, 1917, 1920, 1923, 1926, 1929, 1932,\n\t1935, 1938, 1941, 1944, 1947, 1950, 1953, 1956, 1959, 1962, 1965, 1968,\n\t1971, 1974, 1977, 1980, 1983, 1986, 1989, 1992, 1995, 1998, 2001, 2004,\n\t2007, 2010, 2013, 2016, 2019, 2022, 2025, 2028, 2031, 2034, 2037, 2040,\n\t2043, 2046, 2049, 2052, 2055, 2058, 2061, 2064, 2067, 2070, 2073, 2076,\n\t2079, 2082, 2085, 2088, 2091, 2094, 2097, 2100, 2103, 0, 0, 0, 0, 2106,\n\t2109, 2112, 2115, 2118, 2121, 2124, 2127, 2130, 2133, 2136, 2139, 2142,\n\t2145, 2148, 2151, 2154, 2157, 2160, 2163, 2166, 2169, 2172, 2175, 2178,\n\t2181, 2184, 2187, 2190, 2193, 2196, 2199, 2202, 2205, 2208, 2211, 2214,\n\t2217, 2220, 2223, 2226, 2229, 2232, 2235, 2238, 2241, 2244, 2247, 2250,\n\t2253, 2256, 2259, 2262, 2265, 2268, 2271, 2274, 2277, 2280, 2283, 2286,\n\t2289, 2292, 2295, 2298, 2301, 2304, 2307, 2310, 2313, 2316, 2319, 2322,\n\t2325, 2328, 2331, 2334, 2337, 2340, 2343, 2346, 2349, 2352, 2355, 2358,\n\t2361, 2364, 2367, 2370, 2373, 0, 0, 0, 0, 0, 0, 2376, 2379, 2382, 2385,\n\t2388, 2391, 2394, 2397, 2400, 2403, 2406, 2409, 2412, 2415, 2418, 2421,\n\t2424, 2427, 2430, 2433, 2436, 2439, 0, 0, 2442, 2445, 2448, 2451, 2454,\n\t2457, 0, 0, 2460, 2463, 2466, 2469, 2472, 2475, 2478, 2481, 2484, 2487,\n\t2490, 2493, 2496, 2499, 2502, 2505, 2508, 2511, 2514, 2517, 2520, 2523,\n\t2526, 2529, 2532, 2535, 2538, 2541, 2544, 2547, 2550, 2553, 2556, 2559,\n\t2562, 2565, 2568, 2571, 0, 0, 2574, 2577, 2580, 2583, 2586, 2589, 0, 0,\n\t2592, 2595, 2598, 2601, 2604, 2607, 2610, 2613, 0, 2616, 0, 2619, 0,\n\t2622, 0, 2625, 2628, 2631, 2634, 2637, 2640, 2643, 2646, 2649, 2652,\n\t2655, 2658, 2661, 2664, 2667, 2670, 2673, 2676, 2679, 2681, 2684, 2686,\n\t2689, 2691, 2694, 2696, 2699, 2701, 2704, 2706, 2709, 0, 0, 2711, 2714,\n\t2717, 2720, 2723, 2726, 2729, 2732, 2735, 2738, 2741, 2744, 2747, 2750,\n\t2753, 2756, 2759, 2762, 2765, 2768, 2771, 2774, 2777, 2780, 2783, 2786,\n\t2789, 2792, 2795, 2798, 2801, 2804, 2807, 2810, 2813, 2816, 2819, 2822,\n\t2825, 2828, 2831, 2834, 2837, 2840, 2843, 2846, 2849, 2852, 2855, 2858,\n\t2861, 2864, 2867, 0, 2870, 2873, 2876, 2879, 2882, 2885, 2887, 2890,\n\t2893, 2895, 2898, 2901, 2904, 2907, 2910, 0, 2913, 2916, 2919, 2922,\n\t2924, 2927, 2929, 2932, 2935, 2938, 2941, 2944, 2947, 2950, 0, 0, 2952,\n\t2955, 2958, 2961, 2964, 2967, 0, 2969, 2972, 2975, 2978, 2981, 2984,\n\t2987, 2989, 2992, 2995, 2998, 3001, 3004, 3007, 3010, 3012, 3015, 3018,\n\t3020, 0, 0, 3022, 3025, 3028, 0, 3031, 3034, 3037, 3040, 3042, 3045,\n\t3047, 3050, 3052, 0, 3055, 3057, 3059, 3061, 3063, 3065, 3067, 3069,\n\t3071, 3073, 3075, 0, 0, 0, 0, 0, 0, 3077, 0, 0, 0, 0, 0, 3079, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 3082, 3084, 3087, 0, 0, 0, 0, 0, 0, 0, 0,\n\t3091, 0, 0, 0, 3093, 3096, 0, 3100, 3103, 0, 0, 0, 0, 3107, 0, 3110, 0,\n\t0, 0, 0, 0, 0, 0, 0, 3113, 3116, 3119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 3122, 0, 0, 0, 0, 0, 0, 0, 3127, 3129, 3131, 0, 0, 3133, 3135,\n\t3137, 3139, 3141, 3143, 3145, 3147, 3149, 3151, 3153, 3155, 3157, 3159,\n\t3161, 3163, 3165, 3167, 3169, 3171, 3173, 3175, 3177, 3179, 3181, 3183,\n\t3185, 0, 3187, 3189, 3191, 3193, 3195, 3197, 3199, 3201, 3203, 3205,\n\t3207, 3209, 3211, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3213, 0, 0, 0, 0, 0,\n\t0, 0, 3216, 3220, 3224, 3226, 0, 3229, 3233, 3237, 0, 3239, 3242, 3244,\n\t3246, 3248, 3250, 3252, 3254, 3256, 3258, 3260, 0, 3262, 3264, 0, 0,\n\t3267, 3269, 3271, 3273, 3275, 0, 0, 3277, 3280, 3284, 0, 3287, 0, 3289,\n\t0, 3291, 0, 3293, 3295, 3297, 3299, 0, 3301, 3303, 3305, 0, 3307, 3309,\n\t3311, 3313, 3315, 3317, 3319, 0, 3321, 3325, 3327, 3329, 3331, 3333, 0,\n\t0, 0, 0, 3335, 3337, 3339, 3341, 3343, 0, 0, 0, 0, 0, 0, 3345, 3349,\n\t3353, 3358, 3362, 3366, 3370, 3374, 3378, 3382, 3386, 3390, 3394, 3398,\n\t3402, 3406, 3409, 3411, 3414, 3418, 3421, 3423, 3426, 3430, 3435, 3438,\n\t3440, 3443, 3447, 3449, 3451, 3453, 3455, 3457, 3460, 3464, 3467, 3469,\n\t3472, 3476, 3481, 3484, 3486, 3489, 3493, 3495, 3497, 3499, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 3501, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t3505, 3508, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3511,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3514, 3517, 3520, 0, 0, 0, 0,\n\t3523, 0, 0, 0, 0, 3526, 0, 0, 3529, 0, 0, 0, 0, 0, 0, 0, 3532, 0, 3535,\n\t0, 0, 0, 0, 0, 3538, 3541, 0, 3545, 3548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 3552, 0, 0, 3555, 0, 0, 3558, 0, 3561, 0, 0, 0, 0, 0,\n\t0, 3564, 0, 3567, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3570, 3573, 3576, 3579,\n\t3582, 0, 0, 3585, 3588, 0, 0, 3591, 3594, 0, 0, 0, 0, 0, 0, 3597, 3600,\n\t0, 0, 3603, 3606, 0, 0, 3609, 3612, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 3615, 3618, 3621, 3624, 3627, 3630, 3633, 3636, 0, 0,\n\t0, 0, 0, 0, 3639, 3642, 3645, 3648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t3651, 3653, 0, 0, 0, 0, 0, 3655, 3657, 3659, 3661, 3663, 3665, 3667,\n\t3669, 3671, 3673, 3676, 3679, 3682, 3685, 3688, 3691, 3694, 3697, 3700,\n\t3703, 3706, 3710, 3714, 3718, 3722, 3726, 3730, 3734, 3738, 3742, 3747,\n\t3752, 3757, 3762, 3767, 3772, 3777, 3782, 3787, 3792, 3797, 3800, 3803,\n\t3806, 3809, 3812, 3815, 3818, 3821, 3824, 3828, 3832, 3836, 3840, 3844,\n\t3848, 3852, 3856, 3860, 3864, 3868, 3872, 3876, 3880, 3884, 3888, 3892,\n\t3896, 3900, 3904, 3908, 3912, 3916, 3920, 3924, 3928, 3932, 3936, 3940,\n\t3944, 3948, 3952, 3956, 3960, 3964, 3968, 3972, 3974, 3976, 3978, 3980,\n\t3982, 3984, 3986, 3988, 3990, 3992, 3994, 3996, 3998, 4000, 4002, 4004,\n\t4006, 4008, 4010, 4012, 4014, 4016, 4018, 4020, 4022, 4024, 4026, 4028,\n\t4030, 4032, 4034, 4036, 4038, 4040, 4042, 4044, 4046, 4048, 4050, 4052,\n\t4054, 4056, 4058, 4060, 4062, 4064, 4066, 4068, 4070, 4072, 4074, 4076,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4078, 0, 0, 0, 0, 0,\n\t0, 0, 4083, 4087, 4090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 4094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4097,\n\t4099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4101, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4103, 0, 0, 0, 4105, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 4107, 4109, 4111, 4113, 4115, 4117, 4119, 4121,\n\t4123, 4125, 4127, 4129, 4131, 4133, 4135, 4137, 4139, 4141, 4143, 4145,\n\t4147, 4149, 4151, 4153, 4155, 4157, 4159, 4161, 4163, 4165, 4167, 4169,\n\t4171, 4173, 4175, 4177, 4179, 4181, 4183, 4185, 4187, 4189, 4191, 4193,\n\t4195, 4197, 4199, 4201, 4203, 4205, 4207, 4209, 4211, 4213, 4215, 4217,\n\t4219, 4221, 4223, 4225, 4227, 4229, 4231, 4233, 4235, 4237, 4239, 4241,\n\t4243, 4245, 4247, 4249, 4251, 4253, 4255, 4257, 4259, 4261, 4263, 4265,\n\t4267, 4269, 4271, 4273, 4275, 4277, 4279, 4281, 4283, 4285, 4287, 4289,\n\t4291, 4293, 4295, 4297, 4299, 4301, 4303, 4305, 4307, 4309, 4311, 4313,\n\t4315, 4317, 4319, 4321, 4323, 4325, 4327, 4329, 4331, 4333, 4335, 4337,\n\t4339, 4341, 4343, 4345, 4347, 4349, 4351, 4353, 4355, 4357, 4359, 4361,\n\t4363, 4365, 4367, 4369, 4371, 4373, 4375, 4377, 4379, 4381, 4383, 4385,\n\t4387, 4389, 4391, 4393, 4395, 4397, 4399, 4401, 4403, 4405, 4407, 4409,\n\t4411, 4413, 4415, 4417, 4419, 4421, 4423, 4425, 4427, 4429, 4431, 4433,\n\t4435, 4437, 4439, 4441, 4443, 4445, 4447, 4449, 4451, 4453, 4455, 4457,\n\t4459, 4461, 4463, 4465, 4467, 4469, 4471, 4473, 4475, 4477, 4479, 4481,\n\t4483, 4485, 4487, 4489, 4491, 4493, 4495, 4497, 4499, 4501, 4503, 4505,\n\t4507, 4509, 4511, 4513, 4515, 4517, 4519, 4521, 4523, 4525, 4527, 4529,\n\t4531, 4533, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4535, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4537, 0, 4539, 4541, 4543, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4545, 0, 4548, 0, 4551, 0,\n\t4554, 0, 4557, 0, 4560, 0, 4563, 0, 4566, 0, 4569, 0, 4572, 0, 4575, 0,\n\t4578, 0, 0, 4581, 0, 4584, 0, 4587, 0, 0, 0, 0, 0, 0, 4590, 4593, 0,\n\t4596, 4599, 0, 4602, 4605, 0, 4608, 4611, 0, 4614, 4617, 0, 0, 0, 0, 0,\n\t0, 4620, 0, 0, 0, 0, 0, 0, 4623, 4626, 0, 4629, 4632, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 4635, 0, 4638, 0, 4641, 0, 4644, 0, 4647, 0, 4650, 0,\n\t4653, 0, 4656, 0, 4659, 0, 4662, 0, 4665, 0, 4668, 0, 0, 4671, 0, 4674,\n\t0, 4677, 0, 0, 0, 0, 0, 0, 4680, 4683, 0, 4686, 4689, 0, 4692, 4695, 0,\n\t4698, 4701, 0, 4704, 4707, 0, 0, 0, 0, 0, 0, 4710, 0, 0, 4713, 4716,\n\t4719, 4722, 0, 0, 0, 4725, 4728, 0, 4731, 4733, 4735, 4737, 4739, 4741,\n\t4743, 4745, 4747, 4749, 4751, 4753, 4755, 4757, 4759, 4761, 4763, 4765,\n\t4767, 4769, 4771, 4773, 4775, 4777, 4779, 4781, 4783, 4785, 4787, 4789,\n\t4791, 4793, 4795, 4797, 4799, 4801, 4803, 4805, 4807, 4809, 4811, 4813,\n\t4815, 4817, 4819, 4821, 4823, 4825, 4827, 4829, 4831, 4833, 4835, 4837,\n\t4839, 4841, 4843, 4845, 4847, 4849, 4851, 4853, 4855, 4857, 4859, 4861,\n\t4863, 4865, 4867, 4869, 4871, 4873, 4875, 4877, 4879, 4881, 4883, 4885,\n\t4887, 4889, 4891, 4893, 4895, 4897, 4899, 4901, 4903, 4905, 4907, 4909,\n\t4911, 4913, 4915, 4917, 0, 0, 0, 4919, 4921, 4923, 4925, 4927, 4929,\n\t4931, 4933, 4935, 4937, 4939, 4941, 4943, 4945, 4947, 4951, 4955, 4959,\n\t4963, 4967, 4971, 4975, 4979, 4983, 4987, 4991, 4995, 4999, 5003, 5008,\n\t5013, 5018, 5023, 5028, 5033, 5038, 5043, 5048, 5053, 5058, 5063, 5068,\n\t5073, 5078, 5086, 0, 5093, 5097, 5101, 5105, 5109, 5113, 5117, 5121,\n\t5125, 5129, 5133, 5137, 5141, 5145, 5149, 5153, 5157, 5161, 5165, 5169,\n\t5173, 5177, 5181, 5185, 5189, 5193, 5197, 5201, 5205, 5209, 5213, 5217,\n\t5221, 5225, 5229, 5233, 5237, 5239, 5241, 5243, 0, 0, 0, 0, 0, 0, 0, 0,\n\t5245, 5249, 5252, 5255, 5258, 5261, 5264, 5267, 5270, 5273, 5276, 5279,\n\t5282, 5285, 5288, 5291, 5294, 5296, 5298, 5300, 5302, 5304, 5306, 5308,\n\t5310, 5312, 5314, 5316, 5318, 5320, 5322, 5325, 5328, 5331, 5334, 5337,\n\t5340, 5343, 5346, 5349, 5352, 5355, 5358, 5361, 5364, 5370, 5375, 0,\n\t5378, 5380, 5382, 5384, 5386, 5388, 5390, 5392, 5394, 5396, 5398, 5400,\n\t5402, 5404, 5406, 5408, 5410, 5412, 5414, 5416, 5418, 5420, 5422, 5424,\n\t5426, 5428, 5430, 5432, 5434, 5436, 5438, 5440, 5442, 5444, 5446, 5448,\n\t5450, 5452, 5454, 5456, 5458, 5460, 5462, 5464, 5466, 5468, 5470, 5472,\n\t5474, 5476, 5479, 5482, 5485, 5488, 5491, 5494, 5497, 5500, 5503, 5506,\n\t5509, 5512, 5515, 5518, 5521, 5524, 5527, 5530, 5533, 5536, 5539, 5542,\n\t5545, 5548, 5552, 5556, 5560, 5563, 5567, 5570, 5574, 5576, 5578, 5580,\n\t5582, 5584, 5586, 5588, 5590, 5592, 5594, 5596, 5598, 5600, 5602, 5604,\n\t5606, 5608, 5610, 5612, 5614, 5616, 5618, 5620, 5622, 5624, 5626, 5628,\n\t5630, 5632, 5634, 5636, 5638, 5640, 5642, 5644, 5646, 5648, 5650, 5652,\n\t5654, 5656, 5658, 5660, 5662, 5664, 5666, 0, 5668, 5673, 5678, 5683,\n\t5687, 5692, 5696, 5700, 5706, 5711, 5715, 5719, 5723, 5728, 5733, 5737,\n\t5741, 5744, 5748, 5753, 5758, 5761, 5767, 5774, 5780, 5784, 5790, 5796,\n\t5801, 5805, 5809, 5813, 5818, 5824, 5829, 5833, 5837, 5841, 5844, 5847,\n\t5850, 5853, 5857, 5861, 5867, 5871, 5876, 5882, 5886, 5889, 5892, 5898,\n\t5903, 5909, 5913, 5919, 5922, 5926, 5930, 5934, 5938, 5942, 5947, 5951,\n\t5954, 5958, 5962, 5966, 5971, 5975, 5979, 5983, 5989, 5994, 5997, 6003,\n\t6006, 6011, 6016, 6020, 6024, 6028, 6033, 6036, 6040, 6045, 6048, 6054,\n\t6058, 6061, 6064, 6067, 6070, 6073, 6076, 6079, 6082, 6085, 6088, 6092,\n\t6096, 6100, 6104, 6108, 6112, 6116, 6120, 6124, 6128, 6132, 6136, 6140,\n\t6144, 6148, 6152, 6155, 6158, 6162, 6165, 6168, 6171, 6175, 6179, 6182,\n\t6185, 6188, 6191, 6194, 6199, 6202, 6205, 6208, 6211, 6214, 6217, 6220,\n\t6223, 6227, 6232, 6235, 6238, 6241, 6244, 6247, 6250, 6253, 6257, 6261,\n\t6265, 6269, 6272, 6275, 6278, 6281, 6284, 6287, 6290, 6293, 6296, 6299,\n\t6303, 6307, 6310, 6314, 6318, 6322, 6325, 6329, 6333, 6338, 6341, 6345,\n\t6349, 6353, 6357, 6363, 6370, 6373, 6376, 6379, 6382, 6385, 6388, 6391,\n\t6394, 6397, 6400, 6403, 6406, 6409, 6412, 6415, 6418, 6421, 6424, 6429,\n\t6432, 6435, 6438, 6443, 6447, 6450, 6453, 6456, 6459, 6462, 6465, 6468,\n\t6471, 6474, 6477, 6481, 6484, 6487, 6491, 6495, 6498, 6503, 6507, 6510,\n\t6513, 6516, 6519, 6523, 6527, 6530, 6533, 6536, 6539, 6542, 6545, 6548,\n\t6551, 6554, 6558, 6562, 6566, 6570, 6574, 6578, 6582, 6586, 6590, 6594,\n\t6598, 6602, 6606, 6610, 6614, 6618, 6622, 6626, 6630, 6634, 6638, 6642,\n\t6646, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 6648, 6650, 0, 0, 0, 0, 0, 0, 6652, 6654, 6656, 6658, 6660, 6662,\n\t6664, 6666, 6668, 6670, 6672, 6674, 6676, 6678, 6680, 6682, 6684, 6686,\n\t6688, 6690, 6692, 6694, 6696, 6698, 6700, 6702, 6704, 6706, 6708, 6710,\n\t6712, 6714, 6716, 6718, 6720, 6722, 6724, 6726, 6728, 6730, 6732, 6734,\n\t6736, 6738, 6740, 6742, 6744, 6746, 6748, 6750, 6752, 6754, 6756, 6758,\n\t6760, 6762, 6764, 6766, 6768, 6770, 6772, 6774, 6776, 6778, 6780, 6782,\n\t6784, 6786, 6788, 6790, 6792, 6794, 6796, 6798, 6800, 6802, 6804, 6806,\n\t6808, 6810, 6812, 6814, 6816, 6818, 6820, 6822, 6824, 6826, 6828, 6830,\n\t6832, 6834, 6836, 6838, 6840, 6842, 6844, 6846, 6848, 6850, 6852, 6854,\n\t6856, 6858, 6860, 6862, 6864, 6866, 6868, 6870, 6872, 6874, 6876, 6878,\n\t6880, 6882, 6884, 6886, 6888, 6890, 6892, 6894, 6896, 6898, 6900, 6902,\n\t6904, 6906, 6908, 6910, 6912, 6914, 6916, 6918, 6920, 6922, 6924, 6926,\n\t6928, 6930, 6932, 6934, 6936, 6938, 6940, 6942, 6944, 6946, 6948, 6950,\n\t6952, 6954, 6956, 6958, 6960, 6962, 6964, 6966, 6968, 6970, 6972, 6974,\n\t6976, 6978, 6980, 6982, 6984, 6986, 6988, 6990, 6992, 6994, 6996, 6998,\n\t7000, 7002, 7004, 7006, 7008, 7010, 7012, 7014, 7016, 7018, 7020, 7022,\n\t7024, 7026, 7028, 7030, 7032, 7034, 7036, 7038, 7040, 7042, 7044, 7046,\n\t7048, 7050, 7052, 7054, 7056, 7058, 7060, 7062, 7064, 7066, 7068, 7070,\n\t7072, 7074, 7076, 7078, 7080, 7082, 7084, 7086, 7088, 7090, 7092, 7094,\n\t7096, 7098, 7100, 7102, 7104, 7106, 7108, 7110, 7112, 7114, 7116, 7118,\n\t7120, 7122, 7124, 7126, 7128, 7130, 7132, 7134, 7136, 7138, 7140, 7142,\n\t7144, 7146, 7148, 7150, 7152, 7154, 7156, 7158, 7160, 7162, 7164, 7166,\n\t7168, 7170, 7172, 7174, 7176, 7178, 7180, 7182, 7184, 7186, 7188, 7190,\n\t0, 0, 7192, 0, 7194, 0, 0, 7196, 7198, 7200, 7202, 7204, 7206, 7208,\n\t7210, 7212, 7214, 0, 7216, 0, 7218, 0, 0, 7220, 7222, 0, 0, 0, 7224,\n\t7226, 7228, 7230, 7232, 7234, 7236, 7238, 7240, 7242, 7244, 7246, 7248,\n\t7250, 7252, 7254, 7256, 7258, 7260, 7262, 7264, 7266, 7268, 7270, 7272,\n\t7274, 7276, 7278, 7280, 7282, 7284, 7286, 7288, 7290, 7292, 7294, 7296,\n\t7298, 7300, 7302, 7304, 7306, 7308, 7310, 7312, 7314, 7316, 7318, 7320,\n\t7322, 7324, 7326, 7328, 7330, 7332, 7334, 7336, 7338, 7340, 7342, 7344,\n\t7346, 7348, 7350, 7352, 7354, 7356, 7359, 0, 0, 7361, 7363, 7365, 7367,\n\t7369, 7371, 7373, 7375, 7377, 7379, 7381, 7383, 7385, 7387, 7389, 7391,\n\t7393, 7395, 7397, 7399, 7401, 7403, 7405, 7407, 7409, 7411, 7413, 7415,\n\t7417, 7419, 7421, 7423, 7425, 7427, 7429, 7431, 7433, 7435, 7437, 7439,\n\t7441, 7443, 7445, 7447, 7449, 7451, 7453, 7455, 7457, 7459, 7461, 7463,\n\t7465, 7467, 7469, 7471, 7473, 7475, 7477, 7479, 7481, 7483, 7485, 7487,\n\t7489, 7491, 7493, 7495, 7497, 7499, 7501, 7503, 7505, 7507, 7509, 7511,\n\t7513, 7515, 7517, 7519, 7521, 7523, 7525, 7527, 7529, 7531, 7533, 7535,\n\t7537, 7539, 7541, 7543, 7545, 7547, 7549, 7551, 7554, 7557, 7560, 7562,\n\t7564, 7566, 7569, 7572, 7575, 7577, 0, 0, 0, 0, 0, 0, 7579, 7582, 7585,\n\t7588, 7592, 7596, 7599, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7602, 7605,\n\t7608, 7611, 7614, 0, 0, 0, 0, 0, 7617, 0, 7620, 7623, 7625, 7627, 7629,\n\t7631, 7633, 7635, 7637, 7639, 7641, 7643, 7646, 7649, 7652, 7655, 7658,\n\t7661, 7664, 7667, 7670, 7673, 7676, 7679, 0, 7682, 7685, 7688, 7691,\n\t7694, 0, 7697, 0, 7700, 7703, 0, 7706, 7709, 0, 7712, 7715, 7718, 7721,\n\t7724, 7727, 7730, 7733, 7736, 7739, 7742, 7744, 7746, 7748, 7750, 7752,\n\t7754, 7756, 7758, 7760, 7762, 7764, 7766, 7768, 7770, 7772, 7774, 7776,\n\t7778, 7780, 7782, 7784, 7786, 7788, 7790, 7792, 7794, 7796, 7798, 7800,\n\t7802, 7804, 7806, 7808, 7810, 7812, 7814, 7816, 7818, 7820, 7822, 7824,\n\t7826, 7828, 7830, 7832, 7834, 7836, 7838, 7840, 7842, 7844, 7846, 7848,\n\t7850, 7852, 7854, 7856, 7858, 7860, 7862, 7864, 7866, 7868, 7870, 7872,\n\t7874, 7876, 7878, 7880, 7882, 7884, 7886, 7888, 7890, 7892, 7894, 7896,\n\t7898, 7900, 7902, 7904, 7906, 7908, 7910, 7912, 7914, 7916, 7918, 7920,\n\t7922, 7924, 7926, 7928, 7930, 7932, 7934, 7936, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 7938, 7940, 7942, 7944, 7946, 7948, 7950,\n\t7952, 7954, 7956, 7958, 7960, 7962, 7964, 7966, 7968, 7970, 7972, 7974,\n\t7976, 7978, 7980, 7982, 7984, 7987, 7990, 7993, 7996, 7999, 8002, 8005,\n\t8008, 8011, 8014, 8017, 8020, 8023, 8026, 8029, 8032, 8035, 8038, 8040,\n\t8042, 8044, 8046, 8049, 8052, 8055, 8058, 8061, 8064, 8067, 8070, 8073,\n\t8076, 8079, 8082, 8085, 8088, 8091, 8094, 8097, 8100, 8103, 8106, 8109,\n\t8112, 8115, 8118, 8121, 8124, 8127, 8130, 8133, 8136, 8139, 8142, 8145,\n\t8148, 8151, 8154, 8157, 8160, 8163, 8166, 8169, 8172, 8175, 8178, 8181,\n\t8184, 8187, 8190, 8193, 8196, 8199, 8202, 8205, 8208, 8211, 8214, 8217,\n\t8220, 8223, 8226, 8229, 8232, 8235, 8238, 8241, 8244, 8247, 8250, 8253,\n\t8256, 8259, 8262, 8265, 8268, 8271, 8274, 8277, 8280, 8283, 8286, 8289,\n\t8292, 8295, 8298, 8301, 8304, 8307, 8310, 8313, 8316, 8319, 8322, 8325,\n\t8328, 8332, 8336, 8340, 8344, 8348, 8352, 8355, 8358, 8361, 8364, 8367,\n\t8370, 8373, 8376, 8379, 8382, 8385, 8388, 8391, 8394, 8397, 8400, 8403,\n\t8406, 8409, 8412, 8415, 8418, 8421, 8424, 8427, 8430, 8433, 8436, 8439,\n\t8442, 8445, 8448, 8451, 8454, 8457, 8460, 8463, 8466, 8469, 8472, 8475,\n\t8478, 8481, 8484, 8487, 8490, 8493, 8496, 8499, 8502, 8505, 8508, 8511,\n\t8514, 8517, 8520, 8523, 8526, 8529, 8532, 8535, 8538, 8541, 8544, 8547,\n\t8550, 8553, 8556, 8559, 8562, 8565, 8568, 8571, 8574, 8577, 8580, 8583,\n\t8586, 8589, 8592, 8595, 8598, 8601, 8604, 8607, 8610, 8613, 8616, 8619,\n\t8622, 8625, 8628, 8631, 8634, 8637, 8640, 8643, 8646, 8649, 8652, 8655,\n\t8658, 8661, 8664, 8667, 8670, 8673, 8676, 8679, 8682, 8685, 8688, 8691,\n\t8694, 8697, 8700, 8703, 8706, 8709, 8712, 8715, 8718, 8721, 8724, 8727,\n\t8730, 8733, 8736, 8739, 8742, 8745, 8748, 8751, 8754, 8757, 8760, 8763,\n\t8766, 8769, 8772, 8775, 8778, 8782, 8786, 8790, 8793, 8796, 8799, 8802,\n\t8805, 8808, 8811, 8814, 8817, 8820, 8823, 8826, 8829, 8832, 8835, 8838,\n\t8841, 8844, 8847, 8850, 8853, 8856, 8859, 8862, 8865, 8868, 8871, 8874,\n\t8877, 8880, 8883, 8886, 8889, 8892, 8895, 8898, 8901, 8904, 8907, 8910,\n\t8913, 8916, 8919, 8922, 8925, 8928, 8931, 8934, 8937, 8940, 8943, 8946,\n\t8949, 8952, 8955, 8958, 8961, 8964, 8967, 8970, 8973, 8976, 8979, 8982,\n\t8985, 8988, 8991, 8994, 8997, 9000, 9003, 9006, 0, 0, 9009, 9013, 9017,\n\t9021, 9025, 9029, 9033, 9037, 9041, 9045, 9049, 9053, 9057, 9061, 9065,\n\t9069, 9073, 9077, 9081, 9085, 9089, 9093, 9097, 9101, 9105, 9109, 9113,\n\t9117, 9121, 9125, 9129, 9133, 9137, 9141, 9145, 9149, 9153, 9157, 9161,\n\t9165, 9169, 9173, 9177, 9181, 9185, 9189, 9193, 9197, 9201, 9205, 9209,\n\t9213, 9217, 9221, 9225, 9229, 9233, 9237, 9241, 9245, 9249, 9253, 9257,\n\t9261, 0, 0, 9265, 9269, 9273, 9277, 9281, 9285, 9289, 9293, 9297, 9301,\n\t9305, 9309, 9313, 9317, 9321, 9325, 9329, 9333, 9337, 9341, 9345, 9349,\n\t9353, 9357, 9361, 9365, 9369, 9373, 9377, 9381, 9385, 9389, 9393, 9397,\n\t9401, 9405, 9409, 9413, 9417, 9421, 9425, 9429, 9433, 9437, 9441, 9445,\n\t9449, 9453, 9457, 9461, 9465, 9469, 9473, 9477, 0, 0, 0, 0, 0, 0, 0, 0,\n\t9481, 9485, 9489, 9494, 9499, 9504, 9509, 9514, 9519, 9524, 9528, 9547,\n\t9556, 0, 0, 0, 9561, 9563, 9565, 9567, 9569, 9571, 9573, 9575, 9577,\n\t9579, 0, 0, 0, 0, 0, 0, 9581, 9583, 9585, 9587, 9589, 9591, 9593, 9595,\n\t9597, 9599, 9601, 9603, 9605, 9607, 9609, 9611, 9613, 9615, 9617, 9619,\n\t9621, 0, 0, 9623, 9625, 9627, 9629, 9631, 9633, 9635, 9637, 9639, 9641,\n\t9643, 9645, 0, 9647, 9649, 9651, 9653, 9655, 9657, 9659, 9661, 9663,\n\t9665, 9667, 9669, 9671, 9673, 9675, 9677, 9679, 9681, 9683, 0, 9685,\n\t9687, 9689, 9691, 0, 0, 0, 0, 9693, 9696, 9699, 0, 9702, 0, 9705, 9708,\n\t9711, 9714, 9717, 9720, 9723, 9726, 9729, 9732, 9735, 9737, 9739, 9741,\n\t9743, 9745, 9747, 9749, 9751, 9753, 9755, 9757, 9759, 9761, 9763, 9765,\n\t9767, 9769, 9771, 9773, 9775, 9777, 9779, 9781, 9783, 9785, 9787, 9789,\n\t9791, 9793, 9795, 9797, 9799, 9801, 9803, 9805, 9807, 9809, 9811, 9813,\n\t9815, 9817, 9819, 9821, 9823, 9825, 9827, 9829, 9831, 9833, 9835, 9837,\n\t9839, 9841, 9843, 9845, 9847, 9849, 9851, 9853, 9855, 9857, 9859, 9861,\n\t9863, 9865, 9867, 9869, 9871, 9873, 9875, 9877, 9879, 9881, 9883, 9885,\n\t9887, 9889, 9891, 9893, 9895, 9897, 9899, 9901, 9903, 9905, 9907, 9909,\n\t9911, 9913, 9915, 9917, 9919, 9921, 9923, 9925, 9927, 9929, 9931, 9933,\n\t9935, 9937, 9939, 9941, 9943, 9945, 9947, 9949, 9951, 9953, 9955, 9957,\n\t9959, 9961, 9963, 9965, 9967, 9969, 9972, 9975, 9978, 9981, 9984, 9987,\n\t9990, 0, 0, 0, 0, 9993, 9995, 9997, 9999, 10001, 10003, 10005, 10007,\n\t10009, 10011, 10013, 10015, 10017, 10019, 10021, 10023, 10025, 10027,\n\t10029, 10031, 10033, 10035, 10037, 10039, 10041, 10043, 10045, 10047,\n\t10049, 10051, 10053, 10055, 10057, 10059, 10061, 10063, 10065, 10067,\n\t10069, 10071, 10073, 10075, 10077, 10079, 10081, 10083, 10085, 10087,\n\t10089, 10091, 10093, 10095, 10097, 10099, 10101, 10103, 10105, 10107,\n\t10109, 10111, 10113, 10115, 10117, 10119, 10121, 10123, 10125, 10127,\n\t10129, 10131, 10133, 10135, 10137, 10139, 10141, 10143, 10145, 10147,\n\t10149, 10151, 10153, 10155, 10157, 10159, 10161, 10163, 10165, 10167,\n\t10169, 10171, 10173, 10175, 10177, 10179, 10181, 10183, 10185, 10187,\n\t10189, 10191, 10193, 10195, 10197, 10199, 10201, 10203, 10205, 10207,\n\t10209, 10211, 10213, 10215, 10217, 10219, 10221, 10223, 10225, 10227,\n\t10229, 10231, 10233, 10235, 10237, 10239, 10241, 10243, 10245, 10247,\n\t10249, 10251, 10253, 10255, 10257, 10259, 10261, 10263, 10265, 10267,\n\t10269, 10271, 10273, 10275, 10277, 10279, 10281, 10283, 10285, 10287,\n\t10289, 10291, 10293, 10295, 10297, 10299, 10301, 10303, 10305, 10307,\n\t10309, 10311, 10313, 10315, 10317, 10319, 10321, 10323, 10325, 10327,\n\t10329, 10331, 10333, 10335, 10337, 10339, 10341, 10343, 10345, 10347,\n\t10349, 10351, 10353, 10355, 10357, 10359, 10361, 10363, 10365, 10367,\n\t10369, 10371, 0, 0, 0, 10373, 10375, 10377, 10379, 10381, 10383, 0, 0,\n\t10385, 10387, 10389, 10391, 10393, 10395, 0, 0, 10397, 10399, 10401,\n\t10403, 10405, 10407, 0, 0, 10409, 10411, 10413, 0, 0, 0, 10415, 10417,\n\t10419, 10421, 10423, 10425, 10427, 0, 10429, 10431, 10433, 10435, 10437,\n\t10439, 10441, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10443, 0, 10448, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 10458, 10463, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 10468, 10473, 10478, 10483, 10488, 10493, 10498, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10503, 10508, 10513, 10518,\n\t10523, 10528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10533, 10535,\n\t10537, 10539, 10541, 10543, 10545, 10547, 10549, 10551, 10553, 10555,\n\t10557, 10559, 10561, 10563, 10565, 10567, 10569, 10571, 10573, 10575,\n\t10577, 10579, 10581, 10583, 10585, 10587, 10589, 10591, 10593, 10595,\n\t10597, 10599, 10601, 10603, 10605, 10607, 10609, 10611, 10613, 10615,\n\t10617, 10619, 10621, 10623, 10625, 10627, 10629, 10631, 10633, 10635,\n\t10637, 10639, 10641, 10643, 10645, 10647, 10649, 10651, 10653, 10655,\n\t10657, 10659, 10661, 10663, 10665, 10667, 10669, 10671, 10673, 10675,\n\t10677, 10679, 10681, 10683, 10685, 10687, 10689, 10691, 10693, 10695,\n\t10697, 10699, 10701, 0, 10703, 10705, 10707, 10709, 10711, 10713, 10715,\n\t10717, 10719, 10721, 10723, 10725, 10727, 10729, 10731, 10733, 10735,\n\t10737, 10739, 10741, 10743, 10745, 10747, 10749, 10751, 10753, 10755,\n\t10757, 10759, 10761, 10763, 10765, 10767, 10769, 10771, 10773, 10775,\n\t10777, 10779, 10781, 10783, 10785, 10787, 10789, 10791, 10793, 10795,\n\t10797, 10799, 10801, 10803, 10805, 10807, 10809, 10811, 10813, 10815,\n\t10817, 10819, 10821, 10823, 10825, 10827, 10829, 10831, 10833, 10835,\n\t10837, 10839, 10841, 10843, 0, 10845, 10847, 0, 0, 10849, 0, 0, 10851,\n\t10853, 0, 0, 10855, 10857, 10859, 10861, 0, 10863, 10865, 10867, 10869,\n\t10871, 10873, 10875, 10877, 10879, 10881, 10883, 10885, 0, 10887, 0,\n\t10889, 10891, 10893, 10895, 10897, 10899, 10901, 0, 10903, 10905, 10907,\n\t10909, 10911, 10913, 10915, 10917, 10919, 10921, 10923, 10925, 10927,\n\t10929, 10931, 10933, 10935, 10937, 10939, 10941, 10943, 10945, 10947,\n\t10949, 10951, 10953, 10955, 10957, 10959, 10961, 10963, 10965, 10967,\n\t10969, 10971, 10973, 10975, 10977, 10979, 10981, 10983, 10985, 10987,\n\t10989, 10991, 10993, 10995, 10997, 10999, 11001, 11003, 11005, 11007,\n\t11009, 11011, 11013, 11015, 11017, 11019, 11021, 11023, 11025, 11027,\n\t11029, 11031, 0, 11033, 11035, 11037, 11039, 0, 0, 11041, 11043, 11045,\n\t11047, 11049, 11051, 11053, 11055, 0, 11057, 11059, 11061, 11063, 11065,\n\t11067, 11069, 0, 11071, 11073, 11075, 11077, 11079, 11081, 11083, 11085,\n\t11087, 11089, 11091, 11093, 11095, 11097, 11099, 11101, 11103, 11105,\n\t11107, 11109, 11111, 11113, 11115, 11117, 11119, 11121, 11123, 11125, 0,\n\t11127, 11129, 11131, 11133, 0, 11135, 11137, 11139, 11141, 11143, 0,\n\t11145, 0, 0, 0, 11147, 11149, 11151, 11153, 11155, 11157, 11159, 0,\n\t11161, 11163, 11165, 11167, 11169, 11171, 11173, 11175, 11177, 11179,\n\t11181, 11183, 11185, 11187, 11189, 11191, 11193, 11195, 11197, 11199,\n\t11201, 11203, 11205, 11207, 11209, 11211, 11213, 11215, 11217, 11219,\n\t11221, 11223, 11225, 11227, 11229, 11231, 11233, 11235, 11237, 11239,\n\t11241, 11243, 11245, 11247, 11249, 11251, 11253, 11255, 11257, 11259,\n\t11261, 11263, 11265, 11267, 11269, 11271, 11273, 11275, 11277, 11279,\n\t11281, 11283, 11285, 11287, 11289, 11291, 11293, 11295, 11297, 11299,\n\t11301, 11303, 11305, 11307, 11309, 11311, 11313, 11315, 11317, 11319,\n\t11321, 11323, 11325, 11327, 11329, 11331, 11333, 11335, 11337, 11339,\n\t11341, 11343, 11345, 11347, 11349, 11351, 11353, 11355, 11357, 11359,\n\t11361, 11363, 11365, 11367, 11369, 11371, 11373, 11375, 11377, 11379,\n\t11381, 11383, 11385, 11387, 11389, 11391, 11393, 11395, 11397, 11399,\n\t11401, 11403, 11405, 11407, 11409, 11411, 11413, 11415, 11417, 11419,\n\t11421, 11423, 11425, 11427, 11429, 11431, 11433, 11435, 11437, 11439,\n\t11441, 11443, 11445, 11447, 11449, 11451, 11453, 11455, 11457, 11459,\n\t11461, 11463, 11465, 11467, 11469, 11471, 11473, 11475, 11477, 11479,\n\t11481, 11483, 11485, 11487, 11489, 11491, 11493, 11495, 11497, 11499,\n\t11501, 11503, 11505, 11507, 11509, 11511, 11513, 11515, 11517, 11519,\n\t11521, 11523, 11525, 11527, 11529, 11531, 11533, 11535, 11537, 11539,\n\t11541, 11543, 11545, 11547, 11549, 11551, 11553, 11555, 11557, 11559,\n\t11561, 11563, 11565, 11567, 11569, 11571, 11573, 11575, 11577, 11579,\n\t11581, 11583, 11585, 11587, 11589, 11591, 11593, 11595, 11597, 11599,\n\t11601, 11603, 11605, 11607, 11609, 11611, 11613, 11615, 11617, 11619,\n\t11621, 11623, 11625, 11627, 11629, 11631, 11633, 11635, 11637, 11639,\n\t11641, 11643, 11645, 11647, 11649, 11651, 11653, 11655, 11657, 11659,\n\t11661, 11663, 11665, 11667, 11669, 11671, 11673, 11675, 11677, 11679,\n\t11681, 11683, 11685, 11687, 11689, 11691, 11693, 11695, 11697, 11699,\n\t11701, 11703, 11705, 11707, 11709, 11711, 11713, 11715, 11717, 11719,\n\t11721, 11723, 11725, 11727, 11729, 11731, 11733, 11735, 11737, 11739,\n\t11741, 11743, 11745, 11747, 11749, 11751, 11753, 11755, 11757, 11759,\n\t11761, 11763, 11765, 11767, 11769, 11771, 11773, 11775, 11777, 11779,\n\t11781, 11783, 11785, 11787, 11789, 11791, 11793, 11795, 11797, 11799,\n\t11801, 11803, 11805, 11807, 11809, 11811, 11813, 11815, 11817, 11819,\n\t11821, 11823, 11825, 11827, 11829, 11831, 11833, 11835, 11837, 11839, 0,\n\t0, 11841, 11843, 11845, 11847, 11849, 11851, 11853, 11855, 11857, 11859,\n\t11861, 11863, 11865, 11867, 11869, 11871, 11873, 11875, 11877, 11879,\n\t11881, 11883, 11885, 11887, 11889, 11891, 11893, 11895, 11897, 11899,\n\t11901, 11903, 11905, 11907, 11909, 11911, 11913, 11915, 11917, 11919,\n\t11921, 11923, 11925, 11927, 11929, 11931, 11933, 11935, 11937, 11939,\n\t11941, 11943, 11945, 11947, 11949, 11951, 11953, 11955, 11957, 11959,\n\t11961, 11963, 11965, 11967, 11969, 11971, 11973, 11975, 11977, 11979,\n\t11981, 11983, 11985, 11987, 11989, 11991, 11993, 11995, 11997, 11999,\n\t12001, 12003, 12005, 12007, 12009, 12011, 12013, 12015, 12017, 12019,\n\t12021, 12023, 12025, 12027, 12029, 12031, 12033, 12035, 12037, 12039,\n\t12041, 12043, 12045, 12047, 12049, 12051, 12053, 12055, 12057, 12059,\n\t12061, 12063, 12065, 12067, 12069, 12071, 12073, 12075, 12077, 12079,\n\t12081, 12083, 12085, 12087, 12089, 12091, 12093, 12095, 12097, 12099,\n\t12101, 12103, 12105, 12107, 12109, 12111, 12113, 12115, 12117, 12119,\n\t12121, 12123, 12125, 12127, 12129, 12131, 12133, 12135, 12137, 12139,\n\t12141, 12143, 12145, 12147, 12149, 12151, 12153, 12155, 12157, 12159,\n\t12161, 12163, 12165, 12167, 12169, 12171, 12173, 12175, 12177, 12179,\n\t12181, 12183, 12185, 12187, 12189, 12191, 12193, 12195, 12197, 12199,\n\t12201, 12203, 12205, 12207, 12209, 12211, 12213, 12215, 12217, 12219,\n\t12221, 12223, 12225, 12227, 12229, 12231, 12233, 12235, 12237, 12239,\n\t12241, 12243, 12245, 12247, 12249, 12251, 12253, 12255, 12257, 12259,\n\t12261, 12263, 12265, 12267, 12269, 12271, 12273, 12275, 12277, 12279,\n\t12281, 12283, 12285, 12287, 12289, 12291, 12293, 12295, 12297, 12299,\n\t12301, 12303, 12305, 12307, 12309, 12311, 12313, 12315, 12317, 12319,\n\t12321, 12323, 12325, 12327, 12329, 12331, 12333, 12335, 12337, 12339,\n\t12341, 12343, 12345, 12347, 12349, 12351, 12353, 12355, 12357, 12359,\n\t12361, 12363, 12365, 12367, 12369, 12371, 12373, 12375, 12377, 12379,\n\t12381, 12383, 12385, 12387, 12389, 12391, 12393, 12395, 12397, 12399,\n\t12401, 12403, 12405, 12407, 12409, 12411, 12413, 12415, 12417, 12419,\n\t12421, 12423, 0, 0, 12425, 12427, 12429, 12431, 12433, 12435, 12437,\n\t12439, 12441, 12443, 12445, 12447, 12449, 12451, 12453, 12455, 12457,\n\t12459, 12461, 12463, 12465, 12467, 12469, 12471, 12473, 12475, 12477,\n\t12479, 12481, 12483, 12485, 12487, 12489, 12491, 12493, 12495, 12497,\n\t12499, 12501, 12503, 12505, 12507, 12509, 12511, 12513, 12515, 12517,\n\t12519, 12521, 12523, 12525, 12527, 12529, 12531, 0, 12533, 12535, 12537,\n\t12539, 12541, 12543, 12545, 12547, 12549, 12551, 12553, 12555, 12557,\n\t12559, 12561, 12563, 12565, 12567, 12569, 12571, 12573, 12575, 12577,\n\t12579, 12581, 12583, 12585, 0, 12587, 12589, 0, 12591, 0, 0, 12593, 0,\n\t12595, 12597, 12599, 12601, 12603, 12605, 12607, 12609, 12611, 12613, 0,\n\t12615, 12617, 12619, 12621, 0, 12623, 0, 12625, 0, 0, 0, 0, 0, 0, 12627,\n\t0, 0, 0, 0, 12629, 0, 12631, 0, 12633, 0, 12635, 12637, 12639, 0, 12641,\n\t12643, 0, 12645, 0, 0, 12647, 0, 12649, 0, 12651, 0, 12653, 0, 12655, 0,\n\t12657, 12659, 0, 12661, 0, 0, 12663, 12665, 12667, 12669, 0, 12671,\n\t12673, 12675, 12677, 12679, 12681, 12683, 0, 12685, 12687, 12689, 12691,\n\t0, 12693, 12695, 12697, 12699, 0, 12701, 0, 12703, 12705, 12707, 12709,\n\t12711, 12713, 12715, 12717, 12719, 12721, 0, 12723, 12725, 12727, 12729,\n\t12731, 12733, 12735, 12737, 12739, 12741, 12743, 12745, 12747, 12749,\n\t12751, 12753, 12755, 0, 0, 0, 0, 0, 12757, 12759, 12761, 0, 12763, 12765,\n\t12767, 12769, 12771, 0, 12773, 12775, 12777, 12779, 12781, 12783, 12785,\n\t12787, 12789, 12791, 12793, 12795, 12797, 12799, 12801, 12803, 12805, 0,\n\t0, 0, 0, 12807, 12810, 12813, 12816, 12819, 12822, 12825, 12828, 12831,\n\t12834, 12837, 0, 0, 0, 0, 0, 12840, 12844, 12848, 12852, 12856, 12860,\n\t12864, 12868, 12872, 12876, 12880, 12884, 12888, 12892, 12896, 12900,\n\t12904, 12908, 12912, 12916, 12920, 12924, 12928, 12932, 12936, 12940,\n\t12944, 12948, 12950, 12952, 12955, 0, 12958, 12960, 12962, 12964, 12966,\n\t12968, 12970, 12972, 12974, 12976, 12978, 12980, 12982, 12984, 12986,\n\t12988, 12990, 12992, 12994, 12996, 12998, 13000, 13002, 13004, 13006,\n\t13008, 13010, 13013, 13016, 13019, 13022, 13026, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 13029, 13032, 0, 0, 0, 0, 13035, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 13038, 13041, 13044, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t13046, 13048, 13050, 13052, 13054, 13056, 13058, 13060, 13062, 13064,\n\t13066, 13068, 13070, 13072, 13074, 13076, 13078, 13080, 13082, 13084,\n\t13086, 13088, 13090, 13092, 13094, 13096, 13098, 13100, 13102, 13104,\n\t13106, 13108, 13110, 13112, 13114, 13116, 13118, 13120, 13122, 13124,\n\t13126, 13128, 13130, 0, 0, 0, 0, 0, 13132, 13136, 13140, 13144, 13148,\n\t13152, 13156, 13160, 13164, 0, 0, 0, 0, 0, 0, 0, 13168, 13170, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13172, 13174, 13176, 13178, 13181,\n\t13183, 13185, 13187, 13189, 13191, 13193, 13195, 13197, 13199, 13202,\n\t13204, 13206, 13208, 13210, 13213, 13215, 13217, 13219, 13222, 13224,\n\t13226, 13228, 13230, 13232, 13235, 13237, 13239, 13241, 13243, 13245,\n\t13247, 13249, 13251, 13253, 13255, 13257, 13259, 13261, 13263, 13265,\n\t13267, 13269, 13271, 13273, 13275, 13277, 13279, 13281, 13284, 13286,\n\t13288, 13290, 13293, 13295, 13297, 13299, 13301, 13303, 13305, 13307,\n\t13309, 13311, 13313, 13315, 13317, 13319, 13321, 13323, 13325, 13327,\n\t13329, 13331, 13333, 13335, 13337, 13339, 13341, 13343, 13345, 13347,\n\t13349, 13351, 13353, 13355, 13357, 13360, 13362, 13364, 13366, 13368,\n\t13370, 13372, 13375, 13378, 13380, 13382, 13384, 13386, 13388, 13390,\n\t13392, 13394, 13396, 13398, 13401, 13403, 13405, 13407, 13409, 13412,\n\t13414, 13416, 13418, 13420, 13422, 13424, 13426, 13428, 13430, 13433,\n\t13435, 13438, 13440, 13442, 13444, 13446, 13448, 13450, 13452, 13454,\n\t13456, 13458, 13460, 13463, 13465, 13467, 13469, 13471, 13473, 13476,\n\t13478, 13481, 13484, 13486, 13488, 13490, 13492, 13495, 13498, 13500,\n\t13502, 13504, 13506, 13508, 13510, 13512, 13514, 13516, 13518, 13520,\n\t13523, 13525, 13527, 13529, 13531, 13533, 13535, 13537, 13539, 13541,\n\t13543, 13545, 13547, 13549, 13551, 13553, 13555, 13557, 13559, 13561,\n\t13564, 13566, 13568, 13570, 13572, 13574, 13577, 13579, 13581, 13583,\n\t13585, 13587, 13589, 13591, 13593, 13595, 13597, 13599, 13602, 13604,\n\t13606, 13608, 13610, 13612, 13614, 13616, 13618, 13620, 13622, 13624,\n\t13626, 13628, 13630, 13632, 13634, 13636, 13638, 13641, 13643, 13645,\n\t13647, 13649, 13651, 13654, 13656, 13658, 13660, 13662, 13664, 13666,\n\t13668, 13670, 13673, 13675, 13677, 13679, 13682, 13684, 13686, 13688,\n\t13690, 13692, 13694, 13697, 13700, 13703, 13705, 13708, 13710, 13712,\n\t13714, 13716, 13718, 13720, 13722, 13724, 13726, 13728, 13731, 13733,\n\t13735, 13737, 13739, 13741, 13743, 13746, 13748, 13750, 13753, 13756,\n\t13758, 13760, 13762, 13764, 13766, 13768, 13770, 13772, 13774, 13777,\n\t13779, 13782, 13784, 13787, 13789, 13791, 13793, 13796, 13798, 13800,\n\t13803, 13806, 13808, 13810, 13812, 13814, 13816, 13818, 13820, 13822,\n\t13824, 13826, 13828, 13830, 13832, 13835, 13837, 13840, 13842, 13845,\n\t13847, 13850, 13853, 13856, 13858, 13860, 13862, 13865, 13868, 13871,\n\t13874, 13876, 13878, 13880, 13882, 13884, 13886, 13888, 13890, 13893,\n\t13895, 13897, 13899, 13901, 13904, 13906, 13909, 13912, 13914, 13916,\n\t13918, 13920, 13922, 13924, 13927, 13930, 13933, 13935, 13937, 13940,\n\t13942, 13944, 13946, 13949, 13951, 13953, 13955, 13957, 13959, 13962,\n\t13964, 13966, 13968, 13970, 13972, 13974, 13977, 13980, 13982, 13985,\n\t13987, 13990, 13992, 13994, 13996, 13999, 14002, 14004, 14007, 14009,\n\t14012, 14014, 14016, 14018, 14020, 14022, 14024, 14027, 14030, 14033,\n\t14036, 14038, 14040, 14042, 14044, 14046, 14048, 14050, 14052, 14054,\n\t14056, 14058, 14060, 14063, 14065, 14067, 14069, 14071, 14073, 14075,\n\t14077, 14079, 14081, 14083, 14085, 14087, 14090, 14093, 14096, 14098,\n\t14100, 14102, 14104, 14107, 14109, 14112, 14114, 14116, 14119, 14122,\n\t14124, 14126, 14128, 14130, 14132, 14134, 14136, 14138, 14140, 14142,\n\t14144, 14146, 14148, 14150, 14152, 14154, 14156, 14158, 14160, 14163,\n\t14165, 14167, 14169, 14171, 14173, 14176, 14179, 14181, 14183, 14185,\n\t14187, 14189, 14191, 14194, 14196, 14198, 14200, 14202, 14205, 14208,\n\t14210, 14212, 14214, 14217, 14219, 14221, 14224, 14227, 14229, 14231,\n\t14233, 14236, 14238, 14240, 14242, 14244, 14246, 14248, 14250, 14253,\n\t14255, 14257, 14259, 14262, 14264, 14266, 14268, 14270, 14273, 14276,\n\t14278, 14280, 14282, 14285, 14287, 14290, 14292, 14294, 14296, 14299,\n\t14301, 14303, 14305, 14307, 14309, 14311, 14313, 14316, 14318, 14320,\n\t14322, 14324, 14326, 14328, 14331, 14333, 14336, 14339, 14342, 14344,\n\t14346, 14348, 14350, 14352, 14354, 14356, 14358, 0, 0,\n};\n\n/* NFC pairs */\n#define COMP_SHIFT1 2\n#define COMP_SHIFT2 1\nstatic const unsigned short comp_index0[] = {\n\t0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 4, 5, 6,\n\t0, 0, 0, 0, 7, 0, 8, 9, 0, 0, 0, 10, 11, 12, 0, 0, 0, 0, 13, 14, 15, 16,\n\t0, 0, 0, 17, 18, 19, 20, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 22, 23, 24, 0, 0,\n\t0, 0, 25, 26, 27, 28, 0, 0, 0, 29, 30, 31, 32, 0, 0, 0, 33, 0, 0, 0, 0,\n\t0, 0, 34, 35, 36, 37, 0, 0, 0, 38, 39, 40, 41, 0, 0, 0, 42, 0, 43, 0, 0,\n\t0, 0, 44, 45, 46, 47, 0, 0, 0, 48, 49, 50, 0, 0, 0, 0, 51, 0, 0, 0, 0, 0,\n\t0, 52, 53, 54, 55, 0, 0, 0, 56, 57, 58, 0, 0, 0, 0, 59, 60, 61, 62, 0, 0,\n\t0, 63, 64, 65, 66, 0, 0, 0, 67, 0, 68, 0, 0, 0, 0, 69, 0, 70, 0, 0, 0, 0,\n\t71, 0, 0, 0, 0, 0, 0, 72, 73, 74, 0, 0, 0, 0, 75, 76, 77, 78, 0, 0, 0,\n\t79, 80, 81, 0, 0, 0, 0, 82, 0, 83, 84, 0, 0, 0, 85, 86, 87, 0, 0, 0, 0,\n\t88, 89, 90, 91, 0, 0, 0, 92, 93, 94, 95, 0, 0, 0, 96, 0, 0, 0, 0, 0, 0,\n\t97, 98, 99, 0, 0, 0, 0, 100, 101, 102, 103, 0, 0, 0, 104, 105, 106, 107,\n\t0, 0, 0, 108, 109, 0, 0, 0, 0, 0, 110, 111, 112, 113, 0, 0, 0, 114, 115,\n\t116, 117, 0, 0, 0, 118, 0, 119, 0, 0, 0, 0, 120, 121, 122, 123, 0, 0, 0,\n\t124, 125, 126, 0, 0, 0, 0, 127, 0, 0, 0, 0, 0, 0, 128, 129, 130, 131, 0,\n\t0, 0, 132, 133, 134, 0, 0, 0, 0, 135, 136, 137, 138, 0, 0, 0, 139, 140,\n\t141, 142, 0, 0, 0, 143, 0, 144, 0, 0, 0, 0, 145, 146, 147, 0, 0, 0, 0,\n\t148, 0, 0, 0, 0, 0, 0, 149, 150, 151, 0, 0, 0, 0, 152, 153, 154, 155, 0,\n\t0, 0, 156, 0, 0, 157, 0, 0, 0, 158, 159, 0, 0, 0, 0, 0, 160, 0, 0, 0, 0,\n\t0, 0, 161, 0, 0, 0, 0, 0, 0, 162, 0, 0, 0, 0, 0, 0, 163, 0, 0, 0, 0, 0,\n\t0, 164, 165, 0, 0, 0, 0, 0, 166, 0, 0, 0, 0, 0, 0, 167, 168, 0, 0, 0, 0,\n\t0, 169, 0, 0, 0, 0, 0, 0, 170, 0, 0, 0, 0, 0, 0, 171, 0, 0, 0, 0, 0, 0,\n\t172, 173, 0, 0, 0, 0, 0, 174, 175, 0, 0, 0, 0, 0, 176, 0, 0, 0, 0, 0, 0,\n\t177, 0, 0, 0, 0, 0, 0, 178, 0, 0, 0, 0, 0, 0, 179, 0, 0, 0, 0, 0, 0, 180,\n\t181, 0, 0, 0, 0, 0, 182, 0, 0, 0, 0, 0, 0, 183, 184, 0, 0, 0, 0, 0, 185,\n\t0, 0, 0, 0, 0, 0, 186, 0, 0, 0, 0, 0, 0, 187, 0, 0, 0, 0, 0, 0, 188, 189,\n\t0, 0, 0, 0, 0, 190, 191, 0, 0, 0, 0, 0, 192, 193, 0, 0, 0, 0, 0, 194, 0,\n\t0, 0, 0, 0, 0, 195, 0, 0, 0, 0, 0, 0, 196, 0, 0, 0, 0, 0, 0, 197, 0, 0,\n\t0, 0, 0, 0, 198, 0, 0, 0, 0, 0, 0, 199, 0, 0, 0, 0, 0, 0, 200, 0, 0, 0,\n\t0, 0, 0, 201, 0, 0, 0, 0, 0, 0, 202, 0, 0, 0, 0, 0, 0, 203, 0, 0, 0, 0,\n\t0, 0, 204, 0, 0, 0, 0, 0, 0, 205, 0, 0, 0, 0, 0, 0, 206, 0, 0, 0, 0, 0,\n\t0, 207, 208, 209, 0, 0, 0, 0, 210, 211, 212, 0, 0, 0, 0, 213, 214, 215,\n\t0, 0, 0, 0, 216, 217, 218, 0, 0, 0, 0, 0, 219, 0, 0, 0, 0, 0, 220, 0, 0,\n\t0, 0, 0, 0, 221, 0, 0, 0, 0, 0, 0, 222, 0, 0, 0, 0, 0, 0, 223, 0, 0, 0,\n\t0, 0, 0, 224, 0, 0, 0, 0, 0, 0, 225, 0, 0, 0, 0, 0, 0, 226, 0, 0, 0, 0,\n\t0, 0, 227, 0, 0, 0, 0, 0, 0, 0, 228, 0, 0, 0, 0, 0, 229, 230, 0, 231, 0,\n\t0, 0, 232, 233, 0, 0, 0, 0, 0, 234, 235, 0, 236, 0, 0, 0, 237, 238, 0, 0,\n\t0, 0, 0, 239, 240, 0, 0, 0, 0, 0, 0, 241, 0, 0, 0, 0, 0, 242, 243, 0, 0,\n\t0, 0, 0, 244, 245, 0, 246, 0, 0, 0, 0, 0, 0, 247, 0, 0, 0, 0, 0, 0, 248,\n\t0, 0, 0, 249, 250, 0, 251, 0, 0, 0, 252, 253, 0, 0, 0, 0, 0, 254, 255, 0,\n\t256, 0, 0, 0, 257, 258, 0, 259, 0, 0, 0, 260, 261, 0, 0, 0, 0, 0, 0, 262,\n\t0, 0, 0, 0, 0, 263, 264, 0, 265, 0, 0, 0, 266, 267, 0, 268, 0, 0, 0, 269,\n\t0, 0, 270, 0, 0, 0, 271, 0, 0, 272, 0, 0, 0, 0, 0, 0, 273, 0, 0, 0, 274,\n\t0, 0, 0, 0, 0, 0, 275, 0, 0, 0, 0, 0, 0, 276, 0, 0, 0, 0, 0, 0, 277, 0,\n\t0, 0, 0, 0, 0, 278, 0, 0, 0, 0, 0, 0, 279, 0, 0, 0, 0, 0, 0, 280, 0, 0,\n\t0, 0, 0, 0, 281, 0, 0, 0, 0, 0, 0, 282, 0, 0, 0, 0, 0, 0, 283, 0, 0, 0,\n\t0, 0, 0, 284, 285, 0, 0, 0, 0, 0, 286, 0, 0, 0, 0, 0, 0, 287, 0, 0, 0, 0,\n\t0, 0, 288, 0, 0, 0, 0, 0, 0, 289, 0, 0, 0, 0, 0, 0, 290, 0, 0, 0, 0, 0,\n\t0, 291, 0, 0, 0, 0, 0, 0, 292, 0, 0, 0, 0, 0, 0, 293, 0, 0, 0, 0, 0, 0,\n\t294, 0, 0, 0, 0, 0, 0, 295, 0, 0, 0, 0, 0, 0, 296, 0, 0, 0, 0, 0, 0, 297,\n\t298, 0, 0, 0, 0, 0, 299, 0, 0, 0, 0, 0, 0, 300, 0, 0, 0, 0, 0, 0, 301, 0,\n\t0, 0, 0, 0, 0, 302, 0, 0, 0, 0, 0, 0, 0, 303, 0, 0, 0, 0, 0, 0, 304, 0,\n\t0, 0, 0, 0, 305, 0, 0, 0, 0, 0, 0, 306, 0, 0, 0, 0, 0, 0, 307, 0, 0, 0,\n\t0, 0, 0, 308, 0, 0, 0, 0, 0, 0, 0, 0, 0, 309, 310, 0, 0, 0, 0, 0, 311, 0,\n\t0, 0, 0, 0, 0, 312, 0, 0, 0, 0, 0, 0, 313, 0, 0, 0, 0, 0, 0, 314, 0, 0,\n\t0, 0, 0, 0, 315, 0, 0, 0, 0, 0, 0, 0, 316, 0, 0, 0, 0, 0, 0, 317, 0, 0,\n\t0, 0, 0, 0, 318, 0, 0, 0, 0, 0, 0, 319, 0, 0, 0, 0, 0, 0, 320, 0, 0, 0,\n\t0, 0, 0, 0, 321, 0, 0, 0, 0, 0, 322, 323, 0, 0, 0, 0, 0, 324, 0, 0, 0, 0,\n\t0, 0, 0, 325, 0, 0, 0, 0, 0, 0, 326, 0, 0, 0, 0, 0, 0, 327, 0, 0, 0, 0,\n\t0, 0, 328, 0, 0, 0, 0, 0, 0, 329, 0, 0, 0, 0, 0, 0, 330, 0, 0, 0, 0, 0,\n\t0, 331, 332, 0, 0, 0, 0, 0, 333, 0, 0, 0, 0, 0, 0, 0, 334, 0, 0, 0, 0, 0,\n\t0, 335, 0, 0, 0, 0, 0, 0, 336, 0, 0, 0, 0, 0, 0, 337, 0, 0, 0, 0, 0, 0,\n\t338, 0, 0, 0, 0, 0, 0, 339, 0, 0, 0, 0, 0, 0, 340, 0, 0, 0, 0, 0, 0, 341,\n\t0, 0, 0, 0, 0, 0, 342, 0, 0, 0, 0, 0, 0, 343, 0, 0, 0, 0, 0, 0, 344, 0,\n\t0, 0, 0, 0, 0, 345, 346, 0, 0, 0, 0, 0, 0, 347, 0, 0, 0, 0, 0, 0, 348, 0,\n\t0, 0, 0, 0, 0, 349, 0, 0, 0, 0, 0, 0, 350, 0, 0, 0, 0, 0, 0, 351, 0, 0,\n\t0, 0, 0, 0, 352, 0, 0, 0, 0, 0, 0, 353, 0, 0, 0, 0, 0, 0, 354, 0, 0, 0,\n\t0, 0, 0, 355, 0, 0, 0, 0, 0, 0, 356, 0, 0, 0, 0, 0, 0, 357, 0, 0, 0, 0,\n\t0, 0, 358, 0, 0, 359, 0, 0, 0, 360, 0, 0, 361, 0, 0, 0, 0, 0, 0, 362, 0,\n\t0, 0, 0, 0, 0, 363, 0, 0, 0, 0, 0, 0, 364, 0, 0, 0, 0, 0, 0, 365, 0, 0,\n\t0, 0, 0, 0, 366, 0, 0, 0, 0, 0, 0, 367, 0, 0, 0, 368, 0, 0, 369, 0, 0, 0,\n\t370, 0, 0, 371, 0, 0, 0, 0, 0, 0, 372, 0, 0, 0, 0, 0, 0, 373, 0, 0, 0, 0,\n\t0, 0, 374, 0, 0, 0, 0, 0, 0, 375, 0, 0, 0, 0, 0, 0, 376, 0, 0, 0, 0, 0,\n\t0, 377, 0, 0, 0, 378, 0, 0, 0, 0, 0, 0, 379, 0, 0, 0, 0, 0, 0, 380, 0, 0,\n\t0, 0, 0, 0, 381, 0, 0, 0, 0, 0, 0, 382, 0, 0, 383, 0, 0, 0, 384, 0, 0,\n\t385, 0, 0, 0, 0, 0, 0, 386, 0, 0, 0, 0, 0, 0, 387, 0, 0, 0, 0, 0, 0, 388,\n\t0, 0, 0, 0, 0, 0, 389, 0, 0, 0, 0, 0, 0, 390, 0, 0, 0, 0, 0, 0, 391, 0,\n\t0, 0, 392, 0, 0, 393, 0, 0, 0, 394, 0, 0, 395, 0, 0, 0, 0, 0, 0, 396, 0,\n\t0, 0, 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, 398, 0, 0, 0, 0, 0, 0, 399, 0, 0,\n\t0, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 401, 0, 0, 0, 402, 0, 0, 403, 0, 0, 0,\n\t404, 0, 0, 405, 0, 0, 0, 406, 0, 0, 407, 0, 0, 0, 408, 0, 0, 409, 0, 0,\n\t0, 410, 0, 0, 0, 0, 0, 0, 411, 0, 0, 0, 0, 0, 0, 412, 0, 0, 0, 0, 0, 0,\n\t413, 0, 0, 0, 0, 0, 0, 414, 0, 0, 415, 0, 0, 0, 416, 0, 0, 417, 0, 0, 0,\n\t418, 0, 0, 419, 0, 0, 0, 420, 0, 0, 421, 0, 0, 0, 422, 0, 0, 423, 0, 0,\n\t0, 0, 0, 0, 424, 0, 0, 0, 0, 0, 0, 425, 0, 0, 0, 0, 0, 0, 426, 0, 0, 0,\n\t0, 0, 0, 427, 0, 0, 0, 0, 0, 0, 428, 0, 0, 0, 0, 0, 0, 429, 0, 0, 0, 430,\n\t0, 0, 431, 0, 0, 0, 432, 0, 0, 433, 0, 0, 0, 0, 0, 0, 434, 0, 0, 0, 0, 0,\n\t0, 435, 0, 0, 0, 0, 0, 0, 436, 0, 0, 0, 0, 0, 0, 437, 0, 0, 0, 0, 0, 0,\n\t438, 0, 0, 0, 0, 0, 0, 439, 0, 0, 0, 0, 0, 0, 440, 0, 0, 0, 0, 0, 0, 441,\n\t0, 0, 0, 0, 0, 0, 442, 0, 0, 0, 0, 0, 0, 443, 0, 0, 0, 444, 0, 0, 445, 0,\n\t0, 0, 0, 0, 0, 446, 0, 0, 0, 0, 0, 0, 447, 0, 0, 0, 448, 0, 0, 449, 0, 0,\n\t0, 0, 0, 0, 450, 0, 0, 0, 0, 0, 0, 451, 0, 0, 0, 0, 0, 0, 452, 0, 0, 0,\n\t0, 0, 0, 453, 0, 0, 0, 0, 0, 0, 454, 0, 0, 0, 0, 0, 0, 455, 0, 0, 0, 0,\n\t0, 0, 456, 0, 0, 0, 0, 0, 0, 457, 0, 0, 0, 0, 0, 0, 458, 0, 0, 0, 0, 0,\n\t0, 459, 0, 0, 0, 0, 0, 0, 460, 0, 0, 0, 0, 0, 0, 461, 0, 0, 0, 0, 0, 0,\n\t462, 0, 0, 0, 0, 0, 0, 463, 0, 0, 0, 0, 0, 0, 464, 0, 0, 0, 0, 0, 0, 465,\n\t0, 0, 0, 0, 0, 0, 466, 0, 0, 0, 0, 0, 0, 467, 0, 0, 0, 0, 0, 0, 468, 0,\n\t0, 0, 0, 0, 0, 469, 0, 0, 0, 0, 0, 0, 470, 0, 0, 0, 0, 0, 0, 471, 0, 0,\n\t0, 0, 0, 0, 472, 0, 0, 0, 0, 0, 0, 473, 0, 0, 0, 0, 0, 0, 474, 0, 0, 0,\n\t0, 0, 0, 475, 0, 0, 0, 0, 0, 0, 476, 0, 0, 0, 0, 0, 0, 477, 0, 0, 0, 0,\n\t0, 0, 478, 0, 0, 0, 0, 0, 0, 479, 0, 0, 0, 0, 0, 0, 480, 0, 0, 0, 0, 0,\n\t0, 481, 0, 0, 0, 0, 0, 0, 482, 0, 0, 0, 0, 0, 0, 483, 0, 0, 0, 0, 0, 0,\n\t484, 0, 0, 0, 0, 0, 0, 485, 0, 0, 0, 0, 0, 0, 486, 0, 0, 0, 0, 0, 0, 487,\n\t0, 0, 0, 0, 0, 0, 488, 0, 0, 0, 0, 0, 0, 489, 0, 0, 0, 0, 0, 0, 490, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 491, 0, 0, 0, 0, 0, 0, 492, 0, 0, 0, 0, 0, 0,\n\t493, 0, 0, 0, 0, 0, 0, 494, 0, 0, 0, 0, 0, 0, 495, 0, 0, 0, 0, 0, 0, 496,\n\t0, 0, 0, 0, 0, 0, 497, 0, 0, 0, 0, 0, 0, 498, 0, 0, 0, 0, 0, 0, 499, 0,\n\t0, 0, 0, 0, 0, 500, 0, 0, 0, 0, 0, 0, 501, 0, 0, 0, 0, 0, 0, 502, 0, 0,\n\t0, 0, 0, 0, 503, 0, 0, 0, 0, 0, 0, 504, 0, 0, 0, 0, 0, 0, 505, 0, 0, 0,\n\t0, 0, 0, 506, 0, 0, 0, 0, 0, 0, 507, 0, 0, 0, 0, 0, 0, 508, 0, 0, 0, 0,\n\t0, 0, 509, 0, 0, 0, 0, 0, 0, 510, 0, 0, 0, 0, 0, 0, 511, 0, 0, 0, 0, 0,\n\t0, 512, 0, 0, 0, 0, 0, 0, 513, 0, 0, 0, 0, 0, 0, 514, 0, 0, 0, 0, 0, 0,\n\t515, 0, 0, 0, 0, 0, 0, 516, 0, 0, 0, 0, 0, 0, 517, 0, 0, 0, 0, 0, 0, 518,\n\t0, 0, 0, 0, 0, 0, 519, 0, 0, 0, 0, 0, 0, 520, 0, 0, 0, 0, 0, 0, 521, 0,\n\t0, 0, 0, 0, 0, 522, 0, 0, 0, 0, 0, 0, 523, 0, 0, 0, 0, 0, 0, 524, 0, 0,\n\t0, 0, 0, 0, 525, 0, 0, 0, 0, 0, 0, 526, 0, 0, 0, 0, 0, 0, 527, 0, 0, 0,\n\t0, 0, 0, 528, 0, 0, 0, 0, 0, 0, 529, 0, 0, 0, 0, 0, 0, 530, 0, 0, 0, 0,\n\t0, 0, 531, 0, 0, 0, 0, 0, 0, 532, 0, 0, 0, 0, 0, 0, 533, 0, 0, 0, 0, 0,\n\t0, 534, 0, 0, 0, 0, 0, 0, 535, 0, 0, 0, 0, 0, 0, 536, 0, 0, 0, 0, 0, 0,\n\t537, 0, 0, 0, 0, 0, 0, 538, 0, 0, 0, 0, 0, 0, 539, 0, 0, 0, 0, 0, 0, 540,\n\t0, 0, 0, 0, 0, 0, 541, 0, 0, 0, 0, 0, 0, 542, 0, 0, 0, 0, 0, 0, 543,\n};\n\nstatic const unsigned short comp_index1[] = {\n\t0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 4, 5, 6, 7, 8, 9, 10, 0,\n\t11, 12, 0, 13, 0, 0, 0, 14, 15, 0, 0, 0, 0, 16, 0, 0, 17, 18, 0, 19, 0,\n\t20, 0, 0, 0, 0, 21, 0, 0, 0, 0, 22, 0, 23, 0, 0, 24, 0, 25, 26, 0, 27, 0,\n\t0, 28, 29, 30, 31, 32, 33, 34, 0, 35, 0, 36, 37, 38, 0, 0, 0, 0, 0, 0,\n\t39, 40, 41, 42, 43, 0, 44, 0, 0, 0, 0, 45, 0, 0, 46, 0, 47, 0, 48, 0, 0,\n\t49, 0, 50, 0, 51, 0, 0, 0, 52, 53, 54, 55, 56, 57, 58, 0, 59, 0, 0, 60,\n\t61, 0, 0, 0, 0, 62, 0, 0, 63, 0, 0, 0, 0, 64, 0, 0, 65, 0, 66, 0, 0, 67,\n\t0, 0, 68, 0, 0, 0, 0, 69, 0, 0, 70, 0, 71, 72, 0, 73, 0, 0, 74, 0, 0, 75,\n\t76, 0, 0, 0, 77, 78, 0, 79, 0, 80, 0, 0, 81, 0, 82, 83, 0, 84, 0, 0, 85,\n\t86, 87, 88, 89, 90, 91, 0, 92, 0, 0, 93, 94, 0, 0, 95, 96, 0, 0, 97, 0,\n\t98, 99, 0, 100, 0, 101, 0, 0, 102, 0, 0, 103, 104, 0, 105, 0, 106, 0, 0,\n\t107, 0, 108, 0, 0, 0, 0, 109, 0, 110, 0, 0, 111, 0, 112, 113, 0, 114, 0,\n\t0, 115, 116, 117, 118, 119, 120, 121, 0, 122, 123, 0, 124, 125, 0, 0, 0,\n\t0, 126, 0, 0, 127, 0, 0, 0, 128, 129, 0, 130, 131, 0, 0, 0, 0, 0, 0, 132,\n\t133, 134, 135, 136, 137, 0, 0, 0, 138, 0, 0, 0, 139, 140, 0, 141, 0, 142,\n\t0, 0, 143, 0, 0, 0, 0, 144, 0, 0, 145, 146, 147, 148, 149, 150, 151, 0,\n\t152, 153, 0, 154, 0, 0, 0, 155, 156, 0, 0, 0, 0, 157, 0, 0, 158, 159, 0,\n\t160, 0, 161, 0, 0, 0, 0, 162, 0, 0, 0, 0, 163, 0, 164, 0, 0, 165, 0, 166,\n\t167, 0, 168, 0, 0, 169, 170, 171, 172, 173, 174, 175, 0, 176, 0, 177,\n\t178, 179, 0, 0, 0, 0, 0, 0, 180, 181, 182, 183, 184, 0, 185, 0, 0, 0, 0,\n\t186, 0, 0, 187, 0, 188, 0, 189, 0, 0, 190, 0, 191, 0, 192, 193, 0, 0,\n\t194, 195, 196, 197, 198, 199, 200, 0, 201, 0, 0, 202, 203, 0, 0, 0, 0,\n\t204, 0, 0, 0, 205, 0, 0, 206, 0, 0, 0, 0, 207, 0, 0, 208, 0, 209, 0, 0,\n\t210, 0, 0, 211, 0, 0, 0, 0, 212, 0, 0, 213, 0, 214, 215, 0, 216, 0, 0,\n\t217, 0, 0, 218, 219, 0, 0, 0, 220, 221, 0, 222, 0, 223, 0, 0, 224, 0,\n\t225, 226, 0, 227, 0, 0, 228, 229, 230, 231, 232, 233, 234, 0, 235, 0, 0,\n\t236, 237, 0, 0, 238, 239, 0, 0, 240, 0, 241, 242, 0, 243, 0, 244, 0, 0,\n\t245, 0, 0, 246, 247, 0, 248, 0, 249, 0, 0, 250, 0, 251, 0, 0, 0, 0, 252,\n\t0, 253, 0, 0, 254, 0, 255, 256, 0, 257, 0, 0, 258, 259, 260, 261, 262,\n\t263, 264, 0, 265, 266, 0, 267, 268, 0, 0, 0, 0, 269, 0, 0, 270, 0, 0, 0,\n\t271, 272, 0, 273, 274, 0, 0, 0, 275, 0, 0, 0, 0, 0, 0, 276, 277, 278,\n\t279, 280, 281, 0, 0, 0, 282, 0, 0, 0, 283, 284, 0, 285, 0, 286, 0, 0,\n\t287, 0, 0, 0, 0, 288, 0, 0, 289, 0, 0, 0, 0, 0, 290, 0, 291, 292, 0, 0,\n\t293, 0, 0, 0, 0, 0, 294, 0, 295, 0, 0, 0, 296, 0, 297, 0, 298, 0, 0, 0,\n\t299, 300, 0, 0, 301, 0, 0, 0, 302, 0, 0, 0, 303, 304, 0, 0, 305, 0, 0, 0,\n\t306, 0, 307, 308, 0, 0, 309, 0, 310, 0, 0, 0, 311, 0, 312, 0, 0, 313, 0,\n\t0, 314, 315, 0, 0, 316, 0, 0, 0, 0, 0, 317, 0, 318, 0, 0, 0, 319, 0, 320,\n\t0, 321, 0, 0, 0, 322, 323, 0, 0, 324, 0, 0, 0, 325, 0, 0, 0, 326, 327, 0,\n\t0, 328, 0, 0, 0, 329, 0, 330, 331, 0, 0, 332, 0, 333, 0, 0, 0, 334, 0,\n\t335, 0, 0, 336, 0, 0, 337, 338, 0, 0, 339, 0, 0, 0, 340, 341, 0, 0, 342,\n\t0, 0, 0, 343, 0, 0, 0, 344, 0, 0, 0, 345, 0, 0, 0, 346, 0, 0, 0, 0, 0, 0,\n\t347, 0, 0, 0, 348, 0, 0, 0, 349, 0, 0, 0, 350, 351, 0, 0, 0, 352, 0, 0,\n\t0, 0, 0, 0, 353, 0, 0, 0, 354, 0, 0, 0, 355, 356, 357, 0, 0, 358, 0, 0,\n\t0, 359, 0, 0, 0, 360, 361, 0, 0, 362, 0, 0, 0, 363, 0, 0, 0, 364, 365, 0,\n\t0, 366, 0, 0, 0, 367, 0, 0, 0, 368, 369, 0, 0, 370, 0, 0, 0, 371, 0, 0,\n\t0, 0, 372, 0, 0, 0, 0, 373, 0, 0, 0, 374, 0, 0, 0, 375, 0, 0, 0, 376, 0,\n\t0, 0, 377, 0, 0, 0, 378, 0, 0, 0, 379, 0, 0, 0, 380, 0, 0, 381, 0, 0,\n\t382, 0, 383, 0, 0, 0, 0, 384, 0, 0, 385, 0, 386, 0, 0, 0, 0, 0, 0, 387,\n\t388, 0, 0, 0, 0, 0, 0, 389, 0, 0, 390, 0, 391, 0, 392, 393, 0, 0, 0, 394,\n\t395, 0, 0, 0, 0, 0, 0, 396, 0, 0, 0, 397, 398, 0, 399, 400, 0, 0, 0, 401,\n\t402, 0, 0, 0, 0, 0, 0, 403, 0, 0, 404, 0, 0, 0, 405, 0, 0, 0, 406, 0,\n\t407, 0, 408, 0, 0, 0, 0, 409, 0, 0, 410, 0, 411, 0, 0, 0, 0, 0, 0, 412,\n\t413, 0, 0, 0, 0, 0, 0, 414, 0, 0, 415, 0, 416, 0, 417, 418, 0, 0, 0, 419,\n\t0, 0, 420, 0, 421, 0, 0, 0, 0, 0, 0, 422, 0, 0, 0, 423, 424, 0, 425, 426,\n\t0, 0, 0, 427, 0, 0, 428, 0, 429, 0, 0, 0, 0, 0, 0, 430, 0, 0, 431, 0,\n\t432, 0, 0, 0, 0, 0, 433, 0, 434, 0, 0, 0, 0, 0, 435, 0, 0, 0, 436, 0,\n\t437, 0, 0, 438, 0, 0, 0, 439, 0, 0, 440, 441, 442, 0, 0, 0, 443, 0, 444,\n\t445, 0, 0, 446, 447, 0, 0, 0, 448, 449, 0, 450, 451, 452, 0, 0, 0, 0, 0,\n\t0, 453, 0, 0, 454, 455, 0, 456, 0, 0, 0, 0, 0, 457, 0, 0, 0, 458, 0, 0,\n\t0, 459, 0, 0, 460, 461, 462, 0, 0, 0, 463, 0, 464, 465, 0, 0, 466, 467,\n\t0, 0, 0, 468, 469, 0, 470, 471, 472, 0, 0, 0, 0, 0, 0, 473, 0, 0, 474,\n\t475, 0, 476, 0, 0, 0, 0, 0, 477, 0, 0, 0, 478, 0, 0, 0, 479, 0, 0, 0,\n\t480, 0, 0, 481, 0, 0, 0, 482, 0, 0, 0, 0, 483, 0, 0, 0, 484, 0, 0, 0,\n\t485, 0, 0, 0, 486, 0, 0, 0, 487, 488, 0, 0, 0, 0, 0, 0, 489, 0, 0, 0,\n\t490, 0, 0, 0, 491, 0, 0, 0, 492, 0, 0, 0, 493, 494, 0, 0, 0, 495, 0, 0,\n\t0, 496, 0, 0, 0, 0, 497, 0, 0, 0, 0, 498, 499, 500, 0, 0, 0, 0, 0, 0,\n\t501, 502, 0, 0, 0, 0, 0, 0, 503, 504, 0, 0, 0, 0, 505, 0, 0, 0, 506, 507,\n\t0, 0, 508, 0, 0, 0, 0, 509, 510, 0, 0, 511, 0, 0, 0, 0, 512, 513, 0, 0,\n\t0, 0, 0, 0, 514, 0, 515, 0, 0, 0, 516, 0, 0, 0, 517, 0, 0, 0, 518, 0, 0,\n\t0, 519, 0, 0, 0, 520, 0, 0, 0, 521, 0, 0, 0, 522, 0, 0, 0, 523, 0, 0, 0,\n\t524, 0, 0, 0, 525, 0, 0, 0, 526, 0, 0, 0, 0, 527, 0, 0, 0, 528, 0, 0, 0,\n\t529, 0, 0, 0, 530, 0, 0, 0, 0, 531, 0, 0, 0, 532, 0, 533, 534, 0, 0, 535,\n\t536, 0, 0, 537, 0, 0, 0, 538, 0, 0, 0, 539, 0, 0, 0, 540, 0, 0, 541, 0,\n\t0, 0, 0, 0, 542, 0, 543, 0, 0, 0, 0, 0, 544, 0, 0, 0, 545, 0, 0, 0, 546,\n\t0, 0, 0, 547, 0, 0, 0, 548, 0, 0, 0, 549, 0, 0, 0, 550, 0, 551, 0, 0, 0,\n\t0, 0, 552, 0, 553, 0, 0, 0, 0, 0, 554, 0, 0, 0, 555, 0, 0, 0, 556, 0, 0,\n\t0, 557, 0, 0, 0, 558, 0, 0, 0, 559, 0, 0, 0, 560, 0, 561, 0, 0, 0, 562,\n\t0, 0, 0, 563, 0, 0, 0, 564, 0, 0, 0, 565, 0, 0, 0, 0, 0, 566, 0, 567, 0,\n\t0, 0, 0, 0, 568, 0, 0, 0, 569, 0, 0, 0, 570, 0, 0, 0, 571, 0, 0, 0, 572,\n\t0, 0, 0, 573, 0, 0, 0, 574, 0, 575, 0, 0, 0, 0, 0, 576, 0, 577, 0, 0, 0,\n\t0, 0, 578, 0, 0, 0, 579, 0, 0, 0, 580, 0, 0, 0, 581, 0, 0, 0, 582, 0, 0,\n\t0, 583, 0, 0, 0, 584, 0, 585, 0, 0, 0, 0, 0, 586, 0, 587, 0, 0, 0, 0, 0,\n\t588, 0, 589, 0, 0, 0, 0, 0, 590, 0, 591, 0, 0, 0, 0, 0, 592, 0, 593, 0,\n\t0, 0, 594, 0, 0, 0, 595, 0, 0, 0, 596, 0, 0, 0, 597, 0, 0, 0, 0, 0, 598,\n\t0, 599, 0, 0, 0, 0, 0, 600, 0, 601, 0, 0, 0, 0, 0, 602, 0, 603, 0, 0, 0,\n\t0, 0, 604, 0, 605, 0, 0, 0, 0, 0, 606, 0, 0, 0, 607, 0, 0, 0, 608, 0, 0,\n\t0, 609, 0, 0, 0, 610, 0, 0, 0, 611, 0, 0, 0, 612, 0, 613, 0, 0, 0, 0, 0,\n\t614, 0, 615, 0, 0, 0, 0, 0, 616, 0, 0, 0, 617, 0, 0, 0, 618, 0, 0, 0,\n\t619, 0, 0, 0, 620, 0, 0, 0, 621, 0, 0, 0, 622, 0, 0, 0, 623, 0, 0, 0,\n\t624, 0, 0, 0, 625, 0, 0, 0, 626, 0, 627, 0, 0, 0, 0, 0, 628, 0, 0, 0,\n\t629, 0, 0, 0, 630, 0, 631, 0, 0, 0, 0, 0, 632, 0, 0, 633, 0, 0, 0, 634,\n\t0, 0, 0, 635, 0, 0, 0, 636, 0, 0, 0, 637, 0, 0, 0, 638, 0, 0, 0, 639, 0,\n\t0, 0, 640, 0, 0, 0, 641, 0, 0, 0, 642, 0, 0, 0, 643, 0, 0, 0, 644, 0, 0,\n\t0, 645, 0, 0, 0, 646, 0, 0, 0, 647, 0, 0, 0, 648, 0, 0, 0, 649, 0, 0, 0,\n\t650, 0, 0, 0, 651, 0, 0, 0, 652, 0, 0, 0, 653, 0, 0, 0, 654, 0, 0, 0,\n\t655, 0, 0, 0, 656, 0, 0, 0, 657, 0, 0, 0, 658, 0, 0, 0, 659, 0, 0, 0,\n\t660, 0, 0, 0, 661, 0, 0, 0, 662, 0, 0, 0, 663, 0, 0, 0, 664, 0, 0, 0,\n\t665, 0, 0, 0, 666, 0, 0, 0, 667, 0, 0, 0, 668, 0, 0, 0, 669, 0, 0, 0,\n\t670, 0, 0, 0, 671, 0, 0, 0, 672, 0, 0, 0, 673, 0, 0, 0, 0, 674, 0, 0, 0,\n\t675, 0, 0, 0, 676, 0, 0, 0, 677, 0, 0, 0, 678, 0, 0, 0, 679, 0, 0, 0,\n\t680, 0, 0, 0, 681, 0, 0, 0, 682, 0, 0, 0, 683, 0, 0, 0, 684, 0, 0, 0,\n\t685, 0, 0, 0, 686, 0, 0, 0, 687, 0, 0, 0, 688, 0, 0, 0, 689, 0, 0, 0,\n\t690, 0, 0, 0, 691, 0, 0, 0, 692, 0, 0, 0, 693, 0, 0, 0, 694, 0, 0, 0,\n\t695, 0, 0, 0, 696, 0, 0, 0, 697, 0, 0, 0, 698, 0, 0, 0, 699, 0, 0, 0,\n\t700, 0, 0, 0, 701, 0, 0, 0, 702, 0, 0, 0, 703, 0, 0, 0, 704, 0, 0, 0,\n\t705, 0, 0, 0, 706, 0, 0, 0, 707, 0, 0, 0, 708, 0, 0, 0, 709, 0, 0, 0,\n\t710, 0, 0, 0, 711, 0, 0, 0, 712, 0, 0, 0, 713, 0, 0, 0, 714, 0, 0, 0,\n\t715, 0, 0, 0, 716, 0, 0, 0, 717, 0, 0, 0, 718, 0, 0, 0, 719, 0, 0, 0,\n\t720, 0, 0, 0, 721, 0, 0, 0, 0, 722, 0, 0, 0, 723, 0, 0, 0, 724, 0, 0, 0,\n\t725, 0, 0, 0, 726,\n};\n\nstatic const unsigned int comp_data[] = {\n\t0, 0, 0, 8814, 0, 8800, 0, 8815, 192, 193, 194, 195, 256, 258, 550, 196,\n\t7842, 197, 0, 461, 512, 514, 0, 7840, 0, 7680, 260, 0, 7682, 0, 0, 7684,\n\t7686, 0, 0, 262, 264, 0, 266, 0, 0, 268, 0, 199, 7690, 0, 0, 270, 0,\n\t7692, 0, 7696, 0, 7698, 7694, 0, 200, 201, 202, 7868, 274, 276, 278, 203,\n\t7866, 0, 0, 282, 516, 518, 0, 7864, 0, 552, 280, 7704, 0, 7706, 7710, 0,\n\t0, 500, 284, 0, 7712, 286, 288, 0, 0, 486, 0, 290, 292, 0, 7714, 7718, 0,\n\t542, 0, 7716, 0, 7720, 7722, 0, 204, 205, 206, 296, 298, 300, 304, 207,\n\t7880, 0, 0, 463, 520, 522, 0, 7882, 302, 0, 0, 7724, 308, 0, 0, 7728, 0,\n\t488, 0, 7730, 0, 310, 7732, 0, 0, 313, 0, 317, 0, 7734, 0, 315, 0, 7740,\n\t7738, 0, 0, 7742, 7744, 0, 0, 7746, 504, 323, 0, 209, 7748, 0, 0, 327, 0,\n\t7750, 0, 325, 0, 7754, 7752, 0, 210, 211, 212, 213, 332, 334, 558, 214,\n\t7886, 0, 336, 465, 524, 526, 416, 7884, 490, 0, 0, 7764, 7766, 0, 0, 340,\n\t7768, 0, 0, 344, 528, 530, 0, 7770, 0, 342, 7774, 0, 0, 346, 348, 0,\n\t7776, 0, 0, 352, 0, 7778, 536, 350, 7786, 0, 0, 356, 0, 7788, 538, 354,\n\t0, 7792, 7790, 0, 217, 218, 219, 360, 362, 364, 0, 220, 7910, 366, 368,\n\t467, 532, 534, 431, 7908, 7794, 0, 370, 7798, 0, 7796, 0, 7804, 0, 7806,\n\t7808, 7810, 372, 0, 7814, 7812, 0, 7816, 7818, 7820, 7922, 221, 374,\n\t7928, 562, 0, 7822, 376, 7926, 0, 0, 7924, 0, 377, 7824, 0, 379, 0, 0,\n\t381, 0, 7826, 7828, 0, 224, 225, 226, 227, 257, 259, 551, 228, 7843, 229,\n\t0, 462, 513, 515, 0, 7841, 0, 7681, 261, 0, 7683, 0, 0, 7685, 7687, 0, 0,\n\t263, 265, 0, 267, 0, 0, 269, 0, 231, 7691, 0, 0, 271, 0, 7693, 0, 7697,\n\t0, 7699, 7695, 0, 232, 233, 234, 7869, 275, 277, 279, 235, 7867, 0, 0,\n\t283, 517, 519, 0, 7865, 0, 553, 281, 7705, 0, 7707, 7711, 0, 0, 501, 285,\n\t0, 7713, 287, 289, 0, 0, 487, 0, 291, 293, 0, 7715, 7719, 0, 543, 0,\n\t7717, 0, 7721, 7723, 0, 7830, 0, 236, 237, 238, 297, 299, 301, 0, 239,\n\t7881, 0, 0, 464, 521, 523, 0, 7883, 303, 0, 0, 7725, 309, 0, 0, 496, 0,\n\t7729, 0, 489, 0, 7731, 0, 311, 7733, 0, 0, 314, 0, 318, 0, 7735, 0, 316,\n\t0, 7741, 7739, 0, 0, 7743, 7745, 0, 0, 7747, 505, 324, 0, 241, 7749, 0,\n\t0, 328, 0, 7751, 0, 326, 0, 7755, 7753, 0, 242, 243, 244, 245, 333, 335,\n\t559, 246, 7887, 0, 337, 466, 525, 527, 417, 7885, 491, 0, 0, 7765, 7767,\n\t0, 0, 341, 7769, 0, 0, 345, 529, 531, 0, 7771, 0, 343, 7775, 0, 0, 347,\n\t349, 0, 7777, 0, 0, 353, 0, 7779, 537, 351, 7787, 7831, 0, 357, 0, 7789,\n\t539, 355, 0, 7793, 7791, 0, 249, 250, 251, 361, 363, 365, 0, 252, 7911,\n\t367, 369, 468, 533, 535, 432, 7909, 7795, 0, 371, 7799, 0, 7797, 0, 7805,\n\t0, 7807, 7809, 7811, 373, 0, 7815, 7813, 0, 7832, 0, 7817, 7819, 7821,\n\t7923, 253, 375, 7929, 563, 0, 7823, 255, 7927, 7833, 0, 7925, 0, 378,\n\t7825, 0, 380, 0, 0, 382, 0, 7827, 7829, 0, 8173, 901, 8129, 0, 7846,\n\t7844, 0, 7850, 7848, 0, 478, 0, 0, 506, 0, 508, 482, 0, 0, 7688, 7872,\n\t7870, 0, 7876, 7874, 0, 0, 7726, 7890, 7888, 0, 7894, 7892, 0, 0, 7756,\n\t556, 0, 0, 7758, 554, 0, 0, 510, 475, 471, 469, 0, 0, 473, 7847, 7845, 0,\n\t7851, 7849, 0, 479, 0, 0, 507, 0, 509, 483, 0, 0, 7689, 7873, 7871, 0,\n\t7877, 7875, 0, 0, 7727, 7891, 7889, 0, 7895, 7893, 0, 0, 7757, 557, 0, 0,\n\t7759, 555, 0, 0, 511, 476, 472, 470, 0, 0, 474, 7856, 7854, 0, 7860,\n\t7858, 0, 7857, 7855, 0, 7861, 7859, 0, 7700, 7702, 7701, 7703, 7760,\n\t7762, 7761, 7763, 7780, 0, 7781, 0, 7782, 0, 7783, 0, 0, 7800, 0, 7801,\n\t0, 7802, 0, 7803, 7835, 0, 7900, 7898, 0, 7904, 7902, 0, 0, 7906, 7901,\n\t7899, 0, 7905, 7903, 0, 0, 7907, 7914, 7912, 0, 7918, 7916, 0, 0, 7920,\n\t7915, 7913, 0, 7919, 7917, 0, 0, 7921, 0, 494, 492, 0, 493, 0, 480, 0,\n\t481, 0, 0, 7708, 0, 7709, 560, 0, 561, 0, 0, 495, 8122, 902, 8121, 8120,\n\t7944, 7945, 0, 8124, 8136, 904, 7960, 7961, 8138, 905, 7976, 7977, 0,\n\t8140, 8154, 906, 8153, 8152, 0, 938, 7992, 7993, 8184, 908, 8008, 8009,\n\t0, 8172, 8170, 910, 8169, 8168, 0, 939, 0, 8025, 8186, 911, 8040, 8041,\n\t0, 8188, 0, 8116, 0, 8132, 8048, 940, 8113, 8112, 7936, 7937, 8118, 8115,\n\t8050, 941, 7952, 7953, 8052, 942, 7968, 7969, 8134, 8131, 8054, 943,\n\t8145, 8144, 0, 970, 7984, 7985, 8150, 0, 8056, 972, 8000, 8001, 8164,\n\t8165, 8058, 973, 8161, 8160, 0, 971, 8016, 8017, 8166, 0, 8060, 974,\n\t8032, 8033, 8182, 8179, 8146, 912, 8151, 0, 8162, 944, 8167, 0, 0, 8180,\n\t0, 979, 0, 980, 0, 1031, 0, 1232, 0, 1234, 0, 1027, 1024, 0, 0, 1238, 0,\n\t1025, 0, 1217, 0, 1244, 0, 1246, 1037, 0, 1250, 1049, 0, 1252, 0, 1036,\n\t0, 1254, 1262, 1038, 0, 1264, 1266, 0, 0, 1268, 0, 1272, 0, 1260, 0,\n\t1233, 0, 1235, 0, 1107, 1104, 0, 0, 1239, 0, 1105, 0, 1218, 0, 1245, 0,\n\t1247, 1117, 0, 1251, 1081, 0, 1253, 0, 1116, 0, 1255, 1263, 1118, 0,\n\t1265, 1267, 0, 0, 1269, 0, 1273, 0, 1261, 0, 1111, 1142, 0, 1143, 0, 0,\n\t1242, 0, 1243, 0, 1258, 0, 1259, 1570, 1571, 1573, 0, 0, 1572, 0, 1574,\n\t0, 1730, 0, 1747, 0, 1728, 0, 2345, 0, 2353, 0, 2356, 2507, 2508, 2891,\n\t2888, 2892, 0, 2964, 0, 0, 3018, 3020, 0, 0, 3019, 0, 3144, 0, 3264,\n\t3274, 3271, 3272, 0, 0, 3275, 0, 3402, 3404, 0, 0, 3403, 0, 3546, 3548,\n\t3550, 0, 3549, 4134, 0, 0, 6918, 0, 6920, 0, 6922, 0, 6924, 0, 6926, 0,\n\t6930, 0, 6971, 0, 6973, 0, 6976, 0, 6977, 0, 6979, 7736, 0, 7737, 0,\n\t7772, 0, 7773, 0, 7784, 0, 7785, 0, 7852, 0, 0, 7862, 7853, 0, 0, 7863,\n\t7878, 0, 7879, 0, 7896, 0, 7897, 0, 7938, 7940, 7942, 8064, 7939, 7941,\n\t7943, 8065, 0, 8066, 0, 8067, 0, 8068, 0, 8069, 0, 8070, 0, 8071, 7946,\n\t7948, 7950, 8072, 7947, 7949, 7951, 8073, 0, 8074, 0, 8075, 0, 8076, 0,\n\t8077, 0, 8078, 0, 8079, 7954, 7956, 7955, 7957, 7962, 7964, 7963, 7965,\n\t7970, 7972, 7974, 8080, 7971, 7973, 7975, 8081, 0, 8082, 0, 8083, 0,\n\t8084, 0, 8085, 0, 8086, 0, 8087, 7978, 7980, 7982, 8088, 7979, 7981,\n\t7983, 8089, 0, 8090, 0, 8091, 0, 8092, 0, 8093, 0, 8094, 0, 8095, 7986,\n\t7988, 7990, 0, 7987, 7989, 7991, 0, 7994, 7996, 7998, 0, 7995, 7997,\n\t7999, 0, 8002, 8004, 8003, 8005, 8010, 8012, 8011, 8013, 8018, 8020,\n\t8022, 0, 8019, 8021, 8023, 0, 8027, 8029, 8031, 0, 8034, 8036, 8038,\n\t8096, 8035, 8037, 8039, 8097, 0, 8098, 0, 8099, 0, 8100, 0, 8101, 0,\n\t8102, 0, 8103, 8042, 8044, 8046, 8104, 8043, 8045, 8047, 8105, 0, 8106,\n\t0, 8107, 0, 8108, 0, 8109, 0, 8110, 0, 8111, 0, 8114, 0, 8130, 0, 8178,\n\t0, 8119, 8141, 8142, 8143, 0, 0, 8135, 0, 8183, 8157, 8158, 8159, 0, 0,\n\t8602, 0, 8603, 0, 8622, 0, 8653, 0, 8655, 0, 8654, 0, 8708, 0, 8713, 0,\n\t8716, 0, 8740, 0, 8742, 0, 8769, 0, 8772, 0, 8775, 0, 8777, 0, 8813, 0,\n\t8802, 0, 8816, 0, 8817, 0, 8820, 0, 8821, 0, 8824, 0, 8825, 0, 8832, 0,\n\t8833, 0, 8928, 0, 8929, 0, 8836, 0, 8837, 0, 8840, 0, 8841, 0, 8930, 0,\n\t8931, 0, 8876, 0, 8877, 0, 8878, 0, 8879, 0, 8938, 0, 8939, 0, 8940, 0,\n\t8941, 12436, 0, 12364, 0, 12366, 0, 12368, 0, 12370, 0, 12372, 0, 12374,\n\t0, 12376, 0, 12378, 0, 12380, 0, 12382, 0, 12384, 0, 12386, 0, 12389, 0,\n\t12391, 0, 12393, 0, 12400, 12401, 12403, 12404, 12406, 12407, 12409,\n\t12410, 12412, 12413, 12446, 0, 12532, 0, 12460, 0, 12462, 0, 12464, 0,\n\t12466, 0, 12468, 0, 12470, 0, 12472, 0, 12474, 0, 12476, 0, 12478, 0,\n\t12480, 0, 12482, 0, 12485, 0, 12487, 0, 12489, 0, 12496, 12497, 12499,\n\t12500, 12502, 12503, 12505, 12506, 12508, 12509, 12535, 0, 12536, 0,\n\t12537, 0, 12538, 0, 12542, 0, 69786, 0, 69788, 0, 69803, 0, 0, 69934, 0,\n\t69935,\n};\n"
  },
  {
    "path": "mupdf/source/fitz/unzip.c",
    "content": "#include \"mupdf/fitz.h\"\n\n#include <zlib.h>\n\n#define ZIP_LOCAL_FILE_SIG 0x04034b50\n#define ZIP_DATA_DESC_SIG 0x08074b50\n#define ZIP_CENTRAL_DIRECTORY_SIG 0x02014b50\n#define ZIP_END_OF_CENTRAL_DIRECTORY_SIG 0x06054b50\n\n#define ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIG 0x07064b50\n#define ZIP64_END_OF_CENTRAL_DIRECTORY_SIG 0x06064b50\n#define ZIP64_EXTRA_FIELD_SIG 0x0001\n\n#define ZIP_ENCRYPTED_FLAG 0x1\n\nstruct zip_entry\n{\n\tchar *name;\n\tint offset, csize, usize;\n};\n\nstruct fz_archive_s\n{\n\tchar *directory;\n\tfz_stream *file;\n\tint count;\n\tstruct zip_entry *table;\n};\n\nstatic inline int getshort(fz_stream *file)\n{\n\tint a = fz_read_byte(file);\n\tint b = fz_read_byte(file);\n\treturn a | b << 8;\n}\n\nstatic inline int getlong(fz_stream *file)\n{\n\tint a = fz_read_byte(file);\n\tint b = fz_read_byte(file);\n\tint c = fz_read_byte(file);\n\tint d = fz_read_byte(file);\n\treturn a | b << 8 | c << 16 | d << 24;\n}\n\nstatic inline int getlong64(fz_stream *file)\n{\n\tint a = getlong(file);\n\tint b = getlong(file);\n\treturn b != 0 ? -1 : a;\n}\n\nstatic inline int zip_isdigit(int c)\n{\n\treturn c >= '0' && c <= '9';\n}\n\nstatic inline int zip_toupper(int c)\n{\n\tif (c >= 'a' && c <= 'z')\n\t\treturn c - 'a' + 'A';\n\treturn c;\n}\n\nstatic int zip_strcasecmp(const char *a, const char *b)\n{\n\twhile (zip_toupper(*a) == zip_toupper(*b))\n\t{\n\t\tif (*a++ == 0)\n\t\t\treturn 0;\n\t\tb++;\n\t}\n\treturn zip_toupper(*a) - zip_toupper(*b);\n}\n\nstatic int case_compare_entries(const void *a_, const void *b_)\n{\n\tconst struct zip_entry *a = a_;\n\tconst struct zip_entry *b = b_;\n\treturn zip_strcasecmp(a->name, b->name);\n}\n\nstatic struct zip_entry *lookup_zip_entry(fz_context *ctx, fz_archive *zip, const char *name)\n{\n\tint l = 0;\n\tint r = zip->count - 1;\n\twhile (l <= r)\n\t{\n\t\tint m = (l + r) >> 1;\n\t\tint c = zip_strcasecmp(name, zip->table[m].name);\n\t\tif (c < 0)\n\t\t\tr = m - 1;\n\t\telse if (c > 0)\n\t\t\tl = m + 1;\n\t\telse\n\t\t\treturn &zip->table[m];\n\t}\n\treturn NULL;\n}\n\nstatic void read_zip_dir_imp(fz_context *ctx, fz_archive *zip, int start_offset)\n{\n\tfz_stream *file = zip->file;\n\tint sig;\n\tint offset, count;\n\tint namesize, metasize, commentsize;\n\tint i;\n\n\tfz_seek(file, start_offset, 0);\n\n\tsig = getlong(file);\n\tif (sig != ZIP_END_OF_CENTRAL_DIRECTORY_SIG)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"wrong zip end of central directory signature (0x%x)\", sig);\n\n\t(void) getshort(file); /* this disk */\n\t(void) getshort(file); /* start disk */\n\t(void) getshort(file); /* entries in this disk */\n\tcount = getshort(file); /* entries in central directory disk */\n\t(void) getlong(file); /* size of central directory */\n\toffset = getlong(file); /* offset to central directory */\n\n\t/* ZIP64 */\n\tif (count == 0xFFFF || offset == 0xFFFFFFFF)\n\t{\n\t\tint offset64, count64;\n\n\t\tfz_seek(file, start_offset - 20, 0);\n\n\t\tsig = getlong(file);\n\t\tif (sig != ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIG)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"wrong zip64 end of central directory locator signature (0x%x)\", sig);\n\n\t\t(void) getlong(file); /* start disk */\n\t\toffset64 = getlong64(file); /* offset to end of central directory record */\n\t\tif (offset64 < 0)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"zip64 files larger than 2 GB aren't supported\");\n\n\t\tfz_seek(file, offset64, 0);\n\n\t\tsig = getlong(file);\n\t\tif (sig != ZIP64_END_OF_CENTRAL_DIRECTORY_SIG)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"wrong zip64 end of central directory signature (0x%x)\", sig);\n\n\t\t(void) getlong64(file); /* size of record */\n\t\t(void) getshort(file); /* version made by */\n\t\t(void) getshort(file); /* version to extract */\n\t\t(void) getlong(file); /* disk number */\n\t\t(void) getlong(file); /* disk number start */\n\t\tcount64 = getlong64(file); /* entries in central directory disk */\n\t\t(void) getlong64(file); /* entries in central directory */\n\t\t(void) getlong64(file); /* size of central directory */\n\t\toffset64 = getlong64(file); /* offset to central directory */\n\n\t\tif (count == 0xFFFF)\n\t\t\tcount = count64;\n\t\tif (offset == 0xFFFFFFFF)\n\t\t\toffset = offset64;\n\t\tif (count < 0 || offset < 0)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"zip64 files larger than 2 GB aren't supported\");\n\t}\n\n\tzip->count = count;\n\tzip->table = fz_malloc_array(ctx, count, sizeof *zip->table);\n\tmemset(zip->table, 0, count * sizeof *zip->table);\n\n\tfz_seek(file, offset, 0);\n\n\tfor (i = 0; i < count; i++)\n\t{\n\t\tsig = getlong(file);\n\t\tif (sig != ZIP_CENTRAL_DIRECTORY_SIG)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"wrong zip central directory signature (0x%x)\", sig);\n\n\t\t(void) getshort(file); /* version made by */\n\t\t(void) getshort(file); /* version to extract */\n\t\t(void) getshort(file); /* general */\n\t\t(void) getshort(file); /* method */\n\t\t(void) getshort(file); /* last mod file time */\n\t\t(void) getshort(file); /* last mod file date */\n\t\t(void) getlong(file); /* crc-32 */\n\t\tzip->table[i].csize = getlong(file);\n\t\tzip->table[i].usize = getlong(file);\n\t\tnamesize = getshort(file);\n\t\tmetasize = getshort(file);\n\t\tcommentsize = getshort(file);\n\t\t(void) getshort(file); /* disk number start */\n\t\t(void) getshort(file); /* int file atts */\n\t\t(void) getlong(file); /* ext file atts */\n\t\tzip->table[i].offset = getlong(file);\n\n\t\tzip->table[i].name = fz_malloc(ctx, namesize + 1);\n\t\tfz_read(file, (unsigned char*)zip->table[i].name, namesize);\n\t\tzip->table[i].name[namesize] = 0;\n\n\t\twhile (metasize > 0)\n\t\t{\n\t\t\tint type = getshort(file);\n\t\t\tint size = getshort(file);\n\t\t\tif (type == ZIP64_EXTRA_FIELD_SIG)\n\t\t\t{\n\t\t\t\tint sizeleft = size;\n\t\t\t\tif (zip->table[i].usize == 0xFFFFFFFF && sizeleft >= 8)\n\t\t\t\t{\n\t\t\t\t\tzip->table[i].usize = getlong64(file);\n\t\t\t\t\tsizeleft -= 8;\n\t\t\t\t}\n\t\t\t\tif (zip->table[i].csize == 0xFFFFFFFF && sizeleft >= 8)\n\t\t\t\t{\n\t\t\t\t\tzip->table[i].csize = getlong64(file);\n\t\t\t\t\tsizeleft -= 8;\n\t\t\t\t}\n\t\t\t\tif (zip->table[i].offset == 0xFFFFFFFF && sizeleft >= 8)\n\t\t\t\t{\n\t\t\t\t\tzip->table[i].offset = getlong64(file);\n\t\t\t\t\tsizeleft -= 8;\n\t\t\t\t}\n\t\t\t\tfz_seek(file, sizeleft - size, 1);\n\t\t\t}\n\t\t\tfz_seek(file, size, 1);\n\t\t\tmetasize -= 4 + size;\n\t\t}\n\t\tif (zip->table[i].usize < 0 || zip->table[i].csize < 0 || zip->table[i].offset < 0)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"zip64 files larger than 2 GB are not supported\");\n\n\t\tfz_seek(file, commentsize, 1);\n\t}\n\n\tqsort(zip->table, count, sizeof *zip->table, case_compare_entries);\n}\n\nstatic void read_zip_dir(fz_context *ctx, fz_archive *zip)\n{\n\tfz_stream *file = zip->file;\n\tunsigned char buf[512];\n\tint size, back, maxback;\n\tint i, n;\n\n\tfz_seek(file, 0, SEEK_END);\n\tsize = fz_tell(file);\n\n\tmaxback = fz_mini(size, 0xFFFF + sizeof buf);\n\tback = fz_mini(maxback, sizeof buf);\n\n\twhile (back < maxback)\n\t{\n\t\tfz_seek(file, size - back, 0);\n\t\tn = fz_read(file, buf, sizeof buf);\n\t\tfor (i = n - 4; i > 0; i--)\n\t\t{\n\t\t\tif (!memcmp(buf + i, \"PK\\5\\6\", 4))\n\t\t\t{\n\t\t\t\tread_zip_dir_imp(ctx, zip, size - back + i);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tback += sizeof buf - 4;\n\t}\n\n\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot find end of central directory\");\n}\n\nstatic int read_zip_entry_header(fz_context *ctx, fz_archive *zip, struct zip_entry *ent)\n{\n\tfz_stream *file = zip->file;\n\tint sig, general, method, namelength, extralength;\n\n\tfz_seek(file, ent->offset, 0);\n\n\tsig = getlong(file);\n\tif (sig != ZIP_LOCAL_FILE_SIG)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"wrong zip local file signature (0x%x)\", sig);\n\n\t(void) getshort(file); /* version */\n\tgeneral = getshort(file); /* general */\n\tif (general & ZIP_ENCRYPTED_FLAG)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"zip content is encrypted\");\n\n\tmethod = getshort(file);\n\t(void) getshort(file); /* file time */\n\t(void) getshort(file); /* file date */\n\t(void) getlong(file); /* crc-32 */\n\t(void) getlong(file); /* csize */\n\t(void) getlong(file); /* usize */\n\tnamelength = getshort(file);\n\textralength = getshort(file);\n\n\tfz_seek(file, namelength + extralength, 1);\n\n\treturn method;\n}\n\nstatic fz_stream *open_zip_entry(fz_context *ctx, fz_archive *zip, struct zip_entry *ent)\n{\n\tfz_stream *file = zip->file;\n\tint method = read_zip_entry_header(ctx, zip, ent);\n\tif (method == 0)\n\t\treturn fz_open_null(file, ent->usize, fz_tell(file));\n\tif (method == 8)\n\t\treturn fz_open_flated(file, -15);\n\tfz_throw(ctx, FZ_ERROR_GENERIC, \"unknown zip method: %d\", method);\n}\n\nstatic fz_buffer *read_zip_entry(fz_context *ctx, fz_archive *zip, struct zip_entry *ent)\n{\n\tfz_stream *file = zip->file;\n\tfz_buffer *ubuf;\n\tunsigned char *cbuf;\n\tint method;\n\tz_stream z;\n\tint code;\n\n\tmethod = read_zip_entry_header(ctx, zip, ent);\n\n\tubuf = fz_new_buffer(ctx, ent->usize + 1); /* +1 because many callers will add a terminating zero */\n\tubuf->len = ent->usize;\n\n\tif (method == 0)\n\t{\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tfz_read(file, ubuf->data, ent->usize);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_drop_buffer(ctx, ubuf);\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t\treturn ubuf;\n\t}\n\n\tif (method == 8)\n\t{\n\t\tcbuf = fz_malloc(ctx, ent->csize);\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tfz_read(file, cbuf, ent->csize);\n\n\t\t\tz.zalloc = (alloc_func) fz_malloc_array;\n\t\t\tz.zfree = (free_func) fz_free;\n\t\t\tz.opaque = ctx;\n\t\t\tz.next_in = cbuf;\n\t\t\tz.avail_in = ent->csize;\n\t\t\tz.next_out = ubuf->data;\n\t\t\tz.avail_out = ent->usize;\n\n\t\t\tcode = inflateInit2(&z, -15);\n\t\t\tif (code != Z_OK)\n\t\t\t{\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"zlib inflateInit2 error: %s\", z.msg);\n\t\t\t}\n\t\t\tcode = inflate(&z, Z_FINISH);\n\t\t\tif (code != Z_STREAM_END)\n\t\t\t{\n\t\t\t\tinflateEnd(&z);\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"zlib inflate error: %s\", z.msg);\n\t\t\t}\n\t\t\tcode = inflateEnd(&z);\n\t\t\tif (code != Z_OK)\n\t\t\t{\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"zlib inflateEnd error: %s\", z.msg);\n\t\t\t}\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tfz_free(ctx, cbuf);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_drop_buffer(ctx, ubuf);\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t\treturn ubuf;\n\t}\n\n\tfz_drop_buffer(ctx, ubuf);\n\tfz_throw(ctx, FZ_ERROR_GENERIC, \"unknown zip method: %d\", method);\n}\n\nint\nfz_has_archive_entry(fz_context *ctx, fz_archive *zip, const char *name)\n{\n\tif (zip->directory)\n\t{\n\t\tchar path[2048];\n\t\tFILE *file;\n\t\tfz_strlcpy(path, zip->directory, sizeof path);\n\t\tfz_strlcat(path, \"/\", sizeof path);\n\t\tfz_strlcat(path, name, sizeof path);\n\t\tfile = fopen(path, \"rb\");\n\t\tif (file)\n\t\t\tfclose(file);\n\t\treturn file != NULL;\n\t}\n\telse\n\t{\n\t\treturn lookup_zip_entry(ctx, zip, name) != NULL;\n\t}\n}\n\nfz_stream *\nfz_open_archive_entry(fz_context *ctx, fz_archive *zip, const char *name)\n{\n\tif (zip->directory)\n\t{\n\t\tchar path[2048];\n\t\tfz_strlcpy(path, zip->directory, sizeof path);\n\t\tfz_strlcat(path, \"/\", sizeof path);\n\t\tfz_strlcat(path, name, sizeof path);\n\t\treturn fz_open_file(ctx, path);\n\t}\n\telse\n\t{\n\t\tstruct zip_entry *ent = lookup_zip_entry(ctx, zip, name);\n\t\tif (!ent)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot find zip entry: '%s'\", name);\n\t\treturn open_zip_entry(ctx, zip, ent);\n\t}\n}\n\nfz_buffer *\nfz_read_archive_entry(fz_context *ctx, fz_archive *zip, const char *name)\n{\n\tif (zip->directory)\n\t{\n\t\tchar path[2048];\n\t\tfz_strlcpy(path, zip->directory, sizeof path);\n\t\tfz_strlcat(path, \"/\", sizeof path);\n\t\tfz_strlcat(path, name, sizeof path);\n\t\treturn fz_read_file(ctx, path);\n\t}\n\telse\n\t{\n\t\tstruct zip_entry *ent = lookup_zip_entry(ctx, zip, name);\n\t\tif (!ent)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot find zip entry: '%s'\", name);\n\t\treturn read_zip_entry(ctx, zip, ent);\n\t}\n}\n\nint\nfz_count_archive_entries(fz_context *ctx, fz_archive *zip)\n{\n\treturn zip->count;\n}\n\nconst char *\nfz_list_archive_entry(fz_context *ctx, fz_archive *zip, int idx)\n{\n\tif (idx < 0 || idx >= zip->count)\n\t\treturn NULL;\n\treturn zip->table[idx].name;\n}\n\nvoid\nfz_close_archive(fz_context *ctx, fz_archive *zip)\n{\n\tint i;\n\tif (zip)\n\t{\n\t\tfz_free(ctx, zip->directory);\n\t\tfz_close(zip->file);\n\t\tfor (i = 0; i < zip->count; ++i)\n\t\t\tfz_free(ctx, zip->table[i].name);\n\t\tfz_free(ctx, zip->table);\n\t\tfz_free(ctx, zip);\n\t}\n}\n\nvoid\nfz_rebind_archive(fz_archive *zip, fz_context *ctx)\n{\n\tif (zip->file)\n\t\tfz_rebind_stream(zip->file, ctx);\n}\n\nfz_archive *\nfz_open_directory(fz_context *ctx, const char *dirname)\n{\n\tfz_archive *zip = fz_malloc_struct(ctx, fz_archive);\n\tzip->directory = fz_strdup(ctx, dirname);\n\treturn zip;\n}\n\nfz_archive *\nfz_open_archive_with_stream(fz_context *ctx, fz_stream *file)\n{\n\tfz_archive *zip;\n\n\tzip = fz_malloc_struct(ctx, fz_archive);\n\tzip->file = fz_keep_stream(file);\n\tzip->count = 0;\n\tzip->table = NULL;\n\n\tfz_try(ctx)\n\t{\n\t\tread_zip_dir(ctx, zip);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_close_archive(ctx, zip);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn zip;\n}\n\nfz_archive *\nfz_open_archive(fz_context *ctx, const char *filename)\n{\n\tfz_stream *file;\n\tfz_archive *zip;\n\n\tfile = fz_open_file(ctx, filename);\n\tfz_try(ctx)\n\t{\n\t\tzip = fz_open_archive_with_stream(ctx, file);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(file);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn zip;\n}\n"
  },
  {
    "path": "mupdf/source/fitz/xml.c",
    "content": "#include \"mupdf/fitz.h\"\n\nstatic const struct { const char *ent; int ucs; } html_entities[] = {\n\t{\"nbsp\",160}, {\"iexcl\",161}, {\"cent\",162}, {\"pound\",163},\n\t{\"curren\",164}, {\"yen\",165}, {\"brvbar\",166}, {\"sect\",167},\n\t{\"uml\",168}, {\"copy\",169}, {\"ordf\",170}, {\"laquo\",171},\n\t{\"not\",172}, {\"shy\",173}, {\"reg\",174}, {\"macr\",175}, {\"deg\",176},\n\t{\"plusmn\",177}, {\"sup2\",178}, {\"sup3\",179}, {\"acute\",180},\n\t{\"micro\",181}, {\"para\",182}, {\"middot\",183}, {\"cedil\",184},\n\t{\"sup1\",185}, {\"ordm\",186}, {\"raquo\",187}, {\"frac14\",188},\n\t{\"frac12\",189}, {\"frac34\",190}, {\"iquest\",191}, {\"Agrave\",192},\n\t{\"Aacute\",193}, {\"Acirc\",194}, {\"Atilde\",195}, {\"Auml\",196},\n\t{\"Aring\",197}, {\"AElig\",198}, {\"Ccedil\",199}, {\"Egrave\",200},\n\t{\"Eacute\",201}, {\"Ecirc\",202}, {\"Euml\",203}, {\"Igrave\",204},\n\t{\"Iacute\",205}, {\"Icirc\",206}, {\"Iuml\",207}, {\"ETH\",208},\n\t{\"Ntilde\",209}, {\"Ograve\",210}, {\"Oacute\",211}, {\"Ocirc\",212},\n\t{\"Otilde\",213}, {\"Ouml\",214}, {\"times\",215}, {\"Oslash\",216},\n\t{\"Ugrave\",217}, {\"Uacute\",218}, {\"Ucirc\",219}, {\"Uuml\",220},\n\t{\"Yacute\",221}, {\"THORN\",222}, {\"szlig\",223}, {\"agrave\",224},\n\t{\"aacute\",225}, {\"acirc\",226}, {\"atilde\",227}, {\"auml\",228},\n\t{\"aring\",229}, {\"aelig\",230}, {\"ccedil\",231}, {\"egrave\",232},\n\t{\"eacute\",233}, {\"ecirc\",234}, {\"euml\",235}, {\"igrave\",236},\n\t{\"iacute\",237}, {\"icirc\",238}, {\"iuml\",239}, {\"eth\",240},\n\t{\"ntilde\",241}, {\"ograve\",242}, {\"oacute\",243}, {\"ocirc\",244},\n\t{\"otilde\",245}, {\"ouml\",246}, {\"divide\",247}, {\"oslash\",248},\n\t{\"ugrave\",249}, {\"uacute\",250}, {\"ucirc\",251}, {\"uuml\",252},\n\t{\"yacute\",253}, {\"thorn\",254}, {\"yuml\",255}, {\"lt\",60}, {\"gt\",62},\n\t{\"amp\",38}, {\"apos\",39}, {\"quot\",34}, {\"OElig\",338}, {\"oelig\",339},\n\t{\"Scaron\",352}, {\"scaron\",353}, {\"Yuml\",376}, {\"circ\",710},\n\t{\"tilde\",732}, {\"ensp\",8194}, {\"emsp\",8195}, {\"thinsp\",8201},\n\t{\"zwnj\",8204}, {\"zwj\",8205}, {\"lrm\",8206}, {\"rlm\",8207},\n\t{\"ndash\",8211}, {\"mdash\",8212}, {\"lsquo\",8216}, {\"rsquo\",8217},\n\t{\"sbquo\",8218}, {\"ldquo\",8220}, {\"rdquo\",8221}, {\"bdquo\",8222},\n\t{\"dagger\",8224}, {\"Dagger\",8225}, {\"permil\",8240}, {\"lsaquo\",8249},\n\t{\"rsaquo\",8250}, {\"euro\",8364}, {\"fnof\",402}, {\"Alpha\",913},\n\t{\"Beta\",914}, {\"Gamma\",915}, {\"Delta\",916}, {\"Epsilon\",917},\n\t{\"Zeta\",918}, {\"Eta\",919}, {\"Theta\",920}, {\"Iota\",921}, {\"Kappa\",922},\n\t{\"Lambda\",923}, {\"Mu\",924}, {\"Nu\",925}, {\"Xi\",926}, {\"Omicron\",927},\n\t{\"Pi\",928}, {\"Rho\",929}, {\"Sigma\",931}, {\"Tau\",932}, {\"Upsilon\",933},\n\t{\"Phi\",934}, {\"Chi\",935}, {\"Psi\",936}, {\"Omega\",937}, {\"alpha\",945},\n\t{\"beta\",946}, {\"gamma\",947}, {\"delta\",948}, {\"epsilon\",949},\n\t{\"zeta\",950}, {\"eta\",951}, {\"theta\",952}, {\"iota\",953}, {\"kappa\",954},\n\t{\"lambda\",955}, {\"mu\",956}, {\"nu\",957}, {\"xi\",958}, {\"omicron\",959},\n\t{\"pi\",960}, {\"rho\",961}, {\"sigmaf\",962}, {\"sigma\",963}, {\"tau\",964},\n\t{\"upsilon\",965}, {\"phi\",966}, {\"chi\",967}, {\"psi\",968}, {\"omega\",969},\n\t{\"thetasym\",977}, {\"upsih\",978}, {\"piv\",982}, {\"bull\",8226},\n\t{\"hellip\",8230}, {\"prime\",8242}, {\"Prime\",8243}, {\"oline\",8254},\n\t{\"frasl\",8260}, {\"weierp\",8472}, {\"image\",8465}, {\"real\",8476},\n\t{\"trade\",8482}, {\"alefsym\",8501}, {\"larr\",8592}, {\"uarr\",8593},\n\t{\"rarr\",8594}, {\"darr\",8595}, {\"harr\",8596}, {\"crarr\",8629},\n\t{\"lArr\",8656}, {\"uArr\",8657}, {\"rArr\",8658}, {\"dArr\",8659},\n\t{\"hArr\",8660}, {\"forall\",8704}, {\"part\",8706}, {\"exist\",8707},\n\t{\"empty\",8709}, {\"nabla\",8711}, {\"isin\",8712}, {\"notin\",8713},\n\t{\"ni\",8715}, {\"prod\",8719}, {\"sum\",8721}, {\"minus\",8722},\n\t{\"lowast\",8727}, {\"radic\",8730}, {\"prop\",8733}, {\"infin\",8734},\n\t{\"ang\",8736}, {\"and\",8743}, {\"or\",8744}, {\"cap\",8745}, {\"cup\",8746},\n\t{\"int\",8747}, {\"there4\",8756}, {\"sim\",8764}, {\"cong\",8773},\n\t{\"asymp\",8776}, {\"ne\",8800}, {\"equiv\",8801}, {\"le\",8804}, {\"ge\",8805},\n\t{\"sub\",8834}, {\"sup\",8835}, {\"nsub\",8836}, {\"sube\",8838},\n\t{\"supe\",8839}, {\"oplus\",8853}, {\"otimes\",8855}, {\"perp\",8869},\n\t{\"sdot\",8901}, {\"lceil\",8968}, {\"rceil\",8969}, {\"lfloor\",8970},\n\t{\"rfloor\",8971}, {\"lang\",9001}, {\"rang\",9002}, {\"loz\",9674},\n\t{\"spades\",9824}, {\"clubs\",9827}, {\"hearts\",9829}, {\"diams\",9830},\n};\n\nstruct parser\n{\n\tfz_xml *head;\n\tfz_context *ctx;\n\tint preserve_white;\n\tint depth;\n};\n\nstruct attribute\n{\n\tchar name[40];\n\tchar *value;\n\tstruct attribute *next;\n};\n\nstruct fz_xml_s\n{\n\tchar name[40];\n\tchar *text;\n\tstruct attribute *atts;\n\tfz_xml *up, *down, *tail, *prev, *next;\n};\n\nstatic inline void indent(int n)\n{\n\twhile (n--) putchar(' ');\n}\n\nvoid fz_debug_xml(fz_xml *item, int level)\n{\n\tif (item->text)\n\t{\n\t\tprintf(\"%s\\n\", item->text);\n\t}\n\telse\n\t{\n\t\tfz_xml *child;\n\t\tstruct attribute *att;\n\n\t\tindent(level);\n\t\tprintf(\"<%s\", item->name);\n\t\tfor (att = item->atts; att; att = att->next)\n\t\t\tprintf(\" %s=\\\"%s\\\"\", att->name, att->value);\n\t\tif (item->down)\n\t\t{\n\t\t\tprintf(\">\\n\");\n\t\t\tfor (child = item->down; child; child = child->next)\n\t\t\t\tfz_debug_xml(child, level + 1);\n\t\t\tindent(level);\n\t\t\tprintf(\"</%s>\\n\", item->name);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprintf(\"/>\\n\");\n\t\t}\n\t}\n}\n\nfz_xml *fz_xml_prev(fz_xml *item)\n{\n\treturn item ? item->prev : NULL;\n}\n\nfz_xml *fz_xml_next(fz_xml *item)\n{\n\treturn item ? item->next : NULL;\n}\n\nfz_xml *fz_xml_up(fz_xml *item)\n{\n\treturn item ? item->up : NULL;\n}\n\nfz_xml *fz_xml_down(fz_xml *item)\n{\n\treturn item ? item->down : NULL;\n}\n\nchar *fz_xml_text(fz_xml *item)\n{\n\treturn item ? item->text : NULL;\n}\n\nchar *fz_xml_tag(fz_xml *item)\n{\n\treturn item && item->name[0] ? item->name : NULL;\n}\n\nint fz_xml_is_tag(fz_xml *item, const char *name)\n{\n\tif (!item)\n\t\treturn 0;\n\treturn !strcmp(item->name, name);\n}\n\nchar *fz_xml_att(fz_xml *item, const char *name)\n{\n\tstruct attribute *att;\n\tif (!item)\n\t\treturn NULL;\n\tfor (att = item->atts; att; att = att->next)\n\t\tif (!strcmp(att->name, name))\n\t\t\treturn att->value;\n\treturn NULL;\n}\n\nfz_xml *fz_xml_find(fz_xml *item, const char *tag)\n{\n\twhile (item)\n\t{\n\t\tif (!strcmp(item->name, tag))\n\t\t\treturn item;\n\t\titem = item->next;\n\t}\n\treturn NULL;\n}\n\nfz_xml *fz_xml_find_next(fz_xml *item, const char *tag)\n{\n\tif (item)\n\t\titem = item->next;\n\treturn fz_xml_find(item, tag);\n}\n\nfz_xml *fz_xml_find_down(fz_xml *item, const char *tag)\n{\n\tif (item)\n\t\titem = item->down;\n\treturn fz_xml_find(item, tag);\n}\n\nstatic void xml_free_attribute(fz_context *ctx, struct attribute *att)\n{\n\twhile (att) {\n\t\tstruct attribute *next = att->next;\n\t\tif (att->value)\n\t\t\tfz_free(ctx, att->value);\n\t\tfz_free(ctx, att);\n\t\tatt = next;\n\t}\n}\n\nvoid fz_free_xml(fz_context *ctx, fz_xml *item)\n{\n\twhile (item)\n\t{\n\t\tfz_xml *next = item->next;\n\t\tif (item->text)\n\t\t\tfz_free(ctx, item->text);\n\t\tif (item->atts)\n\t\t\txml_free_attribute(ctx, item->atts);\n\t\tif (item->down)\n\t\t\tfz_free_xml(ctx, item->down);\n\t\tfz_free(ctx, item);\n\t\titem = next;\n\t}\n}\n\nvoid fz_detach_xml(fz_xml *node)\n{\n\tif (node->up)\n\t\tnode->up->down = NULL;\n}\n\nstatic int xml_parse_entity(int *c, char *a)\n{\n\tchar *b;\n\tint i;\n\n\tif (a[1] == '#') {\n\t\tif (a[2] == 'x')\n\t\t\t*c = strtol(a + 3, &b, 16);\n\t\telse\n\t\t\t*c = strtol(a + 2, &b, 10);\n\t\tif (*b == ';')\n\t\t\treturn b - a + 1;\n\t}\n\telse if (a[1] == 'l' && a[2] == 't' && a[3] == ';') {\n\t\t*c = '<';\n\t\treturn 4;\n\t}\n\telse if (a[1] == 'g' && a[2] == 't' && a[3] == ';') {\n\t\t*c = '>';\n\t\treturn 4;\n\t}\n\telse if (a[1] == 'a' && a[2] == 'm' && a[3] == 'p' && a[4] == ';') {\n\t\t*c = '&';\n\t\treturn 5;\n\t}\n\telse if (a[1] == 'a' && a[2] == 'p' && a[3] == 'o' && a[4] == 's' && a[5] == ';') {\n\t\t*c = '\\'';\n\t\treturn 6;\n\t}\n\telse if (a[1] == 'q' && a[2] == 'u' && a[3] == 'o' && a[4] == 't' && a[5] == ';') {\n\t\t*c = '\"';\n\t\treturn 6;\n\t}\n\n\t/* We should only be doing this for XHTML, but it shouldn't be a problem. */\n\tfor (i = 0; i < nelem(html_entities); ++i) {\n\t\tunsigned int n = strlen(html_entities[i].ent);\n\t\tif (!memcmp(a+1, html_entities[i].ent, n) && a[1+n] == ';') {\n\t\t\t*c = html_entities[i].ucs;\n\t\t\treturn n + 2;\n\t\t}\n\t}\n\n\t*c = *a;\n\treturn 1;\n}\n\nstatic inline int isname(int c)\n{\n\treturn c == '.' || c == '-' || c == '_' || c == ':' ||\n\t\t(c >= '0' && c <= '9') ||\n\t\t(c >= 'A' && c <= 'Z') ||\n\t\t(c >= 'a' && c <= 'z');\n}\n\nstatic inline int iswhite(int c)\n{\n\treturn c == ' ' || c == '\\r' || c == '\\n' || c == '\\t';\n}\n\nstatic void xml_emit_open_tag(struct parser *parser, char *a, char *b)\n{\n\tfz_xml *head, *tail;\n\tchar *ns;\n\n\t/* skip namespace prefix */\n\tfor (ns = a; ns < b; ++ns)\n\t\tif (*ns == ':')\n\t\t\ta = ns + 1;\n\n\thead = fz_malloc_struct(parser->ctx, fz_xml);\n\tif (b - a > sizeof(head->name) - 1)\n\t\tb = a + sizeof(head->name) - 1;\n\tmemcpy(head->name, a, b - a);\n\thead->name[b - a] = 0;\n\n\thead->atts = NULL;\n\thead->text = NULL;\n\thead->up = parser->head;\n\thead->down = NULL;\n\thead->prev = NULL;\n\thead->next = NULL;\n\n\tif (!parser->head->down) {\n\t\tparser->head->down = head;\n\t\tparser->head->tail = head;\n\t}\n\telse {\n\t\ttail = parser->head->tail;\n\t\ttail->next = head;\n\t\thead->prev = tail;\n\t\tparser->head->tail = head;\n\t}\n\n\tparser->head = head;\n\tparser->depth++;\n}\n\nstatic void xml_emit_att_name(struct parser *parser, char *a, char *b)\n{\n\tfz_xml *head = parser->head;\n\tstruct attribute *att;\n\n\tatt = fz_malloc_struct(parser->ctx, struct attribute);\n\tif (b - a > sizeof(att->name) - 1)\n\t\tb = a + sizeof(att->name) - 1;\n\tmemcpy(att->name, a, b - a);\n\tatt->name[b - a] = 0;\n\tatt->value = NULL;\n\tatt->next = head->atts;\n\thead->atts = att;\n}\n\nstatic void xml_emit_att_value(struct parser *parser, char *a, char *b)\n{\n\tfz_xml *head = parser->head;\n\tstruct attribute *att = head->atts;\n\tchar *s;\n\tint c;\n\n\t/* entities are all longer than UTFmax so runetochar is safe */\n\ts = att->value = fz_malloc(parser->ctx, b - a + 1);\n\twhile (a < b) {\n\t\tif (*a == '&') {\n\t\t\ta += xml_parse_entity(&c, a);\n\t\t\ts += fz_runetochar(s, c);\n\t\t}\n\t\telse {\n\t\t\t*s++ = *a++;\n\t\t}\n\t}\n\t*s = 0;\n}\n\nstatic void xml_emit_close_tag(struct parser *parser)\n{\n\tparser->depth--;\n\tif (parser->head->up)\n\t\tparser->head = parser->head->up;\n}\n\nstatic void xml_emit_text(struct parser *parser, char *a, char *b)\n{\n\tstatic char *empty = \"\";\n\tfz_xml *head;\n\tchar *s;\n\tint c;\n\n\t/* Skip text outside the root tag */\n\tif (parser->depth == 0)\n\t\treturn;\n\n\t/* Skip all-whitespace text nodes */\n\tif (!parser->preserve_white)\n\t{\n\t\tfor (s = a; s < b; s++)\n\t\t\tif (!iswhite(*s))\n\t\t\t\tbreak;\n\t\tif (s == b)\n\t\t\treturn;\n\t}\n\n\txml_emit_open_tag(parser, empty, empty);\n\thead = parser->head;\n\n\t/* entities are all longer than UTFmax so runetochar is safe */\n\ts = head->text = fz_malloc(parser->ctx, b - a + 1);\n\twhile (a < b) {\n\t\tif (*a == '&') {\n\t\t\ta += xml_parse_entity(&c, a);\n\t\t\ts += fz_runetochar(s, c);\n\t\t}\n\t\telse {\n\t\t\t*s++ = *a++;\n\t\t}\n\t}\n\t*s = 0;\n\n\txml_emit_close_tag(parser);\n}\n\nstatic void xml_emit_cdata(struct parser *parser, char *a, char *b)\n{\n\tstatic char *empty = \"\";\n\tfz_xml *head;\n\tchar *s;\n\n\txml_emit_open_tag(parser, empty, empty);\n\thead = parser->head;\n\n\ts = head->text = fz_malloc(parser->ctx, b - a + 1);\n\twhile (a < b)\n\t\t*s++ = *a++;\n\t*s = 0;\n\n\txml_emit_close_tag(parser);\n}\n\nstatic char *xml_parse_document_imp(struct parser *x, char *p)\n{\n\tchar *mark;\n\tint quote;\n\nparse_text:\n\tmark = p;\n\twhile (*p && *p != '<') ++p;\n\tif (mark != p) xml_emit_text(x, mark, p);\n\tif (*p == '<') { ++p; goto parse_element; }\n\treturn NULL;\n\nparse_element:\n\tif (*p == '/') { ++p; goto parse_closing_element; }\n\tif (*p == '!') { ++p; goto parse_comment; }\n\tif (*p == '?') { ++p; goto parse_processing_instruction; }\n\twhile (iswhite(*p)) ++p;\n\tif (isname(*p))\n\t\tgoto parse_element_name;\n\treturn \"syntax error in element\";\n\nparse_comment:\n\tif (*p == '[') goto parse_cdata;\n\tif (*p == 'D' && !memcmp(p, \"DOCTYPE\", 7)) goto parse_declaration;\n\tif (*p++ != '-') return \"syntax error in comment (<! not followed by --)\";\n\tif (*p++ != '-') return \"syntax error in comment (<!- not followed by -)\";\n\twhile (*p) {\n\t\tif (p[0] == '-' && p[1] == '-' && p[2] == '>') {\n\t\t\tp += 3;\n\t\t\tgoto parse_text;\n\t\t}\n\t\t++p;\n\t}\n\treturn \"end of data in comment\";\n\nparse_declaration:\n\twhile (*p) if (*p++ == '>') goto parse_text;\n\treturn \"end of data in declaration\";\n\nparse_cdata:\n\tif (p[1] != 'C' || p[2] != 'D' || p[3] != 'A' || p[4] != 'T' || p[5] != 'A' || p[6] != '[')\n\t\treturn \"syntax error in CDATA section\";\n\tp += 7;\n\tmark = p;\n\twhile (*p) {\n\t\tif (p[0] == ']' && p[1] == ']' && p[2] == '>') {\n\t\t\txml_emit_cdata(x, mark, p);\n\t\t\tp += 3;\n\t\t\tgoto parse_text;\n\t\t}\n\t\t++p;\n\t}\n\treturn \"end of data in CDATA section\";\n\nparse_processing_instruction:\n\twhile (*p) {\n\t\tif (p[0] == '?' && p[1] == '>') {\n\t\t\tp += 2;\n\t\t\tgoto parse_text;\n\t\t}\n\t\t++p;\n\t}\n\treturn \"end of data in processing instruction\";\n\nparse_closing_element:\n\twhile (iswhite(*p)) ++p;\n\twhile (isname(*p)) ++p;\n\twhile (iswhite(*p)) ++p;\n\tif (*p != '>')\n\t\treturn \"syntax error in closing element\";\n\txml_emit_close_tag(x);\n\t++p;\n\tgoto parse_text;\n\nparse_element_name:\n\tmark = p;\n\twhile (isname(*p)) ++p;\n\txml_emit_open_tag(x, mark, p);\n\tif (*p == '>') { ++p; goto parse_text; }\n\tif (p[0] == '/' && p[1] == '>') {\n\t\txml_emit_close_tag(x);\n\t\tp += 2;\n\t\tgoto parse_text;\n\t}\n\tif (iswhite(*p))\n\t\tgoto parse_attributes;\n\treturn \"syntax error after element name\";\n\nparse_attributes:\n\twhile (iswhite(*p)) ++p;\n\tif (isname(*p))\n\t\tgoto parse_attribute_name;\n\tif (*p == '>') { ++p; goto parse_text; }\n\tif (p[0] == '/' && p[1] == '>') {\n\t\txml_emit_close_tag(x);\n\t\tp += 2;\n\t\tgoto parse_text;\n\t}\n\treturn \"syntax error in attributes\";\n\nparse_attribute_name:\n\tmark = p;\n\twhile (isname(*p)) ++p;\n\txml_emit_att_name(x, mark, p);\n\twhile (iswhite(*p)) ++p;\n\tif (*p == '=') { ++p; goto parse_attribute_value; }\n\treturn \"syntax error after attribute name\";\n\nparse_attribute_value:\n\twhile (iswhite(*p)) ++p;\n\tquote = *p++;\n\tif (quote != '\"' && quote != '\\'')\n\t\treturn \"missing quote character\";\n\tmark = p;\n\twhile (*p && *p != quote) ++p;\n\tif (*p == quote) {\n\t\txml_emit_att_value(x, mark, p++);\n\t\tgoto parse_attributes;\n\t}\n\treturn \"end of data in attribute value\";\n}\n\nstatic char *convert_to_utf8(fz_context *doc, unsigned char *s, int n, int *dofree)\n{\n\tunsigned char *e = s + n;\n\tchar *dst, *d;\n\tint c;\n\n\tif (s[0] == 0xFE && s[1] == 0xFF) {\n\t\ts += 2;\n\t\tdst = d = fz_malloc(doc, n * 2);\n\t\twhile (s + 1 < e) {\n\t\t\tc = s[0] << 8 | s[1];\n\t\t\td += fz_runetochar(d, c);\n\t\t\ts += 2;\n\t\t}\n\t\t*d = 0;\n\t\t*dofree = 1;\n\t\treturn dst;\n\t}\n\n\tif (s[0] == 0xFF && s[1] == 0xFE) {\n\t\ts += 2;\n\t\tdst = d = fz_malloc(doc, n * 2);\n\t\twhile (s + 1 < e) {\n\t\t\tc = s[0] | s[1] << 8;\n\t\t\td += fz_runetochar(d, c);\n\t\t\ts += 2;\n\t\t}\n\t\t*d = 0;\n\t\t*dofree = 1;\n\t\treturn dst;\n\t}\n\n\t*dofree = 0;\n\n\tif (s[0] == 0xEF && s[1] == 0xBB && s[2] == 0xBF)\n\t\treturn (char*)s+3;\n\n\treturn (char*)s;\n}\n\nfz_xml *\nfz_parse_xml(fz_context *ctx, unsigned char *s, int n, int preserve_white)\n{\n\tstruct parser parser;\n\tfz_xml root, *node;\n\tchar *p, *error;\n\tint dofree;\n\n\t/* s is already null-terminated (see xps_new_part) */\n\n\tmemset(&root, 0, sizeof(root));\n\tparser.head = &root;\n\tparser.ctx = ctx;\n\tparser.preserve_white = preserve_white;\n\tparser.depth = 0;\n\n\tp = convert_to_utf8(ctx, s, n, &dofree);\n\n\tfz_try(ctx)\n\t{\n\t\terror = xml_parse_document_imp(&parser, p);\n\t\tif (error)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"%s\", error);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tif (dofree)\n\t\t\tfz_free(ctx, p);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free_xml(ctx, root.down);\n\t\tfz_rethrow(ctx);\n\t}\n\n\tfor (node = root.down; node; node = node->next)\n\t\tnode->up = NULL;\n\treturn root.down;\n}\n"
  },
  {
    "path": "mupdf/source/img/muimage.c",
    "content": "#include \"mupdf/img.h\"\n\n#include <ctype.h> /* for tolower */\n\n#define DPI 72.0f\n\nstatic void image_init_document(image_document *doc);\n\nstruct image_document_s\n{\n\tfz_document super;\n\n\tfz_context *ctx;\n\tfz_stream *file;\n\tfz_image *image;\n};\n\nimage_document *\nimage_open_document_with_stream(fz_context *ctx, fz_stream *file)\n{\n\timage_document *doc;\n\tfz_buffer *buffer = NULL;\n\n\tdoc = fz_malloc_struct(ctx, image_document);\n\timage_init_document(doc);\n\tdoc->ctx = ctx;\n\tdoc->file = fz_keep_stream(file);\n\n\tfz_var(buffer);\n\n\tfz_try(ctx)\n\t{\n\t\tbuffer = fz_read_all(doc->file, 1024);\n\t\tdoc->image = fz_new_image_from_buffer(ctx, buffer);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, buffer);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\timage_close_document(doc);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn doc;\n}\n\nimage_document *\nimage_open_document(fz_context *ctx, const char *filename)\n{\n\tfz_stream *file;\n\timage_document *doc;\n\n\tfile = fz_open_file(ctx, filename);\n\tif (!file)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot open file '%s': %s\", filename, strerror(errno));\n\n\tfz_try(ctx)\n\t{\n\t\tdoc = image_open_document_with_stream(ctx, file);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(file);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn doc;\n}\n\nvoid\nimage_close_document(image_document *doc)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_drop_image(ctx, doc->image);\n\tfz_close(doc->file);\n\tfz_free(ctx, doc);\n}\n\nint\nimage_count_pages(image_document *doc)\n{\n\treturn 1;\n}\n\nimage_page *\nimage_load_page(image_document *doc, int number)\n{\n\tif (number != 0)\n\t\treturn NULL;\n\n\treturn (image_page *)doc->image;\n}\n\nvoid\nimage_free_page(image_document *doc, image_page *page)\n{\n}\n\nfz_rect *\nimage_bound_page(image_document *doc, image_page *page, fz_rect *bbox)\n{\n\tfz_image *image = (fz_image *)page;\n\tbbox->x0 = bbox->y0 = 0;\n\tbbox->x1 = image->w * DPI / image->xres;\n\tbbox->y1 = image->h * DPI / image->yres;\n\treturn bbox;\n}\n\nvoid\nimage_run_page(image_document *doc, image_page *page, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie)\n{\n\tfz_matrix local_ctm = *ctm;\n\tfz_image *image = (fz_image *)page;\n\tfloat w = image->w * DPI / image->xres;\n\tfloat h = image->h * DPI / image->yres;\n\tfz_pre_scale(&local_ctm, w, h);\n\tfz_fill_image(dev, image, &local_ctm, 1);\n}\n\nstatic int\nimage_meta(image_document *doc, int key, void *ptr, int size)\n{\n\tswitch(key)\n\t{\n\tcase FZ_META_FORMAT_INFO:\n\t\tsprintf((char *)ptr, \"IMAGE\");\n\t\treturn FZ_META_OK;\n\tdefault:\n\t\treturn FZ_META_UNKNOWN_KEY;\n\t}\n}\n\nstatic void\nimage_rebind(image_document *doc, fz_context *ctx)\n{\n\tdoc->ctx = ctx;\n\tfz_rebind_stream(doc->file, ctx);\n}\n\nstatic void\nimage_init_document(image_document *doc)\n{\n\tdoc->super.close = (fz_document_close_fn *)image_close_document;\n\tdoc->super.count_pages = (fz_document_count_pages_fn *)image_count_pages;\n\tdoc->super.load_page = (fz_document_load_page_fn *)image_load_page;\n\tdoc->super.bound_page = (fz_document_bound_page_fn *)image_bound_page;\n\tdoc->super.run_page_contents = (fz_document_run_page_contents_fn *)image_run_page;\n\tdoc->super.free_page = (fz_document_free_page_fn *)image_free_page;\n\tdoc->super.meta = (fz_document_meta_fn *)image_meta;\n\tdoc->super.rebind = (fz_document_rebind_fn *)image_rebind;\n}\n\nstatic int\nimage_recognize(fz_context *doc, const char *magic)\n{\n\tchar *ext = strrchr(magic, '.');\n\n\tif (ext)\n\t{\n\t\tif (!fz_strcasecmp(ext, \".png\") || !fz_strcasecmp(ext, \".jpg\") ||\n\t\t\t!fz_strcasecmp(ext, \".jpeg\") || !fz_strcasecmp(ext, \".jfif\") ||\n\t\t\t!fz_strcasecmp(ext, \".jfif-tbnl\") || !fz_strcasecmp(ext, \".jpe\"))\n\t\t\treturn 100;\n\t}\n\tif (!strcmp(magic, \"png\") || !strcmp(magic, \"image/png\") ||\n\t\t!strcmp(magic, \"jpg\") || !strcmp(magic, \"image/jpeg\") ||\n\t\t!strcmp(magic, \"jpeg\") || !strcmp(magic, \"image/pjpeg\") ||\n\t\t!strcmp(magic, \"jpe\") || !strcmp(magic, \"jfif\"))\n\t\treturn 100;\n\n\treturn 0;\n}\n\nfz_document_handler img_document_handler =\n{\n\t(fz_document_recognize_fn *)&image_recognize,\n\t(fz_document_open_fn *)&image_open_document,\n\t(fz_document_open_with_stream_fn *)&image_open_document_with_stream\n};\n"
  },
  {
    "path": "mupdf/source/pdf/js/pdf-js-none.c",
    "content": "#include \"mupdf/pdf.h\"\n\nvoid pdf_enable_js(pdf_document *doc)\n{\n}\n\nvoid pdf_disable_js(pdf_document *doc)\n{\n}\n\nint pdf_js_supported(pdf_document *doc)\n{\n\treturn 0;\n}\n\nvoid pdf_js_setup_event(pdf_js *js, pdf_js_event *e)\n{\n}\n\npdf_js_event *pdf_js_get_event(pdf_js *js)\n{\n\treturn NULL;\n}\n\nvoid pdf_js_execute(pdf_js *js, char *code)\n{\n}\n\nvoid pdf_js_execute_count(pdf_js *js, char *code, int count)\n{\n}\n"
  },
  {
    "path": "mupdf/source/pdf/js/pdf-js.c",
    "content": "#include \"mupdf/pdf.h\"\n\nstruct pdf_js_s\n{\n\tpdf_document *doc;\n\tpdf_obj *form;\n\tpdf_js_event event;\n\tpdf_jsimp *imp;\n\tpdf_jsimp_type *doctype;\n\tpdf_jsimp_type *eventtype;\n\tpdf_jsimp_type *fieldtype;\n\tpdf_jsimp_type *apptype;\n};\n\nstatic pdf_jsimp_obj *app_alert(void *jsctx, void *obj, int argc, pdf_jsimp_obj *args[])\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\tfz_context *ctx = js->doc->ctx;\n\tpdf_jsimp_obj *cMsg_obj = NULL;\n\tpdf_jsimp_obj *nIcon_obj = NULL;\n\tpdf_jsimp_obj *nType_obj = NULL;\n\tpdf_jsimp_obj *cTitle_obj = NULL;\n\tpdf_jsimp_obj *nButton_obj = NULL;\n\tpdf_alert_event event;\n\tint arg_is_obj = 0;\n\n\tif (argc < 1 || argc > 6)\n\t\treturn NULL;\n\n\tevent.message = \"\";\n\tevent.icon_type = PDF_ALERT_ICON_ERROR;\n\tevent.button_group_type = PDF_ALERT_BUTTON_GROUP_OK;\n\tevent.title = \"MuPDF\";\n\tevent.check_box_message = NULL;\n\tevent.button_pressed = 0;\n\n\tfz_var(cMsg_obj);\n\tfz_var(nIcon_obj);\n\tfz_var(nType_obj);\n\tfz_var(cTitle_obj);\n\tfz_try(ctx)\n\t{\n\t\targ_is_obj = (argc == 1 && pdf_jsimp_to_type(js->imp, args[0]) != JS_TYPE_STRING);\n\t\tif (arg_is_obj)\n\t\t{\n\t\t\tcMsg_obj = pdf_jsimp_property(js->imp, args[0], \"cMsg\");\n\t\t\tnIcon_obj = pdf_jsimp_property(js->imp, args[0], \"nIcon\");\n\t\t\tnType_obj = pdf_jsimp_property(js->imp, args[0], \"nType\");\n\t\t\tcTitle_obj = pdf_jsimp_property(js->imp, args[0], \"cTitle\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tswitch (argc)\n\t\t\t{\n\t\t\tcase 6:\n\t\t\tcase 5:\n\t\t\tcase 4:\n\t\t\t\tcTitle_obj = args[3];\n\t\t\tcase 3:\n\t\t\t\tnType_obj = args[2];\n\t\t\tcase 2:\n\t\t\t\tnIcon_obj = args[1];\n\t\t\tcase 1:\n\t\t\t\tcMsg_obj = args[0];\n\t\t\t}\n\t\t}\n\n\t\tif (cMsg_obj)\n\t\t\tevent.message = pdf_jsimp_to_string(js->imp, cMsg_obj);\n\n\t\tif (nIcon_obj)\n\t\t\tevent.icon_type = (int)pdf_jsimp_to_number(js->imp, nIcon_obj);\n\n\t\tif (nType_obj)\n\t\t\tevent.button_group_type = (int)pdf_jsimp_to_number(js->imp, nType_obj);\n\n\t\tif (cTitle_obj)\n\t\t\tevent.title = pdf_jsimp_to_string(js->imp, cTitle_obj);\n\n\t\tpdf_event_issue_alert(js->doc, &event);\n\t\tnButton_obj = pdf_jsimp_from_number(js->imp, (double)event.button_pressed);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tif (arg_is_obj)\n\t\t{\n\t\t\tpdf_jsimp_drop_obj(js->imp, cMsg_obj);\n\t\t\tpdf_jsimp_drop_obj(js->imp, nIcon_obj);\n\t\t\tpdf_jsimp_drop_obj(js->imp, nType_obj);\n\t\t\tpdf_jsimp_drop_obj(js->imp, cTitle_obj);\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn nButton_obj;\n}\n\nstatic pdf_jsimp_obj *app_execDialog(void *jsctx, void *obj, int argc, pdf_jsimp_obj *args[])\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\n\tpdf_event_issue_exec_dialog(js->doc);\n\n\treturn NULL;\n}\n\nstatic pdf_jsimp_obj *app_execMenuItem(void *jsctx, void *obj, int argc, pdf_jsimp_obj *args[])\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\n\tif (argc == 1)\n\t\tpdf_event_issue_exec_menu_item(js->doc, pdf_jsimp_to_string(js->imp, args[0]));\n\n\treturn NULL;\n}\n\nstatic pdf_jsimp_obj *app_launchURL(void *jsctx, void *obj, int argc, pdf_jsimp_obj *args[])\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\tchar *cUrl;\n\tint bNewFrame = 0;\n\n\tswitch (argc)\n\t{\n\tdefault:\n\t\treturn NULL;\n\tcase 2:\n\t\tbNewFrame = (int)pdf_jsimp_to_number(js->imp, args[1]);\n\tcase 1:\n\t\tcUrl = pdf_jsimp_to_string(js->imp, args[0]);\n\t}\n\n\tpdf_event_issue_launch_url(js->doc, cUrl, bNewFrame);\n\n\treturn NULL;\n}\n\nstatic pdf_obj *load_color(pdf_document *doc, pdf_jsimp *imp, pdf_jsimp_obj *val)\n{\n\tpdf_obj *col = NULL;\n\tpdf_obj *comp = NULL;\n\tpdf_jsimp_obj *jscomp = NULL;\n\tint i;\n\tint n;\n\tfz_context *ctx = doc->ctx;\n\n\tn = pdf_jsimp_array_len(imp, val);\n\n\t/* The only legitimate color expressed as an array of length 1\n\t * is [T], meaning transparent. Return a NULL object to represent\n\t * transparent */\n\tif (n <= 1)\n\t\treturn NULL;\n\n\tcol = pdf_new_array(doc, n-1);\n\n\tfz_var(comp);\n\tfz_var(jscomp);\n\tfz_try(ctx)\n\t{\n\t\tfor (i = 0; i < n-1; i++)\n\t\t{\n\t\t\tjscomp = pdf_jsimp_array_item(imp, val, i+1);\n\t\t\tcomp = pdf_new_real(doc, pdf_jsimp_to_number(imp, jscomp));\n\t\t\tpdf_array_push(col, comp);\n\t\t\tpdf_jsimp_drop_obj(imp, jscomp);\n\t\t\tjscomp = NULL;\n\t\t\tpdf_drop_obj(comp);\n\t\t\tcomp = NULL;\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_jsimp_drop_obj(imp, jscomp);\n\t\tpdf_drop_obj(comp);\n\t\tpdf_drop_obj(col);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn col;\n}\n\nstatic pdf_jsimp_obj *field_buttonSetCaption(void *jsctx, void *obj, int argc, pdf_jsimp_obj *args[])\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\tpdf_obj *field = (pdf_obj *)obj;\n\tchar *name;\n\n\tif (argc != 1)\n\t\treturn NULL;\n\n\tname = pdf_jsimp_to_string(js->imp, args[0]);\n\tpdf_field_set_button_caption(js->doc, field, name);\n\n\treturn NULL;\n}\n\nstatic pdf_jsimp_obj *field_getName(void *jsctx, void *obj)\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\tfz_context *ctx = js->doc->ctx;\n\tpdf_obj *field = (pdf_obj *)obj;\n\tchar *name;\n\tpdf_jsimp_obj *oname = NULL;\n\n\tif (field == NULL)\n\t\treturn NULL;\n\n\tname = pdf_field_name(js->doc, field);\n\tfz_try(ctx)\n\t{\n\t\toname = pdf_jsimp_from_string(js->imp, name);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_free(ctx, name);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn oname;\n}\n\nstatic void field_setName(void *jsctx, void *obj, pdf_jsimp_obj *val)\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\tfz_warn(js->doc->ctx, \"Unexpected call to field_setName\");\n}\n\nstatic pdf_jsimp_obj *field_getDisplay(void *jsctx, void *obj)\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\tpdf_obj *field = (pdf_obj *)obj;\n\n\treturn field ? pdf_jsimp_from_number(js->imp, (double)pdf_field_display(js->doc, field)) : NULL;\n}\n\nstatic void field_setDisplay(void *jsctx, void *obj, pdf_jsimp_obj *val)\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\tpdf_obj *field = (pdf_obj *)obj;\n\tif (field)\n\t\tpdf_field_set_display(js->doc, field, (int)pdf_jsimp_to_number(js->imp, val));\n}\n\nstatic pdf_jsimp_obj *field_getFillColor(void *jsctx, void *obj)\n{\n\treturn NULL;\n}\n\nstatic void field_setFillColor(void *jsctx, void *obj, pdf_jsimp_obj *val)\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\tfz_context *ctx = js->doc->ctx;\n\tpdf_obj *field = (pdf_obj *)obj;\n\tpdf_obj *col;\n\n\tif (!field)\n\t\treturn;\n\n\tcol = load_color(js->doc, js->imp, val);\n\tfz_try(ctx)\n\t{\n\t\tpdf_field_set_fill_color(js->doc, field, col);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(col);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic pdf_jsimp_obj *field_getTextColor(void *jsctx, void *obj)\n{\n\treturn NULL;\n}\n\nstatic void field_setTextColor(void *jsctx, void *obj, pdf_jsimp_obj *val)\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\tfz_context *ctx = js->doc->ctx;\n\tpdf_obj *field = (pdf_obj *)obj;\n\tpdf_obj *col;\n\n\tif (!field)\n\t\treturn;\n\n\tcol = load_color(js->doc, js->imp, val);\n\tfz_try(ctx)\n\t{\n\t\tpdf_field_set_text_color(js->doc, field, col);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(col);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic pdf_jsimp_obj *field_getBorderStyle(void *jsctx, void *obj)\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\tpdf_obj *field = (pdf_obj *)obj;\n\n\treturn field ? pdf_jsimp_from_string(js->imp, pdf_field_border_style(js->doc, field)) : NULL;\n}\n\nstatic void field_setBorderStyle(void *jsctx, void *obj, pdf_jsimp_obj *val)\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\tpdf_obj *field = (pdf_obj *)obj;\n\n\tif (field)\n\t\tpdf_field_set_border_style(js->doc, field, pdf_jsimp_to_string(js->imp, val));\n}\n\nstatic pdf_jsimp_obj *field_getValue(void *jsctx, void *obj)\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\tpdf_obj *field = (pdf_obj *)obj;\n\tchar *fval;\n\n\tif (!field)\n\t\treturn NULL;\n\n\tfval = pdf_field_value(js->doc, field);\n\treturn pdf_jsimp_from_string(js->imp, fval?fval:\"\");\n}\n\nstatic void field_setValue(void *jsctx, void *obj, pdf_jsimp_obj *val)\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\tpdf_obj *field = (pdf_obj *)obj;\n\n\tif (field)\n\t\t(void)pdf_field_set_value(js->doc, field, pdf_jsimp_to_string(js->imp, val));\n}\n\nstatic pdf_jsimp_obj *event_getTarget(void *jsctx, void *obj)\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\n\treturn pdf_jsimp_new_obj(js->imp, js->fieldtype, js->event.target);\n}\n\nstatic void event_setTarget(void *jsctx, void *obj, pdf_jsimp_obj *val)\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\tfz_warn(js->doc->ctx, \"Unexpected call to event_setTarget\");\n}\n\nstatic pdf_jsimp_obj *event_getValue(void *jsctx, void *obj)\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\tchar *v = js->event.value;\n\n\treturn pdf_jsimp_from_string(js->imp, v?v:\"\");\n}\n\nstatic void event_setValue(void *jsctx, void *obj, pdf_jsimp_obj *val)\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\tfz_context *ctx = js->doc->ctx;\n\tfz_free(ctx, js->event.value);\n\tjs->event.value = NULL;\n\tjs->event.value = fz_strdup(ctx, pdf_jsimp_to_string(js->imp, val));\n}\n\nstatic pdf_jsimp_obj *event_getWillCommit(void *jsctx, void *obj)\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\n\treturn pdf_jsimp_from_number(js->imp, 1.0);\n}\n\nstatic void event_setWillCommit(void *jsctx, void *obj, pdf_jsimp_obj *val)\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\tfz_warn(js->doc->ctx, \"Unexpected call to event_setWillCommit\");\n}\n\nstatic pdf_jsimp_obj *event_getRC(void *jsctx, void *obj)\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\n\treturn pdf_jsimp_from_number(js->imp, (double)js->event.rc);\n}\n\nstatic void event_setRC(void *jsctx, void *obj, pdf_jsimp_obj *val)\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\n\tjs->event.rc = (int)pdf_jsimp_to_number(js->imp, val);\n}\n\nstatic pdf_jsimp_obj *doc_getEvent(void *jsctx, void *obj)\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\n\treturn pdf_jsimp_new_obj(js->imp, js->eventtype, &js->event);\n}\n\nstatic void doc_setEvent(void *jsctx, void *obj, pdf_jsimp_obj *val)\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\tfz_warn(js->doc->ctx, \"Unexpected call to doc_setEvent\");\n}\n\nstatic pdf_jsimp_obj *doc_getApp(void *jsctx, void *obj)\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\n\treturn pdf_jsimp_new_obj(js->imp, js->apptype, NULL);\n}\n\nstatic void doc_setApp(void *jsctx, void *obj, pdf_jsimp_obj *val)\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\tfz_warn(js->doc->ctx, \"Unexpected call to doc_setApp\");\n}\n\nstatic char *utf8_to_pdf(fz_context *ctx, char *utf8)\n{\n\tchar *pdf = fz_malloc(ctx, strlen(utf8)+1);\n\tint i = 0;\n\tunsigned char c;\n\n\twhile ((c = *utf8) != 0)\n\t{\n\t\tif ((c & 0x80) == 0 && pdf_doc_encoding[c] == c)\n\t\t{\n\t\t\tpdf[i++] = c;\n\t\t\tutf8++ ;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tint rune;\n\t\t\tint j;\n\n\t\t\tutf8 += fz_chartorune(&rune, utf8);\n\n\t\t\tfor (j = 0; j < sizeof(pdf_doc_encoding) && pdf_doc_encoding[j] != rune; j++)\n\t\t\t\t;\n\n\t\t\tif (j < sizeof(pdf_doc_encoding))\n\t\t\t\tpdf[i++] = j;\n\t\t}\n\t}\n\n\tpdf[i] = 0;\n\n\treturn pdf;\n}\n\nstatic pdf_jsimp_obj *doc_getField(void *jsctx, void *obj, int argc, pdf_jsimp_obj *args[])\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\tfz_context *ctx = js->doc->ctx;\n\tpdf_obj *dict = NULL;\n\tchar *utf8;\n\tchar *name = NULL;\n\n\tif (argc != 1)\n\t\treturn NULL;\n\n\tfz_var(dict);\n\tfz_var(name);\n\tfz_try(ctx)\n\t{\n\t\tutf8 = pdf_jsimp_to_string(js->imp, args[0]);\n\n\t\tif (utf8)\n\t\t{\n\t\t\tname = utf8_to_pdf(ctx, utf8);\n\t\t\tdict = pdf_lookup_field(js->form, name);\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_free(ctx, name);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\tfz_warn(ctx, \"doc_getField failed: %s\", fz_caught_message(ctx));\n\t\tdict = NULL;\n\t}\n\n\treturn dict ? pdf_jsimp_new_obj(js->imp, js->fieldtype, dict) : NULL;\n}\n\nstatic void reset_field(pdf_js *js, pdf_jsimp_obj *item)\n{\n\tfz_context *ctx = js->doc->ctx;\n\tchar *name = NULL;\n\tchar *utf8 = pdf_jsimp_to_string(js->imp, item);\n\n\tif (utf8)\n\t{\n\t\tpdf_obj *field;\n\n\t\tfz_var(name);\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tname = utf8_to_pdf(ctx, utf8);\n\t\t\tfield = pdf_lookup_field(js->form, name);\n\t\t\tif (field)\n\t\t\t\tpdf_field_reset(js->doc, field);\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tfz_free(ctx, name);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t}\n}\n\nstatic pdf_jsimp_obj *doc_resetForm(void *jsctx, void *obj, int argc, pdf_jsimp_obj *args[])\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\tfz_context *ctx = js->doc->ctx;\n\tpdf_jsimp_obj *arr = NULL;\n\tpdf_jsimp_obj *elem = NULL;\n\n\tswitch (argc)\n\t{\n\tcase 0:\n\t\tbreak;\n\tcase 1:\n\t\tswitch (pdf_jsimp_to_type(js->imp, args[0]))\n\t\t{\n\t\tcase JS_TYPE_NULL:\n\t\t\tbreak;\n\t\tcase JS_TYPE_ARRAY:\n\t\t\tarr = args[0];\n\t\t\tbreak;\n\t\tcase JS_TYPE_STRING:\n\t\t\telem = args[0];\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn NULL;\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\treturn NULL;\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tif(arr)\n\t\t{\n\t\t\t/* An array of fields has been passed in. Call\n\t\t\t * pdf_reset_field on each */\n\t\t\tint i, n = pdf_jsimp_array_len(js->imp, arr);\n\n\t\t\tfor (i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\tpdf_jsimp_obj *item = pdf_jsimp_array_item(js->imp, arr, i);\n\n\t\t\t\tif (item)\n\t\t\t\t\treset_field(js, item);\n\n\t\t\t}\n\t\t}\n\t\telse if (elem)\n\t\t{\n\t\t\treset_field(js, elem);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* No argument or null passed in means reset all. */\n\t\t\tint i, n = pdf_array_len(js->form);\n\n\t\t\tfor (i = 0; i < n; i++)\n\t\t\t\tpdf_field_reset(js->doc, pdf_array_get(js->form, i));\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_warn(ctx, \"doc_resetForm failed: %s\", fz_caught_message(ctx));\n\t}\n\n\treturn NULL;\n}\n\nstatic pdf_jsimp_obj *doc_print(void *jsctx, void *obj, int argc, pdf_jsimp_obj *args[])\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\n\tpdf_event_issue_print(js->doc);\n\n\treturn NULL;\n}\n\nstatic pdf_jsimp_obj *doc_mailDoc(void *jsctx, void *obj, int argc, pdf_jsimp_obj *args[])\n{\n\tpdf_js *js = (pdf_js *)jsctx;\n\tfz_context *ctx = js->doc->ctx;\n\tpdf_jsimp_obj *bUI_obj = NULL;\n\tpdf_jsimp_obj *cTo_obj = NULL;\n\tpdf_jsimp_obj *cCc_obj = NULL;\n\tpdf_jsimp_obj *cBcc_obj = NULL;\n\tpdf_jsimp_obj *cSubject_obj = NULL;\n\tpdf_jsimp_obj *cMessage_obj = NULL;\n\tpdf_mail_doc_event event;\n\tint arg_is_obj = 0;\n\n\tif (argc < 1 || argc > 6)\n\t\treturn NULL;\n\n\tevent.ask_user = 1;\n\tevent.to = \"\";\n\tevent.cc = \"\";\n\tevent.bcc = \"\";\n\tevent.subject = \"\";\n\tevent.message = \"\";\n\n\tfz_var(bUI_obj);\n\tfz_var(cTo_obj);\n\tfz_var(cCc_obj);\n\tfz_var(cBcc_obj);\n\tfz_var(cSubject_obj);\n\tfz_var(cMessage_obj);\n\tfz_try(ctx)\n\t{\n\t\targ_is_obj = (argc == 1 && pdf_jsimp_to_type(js->imp, args[0]) != JS_TYPE_BOOLEAN);\n\t\tif (arg_is_obj)\n\t\t{\n\t\t\tbUI_obj = pdf_jsimp_property(js->imp, args[0], \"bUI\");\n\t\t\tcTo_obj = pdf_jsimp_property(js->imp, args[0], \"cTo\");\n\t\t\tcCc_obj = pdf_jsimp_property(js->imp, args[0], \"cCc\");\n\t\t\tcBcc_obj = pdf_jsimp_property(js->imp, args[0], \"cBcc\");\n\t\t\tcSubject_obj = pdf_jsimp_property(js->imp, args[0], \"cSubject\");\n\t\t\tcMessage_obj = pdf_jsimp_property(js->imp, args[0], \"cMessage\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tswitch (argc)\n\t\t\t{\n\t\t\tcase 6:\n\t\t\t\tcMessage_obj = args[5];\n\t\t\tcase 5:\n\t\t\t\tcSubject_obj = args[4];\n\t\t\tcase 4:\n\t\t\t\tcBcc_obj = args[3];\n\t\t\tcase 3:\n\t\t\t\tcCc_obj = args[2];\n\t\t\tcase 2:\n\t\t\t\tcTo_obj = args[1];\n\t\t\tcase 1:\n\t\t\t\tbUI_obj = args[0];\n\t\t\t}\n\t\t}\n\n\t\tif (bUI_obj)\n\t\t\tevent.ask_user = (int)pdf_jsimp_to_number(js->imp, bUI_obj);\n\n\t\tif (cTo_obj)\n\t\t\tevent.to = pdf_jsimp_to_string(js->imp, cTo_obj);\n\n\t\tif (cCc_obj)\n\t\t\tevent.cc = pdf_jsimp_to_string(js->imp, cCc_obj);\n\n\t\tif (cBcc_obj)\n\t\t\tevent.bcc = pdf_jsimp_to_string(js->imp, cBcc_obj);\n\n\t\tif (cSubject_obj)\n\t\t\tevent.subject = pdf_jsimp_to_string(js->imp, cSubject_obj);\n\n\t\tif (cMessage_obj)\n\t\t\tevent.message = pdf_jsimp_to_string(js->imp, cMessage_obj);\n\n\t\tpdf_event_issue_mail_doc(js->doc, &event);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tif (arg_is_obj)\n\t\t{\n\t\t\tpdf_jsimp_drop_obj(js->imp, bUI_obj);\n\t\t\tpdf_jsimp_drop_obj(js->imp, cTo_obj);\n\t\t\tpdf_jsimp_drop_obj(js->imp, cCc_obj);\n\t\t\tpdf_jsimp_drop_obj(js->imp, cBcc_obj);\n\t\t\tpdf_jsimp_drop_obj(js->imp, cSubject_obj);\n\t\t\tpdf_jsimp_drop_obj(js->imp, cMessage_obj);\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn NULL;\n}\n\nstatic void declare_dom(pdf_js *js)\n{\n\tpdf_jsimp *imp = js->imp;\n\n\t/* Create the document type */\n\tjs->doctype = pdf_jsimp_new_type(imp, NULL, \"Document\");\n\tpdf_jsimp_addmethod(imp, js->doctype, \"getField\", doc_getField);\n\tpdf_jsimp_addmethod(imp, js->doctype, \"resetForm\", doc_resetForm);\n\tpdf_jsimp_addmethod(imp, js->doctype, \"print\", doc_print);\n\tpdf_jsimp_addmethod(imp, js->doctype, \"mailDoc\", doc_mailDoc);\n\tpdf_jsimp_addproperty(imp, js->doctype, \"event\", doc_getEvent, doc_setEvent);\n\tpdf_jsimp_addproperty(imp, js->doctype, \"app\", doc_getApp, doc_setApp);\n\n\t/* Create the event type */\n\tjs->eventtype = pdf_jsimp_new_type(imp, NULL, \"Event\");\n\tpdf_jsimp_addproperty(imp, js->eventtype, \"target\", event_getTarget, event_setTarget);\n\tpdf_jsimp_addproperty(imp, js->eventtype, \"value\", event_getValue, event_setValue);\n\tpdf_jsimp_addproperty(imp, js->eventtype, \"willCommit\", event_getWillCommit, event_setWillCommit);\n\tpdf_jsimp_addproperty(imp, js->eventtype, \"rc\", event_getRC, event_setRC);\n\n\t/* Create the field type */\n\tjs->fieldtype = pdf_jsimp_new_type(imp, NULL, \"Field\");\n\tpdf_jsimp_addproperty(imp, js->fieldtype, \"value\", field_getValue, field_setValue);\n\tpdf_jsimp_addproperty(imp, js->fieldtype, \"borderStyle\", field_getBorderStyle, field_setBorderStyle);\n\tpdf_jsimp_addproperty(imp, js->fieldtype, \"textColor\", field_getTextColor, field_setTextColor);\n\tpdf_jsimp_addproperty(imp, js->fieldtype, \"fillColor\", field_getFillColor, field_setFillColor);\n\tpdf_jsimp_addproperty(imp, js->fieldtype, \"display\", field_getDisplay, field_setDisplay);\n\tpdf_jsimp_addproperty(imp, js->fieldtype, \"name\", field_getName, field_setName);\n\tpdf_jsimp_addmethod(imp, js->fieldtype, \"buttonSetCaption\", field_buttonSetCaption);\n\n\t/* Create the app type */\n\tjs->apptype = pdf_jsimp_new_type(imp, NULL, \"Application\");\n\tpdf_jsimp_addmethod(imp, js->apptype, \"alert\", app_alert);\n\tpdf_jsimp_addmethod(imp, js->apptype, \"execDialog\", app_execDialog);\n\tpdf_jsimp_addmethod(imp, js->apptype, \"execMenuItem\", app_execMenuItem);\n\tpdf_jsimp_addmethod(imp, js->apptype, \"launchURL\", app_launchURL);\n\n\t/* Create the document object and tell the engine to use */\n\tpdf_jsimp_set_global_type(js->imp, js->doctype);\n}\n\nstatic void preload_helpers(pdf_js *js)\n{\n\t/* When testing on the cluster:\n\t * Use a fixed date for \"new Date\" and Date.now().\n\t * Sadly, this breaks uses of the Date function without the new keyword.\n\t * Return a fixed number from Math.random().\n\t */\n#ifdef CLUSTER\n\tpdf_jsimp_execute(js->imp,\n\"var MuPDFOldDate = Date\\n\"\n\"Date = function() { return new MuPDFOldDate(298252800000); }\\n\"\n\"Date.now = function() { return 298252800000; }\\n\"\n\"Date.UTC = function() { return 298252800000; }\\n\"\n\"Date.parse = MuPDFOldDate.parse;\\n\"\n\"Math.random = function() { return 1/4; }\\n\"\n\t);\n#endif\n\n\tpdf_jsimp_execute(js->imp,\n#include \"gen_js_util.h\"\n\t);\n}\n\nstatic void pdf_drop_js(pdf_js *js)\n{\n\tif (js)\n\t{\n\t\tfz_context *ctx = js->doc->ctx;\n\t\tfz_free(ctx, js->event.value);\n\t\tpdf_jsimp_drop_type(js->imp, js->apptype);\n\t\tpdf_jsimp_drop_type(js->imp, js->eventtype);\n\t\tpdf_jsimp_drop_type(js->imp, js->fieldtype);\n\t\tpdf_jsimp_drop_type(js->imp, js->doctype);\n\t\tpdf_drop_jsimp(js->imp);\n\t\tfz_free(ctx, js);\n\t}\n}\n\nstatic pdf_js *pdf_new_js(pdf_document *doc)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_js *js = NULL;\n\n\tfz_var(js);\n\tfz_try(ctx)\n\t{\n\t\tpdf_obj *root, *acroform;\n\n\t\tjs = fz_malloc_struct(ctx, pdf_js);\n\t\tjs->doc = doc;\n\n\t\t/* Find the form array */\n\t\troot = pdf_dict_gets(pdf_trailer(doc), \"Root\");\n\t\tacroform = pdf_dict_gets(root, \"AcroForm\");\n\t\tjs->form = pdf_dict_gets(acroform, \"Fields\");\n\n\t\t/* Initialise the javascript engine, passing the main context\n\t\t * for use in memory allocation and exception handling. Also\n\t\t * pass our js context, for it to pass back to us. */\n\t\tjs->imp = pdf_new_jsimp(ctx, js);\n\t\tdeclare_dom(js);\n\n\t\tpreload_helpers(js);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_js(js);\n\t\tjs = NULL;\n\t}\n\n\treturn js;\n}\n\nstatic void pdf_js_load_document_level(pdf_js *js)\n{\n\tpdf_document *doc = js->doc;\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *javascript = NULL;\n\tchar *codebuf = NULL;\n\n\tfz_var(javascript);\n\tfz_var(codebuf);\n\tfz_try(ctx)\n\t{\n\t\tint len, i;\n\n\t\tjavascript = pdf_load_name_tree(doc, \"JavaScript\");\n\t\tlen = pdf_dict_len(javascript);\n\n\t\tfor (i = 0; i < len; i++)\n\t\t{\n\t\t\tpdf_obj *fragment = pdf_dict_get_val(javascript, i);\n\t\t\tpdf_obj *code = pdf_dict_gets(fragment, \"JS\");\n\n\t\t\tfz_var(codebuf);\n\t\t\tfz_try(ctx)\n\t\t\t{\n\t\t\t\tcodebuf = pdf_to_utf8(doc, code);\n\t\t\t\tpdf_jsimp_execute(js->imp, codebuf);\n\t\t\t}\n\t\t\tfz_always(ctx)\n\t\t\t{\n\t\t\t\tfz_free(ctx, codebuf);\n\t\t\t\tcodebuf = NULL;\n\t\t\t}\n\t\t\tfz_catch(ctx)\n\t\t\t{\n\t\t\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\t\t\tfz_warn(ctx, \"Warning: %s\", fz_caught_message(ctx));\n\t\t\t}\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(javascript);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nvoid pdf_js_setup_event(pdf_js *js, pdf_js_event *e)\n{\n\tif (js)\n\t{\n\t\tfz_context *ctx = js->doc->ctx;\n\t\tchar *ev = e->value ? e->value : \"\";\n\t\tchar *v = fz_strdup(ctx, ev);\n\n\t\tfz_free(ctx, js->event.value);\n\t\tjs->event.value = v;\n\n\t\tjs->event.target = e->target;\n\t\tjs->event.rc = 1;\n\t}\n}\n\npdf_js_event *pdf_js_get_event(pdf_js *js)\n{\n\treturn js ? &js->event : NULL;\n}\n\nvoid pdf_js_execute(pdf_js *js, char *code)\n{\n\tif (js)\n\t{\n\t\tfz_context *ctx = js->doc->ctx;\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tpdf_jsimp_execute(js->imp, code);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t}\n\t}\n}\n\nvoid pdf_js_execute_count(pdf_js *js, char *code, int count)\n{\n\tif (js)\n\t{\n\t\tfz_context *ctx = js->doc->ctx;\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tpdf_jsimp_execute_count(js->imp, code, count);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t}\n\t}\n}\n\nvoid pdf_enable_js(pdf_document *doc)\n{\n\tif (!doc->js) {\n\t\tdoc->js = pdf_new_js(doc);\n\t\tdoc->drop_js = pdf_drop_js;\n\t\tpdf_js_load_document_level(doc->js);\n\t}\n}\n\nvoid pdf_disable_js(pdf_document *doc)\n{\n\tif (doc->js)\n\t\tdoc->drop_js(doc->js);\n\tdoc->js = NULL;\n}\n\nint pdf_js_supported(pdf_document *doc)\n{\n\treturn doc->js != NULL;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/js/pdf-jsimp-cpp.c",
    "content": "/* This file contains wrapper functions for pdf_jsimp functions implemented\n * in C++, from which calls to fz_throw aren't safe. The C++ versions\n * return errors explicitly, and these wrappers then throw them. */\n\n#include \"mupdf/pdf.h\"\n#include \"pdf-jsimp-cpp.h\"\n\npdf_jsimp *pdf_new_jsimp(fz_context *ctx, void *jsctx)\n{\n\tpdf_jsimp *jsi = NULL;\n\tconst char *err = pdf_new_jsimp_cpp(ctx, jsctx, &jsi);\n\tif (err != NULL)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"%s\", err);\n\n\treturn jsi;\n}\n\nvoid pdf_drop_jsimp(pdf_jsimp *imp)\n{\n\tif (imp)\n\t{\n\t\tfz_context *ctx = pdf_jsimp_ctx_cpp(imp);\n\t\tconst char *err = pdf_drop_jsimp_cpp(imp);\n\t\tif (err != NULL)\n\t\t\tfz_warn(ctx, \"%s\", err);\n\t}\n}\n\npdf_jsimp_type *pdf_jsimp_new_type(pdf_jsimp *imp, pdf_jsimp_dtr *dtr, char *name)\n{\n\tpdf_jsimp_type *type = NULL;\n\tconst char *err = pdf_jsimp_new_type_cpp(imp, dtr, &type);\n\tif (err != NULL)\n\t\tfz_throw(pdf_jsimp_ctx_cpp(imp), FZ_ERROR_GENERIC, \"%s\", err);\n\n\treturn type;\n}\n\nvoid pdf_jsimp_drop_type(pdf_jsimp *imp, pdf_jsimp_type *type)\n{\n\tconst char *err = pdf_jsimp_drop_type_cpp(imp, type);\n\tif (err != NULL)\n\t\tfz_warn(pdf_jsimp_ctx_cpp(imp), \"%s\", err);\n}\n\nvoid pdf_jsimp_addmethod(pdf_jsimp *imp, pdf_jsimp_type *type, char *name, pdf_jsimp_method *meth)\n{\n\tconst char *err = pdf_jsimp_addmethod_cpp(imp, type, name, meth);\n\tif (err != NULL)\n\t\tfz_throw(pdf_jsimp_ctx_cpp(imp), FZ_ERROR_GENERIC, \"%s\", err);\n}\n\nvoid pdf_jsimp_addproperty(pdf_jsimp *imp, pdf_jsimp_type *type, char *name, pdf_jsimp_getter *get, pdf_jsimp_setter *set)\n{\n\tconst char *err = pdf_jsimp_addproperty_cpp(imp, type, name, get, set);\n\tif (err != NULL)\n\t\tfz_throw(pdf_jsimp_ctx_cpp(imp), FZ_ERROR_GENERIC, \"%s\", err);\n}\n\nvoid pdf_jsimp_set_global_type(pdf_jsimp *imp, pdf_jsimp_type *type)\n{\n\tconst char *err = pdf_jsimp_set_global_type_cpp(imp, type);\n\tif (err != NULL)\n\t\tfz_throw(pdf_jsimp_ctx_cpp(imp), FZ_ERROR_GENERIC, \"%s\", err);\n}\n\npdf_jsimp_obj *pdf_jsimp_new_obj(pdf_jsimp *imp, pdf_jsimp_type *type, void *natobj)\n{\n\tpdf_jsimp_obj *obj = NULL;\n\tconst char *err = pdf_jsimp_new_obj_cpp(imp, type, natobj, &obj);\n\tif (err != NULL)\n\t\tfz_throw(pdf_jsimp_ctx_cpp(imp), FZ_ERROR_GENERIC, \"%s\", err);\n\n\treturn obj;\n}\n\nvoid pdf_jsimp_drop_obj(pdf_jsimp *imp, pdf_jsimp_obj *obj)\n{\n\tconst char *err = pdf_jsimp_drop_obj_cpp(imp, obj);\n\tif (err != NULL)\n\t\tfz_warn(pdf_jsimp_ctx_cpp(imp), \"%s\", err);\n}\n\nint pdf_jsimp_to_type(pdf_jsimp *imp, pdf_jsimp_obj *obj)\n{\n\tint type = 0;\n\tconst char *err = pdf_jsimp_to_type_cpp(imp, obj, &type);\n\tif (err != NULL)\n\t\tfz_throw(pdf_jsimp_ctx_cpp(imp), FZ_ERROR_GENERIC, \"%s\", err);\n\n\treturn type;\n}\n\npdf_jsimp_obj *pdf_jsimp_from_string(pdf_jsimp *imp, char *str)\n{\n\tpdf_jsimp_obj *obj = NULL;\n\tconst char *err = pdf_jsimp_from_string_cpp(imp, str, &obj);\n\tif (err != NULL)\n\t\tfz_throw(pdf_jsimp_ctx_cpp(imp), FZ_ERROR_GENERIC, \"%s\", err);\n\n\treturn obj;\n}\n\nchar *pdf_jsimp_to_string(pdf_jsimp *imp, pdf_jsimp_obj *obj)\n{\n\tchar *str = NULL;\n\tconst char *err = pdf_jsimp_to_string_cpp(imp, obj, &str);\n\tif (err != NULL)\n\t\tfz_throw(pdf_jsimp_ctx_cpp(imp), FZ_ERROR_GENERIC, \"%s\", err);\n\n\treturn str;\n}\n\npdf_jsimp_obj *pdf_jsimp_from_number(pdf_jsimp *imp, double num)\n{\n\tpdf_jsimp_obj *obj = NULL;\n\tconst char *err = pdf_jsimp_from_number_cpp(imp, num, &obj);\n\tif (err != NULL)\n\t\tfz_throw(pdf_jsimp_ctx_cpp(imp), FZ_ERROR_GENERIC, \"%s\", err);\n\n\treturn obj;\n}\n\ndouble pdf_jsimp_to_number(pdf_jsimp *imp, pdf_jsimp_obj *obj)\n{\n\tdouble num;\n\tconst char *err = pdf_jsimp_to_number_cpp(imp, obj, &num);\n\tif (err != NULL)\n\t\tfz_throw(pdf_jsimp_ctx_cpp(imp), FZ_ERROR_GENERIC, \"%s\", err);\n\n\treturn num;\n}\n\nint pdf_jsimp_array_len(pdf_jsimp *imp, pdf_jsimp_obj *obj)\n{\n\tint len = 0;\n\tconst char *err = pdf_jsimp_array_len_cpp(imp, obj, &len);\n\tif (err != NULL)\n\t\tfz_throw(pdf_jsimp_ctx_cpp(imp), FZ_ERROR_GENERIC, \"%s\", err);\n\n\treturn len;\n}\n\npdf_jsimp_obj *pdf_jsimp_array_item(pdf_jsimp *imp, pdf_jsimp_obj *obj, int i)\n{\n\tpdf_jsimp_obj *item = NULL;\n\tconst char *err = pdf_jsimp_array_item_cpp(imp, obj, i, &item);\n\tif (err != NULL)\n\t\tfz_throw(pdf_jsimp_ctx_cpp(imp), FZ_ERROR_GENERIC, \"%s\", err);\n\n\treturn item;\n}\n\npdf_jsimp_obj *pdf_jsimp_property(pdf_jsimp *imp, pdf_jsimp_obj *obj, char *prop)\n{\n\tpdf_jsimp_obj *pobj = NULL;\n\tconst char *err = pdf_jsimp_property_cpp(imp, obj, prop, &pobj);\n\tif (err != NULL)\n\t\tfz_throw(pdf_jsimp_ctx_cpp(imp), FZ_ERROR_GENERIC, \"%s\", err);\n\n\treturn pobj;\n}\n\nvoid pdf_jsimp_execute(pdf_jsimp *imp, char *code)\n{\n\tconst char *err = pdf_jsimp_execute_cpp(imp, code);\n\tif (err != NULL)\n\t\tfz_throw(pdf_jsimp_ctx_cpp(imp), FZ_ERROR_GENERIC, \"%s\", err);\n}\n\nvoid pdf_jsimp_execute_count(pdf_jsimp *imp, char *code, int count)\n{\n\tconst char *err = pdf_jsimp_execute_count_cpp(imp, code, count);\n\tif (err != NULL)\n\t\tfz_throw(pdf_jsimp_ctx_cpp(imp), FZ_ERROR_GENERIC, \"%s\", err);\n}\npdf_jsimp_obj *pdf_jsimp_call_method(pdf_jsimp *imp, pdf_jsimp_method *meth, void *jsctx, void *obj, int argc, pdf_jsimp_obj *args[])\n{\n\tfz_context *ctx = pdf_jsimp_ctx_cpp(imp);\n\tpdf_jsimp_obj *res;\n\n\tfz_try(ctx)\n\t{\n\t\tres = meth(jsctx, obj, argc, args);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tres = NULL;\n\t\tfz_warn(ctx, \"%s\", fz_caught_message(ctx));\n\t}\n\n\treturn res;\n}\n\npdf_jsimp_obj *pdf_jsimp_call_getter(pdf_jsimp *imp, pdf_jsimp_getter *get, void *jsctx, void *obj)\n{\n\tfz_context *ctx = pdf_jsimp_ctx_cpp(imp);\n\tpdf_jsimp_obj *res;\n\n\tfz_try(ctx)\n\t{\n\t\tres = get(jsctx, obj);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tres = NULL;\n\t\tfz_warn(ctx, \"%s\", fz_caught_message(ctx));\n\t}\n\n\treturn res;\n}\n\nvoid pdf_jsimp_call_setter(pdf_jsimp *imp, pdf_jsimp_setter *set, void *jsctx, void *obj, pdf_jsimp_obj *val)\n{\n\tfz_context *ctx = pdf_jsimp_ctx_cpp(imp);\n\n\tfz_try(ctx)\n\t{\n\t\tset(jsctx, obj, val);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_warn(ctx, \"%s\", fz_caught_message(ctx));\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/pdf/js/pdf-jsimp-cpp.h",
    "content": "/* C++ version of the pdf_jsimp api. C++ cannot safely call fz_throw,\n * so C++ implementations return explicit errors in char * form. */\n\nfz_context *pdf_jsimp_ctx_cpp(pdf_jsimp *imp);\nconst char *pdf_new_jsimp_cpp(fz_context *ctx, void *jsctx, pdf_jsimp **imp);\nconst char *pdf_drop_jsimp_cpp(pdf_jsimp *imp);\nconst char *pdf_jsimp_new_type_cpp(pdf_jsimp *imp, pdf_jsimp_dtr *dtr, pdf_jsimp_type **type);\nconst char *pdf_jsimp_drop_type_cpp(pdf_jsimp *imp, pdf_jsimp_type *type);\nconst char *pdf_jsimp_addmethod_cpp(pdf_jsimp *imp, pdf_jsimp_type *type, char *name, pdf_jsimp_method *meth);\nconst char *pdf_jsimp_addproperty_cpp(pdf_jsimp *imp, pdf_jsimp_type *type, char *name, pdf_jsimp_getter *get, pdf_jsimp_setter *set);\nconst char *pdf_jsimp_set_global_type_cpp(pdf_jsimp *imp, pdf_jsimp_type *type);\nconst char *pdf_jsimp_new_obj_cpp(pdf_jsimp *imp, pdf_jsimp_type *type, void *natobj, pdf_jsimp_obj **obj);\nconst char *pdf_jsimp_drop_obj_cpp(pdf_jsimp *imp, pdf_jsimp_obj *obj);\nconst char *pdf_jsimp_to_type_cpp(pdf_jsimp *imp, pdf_jsimp_obj *obj, int *type);\nconst char *pdf_jsimp_from_string_cpp(pdf_jsimp *imp, char *str, pdf_jsimp_obj **obj);\nconst char *pdf_jsimp_to_string_cpp(pdf_jsimp *imp, pdf_jsimp_obj *obj, char **str);\nconst char *pdf_jsimp_from_number_cpp(pdf_jsimp *imp, double num, pdf_jsimp_obj **obj);\nconst char *pdf_jsimp_to_number_cpp(pdf_jsimp *imp, pdf_jsimp_obj *obj, double *num);\nconst char *pdf_jsimp_array_len_cpp(pdf_jsimp *imp, pdf_jsimp_obj *obj, int *len);\nconst char *pdf_jsimp_array_item_cpp(pdf_jsimp *imp, pdf_jsimp_obj *obj, int i, pdf_jsimp_obj **item);\nconst char *pdf_jsimp_property_cpp(pdf_jsimp *imp, pdf_jsimp_obj *obj, char *prop, pdf_jsimp_obj **pobj);\nconst char *pdf_jsimp_execute_cpp(pdf_jsimp *imp, char *code);\nconst char *pdf_jsimp_execute_count_cpp(pdf_jsimp *imp, char *code, int count);\n\n/* Also when calling back into mupdf, all exceptions must be caught. The functions bellow\n * wrap these calls */\npdf_jsimp_obj *pdf_jsimp_call_method(pdf_jsimp *imp, pdf_jsimp_method *meth, void *jsctx, void *obj, int argc, pdf_jsimp_obj *args[]);\npdf_jsimp_obj *pdf_jsimp_call_getter(pdf_jsimp *imp, pdf_jsimp_getter *get, void *jsctx, void *obj);\nvoid pdf_jsimp_call_setter(pdf_jsimp *imp, pdf_jsimp_setter *set, void *jsctx, void *obj, pdf_jsimp_obj *val);\n"
  },
  {
    "path": "mupdf/source/pdf/js/pdf-jsimp-jscore.c",
    "content": "/* This file contains wrapper functions for pdf_jsimp functions implemented\n * in Javascriptcore */\n\n#include <JavaScriptCore/JavaScriptCore.h>\n#include \"mupdf/pdf.h\"\n\n#define STRING_BUF_SIZE (256)\n#define FUNCTION_PREAMBLE_LEN (9)\n\n/*\n\tWe need only a single JSClassRef because we store property and method information\n\tin the private data of each object. The JSClassRef is set up to know how to access\n\tthat data.\n*/\nstruct pdf_jsimp_s\n{\n\tfz_context *ctx;\n\tvoid *nat_ctx;\n\tJSGlobalContextRef jscore_ctx;\n\tJSClassRef class_ref;\n};\n\nenum\n{\n\tPROP_FN,\n\tPROP_VAL\n};\n\ntypedef struct prop_fn_s\n{\n\tpdf_jsimp_method *meth;\n} prop_fn;\n\ntypedef struct prop_val_s\n{\n\tpdf_jsimp_getter *get;\n\tpdf_jsimp_setter *set;\n} prop_val;\n\ntypedef struct prop_s\n{\n\tchar *name;\n\tint type;\n\tunion\n\t{\n\t\tprop_fn fn;\n\t\tprop_val val;\n\t} u;\n} prop;\n\ntypedef struct prop_list_s prop_list;\n\nstruct prop_list_s\n{\n\tprop prop;\n\tprop_list *next;\n};\n\nstruct pdf_jsimp_type_s\n{\n\tpdf_jsimp *imp;\n\tpdf_jsimp_dtr *dtr;\n\tprop_list *props;\n};\n\n/*\n\tWhen we create a JavaScriptCore object, we store in its private data the MuPDF\n\tnative object pointer and a pointer to the type. The type has a list of the\n\tproperties and methods\n*/\ntypedef struct priv_data_s\n{\n\tpdf_jsimp_type *type;\n\tvoid *natobj;\n} priv_data;\n\nstruct pdf_jsimp_obj_s\n{\n\tJSValueRef ref;\n\tchar *str;\n};\n\nstatic prop *find_prop(prop_list *list, char *name)\n{\n\twhile (list)\n\t{\n\t\tif (strcmp(name, list->prop.name) == 0)\n\t\t\treturn &list->prop;\n\n\t\tlist = list->next;\n\t}\n\n\treturn NULL;\n}\n\nstatic pdf_jsimp_obj *wrap_val(pdf_jsimp *imp, JSValueRef ref)\n{\n\tpdf_jsimp_obj *obj = fz_malloc_struct(imp->ctx, pdf_jsimp_obj);\n\tobj->ref = ref;\n\tJSValueProtect(imp->jscore_ctx, ref);\n\n\treturn obj;\n}\n\nstatic JSValueRef callMethod(JSContextRef jscore_ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef *exception)\n{\n\tpdf_jsimp *imp;\n\tfz_context *ctx;\n\tpdf_jsimp_obj *res = NULL;\n\tJSValueRef resref = NULL;\n\tint i;\n\tpdf_jsimp_obj **args = NULL;\n\tpdf_jsimp_method *meth = JSObjectGetPrivate(function);\n\tpriv_data *pdata = JSObjectGetPrivate(thisObject);\n\tif (meth == NULL)\n\t{\n\t\t/*\n\t\t\tThe attempt to store the method pointer as private data failed, so we\n\t\t\tturn the function into a string, which will have the form \"function name() xxx\",\n\t\t\tand then lookup the name.\n\t\t*/\n\t\tchar name[STRING_BUF_SIZE];\n\t\tchar *np;\n\t\tchar *bp;\n\t\tJSStringRef jname = JSValueToStringCopy(jscore_ctx, function, NULL);\n\t\tprop *p;\n\t\tJSStringGetUTF8CString(jname, name, STRING_BUF_SIZE);\n\t\tif (strlen(name) >= FUNCTION_PREAMBLE_LEN)\n\t\t{\n\t\t\tnp = name + FUNCTION_PREAMBLE_LEN; /* strlen(\"function \"); */\n\t\t\tbp = strchr(np, '(');\n\t\t\tif (bp)\n\t\t\t\t*bp = 0;\n\t\t\tp = find_prop(pdata->type->props, np);\n\t\t\tif (p && p->type == PROP_FN)\n\t\t\t{\n\t\t\t\tmeth = p->u.fn.meth;\n\t\t\t}\n\t\t}\n\t\tJSStringRelease(jname);\n\t}\n\tif (meth == NULL || pdata == NULL)\n\t\treturn JSValueMakeUndefined(jscore_ctx);\n\n\timp = pdata->type->imp;\n\tctx = imp->ctx;\n\n\tfz_var(args);\n\tfz_var(res);\n\tfz_try(ctx)\n\t{\n\t\targs = fz_malloc_array(ctx, argumentCount, sizeof(pdf_jsimp_obj));\n\t\tfor (i = 0; i < argumentCount; i++)\n\t\t\targs[i] = wrap_val(imp, arguments[i]);\n\n\t\tres = meth(imp->nat_ctx, pdata->natobj, argumentCount, args);\n\t\tif (res)\n\t\t\tresref = res->ref;\n\t}\n\tfz_always(ctx)\n\t{\n\t\tif (args)\n\t\t{\n\t\t\tfor (i = 0; i < argumentCount; i++)\n\t\t\t\tpdf_jsimp_drop_obj(imp, args[i]);\n\t\t\tfz_free(ctx, args);\n\t\t}\n\t\tpdf_jsimp_drop_obj(imp, res);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\treturn JSValueMakeUndefined(jscore_ctx);\n\t}\n\n\treturn resref;\n}\n\nstatic JSValueRef getProperty(JSContextRef jscore_ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef *exception)\n{\n\tpdf_jsimp *imp;\n\tchar buf[STRING_BUF_SIZE];\n\tprop *p;\n\tJSValueRef res = NULL;\n\n\tpriv_data *pdata = JSObjectGetPrivate(object);\n\tif (pdata == NULL)\n\t\treturn NULL;\n\n\tJSStringGetUTF8CString(propertyName, buf, STRING_BUF_SIZE);\n\tp = find_prop(pdata->type->props, buf);\n\tif (p == NULL)\n\t\treturn NULL;\n\n\timp = pdata->type->imp;\n\n\tswitch(p->type)\n\t{\n\t\tcase PROP_FN:\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t\tFor some reason passing the method pointer as private data doesn't work: the data comes back\n\t\t\t\t\tNULL when interrogated in callMethod above. So we also specify the method name when\n\t\t\t\t\tcreating the function so that we can look it up again in callMethod. Not ideal, but\n\t\t\t\t\twill do until we can find a better solution.\n\t\t\t\t*/\n\t\t\t\tJSObjectRef ores = JSObjectMakeFunctionWithCallback(jscore_ctx, propertyName, callMethod);\n\t\t\t\tJSObjectSetPrivate(ores, p->u.fn.meth);\n\t\t\t\tres = ores;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase PROP_VAL:\n\t\t\t{\n\t\t\t\tpdf_jsimp_obj *pres = p->u.val.get(imp->nat_ctx, pdata->natobj);\n\t\t\t\tres = pres->ref;\n\t\t\t\tpdf_jsimp_drop_obj(imp, pres);\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\treturn res;\n}\n\nstatic bool setProperty(JSContextRef jscore_ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef *exception)\n{\n\tpdf_jsimp *imp;\n\tchar buf[STRING_BUF_SIZE];\n\tprop *p;\n\n\tpriv_data *pdata = JSObjectGetPrivate(object);\n\tif (pdata == NULL)\n\t\treturn false;\n\n\tJSStringGetUTF8CString(propertyName, buf, STRING_BUF_SIZE);\n\tp = find_prop(pdata->type->props, buf);\n\tif (p == NULL)\n\t\treturn false;\n\n\timp = pdata->type->imp;\n\n\tswitch(p->type)\n\t{\n\t\tcase PROP_FN:\n\t\t\tbreak;\n\n\t\tcase PROP_VAL:\n\t\t\t{\n\t\t\t\tpdf_jsimp_obj *pval = wrap_val(imp, value);\n\t\t\t\tp->u.val.set(imp->nat_ctx, pdata->natobj, pval);\n\t\t\t\tpdf_jsimp_drop_obj(imp, pval);\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\treturn true;\n}\n\npdf_jsimp *pdf_new_jsimp(fz_context *ctx, void *jsctx)\n{\n\tpdf_jsimp *imp = fz_malloc_struct(ctx, pdf_jsimp);\n\n\tfz_try(ctx)\n\t{\n\t\tJSClassDefinition classDef = kJSClassDefinitionEmpty;\n\n\t\tclassDef.getProperty = getProperty;\n\t\tclassDef.setProperty = setProperty;\n\n\t\timp->nat_ctx = jsctx;\n\t\timp->class_ref = JSClassCreate(&classDef);\n\t\timp->jscore_ctx = JSGlobalContextCreate(imp->class_ref);\n\t\tif (imp->jscore_ctx == NULL)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"JSGlobalContextCreate failed\");\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_jsimp(imp);\n\t\tfz_rethrow(ctx);\n\t}\n\n\timp->ctx = ctx;\n\n\treturn imp;\n}\n\nvoid pdf_drop_jsimp(pdf_jsimp *imp)\n{\n\tif (imp)\n\t{\n\t\tJSGlobalContextRelease(imp->jscore_ctx);\n\t\tJSClassRelease(imp->class_ref);\n\t\tfz_free(imp->ctx, imp);\n\t}\n}\n\npdf_jsimp_type *pdf_jsimp_new_type(pdf_jsimp *imp, pdf_jsimp_dtr *dtr, char *name)\n{\n\tpdf_jsimp_type *type = fz_malloc_struct(imp->ctx, pdf_jsimp_type);\n\ttype->imp = imp;\n\ttype->dtr = dtr;\n\treturn type;\n}\n\nvoid pdf_jsimp_drop_type(pdf_jsimp *imp, pdf_jsimp_type *type)\n{\n\tif (imp && type)\n\t{\n\t\tfz_context *ctx = imp->ctx;\n\t\tprop_list *node;\n\n\t\twhile (type->props)\n\t\t{\n\t\t\tnode = type->props;\n\t\t\ttype->props = node->next;\n\t\t\tfz_free(ctx, node->prop.name);\n\t\t\tfz_free(ctx, node);\n\t\t}\n\n\t\tfz_free(ctx, type);\n\t}\n}\n\nvoid pdf_jsimp_addmethod(pdf_jsimp *imp, pdf_jsimp_type *type, char *name, pdf_jsimp_method *meth)\n{\n\tfz_context *ctx = imp->ctx;\n\tprop_list *node = fz_malloc_struct(ctx, prop_list);\n\n\tfz_try(ctx)\n\t{\n\t\tnode->prop.name = fz_strdup(imp->ctx, name);\n\t\tnode->prop.type = PROP_FN;\n\t\tnode->prop.u.fn.meth = meth;\n\n\t\tnode->next = type->props;\n\t\ttype->props = node;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, node);\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nvoid pdf_jsimp_addproperty(pdf_jsimp *imp, pdf_jsimp_type *type, char *name, pdf_jsimp_getter *get, pdf_jsimp_setter *set)\n{\n\tfz_context *ctx = imp->ctx;\n\tprop_list *node = fz_malloc_struct(ctx, prop_list);\n\n\tfz_try(ctx)\n\t{\n\t\tnode->prop.name = fz_strdup(imp->ctx, name);\n\t\tnode->prop.type = PROP_VAL;\n\t\tnode->prop.u.val.get = get;\n\t\tnode->prop.u.val.set = set;\n\n\t\tnode->next = type->props;\n\t\ttype->props = node;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, node);\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nvoid pdf_jsimp_set_global_type(pdf_jsimp *imp, pdf_jsimp_type *type)\n{\n\tfz_context *ctx = imp->ctx;\n\tpriv_data *pdata;\n\tJSObjectRef gobj = JSContextGetGlobalObject(imp->jscore_ctx);\n\tif (gobj == NULL)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"JSContextGetGlobalObject failed\");\n\n\tpdata = fz_malloc_struct(ctx, priv_data);\n\tpdata->type = type;\n\tpdata->natobj = NULL;\n\tJSObjectSetPrivate(gobj, pdata);\n}\n\npdf_jsimp_obj *pdf_jsimp_new_obj(pdf_jsimp *imp, pdf_jsimp_type *type, void *natobj)\n{\n\tfz_context *ctx = imp->ctx;\n\tpdf_jsimp_obj *obj = fz_malloc_struct(ctx, pdf_jsimp_obj);\n\tpriv_data *pdata = NULL;\n\n\tfz_var(pdata);\n\tfz_try(ctx)\n\t{\n\t\tpdata = fz_malloc_struct(ctx, priv_data);\n\t\tpdata->type = type;\n\t\tpdata->natobj = natobj;\n\t\tobj->ref = JSObjectMake(imp->jscore_ctx, imp->class_ref, pdata);\n\t\tif (obj->ref == NULL)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"JSObjectMake failed\");\n\n\t\tJSValueProtect(imp->jscore_ctx, obj->ref);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, pdata);\n\t\tfz_free(ctx, obj);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn obj;\n}\n\nvoid pdf_jsimp_drop_obj(pdf_jsimp *imp, pdf_jsimp_obj *obj)\n{\n\tif (imp && obj)\n\t{\n\t\tJSValueUnprotect(imp->jscore_ctx, obj->ref);\n\t\tfz_free(imp->ctx, obj->str);\n\t\tfz_free(imp->ctx, obj);\n\t}\n}\n\nint pdf_jsimp_to_type(pdf_jsimp *imp, pdf_jsimp_obj *obj)\n{\n\tswitch (JSValueGetType(imp->jscore_ctx, obj->ref))\n\t{\n\t\tcase kJSTypeNull: return JS_TYPE_NULL;\n\t\tcase kJSTypeBoolean: return JS_TYPE_BOOLEAN;\n\t\tcase kJSTypeNumber: return JS_TYPE_NUMBER;\n\t\tcase kJSTypeString: return JS_TYPE_STRING;\n\t\tcase kJSTypeObject: return JS_TYPE_ARRAY;\n\t\tdefault: return JS_TYPE_UNKNOWN;\n\t}\n}\n\npdf_jsimp_obj *pdf_jsimp_from_string(pdf_jsimp *imp, char *str)\n{\n\tJSStringRef sref = JSStringCreateWithUTF8CString(str);\n\tJSValueRef vref = JSValueMakeString(imp->jscore_ctx, sref);\n\tJSStringRelease(sref);\n\n\treturn wrap_val(imp, vref);\n}\n\nchar *pdf_jsimp_to_string(pdf_jsimp *imp, pdf_jsimp_obj *obj)\n{\n\tfz_context *ctx = imp->ctx;\n\tJSStringRef jstr = JSValueToStringCopy(imp->jscore_ctx, obj->ref, NULL);\n\tint len;\n\n\tif (jstr == NULL)\n\t\treturn \"\";\n\n\tfz_try(ctx)\n\t{\n\t\tlen = JSStringGetMaximumUTF8CStringSize(jstr);\n\t\tfz_free(ctx, obj->str);\n\t\tobj->str = NULL;\n\t\tobj->str = fz_malloc(ctx, len+1);\n\t\tJSStringGetUTF8CString(jstr, obj->str, len+1);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tJSStringRelease(jstr);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn obj->str;\n}\n\npdf_jsimp_obj *pdf_jsimp_from_number(pdf_jsimp *imp, double num)\n{\n\treturn wrap_val(imp, JSValueMakeNumber(imp->jscore_ctx, num));\n}\n\ndouble pdf_jsimp_to_number(pdf_jsimp *imp, pdf_jsimp_obj *obj)\n{\n\treturn JSValueToNumber(imp->jscore_ctx, obj->ref, NULL);\n}\n\nint pdf_jsimp_array_len(pdf_jsimp *imp, pdf_jsimp_obj *obj)\n{\n\tpdf_jsimp_obj *lobj = pdf_jsimp_property(imp, obj, \"length\");\n\tint num = (int)pdf_jsimp_to_number(imp, lobj);\n\n\tpdf_jsimp_drop_obj(imp, lobj);\n\n\treturn num;\n}\n\npdf_jsimp_obj *pdf_jsimp_array_item(pdf_jsimp *imp, pdf_jsimp_obj *obj, int i)\n{\n\treturn wrap_val(imp, JSObjectGetPropertyAtIndex(imp->jscore_ctx, JSValueToObject(imp->jscore_ctx, obj->ref, NULL), i, NULL));\n}\n\npdf_jsimp_obj *pdf_jsimp_property(pdf_jsimp *imp, pdf_jsimp_obj *obj, char *prop)\n{\n\tJSStringRef jprop = JSStringCreateWithUTF8CString(prop);\n\tJSValueRef jval = JSObjectGetProperty(imp->jscore_ctx, JSValueToObject(imp->jscore_ctx, obj->ref, NULL), jprop, NULL);\n\n\tJSStringRelease(jprop);\n\n\treturn wrap_val(imp, jval);\n}\n\nvoid pdf_jsimp_execute(pdf_jsimp *imp, char *code)\n{\n\tJSStringRef jcode = JSStringCreateWithUTF8CString(code);\n\tJSEvaluateScript(imp->jscore_ctx, jcode, NULL, NULL, 0, NULL);\n\tJSStringRelease(jcode);\n}\n\nvoid pdf_jsimp_execute_count(pdf_jsimp *imp, char *code, int count)\n{\n\tchar *terminated = fz_malloc(imp->ctx, count+1);\n\tmemcpy(terminated, code, count);\n\tterminated[count] = 0;\n\tpdf_jsimp_execute(imp, terminated);\n\tfz_free(imp->ctx, terminated);\n}\n"
  },
  {
    "path": "mupdf/source/pdf/js/pdf-jsimp-mu.c",
    "content": "#include \"mupdf/pdf.h\"\n\n#include <mujs.h>\n\n#define MAXARGS 16\n\n#define OBJ(i) ((pdf_jsimp_obj*)((intptr_t)(i)))\n#define IDX(p) ((intptr_t)(p))\n#define NEWOBJ(J,x) OBJ(js_gettop(J) + (x))\n\nstruct pdf_jsimp_s\n{\n\tfz_context *ctx;\n\tvoid *jsctx;\n\tjs_State *J;\n};\n\nstatic void *alloc(void *ud, void *ptr, unsigned int n)\n{\n\tfz_context *ctx = ud;\n\tif (n == 0) {\n\t\tfz_free(ctx, ptr);\n\t\treturn NULL;\n\t}\n\tif (ptr)\n\t\treturn fz_resize_array(ctx, ptr, n, 1);\n\treturn fz_malloc_array(ctx, n, 1);\n}\n\npdf_jsimp *pdf_new_jsimp(fz_context *ctx, void *jsctx)\n{\n\tjs_State *J;\n\tpdf_jsimp *imp;\n\n\tJ = js_newstate(alloc, ctx, 0);\n\tjs_setcontext(J, jsctx);\n\n\timp = fz_malloc_struct(ctx, pdf_jsimp);\n\timp->ctx = ctx;\n\timp->jsctx = jsctx;\n\timp->J = J;\n\treturn imp;\n}\n\nvoid pdf_drop_jsimp(pdf_jsimp *imp)\n{\n\tif (imp)\n\t{\n\t\tjs_freestate(imp->J);\n\t\tfz_free(imp->ctx, imp);\n\t}\n}\n\npdf_jsimp_type *pdf_jsimp_new_type(pdf_jsimp *imp, pdf_jsimp_dtr *dtr, char *name)\n{\n\tjs_State *J = imp->J;\n\tjs_newobject(J);\n\tjs_setregistry(J, name);\n\treturn (pdf_jsimp_type*)name;\n}\n\nvoid pdf_jsimp_drop_type(pdf_jsimp *imp, pdf_jsimp_type *type)\n{\n\tif (imp && type)\n\t{\n\t\tjs_State *J = imp->J;\n\t\tjs_delregistry(J, (const char *)type);\n\t}\n}\n\nstatic void wrapmethod(js_State *J)\n{\n\tpdf_jsimp_obj *args[MAXARGS];\n\tpdf_jsimp_obj *ret;\n\tpdf_jsimp_method *meth;\n\tconst char *type;\n\tvoid *jsctx;\n\tvoid *obj;\n\tint i;\n\n\tint argc = js_gettop(J) - 1;\n\n\tjsctx = js_getcontext(J);\n\n\tjs_currentfunction(J);\n\t{\n\t\tjs_getproperty(J, -1, \"__call\");\n\t\tmeth = js_touserdata(J, -1, \"method\");\n\t\tjs_pop(J, 1);\n\n\t\tjs_getproperty(J, -1, \"__type\");\n\t\ttype = js_tostring(J, -1);\n\t\tjs_pop(J, 1);\n\t}\n\tjs_pop(J, 1);\n\n\tif (js_isuserdata(J, 0, type))\n\t\tobj = js_touserdata(J, 0, type);\n\telse\n\t\tobj = NULL;\n\n\tif (argc > MAXARGS)\n\t\tjs_rangeerror(J, \"too many arguments\");\n\n\tfor (i = 0; i < argc; ++i)\n\t\targs[i] = OBJ(i+1);\n\tret = meth(jsctx, obj, argc, args);\n\tif (ret)\n\t\tjs_copy(J, IDX(ret));\n\telse\n\t\tjs_pushundefined(J);\n}\n\nstatic void wrapgetter(js_State *J)\n{\n\tpdf_jsimp_obj *ret;\n\tpdf_jsimp_getter *get;\n\tconst char *type;\n\tvoid *jsctx;\n\tvoid *obj;\n\n\tjsctx = js_getcontext(J);\n\n\tjs_currentfunction(J);\n\t{\n\t\tjs_getproperty(J, -1, \"__get\");\n\t\tget = js_touserdata(J, -1, \"getter\");\n\t\tjs_pop(J, 1);\n\n\t\tjs_getproperty(J, -1, \"__type\");\n\t\ttype = js_tostring(J, -1);\n\t\tjs_pop(J, 1);\n\t}\n\tjs_pop(J, 1);\n\n\tif (js_isuserdata(J, 0, type))\n\t\tobj = js_touserdata(J, 0, type);\n\telse\n\t\tobj = NULL;\n\n\tret = get(jsctx, obj);\n\tif (ret)\n\t\tjs_copy(J, IDX(ret));\n\telse\n\t\tjs_pushundefined(J);\n}\n\nstatic void wrapsetter(js_State *J)\n{\n\tpdf_jsimp_setter *set;\n\tconst char *type;\n\tvoid *jsctx;\n\tvoid *obj;\n\n\tjsctx = js_getcontext(J);\n\n\tjs_currentfunction(J);\n\t{\n\t\tjs_getproperty(J, -1, \"__set\");\n\t\tset = js_touserdata(J, -1, \"setter\");\n\t\tjs_pop(J, 1);\n\n\t\tjs_getproperty(J, -1, \"__type\");\n\t\ttype = js_tostring(J, -1);\n\t\tjs_pop(J, 1);\n\t}\n\tjs_pop(J, 1);\n\n\tif (js_isuserdata(J, 0, type))\n\t\tobj = js_touserdata(J, 0, type);\n\telse\n\t\tobj = NULL;\n\n\tset(jsctx, obj, OBJ(1));\n\n\tjs_pushundefined(J);\n}\n\nvoid pdf_jsimp_addmethod(pdf_jsimp *imp, pdf_jsimp_type *type, char *name, pdf_jsimp_method *meth)\n{\n\tjs_State *J = imp->J;\n\tjs_getregistry(J, (const char *)type);\n\t{\n\t\tjs_newcfunction(J, wrapmethod, name, 0);\n\t\t{\n\t\t\tjs_pushnull(J);\n\t\t\tjs_newuserdata(J, \"method\", meth, NULL);\n\t\t\tjs_defproperty(J, -2, \"__call\", JS_READONLY | JS_DONTENUM | JS_DONTCONF);\n\t\t\tjs_pushstring(J, (const char *)type);\n\t\t\tjs_defproperty(J, -2, \"__type\", JS_READONLY | JS_DONTENUM | JS_DONTCONF);\n\t\t}\n\t\tjs_defproperty(J, -2, name, JS_READONLY | JS_DONTCONF);\n\t}\n\tjs_pop(J, 1);\n}\n\nvoid pdf_jsimp_addproperty(pdf_jsimp *imp, pdf_jsimp_type *type, char *name, pdf_jsimp_getter *get, pdf_jsimp_setter *set)\n{\n\tjs_State *J = imp->J;\n\tjs_getregistry(J, (const char *)type);\n\t{\n\t\tjs_newcfunction(J, wrapgetter, name, 0);\n\t\t{\n\t\t\tjs_pushnull(J);\n\t\t\tjs_newuserdata(J, \"getter\", get, NULL);\n\t\t\tjs_defproperty(J, -2, \"__get\", JS_READONLY | JS_DONTENUM | JS_DONTCONF);\n\t\t\tjs_pushstring(J, (const char *)type);\n\t\t\tjs_defproperty(J, -2, \"__type\", JS_READONLY | JS_DONTENUM | JS_DONTCONF);\n\t\t}\n\t\tjs_newcfunction(J, wrapsetter, name, 0);\n\t\t{\n\t\t\tjs_pushnull(J);\n\t\t\tjs_newuserdata(J, \"setter\", set, NULL);\n\t\t\tjs_defproperty(J, -2, \"__set\", JS_READONLY | JS_DONTENUM | JS_DONTCONF);\n\t\t\tjs_pushstring(J, (const char *)type);\n\t\t\tjs_defproperty(J, -2, \"__type\", JS_READONLY | JS_DONTENUM | JS_DONTCONF);\n\t\t}\n\t\tjs_defaccessor(J, -3, name, JS_READONLY | JS_DONTCONF);\n\t}\n\tjs_pop(J, 1);\n}\n\nvoid pdf_jsimp_set_global_type(pdf_jsimp *imp, pdf_jsimp_type *type)\n{\n\tjs_State *J = imp->J;\n\tconst char *name;\n\n\tjs_getregistry(J, (const char *)type);\n\tjs_pushiterator(J, -1, 1);\n\twhile ((name = js_nextiterator(J, -1)))\n\t{\n\t\tjs_getproperty(J, -2, name);\n\t\tjs_setglobal(J, name);\n\t}\n}\n\npdf_jsimp_obj *pdf_jsimp_new_obj(pdf_jsimp *imp, pdf_jsimp_type *type, void *natobj)\n{\n\tjs_State *J = imp->J;\n\tjs_getregistry(J, (const char *)type);\n\tjs_newuserdata(J, (const char *)type, natobj, NULL);\n\treturn NEWOBJ(J, -1);\n}\n\nvoid pdf_jsimp_drop_obj(pdf_jsimp *imp, pdf_jsimp_obj *obj)\n{\n}\n\nint pdf_jsimp_to_type(pdf_jsimp *imp, pdf_jsimp_obj *obj)\n{\n\tjs_State *J = imp->J;\n\tif (js_isnull(J, IDX(obj))) return JS_TYPE_NULL;\n\tif (js_isboolean(J, IDX(obj))) return JS_TYPE_BOOLEAN;\n\tif (js_isnumber(J, IDX(obj))) return JS_TYPE_NUMBER;\n\tif (js_isstring(J, IDX(obj))) return JS_TYPE_STRING;\n\tif (js_isarray(J, IDX(obj))) return JS_TYPE_ARRAY;\n\treturn JS_TYPE_UNKNOWN;\n}\n\npdf_jsimp_obj *pdf_jsimp_from_string(pdf_jsimp *imp, char *str)\n{\n\tjs_State *J = imp->J;\n\tjs_pushstring(J, str);\n\treturn NEWOBJ(J, -1);\n}\n\nchar *pdf_jsimp_to_string(pdf_jsimp *imp, pdf_jsimp_obj *obj)\n{\n\t/* cast away const :( */\n\treturn (char*)js_tostring(imp->J, IDX(obj));\n}\n\npdf_jsimp_obj *pdf_jsimp_from_number(pdf_jsimp *imp, double num)\n{\n\tjs_State *J = imp->J;\n\tjs_pushnumber(J, num);\n\treturn NEWOBJ(J, -1);\n}\n\ndouble pdf_jsimp_to_number(pdf_jsimp *imp, pdf_jsimp_obj *obj)\n{\n\treturn js_tonumber(imp->J, IDX(obj));\n}\n\nint pdf_jsimp_array_len(pdf_jsimp *imp, pdf_jsimp_obj *obj)\n{\n\tjs_State *J = imp->J;\n\treturn js_getlength(J, IDX(obj));\n}\n\npdf_jsimp_obj *pdf_jsimp_array_item(pdf_jsimp *imp, pdf_jsimp_obj *obj, int i)\n{\n\tjs_State *J = imp->J;\n\tjs_getindex(J, IDX(obj), i);\n\treturn NEWOBJ(J, -1);\n}\n\npdf_jsimp_obj *pdf_jsimp_property(pdf_jsimp *imp, pdf_jsimp_obj *obj, char *prop)\n{\n\tjs_State *J = imp->J;\n\tjs_getproperty(J, IDX(obj), prop);\n\treturn NEWOBJ(J, -1);\n}\n\nvoid pdf_jsimp_execute(pdf_jsimp *imp, char *code)\n{\n\tjs_State *J = imp->J;\n\tjs_dostring(J, code, 0);\n}\n\nvoid pdf_jsimp_execute_count(pdf_jsimp *imp, char *code, int count)\n{\n\tchar *terminated = fz_malloc(imp->ctx, count+1);\n\tmemcpy(terminated, code, count);\n\tterminated[count] = 0;\n\tpdf_jsimp_execute(imp, terminated);\n\tfz_free(imp->ctx, terminated);\n}\n"
  },
  {
    "path": "mupdf/source/pdf/js/pdf-jsimp-v8.cpp",
    "content": "/*\n\tThis file contains the v8 implementation of the pdf_jsimp API\n */\n\nextern \"C\" {\n#include \"mupdf/fitz.h\"\n#include \"mupdf/pdf.h\"\n#include \"pdf-jsimp-cpp.h\"\n}\n\n#include <vector>\n#include <set>\n#include <v8.h>\n\nusing namespace v8;\nusing namespace std;\n\nstruct PDFJSImp;\n\n/* Object we pass to FunctionTemplate::New, which v8 passes back to us in\n * callMethod, allowing us to call our client's, passed-in method. */\nstruct PDFJSImpMethod\n{\n\tPDFJSImp *imp;\n\tpdf_jsimp_method *meth;\n\n\tPDFJSImpMethod(PDFJSImp *imp, pdf_jsimp_method *meth) : imp(imp), meth(meth) {}\n};\n\n/* Object we pass to ObjectTemplate::SetAccessor, which v8 passes back to us in\n * setProp and getProp, allowing us to call our client's, passed-in set/get methods. */\nstruct PDFJSImpProperty\n{\n\tPDFJSImp *imp;\n\tpdf_jsimp_getter *get;\n\tpdf_jsimp_setter *set;\n\n\tPDFJSImpProperty(PDFJSImp *imp, pdf_jsimp_getter *get, pdf_jsimp_setter *set) : imp(imp), get(get), set(set) {}\n};\n\n/* Internal representation of the pdf_jsimp_type object */\nstruct PDFJSImpType\n{\n\tPDFJSImp                  *imp;\n\tPersistent<ObjectTemplate> templ;\n\tpdf_jsimp_dtr             *dtr;\n\tvector<PDFJSImpMethod *> methods;\n\tvector<PDFJSImpProperty *> properties;\n\n\tPDFJSImpType(PDFJSImp *imp, pdf_jsimp_dtr *dtr): imp(imp), dtr(dtr)\n\t{\n\t\tHandleScope scope;\n\t\ttempl = Persistent<ObjectTemplate>::New(ObjectTemplate::New());\n\t\ttempl->SetInternalFieldCount(1);\n\t}\n\n\t~PDFJSImpType()\n\t{\n\t\tvector<PDFJSImpMethod *>::iterator mit;\n\t\tfor (mit = methods.begin(); mit < methods.end(); mit++)\n\t\t\tdelete *mit;\n\n\t\tvector<PDFJSImpProperty *>::iterator pit;\n\t\tfor (pit = properties.begin(); pit < properties.end(); pit++)\n\t\t\tdelete *pit;\n\n\t\ttempl.Dispose();\n\t}\n};\n\n/* Info via which we destroy the client side part of objects that\n * v8 garbage collects */\nstruct PDFJSImpGCObj\n{\n\tPersistent<Object> pobj;\n\tPDFJSImpType *type;\n\n\tPDFJSImpGCObj(Handle<Object> obj, PDFJSImpType *type): type(type)\n\t{\n\t\tpobj = Persistent<Object>::New(obj);\n\t}\n\n\t~PDFJSImpGCObj()\n\t{\n\t\tpobj.Dispose();\n\t}\n};\n\n/* Internal representation of the pdf_jsimp object */\nstruct PDFJSImp\n{\n\tfz_context\t\t\t*ctx;\n\tvoid\t\t\t\t*jsctx;\n\tPersistent<Context>\t context;\n\tvector<PDFJSImpType *> types;\n\tset<PDFJSImpGCObj *> gclist;\n\n\tPDFJSImp(fz_context *ctx, void *jsctx) : ctx(ctx), jsctx(jsctx)\n\t{\n\t\tHandleScope scope;\n\t\tcontext = Persistent<Context>::New(Context::New());\n\t}\n\n\t~PDFJSImp()\n\t{\n\t\tHandleScope scope;\n\t\t/* Tell v8 our context will not be used again */\n\t\tcontext.Dispose();\n\n\t\t/* Unlink and destroy all the objects that v8 has yet to gc */\n\t\tset<PDFJSImpGCObj *>::iterator oit;\n\t\tfor (oit = gclist.begin(); oit != gclist.end(); oit++)\n\t\t{\n\t\t\t(*oit)->pobj.ClearWeak(); /* So that gcCallback wont get called */\n\t\t\tPDFJSImpType *vType = (*oit)->type;\n\t\t\tLocal<External> owrap = Local<External>::Cast((*oit)->pobj->GetInternalField(0));\n\t\t\tvType->dtr(vType->imp->jsctx, owrap->Value());\n\t\t\tdelete *oit;\n\t\t}\n\n\t\tvector<PDFJSImpType *>::iterator it;\n\t\tfor (it = types.begin(); it < types.end(); it++)\n\t\t\tdelete *it;\n\t}\n};\n\n/* Internal representation of the pdf_jsimp_obj object */\nclass PDFJSImpObject\n{\n\tPersistent<Value>   pobj;\n\tString::Utf8Value  *utf8;\n\npublic:\n\tPDFJSImpObject(Handle<Value> obj): utf8(NULL)\n\t{\n\t\tpobj = Persistent<Value>::New(obj);\n\t}\n\n\tPDFJSImpObject(const char *str): utf8(NULL)\n\t{\n\t\tpobj = Persistent<Value>::New(String::New(str));\n\t}\n\n\tPDFJSImpObject(double num): utf8(NULL)\n\t{\n\t\tpobj = Persistent<Value>::New(Number::New(num));\n\t}\n\n\t~PDFJSImpObject()\n\t{\n\t\tdelete utf8;\n\t\tpobj.Dispose();\n\t}\n\n\tint type()\n\t{\n\t\tif (pobj->IsNull())\n\t\t\treturn JS_TYPE_NULL;\n\t\telse if (pobj->IsString() || pobj->IsStringObject())\n\t\t\treturn JS_TYPE_STRING;\n\t\telse if (pobj->IsNumber() || pobj->IsNumberObject())\n\t\t\treturn JS_TYPE_NUMBER;\n\t\telse if (pobj->IsArray())\n\t\t\treturn JS_TYPE_ARRAY;\n\t\telse if (pobj->IsBoolean() || pobj->IsBooleanObject())\n\t\t\treturn JS_TYPE_BOOLEAN;\n\t\telse\n\t\t\treturn JS_TYPE_UNKNOWN;\n\t}\n\n\tchar *toString()\n\t{\n\t\tdelete utf8;\n\t\tutf8 = new String::Utf8Value(pobj);\n\t\treturn **utf8;\n\t}\n\n\tdouble toNumber()\n\t{\n\t\treturn pobj->NumberValue();\n\t}\n\n\tHandle<Value> toValue()\n\t{\n\t\treturn pobj;\n\t}\n};\n\nextern \"C\" fz_context *pdf_jsimp_ctx_cpp(pdf_jsimp *imp)\n{\n\treturn reinterpret_cast<PDFJSImp *>(imp)->ctx;\n}\n\nextern \"C\" const char *pdf_new_jsimp_cpp(fz_context *ctx, void *jsctx, pdf_jsimp **imp)\n{\n\tLocker lock;\n\t*imp = reinterpret_cast<pdf_jsimp *>(new PDFJSImp(ctx, jsctx));\n\n\treturn NULL;\n}\n\nextern \"C\" const char *pdf_drop_jsimp_cpp(pdf_jsimp *imp)\n{\n\tLocker lock;\n\tdelete reinterpret_cast<PDFJSImp *>(imp);\n\treturn NULL;\n}\n\nextern \"C\" const char *pdf_jsimp_new_type_cpp(pdf_jsimp *imp, pdf_jsimp_dtr *dtr, pdf_jsimp_type **type)\n{\n\tLocker lock;\n\tPDFJSImp *vImp = reinterpret_cast<PDFJSImp *>(imp);\n\tPDFJSImpType *vType = new PDFJSImpType(vImp, dtr);\n\tvImp->types.push_back(vType);\n\t*type = reinterpret_cast<pdf_jsimp_type *>(vType);\n\treturn NULL;\n}\n\nextern \"C\" const char *pdf_jsimp_drop_type_cpp(pdf_jsimp *imp, pdf_jsimp_type *type)\n{\n\t/* Types are recorded and destroyed as part of PDFJSImp */\n\treturn NULL;\n}\n\nstatic Handle<Value> callMethod(const Arguments &args)\n{\n\tHandleScope scope;\n\tLocal<External> mwrap = Local<External>::Cast(args.Data());\n\tPDFJSImpMethod *m = (PDFJSImpMethod *)mwrap->Value();\n\n\tLocal<Object> self = args.Holder();\n\tLocal<External> owrap;\n\tvoid *nself = NULL;\n\tif (self->InternalFieldCount() > 0)\n\t{\n\t\towrap = Local<External>::Cast(self->GetInternalField(0));\n\t\tnself = owrap->Value();\n\t}\n\n\tint c = args.Length();\n\tPDFJSImpObject **native_args = new PDFJSImpObject*[c];\n\tfor (int i = 0; i < c; i++)\n\t\tnative_args[i] = new PDFJSImpObject(args[i]);\n\n\tPDFJSImpObject *obj = reinterpret_cast<PDFJSImpObject *>(pdf_jsimp_call_method(reinterpret_cast<pdf_jsimp *>(m->imp), m->meth, m->imp->jsctx, nself, c, reinterpret_cast<pdf_jsimp_obj **>(native_args)));\n\tHandle<Value> val;\n\tif (obj)\n\t\tval = obj->toValue();\n\tdelete obj;\n\n\tfor (int i = 0; i < c; i++)\n\t\tdelete native_args[i];\n\n\tdelete native_args;\n\n\treturn scope.Close(val);\n}\n\nextern \"C\" const char *pdf_jsimp_addmethod_cpp(pdf_jsimp *imp, pdf_jsimp_type *type, char *name, pdf_jsimp_method *meth)\n{\n\tLocker lock;\n\tPDFJSImpType *vType = reinterpret_cast<PDFJSImpType *>(type);\n\tHandleScope scope;\n\n\tPDFJSImpMethod *pmeth = new PDFJSImpMethod(vType->imp, meth);\n\tvType->templ->Set(String::New(name), FunctionTemplate::New(callMethod, External::New(pmeth)));\n\tvType->methods.push_back(pmeth);\n\treturn NULL;\n}\n\nstatic Handle<Value> getProp(Local<String> property, const AccessorInfo &info)\n{\n\tHandleScope scope;\n\tLocal<External> pwrap = Local<External>::Cast(info.Data());\n\tPDFJSImpProperty *p = reinterpret_cast<PDFJSImpProperty *>(pwrap->Value());\n\n\tLocal<Object> self = info.Holder();\n\tLocal<External> owrap;\n\tvoid *nself = NULL;\n\tif (self->InternalFieldCount() > 0)\n\t{\n\t\tLocal<Value> val = self->GetInternalField(0);\n\t\tif (val->IsExternal())\n\t\t{\n\t\t\towrap = Local<External>::Cast(val);\n\t\t\tnself = owrap->Value();\n\t\t}\n\t}\n\n\tPDFJSImpObject *obj = reinterpret_cast<PDFJSImpObject *>(pdf_jsimp_call_getter(reinterpret_cast<pdf_jsimp *>(p->imp), p->get, p->imp->jsctx, nself));\n\tHandle<Value> val;\n\tif (obj)\n\t\tval = obj->toValue();\n\tdelete obj;\n\treturn scope.Close(val);\n}\n\nstatic void setProp(Local<String> property, Local<Value> value, const AccessorInfo &info)\n{\n\tHandleScope scope;\n\tLocal<External> wrap = Local<External>::Cast(info.Data());\n\tPDFJSImpProperty *p = reinterpret_cast<PDFJSImpProperty *>(wrap->Value());\n\n\tLocal<Object> self = info.Holder();\n\tLocal<External> owrap;\n\tvoid *nself = NULL;\n\tif (self->InternalFieldCount() > 0)\n\t{\n\t\towrap = Local<External>::Cast(self->GetInternalField(0));\n\t\tnself = owrap->Value();\n\t}\n\n\tPDFJSImpObject *obj = new PDFJSImpObject(value);\n\n\tpdf_jsimp_call_setter(reinterpret_cast<pdf_jsimp *>(p->imp), p->set, p->imp->jsctx, nself, reinterpret_cast<pdf_jsimp_obj *>(obj));\n\tdelete obj;\n}\n\nextern \"C\" const char *pdf_jsimp_addproperty_cpp(pdf_jsimp *imp, pdf_jsimp_type *type, char *name, pdf_jsimp_getter *get, pdf_jsimp_setter *set)\n{\n\tLocker lock;\n\tPDFJSImpType *vType = reinterpret_cast<PDFJSImpType *>(type);\n\tHandleScope scope;\n\n\tPDFJSImpProperty *prop = new PDFJSImpProperty(vType->imp, get, set);\n\tvType->templ->SetAccessor(String::New(name), getProp, setProp, External::New(prop));\n\tvType->properties.push_back(prop);\n\treturn NULL;\n}\n\nextern \"C\" const char *pdf_jsimp_set_global_type_cpp(pdf_jsimp *imp, pdf_jsimp_type *type)\n{\n\tLocker lock;\n\tPDFJSImp\t *vImp  = reinterpret_cast<PDFJSImp *>(imp);\n\tPDFJSImpType *vType = reinterpret_cast<PDFJSImpType *>(type);\n\tHandleScope scope;\n\n\tvImp->context = Persistent<Context>::New(Context::New(NULL, vType->templ));\n\treturn NULL;\n}\n\nstatic void gcCallback(Persistent<Value> val, void *parm)\n{\n\tPDFJSImpGCObj *gco = reinterpret_cast<PDFJSImpGCObj *>(parm);\n\tPDFJSImpType *vType = gco->type;\n\tHandleScope scope;\n\tPersistent<Object> obj = Persistent<Object>::Cast(val);\n\n\tLocal<External> owrap = Local<External>::Cast(obj->GetInternalField(0));\n\tvType->dtr(vType->imp->jsctx, owrap->Value());\n\tvType->imp->gclist.erase(gco);\n\tdelete gco; /* Disposes of the persistent handle */\n}\n\nextern \"C\" const char *pdf_jsimp_new_obj_cpp(pdf_jsimp *imp, pdf_jsimp_type *type, void *natobj, pdf_jsimp_obj **robj)\n{\n\tLocker lock;\n\tPDFJSImpType *vType = reinterpret_cast<PDFJSImpType *>(type);\n\tHandleScope scope;\n\tLocal<Object> obj = vType->templ->NewInstance();\n\tobj->SetInternalField(0, External::New(natobj));\n\n\t/* Arrange for destructor to be called on the client-side object\n\t * when the v8 object is garbage collected */\n\tif (vType->dtr)\n\t{\n\t\t/* Wrap obj in a PDFJSImpGCObj, which takes a persistent handle to\n\t\t * obj, and stores its type with it. The persistent handle tells v8\n\t\t * it cannot just destroy obj leaving the client-side object hanging */\n\t\tPDFJSImpGCObj *gco = new PDFJSImpGCObj(obj, vType);\n\t\t/* Keep the wrapped object in a list, so that we can take back control\n\t\t * of destroying client-side objects when shutting down this context */\n\t\tvType->imp->gclist.insert(gco);\n\t\t/* Tell v8 that it can destroy the persistent handle to obj when it has\n\t\t * no further need for it, but it must inform us via gcCallback */\n\t\tgco->pobj.MakeWeak(gco, gcCallback);\n\t}\n\n\t*robj = reinterpret_cast<pdf_jsimp_obj *>(new PDFJSImpObject(obj));\n\treturn NULL;\n}\n\nextern \"C\" const char *pdf_jsimp_drop_obj_cpp(pdf_jsimp *imp, pdf_jsimp_obj *obj)\n{\n\tLocker lock;\n\tdelete reinterpret_cast<PDFJSImpObject *>(obj);\n\treturn NULL;\n}\n\nextern \"C\" const char *pdf_jsimp_to_type_cpp(pdf_jsimp *imp, pdf_jsimp_obj *obj, int *type)\n{\n\tLocker lock;\n\t*type = reinterpret_cast<PDFJSImpObject *>(obj)->type();\n\treturn NULL;\n}\n\nextern \"C\" const char *pdf_jsimp_from_string_cpp(pdf_jsimp *imp, char *str, pdf_jsimp_obj **obj)\n{\n\tLocker lock;\n\t*obj = reinterpret_cast<pdf_jsimp_obj *>(new PDFJSImpObject(str));\n\treturn NULL;\n}\n\nextern \"C\" const char *pdf_jsimp_to_string_cpp(pdf_jsimp *imp, pdf_jsimp_obj *obj, char **str)\n{\n\tLocker lock;\n\t*str = reinterpret_cast<PDFJSImpObject *>(obj)->toString();\n\treturn NULL;\n}\n\nextern \"C\" const char *pdf_jsimp_from_number_cpp(pdf_jsimp *imp, double num, pdf_jsimp_obj **obj)\n{\n\tLocker lock;\n\t*obj = reinterpret_cast<pdf_jsimp_obj *>(new PDFJSImpObject(num));\n\treturn NULL;\n}\n\nextern \"C\" const char *pdf_jsimp_to_number_cpp(pdf_jsimp *imp, pdf_jsimp_obj *obj, double *num)\n{\n\tLocker lock;\n\t*num = reinterpret_cast<PDFJSImpObject *>(obj)->toNumber();\n\treturn NULL;\n}\n\nextern \"C\" const char *pdf_jsimp_array_len_cpp(pdf_jsimp *imp, pdf_jsimp_obj *obj, int *len)\n{\n\tLocker lock;\n\tLocal<Object> jsobj = reinterpret_cast<PDFJSImpObject *>(obj)->toValue()->ToObject();\n\tLocal<Array> arr = Local<Array>::Cast(jsobj);\n\t*len = arr->Length();\n\treturn NULL;\n}\n\nextern \"C\" const char *pdf_jsimp_array_item_cpp(pdf_jsimp *imp, pdf_jsimp_obj *obj, int i, pdf_jsimp_obj **item)\n{\n\tLocker lock;\n\tLocal<Object> jsobj = reinterpret_cast<PDFJSImpObject *>(obj)->toValue()->ToObject();\n\t*item = reinterpret_cast<pdf_jsimp_obj *>(new PDFJSImpObject(jsobj->Get(Number::New(i))));\n\treturn NULL;\n}\n\nextern \"C\" const char *pdf_jsimp_property_cpp(pdf_jsimp *imp, pdf_jsimp_obj *obj, char *prop, pdf_jsimp_obj **pobj)\n{\n\tLocker lock;\n\tLocal<Object> jsobj = reinterpret_cast<PDFJSImpObject *>(obj)->toValue()->ToObject();\n\t*pobj = reinterpret_cast<pdf_jsimp_obj *>(new PDFJSImpObject(jsobj->Get(String::New(prop))));\n\treturn NULL;\n}\n\nextern \"C\" const char *pdf_jsimp_execute_cpp(pdf_jsimp *imp, char *code)\n{\n\tLocker lock;\n\tPDFJSImp *vImp = reinterpret_cast<PDFJSImp *>(imp);\n\tHandleScope scope;\n\tContext::Scope context_scope(vImp->context);\n\tHandle<Script> script = Script::Compile(String::New(code));\n\tif (script.IsEmpty())\n\t\treturn \"compile failed in pdf_jsimp_execute\";\n\tscript->Run();\n\treturn NULL;\n}\n\nextern \"C\" const char *pdf_jsimp_execute_count_cpp(pdf_jsimp *imp, char *code, int count)\n{\n\tLocker lock;\n\tPDFJSImp *vImp = reinterpret_cast<PDFJSImp *>(imp);\n\tHandleScope scope;\n\tContext::Scope context_scope(vImp->context);\n\tHandle<Script> script = Script::Compile(String::New(code, count));\n\tif (script.IsEmpty())\n\t\treturn \"compile failed in pdf_jsimp_execute_count\";\n\tscript->Run();\n\treturn NULL;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/js/pdf-util.js",
    "content": "var MuPDF = {\n\tmonthName: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n\tshortMonthName: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n\tmonthPattern: /Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec/,\n\tdayName: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n\n\tpadZeros: function(num, places) {\n\t\tvar s = String(num)\n\t\twhile (s.length < places)\n\t\t\ts = '0' + s\n\t\treturn s;\n\t},\n\n\tconvertCase: function(str, cmd) {\n\t\tswitch (cmd) {\n\t\t\tcase '>': return str.toUpperCase();\n\t\t\tcase '<': return str.toLowerCase();\n\t\t\tdefault: return str;\n\t\t}\n\t},\n};\n\n/* display must be kept in sync with an enum in pdf_form.c */\nvar display = {\n\tvisible: 0,\n\thidden: 1,\n\tnoPrint: 2,\n\tnoView: 3,\n};\n\nvar border = {\n\ts: \"Solid\",\n\td: \"Dashed\",\n\tb: \"Beveled\",\n\ti: \"Inset\",\n\tu: \"Underline\",\n};\n\nvar color = {\n\ttransparent: [ \"T\" ],\n\tblack: [ \"G\", 0 ],\n\twhite: [ \"G\", 1 ],\n\tred: [ \"RGB\", 1,0,0 ],\n\tgreen: [ \"RGB\", 0,1,0 ],\n\tblue: [ \"RGB\", 0,0,1 ],\n\tcyan: [ \"CMYK\", 1,0,0,0 ],\n\tmagenta: [ \"CMYK\", 0,1,0,0 ],\n\tyellow: [ \"CMYK\", 0,0,1,0 ],\n\tdkGray: [ \"G\", 0.25 ],\n\tgray: [ \"G\", 0.5 ],\n\tltGray: [ \"G\", 0.75 ],\n};\n\nvar util = {};\n\nutil.printd = function(fmt, d)\n{\n\tvar regexp = /(m+|d+|y+|H+|h+|M+|s+|t+|[^mdyHhMst]+)/g;\n\tvar res = '';\n\tvar i;\n\n\tif (!d)\n\t\treturn null;\n\n\tvar tokens = fmt.match(regexp);\n\tvar length = tokens ? tokens.length : 0;\n\n\tfor (i = 0; i < length; i++)\n\t{\n\t\tswitch(tokens[i])\n\t\t{\n\t\t\tcase 'mmmm': res += MuPDF.monthName[d.getMonth()]; break;\n\t\t\tcase 'mmm': res += MuPDF.monthName[d.getMonth()].substring(0,3); break;\n\t\t\tcase 'mm': res += MuPDF.padZeros(d.getMonth()+1, 2); break;\n\t\t\tcase 'm': res += d.getMonth()+1; break;\n\t\t\tcase 'dddd': res += MuPDF.dayName[d.getDay()]; break;\n\t\t\tcase 'ddd': res += MuPDF.dayName[d.getDay()].substring(0,3); break;\n\t\t\tcase 'dd': res += MuPDF.padZeros(d.getDate(), 2); break;\n\t\t\tcase 'd': res += d.getDate(); break;\n\t\t\tcase 'yyyy': res += d.getFullYear(); break;\n\t\t\tcase 'yy': res += d.getFullYear()%100; break;\n\t\t\tcase 'HH': res += MuPDF.padZeros(d.getHours(), 2); break;\n\t\t\tcase 'H': res += d.getHours(); break;\n\t\t\tcase 'hh': res += MuPDF.padZeros((d.getHours()+11)%12+1, 2); break;\n\t\t\tcase 'h': res += (d.getHours()+11)%12+1; break;\n\t\t\tcase 'MM': res += MuPDF.padZeros(d.getMinutes(), 2); break;\n\t\t\tcase 'M': res += d.getMinutes(); break;\n\t\t\tcase 'ss': res += MuPDF.padZeros(d.getSeconds(), 2); break;\n\t\t\tcase 's': res += d.getSeconds(); break;\n\t\t\tcase 'tt': res += d.getHours() < 12 ? 'am' : 'pm'; break;\n\t\t\tcase 't': res += d.getHours() < 12 ? 'a' : 'p'; break;\n\t\t\tdefault: res += tokens[i];\n\t\t}\n\t}\n\n\treturn res;\n}\n\nutil.printx = function(fmt, val)\n{\n\tvar cs = '=';\n\tvar res = '';\n\tvar i = 0;\n\tvar m;\n\tvar length = fmt ? fmt.length : 0;\n\n\twhile (i < length)\n\t{\n\t\tswitch (fmt.charAt(i))\n\t\t{\n\t\t\tcase '\\\\':\n\t\t\t\ti++;\n\t\t\t\tif (i >= length) return res;\n\t\t\t\tres += fmt.charAt(i);\n\t\t\t\tbreak;\n\n\t\t\tcase 'X':\n\t\t\t\tm = val.match(/\\w/);\n\t\t\t\tif (!m) return res;\n\t\t\t\tres += MuPDF.convertCase(m[0],cs);\n\t\t\t\tval = val.replace(/^\\W*\\w/,'');\n\t\t\t\tbreak;\n\n\t\t\tcase 'A':\n\t\t\t\tm = val.match(/[A-Za-z]/);\n\t\t\t\tif (!m) return res;\n\t\t\t\tres += MuPDF.convertCase(m[0],cs);\n\t\t\t\tval = val.replace(/^[^A-Za-z]*[A-Za-z]/,'');\n\t\t\t\tbreak;\n\n\t\t\tcase '9':\n\t\t\t\tm = val.match(/\\d/);\n\t\t\t\tif (!m) return res;\n\t\t\t\tres += m[0];\n\t\t\t\tval = val.replace(/^\\D*\\d/,'');\n\t\t\t\tbreak;\n\n\t\t\tcase '*':\n\t\t\t\tres += val;\n\t\t\t\tval = '';\n\t\t\t\tbreak;\n\n\t\t\tcase '?':\n\t\t\t\tif (!val) return res;\n\t\t\t\tres += MuPDF.convertCase(val.charAt(0),cs);\n\t\t\t\tval = val.substring(1);\n\t\t\t\tbreak;\n\n\t\t\tcase '=':\n\t\t\tcase '>':\n\t\t\tcase '<':\n\t\t\t\tcs = fmt.charAt(i);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tres += MuPDF.convertCase(fmt.charAt(i),cs);\n\t\t\t\tbreak;\n\t\t}\n\n\t\ti++;\n\t}\n\n\treturn res;\n}\n\nutil.printf = function()\n{\n\tvar i;\n\n\tif (arguments.length < 1)\n\t\treturn \"\";\n\n\tvar res = \"\";\n\tvar arg_i = 1;\n\tvar regexp = /%[^dfsx]*[dfsx]|[^%]*/g;\n\tvar tokens = arguments[0].match(regexp);\n\tvar length = tokens ? tokens.length : 0;\n\n\tfor (i = 0; i < length; i++)\n\t{\n\t\tvar tok = tokens[i];\n\t\tif (tok.match(/^%/))\n\t\t{\n\t\t\tif (arg_i < arguments.length)\n\t\t\t{\n\t\t\t\tvar val = arguments[arg_i++];\n\t\t\t\tvar fval = '';\n\t\t\t\tvar neg = false;\n\t\t\t\tvar decsep_re = /^,[0123]/;\n\t\t\t\tvar flags_re = /^[+ 0#]+/;\n\t\t\t\tvar width_re = /^\\d+/;\n\t\t\t\tvar prec_re = /^\\.\\d+/;\n\t\t\t\tvar conv_re = /^[dfsx]/;\n\n\t\t\t\ttok = tok.replace(/^%/, \"\");\n\t\t\t\tvar decsep = tok.match(decsep_re);\n\t\t\t\tif (decsep) decsep = decsep[0];\n\t\t\t\ttok = tok.replace(decsep_re, \"\");\n\t\t\t\tvar flags = tok.match(flags_re);\n\t\t\t\tif (flags) flags = flags[0];\n\t\t\t\ttok = tok.replace(flags_re, \"\");\n\t\t\t\tvar width = tok.match(width_re);\n\t\t\t\tif (width) width = width[0];\n\t\t\t\ttok = tok.replace(width_re, \"\");\n\t\t\t\tvar prec = tok.match(prec_re);\n\t\t\t\tif (prec) prec = prec[0];\n\t\t\t\ttok = tok.replace(prec_re, \"\");\n\t\t\t\tvar conv = tok.match(conv_re);\n\t\t\t\tif (conv) conv = conv[0];\n\n\t\t\t\tprec = prec ? Number(prec.replace(/^\\./, '')) : 0;\n\t\t\t\tvar poschar = (flags && flags.match(/[+ ]/)) ? flags.match(/[+ ]/)[0] : '';\n\t\t\t\tvar pad = (flags && flags.match(/0/)) ? '0' : ' ';\n\n\t\t\t\tvar point = '.';\n\t\t\t\tvar thou = '';\n\n\t\t\t\tif (decsep)\n\t\t\t\t{\n\t\t\t\t\tswitch(decsep)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase ',0': thou = ','; break;\n\t\t\t\t\t\tcase ',1': break;\n\t\t\t\t\t\tcase ',2': thou = '.'; point = ','; break;\n\t\t\t\t\t\tcase ',3': point = ','; break;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tswitch(conv)\n\t\t\t\t{\n\t\t\t\t\tcase 'x':\n\t\t\t\t\t\tval = Math.floor(val);\n\t\t\t\t\t\tneg = (val < 0);\n\t\t\t\t\t\tif (neg)\n\t\t\t\t\t\t\tval = -val;\n\n\t\t\t\t\t\t// Convert to hex\n\t\t\t\t\t\twhile (val)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfval = '0123456789ABCDEF'.charAt(val%16) + fval;\n\t\t\t\t\t\t\tval = Math.floor(val/16);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (neg)\n\t\t\t\t\t\t\tfval = '-' + fval;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tfval = poschar + fval;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'd':\n\t\t\t\t\t\tfval = String(Math.floor(val));\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 's':\n\t\t\t\t\t\t// Always pad strings with space\n\t\t\t\t\t\tpad = ' ';\n\t\t\t\t\t\tfval = String(val);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'f':\n\t\t\t\t\t\tfval = String(val);\n\n\t\t\t\t\t\tif (prec)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar frac = fval.match(/\\.\\d+/);\n\t\t\t\t\t\t\tif (frac)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfrac = frac[0];\n\t\t\t\t\t\t\t\t// Matched string includes the dot, so make it\n\t\t\t\t\t\t\t\t// prec+1 in length\n\t\t\t\t\t\t\t\tif (frac.length > prec+1)\n\t\t\t\t\t\t\t\t\tfrac = frac.substring(0, prec+1);\n\t\t\t\t\t\t\t\telse if(frac.length < prec+1)\n\t\t\t\t\t\t\t\t\tfrac += new Array(prec+1-frac.length+1).join('0');\n\n\t\t\t\t\t\t\t\tfval = fval.replace(/\\.\\d+/, frac);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (conv.match(/[fd]/))\n\t\t\t\t{\n\t\t\t\t\tif (fval >= 0)\n\t\t\t\t\t\tfval = poschar + fval;\n\n\t\t\t\t\tif (point !== '.')\n\t\t\t\t\t\tfval.replace(/\\./, point);\n\n\t\t\t\t\tif (thou)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar intpart = fval.match(/\\d+/)[0];\n\t\t\t\t\t\tintpart = new Array(2-(intpart.length+2)%3+1).join('0') + intpart;\n\t\t\t\t\t\tintpart = intpart.match(/.../g).join(thou).replace(/^0*[,.]?/,'');\n\t\t\t\t\t\tfval = fval.replace(/\\d+/, intpart);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (width && fval.length < width)\n\t\t\t\t\tfval = new Array(width - fval.length + 1).join(pad) + fval;\n\n\t\t\t\tres += fval;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tres += tok;\n\t\t}\n\t}\n\n\treturn res;\n}\n\nfunction AFMergeChange(event)\n{\n\treturn event.value;\n}\n\nfunction AFMakeNumber(str)\n{\n\tvar nums = str.match(/\\d+/g);\n\n\tif (!nums)\n\t\treturn null;\n\n\tvar res = nums.join('.');\n\n\tif (str.match(/^[^0-9]*\\./))\n\t\tres = '0.'+res;\n\n\treturn res * (str.match(/-/) ? -1.0 : 1.0);\n}\n\nfunction AFExtractTime(dt)\n{\n\tvar ampm = dt.match(/(am|pm)/);\n\tdt = dt.replace(/(am|pm)/, '');\n\tvar t = dt.match(/\\d{1,2}:\\d{1,2}:\\d{1,2}/);\n\tdt = dt.replace(/\\d{1,2}:\\d{1,2}:\\d{1,2}/, '');\n\tif (!t)\n\t{\n\t\tt = dt.match(/\\d{1,2}:\\d{1,2}/);\n\t\tdt = dt.replace(/\\d{1,2}:\\d{1,2}/, '');\n\t}\n\n\treturn [dt, t?t[0]+(ampm?ampm[0]:''):''];\n}\n\nfunction AFParseDateOrder(fmt)\n{\n\tvar i;\n\tvar order = '';\n\n\t// Ensure all present with those not added in default order\n\tfmt += \"mdy\";\n\n\tfor (i = 0; i < fmt.length; i++)\n\t{\n\t\tvar c = fmt.charAt(i);\n\n\t\tif ('ymd'.indexOf(c) !== -1 && order.indexOf(c) === -1)\n\t\t\torder += c;\n\t}\n\n\treturn order;\n}\n\nfunction AFMatchMonth(d)\n{\n\tvar m = d.match(MuPDF.monthPattern);\n\n\treturn m ? MuPDF.shortMonthName.indexOf(m[0]) : null;\n}\n\nfunction AFParseTime(str, d)\n{\n\tif (!str)\n\t\treturn d;\n\n\tif (!d)\n\t\td = new Date();\n\n\tvar ampm = str.match(/(am|pm)/);\n\tvar nums = str.match(/\\d+/g);\n\tvar hour, min, sec;\n\n\tif (!nums)\n\t\treturn null;\n\n\tsec = 0;\n\n\tswitch (nums.length)\n\t{\n\t\tcase 3:\n\t\t\tsec = parseInt(nums[2]);\n\t\tcase 2:\n\t\t\thour = parseInt(nums[0]);\n\t\t\tmin = parseInt(nums[1]);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\treturn null;\n\t}\n\n\tampm = ampm && ampm[0]\n\n\tif (ampm === 'am' && hour < 12)\n\t\thour = 12 + hour;\n\tif (ampm === 'pm' && hour >= 12)\n\t\thour = 0 + hour - 12;\n\n\td.setHours(hour, min, sec);\n\n\tif (d.getHours() !== hour || d.getMinutes() !== min || d.getSeconds() !== sec)\n\t\treturn null;\n\n\treturn d;\n}\n\nfunction AFParseDateEx(d, fmt)\n{\n\tvar i;\n\tvar dt = AFExtractTime(d);\n\tvar nums = dt[0].match(/\\d+/g);\n\tvar order = AFParseDateOrder(fmt);\n\tvar text_month = AFMatchMonth(dt[0]);\n\tvar dout = new Date();\n\tvar year = dout.getFullYear();\n\tvar month = dout.getMonth();\n\tvar date = dout.getDate();\n\n\tdout.setHours(12,0,0);\n\n\tif (!nums || nums.length < 1 || nums.length > 3)\n\t\treturn null;\n\n\tif (nums.length < 3 && text_month)\n\t{\n\t\t// Use the text month rather than one of the numbers\n\t\tmonth = text_month;\n\t\torder = order.replace('m','');\n\t}\n\n\torder = order.substring(0, nums.length);\n\n\t// If year and month specified but not date then use the 1st\n\tif (order === \"ym\" || (order === \"y\" && text_month))\n\t\tdate = 1;\n\n\tfor (i = 0; i < nums.length; i++)\n\t{\n\t\tswitch (order.charAt(i))\n\t\t{\n\t\t\tcase 'y': year = parseInt(nums[i]); break;\n\t\t\tcase 'm': month = parseInt(nums[i]) - 1; break;\n\t\t\tcase 'd': date = parseInt(nums[i]); break;\n\t\t}\n\t}\n\n\tif (year < 100)\n\t{\n\t\tif (fmt.search(\"yyyy\") !== -1)\n\t\t\treturn null;\n\n\t\tif (year >= 50)\n\t\t\tyear = 1900 + year;\n\t\telse if (year >= 0)\n\t\t\tyear = 2000 + year;\n\t}\n\n\tdout.setFullYear(year, month, date);\n\n\tif (dout.getFullYear() !== year || dout.getMonth() !== month || dout.getDate() !== date)\n\t\treturn null;\n\n\treturn AFParseTime(dt[1], dout);\n}\n\nfunction AFDate_KeystrokeEx(fmt)\n{\n\tif (event.willCommit && !AFParseDateEx(event.value, fmt))\n\t{\n\t\tapp.alert(\"The date/time entered (\"+event.value+\") does not match the format (\"+fmt+\") of the field [ \"+event.target.name+\" ]\");\n\t\tevent.rc = false;\n\t}\n}\n\nfunction AFDate_Keystroke(index)\n{\n\tvar formats = ['m/d','m/d/yy','mm/dd/yy','mm/yy','d-mmm','d-mmm-yy','dd-mm-yy','yy-mm-dd',\n\t\t\t\t'mmm-yy','mmmm-yy','mmm d, yyyy','mmmm d, yyyy','m/d/yy h:MM tt','m/d/yy HH:MM'];\n\tAFDate_KeystrokeEx(formats[index]);\n}\n\nfunction AFDate_FormatEx(fmt)\n{\n\tvar d = AFParseDateEx(event.value, fmt);\n\n\tevent.value = d ? util.printd(fmt, d) : \"\";\n}\n\nfunction AFDate_Format(index)\n{\n\tvar formats = ['m/d','m/d/yy','mm/dd/yy','mm/yy','d-mmm','d-mmm-yy','dd-mm-yy','yy-mm-dd',\n\t\t\t\t'mmm-yy','mmmm-yy','mmm d, yyyy','mmmm d, yyyy','m/d/yy h:MM tt','m/d/yy HH:MM'];\n\tAFDate_FormatEx(formats[index]);\n}\n\nfunction AFTime_Keystroke(index)\n{\n\tif (event.willCommit && !AFParseTime(event.value, null))\n\t{\n\t\tapp.alert(\"The value entered (\"+event.value+\") does not match the format of the field [ \"+event.target.name+\" ]\");\n\t\tevent.rc = false;\n\t}\n}\n\nfunction AFTime_FormatEx(fmt)\n{\n\tvar d = AFParseTime(event.value, null);\n\n\tevent.value = d ? util.printd(fmt, d) : '';\n}\n\nfunction AFTime_Format(index)\n{\n\tvar formats = ['HH:MM','h:MM tt','HH:MM:ss','h:MM:ss tt'];\n\n\tAFTime_FormatEx(formats[index]);\n}\n\nfunction AFSpecial_KeystrokeEx(fmt)\n{\n\tvar cs = '=';\n\tvar val = event.value;\n\tvar res = '';\n\tvar i = 0;\n\tvar m;\n\tvar length = fmt ? fmt.length : 0;\n\n\twhile (i < length)\n\t{\n\t\tswitch (fmt.charAt(i))\n\t\t{\n\t\t\tcase '\\\\':\n\t\t\t\ti++;\n\t\t\t\tif (i >= length)\n\t\t\t\t\tbreak;\n\t\t\t\tres += fmt.charAt(i);\n\t\t\t\tif (val && val.charAt(0) === fmt.charAt(i))\n\t\t\t\t\tval = val.substring(1);\n\t\t\t\tbreak;\n\n\t\t\tcase 'X':\n\t\t\t\tm = val.match(/^\\w/);\n\t\t\t\tif (!m)\n\t\t\t\t{\n\t\t\t\t\tevent.rc = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tres += MuPDF.convertCase(m[0],cs);\n\t\t\t\tval = val.substring(1);\n\t\t\t\tbreak;\n\n\t\t\tcase 'A':\n\t\t\t\tm = val.match(/^[A-Za-z]/);\n\t\t\t\tif (!m)\n\t\t\t\t{\n\t\t\t\t\tevent.rc = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tres += MuPDF.convertCase(m[0],cs);\n\t\t\t\tval = val.substring(1);\n\t\t\t\tbreak;\n\n\t\t\tcase '9':\n\t\t\t\tm = val.match(/^\\d/);\n\t\t\t\tif (!m)\n\t\t\t\t{\n\t\t\t\t\tevent.rc = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tres += m[0];\n\t\t\t\tval = val.substring(1);\n\t\t\t\tbreak;\n\n\t\t\tcase '*':\n\t\t\t\tres += val;\n\t\t\t\tval = '';\n\t\t\t\tbreak;\n\n\t\t\tcase '?':\n\t\t\t\tif (!val)\n\t\t\t\t{\n\t\t\t\t\tevent.rc = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tres += MuPDF.convertCase(val.charAt(0),cs);\n\t\t\t\tval = val.substring(1);\n\t\t\t\tbreak;\n\n\t\t\tcase '=':\n\t\t\tcase '>':\n\t\t\tcase '<':\n\t\t\t\tcs = fmt.charAt(i);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tres += fmt.charAt(i);\n\t\t\t\tif (val && val.charAt(0) === fmt.charAt(i))\n\t\t\t\t\tval = val.substring(1);\n\t\t\t\tbreak;\n\t\t}\n\n\t\ti++;\n\t}\n\n\tif (event.rc)\n\t\tevent.value = res;\n\telse if (event.willCommit)\n\t\tapp.alert(\"The value entered (\"+event.value+\") does not match the format of the field [ \"+event.target.name+\" ] should be \"+fmt);\n}\n\nfunction AFSpecial_Keystroke(index)\n{\n\tif (event.willCommit)\n\t{\n\t\tswitch (index)\n\t\t{\n\t\t\tcase 0:\n\t\t\t\tif (!event.value.match(/^\\d{5}$/))\n\t\t\t\t\tevent.rc = false;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tif (!event.value.match(/^\\d{5}[-. ]?\\d{4}$/))\n\t\t\t\t\tevent.rc = false;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif (!event.value.match(/^((\\(\\d{3}\\)|\\d{3})[-. ]?)?\\d{3}[-. ]?\\d{4}$/))\n\t\t\t\t\tevent.rc = false;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tif (!event.value.match(/^\\d{3}[-. ]?\\d{2}[-. ]?\\d{4}$/))\n\t\t\t\t\tevent.rc = false;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (!event.rc)\n\t\t\tapp.alert(\"The value entered (\"+event.value+\") does not match the format of the field [ \"+event.target.name+\" ]\");\n\t}\n}\n\nfunction AFSpecial_Format(index)\n{\n\tvar res;\n\n\tswitch (index)\n\t{\n\t\tcase 0:\n\t\t\tres = util.printx('99999', event.value);\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tres = util.printx('99999-9999', event.value);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tres = util.printx('9999999999', event.value);\n\t\t\tres = util.printx(res.length >= 10 ? '(999) 999-9999' : '999-9999', event.value);\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tres = util.printx('999-99-9999', event.value);\n\t\t\tbreak;\n\t}\n\n\tevent.value = res ? res : '';\n}\n\nfunction AFNumber_Keystroke(nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend)\n{\n\tif (sepStyle & 2)\n\t{\n\t\tif (!event.value.match(/^[+-]?\\d*[,.]?\\d*$/))\n\t\t\tevent.rc = false;\n\t}\n\telse\n\t{\n\t\tif (!event.value.match(/^[+-]?\\d*\\.?\\d*$/))\n\t\t\tevent.rc = false;\n\t}\n\n\tif (event.willCommit)\n\t{\n\t\tif (!event.value.match(/\\d/))\n\t\t\tevent.rc = false;\n\n\t\tif (!event.rc)\n\t\t\tapp.alert(\"The value entered (\"+event.value+\") does not match the format of the field [ \"+event.target.name+\" ]\");\n\t}\n}\n\nfunction AFNumber_Format(nDec,sepStyle,negStyle,currStyle,strCurrency,bCurrencyPrepend)\n{\n\tvar val = event.value;\n\tvar fracpart;\n\tvar intpart;\n\tvar point = sepStyle&2 ? ',' : '.';\n\tvar separator = sepStyle&2 ? '.' : ',';\n\n\tif (/^\\D*\\./.test(val))\n\t\tval = '0'+val;\n\n\tvar groups = val.match(/\\d+/g);\n\n\tif (!groups)\n\t\treturn;\n\n\tswitch (groups.length)\n\t{\n\t\tcase 0:\n\t\t\treturn;\n\t\tcase 1:\n\t\t\tfracpart = '';\n\t\t\tintpart = groups[0];\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tfracpart = groups.pop();\n\t\t\tintpart = groups.join('');\n\t\t\tbreak;\n\t}\n\n\t// Remove leading zeros\n\tintpart = intpart.replace(/^0*/,'');\n\tif (!intpart)\n\t\tintpart = '0';\n\n\tif ((sepStyle & 1) === 0)\n\t{\n\t\t// Add the thousands sepearators: pad to length multiple of 3 with zeros,\n\t\t// split into 3s, join with separator, and remove the leading zeros\n\t\tintpart = new Array(2-(intpart.length+2)%3+1).join('0') + intpart;\n\t\tintpart = intpart.match(/.../g).join(separator).replace(/^0*/,'');\n\t}\n\n\tif (!intpart)\n\t\tintpart = '0';\n\n\t// Adjust fractional part to correct number of decimal places\n\tfracpart += new Array(nDec+1).join('0');\n\tfracpart = fracpart.substring(0,nDec);\n\n\tif (fracpart)\n\t\tintpart += point+fracpart;\n\n\tif (bCurrencyPrepend)\n\t\tintpart = strCurrency+intpart;\n\telse\n\t\tintpart += strCurrency;\n\n\tif (/-/.test(val))\n\t{\n\t\tswitch (negStyle)\n\t\t{\n\t\t\tcase 0:\n\t\t\t\tintpart = '-'+intpart;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\tcase 3:\n\t\t\t\tintpart = '('+intpart+')';\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (negStyle&1)\n\t\tevent.target.textColor = /-/.test(val) ? color.red : color.black;\n\n\tevent.value = intpart;\n}\n\nfunction AFPercent_Keystroke(nDec, sepStyle)\n{\n\tAFNumber_Keystroke(nDec, sepStyle, 0, 0, \"\", true);\n}\n\nfunction AFPercent_Format(nDec, sepStyle)\n{\n\tvar val = AFMakeNumber(event.value);\n\n\tif (!val)\n\t{\n\t\tevent.value = '';\n\t\treturn;\n\t}\n\n\tevent.value = (val * 100) + '';\n\n\tAFNumber_Format(nDec, sepStyle, 0, 0, \"%\", false);\n}\n\nfunction AFSimple_Calculate(op, list)\n{\n\tvar i, res;\n\n\tswitch (op)\n\t{\n\t\tcase 'SUM':\n\t\t\tres = 0;\n\t\t\tbreak;\n\t\tcase 'PRD':\n\t\t\tres = 1;\n\t\t\tbreak;\n\t\tcase 'AVG':\n\t\t\tres = 0;\n\t\t\tbreak;\n\t}\n\n\tif (typeof list === 'string')\n\t\tlist = list.split(/ *, */);\n\n\tfor (i = 0; i < list.length; i++)\n\t{\n\t\tvar field = getField(list[i]);\n\t\tvar value = Number(field.value);\n\n\t\tswitch (op)\n\t\t{\n\t\t\tcase 'SUM':\n\t\t\t\tres += value;\n\t\t\t\tbreak;\n\t\t\tcase 'PRD':\n\t\t\t\tres *= value;\n\t\t\t\tbreak;\n\t\t\tcase 'AVG':\n\t\t\t\tres += value;\n\t\t\t\tbreak;\n\t\t\tcase 'MIN':\n\t\t\t\tif (i === 0 || value < res)\n\t\t\t\t\tres = value;\n\t\t\t\tbreak;\n\t\t\tcase 'MAX':\n\t\t\t\tif (i === 0 || value > res)\n\t\t\t\t\tres = value;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (op === 'AVG')\n\t\tres /= list.length;\n\n\tevent.value = res;\n}\n\nfunction AFRange_Validate(lowerCheck, lowerLimit, upperCheck, upperLimit)\n{\n\tif (upperCheck && event.value > upperLimit)\n\t{\n\t\tevent.rc = false;\n\t}\n\n\tif (lowerCheck && event.value < lowerLimit)\n\t{\n\t\tevent.rc = false;\n\t}\n\n\tif (!event.rc)\n\t{\n\t\tif (lowerCheck && upperCheck)\n\t\t\tapp.alert(util.printf(\"The entered value (\"+event.value+\") must be greater than or equal to %s and less than or equal to %s\", lowerLimit, upperLimit));\n\t\telse if (lowerCheck)\n\t\t\tapp.alert(util.printf(\"The entered value (\"+event.value+\") must be greater than or equal to %s\", lowerLimit));\n\t\telse\n\t\t\tapp.alert(util.printf(\"The entered value (\"+event.value+\") must be less than or equal to %s\", upperLimit));\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-annot-edit.c",
    "content": "#include \"mupdf/pdf.h\"\n\n#define TEXT_ANNOT_SIZE (25.0)\n\nstatic const char *annot_type_str(fz_annot_type type)\n{\n\tswitch (type)\n\t{\n\tcase FZ_ANNOT_TEXT: return \"Text\";\n\tcase FZ_ANNOT_LINK: return \"Link\";\n\tcase FZ_ANNOT_FREETEXT: return \"FreeText\";\n\tcase FZ_ANNOT_LINE: return \"Line\";\n\tcase FZ_ANNOT_SQUARE: return \"Square\";\n\tcase FZ_ANNOT_CIRCLE: return \"Circle\";\n\tcase FZ_ANNOT_POLYGON: return \"Polygon\";\n\tcase FZ_ANNOT_POLYLINE: return \"PolyLine\";\n\tcase FZ_ANNOT_HIGHLIGHT: return \"Highlight\";\n\tcase FZ_ANNOT_UNDERLINE: return \"Underline\";\n\tcase FZ_ANNOT_SQUIGGLY: return \"Squiggly\";\n\tcase FZ_ANNOT_STRIKEOUT: return \"StrikeOut\";\n\tcase FZ_ANNOT_STAMP: return \"Stamp\";\n\tcase FZ_ANNOT_CARET: return \"Caret\";\n\tcase FZ_ANNOT_INK: return \"Ink\";\n\tcase FZ_ANNOT_POPUP: return \"Popup\";\n\tcase FZ_ANNOT_FILEATTACHMENT: return \"FileAttachment\";\n\tcase FZ_ANNOT_SOUND: return \"Sound\";\n\tcase FZ_ANNOT_MOVIE: return \"Movie\";\n\tcase FZ_ANNOT_WIDGET: return \"Widget\";\n\tcase FZ_ANNOT_SCREEN: return \"Screen\";\n\tcase FZ_ANNOT_PRINTERMARK: return \"PrinterMark\";\n\tcase FZ_ANNOT_TRAPNET: return \"TrapNet\";\n\tcase FZ_ANNOT_WATERMARK: return \"Watermark\";\n\tcase FZ_ANNOT_3D: return \"3D\";\n\tdefault: return \"\";\n\t}\n}\n\nvoid\npdf_update_annot(pdf_document *doc, pdf_annot *annot)\n{\n\t/* SumatraPDF: prevent regressions */\n#if 0\n\tpdf_obj *obj, *ap, *as, *n;\n\tfz_context *ctx = doc->ctx;\n\n\tif (doc->update_appearance)\n\t\tdoc->update_appearance(doc, annot);\n\n\tobj = annot->obj;\n\n\tap = pdf_dict_gets(obj, \"AP\");\n\tas = pdf_dict_gets(obj, \"AS\");\n\n\tif (pdf_is_dict(ap))\n\t{\n\t\tpdf_hotspot *hp = &doc->hotspot;\n\n\t\tn = NULL;\n\n\t\tif (hp->num == pdf_to_num(obj)\n\t\t\t&& hp->gen == pdf_to_gen(obj)\n\t\t\t&& (hp->state & HOTSPOT_POINTER_DOWN))\n\t\t{\n\t\t\tn = pdf_dict_gets(ap, \"D\"); /* down state */\n\t\t}\n\n\t\tif (n == NULL)\n\t\t\tn = pdf_dict_gets(ap, \"N\"); /* normal state */\n\n\t\t/* lookup current state in sub-dictionary */\n\t\tif (!pdf_is_stream(doc, pdf_to_num(n), pdf_to_gen(n)))\n\t\t\tn = pdf_dict_get(n, as);\n\n\t\tpdf_drop_xobject(ctx, annot->ap);\n\t\tannot->ap = NULL;\n\n\t\tif (pdf_is_stream(doc, pdf_to_num(n), pdf_to_gen(n)))\n\t\t{\n\t\t\tfz_try(ctx)\n\t\t\t{\n\t\t\t\tannot->ap = pdf_load_xobject(doc, n);\n\t\t\t\tpdf_transform_annot(annot);\n\t\t\t\tannot->ap_iteration = annot->ap->iteration;\n\t\t\t}\n\t\t\tfz_catch(ctx)\n\t\t\t{\n\t\t\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\t\t\tfz_warn(ctx, \"ignoring broken annotation\");\n\t\t\t}\n\t\t}\n\t}\n#endif\n}\n\npdf_annot *\npdf_create_annot(pdf_document *doc, pdf_page *page, fz_annot_type type)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_annot *annot = NULL;\n\tpdf_obj *annot_obj = pdf_new_dict(doc, 0);\n\tpdf_obj *ind_obj = NULL;\n\n\tfz_var(annot);\n\tfz_var(ind_obj);\n\tfz_try(ctx)\n\t{\n\t\tint ind_obj_num;\n\t\tfz_rect rect = {0.0, 0.0, 0.0, 0.0};\n\t\tconst char *type_str = annot_type_str(type);\n\t\tpdf_obj *annot_arr = pdf_dict_gets(page->me, \"Annots\");\n\t\tif (annot_arr == NULL)\n\t\t{\n\t\t\tannot_arr = pdf_new_array(doc, 0);\n\t\t\tpdf_dict_puts_drop(page->me, \"Annots\", annot_arr);\n\t\t}\n\n\t\tpdf_dict_puts_drop(annot_obj, \"Type\", pdf_new_name(doc, \"Annot\"));\n\n\t\tpdf_dict_puts_drop(annot_obj, \"Subtype\", pdf_new_name(doc, type_str));\n\t\tpdf_dict_puts_drop(annot_obj, \"Rect\", pdf_new_rect(doc, &rect));\n\n\t\t/* Make printable as default */\n\t\tpdf_dict_puts_drop(annot_obj, \"F\", pdf_new_int(doc, F_Print));\n\n\t\tannot = fz_malloc_struct(ctx, pdf_annot);\n\t\tannot->page = page;\n\t\tannot->rect = rect;\n\t\tannot->pagerect = rect;\n\t\tannot->ap = NULL;\n\t\tannot->widget_type = PDF_WIDGET_TYPE_NOT_WIDGET;\n\t\tannot->annot_type = type;\n\n\t\t/*\n\t\t\tBoth annotation object and annotation structure are now created.\n\t\t\tInsert the object in the hierarchy and the structure in the\n\t\t\tpage's array.\n\t\t*/\n\t\tind_obj_num = pdf_create_object(doc);\n\t\tpdf_update_object(doc, ind_obj_num, annot_obj);\n\t\tind_obj = pdf_new_indirect(doc, ind_obj_num, 0);\n\t\tpdf_array_push(annot_arr, ind_obj);\n\t\tannot->obj = pdf_keep_obj(ind_obj);\n\n\t\t/*\n\t\t\tLinking must be done after any call that might throw because\n\t\t\tpdf_free_annot below actually frees a list. Put the new annot\n\t\t\tat the end of the list, so that it will be drawn last.\n\t\t*/\n\t\t*page->annot_tailp = annot;\n\t\tpage->annot_tailp = &annot->next;\n\n\t\tdoc->dirty = 1;\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(annot_obj);\n\t\tpdf_drop_obj(ind_obj);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_free_annot(ctx, annot);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn annot;\n}\n\nvoid\npdf_delete_annot(pdf_document *doc, pdf_page *page, pdf_annot *annot)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_annot **annotptr;\n\tpdf_obj *old_annot_arr;\n\tpdf_obj *annot_arr;\n\n\tif (annot == NULL)\n\t\treturn;\n\n\t/* Remove annot from page's list */\n\tfor (annotptr = &page->annots; *annotptr; annotptr = &(*annotptr)->next)\n\t{\n\t\tif (*annotptr == annot)\n\t\t\tbreak;\n\t}\n\n\t/* Check the passed annotation was of this page */\n\tif (*annotptr == NULL)\n\t\treturn;\n\n\t*annotptr = annot->next;\n\t/* If the removed annotation was the last in the list adjust the end pointer */\n\tif (*annotptr == NULL)\n\t\tpage->annot_tailp = annotptr;\n\n\t/* Stick it in the deleted list */\n\tannot->next = page->deleted_annots;\n\tpage->deleted_annots = annot;\n\n\tpdf_drop_xobject(ctx, annot->ap);\n\tannot->ap = NULL;\n\n\t/* Recreate the \"Annots\" array with this annot removed */\n\told_annot_arr = pdf_dict_gets(page->me, \"Annots\");\n\n\tif (old_annot_arr)\n\t{\n\t\tint i, n = pdf_array_len(old_annot_arr);\n\t\tannot_arr = pdf_new_array(doc, n?(n-1):0);\n\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tfor (i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\tpdf_obj *obj = pdf_array_get(old_annot_arr, i);\n\n\t\t\t\tif (obj != annot->obj)\n\t\t\t\t\tpdf_array_push(annot_arr, obj);\n\t\t\t}\n\n\t\t\tif (pdf_is_indirect(old_annot_arr))\n\t\t\t\tpdf_update_object(doc, pdf_to_num(old_annot_arr), annot_arr);\n\t\t\telse\n\t\t\t\tpdf_dict_puts(page->me, \"Annots\", annot_arr);\n\n\t\t\tif (pdf_is_indirect(annot->obj))\n\t\t\t\tpdf_delete_object(doc, pdf_to_num(annot->obj));\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tpdf_drop_obj(annot_arr);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t}\n\n\tpdf_drop_obj(annot->obj);\n\tannot->obj = NULL;\n\tdoc->dirty = 1;\n}\n\nvoid\npdf_set_markup_annot_quadpoints(pdf_document *doc, pdf_annot *annot, fz_point *qp, int n)\n{\n\tfz_matrix ctm;\n\tpdf_obj *arr = pdf_new_array(doc, n*2);\n\tint i;\n\n\tfz_invert_matrix(&ctm, &annot->page->ctm);\n\n\tpdf_dict_puts_drop(annot->obj, \"QuadPoints\", arr);\n\n\tfor (i = 0; i < n; i++)\n\t{\n\t\tfz_point pt = qp[i];\n\t\tpdf_obj *r;\n\n\t\tfz_transform_point(&pt, &ctm);\n\t\tr = pdf_new_real(doc, pt.x);\n\t\tpdf_array_push_drop(arr, r);\n\t\tr = pdf_new_real(doc, pt.y);\n\t\tpdf_array_push_drop(arr, r);\n\t}\n}\n\nstatic void update_rect(fz_context *ctx, pdf_annot *annot)\n{\n\tpdf_to_rect(ctx, pdf_dict_gets(annot->obj, \"Rect\"), &annot->rect);\n\tannot->pagerect = annot->rect;\n\tfz_transform_rect(&annot->pagerect, &annot->page->ctm);\n}\n\nvoid\npdf_set_ink_annot_list(pdf_document *doc, pdf_annot *annot, fz_point *pts, int *counts, int ncount, float color[3], float thickness)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_matrix ctm;\n\tpdf_obj *list = pdf_new_array(doc, ncount);\n\tpdf_obj *bs, *col;\n\tfz_rect rect;\n\tint i, k = 0;\n\n\tfz_invert_matrix(&ctm, &annot->page->ctm);\n\n\tpdf_dict_puts_drop(annot->obj, \"InkList\", list);\n\n\tfor (i = 0; i < ncount; i++)\n\t{\n\t\tint j;\n\t\tpdf_obj *arc = pdf_new_array(doc, counts[i]);\n\n\t\tpdf_array_push_drop(list, arc);\n\n\t\tfor (j = 0; j < counts[i]; j++)\n\t\t{\n\t\t\tfz_point pt = pts[k];\n\n\t\t\tfz_transform_point(&pt, &ctm);\n\n\t\t\tif (i == 0 && j == 0)\n\t\t\t{\n\t\t\t\trect.x0 = rect.x1 = pt.x;\n\t\t\t\trect.y0 = rect.y1 = pt.y;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfz_include_point_in_rect(&rect, &pt);\n\t\t\t}\n\n\t\t\tpdf_array_push_drop(arc, pdf_new_real(doc, pt.x));\n\t\t\tpdf_array_push_drop(arc, pdf_new_real(doc, pt.y));\n\t\t\tk++;\n\t\t}\n\t}\n\n\t/*\n\t\tExpand the rectangle by thickness all around. We cannot use\n\t\tfz_expand_rect because the rectangle might be empty in the\n\t\tsingle point case\n\t*/\n\tif (k > 0)\n\t{\n\t\trect.x0 -= thickness;\n\t\trect.y0 -= thickness;\n\t\trect.x1 += thickness;\n\t\trect.y1 += thickness;\n\t}\n\n\tpdf_dict_puts_drop(annot->obj, \"Rect\", pdf_new_rect(doc, &rect));\n\tupdate_rect(ctx, annot);\n\n\tbs = pdf_new_dict(doc, 1);\n\tpdf_dict_puts_drop(annot->obj, \"BS\", bs);\n\tpdf_dict_puts_drop(bs, \"W\", pdf_new_real(doc, thickness));\n\n\tcol = pdf_new_array(doc, 3);\n\tpdf_dict_puts_drop(annot->obj, \"C\", col);\n\tfor (i = 0; i < 3; i++)\n\t\tpdf_array_push_drop(col, pdf_new_real(doc, color[i]));\n}\n\nstatic void find_free_font_name(pdf_obj *fdict, char *buf, int buf_size)\n{\n\tint i;\n\n\t/* Find a number X such that /FX doesn't occur as a key in fdict */\n\tfor (i = 0; 1; i++)\n\t{\n\t\tsnprintf(buf, buf_size, \"F%d\", i);\n\n\t\tif (!pdf_dict_gets(fdict, buf))\n\t\t\tbreak;\n\t}\n}\n\nvoid pdf_set_text_annot_position(pdf_document *doc, pdf_annot *annot, fz_point pt)\n{\n\tfz_matrix ctm;\n\tfz_rect rect;\n\tint flags;\n\n\tfz_invert_matrix(&ctm, &annot->page->ctm);\n\trect.x0 = pt.x;\n\trect.x1 = pt.x + TEXT_ANNOT_SIZE;\n\trect.y0 = pt.y;\n\trect.y1 = pt.y + TEXT_ANNOT_SIZE;\n\tfz_transform_rect(&rect, &ctm);\n\n\tpdf_dict_puts_drop(annot->obj, \"Rect\", pdf_new_rect(doc, &rect));\n\n\tflags = pdf_to_int(pdf_dict_gets(annot->obj, \"F\"));\n\tflags |= (F_NoZoom|F_NoRotate);\n\tpdf_dict_puts_drop(annot->obj, \"F\", pdf_new_int(doc, flags));\n\n\tupdate_rect(doc->ctx, annot);\n}\n\nvoid pdf_set_annot_contents(pdf_document *doc, pdf_annot *annot, char *text)\n{\n\tpdf_dict_puts_drop(annot->obj, \"Contents\", pdf_new_string(doc, text, strlen(text)));\n}\n\nchar *pdf_annot_contents(pdf_document *doc, pdf_annot *annot)\n{\n\treturn pdf_to_str_buf(pdf_dict_getp(annot->obj, \"Contents\"));\n}\n\nvoid pdf_set_free_text_details(pdf_document *doc, pdf_annot *annot, fz_point *pos, char *text, char *font_name, float font_size, float color[3])\n{\n\tfz_context *ctx = doc->ctx;\n\tchar nbuf[32];\n\tpdf_obj *dr;\n\tpdf_obj *form_fonts;\n\tpdf_obj *font = NULL;\n\tpdf_obj *ref;\n\tpdf_font_desc *font_desc = NULL;\n\tpdf_da_info da_info;\n\tfz_buffer *fzbuf = NULL;\n\tfz_matrix ctm;\n\tfz_point page_pos;\n\n\tfz_invert_matrix(&ctm, &annot->page->ctm);\n\n\tdr = pdf_dict_gets(annot->page->me, \"Resources\");\n\tif (!dr)\n\t{\n\t\tdr = pdf_new_dict(doc, 1);\n\t\tpdf_dict_putp_drop(annot->page->me, \"Resources\", dr);\n\t}\n\n\t/* Ensure the resource dictionary includes a font dict */\n\tform_fonts = pdf_dict_gets(dr, \"Font\");\n\tif (!form_fonts)\n\t{\n\t\tform_fonts = pdf_new_dict(doc, 1);\n\t\tpdf_dict_puts_drop(dr, \"Font\", form_fonts);\n\t\t/* form_fonts is still valid if execution continues past the above call */\n\t}\n\n\tfz_var(fzbuf);\n\tfz_var(font);\n\tfz_try(ctx)\n\t{\n\t\tunsigned char *da_str;\n\t\tint da_len;\n\t\tfz_rect bounds;\n\n\t\tfind_free_font_name(form_fonts, nbuf, sizeof(nbuf));\n\n\t\tfont = pdf_new_dict(doc, 5);\n\t\tref = pdf_new_ref(doc, font);\n\t\tpdf_dict_puts_drop(form_fonts, nbuf, ref);\n\n\t\tpdf_dict_puts_drop(font, \"Type\", pdf_new_name(doc, \"Font\"));\n\t\tpdf_dict_puts_drop(font, \"Subtype\", pdf_new_name(doc, \"Type1\"));\n\t\tpdf_dict_puts_drop(font, \"BaseFont\", pdf_new_name(doc, font_name));\n\t\tpdf_dict_puts_drop(font, \"Encoding\", pdf_new_name(doc, \"WinAnsiEncoding\"));\n\n\t\tmemcpy(da_info.col, color, sizeof(float)*3);\n\t\tda_info.col_size = 3;\n\t\tda_info.font_name = nbuf;\n\t\tda_info.font_size = font_size;\n\n\t\tfzbuf = fz_new_buffer(ctx, 0);\n\t\tpdf_fzbuf_print_da(ctx, fzbuf, &da_info);\n\n\t\tda_len = fz_buffer_storage(ctx, fzbuf, &da_str);\n\t\tpdf_dict_puts_drop(annot->obj, \"DA\", pdf_new_string(doc, (char *)da_str, da_len));\n\n\t\t/* FIXME: should convert to WinAnsiEncoding */\n\t\tpdf_dict_puts_drop(annot->obj, \"Contents\", pdf_new_string(doc, text, strlen(text)));\n\n\t\tfont_desc = pdf_load_font(doc, NULL, font, 0);\n\t\tpdf_measure_text(ctx, font_desc, (unsigned char *)text, strlen(text), &bounds);\n\n\t\tpage_pos = *pos;\n\t\tfz_transform_point(&page_pos, &ctm);\n\n\t\tbounds.x0 *= font_size;\n\t\tbounds.x1 *= font_size;\n\t\tbounds.y0 *= font_size;\n\t\tbounds.y1 *= font_size;\n\n\t\tbounds.x0 += page_pos.x;\n\t\tbounds.x1 += page_pos.x;\n\t\tbounds.y0 += page_pos.y;\n\t\tbounds.y1 += page_pos.y;\n\n\t\tpdf_dict_puts_drop(annot->obj, \"Rect\", pdf_new_rect(doc, &bounds));\n\t\tupdate_rect(ctx, annot);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(font);\n\t\tfz_drop_buffer(ctx, fzbuf);\n\t\tpdf_drop_font(ctx, font_desc);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-annot.c",
    "content": "#include \"mupdf/pdf.h\"\n\nstatic pdf_obj *\nresolve_dest_rec(pdf_document *doc, pdf_obj *dest, fz_link_kind kind, int depth)\n{\n\tif (depth > 10) /* Arbitrary to avoid infinite recursion */\n\t\treturn NULL;\n\n\tif (pdf_is_name(dest) || pdf_is_string(dest))\n\t{\n\t\tif (kind == FZ_LINK_GOTO)\n\t\t{\n\t\t\tdest = pdf_lookup_dest(doc, dest);\n\t\t\tdest = resolve_dest_rec(doc, dest, kind, depth+1);\n\t\t}\n\n\t\treturn dest;\n\t}\n\n\telse if (pdf_is_array(dest))\n\t{\n\t\treturn dest;\n\t}\n\n\telse if (pdf_is_dict(dest))\n\t{\n\t\tdest = pdf_dict_gets(dest, \"D\");\n\t\treturn resolve_dest_rec(doc, dest, kind, depth+1);\n\t}\n\n\telse if (pdf_is_indirect(dest))\n\t\treturn dest;\n\n\treturn NULL;\n}\n\nstatic pdf_obj *\nresolve_dest(pdf_document *doc, pdf_obj *dest, fz_link_kind kind)\n{\n\treturn resolve_dest_rec(doc, dest, kind, 0);\n}\n\nfz_link_dest\npdf_parse_link_dest(pdf_document *doc, fz_link_kind kind, pdf_obj *dest)\n{\n\tfz_link_dest ld;\n\tpdf_obj *obj;\n\n\tint l_from_2 = 0;\n\tint b_from_3 = 0;\n\tint r_from_4 = 0;\n\tint t_from_5 = 0;\n\tint t_from_3 = 0;\n\tint t_from_2 = 0;\n\tint z_from_4 = 0;\n\n\tld.kind = kind;\n\tld.ld.gotor.flags = 0;\n\tld.ld.gotor.lt.x = 0;\n\tld.ld.gotor.lt.y = 0;\n\tld.ld.gotor.rb.x = 0;\n\tld.ld.gotor.rb.y = 0;\n\tld.ld.gotor.page = -1;\n\tld.ld.gotor.dest = NULL;\n\n\tdest = resolve_dest(doc, dest, kind);\n\tif (dest == NULL)\n\t{\n\t\tfz_warn(doc->ctx, \"undefined link destination\");\n\t\treturn ld;\n\t}\n\n\tif (pdf_is_name(dest))\n\t{\n\t\t/* SumatraPDF: expose dest as UTF-8 string */\n\t\tld.ld.gotor.dest = fz_strdup(doc->ctx, pdf_to_name(dest));\n\t\treturn ld;\n\t}\n\telse if (pdf_is_string(dest))\n\t{\n\t\t/* SumatraPDF: expose dest as UTF-8 string */\n\t\tld.ld.gotor.dest = pdf_to_utf8(doc, dest);\n\t\treturn ld;\n\t}\n\n\tobj = pdf_array_get(dest, 0);\n\tif (pdf_is_int(obj))\n\t\tld.ld.gotor.page = pdf_to_int(obj);\n\telse\n\t{\n\t\tfz_try(doc->ctx)\n\t\t{\n\t\t\tld.ld.gotor.page = pdf_lookup_page_number(doc, obj);\n\t\t}\n\t\tfz_catch(doc->ctx)\n\t\t{\n\t\t\tld.kind = FZ_LINK_NONE;\n\t\t\treturn ld;\n\t\t}\n\t}\n\n\tobj = pdf_array_get(dest, 1);\n\tif (!pdf_is_name(obj))\n\t\treturn ld;\n\n\tif (!strcmp(\"XYZ\", pdf_to_name(obj)))\n\t{\n\t\tl_from_2 = t_from_3 = z_from_4 = 1;\n\t\tld.ld.gotor.flags |= fz_link_flag_r_is_zoom;\n\t}\n\telse if ((!strcmp(\"Fit\", pdf_to_name(obj))) || (!strcmp(\"FitB\", pdf_to_name(obj))))\n\t{\n\t\tld.ld.gotor.flags |= fz_link_flag_fit_h;\n\t\tld.ld.gotor.flags |= fz_link_flag_fit_v;\n\t}\n\telse if ((!strcmp(\"FitH\", pdf_to_name(obj))) || (!strcmp(\"FitBH\", pdf_to_name(obj))))\n\t{\n\t\tt_from_2 = 1;\n\t\tld.ld.gotor.flags |= fz_link_flag_fit_h;\n\t}\n\telse if ((!strcmp(\"FitV\", pdf_to_name(obj))) || (!strcmp(\"FitBV\", pdf_to_name(obj))))\n\t{\n\t\tl_from_2 = 1;\n\t\tld.ld.gotor.flags |= fz_link_flag_fit_v;\n\t}\n\telse if (!strcmp(\"FitR\", pdf_to_name(obj)))\n\t{\n\t\tl_from_2 = b_from_3 = r_from_4 = t_from_5 = 1;\n\t\tld.ld.gotor.flags |= fz_link_flag_fit_h;\n\t\tld.ld.gotor.flags |= fz_link_flag_fit_v;\n\t}\n\n\tif (l_from_2)\n\t{\n\t\tobj = pdf_array_get(dest, 2);\n\t\tif (pdf_is_int(obj))\n\t\t{\n\t\t\tld.ld.gotor.flags |= fz_link_flag_l_valid;\n\t\t\tld.ld.gotor.lt.x = pdf_to_int(obj);\n\t\t}\n\t\telse if (pdf_is_real(obj))\n\t\t{\n\t\t\tld.ld.gotor.flags |= fz_link_flag_l_valid;\n\t\t\tld.ld.gotor.lt.x = pdf_to_real(obj);\n\t\t}\n\t}\n\tif (b_from_3)\n\t{\n\t\tobj = pdf_array_get(dest, 3);\n\t\tif (pdf_is_int(obj))\n\t\t{\n\t\t\tld.ld.gotor.flags |= fz_link_flag_b_valid;\n\t\t\tld.ld.gotor.rb.y = pdf_to_int(obj);\n\t\t}\n\t\telse if (pdf_is_real(obj))\n\t\t{\n\t\t\tld.ld.gotor.flags |= fz_link_flag_b_valid;\n\t\t\tld.ld.gotor.rb.y = pdf_to_real(obj);\n\t\t}\n\t}\n\tif (r_from_4)\n\t{\n\t\tobj = pdf_array_get(dest, 4);\n\t\tif (pdf_is_int(obj))\n\t\t{\n\t\t\tld.ld.gotor.flags |= fz_link_flag_r_valid;\n\t\t\tld.ld.gotor.rb.x = pdf_to_int(obj);\n\t\t}\n\t\telse if (pdf_is_real(obj))\n\t\t{\n\t\t\tld.ld.gotor.flags |= fz_link_flag_r_valid;\n\t\t\tld.ld.gotor.rb.x = pdf_to_real(obj);\n\t\t}\n\t}\n\tif (t_from_5 || t_from_3 || t_from_2)\n\t{\n\t\tif (t_from_5)\n\t\t\tobj = pdf_array_get(dest, 5);\n\t\telse if (t_from_3)\n\t\t\tobj = pdf_array_get(dest, 3);\n\t\telse\n\t\t\tobj = pdf_array_get(dest, 2);\n\t\tif (pdf_is_int(obj))\n\t\t{\n\t\t\tld.ld.gotor.flags |= fz_link_flag_t_valid;\n\t\t\tld.ld.gotor.lt.y = pdf_to_int(obj);\n\t\t}\n\t\telse if (pdf_is_real(obj))\n\t\t{\n\t\t\tld.ld.gotor.flags |= fz_link_flag_t_valid;\n\t\t\tld.ld.gotor.lt.y = pdf_to_real(obj);\n\t\t}\n\t}\n\tif (z_from_4)\n\t{\n\t\tobj = pdf_array_get(dest, 4);\n\t\tif (pdf_is_int(obj))\n\t\t{\n\t\t\tld.ld.gotor.flags |= fz_link_flag_r_valid;\n\t\t\tld.ld.gotor.rb.x = pdf_to_int(obj);\n\t\t}\n\t\telse if (pdf_is_real(obj))\n\t\t{\n\t\t\tld.ld.gotor.flags |= fz_link_flag_r_valid;\n\t\t\tld.ld.gotor.rb.x = pdf_to_real(obj);\n\t\t}\n\t}\n\n\t/* Duplicate the values out for the sake of stupid clients */\n\tif ((ld.ld.gotor.flags & (fz_link_flag_l_valid | fz_link_flag_r_valid)) == fz_link_flag_l_valid)\n\t\tld.ld.gotor.rb.x = ld.ld.gotor.lt.x;\n\tif ((ld.ld.gotor.flags & (fz_link_flag_l_valid | fz_link_flag_r_valid | fz_link_flag_r_is_zoom)) == fz_link_flag_r_valid)\n\t\tld.ld.gotor.lt.x = ld.ld.gotor.rb.x;\n\tif ((ld.ld.gotor.flags & (fz_link_flag_t_valid | fz_link_flag_b_valid)) == fz_link_flag_t_valid)\n\t\tld.ld.gotor.rb.y = ld.ld.gotor.lt.y;\n\tif ((ld.ld.gotor.flags & (fz_link_flag_t_valid | fz_link_flag_b_valid)) == fz_link_flag_b_valid)\n\t\tld.ld.gotor.lt.y = ld.ld.gotor.rb.y;\n\n\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=1686 */\n\t/* some producers wrongly expect \"/XYZ 0 0 0\" to be the same as \"/XYZ null null null\" */\n\tif ((ld.ld.gotor.flags & fz_link_flag_r_is_zoom) &&\n\t\t(ld.ld.gotor.flags & (fz_link_flag_l_valid | fz_link_flag_t_valid | fz_link_flag_r_valid)) == (fz_link_flag_l_valid | fz_link_flag_t_valid | fz_link_flag_r_valid) &&\n\t\tld.ld.gotor.lt.x == 0 && ld.ld.gotor.lt.y == 0 && ld.ld.gotor.rb.x == 0)\n\t\tld.ld.gotor.flags = fz_link_flag_r_is_zoom;\n\n\treturn ld;\n}\n\n/* SumatraPDF: parse full file specifications */\nchar *\npdf_file_spec_to_str(pdf_document *doc, pdf_obj *file_spec)\n{\n\tpdf_obj *obj = NULL;\n\tchar *path = NULL, *c;\n\n\tif (pdf_is_string(file_spec))\n\t\tobj = file_spec;\n\telse if (pdf_is_dict(file_spec))\n\t{\n#ifdef _WIN32\n\t\tobj = pdf_dict_gets(file_spec, \"DOS\");\n#else\n\t\tobj = pdf_dict_gets(file_spec, \"Unix\");\n#endif\n\t\tif (!obj)\n\t\t\tobj = pdf_dict_getsa(file_spec, \"UF\", \"F\");\n\t}\n\tif (!pdf_is_string(obj))\n\t\treturn NULL;\n\n\tpath = pdf_to_utf8(doc, obj);\n#ifdef _WIN32\n\tif (strcmp(pdf_to_name(pdf_dict_gets(file_spec, \"FS\")), \"URL\") != 0)\n\t{\n\t\t/* move the file name into the expected place and use the expected path separator */\n\t\tif (path[0] == '/' && (('A' <= path[1] && path[1] <= 'Z') || ('a' <= path[1] && path[1] <= 'z')) && path[2] == '/')\n\t\t{\n\t\t\tpath[0] = path[1];\n\t\t\tpath[1] = ':';\n\t\t}\n\t\tfor (c = path; *c; c++)\n\t\t{\n\t\t\tif (*c == '/')\n\t\t\t\t*c = '\\\\';\n\t\t}\n\t}\n#endif\n\treturn path;\n}\n\nstatic char *\npdf_parse_file_spec(pdf_document *doc, pdf_obj *file_spec)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *filename;\n\n\tif (pdf_is_string(file_spec))\n\t\treturn pdf_to_utf8(doc, file_spec);\n\n\tif (pdf_is_dict(file_spec)) {\n\t\tfilename = pdf_dict_gets(file_spec, \"UF\");\n\t\tif (!filename)\n\t\t\tfilename = pdf_dict_gets(file_spec, \"F\");\n\t\tif (!filename)\n\t\t\tfilename = pdf_dict_gets(file_spec, \"Unix\");\n\t\tif (!filename)\n\t\t\tfilename = pdf_dict_gets(file_spec, \"Mac\");\n\t\tif (!filename)\n\t\t\tfilename = pdf_dict_gets(file_spec, \"DOS\");\n\n\t\treturn pdf_to_utf8(doc, filename);\n\t}\n\n\tfz_warn(ctx, \"cannot parse file specification\");\n\treturn NULL;\n}\n\nfz_link_dest\npdf_parse_action(pdf_document *doc, pdf_obj *action)\n{\n\tfz_link_dest ld;\n\tpdf_obj *obj, *dest, *file_spec;\n\tfz_context *ctx = doc->ctx;\n\n\tUNUSED(ctx);\n\n\tld.kind = FZ_LINK_NONE;\n\n\tif (!action)\n\t\treturn ld;\n\n\tobj = pdf_dict_gets(action, \"S\");\n\tif (!strcmp(pdf_to_name(obj), \"GoTo\"))\n\t{\n\t\tdest = pdf_dict_gets(action, \"D\");\n\t\tld = pdf_parse_link_dest(doc, FZ_LINK_GOTO, dest);\n\t}\n\telse if (!strcmp(pdf_to_name(obj), \"URI\"))\n\t{\n\t\tld.kind = FZ_LINK_URI;\n\t\tld.ld.uri.is_map = pdf_to_bool(pdf_dict_gets(action, \"IsMap\"));\n\t\tld.ld.uri.uri = pdf_to_utf8(doc, pdf_dict_gets(action, \"URI\"));\n\t}\n\telse if (!strcmp(pdf_to_name(obj), \"Launch\"))\n\t{\n\t\tld.kind = FZ_LINK_LAUNCH;\n\t\tfile_spec = pdf_dict_gets(action, \"F\");\n\t\t/* SumatraPDF: parse full file specifications */\n\t\tld.ld.launch.file_spec = pdf_file_spec_to_str(doc, file_spec);\n\t\tld.ld.launch.new_window = pdf_to_int(pdf_dict_gets(action, \"NewWindow\"));\n\t\t/* SumatraPDF: support launching embedded files */\n#ifdef _WIN32\n\t\tobj = pdf_dict_getsa(pdf_dict_gets(file_spec, \"EF\"), \"DOS\", \"F\");\n#else\n\t\tobj = pdf_dict_getsa(pdf_dict_gets(file_spec, \"EF\"), \"Unix\", \"F\");\n#endif\n\t\tld.ld.launch.embedded_num = pdf_to_num(obj);\n\t\tld.ld.launch.embedded_gen = pdf_to_gen(obj);\n\t\t/* SumatraPDF: support URL /Filespec */\n\t\tld.ld.launch.is_uri = !obj && !strcmp(pdf_to_name(pdf_dict_gets(file_spec, \"FS\")), \"URL\");\n\t}\n\telse if (!strcmp(pdf_to_name(obj), \"Named\"))\n\t{\n\t\tld.kind = FZ_LINK_NAMED;\n\t\tld.ld.named.named = fz_strdup(ctx, pdf_to_name(pdf_dict_gets(action, \"N\")));\n\t}\n\telse if (!strcmp(pdf_to_name(obj), \"GoToR\"))\n\t{\n\t\tdest = pdf_dict_gets(action, \"D\");\n\t\tfile_spec = pdf_dict_gets(action, \"F\");\n\t\tld = pdf_parse_link_dest(doc, FZ_LINK_GOTOR, dest);\n\t\t/* SumatraPDF: parse full file specifications */\n\t\tld.ld.gotor.file_spec = pdf_file_spec_to_str(doc, file_spec);\n\t\tld.ld.gotor.new_window = pdf_to_int(pdf_dict_gets(action, \"NewWindow\"));\n\t}\n\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=2117 */\n\telse if (!strcmp(pdf_to_name(obj), \"JavaScript\"))\n\t{\n\t\t/* hackily extract the first URL the JavaScript action might open */\n\t\tchar *js = pdf_to_utf8(doc, pdf_dict_gets(action, \"JS\"));\n\t\tchar *url = strstr(js, \"getURL(\\\"\");\n\t\tif (url && strchr(url + 8, '\"'))\n\t\t{\n\t\t\turl += 8;\n\t\t\t*strchr(url, '\"') = '\\0';\n\t\t\tld.kind = FZ_LINK_URI;\n\t\t\tld.ld.uri.is_map = 0;\n\t\t\tld.ld.uri.uri = fz_strdup(ctx, url);\n\t\t}\n\t\tfz_free(ctx, js);\n\t}\n\treturn ld;\n}\n\nstatic fz_link *\npdf_load_link(pdf_document *doc, pdf_obj *dict, const fz_matrix *page_ctm)\n{\n\tpdf_obj *action;\n\tpdf_obj *obj;\n\tfz_rect bbox;\n\tfz_context *ctx = doc->ctx;\n\tfz_link_dest ld;\n\n\tobj = pdf_dict_gets(dict, \"Rect\");\n\tif (obj)\n\t\tpdf_to_rect(ctx, obj, &bbox);\n\telse\n\t\tbbox = fz_empty_rect;\n\n\tfz_transform_rect(&bbox, page_ctm);\n\n\tobj = pdf_dict_gets(dict, \"Dest\");\n\tif (obj)\n\t\tld = pdf_parse_link_dest(doc, FZ_LINK_GOTO, obj);\n\telse\n\t{\n\t\taction = pdf_dict_gets(dict, \"A\");\n\t\t/* fall back to additional action button's down/up action */\n\t\tif (!action)\n\t\t\taction = pdf_dict_getsa(pdf_dict_gets(dict, \"AA\"), \"U\", \"D\");\n\n\t\tld = pdf_parse_action(doc, action);\n\t}\n\t/* support clicking on embedded Flash movies, etc. (PDF 1.7 ExtensionLevel 3) */\n\tif (!obj && !action && (obj = pdf_dict_getp(dict, \"RichMediaContent/Configurations\")) != NULL)\n\t{\n\t\tobj = pdf_dict_gets(pdf_array_get(obj, 0), \"Instances\");\n\t\taction = pdf_dict_gets(pdf_array_get(obj, 0), \"Asset\");\n\t\tif (action)\n\t\t{\n\t\t\tld.kind = FZ_LINK_LAUNCH;\n\t\t\tld.ld.launch.file_spec = pdf_file_spec_to_str(doc, action);\n\t\t\tld.ld.launch.new_window = 1;\n#ifdef _WIN32\n\t\t\tobj = pdf_dict_getsa(pdf_dict_gets(action, \"EF\"), \"DOS\", \"F\");\n#else\n\t\t\tobj = pdf_dict_getsa(pdf_dict_gets(action, \"EF\"), \"Unix\", \"F\");\n#endif\n\t\t\tld.ld.launch.embedded_num = pdf_to_num(obj);\n\t\t\tld.ld.launch.embedded_gen = pdf_to_gen(obj);\n\t\t\tld.ld.launch.is_uri = !obj && !strcmp(pdf_to_name(pdf_dict_gets(action, \"FS\")), \"URL\");\n\t\t}\n\t}\n\tif (ld.kind == FZ_LINK_NONE)\n\t\treturn NULL;\n\treturn fz_new_link(ctx, &bbox, ld);\n}\n\nfz_link *\npdf_load_link_annots(pdf_document *doc, pdf_obj *annots, const fz_matrix *page_ctm)\n{\n\tfz_link *link, *head, *tail;\n\tpdf_obj *obj;\n\tint i, n;\n\n\thead = tail = NULL;\n\tlink = NULL;\n\n\tn = pdf_array_len(annots);\n\tfor (i = 0; i < n; i++)\n\t{\n\t\t/* FIXME: Move the try/catch out of the loop for performance? */\n\t\tfz_try(doc->ctx)\n\t\t{\n\t\t\tobj = pdf_array_get(annots, i);\n\t\t\tlink = pdf_load_link(doc, obj, page_ctm);\n\t\t}\n\t\tfz_catch(doc->ctx)\n\t\t{\n\t\t\tfz_rethrow_if(doc->ctx, FZ_ERROR_TRYLATER);\n\t\t\tlink = NULL;\n\t\t}\n\n\t\tif (link)\n\t\t{\n\t\t\tif (!head)\n\t\t\t\thead = tail = link;\n\t\t\telse\n\t\t\t{\n\t\t\t\ttail->next = link;\n\t\t\t\ttail = link;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn head;\n}\n\nvoid\npdf_free_annot(fz_context *ctx, pdf_annot *annot)\n{\n\tpdf_annot *next;\n\n\twhile (annot)\n\t{\n\t\tnext = annot->next;\n\t\tif (annot->ap)\n\t\t\tpdf_drop_xobject(ctx, annot->ap);\n\t\tpdf_drop_obj(annot->obj);\n\t\tfz_free(ctx, annot);\n\t\tannot = next;\n\t}\n}\n\nvoid\npdf_transform_annot(pdf_annot *annot)\n{\n\tfz_rect bbox = annot->ap->bbox;\n\tfz_rect rect = annot->rect;\n\tfloat w, h, x, y;\n\n\tfz_transform_rect(&bbox, &annot->ap->matrix);\n\tif (bbox.x1 == bbox.x0)\n\t\tw = 0;\n\telse\n\t\tw = (rect.x1 - rect.x0) / (bbox.x1 - bbox.x0);\n\tif (bbox.y1 == bbox.y0)\n\t\th = 0;\n\telse\n\t\th = (rect.y1 - rect.y0) / (bbox.y1 - bbox.y0);\n\t/* cf. https://github.com/sumatrapdfreader/sumatrapdf/issues/318 */\n\tx = rect.x0 - bbox.x0 * w;\n\ty = rect.y0 - bbox.y0 * h;\n\n\tfz_pre_scale(fz_translate(&annot->matrix, x, y), w, h);\n}\n\nfz_annot_type pdf_annot_obj_type(pdf_obj *obj)\n{\n\tchar *subtype = pdf_to_name(pdf_dict_gets(obj, \"Subtype\"));\n\tif (!strcmp(subtype, \"Text\"))\n\t\treturn FZ_ANNOT_TEXT;\n\telse if (!strcmp(subtype, \"Link\"))\n\t\treturn FZ_ANNOT_LINK;\n\telse if (!strcmp(subtype, \"FreeText\"))\n\t\treturn FZ_ANNOT_FREETEXT;\n\telse if (!strcmp(subtype, \"Line\"))\n\t\treturn FZ_ANNOT_LINE;\n\telse if (!strcmp(subtype, \"Square\"))\n\t\treturn FZ_ANNOT_SQUARE;\n\telse if (!strcmp(subtype, \"Circle\"))\n\t\treturn FZ_ANNOT_CIRCLE;\n\telse if (!strcmp(subtype, \"Polygon\"))\n\t\treturn FZ_ANNOT_POLYGON;\n\telse if (!strcmp(subtype, \"PolyLine\"))\n\t\treturn FZ_ANNOT_POLYLINE;\n\telse if (!strcmp(subtype, \"Highlight\"))\n\t\treturn FZ_ANNOT_HIGHLIGHT;\n\telse if (!strcmp(subtype, \"Underline\"))\n\t\treturn FZ_ANNOT_UNDERLINE;\n\telse if (!strcmp(subtype, \"Squiggly\"))\n\t\treturn FZ_ANNOT_SQUIGGLY;\n\telse if (!strcmp(subtype, \"StrikeOut\"))\n\t\treturn FZ_ANNOT_STRIKEOUT;\n\telse if (!strcmp(subtype, \"Stamp\"))\n\t\treturn FZ_ANNOT_STAMP;\n\telse if (!strcmp(subtype, \"Caret\"))\n\t\treturn FZ_ANNOT_CARET;\n\telse if (!strcmp(subtype, \"Ink\"))\n\t\treturn FZ_ANNOT_INK;\n\telse if (!strcmp(subtype, \"Popup\"))\n\t\treturn FZ_ANNOT_POPUP;\n\telse if (!strcmp(subtype, \"FileAttachment\"))\n\t\treturn FZ_ANNOT_FILEATTACHMENT;\n\telse if (!strcmp(subtype, \"Sound\"))\n\t\treturn FZ_ANNOT_SOUND;\n\telse if (!strcmp(subtype, \"Movie\"))\n\t\treturn FZ_ANNOT_MOVIE;\n\telse if (!strcmp(subtype, \"Widget\"))\n\t\treturn FZ_ANNOT_WIDGET;\n\telse if (!strcmp(subtype, \"Screen\"))\n\t\treturn FZ_ANNOT_SCREEN;\n\telse if (!strcmp(subtype, \"PrinterMark\"))\n\t\treturn FZ_ANNOT_PRINTERMARK;\n\telse if (!strcmp(subtype, \"TrapNet\"))\n\t\treturn FZ_ANNOT_TRAPNET;\n\telse if (!strcmp(subtype, \"Watermark\"))\n\t\treturn FZ_ANNOT_WATERMARK;\n\telse if (!strcmp(subtype, \"3D\"))\n\t\treturn FZ_ANNOT_3D;\n\telse\n\t\treturn -1;\n}\n\n/* SumatraPDF: synthesize appearance streams for a few more annotations */\n/* TODO: reuse code from pdf_form.c where possible and reasonable */\n\nstatic pdf_annot *\npdf_create_annot_ex(pdf_document *doc, const fz_rect *rect, pdf_obj *base_obj, fz_buffer *content, pdf_obj *resources, int transparency, fz_annot_type type)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_xobject *form = NULL;\n\tpdf_annot *annot;\n\tint rotate;\n\tint num;\n\n\tfz_var(form);\n\n\tfz_try(ctx)\n\t{\n\t\trotate = pdf_to_int(pdf_dict_getp(base_obj, \"MK/R\"));\n\n\t\tform = pdf_create_xobject(ctx, base_obj);\n\t\tfz_rotate(&form->matrix, rotate);\n\t\tform->bbox.x1 = ((rotate % 180) != 90) ? rect->x1 - rect->x0 : rect->y1 - rect->y0;\n\t\tform->bbox.y1 = ((rotate % 180) != 90) ? rect->y1 - rect->y0 : rect->x1 - rect->x0;\n\t\tform->transparency = transparency;\n\t\tform->isolated = !transparency;\n\t\tform->resources = resources;\n\n\t\tnum = pdf_create_object(doc);\n\t\tpdf_update_object(doc, num, base_obj);\n\t\tpdf_update_stream(doc, num, content);\n\t\tform->contents = pdf_new_indirect(doc, num, 0);\n\n\t\tannot = fz_malloc_struct(ctx, pdf_annot);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, content);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_xobject(ctx, form);\n\t\tpdf_drop_obj(base_obj);\n\t\tfz_rethrow(ctx);\n\t}\n\n\tannot->obj = base_obj;\n\tannot->rect = *rect;\n\tannot->ap = form;\n\tannot->next = NULL;\n\tannot->annot_type = type;\n\tannot->widget_type = PDF_WIDGET_TYPE_NOT_WIDGET;\n\n\tpdf_transform_annot(annot);\n\n\treturn annot;\n}\n\n#define ANNOT_OC_VIEW_ONLY \\\n\t\"<< /Type /OCMD /OCGs << /Type /OCG /Usage << /Print << /PrintState /OFF >> /Export << /ExportState /OFF >> >> >> >>\"\n\nstatic pdf_obj *\npdf_clone_for_view_only(pdf_document *doc, pdf_obj *obj)\n{\n\tfz_context *ctx = doc->ctx;\n\tobj = pdf_copy_dict(obj);\n\n\tfz_try(ctx)\n\t{\n\t\tif (!doc->ocg)\n\t\t\tdoc->ocg = fz_calloc(doc->ctx, 1, sizeof(*doc->ocg));\n\t\tpdf_dict_puts_drop(obj, \"OC\", pdf_new_obj_from_str(doc, ANNOT_OC_VIEW_ONLY));\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_warn(ctx, \"annotation might be printed unexpectedly\");\n\t}\n\n\treturn obj;\n}\n\nstatic void\npdf_get_annot_color(pdf_obj *obj, float rgb[3])\n{\n\tint k;\n\tobj = pdf_dict_gets(obj, \"C\");\n\tfor (k = 0; k < 3; k++)\n\t\trgb[k] = pdf_to_real(pdf_array_get(obj, k));\n}\n\n/* SumatraPDF: partial support for link borders */\nstatic pdf_annot *\npdf_create_link_annot(pdf_document *doc, pdf_obj *obj)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *border, *dashes;\n\tfloat border_width;\n\tchar border_style = 'S';\n\tfz_buffer *content = NULL;\n\tfz_rect rect;\n\tfloat rgb[3];\n\tint i, n;\n\n\tfz_var(content);\n\n\tborder = pdf_dict_gets(obj, \"BS\");\n\tif (pdf_is_dict(border))\n\t{\n\t\tpdf_obj *w = pdf_dict_gets(border, \"W\");\n\t\tconst char *s = pdf_to_name(pdf_dict_gets(border, \"S\"));\n\t\tborder_width = pdf_is_number(w) ? pdf_to_real(w) : 1.f;\n\t\tborder_style = strlen(s) == 1 ? *s : 'S';\n\t\tdashes = border_style == 'D' ? pdf_dict_gets(border, \"D\") : NULL;\n\t}\n\telse\n\t{\n\t\tborder = pdf_dict_gets(obj, \"Border\");\n\t\tborder_width = pdf_to_real(pdf_array_get(border, 2));\n\t\tdashes = pdf_array_get(border, 3);\n\t}\n\n\t/* Adobe Reader omits the border if dashes isn't an array */\n\tif (border_width <= 0 || dashes && !pdf_is_array(dashes))\n\t{\n\t\tif (border && (border_width || dashes))\n\t\t\tfz_warn(ctx, \"ignoring invalid link /Border array\");\n\t\treturn NULL;\n\t}\n\n\tpdf_get_annot_color(obj, rgb);\n\tpdf_to_rect(ctx, pdf_dict_gets(obj, \"Rect\"), &rect);\n\n\tfz_try(ctx)\n\t{\n\t\tcontent = fz_new_buffer(ctx, 128);\n\n\t\t// TODO: draw rounded rectangles if the first two /Border values are non-zero\n\t\tfz_buffer_printf(ctx, content, \"q %f w [\", border_width);\n\t\tfor (i = 0, n = pdf_array_len(dashes); i < n; i++)\n\t\t\tfz_buffer_printf(ctx, content, \"%f \", pdf_to_real(pdf_array_get(dashes, i)));\n\t\tfz_buffer_printf(ctx, content, \"] 0 d %f %f %f RG \", rgb[0], rgb[1], rgb[2]);\n\t\tif (border_style == 'U')\n\t\t\tfz_buffer_printf(ctx, content, \"0 0 m %f 0 l S Q\", rect.x1 - rect.x0);\n\t\telse\n\t\t\tfz_buffer_printf(ctx, content, \"0 0 %f %f re S Q\", rect.x1 - rect.x0, rect.y1 - rect.y0);\n\n\t\tobj = pdf_clone_for_view_only(doc, obj);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, content);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn pdf_create_annot_ex(doc, &rect, obj, content, NULL, 0, FZ_ANNOT_LINK);\n}\n\n// appearance streams adapted from Poppler's Annot.cc, licensed under GPLv2 and later\n#define ANNOT_TEXT_AP_NOTE \\\n\t\"%f %f %f RG 1 J 1 j [] 0 d 4 M\\n\"                                    \\\n\t\"2 w 9 18 m 4 18 l 4 7 4 4 6 3 c 20 3 l 18 4 18 7 18 18 c 17 18 l S\\n\"      \\\n\t\"1.5 w 10 16 m 14 21 l S\\n\"                                                 \\\n\t\"1.85625 w\\n\"                                                               \\\n\t\"15.07 20.523 m 15.07 19.672 14.379 18.977 13.523 18.977 c 12.672 18.977\\n\" \\\n\t\"11.977 19.672 11.977 20.523 c 11.977 21.379 12.672 22.07 13.523 22.07 c\\n\" \\\n\t\"14.379 22.07 15.07 21.379 15.07 20.523 c h S\\n\"                            \\\n\t\"1 w 6.5 13.5 m 15.5 13.5 l S 6.5 10.5 m 13.5 10.5 l S\\n\"                   \\\n\t\"6.801 7.5 m 15.5 7.5 l S\\n\"\n\n#define ANNOT_TEXT_AP_COMMENT \\\n\t\"%f %f %f RG 0 J 1 j [] 0 d 4 M 2 w\\n\"                                \\\n\t\"8 20 m 16 20 l 18.363 20 20 18.215 20 16 c 20 13 l 20 10.785 18.363 9\\n\"   \\\n\t\"16 9 c 13 9 l 8 3 l 8 9 l 8 9 l 5.637 9 4 10.785 4 13 c 4 16 l\\n\"          \\\n\t\"4 18.215 5.637 20 8 20 c h S\\n\"\n\n#define ANNOT_TEXT_AP_KEY \\\n\t\"%f %f %f RG 0 J 1 j [] 0 d 4 M\\n\"                                    \\\n\t\"2 w 11.895 18.754 m 13.926 20.625 17.09 20.496 18.961 18.465 c 20.832\\n\"   \\\n\t\"16.434 20.699 13.27 18.668 11.398 c 17.164 10.016 15.043 9.746 13.281\\n\"   \\\n\t\"10.516 c 12.473 9.324 l 11.281 10.078 l 9.547 8.664 l 9.008 6.496 l\\n\"     \\\n\t\"7.059 6.059 l 6.34 4.121 l 5.543 3.668 l 3.375 4.207 l 2.938 6.156 l\\n\"    \\\n\t\"10.57 13.457 l 9.949 15.277 10.391 17.367 11.895 18.754 c h S\\n\"           \\\n\t\"1.5 w 16.059 15.586 m 16.523 15.078 17.316 15.043 17.824 15.512 c\\n\"       \\\n\t\"18.332 15.98 18.363 16.77 17.895 17.277 c 17.43 17.785 16.637 17.816\\n\"    \\\n\t\"16.129 17.352 c 15.621 16.883 15.59 16.094 16.059 15.586 c h S\\n\"\n\n#define ANNOT_TEXT_AP_HELP \\\n\t\"%f %f %f RG 0 J 1 j [] 0 d 4 M 2.5 w\\n\"                              \\\n\t\"8.289 16.488 m 8.824 17.828 10.043 18.773 11.473 18.965 c 12.902 19.156\\n\" \\\n\t\"14.328 18.559 15.195 17.406 c 16.062 16.254 16.242 14.723 15.664 13.398\\n\" \\\n\t\"c S 12 8 m 12 12 16 11 16 15 c S\\n\"                                        \\\n\t\"q 1 0 0 -1 0 24 cm 1.539286 w\\n\"                                           \\\n\t\"12.684 20.891 m 12.473 21.258 12.004 21.395 11.629 21.196 c 11.254\\n\"      \\\n\t\"20.992 11.105 20.531 11.297 20.149 c 11.488 19.77 11.945 19.61 12.332\\n\"   \\\n\t\"19.789 c 12.719 19.969 12.891 20.426 12.719 20.817 c S Q\\n\"\n\n#define ANNOT_TEXT_AP_PARAGRAPH \\\n\t\"%f %f %f RG 1 J 1 j [] 0 d 4 M 2 w\\n\"                                \\\n\t\"15 3 m 15 18 l 11 18 l 11 3 l S\\n\"                                         \\\n\t\"q 1 0 0 -1 0 24 cm 4 w\\n\"                                                  \\\n\t\"9.777 10.988 m 8.746 10.871 7.973 9.988 8 8.949 c 8.027 7.91 8.844\\n\"      \\\n\t\"7.066 9.879 7.004 c S Q\\n\"\n\n#define ANNOT_TEXT_AP_NEW_PARAGRAPH \\\n\t\"%f %f %f RG 0 J 1 j [] 0 d 4 M 4 w\\n\"                                \\\n\t\"q 1 0 0 -1 0 24 cm\\n\"                                                      \\\n\t\"9.211 11.988 m 8.449 12.07 7.711 11.707 7.305 11.059 c 6.898 10.41\\n\"      \\\n\t\"6.898 9.59 7.305 8.941 c 7.711 8.293 8.449 7.93 9.211 8.012 c S Q\\n\"       \\\n\t\"q 1 0 0 -1 0 24 cm 1.004413 w\\n\"                                           \\\n\t\"18.07 11.511 m 15.113 10.014 l 12.199 11.602 l 12.711 8.323 l 10.301\\n\"    \\\n\t\"6.045 l 13.574 5.517 l 14.996 2.522 l 16.512 5.474 l 19.801 5.899 l\\n\"     \\\n\t\"17.461 8.252 l 18.07 11.511 l h S Q\\n\"                                     \\\n\t\"2 w 11 17 m 10 17 l 10 3 l S 14 3 m 14 13 l S\\n\"\n\n#define ANNOT_TEXT_AP_INSERT \\\n\t\"%f %f %f RG 1 J 0 j [] 0 d 4 M 2 w\\n\"                                \\\n\t\"12 18.012 m 20 18 l S 9 10 m 17 10 l S 12 14.012 m 20 14 l S\\n\"            \\\n\t\"12 6.012 m 20 6.012 l S 4 12 m 6 10 l 4 8 l S 4 12 m 4 8 l S\\n\"\n\n#define ANNOT_TEXT_AP_CROSS \\\n\t\"%f %f %f RG 1 J 0 j [] 0 d 4 M 2.5 w\\n\"                              \\\n\t\"18 5 m 6 17 l S 6 5 m 18 17 l S\\n\"\n\n#define ANNOT_TEXT_AP_CIRCLE \\\n\t\"%f %f %f RG 1 J 1 j [] 0 d 4 M 2.5 w\\n\"                              \\\n\t\"19.5 11.5 m 19.5 7.359 16.141 4 12 4 c 7.859 4 4.5 7.359 4.5 11.5 c 4.5\\n\" \\\n\t\"15.641 7.859 19 12 19 c 16.141 19 19.5 15.641 19.5 11.5 c h S\\n\"\n\n/* SumatraPDF: partial support for text icons */\nstatic pdf_annot *\npdf_create_text_annot(pdf_document *doc, pdf_obj *obj)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_buffer *content = NULL;\n\tfz_rect rect;\n\tchar *icon_name, *content_ap;\n\tfloat rgb[3];\n\n\tfz_var(content);\n\n\ticon_name = pdf_to_name(pdf_dict_gets(obj, \"Name\"));\n\tpdf_to_rect(ctx, pdf_dict_gets(obj, \"Rect\"), &rect);\n\trect.x1 = rect.x0 + 24;\n\trect.y0 = rect.y1 - 24;\n\tpdf_get_annot_color(obj, rgb);\n\n\tif (!strcmp(icon_name, \"Comment\"))\n\t\tcontent_ap = ANNOT_TEXT_AP_COMMENT;\n\telse if (!strcmp(icon_name, \"Key\"))\n\t\tcontent_ap = ANNOT_TEXT_AP_KEY;\n\telse if (!strcmp(icon_name, \"Help\"))\n\t\tcontent_ap = ANNOT_TEXT_AP_HELP;\n\telse if (!strcmp(icon_name, \"Paragraph\"))\n\t\tcontent_ap = ANNOT_TEXT_AP_PARAGRAPH;\n\telse if (!strcmp(icon_name, \"NewParagraph\"))\n\t\tcontent_ap = ANNOT_TEXT_AP_NEW_PARAGRAPH;\n\telse if (!strcmp(icon_name, \"Insert\"))\n\t\tcontent_ap = ANNOT_TEXT_AP_INSERT;\n\telse if (!strcmp(icon_name, \"Cross\"))\n\t\tcontent_ap = ANNOT_TEXT_AP_CROSS;\n\telse if (!strcmp(icon_name, \"Circle\"))\n\t\tcontent_ap = ANNOT_TEXT_AP_CIRCLE;\n\telse\n\t\tcontent_ap = ANNOT_TEXT_AP_NOTE;\n\n\tfz_try(ctx)\n\t{\n\t\tcontent = fz_new_buffer(ctx, 512);\n\n\t\t// TODO: make icons semi-transparent (cf. pdf_create_highlight_annot)?\n\t\tfz_buffer_printf(ctx, content, \"q \");\n\t\tfz_buffer_printf(ctx, content, content_ap, 0.5, 0.5, 0.5);\n\t\tfz_buffer_printf(ctx, content, \" 1 0 0 1 0 1 cm \");\n\t\tfz_buffer_printf(ctx, content, content_ap, rgb[0], rgb[1], rgb[2]);\n\t\tfz_buffer_printf(ctx, content, \" Q\", content_ap);\n\n\t\tobj = pdf_clone_for_view_only(doc, obj);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, content);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn pdf_create_annot_ex(doc, &rect, obj, content, NULL, 0, FZ_ANNOT_TEXT);\n}\n\n// appearance streams adapted from Poppler's Annot.cc, licensed under GPLv2 and later\n#define ANNOT_FILE_ATTACHMENT_AP_PUSHPIN \\\n\t\"%f %f %f RG 1 J 1 j [] 0 d 4 M\\n\"                                    \\\n\t\"2 w 5 4 m 6 5 l S\\n\"                                                       \\\n\t\"11 14 m 9 12 l 6 12 l 13 5 l 13 8 l 15 10 l 18 11 l 20 11 l 12 19 l 12\\n\"  \\\n\t\"17 l 11 14 l h\\n\"                                                          \\\n\t\"3 w 6 5 m 9 8 l S\\n\"\n\n#define ANNOT_FILE_ATTACHMENT_AP_PAPERCLIP \\\n\t\"%f %f %f RG 1 J 1 j [] 0 d 4 M 2 w\\n\"                                \\\n\t\"16.645 12.035 m 12.418 7.707 l 10.902 6.559 6.402 11.203 8.09 12.562 c\\n\"  \\\n\t\"14.133 18.578 l 14.949 19.387 16.867 19.184 17.539 18.465 c 20.551\\n\"      \\\n\t\"15.23 l 21.191 14.66 21.336 12.887 20.426 12.102 c 13.18 4.824 l 12.18\\n\"  \\\n\t\"3.82 6.25 2.566 4.324 4.461 c 3 6.395 3.383 11.438 4.711 12.801 c 9.648\\n\" \\\n\t\"17.887 l S\\n\"\n\n#define ANNOT_FILE_ATTACHMENT_AP_GRAPH \\\n\t\"%f %f %f RG 1 J 1 j [] 0 d 4 M\\n\"                                    \\\n\t\"1 w 18.5 15.5 m 18.5 13.086 l 16.086 15.5 l 18.5 15.5 l h\\n\"               \\\n\t\"7 7 m 10 11 l 13 9 l 18 15 l S\\n\"                                          \\\n\t\"2 w 3 19 m 3 3 l 21 3 l S\\n\"\n\n#define ANNOT_FILE_ATTACHMENT_AP_TAG \\\n\t\"%f %f %f RG 1 J 1 j [] 0 d 4 M\\n\"                                    \\\n\t\"1 w q 1 0 0 -1 0 24 cm\\n\"                                                  \\\n\t\"8.492 8.707 m 8.492 9.535 7.82 10.207 6.992 10.207 c 6.164 10.207 5.492\\n\" \\\n\t\"9.535 5.492 8.707 c 5.492 7.879 6.164 7.207 6.992 7.207 c 7.82 7.207\\n\"    \\\n\t\"8.492 7.879 8.492 8.707 c h S Q\\n\"                                         \\\n\t\"2 w\\n\"                                                                     \\\n\t\"2 w 20.078 11.414 m 20.891 10.602 20.785 9.293 20.078 8.586 c 14.422\\n\"    \\\n\t\"2.93 l 13.715 2.223 12.301 2.223 11.594 2.93 c 3.816 10.707 l 3.109\\n\"     \\\n\t\"11.414 2.402 17.781 3.816 19.195 c 5.23 20.609 11.594 19.902 12.301\\n\"     \\\n\t\"19.195 c 20.078 11.414 l h S\\n\"                                            \\\n\t\"1 w 11.949 13.184 m 16.191 8.941 l S 14.07 6.82 m 9.828 11.062 l S\\n\"      \\\n\t\"6.93 15.141 m 8 20 14.27 20.5 16 20.5 c 18.094 20.504 19.5 20 19.5 18 c\\n\" \\\n\t\"19.5 16.699 20.91 16.418 22.5 16.5 c S\\n\"\n\n/* SumatraPDF: partial support for file attachment icons */\nstatic pdf_annot *\npdf_create_file_annot(pdf_document *doc, pdf_obj *obj)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_buffer *content = NULL;\n\tfz_rect rect;\n\tchar *icon_name, *content_ap;\n\tfloat rgb[3];\n\n\tfz_var(content);\n\n\tpdf_to_rect(ctx, pdf_dict_gets(obj, \"Rect\"), &rect);\n\ticon_name = pdf_to_name(pdf_dict_gets(obj, \"Name\"));\n\tpdf_get_annot_color(obj, rgb);\n\n\tif (!strcmp(icon_name, \"Graph\"))\n\t\tcontent_ap = ANNOT_FILE_ATTACHMENT_AP_GRAPH;\n\telse if (!strcmp(icon_name, \"Paperclip\"))\n\t\tcontent_ap = ANNOT_FILE_ATTACHMENT_AP_PAPERCLIP;\n\telse if (!strcmp(icon_name, \"Tag\"))\n\t\tcontent_ap = ANNOT_FILE_ATTACHMENT_AP_TAG;\n\telse\n\t\tcontent_ap = ANNOT_FILE_ATTACHMENT_AP_PUSHPIN;\n\n\tfz_try(ctx)\n\t{\n\t\tcontent = fz_new_buffer(ctx, 512);\n\n\t\tfz_buffer_printf(ctx, content, \"q %f 0 0 %f 0 0 cm \",\n\t\t\t(rect.x1 - rect.x0) / 24, (rect.y1 - rect.y0) / 24);\n\t\tfz_buffer_printf(ctx, content, content_ap, 0.5, 0.5, 0.5);\n\t\tfz_buffer_printf(ctx, content, \" 1 0 0 1 0 1 cm \");\n\t\tfz_buffer_printf(ctx, content, content_ap, rgb[0], rgb[1], rgb[2]);\n\t\tfz_buffer_printf(ctx, content, \" Q\", content_ap);\n\n\t\tobj = pdf_clone_for_view_only(doc, obj);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, content);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn pdf_create_annot_ex(doc, &rect, obj, content, NULL, 0, FZ_ANNOT_FILEATTACHMENT);\n}\n\n/* SumatraPDF: partial support for text markup annotations */\n\n/* a: top/left to bottom/right; b: bottom/left to top/right */\nstatic void\npdf_get_quadrilaterals(pdf_obj *quad_points, int i, fz_rect *a, fz_rect *b)\n{\n\ta->x0 = pdf_to_real(pdf_array_get(quad_points, i * 8 + 0));\n\ta->y0 = pdf_to_real(pdf_array_get(quad_points, i * 8 + 1));\n\tb->x1 = pdf_to_real(pdf_array_get(quad_points, i * 8 + 2));\n\tb->y1 = pdf_to_real(pdf_array_get(quad_points, i * 8 + 3));\n\tb->x0 = pdf_to_real(pdf_array_get(quad_points, i * 8 + 4));\n\tb->y0 = pdf_to_real(pdf_array_get(quad_points, i * 8 + 5));\n\ta->x1 = pdf_to_real(pdf_array_get(quad_points, i * 8 + 6));\n\ta->y1 = pdf_to_real(pdf_array_get(quad_points, i * 8 + 7));\n}\n\nstatic fz_rect\nfz_straighten_rect(fz_rect rect)\n{\n\tfz_rect r;\n\tr.x0 = fz_min(rect.x0, rect.x1);\n\tr.y0 = fz_min(rect.y0, rect.y1);\n\tr.x1 = fz_max(rect.x0, rect.x1);\n\tr.y1 = fz_max(rect.y0, rect.y1);\n\treturn r;\n}\n\n#define ANNOT_HIGHLIGHT_AP_RESOURCES \\\n\t\"<< /ExtGState << /GS << /Type /ExtGState /ca 0.8 /AIS false /BM /Multiply >> >> >>\"\n\nstatic pdf_annot *\npdf_create_highlight_annot(pdf_document *doc, pdf_obj *obj)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_buffer *content = NULL;\n\tpdf_obj *quad_points, *resources;\n\tfz_rect rect, a, b;\n\tfz_point skew;\n\tfloat rgb[3];\n\tint i, n;\n\n\tfz_var(content);\n\n\tpdf_to_rect(ctx, pdf_dict_gets(obj, \"Rect\"), &rect);\n\tquad_points = pdf_dict_gets(obj, \"QuadPoints\");\n\tfor (i = 0, n = pdf_array_len(quad_points) / 8; i < n; i++)\n\t{\n\t\tpdf_get_quadrilaterals(quad_points, i, &a, &b);\n\t\tskew.x = 0.15 * fabs(a.y0 - b.y0);\n\t\tskew.y = 0.15 * fabs(a.x0 - b.x0);\n\t\tb.x0 -= skew.x; b.x1 += skew.x;\n\t\tb.y0 -= skew.y; b.y1 += skew.y;\n\t\ta = fz_straighten_rect(a); b = fz_straighten_rect(b);\n\t\tfz_union_rect(fz_union_rect(&rect, &a), &b);\n\t}\n\tpdf_get_annot_color(obj, rgb);\n\n\tfz_try(ctx)\n\t{\n\t\tcontent = fz_new_buffer(ctx, 512);\n\n\t\tfz_buffer_printf(ctx, content, \"q /GS gs %f %f %f rg 1 0 0 1 -%f -%f cm \",\n\t\t\trgb[0], rgb[1], rgb[2], rect.x0, rect.y0);\n\t\tfor (i = 0, n = pdf_array_len(quad_points) / 8; i < n; i++)\n\t\t{\n\t\t\tpdf_get_quadrilaterals(quad_points, i, &a, &b);\n\t\t\tskew.x = 0.15 * fabs(a.y0 - b.y0);\n\t\t\tskew.y = 0.15 * fabs(a.x0 - b.x0);\n\t\t\tfz_buffer_printf(ctx, content, \"%f %f m %f %f l %f %f l %f %f l h \",\n\t\t\t\ta.x0, a.y0, b.x1 + skew.x, b.y1 + skew.y, a.x1, a.y1, b.x0 - skew.x, b.y0 - skew.y);\n\t\t}\n\t\tfz_buffer_printf(ctx, content, \"f Q\");\n\n\t\tresources = pdf_new_obj_from_str(doc, ANNOT_HIGHLIGHT_AP_RESOURCES);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, content);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn pdf_create_annot_ex(doc, &rect, pdf_keep_obj(obj), content, resources, 1, FZ_ANNOT_HIGHLIGHT);\n}\n\nstatic pdf_annot *\npdf_create_markup_annot(pdf_document *doc, pdf_obj *obj, fz_annot_type annot_type)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_buffer *content = NULL;\n\tpdf_obj *quad_points;\n\tfz_rect rect, a, b;\n\tfloat rgb[3], dot;\n\tfz_point offs;\n\tint i, n;\n\n\tfz_var(content);\n\n\tpdf_to_rect(ctx, pdf_dict_gets(obj, \"Rect\"), &rect);\n\tquad_points = pdf_dict_gets(obj, \"QuadPoints\");\n\tfor (i = 0, n = pdf_array_len(quad_points) / 8; i < n; i++)\n\t{\n\t\tpdf_get_quadrilaterals(quad_points, i, &a, &b);\n\t\toffs.x = a.x0 - b.x0; offs.y = a.y0 - b.y0;\n\t\tdot = offs.x == 0 ? fabs(offs.y) : offs.y == 0 ? fabs(offs.x) : hypotf(offs.x, offs.y);\n\t\toffs.x = offs.x / dot / 4; offs.y = offs.y / dot / 4;\n\t\tb.x0 -= offs.x; a.x1 -= offs.x;\n\t\tb.y0 -= offs.y; a.y1 -= offs.y;\n\t\ta = fz_straighten_rect(a); b = fz_straighten_rect(b);\n\t\tfz_union_rect(fz_union_rect(&rect, &a), &b);\n\t}\n\tpdf_get_annot_color(obj, rgb);\n\n\tfz_try(ctx)\n\t{\n\t\tcontent = fz_new_buffer(ctx, 512);\n\n\t\tfz_buffer_printf(ctx, content, \"q %f %f %f RG 1 0 0 1 -%f -%f cm 0.5 w \",\n\t\t\trgb[0], rgb[1], rgb[2], rect.x0, rect.y0);\n\t\tif (annot_type == FZ_ANNOT_SQUIGGLY)\n\t\t\tfz_buffer_printf(ctx, content, \"[1] 1.5 d \");\n\t\tfor (i = 0, n = pdf_array_len(quad_points) / 8; i < n; i++)\n\t\t{\n\t\t\tpdf_get_quadrilaterals(quad_points, i, &a, &b);\n\t\t\tif (annot_type == FZ_ANNOT_STRIKEOUT)\n\t\t\t\tfz_buffer_printf(ctx, content, \"%f %f m %f %f l \",\n\t\t\t\t\t(a.x0 + b.x0) / 2, (a.y0 + b.y0) / 2, (a.x1 + b.x1) / 2, (a.y1 + b.y1) / 2);\n\t\t\telse\n\t\t\t\tfz_buffer_printf(ctx, content, \"%f %f m %f %f l \", b.x0, b.y0, a.x1, a.y1);\n\t\t\tif (annot_type == FZ_ANNOT_SQUIGGLY)\n\t\t\t{\n\t\t\t\toffs.x = a.x0 - b.x0; offs.y = a.y0 - b.y0;\n\t\t\t\tdot = offs.x == 0 ? fabs(offs.y) : offs.y == 0 ? fabs(offs.x) : hypotf(offs.x, offs.y);\n\t\t\t\toffs.x = offs.x / dot / 2; offs.y = offs.y / dot / 2;\n\t\t\t\tfz_buffer_printf(ctx, content, \"S [1] 0.5 d %f %f m %f %f l \", b.x0 + offs.x, b.y0 + offs.y, a.x1 + offs.x, a.y1 + offs.y);\n\t\t\t}\n\t\t}\n\t\tfz_buffer_printf(ctx, content, \"S Q\");\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, content);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn pdf_create_annot_ex(doc, &rect, pdf_keep_obj(obj), content, NULL, 0, annot_type);\n}\n\n/* cf. http://bugs.ghostscript.com/show_bug.cgi?id=692078 */\nstatic pdf_obj *\npdf_dict_get_inheritable(pdf_document *doc, pdf_obj *obj, char *key)\n{\n\twhile (obj)\n\t{\n\t\tpdf_obj *val = pdf_dict_gets(obj, key);\n\t\tif (val)\n\t\t\treturn val;\n\t\tobj = pdf_dict_gets(obj, \"Parent\");\n\t}\n\treturn pdf_dict_gets(pdf_dict_gets(pdf_dict_gets(pdf_trailer(doc), \"Root\"), \"AcroForm\"), key);\n}\n\nstatic float\npdf_extract_font_size(pdf_document *doc, char *appearance, char **font_name)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_stream *stream = fz_open_memory(ctx, (unsigned char *)appearance, strlen(appearance));\n\tpdf_lexbuf *lexbuf = &doc->lexbuf.base;\n\tfloat font_size = 0;\n\tint tok;\n\n\t*font_name = NULL;\n\tdo\n\t{\n\t\tfz_try(ctx)\n\t\t{\n\t\t\ttok = pdf_lex(stream, lexbuf);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\ttok = PDF_TOK_EOF;\n\t\t}\n\t\tif (tok == PDF_TOK_EOF)\n\t\t{\n\t\t\tfz_free(ctx, *font_name);\n\t\t\t*font_name = NULL;\n\t\t\tbreak;\n\t\t}\n\t\tif (tok == PDF_TOK_NAME)\n\t\t{\n\t\t\tfz_free(ctx, *font_name);\n\t\t\tfz_try(ctx)\n\t\t\t{\n\t\t\t\t*font_name = fz_strdup(ctx, lexbuf->scratch);\n\t\t\t}\n\t\t\tfz_catch(ctx)\n\t\t\t{\n\t\t\t\t*font_name = NULL;\n\t\t\t}\n\t\t}\n\t\telse if (tok == PDF_TOK_REAL)\n\t\t{\n\t\t\tfont_size = lexbuf->f;\n\t\t}\n\t\telse if (tok == PDF_TOK_INT)\n\t\t{\n\t\t\tfont_size = lexbuf->i;\n\t\t}\n\t} while (tok != PDF_TOK_KEYWORD || strcmp(lexbuf->scratch, \"Tf\") != 0);\n\tfz_close(stream);\n\treturn font_size;\n}\n\nstatic pdf_obj *\npdf_get_ap_stream(pdf_document *doc, pdf_obj *obj)\n{\n\tpdf_obj *ap = pdf_dict_gets(obj, \"AP\");\n\tif (!pdf_is_dict(ap))\n\t\treturn NULL;\n\n\tap = pdf_dict_gets(ap, \"N\");\n\tif (!pdf_is_stream(doc, pdf_to_num(ap), pdf_to_gen(ap)))\n\t\tap = pdf_dict_get(ap, pdf_dict_gets(obj, \"AS\"));\n\tif (!pdf_is_stream(doc, pdf_to_num(ap), pdf_to_gen(ap)))\n\t\treturn NULL;\n\n\treturn ap;\n}\n\nstatic void\npdf_prepend_ap_background(fz_buffer *content, pdf_document *doc, pdf_obj *obj)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_xobject *form = NULL;\n\tfz_stream *ap_stm = NULL;\n\tfz_buffer *ap_contents = NULL;\n\tint i;\n\n\tpdf_obj *ap = pdf_get_ap_stream(doc, obj);\n\tif (!ap)\n\t\treturn;\n\n\tfz_var(form);\n\tfz_var(ap_stm);\n\tfz_var(ap_contents);\n\n\tfz_try(ctx)\n\t{\n\t\tform = pdf_load_xobject(doc, ap);\n\t\tap_stm = pdf_open_contents_stream(doc, form->contents);\n\t\tap_contents = fz_read_all(ap_stm, 0);\n\n\t\tfor (i = 0; i < ap_contents->len - 3 && memcmp(ap_contents->data + i, \"/Tx\", 3) != 0; i++);\n\t\tif (i == ap_contents->len - 3)\n\t\t\ti = ap_contents->len;\n\t\tif (content->len + i < 0)\n\t\t\ti = 0;\n\t\tif (content->cap < content->len + i)\n\t\t\tfz_resize_buffer(ctx, content, content->len + i);\n\t\tmemcpy(content->data + content->len, ap_contents->data, i);\n\t\tcontent->len += i;\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, ap_contents);\n\t\tfz_close(ap_stm);\n\t\tpdf_drop_xobject(ctx, form);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\t/* fail silently */\n\t}\n}\n\nstatic void\npdf_string_to_Tj(fz_context *ctx, fz_buffer *content, unsigned short *ucs2, unsigned short *end)\n{\n\t// TODO: might be able to use fz_buffer_printf(ctx, content, \"%( Tj \", ...);\n\tfz_buffer_printf(ctx, content, \"(\");\n\tfor (; ucs2 < end; ucs2++)\n\t{\n\t\t// TODO: convert to CID(?)\n\t\tif (*ucs2 < 0x20 || *ucs2 == '(' || *ucs2 == ')' || *ucs2 == '\\\\')\n\t\t\tfz_buffer_printf(ctx, content, \"\\\\%03o\", *ucs2);\n\t\telse\n\t\t\tfz_buffer_printf(ctx, content, \"%c\", *ucs2);\n\t}\n\tfz_buffer_printf(ctx, content, \") Tj \");\n}\n\nstatic float\npdf_get_string_width(pdf_document *doc, pdf_obj *res, fz_buffer *base, unsigned short *string, unsigned short *end)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_rect rect;\n\tfloat width;\n\tint old_len = base->len;\n\tfz_device *dev = fz_new_bbox_device(ctx, &rect);\n\n\tfz_try(ctx)\n\t{\n\t\tpdf_string_to_Tj(ctx, base, string, end);\n\t\tfz_buffer_printf(ctx, base, \"ET Q EMC\");\n\t\tpdf_run_glyph(doc, res, base, dev, &fz_identity, NULL, 0);\n\t\twidth = rect.x1 - rect.x0;\n\t}\n\tfz_always(ctx)\n\t{\n\t\tbase->len = old_len;\n\t\tfz_free_device(dev);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\twidth = -1;\n\t}\n\n\treturn width;\n}\n\n#define iswspace(c) ((c) == 32 || 9 <= (c) && (c) <= 13)\n\nstatic unsigned short *\npdf_append_line(pdf_document *doc, pdf_obj *res, fz_buffer *content, fz_buffer *base_ap,\n\tunsigned short *ucs2, float font_size, int align, float width, int is_multiline, float *x)\n{\n\tfz_context *ctx = doc->ctx;\n\tunsigned short *end, *keep;\n\tfloat w, x1 = 0;\n\n\tif (is_multiline)\n\t{\n\t\tend = ucs2;\n\t\tdo\n\t\t{\n\t\t\tif (*end == '\\n' || *end == '\\r' && *(end + 1) != '\\n')\n\t\t\t\tbreak;\n\n\t\t\tfor (keep = end + 1; *keep && !iswspace(*keep); keep++);\n\t\t\tw = pdf_get_string_width(doc, res, base_ap, ucs2, keep);\n\t\t\tif (w <= width || end == ucs2)\n\t\t\t\tend = keep;\n\t\t} while (w <= width && *end);\n\t}\n\telse\n\t\tend = ucs2 + wcslen(ucs2);\n\n\tif (align != 0)\n\t{\n\t\tw = pdf_get_string_width(doc, res, base_ap, ucs2, end);\n\t\tif (w < 0)\n\t\t\tfz_warn(ctx, \"can't change the text's alignment\");\n\t\telse if (align == 1 /* centered */)\n\t\t\tx1 = (width - w) / 2;\n\t\telse if (align == 2 /* right-aligned */)\n\t\t\tx1 = width - w;\n\t\telse\n\t\t\tfz_warn(ctx, \"ignoring unknown quadding value %d\", align);\n\t}\n\n\tfz_buffer_printf(ctx, content, \"%f %f Td \", x1 - *x, -font_size);\n\tpdf_string_to_Tj(ctx, content, ucs2, end);\n\t*x = x1;\n\n\treturn end + (*end ? 1 : 0);\n}\n\nstatic void\npdf_append_combed_line(pdf_document *doc, pdf_obj *res, fz_buffer *content, fz_buffer *base_ap,\n\tunsigned short *ucs2, float font_size, float width, int max_len)\n{\n\tfloat comb_width = max_len > 0 ? width / max_len : 0;\n\tunsigned short c[2] = { 0 };\n\tfloat x = -2.0f;\n\tint i;\n\n\tfz_buffer_printf(doc->ctx, content, \"0 %f Td \", -font_size);\n\tfor (i = 0; i < max_len && ucs2[i]; i++)\n\t{\n\t\t*c = ucs2[i];\n\t\tpdf_append_line(doc, res, content, base_ap, c, 0, 1 /* centered */, comb_width, 0, &x);\n\t\tx -= comb_width;\n\t}\n}\n\nstatic pdf_annot *\npdf_update_tx_widget_annot(pdf_document *doc, pdf_obj *obj)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *ap, *res, *value;\n\tfz_rect rect;\n\tfz_matrix ctm;\n\tfz_buffer *content = NULL, *base_ap = NULL;\n\tint flags, align, rotate, is_multiline;\n\tfloat font_size, x, y;\n\tchar *font_name = NULL;\n\tunsigned short *ucs2 = NULL, *rest;\n\tpdf_annot *annot;\n\n\tfz_var(content);\n\tfz_var(base_ap);\n\tfz_var(font_name);\n\tfz_var(ucs2);\n\n\tif (strcmp(pdf_to_name(pdf_dict_gets(obj, \"Subtype\")), \"Widget\") != 0)\n\t\treturn NULL;\n\tif (!pdf_to_bool(pdf_dict_get_inheritable(doc, NULL, \"NeedAppearances\")) && pdf_get_ap_stream(doc, obj))\n\t\treturn NULL;\n\tvalue = pdf_dict_get_inheritable(doc, obj, \"FT\");\n\tif (strcmp(pdf_to_name(value), \"Tx\") != 0)\n\t\treturn NULL;\n\n\tap = pdf_dict_get_inheritable(doc, obj, \"DA\");\n\tvalue = pdf_dict_get_inheritable(doc, obj, \"V\");\n\tif (!ap || !value)\n\t\treturn NULL;\n\n\tres = pdf_dict_get_inheritable(doc, obj, \"DR\");\n\tpdf_to_rect(ctx, pdf_dict_gets(obj, \"Rect\"), &rect);\n\trotate = pdf_to_int(pdf_dict_gets(pdf_dict_gets(obj, \"MK\"), \"R\"));\n\tfz_transform_rect(&rect, fz_rotate(&ctm, rotate));\n\n\tflags = pdf_to_int(pdf_dict_gets(obj, \"Ff\"));\n\tis_multiline = (flags & Ff_Multiline) != 0;\n\tif ((flags & Ff_RichText))\n\t\tfz_warn(ctx, \"missing support for richtext fields\");\n\talign = pdf_to_int(pdf_dict_gets(obj, \"Q\"));\n\n\tfont_size = pdf_extract_font_size(doc, pdf_to_str_buf(ap), &font_name);\n\tif (!font_size || !font_name)\n\t\tfont_size = is_multiline ? 10 /* FIXME */ : floor(rect.y1 - rect.y0 - 2);\n\n\tfz_try(ctx)\n\t{\n\t\tcontent = fz_new_buffer(ctx, 256);\n\t\tbase_ap = fz_new_buffer(ctx, 256);\n\n\t\tpdf_prepend_ap_background(content, doc, obj);\n\t\tfz_buffer_printf(ctx, content, \"/Tx BMC q 1 1 %f %f re W n BT %s \",\n\t\t\trect.x1 - rect.x0 - 2.0f, rect.y1 - rect.y0 - 2.0f, pdf_to_str_buf(ap));\n\t\tfz_buffer_printf(ctx, base_ap, \"/Tx BMC q BT %s \", pdf_to_str_buf(ap));\n\t\tif (font_name)\n\t\t{\n\t\t\tpdf_font_desc *fontdesc = NULL;\n\t\t\tpdf_obj *font_obj = pdf_dict_gets(pdf_dict_gets(res, \"Font\"), font_name);\n\t\t\tif (font_obj)\n\t\t\t{\n\t\t\t\tfz_try(ctx)\n\t\t\t\t{\n\t\t\t\t\tfontdesc = pdf_load_font(doc, res, font_obj, 0);\n\t\t\t\t}\n\t\t\t\tfz_catch(ctx)\n\t\t\t\t{\n\t\t\t\t\tfontdesc = NULL;\n\t\t\t\t}\n\t\t\t}\n\t\t\t/* TODO: try to reverse the encoding instead of replacing the font */\n\t\t\tif (fontdesc && fontdesc->cid_to_gid && !fontdesc->cid_to_ucs || !fontdesc && pdf_dict_gets(res, \"Font\"))\n\t\t\t{\n\t\t\t\tpdf_obj *new_font = pdf_new_obj_from_str(doc, \"<< /Type /Font /BaseFont /Helvetica /Subtype /Type1 >>\");\n\t\t\t\tfz_free(ctx, font_name);\n\t\t\t\tfont_name = NULL;\n\t\t\t\tfont_name = fz_strdup(ctx, \"Default\");\n\t\t\t\tpdf_dict_puts_drop(pdf_dict_gets(res, \"Font\"), font_name, new_font);\n\t\t\t}\n\t\t\tpdf_drop_font(ctx, fontdesc);\n\t\t\tfontdesc = NULL;\n\t\t\tfz_buffer_printf(ctx, content, \"/%s %f Tf \", font_name, font_size);\n\t\t\tfz_buffer_printf(ctx, base_ap, \"/%s %f Tf \", font_name, font_size);\n\t\t\tfz_free(ctx, font_name);\n\t\t\tfont_name = NULL;\n\t\t}\n\t\ty = 0.5f * (rect.y1 - rect.y0) + 0.6f * font_size;\n\t\tif (is_multiline)\n\t\t\ty = rect.y1 - rect.y0 - 2;\n\t\tfz_buffer_printf(ctx, content, \"1 0 0 1 2 %f Tm \", y);\n\n\t\tucs2 = pdf_to_ucs2(doc, value);\n\t\tfor (rest = ucs2; *rest; rest++)\n\t\t\tif (*rest > 0xFF)\n\t\t\t\t*rest = '?';\n\t\tif ((flags & Ff_Password))\n\t\t\tfor (rest = ucs2; *rest; rest++)\n\t\t\t\t*rest = '*';\n\n\t\tx = 0;\n\t\trest = ucs2;\n\t\tif ((flags & Ff_Comb))\n\t\t{\n\t\t\tpdf_append_combed_line(doc, res, content, base_ap, ucs2, font_size, rect.x1 - rect.x0, pdf_to_int(pdf_dict_get_inheritable(doc, obj, \"MaxLen\")));\n\t\t\trest = L\"\";\n\t\t}\n\t\twhile (*rest)\n\t\t\trest = pdf_append_line(doc, res, content, base_ap, rest, font_size, align, rect.x1 - rect.x0 - 4.0f, is_multiline, &x);\n\n\t\tfz_buffer_printf(ctx, content, \"ET Q EMC\");\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_free(ctx, ucs2);\n\t\tfz_drop_buffer(ctx, base_ap);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, font_name);\n\t\tfz_drop_buffer(ctx, content);\n\t\tfz_rethrow(ctx);\n\t}\n\n\tfz_transform_rect(&rect, fz_rotate(&ctm, -rotate));\n\tannot = pdf_create_annot_ex(doc, &rect, pdf_keep_obj(obj), content, res ? pdf_keep_obj(res) : NULL, 0, FZ_ANNOT_WIDGET);\n\tannot->widget_type = PDF_WIDGET_TYPE_TEXT;\n\treturn annot;\n}\n\n/* SumatraPDF: partial support for freetext annotations */\n\n#define ANNOT_FREETEXT_AP_RESOURCES \\\n\t\"<< /Font << /Default << /Type /Font /BaseFont /Helvetica /Subtype /Type1 >> >> >>\"\n\nstatic pdf_annot *\npdf_create_freetext_annot(pdf_document *doc, pdf_obj *obj)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_buffer *content = NULL, *base_ap = NULL;\n\tpdf_obj *ap = pdf_dict_get_inheritable(doc, obj, \"DA\");\n\tpdf_obj *value = pdf_dict_gets(obj, \"Contents\");\n\tint align = pdf_to_int(pdf_dict_gets(obj, \"Q\"));\n\tpdf_obj *res = pdf_new_obj_from_str(doc, ANNOT_FREETEXT_AP_RESOURCES);\n\tunsigned short *ucs2 = NULL, *rest;\n\tfz_rect rect;\n\tchar *r;\n\tfloat x;\n\n\tchar *font_name = NULL;\n\tfloat font_size = pdf_extract_font_size(doc, pdf_to_str_buf(ap), &font_name);\n\tpdf_to_rect(ctx, pdf_dict_gets(obj, \"Rect\"), &rect);\n\n\tfz_var(content);\n\tfz_var(base_ap);\n\tfz_var(ucs2);\n\n\tfz_try(ctx)\n\t{\n\t\tcontent = fz_new_buffer(ctx, 256);\n\t\tbase_ap = fz_new_buffer(ctx, 256);\n\n\t\tif (!font_size)\n\t\t\tfont_size = 10;\n\t\t/* TODO: what resource dictionary does this font name refer to? */\n\t\tif (font_name)\n\t\t{\n\t\t\tpdf_obj *font = pdf_dict_gets(res, \"Font\");\n\t\t\tpdf_dict_puts(font, font_name, pdf_dict_gets(font, \"Default\"));\n\t\t\tfz_free(ctx, font_name);\n\t\t}\n\n\t\tfz_buffer_printf(ctx, content, \"q 1 1 %f %f re W n BT %s \",\n\t\t\trect.x1 - rect.x0 - 2.0f, rect.y1 - rect.y0 - 2.0f, pdf_to_str_buf(ap));\n\t\tfz_buffer_printf(ctx, base_ap, \"q BT %s \", pdf_to_str_buf(ap));\n\t\tfz_buffer_printf(ctx, content, \"/Default %f Tf \", font_size);\n\t\tfz_buffer_printf(ctx, base_ap, \"/Default %f Tf \", font_size);\n\t\tfz_buffer_printf(ctx, content, \"1 0 0 1 2 %f Tm \", rect.y1 - rect.y0 - 2);\n\n\t\t/* Adobe Reader seems to consider \"[1 0 0] r\" and \"1 0 0 rg\" to mean the same(?) */\n\t\tif ((r = strchr((char *)base_ap->data, '[')) != NULL && sscanf(r, \"[%f %f %f] r\", &x, &x, &x) == 3)\n\t\t{\n\t\t\t*r = ' ';\n\t\t\tmemcpy(strchr(r, ']'), \" rg\", 3);\n\t\t}\n\t\tif ((r = strchr((char *)content->data, '[')) != NULL && sscanf(r, \"[%f %f %f] r\", &x, &x, &x) == 3)\n\t\t{\n\t\t\t*r = ' ';\n\t\t\tmemcpy(strchr(r, ']'), \" rg\", 3);\n\t\t}\n\n\t\tucs2 = pdf_to_ucs2(doc, value);\n\t\tfor (rest = ucs2; *rest; rest++)\n\t\t\tif (*rest > 0xFF)\n\t\t\t\t*rest = '?';\n\n\t\tx = 0;\n\t\trest = ucs2;\n\t\twhile (*rest)\n\t\t\trest = pdf_append_line(doc, res, content, base_ap, rest, font_size, align, rect.x1 - rect.x0 - 4.0f, 1, &x);\n\n\t\tfz_buffer_printf(ctx, content, \"ET Q\");\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_free(ctx, ucs2);\n\t\tfz_drop_buffer(ctx, base_ap);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn pdf_create_annot_ex(doc, &rect, pdf_keep_obj(obj), content, res, 0, FZ_ANNOT_FREETEXT);\n}\n\nstatic pdf_annot *\npdf_create_widget_annot(pdf_document *doc, pdf_obj *obj)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_rect rect;\n\n\t/* TODO: synthesize a full appearance stream */\n\tif (!pdf_is_string(pdf_dict_gets(obj, \"TU\")))\n\t\treturn NULL;\n\n\tpdf_to_rect(ctx, pdf_dict_gets(obj, \"Rect\"), &rect);\n\n\treturn pdf_create_annot_ex(doc, &rect, pdf_keep_obj(obj), fz_new_buffer(ctx, 0), NULL, 0, FZ_ANNOT_WIDGET);\n}\n\nstatic pdf_annot *\npdf_create_annot_with_appearance(pdf_document *doc, pdf_obj *obj)\n{\n\tfz_annot_type annot_type = pdf_annot_obj_type(obj);\n\tswitch (annot_type)\n\t{\n\tcase FZ_ANNOT_LINK:\n\t\treturn pdf_create_link_annot(doc, obj);\n\tcase FZ_ANNOT_TEXT:\n\t\treturn pdf_create_text_annot(doc, obj);\n\tcase FZ_ANNOT_FILEATTACHMENT:\n\t\treturn pdf_create_file_annot(doc, obj);\n\tcase FZ_ANNOT_HIGHLIGHT:\n\t\t/* TODO: Adobe Reader seems to sometimes ignore the appearance stream for highlights(?) */\n\t\treturn pdf_create_highlight_annot(doc, obj);\n\tcase FZ_ANNOT_UNDERLINE:\n\tcase FZ_ANNOT_STRIKEOUT:\n\tcase FZ_ANNOT_SQUIGGLY:\n\t\treturn pdf_create_markup_annot(doc, obj, annot_type);\n\tcase FZ_ANNOT_FREETEXT:\n\t\treturn pdf_create_freetext_annot(doc, obj);\n\tcase FZ_ANNOT_WIDGET:\n\t\treturn pdf_create_widget_annot(doc, obj);\n\tdefault:\n\t\treturn NULL;\n\t}\n}\n\nvoid\npdf_load_annots(pdf_document *doc, pdf_page *page, pdf_obj *annots)\n{\n\tpdf_annot *annot, **itr;\n\tpdf_obj *obj, *ap, *as, *n, *rect;\n\tint i, len, keep_annot;\n\tfz_context *ctx = doc->ctx;\n\n\tfz_var(annot);\n\tfz_var(itr);\n\tfz_var(keep_annot);\n\n\titr = &page->annots;\n\n\tlen = pdf_array_len(annots);\n\t/*\n\tCreate an initial linked list of pdf_annot structures with only the obj field\n\tfilled in. We do this because update_appearance has the potential to change\n\tthe annot array, so we don't want to be iterating through the array while\n\tthat happens.\n\t*/\n\tfz_try(ctx)\n\t{\n\t\tfor (i = 0; i < len; i++)\n\t\t{\n\t\t\tobj = pdf_array_get(annots, i);\n\t\t\tannot = fz_malloc_struct(ctx, pdf_annot);\n\t\t\tannot->obj = pdf_keep_obj(obj);\n\t\t\tannot->page = page;\n\t\t\tannot->next = NULL;\n\n\t\t\t*itr = annot;\n\t\t\titr = &annot->next;\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_free_annot(ctx, page->annots);\n\t\tpage->annots = NULL;\n\t\tfz_rethrow(ctx);\n\t}\n\n\t/*\n\tIterate through the newly created annot linked list, using a double pointer to\n\tfacilitate deleting broken annotations.\n\t*/\n\titr = &page->annots;\n\twhile (*itr)\n\t{\n\t\tannot = *itr;\n\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tpdf_hotspot *hp = &doc->hotspot;\n\n\t\t\t/* SumatraPDF: synthesize appearance streams for a few more annotations */\n\t\t\tpdf_annot *synth;\n\t\t\t/* cf. http://bugs.ghostscript.com/show_bug.cgi?id=692078 */\n\t\t\tif ((synth = pdf_update_tx_widget_annot(doc, annot->obj)) != NULL ||\n\t\t\t\t!pdf_is_dict(pdf_dict_getp(annot->obj, \"AP/N\")) && (synth = pdf_create_annot_with_appearance(doc, annot->obj)) != NULL)\n\t\t\t{\n\t\t\t\tsynth->page = page;\n\t\t\t\tsynth->pagerect = annot->rect;\n\t\t\t\tfz_transform_rect(&synth->pagerect, &page->ctm);\n\t\t\t\tsynth->next = annot->next;\n\t\t\t\tpdf_drop_obj(annot->obj);\n\t\t\t\t*annot = *synth;\n\t\t\t\tfz_free(ctx, synth);\n\t\t\t\titr = &annot->next;\n\t\t\t\tkeep_annot = 1;\n\t\t\t\tbreak; // out of fz_try\n\t\t\t}\n\n\t\t\tn = NULL;\n\n\t\t\t/* SumatraPDF: prevent regressions */\n\t\t\tif (doc->update_appearance && 0)\n\t\t\t\tdoc->update_appearance(doc, annot);\n\n\t\t\tobj = annot->obj;\n\t\t\trect = pdf_dict_gets(obj, \"Rect\");\n\t\t\tap = pdf_dict_gets(obj, \"AP\");\n\t\t\tas = pdf_dict_gets(obj, \"AS\");\n\n\t\t\t/* We only collect annotations with an appearance\n\t\t\t * stream into this list, so remove any that don't\n\t\t\t * (such as links) and continue. */\n\t\t\tkeep_annot = pdf_is_dict(ap);\n\t\t\tif (!keep_annot)\n\t\t\t\tbreak;\n\n\t\t\tif (hp->num == pdf_to_num(obj)\n\t\t\t\t&& hp->gen == pdf_to_gen(obj)\n\t\t\t\t&& (hp->state & HOTSPOT_POINTER_DOWN))\n\t\t\t{\n\t\t\t\tn = pdf_dict_gets(ap, \"D\"); /* down state */\n\t\t\t}\n\n\t\t\tif (n == NULL)\n\t\t\t\tn = pdf_dict_gets(ap, \"N\"); /* normal state */\n\n\t\t\t/* lookup current state in sub-dictionary */\n\t\t\tif (!pdf_is_stream(doc, pdf_to_num(n), pdf_to_gen(n)))\n\t\t\t\tn = pdf_dict_get(n, as);\n\n\t\t\tpdf_to_rect(ctx, rect, &annot->rect);\n\t\t\tannot->pagerect = annot->rect;\n\t\t\tfz_transform_rect(&annot->pagerect, &page->ctm);\n\t\t\tannot->ap = NULL;\n\t\t\tannot->annot_type = pdf_annot_obj_type(obj);\n\t\t\tannot->widget_type = annot->annot_type == FZ_ANNOT_WIDGET ? pdf_field_type(doc, obj) : PDF_WIDGET_TYPE_NOT_WIDGET;\n\n\t\t\tif (pdf_is_stream(doc, pdf_to_num(n), pdf_to_gen(n)))\n\t\t\t{\n\t\t\t\tannot->ap = pdf_load_xobject(doc, n);\n\t\t\t\tpdf_transform_annot(annot);\n\t\t\t\tannot->ap_iteration = annot->ap->iteration;\n\t\t\t}\n\n\t\t\tif (obj == doc->focus_obj)\n\t\t\t\tdoc->focus = annot;\n\n\t\t\t/* Move to next item in the linked list */\n\t\t\titr = &annot->next;\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tif (fz_caught(ctx) == FZ_ERROR_TRYLATER)\n\t\t\t{\n\t\t\t\tpdf_free_annot(ctx, page->annots);\n\t\t\t\tpage->annots = NULL;\n\t\t\t\tfz_rethrow(ctx);\n\t\t\t}\n\t\t\tkeep_annot = 0;\n\t\t\tfz_warn(ctx, \"ignoring broken annotation\");\n\t\t}\n\t\tif (!keep_annot)\n\t\t{\n\t\t\t/* Move to next item in the linked list, dropping this one */\n\t\t\t*itr = annot->next;\n\t\t\tannot->next = NULL; /* Required because pdf_free_annot follows the \"next\" chain */\n\t\t\tpdf_free_annot(ctx, annot);\n\t\t}\n\t}\n\n\tpage->annot_tailp = itr;\n}\n\npdf_annot *\npdf_first_annot(pdf_document *doc, pdf_page *page)\n{\n\treturn page ? page->annots : NULL;\n}\n\npdf_annot *\npdf_next_annot(pdf_document *doc, pdf_annot *annot)\n{\n\treturn annot ? annot->next : NULL;\n}\n\nfz_rect *\npdf_bound_annot(pdf_document *doc, pdf_annot *annot, fz_rect *rect)\n{\n\tif (rect == NULL)\n\t\treturn NULL;\n\n\tif (annot)\n\t\t*rect = annot->pagerect;\n\telse\n\t\t*rect = fz_empty_rect;\n\treturn rect;\n}\n\nfz_annot_type\npdf_annot_type(pdf_annot *annot)\n{\n\treturn annot->annot_type;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-appearance.c",
    "content": "#include \"mupdf/pdf.h\"\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_ADVANCES_H\n\n#define MATRIX_COEFS (6)\n#define STRIKE_HEIGHT (0.375f)\n#define UNDERLINE_HEIGHT (0.075f)\n#define LINE_THICKNESS (0.07f)\n#define SMALL_FLOAT (0.00001)\n\nenum\n{\n\tQ_Left = 0,\n\tQ_Cent = 1,\n\tQ_Right = 2\n};\n\nenum\n{\n\tBS_Solid,\n\tBS_Dashed,\n\tBS_Beveled,\n\tBS_Inset,\n\tBS_Underline\n};\n\ntypedef struct font_info_s\n{\n\tpdf_da_info da_rec;\n\tpdf_font_desc *font;\n\tfloat lineheight;\n} font_info;\n\ntypedef struct text_widget_info_s\n{\n\tpdf_obj *dr;\n\tpdf_obj *col;\n\tfont_info font_rec;\n\tint q;\n\tint multiline;\n\tint comb;\n\tint max_len;\n} text_widget_info;\n\nstatic const char *fmt_re = \"%f %f %f %f re\\n\";\nstatic const char *fmt_f = \"f\\n\";\nstatic const char *fmt_s = \"s\\n\";\nstatic const char *fmt_g = \"%f g\\n\";\nstatic const char *fmt_m = \"%f %f m\\n\";\nstatic const char *fmt_l = \"%f %f l\\n\";\nstatic const char *fmt_w = \"%f w\\n\";\nstatic const char *fmt_Tx_BMC = \"/Tx BMC\\n\";\nstatic const char *fmt_q = \"q\\n\";\nstatic const char *fmt_W = \"W\\n\";\nstatic const char *fmt_n = \"n\\n\";\nstatic const char *fmt_BT = \"BT\\n\";\nstatic const char *fmt_Tm = \"%f %f %f %f %f %f Tm\\n\";\nstatic const char *fmt_Td = \"%f %f Td\\n\";\nstatic const char *fmt_Tj = \" Tj\\n\";\nstatic const char *fmt_ET = \"ET\\n\";\nstatic const char *fmt_Q = \"Q\\n\";\nstatic const char *fmt_EMC = \"EMC\\n\";\n\nvoid pdf_da_info_fin(fz_context *ctx, pdf_da_info *di)\n{\n\tfz_free(ctx, di->font_name);\n\tdi->font_name = NULL;\n}\n\nstatic void da_check_stack(float *stack, int *top)\n{\n\tif (*top == 32)\n\t{\n\t\tmemmove(stack, stack + 1, 31 * sizeof(stack[0]));\n\t\t*top = 31;\n\t}\n}\n\nvoid pdf_parse_da(fz_context *ctx, char *da, pdf_da_info *di)\n{\n\tfloat stack[32] = { 0.0f };\n\tint top = 0;\n\tpdf_token tok;\n\tchar *name = NULL;\n\tpdf_lexbuf lbuf;\n\tfz_stream *str = fz_open_memory(ctx, (unsigned char *)da, strlen(da));\n\n\tpdf_lexbuf_init(ctx, &lbuf, PDF_LEXBUF_SMALL);\n\n\tfz_var(str);\n\tfz_var(name);\n\tfz_try(ctx)\n\t{\n\t\tfor (tok = pdf_lex(str, &lbuf); tok != PDF_TOK_EOF; tok = pdf_lex(str, &lbuf))\n\t\t{\n\t\t\tswitch (tok)\n\t\t\t{\n\t\t\tcase PDF_TOK_NAME:\n\t\t\t\tfz_free(ctx, name);\n\t\t\t\tname = fz_strdup(ctx, lbuf.scratch);\n\t\t\t\tbreak;\n\n\t\t\tcase PDF_TOK_INT:\n\t\t\t\tda_check_stack(stack, &top);\n\t\t\t\tstack[top] = lbuf.i;\n\t\t\t\ttop ++;\n\t\t\t\tbreak;\n\n\t\t\tcase PDF_TOK_REAL:\n\t\t\t\tda_check_stack(stack, &top);\n\t\t\t\tstack[top] = lbuf.f;\n\t\t\t\ttop ++;\n\t\t\t\tbreak;\n\n\t\t\tcase PDF_TOK_KEYWORD:\n\t\t\t\tif (!strcmp(lbuf.scratch, \"Tf\"))\n\t\t\t\t{\n\t\t\t\t\tdi->font_size = stack[0];\n\t\t\t\t\tdi->font_name = name;\n\t\t\t\t\tname = NULL;\n\t\t\t\t}\n\t\t\t\telse if (!strcmp(lbuf.scratch, \"rg\"))\n\t\t\t\t{\n\t\t\t\t\tdi->col[0] = stack[0];\n\t\t\t\t\tdi->col[1] = stack[1];\n\t\t\t\t\tdi->col[2] = stack[2];\n\t\t\t\t\tdi->col_size = 3;\n\t\t\t\t}\n\t\t\t\telse if (!strcmp(lbuf.scratch, \"g\"))\n\t\t\t\t{\n\t\t\t\t\tdi->col[0] = stack[0];\n\t\t\t\t\tdi->col_size = 1;\n\t\t\t\t}\n\n\t\t\t\tfz_free(ctx, name);\n\t\t\t\tname = NULL;\n\t\t\t\ttop = 0;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_free(ctx, name);\n\t\tfz_close(str);\n\t\tpdf_lexbuf_fin(&lbuf);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void get_font_info(pdf_document *doc, pdf_obj *dr, char *da, font_info *font_rec)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_font_desc *font;\n\n\tpdf_parse_da(ctx, da, &font_rec->da_rec);\n\tif (font_rec->da_rec.font_name == NULL)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"No font name in default appearance\");\n\n\tfont_rec->font = font = pdf_load_font(doc, dr, pdf_dict_gets(pdf_dict_gets(dr, \"Font\"), font_rec->da_rec.font_name), 0);\n\tfont_rec->lineheight = 1.0;\n\tif (font && font->ascent != 0.0f && font->descent != 0.0f)\n\t\tfont_rec->lineheight = (font->ascent - font->descent) / 1000.0;\n}\n\nstatic void font_info_fin(fz_context *ctx, font_info *font_rec)\n{\n\tpdf_drop_font(ctx, font_rec->font);\n\tfont_rec->font = NULL;\n\tpdf_da_info_fin(ctx, &font_rec->da_rec);\n}\n\nstatic void get_text_widget_info(pdf_document *doc, pdf_obj *widget, text_widget_info *info)\n{\n\tchar *da = pdf_to_str_buf(pdf_get_inheritable(doc, widget, \"DA\"));\n\tint ff = pdf_get_field_flags(doc, widget);\n\tpdf_obj *ml = pdf_get_inheritable(doc, widget, \"MaxLen\");\n\n\tinfo->dr = pdf_get_inheritable(doc, widget, \"DR\");\n\tinfo->col = pdf_dict_getp(widget, \"MK/BG\");\n\tinfo->q = pdf_to_int(pdf_get_inheritable(doc, widget, \"Q\"));\n\tinfo->multiline = (ff & Ff_Multiline) != 0;\n\tinfo->comb = (ff & (Ff_Multiline|Ff_Password|Ff_FileSelect|Ff_Comb)) == Ff_Comb;\n\n\tif (ml == NULL)\n\t\tinfo->comb = 0;\n\telse\n\t\tinfo->max_len = pdf_to_int(ml);\n\n\tget_font_info(doc, info->dr, da, &info->font_rec);\n}\n\nvoid pdf_fzbuf_print_da(fz_context *ctx, fz_buffer *fzbuf, pdf_da_info *di)\n{\n\tif (di->font_name != NULL && di->font_size != 0)\n\t\tfz_buffer_printf(ctx, fzbuf, \"/%s %d Tf\", di->font_name, di->font_size);\n\n\tswitch (di->col_size)\n\t{\n\tcase 1:\n\t\tfz_buffer_printf(ctx, fzbuf, \" %f g\", di->col[0]);\n\t\tbreak;\n\n\tcase 3:\n\t\tfz_buffer_printf(ctx, fzbuf, \" %f %f %f rg\", di->col[0], di->col[1], di->col[2]);\n\t\tbreak;\n\n\tcase 4:\n\t\tfz_buffer_printf(ctx, fzbuf, \" %f %f %f %f k\", di->col[0], di->col[1], di->col[2], di->col[3]);\n\t\tbreak;\n\n\tdefault:\n\t\tfz_buffer_printf(ctx, fzbuf, \" 0 g\");\n\t\tbreak;\n\t}\n}\n\nstatic fz_rect *measure_text(pdf_document *doc, font_info *font_rec, const fz_matrix *tm, char *text, fz_rect *bbox)\n{\n\tpdf_measure_text(doc->ctx, font_rec->font, (unsigned char *)text, strlen(text), bbox);\n\n\tbbox->x0 *= font_rec->da_rec.font_size * tm->a;\n\tbbox->y0 *= font_rec->da_rec.font_size * tm->d;\n\tbbox->x1 *= font_rec->da_rec.font_size * tm->a;\n\tbbox->y1 *= font_rec->da_rec.font_size * tm->d;\n\n\treturn bbox;\n}\n\nstatic void fzbuf_print_color(fz_context *ctx, fz_buffer *fzbuf, pdf_obj *arr, int stroke, float adj)\n{\n\tswitch (pdf_array_len(arr))\n\t{\n\tcase 1:\n\t\tfz_buffer_printf(ctx, fzbuf, stroke?\"%f G\\n\":\"%f g\\n\",\n\t\t\tpdf_to_real(pdf_array_get(arr, 0)) + adj);\n\t\tbreak;\n\tcase 3:\n\t\tfz_buffer_printf(ctx, fzbuf, stroke?\"%f %f %f RG\\n\":\"%f %f %f rg\\n\",\n\t\t\tpdf_to_real(pdf_array_get(arr, 0)) + adj,\n\t\t\tpdf_to_real(pdf_array_get(arr, 1)) + adj,\n\t\t\tpdf_to_real(pdf_array_get(arr, 2)) + adj);\n\t\tbreak;\n\tcase 4:\n\t\tfz_buffer_printf(ctx, fzbuf, stroke?\"%f %f %f %f K\\n\":\"%f %f %f %f k\\n\",\n\t\t\tpdf_to_real(pdf_array_get(arr, 0)),\n\t\t\tpdf_to_real(pdf_array_get(arr, 1)),\n\t\t\tpdf_to_real(pdf_array_get(arr, 2)),\n\t\t\tpdf_to_real(pdf_array_get(arr, 3)));\n\t\tbreak;\n\t}\n}\n\nstatic void fzbuf_print_text(fz_context *ctx, fz_buffer *fzbuf, const fz_rect *clip, pdf_obj *col, font_info *font_rec, const fz_matrix *tm, char *text)\n{\n\tfz_buffer_printf(ctx, fzbuf, fmt_q);\n\tif (clip)\n\t{\n\t\tfz_buffer_printf(ctx, fzbuf, fmt_re, clip->x0, clip->y0, clip->x1 - clip->x0, clip->y1 - clip->y0);\n\t\tfz_buffer_printf(ctx, fzbuf, fmt_W);\n\t\tif (col)\n\t\t{\n\t\t\tfzbuf_print_color(ctx, fzbuf, col, 0, 0.0);\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_f);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_n);\n\t\t}\n\t}\n\n\tfz_buffer_printf(ctx, fzbuf, fmt_BT);\n\n\tpdf_fzbuf_print_da(ctx, fzbuf, &font_rec->da_rec);\n\n\tfz_buffer_printf(ctx, fzbuf, \"\\n\");\n\tif (tm)\n\t\tfz_buffer_printf(ctx, fzbuf, fmt_Tm, tm->a, tm->b, tm->c, tm->d, tm->e, tm->f);\n\n\tfz_buffer_cat_pdf_string(ctx, fzbuf, text);\n\tfz_buffer_printf(ctx, fzbuf, fmt_Tj);\n\tfz_buffer_printf(ctx, fzbuf, fmt_ET);\n\tfz_buffer_printf(ctx, fzbuf, fmt_Q);\n}\n\nstatic fz_buffer *create_text_buffer(fz_context *ctx, const fz_rect *clip, text_widget_info *info, const fz_matrix *tm, char *text)\n{\n\tfz_buffer *fzbuf = fz_new_buffer(ctx, 0);\n\n\tfz_try(ctx)\n\t{\n\t\tfz_buffer_printf(ctx, fzbuf, fmt_Tx_BMC);\n\t\tfzbuf_print_text(ctx, fzbuf, clip, info->col, &info->font_rec, tm, text);\n\t\tfz_buffer_printf(ctx, fzbuf, fmt_EMC);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, fzbuf);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn fzbuf;\n}\n\nstatic fz_buffer *create_aligned_text_buffer(pdf_document *doc, const fz_rect *clip, text_widget_info *info, const fz_matrix *tm, char *text)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_matrix atm = *tm;\n\n\tif (info->q != Q_Left)\n\t{\n\t\tfz_rect rect;\n\n\t\tmeasure_text(doc, &info->font_rec, tm, text, &rect);\n\t\tatm.e -= info->q == Q_Right ? rect.x1 : (rect.x1 - rect.x0) / 2;\n\t}\n\n\treturn create_text_buffer(ctx, clip, info, &atm, text);\n}\n\nstatic void measure_ascent_descent(pdf_document *doc, font_info *finf, char *text, float *ascent, float *descent)\n{\n\tfz_context *ctx = doc->ctx;\n\tchar *testtext = NULL;\n\tfz_rect bbox;\n\tfont_info tinf = *finf;\n\n\tfz_var(testtext);\n\tfz_try(ctx)\n\t{\n\t\t/* Heuristic: adding \"My\" to text will in most cases\n\t\t * produce a measurement that will encompass all chars */\n\t\ttesttext = fz_malloc(ctx, strlen(text) + 3);\n\t\tstrcpy(testtext, \"My\");\n\t\tstrcat(testtext, text);\n\t\ttinf.da_rec.font_size = 1;\n\t\tmeasure_text(doc, &tinf, &fz_identity, testtext, &bbox);\n\t\t*descent = -bbox.y0;\n\t\t*ascent = bbox.y1;\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_free(ctx, testtext);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\ntypedef struct text_splitter_s\n{\n\tfont_info *info;\n\tfloat width;\n\tfloat height;\n\tfloat scale;\n\tfloat unscaled_width;\n\tfloat fontsize;\n\tfloat lineheight;\n\tchar *text;\n\tint done;\n\tfloat x_orig;\n\tfloat y_orig;\n\tfloat x;\n\tfloat x_end;\n\tint text_start;\n\tint text_end;\n\tint max_lines;\n\tint retry;\n} text_splitter;\n\nstatic void text_splitter_init(text_splitter *splitter, font_info *info, char *text, float width, float height, int variable)\n{\n\tfloat fontsize = info->da_rec.font_size;\n\n\tmemset(splitter, 0, sizeof(*splitter));\n\tsplitter->info = info;\n\tsplitter->text = text;\n\tsplitter->width = width;\n\tsplitter->unscaled_width = width;\n\tsplitter->height = height;\n\tsplitter->fontsize = fontsize;\n\tsplitter->scale = 1.0;\n\tsplitter->lineheight = fontsize * info->lineheight ;\n\t/* RJW: The cast in the following line is important, as otherwise\n\t * under MSVC in the variable = 0 case, splitter->max_lines becomes\n\t * INT_MIN. */\n\tsplitter->max_lines = variable ? (int)(height/splitter->lineheight) : INT_MAX;\n}\n\nstatic void text_splitter_start_pass(text_splitter *splitter)\n{\n\tsplitter->text_end = 0;\n\tsplitter->x_orig = 0;\n\tsplitter->y_orig = 0;\n}\n\nstatic void text_splitter_start_line(text_splitter *splitter)\n{\n\tsplitter->x_end = 0;\n}\n\nstatic int text_splitter_layout(fz_context *ctx, text_splitter *splitter)\n{\n\tchar *text;\n\tfloat room;\n\tfloat stride;\n\tint count;\n\tint len;\n\tfloat fontsize = splitter->info->da_rec.font_size;\n\n\tsplitter->x = splitter->x_end;\n\tsplitter->text_start = splitter->text_end;\n\n\ttext = splitter->text + splitter->text_start;\n\troom = splitter->unscaled_width - splitter->x;\n\n\tif (strchr(\"\\r\\n\", text[0]))\n\t{\n\t\t/* Consume return chars and report end of line */\n\t\tsplitter->text_end += strspn(text, \"\\r\\n\");\n\t\tsplitter->text_start = splitter->text_end;\n\t\tsplitter->done = (splitter->text[splitter->text_end] == '\\0');\n\t\treturn 0;\n\t}\n\telse if (text[0] == ' ')\n\t{\n\t\t/* Treat each space as a word */\n\t\tlen = 1;\n\t}\n\telse\n\t{\n\t\tlen = 0;\n\t\twhile (text[len] != '\\0' && !strchr(\" \\r\\n\", text[len]))\n\t\t\tlen ++;\n\t}\n\n\tstride = pdf_text_stride(ctx, splitter->info->font, fontsize, (unsigned char *)text, len, room, &count);\n\n\t/* If not a single char fits although the line is empty, then force one char */\n\tif (count == 0 && splitter->x == 0.0)\n\t\tstride = pdf_text_stride(ctx, splitter->info->font, fontsize, (unsigned char *)text, 1, FLT_MAX, &count);\n\n\tif (count < len && splitter->retry)\n\t{\n\t\t/* The word didn't fit and we are in retry mode. Work out the\n\t\t * least additional scaling that may help */\n\t\tfloat fitwidth; /* width if we force the word in */\n\t\tfloat hstretchwidth; /* width if we just bump by 10% */\n\t\tfloat vstretchwidth; /* width resulting from forcing in another line */\n\t\tfloat bestwidth;\n\n\t\tfitwidth = splitter->x +\n\t\t\tpdf_text_stride(ctx, splitter->info->font, fontsize, (unsigned char *)text, len, FLT_MAX, &count);\n\t\t/* FIXME: temporary fiddle factor. Would be better to work in integers */\n\t\tfitwidth *= 1.001f;\n\n\t\t/* Stretching by 10% is worth trying only if processing the first word on the line */\n\t\thstretchwidth = splitter->x == 0.0\n\t\t\t? splitter->width * 1.1 / splitter->scale\n\t\t\t: FLT_MAX;\n\n\t\tvstretchwidth = splitter->width * (splitter->max_lines + 1) * splitter->lineheight\n\t\t\t/ splitter->height;\n\n\t\tbestwidth = fz_min(fitwidth, fz_min(hstretchwidth, vstretchwidth));\n\n\t\tif (bestwidth == vstretchwidth)\n\t\t\tsplitter->max_lines ++;\n\n\t\tsplitter->scale = splitter->width / bestwidth;\n\t\tsplitter->unscaled_width = bestwidth;\n\n\t\tsplitter->retry = 0;\n\n\t\t/* Try again */\n\t\troom = splitter->unscaled_width - splitter->x;\n\t\tstride = pdf_text_stride(ctx, splitter->info->font, fontsize, (unsigned char *)text, len, room, &count);\n\t}\n\n\t/* This is not the first word on the line. Best to give up on this line and push\n\t * the word onto the next */\n\tif (count < len && splitter->x > 0.0)\n\t\treturn 0;\n\n\tsplitter->text_end = splitter->text_start + count;\n\tsplitter->x_end = splitter->x + stride;\n\tsplitter->done = (splitter->text[splitter->text_end] == '\\0');\n\treturn 1;\n}\n\nstatic void text_splitter_move(text_splitter *splitter, float newy, float *relx, float *rely)\n{\n\t*relx = splitter->x - splitter->x_orig;\n\t*rely = newy * splitter->lineheight - splitter->y_orig;\n\n\tsplitter->x_orig = splitter->x;\n\tsplitter->y_orig = newy * splitter->lineheight;\n}\n\nstatic void text_splitter_retry(text_splitter *splitter)\n{\n\tif (splitter->retry)\n\t{\n\t\t/* Already tried expanding lines. Overflow must\n\t\t * be caused by carriage control */\n\t\tsplitter->max_lines ++;\n\t\tsplitter->retry = 0;\n\t\tsplitter->unscaled_width = splitter->width * splitter->max_lines * splitter->lineheight\n\t\t\t/ splitter->height;\n\t\tsplitter->scale = splitter->width / splitter->unscaled_width;\n\t}\n\telse\n\t{\n\t\tsplitter->retry = 1;\n\t}\n}\n\nstatic void fzbuf_print_text_start(fz_context *ctx, fz_buffer *fzbuf, const fz_rect *clip, pdf_obj *col, font_info *font, const fz_matrix *tm)\n{\n\tfz_buffer_printf(ctx, fzbuf, fmt_Tx_BMC);\n\tfz_buffer_printf(ctx, fzbuf, fmt_q);\n\n\tif (clip)\n\t{\n\t\tfz_buffer_printf(ctx, fzbuf, fmt_re, clip->x0, clip->y0, clip->x1 - clip->x0, clip->y1 - clip->y0);\n\t\tfz_buffer_printf(ctx, fzbuf, fmt_W);\n\t\tif (col)\n\t\t{\n\t\t\tfzbuf_print_color(ctx, fzbuf, col, 0, 0.0);\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_f);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_n);\n\t\t}\n\t}\n\n\tfz_buffer_printf(ctx, fzbuf, fmt_BT);\n\n\tpdf_fzbuf_print_da(ctx, fzbuf, &font->da_rec);\n\tfz_buffer_printf(ctx, fzbuf, \"\\n\");\n\n\tfz_buffer_printf(ctx, fzbuf, fmt_Tm, tm->a, tm->b, tm->c, tm->d, tm->e, tm->f);\n}\n\nstatic void fzbuf_print_text_end(fz_context *ctx, fz_buffer *fzbuf)\n{\n\tfz_buffer_printf(ctx, fzbuf, fmt_ET);\n\tfz_buffer_printf(ctx, fzbuf, fmt_Q);\n\tfz_buffer_printf(ctx, fzbuf, fmt_EMC);\n}\n\nstatic void fzbuf_print_text_word(fz_context *ctx, fz_buffer *fzbuf, float x, float y, char *text, int count)\n{\n\tint i;\n\n\tfz_buffer_printf(ctx, fzbuf, fmt_Td, x, y);\n\tfz_buffer_printf(ctx, fzbuf, \"(\");\n\n\tfor (i = 0; i < count; i++)\n\t\tfz_buffer_printf(ctx, fzbuf, \"%c\", text[i]);\n\n\tfz_buffer_printf(ctx, fzbuf, \") Tj\\n\");\n}\n\nstatic fz_buffer *create_text_appearance(pdf_document *doc, const fz_rect *bbox, const fz_matrix *oldtm, text_widget_info *info, char *text)\n{\n\tfz_context *ctx = doc->ctx;\n\tint fontsize;\n\tint variable;\n\tfloat height, width, full_width;\n\tfz_buffer *fzbuf = NULL;\n\tfz_buffer *fztmp = NULL;\n\tfz_rect rect;\n\tfz_rect tbox;\n\trect = *bbox;\n\n\tif (rect.x1 - rect.x0 > 3.0 && rect.y1 - rect.y0 > 3.0)\n\t{\n\t\trect.x0 += 1.0;\n\t\trect.x1 -= 1.0;\n\t\trect.y0 += 1.0;\n\t\trect.y1 -= 1.0;\n\t}\n\n\theight = rect.y1 - rect.y0;\n\twidth = rect.x1 - rect.x0;\n\tfull_width = bbox->x1 - bbox->x0;\n\n\tfz_var(fzbuf);\n\tfz_var(fztmp);\n\tfz_try(ctx)\n\t{\n\t\tfloat ascent, descent;\n\t\tfz_matrix tm;\n\n\t\tvariable = (info->font_rec.da_rec.font_size == 0);\n\t\tfontsize = variable\n\t\t\t? (info->multiline ? 14.0 : height / info->font_rec.lineheight)\n\t\t\t: info->font_rec.da_rec.font_size;\n\n\t\tinfo->font_rec.da_rec.font_size = fontsize;\n\n\t\tmeasure_ascent_descent(doc, &info->font_rec, text, &ascent, &descent);\n\n\t\tif (info->multiline)\n\t\t{\n\t\t\ttext_splitter splitter;\n\n\t\t\ttext_splitter_init(&splitter, &info->font_rec, text, width, height, variable);\n\n\t\t\twhile (!splitter.done)\n\t\t\t{\n\t\t\t\t/* Try a layout pass */\n\t\t\t\tint line = 0;\n\n\t\t\t\tfz_drop_buffer(ctx, fztmp);\n\t\t\t\tfztmp = NULL;\n\t\t\t\tfztmp = fz_new_buffer(ctx, 0);\n\n\t\t\t\ttext_splitter_start_pass(&splitter);\n\n\t\t\t\t/* Layout unscaled text to a scaled-up width, so that\n\t\t\t\t * the scaled-down text will fit the unscaled width */\n\n\t\t\t\twhile (!splitter.done && line < splitter.max_lines)\n\t\t\t\t{\n\t\t\t\t\t/* Layout a line */\n\t\t\t\t\ttext_splitter_start_line(&splitter);\n\n\t\t\t\t\twhile (!splitter.done && text_splitter_layout(ctx, &splitter))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (splitter.text[splitter.text_start] != ' ')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfloat x, y;\n\t\t\t\t\t\t\tchar *word = text+splitter.text_start;\n\t\t\t\t\t\t\tint wordlen = splitter.text_end-splitter.text_start;\n\n\t\t\t\t\t\t\ttext_splitter_move(&splitter, -line, &x, &y);\n\t\t\t\t\t\t\tfzbuf_print_text_word(ctx, fztmp, x, y, word, wordlen);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tline ++;\n\t\t\t\t}\n\n\t\t\t\tif (!splitter.done)\n\t\t\t\t\ttext_splitter_retry(&splitter);\n\t\t\t}\n\n\t\t\tfzbuf = fz_new_buffer(ctx, 0);\n\n\t\t\ttm.a = splitter.scale;\n\t\t\ttm.b = 0.0;\n\t\t\ttm.c = 0.0;\n\t\t\ttm.d = splitter.scale;\n\t\t\ttm.e = rect.x0;\n\t\t\ttm.f = rect.y1 - (1.0+ascent-descent)*fontsize*splitter.scale/2.0;\n\n\t\t\tfzbuf_print_text_start(ctx, fzbuf, &rect, info->col, &info->font_rec, &tm);\n\n\t\t\tfz_buffer_cat(ctx, fzbuf, fztmp);\n\n\t\t\tfzbuf_print_text_end(ctx, fzbuf);\n\t\t}\n\t\telse if (info->comb)\n\t\t{\n\t\t\tint i, n = fz_mini((int)strlen(text), info->max_len);\n\t\t\tfloat comb_width = full_width/info->max_len;\n\t\t\tfloat char_width = pdf_text_stride(ctx, info->font_rec.font, fontsize, (unsigned char *)\"M\", 1, FLT_MAX, NULL);\n\t\t\tfloat init_skip = (comb_width - char_width)/2.0;\n\n\t\t\tfz_translate(&tm, rect.x0, rect.y1 - (height+(ascent-descent)*fontsize)/2.0);\n\n\t\t\tfzbuf = fz_new_buffer(ctx, 0);\n\n\t\t\tfzbuf_print_text_start(ctx, fzbuf, &rect, info->col, &info->font_rec, &tm);\n\n\t\t\tfor (i = 0; i < n; i++)\n\t\t\t\tfzbuf_print_text_word(ctx, fzbuf, i == 0 ? init_skip : comb_width, 0.0, text+i, 1);\n\n\t\t\tfzbuf_print_text_end(ctx, fzbuf);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (oldtm)\n\t\t\t{\n\t\t\t\ttm = *oldtm;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfz_translate(&tm, rect.x0, rect.y1 - (height+(ascent-descent)*fontsize)/2.0);\n\n\t\t\t\tswitch (info->q)\n\t\t\t\t{\n\t\t\t\tcase Q_Right: tm.e += width; break;\n\t\t\t\tcase Q_Cent: tm.e += width/2; break;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (variable)\n\t\t\t{\n\t\t\t\tmeasure_text(doc, &info->font_rec, &tm, text, &tbox);\n\n\t\t\t\tif (tbox.x1 - tbox.x0 > width)\n\t\t\t\t{\n\t\t\t\t\t/* Scale the text to fit but use the same offset\n\t\t\t\t\t* to keep the baseline constant */\n\t\t\t\t\ttm.a *= width / (tbox.x1 - tbox.x0);\n\t\t\t\t\ttm.d *= width / (tbox.x1 - tbox.x0);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfzbuf = create_aligned_text_buffer(doc, &rect, info, &tm, text);\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, fztmp);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, fzbuf);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn fzbuf;\n}\n\nstatic int get_matrix(pdf_document *doc, pdf_xobject *form, int q, fz_matrix *mt)\n{\n\tfz_context *ctx = doc->ctx;\n\tint found = 0;\n\tpdf_lexbuf lbuf;\n\tfz_stream *str;\n\n\tstr = pdf_open_stream(doc, pdf_to_num(form->contents), pdf_to_gen(form->contents));\n\n\tpdf_lexbuf_init(ctx, &lbuf, PDF_LEXBUF_SMALL);\n\n\tfz_try(ctx)\n\t{\n\t\tint tok;\n\t\tfloat coefs[MATRIX_COEFS];\n\t\tint coef_i = 0;\n\n\t\t/* Look for the text matrix Tm in the stream */\n\t\tfor (tok = pdf_lex(str, &lbuf); tok != PDF_TOK_EOF; tok = pdf_lex(str, &lbuf))\n\t\t{\n\t\t\tif (tok == PDF_TOK_INT || tok == PDF_TOK_REAL)\n\t\t\t{\n\t\t\t\tif (coef_i >= MATRIX_COEFS)\n\t\t\t\t{\n\t\t\t\t\tint i;\n\t\t\t\t\tfor (i = 0; i < MATRIX_COEFS-1; i++)\n\t\t\t\t\t\tcoefs[i] = coefs[i+1];\n\n\t\t\t\t\tcoef_i = MATRIX_COEFS-1;\n\t\t\t\t}\n\n\t\t\t\tcoefs[coef_i++] = tok == PDF_TOK_INT ? lbuf.i : lbuf.f;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (tok == PDF_TOK_KEYWORD && !strcmp(lbuf.scratch, \"Tm\") && coef_i == MATRIX_COEFS)\n\t\t\t\t{\n\t\t\t\t\tfound = 1;\n\t\t\t\t\tmt->a = coefs[0];\n\t\t\t\t\tmt->b = coefs[1];\n\t\t\t\t\tmt->c = coefs[2];\n\t\t\t\t\tmt->d = coefs[3];\n\t\t\t\t\tmt->e = coefs[4];\n\t\t\t\t\tmt->f = coefs[5];\n\t\t\t\t}\n\n\t\t\t\tcoef_i = 0;\n\t\t\t}\n\t\t}\n\n\t\tif (found)\n\t\t{\n\t\t\tfz_rect bbox;\n\t\t\tpdf_to_rect(ctx, pdf_dict_gets(form->contents, \"BBox\"), &bbox);\n\n\t\t\tswitch (q)\n\t\t\t{\n\t\t\tcase Q_Left:\n\t\t\t\tmt->e = bbox.x0 + 1;\n\t\t\t\tbreak;\n\n\t\t\tcase Q_Cent:\n\t\t\t\tmt->e = (bbox.x1 - bbox.x0) / 2;\n\t\t\t\tbreak;\n\n\t\t\tcase Q_Right:\n\t\t\t\tmt->e = bbox.x1 - 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(str);\n\t\tpdf_lexbuf_fin(&lbuf);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn found;\n}\n\nstatic char *to_font_encoding(fz_context *ctx, pdf_font_desc *font, char *utf8)\n{\n\tint i;\n\tint needs_converting = 0;\n\n\t/* Temporay partial solution. We are using a slow lookup in the conversion\n\t * below, so we avoid performing the conversion unnecessarily. We check for\n\t * top-bit-set chars, and convert only if they are present. We should also\n\t * check that the font encoding is one that agrees with utf8 from 0 to 7f,\n\t * but for now we get away without doing so. This is after all an improvement\n\t * on just strdup */\n\tfor (i = 0; utf8[i] != '\\0'; i++)\n\t{\n\t\tif (utf8[i] & 0x80)\n\t\t\tneeds_converting = 1;\n\t}\n\n\t/* Even if we need to convert, we cannot do so if the font has no cid_to_ucs mapping */\n\tif (needs_converting && font->cid_to_ucs)\n\t{\n\t\tchar *buf = fz_malloc(ctx, strlen(utf8) + 1);\n\t\tchar *bufp = buf;\n\n\t\tfz_try(ctx)\n\t\t{\n\t\t\twhile(*utf8)\n\t\t\t{\n\t\t\t\tif (*utf8 & 0x80)\n\t\t\t\t{\n\t\t\t\t\tint rune;\n\n\t\t\t\t\tutf8 += fz_chartorune(&rune, utf8);\n\n\t\t\t\t\t/* Slow search for the cid that maps to the unicode value held in 'rune\" */\n\t\t\t\t\tfor (i = 0; i < font->cid_to_ucs_len && font->cid_to_ucs[i] != rune; i++)\n\t\t\t\t\t\t;\n\n\t\t\t\t\t/* If found store the cid */\n\t\t\t\t\tif (i < font->cid_to_ucs_len)\n\t\t\t\t\t\t*bufp++ = i;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t*bufp++ = *utf8++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t*bufp = '\\0';\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_free(ctx, buf);\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\n\t\treturn buf;\n\t}\n\telse\n\t{\n\t\t/* If either no conversion is needed or the font has no cid_to_ucs\n\t\t * mapping then leave unconverted, although in the latter case the result\n\t\t * is likely incorrect */\n\t\treturn fz_strdup(ctx, utf8);\n\t}\n}\n\nstatic void account_for_rot(fz_rect *rect, fz_matrix *mat, int rot)\n{\n\tfloat width = rect->x1;\n\tfloat height = rect->y1;\n\n\tswitch (rot)\n\t{\n\tdefault:\n\t\t*mat = fz_identity;\n\t\tbreak;\n\tcase 90:\n\t\tfz_pre_rotate(fz_translate(mat, width, 0), rot);\n\t\trect->x1 = height;\n\t\trect->y1 = width;\n\t\tbreak;\n\tcase 180:\n\t\tfz_pre_rotate(fz_translate(mat, width, height), rot);\n\t\tbreak;\n\tcase 270:\n\t\tfz_pre_rotate(fz_translate(mat, 0, height), rot);\n\t\trect->x1 = height;\n\t\trect->y1 = width;\n\t\tbreak;\n\t}\n}\n\nstatic void copy_resources(pdf_obj *dst, pdf_obj *src)\n{\n\tint i, len;\n\n\tlen = pdf_dict_len(src);\n\tfor (i = 0; i < len; i++)\n\t{\n\t\tpdf_obj *key = pdf_dict_get_key(src, i);\n\n\t\tif (!pdf_dict_get(dst, key))\n\t\t\tpdf_dict_put(dst, key, pdf_dict_get_val(src, i));\n\t}\n}\n\nstatic pdf_xobject *load_or_create_form(pdf_document *doc, pdf_obj *obj, fz_rect *rect)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *ap = NULL;\n\tfz_matrix mat;\n\tint rot;\n\tpdf_obj *formobj = NULL;\n\tpdf_xobject *form = NULL;\n\tchar *dn = \"N\";\n\tfz_buffer *fzbuf = NULL;\n\tint create_form = 0;\n\n\tfz_var(formobj);\n\tfz_var(form);\n\tfz_var(fzbuf);\n\tfz_try(ctx)\n\t{\n\t\trot = pdf_to_int(pdf_dict_getp(obj, \"MK/R\"));\n\t\tpdf_to_rect(ctx, pdf_dict_gets(obj, \"Rect\"), rect);\n\t\trect->x1 -= rect->x0;\n\t\trect->y1 -= rect->y0;\n\t\trect->x0 = rect->y0 = 0;\n\t\taccount_for_rot(rect, &mat, rot);\n\n\t\tap = pdf_dict_gets(obj, \"AP\");\n\t\tif (ap == NULL)\n\t\t{\n\t\t\tap = pdf_new_dict(doc, 1);\n\t\t\tpdf_dict_puts_drop(obj, \"AP\", ap);\n\t\t}\n\n\t\tformobj = pdf_dict_gets(ap, dn);\n\t\tif (formobj == NULL)\n\t\t{\n\t\t\tformobj = pdf_new_xobject(doc, rect, &mat);\n\t\t\tpdf_dict_puts_drop(ap, dn, formobj);\n\t\t\tcreate_form = 1;\n\t\t}\n\n\t\tform = pdf_load_xobject(doc, formobj);\n\t\tif (create_form)\n\t\t{\n\t\t\tfzbuf = fz_new_buffer(ctx, 1);\n\t\t\tpdf_update_xobject_contents(doc, form, fzbuf);\n\t\t}\n\n\t\tcopy_resources(form->resources, pdf_get_inheritable(doc, obj, \"DR\"));\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, fzbuf);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_xobject(ctx, form);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn form;\n}\n\nstatic void update_marked_content(pdf_document *doc, pdf_xobject *form, fz_buffer *fzbuf)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_token tok;\n\tpdf_lexbuf lbuf;\n\tfz_stream *str_outer = NULL;\n\tfz_stream *str_inner = NULL;\n\tunsigned char *buf;\n\tint len;\n\tfz_buffer *newbuf = NULL;\n\n\tpdf_lexbuf_init(ctx, &lbuf, PDF_LEXBUF_SMALL);\n\n\tfz_var(str_outer);\n\tfz_var(str_inner);\n\tfz_var(newbuf);\n\tfz_try(ctx)\n\t{\n\t\tint bmc_found;\n\t\tint first = 1;\n\n\t\tnewbuf = fz_new_buffer(ctx, 0);\n\t\tstr_outer = pdf_open_stream(doc, pdf_to_num(form->contents), pdf_to_gen(form->contents));\n\t\tlen = fz_buffer_storage(ctx, fzbuf, &buf);\n\t\tstr_inner = fz_open_memory(ctx, buf, len);\n\n\t\t/* Copy the existing appearance stream to newbuf while looking for BMC */\n\t\tfor (tok = pdf_lex(str_outer, &lbuf); tok != PDF_TOK_EOF; tok = pdf_lex(str_outer, &lbuf))\n\t\t{\n\t\t\tif (first)\n\t\t\t\tfirst = 0;\n\t\t\telse\n\t\t\t\tfz_buffer_printf(ctx, newbuf, \" \");\n\n\t\t\tpdf_print_token(ctx, newbuf, tok, &lbuf);\n\t\t\tif (tok == PDF_TOK_KEYWORD && !strcmp(lbuf.scratch, \"BMC\"))\n\t\t\t\tbreak;\n\t\t}\n\n\t\tbmc_found = (tok != PDF_TOK_EOF);\n\n\t\tif (bmc_found)\n\t\t{\n\t\t\t/* Drop Tx BMC from the replacement appearance stream */\n\t\t\t(void)pdf_lex(str_inner, &lbuf);\n\t\t\t(void)pdf_lex(str_inner, &lbuf);\n\t\t}\n\n\t\t/* Copy the replacement appearance stream to newbuf */\n\t\tfor (tok = pdf_lex(str_inner, &lbuf); tok != PDF_TOK_EOF; tok = pdf_lex(str_inner, &lbuf))\n\t\t{\n\t\t\tfz_buffer_printf(ctx, newbuf, \" \");\n\t\t\tpdf_print_token(ctx, newbuf, tok, &lbuf);\n\t\t}\n\n\t\tif (bmc_found)\n\t\t{\n\t\t\t/* Drop the rest of the existing appearance stream until EMC found */\n\t\t\tfor (tok = pdf_lex(str_outer, &lbuf); tok != PDF_TOK_EOF; tok = pdf_lex(str_outer, &lbuf))\n\t\t\t{\n\t\t\t\tif (tok == PDF_TOK_KEYWORD && !strcmp(lbuf.scratch, \"EMC\"))\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t/* Copy the rest of the existing appearance stream to newbuf */\n\t\t\tfor (tok = pdf_lex(str_outer, &lbuf); tok != PDF_TOK_EOF; tok = pdf_lex(str_outer, &lbuf))\n\t\t\t{\n\t\t\t\tfz_buffer_printf(ctx, newbuf, \" \");\n\t\t\t\tpdf_print_token(ctx, newbuf, tok, &lbuf);\n\t\t\t}\n\t\t}\n\n\t\t/* Use newbuf in place of the existing appearance stream */\n\t\tpdf_update_xobject_contents(doc, form, newbuf);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(str_outer);\n\t\tfz_close(str_inner);\n\t\tfz_drop_buffer(ctx, newbuf);\n\t\tpdf_lexbuf_fin(&lbuf);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic int get_border_style(pdf_obj *obj)\n{\n\tchar *sname = pdf_to_name(pdf_dict_getp(obj, \"BS/S\"));\n\n\tif (!strcmp(sname, \"D\"))\n\t\treturn BS_Dashed;\n\telse if (!strcmp(sname, \"B\"))\n\t\treturn BS_Beveled;\n\telse if (!strcmp(sname, \"I\"))\n\t\treturn BS_Inset;\n\telse if (!strcmp(sname, \"U\"))\n\t\treturn BS_Underline;\n\telse\n\t\treturn BS_Solid;\n}\n\nstatic float get_border_width(pdf_obj *obj)\n{\n\tfloat w = pdf_to_real(pdf_dict_getp(obj, \"BS/W\"));\n\treturn w == 0.0 ? 1.0 : w;\n}\n\nvoid pdf_update_text_appearance(pdf_document *doc, pdf_obj *obj, char *eventValue)\n{\n\tfz_context *ctx = doc->ctx;\n\ttext_widget_info info;\n\tpdf_xobject *form = NULL;\n\tfz_buffer *fzbuf = NULL;\n\tfz_matrix tm;\n\tfz_rect rect;\n\tint has_tm;\n\tchar *text = NULL;\n\n\tmemset(&info, 0, sizeof(info));\n\n\tfz_var(info);\n\tfz_var(form);\n\tfz_var(fzbuf);\n\tfz_var(text);\n\tfz_try(ctx)\n\t{\n\t\tget_text_widget_info(doc, obj, &info);\n\n\t\tif (eventValue)\n\t\t\ttext = to_font_encoding(ctx, info.font_rec.font, eventValue);\n\t\telse\n\t\t\ttext = pdf_field_value(doc, obj);\n\n\t\tform = load_or_create_form(doc, obj, &rect);\n\n\t\thas_tm = get_matrix(doc, form, info.q, &tm);\n\t\tfzbuf = create_text_appearance(doc, &form->bbox, has_tm ? &tm : NULL, &info,\n\t\t\ttext?text:\"\");\n\t\tupdate_marked_content(doc, form, fzbuf);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_free(ctx, text);\n\t\tpdf_drop_xobject(ctx, form);\n\t\tfz_drop_buffer(ctx, fzbuf);\n\t\tfont_info_fin(ctx, &info.font_rec);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_warn(ctx, \"update_text_appearance failed\");\n\t}\n}\n\nvoid pdf_update_combobox_appearance(pdf_document *doc, pdf_obj *obj)\n{\n\tfz_context *ctx = doc->ctx;\n\ttext_widget_info info;\n\tpdf_xobject *form = NULL;\n\tfz_buffer *fzbuf = NULL;\n\tfz_matrix tm;\n\tfz_rect rect;\n\tint has_tm;\n\tpdf_obj *val;\n\tchar *text;\n\n\tmemset(&info, 0, sizeof(info));\n\n\tfz_var(info);\n\tfz_var(form);\n\tfz_var(fzbuf);\n\tfz_try(ctx)\n\t{\n\t\tget_text_widget_info(doc, obj, &info);\n\n\t\tval = pdf_get_inheritable(doc, obj, \"V\");\n\n\t\tif (pdf_is_array(val))\n\t\t\tval = pdf_array_get(val, 0);\n\n\t\ttext = pdf_to_str_buf(val);\n\n\t\tif (!text)\n\t\t\ttext = \"\";\n\n\t\tform = load_or_create_form(doc, obj, &rect);\n\n\t\thas_tm = get_matrix(doc, form, info.q, &tm);\n\t\tfzbuf = create_text_appearance(doc, &form->bbox, has_tm ? &tm : NULL, &info,\n\t\t\ttext?text:\"\");\n\t\tupdate_marked_content(doc, form, fzbuf);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_xobject(ctx, form);\n\t\tfz_drop_buffer(ctx, fzbuf);\n\t\tfont_info_fin(ctx, &info.font_rec);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_warn(ctx, \"update_text_appearance failed\");\n\t}\n}\n\nvoid pdf_update_pushbutton_appearance(pdf_document *doc, pdf_obj *obj)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_rect rect;\n\tpdf_xobject *form = NULL;\n\tfz_buffer *fzbuf = NULL;\n\tpdf_obj *tobj = NULL;\n\tfont_info font_rec;\n\tint bstyle;\n\tfloat bwidth;\n\tfloat btotal;\n\n\tmemset(&font_rec, 0, sizeof(font_rec));\n\n\tfz_var(font_rec);\n\tfz_var(form);\n\tfz_var(fzbuf);\n\tfz_try(ctx)\n\t{\n\t\tform = load_or_create_form(doc, obj, &rect);\n\t\tfzbuf = fz_new_buffer(ctx, 0);\n\t\ttobj = pdf_dict_getp(obj, \"MK/BG\");\n\t\tif (pdf_is_array(tobj))\n\t\t{\n\t\t\tfzbuf_print_color(ctx, fzbuf, tobj, 0, 0.0);\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_re,\n\t\t\t\trect.x0, rect.y0, rect.x1, rect.y1);\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_f);\n\t\t}\n\t\tbstyle = get_border_style(obj);\n\t\tbwidth = get_border_width(obj);\n\t\tbtotal = bwidth;\n\t\tif (bstyle == BS_Beveled || bstyle == BS_Inset)\n\t\t{\n\t\t\tbtotal += bwidth;\n\n\t\t\tif (bstyle == BS_Beveled)\n\t\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_g, 1.0);\n\t\t\telse\n\t\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_g, 0.33);\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_m, bwidth, bwidth);\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_l, bwidth, rect.y1 - bwidth);\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_l, rect.x1 - bwidth, rect.y1 - bwidth);\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_l, rect.x1 - 2 * bwidth, rect.y1 - 2 * bwidth);\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_l, 2 * bwidth, rect.y1 - 2 * bwidth);\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_l, 2 * bwidth, 2 * bwidth);\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_f);\n\t\t\tif (bstyle == BS_Beveled)\n\t\t\t\tfzbuf_print_color(ctx, fzbuf, tobj, 0, -0.25);\n\t\t\telse\n\t\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_g, 0.66);\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_m, rect.x1 - bwidth, rect.y1 - bwidth);\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_l, rect.x1 - bwidth, bwidth);\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_l, bwidth, bwidth);\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_l, 2 * bwidth, 2 * bwidth);\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_l, rect.x1 - 2 * bwidth, 2 * bwidth);\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_l, rect.x1 - 2 * bwidth, rect.y1 - 2 * bwidth);\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_f);\n\t\t}\n\n\t\ttobj = pdf_dict_getp(obj, \"MK/BC\");\n\t\tif (tobj)\n\t\t{\n\t\t\tfzbuf_print_color(ctx, fzbuf, tobj, 1, 0.0);\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_w, bwidth);\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_re,\n\t\t\t\tbwidth/2, bwidth/2,\n\t\t\t\trect.x1 -bwidth/2, rect.y1 - bwidth/2);\n\t\t\tfz_buffer_printf(ctx, fzbuf, fmt_s);\n\t\t}\n\n\t\ttobj = pdf_dict_getp(obj, \"MK/CA\");\n\t\tif (tobj)\n\t\t{\n\t\t\tfz_rect clip = rect;\n\t\t\tfz_rect bounds;\n\t\t\tfz_matrix mat;\n\t\t\tchar *da = pdf_to_str_buf(pdf_get_inheritable(doc, obj, \"DA\"));\n\t\t\tchar *text = pdf_to_str_buf(tobj);\n\n\t\t\tclip.x0 += btotal;\n\t\t\tclip.y0 += btotal;\n\t\t\tclip.x1 -= btotal;\n\t\t\tclip.y1 -= btotal;\n\n\t\t\tget_font_info(doc, form->resources, da, &font_rec);\n\t\t\tmeasure_text(doc, &font_rec, &fz_identity, text, &bounds);\n\t\t\tfz_translate(&mat, (rect.x1 - bounds.x1)/2, (rect.y1 - bounds.y1)/2);\n\t\t\tfzbuf_print_text(ctx, fzbuf, &clip, NULL, &font_rec, &mat, text);\n\t\t}\n\n\t\tpdf_update_xobject_contents(doc, form, fzbuf);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfont_info_fin(ctx, &font_rec);\n\t\tfz_drop_buffer(ctx, fzbuf);\n\t\tpdf_drop_xobject(ctx, form);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nvoid pdf_update_text_markup_appearance(pdf_document *doc, pdf_annot *annot, fz_annot_type type)\n{\n\tfloat color[3];\n\tfloat alpha;\n\tfloat line_height;\n\tfloat line_thickness;\n\n\tswitch (type)\n\t{\n\t\tcase FZ_ANNOT_HIGHLIGHT:\n\t\t\tcolor[0] = 1.0;\n\t\t\tcolor[1] = 1.0;\n\t\t\tcolor[2] = 0.0;\n\t\t\talpha = 0.5;\n\t\t\tline_thickness = 1.0;\n\t\t\tline_height = 0.5;\n\t\t\tbreak;\n\t\tcase FZ_ANNOT_UNDERLINE:\n\t\t\tcolor[0] = 0.0;\n\t\t\tcolor[1] = 0.0;\n\t\t\tcolor[2] = 1.0;\n\t\t\talpha = 1.0;\n\t\t\tline_thickness = LINE_THICKNESS;\n\t\t\tline_height = UNDERLINE_HEIGHT;\n\t\t\tbreak;\n\t\tcase FZ_ANNOT_STRIKEOUT:\n\t\t\tcolor[0] = 1.0;\n\t\t\tcolor[1] = 0.0;\n\t\t\tcolor[2] = 0.0;\n\t\t\talpha = 1.0;\n\t\t\tline_thickness = LINE_THICKNESS;\n\t\t\tline_height = STRIKE_HEIGHT;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn;\n\t}\n\n\tpdf_set_markup_appearance(doc, annot, color, alpha, line_thickness, line_height);\n}\n\nstatic void update_rect(fz_context *ctx, pdf_annot *annot)\n{\n\tpdf_to_rect(ctx, pdf_dict_gets(annot->obj, \"Rect\"), &annot->rect);\n\tannot->pagerect = annot->rect;\n\tfz_transform_rect(&annot->pagerect, &annot->page->ctm);\n}\n\nvoid pdf_set_annot_appearance(pdf_document *doc, pdf_annot *annot, fz_rect *rect, fz_display_list *disp_list)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *obj = annot->obj;\n\tconst fz_matrix *page_ctm = &annot->page->ctm;\n\tfz_matrix ctm;\n\tfz_matrix mat = fz_identity;\n\tfz_device *dev = NULL;\n\tpdf_xobject *xobj = NULL;\n\n\tfz_invert_matrix(&ctm, page_ctm);\n\n\tfz_var(dev);\n\tfz_try(ctx)\n\t{\n\t\tpdf_obj *ap_obj;\n\t\tfz_rect trect = *rect;\n\n\t\tfz_transform_rect(&trect, &ctm);\n\n\t\tpdf_dict_puts_drop(obj, \"Rect\", pdf_new_rect(doc, &trect));\n\n\t\t/* See if there is a current normal appearance */\n\t\tap_obj = pdf_dict_getp(obj, \"AP/N\");\n\t\tif (!pdf_is_stream(doc, pdf_to_num(ap_obj), pdf_to_gen(ap_obj)))\n\t\t\tap_obj = NULL;\n\n\t\tif (ap_obj == NULL)\n\t\t{\n\t\t\tap_obj = pdf_new_xobject(doc, &trect, &mat);\n\t\t\tpdf_dict_putp_drop(obj, \"AP/N\", ap_obj);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tpdf_xref_ensure_incremental_object(doc, pdf_to_num(ap_obj));\n\t\t\t/* Update bounding box and matrix in reused xobject obj */\n\t\t\tpdf_dict_puts_drop(ap_obj, \"BBox\", pdf_new_rect(doc, &trect));\n\t\t\tpdf_dict_puts_drop(ap_obj, \"Matrix\", pdf_new_matrix(doc, &mat));\n\t\t}\n\n\t\tdev = pdf_new_pdf_device(doc, ap_obj, pdf_dict_gets(ap_obj, \"Resources\"), &mat);\n\t\tfz_run_display_list(disp_list, dev, &ctm, &fz_infinite_rect, NULL);\n\t\tfz_free_device(dev);\n\n\t\t/* Mark the appearance as changed - required for partial update */\n\t\txobj = pdf_load_xobject(doc, ap_obj);\n\t\tif (xobj)\n\t\t{\n\t\t\t/* Update bounding box and matrix also in the xobject structure */\n\t\t\txobj->bbox = trect;\n\t\t\txobj->matrix = mat;\n\t\t\txobj->iteration++;\n\t\t\tpdf_drop_xobject(ctx, xobj);\n\t\t}\n\n\t\tdoc->dirty = 1;\n\n\t\tupdate_rect(ctx, annot);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free_device(dev);\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic fz_point *\nquadpoints(pdf_document *doc, pdf_obj *annot, int *nout)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *quad = pdf_dict_gets(annot, \"QuadPoints\");\n\tfz_point *qp = NULL;\n\tint i, n;\n\n\tif (!quad)\n\t\treturn NULL;\n\n\tn = pdf_array_len(quad);\n\n\tif (n%8 != 0)\n\t\treturn NULL;\n\n\tfz_var(qp);\n\tfz_try(ctx)\n\t{\n\t\tqp = fz_malloc_array(ctx, n/2, sizeof(fz_point));\n\n\t\tfor (i = 0; i < n; i += 2)\n\t\t{\n\t\t\tqp[i/2].x = pdf_to_real(pdf_array_get(quad, i));\n\t\t\tqp[i/2].y = pdf_to_real(pdf_array_get(quad, i+1));\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, qp);\n\t\tfz_rethrow(ctx);\n\t}\n\n\t*nout = n/2;\n\n\treturn qp;\n}\n\nvoid pdf_set_markup_appearance(pdf_document *doc, pdf_annot *annot, float color[3], float alpha, float line_thickness, float line_height)\n{\n\tfz_context *ctx = doc->ctx;\n\tconst fz_matrix *page_ctm = &annot->page->ctm;\n\tfz_path *path = NULL;\n\tfz_stroke_state *stroke = NULL;\n\tfz_device *dev = NULL;\n\tfz_display_list *strike_list = NULL;\n\tint i, n;\n\tfz_point *qp = quadpoints(doc, annot->obj, &n);\n\n\tif (!qp || n <= 0)\n\t\treturn;\n\n\tfz_var(path);\n\tfz_var(stroke);\n\tfz_var(dev);\n\tfz_var(strike_list);\n\tfz_try(ctx)\n\t{\n\t\tfz_rect rect = fz_empty_rect;\n\n\t\trect.x0 = rect.x1 = qp[0].x;\n\t\trect.y0 = rect.y1 = qp[0].y;\n\t\tfor (i = 0; i < n; i++)\n\t\t\tfz_include_point_in_rect(&rect, &qp[i]);\n\n\t\tstrike_list = fz_new_display_list(ctx);\n\t\tdev = fz_new_list_device(ctx, strike_list);\n\n\t\tfor (i = 0; i < n; i += 4)\n\t\t{\n\t\t\tfz_point pt0 = qp[i];\n\t\t\tfz_point pt1 = qp[i+1];\n\t\t\tfz_point up;\n\t\t\tfloat thickness;\n\n\t\t\tup.x = qp[i+2].x - qp[i+1].x;\n\t\t\tup.y = qp[i+2].y - qp[i+1].y;\n\n\t\t\tpt0.x += line_height * up.x;\n\t\t\tpt0.y += line_height * up.y;\n\t\t\tpt1.x += line_height * up.x;\n\t\t\tpt1.y += line_height * up.y;\n\n\t\t\tthickness = sqrtf(up.x * up.x + up.y * up.y) * line_thickness;\n\n\t\t\tif (!stroke || fz_abs(stroke->linewidth - thickness) < SMALL_FLOAT)\n\t\t\t{\n\t\t\t\tif (stroke)\n\t\t\t\t{\n\t\t\t\t\t// assert(path)\n\t\t\t\t\tfz_stroke_path(dev, path, stroke, page_ctm, fz_device_rgb(ctx), color, alpha);\n\t\t\t\t\tfz_drop_stroke_state(ctx, stroke);\n\t\t\t\t\tstroke = NULL;\n\t\t\t\t\tfz_free_path(ctx, path);\n\t\t\t\t\tpath = NULL;\n\t\t\t\t}\n\n\t\t\t\tstroke = fz_new_stroke_state(ctx);\n\t\t\t\tstroke->linewidth = thickness;\n\t\t\t\tpath = fz_new_path(ctx);\n\t\t\t}\n\n\t\t\tfz_moveto(ctx, path, pt0.x, pt0.y);\n\t\t\tfz_lineto(ctx, path, pt1.x, pt1.y);\n\t\t}\n\n\t\tif (stroke)\n\t\t{\n\t\t\tfz_stroke_path(dev, path, stroke, page_ctm, fz_device_rgb(ctx), color, alpha);\n\t\t}\n\n\t\tfz_transform_rect(&rect, page_ctm);\n\t\tpdf_set_annot_appearance(doc, annot, &rect, strike_list);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_free(ctx, qp);\n\t\tfz_free_device(dev);\n\t\tfz_drop_stroke_state(ctx, stroke);\n\t\tfz_free_path(ctx, path);\n\t\tfz_drop_display_list(ctx, strike_list);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic fz_colorspace *pdf_to_color(pdf_document *doc, pdf_obj *col, float color[4])\n{\n\tfz_colorspace *cs;\n\tint i, ncol = pdf_array_len(col);\n\n\tswitch (ncol)\n\t{\n\tcase 1: cs = fz_device_gray(doc->ctx); break;\n\tcase 3: cs = fz_device_rgb(doc->ctx); break;\n\tcase 4: cs = fz_device_cmyk(doc->ctx); break;\n\tdefault: return NULL;\n\t}\n\n\tfor (i = 0; i < ncol; i++)\n\t\tcolor[i] = pdf_to_real(pdf_array_get(col, i));\n\n\treturn cs;\n}\n\nvoid pdf_update_ink_appearance(pdf_document *doc, pdf_annot *annot)\n{\n\tfz_context *ctx = doc->ctx;\n\tconst fz_matrix *page_ctm = &annot->page->ctm;\n\tfz_path *path = NULL;\n\tfz_stroke_state *stroke = NULL;\n\tfz_device *dev = NULL;\n\tfz_display_list *strike_list = NULL;\n\tfz_colorspace *cs = NULL;\n\n\tfz_var(path);\n\tfz_var(stroke);\n\tfz_var(dev);\n\tfz_var(strike_list);\n\tfz_var(cs);\n\tfz_try(ctx)\n\t{\n\t\tfz_rect rect = fz_empty_rect;\n\t\tfloat color[4];\n\t\tfloat width;\n\t\tpdf_obj *list;\n\t\tint n, m, i, j;\n\t\tint empty = 1;\n\n\t\tcs = pdf_to_color(doc, pdf_dict_gets(annot->obj, \"C\"), color);\n\t\tif (!cs)\n\t\t{\n\t\t\tcs = fz_device_rgb(ctx);\n\t\t\tcolor[0] = 1.0f;\n\t\t\tcolor[1] = 0.0f;\n\t\t\tcolor[2] = 0.0f;\n\t\t}\n\n\t\twidth = pdf_to_real(pdf_dict_gets(pdf_dict_gets(annot->obj, \"BS\"), \"W\"));\n\t\tif (width == 0.0f)\n\t\t\twidth = 1.0f;\n\n\t\tlist = pdf_dict_gets(annot->obj, \"InkList\");\n\n\t\tn = pdf_array_len(list);\n\n\t\tstrike_list = fz_new_display_list(ctx);\n\t\tdev = fz_new_list_device(ctx, strike_list);\n\t\tpath = fz_new_path(ctx);\n\t\tstroke = fz_new_stroke_state(ctx);\n\t\tstroke->linewidth = width;\n\t\tstroke->start_cap = stroke->end_cap = FZ_LINECAP_ROUND;\n\t\tstroke->linejoin = FZ_LINEJOIN_ROUND;\n\n\t\tfor (i = 0; i < n; i ++)\n\t\t{\n\t\t\tfz_point pt_last;\n\t\t\tpdf_obj *arc = pdf_array_get(list, i);\n\t\t\tm = pdf_array_len(arc);\n\n\t\t\tfor (j = 0; j < m-1; j += 2)\n\t\t\t{\n\t\t\t\tfz_point pt;\n\t\t\t\tpt.x = pdf_to_real(pdf_array_get(arc, j));\n\t\t\t\tpt.y = pdf_to_real(pdf_array_get(arc, j+1));\n\n\t\t\t\tif (i == 0 && j == 0)\n\t\t\t\t{\n\t\t\t\t\trect.x0 = rect.x1 = pt.x;\n\t\t\t\t\trect.y0 = rect.y1 = pt.y;\n\t\t\t\t\tempty = 0;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfz_include_point_in_rect(&rect, &pt);\n\t\t\t\t}\n\n\t\t\t\tif (j == 0)\n\t\t\t\t\tfz_moveto(ctx, path, pt.x, pt.y);\n\t\t\t\telse\n\t\t\t\t\tfz_curvetov(ctx, path, pt_last.x, pt_last.y, (pt.x + pt_last.x) / 2, (pt.y + pt_last.y) / 2);\n\t\t\t\tpt_last = pt;\n\t\t\t}\n\t\t\tfz_lineto(ctx, path, pt_last.x, pt_last.y);\n\t\t}\n\n\t\tfz_stroke_path(dev, path, stroke, page_ctm, cs, color, 1.0f);\n\n\t\tfz_expand_rect(&rect, width);\n\t\t/*\n\t\t\tExpand the rectangle by width all around. We cannot use\n\t\t\tfz_expand_rect because the rectangle might be empty in the\n\t\t\tsingle point case\n\t\t*/\n\t\tif (!empty)\n\t\t{\n\t\t\trect.x0 -= width;\n\t\t\trect.y0 -= width;\n\t\t\trect.x1 += width;\n\t\t\trect.y1 += width;\n\t\t}\n\n\n\t\tfz_transform_rect(&rect, page_ctm);\n\t\tpdf_set_annot_appearance(doc, annot, &rect, strike_list);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_colorspace(ctx, cs);\n\t\tfz_free_device(dev);\n\t\tfz_drop_stroke_state(ctx, stroke);\n\t\tfz_free_path(ctx, path);\n\t\tfz_drop_display_list(ctx, strike_list);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void add_text(fz_context *ctx, font_info *font_rec, fz_text *text, char *str, int str_len, float x, float y)\n{\n\tfz_font *font = font_rec->font->font;\n\tint mask = FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM;\n\n\twhile (str_len--)\n\t{\n\t\tFT_Fixed adv;\n\n\t\t/* FIXME: convert str from utf8 to WinAnsi */\n\t\tint gid = FT_Get_Char_Index(font->ft_face, *str);\n\t\tfz_add_text(ctx, text, gid, *str++, x, y);\n\n\t\tFT_Get_Advance(font->ft_face, gid, mask, &adv);\n\t\tx += ((float)adv) * font_rec->da_rec.font_size / ((FT_Face)font->ft_face)->units_per_EM;\n\t}\n}\n\nstatic fz_text *layout_text(fz_context *ctx, font_info *font_rec, char *str, float x, float y)\n{\n\tfz_matrix tm;\n\tfz_font *font = font_rec->font->font;\n\tfz_text *text;\n\n\tfz_scale(&tm, font_rec->da_rec.font_size, font_rec->da_rec.font_size);\n\ttext = fz_new_text(ctx, font, &tm, 0);\n\n\tfz_try(ctx)\n\t{\n\t\tadd_text(ctx, font_rec, text, str, strlen(str), x, y);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free_text(ctx, text);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn text;\n}\n\nstatic fz_text *fit_text(fz_context *ctx, font_info *font_rec, char *str, fz_rect *bounds)\n{\n\tfloat width = bounds->x1 - bounds->x0;\n\tfloat height = bounds->y1 - bounds->y0;\n\tfz_matrix tm;\n\tfz_text *text = NULL;\n\ttext_splitter splitter;\n\tfloat ascender;\n\n\t/* Initially aim for one-line of text */\n\tfont_rec->da_rec.font_size = height / font_rec->lineheight;\n\n\ttext_splitter_init(&splitter, font_rec, str, width, height, 1);\n\n\tfz_var(text);\n\tfz_try(ctx)\n\t{\n\t\tint i;\n\t\twhile (!splitter.done)\n\t\t{\n\t\t\t/* Try a layout pass */\n\t\t\tint line = 0;\n\t\t\tfloat font_size;\n\t\t\tfloat x = 0.0;\n\t\t\tfloat y = 0.0;\n\n\n\t\t\tfz_free_text(ctx, text);\n\t\t\ttext = NULL;\n\t\t\tfont_size = font_rec->da_rec.font_size;\n\t\t\tfz_scale(&tm, font_size, font_size);\n\t\t\ttext = fz_new_text(ctx, font_rec->font->font, &tm, 0);\n\n\t\t\ttext_splitter_start_pass(&splitter);\n\n\t\t\t/* Layout unscaled text to a scaled-up width, so that\n\t\t\t* the scaled-down text will fit the unscaled width */\n\n\t\t\twhile (!splitter.done && line < splitter.max_lines)\n\t\t\t{\n\t\t\t\t/* Layout a line */\n\t\t\t\ttext_splitter_start_line(&splitter);\n\n\t\t\t\twhile (!splitter.done && text_splitter_layout(ctx, &splitter))\n\t\t\t\t{\n\t\t\t\t\tif (splitter.text[splitter.text_start] != ' ')\n\t\t\t\t\t{\n\t\t\t\t\t\tfloat dx, dy;\n\t\t\t\t\t\tchar *word = str+splitter.text_start;\n\t\t\t\t\t\tint wordlen = splitter.text_end-splitter.text_start;\n\n\t\t\t\t\t\ttext_splitter_move(&splitter, -line, &dx, &dy);\n\t\t\t\t\t\tx += dx;\n\t\t\t\t\t\ty += dy;\n\t\t\t\t\t\tadd_text(ctx, font_rec, text, word, wordlen, x, y);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tline ++;\n\t\t\t}\n\n\t\t\tif (!splitter.done)\n\t\t\t\ttext_splitter_retry(&splitter);\n\t\t}\n\n\t\t/* Post process text with the scale determined by the splitter\n\t\t * and with the required offst */\n\t\tfz_pre_scale(&text->trm, splitter.scale, splitter.scale);\n\t\tascender = font_rec->font->ascent * font_rec->da_rec.font_size * splitter.scale / 1000.0f;\n\t\tfor (i = 0; i < text->len; i++)\n\t\t{\n\t\t\ttext->items[i].x = text->items[i].x * splitter.scale + bounds->x0;\n\t\t\ttext->items[i].y = text->items[i].y * splitter.scale + bounds->y1 - ascender;\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free_text(ctx, text);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn text;\n}\n\nstatic void rect_center(const fz_rect *rect, fz_point *c)\n{\n\tc->x = (rect->x0 + rect->x1) / 2.0f;\n\tc->y = (rect->y0 + rect->y1) / 2.0f;\n}\n\nstatic void center_rect_within_rect(const fz_rect *tofit, const fz_rect *within, fz_matrix *mat)\n{\n\tfloat xscale = (within->x1 - within->x0) / (tofit->x1 - tofit->x0);\n\tfloat yscale = (within->y1 - within->y0) / (tofit->y1 - tofit->y0);\n\tfloat scale = fz_min(xscale, yscale);\n\tfz_point tofit_center;\n\tfz_point within_center;\n\n\trect_center(within, &within_center);\n\trect_center(tofit, &tofit_center);\n\n\t/* Translate \"tofit\" to be centered on the origin\n\t * Scale \"tofit\" to a size that fits within \"within\"\n\t * Translate \"tofit\" to \"within's\" center\n\t * Do all the above in reverse order so that we can use the fz_pre_xx functions */\n\tfz_translate(mat, within_center.x, within_center.y);\n\tfz_pre_scale(mat, scale, scale);\n\tfz_pre_translate(mat, -tofit_center.x, -tofit_center.y);\n}\n\nstatic const float outline_thickness = 15.0f;\n\nstatic void draw_rounded_rect(fz_context *ctx, fz_path *path)\n{\n\tfz_moveto(ctx, path, 20.0, 60.0);\n\tfz_curveto(ctx, path, 20.0, 30.0, 30.0, 20.0, 60.0, 20.0);\n\tfz_lineto(ctx, path, 340.0, 20.0);\n\tfz_curveto(ctx, path, 370.0, 20.0, 380.0, 30.0, 380.0, 60.0);\n\tfz_lineto(ctx, path, 380.0, 340.0);\n\tfz_curveto(ctx, path, 380.0, 370.0, 370.0, 380.0, 340.0, 380.0);\n\tfz_lineto(ctx, path, 60.0, 380.0);\n\tfz_curveto(ctx, path, 30.0, 380.0, 20.0, 370.0, 20.0, 340.0);\n\tfz_closepath(ctx, path);\n}\n\nstatic void draw_speech_bubble(fz_context *ctx, fz_path *path)\n{\n\tfz_moveto(ctx, path, 199.0f, 315.6f);\n\tfz_curveto(ctx, path, 35.6f, 315.6f, 27.0f, 160.8f, 130.2f, 131.77f);\n\tfz_curveto(ctx, path, 130.2f, 93.07f, 113.0f, 83.4f, 113.0f, 83.4f);\n\tfz_curveto(ctx, path, 138.8f, 73.72f, 173.2f, 83.4f, 190.4f, 122.1f);\n\tfz_curveto(ctx, path, 391.64f, 122.1f, 362.4f, 315.6f, 199.0f, 315.6f);\n\tfz_closepath(ctx, path);\n}\n\nvoid pdf_update_text_annot_appearance(pdf_document *doc, pdf_annot *annot)\n{\n\tstatic float white[3] = {1.0, 1.0, 1.0};\n\tstatic float yellow[3] = {1.0, 1.0, 0.0};\n\tstatic float black[3] = {0.0, 0.0, 0.0};\n\tfz_context *ctx = doc->ctx;\n\tconst fz_matrix *page_ctm = &annot->page->ctm;\n\tfz_display_list *dlist = NULL;\n\tfz_device *dev = NULL;\n\tfz_colorspace *cs = NULL;\n\tfz_path *path = NULL;\n\tfz_stroke_state *stroke = NULL;\n\n\tfz_var(path);\n\tfz_var(stroke);\n\tfz_var(dlist);\n\tfz_var(dev);\n\tfz_var(cs);\n\tfz_try(ctx)\n\t{\n\t\tfz_rect rect;\n\t\tfz_rect bounds;\n\t\tfz_matrix tm;\n\n\t\tpdf_to_rect(ctx, pdf_dict_gets(annot->obj, \"Rect\"), &rect);\n\t\tdlist = fz_new_display_list(ctx);\n\t\tdev = fz_new_list_device(ctx, dlist);\n\t\tstroke = fz_new_stroke_state(ctx);\n\t\tstroke->linewidth = outline_thickness;\n\t\tstroke->linejoin = FZ_LINEJOIN_ROUND;\n\n\t\tpath = fz_new_path(ctx);\n\t\tdraw_rounded_rect(ctx, path);\n\t\tfz_bound_path(ctx, path, NULL, &fz_identity, &bounds);\n\t\tfz_expand_rect(&bounds, outline_thickness);\n\t\tcenter_rect_within_rect(&bounds, &rect, &tm);\n\t\tfz_concat(&tm, &tm, page_ctm);\n\t\tcs = fz_device_rgb(ctx);\n\t\tfz_fill_path(dev, path, 0, &tm, cs, yellow, 1.0f);\n\t\tfz_stroke_path(dev, path, stroke, &tm, cs, black, 1.0f);\n\t\tfz_free_path(ctx, path);\n\t\tpath = NULL;\n\n\t\tpath = fz_new_path(ctx);\n\t\tdraw_speech_bubble(ctx, path);\n\t\tfz_fill_path(dev, path, 0, &tm, cs, white, 1.0f);\n\t\tfz_stroke_path(dev, path, stroke, &tm, cs, black, 1.0f);\n\n\t\tfz_transform_rect(&rect, page_ctm);\n\t\tpdf_set_annot_appearance(doc, annot, &rect, dlist);\n\n\t\t/* Drop the cached xobject from the annotation structure to\n\t\t * force a redraw on next pdf_update_page call */\n\t\tpdf_drop_xobject(ctx, annot->ap);\n\t\tannot->ap = NULL;\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_free_device(dev);\n\t\tfz_drop_display_list(ctx, dlist);\n\t\tfz_drop_stroke_state(ctx, stroke);\n\t\tfz_free_path(ctx, path);\n\t\tfz_drop_colorspace(ctx, cs);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nvoid pdf_update_free_text_annot_appearance(pdf_document *doc, pdf_annot *annot)\n{\n\tfz_context *ctx = doc->ctx;\n\tconst fz_matrix *page_ctm = &annot->page->ctm;\n\tpdf_obj *obj = annot->obj;\n\tpdf_obj *dr = pdf_dict_getp(annot->page->me, \"Resources\");\n\tfz_display_list *dlist = NULL;\n\tfz_device *dev = NULL;\n\tfont_info font_rec;\n\tfz_text *text = NULL;\n\tfz_colorspace *cs = NULL;\n\n\tmemset(&font_rec, 0, sizeof(font_rec));\n\n\t/* Set some sane defaults in case the parsing of the font_rec fails */\n\tfont_rec.da_rec.col_size = 1; /* Default to greyscale */\n\tfont_rec.da_rec.font_size = 12; /* Default to 12 point */\n\n\tfz_var(dlist);\n\tfz_var(dev);\n\tfz_var(text);\n\tfz_var(cs);\n\tfz_try(ctx)\n\t{\n\t\tchar *contents = pdf_to_str_buf(pdf_dict_gets(obj, \"Contents\"));\n\t\tchar *da = pdf_to_str_buf(pdf_dict_gets(obj, \"DA\"));\n\t\tfz_rect rect = annot->rect;\n\t\tfz_point pos;\n\n\t\tget_font_info(doc, dr, da, &font_rec);\n\n\t\tswitch (font_rec.da_rec.col_size)\n\t\t{\n\t\tdefault: cs = fz_device_gray(doc->ctx); break;\n\t\tcase 3: cs = fz_device_rgb(doc->ctx); break;\n\t\tcase 4: cs = fz_device_cmyk(doc->ctx); break;\n\t\t}\n\n\t\t/* Adjust for the descender */\n\t\tpos.x = rect.x0;\n\t\tpos.y = rect.y0 - font_rec.font->descent * font_rec.da_rec.font_size / 1000.0f;\n\n\t\ttext = layout_text(ctx, &font_rec, contents, pos.x, pos.y);\n\n\t\tdlist = fz_new_display_list(ctx);\n\t\tdev = fz_new_list_device(ctx, dlist);\n\t\tfz_fill_text(dev, text, page_ctm, cs, font_rec.da_rec.col, 1.0f);\n\n\t\tfz_transform_rect(&rect, page_ctm);\n\t\tpdf_set_annot_appearance(doc, annot, &rect, dlist);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_free_device(dev);\n\t\tfz_drop_display_list(ctx, dlist);\n\t\tfont_info_fin(ctx, &font_rec);\n\t\tfz_free_text(ctx, text);\n\t\tfz_drop_colorspace(ctx, cs);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void draw_logo(fz_context *ctx, fz_path *path)\n{\n\tfz_moveto(ctx, path, 122.25f, 0.0f);\n\tfz_lineto(ctx, path, 122.25f, 14.249f);\n\tfz_curveto(ctx, path, 125.98f, 13.842f, 129.73f, 13.518f, 133.5f, 13.277f);\n\tfz_lineto(ctx, path, 133.5f, 0.0f);\n\tfz_lineto(ctx, path, 122.25f, 0.0f);\n\tfz_closepath(ctx, path);\n\tfz_moveto(ctx, path, 140.251f, 0.0f);\n\tfz_lineto(ctx, path, 140.251f, 12.935f);\n\tfz_curveto(ctx, path, 152.534f, 12.477f, 165.03f, 12.899f, 177.75f, 14.249f);\n\tfz_lineto(ctx, path, 177.75f, 21.749f);\n\tfz_curveto(ctx, path, 165.304f, 20.413f, 152.809f, 19.871f, 140.251f, 20.348f);\n\tfz_lineto(ctx, path, 140.251f, 39.0f);\n\tfz_lineto(ctx, path, 133.5f, 39.0f);\n\tfz_lineto(ctx, path, 133.5f, 20.704f);\n\tfz_curveto(ctx, path, 129.756f, 20.956f, 126.006f, 21.302f, 122.25f, 21.749f);\n\tfz_lineto(ctx, path, 122.25f, 50.999f);\n\tfz_lineto(ctx, path, 177.751f, 50.999f);\n\tfz_lineto(ctx, path, 177.751f, 0.0f);\n\tfz_lineto(ctx, path, 140.251f, 0.0f);\n\tfz_closepath(ctx, path);\n\tfz_moveto(ctx, path, 23.482f, 129.419f);\n\tfz_curveto(ctx, path, -20.999f, 199.258f, -0.418f, 292.039f, 69.42f, 336.519f);\n\tfz_curveto(ctx, path, 139.259f, 381.0f, 232.04f, 360.419f, 276.52f, 290.581f);\n\tfz_curveto(ctx, path, 321.001f, 220.742f, 300.42f, 127.961f, 230.582f, 83.481f);\n\tfz_curveto(ctx, path, 160.743f, 39.0f, 67.962f, 59.581f, 23.482f, 129.419f);\n\tfz_closepath(ctx, path);\n\tfz_moveto(ctx, path, 254.751f, 128.492f);\n\tfz_curveto(ctx, path, 303.074f, 182.82f, 295.364f, 263.762f, 237.541f, 309.165f);\n\tfz_curveto(ctx, path, 179.718f, 354.568f, 93.57f, 347.324f, 45.247f, 292.996f);\n\tfz_curveto(ctx, path, -3.076f, 238.668f, 4.634f, 157.726f, 62.457f, 112.323f);\n\tfz_curveto(ctx, path, 120.28f, 66.92f, 206.428f, 74.164f, 254.751f, 128.492f);\n\tfz_closepath(ctx, path);\n\tfz_moveto(ctx, path, 111.0f, 98.999f);\n\tfz_curveto(ctx, path, 87.424f, 106.253f, 68.25f, 122.249f, 51.75f, 144.749f);\n\tfz_lineto(ctx, path, 103.5f, 297.749f);\n\tfz_lineto(ctx, path, 213.75f, 298.499f);\n\tfz_curveto(ctx, path, 206.25f, 306.749f, 195.744f, 311.478f, 185.25f, 314.249f);\n\tfz_curveto(ctx, path, 164.22f, 319.802f, 141.22f, 319.775f, 120.0f, 314.999f);\n\tfz_curveto(ctx, path, 96.658f, 309.745f, 77.25f, 298.499f, 55.5f, 283.499f);\n\tfz_curveto(ctx, path, 69.75f, 299.249f, 84.617f, 311.546f, 102.75f, 319.499f);\n\tfz_curveto(ctx, path, 117.166f, 325.822f, 133.509f, 327.689f, 149.25f, 327.749f);\n\tfz_curveto(ctx, path, 164.21f, 327.806f, 179.924f, 326.532f, 193.5f, 320.249f);\n\tfz_curveto(ctx, path, 213.95f, 310.785f, 232.5f, 294.749f, 245.25f, 276.749f);\n\tfz_lineto(ctx, path, 227.25f, 276.749f);\n\tfz_curveto(ctx, path, 213.963f, 276.749f, 197.25f, 263.786f, 197.25f, 250.499f);\n\tfz_lineto(ctx, path, 197.25f, 112.499f);\n\tfz_curveto(ctx, path, 213.75f, 114.749f, 228.0f, 127.499f, 241.5f, 140.999f);\n\tfz_curveto(ctx, path, 231.75f, 121.499f, 215.175f, 109.723f, 197.25f, 101.249f);\n\tfz_curveto(ctx, path, 181.5f, 95.249f, 168.412f, 94.775f, 153.0f, 94.499f);\n\tfz_curveto(ctx, path, 139.42f, 94.256f, 120.75f, 95.999f, 111.0f, 98.999f);\n\tfz_closepath(ctx, path);\n\tfz_moveto(ctx, path, 125.25f, 105.749f);\n\tfz_lineto(ctx, path, 125.25f, 202.499f);\n\tfz_lineto(ctx, path, 95.25f, 117.749f);\n\tfz_curveto(ctx, path, 105.75f, 108.749f, 114.0f, 105.749f, 125.25f, 105.749f);\n\tfz_closepath(ctx, path);\n};\n\nstatic void insert_signature_appearance_layers(pdf_document *doc, pdf_annot *annot)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *ap = pdf_dict_getp(annot->obj, \"AP/N\");\n\tpdf_obj *main_ap = NULL;\n\tpdf_obj *frm = NULL;\n\tpdf_obj *n0 = NULL;\n\tfz_rect bbox;\n\tfz_buffer *fzbuf = NULL;\n\n\tpdf_to_rect(ctx, pdf_dict_gets(ap, \"BBox\"), &bbox);\n\n\tfz_var(main_ap);\n\tfz_var(frm);\n\tfz_var(n0);\n\tfz_var(fzbuf);\n\tfz_try(ctx)\n\t{\n\t\tmain_ap = pdf_new_xobject(doc, &bbox, &fz_identity);\n\t\tfrm = pdf_new_xobject(doc, &bbox, &fz_identity);\n\t\tn0 = pdf_new_xobject(doc, &bbox, &fz_identity);\n\n\t\tpdf_dict_putp(main_ap, \"Resources/XObject/FRM\", frm);\n\t\tfzbuf = fz_new_buffer(ctx, 8);\n\t\tfz_buffer_printf(ctx, fzbuf, \"/FRM Do\");\n\t\tpdf_update_stream(doc, pdf_to_num(main_ap), fzbuf);\n\t\tpdf_dict_puts_drop(main_ap, \"Length\", pdf_new_int(doc, fzbuf->len));\n\t\tfz_drop_buffer(ctx, fzbuf);\n\t\tfzbuf = NULL;\n\n\t\tpdf_dict_putp(frm, \"Resources/XObject/n0\", n0);\n\t\tpdf_dict_putp(frm, \"Resources/XObject/n2\", ap);\n\t\tfzbuf = fz_new_buffer(ctx, 8);\n\t\tfz_buffer_printf(ctx, fzbuf, \"q 1 0 0 1 0 0 cm /n0 Do Q q 1 0 0 1 0 0 cm /n2 Do Q\");\n\t\tpdf_update_stream(doc, pdf_to_num(frm), fzbuf);\n\t\tpdf_dict_puts_drop(frm, \"Length\", pdf_new_int(doc, fzbuf->len));\n\t\tfz_drop_buffer(ctx, fzbuf);\n\t\tfzbuf = NULL;\n\n\t\tfzbuf = fz_new_buffer(ctx, 8);\n\t\tfz_buffer_printf(ctx, fzbuf, \"%% DSBlank\");\n\t\tpdf_update_stream(doc, pdf_to_num(n0), fzbuf);\n\t\tpdf_dict_puts_drop(n0, \"Length\", pdf_new_int(doc, fzbuf->len));\n\t\tfz_drop_buffer(ctx, fzbuf);\n\t\tfzbuf = NULL;\n\n\t\tpdf_dict_putp(annot->obj, \"AP/N\", main_ap);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(main_ap);\n\t\tpdf_drop_obj(frm);\n\t\tpdf_drop_obj(n0);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, fzbuf);\n\t\tfz_rethrow(ctx);\n\t}\n}\n\n/* MuPDF blue */\nstatic float logo_color[3] = {(float)0x25/(float)0xFF, (float)0x72/(float)0xFF, (float)0xAC/(float)0xFF};\n\nvoid pdf_set_signature_appearance(pdf_document *doc, pdf_annot *annot, char *name, char *dn, char *date)\n{\n\tfz_context *ctx = doc->ctx;\n\tconst fz_matrix *page_ctm = &annot->page->ctm;\n\tpdf_obj *obj = annot->obj;\n\tpdf_obj *dr = pdf_dict_getp(pdf_trailer(doc), \"Root/AcroForm/DR\");\n\tfz_display_list *dlist = NULL;\n\tfz_device *dev = NULL;\n\tfont_info font_rec;\n\tfz_text *text = NULL;\n\tfz_colorspace *cs = NULL;\n\tfz_path *path = NULL;\n\tfz_buffer *fzbuf = NULL;\n\n\tif (!dr)\n\t\tpdf_dict_putp_drop(pdf_trailer(doc), \"Root/AcroForm/DR\", pdf_new_dict(doc, 1));\n\n\tmemset(&font_rec, 0, sizeof(font_rec));\n\n\tfz_var(path);\n\tfz_var(dlist);\n\tfz_var(dev);\n\tfz_var(text);\n\tfz_var(cs);\n\tfz_var(fzbuf);\n\tfz_try(ctx)\n\t{\n\t\tchar *da = pdf_to_str_buf(pdf_dict_gets(obj, \"DA\"));\n\t\tfz_rect rect = annot->rect;\n\t\tfz_rect logo_bounds;\n\t\tfz_matrix logo_tm;\n\t\tunsigned char *bufstr;\n\n\t\tdlist = fz_new_display_list(ctx);\n\t\tdev = fz_new_list_device(ctx, dlist);\n\n\t\tpath = fz_new_path(ctx);\n\t\tdraw_logo(ctx, path);\n\t\tfz_bound_path(ctx, path, NULL, &fz_identity, &logo_bounds);\n\t\tcenter_rect_within_rect(&logo_bounds, &rect, &logo_tm);\n\t\tfz_concat(&logo_tm, &logo_tm, page_ctm);\n\t\tcs = fz_device_rgb(ctx);\n\t\tfz_fill_path(dev, path, 0, &logo_tm, cs, logo_color, 1.0f);\n\t\tfz_drop_colorspace(ctx, cs);\n\t\tcs = NULL;\n\n\t\tget_font_info(doc, dr, da, &font_rec);\n\n\t\tswitch (font_rec.da_rec.col_size)\n\t\t{\n\t\tcase 1: cs = fz_device_gray(ctx); break;\n\t\tcase 3: cs = fz_device_rgb(ctx); break;\n\t\tcase 4: cs = fz_device_cmyk(ctx); break;\n\t\t}\n\n\t\t/* Display the name in the left-hand half of the form field */\n\t\trect.x1 = (rect.x0 + rect.x1)/2.0f;\n\t\ttext = fit_text(ctx, &font_rec, name, &rect);\n\t\tfz_fill_text(dev, text, page_ctm, cs, font_rec.da_rec.col, 1.0f);\n\t\tfz_free_text(ctx, text);\n\t\ttext = NULL;\n\n\t\t/* Display the distinguished name in the right-hand half */\n\t\tfzbuf = fz_new_buffer(ctx, 256);\n\t\tfz_buffer_printf(ctx, fzbuf, \"Digitally signed by %s\", name);\n\t\tfz_buffer_printf(ctx, fzbuf, \"\\nDN: %s\", dn);\n\t\tif (date)\n\t\t\tfz_buffer_printf(ctx, fzbuf, \"\\nDate: %s\", date);\n\t\t(void)fz_buffer_storage(ctx, fzbuf, &bufstr);\n\t\trect = annot->rect;\n\t\trect.x0 = (rect.x0 + rect.x1)/2.0f;\n\t\ttext = fit_text(ctx, &font_rec, (char *)bufstr, &rect);\n\t\tfz_fill_text(dev, text, page_ctm, cs, font_rec.da_rec.col, 1.0f);\n\n\t\trect = annot->rect;\n\t\tfz_transform_rect(&rect, page_ctm);\n\t\tpdf_set_annot_appearance(doc, annot, &rect, dlist);\n\n\t\t/* Drop the cached xobject from the annotation structure to\n\t\t * force a redraw on next pdf_update_page call */\n\t\tpdf_drop_xobject(ctx, annot->ap);\n\t\tannot->ap = NULL;\n\n\t\tinsert_signature_appearance_layers(doc, annot);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_free_device(dev);\n\t\tfz_drop_display_list(ctx, dlist);\n\t\tfont_info_fin(ctx, &font_rec);\n\t\tfz_free_path(ctx, path);\n\t\tfz_free_text(ctx, text);\n\t\tfz_drop_colorspace(ctx, cs);\n\t\tfz_drop_buffer(ctx, fzbuf);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nvoid pdf_update_appearance(pdf_document *doc, pdf_annot *annot)\n{\n\tpdf_obj *obj = annot->obj;\n\tif (!pdf_dict_gets(obj, \"AP\") || pdf_obj_is_dirty(obj))\n\t{\n\t\tfz_annot_type type = pdf_annot_obj_type(obj);\n\t\tswitch (type)\n\t\t{\n\t\tcase FZ_ANNOT_WIDGET:\n\t\t\tswitch (pdf_field_type(doc, obj))\n\t\t\t{\n\t\t\tcase PDF_WIDGET_TYPE_TEXT:\n\t\t\t\t{\n\t\t\t\t\t#if 0\n\t\t\t\t\tpdf_obj *formatting = pdf_dict_getp(obj, \"AA/F\");\n\t\t\t\t\tif (formatting && doc->js)\n\t\t\t\t\t{\n\t\t\t\t\t\t/* Apply formatting */\n\t\t\t\t\t\tpdf_js_event e;\n\t\t\t\t\t\tfz_context *ctx = doc->ctx;\n\n\t\t\t\t\t\te.target = obj;\n\t\t\t\t\t\te.value = pdf_field_value(doc, obj);\n\t\t\t\t\t\tfz_try(ctx)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpdf_js_setup_event(doc->js, &e);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfz_always(ctx)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfz_free(ctx, e.value);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfz_catch(ctx)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfz_rethrow(ctx);\n\t\t\t\t\t\t}\n\t\t\t\t\t\texecute_action(doc, obj, formatting);\n\t\t\t\t\t\t/* Update appearance from JS event.value */\n\t\t\t\t\t\tpdf_update_text_appearance(doc, obj, pdf_js_get_event(doc->js)->value);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t#endif\n\t\t\t\t\t{\n\t\t\t\t\t\t/* Update appearance from field value */\n\t\t\t\t\t\tpdf_update_text_appearance(doc, obj, NULL);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase PDF_WIDGET_TYPE_PUSHBUTTON:\n\t\t\t\tpdf_update_pushbutton_appearance(doc, obj);\n\t\t\t\tbreak;\n\t\t\tcase PDF_WIDGET_TYPE_LISTBOX:\n\t\t\tcase PDF_WIDGET_TYPE_COMBOBOX:\n\t\t\t\t/* Treating listbox and combobox identically for now,\n\t\t\t\t * and the behaviour is most appropriate for a combobox */\n\t\t\t\tpdf_update_combobox_appearance(doc, obj);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase FZ_ANNOT_TEXT:\n\t\t\tpdf_update_text_annot_appearance(doc, annot);\n\t\t\tbreak;\n\t\tcase FZ_ANNOT_FREETEXT:\n\t\t\tpdf_update_free_text_annot_appearance(doc, annot);\n\t\t\tbreak;\n\t\tcase FZ_ANNOT_STRIKEOUT:\n\t\tcase FZ_ANNOT_UNDERLINE:\n\t\tcase FZ_ANNOT_HIGHLIGHT:\n\t\t\tpdf_update_text_markup_appearance(doc, annot, type);\n\t\t\tbreak;\n\t\tcase FZ_ANNOT_INK:\n\t\t\tpdf_update_ink_appearance(doc, annot);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t\tpdf_clean_obj(obj);\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-clean.c",
    "content": "#include \"pdf-interpret-imp.h\"\n\nstatic void\npdf_clean_stream_object(pdf_document *doc, pdf_obj *obj, pdf_obj *orig_res, fz_cookie *cookie, int own_res)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_process process, process2;\n\tfz_buffer *buffer;\n\tint num;\n\tpdf_obj *res = NULL;\n\tpdf_obj *ref = NULL;\n\n\tif (!obj)\n\t\treturn;\n\n\tfz_var(res);\n\tfz_var(ref);\n\n\tbuffer = fz_new_buffer(ctx, 1024);\n\n\tfz_try(ctx)\n\t{\n\t\tif (own_res)\n\t\t{\n\t\t\tpdf_obj *r = pdf_dict_gets(obj, \"Resources\");\n\t\t\tif (r)\n\t\t\t\torig_res = r;\n\t\t}\n\n\t\tres = pdf_new_dict(doc, 1);\n\n\t\tpdf_process_buffer(&process2, ctx, buffer);\n\t\tpdf_process_filter(&process, ctx, &process2, res);\n\n\t\tpdf_process_stream_object(doc, obj, &process, orig_res, cookie);\n\n\t\tnum = pdf_to_num(obj);\n\t\tpdf_dict_dels(obj, \"Filter\");\n\t\tpdf_update_stream(doc, num, buffer);\n\n\t\tif (own_res)\n\t\t{\n\t\t\tref = pdf_new_ref(doc, res);\n\t\t\tpdf_dict_puts(obj, \"Resources\", ref);\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, buffer);\n\t\tpdf_drop_obj(res);\n\t\tpdf_drop_obj(ref);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_message(ctx, \"Failed while cleaning xobject\");\n\t}\n}\n\nstatic void\npdf_clean_type3(pdf_document *doc, pdf_obj *obj, pdf_obj *orig_res, fz_cookie *cookie)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_process process, process2;\n\tfz_buffer *buffer;\n\tint num, i, l;\n\tpdf_obj *res = NULL;\n\tpdf_obj *ref = NULL;\n\tpdf_obj *charprocs;\n\n\tfz_var(res);\n\tfz_var(ref);\n\n\tfz_try(ctx)\n\t{\n\t\tres = pdf_dict_gets(obj, \"Resources\");\n\t\tif (res)\n\t\t\torig_res = res;\n\t\tres = NULL;\n\n\t\tres = pdf_new_dict(doc, 1);\n\n\t\tcharprocs = pdf_dict_gets(obj, \"CharProcs\");\n\t\tl = pdf_dict_len(charprocs);\n\n\t\tfor (i = 0; i < l; i++)\n\t\t{\n\t\t\tpdf_obj *key = pdf_dict_get_key(charprocs, i);\n\t\t\tpdf_obj *val = pdf_dict_get_val(charprocs, i);\n\n\t\t\tbuffer = fz_new_buffer(ctx, 1024);\n\t\t\tpdf_process_buffer(&process2, ctx, buffer);\n\t\t\tpdf_process_filter(&process, ctx, &process2, res);\n\n\t\t\tpdf_process_stream_object(doc, val, &process, orig_res, cookie);\n\n\t\t\tnum = pdf_to_num(val);\n\t\t\tpdf_dict_dels(val, \"Filter\");\n\t\t\tpdf_update_stream(doc, num, buffer);\n\t\t\tpdf_dict_put(charprocs, key, val);\n\t\t\tfz_drop_buffer(ctx, buffer);\n\t\t\tbuffer = NULL;\n\t\t}\n\n\t\t/* ProcSet - no cleaning possible. Inherit this from the old dict. */\n\t\tpdf_dict_puts(res, \"ProcSet\", pdf_dict_gets(orig_res, \"ProcSet\"));\n\n\t\tref = pdf_new_ref(doc, res);\n\t\tpdf_dict_puts(obj, \"Resources\", ref);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, buffer);\n\t\tpdf_drop_obj(res);\n\t\tpdf_drop_obj(ref);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_message(ctx, \"Failed while cleaning xobject\");\n\t}\n}\n\nvoid pdf_clean_page_contents(pdf_document *doc, pdf_page *page, fz_cookie *cookie)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_process process, process2;\n\tfz_buffer *buffer = fz_new_buffer(ctx, 1024);\n\tint num;\n\tpdf_obj *contents;\n\tpdf_obj *new_obj = NULL;\n\tpdf_obj *new_ref = NULL;\n\tpdf_obj *res = NULL;\n\tpdf_obj *ref = NULL;\n\tpdf_obj *obj;\n\n\tfz_var(new_obj);\n\tfz_var(new_ref);\n\tfz_var(res);\n\tfz_var(ref);\n\n\tfz_try(ctx)\n\t{\n\t\tres = pdf_new_dict(doc, 1);\n\n\t\tpdf_process_buffer(&process2, ctx, buffer);\n\t\tpdf_process_filter(&process, ctx, &process2, res);\n\n\t\tpdf_process_stream_object(doc, page->contents, &process, page->resources, cookie);\n\n\t\tcontents = page->contents;\n\t\tif (pdf_is_array(contents))\n\t\t{\n\t\t\tint n = pdf_array_len(contents);\n\t\t\tint i;\n\n\t\t\tfor (i = n-1; i > 0; i--)\n\t\t\t\tpdf_array_delete(contents, i);\n\t\t\t/* We cannot rewrite the 0th entry of contents\n\t\t\t * directly as it may occur in other pages content\n\t\t\t * dictionaries too. We therefore clone it and make\n\t\t\t * a new object reference. */\n\t\t\tnew_obj = pdf_copy_dict(pdf_array_get(contents, 0));\n\t\t\tnew_ref = pdf_new_ref(doc, new_obj);\n\t\t\tnum = pdf_to_num(new_ref);\n\t\t\tpdf_array_put(contents, 0, new_ref);\n\t\t\tpdf_dict_dels(new_obj, \"Filter\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tnum = pdf_to_num(contents);\n\t\t\tpdf_dict_dels(contents, \"Filter\");\n\t\t}\n\t\tpdf_update_stream(doc, num, buffer);\n\n\t\t/* Now deal with resources. The spec allows for Type3 fonts and form\n\t\t * XObjects to omit a resource dictionary and look in the parent.\n\t\t * Avoid that by flattening here as part of the cleaning. This could\n\t\t * conceivably cause changes in rendering, but we don't care. */\n\n\t\t/* ExtGState */\n\t\tobj = pdf_dict_gets(res, \"ExtGState\");\n\t\tif (obj)\n\t\t{\n\t\t\tint i, l;\n\n\t\t\tl = pdf_dict_len(obj);\n\t\t\tfor (i = 0; i < l; i++)\n\t\t\t{\n\t\t\t\tpdf_obj *o = pdf_dict_gets(pdf_dict_get_val(obj, i), \"SMask\");\n\n\t\t\t\tif (!o)\n\t\t\t\t\tcontinue;\n\t\t\t\to = pdf_dict_gets(o, \"G\");\n\t\t\t\tif (!o)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t/* Transparency group XObject */\n\t\t\t\tpdf_clean_stream_object(doc, o, page->resources, cookie, 1);\n\t\t\t}\n\t\t}\n\n\t\t/* ColorSpace - no cleaning possible */\n\n\t\t/* Pattern */\n\t\tobj = pdf_dict_gets(res, \"Pattern\");\n\t\tif (obj)\n\t\t{\n\t\t\tint i, l;\n\n\t\t\tl = pdf_dict_len(obj);\n\t\t\tfor (i = 0; i < l; i++)\n\t\t\t{\n\t\t\t\tpdf_obj *pat = pdf_dict_get_val(obj, i);\n\n\t\t\t\tif (!pat)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (pdf_to_int(pdf_dict_gets(pat, \"PatternType\")) == 1)\n\t\t\t\t\tpdf_clean_stream_object(doc, pat, page->resources, cookie, 0);\n\t\t\t}\n\t\t}\n\n\t\t/* Shading - no cleaning possible */\n\n\t\t/* XObject */\n\t\tobj = pdf_dict_gets(res, \"XObject\");\n\t\tif (obj)\n\t\t{\n\t\t\tint i, l;\n\n\t\t\tl = pdf_dict_len(obj);\n\t\t\tfor (i = 0; i < l; i++)\n\t\t\t{\n\t\t\t\tpdf_obj *xobj = pdf_dict_get_val(obj, i);\n\n\t\t\t\tif (strcmp(pdf_to_name(pdf_dict_gets(xobj, \"Subtype\")), \"Form\"))\n\t\t\t\t\tcontinue;\n\n\t\t\t\tpdf_clean_stream_object(doc, xobj, page->resources, cookie, 1);\n\t\t\t}\n\t\t}\n\n\t\t/* Font */\n\t\tobj = pdf_dict_gets(res, \"Font\");\n\t\tif (obj)\n\t\t{\n\t\t\tint i, l;\n\n\t\t\tl = pdf_dict_len(obj);\n\t\t\tfor (i = 0; i < l; i++)\n\t\t\t{\n\t\t\t\tpdf_obj *o = pdf_dict_get_val(obj, i);\n\n\t\t\t\tif (!strcmp(pdf_to_name(pdf_dict_gets(o, \"Subtype\")), \"Type3\"))\n\t\t\t\t{\n\t\t\t\t\tpdf_clean_type3(doc, o, page->resources, cookie);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* ProcSet - no cleaning possible. Inherit this from the old dict. */\n\t\tobj = pdf_dict_gets(page->resources, \"ProcSet\");\n\t\tif (obj)\n\t\t\tpdf_dict_puts(res, \"ProcSet\", obj);\n\n\t\t/* Properties - no cleaning possible. */\n\n\t\tpdf_drop_obj(page->resources);\n\t\tref = pdf_new_ref(doc, res);\n\t\tpage->resources = pdf_keep_obj(ref);\n\t\tpdf_dict_puts(page->me, \"Resources\", ref);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, buffer);\n\t\tpdf_drop_obj(new_obj);\n\t\tpdf_drop_obj(new_ref);\n\t\tpdf_drop_obj(res);\n\t\tpdf_drop_obj(ref);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_message(ctx, \"Failed while cleaning page\");\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-cmap-load.c",
    "content": "#include \"mupdf/pdf.h\"\n\nunsigned int\npdf_cmap_size(fz_context *ctx, pdf_cmap *cmap)\n{\n\tif (cmap == NULL)\n\t\treturn 0;\n\tif (cmap->storable.refs < 0)\n\t\treturn 0;\n\n\treturn pdf_cmap_size(ctx, cmap->usecmap) +\n\t\tcmap->rcap * sizeof *cmap->ranges +\n\t\tcmap->xcap * sizeof *cmap->xranges +\n\t\tcmap->mcap * sizeof *cmap->mranges;\n}\n\n/*\n * Load CMap stream in PDF file\n */\npdf_cmap *\npdf_load_embedded_cmap(pdf_document *doc, pdf_obj *stmobj)\n{\n\tfz_stream *file = NULL;\n\tpdf_cmap *cmap = NULL;\n\tpdf_cmap *usecmap;\n\tpdf_obj *wmode;\n\tpdf_obj *obj = NULL;\n\tfz_context *ctx = doc->ctx;\n\tint phase = 0;\n\n\tfz_var(phase);\n\tfz_var(obj);\n\tfz_var(file);\n\tfz_var(cmap);\n\n\tif (pdf_obj_marked(stmobj))\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Recursion in embedded cmap\");\n\n\tif ((cmap = pdf_find_item(ctx, pdf_free_cmap_imp, stmobj)) != NULL)\n\t{\n\t\treturn cmap;\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tfile = pdf_open_stream(doc, pdf_to_num(stmobj), pdf_to_gen(stmobj));\n\t\tphase = 1;\n\t\tcmap = pdf_load_cmap(ctx, file);\n\t\tphase = 2;\n\t\tfz_close(file);\n\t\tfile = NULL;\n\n\t\twmode = pdf_dict_gets(stmobj, \"WMode\");\n\t\tif (pdf_is_int(wmode))\n\t\t\tpdf_set_cmap_wmode(ctx, cmap, pdf_to_int(wmode));\n\t\tobj = pdf_dict_gets(stmobj, \"UseCMap\");\n\t\tif (pdf_is_name(obj))\n\t\t{\n\t\t\tusecmap = pdf_load_system_cmap(ctx, pdf_to_name(obj));\n\t\t\tpdf_set_usecmap(ctx, cmap, usecmap);\n\t\t\tpdf_drop_cmap(ctx, usecmap);\n\t\t}\n\t\telse if (pdf_is_indirect(obj))\n\t\t{\n\t\t\tphase = 3;\n\t\t\tpdf_mark_obj(obj);\n\t\t\tusecmap = pdf_load_embedded_cmap(doc, obj);\n\t\t\tpdf_unmark_obj(obj);\n\t\t\tphase = 4;\n\t\t\tpdf_set_usecmap(ctx, cmap, usecmap);\n\t\t\tpdf_drop_cmap(ctx, usecmap);\n\t\t}\n\n\t\tpdf_store_item(ctx, stmobj, cmap, pdf_cmap_size(ctx, cmap));\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tif (file)\n\t\t\tfz_close(file);\n\t\tif (cmap)\n\t\t\tpdf_drop_cmap(ctx, cmap);\n\t\tif (phase < 1)\n\t\t\tfz_rethrow_message(ctx, \"cannot open cmap stream (%d %d R)\", pdf_to_num(stmobj), pdf_to_gen(stmobj));\n\t\telse if (phase < 2)\n\t\t\tfz_rethrow_message(ctx, \"cannot parse cmap stream (%d %d R)\", pdf_to_num(stmobj), pdf_to_gen(stmobj));\n\t\telse if (phase < 3)\n\t\t\tfz_rethrow_message(ctx, \"cannot load system usecmap '%s'\", pdf_to_name(obj));\n\t\telse\n\t\t{\n\t\t\tif (phase == 3)\n\t\t\t\tpdf_unmark_obj(obj);\n\t\t\tfz_rethrow_message(ctx, \"cannot load embedded usecmap (%d %d R)\", pdf_to_num(obj), pdf_to_gen(obj));\n\t\t}\n\t}\n\n\treturn cmap;\n}\n\n/*\n * Create an Identity-* CMap (for both 1 and 2-byte encodings)\n */\npdf_cmap *\npdf_new_identity_cmap(fz_context *ctx, int wmode, int bytes)\n{\n\tpdf_cmap *cmap = pdf_new_cmap(ctx);\n\tfz_try(ctx)\n\t{\n\t\tunsigned int high = (1 << (bytes * 8)) - 1;\n\t\tsprintf(cmap->cmap_name, \"Identity-%c\", wmode ? 'V' : 'H');\n\t\tpdf_add_codespace(ctx, cmap, 0, high, bytes);\n\t\tpdf_map_range_to_range(ctx, cmap, 0, high, 0);\n\t\tpdf_sort_cmap(ctx, cmap);\n\t\tpdf_set_cmap_wmode(ctx, cmap, wmode);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_cmap(ctx, cmap);\n\t\tfz_rethrow(ctx);\n\t}\n\treturn cmap;\n}\n\n/*\n * Load predefined CMap from system.\n */\npdf_cmap *\npdf_load_system_cmap(fz_context *ctx, char *cmap_name)\n{\n\tpdf_cmap *usecmap;\n\tpdf_cmap *cmap;\n\n\tcmap = pdf_load_builtin_cmap(ctx, cmap_name);\n\tif (!cmap)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"no builtin cmap file: %s\", cmap_name);\n\n\tif (cmap->usecmap_name[0] && !cmap->usecmap)\n\t{\n\t\tusecmap = pdf_load_system_cmap(ctx, cmap->usecmap_name);\n\t\tif (!usecmap)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"no builtin cmap file: %s\", cmap->usecmap_name);\n\t\tpdf_set_usecmap(ctx, cmap, usecmap);\n\t}\n\n\treturn cmap;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-cmap-parse.c",
    "content": "#include \"mupdf/pdf.h\"\n\n/*\n * CMap parser\n */\n\nstatic int\npdf_code_from_string(char *buf, int len)\n{\n\tint a = 0;\n\twhile (len--)\n\t\ta = (a << 8) | *(unsigned char *)buf++;\n\treturn a;\n}\n\nstatic void\npdf_parse_cmap_name(fz_context *ctx, pdf_cmap *cmap, fz_stream *file, pdf_lexbuf *buf)\n{\n\tpdf_token tok;\n\n\ttok = pdf_lex(file, buf);\n\n\tif (tok == PDF_TOK_NAME)\n\t\tfz_strlcpy(cmap->cmap_name, buf->scratch, sizeof(cmap->cmap_name));\n\telse\n\t\tfz_warn(ctx, \"expected name after CMapName in cmap\");\n}\n\nstatic void\npdf_parse_wmode(fz_context *ctx, pdf_cmap *cmap, fz_stream *file, pdf_lexbuf *buf)\n{\n\tpdf_token tok;\n\n\ttok = pdf_lex(file, buf);\n\n\tif (tok == PDF_TOK_INT)\n\t\tpdf_set_cmap_wmode(ctx, cmap, buf->i);\n\telse\n\t\tfz_warn(ctx, \"expected integer after WMode in cmap\");\n}\n\nstatic void\npdf_parse_codespace_range(fz_context *ctx, pdf_cmap *cmap, fz_stream *file, pdf_lexbuf *buf)\n{\n\tpdf_token tok;\n\tint lo, hi;\n\n\twhile (1)\n\t{\n\t\ttok = pdf_lex(file, buf);\n\n\t\tif (tok == PDF_TOK_KEYWORD && !strcmp(buf->scratch, \"endcodespacerange\"))\n\t\t\treturn;\n\n\t\telse if (tok == PDF_TOK_STRING)\n\t\t{\n\t\t\tlo = pdf_code_from_string(buf->scratch, buf->len);\n\t\t\ttok = pdf_lex(file, buf);\n\t\t\tif (tok == PDF_TOK_STRING)\n\t\t\t{\n\t\t\t\thi = pdf_code_from_string(buf->scratch, buf->len);\n\t\t\t\tpdf_add_codespace(ctx, cmap, lo, hi, buf->len);\n\t\t\t}\n\t\t\telse break;\n\t\t}\n\n\t\telse break;\n\t}\n\n\tfz_throw(ctx, FZ_ERROR_GENERIC, \"expected string or endcodespacerange\");\n}\n\nstatic void\npdf_parse_cid_range(fz_context *ctx, pdf_cmap *cmap, fz_stream *file, pdf_lexbuf *buf)\n{\n\tpdf_token tok;\n\tint lo, hi, dst;\n\n\twhile (1)\n\t{\n\t\ttok = pdf_lex(file, buf);\n\n\t\tif (tok == PDF_TOK_KEYWORD && !strcmp(buf->scratch, \"endcidrange\"))\n\t\t\treturn;\n\n\t\telse if (tok != PDF_TOK_STRING)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"expected string or endcidrange\");\n\n\t\tlo = pdf_code_from_string(buf->scratch, buf->len);\n\n\t\ttok = pdf_lex(file, buf);\n\t\tif (tok != PDF_TOK_STRING)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"expected string\");\n\n\t\thi = pdf_code_from_string(buf->scratch, buf->len);\n\n\t\ttok = pdf_lex(file, buf);\n\t\tif (tok != PDF_TOK_INT)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"expected integer\");\n\n\t\tdst = buf->i;\n\n\t\tpdf_map_range_to_range(ctx, cmap, lo, hi, dst);\n\t}\n}\n\nstatic void\npdf_parse_cid_char(fz_context *ctx, pdf_cmap *cmap, fz_stream *file, pdf_lexbuf *buf)\n{\n\tpdf_token tok;\n\tint src, dst;\n\n\twhile (1)\n\t{\n\t\ttok = pdf_lex(file, buf);\n\n\t\tif (tok == PDF_TOK_KEYWORD && !strcmp(buf->scratch, \"endcidchar\"))\n\t\t\treturn;\n\n\t\telse if (tok != PDF_TOK_STRING)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"expected string or endcidchar\");\n\n\t\tsrc = pdf_code_from_string(buf->scratch, buf->len);\n\n\t\ttok = pdf_lex(file, buf);\n\t\tif (tok != PDF_TOK_INT)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"expected integer\");\n\n\t\tdst = buf->i;\n\n\t\tpdf_map_range_to_range(ctx, cmap, src, src, dst);\n\t}\n}\n\nstatic void\npdf_parse_bf_range_array(fz_context *ctx, pdf_cmap *cmap, fz_stream *file, pdf_lexbuf *buf, int lo, int hi)\n{\n\tpdf_token tok;\n\tint dst[256];\n\tint i;\n\n\twhile (1)\n\t{\n\t\ttok = pdf_lex(file, buf);\n\n\t\tif (tok == PDF_TOK_CLOSE_ARRAY)\n\t\t\treturn;\n\n\t\t/* Note: does not handle [ /Name /Name ... ] */\n\t\telse if (tok != PDF_TOK_STRING)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"expected string or ]\");\n\n\t\tif (buf->len / 2)\n\t\t{\n\t\t\tint len = fz_mini(buf->len / 2, nelem(dst));\n\t\t\tfor (i = 0; i < len; i++)\n\t\t\t\tdst[i] = pdf_code_from_string(&buf->scratch[i * 2], 2);\n\n\t\t\tpdf_map_one_to_many(ctx, cmap, lo, dst, buf->len / 2);\n\t\t}\n\n\t\tlo ++;\n\t}\n}\n\nstatic void\npdf_parse_bf_range(fz_context *ctx, pdf_cmap *cmap, fz_stream *file, pdf_lexbuf *buf)\n{\n\tpdf_token tok;\n\tint lo, hi, dst;\n\n\twhile (1)\n\t{\n\t\ttok = pdf_lex(file, buf);\n\n\t\tif (tok == PDF_TOK_KEYWORD && !strcmp(buf->scratch, \"endbfrange\"))\n\t\t\treturn;\n\n\t\telse if (tok != PDF_TOK_STRING)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"expected string or endbfrange\");\n\n\t\tlo = pdf_code_from_string(buf->scratch, buf->len);\n\n\t\ttok = pdf_lex(file, buf);\n\t\tif (tok != PDF_TOK_STRING)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"expected string\");\n\n\t\thi = pdf_code_from_string(buf->scratch, buf->len);\n\t\tif (lo < 0 || lo > 65535 || hi < 0 || hi > 65535 || lo > hi)\n\t\t{\n\t\t\tfz_warn(ctx, \"bf_range limits out of range in cmap %s\", cmap->cmap_name);\n\t\t\treturn;\n\t\t}\n\n\t\ttok = pdf_lex(file, buf);\n\n\t\tif (tok == PDF_TOK_STRING)\n\t\t{\n\t\t\tif (buf->len == 2)\n\t\t\t{\n\t\t\t\tdst = pdf_code_from_string(buf->scratch, buf->len);\n\t\t\t\tpdf_map_range_to_range(ctx, cmap, lo, hi, dst);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tint dststr[256];\n\t\t\t\tint i;\n\n\t\t\t\tif (buf->len / 2)\n\t\t\t\t{\n\t\t\t\t\tint len = fz_mini(buf->len / 2, nelem(dststr));\n\t\t\t\t\tfor (i = 0; i < len; i++)\n\t\t\t\t\t\tdststr[i] = pdf_code_from_string(&buf->scratch[i * 2], 2);\n\n\t\t\t\t\twhile (lo <= hi)\n\t\t\t\t\t{\n\t\t\t\t\t\tdststr[i-1] ++;\n\t\t\t\t\t\tpdf_map_one_to_many(ctx, cmap, lo, dststr, i);\n\t\t\t\t\t\tlo ++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\telse if (tok == PDF_TOK_OPEN_ARRAY)\n\t\t{\n\t\t\tpdf_parse_bf_range_array(ctx, cmap, file, buf, lo, hi);\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"expected string or array or endbfrange\");\n\t\t}\n\t}\n}\n\nstatic void\npdf_parse_bf_char(fz_context *ctx, pdf_cmap *cmap, fz_stream *file, pdf_lexbuf *buf)\n{\n\tpdf_token tok;\n\tint dst[256];\n\tint src;\n\tint i;\n\n\twhile (1)\n\t{\n\t\ttok = pdf_lex(file, buf);\n\n\t\tif (tok == PDF_TOK_KEYWORD && !strcmp(buf->scratch, \"endbfchar\"))\n\t\t\treturn;\n\n\t\telse if (tok != PDF_TOK_STRING)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"expected string or endbfchar\");\n\n\t\tsrc = pdf_code_from_string(buf->scratch, buf->len);\n\n\t\ttok = pdf_lex(file, buf);\n\t\t/* Note: does not handle /dstName */\n\t\tif (tok != PDF_TOK_STRING)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"expected string\");\n\n\t\tif (buf->len / 2)\n\t\t{\n\t\t\tint len = fz_mini(buf->len / 2, nelem(dst));\n\t\t\tfor (i = 0; i < len; i++)\n\t\t\t\tdst[i] = pdf_code_from_string(&buf->scratch[i * 2], 2);\n\t\t\tpdf_map_one_to_many(ctx, cmap, src, dst, i);\n\t\t}\n\t}\n}\n\npdf_cmap *\npdf_load_cmap(fz_context *ctx, fz_stream *file)\n{\n\tpdf_cmap *cmap;\n\tchar key[64];\n\tpdf_lexbuf buf;\n\tpdf_token tok;\n\n\tpdf_lexbuf_init(ctx, &buf, PDF_LEXBUF_SMALL);\n\tcmap = pdf_new_cmap(ctx);\n\n\tstrcpy(key, \".notdef\");\n\n\tfz_try(ctx)\n\t{\n\t\twhile (1)\n\t\t{\n\t\t\ttok = pdf_lex(file, &buf);\n\n\t\t\tif (tok == PDF_TOK_EOF)\n\t\t\t\tbreak;\n\n\t\t\telse if (tok == PDF_TOK_NAME)\n\t\t\t{\n\t\t\t\tif (!strcmp(buf.scratch, \"CMapName\"))\n\t\t\t\t\tpdf_parse_cmap_name(ctx, cmap, file, &buf);\n\t\t\t\telse if (!strcmp(buf.scratch, \"WMode\"))\n\t\t\t\t\tpdf_parse_wmode(ctx, cmap, file, &buf);\n\t\t\t\telse\n\t\t\t\t\tfz_strlcpy(key, buf.scratch, sizeof key);\n\t\t\t}\n\n\t\t\telse if (tok == PDF_TOK_KEYWORD)\n\t\t\t{\n\t\t\t\tif (!strcmp(buf.scratch, \"endcmap\"))\n\t\t\t\t\tbreak;\n\n\t\t\t\telse if (!strcmp(buf.scratch, \"usecmap\"))\n\t\t\t\t\tfz_strlcpy(cmap->usecmap_name, key, sizeof(cmap->usecmap_name));\n\n\t\t\t\telse if (!strcmp(buf.scratch, \"begincodespacerange\"))\n\t\t\t\t\tpdf_parse_codespace_range(ctx, cmap, file, &buf);\n\n\t\t\t\telse if (!strcmp(buf.scratch, \"beginbfchar\"))\n\t\t\t\t\tpdf_parse_bf_char(ctx, cmap, file, &buf);\n\n\t\t\t\telse if (!strcmp(buf.scratch, \"begincidchar\"))\n\t\t\t\t\tpdf_parse_cid_char(ctx, cmap, file, &buf);\n\n\t\t\t\telse if (!strcmp(buf.scratch, \"beginbfrange\"))\n\t\t\t\t\tpdf_parse_bf_range(ctx, cmap, file, &buf);\n\n\t\t\t\telse if (!strcmp(buf.scratch, \"begincidrange\"))\n\t\t\t\t\tpdf_parse_cid_range(ctx, cmap, file, &buf);\n\t\t\t}\n\n\t\t\t/* ignore everything else */\n\t\t}\n\n\t\tpdf_sort_cmap(ctx, cmap);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_lexbuf_fin(&buf);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_cmap(ctx, cmap);\n\t\tfz_rethrow_message(ctx, \"syntaxerror in cmap\");\n\t}\n\n\treturn cmap;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-cmap-table.c",
    "content": "#include \"mupdf/pdf.h\"\n\n#ifndef NOCJK\n#include \"gen_cmap_cns.h\"\n#include \"gen_cmap_gb.h\"\n#include \"gen_cmap_japan.h\"\n#include \"gen_cmap_korea.h\"\n#endif\n\nstatic const struct { char *name; pdf_cmap *cmap; } cmap_table[] =\n{\n#ifndef NOCJK\n\t{\"78-EUC-H\",&cmap_78_EUC_H},\n\t{\"78-EUC-V\",&cmap_78_EUC_V},\n\t{\"78-H\",&cmap_78_H},\n\t{\"78-RKSJ-H\",&cmap_78_RKSJ_H},\n\t{\"78-RKSJ-V\",&cmap_78_RKSJ_V},\n\t{\"78-V\",&cmap_78_V},\n\t{\"78ms-RKSJ-H\",&cmap_78ms_RKSJ_H},\n\t{\"78ms-RKSJ-V\",&cmap_78ms_RKSJ_V},\n\t{\"83pv-RKSJ-H\",&cmap_83pv_RKSJ_H},\n\t{\"90ms-RKSJ-H\",&cmap_90ms_RKSJ_H},\n\t{\"90ms-RKSJ-V\",&cmap_90ms_RKSJ_V},\n\t{\"90msp-RKSJ-H\",&cmap_90msp_RKSJ_H},\n\t{\"90msp-RKSJ-V\",&cmap_90msp_RKSJ_V},\n\t{\"90pv-RKSJ-H\",&cmap_90pv_RKSJ_H},\n\t{\"90pv-RKSJ-V\",&cmap_90pv_RKSJ_V},\n\t{\"Add-H\",&cmap_Add_H},\n\t{\"Add-RKSJ-H\",&cmap_Add_RKSJ_H},\n\t{\"Add-RKSJ-V\",&cmap_Add_RKSJ_V},\n\t{\"Add-V\",&cmap_Add_V},\n\t{\"Adobe-CNS1-0\",&cmap_Adobe_CNS1_0},\n\t{\"Adobe-CNS1-1\",&cmap_Adobe_CNS1_1},\n\t{\"Adobe-CNS1-2\",&cmap_Adobe_CNS1_2},\n\t{\"Adobe-CNS1-3\",&cmap_Adobe_CNS1_3},\n\t{\"Adobe-CNS1-4\",&cmap_Adobe_CNS1_4},\n\t{\"Adobe-CNS1-5\",&cmap_Adobe_CNS1_5},\n\t{\"Adobe-CNS1-6\",&cmap_Adobe_CNS1_6},\n\t{\"Adobe-CNS1-UCS2\",&cmap_Adobe_CNS1_UCS2},\n\t{\"Adobe-GB1-0\",&cmap_Adobe_GB1_0},\n\t{\"Adobe-GB1-1\",&cmap_Adobe_GB1_1},\n\t{\"Adobe-GB1-2\",&cmap_Adobe_GB1_2},\n\t{\"Adobe-GB1-3\",&cmap_Adobe_GB1_3},\n\t{\"Adobe-GB1-4\",&cmap_Adobe_GB1_4},\n\t{\"Adobe-GB1-5\",&cmap_Adobe_GB1_5},\n\t{\"Adobe-GB1-UCS2\",&cmap_Adobe_GB1_UCS2},\n\t{\"Adobe-Japan1-0\",&cmap_Adobe_Japan1_0},\n\t{\"Adobe-Japan1-1\",&cmap_Adobe_Japan1_1},\n\t{\"Adobe-Japan1-2\",&cmap_Adobe_Japan1_2},\n\t{\"Adobe-Japan1-3\",&cmap_Adobe_Japan1_3},\n\t{\"Adobe-Japan1-4\",&cmap_Adobe_Japan1_4},\n\t{\"Adobe-Japan1-5\",&cmap_Adobe_Japan1_5},\n\t{\"Adobe-Japan1-6\",&cmap_Adobe_Japan1_6},\n\t{\"Adobe-Japan1-UCS2\",&cmap_Adobe_Japan1_UCS2},\n\t{\"Adobe-Korea1-0\",&cmap_Adobe_Korea1_0},\n\t{\"Adobe-Korea1-1\",&cmap_Adobe_Korea1_1},\n\t{\"Adobe-Korea1-2\",&cmap_Adobe_Korea1_2},\n\t{\"Adobe-Korea1-UCS2\",&cmap_Adobe_Korea1_UCS2},\n\t{\"B5-H\",&cmap_B5_H},\n\t{\"B5-V\",&cmap_B5_V},\n\t{\"B5pc-H\",&cmap_B5pc_H},\n\t{\"B5pc-V\",&cmap_B5pc_V},\n\t{\"CNS-EUC-H\",&cmap_CNS_EUC_H},\n\t{\"CNS-EUC-V\",&cmap_CNS_EUC_V},\n\t{\"CNS1-H\",&cmap_CNS1_H},\n\t{\"CNS1-V\",&cmap_CNS1_V},\n\t{\"CNS2-H\",&cmap_CNS2_H},\n\t{\"CNS2-V\",&cmap_CNS2_V},\n\t{\"ETHK-B5-H\",&cmap_ETHK_B5_H},\n\t{\"ETHK-B5-V\",&cmap_ETHK_B5_V},\n\t{\"ETen-B5-H\",&cmap_ETen_B5_H},\n\t{\"ETen-B5-V\",&cmap_ETen_B5_V},\n\t{\"ETenms-B5-H\",&cmap_ETenms_B5_H},\n\t{\"ETenms-B5-V\",&cmap_ETenms_B5_V},\n\t{\"EUC-H\",&cmap_EUC_H},\n\t{\"EUC-V\",&cmap_EUC_V},\n\t{\"Ext-H\",&cmap_Ext_H},\n\t{\"Ext-RKSJ-H\",&cmap_Ext_RKSJ_H},\n\t{\"Ext-RKSJ-V\",&cmap_Ext_RKSJ_V},\n\t{\"Ext-V\",&cmap_Ext_V},\n\t{\"GB-EUC-H\",&cmap_GB_EUC_H},\n\t{\"GB-EUC-V\",&cmap_GB_EUC_V},\n\t{\"GB-H\",&cmap_GB_H},\n\t{\"GB-V\",&cmap_GB_V},\n\t{\"GBK-EUC-H\",&cmap_GBK_EUC_H},\n\t{\"GBK-EUC-V\",&cmap_GBK_EUC_V},\n\t{\"GBK2K-H\",&cmap_GBK2K_H},\n\t{\"GBK2K-V\",&cmap_GBK2K_V},\n\t{\"GBKp-EUC-H\",&cmap_GBKp_EUC_H},\n\t{\"GBKp-EUC-V\",&cmap_GBKp_EUC_V},\n\t{\"GBT-EUC-H\",&cmap_GBT_EUC_H},\n\t{\"GBT-EUC-V\",&cmap_GBT_EUC_V},\n\t{\"GBT-H\",&cmap_GBT_H},\n\t{\"GBT-V\",&cmap_GBT_V},\n\t{\"GBTpc-EUC-H\",&cmap_GBTpc_EUC_H},\n\t{\"GBTpc-EUC-V\",&cmap_GBTpc_EUC_V},\n\t{\"GBpc-EUC-H\",&cmap_GBpc_EUC_H},\n\t{\"GBpc-EUC-V\",&cmap_GBpc_EUC_V},\n\t{\"H\",&cmap_H},\n\t{\"HKdla-B5-H\",&cmap_HKdla_B5_H},\n\t{\"HKdla-B5-V\",&cmap_HKdla_B5_V},\n\t{\"HKdlb-B5-H\",&cmap_HKdlb_B5_H},\n\t{\"HKdlb-B5-V\",&cmap_HKdlb_B5_V},\n\t{\"HKgccs-B5-H\",&cmap_HKgccs_B5_H},\n\t{\"HKgccs-B5-V\",&cmap_HKgccs_B5_V},\n\t{\"HKm314-B5-H\",&cmap_HKm314_B5_H},\n\t{\"HKm314-B5-V\",&cmap_HKm314_B5_V},\n\t{\"HKm471-B5-H\",&cmap_HKm471_B5_H},\n\t{\"HKm471-B5-V\",&cmap_HKm471_B5_V},\n\t{\"HKscs-B5-H\",&cmap_HKscs_B5_H},\n\t{\"HKscs-B5-V\",&cmap_HKscs_B5_V},\n\t{\"Hankaku\",&cmap_Hankaku},\n\t{\"Hiragana\",&cmap_Hiragana},\n\t{\"KSC-EUC-H\",&cmap_KSC_EUC_H},\n\t{\"KSC-EUC-V\",&cmap_KSC_EUC_V},\n\t{\"KSC-H\",&cmap_KSC_H},\n\t{\"KSC-Johab-H\",&cmap_KSC_Johab_H},\n\t{\"KSC-Johab-V\",&cmap_KSC_Johab_V},\n\t{\"KSC-V\",&cmap_KSC_V},\n\t{\"KSCms-UHC-H\",&cmap_KSCms_UHC_H},\n\t{\"KSCms-UHC-HW-H\",&cmap_KSCms_UHC_HW_H},\n\t{\"KSCms-UHC-HW-V\",&cmap_KSCms_UHC_HW_V},\n\t{\"KSCms-UHC-V\",&cmap_KSCms_UHC_V},\n\t{\"KSCpc-EUC-H\",&cmap_KSCpc_EUC_H},\n\t{\"KSCpc-EUC-V\",&cmap_KSCpc_EUC_V},\n\t{\"Katakana\",&cmap_Katakana},\n\t{\"NWP-H\",&cmap_NWP_H},\n\t{\"NWP-V\",&cmap_NWP_V},\n\t{\"RKSJ-H\",&cmap_RKSJ_H},\n\t{\"RKSJ-V\",&cmap_RKSJ_V},\n\t{\"Roman\",&cmap_Roman},\n\t{\"UniCNS-UCS2-H\",&cmap_UniCNS_UCS2_H},\n\t{\"UniCNS-UCS2-V\",&cmap_UniCNS_UCS2_V},\n\t{\"UniCNS-UTF16-H\",&cmap_UniCNS_UTF16_H},\n\t{\"UniCNS-UTF16-V\",&cmap_UniCNS_UTF16_V},\n\t{\"UniCNS-UTF32-H\",&cmap_UniCNS_UTF32_H},\n\t{\"UniCNS-UTF32-V\",&cmap_UniCNS_UTF32_V},\n\t{\"UniCNS-UTF8-H\",&cmap_UniCNS_UTF8_H},\n\t{\"UniCNS-UTF8-V\",&cmap_UniCNS_UTF8_V},\n\t{\"UniCNS-X\",&cmap_UniCNS_X},\n\t{\"UniGB-UCS2-H\",&cmap_UniGB_UCS2_H},\n\t{\"UniGB-UCS2-V\",&cmap_UniGB_UCS2_V},\n\t{\"UniGB-UTF16-H\",&cmap_UniGB_UTF16_H},\n\t{\"UniGB-UTF16-V\",&cmap_UniGB_UTF16_V},\n\t{\"UniGB-UTF32-H\",&cmap_UniGB_UTF32_H},\n\t{\"UniGB-UTF32-V\",&cmap_UniGB_UTF32_V},\n\t{\"UniGB-UTF8-H\",&cmap_UniGB_UTF8_H},\n\t{\"UniGB-UTF8-V\",&cmap_UniGB_UTF8_V},\n\t{\"UniGB-X\",&cmap_UniGB_X},\n\t{\"UniJIS-UCS2-H\",&cmap_UniJIS_UCS2_H},\n\t{\"UniJIS-UCS2-HW-H\",&cmap_UniJIS_UCS2_HW_H},\n\t{\"UniJIS-UCS2-HW-V\",&cmap_UniJIS_UCS2_HW_V},\n\t{\"UniJIS-UCS2-V\",&cmap_UniJIS_UCS2_V},\n\t{\"UniJIS-UTF16-H\",&cmap_UniJIS_UTF16_H},\n\t{\"UniJIS-UTF16-V\",&cmap_UniJIS_UTF16_V},\n\t{\"UniJIS-UTF32-H\",&cmap_UniJIS_UTF32_H},\n\t{\"UniJIS-UTF32-V\",&cmap_UniJIS_UTF32_V},\n\t{\"UniJIS-UTF8-H\",&cmap_UniJIS_UTF8_H},\n\t{\"UniJIS-UTF8-V\",&cmap_UniJIS_UTF8_V},\n\t{\"UniJIS-X\",&cmap_UniJIS_X},\n\t{\"UniJIS-X16\",&cmap_UniJIS_X16},\n\t{\"UniJIS-X32\",&cmap_UniJIS_X32},\n\t{\"UniJIS-X8\",&cmap_UniJIS_X8},\n\t{\"UniJIS2004-UTF16-H\",&cmap_UniJIS2004_UTF16_H},\n\t{\"UniJIS2004-UTF16-V\",&cmap_UniJIS2004_UTF16_V},\n\t{\"UniJIS2004-UTF32-H\",&cmap_UniJIS2004_UTF32_H},\n\t{\"UniJIS2004-UTF32-V\",&cmap_UniJIS2004_UTF32_V},\n\t{\"UniJIS2004-UTF8-H\",&cmap_UniJIS2004_UTF8_H},\n\t{\"UniJIS2004-UTF8-V\",&cmap_UniJIS2004_UTF8_V},\n\t{\"UniJISPro-UCS2-HW-V\",&cmap_UniJISPro_UCS2_HW_V},\n\t{\"UniJISPro-UCS2-V\",&cmap_UniJISPro_UCS2_V},\n\t{\"UniJISPro-UTF8-V\",&cmap_UniJISPro_UTF8_V},\n\t{\"UniJISX0213-UTF32-H\",&cmap_UniJISX0213_UTF32_H},\n\t{\"UniJISX0213-UTF32-V\",&cmap_UniJISX0213_UTF32_V},\n\t{\"UniJISX02132004-UTF32-H\",&cmap_UniJISX02132004_UTF32_H},\n\t{\"UniJISX02132004-UTF32-V\",&cmap_UniJISX02132004_UTF32_V},\n\t{\"UniKS-UCS2-H\",&cmap_UniKS_UCS2_H},\n\t{\"UniKS-UCS2-V\",&cmap_UniKS_UCS2_V},\n\t{\"UniKS-UTF16-H\",&cmap_UniKS_UTF16_H},\n\t{\"UniKS-UTF16-V\",&cmap_UniKS_UTF16_V},\n\t{\"UniKS-UTF32-H\",&cmap_UniKS_UTF32_H},\n\t{\"UniKS-UTF32-V\",&cmap_UniKS_UTF32_V},\n\t{\"UniKS-UTF8-H\",&cmap_UniKS_UTF8_H},\n\t{\"UniKS-UTF8-V\",&cmap_UniKS_UTF8_V},\n\t{\"UniKS-X\",&cmap_UniKS_X},\n\t{\"V\",&cmap_V},\n\t{\"WP-Symbol\",&cmap_WP_Symbol},\n#endif\n};\n\npdf_cmap *\npdf_load_builtin_cmap(fz_context *ctx, char *cmap_name)\n{\n\tint l = 0;\n\tint r = nelem(cmap_table) - 1;\n\twhile (l <= r)\n\t{\n\t\tint m = (l + r) >> 1;\n\t\tint c = strcmp(cmap_name, cmap_table[m].name);\n\t\tif (c < 0)\n\t\t\tr = m - 1;\n\t\telse if (c > 0)\n\t\t\tl = m + 1;\n\t\telse\n\t\t\treturn cmap_table[m].cmap;\n\t}\n\treturn NULL;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-cmap.c",
    "content": "#include \"mupdf/pdf.h\"\n\n/*\n * Allocate, destroy and simple parameters.\n */\n\nvoid\npdf_free_cmap_imp(fz_context *ctx, fz_storable *cmap_)\n{\n\tpdf_cmap *cmap = (pdf_cmap *)cmap_;\n\tif (cmap->usecmap)\n\t\tpdf_drop_cmap(ctx, cmap->usecmap);\n\tfz_free(ctx, cmap->ranges);\n\tfz_free(ctx, cmap->xranges);\n\tfz_free(ctx, cmap->mranges);\n\tfz_free(ctx, cmap);\n}\n\npdf_cmap *\npdf_new_cmap(fz_context *ctx)\n{\n\tpdf_cmap *cmap = fz_malloc_struct(ctx, pdf_cmap);\n\tFZ_INIT_STORABLE(cmap, 1, pdf_free_cmap_imp);\n\treturn cmap;\n}\n\n/* Could be a macro for speed */\npdf_cmap *\npdf_keep_cmap(fz_context *ctx, pdf_cmap *cmap)\n{\n\treturn (pdf_cmap *)fz_keep_storable(ctx, &cmap->storable);\n}\n\n/* Could be a macro for speed */\nvoid\npdf_drop_cmap(fz_context *ctx, pdf_cmap *cmap)\n{\n\tfz_drop_storable(ctx, &cmap->storable);\n}\n\nvoid\npdf_set_usecmap(fz_context *ctx, pdf_cmap *cmap, pdf_cmap *usecmap)\n{\n\tint i;\n\n\tif (cmap->usecmap)\n\t\tpdf_drop_cmap(ctx, cmap->usecmap);\n\tcmap->usecmap = pdf_keep_cmap(ctx, usecmap);\n\n\tif (cmap->codespace_len == 0)\n\t{\n\t\tcmap->codespace_len = usecmap->codespace_len;\n\t\tfor (i = 0; i < usecmap->codespace_len; i++)\n\t\t\tcmap->codespace[i] = usecmap->codespace[i];\n\t}\n}\n\nint\npdf_cmap_wmode(fz_context *ctx, pdf_cmap *cmap)\n{\n\treturn cmap->wmode;\n}\n\nvoid\npdf_set_cmap_wmode(fz_context *ctx, pdf_cmap *cmap, int wmode)\n{\n\tcmap->wmode = wmode;\n}\n\n/*\n * Add a codespacerange section.\n * These ranges are used by pdf_decode_cmap to decode\n * multi-byte encoded strings.\n */\nvoid\npdf_add_codespace(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high, int n)\n{\n\tif (cmap->codespace_len + 1 == nelem(cmap->codespace))\n\t{\n\t\tfz_warn(ctx, \"assert: too many code space ranges\");\n\t\treturn;\n\t}\n\n\tcmap->codespace[cmap->codespace_len].n = n;\n\tcmap->codespace[cmap->codespace_len].low = low;\n\tcmap->codespace[cmap->codespace_len].high = high;\n\tcmap->codespace_len ++;\n}\n\n/*\n * Add a range.\n */\nstatic void\nadd_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high, unsigned int out)\n{\n\tif (low > high)\n\t{\n\t\tfz_warn(ctx, \"range limits out of range in cmap %s\", cmap->cmap_name);\n\t\treturn;\n\t}\n\n\tif (low <= 0xFFFF && high <= 0xFFFF && out <= 0xFFFF)\n\t{\n\t\tif (cmap->rlen + 1 > cmap->rcap)\n\t\t{\n\t\t\tint new_cap = cmap->rcap ? cmap->rcap * 2 : 256;\n\t\t\tcmap->ranges = fz_resize_array(ctx, cmap->ranges, new_cap, sizeof *cmap->ranges);\n\t\t\tcmap->rcap = new_cap;\n\t\t}\n\t\tcmap->ranges[cmap->rlen].low = low;\n\t\tcmap->ranges[cmap->rlen].high = high;\n\t\tcmap->ranges[cmap->rlen].out = out;\n\t\tcmap->rlen++;\n\t}\n\telse\n\t{\n\t\tif (cmap->xlen + 1 > cmap->xcap)\n\t\t{\n\t\t\tint new_cap = cmap->xcap ? cmap->xcap * 2 : 256;\n\t\t\tcmap->xranges = fz_resize_array(ctx, cmap->xranges, new_cap, sizeof *cmap->xranges);\n\t\t\tcmap->xcap = new_cap;\n\t\t}\n\t\tcmap->xranges[cmap->xlen].low = low;\n\t\tcmap->xranges[cmap->xlen].high = high;\n\t\tcmap->xranges[cmap->xlen].out = out;\n\t\tcmap->xlen++;\n\t}\n}\n\n/*\n * Add a one-to-many mapping.\n */\nstatic void\nadd_mrange(fz_context *ctx, pdf_cmap *cmap, unsigned int low, int *out, int len)\n{\n\tint i;\n\tif (cmap->mlen + 1 > cmap->mcap)\n\t{\n\t\tint new_cap = cmap->mcap ? cmap->mcap * 2 : 256;\n\t\tcmap->mranges = fz_resize_array(ctx, cmap->mranges, new_cap, sizeof *cmap->mranges);\n\t\tcmap->mcap = new_cap;\n\t}\n\tcmap->mranges[cmap->mlen].low = low;\n\tcmap->mranges[cmap->mlen].len = len;\n\tfor (i = 0; i < len; ++i)\n\t\tcmap->mranges[cmap->mlen].out[i] = out[i];\n\tfor (; i < PDF_MRANGE_CAP; ++i)\n\t\tcmap->mranges[cmap->mlen].out[i] = 0;\n\tcmap->mlen++;\n}\n\n/*\n * Add a range-to-table mapping.\n */\nvoid\npdf_map_range_to_table(fz_context *ctx, pdf_cmap *cmap, unsigned int low, int *table, int len)\n{\n\tint i;\n\tfor (i = 0; i < len; i++)\n\t\tadd_range(ctx, cmap, low + i, low + i, table[i]);\n}\n\n/*\n * Add a range of contiguous one-to-one mappings (ie 1..5 maps to 21..25)\n */\nvoid\npdf_map_range_to_range(fz_context *ctx, pdf_cmap *cmap, unsigned int low, unsigned int high, int out)\n{\n\tadd_range(ctx, cmap, low, high, out);\n}\n\n/*\n * Add a single one-to-many mapping.\n */\nvoid\npdf_map_one_to_many(fz_context *ctx, pdf_cmap *cmap, unsigned int low, int *values, int len)\n{\n\tif (len == 1)\n\t{\n\t\tadd_range(ctx, cmap, low, low, values[0]);\n\t\treturn;\n\t}\n\n\t/* Decode unicode surrogate pairs. */\n\t/* Only the *-UCS2 CMaps use one-to-many mappings, so assuming unicode should be safe. */\n\tif (len == 2 &&\n\t\tvalues[0] >= 0xD800 && values[0] <= 0xDBFF &&\n\t\tvalues[1] >= 0xDC00 && values[1] <= 0xDFFF)\n\t{\n\t\tint rune = ((values[0] - 0xD800) << 10) + (values[1] - 0xDC00) + 0x10000;\n\t\tadd_range(ctx, cmap, low, low, rune);\n\t\treturn;\n\t}\n\n\tif (len > PDF_MRANGE_CAP)\n\t{\n\t\tfz_warn(ctx, \"ignoring one to many mapping in cmap %s\", cmap->cmap_name);\n\t\treturn;\n\t}\n\n\tadd_mrange(ctx, cmap, low, values, len);\n}\n\n/*\n * Sort the input ranges.\n * Merge contiguous ranges.\n */\n\nstatic int cmprange(const void *va, const void *vb)\n{\n\tunsigned int a = ((const pdf_range*)va)->low;\n\tunsigned int b = ((const pdf_range*)vb)->low;\n\treturn a < b ? -1 : a > b ? 1 : 0;\n}\n\nstatic int cmpxrange(const void *va, const void *vb)\n{\n\tunsigned int a = ((const pdf_xrange*)va)->low;\n\tunsigned int b = ((const pdf_xrange*)vb)->low;\n\treturn a < b ? -1 : a > b ? 1 : 0;\n}\n\nstatic int cmpmrange(const void *va, const void *vb)\n{\n\tunsigned int a = ((const pdf_mrange*)va)->low;\n\tunsigned int b = ((const pdf_mrange*)vb)->low;\n\treturn a < b ? -1 : a > b ? 1 : 0;\n}\n\nvoid\npdf_sort_cmap(fz_context *ctx, pdf_cmap *cmap)\n{\n\tpdf_range *a, *b;\n\tpdf_xrange *x, *y;\n\n\tif (cmap->rlen)\n\t{\n\t\tqsort(cmap->ranges, cmap->rlen, sizeof *cmap->ranges, cmprange);\n\t\ta = cmap->ranges;\n\t\tfor (b = a + 1; b < cmap->ranges + cmap->rlen; ++b)\n\t\t{\n\t\t\tif (b->low == a->high + 1 && b->out == a->out + (a->high - a->low) + 1)\n\t\t\t\ta->high = b->high;\n\t\t\telse\n\t\t\t\t*(++a) = *b;\n\t\t}\n\t\tcmap->rlen = a - cmap->ranges + 1;\n\t}\n\n\tif (cmap->xlen)\n\t{\n\t\tqsort(cmap->xranges, cmap->xlen, sizeof *cmap->xranges, cmpxrange);\n\t\tx = cmap->xranges;\n\t\tfor (y = x + 1; y < cmap->xranges + cmap->xlen; ++y)\n\t\t{\n\t\t\tif (y->low == x->high + 1 && y->out == x->out + (x->high - x->low) + 1)\n\t\t\t\tx->high = y->high;\n\t\t\telse\n\t\t\t\t*(++x) = *y;\n\t\t}\n\t\tcmap->xlen = x - cmap->xranges + 1;\n\t}\n\n\tif (cmap->mlen)\n\t{\n\t\tqsort(cmap->mranges, cmap->mlen, sizeof *cmap->mranges, cmpmrange);\n\t}\n}\n\n/*\n * Lookup the mapping of a codepoint.\n */\nint\npdf_lookup_cmap(pdf_cmap *cmap, unsigned int cpt)\n{\n\tpdf_range *ranges = cmap->ranges;\n\tpdf_xrange *xranges = cmap->xranges;\n\tint l, r, m;\n\n\tl = 0;\n\tr = cmap->rlen - 1;\n\twhile (l <= r)\n\t{\n\t\tm = (l + r) >> 1;\n\t\tif (cpt < ranges[m].low)\n\t\t\tr = m - 1;\n\t\telse if (cpt > ranges[m].high)\n\t\t\tl = m + 1;\n\t\telse\n\t\t\treturn cpt - ranges[m].low + ranges[m].out;\n\t}\n\n\tl = 0;\n\tr = cmap->xlen - 1;\n\twhile (l <= r)\n\t{\n\t\tm = (l + r) >> 1;\n\t\tif (cpt < xranges[m].low)\n\t\t\tr = m - 1;\n\t\telse if (cpt > xranges[m].high)\n\t\t\tl = m + 1;\n\t\telse\n\t\t\treturn cpt - xranges[m].low + xranges[m].out;\n\t}\n\n\tif (cmap->usecmap)\n\t\treturn pdf_lookup_cmap(cmap->usecmap, cpt);\n\n\treturn -1;\n}\n\nint\npdf_lookup_cmap_full(pdf_cmap *cmap, unsigned int cpt, int *out)\n{\n\tpdf_range *ranges = cmap->ranges;\n\tpdf_xrange *xranges = cmap->xranges;\n\tpdf_mrange *mranges = cmap->mranges;\n\tunsigned int i;\n\tint l, r, m;\n\n\tl = 0;\n\tr = cmap->rlen - 1;\n\twhile (l <= r)\n\t{\n\t\tm = (l + r) >> 1;\n\t\tif (cpt < ranges[m].low)\n\t\t\tr = m - 1;\n\t\telse if (cpt > ranges[m].high)\n\t\t\tl = m + 1;\n\t\telse\n\t\t{\n\t\t\tout[0] = cpt - ranges[m].low + ranges[m].out;\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\tl = 0;\n\tr = cmap->xlen - 1;\n\twhile (l <= r)\n\t{\n\t\tm = (l + r) >> 1;\n\t\tif (cpt < xranges[m].low)\n\t\t\tr = m - 1;\n\t\telse if (cpt > xranges[m].high)\n\t\t\tl = m + 1;\n\t\telse\n\t\t{\n\t\t\tout[0] = cpt - xranges[m].low + xranges[m].out;\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\tl = 0;\n\tr = cmap->mlen - 1;\n\twhile (l <= r)\n\t{\n\t\tm = (l + r) >> 1;\n\t\tif (cpt < mranges[m].low)\n\t\t\tr = m - 1;\n\t\telse if (cpt > mranges[m].low)\n\t\t\tl = m + 1;\n\t\telse\n\t\t{\n\t\t\tfor (i = 0; i < mranges[m].len; ++i)\n\t\t\t\tout[i] = mranges[m].out[i];\n\t\t\treturn mranges[m].len;\n\t\t}\n\t}\n\n\tif (cmap->usecmap)\n\t\treturn pdf_lookup_cmap_full(cmap->usecmap, cpt, out);\n\n\treturn 0;\n}\n\n/*\n * Use the codespace ranges to extract a codepoint from a\n * multi-byte encoded string.\n */\nint\npdf_decode_cmap(pdf_cmap *cmap, unsigned char *buf, unsigned char *end, unsigned int *cpt)\n{\n\tunsigned int c;\n\tint k, n;\n\tint len = end - buf;\n\n\tif (len > 4)\n\t\tlen = 4;\n\n\tc = 0;\n\tfor (n = 0; n < len; n++)\n\t{\n\t\tc = (c << 8) | buf[n];\n\t\tfor (k = 0; k < cmap->codespace_len; k++)\n\t\t{\n\t\t\tif (cmap->codespace[k].n == n + 1)\n\t\t\t{\n\t\t\t\tif (c >= cmap->codespace[k].low && c <= cmap->codespace[k].high)\n\t\t\t\t{\n\t\t\t\t\t*cpt = c;\n\t\t\t\t\treturn n + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t*cpt = 0;\n\treturn 1;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-colorspace.c",
    "content": "#include \"mupdf/pdf.h\"\n\n/* ICCBased */\n\nstatic fz_colorspace *\nload_icc_based(pdf_document *doc, pdf_obj *dict)\n{\n\tint n;\n\tpdf_obj *obj;\n\tfz_context *ctx = doc->ctx;\n\n\tn = pdf_to_int(pdf_dict_gets(dict, \"N\"));\n\tobj = pdf_dict_gets(dict, \"Alternate\");\n\n\tif (obj)\n\t{\n\t\tfz_colorspace *cs_alt = NULL;\n\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tcs_alt = pdf_load_colorspace(doc, obj);\n\t\t\tif (cs_alt->n != n)\n\t\t\t{\n\t\t\t\tfz_drop_colorspace(ctx, cs_alt);\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"ICCBased /Alternate colorspace must have %d components\", n);\n\t\t\t}\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tcs_alt = NULL;\n\t\t}\n\n\t\tif (cs_alt)\n\t\t\treturn cs_alt;\n\t}\n\n\tswitch (n)\n\t{\n\tcase 1: return fz_device_gray(ctx);\n\tcase 3: return fz_device_rgb(ctx);\n\tcase 4: return fz_device_cmyk(ctx);\n\t}\n\n\tfz_throw(ctx, FZ_ERROR_GENERIC, \"syntaxerror: ICCBased must have 1, 3 or 4 components\");\n}\n\n/* Lab */\n\nstatic inline float fung(float x)\n{\n\tif (x >= 6.0f / 29.0f)\n\t\treturn x * x * x;\n\treturn (108.0f / 841.0f) * (x - (4.0f / 29.0f));\n}\n\nstatic void\nlab_to_rgb(fz_context *ctx, fz_colorspace *cs, const float *lab, float *rgb)\n{\n\t/* input is in range (0..100, -128..127, -128..127) not (0..1, 0..1, 0..1) */\n\tfloat lstar, astar, bstar, l, m, n, x, y, z, r, g, b;\n\tlstar = lab[0];\n\tastar = lab[1];\n\tbstar = lab[2];\n\tm = (lstar + 16) / 116;\n\tl = m + astar / 500;\n\tn = m - bstar / 200;\n\tx = fung(l);\n\ty = fung(m);\n\tz = fung(n);\n\tr = (3.240449f * x + -1.537136f * y + -0.498531f * z) * 0.830026f;\n\tg = (-0.969265f * x + 1.876011f * y + 0.041556f * z) * 1.05452f;\n\tb = (0.055643f * x + -0.204026f * y + 1.057229f * z) * 1.1003f;\n\trgb[0] = sqrtf(fz_clamp(r, 0, 1));\n\trgb[1] = sqrtf(fz_clamp(g, 0, 1));\n\trgb[2] = sqrtf(fz_clamp(b, 0, 1));\n}\n\nstatic void\nrgb_to_lab(fz_context *ctx, fz_colorspace *cs, const float *rgb, float *lab)\n{\n\tfz_warn(ctx, \"cannot convert into L*a*b colorspace\");\n\tlab[0] = rgb[0];\n\tlab[1] = rgb[1];\n\tlab[2] = rgb[2];\n}\n\nstatic fz_colorspace k_device_lab = { {-1, fz_free_colorspace_imp}, 0, \"Lab\", 3, lab_to_rgb, rgb_to_lab };\nstatic fz_colorspace *fz_device_lab = &k_device_lab;\n\n/* Separation and DeviceN */\n\nstruct separation\n{\n\tfz_colorspace *base;\n\tfz_function *tint;\n};\n\nstatic void\nseparation_to_rgb(fz_context *ctx, fz_colorspace *cs, const float *color, float *rgb)\n{\n\tstruct separation *sep = cs->data;\n\tfloat alt[FZ_MAX_COLORS];\n\tfz_eval_function(ctx, sep->tint, color, cs->n, alt, sep->base->n);\n\tsep->base->to_rgb(ctx, sep->base, alt, rgb);\n}\n\nstatic void\nfree_separation(fz_context *ctx, fz_colorspace *cs)\n{\n\tstruct separation *sep = cs->data;\n\tfz_drop_colorspace(ctx, sep->base);\n\tfz_drop_function(ctx, sep->tint);\n\tfz_free(ctx, sep);\n}\n\nstatic fz_colorspace *\nload_separation(pdf_document *doc, pdf_obj *array)\n{\n\tfz_colorspace *cs;\n\tstruct separation *sep = NULL;\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *nameobj = pdf_array_get(array, 1);\n\tpdf_obj *baseobj = pdf_array_get(array, 2);\n\tpdf_obj *tintobj = pdf_array_get(array, 3);\n\tfz_colorspace *base;\n\tfz_function *tint = NULL;\n\tint n;\n\n\tfz_var(tint);\n\tfz_var(sep);\n\n\tif (pdf_is_array(nameobj))\n\t\tn = pdf_array_len(nameobj);\n\telse\n\t\tn = 1;\n\n\tif (n > FZ_MAX_COLORS)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"too many components in colorspace\");\n\n\tbase = pdf_load_colorspace(doc, baseobj);\n\n\tfz_try(ctx)\n\t{\n\t\ttint = pdf_load_function(doc, tintobj, n, base->n);\n\t\t/* RJW: fz_drop_colorspace(ctx, base);\n\t\t * \"cannot load tint function (%d %d R)\", pdf_to_num(tintobj), pdf_to_gen(tintobj) */\n\n\t\tsep = fz_malloc_struct(ctx, struct separation);\n\t\tsep->base = base;\n\t\tsep->tint = tint;\n\n\t\tcs = fz_new_colorspace(ctx, n == 1 ? \"Separation\" : \"DeviceN\", n);\n\t\tcs->to_rgb = separation_to_rgb;\n\t\tcs->free_data = free_separation;\n\t\tcs->data = sep;\n\t\tcs->size += sizeof(struct separation) + (base ? base->size : 0) + fz_function_size(tint);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_drop_colorspace(ctx, base);\n\t\tfz_drop_function(ctx, tint);\n\t\tfz_free(ctx, sep);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn cs;\n}\n\nint\npdf_is_tint_colorspace(fz_colorspace *cs)\n{\n\treturn cs && cs->to_rgb == separation_to_rgb;\n}\n\n/* Indexed */\n\nstatic fz_colorspace *\nload_indexed(pdf_document *doc, pdf_obj *array)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *baseobj = pdf_array_get(array, 1);\n\tpdf_obj *highobj = pdf_array_get(array, 2);\n\tpdf_obj *lookupobj = pdf_array_get(array, 3);\n\tfz_colorspace *base = NULL;\n\tfz_colorspace *cs;\n\tint i, n, high;\n\tunsigned char *lookup = NULL;\n\n\tfz_var(base);\n\tfz_var(lookup);\n\n\tfz_try(ctx)\n\t{\n\t\tbase = pdf_load_colorspace(doc, baseobj);\n\n\t\thigh = pdf_to_int(highobj);\n\t\thigh = fz_clampi(high, 0, 255);\n\t\tn = base->n * (high + 1);\n\t\tlookup = fz_malloc_array(ctx, 1, n);\n\n\t\tif (pdf_is_string(lookupobj) && pdf_to_str_len(lookupobj) >= n)\n\t\t{\n\t\t\tunsigned char *buf = (unsigned char *) pdf_to_str_buf(lookupobj);\n\t\t\tfor (i = 0; i < n; i++)\n\t\t\t\tlookup[i] = buf[i];\n\t\t}\n\t\telse if (pdf_is_indirect(lookupobj))\n\t\t{\n\t\t\tfz_stream *file = NULL;\n\n\t\t\tfz_var(file);\n\n\t\t\tfz_try(ctx)\n\t\t\t{\n\t\t\t\tfile = pdf_open_stream(doc, pdf_to_num(lookupobj), pdf_to_gen(lookupobj));\n\t\t\t\ti = fz_read(file, lookup, n);\n\t\t\t\tif (i < n)\n\t\t\t\t\tmemset(lookup+i, 0, n-i);\n\t\t\t}\n\t\t\tfz_always(ctx)\n\t\t\t{\n\t\t\t\tfz_close(file);\n\t\t\t}\n\t\t\tfz_catch(ctx)\n\t\t\t{\n\t\t\t\tfz_rethrow_message(ctx, \"cannot open colorspace lookup table (%d 0 R)\", pdf_to_num(lookupobj));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_rethrow_message(ctx, \"cannot parse colorspace lookup table\");\n\t\t}\n\n\t\tcs = fz_new_indexed_colorspace(ctx, base, high, lookup);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_drop_colorspace(ctx, base);\n\t\tfz_free(ctx, lookup);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn cs;\n}\n\n/* Parse and create colorspace from PDF object */\n\nstatic fz_colorspace *\npdf_load_colorspace_imp(pdf_document *doc, pdf_obj *obj)\n{\n\tfz_context *ctx = doc->ctx;\n\n\tif (pdf_obj_marked(obj))\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Recursion in colorspace definition\");\n\n\tif (pdf_is_name(obj))\n\t{\n\t\tconst char *str = pdf_to_name(obj);\n\t\tif (!strcmp(str, \"Pattern\"))\n\t\t\treturn fz_device_gray(ctx);\n\t\telse if (!strcmp(str, \"G\"))\n\t\t\treturn fz_device_gray(ctx);\n\t\telse if (!strcmp(str, \"RGB\"))\n\t\t\treturn fz_device_rgb(ctx);\n\t\telse if (!strcmp(str, \"CMYK\"))\n\t\t\treturn fz_device_cmyk(ctx);\n\t\telse if (!strcmp(str, \"DeviceGray\"))\n\t\t\treturn fz_device_gray(ctx);\n\t\telse if (!strcmp(str, \"DeviceRGB\"))\n\t\t\treturn fz_device_rgb(ctx);\n\t\telse if (!strcmp(str, \"DeviceCMYK\"))\n\t\t\treturn fz_device_cmyk(ctx);\n\t\telse\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"unknown colorspace: %s\", pdf_to_name(obj));\n\t}\n\n\telse if (pdf_is_array(obj))\n\t{\n\t\tpdf_obj *name = pdf_array_get(obj, 0);\n\t\tconst char *str = pdf_to_name(name);\n\n\t\tif (pdf_is_name(name))\n\t\t{\n\t\t\t/* load base colorspace instead */\n\t\t\tif (!strcmp(str, \"G\"))\n\t\t\t\treturn fz_device_gray(ctx);\n\t\t\telse if (!strcmp(str, \"RGB\"))\n\t\t\t\treturn fz_device_rgb(ctx);\n\t\t\telse if (!strcmp(str, \"CMYK\"))\n\t\t\t\treturn fz_device_cmyk(ctx);\n\t\t\telse if (!strcmp(str, \"DeviceGray\"))\n\t\t\t\treturn fz_device_gray(ctx);\n\t\t\telse if (!strcmp(str, \"DeviceRGB\"))\n\t\t\t\treturn fz_device_rgb(ctx);\n\t\t\telse if (!strcmp(str, \"DeviceCMYK\"))\n\t\t\t\treturn fz_device_cmyk(ctx);\n\t\t\telse if (!strcmp(str, \"CalGray\"))\n\t\t\t\treturn fz_device_gray(ctx);\n\t\t\telse if (!strcmp(str, \"CalRGB\"))\n\t\t\t\treturn fz_device_rgb(ctx);\n\t\t\telse if (!strcmp(str, \"CalCMYK\"))\n\t\t\t\treturn fz_device_cmyk(ctx);\n\t\t\telse if (!strcmp(str, \"Lab\"))\n\t\t\t\treturn fz_device_lab;\n\t\t\telse\n\t\t\t{\n\t\t\t\tfz_colorspace *cs;\n\t\t\t\tfz_try(ctx)\n\t\t\t\t{\n\t\t\t\t\tpdf_mark_obj(obj);\n\t\t\t\t\tif (!strcmp(str, \"ICCBased\"))\n\t\t\t\t\t\tcs = load_icc_based(doc, pdf_array_get(obj, 1));\n\n\t\t\t\t\telse if (!strcmp(str, \"Indexed\"))\n\t\t\t\t\t\tcs = load_indexed(doc, obj);\n\t\t\t\t\telse if (!strcmp(str, \"I\"))\n\t\t\t\t\t\tcs = load_indexed(doc, obj);\n\n\t\t\t\t\telse if (!strcmp(str, \"Separation\"))\n\t\t\t\t\t\tcs = load_separation(doc, obj);\n\n\t\t\t\t\telse if (!strcmp(str, \"DeviceN\"))\n\t\t\t\t\t\tcs = load_separation(doc, obj);\n\t\t\t\t\telse if (!strcmp(str, \"Pattern\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tpdf_obj *pobj;\n\n\t\t\t\t\t\tpobj = pdf_array_get(obj, 1);\n\t\t\t\t\t\tif (!pobj)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcs = fz_device_gray(ctx);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcs = pdf_load_colorspace(doc, pobj);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"syntaxerror: unknown colorspace %s\", str);\n\t\t\t\t}\n\t\t\t\tfz_always(ctx)\n\t\t\t\t{\n\t\t\t\t\tpdf_unmark_obj(obj);\n\t\t\t\t}\n\t\t\t\tfz_catch(ctx)\n\t\t\t\t{\n\t\t\t\t\tfz_rethrow(ctx);\n\t\t\t\t}\n\t\t\t\treturn cs;\n\t\t\t}\n\t\t}\n\t}\n\n\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"syntaxerror: could not parse color space (%d %d R)\", pdf_to_num(obj), pdf_to_gen(obj));\n}\n\nfz_colorspace *\npdf_load_colorspace(pdf_document *doc, pdf_obj *obj)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_colorspace *cs;\n\n\tif ((cs = pdf_find_item(ctx, fz_free_colorspace_imp, obj)) != NULL)\n\t{\n\t\treturn cs;\n\t}\n\n\tcs = pdf_load_colorspace_imp(doc, obj);\n\n\tpdf_store_item(ctx, obj, cs, cs->size);\n\n\treturn cs;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-crypt.c",
    "content": "#include \"mupdf/pdf.h\"\n\nenum\n{\n\tPDF_CRYPT_NONE,\n\tPDF_CRYPT_RC4,\n\tPDF_CRYPT_AESV2,\n\tPDF_CRYPT_AESV3,\n\tPDF_CRYPT_UNKNOWN,\n};\n\ntypedef struct pdf_crypt_filter_s pdf_crypt_filter;\n\nstruct pdf_crypt_filter_s\n{\n\tint method;\n\tint length;\n};\n\nstruct pdf_crypt_s\n{\n\tpdf_obj *id;\n\n\tint v;\n\tint length;\n\tpdf_obj *cf;\n\tpdf_crypt_filter stmf;\n\tpdf_crypt_filter strf;\n\n\tint r;\n\tunsigned char o[48];\n\tunsigned char u[48];\n\tunsigned char oe[32];\n\tunsigned char ue[32];\n\tint p;\n\tint encrypt_metadata;\n\n\tunsigned char key[32]; /* decryption key generated from password */\n};\n\nstatic void pdf_parse_crypt_filter(fz_context *ctx, pdf_crypt_filter *cf, pdf_crypt *crypt, char *name);\n\n/*\n * Create crypt object for decrypting strings and streams\n * given the Encryption and ID objects.\n */\n\npdf_crypt *\npdf_new_crypt(fz_context *ctx, pdf_obj *dict, pdf_obj *id)\n{\n\tpdf_crypt *crypt;\n\tpdf_obj *obj;\n\n\tcrypt = fz_malloc_struct(ctx, pdf_crypt);\n\n\t/* Common to all security handlers (PDF 1.7 table 3.18) */\n\n\tobj = pdf_dict_gets(dict, \"Filter\");\n\tif (!pdf_is_name(obj))\n\t{\n\t\tpdf_free_crypt(ctx, crypt);\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"unspecified encryption handler\");\n\t}\n\tif (strcmp(pdf_to_name(obj), \"Standard\") != 0)\n\t{\n\t\tpdf_free_crypt(ctx, crypt);\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"unknown encryption handler: '%s'\", pdf_to_name(obj));\n\t}\n\n\tcrypt->v = 0;\n\tobj = pdf_dict_gets(dict, \"V\");\n\tif (pdf_is_int(obj))\n\t\tcrypt->v = pdf_to_int(obj);\n\tif (crypt->v != 1 && crypt->v != 2 && crypt->v != 4 && crypt->v != 5)\n\t{\n\t\tpdf_free_crypt(ctx, crypt);\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"unknown encryption version\");\n\t}\n\n\t/* Standard security handler (PDF 1.7 table 3.19) */\n\n\tobj = pdf_dict_gets(dict, \"R\");\n\tif (pdf_is_int(obj))\n\t\tcrypt->r = pdf_to_int(obj);\n\telse if (crypt->v <= 4)\n\t{\n\t\tfz_warn(ctx, \"encryption dictionary missing revision value, guessing...\");\n\t\tif (crypt->v < 2)\n\t\t\tcrypt->r = 2;\n\t\telse if (crypt->v == 2)\n\t\t\tcrypt->r = 3;\n\t\telse if (crypt->v == 4)\n\t\t\tcrypt->r = 4;\n\t}\n\telse\n\t{\n\t\tpdf_free_crypt(ctx, crypt);\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"encryption dictionary missing version and revision value\");\n\t}\n\tif (crypt->r < 1 || crypt->r > 6)\n\t{\n\t\tint r = crypt->r;\n\t\tpdf_free_crypt(ctx, crypt);\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"unknown crypt revision %d\", r);\n\t}\n\n\tobj = pdf_dict_gets(dict, \"O\");\n\tif (pdf_is_string(obj) && pdf_to_str_len(obj) == 32)\n\t\tmemcpy(crypt->o, pdf_to_str_buf(obj), 32);\n\t/* /O and /U are supposed to be 48 bytes long for revision 5 and 6, they're often longer, though */\n\telse if (crypt->r >= 5 && pdf_is_string(obj) && pdf_to_str_len(obj) >= 48)\n\t\tmemcpy(crypt->o, pdf_to_str_buf(obj), 48);\n\telse\n\t{\n\t\tpdf_free_crypt(ctx, crypt);\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"encryption dictionary missing owner password\");\n\t}\n\n\tobj = pdf_dict_gets(dict, \"U\");\n\tif (pdf_is_string(obj) && pdf_to_str_len(obj) == 32)\n\t\tmemcpy(crypt->u, pdf_to_str_buf(obj), 32);\n\t/* /O and /U are supposed to be 48 bytes long for revision 5 and 6, they're often longer, though */\n\telse if (crypt->r >= 5 && pdf_is_string(obj) && pdf_to_str_len(obj) >= 48)\n\t\tmemcpy(crypt->u, pdf_to_str_buf(obj), 48);\n\telse if (pdf_is_string(obj) && pdf_to_str_len(obj) < 32)\n\t{\n\t\tfz_warn(ctx, \"encryption password key too short (%d)\", pdf_to_str_len(obj));\n\t\tmemcpy(crypt->u, pdf_to_str_buf(obj), pdf_to_str_len(obj));\n\t}\n\telse\n\t{\n\t\tpdf_free_crypt(ctx, crypt);\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"encryption dictionary missing user password\");\n\t}\n\n\tobj = pdf_dict_gets(dict, \"P\");\n\tif (pdf_is_int(obj))\n\t\tcrypt->p = pdf_to_int(obj);\n\telse\n\t{\n\t\tfz_warn(ctx, \"encryption dictionary missing permissions\");\n\t\tcrypt->p = 0xfffffffc;\n\t}\n\n\tif (crypt->r == 5 || crypt->r == 6)\n\t{\n\t\tobj = pdf_dict_gets(dict, \"OE\");\n\t\tif (!pdf_is_string(obj) || pdf_to_str_len(obj) != 32)\n\t\t{\n\t\t\tpdf_free_crypt(ctx, crypt);\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"encryption dictionary missing owner encryption key\");\n\t\t}\n\t\tmemcpy(crypt->oe, pdf_to_str_buf(obj), 32);\n\n\t\tobj = pdf_dict_gets(dict, \"UE\");\n\t\tif (!pdf_is_string(obj) || pdf_to_str_len(obj) != 32)\n\t\t{\n\t\t\tpdf_free_crypt(ctx, crypt);\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"encryption dictionary missing user encryption key\");\n\t\t}\n\t\tmemcpy(crypt->ue, pdf_to_str_buf(obj), 32);\n\t}\n\n\tcrypt->encrypt_metadata = 1;\n\tobj = pdf_dict_gets(dict, \"EncryptMetadata\");\n\tif (pdf_is_bool(obj))\n\t\tcrypt->encrypt_metadata = pdf_to_bool(obj);\n\n\t/* Extract file identifier string */\n\n\tif (pdf_is_array(id) && pdf_array_len(id) == 2)\n\t{\n\t\tobj = pdf_array_get(id, 0);\n\t\tif (pdf_is_string(obj))\n\t\t\tcrypt->id = pdf_keep_obj(obj);\n\t}\n\telse\n\t\tfz_warn(ctx, \"missing file identifier, may not be able to do decryption\");\n\n\t/* Determine encryption key length */\n\n\tcrypt->length = 40;\n\tif (crypt->v == 2 || crypt->v == 4)\n\t{\n\t\tobj = pdf_dict_gets(dict, \"Length\");\n\t\tif (pdf_is_int(obj))\n\t\t\tcrypt->length = pdf_to_int(obj);\n\n\t\t/* work-around for pdf generators that assume length is in bytes */\n\t\tif (crypt->length < 40)\n\t\t\tcrypt->length = crypt->length * 8;\n\n\t\tif (crypt->length % 8 != 0)\n\t\t{\n\t\t\tpdf_free_crypt(ctx, crypt);\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"invalid encryption key length\");\n\t\t}\n\t\tif (crypt->length < 40 || crypt->length > 128)\n\t\t{\n\t\t\tpdf_free_crypt(ctx, crypt);\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"invalid encryption key length\");\n\t\t}\n\t}\n\n\tif (crypt->v == 5)\n\t\tcrypt->length = 256;\n\n\tif (crypt->v == 1 || crypt->v == 2)\n\t{\n\t\tcrypt->stmf.method = PDF_CRYPT_RC4;\n\t\tcrypt->stmf.length = crypt->length;\n\n\t\tcrypt->strf.method = PDF_CRYPT_RC4;\n\t\tcrypt->strf.length = crypt->length;\n\t}\n\n\tif (crypt->v == 4 || crypt->v == 5)\n\t{\n\t\tcrypt->stmf.method = PDF_CRYPT_NONE;\n\t\tcrypt->stmf.length = crypt->length;\n\n\t\tcrypt->strf.method = PDF_CRYPT_NONE;\n\t\tcrypt->strf.length = crypt->length;\n\n\t\tobj = pdf_dict_gets(dict, \"CF\");\n\t\tif (pdf_is_dict(obj))\n\t\t{\n\t\t\tcrypt->cf = pdf_keep_obj(obj);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcrypt->cf = NULL;\n\t\t}\n\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tobj = pdf_dict_gets(dict, \"StmF\");\n\t\t\tif (pdf_is_name(obj))\n\t\t\t\tpdf_parse_crypt_filter(ctx, &crypt->stmf, crypt, pdf_to_name(obj));\n\n\t\t\tobj = pdf_dict_gets(dict, \"StrF\");\n\t\t\tif (pdf_is_name(obj))\n\t\t\t\tpdf_parse_crypt_filter(ctx, &crypt->strf, crypt, pdf_to_name(obj));\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tpdf_free_crypt(ctx, crypt);\n\t\t\tfz_rethrow_message(ctx, \"cannot parse string crypt filter (%d %d R)\", pdf_to_num(obj), pdf_to_gen(obj));\n\t\t}\n\n\t\t/* in crypt revision 4, the crypt filter determines the key length */\n\t\tif (crypt->strf.method != PDF_CRYPT_NONE)\n\t\t\tcrypt->length = crypt->stmf.length;\n\t}\n\n\treturn crypt;\n}\n\nvoid\npdf_free_crypt(fz_context *ctx, pdf_crypt *crypt)\n{\n\tpdf_drop_obj(crypt->id);\n\tpdf_drop_obj(crypt->cf);\n\tfz_free(ctx, crypt);\n}\n\n/*\n * Parse a CF dictionary entry (PDF 1.7 table 3.22)\n */\n\nstatic void\npdf_parse_crypt_filter(fz_context *ctx, pdf_crypt_filter *cf, pdf_crypt *crypt, char *name)\n{\n\tpdf_obj *obj;\n\tpdf_obj *dict;\n\tint is_identity = (strcmp(name, \"Identity\") == 0);\n\tint is_stdcf = (!is_identity && (strcmp(name, \"StdCF\") == 0));\n\n\tif (!is_identity && !is_stdcf)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Crypt Filter not Identity or StdCF (%d %d R)\", pdf_to_num(crypt->cf), pdf_to_gen(crypt->cf));\n\n\tcf->method = PDF_CRYPT_NONE;\n\tcf->length = crypt->length;\n\n\tif (!crypt->cf)\n\t{\n\t\tcf->method = (is_identity ? PDF_CRYPT_NONE : PDF_CRYPT_RC4);\n\t\treturn;\n\t}\n\n\tdict = pdf_dict_gets(crypt->cf, name);\n\tif (!pdf_is_dict(dict))\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot parse crypt filter (%d %d R)\", pdf_to_num(crypt->cf), pdf_to_gen(crypt->cf));\n\n\tobj = pdf_dict_gets(dict, \"CFM\");\n\tif (pdf_is_name(obj))\n\t{\n\t\tif (!strcmp(pdf_to_name(obj), \"None\"))\n\t\t\tcf->method = PDF_CRYPT_NONE;\n\t\telse if (!strcmp(pdf_to_name(obj), \"V2\"))\n\t\t\tcf->method = PDF_CRYPT_RC4;\n\t\telse if (!strcmp(pdf_to_name(obj), \"AESV2\"))\n\t\t\tcf->method = PDF_CRYPT_AESV2;\n\t\telse if (!strcmp(pdf_to_name(obj), \"AESV3\"))\n\t\t\tcf->method = PDF_CRYPT_AESV3;\n\t\telse\n\t\t\tfz_warn(ctx, \"unknown encryption method: %s\", pdf_to_name(obj));\n\t}\n\n\tobj = pdf_dict_gets(dict, \"Length\");\n\tif (pdf_is_int(obj))\n\t\tcf->length = pdf_to_int(obj);\n\n\t/* the length for crypt filters is supposed to be in bytes not bits */\n\tif (cf->length < 40)\n\t\tcf->length = cf->length * 8;\n\n\tif ((cf->length % 8) != 0)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"invalid key length: %d\", cf->length);\n\n\tif ((crypt->r == 1 || crypt->r == 2 || crypt->r == 3 || crypt->r == 4) &&\n\t\t(cf->length < 0 || cf->length > 128))\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"invalid key length: %d\", cf->length);\n\tif ((crypt->r == 5 || crypt->r == 6) && cf->length != 256)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"invalid key length: %d\", cf->length);\n}\n\n/*\n * Compute an encryption key (PDF 1.7 algorithm 3.2)\n */\n\nstatic const unsigned char padding[32] =\n{\n\t0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41,\n\t0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08,\n\t0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, 0x3e, 0x80,\n\t0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a\n};\n\nstatic void\npdf_compute_encryption_key(pdf_crypt *crypt, unsigned char *password, int pwlen, unsigned char *key)\n{\n\tunsigned char buf[32];\n\tunsigned int p;\n\tint i, n;\n\tfz_md5 md5;\n\n\tn = crypt->length / 8;\n\n\t/* Step 1 - copy and pad password string */\n\tif (pwlen > 32)\n\t\tpwlen = 32;\n\tmemcpy(buf, password, pwlen);\n\tmemcpy(buf + pwlen, padding, 32 - pwlen);\n\n\t/* Step 2 - init md5 and pass value of step 1 */\n\tfz_md5_init(&md5);\n\tfz_md5_update(&md5, buf, 32);\n\n\t/* Step 3 - pass O value */\n\tfz_md5_update(&md5, crypt->o, 32);\n\n\t/* Step 4 - pass P value as unsigned int, low-order byte first */\n\tp = (unsigned int) crypt->p;\n\tbuf[0] = (p) & 0xFF;\n\tbuf[1] = (p >> 8) & 0xFF;\n\tbuf[2] = (p >> 16) & 0xFF;\n\tbuf[3] = (p >> 24) & 0xFF;\n\tfz_md5_update(&md5, buf, 4);\n\n\t/* Step 5 - pass first element of ID array */\n\tfz_md5_update(&md5, (unsigned char *)pdf_to_str_buf(crypt->id), pdf_to_str_len(crypt->id));\n\n\t/* Step 6 (revision 4 or greater) - if metadata is not encrypted pass 0xFFFFFFFF */\n\tif (crypt->r >= 4)\n\t{\n\t\tif (!crypt->encrypt_metadata)\n\t\t{\n\t\t\tbuf[0] = 0xFF;\n\t\t\tbuf[1] = 0xFF;\n\t\t\tbuf[2] = 0xFF;\n\t\t\tbuf[3] = 0xFF;\n\t\t\tfz_md5_update(&md5, buf, 4);\n\t\t}\n\t}\n\n\t/* Step 7 - finish the hash */\n\tfz_md5_final(&md5, buf);\n\n\t/* Step 8 (revision 3 or greater) - do some voodoo 50 times */\n\tif (crypt->r >= 3)\n\t{\n\t\tfor (i = 0; i < 50; i++)\n\t\t{\n\t\t\tfz_md5_init(&md5);\n\t\t\tfz_md5_update(&md5, buf, n);\n\t\t\tfz_md5_final(&md5, buf);\n\t\t}\n\t}\n\n\t/* Step 9 - the key is the first 'n' bytes of the result */\n\tmemcpy(key, buf, n);\n}\n\n/*\n * Compute an encryption key (PDF 1.7 ExtensionLevel 3 algorithm 3.2a)\n */\n\nstatic void\npdf_compute_encryption_key_r5(fz_context *ctx, pdf_crypt *crypt, unsigned char *password, int pwlen, int ownerkey, unsigned char *validationkey)\n{\n\tunsigned char buffer[128 + 8 + 48];\n\tfz_sha256 sha256;\n\tfz_aes aes;\n\n\t/* Step 2 - truncate UTF-8 password to 127 characters */\n\n\tif (pwlen > 127)\n\t\tpwlen = 127;\n\n\t/* Step 3/4 - test password against owner/user key and compute encryption key */\n\n\tmemcpy(buffer, password, pwlen);\n\tif (ownerkey)\n\t{\n\t\tmemcpy(buffer + pwlen, crypt->o + 32, 8);\n\t\tmemcpy(buffer + pwlen + 8, crypt->u, 48);\n\t}\n\telse\n\t\tmemcpy(buffer + pwlen, crypt->u + 32, 8);\n\n\tfz_sha256_init(&sha256);\n\tfz_sha256_update(&sha256, buffer, pwlen + 8 + (ownerkey ? 48 : 0));\n\tfz_sha256_final(&sha256, validationkey);\n\n\t/* Step 3.5/4.5 - compute file encryption key from OE/UE */\n\n\t/* cf. https://github.com/sumatrapdfreader/sumatrapdf/issues/294 */\n\tif (ownerkey)\n\t{\n\t\tmemcpy(buffer + pwlen, crypt->o + 40, 8);\n\t\tmemcpy(buffer + pwlen + 8, crypt->u, 48);\n\t}\n\telse\n\tmemcpy(buffer + pwlen, crypt->u + 40, 8);\n\n\tfz_sha256_init(&sha256);\n\tfz_sha256_update(&sha256, buffer, pwlen + 8 + (ownerkey ? 48 : 0));\n\tfz_sha256_final(&sha256, buffer);\n\n\t/* clear password buffer and use it as iv */\n\tmemset(buffer + 32, 0, sizeof(buffer) - 32);\n\tif (aes_setkey_dec(&aes, buffer, crypt->length))\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"AES key init failed (keylen=%d)\", crypt->length);\n\taes_crypt_cbc(&aes, AES_DECRYPT, 32, buffer + 32, ownerkey ? crypt->oe : crypt->ue, crypt->key);\n}\n\n/*\n * Compute an encryption key (PDF 1.7 ExtensionLevel 8 algorithm)\n *\n * Adobe has not yet released the details, so the algorithm reference is:\n * http://esec-lab.sogeti.com/post/The-undocumented-password-validation-algorithm-of-Adobe-Reader-X\n */\n\nstatic void\npdf_compute_hardened_hash_r6(fz_context *ctx, unsigned char *password, int pwlen, unsigned char salt[16], unsigned char *ownerkey, unsigned char hash[32])\n{\n\tunsigned char data[(128 + 64 + 48) * 64];\n\tunsigned char block[64];\n\tint block_size = 32;\n\tint data_len = 0;\n\tint i, j, sum;\n\n\tfz_sha256 sha256;\n\tfz_sha384 sha384;\n\tfz_sha512 sha512;\n\tfz_aes aes;\n\n\t/* Step 1: calculate initial data block */\n\tfz_sha256_init(&sha256);\n\tfz_sha256_update(&sha256, password, pwlen);\n\tfz_sha256_update(&sha256, salt, 8);\n\tif (ownerkey)\n\t\tfz_sha256_update(&sha256, ownerkey, 48);\n\tfz_sha256_final(&sha256, block);\n\n\tfor (i = 0; i < 64 || i < data[data_len * 64 - 1] + 32; i++)\n\t{\n\t\t/* Step 2: repeat password and data block 64 times */\n\t\tmemcpy(data, password, pwlen);\n\t\tmemcpy(data + pwlen, block, block_size);\n\t\tif (ownerkey)\n\t\t\tmemcpy(data + pwlen + block_size, ownerkey, 48);\n\t\tdata_len = pwlen + block_size + (ownerkey ? 48 : 0);\n\t\tfor (j = 1; j < 64; j++)\n\t\t\tmemcpy(data + j * data_len, data, data_len);\n\n\t\t/* Step 3: encrypt data using data block as key and iv */\n\t\tif (aes_setkey_enc(&aes, block, 128))\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"AES key init failed (keylen=%d)\", 128);\n\t\taes_crypt_cbc(&aes, AES_ENCRYPT, data_len * 64, block + 16, data, data);\n\n\t\t/* Step 4: determine SHA-2 hash size for this round */\n\t\tfor (j = 0, sum = 0; j < 16; j++)\n\t\t\tsum += data[j];\n\n\t\t/* Step 5: calculate data block for next round */\n\t\tblock_size = 32 + (sum % 3) * 16;\n\t\tswitch (block_size)\n\t\t{\n\t\tcase 32:\n\t\t\tfz_sha256_init(&sha256);\n\t\t\tfz_sha256_update(&sha256, data, data_len * 64);\n\t\t\tfz_sha256_final(&sha256, block);\n\t\t\tbreak;\n\t\tcase 48:\n\t\t\tfz_sha384_init(&sha384);\n\t\t\tfz_sha384_update(&sha384, data, data_len * 64);\n\t\t\tfz_sha384_final(&sha384, block);\n\t\t\tbreak;\n\t\tcase 64:\n\t\t\tfz_sha512_init(&sha512);\n\t\t\tfz_sha512_update(&sha512, data, data_len * 64);\n\t\t\tfz_sha512_final(&sha512, block);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tmemset(data, 0, sizeof(data));\n\tmemcpy(hash, block, 32);\n}\n\nstatic void\npdf_compute_encryption_key_r6(fz_context *ctx, pdf_crypt *crypt, unsigned char *password, int pwlen, int ownerkey, unsigned char *validationkey)\n{\n\tunsigned char hash[32];\n\tunsigned char iv[16];\n\tfz_aes aes;\n\n\tif (pwlen > 127)\n\t\tpwlen = 127;\n\n\tpdf_compute_hardened_hash_r6(ctx, password, pwlen,\n\t\t(ownerkey ? crypt->o : crypt->u) + 32,\n\t\townerkey ? crypt->u : NULL, validationkey);\n\t/* cf. http://bugs.ghostscript.com/show_bug.cgi?id=696182 */\n\tpdf_compute_hardened_hash_r6(ctx, password, pwlen,\n\t\t(ownerkey ? crypt->o : crypt->u) + 40,\n\t\townerkey ? crypt->u : NULL, hash);\n\n\tmemset(iv, 0, sizeof(iv));\n\tif (aes_setkey_dec(&aes, hash, 256))\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"AES key init failed (keylen=256)\");\n\taes_crypt_cbc(&aes, AES_DECRYPT, 32, iv,\n\t\townerkey ? crypt->oe : crypt->ue, crypt->key);\n}\n\n/*\n * Computing the user password (PDF 1.7 algorithm 3.4 and 3.5)\n * Also save the generated key for decrypting objects and streams in crypt->key.\n */\n\nstatic void\npdf_compute_user_password(fz_context *ctx, pdf_crypt *crypt, unsigned char *password, int pwlen, unsigned char *output)\n{\n\tif (crypt->r == 2)\n\t{\n\t\tfz_arc4 arc4;\n\n\t\tpdf_compute_encryption_key(crypt, password, pwlen, crypt->key);\n\t\tfz_arc4_init(&arc4, crypt->key, crypt->length / 8);\n\t\tfz_arc4_encrypt(&arc4, output, padding, 32);\n\t}\n\n\tif (crypt->r == 3 || crypt->r == 4)\n\t{\n\t\tunsigned char xor[32];\n\t\tunsigned char digest[16];\n\t\tfz_md5 md5;\n\t\tfz_arc4 arc4;\n\t\tint i, x, n;\n\n\t\tn = crypt->length / 8;\n\n\t\tpdf_compute_encryption_key(crypt, password, pwlen, crypt->key);\n\n\t\tfz_md5_init(&md5);\n\t\tfz_md5_update(&md5, padding, 32);\n\t\tfz_md5_update(&md5, (unsigned char*)pdf_to_str_buf(crypt->id), pdf_to_str_len(crypt->id));\n\t\tfz_md5_final(&md5, digest);\n\n\t\tfz_arc4_init(&arc4, crypt->key, n);\n\t\tfz_arc4_encrypt(&arc4, output, digest, 16);\n\n\t\tfor (x = 1; x <= 19; x++)\n\t\t{\n\t\t\tfor (i = 0; i < n; i++)\n\t\t\t\txor[i] = crypt->key[i] ^ x;\n\t\t\tfz_arc4_init(&arc4, xor, n);\n\t\t\tfz_arc4_encrypt(&arc4, output, output, 16);\n\t\t}\n\n\t\tmemcpy(output + 16, padding, 16);\n\t}\n\n\tif (crypt->r == 5)\n\t{\n\t\tpdf_compute_encryption_key_r5(ctx, crypt, password, pwlen, 0, output);\n\t}\n\n\tif (crypt->r == 6)\n\t{\n\t\tpdf_compute_encryption_key_r6(ctx, crypt, password, pwlen, 0, output);\n\t}\n}\n\n/*\n * Authenticating the user password (PDF 1.7 algorithm 3.6\n * and ExtensionLevel 3 algorithm 3.11)\n * This also has the side effect of saving a key generated\n * from the password for decrypting objects and streams.\n */\n\nstatic int\npdf_authenticate_user_password(fz_context *ctx, pdf_crypt *crypt, unsigned char *password, int pwlen)\n{\n\tunsigned char output[32];\n\tpdf_compute_user_password(ctx, crypt, password, pwlen, output);\n\tif (crypt->r == 2 || crypt->r == 5 || crypt->r == 6)\n\t\treturn memcmp(output, crypt->u, 32) == 0;\n\tif (crypt->r == 3 || crypt->r == 4)\n\t\treturn memcmp(output, crypt->u, 16) == 0;\n\treturn 0;\n}\n\n/*\n * Authenticating the owner password (PDF 1.7 algorithm 3.7\n * and ExtensionLevel 3 algorithm 3.12)\n * Generates the user password from the owner password\n * and calls pdf_authenticate_user_password.\n */\n\nstatic int\npdf_authenticate_owner_password(fz_context *ctx, pdf_crypt *crypt, unsigned char *ownerpass, int pwlen)\n{\n\tunsigned char pwbuf[32];\n\tunsigned char key[32];\n\tunsigned char xor[32];\n\tunsigned char userpass[32];\n\tint i, n, x;\n\tfz_md5 md5;\n\tfz_arc4 arc4;\n\n\tif (crypt->r == 5)\n\t{\n\t\t/* PDF 1.7 ExtensionLevel 3 algorithm 3.12 */\n\t\tpdf_compute_encryption_key_r5(ctx, crypt, ownerpass, pwlen, 1, key);\n\t\treturn !memcmp(key, crypt->o, 32);\n\t}\n\telse if (crypt->r == 6)\n\t{\n\t\t/* PDF 1.7 ExtensionLevel 8 algorithm */\n\t\tpdf_compute_encryption_key_r6(ctx, crypt, ownerpass, pwlen, 1, key);\n\t\treturn !memcmp(key, crypt->o, 32);\n\t}\n\n\tn = crypt->length / 8;\n\n\t/* Step 1 -- steps 1 to 4 of PDF 1.7 algorithm 3.3 */\n\n\t/* copy and pad password string */\n\tif (pwlen > 32)\n\t\tpwlen = 32;\n\tmemcpy(pwbuf, ownerpass, pwlen);\n\tmemcpy(pwbuf + pwlen, padding, 32 - pwlen);\n\n\t/* take md5 hash of padded password */\n\tfz_md5_init(&md5);\n\tfz_md5_update(&md5, pwbuf, 32);\n\tfz_md5_final(&md5, key);\n\n\t/* do some voodoo 50 times (Revision 3 or greater) */\n\tif (crypt->r >= 3)\n\t{\n\t\tfor (i = 0; i < 50; i++)\n\t\t{\n\t\t\tfz_md5_init(&md5);\n\t\t\tfz_md5_update(&md5, key, 16);\n\t\t\tfz_md5_final(&md5, key);\n\t\t}\n\t}\n\n\t/* Step 2 (Revision 2) */\n\tif (crypt->r == 2)\n\t{\n\t\tfz_arc4_init(&arc4, key, n);\n\t\tfz_arc4_encrypt(&arc4, userpass, crypt->o, 32);\n\t}\n\n\t/* Step 2 (Revision 3 or greater) */\n\tif (crypt->r >= 3)\n\t{\n\t\tmemcpy(userpass, crypt->o, 32);\n\t\tfor (x = 0; x < 20; x++)\n\t\t{\n\t\t\tfor (i = 0; i < n; i++)\n\t\t\t\txor[i] = key[i] ^ (19 - x);\n\t\t\tfz_arc4_init(&arc4, xor, n);\n\t\t\tfz_arc4_encrypt(&arc4, userpass, userpass, 32);\n\t\t}\n\t}\n\n\treturn pdf_authenticate_user_password(ctx, crypt, userpass, 32);\n}\n\nstatic void pdf_docenc_from_utf8(char *password, const char *utf8, int n)\n{\n\tint i = 0, k, c;\n\twhile (*utf8 && i + 1 < n)\n\t{\n\t\tutf8 += fz_chartorune(&c, utf8);\n\t\tfor (k = 0; k < 256; k++)\n\t\t{\n\t\t\tif (c == pdf_doc_encoding[k])\n\t\t\t{\n\t\t\t\tpassword[i++] = k;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* FIXME: drop characters that can't be encoded or return an error? */\n\t}\n\tpassword[i] = 0;\n}\n\nstatic void pdf_saslprep_from_utf8(char *password, const char *utf8, int n)\n{\n\t/* TODO: stringprep with SALSprep profile */\n\tfz_strlcpy(password, utf8, n);\n}\n\nint\npdf_authenticate_password(pdf_document *doc, const char *pwd_utf8)\n{\n\tchar password[2048];\n\n\tif (doc->crypt)\n\t{\n\t\tpassword[0] = 0;\n\t\tif (pwd_utf8)\n\t\t{\n\t\t\tif (doc->crypt->r <= 4)\n\t\t\t\tpdf_docenc_from_utf8(password, pwd_utf8, sizeof password);\n\t\t\telse\n\t\t\t\tpdf_saslprep_from_utf8(password, pwd_utf8, sizeof password);\n\t\t}\n\n\t\tif (pdf_authenticate_user_password(doc->ctx, doc->crypt, (unsigned char *)password, strlen(password)))\n\t\t\treturn 1;\n\t\tif (pdf_authenticate_owner_password(doc->ctx, doc->crypt, (unsigned char *)password, strlen(password)))\n\t\t\treturn 1;\n\t\treturn 0;\n\t}\n\treturn 1;\n}\n\nint\npdf_needs_password(pdf_document *doc)\n{\n\tif (!doc->crypt)\n\t\treturn 0;\n\tif (pdf_authenticate_password(doc, \"\"))\n\t\treturn 0;\n\treturn 1;\n}\n\nint\npdf_has_permission(pdf_document *doc, int p)\n{\n\tif (!doc->crypt)\n\t\treturn 1;\n\treturn doc->crypt->p & p;\n}\n\nunsigned char *\npdf_crypt_key(pdf_document *doc)\n{\n\tif (doc->crypt)\n\t\treturn doc->crypt->key;\n\treturn NULL;\n}\n\nint\npdf_crypt_version(pdf_document *doc)\n{\n\tif (doc->crypt)\n\t\treturn doc->crypt->v;\n\treturn 0;\n}\n\nint pdf_crypt_revision(pdf_document *doc)\n{\n\tif (doc->crypt)\n\t\treturn doc->crypt->r;\n\treturn 0;\n}\n\nchar *\npdf_crypt_method(pdf_document *doc)\n{\n\tif (doc->crypt)\n\t{\n\t\tswitch (doc->crypt->strf.method)\n\t\t{\n\t\tcase PDF_CRYPT_NONE: return \"None\";\n\t\tcase PDF_CRYPT_RC4: return \"RC4\";\n\t\tcase PDF_CRYPT_AESV2: return \"AES\";\n\t\tcase PDF_CRYPT_AESV3: return \"AES\";\n\t\tcase PDF_CRYPT_UNKNOWN: return \"Unknown\";\n\t\t}\n\t}\n\treturn \"None\";\n}\n\nint\npdf_crypt_length(pdf_document *doc)\n{\n\tif (doc->crypt)\n\t\treturn doc->crypt->length;\n\treturn 0;\n}\n\n/*\n * PDF 1.7 algorithm 3.1 and ExtensionLevel 3 algorithm 3.1a\n *\n * Using the global encryption key that was generated from the\n * password, create a new key that is used to decrypt individual\n * objects and streams. This key is based on the object and\n * generation numbers.\n */\n\nstatic int\npdf_compute_object_key(pdf_crypt *crypt, pdf_crypt_filter *cf, int num, int gen, unsigned char *key, int max_len)\n{\n\tfz_md5 md5;\n\tunsigned char message[5];\n\tint key_len = crypt->length / 8;\n\n\tif (key_len > max_len)\n\t\tkey_len = max_len;\n\n\tif (cf->method == PDF_CRYPT_AESV3)\n\t{\n\t\tmemcpy(key, crypt->key, key_len);\n\t\treturn key_len;\n\t}\n\n\tfz_md5_init(&md5);\n\tfz_md5_update(&md5, crypt->key, key_len);\n\tmessage[0] = (num) & 0xFF;\n\tmessage[1] = (num >> 8) & 0xFF;\n\tmessage[2] = (num >> 16) & 0xFF;\n\tmessage[3] = (gen) & 0xFF;\n\tmessage[4] = (gen >> 8) & 0xFF;\n\tfz_md5_update(&md5, message, 5);\n\n\tif (cf->method == PDF_CRYPT_AESV2)\n\t\tfz_md5_update(&md5, (unsigned char *)\"sAlT\", 4);\n\n\tfz_md5_final(&md5, key);\n\n\tif (key_len + 5 > 16)\n\t\treturn 16;\n\treturn key_len + 5;\n}\n\n/*\n * PDF 1.7 algorithm 3.1 and ExtensionLevel 3 algorithm 3.1a\n *\n * Decrypt all strings in obj modifying the data in-place.\n * Recurse through arrays and dictionaries, but do not follow\n * indirect references.\n */\n\nstatic void\npdf_crypt_obj_imp(fz_context *ctx, pdf_crypt *crypt, pdf_obj *obj, unsigned char *key, int keylen)\n{\n\tunsigned char *s;\n\tint i, n;\n\n\tif (pdf_is_indirect(obj))\n\t\treturn;\n\n\tif (pdf_is_string(obj))\n\t{\n\t\ts = (unsigned char *)pdf_to_str_buf(obj);\n\t\tn = pdf_to_str_len(obj);\n\n\t\tif (crypt->strf.method == PDF_CRYPT_RC4)\n\t\t{\n\t\t\tfz_arc4 arc4;\n\t\t\tfz_arc4_init(&arc4, key, keylen);\n\t\t\tfz_arc4_encrypt(&arc4, s, s, n);\n\t\t}\n\n\t\tif (crypt->strf.method == PDF_CRYPT_AESV2 || crypt->strf.method == PDF_CRYPT_AESV3)\n\t\t{\n\t\t\tif (n == 0)\n\t\t\t{\n\t\t\t\t/* Empty strings are permissible */\n\t\t\t}\n\t\t\telse if (n & 15 || n < 32)\n\t\t\t\tfz_warn(ctx, \"invalid string length for aes encryption\");\n\t\t\telse\n\t\t\t{\n\t\t\t\tunsigned char iv[16];\n\t\t\t\tfz_aes aes;\n\t\t\t\tmemcpy(iv, s, 16);\n\t\t\t\tif (aes_setkey_dec(&aes, key, keylen * 8))\n\t\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"AES key init failed (keylen=%d)\", keylen * 8);\n\t\t\t\taes_crypt_cbc(&aes, AES_DECRYPT, n - 16, iv, s + 16, s);\n\t\t\t\t/* delete space used for iv and padding bytes at end */\n\t\t\t\tif (s[n - 17] < 1 || s[n - 17] > 16)\n\t\t\t\t\tfz_warn(ctx, \"aes padding out of range\");\n\t\t\t\telse\n\t\t\t\t\tpdf_set_str_len(obj, n - 16 - s[n - 17]);\n\t\t\t}\n\t\t}\n\t}\n\n\telse if (pdf_is_array(obj))\n\t{\n\t\tn = pdf_array_len(obj);\n\t\tfor (i = 0; i < n; i++)\n\t\t{\n\t\t\tpdf_crypt_obj_imp(ctx, crypt, pdf_array_get(obj, i), key, keylen);\n\t\t}\n\t}\n\n\telse if (pdf_is_dict(obj))\n\t{\n\t\tn = pdf_dict_len(obj);\n\t\tfor (i = 0; i < n; i++)\n\t\t{\n\t\t\tpdf_crypt_obj_imp(ctx, crypt, pdf_dict_get_val(obj, i), key, keylen);\n\t\t}\n\t}\n}\n\nvoid\npdf_crypt_obj(fz_context *ctx, pdf_crypt *crypt, pdf_obj *obj, int num, int gen)\n{\n\tunsigned char key[32];\n\tint len;\n\n\tlen = pdf_compute_object_key(crypt, &crypt->strf, num, gen, key, 32);\n\n\tpdf_crypt_obj_imp(ctx, crypt, obj, key, len);\n}\n\n/*\n * PDF 1.7 algorithm 3.1 and ExtensionLevel 3 algorithm 3.1a\n *\n * Create filter suitable for de/encrypting a stream.\n */\nstatic fz_stream *\npdf_open_crypt_imp(fz_stream *chain, pdf_crypt *crypt, pdf_crypt_filter *stmf, int num, int gen)\n{\n\tunsigned char key[32];\n\tint len;\n\n\tlen = pdf_compute_object_key(crypt, stmf, num, gen, key, 32);\n\n\tif (stmf->method == PDF_CRYPT_RC4)\n\t\treturn fz_open_arc4(chain, key, len);\n\n\tif (stmf->method == PDF_CRYPT_AESV2 || stmf->method == PDF_CRYPT_AESV3)\n\t\treturn fz_open_aesd(chain, key, len);\n\n\treturn fz_open_copy(chain);\n}\n\nfz_stream *\npdf_open_crypt(fz_stream *chain, pdf_crypt *crypt, int num, int gen)\n{\n\treturn pdf_open_crypt_imp(chain, crypt, &crypt->stmf, num, gen);\n}\n\nfz_stream *\npdf_open_crypt_with_filter(fz_stream *chain, pdf_crypt *crypt, char *name, int num, int gen)\n{\n\tif (strcmp(name, \"Identity\"))\n\t{\n\t\tpdf_crypt_filter cf;\n\t\tpdf_parse_crypt_filter(chain->ctx, &cf, crypt, name);\n\t\treturn pdf_open_crypt_imp(chain, crypt, &cf, num, gen);\n\t}\n\treturn chain;\n}\n\n#ifndef NDEBUG\nvoid pdf_print_crypt(pdf_crypt *crypt)\n{\n\tint i;\n\n\tprintf(\"crypt {\\n\");\n\n\tprintf(\"\\tv=%d length=%d\\n\", crypt->v, crypt->length);\n\tprintf(\"\\tstmf method=%d length=%d\\n\", crypt->stmf.method, crypt->stmf.length);\n\tprintf(\"\\tstrf method=%d length=%d\\n\", crypt->strf.method, crypt->strf.length);\n\tprintf(\"\\tr=%d\\n\", crypt->r);\n\n\tprintf(\"\\to=<\");\n\tfor (i = 0; i < 32; i++)\n\t\tprintf(\"%02X\", crypt->o[i]);\n\tprintf(\">\\n\");\n\n\tprintf(\"\\tu=<\");\n\tfor (i = 0; i < 32; i++)\n\t\tprintf(\"%02X\", crypt->u[i]);\n\tprintf(\">\\n\");\n\n\tprintf(\"}\\n\");\n}\n#endif\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-device.c",
    "content": "#include \"mupdf/pdf.h\"\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_ADVANCES_H\n\n#define ALLOWED_TEXT_POS_ERROR (0.001f)\n\ntypedef struct pdf_device_s pdf_device;\n\ntypedef struct gstate_s gstate;\n\nstruct gstate_s\n{\n\t/* The first few entries aren't really graphics state things, but\n\t * they are recorded here as they are fundamentally intertwined with\n\t * the push/pulling of the gstates. */\n\tfz_buffer *buf;\n\tvoid (*on_pop)(pdf_device*,void *);\n\tvoid *on_pop_arg;\n\t/* The graphics state proper */\n\tfz_colorspace *colorspace[2];\n\tfloat color[2][4];\n\tfz_matrix ctm;\n\tfz_stroke_state *stroke_state;\n\tfloat alpha[2];\n\tint font;\n\tfloat font_size;\n\tfloat char_spacing;\n\tfloat word_spacing;\n\tfloat horizontal_scaling;\n\tfloat leading;\n\tint text_rendering_mode;\n\tfloat rise;\n\tint knockout;\n\tfz_matrix tm;\n};\n\ntypedef struct image_entry_s image_entry;\n\nstruct image_entry_s\n{\n\tchar digest[16];\n\tpdf_obj *ref;\n};\n\ntypedef struct alpha_entry_s alpha_entry;\n\nstruct alpha_entry_s\n{\n\tfloat alpha;\n\tint stroke;\n};\n\ntypedef struct font_entry_s font_entry;\n\nstruct font_entry_s\n{\n\tfz_font *font;\n};\n\ntypedef struct group_entry_s group_entry;\n\nstruct group_entry_s\n{\n\tint alpha;\n\tint isolated;\n\tint knockout;\n\tfz_colorspace *colorspace;\n\tpdf_obj *ref;\n};\n\nstruct pdf_device_s\n{\n\tfz_context *ctx;\n\tpdf_document *doc;\n\tpdf_obj *contents;\n\tpdf_obj *resources;\n\n\tint in_text;\n\n\tint num_forms;\n\tint num_smasks;\n\n\tint num_gstates;\n\tint max_gstates;\n\tgstate *gstates;\n\n\tint num_imgs;\n\tint max_imgs;\n\timage_entry *images;\n\n\tint num_alphas;\n\tint max_alphas;\n\talpha_entry *alphas;\n\n\tint num_fonts;\n\tint max_fonts;\n\tfont_entry *fonts;\n\n\tint num_groups;\n\tint max_groups;\n\tgroup_entry *groups;\n};\n\n#define CURRENT_GSTATE(pdev) (&(pdev)->gstates[(pdev)->num_gstates-1])\n\n/* Helper functions */\n\nstatic int\nsend_image(pdf_device *pdev, fz_image *image, int mask, int smask)\n{\n\tfz_context *ctx = pdev->ctx;\n\tfz_pixmap *pixmap = NULL;\n\tpdf_obj *imobj = NULL;\n\tpdf_obj *imref = NULL;\n\tfz_compressed_buffer *cbuffer = NULL;\n\tfz_compression_params *cp = NULL;\n\tfz_buffer *buffer = NULL;\n\tint i, num;\n\tfz_md5 state;\n\tunsigned char digest[16];\n\tfz_colorspace *colorspace = image->colorspace;\n\tpdf_document *doc = pdev->doc;\n\n\t/* If we can maintain compression, do so */\n\tcbuffer = image->buffer;\n\n\tfz_var(pixmap);\n\tfz_var(buffer);\n\tfz_var(imobj);\n\tfz_var(imref);\n\n\tfz_try(ctx)\n\t{\n\t\tif (cbuffer != NULL && cbuffer->params.type != FZ_IMAGE_PNG && cbuffer->params.type != FZ_IMAGE_TIFF)\n\t\t{\n\t\t\tbuffer = fz_keep_buffer(ctx, cbuffer->buffer);\n\t\t\tcp = &cbuffer->params;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tunsigned int size;\n\t\t\tint n;\n\t\t\t/* Currently, set to maintain resolution; should we consider\n\t\t\t * subsampling here according to desired output res? */\n\t\t\tpixmap = image->get_pixmap(ctx, image, image->w, image->h);\n\t\t\tcolorspace = pixmap->colorspace; /* May be different to image->colorspace! */\n\t\t\tn = (pixmap->n == 1 ? 1 : pixmap->n-1);\n\t\t\tsize = image->w * image->h * n;\n\t\t\tbuffer = fz_new_buffer(ctx, size);\n\t\t\tbuffer->len = size;\n\t\t\tif (pixmap->n == 1)\n\t\t\t{\n\t\t\t\tmemcpy(buffer->data, pixmap->samples, size);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/* Need to remove the alpha plane */\n\t\t\t\tunsigned char *d = buffer->data;\n\t\t\t\tunsigned char *s = pixmap->samples;\n\t\t\t\tint mod = n;\n\t\t\t\twhile (size--)\n\t\t\t\t{\n\t\t\t\t\t*d++ = *s++;\n\t\t\t\t\tmod--;\n\t\t\t\t\tif (mod == 0)\n\t\t\t\t\t\ts++, mod = n;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfz_md5_init(&state);\n\t\tfz_md5_update(&state, buffer->data, buffer->len);\n\t\tfz_md5_final(&state, digest);\n\t\tfor(i=0; i < pdev->num_imgs; i++)\n\t\t{\n\t\t\tif (!memcmp(&digest, pdev->images[i].digest, sizeof(digest)))\n\t\t\t{\n\t\t\t\tnum = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (i < pdev->num_imgs)\n\t\t\tbreak;\n\n\t\tif (pdev->num_imgs == pdev->max_imgs)\n\t\t{\n\t\t\tint newmax = pdev->max_imgs * 2;\n\t\t\tif (newmax == 0)\n\t\t\t\tnewmax = 4;\n\t\t\tpdev->images = fz_resize_array(ctx, pdev->images, newmax, sizeof(*pdev->images));\n\t\t\tpdev->max_imgs = newmax;\n\t\t}\n\t\tnum = pdev->num_imgs++;\n\t\tmemcpy(pdev->images[num].digest,digest,16);\n\t\tpdev->images[num].ref = NULL; /* Will be filled in later */\n\n\t\timobj = pdf_new_dict(doc, 3);\n\t\tpdf_dict_puts_drop(imobj, \"Type\", pdf_new_name(doc, \"XObject\"));\n\t\tpdf_dict_puts_drop(imobj, \"Subtype\", pdf_new_name(doc, \"Image\"));\n\t\tpdf_dict_puts_drop(imobj, \"Width\", pdf_new_int(doc, image->w));\n\t\tpdf_dict_puts_drop(imobj, \"Height\", pdf_new_int(doc, image->h));\n\t\tif (mask)\n\t\t{}\n\t\telse if (!colorspace || colorspace->n == 1)\n\t\t\tpdf_dict_puts_drop(imobj, \"ColorSpace\", pdf_new_name(doc, \"DeviceGray\"));\n\t\telse if (colorspace->n == 3)\n\t\t\tpdf_dict_puts_drop(imobj, \"ColorSpace\", pdf_new_name(doc, \"DeviceRGB\"));\n\t\telse if (colorspace->n == 4)\n\t\t\tpdf_dict_puts_drop(imobj, \"ColorSpace\", pdf_new_name(doc, \"DeviceCMYK\"));\n\t\tif (!mask)\n\t\t\tpdf_dict_puts_drop(imobj, \"BitsPerComponent\", pdf_new_int(doc, image->bpc));\n\t\tswitch (cp ? cp->type : FZ_IMAGE_UNKNOWN)\n\t\t{\n\t\tcase FZ_IMAGE_UNKNOWN: /* Unknown also means raw */\n\t\tdefault:\n\t\t\tbreak;\n\t\tcase FZ_IMAGE_JPEG:\n\t\t\tif (cp->u.jpeg.color_transform != -1)\n\t\t\t\tpdf_dict_puts_drop(imobj, \"ColorTransform\", pdf_new_int(doc, cp->u.jpeg.color_transform));\n\t\t\tpdf_dict_puts_drop(imobj, \"Filter\", pdf_new_name(doc, \"DCTDecode\"));\n\t\t\tbreak;\n\t\tcase FZ_IMAGE_JPX:\n\t\t\tif (cp->u.jpx.smask_in_data)\n\t\t\t\tpdf_dict_puts_drop(imobj, \"SMaskInData\", pdf_new_int(doc, cp->u.jpx.smask_in_data));\n\t\t\tpdf_dict_puts_drop(imobj, \"Filter\", pdf_new_name(doc, \"JPXDecode\"));\n\t\t\tbreak;\n\t\tcase FZ_IMAGE_FAX:\n\t\t\tif (cp->u.fax.columns)\n\t\t\t\tpdf_dict_puts_drop(imobj, \"Columns\", pdf_new_int(doc, cp->u.fax.columns));\n\t\t\tif (cp->u.fax.rows)\n\t\t\t\tpdf_dict_puts_drop(imobj, \"Rows\", pdf_new_int(doc, cp->u.fax.rows));\n\t\t\tif (cp->u.fax.k)\n\t\t\t\tpdf_dict_puts_drop(imobj, \"K\", pdf_new_int(doc, cp->u.fax.k));\n\t\t\tif (cp->u.fax.end_of_line)\n\t\t\t\tpdf_dict_puts_drop(imobj, \"EndOfLine\", pdf_new_int(doc, cp->u.fax.end_of_line));\n\t\t\tif (cp->u.fax.encoded_byte_align)\n\t\t\t\tpdf_dict_puts_drop(imobj, \"EncodedByteAlign\", pdf_new_int(doc, cp->u.fax.encoded_byte_align));\n\t\t\tif (cp->u.fax.end_of_block)\n\t\t\t\tpdf_dict_puts_drop(imobj, \"EndOfBlock\", pdf_new_int(doc, cp->u.fax.end_of_block));\n\t\t\tif (cp->u.fax.black_is_1)\n\t\t\t\tpdf_dict_puts_drop(imobj, \"BlackIs1\", pdf_new_int(doc, cp->u.fax.black_is_1));\n\t\t\tif (cp->u.fax.damaged_rows_before_error)\n\t\t\t\tpdf_dict_puts_drop(imobj, \"DamagedRowsBeforeError\", pdf_new_int(doc, cp->u.fax.damaged_rows_before_error));\n\t\t\tpdf_dict_puts_drop(imobj, \"Filter\", pdf_new_name(doc, \"CCITTFaxDecode\"));\n\t\t\tbreak;\n\t\tcase FZ_IMAGE_JBIG2:\n\t\t\t/* FIXME - jbig2globals */\n\t\t\tcp->type = FZ_IMAGE_UNKNOWN;\n\t\t\tbreak;\n\t\tcase FZ_IMAGE_FLATE:\n\t\t\tif (cp->u.flate.columns)\n\t\t\t\tpdf_dict_puts_drop(imobj, \"Columns\", pdf_new_int(doc, cp->u.flate.columns));\n\t\t\tif (cp->u.flate.colors)\n\t\t\t\tpdf_dict_puts_drop(imobj, \"Colors\", pdf_new_int(doc, cp->u.flate.colors));\n\t\t\tif (cp->u.flate.predictor)\n\t\t\t\tpdf_dict_puts_drop(imobj, \"Predictor\", pdf_new_int(doc, cp->u.flate.predictor));\n\t\t\tpdf_dict_puts_drop(imobj, \"Filter\", pdf_new_name(doc, \"FlateDecode\"));\n\t\t\tpdf_dict_puts_drop(imobj, \"BitsPerComponent\", pdf_new_int(doc, image->bpc));\n\t\t\tbreak;\n\t\tcase FZ_IMAGE_LZW:\n\t\t\tif (cp->u.lzw.columns)\n\t\t\t\tpdf_dict_puts_drop(imobj, \"Columns\", pdf_new_int(doc, cp->u.lzw.columns));\n\t\t\tif (cp->u.lzw.colors)\n\t\t\t\tpdf_dict_puts_drop(imobj, \"Colors\", pdf_new_int(doc, cp->u.lzw.colors));\n\t\t\tif (cp->u.lzw.predictor)\n\t\t\t\tpdf_dict_puts_drop(imobj, \"Predictor\", pdf_new_int(doc, cp->u.lzw.predictor));\n\t\t\tif (cp->u.lzw.early_change)\n\t\t\t\tpdf_dict_puts_drop(imobj, \"EarlyChange\", pdf_new_int(doc, cp->u.lzw.early_change));\n\t\t\tpdf_dict_puts_drop(imobj, \"Filter\", pdf_new_name(doc, \"LZWDecode\"));\n\t\t\tbreak;\n\t\tcase FZ_IMAGE_RLD:\n\t\t\tpdf_dict_puts_drop(imobj, \"Filter\", pdf_new_name(doc, \"RunLengthDecode\"));\n\t\t\tbreak;\n\t\t}\n\t\tif (mask)\n\t\t{\n\t\t\tpdf_dict_puts_drop(imobj, \"ImageMask\", pdf_new_bool(doc, 1));\n\t\t}\n\t\tif (image->mask)\n\t\t{\n\t\t\tint smasknum = send_image(pdev, image->mask, 0, 1);\n\t\t\tpdf_dict_puts(imobj, \"SMask\", pdev->images[smasknum].ref);\n\t\t}\n\n\t\timref = pdf_new_ref(doc, imobj);\n\t\tpdf_update_stream(doc, pdf_to_num(imref), buffer);\n\t\tpdf_dict_puts_drop(imobj, \"Length\", pdf_new_int(doc, buffer->len));\n\n\t\t{\n\t\t\tchar text[32];\n\t\t\tsnprintf(text, sizeof(text), \"XObject/Img%d\", num);\n\t\t\tpdf_dict_putp(pdev->resources, text, imref);\n\t\t}\n\t\tpdev->images[num].ref = imref;\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, buffer);\n\t\tpdf_drop_obj(imobj);\n\t\tfz_drop_pixmap(ctx, pixmap);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_obj(imref);\n\t\tfz_rethrow(ctx);\n\t}\n\treturn num;\n}\n\nstatic void\npdf_dev_stroke_state(pdf_device *pdev, fz_stroke_state *stroke_state)\n{\n\tfz_context *ctx = pdev->ctx;\n\tgstate *gs = CURRENT_GSTATE(pdev);\n\n\tif (stroke_state == gs->stroke_state)\n\t\treturn;\n\tif (gs->stroke_state && !memcmp(stroke_state, gs->stroke_state, sizeof(*stroke_state)))\n\t\treturn;\n\tif (!gs->stroke_state || gs->stroke_state->linewidth != stroke_state->linewidth)\n\t{\n\t\tfz_buffer_printf(ctx, gs->buf, \"%f w\\n\", stroke_state->linewidth);\n\t}\n\tif (!gs->stroke_state || gs->stroke_state->start_cap != stroke_state->start_cap)\n\t{\n\t\tint cap = stroke_state->start_cap;\n\t\t/* FIXME: Triangle caps aren't supported in pdf */\n\t\tif (cap == FZ_LINECAP_TRIANGLE)\n\t\t\tcap = FZ_LINECAP_BUTT;\n\t\tfz_buffer_printf(ctx, gs->buf, \"%d J\\n\", cap);\n\t}\n\tif (!gs->stroke_state || gs->stroke_state->linejoin != stroke_state->linejoin)\n\t{\n\t\tint join = stroke_state->linejoin;\n\t\tif (join == FZ_LINEJOIN_MITER_XPS)\n\t\t\tjoin = FZ_LINEJOIN_MITER;\n\t\tfz_buffer_printf(ctx, gs->buf, \"%d j\\n\", join);\n\t}\n\tif (!gs->stroke_state || gs->stroke_state->miterlimit != stroke_state->miterlimit)\n\t{\n\t\tfz_buffer_printf(ctx, gs->buf, \"%f M\\n\", stroke_state->miterlimit);\n\t}\n\tif (gs->stroke_state == NULL && stroke_state->dash_len == 0)\n\t{}\n\telse if (!gs->stroke_state || gs->stroke_state->dash_phase != stroke_state->dash_phase || gs->stroke_state->dash_len != stroke_state->dash_len ||\n\t\tmemcmp(gs->stroke_state->dash_list, stroke_state->dash_list, sizeof(float)*stroke_state->dash_len))\n\t{\n\t\tint i;\n\t\tif (stroke_state->dash_len == 0)\n\t\t\tfz_buffer_printf(ctx, gs->buf, \"[\");\n\t\tfor (i = 0; i < stroke_state->dash_len; i++)\n\t\t\tfz_buffer_printf(ctx, gs->buf, \"%c%f\", (i == 0 ? '[' : ' '), stroke_state->dash_list[i]);\n\t\tfz_buffer_printf(ctx, gs->buf, \"]%f d\\n\", stroke_state->dash_phase);\n\n\t}\n\tfz_drop_stroke_state(ctx, gs->stroke_state);\n\tgs->stroke_state = fz_keep_stroke_state(ctx, stroke_state);\n}\n\nstatic void\npdf_dev_path(pdf_device *pdev, fz_path *path)\n{\n\tfz_context *ctx = pdev->ctx;\n\tgstate *gs = CURRENT_GSTATE(pdev);\n\tfloat x, y;\n\tint i = 0, k = 0;\n\twhile (i < path->cmd_len)\n\t{\n\t\tswitch (path->cmds[i++])\n\t\t{\n\t\tcase FZ_MOVETO:\n\t\t\tx = path->coords[k++];\n\t\t\ty = path->coords[k++];\n\t\t\tfz_buffer_printf(ctx, gs->buf, \"%f %f m\\n\", x, y);\n\t\t\tbreak;\n\t\tcase FZ_LINETO:\n\t\t\tx = path->coords[k++];\n\t\t\ty = path->coords[k++];\n\t\t\tfz_buffer_printf(ctx, gs->buf, \"%f %f l\\n\", x, y);\n\t\t\tbreak;\n\t\tcase FZ_CURVETO:\n\t\t\tx = path->coords[k++];\n\t\t\ty = path->coords[k++];\n\t\t\tfz_buffer_printf(ctx, gs->buf, \"%f %f \", x, y);\n\t\t\tx = path->coords[k++];\n\t\t\ty = path->coords[k++];\n\t\t\tfz_buffer_printf(ctx, gs->buf, \"%f %f \", x, y);\n\t\t\tx = path->coords[k++];\n\t\t\ty = path->coords[k++];\n\t\t\tfz_buffer_printf(ctx, gs->buf, \"%f %f c\\n\", x, y);\n\t\t\tbreak;\n\t\tcase FZ_CLOSE_PATH:\n\t\t\tfz_buffer_printf(ctx, gs->buf, \"h\\n\");\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\nstatic void\npdf_dev_ctm(pdf_device *pdev, const fz_matrix *ctm)\n{\n\tfz_matrix inverse;\n\tgstate *gs = CURRENT_GSTATE(pdev);\n\n\tif (memcmp(&gs->ctm, ctm, sizeof(*ctm)) == 0)\n\t\treturn;\n\tfz_invert_matrix(&inverse, &gs->ctm);\n\tfz_concat(&inverse, ctm, &inverse);\n\tmemcpy(&gs->ctm, ctm, sizeof(*ctm));\n\tfz_buffer_printf(pdev->ctx, gs->buf, \"%f %f %f %f %f %f cm\\n\", inverse.a, inverse.b, inverse.c, inverse.d, inverse.e, inverse.f);\n}\n\nstatic void\npdf_dev_color(pdf_device *pdev, fz_colorspace *colorspace, float *color, int stroke)\n{\n\tint diff = 0;\n\tint i;\n\tint cspace = 0;\n\tfz_context *ctx = pdev->ctx;\n\tfloat rgb[FZ_MAX_COLORS];\n\tgstate *gs = CURRENT_GSTATE(pdev);\n\n\tif (colorspace == fz_device_gray(ctx))\n\t\tcspace = 1;\n\telse if (colorspace == fz_device_rgb(ctx))\n\t\tcspace = 3;\n\telse if (colorspace == fz_device_cmyk(ctx))\n\t\tcspace = 4;\n\n\tif (cspace == 0)\n\t{\n\t\t/* If it's an unknown colorspace, fallback to rgb */\n\t\tcolorspace->to_rgb(ctx, colorspace, color, rgb);\n\t\tcolor = rgb;\n\t\tcolorspace = fz_device_rgb(ctx);\n\t}\n\n\tif (gs->colorspace[stroke] != colorspace)\n\t{\n\t\tgs->colorspace[stroke] = colorspace;\n\t\tdiff = 1;\n\t}\n\n\tfor (i=0; i < colorspace->n; i++)\n\t\tif (gs->color[stroke][i] != color[i])\n\t\t{\n\t\t\tgs->color[stroke][i] = color[i];\n\t\t\tdiff = 1;\n\t\t}\n\n\tif (diff == 0)\n\t\treturn;\n\n\tswitch (cspace + stroke*8)\n\t{\n\t\tcase 1:\n\t\t\tfz_buffer_printf(ctx, gs->buf, \"%f g\\n\", color[0]);\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tfz_buffer_printf(ctx, gs->buf, \"%f %f %f rg\\n\", color[0], color[1], color[2]);\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tfz_buffer_printf(ctx, gs->buf, \"%f %f %f %f k\\n\", color[0], color[1], color[2], color[3]);\n\t\t\tbreak;\n\t\tcase 1+8:\n\t\t\tfz_buffer_printf(ctx, gs->buf, \"%f G\\n\", color[0]);\n\t\t\tbreak;\n\t\tcase 3+8:\n\t\t\tfz_buffer_printf(ctx, gs->buf, \"%f %f %f RG\\n\", color[0], color[1], color[2]);\n\t\t\tbreak;\n\t\tcase 4+8:\n\t\t\tfz_buffer_printf(ctx, gs->buf, \"%f %f %f %f K\\n\", color[0], color[1], color[2], color[3]);\n\t\t\tbreak;\n\t}\n}\n\nstatic void\npdf_dev_alpha(pdf_device *pdev, float alpha, int stroke)\n{\n\tint i;\n\tfz_context *ctx = pdev->ctx;\n\tpdf_document *doc = pdev->doc;\n\tgstate *gs = CURRENT_GSTATE(pdev);\n\n\t/* If the alpha is unchanged, nothing to do */\n\tif (gs->alpha[stroke] == alpha)\n\t\treturn;\n\n\t/* Have we sent such an alpha before? */\n\tfor (i = 0; i < pdev->num_alphas; i++)\n\t\tif (pdev->alphas[i].alpha == alpha && pdev->alphas[i].stroke == stroke)\n\t\t\tbreak;\n\n\tif (i == pdev->num_alphas)\n\t{\n\t\tpdf_obj *o;\n\t\tpdf_obj *ref = NULL;\n\n\t\tfz_var(ref);\n\n\t\t/* No. Need to make a new one */\n\t\tif (pdev->num_alphas == pdev->max_alphas)\n\t\t{\n\t\t\tint newmax = pdev->max_alphas * 2;\n\t\t\tif (newmax == 0)\n\t\t\t\tnewmax = 4;\n\t\t\tpdev->alphas = fz_resize_array(ctx, pdev->alphas, newmax, sizeof(*pdev->alphas));\n\t\t\tpdev->max_alphas = newmax;\n\t\t}\n\t\tpdev->alphas[i].alpha = alpha;\n\t\tpdev->alphas[i].stroke = stroke;\n\n\t\to = pdf_new_dict(doc, 1);\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tchar text[32];\n\t\t\tpdf_dict_puts_drop(o, (stroke ? \"CA\" : \"ca\"), pdf_new_real(doc, alpha));\n\t\t\tref = pdf_new_ref(doc, o);\n\t\t\tsnprintf(text, sizeof(text), \"ExtGState/Alp%d\", i);\n\t\t\tpdf_dict_putp(pdev->resources, text, ref);\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tpdf_drop_obj(o);\n\t\t\tpdf_drop_obj(ref);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t\tpdev->num_alphas++;\n\t}\n\tfz_buffer_printf(ctx, gs->buf, \"/Alp%d gs\\n\", i);\n}\n\nstatic void\npdf_dev_font(pdf_device *pdev, fz_font *font, float size)\n{\n\tint i;\n\tpdf_document *doc = pdev->doc;\n\tfz_context *ctx = pdev->ctx;\n\tgstate *gs = CURRENT_GSTATE(pdev);\n\n\t/* If the font is unchanged, nothing to do */\n\tif (gs->font >= 0 && pdev->fonts[gs->font].font == font)\n\t\treturn;\n\n\tif (font->ft_buffer != NULL || font->ft_substitute)\n\t\tfz_throw(pdev->ctx, FZ_ERROR_GENERIC, \"pdf device supports only base 14 fonts currently\");\n\n\t/* Have we sent such a font before? */\n\tfor (i = 0; i < pdev->num_fonts; i++)\n\t\tif (pdev->fonts[i].font == font)\n\t\t\tbreak;\n\n\tif (i == pdev->num_fonts)\n\t{\n\t\tpdf_obj *o;\n\t\tpdf_obj *ref = NULL;\n\n\t\tfz_var(ref);\n\n\t\t/* No. Need to make a new one */\n\t\tif (pdev->num_fonts == pdev->max_fonts)\n\t\t{\n\t\t\tint newmax = pdev->max_fonts * 2;\n\t\t\tif (newmax == 0)\n\t\t\t\tnewmax = 4;\n\t\t\tpdev->fonts = fz_resize_array(ctx, pdev->fonts, newmax, sizeof(*pdev->fonts));\n\t\t\tpdev->max_fonts = newmax;\n\t\t}\n\t\tpdev->fonts[i].font = fz_keep_font(ctx, font);\n\n\t\to = pdf_new_dict(doc, 3);\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tchar text[32];\n\t\t\tpdf_dict_puts_drop(o, \"Type\", pdf_new_name(doc, \"Font\"));\n\t\t\tpdf_dict_puts_drop(o, \"Subtype\", pdf_new_name(doc, \"Type1\"));\n\t\t\tpdf_dict_puts_drop(o, \"BaseFont\", pdf_new_name(doc, font->name));\n\t\t\tpdf_dict_puts_drop(o, \"Encoding\", pdf_new_name(doc, \"WinAnsiEncoding\"));\n\t\t\tref = pdf_new_ref(doc, o);\n\t\t\tsnprintf(text, sizeof(text), \"Font/F%d\", i);\n\t\t\tpdf_dict_putp(pdev->resources, text, ref);\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tpdf_drop_obj(o);\n\t\t\tpdf_drop_obj(ref);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t\tpdev->num_fonts++;\n\t}\n\tfz_buffer_printf(ctx, gs->buf, \"/F%d %f Tf\\n\", i, size);\n}\n\nstatic void\npdf_dev_tm(pdf_device *pdev, const fz_matrix *tm)\n{\n\tgstate *gs = CURRENT_GSTATE(pdev);\n\n\tif (memcmp(&gs->tm, tm, sizeof(*tm)) == 0)\n\t\treturn;\n\tfz_buffer_printf(pdev->ctx, gs->buf, \"%f %f %f %f %f %f Tm\\n\", tm->a, tm->b, tm->c, tm->d, tm->e, tm->f);\n\tgs->tm = *tm;\n}\n\nstatic void\npdf_dev_push_new_buf(pdf_device *pdev, fz_buffer *buf, void (*on_pop)(pdf_device*,void *), void *on_pop_arg)\n{\n\tfz_context *ctx = pdev->ctx;\n\n\tif (pdev->num_gstates == pdev->max_gstates)\n\t{\n\t\tint newmax = pdev->max_gstates*2;\n\n\t\tpdev->gstates = fz_resize_array(ctx, pdev->gstates, newmax, sizeof(*pdev->gstates));\n\t\tpdev->max_gstates = newmax;\n\t}\n\tmemcpy(&pdev->gstates[pdev->num_gstates], &pdev->gstates[pdev->num_gstates-1], sizeof(*pdev->gstates));\n\tfz_keep_stroke_state(ctx, pdev->gstates[pdev->num_gstates].stroke_state);\n\tif (buf)\n\t\tpdev->gstates[pdev->num_gstates].buf = buf;\n\telse\n\t\tfz_keep_buffer(ctx, pdev->gstates[pdev->num_gstates].buf);\n\tpdev->gstates[pdev->num_gstates].on_pop = on_pop;\n\tpdev->gstates[pdev->num_gstates].on_pop_arg = on_pop_arg;\n\tfz_buffer_printf(ctx, pdev->gstates[pdev->num_gstates].buf, \"q\\n\");\n\tpdev->num_gstates++;\n}\n\nstatic void\npdf_dev_push(pdf_device *pdev)\n{\n\tpdf_dev_push_new_buf(pdev, NULL, NULL, NULL);\n}\n\nstatic void *\npdf_dev_pop(pdf_device *pdev)\n{\n\tfz_context *ctx = pdev->ctx;\n\tgstate *gs = CURRENT_GSTATE(pdev);\n\tvoid *arg = gs->on_pop_arg;\n\n\tfz_buffer_printf(pdev->ctx, gs->buf, \"Q\\n\");\n\tif (gs->on_pop)\n\t\tgs->on_pop(pdev, arg);\n\tpdev->num_gstates--;\n\tfz_drop_stroke_state(ctx, pdev->gstates[pdev->num_gstates].stroke_state);\n\tfz_drop_buffer(ctx, pdev->gstates[pdev->num_gstates].buf);\n\treturn arg;\n}\n\nstatic void\npdf_dev_text(pdf_device *pdev, fz_text *text, float size)\n{\n\tint mask = FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM;\n\tint i;\n\tfz_matrix trm;\n\tfz_matrix inverse;\n\tgstate *gs = CURRENT_GSTATE(pdev);\n\tfz_matrix trunc_trm;\n\n\ttrm = gs->tm;\n\ttrunc_trm.a = trm.a;\n\ttrunc_trm.b = trm.b;\n\ttrunc_trm.c = trm.c;\n\ttrunc_trm.d = trm.d;\n\ttrunc_trm.e = 0;\n\ttrunc_trm.f = 0;\n\tfz_invert_matrix(&inverse, &trunc_trm);\n\n\ti = 0;\n\twhile (i < text->len)\n\t{\n\t\tfz_text_item *it = &text->items[i];\n\t\tfz_point delta;\n\t\tfloat x;\n\t\tint j;\n\n\t\tdelta.x = it->x - trm.e;\n\t\tdelta.y = it->y - trm.f;\n\t\tfz_transform_point(&delta, &inverse);\n\t\tif (delta.x != 0 || delta.y != 0)\n\t\t{\n\t\t\tfz_buffer_printf(pdev->ctx, gs->buf, \"%f %f Td \", delta.x, delta.y);\n\t\t\ttrm.e = it->x;\n\t\t\ttrm.f = it->y;\n\t\t}\n\n\t\tj = i+1;\n\t\tif (text->font->ft_face)\n\t\t{\n\t\t\t/* Find prefix of text for which the advance of each character accounts\n\t\t\t * for the position offset */\n\t\t\tx = it->x;\n\t\t\twhile (j < text->len)\n\t\t\t{\n\t\t\t\tFT_Fixed adv;\n\t\t\t\tFT_Get_Advance(text->font->ft_face, text->items[j-1].gid, mask, &adv);\n\t\t\t\tx += (float)adv * size /((FT_Face)text->font->ft_face)->units_per_EM;\n\t\t\t\tif (fabs(x - text->items[j].x) > ALLOWED_TEXT_POS_ERROR || fabs(it->y - text->items[j].y) > ALLOWED_TEXT_POS_ERROR)\n\t\t\t\t\tbreak;\n\t\t\t\tj++;\n\t\t\t}\n\t\t}\n\n\t\tfz_buffer_printf(pdev->ctx, gs->buf, \"<\");\n\t\tfor (/* i from its current value */; i < j; i++)\n\t\t{\n\t\t\t/* FIXME: should use it->gid, rather than it->ucs, and convert\n\t\t\t* to the correct encoding */\n\t\t\tfz_buffer_printf(pdev->ctx, gs->buf, \"%02x\", text->items[i].ucs);\n\t\t}\n\t\tfz_buffer_printf(pdev->ctx, gs->buf, \"> Tj\\n\");\n\t}\n\tgs->tm.e = trm.e;\n\tgs->tm.f = trm.f;\n}\n\nstatic void\npdf_dev_trm(pdf_device *pdev, int trm)\n{\n\tgstate *gs = CURRENT_GSTATE(pdev);\n\n\tif (gs->text_rendering_mode == trm)\n\t\treturn;\n\tgs->text_rendering_mode = trm;\n\tfz_buffer_printf(pdev->ctx, gs->buf, \"%d Tr\\n\", trm);\n}\n\nstatic void\npdf_dev_begin_text(pdf_device *pdev, const fz_matrix *tm, int trm)\n{\n\tpdf_dev_trm(pdev, trm);\n\tif (!pdev->in_text)\n\t{\n\t\tgstate *gs = CURRENT_GSTATE(pdev);\n\t\tfz_buffer_printf(pdev->ctx, gs->buf, \"BT\\n\");\n\t\tgs->tm.a = 1;\n\t\tgs->tm.b = 0;\n\t\tgs->tm.c = 0;\n\t\tgs->tm.d = 1;\n\t\tgs->tm.e = 0;\n\t\tgs->tm.f = 0;\n\t\tpdev->in_text = 1;\n\t}\n\tpdf_dev_tm(pdev, tm);\n}\n\nstatic void\npdf_dev_end_text(pdf_device *pdev)\n{\n\tgstate *gs = CURRENT_GSTATE(pdev);\n\n\tif (!pdev->in_text)\n\t\treturn;\n\tpdev->in_text = 0;\n\tfz_buffer_printf(pdev->ctx, gs->buf, \"ET\\n\");\n}\n\nstatic int\npdf_dev_new_form(pdf_obj **form_ref, pdf_device *pdev, const fz_rect *bbox, int isolated, int knockout, float alpha, fz_colorspace *colorspace)\n{\n\tfz_context *ctx = pdev->ctx;\n\tpdf_document *doc = pdev->doc;\n\tint num;\n\tpdf_obj *group_ref;\n\tpdf_obj *group;\n\tpdf_obj *form;\n\n\t*form_ref = NULL;\n\n\t/* Find (or make) a new group with the required options. */\n\tfor(num = 0; num < pdev->num_groups; num++)\n\t{\n\t\tgroup_entry *g = &pdev->groups[num];\n\t\tif (g->isolated == isolated && g->knockout == knockout && g->alpha == alpha && g->colorspace == colorspace)\n\t\t{\n\t\t\tgroup_ref = pdev->groups[num].ref;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/* If we didn't find one, make one */\n\tif (num == pdev->num_groups)\n\t{\n\t\tif (pdev->num_groups == pdev->max_groups)\n\t\t{\n\t\t\tint newmax = pdev->max_groups * 2;\n\t\t\tif (newmax == 0)\n\t\t\t\tnewmax = 4;\n\t\t\tpdev->groups = fz_resize_array(ctx, pdev->groups, newmax, sizeof(*pdev->groups));\n\t\t\tpdev->max_groups = newmax;\n\t\t}\n\t\tpdev->num_groups++;\n\t\tpdev->groups[num].isolated = isolated;\n\t\tpdev->groups[num].knockout = knockout;\n\t\tpdev->groups[num].alpha = alpha;\n\t\tpdev->groups[num].colorspace = fz_keep_colorspace(ctx, colorspace);\n\t\tpdev->groups[num].ref = NULL;\n\t\tgroup = pdf_new_dict(doc, 5);\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tpdf_dict_puts_drop(group, \"Type\", pdf_new_name(doc, \"Group\"));\n\t\t\tpdf_dict_puts_drop(group, \"S\", pdf_new_name(doc, \"Transparency\"));\n\t\t\tpdf_dict_puts_drop(group, \"K\", pdf_new_bool(doc, knockout));\n\t\t\tpdf_dict_puts_drop(group, \"I\", pdf_new_bool(doc, isolated));\n\t\t\tif (!colorspace)\n\t\t\t{}\n\t\t\telse if (colorspace->n == 1)\n\t\t\t\tpdf_dict_puts_drop(group, \"CS\", pdf_new_name(doc, \"DeviceGray\"));\n\t\t\telse if (colorspace->n == 4)\n\t\t\t\tpdf_dict_puts_drop(group, \"CS\", pdf_new_name(doc, \"DeviceCMYK\"));\n\t\t\telse\n\t\t\t\tpdf_dict_puts_drop(group, \"CS\", pdf_new_name(doc, \"DeviceRGB\"));\n\t\t\tgroup_ref = pdev->groups[num].ref = pdf_new_ref(doc, group);\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tpdf_drop_obj(group);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t}\n\n\t/* Make us a new Forms object that points to that group, and change\n\t * to writing into the buffer for that Forms object. */\n\tform = pdf_new_dict(doc, 4);\n\tfz_try(ctx)\n\t{\n\t\tpdf_dict_puts_drop(form, \"Subtype\", pdf_new_name(doc, \"Form\"));\n\t\tpdf_dict_puts(form, \"Group\", group_ref);\n\t\tpdf_dict_puts_drop(form, \"FormType\", pdf_new_int(doc, 1));\n\t\tpdf_dict_puts_drop(form, \"BBox\", pdf_new_rect(doc, bbox));\n\t\t*form_ref = pdf_new_ref(doc, form);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_obj(form);\n\t\tfz_rethrow(ctx);\n\t}\n\n\t/* Insert the new form object into the resources */\n\t{\n\t\tchar text[32];\n\t\tnum = pdev->num_forms++;\n\t\tsnprintf(text, sizeof(text), \"XObject/Fm%d\", num);\n\t\tpdf_dict_putp(pdev->resources, text, *form_ref);\n\t}\n\n\treturn num;\n}\n\n/* Entry points */\n\nstatic void\npdf_dev_fill_path(fz_device *dev, fz_path *path, int even_odd, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tpdf_device *pdev = dev->user;\n\tgstate *gs = CURRENT_GSTATE(pdev);\n\n\tpdf_dev_end_text(pdev);\n\tpdf_dev_alpha(pdev, alpha, 0);\n\tpdf_dev_color(pdev, colorspace, color, 0);\n\tpdf_dev_ctm(pdev, ctm);\n\tpdf_dev_path(pdev, path);\n\tfz_buffer_printf(dev->ctx, gs->buf, (even_odd ? \"f*\\n\" : \"f\\n\"));\n}\n\nstatic void\npdf_dev_stroke_path(fz_device *dev, fz_path *path, fz_stroke_state *stroke, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tpdf_device *pdev = dev->user;\n\tgstate *gs = CURRENT_GSTATE(pdev);\n\n\tpdf_dev_end_text(pdev);\n\tpdf_dev_alpha(pdev, alpha, 1);\n\tpdf_dev_color(pdev, colorspace, color, 1);\n\tpdf_dev_ctm(pdev, ctm);\n\tpdf_dev_stroke_state(pdev, stroke);\n\tpdf_dev_path(pdev, path);\n\tfz_buffer_printf(dev->ctx, gs->buf, \"S\\n\");\n}\n\nstatic void\npdf_dev_clip_path(fz_device *dev, fz_path *path, const fz_rect *rect, int even_odd, const fz_matrix *ctm)\n{\n\tpdf_device *pdev = dev->user;\n\tgstate *gs;\n\n\tpdf_dev_end_text(pdev);\n\tpdf_dev_push(pdev);\n\tpdf_dev_ctm(pdev, ctm);\n\tpdf_dev_path(pdev, path);\n\tgs = CURRENT_GSTATE(pdev);\n\tfz_buffer_printf(dev->ctx, gs->buf, (even_odd ? \"W* n\\n\" : \"W n\\n\"));\n}\n\nstatic void\npdf_dev_clip_stroke_path(fz_device *dev, fz_path *path, const fz_rect *rect, fz_stroke_state *stroke, const fz_matrix *ctm)\n{\n\tpdf_device *pdev = dev->user;\n\tgstate *gs;\n\n\tpdf_dev_end_text(pdev);\n\tpdf_dev_push(pdev);\n\t/* FIXME: Need to push a group, select a pattern (or shading) here,\n\t * stroke with the pattern/shading. Then move to defining that pattern\n\t * with the next calls to the device interface until the next pop\n\t * when we pop the group. */\n\tpdf_dev_ctm(pdev, ctm);\n\tpdf_dev_path(pdev, path);\n\tgs = CURRENT_GSTATE(pdev);\n\tfz_buffer_printf(dev->ctx, gs->buf, \"W n\\n\");\n}\n\nstatic void\npdf_dev_fill_text(fz_device *dev, fz_text *text, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tpdf_device *pdev = dev->user;\n\tfz_matrix trm = text->trm;\n\tfloat size = fz_matrix_expansion(&trm);\n\n\tfz_pre_scale(&trm, 1/size, 1/size);\n\n\tpdf_dev_begin_text(pdev, &trm, 0);\n\tpdf_dev_font(pdev, text->font, size);\n\tpdf_dev_ctm(pdev, ctm);\n\tpdf_dev_alpha(pdev, alpha, 0);\n\tpdf_dev_color(pdev, colorspace, color, 0);\n\tpdf_dev_text(pdev, text, size);\n}\n\nstatic void\npdf_dev_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, const fz_matrix *ctm,\n\tfz_colorspace *colorspace, float *color, float alpha)\n{\n\tpdf_device *pdev = dev->user;\n\tfz_matrix trm = text->trm;\n\tfloat size = fz_matrix_expansion(&trm);\n\n\tfz_pre_scale(&trm, 1/size, 1/size);\n\n\tpdf_dev_begin_text(pdev, &text->trm, 1);\n\tpdf_dev_font(pdev, text->font, 1);\n\tpdf_dev_ctm(pdev, ctm);\n\tpdf_dev_alpha(pdev, alpha, 1);\n\tpdf_dev_color(pdev, colorspace, color, 1);\n\tpdf_dev_text(pdev, text, size);\n}\n\nstatic void\npdf_dev_clip_text(fz_device *dev, fz_text *text, const fz_matrix *ctm, int accumulate)\n{\n\tpdf_device *pdev = dev->user;\n\tfz_matrix trm = text->trm;\n\tfloat size = fz_matrix_expansion(&trm);\n\n\tfz_pre_scale(&trm, 1/size, 1/size);\n\n\tpdf_dev_begin_text(pdev, &text->trm, 0);\n\tpdf_dev_ctm(pdev, ctm);\n\tpdf_dev_font(pdev, text->font, 7);\n\tpdf_dev_text(pdev, text, size);\n}\n\nstatic void\npdf_dev_clip_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, const fz_matrix *ctm)\n{\n\tpdf_device *pdev = dev->user;\n\tfz_matrix trm = text->trm;\n\tfloat size = fz_matrix_expansion(&trm);\n\n\tfz_pre_scale(&trm, 1/size, 1/size);\n\n\tpdf_dev_begin_text(pdev, &text->trm, 0);\n\tpdf_dev_font(pdev, text->font, 5);\n\tpdf_dev_ctm(pdev, ctm);\n\tpdf_dev_text(pdev, text, size);\n}\n\nstatic void\npdf_dev_ignore_text(fz_device *dev, fz_text *text, const fz_matrix *ctm)\n{\n\tpdf_device *pdev = dev->user;\n\tfz_matrix trm = text->trm;\n\tfloat size = fz_matrix_expansion(&trm);\n\n\tfz_pre_scale(&trm, 1/size, 1/size);\n\n\tpdf_dev_begin_text(pdev, &text->trm, 0);\n\tpdf_dev_ctm(pdev, ctm);\n\tpdf_dev_font(pdev, text->font, 3);\n\tpdf_dev_text(pdev, text, size);\n}\n\nstatic void\npdf_dev_fill_image(fz_device *dev, fz_image *image, const fz_matrix *ctm, float alpha)\n{\n\tpdf_device *pdev = (pdf_device *)dev->user;\n\tint num;\n\tgstate *gs = CURRENT_GSTATE(pdev);\n\tfz_matrix local_ctm = *ctm;\n\n\tpdf_dev_end_text(pdev);\n\tnum = send_image(pdev, image, 0, 0);\n\tpdf_dev_alpha(pdev, alpha, 0);\n\t/* PDF images are upside down, so fiddle the ctm */\n\tfz_pre_scale(&local_ctm, 1, -1);\n\tfz_pre_translate(&local_ctm, 0, -1);\n\tpdf_dev_ctm(pdev, &local_ctm);\n\tfz_buffer_printf(dev->ctx, gs->buf, \"/Img%d Do\\n\", num);\n}\n\nstatic void\npdf_dev_fill_shade(fz_device *dev, fz_shade *shade, const fz_matrix *ctm, float alpha)\n{\n\tpdf_device *pdev = (pdf_device *)dev->user;\n\n\t/* FIXME */\n\tpdf_dev_end_text(pdev);\n}\n\nstatic void\npdf_dev_fill_image_mask(fz_device *dev, fz_image *image, const fz_matrix *ctm,\nfz_colorspace *colorspace, float *color, float alpha)\n{\n\tpdf_device *pdev = (pdf_device *)dev->user;\n\tgstate *gs = CURRENT_GSTATE(pdev);\n\tint num;\n\tfz_matrix local_ctm = *ctm;\n\n\tpdf_dev_end_text(pdev);\n\tnum = send_image(pdev, image, 1, 0);\n\tfz_buffer_printf(dev->ctx, gs->buf, \"q\\n\");\n\tpdf_dev_alpha(pdev, alpha, 0);\n\tpdf_dev_color(pdev, colorspace, color, 0);\n\t/* PDF images are upside down, so fiddle the ctm */\n\tfz_pre_scale(&local_ctm, 1, -1);\n\tfz_pre_translate(&local_ctm, 0, -1);\n\tpdf_dev_ctm(pdev, &local_ctm);\n\tfz_buffer_printf(dev->ctx, gs->buf, \"/Img%d Do Q\\n\", num);\n}\n\nstatic void\npdf_dev_clip_image_mask(fz_device *dev, fz_image *image, const fz_rect *rect, const fz_matrix *ctm)\n{\n\tpdf_device *pdev = (pdf_device *)dev->user;\n\n\t/* FIXME */\n\tpdf_dev_end_text(pdev);\n\tpdf_dev_push(pdev);\n}\n\nstatic void\npdf_dev_pop_clip(fz_device *dev)\n{\n\tpdf_device *pdev = (pdf_device *)dev->user;\n\n\t/* FIXME */\n\tpdf_dev_end_text(pdev);\n\tpdf_dev_pop(pdev);\n}\n\nstatic void\npdf_dev_begin_mask(fz_device *dev, const fz_rect *bbox, int luminosity, fz_colorspace *colorspace, float *color)\n{\n\tpdf_device *pdev = (pdf_device *)dev->user;\n\tpdf_document *doc = pdev->doc;\n\tfz_context *ctx = pdev->ctx;\n\tgstate *gs;\n\tpdf_obj *smask = NULL;\n\tpdf_obj *egs = NULL;\n\tpdf_obj *egs_ref;\n\tpdf_obj *form_ref;\n\tpdf_obj *color_obj = NULL;\n\tint i;\n\n\tfz_var(smask);\n\tfz_var(egs);\n\tfz_var(color_obj);\n\n\tpdf_dev_end_text(pdev);\n\n\t/* Make a new form to contain the contents of the softmask */\n\tpdf_dev_new_form(&form_ref, pdev, bbox, 0, 0, 1, colorspace);\n\n\tfz_try(ctx)\n\t{\n\t\tsmask = pdf_new_dict(doc, 4);\n\t\tpdf_dict_puts_drop(smask, \"Type\", pdf_new_name(doc, \"Mask\"));\n\t\tpdf_dict_puts_drop(smask, \"S\", pdf_new_name(doc, (luminosity ? \"Luminosity\" : \"Alpha\")));\n\t\tpdf_dict_puts(smask, \"G\", form_ref);\n\t\tcolor_obj = pdf_new_array(doc, colorspace->n);\n\t\tfor (i = 0; i < colorspace->n; i++)\n\t\t\tpdf_array_push(color_obj, pdf_new_real(doc, color[i]));\n\t\tpdf_dict_puts_drop(smask, \"BC\", color_obj);\n\t\tcolor_obj = NULL;\n\n\t\tegs = pdf_new_dict(doc, 5);\n\t\tpdf_dict_puts_drop(egs, \"Type\", pdf_new_name(doc, \"ExtGState\"));\n\t\tpdf_dict_puts_drop(egs, \"SMask\", pdf_new_ref(doc, smask));\n\t\tegs_ref = pdf_new_ref(doc, egs);\n\n\t\t{\n\t\t\tchar text[32];\n\t\t\tsnprintf(text, sizeof(text), \"ExtGState/SM%d\", pdev->num_smasks++);\n\t\t\tpdf_dict_putp(pdev->resources, text, egs_ref);\n\t\t\tpdf_drop_obj(egs_ref);\n\t\t}\n\t\tgs = CURRENT_GSTATE(pdev);\n\t\tfz_buffer_printf(dev->ctx, gs->buf, \"/SM%d gs\\n\", pdev->num_smasks-1);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(smask);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_obj(form_ref);\n\t\tpdf_drop_obj(color_obj);\n\t\tfz_rethrow(ctx);\n\t}\n\n\t/* Now, everything we get until the end_mask needs to go into a\n\t * new buffer, which will be the stream contents for the form. */\n\tpdf_dev_push_new_buf(pdev, fz_new_buffer(ctx, 1024), NULL, form_ref);\n}\n\nstatic void\npdf_dev_end_mask(fz_device *dev)\n{\n\tpdf_device *pdev = (pdf_device *)dev->user;\n\tpdf_document *doc = pdev->doc;\n\tfz_context *ctx = pdev->ctx;\n\tgstate *gs = CURRENT_GSTATE(pdev);\n\tfz_buffer *buf = fz_keep_buffer(ctx, gs->buf);\n\tpdf_obj *form_ref = (pdf_obj *)gs->on_pop_arg;\n\n\t/* Here we do part of the pop, but not all of it. */\n\tpdf_dev_end_text(pdev);\n\tfz_buffer_printf(ctx, buf, \"Q\\n\");\n\tpdf_dict_puts_drop(form_ref, \"Length\", pdf_new_int(doc, buf->len));\n\tpdf_update_stream(doc, pdf_to_num(form_ref), buf);\n\tfz_drop_buffer(ctx, buf);\n\tgs->buf = fz_keep_buffer(ctx, gs[-1].buf);\n\tgs->on_pop_arg = NULL;\n\tpdf_drop_obj(form_ref);\n\tfz_buffer_printf(ctx, gs->buf, \"q\\n\");\n}\n\nstatic void\npdf_dev_begin_group(fz_device *dev, const fz_rect *bbox, int isolated, int knockout, int blendmode, float alpha)\n{\n\tpdf_device *pdev = (pdf_device *)dev->user;\n\tfz_context *ctx = pdev->ctx;\n\tpdf_document *doc = pdev->doc;\n\tint num;\n\tpdf_obj *form_ref;\n\tgstate *gs;\n\n\tpdf_dev_end_text(pdev);\n\n\tnum = pdf_dev_new_form(&form_ref, pdev, bbox, isolated, knockout, alpha, NULL);\n\n\t/* Do we have an appropriate blending extgstate already? */\n\t{\n\t\tchar text[32];\n\t\tpdf_obj *obj;\n\t\tsnprintf(text, sizeof(text), \"ExtGState/BlendMode%d\", blendmode);\n\t\tobj = pdf_dict_getp(pdev->resources, text);\n\t\tif (obj == NULL)\n\t\t{\n\t\t\t/* No, better make one */\n\t\t\tobj = pdf_new_dict(pdev->doc, 2);\n\t\t\tpdf_dict_puts_drop(obj, \"Type\", pdf_new_name(doc, \"ExtGState\"));\n\t\t\tpdf_dict_puts_drop(obj, \"BM\", pdf_new_name(doc, fz_blendmode_name(blendmode)));\n\t\t\tpdf_dict_putp_drop(pdev->resources, text, obj);\n\t\t}\n\t}\n\n\t/* Add the call to this group */\n\tgs = CURRENT_GSTATE(pdev);\n\tfz_buffer_printf(dev->ctx, gs->buf, \"/BlendMode%d gs /Fm%d Do\\n\", blendmode, num);\n\n\t/* Now, everything we get until the end of group needs to go into a\n\t * new buffer, which will be the stream contents for the form. */\n\tpdf_dev_push_new_buf(pdev, fz_new_buffer(ctx, 1024), NULL, form_ref);\n}\n\nstatic void\npdf_dev_end_group(fz_device *dev)\n{\n\tpdf_device *pdev = (pdf_device *)dev->user;\n\tpdf_document *doc = pdev->doc;\n\tgstate *gs = CURRENT_GSTATE(pdev);\n\tfz_context *ctx = pdev->ctx;\n\tfz_buffer *buf = fz_keep_buffer(ctx, gs->buf);\n\tpdf_obj *form_ref;\n\n\tpdf_dev_end_text(pdev);\n\tform_ref = (pdf_obj *)pdf_dev_pop(pdev);\n\tpdf_dict_puts_drop(form_ref, \"Length\", pdf_new_int(doc, gs->buf->len));\n\tpdf_update_stream(doc, pdf_to_num(form_ref), buf);\n\tfz_drop_buffer(ctx, buf);\n\tpdf_drop_obj(form_ref);\n}\n\nstatic int\npdf_dev_begin_tile(fz_device *dev, const fz_rect *area, const fz_rect *view, float xstep, float ystep, const fz_matrix *ctm, int id)\n{\n\tpdf_device *pdev = (pdf_device *)dev->user;\n\n\t/* FIXME */\n\tpdf_dev_end_text(pdev);\n\treturn 0;\n}\n\nstatic void\npdf_dev_end_tile(fz_device *dev)\n{\n\tpdf_device *pdev = (pdf_device *)dev->user;\n\n\t/* FIXME */\n\tpdf_dev_end_text(pdev);\n}\n\nstatic void\npdf_dev_free_user(fz_device *dev)\n{\n\tpdf_device *pdev = dev->user;\n\tpdf_document *doc = pdev->doc;\n\tfz_context *ctx = pdev->ctx;\n\tgstate *gs = CURRENT_GSTATE(pdev);\n\tint i;\n\n\tpdf_dev_end_text(pdev);\n\n\tpdf_dict_puts_drop(pdev->contents, \"Length\", pdf_new_int(doc, gs->buf->len));\n\n\tfor (i = pdev->num_gstates-1; i >= 0; i--)\n\t{\n\t\tfz_drop_stroke_state(ctx, pdev->gstates[i].stroke_state);\n\t}\n\n\tfor (i = pdev->num_fonts-1; i >= 0; i--)\n\t{\n\t\tfz_drop_font(ctx, pdev->fonts[i].font);\n\t}\n\n\tfor (i = pdev->num_imgs-1; i >= 0; i--)\n\t{\n\t\tpdf_drop_obj(pdev->images[i].ref);\n\t}\n\n\tpdf_update_stream(doc, pdf_to_num(pdev->contents), pdev->gstates[0].buf);\n\tfz_drop_buffer(ctx, pdev->gstates[0].buf);\n\n\tpdf_drop_obj(pdev->contents);\n\tpdf_drop_obj(pdev->resources);\n\n\tfz_free(ctx, pdev->images);\n\tfz_free(ctx, pdev->alphas);\n\tfz_free(ctx, pdev->gstates);\n\tfz_free(ctx, pdev);\n}\n\nstatic void\npdf_dev_rebind(fz_device *dev)\n{\n\tpdf_device *pdev = dev->user;\n\n\t/* SumatraPDF: prevent dependency on fitz/document.c */\n\tif (pdev->doc && pdev->doc->super.rebind)\n\t\tpdev->doc->super.rebind(&pdev->doc->super, dev->ctx);\n}\n\nfz_device *pdf_new_pdf_device(pdf_document *doc, pdf_obj *contents, pdf_obj *resources, const fz_matrix *ctm)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_device *pdev = fz_malloc_struct(ctx, pdf_device);\n\tfz_device *dev;\n\n\tfz_try(ctx)\n\t{\n\t\tpdev->ctx = ctx;\n\t\tpdev->doc = doc;\n\t\tpdev->contents = pdf_keep_obj(contents);\n\t\tpdev->resources = pdf_keep_obj(resources);\n\t\tpdev->gstates = fz_malloc_struct(ctx, gstate);\n\t\tpdev->gstates[0].buf = fz_new_buffer(ctx, 256);\n\t\tpdev->gstates[0].ctm = *ctm;\n\t\tpdev->gstates[0].colorspace[0] = fz_device_gray(ctx);\n\t\tpdev->gstates[0].colorspace[1] = fz_device_gray(ctx);\n\t\tpdev->gstates[0].color[0][0] = 1;\n\t\tpdev->gstates[0].color[1][0] = 1;\n\t\tpdev->gstates[0].alpha[0] = 1.0;\n\t\tpdev->gstates[0].alpha[1] = 1.0;\n\t\tpdev->gstates[0].font = -1;\n\t\tpdev->gstates[0].horizontal_scaling = 100;\n\t\tpdev->num_gstates = 1;\n\t\tpdev->max_gstates = 1;\n\n\t\tdev = fz_new_device(ctx, pdev);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tif (pdev->gstates)\n\t\t\tfz_drop_buffer(ctx, pdev->gstates[0].buf);\n\t\tfz_free(ctx, pdev);\n\t\tfz_rethrow(ctx);\n\t}\n\n\tdev->rebind = pdf_dev_rebind;\n\tdev->free_user = pdf_dev_free_user;\n\n\tdev->fill_path = pdf_dev_fill_path;\n\tdev->stroke_path = pdf_dev_stroke_path;\n\tdev->clip_path = pdf_dev_clip_path;\n\tdev->clip_stroke_path = pdf_dev_clip_stroke_path;\n\n\tdev->fill_text = pdf_dev_fill_text;\n\tdev->stroke_text = pdf_dev_stroke_text;\n\tdev->clip_text = pdf_dev_clip_text;\n\tdev->clip_stroke_text = pdf_dev_clip_stroke_text;\n\tdev->ignore_text = pdf_dev_ignore_text;\n\n\tdev->fill_shade = pdf_dev_fill_shade;\n\tdev->fill_image = pdf_dev_fill_image;\n\tdev->fill_image_mask = pdf_dev_fill_image_mask;\n\tdev->clip_image_mask = pdf_dev_clip_image_mask;\n\n\tdev->pop_clip = pdf_dev_pop_clip;\n\n\tdev->begin_mask = pdf_dev_begin_mask;\n\tdev->end_mask = pdf_dev_end_mask;\n\tdev->begin_group = pdf_dev_begin_group;\n\tdev->end_group = pdf_dev_end_group;\n\n\tdev->begin_tile = pdf_dev_begin_tile;\n\tdev->end_tile = pdf_dev_end_tile;\n\n\treturn dev;\n}\n\nfz_device *pdf_page_write(pdf_document *doc, pdf_page *page)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *resources = pdf_dict_gets(page->me, \"Resources\");\n\tfz_matrix ctm;\n\tfz_pre_translate(fz_scale(&ctm, 1, -1), 0, page->mediabox.y0-page->mediabox.y1);\n\n\tif (resources == NULL)\n\t{\n\t\tresources = pdf_new_dict(doc, 0);\n\t\tpdf_dict_puts_drop(page->me, \"Resources\", resources);\n\t}\n\n\tif (page->contents == NULL)\n\t{\n\t\tpdf_obj *obj = pdf_new_dict(doc, 0);\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tpage->contents = pdf_new_ref(doc, obj);\n\t\t\tpdf_dict_puts(page->me, \"Contents\", page->contents);\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tpdf_drop_obj(obj);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t}\n\n\treturn pdf_new_pdf_device(doc, page->contents, resources, &ctm);\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-encoding.c",
    "content": "#include \"mupdf/pdf.h\"\n\n#include \"pdf-encodings.h\"\n#include \"pdf-glyphlist.h\"\n\nvoid\npdf_load_encoding(char **estrings, char *encoding)\n{\n\tchar **bstrings = NULL;\n\tint i;\n\n\tif (!strcmp(encoding, \"StandardEncoding\"))\n\t\tbstrings = (char**) pdf_standard;\n\tif (!strcmp(encoding, \"MacRomanEncoding\"))\n\t\tbstrings = (char**) pdf_mac_roman;\n\tif (!strcmp(encoding, \"MacExpertEncoding\"))\n\t\tbstrings = (char**) pdf_mac_expert;\n\tif (!strcmp(encoding, \"WinAnsiEncoding\"))\n\t\tbstrings = (char**) pdf_win_ansi;\n\n\tif (bstrings)\n\t\tfor (i = 0; i < 256; i++)\n\t\t\testrings[i] = bstrings[i];\n}\n\nint\npdf_lookup_agl(char *name)\n{\n\tchar buf[64];\n\tchar *p;\n\tint l = 0;\n\tint r = nelem(agl_name_list) - 1;\n\n\tfz_strlcpy(buf, name, sizeof buf);\n\n\t/* kill anything after first period and underscore */\n\tp = strchr(buf, '.');\n\tif (p) p[0] = 0;\n\tp = strchr(buf, '_');\n\tif (p) p[0] = 0;\n\n\twhile (l <= r)\n\t{\n\t\tint m = (l + r) >> 1;\n\t\tint c = strcmp(buf, agl_name_list[m]);\n\t\tif (c < 0)\n\t\t\tr = m - 1;\n\t\telse if (c > 0)\n\t\t\tl = m + 1;\n\t\telse\n\t\t\treturn agl_code_list[m];\n\t}\n\n\t/* cf. http://bugs.ghostscript.com/show_bug.cgi?id=696012 */\n\tif (strstr(buf, \"uni\") == buf)\n\t\treturn fz_clampi(strtol(buf + 3, NULL, 16), 0, 0x10ffff);\n\telse if (strstr(buf, \"u\") == buf)\n\t\treturn fz_clampi(strtol(buf + 1, NULL, 16), 0, 0x10ffff);\n\telse if (strstr(buf, \"a\") == buf && strlen(buf) >= 3)\n\t\treturn fz_clampi(strtol(buf + 1, NULL, 10), 0, 0x10ffff);\n\n\treturn 0;\n}\n\nstatic const char *empty_dup_list[] = { 0 };\n\nconst char **\npdf_lookup_agl_duplicates(int ucs)\n{\n\tint l = 0;\n\tint r = nelem(agl_dup_offsets) / 2 - 1;\n\twhile (l <= r)\n\t{\n\t\tint m = (l + r) >> 1;\n\t\tif (ucs < agl_dup_offsets[m << 1])\n\t\t\tr = m - 1;\n\t\telse if (ucs > agl_dup_offsets[m << 1])\n\t\t\tl = m + 1;\n\t\telse\n\t\t\treturn agl_dup_names + agl_dup_offsets[(m << 1) + 1];\n\t}\n\treturn empty_dup_list;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-encodings.h",
    "content": "#define _notdef NULL\n\nconst unsigned short pdf_doc_encoding[256] =\n{\n\t/* 0x0 to 0x17 except \\t, \\n and \\r are really undefined */\n\t0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,\n\t0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,\n\t0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,\n\t0x02d8, 0x02c7, 0x02c6, 0x02d9, 0x02dd, 0x02db, 0x02da, 0x02dc,\n\t0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,\n\t0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,\n\t0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,\n\t0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,\n\t0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,\n\t0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,\n\t0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,\n\t0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f,\n\t0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067,\n\t0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,\n\t0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,\n\t0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x0000,\n\t0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x0192, 0x2044,\n\t0x2039, 0x203a, 0x2212, 0x2030, 0x201e, 0x201c, 0x201d, 0x2018,\n\t0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x0141, 0x0152, 0x0160,\n\t0x0178, 0x017d, 0x0131, 0x0142, 0x0153, 0x0161, 0x017e, 0x0000,\n\t0x20ac, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7,\n\t0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x0000, 0x00ae, 0x00af,\n\t0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7,\n\t0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf,\n\t0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7,\n\t0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,\n\t0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7,\n\t0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df,\n\t0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,\n\t0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,\n\t0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7,\n\t0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff\n};\n\nconst char * const pdf_standard[256] = { _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t\"space\", \"exclam\", \"quotedbl\", \"numbersign\", \"dollar\", \"percent\",\n\t\"ampersand\", \"quoteright\", \"parenleft\", \"parenright\", \"asterisk\",\n\t\"plus\", \"comma\", \"hyphen\", \"period\", \"slash\", \"zero\", \"one\", \"two\",\n\t\"three\", \"four\", \"five\", \"six\", \"seven\", \"eight\", \"nine\", \"colon\",\n\t\"semicolon\", \"less\", \"equal\", \"greater\", \"question\", \"at\", \"A\",\n\t\"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\",\n\t\"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\",\n\t\"bracketleft\", \"backslash\", \"bracketright\", \"asciicircum\", \"underscore\",\n\t\"quoteleft\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\",\n\t\"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\",\n\t\"y\", \"z\", \"braceleft\", \"bar\", \"braceright\", \"asciitilde\", _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, \"exclamdown\", \"cent\", \"sterling\",\n\t\"fraction\", \"yen\", \"florin\", \"section\", \"currency\", \"quotesingle\",\n\t\"quotedblleft\", \"guillemotleft\", \"guilsinglleft\", \"guilsinglright\",\n\t\"fi\", \"fl\", _notdef, \"endash\", \"dagger\", \"daggerdbl\", \"periodcentered\",\n\t_notdef, \"paragraph\", \"bullet\", \"quotesinglbase\", \"quotedblbase\",\n\t\"quotedblright\", \"guillemotright\", \"ellipsis\", \"perthousand\",\n\t_notdef, \"questiondown\", _notdef, \"grave\", \"acute\", \"circumflex\",\n\t\"tilde\", \"macron\", \"breve\", \"dotaccent\", \"dieresis\", _notdef,\n\t\"ring\", \"cedilla\", _notdef, \"hungarumlaut\", \"ogonek\", \"caron\",\n\t\"emdash\", _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, \"AE\",\n\t_notdef, \"ordfeminine\", _notdef, _notdef, _notdef, _notdef,\n\t\"Lslash\", \"Oslash\", \"OE\", \"ordmasculine\", _notdef, _notdef,\n\t_notdef, _notdef, _notdef, \"ae\", _notdef, _notdef,\n\t_notdef, \"dotlessi\", _notdef, _notdef, \"lslash\", \"oslash\",\n\t\"oe\", \"germandbls\", _notdef, _notdef, _notdef, _notdef\n};\n\nconst char * const pdf_mac_roman[256] = { _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t\"space\", \"exclam\", \"quotedbl\", \"numbersign\", \"dollar\", \"percent\",\n\t\"ampersand\", \"quotesingle\", \"parenleft\", \"parenright\", \"asterisk\",\n\t\"plus\", \"comma\", \"hyphen\", \"period\", \"slash\", \"zero\", \"one\", \"two\",\n\t\"three\", \"four\", \"five\", \"six\", \"seven\", \"eight\", \"nine\", \"colon\",\n\t\"semicolon\", \"less\", \"equal\", \"greater\", \"question\", \"at\", \"A\",\n\t\"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\",\n\t\"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\",\n\t\"bracketleft\", \"backslash\", \"bracketright\", \"asciicircum\", \"underscore\",\n\t\"grave\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\",\n\t\"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\",\n\t\"y\", \"z\", \"braceleft\", \"bar\", \"braceright\", \"asciitilde\", _notdef,\n\t\"Adieresis\", \"Aring\", \"Ccedilla\", \"Eacute\", \"Ntilde\", \"Odieresis\",\n\t\"Udieresis\", \"aacute\", \"agrave\", \"acircumflex\", \"adieresis\", \"atilde\",\n\t\"aring\", \"ccedilla\", \"eacute\", \"egrave\", \"ecircumflex\", \"edieresis\",\n\t\"iacute\", \"igrave\", \"icircumflex\", \"idieresis\", \"ntilde\", \"oacute\",\n\t\"ograve\", \"ocircumflex\", \"odieresis\", \"otilde\", \"uacute\", \"ugrave\",\n\t\"ucircumflex\", \"udieresis\", \"dagger\", \"degree\", \"cent\", \"sterling\",\n\t\"section\", \"bullet\", \"paragraph\", \"germandbls\", \"registered\",\n\t\"copyright\", \"trademark\", \"acute\", \"dieresis\", _notdef, \"AE\",\n\t\"Oslash\", _notdef, \"plusminus\", _notdef, _notdef, \"yen\", \"mu\",\n\t_notdef, _notdef, _notdef, _notdef, _notdef, \"ordfeminine\",\n\t\"ordmasculine\", _notdef, \"ae\", \"oslash\", \"questiondown\", \"exclamdown\",\n\t\"logicalnot\", _notdef, \"florin\", _notdef, _notdef, \"guillemotleft\",\n\t\"guillemotright\", \"ellipsis\", \"space\", \"Agrave\", \"Atilde\", \"Otilde\",\n\t\"OE\", \"oe\", \"endash\", \"emdash\", \"quotedblleft\", \"quotedblright\",\n\t\"quoteleft\", \"quoteright\", \"divide\", _notdef, \"ydieresis\",\n\t\"Ydieresis\", \"fraction\", \"currency\", \"guilsinglleft\", \"guilsinglright\",\n\t\"fi\", \"fl\", \"daggerdbl\", \"periodcentered\", \"quotesinglbase\",\n\t\"quotedblbase\", \"perthousand\", \"Acircumflex\", \"Ecircumflex\", \"Aacute\",\n\t\"Edieresis\", \"Egrave\", \"Iacute\", \"Icircumflex\", \"Idieresis\", \"Igrave\",\n\t\"Oacute\", \"Ocircumflex\", _notdef, \"Ograve\", \"Uacute\", \"Ucircumflex\",\n\t\"Ugrave\", \"dotlessi\", \"circumflex\", \"tilde\", \"macron\", \"breve\",\n\t\"dotaccent\", \"ring\", \"cedilla\", \"hungarumlaut\", \"ogonek\", \"caron\"\n};\n\nconst char * const pdf_mac_expert[256] = { _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t\"space\", \"exclamsmall\", \"Hungarumlautsmall\", \"centoldstyle\",\n\t\"dollaroldstyle\", \"dollarsuperior\", \"ampersandsmall\", \"Acutesmall\",\n\t\"parenleftsuperior\", \"parenrightsuperior\", \"twodotenleader\",\n\t\"onedotenleader\", \"comma\", \"hyphen\", \"period\", \"fraction\",\n\t\"zerooldstyle\", \"oneoldstyle\", \"twooldstyle\", \"threeoldstyle\",\n\t\"fouroldstyle\", \"fiveoldstyle\", \"sixoldstyle\", \"sevenoldstyle\",\n\t\"eightoldstyle\", \"nineoldstyle\", \"colon\", \"semicolon\", _notdef,\n\t\"threequartersemdash\", _notdef, \"questionsmall\", _notdef,\n\t_notdef, _notdef, _notdef, \"Ethsmall\", _notdef, _notdef,\n\t\"onequarter\", \"onehalf\", \"threequarters\", \"oneeighth\", \"threeeighths\",\n\t\"fiveeighths\", \"seveneighths\", \"onethird\", \"twothirds\", _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, \"ff\", \"fi\",\n\t\"fl\", \"ffi\", \"ffl\", \"parenleftinferior\", _notdef, \"parenrightinferior\",\n\t\"Circumflexsmall\", \"hypheninferior\", \"Gravesmall\", \"Asmall\", \"Bsmall\",\n\t\"Csmall\", \"Dsmall\", \"Esmall\", \"Fsmall\", \"Gsmall\", \"Hsmall\", \"Ismall\",\n\t\"Jsmall\", \"Ksmall\", \"Lsmall\", \"Msmall\", \"Nsmall\", \"Osmall\", \"Psmall\",\n\t\"Qsmall\", \"Rsmall\", \"Ssmall\", \"Tsmall\", \"Usmall\", \"Vsmall\", \"Wsmall\",\n\t\"Xsmall\", \"Ysmall\", \"Zsmall\", \"colonmonetary\", \"onefitted\", \"rupiah\",\n\t\"Tildesmall\", _notdef, _notdef, \"asuperior\", \"centsuperior\",\n\t_notdef, _notdef, _notdef, _notdef, \"Aacutesmall\",\n\t\"Agravesmall\", \"Acircumflexsmall\", \"Adieresissmall\", \"Atildesmall\",\n\t\"Aringsmall\", \"Ccedillasmall\", \"Eacutesmall\", \"Egravesmall\",\n\t\"Ecircumflexsmall\", \"Edieresissmall\", \"Iacutesmall\", \"Igravesmall\",\n\t\"Icircumflexsmall\", \"Idieresissmall\", \"Ntildesmall\", \"Oacutesmall\",\n\t\"Ogravesmall\", \"Ocircumflexsmall\", \"Odieresissmall\", \"Otildesmall\",\n\t\"Uacutesmall\", \"Ugravesmall\", \"Ucircumflexsmall\", \"Udieresissmall\",\n\t_notdef, \"eightsuperior\", \"fourinferior\", \"threeinferior\",\n\t\"sixinferior\", \"eightinferior\", \"seveninferior\", \"Scaronsmall\",\n\t_notdef, \"centinferior\", \"twoinferior\", _notdef, \"Dieresissmall\",\n\t_notdef, \"Caronsmall\", \"osuperior\", \"fiveinferior\", _notdef,\n\t\"commainferior\", \"periodinferior\", \"Yacutesmall\", _notdef,\n\t\"dollarinferior\", _notdef, _notdef, \"Thornsmall\", _notdef,\n\t\"nineinferior\", \"zeroinferior\", \"Zcaronsmall\", \"AEsmall\", \"Oslashsmall\",\n\t\"questiondownsmall\", \"oneinferior\", \"Lslashsmall\", _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, \"Cedillasmall\",\n\t_notdef, _notdef, _notdef, _notdef, _notdef, \"OEsmall\",\n\t\"figuredash\", \"hyphensuperior\", _notdef, _notdef, _notdef,\n\t_notdef, \"exclamdownsmall\", _notdef, \"Ydieresissmall\", _notdef,\n\t\"onesuperior\", \"twosuperior\", \"threesuperior\", \"foursuperior\",\n\t\"fivesuperior\", \"sixsuperior\", \"sevensuperior\", \"ninesuperior\",\n\t\"zerosuperior\", _notdef, \"esuperior\", \"rsuperior\", \"tsuperior\",\n\t_notdef, _notdef, \"isuperior\", \"ssuperior\", \"dsuperior\",\n\t_notdef, _notdef, _notdef, _notdef, _notdef, \"lsuperior\",\n\t\"Ogoneksmall\", \"Brevesmall\", \"Macronsmall\", \"bsuperior\", \"nsuperior\",\n\t\"msuperior\", \"commasuperior\", \"periodsuperior\", \"Dotaccentsmall\",\n\t\"Ringsmall\", _notdef, _notdef, _notdef, _notdef };\n\nconst char * const pdf_win_ansi[256] = { _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, _notdef,\n\t_notdef, _notdef, _notdef, _notdef, _notdef, \"space\",\n\t\"exclam\", \"quotedbl\", \"numbersign\", \"dollar\", \"percent\", \"ampersand\",\n\t\"quotesingle\", \"parenleft\", \"parenright\", \"asterisk\", \"plus\",\n\t\"comma\", \"hyphen\", \"period\", \"slash\", \"zero\", \"one\", \"two\", \"three\",\n\t\"four\", \"five\", \"six\", \"seven\", \"eight\", \"nine\", \"colon\", \"semicolon\",\n\t\"less\", \"equal\", \"greater\", \"question\", \"at\", \"A\", \"B\", \"C\", \"D\",\n\t\"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\",\n\t\"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\", \"bracketleft\",\n\t\"backslash\", \"bracketright\", \"asciicircum\", \"underscore\", \"grave\",\n\t\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\",\n\t\"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\",\n\t\"braceleft\", \"bar\", \"braceright\", \"asciitilde\", \"bullet\", \"Euro\",\n\t\"bullet\", \"quotesinglbase\", \"florin\", \"quotedblbase\", \"ellipsis\",\n\t\"dagger\", \"daggerdbl\", \"circumflex\", \"perthousand\", \"Scaron\",\n\t\"guilsinglleft\", \"OE\", \"bullet\", \"Zcaron\", \"bullet\", \"bullet\",\n\t\"quoteleft\", \"quoteright\", \"quotedblleft\", \"quotedblright\", \"bullet\",\n\t\"endash\", \"emdash\", \"tilde\", \"trademark\", \"scaron\", \"guilsinglright\",\n\t\"oe\", \"bullet\", \"zcaron\", \"Ydieresis\", \"space\", \"exclamdown\", \"cent\",\n\t\"sterling\", \"currency\", \"yen\", \"brokenbar\", \"section\", \"dieresis\",\n\t\"copyright\", \"ordfeminine\", \"guillemotleft\", \"logicalnot\", \"hyphen\",\n\t\"registered\", \"macron\", \"degree\", \"plusminus\", \"twosuperior\",\n\t\"threesuperior\", \"acute\", \"mu\", \"paragraph\", \"periodcentered\",\n\t\"cedilla\", \"onesuperior\", \"ordmasculine\", \"guillemotright\",\n\t\"onequarter\", \"onehalf\", \"threequarters\", \"questiondown\", \"Agrave\",\n\t\"Aacute\", \"Acircumflex\", \"Atilde\", \"Adieresis\", \"Aring\", \"AE\",\n\t\"Ccedilla\", \"Egrave\", \"Eacute\", \"Ecircumflex\", \"Edieresis\", \"Igrave\",\n\t\"Iacute\", \"Icircumflex\", \"Idieresis\", \"Eth\", \"Ntilde\", \"Ograve\",\n\t\"Oacute\", \"Ocircumflex\", \"Otilde\", \"Odieresis\", \"multiply\", \"Oslash\",\n\t\"Ugrave\", \"Uacute\", \"Ucircumflex\", \"Udieresis\", \"Yacute\", \"Thorn\",\n\t\"germandbls\", \"agrave\", \"aacute\", \"acircumflex\", \"atilde\", \"adieresis\",\n\t\"aring\", \"ae\", \"ccedilla\", \"egrave\", \"eacute\", \"ecircumflex\",\n\t\"edieresis\", \"igrave\", \"iacute\", \"icircumflex\", \"idieresis\", \"eth\",\n\t\"ntilde\", \"ograve\", \"oacute\", \"ocircumflex\", \"otilde\", \"odieresis\",\n\t\"divide\", \"oslash\", \"ugrave\", \"uacute\", \"ucircumflex\", \"udieresis\",\n\t\"yacute\", \"thorn\", \"ydieresis\"\n};\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-event.c",
    "content": "#include \"mupdf/fitz.h\"\n#include \"mupdf/pdf.h\"\n\ntypedef struct\n{\n\tpdf_doc_event base;\n\tpdf_alert_event alert;\n} pdf_alert_event_internal;\n\npdf_alert_event *pdf_access_alert_event(pdf_doc_event *event)\n{\n\tpdf_alert_event *alert = NULL;\n\n\tif (event->type == PDF_DOCUMENT_EVENT_ALERT)\n\t\talert = &((pdf_alert_event_internal *)event)->alert;\n\n\treturn alert;\n}\n\nvoid pdf_event_issue_alert(pdf_document *doc, pdf_alert_event *alert)\n{\n\tif (doc->event_cb)\n\t{\n\t\tpdf_alert_event_internal ievent;\n\t\tievent.base.type = PDF_DOCUMENT_EVENT_ALERT;\n\t\tievent.alert = *alert;\n\n\t\tdoc->event_cb((pdf_doc_event *)&ievent, doc->event_cb_data);\n\n\t\t*alert = ievent.alert;\n\t}\n}\n\nvoid pdf_event_issue_print(pdf_document *doc)\n{\n\tpdf_doc_event e;\n\n\te.type = PDF_DOCUMENT_EVENT_PRINT;\n\n\tif (doc->event_cb)\n\t\tdoc->event_cb(&e, doc->event_cb_data);\n}\n\ntypedef struct\n{\n\tpdf_doc_event base;\n\tchar *item;\n} pdf_exec_menu_item_event_internal;\n\nchar *pdf_access_exec_menu_item_event(pdf_doc_event *event)\n{\n\tchar *item = NULL;\n\n\tif (event->type == PDF_DOCUMENT_EVENT_EXEC_MENU_ITEM)\n\t\titem = ((pdf_exec_menu_item_event_internal *)event)->item;\n\n\treturn item;\n}\n\nvoid pdf_event_issue_exec_menu_item(pdf_document *doc, char *item)\n{\n\tif (doc->event_cb)\n\t{\n\t\tpdf_exec_menu_item_event_internal ievent;\n\t\tievent.base.type = PDF_DOCUMENT_EVENT_EXEC_MENU_ITEM;\n\t\tievent.item = item;\n\n\t\tdoc->event_cb((pdf_doc_event *)&ievent, doc->event_cb_data);\n\t}\n}\n\nvoid pdf_event_issue_exec_dialog(pdf_document *doc)\n{\n\tpdf_doc_event e;\n\n\te.type = PDF_DOCUMENT_EVENT_EXEC_DIALOG;\n\n\tif (doc->event_cb)\n\t\tdoc->event_cb(&e, doc->event_cb_data);\n}\n\ntypedef struct\n{\n\tpdf_doc_event base;\n\tpdf_launch_url_event launch_url;\n} pdf_launch_url_event_internal;\n\npdf_launch_url_event *pdf_access_launch_url_event(pdf_doc_event *event)\n{\n\tpdf_launch_url_event *launch_url = NULL;\n\n\tif (event->type == PDF_DOCUMENT_EVENT_LAUNCH_URL)\n\t\tlaunch_url = &((pdf_launch_url_event_internal *)event)->launch_url;\n\n\treturn launch_url;\n}\n\nvoid pdf_event_issue_launch_url(pdf_document *doc, char *url, int new_frame)\n{\n\tif (doc->event_cb)\n\t{\n\t\tpdf_launch_url_event_internal e;\n\n\t\te.base.type = PDF_DOCUMENT_EVENT_LAUNCH_URL;\n\t\te.launch_url.url = url;\n\t\te.launch_url.new_frame = new_frame;\n\t\tdoc->event_cb((pdf_doc_event *)&e, doc->event_cb_data);\n\t}\n}\n\ntypedef struct\n{\n\tpdf_doc_event base;\n\tpdf_mail_doc_event mail_doc;\n} pdf_mail_doc_event_internal;\n\npdf_mail_doc_event *pdf_access_mail_doc_event(pdf_doc_event *event)\n{\n\tpdf_mail_doc_event *mail_doc = NULL;\n\n\tif (event->type == PDF_DOCUMENT_EVENT_MAIL_DOC)\n\t\tmail_doc = &((pdf_mail_doc_event_internal *)event)->mail_doc;\n\n\treturn mail_doc;\n}\n\nvoid pdf_event_issue_mail_doc(pdf_document *doc, pdf_mail_doc_event *event)\n{\n\tif (doc->event_cb)\n\t{\n\t\tpdf_mail_doc_event_internal e;\n\n\t\te.base.type = PDF_DOCUMENT_EVENT_MAIL_DOC;\n\t\te.mail_doc = *event;\n\n\t\tdoc->event_cb((pdf_doc_event *)&e, doc->event_cb_data);\n\t}\n}\n\nvoid pdf_set_doc_event_callback(pdf_document *doc, pdf_doc_event_cb *fn, void *data)\n{\n\tdoc->event_cb = fn;\n\tdoc->event_cb_data = data;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-field.c",
    "content": "#include \"mupdf/pdf.h\"\n\npdf_obj *pdf_get_inheritable(pdf_document *doc, pdf_obj *obj, char *key)\n{\n\tpdf_obj *fobj = NULL;\n\n\twhile (!fobj && obj)\n\t{\n\t\tfobj = pdf_dict_gets(obj, key);\n\n\t\tif (!fobj)\n\t\t\tobj = pdf_dict_gets(obj, \"Parent\");\n\t}\n\n\treturn fobj ? fobj : pdf_dict_gets(pdf_dict_gets(pdf_dict_gets(pdf_trailer(doc), \"Root\"), \"AcroForm\"), key);\n}\n\nchar *pdf_get_string_or_stream(pdf_document *doc, pdf_obj *obj)\n{\n\tfz_context *ctx = doc->ctx;\n\tint len = 0;\n\tchar *buf = NULL;\n\tfz_buffer *strmbuf = NULL;\n\tchar *text = NULL;\n\n\tfz_var(strmbuf);\n\tfz_var(text);\n\tfz_try(ctx)\n\t{\n\t\tif (pdf_is_string(obj))\n\t\t{\n\t\t\tlen = pdf_to_str_len(obj);\n\t\t\tbuf = pdf_to_str_buf(obj);\n\t\t}\n\t\telse if (pdf_is_stream(doc, pdf_to_num(obj), pdf_to_gen(obj)))\n\t\t{\n\t\t\tstrmbuf = pdf_load_stream(doc, pdf_to_num(obj), pdf_to_gen(obj));\n\t\t\tlen = fz_buffer_storage(ctx, strmbuf, (unsigned char **)&buf);\n\t\t}\n\n\t\tif (buf)\n\t\t{\n\t\t\ttext = fz_malloc(ctx, len+1);\n\t\t\tmemcpy(text, buf, len);\n\t\t\ttext[len] = 0;\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, strmbuf);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, text);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn text;\n}\n\nchar *pdf_field_value(pdf_document *doc, pdf_obj *field)\n{\n\treturn pdf_get_string_or_stream(doc, pdf_get_inheritable(doc, field, \"V\"));\n}\n\nint pdf_get_field_flags(pdf_document *doc, pdf_obj *obj)\n{\n\treturn pdf_to_int(pdf_get_inheritable(doc, obj, \"Ff\"));\n}\n\nstatic char *get_field_type_name(pdf_document *doc, pdf_obj *obj)\n{\n\treturn pdf_to_name(pdf_get_inheritable(doc, obj, \"FT\"));\n}\n\nint pdf_field_type(pdf_document *doc, pdf_obj *obj)\n{\n\tchar *type = get_field_type_name(doc, obj);\n\tint flags = pdf_get_field_flags(doc, obj);\n\n\tif (!strcmp(type, \"Btn\"))\n\t{\n\t\tif (flags & Ff_Pushbutton)\n\t\t\treturn PDF_WIDGET_TYPE_PUSHBUTTON;\n\t\telse if (flags & Ff_Radio)\n\t\t\treturn PDF_WIDGET_TYPE_RADIOBUTTON;\n\t\telse\n\t\t\treturn PDF_WIDGET_TYPE_CHECKBOX;\n\t}\n\telse if (!strcmp(type, \"Tx\"))\n\t\treturn PDF_WIDGET_TYPE_TEXT;\n\telse if (!strcmp(type, \"Ch\"))\n\t{\n\t\tif (flags & Ff_Combo)\n\t\t\treturn PDF_WIDGET_TYPE_COMBOBOX;\n\t\telse\n\t\t\treturn PDF_WIDGET_TYPE_LISTBOX;\n\t}\n\telse if (!strcmp(type, \"Sig\"))\n\t\treturn PDF_WIDGET_TYPE_SIGNATURE;\n\telse\n\t\treturn PDF_WIDGET_TYPE_NOT_WIDGET;\n}\n\nvoid pdf_set_field_type(pdf_document *doc, pdf_obj *obj, int type)\n{\n\tint setbits = 0;\n\tint clearbits = 0;\n\tchar *typename = NULL;\n\n\tswitch(type)\n\t{\n\tcase PDF_WIDGET_TYPE_PUSHBUTTON:\n\t\ttypename = \"Btn\";\n\t\tsetbits = Ff_Pushbutton;\n\t\tbreak;\n\tcase PDF_WIDGET_TYPE_CHECKBOX:\n\t\ttypename = \"Btn\";\n\t\tclearbits = Ff_Pushbutton;\n\t\tsetbits = Ff_Radio;\n\t\tbreak;\n\tcase PDF_WIDGET_TYPE_RADIOBUTTON:\n\t\ttypename = \"Btn\";\n\t\tclearbits = (Ff_Pushbutton|Ff_Radio);\n\t\tbreak;\n\tcase PDF_WIDGET_TYPE_TEXT:\n\t\ttypename = \"Tx\";\n\t\tbreak;\n\tcase PDF_WIDGET_TYPE_LISTBOX:\n\t\ttypename = \"Ch\";\n\t\tclearbits = Ff_Combo;\n\t\tbreak;\n\tcase PDF_WIDGET_TYPE_COMBOBOX:\n\t\ttypename = \"Ch\";\n\t\tsetbits = Ff_Combo;\n\t\tbreak;\n\tcase PDF_WIDGET_TYPE_SIGNATURE:\n\t\ttypename = \"Sig\";\n\t\tbreak;\n\t}\n\n\tif (typename)\n\t\tpdf_dict_puts_drop(obj, \"FT\", pdf_new_name(doc, typename));\n\n\tif (setbits != 0 || clearbits != 0)\n\t{\n\t\tint bits = pdf_to_int(pdf_dict_gets(obj, \"Ff\"));\n\t\tbits &= ~clearbits;\n\t\tbits |= setbits;\n\t\tpdf_dict_puts_drop(obj, \"Ff\", pdf_new_int(doc, bits));\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-font.c",
    "content": "#include \"mupdf/pdf.h\"\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_XFREE86_H\n\nstatic void pdf_load_font_descriptor(pdf_font_desc *fontdesc, pdf_document *doc, pdf_obj *dict, char *collection, char *basefont, int iscidfont, int has_encoding);\n\nstatic const char *base_font_names[][10] =\n{\n\t{ \"Courier\", \"CourierNew\", \"CourierNewPSMT\", NULL },\n\t{ \"Courier-Bold\", \"CourierNew,Bold\", \"Courier,Bold\",\n\t\t\"CourierNewPS-BoldMT\", \"CourierNew-Bold\", NULL },\n\t{ \"Courier-Oblique\", \"CourierNew,Italic\", \"Courier,Italic\",\n\t\t\"CourierNewPS-ItalicMT\", \"CourierNew-Italic\", NULL },\n\t{ \"Courier-BoldOblique\", \"CourierNew,BoldItalic\", \"Courier,BoldItalic\",\n\t\t\"CourierNewPS-BoldItalicMT\", \"CourierNew-BoldItalic\", NULL },\n\t{ \"Helvetica\", \"ArialMT\", \"Arial\", NULL },\n\t{ \"Helvetica-Bold\", \"Arial-BoldMT\", \"Arial,Bold\", \"Arial-Bold\",\n\t\t\"Helvetica,Bold\", NULL },\n\t{ \"Helvetica-Oblique\", \"Arial-ItalicMT\", \"Arial,Italic\", \"Arial-Italic\",\n\t\t\"Helvetica,Italic\", \"Helvetica-Italic\", NULL },\n\t{ \"Helvetica-BoldOblique\", \"Arial-BoldItalicMT\",\n\t\t\"Arial,BoldItalic\", \"Arial-BoldItalic\",\n\t\t\"Helvetica,BoldItalic\", \"Helvetica-BoldItalic\", NULL },\n\t{ \"Times-Roman\", \"TimesNewRomanPSMT\", \"TimesNewRoman\",\n\t\t\"TimesNewRomanPS\", NULL },\n\t{ \"Times-Bold\", \"TimesNewRomanPS-BoldMT\", \"TimesNewRoman,Bold\",\n\t\t\"TimesNewRomanPS-Bold\", \"TimesNewRoman-Bold\", NULL },\n\t{ \"Times-Italic\", \"TimesNewRomanPS-ItalicMT\", \"TimesNewRoman,Italic\",\n\t\t\"TimesNewRomanPS-Italic\", \"TimesNewRoman-Italic\", NULL },\n\t{ \"Times-BoldItalic\", \"TimesNewRomanPS-BoldItalicMT\",\n\t\t\"TimesNewRoman,BoldItalic\", \"TimesNewRomanPS-BoldItalic\",\n\t\t\"TimesNewRoman-BoldItalic\", NULL },\n\t{ \"Symbol\", \"Symbol,Italic\", \"Symbol,Bold\", \"Symbol,BoldItalic\",\n\t\t\"SymbolMT\", \"SymbolMT,Italic\", \"SymbolMT,Bold\", \"SymbolMT,BoldItalic\", NULL },\n\t{ \"ZapfDingbats\", NULL }\n};\n\nstatic int is_dynalab(char *name)\n{\n\tif (strstr(name, \"HuaTian\"))\n\t\treturn 1;\n\tif (strstr(name, \"MingLi\"))\n\t\treturn 1;\n\tif ((strstr(name, \"DF\") == name) || strstr(name, \"+DF\"))\n\t\treturn 1;\n\tif ((strstr(name, \"DLC\") == name) || strstr(name, \"+DLC\"))\n\t\treturn 1;\n\treturn 0;\n}\n\nstatic int strcmp_ignore_space(const char *a, const char *b)\n{\n\twhile (1)\n\t{\n\t\twhile (*a == ' ')\n\t\t\ta++;\n\t\twhile (*b == ' ')\n\t\t\tb++;\n\t\tif (*a != *b)\n\t\t\treturn 1;\n\t\tif (*a == 0)\n\t\t\treturn *a != *b;\n\t\tif (*b == 0)\n\t\t\treturn *a != *b;\n\t\ta++;\n\t\tb++;\n\t}\n}\n\nstatic const char *clean_font_name(const char *fontname)\n{\n\tint i, k;\n\tfor (i = 0; i < nelem(base_font_names); i++)\n\t\tfor (k = 0; base_font_names[i][k]; k++)\n\t\t\tif (!strcmp_ignore_space(base_font_names[i][k], fontname))\n\t\t\t\treturn base_font_names[i][0];\n\treturn fontname;\n}\n\n/* SumatraPDF: expose clean_font_name */\nconst char *\npdf_clean_base14_name(const char *fontname)\n{\n\treturn clean_font_name(fontname);\n}\n\n/*\n * FreeType and Rendering glue\n */\n\nenum { UNKNOWN, TYPE1, TRUETYPE };\n\nstatic int ft_kind(FT_Face face)\n{\n\tconst char *kind = FT_Get_X11_Font_Format(face);\n\tif (!strcmp(kind, \"TrueType\"))\n\t\treturn TRUETYPE;\n\tif (!strcmp(kind, \"Type 1\"))\n\t\treturn TYPE1;\n\tif (!strcmp(kind, \"CFF\"))\n\t\treturn TYPE1;\n\tif (!strcmp(kind, \"CID Type 1\"))\n\t\treturn TYPE1;\n\treturn UNKNOWN;\n}\n\nstatic int ft_is_bold(FT_Face face)\n{\n\treturn face->style_flags & FT_STYLE_FLAG_BOLD;\n}\n\nstatic int ft_is_italic(FT_Face face)\n{\n\treturn face->style_flags & FT_STYLE_FLAG_ITALIC;\n}\n\nstatic int ft_char_index(FT_Face face, int cid)\n{\n\tint gid = FT_Get_Char_Index(face, cid);\n\tif (gid == 0)\n\t\tgid = FT_Get_Char_Index(face, 0xf000 + cid);\n\n\t/* some chinese fonts only ship the similarly looking 0x2026 */\n\tif (gid == 0 && cid == 0x22ef)\n\t\tgid = FT_Get_Char_Index(face, 0x2026);\n\n\treturn gid;\n}\n\nstatic int ft_cid_to_gid(pdf_font_desc *fontdesc, int cid)\n{\n\tif (fontdesc->to_ttf_cmap)\n\t{\n\t\tcid = pdf_lookup_cmap(fontdesc->to_ttf_cmap, cid);\n\t\treturn ft_char_index(fontdesc->font->ft_face, cid);\n\t}\n\n\tif (fontdesc->cid_to_gid && cid < fontdesc->cid_to_gid_len && cid >= 0)\n\t\treturn fontdesc->cid_to_gid[cid];\n\n\treturn cid;\n}\n\nint\npdf_font_cid_to_gid(fz_context *ctx, pdf_font_desc *fontdesc, int cid)\n{\n\tif (fontdesc->font->ft_face)\n\t\treturn ft_cid_to_gid(fontdesc, cid);\n\treturn cid;\n}\n\nstatic int ft_width(fz_context *ctx, pdf_font_desc *fontdesc, int cid)\n{\n\tint gid = ft_cid_to_gid(fontdesc, cid);\n\tint fterr;\n\n\tfterr = FT_Load_Glyph(fontdesc->font->ft_face, gid,\n\t\t\tFT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP | FT_LOAD_IGNORE_TRANSFORM);\n\tif (fterr)\n\t{\n\t\tfz_warn(ctx, \"freetype load glyph (gid %d): %s\", gid, ft_error_string(fterr));\n\t\treturn 0;\n\t}\n\treturn ((FT_Face)fontdesc->font->ft_face)->glyph->advance.x;\n}\n\nstatic int lookup_mre_code(char *name)\n{\n\tint i;\n\tfor (i = 0; i < 256; i++)\n\t\tif (pdf_mac_roman[i] && !strcmp(name, pdf_mac_roman[i]))\n\t\t\treturn i;\n\treturn -1;\n}\n\n/*\n * Load font files.\n */\n\nstatic void\npdf_load_builtin_font(fz_context *ctx, pdf_font_desc *fontdesc, char *fontname, int has_descriptor)\n{\n\tFT_Face face;\n\tconst char *clean_name = clean_font_name(fontname);\n\n\tfontdesc->font = fz_load_system_font(ctx, fontname, 0, 0, !has_descriptor);\n\tif (!fontdesc->font)\n\t{\n\t\tunsigned char *data;\n\t\tunsigned int len;\n\n\t\tdata = pdf_lookup_builtin_font(clean_name, &len);\n\t\tif (!data)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot find builtin font: '%s'\", fontname);\n\n\t\tfontdesc->font = fz_new_font_from_memory(ctx, fontname, data, len, 0, 1);\n\t}\n\n\tif (!strcmp(clean_name, \"Symbol\") || !strcmp(clean_name, \"ZapfDingbats\"))\n\t\tfontdesc->flags |= PDF_FD_SYMBOLIC;\n\n\tface = fontdesc->font->ft_face;\n\tfontdesc->ascent = 1000.0f * face->ascender / face->units_per_EM;\n\tfontdesc->descent = 1000.0f * face->descender / face->units_per_EM;\n}\n\nstatic void\npdf_load_substitute_font(fz_context *ctx, pdf_font_desc *fontdesc, char *fontname, int mono, int serif, int bold, int italic, int has_encoding)\n{\n\tfontdesc->font = fz_load_system_font(ctx, fontname, bold, italic, 0);\n\tif (!fontdesc->font)\n\t{\n\t\tunsigned char *data;\n\t\tunsigned int len;\n\n\t\t/* cf. http://bugs.ghostscript.com/show_bug.cgi?id=691690 */\n\t\tif ((fontdesc->flags & PDF_FD_SYMBOLIC) && !has_encoding)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"encoding-less symbolic font '%s' is missing\", fontname);\n\n\t\tdata = pdf_lookup_substitute_font(mono, serif, bold, italic, &len);\n\t\tif (!data)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot find substitute font\");\n\n\t\tfontdesc->font = fz_new_font_from_memory(ctx, fontname, data, len, 0, 1);\n\t\tfontdesc->font->ft_bold = bold && !ft_is_bold(fontdesc->font->ft_face);\n\t\tfontdesc->font->ft_italic = italic && !ft_is_italic(fontdesc->font->ft_face);\n\t}\n\n\tfontdesc->font->ft_substitute = 1;\n}\n\nstatic void\npdf_load_substitute_cjk_font(fz_context *ctx, pdf_font_desc *fontdesc, char *fontname, int ros, int serif)\n{\n\tfontdesc->font = fz_load_system_cjk_font(ctx, fontname, ros, serif);\n\tif (!fontdesc->font)\n\t{\n\t\tunsigned char *data;\n\t\tunsigned int len;\n\t\tint index;\n\n\t\tdata = pdf_lookup_substitute_cjk_font(ros, serif, fontdesc->wmode, &len, &index);\n\t\tif (!data)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot find builtin CJK font\");\n\n\t\t/* A glyph bbox cache is too big for CJK fonts. */\n\t\tfontdesc->font = fz_new_font_from_memory(ctx, fontname, data, len, index, 0);\n\t}\n\n\tfontdesc->font->ft_substitute = 1;\n}\n\nstatic void\npdf_load_system_font(fz_context *ctx, pdf_font_desc *fontdesc, char *fontname, char *collection, int has_encoding)\n{\n\tint bold = 0;\n\tint italic = 0;\n\tint serif = 0;\n\tint mono = 0;\n\n\tif (strstr(fontname, \"Bold\"))\n\t\tbold = 1;\n\tif (strstr(fontname, \"Italic\"))\n\t\titalic = 1;\n\tif (strstr(fontname, \"Oblique\"))\n\t\titalic = 1;\n\t/* cf. https://code.google.com/p/sumatrapdf/issues/detail?id=2280 */\n\tif (strstr(fontname, \"Courier\"))\n\t\tmono = 1;\n\n\tif (fontdesc->flags & PDF_FD_FIXED_PITCH)\n\t\tmono = 1;\n\tif (fontdesc->flags & PDF_FD_SERIF)\n\t\tserif = 1;\n\tif (fontdesc->flags & PDF_FD_ITALIC)\n\t\titalic = 1;\n\tif (fontdesc->flags & PDF_FD_FORCE_BOLD)\n\t\tbold = 1;\n\n\tif (collection)\n\t{\n\t\tif (!strcmp(collection, \"Adobe-CNS1\"))\n\t\t\tpdf_load_substitute_cjk_font(ctx, fontdesc, fontname, FZ_ADOBE_CNS_1, serif);\n\t\telse if (!strcmp(collection, \"Adobe-GB1\"))\n\t\t\tpdf_load_substitute_cjk_font(ctx, fontdesc, fontname, FZ_ADOBE_GB_1, serif);\n\t\telse if (!strcmp(collection, \"Adobe-Japan1\"))\n\t\t\tpdf_load_substitute_cjk_font(ctx, fontdesc, fontname, FZ_ADOBE_JAPAN_1, serif);\n\t\telse if (!strcmp(collection, \"Adobe-Korea1\"))\n\t\t\tpdf_load_substitute_cjk_font(ctx, fontdesc, fontname, FZ_ADOBE_KOREA_1, serif);\n\t\telse\n\t\t{\n\t\t\tif (strcmp(collection, \"Adobe-Identity\") != 0)\n\t\t\t\tfz_warn(ctx, \"unknown cid collection: %s\", collection);\n\t\t\tpdf_load_substitute_font(ctx, fontdesc, fontname, mono, serif, bold, italic, 1);\n\t\t}\n\t}\n\telse\n\t{\n\t\tpdf_load_substitute_font(ctx, fontdesc, fontname, mono, serif, bold, italic, has_encoding);\n\t}\n}\n\nstatic void\npdf_load_embedded_font(pdf_document *doc, pdf_font_desc *fontdesc, char *fontname, pdf_obj *stmref)\n{\n\tfz_buffer *buf;\n\tfz_context *ctx = doc->ctx;\n\n\tfz_try(ctx)\n\t{\n\t\tbuf = pdf_load_stream(doc, pdf_to_num(stmref), pdf_to_gen(stmref));\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_message(ctx, \"cannot load font stream (%d %d R)\", pdf_to_num(stmref), pdf_to_gen(stmref));\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tfontdesc->font = fz_new_font_from_buffer(ctx, fontname, buf, 0, 1);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, buf);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_message(ctx, \"cannot load embedded font (%d %d R)\", pdf_to_num(stmref), pdf_to_gen(stmref));\n\t}\n\tfontdesc->size += buf->len;\n\n\tfontdesc->is_embedded = 1;\n}\n\n/*\n * Create and destroy\n */\n\npdf_font_desc *\npdf_keep_font(fz_context *ctx, pdf_font_desc *fontdesc)\n{\n\treturn (pdf_font_desc *)fz_keep_storable(ctx, &fontdesc->storable);\n}\n\nvoid\npdf_drop_font(fz_context *ctx, pdf_font_desc *fontdesc)\n{\n\tfz_drop_storable(ctx, &fontdesc->storable);\n}\n\nstatic void\npdf_free_font_imp(fz_context *ctx, fz_storable *fontdesc_)\n{\n\tpdf_font_desc *fontdesc = (pdf_font_desc *)fontdesc_;\n\n\t/* SumatraPDF: free vertical glyph substitution data (before font!) */\n\tpdf_ft_free_vsubst(fontdesc);\n\tif (fontdesc->font)\n\t\tfz_drop_font(ctx, fontdesc->font);\n\tif (fontdesc->encoding)\n\t\tpdf_drop_cmap(ctx, fontdesc->encoding);\n\tif (fontdesc->to_ttf_cmap)\n\t\tpdf_drop_cmap(ctx, fontdesc->to_ttf_cmap);\n\tif (fontdesc->to_unicode)\n\t\tpdf_drop_cmap(ctx, fontdesc->to_unicode);\n\tfz_free(ctx, fontdesc->cid_to_gid);\n\tfz_free(ctx, fontdesc->cid_to_ucs);\n\tfz_free(ctx, fontdesc->hmtx);\n\tfz_free(ctx, fontdesc->vmtx);\n\tfz_free(ctx, fontdesc);\n}\n\npdf_font_desc *\npdf_new_font_desc(fz_context *ctx)\n{\n\tpdf_font_desc *fontdesc;\n\n\tfontdesc = fz_malloc_struct(ctx, pdf_font_desc);\n\tFZ_INIT_STORABLE(fontdesc, 1, pdf_free_font_imp);\n\tfontdesc->size = sizeof(pdf_font_desc);\n\n\tfontdesc->font = NULL;\n\n\tfontdesc->flags = 0;\n\tfontdesc->italic_angle = 0;\n\tfontdesc->ascent = 0;\n\tfontdesc->descent = 0;\n\tfontdesc->cap_height = 0;\n\tfontdesc->x_height = 0;\n\tfontdesc->missing_width = 0;\n\n\tfontdesc->encoding = NULL;\n\tfontdesc->to_ttf_cmap = NULL;\n\tfontdesc->cid_to_gid_len = 0;\n\tfontdesc->cid_to_gid = NULL;\n\n\tfontdesc->to_unicode = NULL;\n\tfontdesc->cid_to_ucs_len = 0;\n\tfontdesc->cid_to_ucs = NULL;\n\n\tfontdesc->wmode = 0;\n\n\tfontdesc->hmtx_cap = 0;\n\tfontdesc->vmtx_cap = 0;\n\tfontdesc->hmtx_len = 0;\n\tfontdesc->vmtx_len = 0;\n\tfontdesc->hmtx = NULL;\n\tfontdesc->vmtx = NULL;\n\n\tfontdesc->dhmtx.lo = 0x0000;\n\tfontdesc->dhmtx.hi = 0xFFFF;\n\tfontdesc->dhmtx.w = 1000;\n\n\tfontdesc->dvmtx.lo = 0x0000;\n\tfontdesc->dvmtx.hi = 0xFFFF;\n\tfontdesc->dvmtx.x = 0;\n\tfontdesc->dvmtx.y = 880;\n\tfontdesc->dvmtx.w = -1000;\n\n\tfontdesc->is_embedded = 0;\n\n\t/* SumatraPDF: vertical glyph substitution */\n\tfontdesc->_vsubst = NULL;\n\n\treturn fontdesc;\n}\n\n/* SumatraPDF: provide a bullet fallback font */\nstatic pdf_font_desc *\npdf_load_bullet_font(fz_context *ctx)\n{\n\tpdf_font_desc *fontdesc = pdf_new_font_desc(ctx);\n\tint gid, i;\n\n\tfz_try(ctx)\n\t{\n\t\tpdf_load_builtin_font(ctx, fontdesc, \"Symbol\", 0);\n\t\tfontdesc->encoding = pdf_new_identity_cmap(ctx, 0, 1);\n\t\tfontdesc->cid_to_gid_len = 256;\n\t\tfontdesc->cid_to_gid = fz_malloc_array(ctx, 256, sizeof(unsigned short));\n\t\tgid = FT_Get_Name_Index(fontdesc->font->ft_face, \"bullet\");\n\t\tfor (i = 0; i < 256; i++)\n\t\t\tfontdesc->cid_to_gid[i] = gid;\n\t\tFT_Set_Char_Size(fontdesc->font->ft_face, 1000, 1000, 72, 72);\n\t\tpdf_set_default_hmtx(ctx, fontdesc, ft_width(ctx, fontdesc, 0));\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_font(ctx, fontdesc);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn fontdesc;\n}\n\n/*\n * Simple fonts (Type1 and TrueType)\n */\n\nstatic pdf_font_desc *\npdf_load_simple_font_by_name(pdf_document *doc, pdf_obj *dict, char *basefont)\n{\n\tpdf_obj *descriptor;\n\tpdf_obj *encoding;\n\tpdf_obj *widths;\n\tunsigned short *etable = NULL;\n\tpdf_font_desc *fontdesc = NULL;\n\tchar *subtype;\n\tFT_Face face;\n\tFT_CharMap cmap;\n\tint symbolic;\n\tint kind;\n\n\tchar *estrings[256];\n\tchar ebuffer[256][32];\n\tint i, k, n;\n\tint fterr;\n\tint has_lock = 0;\n\tfz_context *ctx = doc->ctx;\n\n\tfz_var(fontdesc);\n\tfz_var(etable);\n\tfz_var(has_lock);\n\n\t/* Load font file */\n\tfz_try(ctx)\n\t{\n\t\tfontdesc = pdf_new_font_desc(ctx);\n\n\t\tdescriptor = pdf_dict_gets(dict, \"FontDescriptor\");\n\t\t/* cf. http://bugs.ghostscript.com/show_bug.cgi?id=691690 */\n\t\tfz_try(ctx)\n\t\t{\n\t\tif (descriptor)\n\t\t\tpdf_load_font_descriptor(fontdesc, doc, descriptor, NULL, basefont, 0, pdf_dict_gets(dict, \"Encoding\") != NULL);\n\t\telse\n\t\t\tpdf_load_builtin_font(ctx, fontdesc, basefont, 0);\n\t\t/* cf. http://bugs.ghostscript.com/show_bug.cgi?id=691690 */\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tif (!(fontdesc->flags & PDF_FD_SYMBOLIC))\n\t\t\t\tfz_rethrow(ctx);\n\t\t\tfz_warn(ctx, \"using bullet-substitute font for '%s' (%d %d R)\", basefont, pdf_to_num(dict), pdf_to_gen(dict));\n\t\t\tpdf_drop_font(ctx, fontdesc);\n\t\t\tfontdesc = NULL;\n\t\t\tfontdesc = pdf_load_bullet_font(ctx);\n\n\t\t\tface = fontdesc->font->ft_face;\n\t\t\tkind = ft_kind(face);\n\t\t\tgoto skip_encoding;\n\t\t}\n\n\t\t/* Some chinese documents mistakenly consider WinAnsiEncoding to be codepage 936 */\n\t\tif (descriptor && pdf_is_string(pdf_dict_gets(descriptor, \"FontName\")) &&\n\t\t\t!pdf_dict_gets(dict, \"ToUnicode\") &&\n\t\t\t!strcmp(pdf_to_name(pdf_dict_gets(dict, \"Encoding\")), \"WinAnsiEncoding\") &&\n\t\t\tpdf_to_int(pdf_dict_gets(descriptor, \"Flags\")) == 4)\n\t\t{\n\t\t\tchar *cp936fonts[] = {\n\t\t\t\t\"\\xCB\\xCE\\xCC\\xE5\", \"SimSun,Regular\",\n\t\t\t\t\"\\xBA\\xDA\\xCC\\xE5\", \"SimHei,Regular\",\n\t\t\t\t\"\\xBF\\xAC\\xCC\\xE5_GB2312\", \"SimKai,Regular\",\n\t\t\t\t\"\\xB7\\xC2\\xCB\\xCE_GB2312\", \"SimFang,Regular\",\n\t\t\t\t\"\\xC1\\xA5\\xCA\\xE9\", \"SimLi,Regular\",\n\t\t\t\tNULL\n\t\t\t};\n\t\t\tfor (i = 0; cp936fonts[i]; i += 2)\n\t\t\t\tif (!strcmp(basefont, cp936fonts[i]))\n\t\t\t\t\tbreak;\n\t\t\tif (cp936fonts[i])\n\t\t\t{\n\t\t\t\tfz_warn(ctx, \"workaround for S22PDF lying about chinese font encodings\");\n\t\t\t\tpdf_drop_font(ctx, fontdesc);\n\t\t\t\tfontdesc = NULL;\n\t\t\t\tfontdesc = pdf_new_font_desc(ctx);\n\t\t\t\tpdf_load_font_descriptor(fontdesc, doc, descriptor, \"Adobe-GB1\", cp936fonts[i+1], 0, 1);\n\t\t\t\tfontdesc->encoding = pdf_load_system_cmap(ctx, \"GBK-EUC-H\");\n\t\t\t\tfontdesc->to_unicode = pdf_load_system_cmap(ctx, \"Adobe-GB1-UCS2\");\n\t\t\t\tfontdesc->to_ttf_cmap = pdf_load_system_cmap(ctx, \"Adobe-GB1-UCS2\");\n\n\t\t\t\tface = fontdesc->font->ft_face;\n\t\t\t\t/* kind = ft_kind(face); */\n\t\t\t\tgoto skip_encoding;\n\t\t\t}\n\t\t}\n\n\t\tface = fontdesc->font->ft_face;\n\t\tkind = ft_kind(face);\n\n\t\t/* Encoding */\n\n\t\tsymbolic = fontdesc->flags & 4;\n\n\t\tif (face->num_charmaps > 0)\n\t\t\tcmap = face->charmaps[0];\n\t\telse\n\t\t\tcmap = NULL;\n\n\t\t/* cf. https://github.com/sumatrapdfreader/sumatrapdf/issues/86 */\n\t\tencoding = pdf_dict_gets(dict, \"Encoding\");\n\n\t\tfor (i = 0; i < face->num_charmaps; i++)\n\t\t{\n\t\t\tFT_CharMap test = face->charmaps[i];\n\n\t\t\tif (kind == TYPE1)\n\t\t\t{\n\t\t\t\tif (test->platform_id == 7)\n\t\t\t\t\tcmap = test;\n\t\t\t}\n\n\t\t\tif (kind == TRUETYPE)\n\t\t\t{\n\t\t\t\t/* cf. https://github.com/sumatrapdfreader/sumatrapdf/issues/86 */\n\t\t\t\tif (test->platform_id == 1 && test->encoding_id == 0 && (!pdf_is_name(encoding) || strcmp(pdf_to_name(encoding), \"WinAnsiEncoding\")))\n\t\t\t\t\tcmap = test;\n\t\t\t\tif (test->platform_id == 3 && test->encoding_id == 1 && (!pdf_is_name(encoding) || strcmp(pdf_to_name(encoding), \"MacRomanEncoding\")))\n\t\t\t\t\tcmap = test;\n\t\t\t\tif (symbolic && test->platform_id == 3 && test->encoding_id == 0)\n\t\t\t\t\tcmap = test;\n\t\t\t}\n\t\t}\n\n\t\tif (cmap)\n\t\t{\n\t\t\tfterr = FT_Set_Charmap(face, cmap);\n\t\t\tif (fterr)\n\t\t\t\tfz_warn(ctx, \"freetype could not set cmap: %s\", ft_error_string(fterr));\n\t\t}\n\t\telse\n\t\t\tfz_warn(ctx, \"freetype could not find any cmaps\");\n\n\t\tetable = fz_malloc_array(ctx, 256, sizeof(unsigned short));\n\t\tfontdesc->size += 256 * sizeof(unsigned short);\n\t\tfor (i = 0; i < 256; i++)\n\t\t{\n\t\t\testrings[i] = NULL;\n\t\t\tetable[i] = 0;\n\t\t}\n\n\t\tencoding = pdf_dict_gets(dict, \"Encoding\");\n\t\tif (encoding)\n\t\t{\n\t\t\tif (pdf_is_name(encoding))\n\t\t\t\tpdf_load_encoding(estrings, pdf_to_name(encoding));\n\n\t\t\tif (pdf_is_dict(encoding))\n\t\t\t{\n\t\t\t\tpdf_obj *base, *diff, *item;\n\n\t\t\t\tbase = pdf_dict_gets(encoding, \"BaseEncoding\");\n\t\t\t\tif (pdf_is_name(base))\n\t\t\t\t\tpdf_load_encoding(estrings, pdf_to_name(base));\n\t\t\t\telse if (!fontdesc->is_embedded && !symbolic)\n\t\t\t\t\tpdf_load_encoding(estrings, \"StandardEncoding\");\n\t\t\t\t/* SumatraPDF: TODO: find better fix for encoding mismatch */\n\t\t\t\telse if (!fontdesc->encoding && !symbolic && !strcmp(FT_Get_X11_Font_Format(face), \"CFF\"))\n\t\t\t\t\tpdf_load_encoding(estrings, \"StandardEncoding\");\n\n\t\t\t\tdiff = pdf_dict_gets(encoding, \"Differences\");\n\t\t\t\tif (pdf_is_array(diff))\n\t\t\t\t{\n\t\t\t\t\tn = pdf_array_len(diff);\n\t\t\t\t\tk = 0;\n\t\t\t\t\tfor (i = 0; i < n; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\titem = pdf_array_get(diff, i);\n\t\t\t\t\t\tif (pdf_is_int(item))\n\t\t\t\t\t\t\tk = pdf_to_int(item);\n\t\t\t\t\t\tif (pdf_is_name(item) && k >= 0 && k < nelem(estrings))\n\t\t\t\t\t\t\testrings[k++] = pdf_to_name(item);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if (!fontdesc->is_embedded && !symbolic)\n\t\t\tpdf_load_encoding(estrings, \"StandardEncoding\");\n\n\t\t/* start with the builtin encoding */\n\t\tfor (i = 0; i < 256; i++)\n\t\t\tetable[i] = ft_char_index(face, i);\n\n\t\tfz_lock(ctx, FZ_LOCK_FREETYPE);\n\t\thas_lock = 1;\n\n\t\t/* built-in and substitute fonts may be a different type than what the document expects */\n\t\tsubtype = pdf_to_name(pdf_dict_gets(dict, \"Subtype\"));\n\t\tif (!strcmp(subtype, \"Type1\"))\n\t\t\tkind = TYPE1;\n\t\telse if (!strcmp(subtype, \"MMType1\"))\n\t\t\tkind = TYPE1;\n\t\telse if (!strcmp(subtype, \"TrueType\"))\n\t\t\tkind = TRUETYPE;\n\t\telse if (!strcmp(subtype, \"CIDFontType0\"))\n\t\t\tkind = TYPE1;\n\t\telse if (!strcmp(subtype, \"CIDFontType2\"))\n\t\t\tkind = TRUETYPE;\n\n\t\t/* encode by glyph name where we can */\n\t\tif (kind == TYPE1)\n\t\t{\n\t\t\tfor (i = 0; i < 256; i++)\n\t\t\t{\n\t\t\t\tif (estrings[i])\n\t\t\t\t{\n\t\t\t\t\tetable[i] = FT_Get_Name_Index(face, estrings[i]);\n\t\t\t\t\tif (etable[i] == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tint aglcode = pdf_lookup_agl(estrings[i]);\n\t\t\t\t\t\tconst char **dupnames = pdf_lookup_agl_duplicates(aglcode);\n\t\t\t\t\t\twhile (*dupnames)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tetable[i] = FT_Get_Name_Index(face, (char*)*dupnames);\n\t\t\t\t\t\t\tif (etable[i])\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdupnames++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (etable[i] == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchar buf[10];\n\t\t\t\t\t\t\tsprintf(buf, \"uni%04X\", aglcode);\n\t\t\t\t\t\t\tetable[i] = FT_Get_Name_Index(face, buf);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* encode by glyph name where we can */\n\t\t/* SumatraPDF: handle TrueType fonts loaded as Type1 more like TrueType fonts (required for substitute fonts) */\n\t\tif (kind == TRUETYPE || (ft_kind(face) == TRUETYPE && (!fontdesc->is_embedded || !FT_HAS_GLYPH_NAMES(face))))\n\t\t{\n\t\t\t/* Unicode cmap */\n\t\t\tif (!symbolic && face->charmap && face->charmap->platform_id == 3)\n\t\t\t{\n\t\t\t\tfor (i = 0; i < 256; i++)\n\t\t\t\t{\n\t\t\t\t\tif (estrings[i])\n\t\t\t\t\t{\n\t\t\t\t\t\tint aglcode = pdf_lookup_agl(estrings[i]);\n\t\t\t\t\t\tif (!aglcode)\n\t\t\t\t\t\t\tetable[i] = FT_Get_Name_Index(face, estrings[i]);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tetable[i] = ft_char_index(face, aglcode);\n\t\t\t\t\t\t/* SumatraPDF: prefer non-zero gids */\n\t\t\t\t\t\tif (!etable[i])\n\t\t\t\t\t\t\tetable[i] = ft_char_index(face, i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* MacRoman cmap */\n\t\t\telse if (!symbolic && face->charmap && face->charmap->platform_id == 1)\n\t\t\t{\n\t\t\t\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=2123 */\n\t\t\t\tif (pdf_is_name(encoding) && !strcmp(pdf_to_name(encoding), \"MacExpertEncoding\"))\n\t\t\t\t{\n\t\t\t\t\tif (FT_HAS_GLYPH_NAMES(face))\n\t\t\t\t\t\tfor (i = 0; i < 256; i++)\n\t\t\t\t\t\t\testrings[i] = NULL;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tfor (i = 0; i < 256; i++)\n\t\t\t\t{\n\t\t\t\t\tif (estrings[i])\n\t\t\t\t\t{\n\t\t\t\t\t\tk = lookup_mre_code(estrings[i]);\n\t\t\t\t\t\tif (k <= 0)\n\t\t\t\t\t\t\tetable[i] = FT_Get_Name_Index(face, estrings[i]);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tetable[i] = ft_char_index(face, k);\n\t\t\t\t\t\t/* SumatraPDF: prefer non-zero gids */\n\t\t\t\t\t\tif (!etable[i])\n\t\t\t\t\t\t\tetable[i] = ft_char_index(face, i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* Symbolic cmap */\n\t\t\telse if (!face->charmap || face->charmap->encoding != FT_ENCODING_MS_SYMBOL)\n\t\t\t{\n\t\t\t\tfor (i = 0; i < 256; i++)\n\t\t\t\t{\n\t\t\t\t\tif (estrings[i])\n\t\t\t\t\t{\n\t\t\t\t\t\tetable[i] = FT_Get_Name_Index(face, estrings[i]);\n\t\t\t\t\t\tif (etable[i] == 0)\n\t\t\t\t\t\t\tetable[i] = ft_char_index(face, i);\n\t\t\t\t\t\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=1872 */\n\t\t\t\t\t\tif (etable[i] == 0 && symbolic)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint aglcode = pdf_lookup_agl(estrings[i]);\n\t\t\t\t\t\t\tif (aglcode)\n\t\t\t\t\t\t\t\tetable[i] = ft_char_index(face, aglcode);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* try to reverse the glyph names from the builtin encoding */\n\t\tfor (i = 0; i < 256; i++)\n\t\t{\n\t\t\tif (etable[i] && !estrings[i])\n\t\t\t{\n\t\t\t\tif (FT_HAS_GLYPH_NAMES(face))\n\t\t\t\t{\n\t\t\t\t\tfterr = FT_Get_Glyph_Name(face, etable[i], ebuffer[i], 32);\n\t\t\t\t\tif (fterr)\n\t\t\t\t\t\tfz_warn(ctx, \"freetype get glyph name (gid %d): %s\", etable[i], ft_error_string(fterr));\n\t\t\t\t\tif (ebuffer[i][0])\n\t\t\t\t\t\testrings[i] = ebuffer[i];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\testrings[i] = (char*) pdf_win_ansi[i]; /* discard const */\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* symbolic Type 1 fonts with an implicit encoding and non-standard glyph names */\n\t\tif (kind == TYPE1 && symbolic)\n\t\t{\n\t\t\tfor (i = 0; i < 256; i++)\n\t\t\t\tif (etable[i] && estrings[i] && !pdf_lookup_agl(estrings[i]))\n\t\t\t\t\testrings[i] = (char*) pdf_standard[i];\n\t\t}\n\n\t\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\t\thas_lock = 0;\n\n\t\tfontdesc->encoding = pdf_new_identity_cmap(ctx, 0, 1);\n\t\tfontdesc->size += pdf_cmap_size(ctx, fontdesc->encoding);\n\t\tfontdesc->cid_to_gid_len = 256;\n\t\tfontdesc->cid_to_gid = etable;\n\n\t\tfz_try(ctx)\n\t\t{\n\t\t\t/* cf. https://github.com/sumatrapdfreader/sumatrapdf/issues/184 */\n\t\t\tpdf_obj *to_unicode = fontdesc->is_embedded || pdf_is_dict(encoding) ? pdf_dict_gets(dict, \"ToUnicode\") : NULL;\n\t\t\tpdf_load_to_unicode(doc, fontdesc, estrings, NULL, to_unicode);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\t\tfz_warn(ctx, \"cannot load ToUnicode CMap\");\n\t\t}\n\n\tskip_encoding:\n\n\t\t/* Widths */\n\n\t\tpdf_set_default_hmtx(ctx, fontdesc, fontdesc->missing_width);\n\n\t\twidths = pdf_dict_gets(dict, \"Widths\");\n\t\tif (widths)\n\t\t{\n\t\t\tint first, last;\n\n\t\t\tfirst = pdf_to_int(pdf_dict_gets(dict, \"FirstChar\"));\n\t\t\tlast = pdf_to_int(pdf_dict_gets(dict, \"LastChar\"));\n\n\t\t\tif (first < 0 || last > 255 || first > last)\n\t\t\t\tfirst = last = 0;\n\n\t\t\tfor (i = 0; i < last - first + 1; i++)\n\t\t\t{\n\t\t\t\tint wid = pdf_to_int(pdf_array_get(widths, i));\n\t\t\t\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=1616 */\n\t\t\t\tif (!wid && i >= pdf_array_len(widths))\n\t\t\t\t{\n\t\t\t\t\tfz_warn(ctx, \"font width missing for glyph %d (%d %d R)\", i + first, pdf_to_num(dict), pdf_to_gen(dict));\n\t\t\t\t\tFT_Set_Char_Size(face, 1000, 1000, 72, 72);\n\t\t\t\t\twid = ft_width(ctx, fontdesc, i + first);\n\t\t\t\t}\n\t\t\t\tpdf_add_hmtx(ctx, fontdesc, i + first, i + first, wid);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_lock(ctx, FZ_LOCK_FREETYPE);\n\t\t\thas_lock = 1;\n\t\t\tfterr = FT_Set_Char_Size(face, 1000, 1000, 72, 72);\n\t\t\tif (fterr)\n\t\t\t\tfz_warn(ctx, \"freetype set character size: %s\", ft_error_string(fterr));\n\t\t\tfor (i = 0; i < 256; i++)\n\t\t\t{\n\t\t\t\tpdf_add_hmtx(ctx, fontdesc, i, i, ft_width(ctx, fontdesc, i));\n\t\t\t}\n\t\t\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\t\t\thas_lock = 0;\n\t\t}\n\n\t\tpdf_end_hmtx(ctx, fontdesc);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tif (has_lock)\n\t\t\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\t\tif (fontdesc && etable != fontdesc->cid_to_gid)\n\t\t\tfz_free(ctx, etable);\n\t\tpdf_drop_font(ctx, fontdesc);\n\t\tfz_rethrow_message(ctx, \"cannot load simple font (%d %d R)\", pdf_to_num(dict), pdf_to_gen(dict));\n\t}\n\treturn fontdesc;\n}\n\nstatic pdf_font_desc *\npdf_load_simple_font(pdf_document *doc, pdf_obj *dict)\n{\n\tchar *basefont = pdf_to_name(pdf_dict_gets(dict, \"BaseFont\"));\n\n\treturn pdf_load_simple_font_by_name(doc, dict, basefont);\n}\n\nstatic int\nhail_mary_make_hash_key(fz_store_hash *hash, void *key_)\n{\n\thash->u.i.i0 = 0;\n\thash->u.i.i1 = 0;\n\thash->u.i.ptr = NULL;\n\treturn 1;\n}\n\nstatic void *\nhail_mary_keep_key(fz_context *ctx, void *key)\n{\n\treturn key;\n}\n\nstatic void\nhail_mary_drop_key(fz_context *ctx, void *key)\n{\n}\n\nstatic int\nhail_mary_cmp_key(void *k0, void *k1)\n{\n\treturn k0 == k1;\n}\n\n#ifndef NDEBUG\nstatic void\nhail_mary_debug_key(FILE *out, void *key_)\n{\n\tfprintf(out, \"hail mary \");\n}\n#endif\n\nstatic fz_store_type hail_mary_store_type =\n{\n\thail_mary_make_hash_key,\n\thail_mary_keep_key,\n\thail_mary_drop_key,\n\thail_mary_cmp_key,\n#ifndef NDEBUG\n\thail_mary_debug_key\n#endif\n};\n\npdf_font_desc *\npdf_load_hail_mary_font(pdf_document *doc)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_font_desc *fontdesc;\n\tpdf_font_desc *existing;\n\n\tif ((fontdesc = fz_find_item(ctx, pdf_free_font_imp, &hail_mary_store_type, &hail_mary_store_type)) != NULL)\n\t{\n\t\treturn fontdesc;\n\t}\n\n\t/* FIXME: Get someone with a clue about fonts to fix this */\n\tfontdesc = pdf_load_simple_font_by_name(doc, NULL, \"Helvetica\");\n\n\texisting = fz_store_item(ctx, &hail_mary_store_type, fontdesc, fontdesc->size, &hail_mary_store_type);\n\tassert(existing == NULL);\n\n\treturn fontdesc;\n}\n\n/*\n * CID Fonts\n */\n\nstatic pdf_font_desc *\nload_cid_font(pdf_document *doc, pdf_obj *dict, pdf_obj *encoding, pdf_obj *to_unicode)\n{\n\tpdf_obj *widths;\n\tpdf_obj *descriptor;\n\tpdf_font_desc *fontdesc = NULL;\n\tpdf_cmap *cmap;\n\tFT_Face face;\n\tchar collection[256];\n\tchar *basefont;\n\tint i, k, fterr;\n\tpdf_obj *cidtogidmap;\n\tpdf_obj *obj;\n\tint dw;\n\tfz_context *ctx = doc->ctx;\n\n\tfz_var(fontdesc);\n\n\tfz_try(ctx)\n\t{\n\t\t/* Get font name and CID collection */\n\n\t\tbasefont = pdf_to_name(pdf_dict_gets(dict, \"BaseFont\"));\n\n\t\t{\n\t\t\tpdf_obj *cidinfo;\n\t\t\tchar tmpstr[64];\n\t\t\tint tmplen;\n\n\t\t\tcidinfo = pdf_dict_gets(dict, \"CIDSystemInfo\");\n\t\t\tif (!cidinfo)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cid font is missing info\");\n\n\t\t\tobj = pdf_dict_gets(cidinfo, \"Registry\");\n\t\t\ttmplen = fz_mini(sizeof tmpstr - 1, pdf_to_str_len(obj));\n\t\t\tmemcpy(tmpstr, pdf_to_str_buf(obj), tmplen);\n\t\t\ttmpstr[tmplen] = '\\0';\n\t\t\tfz_strlcpy(collection, tmpstr, sizeof collection);\n\n\t\t\tfz_strlcat(collection, \"-\", sizeof collection);\n\n\t\t\tobj = pdf_dict_gets(cidinfo, \"Ordering\");\n\t\t\ttmplen = fz_mini(sizeof tmpstr - 1, pdf_to_str_len(obj));\n\t\t\tmemcpy(tmpstr, pdf_to_str_buf(obj), tmplen);\n\t\t\ttmpstr[tmplen] = '\\0';\n\t\t\tfz_strlcat(collection, tmpstr, sizeof collection);\n\t\t}\n\n\t\t/* Encoding */\n\n\t\tif (pdf_is_name(encoding))\n\t\t{\n\t\t\tif (!strcmp(pdf_to_name(encoding), \"Identity-H\"))\n\t\t\t\tcmap = pdf_new_identity_cmap(ctx, 0, 2);\n\t\t\telse if (!strcmp(pdf_to_name(encoding), \"Identity-V\"))\n\t\t\t\tcmap = pdf_new_identity_cmap(ctx, 1, 2);\n\t\t\telse\n\t\t\t\tcmap = pdf_load_system_cmap(ctx, pdf_to_name(encoding));\n\t\t}\n\t\telse if (pdf_is_indirect(encoding))\n\t\t{\n\t\t\tcmap = pdf_load_embedded_cmap(doc, encoding);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"syntaxerror: font missing encoding\");\n\t\t}\n\n\t\t/* Load font file */\n\n\t\tfontdesc = pdf_new_font_desc(ctx);\n\n\t\tfontdesc->encoding = cmap;\n\t\tfontdesc->size += pdf_cmap_size(ctx, fontdesc->encoding);\n\n\t\tpdf_set_font_wmode(ctx, fontdesc, pdf_cmap_wmode(ctx, fontdesc->encoding));\n\n\t\tdescriptor = pdf_dict_gets(dict, \"FontDescriptor\");\n\t\tif (!descriptor)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"syntaxerror: missing font descriptor\");\n\t\tpdf_load_font_descriptor(fontdesc, doc, descriptor, collection, basefont, 1, 1);\n\n\t\tface = fontdesc->font->ft_face;\n\n\t\t/* Apply encoding */\n\n\t\tcidtogidmap = pdf_dict_gets(dict, \"CIDToGIDMap\");\n\t\tif (pdf_is_indirect(cidtogidmap))\n\t\t{\n\t\t\tfz_buffer *buf;\n\n\t\t\tbuf = pdf_load_stream(doc, pdf_to_num(cidtogidmap), pdf_to_gen(cidtogidmap));\n\n\t\t\tfontdesc->cid_to_gid_len = (buf->len) / 2;\n\t\t\tfontdesc->cid_to_gid = fz_malloc_array(ctx, fontdesc->cid_to_gid_len, sizeof(unsigned short));\n\t\t\tfontdesc->size += fontdesc->cid_to_gid_len * sizeof(unsigned short);\n\t\t\tfor (i = 0; i < fontdesc->cid_to_gid_len; i++)\n\t\t\t\tfontdesc->cid_to_gid[i] = (buf->data[i * 2] << 8) + buf->data[i * 2 + 1];\n\n\t\t\tfz_drop_buffer(ctx, buf);\n\t\t}\n\n\t\t/* if font is external, cidtogidmap should not be identity */\n\t\t/* so we map from cid to unicode and then map that through the (3 1) */\n\t\t/* unicode cmap to get a glyph id */\n\t\telse if (fontdesc->font->ft_substitute)\n\t\t{\n\t\t\tfterr = FT_Select_Charmap(face, ft_encoding_unicode);\n\t\t\tif (fterr)\n\t\t\t{\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"fonterror: no unicode cmap when emulating CID font: %s\", ft_error_string(fterr));\n\t\t\t}\n\n\t\t\tif (!strcmp(collection, \"Adobe-CNS1\"))\n\t\t\t\tfontdesc->to_ttf_cmap = pdf_load_system_cmap(ctx, \"Adobe-CNS1-UCS2\");\n\t\t\telse if (!strcmp(collection, \"Adobe-GB1\"))\n\t\t\t\tfontdesc->to_ttf_cmap = pdf_load_system_cmap(ctx, \"Adobe-GB1-UCS2\");\n\t\t\telse if (!strcmp(collection, \"Adobe-Japan1\"))\n\t\t\t\tfontdesc->to_ttf_cmap = pdf_load_system_cmap(ctx, \"Adobe-Japan1-UCS2\");\n\t\t\telse if (!strcmp(collection, \"Adobe-Japan2\"))\n\t\t\t\tfontdesc->to_ttf_cmap = pdf_load_system_cmap(ctx, \"Adobe-Japan2-UCS2\");\n\t\t\telse if (!strcmp(collection, \"Adobe-Korea1\"))\n\t\t\t\tfontdesc->to_ttf_cmap = pdf_load_system_cmap(ctx, \"Adobe-Korea1-UCS2\");\n\t\t\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=2318 */\n\t\t\telse if (!strcmp(collection, \"Adobe-Identity\") && fontdesc->font->ft_filepath)\n\t\t\t\tfontdesc->font->ft_substitute = 0;\n\t\t}\n\n\t\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=1961 */\n\t\tfz_try(ctx)\n\t\t{\n\n\t\tpdf_load_to_unicode(doc, fontdesc, NULL, collection, to_unicode);\n\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_warn(ctx, \"cannot load ToUnicode CMap\");\n\t\t}\n\n\t\t/* If we have an identity encoding, we're supposed to use the glyph ids directly.\n\t\t * If we only have a substitute font, that won't work.\n\t\t * Make a last ditch attempt by using\n\t\t * the ToUnicode table if it exists to map via the substitute font's cmap. */\n\t\tif (strstr(fontdesc->encoding->cmap_name, \"Identity-\") && fontdesc->font->ft_substitute)\n\t\t{\n\t\t\tfz_warn(ctx, \"non-embedded font using identity encoding: %s\", basefont);\n\t\t\tif (fontdesc->to_unicode && !fontdesc->to_ttf_cmap)\n\t\t\t\tfontdesc->to_ttf_cmap = pdf_keep_cmap(ctx, fontdesc->to_unicode);\n\t\t}\n\n\t\t/* Horizontal */\n\n\t\tdw = 1000;\n\t\tobj = pdf_dict_gets(dict, \"DW\");\n\t\tif (obj)\n\t\t\tdw = pdf_to_int(obj);\n\t\tpdf_set_default_hmtx(ctx, fontdesc, dw);\n\n\t\twidths = pdf_dict_gets(dict, \"W\");\n\t\tif (widths)\n\t\t{\n\t\t\tint c0, c1, w, n, m;\n\n\t\t\tn = pdf_array_len(widths);\n\t\t\tfor (i = 0; i < n; )\n\t\t\t{\n\t\t\t\tc0 = pdf_to_int(pdf_array_get(widths, i));\n\t\t\t\tobj = pdf_array_get(widths, i + 1);\n\t\t\t\tif (pdf_is_array(obj))\n\t\t\t\t{\n\t\t\t\t\tm = pdf_array_len(obj);\n\t\t\t\t\tfor (k = 0; k < m; k++)\n\t\t\t\t\t{\n\t\t\t\t\t\tw = pdf_to_int(pdf_array_get(obj, k));\n\t\t\t\t\t\tpdf_add_hmtx(ctx, fontdesc, c0 + k, c0 + k, w);\n\t\t\t\t\t}\n\t\t\t\t\ti += 2;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tc1 = pdf_to_int(obj);\n\t\t\t\t\tw = pdf_to_int(pdf_array_get(widths, i + 2));\n\t\t\t\t\tpdf_add_hmtx(ctx, fontdesc, c0, c1, w);\n\t\t\t\t\ti += 3;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpdf_end_hmtx(ctx, fontdesc);\n\n\t\t/* Vertical */\n\n\t\tif (pdf_cmap_wmode(ctx, fontdesc->encoding) == 1)\n\t\t{\n\t\t\tint dw2y = 880;\n\t\t\tint dw2w = -1000;\n\n\t\t\tobj = pdf_dict_gets(dict, \"DW2\");\n\t\t\tif (obj)\n\t\t\t{\n\t\t\t\tdw2y = pdf_to_int(pdf_array_get(obj, 0));\n\t\t\t\tdw2w = pdf_to_int(pdf_array_get(obj, 1));\n\t\t\t}\n\n\t\t\tpdf_set_default_vmtx(ctx, fontdesc, dw2y, dw2w);\n\n\t\t\twidths = pdf_dict_gets(dict, \"W2\");\n\t\t\tif (widths)\n\t\t\t{\n\t\t\t\tint c0, c1, w, x, y, n;\n\n\t\t\t\tn = pdf_array_len(widths);\n\t\t\t\tfor (i = 0; i < n; )\n\t\t\t\t{\n\t\t\t\t\tc0 = pdf_to_int(pdf_array_get(widths, i));\n\t\t\t\t\tobj = pdf_array_get(widths, i + 1);\n\t\t\t\t\tif (pdf_is_array(obj))\n\t\t\t\t\t{\n\t\t\t\t\t\tint m = pdf_array_len(obj);\n\t\t\t\t\t\tfor (k = 0; k * 3 < m; k ++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tw = pdf_to_int(pdf_array_get(obj, k * 3 + 0));\n\t\t\t\t\t\t\tx = pdf_to_int(pdf_array_get(obj, k * 3 + 1));\n\t\t\t\t\t\t\ty = pdf_to_int(pdf_array_get(obj, k * 3 + 2));\n\t\t\t\t\t\t\tpdf_add_vmtx(ctx, fontdesc, c0 + k, c0 + k, x, y, w);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ti += 2;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tc1 = pdf_to_int(obj);\n\t\t\t\t\t\tw = pdf_to_int(pdf_array_get(widths, i + 2));\n\t\t\t\t\t\tx = pdf_to_int(pdf_array_get(widths, i + 3));\n\t\t\t\t\t\ty = pdf_to_int(pdf_array_get(widths, i + 4));\n\t\t\t\t\t\tpdf_add_vmtx(ctx, fontdesc, c0, c1, x, y, w);\n\t\t\t\t\t\ti += 5;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpdf_end_vmtx(ctx, fontdesc);\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_font(ctx, fontdesc);\n\t\tfz_rethrow_message(ctx, \"cannot load cid font (%d %d R)\", pdf_to_num(dict), pdf_to_gen(dict));\n\t}\n\n\treturn fontdesc;\n}\n\nstatic pdf_font_desc *\npdf_load_type0_font(pdf_document *doc, pdf_obj *dict)\n{\n\tpdf_obj *dfonts;\n\tpdf_obj *dfont;\n\tpdf_obj *subtype;\n\tpdf_obj *encoding;\n\tpdf_obj *to_unicode;\n\n\tdfonts = pdf_dict_gets(dict, \"DescendantFonts\");\n\tif (!dfonts)\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"cid font is missing descendant fonts\");\n\n\tdfont = pdf_array_get(dfonts, 0);\n\n\tsubtype = pdf_dict_gets(dfont, \"Subtype\");\n\tencoding = pdf_dict_gets(dict, \"Encoding\");\n\tto_unicode = pdf_dict_gets(dict, \"ToUnicode\");\n\n\tif (pdf_is_name(subtype) && !strcmp(pdf_to_name(subtype), \"CIDFontType0\"))\n\t\treturn load_cid_font(doc, dfont, encoding, to_unicode);\n\tif (pdf_is_name(subtype) && !strcmp(pdf_to_name(subtype), \"CIDFontType2\"))\n\t\treturn load_cid_font(doc, dfont, encoding, to_unicode);\n\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"syntaxerror: unknown cid font type\");\n}\n\n/*\n * FontDescriptor\n */\n\nstatic void\npdf_load_font_descriptor(pdf_font_desc *fontdesc, pdf_document *doc, pdf_obj *dict, char *collection, char *basefont, int iscidfont, int has_encoding)\n{\n\tpdf_obj *obj1, *obj2, *obj3, *obj;\n\tchar *fontname;\n\tFT_Face face;\n\tfz_context *ctx = doc->ctx;\n\n\t/* Prefer BaseFont; don't bother with FontName */\n\tfontname = basefont;\n\n\t/* SumatraPDF: handle /BaseFont /Arial,Bold+000041 /FontName /Arial,Bold */\n\tif (strchr(basefont, '+') && pdf_is_name(pdf_dict_gets(dict, \"FontName\")))\n\t\tfontname = pdf_to_name(pdf_dict_gets(dict, \"FontName\"));\n\n\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=1616 */\n\tif (strlen(fontname) > 7 && fontname[6] == '+')\n\t\tfontname += 7;\n\n\tfontdesc->flags = pdf_to_int(pdf_dict_gets(dict, \"Flags\"));\n\tfontdesc->italic_angle = pdf_to_real(pdf_dict_gets(dict, \"ItalicAngle\"));\n\tfontdesc->ascent = pdf_to_real(pdf_dict_gets(dict, \"Ascent\"));\n\tfontdesc->descent = pdf_to_real(pdf_dict_gets(dict, \"Descent\"));\n\tfontdesc->cap_height = pdf_to_real(pdf_dict_gets(dict, \"CapHeight\"));\n\tfontdesc->x_height = pdf_to_real(pdf_dict_gets(dict, \"XHeight\"));\n\tfontdesc->missing_width = pdf_to_real(pdf_dict_gets(dict, \"MissingWidth\"));\n\n\tobj1 = pdf_dict_gets(dict, \"FontFile\");\n\tobj2 = pdf_dict_gets(dict, \"FontFile2\");\n\tobj3 = pdf_dict_gets(dict, \"FontFile3\");\n\tobj = obj1 ? obj1 : obj2 ? obj2 : obj3;\n\n\tif (pdf_is_indirect(obj))\n\t{\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tpdf_load_embedded_font(doc, fontdesc, fontname, obj);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\t\tfz_warn(ctx, \"ignored error when loading embedded font; attempting to load system font\");\n\t\t\tif (!iscidfont && fontname != clean_font_name(fontname))\n\t\t\t\tpdf_load_builtin_font(ctx, fontdesc, fontname, 1);\n\t\t\telse\n\t\t\t\tpdf_load_system_font(ctx, fontdesc, fontname, collection, has_encoding);\n\t\t}\n\t}\n\telse\n\t{\n\t\tif (!iscidfont && fontname != clean_font_name(fontname))\n\t\t\tpdf_load_builtin_font(ctx, fontdesc, fontname, 1);\n\t\telse\n\t\t\tpdf_load_system_font(ctx, fontdesc, fontname, collection, has_encoding);\n\t}\n\n\t/* Check for DynaLab fonts that must use hinting */\n\tface = fontdesc->font->ft_face;\n\tif (ft_kind(face) == TRUETYPE)\n\t{\n\t\tif (FT_IS_TRICKY(face) || is_dynalab(fontdesc->font->name))\n\t\t\tfontdesc->font->ft_hint = 1;\n\t\t/* cf. https://code.google.com/p/sumatrapdf/issues/detail?id=2489 */\n\t\telse if (!strcmp(fontdesc->font->name, \"\\xBC\\xD0\\xB7\\xA2\\xC5\\xE9\"))\n\t\t\tfontdesc->font->ft_hint = 1;\n\n\t\tif (fontdesc->ascent == 0.0f)\n\t\t\tfontdesc->ascent = 1000.0f * face->ascender / face->units_per_EM;\n\n\t\tif (fontdesc->descent == 0.0f)\n\t\t\tfontdesc->descent = 1000.0f * face->descender / face->units_per_EM;\n\t}\n\n\t/* cf. https://code.google.com/p/sumatrapdf/issues/detail?id=2404 */\n\tif (!(fontdesc->flags & PDF_FD_SYMBOLIC) &&\n\t\tface && face->num_charmaps > 0 && face->charmaps[0]->encoding == FT_ENCODING_MS_SYMBOL &&\n\t\t!strncmp(fontdesc->font->name, \"Symbol\", 6))\n\t{\n\t\tfontdesc->flags |= PDF_FD_SYMBOLIC;\n\t}\n}\n\nstatic void\npdf_make_width_table(fz_context *ctx, pdf_font_desc *fontdesc)\n{\n\tfz_font *font = fontdesc->font;\n\tint i, k, n, cid, gid;\n\n\tn = 0;\n\tfor (i = 0; i < fontdesc->hmtx_len; i++)\n\t{\n\t\tfor (k = fontdesc->hmtx[i].lo; k <= fontdesc->hmtx[i].hi; k++)\n\t\t{\n\t\t\tcid = pdf_lookup_cmap(fontdesc->encoding, k);\n\t\t\tgid = pdf_font_cid_to_gid(ctx, fontdesc, cid);\n\t\t\tif (gid > n)\n\t\t\t\tn = gid;\n\t\t}\n\t};\n\n\tfont->width_count = n + 1;\n\tfont->width_table = fz_malloc_array(ctx, font->width_count, sizeof(int));\n\tmemset(font->width_table, 0, font->width_count * sizeof(int));\n\tfontdesc->size += font->width_count * sizeof(int);\n\n\tfor (i = 0; i < fontdesc->hmtx_len; i++)\n\t{\n\t\tfor (k = fontdesc->hmtx[i].lo; k <= fontdesc->hmtx[i].hi; k++)\n\t\t{\n\t\t\tcid = pdf_lookup_cmap(fontdesc->encoding, k);\n\t\t\tgid = pdf_font_cid_to_gid(ctx, fontdesc, cid);\n\t\t\tif (gid >= 0 && gid < font->width_count)\n\t\t\t\tfont->width_table[gid] = fz_maxi(fontdesc->hmtx[i].w, font->width_table[gid]);\n\t\t}\n\t}\n}\n\npdf_font_desc *\npdf_load_font(pdf_document *doc, pdf_obj *rdb, pdf_obj *dict, int nested_depth)\n{\n\tchar *subtype;\n\tpdf_obj *dfonts;\n\tpdf_obj *charprocs;\n\tfz_context *ctx = doc->ctx;\n\tpdf_font_desc *fontdesc;\n\tint type3 = 0;\n\n\tif ((fontdesc = pdf_find_item(ctx, pdf_free_font_imp, dict)) != NULL)\n\t{\n\t\treturn fontdesc;\n\t}\n\n\tsubtype = pdf_to_name(pdf_dict_gets(dict, \"Subtype\"));\n\tdfonts = pdf_dict_gets(dict, \"DescendantFonts\");\n\tcharprocs = pdf_dict_gets(dict, \"CharProcs\");\n\n\tif (subtype && !strcmp(subtype, \"Type0\"))\n\t\tfontdesc = pdf_load_type0_font(doc, dict);\n\telse if (subtype && !strcmp(subtype, \"Type1\"))\n\t\tfontdesc = pdf_load_simple_font(doc, dict);\n\telse if (subtype && !strcmp(subtype, \"MMType1\"))\n\t\tfontdesc = pdf_load_simple_font(doc, dict);\n\telse if (subtype && !strcmp(subtype, \"TrueType\"))\n\t\tfontdesc = pdf_load_simple_font(doc, dict);\n\telse if (subtype && !strcmp(subtype, \"Type3\"))\n\t{\n\t\tfontdesc = pdf_load_type3_font(doc, rdb, dict);\n\t\ttype3 = 1;\n\t}\n\telse if (charprocs)\n\t{\n\t\tfz_warn(ctx, \"unknown font format, guessing type3.\");\n\t\tfontdesc = pdf_load_type3_font(doc, rdb, dict);\n\t\ttype3 = 1;\n\t}\n\telse if (dfonts)\n\t{\n\t\tfz_warn(ctx, \"unknown font format, guessing type0.\");\n\t\tfontdesc = pdf_load_type0_font(doc, dict);\n\t}\n\telse\n\t{\n\t\tfz_warn(ctx, \"unknown font format, guessing type1 or truetype.\");\n\t\tfontdesc = pdf_load_simple_font(doc, dict);\n\t}\n\n\t/* Save the widths to stretch non-CJK substitute fonts */\n\tif (fontdesc->font->ft_substitute && !fontdesc->to_ttf_cmap)\n\t\tpdf_make_width_table(ctx, fontdesc);\n\n\tpdf_store_item(ctx, dict, fontdesc, fontdesc->size);\n\n\tif (type3)\n\t\tpdf_load_type3_glyphs(doc, fontdesc, nested_depth);\n\n\treturn fontdesc;\n}\n\n#ifndef NDEBUG\nvoid\npdf_print_font(fz_context *ctx, pdf_font_desc *fontdesc)\n{\n\tint i;\n\n\tprintf(\"fontdesc {\\n\");\n\n\tif (fontdesc->font->ft_face)\n\t\tprintf(\"\\tfreetype font\\n\");\n\tif (fontdesc->font->t3procs)\n\t\tprintf(\"\\ttype3 font\\n\");\n\n\tprintf(\"\\twmode %d\\n\", fontdesc->wmode);\n\tprintf(\"\\tDW %d\\n\", fontdesc->dhmtx.w);\n\n\tprintf(\"\\tW {\\n\");\n\tfor (i = 0; i < fontdesc->hmtx_len; i++)\n\t\tprintf(\"\\t\\t<%04x> <%04x> %d\\n\",\n\t\t\tfontdesc->hmtx[i].lo, fontdesc->hmtx[i].hi, fontdesc->hmtx[i].w);\n\tprintf(\"\\t}\\n\");\n\n\tif (fontdesc->wmode)\n\t{\n\t\tprintf(\"\\tDW2 [%d %d]\\n\", fontdesc->dvmtx.y, fontdesc->dvmtx.w);\n\t\tprintf(\"\\tW2 {\\n\");\n\t\tfor (i = 0; i < fontdesc->vmtx_len; i++)\n\t\t\tprintf(\"\\t\\t<%04x> <%04x> %d %d %d\\n\", fontdesc->vmtx[i].lo, fontdesc->vmtx[i].hi,\n\t\t\t\tfontdesc->vmtx[i].x, fontdesc->vmtx[i].y, fontdesc->vmtx[i].w);\n\t\tprintf(\"\\t}\\n\");\n\t}\n}\n#endif\n\nfz_rect *pdf_measure_text(fz_context *ctx, pdf_font_desc *fontdesc, unsigned char *buf, int len, fz_rect *acc)\n{\n\tint i;\n\tint w = 0;\n\n\tfor (i = 0; i < len; i++)\n\t\tw += pdf_lookup_hmtx(ctx, fontdesc, buf[i]).w;\n\n\tacc->x0 = 0;\n\tacc->x1 = w / 1000.0f;\n\tacc->y0 = fontdesc->descent / 1000.0f;\n\tacc->y1 = fontdesc->ascent / 1000.0f;\n\n\treturn acc;\n}\n\nfloat pdf_text_stride(fz_context *ctx, pdf_font_desc *fontdesc, float fontsize, unsigned char *buf, int len, float room, int *count)\n{\n\tpdf_hmtx h;\n\tint i = 0;\n\tfloat x = 0.0;\n\n\twhile(i < len)\n\t{\n\t\tfloat span;\n\n\t\th = pdf_lookup_hmtx(ctx, fontdesc, buf[i]);\n\n\t\tspan = h.w * fontsize / 1000.0;\n\n\t\tif (x + span > room)\n\t\t\tbreak;\n\n\t\tx += span;\n\t\ti ++;\n\t}\n\n\tif (count)\n\t\t*count = i;\n\n\treturn x;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-fontfile.c",
    "content": "#include \"mupdf/pdf.h\"\n\n/*\n\tWhich fonts are embedded is based on a few preprocessor definitions.\n\n\tThe base 14 fonts are always embedded.\n\tFor CJK font substitution we embed DroidSansFallback.\n\n\tSet NOCJK to skip all CJK support (this also omits embedding the CJK CMaps)\n\tSet NOCJKFONT to skip the embedded CJK font.\n\tSet NOCJKFULL to embed a smaller CJK font without CJK Extension A support.\n*/\n\n#ifdef NOCJK\n#define NOCJKFONT\n#endif\n\n/* SumatraPDF: allow using NASM to include fonts as binary instead of requiring a separate generate.bat build step */\n#ifdef NOASMFONTS\n#include \"gen_font_base14.h\"\n#else\n/* fonts are included via font_base14.asm.\n   TODO: we need a script that updates the size of the fonts when they change,\n   to be run manually after font update. It could be a separate .h file\n   (such as gen_font_base14.h) or we could directly change this file. */\nextern const unsigned char pdf_font_Dingbats[29728];\nextern const unsigned char pdf_font_NimbusMono_Bold[62684];\nextern const unsigned char pdf_font_NimbusMono_BoldOblique[67852];\nextern const unsigned char pdf_font_NimbusMono_Oblique[63536];\nextern const unsigned char pdf_font_NimbusMono_Regular[55996];\nextern const unsigned char pdf_font_NimbusRomNo9L_Med[63036];\nextern const unsigned char pdf_font_NimbusRomNo9L_MedIta[67203];\nextern const unsigned char pdf_font_NimbusRomNo9L_Reg[60468];\nextern const unsigned char pdf_font_NimbusRomNo9L_RegIta[69073];\nextern const unsigned char pdf_font_NimbusSanL_Bol[46110];\nextern const unsigned char pdf_font_NimbusSanL_BolIta[50494];\nextern const unsigned char pdf_font_NimbusSanL_Reg[44632];\nextern const unsigned char pdf_font_NimbusSanL_RegIta[50172];\nextern const unsigned char pdf_font_StandardSymL[19828];\n#endif\n\n#ifndef NOCJKFONT\n#ifndef NOCJKFULL\n#include \"gen_font_cjk_full.h\"\n#else\n#include \"gen_font_cjk.h\"\n#endif\n#endif\n\nunsigned char *\npdf_lookup_builtin_font(const char *name, unsigned int *len)\n{\n\tif (!strcmp(\"Courier\", name)) {\n\t\t*len = sizeof pdf_font_NimbusMono_Regular;\n\t\treturn (unsigned char*) pdf_font_NimbusMono_Regular;\n\t}\n\tif (!strcmp(\"Courier-Bold\", name)) {\n\t\t*len = sizeof pdf_font_NimbusMono_Bold;\n\t\treturn (unsigned char*) pdf_font_NimbusMono_Bold;\n\t}\n\tif (!strcmp(\"Courier-Oblique\", name)) {\n\t\t*len = sizeof pdf_font_NimbusMono_Oblique;\n\t\treturn (unsigned char*) pdf_font_NimbusMono_Oblique;\n\t}\n\tif (!strcmp(\"Courier-BoldOblique\", name)) {\n\t\t*len = sizeof pdf_font_NimbusMono_BoldOblique;\n\t\treturn (unsigned char*) pdf_font_NimbusMono_BoldOblique;\n\t}\n\tif (!strcmp(\"Helvetica\", name)) {\n\t\t*len = sizeof pdf_font_NimbusSanL_Reg;\n\t\treturn (unsigned char*) pdf_font_NimbusSanL_Reg;\n\t}\n\tif (!strcmp(\"Helvetica-Bold\", name)) {\n\t\t*len = sizeof pdf_font_NimbusSanL_Bol;\n\t\treturn (unsigned char*) pdf_font_NimbusSanL_Bol;\n\t}\n\tif (!strcmp(\"Helvetica-Oblique\", name)) {\n\t\t*len = sizeof pdf_font_NimbusSanL_RegIta;\n\t\treturn (unsigned char*) pdf_font_NimbusSanL_RegIta;\n\t}\n\tif (!strcmp(\"Helvetica-BoldOblique\", name)) {\n\t\t*len = sizeof pdf_font_NimbusSanL_BolIta;\n\t\treturn (unsigned char*) pdf_font_NimbusSanL_BolIta;\n\t}\n\tif (!strcmp(\"Times-Roman\", name)) {\n\t\t*len = sizeof pdf_font_NimbusRomNo9L_Reg;\n\t\treturn (unsigned char*) pdf_font_NimbusRomNo9L_Reg;\n\t}\n\tif (!strcmp(\"Times-Bold\", name)) {\n\t\t*len = sizeof pdf_font_NimbusRomNo9L_Med;\n\t\treturn (unsigned char*) pdf_font_NimbusRomNo9L_Med;\n\t}\n\tif (!strcmp(\"Times-Italic\", name)) {\n\t\t*len = sizeof pdf_font_NimbusRomNo9L_RegIta;\n\t\treturn (unsigned char*) pdf_font_NimbusRomNo9L_RegIta;\n\t}\n\tif (!strcmp(\"Times-BoldItalic\", name)) {\n\t\t*len = sizeof pdf_font_NimbusRomNo9L_MedIta;\n\t\treturn (unsigned char*) pdf_font_NimbusRomNo9L_MedIta;\n\t}\n\tif (!strcmp(\"Symbol\", name)) {\n\t\t*len = sizeof pdf_font_StandardSymL;\n\t\treturn (unsigned char*) pdf_font_StandardSymL;\n\t}\n\tif (!strcmp(\"ZapfDingbats\", name)) {\n\t\t*len = sizeof pdf_font_Dingbats;\n\t\treturn (unsigned char*) pdf_font_Dingbats;\n\t}\n\t*len = 0;\n\treturn NULL;\n}\n\nunsigned char *\npdf_lookup_substitute_font(int mono, int serif, int bold, int italic, unsigned int *len)\n{\n\tif (mono) {\n\t\tif (bold) {\n\t\t\tif (italic) return pdf_lookup_builtin_font(\"Courier-BoldOblique\", len);\n\t\t\telse return pdf_lookup_builtin_font(\"Courier-Bold\", len);\n\t\t} else {\n\t\t\tif (italic) return pdf_lookup_builtin_font(\"Courier-Oblique\", len);\n\t\t\telse return pdf_lookup_builtin_font(\"Courier\", len);\n\t\t}\n\t} else if (serif) {\n\t\tif (bold) {\n\t\t\tif (italic) return pdf_lookup_builtin_font(\"Times-BoldItalic\", len);\n\t\t\telse return pdf_lookup_builtin_font(\"Times-Bold\", len);\n\t\t} else {\n\t\t\tif (italic) return pdf_lookup_builtin_font(\"Times-Italic\", len);\n\t\t\telse return pdf_lookup_builtin_font(\"Times-Roman\", len);\n\t\t}\n\t} else {\n\t\tif (bold) {\n\t\t\tif (italic) return pdf_lookup_builtin_font(\"Helvetica-BoldOblique\", len);\n\t\t\telse return pdf_lookup_builtin_font(\"Helvetica-Bold\", len);\n\t\t} else {\n\t\t\tif (italic) return pdf_lookup_builtin_font(\"Helvetica-Oblique\", len);\n\t\t\telse return pdf_lookup_builtin_font(\"Helvetica\", len);\n\t\t}\n\t}\n}\n\nunsigned char *\npdf_lookup_substitute_cjk_font(int ros, int serif, int wmode, unsigned int *len, int *index)\n{\n#ifndef NOCJKFONT\n#ifndef NOCJKFULL\n\t*index = wmode;\n\t*len = sizeof pdf_font_DroidSansFallbackFull;\n\treturn (unsigned char*) pdf_font_DroidSansFallbackFull;\n#else\n\t*index = wmode;\n\t*len = sizeof pdf_font_DroidSansFallback;\n\treturn (unsigned char*) pdf_font_DroidSansFallback;\n#endif\n#else\n\t*len = 0;\n\treturn NULL;\n#endif\n}\n\n/* SumatraPDF: also load fonts included with Windows */\n#ifdef _WIN32\n\n#ifndef UNICODE\n#define UNICODE\n#endif\n#ifndef _UNICODE\n#define _UNICODE\n#endif\n\n#include <windows.h>\n\n// TODO: Use more of FreeType for TTF parsing (for performance reasons,\n//       the fonts can't be parsed completely, though)\n#include <ft2build.h>\n#include FT_TRUETYPE_IDS_H\n#include FT_TRUETYPE_TAGS_H\n\n#define TTC_VERSION1\t0x00010000\n#define TTC_VERSION2\t0x00020000\n\n#define MAX_FACENAME\t128\n\n// Note: the font face must be the first field so that the structure\n//       can be treated like a simple string for searching\ntypedef struct pdf_fontmapMS_s\n{\n\tchar fontface[MAX_FACENAME];\n\tchar fontpath[MAX_PATH];\n\tint index;\n} pdf_fontmapMS;\n\ntypedef struct pdf_fontlistMS_s\n{\n\tpdf_fontmapMS *fontmap;\n\tint len;\n\tint cap;\n} pdf_fontlistMS;\n\ntypedef struct _tagTT_OFFSET_TABLE\n{\n\tULONG\tuVersion;\n\tUSHORT\tuNumOfTables;\n\tUSHORT\tuSearchRange;\n\tUSHORT\tuEntrySelector;\n\tUSHORT\tuRangeShift;\n} TT_OFFSET_TABLE;\n\ntypedef struct _tagTT_TABLE_DIRECTORY\n{\n\tULONG\tuTag;\t\t\t\t//table name\n\tULONG\tuCheckSum;\t\t\t//Check sum\n\tULONG\tuOffset;\t\t\t//Offset from beginning of file\n\tULONG\tuLength;\t\t\t//length of the table in bytes\n} TT_TABLE_DIRECTORY;\n\ntypedef struct _tagTT_NAME_TABLE_HEADER\n{\n\tUSHORT\tuFSelector;\t\t\t//format selector. Always 0\n\tUSHORT\tuNRCount;\t\t\t//Name Records count\n\tUSHORT\tuStorageOffset;\t\t//Offset for strings storage, from start of the table\n} TT_NAME_TABLE_HEADER;\n\ntypedef struct _tagTT_NAME_RECORD\n{\n\tUSHORT\tuPlatformID;\n\tUSHORT\tuEncodingID;\n\tUSHORT\tuLanguageID;\n\tUSHORT\tuNameID;\n\tUSHORT\tuStringLength;\n\tUSHORT\tuStringOffset;\t//from start of storage area\n} TT_NAME_RECORD;\n\ntypedef struct _tagFONT_COLLECTION\n{\n\tULONG\tTag;\n\tULONG\tVersion;\n\tULONG\tNumFonts;\n} FONT_COLLECTION;\n\nstatic struct {\n\tchar *name;\n\tchar *pattern;\n} baseSubstitutes[] = {\n\t{ \"Courier\", \"CourierNewPSMT\" },\n\t{ \"Courier-Bold\", \"CourierNewPS-BoldMT\" },\n\t{ \"Courier-Oblique\", \"CourierNewPS-ItalicMT\" },\n\t{ \"Courier-BoldOblique\", \"CourierNewPS-BoldItalicMT\" },\n\t{ \"Helvetica\", \"ArialMT\" },\n\t{ \"Helvetica-Bold\", \"Arial-BoldMT\" },\n\t{ \"Helvetica-Oblique\", \"Arial-ItalicMT\" },\n\t{ \"Helvetica-BoldOblique\", \"Arial-BoldItalicMT\" },\n\t{ \"Times-Roman\", \"TimesNewRomanPSMT\" },\n\t{ \"Times-Bold\", \"TimesNewRomanPS-BoldMT\" },\n\t{ \"Times-Italic\", \"TimesNewRomanPS-ItalicMT\" },\n\t{ \"Times-BoldItalic\", \"TimesNewRomanPS-BoldItalicMT\" },\n\t{ \"Symbol\", \"SymbolMT\" },\n};\n\nstatic pdf_fontlistMS fontlistMS =\n{\n\tNULL,\n\t0,\n\t0,\n};\n\nstatic inline USHORT BEtoHs(USHORT x)\n{\n\tBYTE *data = (BYTE *)&x;\n\treturn (data[0] << 8) | data[1];\n}\n\nstatic inline ULONG BEtoHl(ULONG x)\n{\n\tBYTE *data = (BYTE *)&x;\n\treturn (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3];\n}\n\n/* A little bit more sophisticated name matching so that e.g. \"EurostileExtended\"\n   matches \"EurostileExtended-Roman\" or \"Tahoma-Bold,Bold\" matches \"Tahoma-Bold\" */\nstatic int\nlookup_compare(const void *elem1, const void *elem2)\n{\n\tconst char *val1 = elem1;\n\tconst char *val2 = elem2;\n\tint len1 = strlen(val1);\n\tint len2 = strlen(val2);\n\n\tif (len1 != len2)\n\t{\n\t\tconst char *rest = len1 > len2 ? val1 + len2 : val2 + len1;\n\t\tif (',' == *rest || !_stricmp(rest, \"-roman\"))\n\t\t\treturn _strnicmp(val1, val2, fz_mini(len1, len2));\n\t}\n\n\treturn _stricmp(val1, val2);\n}\n\nstatic void\nremove_spaces(char *srcDest)\n{\n\tchar *dest;\n\n\tfor (dest = srcDest; *srcDest; srcDest++)\n\t\tif (*srcDest != ' ')\n\t\t\t*dest++ = *srcDest;\n\t*dest = '\\0';\n}\n\nstatic int\nstr_ends_with(const char *str, const char *end)\n{\n\tsize_t len1 = strlen(str);\n\tsize_t len2 = strlen(end);\n\n\treturn len1 >= len2 && !strcmp(str + len1 - len2, end);\n}\n\nstatic pdf_fontmapMS *\npdf_find_windows_font_path(const char *fontname)\n{\n\treturn bsearch(fontname, fontlistMS.fontmap, fontlistMS.len, sizeof(pdf_fontmapMS), lookup_compare);\n}\n\n/* source and dest can be same */\nstatic void\ndecode_unicode_BE(fz_context *ctx, char *source, int sourcelen, char *dest, int destlen)\n{\n\tWCHAR *tmp;\n\tint converted, i;\n\n\tif (sourcelen % 2 != 0)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"fonterror : invalid unicode string\");\n\n\ttmp = fz_malloc_array(ctx, sourcelen / 2 + 1, sizeof(WCHAR));\n\tfor (i = 0; i < sourcelen / 2; i++)\n\t\ttmp[i] = BEtoHs(((WCHAR *)source)[i]);\n\ttmp[sourcelen / 2] = '\\0';\n\n\tconverted = WideCharToMultiByte(CP_UTF8, 0, tmp, -1, dest, destlen, NULL, NULL);\n\tfz_free(ctx, tmp);\n\tif (!converted)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"fonterror : invalid unicode string\");\n}\n\nstatic void\ndecode_platform_string(fz_context *ctx, int platform, int enctype, char *source, int sourcelen, char *dest, int destlen)\n{\n\tswitch (platform)\n\t{\n\tcase TT_PLATFORM_APPLE_UNICODE:\n\t\tswitch (enctype)\n\t\t{\n\t\tcase TT_APPLE_ID_DEFAULT:\n\t\tcase TT_APPLE_ID_UNICODE_2_0:\n\t\t\tdecode_unicode_BE(ctx, source, sourcelen, dest, destlen);\n\t\t\treturn;\n\t\t}\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"fonterror : unsupported encoding (%d/%d)\", platform, enctype);\n\tcase TT_PLATFORM_MACINTOSH:\n\t\tswitch (enctype)\n\t\t{\n\t\tcase TT_MAC_ID_ROMAN:\n\t\t\tif (sourcelen + 1 > destlen)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"fonterror : overlong fontname: %s\", source);\n\t\t\t// TODO: Convert to UTF-8 from what encoding?\n\t\t\tmemcpy(dest, source, sourcelen);\n\t\t\tdest[sourcelen] = 0;\n\t\t\treturn;\n\t\t}\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"fonterror : unsupported encoding (%d/%d)\", platform, enctype);\n\tcase TT_PLATFORM_MICROSOFT:\n\t\tswitch (enctype)\n\t\t{\n\t\tcase TT_MS_ID_SYMBOL_CS:\n\t\tcase TT_MS_ID_UNICODE_CS:\n\t\tcase TT_MS_ID_UCS_4:\n\t\t\tdecode_unicode_BE(ctx, source, sourcelen, dest, destlen);\n\t\t\treturn;\n\t\t}\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"fonterror : unsupported encoding (%d/%d)\", platform, enctype);\n\tdefault:\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"fonterror : unsupported encoding (%d/%d)\", platform, enctype);\n\t}\n}\n\nstatic void\ngrow_system_font_list(fz_context *ctx, pdf_fontlistMS *fl)\n{\n\tint newcap;\n\tpdf_fontmapMS *newitems;\n\n\tif (fl->cap == 0)\n\t\tnewcap = 1024;\n\telse\n\t\tnewcap = fl->cap * 2;\n\n\t// use realloc/free for the fontmap, since the list can\n\t// remain in memory even with all fz_contexts destroyed\n\tnewitems = realloc(fl->fontmap, newcap * sizeof(pdf_fontmapMS));\n\tif (!newitems)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"OOM in grow_system_font_list\");\n\tmemset(newitems + fl->cap, 0, sizeof(pdf_fontmapMS) * (newcap - fl->cap));\n\n\tfl->fontmap = newitems;\n\tfl->cap = newcap;\n}\n\nstatic void\nappend_mapping(fz_context *ctx, pdf_fontlistMS *fl, const char *facename, const char *path, int index)\n{\n\tif (fl->len == fl->cap)\n\t\tgrow_system_font_list(ctx, fl);\n\n\tif (fl->len >= fl->cap)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"fonterror : fontlist overflow\");\n\n\tfz_strlcpy(fl->fontmap[fl->len].fontface, facename, sizeof(fl->fontmap[0].fontface));\n\tfz_strlcpy(fl->fontmap[fl->len].fontpath, path, sizeof(fl->fontmap[0].fontpath));\n\tfl->fontmap[fl->len].index = index;\n\n\t++fl->len;\n}\n\nstatic void\nsafe_read(fz_stream *file, int offset, char *buf, int size)\n{\n\tint n;\n\tfz_seek(file, offset, 0);\n\tn = fz_read(file, (unsigned char *)buf, size);\n\tif (n != size)\n\t\tfz_throw(file->ctx, FZ_ERROR_GENERIC, \"safe_read: read %d, expected %d\", n, size);\n}\n\nstatic void\nread_ttf_string(fz_stream *file, int offset, TT_NAME_RECORD *ttRecordBE, char *buf, int size)\n{\n\tchar szTemp[MAX_FACENAME * 2];\n\t// ignore empty and overlong strings\n\tint stringLength = BEtoHs(ttRecordBE->uStringLength);\n\tif (stringLength == 0 || stringLength >= sizeof(szTemp))\n\t\treturn;\n\n\tsafe_read(file, offset + BEtoHs(ttRecordBE->uStringOffset), szTemp, stringLength);\n\tdecode_platform_string(file->ctx, BEtoHs(ttRecordBE->uPlatformID),\n\t\tBEtoHs(ttRecordBE->uEncodingID), szTemp, stringLength, buf, size);\n}\n\nstatic void\nmakeFakePSName(char szName[MAX_FACENAME], const char *szStyle)\n{\n\t// append the font's subfamily, unless it's a Regular font\n\tif (*szStyle && _stricmp(szStyle, \"Regular\") != 0)\n\t{\n\t\tfz_strlcat(szName, \"-\", MAX_FACENAME);\n\t\tfz_strlcat(szName, szStyle, MAX_FACENAME);\n\t}\n\tremove_spaces(szName);\n}\n\nstatic void\nparseTTF(fz_stream *file, int offset, int index, const char *path)\n{\n\tTT_OFFSET_TABLE ttOffsetTableBE;\n\tTT_TABLE_DIRECTORY tblDirBE;\n\tTT_NAME_TABLE_HEADER ttNTHeaderBE;\n\tTT_NAME_RECORD ttRecordBE;\n\n\tchar szPSName[MAX_FACENAME] = { 0 };\n\tchar szTTName[MAX_FACENAME] = { 0 };\n\tchar szStyle[MAX_FACENAME] = { 0 };\n\tchar szCJKName[MAX_FACENAME] = { 0 };\n\tint i, count, tblOffset;\n\n\tsafe_read(file, offset, (char *)&ttOffsetTableBE, sizeof(TT_OFFSET_TABLE));\n\n\t// check if this is a TrueType font of version 1.0 or an OpenType font\n\tif (BEtoHl(ttOffsetTableBE.uVersion) != TTC_VERSION1 &&\n\t\tBEtoHl(ttOffsetTableBE.uVersion) != TTAG_OTTO)\n\t{\n\t\tfz_throw(file->ctx, FZ_ERROR_GENERIC, \"fonterror : invalid font version %x\", BEtoHl(ttOffsetTableBE.uVersion));\n\t}\n\n\t// determine the name table's offset by iterating through the offset table\n\tcount = BEtoHs(ttOffsetTableBE.uNumOfTables);\n\tfor (i = 0; i < count; i++)\n\t{\n\t\tint entryOffset = offset + sizeof(TT_OFFSET_TABLE) + i * sizeof(TT_TABLE_DIRECTORY);\n\t\tsafe_read(file, entryOffset, (char *)&tblDirBE, sizeof(TT_TABLE_DIRECTORY));\n\t\tif (!BEtoHl(tblDirBE.uTag) || BEtoHl(tblDirBE.uTag) == TTAG_name)\n\t\t\tbreak;\n\t}\n\tif (count == i || !BEtoHl(tblDirBE.uTag))\n\t\tfz_throw(file->ctx, FZ_ERROR_GENERIC, \"fonterror : nameless font\");\n\ttblOffset = BEtoHl(tblDirBE.uOffset);\n\n\t// read the 'name' table for record count and offsets\n\tsafe_read(file, tblOffset, (char *)&ttNTHeaderBE, sizeof(TT_NAME_TABLE_HEADER));\n\toffset = tblOffset + sizeof(TT_NAME_TABLE_HEADER);\n\ttblOffset += BEtoHs(ttNTHeaderBE.uStorageOffset);\n\n\t// read through the strings for PostScript name and font family\n\tcount = BEtoHs(ttNTHeaderBE.uNRCount);\n\tfor (i = 0; i < count; i++)\n\t{\n\t\tshort langId, nameId;\n\t\tBOOL isCJKName;\n\n\t\tsafe_read(file, offset + i * sizeof(TT_NAME_RECORD), (char *)&ttRecordBE, sizeof(TT_NAME_RECORD));\n\n\t\tlangId = BEtoHs(ttRecordBE.uLanguageID);\n\t\tnameId = BEtoHs(ttRecordBE.uNameID);\n\t\tisCJKName = TT_NAME_ID_FONT_FAMILY == nameId && LANG_CHINESE == PRIMARYLANGID(langId);\n\n\t\t// ignore non-English strings (except for Chinese font names)\n\t\tif (langId && langId != TT_MS_LANGID_ENGLISH_UNITED_STATES && !isCJKName)\n\t\t\tcontinue;\n\t\t// ignore names other than font (sub)family and PostScript name\n\t\tfz_try(file->ctx)\n\t\t{\n\t\t\tif (isCJKName)\n\t\t\t\tread_ttf_string(file, tblOffset, &ttRecordBE, szCJKName, sizeof(szCJKName));\n\t\t\telse if (TT_NAME_ID_FONT_FAMILY == nameId)\n\t\t\t\tread_ttf_string(file, tblOffset, &ttRecordBE, szTTName, sizeof(szTTName));\n\t\t\telse if (TT_NAME_ID_FONT_SUBFAMILY == nameId)\n\t\t\t\tread_ttf_string(file, tblOffset, &ttRecordBE, szStyle, sizeof(szStyle));\n\t\t\telse if (TT_NAME_ID_PS_NAME == nameId)\n\t\t\t\tread_ttf_string(file, tblOffset, &ttRecordBE, szPSName, sizeof(szPSName));\n\t\t}\n\t\tfz_catch(file->ctx)\n\t\t{\n\t\t\tfz_warn(file->ctx, \"ignoring face name decoding fonterror\");\n\t\t}\n\t}\n\n\t// try to prevent non-Arial fonts from accidentally substituting Arial\n\tif (!strcmp(szPSName, \"ArialMT\"))\n\t{\n\t\t// cf. https://code.google.com/p/sumatrapdf/issues/detail?id=2471\n\t\tif (strcmp(szTTName, \"Arial\") != 0)\n\t\t\tszPSName[0] = '\\0';\n\t\t// TODO: is there a better way to distinguish Arial Caps from Arial proper?\n\t\t// cf. http://code.google.com/p/sumatrapdf/issues/detail?id=1290\n\t\telse if (strstr(path, \"caps\") || strstr(path, \"Caps\"))\n\t\t\tfz_throw(file->ctx, FZ_ERROR_GENERIC, \"ignore %s, as it can't be distinguished from Arial,Regular\", path);\n\t}\n\n\tif (szPSName[0])\n\t\tappend_mapping(file->ctx, &fontlistMS, szPSName, path, index);\n\tif (szTTName[0])\n\t{\n\t\t// derive a PostScript-like name and add it, if it's different from the font's\n\t\t// included PostScript name; cf. http://code.google.com/p/sumatrapdf/issues/detail?id=376\n\t\tmakeFakePSName(szTTName, szStyle);\n\t\t// compare the two names before adding this one\n\t\tif (lookup_compare(szTTName, szPSName))\n\t\t\tappend_mapping(file->ctx, &fontlistMS, szTTName, path, index);\n\t}\n\tif (szCJKName[0])\n\t{\n\t\tmakeFakePSName(szCJKName, szStyle);\n\t\tif (lookup_compare(szCJKName, szPSName) && lookup_compare(szCJKName, szTTName))\n\t\t\tappend_mapping(file->ctx, &fontlistMS, szCJKName, path, index);\n\t}\n}\n\nstatic void\nparseTTFs(fz_context *ctx, const char *path)\n{\n\tfz_stream *file = fz_open_file(ctx, path);\n\t/* \"fonterror : %s not found\", path */\n\tfz_try(ctx)\n\t{\n\t\tparseTTF(file, 0, 0, path);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(file);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void\nparseTTCs(fz_context *ctx, const char *path)\n{\n\tFONT_COLLECTION fontcollectionBE;\n\tULONG i, numFonts, *offsettableBE = NULL;\n\n\tfz_stream *file = fz_open_file(ctx, path);\n\t/* \"fonterror : %s not found\", path */\n\n\tfz_var(offsettableBE);\n\n\tfz_try(ctx)\n\t{\n\t\tsafe_read(file, 0, (char *)&fontcollectionBE, sizeof(FONT_COLLECTION));\n\t\tif (BEtoHl(fontcollectionBE.Tag) != TTAG_ttcf)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"fonterror : wrong format %x\", BEtoHl(fontcollectionBE.Tag));\n\t\tif (BEtoHl(fontcollectionBE.Version) != TTC_VERSION1 &&\n\t\t\tBEtoHl(fontcollectionBE.Version) != TTC_VERSION2)\n\t\t{\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"fonterror : invalid version %x\", BEtoHl(fontcollectionBE.Version));\n\t\t}\n\n\t\tnumFonts = BEtoHl(fontcollectionBE.NumFonts);\n\t\toffsettableBE = fz_malloc_array(ctx, numFonts, sizeof(ULONG));\n\n\t\tsafe_read(file, sizeof(FONT_COLLECTION), (char *)offsettableBE, numFonts * sizeof(ULONG));\n\t\tfor (i = 0; i < numFonts; i++)\n\t\t\tparseTTF(file, BEtoHl(offsettableBE[i]), i, path);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_free(ctx, offsettableBE);\n\t\tfz_close(file);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void\nextend_system_font_list(fz_context *ctx, const WCHAR *path)\n{\n\tWCHAR szPath[MAX_PATH], *lpFileName;\n\tWIN32_FIND_DATA FileData;\n\tHANDLE hList;\n\n\tGetFullPathName(path, nelem(szPath), szPath, &lpFileName);\n\n\thList = FindFirstFile(szPath, &FileData);\n\tif (hList == INVALID_HANDLE_VALUE)\n\t{\n\t\t// Don't complain about missing directories\n\t\tif (GetLastError() == ERROR_FILE_NOT_FOUND)\n\t\t\treturn;\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"extend_system_font_list: unknown error %d\", GetLastError());\n\t}\n\tdo\n\t{\n\t\tif (!(FileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))\n\t\t{\n\t\t\tchar szPathUtf8[MAX_PATH], *fileExt;\n\t\t\tint res;\n\t\t\tlstrcpyn(lpFileName, FileData.cFileName, szPath + MAX_PATH - lpFileName);\n\t\t\tres = WideCharToMultiByte(CP_UTF8, 0, szPath, -1, szPathUtf8, sizeof(szPathUtf8), NULL, NULL);\n\t\t\tif (!res)\n\t\t\t{\n\t\t\t\tfz_warn(ctx, \"WideCharToMultiByte failed for %S\", szPath);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfileExt = szPathUtf8 + strlen(szPathUtf8) - 4;\n\t\t\tfz_try(ctx)\n\t\t\t{\n\t\t\t\tif (!_stricmp(fileExt, \".ttc\"))\n\t\t\t\t\tparseTTCs(ctx, szPathUtf8);\n\t\t\t\telse if (!_stricmp(fileExt, \".ttf\") || !_stricmp(fileExt, \".otf\"))\n\t\t\t\t\tparseTTFs(ctx, szPathUtf8);\n\t\t\t}\n\t\t\tfz_catch(ctx)\n\t\t\t{\n\t\t\t\t// ignore errors occurring while parsing a given font file\n\t\t\t}\n\t\t}\n\t} while (FindNextFile(hList, &FileData));\n\tFindClose(hList);\n}\n\nstatic void\ndestroy_system_font_list(void)\n{\n\tfree(fontlistMS.fontmap);\n\tmemset(&fontlistMS, 0, sizeof(fontlistMS));\n}\n\n// cf. http://blogs.msdn.com/b/oldnewthing/archive/2004/10/25/247180.aspx\nEXTERN_C IMAGE_DOS_HEADER __ImageBase;\n#define CURRENT_HMODULE ((HMODULE)&__ImageBase)\n\nstatic void\ncreate_system_font_list(fz_context *ctx)\n{\n\tWCHAR szFontDir[MAX_PATH];\n\tUINT cch;\n\n\tcch = GetWindowsDirectory(szFontDir, nelem(szFontDir) - 12);\n\tif (0 < cch && cch < nelem(szFontDir) - 12)\n\t{\n\t\twcscat_s(szFontDir, MAX_PATH, L\"\\\\Fonts\\\\*.?t?\");\n\t\textend_system_font_list(ctx, szFontDir);\n\t}\n\n\tif (fontlistMS.len == 0)\n\t\tfz_warn(ctx, \"couldn't find any usable system fonts\");\n\n#ifdef NOCJKFONT\n\t{\n\t\t// If no CJK fallback font is builtin but one has been shipped separately (in the same\n\t\t// directory as the main executable), add it to the list of loadable system fonts\n\t\tWCHAR szFile[MAX_PATH], *lpFileName;\n\t\tszFile[0] = '\\0';\n\t\tGetModuleFileName(CURRENT_HMODULE, szFontDir, MAX_PATH);\n\t\tszFontDir[nelem(szFontDir) - 1] = '\\0';\n\t\tGetFullPathName(szFontDir, MAX_PATH, szFile, &lpFileName);\n\t\tlstrcpyn(lpFileName, L\"DroidSansFallback.ttf\", szFile + MAX_PATH - lpFileName);\n\t\textend_system_font_list(ctx, szFile);\n\t}\n#endif\n\n\t// sort the font list, so that it can be searched binarily\n\tqsort(fontlistMS.fontmap, fontlistMS.len, sizeof(pdf_fontmapMS), _stricmp);\n\n#ifdef DEBUG\n\t// allow to overwrite system fonts for debugging purposes\n\t// (either pass a full path or a search pattern such as \"fonts\\*.ttf\")\n\tcch = GetEnvironmentVariable(L\"MUPDF_FONTS_PATTERN\", szFontDir, nelem(szFontDir));\n\tif (0 < cch && cch < nelem(szFontDir))\n\t{\n\t\tint i, prev_len = fontlistMS.len;\n\t\textend_system_font_list(ctx, szFontDir);\n\t\tfor (i = prev_len; i < fontlistMS.len; i++)\n\t\t{\n\t\t\tpdf_fontmapMS *entry = bsearch(fontlistMS.fontmap[i].fontface, fontlistMS.fontmap, prev_len, sizeof(pdf_fontmapMS), lookup_compare);\n\t\t\tif (entry)\n\t\t\t\t*entry = fontlistMS.fontmap[i];\n\t\t}\n\t\tqsort(fontlistMS.fontmap, fontlistMS.len, sizeof(pdf_fontmapMS), _stricmp);\n\t}\n#endif\n\n\t// make sure to clean up after ourselves\n\tatexit(destroy_system_font_list);\n}\n\nstatic LONG fontlist_locked = FALSE;\n\nstatic fz_font *\npdf_load_windows_font_by_name(fz_context *ctx, const char *orig_name)\n{\n\tpdf_fontmapMS *found = NULL;\n\tchar *comma, *fontname;\n\tfz_font *font;\n\n\t// not using a CRITICAL_SECTION, as there's no good place for creating/deleting it\n\t// (and can't use fz_context locks, as fontlistMS is reused across fz_context)\n\twhile (InterlockedCompareExchange(&fontlist_locked, TRUE, FALSE) != FALSE)\n\t\tSleep(10);\n\tif (fontlistMS.len == 0)\n\t{\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tcreate_system_font_list(ctx);\n\t\t}\n\t\tfz_catch(ctx) { }\n\t}\n\tif (InterlockedCompareExchange(&fontlist_locked, FALSE, TRUE) != TRUE)\n\t\tassert(0);\n\tif (fontlistMS.len == 0)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"fonterror: couldn't find any fonts\");\n\n\t// work on a normalized copy of the font name\n\tfontname = fz_strdup(ctx, orig_name);\n\tremove_spaces(fontname);\n\n\t// first, try to find the exact font name (including appended style information)\n\tcomma = strchr(fontname, ',');\n\tif (comma)\n\t{\n\t\t*comma = '-';\n\t\tfound = pdf_find_windows_font_path(fontname);\n\t\t*comma = ',';\n\t}\n\t// second, substitute the font name with a known PostScript name\n\telse\n\t{\n\t\tint i;\n\t\tfor (i = 0; i < nelem(baseSubstitutes) && !found; i++)\n\t\t\tif (!strcmp(fontname, baseSubstitutes[i].name))\n\t\t\t\tfound = pdf_find_windows_font_path(baseSubstitutes[i].pattern);\n\t}\n\t// third, search for the font name without additional style information\n\tif (!found)\n\t\tfound = pdf_find_windows_font_path(fontname);\n\t// fourth, try to separate style from basename for prestyled fonts (e.g. \"ArialBold\")\n\tif (!found && !comma && (str_ends_with(fontname, \"Bold\") || str_ends_with(fontname, \"Italic\")))\n\t{\n\t\tint styleLen = str_ends_with(fontname, \"Bold\") ? 4 : str_ends_with(fontname, \"BoldItalic\") ? 10 : 6;\n\t\tfontname = fz_resize_array(ctx, fontname, strlen(fontname) + 2, sizeof(char));\n\t\tcomma = fontname + strlen(fontname) - styleLen;\n\t\tmemmove(comma + 1, comma, styleLen + 1);\n\t\t*comma = '-';\n\t\tfound = pdf_find_windows_font_path(fontname);\n\t\t*comma = ',';\n\t\tif (!found)\n\t\t\tfound = pdf_find_windows_font_path(fontname);\n\t}\n\t// fifth, try to convert the font name from the common Chinese codepage 936\n\tif (!found && fontname[0] < 0)\n\t{\n\t\tWCHAR cjkNameW[MAX_FACENAME];\n\t\tchar cjkName[MAX_FACENAME];\n\t\tif (MultiByteToWideChar(936, MB_ERR_INVALID_CHARS, fontname, -1, cjkNameW, nelem(cjkNameW)) &&\n\t\t\tWideCharToMultiByte(CP_UTF8, 0, cjkNameW, -1, cjkName, nelem(cjkName), NULL, NULL))\n\t\t{\n\t\t\tcomma = strchr(cjkName, ',');\n\t\t\tif (comma)\n\t\t\t{\n\t\t\t\t*comma = '-';\n\t\t\t\tfound = pdf_find_windows_font_path(cjkName);\n\t\t\t\t*comma = ',';\n\t\t\t}\n\t\t\tif (!found)\n\t\t\t\tfound = pdf_find_windows_font_path(cjkName);\n\t\t}\n\t}\n\n\tfz_free(ctx, fontname);\n\tif (!found)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"couldn't find system font '%s'\", orig_name);\n\n\tfz_warn(ctx, \"loading non-embedded font '%s' from '%s'\", orig_name, found->fontpath);\n\n\tfont = fz_new_font_from_file(ctx, orig_name, found->fontpath, found->index,\n\t\tstrcmp(found->fontface, \"DroidSansFallback\") != 0);\n\tfont->ft_substitute = 1;\n\treturn font;\n}\n\nstatic fz_font *\npdf_load_windows_font(fz_context *ctx, const char *fontname, int bold, int italic, int needs_exact_metrics)\n{\n\tfz_font *font;\n\tconst char *clean_name = pdf_clean_base14_name(fontname);\n\n\tif (needs_exact_metrics)\n\t{\n\t\t/* TODO: the metrics for Times-Roman and Courier don't match\n\t\t   those of Windows' Times New Roman and Courier New; for\n\t\t   some reason, Poppler doesn't seem to have this problem */\n\t\tunsigned int len;\n\t\tif (pdf_lookup_builtin_font(fontname, &len))\n\t\t\treturn NULL;\n\n\t\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=2173 */\n\t\tif (clean_name != fontname && !strncmp(clean_name, \"Times-\", 6))\n\t\t\treturn NULL;\n\t}\n\n\tfont = pdf_load_windows_font_by_name(ctx, fontname);\n\t/* use the font's own metrics for base 14 fonts */\n\tif (clean_name != fontname)\n\t\tfont->ft_substitute = 0;\n\treturn font;\n}\n\nstatic fz_font *\npdf_load_windows_cjk_font(fz_context *ctx, const char *fontname, int ros, int serif)\n{\n\tfz_font *font;\n\n\t/* try to find a matching system font before falling back to an approximate one */\n\tfz_try(ctx)\n\t{\n\t\tfont = pdf_load_windows_font_by_name(ctx, fontname);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfont = NULL;\n\t}\n\tif (font)\n\t\treturn font;\n\n\t/* try to fall back to a reasonable system font */\n\tfz_try(ctx)\n\t{\n\t\tif (serif)\n\t\t{\n\t\t\tswitch (ros)\n\t\t\t{\n\t\t\tcase FZ_ADOBE_CNS_1: font = pdf_load_windows_font_by_name(ctx, \"MingLiU\"); break;\n\t\t\tcase FZ_ADOBE_GB_1: font = pdf_load_windows_font_by_name(ctx, \"SimSun\"); break;\n\t\t\tcase FZ_ADOBE_JAPAN_1: font = pdf_load_windows_font_by_name(ctx, \"MS-Mincho\"); break;\n\t\t\tcase FZ_ADOBE_KOREA_1: font = pdf_load_windows_font_by_name(ctx, \"Batang\"); break;\n\t\t\tdefault: fz_throw(ctx, FZ_ERROR_GENERIC, \"invalid serif ros\");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tswitch (ros)\n\t\t\t{\n\t\t\tcase FZ_ADOBE_CNS_1: font = pdf_load_windows_font_by_name(ctx, \"DFKaiShu-SB-Estd-BF\"); break;\n\t\t\tcase FZ_ADOBE_GB_1:\n\t\t\t\tfz_try(ctx)\n\t\t\t\t{\n\t\t\t\t\tfont = pdf_load_windows_font_by_name(ctx, \"KaiTi\");\n\t\t\t\t}\n\t\t\t\tfz_catch(ctx)\n\t\t\t\t{\n\t\t\t\t\tfont = pdf_load_windows_font_by_name(ctx, \"KaiTi_GB2312\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FZ_ADOBE_JAPAN_1: font = pdf_load_windows_font_by_name(ctx, \"MS-Gothic\"); break;\n\t\t\tcase FZ_ADOBE_KOREA_1: font = pdf_load_windows_font_by_name(ctx, \"Gulim\"); break;\n\t\t\tdefault: fz_throw(ctx, FZ_ERROR_GENERIC, \"invalid sans-serif ros\");\n\t\t\t}\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n#ifdef NOCJKFONT\n\t\t/* If no CJK fallback font is builtin, maybe one has been shipped separately */\n\t\tfont = pdf_load_windows_font_by_name(ctx, \"DroidSansFallback\");\n#else\n\t\tfz_rethrow(ctx);\n#endif\n\t}\n\n\treturn font;\n}\n\n#endif\n\nvoid pdf_install_load_system_font_funcs(fz_context *ctx)\n{\n#ifdef _WIN32\n\tfz_install_load_system_font_funcs(ctx, pdf_load_windows_font, pdf_load_windows_cjk_font);\n#endif\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-form.c",
    "content": "#include \"mupdf/pdf.h\"\n\n/* Must be kept in sync with definitions in pdf_util.js */\nenum\n{\n\tDisplay_Visible,\n\tDisplay_Hidden,\n\tDisplay_NoPrint,\n\tDisplay_NoView\n};\n\nenum\n{\n\tSigFlag_SignaturesExist = 1,\n\tSigFlag_AppendOnly = 2\n};\n\nstatic int pdf_field_dirties_document(pdf_document *doc, pdf_obj *field)\n{\n\tint ff = pdf_get_field_flags(doc, field);\n\tif (ff & Ff_NoExport) return 0;\n\tif (ff & Ff_ReadOnly) return 0;\n\treturn 1;\n}\n\n/* Find the point in a field hierarchy where all descendents\n * share the same name */\nstatic pdf_obj *find_head_of_field_group(pdf_obj *obj)\n{\n\tif (obj == NULL || pdf_dict_gets(obj, \"T\"))\n\t\treturn obj;\n\telse\n\t\treturn find_head_of_field_group(pdf_dict_gets(obj, \"Parent\"));\n}\n\nstatic void pdf_field_mark_dirty(pdf_document *doc, pdf_obj *field)\n{\n\tpdf_obj *kids = pdf_dict_gets(field, \"Kids\");\n\tif (kids)\n\t{\n\t\tint i, n = pdf_array_len(kids);\n\n\t\tfor (i = 0; i < n; i++)\n\t\t\tpdf_field_mark_dirty(doc, pdf_array_get(kids, i));\n\t}\n\telse\n\t{\n\t\tpdf_dirty_obj(field);\n\t}\n}\n\nstatic void update_field_value(pdf_document *doc, pdf_obj *obj, char *text)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *sobj = NULL;\n\tpdf_obj *grp;\n\n\tif (!text)\n\t\ttext = \"\";\n\n\t/* All fields of the same name should be updated, so\n\t * set the value at the head of the group */\n\tgrp = find_head_of_field_group(obj);\n\tif (grp)\n\t\tobj = grp;\n\n\tfz_var(sobj);\n\tfz_try(ctx)\n\t{\n\t\tsobj = pdf_new_string(doc, text, strlen(text));\n\t\tpdf_dict_puts(obj, \"V\", sobj);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(sobj);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\tpdf_field_mark_dirty(doc, obj);\n}\n\nstatic pdf_obj *find_field(pdf_obj *dict, char *name, int len)\n{\n\tpdf_obj *field;\n\n\tint i, n = pdf_array_len(dict);\n\n\tfor (i = 0; i < n; i++)\n\t{\n\t\tchar *part;\n\n\t\tfield = pdf_array_get(dict, i);\n\t\tpart = pdf_to_str_buf(pdf_dict_gets(field, \"T\"));\n\t\tif (strlen(part) == (size_t)len && !memcmp(part, name, len))\n\t\t\treturn field;\n\t}\n\n\treturn NULL;\n}\n\npdf_obj *pdf_lookup_field(pdf_obj *form, char *name)\n{\n\tchar *dot;\n\tchar *namep;\n\tpdf_obj *dict = NULL;\n\tint len;\n\n\t/* Process the fully qualified field name which has\n\t* the partial names delimited by '.'. Pretend there\n\t* was a preceding '.' to simplify the loop */\n\tdot = name - 1;\n\n\twhile (dot && form)\n\t{\n\t\tnamep = dot + 1;\n\t\tdot = strchr(namep, '.');\n\t\tlen = dot ? dot - namep : strlen(namep);\n\t\tdict = find_field(form, namep, len);\n\t\tif (dot)\n\t\t\tform = pdf_dict_gets(dict, \"Kids\");\n\t}\n\n\treturn dict;\n}\n\nstatic void reset_field(pdf_document *doc, pdf_obj *field)\n{\n\tfz_context *ctx = doc->ctx;\n\t/* Set V to DV whereever DV is present, and delete V where DV is not.\n\t * FIXME: we assume for now that V has not been set unequal\n\t * to DV higher in the hierarchy than \"field\".\n\t *\n\t * At the bottom of the hierarchy we may find widget annotations\n\t * that aren't also fields, but DV and V will not be present in their\n\t * dictionaries, and attempts to remove V will be harmless. */\n\tpdf_obj *dv = pdf_dict_gets(field, \"DV\");\n\tpdf_obj *kids = pdf_dict_gets(field, \"Kids\");\n\n\tif (dv)\n\t\tpdf_dict_puts(field, \"V\", dv);\n\telse\n\t\tpdf_dict_dels(field, \"V\");\n\n\tif (kids == NULL)\n\t{\n\t\t/* The leaves of the tree are widget annotations\n\t\t * In some cases we need to update the appearance state;\n\t\t * in others we need to mark the field as dirty so that\n\t\t * the appearance stream will be regenerated. */\n\t\tswitch (pdf_field_type(doc, field))\n\t\t{\n\t\tcase PDF_WIDGET_TYPE_RADIOBUTTON:\n\t\tcase PDF_WIDGET_TYPE_CHECKBOX:\n\t\t\t{\n\t\t\t\tpdf_obj *leafv = pdf_get_inheritable(doc, field, \"V\");\n\n\t\t\t\tif (leafv)\n\t\t\t\t\tpdf_keep_obj(leafv);\n\t\t\t\telse\n\t\t\t\t\tleafv = pdf_new_name(doc, \"Off\");\n\n\t\t\t\tfz_try(ctx)\n\t\t\t\t{\n\t\t\t\t\tpdf_dict_puts(field, \"AS\", leafv);\n\t\t\t\t}\n\t\t\t\tfz_always(ctx)\n\t\t\t\t{\n\t\t\t\t\tpdf_drop_obj(leafv);\n\t\t\t\t}\n\t\t\t\tfz_catch(ctx)\n\t\t\t\t{\n\t\t\t\t\tfz_rethrow(ctx);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase PDF_WIDGET_TYPE_PUSHBUTTON:\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tpdf_field_mark_dirty(doc, field);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (pdf_field_dirties_document(doc, field))\n\t\tdoc->dirty = 1;\n}\n\nvoid pdf_field_reset(pdf_document *doc, pdf_obj *field)\n{\n\tpdf_obj *kids = pdf_dict_gets(field, \"Kids\");\n\n\treset_field(doc, field);\n\n\tif (kids)\n\t{\n\t\tint i, n = pdf_array_len(kids);\n\n\t\tfor (i = 0; i < n; i++)\n\t\t\tpdf_field_reset(doc, pdf_array_get(kids, i));\n\t}\n}\n\nstatic void add_field_hierarchy_to_array(pdf_obj *array, pdf_obj *field)\n{\n\tpdf_obj *kids = pdf_dict_gets(field, \"Kids\");\n\tpdf_obj *exclude = pdf_dict_gets(field, \"Exclude\");\n\n\tif (exclude)\n\t\treturn;\n\n\tpdf_array_push(array, field);\n\n\tif (kids)\n\t{\n\t\tint i, n = pdf_array_len(kids);\n\n\t\tfor (i = 0; i < n; i++)\n\t\t\tadd_field_hierarchy_to_array(array, pdf_array_get(kids, i));\n\t}\n}\n\n/*\n\tWhen resetting or submitting a form, the fields to act upon are defined\n\tby an array of either field references or field names, plus a flag determining\n\twhether to act upon the fields in the array, or all fields other than those in\n\tthe array. specified_fields interprets this information and produces the array\n\tof fields to be acted upon.\n*/\nstatic pdf_obj *specified_fields(pdf_document *doc, pdf_obj *fields, int exclude)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *form = pdf_dict_getp(pdf_trailer(doc), \"Root/AcroForm/Fields\");\n\tint i, n;\n\tpdf_obj *result = pdf_new_array(doc, 0);\n\tpdf_obj *nil = NULL;\n\n\tfz_var(nil);\n\tfz_try(ctx)\n\t{\n\t\t/* The 'fields' array not being present signals that all fields\n\t\t* should be acted upon, so handle it using the exclude case - excluding none */\n\t\tif (exclude || !fields)\n\t\t{\n\t\t\t/* mark the fields we don't want to act upon */\n\t\t\tnil = pdf_new_null(doc);\n\n\t\t\tn = pdf_array_len(fields);\n\n\t\t\tfor (i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\tpdf_obj *field = pdf_array_get(fields, i);\n\n\t\t\t\tif (pdf_is_string(field))\n\t\t\t\t\tfield = pdf_lookup_field(form, pdf_to_str_buf(field));\n\n\t\t\t\tif (field)\n\t\t\t\t\tpdf_dict_puts(field, \"Exclude\", nil);\n\t\t\t}\n\n\t\t\t/* Act upon all unmarked fields */\n\t\t\tn = pdf_array_len(form);\n\n\t\t\tfor (i = 0; i < n; i++)\n\t\t\t\tadd_field_hierarchy_to_array(result, pdf_array_get(form, i));\n\n\t\t\t/* Unmark the marked fields */\n\t\t\tn = pdf_array_len(fields);\n\n\t\t\tfor (i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\tpdf_obj *field = pdf_array_get(fields, i);\n\n\t\t\t\tif (pdf_is_string(field))\n\t\t\t\t\tfield = pdf_lookup_field(form, pdf_to_str_buf(field));\n\n\t\t\t\tif (field)\n\t\t\t\t\tpdf_dict_dels(field, \"Exclude\");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tn = pdf_array_len(fields);\n\n\t\t\tfor (i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\tpdf_obj *field = pdf_array_get(fields, i);\n\n\t\t\t\tif (pdf_is_string(field))\n\t\t\t\t\tfield = pdf_lookup_field(form, pdf_to_str_buf(field));\n\n\t\t\t\tif (field)\n\t\t\t\t\tadd_field_hierarchy_to_array(result, field);\n\t\t\t}\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(nil);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_obj(result);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn result;\n}\n\nstatic void reset_form(pdf_document *doc, pdf_obj *fields, int exclude)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *sfields = specified_fields(doc, fields, exclude);\n\n\tfz_try(ctx)\n\t{\n\t\tint i, n = pdf_array_len(sfields);\n\n\t\tfor (i = 0; i < n; i++)\n\t\t\treset_field(doc, pdf_array_get(sfields, i));\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(sfields);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void execute_action(pdf_document *doc, pdf_obj *obj, pdf_obj *a)\n{\n\tfz_context *ctx = doc->ctx;\n\tif (a)\n\t{\n\t\tchar *type = pdf_to_name(pdf_dict_gets(a, \"S\"));\n\n\t\tif (!strcmp(type, \"JavaScript\"))\n\t\t{\n\t\t\tpdf_obj *js = pdf_dict_gets(a, \"JS\");\n\t\t\tif (js)\n\t\t\t{\n\t\t\t\tchar *code = pdf_to_utf8(doc, js);\n\t\t\t\tfz_try(ctx)\n\t\t\t\t{\n\t\t\t\t\tpdf_js_execute(doc->js, code);\n\t\t\t\t}\n\t\t\t\tfz_always(ctx)\n\t\t\t\t{\n\t\t\t\t\tfz_free(ctx, code);\n\t\t\t\t}\n\t\t\t\tfz_catch(ctx)\n\t\t\t\t{\n\t\t\t\t\tfz_rethrow(ctx);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if (!strcmp(type, \"ResetForm\"))\n\t\t{\n\t\t\treset_form(doc, pdf_dict_gets(a, \"Fields\"), pdf_to_int(pdf_dict_gets(a, \"Flags\")) & 1);\n\t\t}\n\t\telse if (!strcmp(type, \"Named\"))\n\t\t{\n\t\t\tchar *name = pdf_to_name(pdf_dict_gets(a, \"N\"));\n\n\t\t\tif (!strcmp(name, \"Print\"))\n\t\t\t\tpdf_event_issue_print(doc);\n\t\t}\n\t}\n}\n\nstatic void execute_action_chain(pdf_document *doc, pdf_obj *obj)\n{\n\tpdf_obj *a = pdf_dict_gets(obj, \"A\");\n\tpdf_js_event e;\n\n\te.target = obj;\n\te.value = \"\";\n\tpdf_js_setup_event(doc->js, &e);\n\n\twhile (a)\n\t{\n\t\texecute_action(doc, obj, a);\n\t\ta = pdf_dict_gets(a, \"Next\");\n\t}\n}\n\nstatic void execute_additional_action(pdf_document *doc, pdf_obj *obj, char *act)\n{\n\tpdf_obj *a = pdf_dict_getp(obj, act);\n\n\tif (a)\n\t{\n\t\tpdf_js_event e;\n\n\t\te.target = obj;\n\t\te.value = \"\";\n\t\tpdf_js_setup_event(doc->js, &e);\n\t\texecute_action(doc, obj, a);\n\t}\n}\n\nstatic void check_off(pdf_document *doc, pdf_obj *obj)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *off = NULL;\n\n\tfz_var(off);\n\tfz_try(ctx);\n\t{\n\t\toff = pdf_new_name(doc, \"Off\");\n\t\tpdf_dict_puts(obj, \"AS\", off);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(off);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void set_check(pdf_document *doc, pdf_obj *chk, char *name)\n{\n\tpdf_obj *n = pdf_dict_getp(chk, \"AP/N\");\n\tpdf_obj *val = NULL;\n\tfz_context *ctx = doc->ctx;\n\n\tfz_var(val);\n\tfz_try(ctx)\n\t{\n\t\t/* If name is a possible value of this check\n\t\t* box then use it, otherwise use \"Off\" */\n\t\tif (pdf_dict_gets(n, name))\n\t\t\tval = pdf_new_name(doc, name);\n\t\telse\n\t\t\tval = pdf_new_name(doc, \"Off\");\n\n\t\tpdf_dict_puts(chk, \"AS\", val);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(val);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\n/* Set the values of all fields in a group defined by a node\n * in the hierarchy */\nstatic void set_check_grp(pdf_document *doc, pdf_obj *grp, char *val)\n{\n\tpdf_obj *kids = pdf_dict_gets(grp, \"Kids\");\n\n\tif (kids == NULL)\n\t{\n\t\tset_check(doc, grp, val);\n\t}\n\telse\n\t{\n\t\tint i, n = pdf_array_len(kids);\n\n\t\tfor (i = 0; i < n; i++)\n\t\t\tset_check_grp(doc, pdf_array_get(kids, i), val);\n\t}\n}\n\nstatic void recalculate(pdf_document *doc)\n{\n\tfz_context *ctx = doc->ctx;\n\n\tif (doc->recalculating)\n\t\treturn;\n\n\tdoc->recalculating = 1;\n\tfz_try(ctx)\n\t{\n\t\tpdf_obj *co = pdf_dict_getp(pdf_trailer(doc), \"Root/AcroForm/CO\");\n\n\t\tif (co && doc->js)\n\t\t{\n\t\t\tint i, n = pdf_array_len(co);\n\n\t\t\tfor (i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\tpdf_obj *field = pdf_array_get(co, i);\n\t\t\t\tpdf_obj *calc = pdf_dict_getp(field, \"AA/C\");\n\n\t\t\t\tif (calc)\n\t\t\t\t{\n\t\t\t\t\tpdf_js_event e;\n\n\t\t\t\t\te.target = field;\n\t\t\t\t\te.value = pdf_field_value(doc, field);\n\t\t\t\t\tpdf_js_setup_event(doc->js, &e);\n\t\t\t\t\texecute_action(doc, field, calc);\n\t\t\t\t\t/* A calculate action, updates event.value. We need\n\t\t\t\t\t* to place the value in the field */\n\t\t\t\t\tupdate_field_value(doc, field, pdf_js_get_event(doc->js)->value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tdoc->recalculating = 0;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void toggle_check_box(pdf_document *doc, pdf_obj *obj)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *as = pdf_dict_gets(obj, \"AS\");\n\tint ff = pdf_get_field_flags(doc, obj);\n\tint radio = ((ff & (Ff_Pushbutton|Ff_Radio)) == Ff_Radio);\n\tchar *val = NULL;\n\tpdf_obj *grp = radio ? pdf_dict_gets(obj, \"Parent\") : find_head_of_field_group(obj);\n\n\tif (!grp)\n\t\tgrp = obj;\n\n\tif (as && strcmp(pdf_to_name(as), \"Off\"))\n\t{\n\t\t/* \"as\" neither missing nor set to Off. Set it to Off, unless\n\t\t * this is a non-toggle-off radio button. */\n\t\tif ((ff & (Ff_Pushbutton|Ff_NoToggleToOff|Ff_Radio)) != (Ff_NoToggleToOff|Ff_Radio))\n\t\t{\n\t\t\tcheck_off(doc, obj);\n\t\t\tval = \"Off\";\n\t\t}\n\t}\n\telse\n\t{\n\t\tpdf_obj *n, *key = NULL;\n\t\tint len, i;\n\n\t\tn = pdf_dict_getp(obj, \"AP/N\");\n\n\t\t/* Look for a key that isn't \"Off\" */\n\t\tlen = pdf_dict_len(n);\n\t\tfor (i = 0; i < len; i++)\n\t\t{\n\t\t\tkey = pdf_dict_get_key(n, i);\n\t\t\tif (pdf_is_name(key) && strcmp(pdf_to_name(key), \"Off\"))\n\t\t\t\tbreak;\n\t\t}\n\n\t\t/* If we found no alternative value to Off then we have no value to use */\n\t\tif (!key)\n\t\t\treturn;\n\n\t\tval = pdf_to_name(key);\n\n\t\tif (radio)\n\t\t{\n\t\t\t/* For radio buttons, first turn off all buttons in the group and\n\t\t\t * then set the one that was clicked */\n\t\t\tpdf_obj *kids = pdf_dict_gets(grp, \"Kids\");\n\n\t\t\tlen = pdf_array_len(kids);\n\t\t\tfor (i = 0; i < len; i++)\n\t\t\t\tcheck_off(doc, pdf_array_get(kids, i));\n\n\t\t\tpdf_dict_puts(obj, \"AS\", key);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* For check boxes, we have located the node of the field hierarchy\n\t\t\t * below which all fields share a name with the clicked one. Set\n\t\t\t * all to the same value. This may cause the group to act like\n\t\t\t * radio buttons, if each have distinct \"On\" values */\n\t\t\tif (grp)\n\t\t\t\tset_check_grp(doc, grp, val);\n\t\t\telse\n\t\t\t\tset_check(doc, obj, val);\n\t\t}\n\t}\n\n\tif (val && grp)\n\t{\n\t\tpdf_obj *v = NULL;\n\n\t\tfz_var(v);\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tv = pdf_new_string(doc, val, strlen(val));\n\t\t\tpdf_dict_puts(grp, \"V\", v);\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tpdf_drop_obj(v);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\n\t\trecalculate(doc);\n\t}\n}\n\nint pdf_has_unsaved_changes(pdf_document *doc)\n{\n\treturn doc->dirty;\n}\n\nint pdf_pass_event(pdf_document *doc, pdf_page *page, pdf_ui_event *ui_event)\n{\n\tpdf_annot *annot;\n\tpdf_hotspot *hp = &doc->hotspot;\n\tfz_point *pt = &(ui_event->event.pointer.pt);\n\tint changed = 0;\n\n\tif (page == NULL)\n\t\treturn 0;\n\n\tfor (annot = page->annots; annot; annot = annot->next)\n\t{\n\t\tif (pt->x >= annot->pagerect.x0 && pt->x <= annot->pagerect.x1)\n\t\t\tif (pt->y >= annot->pagerect.y0 && pt->y <= annot->pagerect.y1)\n\t\t\t\tbreak;\n\t}\n\n\tif (annot)\n\t{\n\t\tint f = pdf_to_int(pdf_dict_gets(annot->obj, \"F\"));\n\n\t\tif (f & (F_Hidden|F_NoView))\n\t\t\tannot = NULL;\n\t}\n\n\tswitch (ui_event->etype)\n\t{\n\tcase PDF_EVENT_TYPE_POINTER:\n\t\t{\n\t\t\tswitch (ui_event->event.pointer.ptype)\n\t\t\t{\n\t\t\tcase PDF_POINTER_DOWN:\n\t\t\t\tif (doc->focus_obj)\n\t\t\t\t{\n\t\t\t\t\t/* Execute the blur action */\n\t\t\t\t\texecute_additional_action(doc, doc->focus_obj, \"AA/Bl\");\n\t\t\t\t\tdoc->focus = NULL;\n\t\t\t\t\tpdf_drop_obj(doc->focus_obj);\n\t\t\t\t\tdoc->focus_obj = NULL;\n\t\t\t\t}\n\n\t\t\t\tif (annot)\n\t\t\t\t{\n\t\t\t\t\tdoc->focus = annot;\n\t\t\t\t\tdoc->focus_obj = pdf_keep_obj(annot->obj);\n\n\t\t\t\t\thp->num = pdf_to_num(annot->obj);\n\t\t\t\t\thp->gen = pdf_to_gen(annot->obj);\n\t\t\t\t\thp->state = HOTSPOT_POINTER_DOWN;\n\t\t\t\t\tchanged = 1;\n\t\t\t\t\t/* Exectute the down and focus actions */\n\t\t\t\t\texecute_additional_action(doc, annot->obj, \"AA/Fo\");\n\t\t\t\t\texecute_additional_action(doc, annot->obj, \"AA/D\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase PDF_POINTER_UP:\n\t\t\t\tif (hp->state != 0)\n\t\t\t\t\tchanged = 1;\n\n\t\t\t\thp->num = 0;\n\t\t\t\thp->gen = 0;\n\t\t\t\thp->state = 0;\n\n\t\t\t\tif (annot)\n\t\t\t\t{\n\t\t\t\t\tswitch (annot->widget_type)\n\t\t\t\t\t{\n\t\t\t\t\tcase PDF_WIDGET_TYPE_RADIOBUTTON:\n\t\t\t\t\tcase PDF_WIDGET_TYPE_CHECKBOX:\n\t\t\t\t\t\t/* FIXME: treating radio buttons like check boxes, for now */\n\t\t\t\t\t\ttoggle_check_box(doc, annot->obj);\n\t\t\t\t\t\tchanged = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Execute the up action */\n\t\t\t\t\texecute_additional_action(doc, annot->obj, \"AA/U\");\n\t\t\t\t\t/* Execute the main action chain */\n\t\t\t\t\texecute_action_chain(doc, annot->obj);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tbreak;\n\t}\n\n\treturn changed;\n}\n\nvoid pdf_update_page(pdf_document *doc, pdf_page *page)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_annot *annot;\n\n\t/* Reset changed_annots to empty */\n\tpage->changed_annots = NULL;\n\n\t/*\n\t\tFree all annots in tmp_annots, since these were\n\t\treferenced only from changed_annots.\n\t*/\n\tif (page->tmp_annots)\n\t{\n\t\tpdf_free_annot(ctx, page->tmp_annots);\n\t\tpage->tmp_annots = NULL;\n\t}\n\n\t/* Add all changed annots to the list */\n\tfor (annot = page->annots; annot; annot = annot->next)\n\t{\n\t\tpdf_xobject *ap = pdf_keep_xobject(ctx, annot->ap);\n\t\tint ap_iteration = annot->ap_iteration;\n\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tpdf_update_annot(doc, annot);\n\n\t\t\tif ((ap != annot->ap || ap_iteration != annot->ap_iteration))\n\t\t\t{\n\t\t\t\tannot->next_changed = page->changed_annots;\n\t\t\t\tpage->changed_annots = annot;\n\t\t\t}\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tpdf_drop_xobject(ctx, ap);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t}\n\n\t/*\n\t\tAdd all deleted annots to the list, since these also\n\t\twarrant a screen update\n\t*/\n\tfor (annot = page->deleted_annots; annot; annot = annot->next)\n\t{\n\t\tannot->next_changed = page->changed_annots;\n\t\tpage->changed_annots = annot;\n\t}\n\n\t/*\n\t\tMove deleted_annots to tmp_annots to keep them separate\n\t\tfrom any future deleted ones. They cannot yet be freed\n\t\tsince they are linked into changed_annots\n\t*/\n\tpage->tmp_annots = page->deleted_annots;\n\tpage->deleted_annots = NULL;\n}\n\npdf_annot *pdf_poll_changed_annot(pdf_document *idoc, pdf_page *page)\n{\n\tpdf_annot *annot = page->changed_annots;\n\n\tif (annot)\n\t\tpage->changed_annots = annot->next_changed;\n\n\treturn annot;\n}\n\npdf_widget *pdf_focused_widget(pdf_document *doc)\n{\n\treturn (pdf_widget *)doc->focus;\n}\n\npdf_widget *pdf_first_widget(pdf_document *doc, pdf_page *page)\n{\n\tpdf_annot *annot = page->annots;\n\n\twhile (annot && annot->widget_type == PDF_WIDGET_TYPE_NOT_WIDGET)\n\t\tannot = annot->next;\n\n\treturn (pdf_widget *)annot;\n}\n\npdf_widget *pdf_next_widget(pdf_widget *previous)\n{\n\tpdf_annot *annot = (pdf_annot *)previous;\n\n\tif (annot)\n\t\tannot = annot->next;\n\n\twhile (annot && annot->widget_type == PDF_WIDGET_TYPE_NOT_WIDGET)\n\t\tannot = annot->next;\n\n\treturn (pdf_widget *)annot;\n}\n\npdf_widget *pdf_create_widget(pdf_document *doc, pdf_page *page, int type, char *fieldname)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *form = NULL;\n\tint old_sigflags = pdf_to_int(pdf_dict_getp(pdf_trailer(doc), \"Root/AcroForm/SigFlags\"));\n\tpdf_annot *annot = pdf_create_annot(doc, page, FZ_ANNOT_WIDGET);\n\n\tfz_try(ctx)\n\t{\n\t\tpdf_set_field_type(doc, annot->obj, type);\n\t\tpdf_dict_puts_drop(annot->obj, \"T\", pdf_new_string(doc, fieldname, strlen(fieldname)));\n\t\tannot->widget_type = type;\n\n\t\tif (type == PDF_WIDGET_TYPE_SIGNATURE)\n\t\t{\n\t\t\tint sigflags = (old_sigflags | (SigFlag_SignaturesExist|SigFlag_AppendOnly));\n\t\t\tpdf_dict_putp_drop(pdf_trailer(doc), \"Root/AcroForm/SigFlags\", pdf_new_int(doc, sigflags));\n\t\t}\n\n\t\t/*\n\t\tpdf_create_annot will have linked the new widget into the page's\n\t\tannot array. We also need it linked into the document's form\n\t\t*/\n\t\tform = pdf_dict_getp(pdf_trailer(doc), \"Root/AcroForm/Fields\");\n\t\tif (!form)\n\t\t{\n\t\t\tform = pdf_new_array(doc, 1);\n\t\t\tpdf_dict_putp_drop(pdf_trailer(doc), \"Root/AcroForm/Fields\", form);\n\t\t}\n\n\t\tpdf_array_push(form, annot->obj); /* Cleanup relies on this statement being last */\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_delete_annot(doc, page, annot);\n\n\t\t/* An empty Fields array may have been created, but that is harmless */\n\n\t\tif (type == PDF_WIDGET_TYPE_SIGNATURE)\n\t\t\tpdf_dict_putp_drop(pdf_trailer(doc), \"Root/AcroForm/SigFlags\", pdf_new_int(doc, old_sigflags));\n\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn (pdf_widget *)annot;\n}\n\nint pdf_widget_get_type(pdf_widget *widget)\n{\n\tpdf_annot *annot = (pdf_annot *)widget;\n\treturn annot->widget_type;\n}\n\nstatic int set_text_field_value(pdf_document *doc, pdf_obj *field, char *text)\n{\n\tpdf_obj *v = pdf_dict_getp(field, \"AA/V\");\n\n\tif (v && doc->js)\n\t{\n\t\tpdf_js_event e;\n\n\t\te.target = field;\n\t\te.value = text;\n\t\tpdf_js_setup_event(doc->js, &e);\n\t\texecute_action(doc, field, v);\n\n\t\tif (!pdf_js_get_event(doc->js)->rc)\n\t\t\treturn 0;\n\n\t\ttext = pdf_js_get_event(doc->js)->value;\n\t}\n\n\tif (pdf_field_dirties_document(doc, field))\n\t\tdoc->dirty = 1;\n\tupdate_field_value(doc, field, text);\n\n\treturn 1;\n}\n\nstatic void update_checkbox_selector(pdf_document *doc, pdf_obj *field, char *val)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *kids = pdf_dict_gets(field, \"Kids\");\n\n\tif (kids)\n\t{\n\t\tint i, n = pdf_array_len(kids);\n\n\t\tfor (i = 0; i < n; i++)\n\t\t\tupdate_checkbox_selector(doc, pdf_array_get(kids, i), val);\n\t}\n\telse\n\t{\n\t\tpdf_obj *n = pdf_dict_getp(field, \"AP/N\");\n\t\tpdf_obj *oval = NULL;\n\n\t\tfz_var(oval);\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tif (pdf_dict_gets(n, val))\n\t\t\t\toval = pdf_new_name(doc, val);\n\t\t\telse\n\t\t\t\toval = pdf_new_name(doc, \"Off\");\n\n\t\t\tpdf_dict_puts(field, \"AS\", oval);\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tpdf_drop_obj(oval);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t}\n}\n\nstatic int set_checkbox_value(pdf_document *doc, pdf_obj *field, char *val)\n{\n\tupdate_checkbox_selector(doc, field, val);\n\tupdate_field_value(doc, field, val);\n\treturn 1;\n}\n\nint pdf_field_set_value(pdf_document *doc, pdf_obj *field, char *text)\n{\n\tint res = 0;\n\n\tswitch (pdf_field_type(doc, field))\n\t{\n\tcase PDF_WIDGET_TYPE_TEXT:\n\t\tres = set_text_field_value(doc, field, text);\n\t\tbreak;\n\n\tcase PDF_WIDGET_TYPE_CHECKBOX:\n\tcase PDF_WIDGET_TYPE_RADIOBUTTON:\n\t\tres = set_checkbox_value(doc, field, text);\n\t\tbreak;\n\n\tdefault:\n\t\t/* text updater will do in most cases */\n\t\tupdate_field_value(doc, field, text);\n\t\tres = 1;\n\t\tbreak;\n\t}\n\n\trecalculate(doc);\n\n\treturn res;\n}\n\nchar *pdf_field_border_style(pdf_document *doc, pdf_obj *field)\n{\n\tchar *bs = pdf_to_name(pdf_dict_getp(field, \"BS/S\"));\n\n\tswitch (*bs)\n\t{\n\tcase 'S': return \"Solid\";\n\tcase 'D': return \"Dashed\";\n\tcase 'B': return \"Beveled\";\n\tcase 'I': return \"Inset\";\n\tcase 'U': return \"Underline\";\n\t}\n\n\treturn \"Solid\";\n}\n\nvoid pdf_field_set_border_style(pdf_document *doc, pdf_obj *field, char *text)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *val = NULL;\n\n\tif (!strcmp(text, \"Solid\"))\n\t\tval = pdf_new_name(doc, \"S\");\n\telse if (!strcmp(text, \"Dashed\"))\n\t\tval = pdf_new_name(doc, \"D\");\n\telse if (!strcmp(text, \"Beveled\"))\n\t\tval = pdf_new_name(doc, \"B\");\n\telse if (!strcmp(text, \"Inset\"))\n\t\tval = pdf_new_name(doc, \"I\");\n\telse if (!strcmp(text, \"Underline\"))\n\t\tval = pdf_new_name(doc, \"U\");\n\telse\n\t\treturn;\n\n\tfz_try(ctx);\n\t{\n\t\tpdf_dict_putp(field, \"BS/S\", val);\n\t\tpdf_field_mark_dirty(doc, field);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(val);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nvoid pdf_field_set_button_caption(pdf_document *doc, pdf_obj *field, char *text)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *val = pdf_new_string(doc, text, strlen(text));\n\n\tfz_try(ctx);\n\t{\n\t\tif (pdf_field_type(doc, field) == PDF_WIDGET_TYPE_PUSHBUTTON)\n\t\t{\n\t\t\tpdf_dict_putp(field, \"MK/CA\", val);\n\t\t\tpdf_field_mark_dirty(doc, field);\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(val);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nint pdf_field_display(pdf_document *doc, pdf_obj *field)\n{\n\tpdf_obj *kids;\n\tint f, res = Display_Visible;\n\n\t/* Base response on first of children. Not ideal,\n\t * but not clear how to handle children with\n\t * differing values */\n\twhile ((kids = pdf_dict_gets(field, \"Kids\")) != NULL)\n\t\tfield = pdf_array_get(kids, 0);\n\n\tf = pdf_to_int(pdf_dict_gets(field, \"F\"));\n\n\tif (f & F_Hidden)\n\t{\n\t\tres = Display_Hidden;\n\t}\n\telse if (f & F_Print)\n\t{\n\t\tif (f & F_NoView)\n\t\t\tres = Display_NoView;\n\t}\n\telse\n\t{\n\t\tif (f & F_NoView)\n\t\t\tres = Display_Hidden;\n\t\telse\n\t\t\tres = Display_NoPrint;\n\t}\n\n\treturn res;\n}\n\n/*\n * get the field name in a char buffer that has spare room to\n * add more characters at the end.\n */\nstatic char *get_field_name(pdf_document *doc, pdf_obj *field, int spare)\n{\n\tfz_context *ctx = doc->ctx;\n\tchar *res = NULL;\n\tpdf_obj *parent = pdf_dict_gets(field, \"Parent\");\n\tchar *lname = pdf_to_str_buf(pdf_dict_gets(field, \"T\"));\n\tint llen = strlen(lname);\n\n\t/*\n\t * If we found a name at this point in the field hierarchy\n\t * then we'll need extra space for it and a dot\n\t */\n\tif (llen)\n\t\tspare += llen+1;\n\n\tif (parent)\n\t{\n\t\tres = get_field_name(doc, parent, spare);\n\t}\n\telse\n\t{\n\t\tres = fz_malloc(ctx, spare+1);\n\t\tres[0] = 0;\n\t}\n\n\tif (llen)\n\t{\n\t\tif (res[0])\n\t\t\tstrcat(res, \".\");\n\n\t\tstrcat(res, lname);\n\t}\n\n\treturn res;\n}\n\nchar *pdf_field_name(pdf_document *doc, pdf_obj *field)\n{\n\treturn get_field_name(doc, field, 0);\n}\n\nvoid pdf_field_set_display(pdf_document *doc, pdf_obj *field, int d)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *kids = pdf_dict_gets(field, \"Kids\");\n\n\tif (!kids)\n\t{\n\t\tint mask = (F_Hidden|F_Print|F_NoView);\n\t\tint f = pdf_to_int(pdf_dict_gets(field, \"F\")) & ~mask;\n\t\tpdf_obj *fo = NULL;\n\n\t\tswitch (d)\n\t\t{\n\t\tcase Display_Visible:\n\t\t\tf |= F_Print;\n\t\t\tbreak;\n\t\tcase Display_Hidden:\n\t\t\tf |= F_Hidden;\n\t\t\tbreak;\n\t\tcase Display_NoView:\n\t\t\tf |= (F_Print|F_NoView);\n\t\t\tbreak;\n\t\tcase Display_NoPrint:\n\t\t\tbreak;\n\t\t}\n\n\t\tfz_var(fo);\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tfo = pdf_new_int(doc, f);\n\t\t\tpdf_dict_puts(field, \"F\", fo);\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tpdf_drop_obj(fo);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t}\n\telse\n\t{\n\t\tint i, n = pdf_array_len(kids);\n\n\t\tfor (i = 0; i < n; i++)\n\t\t\tpdf_field_set_display(doc, pdf_array_get(kids, i), d);\n\t}\n}\n\nvoid pdf_field_set_fill_color(pdf_document *doc, pdf_obj *field, pdf_obj *col)\n{\n\t/* col == NULL mean transparent, but we can simply pass it on as with\n\t * non-NULL values because pdf_dict_putp interprets a NULL value as\n\t * delete */\n\tpdf_dict_putp(field, \"MK/BG\", col);\n\tpdf_field_mark_dirty(doc, field);\n}\n\nvoid pdf_field_set_text_color(pdf_document *doc, pdf_obj *field, pdf_obj *col)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_da_info di;\n\tfz_buffer *fzbuf = NULL;\n\tchar *da = pdf_to_str_buf(pdf_get_inheritable(doc, field, \"DA\"));\n\tunsigned char *buf;\n\tint len;\n\tpdf_obj *daobj = NULL;\n\n\tmemset(&di, 0, sizeof(di));\n\n\tfz_var(fzbuf);\n\tfz_var(di);\n\tfz_var(daobj);\n\tfz_try(ctx)\n\t{\n\t\tint i;\n\n\t\tpdf_parse_da(ctx, da, &di);\n\t\tdi.col_size = pdf_array_len(col);\n\n\t\tlen = fz_mini(di.col_size, nelem(di.col));\n\t\tfor (i = 0; i < len; i++)\n\t\t\tdi.col[i] = pdf_to_real(pdf_array_get(col, i));\n\n\t\tfzbuf = fz_new_buffer(ctx, 0);\n\t\tpdf_fzbuf_print_da(ctx, fzbuf, &di);\n\t\tlen = fz_buffer_storage(ctx, fzbuf, &buf);\n\t\tdaobj = pdf_new_string(doc, (char *)buf, len);\n\t\tpdf_dict_puts(field, \"DA\", daobj);\n\t\tpdf_field_mark_dirty(doc, field);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_da_info_fin(ctx, &di);\n\t\tfz_drop_buffer(ctx, fzbuf);\n\t\tpdf_drop_obj(daobj);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_warn(ctx, \"%s\", fz_caught_message(ctx));\n\t}\n}\n\nfz_rect *pdf_bound_widget(pdf_widget *widget, fz_rect *rect)\n{\n\tpdf_annot *annot = (pdf_annot *)widget;\n\n\tif (rect == NULL)\n\t\treturn NULL;\n\t*rect = annot->pagerect;\n\n\treturn rect;\n}\n\nchar *pdf_text_widget_text(pdf_document *doc, pdf_widget *tw)\n{\n\tpdf_annot *annot = (pdf_annot *)tw;\n\tfz_context *ctx = doc->ctx;\n\tchar *text = NULL;\n\n\tfz_var(text);\n\tfz_try(ctx)\n\t{\n\t\ttext = pdf_field_value(doc, annot->obj);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_warn(ctx, \"failed allocation in fz_text_widget_text\");\n\t}\n\n\treturn text;\n}\n\nint pdf_text_widget_max_len(pdf_document *doc, pdf_widget *tw)\n{\n\tpdf_annot *annot = (pdf_annot *)tw;\n\n\treturn pdf_to_int(pdf_get_inheritable(doc, annot->obj, \"MaxLen\"));\n}\n\nint pdf_text_widget_content_type(pdf_document *doc, pdf_widget *tw)\n{\n\tpdf_annot *annot = (pdf_annot *)tw;\n\tfz_context *ctx = doc->ctx;\n\tchar *code = NULL;\n\tint type = PDF_WIDGET_CONTENT_UNRESTRAINED;\n\n\tfz_var(code);\n\tfz_try(ctx)\n\t{\n\t\tcode = pdf_get_string_or_stream(doc, pdf_dict_getp(annot->obj, \"AA/F/JS\"));\n\t\tif (code)\n\t\t{\n\t\t\tif (strstr(code, \"AFNumber_Format\"))\n\t\t\t\ttype = PDF_WIDGET_CONTENT_NUMBER;\n\t\t\telse if (strstr(code, \"AFSpecial_Format\"))\n\t\t\t\ttype = PDF_WIDGET_CONTENT_SPECIAL;\n\t\t\telse if (strstr(code, \"AFDate_FormatEx\"))\n\t\t\t\ttype = PDF_WIDGET_CONTENT_DATE;\n\t\t\telse if (strstr(code, \"AFTime_FormatEx\"))\n\t\t\t\ttype = PDF_WIDGET_CONTENT_TIME;\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_free(ctx, code);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_warn(ctx, \"failure in fz_text_widget_content_type\");\n\t}\n\n\treturn type;\n}\n\nstatic int run_keystroke(pdf_document *doc, pdf_obj *field, char **text)\n{\n\tpdf_obj *k = pdf_dict_getp(field, \"AA/K\");\n\n\tif (k && doc->js)\n\t{\n\t\tpdf_js_event e;\n\n\t\te.target = field;\n\t\te.value = *text;\n\t\tpdf_js_setup_event(doc->js, &e);\n\t\texecute_action(doc, field, k);\n\n\t\tif (!pdf_js_get_event(doc->js)->rc)\n\t\t\treturn 0;\n\n\t\t*text = pdf_js_get_event(doc->js)->value;\n\t}\n\n\treturn 1;\n}\n\nint pdf_text_widget_set_text(pdf_document *doc, pdf_widget *tw, char *text)\n{\n\tpdf_annot *annot = (pdf_annot *)tw;\n\tfz_context *ctx = doc->ctx;\n\tint accepted = 0;\n\n\tfz_try(ctx)\n\t{\n\t\taccepted = run_keystroke(doc, annot->obj, &text);\n\t\tif (accepted)\n\t\t\taccepted = pdf_field_set_value(doc, annot->obj, text);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_warn(ctx, \"fz_text_widget_set_text failed\");\n\t}\n\n\treturn accepted;\n}\n\nint pdf_choice_widget_options(pdf_document *doc, pdf_widget *tw, char *opts[])\n{\n\tpdf_annot *annot = (pdf_annot *)tw;\n\tpdf_obj *optarr;\n\tint i, n;\n\n\tif (!annot)\n\t\treturn 0;\n\n\toptarr = pdf_dict_gets(annot->obj, \"Opt\");\n\tn = pdf_array_len(optarr);\n\n\tif (opts)\n\t{\n\t\tfor (i = 0; i < n; i++)\n\t\t{\n\t\t\topts[i] = pdf_to_str_buf(pdf_array_get(optarr, i));\n\t\t}\n\t}\n\n\treturn n;\n}\n\nint pdf_choice_widget_is_multiselect(pdf_document *doc, pdf_widget *tw)\n{\n\tpdf_annot *annot = (pdf_annot *)tw;\n\n\tif (!annot) return 0;\n\n\tswitch (pdf_field_type(doc, annot->obj))\n\t{\n\tcase PDF_WIDGET_TYPE_LISTBOX:\n\tcase PDF_WIDGET_TYPE_COMBOBOX:\n\t\treturn (pdf_get_field_flags(doc, annot->obj) & Ff_MultiSelect) != 0;\n\tdefault:\n\t\treturn 0;\n\t}\n}\n\nint pdf_choice_widget_value(pdf_document *doc, pdf_widget *tw, char *opts[])\n{\n\tpdf_annot *annot = (pdf_annot *)tw;\n\tpdf_obj *optarr;\n\tint i, n;\n\n\tif (!annot)\n\t\treturn 0;\n\n\toptarr = pdf_dict_gets(annot->obj, \"V\");\n\n\tif (pdf_is_string(optarr))\n\t{\n\t\tif (opts)\n\t\t\topts[0] = pdf_to_str_buf(optarr);\n\n\t\treturn 1;\n\t}\n\telse\n\t{\n\t\tn = pdf_array_len(optarr);\n\n\t\tif (opts)\n\t\t{\n\t\t\tfor (i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\tpdf_obj *elem = pdf_array_get(optarr, i);\n\n\t\t\t\tif (pdf_is_array(elem))\n\t\t\t\t\telem = pdf_array_get(elem, 1);\n\n\t\t\t\topts[i] = pdf_to_str_buf(elem);\n\t\t\t}\n\t\t}\n\n\t\treturn n;\n\t}\n}\n\nvoid pdf_choice_widget_set_value(pdf_document *doc, pdf_widget *tw, int n, char *opts[])\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_annot *annot = (pdf_annot *)tw;\n\tpdf_obj *optarr = NULL, *opt = NULL;\n\tint i;\n\n\tif (!annot)\n\t\treturn;\n\n\tfz_var(optarr);\n\tfz_var(opt);\n\tfz_try(ctx)\n\t{\n\t\tif (n != 1)\n\t\t{\n\t\t\toptarr = pdf_new_array(doc, n);\n\n\t\t\tfor (i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\topt = pdf_new_string(doc, opts[i], strlen(opts[i]));\n\t\t\t\tpdf_array_push(optarr, opt);\n\t\t\t\tpdf_drop_obj(opt);\n\t\t\t\topt = NULL;\n\t\t\t}\n\n\t\t\tpdf_dict_puts(annot->obj, \"V\", optarr);\n\t\t\tpdf_drop_obj(optarr);\n\t\t}\n\t\telse\n\t\t{\n\t\t\topt = pdf_new_string(doc, opts[0], strlen(opts[0]));\n\t\t\tpdf_dict_puts(annot->obj, \"V\", opt);\n\t\t\tpdf_drop_obj(opt);\n\t\t}\n\n\t\t/* FIXME: when n > 1, we should be regenerating the indexes */\n\t\tpdf_dict_dels(annot->obj, \"I\");\n\n\t\tpdf_field_mark_dirty(doc, annot->obj);\n\t\tif (pdf_field_dirties_document(doc, annot->obj))\n\t\t\tdoc->dirty = 1;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_obj(optarr);\n\t\tpdf_drop_obj(opt);\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nint pdf_signature_widget_byte_range(pdf_document *doc, pdf_widget *widget, int (*byte_range)[2])\n{\n\tpdf_annot *annot = (pdf_annot *)widget;\n\tpdf_obj *br = pdf_dict_getp(annot->obj, \"V/ByteRange\");\n\tint i, n = pdf_array_len(br)/2;\n\n\tif (byte_range)\n\t{\n\t\tfor (i = 0; i < n; i++)\n\t\t{\n\t\t\tbyte_range[i][0] = pdf_to_int(pdf_array_get(br, 2*i));\n\t\t\tbyte_range[i][1] = pdf_to_int(pdf_array_get(br, 2*i+1));\n\t\t}\n\t}\n\n\treturn n;\n}\n\nint pdf_signature_widget_contents(pdf_document *doc, pdf_widget *widget, char **contents)\n{\n\tpdf_annot *annot = (pdf_annot *)widget;\n\tpdf_obj *c = pdf_dict_getp(annot->obj, \"V/Contents\");\n\tif (contents)\n\t\t*contents = pdf_to_str_buf(c);\n\treturn pdf_to_str_len(c);\n}\n\nvoid pdf_signature_set_value(pdf_document *doc, pdf_obj *field, pdf_signer *signer)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *v;\n\tpdf_obj *indv;\n\tint vnum;\n\tpdf_obj *byte_range;\n\tpdf_obj *contents;\n\tchar buf[2048];\n\tpdf_unsaved_sig *unsaved_sig;\n\n\tmemset(buf, 0, sizeof(buf));\n\n\tvnum = pdf_create_object(doc);\n\tindv = pdf_new_indirect(doc, vnum, 0);\n\tpdf_dict_puts_drop(field, \"V\", indv);\n\n\tfz_var(v);\n\tfz_try(ctx)\n\t{\n\t\tv = pdf_new_dict(doc, 4);\n\t\tpdf_update_object(doc, vnum, v);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(v);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\tbyte_range = pdf_new_array(doc, 4);\n\tpdf_dict_puts_drop(v, \"ByteRange\", byte_range);\n\n\tcontents = pdf_new_string(doc, buf, sizeof(buf));\n\tpdf_dict_puts_drop(v, \"Contents\", contents);\n\n\tpdf_dict_puts_drop(v, \"Filter\", pdf_new_name(doc, \"Adobe.PPKLite\"));\n\tpdf_dict_puts_drop(v, \"SubFilter\", pdf_new_name(doc, \"adbe.pkcs7.detached\"));\n\n\t/* Record details within the document structure so that contents\n\t * and byte_range can be updated with their correct values at\n\t * saving time */\n\tunsaved_sig = fz_malloc_struct(doc->ctx, pdf_unsaved_sig);\n\tunsaved_sig->field = pdf_keep_obj(field);\n\tunsaved_sig->signer = pdf_keep_signer(signer);\n\tunsaved_sig->next = doc->unsaved_sigs;\n\tdoc->unsaved_sigs = unsaved_sig;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-ft-tools.c",
    "content": "#include \"mupdf/pdf.h\"\n\n/**\n * the following code has been adapted from\n * http://code.google.com/p/ezgdi/source/browse/trunk/ezgdi/ft2vert.c?r=56\n * \n * per http://code.google.com/p/ezgdi/ the whole project is licensed both\n * under GPLv3 and the FreeType license\n */\n\n/*\n * \"ft2vert.c\"\n * \n * Converter to vertical glyph ID by handling GSUB vrt2/vert feature\n * requires FreeType-2.1.10 or latter\n *\n * (C) 2005 Nobuyuki TSUCHIMURA\n *\n * using such Lookup\n *   ScriptTag == 'kana'\n *   DefaultLangSys or LangSysTag == 'JAN '\n *   FeatureTag == 'vrt2' or 'vert'\n *\n * [reference]\n * http://partners.adobe.com/public/developer/opentype/index_table_formats1.html\n * http://partners.adobe.com/public/developer/opentype/index_table_formats.html\n * http://partners.adobe.com/public/developer/opentype/index_tag9.html#vrt2\n */\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_OPENTYPE_VALIDATE_H\n\n#define TAG_KANA FT_MAKE_TAG('k', 'a', 'n', 'a')\n#define TAG_JAN  FT_MAKE_TAG('J', 'A', 'N', ' ')\n#define TAG_VERT FT_MAKE_TAG('v', 'e', 'r', 't')\n#define TAG_VRT2 FT_MAKE_TAG('v', 'r', 't', '2')\n\n#define BYTE2(p) ((p) += 2, (int)(p)[-2] << 8  | (p)[-1])\n#define BYTE4(p) ((p) += 4, (int)(p)[-4] << 24 | (int)(p)[-3] << 16 | (int)(p)[-2] << 8 | (p)[-1])\n\nstruct ft2vert_st\n{\n\tint SubTableCount;\n\tstruct SubTable_st\n\t{\n\t\tstruct SingleSubst_st\n\t\t{\n\t\t\tFT_UInt SubstFormat;\n\t\t\tFT_UInt DeltaGlyphID; /* SubstFormat == 1 */\n\t\t\tint     GlyphCount;   /* SubstFormat == 2 */\n\t\t\tFT_UInt *Substitute;  /* SubstFormat == 2 */\n\t\t} SingleSubst;\n\t\tstruct Coverage_st\n\t\t{\n\t\t\tFT_UInt CoverageFormat;\n\t\t\tint     GlyphCount;   /* CoverageFormat == 1 */\n\t\t\tFT_UInt *GlyphArray;  /* CoverageFormat == 1 */\n\t\t\tint     RangeCount;   /* CoverageFormat == 2 */\n\t\t\tstruct  RangeRecord_st\n\t\t\t{\n\t\t\t\tFT_UInt Start, End;\n\t\t\t} *RangeRecord;       /* CoverageFormat == 2 */\n\t\t} Coverage;\n\t} *SubTable;\n\n\tFT_Bytes GSUB_table;\n\tFT_Bytes kanaFeature;\n\tFT_Bytes vertLookup, vrt2Lookup;\n\n\tfz_context *ctx;\n};\n\n\nstatic int isInIndex(FT_Bytes s, int index)\n{\n\tint i, count;\n\n\tif (s == NULL)\n\t\treturn 0;\n\tcount = BYTE2(s);\n\tfor (i = 0; i < count; i++)\n\t\tif (index == BYTE2(s))\n\t\t\treturn 1;\n\treturn 0;\n}\n\n/**********  Lookup part ***************/\n\nstatic void scan_Coverage(struct ft2vert_st *ret, const FT_Bytes top)\n{\n\tint i;\n\tFT_Bytes s = top;\n\tstruct Coverage_st *t;\n\n\tt = &ret->SubTable[ret->SubTableCount].Coverage;\n\tt->CoverageFormat = BYTE2(s);\n\tswitch (t->CoverageFormat)\n\t{\n\tcase 1:\n\t\tt->GlyphCount = BYTE2(s);\n\t\tt->GlyphArray = fz_malloc_array(ret->ctx, t->GlyphCount, sizeof(t->GlyphArray[0]));\n\t\tmemset(t->GlyphArray, 0, t->GlyphCount * sizeof(t->GlyphArray[0]));\n\t\tfor (i = 0; i < t->GlyphCount; i++)\n\t\t\tt->GlyphArray[i] = BYTE2(s);\n\t\tbreak;\n\tcase 2:\n\t\tt->RangeCount = BYTE2(s);\n\t\tt->RangeRecord = fz_malloc_array(ret->ctx, t->RangeCount, sizeof(t->RangeRecord[0]));\n\t\tmemset(t->RangeRecord, 0, t->RangeCount * sizeof(t->RangeRecord[0]));\n\t\tfor (i = 0; i < t->RangeCount; i++)\n\t\t{\n\t\t\tt->RangeRecord[i].Start = BYTE2(s);\n\t\t\tt->RangeRecord[i].End   = BYTE2(s);\n\t\t\ts += 2; /* drop StartCoverageIndex */\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tfz_warn(ret->ctx, \"scan_Coverage: unknown CoverageFormat (%d).\", t->CoverageFormat);\n\t\treturn;\n\t}\n\tret->SubTableCount++;\n}\n\nstatic void scan_SubTable(struct ft2vert_st *ret, const FT_Bytes top)\n{\n\tint i;\n\tFT_Bytes s = top;\n\tFT_Offset Coverage;\n\tstruct SingleSubst_st *t;\n\n\tt = &ret->SubTable[ret->SubTableCount].SingleSubst;\n\tt->SubstFormat = BYTE2(s);\n\tCoverage       = BYTE2(s);\n\tscan_Coverage(ret, top + Coverage);\n\tswitch (t->SubstFormat)\n\t{\n\tcase 1: /* SingleSubstFormat1 */\n\t\tt->DeltaGlyphID = BYTE2(s);\n\t\tbreak;\n\tcase 2: /* SingleSubstFormat2 */\n\t\tt->GlyphCount   = BYTE2(s);\n\t\tt->Substitute = fz_malloc_array(ret->ctx, t->GlyphCount, sizeof(t->Substitute[0]));\n\t\tmemset(t->Substitute, 0, t->GlyphCount * sizeof(t->Substitute[0]));\n\t\tfor (i = 0; i < t->GlyphCount; i++)\n\t\t\tt->Substitute[i] = BYTE2(s);\n\t\tbreak;\n\tdefault:\n\t\tfz_warn(ret->ctx, \"scan_SubTable: unknown SubstFormat (%d).\", t->SubstFormat);\n\t}\n}\n\nstatic void scan_Lookup(struct ft2vert_st *ret, const FT_Bytes top)\n{\n\tint i;\n\tFT_Bytes s = top;\n\tFT_UShort LookupType;\n\tFT_UShort LookupFlag;\n\tFT_UShort SubTableCount;\n\tFT_UShort SubTable;\n\n\tLookupType    = BYTE2(s);\n\tLookupFlag    = BYTE2(s);\n\tSubTableCount = BYTE2(s);\n\tSubTable      = BYTE2(s);\n\n\tret->SubTable = fz_malloc_array(ret->ctx, SubTableCount, sizeof(ret->SubTable[0]));\n\tmemset(ret->SubTable, 0, SubTableCount * sizeof(ret->SubTable[0]));\n\tfor (i = 0; i < SubTableCount; i++)\n\t\tscan_SubTable(ret, top + SubTable);\n\n\tif (ret->SubTableCount != SubTableCount)\n\t\tfz_warn(ret->ctx, \"scan_Lookup: SubTableCount (=%d) is not expected (=%d).\",\n\t\t\t\tret->SubTableCount, SubTableCount);\n}\n\nstatic void scan_LookupList(struct ft2vert_st *ret, const FT_Bytes top)\n{\n\tint i;\n\tFT_Bytes s = top;\n\tint LookupCount;\n\n\tLookupCount = BYTE2(s);\n\n\tfor (i = 0; i < LookupCount; i++)\n\t{\n\t\tFT_Bytes t = top + BYTE2(s);\n\t\tif (isInIndex(ret->vertLookup, i))\n\t\t\tscan_Lookup(ret, t);\n\t}\n}\n\n/********** Feature part ****************/\n\nstatic void scan_FeatureList(struct ft2vert_st *ret, const FT_Bytes top)\n{\n\tint i;\n\tFT_Bytes s = top;\n\tint FeatureCount;\n\n\tFeatureCount = BYTE2(s);\n\n\tfor (i = 0; i < FeatureCount; i++)\n\t{\n\t\tFT_Tag FeatureTag = BYTE4(s);\n\t\tFT_Offset Feature = BYTE2(s);\n\t\tif (isInIndex(ret->kanaFeature, i))\n\t\t{\n\t\t\tswitch (FeatureTag)\n\t\t\t{\n\t\t\tcase TAG_VERT: ret->vertLookup = top + Feature + 2; break;\n\t\t\tcase TAG_VRT2: ret->vrt2Lookup = top + Feature + 2; break;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/********** Script part ****************/\n\nstatic void scan_LangSys(struct ft2vert_st *ret, const FT_Bytes top, const FT_Tag ScriptTag)\n{\n\tif (ScriptTag == TAG_KANA && ret->kanaFeature == NULL)\n\t\tret->kanaFeature = top + 4;\n}\n\nstatic void scan_Script(struct ft2vert_st *ret, const FT_Bytes top, const FT_Tag ScriptTag)\n{\n\tint i;\n\tFT_Bytes s = top;\n\tFT_Offset DefaultLangSys;\n\tint LangSysCount;\n\n\tDefaultLangSys = BYTE2(s);\n\tif (DefaultLangSys != 0)\n\t\tscan_LangSys(ret, top + DefaultLangSys, ScriptTag);\n\tLangSysCount = BYTE2(s);\n\n\tfor (i = 0; i < LangSysCount; i++)\n\t{\n\t\tFT_Tag LangSysTag = BYTE4(s);\n\t\tFT_Bytes t = top + BYTE2(s);\n\t\tif (LangSysTag == TAG_JAN)\n\t\t\tscan_LangSys(ret, t, ScriptTag);\n\t}\n}\n\nstatic void scan_ScriptList(struct ft2vert_st *ret, const FT_Bytes top)\n{\n\tint i;\n\tFT_Bytes s = top;\n\tint ScriptCount;\n\n\tScriptCount = BYTE2(s);\n\n\tfor (i = 0; i < ScriptCount; i++)\n\t{\n\t\tFT_Tag ScriptTag = BYTE4(s);\n\t\tFT_Bytes t = top + BYTE2(s);\n\t\tif (ScriptTag == TAG_KANA)\n\t\t\tscan_Script(ret, t, ScriptTag);\n\t}\n}\n\n/********** header part *****************/\n\nstatic void scan_GSUB_Header(struct ft2vert_st *ret, const FT_Bytes top)\n{\n\tFT_Bytes s = top;\n\tFT_Fixed  Version;\n\tFT_Offset ScriptList;\n\tFT_Offset FeatureList;\n\tFT_Offset LookupList;\n\n\tVersion     = BYTE4(s);\n\tScriptList  = BYTE2(s);\n\tFeatureList = BYTE2(s);\n\tLookupList  = BYTE2(s);\n\n\tif (Version != 0x00010000)\n\t\tfz_warn(ret->ctx, \"GSUB Version (=%.1f) is not 1.0\", (double)Version / 0x10000);\n\n\tscan_ScriptList(ret, top + ScriptList);\n\tscan_FeatureList(ret, top + FeatureList);\n\t/* vrt2 has higher priority over vert */\n\tif (ret->vrt2Lookup != NULL)\n\t\tret->vertLookup = ret->vrt2Lookup;\n\tscan_LookupList(ret, top + LookupList);\n}\n\nstatic struct ft2vert_st *ft2vert_init(fz_context *ctx, FT_Face face)\n{\n\tstruct ft2vert_st *ret;\n\tint ft_error;\n\tFT_Bytes base, gdef, gpos, jstf;\n\n\tret = fz_malloc(ctx, sizeof(ret[0]));\n\tmemset(ret, 0, sizeof(ret[0]));\n\tret->ctx = ctx;\n\n\tft_error = FT_OpenType_Validate(face, FT_VALIDATE_GSUB, &base, &gdef, &gpos, &ret->GSUB_table, &jstf);\n\tassert(ft_error != FT_Err_Unimplemented_Feature); // make sure to enable the otvalid module\n\tif (ft_error != 0 || ret->GSUB_table == 0)\n\t{\n\t\tfz_warn(ctx, \"%s has no GSUB table.\", face->family_name);\n\t\treturn ret;\n\t}\n\tscan_GSUB_Header(ret, ret->GSUB_table);\n\tif (ret->SubTableCount == 0)\n\t\tfz_warn(ctx, \"%s has no vrt2/vert feature.\", face->family_name);\n\n\treturn ret;\n}\n\nstatic void ft2vert_final(FT_Face face, struct ft2vert_st *vert){\n\tfz_context *ctx = vert->ctx;\n\tint j;\n\tfor (j = 0; j < vert->SubTableCount; j++)\n\t{\n\t\tfz_free(ctx, vert->SubTable[j].SingleSubst.Substitute);\n\t\tfz_free(ctx, vert->SubTable[j].Coverage.GlyphArray);\n\t\tfz_free(ctx, vert->SubTable[j].Coverage.RangeRecord);\n\t}\n\tfz_free(ctx, vert->SubTable);\n\tFT_OpenType_Free(face, vert->GSUB_table);\n\tfz_free(ctx, vert);\n}\n\n/********** converting part *****************/\n\nstatic FT_UInt get_vert_nth_gid(fz_context *ctx, struct SubTable_st *t, FT_UInt gid, int n)\n{\n\tswitch (t->SingleSubst.SubstFormat)\n\t{\n\tcase 1: return gid + t->SingleSubst.DeltaGlyphID;\n\tcase 2: return t->SingleSubst.Substitute[n];\n\tdefault: fz_warn(ctx, \"get_vert_nth_gid: internal error\");\n\t}\n\treturn 0;\n}\n\nstatic FT_UInt ft2gsub_get_gid(const struct ft2vert_st *ft2vert, const FT_UInt gid)\n{\n\tint i, k;\n\tint j = 0; /* StartCoverageIndex */\n\n\tfor (k = 0; k < ft2vert->SubTableCount; k++)\n\t{\n\t\tstruct SubTable_st *t = &ft2vert->SubTable[k];\n\t\tswitch (t->Coverage.CoverageFormat)\n\t\t{\n\t\tcase 1:\n\t\t\tfor (i = 0; i < t->Coverage.GlyphCount; i++)\n\t\t\t\tif (t->Coverage.GlyphArray[i] == gid)\n\t\t\t\t\treturn get_vert_nth_gid(ft2vert->ctx, t, gid, i);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tfor (i = 0; i < t->Coverage.RangeCount; i++)\n\t\t\t{\n\t\t\t\tstruct RangeRecord_st *r = &t->Coverage.RangeRecord[i];\n\t\t\t\tif (r->Start <= gid && gid <= r->End)\n\t\t\t\t\treturn get_vert_nth_gid(ft2vert->ctx, t, gid, gid - r->Start + j);\n\t\t\t\tj += r->End - r->Start + 1;\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tfz_warn(ft2vert->ctx, \"ft2gsub_get_gid: internal error\");\n\t\t}\n\t}\n\n\treturn 0;\n}\n\n\nint pdf_ft_lookup_vgid(fz_context *ctx, pdf_font_desc *fontdesc, int gid)\n{\n\tint vgid = 0;\n\tif (!fontdesc->_vsubst)\n\t{\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tfontdesc->_vsubst = ft2vert_init(ctx, fontdesc->font->ft_face);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\treturn gid;\n\t\t}\n\t}\n\tvgid = ft2gsub_get_gid(fontdesc->_vsubst, gid);\n\treturn vgid ? vgid : gid;\n}\n\nvoid pdf_ft_free_vsubst(pdf_font_desc *fontdesc)\n{\n\tif (fontdesc && fontdesc->_vsubst)\n\t\tft2vert_final(fontdesc->font->ft_face, fontdesc->_vsubst);\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-function.c",
    "content": "#include \"mupdf/pdf.h\"\n\ntypedef struct psobj_s psobj;\n\nenum\n{\n\tSAMPLE = 0,\n\tEXPONENTIAL = 2,\n\tSTITCHING = 3,\n\tPOSTSCRIPT = 4\n};\n\ntypedef struct pdf_function_s pdf_function;\n\nstruct pdf_function_s\n{\n\tfz_function base;\n\tint type;\t\t\t\t/* 0=sample 2=exponential 3=stitching 4=postscript */\n\tfloat domain[FZ_FN_MAXM][2];\t/* even index : min value, odd index : max value */\n\tfloat range[FZ_FN_MAXN][2];\t/* even index : min value, odd index : max value */\n\tint has_range;\n\n\tunion\n\t{\n\t\tstruct {\n\t\t\tunsigned short bps;\n\t\t\tint size[FZ_FN_MAXM];\n\t\t\tfloat encode[FZ_FN_MAXM][2];\n\t\t\tfloat decode[FZ_FN_MAXN][2];\n\t\t\tfloat *samples;\n\t\t} sa;\n\n\t\tstruct {\n\t\t\tfloat n;\n\t\t\tfloat c0[FZ_FN_MAXN];\n\t\t\tfloat c1[FZ_FN_MAXN];\n\t\t} e;\n\n\t\tstruct {\n\t\t\tint k;\n\t\t\tfz_function **funcs; /* k */\n\t\t\tfloat *bounds; /* k - 1 */\n\t\t\tfloat *encode; /* k * 2 */\n\t\t} st;\n\n\t\tstruct {\n\t\t\tpsobj *code;\n\t\t\tint cap;\n\t\t} p;\n\t} u;\n};\n\n#define RADIAN 57.2957795\n\nstatic inline float lerp(float x, float xmin, float xmax, float ymin, float ymax)\n{\n\tif (xmin == xmax)\n\t\treturn ymin;\n\tif (ymin == ymax)\n\t\treturn ymin;\n\treturn ymin + (x - xmin) * (ymax - ymin) / (xmax - xmin);\n}\n\n/*\n * PostScript calculator\n */\n\nenum { PS_BOOL, PS_INT, PS_REAL, PS_OPERATOR, PS_BLOCK };\n\nenum\n{\n\tPS_OP_ABS, PS_OP_ADD, PS_OP_AND, PS_OP_ATAN, PS_OP_BITSHIFT,\n\tPS_OP_CEILING, PS_OP_COPY, PS_OP_COS, PS_OP_CVI, PS_OP_CVR,\n\tPS_OP_DIV, PS_OP_DUP, PS_OP_EQ, PS_OP_EXCH, PS_OP_EXP,\n\tPS_OP_FALSE, PS_OP_FLOOR, PS_OP_GE, PS_OP_GT, PS_OP_IDIV, PS_OP_IF,\n\tPS_OP_IFELSE, PS_OP_INDEX, PS_OP_LE, PS_OP_LN, PS_OP_LOG, PS_OP_LT,\n\tPS_OP_MOD, PS_OP_MUL, PS_OP_NE, PS_OP_NEG, PS_OP_NOT, PS_OP_OR,\n\tPS_OP_POP, PS_OP_RETURN, PS_OP_ROLL, PS_OP_ROUND, PS_OP_SIN,\n\tPS_OP_SQRT, PS_OP_SUB, PS_OP_TRUE, PS_OP_TRUNCATE, PS_OP_XOR\n};\n\nstatic char *ps_op_names[] =\n{\n\t\"abs\", \"add\", \"and\", \"atan\", \"bitshift\", \"ceiling\", \"copy\",\n\t\"cos\", \"cvi\", \"cvr\", \"div\", \"dup\", \"eq\", \"exch\", \"exp\",\n\t\"false\", \"floor\", \"ge\", \"gt\", \"idiv\", \"if\", \"ifelse\", \"index\", \"le\", \"ln\",\n\t\"log\", \"lt\", \"mod\", \"mul\", \"ne\", \"neg\", \"not\", \"or\", \"pop\", \"return\",\n\t\"roll\", \"round\", \"sin\", \"sqrt\", \"sub\", \"true\", \"truncate\", \"xor\"\n};\n\nstruct psobj_s\n{\n\tint type;\n\tunion\n\t{\n\t\tint b;\t\t\t\t/* boolean (stack only) */\n\t\tint i;\t\t\t\t/* integer (stack and code) */\n\t\tfloat f;\t\t\t/* real (stack and code) */\n\t\tint op;\t\t\t\t/* operator (code only) */\n\t\tint block;\t\t\t/* if/ifelse block pointer (code only) */\n\t} u;\n};\n\ntypedef struct ps_stack_s ps_stack;\n\nstruct ps_stack_s\n{\n\tpsobj stack[100];\n\tint sp;\n};\n\n#ifndef NDEBUG\nvoid\npdf_debug_ps_stack(ps_stack *st)\n{\n\tint i;\n\n\tprintf(\"stack: \");\n\n\tfor (i = 0; i < st->sp; i++)\n\t{\n\t\tswitch (st->stack[i].type)\n\t\t{\n\t\tcase PS_BOOL:\n\t\t\tif (st->stack[i].u.b)\n\t\t\t\tprintf(\"true \");\n\t\t\telse\n\t\t\t\tprintf(\"false \");\n\t\t\tbreak;\n\n\t\tcase PS_INT:\n\t\t\tprintf(\"%d \", st->stack[i].u.i);\n\t\t\tbreak;\n\n\t\tcase PS_REAL:\n\t\t\tprintf(\"%g \", st->stack[i].u.f);\n\t\t\tbreak;\n\t\t}\n\t}\n\tprintf(\"\\n\");\n\n}\n#endif\n\nstatic void\nps_init_stack(ps_stack *st)\n{\n\tmemset(st->stack, 0, sizeof(st->stack));\n\tst->sp = 0;\n}\n\nstatic inline int ps_overflow(ps_stack *st, int n)\n{\n\treturn n < 0 || st->sp + n >= nelem(st->stack);\n}\n\nstatic inline int ps_underflow(ps_stack *st, int n)\n{\n\treturn n < 0 || st->sp - n < 0;\n}\n\nstatic inline int ps_is_type(ps_stack *st, int t)\n{\n\treturn !ps_underflow(st, 1) && st->stack[st->sp - 1].type == t;\n}\n\nstatic inline int ps_is_type2(ps_stack *st, int t)\n{\n\treturn !ps_underflow(st, 2) && st->stack[st->sp - 1].type == t && st->stack[st->sp - 2].type == t;\n}\n\nstatic void\nps_push_bool(ps_stack *st, int b)\n{\n\tif (!ps_overflow(st, 1))\n\t{\n\t\tst->stack[st->sp].type = PS_BOOL;\n\t\tst->stack[st->sp].u.b = b;\n\t\tst->sp++;\n\t}\n}\n\nstatic void\nps_push_int(ps_stack *st, int n)\n{\n\tif (!ps_overflow(st, 1))\n\t{\n\t\tst->stack[st->sp].type = PS_INT;\n\t\tst->stack[st->sp].u.i = n;\n\t\tst->sp++;\n\t}\n}\n\nstatic void\nps_push_real(ps_stack *st, float n)\n{\n\tif (!ps_overflow(st, 1))\n\t{\n\t\tst->stack[st->sp].type = PS_REAL;\n\t\tif (isnan(n))\n\t\t{\n\t\t\t/* Push 1.0, as it's a small known value that won't\n\t\t\t * cause a divide by 0. Same reason as in fz_atof. */\n\t\t\tn = 1.0;\n\t\t}\n\t\tst->stack[st->sp].u.f = fz_clamp(n, -FLT_MAX, FLT_MAX);\n\t\tst->sp++;\n\t}\n}\n\nstatic int\nps_pop_bool(ps_stack *st)\n{\n\tif (!ps_underflow(st, 1))\n\t{\n\t\tif (ps_is_type(st, PS_BOOL))\n\t\t\treturn st->stack[--st->sp].u.b;\n\t}\n\treturn 0;\n}\n\nstatic int\nps_pop_int(ps_stack *st)\n{\n\tif (!ps_underflow(st, 1))\n\t{\n\t\tif (ps_is_type(st, PS_INT))\n\t\t\treturn st->stack[--st->sp].u.i;\n\t\tif (ps_is_type(st, PS_REAL))\n\t\t\treturn st->stack[--st->sp].u.f;\n\t}\n\treturn 0;\n}\n\nstatic float\nps_pop_real(ps_stack *st)\n{\n\tif (!ps_underflow(st, 1))\n\t{\n\t\tif (ps_is_type(st, PS_INT))\n\t\t\treturn st->stack[--st->sp].u.i;\n\t\tif (ps_is_type(st, PS_REAL))\n\t\t\treturn st->stack[--st->sp].u.f;\n\t}\n\treturn 0;\n}\n\nstatic void\nps_copy(ps_stack *st, int n)\n{\n\tif (!ps_underflow(st, n) && !ps_overflow(st, n))\n\t{\n\t\tmemcpy(st->stack + st->sp, st->stack + st->sp - n, n * sizeof(psobj));\n\t\tst->sp += n;\n\t}\n}\n\nstatic void\nps_roll(ps_stack *st, int n, int j)\n{\n\tpsobj tmp;\n\tint i;\n\n\tif (ps_underflow(st, n) || j == 0 || n == 0)\n\t\treturn;\n\n\tif (j >= 0)\n\t{\n\t\tj %= n;\n\t}\n\telse\n\t{\n\t\tj = -j % n;\n\t\tif (j != 0)\n\t\t\tj = n - j;\n\t}\n\n\tfor (i = 0; i < j; i++)\n\t{\n\t\ttmp = st->stack[st->sp - 1];\n\t\tmemmove(st->stack + st->sp - n + 1, st->stack + st->sp - n, n * sizeof(psobj));\n\t\tst->stack[st->sp - n] = tmp;\n\t}\n}\n\nstatic void\nps_index(ps_stack *st, int n)\n{\n\tif (!ps_overflow(st, 1) && !ps_underflow(st, n))\n\t{\n\t\tst->stack[st->sp] = st->stack[st->sp - n - 1];\n\t\tst->sp++;\n\t}\n}\n\nstatic void\nps_run(fz_context *ctx, psobj *code, ps_stack *st, int pc)\n{\n\tint i1, i2;\n\tfloat r1, r2;\n\tint b1, b2;\n\n\twhile (1)\n\t{\n\t\tswitch (code[pc].type)\n\t\t{\n\t\tcase PS_INT:\n\t\t\tps_push_int(st, code[pc++].u.i);\n\t\t\tbreak;\n\n\t\tcase PS_REAL:\n\t\t\tps_push_real(st, code[pc++].u.f);\n\t\t\tbreak;\n\n\t\tcase PS_OPERATOR:\n\t\t\tswitch (code[pc++].u.op)\n\t\t\t{\n\t\t\tcase PS_OP_ABS:\n\t\t\t\tif (ps_is_type(st, PS_INT))\n\t\t\t\t\tps_push_int(st, abs(ps_pop_int(st)));\n\t\t\t\telse\n\t\t\t\t\tps_push_real(st, fabsf(ps_pop_real(st)));\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_ADD:\n\t\t\t\tif (ps_is_type2(st, PS_INT)) {\n\t\t\t\t\ti2 = ps_pop_int(st);\n\t\t\t\t\ti1 = ps_pop_int(st);\n\t\t\t\t\tps_push_int(st, i1 + i2);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tr2 = ps_pop_real(st);\n\t\t\t\t\tr1 = ps_pop_real(st);\n\t\t\t\t\tps_push_real(st, r1 + r2);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_AND:\n\t\t\t\tif (ps_is_type2(st, PS_INT)) {\n\t\t\t\t\ti2 = ps_pop_int(st);\n\t\t\t\t\ti1 = ps_pop_int(st);\n\t\t\t\t\tps_push_int(st, i1 & i2);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tb2 = ps_pop_bool(st);\n\t\t\t\t\tb1 = ps_pop_bool(st);\n\t\t\t\t\tps_push_bool(st, b1 && b2);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_ATAN:\n\t\t\t\tr2 = ps_pop_real(st);\n\t\t\t\tr1 = ps_pop_real(st);\n\t\t\t\tr1 = atan2f(r1, r2) * RADIAN;\n\t\t\t\tif (r1 < 0)\n\t\t\t\t\tr1 += 360;\n\t\t\t\tps_push_real(st, r1);\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_BITSHIFT:\n\t\t\t\ti2 = ps_pop_int(st);\n\t\t\t\ti1 = ps_pop_int(st);\n\t\t\t\tif (i2 > 0 && i2 < 8 * sizeof (i2))\n\t\t\t\t\tps_push_int(st, i1 << i2);\n\t\t\t\telse if (i2 < 0 && i2 > -8 * (int)sizeof (i2))\n\t\t\t\t\tps_push_int(st, (int)((unsigned int)i1 >> -i2));\n\t\t\t\telse\n\t\t\t\t\tps_push_int(st, i1);\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_CEILING:\n\t\t\t\tr1 = ps_pop_real(st);\n\t\t\t\tps_push_real(st, ceilf(r1));\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_COPY:\n\t\t\t\tps_copy(st, ps_pop_int(st));\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_COS:\n\t\t\t\tr1 = ps_pop_real(st);\n\t\t\t\tps_push_real(st, cosf(r1/RADIAN));\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_CVI:\n\t\t\t\tps_push_int(st, ps_pop_int(st));\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_CVR:\n\t\t\t\tps_push_real(st, ps_pop_real(st));\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_DIV:\n\t\t\t\tr2 = ps_pop_real(st);\n\t\t\t\tr1 = ps_pop_real(st);\n\t\t\t\tif (fabsf(r2) >= FLT_EPSILON)\n\t\t\t\t\tps_push_real(st, r1 / r2);\n\t\t\t\telse\n\t\t\t\t\tps_push_real(st, DIV_BY_ZERO(r1, r2, -FLT_MAX, FLT_MAX));\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_DUP:\n\t\t\t\tps_copy(st, 1);\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_EQ:\n\t\t\t\tif (ps_is_type2(st, PS_BOOL)) {\n\t\t\t\t\tb2 = ps_pop_bool(st);\n\t\t\t\t\tb1 = ps_pop_bool(st);\n\t\t\t\t\tps_push_bool(st, b1 == b2);\n\t\t\t\t}\n\t\t\t\telse if (ps_is_type2(st, PS_INT)) {\n\t\t\t\t\ti2 = ps_pop_int(st);\n\t\t\t\t\ti1 = ps_pop_int(st);\n\t\t\t\t\tps_push_bool(st, i1 == i2);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tr2 = ps_pop_real(st);\n\t\t\t\t\tr1 = ps_pop_real(st);\n\t\t\t\t\tps_push_bool(st, r1 == r2);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_EXCH:\n\t\t\t\tps_roll(st, 2, 1);\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_EXP:\n\t\t\t\tr2 = ps_pop_real(st);\n\t\t\t\tr1 = ps_pop_real(st);\n\t\t\t\tps_push_real(st, powf(r1, r2));\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_FALSE:\n\t\t\t\tps_push_bool(st, 0);\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_FLOOR:\n\t\t\t\tr1 = ps_pop_real(st);\n\t\t\t\tps_push_real(st, floorf(r1));\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_GE:\n\t\t\t\tif (ps_is_type2(st, PS_INT)) {\n\t\t\t\t\ti2 = ps_pop_int(st);\n\t\t\t\t\ti1 = ps_pop_int(st);\n\t\t\t\t\tps_push_bool(st, i1 >= i2);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tr2 = ps_pop_real(st);\n\t\t\t\t\tr1 = ps_pop_real(st);\n\t\t\t\t\tps_push_bool(st, r1 >= r2);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_GT:\n\t\t\t\tif (ps_is_type2(st, PS_INT)) {\n\t\t\t\t\ti2 = ps_pop_int(st);\n\t\t\t\t\ti1 = ps_pop_int(st);\n\t\t\t\t\tps_push_bool(st, i1 > i2);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tr2 = ps_pop_real(st);\n\t\t\t\t\tr1 = ps_pop_real(st);\n\t\t\t\t\tps_push_bool(st, r1 > r2);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_IDIV:\n\t\t\t\ti2 = ps_pop_int(st);\n\t\t\t\ti1 = ps_pop_int(st);\n\t\t\t\tif (i2 != 0)\n\t\t\t\t\tps_push_int(st, i1 / i2);\n\t\t\t\telse\n\t\t\t\t\tps_push_int(st, DIV_BY_ZERO(i1, i2, INT_MIN, INT_MAX));\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_INDEX:\n\t\t\t\tps_index(st, ps_pop_int(st));\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_LE:\n\t\t\t\tif (ps_is_type2(st, PS_INT)) {\n\t\t\t\t\ti2 = ps_pop_int(st);\n\t\t\t\t\ti1 = ps_pop_int(st);\n\t\t\t\t\tps_push_bool(st, i1 <= i2);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tr2 = ps_pop_real(st);\n\t\t\t\t\tr1 = ps_pop_real(st);\n\t\t\t\t\tps_push_bool(st, r1 <= r2);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_LN:\n\t\t\t\tr1 = ps_pop_real(st);\n\t\t\t\t/* Bug 692941 - logf as separate statement */\n\t\t\t\tr2 = logf(r1);\n\t\t\t\tps_push_real(st, r2);\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_LOG:\n\t\t\t\tr1 = ps_pop_real(st);\n\t\t\t\tps_push_real(st, log10f(r1));\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_LT:\n\t\t\t\tif (ps_is_type2(st, PS_INT)) {\n\t\t\t\t\ti2 = ps_pop_int(st);\n\t\t\t\t\ti1 = ps_pop_int(st);\n\t\t\t\t\tps_push_bool(st, i1 < i2);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tr2 = ps_pop_real(st);\n\t\t\t\t\tr1 = ps_pop_real(st);\n\t\t\t\t\tps_push_bool(st, r1 < r2);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_MOD:\n\t\t\t\ti2 = ps_pop_int(st);\n\t\t\t\ti1 = ps_pop_int(st);\n\t\t\t\tif (i2 != 0)\n\t\t\t\t\tps_push_int(st, i1 % i2);\n\t\t\t\telse\n\t\t\t\t\tps_push_int(st, DIV_BY_ZERO(i1, i2, INT_MIN, INT_MAX));\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_MUL:\n\t\t\t\tif (ps_is_type2(st, PS_INT)) {\n\t\t\t\t\ti2 = ps_pop_int(st);\n\t\t\t\t\ti1 = ps_pop_int(st);\n\t\t\t\t\tps_push_int(st, i1 * i2);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tr2 = ps_pop_real(st);\n\t\t\t\t\tr1 = ps_pop_real(st);\n\t\t\t\t\tps_push_real(st, r1 * r2);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_NE:\n\t\t\t\tif (ps_is_type2(st, PS_BOOL)) {\n\t\t\t\t\tb2 = ps_pop_bool(st);\n\t\t\t\t\tb1 = ps_pop_bool(st);\n\t\t\t\t\tps_push_bool(st, b1 != b2);\n\t\t\t\t}\n\t\t\t\telse if (ps_is_type2(st, PS_INT)) {\n\t\t\t\t\ti2 = ps_pop_int(st);\n\t\t\t\t\ti1 = ps_pop_int(st);\n\t\t\t\t\tps_push_bool(st, i1 != i2);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tr2 = ps_pop_real(st);\n\t\t\t\t\tr1 = ps_pop_real(st);\n\t\t\t\t\tps_push_bool(st, r1 != r2);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_NEG:\n\t\t\t\tif (ps_is_type(st, PS_INT))\n\t\t\t\t\tps_push_int(st, -ps_pop_int(st));\n\t\t\t\telse\n\t\t\t\t\tps_push_real(st, -ps_pop_real(st));\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_NOT:\n\t\t\t\tif (ps_is_type(st, PS_BOOL))\n\t\t\t\t\tps_push_bool(st, !ps_pop_bool(st));\n\t\t\t\telse\n\t\t\t\t\tps_push_int(st, ~ps_pop_int(st));\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_OR:\n\t\t\t\tif (ps_is_type2(st, PS_BOOL)) {\n\t\t\t\t\tb2 = ps_pop_bool(st);\n\t\t\t\t\tb1 = ps_pop_bool(st);\n\t\t\t\t\tps_push_bool(st, b1 || b2);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ti2 = ps_pop_int(st);\n\t\t\t\t\ti1 = ps_pop_int(st);\n\t\t\t\t\tps_push_int(st, i1 | i2);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_POP:\n\t\t\t\tif (!ps_underflow(st, 1))\n\t\t\t\t\tst->sp--;\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_ROLL:\n\t\t\t\ti2 = ps_pop_int(st);\n\t\t\t\ti1 = ps_pop_int(st);\n\t\t\t\tps_roll(st, i1, i2);\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_ROUND:\n\t\t\t\tif (!ps_is_type(st, PS_INT)) {\n\t\t\t\t\tr1 = ps_pop_real(st);\n\t\t\t\t\tps_push_real(st, (r1 >= 0) ? floorf(r1 + 0.5f) : ceilf(r1 - 0.5f));\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_SIN:\n\t\t\t\tr1 = ps_pop_real(st);\n\t\t\t\tps_push_real(st, sinf(r1/RADIAN));\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_SQRT:\n\t\t\t\tr1 = ps_pop_real(st);\n\t\t\t\tps_push_real(st, sqrtf(r1));\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_SUB:\n\t\t\t\tif (ps_is_type2(st, PS_INT)) {\n\t\t\t\t\ti2 = ps_pop_int(st);\n\t\t\t\t\ti1 = ps_pop_int(st);\n\t\t\t\t\tps_push_int(st, i1 - i2);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tr2 = ps_pop_real(st);\n\t\t\t\t\tr1 = ps_pop_real(st);\n\t\t\t\t\tps_push_real(st, r1 - r2);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_TRUE:\n\t\t\t\tps_push_bool(st, 1);\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_TRUNCATE:\n\t\t\t\tif (!ps_is_type(st, PS_INT)) {\n\t\t\t\t\tr1 = ps_pop_real(st);\n\t\t\t\t\tps_push_real(st, (r1 >= 0) ? floorf(r1) : ceilf(r1));\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_XOR:\n\t\t\t\tif (ps_is_type2(st, PS_BOOL)) {\n\t\t\t\t\tb2 = ps_pop_bool(st);\n\t\t\t\t\tb1 = ps_pop_bool(st);\n\t\t\t\t\tps_push_bool(st, b1 ^ b2);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ti2 = ps_pop_int(st);\n\t\t\t\t\ti1 = ps_pop_int(st);\n\t\t\t\t\tps_push_int(st, i1 ^ i2);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_IF:\n\t\t\t\tb1 = ps_pop_bool(st);\n\t\t\t\tif (b1)\n\t\t\t\t\tps_run(ctx, code, st, code[pc + 1].u.block);\n\t\t\t\tpc = code[pc + 2].u.block;\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_IFELSE:\n\t\t\t\tb1 = ps_pop_bool(st);\n\t\t\t\tif (b1)\n\t\t\t\t\tps_run(ctx, code, st, code[pc + 1].u.block);\n\t\t\t\telse\n\t\t\t\t\tps_run(ctx, code, st, code[pc + 0].u.block);\n\t\t\t\tpc = code[pc + 2].u.block;\n\t\t\t\tbreak;\n\n\t\t\tcase PS_OP_RETURN:\n\t\t\t\treturn;\n\n\t\t\tdefault:\n\t\t\t\tfz_warn(ctx, \"foreign operator in calculator function\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tfz_warn(ctx, \"foreign object in calculator function\");\n\t\t\treturn;\n\t\t}\n\t}\n}\n\nstatic void\nresize_code(fz_context *ctx, pdf_function *func, int newsize)\n{\n\tif (newsize >= func->u.p.cap)\n\t{\n\t\tint new_cap = func->u.p.cap + 64;\n\t\tfunc->u.p.code = fz_resize_array(ctx, func->u.p.code, new_cap, sizeof(psobj));\n\t\tfunc->u.p.cap = new_cap;\n\t}\n}\n\nstatic void\nparse_code(pdf_function *func, fz_stream *stream, int *codeptr, pdf_lexbuf *buf)\n{\n\tpdf_token tok;\n\tint opptr, elseptr, ifptr;\n\tint a, b, mid, cmp;\n\tfz_context *ctx = stream->ctx;\n\n\twhile (1)\n\t{\n\t\ttok = pdf_lex(stream, buf);\n\n\t\tswitch (tok)\n\t\t{\n\t\tcase PDF_TOK_EOF:\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"truncated calculator function\");\n\n\t\tcase PDF_TOK_INT:\n\t\t\tresize_code(ctx, func, *codeptr);\n\t\t\tfunc->u.p.code[*codeptr].type = PS_INT;\n\t\t\tfunc->u.p.code[*codeptr].u.i = buf->i;\n\t\t\t++*codeptr;\n\t\t\tbreak;\n\n\t\tcase PDF_TOK_TRUE:\n\t\t\tresize_code(ctx, func, *codeptr);\n\t\t\tfunc->u.p.code[*codeptr].type = PS_BOOL;\n\t\t\tfunc->u.p.code[*codeptr].u.b = 1;\n\t\t\t++*codeptr;\n\t\t\tbreak;\n\n\t\tcase PDF_TOK_FALSE:\n\t\t\tresize_code(ctx, func, *codeptr);\n\t\t\tfunc->u.p.code[*codeptr].type = PS_BOOL;\n\t\t\tfunc->u.p.code[*codeptr].u.b = 0;\n\t\t\t++*codeptr;\n\t\t\tbreak;\n\n\t\tcase PDF_TOK_REAL:\n\t\t\tresize_code(ctx, func, *codeptr);\n\t\t\tfunc->u.p.code[*codeptr].type = PS_REAL;\n\t\t\tfunc->u.p.code[*codeptr].u.f = buf->f;\n\t\t\t++*codeptr;\n\t\t\tbreak;\n\n\t\tcase PDF_TOK_OPEN_BRACE:\n\t\t\topptr = *codeptr;\n\t\t\t*codeptr += 4;\n\n\t\t\tresize_code(ctx, func, *codeptr);\n\n\t\t\tifptr = *codeptr;\n\t\t\tparse_code(func, stream, codeptr, buf);\n\n\t\t\ttok = pdf_lex(stream, buf);\n\n\t\t\tif (tok == PDF_TOK_OPEN_BRACE)\n\t\t\t{\n\t\t\t\telseptr = *codeptr;\n\t\t\t\tparse_code(func, stream, codeptr, buf);\n\n\t\t\t\ttok = pdf_lex(stream, buf);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\telseptr = -1;\n\t\t\t}\n\n\t\t\tif (tok != PDF_TOK_KEYWORD)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"missing keyword in 'if-else' context\");\n\n\t\t\tif (!strcmp(buf->scratch, \"if\"))\n\t\t\t{\n\t\t\t\tif (elseptr >= 0)\n\t\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"too many branches for 'if'\");\n\t\t\t\tfunc->u.p.code[opptr].type = PS_OPERATOR;\n\t\t\t\tfunc->u.p.code[opptr].u.op = PS_OP_IF;\n\t\t\t\tfunc->u.p.code[opptr+2].type = PS_BLOCK;\n\t\t\t\tfunc->u.p.code[opptr+2].u.block = ifptr;\n\t\t\t\tfunc->u.p.code[opptr+3].type = PS_BLOCK;\n\t\t\t\tfunc->u.p.code[opptr+3].u.block = *codeptr;\n\t\t\t}\n\t\t\telse if (!strcmp(buf->scratch, \"ifelse\"))\n\t\t\t{\n\t\t\t\tif (elseptr < 0)\n\t\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"not enough branches for 'ifelse'\");\n\t\t\t\tfunc->u.p.code[opptr].type = PS_OPERATOR;\n\t\t\t\tfunc->u.p.code[opptr].u.op = PS_OP_IFELSE;\n\t\t\t\tfunc->u.p.code[opptr+1].type = PS_BLOCK;\n\t\t\t\tfunc->u.p.code[opptr+1].u.block = elseptr;\n\t\t\t\tfunc->u.p.code[opptr+2].type = PS_BLOCK;\n\t\t\t\tfunc->u.p.code[opptr+2].u.block = ifptr;\n\t\t\t\tfunc->u.p.code[opptr+3].type = PS_BLOCK;\n\t\t\t\tfunc->u.p.code[opptr+3].u.block = *codeptr;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"unknown keyword in 'if-else' context: '%s'\", buf->scratch);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase PDF_TOK_CLOSE_BRACE:\n\t\t\tresize_code(ctx, func, *codeptr);\n\t\t\tfunc->u.p.code[*codeptr].type = PS_OPERATOR;\n\t\t\tfunc->u.p.code[*codeptr].u.op = PS_OP_RETURN;\n\t\t\t++*codeptr;\n\t\t\treturn;\n\n\t\tcase PDF_TOK_KEYWORD:\n\t\t\tcmp = -1;\n\t\t\ta = -1;\n\t\t\tb = nelem(ps_op_names);\n\t\t\twhile (b - a > 1)\n\t\t\t{\n\t\t\t\tmid = (a + b) / 2;\n\t\t\t\tcmp = strcmp(buf->scratch, ps_op_names[mid]);\n\t\t\t\tif (cmp > 0)\n\t\t\t\t\ta = mid;\n\t\t\t\telse if (cmp < 0)\n\t\t\t\t\tb = mid;\n\t\t\t\telse\n\t\t\t\t\ta = b = mid;\n\t\t\t}\n\t\t\tif (cmp != 0)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"unknown operator: '%s'\", buf->scratch);\n\t\t\tif (a == PS_OP_IFELSE)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"illegally positioned ifelse operator in function\");\n\t\t\tif (a == PS_OP_IF)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"illegally positioned if operator in function\");\n\n\t\t\tresize_code(ctx, func, *codeptr);\n\t\t\tfunc->u.p.code[*codeptr].type = PS_OPERATOR;\n\t\t\tfunc->u.p.code[*codeptr].u.op = a;\n\t\t\t++*codeptr;\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"calculator function syntax error\");\n\t\t}\n\t}\n}\n\nstatic void\nload_postscript_func(pdf_function *func, pdf_document *doc, pdf_obj *dict, int num, int gen)\n{\n\tfz_stream *stream = NULL;\n\tint codeptr;\n\tpdf_lexbuf buf;\n\tpdf_token tok;\n\tfz_context *ctx = doc->ctx;\n\tint locked = 0;\n\n\tpdf_lexbuf_init(ctx, &buf, PDF_LEXBUF_SMALL);\n\n\tfz_var(stream);\n\tfz_var(locked);\n\n\tfz_try(ctx)\n\t{\n\t\tstream = pdf_open_stream(doc, num, gen);\n\n\t\ttok = pdf_lex(stream, &buf);\n\t\tif (tok != PDF_TOK_OPEN_BRACE)\n\t\t{\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"stream is not a calculator function\");\n\t\t}\n\n\t\tfunc->u.p.code = NULL;\n\t\tfunc->u.p.cap = 0;\n\n\t\tcodeptr = 0;\n\t\tparse_code(func, stream, &codeptr, &buf);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(stream);\n\t\tpdf_lexbuf_fin(&buf);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_message(ctx, \"cannot parse calculator function (%d %d R)\", num, gen);\n\t}\n\n\tfunc->base.size += func->u.p.cap * sizeof(psobj);\n}\n\nstatic void\neval_postscript_func(fz_context *ctx, pdf_function *func, const float *in, float *out)\n{\n\tps_stack st;\n\tfloat x;\n\tint i;\n\n\tps_init_stack(&st);\n\n\tfor (i = 0; i < func->base.m; i++)\n\t{\n\t\tx = fz_clamp(in[i], func->domain[i][0], func->domain[i][1]);\n\t\tps_push_real(&st, x);\n\t}\n\n\tps_run(ctx, func->u.p.code, &st, 0);\n\n\tfor (i = func->base.n - 1; i >= 0; i--)\n\t{\n\t\tx = ps_pop_real(&st);\n\t\tout[i] = fz_clamp(x, func->range[i][0], func->range[i][1]);\n\t}\n}\n\n/*\n * Sample function\n */\n\n#define MAX_SAMPLE_FUNCTION_SIZE (100 << 20)\n\nstatic void\nload_sample_func(pdf_function *func, pdf_document *doc, pdf_obj *dict, int num, int gen)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_stream *stream;\n\tpdf_obj *obj;\n\tint samplecount;\n\tint bps;\n\tint i;\n\n\tfz_var(stream);\n\n\tfunc->u.sa.samples = NULL;\n\n\tobj = pdf_dict_gets(dict, \"Size\");\n\tif (pdf_array_len(obj) < func->base.m)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"too few sample function dimension sizes\");\n\tif (pdf_array_len(obj) > func->base.m)\n\t\tfz_warn(ctx, \"too many sample function dimension sizes\");\n\tfor (i = 0; i < func->base.m; i++)\n\t{\n\t\tfunc->u.sa.size[i] = pdf_to_int(pdf_array_get(obj, i));\n\t\tif (func->u.sa.size[i] <= 0)\n\t\t{\n\t\t\tfz_warn(ctx, \"non-positive sample function dimension size\");\n\t\t\tfunc->u.sa.size[i] = 1;\n\t\t}\n\t}\n\n\tobj = pdf_dict_gets(dict, \"BitsPerSample\");\n\tfunc->u.sa.bps = bps = pdf_to_int(obj);\n\n\tfor (i = 0; i < func->base.m; i++)\n\t{\n\t\tfunc->u.sa.encode[i][0] = 0;\n\t\tfunc->u.sa.encode[i][1] = func->u.sa.size[i] - 1;\n\t}\n\tobj = pdf_dict_gets(dict, \"Encode\");\n\tif (pdf_is_array(obj))\n\t{\n\t\tint ranges = fz_mini(func->base.m, pdf_array_len(obj) / 2);\n\t\tif (ranges != func->base.m)\n\t\t\tfz_warn(ctx, \"wrong number of sample function input mappings\");\n\n\t\tfor (i = 0; i < ranges; i++)\n\t\t{\n\t\t\tfunc->u.sa.encode[i][0] = pdf_to_real(pdf_array_get(obj, i * 2 + 0));\n\t\t\tfunc->u.sa.encode[i][1] = pdf_to_real(pdf_array_get(obj, i * 2 + 1));\n\t\t}\n\t}\n\n\tfor (i = 0; i < func->base.n; i++)\n\t{\n\t\tfunc->u.sa.decode[i][0] = func->range[i][0];\n\t\tfunc->u.sa.decode[i][1] = func->range[i][1];\n\t}\n\n\tobj = pdf_dict_gets(dict, \"Decode\");\n\tif (pdf_is_array(obj))\n\t{\n\t\tint ranges = fz_mini(func->base.n, pdf_array_len(obj) / 2);\n\t\tif (ranges != func->base.n)\n\t\t\tfz_warn(ctx, \"wrong number of sample function output mappings\");\n\n\t\tfor (i = 0; i < ranges; i++)\n\t\t{\n\t\t\tfunc->u.sa.decode[i][0] = pdf_to_real(pdf_array_get(obj, i * 2 + 0));\n\t\t\tfunc->u.sa.decode[i][1] = pdf_to_real(pdf_array_get(obj, i * 2 + 1));\n\t\t}\n\t}\n\n\tfor (i = 0, samplecount = func->base.n; i < func->base.m; i++)\n\t\tsamplecount *= func->u.sa.size[i];\n\n\tif (samplecount > MAX_SAMPLE_FUNCTION_SIZE)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"sample function too large\");\n\n\tfunc->u.sa.samples = fz_malloc_array(ctx, samplecount, sizeof(float));\n\tfunc->base.size += samplecount * sizeof(float);\n\n\tstream = pdf_open_stream(doc, num, gen);\n\n\tfz_try(ctx)\n\t{\n\t\t/* read samples */\n\t\tfor (i = 0; i < samplecount; i++)\n\t\t{\n\t\t\tunsigned int x;\n\t\t\tfloat s;\n\n\t\t\tif (fz_is_eof_bits(stream))\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"truncated sample function stream\");\n\n\t\t\tswitch (bps)\n\t\t\t{\n\t\t\tcase 1: s = fz_read_bits(stream, 1); break;\n\t\t\tcase 2: s = fz_read_bits(stream, 2) / 3.0f; break;\n\t\t\tcase 4: s = fz_read_bits(stream, 4) / 15.0f; break;\n\t\t\tcase 8: s = fz_read_byte(stream) / 255.0f; break;\n\t\t\tcase 12: s = fz_read_bits(stream, 12) / 4095.0f; break;\n\t\t\tcase 16:\n\t\t\t\tx = fz_read_byte(stream) << 8;\n\t\t\t\tx |= fz_read_byte(stream);\n\t\t\t\ts = x / 65535.0f;\n\t\t\t\tbreak;\n\t\t\tcase 24:\n\t\t\t\tx = fz_read_byte(stream) << 16;\n\t\t\t\tx |= fz_read_byte(stream) << 8;\n\t\t\t\tx |= fz_read_byte(stream);\n\t\t\t\ts = x / 16777215.0f;\n\t\t\t\tbreak;\n\t\t\tcase 32:\n\t\t\t\tx = fz_read_byte(stream) << 24;\n\t\t\t\tx |= fz_read_byte(stream) << 16;\n\t\t\t\tx |= fz_read_byte(stream) << 8;\n\t\t\t\tx |= fz_read_byte(stream);\n\t\t\t\ts = x / 4294967295.0f;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"sample stream bit depth %d unsupported\", bps);\n\t\t\t}\n\n\t\t\tfunc->u.sa.samples[i] = s;\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(stream);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic float\ninterpolate_sample(pdf_function *func, int *scale, int *e0, int *e1, float *efrac, int dim, int idx)\n{\n\tfloat a, b;\n\tint idx0, idx1;\n\n\tidx0 = e0[dim] * scale[dim] + idx;\n\tidx1 = e1[dim] * scale[dim] + idx;\n\n\tif (dim == 0)\n\t{\n\t\ta = func->u.sa.samples[idx0];\n\t\tb = func->u.sa.samples[idx1];\n\t}\n\telse\n\t{\n\t\ta = interpolate_sample(func, scale, e0, e1, efrac, dim - 1, idx0);\n\t\tb = interpolate_sample(func, scale, e0, e1, efrac, dim - 1, idx1);\n\t}\n\n\treturn a + (b - a) * efrac[dim];\n}\n\nstatic void\neval_sample_func(fz_context *ctx, pdf_function *func, const float *in, float *out)\n{\n\tint e0[FZ_FN_MAXM], e1[FZ_FN_MAXM], scale[FZ_FN_MAXM];\n\tfloat efrac[FZ_FN_MAXM];\n\tfloat x;\n\tint i;\n\n\t/* encode input coordinates */\n\tfor (i = 0; i < func->base.m; i++)\n\t{\n\t\tx = fz_clamp(in[i], func->domain[i][0], func->domain[i][1]);\n\t\tx = lerp(x, func->domain[i][0], func->domain[i][1],\n\t\t\tfunc->u.sa.encode[i][0], func->u.sa.encode[i][1]);\n\t\tx = fz_clamp(x, 0, func->u.sa.size[i] - 1);\n\t\te0[i] = floorf(x);\n\t\te1[i] = ceilf(x);\n\t\tefrac[i] = x - floorf(x);\n\t}\n\n\tscale[0] = func->base.n;\n\tfor (i = 1; i < func->base.m; i++)\n\t\tscale[i] = scale[i - 1] * func->u.sa.size[i-1];\n\n\tfor (i = 0; i < func->base.n; i++)\n\t{\n\t\tif (func->base.m == 1)\n\t\t{\n\t\t\tfloat a = func->u.sa.samples[e0[0] * func->base.n + i];\n\t\t\tfloat b = func->u.sa.samples[e1[0] * func->base.n + i];\n\n\t\t\tfloat ab = a + (b - a) * efrac[0];\n\n\t\t\tout[i] = lerp(ab, 0, 1, func->u.sa.decode[i][0], func->u.sa.decode[i][1]);\n\t\t\tout[i] = fz_clamp(out[i], func->range[i][0], func->range[i][1]);\n\t\t}\n\n\t\telse if (func->base.m == 2)\n\t\t{\n\t\t\tint s0 = func->base.n;\n\t\t\tint s1 = s0 * func->u.sa.size[0];\n\n\t\t\tfloat a = func->u.sa.samples[e0[0] * s0 + e0[1] * s1 + i];\n\t\t\tfloat b = func->u.sa.samples[e1[0] * s0 + e0[1] * s1 + i];\n\t\t\tfloat c = func->u.sa.samples[e0[0] * s0 + e1[1] * s1 + i];\n\t\t\tfloat d = func->u.sa.samples[e1[0] * s0 + e1[1] * s1 + i];\n\n\t\t\tfloat ab = a + (b - a) * efrac[0];\n\t\t\tfloat cd = c + (d - c) * efrac[0];\n\t\t\tfloat abcd = ab + (cd - ab) * efrac[1];\n\n\t\t\tout[i] = lerp(abcd, 0, 1, func->u.sa.decode[i][0], func->u.sa.decode[i][1]);\n\t\t\tout[i] = fz_clamp(out[i], func->range[i][0], func->range[i][1]);\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\tx = interpolate_sample(func, scale, e0, e1, efrac, func->base.m - 1, i);\n\t\t\tout[i] = lerp(x, 0, 1, func->u.sa.decode[i][0], func->u.sa.decode[i][1]);\n\t\t\tout[i] = fz_clamp(out[i], func->range[i][0], func->range[i][1]);\n\t\t}\n\t}\n}\n\n/*\n * Exponential function\n */\n\nstatic void\nload_exponential_func(fz_context *ctx, pdf_function *func, pdf_obj *dict)\n{\n\tpdf_obj *obj;\n\tint i;\n\n\tif (func->base.m > 1)\n\t\tfz_warn(ctx, \"exponential functions have at most one input\");\n\tfunc->base.m = 1;\n\n\tobj = pdf_dict_gets(dict, \"N\");\n\tfunc->u.e.n = pdf_to_real(obj);\n\n\t/* See exponential functions (PDF 1.7 section 3.9.2) */\n\tif (func->u.e.n != (int) func->u.e.n)\n\t{\n\t\t/* If N is non-integer, input values may never be negative */\n\t\tfor (i = 0; i < func->base.m; i++)\n\t\t\tif (func->domain[i][0] < 0 || func->domain[i][1] < 0)\n\t\t\t\tfz_warn(ctx, \"exponential function input domain includes illegal negative input values\");\n\t}\n\telse if (func->u.e.n < 0)\n\t{\n\t\t/* if N is negative, input values may never be zero */\n\t\tfor (i = 0; i < func->base.m; i++)\n\t\t\tif (func->domain[i][0] == 0 || func->domain[i][1] == 0 ||\n\t\t\t\t(func->domain[i][0] < 0 && func->domain[i][1] > 0))\n\t\t\t\tfz_warn(ctx, \"exponential function input domain includes illegal input value zero\");\n\t}\n\n\tfor (i = 0; i < func->base.n; i++)\n\t{\n\t\tfunc->u.e.c0[i] = 0;\n\t\tfunc->u.e.c1[i] = 1;\n\t}\n\n\tobj = pdf_dict_gets(dict, \"C0\");\n\tif (pdf_is_array(obj))\n\t{\n\t\tint ranges = fz_mini(func->base.n, pdf_array_len(obj));\n\t\tif (ranges != func->base.n)\n\t\t\tfz_warn(ctx, \"wrong number of C0 constants for exponential function\");\n\n\t\tfor (i = 0; i < ranges; i++)\n\t\t\tfunc->u.e.c0[i] = pdf_to_real(pdf_array_get(obj, i));\n\t}\n\n\tobj = pdf_dict_gets(dict, \"C1\");\n\tif (pdf_is_array(obj))\n\t{\n\t\tint ranges = fz_mini(func->base.n, pdf_array_len(obj));\n\t\tif (ranges != func->base.n)\n\t\t\tfz_warn(ctx, \"wrong number of C1 constants for exponential function\");\n\n\t\tfor (i = 0; i < ranges; i++)\n\t\t\tfunc->u.e.c1[i] = pdf_to_real(pdf_array_get(obj, i));\n\t}\n}\n\nstatic void\neval_exponential_func(fz_context *ctx, pdf_function *func, float in, float *out)\n{\n\tfloat x = in;\n\tfloat tmp;\n\tint i;\n\n\tx = fz_clamp(x, func->domain[0][0], func->domain[0][1]);\n\n\t/* Default output is zero, which is suitable for violated constraints */\n\tif ((func->u.e.n != (int)func->u.e.n && x < 0) || (func->u.e.n < 0 && x == 0))\n\t\treturn;\n\n\ttmp = powf(x, func->u.e.n);\n\tfor (i = 0; i < func->base.n; i++)\n\t{\n\t\tout[i] = func->u.e.c0[i] + tmp * (func->u.e.c1[i] - func->u.e.c0[i]);\n\t\tif (func->has_range)\n\t\t\tout[i] = fz_clamp(out[i], func->range[i][0], func->range[i][1]);\n\t}\n}\n\n/*\n * Stitching function\n */\n\nstatic void\nload_stitching_func(pdf_function *func, pdf_document *doc, pdf_obj *dict)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_function **funcs;\n\tpdf_obj *obj;\n\tpdf_obj *sub;\n\tpdf_obj *num;\n\tint k;\n\tint i;\n\n\tfunc->u.st.k = 0;\n\n\tif (func->base.m > 1)\n\t\tfz_warn(ctx, \"stitching functions have at most one input\");\n\tfunc->base.m = 1;\n\n\tobj = pdf_dict_gets(dict, \"Functions\");\n\tif (!pdf_is_array(obj))\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"stitching function has no input functions\");\n\n\tfz_try(ctx)\n\t{\n\t\tpdf_mark_obj(obj);\n\t\tk = pdf_array_len(obj);\n\n\t\tfunc->u.st.funcs = fz_malloc_array(ctx, k, sizeof(fz_function*));\n\t\tfunc->u.st.bounds = fz_malloc_array(ctx, k - 1, sizeof(float));\n\t\tfunc->u.st.encode = fz_malloc_array(ctx, k * 2, sizeof(float));\n\t\tfuncs = func->u.st.funcs;\n\n\t\tfor (i = 0; i < k; i++)\n\t\t{\n\t\t\tsub = pdf_array_get(obj, i);\n\t\t\tfuncs[i] = pdf_load_function(doc, sub, 1, func->base.n);\n\n\t\t\tfunc->base.size += fz_function_size(funcs[i]);\n\t\t\tfunc->u.st.k ++;\n\n\t\t\tif (funcs[i]->m != func->base.m)\n\t\t\t\tfz_warn(ctx, \"wrong number of inputs for sub function %d\", i);\n\t\t\tif (funcs[i]->n != func->base.n)\n\t\t\t\tfz_warn(ctx, \"wrong number of outputs for sub function %d\", i);\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_unmark_obj(obj);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\tobj = pdf_dict_gets(dict, \"Bounds\");\n\tif (!pdf_is_array(obj))\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"stitching function has no bounds\");\n\t{\n\t\tif (pdf_array_len(obj) < k - 1)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"too few subfunction boundaries\");\n\t\tif (pdf_array_len(obj) > k)\n\t\t\tfz_warn(ctx, \"too many subfunction boundaries\");\n\n\t\tfor (i = 0; i < k - 1; i++)\n\t\t{\n\t\t\tnum = pdf_array_get(obj, i);\n\t\t\tfunc->u.st.bounds[i] = pdf_to_real(num);\n\t\t\tif (i && func->u.st.bounds[i - 1] > func->u.st.bounds[i])\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"subfunction %d boundary out of range\", i);\n\t\t}\n\n\t\tif (k > 1 && (func->domain[0][0] > func->u.st.bounds[0] ||\n\t\t\tfunc->domain[0][1] < func->u.st.bounds[k - 2]))\n\t\t\tfz_warn(ctx, \"subfunction boundaries outside of input mapping\");\n\t}\n\n\tfor (i = 0; i < k; i++)\n\t{\n\t\tfunc->u.st.encode[i * 2 + 0] = 0;\n\t\tfunc->u.st.encode[i * 2 + 1] = 0;\n\t}\n\n\tobj = pdf_dict_gets(dict, \"Encode\");\n\tif (pdf_is_array(obj))\n\t{\n\t\tint ranges = fz_mini(k, pdf_array_len(obj) / 2);\n\t\tif (ranges != k)\n\t\t\tfz_warn(ctx, \"wrong number of stitching function input mappings\");\n\n\t\tfor (i = 0; i < ranges; i++)\n\t\t{\n\t\t\tfunc->u.st.encode[i * 2 + 0] = pdf_to_real(pdf_array_get(obj, i * 2 + 0));\n\t\t\tfunc->u.st.encode[i * 2 + 1] = pdf_to_real(pdf_array_get(obj, i * 2 + 1));\n\t\t}\n\t}\n}\n\nstatic void\neval_stitching_func(fz_context *ctx, pdf_function *func, float in, float *out)\n{\n\tfloat low, high;\n\tint k = func->u.st.k;\n\tfloat *bounds = func->u.st.bounds;\n\tint i;\n\n\tin = fz_clamp(in, func->domain[0][0], func->domain[0][1]);\n\n\tfor (i = 0; i < k - 1; i++)\n\t{\n\t\tif (in < bounds[i])\n\t\t\tbreak;\n\t}\n\n\tif (i == 0 && k == 1)\n\t{\n\t\tlow = func->domain[0][0];\n\t\thigh = func->domain[0][1];\n\t}\n\telse if (i == 0)\n\t{\n\t\tlow = func->domain[0][0];\n\t\thigh = bounds[0];\n\t}\n\telse if (i == k - 1)\n\t{\n\t\tlow = bounds[k - 2];\n\t\thigh = func->domain[0][1];\n\t}\n\telse\n\t{\n\t\tlow = bounds[i - 1];\n\t\thigh = bounds[i];\n\t}\n\n\tin = lerp(in, low, high, func->u.st.encode[i * 2 + 0], func->u.st.encode[i * 2 + 1]);\n\n\tfz_eval_function(ctx, func->u.st.funcs[i], &in, 1, out, func->u.st.funcs[i]->n);\n}\n\n/*\n * Common\n */\n\nstatic void\npdf_free_function_imp(fz_context *ctx, fz_storable *func_)\n{\n\tpdf_function *func = (pdf_function *)func_;\n\tint i;\n\n\tswitch (func->type)\n\t{\n\tcase SAMPLE:\n\t\tfz_free(ctx, func->u.sa.samples);\n\t\tbreak;\n\tcase EXPONENTIAL:\n\t\tbreak;\n\tcase STITCHING:\n\t\tfor (i = 0; i < func->u.st.k; i++)\n\t\t\tfz_drop_function(ctx, func->u.st.funcs[i]);\n\t\tfz_free(ctx, func->u.st.funcs);\n\t\tfz_free(ctx, func->u.st.bounds);\n\t\tfz_free(ctx, func->u.st.encode);\n\t\tbreak;\n\tcase POSTSCRIPT:\n\t\tfz_free(ctx, func->u.p.code);\n\t\tbreak;\n\t}\n\tfz_free(ctx, func);\n}\n\nstatic void\npdf_eval_function(fz_context *ctx, fz_function *func_, const float *in, float *out)\n{\n\tpdf_function *func = (pdf_function *)func_;\n\n\tswitch (func->type)\n\t{\n\tcase SAMPLE: eval_sample_func(ctx, func, in, out); break;\n\tcase EXPONENTIAL: eval_exponential_func(ctx, func, *in, out); break;\n\tcase STITCHING: eval_stitching_func(ctx, func, *in, out); break;\n\tcase POSTSCRIPT: eval_postscript_func(ctx, func, in, out); break;\n\t}\n}\n\n/*\n * Debugging prints\n */\n\n#ifndef NDEBUG\nstatic void\npdf_debug_indent(char *prefix, int level, char *suffix)\n{\n\tint i;\n\n\tprintf(\"%s\", prefix);\n\n\tfor (i = 0; i < level; i++)\n\t\tprintf(\"\\t\");\n\n\tprintf(\"%s\", suffix);\n}\n\nstatic void\npdf_debug_ps_func_code(psobj *funccode, psobj *code, int level)\n{\n\tint eof, wasop;\n\n\tpdf_debug_indent(\"\", level, \"{\");\n\n\t/* Print empty blocks as { }, instead of separating braces on different lines. */\n\tif (code->type == PS_OPERATOR && code->u.op == PS_OP_RETURN)\n\t{\n\t\tprintf(\" } \");\n\t\treturn;\n\t}\n\n\tpdf_debug_indent(\"\\n\", ++level, \"\");\n\n\teof = 0;\n\twasop = 0;\n\twhile (!eof)\n\t{\n\t\tswitch (code->type)\n\t\t{\n\t\tcase PS_INT:\n\t\t\tif (wasop)\n\t\t\t\tpdf_debug_indent(\"\\n\", level, \"\");\n\n\t\t\tprintf(\"%d \", code->u.i);\n\t\t\twasop = 0;\n\t\t\tcode++;\n\t\t\tbreak;\n\n\t\tcase PS_REAL:\n\t\t\tif (wasop)\n\t\t\t\tpdf_debug_indent(\"\\n\", level, \"\");\n\n\t\t\tprintf(\"%g \", code->u.f);\n\t\t\twasop = 0;\n\t\t\tcode++;\n\t\t\tbreak;\n\n\t\tcase PS_OPERATOR:\n\t\t\tif (code->u.op == PS_OP_RETURN)\n\t\t\t{\n\t\t\t\tprintf(\"\\n\");\n\t\t\t\teof = 1;\n\t\t\t}\n\t\t\telse if (code->u.op == PS_OP_IF)\n\t\t\t{\n\t\t\t\tprintf(\"\\n\");\n\t\t\t\tpdf_debug_ps_func_code(funccode, &funccode[(code + 2)->u.block], level);\n\n\t\t\t\tprintf(\"%s\", ps_op_names[code->u.op]);\n\t\t\t\tcode = &funccode[(code + 3)->u.block];\n\t\t\t\tif (code->type != PS_OPERATOR || code->u.op != PS_OP_RETURN)\n\t\t\t\t\tpdf_debug_indent(\"\\n\", level, \"\");\n\n\t\t\t\twasop = 0;\n\t\t\t}\n\t\t\telse if (code->u.op == PS_OP_IFELSE)\n\t\t\t{\n\t\t\t\tprintf(\"\\n\");\n\t\t\t\tpdf_debug_ps_func_code(funccode, &funccode[(code + 2)->u.block], level);\n\n\t\t\t\tprintf(\"\\n\");\n\t\t\t\tpdf_debug_ps_func_code(funccode, &funccode[(code + 1)->u.block], level);\n\n\t\t\t\tprintf(\"%s\", ps_op_names[code->u.op]);\n\t\t\t\tcode = &funccode[(code + 3)->u.block];\n\t\t\t\tif (code->type != PS_OPERATOR || code->u.op != PS_OP_RETURN)\n\t\t\t\t\tpdf_debug_indent(\"\\n\", level, \"\");\n\n\t\t\t\twasop = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tprintf(\"%s \", ps_op_names[code->u.op]);\n\t\t\t\tcode++;\n\t\t\t\twasop = 1;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tpdf_debug_indent(\"\", --level, \"} \");\n}\n\nstatic void\npdf_debug_function_imp(fz_function *func_, int level)\n{\n\tint i;\n\tpdf_function *func = (pdf_function *)func_;\n\n\tpdf_debug_indent(\"\", level, \"function {\\n\");\n\n\tpdf_debug_indent(\"\", ++level, \"\");\n\tswitch (func->type)\n\t{\n\tcase SAMPLE:\n\t\tprintf(\"sampled\");\n\t\tbreak;\n\tcase EXPONENTIAL:\n\t\tprintf(\"exponential\");\n\t\tbreak;\n\tcase STITCHING:\n\t\tprintf(\"stitching\");\n\t\tbreak;\n\tcase POSTSCRIPT:\n\t\tprintf(\"postscript\");\n\t\tbreak;\n\t}\n\n\tpdf_debug_indent(\"\\n\", level, \"\");\n\tprintf(\"%d input -> %d output\\n\", func->base.m, func->base.n);\n\n\tpdf_debug_indent(\"\", level, \"domain \");\n\tfor (i = 0; i < func->base.m; i++)\n\t\tprintf(\"%g %g \", func->domain[i][0], func->domain[i][1]);\n\tprintf(\"\\n\");\n\n\tif (func->has_range)\n\t{\n\t\tpdf_debug_indent(\"\", level, \"range \");\n\t\tfor (i = 0; i < func->base.n; i++)\n\t\t\tprintf(\"%g %g \", func->range[i][0], func->range[i][1]);\n\t\tprintf(\"\\n\");\n\t}\n\n\tswitch (func->type)\n\t{\n\tcase SAMPLE:\n\t\tpdf_debug_indent(\"\", level, \"\");\n\t\tprintf(\"bps: %d\\n\", func->u.sa.bps);\n\n\t\tpdf_debug_indent(\"\", level, \"\");\n\t\tprintf(\"size: [ \");\n\t\tfor (i = 0; i < func->base.m; i++)\n\t\t\tprintf(\"%d \", func->u.sa.size[i]);\n\t\tprintf(\"]\\n\");\n\n\t\tpdf_debug_indent(\"\", level, \"\");\n\t\tprintf(\"encode: [ \");\n\t\tfor (i = 0; i < func->base.m; i++)\n\t\t\tprintf(\"%g %g \", func->u.sa.encode[i][0], func->u.sa.encode[i][1]);\n\t\tprintf(\"]\\n\");\n\n\t\tpdf_debug_indent(\"\", level, \"\");\n\t\tprintf(\"decode: [ \");\n\t\tfor (i = 0; i < func->base.m; i++)\n\t\t\tprintf(\"%g %g \", func->u.sa.decode[i][0], func->u.sa.decode[i][1]);\n\t\tprintf(\"]\\n\");\n\t\tbreak;\n\n\tcase EXPONENTIAL:\n\t\tpdf_debug_indent(\"\", level, \"\");\n\t\tprintf(\"n: %g\\n\", func->u.e.n);\n\n\t\tpdf_debug_indent(\"\", level, \"\");\n\t\tprintf(\"c0: [ \");\n\t\tfor (i = 0; i < func->base.n; i++)\n\t\t\tprintf(\"%g \", func->u.e.c0[i]);\n\t\tprintf(\"]\\n\");\n\n\t\tpdf_debug_indent(\"\", level, \"\");\n\t\tprintf(\"c1: [ \");\n\t\tfor (i = 0; i < func->base.n; i++)\n\t\t\tprintf(\"%g \", func->u.e.c1[i]);\n\t\tprintf(\"]\\n\");\n\t\tbreak;\n\n\tcase STITCHING:\n\t\tpdf_debug_indent(\"\", level, \"\");\n\t\tprintf(\"%d functions\\n\", func->u.st.k);\n\n\t\tpdf_debug_indent(\"\", level, \"\");\n\t\tprintf(\"bounds: [ \");\n\t\tfor (i = 0; i < func->u.st.k - 1; i++)\n\t\t\tprintf(\"%g \", func->u.st.bounds[i]);\n\t\tprintf(\"]\\n\");\n\n\t\tpdf_debug_indent(\"\", level, \"\");\n\t\tprintf(\"encode: [ \");\n\t\tfor (i = 0; i < func->u.st.k * 2; i++)\n\t\t\tprintf(\"%g \", func->u.st.encode[i]);\n\t\tprintf(\"]\\n\");\n\n\t\tfor (i = 0; i < func->u.st.k; i++)\n\t\t\tpdf_debug_function_imp(func->u.st.funcs[i], level);\n\t\tbreak;\n\n\tcase POSTSCRIPT:\n\t\tpdf_debug_ps_func_code(func->u.p.code, func->u.p.code, level);\n\t\tprintf(\"\\n\");\n\t\tbreak;\n\t}\n\n\tpdf_debug_indent(\"\", --level, \"}\\n\");\n}\n\nvoid\npdf_debug_function(fz_function *func)\n{\n\tpdf_debug_function_imp(func, 0);\n}\n#endif\n\nfz_function *\npdf_load_function(pdf_document *doc, pdf_obj *dict, int in, int out)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_function *func;\n\tpdf_obj *obj;\n\tint i;\n\n\tif (pdf_obj_marked(dict))\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Recursion in function definition\");\n\n\tif ((func = pdf_find_item(ctx, pdf_free_function_imp, dict)) != NULL)\n\t{\n\t\treturn (fz_function *)func;\n\t}\n\n\tfunc = fz_malloc_struct(ctx, pdf_function);\n\tFZ_INIT_STORABLE(&func->base, 1, pdf_free_function_imp);\n\tfunc->base.size = sizeof(*func);\n\tfunc->base.evaluate = pdf_eval_function;\n#ifndef NDEBUG\n\tfunc->base.debug = pdf_debug_function;\n#endif\n\n\tobj = pdf_dict_gets(dict, \"FunctionType\");\n\tfunc->type = pdf_to_int(obj);\n\n\t/* required for all */\n\tobj = pdf_dict_gets(dict, \"Domain\");\n\tfunc->base.m = fz_clampi(pdf_array_len(obj) / 2, 1, FZ_FN_MAXM);\n\tfor (i = 0; i < func->base.m; i++)\n\t{\n\t\tfunc->domain[i][0] = pdf_to_real(pdf_array_get(obj, i * 2 + 0));\n\t\tfunc->domain[i][1] = pdf_to_real(pdf_array_get(obj, i * 2 + 1));\n\t}\n\n\t/* required for type0 and type4, optional otherwise */\n\tobj = pdf_dict_gets(dict, \"Range\");\n\tif (pdf_is_array(obj))\n\t{\n\t\tfunc->has_range = 1;\n\t\tfunc->base.n = fz_clampi(pdf_array_len(obj) / 2, 1, FZ_FN_MAXN);\n\t\tfor (i = 0; i < func->base.n; i++)\n\t\t{\n\t\t\tfunc->range[i][0] = pdf_to_real(pdf_array_get(obj, i * 2 + 0));\n\t\t\tfunc->range[i][1] = pdf_to_real(pdf_array_get(obj, i * 2 + 1));\n\t\t}\n\t}\n\telse\n\t{\n\t\tfunc->has_range = 0;\n\t\tfunc->base.n = out;\n\t}\n\n\tif (func->base.m != in)\n\t\tfz_warn(ctx, \"wrong number of function inputs\");\n\tif (func->base.n != out)\n\t\tfz_warn(ctx, \"wrong number of function outputs\");\n\n\tfz_try(ctx)\n\t{\n\t\tswitch (func->type)\n\t\t{\n\t\tcase SAMPLE:\n\t\t\tload_sample_func(func, doc, dict, pdf_to_num(dict), pdf_to_gen(dict));\n\t\t\tbreak;\n\n\t\tcase EXPONENTIAL:\n\t\t\tload_exponential_func(ctx, func, dict);\n\t\t\tbreak;\n\n\t\tcase STITCHING:\n\t\t\tload_stitching_func(func, doc, dict);\n\t\t\tbreak;\n\n\t\tcase POSTSCRIPT:\n\t\t\tload_postscript_func(func, doc, dict, pdf_to_num(dict), pdf_to_gen(dict));\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"unknown function type (%d %d R)\", pdf_to_num(dict), pdf_to_gen(dict));\n\t\t}\n\n\t\tpdf_store_item(ctx, dict, func, func->base.size);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tint type = func->type;\n\t\tfz_drop_function(ctx, (fz_function *)func);\n\t\tfz_rethrow_message(ctx, \"cannot load %s function (%d %d R)\",\n\t\t\t\t\ttype == SAMPLE ? \"sampled\" :\n\t\t\t\t\ttype == EXPONENTIAL ? \"exponential\" :\n\t\t\t\t\ttype == STITCHING ? \"stitching\" :\n\t\t\t\t\ttype == POSTSCRIPT ? \"calculator\" :\n\t\t\t\t\t\"unknown\",\n\t\t\t\t\tpdf_to_num(dict), pdf_to_gen(dict));\n\t}\n\n\treturn (fz_function *)func;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-glyphlist.h",
    "content": "/*\n# Name: Adobe Glyph List\n# Table version: 2.0\n# Date: September 20, 2002\n#\n# See http://partners.adobe.com/asn/developer/typeforum/unicodegn.html\n#\n# Format: Semicolon-delimited fields:\n#\t(1) glyph name\n#\t(2) Unicode scalar value\n#--end\n*/\n\nstatic const char *agl_name_list[] = {\n\"A\",\"AE\",\"AEacute\",\"AEmacron\",\"AEsmall\",\"Aacute\",\"Aacutesmall\",\"Abreve\",\n\"Abreveacute\",\"Abrevecyrillic\",\"Abrevedotbelow\",\"Abrevegrave\",\n\"Abrevehookabove\",\"Abrevetilde\",\"Acaron\",\"Acircle\",\"Acircumflex\",\n\"Acircumflexacute\",\"Acircumflexdotbelow\",\"Acircumflexgrave\",\n\"Acircumflexhookabove\",\"Acircumflexsmall\",\"Acircumflextilde\",\"Acute\",\n\"Acutesmall\",\"Acyrillic\",\"Adblgrave\",\"Adieresis\",\"Adieresiscyrillic\",\n\"Adieresismacron\",\"Adieresissmall\",\"Adotbelow\",\"Adotmacron\",\"Agrave\",\n\"Agravesmall\",\"Ahookabove\",\"Aiecyrillic\",\"Ainvertedbreve\",\"Alpha\",\n\"Alphatonos\",\"Amacron\",\"Amonospace\",\"Aogonek\",\"Aring\",\"Aringacute\",\n\"Aringbelow\",\"Aringsmall\",\"Asmall\",\"Atilde\",\"Atildesmall\",\"Aybarmenian\",\"B\",\n\"Bcircle\",\"Bdotaccent\",\"Bdotbelow\",\"Becyrillic\",\"Benarmenian\",\"Beta\",\"Bhook\",\n\"Blinebelow\",\"Bmonospace\",\"Brevesmall\",\"Bsmall\",\"Btopbar\",\"C\",\"Caarmenian\",\n\"Cacute\",\"Caron\",\"Caronsmall\",\"Ccaron\",\"Ccedilla\",\"Ccedillaacute\",\n\"Ccedillasmall\",\"Ccircle\",\"Ccircumflex\",\"Cdot\",\"Cdotaccent\",\"Cedillasmall\",\n\"Chaarmenian\",\"Cheabkhasiancyrillic\",\"Checyrillic\",\n\"Chedescenderabkhasiancyrillic\",\"Chedescendercyrillic\",\"Chedieresiscyrillic\",\n\"Cheharmenian\",\"Chekhakassiancyrillic\",\"Cheverticalstrokecyrillic\",\"Chi\",\n\"Chook\",\"Circumflexsmall\",\"Cmonospace\",\"Coarmenian\",\"Csmall\",\"D\",\"DZ\",\n\"DZcaron\",\"Daarmenian\",\"Dafrican\",\"Dcaron\",\"Dcedilla\",\"Dcircle\",\n\"Dcircumflexbelow\",\"Dcroat\",\"Ddotaccent\",\"Ddotbelow\",\"Decyrillic\",\"Deicoptic\",\n\"Delta\",\"Deltagreek\",\"Dhook\",\"Dieresis\",\"DieresisAcute\",\"DieresisGrave\",\n\"Dieresissmall\",\"Digammagreek\",\"Djecyrillic\",\"Dlinebelow\",\"Dmonospace\",\n\"Dotaccentsmall\",\"Dslash\",\"Dsmall\",\"Dtopbar\",\"Dz\",\"Dzcaron\",\n\"Dzeabkhasiancyrillic\",\"Dzecyrillic\",\"Dzhecyrillic\",\"E\",\"Eacute\",\n\"Eacutesmall\",\"Ebreve\",\"Ecaron\",\"Ecedillabreve\",\"Echarmenian\",\"Ecircle\",\n\"Ecircumflex\",\"Ecircumflexacute\",\"Ecircumflexbelow\",\"Ecircumflexdotbelow\",\n\"Ecircumflexgrave\",\"Ecircumflexhookabove\",\"Ecircumflexsmall\",\n\"Ecircumflextilde\",\"Ecyrillic\",\"Edblgrave\",\"Edieresis\",\"Edieresissmall\",\n\"Edot\",\"Edotaccent\",\"Edotbelow\",\"Efcyrillic\",\"Egrave\",\"Egravesmall\",\n\"Eharmenian\",\"Ehookabove\",\"Eightroman\",\"Einvertedbreve\",\"Eiotifiedcyrillic\",\n\"Elcyrillic\",\"Elevenroman\",\"Emacron\",\"Emacronacute\",\"Emacrongrave\",\n\"Emcyrillic\",\"Emonospace\",\"Encyrillic\",\"Endescendercyrillic\",\"Eng\",\n\"Enghecyrillic\",\"Enhookcyrillic\",\"Eogonek\",\"Eopen\",\"Epsilon\",\"Epsilontonos\",\n\"Ercyrillic\",\"Ereversed\",\"Ereversedcyrillic\",\"Escyrillic\",\n\"Esdescendercyrillic\",\"Esh\",\"Esmall\",\"Eta\",\"Etarmenian\",\"Etatonos\",\"Eth\",\n\"Ethsmall\",\"Etilde\",\"Etildebelow\",\"Euro\",\"Ezh\",\"Ezhcaron\",\"Ezhreversed\",\"F\",\n\"Fcircle\",\"Fdotaccent\",\"Feharmenian\",\"Feicoptic\",\"Fhook\",\"Fitacyrillic\",\n\"Fiveroman\",\"Fmonospace\",\"Fourroman\",\"Fsmall\",\"G\",\"GBsquare\",\"Gacute\",\"Gamma\",\n\"Gammaafrican\",\"Gangiacoptic\",\"Gbreve\",\"Gcaron\",\"Gcedilla\",\"Gcircle\",\n\"Gcircumflex\",\"Gcommaaccent\",\"Gdot\",\"Gdotaccent\",\"Gecyrillic\",\"Ghadarmenian\",\n\"Ghemiddlehookcyrillic\",\"Ghestrokecyrillic\",\"Gheupturncyrillic\",\"Ghook\",\n\"Gimarmenian\",\"Gjecyrillic\",\"Gmacron\",\"Gmonospace\",\"Grave\",\"Gravesmall\",\n\"Gsmall\",\"Gsmallhook\",\"Gstroke\",\"H\",\"H18533\",\"H18543\",\"H18551\",\"H22073\",\n\"HPsquare\",\"Haabkhasiancyrillic\",\"Hadescendercyrillic\",\"Hardsigncyrillic\",\n\"Hbar\",\"Hbrevebelow\",\"Hcedilla\",\"Hcircle\",\"Hcircumflex\",\"Hdieresis\",\n\"Hdotaccent\",\"Hdotbelow\",\"Hmonospace\",\"Hoarmenian\",\"Horicoptic\",\"Hsmall\",\n\"Hungarumlaut\",\"Hungarumlautsmall\",\"Hzsquare\",\"I\",\"IAcyrillic\",\"IJ\",\n\"IUcyrillic\",\"Iacute\",\"Iacutesmall\",\"Ibreve\",\"Icaron\",\"Icircle\",\"Icircumflex\",\n\"Icircumflexsmall\",\"Icyrillic\",\"Idblgrave\",\"Idieresis\",\"Idieresisacute\",\n\"Idieresiscyrillic\",\"Idieresissmall\",\"Idot\",\"Idotaccent\",\"Idotbelow\",\n\"Iebrevecyrillic\",\"Iecyrillic\",\"Ifraktur\",\"Igrave\",\"Igravesmall\",\"Ihookabove\",\n\"Iicyrillic\",\"Iinvertedbreve\",\"Iishortcyrillic\",\"Imacron\",\"Imacroncyrillic\",\n\"Imonospace\",\"Iniarmenian\",\"Iocyrillic\",\"Iogonek\",\"Iota\",\"Iotaafrican\",\n\"Iotadieresis\",\"Iotatonos\",\"Ismall\",\"Istroke\",\"Itilde\",\"Itildebelow\",\n\"Izhitsacyrillic\",\"Izhitsadblgravecyrillic\",\"J\",\"Jaarmenian\",\"Jcircle\",\n\"Jcircumflex\",\"Jecyrillic\",\"Jheharmenian\",\"Jmonospace\",\"Jsmall\",\"K\",\n\"KBsquare\",\"KKsquare\",\"Kabashkircyrillic\",\"Kacute\",\"Kacyrillic\",\n\"Kadescendercyrillic\",\"Kahookcyrillic\",\"Kappa\",\"Kastrokecyrillic\",\n\"Kaverticalstrokecyrillic\",\"Kcaron\",\"Kcedilla\",\"Kcircle\",\"Kcommaaccent\",\n\"Kdotbelow\",\"Keharmenian\",\"Kenarmenian\",\"Khacyrillic\",\"Kheicoptic\",\"Khook\",\n\"Kjecyrillic\",\"Klinebelow\",\"Kmonospace\",\"Koppacyrillic\",\"Koppagreek\",\n\"Ksicyrillic\",\"Ksmall\",\"L\",\"LJ\",\"LL\",\"Lacute\",\"Lambda\",\"Lcaron\",\"Lcedilla\",\n\"Lcircle\",\"Lcircumflexbelow\",\"Lcommaaccent\",\"Ldot\",\"Ldotaccent\",\"Ldotbelow\",\n\"Ldotbelowmacron\",\"Liwnarmenian\",\"Lj\",\"Ljecyrillic\",\"Llinebelow\",\"Lmonospace\",\n\"Lslash\",\"Lslashsmall\",\"Lsmall\",\"M\",\"MBsquare\",\"Macron\",\"Macronsmall\",\n\"Macute\",\"Mcircle\",\"Mdotaccent\",\"Mdotbelow\",\"Menarmenian\",\"Mmonospace\",\n\"Msmall\",\"Mturned\",\"Mu\",\"N\",\"NJ\",\"Nacute\",\"Ncaron\",\"Ncedilla\",\"Ncircle\",\n\"Ncircumflexbelow\",\"Ncommaaccent\",\"Ndotaccent\",\"Ndotbelow\",\"Nhookleft\",\n\"Nineroman\",\"Nj\",\"Njecyrillic\",\"Nlinebelow\",\"Nmonospace\",\"Nowarmenian\",\n\"Nsmall\",\"Ntilde\",\"Ntildesmall\",\"Nu\",\"O\",\"OE\",\"OEsmall\",\"Oacute\",\n\"Oacutesmall\",\"Obarredcyrillic\",\"Obarreddieresiscyrillic\",\"Obreve\",\"Ocaron\",\n\"Ocenteredtilde\",\"Ocircle\",\"Ocircumflex\",\"Ocircumflexacute\",\n\"Ocircumflexdotbelow\",\"Ocircumflexgrave\",\"Ocircumflexhookabove\",\n\"Ocircumflexsmall\",\"Ocircumflextilde\",\"Ocyrillic\",\"Odblacute\",\"Odblgrave\",\n\"Odieresis\",\"Odieresiscyrillic\",\"Odieresissmall\",\"Odotbelow\",\"Ogoneksmall\",\n\"Ograve\",\"Ogravesmall\",\"Oharmenian\",\"Ohm\",\"Ohookabove\",\"Ohorn\",\"Ohornacute\",\n\"Ohorndotbelow\",\"Ohorngrave\",\"Ohornhookabove\",\"Ohorntilde\",\"Ohungarumlaut\",\n\"Oi\",\"Oinvertedbreve\",\"Omacron\",\"Omacronacute\",\"Omacrongrave\",\"Omega\",\n\"Omegacyrillic\",\"Omegagreek\",\"Omegaroundcyrillic\",\"Omegatitlocyrillic\",\n\"Omegatonos\",\"Omicron\",\"Omicrontonos\",\"Omonospace\",\"Oneroman\",\"Oogonek\",\n\"Oogonekmacron\",\"Oopen\",\"Oslash\",\"Oslashacute\",\"Oslashsmall\",\"Osmall\",\n\"Ostrokeacute\",\"Otcyrillic\",\"Otilde\",\"Otildeacute\",\"Otildedieresis\",\n\"Otildesmall\",\"P\",\"Pacute\",\"Pcircle\",\"Pdotaccent\",\"Pecyrillic\",\"Peharmenian\",\n\"Pemiddlehookcyrillic\",\"Phi\",\"Phook\",\"Pi\",\"Piwrarmenian\",\"Pmonospace\",\"Psi\",\n\"Psicyrillic\",\"Psmall\",\"Q\",\"Qcircle\",\"Qmonospace\",\"Qsmall\",\"R\",\"Raarmenian\",\n\"Racute\",\"Rcaron\",\"Rcedilla\",\"Rcircle\",\"Rcommaaccent\",\"Rdblgrave\",\n\"Rdotaccent\",\"Rdotbelow\",\"Rdotbelowmacron\",\"Reharmenian\",\"Rfraktur\",\"Rho\",\n\"Ringsmall\",\"Rinvertedbreve\",\"Rlinebelow\",\"Rmonospace\",\"Rsmall\",\n\"Rsmallinverted\",\"Rsmallinvertedsuperior\",\"S\",\"SF010000\",\"SF020000\",\n\"SF030000\",\"SF040000\",\"SF050000\",\"SF060000\",\"SF070000\",\"SF080000\",\"SF090000\",\n\"SF100000\",\"SF110000\",\"SF190000\",\"SF200000\",\"SF210000\",\"SF220000\",\"SF230000\",\n\"SF240000\",\"SF250000\",\"SF260000\",\"SF270000\",\"SF280000\",\"SF360000\",\"SF370000\",\n\"SF380000\",\"SF390000\",\"SF400000\",\"SF410000\",\"SF420000\",\"SF430000\",\"SF440000\",\n\"SF450000\",\"SF460000\",\"SF470000\",\"SF480000\",\"SF490000\",\"SF500000\",\"SF510000\",\n\"SF520000\",\"SF530000\",\"SF540000\",\"Sacute\",\"Sacutedotaccent\",\"Sampigreek\",\n\"Scaron\",\"Scarondotaccent\",\"Scaronsmall\",\"Scedilla\",\"Schwa\",\"Schwacyrillic\",\n\"Schwadieresiscyrillic\",\"Scircle\",\"Scircumflex\",\"Scommaaccent\",\"Sdotaccent\",\n\"Sdotbelow\",\"Sdotbelowdotaccent\",\"Seharmenian\",\"Sevenroman\",\"Shaarmenian\",\n\"Shacyrillic\",\"Shchacyrillic\",\"Sheicoptic\",\"Shhacyrillic\",\"Shimacoptic\",\n\"Sigma\",\"Sixroman\",\"Smonospace\",\"Softsigncyrillic\",\"Ssmall\",\"Stigmagreek\",\"T\",\n\"Tau\",\"Tbar\",\"Tcaron\",\"Tcedilla\",\"Tcircle\",\"Tcircumflexbelow\",\"Tcommaaccent\",\n\"Tdotaccent\",\"Tdotbelow\",\"Tecyrillic\",\"Tedescendercyrillic\",\"Tenroman\",\n\"Tetsecyrillic\",\"Theta\",\"Thook\",\"Thorn\",\"Thornsmall\",\"Threeroman\",\n\"Tildesmall\",\"Tiwnarmenian\",\"Tlinebelow\",\"Tmonospace\",\"Toarmenian\",\"Tonefive\",\n\"Tonesix\",\"Tonetwo\",\"Tretroflexhook\",\"Tsecyrillic\",\"Tshecyrillic\",\"Tsmall\",\n\"Twelveroman\",\"Tworoman\",\"U\",\"Uacute\",\"Uacutesmall\",\"Ubreve\",\"Ucaron\",\n\"Ucircle\",\"Ucircumflex\",\"Ucircumflexbelow\",\"Ucircumflexsmall\",\"Ucyrillic\",\n\"Udblacute\",\"Udblgrave\",\"Udieresis\",\"Udieresisacute\",\"Udieresisbelow\",\n\"Udieresiscaron\",\"Udieresiscyrillic\",\"Udieresisgrave\",\"Udieresismacron\",\n\"Udieresissmall\",\"Udotbelow\",\"Ugrave\",\"Ugravesmall\",\"Uhookabove\",\"Uhorn\",\n\"Uhornacute\",\"Uhorndotbelow\",\"Uhorngrave\",\"Uhornhookabove\",\"Uhorntilde\",\n\"Uhungarumlaut\",\"Uhungarumlautcyrillic\",\"Uinvertedbreve\",\"Ukcyrillic\",\n\"Umacron\",\"Umacroncyrillic\",\"Umacrondieresis\",\"Umonospace\",\"Uogonek\",\n\"Upsilon\",\"Upsilon1\",\"Upsilonacutehooksymbolgreek\",\"Upsilonafrican\",\n\"Upsilondieresis\",\"Upsilondieresishooksymbolgreek\",\"Upsilonhooksymbol\",\n\"Upsilontonos\",\"Uring\",\"Ushortcyrillic\",\"Usmall\",\"Ustraightcyrillic\",\n\"Ustraightstrokecyrillic\",\"Utilde\",\"Utildeacute\",\"Utildebelow\",\"V\",\"Vcircle\",\n\"Vdotbelow\",\"Vecyrillic\",\"Vewarmenian\",\"Vhook\",\"Vmonospace\",\"Voarmenian\",\n\"Vsmall\",\"Vtilde\",\"W\",\"Wacute\",\"Wcircle\",\"Wcircumflex\",\"Wdieresis\",\n\"Wdotaccent\",\"Wdotbelow\",\"Wgrave\",\"Wmonospace\",\"Wsmall\",\"X\",\"Xcircle\",\n\"Xdieresis\",\"Xdotaccent\",\"Xeharmenian\",\"Xi\",\"Xmonospace\",\"Xsmall\",\"Y\",\n\"Yacute\",\"Yacutesmall\",\"Yatcyrillic\",\"Ycircle\",\"Ycircumflex\",\"Ydieresis\",\n\"Ydieresissmall\",\"Ydotaccent\",\"Ydotbelow\",\"Yericyrillic\",\n\"Yerudieresiscyrillic\",\"Ygrave\",\"Yhook\",\"Yhookabove\",\"Yiarmenian\",\n\"Yicyrillic\",\"Yiwnarmenian\",\"Ymonospace\",\"Ysmall\",\"Ytilde\",\"Yusbigcyrillic\",\n\"Yusbigiotifiedcyrillic\",\"Yuslittlecyrillic\",\"Yuslittleiotifiedcyrillic\",\"Z\",\n\"Zaarmenian\",\"Zacute\",\"Zcaron\",\"Zcaronsmall\",\"Zcircle\",\"Zcircumflex\",\"Zdot\",\n\"Zdotaccent\",\"Zdotbelow\",\"Zecyrillic\",\"Zedescendercyrillic\",\n\"Zedieresiscyrillic\",\"Zeta\",\"Zhearmenian\",\"Zhebrevecyrillic\",\"Zhecyrillic\",\n\"Zhedescendercyrillic\",\"Zhedieresiscyrillic\",\"Zlinebelow\",\"Zmonospace\",\n\"Zsmall\",\"Zstroke\",\"a\",\"aabengali\",\"aacute\",\"aadeva\",\"aagujarati\",\n\"aagurmukhi\",\"aamatragurmukhi\",\"aarusquare\",\"aavowelsignbengali\",\n\"aavowelsigndeva\",\"aavowelsigngujarati\",\"abbreviationmarkarmenian\",\n\"abbreviationsigndeva\",\"abengali\",\"abopomofo\",\"abreve\",\"abreveacute\",\n\"abrevecyrillic\",\"abrevedotbelow\",\"abrevegrave\",\"abrevehookabove\",\n\"abrevetilde\",\"acaron\",\"acircle\",\"acircumflex\",\"acircumflexacute\",\n\"acircumflexdotbelow\",\"acircumflexgrave\",\"acircumflexhookabove\",\n\"acircumflextilde\",\"acute\",\"acutebelowcmb\",\"acutecmb\",\"acutecomb\",\"acutedeva\",\n\"acutelowmod\",\"acutetonecmb\",\"acyrillic\",\"adblgrave\",\"addakgurmukhi\",\"adeva\",\n\"adieresis\",\"adieresiscyrillic\",\"adieresismacron\",\"adotbelow\",\"adotmacron\",\n\"ae\",\"aeacute\",\"aekorean\",\"aemacron\",\"afii00208\",\"afii08941\",\"afii10017\",\n\"afii10018\",\"afii10019\",\"afii10020\",\"afii10021\",\"afii10022\",\"afii10023\",\n\"afii10024\",\"afii10025\",\"afii10026\",\"afii10027\",\"afii10028\",\"afii10029\",\n\"afii10030\",\"afii10031\",\"afii10032\",\"afii10033\",\"afii10034\",\"afii10035\",\n\"afii10036\",\"afii10037\",\"afii10038\",\"afii10039\",\"afii10040\",\"afii10041\",\n\"afii10042\",\"afii10043\",\"afii10044\",\"afii10045\",\"afii10046\",\"afii10047\",\n\"afii10048\",\"afii10049\",\"afii10050\",\"afii10051\",\"afii10052\",\"afii10053\",\n\"afii10054\",\"afii10055\",\"afii10056\",\"afii10057\",\"afii10058\",\"afii10059\",\n\"afii10060\",\"afii10061\",\"afii10062\",\"afii10063\",\"afii10064\",\"afii10065\",\n\"afii10066\",\"afii10067\",\"afii10068\",\"afii10069\",\"afii10070\",\"afii10071\",\n\"afii10072\",\"afii10073\",\"afii10074\",\"afii10075\",\"afii10076\",\"afii10077\",\n\"afii10078\",\"afii10079\",\"afii10080\",\"afii10081\",\"afii10082\",\"afii10083\",\n\"afii10084\",\"afii10085\",\"afii10086\",\"afii10087\",\"afii10088\",\"afii10089\",\n\"afii10090\",\"afii10091\",\"afii10092\",\"afii10093\",\"afii10094\",\"afii10095\",\n\"afii10096\",\"afii10097\",\"afii10098\",\"afii10099\",\"afii10100\",\"afii10101\",\n\"afii10102\",\"afii10103\",\"afii10104\",\"afii10105\",\"afii10106\",\"afii10107\",\n\"afii10108\",\"afii10109\",\"afii10110\",\"afii10145\",\"afii10146\",\"afii10147\",\n\"afii10148\",\"afii10192\",\"afii10193\",\"afii10194\",\"afii10195\",\"afii10196\",\n\"afii10831\",\"afii10832\",\"afii10846\",\"afii299\",\"afii300\",\"afii301\",\"afii57381\",\n\"afii57388\",\"afii57392\",\"afii57393\",\"afii57394\",\"afii57395\",\"afii57396\",\n\"afii57397\",\"afii57398\",\"afii57399\",\"afii57400\",\"afii57401\",\"afii57403\",\n\"afii57407\",\"afii57409\",\"afii57410\",\"afii57411\",\"afii57412\",\"afii57413\",\n\"afii57414\",\"afii57415\",\"afii57416\",\"afii57417\",\"afii57418\",\"afii57419\",\n\"afii57420\",\"afii57421\",\"afii57422\",\"afii57423\",\"afii57424\",\"afii57425\",\n\"afii57426\",\"afii57427\",\"afii57428\",\"afii57429\",\"afii57430\",\"afii57431\",\n\"afii57432\",\"afii57433\",\"afii57434\",\"afii57440\",\"afii57441\",\"afii57442\",\n\"afii57443\",\"afii57444\",\"afii57445\",\"afii57446\",\"afii57448\",\"afii57449\",\n\"afii57450\",\"afii57451\",\"afii57452\",\"afii57453\",\"afii57454\",\"afii57455\",\n\"afii57456\",\"afii57457\",\"afii57458\",\"afii57470\",\"afii57505\",\"afii57506\",\n\"afii57507\",\"afii57508\",\"afii57509\",\"afii57511\",\"afii57512\",\"afii57513\",\n\"afii57514\",\"afii57519\",\"afii57534\",\"afii57636\",\"afii57645\",\"afii57658\",\n\"afii57664\",\"afii57665\",\"afii57666\",\"afii57667\",\"afii57668\",\"afii57669\",\n\"afii57670\",\"afii57671\",\"afii57672\",\"afii57673\",\"afii57674\",\"afii57675\",\n\"afii57676\",\"afii57677\",\"afii57678\",\"afii57679\",\"afii57680\",\"afii57681\",\n\"afii57682\",\"afii57683\",\"afii57684\",\"afii57685\",\"afii57686\",\"afii57687\",\n\"afii57688\",\"afii57689\",\"afii57690\",\"afii57694\",\"afii57695\",\"afii57700\",\n\"afii57705\",\"afii57716\",\"afii57717\",\"afii57718\",\"afii57723\",\"afii57793\",\n\"afii57794\",\"afii57795\",\"afii57796\",\"afii57797\",\"afii57798\",\"afii57799\",\n\"afii57800\",\"afii57801\",\"afii57802\",\"afii57803\",\"afii57804\",\"afii57806\",\n\"afii57807\",\"afii57839\",\"afii57841\",\"afii57842\",\"afii57929\",\"afii61248\",\n\"afii61289\",\"afii61352\",\"afii61573\",\"afii61574\",\"afii61575\",\"afii61664\",\n\"afii63167\",\"afii64937\",\"agrave\",\"agujarati\",\"agurmukhi\",\"ahiragana\",\n\"ahookabove\",\"aibengali\",\"aibopomofo\",\"aideva\",\"aiecyrillic\",\"aigujarati\",\n\"aigurmukhi\",\"aimatragurmukhi\",\"ainarabic\",\"ainfinalarabic\",\n\"aininitialarabic\",\"ainmedialarabic\",\"ainvertedbreve\",\"aivowelsignbengali\",\n\"aivowelsigndeva\",\"aivowelsigngujarati\",\"akatakana\",\"akatakanahalfwidth\",\n\"akorean\",\"alef\",\"alefarabic\",\"alefdageshhebrew\",\"aleffinalarabic\",\n\"alefhamzaabovearabic\",\"alefhamzaabovefinalarabic\",\"alefhamzabelowarabic\",\n\"alefhamzabelowfinalarabic\",\"alefhebrew\",\"aleflamedhebrew\",\n\"alefmaddaabovearabic\",\"alefmaddaabovefinalarabic\",\"alefmaksuraarabic\",\n\"alefmaksurafinalarabic\",\"alefmaksurainitialarabic\",\"alefmaksuramedialarabic\",\n\"alefpatahhebrew\",\"alefqamatshebrew\",\"aleph\",\"allequal\",\"alpha\",\"alphatonos\",\n\"amacron\",\"amonospace\",\"ampersand\",\"ampersandmonospace\",\"ampersandsmall\",\n\"amsquare\",\"anbopomofo\",\"angbopomofo\",\"angkhankhuthai\",\"angle\",\n\"anglebracketleft\",\"anglebracketleftvertical\",\"anglebracketright\",\n\"anglebracketrightvertical\",\"angleleft\",\"angleright\",\"angstrom\",\"anoteleia\",\n\"anudattadeva\",\"anusvarabengali\",\"anusvaradeva\",\"anusvaragujarati\",\"aogonek\",\n\"apaatosquare\",\"aparen\",\"apostrophearmenian\",\"apostrophemod\",\"apple\",\n\"approaches\",\"approxequal\",\"approxequalorimage\",\"approximatelyequal\",\n\"araeaekorean\",\"araeakorean\",\"arc\",\"arighthalfring\",\"aring\",\"aringacute\",\n\"aringbelow\",\"arrowboth\",\"arrowdashdown\",\"arrowdashleft\",\"arrowdashright\",\n\"arrowdashup\",\"arrowdblboth\",\"arrowdbldown\",\"arrowdblleft\",\"arrowdblright\",\n\"arrowdblup\",\"arrowdown\",\"arrowdownleft\",\"arrowdownright\",\"arrowdownwhite\",\n\"arrowheaddownmod\",\"arrowheadleftmod\",\"arrowheadrightmod\",\"arrowheadupmod\",\n\"arrowhorizex\",\"arrowleft\",\"arrowleftdbl\",\"arrowleftdblstroke\",\n\"arrowleftoverright\",\"arrowleftwhite\",\"arrowright\",\"arrowrightdblstroke\",\n\"arrowrightheavy\",\"arrowrightoverleft\",\"arrowrightwhite\",\"arrowtableft\",\n\"arrowtabright\",\"arrowup\",\"arrowupdn\",\"arrowupdnbse\",\"arrowupdownbase\",\n\"arrowupleft\",\"arrowupleftofdown\",\"arrowupright\",\"arrowupwhite\",\"arrowvertex\",\n\"asciicircum\",\"asciicircummonospace\",\"asciitilde\",\"asciitildemonospace\",\n\"ascript\",\"ascriptturned\",\"asmallhiragana\",\"asmallkatakana\",\n\"asmallkatakanahalfwidth\",\"asterisk\",\"asteriskaltonearabic\",\"asteriskarabic\",\n\"asteriskmath\",\"asteriskmonospace\",\"asterisksmall\",\"asterism\",\"asuperior\",\n\"asymptoticallyequal\",\"at\",\"atilde\",\"atmonospace\",\"atsmall\",\"aturned\",\n\"aubengali\",\"aubopomofo\",\"audeva\",\"augujarati\",\"augurmukhi\",\n\"aulengthmarkbengali\",\"aumatragurmukhi\",\"auvowelsignbengali\",\n\"auvowelsigndeva\",\"auvowelsigngujarati\",\"avagrahadeva\",\"aybarmenian\",\"ayin\",\n\"ayinaltonehebrew\",\"ayinhebrew\",\"b\",\"babengali\",\"backslash\",\n\"backslashmonospace\",\"badeva\",\"bagujarati\",\"bagurmukhi\",\"bahiragana\",\n\"bahtthai\",\"bakatakana\",\"bar\",\"barmonospace\",\"bbopomofo\",\"bcircle\",\n\"bdotaccent\",\"bdotbelow\",\"beamedsixteenthnotes\",\"because\",\"becyrillic\",\n\"beharabic\",\"behfinalarabic\",\"behinitialarabic\",\"behiragana\",\n\"behmedialarabic\",\"behmeeminitialarabic\",\"behmeemisolatedarabic\",\n\"behnoonfinalarabic\",\"bekatakana\",\"benarmenian\",\"bet\",\"beta\",\n\"betasymbolgreek\",\"betdagesh\",\"betdageshhebrew\",\"bethebrew\",\"betrafehebrew\",\n\"bhabengali\",\"bhadeva\",\"bhagujarati\",\"bhagurmukhi\",\"bhook\",\"bihiragana\",\n\"bikatakana\",\"bilabialclick\",\"bindigurmukhi\",\"birusquare\",\"blackcircle\",\n\"blackdiamond\",\"blackdownpointingtriangle\",\"blackleftpointingpointer\",\n\"blackleftpointingtriangle\",\"blacklenticularbracketleft\",\n\"blacklenticularbracketleftvertical\",\"blacklenticularbracketright\",\n\"blacklenticularbracketrightvertical\",\"blacklowerlefttriangle\",\n\"blacklowerrighttriangle\",\"blackrectangle\",\"blackrightpointingpointer\",\n\"blackrightpointingtriangle\",\"blacksmallsquare\",\"blacksmilingface\",\n\"blacksquare\",\"blackstar\",\"blackupperlefttriangle\",\"blackupperrighttriangle\",\n\"blackuppointingsmalltriangle\",\"blackuppointingtriangle\",\"blank\",\"blinebelow\",\n\"block\",\"bmonospace\",\"bobaimaithai\",\"bohiragana\",\"bokatakana\",\"bparen\",\n\"bqsquare\",\"braceex\",\"braceleft\",\"braceleftbt\",\"braceleftmid\",\n\"braceleftmonospace\",\"braceleftsmall\",\"bracelefttp\",\"braceleftvertical\",\n\"braceright\",\"bracerightbt\",\"bracerightmid\",\"bracerightmonospace\",\n\"bracerightsmall\",\"bracerighttp\",\"bracerightvertical\",\"bracketleft\",\n\"bracketleftbt\",\"bracketleftex\",\"bracketleftmonospace\",\"bracketlefttp\",\n\"bracketright\",\"bracketrightbt\",\"bracketrightex\",\"bracketrightmonospace\",\n\"bracketrighttp\",\"breve\",\"brevebelowcmb\",\"brevecmb\",\"breveinvertedbelowcmb\",\n\"breveinvertedcmb\",\"breveinverteddoublecmb\",\"bridgebelowcmb\",\n\"bridgeinvertedbelowcmb\",\"brokenbar\",\"bstroke\",\"bsuperior\",\"btopbar\",\n\"buhiragana\",\"bukatakana\",\"bullet\",\"bulletinverse\",\"bulletoperator\",\n\"bullseye\",\"c\",\"caarmenian\",\"cabengali\",\"cacute\",\"cadeva\",\"cagujarati\",\n\"cagurmukhi\",\"calsquare\",\"candrabindubengali\",\"candrabinducmb\",\n\"candrabindudeva\",\"candrabindugujarati\",\"capslock\",\"careof\",\"caron\",\n\"caronbelowcmb\",\"caroncmb\",\"carriagereturn\",\"cbopomofo\",\"ccaron\",\"ccedilla\",\n\"ccedillaacute\",\"ccircle\",\"ccircumflex\",\"ccurl\",\"cdot\",\"cdotaccent\",\n\"cdsquare\",\"cedilla\",\"cedillacmb\",\"cent\",\"centigrade\",\"centinferior\",\n\"centmonospace\",\"centoldstyle\",\"centsuperior\",\"chaarmenian\",\"chabengali\",\n\"chadeva\",\"chagujarati\",\"chagurmukhi\",\"chbopomofo\",\"cheabkhasiancyrillic\",\n\"checkmark\",\"checyrillic\",\"chedescenderabkhasiancyrillic\",\n\"chedescendercyrillic\",\"chedieresiscyrillic\",\"cheharmenian\",\n\"chekhakassiancyrillic\",\"cheverticalstrokecyrillic\",\"chi\",\n\"chieuchacirclekorean\",\"chieuchaparenkorean\",\"chieuchcirclekorean\",\n\"chieuchkorean\",\"chieuchparenkorean\",\"chochangthai\",\"chochanthai\",\n\"chochingthai\",\"chochoethai\",\"chook\",\"cieucacirclekorean\",\"cieucaparenkorean\",\n\"cieuccirclekorean\",\"cieuckorean\",\"cieucparenkorean\",\"cieucuparenkorean\",\n\"circle\",\"circlemultiply\",\"circleot\",\"circleplus\",\"circlepostalmark\",\n\"circlewithlefthalfblack\",\"circlewithrighthalfblack\",\"circumflex\",\n\"circumflexbelowcmb\",\"circumflexcmb\",\"clear\",\"clickalveolar\",\"clickdental\",\n\"clicklateral\",\"clickretroflex\",\"club\",\"clubsuitblack\",\"clubsuitwhite\",\n\"cmcubedsquare\",\"cmonospace\",\"cmsquaredsquare\",\"coarmenian\",\"colon\",\n\"colonmonetary\",\"colonmonospace\",\"colonsign\",\"colonsmall\",\n\"colontriangularhalfmod\",\"colontriangularmod\",\"comma\",\"commaabovecmb\",\n\"commaaboverightcmb\",\"commaaccent\",\"commaarabic\",\"commaarmenian\",\n\"commainferior\",\"commamonospace\",\"commareversedabovecmb\",\"commareversedmod\",\n\"commasmall\",\"commasuperior\",\"commaturnedabovecmb\",\"commaturnedmod\",\"compass\",\n\"congruent\",\"contourintegral\",\"control\",\"controlACK\",\"controlBEL\",\"controlBS\",\n\"controlCAN\",\"controlCR\",\"controlDC1\",\"controlDC2\",\"controlDC3\",\"controlDC4\",\n\"controlDEL\",\"controlDLE\",\"controlEM\",\"controlENQ\",\"controlEOT\",\"controlESC\",\n\"controlETB\",\"controlETX\",\"controlFF\",\"controlFS\",\"controlGS\",\"controlHT\",\n\"controlLF\",\"controlNAK\",\"controlRS\",\"controlSI\",\"controlSO\",\"controlSOT\",\n\"controlSTX\",\"controlSUB\",\"controlSYN\",\"controlUS\",\"controlVT\",\"copyright\",\n\"copyrightsans\",\"copyrightserif\",\"cornerbracketleft\",\n\"cornerbracketlefthalfwidth\",\"cornerbracketleftvertical\",\"cornerbracketright\",\n\"cornerbracketrighthalfwidth\",\"cornerbracketrightvertical\",\n\"corporationsquare\",\"cosquare\",\"coverkgsquare\",\"cparen\",\"cruzeiro\",\n\"cstretched\",\"curlyand\",\"curlyor\",\"currency\",\"cyrBreve\",\"cyrFlex\",\"cyrbreve\",\n\"cyrflex\",\"d\",\"daarmenian\",\"dabengali\",\"dadarabic\",\"dadeva\",\"dadfinalarabic\",\n\"dadinitialarabic\",\"dadmedialarabic\",\"dagesh\",\"dageshhebrew\",\"dagger\",\n\"daggerdbl\",\"dagujarati\",\"dagurmukhi\",\"dahiragana\",\"dakatakana\",\"dalarabic\",\n\"dalet\",\"daletdagesh\",\"daletdageshhebrew\",\"dalethatafpatah\",\n\"dalethatafpatahhebrew\",\"dalethatafsegol\",\"dalethatafsegolhebrew\",\n\"dalethebrew\",\"dalethiriq\",\"dalethiriqhebrew\",\"daletholam\",\"daletholamhebrew\",\n\"daletpatah\",\"daletpatahhebrew\",\"daletqamats\",\"daletqamatshebrew\",\n\"daletqubuts\",\"daletqubutshebrew\",\"daletsegol\",\"daletsegolhebrew\",\n\"daletsheva\",\"daletshevahebrew\",\"dalettsere\",\"dalettserehebrew\",\n\"dalfinalarabic\",\"dammaarabic\",\"dammalowarabic\",\"dammatanaltonearabic\",\n\"dammatanarabic\",\"danda\",\"dargahebrew\",\"dargalefthebrew\",\n\"dasiapneumatacyrilliccmb\",\"dblGrave\",\"dblanglebracketleft\",\n\"dblanglebracketleftvertical\",\"dblanglebracketright\",\n\"dblanglebracketrightvertical\",\"dblarchinvertedbelowcmb\",\"dblarrowleft\",\n\"dblarrowright\",\"dbldanda\",\"dblgrave\",\"dblgravecmb\",\"dblintegral\",\n\"dbllowline\",\"dbllowlinecmb\",\"dbloverlinecmb\",\"dblprimemod\",\"dblverticalbar\",\n\"dblverticallineabovecmb\",\"dbopomofo\",\"dbsquare\",\"dcaron\",\"dcedilla\",\n\"dcircle\",\"dcircumflexbelow\",\"dcroat\",\"ddabengali\",\"ddadeva\",\"ddagujarati\",\n\"ddagurmukhi\",\"ddalarabic\",\"ddalfinalarabic\",\"dddhadeva\",\"ddhabengali\",\n\"ddhadeva\",\"ddhagujarati\",\"ddhagurmukhi\",\"ddotaccent\",\"ddotbelow\",\n\"decimalseparatorarabic\",\"decimalseparatorpersian\",\"decyrillic\",\"degree\",\n\"dehihebrew\",\"dehiragana\",\"deicoptic\",\"dekatakana\",\"deleteleft\",\"deleteright\",\n\"delta\",\"deltaturned\",\"denominatorminusonenumeratorbengali\",\"dezh\",\n\"dhabengali\",\"dhadeva\",\"dhagujarati\",\"dhagurmukhi\",\"dhook\",\"dialytikatonos\",\n\"dialytikatonoscmb\",\"diamond\",\"diamondsuitwhite\",\"dieresis\",\"dieresisacute\",\n\"dieresisbelowcmb\",\"dieresiscmb\",\"dieresisgrave\",\"dieresistonos\",\"dihiragana\",\n\"dikatakana\",\"dittomark\",\"divide\",\"divides\",\"divisionslash\",\"djecyrillic\",\n\"dkshade\",\"dlinebelow\",\"dlsquare\",\"dmacron\",\"dmonospace\",\"dnblock\",\n\"dochadathai\",\"dodekthai\",\"dohiragana\",\"dokatakana\",\"dollar\",\"dollarinferior\",\n\"dollarmonospace\",\"dollaroldstyle\",\"dollarsmall\",\"dollarsuperior\",\"dong\",\n\"dorusquare\",\"dotaccent\",\"dotaccentcmb\",\"dotbelowcmb\",\"dotbelowcomb\",\n\"dotkatakana\",\"dotlessi\",\"dotlessj\",\"dotlessjstrokehook\",\"dotmath\",\n\"dottedcircle\",\"doubleyodpatah\",\"doubleyodpatahhebrew\",\"downtackbelowcmb\",\n\"downtackmod\",\"dparen\",\"dsuperior\",\"dtail\",\"dtopbar\",\"duhiragana\",\n\"dukatakana\",\"dz\",\"dzaltone\",\"dzcaron\",\"dzcurl\",\"dzeabkhasiancyrillic\",\n\"dzecyrillic\",\"dzhecyrillic\",\"e\",\"eacute\",\"earth\",\"ebengali\",\"ebopomofo\",\n\"ebreve\",\"ecandradeva\",\"ecandragujarati\",\"ecandravowelsigndeva\",\n\"ecandravowelsigngujarati\",\"ecaron\",\"ecedillabreve\",\"echarmenian\",\n\"echyiwnarmenian\",\"ecircle\",\"ecircumflex\",\"ecircumflexacute\",\n\"ecircumflexbelow\",\"ecircumflexdotbelow\",\"ecircumflexgrave\",\n\"ecircumflexhookabove\",\"ecircumflextilde\",\"ecyrillic\",\"edblgrave\",\"edeva\",\n\"edieresis\",\"edot\",\"edotaccent\",\"edotbelow\",\"eegurmukhi\",\"eematragurmukhi\",\n\"efcyrillic\",\"egrave\",\"egujarati\",\"eharmenian\",\"ehbopomofo\",\"ehiragana\",\n\"ehookabove\",\"eibopomofo\",\"eight\",\"eightarabic\",\"eightbengali\",\"eightcircle\",\n\"eightcircleinversesansserif\",\"eightdeva\",\"eighteencircle\",\"eighteenparen\",\n\"eighteenperiod\",\"eightgujarati\",\"eightgurmukhi\",\"eighthackarabic\",\n\"eighthangzhou\",\"eighthnotebeamed\",\"eightideographicparen\",\"eightinferior\",\n\"eightmonospace\",\"eightoldstyle\",\"eightparen\",\"eightperiod\",\"eightpersian\",\n\"eightroman\",\"eightsuperior\",\"eightthai\",\"einvertedbreve\",\"eiotifiedcyrillic\",\n\"ekatakana\",\"ekatakanahalfwidth\",\"ekonkargurmukhi\",\"ekorean\",\"elcyrillic\",\n\"element\",\"elevencircle\",\"elevenparen\",\"elevenperiod\",\"elevenroman\",\n\"ellipsis\",\"ellipsisvertical\",\"emacron\",\"emacronacute\",\"emacrongrave\",\n\"emcyrillic\",\"emdash\",\"emdashvertical\",\"emonospace\",\"emphasismarkarmenian\",\n\"emptyset\",\"enbopomofo\",\"encyrillic\",\"endash\",\"endashvertical\",\n\"endescendercyrillic\",\"eng\",\"engbopomofo\",\"enghecyrillic\",\"enhookcyrillic\",\n\"enspace\",\"eogonek\",\"eokorean\",\"eopen\",\"eopenclosed\",\"eopenreversed\",\n\"eopenreversedclosed\",\"eopenreversedhook\",\"eparen\",\"epsilon\",\"epsilontonos\",\n\"equal\",\"equalmonospace\",\"equalsmall\",\"equalsuperior\",\"equivalence\",\n\"erbopomofo\",\"ercyrillic\",\"ereversed\",\"ereversedcyrillic\",\"escyrillic\",\n\"esdescendercyrillic\",\"esh\",\"eshcurl\",\"eshortdeva\",\"eshortvowelsigndeva\",\n\"eshreversedloop\",\"eshsquatreversed\",\"esmallhiragana\",\"esmallkatakana\",\n\"esmallkatakanahalfwidth\",\"estimated\",\"esuperior\",\"eta\",\"etarmenian\",\n\"etatonos\",\"eth\",\"etilde\",\"etildebelow\",\"etnahtafoukhhebrew\",\n\"etnahtafoukhlefthebrew\",\"etnahtahebrew\",\"etnahtalefthebrew\",\"eturned\",\n\"eukorean\",\"euro\",\"evowelsignbengali\",\"evowelsigndeva\",\"evowelsigngujarati\",\n\"exclam\",\"exclamarmenian\",\"exclamdbl\",\"exclamdown\",\"exclamdownsmall\",\n\"exclammonospace\",\"exclamsmall\",\"existential\",\"ezh\",\"ezhcaron\",\"ezhcurl\",\n\"ezhreversed\",\"ezhtail\",\"f\",\"fadeva\",\"fagurmukhi\",\"fahrenheit\",\"fathaarabic\",\n\"fathalowarabic\",\"fathatanarabic\",\"fbopomofo\",\"fcircle\",\"fdotaccent\",\n\"feharabic\",\"feharmenian\",\"fehfinalarabic\",\"fehinitialarabic\",\n\"fehmedialarabic\",\"feicoptic\",\"female\",\"ff\",\"ffi\",\"ffl\",\"fi\",\"fifteencircle\",\n\"fifteenparen\",\"fifteenperiod\",\"figuredash\",\"filledbox\",\"filledrect\",\n\"finalkaf\",\"finalkafdagesh\",\"finalkafdageshhebrew\",\"finalkafhebrew\",\n\"finalkafqamats\",\"finalkafqamatshebrew\",\"finalkafsheva\",\"finalkafshevahebrew\",\n\"finalmem\",\"finalmemhebrew\",\"finalnun\",\"finalnunhebrew\",\"finalpe\",\n\"finalpehebrew\",\"finaltsadi\",\"finaltsadihebrew\",\"firsttonechinese\",\"fisheye\",\n\"fitacyrillic\",\"five\",\"fivearabic\",\"fivebengali\",\"fivecircle\",\n\"fivecircleinversesansserif\",\"fivedeva\",\"fiveeighths\",\"fivegujarati\",\n\"fivegurmukhi\",\"fivehackarabic\",\"fivehangzhou\",\"fiveideographicparen\",\n\"fiveinferior\",\"fivemonospace\",\"fiveoldstyle\",\"fiveparen\",\"fiveperiod\",\n\"fivepersian\",\"fiveroman\",\"fivesuperior\",\"fivethai\",\"fl\",\"florin\",\n\"fmonospace\",\"fmsquare\",\"fofanthai\",\"fofathai\",\"fongmanthai\",\"forall\",\"four\",\n\"fourarabic\",\"fourbengali\",\"fourcircle\",\"fourcircleinversesansserif\",\n\"fourdeva\",\"fourgujarati\",\"fourgurmukhi\",\"fourhackarabic\",\"fourhangzhou\",\n\"fourideographicparen\",\"fourinferior\",\"fourmonospace\",\"fournumeratorbengali\",\n\"fouroldstyle\",\"fourparen\",\"fourperiod\",\"fourpersian\",\"fourroman\",\n\"foursuperior\",\"fourteencircle\",\"fourteenparen\",\"fourteenperiod\",\"fourthai\",\n\"fourthtonechinese\",\"fparen\",\"fraction\",\"franc\",\"g\",\"gabengali\",\"gacute\",\n\"gadeva\",\"gafarabic\",\"gaffinalarabic\",\"gafinitialarabic\",\"gafmedialarabic\",\n\"gagujarati\",\"gagurmukhi\",\"gahiragana\",\"gakatakana\",\"gamma\",\"gammalatinsmall\",\n\"gammasuperior\",\"gangiacoptic\",\"gbopomofo\",\"gbreve\",\"gcaron\",\"gcedilla\",\n\"gcircle\",\"gcircumflex\",\"gcommaaccent\",\"gdot\",\"gdotaccent\",\"gecyrillic\",\n\"gehiragana\",\"gekatakana\",\"geometricallyequal\",\"gereshaccenthebrew\",\n\"gereshhebrew\",\"gereshmuqdamhebrew\",\"germandbls\",\"gershayimaccenthebrew\",\n\"gershayimhebrew\",\"getamark\",\"ghabengali\",\"ghadarmenian\",\"ghadeva\",\n\"ghagujarati\",\"ghagurmukhi\",\"ghainarabic\",\"ghainfinalarabic\",\n\"ghaininitialarabic\",\"ghainmedialarabic\",\"ghemiddlehookcyrillic\",\n\"ghestrokecyrillic\",\"gheupturncyrillic\",\"ghhadeva\",\"ghhagurmukhi\",\"ghook\",\n\"ghzsquare\",\"gihiragana\",\"gikatakana\",\"gimarmenian\",\"gimel\",\"gimeldagesh\",\n\"gimeldageshhebrew\",\"gimelhebrew\",\"gjecyrillic\",\"glottalinvertedstroke\",\n\"glottalstop\",\"glottalstopinverted\",\"glottalstopmod\",\"glottalstopreversed\",\n\"glottalstopreversedmod\",\"glottalstopreversedsuperior\",\"glottalstopstroke\",\n\"glottalstopstrokereversed\",\"gmacron\",\"gmonospace\",\"gohiragana\",\"gokatakana\",\n\"gparen\",\"gpasquare\",\"gradient\",\"grave\",\"gravebelowcmb\",\"gravecmb\",\n\"gravecomb\",\"gravedeva\",\"gravelowmod\",\"gravemonospace\",\"gravetonecmb\",\n\"greater\",\"greaterequal\",\"greaterequalorless\",\"greatermonospace\",\n\"greaterorequivalent\",\"greaterorless\",\"greateroverequal\",\"greatersmall\",\n\"gscript\",\"gstroke\",\"guhiragana\",\"guillemotleft\",\"guillemotright\",\n\"guilsinglleft\",\"guilsinglright\",\"gukatakana\",\"guramusquare\",\"gysquare\",\"h\",\n\"haabkhasiancyrillic\",\"haaltonearabic\",\"habengali\",\"hadescendercyrillic\",\n\"hadeva\",\"hagujarati\",\"hagurmukhi\",\"haharabic\",\"hahfinalarabic\",\n\"hahinitialarabic\",\"hahiragana\",\"hahmedialarabic\",\"haitusquare\",\"hakatakana\",\n\"hakatakanahalfwidth\",\"halantgurmukhi\",\"hamzaarabic\",\"hamzadammaarabic\",\n\"hamzadammatanarabic\",\"hamzafathaarabic\",\"hamzafathatanarabic\",\n\"hamzalowarabic\",\"hamzalowkasraarabic\",\"hamzalowkasratanarabic\",\n\"hamzasukunarabic\",\"hangulfiller\",\"hardsigncyrillic\",\"harpoonleftbarbup\",\n\"harpoonrightbarbup\",\"hasquare\",\"hatafpatah\",\"hatafpatah16\",\"hatafpatah23\",\n\"hatafpatah2f\",\"hatafpatahhebrew\",\"hatafpatahnarrowhebrew\",\n\"hatafpatahquarterhebrew\",\"hatafpatahwidehebrew\",\"hatafqamats\",\n\"hatafqamats1b\",\"hatafqamats28\",\"hatafqamats34\",\"hatafqamatshebrew\",\n\"hatafqamatsnarrowhebrew\",\"hatafqamatsquarterhebrew\",\"hatafqamatswidehebrew\",\n\"hatafsegol\",\"hatafsegol17\",\"hatafsegol24\",\"hatafsegol30\",\"hatafsegolhebrew\",\n\"hatafsegolnarrowhebrew\",\"hatafsegolquarterhebrew\",\"hatafsegolwidehebrew\",\n\"hbar\",\"hbopomofo\",\"hbrevebelow\",\"hcedilla\",\"hcircle\",\"hcircumflex\",\n\"hdieresis\",\"hdotaccent\",\"hdotbelow\",\"he\",\"heart\",\"heartsuitblack\",\n\"heartsuitwhite\",\"hedagesh\",\"hedageshhebrew\",\"hehaltonearabic\",\"heharabic\",\n\"hehebrew\",\"hehfinalaltonearabic\",\"hehfinalalttwoarabic\",\"hehfinalarabic\",\n\"hehhamzaabovefinalarabic\",\"hehhamzaaboveisolatedarabic\",\n\"hehinitialaltonearabic\",\"hehinitialarabic\",\"hehiragana\",\n\"hehmedialaltonearabic\",\"hehmedialarabic\",\"heiseierasquare\",\"hekatakana\",\n\"hekatakanahalfwidth\",\"hekutaarusquare\",\"henghook\",\"herutusquare\",\"het\",\n\"hethebrew\",\"hhook\",\"hhooksuperior\",\"hieuhacirclekorean\",\"hieuhaparenkorean\",\n\"hieuhcirclekorean\",\"hieuhkorean\",\"hieuhparenkorean\",\"hihiragana\",\n\"hikatakana\",\"hikatakanahalfwidth\",\"hiriq\",\"hiriq14\",\"hiriq21\",\"hiriq2d\",\n\"hiriqhebrew\",\"hiriqnarrowhebrew\",\"hiriqquarterhebrew\",\"hiriqwidehebrew\",\n\"hlinebelow\",\"hmonospace\",\"hoarmenian\",\"hohipthai\",\"hohiragana\",\"hokatakana\",\n\"hokatakanahalfwidth\",\"holam\",\"holam19\",\"holam26\",\"holam32\",\"holamhebrew\",\n\"holamnarrowhebrew\",\"holamquarterhebrew\",\"holamwidehebrew\",\"honokhukthai\",\n\"hookabovecomb\",\"hookcmb\",\"hookpalatalizedbelowcmb\",\"hookretroflexbelowcmb\",\n\"hoonsquare\",\"horicoptic\",\"horizontalbar\",\"horncmb\",\"hotsprings\",\"house\",\n\"hparen\",\"hsuperior\",\"hturned\",\"huhiragana\",\"huiitosquare\",\"hukatakana\",\n\"hukatakanahalfwidth\",\"hungarumlaut\",\"hungarumlautcmb\",\"hv\",\"hyphen\",\n\"hypheninferior\",\"hyphenmonospace\",\"hyphensmall\",\"hyphensuperior\",\"hyphentwo\",\n\"i\",\"iacute\",\"iacyrillic\",\"ibengali\",\"ibopomofo\",\"ibreve\",\"icaron\",\"icircle\",\n\"icircumflex\",\"icyrillic\",\"idblgrave\",\"ideographearthcircle\",\n\"ideographfirecircle\",\"ideographicallianceparen\",\"ideographiccallparen\",\n\"ideographiccentrecircle\",\"ideographicclose\",\"ideographiccomma\",\n\"ideographiccommaleft\",\"ideographiccongratulationparen\",\n\"ideographiccorrectcircle\",\"ideographicearthparen\",\n\"ideographicenterpriseparen\",\"ideographicexcellentcircle\",\n\"ideographicfestivalparen\",\"ideographicfinancialcircle\",\n\"ideographicfinancialparen\",\"ideographicfireparen\",\"ideographichaveparen\",\n\"ideographichighcircle\",\"ideographiciterationmark\",\"ideographiclaborcircle\",\n\"ideographiclaborparen\",\"ideographicleftcircle\",\"ideographiclowcircle\",\n\"ideographicmedicinecircle\",\"ideographicmetalparen\",\"ideographicmoonparen\",\n\"ideographicnameparen\",\"ideographicperiod\",\"ideographicprintcircle\",\n\"ideographicreachparen\",\"ideographicrepresentparen\",\n\"ideographicresourceparen\",\"ideographicrightcircle\",\"ideographicsecretcircle\",\n\"ideographicselfparen\",\"ideographicsocietyparen\",\"ideographicspace\",\n\"ideographicspecialparen\",\"ideographicstockparen\",\"ideographicstudyparen\",\n\"ideographicsunparen\",\"ideographicsuperviseparen\",\"ideographicwaterparen\",\n\"ideographicwoodparen\",\"ideographiczero\",\"ideographmetalcircle\",\n\"ideographmooncircle\",\"ideographnamecircle\",\"ideographsuncircle\",\n\"ideographwatercircle\",\"ideographwoodcircle\",\"ideva\",\"idieresis\",\n\"idieresisacute\",\"idieresiscyrillic\",\"idotbelow\",\"iebrevecyrillic\",\n\"iecyrillic\",\"ieungacirclekorean\",\"ieungaparenkorean\",\"ieungcirclekorean\",\n\"ieungkorean\",\"ieungparenkorean\",\"igrave\",\"igujarati\",\"igurmukhi\",\"ihiragana\",\n\"ihookabove\",\"iibengali\",\"iicyrillic\",\"iideva\",\"iigujarati\",\"iigurmukhi\",\n\"iimatragurmukhi\",\"iinvertedbreve\",\"iishortcyrillic\",\"iivowelsignbengali\",\n\"iivowelsigndeva\",\"iivowelsigngujarati\",\"ij\",\"ikatakana\",\"ikatakanahalfwidth\",\n\"ikorean\",\"ilde\",\"iluyhebrew\",\"imacron\",\"imacroncyrillic\",\n\"imageorapproximatelyequal\",\"imatragurmukhi\",\"imonospace\",\"increment\",\n\"infinity\",\"iniarmenian\",\"integral\",\"integralbottom\",\"integralbt\",\n\"integralex\",\"integraltop\",\"integraltp\",\"intersection\",\"intisquare\",\n\"invbullet\",\"invcircle\",\"invsmileface\",\"iocyrillic\",\"iogonek\",\"iota\",\n\"iotadieresis\",\"iotadieresistonos\",\"iotalatin\",\"iotatonos\",\"iparen\",\n\"irigurmukhi\",\"ismallhiragana\",\"ismallkatakana\",\"ismallkatakanahalfwidth\",\n\"issharbengali\",\"istroke\",\"isuperior\",\"iterationhiragana\",\"iterationkatakana\",\n\"itilde\",\"itildebelow\",\"iubopomofo\",\"iucyrillic\",\"ivowelsignbengali\",\n\"ivowelsigndeva\",\"ivowelsigngujarati\",\"izhitsacyrillic\",\n\"izhitsadblgravecyrillic\",\"j\",\"jaarmenian\",\"jabengali\",\"jadeva\",\"jagujarati\",\n\"jagurmukhi\",\"jbopomofo\",\"jcaron\",\"jcircle\",\"jcircumflex\",\"jcrossedtail\",\n\"jdotlessstroke\",\"jecyrillic\",\"jeemarabic\",\"jeemfinalarabic\",\n\"jeeminitialarabic\",\"jeemmedialarabic\",\"jeharabic\",\"jehfinalarabic\",\n\"jhabengali\",\"jhadeva\",\"jhagujarati\",\"jhagurmukhi\",\"jheharmenian\",\"jis\",\n\"jmonospace\",\"jparen\",\"jsuperior\",\"k\",\"kabashkircyrillic\",\"kabengali\",\n\"kacute\",\"kacyrillic\",\"kadescendercyrillic\",\"kadeva\",\"kaf\",\"kafarabic\",\n\"kafdagesh\",\"kafdageshhebrew\",\"kaffinalarabic\",\"kafhebrew\",\"kafinitialarabic\",\n\"kafmedialarabic\",\"kafrafehebrew\",\"kagujarati\",\"kagurmukhi\",\"kahiragana\",\n\"kahookcyrillic\",\"kakatakana\",\"kakatakanahalfwidth\",\"kappa\",\n\"kappasymbolgreek\",\"kapyeounmieumkorean\",\"kapyeounphieuphkorean\",\n\"kapyeounpieupkorean\",\"kapyeounssangpieupkorean\",\"karoriisquare\",\n\"kashidaautoarabic\",\"kashidaautonosidebearingarabic\",\"kasmallkatakana\",\n\"kasquare\",\"kasraarabic\",\"kasratanarabic\",\"kastrokecyrillic\",\n\"katahiraprolongmarkhalfwidth\",\"kaverticalstrokecyrillic\",\"kbopomofo\",\n\"kcalsquare\",\"kcaron\",\"kcedilla\",\"kcircle\",\"kcommaaccent\",\"kdotbelow\",\n\"keharmenian\",\"kehiragana\",\"kekatakana\",\"kekatakanahalfwidth\",\"kenarmenian\",\n\"kesmallkatakana\",\"kgreenlandic\",\"khabengali\",\"khacyrillic\",\"khadeva\",\n\"khagujarati\",\"khagurmukhi\",\"khaharabic\",\"khahfinalarabic\",\n\"khahinitialarabic\",\"khahmedialarabic\",\"kheicoptic\",\"khhadeva\",\"khhagurmukhi\",\n\"khieukhacirclekorean\",\"khieukhaparenkorean\",\"khieukhcirclekorean\",\n\"khieukhkorean\",\"khieukhparenkorean\",\"khokhaithai\",\"khokhonthai\",\n\"khokhuatthai\",\"khokhwaithai\",\"khomutthai\",\"khook\",\"khorakhangthai\",\n\"khzsquare\",\"kihiragana\",\"kikatakana\",\"kikatakanahalfwidth\",\n\"kiroguramusquare\",\"kiromeetorusquare\",\"kirosquare\",\"kiyeokacirclekorean\",\n\"kiyeokaparenkorean\",\"kiyeokcirclekorean\",\"kiyeokkorean\",\"kiyeokparenkorean\",\n\"kiyeoksioskorean\",\"kjecyrillic\",\"klinebelow\",\"klsquare\",\"kmcubedsquare\",\n\"kmonospace\",\"kmsquaredsquare\",\"kohiragana\",\"kohmsquare\",\"kokaithai\",\n\"kokatakana\",\"kokatakanahalfwidth\",\"kooposquare\",\"koppacyrillic\",\n\"koreanstandardsymbol\",\"koroniscmb\",\"kparen\",\"kpasquare\",\"ksicyrillic\",\n\"ktsquare\",\"kturned\",\"kuhiragana\",\"kukatakana\",\"kukatakanahalfwidth\",\n\"kvsquare\",\"kwsquare\",\"l\",\"labengali\",\"lacute\",\"ladeva\",\"lagujarati\",\n\"lagurmukhi\",\"lakkhangyaothai\",\"lamaleffinalarabic\",\n\"lamalefhamzaabovefinalarabic\",\"lamalefhamzaaboveisolatedarabic\",\n\"lamalefhamzabelowfinalarabic\",\"lamalefhamzabelowisolatedarabic\",\n\"lamalefisolatedarabic\",\"lamalefmaddaabovefinalarabic\",\n\"lamalefmaddaaboveisolatedarabic\",\"lamarabic\",\"lambda\",\"lambdastroke\",\"lamed\",\n\"lameddagesh\",\"lameddageshhebrew\",\"lamedhebrew\",\"lamedholam\",\n\"lamedholamdagesh\",\"lamedholamdageshhebrew\",\"lamedholamhebrew\",\n\"lamfinalarabic\",\"lamhahinitialarabic\",\"laminitialarabic\",\n\"lamjeeminitialarabic\",\"lamkhahinitialarabic\",\"lamlamhehisolatedarabic\",\n\"lammedialarabic\",\"lammeemhahinitialarabic\",\"lammeeminitialarabic\",\n\"lammeemjeeminitialarabic\",\"lammeemkhahinitialarabic\",\"largecircle\",\"lbar\",\n\"lbelt\",\"lbopomofo\",\"lcaron\",\"lcedilla\",\"lcircle\",\"lcircumflexbelow\",\n\"lcommaaccent\",\"ldot\",\"ldotaccent\",\"ldotbelow\",\"ldotbelowmacron\",\n\"leftangleabovecmb\",\"lefttackbelowcmb\",\"less\",\"lessequal\",\n\"lessequalorgreater\",\"lessmonospace\",\"lessorequivalent\",\"lessorgreater\",\n\"lessoverequal\",\"lesssmall\",\"lezh\",\"lfblock\",\"lhookretroflex\",\"lira\",\n\"liwnarmenian\",\"lj\",\"ljecyrillic\",\"ll\",\"lladeva\",\"llagujarati\",\"llinebelow\",\n\"llladeva\",\"llvocalicbengali\",\"llvocalicdeva\",\"llvocalicvowelsignbengali\",\n\"llvocalicvowelsigndeva\",\"lmiddletilde\",\"lmonospace\",\"lmsquare\",\"lochulathai\",\n\"logicaland\",\"logicalnot\",\"logicalnotreversed\",\"logicalor\",\"lolingthai\",\n\"longs\",\"lowlinecenterline\",\"lowlinecmb\",\"lowlinedashed\",\"lozenge\",\"lparen\",\n\"lslash\",\"lsquare\",\"lsuperior\",\"ltshade\",\"luthai\",\"lvocalicbengali\",\n\"lvocalicdeva\",\"lvocalicvowelsignbengali\",\"lvocalicvowelsigndeva\",\"lxsquare\",\n\"m\",\"mabengali\",\"macron\",\"macronbelowcmb\",\"macroncmb\",\"macronlowmod\",\n\"macronmonospace\",\"macute\",\"madeva\",\"magujarati\",\"magurmukhi\",\n\"mahapakhhebrew\",\"mahapakhlefthebrew\",\"mahiragana\",\"maichattawalowleftthai\",\n\"maichattawalowrightthai\",\"maichattawathai\",\"maichattawaupperleftthai\",\n\"maieklowleftthai\",\"maieklowrightthai\",\"maiekthai\",\"maiekupperleftthai\",\n\"maihanakatleftthai\",\"maihanakatthai\",\"maitaikhuleftthai\",\"maitaikhuthai\",\n\"maitholowleftthai\",\"maitholowrightthai\",\"maithothai\",\"maithoupperleftthai\",\n\"maitrilowleftthai\",\"maitrilowrightthai\",\"maitrithai\",\"maitriupperleftthai\",\n\"maiyamokthai\",\"makatakana\",\"makatakanahalfwidth\",\"male\",\"mansyonsquare\",\n\"maqafhebrew\",\"mars\",\"masoracirclehebrew\",\"masquare\",\"mbopomofo\",\"mbsquare\",\n\"mcircle\",\"mcubedsquare\",\"mdotaccent\",\"mdotbelow\",\"meemarabic\",\n\"meemfinalarabic\",\"meeminitialarabic\",\"meemmedialarabic\",\n\"meemmeeminitialarabic\",\"meemmeemisolatedarabic\",\"meetorusquare\",\"mehiragana\",\n\"meizierasquare\",\"mekatakana\",\"mekatakanahalfwidth\",\"mem\",\"memdagesh\",\n\"memdageshhebrew\",\"memhebrew\",\"menarmenian\",\"merkhahebrew\",\n\"merkhakefulahebrew\",\"merkhakefulalefthebrew\",\"merkhalefthebrew\",\"mhook\",\n\"mhzsquare\",\"middledotkatakanahalfwidth\",\"middot\",\"mieumacirclekorean\",\n\"mieumaparenkorean\",\"mieumcirclekorean\",\"mieumkorean\",\"mieumpansioskorean\",\n\"mieumparenkorean\",\"mieumpieupkorean\",\"mieumsioskorean\",\"mihiragana\",\n\"mikatakana\",\"mikatakanahalfwidth\",\"minus\",\"minusbelowcmb\",\"minuscircle\",\n\"minusmod\",\"minusplus\",\"minute\",\"miribaarusquare\",\"mirisquare\",\n\"mlonglegturned\",\"mlsquare\",\"mmcubedsquare\",\"mmonospace\",\"mmsquaredsquare\",\n\"mohiragana\",\"mohmsquare\",\"mokatakana\",\"mokatakanahalfwidth\",\"molsquare\",\n\"momathai\",\"moverssquare\",\"moverssquaredsquare\",\"mparen\",\"mpasquare\",\n\"mssquare\",\"msuperior\",\"mturned\",\"mu\",\"mu1\",\"muasquare\",\"muchgreater\",\n\"muchless\",\"mufsquare\",\"mugreek\",\"mugsquare\",\"muhiragana\",\"mukatakana\",\n\"mukatakanahalfwidth\",\"mulsquare\",\"multiply\",\"mumsquare\",\"munahhebrew\",\n\"munahlefthebrew\",\"musicalnote\",\"musicalnotedbl\",\"musicflatsign\",\n\"musicsharpsign\",\"mussquare\",\"muvsquare\",\"muwsquare\",\"mvmegasquare\",\n\"mvsquare\",\"mwmegasquare\",\"mwsquare\",\"n\",\"nabengali\",\"nabla\",\"nacute\",\n\"nadeva\",\"nagujarati\",\"nagurmukhi\",\"nahiragana\",\"nakatakana\",\n\"nakatakanahalfwidth\",\"napostrophe\",\"nasquare\",\"nbopomofo\",\"nbspace\",\"ncaron\",\n\"ncedilla\",\"ncircle\",\"ncircumflexbelow\",\"ncommaaccent\",\"ndotaccent\",\n\"ndotbelow\",\"nehiragana\",\"nekatakana\",\"nekatakanahalfwidth\",\"newsheqelsign\",\n\"nfsquare\",\"ngabengali\",\"ngadeva\",\"ngagujarati\",\"ngagurmukhi\",\"ngonguthai\",\n\"nhiragana\",\"nhookleft\",\"nhookretroflex\",\"nieunacirclekorean\",\n\"nieunaparenkorean\",\"nieuncieuckorean\",\"nieuncirclekorean\",\"nieunhieuhkorean\",\n\"nieunkorean\",\"nieunpansioskorean\",\"nieunparenkorean\",\"nieunsioskorean\",\n\"nieuntikeutkorean\",\"nihiragana\",\"nikatakana\",\"nikatakanahalfwidth\",\n\"nikhahitleftthai\",\"nikhahitthai\",\"nine\",\"ninearabic\",\"ninebengali\",\n\"ninecircle\",\"ninecircleinversesansserif\",\"ninedeva\",\"ninegujarati\",\n\"ninegurmukhi\",\"ninehackarabic\",\"ninehangzhou\",\"nineideographicparen\",\n\"nineinferior\",\"ninemonospace\",\"nineoldstyle\",\"nineparen\",\"nineperiod\",\n\"ninepersian\",\"nineroman\",\"ninesuperior\",\"nineteencircle\",\"nineteenparen\",\n\"nineteenperiod\",\"ninethai\",\"nj\",\"njecyrillic\",\"nkatakana\",\n\"nkatakanahalfwidth\",\"nlegrightlong\",\"nlinebelow\",\"nmonospace\",\"nmsquare\",\n\"nnabengali\",\"nnadeva\",\"nnagujarati\",\"nnagurmukhi\",\"nnnadeva\",\"nohiragana\",\n\"nokatakana\",\"nokatakanahalfwidth\",\"nonbreakingspace\",\"nonenthai\",\"nonuthai\",\n\"noonarabic\",\"noonfinalarabic\",\"noonghunnaarabic\",\"noonghunnafinalarabic\",\n\"noonhehinitialarabic\",\"nooninitialarabic\",\"noonjeeminitialarabic\",\n\"noonjeemisolatedarabic\",\"noonmedialarabic\",\"noonmeeminitialarabic\",\n\"noonmeemisolatedarabic\",\"noonnoonfinalarabic\",\"notcontains\",\"notelement\",\n\"notelementof\",\"notequal\",\"notgreater\",\"notgreaternorequal\",\n\"notgreaternorless\",\"notidentical\",\"notless\",\"notlessnorequal\",\"notparallel\",\n\"notprecedes\",\"notsubset\",\"notsucceeds\",\"notsuperset\",\"nowarmenian\",\"nparen\",\n\"nssquare\",\"nsuperior\",\"ntilde\",\"nu\",\"nuhiragana\",\"nukatakana\",\n\"nukatakanahalfwidth\",\"nuktabengali\",\"nuktadeva\",\"nuktagujarati\",\n\"nuktagurmukhi\",\"numbersign\",\"numbersignmonospace\",\"numbersignsmall\",\n\"numeralsigngreek\",\"numeralsignlowergreek\",\"numero\",\"nun\",\"nundagesh\",\n\"nundageshhebrew\",\"nunhebrew\",\"nvsquare\",\"nwsquare\",\"nyabengali\",\"nyadeva\",\n\"nyagujarati\",\"nyagurmukhi\",\"o\",\"oacute\",\"oangthai\",\"obarred\",\n\"obarredcyrillic\",\"obarreddieresiscyrillic\",\"obengali\",\"obopomofo\",\"obreve\",\n\"ocandradeva\",\"ocandragujarati\",\"ocandravowelsigndeva\",\n\"ocandravowelsigngujarati\",\"ocaron\",\"ocircle\",\"ocircumflex\",\n\"ocircumflexacute\",\"ocircumflexdotbelow\",\"ocircumflexgrave\",\n\"ocircumflexhookabove\",\"ocircumflextilde\",\"ocyrillic\",\"odblacute\",\"odblgrave\",\n\"odeva\",\"odieresis\",\"odieresiscyrillic\",\"odotbelow\",\"oe\",\"oekorean\",\"ogonek\",\n\"ogonekcmb\",\"ograve\",\"ogujarati\",\"oharmenian\",\"ohiragana\",\"ohookabove\",\n\"ohorn\",\"ohornacute\",\"ohorndotbelow\",\"ohorngrave\",\"ohornhookabove\",\n\"ohorntilde\",\"ohungarumlaut\",\"oi\",\"oinvertedbreve\",\"okatakana\",\n\"okatakanahalfwidth\",\"okorean\",\"olehebrew\",\"omacron\",\"omacronacute\",\n\"omacrongrave\",\"omdeva\",\"omega\",\"omega1\",\"omegacyrillic\",\"omegalatinclosed\",\n\"omegaroundcyrillic\",\"omegatitlocyrillic\",\"omegatonos\",\"omgujarati\",\"omicron\",\n\"omicrontonos\",\"omonospace\",\"one\",\"onearabic\",\"onebengali\",\"onecircle\",\n\"onecircleinversesansserif\",\"onedeva\",\"onedotenleader\",\"oneeighth\",\n\"onefitted\",\"onegujarati\",\"onegurmukhi\",\"onehackarabic\",\"onehalf\",\n\"onehangzhou\",\"oneideographicparen\",\"oneinferior\",\"onemonospace\",\n\"onenumeratorbengali\",\"oneoldstyle\",\"oneparen\",\"oneperiod\",\"onepersian\",\n\"onequarter\",\"oneroman\",\"onesuperior\",\"onethai\",\"onethird\",\"oogonek\",\n\"oogonekmacron\",\"oogurmukhi\",\"oomatragurmukhi\",\"oopen\",\"oparen\",\"openbullet\",\n\"option\",\"ordfeminine\",\"ordmasculine\",\"orthogonal\",\"oshortdeva\",\n\"oshortvowelsigndeva\",\"oslash\",\"oslashacute\",\"osmallhiragana\",\n\"osmallkatakana\",\"osmallkatakanahalfwidth\",\"ostrokeacute\",\"osuperior\",\n\"otcyrillic\",\"otilde\",\"otildeacute\",\"otildedieresis\",\"oubopomofo\",\"overline\",\n\"overlinecenterline\",\"overlinecmb\",\"overlinedashed\",\"overlinedblwavy\",\n\"overlinewavy\",\"overscore\",\"ovowelsignbengali\",\"ovowelsigndeva\",\n\"ovowelsigngujarati\",\"p\",\"paampssquare\",\"paasentosquare\",\"pabengali\",\"pacute\",\n\"padeva\",\"pagedown\",\"pageup\",\"pagujarati\",\"pagurmukhi\",\"pahiragana\",\n\"paiyannoithai\",\"pakatakana\",\"palatalizationcyrilliccmb\",\"palochkacyrillic\",\n\"pansioskorean\",\"paragraph\",\"parallel\",\"parenleft\",\"parenleftaltonearabic\",\n\"parenleftbt\",\"parenleftex\",\"parenleftinferior\",\"parenleftmonospace\",\n\"parenleftsmall\",\"parenleftsuperior\",\"parenlefttp\",\"parenleftvertical\",\n\"parenright\",\"parenrightaltonearabic\",\"parenrightbt\",\"parenrightex\",\n\"parenrightinferior\",\"parenrightmonospace\",\"parenrightsmall\",\n\"parenrightsuperior\",\"parenrighttp\",\"parenrightvertical\",\"partialdiff\",\n\"paseqhebrew\",\"pashtahebrew\",\"pasquare\",\"patah\",\"patah11\",\"patah1d\",\"patah2a\",\n\"patahhebrew\",\"patahnarrowhebrew\",\"patahquarterhebrew\",\"patahwidehebrew\",\n\"pazerhebrew\",\"pbopomofo\",\"pcircle\",\"pdotaccent\",\"pe\",\"pecyrillic\",\"pedagesh\",\n\"pedageshhebrew\",\"peezisquare\",\"pefinaldageshhebrew\",\"peharabic\",\n\"peharmenian\",\"pehebrew\",\"pehfinalarabic\",\"pehinitialarabic\",\"pehiragana\",\n\"pehmedialarabic\",\"pekatakana\",\"pemiddlehookcyrillic\",\"perafehebrew\",\n\"percent\",\"percentarabic\",\"percentmonospace\",\"percentsmall\",\"period\",\n\"periodarmenian\",\"periodcentered\",\"periodhalfwidth\",\"periodinferior\",\n\"periodmonospace\",\"periodsmall\",\"periodsuperior\",\"perispomenigreekcmb\",\n\"perpendicular\",\"perthousand\",\"peseta\",\"pfsquare\",\"phabengali\",\"phadeva\",\n\"phagujarati\",\"phagurmukhi\",\"phi\",\"phi1\",\"phieuphacirclekorean\",\n\"phieuphaparenkorean\",\"phieuphcirclekorean\",\"phieuphkorean\",\n\"phieuphparenkorean\",\"philatin\",\"phinthuthai\",\"phisymbolgreek\",\"phook\",\n\"phophanthai\",\"phophungthai\",\"phosamphaothai\",\"pi\",\"pieupacirclekorean\",\n\"pieupaparenkorean\",\"pieupcieuckorean\",\"pieupcirclekorean\",\n\"pieupkiyeokkorean\",\"pieupkorean\",\"pieupparenkorean\",\"pieupsioskiyeokkorean\",\n\"pieupsioskorean\",\"pieupsiostikeutkorean\",\"pieupthieuthkorean\",\n\"pieuptikeutkorean\",\"pihiragana\",\"pikatakana\",\"pisymbolgreek\",\"piwrarmenian\",\n\"plus\",\"plusbelowcmb\",\"pluscircle\",\"plusminus\",\"plusmod\",\"plusmonospace\",\n\"plussmall\",\"plussuperior\",\"pmonospace\",\"pmsquare\",\"pohiragana\",\n\"pointingindexdownwhite\",\"pointingindexleftwhite\",\"pointingindexrightwhite\",\n\"pointingindexupwhite\",\"pokatakana\",\"poplathai\",\"postalmark\",\"postalmarkface\",\n\"pparen\",\"precedes\",\"prescription\",\"primemod\",\"primereversed\",\"product\",\n\"projective\",\"prolongedkana\",\"propellor\",\"propersubset\",\"propersuperset\",\n\"proportion\",\"proportional\",\"psi\",\"psicyrillic\",\"psilipneumatacyrilliccmb\",\n\"pssquare\",\"puhiragana\",\"pukatakana\",\"pvsquare\",\"pwsquare\",\"q\",\"qadeva\",\n\"qadmahebrew\",\"qafarabic\",\"qaffinalarabic\",\"qafinitialarabic\",\n\"qafmedialarabic\",\"qamats\",\"qamats10\",\"qamats1a\",\"qamats1c\",\"qamats27\",\n\"qamats29\",\"qamats33\",\"qamatsde\",\"qamatshebrew\",\"qamatsnarrowhebrew\",\n\"qamatsqatanhebrew\",\"qamatsqatannarrowhebrew\",\"qamatsqatanquarterhebrew\",\n\"qamatsqatanwidehebrew\",\"qamatsquarterhebrew\",\"qamatswidehebrew\",\n\"qarneyparahebrew\",\"qbopomofo\",\"qcircle\",\"qhook\",\"qmonospace\",\"qof\",\n\"qofdagesh\",\"qofdageshhebrew\",\"qofhatafpatah\",\"qofhatafpatahhebrew\",\n\"qofhatafsegol\",\"qofhatafsegolhebrew\",\"qofhebrew\",\"qofhiriq\",\"qofhiriqhebrew\",\n\"qofholam\",\"qofholamhebrew\",\"qofpatah\",\"qofpatahhebrew\",\"qofqamats\",\n\"qofqamatshebrew\",\"qofqubuts\",\"qofqubutshebrew\",\"qofsegol\",\"qofsegolhebrew\",\n\"qofsheva\",\"qofshevahebrew\",\"qoftsere\",\"qoftserehebrew\",\"qparen\",\n\"quarternote\",\"qubuts\",\"qubuts18\",\"qubuts25\",\"qubuts31\",\"qubutshebrew\",\n\"qubutsnarrowhebrew\",\"qubutsquarterhebrew\",\"qubutswidehebrew\",\"question\",\n\"questionarabic\",\"questionarmenian\",\"questiondown\",\"questiondownsmall\",\n\"questiongreek\",\"questionmonospace\",\"questionsmall\",\"quotedbl\",\"quotedblbase\",\n\"quotedblleft\",\"quotedblmonospace\",\"quotedblprime\",\"quotedblprimereversed\",\n\"quotedblright\",\"quoteleft\",\"quoteleftreversed\",\"quotereversed\",\"quoteright\",\n\"quoterightn\",\"quotesinglbase\",\"quotesingle\",\"quotesinglemonospace\",\"r\",\n\"raarmenian\",\"rabengali\",\"racute\",\"radeva\",\"radical\",\"radicalex\",\n\"radoverssquare\",\"radoverssquaredsquare\",\"radsquare\",\"rafe\",\"rafehebrew\",\n\"ragujarati\",\"ragurmukhi\",\"rahiragana\",\"rakatakana\",\"rakatakanahalfwidth\",\n\"ralowerdiagonalbengali\",\"ramiddlediagonalbengali\",\"ramshorn\",\"ratio\",\n\"rbopomofo\",\"rcaron\",\"rcedilla\",\"rcircle\",\"rcommaaccent\",\"rdblgrave\",\n\"rdotaccent\",\"rdotbelow\",\"rdotbelowmacron\",\"referencemark\",\"reflexsubset\",\n\"reflexsuperset\",\"registered\",\"registersans\",\"registerserif\",\"reharabic\",\n\"reharmenian\",\"rehfinalarabic\",\"rehiragana\",\"rehyehaleflamarabic\",\n\"rekatakana\",\"rekatakanahalfwidth\",\"resh\",\"reshdageshhebrew\",\"reshhatafpatah\",\n\"reshhatafpatahhebrew\",\"reshhatafsegol\",\"reshhatafsegolhebrew\",\"reshhebrew\",\n\"reshhiriq\",\"reshhiriqhebrew\",\"reshholam\",\"reshholamhebrew\",\"reshpatah\",\n\"reshpatahhebrew\",\"reshqamats\",\"reshqamatshebrew\",\"reshqubuts\",\n\"reshqubutshebrew\",\"reshsegol\",\"reshsegolhebrew\",\"reshsheva\",\n\"reshshevahebrew\",\"reshtsere\",\"reshtserehebrew\",\"reversedtilde\",\"reviahebrew\",\n\"reviamugrashhebrew\",\"revlogicalnot\",\"rfishhook\",\"rfishhookreversed\",\n\"rhabengali\",\"rhadeva\",\"rho\",\"rhook\",\"rhookturned\",\"rhookturnedsuperior\",\n\"rhosymbolgreek\",\"rhotichookmod\",\"rieulacirclekorean\",\"rieulaparenkorean\",\n\"rieulcirclekorean\",\"rieulhieuhkorean\",\"rieulkiyeokkorean\",\n\"rieulkiyeoksioskorean\",\"rieulkorean\",\"rieulmieumkorean\",\"rieulpansioskorean\",\n\"rieulparenkorean\",\"rieulphieuphkorean\",\"rieulpieupkorean\",\n\"rieulpieupsioskorean\",\"rieulsioskorean\",\"rieulthieuthkorean\",\n\"rieultikeutkorean\",\"rieulyeorinhieuhkorean\",\"rightangle\",\"righttackbelowcmb\",\n\"righttriangle\",\"rihiragana\",\"rikatakana\",\"rikatakanahalfwidth\",\"ring\",\n\"ringbelowcmb\",\"ringcmb\",\"ringhalfleft\",\"ringhalfleftarmenian\",\n\"ringhalfleftbelowcmb\",\"ringhalfleftcentered\",\"ringhalfright\",\n\"ringhalfrightbelowcmb\",\"ringhalfrightcentered\",\"rinvertedbreve\",\n\"rittorusquare\",\"rlinebelow\",\"rlongleg\",\"rlonglegturned\",\"rmonospace\",\n\"rohiragana\",\"rokatakana\",\"rokatakanahalfwidth\",\"roruathai\",\"rparen\",\n\"rrabengali\",\"rradeva\",\"rragurmukhi\",\"rreharabic\",\"rrehfinalarabic\",\n\"rrvocalicbengali\",\"rrvocalicdeva\",\"rrvocalicgujarati\",\n\"rrvocalicvowelsignbengali\",\"rrvocalicvowelsigndeva\",\n\"rrvocalicvowelsigngujarati\",\"rsuperior\",\"rtblock\",\"rturned\",\n\"rturnedsuperior\",\"ruhiragana\",\"rukatakana\",\"rukatakanahalfwidth\",\n\"rupeemarkbengali\",\"rupeesignbengali\",\"rupiah\",\"ruthai\",\"rvocalicbengali\",\n\"rvocalicdeva\",\"rvocalicgujarati\",\"rvocalicvowelsignbengali\",\n\"rvocalicvowelsigndeva\",\"rvocalicvowelsigngujarati\",\"s\",\"sabengali\",\"sacute\",\n\"sacutedotaccent\",\"sadarabic\",\"sadeva\",\"sadfinalarabic\",\"sadinitialarabic\",\n\"sadmedialarabic\",\"sagujarati\",\"sagurmukhi\",\"sahiragana\",\"sakatakana\",\n\"sakatakanahalfwidth\",\"sallallahoualayhewasallamarabic\",\"samekh\",\n\"samekhdagesh\",\"samekhdageshhebrew\",\"samekhhebrew\",\"saraaathai\",\"saraaethai\",\n\"saraaimaimalaithai\",\"saraaimaimuanthai\",\"saraamthai\",\"saraathai\",\"saraethai\",\n\"saraiileftthai\",\"saraiithai\",\"saraileftthai\",\"saraithai\",\"saraothai\",\n\"saraueeleftthai\",\"saraueethai\",\"saraueleftthai\",\"sarauethai\",\"sarauthai\",\n\"sarauuthai\",\"sbopomofo\",\"scaron\",\"scarondotaccent\",\"scedilla\",\"schwa\",\n\"schwacyrillic\",\"schwadieresiscyrillic\",\"schwahook\",\"scircle\",\"scircumflex\",\n\"scommaaccent\",\"sdotaccent\",\"sdotbelow\",\"sdotbelowdotaccent\",\n\"seagullbelowcmb\",\"second\",\"secondtonechinese\",\"section\",\"seenarabic\",\n\"seenfinalarabic\",\"seeninitialarabic\",\"seenmedialarabic\",\"segol\",\"segol13\",\n\"segol1f\",\"segol2c\",\"segolhebrew\",\"segolnarrowhebrew\",\"segolquarterhebrew\",\n\"segoltahebrew\",\"segolwidehebrew\",\"seharmenian\",\"sehiragana\",\"sekatakana\",\n\"sekatakanahalfwidth\",\"semicolon\",\"semicolonarabic\",\"semicolonmonospace\",\n\"semicolonsmall\",\"semivoicedmarkkana\",\"semivoicedmarkkanahalfwidth\",\n\"sentisquare\",\"sentosquare\",\"seven\",\"sevenarabic\",\"sevenbengali\",\n\"sevencircle\",\"sevencircleinversesansserif\",\"sevendeva\",\"seveneighths\",\n\"sevengujarati\",\"sevengurmukhi\",\"sevenhackarabic\",\"sevenhangzhou\",\n\"sevenideographicparen\",\"seveninferior\",\"sevenmonospace\",\"sevenoldstyle\",\n\"sevenparen\",\"sevenperiod\",\"sevenpersian\",\"sevenroman\",\"sevensuperior\",\n\"seventeencircle\",\"seventeenparen\",\"seventeenperiod\",\"seventhai\",\"sfthyphen\",\n\"shaarmenian\",\"shabengali\",\"shacyrillic\",\"shaddaarabic\",\"shaddadammaarabic\",\n\"shaddadammatanarabic\",\"shaddafathaarabic\",\"shaddafathatanarabic\",\n\"shaddakasraarabic\",\"shaddakasratanarabic\",\"shade\",\"shadedark\",\"shadelight\",\n\"shademedium\",\"shadeva\",\"shagujarati\",\"shagurmukhi\",\"shalshelethebrew\",\n\"shbopomofo\",\"shchacyrillic\",\"sheenarabic\",\"sheenfinalarabic\",\n\"sheeninitialarabic\",\"sheenmedialarabic\",\"sheicoptic\",\"sheqel\",\"sheqelhebrew\",\n\"sheva\",\"sheva115\",\"sheva15\",\"sheva22\",\"sheva2e\",\"shevahebrew\",\n\"shevanarrowhebrew\",\"shevaquarterhebrew\",\"shevawidehebrew\",\"shhacyrillic\",\n\"shimacoptic\",\"shin\",\"shindagesh\",\"shindageshhebrew\",\"shindageshshindot\",\n\"shindageshshindothebrew\",\"shindageshsindot\",\"shindageshsindothebrew\",\n\"shindothebrew\",\"shinhebrew\",\"shinshindot\",\"shinshindothebrew\",\"shinsindot\",\n\"shinsindothebrew\",\"shook\",\"sigma\",\"sigma1\",\"sigmafinal\",\n\"sigmalunatesymbolgreek\",\"sihiragana\",\"sikatakana\",\"sikatakanahalfwidth\",\n\"siluqhebrew\",\"siluqlefthebrew\",\"similar\",\"sindothebrew\",\"siosacirclekorean\",\n\"siosaparenkorean\",\"sioscieuckorean\",\"sioscirclekorean\",\"sioskiyeokkorean\",\n\"sioskorean\",\"siosnieunkorean\",\"siosparenkorean\",\"siospieupkorean\",\n\"siostikeutkorean\",\"six\",\"sixarabic\",\"sixbengali\",\"sixcircle\",\n\"sixcircleinversesansserif\",\"sixdeva\",\"sixgujarati\",\"sixgurmukhi\",\n\"sixhackarabic\",\"sixhangzhou\",\"sixideographicparen\",\"sixinferior\",\n\"sixmonospace\",\"sixoldstyle\",\"sixparen\",\"sixperiod\",\"sixpersian\",\"sixroman\",\n\"sixsuperior\",\"sixteencircle\",\"sixteencurrencydenominatorbengali\",\n\"sixteenparen\",\"sixteenperiod\",\"sixthai\",\"slash\",\"slashmonospace\",\"slong\",\n\"slongdotaccent\",\"smileface\",\"smonospace\",\"sofpasuqhebrew\",\"softhyphen\",\n\"softsigncyrillic\",\"sohiragana\",\"sokatakana\",\"sokatakanahalfwidth\",\n\"soliduslongoverlaycmb\",\"solidusshortoverlaycmb\",\"sorusithai\",\"sosalathai\",\n\"sosothai\",\"sosuathai\",\"space\",\"spacehackarabic\",\"spade\",\"spadesuitblack\",\n\"spadesuitwhite\",\"sparen\",\"squarebelowcmb\",\"squarecc\",\"squarecm\",\n\"squarediagonalcrosshatchfill\",\"squarehorizontalfill\",\"squarekg\",\"squarekm\",\n\"squarekmcapital\",\"squareln\",\"squarelog\",\"squaremg\",\"squaremil\",\"squaremm\",\n\"squaremsquared\",\"squareorthogonalcrosshatchfill\",\n\"squareupperlefttolowerrightfill\",\"squareupperrighttolowerleftfill\",\n\"squareverticalfill\",\"squarewhitewithsmallblack\",\"srsquare\",\"ssabengali\",\n\"ssadeva\",\"ssagujarati\",\"ssangcieuckorean\",\"ssanghieuhkorean\",\n\"ssangieungkorean\",\"ssangkiyeokkorean\",\"ssangnieunkorean\",\"ssangpieupkorean\",\n\"ssangsioskorean\",\"ssangtikeutkorean\",\"ssuperior\",\"sterling\",\n\"sterlingmonospace\",\"strokelongoverlaycmb\",\"strokeshortoverlaycmb\",\"subset\",\n\"subsetnotequal\",\"subsetorequal\",\"succeeds\",\"suchthat\",\"suhiragana\",\n\"sukatakana\",\"sukatakanahalfwidth\",\"sukunarabic\",\"summation\",\"sun\",\"superset\",\n\"supersetnotequal\",\"supersetorequal\",\"svsquare\",\"syouwaerasquare\",\"t\",\n\"tabengali\",\"tackdown\",\"tackleft\",\"tadeva\",\"tagujarati\",\"tagurmukhi\",\n\"taharabic\",\"tahfinalarabic\",\"tahinitialarabic\",\"tahiragana\",\n\"tahmedialarabic\",\"taisyouerasquare\",\"takatakana\",\"takatakanahalfwidth\",\n\"tatweelarabic\",\"tau\",\"tav\",\"tavdages\",\"tavdagesh\",\"tavdageshhebrew\",\n\"tavhebrew\",\"tbar\",\"tbopomofo\",\"tcaron\",\"tccurl\",\"tcedilla\",\"tcheharabic\",\n\"tchehfinalarabic\",\"tchehinitialarabic\",\"tchehmedialarabic\",\n\"tchehmeeminitialarabic\",\"tcircle\",\"tcircumflexbelow\",\"tcommaaccent\",\n\"tdieresis\",\"tdotaccent\",\"tdotbelow\",\"tecyrillic\",\"tedescendercyrillic\",\n\"teharabic\",\"tehfinalarabic\",\"tehhahinitialarabic\",\"tehhahisolatedarabic\",\n\"tehinitialarabic\",\"tehiragana\",\"tehjeeminitialarabic\",\n\"tehjeemisolatedarabic\",\"tehmarbutaarabic\",\"tehmarbutafinalarabic\",\n\"tehmedialarabic\",\"tehmeeminitialarabic\",\"tehmeemisolatedarabic\",\n\"tehnoonfinalarabic\",\"tekatakana\",\"tekatakanahalfwidth\",\"telephone\",\n\"telephoneblack\",\"telishagedolahebrew\",\"telishaqetanahebrew\",\"tencircle\",\n\"tenideographicparen\",\"tenparen\",\"tenperiod\",\"tenroman\",\"tesh\",\"tet\",\n\"tetdagesh\",\"tetdageshhebrew\",\"tethebrew\",\"tetsecyrillic\",\"tevirhebrew\",\n\"tevirlefthebrew\",\"thabengali\",\"thadeva\",\"thagujarati\",\"thagurmukhi\",\n\"thalarabic\",\"thalfinalarabic\",\"thanthakhatlowleftthai\",\n\"thanthakhatlowrightthai\",\"thanthakhatthai\",\"thanthakhatupperleftthai\",\n\"theharabic\",\"thehfinalarabic\",\"thehinitialarabic\",\"thehmedialarabic\",\n\"thereexists\",\"therefore\",\"theta\",\"theta1\",\"thetasymbolgreek\",\n\"thieuthacirclekorean\",\"thieuthaparenkorean\",\"thieuthcirclekorean\",\n\"thieuthkorean\",\"thieuthparenkorean\",\"thirteencircle\",\"thirteenparen\",\n\"thirteenperiod\",\"thonangmonthothai\",\"thook\",\"thophuthaothai\",\"thorn\",\n\"thothahanthai\",\"thothanthai\",\"thothongthai\",\"thothungthai\",\n\"thousandcyrillic\",\"thousandsseparatorarabic\",\"thousandsseparatorpersian\",\n\"three\",\"threearabic\",\"threebengali\",\"threecircle\",\n\"threecircleinversesansserif\",\"threedeva\",\"threeeighths\",\"threegujarati\",\n\"threegurmukhi\",\"threehackarabic\",\"threehangzhou\",\"threeideographicparen\",\n\"threeinferior\",\"threemonospace\",\"threenumeratorbengali\",\"threeoldstyle\",\n\"threeparen\",\"threeperiod\",\"threepersian\",\"threequarters\",\n\"threequartersemdash\",\"threeroman\",\"threesuperior\",\"threethai\",\"thzsquare\",\n\"tihiragana\",\"tikatakana\",\"tikatakanahalfwidth\",\"tikeutacirclekorean\",\n\"tikeutaparenkorean\",\"tikeutcirclekorean\",\"tikeutkorean\",\"tikeutparenkorean\",\n\"tilde\",\"tildebelowcmb\",\"tildecmb\",\"tildecomb\",\"tildedoublecmb\",\n\"tildeoperator\",\"tildeoverlaycmb\",\"tildeverticalcmb\",\"timescircle\",\n\"tipehahebrew\",\"tipehalefthebrew\",\"tippigurmukhi\",\"titlocyrilliccmb\",\n\"tiwnarmenian\",\"tlinebelow\",\"tmonospace\",\"toarmenian\",\"tohiragana\",\n\"tokatakana\",\"tokatakanahalfwidth\",\"tonebarextrahighmod\",\"tonebarextralowmod\",\n\"tonebarhighmod\",\"tonebarlowmod\",\"tonebarmidmod\",\"tonefive\",\"tonesix\",\n\"tonetwo\",\"tonos\",\"tonsquare\",\"topatakthai\",\"tortoiseshellbracketleft\",\n\"tortoiseshellbracketleftsmall\",\"tortoiseshellbracketleftvertical\",\n\"tortoiseshellbracketright\",\"tortoiseshellbracketrightsmall\",\n\"tortoiseshellbracketrightvertical\",\"totaothai\",\"tpalatalhook\",\"tparen\",\n\"trademark\",\"trademarksans\",\"trademarkserif\",\"tretroflexhook\",\"triagdn\",\n\"triaglf\",\"triagrt\",\"triagup\",\"ts\",\"tsadi\",\"tsadidagesh\",\"tsadidageshhebrew\",\n\"tsadihebrew\",\"tsecyrillic\",\"tsere\",\"tsere12\",\"tsere1e\",\"tsere2b\",\n\"tserehebrew\",\"tserenarrowhebrew\",\"tserequarterhebrew\",\"tserewidehebrew\",\n\"tshecyrillic\",\"tsuperior\",\"ttabengali\",\"ttadeva\",\"ttagujarati\",\"ttagurmukhi\",\n\"tteharabic\",\"ttehfinalarabic\",\"ttehinitialarabic\",\"ttehmedialarabic\",\n\"tthabengali\",\"tthadeva\",\"tthagujarati\",\"tthagurmukhi\",\"tturned\",\"tuhiragana\",\n\"tukatakana\",\"tukatakanahalfwidth\",\"tusmallhiragana\",\"tusmallkatakana\",\n\"tusmallkatakanahalfwidth\",\"twelvecircle\",\"twelveparen\",\"twelveperiod\",\n\"twelveroman\",\"twentycircle\",\"twentyhangzhou\",\"twentyparen\",\"twentyperiod\",\n\"two\",\"twoarabic\",\"twobengali\",\"twocircle\",\"twocircleinversesansserif\",\n\"twodeva\",\"twodotenleader\",\"twodotleader\",\"twodotleadervertical\",\n\"twogujarati\",\"twogurmukhi\",\"twohackarabic\",\"twohangzhou\",\n\"twoideographicparen\",\"twoinferior\",\"twomonospace\",\"twonumeratorbengali\",\n\"twooldstyle\",\"twoparen\",\"twoperiod\",\"twopersian\",\"tworoman\",\"twostroke\",\n\"twosuperior\",\"twothai\",\"twothirds\",\"u\",\"uacute\",\"ubar\",\"ubengali\",\n\"ubopomofo\",\"ubreve\",\"ucaron\",\"ucircle\",\"ucircumflex\",\"ucircumflexbelow\",\n\"ucyrillic\",\"udattadeva\",\"udblacute\",\"udblgrave\",\"udeva\",\"udieresis\",\n\"udieresisacute\",\"udieresisbelow\",\"udieresiscaron\",\"udieresiscyrillic\",\n\"udieresisgrave\",\"udieresismacron\",\"udotbelow\",\"ugrave\",\"ugujarati\",\n\"ugurmukhi\",\"uhiragana\",\"uhookabove\",\"uhorn\",\"uhornacute\",\"uhorndotbelow\",\n\"uhorngrave\",\"uhornhookabove\",\"uhorntilde\",\"uhungarumlaut\",\n\"uhungarumlautcyrillic\",\"uinvertedbreve\",\"ukatakana\",\"ukatakanahalfwidth\",\n\"ukcyrillic\",\"ukorean\",\"umacron\",\"umacroncyrillic\",\"umacrondieresis\",\n\"umatragurmukhi\",\"umonospace\",\"underscore\",\"underscoredbl\",\n\"underscoremonospace\",\"underscorevertical\",\"underscorewavy\",\"union\",\n\"universal\",\"uogonek\",\"uparen\",\"upblock\",\"upperdothebrew\",\"upsilon\",\n\"upsilondieresis\",\"upsilondieresistonos\",\"upsilonlatin\",\"upsilontonos\",\n\"uptackbelowcmb\",\"uptackmod\",\"uragurmukhi\",\"uring\",\"ushortcyrillic\",\n\"usmallhiragana\",\"usmallkatakana\",\"usmallkatakanahalfwidth\",\n\"ustraightcyrillic\",\"ustraightstrokecyrillic\",\"utilde\",\"utildeacute\",\n\"utildebelow\",\"uubengali\",\"uudeva\",\"uugujarati\",\"uugurmukhi\",\n\"uumatragurmukhi\",\"uuvowelsignbengali\",\"uuvowelsigndeva\",\n\"uuvowelsigngujarati\",\"uvowelsignbengali\",\"uvowelsigndeva\",\n\"uvowelsigngujarati\",\"v\",\"vadeva\",\"vagujarati\",\"vagurmukhi\",\"vakatakana\",\n\"vav\",\"vavdagesh\",\"vavdagesh65\",\"vavdageshhebrew\",\"vavhebrew\",\"vavholam\",\n\"vavholamhebrew\",\"vavvavhebrew\",\"vavyodhebrew\",\"vcircle\",\"vdotbelow\",\n\"vecyrillic\",\"veharabic\",\"vehfinalarabic\",\"vehinitialarabic\",\n\"vehmedialarabic\",\"vekatakana\",\"venus\",\"verticalbar\",\"verticallineabovecmb\",\n\"verticallinebelowcmb\",\"verticallinelowmod\",\"verticallinemod\",\"vewarmenian\",\n\"vhook\",\"vikatakana\",\"viramabengali\",\"viramadeva\",\"viramagujarati\",\n\"visargabengali\",\"visargadeva\",\"visargagujarati\",\"vmonospace\",\"voarmenian\",\n\"voicediterationhiragana\",\"voicediterationkatakana\",\"voicedmarkkana\",\n\"voicedmarkkanahalfwidth\",\"vokatakana\",\"vparen\",\"vtilde\",\"vturned\",\n\"vuhiragana\",\"vukatakana\",\"w\",\"wacute\",\"waekorean\",\"wahiragana\",\"wakatakana\",\n\"wakatakanahalfwidth\",\"wakorean\",\"wasmallhiragana\",\"wasmallkatakana\",\n\"wattosquare\",\"wavedash\",\"wavyunderscorevertical\",\"wawarabic\",\n\"wawfinalarabic\",\"wawhamzaabovearabic\",\"wawhamzaabovefinalarabic\",\"wbsquare\",\n\"wcircle\",\"wcircumflex\",\"wdieresis\",\"wdotaccent\",\"wdotbelow\",\"wehiragana\",\n\"weierstrass\",\"wekatakana\",\"wekorean\",\"weokorean\",\"wgrave\",\"whitebullet\",\n\"whitecircle\",\"whitecircleinverse\",\"whitecornerbracketleft\",\n\"whitecornerbracketleftvertical\",\"whitecornerbracketright\",\n\"whitecornerbracketrightvertical\",\"whitediamond\",\n\"whitediamondcontainingblacksmalldiamond\",\"whitedownpointingsmalltriangle\",\n\"whitedownpointingtriangle\",\"whiteleftpointingsmalltriangle\",\n\"whiteleftpointingtriangle\",\"whitelenticularbracketleft\",\n\"whitelenticularbracketright\",\"whiterightpointingsmalltriangle\",\n\"whiterightpointingtriangle\",\"whitesmallsquare\",\"whitesmilingface\",\n\"whitesquare\",\"whitestar\",\"whitetelephone\",\"whitetortoiseshellbracketleft\",\n\"whitetortoiseshellbracketright\",\"whiteuppointingsmalltriangle\",\n\"whiteuppointingtriangle\",\"wihiragana\",\"wikatakana\",\"wikorean\",\"wmonospace\",\n\"wohiragana\",\"wokatakana\",\"wokatakanahalfwidth\",\"won\",\"wonmonospace\",\n\"wowaenthai\",\"wparen\",\"wring\",\"wsuperior\",\"wturned\",\"wynn\",\"x\",\"xabovecmb\",\n\"xbopomofo\",\"xcircle\",\"xdieresis\",\"xdotaccent\",\"xeharmenian\",\"xi\",\n\"xmonospace\",\"xparen\",\"xsuperior\",\"y\",\"yaadosquare\",\"yabengali\",\"yacute\",\n\"yadeva\",\"yaekorean\",\"yagujarati\",\"yagurmukhi\",\"yahiragana\",\"yakatakana\",\n\"yakatakanahalfwidth\",\"yakorean\",\"yamakkanthai\",\"yasmallhiragana\",\n\"yasmallkatakana\",\"yasmallkatakanahalfwidth\",\"yatcyrillic\",\"ycircle\",\n\"ycircumflex\",\"ydieresis\",\"ydotaccent\",\"ydotbelow\",\"yeharabic\",\n\"yehbarreearabic\",\"yehbarreefinalarabic\",\"yehfinalarabic\",\n\"yehhamzaabovearabic\",\"yehhamzaabovefinalarabic\",\"yehhamzaaboveinitialarabic\",\n\"yehhamzaabovemedialarabic\",\"yehinitialarabic\",\"yehmedialarabic\",\n\"yehmeeminitialarabic\",\"yehmeemisolatedarabic\",\"yehnoonfinalarabic\",\n\"yehthreedotsbelowarabic\",\"yekorean\",\"yen\",\"yenmonospace\",\"yeokorean\",\n\"yeorinhieuhkorean\",\"yerahbenyomohebrew\",\"yerahbenyomolefthebrew\",\n\"yericyrillic\",\"yerudieresiscyrillic\",\"yesieungkorean\",\n\"yesieungpansioskorean\",\"yesieungsioskorean\",\"yetivhebrew\",\"ygrave\",\"yhook\",\n\"yhookabove\",\"yiarmenian\",\"yicyrillic\",\"yikorean\",\"yinyang\",\"yiwnarmenian\",\n\"ymonospace\",\"yod\",\"yoddagesh\",\"yoddageshhebrew\",\"yodhebrew\",\"yodyodhebrew\",\n\"yodyodpatahhebrew\",\"yohiragana\",\"yoikorean\",\"yokatakana\",\n\"yokatakanahalfwidth\",\"yokorean\",\"yosmallhiragana\",\"yosmallkatakana\",\n\"yosmallkatakanahalfwidth\",\"yotgreek\",\"yoyaekorean\",\"yoyakorean\",\"yoyakthai\",\n\"yoyingthai\",\"yparen\",\"ypogegrammeni\",\"ypogegrammenigreekcmb\",\"yr\",\"yring\",\n\"ysuperior\",\"ytilde\",\"yturned\",\"yuhiragana\",\"yuikorean\",\"yukatakana\",\n\"yukatakanahalfwidth\",\"yukorean\",\"yusbigcyrillic\",\"yusbigiotifiedcyrillic\",\n\"yuslittlecyrillic\",\"yuslittleiotifiedcyrillic\",\"yusmallhiragana\",\n\"yusmallkatakana\",\"yusmallkatakanahalfwidth\",\"yuyekorean\",\"yuyeokorean\",\n\"yyabengali\",\"yyadeva\",\"z\",\"zaarmenian\",\"zacute\",\"zadeva\",\"zagurmukhi\",\n\"zaharabic\",\"zahfinalarabic\",\"zahinitialarabic\",\"zahiragana\",\n\"zahmedialarabic\",\"zainarabic\",\"zainfinalarabic\",\"zakatakana\",\n\"zaqefgadolhebrew\",\"zaqefqatanhebrew\",\"zarqahebrew\",\"zayin\",\"zayindagesh\",\n\"zayindageshhebrew\",\"zayinhebrew\",\"zbopomofo\",\"zcaron\",\"zcircle\",\n\"zcircumflex\",\"zcurl\",\"zdot\",\"zdotaccent\",\"zdotbelow\",\"zecyrillic\",\n\"zedescendercyrillic\",\"zedieresiscyrillic\",\"zehiragana\",\"zekatakana\",\"zero\",\n\"zeroarabic\",\"zerobengali\",\"zerodeva\",\"zerogujarati\",\"zerogurmukhi\",\n\"zerohackarabic\",\"zeroinferior\",\"zeromonospace\",\"zerooldstyle\",\"zeropersian\",\n\"zerosuperior\",\"zerothai\",\"zerowidthjoiner\",\"zerowidthnonjoiner\",\n\"zerowidthspace\",\"zeta\",\"zhbopomofo\",\"zhearmenian\",\"zhebrevecyrillic\",\n\"zhecyrillic\",\"zhedescendercyrillic\",\"zhedieresiscyrillic\",\"zihiragana\",\n\"zikatakana\",\"zinorhebrew\",\"zlinebelow\",\"zmonospace\",\"zohiragana\",\n\"zokatakana\",\"zparen\",\"zretroflexhook\",\"zstroke\",\"zuhiragana\",\"zukatakana\",\n};\n\nstatic const unsigned short agl_code_list[] = {\n65,198,508,482,63462,193,63457,258,7854,1232,7862,7856,7858,7860,461,9398,194,\n7844,7852,7846,7848,63458,7850,63177,63412,1040,512,196,1234,478,63460,7840,\n480,192,63456,7842,1236,514,913,902,256,65313,260,197,506,7680,63461,63329,\n195,63459,1329,66,9399,7682,7684,1041,1330,914,385,7686,65314,63220,63330,386,\n67,1342,262,63178,63221,268,199,7688,63463,9400,264,266,266,63416,1353,1212,\n1063,1214,1206,1268,1347,1227,1208,935,391,63222,65315,1361,63331,68,497,452,\n1332,393,270,7696,9401,7698,272,7690,7692,1044,1006,8710,916,394,63179,63180,\n63181,63400,988,1026,7694,65316,63223,272,63332,395,498,453,1248,1029,1039,69,\n201,63465,276,282,7708,1333,9402,202,7870,7704,7878,7872,7874,63466,7876,1028,\n516,203,63467,278,278,7864,1060,200,63464,1335,7866,8551,518,1124,1051,8554,\n274,7702,7700,1052,65317,1053,1186,330,1188,1223,280,400,917,904,1056,398,\n1069,1057,1194,425,63333,919,1336,905,208,63472,7868,7706,8364,439,494,440,70,\n9403,7710,1366,996,401,1138,8548,65318,8547,63334,71,13191,500,915,404,1002,\n286,486,290,9404,284,290,288,288,1043,1346,1172,1170,1168,403,1331,1027,7712,\n65319,63182,63328,63335,667,484,72,9679,9642,9643,9633,13259,1192,1202,1066,\n294,7722,7720,9405,292,7718,7714,7716,65320,1344,1000,63336,63183,63224,13200,\n73,1071,306,1070,205,63469,300,463,9406,206,63470,1030,520,207,7726,1252,\n63471,304,304,7882,1238,1045,8465,204,63468,7880,1048,522,1049,298,1250,65321,\n1339,1025,302,921,406,938,906,63337,407,296,7724,1140,1142,74,1345,9407,308,\n1032,1355,65322,63338,75,13189,13261,1184,7728,1050,1178,1219,922,1182,1180,\n488,310,9408,310,7730,1364,1343,1061,998,408,1036,7732,65323,1152,990,1134,\n63339,76,455,63167,313,923,317,315,9409,7740,315,319,319,7734,7736,1340,456,\n1033,7738,65324,321,63225,63340,77,13190,63184,63407,7742,9410,7744,7746,1348,\n65325,63341,412,924,78,458,323,327,325,9411,7754,325,7748,7750,413,8552,459,\n1034,7752,65326,1350,63342,209,63473,925,79,338,63226,211,63475,1256,1258,334,\n465,415,9412,212,7888,7896,7890,7892,63476,7894,1054,336,524,214,1254,63478,\n7884,63227,210,63474,1365,8486,7886,416,7898,7906,7900,7902,7904,336,418,526,\n332,7762,7760,8486,1120,937,1146,1148,911,927,908,65327,8544,490,492,390,216,\n510,63480,63343,510,1150,213,7756,7758,63477,80,7764,9413,7766,1055,1354,1190,\n934,420,928,1363,65328,936,1136,63344,81,9414,65329,63345,82,1356,340,344,342,\n9415,342,528,7768,7770,7772,1360,8476,929,63228,530,7774,65330,63346,641,694,\n83,9484,9492,9488,9496,9532,9516,9524,9500,9508,9472,9474,9569,9570,9558,9557,\n9571,9553,9559,9565,9564,9563,9566,9567,9562,9556,9577,9574,9568,9552,9580,\n9575,9576,9572,9573,9561,9560,9554,9555,9579,9578,346,7780,992,352,7782,63229,\n350,399,1240,1242,9416,348,536,7776,7778,7784,1357,8550,1351,1064,1065,994,\n1210,1004,931,8549,65331,1068,63347,986,84,932,358,356,354,9417,7792,354,7786,\n7788,1058,1196,8553,1204,920,428,222,63486,8546,63230,1359,7790,65332,1337,\n444,388,423,430,1062,1035,63348,8555,8545,85,218,63482,364,467,9418,219,7798,\n63483,1059,368,532,220,471,7794,473,1264,475,469,63484,7908,217,63481,7910,\n431,7912,7920,7914,7916,7918,368,1266,534,1144,362,1262,7802,65333,370,933,\n978,979,433,939,980,978,910,366,1038,63349,1198,1200,360,7800,7796,86,9419,\n7806,1042,1358,434,65334,1352,63350,7804,87,7810,9420,372,7812,7814,7816,7808,\n65335,63351,88,9421,7820,7818,1341,926,65336,63352,89,221,63485,1122,9422,374,\n376,63487,7822,7924,1067,1272,7922,435,7926,1349,1031,1362,65337,63353,7928,\n1130,1132,1126,1128,90,1334,377,381,63231,9423,7824,379,379,7826,1047,1176,\n1246,918,1338,1217,1046,1174,1244,7828,65338,63354,437,97,2438,225,2310,2694,\n2566,2622,13059,2494,2366,2750,1375,2416,2437,12570,259,7855,1233,7863,7857,\n7859,7861,462,9424,226,7845,7853,7847,7849,7851,180,791,769,769,2388,719,833,\n1072,513,2673,2309,228,1235,479,7841,481,230,509,12624,483,8213,8356,1040,\n1041,1042,1043,1044,1045,1025,1046,1047,1048,1049,1050,1051,1052,1053,1054,\n1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,\n1070,1071,1168,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1038,\n63172,63173,1072,1073,1074,1075,1076,1077,1105,1078,1079,1080,1081,1082,1083,\n1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,\n1099,1100,1101,1102,1103,1169,1106,1107,1108,1109,1110,1111,1112,1113,1114,\n1115,1116,1118,1039,1122,1138,1140,63174,1119,1123,1139,1141,63175,63176,1241,\n8206,8207,8205,1642,1548,1632,1633,1634,1635,1636,1637,1638,1639,1640,1641,\n1563,1567,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,\n1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,1600,1601,\n1602,1603,1604,1605,1606,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,\n1618,1607,1700,1662,1670,1688,1711,1657,1672,1681,1722,1746,1749,8362,1470,\n1475,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,\n1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,64298,64299,\n64331,64287,1520,1521,1522,64309,1460,1461,1462,1467,1464,1463,1456,1458,1457,\n1459,1474,1473,1465,1468,1469,1471,1472,700,8453,8467,8470,8236,8237,8238,\n8204,1645,701,224,2693,2565,12354,7843,2448,12574,2320,1237,2704,2576,2632,\n1593,65226,65227,65228,515,2504,2376,2760,12450,65393,12623,1488,1575,64304,\n65166,1571,65156,1573,65160,1488,64335,1570,65154,1609,65264,65267,65268,\n64302,64303,8501,8780,945,940,257,65345,38,65286,63270,13250,12578,12580,3674,\n8736,12296,65087,12297,65088,9001,9002,8491,903,2386,2434,2306,2690,261,13056,\n9372,1370,700,63743,8784,8776,8786,8773,12686,12685,8978,7834,229,507,7681,\n8596,8675,8672,8674,8673,8660,8659,8656,8658,8657,8595,8601,8600,8681,709,706,\n707,708,63719,8592,8656,8653,8646,8678,8594,8655,10142,8644,8680,8676,8677,\n8593,8597,8616,8616,8598,8645,8599,8679,63718,94,65342,126,65374,593,594,\n12353,12449,65383,42,1645,1645,8727,65290,65121,8258,63209,8771,64,227,65312,\n65131,592,2452,12576,2324,2708,2580,2519,2636,2508,2380,2764,2365,1377,1506,\n64288,1506,98,2476,92,65340,2348,2732,2604,12400,3647,12496,124,65372,12549,\n9425,7683,7685,9836,8757,1073,1576,65168,65169,12409,65170,64671,64520,64621,\n12505,1378,1489,946,976,64305,64305,1489,64332,2477,2349,2733,2605,595,12403,\n12499,664,2562,13105,9679,9670,9660,9668,9664,12304,65083,12305,65084,9699,\n9698,9644,9658,9654,9642,9787,9632,9733,9700,9701,9652,9650,9251,7687,9608,\n65346,3610,12412,12508,9373,13251,63732,123,63731,63730,65371,65115,63729,\n65079,125,63742,63741,65373,65116,63740,65080,91,63728,63727,65339,63726,93,\n63739,63738,65341,63737,728,814,774,815,785,865,810,826,166,384,63210,387,\n12406,12502,8226,9688,8729,9678,99,1390,2458,263,2330,2714,2586,13192,2433,\n784,2305,2689,8682,8453,711,812,780,8629,12568,269,231,7689,9426,265,597,267,\n267,13253,184,807,162,8451,63199,65504,63394,63200,1401,2459,2331,2715,2587,\n12564,1213,10003,1095,1215,1207,1269,1395,1228,1209,967,12919,12823,12905,\n12618,12809,3594,3592,3593,3596,392,12918,12822,12904,12616,12808,12828,9675,\n8855,8857,8853,12342,9680,9681,710,813,770,8999,450,448,449,451,9827,9827,\n9831,13220,65347,13216,1409,58,8353,65306,8353,65109,721,720,44,787,789,63171,\n1548,1373,63201,65292,788,701,65104,63202,786,699,9788,8773,8750,8963,6,7,8,\n24,13,17,18,19,20,127,16,25,5,4,27,23,3,12,28,29,9,10,21,30,15,14,2,1,26,22,\n31,11,169,63721,63193,12300,65378,65089,12301,65379,65090,13183,13255,13254,\n9374,8354,663,8911,8910,164,63185,63186,63188,63189,100,1380,2470,1590,2342,\n65214,65215,65216,1468,1468,8224,8225,2726,2598,12384,12480,1583,1491,64307,\n64307,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,1491,\n1491,1491,1491,1491,1491,1491,1491,65194,1615,1615,1612,1612,2404,1447,1447,\n1157,63187,12298,65085,12299,65086,811,8660,8658,2405,63190,783,8748,8215,819,\n831,698,8214,782,12553,13256,271,7697,9427,7699,273,2465,2337,2721,2593,1672,\n64393,2396,2466,2338,2722,2594,7691,7693,1643,1643,1076,176,1453,12391,1007,\n12487,9003,8998,948,397,2552,676,2471,2343,2727,2599,599,901,836,9830,9826,\n168,63191,804,776,63192,901,12386,12482,12291,247,8739,8725,1106,9619,7695,\n13207,273,65348,9604,3598,3604,12393,12489,36,63203,65284,63268,65129,63204,\n8363,13094,729,775,803,803,12539,305,63166,644,8901,9676,64287,64287,798,725,\n9375,63211,598,396,12389,12485,499,675,454,677,1249,1109,1119,101,233,9793,\n2447,12572,277,2317,2701,2373,2757,283,7709,1381,1415,9428,234,7871,7705,7879,\n7873,7875,7877,1108,517,2319,235,279,279,7865,2575,2631,1092,232,2703,1383,\n12573,12360,7867,12575,56,1640,2542,9319,10129,2414,9329,9349,9369,2798,2670,\n1640,12328,9835,12839,8328,65304,63288,9339,9359,1784,8567,8312,3672,519,1125,\n12456,65396,2676,12628,1083,8712,9322,9342,9362,8570,8230,8942,275,7703,7701,\n1084,8212,65073,65349,1371,8709,12579,1085,8211,65074,1187,331,12581,1189,\n1224,8194,281,12627,603,666,604,606,605,9376,949,941,61,65309,65126,8316,8801,\n12582,1088,600,1101,1089,1195,643,646,2318,2374,426,645,12359,12455,65386,\n8494,63212,951,1384,942,240,7869,7707,1425,1425,1425,1425,477,12641,8364,2503,\n2375,2759,33,1372,8252,161,63393,65281,63265,8707,658,495,659,441,442,102,\n2398,2654,8457,1614,1614,1611,12552,9429,7711,1601,1414,65234,65235,65236,997,\n9792,64256,64259,64260,64257,9326,9346,9366,8210,9632,9644,1498,64314,64314,\n1498,1498,1498,1498,1498,1501,1501,1503,1503,1507,1507,1509,1509,713,9673,\n1139,53,1637,2539,9316,10126,2411,8541,2795,2667,1637,12325,12836,8325,65301,\n63285,9336,9356,1781,8564,8309,3669,64258,402,65350,13209,3615,3613,3663,8704,\n52,1636,2538,9315,10125,2410,2794,2666,1636,12324,12835,8324,65300,2551,63284,\n9335,9355,1780,8563,8308,9325,9345,9365,3668,715,9377,8260,8355,103,2455,501,\n2327,1711,64403,64404,64405,2711,2583,12364,12460,947,611,736,1003,12557,287,\n487,291,9430,285,291,289,289,1075,12370,12466,8785,1436,1523,1437,223,1438,\n1524,12307,2456,1394,2328,2712,2584,1594,65230,65231,65232,1173,1171,1169,\n2394,2650,608,13203,12366,12462,1379,1490,64306,64306,1490,1107,446,660,662,\n704,661,705,740,673,674,7713,65351,12372,12468,9378,13228,8711,96,790,768,768,\n2387,718,65344,832,62,8805,8923,65310,8819,8823,8807,65125,609,485,12368,171,\n187,8249,8250,12464,13080,13257,104,1193,1729,2489,1203,2361,2745,2617,1581,\n65186,65187,12399,65188,13098,12495,65418,2637,1569,1569,1569,1569,1569,1569,\n1569,1569,1569,12644,1098,8636,8640,13258,1458,1458,1458,1458,1458,1458,1458,\n1458,1459,1459,1459,1459,1459,1459,1459,1459,1457,1457,1457,1457,1457,1457,\n1457,1457,295,12559,7723,7721,9431,293,7719,7715,7717,1492,9829,9829,9825,\n64308,64308,1729,1607,1492,64423,65258,65258,64421,64420,64424,65259,12408,\n64425,65260,13179,12504,65421,13110,615,13113,1495,1495,614,689,12923,12827,\n12909,12622,12813,12402,12498,65419,1460,1460,1460,1460,1460,1460,1460,1460,\n7830,65352,1392,3627,12411,12507,65422,1465,1465,1465,1465,1465,1465,1465,\n1465,3630,777,777,801,802,13122,1001,8213,795,9832,8962,9379,688,613,12405,\n13107,12501,65420,733,779,405,45,63205,65293,65123,63206,8208,105,237,1103,\n2439,12583,301,464,9432,238,1110,521,12943,12939,12863,12858,12965,12294,\n12289,65380,12855,12963,12847,12861,12957,12864,12950,12854,12843,12850,12964,\n12293,12952,12856,12967,12966,12969,12846,12842,12852,12290,12958,12867,12857,\n12862,12968,12953,12866,12851,12288,12853,12849,12859,12848,12860,12844,12845,\n12295,12942,12938,12948,12944,12940,12941,2311,239,7727,1253,7883,1239,1077,\n12917,12821,12903,12615,12807,236,2695,2567,12356,7881,2440,1080,2312,2696,\n2568,2624,523,1081,2496,2368,2752,307,12452,65394,12643,732,1452,299,1251,\n8787,2623,65353,8710,8734,1387,8747,8993,8993,63733,8992,8992,8745,13061,9688,\n9689,9787,1105,303,953,970,912,617,943,9380,2674,12355,12451,65384,2554,616,\n63213,12445,12541,297,7725,12585,1102,2495,2367,2751,1141,1143,106,1393,2460,\n2332,2716,2588,12560,496,9433,309,669,607,1112,1580,65182,65183,65184,1688,\n64395,2461,2333,2717,2589,1403,12292,65354,9381,690,107,1185,2453,7729,1082,\n1179,2325,1499,1603,64315,64315,65242,1499,65243,65244,64333,2709,2581,12363,\n1220,12459,65398,954,1008,12657,12676,12664,12665,13069,1600,1600,12533,13188,\n1616,1613,1183,65392,1181,12558,13193,489,311,9434,311,7731,1412,12369,12465,\n65401,1391,12534,312,2454,1093,2326,2710,2582,1582,65190,65191,65192,999,2393,\n2649,12920,12824,12906,12619,12810,3586,3589,3587,3588,3675,409,3590,13201,\n12365,12461,65399,13077,13078,13076,12910,12814,12896,12593,12800,12595,1116,\n7733,13208,13222,65355,13218,12371,13248,3585,12467,65402,13086,1153,12927,\n835,9382,13226,1135,13263,670,12367,12463,65400,13240,13246,108,2482,314,2354,\n2738,2610,3653,65276,65272,65271,65274,65273,65275,65270,65269,1604,955,411,\n1500,64316,64316,1500,1500,1500,1500,1500,65246,64714,65247,64713,64715,65010,\n65248,64904,64716,65247,65247,9711,410,620,12556,318,316,9435,7741,316,320,\n320,7735,7737,794,792,60,8804,8922,65308,8818,8822,8806,65124,622,9612,621,\n8356,1388,457,1113,63168,2355,2739,7739,2356,2529,2401,2531,2403,619,65356,\n13264,3628,8743,172,8976,8744,3621,383,65102,818,65101,9674,9383,322,8467,\n63214,9617,3622,2444,2316,2530,2402,13267,109,2478,175,817,772,717,65507,7743,\n2350,2734,2606,1444,1444,12414,63637,63636,3659,63635,63628,63627,3656,63626,\n63620,3633,63625,3655,63631,63630,3657,63629,63634,63633,3658,63632,3654,\n12510,65423,9794,13127,1470,9794,1455,13187,12551,13268,9436,13221,7745,7747,\n1605,65250,65251,65252,64721,64584,13133,12417,13182,12513,65426,1502,64318,\n64318,1502,1396,1445,1446,1446,1445,625,13202,65381,183,12914,12818,12900,\n12609,12656,12804,12654,12655,12415,12511,65424,8722,800,8854,727,8723,8242,\n13130,13129,624,13206,13219,65357,13215,12418,13249,12514,65427,13270,3617,\n13223,13224,9384,13227,13235,63215,623,181,181,13186,8811,8810,13196,956,\n13197,12416,12512,65425,13205,215,13211,1443,1443,9834,9835,9837,9839,13234,\n13238,13244,13241,13239,13247,13245,110,2472,8711,324,2344,2728,2600,12394,\n12490,65413,329,13185,12555,160,328,326,9437,7755,326,7749,7751,12397,12493,\n65416,8362,13195,2457,2329,2713,2585,3591,12435,626,627,12911,12815,12597,\n12897,12598,12596,12648,12801,12647,12646,12395,12491,65414,63641,3661,57,\n1641,2543,9320,10130,2415,2799,2671,1641,12329,12840,8329,65305,63289,9340,\n9360,1785,8568,8313,9330,9350,9370,3673,460,1114,12531,65437,414,7753,65358,\n13210,2467,2339,2723,2595,2345,12398,12494,65417,160,3603,3609,1606,65254,\n1722,64415,65255,65255,64722,64587,65256,64725,64590,64653,8716,8713,8713,\n8800,8815,8817,8825,8802,8814,8816,8742,8832,8836,8833,8837,1398,9385,13233,\n8319,241,957,12396,12492,65415,2492,2364,2748,2620,35,65283,65119,884,885,\n8470,1504,64320,64320,1504,13237,13243,2462,2334,2718,2590,111,243,3629,629,\n1257,1259,2451,12571,335,2321,2705,2377,2761,466,9438,244,7889,7897,7891,7893,\n7895,1086,337,525,2323,246,1255,7885,339,12634,731,808,242,2707,1413,12362,\n7887,417,7899,7907,7901,7903,7905,337,419,527,12458,65397,12631,1451,333,7763,\n7761,2384,969,982,1121,631,1147,1149,974,2768,959,972,65359,49,1633,2535,9312,\n10122,2407,8228,8539,63196,2791,2663,1633,189,12321,12832,8321,65297,2548,\n63281,9332,9352,1777,188,8560,185,3665,8531,491,493,2579,2635,596,9386,9702,\n8997,170,186,8735,2322,2378,248,511,12361,12457,65387,511,63216,1151,245,7757,\n7759,12577,8254,65098,773,65097,65100,65099,175,2507,2379,2763,112,13184,\n13099,2474,7765,2346,8671,8670,2730,2602,12401,3631,12497,1156,1216,12671,182,\n8741,40,64830,63725,63724,8333,65288,65113,8317,63723,65077,41,64831,63736,\n63735,8334,65289,65114,8318,63734,65078,8706,1472,1433,13225,1463,1463,1463,\n1463,1463,1463,1463,1463,1441,12550,9439,7767,1508,1087,64324,64324,13115,\n64323,1662,1402,1508,64343,64344,12410,64345,12506,1191,64334,37,1642,65285,\n65130,46,1417,183,65377,63207,65294,65106,63208,834,8869,8240,8359,13194,2475,\n2347,2731,2603,966,981,12922,12826,12908,12621,12812,632,3642,981,421,3614,\n3612,3616,960,12915,12819,12662,12901,12658,12610,12805,12660,12612,12661,\n12663,12659,12404,12500,982,1411,43,799,8853,177,726,65291,65122,8314,65360,\n13272,12413,9759,9756,9758,9757,12509,3611,12306,12320,9387,8826,8478,697,\n8245,8719,8965,12540,8984,8834,8835,8759,8733,968,1137,1158,13232,12407,12503,\n13236,13242,113,2392,1448,1602,65238,65239,65240,1464,1464,1464,1464,1464,\n1464,1464,1464,1464,1464,1464,1464,1464,1464,1464,1464,1439,12561,9440,672,\n65361,1511,64327,64327,1511,1511,1511,1511,1511,1511,1511,1511,1511,1511,1511,\n1511,1511,1511,1511,1511,1511,1511,1511,1511,1511,9388,9833,1467,1467,1467,\n1467,1467,1467,1467,1467,63,1567,1374,191,63423,894,65311,63295,34,8222,8220,\n65282,12318,12317,8221,8216,8219,8219,8217,329,8218,39,65287,114,1404,2480,\n341,2352,8730,63717,13230,13231,13229,1471,1471,2736,2608,12425,12521,65431,\n2545,2544,612,8758,12566,345,343,9441,343,529,7769,7771,7773,8251,8838,8839,\n174,63720,63194,1585,1408,65198,12428,1585,12524,65434,1512,64328,1512,1512,\n1512,1512,1512,1512,1512,1512,1512,1512,1512,1512,1512,1512,1512,1512,1512,\n1512,1512,1512,1512,8765,1431,1431,8976,638,639,2525,2397,961,637,635,693,\n1009,734,12913,12817,12899,12608,12602,12649,12601,12603,12652,12803,12607,\n12604,12651,12605,12606,12650,12653,8735,793,8895,12426,12522,65432,730,805,\n778,703,1369,796,723,702,825,722,531,13137,7775,636,634,65362,12429,12525,\n65435,3619,9389,2524,2353,2652,1681,64397,2528,2400,2784,2500,2372,2756,63217,\n9616,633,692,12427,12523,65433,2546,2547,63197,3620,2443,2315,2699,2499,2371,\n2755,115,2488,347,7781,1589,2360,65210,65211,65212,2744,2616,12373,12469,\n65403,65018,1505,64321,64321,1505,3634,3649,3652,3651,3635,3632,3648,63622,\n3637,63621,3636,3650,63624,3639,63623,3638,3640,3641,12569,353,7783,351,601,\n1241,1243,602,9442,349,537,7777,7779,7785,828,8243,714,167,1587,65202,65203,\n65204,1462,1462,1462,1462,1462,1462,1462,1426,1462,1405,12379,12475,65406,59,\n1563,65307,65108,12444,65439,13090,13091,55,1639,2541,9318,10128,2413,8542,\n2797,2669,1639,12327,12838,8327,65303,63287,9338,9358,1783,8566,8311,9328,\n9348,9368,3671,173,1399,2486,1096,1617,64609,64606,64608,1617,64610,64607,\n9618,9619,9617,9618,2358,2742,2614,1427,12565,1097,1588,65206,65207,65208,995,\n8362,8362,1456,1456,1456,1456,1456,1456,1456,1456,1456,1211,1005,1513,64329,\n64329,64300,64300,64301,64301,1473,1513,64298,64298,64299,64299,642,963,962,\n962,1010,12375,12471,65404,1469,1469,8764,1474,12916,12820,12670,12902,12666,\n12613,12667,12806,12669,12668,54,1638,2540,9317,10127,2412,2796,2668,1638,\n12326,12837,8326,65302,63286,9337,9357,1782,8565,8310,9327,2553,9347,9367,\n3670,47,65295,383,7835,9786,65363,1475,173,1100,12381,12477,65407,824,823,\n3625,3624,3595,3626,32,32,9824,9824,9828,9390,827,13252,13213,9641,9636,13199,\n13214,13262,13265,13266,13198,13269,13212,13217,9638,9639,9640,9637,9635,\n13275,2487,2359,2743,12617,12677,12672,12594,12645,12611,12614,12600,63218,\n163,65505,822,821,8834,8842,8838,8827,8715,12377,12473,65405,1618,8721,9788,\n8835,8843,8839,13276,13180,116,2468,8868,8867,2340,2724,2596,1591,65218,65219,\n12383,65220,13181,12479,65408,1600,964,1514,64330,64330,64330,1514,359,12554,\n357,680,355,1670,64379,64380,64381,64380,9443,7793,355,7831,7787,7789,1090,\n1197,1578,65174,64674,64524,65175,12390,64673,64523,1577,65172,65176,64676,\n64526,64627,12486,65411,8481,9742,1440,1449,9321,12841,9341,9361,8569,679,\n1496,64312,64312,1496,1205,1435,1435,2469,2341,2725,2597,1584,65196,63640,\n63639,3660,63638,1579,65178,65179,65180,8707,8756,952,977,977,12921,12825,\n12907,12620,12811,9324,9344,9364,3601,429,3602,254,3607,3600,3608,3606,1154,\n1644,1644,51,1635,2537,9314,10124,2409,8540,2793,2665,1635,12323,12834,8323,\n65299,2550,63283,9334,9354,1779,190,63198,8562,179,3667,13204,12385,12481,\n65409,12912,12816,12898,12599,12802,732,816,771,771,864,8764,820,830,8855,\n1430,1430,2672,1155,1407,7791,65364,1385,12392,12488,65412,741,745,742,744,\n743,445,389,424,900,13095,3599,12308,65117,65081,12309,65118,65082,3605,427,\n9391,8482,63722,63195,648,9660,9668,9658,9650,678,1510,64326,64326,1510,1094,\n1461,1461,1461,1461,1461,1461,1461,1461,1115,63219,2463,2335,2719,2591,1657,\n64359,64360,64361,2464,2336,2720,2592,647,12388,12484,65410,12387,12483,65391,\n9323,9343,9363,8571,9331,21316,9351,9371,50,1634,2536,9313,10123,2408,8229,\n8229,65072,2792,2664,1634,12322,12833,8322,65298,2549,63282,9333,9353,1778,\n8561,443,178,3666,8532,117,250,649,2441,12584,365,468,9444,251,7799,1091,2385,\n369,533,2313,252,472,7795,474,1265,476,470,7909,249,2697,2569,12358,7911,432,\n7913,7921,7915,7917,7919,369,1267,535,12454,65395,1145,12636,363,1263,7803,\n2625,65365,95,8215,65343,65075,65103,8746,8704,371,9392,9600,1476,965,971,944,\n650,973,797,724,2675,367,1118,12357,12453,65385,1199,1201,361,7801,7797,2442,\n2314,2698,2570,2626,2498,2370,2754,2497,2369,2753,118,2357,2741,2613,12535,\n1493,64309,64309,64309,1493,64331,64331,1520,1521,9445,7807,1074,1700,64363,\n64364,64365,12537,9792,124,781,809,716,712,1406,651,12536,2509,2381,2765,2435,\n2307,2691,65366,1400,12446,12542,12443,65438,12538,9393,7805,652,12436,12532,\n119,7811,12633,12431,12527,65436,12632,12430,12526,13143,12316,65076,1608,\n65262,1572,65158,13277,9446,373,7813,7815,7817,12433,8472,12529,12638,12637,\n7809,9702,9675,9689,12302,65091,12303,65092,9671,9672,9663,9661,9667,9665,\n12310,12311,9657,9655,9643,9786,9633,9734,9743,12312,12313,9653,9651,12432,\n12528,12639,65367,12434,12530,65382,8361,65510,3623,9394,7832,695,653,447,120,\n829,12562,9447,7821,7819,1389,958,65368,9395,739,121,13134,2479,253,2351,\n12626,2735,2607,12420,12516,65428,12625,3662,12419,12515,65388,1123,9448,375,\n255,7823,7925,1610,1746,64431,65266,1574,65162,65163,65164,65267,65268,64733,\n64600,64660,1745,12630,165,65509,12629,12678,1450,1450,1099,1273,12673,12675,\n12674,1434,7923,436,7927,1397,1111,12642,9775,1410,65369,1497,64313,64313,\n1497,1522,64287,12424,12681,12520,65430,12635,12423,12519,65390,1011,12680,\n12679,3618,3597,9396,890,837,422,7833,696,7929,654,12422,12684,12518,65429,\n12640,1131,1133,1127,1129,12421,12517,65389,12683,12682,2527,2399,122,1382,\n378,2395,2651,1592,65222,65223,12374,65224,1586,65200,12470,1429,1428,1432,\n1494,64310,64310,1494,12567,382,9449,7825,657,380,380,7827,1079,1177,1247,\n12380,12476,48,1632,2534,2406,2790,2662,1632,8320,65296,63280,1776,8304,3664,\n65279,8204,8203,950,12563,1386,1218,1078,1175,1245,12376,12472,1454,7829,\n65370,12382,12478,9397,656,438,12378,12474,\n};\n\nstatic const unsigned short agl_dup_offsets[] = {\n32,0,124,3,160,6,173,9,175,12,181,15,183,18,266,21,267,24,272,27,273,30,\n278,33,279,36,288,39,289,42,290,45,291,48,304,51,310,54,311,57,315,60,316,63,\n319,66,320,69,325,72,326,75,329,78,336,81,337,84,342,87,343,90,354,93,355,96,\n368,99,369,102,379,105,380,108,383,111,510,114,511,117,700,120,701,123,\n732,126,768,129,769,132,771,135,777,138,803,141,901,144,962,147,977,150,\n978,153,981,156,982,159,1025,162,1026,165,1027,168,1028,171,1029,174,1030,177,\n1031,180,1032,183,1033,186,1034,189,1035,192,1036,195,1038,198,1039,201,\n1040,204,1041,207,1042,210,1043,213,1044,216,1045,219,1046,222,1047,225,\n1048,228,1049,231,1050,234,1051,237,1052,240,1053,243,1054,246,1055,249,\n1056,252,1057,255,1058,258,1059,261,1060,264,1061,267,1062,270,1063,273,\n1064,276,1065,279,1066,282,1067,285,1068,288,1069,291,1070,294,1071,297,\n1072,300,1073,303,1074,306,1075,309,1076,312,1077,315,1078,318,1079,321,\n1080,324,1081,327,1082,330,1083,333,1084,336,1085,339,1086,342,1087,345,\n1088,348,1089,351,1090,354,1091,357,1092,360,1093,363,1094,366,1095,369,\n1096,372,1097,375,1098,378,1099,381,1100,384,1101,387,1102,390,1103,393,\n1105,396,1106,399,1107,402,1108,405,1109,408,1110,411,1111,414,1112,417,\n1113,420,1114,423,1115,426,1116,429,1118,432,1119,435,1122,438,1123,441,\n1138,444,1139,447,1140,450,1141,453,1168,456,1169,459,1241,462,1425,465,\n1430,470,1431,473,1435,476,1443,479,1444,482,1445,485,1446,488,1447,491,\n1450,494,1456,497,1457,508,1458,518,1459,528,1460,538,1461,548,1462,558,\n1463,568,1464,578,1465,596,1467,606,1468,616,1469,620,1470,624,1471,627,\n1472,631,1473,634,1474,637,1475,640,1488,643,1489,647,1490,651,1491,655,\n1492,679,1493,683,1494,687,1495,691,1496,695,1497,699,1498,703,1499,711,\n1500,715,1501,723,1502,727,1503,731,1504,735,1505,739,1506,743,1507,747,\n1508,751,1509,755,1510,759,1511,763,1512,787,1513,811,1514,815,1520,819,\n1521,822,1522,825,1548,828,1563,831,1567,834,1569,837,1570,848,1571,851,\n1572,854,1573,857,1574,860,1575,863,1576,866,1577,869,1578,872,1579,875,\n1580,878,1581,881,1582,884,1583,887,1584,890,1585,893,1586,897,1587,900,\n1588,903,1589,906,1590,909,1591,912,1592,915,1593,918,1594,921,1600,924,\n1601,929,1602,932,1603,935,1604,938,1605,941,1606,944,1607,947,1608,950,\n1609,953,1610,956,1611,959,1612,962,1613,966,1614,969,1615,973,1616,977,\n1617,980,1618,984,1632,987,1633,991,1634,995,1635,999,1636,1003,1637,1007,\n1638,1011,1639,1015,1640,1019,1641,1023,1642,1027,1643,1030,1644,1033,\n1645,1036,1657,1040,1662,1043,1670,1046,1672,1049,1681,1052,1688,1055,\n1700,1058,1711,1061,1722,1064,1729,1067,1746,1070,8204,1073,8213,1076,\n8215,1079,8219,1082,8229,1085,8353,1088,8356,1091,8362,1094,8364,1099,\n8453,1102,8467,1105,8470,1108,8486,1111,8616,1114,8656,1117,8658,1120,\n8660,1123,8704,1126,8707,1129,8710,1132,8711,1135,8713,1138,8735,1141,\n8764,1144,8773,1147,8834,1150,8835,1153,8838,1156,8839,1159,8853,1162,\n8855,1165,8976,1168,8992,1171,8993,1174,9617,1177,9618,1180,9619,1183,\n9632,1186,9633,1189,9642,1192,9643,1195,9644,1198,9650,1201,9658,1204,\n9660,1207,9668,1210,9675,1213,9679,1216,9688,1219,9689,1222,9702,1225,\n9786,1228,9787,1231,9788,1234,9792,1237,9794,1240,9824,1243,9827,1246,\n9829,1249,9835,1252,64287,1255,64298,1260,64299,1264,64300,1268,64301,1271,\n64305,1274,64306,1277,64307,1280,64308,1283,64309,1286,64310,1291,64312,1294,\n64313,1297,64314,1300,64315,1303,64316,1306,64318,1309,64320,1312,64321,1315,\n64324,1318,64326,1321,64327,1324,64329,1327,64330,1330,64331,1334,64380,1338,\n65247,1341,65255,1345,65258,1348,65267,1351,65268,1354,\n};\n\nstatic const char *agl_dup_names[] = {\n\"space\",\"spacehackarabic\",0,\"bar\",\"verticalbar\",0,\"nbspace\",\n\"nonbreakingspace\",0,\"sfthyphen\",\"softhyphen\",0,\"macron\",\"overscore\",0,\"mu\",\n\"mu1\",0,\"middot\",\"periodcentered\",0,\"Cdot\",\"Cdotaccent\",0,\"cdot\",\"cdotaccent\",\n0,\"Dcroat\",\"Dslash\",0,\"dcroat\",\"dmacron\",0,\"Edot\",\"Edotaccent\",0,\"edot\",\n\"edotaccent\",0,\"Gdot\",\"Gdotaccent\",0,\"gdot\",\"gdotaccent\",0,\"Gcedilla\",\n\"Gcommaaccent\",0,\"gcedilla\",\"gcommaaccent\",0,\"Idot\",\"Idotaccent\",0,\"Kcedilla\",\n\"Kcommaaccent\",0,\"kcedilla\",\"kcommaaccent\",0,\"Lcedilla\",\"Lcommaaccent\",0,\n\"lcedilla\",\"lcommaaccent\",0,\"Ldot\",\"Ldotaccent\",0,\"ldot\",\"ldotaccent\",0,\n\"Ncedilla\",\"Ncommaaccent\",0,\"ncedilla\",\"ncommaaccent\",0,\"napostrophe\",\n\"quoterightn\",0,\"Odblacute\",\"Ohungarumlaut\",0,\"odblacute\",\"ohungarumlaut\",0,\n\"Rcedilla\",\"Rcommaaccent\",0,\"rcedilla\",\"rcommaaccent\",0,\"Tcedilla\",\n\"Tcommaaccent\",0,\"tcedilla\",\"tcommaaccent\",0,\"Udblacute\",\"Uhungarumlaut\",0,\n\"udblacute\",\"uhungarumlaut\",0,\"Zdot\",\"Zdotaccent\",0,\"zdot\",\"zdotaccent\",0,\n\"longs\",\"slong\",0,\"Oslashacute\",\"Ostrokeacute\",0,\"oslashacute\",\"ostrokeacute\",\n0,\"afii57929\",\"apostrophemod\",0,\"afii64937\",\"commareversedmod\",0,\"ilde\",\n\"tilde\",0,\"gravecmb\",\"gravecomb\",0,\"acutecmb\",\"acutecomb\",0,\"tildecmb\",\n\"tildecomb\",0,\"hookabovecomb\",\"hookcmb\",0,\"dotbelowcmb\",\"dotbelowcomb\",0,\n\"dialytikatonos\",\"dieresistonos\",0,\"sigma1\",\"sigmafinal\",0,\"theta1\",\n\"thetasymbolgreek\",0,\"Upsilon1\",\"Upsilonhooksymbol\",0,\"phi1\",\"phisymbolgreek\",\n0,\"omega1\",\"pisymbolgreek\",0,\"Iocyrillic\",\"afii10023\",0,\"Djecyrillic\",\n\"afii10051\",0,\"Gjecyrillic\",\"afii10052\",0,\"Ecyrillic\",\"afii10053\",0,\n\"Dzecyrillic\",\"afii10054\",0,\"Icyrillic\",\"afii10055\",0,\"Yicyrillic\",\n\"afii10056\",0,\"Jecyrillic\",\"afii10057\",0,\"Ljecyrillic\",\"afii10058\",0,\n\"Njecyrillic\",\"afii10059\",0,\"Tshecyrillic\",\"afii10060\",0,\"Kjecyrillic\",\n\"afii10061\",0,\"Ushortcyrillic\",\"afii10062\",0,\"Dzhecyrillic\",\"afii10145\",0,\n\"Acyrillic\",\"afii10017\",0,\"Becyrillic\",\"afii10018\",0,\"Vecyrillic\",\"afii10019\",\n0,\"Gecyrillic\",\"afii10020\",0,\"Decyrillic\",\"afii10021\",0,\"Iecyrillic\",\n\"afii10022\",0,\"Zhecyrillic\",\"afii10024\",0,\"Zecyrillic\",\"afii10025\",0,\n\"Iicyrillic\",\"afii10026\",0,\"Iishortcyrillic\",\"afii10027\",0,\"Kacyrillic\",\n\"afii10028\",0,\"Elcyrillic\",\"afii10029\",0,\"Emcyrillic\",\"afii10030\",0,\n\"Encyrillic\",\"afii10031\",0,\"Ocyrillic\",\"afii10032\",0,\"Pecyrillic\",\"afii10033\",\n0,\"Ercyrillic\",\"afii10034\",0,\"Escyrillic\",\"afii10035\",0,\"Tecyrillic\",\n\"afii10036\",0,\"Ucyrillic\",\"afii10037\",0,\"Efcyrillic\",\"afii10038\",0,\n\"Khacyrillic\",\"afii10039\",0,\"Tsecyrillic\",\"afii10040\",0,\"Checyrillic\",\n\"afii10041\",0,\"Shacyrillic\",\"afii10042\",0,\"Shchacyrillic\",\"afii10043\",0,\n\"Hardsigncyrillic\",\"afii10044\",0,\"Yericyrillic\",\"afii10045\",0,\n\"Softsigncyrillic\",\"afii10046\",0,\"Ereversedcyrillic\",\"afii10047\",0,\n\"IUcyrillic\",\"afii10048\",0,\"IAcyrillic\",\"afii10049\",0,\"acyrillic\",\"afii10065\",\n0,\"afii10066\",\"becyrillic\",0,\"afii10067\",\"vecyrillic\",0,\"afii10068\",\n\"gecyrillic\",0,\"afii10069\",\"decyrillic\",0,\"afii10070\",\"iecyrillic\",0,\n\"afii10072\",\"zhecyrillic\",0,\"afii10073\",\"zecyrillic\",0,\"afii10074\",\n\"iicyrillic\",0,\"afii10075\",\"iishortcyrillic\",0,\"afii10076\",\"kacyrillic\",0,\n\"afii10077\",\"elcyrillic\",0,\"afii10078\",\"emcyrillic\",0,\"afii10079\",\n\"encyrillic\",0,\"afii10080\",\"ocyrillic\",0,\"afii10081\",\"pecyrillic\",0,\n\"afii10082\",\"ercyrillic\",0,\"afii10083\",\"escyrillic\",0,\"afii10084\",\n\"tecyrillic\",0,\"afii10085\",\"ucyrillic\",0,\"afii10086\",\"efcyrillic\",0,\n\"afii10087\",\"khacyrillic\",0,\"afii10088\",\"tsecyrillic\",0,\"afii10089\",\n\"checyrillic\",0,\"afii10090\",\"shacyrillic\",0,\"afii10091\",\"shchacyrillic\",0,\n\"afii10092\",\"hardsigncyrillic\",0,\"afii10093\",\"yericyrillic\",0,\"afii10094\",\n\"softsigncyrillic\",0,\"afii10095\",\"ereversedcyrillic\",0,\"afii10096\",\n\"iucyrillic\",0,\"afii10097\",\"iacyrillic\",0,\"afii10071\",\"iocyrillic\",0,\n\"afii10099\",\"djecyrillic\",0,\"afii10100\",\"gjecyrillic\",0,\"afii10101\",\n\"ecyrillic\",0,\"afii10102\",\"dzecyrillic\",0,\"afii10103\",\"icyrillic\",0,\n\"afii10104\",\"yicyrillic\",0,\"afii10105\",\"jecyrillic\",0,\"afii10106\",\n\"ljecyrillic\",0,\"afii10107\",\"njecyrillic\",0,\"afii10108\",\"tshecyrillic\",0,\n\"afii10109\",\"kjecyrillic\",0,\"afii10110\",\"ushortcyrillic\",0,\"afii10193\",\n\"dzhecyrillic\",0,\"Yatcyrillic\",\"afii10146\",0,\"afii10194\",\"yatcyrillic\",0,\n\"Fitacyrillic\",\"afii10147\",0,\"afii10195\",\"fitacyrillic\",0,\"Izhitsacyrillic\",\n\"afii10148\",0,\"afii10196\",\"izhitsacyrillic\",0,\"Gheupturncyrillic\",\"afii10050\",\n0,\"afii10098\",\"gheupturncyrillic\",0,\"afii10846\",\"schwacyrillic\",0,\n\"etnahtafoukhhebrew\",\"etnahtafoukhlefthebrew\",\"etnahtahebrew\",\n\"etnahtalefthebrew\",0,\"tipehahebrew\",\"tipehalefthebrew\",0,\"reviahebrew\",\n\"reviamugrashhebrew\",0,\"tevirhebrew\",\"tevirlefthebrew\",0,\"munahhebrew\",\n\"munahlefthebrew\",0,\"mahapakhhebrew\",\"mahapakhlefthebrew\",0,\"merkhahebrew\",\n\"merkhalefthebrew\",0,\"merkhakefulahebrew\",\"merkhakefulalefthebrew\",0,\n\"dargahebrew\",\"dargalefthebrew\",0,\"yerahbenyomohebrew\",\n\"yerahbenyomolefthebrew\",0,\"afii57799\",\"sheva\",\"sheva115\",\"sheva15\",\"sheva22\",\n\"sheva2e\",\"shevahebrew\",\"shevanarrowhebrew\",\"shevaquarterhebrew\",\n\"shevawidehebrew\",0,\"afii57801\",\"hatafsegol\",\"hatafsegol17\",\"hatafsegol24\",\n\"hatafsegol30\",\"hatafsegolhebrew\",\"hatafsegolnarrowhebrew\",\n\"hatafsegolquarterhebrew\",\"hatafsegolwidehebrew\",0,\"afii57800\",\"hatafpatah\",\n\"hatafpatah16\",\"hatafpatah23\",\"hatafpatah2f\",\"hatafpatahhebrew\",\n\"hatafpatahnarrowhebrew\",\"hatafpatahquarterhebrew\",\"hatafpatahwidehebrew\",0,\n\"afii57802\",\"hatafqamats\",\"hatafqamats1b\",\"hatafqamats28\",\"hatafqamats34\",\n\"hatafqamatshebrew\",\"hatafqamatsnarrowhebrew\",\"hatafqamatsquarterhebrew\",\n\"hatafqamatswidehebrew\",0,\"afii57793\",\"hiriq\",\"hiriq14\",\"hiriq21\",\"hiriq2d\",\n\"hiriqhebrew\",\"hiriqnarrowhebrew\",\"hiriqquarterhebrew\",\"hiriqwidehebrew\",0,\n\"afii57794\",\"tsere\",\"tsere12\",\"tsere1e\",\"tsere2b\",\"tserehebrew\",\n\"tserenarrowhebrew\",\"tserequarterhebrew\",\"tserewidehebrew\",0,\"afii57795\",\n\"segol\",\"segol13\",\"segol1f\",\"segol2c\",\"segolhebrew\",\"segolnarrowhebrew\",\n\"segolquarterhebrew\",\"segolwidehebrew\",0,\"afii57798\",\"patah\",\"patah11\",\n\"patah1d\",\"patah2a\",\"patahhebrew\",\"patahnarrowhebrew\",\"patahquarterhebrew\",\n\"patahwidehebrew\",0,\"afii57797\",\"qamats\",\"qamats10\",\"qamats1a\",\"qamats1c\",\n\"qamats27\",\"qamats29\",\"qamats33\",\"qamatsde\",\"qamatshebrew\",\n\"qamatsnarrowhebrew\",\"qamatsqatanhebrew\",\"qamatsqatannarrowhebrew\",\n\"qamatsqatanquarterhebrew\",\"qamatsqatanwidehebrew\",\"qamatsquarterhebrew\",\n\"qamatswidehebrew\",0,\"afii57806\",\"holam\",\"holam19\",\"holam26\",\"holam32\",\n\"holamhebrew\",\"holamnarrowhebrew\",\"holamquarterhebrew\",\"holamwidehebrew\",0,\n\"afii57796\",\"qubuts\",\"qubuts18\",\"qubuts25\",\"qubuts31\",\"qubutshebrew\",\n\"qubutsnarrowhebrew\",\"qubutsquarterhebrew\",\"qubutswidehebrew\",0,\"afii57807\",\n\"dagesh\",\"dageshhebrew\",0,\"afii57839\",\"siluqhebrew\",\"siluqlefthebrew\",0,\n\"afii57645\",\"maqafhebrew\",0,\"afii57841\",\"rafe\",\"rafehebrew\",0,\"afii57842\",\n\"paseqhebrew\",0,\"afii57804\",\"shindothebrew\",0,\"afii57803\",\"sindothebrew\",0,\n\"afii57658\",\"sofpasuqhebrew\",0,\"afii57664\",\"alef\",\"alefhebrew\",0,\"afii57665\",\n\"bet\",\"bethebrew\",0,\"afii57666\",\"gimel\",\"gimelhebrew\",0,\"afii57667\",\"dalet\",\n\"dalethatafpatah\",\"dalethatafpatahhebrew\",\"dalethatafsegol\",\n\"dalethatafsegolhebrew\",\"dalethebrew\",\"dalethiriq\",\"dalethiriqhebrew\",\n\"daletholam\",\"daletholamhebrew\",\"daletpatah\",\"daletpatahhebrew\",\"daletqamats\",\n\"daletqamatshebrew\",\"daletqubuts\",\"daletqubutshebrew\",\"daletsegol\",\n\"daletsegolhebrew\",\"daletsheva\",\"daletshevahebrew\",\"dalettsere\",\n\"dalettserehebrew\",0,\"afii57668\",\"he\",\"hehebrew\",0,\"afii57669\",\"vav\",\n\"vavhebrew\",0,\"afii57670\",\"zayin\",\"zayinhebrew\",0,\"afii57671\",\"het\",\n\"hethebrew\",0,\"afii57672\",\"tet\",\"tethebrew\",0,\"afii57673\",\"yod\",\"yodhebrew\",0,\n\"afii57674\",\"finalkaf\",\"finalkafhebrew\",\"finalkafqamats\",\n\"finalkafqamatshebrew\",\"finalkafsheva\",\"finalkafshevahebrew\",0,\"afii57675\",\n\"kaf\",\"kafhebrew\",0,\"afii57676\",\"lamed\",\"lamedhebrew\",\"lamedholam\",\n\"lamedholamdagesh\",\"lamedholamdageshhebrew\",\"lamedholamhebrew\",0,\"afii57677\",\n\"finalmem\",\"finalmemhebrew\",0,\"afii57678\",\"mem\",\"memhebrew\",0,\"afii57679\",\n\"finalnun\",\"finalnunhebrew\",0,\"afii57680\",\"nun\",\"nunhebrew\",0,\"afii57681\",\n\"samekh\",\"samekhhebrew\",0,\"afii57682\",\"ayin\",\"ayinhebrew\",0,\"afii57683\",\n\"finalpe\",\"finalpehebrew\",0,\"afii57684\",\"pe\",\"pehebrew\",0,\"afii57685\",\n\"finaltsadi\",\"finaltsadihebrew\",0,\"afii57686\",\"tsadi\",\"tsadihebrew\",0,\n\"afii57687\",\"qof\",\"qofhatafpatah\",\"qofhatafpatahhebrew\",\"qofhatafsegol\",\n\"qofhatafsegolhebrew\",\"qofhebrew\",\"qofhiriq\",\"qofhiriqhebrew\",\"qofholam\",\n\"qofholamhebrew\",\"qofpatah\",\"qofpatahhebrew\",\"qofqamats\",\"qofqamatshebrew\",\n\"qofqubuts\",\"qofqubutshebrew\",\"qofsegol\",\"qofsegolhebrew\",\"qofsheva\",\n\"qofshevahebrew\",\"qoftsere\",\"qoftserehebrew\",0,\"afii57688\",\"resh\",\n\"reshhatafpatah\",\"reshhatafpatahhebrew\",\"reshhatafsegol\",\n\"reshhatafsegolhebrew\",\"reshhebrew\",\"reshhiriq\",\"reshhiriqhebrew\",\"reshholam\",\n\"reshholamhebrew\",\"reshpatah\",\"reshpatahhebrew\",\"reshqamats\",\n\"reshqamatshebrew\",\"reshqubuts\",\"reshqubutshebrew\",\"reshsegol\",\n\"reshsegolhebrew\",\"reshsheva\",\"reshshevahebrew\",\"reshtsere\",\"reshtserehebrew\",\n0,\"afii57689\",\"shin\",\"shinhebrew\",0,\"afii57690\",\"tav\",\"tavhebrew\",0,\n\"afii57716\",\"vavvavhebrew\",0,\"afii57717\",\"vavyodhebrew\",0,\"afii57718\",\n\"yodyodhebrew\",0,\"afii57388\",\"commaarabic\",0,\"afii57403\",\"semicolonarabic\",0,\n\"afii57407\",\"questionarabic\",0,\"afii57409\",\"hamzaarabic\",\"hamzadammaarabic\",\n\"hamzadammatanarabic\",\"hamzafathaarabic\",\"hamzafathatanarabic\",\n\"hamzalowarabic\",\"hamzalowkasraarabic\",\"hamzalowkasratanarabic\",\n\"hamzasukunarabic\",0,\"afii57410\",\"alefmaddaabovearabic\",0,\"afii57411\",\n\"alefhamzaabovearabic\",0,\"afii57412\",\"wawhamzaabovearabic\",0,\"afii57413\",\n\"alefhamzabelowarabic\",0,\"afii57414\",\"yehhamzaabovearabic\",0,\"afii57415\",\n\"alefarabic\",0,\"afii57416\",\"beharabic\",0,\"afii57417\",\"tehmarbutaarabic\",0,\n\"afii57418\",\"teharabic\",0,\"afii57419\",\"theharabic\",0,\"afii57420\",\"jeemarabic\",\n0,\"afii57421\",\"haharabic\",0,\"afii57422\",\"khaharabic\",0,\"afii57423\",\n\"dalarabic\",0,\"afii57424\",\"thalarabic\",0,\"afii57425\",\"reharabic\",\n\"rehyehaleflamarabic\",0,\"afii57426\",\"zainarabic\",0,\"afii57427\",\"seenarabic\",0,\n\"afii57428\",\"sheenarabic\",0,\"afii57429\",\"sadarabic\",0,\"afii57430\",\"dadarabic\",\n0,\"afii57431\",\"taharabic\",0,\"afii57432\",\"zaharabic\",0,\"afii57433\",\"ainarabic\",\n0,\"afii57434\",\"ghainarabic\",0,\"afii57440\",\"kashidaautoarabic\",\n\"kashidaautonosidebearingarabic\",\"tatweelarabic\",0,\"afii57441\",\"feharabic\",0,\n\"afii57442\",\"qafarabic\",0,\"afii57443\",\"kafarabic\",0,\"afii57444\",\"lamarabic\",0,\n\"afii57445\",\"meemarabic\",0,\"afii57446\",\"noonarabic\",0,\"afii57470\",\"heharabic\",\n0,\"afii57448\",\"wawarabic\",0,\"afii57449\",\"alefmaksuraarabic\",0,\"afii57450\",\n\"yeharabic\",0,\"afii57451\",\"fathatanarabic\",0,\"afii57452\",\n\"dammatanaltonearabic\",\"dammatanarabic\",0,\"afii57453\",\"kasratanarabic\",0,\n\"afii57454\",\"fathaarabic\",\"fathalowarabic\",0,\"afii57455\",\"dammaarabic\",\n\"dammalowarabic\",0,\"afii57456\",\"kasraarabic\",0,\"afii57457\",\"shaddaarabic\",\n\"shaddafathatanarabic\",0,\"afii57458\",\"sukunarabic\",0,\"afii57392\",\"zeroarabic\",\n\"zerohackarabic\",0,\"afii57393\",\"onearabic\",\"onehackarabic\",0,\"afii57394\",\n\"twoarabic\",\"twohackarabic\",0,\"afii57395\",\"threearabic\",\"threehackarabic\",0,\n\"afii57396\",\"fourarabic\",\"fourhackarabic\",0,\"afii57397\",\"fivearabic\",\n\"fivehackarabic\",0,\"afii57398\",\"sixarabic\",\"sixhackarabic\",0,\"afii57399\",\n\"sevenarabic\",\"sevenhackarabic\",0,\"afii57400\",\"eightarabic\",\"eighthackarabic\",\n0,\"afii57401\",\"ninearabic\",\"ninehackarabic\",0,\"afii57381\",\"percentarabic\",0,\n\"decimalseparatorarabic\",\"decimalseparatorpersian\",0,\n\"thousandsseparatorarabic\",\"thousandsseparatorpersian\",0,\"afii63167\",\n\"asteriskaltonearabic\",\"asteriskarabic\",0,\"afii57511\",\"tteharabic\",0,\n\"afii57506\",\"peharabic\",0,\"afii57507\",\"tcheharabic\",0,\"afii57512\",\n\"ddalarabic\",0,\"afii57513\",\"rreharabic\",0,\"afii57508\",\"jeharabic\",0,\n\"afii57505\",\"veharabic\",0,\"afii57509\",\"gafarabic\",0,\"afii57514\",\n\"noonghunnaarabic\",0,\"haaltonearabic\",\"hehaltonearabic\",0,\"afii57519\",\n\"yehbarreearabic\",0,\"afii61664\",\"zerowidthnonjoiner\",0,\"afii00208\",\n\"horizontalbar\",0,\"dbllowline\",\"underscoredbl\",0,\"quoteleftreversed\",\n\"quotereversed\",0,\"twodotenleader\",\"twodotleader\",0,\"colonmonetary\",\n\"colonsign\",0,\"afii08941\",\"lira\",0,\"afii57636\",\"newsheqelsign\",\"sheqel\",\n\"sheqelhebrew\",0,\"Euro\",\"euro\",0,\"afii61248\",\"careof\",0,\"afii61289\",\"lsquare\",\n0,\"afii61352\",\"numero\",0,\"Ohm\",\"Omega\",0,\"arrowupdnbse\",\"arrowupdownbase\",0,\n\"arrowdblleft\",\"arrowleftdbl\",0,\"arrowdblright\",\"dblarrowright\",0,\n\"arrowdblboth\",\"dblarrowleft\",0,\"forall\",\"universal\",0,\"existential\",\n\"thereexists\",0,\"Delta\",\"increment\",0,\"gradient\",\"nabla\",0,\"notelement\",\n\"notelementof\",0,\"orthogonal\",\"rightangle\",0,\"similar\",\"tildeoperator\",0,\n\"approximatelyequal\",\"congruent\",0,\"propersubset\",\"subset\",0,\"propersuperset\",\n\"superset\",0,\"reflexsubset\",\"subsetorequal\",0,\"reflexsuperset\",\n\"supersetorequal\",0,\"circleplus\",\"pluscircle\",0,\"circlemultiply\",\n\"timescircle\",0,\"logicalnotreversed\",\"revlogicalnot\",0,\"integraltop\",\n\"integraltp\",0,\"integralbottom\",\"integralbt\",0,\"ltshade\",\"shadelight\",0,\n\"shade\",\"shademedium\",0,\"dkshade\",\"shadedark\",0,\"blacksquare\",\"filledbox\",0,\n\"H22073\",\"whitesquare\",0,\"H18543\",\"blacksmallsquare\",0,\"H18551\",\n\"whitesmallsquare\",0,\"blackrectangle\",\"filledrect\",0,\n\"blackuppointingtriangle\",\"triagup\",0,\"blackrightpointingpointer\",\"triagrt\",0,\n\"blackdownpointingtriangle\",\"triagdn\",0,\"blackleftpointingpointer\",\"triaglf\",\n0,\"circle\",\"whitecircle\",0,\"H18533\",\"blackcircle\",0,\"bulletinverse\",\n\"invbullet\",0,\"invcircle\",\"whitecircleinverse\",0,\"openbullet\",\"whitebullet\",0,\n\"smileface\",\"whitesmilingface\",0,\"blacksmilingface\",\"invsmileface\",0,\n\"compass\",\"sun\",0,\"female\",\"venus\",0,\"male\",\"mars\",0,\"spade\",\"spadesuitblack\",\n0,\"club\",\"clubsuitblack\",0,\"heart\",\"heartsuitblack\",0,\"eighthnotebeamed\",\n\"musicalnotedbl\",0,\"afii57705\",\"doubleyodpatah\",\"doubleyodpatahhebrew\",\n\"yodyodpatahhebrew\",0,\"afii57694\",\"shinshindot\",\"shinshindothebrew\",0,\n\"afii57695\",\"shinsindot\",\"shinsindothebrew\",0,\"shindageshshindot\",\n\"shindageshshindothebrew\",0,\"shindageshsindot\",\"shindageshsindothebrew\",0,\n\"betdagesh\",\"betdageshhebrew\",0,\"gimeldagesh\",\"gimeldageshhebrew\",0,\n\"daletdagesh\",\"daletdageshhebrew\",0,\"hedagesh\",\"hedageshhebrew\",0,\"afii57723\",\n\"vavdagesh\",\"vavdagesh65\",\"vavdageshhebrew\",0,\"zayindagesh\",\n\"zayindageshhebrew\",0,\"tetdagesh\",\"tetdageshhebrew\",0,\"yoddagesh\",\n\"yoddageshhebrew\",0,\"finalkafdagesh\",\"finalkafdageshhebrew\",0,\"kafdagesh\",\n\"kafdageshhebrew\",0,\"lameddagesh\",\"lameddageshhebrew\",0,\"memdagesh\",\n\"memdageshhebrew\",0,\"nundagesh\",\"nundageshhebrew\",0,\"samekhdagesh\",\n\"samekhdageshhebrew\",0,\"pedagesh\",\"pedageshhebrew\",0,\"tsadidagesh\",\n\"tsadidageshhebrew\",0,\"qofdagesh\",\"qofdageshhebrew\",0,\"shindagesh\",\n\"shindageshhebrew\",0,\"tavdages\",\"tavdagesh\",\"tavdageshhebrew\",0,\"afii57700\",\n\"vavholam\",\"vavholamhebrew\",0,\"tchehinitialarabic\",\"tchehmeeminitialarabic\",0,\n\"laminitialarabic\",\"lammeemjeeminitialarabic\",\"lammeemkhahinitialarabic\",0,\n\"noonhehinitialarabic\",\"nooninitialarabic\",0,\"hehfinalalttwoarabic\",\n\"hehfinalarabic\",0,\"alefmaksurainitialarabic\",\"yehinitialarabic\",0,\n\"alefmaksuramedialarabic\",\"yehmedialarabic\",0,\n};\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-image.c",
    "content": "#include \"mupdf/pdf.h\"\n\nstatic fz_image *pdf_load_jpx(pdf_document *doc, pdf_obj *dict, int forcemask);\n\nstatic fz_image *\npdf_load_image_imp(pdf_document *doc, pdf_obj *rdb, pdf_obj *dict, fz_stream *cstm, int forcemask)\n{\n\tfz_stream *stm = NULL;\n\tfz_image *image = NULL;\n\tpdf_obj *obj, *res;\n\n\tint w, h, bpc, n;\n\tint imagemask;\n\tint interpolate;\n\tint indexed;\n\tfz_image *mask = NULL; /* explicit mask/soft mask image */\n\tint usecolorkey = 0;\n\tfz_colorspace *colorspace = NULL;\n\tfloat decode[FZ_MAX_COLORS * 2];\n\tint colorkey[FZ_MAX_COLORS * 2];\n\tint stride;\n\n\tint i;\n\tfz_context *ctx = doc->ctx;\n\tfz_compressed_buffer *buffer;\n\n\tfz_var(stm);\n\tfz_var(mask);\n\tfz_var(image);\n\tfz_var(colorspace);\n\n\tfz_try(ctx)\n\t{\n\t\t/* special case for JPEG2000 images */\n\t\tif (pdf_is_jpx_image(ctx, dict))\n\t\t{\n\t\t\timage = pdf_load_jpx(doc, dict, forcemask);\n\n\t\t\tif (forcemask)\n\t\t\t{\n\t\t\t\tfz_pixmap *mask_pixmap;\n\t\t\t\tif (image->n != 2)\n\t\t\t\t{\n\t\t\t\t\tfz_pixmap *gray;\n\t\t\t\t\tfz_irect bbox;\n\t\t\t\t\tfz_warn(ctx, \"soft mask should be grayscale\");\n\t\t\t\t\tgray = fz_new_pixmap_with_bbox(ctx, fz_device_gray(ctx), fz_pixmap_bbox(ctx, image->tile, &bbox));\n\t\t\t\t\t/* SumatraPDF: ignore invalid JPX softmasks */\n\t\t\t\t\tfz_clear_pixmap_with_value(ctx, gray, 255);\n\t\t\t\t\tfz_drop_pixmap(ctx, image->tile);\n\t\t\t\t\timage->tile = gray;\n\t\t\t\t}\n\t\t\t\tmask_pixmap = fz_alpha_from_gray(ctx, image->tile, 1);\n\t\t\t\tfz_drop_pixmap(ctx, image->tile);\n\t\t\t\timage->tile = mask_pixmap;\n\t\t\t}\n\t\t\tbreak; /* Out of fz_try */\n\t\t}\n\n\t\tw = pdf_to_int(pdf_dict_getsa(dict, \"Width\", \"W\"));\n\t\th = pdf_to_int(pdf_dict_getsa(dict, \"Height\", \"H\"));\n\t\tbpc = pdf_to_int(pdf_dict_getsa(dict, \"BitsPerComponent\", \"BPC\"));\n\t\tif (bpc == 0)\n\t\t\tbpc = 8;\n\t\timagemask = pdf_to_bool(pdf_dict_getsa(dict, \"ImageMask\", \"IM\"));\n\t\tinterpolate = pdf_to_bool(pdf_dict_getsa(dict, \"Interpolate\", \"I\"));\n\n\t\tindexed = 0;\n\t\tusecolorkey = 0;\n\n\t\tif (imagemask)\n\t\t\tbpc = 1;\n\n\t\tif (w <= 0)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"image width is zero (or less)\");\n\t\tif (h <= 0)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"image height is zero (or less)\");\n\t\tif (bpc <= 0)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"image depth is zero (or less)\");\n\t\tif (bpc > 16)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"image depth is too large: %d\", bpc);\n\t\tif (w > (1 << 16))\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"image is too wide\");\n\t\tif (h > (1 << 16))\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"image is too high\");\n\n\t\tobj = pdf_dict_getsa(dict, \"ColorSpace\", \"CS\");\n\t\tif (obj && !imagemask && !forcemask)\n\t\t{\n\t\t\t/* colorspace resource lookup is only done for inline images */\n\t\t\tif (pdf_is_name(obj))\n\t\t\t{\n\t\t\t\tres = pdf_dict_get(pdf_dict_gets(rdb, \"ColorSpace\"), obj);\n\t\t\t\tif (res)\n\t\t\t\t\tobj = res;\n\t\t\t}\n\n\t\t\tcolorspace = pdf_load_colorspace(doc, obj);\n\t\t\tindexed = fz_colorspace_is_indexed(colorspace);\n\n\t\t\tn = colorspace->n;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tn = 1;\n\t\t}\n\n\t\tobj = pdf_dict_getsa(dict, \"Decode\", \"D\");\n\t\tif (obj)\n\t\t{\n\t\t\tfor (i = 0; i < n * 2; i++)\n\t\t\t\tdecode[i] = pdf_to_real(pdf_array_get(obj, i));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfloat maxval = indexed ? (1 << bpc) - 1 : 1;\n\t\t\tfor (i = 0; i < n * 2; i++)\n\t\t\t\tdecode[i] = i & 1 ? maxval : 0;\n\t\t}\n\n\t\tobj = pdf_dict_getsa(dict, \"SMask\", \"Mask\");\n\t\tif (pdf_is_dict(obj))\n\t\t{\n\t\t\t/* Not allowed for inline images or soft masks */\n\t\t\tif (cstm)\n\t\t\t\tfz_warn(ctx, \"Ignoring invalid inline image soft mask\");\n\t\t\telse if (forcemask)\n\t\t\t\tfz_warn(ctx, \"Ignoring recursive image soft mask\");\n\t\t\telse\n\t\t\t{\n\t\t\t\tmask = pdf_load_image_imp(doc, rdb, obj, NULL, 1);\n\t\t\t\tobj = pdf_dict_gets(obj, \"Matte\");\n\t\t\t\tif (pdf_is_array(obj))\n\t\t\t\t{\n\t\t\t\t\tusecolorkey = 1;\n\t\t\t\t\tfor (i = 0; i < n; i++)\n\t\t\t\t\t\tcolorkey[i] = pdf_to_real(pdf_array_get(obj, i)) * 255;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if (pdf_is_array(obj))\n\t\t{\n\t\t\tusecolorkey = 1;\n\t\t\tfor (i = 0; i < n * 2; i++)\n\t\t\t{\n\t\t\t\tif (!pdf_is_int(pdf_array_get(obj, i)))\n\t\t\t\t{\n\t\t\t\t\tfz_warn(ctx, \"invalid value in color key mask\");\n\t\t\t\t\tusecolorkey = 0;\n\t\t\t\t}\n\t\t\t\tcolorkey[i] = pdf_to_int(pdf_array_get(obj, i));\n\t\t\t}\n\t\t}\n\n\t\t/* Do we load from a ref, or do we load an inline stream? */\n\t\tif (cstm == NULL)\n\t\t{\n\t\t\t/* Just load the compressed image data now and we can\n\t\t\t * decode it on demand. */\n\t\t\tint num = pdf_to_num(dict);\n\t\t\tint gen = pdf_to_gen(dict);\n\t\t\tbuffer = pdf_load_compressed_stream(doc, num, gen);\n\t\t\timage = fz_new_image(ctx, w, h, bpc, colorspace, 96, 96, interpolate, imagemask, decode, usecolorkey ? colorkey : NULL, buffer, mask);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* Inline stream */\n\t\t\tstride = (w * n * bpc + 7) / 8;\n\t\t\timage = fz_new_image(ctx, w, h, bpc, colorspace, 96, 96, interpolate, imagemask, decode, usecolorkey ? colorkey : NULL, NULL, mask);\n\t\t\tpdf_load_compressed_inline_image(doc, dict, stride * h, cstm, indexed, image);\n\t\t}\n\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_drop_colorspace(ctx, colorspace);\n\t\tfz_drop_image(ctx, mask);\n\t\tfz_drop_image(ctx, image);\n\t\tfz_rethrow(ctx);\n\t}\n\treturn image;\n}\n\nfz_image *\npdf_load_inline_image(pdf_document *doc, pdf_obj *rdb, pdf_obj *dict, fz_stream *file)\n{\n\treturn pdf_load_image_imp(doc, rdb, dict, file, 0);\n}\n\nint\npdf_is_jpx_image(fz_context *ctx, pdf_obj *dict)\n{\n\tpdf_obj *filter;\n\tint i, n;\n\n\tfilter = pdf_dict_gets(dict, \"Filter\");\n\tif (!strcmp(pdf_to_name(filter), \"JPXDecode\"))\n\t\treturn 1;\n\tn = pdf_array_len(filter);\n\tfor (i = 0; i < n; i++)\n\t\tif (!strcmp(pdf_to_name(pdf_array_get(filter, i)), \"JPXDecode\"))\n\t\t\treturn 1;\n\treturn 0;\n}\n\nstatic fz_image *\npdf_load_jpx(pdf_document *doc, pdf_obj *dict, int forcemask)\n{\n\tfz_buffer *buf = NULL;\n\tfz_colorspace *colorspace = NULL;\n\tfz_pixmap *img = NULL;\n\tpdf_obj *obj;\n\tfz_context *ctx = doc->ctx;\n\tint indexed = 0;\n\tfz_image *mask = NULL;\n\n\tfz_var(img);\n\tfz_var(buf);\n\tfz_var(colorspace);\n\tfz_var(mask);\n\n\tbuf = pdf_load_stream(doc, pdf_to_num(dict), pdf_to_gen(dict));\n\n\t/* FIXME: We can't handle decode arrays for indexed images currently */\n\tfz_try(ctx)\n\t{\n\t\tobj = pdf_dict_gets(dict, \"ColorSpace\");\n\t\tif (obj)\n\t\t{\n\t\t\tcolorspace = pdf_load_colorspace(doc, obj);\n\t\t\tindexed = fz_colorspace_is_indexed(colorspace);\n\t\t}\n\n\t\timg = fz_load_jpx(ctx, buf->data, buf->len, colorspace, indexed);\n\n\t\tobj = pdf_dict_getsa(dict, \"SMask\", \"Mask\");\n\t\tif (pdf_is_dict(obj))\n\t\t{\n\t\t\tif (forcemask)\n\t\t\t\tfz_warn(ctx, \"Ignoring recursive JPX soft mask\");\n\t\t\telse\n\t\t\t\tmask = pdf_load_image_imp(doc, NULL, obj, NULL, 1);\n\t\t}\n\n\t\tobj = pdf_dict_getsa(dict, \"Decode\", \"D\");\n\t\tif (obj && !indexed)\n\t\t{\n\t\t\tfloat decode[FZ_MAX_COLORS * 2];\n\t\t\tint i;\n\n\t\t\tfor (i = 0; i < img->n * 2; i++)\n\t\t\t\tdecode[i] = pdf_to_real(pdf_array_get(obj, i));\n\n\t\t\tfz_decode_tile(img, decode);\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_colorspace(ctx, colorspace);\n\t\tfz_drop_buffer(ctx, buf);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_drop_pixmap(ctx, img);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn fz_new_image_from_pixmap(ctx, img, mask);\n}\n\nstatic int\nfz_image_size(fz_context *ctx, fz_image *im)\n{\n\tif (im == NULL)\n\t\treturn 0;\n\treturn sizeof(*im) + fz_pixmap_size(ctx, im->tile) + (im->buffer && im->buffer->buffer ? im->buffer->buffer->cap : 0);\n}\n\nfz_image *\npdf_load_image(pdf_document *doc, pdf_obj *dict)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_image *image;\n\n\tif ((image = pdf_find_item(ctx, fz_free_image, dict)) != NULL)\n\t{\n\t\treturn (fz_image *)image;\n\t}\n\n\timage = pdf_load_image_imp(doc, NULL, dict, NULL, 0);\n\n\tpdf_store_item(ctx, dict, image, fz_image_size(ctx, image));\n\n\treturn (fz_image *)image;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-interpret-imp.h",
    "content": "#ifndef PDF_INTERPRET_IMP_H\n#define PDF_INTERPRET_IMP_H\n\n#include \"mupdf/pdf.h\"\n\ntypedef struct pdf_csi_s pdf_csi;\ntypedef struct pdf_gstate_s pdf_gstate;\n\ntypedef void (*pdf_operator_fn)(pdf_csi *, void *user);\ntypedef void (*pdf_process_annot_fn)(pdf_csi *csi, void *user, pdf_obj *resources, pdf_annot *annot);\ntypedef void (*pdf_process_stream_fn)(pdf_csi *csi, void *user, pdf_lexbuf *buf);\ntypedef void (*pdf_process_contents_fn)(pdf_csi *csi, void *user, pdf_obj *resources, pdf_obj *contents);\n\ntypedef enum {\n\t/* The first section of op's all run without a try/catch */\n\tPDF_OP_dquote,\n\tPDF_OP_squote,\n\tPDF_OP_B,\n\tPDF_OP_Bstar,\n\tPDF_OP_BDC,\n\tPDF_OP_BI,\n\tPDF_OP_BMC,\n\tPDF_OP_BT,\n\tPDF_OP_BX,\n\tPDF_OP_CS,\n\tPDF_OP_DP,\n\tPDF_OP_EMC,\n\tPDF_OP_ET,\n\tPDF_OP_EX,\n\tPDF_OP_F,\n\tPDF_OP_G,\n\tPDF_OP_J,\n\tPDF_OP_K,\n\tPDF_OP_M,\n\tPDF_OP_MP,\n\tPDF_OP_Q,\n\tPDF_OP_RG,\n\tPDF_OP_S,\n\tPDF_OP_SC,\n\tPDF_OP_SCN,\n\tPDF_OP_Tstar,\n\tPDF_OP_TD,\n\tPDF_OP_TJ,\n\tPDF_OP_TL,\n\tPDF_OP_Tc,\n\tPDF_OP_Td,\n\tPDF_OP_Tj,\n\tPDF_OP_Tm,\n\tPDF_OP_Tr,\n\tPDF_OP_Ts,\n\tPDF_OP_Tw,\n\tPDF_OP_Tz,\n\tPDF_OP_W,\n\tPDF_OP_Wstar,\n\tPDF_OP_b,\n\tPDF_OP_bstar,\n\tPDF_OP_c,\n\tPDF_OP_cm,\n\tPDF_OP_cs,\n\tPDF_OP_d,\n\tPDF_OP_d0,\n\tPDF_OP_d1,\n\tPDF_OP_f,\n\tPDF_OP_fstar,\n\tPDF_OP_g,\n\tPDF_OP_h,\n\tPDF_OP_i,\n\tPDF_OP_j,\n\tPDF_OP_k,\n\tPDF_OP_l,\n\tPDF_OP_m,\n\tPDF_OP_n,\n\tPDF_OP_q,\n\tPDF_OP_re,\n\tPDF_OP_rg,\n\tPDF_OP_ri,\n\tPDF_OP_s,\n\tPDF_OP_sc,\n\tPDF_OP_scn,\n\tPDF_OP_v,\n\tPDF_OP_w,\n\tPDF_OP_y,\n\t/* ops in this second section require additional try/catch handling */\n\tPDF_OP_Do,\n\tPDF_OP_Tf,\n\tPDF_OP_gs,\n\tPDF_OP_sh,\n\t/* END is used to signify end of stream (finalise and close down) */\n\tPDF_OP_END,\n\t/* And finally we have a max */\n\tPDF_OP_MAX\n} PDF_OP;\n\ntypedef struct pdf_processor_s {\n\tpdf_operator_fn op_table[PDF_OP_MAX];\n\tpdf_process_annot_fn process_annot;\n\tpdf_process_stream_fn process_stream;\n\tpdf_process_contents_fn process_contents;\n} pdf_processor;\n\ntypedef struct pdf_process_s\n{\n\tconst pdf_processor *processor;\n\tvoid *state;\n} pdf_process;\n\nstruct pdf_csi_s\n{\n\tpdf_document *doc;\n\n\t/* Current resource dict and file. These are in here to reduce param\n\t * passing. */\n\tpdf_obj *rdb;\n\tfz_stream *file;\n\n\t/* Operator table */\n\tpdf_process process;\n\n\t/* interpreter stack */\n\tpdf_obj *obj;\n\tchar name[256];\n\tunsigned char string[256];\n\tint string_len;\n\tfloat stack[32];\n\tint top;\n\tfz_image *img;\n\n\tint xbalance;\n\tint in_text;\n\n\t/* cookie support */\n\tfz_cookie *cookie;\n};\n\nstatic inline void pdf_process_op(pdf_csi *csi, int op, const pdf_process *process)\n{\n\tprocess->processor->op_table[op](csi, process->state);\n}\n\n/* Helper functions for the filter implementations to call */\nvoid pdf_process_contents_object(pdf_csi *csi, pdf_obj *rdb, pdf_obj *contents);\nvoid pdf_process_stream(pdf_csi *csi, pdf_lexbuf *buf);\n\n/* Functions to set up pdf_process structures */\npdf_process *pdf_process_run(pdf_process *process, fz_device *dev, const fz_matrix *ctm, const char *event, pdf_gstate *gstate, int nested);\npdf_process *pdf_process_buffer(pdf_process *process, fz_context *ctx, fz_buffer *buffer);\npdf_process *pdf_process_filter(pdf_process *process, fz_context *ctx, pdf_process *underlying, pdf_obj *resources);\n\n/* Functions to actually use the pdf_process structures to process\n * annotations, glyphs and general stream objects */\nvoid pdf_process_annot(pdf_document *doc, pdf_page *page, pdf_annot *annot, const pdf_process *process, fz_cookie *cookie);\nvoid pdf_process_glyph(pdf_document *doc, pdf_obj *resources, fz_buffer *contents, pdf_process *process);\nvoid pdf_process_stream_object(pdf_document *doc, pdf_obj *obj, const pdf_process *process, pdf_obj *res, fz_cookie *cookie);\n\n#endif\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-interpret.c",
    "content": "#include \"pdf-interpret-imp.h\"\n\nstatic pdf_csi *\npdf_new_csi(pdf_document *doc, fz_cookie *cookie, const pdf_process *process)\n{\n\tpdf_csi *csi = NULL;\n\tfz_context *ctx = doc->ctx;\n\n\tfz_var(csi);\n\n\tfz_try(ctx)\n\t{\n\t\tcsi = fz_malloc_struct(ctx, pdf_csi);\n\t\tcsi->doc = doc;\n\t\tcsi->in_text = 0;\n\n\t\tcsi->top = 0;\n\t\tcsi->obj = NULL;\n\t\tcsi->name[0] = 0;\n\t\tcsi->string_len = 0;\n\t\tmemset(csi->stack, 0, sizeof csi->stack);\n\n\t\tcsi->process = *process;\n\n\t\tcsi->xbalance = 0;\n\t\tcsi->cookie = cookie;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_process_op(csi, PDF_OP_END, process);\n\t\tfz_free(ctx, csi);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn csi;\n}\n\nstatic void\npdf_clear_stack(pdf_csi *csi)\n{\n\tint i;\n\n\tfz_drop_image(csi->doc->ctx, csi->img);\n\tcsi->img = NULL;\n\n\tpdf_drop_obj(csi->obj);\n\tcsi->obj = NULL;\n\n\tcsi->name[0] = 0;\n\tcsi->string_len = 0;\n\tfor (i = 0; i < csi->top; i++)\n\t\tcsi->stack[i] = 0;\n\n\tcsi->top = 0;\n}\n\nstatic void\npdf_free_csi(pdf_csi *csi)\n{\n\tfz_context *ctx = csi->doc->ctx;\n\n\tpdf_process_op(csi, PDF_OP_END, &csi->process);\n\tfz_free(ctx, csi);\n}\n\n#define A(a) (a)\n#define B(a,b) (a | b << 8)\n#define C(a,b,c) (a | b << 8 | c << 16)\n\nstatic void\nparse_inline_image(pdf_csi *csi)\n{\n\tfz_context *ctx = csi->doc->ctx;\n\tpdf_obj *rdb = csi->rdb;\n\tfz_stream *file = csi->file;\n\tint ch, found;\n\n\tfz_drop_image(ctx, csi->img);\n\tcsi->img = NULL;\n\tpdf_drop_obj(csi->obj);\n\tcsi->obj = NULL;\n\n\tcsi->obj = pdf_parse_dict(csi->doc, file, &csi->doc->lexbuf.base);\n\n\t/* read whitespace after ID keyword */\n\tch = fz_read_byte(file);\n\tif (ch == '\\r')\n\t\tif (fz_peek_byte(file) == '\\n')\n\t\t\tfz_read_byte(file);\n\n\tfz_try(ctx)\n\t{\n\t\tcsi->img = pdf_load_inline_image(csi->doc, rdb, csi->obj, file);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\t/* find EI */\n\tfound = 0;\n\tch = fz_read_byte(file);\n\tdo\n\t{\n\t\twhile (ch != 'E' && ch != EOF)\n\t\t\tch = fz_read_byte(file);\n\t\tif (ch == 'E')\n\t\t{\n\t\t\tch = fz_read_byte(file);\n\t\t\tif (ch == 'I')\n\t\t\t{\n\t\t\t\tch = fz_peek_byte(file);\n\t\t\t\tif (ch == ' ' || ch <= 32 || ch == EOF || ch == '<' || ch == '/')\n\t\t\t\t{\n\t\t\t\t\tfound = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} while (ch != EOF);\n\tif (!found)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"syntax error after inline image\");\n}\n\nstatic int\npdf_run_keyword(pdf_csi *csi, char *buf)\n{\n\tfz_context *ctx = csi->doc->ctx;\n\tint key;\n\tPDF_OP op;\n\n\tkey = buf[0];\n\tif (buf[1])\n\t{\n\t\tkey |= buf[1] << 8;\n\t\tif (buf[2])\n\t\t{\n\t\t\tkey |= buf[2] << 16;\n\t\t\tif (buf[3])\n\t\t\t\tkey = 0;\n\t\t}\n\t}\n\n\tswitch (key)\n\t{\n\tcase A('\"'): op = PDF_OP_dquote; break;\n\tcase A('\\''): op = PDF_OP_squote; break;\n\tcase A('B'): op = PDF_OP_B; break;\n\tcase B('B','*'): op = PDF_OP_Bstar; break;\n\tcase C('B','D','C'): op = PDF_OP_BDC; break;\n\tcase B('B','I'): op = PDF_OP_BI; break;\n\tcase C('B','M','C'): op = PDF_OP_BMC; break;\n\tcase B('B','T'):\n\t\top = PDF_OP_BT;\n\t\tcsi->in_text = 1;\n\t\tbreak;\n\tcase B('B','X'):\n\t\top = PDF_OP_BX;\n\t\tcsi->xbalance++;\n\t\tbreak;\n\tcase B('C','S'): op = PDF_OP_CS; break;\n\tcase B('D','P'): op = PDF_OP_DP; break;\n\tcase B('D','o'): op = PDF_OP_Do; break;\n\tcase C('E','M','C'): op = PDF_OP_EMC; break;\n\tcase B('E','T'):\n\t\top = PDF_OP_ET;\n\t\tcsi->in_text = 0;\n\t\tbreak;\n\tcase B('E','X'):\n\t\top = PDF_OP_EX;\n\t\tcsi->xbalance--;\n\t\tbreak;\n\tcase A('F'): op = PDF_OP_F; break;\n\tcase A('G'): op = PDF_OP_G; break;\n\tcase A('J'): op = PDF_OP_J; break;\n\tcase A('K'): op = PDF_OP_K; break;\n\tcase A('M'): op = PDF_OP_M; break;\n\tcase B('M','P'): op = PDF_OP_MP; break;\n\tcase A('Q'): op = PDF_OP_Q; break;\n\tcase B('R','G'): op = PDF_OP_RG; break;\n\tcase A('S'): op = PDF_OP_S; break;\n\tcase B('S','C'): op = PDF_OP_SC; break;\n\tcase C('S','C','N'): op = PDF_OP_SCN; break;\n\tcase B('T','*'): op = PDF_OP_Tstar; break;\n\tcase B('T','D'): op = PDF_OP_TD; break;\n\tcase B('T','J'): op = PDF_OP_TJ; break;\n\tcase B('T','L'): op = PDF_OP_TL; break;\n\tcase B('T','c'): op = PDF_OP_Tc; break;\n\tcase B('T','d'): op = PDF_OP_Td; break;\n\tcase B('T','f'): op = PDF_OP_Tf; break;\n\tcase B('T','j'): op = PDF_OP_Tj; break;\n\tcase B('T','m'): op = PDF_OP_Tm; break;\n\tcase B('T','r'): op = PDF_OP_Tr; break;\n\tcase B('T','s'): op = PDF_OP_Ts; break;\n\tcase B('T','w'): op = PDF_OP_Tw; break;\n\tcase B('T','z'): op = PDF_OP_Tz; break;\n\tcase A('W'): op = PDF_OP_W; break;\n\tcase B('W','*'): op = PDF_OP_Wstar; break;\n\tcase A('b'): op = PDF_OP_b; break;\n\tcase B('b','*'): op = PDF_OP_bstar; break;\n\tcase A('c'): op = PDF_OP_c; break;\n\tcase B('c','m'): op = PDF_OP_cm; break;\n\tcase B('c','s'): op = PDF_OP_cs; break;\n\tcase A('d'): op = PDF_OP_d; break;\n\tcase B('d','0'): op = PDF_OP_d0; break;\n\tcase B('d','1'): op = PDF_OP_d1; break;\n\tcase A('f'): op = PDF_OP_f; break;\n\tcase B('f','*'): op = PDF_OP_fstar; break;\n\tcase A('g'): op = PDF_OP_g; break;\n\tcase B('g','s'): op = PDF_OP_gs; break;\n\tcase A('h'): op = PDF_OP_h; break;\n\tcase A('i'): op = PDF_OP_i; break;\n\tcase A('j'): op = PDF_OP_j; break;\n\tcase A('k'): op = PDF_OP_k; break;\n\tcase A('l'): op = PDF_OP_l; break;\n\tcase A('m'): op = PDF_OP_m; break;\n\tcase A('n'): op = PDF_OP_n; break;\n\tcase A('q'): op = PDF_OP_q; break;\n\tcase B('r','e'): op = PDF_OP_re; break;\n\tcase B('r','g'): op = PDF_OP_rg; break;\n\tcase B('r','i'): op = PDF_OP_ri; break;\n\tcase A('s'): op = PDF_OP_s; break;\n\tcase B('s','c'): op = PDF_OP_sc; break;\n\tcase C('s','c','n'): op = PDF_OP_scn; break;\n\tcase B('s','h'): op = PDF_OP_sh; break;\n\tcase A('v'): op = PDF_OP_v; break;\n\tcase A('w'): op = PDF_OP_w; break;\n\tcase A('y'): op = PDF_OP_y; break;\n\tdefault:\n\t\tif (!csi->xbalance)\n\t\t{\n\t\t\tfz_warn(ctx, \"unknown keyword: '%s'\", buf);\n\t\t\treturn 1;\n\t\t}\n\t\treturn 0;\n\t}\n\n\tif (op == PDF_OP_BI)\n\t{\n\t\tparse_inline_image(csi);\n\t}\n\n\tif (op < PDF_OP_Do)\n\t{\n\t\tpdf_process_op(csi, op, &csi->process);\n\t}\n\telse if (op < PDF_OP_END)\n\t{\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tpdf_process_op(csi, op, &csi->process);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_rethrow_if(ctx, FZ_ERROR_ABORT);\n\t\t\tswitch (op)\n\t\t\t{\n\t\t\tcase PDF_OP_Do:\n\t\t\t\tfz_rethrow_message(ctx, \"cannot draw xobject/image\");\n\t\t\t\tbreak;\n\t\t\tcase PDF_OP_Tf:\n\t\t\t\tfz_rethrow_message(ctx, \"cannot set font\");\n\t\t\t\tbreak;\n\t\t\tcase PDF_OP_gs:\n\t\t\t\tfz_rethrow_message(ctx, \"cannot set graphics state\");\n\t\t\t\tbreak;\n\t\t\tcase PDF_OP_sh:\n\t\t\t\tfz_rethrow_message(ctx, \"cannot draw shading\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tfz_rethrow(ctx); /* Should never happen */\n\t\t\t}\n\t\t}\n\t}\n\treturn 0;\n}\n\nvoid\npdf_process_stream(pdf_csi *csi, pdf_lexbuf *buf)\n{\n\tfz_context *ctx = csi->doc->ctx;\n\tfz_stream *file = csi->file;\n\tpdf_token tok = PDF_TOK_ERROR;\n\tint in_text_array = 0;\n\tint ignoring_errors = 0;\n\n\t/* make sure we have a clean slate if we come here from flush_text */\n\tpdf_clear_stack(csi);\n\n\tfz_var(in_text_array);\n\tfz_var(tok);\n\n\tif (csi->cookie)\n\t{\n\t\tcsi->cookie->progress_max = -1;\n\t\tcsi->cookie->progress = 0;\n\t}\n\n\tdo\n\t{\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tdo\n\t\t\t{\n\t\t\t\t/* Check the cookie */\n\t\t\t\tif (csi->cookie)\n\t\t\t\t{\n\t\t\t\t\tif (csi->cookie->abort)\n\t\t\t\t\t{\n\t\t\t\t\t\ttok = PDF_TOK_EOF;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcsi->cookie->progress++;\n\t\t\t\t}\n\n\t\t\t\ttok = pdf_lex(file, buf);\n\n\t\t\t\tif (in_text_array)\n\t\t\t\t{\n\t\t\t\t\tswitch(tok)\n\t\t\t\t\t{\n\t\t\t\t\tcase PDF_TOK_CLOSE_ARRAY:\n\t\t\t\t\t\tin_text_array = 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PDF_TOK_REAL:\n\t\t\t\t\t\tpdf_array_push_drop(csi->obj, pdf_new_real(csi->doc, buf->f));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PDF_TOK_INT:\n\t\t\t\t\t\tpdf_array_push_drop(csi->obj, pdf_new_int(csi->doc, buf->i));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PDF_TOK_STRING:\n\t\t\t\t\t\tpdf_array_push_drop(csi->obj, pdf_new_string(csi->doc, buf->scratch, buf->len));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PDF_TOK_EOF:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PDF_TOK_KEYWORD:\n\t\t\t\t\t\tif (!strcmp(buf->scratch, \"Tw\") || !strcmp(buf->scratch, \"Tc\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint l = pdf_array_len(csi->obj);\n\t\t\t\t\t\t\tif (l > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpdf_obj *o = pdf_array_get(csi->obj, l-1);\n\t\t\t\t\t\t\t\tif (pdf_is_number(o))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcsi->stack[0] = pdf_to_real(o);\n\t\t\t\t\t\t\t\t\tpdf_array_delete(csi->obj, l-1);\n\t\t\t\t\t\t\t\t\tif (pdf_run_keyword(csi, buf->scratch) == 0)\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/* Deliberate Fallthrough! */\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"syntax error in array\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse switch (tok)\n\t\t\t\t{\n\t\t\t\tcase PDF_TOK_ENDSTREAM:\n\t\t\t\tcase PDF_TOK_EOF:\n\t\t\t\t\ttok = PDF_TOK_EOF;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase PDF_TOK_OPEN_ARRAY:\n\t\t\t\t\tif (csi->obj)\n\t\t\t\t\t{\n\t\t\t\t\t\tpdf_drop_obj(csi->obj);\n\t\t\t\t\t\tcsi->obj = NULL;\n\t\t\t\t\t}\n\t\t\t\t\tif (csi->in_text)\n\t\t\t\t\t{\n\t\t\t\t\t\tin_text_array = 1;\n\t\t\t\t\t\tcsi->obj = pdf_new_array(csi->doc, 4);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcsi->obj = pdf_parse_array(csi->doc, file, buf);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase PDF_TOK_OPEN_DICT:\n\t\t\t\t\tif (csi->obj)\n\t\t\t\t\t{\n\t\t\t\t\t\tpdf_drop_obj(csi->obj);\n\t\t\t\t\t\tcsi->obj = NULL;\n\t\t\t\t\t}\n\t\t\t\t\tcsi->obj = pdf_parse_dict(csi->doc, file, buf);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase PDF_TOK_NAME:\n\t\t\t\t\tif (csi->name[0])\n\t\t\t\t\t{\n\t\t\t\t\t\tpdf_drop_obj(csi->obj);\n\t\t\t\t\t\tcsi->obj = NULL;\n\t\t\t\t\t\tcsi->obj = pdf_new_name(csi->doc, buf->scratch);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tfz_strlcpy(csi->name, buf->scratch, sizeof(csi->name));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase PDF_TOK_INT:\n\t\t\t\t\tif (csi->top < nelem(csi->stack)) {\n\t\t\t\t\t\tcsi->stack[csi->top] = buf->i;\n\t\t\t\t\t\tcsi->top ++;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"stack overflow\");\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase PDF_TOK_REAL:\n\t\t\t\t\tif (csi->top < nelem(csi->stack)) {\n\t\t\t\t\t\tcsi->stack[csi->top] = buf->f;\n\t\t\t\t\t\tcsi->top ++;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"stack overflow\");\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase PDF_TOK_STRING:\n\t\t\t\t\tif (buf->len <= sizeof(csi->string))\n\t\t\t\t\t{\n\t\t\t\t\t\tmemcpy(csi->string, buf->scratch, buf->len);\n\t\t\t\t\t\tcsi->string_len = buf->len;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (csi->obj)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpdf_drop_obj(csi->obj);\n\t\t\t\t\t\t\tcsi->obj = NULL;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcsi->obj = pdf_new_string(csi->doc, buf->scratch, buf->len);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase PDF_TOK_KEYWORD:\n\t\t\t\t\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=1982 */\n\t\t\t\t\tif (pdf_run_keyword(csi, buf->scratch) && buf->len > 8)\n\t\t\t\t\t{\n\t\t\t\t\t\ttok = PDF_TOK_EOF;\n\t\t\t\t\t}\n\t\t\t\t\tpdf_clear_stack(csi);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"syntax error in content stream\");\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (tok != PDF_TOK_EOF);\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tpdf_clear_stack(csi);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tint caught;\n\n\t\t\tif (!csi->cookie)\n\t\t\t{\n\t\t\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\t\t\t/* SumatraPDF: abort processing also without error cookie */\n\t\t\t\tfz_rethrow_if(ctx, FZ_ERROR_ABORT);\n\t\t\t}\n\t\t\telse if ((caught = fz_caught(ctx)) == FZ_ERROR_TRYLATER)\n\t\t\t{\n\t\t\t\tif (csi->cookie->incomplete_ok)\n\t\t\t\t\tcsi->cookie->incomplete++;\n\t\t\t\telse\n\t\t\t\t\tfz_rethrow(ctx);\n\t\t\t}\n\t\t\telse if (caught == FZ_ERROR_ABORT)\n\t\t\t{\n\t\t\t\tfz_rethrow(ctx);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t csi->cookie->errors++;\n\t\t\t}\n\t\t\tif (!ignoring_errors)\n\t\t\t{\n\t\t\t\tfz_warn(ctx, \"Ignoring errors during rendering\");\n\t\t\t\tignoring_errors = 1;\n\t\t\t}\n\t\t\t/* If we do catch an error, then reset ourselves to a\n\t\t\t * base lexing state */\n\t\t\tin_text_array = 0;\n\t\t\t/* SumatraPDF: clear the stack on errors */\n\t\t\tpdf_clear_stack(csi);\n\t\t}\n\t}\n\twhile (tok != PDF_TOK_EOF);\n}\n\n/*\n * Entry points\n */\n\nstatic void\npdf_process_contents_stream(pdf_csi *csi, pdf_obj *rdb, fz_stream *file)\n{\n\tfz_context *ctx = csi->doc->ctx;\n\tpdf_lexbuf *buf;\n\tint save_in_text;\n\tpdf_obj *save_obj;\n\tpdf_obj *save_rdb = csi->rdb;\n\tfz_stream *save_file = csi->file;\n\n\tfz_var(buf);\n\n\tif (file == NULL)\n\t\treturn;\n\n\tbuf = fz_malloc(ctx, sizeof(*buf)); /* we must be re-entrant for type3 fonts */\n\tpdf_lexbuf_init(ctx, buf, PDF_LEXBUF_SMALL);\n\tsave_in_text = csi->in_text;\n\tcsi->in_text = 0;\n\tsave_obj = csi->obj;\n\tcsi->obj = NULL;\n\tcsi->rdb = rdb;\n\tcsi->file = file;\n\tfz_try(ctx)\n\t{\n\t\tcsi->process.processor->process_stream(csi, csi->process.state, buf);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tcsi->in_text = save_in_text;\n\t\tpdf_drop_obj(csi->obj);\n\t\tcsi->obj = save_obj;\n\t\tcsi->rdb = save_rdb;\n\t\tcsi->file = save_file;\n\t\tpdf_lexbuf_fin(buf);\n\t\tfz_free(ctx, buf);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\tfz_rethrow_if(ctx, FZ_ERROR_ABORT);\n\t\tfz_warn(ctx, \"Content stream parsing error - rendering truncated\");\n\t}\n}\n\nvoid\npdf_process_annot(pdf_document *doc, pdf_page *page, pdf_annot *annot, const pdf_process *process, fz_cookie *cookie)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_csi *csi;\n\tint flags;\n\n\tcsi = pdf_new_csi(doc, cookie, process);\n\tfz_try(ctx)\n\t{\n\t\tflags = pdf_to_int(pdf_dict_gets(annot->obj, \"F\"));\n\n\t\t/* Check not invisible (bit 0) and hidden (bit 1) */\n\t\t/* TODO: NoZoom and NoRotate */\n\t\tif (flags & ((1 << 0) | (1 << 1)))\n\t\t\tbreak;\n\n\t\tcsi->process.processor->process_annot(csi, csi->process.state, page->resources, annot);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_free_csi(csi);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_message(ctx, \"cannot parse annotation appearance stream\");\n\t}\n}\n\nvoid\npdf_process_contents_object(pdf_csi *csi, pdf_obj *rdb, pdf_obj *contents)\n{\n\tfz_context *ctx = csi->doc->ctx;\n\tfz_stream *file = NULL;\n\n\tif (contents == NULL)\n\t\treturn;\n\n\tfile = pdf_open_contents_stream(csi->doc, contents);\n\tfz_try(ctx)\n\t{\n\t\tpdf_process_contents_stream(csi, rdb, file);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(file);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void\npdf_process_contents_buffer(pdf_csi *csi, pdf_obj *rdb, fz_buffer *contents)\n{\n\tfz_context *ctx = csi->doc->ctx;\n\tfz_stream *file = NULL;\n\n\tif (contents == NULL)\n\t\treturn;\n\n\tfile = fz_open_buffer(ctx, contents);\n\tfz_try(ctx)\n\t{\n\t\tpdf_process_contents_stream(csi, rdb, file);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(file);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nvoid\npdf_process_stream_object(pdf_document *doc, pdf_obj *obj, const pdf_process *process, pdf_obj *res, fz_cookie *cookie)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_csi *csi;\n\n\tcsi = pdf_new_csi(doc, cookie, process);\n\tfz_try(ctx)\n\t{\n\t\tcsi->process.processor->process_contents(csi, csi->process.state, res, obj);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_free_csi(csi);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_if(ctx, FZ_ERROR_ABORT);\n\t\tfz_rethrow_message(ctx, \"cannot parse content stream\");\n\t}\n}\n\nvoid\npdf_process_glyph(pdf_document *doc, pdf_obj *resources, fz_buffer *contents, pdf_process *process)\n{\n\tpdf_csi *csi;\n\tfz_context *ctx = doc->ctx;\n\n\tcsi = pdf_new_csi(doc, NULL, process);\n\tfz_try(ctx)\n\t{\n\t\tpdf_process_contents_buffer(csi, resources, contents);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_free_csi(csi);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_if(ctx, FZ_ERROR_ABORT);\n\t\tfz_rethrow_message(ctx, \"cannot parse glyph content stream\");\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-lex.c",
    "content": "#include \"mupdf/pdf.h\"\n\n#define IS_NUMBER \\\n\t'+':case'-':case'.':case'0':case'1':case'2':case'3':\\\n\tcase'4':case'5':case'6':case'7':case'8':case'9'\n#define IS_WHITE \\\n\t'\\000':case'\\011':case'\\012':case'\\014':case'\\015':case'\\040'\n#define IS_HEX \\\n\t'0':case'1':case'2':case'3':case'4':case'5':case'6':\\\n\tcase'7':case'8':case'9':case'A':case'B':case'C':\\\n\tcase'D':case'E':case'F':case'a':case'b':case'c':\\\n\tcase'd':case'e':case'f'\n#define IS_DELIM \\\n\t'(':case')':case'<':case'>':case'[':case']':case'{':\\\n\tcase'}':case'/':case'%'\n\n#define RANGE_0_9 \\\n\t'0':case'1':case'2':case'3':case'4':case'5':\\\n\tcase'6':case'7':case'8':case'9'\n#define RANGE_a_f \\\n\t'a':case'b':case'c':case'd':case'e':case'f'\n#define RANGE_A_F \\\n\t'A':case'B':case'C':case'D':case'E':case'F'\n#define RANGE_0_7 \\\n\t'0':case'1':case'2':case'3':case'4':case'5':case'6':case'7'\n\nstatic inline int iswhite(int ch)\n{\n\treturn\n\t\tch == '\\000' ||\n\t\tch == '\\011' ||\n\t\tch == '\\012' ||\n\t\tch == '\\014' ||\n\t\tch == '\\015' ||\n\t\tch == '\\040';\n}\n\nstatic inline int unhex(int ch)\n{\n\tif (ch >= '0' && ch <= '9') return ch - '0';\n\tif (ch >= 'A' && ch <= 'F') return ch - 'A' + 0xA;\n\tif (ch >= 'a' && ch <= 'f') return ch - 'a' + 0xA;\n\treturn 0;\n}\n\nstatic void\nlex_white(fz_stream *f)\n{\n\tint c;\n\tdo {\n\t\tc = fz_read_byte(f);\n\t} while ((c <= 32) && (iswhite(c)));\n\tif (c != EOF)\n\t\tfz_unread_byte(f);\n}\n\nstatic void\nlex_comment(fz_stream *f)\n{\n\tint c;\n\tdo {\n\t\tc = fz_read_byte(f);\n\t} while ((c != '\\012') && (c != '\\015') && (c != EOF));\n}\n\nstatic int\nlex_number(fz_stream *f, pdf_lexbuf *buf, int c)\n{\n\tint neg = 0;\n\tint i = 0;\n\tint n;\n\tint d;\n\tfloat v;\n\n\t/* Initially we might have +, -, . or a digit */\n\tswitch (c)\n\t{\n\tcase '.':\n\t\tgoto loop_after_dot;\n\tcase '-':\n\t\tneg = 1;\n\t\tbreak;\n\tcase '+':\n\t\tbreak;\n\tdefault: /* Must be a digit */\n\t\ti = c - '0';\n\t\tbreak;\n\t}\n\n\twhile (1)\n\t{\n\t\tc = fz_read_byte(f);\n\t\tswitch (c)\n\t\t{\n\t\tcase '.':\n\t\t\tgoto loop_after_dot;\n\t\tcase RANGE_0_9:\n\t\t\ti = 10*i + c - '0';\n\t\t\t/* FIXME: Need overflow check here; do we care? */\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tfz_unread_byte(f);\n\t\t\t/* Fallthrough */\n\t\tcase EOF:\n\t\t\tif (neg)\n\t\t\t\ti = -i;\n\t\t\tbuf->i = i;\n\t\t\treturn PDF_TOK_INT;\n\t\t}\n\t}\n\n\t/* In here, we've seen a dot, so can accept just digits */\nloop_after_dot:\n\tn = 0;\n\td = 1;\n\twhile (1)\n\t{\n\t\tc = fz_read_byte(f);\n\t\tswitch (c)\n\t\t{\n\t\tcase RANGE_0_9:\n\t\t\tif (d >= INT_MAX/10)\n\t\t\t\tgoto underflow;\n\t\t\tn = n*10 + (c - '0');\n\t\t\td *= 10;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tfz_unread_byte(f);\n\t\t\t/* Fallthrough */\n\t\tcase EOF:\n\t\t\tv = (float)i + ((float)n / (float)d);\n\t\t\tif (neg)\n\t\t\t\tv = -v;\n\t\t\tbuf->f = v;\n\t\t\treturn PDF_TOK_REAL;\n\t\t}\n\t}\n\nunderflow:\n\t/* Ignore any digits after here, because they are too small */\n\twhile (1)\n\t{\n\t\tc = fz_read_byte(f);\n\t\tswitch (c)\n\t\t{\n\t\tcase RANGE_0_9:\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tfz_unread_byte(f);\n\t\t\t/* Fallthrough */\n\t\tcase EOF:\n\t\t\tv = (float)i + ((float)n / (float)d);\n\t\t\tif (neg)\n\t\t\t\tv = -v;\n\t\t\tbuf->f = v;\n\t\t\treturn PDF_TOK_REAL;\n\t\t}\n\t}\n}\n\nstatic void\nlex_name(fz_stream *f, pdf_lexbuf *buf)\n{\n\tchar *s = buf->scratch;\n\tint n = buf->size;\n\n\twhile (n > 1)\n\t{\n\t\tint c = fz_read_byte(f);\n\t\tswitch (c)\n\t\t{\n\t\tcase IS_WHITE:\n\t\tcase IS_DELIM:\n\t\t\tfz_unread_byte(f);\n\t\t\tgoto end;\n\t\tcase EOF:\n\t\t\tgoto end;\n\t\tcase '#':\n\t\t{\n\t\t\tint d;\n\t\t\tc = fz_read_byte(f);\n\t\t\tswitch (c)\n\t\t\t{\n\t\t\tcase RANGE_0_9:\n\t\t\t\td = (c - '0') << 4;\n\t\t\t\tbreak;\n\t\t\tcase RANGE_a_f:\n\t\t\t\td = (c - 'a' + 10) << 4;\n\t\t\t\tbreak;\n\t\t\tcase RANGE_A_F:\n\t\t\t\td = (c - 'A' + 10) << 4;\n\t\t\t\tbreak;\n\t\t\t/* cf. https://code.google.com/p/sumatrapdf/issues/detail?id=2300 */\n\t\t\tcase '#':\n\t\t\t\tfz_unread_byte(f);\n\t\t\t\t*s++ = '#';\n\t\t\t\tn--;\n\t\t\t\tcontinue;\n\t\t\tdefault:\n\t\t\t\tfz_unread_byte(f);\n\t\t\t\t/* fallthrough */\n\t\t\tcase EOF:\n\t\t\t\tgoto end;\n\t\t\t}\n\t\t\tc = fz_read_byte(f);\n\t\t\tswitch (c)\n\t\t\t{\n\t\t\tcase RANGE_0_9:\n\t\t\t\tc -= '0';\n\t\t\t\tbreak;\n\t\t\tcase RANGE_a_f:\n\t\t\t\tc -= 'a' - 10;\n\t\t\t\tbreak;\n\t\t\tcase RANGE_A_F:\n\t\t\t\tc -= 'A' - 10;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tfz_unread_byte(f);\n\t\t\t\t/* fallthrough */\n\t\t\tcase EOF:\n\t\t\t\t*s++ = d;\n\t\t\t\tn--;\n\t\t\t\tgoto end;\n\t\t\t}\n\t\t\t*s++ = d + c;\n\t\t\tn--;\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\t*s++ = c;\n\t\t\tn--;\n\t\t\tbreak;\n\t\t}\n\t}\nend:\n\t*s = '\\0';\n\tbuf->len = s - buf->scratch;\n}\n\nstatic int\nlex_string(fz_stream *f, pdf_lexbuf *lb)\n{\n\tchar *s = lb->scratch;\n\tchar *e = s + lb->size;\n\tint bal = 1;\n\tint oct;\n\tint c;\n\n\twhile (1)\n\t{\n\t\tif (s == e)\n\t\t{\n\t\t\ts += pdf_lexbuf_grow(lb);\n\t\t\te = lb->scratch + lb->size;\n\t\t}\n\t\tc = fz_read_byte(f);\n\t\tswitch (c)\n\t\t{\n\t\tcase EOF:\n\t\t\tgoto end;\n\t\tcase '(':\n\t\t\tbal++;\n\t\t\t*s++ = c;\n\t\t\tbreak;\n\t\tcase ')':\n\t\t\tbal --;\n\t\t\tif (bal == 0)\n\t\t\t\tgoto end;\n\t\t\t*s++ = c;\n\t\t\tbreak;\n\t\tcase '\\\\':\n\t\t\tc = fz_read_byte(f);\n\t\t\tswitch (c)\n\t\t\t{\n\t\t\tcase EOF:\n\t\t\t\tgoto end;\n\t\t\tcase 'n':\n\t\t\t\t*s++ = '\\n';\n\t\t\t\tbreak;\n\t\t\tcase 'r':\n\t\t\t\t*s++ = '\\r';\n\t\t\t\tbreak;\n\t\t\tcase 't':\n\t\t\t\t*s++ = '\\t';\n\t\t\t\tbreak;\n\t\t\tcase 'b':\n\t\t\t\t*s++ = '\\b';\n\t\t\t\tbreak;\n\t\t\tcase 'f':\n\t\t\t\t*s++ = '\\f';\n\t\t\t\tbreak;\n\t\t\tcase '(':\n\t\t\t\t*s++ = '(';\n\t\t\t\tbreak;\n\t\t\tcase ')':\n\t\t\t\t*s++ = ')';\n\t\t\t\tbreak;\n\t\t\tcase '\\\\':\n\t\t\t\t*s++ = '\\\\';\n\t\t\t\tbreak;\n\t\t\tcase RANGE_0_7:\n\t\t\t\toct = c - '0';\n\t\t\t\tc = fz_read_byte(f);\n\t\t\t\tif (c >= '0' && c <= '7')\n\t\t\t\t{\n\t\t\t\t\toct = oct * 8 + (c - '0');\n\t\t\t\t\tc = fz_read_byte(f);\n\t\t\t\t\tif (c >= '0' && c <= '7')\n\t\t\t\t\t\toct = oct * 8 + (c - '0');\n\t\t\t\t\telse if (c != EOF)\n\t\t\t\t\t\tfz_unread_byte(f);\n\t\t\t\t}\n\t\t\t\telse if (c != EOF)\n\t\t\t\t\tfz_unread_byte(f);\n\t\t\t\t*s++ = oct;\n\t\t\t\tbreak;\n\t\t\tcase '\\n':\n\t\t\t\tbreak;\n\t\t\tcase '\\r':\n\t\t\t\tc = fz_read_byte(f);\n\t\t\t\tif ((c != '\\n') && (c != EOF))\n\t\t\t\t\tfz_unread_byte(f);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t*s++ = c;\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t*s++ = c;\n\t\t\tbreak;\n\t\t}\n\t}\nend:\n\tlb->len = s - lb->scratch;\n\treturn PDF_TOK_STRING;\n}\n\nstatic int\nlex_hex_string(fz_stream *f, pdf_lexbuf *lb)\n{\n\tchar *s = lb->scratch;\n\tchar *e = s + lb->size;\n\tint a = 0, x = 0;\n\tint c;\n\n\twhile (1)\n\t{\n\t\tif (s == e)\n\t\t{\n\t\t\ts += pdf_lexbuf_grow(lb);\n\t\t\te = lb->scratch + lb->size;\n\t\t}\n\t\tc = fz_read_byte(f);\n\t\tswitch (c)\n\t\t{\n\t\tcase IS_WHITE:\n\t\t\tbreak;\n\t\tcase IS_HEX:\n\t\t\tif (x)\n\t\t\t{\n\t\t\t\t*s++ = a * 16 + unhex(c);\n\t\t\t\tx = !x;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ta = unhex(c);\n\t\t\t\tx = !x;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '>':\n\t\tcase EOF:\n\t\t\tgoto end;\n\t\tdefault:\n\t\t\tfz_warn(f->ctx, \"ignoring invalid character in hex string\");\n\t\t}\n\t}\nend:\n\tlb->len = s - lb->scratch;\n\treturn PDF_TOK_STRING;\n}\n\nstatic pdf_token\npdf_token_from_keyword(char *key)\n{\n\tswitch (*key)\n\t{\n\tcase 'R':\n\t\tif (!strcmp(key, \"R\")) return PDF_TOK_R;\n\t\tbreak;\n\tcase 't':\n\t\tif (!strcmp(key, \"true\")) return PDF_TOK_TRUE;\n\t\tif (!strcmp(key, \"trailer\")) return PDF_TOK_TRAILER;\n\t\tbreak;\n\tcase 'f':\n\t\tif (!strcmp(key, \"false\")) return PDF_TOK_FALSE;\n\t\tbreak;\n\tcase 'n':\n\t\tif (!strcmp(key, \"null\")) return PDF_TOK_NULL;\n\t\tbreak;\n\tcase 'o':\n\t\tif (!strcmp(key, \"obj\")) return PDF_TOK_OBJ;\n\t\tbreak;\n\tcase 'e':\n\t\tif (!strcmp(key, \"endobj\")) return PDF_TOK_ENDOBJ;\n\t\tif (!strcmp(key, \"endstream\")) return PDF_TOK_ENDSTREAM;\n\t\tbreak;\n\tcase 's':\n\t\tif (!strcmp(key, \"stream\")) return PDF_TOK_STREAM;\n\t\tif (!strcmp(key, \"startxref\")) return PDF_TOK_STARTXREF;\n\t\tbreak;\n\tcase 'x':\n\t\tif (!strcmp(key, \"xref\")) return PDF_TOK_XREF;\n\t\tbreak;\n\tdefault:\n\t\tbreak;\n\t}\n\n\treturn PDF_TOK_KEYWORD;\n}\n\nvoid pdf_lexbuf_init(fz_context *ctx, pdf_lexbuf *lb, int size)\n{\n\tlb->size = lb->base_size = size;\n\tlb->len = 0;\n\tlb->ctx = ctx;\n\tlb->scratch = &lb->buffer[0];\n}\n\nvoid pdf_lexbuf_fin(pdf_lexbuf *lb)\n{\n\tif (lb && lb->size != lb->base_size)\n\t\tfz_free(lb->ctx, lb->scratch);\n}\n\nptrdiff_t pdf_lexbuf_grow(pdf_lexbuf *lb)\n{\n\tchar *old = lb->scratch;\n\tint newsize = lb->size * 2;\n\tif (lb->size == lb->base_size)\n\t{\n\t\tlb->scratch = fz_malloc(lb->ctx, newsize);\n\t\tmemcpy(lb->scratch, lb->buffer, lb->size);\n\t}\n\telse\n\t{\n\t\tlb->scratch = fz_resize_array(lb->ctx, lb->scratch, newsize, 1);\n\t}\n\tlb->size = newsize;\n\treturn lb->scratch - old;\n}\n\npdf_token\npdf_lex(fz_stream *f, pdf_lexbuf *buf)\n{\n\twhile (1)\n\t{\n\t\tint c = fz_read_byte(f);\n\t\tswitch (c)\n\t\t{\n\t\tcase EOF:\n\t\t\treturn PDF_TOK_EOF;\n\t\tcase IS_WHITE:\n\t\t\tlex_white(f);\n\t\t\tbreak;\n\t\tcase '%':\n\t\t\tlex_comment(f);\n\t\t\tbreak;\n\t\tcase '/':\n\t\t\tlex_name(f, buf);\n\t\t\treturn PDF_TOK_NAME;\n\t\tcase '(':\n\t\t\treturn lex_string(f, buf);\n\t\tcase ')':\n\t\t\tfz_warn(f->ctx, \"lexical error (unexpected ')')\");\n\t\t\tcontinue;\n\t\tcase '<':\n\t\t\tc = fz_read_byte(f);\n\t\t\tif (c == '<')\n\t\t\t{\n\t\t\t\treturn PDF_TOK_OPEN_DICT;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfz_unread_byte(f);\n\t\t\t\treturn lex_hex_string(f, buf);\n\t\t\t}\n\t\tcase '>':\n\t\t\tc = fz_read_byte(f);\n\t\t\tif (c == '>')\n\t\t\t{\n\t\t\t\treturn PDF_TOK_CLOSE_DICT;\n\t\t\t}\n\t\t\tfz_warn(f->ctx, \"lexical error (unexpected '>')\");\n\t\t\tif (c == EOF)\n\t\t\t{\n\t\t\t\treturn PDF_TOK_EOF;\n\t\t\t}\n\t\t\tfz_unread_byte(f);\n\t\t\tcontinue;\n\t\tcase '[':\n\t\t\treturn PDF_TOK_OPEN_ARRAY;\n\t\tcase ']':\n\t\t\treturn PDF_TOK_CLOSE_ARRAY;\n\t\tcase '{':\n\t\t\treturn PDF_TOK_OPEN_BRACE;\n\t\tcase '}':\n\t\t\treturn PDF_TOK_CLOSE_BRACE;\n\t\tcase IS_NUMBER:\n\t\t\t/* cf. https://code.google.com/p/sumatrapdf/issues/detail?id=2231 */\n\t\t\t{\n\t\t\t\tint tok = lex_number(f, buf, c);\n\t\t\t\twhile (1)\n\t\t\t\t{\n\t\t\t\t\tc = fz_peek_byte(f);\n\t\t\t\t\tswitch (c)\n\t\t\t\t\t{\n\t\t\t\t\tcase IS_NUMBER:\n\t\t\t\t\t\tfz_warn(f->ctx, \"ignoring invalid character after number: '%c'\", c);\n\t\t\t\t\t\tfz_read_byte(f);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn tok;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tdefault: /* isregular: !isdelim && !iswhite && c != EOF */\n\t\t\tfz_unread_byte(f);\n\t\t\tlex_name(f, buf);\n\t\t\treturn pdf_token_from_keyword(buf->scratch);\n\t\t}\n\t}\n}\n\npdf_token\npdf_lex_no_string(fz_stream *f, pdf_lexbuf *buf)\n{\n\twhile (1)\n\t{\n\t\tint c = fz_read_byte(f);\n\t\tswitch (c)\n\t\t{\n\t\tcase EOF:\n\t\t\treturn PDF_TOK_EOF;\n\t\tcase IS_WHITE:\n\t\t\tlex_white(f);\n\t\t\tbreak;\n\t\tcase '%':\n\t\t\tlex_comment(f);\n\t\t\tbreak;\n\t\tcase '/':\n\t\t\tlex_name(f, buf);\n\t\t\treturn PDF_TOK_NAME;\n\t\tcase '(':\n\t\t\tcontinue;\n\t\tcase ')':\n\t\t\tcontinue;\n\t\tcase '<':\n\t\t\tc = fz_read_byte(f);\n\t\t\tif (c == '<')\n\t\t\t{\n\t\t\t\treturn PDF_TOK_OPEN_DICT;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\tcase '>':\n\t\t\tc = fz_read_byte(f);\n\t\t\tif (c == '>')\n\t\t\t{\n\t\t\t\treturn PDF_TOK_CLOSE_DICT;\n\t\t\t}\n\t\t\tif (c == EOF)\n\t\t\t{\n\t\t\t\treturn PDF_TOK_EOF;\n\t\t\t}\n\t\t\tfz_unread_byte(f);\n\t\t\tcontinue;\n\t\tcase '[':\n\t\t\treturn PDF_TOK_OPEN_ARRAY;\n\t\tcase ']':\n\t\t\treturn PDF_TOK_CLOSE_ARRAY;\n\t\tcase '{':\n\t\t\treturn PDF_TOK_OPEN_BRACE;\n\t\tcase '}':\n\t\t\treturn PDF_TOK_CLOSE_BRACE;\n\t\tcase IS_NUMBER:\n\t\t\treturn lex_number(f, buf, c);\n\t\tdefault: /* isregular: !isdelim && !iswhite && c != EOF */\n\t\t\tfz_unread_byte(f);\n\t\t\tlex_name(f, buf);\n\t\t\treturn pdf_token_from_keyword(buf->scratch);\n\t\t}\n\t}\n}\n\nvoid pdf_print_token(fz_context *ctx, fz_buffer *fzbuf, int tok, pdf_lexbuf *buf)\n{\n\tswitch (tok)\n\t{\n\tcase PDF_TOK_NAME:\n\t\tfz_buffer_printf(ctx, fzbuf, \"/%s\", buf->scratch);\n\t\tbreak;\n\tcase PDF_TOK_STRING:\n\t\tif (buf->len >= buf->size)\n\t\t\tpdf_lexbuf_grow(buf);\n\t\tbuf->scratch[buf->len] = 0;\n\t\tfz_buffer_cat_pdf_string(ctx, fzbuf, buf->scratch);\n\t\tbreak;\n\tcase PDF_TOK_OPEN_DICT:\n\t\tfz_buffer_printf(ctx, fzbuf, \"<<\");\n\t\tbreak;\n\tcase PDF_TOK_CLOSE_DICT:\n\t\tfz_buffer_printf(ctx, fzbuf, \">>\");\n\t\tbreak;\n\tcase PDF_TOK_OPEN_ARRAY:\n\t\tfz_buffer_printf(ctx, fzbuf, \"[\");\n\t\tbreak;\n\tcase PDF_TOK_CLOSE_ARRAY:\n\t\tfz_buffer_printf(ctx, fzbuf, \"]\");\n\t\tbreak;\n\tcase PDF_TOK_OPEN_BRACE:\n\t\tfz_buffer_printf(ctx, fzbuf, \"{\");\n\t\tbreak;\n\tcase PDF_TOK_CLOSE_BRACE:\n\t\tfz_buffer_printf(ctx, fzbuf, \"}\");\n\t\tbreak;\n\tcase PDF_TOK_INT:\n\t\tfz_buffer_printf(ctx, fzbuf, \"%d\", buf->i);\n\t\tbreak;\n\tcase PDF_TOK_REAL:\n\t\t{\n\t\t\tfz_buffer_printf(ctx, fzbuf, \"%g\", buf->f);\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tfz_buffer_printf(ctx, fzbuf, \"%s\", buf->scratch);\n\t\tbreak;\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-metrics.c",
    "content": "#include \"mupdf/pdf.h\"\n\nvoid\npdf_set_font_wmode(fz_context *ctx, pdf_font_desc *font, int wmode)\n{\n\tfont->wmode = wmode;\n}\n\nvoid\npdf_set_default_hmtx(fz_context *ctx, pdf_font_desc *font, int w)\n{\n\tfont->dhmtx.w = w;\n}\n\nvoid\npdf_set_default_vmtx(fz_context *ctx, pdf_font_desc *font, int y, int w)\n{\n\tfont->dvmtx.y = y;\n\tfont->dvmtx.w = w;\n}\n\nvoid\npdf_add_hmtx(fz_context *ctx, pdf_font_desc *font, int lo, int hi, int w)\n{\n\tif (font->hmtx_len + 1 >= font->hmtx_cap)\n\t{\n\t\tint new_cap = font->hmtx_cap + 16;\n\t\tfont->hmtx = fz_resize_array(ctx, font->hmtx, new_cap, sizeof(pdf_hmtx));\n\t\tfont->hmtx_cap = new_cap;\n\t}\n\n\tfont->hmtx[font->hmtx_len].lo = lo;\n\tfont->hmtx[font->hmtx_len].hi = hi;\n\tfont->hmtx[font->hmtx_len].w = w;\n\tfont->hmtx_len++;\n}\n\nvoid\npdf_add_vmtx(fz_context *ctx, pdf_font_desc *font, int lo, int hi, int x, int y, int w)\n{\n\tif (font->vmtx_len + 1 >= font->vmtx_cap)\n\t{\n\t\tint new_cap = font->vmtx_cap + 16;\n\t\tfont->vmtx = fz_resize_array(ctx, font->vmtx, new_cap, sizeof(pdf_vmtx));\n\t\tfont->vmtx_cap = new_cap;\n\t}\n\n\tfont->vmtx[font->vmtx_len].lo = lo;\n\tfont->vmtx[font->vmtx_len].hi = hi;\n\tfont->vmtx[font->vmtx_len].x = x;\n\tfont->vmtx[font->vmtx_len].y = y;\n\tfont->vmtx[font->vmtx_len].w = w;\n\tfont->vmtx_len++;\n}\n\nstatic int cmph(const void *a0, const void *b0)\n{\n\tpdf_hmtx *a = (pdf_hmtx*)a0;\n\tpdf_hmtx *b = (pdf_hmtx*)b0;\n\treturn a->lo - b->lo;\n}\n\nstatic int cmpv(const void *a0, const void *b0)\n{\n\tpdf_vmtx *a = (pdf_vmtx*)a0;\n\tpdf_vmtx *b = (pdf_vmtx*)b0;\n\treturn a->lo - b->lo;\n}\n\nvoid\npdf_end_hmtx(fz_context *ctx, pdf_font_desc *font)\n{\n\tif (!font->hmtx)\n\t\treturn;\n\tqsort(font->hmtx, font->hmtx_len, sizeof(pdf_hmtx), cmph);\n\tfont->size += font->hmtx_cap * sizeof(pdf_hmtx);\n}\n\nvoid\npdf_end_vmtx(fz_context *ctx, pdf_font_desc *font)\n{\n\tif (!font->vmtx)\n\t\treturn;\n\tqsort(font->vmtx, font->vmtx_len, sizeof(pdf_vmtx), cmpv);\n\tfont->size += font->vmtx_cap * sizeof(pdf_vmtx);\n}\n\npdf_hmtx\npdf_lookup_hmtx(fz_context *ctx, pdf_font_desc *font, int cid)\n{\n\tint l = 0;\n\tint r = font->hmtx_len - 1;\n\tint m;\n\n\tif (!font->hmtx)\n\t\tgoto notfound;\n\n\twhile (l <= r)\n\t{\n\t\tm = (l + r) >> 1;\n\t\tif (cid < font->hmtx[m].lo)\n\t\t\tr = m - 1;\n\t\telse if (cid > font->hmtx[m].hi)\n\t\t\tl = m + 1;\n\t\telse\n\t\t\treturn font->hmtx[m];\n\t}\n\nnotfound:\n\treturn font->dhmtx;\n}\n\npdf_vmtx\npdf_lookup_vmtx(fz_context *ctx, pdf_font_desc *font, int cid)\n{\n\tpdf_hmtx h;\n\tpdf_vmtx v;\n\tint l = 0;\n\tint r = font->vmtx_len - 1;\n\tint m;\n\n\tif (!font->vmtx)\n\t\tgoto notfound;\n\n\twhile (l <= r)\n\t{\n\t\tm = (l + r) >> 1;\n\t\tif (cid < font->vmtx[m].lo)\n\t\t\tr = m - 1;\n\t\telse if (cid > font->vmtx[m].hi)\n\t\t\tl = m + 1;\n\t\telse\n\t\t\treturn font->vmtx[m];\n\t}\n\nnotfound:\n\th = pdf_lookup_hmtx(ctx, font, cid);\n\tv = font->dvmtx;\n\tv.x = h.w / 2;\n\treturn v;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-nametree.c",
    "content": "#include \"mupdf/pdf.h\"\n\nstatic pdf_obj *\npdf_lookup_name_imp(fz_context *ctx, pdf_obj *node, pdf_obj *needle)\n{\n\tpdf_obj *kids = pdf_dict_gets(node, \"Kids\");\n\tpdf_obj *names = pdf_dict_gets(node, \"Names\");\n\n\tif (pdf_is_array(kids))\n\t{\n\t\tint l = 0;\n\t\tint r = pdf_array_len(kids) - 1;\n\n\t\twhile (l <= r)\n\t\t{\n\t\t\tint m = (l + r) >> 1;\n\t\t\tpdf_obj *kid = pdf_array_get(kids, m);\n\t\t\tpdf_obj *limits = pdf_dict_gets(kid, \"Limits\");\n\t\t\tpdf_obj *first = pdf_array_get(limits, 0);\n\t\t\tpdf_obj *last = pdf_array_get(limits, 1);\n\n\t\t\tif (pdf_objcmp(needle, first) < 0)\n\t\t\t\tr = m - 1;\n\t\t\telse if (pdf_objcmp(needle, last) > 0)\n\t\t\t\tl = m + 1;\n\t\t\telse\n\t\t\t{\n\t\t\t\tpdf_obj *obj;\n\n\t\t\t\tif (pdf_mark_obj(node))\n\t\t\t\t\tbreak;\n\t\t\t\tobj = pdf_lookup_name_imp(ctx, kid, needle);\n\t\t\t\tpdf_unmark_obj(node);\n\t\t\t\treturn obj;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (pdf_is_array(names))\n\t{\n\t\tint l = 0;\n\t\tint r = (pdf_array_len(names) / 2) - 1;\n\n\t\twhile (l <= r)\n\t\t{\n\t\t\tint m = (l + r) >> 1;\n\t\t\tint c;\n\t\t\tpdf_obj *key = pdf_array_get(names, m * 2);\n\t\t\tpdf_obj *val = pdf_array_get(names, m * 2 + 1);\n\n\t\t\tc = pdf_objcmp(needle, key);\n\t\t\tif (c < 0)\n\t\t\t\tr = m - 1;\n\t\t\telse if (c > 0)\n\t\t\t\tl = m + 1;\n\t\t\telse\n\t\t\t\treturn val;\n\t\t}\n\n\t\t/* Spec says names should be sorted (hence the binary search,\n\t\t * above), but Acrobat copes with non-sorted. Drop back to a\n\t\t * simple search if the binary search fails. */\n\t\tr = pdf_array_len(names)/2;\n\t\tfor (l = 0; l < r; l++)\n\t\t\tif (!pdf_objcmp(needle, pdf_array_get(names, l * 2)))\n\t\t\t\treturn pdf_array_get(names, l * 2 + 1);\n\t}\n\n\treturn NULL;\n}\n\npdf_obj *\npdf_lookup_name(pdf_document *doc, char *which, pdf_obj *needle)\n{\n\tfz_context *ctx = doc->ctx;\n\n\tpdf_obj *root = pdf_dict_gets(pdf_trailer(doc), \"Root\");\n\tpdf_obj *names = pdf_dict_gets(root, \"Names\");\n\tpdf_obj *tree = pdf_dict_gets(names, which);\n\treturn pdf_lookup_name_imp(ctx, tree, needle);\n}\n\npdf_obj *\npdf_lookup_dest(pdf_document *doc, pdf_obj *needle)\n{\n\tfz_context *ctx = doc->ctx;\n\n\tpdf_obj *root = pdf_dict_gets(pdf_trailer(doc), \"Root\");\n\tpdf_obj *dests = pdf_dict_gets(root, \"Dests\");\n\tpdf_obj *names = pdf_dict_gets(root, \"Names\");\n\tpdf_obj *dest = NULL;\n\n\t/* PDF 1.1 has destinations in a dictionary */\n\tif (dests)\n\t{\n\t\tif (pdf_is_name(needle))\n\t\t\treturn pdf_dict_get(dests, needle);\n\t\telse\n\t\t\treturn pdf_dict_gets(dests, pdf_to_str_buf(needle));\n\t}\n\n\t/* PDF 1.2 has destinations in a name tree */\n\tif (names && !dest)\n\t{\n\t\tpdf_obj *tree = pdf_dict_gets(names, \"Dests\");\n\t\treturn pdf_lookup_name_imp(ctx, tree, needle);\n\t}\n\n\treturn NULL;\n}\n\nstatic void\npdf_load_name_tree_imp(pdf_obj *dict, pdf_document *doc, pdf_obj *node)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *kids = pdf_dict_gets(node, \"Kids\");\n\tpdf_obj *names = pdf_dict_gets(node, \"Names\");\n\tint i;\n\n\tUNUSED(ctx);\n\n\tif (kids && !pdf_mark_obj(node))\n\t{\n\t\tint len = pdf_array_len(kids);\n\t\tfor (i = 0; i < len; i++)\n\t\t\tpdf_load_name_tree_imp(dict, doc, pdf_array_get(kids, i));\n\t\tpdf_unmark_obj(node);\n\t}\n\n\tif (names)\n\t{\n\t\tint len = pdf_array_len(names);\n\t\tfor (i = 0; i + 1 < len; i += 2)\n\t\t{\n\t\t\tpdf_obj *key = pdf_array_get(names, i);\n\t\t\tpdf_obj *val = pdf_array_get(names, i + 1);\n\t\t\tif (pdf_is_string(key))\n\t\t\t{\n\t\t\t\tkey = pdf_to_utf8_name(doc, key);\n\t\t\t\tpdf_dict_put(dict, key, val);\n\t\t\t\tpdf_drop_obj(key);\n\t\t\t}\n\t\t\telse if (pdf_is_name(key))\n\t\t\t{\n\t\t\t\tpdf_dict_put(dict, key, val);\n\t\t\t}\n\t\t}\n\t}\n}\n\npdf_obj *\npdf_load_name_tree(pdf_document *doc, char *which)\n{\n\tpdf_obj *root = pdf_dict_gets(pdf_trailer(doc), \"Root\");\n\tpdf_obj *names = pdf_dict_gets(root, \"Names\");\n\tpdf_obj *tree = pdf_dict_gets(names, which);\n\tif (pdf_is_dict(tree))\n\t{\n\t\tpdf_obj *dict = pdf_new_dict(doc, 100);\n\t\tpdf_load_name_tree_imp(dict, doc, tree);\n\t\treturn dict;\n\t}\n\treturn NULL;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-object.c",
    "content": "#include \"mupdf/pdf.h\"\n\ntypedef enum pdf_objkind_e\n{\n\tPDF_NULL = 0,\n\tPDF_BOOL = 'b',\n\tPDF_INT = 'i',\n\tPDF_REAL = 'f',\n\tPDF_STRING = 's',\n\tPDF_NAME = 'n',\n\tPDF_ARRAY = 'a',\n\tPDF_DICT = 'd',\n\tPDF_INDIRECT = 'r'\n} pdf_objkind;\n\nstruct keyval\n{\n\tpdf_obj *k;\n\tpdf_obj *v;\n};\n\nenum\n{\n\tPDF_FLAGS_MARKED = 1,\n\tPDF_FLAGS_SORTED = 2,\n\tPDF_FLAGS_MEMO = 4,\n\tPDF_FLAGS_MEMO_BOOL = 8,\n\tPDF_FLAGS_DIRTY = 16\n};\n\nstruct pdf_obj_s\n{\n\tint refs;\n\tunsigned char kind;\n\tunsigned char flags;\n\tpdf_document *doc;\n\tint parent_num;\n\tunion\n\t{\n\t\tint b;\n\t\tint i;\n\t\tfloat f;\n\t\tstruct {\n\t\t\tunsigned short len;\n\t\t\tchar buf[1];\n\t\t} s;\n\t\tchar n[1];\n\t\tstruct {\n\t\t\tint len;\n\t\t\tint cap;\n\t\t\tpdf_obj **items;\n\t\t} a;\n\t\tstruct {\n\t\t\tint len;\n\t\t\tint cap;\n\t\t\tstruct keyval *items;\n\t\t} d;\n\t\tstruct {\n\t\t\tint num;\n\t\t\tint gen;\n\t\t} r;\n\t} u;\n};\n\npdf_obj *\npdf_new_null(pdf_document *doc)\n{\n\tpdf_obj *obj;\n\tfz_context *ctx = doc->ctx;\n\tobj = Memento_label(fz_malloc(ctx, sizeof(pdf_obj)), \"pdf_obj(null)\");\n\tobj->doc = doc;\n\tobj->refs = 1;\n\tobj->kind = PDF_NULL;\n\tobj->flags = 0;\n\tobj->parent_num = 0;\n\treturn obj;\n}\n\npdf_obj *\npdf_new_bool(pdf_document *doc, int b)\n{\n\tpdf_obj *obj;\n\tfz_context *ctx = doc->ctx;\n\tobj = Memento_label(fz_malloc(ctx, sizeof(pdf_obj)), \"pdf_obj(bool)\");\n\tobj->doc = doc;\n\tobj->refs = 1;\n\tobj->kind = PDF_BOOL;\n\tobj->flags = 0;\n\tobj->parent_num = 0;\n\tobj->u.b = b;\n\treturn obj;\n}\n\npdf_obj *\npdf_new_int(pdf_document *doc, int i)\n{\n\tpdf_obj *obj;\n\tfz_context *ctx = doc->ctx;\n\tobj = Memento_label(fz_malloc(ctx, sizeof(pdf_obj)), \"pdf_obj(int)\");\n\tobj->doc = doc;\n\tobj->refs = 1;\n\tobj->kind = PDF_INT;\n\tobj->flags = 0;\n\tobj->parent_num = 0;\n\tobj->u.i = i;\n\treturn obj;\n}\n\npdf_obj *\npdf_new_real(pdf_document *doc, float f)\n{\n\tpdf_obj *obj;\n\tfz_context *ctx = doc->ctx;\n\tobj = Memento_label(fz_malloc(ctx, sizeof(pdf_obj)), \"pdf_obj(real)\");\n\tobj->doc = doc;\n\tobj->refs = 1;\n\tobj->kind = PDF_REAL;\n\tobj->flags = 0;\n\tobj->parent_num = 0;\n\tobj->u.f = f;\n\treturn obj;\n}\n\npdf_obj *\npdf_new_string(pdf_document *doc, const char *str, int len)\n{\n\tpdf_obj *obj;\n\tfz_context *ctx = doc->ctx;\n\tobj = Memento_label(fz_malloc(ctx, offsetof(pdf_obj, u.s.buf) + len + 1), \"pdf_obj(string)\");\n\tobj->doc = doc;\n\tobj->refs = 1;\n\tobj->kind = PDF_STRING;\n\tobj->flags = 0;\n\tobj->parent_num = 0;\n\tobj->u.s.len = len;\n\tmemcpy(obj->u.s.buf, str, len);\n\tobj->u.s.buf[len] = '\\0';\n\treturn obj;\n}\n\npdf_obj *\npdf_new_name(pdf_document *doc, const char *str)\n{\n\tpdf_obj *obj;\n\tfz_context *ctx = doc->ctx;\n\tobj = Memento_label(fz_malloc(ctx, offsetof(pdf_obj, u.n) + strlen(str) + 1), \"pdf_obj(name)\");\n\tobj->doc = doc;\n\tobj->refs = 1;\n\tobj->kind = PDF_NAME;\n\tobj->flags = 0;\n\tobj->parent_num = 0;\n\tstrcpy(obj->u.n, str);\n\treturn obj;\n}\n\npdf_obj *\npdf_new_indirect(pdf_document *doc, int num, int gen)\n{\n\tpdf_obj *obj;\n\tfz_context *ctx = doc->ctx;\n\tobj = Memento_label(fz_malloc(ctx, sizeof(pdf_obj)), \"pdf_obj(indirect)\");\n\tobj->doc = doc;\n\tobj->refs = 1;\n\tobj->kind = PDF_INDIRECT;\n\tobj->flags = 0;\n\tobj->parent_num = 0;\n\tobj->u.r.num = num;\n\tobj->u.r.gen = gen;\n\treturn obj;\n}\n\npdf_obj *\npdf_keep_obj(pdf_obj *obj)\n{\n\tif (obj)\n\t\tobj->refs ++;\n\treturn obj;\n}\n\nint pdf_is_indirect(pdf_obj *obj)\n{\n\treturn obj ? obj->kind == PDF_INDIRECT : 0;\n}\n\n#define RESOLVE(obj) \\\n\tdo { \\\n\t\tif (obj && obj->kind == PDF_INDIRECT) \\\n\t\t{\\\n\t\t\tobj = pdf_resolve_indirect(obj); \\\n\t\t} \\\n\t} while (0)\n\nint pdf_is_null(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\treturn obj ? obj->kind == PDF_NULL : 0;\n}\n\nint pdf_is_bool(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\treturn obj ? obj->kind == PDF_BOOL : 0;\n}\n\nint pdf_is_int(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\treturn obj ? obj->kind == PDF_INT : 0;\n}\n\nint pdf_is_real(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\treturn obj ? obj->kind == PDF_REAL : 0;\n}\n\nint pdf_is_number(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\treturn obj ? (obj->kind == PDF_REAL || obj->kind == PDF_INT) : 0;\n}\n\nint pdf_is_string(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\treturn obj ? obj->kind == PDF_STRING : 0;\n}\n\nint pdf_is_name(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\treturn obj ? obj->kind == PDF_NAME : 0;\n}\n\nint pdf_is_array(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\treturn obj ? obj->kind == PDF_ARRAY : 0;\n}\n\nint pdf_is_dict(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\treturn obj ? obj->kind == PDF_DICT : 0;\n}\n\nint pdf_to_bool(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\tif (!obj)\n\t\treturn 0;\n\treturn obj->kind == PDF_BOOL ? obj->u.b : 0;\n}\n\nint pdf_to_int(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\tif (!obj)\n\t\treturn 0;\n\tif (obj->kind == PDF_INT)\n\t\treturn obj->u.i;\n\tif (obj->kind == PDF_REAL)\n\t\treturn (int)(obj->u.f + 0.5f); /* No roundf in MSVC */\n\treturn 0;\n}\n\nfloat pdf_to_real(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\tif (!obj)\n\t\treturn 0;\n\tif (obj->kind == PDF_REAL)\n\t\treturn obj->u.f;\n\tif (obj->kind == PDF_INT)\n\t\treturn obj->u.i;\n\treturn 0;\n}\n\nchar *pdf_to_name(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\tif (!obj || obj->kind != PDF_NAME)\n\t\treturn \"\";\n\treturn obj->u.n;\n}\n\nchar *pdf_to_str_buf(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\tif (!obj || obj->kind != PDF_STRING)\n\t\treturn \"\";\n\treturn obj->u.s.buf;\n}\n\nint pdf_to_str_len(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\tif (!obj || obj->kind != PDF_STRING)\n\t\treturn 0;\n\treturn obj->u.s.len;\n}\n\nvoid pdf_set_int(pdf_obj *obj, int i)\n{\n\tif (!obj || obj->kind != PDF_INT)\n\t\treturn;\n\tobj->u.i = i;\n}\n\n/* for use by pdf_crypt_obj_imp to decrypt AES string in place */\nvoid pdf_set_str_len(pdf_obj *obj, int newlen)\n{\n\tRESOLVE(obj);\n\tif (!obj || obj->kind != PDF_STRING)\n\t\treturn; /* This should never happen */\n\tif (newlen > obj->u.s.len)\n\t\treturn; /* This should never happen */\n\tobj->u.s.len = newlen;\n}\n\npdf_obj *pdf_to_dict(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\treturn (obj && obj->kind == PDF_DICT ? obj : NULL);\n}\n\nint pdf_to_num(pdf_obj *obj)\n{\n\tif (!obj || obj->kind != PDF_INDIRECT)\n\t\treturn 0;\n\treturn obj->u.r.num;\n}\n\nint pdf_to_gen(pdf_obj *obj)\n{\n\tif (!obj || obj->kind != PDF_INDIRECT)\n\t\treturn 0;\n\treturn obj->u.r.gen;\n}\n\npdf_document *pdf_get_indirect_document(pdf_obj *obj)\n{\n\tif (!obj || obj->kind != PDF_INDIRECT)\n\t\treturn NULL;\n\treturn obj->doc;\n}\n\nint\npdf_objcmp(pdf_obj *a, pdf_obj *b)\n{\n\tint i;\n\n\tif (a == b)\n\t\treturn 0;\n\n\tif (!a || !b)\n\t\treturn 1;\n\n\tif (a->kind != b->kind)\n\t\treturn 1;\n\n\tswitch (a->kind)\n\t{\n\tcase PDF_NULL:\n\t\treturn 0;\n\n\tcase PDF_BOOL:\n\t\treturn a->u.b - b->u.b;\n\n\tcase PDF_INT:\n\t\treturn a->u.i - b->u.i;\n\n\tcase PDF_REAL:\n\t\tif (a->u.f < b->u.f)\n\t\t\treturn -1;\n\t\tif (a->u.f > b->u.f)\n\t\t\treturn 1;\n\t\treturn 0;\n\n\tcase PDF_STRING:\n\t\tif (a->u.s.len < b->u.s.len)\n\t\t{\n\t\t\tif (memcmp(a->u.s.buf, b->u.s.buf, a->u.s.len) <= 0)\n\t\t\t\treturn -1;\n\t\t\treturn 1;\n\t\t}\n\t\tif (a->u.s.len > b->u.s.len)\n\t\t{\n\t\t\tif (memcmp(a->u.s.buf, b->u.s.buf, b->u.s.len) >= 0)\n\t\t\t\treturn 1;\n\t\t\treturn -1;\n\t\t}\n\t\treturn memcmp(a->u.s.buf, b->u.s.buf, a->u.s.len);\n\n\tcase PDF_NAME:\n\t\treturn strcmp(a->u.n, b->u.n);\n\n\tcase PDF_INDIRECT:\n\t\tif (a->u.r.num == b->u.r.num)\n\t\t\treturn a->u.r.gen - b->u.r.gen;\n\t\treturn a->u.r.num - b->u.r.num;\n\n\tcase PDF_ARRAY:\n\t\tif (a->u.a.len != b->u.a.len)\n\t\t\treturn a->u.a.len - b->u.a.len;\n\t\tfor (i = 0; i < a->u.a.len; i++)\n\t\t\tif (pdf_objcmp(a->u.a.items[i], b->u.a.items[i]))\n\t\t\t\treturn 1;\n\t\treturn 0;\n\n\tcase PDF_DICT:\n\t\tif (a->u.d.len != b->u.d.len)\n\t\t\treturn a->u.d.len - b->u.d.len;\n\t\tfor (i = 0; i < a->u.d.len; i++)\n\t\t{\n\t\t\tif (pdf_objcmp(a->u.d.items[i].k, b->u.d.items[i].k))\n\t\t\t\treturn 1;\n\t\t\tif (pdf_objcmp(a->u.d.items[i].v, b->u.d.items[i].v))\n\t\t\t\treturn 1;\n\t\t}\n\t\treturn 0;\n\n\t}\n\treturn 1;\n}\n\nstatic char *\npdf_objkindstr(pdf_obj *obj)\n{\n\tif (!obj)\n\t\treturn \"<NULL>\";\n\tswitch (obj->kind)\n\t{\n\tcase PDF_NULL: return \"null\";\n\tcase PDF_BOOL: return \"boolean\";\n\tcase PDF_INT: return \"integer\";\n\tcase PDF_REAL: return \"real\";\n\tcase PDF_STRING: return \"string\";\n\tcase PDF_NAME: return \"name\";\n\tcase PDF_ARRAY: return \"array\";\n\tcase PDF_DICT: return \"dictionary\";\n\tcase PDF_INDIRECT: return \"reference\";\n\t}\n\treturn \"<unknown>\";\n}\n\npdf_obj *\npdf_new_array(pdf_document *doc, int initialcap)\n{\n\tpdf_obj *obj;\n\tint i;\n\tfz_context *ctx = doc->ctx;\n\n\tobj = Memento_label(fz_malloc(ctx, sizeof(pdf_obj)), \"pdf_obj(array)\");\n\tobj->doc = doc;\n\tobj->refs = 1;\n\tobj->kind = PDF_ARRAY;\n\tobj->flags = 0;\n\tobj->parent_num = 0;\n\n\tobj->u.a.len = 0;\n\tobj->u.a.cap = initialcap > 1 ? initialcap : 6;\n\n\tfz_try(ctx)\n\t{\n\t\tobj->u.a.items = Memento_label(fz_malloc_array(ctx, obj->u.a.cap, sizeof(pdf_obj*)), \"pdf_obj(array items)\");\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, obj);\n\t\tfz_rethrow(ctx);\n\t}\n\tfor (i = 0; i < obj->u.a.cap; i++)\n\t\tobj->u.a.items[i] = NULL;\n\n\treturn obj;\n}\n\nstatic void\npdf_array_grow(pdf_obj *obj)\n{\n\tint i;\n\tint new_cap = (obj->u.a.cap * 3) / 2;\n\n\tobj->u.a.items = fz_resize_array(obj->doc->ctx, obj->u.a.items, new_cap, sizeof(pdf_obj*));\n\tobj->u.a.cap = new_cap;\n\n\tfor (i = obj->u.a.len ; i < obj->u.a.cap; i++)\n\t\tobj->u.a.items[i] = NULL;\n}\n\npdf_obj *\npdf_copy_array(pdf_obj *obj)\n{\n\tpdf_obj *arr;\n\tint i;\n\tint n;\n\tfz_context *ctx = obj->doc->ctx;\n\n\tRESOLVE(obj);\n\tif (!obj)\n\t\treturn NULL; /* Can't warn :( */\n\tif (obj->kind != PDF_ARRAY)\n\t\tfz_warn(ctx, \"assert: not an array (%s)\", pdf_objkindstr(obj));\n\n\tarr = pdf_new_array(obj->doc, pdf_array_len(obj));\n\tn = pdf_array_len(obj);\n\tfor (i = 0; i < n; i++)\n\t\tpdf_array_push(arr, pdf_array_get(obj, i));\n\n\treturn arr;\n}\n\nint\npdf_array_len(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\tif (!obj || obj->kind != PDF_ARRAY)\n\t\treturn 0;\n\treturn obj->u.a.len;\n}\n\npdf_obj *\npdf_array_get(pdf_obj *obj, int i)\n{\n\tRESOLVE(obj);\n\n\tif (!obj || obj->kind != PDF_ARRAY)\n\t\treturn NULL;\n\n\tif (i < 0 || i >= obj->u.a.len)\n\t\treturn NULL;\n\n\treturn obj->u.a.items[i];\n}\n\nstatic void object_altered(pdf_obj *obj, pdf_obj *val)\n{\n\t/*\n\tparent_num = 0 while an object is being parsed from the file.\n\tNo further action is necessary.\n\t*/\n\tif (obj->parent_num == 0 || obj->doc->freeze_updates)\n\t\treturn;\n\n\t/*\n\tOtherwise we need to ensure that the containing hierarchy of objects\n\thas been moved to the incremental xref section and the newly linked\n\tobject needs to record the parent_num\n\t*/\n\tpdf_xref_ensure_incremental_object(obj->doc, obj->parent_num);\n\tpdf_set_obj_parent(val, obj->parent_num);\n}\n\nvoid\npdf_array_put(pdf_obj *obj, int i, pdf_obj *item)\n{\n\tRESOLVE(obj);\n\n\tif (!obj)\n\t\treturn; /* Can't warn :( */\n\tif (obj->kind != PDF_ARRAY)\n\t\tfz_warn(obj->doc->ctx, \"assert: not an array (%s)\", pdf_objkindstr(obj));\n\telse if (i < 0)\n\t\tfz_warn(obj->doc->ctx, \"assert: index %d < 0\", i);\n\telse if (i >= obj->u.a.len)\n\t\tfz_warn(obj->doc->ctx, \"assert: index %d > length %d\", i, obj->u.a.len);\n\telse\n\t{\n\t\tpdf_drop_obj(obj->u.a.items[i]);\n\t\tobj->u.a.items[i] = pdf_keep_obj(item);\n\t}\n\n\tobject_altered(obj, item);\n}\n\nvoid\npdf_array_push(pdf_obj *obj, pdf_obj *item)\n{\n\tRESOLVE(obj);\n\n\tif (!obj)\n\t\treturn; /* Can't warn :( */\n\tif (obj->kind != PDF_ARRAY)\n\t\tfz_warn(obj->doc->ctx, \"assert: not an array (%s)\", pdf_objkindstr(obj));\n\telse\n\t{\n\t\tif (obj->u.a.len + 1 > obj->u.a.cap)\n\t\t\tpdf_array_grow(obj);\n\t\tobj->u.a.items[obj->u.a.len] = pdf_keep_obj(item);\n\t\tobj->u.a.len++;\n\t}\n\n\tobject_altered(obj, item);\n}\n\nvoid\npdf_array_push_drop(pdf_obj *obj, pdf_obj *item)\n{\n\tfz_context *ctx = obj->doc->ctx;\n\n\tfz_try(ctx)\n\t{\n\t\tpdf_array_push(obj, item);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(item);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nvoid\npdf_array_insert(pdf_obj *obj, pdf_obj *item, int i)\n{\n\tRESOLVE(obj);\n\n\tif (!obj)\n\t\treturn; /* Can't warn :( */\n\tif (obj->kind != PDF_ARRAY)\n\t\tfz_warn(obj->doc->ctx, \"assert: not an array (%s)\", pdf_objkindstr(obj));\n\telse\n\t{\n\t\tif (i < 0 || i > obj->u.a.len)\n\t\t\tfz_throw(obj->doc->ctx, FZ_ERROR_GENERIC, \"attempt to insert object %d in array of length %d\", i, obj->u.a.len);\n\t\tif (obj->u.a.len + 1 > obj->u.a.cap)\n\t\t\tpdf_array_grow(obj);\n\t\tmemmove(obj->u.a.items + i + 1, obj->u.a.items + i, (obj->u.a.len - i) * sizeof(pdf_obj*));\n\t\tobj->u.a.items[i] = pdf_keep_obj(item);\n\t\tobj->u.a.len++;\n\t}\n\n\tobject_altered(obj, item);\n}\n\nvoid\npdf_array_insert_drop(pdf_obj *obj, pdf_obj *item, int i)\n{\n\tfz_context *ctx = obj->doc->ctx;\n\tfz_try(ctx)\n\t{\n\t\tpdf_array_insert(obj, item, i);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(item);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nvoid\npdf_array_delete(pdf_obj *obj, int i)\n{\n\tRESOLVE(obj);\n\n\tif (!obj)\n\t\treturn; /* Can't warn :( */\n\tif (obj->kind != PDF_ARRAY)\n\t\tfz_warn(obj->doc->ctx, \"assert: not an array (%s)\", pdf_objkindstr(obj));\n\telse\n\t{\n\t\tpdf_drop_obj(obj->u.a.items[i]);\n\t\tobj->u.a.items[i] = 0;\n\t\tobj->u.a.len--;\n\t\tmemmove(obj->u.a.items + i, obj->u.a.items + i + 1, (obj->u.a.len - i) * sizeof(pdf_obj*));\n\t}\n}\n\nint\npdf_array_contains(pdf_obj *arr, pdf_obj *obj)\n{\n\tint i, len;\n\n\tlen = pdf_array_len(arr);\n\tfor (i = 0; i < len; i++)\n\t\tif (!pdf_objcmp(pdf_array_get(arr, i), obj))\n\t\t\treturn 1;\n\n\treturn 0;\n}\n\npdf_obj *pdf_new_rect(pdf_document *doc, const fz_rect *rect)\n{\n\tpdf_obj *arr = NULL;\n\tpdf_obj *item = NULL;\n\tfz_context *ctx = doc->ctx;\n\n\tfz_var(arr);\n\tfz_var(item);\n\tfz_try(ctx)\n\t{\n\t\tarr = pdf_new_array(doc, 4);\n\n\t\titem = pdf_new_real(doc, rect->x0);\n\t\tpdf_array_push(arr, item);\n\t\tpdf_drop_obj(item);\n\t\titem = NULL;\n\n\t\titem = pdf_new_real(doc, rect->y0);\n\t\tpdf_array_push(arr, item);\n\t\tpdf_drop_obj(item);\n\t\titem = NULL;\n\n\t\titem = pdf_new_real(doc, rect->x1);\n\t\tpdf_array_push(arr, item);\n\t\tpdf_drop_obj(item);\n\t\titem = NULL;\n\n\t\titem = pdf_new_real(doc, rect->y1);\n\t\tpdf_array_push(arr, item);\n\t\tpdf_drop_obj(item);\n\t\titem = NULL;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_obj(item);\n\t\tpdf_drop_obj(arr);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn arr;\n}\n\npdf_obj *pdf_new_matrix(pdf_document *doc, const fz_matrix *mtx)\n{\n\tpdf_obj *arr = NULL;\n\tpdf_obj *item = NULL;\n\tfz_context *ctx = doc->ctx;\n\n\tfz_var(arr);\n\tfz_var(item);\n\tfz_try(ctx)\n\t{\n\t\tarr = pdf_new_array(doc, 6);\n\n\t\titem = pdf_new_real(doc, mtx->a);\n\t\tpdf_array_push(arr, item);\n\t\tpdf_drop_obj(item);\n\t\titem = NULL;\n\n\t\titem = pdf_new_real(doc, mtx->b);\n\t\tpdf_array_push(arr, item);\n\t\tpdf_drop_obj(item);\n\t\titem = NULL;\n\n\t\titem = pdf_new_real(doc, mtx->c);\n\t\tpdf_array_push(arr, item);\n\t\tpdf_drop_obj(item);\n\t\titem = NULL;\n\n\t\titem = pdf_new_real(doc, mtx->d);\n\t\tpdf_array_push(arr, item);\n\t\tpdf_drop_obj(item);\n\t\titem = NULL;\n\n\t\titem = pdf_new_real(doc, mtx->e);\n\t\tpdf_array_push(arr, item);\n\t\tpdf_drop_obj(item);\n\t\titem = NULL;\n\n\t\titem = pdf_new_real(doc, mtx->f);\n\t\tpdf_array_push(arr, item);\n\t\tpdf_drop_obj(item);\n\t\titem = NULL;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_obj(item);\n\t\tpdf_drop_obj(arr);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn arr;\n}\n\n/* dicts may only have names as keys! */\n\nstatic int keyvalcmp(const void *ap, const void *bp)\n{\n\tconst struct keyval *a = ap;\n\tconst struct keyval *b = bp;\n\treturn strcmp(pdf_to_name(a->k), pdf_to_name(b->k));\n}\n\npdf_obj *\npdf_new_dict(pdf_document *doc, int initialcap)\n{\n\tpdf_obj *obj;\n\tint i;\n\tfz_context *ctx = doc->ctx;\n\n\tobj = Memento_label(fz_malloc(ctx, sizeof(pdf_obj)), \"pdf_obj(dict)\");\n\tobj->doc = doc;\n\tobj->refs = 1;\n\tobj->kind = PDF_DICT;\n\tobj->flags = 0;\n\tobj->parent_num = 0;\n\n\tobj->u.d.len = 0;\n\tobj->u.d.cap = initialcap > 1 ? initialcap : 10;\n\n\tfz_try(ctx)\n\t{\n\t\tobj->u.d.items = Memento_label(fz_malloc_array(ctx, obj->u.d.cap, sizeof(struct keyval)), \"pdf_obj(dict items)\");\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, obj);\n\t\tfz_rethrow(ctx);\n\t}\n\tfor (i = 0; i < obj->u.d.cap; i++)\n\t{\n\t\tobj->u.d.items[i].k = NULL;\n\t\tobj->u.d.items[i].v = NULL;\n\t}\n\n\treturn obj;\n}\n\nstatic void\npdf_dict_grow(pdf_obj *obj)\n{\n\tint i;\n\tint new_cap = (obj->u.d.cap * 3) / 2;\n\n\tobj->u.d.items = fz_resize_array(obj->doc->ctx, obj->u.d.items, new_cap, sizeof(struct keyval));\n\tobj->u.d.cap = new_cap;\n\n\tfor (i = obj->u.d.len; i < obj->u.d.cap; i++)\n\t{\n\t\tobj->u.d.items[i].k = NULL;\n\t\tobj->u.d.items[i].v = NULL;\n\t}\n}\n\npdf_obj *\npdf_copy_dict(pdf_obj *obj)\n{\n\tpdf_obj *dict;\n\tint i, n;\n\tpdf_document *doc;\n\n\tRESOLVE(obj);\n\tif (!obj)\n\t\treturn NULL; /* Can't warn :( */\n\tdoc = obj->doc;\n\tif (obj->kind != PDF_DICT)\n\t\tfz_warn(doc->ctx, \"assert: not a dict (%s)\", pdf_objkindstr(obj));\n\n\tn = pdf_dict_len(obj);\n\tdict = pdf_new_dict(doc, n);\n\tfor (i = 0; i < n; i++)\n\t\tpdf_dict_put(dict, pdf_dict_get_key(obj, i), pdf_dict_get_val(obj, i));\n\n\treturn dict;\n}\n\nint\npdf_dict_len(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\tif (!obj || obj->kind != PDF_DICT)\n\t\treturn 0;\n\treturn obj->u.d.len;\n}\n\npdf_obj *\npdf_dict_get_key(pdf_obj *obj, int i)\n{\n\tRESOLVE(obj);\n\tif (!obj || obj->kind != PDF_DICT)\n\t\treturn NULL;\n\n\tif (i < 0 || i >= obj->u.d.len)\n\t\treturn NULL;\n\n\treturn obj->u.d.items[i].k;\n}\n\npdf_obj *\npdf_dict_get_val(pdf_obj *obj, int i)\n{\n\tRESOLVE(obj);\n\tif (!obj || obj->kind != PDF_DICT)\n\t\treturn NULL;\n\n\tif (i < 0 || i >= obj->u.d.len)\n\t\treturn NULL;\n\n\treturn obj->u.d.items[i].v;\n}\n\nstatic int\npdf_dict_finds(pdf_obj *obj, const char *key, int *location)\n{\n\tif ((obj->flags & PDF_FLAGS_SORTED) && obj->u.d.len > 0)\n\t{\n\t\tint l = 0;\n\t\tint r = obj->u.d.len - 1;\n\n\t\tif (strcmp(pdf_to_name(obj->u.d.items[r].k), key) < 0)\n\t\t{\n\t\t\tif (location)\n\t\t\t\t*location = r + 1;\n\t\t\treturn -1;\n\t\t}\n\n\t\twhile (l <= r)\n\t\t{\n\t\t\tint m = (l + r) >> 1;\n\t\t\tint c = -strcmp(pdf_to_name(obj->u.d.items[m].k), key);\n\t\t\tif (c < 0)\n\t\t\t\tr = m - 1;\n\t\t\telse if (c > 0)\n\t\t\t\tl = m + 1;\n\t\t\telse\n\t\t\t\treturn m;\n\n\t\t\tif (location)\n\t\t\t\t*location = l;\n\t\t}\n\t}\n\n\telse\n\t{\n\t\tint i;\n\t\tfor (i = 0; i < obj->u.d.len; i++)\n\t\t\tif (strcmp(pdf_to_name(obj->u.d.items[i].k), key) == 0)\n\t\t\t\treturn i;\n\n\t\tif (location)\n\t\t\t*location = obj->u.d.len;\n\t}\n\n\treturn -1;\n}\n\npdf_obj *\npdf_dict_gets(pdf_obj *obj, const char *key)\n{\n\tint i;\n\n\tRESOLVE(obj);\n\tif (!obj || obj->kind != PDF_DICT)\n\t\treturn NULL;\n\n\ti = pdf_dict_finds(obj, key, NULL);\n\tif (i >= 0)\n\t\treturn obj->u.d.items[i].v;\n\n\treturn NULL;\n}\n\npdf_obj *\npdf_dict_getp(pdf_obj *obj, const char *keys)\n{\n\tchar buf[256];\n\tchar *k, *e;\n\n\tif (strlen(keys)+1 > 256)\n\t\tfz_throw(obj->doc->ctx, FZ_ERROR_GENERIC, \"buffer overflow in pdf_dict_getp\");\n\n\tstrcpy(buf, keys);\n\n\te = buf;\n\twhile (*e && obj)\n\t{\n\t\tk = e;\n\t\twhile (*e != '/' && *e != '\\0')\n\t\t\te++;\n\n\t\tif (*e == '/')\n\t\t{\n\t\t\t*e = '\\0';\n\t\t\te++;\n\t\t}\n\n\t\tobj = pdf_dict_gets(obj, k);\n\t}\n\n\treturn obj;\n}\n\npdf_obj *\npdf_dict_get(pdf_obj *obj, pdf_obj *key)\n{\n\tif (!key || key->kind != PDF_NAME)\n\t\treturn NULL;\n\treturn pdf_dict_gets(obj, pdf_to_name(key));\n}\n\npdf_obj *\npdf_dict_getsa(pdf_obj *obj, const char *key, const char *abbrev)\n{\n\tpdf_obj *v;\n\tv = pdf_dict_gets(obj, key);\n\tif (v)\n\t\treturn v;\n\treturn pdf_dict_gets(obj, abbrev);\n}\n\nvoid\npdf_dict_put(pdf_obj *obj, pdf_obj *key, pdf_obj *val)\n{\n\tint location;\n\tchar *s;\n\tint i;\n\n\tRESOLVE(obj);\n\tif (!obj)\n\t\treturn; /* Can't warn :( */\n\tif (obj->kind != PDF_DICT)\n\t{\n\t\tfz_warn(obj->doc->ctx, \"assert: not a dict (%s)\", pdf_objkindstr(obj));\n\t\treturn;\n\t}\n\n\tRESOLVE(key);\n\tif (!key || key->kind != PDF_NAME)\n\t{\n\t\tfz_warn(obj->doc->ctx, \"assert: key is not a name (%s)\", pdf_objkindstr(obj));\n\t\treturn;\n\t}\n\telse\n\t\ts = pdf_to_name(key);\n\n\tif (!val)\n\t{\n\t\tfz_warn(obj->doc->ctx, \"assert: val does not exist for key (%s)\", s);\n\t\treturn;\n\t}\n\n\tif (obj->u.d.len > 100 && !(obj->flags & PDF_FLAGS_SORTED))\n\t\tpdf_sort_dict(obj);\n\n\ti = pdf_dict_finds(obj, s, &location);\n\tif (i >= 0 && i < obj->u.d.len)\n\t{\n\t\tif (obj->u.d.items[i].v != val)\n\t\t{\n\t\t\tpdf_obj *d = obj->u.d.items[i].v;\n\t\t\tobj->u.d.items[i].v = pdf_keep_obj(val);\n\t\t\tpdf_drop_obj(d);\n\t\t}\n\t}\n\telse\n\t{\n\t\tif (obj->u.d.len + 1 > obj->u.d.cap)\n\t\t\tpdf_dict_grow(obj);\n\n\t\ti = location;\n\t\tif ((obj->flags & PDF_FLAGS_SORTED) && obj->u.d.len > 0)\n\t\t\tmemmove(&obj->u.d.items[i + 1],\n\t\t\t\t&obj->u.d.items[i],\n\t\t\t\t(obj->u.d.len - i) * sizeof(struct keyval));\n\n\t\tobj->u.d.items[i].k = pdf_keep_obj(key);\n\t\tobj->u.d.items[i].v = pdf_keep_obj(val);\n\t\tobj->u.d.len ++;\n\t}\n\n\tobject_altered(obj, val);\n}\n\nvoid\npdf_dict_puts(pdf_obj *obj, const char *key, pdf_obj *val)\n{\n\tpdf_document *doc = obj->doc;\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *keyobj = pdf_new_name(doc, key);\n\n\tfz_try(ctx)\n\t{\n\t\tpdf_dict_put(obj, keyobj, val);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(keyobj);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nvoid\npdf_dict_puts_drop(pdf_obj *obj, const char *key, pdf_obj *val)\n{\n\tpdf_document *doc = obj->doc;\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *keyobj = NULL;\n\n\tfz_var(keyobj);\n\n\tfz_try(ctx)\n\t{\n\t\tkeyobj = pdf_new_name(doc, key);\n\t\tpdf_dict_put(obj, keyobj, val);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(keyobj);\n\t\tpdf_drop_obj(val);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nvoid\npdf_dict_putp(pdf_obj *obj, const char *keys, pdf_obj *val)\n{\n\tfz_context *ctx = obj->doc->ctx;\n\tchar buf[256];\n\tchar *k, *e;\n\tpdf_obj *cobj = NULL;\n\n\tif (strlen(keys)+1 > 256)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"buffer overflow in pdf_dict_putp\");\n\n\tstrcpy(buf, keys);\n\n\te = buf;\n\twhile (*e)\n\t{\n\t\tk = e;\n\t\twhile (*e != '/' && *e != '\\0')\n\t\t\te++;\n\n\t\tif (*e == '/')\n\t\t{\n\t\t\t*e = '\\0';\n\t\t\te++;\n\t\t}\n\n\t\tif (*e)\n\t\t{\n\t\t\t/* Not the last key in the key path. Create subdict if not already there. */\n\t\t\tcobj = pdf_dict_gets(obj, k);\n\t\t\tif (cobj == NULL)\n\t\t\t{\n\t\t\t\tcobj = pdf_new_dict(obj->doc, 1);\n\t\t\t\tfz_try(ctx)\n\t\t\t\t{\n\t\t\t\t\tpdf_dict_puts(obj, k, cobj);\n\t\t\t\t}\n\t\t\t\tfz_always(ctx)\n\t\t\t\t{\n\t\t\t\t\tpdf_drop_obj(cobj);\n\t\t\t\t}\n\t\t\t\tfz_catch(ctx)\n\t\t\t\t{\n\t\t\t\t\tfz_rethrow(ctx);\n\t\t\t\t}\n\t\t\t}\n\t\t\t/* Move to subdict */\n\t\t\tobj = cobj;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* Last key. Use it to store the value */\n\t\t\t/* Use val = NULL to request delete */\n\t\t\tif (val)\n\t\t\t\tpdf_dict_puts(obj, k, val);\n\t\t\telse\n\t\t\t\tpdf_dict_dels(obj, k);\n\t\t}\n\t}\n}\n\nvoid\npdf_dict_putp_drop(pdf_obj *obj, const char *keys, pdf_obj *val)\n{\n\tfz_context *ctx = obj->doc->ctx;\n\n\tfz_try(ctx)\n\t{\n\t\tpdf_dict_putp(obj, keys, val);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(val);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nvoid\npdf_dict_dels(pdf_obj *obj, const char *key)\n{\n\tRESOLVE(obj);\n\n\tif (!obj)\n\t\treturn; /* Can't warn :( */\n\tif (obj->kind != PDF_DICT)\n\t\tfz_warn(obj->doc->ctx, \"assert: not a dict (%s)\", pdf_objkindstr(obj));\n\telse\n\t{\n\t\tint i = pdf_dict_finds(obj, key, NULL);\n\t\tif (i >= 0)\n\t\t{\n\t\t\tpdf_drop_obj(obj->u.d.items[i].k);\n\t\t\tpdf_drop_obj(obj->u.d.items[i].v);\n\t\t\tobj->flags &= ~PDF_FLAGS_SORTED;\n\t\t\tobj->u.d.items[i] = obj->u.d.items[obj->u.d.len-1];\n\t\t\tobj->u.d.len --;\n\t\t}\n\t}\n\n\tobject_altered(obj, NULL);\n}\n\nvoid\npdf_dict_del(pdf_obj *obj, pdf_obj *key)\n{\n\tRESOLVE(key);\n\tif (!key || key->kind != PDF_NAME)\n\t\tfz_warn(obj->doc->ctx, \"assert: key is not a name (%s)\", pdf_objkindstr(obj));\n\telse\n\t\tpdf_dict_dels(obj, key->u.n);\n}\n\nvoid\npdf_sort_dict(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\tif (!obj || obj->kind != PDF_DICT)\n\t\treturn;\n\tif (!(obj->flags & PDF_FLAGS_SORTED))\n\t{\n\t\tqsort(obj->u.d.items, obj->u.d.len, sizeof(struct keyval), keyvalcmp);\n\t\tobj->flags |= PDF_FLAGS_SORTED;\n\t}\n}\n\nint\npdf_obj_marked(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\tif (!obj)\n\t\treturn 0;\n\treturn !!(obj->flags & PDF_FLAGS_MARKED);\n}\n\nint\npdf_mark_obj(pdf_obj *obj)\n{\n\tint marked;\n\tRESOLVE(obj);\n\tif (!obj)\n\t\treturn 0;\n\tmarked = !!(obj->flags & PDF_FLAGS_MARKED);\n\tobj->flags |= PDF_FLAGS_MARKED;\n\treturn marked;\n}\n\nvoid\npdf_unmark_obj(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\tif (!obj)\n\t\treturn;\n\tobj->flags &= ~PDF_FLAGS_MARKED;\n}\n\nvoid\npdf_set_obj_memo(pdf_obj *obj, int memo)\n{\n\tobj->flags |= PDF_FLAGS_MEMO;\n\tif (memo)\n\t\tobj->flags |= PDF_FLAGS_MEMO_BOOL;\n\telse\n\t\tobj->flags &= ~PDF_FLAGS_MEMO_BOOL;\n}\n\nint\npdf_obj_memo(pdf_obj *obj, int *memo)\n{\n\tif (!(obj->flags & PDF_FLAGS_MEMO))\n\t\treturn 0;\n\t*memo = !!(obj->flags & PDF_FLAGS_MEMO_BOOL);\n\treturn 1;\n}\n\nint pdf_obj_is_dirty(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\tif (!obj)\n\t\treturn 0;\n\treturn !!(obj->flags & PDF_FLAGS_DIRTY);\n}\n\nvoid pdf_dirty_obj(pdf_obj *obj)\n{\n\tRESOLVE(obj);\n\tif (!obj)\n\t\treturn;\n\tobj->flags |= PDF_FLAGS_DIRTY;\n}\n\nvoid pdf_clean_obj(pdf_obj *obj)\n{\n\tif (!obj)\n\t\treturn;\n\tobj->flags &= ~PDF_FLAGS_DIRTY;\n}\n\nstatic void\npdf_free_array(pdf_obj *obj)\n{\n\tfz_context *ctx = obj->doc->ctx;\n\tint i;\n\n\tfor (i = 0; i < obj->u.a.len; i++)\n\t\tpdf_drop_obj(obj->u.a.items[i]);\n\n\tfz_free(ctx, obj->u.a.items);\n\tfz_free(ctx, obj);\n}\n\nstatic void\npdf_free_dict(pdf_obj *obj)\n{\n\tint i;\n\tfz_context *ctx = obj->doc->ctx;\n\n\tfor (i = 0; i < obj->u.d.len; i++) {\n\t\tpdf_drop_obj(obj->u.d.items[i].k);\n\t\tpdf_drop_obj(obj->u.d.items[i].v);\n\t}\n\n\tfz_free(ctx, obj->u.d.items);\n\tfz_free(ctx, obj);\n}\n\nvoid\npdf_drop_obj(pdf_obj *obj)\n{\n\tif (!obj)\n\t\treturn;\n\tif (--obj->refs)\n\t\treturn;\n\tif (obj->kind == PDF_ARRAY)\n\t\tpdf_free_array(obj);\n\telse if (obj->kind == PDF_DICT)\n\t\tpdf_free_dict(obj);\n\telse\n\t\tfz_free(obj->doc->ctx, obj);\n}\n\nvoid\npdf_set_obj_parent(pdf_obj *obj, int num)\n{\n\tint n, i;\n\n\tif (!obj)\n\t\treturn;\n\n\tobj->parent_num = num;\n\n\tswitch(obj->kind)\n\t{\n\tcase PDF_ARRAY:\n\t\tn = pdf_array_len(obj);\n\t\tfor (i = 0; i < n; i++)\n\t\t\tpdf_set_obj_parent(pdf_array_get(obj, i), num);\n\t\tbreak;\n\tcase PDF_DICT:\n\t\tn = pdf_dict_len(obj);\n\t\tfor (i = 0; i < n; i++)\n\t\t\tpdf_set_obj_parent(pdf_dict_get_val(obj, i), num);\n\t\tbreak;\n\t}\n}\n\nint pdf_obj_parent_num(pdf_obj *obj)\n{\n\treturn obj->parent_num;\n}\n\npdf_obj *pdf_new_obj_from_str(pdf_document *doc, const char *src)\n{\n\tpdf_obj *result;\n\tpdf_lexbuf lexbuf;\n\tfz_context *ctx = doc->ctx;\n\tfz_stream *stream = fz_open_memory(ctx, (unsigned char *)src, strlen(src));\n\n\tpdf_lexbuf_init(ctx, &lexbuf, PDF_LEXBUF_SMALL);\n\tfz_try(ctx)\n\t{\n\t\tresult = pdf_parse_stm_obj(doc, stream, &lexbuf);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_lexbuf_fin(&lexbuf);\n\t\tfz_close(stream);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn result;\n}\n\n/* Pretty printing objects */\n\nstruct fmt\n{\n\tchar *buf;\n\tint cap;\n\tint len;\n\tint indent;\n\tint tight;\n\tint col;\n\tint sep;\n\tint last;\n};\n\nstatic void fmt_obj(struct fmt *fmt, pdf_obj *obj);\n\nstatic inline int iswhite(int ch)\n{\n\treturn\n\t\tch == '\\000' ||\n\t\tch == '\\011' ||\n\t\tch == '\\012' ||\n\t\tch == '\\014' ||\n\t\tch == '\\015' ||\n\t\tch == '\\040';\n}\n\nstatic inline int isdelim(int ch)\n{\n\treturn\n\t\tch == '(' || ch == ')' ||\n\t\tch == '<' || ch == '>' ||\n\t\tch == '[' || ch == ']' ||\n\t\tch == '{' || ch == '}' ||\n\t\tch == '/' ||\n\t\tch == '%';\n}\n\nstatic inline void fmt_putc(struct fmt *fmt, int c)\n{\n\tif (fmt->sep && !isdelim(fmt->last) && !isdelim(c)) {\n\t\tfmt->sep = 0;\n\t\tfmt_putc(fmt, ' ');\n\t}\n\tfmt->sep = 0;\n\n\tif (fmt->buf && fmt->len < fmt->cap)\n\t\tfmt->buf[fmt->len] = c;\n\n\tif (c == '\\n')\n\t\tfmt->col = 0;\n\telse\n\t\tfmt->col ++;\n\n\tfmt->len ++;\n\n\tfmt->last = c;\n}\n\nstatic inline void fmt_indent(struct fmt *fmt)\n{\n\tint i = fmt->indent;\n\twhile (i--) {\n\t\tfmt_putc(fmt, ' ');\n\t\tfmt_putc(fmt, ' ');\n\t}\n}\n\nstatic inline void fmt_puts(struct fmt *fmt, char *s)\n{\n\twhile (*s)\n\t\tfmt_putc(fmt, *s++);\n}\n\nstatic inline void fmt_sep(struct fmt *fmt)\n{\n\tfmt->sep = 1;\n}\n\nstatic void fmt_str(struct fmt *fmt, pdf_obj *obj)\n{\n\tchar *s = pdf_to_str_buf(obj);\n\tint n = pdf_to_str_len(obj);\n\tint i, c;\n\n\tfmt_putc(fmt, '(');\n\tfor (i = 0; i < n; i++)\n\t{\n\t\tc = (unsigned char)s[i];\n\t\tif (c == '\\n')\n\t\t\tfmt_puts(fmt, \"\\\\n\");\n\t\telse if (c == '\\r')\n\t\t\tfmt_puts(fmt, \"\\\\r\");\n\t\telse if (c == '\\t')\n\t\t\tfmt_puts(fmt, \"\\\\t\");\n\t\telse if (c == '\\b')\n\t\t\tfmt_puts(fmt, \"\\\\b\");\n\t\telse if (c == '\\f')\n\t\t\tfmt_puts(fmt, \"\\\\f\");\n\t\telse if (c == '(')\n\t\t\tfmt_puts(fmt, \"\\\\(\");\n\t\telse if (c == ')')\n\t\t\tfmt_puts(fmt, \"\\\\)\");\n\t\telse if (c == '\\\\')\n\t\t\tfmt_puts(fmt, \"\\\\\\\\\");\n\t\telse if (c < 32 || c >= 127) {\n\t\t\tfmt_putc(fmt, '\\\\');\n\t\t\tfmt_putc(fmt, '0' + ((c / 64) & 7));\n\t\t\tfmt_putc(fmt, '0' + ((c / 8) & 7));\n\t\t\tfmt_putc(fmt, '0' + ((c) & 7));\n\t\t}\n\t\telse\n\t\t\tfmt_putc(fmt, c);\n\t}\n\tfmt_putc(fmt, ')');\n}\n\nstatic void fmt_hex(struct fmt *fmt, pdf_obj *obj)\n{\n\tchar *s = pdf_to_str_buf(obj);\n\tint n = pdf_to_str_len(obj);\n\tint i, b, c;\n\n\tfmt_putc(fmt, '<');\n\tfor (i = 0; i < n; i++) {\n\t\tb = (unsigned char) s[i];\n\t\tc = (b >> 4) & 0x0f;\n\t\tfmt_putc(fmt, c < 0xA ? c + '0' : c + 'A' - 0xA);\n\t\tc = (b) & 0x0f;\n\t\tfmt_putc(fmt, c < 0xA ? c + '0' : c + 'A' - 0xA);\n\t}\n\tfmt_putc(fmt, '>');\n}\n\nstatic void fmt_name(struct fmt *fmt, pdf_obj *obj)\n{\n\tunsigned char *s = (unsigned char *) pdf_to_name(obj);\n\tint i, c;\n\n\tfmt_putc(fmt, '/');\n\n\tfor (i = 0; s[i]; i++)\n\t{\n\t\tif (isdelim(s[i]) || iswhite(s[i]) ||\n\t\t\ts[i] == '#' || s[i] < 32 || s[i] >= 127)\n\t\t{\n\t\t\tfmt_putc(fmt, '#');\n\t\t\tc = (s[i] >> 4) & 0xf;\n\t\t\tfmt_putc(fmt, c < 0xA ? c + '0' : c + 'A' - 0xA);\n\t\t\tc = s[i] & 0xf;\n\t\t\tfmt_putc(fmt, c < 0xA ? c + '0' : c + 'A' - 0xA);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfmt_putc(fmt, s[i]);\n\t\t}\n\t}\n}\n\nstatic void fmt_array(struct fmt *fmt, pdf_obj *obj)\n{\n\tint i, n;\n\n\tn = pdf_array_len(obj);\n\tif (fmt->tight) {\n\t\tfmt_putc(fmt, '[');\n\t\tfor (i = 0; i < n; i++) {\n\t\t\tfmt_obj(fmt, pdf_array_get(obj, i));\n\t\t\tfmt_sep(fmt);\n\t\t}\n\t\tfmt_putc(fmt, ']');\n\t}\n\telse {\n\t\tfmt_puts(fmt, \"[ \");\n\t\tfor (i = 0; i < n; i++) {\n\t\t\tif (fmt->col > 60) {\n\t\t\t\tfmt_putc(fmt, '\\n');\n\t\t\t\tfmt_indent(fmt);\n\t\t\t}\n\t\t\tfmt_obj(fmt, pdf_array_get(obj, i));\n\t\t\tfmt_putc(fmt, ' ');\n\t\t}\n\t\tfmt_putc(fmt, ']');\n\t\tfmt_sep(fmt);\n\t}\n}\n\nstatic void fmt_dict(struct fmt *fmt, pdf_obj *obj)\n{\n\tint i, n;\n\tpdf_obj *key, *val;\n\n\tn = pdf_dict_len(obj);\n\tif (fmt->tight) {\n\t\tfmt_puts(fmt, \"<<\");\n\t\tfor (i = 0; i < n; i++) {\n\t\t\tfmt_obj(fmt, pdf_dict_get_key(obj, i));\n\t\t\tfmt_sep(fmt);\n\t\t\tfmt_obj(fmt, pdf_dict_get_val(obj, i));\n\t\t\tfmt_sep(fmt);\n\t\t}\n\t\tfmt_puts(fmt, \">>\");\n\t}\n\telse {\n\t\tfmt_puts(fmt, \"<<\\n\");\n\t\tfmt->indent ++;\n\t\tfor (i = 0; i < n; i++) {\n\t\t\tkey = pdf_dict_get_key(obj, i);\n\t\t\tval = pdf_dict_get_val(obj, i);\n\t\t\tfmt_indent(fmt);\n\t\t\tfmt_obj(fmt, key);\n\t\t\tfmt_putc(fmt, ' ');\n\t\t\tif (!pdf_is_indirect(val) && pdf_is_array(val))\n\t\t\t\tfmt->indent ++;\n\t\t\tfmt_obj(fmt, val);\n\t\t\tfmt_putc(fmt, '\\n');\n\t\t\tif (!pdf_is_indirect(val) && pdf_is_array(val))\n\t\t\t\tfmt->indent --;\n\t\t}\n\t\tfmt->indent --;\n\t\tfmt_indent(fmt);\n\t\tfmt_puts(fmt, \">>\");\n\t}\n}\n\nstatic void fmt_obj(struct fmt *fmt, pdf_obj *obj)\n{\n\tchar buf[256];\n\n\tif (!obj)\n\t\tfmt_puts(fmt, \"<NULL>\");\n\telse if (pdf_is_indirect(obj))\n\t{\n\t\tfz_snprintf(buf, sizeof buf, \"%d %d R\", pdf_to_num(obj), pdf_to_gen(obj));\n\t\tfmt_puts(fmt, buf);\n\t}\n\telse if (pdf_is_null(obj))\n\t\tfmt_puts(fmt, \"null\");\n\telse if (pdf_is_bool(obj))\n\t\tfmt_puts(fmt, pdf_to_bool(obj) ? \"true\" : \"false\");\n\telse if (pdf_is_int(obj))\n\t{\n\t\tfz_snprintf(buf, sizeof buf, \"%d\", pdf_to_int(obj));\n\t\tfmt_puts(fmt, buf);\n\t}\n\telse if (pdf_is_real(obj))\n\t{\n\t\tfz_snprintf(buf, sizeof buf, \"%g\", pdf_to_real(obj));\n\t\tfmt_puts(fmt, buf);\n\t}\n\telse if (pdf_is_string(obj))\n\t{\n\t\tchar *str = pdf_to_str_buf(obj);\n\t\tint len = pdf_to_str_len(obj);\n\t\tint added = 0;\n\t\tint i, c;\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tc = (unsigned char)str[i];\n\t\t\tif (c != 0 && strchr(\"()\\\\\\n\\r\\t\\b\\f\", c))\n\t\t\t\tadded ++;\n\t\t\telse if (c < 32 || c >= 127)\n\t\t\t\tadded += 3;\n\t\t}\n\t\tif (added < len)\n\t\t\tfmt_str(fmt, obj);\n\t\telse\n\t\t\tfmt_hex(fmt, obj);\n\t}\n\telse if (pdf_is_name(obj))\n\t\tfmt_name(fmt, obj);\n\telse if (pdf_is_array(obj))\n\t\tfmt_array(fmt, obj);\n\telse if (pdf_is_dict(obj))\n\t\tfmt_dict(fmt, obj);\n\telse\n\t\tfmt_puts(fmt, \"<unknown object>\");\n}\n\nint\npdf_sprint_obj(char *s, int n, pdf_obj *obj, int tight)\n{\n\tstruct fmt fmt;\n\n\tfmt.indent = 0;\n\tfmt.col = 0;\n\tfmt.sep = 0;\n\tfmt.last = 0;\n\n\tfmt.tight = tight;\n\tfmt.buf = s;\n\tfmt.cap = n;\n\tfmt.len = 0;\n\tfmt_obj(&fmt, obj);\n\n\tif (fmt.buf && fmt.len < fmt.cap)\n\t\tfmt.buf[fmt.len] = '\\0';\n\n\treturn fmt.len;\n}\n\nint\npdf_fprint_obj(FILE *fp, pdf_obj *obj, int tight)\n{\n\tchar buf[1024];\n\tchar *ptr;\n\tint n;\n\n\tn = pdf_sprint_obj(NULL, 0, obj, tight);\n\tif ((n + 1) < sizeof buf)\n\t{\n\t\tpdf_sprint_obj(buf, sizeof buf, obj, tight);\n\t\tfputs(buf, fp);\n\t\tfputc('\\n', fp);\n\t}\n\telse\n\t{\n\t\tptr = fz_malloc(obj->doc->ctx, n + 1);\n\t\tpdf_sprint_obj(ptr, n + 1, obj, tight);\n\t\tfputs(ptr, fp);\n\t\tfputc('\\n', fp);\n\t\tfz_free(obj->doc->ctx, ptr);\n\t}\n\treturn n;\n}\n\nint pdf_output_obj(fz_output *out, pdf_obj *obj, int tight)\n{\n\tchar buf[1024];\n\tchar *ptr;\n\tint n;\n\n\tn = pdf_sprint_obj(NULL, 0, obj, tight);\n\tif ((n + 1) < sizeof buf)\n\t{\n\t\tpdf_sprint_obj(buf, sizeof buf, obj, tight);\n\t\tfz_printf(out, \"%s\\n\", buf);\n\t}\n\telse\n\t{\n\t\tptr = fz_malloc(obj->doc->ctx, n + 1);\n\t\tpdf_sprint_obj(ptr, n + 1, obj, tight);\n\t\tfz_printf(out, \"%s\\n\", ptr);\n\t\tfz_free(obj->doc->ctx, ptr);\n\t}\n\treturn n;\n}\n\n#ifndef NDEBUG\nvoid\npdf_print_obj(pdf_obj *obj)\n{\n\tpdf_fprint_obj(stdout, obj, 0);\n}\n\nvoid\npdf_print_ref(pdf_obj *ref)\n{\n\tpdf_print_obj(pdf_resolve_indirect(ref));\n}\n#endif\n\nint pdf_obj_refs(pdf_obj *ref)\n{\n\treturn (ref ? ref->refs : 0);\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-op-buffer.c",
    "content": "#include \"pdf-interpret-imp.h\"\n\ntypedef struct pdf_buffer_state_s\n{\n\tfz_context *ctx;\n\tfz_buffer *buffer;\n\tfz_output *out;\n}\npdf_buffer_state;\n\nstatic void\nput_hexstring(pdf_csi *csi, fz_output *out)\n{\n\tint i;\n\n\tfz_printf(out, \"<\");\n\tfor (i = 0; i < csi->string_len; i++)\n\t\tfz_printf(out, \"%02x\", csi->string[i]);\n\tfz_printf(out, \">\");\n}\n\nstatic void\nput_string(pdf_csi *csi, fz_output *out)\n{\n\tint i;\n\n\tfor (i=0; i < csi->string_len; i++)\n\t\tif (csi->string[i] < 32 || csi->string[i] >= 127)\n\t\t\tbreak;\n\tif (i < csi->string_len)\n\t\tput_hexstring(csi, out);\n\telse\n\t{\n\t\tfz_printf(out, \"(\");\n\t\tfor (i = 0; i < csi->string_len; i++)\n\t\t{\n\t\t\tchar c = csi->string[i];\n\t\t\tswitch (c)\n\t\t\t{\n\t\t\tcase '(':\n\t\t\t\tfz_printf(out, \"\\\\(\");\n\t\t\t\tbreak;\n\t\t\tcase ')':\n\t\t\t\tfz_printf(out, \"\\\\)\");\n\t\t\t\tbreak;\n\t\t\tcase '\\\\':\n\t\t\t\tfz_printf(out, \"\\\\\\\\\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tfz_printf(out, \"%c\", csi->string[i]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfz_printf(out, \")\");\n\t}\n}\n\nstatic void\nput_string_or_obj(pdf_csi *csi, fz_output *out)\n{\n\tif (csi->string_len)\n\t\tput_string(csi, out);\n\telse\n\t\tpdf_output_obj(out, csi->obj, 1);\n}\n\nstatic void\npdf_buffer_dquote(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f %f \", csi->stack[0], csi->stack[1]);\n\tput_string_or_obj(csi, state->out);\n\tfz_printf(state->out, \" \\\"\\n\");\n}\n\nstatic void\npdf_buffer_squote(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tput_string_or_obj(csi, state->out);\n\tfz_printf(state->out, \" \\'\\n\");\n}\n\nstatic void\npdf_buffer_B(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"B\\n\");\n}\n\nstatic void\npdf_buffer_Bstar(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"B*\\n\");\n}\n\nstatic void\npdf_buffer_BDC(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"/%s \", csi->name);\n\tpdf_output_obj(state->out, csi->obj, 1);\n\tfz_printf(state->out, \" BDC\\n\");\n}\n\nstatic void\npdf_buffer_BI(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\tint len, i;\n\tunsigned char *data;\n\tfz_compressed_buffer *cbuf;\n\tfz_buffer *buffer;\n\tconst char *match;\n\tconst char *match2;\n\tpdf_obj *filter;\n\tfz_context *ctx = csi->doc->ctx;\n\n\tif (csi->img == NULL)\n\t\treturn;\n\tcbuf = csi->img->buffer;\n\tif (cbuf == NULL)\n\t\treturn;\n\tbuffer = cbuf->buffer;\n\tif (buffer == NULL)\n\t\treturn;\n\n\t/* Tweak the /Filter entry in csi->obj to match the buffer params */\n\tswitch (cbuf->params.type)\n\t{\n\tcase FZ_IMAGE_JPEG:\n\t\tmatch = \"DCTDecode\";\n\t\tmatch2 = \"DCT\";\n\t\tbreak;\n\tcase FZ_IMAGE_FAX:\n\t\tmatch = \"CCITTFaxDecode\";\n\t\tmatch2 = \"CCF\";\n\t\tbreak;\n\tcase FZ_IMAGE_RAW:\n\t\tmatch = NULL;\n\t\tmatch2 = NULL;\n\t\tbreak;\n\tcase FZ_IMAGE_RLD:\n\t\tmatch = \"RunLengthDecode\";\n\t\tmatch2 = \"RL\";\n\t\tbreak;\n\tcase FZ_IMAGE_FLATE:\n\t\tmatch = \"FlateDecode\";\n\t\tmatch2 = \"Fl\";\n\t\tbreak;\n\tcase FZ_IMAGE_LZW:\n\t\tmatch = \"LZWDecode\";\n\t\tmatch2 = \"LZW\";\n\t\tbreak;\n\tdefault:\n\t\tfz_warn(ctx, \"Unsupported type (%d) of inline image\", cbuf->params.type);\n\t\treturn;\n\t}\n\n\tfilter = pdf_dict_gets(csi->obj, \"Filter\");\n\tif (filter == NULL)\n\t\tfilter = pdf_dict_gets(csi->obj, \"F\");\n\tif (match == NULL)\n\t{\n\t\t/* Remove any filter entry (e.g. Ascii85Decode) */\n\t\tif (filter)\n\t\t{\n\t\t\tpdf_dict_dels(csi->obj, \"Filter\");\n\t\t\tpdf_dict_dels(csi->obj, \"F\");\n\t\t}\n\t\tpdf_dict_dels(csi->obj, \"DecodeParms\");\n\t\tpdf_dict_dels(csi->obj, \"DP\");\n\t}\n\telse if (pdf_is_array(filter))\n\t{\n\t\tint l = pdf_array_len(filter);\n\t\tpdf_obj *o = (l == 0 ? NULL : pdf_array_get(filter, l-1));\n\t\tconst char *fil = pdf_to_name(o);\n\n\t\tif (l == 0 || (strcmp(fil, match) && strcmp(fil, match2)))\n\t\t{\n\t\t\tfz_warn(ctx, \"Unexpected Filter configuration in inline image\");\n\t\t\treturn;\n\t\t}\n\t\tpdf_dict_puts(csi->obj, \"F\", o);\n\n\t\to = pdf_dict_gets(csi->obj, \"DecodeParms\");\n\t\tif (o == NULL)\n\t\t\to = pdf_dict_gets(csi->obj, \"DP\");\n\t\tif (o)\n\t\t{\n\t\t\to = pdf_array_get(o, l-1);\n\t\t\tif (o)\n\t\t\t\tpdf_dict_puts(csi->obj, \"DP\", o);\n\t\t\telse\n\t\t\t\tpdf_dict_dels(csi->obj, \"DP\");\n\t\t\tpdf_dict_dels(csi->obj, \"DecodeParms\");\n\t\t}\n\t}\n\telse\n\t{\n\t\t/* It's a singleton. It must be correct */\n\t}\n\n\tfz_printf(state->out, \"BI\\n\");\n\n\tlen = pdf_dict_len(csi->obj);\n\tfor (i = 0; i < len; i++)\n\t{\n\t\tpdf_output_obj(state->out, pdf_dict_get_key(csi->obj, i), 1);\n\t\tpdf_output_obj(state->out, pdf_dict_get_val(csi->obj, i), 1);\n\t}\n\tfz_printf(state->out, \"ID\\n\");\n\n\tbuffer = csi->img->buffer->buffer;\n\tlen = buffer->len;\n\tdata = buffer->data;\n\tfor (i = 0; i < len; i++)\n\t{\n\t\tfz_printf(state->out, \"%c\", data[i]);\n\t}\n\n\tfz_printf(state->out, \"\\nEI\\n\");\n}\n\nstatic void\npdf_buffer_BMC(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"/%s BMC\\n\", csi->name);\n}\n\nstatic void\npdf_buffer_BT(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"BT\\n\");\n}\n\nstatic void\npdf_buffer_BX(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"BX\\n\");\n}\n\nstatic void\npdf_buffer_CS(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"/%s CS\\n\", csi->name);\n}\n\nstatic void\npdf_buffer_DP(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"/%s \", csi->name);\n\tpdf_output_obj(state->out, csi->obj, 1);\n\tfz_printf(state->out, \" DP\\n\");\n}\n\nstatic void\npdf_buffer_EMC(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"EMC\\n\");\n}\n\nstatic void\npdf_buffer_ET(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"ET\\n\");\n}\n\nstatic void\npdf_buffer_EX(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"EX\\n\");\n}\n\nstatic void\npdf_buffer_F(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"F\\n\");\n}\n\nstatic void\npdf_buffer_G(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f G\\n\", csi->stack[0]);\n}\n\nstatic void\npdf_buffer_J(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%d J\\n\", (int)csi->stack[0]);\n}\n\nstatic void\npdf_buffer_K(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f %f %f %f K\\n\", csi->stack[0],\n\t\tcsi->stack[1], csi->stack[2], csi->stack[3]);\n}\n\nstatic void\npdf_buffer_M(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f M\\n\", csi->stack[0]);\n}\n\nstatic void\npdf_buffer_MP(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"/%s MP\\n\", csi->name);\n}\n\nstatic void\npdf_buffer_Q(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"Q\\n\");\n}\n\nstatic void\npdf_buffer_RG(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f %f %f RG\\n\", csi->stack[0], csi->stack[1], csi->stack[2]);\n}\n\nstatic void\npdf_buffer_S(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"S\\n\");\n}\n\nstatic void\npdf_buffer_SC(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\tint i;\n\n\tfor (i = 0; i < csi->top; i++)\n\t\tfz_printf(state->out, \"%f \", csi->stack[i]);\n\tfz_printf(state->out, \"SC\\n\");\n}\n\nstatic void\npdf_buffer_SCN(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\tint i;\n\n\tfor (i = 0; i < csi->top; i++)\n\t\tfz_printf(state->out, \"%f \", csi->stack[i]);\n\tif (csi->name[0])\n\t\tfz_printf(state->out, \"/%s \", csi->name);\n\tfz_printf(state->out, \"SCN\\n\");\n}\n\nstatic void\npdf_buffer_Tstar(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"T*\\n\");\n}\n\nstatic void\npdf_buffer_TD(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f %f TD\\n\", csi->stack[0], csi->stack[1]);\n}\n\nstatic void\npdf_buffer_TJ(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tpdf_output_obj(state->out, csi->obj, 1);\n\tfz_printf(state->out, \" TJ\\n\");\n}\n\nstatic void\npdf_buffer_TL(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f TL\\n\", csi->stack[0]);\n}\n\nstatic void\npdf_buffer_Tc(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f Tc\\n\", csi->stack[0]);\n}\n\nstatic void\npdf_buffer_Td(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f %f Td\\n\", csi->stack[0], csi->stack[1]);\n}\n\nstatic void\npdf_buffer_Tj(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tput_string_or_obj(csi, state->out);\n\tfz_printf(state->out, \" Tj\\n\");\n}\n\nstatic void\npdf_buffer_Tm(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f %f %f %f %f %f Tm\\n\",\n\t\tcsi->stack[0], csi->stack[1], csi->stack[2],\n\t\tcsi->stack[3], csi->stack[4], csi->stack[5]);\n}\n\nstatic void\npdf_buffer_Tr(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f Tr\\n\", csi->stack[0]);\n}\n\nstatic void\npdf_buffer_Ts(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f Ts\\n\", csi->stack[0]);\n}\n\nstatic void\npdf_buffer_Tw(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f Tw\\n\", csi->stack[0]);\n}\n\nstatic void\npdf_buffer_Tz(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f Tz\\n\", csi->stack[0]);\n}\n\nstatic void\npdf_buffer_W(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"W\\n\");\n}\n\nstatic void\npdf_buffer_Wstar(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"W*\\n\");\n}\n\nstatic void\npdf_buffer_b(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"b\\n\");\n}\n\nstatic void\npdf_buffer_bstar(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"b*\\n\");\n}\n\nstatic void\npdf_buffer_c(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f %f %f %f %f %f c\\n\",\n\t\tcsi->stack[0], csi->stack[1], csi->stack[2],\n\t\tcsi->stack[3], csi->stack[4], csi->stack[5]);\n}\n\nstatic void\npdf_buffer_cm(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f %f %f %f %f %f cm\\n\",\n\t\tcsi->stack[0], csi->stack[1], csi->stack[2],\n\t\tcsi->stack[3], csi->stack[4], csi->stack[5]);\n}\n\nstatic void\npdf_buffer_cs(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"/%s cs\\n\", csi->name);\n}\n\nstatic void\npdf_buffer_d(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tpdf_output_obj(state->out, csi->obj, 1);\n\tfz_printf(state->out, \" %f d\\n\", csi->stack[0]);\n}\n\nstatic void\npdf_buffer_d0(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f %f d0\\n\", csi->stack[0], csi->stack[1]);\n}\n\nstatic void\npdf_buffer_d1(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f %f %f %f %f %f d1\\n\",\n\t\tcsi->stack[0], csi->stack[1], csi->stack[2],\n\t\tcsi->stack[3], csi->stack[4], csi->stack[5]);\n}\n\nstatic void\npdf_buffer_f(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"f\\n\");\n}\n\nstatic void\npdf_buffer_fstar(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"f*\\n\");\n}\n\nstatic void\npdf_buffer_g(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f g\\n\", csi->stack[0]);\n}\n\nstatic void\npdf_buffer_h(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"h\\n\");\n}\n\nstatic void\npdf_buffer_i(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f i\\n\", csi->stack[0]);\n}\n\nstatic void\npdf_buffer_j(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%d j\\n\", (int)csi->stack[0]);\n}\n\nstatic void\npdf_buffer_k(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f %f %f %f k\\n\", csi->stack[0],\n\t\tcsi->stack[1], csi->stack[2], csi->stack[3]);\n}\n\nstatic void\npdf_buffer_l(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f %f l\\n\", csi->stack[0], csi->stack[1]);\n}\n\nstatic void\npdf_buffer_m(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f %f m\\n\", csi->stack[0], csi->stack[1]);\n}\n\nstatic void\npdf_buffer_n(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"n\\n\");\n}\n\nstatic void\npdf_buffer_q(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"q\\n\");\n}\n\nstatic void\npdf_buffer_re(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f %f %f %f re\\n\", csi->stack[0],\n\t\tcsi->stack[1], csi->stack[2], csi->stack[3]);\n}\n\nstatic void\npdf_buffer_rg(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f %f %f rg\\n\",\n\t\tcsi->stack[0], csi->stack[1], csi->stack[2]);\n}\n\nstatic void\npdf_buffer_ri(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"/%s ri\\n\", csi->name);\n}\n\nstatic void\npdf_buffer_s(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"s\\n\");\n}\n\nstatic void\npdf_buffer_sc(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\tint i;\n\n\tfor (i = 0; i < csi->top; i++)\n\t\tfz_printf(state->out, \"%f \", csi->stack[i]);\n\tfz_printf(state->out, \"sc\\n\");\n}\n\nstatic void\npdf_buffer_scn(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\tint i;\n\n\tfor (i = 0; i < csi->top; i++)\n\t\tfz_printf(state->out, \"%f \", csi->stack[i]);\n\tif (csi->name[0])\n\t\tfz_printf(state->out, \"/%s \", csi->name);\n\tfz_printf(state->out, \"scn\\n\");\n}\n\nstatic void\npdf_buffer_v(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f %f %f %f v\\n\", csi->stack[0],\n\t\tcsi->stack[1], csi->stack[2], csi->stack[3]);\n}\n\nstatic void\npdf_buffer_w(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f w\\n\", csi->stack[0]);\n}\n\nstatic void\npdf_buffer_y(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"%f %f %f %f y\\n\", csi->stack[0],\n\t\tcsi->stack[1], csi->stack[2], csi->stack[3]);\n}\n\nstatic void\npdf_buffer_Do(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"/%s Do\\n\", csi->name);\n}\n\nstatic void\npdf_buffer_Tf(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"/%s %f Tf\\n\", csi->name, csi->stack[0]);\n}\n\nstatic void\npdf_buffer_gs(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"/%s gs\\n\", csi->name);\n}\n\nstatic void\npdf_buffer_sh(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\n\tfz_printf(state->out, \"/%s sh\\n\", csi->name);\n}\n\nstatic void\nfree_processor_buffer(pdf_csi *csi, void *state_)\n{\n\tpdf_buffer_state *state = (pdf_buffer_state *)state_;\n\tfz_context *ctx = state->ctx;\n\n\tfz_close_output(state->out);\n\tfz_free(ctx, state);\n}\n\nstatic void\nprocess_annot(pdf_csi *csi, void *state, pdf_obj *resources, pdf_annot *annot)\n{\n\tfz_context *ctx = csi->doc->ctx;\n\tpdf_xobject *xobj = annot->ap;\n\n\t/* Avoid infinite recursion */\n\tif (xobj == NULL || pdf_mark_obj(xobj->me))\n\t\treturn;\n\n\tfz_try(ctx)\n\t{\n\t\tif (xobj->resources)\n\t\t\tresources = xobj->resources;\n\n\t\tpdf_process_contents_object(csi, resources, xobj->contents);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_unmark_obj(xobj->me);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void\nprocess_stream(pdf_csi *csi, void *state, pdf_lexbuf *buf)\n{\n\tpdf_process_stream(csi, buf);\n}\n\nstatic void\nprocess_contents(pdf_csi *csi, void *state, pdf_obj *resources, pdf_obj *contents)\n{\n\tpdf_process_contents_object(csi, resources, contents);\n}\n\nstatic const pdf_processor pdf_processor_buffer =\n{\n\t{\n\tpdf_buffer_dquote,\n\tpdf_buffer_squote,\n\tpdf_buffer_B,\n\tpdf_buffer_Bstar,\n\tpdf_buffer_BDC,\n\tpdf_buffer_BI,\n\tpdf_buffer_BMC,\n\tpdf_buffer_BT,\n\tpdf_buffer_BX,\n\tpdf_buffer_CS,\n\tpdf_buffer_DP,\n\tpdf_buffer_EMC,\n\tpdf_buffer_ET,\n\tpdf_buffer_EX,\n\tpdf_buffer_F,\n\tpdf_buffer_G,\n\tpdf_buffer_J,\n\tpdf_buffer_K,\n\tpdf_buffer_M,\n\tpdf_buffer_MP,\n\tpdf_buffer_Q,\n\tpdf_buffer_RG,\n\tpdf_buffer_S,\n\tpdf_buffer_SC,\n\tpdf_buffer_SCN,\n\tpdf_buffer_Tstar,\n\tpdf_buffer_TD,\n\tpdf_buffer_TJ,\n\tpdf_buffer_TL,\n\tpdf_buffer_Tc,\n\tpdf_buffer_Td,\n\tpdf_buffer_Tj,\n\tpdf_buffer_Tm,\n\tpdf_buffer_Tr,\n\tpdf_buffer_Ts,\n\tpdf_buffer_Tw,\n\tpdf_buffer_Tz,\n\tpdf_buffer_W,\n\tpdf_buffer_Wstar,\n\tpdf_buffer_b,\n\tpdf_buffer_bstar,\n\tpdf_buffer_c,\n\tpdf_buffer_cm,\n\tpdf_buffer_cs,\n\tpdf_buffer_d,\n\tpdf_buffer_d0,\n\tpdf_buffer_d1,\n\tpdf_buffer_f,\n\tpdf_buffer_fstar,\n\tpdf_buffer_g,\n\tpdf_buffer_h,\n\tpdf_buffer_i,\n\tpdf_buffer_j,\n\tpdf_buffer_k,\n\tpdf_buffer_l,\n\tpdf_buffer_m,\n\tpdf_buffer_n,\n\tpdf_buffer_q,\n\tpdf_buffer_re,\n\tpdf_buffer_rg,\n\tpdf_buffer_ri,\n\tpdf_buffer_s,\n\tpdf_buffer_sc,\n\tpdf_buffer_scn,\n\tpdf_buffer_v,\n\tpdf_buffer_w,\n\tpdf_buffer_y,\n\tpdf_buffer_Do,\n\tpdf_buffer_Tf,\n\tpdf_buffer_gs,\n\tpdf_buffer_sh,\n\tfree_processor_buffer\n\t},\n\tprocess_annot,\n\tprocess_stream,\n\tprocess_contents\n};\n\npdf_process *pdf_process_buffer(pdf_process *process, fz_context *ctx, fz_buffer *buffer)\n{\n\tfz_output *out = fz_new_output_with_buffer(ctx, buffer);\n\tpdf_buffer_state *p = NULL;\n\n\tfz_var(p);\n\n\tfz_try(ctx)\n\t{\n\t\tp = fz_malloc_struct(ctx, pdf_buffer_state);\n\t\tp->buffer = buffer;\n\t\tp->out = out;\n\t\tp->ctx = ctx;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_close_output(out);\n\t\tfz_rethrow(ctx);\n\t}\n\n\tprocess->state = p;\n\tprocess->processor = &pdf_processor_buffer;\n\treturn process;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-op-filter.c",
    "content": "#include \"pdf-interpret-imp.h\"\n\ntypedef struct filter_gstate_s filter_gstate;\n\ntypedef enum\n{\n\tFLUSH_CTM = 1,\n\tFLUSH_COLOR = 2,\n\tFLUSH_COLOR_S = 4,\n\n\tFLUSH_ALL = 7,\n\tFLUSH_STROKE = 1+4,\n\tFLUSH_FILL = 1+2\n} gstate_flush_flags;\n\nstruct filter_gstate_s\n{\n\tfilter_gstate *next;\n\tint pushed;\n\tfz_matrix ctm;\n\tfz_matrix current_ctm;\n\tfloat color[FZ_MAX_COLORS];\n\tint color_n;\n\tfloat current_color[FZ_MAX_COLORS];\n\tint current_color_n;\n\tfloat color_s[FZ_MAX_COLORS];\n\tint color_s_n;\n\tfloat current_color_s[FZ_MAX_COLORS];\n\tint current_color_s_n;\n\tchar cs[256];\n\tchar cs_s[256];\n\tchar cs_name[256];\n\tchar cs_name_s[256];\n\tchar current_cs[256];\n\tchar current_cs_s[256];\n\tchar current_cs_name[256];\n\tchar current_cs_name_s[256];\n};\n\ntypedef struct pdf_filter_state_s\n{\n\tpdf_process process;\n\tfz_context *ctx;\n\tfilter_gstate *gstate;\n\tpdf_obj *resources;\n} pdf_filter_state;\n\nstatic void insert_resource_name(pdf_csi *csi, pdf_filter_state *state, const char *key, const char *name)\n{\n\tpdf_obj *xobj;\n\tpdf_obj *obj;\n\n\tif (!state->resources || !name || name[0] == 0)\n\t\treturn;\n\n\txobj = pdf_dict_gets(csi->rdb, key);\n\tobj = pdf_dict_gets(xobj, name);\n\n\txobj = pdf_dict_gets(state->resources, key);\n\tif (xobj == NULL) {\n\t\txobj = pdf_new_dict(csi->doc, 1);\n\t\tpdf_dict_puts_drop(state->resources, key, xobj);\n\t}\n\tpdf_dict_putp(xobj, name, obj);\n}\n\nstatic void insert_resource(pdf_csi *csi, pdf_filter_state *state, const char *key)\n{\n\tinsert_resource_name(csi, state, key, csi->name);\n}\n\nstatic inline void call_op(pdf_csi *csi, pdf_filter_state *state, int op)\n{\n\tpdf_process_op(csi, op, &state->process);\n}\n\nstatic void filter_push(pdf_csi *csi, pdf_filter_state *state)\n{\n\tfilter_gstate *gstate = state->gstate;\n\tfilter_gstate *new_gstate = fz_malloc_struct(state->ctx, filter_gstate);\n\n\t*new_gstate = *gstate;\n\tnew_gstate->pushed = 0;\n\tnew_gstate->next = gstate;\n\tstate->gstate = new_gstate;\n}\n\nstatic int filter_pop(pdf_csi *csi, pdf_filter_state *state)\n{\n\tfilter_gstate *gstate = state->gstate;\n\tfilter_gstate *old = gstate->next;\n\n\t/* We are at the top, so nothing to pop! */\n\tif (old == NULL)\n\t\treturn 1;\n\n\tif (gstate->pushed)\n\t\tcall_op(csi, state, PDF_OP_Q);\n\n\tfz_free(state->ctx, gstate);\n\tstate->gstate = old;\n\treturn 0;\n}\n\nstatic void forward(pdf_csi *csi, pdf_filter_state *state, int op, float *f_argv, int f_argc, char *arg)\n{\n\tint top = csi->top;\n\tint to_save = top;\n\tfloat save_f[FZ_MAX_COLORS];\n\tchar save_name[sizeof(csi->name)];\n\tint i;\n\n\t/* Store the stack */\n\tif (to_save > f_argc)\n\t\tto_save = 6;\n\tfor (i = 0; i < to_save; i++)\n\t{\n\t\tsave_f[i] = csi->stack[i];\n\t\tcsi->stack[i] = f_argv[i];\n\t}\n\tfor (;i < f_argc; i++)\n\t{\n\t\tcsi->stack[i] = f_argv[i];\n\t}\n\tcsi->top = f_argc;\n\n\t/* Store the name */\n\tfz_strlcpy(save_name, csi->name, sizeof(csi->name));\n\tif (arg)\n\t{\n\t\tfz_strlcpy(csi->name, arg, sizeof(csi->name));\n\t}\n\telse\n\t{\n\t\tcsi->name[0] = 0;\n\t}\n\n\tcall_op(csi, state, op);\n\n\t/* Restore the name */\n\tfz_strlcpy(csi->name, save_name, sizeof(save_name));\n\n\t/* Restore the stack */\n\tfor (i = 0; i < to_save; i++)\n\t\tcsi->stack[i] = save_f[i];\n\tcsi->top = top;\n}\n\n/* We never allow the topmost gstate to be changed. This allows us\n * to pop back to the zeroth level and be sure that our gstate is\n * sane. This is important for being able to add new operators at\n * the end of pages in a sane way. */\nstatic filter_gstate *\ngstate_to_update(pdf_csi *csi, pdf_filter_state *state)\n{\n\tfilter_gstate *gstate = state->gstate;\n\n\t/* If we're not the top, that's fine */\n\tif (gstate->next != NULL)\n\t\treturn gstate;\n\n\t/* We are the top. Push a group, so we're not */\n\tfilter_push(csi, state);\n\tgstate = state->gstate;\n\tgstate->pushed = 1;\n\tcall_op(csi, state, PDF_OP_q);\n\n\treturn state->gstate;\n}\n\nstatic void filter_flush(pdf_csi *csi, pdf_filter_state *state, int flush)\n{\n\tfilter_gstate *gstate = state->gstate;\n\tint i;\n\n\tif (gstate->pushed == 0)\n\t{\n\t\tgstate->pushed = 1;\n\t\tcall_op(csi, state, PDF_OP_q);\n\t}\n\n\tif (flush & FLUSH_CTM)\n\t{\n\t\tif (gstate->ctm.a != 1 || gstate->ctm.b != 0 ||\n\t\t\tgstate->ctm.c != 0 || gstate->ctm.d != 1 ||\n\t\t\tgstate->ctm.e != 0 || gstate->ctm.f != 0)\n\t\t{\n\t\t\tfz_matrix current = gstate->current_ctm;\n\n\t\t\tforward(csi, state, PDF_OP_cm, (float *)&gstate->ctm.a, 6, NULL);\n\t\t\tfz_concat(&gstate->current_ctm, &current, &gstate->ctm);\n\t\t\tgstate->ctm.a = 1;\n\t\t\tgstate->ctm.b = 0;\n\t\t\tgstate->ctm.c = 0;\n\t\t\tgstate->ctm.d = 1;\n\t\t\tgstate->ctm.e = 0;\n\t\t\tgstate->ctm.f = 0;\n\t\t}\n\t}\n\tif (flush & FLUSH_COLOR)\n\t{\n\t\tif (strcmp(gstate->cs, gstate->current_cs) ||\n\t\t\tgstate->color_n != gstate->current_color_n)\n\t\t{\n\t\t\t/* Colorspace has changed. Send both colorspace (and\n\t\t\t * color if we have it. */\n\t\t\tif (!strcmp(gstate->cs, \"DeviceRGB\"))\n\t\t\t{\n\t\t\t\tforward(csi, state, PDF_OP_rg, gstate->color, 3, NULL);\n\t\t\t}\n\t\t\telse if (!strcmp(gstate->cs, \"DeviceGray\"))\n\t\t\t{\n\t\t\t\tforward(csi, state, PDF_OP_g, gstate->color, 1, NULL);\n\t\t\t}\n\t\t\telse if (!strcmp(gstate->cs, \"DeviceCMYK\"))\n\t\t\t{\n\t\t\t\tforward(csi, state, PDF_OP_k, gstate->color, 4, NULL);\n\t\t\t}\n\t\t\telse if (gstate->cs_name[0])\n\t\t\t{\n\t\t\t\tif (strcmp(gstate->cs, gstate->current_cs))\n\t\t\t\t{\n\t\t\t\t\tforward(csi, state, PDF_OP_cs, NULL, 0, gstate->cs);\n\t\t\t\t}\n\t\t\t\tforward(csi, state, PDF_OP_scn, gstate->color, gstate->color_n, gstate->cs_name);\n\t\t\t}\n\t\t\telse if (gstate->color_n > 0)\n\t\t\t{\n\t\t\t\tif (strcmp(gstate->cs, gstate->current_cs))\n\t\t\t\t{\n\t\t\t\t\tforward(csi, state, PDF_OP_cs, NULL, 0, gstate->cs);\n\t\t\t\t}\n\t\t\t\tforward(csi, state, PDF_OP_scn, gstate->color, gstate->color_n, NULL);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforward(csi, state, PDF_OP_cs, NULL, 0, gstate->cs);\n\t\t\t}\n\t\t\tstrcpy(gstate->current_cs, gstate->cs);\n\t\t\tstrcpy(gstate->current_cs_name, gstate->cs_name);\n\t\t\tgstate->current_color_n = gstate->color_n;\n\t\t\tfor (i = 0; i < gstate->color_n; i++)\n\t\t\t\tgstate->current_color[i] = gstate->color[i];\n\t\t}\n\t\telse if (strcmp(gstate->cs_name, gstate->current_cs_name))\n\t\t{\n\t\t\t/* Pattern name has changed */\n\t\t\tforward(csi, state, PDF_OP_scn, gstate->color, gstate->color_n, gstate->cs_name);\n\t\t\tstrcpy(gstate->current_cs_name, gstate->cs_name);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* Has the color changed? */\n\t\t\tfor (i = 0; i < gstate->color_n; i++)\n\t\t\t{\n\t\t\t\tif (gstate->color[i] != gstate->current_color[i])\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (i == gstate->color_n)\n\t\t\t{\n\t\t\t\t/* The color has not changed. Do nothing. */\n\t\t\t}\n\t\t\telse if (!strcmp(gstate->cs, \"DeviceRGB\"))\n\t\t\t{\n\t\t\t\tforward(csi, state, PDF_OP_rg, gstate->color, 3, NULL);\n\t\t\t}\n\t\t\telse if (!strcmp(gstate->cs, \"DeviceGray\"))\n\t\t\t{\n\t\t\t\tforward(csi, state, PDF_OP_g, gstate->color, 1, NULL);\n\t\t\t}\n\t\t\telse if (!strcmp(gstate->cs, \"DeviceCMYK\"))\n\t\t\t{\n\t\t\t\tforward(csi, state, PDF_OP_k, gstate->color, 4, NULL);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforward(csi, state, PDF_OP_scn, gstate->color, gstate->color_n, NULL);\n\t\t\t}\n\t\t\tfor (; i < gstate->color_n; i++)\n\t\t\t\tgstate->current_color[i] = gstate->color[i];\n\t\t}\n\t}\n\tif (flush & FLUSH_COLOR_S)\n\t{\n\t\tif (strcmp(gstate->cs_s, gstate->current_cs_s) ||\n\t\t\tgstate->color_s_n != gstate->current_color_s_n)\n\t\t{\n\t\t\t/* Colorspace has changed. Send both colorspace (and\n\t\t\t * color if we have it. */\n\t\t\tif (!strcmp(gstate->cs_s, \"DeviceRGB\"))\n\t\t\t{\n\t\t\t\tforward(csi, state, PDF_OP_RG, gstate->color_s, 3, NULL);\n\t\t\t}\n\t\t\telse if (!strcmp(gstate->cs_s, \"DeviceGray\"))\n\t\t\t{\n\t\t\t\tforward(csi, state, PDF_OP_G, gstate->color_s, 1, NULL);\n\t\t\t}\n\t\t\telse if (!strcmp(gstate->cs_s, \"DeviceCMYK\"))\n\t\t\t{\n\t\t\t\tforward(csi, state, PDF_OP_K, gstate->color_s, 4, NULL);\n\t\t\t}\n\t\t\telse if (gstate->cs_name_s[0])\n\t\t\t{\n\t\t\t\tif (strcmp(gstate->cs_s, gstate->current_cs_s))\n\t\t\t\t{\n\t\t\t\t\tforward(csi, state, PDF_OP_CS, NULL, 0, gstate->cs_s);\n\t\t\t\t}\n\t\t\t\tforward(csi, state, PDF_OP_SCN, gstate->color_s, gstate->color_s_n, gstate->cs_name_s);\n\t\t\t}\n\t\t\telse if (gstate->color_s_n > 0)\n\t\t\t{\n\t\t\t\tif (strcmp(gstate->cs_s, gstate->current_cs_s))\n\t\t\t\t{\n\t\t\t\t\tforward(csi, state, PDF_OP_CS, NULL, 0, gstate->cs_s);\n\t\t\t\t}\n\t\t\t\tforward(csi, state, PDF_OP_SCN, gstate->color_s, gstate->color_s_n, NULL);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforward(csi, state, PDF_OP_CS, NULL, 0, gstate->cs_s);\n\t\t\t}\n\t\t\tstrcpy(gstate->current_cs_s, gstate->cs_s);\n\t\t\tstrcpy(gstate->current_cs_name_s, gstate->cs_name_s);\n\t\t\tgstate->current_color_s_n = gstate->color_s_n;\n\t\t\tfor (i = 0; i < gstate->color_s_n; i++)\n\t\t\t\tgstate->current_color_s[i] = gstate->color_s[i];\n\t\t}\n\t\telse if (strcmp(gstate->cs_name_s, gstate->current_cs_name_s))\n\t\t{\n\t\t\t/* Pattern name has changed */\n\t\t\tforward(csi, state, PDF_OP_SCN, gstate->color_s, gstate->color_s_n, gstate->cs_name_s);\n\t\t\tstrcpy(gstate->current_cs_name_s, gstate->cs_name_s);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* Has the color changed? */\n\t\t\tint i;\n\n\t\t\tfor (i = 0; i < gstate->color_s_n; i++)\n\t\t\t{\n\t\t\t\tif (gstate->color_s[i] != gstate->current_color_s[i])\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (i == gstate->color_s_n)\n\t\t\t{\n\t\t\t\t/* The color has not changed. Do nothing. */\n\t\t\t}\n\t\t\telse if (!strcmp(gstate->cs_s, \"DeviceRGB\"))\n\t\t\t{\n\t\t\t\tforward(csi, state, PDF_OP_RG, gstate->color_s, 3, NULL);\n\t\t\t}\n\t\t\telse if (!strcmp(gstate->cs_s, \"DeviceGray\"))\n\t\t\t{\n\t\t\t\tforward(csi, state, PDF_OP_G, gstate->color_s, 1, NULL);\n\t\t\t}\n\t\t\telse if (!strcmp(gstate->cs_s, \"DeviceCMYK\"))\n\t\t\t{\n\t\t\t\tforward(csi, state, PDF_OP_K, gstate->color_s, 4, NULL);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforward(csi, state, PDF_OP_SCN, gstate->color_s, gstate->color_s_n, NULL);\n\t\t\t}\n\t\t\tfor (; i < gstate->color_s_n; i++)\n\t\t\t\tgstate->current_color_s[i] = gstate->color_s[i];\n\t\t}\n\t}\n}\n\nstatic void\npdf_filter_dquote(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_ALL);\n\tcall_op(csi, state, PDF_OP_dquote);\n}\n\nstatic void\npdf_filter_squote(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_ALL);\n\tcall_op(csi, state, PDF_OP_squote);\n}\n\nstatic void\npdf_filter_B(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_ALL);\n\tcall_op(csi, state, PDF_OP_B);\n}\n\nstatic void\npdf_filter_Bstar(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_ALL);\n\tcall_op(csi, state, PDF_OP_Bstar);\n}\n\nstatic void\npdf_filter_BDC(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tinsert_resource_name(csi, state, \"Properties\", pdf_to_name(csi->obj));\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_BDC);\n}\n\nstatic void\npdf_filter_BI(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_FILL);\n\tcall_op(csi, state, PDF_OP_BI);\n}\n\nstatic void\npdf_filter_BMC(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_BMC);\n}\n\nstatic void\npdf_filter_BT(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_BT);\n}\n\nstatic void\npdf_filter_BX(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_BX);\n}\n\nstatic void\npdf_filter_CS(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\tfilter_gstate *gstate = gstate_to_update(csi, state);\n\n\tinsert_resource(csi, state, \"ColorSpace\");\n\n\tfz_strlcpy(gstate->cs_s, csi->name, sizeof(gstate->cs_s));\n\tgstate->current_color_s_n = 0;\n}\n\nstatic void\npdf_filter_DP(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tinsert_resource_name(csi, state, \"Properties\", pdf_to_name(csi->obj));\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_DP);\n}\n\nstatic void\npdf_filter_EMC(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_EMC);\n}\n\nstatic void\npdf_filter_ET(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_ET);\n}\n\nstatic void\npdf_filter_EX(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_EX);\n}\n\nstatic void\npdf_filter_F(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_FILL);\n\tcall_op(csi, state, PDF_OP_F);\n}\n\nstatic void\npdf_filter_G(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\tfilter_gstate *gstate = gstate_to_update(csi, state);\n\n\tstrcpy(gstate->cs_s, \"DeviceGray\");\n\tstrcpy(gstate->cs_name_s, \"\");\n\tgstate->color_s[0] = csi->stack[0];\n\tgstate->color_s_n = 1;\n}\n\nstatic void\npdf_filter_J(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_J);\n}\n\nstatic void\npdf_filter_K(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\tfilter_gstate *gstate = gstate_to_update(csi, state);\n\n\tstrcpy(gstate->cs_s, \"DeviceCMYK\");\n\tstrcpy(gstate->cs_name_s, \"\");\n\tgstate->color_s[0] = csi->stack[0];\n\tgstate->color_s[1] = csi->stack[1];\n\tgstate->color_s[2] = csi->stack[2];\n\tgstate->color_s[3] = csi->stack[3];\n\tgstate->color_s_n = 4;\n}\n\nstatic void\npdf_filter_M(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_M);\n}\n\nstatic void\npdf_filter_MP(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_MP);\n}\n\nstatic void\npdf_filter_Q(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_pop(csi, state);\n}\n\nstatic void\npdf_filter_RG(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\tfilter_gstate *gstate = gstate_to_update(csi, state);\n\n\tstrcpy(gstate->cs_s, \"DeviceRGB\");\n\tstrcpy(gstate->cs_name_s, \"\");\n\tgstate->color_s[0] = csi->stack[0];\n\tgstate->color_s[1] = csi->stack[1];\n\tgstate->color_s[2] = csi->stack[2];\n\tgstate->color_s_n = 3;\n}\n\nstatic void\npdf_filter_S(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_STROKE);\n\tcall_op(csi, state, PDF_OP_S);\n}\n\nstatic void\npdf_filter_SCN(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\tfilter_gstate *gstate = gstate_to_update(csi, state);\n\tint i;\n\n\tif (csi->name[0])\n\t\tinsert_resource(csi, state, \"Pattern\");\n\n\tfz_strlcpy(gstate->cs_name_s, csi->name, sizeof(csi->name));\n\tfor (i = 0; i < csi->top; i++)\n\t{\n\t\tgstate->color_s[i] = csi->stack[i];\n\t}\n\tgstate->color_s_n = csi->top;\n}\n\nstatic void\npdf_filter_Tstar(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_CTM);\n\tcall_op(csi, state, PDF_OP_Tstar);\n}\n\nstatic void\npdf_filter_TD(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_CTM);\n\tcall_op(csi, state, PDF_OP_TD);\n}\n\nstatic void\npdf_filter_TJ(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_ALL);\n\tcall_op(csi, state, PDF_OP_TJ);\n}\n\nstatic void\npdf_filter_TL(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_TL);\n}\n\nstatic void\npdf_filter_Tc(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_Tc);\n}\n\nstatic void\npdf_filter_Td(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_CTM);\n\tcall_op(csi, state, PDF_OP_Td);\n}\n\nstatic void\npdf_filter_Tj(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_ALL);\n\tcall_op(csi, state, PDF_OP_Tj);\n}\n\nstatic void\npdf_filter_Tm(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_CTM);\n\tcall_op(csi, state, PDF_OP_Tm);\n}\n\nstatic void\npdf_filter_Tr(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_Tr);\n}\n\nstatic void\npdf_filter_Ts(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_Ts);\n}\n\nstatic void\npdf_filter_Tw(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_Tw);\n}\n\nstatic void\npdf_filter_Tz(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_Tz);\n}\n\nstatic void\npdf_filter_W(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_CTM);\n\tcall_op(csi, state, PDF_OP_W);\n}\n\nstatic void\npdf_filter_Wstar(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_CTM);\n\tcall_op(csi, state, PDF_OP_Wstar);\n}\n\nstatic void\npdf_filter_b(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_ALL);\n\tcall_op(csi, state, PDF_OP_b);\n}\n\nstatic void\npdf_filter_bstar(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_ALL);\n\tcall_op(csi, state, PDF_OP_bstar);\n}\n\nstatic void\npdf_filter_c(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_CTM);\n\tcall_op(csi, state, PDF_OP_c);\n}\n\nstatic void\npdf_filter_cm(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\tfilter_gstate *gstate = gstate_to_update(csi, state);\n\tfz_matrix old, ctm;\n\n\tctm.a = (csi->top > 0 ? csi->stack[0] : 0.0);\n\tctm.b = (csi->top > 1 ? csi->stack[1] : 0.0);\n\tctm.c = (csi->top > 2 ? csi->stack[2] : 0.0);\n\tctm.d = (csi->top > 3 ? csi->stack[3] : 0.0);\n\tctm.e = (csi->top > 4 ? csi->stack[4] : 0.0);\n\tctm.f = (csi->top > 5 ? csi->stack[5] : 0.0);\n\n\t/* If we're being given an identity matrix, don't bother sending it */\n\tif (ctm.a == 1 && ctm.b == 0 && ctm.c == 0 && ctm.d == 1 &&\n\t\tctm.e == 0.0f && ctm.f == 0)\n\t\treturn;\n\n\told = gstate->ctm;\n\tfz_concat(&gstate->ctm, &ctm, &old);\n}\n\nstatic void\npdf_filter_cs(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\tfilter_gstate *gstate = gstate_to_update(csi, state);\n\n\tinsert_resource(csi, state, \"ColorSpace\");\n\n\tfz_strlcpy(gstate->cs, csi->name, sizeof(csi->name));\n\tgstate->color_n = 0;\n}\n\nstatic void\npdf_filter_d(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_d);\n}\n\nstatic void\npdf_filter_d0(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tcall_op(csi, state, PDF_OP_d0);\n}\n\nstatic void\npdf_filter_d1(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tcall_op(csi, state, PDF_OP_d1);\n}\n\nstatic void\npdf_filter_f(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_FILL);\n\tcall_op(csi, state, PDF_OP_f);\n}\n\nstatic void\npdf_filter_fstar(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_FILL);\n\tcall_op(csi, state, PDF_OP_fstar);\n}\n\nstatic void\npdf_filter_g(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\tfilter_gstate *gstate = gstate_to_update(csi, state);\n\n\tstrcpy(gstate->cs, \"DeviceGray\");\n\tstrcpy(gstate->cs_name, \"\");\n\tgstate->color[0] = csi->stack[0];\n\tgstate->color_n = 1;\n}\n\nstatic void\npdf_filter_h(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_CTM);\n\tcall_op(csi, state, PDF_OP_h);\n}\n\nstatic void\npdf_filter_i(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_i);\n}\n\nstatic void\npdf_filter_j(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_j);\n}\n\nstatic void\npdf_filter_k(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\tfilter_gstate *gstate = gstate_to_update(csi, state);\n\n\tstrcpy(gstate->cs, \"DeviceCMYK\");\n\tstrcpy(gstate->cs_name, \"\");\n\tgstate->color[0] = csi->stack[0];\n\tgstate->color[1] = csi->stack[1];\n\tgstate->color[2] = csi->stack[2];\n\tgstate->color[3] = csi->stack[3];\n\tgstate->color_n = 4;\n}\n\nstatic void\npdf_filter_l(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_CTM);\n\tcall_op(csi, state, PDF_OP_l);\n}\n\nstatic void\npdf_filter_m(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_CTM);\n\tcall_op(csi, state, PDF_OP_m);\n}\n\nstatic void\npdf_filter_n(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_CTM);\n\tcall_op(csi, state, PDF_OP_n);\n}\n\nstatic void\npdf_filter_q(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_push(csi, state);\n}\n\nstatic void\npdf_filter_re(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_CTM);\n\tcall_op(csi, state, PDF_OP_re);\n}\n\nstatic void\npdf_filter_rg(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\tfilter_gstate *gstate = gstate_to_update(csi, state);\n\n\tstrcpy(gstate->cs, \"DeviceRGB\");\n\tstrcpy(gstate->cs_name, \"\");\n\tgstate->color[0] = csi->stack[0];\n\tgstate->color[1] = csi->stack[1];\n\tgstate->color[2] = csi->stack[2];\n\tgstate->color_n = 3;\n}\n\nstatic void\npdf_filter_ri(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_ri);\n}\n\nstatic void\npdf_filter_s(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_STROKE);\n\tcall_op(csi, state, PDF_OP_s);\n}\n\nstatic void\npdf_filter_scn(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\tfilter_gstate *gstate = gstate_to_update(csi, state);\n\tint i;\n\n\tif (csi->name[0])\n\t\tinsert_resource(csi, state, \"Pattern\");\n\n\tfz_strlcpy(gstate->cs_name, csi->name, sizeof(csi->name));\n\tfor (i = 0; i < csi->top; i++)\n\t{\n\t\tgstate->color[i] = csi->stack[i];\n\t}\n\tgstate->color_n = csi->top;\n}\n\nstatic void\npdf_filter_v(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_CTM);\n\tcall_op(csi, state, PDF_OP_v);\n}\n\nstatic void\npdf_filter_w(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_w);\n}\n\nstatic void\npdf_filter_y(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tfilter_flush(csi, state, FLUSH_CTM);\n\tcall_op(csi, state, PDF_OP_y);\n}\n\nstatic void\npdf_filter_Do(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tinsert_resource(csi, state, \"XObject\");\n\n\tfilter_flush(csi, state, FLUSH_ALL);\n\tcall_op(csi, state, PDF_OP_Do);\n}\n\nstatic void\npdf_filter_Tf(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tinsert_resource(csi, state, \"Font\");\n\n\tfilter_flush(csi, state, 0);\n\tcall_op(csi, state, PDF_OP_Tf);\n}\n\nstatic void\npdf_filter_gs(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tinsert_resource(csi, state, \"ExtGState\");\n\n\tfilter_flush(csi, state, FLUSH_ALL);\n\tcall_op(csi, state, PDF_OP_gs);\n}\n\nstatic void\npdf_filter_sh(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\tinsert_resource(csi, state, \"Shading\");\n\n\tfilter_flush(csi, state, FLUSH_ALL);\n\tcall_op(csi, state, PDF_OP_sh);\n}\n\nstatic void\nfree_processor_filter(pdf_csi *csi, void *state_)\n{\n\tpdf_filter_state *state = (pdf_filter_state *)state_;\n\n\t/* csi can permissibly be NULL, but only in the case when we have\n\t * failed while setting up csi. So there is nothing to pop. */\n\tif (csi)\n\t{\n\t\twhile (!filter_pop(csi, state))\n\t\t{\n\t\t\t/* Nothing to do in the loop, all work done above */\n\t\t}\n\t}\n\n\tcall_op(csi, state, PDF_OP_END);\n\tfz_free(state->ctx, state->gstate);\n\tfz_free(state->ctx, state);\n}\n\nstatic void\nprocess_annot(pdf_csi *csi, void *state, pdf_obj *resources, pdf_annot *annot)\n{\n\tfz_context *ctx = csi->doc->ctx;\n\tpdf_xobject *xobj = annot->ap;\n\n\t/* Avoid infinite recursion */\n\tif (xobj == NULL || pdf_mark_obj(xobj->me))\n\t\treturn;\n\n\tfz_try(ctx)\n\t{\n\t\tif (xobj->resources)\n\t\t\tresources = xobj->resources;\n\n\t\tpdf_process_contents_object(csi, resources, xobj->contents);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_unmark_obj(xobj->me);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void\nprocess_stream(pdf_csi *csi, void *state, pdf_lexbuf *buf)\n{\n\tpdf_process_stream(csi, buf);\n}\n\nstatic void\nprocess_contents(pdf_csi *csi, void *state, pdf_obj *resources, pdf_obj *contents)\n{\n\tpdf_process_contents_object(csi, resources, contents);\n}\n\nstatic const pdf_processor pdf_processor_filter =\n{\n\t{\n\tpdf_filter_dquote,\n\tpdf_filter_squote,\n\tpdf_filter_B,\n\tpdf_filter_Bstar,\n\tpdf_filter_BDC,\n\tpdf_filter_BI,\n\tpdf_filter_BMC,\n\tpdf_filter_BT,\n\tpdf_filter_BX,\n\tpdf_filter_CS,\n\tpdf_filter_DP,\n\tpdf_filter_EMC,\n\tpdf_filter_ET,\n\tpdf_filter_EX,\n\tpdf_filter_F,\n\tpdf_filter_G,\n\tpdf_filter_J,\n\tpdf_filter_K,\n\tpdf_filter_M,\n\tpdf_filter_MP,\n\tpdf_filter_Q,\n\tpdf_filter_RG,\n\tpdf_filter_S,\n\tpdf_filter_SCN,\n\tpdf_filter_SCN,\n\tpdf_filter_Tstar,\n\tpdf_filter_TD,\n\tpdf_filter_TJ,\n\tpdf_filter_TL,\n\tpdf_filter_Tc,\n\tpdf_filter_Td,\n\tpdf_filter_Tj,\n\tpdf_filter_Tm,\n\tpdf_filter_Tr,\n\tpdf_filter_Ts,\n\tpdf_filter_Tw,\n\tpdf_filter_Tz,\n\tpdf_filter_W,\n\tpdf_filter_Wstar,\n\tpdf_filter_b,\n\tpdf_filter_bstar,\n\tpdf_filter_c,\n\tpdf_filter_cm,\n\tpdf_filter_cs,\n\tpdf_filter_d,\n\tpdf_filter_d0,\n\tpdf_filter_d1,\n\tpdf_filter_f,\n\tpdf_filter_fstar,\n\tpdf_filter_g,\n\tpdf_filter_h,\n\tpdf_filter_i,\n\tpdf_filter_j,\n\tpdf_filter_k,\n\tpdf_filter_l,\n\tpdf_filter_m,\n\tpdf_filter_n,\n\tpdf_filter_q,\n\tpdf_filter_re,\n\tpdf_filter_rg,\n\tpdf_filter_ri,\n\tpdf_filter_s,\n\tpdf_filter_scn,\n\tpdf_filter_scn,\n\tpdf_filter_v,\n\tpdf_filter_w,\n\tpdf_filter_y,\n\tpdf_filter_Do,\n\tpdf_filter_Tf,\n\tpdf_filter_gs,\n\tpdf_filter_sh,\n\tfree_processor_filter\n\t},\n\tprocess_annot,\n\tprocess_stream,\n\tprocess_contents\n};\n\npdf_process *\npdf_process_filter(pdf_process *process, fz_context *ctx, pdf_process *underlying, pdf_obj *resources)\n{\n\tpdf_filter_state *p = NULL;\n\n\tfz_var(p);\n\n\tfz_try(ctx)\n\t{\n\t\tp = fz_malloc_struct(ctx, pdf_filter_state);\n\t\tp->ctx = ctx;\n\t\tp->process = *underlying;\n\t\tp->gstate = fz_malloc_struct(ctx, filter_gstate);\n\t\tp->resources = resources;\n\t\tp->gstate->ctm = fz_identity;\n\t\tp->gstate->current_ctm = fz_identity;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, p);\n\t\tpdf_process_op(NULL, PDF_OP_END, underlying);\n\t\tfz_rethrow(ctx);\n\t}\n\n\tprocess->state = p;\n\tprocess->processor = &pdf_processor_filter;\n\treturn process;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-op-run.c",
    "content": "#include \"pdf-interpret-imp.h\"\n\n#define TILE\n\n/*\n * Emit graphics calls to device.\n */\n\ntypedef struct pdf_material_s pdf_material;\n\nenum\n{\n\tPDF_FILL,\n\tPDF_STROKE,\n};\n\nenum\n{\n\tPDF_MAT_NONE,\n\tPDF_MAT_COLOR,\n\tPDF_MAT_PATTERN,\n\tPDF_MAT_SHADE,\n};\n\nstruct pdf_material_s\n{\n\tint kind;\n\tfz_colorspace *colorspace;\n\tpdf_pattern *pattern;\n\tfz_shade *shade;\n\tint gstate_num;\n\tfloat alpha;\n\tfloat v[FZ_MAX_COLORS];\n};\n\nstruct pdf_gstate_s\n{\n\tfz_matrix ctm;\n\tint clip_depth;\n\n\t/* path stroking */\n\tfz_stroke_state *stroke_state;\n\n\t/* materials */\n\tpdf_material stroke;\n\tpdf_material fill;\n\n\t/* text state */\n\tfloat char_space;\n\tfloat word_space;\n\tfloat scale;\n\tfloat leading;\n\tpdf_font_desc *font;\n\tfloat size;\n\tint render;\n\tfloat rise;\n\n\t/* transparency */\n\tint blendmode;\n\tpdf_xobject *softmask;\n\tfz_matrix softmask_ctm;\n\tfloat softmask_bc[FZ_MAX_COLORS];\n\tint luminosity;\n\n\t/* SumatraPDF: support transfer functions */\n\tfz_transfer_function *tr;\n\tfz_transfer_function *softmask_tr;\n};\n\ntypedef struct pdf_run_state_s\n{\n\tfz_context *ctx;\n\tfz_device *dev;\n\tpdf_csi *csi;\n\n\tint nested_depth;\n\tint in_hidden_ocg;\n\n\t/* path object state */\n\tfz_path *path;\n\tint clip;\n\tint clip_even_odd;\n\tconst char *event;\n\n\t/* text object state */\n\tfz_text *text;\n\tfz_rect text_bbox;\n\tfz_matrix tlm;\n\tfz_matrix tm;\n\tint text_mode;\n\tint accumulate;\n\n\t/* graphics state */\n\tpdf_gstate *gstate;\n\tint gcap;\n\tint gtop;\n\tint gbot;\n\tint gparent;\n}\npdf_run_state;\n\ntypedef struct softmask_save_s softmask_save;\n\nstruct softmask_save_s\n{\n\tpdf_xobject *softmask;\n\tfz_matrix ctm;\n};\n\nstatic void\nrun_xobject(pdf_csi *csi, void *state, pdf_obj *resources, pdf_xobject *xobj, const fz_matrix *transform);\n\nstatic int\nocg_intents_include(pdf_ocg_descriptor *desc, char *name)\n{\n\tint i, len;\n\n\tif (strcmp(name, \"All\") == 0)\n\t\treturn 1;\n\n\t/* In the absence of a specified intent, it's 'View' */\n\tif (!desc->intent)\n\t\treturn (strcmp(name, \"View\") == 0);\n\n\tif (pdf_is_name(desc->intent))\n\t{\n\t\tchar *intent = pdf_to_name(desc->intent);\n\t\tif (strcmp(intent, \"All\") == 0)\n\t\t\treturn 1;\n\t\treturn (strcmp(intent, name) == 0);\n\t}\n\tif (!pdf_is_array(desc->intent))\n\t\treturn 0;\n\n\tlen = pdf_array_len(desc->intent);\n\tfor (i=0; i < len; i++)\n\t{\n\t\tchar *intent = pdf_to_name(pdf_array_get(desc->intent, i));\n\t\tif (strcmp(intent, \"All\") == 0)\n\t\t\treturn 1;\n\t\tif (strcmp(intent, name) == 0)\n\t\t\treturn 1;\n\t}\n\treturn 0;\n}\n\nint\npdf_is_hidden_ocg(pdf_obj *ocg, pdf_csi *csi, pdf_run_state *pr, pdf_obj *rdb)\n{\n\tchar event_state[16];\n\tpdf_obj *obj, *obj2;\n\tchar *type;\n\tpdf_ocg_descriptor *desc = csi->doc->ocg;\n\tfz_context *ctx = csi->doc->ctx;\n\n\t/* Avoid infinite recursions */\n\tif (pdf_obj_marked(ocg))\n\t\treturn 0;\n\n\t/* If no ocg descriptor, everything is visible */\n\tif (!desc)\n\t\treturn 0;\n\n\t/* If we've been handed a name, look it up in the properties. */\n\tif (pdf_is_name(ocg))\n\t{\n\t\tocg = pdf_dict_gets(pdf_dict_gets(rdb, \"Properties\"), pdf_to_name(ocg));\n\t}\n\t/* If we haven't been given an ocg at all, then we're visible */\n\tif (!ocg)\n\t\treturn 0;\n\n\tfz_strlcpy(event_state, pr->event, sizeof event_state);\n\tfz_strlcat(event_state, \"State\", sizeof event_state);\n\n\ttype = pdf_to_name(pdf_dict_gets(ocg, \"Type\"));\n\n\tif (strcmp(type, \"OCG\") == 0)\n\t{\n\t\t/* An Optional Content Group */\n\t\tint default_value = 0;\n\t\tint num = pdf_to_num(ocg);\n\t\tint gen = pdf_to_gen(ocg);\n\t\tint len = desc->len;\n\t\tint i;\n\n\t\t/* by default an OCG is visible, unless it's explicitly hidden */\n\t\tfor (i = 0; i < len; i++)\n\t\t{\n\t\t\tif (desc->ocgs[i].num == num && desc->ocgs[i].gen == gen)\n\t\t\t{\n\t\t\t\tdefault_value = desc->ocgs[i].state == 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* Check Intents; if our intent is not part of the set given\n\t\t * by the current config, we should ignore it. */\n\t\tobj = pdf_dict_gets(ocg, \"Intent\");\n\t\tif (pdf_is_name(obj))\n\t\t{\n\t\t\t/* If it doesn't match, it's hidden */\n\t\t\tif (ocg_intents_include(desc, pdf_to_name(obj)) == 0)\n\t\t\t\treturn 1;\n\t\t}\n\t\telse if (pdf_is_array(obj))\n\t\t{\n\t\t\tint match = 0;\n\t\t\tlen = pdf_array_len(obj);\n\t\t\tfor (i=0; i<len; i++) {\n\t\t\t\tmatch |= ocg_intents_include(desc, pdf_to_name(pdf_array_get(obj, i)));\n\t\t\t\tif (match)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t/* If we don't match any, it's hidden */\n\t\t\tif (match == 0)\n\t\t\t\treturn 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* If it doesn't match, it's hidden */\n\t\t\tif (ocg_intents_include(desc, \"View\") == 0)\n\t\t\t\treturn 1;\n\t\t}\n\n\t\t/* FIXME: Currently we do a very simple check whereby we look\n\t\t * at the Usage object (an Optional Content Usage Dictionary)\n\t\t * and check to see if the corresponding 'event' key is on\n\t\t * or off.\n\t\t *\n\t\t * Really we should only look at Usage dictionaries that\n\t\t * correspond to entries in the AS list in the OCG config.\n\t\t * Given that we don't handle Zoom or User, or Language\n\t\t * dicts, this is not really a problem. */\n\t\tobj = pdf_dict_gets(ocg, \"Usage\");\n\t\tif (!pdf_is_dict(obj))\n\t\t\treturn default_value;\n\t\t/* FIXME: Should look at Zoom (and return hidden if out of\n\t\t * max/min range) */\n\t\t/* FIXME: Could provide hooks to the caller to check if\n\t\t * User is appropriate - if not return hidden. */\n\t\tobj2 = pdf_dict_gets(obj, pr->event);\n\t\tif (strcmp(pdf_to_name(pdf_dict_gets(obj2, event_state)), \"OFF\") == 0)\n\t\t{\n\t\t\treturn 1;\n\t\t}\n\t\tif (strcmp(pdf_to_name(pdf_dict_gets(obj2, event_state)), \"ON\") == 0)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\treturn default_value;\n\t}\n\telse if (strcmp(type, \"OCMD\") == 0)\n\t{\n\t\t/* An Optional Content Membership Dictionary */\n\t\tchar *name;\n\t\tint combine, on;\n\n\t\tobj = pdf_dict_gets(ocg, \"VE\");\n\t\tif (pdf_is_array(obj)) {\n\t\t\t/* FIXME: Calculate visibility from array */\n\t\t\treturn 0;\n\t\t}\n\t\tname = pdf_to_name(pdf_dict_gets(ocg, \"P\"));\n\t\t/* Set combine; Bit 0 set => AND, Bit 1 set => true means\n\t\t * Off, otherwise true means On */\n\t\tif (strcmp(name, \"AllOn\") == 0)\n\t\t{\n\t\t\tcombine = 1;\n\t\t}\n\t\telse if (strcmp(name, \"AnyOff\") == 0)\n\t\t{\n\t\t\tcombine = 2;\n\t\t}\n\t\telse if (strcmp(name, \"AllOff\") == 0)\n\t\t{\n\t\t\tcombine = 3;\n\t\t}\n\t\telse /* Assume it's the default (AnyOn) */\n\t\t{\n\t\t\tcombine = 0;\n\t\t}\n\n\t\tif (pdf_mark_obj(ocg))\n\t\t\treturn 0; /* Should never happen */\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tobj = pdf_dict_gets(ocg, \"OCGs\");\n\t\t\ton = combine & 1;\n\t\t\tif (pdf_is_array(obj)) {\n\t\t\t\tint i, len;\n\t\t\t\tlen = pdf_array_len(obj);\n\t\t\t\tfor (i = 0; i < len; i++)\n\t\t\t\t{\n\t\t\t\t\tint hidden;\n\t\t\t\t\thidden = pdf_is_hidden_ocg(pdf_array_get(obj, i), csi, pr, rdb);\n\t\t\t\t\tif ((combine & 1) == 0)\n\t\t\t\t\t\thidden = !hidden;\n\t\t\t\t\tif (combine & 2)\n\t\t\t\t\t\ton &= hidden;\n\t\t\t\t\telse\n\t\t\t\t\t\ton |= hidden;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ton = pdf_is_hidden_ocg(obj, csi, pr, rdb);\n\t\t\t\tif ((combine & 1) == 0)\n\t\t\t\t\ton = !on;\n\t\t\t}\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tpdf_unmark_obj(ocg);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t\treturn !on;\n\t}\n\t/* No idea what sort of object this is - be visible */\n\treturn 0;\n}\n\n/* SumatraPDF: support transfer functions */\nstatic fz_transfer_function *\npdf_load_transfer_function(pdf_document *doc, pdf_obj *obj, int is_tr2)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_transfer_function *tr;\n\n\tif (pdf_is_name(obj))\n\t{\n\t\tif (strcmp(pdf_to_name(obj), \"Identity\") && (!is_tr2 || strcmp(pdf_to_name(obj), \"Default\")))\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"unknown transfer function %s\", pdf_to_name(obj));\n\t\treturn NULL;\n\t}\n\n\ttr = fz_malloc_struct(ctx, fz_transfer_function);\n\tFZ_INIT_STORABLE(tr, 1, fz_free);\n\n\tfz_try(ctx)\n\t{\n\t\tfz_function *func;\n\t\tfloat in, out;\n\t\tint i, n;\n\n\t\tif (pdf_is_array(obj))\n\t\t{\n\t\t\tfor (n = 0; n < 4; n++)\n\t\t\t{\n\t\t\t\tpdf_obj *part = pdf_array_get(obj, n);\n\t\t\t\tfunc = pdf_load_function(doc, part, 1, 1);\n\t\t\t\tfor (i = 0; i < 256; i++)\n\t\t\t\t{\n\t\t\t\t\tin = i / 255.0f;\n\t\t\t\t\tfz_eval_function(ctx, func, &in, 1, &out, 1);\n\t\t\t\t\ttr->function[n][i] = (int)(out * 255 + 0.5f);\n\t\t\t\t}\n\t\t\t\tfz_drop_function(ctx, func);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfunc = pdf_load_function(doc, obj, 1, 1);\n\t\t\tfor (i = 0; i < 256; i++)\n\t\t\t{\n\t\t\t\tin = i / 255.0f;\n\t\t\t\tfz_eval_function(ctx, func, &in, 1, &out, 1);\n\t\t\t\tfor (n = 0; n < 4; n++)\n\t\t\t\t\ttr->function[n][i] = (int)(out * 255 + 0.5f);\n\t\t\t}\n\t\t\tfz_drop_function(ctx, func);\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_drop_transfer_function(ctx, tr);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn tr;\n}\n\nstatic pdf_gstate *\nbegin_softmask(pdf_csi *csi, pdf_run_state *pr, softmask_save *save)\n{\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\tpdf_xobject *softmask = gstate->softmask;\n\tfz_rect mask_bbox;\n\tfz_context *ctx;\n\tfz_matrix save_tm, save_tlm, save_ctm;\n\t/* SumatraPDF: support transfer functions */\n\tfz_transfer_function *tr = gstate->softmask_tr;\n\n\tsave->softmask = softmask;\n\tif (softmask == NULL)\n\t\treturn gstate;\n\tsave->ctm = gstate->softmask_ctm;\n\tsave_ctm = gstate->ctm;\n\n\tmask_bbox = softmask->bbox;\n\tctx = pr->ctx;\n\tsave_tm = pr->tm;\n\tsave_tlm = pr->tlm;\n\n\tif (gstate->luminosity)\n\t\tmask_bbox = fz_infinite_rect;\n\telse\n\t{\n\t\tfz_transform_rect(&mask_bbox, &softmask->matrix);\n\t\tfz_transform_rect(&mask_bbox, &gstate->softmask_ctm);\n\t}\n\tgstate->softmask = NULL;\n\tgstate->ctm = gstate->softmask_ctm;\n\t/* SumatraPDF: support transfer functions */\n\tgstate->softmask_tr = NULL;\n\n\tfz_begin_mask(pr->dev, &mask_bbox, gstate->luminosity,\n\t\t\tsoftmask->colorspace, gstate->softmask_bc);\n\tfz_try(ctx)\n\t{\n\t\trun_xobject(csi, pr, csi->rdb, softmask, &fz_identity);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\t/* FIXME: Ignore error - nasty, but if we throw from\n\t\t * here the clip stack would be messed up. */\n\t\tif (csi->cookie)\n\t\t\tcsi->cookie->errors++;\n\t}\n\n\t/* SumatraPDF: support transfer functions */\n\tif (tr)\n\t{\n\t\tfz_apply_transfer_function(pr->dev, tr, 1);\n\t\tgstate = pr->gstate + pr->gtop;\n\t\tgstate->softmask_tr = tr;\n\t}\n\n\tfz_end_mask(pr->dev);\n\n\tpr->tm = save_tm;\n\tpr->tlm = save_tlm;\n\n\tgstate = pr->gstate + pr->gtop;\n\tgstate->ctm = save_ctm;\n\n\treturn gstate;\n}\n\nstatic void\nend_softmask(pdf_csi *csi, pdf_run_state *pr, softmask_save *save)\n{\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\n\tif (save->softmask == NULL)\n\t\treturn;\n\n\tgstate->softmask = save->softmask;\n\tgstate->softmask_ctm = save->ctm;\n\tfz_pop_clip(pr->dev);\n}\n\nstatic pdf_gstate *\npdf_begin_group(pdf_csi *csi, pdf_run_state *pr, const fz_rect *bbox, softmask_save *softmask)\n{\n\tpdf_gstate *gstate = begin_softmask(csi, pr, softmask);\n\n\t/* SumatraPDF: support transfer functions */\n\tif (gstate->blendmode || gstate->tr)\n\t\tfz_begin_group(pr->dev, bbox, 1, 0, gstate->blendmode, 1);\n\n\treturn pr->gstate + pr->gtop;\n}\n\nstatic void\npdf_end_group(pdf_csi *csi, pdf_run_state *pr, softmask_save *softmask)\n{\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\n\t/* SumatraPDF: support transfer functions */\n\tif (gstate->tr)\n\t\tfz_apply_transfer_function(pr->dev, gstate->tr, 0);\n\tif (gstate->blendmode || gstate->tr)\n\t\tfz_end_group(pr->dev);\n\n\tend_softmask(csi, pr, softmask);\n}\n\nstatic void\npdf_show_shade(pdf_csi *csi, pdf_run_state *pr, fz_shade *shd)\n{\n\tfz_context *ctx = pr->ctx;\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\tfz_rect bbox;\n\tsoftmask_save softmask = { NULL };\n\n\tif (pr->in_hidden_ocg > 0)\n\t\treturn;\n\n\tfz_bound_shade(ctx, shd, &gstate->ctm, &bbox);\n\n\tgstate = pdf_begin_group(csi, pr, &bbox, &softmask);\n\n\t/* FIXME: The gstate->ctm in the next line may be wrong; maybe\n\t * it should be the parent gstates ctm? */\n\tfz_fill_shade(pr->dev, shd, &gstate->ctm, gstate->fill.alpha);\n\n\tpdf_end_group(csi, pr, &softmask);\n}\n\nstatic pdf_material *\npdf_keep_material(fz_context *ctx, pdf_material *mat)\n{\n\tif (mat->colorspace)\n\t\tfz_keep_colorspace(ctx, mat->colorspace);\n\tif (mat->pattern)\n\t\tpdf_keep_pattern(ctx, mat->pattern);\n\tif (mat->shade)\n\t\tfz_keep_shade(ctx, mat->shade);\n\treturn mat;\n}\n\nstatic pdf_material *\npdf_drop_material(fz_context *ctx, pdf_material *mat)\n{\n\tif (mat->colorspace)\n\t\tfz_drop_colorspace(ctx, mat->colorspace);\n\tif (mat->pattern)\n\t\tpdf_drop_pattern(ctx, mat->pattern);\n\tif (mat->shade)\n\t\tfz_drop_shade(ctx, mat->shade);\n\treturn mat;\n}\n\nstatic void\npdf_copy_pattern_gstate(fz_context *ctx, pdf_gstate *gs, const pdf_gstate *old)\n{\n\tgs->ctm = old->ctm;\n\n\tpdf_drop_font(ctx, gs->font);\n\tgs->font = pdf_keep_font(ctx, old->font);\n\n\tpdf_drop_xobject(ctx, gs->softmask);\n\tgs->softmask = pdf_keep_xobject(ctx, old->softmask);\n\n\tfz_drop_stroke_state(ctx, gs->stroke_state);\n\tgs->stroke_state = fz_keep_stroke_state(ctx, old->stroke_state);\n\n\t/* SumatraPDF: support transfer functions */\n\tfz_drop_transfer_function(ctx, gs->tr);\n\tgs->tr = fz_keep_transfer_function(ctx, old->tr);\n\tfz_drop_transfer_function(ctx, gs->softmask_tr);\n\tgs->softmask_tr = fz_keep_transfer_function(ctx, old->softmask_tr);\n}\n\nstatic void\npdf_unset_pattern(pdf_run_state *pr, int what)\n{\n\tfz_context *ctx = pr->ctx;\n\tpdf_gstate *gs = pr->gstate + pr->gtop;\n\tpdf_material *mat;\n\tmat = what == PDF_FILL ? &gs->fill : &gs->stroke;\n\tif (mat->kind == PDF_MAT_PATTERN)\n\t{\n\t\tif (mat->pattern)\n\t\t\tpdf_drop_pattern(ctx, mat->pattern);\n\t\tmat->pattern = NULL;\n\t\tmat->kind = PDF_MAT_COLOR;\n\t}\n}\n\nstatic void\npdf_keep_gstate(fz_context *ctx, pdf_gstate *gs)\n{\n\tpdf_keep_material(ctx, &gs->stroke);\n\tpdf_keep_material(ctx, &gs->fill);\n\tif (gs->font)\n\t\tpdf_keep_font(ctx, gs->font);\n\tif (gs->softmask)\n\t\tpdf_keep_xobject(ctx, gs->softmask);\n\tfz_keep_stroke_state(ctx, gs->stroke_state);\n\n\t/* SumatraPDF: support transfer functions */\n\tfz_keep_transfer_function(ctx, gs->tr);\n\tfz_keep_transfer_function(ctx, gs->softmask_tr);\n}\n\nstatic void\npdf_drop_gstate(fz_context *ctx, pdf_gstate *gs)\n{\n\tpdf_drop_material(ctx, &gs->stroke);\n\tpdf_drop_material(ctx, &gs->fill);\n\tif (gs->font)\n\t\tpdf_drop_font(ctx, gs->font);\n\tif (gs->softmask)\n\t\tpdf_drop_xobject(ctx, gs->softmask);\n\tfz_drop_stroke_state(ctx, gs->stroke_state);\n\n\t/* SumatraPDF: support transfer functions */\n\tfz_drop_transfer_function(ctx, gs->tr);\n\tfz_drop_transfer_function(ctx, gs->softmask_tr);\n}\n\nstatic void\npdf_gsave(pdf_run_state *pr)\n{\n\tfz_context *ctx = pr->ctx;\n\n\tif (pr->gtop == pr->gcap-1)\n\t{\n\t\tpr->gstate = fz_resize_array(ctx, pr->gstate, pr->gcap*2, sizeof(pdf_gstate));\n\t\tpr->gcap *= 2;\n\t}\n\n\tmemcpy(&pr->gstate[pr->gtop + 1], &pr->gstate[pr->gtop], sizeof(pdf_gstate));\n\n\tpr->gtop++;\n\tpdf_keep_gstate(ctx, &pr->gstate[pr->gtop]);\n}\n\nstatic void\npdf_grestore(pdf_run_state *pr)\n{\n\tfz_context *ctx = pr->ctx;\n\tpdf_gstate *gs = pr->gstate + pr->gtop;\n\tint clip_depth = gs->clip_depth;\n\n\tif (pr->gtop <= pr->gbot)\n\t{\n\t\tfz_warn(ctx, \"gstate underflow in content stream\");\n\t\treturn;\n\t}\n\n\tpdf_drop_gstate(ctx, gs);\n\tpr->gtop --;\n\n\tgs = pr->gstate + pr->gtop;\n\twhile (clip_depth > gs->clip_depth)\n\t{\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tfz_pop_clip(pr->dev);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\t/* Silently swallow the problem - restores must\n\t\t\t * never throw! */\n\t\t}\n\t\tclip_depth--;\n\t}\n}\n\nstatic void\npdf_show_pattern(pdf_csi *csi, pdf_run_state *pr, pdf_pattern *pat, pdf_gstate *pat_gstate, const fz_rect *area, int what)\n{\n\tfz_context *ctx = pr->ctx;\n\tpdf_gstate *gstate;\n\tint gparent_save;\n\tfz_matrix ptm, invptm, gparent_save_ctm;\n\tint x0, y0, x1, y1;\n\tfloat fx0, fy0, fx1, fy1;\n\tint oldtop;\n\tfz_rect local_area;\n\n\tpdf_gsave(pr);\n\tgstate = pr->gstate + pr->gtop;\n\t/* Patterns are run with the gstate of the parent */\n\tpdf_copy_pattern_gstate(ctx, gstate, pat_gstate);\n\n\tif (pat->ismask)\n\t{\n\t\tpdf_unset_pattern(pr, PDF_FILL);\n\t\tpdf_unset_pattern(pr, PDF_STROKE);\n\t\tif (what == PDF_FILL)\n\t\t{\n\t\t\tpdf_drop_material(ctx, &gstate->stroke);\n\t\t\tpdf_keep_material(ctx, &gstate->fill);\n\t\t\tgstate->stroke = gstate->fill;\n\t\t}\n\t\tif (what == PDF_STROKE)\n\t\t{\n\t\t\tpdf_drop_material(ctx, &gstate->fill);\n\t\t\tpdf_keep_material(ctx, &gstate->stroke);\n\t\t\tgstate->fill = gstate->stroke;\n\t\t}\n\t}\n\telse\n\t{\n\t\t// TODO: unset only the current fill/stroke or both?\n\t\tpdf_unset_pattern(pr, what);\n\t}\n\n\t/* don't apply soft masks to objects in the pattern as well */\n\tif (gstate->softmask)\n\t{\n\t\tpdf_drop_xobject(ctx, gstate->softmask);\n\t\tgstate->softmask = NULL;\n\t}\n\n\tfz_concat(&ptm, &pat->matrix, &pat_gstate->ctm);\n\tfz_invert_matrix(&invptm, &ptm);\n\n\t/* The parent_ctm is amended with our pattern matrix */\n\tgparent_save = pr->gparent;\n\tpr->gparent = pr->gtop-1;\n\tgparent_save_ctm = pr->gstate[pr->gparent].ctm;\n\tpr->gstate[pr->gparent].ctm = ptm;\n\n\tfz_try(ctx)\n\t{\n\t\t/* patterns are painted using the parent_ctm. area = bbox of\n\t\t * shape to be filled in device space. Map it back to pattern\n\t\t * space. */\n\t\tlocal_area = *area;\n\t\tfz_transform_rect(&local_area, &invptm);\n\n\t\tfx0 = (local_area.x0 - pat->bbox.x0) / pat->xstep;\n\t\tfy0 = (local_area.y0 - pat->bbox.y0) / pat->ystep;\n\t\tfx1 = (local_area.x1 - pat->bbox.x0) / pat->xstep;\n\t\tfy1 = (local_area.y1 - pat->bbox.y0) / pat->ystep;\n\t\tif (fx0 > fx1)\n\t\t{\n\t\t\tfloat t = fx0; fx0 = fx1; fx1 = t;\n\t\t}\n\t\tif (fy0 > fy1)\n\t\t{\n\t\t\tfloat t = fy0; fy0 = fy1; fy1 = t;\n\t\t}\n\n\t\toldtop = pr->gtop;\n\n#ifdef TILE\n\t\t/* We have tried various formulations in the past, but this one is\n\t\t * best we've found; only use it as a tile if a whole repeat is\n\t\t * required in at least one direction. Note, that this allows for\n\t\t * 'sections' of 4 tiles to be show, but all non-overlapping. */\n\t\tif (fx1-fx0 > 1 || fy1-fy0 > 1)\n#else\n\t\tif (0)\n#endif\n\t\t{\n\t\t\tfz_begin_tile(pr->dev, &local_area, &pat->bbox, pat->xstep, pat->ystep, &ptm);\n\t\t\tgstate->ctm = ptm;\n\t\t\tpdf_gsave(pr);\n\t\t\tpdf_process_contents_object(csi, pat->resources, pat->contents);\n\t\t\tpdf_grestore(pr);\n\t\t\twhile (oldtop < pr->gtop)\n\t\t\t\tpdf_grestore(pr);\n\t\t\tfz_end_tile(pr->dev);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tint x, y;\n\n\t\t\t/* When calculating the number of tiles required, we adjust by\n\t\t\t * a small amount to allow for rounding errors. By choosing\n\t\t\t * this amount to be smaller than 1/256, we guarantee we won't\n\t\t\t * cause problems that will be visible even under our most\n\t\t\t * extreme antialiasing. */\n\t\t\tx0 = floorf(fx0 + 0.001);\n\t\t\ty0 = floorf(fy0 + 0.001);\n\t\t\tx1 = ceilf(fx1 - 0.001);\n\t\t\ty1 = ceilf(fy1 - 0.001);\n\t\t\t/* The above adjustments cause problems for sufficiently\n\t\t\t * large values for xstep/ystep which may be used if the\n\t\t\t * pattern is expected to be rendered exactly once. */\n\t\t\tif (fx1 > fx0 && x1 == x0)\n\t\t\t\tx1 = x0 + 1;\n\t\t\tif (fy1 > fy0 && y1 == y0)\n\t\t\t\ty1 = y0 + 1;\n\n\t\t\tfor (y = y0; y < y1; y++)\n\t\t\t{\n\t\t\t\tfor (x = x0; x < x1; x++)\n\t\t\t\t{\n\t\t\t\t\tgstate->ctm = ptm;\n\t\t\t\t\tfz_pre_translate(&gstate->ctm, x * pat->xstep, y * pat->ystep);\n\t\t\t\t\tpdf_gsave(pr);\n\t\t\t\t\tfz_try(ctx)\n\t\t\t\t\t{\n\t\t\t\t\t\tpdf_process_contents_object(csi, pat->resources, pat->contents);\n\t\t\t\t\t}\n\t\t\t\t\tfz_always(ctx)\n\t\t\t\t\t{\n\t\t\t\t\t\tpdf_grestore(pr);\n\t\t\t\t\t\twhile (oldtop < pr->gtop)\n\t\t\t\t\t\t\tpdf_grestore(pr);\n\t\t\t\t\t}\n\t\t\t\t\tfz_catch(ctx)\n\t\t\t\t\t{\n\t\t\t\t\t\tfz_rethrow_message(ctx, \"cannot render pattern tile\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpr->gstate[pr->gparent].ctm = gparent_save_ctm;\n\t\tpr->gparent = gparent_save;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\tpdf_grestore(pr);\n}\n\nstatic void\npdf_show_image(pdf_csi *csi, pdf_run_state *pr, fz_image *image)\n{\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\tfz_matrix image_ctm;\n\tfz_rect bbox;\n\tsoftmask_save softmask = { NULL };\n\n\tif (pr->in_hidden_ocg > 0)\n\t\treturn;\n\n\t/* PDF has images bottom-up, so flip them right side up here */\n\timage_ctm = gstate->ctm;\n\tfz_pre_scale(fz_pre_translate(&image_ctm, 0, 1), 1, -1);\n\n\tbbox = fz_unit_rect;\n\tfz_transform_rect(&bbox, &image_ctm);\n\n\tif (image->mask)\n\t{\n\t\t/* apply blend group even though we skip the soft mask */\n\t\tif (gstate->blendmode)\n\t\t\tfz_begin_group(pr->dev, &bbox, 0, 0, gstate->blendmode, 1);\n\t\tfz_clip_image_mask(pr->dev, image->mask, &bbox, &image_ctm);\n\t}\n\telse\n\t\tgstate = pdf_begin_group(csi, pr, &bbox, &softmask);\n\n\tif (!image->colorspace)\n\t{\n\n\t\tswitch (gstate->fill.kind)\n\t\t{\n\t\tcase PDF_MAT_NONE:\n\t\t\tbreak;\n\t\tcase PDF_MAT_COLOR:\n\t\t\tfz_fill_image_mask(pr->dev, image, &image_ctm,\n\t\t\t\tgstate->fill.colorspace, gstate->fill.v, gstate->fill.alpha);\n\t\t\tbreak;\n\t\tcase PDF_MAT_PATTERN:\n\t\t\tif (gstate->fill.pattern)\n\t\t\t{\n\t\t\t\tfz_clip_image_mask(pr->dev, image, &bbox, &image_ctm);\n\t\t\t\tpdf_show_pattern(csi, pr, gstate->fill.pattern, &pr->gstate[gstate->fill.gstate_num], &bbox, PDF_FILL);\n\t\t\t\tfz_pop_clip(pr->dev);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase PDF_MAT_SHADE:\n\t\t\tif (gstate->fill.shade)\n\t\t\t{\n\t\t\t\tfz_clip_image_mask(pr->dev, image, &bbox, &image_ctm);\n\t\t\t\tfz_fill_shade(pr->dev, gstate->fill.shade, &pr->gstate[gstate->fill.gstate_num].ctm, gstate->fill.alpha);\n\t\t\t\tfz_pop_clip(pr->dev);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\telse\n\t{\n\t\tfz_fill_image(pr->dev, image, &image_ctm, gstate->fill.alpha);\n\t}\n\n\tif (image->mask)\n\t{\n\t\tfz_pop_clip(pr->dev);\n\t\tif (gstate->blendmode)\n\t\t\tfz_end_group(pr->dev);\n\t}\n\telse\n\t\tpdf_end_group(csi, pr, &softmask);\n}\n\nstatic void\npdf_show_path(pdf_csi *csi, pdf_run_state *pr, int doclose, int dofill, int dostroke, int even_odd)\n{\n\tfz_context *ctx = pr->ctx;\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\tfz_path *path;\n\tfz_rect bbox;\n\tsoftmask_save softmask = { NULL };\n\tint knockout_group = 0;\n\n\tif (dostroke) {\n\t\tif (pr->dev->flags & (FZ_DEVFLAG_STROKECOLOR_UNDEFINED | FZ_DEVFLAG_LINEJOIN_UNDEFINED | FZ_DEVFLAG_LINEWIDTH_UNDEFINED))\n\t\t\tpr->dev->flags |= FZ_DEVFLAG_UNCACHEABLE;\n\t\telse if (gstate->stroke_state->dash_len != 0 && pr->dev->flags & (FZ_DEVFLAG_STARTCAP_UNDEFINED | FZ_DEVFLAG_DASHCAP_UNDEFINED | FZ_DEVFLAG_ENDCAP_UNDEFINED))\n\t\t\tpr->dev->flags |= FZ_DEVFLAG_UNCACHEABLE;\n\t\telse if (gstate->stroke_state->linejoin == FZ_LINEJOIN_MITER && (pr->dev->flags & FZ_DEVFLAG_MITERLIMIT_UNDEFINED))\n\t\t\tpr->dev->flags |= FZ_DEVFLAG_UNCACHEABLE;\n\t}\n\tif (dofill) {\n\t\tif (pr->dev->flags & FZ_DEVFLAG_FILLCOLOR_UNDEFINED)\n\t\t\tpr->dev->flags |= FZ_DEVFLAG_UNCACHEABLE;\n\t}\n\n\tpath = pr->path;\n\tpr->path = fz_new_path(ctx);\n\n\tfz_try(ctx)\n\t{\n\t\tif (doclose)\n\t\t\tfz_closepath(ctx, path);\n\n\t\tfz_bound_path(ctx, path, (dostroke ? gstate->stroke_state : NULL), &gstate->ctm, &bbox);\n\n\t\tif (pr->clip)\n\t\t{\n\t\t\tgstate->clip_depth++;\n\t\t\tfz_clip_path(pr->dev, path, &bbox, pr->clip_even_odd, &gstate->ctm);\n\t\t\tpr->clip = 0;\n\t\t}\n\n\t\tif (pr->in_hidden_ocg > 0)\n\t\t\tdostroke = dofill = 0;\n\n\t\tif (dofill || dostroke)\n\t\t\tgstate = pdf_begin_group(csi, pr, &bbox, &softmask);\n\n\t\t/* SumatraPDF: prevent regression (e.g. in blend mode 10.pdf and annotations galore.pdf) */\n\t\tif (dofill && dostroke && 0)\n\t\t{\n\t\t\t/* We may need to push a knockout group */\n\t\t\tif (gstate->stroke.alpha == 0)\n\t\t\t{\n\t\t\t\t/* No need for group, as stroke won't do anything */\n\t\t\t}\n\t\t\telse if (gstate->stroke.alpha == 1.0f && gstate->blendmode == FZ_BLEND_NORMAL)\n\t\t\t{\n\t\t\t\t/* No need for group, as stroke won't show up */\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tknockout_group = 1;\n\t\t\t\tfz_begin_group(pr->dev, &bbox, 0, 1, FZ_BLEND_NORMAL, 1);\n\t\t\t}\n\t\t}\n\n\t\tif (dofill)\n\t\t{\n\t\t\tswitch (gstate->fill.kind)\n\t\t\t{\n\t\t\tcase PDF_MAT_NONE:\n\t\t\t\tbreak;\n\t\t\tcase PDF_MAT_COLOR:\n\t\t\t\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=966 */\n\t\t\t\tif (path->coord_len == 4 && path->cmds[0] == FZ_MOVETO && path->cmds[1] == FZ_LINETO &&\n\t\t\t\t\t(path->coords[0] != path->coords[2] || path->coords[1] != path->coords[3]))\n\t\t\t\t{\n\t\t\t\t\tfz_stroke_state *stroke = fz_new_stroke_state(ctx);\n\t\t\t\t\tstroke->linewidth = 0.001f / fz_matrix_expansion(&gstate->ctm);\n\t\t\t\t\tfz_stroke_path(pr->dev, path, stroke, &gstate->ctm,\n\t\t\t\t\t\tgstate->fill.colorspace, gstate->fill.v, gstate->fill.alpha);\n\t\t\t\t\tfz_drop_stroke_state(ctx, stroke);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tfz_fill_path(pr->dev, path, even_odd, &gstate->ctm,\n\t\t\t\t\tgstate->fill.colorspace, gstate->fill.v, gstate->fill.alpha);\n\t\t\t\tbreak;\n\t\t\tcase PDF_MAT_PATTERN:\n\t\t\t\tif (gstate->fill.pattern)\n\t\t\t\t{\n\t\t\t\t\tfz_clip_path(pr->dev, path, &bbox, even_odd, &gstate->ctm);\n\t\t\t\t\tpdf_show_pattern(csi, pr, gstate->fill.pattern, &pr->gstate[gstate->fill.gstate_num], &bbox, PDF_FILL);\n\t\t\t\t\tfz_pop_clip(pr->dev);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase PDF_MAT_SHADE:\n\t\t\t\tif (gstate->fill.shade)\n\t\t\t\t{\n\t\t\t\t\tfz_clip_path(pr->dev, path, &bbox, even_odd, &gstate->ctm);\n\t\t\t\t\t/* The cluster and page 2 of patterns.pdf shows that fz_fill_shade should NOT be called with gstate->ctm. */\n\t\t\t\t\tfz_fill_shade(pr->dev, gstate->fill.shade, &pr->gstate[gstate->fill.gstate_num].ctm, gstate->fill.alpha);\n\t\t\t\t\tfz_pop_clip(pr->dev);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (dostroke)\n\t\t{\n\t\t\tswitch (gstate->stroke.kind)\n\t\t\t{\n\t\t\tcase PDF_MAT_NONE:\n\t\t\t\tbreak;\n\t\t\tcase PDF_MAT_COLOR:\n\t\t\t\tfz_stroke_path(pr->dev, path, gstate->stroke_state, &gstate->ctm,\n\t\t\t\t\tgstate->stroke.colorspace, gstate->stroke.v, gstate->stroke.alpha);\n\t\t\t\tbreak;\n\t\t\tcase PDF_MAT_PATTERN:\n\t\t\t\tif (gstate->stroke.pattern)\n\t\t\t\t{\n\t\t\t\t\tfz_clip_stroke_path(pr->dev, path, &bbox, gstate->stroke_state, &gstate->ctm);\n\t\t\t\t\tpdf_show_pattern(csi, pr, gstate->stroke.pattern, &pr->gstate[gstate->stroke.gstate_num], &bbox, PDF_STROKE);\n\t\t\t\t\tfz_pop_clip(pr->dev);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase PDF_MAT_SHADE:\n\t\t\t\tif (gstate->stroke.shade)\n\t\t\t\t{\n\t\t\t\t\tfz_clip_stroke_path(pr->dev, path, &bbox, gstate->stroke_state, &gstate->ctm);\n\t\t\t\t\tfz_fill_shade(pr->dev, gstate->stroke.shade, &pr->gstate[gstate->stroke.gstate_num].ctm, gstate->stroke.alpha);\n\t\t\t\t\tfz_pop_clip(pr->dev);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (knockout_group)\n\t\t\tfz_end_group(pr->dev);\n\n\t\tif (dofill || dostroke)\n\t\t\tpdf_end_group(csi, pr, &softmask);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_free_path(ctx, path);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\n/*\n * Assemble and emit text\n */\n\nstatic pdf_gstate *\npdf_flush_text(pdf_csi *csi, pdf_run_state *pr)\n{\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\tfz_text *text;\n\tint dofill;\n\tint dostroke;\n\tint doclip;\n\tint doinvisible;\n\tfz_context *ctx = pr->ctx;\n\tsoftmask_save softmask = { NULL };\n\n\tif (!pr->text)\n\t\treturn gstate;\n\ttext = pr->text;\n\tpr->text = NULL;\n\n\tdofill = dostroke = doclip = doinvisible = 0;\n\tswitch (pr->text_mode)\n\t{\n\tcase 0: dofill = 1; break;\n\tcase 1: dostroke = 1; break;\n\tcase 2: dofill = dostroke = 1; break;\n\tcase 3: doinvisible = 1; break;\n\tcase 4: dofill = doclip = 1; break;\n\tcase 5: dostroke = doclip = 1; break;\n\tcase 6: dofill = dostroke = doclip = 1; break;\n\tcase 7: doclip = 1; break;\n\t}\n\n\tif (pr->in_hidden_ocg > 0)\n\t\tdostroke = dofill = 0;\n\n\tfz_try(ctx)\n\t{\n\t\tfz_rect tb = pr->text_bbox;\n\n\t\tfz_transform_rect(&tb, &gstate->ctm);\n\n\t\t/* Don't bother sending a text group with nothing in it */\n\t\tif (text->len == 0)\n\t\t\tbreak;\n\n\t\tgstate = pdf_begin_group(csi, pr, &tb, &softmask);\n\n\t\tif (doinvisible)\n\t\t\tfz_ignore_text(pr->dev, text, &gstate->ctm);\n\n\t\tif (dofill)\n\t\t{\n\t\t\tswitch (gstate->fill.kind)\n\t\t\t{\n\t\t\tcase PDF_MAT_NONE:\n\t\t\t\tbreak;\n\t\t\tcase PDF_MAT_COLOR:\n\t\t\t\tfz_fill_text(pr->dev, text, &gstate->ctm,\n\t\t\t\t\tgstate->fill.colorspace, gstate->fill.v, gstate->fill.alpha);\n\t\t\t\tbreak;\n\t\t\tcase PDF_MAT_PATTERN:\n\t\t\t\tif (gstate->fill.pattern)\n\t\t\t\t{\n\t\t\t\t\tfz_clip_text(pr->dev, text, &gstate->ctm, 0);\n\t\t\t\t\tpdf_show_pattern(csi, pr, gstate->fill.pattern, &pr->gstate[gstate->fill.gstate_num], &tb, PDF_FILL);\n\t\t\t\t\tfz_pop_clip(pr->dev);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase PDF_MAT_SHADE:\n\t\t\t\tif (gstate->fill.shade)\n\t\t\t\t{\n\t\t\t\t\tfz_clip_text(pr->dev, text, &gstate->ctm, 0);\n\t\t\t\t\t/* Page 2 of patterns.pdf shows that fz_fill_shade should NOT be called with gstate->ctm */\n\t\t\t\t\tfz_fill_shade(pr->dev, gstate->fill.shade, &pr->gstate[gstate->fill.gstate_num].ctm, gstate->fill.alpha);\n\t\t\t\t\tfz_pop_clip(pr->dev);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (dostroke)\n\t\t{\n\t\t\tswitch (gstate->stroke.kind)\n\t\t\t{\n\t\t\tcase PDF_MAT_NONE:\n\t\t\t\tbreak;\n\t\t\tcase PDF_MAT_COLOR:\n\t\t\t\tfz_stroke_text(pr->dev, text, gstate->stroke_state, &gstate->ctm,\n\t\t\t\t\tgstate->stroke.colorspace, gstate->stroke.v, gstate->stroke.alpha);\n\t\t\t\tbreak;\n\t\t\tcase PDF_MAT_PATTERN:\n\t\t\t\tif (gstate->stroke.pattern)\n\t\t\t\t{\n\t\t\t\t\tfz_clip_stroke_text(pr->dev, text, gstate->stroke_state, &gstate->ctm);\n\t\t\t\t\tpdf_show_pattern(csi, pr, gstate->stroke.pattern, &pr->gstate[gstate->stroke.gstate_num], &tb, PDF_STROKE);\n\t\t\t\t\tfz_pop_clip(pr->dev);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase PDF_MAT_SHADE:\n\t\t\t\tif (gstate->stroke.shade)\n\t\t\t\t{\n\t\t\t\t\tfz_clip_stroke_text(pr->dev, text, gstate->stroke_state, &gstate->ctm);\n\t\t\t\t\tfz_fill_shade(pr->dev, gstate->stroke.shade, &pr->gstate[gstate->stroke.gstate_num].ctm, gstate->stroke.alpha);\n\t\t\t\t\tfz_pop_clip(pr->dev);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* cf. https://github.com/sumatrapdfreader/sumatrapdf/issues/306 */\n\t\tpdf_end_group(csi, pr, &softmask);\n\n\t\tif (doclip)\n\t\t{\n\t\t\tif (pr->accumulate < 2)\n\t\t\t\tgstate->clip_depth++;\n\t\t\tfz_clip_text(pr->dev, text, &gstate->ctm, pr->accumulate);\n\t\t\tpr->accumulate = 2;\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_free_text(ctx, text);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn pr->gstate + pr->gtop;\n}\n\nstatic void\npdf_show_char(pdf_csi *csi, pdf_run_state *pr, int cid)\n{\n\tfz_context *ctx = pr->ctx;\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\tpdf_font_desc *fontdesc = gstate->font;\n\tfz_matrix tsm, trm;\n\tfloat w0, w1, tx, ty;\n\tpdf_hmtx h;\n\tpdf_vmtx v;\n\tint gid;\n\tint ucsbuf[8];\n\tint ucslen;\n\tint i;\n\tfz_rect bbox;\n\tint render_direct;\n\n\ttsm.a = gstate->size * gstate->scale;\n\ttsm.b = 0;\n\ttsm.c = 0;\n\ttsm.d = gstate->size;\n\ttsm.e = 0;\n\ttsm.f = gstate->rise;\n\n\tucslen = 0;\n\tif (fontdesc->to_unicode)\n\t\tucslen = pdf_lookup_cmap_full(fontdesc->to_unicode, cid, ucsbuf);\n\tif (ucslen == 0 && cid < fontdesc->cid_to_ucs_len)\n\t{\n\t\tucsbuf[0] = fontdesc->cid_to_ucs[cid];\n\t\tucslen = 1;\n\t}\n\tif (ucslen == 0 || (ucslen == 1 && ucsbuf[0] == 0))\n\t{\n\t\tucsbuf[0] = '?';\n\t\tucslen = 1;\n\t}\n\n\tgid = pdf_font_cid_to_gid(ctx, fontdesc, cid);\n\n\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=1149 */\n\tif (fontdesc->wmode == 1 && fontdesc->font->ft_face)\n\t\tgid = pdf_ft_lookup_vgid(ctx, fontdesc, gid);\n\n\tif (fontdesc->wmode == 1)\n\t{\n\t\tv = pdf_lookup_vmtx(ctx, fontdesc, cid);\n\t\ttsm.e -= v.x * fabsf(gstate->size) * 0.001f;\n\t\ttsm.f -= v.y * gstate->size * 0.001f;\n\t}\n\n\tfz_concat(&trm, &tsm, &pr->tm);\n\n\tfz_bound_glyph(ctx, fontdesc->font, gid, &trm, &bbox);\n\t/* Compensate for the glyph cache limited positioning precision */\n\tbbox.x0 -= 1;\n\tbbox.y0 -= 1;\n\tbbox.x1 += 1;\n\tbbox.y1 += 1;\n\n\t/* If we are a type3 font within a type 3 font, or are otherwise\n\t * uncachable, then render direct. */\n\trender_direct = (!fontdesc->font->ft_face && pr->nested_depth > 0) || !fz_glyph_cacheable(ctx, fontdesc->font, gid);\n\n\t/* flush buffered text if face or matrix or rendermode has changed */\n\tif (!pr->text ||\n\t\tfontdesc->font != pr->text->font ||\n\t\tfontdesc->wmode != pr->text->wmode ||\n\t\tfabsf(trm.a - pr->text->trm.a) > FLT_EPSILON ||\n\t\tfabsf(trm.b - pr->text->trm.b) > FLT_EPSILON ||\n\t\tfabsf(trm.c - pr->text->trm.c) > FLT_EPSILON ||\n\t\tfabsf(trm.d - pr->text->trm.d) > FLT_EPSILON ||\n\t\tgstate->render != pr->text_mode ||\n\t\trender_direct)\n\t{\n\t\tgstate = pdf_flush_text(csi, pr);\n\n\t\tpr->text = fz_new_text(ctx, fontdesc->font, &trm, fontdesc->wmode);\n\t\tpr->text->trm.e = 0;\n\t\tpr->text->trm.f = 0;\n\t\tpr->text_mode = gstate->render;\n\t\tpr->text_bbox = fz_empty_rect;\n\t}\n\n\tif (render_direct)\n\t{\n\t\t/* Render the glyph stream direct here (only happens for\n\t\t * type3 glyphs that seem to inherit current graphics\n\t\t * attributes, or type 3 glyphs within type3 glyphs). */\n\t\tfz_matrix composed;\n\t\tfz_concat(&composed, &trm, &gstate->ctm);\n\t\tfz_render_t3_glyph_direct(ctx, pr->dev, fontdesc->font, gid, &composed, gstate, pr->nested_depth);\n\t\t/* Render text invisibly so that it can still be extracted. */\n\t\tpr->text_mode = 3;\n\t}\n\n\tfz_union_rect(&pr->text_bbox, &bbox);\n\n\t/* add glyph to textobject */\n\tfz_add_text(ctx, pr->text, gid, ucsbuf[0], trm.e, trm.f);\n\n\t/* add filler glyphs for one-to-many unicode mapping */\n\tfor (i = 1; i < ucslen; i++)\n\t\tfz_add_text(ctx, pr->text, -1, ucsbuf[i], trm.e, trm.f);\n\n\tif (fontdesc->wmode == 0)\n\t{\n\t\th = pdf_lookup_hmtx(ctx, fontdesc, cid);\n\t\tw0 = h.w * 0.001f;\n\t\ttx = (w0 * gstate->size + gstate->char_space) * gstate->scale;\n\t\tfz_pre_translate(&pr->tm, tx, 0);\n\t}\n\n\tif (fontdesc->wmode == 1)\n\t{\n\t\tw1 = v.w * 0.001f;\n\t\tty = w1 * gstate->size + gstate->char_space;\n\t\tfz_pre_translate(&pr->tm, 0, ty);\n\t}\n}\n\nstatic void\npdf_show_space(pdf_run_state *pr, float tadj)\n{\n\tfz_context *ctx = pr->ctx;\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\tpdf_font_desc *fontdesc = gstate->font;\n\n\tif (!fontdesc)\n\t{\n\t\tfz_warn(ctx, \"cannot draw text since font and size not set\");\n\t\treturn;\n\t}\n\n\tif (fontdesc->wmode == 0)\n\t\tfz_pre_translate(&pr->tm, tadj * gstate->scale, 0);\n\telse\n\t\tfz_pre_translate(&pr->tm, 0, tadj);\n}\n\nstatic void\npdf_show_string(pdf_csi *csi, pdf_run_state *pr, unsigned char *buf, int len)\n{\n\tfz_context *ctx = pr->ctx;\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\tpdf_font_desc *fontdesc = gstate->font;\n\tunsigned char *end = buf + len;\n\tunsigned int cpt;\n\tint cid;\n\n\tif (!fontdesc)\n\t{\n\t\tfz_warn(ctx, \"cannot draw text since font and size not set\");\n\t\treturn;\n\t}\n\n\twhile (buf < end)\n\t{\n\t\tint w = pdf_decode_cmap(fontdesc->encoding, buf, end, &cpt);\n\t\tbuf += w;\n\n\t\tcid = pdf_lookup_cmap(fontdesc->encoding, cpt);\n\t\t/* cf. https://code.google.com/p/sumatrapdf/issues/detail?id=2286 */\n\t\tif (w == 1 && (cpt == 10 || cpt == 13) && !pdf_font_cid_to_gid(ctx, fontdesc, cid))\n\t\t\tfz_warn(ctx, \"ignoring line break in string\");\n\t\telse\n\t\tif (cid >= 0)\n\t\t\tpdf_show_char(csi, pr, cid);\n\t\telse\n\t\t\tfz_warn(ctx, \"cannot encode character\");\n\t\tif (cpt == 32 && w == 1)\n\t\t\tpdf_show_space(pr, gstate->word_space);\n\t}\n}\n\nstatic void\npdf_show_text(pdf_csi *csi, pdf_run_state *pr, pdf_obj *text)\n{\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\tint i;\n\n\tif (pdf_is_array(text))\n\t{\n\t\tint n = pdf_array_len(text);\n\t\tfor (i = 0; i < n; i++)\n\t\t{\n\t\t\tpdf_obj *item = pdf_array_get(text, i);\n\t\t\tif (pdf_is_string(item))\n\t\t\t\tpdf_show_string(csi, pr, (unsigned char *)pdf_to_str_buf(item), pdf_to_str_len(item));\n\t\t\telse\n\t\t\t\tpdf_show_space(pr, - pdf_to_real(item) * gstate->size * 0.001f);\n\t\t}\n\t}\n\telse if (pdf_is_string(text))\n\t{\n\t\tpdf_show_string(csi, pr, (unsigned char *)pdf_to_str_buf(text), pdf_to_str_len(text));\n\t}\n}\n\n/*\n * Interpreter and graphics state stack.\n */\n\nstatic void\npdf_init_gstate(fz_context *ctx, pdf_gstate *gs, const fz_matrix *ctm)\n{\n\tgs->ctm = *ctm;\n\tgs->clip_depth = 0;\n\n\tgs->stroke_state = fz_new_stroke_state(ctx);\n\n\tgs->stroke.kind = PDF_MAT_COLOR;\n\tgs->stroke.colorspace = fz_device_gray(ctx); /* No fz_keep_colorspace as static */\n\tgs->stroke.v[0] = 0;\n\tgs->stroke.pattern = NULL;\n\tgs->stroke.shade = NULL;\n\tgs->stroke.alpha = 1;\n\tgs->stroke.gstate_num = -1;\n\n\tgs->fill.kind = PDF_MAT_COLOR;\n\tgs->fill.colorspace = fz_device_gray(ctx); /* No fz_keep_colorspace as static */\n\tgs->fill.v[0] = 0;\n\tgs->fill.pattern = NULL;\n\tgs->fill.shade = NULL;\n\tgs->fill.alpha = 1;\n\tgs->fill.gstate_num = -1;\n\n\tgs->char_space = 0;\n\tgs->word_space = 0;\n\tgs->scale = 1;\n\tgs->leading = 0;\n\tgs->font = NULL;\n\tgs->size = -1;\n\tgs->render = 0;\n\tgs->rise = 0;\n\n\tgs->blendmode = 0;\n\tgs->softmask = NULL;\n\tgs->softmask_ctm = fz_identity;\n\tgs->luminosity = 0;\n\n\t/* SumatraPDF: support transfer functions */\n\tgs->tr = NULL;\n\tgs->softmask_tr = NULL;\n}\n\nstatic void\npdf_copy_gstate(fz_context *ctx, pdf_gstate *gs, pdf_gstate *old)\n{\n\tpdf_drop_gstate(ctx, gs);\n\t*gs = *old;\n\tpdf_keep_gstate(ctx, gs);\n}\n\n/*\n * Material state\n */\n\nstatic void\npdf_set_colorspace(pdf_csi *csi, pdf_run_state *pr, int what, fz_colorspace *colorspace)\n{\n\tfz_context *ctx = pr->ctx;\n\tpdf_gstate *gs;\n\tpdf_material *mat;\n\n\tgs = pdf_flush_text(csi, pr);\n\n\tmat = what == PDF_FILL ? &gs->fill : &gs->stroke;\n\n\tfz_drop_colorspace(ctx, mat->colorspace);\n\n\tmat->kind = PDF_MAT_COLOR;\n\tmat->colorspace = fz_keep_colorspace(ctx, colorspace);\n\n\tmat->v[0] = 0;\n\tmat->v[1] = 0;\n\tmat->v[2] = 0;\n\tmat->v[3] = 1;\n\n\tif (pdf_is_tint_colorspace(colorspace))\n\t{\n\t\tint i;\n\t\tfor (i = 0; i < colorspace->n; i++)\n\t\t\tmat->v[i] = 1.0f;\n\t}\n}\n\nstatic void\npdf_set_color(pdf_csi *csi, pdf_run_state *pr, int what, float *v)\n{\n\tfz_context *ctx = pr->ctx;\n\tpdf_gstate *gs;\n\tpdf_material *mat;\n\tint i;\n\n\tgs = pdf_flush_text(csi, pr);\n\n\tmat = what == PDF_FILL ? &gs->fill : &gs->stroke;\n\n\tswitch (mat->kind)\n\t{\n\tcase PDF_MAT_PATTERN:\n\tcase PDF_MAT_COLOR:\n\t\tif (fz_colorspace_is_indexed(mat->colorspace))\n\t\t{\n\t\t\tmat->v[0] = v[0] / 255;\n\t\t\tbreak;\n\t\t}\n\t\tfor (i = 0; i < mat->colorspace->n; i++)\n\t\t\tmat->v[i] = v[i];\n\t\tbreak;\n\tdefault:\n\t\tfz_warn(ctx, \"color incompatible with material\");\n\t}\n}\n\nstatic void\npdf_set_shade(pdf_csi *csi, pdf_run_state *pr, int what, fz_shade *shade)\n{\n\tfz_context *ctx = pr->ctx;\n\tpdf_gstate *gs;\n\tpdf_material *mat;\n\n\tgs = pdf_flush_text(csi, pr);\n\n\tmat = what == PDF_FILL ? &gs->fill : &gs->stroke;\n\n\tif (mat->shade)\n\t\tfz_drop_shade(ctx, mat->shade);\n\n\tmat->kind = PDF_MAT_SHADE;\n\tmat->shade = fz_keep_shade(ctx, shade);\n}\n\nstatic void\npdf_set_pattern(pdf_csi *csi, pdf_run_state *pr, int what, pdf_pattern *pat, float *v)\n{\n\tfz_context *ctx = pr->ctx;\n\tpdf_gstate *gs;\n\tpdf_material *mat;\n\n\tgs = pdf_flush_text(csi, pr);\n\n\tmat = what == PDF_FILL ? &gs->fill : &gs->stroke;\n\n\tif (mat->pattern)\n\t\tpdf_drop_pattern(ctx, mat->pattern);\n\n\tmat->kind = PDF_MAT_PATTERN;\n\tif (pat)\n\t\tmat->pattern = pdf_keep_pattern(ctx, pat);\n\telse\n\t\tmat->pattern = NULL;\n\tmat->gstate_num = pr->gparent;\n\n\tif (v)\n\t\tpdf_set_color(csi, pr, what, v);\n}\n\nstatic pdf_font_desc *\nload_font_or_hail_mary(pdf_csi *csi, pdf_obj *rdb, pdf_obj *font, int depth)\n{\n\tpdf_document *doc = csi->doc;\n\tfz_context *ctx = doc->ctx;\n\tpdf_font_desc *desc;\n\n\tfz_try(ctx)\n\t{\n\t\tdesc = pdf_load_font(doc, rdb, font, depth);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tif (fz_caught(ctx) != FZ_ERROR_TRYLATER)\n\t\t\tfz_rethrow(ctx);\n\t\tif (!csi->cookie || !csi->cookie->incomplete_ok)\n\t\t\tfz_rethrow(ctx);\n\t\tdesc = NULL;\n\t\tcsi->cookie->incomplete++;\n\t}\n\tif (desc == NULL)\n\t\tdesc = pdf_load_hail_mary_font(doc);\n\treturn desc;\n}\n\nstatic void\npdf_run_extgstate(pdf_csi *csi, pdf_run_state *pr, pdf_obj *rdb, pdf_obj *extgstate)\n{\n\tfz_context *ctx = pr->ctx;\n\tpdf_gstate *gstate;\n\tfz_colorspace *colorspace;\n\tint i, k, n;\n\n\tgstate = pdf_flush_text(csi, pr);\n\n\tn = pdf_dict_len(extgstate);\n\tfor (i = 0; i < n; i++)\n\t{\n\t\tpdf_obj *key = pdf_dict_get_key(extgstate, i);\n\t\tpdf_obj *val = pdf_dict_get_val(extgstate, i);\n\t\tchar *s = pdf_to_name(key);\n\n\t\tif (!strcmp(s, \"Font\"))\n\t\t{\n\t\t\tif (pdf_is_array(val) && pdf_array_len(val) == 2)\n\t\t\t{\n\t\t\t\tpdf_obj *font = pdf_array_get(val, 0);\n\n\t\t\t\tif (gstate->font)\n\t\t\t\t{\n\t\t\t\t\tpdf_drop_font(ctx, gstate->font);\n\t\t\t\t\tgstate->font = NULL;\n\t\t\t\t}\n\n\t\t\t\tgstate->font = load_font_or_hail_mary(csi, rdb, font, pr->nested_depth);\n\t\t\t\tif (!gstate->font)\n\t\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot find font in store\");\n\t\t\t\tgstate->size = pdf_to_real(pdf_array_get(val, 1));\n\t\t\t}\n\t\t\telse\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"malformed /Font dictionary\");\n\t\t}\n\n\t\telse if (!strcmp(s, \"LC\"))\n\t\t{\n\t\t\tpr->dev->flags &= ~(FZ_DEVFLAG_STARTCAP_UNDEFINED | FZ_DEVFLAG_DASHCAP_UNDEFINED | FZ_DEVFLAG_ENDCAP_UNDEFINED);\n\t\t\tgstate->stroke_state = fz_unshare_stroke_state(ctx, gstate->stroke_state);\n\t\t\tgstate->stroke_state->start_cap = pdf_to_int(val);\n\t\t\tgstate->stroke_state->dash_cap = pdf_to_int(val);\n\t\t\tgstate->stroke_state->end_cap = pdf_to_int(val);\n\t\t}\n\t\telse if (!strcmp(s, \"LW\"))\n\t\t{\n\t\t\tpr->dev->flags &= ~FZ_DEVFLAG_LINEWIDTH_UNDEFINED;\n\t\t\tgstate->stroke_state = fz_unshare_stroke_state(ctx, gstate->stroke_state);\n\t\t\tgstate->stroke_state->linewidth = pdf_to_real(val);\n\t\t}\n\t\telse if (!strcmp(s, \"LJ\"))\n\t\t{\n\t\t\tpr->dev->flags &= ~FZ_DEVFLAG_LINEJOIN_UNDEFINED;\n\t\t\tgstate->stroke_state = fz_unshare_stroke_state(ctx, gstate->stroke_state);\n\t\t\tgstate->stroke_state->linejoin = pdf_to_int(val);\n\t\t}\n\t\telse if (!strcmp(s, \"ML\"))\n\t\t{\n\t\t\tpr->dev->flags &= ~FZ_DEVFLAG_MITERLIMIT_UNDEFINED;\n\t\t\tgstate->stroke_state = fz_unshare_stroke_state(ctx, gstate->stroke_state);\n\t\t\tgstate->stroke_state->miterlimit = pdf_to_real(val);\n\t\t}\n\n\t\telse if (!strcmp(s, \"D\"))\n\t\t{\n\t\t\tif (pdf_is_array(val) && pdf_array_len(val) == 2)\n\t\t\t{\n\t\t\t\tpdf_obj *dashes = pdf_array_get(val, 0);\n\t\t\t\tint len = pdf_array_len(dashes);\n\t\t\t\tgstate->stroke_state = fz_unshare_stroke_state_with_dash_len(ctx, gstate->stroke_state, len);\n\t\t\t\tgstate->stroke_state->dash_len = len;\n\t\t\t\tfor (k = 0; k < len; k++)\n\t\t\t\t\tgstate->stroke_state->dash_list[k] = pdf_to_real(pdf_array_get(dashes, k));\n\t\t\t\tgstate->stroke_state->dash_phase = pdf_to_real(pdf_array_get(val, 1));\n\t\t\t}\n\t\t\telse\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"malformed /D\");\n\t\t}\n\n\t\telse if (!strcmp(s, \"CA\"))\n\t\t\tgstate->stroke.alpha = fz_clamp(pdf_to_real(val), 0, 1);\n\n\t\telse if (!strcmp(s, \"ca\"))\n\t\t\tgstate->fill.alpha = fz_clamp(pdf_to_real(val), 0, 1);\n\n\t\telse if (!strcmp(s, \"BM\"))\n\t\t{\n\t\t\tif (pdf_is_array(val))\n\t\t\t{\n\t\t\t\t/* SumatraPDF: properly support /BM arrays */\n\t\t\t\tfor (k = 0; k < pdf_array_len(val); k++)\n\t\t\t\t{\n\t\t\t\t\tchar *bm = pdf_to_name(pdf_array_get(val, k));\n\t\t\t\t\tif (!strcmp(bm, \"Normal\") || fz_lookup_blendmode(bm) > 0)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tval = pdf_array_get(val, k);\n\t\t\t}\n\t\t\tgstate->blendmode = fz_lookup_blendmode(pdf_to_name(val));\n\t\t}\n\n\t\telse if (!strcmp(s, \"SMask\"))\n\t\t{\n\t\t\tif (pdf_is_dict(val))\n\t\t\t{\n\t\t\t\tpdf_xobject *xobj;\n\t\t\t\tpdf_obj *group, *luminosity, *bc, *tr;\n\n\t\t\t\tif (gstate->softmask)\n\t\t\t\t{\n\t\t\t\t\tpdf_drop_xobject(ctx, gstate->softmask);\n\t\t\t\t\tgstate->softmask = NULL;\n\t\t\t\t}\n\t\t\t\t/* SumatraPDF: support transfer functions */\n\t\t\t\tif (gstate->softmask_tr)\n\t\t\t\t{\n\t\t\t\t\tfz_drop_transfer_function(ctx, gstate->softmask_tr);\n\t\t\t\t\tgstate->softmask_tr = NULL;\n\t\t\t\t}\n\n\t\t\t\tgroup = pdf_dict_gets(val, \"G\");\n\t\t\t\tif (!group)\n\t\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot load softmask xobject (%d %d R)\", pdf_to_num(val), pdf_to_gen(val));\n\t\t\t\txobj = pdf_load_xobject(csi->doc, group);\n\n\t\t\t\tcolorspace = xobj->colorspace;\n\t\t\t\tif (!colorspace)\n\t\t\t\t\tcolorspace = fz_device_gray(ctx);\n\n\t\t\t\t/* The softmask_ctm no longer has the softmask matrix rolled into it, as this\n\t\t\t\t * causes the softmask matrix to be applied twice. */\n\t\t\t\tgstate->softmask_ctm = gstate->ctm;\n\t\t\t\tgstate->softmask = xobj;\n\t\t\t\tfor (k = 0; k < colorspace->n; k++)\n\t\t\t\t\tgstate->softmask_bc[k] = 0;\n\n\t\t\t\tbc = pdf_dict_gets(val, \"BC\");\n\t\t\t\tif (pdf_is_array(bc))\n\t\t\t\t{\n\t\t\t\t\tfor (k = 0; k < colorspace->n; k++)\n\t\t\t\t\t\tgstate->softmask_bc[k] = pdf_to_real(pdf_array_get(bc, k));\n\t\t\t\t}\n\n\t\t\t\tluminosity = pdf_dict_gets(val, \"S\");\n\t\t\t\tif (pdf_is_name(luminosity) && !strcmp(pdf_to_name(luminosity), \"Luminosity\"))\n\t\t\t\t\tgstate->luminosity = 1;\n\t\t\t\telse\n\t\t\t\t\tgstate->luminosity = 0;\n\n\t\t\t\ttr = pdf_dict_gets(val, \"TR\");\n\t\t\t\t/* SumatraPDF: support transfer functions */\n\t\t\t\tif (tr)\n\t\t\t\t\tgstate->softmask_tr = pdf_load_transfer_function(csi->doc, tr, 0);\n\t\t\t}\n\t\t\telse if (pdf_is_name(val) && !strcmp(pdf_to_name(val), \"None\"))\n\t\t\t{\n\t\t\t\tif (gstate->softmask)\n\t\t\t\t{\n\t\t\t\t\tpdf_drop_xobject(ctx, gstate->softmask);\n\t\t\t\t\tgstate->softmask = NULL;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* SumatraPDF: support transfer functions */\n\t\telse if ((!strcmp(s, \"TR\") && !pdf_dict_gets(extgstate, \"TR2\")) || !strcmp(s, \"TR2\"))\n\t\t{\n\t\t\tfz_drop_transfer_function(ctx, gstate->tr);\n\t\t\tgstate->tr = NULL;\n\t\t\tgstate->tr = pdf_load_transfer_function(csi->doc, val, !strcmp(s, \"TR2\"));\n\t\t}\n\t}\n}\n\nstatic void\nrun_xobject(pdf_csi *csi, void *state, pdf_obj *resources, pdf_xobject *xobj, const fz_matrix *transform)\n{\n\tfz_context *ctx = csi->doc->ctx;\n\tpdf_gstate *gstate = NULL;\n\tint oldtop = 0;\n\tfz_matrix local_transform = *transform;\n\tsoftmask_save softmask = { NULL };\n\tint gparent_save;\n\tfz_matrix gparent_save_ctm;\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tint cleanup_state = 0;\n\tchar errmess[256] = \"\";\n\n\t/* Avoid infinite recursion */\n\tif (xobj == NULL || pdf_mark_obj(xobj->me))\n\t\treturn;\n\n\tfz_var(cleanup_state);\n\tfz_var(gstate);\n\tfz_var(oldtop);\n\n\tgparent_save = pr->gparent;\n\tpr->gparent = pr->gtop;\n\n\tfz_try(ctx)\n\t{\n\t\tpdf_gsave(pr);\n\n\t\tgstate = pr->gstate + pr->gtop;\n\t\toldtop = pr->gtop;\n\n\t\t/* apply xobject's transform matrix */\n\t\tfz_concat(&local_transform, &xobj->matrix, &local_transform);\n\t\tfz_concat(&gstate->ctm, &local_transform, &gstate->ctm);\n\n\t\t/* The gparent is updated with the modified ctm */\n\t\tgparent_save_ctm = pr->gstate[pr->gparent].ctm;\n\t\tpr->gstate[pr->gparent].ctm = gstate->ctm;\n\n\t\t/* apply soft mask, create transparency group and reset state */\n\t\tif (xobj->transparency)\n\t\t{\n\t\t\tfz_rect bbox = xobj->bbox;\n\t\t\tfz_transform_rect(&bbox, &gstate->ctm);\n\n\t\t\t/* Remember that we tried to call begin_softmask. Even\n\t\t\t * if it throws an error, we must call end_softmask. */\n\t\t\tcleanup_state = 1;\n\t\t\tgstate = begin_softmask(csi, pr, &softmask);\n\n\t\t\t/* Remember that we tried to call fz_begin_group. Even\n\t\t\t * if it throws an error, we must call fz_end_group. */\n\t\t\tcleanup_state = 2;\n\t\t\tfz_begin_group(pr->dev, &bbox,\n\t\t\t\txobj->isolated, xobj->knockout, gstate->blendmode, gstate->fill.alpha);\n\n\t\t\tgstate->blendmode = 0;\n\t\t\tgstate->stroke.alpha = 1;\n\t\t\tgstate->fill.alpha = 1;\n\t\t}\n\n\t\t/* Remember that we tried to save for the clippath. Even if it\n\t\t * throws an error, we must pop it. */\n\t\tcleanup_state = 3;\n\t\tpdf_gsave(pr); /* Save here so the clippath doesn't persist */\n\n\t\t/* clip to the bounds */\n\t\tfz_moveto(ctx, pr->path, xobj->bbox.x0, xobj->bbox.y0);\n\t\tfz_lineto(ctx, pr->path, xobj->bbox.x1, xobj->bbox.y0);\n\t\tfz_lineto(ctx, pr->path, xobj->bbox.x1, xobj->bbox.y1);\n\t\tfz_lineto(ctx, pr->path, xobj->bbox.x0, xobj->bbox.y1);\n\t\tfz_closepath(ctx, pr->path);\n\t\tpr->clip = 1;\n\t\tpdf_show_path(csi, pr, 0, 0, 0, 0);\n\n\t\t/* run contents */\n\n\t\tif (xobj->resources)\n\t\t\tresources = xobj->resources;\n\n\t\tpdf_process_contents_object(csi, resources, xobj->contents);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tif (cleanup_state >= 3)\n\t\t\tpdf_grestore(pr); /* Remove the clippath */\n\n\t\t/* wrap up transparency stacks */\n\t\tif (xobj->transparency)\n\t\t{\n\t\t\tif (cleanup_state >= 2)\n\t\t\t{\n\t\t\t\tfz_try(ctx)\n\t\t\t\t{\n\t\t\t\t\tfz_end_group(pr->dev);\n\t\t\t\t}\n\t\t\t\tfz_catch(ctx)\n\t\t\t\t{\n\t\t\t\t\t/* Postpone the problem */\n\t\t\t\t\tstrcpy(errmess, fz_caught_message(ctx));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (cleanup_state >= 1)\n\t\t\t{\n\t\t\t\tfz_try(ctx)\n\t\t\t\t{\n\t\t\t\t\tend_softmask(csi, pr, &softmask);\n\t\t\t\t}\n\t\t\t\tfz_catch(ctx)\n\t\t\t\t{\n\t\t\t\t\t/* Postpone the problem */\n\t\t\t\t\tstrcpy(errmess, fz_caught_message(ctx));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpr->gstate[pr->gparent].ctm = gparent_save_ctm;\n\t\tpr->gparent = gparent_save;\n\n\t\tif (gstate)\n\t\t{\n\t\t\twhile (oldtop < pr->gtop)\n\t\t\t\tpdf_grestore(pr);\n\n\t\t\tpdf_grestore(pr);\n\t\t}\n\n\t\tpdf_unmark_obj(xobj->me);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\t/* Rethrow postponed errors */\n\tif (errmess[0])\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"%s\", errmess);\n}\n\nstatic void pdf_run_BDC(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tpdf_obj *ocg;\n\tpdf_obj *rdb = csi->rdb;\n\n\t/* We only understand OC groups so far */\n\tif (strcmp(csi->name, \"OC\") != 0)\n\t\treturn;\n\n\t/* If we are already in a hidden OCG, then we'll still be hidden -\n\t * just increment the depth so we pop back to visibility when we've\n\t * seen enough EDCs. */\n\tif (pr->in_hidden_ocg > 0)\n\t{\n\t\tpr->in_hidden_ocg++;\n\t\treturn;\n\t}\n\n\tif (pdf_is_name(csi->obj))\n\t{\n\t\tocg = pdf_dict_gets(pdf_dict_gets(rdb, \"Properties\"), pdf_to_name(csi->obj));\n\t}\n\telse\n\t\tocg = csi->obj;\n\n\tif (!ocg)\n\t{\n\t\t/* No Properties array, or name not found in the properties\n\t\t * means visible. */\n\t\treturn;\n\t}\n\tif (strcmp(pdf_to_name(pdf_dict_gets(ocg, \"Type\")), \"OCG\") != 0)\n\t{\n\t\t/* Wrong type of property */\n\t\treturn;\n\t}\n\tif (pdf_is_hidden_ocg(ocg, csi, pr, rdb))\n\t\tpr->in_hidden_ocg++;\n}\n\nstatic void pdf_run_BI(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpdf_show_image(csi, pr, csi->img);\n}\n\nstatic void pdf_run_B(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpdf_show_path(csi, pr, 0, 1, 1, 0);\n}\n\nstatic void pdf_run_BMC(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\t/* If we are already in a hidden OCG, then we'll still be hidden -\n\t * just increment the depth so we pop back to visibility when we've\n\t * seen enough EDCs. */\n\tif (pr->in_hidden_ocg > 0)\n\t{\n\t\tpr->in_hidden_ocg++;\n\t}\n}\n\nstatic void pdf_run_BT(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpr->tm = fz_identity;\n\tpr->tlm = fz_identity;\n}\n\nstatic void pdf_run_BX(pdf_csi *csi, void *state)\n{\n}\n\nstatic void pdf_run_Bstar(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpdf_show_path(csi, pr, 0, 1, 1, 1);\n}\n\nstatic void pdf_run_cs_imp(pdf_csi *csi, pdf_run_state *pr, int what)\n{\n\tfz_context *ctx = pr->ctx;\n\tfz_colorspace *colorspace;\n\tpdf_obj *obj, *dict;\n\tpdf_obj *rdb = csi->rdb;\n\n\tif (!strcmp(csi->name, \"Pattern\"))\n\t{\n\t\tpdf_set_pattern(csi, pr, what, NULL, NULL);\n\t}\n\telse\n\t{\n\t\tif (!strcmp(csi->name, \"DeviceGray\"))\n\t\t\tcolorspace = fz_device_gray(ctx); /* No fz_keep_colorspace as static */\n\t\telse if (!strcmp(csi->name, \"DeviceRGB\"))\n\t\t\tcolorspace = fz_device_rgb(ctx); /* No fz_keep_colorspace as static */\n\t\telse if (!strcmp(csi->name, \"DeviceCMYK\"))\n\t\t\tcolorspace = fz_device_cmyk(ctx); /* No fz_keep_colorspace as static */\n\t\telse\n\t\t{\n\t\t\tdict = pdf_dict_gets(rdb, \"ColorSpace\");\n\t\t\tif (!dict)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot find ColorSpace dictionary\");\n\t\t\tobj = pdf_dict_gets(dict, csi->name);\n\t\t\tif (!obj)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot find colorspace resource '%s'\", csi->name);\n\t\t\tcolorspace = pdf_load_colorspace(csi->doc, obj);\n\t\t}\n\n\t\tpdf_set_colorspace(csi, pr, what, colorspace);\n\n\t\tfz_drop_colorspace(ctx, colorspace);\n\t}\n}\n\nstatic void pdf_run_CS(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpr->dev->flags &= ~FZ_DEVFLAG_STROKECOLOR_UNDEFINED;\n\n\tpdf_run_cs_imp(csi, pr, PDF_STROKE);\n}\n\nstatic void pdf_run_cs(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpr->dev->flags &= ~FZ_DEVFLAG_FILLCOLOR_UNDEFINED;\n\n\tpdf_run_cs_imp(csi, pr, PDF_FILL);\n}\n\nstatic void pdf_run_DP(pdf_csi *csi, void *state)\n{\n}\n\nstatic void pdf_run_Do(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tfz_context *ctx = csi->doc->ctx;\n\tpdf_obj *dict;\n\tpdf_obj *obj;\n\tpdf_obj *subtype;\n\tpdf_obj *rdb = csi->rdb;\n\n\tdict = pdf_dict_gets(rdb, \"XObject\");\n\tif (!dict)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot find XObject dictionary when looking for: '%s'\", csi->name);\n\n\tobj = pdf_dict_gets(dict, csi->name);\n\tif (!obj)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot find xobject resource: '%s'\", csi->name);\n\n\tsubtype = pdf_dict_gets(obj, \"Subtype\");\n\tif (!pdf_is_name(subtype))\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"no XObject subtype specified\");\n\n\tif (pdf_is_hidden_ocg(pdf_dict_gets(obj, \"OC\"), csi, pr, rdb))\n\t\treturn;\n\n\tif (!strcmp(pdf_to_name(subtype), \"Form\") && pdf_dict_gets(obj, \"Subtype2\"))\n\t\tsubtype = pdf_dict_gets(obj, \"Subtype2\");\n\n\tif (!strcmp(pdf_to_name(subtype), \"Form\"))\n\t{\n\t\tpdf_xobject *xobj;\n\n\t\txobj = pdf_load_xobject(csi->doc, obj);\n\n\t\t/* Inherit parent resources, in case this one was empty XXX check where it's loaded */\n\t\tif (!xobj->resources)\n\t\t\txobj->resources = pdf_keep_obj(rdb);\n\n\t\tfz_try(ctx)\n\t\t{\n\t\t\trun_xobject(csi, state, xobj->resources, xobj, &fz_identity);\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tpdf_drop_xobject(ctx, xobj);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_rethrow_message(ctx, \"cannot draw xobject (%d %d R)\", pdf_to_num(obj), pdf_to_gen(obj));\n\t\t}\n\t}\n\n\telse if (!strcmp(pdf_to_name(subtype), \"Image\"))\n\t{\n\t\tif ((pr->dev->hints & FZ_IGNORE_IMAGE) == 0)\n\t\t{\n\t\t\tfz_image *img = pdf_load_image(csi->doc, obj);\n\n\t\t\tfz_try(ctx)\n\t\t\t{\n\t\t\t\tpdf_show_image(csi, pr, img);\n\t\t\t}\n\t\t\tfz_always(ctx)\n\t\t\t{\n\t\t\t\tfz_drop_image(ctx, img);\n\t\t\t}\n\t\t\tfz_catch(ctx)\n\t\t\t{\n\t\t\t\tfz_rethrow(ctx);\n\t\t\t}\n\t\t}\n\t}\n\n\telse if (!strcmp(pdf_to_name(subtype), \"PS\"))\n\t{\n\t\tfz_warn(ctx, \"ignoring XObject with subtype PS\");\n\t}\n\n\telse\n\t{\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"unknown XObject subtype: '%s'\", pdf_to_name(subtype));\n\t}\n}\n\nstatic void pdf_run_EMC(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tif (pr->in_hidden_ocg > 0)\n\t\tpr->in_hidden_ocg--;\n}\n\nstatic void pdf_run_ET(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpdf_flush_text(csi, pr);\n\tpr->accumulate = 1;\n}\n\nstatic void pdf_run_EX(pdf_csi *csi, void *state)\n{\n}\n\nstatic void pdf_run_F(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpdf_show_path(csi, pr, 0, 1, 0, 0);\n}\n\nstatic void pdf_run_G(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpr->dev->flags &= ~FZ_DEVFLAG_STROKECOLOR_UNDEFINED;\n\tpdf_set_colorspace(csi, pr, PDF_STROKE, fz_device_gray(csi->doc->ctx));\n\tpdf_set_color(csi, pr, PDF_STROKE, csi->stack);\n}\n\nstatic void pdf_run_J(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\n\tpr->dev->flags &= ~(FZ_DEVFLAG_STARTCAP_UNDEFINED | FZ_DEVFLAG_DASHCAP_UNDEFINED | FZ_DEVFLAG_ENDCAP_UNDEFINED);\n\tgstate->stroke_state = fz_unshare_stroke_state(csi->doc->ctx, gstate->stroke_state);\n\tgstate->stroke_state->start_cap = csi->stack[0];\n\tgstate->stroke_state->dash_cap = csi->stack[0];\n\tgstate->stroke_state->end_cap = csi->stack[0];\n}\n\nstatic void pdf_run_K(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpr->dev->flags &= ~FZ_DEVFLAG_STROKECOLOR_UNDEFINED;\n\tpdf_set_colorspace(csi, pr, PDF_STROKE, fz_device_cmyk(csi->doc->ctx));\n\tpdf_set_color(csi, pr, PDF_STROKE, csi->stack);\n}\n\nstatic void pdf_run_M(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\n\tpr->dev->flags &= ~FZ_DEVFLAG_MITERLIMIT_UNDEFINED;\n\tgstate->stroke_state = fz_unshare_stroke_state(csi->doc->ctx, gstate->stroke_state);\n\tgstate->stroke_state->miterlimit = csi->stack[0];\n}\n\nstatic void pdf_run_MP(pdf_csi *csi, void *state)\n{\n}\n\nstatic void pdf_run_Q(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpdf_grestore(pr);\n}\n\nstatic void pdf_run_RG(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpr->dev->flags &= ~FZ_DEVFLAG_STROKECOLOR_UNDEFINED;\n\tpdf_set_colorspace(csi, pr, PDF_STROKE, fz_device_rgb(csi->doc->ctx));\n\tpdf_set_color(csi, pr, PDF_STROKE, csi->stack);\n}\n\nstatic void pdf_run_S(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpdf_show_path(csi, pr, 0, 0, 1, 0);\n}\n\nstatic void pdf_run_SC_imp(pdf_csi *csi, pdf_run_state *pr, int what, pdf_material *mat)\n{\n\tfz_context *ctx = pr->ctx;\n\tpdf_obj *patterntype;\n\tpdf_obj *dict;\n\tpdf_obj *obj;\n\tint kind;\n\tpdf_obj *rdb = csi->rdb;\n\n\tkind = mat->kind;\n\tif (csi->name[0])\n\t\tkind = PDF_MAT_PATTERN;\n\n\tswitch (kind)\n\t{\n\tcase PDF_MAT_NONE:\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot set color in mask objects\");\n\n\tcase PDF_MAT_COLOR:\n\t\tpdf_set_color(csi, pr, what, csi->stack);\n\t\tbreak;\n\n\tcase PDF_MAT_PATTERN:\n\t\tdict = pdf_dict_gets(rdb, \"Pattern\");\n\t\tif (!dict)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot find Pattern dictionary\");\n\n\t\tobj = pdf_dict_gets(dict, csi->name);\n\t\tif (!obj)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot find pattern resource '%s'\", csi->name);\n\n\t\tpatterntype = pdf_dict_gets(obj, \"PatternType\");\n\n\t\tif (pdf_to_int(patterntype) == 1)\n\t\t{\n\t\t\tpdf_pattern *pat;\n\t\t\tpat = pdf_load_pattern(csi->doc, obj);\n\t\t\tpdf_set_pattern(csi, pr, what, pat, csi->top > 0 ? csi->stack : NULL);\n\t\t\tpdf_drop_pattern(ctx, pat);\n\t\t}\n\t\telse if (pdf_to_int(patterntype) == 2)\n\t\t{\n\t\t\tfz_shade *shd;\n\t\t\tshd = pdf_load_shading(csi->doc, obj);\n\t\t\tpdf_set_shade(csi, pr, what, shd);\n\t\t\tfz_drop_shade(ctx, shd);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"unknown pattern type: %d\", pdf_to_int(patterntype));\n\t\t}\n\t\tbreak;\n\n\tcase PDF_MAT_SHADE:\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot set color in shade objects\");\n\t}\n\tmat->gstate_num = pr->gparent;\n}\n\nstatic void pdf_run_SC(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\n\tpr->dev->flags &= ~FZ_DEVFLAG_STROKECOLOR_UNDEFINED;\n\tpdf_run_SC_imp(csi, pr, PDF_STROKE, &gstate->stroke);\n}\n\nstatic void pdf_run_sc(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\n\tpr->dev->flags &= ~FZ_DEVFLAG_FILLCOLOR_UNDEFINED;\n\tpdf_run_SC_imp(csi, pr, PDF_FILL, &gstate->fill);\n}\n\nstatic void pdf_run_Tc(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\n\tgstate->char_space = csi->stack[0];\n}\n\nstatic void pdf_run_Tw(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\n\tgstate->word_space = csi->stack[0];\n}\n\nstatic void pdf_run_Tz(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tpdf_gstate *gstate;\n\tfloat a = csi->stack[0] / 100;\n\n\tgstate = pdf_flush_text(csi, pr);\n\tgstate->scale = a;\n}\n\nstatic void pdf_run_TL(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\n\tgstate->leading = csi->stack[0];\n}\n\nstatic void pdf_run_Tf(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tfz_context *ctx = csi->doc->ctx;\n\tpdf_obj *rdb = csi->rdb;\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\tpdf_obj *dict;\n\tpdf_obj *obj;\n\n\tgstate->size = csi->stack[0];\n\tif (gstate->font)\n\t\tpdf_drop_font(ctx, gstate->font);\n\tgstate->font = NULL;\n\n\tdict = pdf_dict_gets(rdb, \"Font\");\n\tif (!dict)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot find Font dictionary\");\n\n\tobj = pdf_dict_gets(dict, csi->name);\n\tif (!obj)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot find font resource: '%s'\", csi->name);\n\n\tgstate->font = load_font_or_hail_mary(csi, rdb, obj, pr->nested_depth);\n}\n\nstatic void pdf_run_Tr(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\n\tgstate->render = csi->stack[0];\n}\n\nstatic void pdf_run_Ts(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\n\tgstate->rise = csi->stack[0];\n}\n\nstatic void pdf_run_Td(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tfz_pre_translate(&pr->tlm, csi->stack[0], csi->stack[1]);\n\tpr->tm = pr->tlm;\n}\n\nstatic void pdf_run_TD(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\n\tgstate->leading = -csi->stack[1];\n\tfz_pre_translate(&pr->tlm, csi->stack[0], csi->stack[1]);\n\tpr->tm = pr->tlm;\n}\n\nstatic void pdf_run_Tm(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpr->tm.a = csi->stack[0];\n\tpr->tm.b = csi->stack[1];\n\tpr->tm.c = csi->stack[2];\n\tpr->tm.d = csi->stack[3];\n\tpr->tm.e = csi->stack[4];\n\tpr->tm.f = csi->stack[5];\n\tpr->tlm = pr->tm;\n}\n\nstatic void pdf_run_Tstar(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\n\tfz_pre_translate(&pr->tlm, 0, -gstate->leading);\n\tpr->tm = pr->tlm;\n}\n\nstatic void pdf_run_Tj(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tif (csi->string_len)\n\t\tpdf_show_string(csi, pr, csi->string, csi->string_len);\n\telse\n\t\tpdf_show_text(csi, pr, csi->obj);\n}\n\nstatic void pdf_run_TJ(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tif (csi->string_len)\n\t\tpdf_show_string(csi, pr, csi->string, csi->string_len);\n\telse\n\t\tpdf_show_text(csi, pr, csi->obj);\n}\n\nstatic void pdf_run_W(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpr->clip = 1;\n\tpr->clip_even_odd = 0;\n}\n\nstatic void pdf_run_Wstar(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpr->clip = 1;\n\tpr->clip_even_odd = 1;\n}\n\nstatic void pdf_run_b(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpdf_show_path(csi, pr, 1, 1, 1, 0);\n}\n\nstatic void pdf_run_bstar(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpdf_show_path(csi, pr, 1, 1, 1, 1);\n}\n\nstatic void pdf_run_c(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tfloat a, b, c, d, e, f;\n\n\ta = csi->stack[0];\n\tb = csi->stack[1];\n\tc = csi->stack[2];\n\td = csi->stack[3];\n\te = csi->stack[4];\n\tf = csi->stack[5];\n\tfz_curveto(csi->doc->ctx, pr->path, a, b, c, d, e, f);\n}\n\nstatic void pdf_run_cm(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tpdf_gstate *gstate;\n\tfz_matrix m;\n\n\tgstate = pdf_flush_text(csi, pr);\n\tm.a = csi->stack[0];\n\tm.b = csi->stack[1];\n\tm.c = csi->stack[2];\n\tm.d = csi->stack[3];\n\tm.e = csi->stack[4];\n\tm.f = csi->stack[5];\n\n\tfz_concat(&gstate->ctm, &m, &gstate->ctm);\n}\n\nstatic void pdf_run_d(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\tpdf_obj *array;\n\tint i;\n\tint len;\n\n\tarray = csi->obj;\n\tlen = pdf_array_len(array);\n\tgstate->stroke_state = fz_unshare_stroke_state_with_dash_len(csi->doc->ctx, gstate->stroke_state, len);\n\tgstate->stroke_state->dash_len = len;\n\tfor (i = 0; i < len; i++)\n\t\tgstate->stroke_state->dash_list[i] = pdf_to_real(pdf_array_get(array, i));\n\tgstate->stroke_state->dash_phase = csi->stack[0];\n}\n\nstatic void pdf_run_d0(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tif (pr->nested_depth > 1)\n\t\treturn;\n\tpr->dev->flags |= FZ_DEVFLAG_COLOR;\n}\n\nstatic void pdf_run_d1(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tif (pr->nested_depth > 1)\n\t\treturn;\n\tpr->dev->flags |= FZ_DEVFLAG_MASK;\n\tpr->dev->flags &= ~(FZ_DEVFLAG_FILLCOLOR_UNDEFINED |\n\t\t\t\tFZ_DEVFLAG_STROKECOLOR_UNDEFINED |\n\t\t\t\tFZ_DEVFLAG_STARTCAP_UNDEFINED |\n\t\t\t\tFZ_DEVFLAG_DASHCAP_UNDEFINED |\n\t\t\t\tFZ_DEVFLAG_ENDCAP_UNDEFINED |\n\t\t\t\tFZ_DEVFLAG_LINEJOIN_UNDEFINED |\n\t\t\t\tFZ_DEVFLAG_MITERLIMIT_UNDEFINED |\n\t\t\t\tFZ_DEVFLAG_LINEWIDTH_UNDEFINED);\n}\n\nstatic void pdf_run_f(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpdf_show_path(csi, pr, 0, 1, 0, 0);\n}\n\nstatic void pdf_run_fstar(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpdf_show_path(csi, pr, 0, 1, 0, 1);\n}\n\nstatic void pdf_run_g(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpr->dev->flags &= ~FZ_DEVFLAG_FILLCOLOR_UNDEFINED;\n\tpdf_set_colorspace(csi, pr, PDF_FILL, fz_device_gray(csi->doc->ctx));\n\tpdf_set_color(csi, pr, PDF_FILL, csi->stack);\n}\n\nstatic void pdf_run_gs(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tpdf_obj *dict;\n\tpdf_obj *obj;\n\tfz_context *ctx = csi->doc->ctx;\n\tpdf_obj *rdb = csi->rdb;\n\n\tdict = pdf_dict_gets(rdb, \"ExtGState\");\n\tif (!dict)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot find ExtGState dictionary\");\n\n\tobj = pdf_dict_gets(dict, csi->name);\n\tif (!obj)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot find extgstate resource '%s'\", csi->name);\n\n\tpdf_run_extgstate(csi, pr, rdb, obj);\n}\n\nstatic void pdf_run_h(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tfz_closepath(csi->doc->ctx, pr->path);\n}\n\nstatic void pdf_run_i(pdf_csi *csi, void *state)\n{\n}\n\nstatic void pdf_run_j(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\n\tpr->dev->flags &= ~FZ_DEVFLAG_LINEJOIN_UNDEFINED;\n\tgstate->stroke_state = fz_unshare_stroke_state(csi->doc->ctx, gstate->stroke_state);\n\tgstate->stroke_state->linejoin = csi->stack[0];\n}\n\nstatic void pdf_run_k(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpr->dev->flags &= ~FZ_DEVFLAG_FILLCOLOR_UNDEFINED;\n\tpdf_set_colorspace(csi, pr, PDF_FILL, fz_device_cmyk(csi->doc->ctx));\n\tpdf_set_color(csi, pr, PDF_FILL, csi->stack);\n}\n\nstatic void pdf_run_l(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tfloat a, b;\n\n\ta = csi->stack[0];\n\tb = csi->stack[1];\n\tfz_lineto(csi->doc->ctx, pr->path, a, b);\n}\n\nstatic void pdf_run_m(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tfloat a, b;\n\n\ta = csi->stack[0];\n\tb = csi->stack[1];\n\tfz_moveto(csi->doc->ctx, pr->path, a, b);\n}\n\nstatic void pdf_run_n(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpdf_show_path(csi, pr, 0, 0, 0, 0);\n}\n\nstatic void pdf_run_q(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpdf_gsave(pr);\n}\n\nstatic void pdf_run_re(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tfz_context *ctx = csi->doc->ctx;\n\tfloat x, y, w, h;\n\n\tx = csi->stack[0];\n\ty = csi->stack[1];\n\tw = csi->stack[2];\n\th = csi->stack[3];\n\n\tfz_moveto(ctx, pr->path, x, y);\n\tfz_lineto(ctx, pr->path, x + w, y);\n\tfz_lineto(ctx, pr->path, x + w, y + h);\n\tfz_lineto(ctx, pr->path, x, y + h);\n\tfz_closepath(ctx, pr->path);\n}\n\nstatic void pdf_run_rg(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpr->dev->flags &= ~FZ_DEVFLAG_FILLCOLOR_UNDEFINED;\n\tpdf_set_colorspace(csi, pr, PDF_FILL, fz_device_rgb(csi->doc->ctx));\n\tpdf_set_color(csi, pr, PDF_FILL, csi->stack);\n}\n\nstatic void pdf_run_ri(pdf_csi *csi, void *state)\n{\n}\n\nstatic void pdf_run_s(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\tpdf_show_path(csi, pr, 1, 0, 1, 0);\n}\n\nstatic void pdf_run_sh(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tfz_context *ctx = csi->doc->ctx;\n\tpdf_obj *rdb = csi->rdb;\n\tpdf_obj *dict;\n\tpdf_obj *obj;\n\tfz_shade *shd;\n\n\tdict = pdf_dict_gets(rdb, \"Shading\");\n\tif (!dict)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot find shading dictionary\");\n\n\tobj = pdf_dict_gets(dict, csi->name);\n\tif (!obj)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot find shading resource: '%s'\", csi->name);\n\n\tif ((pr->dev->hints & FZ_IGNORE_SHADE) == 0)\n\t{\n\t\tshd = pdf_load_shading(csi->doc, obj);\n\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tpdf_show_shade(csi, pr, shd);\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tfz_drop_shade(ctx, shd);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t}\n}\n\nstatic void pdf_run_v(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tfloat a, b, c, d;\n\n\ta = csi->stack[0];\n\tb = csi->stack[1];\n\tc = csi->stack[2];\n\td = csi->stack[3];\n\tfz_curvetov(csi->doc->ctx, pr->path, a, b, c, d);\n}\n\nstatic void pdf_run_w(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tpdf_gstate *gstate;\n\n\tgstate = pdf_flush_text(csi, pr); /* linewidth affects stroked text rendering mode */\n\tpr->dev->flags &= ~FZ_DEVFLAG_LINEWIDTH_UNDEFINED;\n\tgstate->stroke_state = fz_unshare_stroke_state(csi->doc->ctx, gstate->stroke_state);\n\tgstate->stroke_state->linewidth = csi->stack[0];\n}\n\nstatic void pdf_run_y(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tfloat a, b, c, d;\n\n\ta = csi->stack[0];\n\tb = csi->stack[1];\n\tc = csi->stack[2];\n\td = csi->stack[3];\n\tfz_curvetoy(csi->doc->ctx, pr->path, a, b, c, d);\n}\n\nstatic void pdf_run_squote(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\n\tfz_pre_translate(&pr->tlm, 0, -gstate->leading);\n\tpr->tm = pr->tlm;\n\n\tif (csi->string_len)\n\t\tpdf_show_string(csi, pr, csi->string, csi->string_len);\n\telse\n\t\tpdf_show_text(csi, pr, csi->obj);\n}\n\nstatic void pdf_run_dquote(pdf_csi *csi, void *state)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tpdf_gstate *gstate = pr->gstate + pr->gtop;\n\n\tgstate->word_space = csi->stack[0];\n\tgstate->char_space = csi->stack[1];\n\n\tfz_pre_translate(&pr->tlm, 0, -gstate->leading);\n\tpr->tm = pr->tlm;\n\n\tif (csi->string_len)\n\t\tpdf_show_string(csi, pr, csi->string, csi->string_len);\n\telse\n\t\tpdf_show_text(csi, pr, csi->obj);\n}\n\nstatic void free_processor_normal(pdf_csi *csi, void *state)\n{\n\tfz_context *ctx = csi->doc->ctx;\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\n\twhile (pr->gtop)\n\t\tpdf_grestore(pr);\n\n\tpdf_drop_material(ctx, &pr->gstate[0].fill);\n\tpdf_drop_material(ctx, &pr->gstate[0].stroke);\n\tif (pr->gstate[0].font)\n\t\tpdf_drop_font(ctx, pr->gstate[0].font);\n\tif (pr->gstate[0].softmask)\n\t\tpdf_drop_xobject(ctx, pr->gstate[0].softmask);\n\t/* SumatraPDF: support transfer functions */\n\tfz_drop_transfer_function(ctx, pr->gstate[0].tr);\n\tfz_drop_transfer_function(ctx, pr->gstate[0].softmask_tr);\n\tfz_drop_stroke_state(ctx, pr->gstate[0].stroke_state);\n\n\twhile (pr->gstate[0].clip_depth--)\n\t\tfz_pop_clip(pr->dev);\n\n\tif (pr->path) fz_free_path(ctx, pr->path);\n\tif (pr->text) fz_free_text(ctx, pr->text);\n\n\tfz_free(ctx, pr->gstate);\n\tfz_free(ctx, pr);\n}\n\nstatic void\nprocess_annot(pdf_csi *csi, void *state, pdf_obj *resources, pdf_annot *annot)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tfz_context *ctx = pr->ctx;\n\tint flags;\n\n\tif (pdf_is_hidden_ocg(pdf_dict_gets(annot->obj, \"OC\"), csi, pr, resources))\n\t\treturn;\n\n\tflags = pdf_to_int(pdf_dict_gets(annot->obj, \"F\"));\n\tif (!strcmp(pr->event, \"Print\") && !(flags & (1 << 2))) /* Print */\n\t\treturn;\n\tif (!strcmp(pr->event, \"View\") && (flags & (1 << 5))) /* NoView */\n\t\treturn;\n\n\tfz_try(ctx)\n\t{\n\t\t/* We need to save an extra level here to allow for level 0\n\t\t * to be the 'parent' gstate level. */\n\t\tpdf_gsave(pr);\n\t\trun_xobject(csi, state, resources, annot->ap, &annot->matrix);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\twhile (pr->gtop > 0)\n\t\t\tpdf_grestore(pr);\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void\nprocess_stream(pdf_csi *csi, void *state, pdf_lexbuf *buf)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tfz_context *ctx = pr->ctx;\n\tint save_gbot;\n\n\tsave_gbot = pr->gbot;\n\tpr->gbot = pr->gtop;\n\tfz_try(ctx)\n\t{\n\t\tpdf_process_stream(csi, buf);\n\t}\n\tfz_always(ctx)\n\t{\n\t\twhile (pr->gtop > pr->gbot)\n\t\t\tpdf_grestore(pr);\n\t\tpr->gbot = save_gbot;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void\nprocess_contents(pdf_csi *csi, void *state, pdf_obj *resources, pdf_obj *contents)\n{\n\tpdf_run_state *pr = (pdf_run_state *)state;\n\tfz_context *ctx = pr->ctx;\n\n\tfz_try(ctx)\n\t{\n\t\t/* We need to save an extra level here to allow for level 0\n\t\t * to be the 'parent' gstate level. */\n\t\tpdf_gsave(pr);\n\t\tpdf_process_contents_object(csi, resources, contents);\n\t}\n\tfz_always(ctx)\n\t{\n\t\twhile (pr->gtop > 0)\n\t\t\tpdf_grestore(pr);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nconst pdf_processor pdf_processor_normal =\n{\n\t{\n\tpdf_run_dquote,\n\tpdf_run_squote,\n\tpdf_run_B,\n\tpdf_run_Bstar,\n\tpdf_run_BDC,\n\tpdf_run_BI,\n\tpdf_run_BMC,\n\tpdf_run_BT,\n\tpdf_run_BX,\n\tpdf_run_CS,\n\tpdf_run_DP,\n\tpdf_run_EMC,\n\tpdf_run_ET,\n\tpdf_run_EX,\n\tpdf_run_F,\n\tpdf_run_G,\n\tpdf_run_J,\n\tpdf_run_K,\n\tpdf_run_M,\n\tpdf_run_MP,\n\tpdf_run_Q,\n\tpdf_run_RG,\n\tpdf_run_S,\n\tpdf_run_SC,\n\tpdf_run_SC, /* SCN */\n\tpdf_run_Tstar,\n\tpdf_run_TD,\n\tpdf_run_TJ,\n\tpdf_run_TL,\n\tpdf_run_Tc,\n\tpdf_run_Td,\n\tpdf_run_Tj,\n\tpdf_run_Tm,\n\tpdf_run_Tr,\n\tpdf_run_Ts,\n\tpdf_run_Tw,\n\tpdf_run_Tz,\n\tpdf_run_W,\n\tpdf_run_Wstar,\n\tpdf_run_b,\n\tpdf_run_bstar,\n\tpdf_run_c,\n\tpdf_run_cm,\n\tpdf_run_cs,\n\tpdf_run_d,\n\tpdf_run_d0,\n\tpdf_run_d1,\n\tpdf_run_f,\n\tpdf_run_fstar,\n\tpdf_run_g,\n\tpdf_run_h,\n\tpdf_run_i,\n\tpdf_run_j,\n\tpdf_run_k,\n\tpdf_run_l,\n\tpdf_run_m,\n\tpdf_run_n,\n\tpdf_run_q,\n\tpdf_run_re,\n\tpdf_run_rg,\n\tpdf_run_ri,\n\tpdf_run_s,\n\tpdf_run_sc,\n\tpdf_run_sc, /* scn */\n\tpdf_run_v,\n\tpdf_run_w,\n\tpdf_run_y,\n\tpdf_run_Do,\n\tpdf_run_Tf,\n\tpdf_run_gs,\n\tpdf_run_sh,\n\tfree_processor_normal\n\t},\n\tprocess_annot,\n\tprocess_stream,\n\tprocess_contents\n};\n\npdf_process *pdf_process_run(pdf_process *process, fz_device *dev, const fz_matrix *ctm, const char *event, pdf_gstate *gstate, int nested)\n{\n\tfz_context *ctx = dev->ctx;\n\tpdf_run_state *pr;\n\n\tpr = fz_malloc_struct(ctx, pdf_run_state);\n\tfz_try(ctx)\n\t{\n\t\tpr->ctx = ctx;\n\t\tpr->dev = dev;\n\t\tpr->in_hidden_ocg = 0;\n\t\tpr->event = event;\n\n\t\tpr->path = fz_new_path(ctx);\n\t\tpr->clip = 0;\n\t\tpr->clip_even_odd = 0;\n\n\t\tpr->text = NULL;\n\t\tpr->tlm = fz_identity;\n\t\tpr->tm = fz_identity;\n\t\tpr->text_mode = 0;\n\t\tpr->accumulate = 1;\n\n\t\tpr->gcap = 64;\n\t\tpr->gstate = fz_malloc_array(ctx, pr->gcap, sizeof(pdf_gstate));\n\n\t\tpr->nested_depth = nested;\n\t\tpdf_init_gstate(ctx, &pr->gstate[0], ctm);\n\t\tif (gstate)\n\t\t{\n\t\t\tpdf_copy_gstate(ctx, &pr->gstate[0], gstate);\n\t\t\tpr->gstate[0].ctm = *ctm;\n\t\t}\n\t\tpr->gtop = 0;\n\t\tpr->gbot = 0;\n\t\tpr->gparent = 0;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free_path(ctx, pr->path);\n\t\tfz_free(ctx, pr);\n\t\tfz_rethrow(ctx);\n\t}\n\n\tprocess->state = pr;\n\tprocess->processor = &pdf_processor_normal;\n\treturn process;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-outline.c",
    "content": "#include \"mupdf/pdf.h\"\n\nstatic fz_outline *\npdf_load_outline_imp(pdf_document *doc, pdf_obj *dict)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_outline *node, **prev, *first;\n\tpdf_obj *obj;\n\tpdf_obj *odict = dict;\n\n\tfz_var(dict);\n\tfz_var(first);\n\n\tfz_try(ctx)\n\t{\n\t\tfirst = NULL;\n\t\tprev = &first;\n\t\twhile (dict && pdf_is_dict(dict))\n\t\t{\n\t\t\tif (pdf_mark_obj(dict))\n\t\t\t\tbreak;\n\t\t\tnode = fz_malloc_struct(ctx, fz_outline);\n\t\t\tnode->title = NULL;\n\t\t\tnode->dest.kind = FZ_LINK_NONE;\n\t\t\tnode->down = NULL;\n\t\t\tnode->next = NULL;\n\t\t\t*prev = node;\n\t\t\tprev = &node->next;\n\n\t\t\tobj = pdf_dict_gets(dict, \"Title\");\n\t\t\tif (obj)\n\t\t\t\tnode->title = pdf_to_utf8(doc, obj);\n\n\t\t\t/* SumatraPDF: support expansion states */\n\t\t\tnode->is_open = pdf_to_int(pdf_dict_gets(dict, \"Count\")) >= 0;\n\n\t\t\t/* SumatraPDF: tolerate invalid link destinations and actions */\n\t\t\tfz_try(ctx)\n\t\t\t{\n\n\t\t\tif ((obj = pdf_dict_gets(dict, \"Dest\")) != NULL)\n\t\t\t\tnode->dest = pdf_parse_link_dest(doc, FZ_LINK_GOTO, obj);\n\t\t\telse if ((obj = pdf_dict_gets(dict, \"A\")) != NULL)\n\t\t\t\tnode->dest = pdf_parse_action(doc, obj);\n\n\t\t\t}\n\t\t\tfz_catch(ctx) { }\n\n\t\t\tobj = pdf_dict_gets(dict, \"First\");\n\t\t\tif (obj)\n\t\t\t\tnode->down = pdf_load_outline_imp(doc, obj);\n\n\t\t\tdict = pdf_dict_gets(dict, \"Next\");\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfor (dict = odict; dict && pdf_obj_marked(dict); dict = pdf_dict_gets(dict, \"Next\"))\n\t\t\tpdf_unmark_obj(dict);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free_outline(ctx, first);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn first;\n}\n\nfz_outline *\npdf_load_outline(pdf_document *doc)\n{\n\tpdf_obj *root, *obj, *first;\n\n\troot = pdf_dict_gets(pdf_trailer(doc), \"Root\");\n\tobj = pdf_dict_gets(root, \"Outlines\");\n\tfirst = pdf_dict_gets(obj, \"First\");\n\tif (first)\n\t\treturn pdf_load_outline_imp(doc, first);\n\n\treturn NULL;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-page.c",
    "content": "#include \"mupdf/pdf.h\"\n\nint\npdf_count_pages(pdf_document *doc)\n{\n\tif (doc->page_count == 0)\n\t{\n\t\tpdf_obj *count = pdf_dict_getp(pdf_trailer(doc), \"Root/Pages/Count\");\n\t\tdoc->page_count = pdf_to_int(count);\n\t}\n\treturn doc->page_count;\n}\n\nenum\n{\n\tLOCAL_STACK_SIZE = 16\n};\n\nstatic pdf_obj *\npdf_lookup_page_loc_imp(pdf_document *doc, pdf_obj *node, int *skip, pdf_obj **parentp, int *indexp)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *kids;\n\tpdf_obj *hit = NULL;\n\tint i, len;\n\tpdf_obj *local_stack[LOCAL_STACK_SIZE];\n\tpdf_obj **stack = &local_stack[0];\n\tint stack_max = LOCAL_STACK_SIZE;\n\tint stack_len = 0;\n\n\tfz_var(hit);\n\tfz_var(stack);\n\tfz_var(stack_len);\n\tfz_var(stack_max);\n\n\tfz_try(ctx)\n\t{\n\t\tdo\n\t\t{\n\t\t\tkids = pdf_dict_gets(node, \"Kids\");\n\t\t\tlen = pdf_array_len(kids);\n\n\t\t\tif (len == 0)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Malformed pages tree\");\n\n\t\t\t/* Every node we need to unmark goes into the stack */\n\t\t\tif (stack_len == stack_max)\n\t\t\t{\n\t\t\t\tif (stack == &local_stack[0])\n\t\t\t\t{\n\t\t\t\t\tstack = fz_malloc_array(ctx, stack_max * 2, sizeof(*stack));\n\t\t\t\t\tmemcpy(stack, &local_stack[0], stack_max * sizeof(*stack));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tstack = fz_resize_array(ctx, stack, stack_max * 2, sizeof(*stack));\n\t\t\t\tstack_max *= 2;\n\t\t\t}\n\t\t\tstack[stack_len++] = node;\n\n\t\t\tif (pdf_mark_obj(node))\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cycle in page tree\");\n\n\t\t\tfor (i = 0; i < len; i++)\n\t\t\t{\n\t\t\t\tpdf_obj *kid = pdf_array_get(kids, i);\n\t\t\t\tchar *type = pdf_to_name(pdf_dict_gets(kid, \"Type\"));\n\t\t\t\tif (*type ? !strcmp(type, \"Pages\") : pdf_dict_gets(kid, \"Kids\") && !pdf_dict_gets(kid, \"MediaBox\"))\n\t\t\t\t{\n\t\t\t\t\tint count = pdf_to_int(pdf_dict_gets(kid, \"Count\"));\n\t\t\t\t\tif (*skip < count)\n\t\t\t\t\t{\n\t\t\t\t\t\tnode = kid;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t*skip -= count;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (*type ? strcmp(type, \"Page\") != 0 : !pdf_dict_gets(kid, \"MediaBox\"))\n\t\t\t\t\t\tfz_warn(ctx, \"non-page object in page tree (%s)\", type);\n\t\t\t\t\tif (*skip == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (parentp) *parentp = node;\n\t\t\t\t\t\tif (indexp) *indexp = i;\n\t\t\t\t\t\thit = kid;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t(*skip)--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\twhile (hit == NULL);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfor (i = stack_len; i > 0; i--)\n\t\t\tpdf_unmark_obj(stack[i-1]);\n\t\tif (stack != &local_stack[0])\n\t\t\tfz_free(ctx, stack);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn hit;\n}\n\npdf_obj *\npdf_lookup_page_loc(pdf_document *doc, int needle, pdf_obj **parentp, int *indexp)\n{\n\tpdf_obj *root = pdf_dict_gets(pdf_trailer(doc), \"Root\");\n\tpdf_obj *node = pdf_dict_gets(root, \"Pages\");\n\tint skip = needle;\n\tpdf_obj *hit;\n\n\tif (!node)\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"cannot find page tree\");\n\n\thit = pdf_lookup_page_loc_imp(doc, node, &skip, parentp, indexp);\n\tif (!hit)\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"cannot find page %d in page tree\", needle);\n\treturn hit;\n}\n\npdf_obj *\npdf_lookup_page_obj(pdf_document *doc, int needle)\n{\n\treturn pdf_lookup_page_loc(doc, needle, NULL, NULL);\n}\n\nstatic int\npdf_count_pages_before_kid(pdf_document *doc, pdf_obj *parent, int kid_num)\n{\n\tpdf_obj *kids = pdf_dict_gets(parent, \"Kids\");\n\tint i, total = 0, len = pdf_array_len(kids);\n\tfor (i = 0; i < len; i++)\n\t{\n\t\tpdf_obj *kid = pdf_array_get(kids, i);\n\t\tif (pdf_to_num(kid) == kid_num)\n\t\t\treturn total;\n\t\tif (!strcmp(pdf_to_name(pdf_dict_gets(kid, \"Type\")), \"Pages\"))\n\t\t{\n\t\t\tpdf_obj *count = pdf_dict_gets(kid, \"Count\");\n\t\t\tint n = pdf_to_int(count);\n\t\t\tif (!pdf_is_int(count) || n < 0)\n\t\t\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"illegal or missing count in pages tree\");\n\t\t\ttotal += n;\n\t\t}\n\t\telse\n\t\t\ttotal++;\n\t}\n\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"kid not found in parent's kids array\");\n}\n\nint\npdf_lookup_page_number(pdf_document *doc, pdf_obj *node)\n{\n\tfz_context *ctx = doc->ctx;\n\tint needle = pdf_to_num(node);\n\tint total = 0;\n\tpdf_obj *parent, *parent2;\n\n\tif (strcmp(pdf_to_name(pdf_dict_gets(node, \"Type\")), \"Page\") != 0)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"invalid page object\");\n\n\t/* cf. http://bugs.ghostscript.com/show_bug.cgi?id=695761 */\n\tif (doc->page_objs)\n\t{\n\t\tint i;\n\t\tfor (i = 0; i < doc->page_count; i++)\n\t\t\tif (!pdf_objcmp(doc->page_objs[i], node))\n\t\t\t\treturn i;\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"invalid page object\");\n\t}\n\n\tparent2 = parent = pdf_dict_gets(node, \"Parent\");\n\tfz_var(parent);\n\tfz_try(ctx)\n\t{\n\t\twhile (pdf_is_dict(parent))\n\t\t{\n\t\t\tif (pdf_mark_obj(parent))\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cycle in page tree (parents)\");\n\t\t\ttotal += pdf_count_pages_before_kid(doc, parent, needle);\n\t\t\tneedle = pdf_to_num(parent);\n\t\t\tparent = pdf_dict_gets(parent, \"Parent\");\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\t/* Run back and unmark */\n\t\twhile (parent2)\n\t\t{\n\t\t\tpdf_unmark_obj(parent2);\n\t\t\tif (parent2 == parent)\n\t\t\t\tbreak;\n\t\t\tparent2 = pdf_dict_gets(parent2, \"Parent\");\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn total;\n}\n\n/* SumatraPDF: make pdf_lookup_inherited_page_item externally available */\npdf_obj *\npdf_lookup_inherited_page_item(pdf_document *doc, pdf_obj *node, const char *key)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *node2 = node;\n\tpdf_obj *val;\n\n\t/* fz_var(node); Not required as node passed in */\n\n\tfz_try(ctx)\n\t{\n\t\tdo\n\t\t{\n\t\t\tval = pdf_dict_gets(node, key);\n\t\t\tif (val)\n\t\t\t\tbreak;\n\t\t\tif (pdf_mark_obj(node))\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cycle in page tree (parents)\");\n\t\t\tnode = pdf_dict_gets(node, \"Parent\");\n\t\t}\n\t\twhile (node);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tdo\n\t\t{\n\t\t\tpdf_unmark_obj(node2);\n\t\t\tif (node2 == node)\n\t\t\t\tbreak;\n\t\t\tnode2 = pdf_dict_gets(node2, \"Parent\");\n\t\t}\n\t\twhile (node2);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn val;\n}\n\n/* We need to know whether to install a page-level transparency group */\n\nstatic int pdf_resources_use_blending(pdf_document *doc, pdf_obj *rdb);\n\nstatic int\npdf_extgstate_uses_blending(pdf_document *doc, pdf_obj *dict)\n{\n\tpdf_obj *obj = pdf_dict_gets(dict, \"BM\");\n\t/* SumatraPDF: properly support /BM arrays */\n\tif (pdf_is_array(obj))\n\t{\n\t\tint k;\n\t\tfor (k = 0; k < pdf_array_len(obj); k++)\n\t\t{\n\t\t\tchar *bm = pdf_to_name(pdf_array_get(obj, k));\n\t\t\tif (!strcmp(bm, \"Normal\") || fz_lookup_blendmode(bm) > 0)\n\t\t\t\tbreak;\n\t\t}\n\t\tobj = pdf_array_get(obj, k);\n\t}\n\tif (pdf_is_name(obj) && strcmp(pdf_to_name(obj), \"Normal\"))\n\t\treturn 1;\n\t/* SumatraPDF: support transfer functions */\n\tobj = pdf_dict_getsa(dict, \"TR\", \"TR2\");\n\tif (obj && !pdf_is_name(obj))\n\t\treturn 1;\n\treturn 0;\n}\n\nstatic int\npdf_pattern_uses_blending(pdf_document *doc, pdf_obj *dict)\n{\n\tpdf_obj *obj;\n\tobj = pdf_dict_gets(dict, \"Resources\");\n\tif (pdf_resources_use_blending(doc, obj))\n\t\treturn 1;\n\tobj = pdf_dict_gets(dict, \"ExtGState\");\n\treturn pdf_extgstate_uses_blending(doc, obj);\n}\n\nstatic int\npdf_xobject_uses_blending(pdf_document *doc, pdf_obj *dict)\n{\n\tpdf_obj *obj = pdf_dict_gets(dict, \"Resources\");\n\tif (!strcmp(pdf_to_name(pdf_dict_getp(dict, \"Group/S\")), \"Transparency\"))\n\t\treturn 1;\n\treturn pdf_resources_use_blending(doc, obj);\n}\n\nstatic int\npdf_resources_use_blending(pdf_document *doc, pdf_obj *rdb)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *obj;\n\tint i, n, useBM = 0;\n\n\tif (!rdb)\n\t\treturn 0;\n\n\t/* Have we been here before and remembered an answer? */\n\tif (pdf_obj_memo(rdb, &useBM))\n\t\treturn useBM;\n\n\t/* stop on cyclic resource dependencies */\n\tif (pdf_mark_obj(rdb))\n\t\treturn 0;\n\n\tfz_try(ctx)\n\t{\n\t\tobj = pdf_dict_gets(rdb, \"ExtGState\");\n\t\tn = pdf_dict_len(obj);\n\t\tfor (i = 0; i < n; i++)\n\t\t\tif (pdf_extgstate_uses_blending(doc, pdf_dict_get_val(obj, i)))\n\t\t\t\tgoto found;\n\n\t\tobj = pdf_dict_gets(rdb, \"Pattern\");\n\t\tn = pdf_dict_len(obj);\n\t\tfor (i = 0; i < n; i++)\n\t\t\tif (pdf_pattern_uses_blending(doc, pdf_dict_get_val(obj, i)))\n\t\t\t\tgoto found;\n\n\t\tobj = pdf_dict_gets(rdb, \"XObject\");\n\t\tn = pdf_dict_len(obj);\n\t\tfor (i = 0; i < n; i++)\n\t\t\tif (pdf_xobject_uses_blending(doc, pdf_dict_get_val(obj, i)))\n\t\t\t\tgoto found;\n\t\tif (0)\n\t\t{\nfound:\n\t\t\tuseBM = 1;\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_unmark_obj(rdb);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\tpdf_set_obj_memo(rdb, useBM);\n\treturn useBM;\n}\n\nstatic void\npdf_load_transition(pdf_document *doc, pdf_page *page, pdf_obj *transdict)\n{\n\tchar *name;\n\tpdf_obj *obj;\n\tint type;\n\n\tobj = pdf_dict_gets(transdict, \"D\");\n\tpage->transition.duration = (obj ? pdf_to_real(obj) : 1);\n\n\tpage->transition.vertical = (pdf_to_name(pdf_dict_gets(transdict, \"Dm\"))[0] != 'H');\n\tpage->transition.outwards = (pdf_to_name(pdf_dict_gets(transdict, \"M\"))[0] != 'I');\n\t/* FIXME: If 'Di' is None, it should be handled differently, but\n\t * this only affects Fly, and we don't implement that currently. */\n\tpage->transition.direction = (pdf_to_int(pdf_dict_gets(transdict, \"Di\")));\n\t/* FIXME: Read SS for Fly when we implement it */\n\t/* FIXME: Read B for Fly when we implement it */\n\n\tname = pdf_to_name(pdf_dict_gets(transdict, \"S\"));\n\tif (!strcmp(name, \"Split\"))\n\t\ttype = FZ_TRANSITION_SPLIT;\n\telse if (!strcmp(name, \"Blinds\"))\n\t\ttype = FZ_TRANSITION_BLINDS;\n\telse if (!strcmp(name, \"Box\"))\n\t\ttype = FZ_TRANSITION_BOX;\n\telse if (!strcmp(name, \"Wipe\"))\n\t\ttype = FZ_TRANSITION_WIPE;\n\telse if (!strcmp(name, \"Dissolve\"))\n\t\ttype = FZ_TRANSITION_DISSOLVE;\n\telse if (!strcmp(name, \"Glitter\"))\n\t\ttype = FZ_TRANSITION_GLITTER;\n\telse if (!strcmp(name, \"Fly\"))\n\t\ttype = FZ_TRANSITION_FLY;\n\telse if (!strcmp(name, \"Push\"))\n\t\ttype = FZ_TRANSITION_PUSH;\n\telse if (!strcmp(name, \"Cover\"))\n\t\ttype = FZ_TRANSITION_COVER;\n\telse if (!strcmp(name, \"Uncover\"))\n\t\ttype = FZ_TRANSITION_UNCOVER;\n\telse if (!strcmp(name, \"Fade\"))\n\t\ttype = FZ_TRANSITION_FADE;\n\telse\n\t\ttype = FZ_TRANSITION_NONE;\n\tpage->transition.type = type;\n}\n\n/* SumatraPDF: allow replacing potentially slow pdf_lookup_page_obj */\npdf_page *\npdf_load_page(pdf_document *doc, int number)\n{\n\tpdf_obj *pageref;\n\n\tif (doc->file_reading_linearly)\n\t{\n\t\tpageref = pdf_progressive_advance(doc, number);\n\t\tif (pageref == NULL)\n\t\t\tfz_throw(doc->ctx, FZ_ERROR_TRYLATER, \"page %d not available yet\", number);\n\t}\n\telse\n\t\tpageref = pdf_lookup_page_obj(doc, number);\n\n\treturn pdf_load_page_by_obj(doc, number, pageref);\n}\n\n\npdf_page *\npdf_load_page_by_obj(pdf_document *doc, int number, pdf_obj *pageref)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_page *page;\n\tpdf_annot *annot;\n\tpdf_obj *pageobj, *obj;\n\tfz_rect mediabox, cropbox, realbox;\n\tfloat userunit;\n\tfz_matrix mat;\n\n\t/* SumatraPDF: allow replacing potentially slow pdf_lookup_page_obj */\n\tpageobj = pdf_resolve_indirect(pageref);\n\n\tpage = fz_malloc_struct(ctx, pdf_page);\n\tpage->resources = NULL;\n\tpage->contents = NULL;\n\tpage->transparency = 0;\n\tpage->links = NULL;\n\tpage->annots = NULL;\n\tpage->annot_tailp = &page->annots;\n\tpage->deleted_annots = NULL;\n\tpage->tmp_annots = NULL;\n\tpage->me = pdf_keep_obj(pageobj);\n\tpage->incomplete = 0;\n\n\tobj = pdf_dict_gets(pageobj, \"UserUnit\");\n\tif (pdf_is_real(obj))\n\t\tuserunit = pdf_to_real(obj);\n\telse\n\t\tuserunit = 1;\n\n\tpdf_to_rect(ctx, pdf_lookup_inherited_page_item(doc, pageobj, \"MediaBox\"), &mediabox);\n\tif (fz_is_empty_rect(&mediabox))\n\t{\n\t\tfz_warn(ctx, \"cannot find page size for page %d\", number + 1);\n\t\tmediabox.x0 = 0;\n\t\tmediabox.y0 = 0;\n\t\tmediabox.x1 = 612;\n\t\tmediabox.y1 = 792;\n\t}\n\n\tpdf_to_rect(ctx, pdf_lookup_inherited_page_item(doc, pageobj, \"CropBox\"), &cropbox);\n\tif (!fz_is_empty_rect(&cropbox))\n\t\tfz_intersect_rect(&mediabox, &cropbox);\n\n\tpage->mediabox.x0 = fz_min(mediabox.x0, mediabox.x1) * userunit;\n\tpage->mediabox.y0 = fz_min(mediabox.y0, mediabox.y1) * userunit;\n\tpage->mediabox.x1 = fz_max(mediabox.x0, mediabox.x1) * userunit;\n\tpage->mediabox.y1 = fz_max(mediabox.y0, mediabox.y1) * userunit;\n\n\tif (page->mediabox.x1 - page->mediabox.x0 < 1 || page->mediabox.y1 - page->mediabox.y0 < 1)\n\t{\n\t\tfz_warn(ctx, \"invalid page size in page %d\", number + 1);\n\t\tpage->mediabox = fz_unit_rect;\n\t}\n\n\tpage->rotate = pdf_to_int(pdf_lookup_inherited_page_item(doc, pageobj, \"Rotate\"));\n\t/* Snap page->rotate to 0, 90, 180 or 270 */\n\tif (page->rotate < 0)\n\t\tpage->rotate = 360 - ((-page->rotate) % 360);\n\tif (page->rotate >= 360)\n\t\tpage->rotate = page->rotate % 360;\n\tpage->rotate = 90*((page->rotate + 45)/90);\n\tif (page->rotate > 360)\n\t\tpage->rotate = 0;\n\n\tfz_pre_rotate(fz_scale(&page->ctm, 1, -1), -page->rotate);\n\trealbox = page->mediabox;\n\tfz_transform_rect(&realbox, &page->ctm);\n\tfz_pre_scale(fz_translate(&mat, -realbox.x0, -realbox.y0), userunit, userunit);\n\tfz_concat(&page->ctm, &page->ctm, &mat);\n\n\tfz_try(ctx)\n\t{\n\t\tobj = pdf_dict_gets(pageobj, \"Annots\");\n\t\tif (obj)\n\t\t{\n\t\t\tpage->links = pdf_load_link_annots(doc, obj, &page->ctm);\n\t\t\tpdf_load_annots(doc, page, obj);\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tif (fz_caught(ctx) != FZ_ERROR_TRYLATER)\n\t\t\t/* SumatraPDF: ignore annotations in case of unexpected errors */\n\t\t\tfz_warn(ctx, \"unexpectedly failed to load page annotations\");\n\t\tpage->incomplete |= PDF_PAGE_INCOMPLETE_ANNOTS;\n\t}\n\n\tpage->duration = pdf_to_real(pdf_dict_gets(pageobj, \"Dur\"));\n\n\tobj = pdf_dict_gets(pageobj, \"Trans\");\n\tpage->transition_present = (obj != NULL);\n\tif (obj)\n\t{\n\t\tpdf_load_transition(doc, page, obj);\n\t}\n\n\t// TODO: inherit\n\tpage->resources = pdf_lookup_inherited_page_item(doc, pageobj, \"Resources\");\n\tif (page->resources)\n\t\tpdf_keep_obj(page->resources);\n\n\tobj = pdf_dict_gets(pageobj, \"Contents\");\n\tfz_try(ctx)\n\t{\n\t\tpage->contents = pdf_keep_obj(obj);\n\n\t\tif (pdf_resources_use_blending(doc, page->resources))\n\t\t\tpage->transparency = 1;\n\t\telse if (!strcmp(pdf_to_name(pdf_dict_getp(pageobj, \"Group/S\")), \"Transparency\"))\n\t\t\tpage->transparency = 1;\n\n\t\tfor (annot = page->annots; annot && !page->transparency; annot = annot->next)\n\t\t\tif (annot->ap && pdf_resources_use_blending(doc, annot->ap->resources))\n\t\t\t\tpage->transparency = 1;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tif (fz_caught(ctx) != FZ_ERROR_TRYLATER)\n\t\t{\n\t\t\tpdf_free_page(doc, page);\n\t\t\tfz_rethrow_message(ctx, \"cannot load page %d contents (%d 0 R)\", number + 1, pdf_to_num(pageref));\n\t\t}\n\t\tpage->incomplete |= PDF_PAGE_INCOMPLETE_CONTENTS;\n\t}\n\n\treturn page;\n}\n\nfz_rect *\npdf_bound_page(pdf_document *doc, pdf_page *page, fz_rect *bounds)\n{\n\tfz_matrix mtx;\n\tfz_rect mediabox = page->mediabox;\n\tfz_transform_rect(&mediabox, fz_rotate(&mtx, page->rotate));\n\tbounds->x0 = bounds->y0 = 0;\n\tbounds->x1 = mediabox.x1 - mediabox.x0;\n\tbounds->y1 = mediabox.y1 - mediabox.y0;\n\treturn bounds;\n}\n\nfz_link *\npdf_load_links(pdf_document *doc, pdf_page *page)\n{\n\treturn fz_keep_link(doc->ctx, page->links);\n}\n\nvoid\npdf_free_page(pdf_document *doc, pdf_page *page)\n{\n\tif (page == NULL)\n\t\treturn;\n\tpdf_drop_obj(page->resources);\n\tpdf_drop_obj(page->contents);\n\tif (page->links)\n\t\tfz_drop_link(doc->ctx, page->links);\n\tif (page->annots)\n\t\tpdf_free_annot(doc->ctx, page->annots);\n\tif (page->deleted_annots)\n\t\tpdf_free_annot(doc->ctx, page->deleted_annots);\n\tif (page->tmp_annots)\n\t\tpdf_free_annot(doc->ctx, page->tmp_annots);\n\t/* doc->focus, when not NULL, refers to one of\n\t * the annotations and must be NULLed when the\n\t * annotations are destroyed. doc->focus_obj\n\t * keeps track of the actual annotation object. */\n\tdoc->focus = NULL;\n\tpdf_drop_obj(page->me);\n\tfz_free(doc->ctx, page);\n}\n\nvoid\npdf_delete_page(pdf_document *doc, int at)\n{\n\tpdf_obj *parent, *kids;\n\tint i;\n\n\tpdf_lookup_page_loc(doc, at, &parent, &i);\n\tkids = pdf_dict_gets(parent, \"Kids\");\n\tpdf_array_delete(kids, i);\n\n\twhile (parent)\n\t{\n\t\tint count = pdf_to_int(pdf_dict_gets(parent, \"Count\"));\n\t\tpdf_dict_puts_drop(parent, \"Count\", pdf_new_int(doc, count - 1));\n\t\tparent = pdf_dict_gets(parent, \"Parent\");\n\t}\n\n\tdoc->page_count = 0; /* invalidate cached value */\n}\n\nvoid\npdf_insert_page(pdf_document *doc, pdf_page *page, int at)\n{\n\tfz_context *ctx = doc->ctx;\n\tint count = pdf_count_pages(doc);\n\tpdf_obj *parent, *kids;\n\tpdf_obj *page_ref;\n\tint i;\n\n\tpage_ref = pdf_new_ref(doc, page->me);\n\n\tfz_try(ctx)\n\t{\n\t\tif (count == 0)\n\t\t{\n\t\t\tpdf_obj *root = pdf_dict_gets(pdf_trailer(doc), \"Root\");\n\t\t\tparent = pdf_dict_gets(root, \"Pages\");\n\t\t\tif (!parent)\n\t\t\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"cannot find page tree\");\n\n\t\t\tkids = pdf_dict_gets(parent, \"Kids\");\n\t\t\tif (!kids)\n\t\t\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"malformed page tree\");\n\n\t\t\tpdf_array_insert(kids, page_ref, 0);\n\t\t}\n\t\telse if (at >= count)\n\t\t{\n\t\t\tif (at == INT_MAX)\n\t\t\t\tat = count;\n\n\t\t\tif (at > count)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot insert page beyond end of page tree\");\n\n\t\t\t/* append after last page */\n\t\t\tpdf_lookup_page_loc(doc, count - 1, &parent, &i);\n\t\t\tkids = pdf_dict_gets(parent, \"Kids\");\n\t\t\tpdf_array_insert(kids, page_ref, i + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* insert before found page */\n\t\t\tpdf_lookup_page_loc(doc, at, &parent, &i);\n\t\t\tkids = pdf_dict_gets(parent, \"Kids\");\n\t\t\tpdf_array_insert(kids, page_ref, i);\n\t\t}\n\n\t\tpdf_dict_puts(page->me, \"Parent\", parent);\n\n\t\t/* Adjust page counts */\n\t\twhile (parent)\n\t\t{\n\t\t\tint count = pdf_to_int(pdf_dict_gets(parent, \"Count\"));\n\t\t\tpdf_dict_puts_drop(parent, \"Count\", pdf_new_int(doc, count + 1));\n\t\t\tparent = pdf_dict_gets(parent, \"Parent\");\n\t\t}\n\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(page_ref);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\tdoc->page_count = 0; /* invalidate cached value */\n}\n\nvoid\npdf_delete_page_range(pdf_document *doc, int start, int end)\n{\n\twhile (start < end)\n\t\tpdf_delete_page(doc, start++);\n}\n\npdf_page *\npdf_create_page(pdf_document *doc, fz_rect mediabox, int res, int rotate)\n{\n\tpdf_page *page = NULL;\n\tpdf_obj *pageobj;\n\tfloat userunit = 1;\n\tfz_context *ctx = doc->ctx;\n\tfz_matrix ctm, tmp;\n\tfz_rect realbox;\n\n\tpage = fz_malloc_struct(ctx, pdf_page);\n\n\tfz_try(ctx)\n\t{\n\t\tpage->resources = NULL;\n\t\tpage->contents = NULL;\n\t\tpage->transparency = 0;\n\t\tpage->links = NULL;\n\t\tpage->annots = NULL;\n\t\tpage->me = pageobj = pdf_new_dict(doc, 4);\n\n\t\tpdf_dict_puts_drop(pageobj, \"Type\", pdf_new_name(doc, \"Page\"));\n\n\t\tpage->mediabox.x0 = fz_min(mediabox.x0, mediabox.x1) * userunit;\n\t\tpage->mediabox.y0 = fz_min(mediabox.y0, mediabox.y1) * userunit;\n\t\tpage->mediabox.x1 = fz_max(mediabox.x0, mediabox.x1) * userunit;\n\t\tpage->mediabox.y1 = fz_max(mediabox.y0, mediabox.y1) * userunit;\n\t\tpdf_dict_puts_drop(pageobj, \"MediaBox\", pdf_new_rect(doc, &page->mediabox));\n\n\t\t/* Snap page->rotate to 0, 90, 180 or 270 */\n\t\tif (page->rotate < 0)\n\t\t\tpage->rotate = 360 - ((-page->rotate) % 360);\n\t\tif (page->rotate >= 360)\n\t\t\tpage->rotate = page->rotate % 360;\n\t\tpage->rotate = 90*((page->rotate + 45)/90);\n\t\tif (page->rotate > 360)\n\t\t\tpage->rotate = 0;\n\t\tpdf_dict_puts_drop(pageobj, \"Rotate\", pdf_new_int(doc, page->rotate));\n\n\t\tfz_pre_rotate(fz_scale(&ctm, 1, -1), -page->rotate);\n\t\trealbox = page->mediabox;\n\t\tfz_transform_rect(&realbox, &ctm);\n\t\tfz_pre_scale(fz_translate(&tmp, -realbox.x0, -realbox.y0), userunit, userunit);\n\t\tfz_concat(&ctm, &ctm, &tmp);\n\t\tpage->ctm = ctm;\n\t\t/* Do not create a Contents, as an empty Contents dict is not\n\t\t * valid. See Bug 694712 */\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_obj(page->me);\n\t\tfz_free(ctx, page);\n\t\tfz_rethrow_message(ctx, \"Failed to create page\");\n\t}\n\n\treturn page;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-parse.c",
    "content": "#include \"mupdf/pdf.h\"\n\nfz_rect *\npdf_to_rect(fz_context *ctx, pdf_obj *array, fz_rect *r)\n{\n\tfloat a = pdf_to_real(pdf_array_get(array, 0));\n\tfloat b = pdf_to_real(pdf_array_get(array, 1));\n\tfloat c = pdf_to_real(pdf_array_get(array, 2));\n\tfloat d = pdf_to_real(pdf_array_get(array, 3));\n\tr->x0 = fz_min(a, c);\n\tr->y0 = fz_min(b, d);\n\tr->x1 = fz_max(a, c);\n\tr->y1 = fz_max(b, d);\n\treturn r;\n}\n\nfz_matrix *\npdf_to_matrix(fz_context *ctx, pdf_obj *array, fz_matrix *m)\n{\n\tm->a = pdf_to_real(pdf_array_get(array, 0));\n\tm->b = pdf_to_real(pdf_array_get(array, 1));\n\tm->c = pdf_to_real(pdf_array_get(array, 2));\n\tm->d = pdf_to_real(pdf_array_get(array, 3));\n\tm->e = pdf_to_real(pdf_array_get(array, 4));\n\tm->f = pdf_to_real(pdf_array_get(array, 5));\n\treturn m;\n}\n\n/* SumatraPDF: detect UTF-8 strings and use them as is */\nstatic int\npdf_is_valid_utf8(const unsigned char *data, const unsigned char *data_end)\n{\n\tfor (; data < data_end; data++)\n\t{\n\t\tint skip = *data < 0x80 ? 0 : *data < 0xC0 ? -1 : *data < 0xE0 ? 1 : *data < 0xF0 ? 2 : *data < 0xF5 ? 3 : -1;\n\t\tif (skip == -1)\n\t\t\treturn 0;\n\t\twhile (skip-- > 0)\n\t\t\tif (++data >= data_end || (*data & 0xC0) != 0x80)\n\t\t\t\treturn 0;\n\t}\n\treturn 1;\n}\n\n/* Convert Unicode/PdfDocEncoding string into utf-8 */\nchar *\npdf_to_utf8(pdf_document *doc, pdf_obj *src)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_buffer *strmbuf = NULL;\n\tunsigned char *srcptr;\n\tchar *dstptr, *dst;\n\tint srclen;\n\tint dstlen = 0;\n\tint ucs;\n\tint i;\n\n\tfz_var(strmbuf);\n\tfz_try(ctx)\n\t{\n\t\tif (pdf_is_string(src))\n\t\t{\n\t\t\tsrcptr = (unsigned char *) pdf_to_str_buf(src);\n\t\t\tsrclen = pdf_to_str_len(src);\n\t\t}\n\t\telse if (pdf_is_stream(doc, pdf_to_num(src), pdf_to_gen(src)))\n\t\t{\n\t\t\tstrmbuf = pdf_load_stream(doc, pdf_to_num(src), pdf_to_gen(src));\n\t\t\tsrclen = fz_buffer_storage(ctx, strmbuf, (unsigned char **)&srcptr);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsrclen = 0;\n\t\t}\n\n\t\tif (srclen >= 2 && srcptr[0] == 254 && srcptr[1] == 255)\n\t\t{\n\t\t\tfor (i = 2; i + 1 < srclen; i += 2)\n\t\t\t{\n\t\t\t\tucs = srcptr[i] << 8 | srcptr[i+1];\n\t\t\t\tdstlen += fz_runelen(ucs);\n\t\t\t}\n\n\t\t\tdstptr = dst = fz_malloc(ctx, dstlen + 1);\n\n\t\t\tfor (i = 2; i + 1 < srclen; i += 2)\n\t\t\t{\n\t\t\t\tucs = srcptr[i] << 8 | srcptr[i+1];\n\t\t\t\tdstptr += fz_runetochar(dstptr, ucs);\n\t\t\t}\n\t\t}\n\t\telse if (srclen >= 2 && srcptr[0] == 255 && srcptr[1] == 254)\n\t\t{\n\t\t\tfor (i = 2; i + 1 < srclen; i += 2)\n\t\t\t{\n\t\t\t\tucs = srcptr[i] | srcptr[i+1] << 8;\n\t\t\t\tdstlen += fz_runelen(ucs);\n\t\t\t}\n\n\t\t\tdstptr = dst = fz_malloc(ctx, dstlen + 1);\n\n\t\t\tfor (i = 2; i + 1 < srclen; i += 2)\n\t\t\t{\n\t\t\t\tucs = srcptr[i] | srcptr[i+1] << 8;\n\t\t\t\tdstptr += fz_runetochar(dstptr, ucs);\n\t\t\t}\n\t\t}\n\t\t/* SumatraPDF: detect UTF-8 strings and use them as is */\n\t\t/* TODO: also detect UTF-8 strings in pdf_to_ucs2(_buf)? */\n\t\telse if (pdf_is_valid_utf8(srcptr, srcptr + srclen))\n\t\t{\n\t\t\tdst = fz_malloc(ctx, srclen + 1);\n\t\t\tmemcpy(dst, srcptr, srclen);\n\t\t\tdstptr = dst + srclen;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor (i = 0; i < srclen; i++)\n\t\t\t\tdstlen += fz_runelen(pdf_doc_encoding[srcptr[i]]);\n\n\t\t\tdstptr = dst = fz_malloc(ctx, dstlen + 1);\n\n\t\t\tfor (i = 0; i < srclen; i++)\n\t\t\t{\n\t\t\t\tucs = pdf_doc_encoding[srcptr[i]];\n\t\t\t\tdstptr += fz_runetochar(dstptr, ucs);\n\t\t\t}\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, strmbuf);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\t*dstptr = '\\0';\n\treturn dst;\n}\n\n/* Convert Unicode/PdfDocEncoding string into ucs-2 */\nunsigned short *\npdf_to_ucs2(pdf_document *doc, pdf_obj *src)\n{\n\tfz_context *ctx = doc->ctx;\n\tunsigned char *srcptr = (unsigned char *) pdf_to_str_buf(src);\n\tunsigned short *dstptr, *dst;\n\tint srclen = pdf_to_str_len(src);\n\tint i;\n\n\tif (srclen >= 2 && srcptr[0] == 254 && srcptr[1] == 255)\n\t{\n\t\tdstptr = dst = fz_malloc_array(ctx, (srclen - 2) / 2 + 1, sizeof(short));\n\t\tfor (i = 2; i + 1 < srclen; i += 2)\n\t\t\t*dstptr++ = srcptr[i] << 8 | srcptr[i+1];\n\t}\n\telse if (srclen >= 2 && srcptr[0] == 255 && srcptr[1] == 254)\n\t{\n\t\tdstptr = dst = fz_malloc_array(ctx, (srclen - 2) / 2 + 1, sizeof(short));\n\t\tfor (i = 2; i + 1 < srclen; i += 2)\n\t\t\t*dstptr++ = srcptr[i] | srcptr[i+1] << 8;\n\t}\n\telse\n\t{\n\t\tdstptr = dst = fz_malloc_array(ctx, srclen + 1, sizeof(short));\n\t\tfor (i = 0; i < srclen; i++)\n\t\t\t*dstptr++ = pdf_doc_encoding[srcptr[i]];\n\t}\n\n\t*dstptr = '\\0';\n\treturn dst;\n}\n\n/* allow to convert to UCS-2 without the need for an fz_context */\n/* (buffer must be at least (fz_to_str_len(src) + 1) * 2 bytes in size) */\nvoid\npdf_to_ucs2_buf(unsigned short *buffer, pdf_obj *src)\n{\n\tunsigned char *srcptr = (unsigned char *) pdf_to_str_buf(src);\n\tunsigned short *dstptr = buffer;\n\tint srclen = pdf_to_str_len(src);\n\tint i;\n\n\tif (srclen >= 2 && srcptr[0] == 254 && srcptr[1] == 255)\n\t{\n\t\tfor (i = 2; i + 1 < srclen; i += 2)\n\t\t\t*dstptr++ = srcptr[i] << 8 | srcptr[i+1];\n\t}\n\telse if (srclen >= 2 && srcptr[0] == 255 && srcptr[1] == 254)\n\t{\n\t\tfor (i = 2; i + 1 < srclen; i += 2)\n\t\t\t*dstptr++ = srcptr[i] | srcptr[i+1] << 8;\n\t}\n\telse\n\t{\n\t\tfor (i = 0; i < srclen; i++)\n\t\t\t*dstptr++ = pdf_doc_encoding[srcptr[i]];\n\t}\n\n\t*dstptr = '\\0';\n}\n\n/* Convert UCS-2 string into PdfDocEncoding for authentication */\nchar *\npdf_from_ucs2(pdf_document *doc, unsigned short *src)\n{\n\tfz_context *ctx = doc->ctx;\n\tint i, j, len;\n\tchar *docstr;\n\n\tlen = 0;\n\twhile (src[len])\n\t\tlen++;\n\n\tdocstr = fz_malloc(ctx, len + 1);\n\n\tfor (i = 0; i < len; i++)\n\t{\n\t\t/* shortcut: check if the character has the same code point in both encodings */\n\t\tif (0 < src[i] && src[i] < 256 && pdf_doc_encoding[src[i]] == src[i]) {\n\t\t\tdocstr[i] = src[i];\n\t\t\tcontinue;\n\t\t}\n\n\t\t/* search through pdf_docencoding for the character's code point */\n\t\tfor (j = 0; j < 256; j++)\n\t\t\tif (pdf_doc_encoding[j] == src[i])\n\t\t\t\tbreak;\n\t\tdocstr[i] = j;\n\n\t\t/* fail, if a character can't be encoded */\n\t\tif (!docstr[i])\n\t\t{\n\t\t\tfz_free(ctx, docstr);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\tdocstr[len] = '\\0';\n\n\treturn docstr;\n}\n\npdf_obj *\npdf_to_utf8_name(pdf_document *doc, pdf_obj *src)\n{\n\tchar *buf = pdf_to_utf8(doc, src);\n\tpdf_obj *dst = pdf_new_name(doc, buf);\n\tfz_free(doc->ctx, buf);\n\treturn dst;\n}\n\npdf_obj *\npdf_parse_array(pdf_document *doc, fz_stream *file, pdf_lexbuf *buf)\n{\n\tpdf_obj *ary = NULL;\n\tpdf_obj *obj = NULL;\n\tint a = 0, b = 0, n = 0;\n\tpdf_token tok;\n\tfz_context *ctx = file->ctx;\n\tpdf_obj *op = NULL;\n\n\tfz_var(obj);\n\n\tary = pdf_new_array(doc, 4);\n\n\tfz_try(ctx)\n\t{\n\t\twhile (1)\n\t\t{\n\t\t\ttok = pdf_lex(file, buf);\n\n\t\t\tif (tok != PDF_TOK_INT && tok != PDF_TOK_R)\n\t\t\t{\n\t\t\t\tif (n > 0)\n\t\t\t\t{\n\t\t\t\t\tobj = pdf_new_int(doc, a);\n\t\t\t\t\tpdf_array_push(ary, obj);\n\t\t\t\t\tpdf_drop_obj(obj);\n\t\t\t\t\tobj = NULL;\n\t\t\t\t}\n\t\t\t\tif (n > 1)\n\t\t\t\t{\n\t\t\t\t\tobj = pdf_new_int(doc, b);\n\t\t\t\t\tpdf_array_push(ary, obj);\n\t\t\t\t\tpdf_drop_obj(obj);\n\t\t\t\t\tobj = NULL;\n\t\t\t\t}\n\t\t\t\tn = 0;\n\t\t\t}\n\n\t\t\tif (tok == PDF_TOK_INT && n == 2)\n\t\t\t{\n\t\t\t\tobj = pdf_new_int(doc, a);\n\t\t\t\tpdf_array_push(ary, obj);\n\t\t\t\tpdf_drop_obj(obj);\n\t\t\t\tobj = NULL;\n\t\t\t\ta = b;\n\t\t\t\tn --;\n\t\t\t}\n\n\t\t\tswitch (tok)\n\t\t\t{\n\t\t\tcase PDF_TOK_CLOSE_ARRAY:\n\t\t\t\top = ary;\n\t\t\t\tgoto end;\n\n\t\t\tcase PDF_TOK_INT:\n\t\t\t\tif (n == 0)\n\t\t\t\t\ta = buf->i;\n\t\t\t\tif (n == 1)\n\t\t\t\t\tb = buf->i;\n\t\t\t\tn ++;\n\t\t\t\tbreak;\n\n\t\t\tcase PDF_TOK_R:\n\t\t\t\tif (n != 2)\n\t\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot parse indirect reference in array\");\n\t\t\t\tobj = pdf_new_indirect(doc, a, b);\n\t\t\t\tpdf_array_push(ary, obj);\n\t\t\t\tpdf_drop_obj(obj);\n\t\t\t\tobj = NULL;\n\t\t\t\tn = 0;\n\t\t\t\tbreak;\n\n\t\t\tcase PDF_TOK_OPEN_ARRAY:\n\t\t\t\tobj = pdf_parse_array(doc, file, buf);\n\t\t\t\tpdf_array_push(ary, obj);\n\t\t\t\tpdf_drop_obj(obj);\n\t\t\t\tobj = NULL;\n\t\t\t\tbreak;\n\n\t\t\tcase PDF_TOK_OPEN_DICT:\n\t\t\t\tobj = pdf_parse_dict(doc, file, buf);\n\t\t\t\tpdf_array_push(ary, obj);\n\t\t\t\tpdf_drop_obj(obj);\n\t\t\t\tobj = NULL;\n\t\t\t\tbreak;\n\n\t\t\tcase PDF_TOK_NAME:\n\t\t\t\tobj = pdf_new_name(doc, buf->scratch);\n\t\t\t\tpdf_array_push(ary, obj);\n\t\t\t\tpdf_drop_obj(obj);\n\t\t\t\tobj = NULL;\n\t\t\t\tbreak;\n\t\t\tcase PDF_TOK_REAL:\n\t\t\t\tobj = pdf_new_real(doc, buf->f);\n\t\t\t\tpdf_array_push(ary, obj);\n\t\t\t\tpdf_drop_obj(obj);\n\t\t\t\tobj = NULL;\n\t\t\t\tbreak;\n\t\t\tcase PDF_TOK_STRING:\n\t\t\t\tobj = pdf_new_string(doc, buf->scratch, buf->len);\n\t\t\t\tpdf_array_push(ary, obj);\n\t\t\t\tpdf_drop_obj(obj);\n\t\t\t\tobj = NULL;\n\t\t\t\tbreak;\n\t\t\tcase PDF_TOK_TRUE:\n\t\t\t\tobj = pdf_new_bool(doc, 1);\n\t\t\t\tpdf_array_push(ary, obj);\n\t\t\t\tpdf_drop_obj(obj);\n\t\t\t\tobj = NULL;\n\t\t\t\tbreak;\n\t\t\tcase PDF_TOK_FALSE:\n\t\t\t\tobj = pdf_new_bool(doc, 0);\n\t\t\t\tpdf_array_push(ary, obj);\n\t\t\t\tpdf_drop_obj(obj);\n\t\t\t\tobj = NULL;\n\t\t\t\tbreak;\n\t\t\tcase PDF_TOK_NULL:\n\t\t\t\tobj = pdf_new_null(doc);\n\t\t\t\tpdf_array_push(ary, obj);\n\t\t\t\tpdf_drop_obj(obj);\n\t\t\t\tobj = NULL;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot parse token in array\");\n\t\t\t}\n\t\t}\nend:\n\t\t{}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_obj(obj);\n\t\tpdf_drop_obj(ary);\n\t\tfz_rethrow_message(ctx, \"cannot parse array\");\n\t}\n\treturn op;\n}\n\n/* SumatraPDF: skip invalid simple tokens in dicts */\nstatic int\npdf_is_simple_tok(pdf_token tok)\n{\n\treturn\n\t\ttok != PDF_TOK_ERROR && tok != PDF_TOK_EOF &&\n\t\ttok != PDF_TOK_OPEN_ARRAY && tok != PDF_TOK_CLOSE_ARRAY &&\n\t\ttok != PDF_TOK_OPEN_DICT && tok != PDF_TOK_CLOSE_DICT &&\n\t\ttok != PDF_TOK_OPEN_BRACE && tok != PDF_TOK_CLOSE_BRACE;\n}\n\npdf_obj *\npdf_parse_dict(pdf_document *doc, fz_stream *file, pdf_lexbuf *buf)\n{\n\tpdf_obj *dict;\n\tpdf_obj *key = NULL;\n\tpdf_obj *val = NULL;\n\tpdf_token tok;\n\tint a, b;\n\tfz_context *ctx = file->ctx;\n\n\tdict = pdf_new_dict(doc, 8);\n\n\tfz_var(key);\n\tfz_var(val);\n\n\tfz_try(ctx)\n\t{\n\t\twhile (1)\n\t\t{\n\t\t\ttok = pdf_lex(file, buf);\n\tskip:\n\t\t\tif (tok == PDF_TOK_CLOSE_DICT)\n\t\t\t\tbreak;\n\n\t\t\t/* for BI .. ID .. EI in content streams */\n\t\t\tif (tok == PDF_TOK_KEYWORD && !strcmp(buf->scratch, \"ID\"))\n\t\t\t\tbreak;\n\n\t\t\t/* SumatraPDF skip invalid simple tokens in dicts */\n\t\t\tif (tok != PDF_TOK_NAME && pdf_is_simple_tok(tok))\n\t\t\t{\n\t\t\t\tfz_warn(ctx, \"skipping invalid key in dict\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (tok != PDF_TOK_NAME)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"invalid key in dict\");\n\n\t\t\tkey = pdf_new_name(doc, buf->scratch);\n\n\t\t\ttok = pdf_lex(file, buf);\n\n\t\t\tswitch (tok)\n\t\t\t{\n\t\t\tcase PDF_TOK_OPEN_ARRAY:\n\t\t\t\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=1643 */\n\t\t\t\tfz_try(ctx)\n\t\t\t\t{\n\t\t\t\t\tval = pdf_parse_array(doc, file, buf);\n\t\t\t\t}\n\t\t\t\tfz_catch(ctx)\n\t\t\t\t{\n\t\t\t\t\tfz_warn(ctx, \"ignoring broken array for '%s'\", pdf_to_name(key));\n\t\t\t\t\tpdf_drop_obj(key);\n\t\t\t\t\tval = key = NULL;\n\t\t\t\t\tdo\n\t\t\t\t\t\ttok = pdf_lex(file, buf);\n\t\t\t\t\twhile (pdf_is_simple_tok(tok));\n\t\t\t\t\tif (tok == PDF_TOK_CLOSE_DICT)\n\t\t\t\t\t\tgoto skip;\n\t\t\t\t\tif (tok == PDF_TOK_CLOSE_ARRAY)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot make sense of broken array after all\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase PDF_TOK_OPEN_DICT:\n\t\t\t\tval = pdf_parse_dict(doc, file, buf);\n\t\t\t\tbreak;\n\n\t\t\tcase PDF_TOK_NAME: val = pdf_new_name(doc, buf->scratch); break;\n\t\t\tcase PDF_TOK_REAL: val = pdf_new_real(doc, buf->f); break;\n\t\t\tcase PDF_TOK_STRING: val = pdf_new_string(doc, buf->scratch, buf->len); break;\n\t\t\tcase PDF_TOK_TRUE: val = pdf_new_bool(doc, 1); break;\n\t\t\tcase PDF_TOK_FALSE: val = pdf_new_bool(doc, 0); break;\n\t\t\tcase PDF_TOK_NULL: val = pdf_new_null(doc); break;\n\n\t\t\tcase PDF_TOK_INT:\n\t\t\t\t/* 64-bit to allow for numbers > INT_MAX and overflow */\n\t\t\t\ta = buf->i;\n\t\t\t\ttok = pdf_lex(file, buf);\n\t\t\t\tif (tok == PDF_TOK_CLOSE_DICT || tok == PDF_TOK_NAME ||\n\t\t\t\t\t(tok == PDF_TOK_KEYWORD && !strcmp(buf->scratch, \"ID\")))\n\t\t\t\t{\n\t\t\t\t\tval = pdf_new_int(doc, a);\n\t\t\t\t\tpdf_dict_put(dict, key, val);\n\t\t\t\t\tpdf_drop_obj(val);\n\t\t\t\t\tval = NULL;\n\t\t\t\t\tpdf_drop_obj(key);\n\t\t\t\t\tkey = NULL;\n\t\t\t\t\tgoto skip;\n\t\t\t\t}\n\t\t\t\tif (tok == PDF_TOK_INT)\n\t\t\t\t{\n\t\t\t\t\tb = buf->i;\n\t\t\t\t\ttok = pdf_lex(file, buf);\n\t\t\t\t\tif (tok == PDF_TOK_R)\n\t\t\t\t\t{\n\t\t\t\t\t\tval = pdf_new_indirect(doc, a, b);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/* fz_throw(ctx, FZ_ERROR_GENERIC, \"invalid indirect reference in dict\");\n\t\t\t\t/* fall through */\n\n\t\t\tdefault:\n\t\t\t\t/* cf. https://code.google.com/p/sumatrapdf/issues/detail?id=2608 */\n\t\t\t\tif (!pdf_is_simple_tok(tok))\n\t\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"unknown token in dict\");\n\t\t\t\tfz_warn(ctx, \"skipping unknown token in dict\");\n\t\t\t\tpdf_drop_obj(key);\n\t\t\t\tkey = NULL;\n\t\t\t\twhile (pdf_is_simple_tok(tok) && tok != PDF_TOK_NAME &&\n\t\t\t\t\t(tok != PDF_TOK_KEYWORD || strcmp(buf->scratch, \"ID\") != 0))\n\t\t\t\t{\n\t\t\t\t\ttok = pdf_lex(file, buf);\n\t\t\t\t}\n\t\t\t\tgoto skip;\n\t\t\t}\n\n\t\t\tpdf_dict_put(dict, key, val);\n\t\t\tpdf_drop_obj(val);\n\t\t\tval = NULL;\n\t\t\tpdf_drop_obj(key);\n\t\t\tkey = NULL;\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_obj(dict);\n\t\tpdf_drop_obj(key);\n\t\tpdf_drop_obj(val);\n\t\tfz_rethrow_message(ctx, \"cannot parse dict\");\n\t}\n\treturn dict;\n}\n\npdf_obj *\npdf_parse_stm_obj(pdf_document *doc, fz_stream *file, pdf_lexbuf *buf)\n{\n\tpdf_token tok;\n\tfz_context *ctx = file->ctx;\n\n\ttok = pdf_lex(file, buf);\n\n\tswitch (tok)\n\t{\n\tcase PDF_TOK_OPEN_ARRAY:\n\t\treturn pdf_parse_array(doc, file, buf);\n\tcase PDF_TOK_OPEN_DICT:\n\t\treturn pdf_parse_dict(doc, file, buf);\n\tcase PDF_TOK_NAME: return pdf_new_name(doc, buf->scratch); break;\n\tcase PDF_TOK_REAL: return pdf_new_real(doc, buf->f); break;\n\tcase PDF_TOK_STRING: return pdf_new_string(doc, buf->scratch, buf->len); break;\n\tcase PDF_TOK_TRUE: return pdf_new_bool(doc, 1); break;\n\tcase PDF_TOK_FALSE: return pdf_new_bool(doc, 0); break;\n\tcase PDF_TOK_NULL: return pdf_new_null(doc); break;\n\tcase PDF_TOK_INT: return pdf_new_int(doc, buf->i); break;\n\tdefault: fz_throw(ctx, FZ_ERROR_GENERIC, \"unknown token in object stream\");\n\t}\n}\n\npdf_obj *\npdf_parse_ind_obj(pdf_document *doc,\n\tfz_stream *file, pdf_lexbuf *buf,\n\tint *onum, int *ogen, int *ostmofs, int *try_repair)\n{\n\tpdf_obj *obj = NULL;\n\tint num = 0, gen = 0, stm_ofs;\n\tpdf_token tok;\n\tint a, b;\n\tfz_context *ctx = file->ctx;\n\n\tfz_var(obj);\n\n\ttok = pdf_lex(file, buf);\n\tif (tok != PDF_TOK_INT)\n\t{\n\t\tif (try_repair)\n\t\t\t*try_repair = 1;\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"expected object number\");\n\t}\n\tnum = buf->i;\n\n\ttok = pdf_lex(file, buf);\n\tif (tok != PDF_TOK_INT)\n\t{\n\t\tif (try_repair)\n\t\t\t*try_repair = 1;\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"expected generation number (%d ? obj)\", num);\n\t}\n\tgen = buf->i;\n\n\ttok = pdf_lex(file, buf);\n\tif (tok != PDF_TOK_OBJ)\n\t{\n\t\tif (try_repair)\n\t\t\t*try_repair = 1;\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"expected 'obj' keyword (%d %d ?)\", num, gen);\n\t}\n\n\ttok = pdf_lex(file, buf);\n\n\tswitch (tok)\n\t{\n\tcase PDF_TOK_OPEN_ARRAY:\n\t\tobj = pdf_parse_array(doc, file, buf);\n\t\tbreak;\n\n\tcase PDF_TOK_OPEN_DICT:\n\t\tobj = pdf_parse_dict(doc, file, buf);\n\t\tbreak;\n\n\tcase PDF_TOK_NAME: obj = pdf_new_name(doc, buf->scratch); break;\n\tcase PDF_TOK_REAL: obj = pdf_new_real(doc, buf->f); break;\n\tcase PDF_TOK_STRING: obj = pdf_new_string(doc, buf->scratch, buf->len); break;\n\tcase PDF_TOK_TRUE: obj = pdf_new_bool(doc, 1); break;\n\tcase PDF_TOK_FALSE: obj = pdf_new_bool(doc, 0); break;\n\tcase PDF_TOK_NULL: obj = pdf_new_null(doc); break;\n\n\tcase PDF_TOK_INT:\n\t\ta = buf->i;\n\t\ttok = pdf_lex(file, buf);\n\n\t\tif (tok == PDF_TOK_STREAM || tok == PDF_TOK_ENDOBJ)\n\t\t{\n\t\t\tobj = pdf_new_int(doc, a);\n\t\t\tgoto skip;\n\t\t}\n\t\tif (tok == PDF_TOK_INT)\n\t\t{\n\t\t\tb = buf->i;\n\t\t\ttok = pdf_lex(file, buf);\n\t\t\tif (tok == PDF_TOK_R)\n\t\t\t{\n\t\t\t\tobj = pdf_new_indirect(doc, a, b);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"expected 'R' keyword (%d %d R)\", num, gen);\n\n\tcase PDF_TOK_ENDOBJ:\n\t\tobj = pdf_new_null(doc);\n\t\tgoto skip;\n\n\tdefault:\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"syntax error in object (%d %d R)\", num, gen);\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\ttok = pdf_lex(file, buf);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_obj(obj);\n\t\tfz_rethrow_message(ctx, \"cannot parse indirect object (%d %d R)\", num, gen);\n\t}\n\nskip:\n\tif (tok == PDF_TOK_STREAM)\n\t{\n\t\tint c = fz_read_byte(file);\n\t\twhile (c == ' ')\n\t\t\tc = fz_read_byte(file);\n\t\tif (c == '\\r')\n\t\t{\n\t\t\tc = fz_peek_byte(file);\n\t\t\tif (c != '\\n')\n\t\t\t\tfz_warn(ctx, \"line feed missing after stream begin marker (%d %d R)\", num, gen);\n\t\t\telse\n\t\t\t\tfz_read_byte(file);\n\t\t}\n\t\tstm_ofs = fz_tell(file);\n\t}\n\telse if (tok == PDF_TOK_ENDOBJ)\n\t{\n\t\tstm_ofs = 0;\n\t}\n\telse\n\t{\n\t\tfz_warn(ctx, \"expected 'endobj' or 'stream' keyword (%d %d R)\", num, gen);\n\t\tstm_ofs = 0;\n\t}\n\n\tif (onum) *onum = num;\n\tif (ogen) *ogen = gen;\n\tif (ostmofs) *ostmofs = stm_ofs;\n\treturn obj;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-pattern.c",
    "content": "#include \"mupdf/pdf.h\"\n\npdf_pattern *\npdf_keep_pattern(fz_context *ctx, pdf_pattern *pat)\n{\n\treturn (pdf_pattern *)fz_keep_storable(ctx, &pat->storable);\n}\n\nvoid\npdf_drop_pattern(fz_context *ctx, pdf_pattern *pat)\n{\n\tfz_drop_storable(ctx, &pat->storable);\n}\n\nstatic void\npdf_free_pattern_imp(fz_context *ctx, fz_storable *pat_)\n{\n\tpdf_pattern *pat = (pdf_pattern *)pat_;\n\n\tif (pat->resources)\n\t\tpdf_drop_obj(pat->resources);\n\tif (pat->contents)\n\t\tpdf_drop_obj(pat->contents);\n\tfz_free(ctx, pat);\n}\n\nstatic unsigned int\npdf_pattern_size(pdf_pattern *pat)\n{\n\tif (pat == NULL)\n\t\treturn 0;\n\treturn sizeof(*pat);\n}\n\npdf_pattern *\npdf_load_pattern(pdf_document *doc, pdf_obj *dict)\n{\n\tpdf_pattern *pat;\n\tpdf_obj *obj;\n\tfz_context *ctx = doc->ctx;\n\n\tif ((pat = pdf_find_item(ctx, pdf_free_pattern_imp, dict)) != NULL)\n\t{\n\t\treturn pat;\n\t}\n\n\tpat = fz_malloc_struct(ctx, pdf_pattern);\n\tFZ_INIT_STORABLE(pat, 1, pdf_free_pattern_imp);\n\tpat->resources = NULL;\n\tpat->contents = NULL;\n\n\t/* Store pattern now, to avoid possible recursion if objects refer back to this one */\n\tpdf_store_item(ctx, dict, pat, pdf_pattern_size(pat));\n\n\tpat->ismask = pdf_to_int(pdf_dict_gets(dict, \"PaintType\")) == 2;\n\tpat->xstep = pdf_to_real(pdf_dict_gets(dict, \"XStep\"));\n\tpat->ystep = pdf_to_real(pdf_dict_gets(dict, \"YStep\"));\n\n\tobj = pdf_dict_gets(dict, \"BBox\");\n\tpdf_to_rect(ctx, obj, &pat->bbox);\n\n\tobj = pdf_dict_gets(dict, \"Matrix\");\n\tif (obj)\n\t\tpdf_to_matrix(ctx, obj, &pat->matrix);\n\telse\n\t\tpat->matrix = fz_identity;\n\n\tpat->resources = pdf_dict_gets(dict, \"Resources\");\n\tif (pat->resources)\n\t\tpdf_keep_obj(pat->resources);\n\n\tfz_try(ctx)\n\t{\n\t\tpat->contents = pdf_keep_obj(dict);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_remove_item(ctx, pdf_free_pattern_imp, dict);\n\t\tpdf_drop_pattern(ctx, pat);\n\t\tfz_rethrow_message(ctx, \"cannot load pattern stream (%d %d R)\", pdf_to_num(dict), pdf_to_gen(dict));\n\t}\n\treturn pat;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-pkcs7.c",
    "content": "#include \"mupdf/pdf.h\" // TODO: move this file to pdf module\n\n#ifdef HAVE_OPENSSL\n\n#include \"openssl/err.h\"\n#include \"openssl/bio.h\"\n#include \"openssl/asn1.h\"\n#include \"openssl/x509.h\"\n#include \"openssl/err.h\"\n#include \"openssl/objects.h\"\n#include \"openssl/pem.h\"\n#include \"openssl/pkcs7.h\"\n#include \"openssl/pkcs12.h\"\n\nenum\n{\n\tSEG_START = 0,\n\tSEG_SIZE = 1\n};\n\ntypedef struct bsegs_struct\n{\n\tint (*seg)[2];\n\tint nsegs;\n\tint current_seg;\n\tint seg_pos;\n} BIO_SEGS_CTX;\n\nstatic int bsegs_read(BIO *b, char *buf, int size)\n{\n\tBIO_SEGS_CTX *ctx = (BIO_SEGS_CTX *)b->ptr;\n\tint read = 0;\n\n\twhile (size > 0 && ctx->current_seg < ctx->nsegs)\n\t{\n\t\tint nb = ctx->seg[ctx->current_seg][SEG_SIZE] - ctx->seg_pos;\n\n\t\tif (nb > size)\n\t\t\tnb = size;\n\n\t\tif (nb > 0)\n\t\t{\n\t\t\tif (ctx->seg_pos == 0)\n\t\t\t\t(void)BIO_seek(b->next_bio, ctx->seg[ctx->current_seg][SEG_START]);\n\n\t\t\t(void)BIO_read(b->next_bio, buf, nb);\n\t\t\tctx->seg_pos += nb;\n\t\t\tread += nb;\n\t\t\tbuf += nb;\n\t\t\tsize -= nb;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tctx->current_seg++;\n\n\t\t\tif (ctx->current_seg < ctx->nsegs)\n\t\t\t\tctx->seg_pos = 0;\n\t\t}\n\t}\n\n\treturn read;\n}\n\nstatic long bsegs_ctrl(BIO *b, int cmd, long arg1, void *arg2)\n{\n\treturn BIO_ctrl(b->next_bio, cmd, arg1, arg2);\n}\n\nstatic int bsegs_new(BIO *b)\n{\n\tBIO_SEGS_CTX *ctx;\n\n\tctx = (BIO_SEGS_CTX *)malloc(sizeof(BIO_SEGS_CTX));\n\tif (ctx == NULL)\n\t\treturn 0;\n\n\tctx->current_seg = 0;\n\tctx->seg_pos = 0;\n\tctx->seg = NULL;\n\tctx->nsegs = 0;\n\n\tb->init = 1;\n\tb->ptr = (char *)ctx;\n\tb->flags = 0;\n\tb->num = 0;\n\n\treturn 1;\n}\n\nstatic int bsegs_free(BIO *b)\n{\n\tif (b == NULL)\n\t\treturn 0;\n\n\tfree(b->ptr);\n\tb->ptr = NULL;\n\tb->init = 0;\n\tb->flags = 0;\n\n\treturn 1;\n}\n\nstatic long bsegs_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)\n{\n\treturn BIO_callback_ctrl(b->next_bio, cmd, fp);\n}\n\nstatic BIO_METHOD methods_bsegs =\n{\n\t0,\"segment reader\",\n\tNULL,\n\tbsegs_read,\n\tNULL,\n\tNULL,\n\tbsegs_ctrl,\n\tbsegs_new,\n\tbsegs_free,\n\tbsegs_callback_ctrl,\n};\n\nstatic BIO_METHOD *BIO_f_segments(void)\n{\n\treturn &methods_bsegs;\n}\n\nstatic void BIO_set_segments(BIO *b, int (*seg)[2], int nsegs)\n{\n\tBIO_SEGS_CTX *ctx = (BIO_SEGS_CTX *)b->ptr;\n\n\tctx->seg = seg;\n\tctx->nsegs = nsegs;\n}\n\ntypedef struct verify_context_s\n{\n\tX509_STORE_CTX x509_ctx;\n\tchar certdesc[256];\n\tint err;\n} verify_context;\n\nstatic int verify_callback(int ok, X509_STORE_CTX *ctx)\n{\n\tverify_context *vctx;\n\tX509 *err_cert;\n\tint err, depth;\n\n\tvctx = (verify_context *)ctx;\n\n\terr_cert = X509_STORE_CTX_get_current_cert(ctx);\n\terr = X509_STORE_CTX_get_error(ctx);\n\tdepth = X509_STORE_CTX_get_error_depth(ctx);\n\n\tX509_NAME_oneline(X509_get_subject_name(err_cert), vctx->certdesc, sizeof(vctx->certdesc));\n\n\tif (!ok && depth >= 6)\n\t{\n\t\tX509_STORE_CTX_set_error(ctx, X509_V_ERR_CERT_CHAIN_TOO_LONG);\n\t}\n\n\tswitch (ctx->error)\n\t{\n\tcase X509_V_ERR_INVALID_PURPOSE:\n\tcase X509_V_ERR_CERT_HAS_EXPIRED:\n\tcase X509_V_ERR_KEYUSAGE_NO_CERTSIGN:\n\t\terr = X509_V_OK;\n\t\tX509_STORE_CTX_set_error(ctx, X509_V_OK);\n\t\tok = 1;\n\t\tbreak;\n\n\tcase X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:\n\t\t/*\n\t\t\tIn this case, don't reset err to X509_V_OK, so that it can be reported,\n\t\t\talthough we do return 1, so that the digest will still be checked\n\t\t*/\n\t\tok = 1;\n\t\tbreak;\n\n\tdefault:\n\t\tbreak;\n\t}\n\n\tif (ok && vctx->err == X509_V_OK)\n\t\tvctx->err = err;\n\treturn ok;\n}\n\nstatic int pk7_verify(X509_STORE *cert_store, PKCS7 *p7, BIO *detached, char *ebuf, int ebufsize)\n{\n\tPKCS7_SIGNER_INFO *si;\n\tverify_context vctx;\n\tBIO *p7bio=NULL;\n\tchar readbuf[1024*4];\n\tint res = 1;\n\tint i;\n\tSTACK_OF(PKCS7_SIGNER_INFO) *sk;\n\n\tvctx.err = X509_V_OK;\n\tebuf[0] = 0;\n\n\tOpenSSL_add_all_algorithms();\n\n\tEVP_add_digest(EVP_md5());\n\tEVP_add_digest(EVP_sha1());\n\n\tERR_load_crypto_strings();\n\n\tERR_clear_error();\n\n\tX509_VERIFY_PARAM_set_flags(cert_store->param, X509_V_FLAG_CB_ISSUER_CHECK);\n\tX509_STORE_set_verify_cb_func(cert_store, verify_callback);\n\n\tp7bio = PKCS7_dataInit(p7, detached);\n\n\t/* We now have to 'read' from p7bio to calculate digests etc. */\n\twhile (BIO_read(p7bio, readbuf, sizeof(readbuf)) > 0)\n\t\t;\n\n\t/* We can now verify signatures */\n\tsk = PKCS7_get_signer_info(p7);\n\tif (sk == NULL)\n\t{\n\t\t/* there are no signatures on this data */\n\t\tres = 0;\n\t\tfz_strlcpy(ebuf, \"No signatures\", ebufsize);\n\t\tgoto exit;\n\t}\n\n\tfor (i=0; i<sk_PKCS7_SIGNER_INFO_num(sk); i++)\n\t{\n\t\tint rc;\n\t\tsi = sk_PKCS7_SIGNER_INFO_value(sk, i);\n\t\trc = PKCS7_dataVerify(cert_store, &vctx.x509_ctx, p7bio,p7, si);\n\t\tif (rc <= 0 || vctx.err != X509_V_OK)\n\t\t{\n\t\t\tchar tbuf[120];\n\n\t\t\tif (rc <= 0)\n\t\t\t{\n\t\t\t\tfz_strlcpy(ebuf, ERR_error_string(ERR_get_error(), tbuf), ebufsize);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/* Error while checking the certificate chain */\n\t\t\t\tsnprintf(ebuf, ebufsize, \"%s(%d): %s\", X509_verify_cert_error_string(vctx.err), vctx.err, vctx.certdesc);\n\t\t\t}\n\n\t\t\tres = 0;\n\t\t\tgoto exit;\n\t\t}\n\t}\n\nexit:\n\tX509_STORE_CTX_cleanup(&vctx.x509_ctx);\n\tERR_free_strings();\n\n\treturn res;\n}\n\nstatic unsigned char adobe_ca[] =\n{\n#include \"gen_adobe_ca.h\"\n};\n\nstatic int verify_sig(char *sig, int sig_len, char *file, int (*byte_range)[2], int byte_range_len, char *ebuf, int ebufsize)\n{\n\tPKCS7 *pk7sig = NULL;\n\tPKCS7 *pk7cert = NULL;\n\tX509_STORE *st = NULL;\n\tBIO *bsig = NULL;\n\tBIO *bcert = NULL;\n\tBIO *bdata = NULL;\n\tBIO *bsegs = NULL;\n\tSTACK_OF(X509) *certs = NULL;\n\tint t;\n\tint res = 0;\n\n\tbsig = BIO_new_mem_buf(sig, sig_len);\n\tpk7sig = d2i_PKCS7_bio(bsig, NULL);\n\tif (pk7sig == NULL)\n\t\tgoto exit;\n\n\tbdata = BIO_new(BIO_s_file());\n\tif (bdata == NULL)\n\t\tgoto exit;\n\tBIO_read_filename(bdata, file);\n\n\tbsegs = BIO_new(BIO_f_segments());\n\tif (bsegs == NULL)\n\t\tgoto exit;\n\n\tbsegs->next_bio = bdata;\n\tBIO_set_segments(bsegs, byte_range, byte_range_len);\n\n\t/* Find the certificates in the pk7 file */\n\tbcert = BIO_new_mem_buf(adobe_ca, sizeof(adobe_ca));\n\tpk7cert = d2i_PKCS7_bio(bcert, NULL);\n\tif (pk7cert == NULL)\n\t\tgoto exit;\n\n\tt = OBJ_obj2nid(pk7cert->type);\n\tswitch (t)\n\t{\n\tcase NID_pkcs7_signed:\n\t\tcerts = pk7cert->d.sign->cert;\n\t\tbreak;\n\n\tcase NID_pkcs7_signedAndEnveloped:\n\t\tcerts = pk7cert->d.sign->cert;\n\t\tbreak;\n\n\tdefault:\n\t\tbreak;\n\t}\n\n\tst = X509_STORE_new();\n\tif (st == NULL)\n\t\tgoto exit;\n\n\t/* Add the certificates to the store */\n\tif (certs != NULL)\n\t{\n\t\tint i, n = sk_X509_num(certs);\n\n\t\tfor (i = 0; i < n; i++)\n\t\t{\n\t\t\tX509 *c = sk_X509_value(certs, i);\n\t\t\tX509_STORE_add_cert(st, c);\n\t\t}\n\t}\n\n\tres = pk7_verify(st, pk7sig, bsegs, ebuf, ebufsize);\n\nexit:\n\tBIO_free(bsig);\n\tBIO_free(bdata);\n\tBIO_free(bsegs);\n\tBIO_free(bcert);\n\tPKCS7_free(pk7sig);\n\tPKCS7_free(pk7cert);\n\tX509_STORE_free(st);\n\n\treturn res;\n}\n\ntypedef struct pdf_designated_name_openssl_s\n{\n\tpdf_designated_name base;\n\tfz_context *ctx;\n\tchar buf[8192];\n} pdf_designated_name_openssl;\n\nstruct pdf_signer_s\n{\n\tfz_context *ctx;\n\tint refs;\n\tX509 *x509;\n\tEVP_PKEY *pkey;\n};\n\nvoid pdf_free_designated_name(pdf_designated_name *dn)\n{\n\tif (dn)\n\t\tfz_free(((pdf_designated_name_openssl *)dn)->ctx, dn);\n}\n\n\nstatic void add_from_bags(X509 **pX509, EVP_PKEY **pPkey, STACK_OF(PKCS12_SAFEBAG) *bags, const char *pw);\n\nstatic void add_from_bag(X509 **pX509, EVP_PKEY **pPkey, PKCS12_SAFEBAG *bag, const char *pw)\n{\n\tEVP_PKEY *pkey = NULL;\n\tX509 *x509 = NULL;\n\tPKCS8_PRIV_KEY_INFO *p8 = NULL;\n\tswitch (M_PKCS12_bag_type(bag))\n\t{\n\tcase NID_keyBag:\n\t\tp8 = bag->value.keybag;\n\t\tpkey = EVP_PKCS82PKEY(p8);\n\t\tbreak;\n\n\tcase NID_pkcs8ShroudedKeyBag:\n\t\tp8 = PKCS12_decrypt_skey(bag, pw, (int)strlen(pw));\n\t\tif (p8)\n\t\t{\n\t\t\tpkey = EVP_PKCS82PKEY(p8);\n\t\t\tPKCS8_PRIV_KEY_INFO_free(p8);\n\t\t}\n\t\tbreak;\n\n\tcase NID_certBag:\n\t\tif (M_PKCS12_cert_bag_type(bag) == NID_x509Certificate)\n\t\t\tx509 = PKCS12_certbag2x509(bag);\n\t\tbreak;\n\n\tcase NID_safeContentsBag:\n\t\tadd_from_bags(pX509, pPkey, bag->value.safes, pw);\n\t\tbreak;\n\t}\n\n\tif (pkey)\n\t{\n\t\tif (!*pPkey)\n\t\t\t*pPkey = pkey;\n\t\telse\n\t\t\tEVP_PKEY_free(pkey);\n\t}\n\n\tif (x509)\n\t{\n\t\tif (!*pX509)\n\t\t\t*pX509 = x509;\n\t\telse\n\t\t\tX509_free(x509);\n\t}\n}\n\nstatic void add_from_bags(X509 **pX509, EVP_PKEY **pPkey, STACK_OF(PKCS12_SAFEBAG) *bags, const char *pw)\n{\n\tint i;\n\n\tfor (i = 0; i < sk_PKCS12_SAFEBAG_num(bags); i++)\n\t\tadd_from_bag(pX509, pPkey, sk_PKCS12_SAFEBAG_value(bags, i), pw);\n}\n\npdf_signer *pdf_read_pfx(fz_context *ctx, const char *pfile, const char *pw)\n{\n\tBIO *pfxbio = NULL;\n\tPKCS12 *p12 = NULL;\n\tSTACK_OF(PKCS7) *asafes;\n\tpdf_signer *signer = NULL;\n\tint i;\n\n\tfz_var(pfxbio);\n\tfz_var(p12);\n\tfz_var(signer);\n\tfz_try(ctx)\n\t{\n\t\tsigner = fz_malloc_struct(ctx, pdf_signer);\n\t\tsigner->ctx = ctx;\n\t\tsigner->refs = 1;\n\n\t\tOpenSSL_add_all_algorithms();\n\n\t\tEVP_add_digest(EVP_md5());\n\t\tEVP_add_digest(EVP_sha1());\n\n\t\tERR_load_crypto_strings();\n\n\t\tERR_clear_error();\n\n\t\tpfxbio = BIO_new_file(pfile, \"r\");\n\t\tif (pfxbio == NULL)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Can't open pfx file: %s\", pfile);\n\n\t\tp12 = d2i_PKCS12_bio(pfxbio, NULL);\n\t\tif (p12 == NULL)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Invalid pfx file: %s\", pfile);\n\n\t\tasafes = PKCS12_unpack_authsafes(p12);\n\t\tif (asafes == NULL)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Invalid pfx file: %s\", pfile);\n\n\t\t/* Nothing in this for loop can fz_throw */\n\t\tfor (i = 0; i < sk_PKCS7_num(asafes); i++)\n\t\t{\n\t\t\tPKCS7 *p7;\n\t\t\tSTACK_OF(PKCS12_SAFEBAG) *bags;\n\t\t\tint bagnid;\n\n\t\t\tp7 = sk_PKCS7_value(asafes, i);\n\t\t\tbagnid = OBJ_obj2nid(p7->type);\n\t\t\tswitch (bagnid)\n\t\t\t{\n\t\t\tcase NID_pkcs7_data:\n\t\t\t\tbags = PKCS12_unpack_p7data(p7);\n\t\t\t\tbreak;\n\t\t\tcase NID_pkcs7_encrypted:\n\t\t\t\tbags = PKCS12_unpack_p7encdata(p7, pw, (int)strlen(pw));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (bags)\n\t\t\t{\n\t\t\t\tadd_from_bags(&signer->x509, &signer->pkey, bags, pw);\n\t\t\t\tsk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);\n\t\t\t}\n\t\t}\n\t\tsk_PKCS7_pop_free (asafes, PKCS7_free);\n\n\t\tif (signer->pkey == NULL)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Failed to obtain public key\");\n\n\t\tif (signer->x509 == NULL)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Failed to obtain certificate\");\n\t}\n\tfz_always(ctx)\n\t{\n\t\tBIO_free(pfxbio);\n\t\tPKCS12_free(p12);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_signer(signer);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn signer;\n}\n\npdf_signer *pdf_keep_signer(pdf_signer *signer)\n{\n\tif (signer)\n\t\tsigner->refs++;\n\n\treturn signer;\n}\n\nvoid pdf_drop_signer(pdf_signer *signer)\n{\n\tif (signer)\n\t{\n\t\tif (--signer->refs == 0)\n\t\t{\n\t\t\tX509_free(signer->x509);\n\t\t\tEVP_PKEY_free(signer->pkey);\n\t\t\tfz_free(signer->ctx, signer);\n\t\t}\n\t}\n}\n\npdf_designated_name *pdf_signer_designated_name(pdf_signer *signer)\n{\n\tfz_context *ctx = signer->ctx;\n\tpdf_designated_name_openssl *dn = fz_malloc_struct(ctx, pdf_designated_name_openssl);\n\tchar *p;\n\n\tdn->ctx = ctx;\n\tX509_NAME_oneline(X509_get_subject_name(signer->x509), dn->buf, sizeof(dn->buf));\n\tp = strstr(dn->buf, \"/CN=\");\n\tif (p) dn->base.cn = p+4;\n\tp = strstr(dn->buf, \"/O=\");\n\tif (p) dn->base.o = p+3;\n\tp = strstr(dn->buf, \"/OU=\");\n\tif (p) dn->base.ou = p+4;\n\tp = strstr(dn->buf, \"/emailAddress=\");\n\tif (p) dn->base.email = p+14;\n\tp = strstr(dn->buf, \"/C=\");\n\tif (p) dn->base.c = p+3;\n\n\tfor (p = dn->buf; *p; p++)\n\t\tif (*p == '/')\n\t\t\t*p = 0;\n\n\treturn (pdf_designated_name *)dn;\n}\n\nvoid pdf_write_digest(pdf_document *doc, char *filename, pdf_obj *byte_range, int digest_offset, int digest_length, pdf_signer *signer)\n{\n\tfz_context *ctx = doc->ctx;\n\tBIO *bdata = NULL;\n\tBIO *bsegs = NULL;\n\tBIO *bp7in = NULL;\n\tBIO *bp7 = NULL;\n\tPKCS7 *p7 = NULL;\n\tPKCS7_SIGNER_INFO *si;\n\tFILE *f = NULL;\n\n\tint (*brange)[2] = NULL;\n\tint brange_len = pdf_array_len(byte_range)/2;\n\n\tfz_var(bdata);\n\tfz_var(bsegs);\n\tfz_var(bp7in);\n\tfz_var(bp7);\n\tfz_var(p7);\n\tfz_var(f);\n\n\tfz_try(ctx)\n\t{\n\t\tunsigned char *p7_ptr;\n\t\tint p7_len;\n\t\tint i;\n\n\t\tbrange = fz_calloc(ctx, brange_len, sizeof(*brange));\n\t\tfor (i = 0; i < brange_len; i++)\n\t\t{\n\t\t\tbrange[i][0] = pdf_to_int(pdf_array_get(byte_range, 2*i));\n\t\t\tbrange[i][1] = pdf_to_int(pdf_array_get(byte_range, 2*i+1));\n\t\t}\n\n\t\tbdata = BIO_new(BIO_s_file());\n\t\tif (bdata == NULL)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Failed to create file BIO\");\n\t\tBIO_read_filename(bdata, filename);\n\n\t\tbsegs = BIO_new(BIO_f_segments());\n\t\tif (bsegs == NULL)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Failed to create segment filter\");\n\n\t\tbsegs->next_bio = bdata;\n\t\tBIO_set_segments(bsegs, brange, brange_len);\n\n\t\tp7 = PKCS7_new();\n\t\tif (p7 == NULL)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Failed to create p7 object\");\n\n\t\tPKCS7_set_type(p7, NID_pkcs7_signed);\n\t\tsi = PKCS7_add_signature(p7, signer->x509, signer->pkey, EVP_sha1());\n\t\tif (si == NULL)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Failed to add signature\");\n\n\t\tPKCS7_add_signed_attribute(si, NID_pkcs9_contentType, V_ASN1_OBJECT, OBJ_nid2obj(NID_pkcs7_data));\n\t\tPKCS7_add_certificate(p7, signer->x509);\n\n\t\tPKCS7_content_new(p7, NID_pkcs7_data);\n\t\tPKCS7_set_detached(p7, 1);\n\n\t\tbp7in = PKCS7_dataInit(p7, NULL);\n\t\tif (bp7in == NULL)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Failed to write to digest\");\n\n\t\twhile(1)\n\t\t{\n\t\t\tchar buf[4096];\n\t\t\tint n = BIO_read(bsegs, buf, sizeof(buf));\n\t\t\tif (n <= 0)\n\t\t\t\tbreak;\n\t\t\tBIO_write(bp7in, buf, n);\n\t\t}\n\n\t\tif (!PKCS7_dataFinal(p7, bp7in))\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Failed to write to digest\");\n\n\t\tBIO_free(bsegs);\n\t\tbsegs = NULL;\n\t\tBIO_free(bdata);\n\t\tbdata = NULL;\n\n\t\tbp7 = BIO_new(BIO_s_mem());\n\t\tif (bp7 == NULL || !i2d_PKCS7_bio(bp7, p7))\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Failed to create memory buffer for digest\");\n\n\t\tp7_len = BIO_get_mem_data(bp7, &p7_ptr);\n\t\tif (p7_len*2 + 2 > digest_length)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Insufficient space for digest\");\n\n\t\tf = fopen(filename, \"rb+\");\n\t\tif (f == NULL)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Failed to write digest\");\n\n\t\tfseek(f, digest_offset+1, SEEK_SET);\n\n\t\tfor (i = 0; i < p7_len; i++)\n\t\t\tfprintf(f, \"%02x\", p7_ptr[i]);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tPKCS7_free(p7);\n\t\tBIO_free(bsegs);\n\t\tBIO_free(bdata);\n\t\tBIO_free(bp7in);\n\t\tBIO_free(bp7);\n\t\tif (f)\n\t\t\tfclose(f);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nint pdf_check_signature(pdf_document *doc, pdf_widget *widget, char *file, char *ebuf, int ebufsize)\n{\n\tfz_context *ctx = doc->ctx;\n\tint (*byte_range)[2] = NULL;\n\tint byte_range_len;\n\tchar *contents = NULL;\n\tint contents_len;\n\tint res = 0;\n\tpdf_unsaved_sig *usig;\n\n\tfor (usig = doc->unsaved_sigs; usig; usig = usig->next)\n\t{\n\t\tif (usig->field == ((pdf_annot *)widget)->obj)\n\t\t{\n\t\t\tfz_strlcpy(ebuf, \"Signed but document yet to be saved\", ebufsize);\n\t\t\tif (ebufsize > 0)\n\t\t\t\tebuf[ebufsize-1] = 0;\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\tfz_var(byte_range);\n\tfz_var(res);\n\tfz_try(ctx);\n\t{\n\t\tbyte_range_len = pdf_signature_widget_byte_range(doc, widget, NULL);\n\t\tif (byte_range_len)\n\t\t{\n\t\t\tbyte_range = fz_calloc(ctx, byte_range_len, sizeof(*byte_range));\n\t\t\tpdf_signature_widget_byte_range(doc, widget, byte_range);\n\t\t}\n\n\t\tcontents_len = pdf_signature_widget_contents(doc, widget, &contents);\n\t\tif (byte_range && contents)\n\t\t{\n\t\t\tres = verify_sig(contents, contents_len, file, byte_range, byte_range_len, ebuf, ebufsize);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tres = 0;\n\t\t\tfz_strlcpy(ebuf, \"Not signed\", ebufsize);\n\t\t}\n\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_free(ctx, byte_range);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tres = 0;\n\t\tfz_strlcpy(ebuf, fz_caught_message(ctx), ebufsize);\n\t}\n\n\tif (ebufsize > 0)\n\t\tebuf[ebufsize-1] = 0;\n\n\treturn res;\n}\n\nvoid pdf_sign_signature(pdf_document *doc, pdf_widget *widget, const char *sigfile, const char *password)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_signer *signer = pdf_read_pfx(ctx, sigfile, password);\n\tpdf_designated_name *dn = NULL;\n\tfz_buffer *fzbuf = NULL;\n\n\tfz_try(ctx)\n\t{\n\t\tchar *dn_str;\n\t\tpdf_obj *wobj = ((pdf_annot *)widget)->obj;\n\t\tfz_rect rect = fz_empty_rect;\n\n\t\tpdf_signature_set_value(doc, wobj, signer);\n\n\t\tpdf_to_rect(ctx, pdf_dict_gets(wobj, \"Rect\"), &rect);\n\t\t/* Create an appearance stream only if the signature is intended to be visible */\n\t\tif (!fz_is_empty_rect(&rect))\n\t\t{\n\t\t\tdn = pdf_signer_designated_name(signer);\n\t\t\tfzbuf = fz_new_buffer(ctx, 256);\n\t\t\tif (!dn->cn)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Certificate has no common name\");\n\n\t\t\tfz_buffer_printf(ctx, fzbuf, \"cn=%s\", dn->cn);\n\n\t\t\tif (dn->o)\n\t\t\t\tfz_buffer_printf(ctx, fzbuf, \", o=%s\", dn->o);\n\n\t\t\tif (dn->ou)\n\t\t\t\tfz_buffer_printf(ctx, fzbuf, \", ou=%s\", dn->ou);\n\n\t\t\tif (dn->email)\n\t\t\t\tfz_buffer_printf(ctx, fzbuf, \", email=%s\", dn->email);\n\n\t\t\tif (dn->c)\n\t\t\t\tfz_buffer_printf(ctx, fzbuf, \", c=%s\", dn->c);\n\n\t\t\t(void)fz_buffer_storage(ctx, fzbuf, (unsigned char **) &dn_str);\n\t\t\tpdf_set_signature_appearance(doc, (pdf_annot *)widget, dn->cn, dn_str, NULL);\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_signer(signer);\n\t\tpdf_free_designated_name(dn);\n\t\tfz_drop_buffer(ctx, fzbuf);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nint pdf_signatures_supported(void)\n{\n\treturn 1;\n}\n\n#else /* HAVE_OPENSSL */\n\nint pdf_check_signature(pdf_document *doc, pdf_widget *widget, char *file, char *ebuf, int ebufsize)\n{\n\tfz_strlcpy(ebuf, \"This version of MuPDF was built without signature support\", ebufsize);\n\treturn 0;\n}\n\nvoid pdf_sign_signature(pdf_document *doc, pdf_widget *widget, const char *sigfile, const char *password)\n{\n}\n\npdf_signer *pdf_keep_signer(pdf_signer *signer)\n{\n\treturn NULL;\n}\n\nvoid pdf_drop_signer(pdf_signer *signer)\n{\n}\n\nvoid pdf_write_digest(pdf_document *doc, char *filename, pdf_obj *byte_range, int digest_offset, int digest_length, pdf_signer *signer)\n{\n}\n\nint pdf_signatures_supported(void)\n{\n\treturn 0;\n}\n\n#endif /* HAVE_OPENSSL */\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-repair.c",
    "content": "#include \"mupdf/pdf.h\"\n\n/* Scan file for objects and reconstruct xref table */\n\n/* Define in PDF 1.7 to be 8388607, but mupdf is more lenient. */\n#define MAX_OBJECT_NUMBER (10 << 20)\n\nstruct entry\n{\n\tint num;\n\tint gen;\n\tint ofs;\n\tint stm_ofs;\n\tint stm_len;\n};\n\nint\npdf_repair_obj(pdf_document *doc, pdf_lexbuf *buf, int *stmofsp, int *stmlenp, pdf_obj **encrypt, pdf_obj **id, pdf_obj **page, int *tmpofs)\n{\n\tpdf_token tok;\n\tint stm_len;\n\tfz_stream *file = doc->file;\n\tfz_context *ctx = file->ctx;\n\n\t*stmofsp = 0;\n\tif (stmlenp)\n\t\t*stmlenp = -1;\n\n\tstm_len = 0;\n\n\t/* On entry to this function, we know that we've just seen\n\t * '<int> <int> obj'. We expect the next thing we see to be a\n\t * pdf object. Regardless of the type of thing we meet next\n\t * we only need to fully parse it if it is a dictionary. */\n\ttok = pdf_lex(file, buf);\n\n\tif (tok == PDF_TOK_OPEN_DICT)\n\t{\n\t\tpdf_obj *dict, *obj;\n\n\t\t/* Send NULL xref so we don't try to resolve references */\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tdict = pdf_parse_dict(doc, file, buf);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\t\t/* Don't let a broken object at EOF overwrite a good one */\n\t\t\tif (file->eof)\n\t\t\t\tfz_rethrow_message(ctx, \"broken object at EOF ignored\");\n\t\t\t/* Silently swallow the error */\n\t\t\tdict = pdf_new_dict(doc, 2);\n\t\t}\n\n\t\tif (encrypt && id)\n\t\t{\n\t\t\tobj = pdf_dict_gets(dict, \"Type\");\n\t\t\tif (pdf_is_name(obj) && !strcmp(pdf_to_name(obj), \"XRef\"))\n\t\t\t{\n\t\t\t\tobj = pdf_dict_gets(dict, \"Encrypt\");\n\t\t\t\tif (obj)\n\t\t\t\t{\n\t\t\t\t\tpdf_drop_obj(*encrypt);\n\t\t\t\t\t*encrypt = pdf_keep_obj(obj);\n\t\t\t\t}\n\n\t\t\t\tobj = pdf_dict_gets(dict, \"ID\");\n\t\t\t\tif (obj)\n\t\t\t\t{\n\t\t\t\t\tpdf_drop_obj(*id);\n\t\t\t\t\t*id = pdf_keep_obj(obj);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tobj = pdf_dict_gets(dict, \"Length\");\n\t\tif (!pdf_is_indirect(obj) && pdf_is_int(obj))\n\t\t\tstm_len = pdf_to_int(obj);\n\n\t\tif (doc->file_reading_linearly && page)\n\t\t{\n\t\t\tobj = pdf_dict_gets(dict, \"Type\");\n\t\t\tif (!strcmp(pdf_to_name(obj), \"Page\"))\n\t\t\t{\n\t\t\t\tpdf_drop_obj(*page);\n\t\t\t\t*page = pdf_keep_obj(dict);\n\t\t\t}\n\t\t}\n\n\t\tpdf_drop_obj(dict);\n\t}\n\n\twhile ( tok != PDF_TOK_STREAM &&\n\t\ttok != PDF_TOK_ENDOBJ &&\n\t\ttok != PDF_TOK_ERROR &&\n\t\ttok != PDF_TOK_EOF &&\n\t\ttok != PDF_TOK_INT )\n\t{\n\t\t*tmpofs = fz_tell(file);\n\t\tif (*tmpofs < 0)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot tell in file\");\n\t\ttok = pdf_lex(file, buf);\n\t}\n\n\tif (tok == PDF_TOK_STREAM)\n\t{\n\t\tint c = fz_read_byte(file);\n\t\tif (c == '\\r') {\n\t\t\tc = fz_peek_byte(file);\n\t\t\tif (c == '\\n')\n\t\t\t\tfz_read_byte(file);\n\t\t}\n\n\t\t*stmofsp = fz_tell(file);\n\t\tif (*stmofsp < 0)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot seek in file\");\n\n\t\tif (stm_len > 0)\n\t\t{\n\t\t\tfz_seek(file, *stmofsp + stm_len, 0);\n\t\t\tfz_try(ctx)\n\t\t\t{\n\t\t\t\ttok = pdf_lex(file, buf);\n\t\t\t}\n\t\t\tfz_catch(ctx)\n\t\t\t{\n\t\t\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\t\t\tfz_warn(ctx, \"cannot find endstream token, falling back to scanning\");\n\t\t\t}\n\t\t\tif (tok == PDF_TOK_ENDSTREAM)\n\t\t\t\tgoto atobjend;\n\t\t\tfz_seek(file, *stmofsp, 0);\n\t\t}\n\n\t\t(void)fz_read(file, (unsigned char *) buf->scratch, 9);\n\n\t\twhile (memcmp(buf->scratch, \"endstream\", 9) != 0)\n\t\t{\n\t\t\t/* cf. bugs.ghostscript.com/show_bug.cgi?id=696129 */\n\t\t\tif (stm_len > 0 && memcmp(buf->scratch, \"endobj\", 6) == 0 && fz_tell(file) - *stmofsp - 9 >= stm_len)\n\t\t\t{\n\t\t\t\tfz_warn(ctx, \"found 'endobj' before 'endstream' after indicated stream /Length\");\n\t\t\t\tfz_seek(file, -9, SEEK_CUR);\n\t\t\t\tif (stmlenp)\n\t\t\t\t\t*stmlenp = fz_tell(file) - *stmofsp;\n\t\t\t\tgoto atobjend;\n\t\t\t}\n\t\t\tc = fz_read_byte(file);\n\t\t\tif (c == EOF)\n\t\t\t\tbreak;\n\t\t\tmemmove(&buf->scratch[0], &buf->scratch[1], 8);\n\t\t\tbuf->scratch[8] = c;\n\t\t}\n\n\t\tif (stmlenp)\n\t\t\t*stmlenp = fz_tell(file) - *stmofsp - 9;\n\natobjend:\n\t\t*tmpofs = fz_tell(file);\n\t\tif (*tmpofs < 0)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot tell in file\");\n\t\ttok = pdf_lex(file, buf);\n\t\tif (tok != PDF_TOK_ENDOBJ)\n\t\t\tfz_warn(ctx, \"object missing 'endobj' token\");\n\t\telse\n\t\t{\n\t\t\t/* Read another token as we always return the next one */\n\t\t\t*tmpofs = fz_tell(file);\n\t\t\tif (*tmpofs < 0)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot tell in file\");\n\t\t\ttok = pdf_lex(file, buf);\n\t\t}\n\t}\n\treturn tok;\n}\n\nstatic void\npdf_repair_obj_stm(pdf_document *doc, int num, int gen)\n{\n\tpdf_obj *obj;\n\tfz_stream *stm = NULL;\n\tpdf_token tok;\n\tint i, n, count;\n\tfz_context *ctx = doc->ctx;\n\tpdf_lexbuf buf;\n\n\tfz_var(stm);\n\n\tpdf_lexbuf_init(ctx, &buf, PDF_LEXBUF_SMALL);\n\n\tfz_try(ctx)\n\t{\n\t\tobj = pdf_load_object(doc, num, gen);\n\n\t\tcount = pdf_to_int(pdf_dict_gets(obj, \"N\"));\n\n\t\tpdf_drop_obj(obj);\n\n\t\tstm = pdf_open_stream(doc, num, gen);\n\n\t\tfor (i = 0; i < count; i++)\n\t\t{\n\t\t\tpdf_xref_entry *entry;\n\n\t\t\ttok = pdf_lex(stm, &buf);\n\t\t\tif (tok != PDF_TOK_INT)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"corrupt object stream (%d %d R)\", num, gen);\n\n\t\t\tn = buf.i;\n\t\t\tif (n < 0)\n\t\t\t{\n\t\t\t\tfz_warn(ctx, \"ignoring object with invalid object number (%d %d R)\", n, i);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse if (n >= pdf_xref_len(doc))\n\t\t\t{\n\t\t\t\tfz_warn(ctx, \"ignoring object with invalid object number (%d %d R)\", n, i);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tentry = pdf_get_populating_xref_entry(doc, n);\n\t\t\t/* cf. https://code.google.com/p/sumatrapdf/issues/detail?id=2767 */\n\t\t\tif (entry->type == 'n')\n\t\t\t{\n\t\t\t\tfz_warn(ctx, \"ignoring object redefinition within stream (%d %d R)\", n, i);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tentry->ofs = num;\n\t\t\tentry->gen = i;\n\t\t\tentry->stm_ofs = 0;\n\t\t\tpdf_drop_obj(entry->obj);\n\t\t\tentry->obj = NULL;\n\t\t\tentry->type = 'o';\n\n\t\t\ttok = pdf_lex(stm, &buf);\n\t\t\tif (tok != PDF_TOK_INT)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"corrupt object stream (%d %d R)\", num, gen);\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(stm);\n\t\tpdf_lexbuf_fin(&buf);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_message(ctx, \"cannot load object stream object (%d %d R)\", num, gen);\n\t}\n}\n\nvoid\npdf_repair_xref(pdf_document *doc)\n{\n\tpdf_obj *dict, *obj = NULL;\n\tpdf_obj *length;\n\n\tpdf_obj *encrypt = NULL;\n\tpdf_obj *id = NULL;\n\tpdf_obj *root = NULL;\n\tpdf_obj *info = NULL;\n\n\tstruct entry *list = NULL;\n\tint listlen;\n\tint listcap;\n\tint maxnum = 0;\n\n\tint num = 0;\n\tint gen = 0;\n\tint tmpofs, numofs = 0, genofs = 0;\n\tint stm_len, stm_ofs;\n\tpdf_token tok;\n\tint next;\n\tint i, n, c;\n\tfz_context *ctx = doc->ctx;\n\tpdf_lexbuf *buf = &doc->lexbuf.base;\n\n\tfz_var(encrypt);\n\tfz_var(id);\n\tfz_var(root);\n\tfz_var(info);\n\tfz_var(list);\n\tfz_var(obj);\n\n\tif (doc->repair_attempted)\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"Repair failed already - not trying again\");\n\tdoc->repair_attempted = 1;\n\n\tdoc->dirty = 1;\n\t/* Can't support incremental update after repair */\n\tdoc->freeze_updates = 1;\n\n\tfz_seek(doc->file, 0, 0);\n\n\tfz_try(ctx)\n\t{\n\t\tpdf_xref_entry *entry;\n\t\tlistlen = 0;\n\t\tlistcap = 1024;\n\t\tlist = fz_malloc_array(ctx, listcap, sizeof(struct entry));\n\n\t\t/* look for '%PDF' version marker within first kilobyte of file */\n\t\tn = fz_read(doc->file, (unsigned char *)buf->scratch, fz_mini(buf->size, 1024));\n\n\t\tfz_seek(doc->file, 0, 0);\n\t\tfor (i = 0; i < n - 4; i++)\n\t\t{\n\t\t\tif (memcmp(&buf->scratch[i], \"%PDF\", 4) == 0)\n\t\t\t{\n\t\t\t\tfz_seek(doc->file, i + 8, 0); /* skip \"%PDF-X.Y\" */\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* skip comment line after version marker since some generators\n\t\t * forget to terminate the comment with a newline */\n\t\tc = fz_read_byte(doc->file);\n\t\twhile (c >= 0 && (c == ' ' || c == '%'))\n\t\t\tc = fz_read_byte(doc->file);\n\t\tfz_unread_byte(doc->file);\n\n\t\twhile (1)\n\t\t{\n\t\t\ttmpofs = fz_tell(doc->file);\n\t\t\tif (tmpofs < 0)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot tell in file\");\n\n\t\t\tfz_try(ctx)\n\t\t\t{\n\t\t\t\ttok = pdf_lex_no_string(doc->file, buf);\n\t\t\t}\n\t\t\tfz_catch(ctx)\n\t\t\t{\n\t\t\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\t\t\tfz_warn(ctx, \"ignoring the rest of the file\");\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t/* If we have the next token already, then we'll jump\n\t\t\t * back here, rather than going through the top of\n\t\t\t * the loop. */\n\t\thave_next_token:\n\n\t\t\tif (tok == PDF_TOK_INT)\n\t\t\t{\n\t\t\t\tif (buf->i < 0)\n\t\t\t\t{\n\t\t\t\t\tnum = 0;\n\t\t\t\t\tgen = 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tnumofs = genofs;\n\t\t\t\tnum = gen;\n\t\t\t\tgenofs = tmpofs;\n\t\t\t\tgen = buf->i;\n\t\t\t}\n\n\t\t\telse if (tok == PDF_TOK_OBJ)\n\t\t\t{\n\t\t\t\tfz_try(ctx)\n\t\t\t\t{\n\t\t\t\t\tstm_len = 0;\n\t\t\t\t\tstm_ofs = 0;\n\t\t\t\t\ttok = pdf_repair_obj(doc, buf, &stm_ofs, &stm_len, &encrypt, &id, NULL, &tmpofs);\n\t\t\t\t}\n\t\t\t\tfz_catch(ctx)\n\t\t\t\t{\n\t\t\t\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\t\t\t\t/* If we haven't seen a root yet, there is nothing\n\t\t\t\t\t * we can do, but give up. Otherwise, we'll make\n\t\t\t\t\t * do. */\n\t\t\t\t\tif (!root)\n\t\t\t\t\t\tfz_rethrow(ctx);\n\t\t\t\t\tfz_warn(ctx, \"cannot parse object (%d %d R) - ignoring rest of file\", num, gen);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (num <= 0 || num > MAX_OBJECT_NUMBER)\n\t\t\t\t{\n\t\t\t\t\tfz_warn(ctx, \"ignoring object with invalid object number (%d %d R)\", num, gen);\n\t\t\t\t\tgoto have_next_token;\n\t\t\t\t}\n\n\t\t\t\tgen = fz_clampi(gen, 0, 65535);\n\n\t\t\t\tif (listlen + 1 == listcap)\n\t\t\t\t{\n\t\t\t\t\tlistcap = (listcap * 3) / 2;\n\t\t\t\t\tlist = fz_resize_array(ctx, list, listcap, sizeof(struct entry));\n\t\t\t\t}\n\n\t\t\t\tlist[listlen].num = num;\n\t\t\t\tlist[listlen].gen = gen;\n\t\t\t\tlist[listlen].ofs = numofs;\n\t\t\t\tlist[listlen].stm_ofs = stm_ofs;\n\t\t\t\tlist[listlen].stm_len = stm_len;\n\t\t\t\tlistlen ++;\n\n\t\t\t\tif (num > maxnum)\n\t\t\t\t\tmaxnum = num;\n\n\t\t\t\tgoto have_next_token;\n\t\t\t}\n\n\t\t\t/* If we find a dictionary it is probably the trailer,\n\t\t\t * but could be a stream (or bogus) dictionary caused\n\t\t\t * by a corrupt file. */\n\t\t\telse if (tok == PDF_TOK_OPEN_DICT)\n\t\t\t{\n\t\t\t\tfz_try(ctx)\n\t\t\t\t{\n\t\t\t\t\tdict = pdf_parse_dict(doc, doc->file, buf);\n\t\t\t\t}\n\t\t\t\tfz_catch(ctx)\n\t\t\t\t{\n\t\t\t\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\t\t\t\t/* If this was the real trailer dict\n\t\t\t\t\t * it was broken, in which case we are\n\t\t\t\t\t * in trouble. Keep going though in\n\t\t\t\t\t * case this was just a bogus dict. */\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tobj = pdf_dict_gets(dict, \"Encrypt\");\n\t\t\t\tif (obj)\n\t\t\t\t{\n\t\t\t\t\tpdf_drop_obj(encrypt);\n\t\t\t\t\tencrypt = pdf_keep_obj(obj);\n\t\t\t\t}\n\n\t\t\t\tobj = pdf_dict_gets(dict, \"ID\");\n\t\t\t\tif (obj && (!id || !encrypt || pdf_dict_gets(dict, \"Encrypt\")))\n\t\t\t\t{\n\t\t\t\t\tpdf_drop_obj(id);\n\t\t\t\t\tid = pdf_keep_obj(obj);\n\t\t\t\t}\n\n\t\t\t\tobj = pdf_dict_gets(dict, \"Root\");\n\t\t\t\tif (obj)\n\t\t\t\t{\n\t\t\t\t\tpdf_drop_obj(root);\n\t\t\t\t\troot = pdf_keep_obj(obj);\n\t\t\t\t}\n\n\t\t\t\tobj = pdf_dict_gets(dict, \"Info\");\n\t\t\t\tif (obj)\n\t\t\t\t{\n\t\t\t\t\tpdf_drop_obj(info);\n\t\t\t\t\tinfo = pdf_keep_obj(obj);\n\t\t\t\t}\n\n\t\t\t\tpdf_drop_obj(dict);\n\t\t\t\tobj = NULL;\n\t\t\t}\n\n\t\t\telse if (tok == PDF_TOK_EOF)\n\t\t\t\tbreak;\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (tok == PDF_TOK_ERROR)\n\t\t\t\t\tfz_read_byte(doc->file);\n\t\t\t\tnum = 0;\n\t\t\t\tgen = 0;\n\t\t\t}\n\n\t\t}\n\n\t\t/* make xref reasonable */\n\n\t\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=1841 */\n\t\t{\n\t\t\tint *bitfield = fz_calloc(ctx, maxnum / 32 + 1, sizeof(int));\n\t\t\tfor (i = listlen - 1; i >= 0; i--)\n\t\t\t{\n\t\t\t\tif (!(bitfield[list[i].num / 32] & (1 << (list[i].num % 32))))\n\t\t\t\t\tbitfield[list[i].num / 32] |= (1 << (list[i].num % 32));\n\t\t\t\telse\n\t\t\t\t\tlist[i].num = -1;\n\t\t\t}\n\t\t\tfz_free(ctx, bitfield);\n\t\t}\n\n\t\t/*\n\t\t\tDummy access to entry to assure sufficient space in the xref table\n\t\t\tand avoid repeated reallocs in the loop\n\t\t*/\n\t\t/* Ensure that the first xref table is a 'solid' one from\n\t\t * 0 to maxnum. */\n\t\tpdf_ensure_solid_xref(doc, maxnum);\n\n\t\tfor (i = 0; i < listlen; i++)\n\t\t{\n\t\t\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=1841 */\n\t\t\tif (list[i].num == -1)\n\t\t\t\tcontinue;\n\n\t\t\tentry = pdf_get_populating_xref_entry(doc, list[i].num);\n\t\t\tentry->type = 'n';\n\t\t\tentry->ofs = list[i].ofs;\n\t\t\tentry->gen = list[i].gen;\n\n\t\t\tentry->stm_ofs = list[i].stm_ofs;\n\n\t\t\t/* correct stream length for unencrypted documents */\n\t\t\tif (!encrypt && list[i].stm_len >= 0)\n\t\t\t{\n\t\t\t\tdict = pdf_load_object(doc, list[i].num, list[i].gen);\n\n\t\t\t\tlength = pdf_new_int(doc, list[i].stm_len);\n\t\t\t\tpdf_dict_puts(dict, \"Length\", length);\n\t\t\t\tpdf_drop_obj(length);\n\n\t\t\t\tpdf_drop_obj(dict);\n\t\t\t}\n\t\t}\n\n\t\tentry = pdf_get_populating_xref_entry(doc, 0);\n\t\tentry->type = 'f';\n\t\tentry->ofs = 0;\n\t\tentry->gen = 65535;\n\t\tentry->stm_ofs = 0;\n\n\t\tnext = 0;\n\t\tfor (i = pdf_xref_len(doc) - 1; i >= 0; i--)\n\t\t{\n\t\t\tentry = pdf_get_populating_xref_entry(doc, i);\n\t\t\tif (entry->type == 'f')\n\t\t\t{\n\t\t\t\tentry->ofs = next;\n\t\t\t\tif (entry->gen < 65535)\n\t\t\t\t\tentry->gen ++;\n\t\t\t\tnext = i;\n\t\t\t}\n\t\t}\n\n\t\t/* create a repaired trailer, Root will be added later */\n\n\t\tobj = pdf_new_dict(doc, 5);\n\t\t/* During repair there is only a single xref section */\n\t\tpdf_set_populating_xref_trailer(doc, obj);\n\t\tpdf_drop_obj(obj);\n\t\tobj = NULL;\n\n\t\tobj = pdf_new_int(doc, maxnum + 1);\n\t\tpdf_dict_puts(pdf_trailer(doc), \"Size\", obj);\n\t\tpdf_drop_obj(obj);\n\t\tobj = NULL;\n\n\t\tif (root)\n\t\t{\n\t\t\tpdf_dict_puts(pdf_trailer(doc), \"Root\", root);\n\t\t\tpdf_drop_obj(root);\n\t\t\troot = NULL;\n\t\t}\n\t\tif (info)\n\t\t{\n\t\t\tpdf_dict_puts(pdf_trailer(doc), \"Info\", info);\n\t\t\tpdf_drop_obj(info);\n\t\t\tinfo = NULL;\n\t\t}\n\n\t\tif (encrypt)\n\t\t{\n\t\t\tif (pdf_is_indirect(encrypt))\n\t\t\t{\n\t\t\t\t/* create new reference with non-NULL xref pointer */\n\t\t\t\tobj = pdf_new_indirect(doc, pdf_to_num(encrypt), pdf_to_gen(encrypt));\n\t\t\t\tpdf_drop_obj(encrypt);\n\t\t\t\tencrypt = obj;\n\t\t\t\tobj = NULL;\n\t\t\t}\n\t\t\tpdf_dict_puts(pdf_trailer(doc), \"Encrypt\", encrypt);\n\t\t\tpdf_drop_obj(encrypt);\n\t\t\tencrypt = NULL;\n\t\t}\n\n\t\tif (id)\n\t\t{\n\t\t\tif (pdf_is_indirect(id))\n\t\t\t{\n\t\t\t\t/* create new reference with non-NULL xref pointer */\n\t\t\t\tobj = pdf_new_indirect(doc, pdf_to_num(id), pdf_to_gen(id));\n\t\t\t\tpdf_drop_obj(id);\n\t\t\t\tid = obj;\n\t\t\t\tobj = NULL;\n\t\t\t}\n\t\t\tpdf_dict_puts(pdf_trailer(doc), \"ID\", id);\n\t\t\tpdf_drop_obj(id);\n\t\t\tid = NULL;\n\t\t}\n\n\t\tfz_free(ctx, list);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_obj(encrypt);\n\t\tpdf_drop_obj(id);\n\t\tpdf_drop_obj(root);\n\t\tpdf_drop_obj(obj);\n\t\tpdf_drop_obj(info);\n\t\tfz_free(ctx, list);\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nvoid\npdf_repair_obj_stms(pdf_document *doc)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *dict;\n\tint i;\n\tint xref_len = pdf_xref_len(doc);\n\n\tfor (i = 0; i < xref_len; i++)\n\t{\n\t\tpdf_xref_entry *entry = pdf_get_populating_xref_entry(doc, i);\n\n\t\tif (entry->stm_ofs)\n\t\t{\n\t\t\tdict = pdf_load_object(doc, i, 0);\n\t\t\tfz_try(ctx)\n\t\t\t{\n\t\t\t\tif (!strcmp(pdf_to_name(pdf_dict_gets(dict, \"Type\")), \"ObjStm\"))\n\t\t\t\t\tpdf_repair_obj_stm(doc, i, 0);\n\t\t\t}\n\t\t\tfz_catch(ctx)\n\t\t\t{\n\t\t\t\tfz_warn(ctx, \"ignoring broken object stream (%d 0 R)\", i);\n\t\t\t}\n\t\t\tpdf_drop_obj(dict);\n\t\t}\n\t}\n\n\t/* Ensure that streamed objects reside inside a known non-streamed object */\n\tfor (i = 0; i < xref_len; i++)\n\t{\n\t\tpdf_xref_entry *entry = pdf_get_populating_xref_entry(doc, i);\n\n\t\tif (entry->type == 'o' && pdf_get_populating_xref_entry(doc, entry->ofs)->type != 'n')\n\t\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"invalid reference to non-object-stream: %d (%d 0 R)\", entry->ofs, i);\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-run.c",
    "content": "#include \"pdf-interpret-imp.h\"\n\nstatic void\npdf_run_annot_with_usage(pdf_document *doc, pdf_page *page, pdf_annot *annot, fz_device *dev, const fz_matrix *ctm, char *event, fz_cookie *cookie)\n{\n\tfz_matrix local_ctm;\n\tpdf_process process;\n\n\tfz_concat(&local_ctm, &page->ctm, ctm);\n\n\tpdf_process_run(&process, dev, &local_ctm, event, NULL, 0);\n\n\tpdf_process_annot(doc, page, annot, &process, cookie);\n}\n\nstatic void pdf_run_page_contents_with_usage(pdf_document *doc, pdf_page *page, fz_device *dev, const fz_matrix *ctm, char *event, fz_cookie *cookie)\n{\n\tfz_matrix local_ctm;\n\tpdf_process process;\n\n\tfz_concat(&local_ctm, &page->ctm, ctm);\n\n\tif (page->transparency)\n\t{\n\t\tfz_rect mediabox = page->mediabox;\n\t\tfz_begin_group(dev, fz_transform_rect(&mediabox, &local_ctm), 1, 0, 0, 1);\n\t}\n\n\tpdf_process_run(&process, dev, &local_ctm, event, NULL, 0);\n\n\tpdf_process_stream_object(doc, page->contents, &process, page->resources, cookie);\n\n\tif (page->transparency)\n\t\tfz_end_group(dev);\n}\n\nvoid pdf_run_page_contents(pdf_document *doc, pdf_page *page, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie)\n{\n\tfz_context *ctx = doc->ctx;\n\tint nocache = !!(dev->hints & FZ_NO_CACHE);\n\n\tif (nocache)\n\t\tpdf_mark_xref(doc);\n\tfz_try(ctx)\n\t{\n\t\tpdf_run_page_contents_with_usage(doc, page, dev, ctm, \"View\", cookie);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tif (nocache)\n\t\t\tpdf_clear_xref_to_mark(doc);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\tif (page->incomplete & PDF_PAGE_INCOMPLETE_CONTENTS)\n\t\tfz_throw(doc->ctx, FZ_ERROR_TRYLATER, \"incomplete rendering\");\n}\n\n\nvoid pdf_run_annot(pdf_document *doc, pdf_page *page, pdf_annot *annot, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie)\n{\n\tfz_context *ctx = doc->ctx;\n\tint nocache = !!(dev->hints & FZ_NO_CACHE);\n\n\tif (nocache)\n\t\tpdf_mark_xref(doc);\n\tfz_try(ctx)\n\t{\n\t\tpdf_run_annot_with_usage(doc, page, annot, dev, ctm, \"View\", cookie);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tif (nocache)\n\t\t\tpdf_clear_xref_to_mark(doc);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\tif (page->incomplete & PDF_PAGE_INCOMPLETE_ANNOTS)\n\t\tfz_throw(doc->ctx, FZ_ERROR_TRYLATER, \"incomplete rendering\");\n}\n\nstatic void pdf_run_page_annots_with_usage(pdf_document *doc, pdf_page *page, fz_device *dev, const fz_matrix *ctm, char *event, fz_cookie *cookie)\n{\n\tpdf_annot *annot;\n\n\tif (cookie && cookie->progress_max != -1)\n\t{\n\t\tint count = 1;\n\t\tfor (annot = page->annots; annot; annot = annot->next)\n\t\t\tcount++;\n\t\tcookie->progress_max += count;\n\t}\n\n\tfor (annot = page->annots; annot; annot = annot->next)\n\t{\n\t\t/* Check the cookie for aborting */\n\t\tif (cookie)\n\t\t{\n\t\t\tif (cookie->abort)\n\t\t\t\tbreak;\n\t\t\tcookie->progress++;\n\t\t}\n\n\t\tpdf_run_annot_with_usage(doc, page, annot, dev, ctm, event, cookie);\n\t}\n}\n\nvoid\npdf_run_page_with_usage(pdf_document *doc, pdf_page *page, fz_device *dev, const fz_matrix *ctm, char *event, fz_cookie *cookie)\n{\n\tfz_context *ctx = doc->ctx;\n\tint nocache = !!(dev->hints & FZ_NO_CACHE);\n\n\tif (nocache)\n\t\tpdf_mark_xref(doc);\n\tfz_try(ctx)\n\t{\n\t\tpdf_run_page_contents_with_usage(doc, page, dev, ctm, event, cookie);\n\t\tpdf_run_page_annots_with_usage(doc, page, dev, ctm, event, cookie);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tif (nocache)\n\t\t\tpdf_clear_xref_to_mark(doc);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\tif (page->incomplete)\n\t\tfz_throw(doc->ctx, FZ_ERROR_TRYLATER, \"incomplete rendering\");\n}\n\nvoid\npdf_run_page(pdf_document *doc, pdf_page *page, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie)\n{\n\tpdf_run_page_with_usage(doc, page, dev, ctm, \"View\", cookie);\n}\n\nvoid\npdf_run_glyph(pdf_document *doc, pdf_obj *resources, fz_buffer *contents, fz_device *dev, const fz_matrix *ctm, void *gstate, int nested_depth)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_process process;\n\n\tif (nested_depth > 10)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Too many nestings of Type3 glyphs\");\n\n\tpdf_process_run(&process, dev, ctm, \"View\", gstate, nested_depth+1);\n\n\tpdf_process_glyph(doc, resources, contents, &process);\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-shade.c",
    "content": "#include \"mupdf/pdf.h\"\n\n/* FIXME: Remove this somehow */\n#define FUNSEGS 32 /* size of sampled mesh for function-based shadings */\n\n/* Sample various functions into lookup tables */\n\nstatic void\npdf_sample_composite_shade_function(fz_context *ctx, fz_shade *shade, fz_function *func, float t0, float t1)\n{\n\tint i;\n\tfloat t;\n\n\tfor (i = 0; i < 256; i++)\n\t{\n\t\tt = t0 + (i / 255.0f) * (t1 - t0);\n\t\tfz_eval_function(ctx, func, &t, 1, shade->function[i], shade->colorspace->n);\n\t\tshade->function[i][shade->colorspace->n] = 1;\n\t}\n}\n\nstatic void\npdf_sample_component_shade_function(fz_context *ctx, fz_shade *shade, int funcs, fz_function **func, float t0, float t1)\n{\n\tint i, k;\n\tfloat t;\n\n\tfor (i = 0; i < 256; i++)\n\t{\n\t\tt = t0 + (i / 255.0f) * (t1 - t0);\n\t\tfor (k = 0; k < funcs; k++)\n\t\t\tfz_eval_function(ctx, func[k], &t, 1, &shade->function[i][k], 1);\n\t\tshade->function[i][k] = 1;\n\t}\n}\n\nstatic void\npdf_sample_shade_function(fz_context *ctx, fz_shade *shade, int funcs, fz_function **func, float t0, float t1)\n{\n\tshade->use_function = 1;\n\tif (funcs == 1)\n\t\tpdf_sample_composite_shade_function(ctx, shade, func[0], t0, t1);\n\telse\n\t\tpdf_sample_component_shade_function(ctx, shade, funcs, func, t0, t1);\n}\n\n/* Type 1-3 -- Function-based, linear and radial shadings */\n\nstatic void\npdf_load_function_based_shading(fz_shade *shade, pdf_document *doc, pdf_obj *dict, fz_function *func)\n{\n\tpdf_obj *obj;\n\tfloat x0, y0, x1, y1;\n\tfloat fv[2];\n\tfz_matrix matrix;\n\tint xx, yy;\n\tfz_context *ctx = doc->ctx;\n\tfloat *p;\n\n\tx0 = y0 = 0;\n\tx1 = y1 = 1;\n\tobj = pdf_dict_gets(dict, \"Domain\");\n\tif (obj)\n\t{\n\t\tx0 = pdf_to_real(pdf_array_get(obj, 0));\n\t\tx1 = pdf_to_real(pdf_array_get(obj, 1));\n\t\ty0 = pdf_to_real(pdf_array_get(obj, 2));\n\t\ty1 = pdf_to_real(pdf_array_get(obj, 3));\n\t}\n\n\tobj = pdf_dict_gets(dict, \"Matrix\");\n\tif (obj)\n\t\tpdf_to_matrix(ctx, obj, &matrix);\n\telse\n\t\tmatrix = fz_identity;\n\tshade->u.f.matrix = matrix;\n\tshade->u.f.xdivs = FUNSEGS;\n\tshade->u.f.ydivs = FUNSEGS;\n\tshade->u.f.fn_vals = fz_malloc(ctx, (FUNSEGS+1)*(FUNSEGS+1)*shade->colorspace->n*sizeof(float));\n\tshade->u.f.domain[0][0] = x0;\n\tshade->u.f.domain[0][1] = y0;\n\tshade->u.f.domain[1][0] = x1;\n\tshade->u.f.domain[1][1] = y1;\n\n\tp = shade->u.f.fn_vals;\n\tfor (yy = 0; yy <= FUNSEGS; yy++)\n\t{\n\t\tfv[1] = y0 + (y1 - y0) * yy / FUNSEGS;\n\n\t\tfor (xx = 0; xx <= FUNSEGS; xx++)\n\t\t{\n\t\t\tfv[0] = x0 + (x1 - x0) * xx / FUNSEGS;\n\n\t\t\tfz_eval_function(ctx, func, fv, 2, p, shade->colorspace->n);\n\t\t\tp += shade->colorspace->n;\n\t\t}\n\t}\n}\n\nstatic void\npdf_load_linear_shading(fz_shade *shade, pdf_document *doc, pdf_obj *dict, int funcs, fz_function **func)\n{\n\tpdf_obj *obj;\n\tfloat d0, d1;\n\tint e0, e1;\n\tfz_context *ctx = doc->ctx;\n\n\tobj = pdf_dict_gets(dict, \"Coords\");\n\tshade->u.l_or_r.coords[0][0] = pdf_to_real(pdf_array_get(obj, 0));\n\tshade->u.l_or_r.coords[0][1] = pdf_to_real(pdf_array_get(obj, 1));\n\tshade->u.l_or_r.coords[1][0] = pdf_to_real(pdf_array_get(obj, 2));\n\tshade->u.l_or_r.coords[1][1] = pdf_to_real(pdf_array_get(obj, 3));\n\n\td0 = 0;\n\td1 = 1;\n\tobj = pdf_dict_gets(dict, \"Domain\");\n\tif (obj)\n\t{\n\t\td0 = pdf_to_real(pdf_array_get(obj, 0));\n\t\td1 = pdf_to_real(pdf_array_get(obj, 1));\n\t}\n\n\te0 = e1 = 0;\n\tobj = pdf_dict_gets(dict, \"Extend\");\n\tif (obj)\n\t{\n\t\te0 = pdf_to_bool(pdf_array_get(obj, 0));\n\t\te1 = pdf_to_bool(pdf_array_get(obj, 1));\n\t}\n\n\tpdf_sample_shade_function(ctx, shade, funcs, func, d0, d1);\n\n\tshade->u.l_or_r.extend[0] = e0;\n\tshade->u.l_or_r.extend[1] = e1;\n}\n\nstatic void\npdf_load_radial_shading(fz_shade *shade, pdf_document *doc, pdf_obj *dict, int funcs, fz_function **func)\n{\n\tpdf_obj *obj;\n\tfloat d0, d1;\n\tint e0, e1;\n\tfz_context *ctx = doc->ctx;\n\n\tobj = pdf_dict_gets(dict, \"Coords\");\n\tshade->u.l_or_r.coords[0][0] = pdf_to_real(pdf_array_get(obj, 0));\n\tshade->u.l_or_r.coords[0][1] = pdf_to_real(pdf_array_get(obj, 1));\n\tshade->u.l_or_r.coords[0][2] = pdf_to_real(pdf_array_get(obj, 2));\n\tshade->u.l_or_r.coords[1][0] = pdf_to_real(pdf_array_get(obj, 3));\n\tshade->u.l_or_r.coords[1][1] = pdf_to_real(pdf_array_get(obj, 4));\n\tshade->u.l_or_r.coords[1][2] = pdf_to_real(pdf_array_get(obj, 5));\n\n\td0 = 0;\n\td1 = 1;\n\tobj = pdf_dict_gets(dict, \"Domain\");\n\tif (obj)\n\t{\n\t\td0 = pdf_to_real(pdf_array_get(obj, 0));\n\t\td1 = pdf_to_real(pdf_array_get(obj, 1));\n\t}\n\n\te0 = e1 = 0;\n\tobj = pdf_dict_gets(dict, \"Extend\");\n\tif (obj)\n\t{\n\t\te0 = pdf_to_bool(pdf_array_get(obj, 0));\n\t\te1 = pdf_to_bool(pdf_array_get(obj, 1));\n\t}\n\n\tpdf_sample_shade_function(ctx, shade, funcs, func, d0, d1);\n\n\tshade->u.l_or_r.extend[0] = e0;\n\tshade->u.l_or_r.extend[1] = e1;\n}\n\n/* Type 4-7 -- Triangle and patch mesh shadings */\n\nstruct mesh_params\n{\n\tint vprow;\n\tint bpflag;\n\tint bpcoord;\n\tint bpcomp;\n\tfloat x0, x1;\n\tfloat y0, y1;\n\tfloat c0[FZ_MAX_COLORS];\n\tfloat c1[FZ_MAX_COLORS];\n};\n\nstatic void\npdf_load_mesh_params(fz_shade *shade, pdf_document *doc, pdf_obj *dict)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *obj;\n\tint i, n;\n\n\tshade->u.m.x0 = shade->u.m.y0 = 0;\n\tshade->u.m.x1 = shade->u.m.y1 = 1;\n\tfor (i = 0; i < FZ_MAX_COLORS; i++)\n\t{\n\t\tshade->u.m.c0[i] = 0;\n\t\tshade->u.m.c1[i] = 1;\n\t}\n\n\tshade->u.m.vprow = pdf_to_int(pdf_dict_gets(dict, \"VerticesPerRow\"));\n\tshade->u.m.bpflag = pdf_to_int(pdf_dict_gets(dict, \"BitsPerFlag\"));\n\tshade->u.m.bpcoord = pdf_to_int(pdf_dict_gets(dict, \"BitsPerCoordinate\"));\n\tshade->u.m.bpcomp = pdf_to_int(pdf_dict_gets(dict, \"BitsPerComponent\"));\n\n\tobj = pdf_dict_gets(dict, \"Decode\");\n\tif (pdf_array_len(obj) >= 6)\n\t{\n\t\tn = (pdf_array_len(obj) - 4) / 2;\n\t\tshade->u.m.x0 = pdf_to_real(pdf_array_get(obj, 0));\n\t\tshade->u.m.x1 = pdf_to_real(pdf_array_get(obj, 1));\n\t\tshade->u.m.y0 = pdf_to_real(pdf_array_get(obj, 2));\n\t\tshade->u.m.y1 = pdf_to_real(pdf_array_get(obj, 3));\n\t\tfor (i = 0; i < n; i++)\n\t\t{\n\t\t\tshade->u.m.c0[i] = pdf_to_real(pdf_array_get(obj, 4 + i * 2));\n\t\t\tshade->u.m.c1[i] = pdf_to_real(pdf_array_get(obj, 5 + i * 2));\n\t\t}\n\t}\n\n\tif (shade->u.m.vprow < 2 && shade->type == 5)\n\t{\n\t\tfz_warn(ctx, \"Too few vertices per row (%d)\", shade->u.m.vprow);\n\t\tshade->u.m.vprow = 2;\n\t}\n\n\tif (shade->u.m.bpflag != 2 && shade->u.m.bpflag != 4 && shade->u.m.bpflag != 8 &&\n\t\tshade->type != 5)\n\t{\n\t\tfz_warn(ctx, \"Invalid number of bits per flag (%d)\", shade->u.m.bpflag);\n\t\tshade->u.m.bpflag = 8;\n\t}\n\n\tif (shade->u.m.bpcoord != 1 && shade->u.m.bpcoord != 2 && shade->u.m.bpcoord != 4 &&\n\t\tshade->u.m.bpcoord != 8 && shade->u.m.bpcoord != 12 && shade->u.m.bpcoord != 16 &&\n\t\tshade->u.m.bpcoord != 24 && shade->u.m.bpcoord != 32)\n\t{\n\t\tfz_warn(ctx, \"Invalid number of bits per coordinate (%d)\", shade->u.m.bpcoord);\n\t\tshade->u.m.bpcoord = 8;\n\t}\n\n\tif (shade->u.m.bpcomp != 1 && shade->u.m.bpcomp != 2 && shade->u.m.bpcomp != 4 &&\n\t\tshade->u.m.bpcomp != 8 && shade->u.m.bpcomp != 12 && shade->u.m.bpcomp != 16)\n\t{\n\t\tfz_warn(ctx, \"Invalid number of bits per component (%d)\", shade->u.m.bpcomp);\n\t\tshade->u.m.bpcomp = 8;\n\t}\n}\n\nstatic void\npdf_load_type4_shade(fz_shade *shade, pdf_document *doc, pdf_obj *dict,\n\tint funcs, fz_function **func)\n{\n\tfz_context *ctx = doc->ctx;\n\n\tpdf_load_mesh_params(shade, doc, dict);\n\n\tif (funcs > 0)\n\t\tpdf_sample_shade_function(ctx, shade, funcs, func, shade->u.m.c0[0], shade->u.m.c1[0]);\n\n\tshade->buffer = pdf_load_compressed_stream(doc, pdf_to_num(dict), pdf_to_gen(dict));\n}\n\nstatic void\npdf_load_type5_shade(fz_shade *shade, pdf_document *doc, pdf_obj *dict,\n\tint funcs, fz_function **func)\n{\n\tfz_context *ctx = doc->ctx;\n\n\tpdf_load_mesh_params(shade, doc, dict);\n\n\tif (funcs > 0)\n\t\tpdf_sample_shade_function(ctx, shade, funcs, func, shade->u.m.c0[0], shade->u.m.c1[0]);\n\n\tshade->buffer = pdf_load_compressed_stream(doc, pdf_to_num(dict), pdf_to_gen(dict));\n}\n\n/* Type 6 & 7 -- Patch mesh shadings */\n\nstatic void\npdf_load_type6_shade(fz_shade *shade, pdf_document *doc, pdf_obj *dict,\n\tint funcs, fz_function **func)\n{\n\tfz_context *ctx = doc->ctx;\n\n\tpdf_load_mesh_params(shade, doc, dict);\n\n\tif (funcs > 0)\n\t\tpdf_sample_shade_function(ctx, shade, funcs, func, shade->u.m.c0[0], shade->u.m.c1[0]);\n\n\tshade->buffer = pdf_load_compressed_stream(doc, pdf_to_num(dict), pdf_to_gen(dict));\n}\n\nstatic void\npdf_load_type7_shade(fz_shade *shade, pdf_document *doc, pdf_obj *dict,\n\tint funcs, fz_function **func)\n{\n\tfz_context *ctx = doc->ctx;\n\n\tpdf_load_mesh_params(shade, doc, dict);\n\n\tif (funcs > 0)\n\t\tpdf_sample_shade_function(ctx, shade, funcs, func, shade->u.m.c0[0], shade->u.m.c1[0]);\n\n\tshade->buffer = pdf_load_compressed_stream(doc, pdf_to_num(dict), pdf_to_gen(dict));\n}\n\n/* Load all of the shading dictionary parameters, then switch on the shading type. */\n\nstatic fz_shade *\npdf_load_shading_dict(pdf_document *doc, pdf_obj *dict, const fz_matrix *transform)\n{\n\tfz_shade *shade = NULL;\n\tfz_function *func[FZ_MAX_COLORS] = { NULL };\n\tpdf_obj *obj;\n\tint funcs = 0;\n\tint type = 0;\n\tint i, in, out;\n\tfz_context *ctx = doc->ctx;\n\n\tfz_var(shade);\n\tfz_var(func);\n\tfz_var(funcs);\n\tfz_var(type);\n\n\tfz_try(ctx)\n\t{\n\t\tshade = fz_malloc_struct(ctx, fz_shade);\n\t\tFZ_INIT_STORABLE(shade, 1, fz_free_shade_imp);\n\t\tshade->type = FZ_MESH_TYPE4;\n\t\tshade->use_background = 0;\n\t\tshade->use_function = 0;\n\t\tshade->matrix = *transform;\n\t\tshade->bbox = fz_infinite_rect;\n\n\t\tshade->colorspace = NULL;\n\n\t\tfuncs = 0;\n\n\t\tobj = pdf_dict_gets(dict, \"ShadingType\");\n\t\ttype = pdf_to_int(obj);\n\n\t\tobj = pdf_dict_gets(dict, \"ColorSpace\");\n\t\tif (!obj)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"shading colorspace is missing\");\n\t\tshade->colorspace = pdf_load_colorspace(doc, obj);\n\n\t\tobj = pdf_dict_gets(dict, \"Background\");\n\t\tif (obj)\n\t\t{\n\t\t\tshade->use_background = 1;\n\t\t\tfor (i = 0; i < shade->colorspace->n; i++)\n\t\t\t\tshade->background[i] = pdf_to_real(pdf_array_get(obj, i));\n\t\t}\n\n\t\tobj = pdf_dict_gets(dict, \"BBox\");\n\t\tif (pdf_is_array(obj))\n\t\t\tpdf_to_rect(ctx, obj, &shade->bbox);\n\n\t\tobj = pdf_dict_gets(dict, \"Function\");\n\t\tif (pdf_is_dict(obj))\n\t\t{\n\t\t\tfuncs = 1;\n\n\t\t\tif (type == 1)\n\t\t\t\tin = 2;\n\t\t\telse\n\t\t\t\tin = 1;\n\t\t\tout = shade->colorspace->n;\n\n\t\t\tfunc[0] = pdf_load_function(doc, obj, in, out);\n\t\t\tif (!func[0])\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot load shading function (%d %d R)\", pdf_to_num(obj), pdf_to_gen(obj));\n\t\t}\n\t\telse if (pdf_is_array(obj))\n\t\t{\n\t\t\tfuncs = pdf_array_len(obj);\n\t\t\tif (funcs != 1 && funcs != shade->colorspace->n)\n\t\t\t{\n\t\t\t\tfuncs = 0;\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"incorrect number of shading functions\");\n\t\t\t}\n\t\t\tif (funcs > FZ_MAX_COLORS)\n\t\t\t{\n\t\t\t\tfuncs = 0;\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"too many shading functions\");\n\t\t\t}\n\n\t\t\tif (type == 1)\n\t\t\t\tin = 2;\n\t\t\telse\n\t\t\t\tin = 1;\n\t\t\tout = 1;\n\n\t\t\tfor (i = 0; i < funcs; i++)\n\t\t\t{\n\t\t\t\tfunc[i] = pdf_load_function(doc, pdf_array_get(obj, i), in, out);\n\t\t\t\tif (!func[i])\n\t\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot load shading function (%d %d R)\", pdf_to_num(obj), pdf_to_gen(obj));\n\t\t\t}\n\t\t}\n\t\telse if (type < 4)\n\t\t{\n\t\t\t/* Functions are compulsory for types 1,2,3 */\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot load shading function (%d %d R)\", pdf_to_num(obj), pdf_to_gen(obj));\n\t\t}\n\n\t\tshade->type = type;\n\t\tswitch (type)\n\t\t{\n\t\tcase 1: pdf_load_function_based_shading(shade, doc, dict, func[0]); break;\n\t\tcase 2: pdf_load_linear_shading(shade, doc, dict, funcs, func); break;\n\t\tcase 3: pdf_load_radial_shading(shade, doc, dict, funcs, func); break;\n\t\tcase 4: pdf_load_type4_shade(shade, doc, dict, funcs, func); break;\n\t\tcase 5: pdf_load_type5_shade(shade, doc, dict, funcs, func); break;\n\t\tcase 6: pdf_load_type6_shade(shade, doc, dict, funcs, func); break;\n\t\tcase 7: pdf_load_type7_shade(shade, doc, dict, funcs, func); break;\n\t\tdefault:\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"unknown shading type: %d\", type);\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfor (i = 0; i < funcs; i++)\n\t\t\tif (func[i])\n\t\t\t\tfz_drop_function(ctx, func[i]);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_drop_shade(ctx, shade);\n\n\t\tfz_rethrow_message(ctx, \"cannot load shading type %d (%d %d R)\", type, pdf_to_num(dict), pdf_to_gen(dict));\n\t}\n\treturn shade;\n}\n\nstatic unsigned int\nfz_shade_size(fz_shade *s)\n{\n\tif (s == NULL)\n\t\treturn 0;\n\tif (s->type == FZ_FUNCTION_BASED)\n\t\treturn sizeof(*s) + sizeof(float) * s->u.f.xdivs * s->u.f.ydivs * s->colorspace->n;\n\treturn sizeof(*s) + fz_compressed_buffer_size(s->buffer);\n}\n\nfz_shade *\npdf_load_shading(pdf_document *doc, pdf_obj *dict)\n{\n\tfz_matrix mat;\n\tpdf_obj *obj;\n\tfz_context *ctx = doc->ctx;\n\tfz_shade *shade;\n\n\tif ((shade = pdf_find_item(ctx, fz_free_shade_imp, dict)) != NULL)\n\t{\n\t\treturn shade;\n\t}\n\n\t/* Type 2 pattern dictionary */\n\tif (pdf_dict_gets(dict, \"PatternType\"))\n\t{\n\t\tobj = pdf_dict_gets(dict, \"Matrix\");\n\t\tif (obj)\n\t\t\tpdf_to_matrix(ctx, obj, &mat);\n\t\telse\n\t\t\tmat = fz_identity;\n\n\t\tobj = pdf_dict_gets(dict, \"ExtGState\");\n\t\tif (obj)\n\t\t{\n\t\t\tif (pdf_dict_gets(obj, \"CA\") || pdf_dict_gets(obj, \"ca\"))\n\t\t\t{\n\t\t\t\tfz_warn(ctx, \"shading with alpha not supported\");\n\t\t\t}\n\t\t}\n\n\t\tobj = pdf_dict_gets(dict, \"Shading\");\n\t\tif (!obj)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"syntaxerror: missing shading dictionary\");\n\n\t\tshade = pdf_load_shading_dict(doc, obj, &mat);\n\t}\n\n\t/* Naked shading dictionary */\n\telse\n\t{\n\t\tshade = pdf_load_shading_dict(doc, dict, &fz_identity);\n\t}\n\n\tpdf_store_item(ctx, dict, shade, fz_shade_size(shade));\n\n\treturn shade;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-store.c",
    "content": "#include \"mupdf/pdf.h\"\n\nstatic int\npdf_make_hash_key(fz_store_hash *hash, void *key_)\n{\n\tpdf_obj *key = (pdf_obj *)key_;\n\n\tif (!pdf_is_indirect(key))\n\t\treturn 0;\n\thash->u.i.i0 = pdf_to_num(key);\n\thash->u.i.i1 = pdf_to_gen(key);\n\thash->u.i.ptr = pdf_get_indirect_document(key);\n\treturn 1;\n}\n\nstatic void *\npdf_keep_key(fz_context *ctx, void *key)\n{\n\treturn (void *)pdf_keep_obj((pdf_obj *)key);\n}\n\nstatic void\npdf_drop_key(fz_context *ctx, void *key)\n{\n\tpdf_drop_obj((pdf_obj *)key);\n}\n\nstatic int\npdf_cmp_key(void *k0, void *k1)\n{\n\treturn pdf_objcmp((pdf_obj *)k0, (pdf_obj *)k1);\n}\n\n#ifndef NDEBUG\nstatic void\npdf_debug_key(FILE *out, void *key_)\n{\n\tpdf_obj *key = (pdf_obj *)key_;\n\n\tif (pdf_is_indirect(key))\n\t{\n\t\tfprintf(out, \"(%d %d R) \", pdf_to_num(key), pdf_to_gen(key));\n\t}\n\telse\n\t\tpdf_fprint_obj(out, key, 0);\n}\n#endif\n\nstatic fz_store_type pdf_obj_store_type =\n{\n\tpdf_make_hash_key,\n\tpdf_keep_key,\n\tpdf_drop_key,\n\tpdf_cmp_key,\n#ifndef NDEBUG\n\tpdf_debug_key\n#endif\n};\n\nvoid\npdf_store_item(fz_context *ctx, pdf_obj *key, void *val, unsigned int itemsize)\n{\n\tvoid *existing;\n\texisting = fz_store_item(ctx, key, val, itemsize, &pdf_obj_store_type);\n\tassert(existing == NULL);\n}\n\nvoid *\npdf_find_item(fz_context *ctx, fz_store_free_fn *free, pdf_obj *key)\n{\n\treturn fz_find_item(ctx, free, key, &pdf_obj_store_type);\n}\n\nvoid\npdf_remove_item(fz_context *ctx, fz_store_free_fn *free, pdf_obj *key)\n{\n\tfz_remove_item(ctx, free, key, &pdf_obj_store_type);\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-stream.c",
    "content": "#include \"mupdf/pdf.h\"\n\n/*\n * Check if an object is a stream or not.\n */\nint\npdf_is_stream(pdf_document *doc, int num, int gen)\n{\n\tpdf_xref_entry *entry;\n\n\tif (num <= 0 || num >= pdf_xref_len(doc))\n\t\treturn 0;\n\n\tentry = pdf_cache_object(doc, num, gen);\n\n\treturn entry->stm_ofs != 0 || entry->stm_buf;\n}\n\n/*\n * Scan stream dictionary for an explicit /Crypt filter\n */\nstatic int\npdf_stream_has_crypt(fz_context *ctx, pdf_obj *stm)\n{\n\tpdf_obj *filters;\n\tpdf_obj *obj;\n\tint i;\n\n\tfilters = pdf_dict_getsa(stm, \"Filter\", \"F\");\n\tif (filters)\n\t{\n\t\tif (!strcmp(pdf_to_name(filters), \"Crypt\"))\n\t\t\treturn 1;\n\t\tif (pdf_is_array(filters))\n\t\t{\n\t\t\tint n = pdf_array_len(filters);\n\t\t\tfor (i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\tobj = pdf_array_get(filters, i);\n\t\t\t\tif (!strcmp(pdf_to_name(obj), \"Crypt\"))\n\t\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t}\n\treturn 0;\n}\n\nstatic fz_jbig2_globals *\npdf_load_jbig2_globals(pdf_document *doc, pdf_obj *dict)\n{\n\tfz_jbig2_globals *globals;\n\tfz_context *ctx = doc->ctx;\n\tfz_buffer *buf = NULL;\n\n\tfz_var(buf);\n\n\tif ((globals = pdf_find_item(ctx, fz_free_jbig2_globals_imp, dict)) != NULL)\n\t{\n\t\treturn globals;\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tbuf = pdf_load_stream(doc, pdf_to_num(dict), pdf_to_gen(dict));\n\t\tglobals = fz_load_jbig2_globals(ctx, buf->data, buf->len);\n\t\tpdf_store_item(ctx, dict, globals, buf->len);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, buf);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn globals;\n}\n\n/*\n * Create a filter given a name and param dictionary.\n */\nstatic fz_stream *\nbuild_filter(fz_stream *chain, pdf_document *doc, pdf_obj *f, pdf_obj *p, int num, int gen, fz_compression_params *params)\n{\n\tfz_context *ctx = chain->ctx;\n\tchar *s = pdf_to_name(f);\n\n\tint predictor = pdf_to_int(pdf_dict_gets(p, \"Predictor\"));\n\tpdf_obj *columns_obj = pdf_dict_gets(p, \"Columns\");\n\tint columns = pdf_to_int(columns_obj);\n\tint colors = pdf_to_int(pdf_dict_gets(p, \"Colors\"));\n\tint bpc = pdf_to_int(pdf_dict_gets(p, \"BitsPerComponent\"));\n\n\tif (params)\n\t\tparams->type = FZ_IMAGE_RAW;\n\n\tif (!strcmp(s, \"ASCIIHexDecode\") || !strcmp(s, \"AHx\"))\n\t\treturn fz_open_ahxd(chain);\n\n\telse if (!strcmp(s, \"ASCII85Decode\") || !strcmp(s, \"A85\"))\n\t\treturn fz_open_a85d(chain);\n\n\telse if (!strcmp(s, \"CCITTFaxDecode\") || !strcmp(s, \"CCF\"))\n\t{\n\t\tpdf_obj *k = pdf_dict_gets(p, \"K\");\n\t\tpdf_obj *eol = pdf_dict_gets(p, \"EndOfLine\");\n\t\tpdf_obj *eba = pdf_dict_gets(p, \"EncodedByteAlign\");\n\t\tpdf_obj *rows = pdf_dict_gets(p, \"Rows\");\n\t\tpdf_obj *eob = pdf_dict_gets(p, \"EndOfBlock\");\n\t\tpdf_obj *bi1 = pdf_dict_gets(p, \"BlackIs1\");\n\t\tif (params)\n\t\t{\n\t\t\t/* We will shortstop here */\n\t\t\tparams->type = FZ_IMAGE_FAX;\n\t\t\tparams->u.fax.k = (k ? pdf_to_int(k) : 0);\n\t\t\tparams->u.fax.end_of_line = (eol ? pdf_to_bool(eol) : 0);\n\t\t\tparams->u.fax.encoded_byte_align = (eba ? pdf_to_bool(eba) : 0);\n\t\t\tparams->u.fax.columns = (columns_obj ? columns : 1728);\n\t\t\tparams->u.fax.rows = (rows ? pdf_to_int(rows) : 0);\n\t\t\tparams->u.fax.end_of_block = (eob ? pdf_to_bool(eob) : 1);\n\t\t\tparams->u.fax.black_is_1 = (bi1 ? pdf_to_bool(bi1) : 0);\n\t\t\treturn chain;\n\t\t}\n\t\treturn fz_open_faxd(chain,\n\t\t\t\tk ? pdf_to_int(k) : 0,\n\t\t\t\teol ? pdf_to_bool(eol) : 0,\n\t\t\t\teba ? pdf_to_bool(eba) : 0,\n\t\t\t\tcolumns_obj ? columns : 1728,\n\t\t\t\trows ? pdf_to_int(rows) : 0,\n\t\t\t\teob ? pdf_to_bool(eob) : 1,\n\t\t\t\tbi1 ? pdf_to_bool(bi1) : 0);\n\t}\n\n\telse if (!strcmp(s, \"DCTDecode\") || !strcmp(s, \"DCT\"))\n\t{\n\t\tpdf_obj *ct = pdf_dict_gets(p, \"ColorTransform\");\n\t\tif (params)\n\t\t{\n\t\t\t/* We will shortstop here */\n\t\t\tparams->type = FZ_IMAGE_JPEG;\n\t\t\tparams->u.jpeg.color_transform = (ct ? pdf_to_int(ct) : -1);\n\t\t\treturn chain;\n\t\t}\n\t\treturn fz_open_dctd(chain, ct ? pdf_to_int(ct) : -1, 0, NULL);\n\t}\n\n\telse if (!strcmp(s, \"RunLengthDecode\") || !strcmp(s, \"RL\"))\n\t{\n\t\tif (params)\n\t\t{\n\t\t\t/* We will shortstop here */\n\t\t\tparams->type = FZ_IMAGE_RLD;\n\t\t\treturn chain;\n\t\t}\n\t\treturn fz_open_rld(chain);\n\t}\n\telse if (!strcmp(s, \"FlateDecode\") || !strcmp(s, \"Fl\"))\n\t{\n\t\tif (params)\n\t\t{\n\t\t\t/* We will shortstop here */\n\t\t\tparams->type = FZ_IMAGE_FLATE;\n\t\t\tparams->u.flate.predictor = predictor;\n\t\t\tparams->u.flate.columns = columns;\n\t\t\tparams->u.flate.colors = colors;\n\t\t\tparams->u.flate.bpc = bpc;\n\t\t\treturn chain;\n\t\t}\n\t\tchain = fz_open_flated(chain, 15);\n\t\tif (predictor > 1)\n\t\t\tchain = fz_open_predict(chain, predictor, columns, colors, bpc);\n\t\treturn chain;\n\t}\n\n\telse if (!strcmp(s, \"LZWDecode\") || !strcmp(s, \"LZW\"))\n\t{\n\t\tpdf_obj *ec = pdf_dict_gets(p, \"EarlyChange\");\n\t\tif (params)\n\t\t{\n\t\t\t/* We will shortstop here */\n\t\t\tparams->type = FZ_IMAGE_LZW;\n\t\t\tparams->u.lzw.predictor = predictor;\n\t\t\tparams->u.lzw.columns = columns;\n\t\t\tparams->u.lzw.colors = colors;\n\t\t\tparams->u.lzw.bpc = bpc;\n\t\t\tparams->u.lzw.early_change = (ec ? pdf_to_int(ec) : 1);\n\t\t\treturn chain;\n\t\t}\n\t\tchain = fz_open_lzwd(chain, ec ? pdf_to_int(ec) : 1);\n\t\tif (predictor > 1)\n\t\t\tchain = fz_open_predict(chain, predictor, columns, colors, bpc);\n\t\treturn chain;\n\t}\n\n\telse if (!strcmp(s, \"JBIG2Decode\"))\n\t{\n\t\tfz_jbig2_globals *globals = NULL;\n\t\tpdf_obj *obj = pdf_dict_gets(p, \"JBIG2Globals\");\n\t\tif (pdf_is_indirect(obj))\n\t\t\tglobals = pdf_load_jbig2_globals(doc, obj);\n\t\t/* fz_open_jbig2d takes possession of globals */\n\t\treturn fz_open_jbig2d(chain, globals);\n\t}\n\n\telse if (!strcmp(s, \"JPXDecode\"))\n\t\treturn chain; /* JPX decoding is special cased in the image loading code */\n\n\telse if (!strcmp(s, \"Crypt\"))\n\t{\n\t\tpdf_obj *name;\n\n\t\tif (!doc->crypt)\n\t\t{\n\t\t\tfz_warn(ctx, \"crypt filter in unencrypted document\");\n\t\t\treturn chain;\n\t\t}\n\n\t\tname = pdf_dict_gets(p, \"Name\");\n\t\tif (pdf_is_name(name))\n\t\t\treturn pdf_open_crypt_with_filter(chain, doc->crypt, pdf_to_name(name), num, gen);\n\n\t\treturn chain;\n\t}\n\n\tfz_warn(ctx, \"unknown filter name (%s)\", s);\n\treturn chain;\n}\n\n/*\n * Build a chain of filters given filter names and param dicts.\n * If head is given, start filter chain with it.\n * Assume ownership of head.\n */\nstatic fz_stream *\nbuild_filter_chain(fz_stream *chain, pdf_document *doc, pdf_obj *fs, pdf_obj *ps, int num, int gen, fz_compression_params *params)\n{\n\tpdf_obj *f;\n\tpdf_obj *p;\n\tint i, n;\n\tfz_context *ctx = chain->ctx;\n\n\tfz_try(ctx)\n\t{\n\t\tn = pdf_array_len(fs);\n\t\tfor (i = 0; i < n; i++)\n\t\t{\n\t\t\tfz_stream *chain2;\n\n\t\t\tf = pdf_array_get(fs, i);\n\t\t\tp = pdf_array_get(ps, i);\n\t\t\tchain2 = chain;\n\t\t\tchain = NULL;\n\t\t\tchain = build_filter(chain2, doc, f, p, num, gen, (i == n-1 ? params : NULL));\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_close(chain);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn chain;\n}\n\n/*\n * Build a filter for reading raw stream data.\n * This is a null filter to constrain reading to the stream length (and to\n * allow for other people accessing the file), followed by a decryption\n * filter.\n *\n * orig_num and orig_gen are used purely to seed the encryption.\n */\nstatic fz_stream *\npdf_open_raw_filter(fz_stream *chain, pdf_document *doc, pdf_obj *stmobj, int num, int orig_num, int orig_gen, int offset)\n{\n\tfz_context *ctx = chain->ctx;\n\tint hascrypt;\n\tint len;\n\n\tif (num > 0 && num < pdf_xref_len(doc))\n\t{\n\t\tpdf_xref_entry *entry = pdf_get_xref_entry(doc, num);\n\t\tif (entry->stm_buf)\n\t\t\treturn fz_open_buffer(ctx, entry->stm_buf);\n\t}\n\n\t/* don't close chain when we close this filter */\n\tfz_keep_stream(chain);\n\n\tlen = pdf_to_int(pdf_dict_gets(stmobj, \"Length\"));\n\tchain = fz_open_null(chain, len, offset);\n\n\thascrypt = pdf_stream_has_crypt(ctx, stmobj);\n\tif (doc->crypt && !hascrypt)\n\t\tchain = pdf_open_crypt(chain, doc->crypt, orig_num, orig_gen);\n\n\treturn chain;\n}\n\n/*\n * Construct a filter to decode a stream, constraining\n * to stream length and decrypting.\n */\nstatic fz_stream *\npdf_open_filter(fz_stream *chain, pdf_document *doc, pdf_obj *stmobj, int num, int gen, int offset, fz_compression_params *imparams)\n{\n\tpdf_obj *filters;\n\tpdf_obj *params;\n\n\tfilters = pdf_dict_getsa(stmobj, \"Filter\", \"F\");\n\tparams = pdf_dict_getsa(stmobj, \"DecodeParms\", \"DP\");\n\n\tchain = pdf_open_raw_filter(chain, doc, stmobj, num, num, gen, offset);\n\n\tfz_var(chain);\n\n\tfz_try(doc->ctx)\n\t{\n\t\tif (pdf_is_name(filters))\n\t\t{\n\t\t\tfz_stream *chain2 = chain;\n\t\t\tchain = NULL;\n\t\t\tchain = build_filter(chain2, doc, filters, params, num, gen, imparams);\n\t\t}\n\t\telse if (pdf_array_len(filters) > 0)\n\t\t{\n\t\t\tfz_stream *chain2 = chain;\n\t\t\tchain = NULL;\n\t\t\tchain = build_filter_chain(chain2, doc, filters, params, num, gen, imparams);\n\t\t}\n\t}\n\tfz_catch(doc->ctx)\n\t{\n\t\tfz_close(chain);\n\t\tfz_rethrow(doc->ctx);\n\t}\n\n\treturn chain;\n}\n\n/*\n * Construct a filter to decode a stream, without\n * constraining to stream length, and without decryption.\n */\nfz_stream *\npdf_open_inline_stream(pdf_document *doc, pdf_obj *stmobj, int length, fz_stream *chain, fz_compression_params *imparams)\n{\n\tpdf_obj *filters;\n\tpdf_obj *params;\n\n\tfilters = pdf_dict_getsa(stmobj, \"Filter\", \"F\");\n\tparams = pdf_dict_getsa(stmobj, \"DecodeParms\", \"DP\");\n\n\t/* don't close chain when we close this filter */\n\tfz_keep_stream(chain);\n\n\tif (pdf_is_name(filters))\n\t\treturn build_filter(chain, doc, filters, params, 0, 0, imparams);\n\tif (pdf_array_len(filters) > 0)\n\t\treturn build_filter_chain(chain, doc, filters, params, 0, 0, imparams);\n\n\tif (imparams)\n\t\timparams->type = FZ_IMAGE_RAW;\n\treturn fz_open_null(chain, length, fz_tell(chain));\n}\n\nvoid\npdf_load_compressed_inline_image(pdf_document *doc, pdf_obj *dict, int length, fz_stream *stm, int indexed, fz_image *image)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_compressed_buffer *bc = fz_malloc_struct(ctx, fz_compressed_buffer);\n\n\tfz_try(ctx)\n\t{\n\t\tint dummy_l2factor = 0;\n\t\tbc->buffer = fz_new_buffer(ctx, 1024);\n\n\t\tstm = pdf_open_inline_stream(doc, dict, length, stm, &bc->params);\n\t\tstm = fz_open_leecher(stm, bc->buffer);\n\t\tstm = fz_open_image_decomp_stream(ctx, stm, &bc->params, &dummy_l2factor);\n\n\t\timage->tile = fz_decomp_image_from_stream(ctx, stm, image, indexed, 0, 0);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free_compressed_buffer(ctx, bc);\n\t\tfz_rethrow(ctx);\n\t}\n\timage->buffer = bc;\n}\n\n/*\n * Open a stream for reading the raw (compressed but decrypted) data.\n */\nfz_stream *\npdf_open_raw_stream(pdf_document *doc, int num, int gen)\n{\n\treturn pdf_open_raw_renumbered_stream(doc, num, gen, num, gen);\n}\n\nfz_stream *\npdf_open_raw_renumbered_stream(pdf_document *doc, int num, int gen, int orig_num, int orig_gen)\n{\n\tpdf_xref_entry *x;\n\n\tif (num <= 0 || num >= pdf_xref_len(doc))\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"object id out of range (%d %d R)\", num, gen);\n\n\tx = pdf_cache_object(doc, num, gen);\n\tif (x->stm_ofs == 0)\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"object is not a stream\");\n\n\treturn pdf_open_raw_filter(doc->file, doc, x->obj, num, orig_num, orig_gen, x->stm_ofs);\n}\n\nstatic fz_stream *\npdf_open_image_stream(pdf_document *doc, int num, int gen, int orig_num, int orig_gen, fz_compression_params *params)\n{\n\tpdf_xref_entry *x;\n\n\tif (num <= 0 || num >= pdf_xref_len(doc))\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"object id out of range (%d %d R)\", num, gen);\n\n\tx = pdf_cache_object(doc, num, gen);\n\tif (x->stm_ofs == 0 && x->stm_buf == NULL)\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"object is not a stream\");\n\n\treturn pdf_open_filter(doc->file, doc, x->obj, orig_num, orig_gen, x->stm_ofs, params);\n}\n\n/*\n * Open a stream for reading uncompressed data.\n * Put the opened file in doc->stream.\n * Using doc->file while a stream is open is a Bad idea.\n */\nfz_stream *\npdf_open_stream(pdf_document *doc, int num, int gen)\n{\n\treturn pdf_open_image_stream(doc, num, gen, num, gen, NULL);\n}\n\nfz_stream *\npdf_open_stream_with_offset(pdf_document *doc, int num, int gen, pdf_obj *dict, int stm_ofs)\n{\n\tif (stm_ofs == 0)\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"object is not a stream\");\n\n\treturn pdf_open_filter(doc->file, doc, dict, num, gen, stm_ofs, NULL);\n}\n\n/*\n * Load raw (compressed but decrypted) contents of a stream into buf.\n */\nfz_buffer *\npdf_load_raw_stream(pdf_document *doc, int num, int gen)\n{\n\treturn pdf_load_raw_renumbered_stream(doc, num, gen, num, gen);\n}\n\nfz_buffer *\npdf_load_raw_renumbered_stream(pdf_document *doc, int num, int gen, int orig_num, int orig_gen)\n{\n\tfz_stream *stm;\n\tpdf_obj *dict;\n\tint len;\n\tfz_buffer *buf;\n\n\tif (num > 0 && num < pdf_xref_len(doc))\n\t{\n\t\tpdf_xref_entry *entry = pdf_get_xref_entry(doc, num);\n\t\tif (entry->stm_buf)\n\t\t\treturn fz_keep_buffer(doc->ctx, entry->stm_buf);\n\t}\n\n\tdict = pdf_load_object(doc, num, gen);\n\n\tlen = pdf_to_int(pdf_dict_gets(dict, \"Length\"));\n\n\tpdf_drop_obj(dict);\n\n\tstm = pdf_open_raw_renumbered_stream(doc, num, gen, orig_num, orig_gen);\n\n\tbuf = fz_read_all(stm, len);\n\n\tfz_close(stm);\n\treturn buf;\n}\n\nstatic int\npdf_guess_filter_length(int len, char *filter)\n{\n\tif (!strcmp(filter, \"ASCIIHexDecode\"))\n\t\treturn len / 2;\n\tif (!strcmp(filter, \"ASCII85Decode\"))\n\t\treturn len * 4 / 5;\n\tif (!strcmp(filter, \"FlateDecode\"))\n\t\treturn len * 3;\n\tif (!strcmp(filter, \"RunLengthDecode\"))\n\t\treturn len * 3;\n\tif (!strcmp(filter, \"LZWDecode\"))\n\t\treturn len * 2;\n\treturn len;\n}\n\nstatic fz_buffer *\npdf_load_image_stream(pdf_document *doc, int num, int gen, int orig_num, int orig_gen, fz_compression_params *params, int *truncated)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_stream *stm = NULL;\n\tpdf_obj *dict, *obj;\n\tint i, len, n;\n\tfz_buffer *buf;\n\n\tfz_var(buf);\n\n\tif (num > 0 && num < pdf_xref_len(doc))\n\t{\n\t\tpdf_xref_entry *entry = pdf_get_xref_entry(doc, num);\n\t\tif (entry->stm_buf)\n\t\t\treturn fz_keep_buffer(doc->ctx, entry->stm_buf);\n\t}\n\n\tdict = pdf_load_object(doc, num, gen);\n\n\tlen = pdf_to_int(pdf_dict_gets(dict, \"Length\"));\n\tobj = pdf_dict_gets(dict, \"Filter\");\n\tlen = pdf_guess_filter_length(len, pdf_to_name(obj));\n\tn = pdf_array_len(obj);\n\tfor (i = 0; i < n; i++)\n\t\tlen = pdf_guess_filter_length(len, pdf_to_name(pdf_array_get(obj, i)));\n\n\tpdf_drop_obj(dict);\n\n\tstm = pdf_open_image_stream(doc, num, gen, orig_num, orig_gen, params);\n\n\tfz_try(ctx)\n\t{\n\t\tif (truncated)\n\t\t\tbuf = fz_read_best(stm, len, truncated);\n\t\telse\n\t\t\tbuf = fz_read_all(stm, len);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(stm);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_message(ctx, \"cannot read raw stream (%d %d R)\", num, gen);\n\t}\n\n\treturn buf;\n}\n\n/*\n * Load uncompressed contents of a stream into buf.\n */\nfz_buffer *\npdf_load_stream(pdf_document *doc, int num, int gen)\n{\n\treturn pdf_load_image_stream(doc, num, gen, num, gen, NULL, NULL);\n}\n\nfz_buffer *\npdf_load_renumbered_stream(pdf_document *doc, int num, int gen, int orig_num, int orig_gen, int *truncated)\n{\n\treturn pdf_load_image_stream(doc, num, gen, orig_num, orig_gen, NULL, truncated);\n}\n\nfz_compressed_buffer *\npdf_load_compressed_stream(pdf_document *doc, int num, int gen)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_compressed_buffer *bc = fz_malloc_struct(ctx, fz_compressed_buffer);\n\n\tfz_try(ctx)\n\t{\n\t\tbc->buffer = pdf_load_image_stream(doc, num, gen, num, gen, &bc->params, NULL);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, bc);\n\t\tfz_rethrow(ctx);\n\t}\n\treturn bc;\n}\n\nstatic fz_stream *\npdf_open_object_array(pdf_document *doc, pdf_obj *list)\n{\n\tint i, n;\n\tfz_context *ctx = doc->ctx;\n\tfz_stream *stm;\n\n\tn = pdf_array_len(list);\n\t/* SumatraPDF: force-close strings at PDF stream boundaries */\n\tstm = fz_open_concat(ctx, n, 5);\n\n\tfz_var(i); /* Workaround Mac compiler bug */\n\tfor (i = 0; i < n; i++)\n\t{\n\t\tpdf_obj *obj = pdf_array_get(list, i);\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tfz_concat_push(stm, pdf_open_stream(doc, pdf_to_num(obj), pdf_to_gen(obj)));\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\t\tfz_warn(ctx, \"cannot load content stream part %d/%d\", i + 1, n);\n\t\t\tcontinue;\n\t\t}\n\t}\n\n\treturn stm;\n}\n\nfz_stream *\npdf_open_contents_stream(pdf_document *doc, pdf_obj *obj)\n{\n\tfz_context *ctx = doc->ctx;\n\tint num, gen;\n\n\tif (pdf_is_array(obj))\n\t\treturn pdf_open_object_array(doc, obj);\n\n\tnum = pdf_to_num(obj);\n\tgen = pdf_to_gen(obj);\n\tif (pdf_is_stream(doc, num, gen))\n\t\treturn pdf_open_image_stream(doc, num, gen, num, gen, NULL);\n\n\tfz_warn(ctx, \"pdf object stream missing (%d %d R)\", num, gen);\n\treturn NULL;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-type3.c",
    "content": "#include \"mupdf/pdf.h\"\n\nstatic void\npdf_run_glyph_func(void *doc, void *rdb, fz_buffer *contents, fz_device *dev, const fz_matrix *ctm, void *gstate, int nested_depth)\n{\n\tpdf_run_glyph(doc, (pdf_obj *)rdb, contents, dev, ctm, gstate, nested_depth);\n}\n\nstatic void\npdf_t3_free_resources(void *doc, void *rdb_)\n{\n\tpdf_obj *rdb = (pdf_obj *)rdb_;\n\tpdf_drop_obj(rdb);\n}\n\npdf_font_desc *\npdf_load_type3_font(pdf_document *doc, pdf_obj *rdb, pdf_obj *dict)\n{\n\tchar buf[256];\n\tchar *estrings[256];\n\tpdf_font_desc *fontdesc = NULL;\n\tpdf_obj *encoding;\n\tpdf_obj *widths;\n\tpdf_obj *charprocs;\n\tpdf_obj *obj;\n\tint first, last;\n\tint i, k, n;\n\tfz_rect bbox;\n\tfz_matrix matrix;\n\tfz_context *ctx = doc->ctx;\n\n\tfz_var(fontdesc);\n\n\t/* Make a new type3 font entry in the document */\n\tif (doc->num_type3_fonts == doc->max_type3_fonts)\n\t{\n\t\tint new_max = doc->max_type3_fonts * 2;\n\n\t\tif (new_max == 0)\n\t\t\tnew_max = 4;\n\t\tdoc->type3_fonts = fz_resize_array(doc->ctx, doc->type3_fonts, new_max, sizeof(*doc->type3_fonts));\n\t\tdoc->max_type3_fonts = new_max;\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tobj = pdf_dict_gets(dict, \"Name\");\n\t\tif (pdf_is_name(obj))\n\t\t\tfz_strlcpy(buf, pdf_to_name(obj), sizeof buf);\n\t\telse\n\t\t\tfz_strlcpy(buf, \"Unnamed-T3\", sizeof buf);\n\n\t\tfontdesc = pdf_new_font_desc(ctx);\n\n\t\tobj = pdf_dict_gets(dict, \"FontMatrix\");\n\t\tpdf_to_matrix(ctx, obj, &matrix);\n\n\t\tobj = pdf_dict_gets(dict, \"FontBBox\");\n\t\tfz_transform_rect(pdf_to_rect(ctx, obj, &bbox), &matrix);\n\n\t\tfontdesc->font = fz_new_type3_font(ctx, buf, &matrix);\n\t\tfontdesc->size += sizeof(fz_font) + 256 * (sizeof(fz_buffer*) + sizeof(float));\n\n\t\tfz_set_font_bbox(ctx, fontdesc->font, bbox.x0, bbox.y0, bbox.x1, bbox.y1);\n\n\t\t/* SumatraPDF: expose Type3 FontDescriptor flags */\n\t\tfontdesc->flags = pdf_to_int(pdf_dict_gets(pdf_dict_gets(dict, \"FontDescriptor\"), \"Flags\"));\n\n\t\t/* Encoding */\n\n\t\tfor (i = 0; i < 256; i++)\n\t\t\testrings[i] = NULL;\n\n\t\tencoding = pdf_dict_gets(dict, \"Encoding\");\n\t\tif (!encoding)\n\t\t{\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"syntaxerror: Type3 font missing Encoding\");\n\t\t}\n\n\t\tif (pdf_is_name(encoding))\n\t\t\tpdf_load_encoding(estrings, pdf_to_name(encoding));\n\n\t\tif (pdf_is_dict(encoding))\n\t\t{\n\t\t\tpdf_obj *base, *diff, *item;\n\n\t\t\tbase = pdf_dict_gets(encoding, \"BaseEncoding\");\n\t\t\tif (pdf_is_name(base))\n\t\t\t\tpdf_load_encoding(estrings, pdf_to_name(base));\n\n\t\t\tdiff = pdf_dict_gets(encoding, \"Differences\");\n\t\t\tif (pdf_is_array(diff))\n\t\t\t{\n\t\t\t\tn = pdf_array_len(diff);\n\t\t\t\tk = 0;\n\t\t\t\tfor (i = 0; i < n; i++)\n\t\t\t\t{\n\t\t\t\t\titem = pdf_array_get(diff, i);\n\t\t\t\t\tif (pdf_is_int(item))\n\t\t\t\t\t\tk = pdf_to_int(item);\n\t\t\t\t\tif (pdf_is_name(item) && k >= 0 && k < nelem(estrings))\n\t\t\t\t\t\testrings[k++] = pdf_to_name(item);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfontdesc->encoding = pdf_new_identity_cmap(ctx, 0, 1);\n\t\tfontdesc->size += pdf_cmap_size(ctx, fontdesc->encoding);\n\n\t\tpdf_load_to_unicode(doc, fontdesc, estrings, NULL, pdf_dict_gets(dict, \"ToUnicode\"));\n\n\t\t/* SumatraPDF: trying to match Adobe Reader's behavior */\n\t\tif (!(fontdesc->flags & PDF_FD_SYMBOLIC) && fontdesc->cid_to_ucs_len >= 128)\n\t\t\tfor (i = 32; i < 128; i++)\n\t\t\t\tif (fontdesc->cid_to_ucs[i] == '?' || fontdesc->cid_to_ucs[i] == '\\0')\n\t\t\t\t\tfontdesc->cid_to_ucs[i] = i;\n\n\t\t/* Widths */\n\n\t\tpdf_set_default_hmtx(ctx, fontdesc, 0);\n\n\t\tfirst = pdf_to_int(pdf_dict_gets(dict, \"FirstChar\"));\n\t\tlast = pdf_to_int(pdf_dict_gets(dict, \"LastChar\"));\n\n\t\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=1966 */\n\t\tif (first >= 256 && last - first < 256)\n\t\t{\n\t\t\tfz_warn(ctx, \"ignoring out-of-bound values for FirstChar/LastChar: %d/%d\", first, last);\n\t\t\tlast -= first;\n\t\t\tfirst = 0;\n\t\t}\n\n\t\tif (first < 0 || last > 255 || first > last)\n\t\t\tfirst = last = 0;\n\n\t\twidths = pdf_dict_gets(dict, \"Widths\");\n\t\tif (!widths)\n\t\t{\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"syntaxerror: Type3 font missing Widths\");\n\t\t}\n\n\t\tfor (i = first; i <= last; i++)\n\t\t{\n\t\t\tfloat w = pdf_to_real(pdf_array_get(widths, i - first));\n\t\t\tw = fontdesc->font->t3matrix.a * w * 1000;\n\t\t\tfontdesc->font->t3widths[i] = w * 0.001f;\n\t\t\tpdf_add_hmtx(ctx, fontdesc, i, i, w);\n\t\t}\n\n\t\tpdf_end_hmtx(ctx, fontdesc);\n\n\t\t/* Resources -- inherit page resources if the font doesn't have its own */\n\n\t\tfontdesc->font->t3freeres = pdf_t3_free_resources;\n\t\tfontdesc->font->t3resources = pdf_dict_gets(dict, \"Resources\");\n\t\tif (!fontdesc->font->t3resources)\n\t\t\tfontdesc->font->t3resources = rdb;\n\t\tif (fontdesc->font->t3resources)\n\t\t\tpdf_keep_obj(fontdesc->font->t3resources);\n\t\tif (!fontdesc->font->t3resources)\n\t\t\tfz_warn(ctx, \"no resource dictionary for type 3 font!\");\n\n\t\tfontdesc->font->t3doc = doc;\n\t\tfontdesc->font->t3run = pdf_run_glyph_func;\n\n\t\t/* CharProcs */\n\n\t\tcharprocs = pdf_dict_gets(dict, \"CharProcs\");\n\t\tif (!charprocs)\n\t\t{\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"syntaxerror: Type3 font missing CharProcs\");\n\t\t}\n\n\t\tfor (i = 0; i < 256; i++)\n\t\t{\n\t\t\tif (estrings[i])\n\t\t\t{\n\t\t\t\t/* SumatraPDF: don't reject fonts with few broken glyphs */\n\t\t\t\tfz_try(ctx)\n\t\t\t\t{\n\n\t\t\t\tobj = pdf_dict_gets(charprocs, estrings[i]);\n\t\t\t\tif (pdf_is_stream(doc, pdf_to_num(obj), pdf_to_gen(obj)))\n\t\t\t\t{\n\t\t\t\t\tfontdesc->font->t3procs[i] = pdf_load_stream(doc, pdf_to_num(obj), pdf_to_gen(obj));\n\t\t\t\t\tfontdesc->size += fontdesc->font->t3procs[i]->cap;\n\t\t\t\t\tfontdesc->size += 0; // TODO: display list size calculation\n\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tfz_catch(ctx)\n\t\t\t\t{\n\t\t\t\t\tfz_warn(ctx, \"failed to get data for type 3 glyph '%s'\", estrings[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tif (fontdesc)\n\t\t\tpdf_drop_font(ctx, fontdesc);\n\t\tfz_rethrow_message(ctx, \"cannot load type3 font (%d %d R)\", pdf_to_num(dict), pdf_to_gen(dict));\n\t}\n\n\tdoc->type3_fonts[doc->num_type3_fonts++] = fz_keep_font(ctx, fontdesc->font);\n\n\treturn fontdesc;\n}\n\nvoid pdf_load_type3_glyphs(pdf_document *doc, pdf_font_desc *fontdesc, int nested_depth)\n{\n\tint i;\n\tfz_context *ctx = doc->ctx;\n\n\tfz_try(ctx)\n\t{\n\t\tfor (i = 0; i < 256; i++)\n\t\t{\n\t\t\tif (fontdesc->font->t3procs[i])\n\t\t\t{\n\t\t\t\tfz_prepare_t3_glyph(ctx, fontdesc->font, i, nested_depth);\n\t\t\t\tfontdesc->size += 0; // TODO: display list size calculation\n\t\t\t}\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\tfz_warn(ctx, \"Type3 glyph load failed: %s\", fz_caught_message(ctx));\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-unicode.c",
    "content": "#include \"mupdf/pdf.h\"\n\n/* Load or synthesize ToUnicode map for fonts */\n\nstatic void\npdf_remap_cmap_range(fz_context *ctx, pdf_cmap *ucs_from_gid,\n\tunsigned int cpt, unsigned int gid, unsigned int n, pdf_cmap *ucs_from_cpt)\n{\n\tunsigned int k;\n\tint ucsbuf[8];\n\tint ucslen;\n\n\tfor (k = 0; k <= n; ++k)\n\t{\n\t\tucslen = pdf_lookup_cmap_full(ucs_from_cpt, cpt + k, ucsbuf);\n\t\tif (ucslen == 1)\n\t\t\tpdf_map_range_to_range(ctx, ucs_from_gid, gid + k, gid + k, ucsbuf[0]);\n\t\telse if (ucslen > 1)\n\t\t\tpdf_map_one_to_many(ctx, ucs_from_gid, gid + k, ucsbuf, ucslen);\n\t}\n}\n\nstatic pdf_cmap *\npdf_remap_cmap(fz_context *ctx, pdf_cmap *gid_from_cpt, pdf_cmap *ucs_from_cpt)\n{\n\tpdf_cmap *ucs_from_gid;\n\tunsigned int a, b, x;\n\tint i;\n\n\tucs_from_gid = pdf_new_cmap(ctx);\n\n\tif (gid_from_cpt->usecmap)\n\t\tucs_from_gid->usecmap = pdf_remap_cmap(ctx, gid_from_cpt->usecmap, ucs_from_cpt);\n\n\tfor (i = 0; i < gid_from_cpt->rlen; ++i)\n\t{\n\t\ta = gid_from_cpt->ranges[i].low;\n\t\tb = gid_from_cpt->ranges[i].high;\n\t\tx = gid_from_cpt->ranges[i].out;\n\t\tpdf_remap_cmap_range(ctx, ucs_from_gid, a, x, b - a, ucs_from_cpt);\n\t}\n\n\tfor (i = 0; i < gid_from_cpt->xlen; ++i)\n\t{\n\t\ta = gid_from_cpt->xranges[i].low;\n\t\tb = gid_from_cpt->xranges[i].high;\n\t\tx = gid_from_cpt->xranges[i].out;\n\t\tpdf_remap_cmap_range(ctx, ucs_from_gid, a, x, b - a, ucs_from_cpt);\n\t}\n\n\t/* Font encoding CMaps don't have one-to-many mappings, so we can ignore the mranges. */\n\n\tpdf_sort_cmap(ctx, ucs_from_gid);\n\n\treturn ucs_from_gid;\n}\n\nvoid\npdf_load_to_unicode(pdf_document *doc, pdf_font_desc *font,\n\tchar **strings, char *collection, pdf_obj *cmapstm)\n{\n\tfz_context *ctx = doc->ctx;\n\tunsigned int cpt;\n\n\tif (pdf_is_stream(doc, pdf_to_num(cmapstm), pdf_to_gen(cmapstm)))\n\t{\n\t\tpdf_cmap *ucs_from_cpt = pdf_load_embedded_cmap(doc, cmapstm);\n\t\tfont->to_unicode = pdf_remap_cmap(ctx, font->encoding, ucs_from_cpt);\n\t\tpdf_drop_cmap(ctx, ucs_from_cpt);\n\t\tfont->size += pdf_cmap_size(ctx, font->to_unicode);\n\t}\n\n\telse if (collection)\n\t{\n\t\tif (!strcmp(collection, \"Adobe-CNS1\"))\n\t\t\tfont->to_unicode = pdf_load_system_cmap(ctx, \"Adobe-CNS1-UCS2\");\n\t\telse if (!strcmp(collection, \"Adobe-GB1\"))\n\t\t\tfont->to_unicode = pdf_load_system_cmap(ctx, \"Adobe-GB1-UCS2\");\n\t\telse if (!strcmp(collection, \"Adobe-Japan1\"))\n\t\t\tfont->to_unicode = pdf_load_system_cmap(ctx, \"Adobe-Japan1-UCS2\");\n\t\telse if (!strcmp(collection, \"Adobe-Korea1\"))\n\t\t\tfont->to_unicode = pdf_load_system_cmap(ctx, \"Adobe-Korea1-UCS2\");\n\t\t/* SumatraPDF: load an identity cmap (until a ToUnicode is synthesized below) */\n\t\telse if (!strcmp(collection, \"Adobe-Identity\") && !(font->flags & PDF_FD_SYMBOLIC))\n\t\t\tfont->to_unicode = pdf_new_identity_cmap(ctx, font->wmode, 2);\n\n\t\treturn;\n\t}\n\n\tif (strings)\n\t{\n\t\t/* TODO one-to-many mappings */\n\n\t\tfont->cid_to_ucs_len = 256;\n\t\tfont->cid_to_ucs = fz_malloc_array(ctx, 256, sizeof *font->cid_to_ucs);\n\t\tfont->size += 256 * sizeof *font->cid_to_ucs;\n\n\t\tfor (cpt = 0; cpt < 256; cpt++)\n\t\t{\n\t\t\tif (strings[cpt])\n\t\t\t\tfont->cid_to_ucs[cpt] = pdf_lookup_agl(strings[cpt]);\n\t\t\telse\n\t\t\t\tfont->cid_to_ucs[cpt] = '?';\n\t\t}\n\t}\n\n\tif (!font->to_unicode && !font->cid_to_ucs)\n\t{\n\t\t/* TODO: synthesize a ToUnicode if it's a freetype font with\n\t\t * cmap and/or post tables or if it has glyph names. */\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-write.c",
    "content": "#include \"mupdf/pdf.h\"\n\n/* #define DEBUG_LINEARIZATION */\n/* #define DEBUG_HEAP_SORT */\n/* #define DEBUG_WRITING */\n\ntypedef struct pdf_write_options_s pdf_write_options;\n\n/*\n\tAs part of linearization, we need to keep a list of what objects are used\n\tby what page. We do this by recording the objects used in a given page\n\tin a page_objects structure. We have a list of these structures (one per\n\tpage) in the page_objects_list structure.\n\n\tThe page_objects structure maintains a heap in the object array, so\n\tinsertion takes log n time, and we can heapsort and dedupe at the end for\n\ta total worse case n log n time.\n\n\tThe magic heap invariant is that:\n\t\tentry[n] >= entry[(n+1)*2-1] & entry[n] >= entry[(n+1)*2]\n\tor equivalently:\n\t\tentry[(n-1)>>1] >= entry[n]\n\n\tFor a discussion of the heap data structure (and heapsort) see Kingston,\n\t\"Algorithms and Data Structures\".\n*/\n\ntypedef struct {\n\tint num_shared;\n\tint page_object_number;\n\tint num_objects;\n\tint min_ofs;\n\tint max_ofs;\n\t/* Extensible list of objects used on this page */\n\tint cap;\n\tint len;\n\tint object[1];\n} page_objects;\n\ntypedef struct {\n\tint cap;\n\tint len;\n\tpage_objects *page[1];\n} page_objects_list;\n\nstruct pdf_write_options_s\n{\n\tFILE *out;\n\tint do_incremental;\n\tint do_ascii;\n\tint do_expand;\n\tint do_garbage;\n\tint do_linear;\n\tint do_clean;\n\tint *use_list;\n\tint *ofs_list;\n\tint *gen_list;\n\tint *renumber_map;\n\tint continue_on_error;\n\tint *errors;\n\t/* The following extras are required for linearization */\n\tint *rev_renumber_map;\n\tint *rev_gen_list;\n\tint start;\n\tint first_xref_offset;\n\tint main_xref_offset;\n\tint first_xref_entry_offset;\n\tint file_len;\n\tint hints_shared_offset;\n\tint hintstream_len;\n\tpdf_obj *linear_l;\n\tpdf_obj *linear_h0;\n\tpdf_obj *linear_h1;\n\tpdf_obj *linear_o;\n\tpdf_obj *linear_e;\n\tpdf_obj *linear_n;\n\tpdf_obj *linear_t;\n\tpdf_obj *hints_s;\n\tpdf_obj *hints_length;\n\tint page_count;\n\tpage_objects_list *page_object_lists;\n};\n\n/*\n * Constants for use with use_list.\n *\n * If use_list[num] = 0, then object num is unused.\n * If use_list[num] & PARAMS, then object num is the linearisation params obj.\n * If use_list[num] & CATALOGUE, then object num is used by the catalogue.\n * If use_list[num] & PAGE1, then object num is used by page 1.\n * If use_list[num] & SHARED, then object num is shared between pages.\n * If use_list[num] & PAGE_OBJECT then this must be the first object in a page.\n * If use_list[num] & OTHER_OBJECTS then this must should appear in section 9.\n * Otherwise object num is used by page (use_list[num]>>USE_PAGE_SHIFT).\n */\nenum\n{\n\tUSE_CATALOGUE = 2,\n\tUSE_PAGE1 = 4,\n\tUSE_SHARED = 8,\n\tUSE_PARAMS = 16,\n\tUSE_HINTS = 32,\n\tUSE_PAGE_OBJECT = 64,\n\tUSE_OTHER_OBJECTS = 128,\n\tUSE_PAGE_MASK = ~255,\n\tUSE_PAGE_SHIFT = 8\n};\n\n/*\n * page_objects and page_object_list handling functions\n */\nstatic page_objects_list *\npage_objects_list_create(fz_context *ctx)\n{\n\tpage_objects_list *pol = fz_calloc(ctx, 1, sizeof(*pol));\n\n\tpol->cap = 1;\n\tpol->len = 0;\n\treturn pol;\n}\n\nstatic void\npage_objects_list_destroy(fz_context *ctx, page_objects_list *pol)\n{\n\tint i;\n\n\tif (!pol)\n\t\treturn;\n\tfor (i = 0; i < pol->len; i++)\n\t{\n\t\tfz_free(ctx, pol->page[i]);\n\t}\n\tfz_free(ctx, pol);\n}\n\nstatic void\npage_objects_list_ensure(fz_context *ctx, page_objects_list **pol, int newcap)\n{\n\tint oldcap = (*pol)->cap;\n\tif (newcap <= oldcap)\n\t\treturn;\n\t*pol = fz_resize_array(ctx, *pol, 1, sizeof(page_objects_list) + (newcap-1)*sizeof(page_objects *));\n\tmemset(&(*pol)->page[oldcap], 0, (newcap-oldcap)*sizeof(page_objects *));\n\t(*pol)->cap = newcap;\n}\n\nstatic page_objects *\npage_objects_create(fz_context *ctx)\n{\n\tint initial_cap = 8;\n\tpage_objects *po = fz_calloc(ctx, 1, sizeof(*po) + (initial_cap-1) * sizeof(int));\n\n\tpo->cap = initial_cap;\n\tpo->len = 0;\n\treturn po;\n\n}\n\nstatic void\npage_objects_insert(fz_context *ctx, page_objects **ppo, int i)\n{\n\tpage_objects *po;\n\n\t/* Make a page_objects if we don't have one */\n\tif (*ppo == NULL)\n\t\t*ppo = page_objects_create(ctx);\n\n\tpo = *ppo;\n\t/* page_objects insertion: extend the page_objects by 1, and put us on the end */\n\tif (po->len == po->cap)\n\t{\n\t\tpo = fz_resize_array(ctx, po, 1, sizeof(page_objects) + (po->cap*2 - 1)*sizeof(int));\n\t\tpo->cap *= 2;\n\t\t*ppo = po;\n\t}\n\tpo->object[po->len++] = i;\n}\n\nstatic void\npage_objects_list_insert(fz_context *ctx, pdf_write_options *opts, int page, int object)\n{\n\tpage_objects_list_ensure(ctx, &opts->page_object_lists, page+1);\n\tif (opts->page_object_lists->len < page+1)\n\t\topts->page_object_lists->len = page+1;\n\tpage_objects_insert(ctx, &opts->page_object_lists->page[page], object);\n}\n\nstatic void\npage_objects_list_set_page_object(fz_context *ctx, pdf_write_options *opts, int page, int object)\n{\n\tpage_objects_list_ensure(ctx, &opts->page_object_lists, page+1);\n\topts->page_object_lists->page[page]->page_object_number = object;\n}\n\nstatic void\npage_objects_sort(fz_context *ctx, page_objects *po)\n{\n\tint i, j;\n\tint n = po->len;\n\n\t/* Step 1: Make a heap */\n\t/* Invariant: Valid heap in [0..i), unsorted elements in [i..n) */\n\tfor (i = 1; i < n; i++)\n\t{\n\t\t/* Now bubble backwards to maintain heap invariant */\n\t\tj = i;\n\t\twhile (j != 0)\n\t\t{\n\t\t\tint tmp;\n\t\t\tint k = (j-1)>>1;\n\t\t\tif (po->object[k] >= po->object[j])\n\t\t\t\tbreak;\n\t\t\ttmp = po->object[k];\n\t\t\tpo->object[k] = po->object[j];\n\t\t\tpo->object[j] = tmp;\n\t\t\tj = k;\n\t\t}\n\t}\n\n\t/* Step 2: Heap sort */\n\t/* Invariant: valid heap in [0..i), sorted list in [i..n) */\n\t/* Initially: i = n */\n\tfor (i = n-1; i > 0; i--)\n\t{\n\t\t/* Swap the maximum (0th) element from the page_objects into its place\n\t\t * in the sorted list (position i). */\n\t\tint tmp = po->object[0];\n\t\tpo->object[0] = po->object[i];\n\t\tpo->object[i] = tmp;\n\t\t/* Now, the page_objects is invalid because the 0th element is out\n\t\t * of place. Bubble it until the page_objects is valid. */\n\t\tj = 0;\n\t\twhile (1)\n\t\t{\n\t\t\t/* Children are k and k+1 */\n\t\t\tint k = (j+1)*2-1;\n\t\t\t/* If both children out of the page_objects, we're done */\n\t\t\tif (k > i-1)\n\t\t\t\tbreak;\n\t\t\t/* If both are in the page_objects, pick the larger one */\n\t\t\tif (k < i-1 && po->object[k] < po->object[k+1])\n\t\t\t\tk++;\n\t\t\t/* If j is bigger than k (i.e. both of it's children),\n\t\t\t * we're done */\n\t\t\tif (po->object[j] > po->object[k])\n\t\t\t\tbreak;\n\t\t\ttmp = po->object[k];\n\t\t\tpo->object[k] = po->object[j];\n\t\t\tpo->object[j] = tmp;\n\t\t\tj = k;\n\t\t}\n\t}\n}\n\nstatic int\norder_ge(int ui, int uj)\n{\n\t/*\n\tFor linearization, we need to order the sections as follows:\n\n\t\tRemaining pages\t\t\t\t\t(Part 7)\n\t\tShared objects\t\t\t\t\t(Part 8)\n\t\tObjects not associated with any page\t\t(Part 9)\n\t\tAny \"other\" objects\n\t\t\t\t\t\t\t(Header)(Part 1)\n\t\t(Linearization params)\t\t\t\t(Part 2)\n\t\t\t\t\t(1st page Xref/Trailer)\t(Part 3)\n\t\tCatalogue (and other document level objects)\t(Part 4)\n\t\tFirst page\t\t\t\t\t(Part 6)\n\t\t(Primary Hint stream)\t\t\t(*)\t(Part 5)\n\t\tAny free objects\n\n\tNote, this is NOT the same order they appear in\n\tthe final file!\n\n\t(*) The PDF reference gives us the option of putting the hint stream\n\tafter the first page, and we take it, for simplicity.\n\t*/\n\n\t/* If the 2 objects are in the same section, then page object comes first. */\n\tif (((ui ^ uj) & ~USE_PAGE_OBJECT) == 0)\n\t\treturn ((ui & USE_PAGE_OBJECT) == 0);\n\t/* Put unused objects last */\n\telse if (ui == 0)\n\t\treturn 1;\n\telse if (uj == 0)\n\t\treturn 0;\n\t/* Put the hint stream before that... */\n\telse if (ui & USE_HINTS)\n\t\treturn 1;\n\telse if (uj & USE_HINTS)\n\t\treturn 0;\n\t/* Put page 1 before that... */\n\telse if (ui & USE_PAGE1)\n\t\treturn 1;\n\telse if (uj & USE_PAGE1)\n\t\treturn 0;\n\t/* Put the catalogue before that... */\n\telse if (ui & USE_CATALOGUE)\n\t\treturn 1;\n\telse if (uj & USE_CATALOGUE)\n\t\treturn 0;\n\t/* Put the linearization params before that... */\n\telse if (ui & USE_PARAMS)\n\t\treturn 1;\n\telse if (uj & USE_PARAMS)\n\t\treturn 0;\n\t/* Put other objects before that */\n\telse if (ui & USE_OTHER_OBJECTS)\n\t\treturn 1;\n\telse if (uj & USE_OTHER_OBJECTS)\n\t\treturn 0;\n\t/* Put objects not associated with any page (anything\n\t * not touched by the catalogue) before that... */\n\telse if (ui == 0)\n\t\treturn 1;\n\telse if (uj == 0)\n\t\treturn 0;\n\t/* Put shared objects before that... */\n\telse if (ui & USE_SHARED)\n\t\treturn 1;\n\telse if (uj & USE_SHARED)\n\t\treturn 0;\n\t/* And otherwise, order by the page number on which\n\t * they are used. */\n\treturn (ui>>USE_PAGE_SHIFT) >= (uj>>USE_PAGE_SHIFT);\n}\n\nstatic void\nheap_sort(int *list, int n, const int *val, int (*ge)(int, int))\n{\n\tint i, j;\n\n#ifdef DEBUG_HEAP_SORT\n\tfprintf(stderr, \"Initially:\\n\");\n\tfor (i=0; i < n; i++)\n\t{\n\t\tfprintf(stderr, \"%d: %d %x\\n\", i, list[i], val[list[i]]);\n\t}\n#endif\n\t/* Step 1: Make a heap */\n\t/* Invariant: Valid heap in [0..i), unsorted elements in [i..n) */\n\tfor (i = 1; i < n; i++)\n\t{\n\t\t/* Now bubble backwards to maintain heap invariant */\n\t\tj = i;\n\t\twhile (j != 0)\n\t\t{\n\t\t\tint tmp;\n\t\t\tint k = (j-1)>>1;\n\t\t\tif (ge(val[list[k]], val[list[j]]))\n\t\t\t\tbreak;\n\t\t\ttmp = list[k];\n\t\t\tlist[k] = list[j];\n\t\t\tlist[j] = tmp;\n\t\t\tj = k;\n\t\t}\n\t}\n#ifdef DEBUG_HEAP_SORT\n\tfprintf(stderr, \"Valid heap:\\n\");\n\tfor (i=0; i < n; i++)\n\t{\n\t\tint k;\n\t\tfprintf(stderr, \"%d: %d %x \", i, list[i], val[list[i]]);\n\t\tk = (i+1)*2-1;\n\t\tif (k < n)\n\t\t{\n\t\t\tif (ge(val[list[i]], val[list[k]]))\n\t\t\t\tfprintf(stderr, \"OK \");\n\t\t\telse\n\t\t\t\tfprintf(stderr, \"BAD \");\n\t\t}\n\t\tif (k+1 < n)\n\t\t{\n\t\t\tif (ge(val[list[i]], val[list[k+1]]))\n\t\t\t\tfprintf(stderr, \"OK\\n\");\n\t\t\telse\n\t\t\t\tfprintf(stderr, \"BAD\\n\");\n\t\t}\n\t\telse\n\t\t\t\tfprintf(stderr, \"\\n\");\n\t}\n#endif\n\n\t/* Step 2: Heap sort */\n\t/* Invariant: valid heap in [0..i), sorted list in [i..n) */\n\t/* Initially: i = n */\n\tfor (i = n-1; i > 0; i--)\n\t{\n\t\t/* Swap the maximum (0th) element from the page_objects into its place\n\t\t * in the sorted list (position i). */\n\t\tint tmp = list[0];\n\t\tlist[0] = list[i];\n\t\tlist[i] = tmp;\n\t\t/* Now, the page_objects is invalid because the 0th element is out\n\t\t * of place. Bubble it until the page_objects is valid. */\n\t\tj = 0;\n\t\twhile (1)\n\t\t{\n\t\t\t/* Children are k and k+1 */\n\t\t\tint k = (j+1)*2-1;\n\t\t\t/* If both children out of the page_objects, we're done */\n\t\t\tif (k > i-1)\n\t\t\t\tbreak;\n\t\t\t/* If both are in the page_objects, pick the larger one */\n\t\t\tif (k < i-1 && ge(val[list[k+1]], val[list[k]]))\n\t\t\t\tk++;\n\t\t\t/* If j is bigger than k (i.e. both of it's children),\n\t\t\t * we're done */\n\t\t\tif (ge(val[list[j]], val[list[k]]))\n\t\t\t\tbreak;\n\t\t\ttmp = list[k];\n\t\t\tlist[k] = list[j];\n\t\t\tlist[j] = tmp;\n\t\t\tj = k;\n\t\t}\n\t}\n#ifdef DEBUG_HEAP_SORT\n\tfprintf(stderr, \"Sorted:\\n\");\n\tfor (i=0; i < n; i++)\n\t{\n\t\tfprintf(stderr, \"%d: %d %x \", i, list[i], val[list[i]]);\n\t\tif (i+1 < n)\n\t\t{\n\t\t\tif (ge(val[list[i+1]], val[list[i]]))\n\t\t\t\tfprintf(stderr, \"OK\");\n\t\t\telse\n\t\t\t\tfprintf(stderr, \"BAD\");\n\t\t}\n\t\tfprintf(stderr, \"\\n\");\n\t}\n#endif\n}\n\nstatic void\npage_objects_dedupe(fz_context *ctx, page_objects *po)\n{\n\tint i, j;\n\tint n = po->len-1;\n\n\tfor (i = 0; i < n; i++)\n\t{\n\t\tif (po->object[i] == po->object[i+1])\n\t\t\tbreak;\n\t}\n\tj = i; /* j points to the last valid one */\n\ti++; /* i points to the first one we haven't looked at */\n\tfor (; i < n; i++)\n\t{\n\t\tif (po->object[j] != po->object[i])\n\t\t\tpo->object[++j] = po->object[i];\n\t}\n\tpo->len = j+1;\n}\n\nstatic void\npage_objects_list_sort_and_dedupe(fz_context *ctx, page_objects_list *pol)\n{\n\tint i;\n\tint n = pol->len;\n\n\tfor (i = 0; i < n; i++)\n\t{\n\t\tpage_objects_sort(ctx, pol->page[i]);\n\t\tpage_objects_dedupe(ctx, pol->page[i]);\n\t}\n}\n\n#ifdef DEBUG_LINEARIZATION\nstatic void\npage_objects_dump(pdf_write_options *opts)\n{\n\tpage_objects_list *pol = opts->page_object_lists;\n\tint i, j;\n\n\tfor (i = 0; i < pol->len; i++)\n\t{\n\t\tpage_objects *p = pol->page[i];\n\t\tfprintf(stderr, \"Page %d\\n\", i+1);\n\t\tfor (j = 0; j < p->len; j++)\n\t\t{\n\t\t\tint o = p->object[j];\n\t\t\tfprintf(stderr, \"\\tObject %d: use=%x\\n\", o, opts->use_list[o]);\n\t\t}\n\t\tfprintf(stderr, \"Byte range=%d->%d\\n\", p->min_ofs, p->max_ofs);\n\t\tfprintf(stderr, \"Number of objects=%d, Number of shared objects=%d\\n\", p->num_objects, p->num_shared);\n\t\tfprintf(stderr, \"Page object number=%d\\n\", p->page_object_number);\n\t}\n}\n\nstatic void\nobjects_dump(pdf_document *doc, pdf_write_options *opts)\n{\n\tint i;\n\n\tfor (i=0; i < pdf_xref_len(doc); i++)\n\t{\n\t\tfprintf(stderr, \"Object %d use=%x offset=%d\\n\", i, opts->use_list[i], opts->ofs_list[i]);\n\t}\n}\n#endif\n\n/*\n * Garbage collect objects not reachable from the trailer.\n */\n\nstatic pdf_obj *sweepref(pdf_document *doc, pdf_write_options *opts, pdf_obj *obj)\n{\n\tint num = pdf_to_num(obj);\n\tint gen = pdf_to_gen(obj);\n\tfz_context *ctx = doc->ctx;\n\n\tif (num <= 0 || num >= pdf_xref_len(doc))\n\t\treturn NULL;\n\tif (opts->use_list[num])\n\t\treturn NULL;\n\n\topts->use_list[num] = 1;\n\n\t/* Bake in /Length in stream objects */\n\tfz_try(ctx)\n\t{\n\t\tif (pdf_is_stream(doc, num, gen))\n\t\t{\n\t\t\tpdf_obj *len = pdf_dict_gets(obj, \"Length\");\n\t\t\tif (pdf_is_indirect(len))\n\t\t\t{\n\t\t\t\topts->use_list[pdf_to_num(len)] = 0;\n\t\t\t\tlen = pdf_resolve_indirect(len);\n\t\t\t\tpdf_dict_puts(obj, \"Length\", len);\n\t\t\t}\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\t/* Leave broken */\n\t}\n\n\treturn pdf_resolve_indirect(obj);\n}\n\nstatic void sweepobj(pdf_document *doc, pdf_write_options *opts, pdf_obj *obj)\n{\n\tint i;\n\n\tif (pdf_is_indirect(obj))\n\t\tobj = sweepref(doc, opts, obj);\n\n\tif (pdf_is_dict(obj))\n\t{\n\t\tint n = pdf_dict_len(obj);\n\t\tfor (i = 0; i < n; i++)\n\t\t\tsweepobj(doc, opts, pdf_dict_get_val(obj, i));\n\t}\n\n\telse if (pdf_is_array(obj))\n\t{\n\t\tint n = pdf_array_len(obj);\n\t\tfor (i = 0; i < n; i++)\n\t\t\tsweepobj(doc, opts, pdf_array_get(obj, i));\n\t}\n}\n\n/*\n * Scan for and remove duplicate objects (slow)\n */\n\nstatic void removeduplicateobjs(pdf_document *doc, pdf_write_options *opts)\n{\n\tint num, other;\n\tfz_context *ctx = doc->ctx;\n\tint xref_len = pdf_xref_len(doc);\n\n\tfor (num = 1; num < xref_len; num++)\n\t{\n\t\t/* Only compare an object to objects preceding it */\n\t\tfor (other = 1; other < num; other++)\n\t\t{\n\t\t\tpdf_obj *a, *b;\n\t\t\tint differ, newnum, streama, streamb;\n\n\t\t\tif (num == other || !opts->use_list[num] || !opts->use_list[other])\n\t\t\t\tcontinue;\n\n\t\t\t/*\n\t\t\t * Comparing stream objects data contents would take too long.\n\t\t\t *\n\t\t\t * pdf_is_stream calls pdf_cache_object and ensures\n\t\t\t * that the xref table has the objects loaded.\n\t\t\t */\n\t\t\tfz_try(ctx)\n\t\t\t{\n\t\t\t\tstreama = pdf_is_stream(doc, num, 0);\n\t\t\t\tstreamb = pdf_is_stream(doc, other, 0);\n\t\t\t\tdiffer = streama || streamb;\n\t\t\t\tif (streama && streamb && opts->do_garbage >= 4)\n\t\t\t\t\tdiffer = 0;\n\t\t\t}\n\t\t\tfz_catch(ctx)\n\t\t\t{\n\t\t\t\t/* Assume different */\n\t\t\t\tdiffer = 1;\n\t\t\t}\n\t\t\tif (differ)\n\t\t\t\tcontinue;\n\n\t\t\ta = pdf_get_xref_entry(doc, num)->obj;\n\t\t\tb = pdf_get_xref_entry(doc, other)->obj;\n\n\t\t\ta = pdf_resolve_indirect(a);\n\t\t\tb = pdf_resolve_indirect(b);\n\n\t\t\tif (pdf_objcmp(a, b))\n\t\t\t\tcontinue;\n\n\t\t\tif (streama && streamb)\n\t\t\t{\n\t\t\t\t/* Check to see if streams match too. */\n\t\t\t\tfz_buffer *sa = NULL;\n\t\t\t\tfz_buffer *sb = NULL;\n\n\t\t\t\tfz_var(sa);\n\t\t\t\tfz_var(sb);\n\n\t\t\t\tdiffer = 1;\n\t\t\t\tfz_try(ctx)\n\t\t\t\t{\n\t\t\t\t\tunsigned char *dataa, *datab;\n\t\t\t\t\tint lena, lenb;\n\t\t\t\t\tsa = pdf_load_raw_renumbered_stream(doc, num, 0, num, 0);\n\t\t\t\t\tsb = pdf_load_raw_renumbered_stream(doc, other, 0, other, 0);\n\t\t\t\t\tlena = fz_buffer_storage(ctx, sa, &dataa);\n\t\t\t\t\tlenb = fz_buffer_storage(ctx, sb, &datab);\n\t\t\t\t\tif (lena == lenb && memcmp(dataa, datab, lena) == 0)\n\t\t\t\t\t\tdiffer = 0;\n\t\t\t\t}\n\t\t\t\tfz_always(ctx)\n\t\t\t\t{\n\t\t\t\t\tfz_drop_buffer(ctx, sa);\n\t\t\t\t\tfz_drop_buffer(ctx, sb);\n\t\t\t\t}\n\t\t\t\tfz_catch(ctx)\n\t\t\t\t{\n\t\t\t\t\tfz_rethrow(ctx);\n\t\t\t\t}\n\t\t\t\tif (differ)\n\t\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/* Keep the lowest numbered object */\n\t\t\tnewnum = fz_mini(num, other);\n\t\t\topts->renumber_map[num] = newnum;\n\t\t\topts->renumber_map[other] = newnum;\n\t\t\topts->rev_renumber_map[newnum] = num; /* Either will do */\n\t\t\topts->use_list[fz_maxi(num, other)] = 0;\n\n\t\t\t/* One duplicate was found, do not look for another */\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\n/*\n * Renumber objects sequentially so the xref is more compact\n *\n * This code assumes that any opts->renumber_map[n] <= n for all n.\n */\n\nstatic void compactxref(pdf_document *doc, pdf_write_options *opts)\n{\n\tint num, newnum;\n\tint xref_len = pdf_xref_len(doc);\n\n\t/*\n\t * Update renumber_map in-place, clustering all used\n\t * objects together at low object ids. Objects that\n\t * already should be renumbered will have their new\n\t * object ids be updated to reflect the compaction.\n\t */\n\n\tnewnum = 1;\n\tfor (num = 1; num < xref_len; num++)\n\t{\n\t\t/* If it's not used, map it to zero */\n\t\tif (!opts->use_list[opts->renumber_map[num]])\n\t\t{\n\t\t\topts->renumber_map[num] = 0;\n\t\t}\n\t\t/* If it's not moved, compact it. */\n\t\telse if (opts->renumber_map[num] == num)\n\t\t{\n\t\t\topts->rev_renumber_map[newnum] = opts->rev_renumber_map[num];\n\t\t\topts->rev_gen_list[newnum] = opts->rev_gen_list[num];\n\t\t\topts->renumber_map[num] = newnum++;\n\t\t}\n\t\t/* Otherwise it's used, and moved. We know that it must have\n\t\t * moved down, so the place it's moved to will be in the right\n\t\t * place already. */\n\t\telse\n\t\t{\n\t\t\topts->renumber_map[num] = opts->renumber_map[opts->renumber_map[num]];\n\t\t}\n\t}\n}\n\n/*\n * Update indirect objects according to renumbering established when\n * removing duplicate objects and compacting the xref.\n */\n\nstatic void renumberobj(pdf_document *doc, pdf_write_options *opts, pdf_obj *obj)\n{\n\tint i;\n\tint xref_len = pdf_xref_len(doc);\n\n\tif (pdf_is_dict(obj))\n\t{\n\t\tint n = pdf_dict_len(obj);\n\t\tfor (i = 0; i < n; i++)\n\t\t{\n\t\t\tpdf_obj *key = pdf_dict_get_key(obj, i);\n\t\t\tpdf_obj *val = pdf_dict_get_val(obj, i);\n\t\t\tif (pdf_is_indirect(val))\n\t\t\t{\n\t\t\t\tint o = pdf_to_num(val);\n\t\t\t\tif (o >= xref_len || o <= 0 || opts->renumber_map[o] == 0)\n\t\t\t\t\tval = pdf_new_null(doc);\n\t\t\t\telse\n\t\t\t\t\tval = pdf_new_indirect(doc, opts->renumber_map[o], 0);\n\t\t\t\tpdf_dict_put(obj, key, val);\n\t\t\t\tpdf_drop_obj(val);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\trenumberobj(doc, opts, val);\n\t\t\t}\n\t\t}\n\t}\n\n\telse if (pdf_is_array(obj))\n\t{\n\t\tint n = pdf_array_len(obj);\n\t\tfor (i = 0; i < n; i++)\n\t\t{\n\t\t\tpdf_obj *val = pdf_array_get(obj, i);\n\t\t\tif (pdf_is_indirect(val))\n\t\t\t{\n\t\t\t\tint o = pdf_to_num(val);\n\t\t\t\tif (o >= xref_len || o <= 0 || opts->renumber_map[o] == 0)\n\t\t\t\t\tval = pdf_new_null(doc);\n\t\t\t\telse\n\t\t\t\t\tval = pdf_new_indirect(doc, opts->renumber_map[o], 0);\n\t\t\t\tpdf_array_put(obj, i, val);\n\t\t\t\tpdf_drop_obj(val);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\trenumberobj(doc, opts, val);\n\t\t\t}\n\t\t}\n\t}\n}\n\nstatic void renumberobjs(pdf_document *doc, pdf_write_options *opts)\n{\n\tpdf_xref_entry *newxref = NULL;\n\tint newlen;\n\tint num;\n\tfz_context *ctx = doc->ctx;\n\tint *new_use_list;\n\tint xref_len = pdf_xref_len(doc);\n\n\tnew_use_list = fz_calloc(ctx, pdf_xref_len(doc)+3, sizeof(int));\n\n\tfz_var(newxref);\n\tfz_try(ctx)\n\t{\n\t\t/* Apply renumber map to indirect references in all objects in xref */\n\t\trenumberobj(doc, opts, pdf_trailer(doc));\n\t\tfor (num = 0; num < xref_len; num++)\n\t\t{\n\t\t\tpdf_obj *obj;\n\t\t\tint to = opts->renumber_map[num];\n\n\t\t\t/* If object is going to be dropped, don't bother renumbering */\n\t\t\tif (to == 0)\n\t\t\t\tcontinue;\n\n\t\t\tobj = pdf_get_xref_entry(doc, num)->obj;\n\n\t\t\tif (pdf_is_indirect(obj))\n\t\t\t{\n\t\t\t\tobj = pdf_new_indirect(doc, to, 0);\n\t\t\t\tpdf_update_object(doc, num, obj);\n\t\t\t\tpdf_drop_obj(obj);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\trenumberobj(doc, opts, obj);\n\t\t\t}\n\t\t}\n\n\t\t/* Create new table for the reordered, compacted xref */\n\t\tnewxref = fz_malloc_array(ctx, xref_len + 3, sizeof(pdf_xref_entry));\n\t\tnewxref[0] = *pdf_get_xref_entry(doc, 0);\n\n\t\t/* Move used objects into the new compacted xref */\n\t\tnewlen = 0;\n\t\tfor (num = 1; num < xref_len; num++)\n\t\t{\n\t\t\tif (opts->use_list[num])\n\t\t\t{\n\t\t\t\tpdf_xref_entry *e;\n\t\t\t\tif (newlen < opts->renumber_map[num])\n\t\t\t\t\tnewlen = opts->renumber_map[num];\n\t\t\t\te = pdf_get_xref_entry(doc, num);\n\t\t\t\tnewxref[opts->renumber_map[num]] = *e;\n\t\t\t\tif (e->obj)\n\t\t\t\t{\n\t\t\t\t\tpdf_set_obj_parent(e->obj, opts->renumber_map[num]);\n\t\t\t\t\te->obj = NULL;\n\t\t\t\t}\n\t\t\t\tnew_use_list[opts->renumber_map[num]] = opts->use_list[num];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpdf_xref_entry *e = pdf_get_xref_entry(doc, num);\n\t\t\t\tpdf_drop_obj(e->obj);\n\t\t\t\te->obj = NULL;\n\t\t\t}\n\t\t}\n\n\t\tpdf_replace_xref(doc, newxref, newlen + 1);\n\t\tnewxref = NULL;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, newxref);\n\t\tfz_free(ctx, new_use_list);\n\t\tfz_rethrow(ctx);\n\t}\n\tfz_free(ctx, opts->use_list);\n\topts->use_list = new_use_list;\n\n\tfor (num = 1; num < xref_len; num++)\n\t{\n\t\topts->renumber_map[num] = num;\n\t}\n}\n\nstatic void page_objects_list_renumber(pdf_write_options *opts)\n{\n\tint i, j;\n\n\tfor (i = 0; i < opts->page_object_lists->len; i++)\n\t{\n\t\tpage_objects *po = opts->page_object_lists->page[i];\n\t\tfor (j = 0; j < po->len; j++)\n\t\t{\n\t\t\tpo->object[j] = opts->renumber_map[po->object[j]];\n\t\t}\n\t\tpo->page_object_number = opts->renumber_map[po->page_object_number];\n\t}\n}\n\nstatic void\nmark_all(pdf_document *doc, pdf_write_options *opts, pdf_obj *val, int flag, int page)\n{\n\tfz_context *ctx = doc->ctx;\n\n\tif (pdf_mark_obj(val))\n\t\treturn;\n\n\tfz_try(ctx)\n\t{\n\t\tif (pdf_is_indirect(val))\n\t\t{\n\t\t\tint num = pdf_to_num(val);\n\t\t\tif (opts->use_list[num] & USE_PAGE_MASK)\n\t\t\t\t/* Already used */\n\t\t\t\topts->use_list[num] |= USE_SHARED;\n\t\t\telse\n\t\t\t\topts->use_list[num] |= flag;\n\t\t\tif (page >= 0)\n\t\t\t\tpage_objects_list_insert(ctx, opts, page, num);\n\t\t}\n\n\t\tif (pdf_is_dict(val))\n\t\t{\n\t\t\tint i, n = pdf_dict_len(val);\n\n\t\t\tfor (i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\tmark_all(doc, opts, pdf_dict_get_val(val, i), flag, page);\n\t\t\t}\n\t\t}\n\t\telse if (pdf_is_array(val))\n\t\t{\n\t\t\tint i, n = pdf_array_len(val);\n\n\t\t\tfor (i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\tmark_all(doc, opts, pdf_array_get(val, i), flag, page);\n\t\t\t}\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_unmark_obj(val);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic int\nmark_pages(pdf_document *doc, pdf_write_options *opts, pdf_obj *val, int pagenum)\n{\n\tfz_context *ctx = doc->ctx;\n\n\tif (pdf_mark_obj(val))\n\t\treturn pagenum;\n\n\tfz_try(ctx)\n\t{\n\t\tif (pdf_is_dict(val))\n\t\t{\n\t\t\tif (!strcmp(\"Page\", pdf_to_name(pdf_dict_gets(val, \"Type\"))))\n\t\t\t{\n\t\t\t\tint num = pdf_to_num(val);\n\t\t\t\tpdf_unmark_obj(val);\n\t\t\t\tmark_all(doc, opts, val, pagenum == 0 ? USE_PAGE1 : (pagenum<<USE_PAGE_SHIFT), pagenum);\n\t\t\t\tpage_objects_list_set_page_object(ctx, opts, pagenum, num);\n\t\t\t\tpagenum++;\n\t\t\t\topts->use_list[num] |= USE_PAGE_OBJECT;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tint i, n = pdf_dict_len(val);\n\n\t\t\t\tfor (i = 0; i < n; i++)\n\t\t\t\t{\n\t\t\t\t\tpdf_obj *key = pdf_dict_get_key(val, i);\n\t\t\t\t\tpdf_obj *obj = pdf_dict_get_val(val, i);\n\n\t\t\t\t\tif (!strcmp(\"Kids\", pdf_to_name(key)))\n\t\t\t\t\t\tpagenum = mark_pages(doc, opts, obj, pagenum);\n\t\t\t\t\telse\n\t\t\t\t\t\tmark_all(doc, opts, obj, USE_CATALOGUE, -1);\n\t\t\t\t}\n\n\t\t\t\tif (pdf_is_indirect(val))\n\t\t\t\t{\n\t\t\t\t\tint num = pdf_to_num(val);\n\t\t\t\t\topts->use_list[num] |= USE_CATALOGUE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if (pdf_is_array(val))\n\t\t{\n\t\t\tint i, n = pdf_array_len(val);\n\n\t\t\tfor (i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\tpagenum = mark_pages(doc, opts, pdf_array_get(val, i), pagenum);\n\t\t\t}\n\t\t\tif (pdf_is_indirect(val))\n\t\t\t{\n\t\t\t\tint num = pdf_to_num(val);\n\t\t\t\topts->use_list[num] |= USE_CATALOGUE;\n\t\t\t}\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_unmark_obj(val);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\treturn pagenum;\n}\n\nstatic void\nmark_root(pdf_document *doc, pdf_write_options *opts, pdf_obj *dict)\n{\n\tfz_context *ctx = doc->ctx;\n\tint i, n = pdf_dict_len(dict);\n\n\tif (pdf_mark_obj(dict))\n\t\treturn;\n\n\tfz_try(ctx)\n\t{\n\t\tif (pdf_is_indirect(dict))\n\t\t{\n\t\t\tint num = pdf_to_num(dict);\n\t\t\topts->use_list[num] |= USE_CATALOGUE;\n\t\t}\n\n\t\tfor (i = 0; i < n; i++)\n\t\t{\n\t\t\tchar *key = pdf_to_name(pdf_dict_get_key(dict, i));\n\t\t\tpdf_obj *val = pdf_dict_get_val(dict, i);\n\n\t\t\tif (!strcmp(\"Pages\", key))\n\t\t\t\topts->page_count = mark_pages(doc, opts, val, 0);\n\t\t\telse if (!strcmp(\"Names\", key))\n\t\t\t\tmark_all(doc, opts, val, USE_OTHER_OBJECTS, -1);\n\t\t\telse if (!strcmp(\"Dests\", key))\n\t\t\t\tmark_all(doc, opts, val, USE_OTHER_OBJECTS, -1);\n\t\t\telse if (!strcmp(\"Outlines\", key))\n\t\t\t{\n\t\t\t\tint section;\n\t\t\t\t/* Look at PageMode to decide whether to\n\t\t\t\t * USE_OTHER_OBJECTS or USE_PAGE1 here. */\n\t\t\t\tif (strcmp(pdf_to_name(pdf_dict_gets(dict, \"PageMode\")), \"UseOutlines\") == 0)\n\t\t\t\t\tsection = USE_PAGE1;\n\t\t\t\telse\n\t\t\t\t\tsection = USE_OTHER_OBJECTS;\n\t\t\t\tmark_all(doc, opts, val, section, -1);\n\t\t\t}\n\t\t\telse\n\t\t\t\tmark_all(doc, opts, val, USE_CATALOGUE, -1);\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_unmark_obj(dict);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void\nmark_trailer(pdf_document *doc, pdf_write_options *opts, pdf_obj *dict)\n{\n\tfz_context *ctx = doc->ctx;\n\tint i, n = pdf_dict_len(dict);\n\n\tif (pdf_mark_obj(dict))\n\t\treturn;\n\n\tfz_try(ctx)\n\t{\n\t\tfor (i = 0; i < n; i++)\n\t\t{\n\t\t\tchar *key = pdf_to_name(pdf_dict_get_key(dict, i));\n\t\t\tpdf_obj *val = pdf_dict_get_val(dict, i);\n\n\t\t\tif (!strcmp(\"Root\", key))\n\t\t\t\tmark_root(doc, opts, val);\n\t\t\telse\n\t\t\t\tmark_all(doc, opts, val, USE_CATALOGUE, -1);\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_unmark_obj(dict);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void\nadd_linearization_objs(pdf_document *doc, pdf_write_options *opts)\n{\n\tpdf_obj *params_obj = NULL;\n\tpdf_obj *params_ref = NULL;\n\tpdf_obj *hint_obj = NULL;\n\tpdf_obj *hint_ref = NULL;\n\tpdf_obj *o = NULL;\n\tint params_num, hint_num;\n\tfz_context *ctx = doc->ctx;\n\n\tfz_var(params_obj);\n\tfz_var(params_ref);\n\tfz_var(hint_obj);\n\tfz_var(hint_ref);\n\tfz_var(o);\n\n\tfz_try(ctx)\n\t{\n\t\t/* Linearization params */\n\t\tparams_obj = pdf_new_dict(doc, 10);\n\t\tparams_ref = pdf_new_ref(doc, params_obj);\n\t\tparams_num = pdf_to_num(params_ref);\n\n\t\topts->use_list[params_num] = USE_PARAMS;\n\t\topts->renumber_map[params_num] = params_num;\n\t\topts->rev_renumber_map[params_num] = params_num;\n\t\topts->gen_list[params_num] = 0;\n\t\topts->rev_gen_list[params_num] = 0;\n\t\tpdf_dict_puts_drop(params_obj, \"Linearized\", pdf_new_real(doc, 1.0));\n\t\topts->linear_l = pdf_new_int(doc, INT_MIN);\n\t\tpdf_dict_puts(params_obj, \"L\", opts->linear_l);\n\t\topts->linear_h0 = pdf_new_int(doc, INT_MIN);\n\t\to = pdf_new_array(doc, 2);\n\t\tpdf_array_push(o, opts->linear_h0);\n\t\topts->linear_h1 = pdf_new_int(doc, INT_MIN);\n\t\tpdf_array_push(o, opts->linear_h1);\n\t\tpdf_dict_puts_drop(params_obj, \"H\", o);\n\t\to = NULL;\n\t\topts->linear_o = pdf_new_int(doc, INT_MIN);\n\t\tpdf_dict_puts(params_obj, \"O\", opts->linear_o);\n\t\topts->linear_e = pdf_new_int(doc, INT_MIN);\n\t\tpdf_dict_puts(params_obj, \"E\", opts->linear_e);\n\t\topts->linear_n = pdf_new_int(doc, INT_MIN);\n\t\tpdf_dict_puts(params_obj, \"N\", opts->linear_n);\n\t\topts->linear_t = pdf_new_int(doc, INT_MIN);\n\t\tpdf_dict_puts(params_obj, \"T\", opts->linear_t);\n\n\t\t/* Primary hint stream */\n\t\thint_obj = pdf_new_dict(doc, 10);\n\t\thint_ref = pdf_new_ref(doc, hint_obj);\n\t\thint_num = pdf_to_num(hint_ref);\n\n\t\topts->use_list[hint_num] = USE_HINTS;\n\t\topts->renumber_map[hint_num] = hint_num;\n\t\topts->rev_renumber_map[hint_num] = hint_num;\n\t\topts->gen_list[hint_num] = 0;\n\t\topts->rev_gen_list[hint_num] = 0;\n\t\tpdf_dict_puts_drop(hint_obj, \"P\", pdf_new_int(doc, 0));\n\t\topts->hints_s = pdf_new_int(doc, INT_MIN);\n\t\tpdf_dict_puts(hint_obj, \"S\", opts->hints_s);\n\t\t/* FIXME: Do we have thumbnails? Do a T entry */\n\t\t/* FIXME: Do we have outlines? Do an O entry */\n\t\t/* FIXME: Do we have article threads? Do an A entry */\n\t\t/* FIXME: Do we have named destinations? Do a E entry */\n\t\t/* FIXME: Do we have interactive forms? Do a V entry */\n\t\t/* FIXME: Do we have document information? Do an I entry */\n\t\t/* FIXME: Do we have logical structure heirarchy? Do a C entry */\n\t\t/* FIXME: Do L, Page Label hint table */\n\t\tpdf_dict_puts_drop(hint_obj, \"Filter\", pdf_new_name(doc, \"FlateDecode\"));\n\t\topts->hints_length = pdf_new_int(doc, INT_MIN);\n\t\tpdf_dict_puts(hint_obj, \"Length\", opts->hints_length);\n\t\tpdf_get_xref_entry(doc, hint_num)->stm_ofs = -1;\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(params_obj);\n\t\tpdf_drop_obj(params_ref);\n\t\tpdf_drop_obj(hint_ref);\n\t\tpdf_drop_obj(hint_obj);\n\t\tpdf_drop_obj(o);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void\nlpr_inherit_res_contents(fz_context *ctx, pdf_obj *res, pdf_obj *dict, char *text)\n{\n\tpdf_obj *o, *r;\n\tint i, n;\n\n\t/* If the parent node doesn't have an entry of this type, give up. */\n\to = pdf_dict_gets(dict, text);\n\tif (!o)\n\t\treturn;\n\n\t/* If the resources dict we are building doesn't have an entry of this\n\t * type yet, then just copy it (ensuring it's not a reference) */\n\tr = pdf_dict_gets(res, text);\n\tif (r == NULL)\n\t{\n\t\to = pdf_resolve_indirect(o);\n\t\tif (pdf_is_dict(o))\n\t\t\to = pdf_copy_dict(o);\n\t\telse if (pdf_is_array(o))\n\t\t\to = pdf_copy_array(o);\n\t\telse\n\t\t\to = NULL;\n\t\tif (o)\n\t\t\tpdf_dict_puts(res, text, o);\n\t\treturn;\n\t}\n\n\t/* Otherwise we need to merge o into r */\n\tif (pdf_is_dict(o))\n\t{\n\t\tn = pdf_dict_len(o);\n\t\tfor (i = 0; i < n; i++)\n\t\t{\n\t\t\tpdf_obj *key = pdf_dict_get_key(o, i);\n\t\t\tpdf_obj *val = pdf_dict_get_val(o, i);\n\n\t\t\tif (pdf_dict_gets(res, pdf_to_name(key)))\n\t\t\t\tcontinue;\n\t\t\tpdf_dict_puts(res, pdf_to_name(key), val);\n\t\t}\n\t}\n}\n\nstatic void\nlpr_inherit_res(fz_context *ctx, pdf_obj *node, int depth, pdf_obj *dict)\n{\n\twhile (1)\n\t{\n\t\tpdf_obj *o;\n\n\t\tnode = pdf_dict_gets(node, \"Parent\");\n\t\tdepth--;\n\t\tif (!node || depth < 0)\n\t\t\tbreak;\n\n\t\to = pdf_dict_gets(node, \"Resources\");\n\t\tif (o)\n\t\t{\n\t\t\tlpr_inherit_res_contents(ctx, dict, o, \"ExtGState\");\n\t\t\tlpr_inherit_res_contents(ctx, dict, o, \"ColorSpace\");\n\t\t\tlpr_inherit_res_contents(ctx, dict, o, \"Pattern\");\n\t\t\tlpr_inherit_res_contents(ctx, dict, o, \"Shading\");\n\t\t\tlpr_inherit_res_contents(ctx, dict, o, \"XObject\");\n\t\t\tlpr_inherit_res_contents(ctx, dict, o, \"Font\");\n\t\t\tlpr_inherit_res_contents(ctx, dict, o, \"ProcSet\");\n\t\t\tlpr_inherit_res_contents(ctx, dict, o, \"Properties\");\n\t\t}\n\t}\n}\n\nstatic pdf_obj *\nlpr_inherit(fz_context *ctx, pdf_obj *node, char *text, int depth)\n{\n\tdo\n\t{\n\t\tpdf_obj *o = pdf_dict_gets(node, text);\n\n\t\tif (o)\n\t\t\treturn pdf_resolve_indirect(o);\n\t\tnode = pdf_dict_gets(node, \"Parent\");\n\t\tdepth--;\n\t}\n\twhile (depth >= 0 && node);\n\n\treturn NULL;\n}\n\nstatic int\nlpr(pdf_document *doc, pdf_obj *node, int depth, int page)\n{\n\tpdf_obj *kids;\n\tpdf_obj *o = NULL;\n\tint i, n;\n\tfz_context *ctx = doc->ctx;\n\n\tif (pdf_mark_obj(node))\n\t\treturn page;\n\n\tfz_var(o);\n\n\tfz_try(ctx)\n\t{\n\t\tif (!strcmp(\"Page\", pdf_to_name(pdf_dict_gets(node, \"Type\"))))\n\t\t{\n\t\t\tpdf_obj *r; /* r is deliberately not cleaned up */\n\n\t\t\t/* Copy resources down to the child */\n\t\t\to = pdf_keep_obj(pdf_dict_gets(node, \"Resources\"));\n\t\t\tif (!o)\n\t\t\t{\n\t\t\t\to = pdf_keep_obj(pdf_new_dict(doc, 2));\n\t\t\t\tpdf_dict_puts(node, \"Resources\", o);\n\t\t\t}\n\t\t\tlpr_inherit_res(ctx, node, depth, o);\n\t\t\tr = lpr_inherit(ctx, node, \"MediaBox\", depth);\n\t\t\tif (r)\n\t\t\t\tpdf_dict_puts(node, \"MediaBox\", r);\n\t\t\tr = lpr_inherit(ctx, node, \"CropBox\", depth);\n\t\t\tif (r)\n\t\t\t\tpdf_dict_puts(node, \"CropBox\", r);\n\t\t\tr = lpr_inherit(ctx, node, \"BleedBox\", depth);\n\t\t\tif (r)\n\t\t\t\tpdf_dict_puts(node, \"BleedBox\", r);\n\t\t\tr = lpr_inherit(ctx, node, \"TrimBox\", depth);\n\t\t\tif (r)\n\t\t\t\tpdf_dict_puts(node, \"TrimBox\", r);\n\t\t\tr = lpr_inherit(ctx, node, \"ArtBox\", depth);\n\t\t\tif (r)\n\t\t\t\tpdf_dict_puts(node, \"ArtBox\", r);\n\t\t\tr = lpr_inherit(ctx, node, \"Rotate\", depth);\n\t\t\tif (r)\n\t\t\t\tpdf_dict_puts(node, \"Rotate\", r);\n\t\t\tpage++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tkids = pdf_dict_gets(node, \"Kids\");\n\t\t\tn = pdf_array_len(kids);\n\t\t\tfor(i = 0; i < n; i++)\n\t\t\t{\n\t\t\t\tpage = lpr(doc, pdf_array_get(kids, i), depth+1, page);\n\t\t\t}\n\t\t\tpdf_dict_dels(node, \"Resources\");\n\t\t\tpdf_dict_dels(node, \"MediaBox\");\n\t\t\tpdf_dict_dels(node, \"CropBox\");\n\t\t\tpdf_dict_dels(node, \"BleedBox\");\n\t\t\tpdf_dict_dels(node, \"TrimBox\");\n\t\t\tpdf_dict_dels(node, \"ArtBox\");\n\t\t\tpdf_dict_dels(node, \"Rotate\");\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(o);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\tpdf_unmark_obj(node);\n\n\treturn page;\n}\n\nvoid\npdf_localise_page_resources(pdf_document *doc)\n{\n\tif (doc->resources_localised)\n\t\treturn;\n\n\tlpr(doc, pdf_dict_getp(pdf_trailer(doc), \"Root/Pages\"), 0, 0);\n\n\tdoc->resources_localised = 1;\n}\n\nstatic void\nlinearize(pdf_document *doc, pdf_write_options *opts)\n{\n\tint i;\n\tint n = pdf_xref_len(doc) + 2;\n\tint *reorder;\n\tint *rev_renumber_map;\n\tint *rev_gen_list;\n\tfz_context *ctx = doc->ctx;\n\n\topts->page_object_lists = page_objects_list_create(ctx);\n\n\t/* Ensure that every page has local references of its resources */\n\t/* FIXME: We could 'thin' the resources according to what is actually\n\t * required for each page, but this would require us to run the page\n\t * content streams. */\n\tpdf_localise_page_resources(doc);\n\n\t/* Walk the objects for each page, marking which ones are used, where */\n\tmemset(opts->use_list, 0, n * sizeof(int));\n\tmark_trailer(doc, opts, pdf_trailer(doc));\n\n\t/* Add new objects required for linearization */\n\tadd_linearization_objs(doc, opts);\n\n#ifdef DEBUG_WRITING\n\tfprintf(stderr, \"Usage calculated:\\n\");\n\tfor (i=0; i < pdf_xref_len(doc); i++)\n\t{\n\t\tfprintf(stderr, \"%d: use=%d\\n\", i, opts->use_list[i]);\n\t}\n#endif\n\n\t/* Allocate/init the structures used for renumbering the objects */\n\treorder = fz_calloc(ctx, n, sizeof(int));\n\trev_renumber_map = fz_calloc(ctx, n, sizeof(int));\n\trev_gen_list = fz_calloc(ctx, n, sizeof(int));\n\tfor (i = 0; i < n; i++)\n\t{\n\t\treorder[i] = i;\n\t}\n\n\t/* Heap sort the reordering */\n\theap_sort(reorder+1, n-1, opts->use_list, &order_ge);\n\n#ifdef DEBUG_WRITING\n\tfprintf(stderr, \"Reordered:\\n\");\n\tfor (i=1; i < pdf_xref_len(doc); i++)\n\t{\n\t\tfprintf(stderr, \"%d: use=%d\\n\", i, opts->use_list[reorder[i]]);\n\t}\n#endif\n\n\t/* Find the split point */\n\tfor (i = 1; (opts->use_list[reorder[i]] & USE_PARAMS) == 0; i++);\n\topts->start = i;\n\n\t/* Roll the reordering into the renumber_map */\n\tfor (i = 0; i < n; i++)\n\t{\n\t\topts->renumber_map[reorder[i]] = i;\n\t\trev_renumber_map[i] = opts->rev_renumber_map[reorder[i]];\n\t\trev_gen_list[i] = opts->rev_gen_list[reorder[i]];\n\t}\n\tfz_free(ctx, opts->rev_renumber_map);\n\tfz_free(ctx, opts->rev_gen_list);\n\topts->rev_renumber_map = rev_renumber_map;\n\topts->rev_gen_list = rev_gen_list;\n\tfz_free(ctx, reorder);\n\n\t/* Apply the renumber_map */\n\tpage_objects_list_renumber(opts);\n\trenumberobjs(doc, opts);\n\n\tpage_objects_list_sort_and_dedupe(ctx, opts->page_object_lists);\n}\n\nstatic void\nupdate_linearization_params(pdf_document *doc, pdf_write_options *opts)\n{\n\tint offset;\n\tpdf_set_int(opts->linear_l, opts->file_len);\n\t/* Primary hint stream offset (of object, not stream!) */\n\tpdf_set_int(opts->linear_h0, opts->ofs_list[pdf_xref_len(doc)-1]);\n\t/* Primary hint stream length (of object, not stream!) */\n\toffset = (opts->start == 1 ? opts->main_xref_offset : opts->ofs_list[1] + opts->hintstream_len);\n\tpdf_set_int(opts->linear_h1, offset - opts->ofs_list[pdf_xref_len(doc)-1]);\n\t/* Object number of first pages page object (the first object of page 0) */\n\tpdf_set_int(opts->linear_o, opts->page_object_lists->page[0]->object[0]);\n\t/* Offset of end of first page (first page is followed by primary\n\t * hint stream (object n-1) then remaining pages (object 1...). The\n\t * primary hint stream counts as part of the first pages data, I think.\n\t */\n\toffset = (opts->start == 1 ? opts->main_xref_offset : opts->ofs_list[1] + opts->hintstream_len);\n\tpdf_set_int(opts->linear_e, offset);\n\t/* Number of pages in document */\n\tpdf_set_int(opts->linear_n, opts->page_count);\n\t/* Offset of first entry in main xref table */\n\tpdf_set_int(opts->linear_t, opts->first_xref_entry_offset + opts->hintstream_len);\n\t/* Offset of shared objects hint table in the primary hint stream */\n\tpdf_set_int(opts->hints_s, opts->hints_shared_offset);\n\t/* Primary hint stream length */\n\tpdf_set_int(opts->hints_length, opts->hintstream_len);\n}\n\n/*\n * Make sure we have loaded objects from object streams.\n */\n\nstatic void preloadobjstms(pdf_document *doc)\n{\n\tpdf_obj *obj;\n\tint num;\n\tint xref_len = pdf_xref_len(doc);\n\n\tfor (num = 0; num < xref_len; num++)\n\t{\n\t\tif (pdf_get_xref_entry(doc, num)->type == 'o')\n\t\t{\n\t\t\tobj = pdf_load_object(doc, num, 0);\n\t\t\tpdf_drop_obj(obj);\n\t\t}\n\t}\n}\n\n/*\n * Save streams and objects to the output\n */\n\nstatic inline int isbinary(int c)\n{\n\tif (c == '\\n' || c == '\\r' || c == '\\t')\n\t\treturn 0;\n\treturn c < 32 || c > 127;\n}\n\nstatic int isbinarystream(fz_buffer *buf)\n{\n\tint i;\n\tfor (i = 0; i < buf->len; i++)\n\t\tif (isbinary(buf->data[i]))\n\t\t\treturn 1;\n\treturn 0;\n}\n\nstatic fz_buffer *hexbuf(fz_context *ctx, unsigned char *p, int n)\n{\n\tstatic const char hex[17] = \"0123456789abcdef\";\n\tfz_buffer *buf;\n\tint x = 0;\n\n\tbuf = fz_new_buffer(ctx, n * 2 + (n / 32) + 2);\n\n\twhile (n--)\n\t{\n\t\tbuf->data[buf->len++] = hex[*p >> 4];\n\t\tbuf->data[buf->len++] = hex[*p & 15];\n\t\tif (++x == 32)\n\t\t{\n\t\t\tbuf->data[buf->len++] = '\\n';\n\t\t\tx = 0;\n\t\t}\n\t\tp++;\n\t}\n\n\tbuf->data[buf->len++] = '>';\n\tbuf->data[buf->len++] = '\\n';\n\n\treturn buf;\n}\n\nstatic void addhexfilter(pdf_document *doc, pdf_obj *dict)\n{\n\tpdf_obj *f, *dp, *newf, *newdp;\n\tpdf_obj *ahx, *nullobj;\n\n\tahx = pdf_new_name(doc, \"ASCIIHexDecode\");\n\tnullobj = pdf_new_null(doc);\n\tnewf = newdp = NULL;\n\n\tf = pdf_dict_gets(dict, \"Filter\");\n\tdp = pdf_dict_gets(dict, \"DecodeParms\");\n\n\tif (pdf_is_name(f))\n\t{\n\t\tnewf = pdf_new_array(doc, 2);\n\t\tpdf_array_push(newf, ahx);\n\t\tpdf_array_push(newf, f);\n\t\tf = newf;\n\t\tif (pdf_is_dict(dp))\n\t\t{\n\t\t\tnewdp = pdf_new_array(doc, 2);\n\t\t\tpdf_array_push(newdp, nullobj);\n\t\t\tpdf_array_push(newdp, dp);\n\t\t\tdp = newdp;\n\t\t}\n\t}\n\telse if (pdf_is_array(f))\n\t{\n\t\tpdf_array_insert(f, ahx, 0);\n\t\tif (pdf_is_array(dp))\n\t\t\tpdf_array_insert(dp, nullobj, 0);\n\t}\n\telse\n\t\tf = ahx;\n\n\tpdf_dict_puts(dict, \"Filter\", f);\n\tif (dp)\n\t\tpdf_dict_puts(dict, \"DecodeParms\", dp);\n\n\tpdf_drop_obj(ahx);\n\tpdf_drop_obj(nullobj);\n\tpdf_drop_obj(newf);\n\tpdf_drop_obj(newdp);\n}\n\nstatic void copystream(pdf_document *doc, pdf_write_options *opts, pdf_obj *obj_orig, int num, int gen)\n{\n\tfz_buffer *buf, *tmp;\n\tpdf_obj *newlen;\n\tpdf_obj *obj;\n\tfz_context *ctx = doc->ctx;\n\tint orig_num = opts->rev_renumber_map[num];\n\tint orig_gen = opts->rev_gen_list[num];\n\n\tbuf = pdf_load_raw_renumbered_stream(doc, num, gen, orig_num, orig_gen);\n\n\tobj = pdf_copy_dict(obj_orig);\n\tif (opts->do_ascii && isbinarystream(buf))\n\t{\n\t\ttmp = hexbuf(ctx, buf->data, buf->len);\n\t\tfz_drop_buffer(ctx, buf);\n\t\tbuf = tmp;\n\n\t\taddhexfilter(doc, obj);\n\n\t\tnewlen = pdf_new_int(doc, buf->len);\n\t\tpdf_dict_puts(obj, \"Length\", newlen);\n\t\tpdf_drop_obj(newlen);\n\t}\n\n\tfprintf(opts->out, \"%d %d obj\\n\", num, gen);\n\tpdf_fprint_obj(opts->out, obj, opts->do_expand == 0);\n\tfprintf(opts->out, \"stream\\n\");\n\tfwrite(buf->data, 1, buf->len, opts->out);\n\tfprintf(opts->out, \"endstream\\nendobj\\n\\n\");\n\n\tfz_drop_buffer(ctx, buf);\n\tpdf_drop_obj(obj);\n}\n\nstatic void expandstream(pdf_document *doc, pdf_write_options *opts, pdf_obj *obj_orig, int num, int gen)\n{\n\tfz_buffer *buf, *tmp;\n\tpdf_obj *newlen;\n\tpdf_obj *obj;\n\tfz_context *ctx = doc->ctx;\n\tint orig_num = opts->rev_renumber_map[num];\n\tint orig_gen = opts->rev_gen_list[num];\n\tint truncated = 0;\n\n\tbuf = pdf_load_renumbered_stream(doc, num, gen, orig_num, orig_gen, (opts->continue_on_error ? &truncated : NULL));\n\tif (truncated && opts->errors)\n\t\t(*opts->errors)++;\n\n\tobj = pdf_copy_dict(obj_orig);\n\tpdf_dict_dels(obj, \"Filter\");\n\tpdf_dict_dels(obj, \"DecodeParms\");\n\n\tif (opts->do_ascii && isbinarystream(buf))\n\t{\n\t\ttmp = hexbuf(ctx, buf->data, buf->len);\n\t\tfz_drop_buffer(ctx, buf);\n\t\tbuf = tmp;\n\n\t\taddhexfilter(doc, obj);\n\t}\n\n\tnewlen = pdf_new_int(doc, buf->len);\n\tpdf_dict_puts(obj, \"Length\", newlen);\n\tpdf_drop_obj(newlen);\n\n\tfprintf(opts->out, \"%d %d obj\\n\", num, gen);\n\tpdf_fprint_obj(opts->out, obj, opts->do_expand == 0);\n\tfprintf(opts->out, \"stream\\n\");\n\tfwrite(buf->data, 1, buf->len, opts->out);\n\tfprintf(opts->out, \"endstream\\nendobj\\n\\n\");\n\n\tfz_drop_buffer(ctx, buf);\n\tpdf_drop_obj(obj);\n}\n\nstatic int is_image_filter(char *s)\n{\n\tif (!strcmp(s, \"CCITTFaxDecode\") || !strcmp(s, \"CCF\") ||\n\t\t!strcmp(s, \"DCTDecode\") || !strcmp(s, \"DCT\") ||\n\t\t!strcmp(s, \"RunLengthDecode\") || !strcmp(s, \"RL\") ||\n\t\t!strcmp(s, \"JBIG2Decode\") ||\n\t\t!strcmp(s, \"JPXDecode\"))\n\t\treturn 1;\n\treturn 0;\n}\n\nstatic int filter_implies_image(pdf_document *doc, pdf_obj *o)\n{\n\tif (!o)\n\t\treturn 0;\n\tif (pdf_is_name(o))\n\t\treturn is_image_filter(pdf_to_name(o));\n\tif (pdf_is_array(o))\n\t{\n\t\tint i, len;\n\t\tlen = pdf_array_len(o);\n\t\tfor (i = 0; i < len; i++)\n\t\t\tif (is_image_filter(pdf_to_name(pdf_array_get(o, i))))\n\t\t\t\treturn 1;\n\t}\n\treturn 0;\n}\n\nstatic void writeobject(pdf_document *doc, pdf_write_options *opts, int num, int gen, int skip_xrefs)\n{\n\tpdf_xref_entry *entry;\n\tpdf_obj *obj;\n\tpdf_obj *type;\n\tfz_context *ctx = doc->ctx;\n\n\tfz_try(ctx)\n\t{\n\t\tobj = pdf_load_object(doc, num, gen);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\tif (opts->continue_on_error)\n\t\t{\n\t\t\tfprintf(opts->out, \"%d %d obj\\nnull\\nendobj\\n\", num, gen);\n\t\t\tif (opts->errors)\n\t\t\t\t(*opts->errors)++;\n\t\t\tfz_warn(ctx, \"%s\", fz_caught_message(ctx));\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t\tfz_rethrow(ctx);\n\t}\n\n\t/* skip ObjStm and XRef objects */\n\tif (pdf_is_dict(obj))\n\t{\n\t\ttype = pdf_dict_gets(obj, \"Type\");\n\t\tif (pdf_is_name(type) && !strcmp(pdf_to_name(type), \"ObjStm\"))\n\t\t{\n\t\t\topts->use_list[num] = 0;\n\t\t\tpdf_drop_obj(obj);\n\t\t\treturn;\n\t\t}\n\t\tif (skip_xrefs && pdf_is_name(type) && !strcmp(pdf_to_name(type), \"XRef\"))\n\t\t{\n\t\t\topts->use_list[num] = 0;\n\t\t\tpdf_drop_obj(obj);\n\t\t\treturn;\n\t\t}\n\t}\n\n\tentry = pdf_get_xref_entry(doc, num);\n\tif (!pdf_is_stream(doc, num, gen))\n\t{\n\t\tfprintf(opts->out, \"%d %d obj\\n\", num, gen);\n\t\tpdf_fprint_obj(opts->out, obj, opts->do_expand == 0);\n\t\tfprintf(opts->out, \"endobj\\n\\n\");\n\t}\n\telse if (entry->stm_ofs < 0 && entry->stm_buf == NULL)\n\t{\n\t\tfprintf(opts->out, \"%d %d obj\\n\", num, gen);\n\t\tpdf_fprint_obj(opts->out, obj, opts->do_expand == 0);\n\t\tfprintf(opts->out, \"stream\\nendstream\\nendobj\\n\\n\");\n\t}\n\telse\n\t{\n\t\tint dontexpand = 0;\n\t\tif (opts->do_expand != 0 && opts->do_expand != fz_expand_all)\n\t\t{\n\t\t\tpdf_obj *o;\n\n\t\t\tif ((o = pdf_dict_gets(obj, \"Type\"), !strcmp(pdf_to_name(o), \"XObject\")) &&\n\t\t\t\t(o = pdf_dict_gets(obj, \"Subtype\"), !strcmp(pdf_to_name(o), \"Image\")))\n\t\t\t\tdontexpand = !(opts->do_expand & fz_expand_images);\n\t\t\tif (o = pdf_dict_gets(obj, \"Type\"), !strcmp(pdf_to_name(o), \"Font\"))\n\t\t\t\tdontexpand = !(opts->do_expand & fz_expand_fonts);\n\t\t\tif (o = pdf_dict_gets(obj, \"Type\"), !strcmp(pdf_to_name(o), \"FontDescriptor\"))\n\t\t\t\tdontexpand = !(opts->do_expand & fz_expand_fonts);\n\t\t\tif (pdf_dict_gets(obj, \"Length1\") != NULL)\n\t\t\t\tdontexpand = !(opts->do_expand & fz_expand_fonts);\n\t\t\tif (pdf_dict_gets(obj, \"Length2\") != NULL)\n\t\t\t\tdontexpand = !(opts->do_expand & fz_expand_fonts);\n\t\t\tif (pdf_dict_gets(obj, \"Length3\") != NULL)\n\t\t\t\tdontexpand = !(opts->do_expand & fz_expand_fonts);\n\t\t\tif (o = pdf_dict_gets(obj, \"Subtype\"), !strcmp(pdf_to_name(o), \"Type1C\"))\n\t\t\t\tdontexpand = !(opts->do_expand & fz_expand_fonts);\n\t\t\tif (o = pdf_dict_gets(obj, \"Subtype\"), !strcmp(pdf_to_name(o), \"CIDFontType0C\"))\n\t\t\t\tdontexpand = !(opts->do_expand & fz_expand_fonts);\n\t\t\tif (o = pdf_dict_gets(obj, \"Filter\"), filter_implies_image(doc, o))\n\t\t\t\tdontexpand = !(opts->do_expand & fz_expand_images);\n\t\t\tif (pdf_dict_gets(obj, \"Width\") != NULL && pdf_dict_gets(obj, \"Height\") != NULL)\n\t\t\t\tdontexpand = !(opts->do_expand & fz_expand_images);\n\t\t}\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tif (opts->do_expand && !dontexpand && !pdf_is_jpx_image(ctx, obj))\n\t\t\t\texpandstream(doc, opts, obj, num, gen);\n\t\t\telse\n\t\t\t\tcopystream(doc, opts, obj, num, gen);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\t\tif (opts->continue_on_error)\n\t\t\t{\n\t\t\t\tfprintf(opts->out, \"%d %d obj\\nnull\\nendobj\\n\", num, gen);\n\t\t\t\tif (opts->errors)\n\t\t\t\t\t(*opts->errors)++;\n\t\t\t\tfz_warn(ctx, \"%s\", fz_caught_message(ctx));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpdf_drop_obj(obj);\n\t\t\t\tfz_rethrow(ctx);\n\t\t\t}\n\t\t}\n\t}\n\n\tpdf_drop_obj(obj);\n}\n\nstatic void writexrefsubsect(pdf_write_options *opts, int from, int to)\n{\n\tint num;\n\n\tfprintf(opts->out, \"%d %d\\n\", from, to - from);\n\tfor (num = from; num < to; num++)\n\t{\n\t\tif (opts->use_list[num])\n\t\t\tfprintf(opts->out, \"%010d %05d n \\n\", opts->ofs_list[num], opts->gen_list[num]);\n\t\telse\n\t\t\tfprintf(opts->out, \"%010d %05d f \\n\", opts->ofs_list[num], opts->gen_list[num]);\n\t}\n}\n\nstatic void writexref(pdf_document *doc, pdf_write_options *opts, int from, int to, int first, int main_xref_offset, int startxref)\n{\n\tpdf_obj *trailer = NULL;\n\tpdf_obj *obj;\n\tpdf_obj *nobj = NULL;\n\tfz_context *ctx = doc->ctx;\n\n\tfprintf(opts->out, \"xref\\n\");\n\topts->first_xref_entry_offset = ftell(opts->out);\n\n\tif (opts->do_incremental)\n\t{\n\t\tint subfrom = from;\n\t\tint subto;\n\n\t\twhile (subfrom < to)\n\t\t{\n\t\t\twhile (subfrom < to && !pdf_xref_is_incremental(doc, subfrom))\n\t\t\t\tsubfrom++;\n\n\t\t\tsubto = subfrom;\n\t\t\twhile (subto < to && pdf_xref_is_incremental(doc, subto))\n\t\t\t\tsubto++;\n\n\t\t\tif (subfrom < subto)\n\t\t\t\twritexrefsubsect(opts, subfrom, subto);\n\n\t\t\tsubfrom = subto;\n\t\t}\n\t}\n\telse\n\t{\n\t\twritexrefsubsect(opts, from, to);\n\t}\n\n\tfprintf(opts->out, \"\\n\");\n\n\tfz_var(trailer);\n\tfz_var(nobj);\n\n\tfz_try(ctx)\n\t{\n\t\tif (opts->do_incremental)\n\t\t{\n\t\t\ttrailer = pdf_keep_obj(pdf_trailer(doc));\n\t\t\tpdf_dict_puts_drop(trailer, \"Size\", pdf_new_int(doc, pdf_xref_len(doc)));\n\t\t\tpdf_dict_puts_drop(trailer, \"Prev\", pdf_new_int(doc, doc->startxref));\n\t\t\tdoc->startxref = startxref;\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttrailer = pdf_new_dict(doc, 5);\n\n\t\t\tnobj = pdf_new_int(doc, to);\n\t\t\tpdf_dict_puts(trailer, \"Size\", nobj);\n\t\t\tpdf_drop_obj(nobj);\n\t\t\tnobj = NULL;\n\n\t\t\tif (first)\n\t\t\t{\n\t\t\t\tobj = pdf_dict_gets(pdf_trailer(doc), \"Info\");\n\t\t\t\tif (obj)\n\t\t\t\t\tpdf_dict_puts(trailer, \"Info\", obj);\n\n\t\t\t\tobj = pdf_dict_gets(pdf_trailer(doc), \"Root\");\n\t\t\t\tif (obj)\n\t\t\t\t\tpdf_dict_puts(trailer, \"Root\", obj);\n\n\t\t\t\tobj = pdf_dict_gets(pdf_trailer(doc), \"ID\");\n\t\t\t\tif (obj)\n\t\t\t\t\tpdf_dict_puts(trailer, \"ID\", obj);\n\t\t\t}\n\t\t\tif (main_xref_offset != 0)\n\t\t\t{\n\t\t\t\tnobj = pdf_new_int(doc, main_xref_offset);\n\t\t\t\tpdf_dict_puts(trailer, \"Prev\", nobj);\n\t\t\t\tpdf_drop_obj(nobj);\n\t\t\t\tnobj = NULL;\n\t\t\t}\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(nobj);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\tfprintf(opts->out, \"trailer\\n\");\n\tpdf_fprint_obj(opts->out, trailer, opts->do_expand == 0);\n\tfprintf(opts->out, \"\\n\");\n\n\tpdf_drop_obj(trailer);\n\n\tfprintf(opts->out, \"startxref\\n%d\\n%%%%EOF\\n\", startxref);\n\n\tdoc->has_xref_streams = 0;\n}\n\nstatic void writexrefstreamsubsect(pdf_document *doc, pdf_write_options *opts, pdf_obj *index, fz_buffer *fzbuf, int from, int to)\n{\n\tint num;\n\n\tpdf_array_push_drop(index, pdf_new_int(doc, from));\n\tpdf_array_push_drop(index, pdf_new_int(doc, to - from));\n\tfor (num = from; num < to; num++)\n\t{\n\t\tfz_write_buffer_byte(doc->ctx, fzbuf, opts->use_list[num] ? 1 : 0);\n\t\tfz_write_buffer_byte(doc->ctx, fzbuf, opts->ofs_list[num]>>24);\n\t\tfz_write_buffer_byte(doc->ctx, fzbuf, opts->ofs_list[num]>>16);\n\t\tfz_write_buffer_byte(doc->ctx, fzbuf, opts->ofs_list[num]>>8);\n\t\tfz_write_buffer_byte(doc->ctx, fzbuf, opts->ofs_list[num]);\n\t\tfz_write_buffer_byte(doc->ctx, fzbuf, opts->gen_list[num]);\n\t}\n}\n\nstatic void writexrefstream(pdf_document *doc, pdf_write_options *opts, int from, int to, int first, int main_xref_offset, int startxref)\n{\n\tfz_context *ctx = doc->ctx;\n\tint num;\n\tpdf_obj *dict = NULL;\n\tpdf_obj *obj;\n\tpdf_obj *w = NULL;\n\tpdf_obj *index;\n\tfz_buffer *fzbuf = NULL;\n\n\tfz_var(dict);\n\tfz_var(w);\n\tfz_var(fzbuf);\n\tfz_try(ctx)\n\t{\n\t\tnum = pdf_create_object(doc);\n\t\tdict = pdf_new_dict(doc, 6);\n\t\tpdf_update_object(doc, num, dict);\n\n\t\topts->first_xref_entry_offset = ftell(opts->out);\n\n\t\tto++;\n\n\t\tif (first)\n\t\t{\n\t\t\tobj = pdf_dict_gets(pdf_trailer(doc), \"Info\");\n\t\t\tif (obj)\n\t\t\t\tpdf_dict_puts(dict, \"Info\", obj);\n\n\t\t\tobj = pdf_dict_gets(pdf_trailer(doc), \"Root\");\n\t\t\tif (obj)\n\t\t\t\tpdf_dict_puts(dict, \"Root\", obj);\n\n\t\t\tobj = pdf_dict_gets(pdf_trailer(doc), \"ID\");\n\t\t\tif (obj)\n\t\t\t\tpdf_dict_puts(dict, \"ID\", obj);\n\n\t\t\tif (opts->do_incremental)\n\t\t\t{\n\t\t\t\tobj = pdf_dict_gets(pdf_trailer(doc), \"Encrypt\");\n\t\t\t\tif (obj)\n\t\t\t\t\tpdf_dict_puts(dict, \"Encrypt\", obj);\n\t\t\t}\n\t\t}\n\n\t\tpdf_dict_puts_drop(dict, \"Size\", pdf_new_int(doc, to));\n\n\t\tif (opts->do_incremental)\n\t\t{\n\t\t\tpdf_dict_puts_drop(dict, \"Prev\", pdf_new_int(doc, doc->startxref));\n\t\t\tdoc->startxref = startxref;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (main_xref_offset != 0)\n\t\t\t\tpdf_dict_puts_drop(dict, \"Prev\", pdf_new_int(doc, main_xref_offset));\n\t\t}\n\n\t\tpdf_dict_puts_drop(dict, \"Type\", pdf_new_name(doc, \"XRef\"));\n\n\t\tw = pdf_new_array(doc, 3);\n\t\tpdf_dict_puts(dict, \"W\", w);\n\t\tpdf_array_push_drop(w, pdf_new_int(doc, 1));\n\t\tpdf_array_push_drop(w, pdf_new_int(doc, 4));\n\t\tpdf_array_push_drop(w, pdf_new_int(doc, 1));\n\n\t\tindex = pdf_new_array(doc, 2);\n\t\tpdf_dict_puts_drop(dict, \"Index\", index);\n\n\t\topts->ofs_list[num] = opts->first_xref_entry_offset;\n\n\t\tfzbuf = fz_new_buffer(ctx, 4*(to-from));\n\n\t\tif (opts->do_incremental)\n\t\t{\n\t\t\tint subfrom = from;\n\t\t\tint subto;\n\n\t\t\twhile (subfrom < to)\n\t\t\t{\n\t\t\t\twhile (subfrom < to && !pdf_xref_is_incremental(doc, subfrom))\n\t\t\t\t\tsubfrom++;\n\n\t\t\t\tsubto = subfrom;\n\t\t\t\twhile (subto < to && pdf_xref_is_incremental(doc, subto))\n\t\t\t\t\tsubto++;\n\n\t\t\t\tif (subfrom < subto)\n\t\t\t\t\twritexrefstreamsubsect(doc, opts, index, fzbuf, subfrom, subto);\n\n\t\t\t\tsubfrom = subto;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\twritexrefstreamsubsect(doc, opts, index, fzbuf, from, to);\n\t\t}\n\n\t\tpdf_update_stream(doc, num, fzbuf);\n\t\tpdf_dict_puts_drop(dict, \"Length\", pdf_new_int(doc, fz_buffer_storage(ctx, fzbuf, NULL)));\n\n\t\twriteobject(doc, opts, num, 0, 0);\n\t\tfprintf(opts->out, \"startxref\\n%d\\n%%%%EOF\\n\", startxref);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(dict);\n\t\tpdf_drop_obj(w);\n\t\tfz_drop_buffer(ctx, fzbuf);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void\npadto(FILE *file, int target)\n{\n\tint pos = ftell(file);\n\n\tassert(pos <= target);\n\twhile (pos < target)\n\t{\n\t\tfputc('\\n', file);\n\t\tpos++;\n\t}\n}\n\nstatic void\ndowriteobject(pdf_document *doc, pdf_write_options *opts, int num, int pass)\n{\n\tpdf_xref_entry *entry = pdf_get_xref_entry(doc, num);\n\tif (entry->type == 'f')\n\t\topts->gen_list[num] = entry->gen;\n\tif (entry->type == 'n')\n\t\topts->gen_list[num] = entry->gen;\n\tif (entry->type == 'o')\n\t\topts->gen_list[num] = 0;\n\n\t/* If we are renumbering, then make sure all generation numbers are\n\t * zero (except object 0 which must be free, and have a gen number of\n\t * 65535). Changing the generation numbers (and indeed object numbers)\n\t * will break encryption - so only do this if we are renumbering\n\t * anyway. */\n\tif (opts->do_garbage >= 2)\n\t\topts->gen_list[num] = (num == 0 ? 65535 : 0);\n\n\tif (opts->do_garbage && !opts->use_list[num])\n\t\treturn;\n\n\tif (entry->type == 'n' || entry->type == 'o')\n\t{\n\t\tif (pass > 0)\n\t\t\tpadto(opts->out, opts->ofs_list[num]);\n\t\topts->ofs_list[num] = ftell(opts->out);\n\t\tif (!opts->do_incremental || pdf_xref_is_incremental(doc, num))\n\t\t\twriteobject(doc, opts, num, opts->gen_list[num], 1);\n\t}\n\telse\n\t\topts->use_list[num] = 0;\n}\n\nstatic void\nwriteobjects(pdf_document *doc, pdf_write_options *opts, int pass)\n{\n\tint num;\n\tint xref_len = pdf_xref_len(doc);\n\n\tif (!opts->do_incremental)\n\t{\n\t\tfprintf(opts->out, \"%%PDF-%d.%d\\n\", doc->version / 10, doc->version % 10);\n\t\tfprintf(opts->out, \"%%\\316\\274\\341\\277\\246\\n\\n\");\n\t}\n\n\tdowriteobject(doc, opts, opts->start, pass);\n\n\tif (opts->do_linear)\n\t{\n\t\t/* Write first xref */\n\t\tif (pass == 0)\n\t\t\topts->first_xref_offset = ftell(opts->out);\n\t\telse\n\t\t\tpadto(opts->out, opts->first_xref_offset);\n\t\twritexref(doc, opts, opts->start, pdf_xref_len(doc), 1, opts->main_xref_offset, 0);\n\t}\n\n\tfor (num = opts->start+1; num < xref_len; num++)\n\t\tdowriteobject(doc, opts, num, pass);\n\tif (opts->do_linear && pass == 1)\n\t{\n\t\tint offset = (opts->start == 1 ? opts->main_xref_offset : opts->ofs_list[1] + opts->hintstream_len);\n\t\tpadto(opts->out, offset);\n\t}\n\tfor (num = 1; num < opts->start; num++)\n\t{\n\t\tif (pass == 1)\n\t\t\topts->ofs_list[num] += opts->hintstream_len;\n\t\tdowriteobject(doc, opts, num, pass);\n\t}\n}\n\nstatic int\nmy_log2(int x)\n{\n\tint i = 0;\n\n\tif (x <= 0)\n\t\treturn 0;\n\n\twhile ((1<<i) <= x && (1<<i) > 0)\n\t\ti++;\n\n\tif ((1<<i) <= 0)\n\t\treturn 0;\n\n\treturn i;\n}\n\nstatic void\nmake_page_offset_hints(pdf_document *doc, pdf_write_options *opts, fz_buffer *buf)\n{\n\tfz_context *ctx = doc->ctx;\n\tint i, j;\n\tint min_objs_per_page, max_objs_per_page;\n\tint min_page_length, max_page_length;\n\tint objs_per_page_bits;\n\tint min_shared_object, max_shared_object;\n\tint max_shared_object_refs = 0;\n\tint min_shared_length, max_shared_length;\n\tpage_objects **pop = &opts->page_object_lists->page[0];\n\tint page_len_bits, shared_object_bits, shared_object_id_bits;\n\tint shared_length_bits;\n\tint xref_len = pdf_xref_len(doc);\n\n\tmin_shared_object = pdf_xref_len(doc);\n\tmax_shared_object = 1;\n\tmin_shared_length = opts->file_len;\n\tmax_shared_length = 0;\n\tfor (i=1; i < xref_len; i++)\n\t{\n\t\tint min, max, page;\n\n\t\tmin = opts->ofs_list[i];\n\t\tif (i == opts->start-1 || (opts->start == 1 && i == xref_len-1))\n\t\t\tmax = opts->main_xref_offset;\n\t\telse if (i == xref_len-1)\n\t\t\tmax = opts->ofs_list[1];\n\t\telse\n\t\t\tmax = opts->ofs_list[i+1];\n\n\t\t/* SumatraPDF: TODO: this assertion doesn't always hold (e.g. for files 1044 and 1103) */\n\t\tassert(max > min);\n\n\t\tif (opts->use_list[i] & USE_SHARED)\n\t\t{\n\t\t\tpage = -1;\n\t\t\tif (i < min_shared_object)\n\t\t\t\tmin_shared_object = i;\n\t\t\tif (i > max_shared_object)\n\t\t\t\tmax_shared_object = i;\n\t\t\tif (min_shared_length > max - min)\n\t\t\t\tmin_shared_length = max - min;\n\t\t\tif (max_shared_length < max - min)\n\t\t\t\tmax_shared_length = max - min;\n\t\t}\n\t\telse if (opts->use_list[i] & (USE_CATALOGUE | USE_HINTS | USE_PARAMS))\n\t\t\tpage = -1;\n\t\telse if (opts->use_list[i] & USE_PAGE1)\n\t\t{\n\t\t\tpage = 0;\n\t\t\tif (min_shared_length > max - min)\n\t\t\t\tmin_shared_length = max - min;\n\t\t\tif (max_shared_length < max - min)\n\t\t\t\tmax_shared_length = max - min;\n\t\t}\n\t\telse if (opts->use_list[i] == 0)\n\t\t\tpage = -1;\n\t\telse\n\t\t\tpage = opts->use_list[i]>>USE_PAGE_SHIFT;\n\n\t\tif (page >= 0)\n\t\t{\n\t\t\tpop[page]->num_objects++;\n\t\t\tif (pop[page]->min_ofs > min)\n\t\t\t\tpop[page]->min_ofs = min;\n\t\t\tif (pop[page]->max_ofs < max)\n\t\t\t\tpop[page]->max_ofs = max;\n\t\t}\n\t}\n\n\tmin_objs_per_page = max_objs_per_page = pop[0]->num_objects;\n\tmin_page_length = max_page_length = pop[0]->max_ofs - pop[0]->min_ofs;\n\tfor (i=1; i < opts->page_count; i++)\n\t{\n\t\tint tmp;\n\t\tif (min_objs_per_page > pop[i]->num_objects)\n\t\t\tmin_objs_per_page = pop[i]->num_objects;\n\t\tif (max_objs_per_page < pop[i]->num_objects)\n\t\t\tmax_objs_per_page = pop[i]->num_objects;\n\t\ttmp = pop[i]->max_ofs - pop[i]->min_ofs;\n\t\tif (tmp < min_page_length)\n\t\t\tmin_page_length = tmp;\n\t\tif (tmp > max_page_length)\n\t\t\tmax_page_length = tmp;\n\t}\n\n\tfor (i=0; i < opts->page_count; i++)\n\t{\n\t\tint count = 0;\n\t\tpage_objects *po = opts->page_object_lists->page[i];\n\t\tfor (j = 0; j < po->len; j++)\n\t\t{\n\t\t\tif (i == 0 && opts->use_list[po->object[j]] & USE_PAGE1)\n\t\t\t\tcount++;\n\t\t\telse if (i != 0 && opts->use_list[po->object[j]] & USE_SHARED)\n\t\t\t\tcount++;\n\t\t}\n\t\tpo->num_shared = count;\n\t\tif (i == 0 || count > max_shared_object_refs)\n\t\t\tmax_shared_object_refs = count;\n\t}\n\tif (min_shared_object > max_shared_object)\n\t\tmin_shared_object = max_shared_object = 0;\n\n\t/* Table F.3 - Header */\n\t/* Header Item 1: Least number of objects in a page */\n\tfz_write_buffer_bits(ctx, buf, min_objs_per_page, 32);\n\t/* Header Item 2: Location of first pages page object */\n\tfz_write_buffer_bits(ctx, buf, opts->ofs_list[pop[0]->page_object_number], 32);\n\t/* Header Item 3: Number of bits required to represent the difference\n\t * between the greatest and least number of objects in a page. */\n\tobjs_per_page_bits = my_log2(max_objs_per_page - min_objs_per_page);\n\tfz_write_buffer_bits(ctx, buf, objs_per_page_bits, 16);\n\t/* Header Item 4: Least length of a page. */\n\tfz_write_buffer_bits(ctx, buf, min_page_length, 32);\n\t/* Header Item 5: Number of bits needed to represent the difference\n\t * between the greatest and least length of a page. */\n\tpage_len_bits = my_log2(max_page_length - min_page_length);\n\tfz_write_buffer_bits(ctx, buf, page_len_bits, 16);\n\t/* Header Item 6: Least offset to start of content stream (Acrobat\n\t * sets this to always be 0) */\n\tfz_write_buffer_bits(ctx, buf, 0, 32);\n\t/* Header Item 7: Number of bits needed to represent the difference\n\t * between the greatest and least offset to content stream (Acrobat\n\t * sets this to always be 0) */\n\tfz_write_buffer_bits(ctx, buf, 0, 16);\n\t/* Header Item 8: Least content stream length. (Acrobat\n\t * sets this to always be 0) */\n\tfz_write_buffer_bits(ctx, buf, 0, 32);\n\t/* Header Item 9: Number of bits needed to represent the difference\n\t * between the greatest and least content stream length (Acrobat\n\t * sets this to always be the same as item 5) */\n\tfz_write_buffer_bits(ctx, buf, page_len_bits, 16);\n\t/* Header Item 10: Number of bits needed to represent the greatest\n\t * number of shared object references. */\n\tshared_object_bits = my_log2(max_shared_object_refs);\n\tfz_write_buffer_bits(ctx, buf, shared_object_bits, 16);\n\t/* Header Item 11: Number of bits needed to represent the greatest\n\t * shared object identifier. */\n\tshared_object_id_bits = my_log2(max_shared_object - min_shared_object + pop[0]->num_shared);\n\tfz_write_buffer_bits(ctx, buf, shared_object_id_bits, 16);\n\t/* Header Item 12: Number of bits needed to represent the numerator\n\t * of the fractions. We always send 0. */\n\tfz_write_buffer_bits(ctx, buf, 0, 16);\n\t/* Header Item 13: Number of bits needed to represent the denominator\n\t * of the fractions. We always send 0. */\n\tfz_write_buffer_bits(ctx, buf, 0, 16);\n\n\t/* Table F.4 - Page offset hint table (per page) */\n\t/* Item 1: A number that, when added to the least number of objects\n\t * on a page, gives the number of objects in the page. */\n\tfor (i = 0; i < opts->page_count; i++)\n\t{\n\t\tfz_write_buffer_bits(ctx, buf, pop[i]->num_objects - min_objs_per_page, objs_per_page_bits);\n\t}\n\tfz_write_buffer_pad(ctx, buf);\n\t/* Item 2: A number that, when added to the least page length, gives\n\t * the length of the page in bytes. */\n\tfor (i = 0; i < opts->page_count; i++)\n\t{\n\t\tfz_write_buffer_bits(ctx, buf, pop[i]->max_ofs - pop[i]->min_ofs - min_page_length, page_len_bits);\n\t}\n\tfz_write_buffer_pad(ctx, buf);\n\t/* Item 3: The number of shared objects referenced from the page. */\n\tfor (i = 0; i < opts->page_count; i++)\n\t{\n\t\tfz_write_buffer_bits(ctx, buf, pop[i]->num_shared, shared_object_bits);\n\t}\n\tfz_write_buffer_pad(ctx, buf);\n\t/* Item 4: Shared object id for each shared object ref in every page.\n\t * Spec says \"not for page 1\", but acrobat does send page 1's - all\n\t * as zeros. */\n\tfor (i = 0; i < opts->page_count; i++)\n\t{\n\t\tfor (j = 0; j < pop[i]->len; j++)\n\t\t{\n\t\t\tint o = pop[i]->object[j];\n\t\t\tif (i == 0 && opts->use_list[o] & USE_PAGE1)\n\t\t\t\tfz_write_buffer_bits(ctx, buf, 0 /* o - pop[0]->page_object_number */, shared_object_id_bits);\n\t\t\tif (i != 0 && opts->use_list[o] & USE_SHARED)\n\t\t\t\tfz_write_buffer_bits(ctx, buf, o - min_shared_object + pop[0]->num_shared, shared_object_id_bits);\n\t\t}\n\t}\n\tfz_write_buffer_pad(ctx, buf);\n\t/* Item 5: Numerator of fractional position for each shared object reference. */\n\t/* We always send 0 in 0 bits */\n\t/* Item 6: A number that, when added to the least offset to the start\n\t * of the content stream (F.3 Item 6), gives the offset in bytes of\n\t * start of the pages content stream object relative to the beginning\n\t * of the page. Always 0 in 0 bits. */\n\t/* Item 7: A number that, when added to the least content stream length\n\t * (F.3 Item 8), gives the length of the pages content stream object.\n\t * Always == Item 2 as least content stream length = least page stream\n\t * length.\n\t */\n\tfor (i = 0; i < opts->page_count; i++)\n\t{\n\t\tfz_write_buffer_bits(ctx, buf, pop[i]->max_ofs - pop[i]->min_ofs - min_page_length, page_len_bits);\n\t}\n\n\t/* Pad, and then do shared object hint table */\n\tfz_write_buffer_pad(ctx, buf);\n\topts->hints_shared_offset = buf->len;\n\n\t/* Table F.5: */\n\t/* Header Item 1: Object number of the first object in the shared\n\t * objects section. */\n\tfz_write_buffer_bits(ctx, buf, min_shared_object, 32);\n\t/* Header Item 2: Location of first object in the shared objects\n\t * section. */\n\tfz_write_buffer_bits(ctx, buf, opts->ofs_list[min_shared_object], 32);\n\t/* Header Item 3: The number of shared object entries for the first\n\t * page. */\n\tfz_write_buffer_bits(ctx, buf, pop[0]->num_shared, 32);\n\t/* Header Item 4: The number of shared object entries for the shared\n\t * objects section + first page. */\n\tfz_write_buffer_bits(ctx, buf, max_shared_object - min_shared_object + pop[0]->num_shared, 32);\n\t/* Header Item 5: The number of bits needed to represent the greatest\n\t * number of objects in a shared object group (Always 0). */\n\tfz_write_buffer_bits(ctx, buf, 0, 16);\n\t/* Header Item 6: The least length of a shared object group in bytes. */\n\tfz_write_buffer_bits(ctx, buf, min_shared_length, 32);\n\t/* Header Item 7: The number of bits required to represent the\n\t * difference between the greatest and least length of a shared object\n\t * group. */\n\tshared_length_bits = my_log2(max_shared_length - min_shared_length);\n\tfz_write_buffer_bits(ctx, buf, shared_length_bits, 16);\n\n\t/* Table F.6 */\n\t/* Item 1: Shared object group length (page 1 objects) */\n\tfor (j = 0; j < pop[0]->len; j++)\n\t{\n\t\tint o = pop[0]->object[j];\n\t\tint min, max;\n\t\tmin = opts->ofs_list[o];\n\t\tif (o == opts->start-1)\n\t\t\tmax = opts->main_xref_offset;\n\t\telse if (o < xref_len-1)\n\t\t\tmax = opts->ofs_list[o+1];\n\t\telse\n\t\t\tmax = opts->ofs_list[1];\n\t\tif (opts->use_list[o] & USE_PAGE1)\n\t\t\tfz_write_buffer_bits(ctx, buf, max - min - min_shared_length, shared_length_bits);\n\t}\n\t/* Item 1: Shared object group length (shared objects) */\n\tfor (i = min_shared_object; i <= max_shared_object; i++)\n\t{\n\t\tint min, max;\n\t\tmin = opts->ofs_list[i];\n\t\tif (i == opts->start-1)\n\t\t\tmax = opts->main_xref_offset;\n\t\telse if (i < xref_len-1)\n\t\t\tmax = opts->ofs_list[i+1];\n\t\telse\n\t\t\tmax = opts->ofs_list[1];\n\t\tfz_write_buffer_bits(ctx, buf, max - min - min_shared_length, shared_length_bits);\n\t}\n\tfz_write_buffer_pad(ctx, buf);\n\n\t/* Item 2: MD5 presence flags */\n\tfor (i = max_shared_object - min_shared_object + pop[0]->num_shared; i > 0; i--)\n\t{\n\t\tfz_write_buffer_bits(ctx, buf, 0, 1);\n\t}\n\tfz_write_buffer_pad(ctx, buf);\n\t/* Item 3: MD5 sums (not present) */\n\tfz_write_buffer_pad(ctx, buf);\n\t/* Item 4: Number of objects in the group (not present) */\n}\n\nstatic void\nmake_hint_stream(pdf_document *doc, pdf_write_options *opts)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_buffer *buf = fz_new_buffer(ctx, 100);\n\n\tfz_try(ctx)\n\t{\n\t\tmake_page_offset_hints(doc, opts, buf);\n\t\tpdf_update_stream(doc, pdf_xref_len(doc)-1, buf);\n\t\topts->hintstream_len = buf->len;\n\t\tfz_drop_buffer(ctx, buf);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_drop_buffer(ctx, buf);\n\t\tfz_rethrow(ctx);\n\t}\n}\n\n#ifdef DEBUG_WRITING\nstatic void dump_object_details(pdf_document *doc, pdf_write_options *opts)\n{\n\tint i;\n\n\tfor (i = 0; i < pdf_xref_len(doc); i++)\n\t{\n\t\tfprintf(stderr, \"%d@%d: use=%d\\n\", i, opts->ofs_list[i], opts->use_list[i]);\n\t}\n}\n#endif\n\nstatic void presize_unsaved_signature_byteranges(pdf_document *doc)\n{\n\tif (doc->unsaved_sigs)\n\t{\n\t\t/* The ByteRange objects of signatures are initially written out with\n\t\t * dummy values, and then overwritten later. We need to make sure their\n\t\t * initial form at least takes enough sufficient file space */\n\t\tpdf_unsaved_sig *usig;\n\t\tint n = 0;\n\n\t\tfor (usig = doc->unsaved_sigs; usig; usig = usig->next)\n\t\t\tn++;\n\n\t\tfor (usig = doc->unsaved_sigs; usig; usig = usig->next)\n\t\t{\n\t\t\t/* There will be segments of bytes at the beginning, at\n\t\t\t * the end and between each consecutive pair of signatures,\n\t\t\t * hence n + 1 */\n\t\t\tint i;\n\t\t\tpdf_obj *byte_range = pdf_dict_getp(usig->field, \"V/ByteRange\");\n\n\t\t\tfor (i = 0; i < n+1; i++)\n\t\t\t{\n\t\t\t\tpdf_array_push_drop(byte_range, pdf_new_int(doc, INT_MAX));\n\t\t\t\tpdf_array_push_drop(byte_range, pdf_new_int(doc, INT_MAX));\n\t\t\t}\n\t\t}\n\t}\n}\n\nstatic void complete_signatures(pdf_document *doc, pdf_write_options *opts, char *filename)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_unsaved_sig *usig;\n\tFILE *f;\n\tchar buf[5120];\n\tint i;\n\tint flen;\n\tint last_end;\n\n\tif (doc->unsaved_sigs)\n\t{\n\t\tpdf_obj *byte_range;\n\n\t\tf = fopen(filename, \"rb+\");\n\t\tif (!f)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Failed to open %s to complete signatures\", filename);\n\n\t\tfseek(f, 0, SEEK_END);\n\t\tflen = ftell(f);\n\n\t\t/* Locate the byte ranges and contents in the saved file */\n\t\tfor (usig = doc->unsaved_sigs; usig; usig = usig->next)\n\t\t{\n\t\t\tchar *bstr, *cstr, *fstr;\n\t\t\tint pnum = pdf_obj_parent_num(pdf_dict_getp(usig->field, \"V/ByteRange\"));\n\t\t\tfseek(f, opts->ofs_list[pnum], SEEK_SET);\n\t\t\t(void)fread(buf, 1, sizeof(buf), f);\n\t\t\tbuf[sizeof(buf)-1] = 0;\n\n\t\t\tbstr = strstr(buf, \"/ByteRange\");\n\t\t\tcstr = strstr(buf, \"/Contents\");\n\t\t\tfstr = strstr(buf, \"/Filter\");\n\n\t\t\tif (bstr && cstr && fstr && bstr < cstr && cstr < fstr)\n\t\t\t{\n\t\t\t\tusig->byte_range_start = bstr - buf + 10 + opts->ofs_list[pnum];\n\t\t\t\tusig->byte_range_end = cstr - buf + opts->ofs_list[pnum];\n\t\t\t\tusig->contents_start = cstr - buf + 9 + opts->ofs_list[pnum];\n\t\t\t\tusig->contents_end = fstr - buf + opts->ofs_list[pnum];\n\t\t\t}\n\t\t}\n\n\t\t/* Recreate ByteRange with correct values. Initially store the\n\t\t * recreated object in the first of the unsaved signatures */\n\t\tbyte_range = pdf_new_array(doc, 4);\n\t\tpdf_dict_putp_drop(doc->unsaved_sigs->field, \"V/ByteRange\", byte_range);\n\n\t\tlast_end = 0;\n\t\tfor (usig = doc->unsaved_sigs; usig; usig = usig->next)\n\t\t{\n\t\t\tpdf_array_push_drop(byte_range, pdf_new_int(doc, last_end));\n\t\t\tpdf_array_push_drop(byte_range, pdf_new_int(doc, usig->contents_start - last_end));\n\t\t\tlast_end = usig->contents_end;\n\t\t}\n\t\tpdf_array_push_drop(byte_range, pdf_new_int(doc, last_end));\n\t\tpdf_array_push_drop(byte_range, pdf_new_int(doc, flen - last_end));\n\n\t\t/* Copy the new ByteRange to the other unsaved signatures */\n\t\tfor (usig = doc->unsaved_sigs->next; usig; usig = usig->next)\n\t\t\tpdf_dict_putp_drop(usig->field, \"V/ByteRange\", pdf_copy_array(byte_range));\n\n\t\t/* Write the byte range into buf, padding with spaces*/\n\t\ti = pdf_sprint_obj(buf, sizeof(buf), byte_range, 1);\n\t\tmemset(buf+i, ' ', sizeof(buf)-i);\n\n\t\t/* Write the byte range to the file */\n\t\tfor (usig = doc->unsaved_sigs; usig; usig = usig->next)\n\t\t{\n\t\t\tfseek(f, usig->byte_range_start, SEEK_SET);\n\t\t\tfwrite(buf, 1, usig->byte_range_end - usig->byte_range_start, f);\n\t\t}\n\n\t\tfclose(f);\n\n\t\t/* Write the digests into the file */\n\t\tfor (usig = doc->unsaved_sigs; usig; usig = usig->next)\n\t\t\tpdf_write_digest(doc, filename, byte_range, usig->contents_start, usig->contents_end - usig->contents_start, usig->signer);\n\n\t\t/* delete the unsaved_sigs records */\n\t\twhile ((usig = doc->unsaved_sigs) != NULL)\n\t\t{\n\t\t\tdoc->unsaved_sigs = usig->next;\n\t\t\tpdf_drop_obj(usig->field);\n\t\t\tpdf_drop_signer(usig->signer);\n\t\t\tfz_free(ctx, usig);\n\t\t}\n\t}\n}\n\nstatic void sanitise(pdf_document *doc)\n{\n\tint n = pdf_count_pages(doc);\n\tint i;\n\n\tfor (i = 0; i < n; i++)\n\t{\n\t\tpdf_page *page = pdf_load_page(doc, i);\n\n\t\tpdf_clean_page_contents(doc, page, NULL);\n\n\t\tpdf_free_page(doc, page);\n\t}\n}\n\nvoid pdf_write_document(pdf_document *doc, char *filename, fz_write_options *fz_opts)\n{\n\tint lastfree;\n\tint num;\n\tpdf_write_options opts = { 0 };\n\tfz_context *ctx;\n\tint xref_len;\n\tfz_write_options fz_opts_defaults = { 0 };\n\n\tif (!doc)\n\t\treturn;\n\n\tif (!fz_opts)\n\t\tfz_opts = &fz_opts_defaults;\n\n\tdoc->freeze_updates = 1;\n\tctx = doc->ctx;\n\n\t/* Sanitise the operator streams */\n\tif (fz_opts->do_clean)\n\t\tsanitise(doc);\n\n\tpdf_finish_edit(doc);\n\tpresize_unsaved_signature_byteranges(doc);\n\n\txref_len = pdf_xref_len(doc);\n\n\tif (fz_opts->do_incremental)\n\t{\n\t\topts.out = fopen(filename, \"ab\");\n\t\tif (opts.out)\n\t\t{\n\t\t\tfseek(opts.out, 0, SEEK_END);\n\t\t\tfprintf(opts.out, \"\\n\");\n\t\t}\n\t}\n\telse\n\t{\n\t\topts.out = fopen(filename, \"wb\");\n\t}\n\n\tif (!opts.out)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot open output file '%s'\", filename);\n\n\tfz_try(ctx)\n\t{\n\t\topts.do_incremental = fz_opts->do_incremental;\n\t\topts.do_expand = fz_opts->do_expand;\n\t\topts.do_garbage = fz_opts->do_garbage;\n\t\topts.do_ascii = fz_opts->do_ascii;\n\t\topts.do_linear = fz_opts->do_linear;\n\t\topts.do_clean = fz_opts->do_clean;\n\t\topts.start = 0;\n\t\topts.main_xref_offset = INT_MIN;\n\t\t/* We deliberately make these arrays long enough to cope with\n\t\t * 1 to n access rather than 0..n-1, and add space for 2 new\n\t\t * extra entries that may be required for linearization. */\n\t\topts.use_list = fz_malloc_array(ctx, pdf_xref_len(doc) + 3, sizeof(int));\n\t\topts.ofs_list = fz_malloc_array(ctx, pdf_xref_len(doc) + 3, sizeof(int));\n\t\topts.gen_list = fz_calloc(ctx, pdf_xref_len(doc) + 3, sizeof(int));\n\t\topts.renumber_map = fz_malloc_array(ctx, pdf_xref_len(doc) + 3, sizeof(int));\n\t\topts.rev_renumber_map = fz_malloc_array(ctx, pdf_xref_len(doc) + 3, sizeof(int));\n\t\topts.rev_gen_list = fz_malloc_array(ctx, pdf_xref_len(doc) + 3, sizeof(int));\n\t\topts.continue_on_error = fz_opts->continue_on_error;\n\t\topts.errors = fz_opts->errors;\n\n\t\tfor (num = 0; num < xref_len; num++)\n\t\t{\n\t\t\topts.use_list[num] = 0;\n\t\t\topts.ofs_list[num] = 0;\n\t\t\topts.renumber_map[num] = num;\n\t\t\topts.rev_renumber_map[num] = num;\n\t\t\topts.rev_gen_list[num] = pdf_get_xref_entry(doc, num)->gen;\n\t\t}\n\n\t\tif (opts.do_incremental && opts.do_garbage)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Can't do incremental writes with garbage collection\");\n\t\tif (opts.do_incremental && opts.do_linear)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Can't do incremental writes with linearisation\");\n\n\t\t/* Make sure any objects hidden in compressed streams have been loaded */\n\t\tif (!opts.do_incremental)\n\t\t{\n\t\t\tpdf_ensure_solid_xref(doc, xref_len);\n\t\t\tpreloadobjstms(doc);\n\t\t}\n\n\t\t/* Sweep & mark objects from the trailer */\n\t\tif (opts.do_garbage >= 1)\n\t\t\tsweepobj(doc, &opts, pdf_trailer(doc));\n\t\telse\n\t\t\tfor (num = 0; num < xref_len; num++)\n\t\t\t\topts.use_list[num] = 1;\n\n\t\t/* Coalesce and renumber duplicate objects */\n\t\tif (opts.do_garbage >= 3)\n\t\t\tremoveduplicateobjs(doc, &opts);\n\n\t\t/* Compact xref by renumbering and removing unused objects */\n\t\tif (opts.do_garbage >= 2 || opts.do_linear)\n\t\t\tcompactxref(doc, &opts);\n\n\t\t/* Make renumbering affect all indirect references and update xref */\n\t\tif (opts.do_garbage >= 2 || opts.do_linear)\n\t\t\trenumberobjs(doc, &opts);\n\n\t\t/* Truncate the xref after compacting and renumbering */\n\t\tif (opts.do_garbage >= 2 && !opts.do_incremental)\n\t\t\twhile (xref_len > 0 && !opts.use_list[xref_len-1])\n\t\t\t\txref_len--;\n\n\t\tif (opts.do_linear)\n\t\t{\n\t\t\tlinearize(doc, &opts);\n\t\t}\n\n\t\twriteobjects(doc, &opts, 0);\n\n#ifdef DEBUG_WRITING\n\t\tdump_object_details(doc, &opts);\n#endif\n\n\t\tif (opts.do_incremental)\n\t\t{\n\t\t\tfor (num = 0; num < xref_len; num++)\n\t\t\t{\n\t\t\t\tif (!opts.use_list[num] && pdf_xref_is_incremental(doc, num))\n\t\t\t\t{\n\t\t\t\t\t/* Make unreusable. FIXME: would be better to link to existing free list */\n\t\t\t\t\topts.gen_list[num] = 65535;\n\t\t\t\t\topts.ofs_list[num] = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* Construct linked list of free object slots */\n\t\t\tlastfree = 0;\n\t\t\tfor (num = 0; num < xref_len; num++)\n\t\t\t{\n\t\t\t\tif (!opts.use_list[num])\n\t\t\t\t{\n\t\t\t\t\topts.gen_list[num]++;\n\t\t\t\t\topts.ofs_list[lastfree] = num;\n\t\t\t\t\tlastfree = num;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (opts.do_linear)\n\t\t{\n\t\t\topts.main_xref_offset = ftell(opts.out);\n\t\t\twritexref(doc, &opts, 0, opts.start, 0, 0, opts.first_xref_offset);\n\t\t\topts.file_len = ftell(opts.out);\n\n\t\t\tmake_hint_stream(doc, &opts);\n\t\t\topts.file_len += opts.hintstream_len;\n\t\t\topts.main_xref_offset += opts.hintstream_len;\n\t\t\tupdate_linearization_params(doc, &opts);\n\t\t\tfseek(opts.out, 0, 0);\n\t\t\twriteobjects(doc, &opts, 1);\n\n\t\t\tpadto(opts.out, opts.main_xref_offset);\n\t\t\twritexref(doc, &opts, 0, opts.start, 0, 0, opts.first_xref_offset);\n\t\t}\n\t\telse\n\t\t{\n\t\t\topts.first_xref_offset = ftell(opts.out);\n\t\t\tif (opts.do_incremental && doc->has_xref_streams)\n\t\t\t\twritexrefstream(doc, &opts, 0, xref_len, 1, 0, opts.first_xref_offset);\n\t\t\telse\n\t\t\t\twritexref(doc, &opts, 0, xref_len, 1, 0, opts.first_xref_offset);\n\t\t}\n\n\t\tfclose(opts.out);\n\t\topts.out = NULL;\n\t\tcomplete_signatures(doc, &opts, filename);\n\n\t\tdoc->dirty = 0;\n\t}\n\tfz_always(ctx)\n\t{\n#ifdef DEBUG_LINEARIZATION\n\t\tpage_objects_dump(&opts);\n\t\tobjects_dump(doc, &opts);\n#endif\n\t\tfz_free(ctx, opts.use_list);\n\t\tfz_free(ctx, opts.ofs_list);\n\t\tfz_free(ctx, opts.gen_list);\n\t\tfz_free(ctx, opts.renumber_map);\n\t\tfz_free(ctx, opts.rev_renumber_map);\n\t\tfz_free(ctx, opts.rev_gen_list);\n\t\tpdf_drop_obj(opts.linear_l);\n\t\tpdf_drop_obj(opts.linear_h0);\n\t\tpdf_drop_obj(opts.linear_h1);\n\t\tpdf_drop_obj(opts.linear_o);\n\t\tpdf_drop_obj(opts.linear_e);\n\t\tpdf_drop_obj(opts.linear_n);\n\t\tpdf_drop_obj(opts.linear_t);\n\t\tpdf_drop_obj(opts.hints_s);\n\t\tpdf_drop_obj(opts.hints_length);\n\t\tpage_objects_list_destroy(ctx, opts.page_object_lists);\n\t\tif (opts.out)\n\t\t\tfclose(opts.out);\n\t\tdoc->freeze_updates = 0;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\n#define KIDS_PER_LEVEL 32\n\n#if 0\n\n// TODO: pdf_rebalance_page_tree(doc);\n\nstatic pdf_obj *\nmake_page_tree_node(pdf_document *doc, int l, int r, pdf_obj *parent_ref, int root)\n{\n\tfz_context *ctx = doc->ctx;\n\tint count_per_kid, spaces;\n\tpdf_obj *a = NULL;\n\tpdf_obj *me = NULL;\n\tpdf_obj *o = NULL;\n\tpdf_obj *me_ref = NULL;\n\n\tcount_per_kid = 1;\n\twhile(count_per_kid * KIDS_PER_LEVEL < r-l)\n\t\tcount_per_kid *= KIDS_PER_LEVEL;\n\n\tfz_var(o);\n\tfz_var(me);\n\tfz_var(a);\n\tfz_var(me_ref);\n\n\tfz_try(ctx)\n\t{\n\t\tme = pdf_new_dict(doc, 2);\n\t\tpdf_dict_puts_drop(me, \"Type\", pdf_new_name(doc, \"Pages\"));\n\t\tpdf_dict_puts_drop(me, \"Count\", pdf_new_int(doc, r-l));\n\t\tif (!root)\n\t\t\tpdf_dict_puts(me, \"Parent\", parent_ref);\n\t\ta = pdf_new_array(doc, KIDS_PER_LEVEL);\n\t\tme_ref = pdf_new_ref(doc, me);\n\n\t\tfor (spaces = KIDS_PER_LEVEL; l < r; spaces--)\n\t\t{\n\t\t\tif (spaces >= r-l)\n\t\t\t{\n\t\t\t\to = pdf_keep_obj(doc->page_refs[l++]);\n\t\t\t\tpdf_dict_puts(o, \"Parent\", me_ref);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tint j = l+count_per_kid;\n\t\t\t\tif (j > r)\n\t\t\t\t\tj = r;\n\t\t\t\to = make_page_tree_node(doc, l, j, me_ref, 0);\n\t\t\t\tl = j;\n\t\t\t}\n\t\t\tpdf_array_push(a, o);\n\t\t\tpdf_drop_obj(o);\n\t\t\to = NULL;\n\t\t}\n\t\tpdf_dict_puts_drop(me, \"Kids\", a);\n\t\ta = NULL;\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(me);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_obj(a);\n\t\tpdf_drop_obj(o);\n\t\tpdf_drop_obj(me);\n\t\tfz_rethrow_message(ctx, \"Failed to synthesize new page tree\");\n\t}\n\treturn me_ref;\n}\n\nstatic void\npdf_rebalance_page_tree(pdf_document *doc)\n{\n\tpdf_obj *catalog;\n\tpdf_obj *pages;\n\n\tif (!doc || !doc->needs_page_tree_rebuild)\n\t\treturn;\n\n\tcatalog = pdf_dict_gets(pdf_trailer(doc), \"Root\");\n\tpages = make_page_tree_node(doc, 0, doc->page_len, catalog, 1);\n\tpdf_dict_puts_drop(catalog, \"Pages\", pages);\n\n\tdoc->needs_page_tree_rebuild = 0;\n}\n\n#endif\n\nstatic void\npdf_rebalance_page_tree(pdf_document *doc)\n{\n}\n\nvoid pdf_finish_edit(pdf_document *doc)\n{\n\tif (!doc)\n\t\treturn;\n\tpdf_rebalance_page_tree(doc);\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-xobject.c",
    "content": "#include \"mupdf/pdf.h\"\n\npdf_xobject *\npdf_keep_xobject(fz_context *ctx, pdf_xobject *xobj)\n{\n\treturn (pdf_xobject *)fz_keep_storable(ctx, &xobj->storable);\n}\n\nvoid\npdf_drop_xobject(fz_context *ctx, pdf_xobject *xobj)\n{\n\tfz_drop_storable(ctx, &xobj->storable);\n}\n\nstatic void\npdf_free_xobject_imp(fz_context *ctx, fz_storable *xobj_)\n{\n\tpdf_xobject *xobj = (pdf_xobject *)xobj_;\n\n\tif (xobj->colorspace)\n\t\tfz_drop_colorspace(ctx, xobj->colorspace);\n\tpdf_drop_obj(xobj->resources);\n\tpdf_drop_obj(xobj->contents);\n\tpdf_drop_obj(xobj->me);\n\tfz_free(ctx, xobj);\n}\n\nstatic unsigned int\npdf_xobject_size(pdf_xobject *xobj)\n{\n\tif (xobj == NULL)\n\t\treturn 0;\n\treturn sizeof(*xobj) + (xobj->colorspace ? xobj->colorspace->size : 0);\n}\n\npdf_xobject *\npdf_load_xobject(pdf_document *doc, pdf_obj *dict)\n{\n\tpdf_xobject *form;\n\tpdf_obj *obj;\n\tfz_context *ctx = doc->ctx;\n\n\tif ((form = pdf_find_item(ctx, pdf_free_xobject_imp, dict)) != NULL)\n\t{\n\t\treturn form;\n\t}\n\n\tform = fz_malloc_struct(ctx, pdf_xobject);\n\tFZ_INIT_STORABLE(form, 1, pdf_free_xobject_imp);\n\tform->resources = NULL;\n\tform->contents = NULL;\n\tform->colorspace = NULL;\n\tform->me = NULL;\n\tform->iteration = 0;\n\n\t/* Store item immediately, to avoid possible recursion if objects refer back to this one */\n\tpdf_store_item(ctx, dict, form, pdf_xobject_size(form));\n\n\tfz_try(ctx)\n\t{\n\t\tobj = pdf_dict_gets(dict, \"BBox\");\n\t\tpdf_to_rect(ctx, obj, &form->bbox);\n\n\t\tobj = pdf_dict_gets(dict, \"Matrix\");\n\t\tif (obj)\n\t\t\tpdf_to_matrix(ctx, obj, &form->matrix);\n\t\telse\n\t\t\tform->matrix = fz_identity;\n\n\t\tform->isolated = 0;\n\t\tform->knockout = 0;\n\t\tform->transparency = 0;\n\n\t\tobj = pdf_dict_gets(dict, \"Group\");\n\t\tif (obj)\n\t\t{\n\t\t\tpdf_obj *attrs = obj;\n\n\t\t\tform->isolated = pdf_to_bool(pdf_dict_gets(attrs, \"I\"));\n\t\t\tform->knockout = pdf_to_bool(pdf_dict_gets(attrs, \"K\"));\n\n\t\t\tobj = pdf_dict_gets(attrs, \"S\");\n\t\t\tif (pdf_is_name(obj) && !strcmp(pdf_to_name(obj), \"Transparency\"))\n\t\t\t\tform->transparency = 1;\n\n\t\t\tobj = pdf_dict_gets(attrs, \"CS\");\n\t\t\tif (obj)\n\t\t\t{\n\t\t\t\tfz_try(ctx)\n\t\t\t\t{\n\t\t\t\t\tform->colorspace = pdf_load_colorspace(doc, obj);\n\t\t\t\t}\n\t\t\t\tfz_catch(ctx)\n\t\t\t\t{\n\t\t\t\t\tfz_warn(ctx, \"cannot load xobject colorspace\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tform->resources = pdf_dict_gets(dict, \"Resources\");\n\t\tif (form->resources)\n\t\t\tpdf_keep_obj(form->resources);\n\n\t\tform->contents = pdf_keep_obj(dict);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_remove_item(ctx, pdf_free_xobject_imp, dict);\n\t\tpdf_drop_xobject(ctx, form);\n\t\tfz_rethrow_message(ctx, \"cannot load xobject content stream (%d %d R)\", pdf_to_num(dict), pdf_to_gen(dict));\n\t}\n\tform->me = pdf_keep_obj(dict);\n\n\treturn form;\n}\n\npdf_obj *\npdf_new_xobject(pdf_document *doc, const fz_rect *bbox, const fz_matrix *mat)\n{\n\tint idict_num;\n\tpdf_obj *idict = NULL;\n\tpdf_obj *dict = NULL;\n\tpdf_xobject *form = NULL;\n\tpdf_obj *obj = NULL;\n\tpdf_obj *res = NULL;\n\tpdf_obj *procset = NULL;\n\tfz_context *ctx = doc->ctx;\n\n\tfz_var(idict);\n\tfz_var(dict);\n\tfz_var(form);\n\tfz_var(obj);\n\tfz_var(res);\n\tfz_var(procset);\n\tfz_try(ctx)\n\t{\n\t\tdict = pdf_new_dict(doc, 0);\n\n\t\tobj = pdf_new_rect(doc, bbox);\n\t\tpdf_dict_puts(dict, \"BBox\", obj);\n\t\tpdf_drop_obj(obj);\n\t\tobj = NULL;\n\n\t\tobj = pdf_new_int(doc, 1);\n\t\tpdf_dict_puts(dict, \"FormType\", obj);\n\t\tpdf_drop_obj(obj);\n\t\tobj = NULL;\n\n\t\tobj = pdf_new_int(doc, 0);\n\t\tpdf_dict_puts(dict, \"Length\", obj);\n\t\tpdf_drop_obj(obj);\n\t\tobj = NULL;\n\n\t\tobj = pdf_new_matrix(doc, mat);\n\t\tpdf_dict_puts(dict, \"Matrix\", obj);\n\t\tpdf_drop_obj(obj);\n\t\tobj = NULL;\n\n\t\tres = pdf_new_dict(doc, 0);\n\t\tprocset = pdf_new_array(doc, 2);\n\t\tobj = pdf_new_name(doc, \"PDF\");\n\t\tpdf_array_push(procset, obj);\n\t\tpdf_drop_obj(obj);\n\t\tobj = NULL;\n\t\tobj = pdf_new_name(doc, \"Text\");\n\t\tpdf_array_push(procset, obj);\n\t\tpdf_drop_obj(obj);\n\t\tobj = NULL;\n\t\tpdf_dict_puts(res, \"ProcSet\", procset);\n\t\tpdf_drop_obj(procset);\n\t\tprocset = NULL;\n\t\tpdf_dict_puts(dict, \"Resources\", res);\n\n\t\tobj = pdf_new_name(doc, \"Form\");\n\t\tpdf_dict_puts(dict, \"Subtype\", obj);\n\t\tpdf_drop_obj(obj);\n\t\tobj = NULL;\n\n\t\tobj = pdf_new_name(doc, \"XObject\");\n\t\tpdf_dict_puts(dict, \"Type\", obj);\n\t\tpdf_drop_obj(obj);\n\t\tobj = NULL;\n\n\t\tform = fz_malloc_struct(ctx, pdf_xobject);\n\t\tFZ_INIT_STORABLE(form, 1, pdf_free_xobject_imp);\n\t\tform->resources = NULL;\n\t\tform->contents = NULL;\n\t\tform->colorspace = NULL;\n\t\tform->me = NULL;\n\t\tform->iteration = 0;\n\n\t\tform->bbox = *bbox;\n\n\t\tform->matrix = *mat;\n\n\t\tform->isolated = 0;\n\t\tform->knockout = 0;\n\t\tform->transparency = 0;\n\n\t\tform->resources = res;\n\t\tres = NULL;\n\n\t\tidict_num = pdf_create_object(doc);\n\t\tpdf_update_object(doc, idict_num, dict);\n\t\tidict = pdf_new_indirect(doc, idict_num, 0);\n\t\tpdf_drop_obj(dict);\n\t\tdict = NULL;\n\n\t\tpdf_store_item(ctx, idict, form, pdf_xobject_size(form));\n\n\t\tform->contents = pdf_keep_obj(idict);\n\t\tform->me = pdf_keep_obj(idict);\n\n\t\tpdf_drop_xobject(ctx, form);\n\t\tform = NULL;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_obj(procset);\n\t\tpdf_drop_obj(res);\n\t\tpdf_drop_obj(obj);\n\t\tpdf_drop_obj(dict);\n\t\tpdf_drop_obj(idict);\n\t\tpdf_drop_xobject(ctx, form);\n\t\tfz_rethrow_message(ctx, \"failed to create xobject)\");\n\t}\n\n\treturn idict;\n}\n\nvoid pdf_update_xobject_contents(pdf_document *doc, pdf_xobject *form, fz_buffer *buffer)\n{\n\tpdf_dict_dels(form->contents, \"Filter\");\n\tpdf_dict_puts_drop(form->contents, \"Length\", pdf_new_int(doc, buffer->len));\n\tpdf_update_stream(doc, pdf_to_num(form->contents), buffer);\n\tform->iteration ++;\n}\n\n/* SumatraPDF: allow to synthesize XObjects (cf. pdf_create_annot_ex) */\npdf_xobject *\npdf_create_xobject(fz_context *ctx, pdf_obj *dict)\n{\n\tpdf_xobject *form = fz_malloc_struct(ctx, pdf_xobject);\n\n\tFZ_INIT_STORABLE(form, 1, pdf_free_xobject_imp);\n\tform->matrix = fz_identity;\n\tform->me = pdf_keep_obj(dict);\n\n\treturn form;\n}\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-xref-aux.c",
    "content": "#include \"mupdf/pdf.h\"\n\n/*\n\tThese functions have been split out of pdf_xref.c to allow tools\n\tto be linked without pulling in the interpreter. The interpreter\n\treferences the built-in font and cmap resources which are quite\n\tbig. Not linking those into the tools saves roughly 6MB in the\n\tresulting executables.\n*/\n\npdf_document *\npdf_open_document_with_stream(fz_context *ctx, fz_stream *file)\n{\n\tpdf_document *doc = pdf_open_document_no_run_with_stream(ctx, file);\n\tdoc->super.run_page_contents = (fz_document_run_page_contents_fn *)pdf_run_page_contents;\n\tdoc->super.run_annot = (fz_document_run_annot_fn *)pdf_run_annot;\n\tdoc->update_appearance = pdf_update_appearance;\n\treturn doc;\n}\n\npdf_document *\npdf_open_document(fz_context *ctx, const char *filename)\n{\n\tpdf_document *doc = pdf_open_document_no_run(ctx, filename);\n\tdoc->super.run_page_contents = (fz_document_run_page_contents_fn *)pdf_run_page_contents;\n\tdoc->super.run_annot = (fz_document_run_annot_fn *)pdf_run_annot;\n\tdoc->update_appearance = pdf_update_appearance;\n\treturn doc;\n}\n\nfz_document_handler pdf_document_handler =\n{\n\t(fz_document_recognize_fn *)&pdf_recognize,\n\t(fz_document_open_fn *)&pdf_open_document,\n\t(fz_document_open_with_stream_fn *)&pdf_open_document_with_stream\n};\n"
  },
  {
    "path": "mupdf/source/pdf/pdf-xref.c",
    "content": "#include \"mupdf/pdf.h\"\n#include \"mupdf/fitz/document.h\"\n\n#undef DEBUG_PROGESSIVE_ADVANCE\n\n#ifdef DEBUG_PROGESSIVE_ADVANCE\n#define DEBUGMESS(A) do { fz_warn A; } while (0)\n#else\n#define DEBUGMESS(A) do { } while (0)\n#endif\n\nstatic inline int iswhite(int ch)\n{\n\treturn\n\t\tch == '\\000' || ch == '\\011' || ch == '\\012' ||\n\t\tch == '\\014' || ch == '\\015' || ch == '\\040';\n}\n\n/*\n * xref tables\n */\n\nstatic void pdf_free_xref_sections(pdf_document *doc)\n{\n\tfz_context *ctx = doc->ctx;\n\tint x, e;\n\n\tfor (x = 0; x < doc->num_xref_sections; x++)\n\t{\n\t\tpdf_xref *xref = &doc->xref_sections[x];\n\t\tpdf_xref_subsec *sub = xref->subsec;\n\n\t\twhile (sub != NULL)\n\t\t{\n\t\t\tpdf_xref_subsec *next_sub = sub->next;\n\t\t\tfor (e = 0; e < sub->len; e++)\n\t\t\t{\n\t\t\t\tpdf_xref_entry *entry = &sub->table[e];\n\n\t\t\t\tif (entry->obj)\n\t\t\t\t{\n\t\t\t\t\tpdf_drop_obj(entry->obj);\n\t\t\t\t\tfz_drop_buffer(ctx, entry->stm_buf);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfz_free(ctx, sub->table);\n\t\t\tfz_free(ctx, sub);\n\t\t\tsub = next_sub;\n\t\t}\n\n\t\tpdf_drop_obj(xref->pre_repair_trailer);\n\t\tpdf_drop_obj(xref->trailer);\n\t}\n\n\tfz_free(ctx, doc->xref_sections);\n\tdoc->xref_sections = NULL;\n\tdoc->num_xref_sections = 0;\n}\n\nstatic void\nextend_xref_index(fz_context *ctx, pdf_document *doc, int newlen)\n{\n\tint i;\n\n\tdoc->xref_index = fz_resize_array(ctx, doc->xref_index, newlen, sizeof(int));\n\tfor (i = doc->max_xref_len; i < newlen; i++)\n\t{\n\t\tdoc->xref_index[i] = 0;\n\t}\n\tdoc->max_xref_len = newlen;\n}\n\n/* This is only ever called when we already have an incremental\n * xref. This means there will only be 1 subsec, and it will be\n * a complete subsec. */\nstatic void pdf_resize_xref(fz_context *ctx, pdf_document *doc, int newlen)\n{\n\tint i;\n\tpdf_xref *xref = &doc->xref_sections[0];\n\tpdf_xref_subsec *sub;\n\n\tassert(xref != NULL);\n\tsub = xref->subsec;\n\tassert(sub->next == NULL && sub->start == 0 && sub->len == xref->num_objects);\n\tassert(newlen > xref->num_objects);\n\n\tsub->table = fz_resize_array(ctx, sub->table, newlen, sizeof(pdf_xref_entry));\n\tfor (i = xref->num_objects; i < newlen; i++)\n\t{\n\t\tsub->table[i].type = 0;\n\t\tsub->table[i].ofs = 0;\n\t\tsub->table[i].gen = 0;\n\t\tsub->table[i].stm_ofs = 0;\n\t\tsub->table[i].stm_buf = NULL;\n\t\tsub->table[i].obj = NULL;\n\t}\n\txref->num_objects = newlen;\n\tsub->len = newlen;\n\tif (doc->max_xref_len < newlen)\n\t\textend_xref_index(ctx, doc, newlen);\n}\n\nstatic void pdf_populate_next_xref_level(pdf_document *doc)\n{\n\tpdf_xref *xref;\n\tdoc->xref_sections = fz_resize_array(doc->ctx, doc->xref_sections, doc->num_xref_sections + 1, sizeof(pdf_xref));\n\tdoc->num_xref_sections++;\n\n\txref = &doc->xref_sections[doc->num_xref_sections - 1];\n\txref->subsec = NULL;\n\txref->num_objects = 0;\n\txref->trailer = NULL;\n\txref->pre_repair_trailer = NULL;\n}\n\npdf_obj *pdf_trailer(pdf_document *doc)\n{\n\t/* Return the document's final trailer */\n\tpdf_xref *xref = &doc->xref_sections[0];\n\n\treturn xref->trailer;\n}\n\nvoid pdf_set_populating_xref_trailer(pdf_document *doc, pdf_obj *trailer)\n{\n\t/* Update the trailer of the xref section being populated */\n\tpdf_xref *xref = &doc->xref_sections[doc->num_xref_sections - 1];\n\tif (xref->trailer)\n\t{\n\t\tpdf_drop_obj(xref->pre_repair_trailer);\n\t\txref->pre_repair_trailer = xref->trailer;\n\t}\n\txref->trailer = pdf_keep_obj(trailer);\n}\n\nint pdf_xref_len(pdf_document *doc)\n{\n\treturn doc->max_xref_len;\n}\n\n/* Ensure that the given xref has a single subsection\n * that covers the entire range. */\nstatic void\nensure_solid_xref(pdf_document *doc, int num, int which)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_xref *xref = &doc->xref_sections[which];\n\tpdf_xref_subsec *sub = xref->subsec;\n\tpdf_xref_subsec *new_sub;\n\n\tif (num < xref->num_objects)\n\t\tnum = xref->num_objects;\n\n\tif (sub != NULL && sub->next == NULL && sub->start == 0 && sub->len >= num)\n\t\treturn;\n\n\tnew_sub = fz_malloc_struct(ctx, pdf_xref_subsec);\n\tfz_try(ctx)\n\t{\n\t\tnew_sub->table = fz_calloc(ctx, num, sizeof(pdf_xref_entry));\n\t\tnew_sub->start = 0;\n\t\tnew_sub->len = num;\n\t\tnew_sub->next = NULL;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, new_sub);\n\t\tfz_rethrow(ctx);\n\t}\n\n\t/* Move objects over to the new subsection and destroy the old\n\t * ones */\n\tsub = xref->subsec;\n\twhile (sub != NULL)\n\t{\n\t\tpdf_xref_subsec *next = sub->next;\n\t\tint i;\n\n\t\tfor (i = 0; i < sub->len; i++)\n\t\t{\n\t\t\tnew_sub->table[i+sub->start] = sub->table[i];\n\t\t}\n\t\tfz_free(ctx, sub->table);\n\t\tfz_free(ctx, sub);\n\t\tsub = next;\n\t}\n\txref->num_objects = num;\n\txref->subsec = new_sub;\n\tif (doc->max_xref_len < num)\n\t\textend_xref_index(ctx, doc, num);\n}\n\n/* Used while reading the individual xref sections from a file */\npdf_xref_entry *pdf_get_populating_xref_entry(pdf_document *doc, int num)\n{\n\t/* Return an entry within the xref currently being populated */\n\tpdf_xref *xref;\n\tpdf_xref_subsec *sub;\n\n\tif (doc->num_xref_sections == 0)\n\t{\n\t\tdoc->xref_sections = fz_calloc(doc->ctx, 1, sizeof(pdf_xref));\n\t\tdoc->num_xref_sections = 1;\n\t}\n\n\t/* Prevent accidental heap underflow */\n\tif (num < 0)\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"object number must not be negative (%d)\", num);\n\n\t/* Return the pointer to the entry in the last section. */\n\txref = &doc->xref_sections[doc->num_xref_sections-1];\n\n\tfor (sub = xref->subsec; sub != NULL; sub = sub->next)\n\t{\n\t\tif (num >= sub->start && num < sub->start + sub->len)\n\t\t\treturn &sub->table[num-sub->start];\n\t}\n\n\t/* We've been asked for an object that's not in a subsec. */\n\tensure_solid_xref(doc, num+1, doc->num_xref_sections-1);\n\txref = &doc->xref_sections[doc->num_xref_sections-1];\n\tsub = xref->subsec;\n\n\treturn &sub->table[num-sub->start];\n}\n\n/* Used after loading a document to access entries */\n/* This will never throw anything, or return NULL if it is\n * only asked to return objects in range within a 'solid'\n * xref. */\npdf_xref_entry *pdf_get_xref_entry(pdf_document *doc, int i)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_xref *xref;\n\tpdf_xref_subsec *sub;\n\tint j;\n\n\tif (i < 0)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Negative object number requested\");\n\n\tif (i <= doc->max_xref_len)\n\t\tj = doc->xref_index[i];\n\telse\n\t\tj = 0;\n\n\t/* Find the first xref section where the entry is defined. */\n\tfor (; j < doc->num_xref_sections; j++)\n\t{\n\t\txref = &doc->xref_sections[j];\n\n\t\tif (i < xref->num_objects)\n\t\t{\n\t\t\tfor (sub = xref->subsec; sub != NULL; sub = sub->next)\n\t\t\t{\n\t\t\t\tpdf_xref_entry *entry;\n\n\t\t\t\tif (i < sub->start || i >= sub->start + sub->len)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tentry = &sub->table[i - sub->start];\n\t\t\t\tif (entry->type)\n\t\t\t\t{\n\t\t\t\t\tdoc->xref_index[i] = j;\n\t\t\t\t\treturn entry;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Didn't find the entry in any section. Return the entry from\n\t * the final section. */\n\tdoc->xref_index[i] = 0;\n\tif (i < xref->num_objects)\n\t{\n\t\txref = &doc->xref_sections[0];\n\t\tfor (sub = xref->subsec; sub != NULL; sub = sub->next)\n\t\t{\n\t\t\tif (i >= sub->start && i < sub->start + sub->len)\n\t\t\t\treturn &sub->table[i - sub->start];\n\t\t}\n\t}\n\n\t/* At this point, we solidify the xref. This ensures that we\n\t * can return a pointer. This is the only case where this function\n\t * might throw an exception, and it will never happen when we are\n\t * working within a 'solid' xref. */\n\tensure_solid_xref(doc, i+1, 0);\n\txref = &doc->xref_sections[0];\n\tsub = xref->subsec;\n\treturn &sub->table[i - sub->start];\n}\n\n/*\n\tEnsure we have an incremental xref section where we can store\n\tupdated versions of indirect objects. This is a new xref section\n\tconsisting of a single xref subsection.\n*/\nstatic void ensure_incremental_xref(pdf_document *doc)\n{\n\tfz_context *ctx = doc->ctx;\n\n\tif (!doc->xref_altered)\n\t{\n\t\tpdf_xref *xref = &doc->xref_sections[0];\n\t\tpdf_xref *pxref;\n\t\tpdf_xref_entry *new_table = fz_calloc(ctx, xref->num_objects, sizeof(pdf_xref_entry));\n\t\tpdf_xref_subsec *sub;\n\t\tpdf_obj *trailer = NULL;\n\t\tint i;\n\n\t\tfz_var(trailer);\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tsub = fz_malloc_struct(ctx, pdf_xref_subsec);\n\t\t\ttrailer = pdf_copy_dict(xref->trailer);\n\t\t\tdoc->xref_sections = fz_resize_array(ctx, doc->xref_sections, doc->num_xref_sections + 1, sizeof(pdf_xref));\n\t\t\txref = &doc->xref_sections[0];\n\t\t\tpxref = &doc->xref_sections[1];\n\t\t\tmemmove(pxref, xref, doc->num_xref_sections * sizeof(pdf_xref));\n\t\t\t/* xref->num_objects is already correct */\n\t\t\txref->subsec = sub;\n\t\t\txref->trailer = trailer;\n\t\t\txref->pre_repair_trailer = NULL;\n\t\t\tsub->next = NULL;\n\t\t\tsub->len = xref->num_objects;\n\t\t\tsub->start = 0;\n\t\t\tsub->table = new_table;\n\t\t\tdoc->num_xref_sections++;\n\t\t\tdoc->xref_altered = 1;\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_free(ctx, new_table);\n\t\t\tpdf_drop_obj(trailer);\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\n\t\t/* Update the xref_index */\n\t\tfor (i = 0; i < doc->max_xref_len; i++)\n\t\t{\n\t\t\tdoc->xref_index[i]++;\n\t\t}\n\t}\n}\n\n/* Used when altering a document */\nstatic pdf_xref_entry *pdf_get_incremental_xref_entry(pdf_document *doc, int i)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_xref *xref;\n\tpdf_xref_subsec *sub;\n\n\t/* Make a new final xref section if we haven't already */\n\tensure_incremental_xref(doc);\n\n\txref = &doc->xref_sections[0];\n\tif (i >= xref->num_objects)\n\t\tpdf_resize_xref(ctx, doc, i + 1);\n\n\tsub = xref->subsec;\n\tassert(sub != NULL && sub->next == NULL);\n\tassert(i >= sub->start && i < sub->start + sub->len);\n\tdoc->xref_index[i] = 0;\n\treturn &sub->table[i - sub->start];\n}\n\nint pdf_xref_is_incremental(pdf_document *doc, int num)\n{\n\tpdf_xref *xref = &doc->xref_sections[0];\n\tpdf_xref_subsec *sub = xref->subsec;\n\n\tassert(sub != NULL && sub->next == NULL && sub->len == xref->num_objects && sub->start == 0);\n\n\treturn doc->xref_altered && num < xref->num_objects && sub->table[num].type;\n}\n\n/* Ensure that the current populating xref has a single subsection\n * that covers the entire range. */\nvoid pdf_ensure_solid_xref(pdf_document *doc, int num)\n{\n\tif (doc->num_xref_sections == 0)\n\t\tpdf_populate_next_xref_level(doc);\n\n\tensure_solid_xref(doc, num, doc->num_xref_sections-1);\n}\n\n/* Ensure that an object has been cloned into the incremental xref section */\nvoid pdf_xref_ensure_incremental_object(pdf_document *doc, int num)\n{\n\tpdf_xref_entry *new_entry, *old_entry;\n\tpdf_xref_subsec *sub = NULL;\n\tint i;\n\n\t/* Make sure we have created an xref section for incremental updates */\n\tensure_incremental_xref(doc);\n\n\t/* Search for the section that contains this object */\n\tfor (i = doc->xref_index[num]; i < doc->num_xref_sections; i++)\n\t{\n\t\tpdf_xref *xref = &doc->xref_sections[i];\n\n\t\tif (num < 0 && num >= xref->num_objects)\n\t\t\tbreak;\n\t\tfor (sub = xref->subsec; sub != NULL; sub = sub->next)\n\t\t{\n\t\t\tif (sub->start <= num && num < sub->start + sub->len && sub->table[num - sub->start].type)\n\t\t\t\tbreak;\n\t\t}\n\t\tif (sub != NULL)\n\t\t\tbreak;\n\t}\n\t/* sub == NULL implies we did not find it */\n\n\t/* If we don't find it, or it's already in the incremental section, return */\n\tif (i == 0 || sub == NULL)\n\t\treturn;\n\n\t/* Move the object to the incremental section */\n\tdoc->xref_index[num] = 0;\n\told_entry = &sub->table[num - sub->start];\n\tnew_entry = pdf_get_incremental_xref_entry(doc, num);\n\t*new_entry = *old_entry;\n\told_entry->obj = NULL;\n\told_entry->stm_buf = NULL;\n}\n\nvoid pdf_replace_xref(pdf_document *doc, pdf_xref_entry *entries, int n)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_xref *xref = NULL;\n\tpdf_xref_subsec *sub;\n\tpdf_obj *trailer = pdf_keep_obj(pdf_trailer(doc));\n\n\tfz_var(xref);\n\tfz_try(ctx)\n\t{\n\t\tdoc->xref_index = fz_calloc(ctx, n, sizeof(int));\n\t\txref = fz_malloc_struct(ctx, pdf_xref);\n\t\tsub = fz_malloc_struct(ctx, pdf_xref_subsec);\n\n\t\t/* The new table completely replaces the previous separate sections */\n\t\tpdf_free_xref_sections(doc);\n\n\t\tsub->table = entries;\n\t\tsub->start = 0;\n\t\tsub->len = n;\n\t\txref->subsec = sub;\n\t\txref->num_objects = n;\n\t\txref->trailer = trailer;\n\t\ttrailer = NULL;\n\n\t\tdoc->xref_sections = xref;\n\t\tdoc->num_xref_sections = 1;\n\t\tdoc->max_xref_len = n;\n\n\t\tmemset(doc->xref_index, 0, sizeof(int)*doc->max_xref_len);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_free(ctx, xref);\n\t\tpdf_drop_obj(trailer);\n\t\tfz_rethrow(ctx);\n\t}\n}\n\n/*\n * magic version tag and startxref\n */\n\nstatic void\npdf_load_version(pdf_document *doc)\n{\n\tchar buf[20];\n\n\tfz_seek(doc->file, 0, SEEK_SET);\n\tfz_read_line(doc->file, buf, sizeof buf);\n\tif (memcmp(buf, \"%PDF-\", 5) != 0)\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"cannot recognize version marker\");\n\n\tdoc->version = 10 * (fz_atof(buf+5) + 0.05);\n}\n\nstatic void\npdf_read_start_xref(pdf_document *doc)\n{\n\tunsigned char buf[1024];\n\tint t, n;\n\tint i;\n\n\tfz_seek(doc->file, 0, SEEK_END);\n\n\tdoc->file_size = fz_tell(doc->file);\n\n\tt = fz_maxi(0, doc->file_size - (int)sizeof buf);\n\tfz_seek(doc->file, t, SEEK_SET);\n\n\tn = fz_read(doc->file, buf, sizeof buf);\n\n\tfor (i = n - 9; i >= 0; i--)\n\t{\n\t\tif (memcmp(buf + i, \"startxref\", 9) == 0)\n\t\t{\n\t\t\ti += 9;\n\t\t\twhile (i < n && iswhite(buf[i]))\n\t\t\t\ti ++;\n\t\t\tdoc->startxref = 0;\n\t\t\twhile (i < n && buf[i] >= '0' && buf[i] <= '9')\n\t\t\t\tdoc->startxref = doc->startxref * 10 + (buf[i++] - '0');\n\t\t\tif (doc->startxref != 0)\n\t\t\t\treturn;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"cannot find startxref\");\n}\n\n/*\n * trailer dictionary\n */\n\nstatic int\npdf_xref_size_from_old_trailer(pdf_document *doc, pdf_lexbuf *buf)\n{\n\tint len;\n\tchar *s;\n\tint t;\n\tpdf_token tok;\n\tint c;\n\tint size;\n\tint ofs;\n\tpdf_obj *trailer = NULL;\n\n\tfz_var(trailer);\n\n\t/* Record the current file read offset so that we can reinstate it */\n\tofs = fz_tell(doc->file);\n\n\tfz_read_line(doc->file, buf->scratch, buf->size);\n\tif (strncmp(buf->scratch, \"xref\", 4) != 0)\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"cannot find xref marker\");\n\n\twhile (1)\n\t{\n\t\tc = fz_peek_byte(doc->file);\n\t\tif (!(c >= '0' && c <= '9'))\n\t\t\tbreak;\n\n\t\tfz_read_line(doc->file, buf->scratch, buf->size);\n\t\ts = buf->scratch;\n\t\tfz_strsep(&s, \" \"); /* ignore ofs */\n\t\tif (!s)\n\t\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"invalid range marker in xref\");\n\t\tlen = fz_atoi(fz_strsep(&s, \" \"));\n\t\tif (len < 0)\n\t\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"xref range marker must be positive\");\n\n\t\t/* broken pdfs where the section is not on a separate line */\n\t\tif (s && *s != '\\0')\n\t\t\tfz_seek(doc->file, -(2 + (int)strlen(s)), SEEK_CUR);\n\n\t\tt = fz_tell(doc->file);\n\t\tif (t < 0)\n\t\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"cannot tell in file\");\n\t\tif (len > (INT_MAX - t) / 20)\n\t\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"xref has too many entries\");\n\n\t\tfz_seek(doc->file, t + 20 * len, SEEK_SET);\n\t}\n\n\tfz_try(doc->ctx)\n\t{\n\t\ttok = pdf_lex(doc->file, buf);\n\t\tif (tok != PDF_TOK_TRAILER)\n\t\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"expected trailer marker\");\n\n\t\ttok = pdf_lex(doc->file, buf);\n\t\tif (tok != PDF_TOK_OPEN_DICT)\n\t\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"expected trailer dictionary\");\n\n\t\ttrailer = pdf_parse_dict(doc, doc->file, buf);\n\n\t\tsize = pdf_to_int(pdf_dict_gets(trailer, \"Size\"));\n\t\tif (!size)\n\t\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"trailer missing Size entry\");\n\t}\n\tfz_always(doc->ctx)\n\t{\n\t\tpdf_drop_obj(trailer);\n\t}\n\tfz_catch(doc->ctx)\n\t{\n\t\tfz_rethrow_message(doc->ctx, \"cannot parse trailer\");\n\t}\n\n\tfz_seek(doc->file, ofs, SEEK_SET);\n\n\treturn size;\n}\n\npdf_obj *\npdf_new_ref(pdf_document *doc, pdf_obj *obj)\n{\n\tint num = pdf_create_object(doc);\n\tpdf_update_object(doc, num, obj);\n\treturn pdf_new_indirect(doc, num, 0);\n}\n\nstatic pdf_xref_entry *\npdf_xref_find_subsection(pdf_document *doc, int ofs, int len)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_xref *xref = &doc->xref_sections[doc->num_xref_sections-1];\n\tpdf_xref_subsec *sub;\n\tint new_max;\n\n\t/* Different cases here. Case 1) We might be asking for a\n\t * subsection (or a subset of a subsection) that we already\n\t * have -  Just return it. Case 2) We might be asking for a\n\t * completely new subsection - Create it and return it.\n\t * Case 3) We might have an overlapping one - Create a 'solid'\n\t * subsection and return that. */\n\n\t/* Sanity check */\n\tfor (sub = xref->subsec; sub != NULL; sub = sub->next)\n\t{\n\t\tif (ofs >= sub->start && ofs + len <= sub->start + sub->len)\n\t\t\treturn &sub->table[ofs-sub->start]; /* Case 1 */\n\t\tif (ofs + len > sub->start && ofs <= sub->start + sub->len)\n\t\t\tbreak; /* Case 3 */\n\t}\n\n\tnew_max = xref->num_objects;\n\tif (new_max < ofs + len)\n\t\tnew_max = ofs + len;\n\n\tif (sub == NULL)\n\t{\n\t\t/* Case 2 */\n\t\tsub = fz_malloc_struct(ctx, pdf_xref_subsec);\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tsub->table = fz_calloc(ctx, len, sizeof(pdf_xref_entry));\n\t\t\tsub->start = ofs;\n\t\t\tsub->len = len;\n\t\t\tsub->next = xref->subsec;\n\t\t\txref->subsec = sub;\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_free(ctx, sub);\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t\txref->num_objects = new_max;\n\t\tif (doc->max_xref_len < new_max)\n\t\t\textend_xref_index(ctx, doc, new_max);\n\t}\n\telse\n\t{\n\t\t/* Case 3 */\n\t\tensure_solid_xref(doc, new_max, doc->num_xref_sections-1);\n\t\txref = &doc->xref_sections[doc->num_xref_sections-1];\n\t\tsub = xref->subsec;\n\t}\n\treturn &sub->table[ofs-sub->start];\n}\n\nstatic pdf_obj *\npdf_read_old_xref(pdf_document *doc, pdf_lexbuf *buf)\n{\n\tint ofs, len;\n\tchar *s;\n\tint n;\n\tpdf_token tok;\n\tint i;\n\tint c;\n\tpdf_obj *trailer;\n\tint xref_len = pdf_xref_size_from_old_trailer(doc, buf);\n\tpdf_xref_entry *table;\n\n\tfz_read_line(doc->file, buf->scratch, buf->size);\n\tif (strncmp(buf->scratch, \"xref\", 4) != 0)\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"cannot find xref marker\");\n\n\twhile (1)\n\t{\n\t\tc = fz_peek_byte(doc->file);\n\t\tif (!(c >= '0' && c <= '9'))\n\t\t\tbreak;\n\n\t\tfz_read_line(doc->file, buf->scratch, buf->size);\n\t\ts = buf->scratch;\n\t\tofs = fz_atoi(fz_strsep(&s, \" \"));\n\t\tlen = fz_atoi(fz_strsep(&s, \" \"));\n\n\t\t/* broken pdfs where the section is not on a separate line */\n\t\tif (s && *s != '\\0')\n\t\t{\n\t\t\tfz_warn(doc->ctx, \"broken xref section. proceeding anyway.\");\n\t\t\tfz_seek(doc->file, -(2 + (int)strlen(s)), SEEK_CUR);\n\t\t}\n\n\t\tif (ofs < 0)\n\t\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"out of range object num in xref: %d\", ofs);\n\n\t\t/* broken pdfs where size in trailer undershoots entries in xref sections */\n\t\tif (ofs + len > xref_len)\n\t\t{\n\t\t\tfz_warn(doc->ctx, \"broken xref section, proceeding anyway.\");\n\t\t}\n\n\t\ttable = pdf_xref_find_subsection(doc, ofs, len);\n\n\t\tfor (i = ofs; i < ofs + len; i++)\n\t\t{\n\t\t\tpdf_xref_entry *entry = &table[i-ofs];\n\t\t\tn = fz_read(doc->file, (unsigned char *) buf->scratch, 20);\n\t\t\tif (n != 20)\n\t\t\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"unexpected EOF in xref table\");\n\t\t\tif (!entry->type)\n\t\t\t{\n\t\t\t\ts = buf->scratch;\n\n\t\t\t\t/* broken pdfs where line start with white space */\n\t\t\t\twhile (*s != '\\0' && iswhite(*s))\n\t\t\t\t\ts++;\n\n\t\t\t\tentry->ofs = atoi(s);\n\t\t\t\tentry->gen = atoi(s + 11);\n\t\t\t\tentry->type = s[17];\n\t\t\t\tif (s[17] != 'f' && s[17] != 'n' && s[17] != 'o')\n\t\t\t\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"unexpected xref type: %#x (%d %d R)\", s[17], i, entry->gen);\n\t\t\t}\n\t\t}\n\t}\n\n\tfz_try(doc->ctx)\n\t{\n\t\ttok = pdf_lex(doc->file, buf);\n\t\tif (tok != PDF_TOK_TRAILER)\n\t\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"expected trailer marker\");\n\n\t\ttok = pdf_lex(doc->file, buf);\n\t\tif (tok != PDF_TOK_OPEN_DICT)\n\t\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"expected trailer dictionary\");\n\n\t\ttrailer = pdf_parse_dict(doc, doc->file, buf);\n\t}\n\tfz_catch(doc->ctx)\n\t{\n\t\tfz_rethrow_message(doc->ctx, \"cannot parse trailer\");\n\t}\n\treturn trailer;\n}\n\nstatic void\npdf_read_new_xref_section(pdf_document *doc, fz_stream *stm, int i0, int i1, int w0, int w1, int w2)\n{\n\tint i, n;\n\tpdf_xref_entry *table;\n\n\tif (i0 < 0 || i1 < 0)\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"negative xref stream entry index\");\n\t//if (i0 + i1 > pdf_xref_len(doc))\n\t//\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"xref stream has too many entries\");\n\n\ttable = pdf_xref_find_subsection(doc, i0, i1);\n\tfor (i = i0; i < i0 + i1; i++)\n\t{\n\t\tpdf_xref_entry *entry = &table[i-i0];\n\t\tint a = 0;\n\t\tint b = 0;\n\t\tint c = 0;\n\n\t\tif (fz_is_eof(stm))\n\t\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"truncated xref stream\");\n\n\t\tfor (n = 0; n < w0; n++)\n\t\t\ta = (a << 8) + fz_read_byte(stm);\n\t\tfor (n = 0; n < w1; n++)\n\t\t\tb = (b << 8) + fz_read_byte(stm);\n\t\tfor (n = 0; n < w2; n++)\n\t\t\tc = (c << 8) + fz_read_byte(stm);\n\n\t\tif (!entry->type)\n\t\t{\n\t\t\tint t = w0 ? a : 1;\n\t\t\tentry->type = t == 0 ? 'f' : t == 1 ? 'n' : t == 2 ? 'o' : 0;\n\t\t\tentry->ofs = w1 ? b : 0;\n\t\t\tentry->gen = w2 ? c : 0;\n\t\t}\n\t}\n\n\tdoc->has_xref_streams = 1;\n}\n\n/* Entered with file locked, remains locked throughout. */\nstatic pdf_obj *\npdf_read_new_xref(pdf_document *doc, pdf_lexbuf *buf)\n{\n\tfz_stream *stm = NULL;\n\tpdf_obj *trailer = NULL;\n\tpdf_obj *index = NULL;\n\tpdf_obj *obj = NULL;\n\tint num, gen, ofs, stm_ofs;\n\tint size, w0, w1, w2;\n\tint t;\n\tfz_context *ctx = doc->ctx;\n\n\tfz_var(trailer);\n\tfz_var(stm);\n\n\tfz_try(ctx)\n\t{\n\t\tofs = fz_tell(doc->file);\n\t\ttrailer = pdf_parse_ind_obj(doc, doc->file, buf, &num, &gen, &stm_ofs, NULL);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_obj(trailer);\n\t\tfz_rethrow_message(ctx, \"cannot parse compressed xref stream object\");\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tpdf_xref_entry *entry;\n\n\t\tobj = pdf_dict_gets(trailer, \"Size\");\n\t\tif (!obj)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"xref stream missing Size entry (%d %d R)\", num, gen);\n\n\t\tsize = pdf_to_int(obj);\n\n\t\tobj = pdf_dict_gets(trailer, \"W\");\n\t\tif (!obj)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"xref stream missing W entry (%d %d R)\", num, gen);\n\t\tw0 = pdf_to_int(pdf_array_get(obj, 0));\n\t\tw1 = pdf_to_int(pdf_array_get(obj, 1));\n\t\tw2 = pdf_to_int(pdf_array_get(obj, 2));\n\n\t\tif (w0 < 0)\n\t\t\tfz_warn(ctx, \"xref stream objects have corrupt type\");\n\t\tif (w1 < 0)\n\t\t\tfz_warn(ctx, \"xref stream objects have corrupt offset\");\n\t\tif (w2 < 0)\n\t\t\tfz_warn(ctx, \"xref stream objects have corrupt generation\");\n\n\t\tw0 = w0 < 0 ? 0 : w0;\n\t\tw1 = w1 < 0 ? 0 : w1;\n\t\tw2 = w2 < 0 ? 0 : w2;\n\n\t\tindex = pdf_dict_gets(trailer, \"Index\");\n\n\t\tstm = pdf_open_stream_with_offset(doc, num, gen, trailer, stm_ofs);\n\n\t\tif (!index)\n\t\t{\n\t\t\tpdf_read_new_xref_section(doc, stm, 0, size, w0, w1, w2);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tint n = pdf_array_len(index);\n\t\t\tfor (t = 0; t < n; t += 2)\n\t\t\t{\n\t\t\t\tint i0 = pdf_to_int(pdf_array_get(index, t + 0));\n\t\t\t\tint i1 = pdf_to_int(pdf_array_get(index, t + 1));\n\t\t\t\tpdf_read_new_xref_section(doc, stm, i0, i1, w0, w1, w2);\n\t\t\t}\n\t\t}\n\t\tentry = pdf_get_populating_xref_entry(doc, num);\n\t\tentry->ofs = ofs;\n\t\tentry->gen = gen;\n\t\tentry->stm_ofs = stm_ofs;\n\t\tpdf_drop_obj(entry->obj);\n\t\tentry->obj = pdf_keep_obj(trailer);\n\t\tentry->type = 'n';\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(stm);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_obj(trailer);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn trailer;\n}\n\nstatic pdf_obj *\npdf_read_xref(pdf_document *doc, int ofs, pdf_lexbuf *buf)\n{\n\tint c;\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *trailer;\n\n\tfz_seek(doc->file, ofs, SEEK_SET);\n\n\twhile (iswhite(fz_peek_byte(doc->file)))\n\t\tfz_read_byte(doc->file);\n\n\tfz_try(ctx)\n\t{\n\t\tc = fz_peek_byte(doc->file);\n\t\tif (c == 'x')\n\t\t\ttrailer = pdf_read_old_xref(doc, buf);\n\t\telse if (c >= '0' && c <= '9')\n\t\t\ttrailer = pdf_read_new_xref(doc, buf);\n\t\telse\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot recognize xref format\");\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_message(ctx, \"cannot read xref (ofs=%d)\", ofs);\n\t}\n\treturn trailer;\n}\n\ntypedef struct ofs_list_s ofs_list;\n\nstruct ofs_list_s\n{\n\tint max;\n\tint len;\n\tint *list;\n};\n\nstatic int\nread_xref_section(pdf_document *doc, int ofs, pdf_lexbuf *buf, ofs_list *offsets)\n{\n\tpdf_obj *trailer = NULL;\n\tfz_context *ctx = doc->ctx;\n\tint xrefstmofs = 0;\n\tint prevofs = 0;\n\n\tfz_var(trailer);\n\n\tfz_try(ctx)\n\t{\n\t\tint i;\n\t\t/* Avoid potential infinite recursion */\n\t\tfor (i = 0; i < offsets->len; i ++)\n\t\t{\n\t\t\tif (offsets->list[i] == ofs)\n\t\t\t\tbreak;\n\t\t}\n\t\tif (i < offsets->len)\n\t\t{\n\t\t\t/* cf. http://bugs.ghostscript.com/show_bug.cgi?id=696022 */\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"xref recursion with offset %d\", ofs);\n\t\t}\n\t\tif (offsets->len == offsets->max)\n\t\t{\n\t\t\toffsets->list = fz_resize_array(ctx, offsets->list, offsets->max*2, sizeof(int));\n\t\t\toffsets->max *= 2;\n\t\t}\n\t\toffsets->list[offsets->len++] = ofs;\n\n\t\ttrailer = pdf_read_xref(doc, ofs, buf);\n\n\t\tpdf_set_populating_xref_trailer(doc, trailer);\n\n\t\t/* FIXME: do we overwrite free entries properly? */\n\t\t/* FIXME: Does this work properly with progression? */\n\t\txrefstmofs = pdf_to_int(pdf_dict_gets(trailer, \"XRefStm\"));\n\t\tif (xrefstmofs)\n\t\t{\n\t\t\tif (xrefstmofs < 0)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"negative xref stream offset\");\n\n\t\t\t/*\n\t\t\t\tRead the XRefStm stream, but throw away the resulting trailer. We do not\n\t\t\t\tfollow any Prev tag therein, as specified on Page 108 of the PDF reference\n\t\t\t\t1.7\n\t\t\t*/\n\t\t\tpdf_drop_obj(pdf_read_xref(doc, xrefstmofs, buf));\n\t\t}\n\n\t\tprevofs = pdf_to_int(pdf_dict_gets(trailer, \"Prev\"));\n\t\tif (prevofs < 0)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"negative xref stream offset for previous xref stream\");\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_drop_obj(trailer);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_message(ctx, \"cannot read xref at offset %d\", ofs);\n\t}\n\n\treturn prevofs;\n}\n\nstatic void\npdf_read_xref_sections(pdf_document *doc, int ofs, pdf_lexbuf *buf, int read_previous)\n{\n\tfz_context *ctx = doc->ctx;\n\tofs_list list;\n\n\tlist.len = 0;\n\tlist.max = 10;\n\tlist.list = fz_malloc_array(ctx, 10, sizeof(int));\n\tfz_try(ctx)\n\t{\n\t\twhile(ofs)\n\t\t{\n\t\t\tpdf_populate_next_xref_level(doc);\n\t\t\tofs = read_xref_section(doc, ofs, buf, &list);\n\t\t\tif (!read_previous)\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_free(ctx, list.list);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic void\npdf_prime_xref_index(pdf_document *doc)\n{\n\tint i, j;\n\tint *idx = doc->xref_index;\n\n\tfor (i = doc->num_xref_sections-1; i >= 0; i--)\n\t{\n\t\tpdf_xref *xref = &doc->xref_sections[i];\n\t\tpdf_xref_subsec *subsec = xref->subsec;\n\t\twhile (subsec != NULL)\n\t\t{\n\t\t\tint start = subsec->start;\n\t\t\tint end = subsec->start + subsec->len;\n\t\t\tfor (j = start; j < end; j++)\n\t\t\t{\n\t\t\t\tchar t = subsec->table[j-start].type;\n\t\t\t\tif (t != 0 && t != 'f')\n\t\t\t\t\tidx[j] = i;\n\t\t\t}\n\n\t\t\tsubsec = subsec->next;\n\t\t}\n\t}\n}\n\n/*\n * load xref tables from pdf\n *\n * File locked on entry, throughout and on exit.\n */\n\nstatic void\npdf_load_xref(pdf_document *doc, pdf_lexbuf *buf)\n{\n\tint i;\n\tint xref_len;\n\tpdf_xref_entry *entry;\n\tfz_context *ctx = doc->ctx;\n\n\tpdf_read_start_xref(doc);\n\n\tpdf_read_xref_sections(doc, doc->startxref, buf, 1);\n\n\tif (pdf_xref_len(doc) == 0)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"found xref was empty\");\n\n\tpdf_prime_xref_index(doc);\n\n\tentry = pdf_get_xref_entry(doc, 0);\n\t/* broken pdfs where first object is missing */\n\tif (!entry->type)\n\t{\n\t\tentry->type = 'f';\n\t\tentry->gen = 65535;\n\t}\n\t/* broken pdfs where first object is not free */\n\telse if (entry->type != 'f')\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"first object in xref is not free\");\n\n\t/* broken pdfs where object offsets are out of range */\n\txref_len = pdf_xref_len(doc);\n\tfor (i = 0; i < xref_len; i++)\n\t{\n\t\tpdf_xref_entry *entry = pdf_get_xref_entry(doc, i);\n\t\tif (entry->type == 'n')\n\t\t{\n\t\t\t/* Special case code: \"0000000000 * n\" means free,\n\t\t\t * according to some producers (inc Quartz) */\n\t\t\tif (entry->ofs == 0)\n\t\t\t\tentry->type = 'f';\n\t\t\telse if (entry->ofs <= 0 || entry->ofs >= doc->file_size)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"object offset out of range: %d (%d 0 R)\", entry->ofs, i);\n\t\t}\n\t\tif (entry->type == 'o')\n\t\t\tif (entry->ofs <= 0 || entry->ofs >= xref_len || pdf_get_xref_entry(doc, entry->ofs)->type != 'n')\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"invalid reference to an objstm that does not exist: %d (%d 0 R)\", entry->ofs, i);\n\t}\n}\n\nstatic void\npdf_load_linear(pdf_document *doc)\n{\n\tpdf_obj *dict = NULL;\n\tpdf_obj *hint = NULL;\n\tpdf_obj *o;\n\tint num, gen, stmofs, lin, len;\n\tfz_context *ctx = doc->ctx;\n\n\tfz_var(dict);\n\tfz_var(hint);\n\n\tfz_try(ctx)\n\t{\n\t\tpdf_xref_entry *entry;\n\n\t\tdict = pdf_parse_ind_obj(doc, doc->file, &doc->lexbuf.base, &num, &gen, &stmofs, NULL);\n\t\tif (!pdf_is_dict(dict))\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Failed to read linearized dictionary\");\n\t\to = pdf_dict_gets(dict, \"Linearized\");\n\t\tif (o == NULL)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Failed to read linearized dictionary\");\n\t\tlin = pdf_to_int(o);\n\t\tif (lin != 1)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"Unexpected version of Linearized tag (%d)\", lin);\n\t\tlen = pdf_to_int(pdf_dict_gets(dict, \"L\"));\n\t\tif (len != doc->file_length)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"File has been updated since linearization\");\n\n\t\tpdf_read_xref_sections(doc, fz_tell(doc->file), &doc->lexbuf.base, 0);\n\n\t\tdoc->page_count = pdf_to_int(pdf_dict_gets(dict, \"N\"));\n\t\tdoc->linear_page_refs = fz_resize_array(ctx, doc->linear_page_refs, doc->page_count, sizeof(pdf_obj *));\n\t\tmemset(doc->linear_page_refs, 0, doc->page_count * sizeof(pdf_obj*));\n\t\tdoc->linear_obj = dict;\n\t\tdoc->linear_pos = fz_tell(doc->file);\n\t\tdoc->linear_page1_obj_num = pdf_to_int(pdf_dict_gets(dict, \"O\"));\n\t\tdoc->linear_page_refs[0] = pdf_new_indirect(doc, doc->linear_page1_obj_num, 0);\n\t\tdoc->linear_page_num = 0;\n\t\thint = pdf_dict_gets(dict, \"H\");\n\t\tdoc->hint_object_offset = pdf_to_int(pdf_array_get(hint, 0));\n\t\tdoc->hint_object_length = pdf_to_int(pdf_array_get(hint, 1));\n\n\t\tentry = pdf_get_populating_xref_entry(doc, 0);\n\t\tentry->type = 'f';\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_obj(dict);\n\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\t/* Drop back to non linearized reading mode */\n\t\tdoc->file_reading_linearly = 0;\n\t}\n}\n\nvoid\npdf_ocg_set_config(pdf_document *doc, int config)\n{\n\tint i, j, len, len2;\n\tpdf_ocg_descriptor *desc = doc->ocg;\n\tpdf_obj *obj, *cobj;\n\tchar *name;\n\n\tobj = pdf_dict_gets(pdf_dict_gets(pdf_trailer(doc), \"Root\"), \"OCProperties\");\n\tif (!obj)\n\t{\n\t\tif (config == 0)\n\t\t\treturn;\n\t\telse\n\t\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"Unknown OCG config (None known!)\");\n\t}\n\tif (config == 0)\n\t{\n\t\tcobj = pdf_dict_gets(obj, \"D\");\n\t\tif (!cobj)\n\t\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"No default OCG config\");\n\t}\n\telse\n\t{\n\t\tcobj = pdf_array_get(pdf_dict_gets(obj, \"Configs\"), config);\n\t\tif (!cobj)\n\t\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"Illegal OCG config\");\n\t}\n\n\tpdf_drop_obj(desc->intent);\n\tdesc->intent = pdf_dict_gets(cobj, \"Intent\");\n\tif (desc->intent)\n\t\tpdf_keep_obj(desc->intent);\n\n\tlen = desc->len;\n\tname = pdf_to_name(pdf_dict_gets(cobj, \"BaseState\"));\n\tif (strcmp(name, \"Unchanged\") == 0)\n\t{\n\t\t/* Do nothing */\n\t}\n\telse if (strcmp(name, \"OFF\") == 0)\n\t{\n\t\tfor (i = 0; i < len; i++)\n\t\t{\n\t\t\tdesc->ocgs[i].state = 0;\n\t\t}\n\t}\n\telse /* Default to ON */\n\t{\n\t\tfor (i = 0; i < len; i++)\n\t\t{\n\t\t\tdesc->ocgs[i].state = 1;\n\t\t}\n\t}\n\n\tobj = pdf_dict_gets(cobj, \"ON\");\n\tlen2 = pdf_array_len(obj);\n\tfor (i = 0; i < len2; i++)\n\t{\n\t\tpdf_obj *o = pdf_array_get(obj, i);\n\t\tint n = pdf_to_num(o);\n\t\tint g = pdf_to_gen(o);\n\t\tfor (j=0; j < len; j++)\n\t\t{\n\t\t\tif (desc->ocgs[j].num == n && desc->ocgs[j].gen == g)\n\t\t\t{\n\t\t\t\tdesc->ocgs[j].state = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tobj = pdf_dict_gets(cobj, \"OFF\");\n\tlen2 = pdf_array_len(obj);\n\tfor (i = 0; i < len2; i++)\n\t{\n\t\tpdf_obj *o = pdf_array_get(obj, i);\n\t\tint n = pdf_to_num(o);\n\t\tint g = pdf_to_gen(o);\n\t\tfor (j=0; j < len; j++)\n\t\t{\n\t\t\tif (desc->ocgs[j].num == n && desc->ocgs[j].gen == g)\n\t\t\t{\n\t\t\t\tdesc->ocgs[j].state = 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/* FIXME: Should make 'num configs' available in the descriptor. */\n\t/* FIXME: Should copy out 'Intent' here into the descriptor, and remove\n\t * csi->intent in favour of that. */\n\t/* FIXME: Should copy 'AS' into the descriptor, and visibility\n\t * decisions should respect it. */\n\t/* FIXME: Make 'Order' available via the descriptor (when we have an\n\t * app that needs it) */\n\t/* FIXME: Make 'ListMode' available via the descriptor (when we have\n\t * an app that needs it) */\n\t/* FIXME: Make 'RBGroups' available via the descriptor (when we have\n\t * an app that needs it) */\n\t/* FIXME: Make 'Locked' available via the descriptor (when we have\n\t * an app that needs it) */\n}\n\nstatic void\npdf_read_ocg(pdf_document *doc)\n{\n\tpdf_obj *obj, *ocg;\n\tint len, i;\n\tpdf_ocg_descriptor *desc;\n\tfz_context *ctx = doc->ctx;\n\n\tfz_var(desc);\n\n\tobj = pdf_dict_gets(pdf_dict_gets(pdf_trailer(doc), \"Root\"), \"OCProperties\");\n\tif (!obj)\n\t\treturn;\n\tocg = pdf_dict_gets(obj, \"OCGs\");\n\tif (!ocg || !pdf_is_array(ocg))\n\t\t/* Not ever supposed to happen, but live with it. */\n\t\treturn;\n\tlen = pdf_array_len(ocg);\n\tfz_try(ctx)\n\t{\n\t\tdesc = fz_calloc(ctx, 1, sizeof(*desc));\n\t\tdesc->len = len;\n\t\tdesc->ocgs = fz_calloc(ctx, len, sizeof(*desc->ocgs));\n\t\tdesc->intent = NULL;\n\t\tfor (i=0; i < len; i++)\n\t\t{\n\t\t\tpdf_obj *o = pdf_array_get(ocg, i);\n\t\t\tdesc->ocgs[i].num = pdf_to_num(o);\n\t\t\tdesc->ocgs[i].gen = pdf_to_gen(o);\n\t\t\tdesc->ocgs[i].state = 1;\n\t\t}\n\t\tdoc->ocg = desc;\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tif (desc)\n\t\t\tfz_free(ctx, desc->ocgs);\n\t\tfz_free(ctx, desc);\n\t\tfz_rethrow(ctx);\n\t}\n\n\tpdf_ocg_set_config(doc, 0);\n}\n\nstatic void\npdf_free_ocg(fz_context *ctx, pdf_ocg_descriptor *desc)\n{\n\tif (!desc)\n\t\treturn;\n\n\tpdf_drop_obj(desc->intent);\n\tfz_free(ctx, desc->ocgs);\n\tfz_free(ctx, desc);\n}\n\n/*\n * Initialize and load xref tables.\n * If password is not null, try to decrypt.\n */\n\nstatic void\npdf_init_document(pdf_document *doc)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_obj *encrypt, *id;\n\tpdf_obj *dict = NULL;\n\tpdf_obj *obj;\n\tpdf_obj *nobj = NULL;\n\tint i, repaired = 0;\n\n\tfz_var(dict);\n\tfz_var(nobj);\n\n\tfz_try(ctx)\n\t{\n\t\tpdf_load_version(doc);\n\n\t\tdoc->file_length = fz_stream_meta(doc->file, FZ_STREAM_META_LENGTH, 0, NULL);\n\t\tif (doc->file_length < 0)\n\t\t\tdoc->file_length = 0;\n\n\t\t/* Check to see if we should work in progressive mode */\n\t\tif (fz_stream_meta(doc->file, FZ_STREAM_META_PROGRESSIVE, 0, NULL) > 0)\n\t\t\tdoc->file_reading_linearly = 1;\n\n\t\t/* Try to load the linearized file if we are in progressive\n\t\t * mode. */\n\t\tif (doc->file_reading_linearly)\n\t\t\tpdf_load_linear(doc);\n\n\t\t/* If we aren't in progressive mode (or the linear load failed\n\t\t * and has set us back to non-progressive mode), load normally.\n\t\t */\n\t\tif (!doc->file_reading_linearly)\n\t\t\tpdf_load_xref(doc, &doc->lexbuf.base);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_free_xref_sections(doc);\n\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\tfz_warn(ctx, \"trying to repair broken xref\");\n\t\trepaired = 1;\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tint hasroot, hasinfo;\n\n\t\tif (repaired)\n\t\t{\n\t\t\t/* pdf_repair_xref may access xref_index, so reset it properly */\n\t\t\tmemset(doc->xref_index, 0, sizeof(int) * doc->max_xref_len);\n\t\t\t/* cf. http://bugs.ghostscript.com/show_bug.cgi?id=696012 */\n\t\t\tpdf_get_populating_xref_entry(doc, 0);\n\t\t\tpdf_repair_xref(doc);\n\t\t\tpdf_prime_xref_index(doc);\n\t\t}\n\n\t\tencrypt = pdf_dict_gets(pdf_trailer(doc), \"Encrypt\");\n\t\tid = pdf_dict_gets(pdf_trailer(doc), \"ID\");\n\t\tif (pdf_is_dict(encrypt))\n\t\t\tdoc->crypt = pdf_new_crypt(ctx, encrypt, id);\n\n\t\t/* Allow lazy clients to read encrypted files with a blank password */\n\t\tpdf_authenticate_password(doc, \"\");\n\n\t\tif (repaired)\n\t\t{\n\t\t\tint xref_len = pdf_xref_len(doc);\n\t\t\tpdf_repair_obj_stms(doc);\n\n\t\t\thasroot = (pdf_dict_gets(pdf_trailer(doc), \"Root\") != NULL);\n\t\t\thasinfo = (pdf_dict_gets(pdf_trailer(doc), \"Info\") != NULL);\n\n\t\t\tfor (i = 1; i < xref_len; i++)\n\t\t\t{\n\t\t\t\tpdf_xref_entry *entry = pdf_get_xref_entry(doc, i);\n\t\t\t\tif (entry->type == 0 || entry->type == 'f')\n\t\t\t\t\tcontinue;\n\n\t\t\t\tfz_try(ctx)\n\t\t\t\t{\n\t\t\t\t\tdict = pdf_load_object(doc, i, 0);\n\t\t\t\t}\n\t\t\t\tfz_catch(ctx)\n\t\t\t\t{\n\t\t\t\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\t\t\t\tfz_warn(ctx, \"ignoring broken object (%d 0 R)\", i);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (!hasroot)\n\t\t\t\t{\n\t\t\t\t\tobj = pdf_dict_gets(dict, \"Type\");\n\t\t\t\t\tif (pdf_is_name(obj) && !strcmp(pdf_to_name(obj), \"Catalog\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tnobj = pdf_new_indirect(doc, i, 0);\n\t\t\t\t\t\tpdf_dict_puts(pdf_trailer(doc), \"Root\", nobj);\n\t\t\t\t\t\tpdf_drop_obj(nobj);\n\t\t\t\t\t\tnobj = NULL;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!hasinfo)\n\t\t\t\t{\n\t\t\t\t\tif (pdf_dict_gets(dict, \"Creator\") || pdf_dict_gets(dict, \"Producer\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tnobj = pdf_new_indirect(doc, i, 0);\n\t\t\t\t\t\tpdf_dict_puts(pdf_trailer(doc), \"Info\", nobj);\n\t\t\t\t\t\tpdf_drop_obj(nobj);\n\t\t\t\t\t\tnobj = NULL;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tpdf_drop_obj(dict);\n\t\t\t\tdict = NULL;\n\t\t\t}\n\n\t\t\t/* ensure that strings are not used in their repaired, non-decrypted form */\n\t\t\tif (doc->crypt)\n\t\t\t\tpdf_clear_xref(doc);\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_obj(dict);\n\t\tpdf_drop_obj(nobj);\n\t\tfz_rethrow_message(ctx, \"cannot open document\");\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tpdf_read_ocg(doc);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_warn(ctx, \"Ignoring Broken Optional Content\");\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tchar *version_str;\n\t\tobj = pdf_dict_getp(pdf_trailer(doc), \"Root/Version\");\n\t\tversion_str = pdf_to_name(obj);\n\t\tif (*version_str)\n\t\t{\n\t\t\tint version = 10 * (fz_atof(version_str) + 0.05);\n\t\t\tif (version > doc->version)\n\t\t\t\tdoc->version = version;\n\t\t}\n\t}\n\tfz_catch(ctx) { }\n}\n\nvoid\npdf_close_document(pdf_document *doc)\n{\n\tfz_context *ctx;\n\tpdf_unsaved_sig *usig;\n\tint i;\n\n\tif (!doc)\n\t\treturn;\n\tctx = doc->ctx;\n\n\t/* Type3 glyphs in the glyph cache can contain pdf_obj pointers\n\t * that we are about to destroy. Simplest solution is to bin the\n\t * glyph cache at this point. */\n\tfz_purge_glyph_cache(ctx);\n\n\tif (doc->js)\n\t\tdoc->drop_js(doc->js);\n\n\tpdf_free_xref_sections(doc);\n\tfz_free(ctx, doc->xref_index);\n\n\tif (doc->focus_obj)\n\t\tpdf_drop_obj(doc->focus_obj);\n\tif (doc->file)\n\t\tfz_close(doc->file);\n\tif (doc->crypt)\n\t\tpdf_free_crypt(ctx, doc->crypt);\n\n\tpdf_drop_obj(doc->linear_obj);\n\tif (doc->linear_page_refs)\n\t{\n\t\tfor (i=0; i < doc->page_count; i++)\n\t\t{\n\t\t\tpdf_drop_obj(doc->linear_page_refs[i]);\n\t\t}\n\t\tfz_free(ctx, doc->linear_page_refs);\n\t}\n\tfz_free(ctx, doc->hint_page);\n\tfz_free(ctx, doc->hint_shared_ref);\n\tfz_free(ctx, doc->hint_shared);\n\tfz_free(ctx, doc->hint_obj_offsets);\n\n\twhile ((usig = doc->unsaved_sigs) != NULL)\n\t{\n\t\tdoc->unsaved_sigs = usig->next;\n\t\tpdf_drop_obj(usig->field);\n\t\tpdf_drop_signer(usig->signer);\n\t\tfz_free(ctx, usig);\n\t}\n\n\tfor (i=0; i < doc->num_type3_fonts; i++)\n\t{\n\t\tfz_decouple_type3_font(ctx, doc->type3_fonts[i], (void *)doc);\n\t\tfz_drop_font(ctx, doc->type3_fonts[i]);\n\t}\n\tfz_free(ctx, doc->type3_fonts);\n\n\tpdf_free_ocg(ctx, doc->ocg);\n\n\tfz_empty_store(ctx);\n\n\tpdf_lexbuf_fin(&doc->lexbuf.base);\n\n\tfz_free(ctx, doc);\n}\n\nvoid\npdf_print_xref(pdf_document *doc)\n{\n\tint i;\n\tint xref_len = pdf_xref_len(doc);\n\tprintf(\"xref\\n0 %d\\n\", xref_len);\n\tfor (i = 0; i < xref_len; i++)\n\t{\n\t\tpdf_xref_entry *entry = pdf_get_xref_entry(doc, i);\n\t\tprintf(\"%05d: %010d %05d %c (stm_ofs=%d; stm_buf=%p)\\n\", i,\n\t\t\tentry->ofs,\n\t\t\tentry->gen,\n\t\t\tentry->type ? entry->type : '-',\n\t\t\tentry->stm_ofs,\n\t\t\tentry->stm_buf);\n\t}\n}\n\n/*\n * compressed object streams\n */\n\nstatic pdf_xref_entry *\npdf_load_obj_stm(pdf_document *doc, int num, int gen, pdf_lexbuf *buf, int target)\n{\n\tfz_stream *stm = NULL;\n\tpdf_obj *objstm = NULL;\n\tint *numbuf = NULL;\n\tint *ofsbuf = NULL;\n\n\tpdf_obj *obj;\n\tint first;\n\tint count;\n\tint i;\n\tpdf_token tok;\n\tfz_context *ctx = doc->ctx;\n\tpdf_xref_entry *ret_entry = NULL;\n\n\tfz_var(numbuf);\n\tfz_var(ofsbuf);\n\tfz_var(objstm);\n\tfz_var(stm);\n\n\tfz_try(ctx)\n\t{\n\t\tobjstm = pdf_load_object(doc, num, gen);\n\n\t\tcount = pdf_to_int(pdf_dict_gets(objstm, \"N\"));\n\t\tfirst = pdf_to_int(pdf_dict_gets(objstm, \"First\"));\n\n\t\tif (count < 0)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"negative number of objects in object stream\");\n\t\tif (first < 0)\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"first object in object stream resides outside stream\");\n\n\t\tnumbuf = fz_calloc(ctx, count, sizeof(int));\n\t\tofsbuf = fz_calloc(ctx, count, sizeof(int));\n\n\t\tstm = pdf_open_stream(doc, num, gen);\n\t\tfor (i = 0; i < count; i++)\n\t\t{\n\t\t\ttok = pdf_lex(stm, buf);\n\t\t\tif (tok != PDF_TOK_INT)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"corrupt object stream (%d %d R)\", num, gen);\n\t\t\tnumbuf[i] = buf->i;\n\n\t\t\ttok = pdf_lex(stm, buf);\n\t\t\tif (tok != PDF_TOK_INT)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"corrupt object stream (%d %d R)\", num, gen);\n\t\t\tofsbuf[i] = buf->i;\n\t\t}\n\n\t\tfz_seek(stm, first, SEEK_SET);\n\n\t\tfor (i = 0; i < count; i++)\n\t\t{\n\t\t\tint xref_len = pdf_xref_len(doc);\n\t\t\tpdf_xref_entry *entry;\n\t\t\tfz_seek(stm, first + ofsbuf[i], SEEK_SET);\n\n\t\t\t/* cf. http://bugs.ghostscript.com/show_bug.cgi?id=695300 */\n\t\t\tfz_try(ctx)\n\t\t\t{\n\n\t\t\tobj = pdf_parse_stm_obj(doc, stm, buf);\n\n\t\t\tif (numbuf[i] <= 0 || numbuf[i] >= xref_len)\n\t\t\t{\n\t\t\t\tpdf_drop_obj(obj);\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"object id (%d 0 R) out of range (0..%d)\", numbuf[i], xref_len - 1);\n\t\t\t}\n\n\t\t\t}\n\t\t\tfz_catch(ctx)\n\t\t\t{\n\t\t\t\tif (stm->eof)\n\t\t\t\t\tbreak;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tentry = pdf_get_xref_entry(doc, numbuf[i]);\n\n\t\t\tpdf_set_obj_parent(obj, numbuf[i]);\n\n\t\t\tif (entry->type == 'o' && entry->ofs == num)\n\t\t\t{\n\t\t\t\t/* If we already have an entry for this object,\n\t\t\t\t * we'd like to drop it and use the new one -\n\t\t\t\t * but this means that anyone currently holding\n\t\t\t\t * a pointer to the old one will be left with a\n\t\t\t\t * stale pointer. Instead, we drop the new one\n\t\t\t\t * and trust that the old one is correct. */\n\t\t\t\tif (entry->obj)\n\t\t\t\t{\n\t\t\t\t\tif (pdf_objcmp(entry->obj, obj))\n\t\t\t\t\t\tfz_warn(ctx, \"Encountered new definition for object %d - keeping the original one\", numbuf[i]);\n\t\t\t\t\tpdf_drop_obj(obj);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tentry->obj = obj;\n\t\t\t\tif (numbuf[i] == target)\n\t\t\t\t\tret_entry = entry;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpdf_drop_obj(obj);\n\t\t\t}\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(stm);\n\t\tfz_free(ctx, ofsbuf);\n\t\tfz_free(ctx, numbuf);\n\t\tpdf_drop_obj(objstm);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_message(ctx, \"cannot open object stream (%d %d R)\", num, gen);\n\t}\n\treturn ret_entry;\n}\n\n/*\n * object loading\n */\nstatic int\npdf_obj_read(pdf_document *doc, int *offset, int *nump, pdf_obj **page)\n{\n\tint num, numofs, gen, genofs, stmofs, tmpofs, tok;\n\tpdf_lexbuf *buf = &doc->lexbuf.base;\n\tfz_context *ctx = doc->ctx;\n\tint xref_len;\n\tpdf_xref_entry *entry;\n\tint newtmpofs;\n\n\tnumofs = *offset;\n\tfz_seek(doc->file, numofs, SEEK_SET);\n\n\t/* We expect to read 'num' here */\n\ttok = pdf_lex(doc->file, buf);\n\tgenofs = fz_tell(doc->file);\n\tif (tok != PDF_TOK_INT)\n\t{\n\t\t/* Failed! */\n\t\tDEBUGMESS((ctx, \"skipping unexpected data (tok=%d) at %d\", tok, *offset));\n\t\t*offset = genofs;\n\t\treturn tok == PDF_TOK_EOF;\n\t}\n\t*nump = num = buf->i;\n\n\t/* We expect to read 'gen' here */\n\ttok = pdf_lex(doc->file, buf);\n\ttmpofs = fz_tell(doc->file);\n\tif (tok != PDF_TOK_INT)\n\t{\n\t\t/* Failed! */\n\t\tDEBUGMESS((ctx, \"skipping unexpected data after \\\"%d\\\" (tok=%d) at %d\", num, tok, *offset));\n\t\t*offset = tmpofs;\n\t\treturn tok == PDF_TOK_EOF;\n\t}\n\tgen = buf->i;\n\n\t/* We expect to read 'obj' here */\n\tdo\n\t{\n\t\ttmpofs = fz_tell(doc->file);\n\t\ttok = pdf_lex(doc->file, buf);\n\t\tif (tok == PDF_TOK_OBJ)\n\t\t\tbreak;\n\t\tif (tok != PDF_TOK_INT)\n\t\t{\n\t\t\tDEBUGMESS((ctx, \"skipping unexpected data (tok=%d) at %d\", tok, tmpofs));\n\t\t\t*offset = fz_tell(doc->file);\n\t\t\treturn tok == PDF_TOK_EOF;\n\t\t}\n\t\tDEBUGMESS((ctx, \"skipping unexpected int %d at %d\", num, numofs));\n\t\t*nump = num = gen;\n\t\tnumofs = genofs;\n\t\tgen = buf->i;\n\t\tgenofs = tmpofs;\n\t}\n\twhile (1);\n\n\t/* Now we read the actual object */\n\txref_len = pdf_xref_len(doc);\n\n\t/* When we are reading a progressive file, we typically see:\n\t *    File Header\n\t *    obj m (Linearization params)\n\t *    xref #1 (refers to objects m-n)\n\t *    obj m+1\n\t *    ...\n\t *    obj n\n\t *    obj 1\n\t *    ...\n\t *    obj n-1\n\t *    xref #2\n\t *\n\t * The linearisation params are read elsewhere, hence\n\t * whenever we read an object it should just go into the\n\t * previous xref.\n\t */\n\ttok = pdf_repair_obj(doc, buf, &stmofs, NULL, NULL, NULL, page, &newtmpofs);\n\n\tdo /* So we can break out of it */\n\t{\n\t\tif (num <= 0 || num >= xref_len)\n\t\t{\n\t\t\tfz_warn(ctx, \"Not a valid object number (%d %d obj)\", num, gen);\n\t\t\tbreak;\n\t\t}\n\t\tif (gen != 0)\n\t\t{\n\t\t\tfz_warn(ctx, \"Unexpected non zero generation number in linearized file\");\n\t\t}\n\t\tentry = pdf_get_populating_xref_entry(doc, num);\n\t\tif (entry->type != 0)\n\t\t{\n\t\t\tDEBUGMESS((ctx, \"Duplicate object found (%d %d obj)\", num, gen));\n\t\t\tbreak;\n\t\t}\n\t\tif (page && *page)\n\t\t{\n\t\t\tDEBUGMESS((ctx, \"Successfully read object %d @ %d - and found page %d!\", num, numofs, doc->linear_page_num));\n\t\t\tif (!entry->obj)\n\t\t\t\tentry->obj = pdf_keep_obj(*page);\n\n\t\t\tif (doc->linear_page_refs[doc->linear_page_num] == NULL)\n\t\t\t\tdoc->linear_page_refs[doc->linear_page_num] = pdf_new_indirect(doc, num, gen);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tDEBUGMESS((ctx, \"Successfully read object %d @ %d\", num, numofs));\n\t\t}\n\t\tentry->type = 'n';\n\t\tentry->gen = 0;\n\t\tentry->ofs = numofs;\n\t\tentry->stm_ofs = stmofs;\n\t}\n\twhile (0);\n\tif (page && *page)\n\t\tdoc->linear_page_num++;\n\n\tif (tok == PDF_TOK_ENDOBJ)\n\t{\n\t\t*offset = fz_tell(doc->file);\n\t}\n\telse\n\t{\n\t\t*offset = newtmpofs;\n\t}\n\treturn 0;\n}\n\nstatic void\npdf_load_hinted_page(pdf_document *doc, int pagenum)\n{\n\tfz_context *ctx = doc->ctx;\n\n\tif (!doc->hints_loaded || !doc->linear_page_refs)\n\t\treturn;\n\n\tif (doc->linear_page_refs[pagenum])\n\t\treturn;\n\n\tfz_try(ctx)\n\t{\n\t\tint num = doc->hint_page[pagenum].number;\n\t\tpdf_obj *page = pdf_load_object(doc, num, 0);\n\t\tif (!strcmp(\"Page\", pdf_to_name(pdf_dict_gets(page, \"Type\"))))\n\t\t{\n\t\t\t/* We have found the page object! */\n\t\t\tDEBUGMESS((ctx, \"LoadHintedPage pagenum=%d num=%d\", pagenum, num));\n\t\t\tdoc->linear_page_refs[pagenum] = pdf_new_indirect(doc, num, 0);\n\t\t}\n\t\tpdf_drop_obj(page);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\t/* Silently swallow the error and proceed as normal */\n\t}\n\n}\n\nstatic int\nread_hinted_object(pdf_document *doc, int num)\n{\n\t/* Try to find the object using our hint table. Find the closest\n\t * object <= the one we want that has a hint and read forward from\n\t * there. */\n\tfz_context *ctx = doc->ctx;\n\tint expected = num;\n\tint curr_pos;\n\tint start, offset;\n\n\twhile (doc->hint_obj_offsets[expected] == 0 && expected > 0)\n\t\texpected--;\n\tif (expected != num)\n\t\tDEBUGMESS((ctx, \"object %d is unhinted, will search forward from %d\", expected, num));\n\tif (expected == 0)\t/* No hints found, just bale */\n\t\treturn 0;\n\n\tcurr_pos = fz_tell(doc->file);\n\toffset = doc->hint_obj_offsets[expected];\n\n\tfz_var(expected);\n\n\tfz_try(ctx)\n\t{\n\t\tint found;\n\n\t\t/* Try to read forward from there */\n\t\tdo\n\t\t{\n\t\t\tstart = offset;\n\t\t\tDEBUGMESS((ctx, \"Searching for object %d @ %d\", expected, offset));\n\t\t\tpdf_obj_read(doc, &offset, &found, 0);\n\t\t\tDEBUGMESS((ctx, \"Found object %d - next will be @ %d\", found, offset));\n\t\t\tif (found <= expected)\n\t\t\t{\n\t\t\t\t/* We found the right one (or one earlier than\n\t\t\t\t * we expected). Update the hints. */\n\t\t\t\tdoc->hint_obj_offsets[expected] = offset;\n\t\t\t\tdoc->hint_obj_offsets[found] = start;\n\t\t\t\tdoc->hint_obj_offsets[found+1] = offset;\n\t\t\t\t/* Retry with the next one */\n\t\t\t\texpected = found+1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/* We found one later than we expected. */\n\t\t\t\tdoc->hint_obj_offsets[expected] = 0;\n\t\t\t\tdoc->hint_obj_offsets[found] = start;\n\t\t\t\tdoc->hint_obj_offsets[found+1] = offset;\n\t\t\t\twhile (doc->hint_obj_offsets[expected] == 0 && expected > 0)\n\t\t\t\t\texpected--;\n\t\t\t\tif (expected == 0)\t/* No hints found, just bale */\n\t\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\twhile (found != num);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_seek(doc->file, curr_pos, SEEK_SET);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\t/* FIXME: Currently we ignore the hint. Perhaps we should\n\t\t * drop back to non-hinted operation here. */\n\t\tdoc->hint_obj_offsets[expected] = 0;\n\t\tfz_rethrow(ctx);\n\t}\n\treturn 1;\n}\n\npdf_xref_entry *\npdf_cache_object(pdf_document *doc, int num, int gen)\n{\n\tpdf_xref_entry *x;\n\tint rnum, rgen, try_repair;\n\tfz_context *ctx = doc->ctx;\n\n\tfz_var(try_repair);\n\n\tif (num <= 0 || num >= pdf_xref_len(doc))\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"object out of range (%d %d R); xref size %d\", num, gen, pdf_xref_len(doc));\n\nobject_updated:\n\ttry_repair = 0;\n\trnum = num;\n\n\tx = pdf_get_xref_entry(doc, num);\n\n\tif (x->obj != NULL)\n\t\treturn x;\n\n\tif (x->type == 'f')\n\t{\n\t\tx->obj = pdf_new_null(doc);\n\t}\n\telse if (x->type == 'n')\n\t{\n\t\tfz_seek(doc->file, x->ofs, SEEK_SET);\n\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tx->obj = pdf_parse_ind_obj(doc, doc->file, &doc->lexbuf.base,\n\t\t\t\t\t&rnum, &rgen, &x->stm_ofs, &try_repair);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tif (!try_repair || fz_caught(ctx) == FZ_ERROR_TRYLATER)\n\t\t\t\tfz_rethrow(ctx);\n\t\t}\n\n\t\tif (!try_repair && rnum != num)\n\t\t{\n\t\t\tpdf_drop_obj(x->obj);\n\t\t\tx->obj = NULL;\n\t\t\ttry_repair = 1;\n\t\t}\n\n\t\tif (try_repair)\n\t\t{\n\t\t\tfz_try(ctx)\n\t\t\t{\n\t\t\t\tpdf_repair_xref(doc);\n\t\t\t\tpdf_prime_xref_index(doc);\n\t\t\t}\n\t\t\tfz_catch(ctx)\n\t\t\t{\n\t\t\t\tif (rnum == num)\n\t\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot parse object (%d %d R)\", num, gen);\n\t\t\t\telse\n\t\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"found object (%d %d R) instead of (%d %d R)\", rnum, rgen, num, gen);\n\t\t\t}\n\t\t\tgoto object_updated;\n\t\t}\n\n\t\tif (doc->crypt)\n\t\t\tpdf_crypt_obj(ctx, doc->crypt, x->obj, num, gen);\n\t}\n\telse if (x->type == 'o')\n\t{\n\t\tif (!x->obj)\n\t\t{\n\t\t\tfz_try(ctx)\n\t\t\t{\n\t\t\t\tx = pdf_load_obj_stm(doc, x->ofs, 0, &doc->lexbuf.base, num);\n\t\t\t}\n\t\t\tfz_catch(ctx)\n\t\t\t{\n\t\t\t\tfz_rethrow_message(ctx, \"cannot load object stream containing object (%d %d R)\", num, gen);\n\t\t\t}\n\t\t\tif (x == NULL)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot load object stream containing object (%d %d R)\", num, gen);\n\t\t\tif (!x->obj)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"object (%d %d R) was not found in its object stream\", num, gen);\n\t\t}\n\t}\n\telse if (doc->hint_obj_offsets && read_hinted_object(doc, num))\n\t{\n\t\tgoto object_updated;\n\t}\n\telse if (doc->file_length && doc->linear_pos < doc->file_length)\n\t{\n\t\tfz_throw(ctx, FZ_ERROR_TRYLATER, \"cannot find object in xref (%d %d R) - not loaded yet?\", num, gen);\n\t}\n\telse\n\t{\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot find object in xref (%d %d R)\", num, gen);\n\t}\n\n\tpdf_set_obj_parent(x->obj, num);\n\treturn x;\n}\n\npdf_obj *\npdf_load_object(pdf_document *doc, int num, int gen)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_xref_entry *entry;\n\n\tfz_try(ctx)\n\t{\n\t\tentry = pdf_cache_object(doc, num, gen);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_message(ctx, \"cannot load object (%d %d R) into cache\", num, gen);\n\t}\n\n\tassert(entry->obj != NULL);\n\n\treturn pdf_keep_obj(entry->obj);\n}\n\npdf_obj *\npdf_resolve_indirect(pdf_obj *ref)\n{\n\tint sanity = 10;\n\tint num;\n\tint gen;\n\tfz_context *ctx = NULL; /* Avoid warning for stupid compilers */\n\tpdf_document *doc;\n\tpdf_xref_entry *entry;\n\n\twhile (pdf_is_indirect(ref))\n\t{\n\t\tif (--sanity == 0)\n\t\t{\n\t\t\tfz_warn(ctx, \"too many indirections (possible indirection cycle involving %d %d R)\", num, gen);\n\t\t\treturn NULL;\n\t\t}\n\t\tdoc = pdf_get_indirect_document(ref);\n\t\tif (!doc)\n\t\t\treturn NULL;\n\t\tctx = doc->ctx;\n\t\tnum = pdf_to_num(ref);\n\t\tgen = pdf_to_gen(ref);\n\n\t\tif (num <= 0 || gen < 0)\n\t\t{\n\t\t\tfz_warn(ctx, \"invalid indirect reference (%d %d R)\", num, gen);\n\t\t\treturn NULL;\n\t\t}\n\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tentry = pdf_cache_object(doc, num, gen);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\t\tfz_warn(ctx, \"cannot load object (%d %d R) into cache\", num, gen);\n\t\t\treturn NULL;\n\t\t}\n\n\t\tif (entry->obj == NULL)\n\t\t\treturn NULL;\n\t\tref = entry->obj;\n\t}\n\n\treturn ref;\n}\n\nint\npdf_count_objects(pdf_document *doc)\n{\n\treturn pdf_xref_len(doc);\n}\n\nint\npdf_create_object(pdf_document *doc)\n{\n\t/* TODO: reuse free object slots by properly linking free object chains in the ofs field */\n\tpdf_xref_entry *entry;\n\tint num = pdf_xref_len(doc);\n\tentry = pdf_get_incremental_xref_entry(doc, num);\n\tentry->type = 'f';\n\tentry->ofs = -1;\n\tentry->gen = 0;\n\tentry->stm_ofs = 0;\n\tentry->stm_buf = NULL;\n\tentry->obj = NULL;\n\treturn num;\n}\n\nvoid\npdf_delete_object(pdf_document *doc, int num)\n{\n\tpdf_xref_entry *x;\n\n\tif (num <= 0 || num >= pdf_xref_len(doc))\n\t{\n\t\tfz_warn(doc->ctx, \"object out of range (%d 0 R); xref size %d\", num, pdf_xref_len(doc));\n\t\treturn;\n\t}\n\n\tx = pdf_get_incremental_xref_entry(doc, num);\n\n\tfz_drop_buffer(doc->ctx, x->stm_buf);\n\tpdf_drop_obj(x->obj);\n\n\tx->type = 'f';\n\tx->ofs = 0;\n\tx->gen = 0;\n\tx->stm_ofs = 0;\n\tx->stm_buf = NULL;\n\tx->obj = NULL;\n}\n\nvoid\npdf_update_object(pdf_document *doc, int num, pdf_obj *newobj)\n{\n\tpdf_xref_entry *x;\n\n\tif (num <= 0 || num >= pdf_xref_len(doc))\n\t{\n\t\tfz_warn(doc->ctx, \"object out of range (%d 0 R); xref size %d\", num, pdf_xref_len(doc));\n\t\treturn;\n\t}\n\n\tx = pdf_get_incremental_xref_entry(doc, num);\n\n\tpdf_drop_obj(x->obj);\n\n\tx->type = 'n';\n\tx->ofs = 0;\n\tx->obj = pdf_keep_obj(newobj);\n\n\tpdf_set_obj_parent(newobj, num);\n}\n\nvoid\npdf_update_stream(pdf_document *doc, int num, fz_buffer *newbuf)\n{\n\tpdf_xref_entry *x;\n\n\tif (num <= 0 || num >= pdf_xref_len(doc))\n\t{\n\t\tfz_warn(doc->ctx, \"object out of range (%d 0 R); xref size %d\", num, pdf_xref_len(doc));\n\t\treturn;\n\t}\n\n\tx = pdf_get_xref_entry(doc, num);\n\n\tfz_drop_buffer(doc->ctx, x->stm_buf);\n\tx->stm_buf = fz_keep_buffer(doc->ctx, newbuf);\n}\n\nint\npdf_meta(pdf_document *doc, int key, void *ptr, int size)\n{\n\tswitch (key)\n\t{\n\t/*\n\t\tptr: Pointer to block (uninitialised on entry)\n\t\tsize: Size of block (at least 64 bytes)\n\t\tReturns: Document format as a brief text string.\n\t*/\n\tcase FZ_META_FORMAT_INFO:\n\t\tsprintf((char *)ptr, \"PDF %d.%d\", doc->version/10, doc->version % 10);\n\t\treturn FZ_META_OK;\n\tcase FZ_META_CRYPT_INFO:\n\t\tif (doc->crypt)\n\t\t\tsprintf((char *)ptr, \"Standard V%d R%d %d-bit %s\",\n\t\t\t\tpdf_crypt_version(doc),\n\t\t\t\tpdf_crypt_revision(doc),\n\t\t\t\tpdf_crypt_length(doc),\n\t\t\t\tpdf_crypt_method(doc));\n\t\telse\n\t\t\tsprintf((char *)ptr, \"None\");\n\t\treturn FZ_META_OK;\n\tcase FZ_META_HAS_PERMISSION:\n\t{\n\t\tint i;\n\t\tswitch (size)\n\t\t{\n\t\tcase FZ_PERMISSION_PRINT:\n\t\t\ti = PDF_PERM_PRINT;\n\t\t\tbreak;\n\t\tcase FZ_PERMISSION_CHANGE:\n\t\t\ti = PDF_PERM_CHANGE;\n\t\t\tbreak;\n\t\tcase FZ_PERMISSION_COPY:\n\t\t\ti = PDF_PERM_COPY;\n\t\t\tbreak;\n\t\tcase FZ_PERMISSION_NOTES:\n\t\t\ti = PDF_PERM_NOTES;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn 0;\n\t\t}\n\t\treturn pdf_has_permission(doc, i);\n\t}\n\tcase FZ_META_INFO:\n\t{\n\t\tpdf_obj *info = pdf_dict_gets(pdf_trailer(doc), \"Info\");\n\t\tif (!info)\n\t\t{\n\t\t\tif (ptr)\n\t\t\t\t*(char *)ptr = 0;\n\t\t\treturn 0;\n\t\t}\n\t\tinfo = pdf_dict_gets(info, *(char **)ptr);\n\t\tif (!info)\n\t\t{\n\t\t\tif (ptr)\n\t\t\t\t*(char *)ptr = 0;\n\t\t\treturn 0;\n\t\t}\n\t\tif (info && ptr && size)\n\t\t{\n\t\t\tchar *utf8 = pdf_to_utf8(doc, info);\n\t\t\tfz_strlcpy(ptr, utf8, size);\n\t\t\tfz_free(doc->ctx, utf8);\n\t\t}\n\t\treturn 1;\n\t}\n\tdefault:\n\t\treturn FZ_META_UNKNOWN_KEY;\n\t}\n}\n\nfz_transition *\npdf_page_presentation(pdf_document *doc, pdf_page *page, float *duration)\n{\n\t*duration = page->duration;\n\tif (!page->transition_present)\n\t\treturn NULL;\n\treturn &page->transition;\n}\n\nstatic void\npdf_rebind(pdf_document *doc, fz_context *ctx)\n{\n\tdoc->ctx = ctx;\n\tfz_rebind_stream(doc->file, ctx);\n}\n\n/*\n\tInitializers for the fz_document interface.\n\n\tThe functions are split across two files to allow calls to a\n\tversion of the constructor that does not link in the interpreter.\n\tThe interpreter references the built-in font and cmap resources\n\twhich are quite big. Not linking those into the mubusy binary\n\tsaves roughly 6MB of space.\n*/\n\nstatic pdf_document *\npdf_new_document(fz_context *ctx, fz_stream *file)\n{\n\tpdf_document *doc = fz_malloc_struct(ctx, pdf_document);\n\n\tdoc->super.close = (fz_document_close_fn *)pdf_close_document;\n\tdoc->super.needs_password = (fz_document_needs_password_fn *)pdf_needs_password;\n\tdoc->super.authenticate_password = (fz_document_authenticate_password_fn *)pdf_authenticate_password;\n\tdoc->super.load_outline = (fz_document_load_outline_fn *)pdf_load_outline;\n\tdoc->super.count_pages = (fz_document_count_pages_fn *)pdf_count_pages;\n\tdoc->super.load_page = (fz_document_load_page_fn *)pdf_load_page;\n\tdoc->super.load_links = (fz_document_load_links_fn *)pdf_load_links;\n\tdoc->super.bound_page = (fz_document_bound_page_fn *)pdf_bound_page;\n\tdoc->super.first_annot = (fz_document_first_annot_fn *)pdf_first_annot;\n\tdoc->super.next_annot = (fz_document_next_annot_fn *)pdf_next_annot;\n\tdoc->super.bound_annot = (fz_document_bound_annot_fn *)pdf_bound_annot;\n\tdoc->super.run_page_contents = NULL; /* see pdf_xref_aux.c */\n\tdoc->super.run_annot = NULL; /* see pdf_xref_aux.c */\n\tdoc->super.free_page = (fz_document_free_page_fn *)pdf_free_page;\n\tdoc->super.meta = (fz_document_meta_fn *)pdf_meta;\n\tdoc->super.page_presentation = (fz_document_page_presentation_fn *)pdf_page_presentation;\n\tdoc->super.write = (fz_document_write_fn *)pdf_write_document;\n\tdoc->super.rebind = (fz_document_rebind_fn *)pdf_rebind;\n\n\tpdf_lexbuf_init(ctx, &doc->lexbuf.base, PDF_LEXBUF_LARGE);\n\tdoc->file = fz_keep_stream(file);\n\tdoc->ctx = ctx;\n\n\treturn doc;\n}\n\npdf_document *\npdf_open_document_no_run_with_stream(fz_context *ctx, fz_stream *file)\n{\n\tpdf_document *doc = pdf_new_document(ctx, file);\n\n\tfz_var(doc);\n\n\tfz_try(ctx)\n\t{\n\t\tpdf_init_document(doc);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_close_document(doc);\n\t\tfz_rethrow_message(ctx, \"cannot load document from stream\");\n\t}\n\treturn doc;\n}\n\npdf_document *\npdf_open_document_no_run(fz_context *ctx, const char *filename)\n{\n\tfz_stream *file = NULL;\n\tpdf_document *doc = NULL;\n\n\tfz_var(file);\n\tfz_var(doc);\n\n\tfz_try(ctx)\n\t{\n\t\tfile = fz_open_file(ctx, filename);\n\t\tdoc = pdf_new_document(ctx, file);\n\t\tpdf_init_document(doc);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(file);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_close_document(doc);\n\t\tfz_rethrow_message(ctx, \"cannot load document '%s'\", filename);\n\t}\n\treturn doc;\n}\n\nstatic void\npdf_load_hints(pdf_document *doc, int objnum, int gennum)\n{\n\tfz_stream *stream = NULL;\n\tpdf_obj *dict;\n\tfz_context *ctx = doc->ctx;\n\n\tfz_var(stream);\n\tfz_var(dict);\n\n\tfz_try(ctx)\n\t{\n\t\tint i, j, least_num_page_objs, page_obj_num_bits;\n\t\tint least_page_len, page_len_num_bits, shared_hint_offset;\n\t\t/* int least_page_offset, page_offset_num_bits; */\n\t\t/* int least_content_stream_len, content_stream_len_num_bits; */\n\t\tint num_shared_obj_num_bits, shared_obj_num_bits;\n\t\t/* int numerator_bits, denominator_bits; */\n\t\tint shared;\n\t\tint shared_obj_num, shared_obj_offset, shared_obj_count_page1;\n\t\tint shared_obj_count_total;\n\t\tint least_shared_group_len, shared_group_len_num_bits;\n\t\tint max_object_num = pdf_xref_len(doc);\n\n\t\tstream = pdf_open_stream(doc, objnum, gennum);\n\t\tdict = pdf_get_xref_entry(doc, objnum)->obj;\n\t\tif (dict == NULL || !pdf_is_dict(dict))\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"malformed hint object\");\n\n\t\tshared_hint_offset = pdf_to_int(pdf_dict_gets(dict, \"S\"));\n\n\t\t/* Malloc the structures (use realloc to cope with the fact we\n\t\t * may try this several times before enough data is loaded) */\n\t\tdoc->hint_page = fz_resize_array(ctx, doc->hint_page, doc->page_count+1, sizeof(*doc->hint_page));\n\t\tmemset(doc->hint_page, 0, sizeof(*doc->hint_page) * (doc->page_count+1));\n\t\tdoc->hint_obj_offsets = fz_resize_array(ctx, doc->hint_obj_offsets, max_object_num, sizeof(*doc->hint_obj_offsets));\n\t\tmemset(doc->hint_obj_offsets, 0, sizeof(*doc->hint_obj_offsets) * max_object_num);\n\t\tdoc->hint_obj_offsets_max = max_object_num;\n\n\t\t/* Read the page object hints table: Header first */\n\t\tleast_num_page_objs = fz_read_bits(stream, 32);\n\t\t/* The following is sometimes a lie, but we read this version,\n\t\t * as other table values are built from it. In\n\t\t * pdf_reference17.pdf, this points to 2 objects before the\n\t\t * first pages page object. */\n\t\tdoc->hint_page[0].offset = fz_read_bits(stream, 32);\n\t\tif (doc->hint_page[0].offset > doc->hint_object_offset)\n\t\t\tdoc->hint_page[0].offset += doc->hint_object_length;\n\t\tpage_obj_num_bits = fz_read_bits(stream, 16);\n\t\tleast_page_len = fz_read_bits(stream, 32);\n\t\tpage_len_num_bits = fz_read_bits(stream, 16);\n\t\t/* least_page_offset = */ (void) fz_read_bits(stream, 32);\n\t\t/* page_offset_num_bits = */ (void) fz_read_bits(stream, 16);\n\t\t/* least_content_stream_len = */ (void) fz_read_bits(stream, 32);\n\t\t/* content_stream_len_num_bits = */ (void) fz_read_bits(stream, 16);\n\t\tnum_shared_obj_num_bits = fz_read_bits(stream, 16);\n\t\tshared_obj_num_bits = fz_read_bits(stream, 16);\n\t\t/* numerator_bits = */ (void) fz_read_bits(stream, 16);\n\t\t/* denominator_bits = */ (void) fz_read_bits(stream, 16);\n\n\t\t/* Item 1: Page object numbers */\n\t\tdoc->hint_page[0].number = doc->linear_page1_obj_num;\n\t\t/* We don't care about the number of objects in the first page */\n\t\t(void)fz_read_bits(stream, page_obj_num_bits);\n\t\tj = 1;\n\t\tfor (i = 1; i < doc->page_count; i++)\n\t\t{\n\t\t\tint delta_page_objs = fz_read_bits(stream, page_obj_num_bits);\n\n\t\t\tdoc->hint_page[i].number = j;\n\t\t\tj += least_num_page_objs + delta_page_objs;\n\t\t}\n\t\tdoc->hint_page[i].number = j; /* Not a real page object */\n\t\tfz_sync_bits(stream);\n\t\t/* Item 2: Page lengths */\n\t\tj = doc->hint_page[0].offset;\n\t\tfor (i = 0; i < doc->page_count; i++)\n\t\t{\n\t\t\tint delta_page_len = fz_read_bits(stream, page_len_num_bits);\n\t\t\tint old = j;\n\n\t\t\tdoc->hint_page[i].offset = j;\n\t\t\tj += least_page_len + delta_page_len;\n\t\t\tif (old <= doc->hint_object_offset && j > doc->hint_object_offset)\n\t\t\t\tj += doc->hint_object_length;\n\t\t}\n\t\tdoc->hint_page[i].offset = j;\n\t\tfz_sync_bits(stream);\n\t\t/* Item 3: Shared references */\n\t\tshared = 0;\n\t\tfor (i = 0; i < doc->page_count; i++)\n\t\t{\n\t\t\tint num_shared_objs = fz_read_bits(stream, num_shared_obj_num_bits);\n\t\t\tdoc->hint_page[i].index = shared;\n\t\t\tshared += num_shared_objs;\n\t\t}\n\t\tdoc->hint_page[i].index = shared;\n\t\tdoc->hint_shared_ref = fz_resize_array(ctx, doc->hint_shared_ref, shared, sizeof(*doc->hint_shared_ref));\n\t\tmemset(doc->hint_shared_ref, 0, sizeof(*doc->hint_shared_ref) * shared);\n\t\tfz_sync_bits(stream);\n\t\t/* Item 4: Shared references */\n\t\tfor (i = 0; i < shared; i++)\n\t\t{\n\t\t\tint ref = fz_read_bits(stream, shared_obj_num_bits);\n\t\t\tdoc->hint_shared_ref[i] = ref;\n\t\t}\n\t\t/* Skip items 5,6,7 as we don't use them */\n\n\t\tfz_seek(stream, shared_hint_offset, SEEK_SET);\n\n\t\t/* Read the shared object hints table: Header first */\n\t\tshared_obj_num = fz_read_bits(stream, 32);\n\t\tshared_obj_offset = fz_read_bits(stream, 32);\n\t\tif (shared_obj_offset > doc->hint_object_offset)\n\t\t\tshared_obj_offset += doc->hint_object_length;\n\t\tshared_obj_count_page1 = fz_read_bits(stream, 32);\n\t\tshared_obj_count_total = fz_read_bits(stream, 32);\n\t\tshared_obj_num_bits = fz_read_bits(stream, 16);\n\t\tleast_shared_group_len = fz_read_bits(stream, 32);\n\t\tshared_group_len_num_bits = fz_read_bits(stream, 16);\n\n\t\t/* Sanity check the references in Item 4 above to ensure we\n\t\t * don't access out of range with malicious files. */\n\t\tfor (i = 0; i < shared; i++)\n\t\t{\n\t\t\tif (doc->hint_shared_ref[i] >= shared_obj_count_total)\n\t\t\t{\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"malformed hint stream (shared refs)\");\n\t\t\t}\n\t\t}\n\n\t\tdoc->hint_shared = fz_resize_array(ctx, doc->hint_shared, shared_obj_count_total+1, sizeof(*doc->hint_shared));\n\t\tmemset(doc->hint_shared, 0, sizeof(*doc->hint_shared) * (shared_obj_count_total+1));\n\n\t\t/* Item 1: Shared references */\n\t\tj = doc->hint_page[0].offset;\n\t\tfor (i = 0; i < shared_obj_count_page1; i++)\n\t\t{\n\t\t\tint off = fz_read_bits(stream, shared_group_len_num_bits);\n\t\t\tint old = j;\n\t\t\tdoc->hint_shared[i].offset = j;\n\t\t\tj += off + least_shared_group_len;\n\t\t\tif (old <= doc->hint_object_offset && j > doc->hint_object_offset)\n\t\t\t\tj += doc->hint_object_length;\n\t\t}\n\t\t/* FIXME: We would have problems recreating the length of the\n\t\t * last page 1 shared reference group. But we'll never need\n\t\t * to, so ignore it. */\n\t\tj = shared_obj_offset;\n\t\tfor (; i < shared_obj_count_total; i++)\n\t\t{\n\t\t\tint off = fz_read_bits(stream, shared_group_len_num_bits);\n\t\t\tint old = j;\n\t\t\tdoc->hint_shared[i].offset = j;\n\t\t\tj += off + least_shared_group_len;\n\t\t\tif (old <= doc->hint_object_offset && j > doc->hint_object_offset)\n\t\t\t\tj += doc->hint_object_length;\n\t\t}\n\t\tdoc->hint_shared[i].offset = j;\n\t\tfz_sync_bits(stream);\n\t\t/* Item 2: Signature flags: read these just so we can skip */\n\t\tfor (i = 0; i < shared_obj_count_total; i++)\n\t\t{\n\t\t\tdoc->hint_shared[i].number = fz_read_bits(stream, 1);\n\t\t}\n\t\tfz_sync_bits(stream);\n\t\t/* Item 3: Signatures: just skip */\n\t\tfor (i = 0; i < shared_obj_count_total; i++)\n\t\t{\n\t\t\tif (doc->hint_shared[i].number)\n\t\t\t{\n\t\t\t\t(void) fz_read_bits(stream, 128);\n\t\t\t}\n\t\t}\n\t\tfz_sync_bits(stream);\n\t\t/* Item 4: Shared object object numbers */\n\t\tj = doc->linear_page1_obj_num; /* FIXME: This is a lie! */\n\t\tfor (i = 0; i < shared_obj_count_page1; i++)\n\t\t{\n\t\t\tdoc->hint_shared[i].number = j;\n\t\t\tj += fz_read_bits(stream, shared_obj_num_bits) + 1;\n\t\t}\n\t\tj = shared_obj_num;\n\t\tfor (; i < shared_obj_count_total; i++)\n\t\t{\n\t\t\tdoc->hint_shared[i].number = j;\n\t\t\tj += fz_read_bits(stream, shared_obj_num_bits) + 1;\n\t\t}\n\t\tdoc->hint_shared[i].number = j;\n\n\t\t/* Now, actually use the data we have gathered. */\n\t\tfor (i = 0 /*shared_obj_count_page1*/; i < shared_obj_count_total; i++)\n\t\t{\n\t\t\tdoc->hint_obj_offsets[doc->hint_shared[i].number] = doc->hint_shared[i].offset;\n\t\t}\n\t\tfor (i = 0; i < doc->page_count; i++)\n\t\t{\n\t\t\tdoc->hint_obj_offsets[doc->hint_page[i].number] = doc->hint_page[i].offset;\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(stream);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\t/* Don't try to load hints again */\n\t\tdoc->hints_loaded = 1;\n\t\t/* We won't use the linearized object any more. */\n\t\tdoc->file_reading_linearly = 0;\n\t\t/* Any other error becomes a TRYLATER */\n\t\tfz_throw(ctx, FZ_ERROR_TRYLATER, \"malformed hints object\");\n\t}\n\tdoc->hints_loaded = 1;\n}\n\nstatic void\npdf_load_hint_object(pdf_document *doc)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_lexbuf *buf = &doc->lexbuf.base;\n\tint curr_pos;\n\n\tcurr_pos = fz_tell(doc->file);\n\tfz_seek(doc->file, doc->hint_object_offset, SEEK_SET);\n\tfz_try(ctx)\n\t{\n\t\twhile (1)\n\t\t{\n\t\t\tpdf_obj *page = NULL;\n\t\t\tint tmpofs, num, gen, tok;\n\n\t\t\ttok = pdf_lex(doc->file, buf);\n\t\t\tif (tok != PDF_TOK_INT)\n\t\t\t\tbreak;\n\t\t\tnum = buf->i;\n\t\t\ttok = pdf_lex(doc->file, buf);\n\t\t\tif (tok != PDF_TOK_INT)\n\t\t\t\tbreak;\n\t\t\tgen = buf->i;\n\t\t\ttok = pdf_lex(doc->file, buf);\n\t\t\tif (tok != PDF_TOK_OBJ)\n\t\t\t\tbreak;\n\t\t\t(void)pdf_repair_obj(doc, buf, &tmpofs, NULL, NULL, NULL, &page, &tmpofs);\n\t\t\tpdf_load_hints(doc, num, gen);\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_seek(doc->file, curr_pos, SEEK_SET);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\npdf_obj *pdf_progressive_advance(pdf_document *doc, int pagenum)\n{\n\tfz_context *ctx = doc->ctx;\n\tpdf_lexbuf *buf = &doc->lexbuf.base;\n\tint curr_pos;\n\tpdf_obj *page;\n\n\tpdf_load_hinted_page(doc, pagenum);\n\n\tif (pagenum < 0 || pagenum >= doc->page_count)\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"page load out of range (%d of %d)\", pagenum, doc->page_count);\n\n\tif (doc->linear_pos == doc->file_length)\n\t\treturn doc->linear_page_refs[pagenum];\n\n\t/* Only load hints once, and then only after we have got page 0 */\n\tif (pagenum > 0 && !doc->hints_loaded && doc->hint_object_offset > 0 && doc->linear_pos >= doc->hint_object_offset)\n\t{\n\t\t/* Found hint object */\n\t\tpdf_load_hint_object(doc);\n\t}\n\n\tDEBUGMESS((ctx, \"continuing to try to advance from %d\", doc->linear_pos));\n\tcurr_pos = fz_tell(doc->file);\n\n\tfz_var(page);\n\n\tfz_try(ctx)\n\t{\n\t\tint eof;\n\t\tdo\n\t\t{\n\t\t\tint num;\n\t\t\tpage = NULL;\n\t\t\teof = pdf_obj_read(doc, &doc->linear_pos, &num, &page);\n\t\t\tpdf_drop_obj(page);\n\t\t\tpage = NULL;\n\t\t}\n\t\twhile (!eof);\n\n\t\t{\n\t\t\tpdf_obj *catalog;\n\t\t\tpdf_obj *pages;\n\t\t\tdoc->linear_pos = doc->file_length;\n\t\t\tpdf_load_xref(doc, buf);\n\t\t\tcatalog = pdf_dict_gets(pdf_trailer(doc), \"Root\");\n\t\t\tpages = pdf_dict_gets(catalog, \"Pages\");\n\n\t\t\tif (!pdf_is_dict(pages))\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"missing page tree\");\n\t\t\tbreak;\n\t\t}\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_seek(doc->file, curr_pos, SEEK_SET);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_obj(page);\n\t\tif (fz_caught(ctx) == FZ_ERROR_TRYLATER)\n\t\t{\n\t\t\tif (doc->linear_page_refs[pagenum] == NULL)\n\t\t\t{\n\t\t\t\t/* Still not got a page */\n\t\t\t\tfz_rethrow(ctx);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tfz_rethrow(ctx);\n\t}\n\n\treturn doc->linear_page_refs[pagenum];\n}\n\npdf_document *pdf_specifics(fz_document *doc)\n{\n\treturn (pdf_document *)((doc && doc->close == (fz_document_close_fn *)pdf_close_document) ? doc : NULL);\n}\n\npdf_document *pdf_create_document(fz_context *ctx)\n{\n\tpdf_document *doc;\n\tpdf_obj *o = NULL;\n\tpdf_obj *root;\n\tpdf_obj *pages;\n\tpdf_obj *trailer = NULL;\n\n\tfz_var(o);\n\tfz_var(trailer);\n\n\tdoc = pdf_new_document(ctx, NULL);\n\tfz_try(ctx)\n\t{\n\t\tdoc->version = 14;\n\t\tdoc->file_size = 0;\n\t\tdoc->startxref = 0;\n\t\tdoc->num_xref_sections = 0;\n\t\tpdf_get_populating_xref_entry(doc, 0);\n\t\tdoc->xref_altered = 1;\n\t\ttrailer = pdf_new_dict(doc, 2);\n\t\tpdf_dict_puts_drop(trailer, \"Size\", pdf_new_int(doc, 3));\n\t\to = root = pdf_new_dict(doc, 2);\n\t\tpdf_dict_puts_drop(trailer, \"Root\", pdf_new_ref(doc, o));\n\t\tpdf_drop_obj(o);\n\t\to = NULL;\n\t\tpdf_dict_puts_drop(root, \"Type\", pdf_new_name(doc, \"Catalog\"));\n\t\to = pages = pdf_new_dict(doc, 3);\n\t\tpdf_dict_puts_drop(root, \"Pages\", pdf_new_ref(doc, o));\n\t\tpdf_drop_obj(o);\n\t\to = NULL;\n\t\tpdf_dict_puts_drop(pages, \"Type\", pdf_new_name(doc, \"Pages\"));\n\t\tpdf_dict_puts_drop(pages, \"Count\", pdf_new_int(doc, 0));\n\t\tpdf_dict_puts_drop(pages, \"Kids\", pdf_new_array(doc, 1));\n\t\tpdf_set_populating_xref_trailer(doc, trailer);\n\t\tpdf_drop_obj(trailer);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tpdf_drop_obj(trailer);\n\t\tpdf_drop_obj(o);\n\t\tfz_rethrow_message(ctx, \"Failed to create empty document\");\n\t}\n\treturn doc;\n}\n\nint\npdf_recognize(fz_context *doc, const char *magic)\n{\n\tchar *ext = strrchr(magic, '.');\n\n\tif (ext)\n\t{\n\t\tif (!fz_strcasecmp(ext, \".pdf\"))\n\t\t\treturn 100;\n\t}\n\tif (!strcmp(magic, \"pdf\") || !strcmp(magic, \"application/pdf\"))\n\t\treturn 100;\n\n\treturn 1;\n}\n\nfz_document_handler pdf_no_run_document_handler =\n{\n\t(fz_document_recognize_fn *)&pdf_recognize,\n\t(fz_document_open_fn *)&pdf_open_document_no_run,\n\t(fz_document_open_with_stream_fn *)&pdf_open_document_no_run_with_stream\n};\n\nvoid pdf_mark_xref(pdf_document *doc)\n{\n\tint x, e;\n\n\tfor (x = 0; x < doc->num_xref_sections; x++)\n\t{\n\t\tpdf_xref *xref = &doc->xref_sections[x];\n\t\tpdf_xref_subsec *sub;\n\n\t\tfor (sub = xref->subsec; sub != NULL; sub = sub->next)\n\t\t{\n\t\t\tfor (e = 0; e < sub->len; e++)\n\t\t\t{\n\t\t\t\tpdf_xref_entry *entry = &sub->table[e];\n\t\t\t\tif (entry->obj)\n\t\t\t\t{\n\t\t\t\t\tentry->flags |= PDF_OBJ_FLAG_MARK;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nvoid pdf_clear_xref(pdf_document *doc)\n{\n\tint x, e;\n\n\tfor (x = 0; x < doc->num_xref_sections; x++)\n\t{\n\t\tpdf_xref *xref = &doc->xref_sections[x];\n\t\tpdf_xref_subsec *sub;\n\n\t\tfor (sub = xref->subsec; sub != NULL; sub = sub->next)\n\t\t{\n\t\t\tfor (e = 0; e < sub->len; e++)\n\t\t\t{\n\t\t\t\tpdf_xref_entry *entry = &sub->table[e];\n\t\t\t\t/* We cannot drop objects if the stream\n\t\t\t\t * buffer has been updated */\n\t\t\t\tif (entry->obj != NULL && entry->stm_buf == NULL)\n\t\t\t\t{\n\t\t\t\t\tif (pdf_obj_refs(entry->obj) == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tpdf_drop_obj(entry->obj);\n\t\t\t\t\t\tentry->obj = NULL;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nvoid pdf_clear_xref_to_mark(pdf_document *doc)\n{\n\tint x, e;\n\n\tfor (x = 0; x < doc->num_xref_sections; x++)\n\t{\n\t\tpdf_xref *xref = &doc->xref_sections[x];\n\t\tpdf_xref_subsec *sub;\n\n\t\tfor (sub = xref->subsec; sub != NULL; sub = sub->next)\n\t\t{\n\t\t\tfor (e = 0; e < sub->len; e++)\n\t\t\t{\n\t\t\t\tpdf_xref_entry *entry = &sub->table[e];\n\n\t\t\t\t/* We cannot drop objects if the stream buffer has\n\t\t\t\t * been updated */\n\t\t\t\tif (entry->obj != NULL && entry->stm_buf == NULL)\n\t\t\t\t{\n\t\t\t\t\tif ((entry->flags & PDF_OBJ_FLAG_MARK) == 0 && pdf_obj_refs(entry->obj) == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tpdf_drop_obj(entry->obj);\n\t\t\t\t\t\tentry->obj = NULL;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/tiff/mutiff.c",
    "content": "#include \"mupdf/tiff.h\"\n\nstatic void tiff_init_document(tiff_document *doc);\n\n#define DPI 72.0f\n\nstruct tiff_page_s\n{\n\tfz_image *image;\n};\n\nstruct tiff_document_s\n{\n\tfz_document super;\n\n\tfz_context *ctx;\n\tfz_stream *file;\n\tfz_buffer *buffer;\n\tint page_count;\n};\n\ntiff_document *\ntiff_open_document_with_stream(fz_context *ctx, fz_stream *file)\n{\n\ttiff_document *doc;\n\tint len;\n\tunsigned char *buf;\n\n\tdoc = fz_malloc_struct(ctx, tiff_document);\n\ttiff_init_document(doc);\n\tdoc->ctx = ctx;\n\tdoc->file = fz_keep_stream(file);\n\tdoc->page_count = 0;\n\n\tfz_try(ctx)\n\t{\n\t\tdoc->buffer = fz_read_all(doc->file, 1024);\n\t\tlen = doc->buffer->len;\n\t\tbuf = doc->buffer->data;\n\n\t\tdoc->page_count = fz_load_tiff_subimage_count(ctx, buf, len);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\ttiff_close_document(doc);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn doc;\n}\n\ntiff_document *\ntiff_open_document(fz_context *ctx, const char *filename)\n{\n\tfz_stream *file;\n\ttiff_document *doc;\n\n\tfile = fz_open_file(ctx, filename);\n\tif (!file)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot open file '%s': %s\", filename, strerror(errno));\n\n\tfz_try(ctx)\n\t{\n\t\tdoc = tiff_open_document_with_stream(ctx, file);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(file);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn doc;\n}\n\nvoid\ntiff_close_document(tiff_document *doc)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_drop_buffer(ctx, doc->buffer);\n\tfz_close(doc->file);\n\tfz_free(ctx, doc);\n}\n\nint\ntiff_count_pages(tiff_document *doc)\n{\n\treturn doc->page_count;\n}\n\ntiff_page *\ntiff_load_page(tiff_document *doc, int number)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_image *mask = NULL;\n\tfz_pixmap *pixmap = NULL;\n\ttiff_page *page = NULL;\n\n\tif (number < 0 || number >= doc->page_count)\n\t\treturn NULL;\n\n\tfz_var(pixmap);\n\tfz_var(page);\n\tfz_try(ctx)\n\t{\n\t\tpixmap = fz_load_tiff_subimage(ctx, doc->buffer->data, doc->buffer->len, number);\n\n\t\tpage = fz_malloc_struct(ctx, tiff_page);\n\t\tpage->image = fz_new_image_from_pixmap(ctx, pixmap, mask);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\ttiff_free_page(doc, page);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn page;\n}\n\nvoid\ntiff_free_page(tiff_document *doc, tiff_page *page)\n{\n\tif (!page)\n\t\treturn;\n\tfz_drop_image(doc->ctx, page->image);\n\tfz_free(doc->ctx, page);\n}\n\nfz_rect *\ntiff_bound_page(tiff_document *doc, tiff_page *page, fz_rect *bbox)\n{\n\tfz_image *image = page->image;\n\tbbox->x0 = bbox->y0 = 0;\n\tbbox->x1 = image->w * DPI / image->xres;\n\tbbox->y1 = image->h * DPI / image->yres;\n\treturn bbox;\n}\n\nvoid\ntiff_run_page(tiff_document *doc, tiff_page *page, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie)\n{\n\tfz_matrix local_ctm = *ctm;\n\tfz_image *image = page->image;\n\tfloat w = image->w * DPI / image->xres;\n\tfloat h = image->h * DPI / image->yres;\n\tfz_pre_scale(&local_ctm, w, h);\n\tfz_fill_image(dev, image, &local_ctm, 1);\n}\n\nstatic int\ntiff_meta(tiff_document *doc, int key, void *ptr, int size)\n{\n\tswitch (key)\n\t{\n\tcase FZ_META_FORMAT_INFO:\n\t\tsprintf((char *)ptr, \"TIFF\");\n\t\treturn FZ_META_OK;\n\tdefault:\n\t\treturn FZ_META_UNKNOWN_KEY;\n\t}\n}\n\nstatic void\ntiff_rebind(tiff_document *doc, fz_context *ctx)\n{\n\tdoc->ctx = ctx;\n\tfz_rebind_stream(doc->file, ctx);\n}\n\nstatic void\ntiff_init_document(tiff_document *doc)\n{\n\tdoc->super.close = (fz_document_close_fn *)tiff_close_document;\n\tdoc->super.count_pages = (fz_document_count_pages_fn *)tiff_count_pages;\n\tdoc->super.load_page = (fz_document_load_page_fn *)tiff_load_page;\n\tdoc->super.bound_page = (fz_document_bound_page_fn *)tiff_bound_page;\n\tdoc->super.run_page_contents = (fz_document_run_page_contents_fn *)tiff_run_page;\n\tdoc->super.free_page = (fz_document_free_page_fn *)tiff_free_page;\n\tdoc->super.meta = (fz_document_meta_fn *)tiff_meta;\n\tdoc->super.rebind = (fz_document_rebind_fn *)tiff_rebind;\n}\n\nstatic int\ntiff_recognize(fz_context *doc, const char *magic)\n{\n\tchar *ext = strrchr(magic, '.');\n\n\tif (ext)\n\t{\n\t\tif (!fz_strcasecmp(ext, \".tiff\") || !fz_strcasecmp(ext, \".tif\"))\n\t\t\treturn 100;\n\t}\n\tif (!strcmp(magic, \"tif\") || !strcmp(magic, \"image/tiff\") ||\n\t\t!strcmp(magic, \"tiff\") || !strcmp(magic, \"image/x-tiff\"))\n\t\treturn 100;\n\n\treturn 0;\n}\n\nfz_document_handler tiff_document_handler =\n{\n\t(fz_document_recognize_fn *)&tiff_recognize,\n\t(fz_document_open_fn *)&tiff_open_document,\n\t(fz_document_open_with_stream_fn *)&tiff_open_document_with_stream\n};\n"
  },
  {
    "path": "mupdf/source/tools/mjsgen.c",
    "content": "/*\n * mjs test file generation tool\n */\n\n#include \"mupdf/fitz.h\"\n#include \"mupdf/pdf.h\"\n\n/*\n\tA useful bit of bash script to call this to generate mjs files:\n\tfor f in tests_private/pdf/forms/v1.3/ *.pdf ; do g=${f%.*} ; echo $g ; ./mjsgen $g.pdf $g.mjs ; done\n\n\tRemove the space from \"/ *.pdf\" before running - can't leave that\n\tin here, as it causes a warning about a possibly malformed comment.\n*/\n\nstatic char lorem[] =\n\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum \"\n\"vehicula augue id est lobortis mollis. Aenean vestibulum metus sed est \"\n\"gravida non tempus lacus aliquet. Nulla vehicula lobortis tincidunt. \"\n\"Donec malesuada nisl et lacus condimentum nec tincidunt urna gravida. \"\n\"Sed dapibus magna eu velit ultrices non rhoncus risus lacinia. Fusce \"\n\"vitae nulla volutpat elit dictum ornare at eu libero. Maecenas felis \"\n\"enim, tempor a tincidunt id, commodo consequat lectus.\\n\"\n\"Morbi tincidunt adipiscing lacus eu dignissim. Pellentesque augue elit, \"\n\"ultrices vitae fermentum et, faucibus et purus. Nam ante libero, lacinia \"\n\"id tincidunt at, ultricies a lorem. Donec non neque at purus condimentum \"\n\"eleifend quis sit amet libero. Sed semper, mi ut tempus tincidunt, lacus \"\n\"eros pellentesque lacus, id vehicula est diam eu quam. Integer tristique \"\n\"fringilla rhoncus. Phasellus convallis, justo ut mollis viverra, dui odio \"\n\"euismod ante, nec fringilla nisl mi ac diam.\\n\"\n\"Maecenas mi urna, ornare commodo feugiat id, cursus in massa. Vivamus \"\n\"augue augue, aliquam at varius eu, venenatis fermentum felis. Sed varius \"\n\"turpis a felis ultrices quis aliquet nunc tincidunt. Suspendisse posuere \"\n\"commodo nunc non viverra. Praesent condimentum varius quam, vel \"\n\"consectetur odio volutpat in. Sed malesuada augue ut lectus commodo porta. \"\n\"Vivamus eget mauris sit amet diam ultrices sollicitudin. Cras pharetra leo \"\n\"non elit lacinia vulputate.\\n\"\n\"Donec ac enim justo, ornare scelerisque diam. Ut vel ante at lorem \"\n\"placerat bibendum ultricies mattis metus. Phasellus in imperdiet odio. \"\n\"Proin semper lacinia libero, sed rutrum eros blandit non. Duis tincidunt \"\n\"ligula est, non pellentesque mauris. Aliquam in erat scelerisque lacus \"\n\"dictum suscipit eget semper magna. Nullam luctus imperdiet risus a \"\n\"semper.\\n\"\n\"Curabitur sit amet tempor sapien. Quisque et tortor in lacus dictum \"\n\"pulvinar. Nunc at nisl ut velit vehicula hendrerit. Mauris elementum \"\n\"sollicitudin leo ac ullamcorper. Proin vel leo nec justo tempus aliquet \"\n\"nec ut mi. Pellentesque vel nisl id dui hendrerit fermentum nec quis \"\n\"tortor. Proin eu sem luctus est consequat euismod. Vestibulum ante ipsum \"\n\"primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce \"\n\"consectetur ultricies nisl ornare dictum. Cras sagittis consectetur lorem \"\n\"sed posuere. Mauris accumsan laoreet arcu, id molestie lorem faucibus eu. \"\n\"Vivamus commodo, neque nec imperdiet pretium, lorem metus viverra turpis, \"\n\"malesuada vulputate justo eros sit amet neque. Nunc quis justo elit, non \"\n\"rutrum mauris. Maecenas blandit condimentum nibh, nec vulputate orci \"\n\"pulvinar at. Proin sed arcu vel odio tempus lobortis sed posuere ipsum. Ut \"\n\"feugiat pellentesque tortor nec ornare.\\n\";\n\nstatic char *filename;\nfz_output *out = NULL;\n\nstatic char *mujstest_filename = NULL;\nstatic FILE *mujstest_file = NULL;\nstatic int mujstest_count = 0;\n\nstatic void usage(void)\n{\n\tfprintf(stderr, \"usage: mjsgen [-p password] input.pdf output.mjs\\n\");\n\texit(1);\n}\n\nstatic void escape_string(FILE *out, int len, const char *string)\n{\n\twhile (len-- && *string)\n\t{\n\t\tchar c = *string++;\n\t\tswitch (c)\n\t\t{\n\t\tcase '\\n':\n\t\t\tfputc('\\\\', out);\n\t\t\tfputc('n', out);\n\t\t\tbreak;\n\t\tcase '\\r':\n\t\t\tfputc('\\\\', out);\n\t\t\tfputc('r', out);\n\t\t\tbreak;\n\t\tcase '\\t':\n\t\t\tfputc('\\\\', out);\n\t\t\tfputc('t', out);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tfputc(c, out);\n\t\t}\n\t}\n}\n\nstatic void processpage(fz_context *ctx, fz_document *doc, int pagenum)\n{\n\tfz_page *page;\n\tint needshot = 0;\n\n\tfz_try(ctx)\n\t{\n\t\tpage = fz_load_page(doc, pagenum - 1);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_message(ctx, \"cannot load page %d in file '%s'\", pagenum, filename);\n\t}\n\n\tpdf_document *inter = pdf_specifics(doc);\n\tpdf_widget *widget = NULL;\n\n\tif (inter)\n\t\twidget = pdf_first_widget(inter, (pdf_page *)page);\n\n\tif (widget)\n\t{\n\t\tfprintf(mujstest_file, \"GOTO %d\\n\", pagenum);\n\t\tneedshot = 1;\n\t}\n\tfor (;widget; widget = pdf_next_widget(widget))\n\t{\n\t\tfz_rect rect;\n\t\tint w, h, len;\n\t\tint type = pdf_widget_get_type(widget);\n\n\t\tpdf_bound_widget(widget, &rect);\n\t\tw = (rect.x1 - rect.x0);\n\t\th = (rect.y1 - rect.y0);\n\t\t++mujstest_count;\n\t\tswitch (type)\n\t\t{\n\t\tdefault:\n\t\t\tfprintf(mujstest_file, \"%% UNKNOWN %0.2f %0.2f %0.2f %0.2f\\n\", rect.x0, rect.y0, rect.x1, rect.y1);\n\t\t\tbreak;\n\t\tcase PDF_WIDGET_TYPE_PUSHBUTTON:\n\t\t\tfprintf(mujstest_file, \"%% PUSHBUTTON %0.2f %0.2f %0.2f %0.2f\\n\", rect.x0, rect.y0, rect.x1, rect.y1);\n\t\t\tbreak;\n\t\tcase PDF_WIDGET_TYPE_CHECKBOX:\n\t\t\tfprintf(mujstest_file, \"%% CHECKBOX %0.2f %0.2f %0.2f %0.2f\\n\", rect.x0, rect.y0, rect.x1, rect.y1);\n\t\t\tbreak;\n\t\tcase PDF_WIDGET_TYPE_RADIOBUTTON:\n\t\t\tfprintf(mujstest_file, \"%% RADIOBUTTON %0.2f %0.2f %0.2f %0.2f\\n\", rect.x0, rect.y0, rect.x1, rect.y1);\n\t\t\tbreak;\n\t\tcase PDF_WIDGET_TYPE_TEXT:\n\t\t{\n\t\t\tint maxlen = pdf_text_widget_max_len(inter, widget);\n\t\t\tint texttype = pdf_text_widget_content_type(inter, widget);\n\n\t\t\t/* If height is low, assume a single row, and base\n\t\t\t * the width off that. */\n\t\t\tif (h < 10)\n\t\t\t{\n\t\t\t\tw = (w+h-1) / (h ? h : 1);\n\t\t\t\th = 1;\n\t\t\t}\n\t\t\t/* Otherwise, if width is low, work off height */\n\t\t\telse if (w < 10)\n\t\t\t{\n\t\t\t\th = (w+h-1) / (w ? w : 1);\n\t\t\t\tw = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tw = (w+9)/10;\n\t\t\t\th = (h+9)/10;\n\t\t\t}\n\t\t\tlen = w*h;\n\t\t\tif (len < 2)\n\t\t\t\tlen = 2;\n\t\t\tif (len > maxlen)\n\t\t\t\tlen = maxlen;\n\t\t\tfprintf(mujstest_file, \"%% TEXT %0.2f %0.2f %0.2f %0.2f\\n\", rect.x0, rect.y0, rect.x1, rect.y1);\n\t\t\tswitch (texttype)\n\t\t\t{\n\t\t\tdefault:\n\t\t\tcase PDF_WIDGET_CONTENT_UNRESTRAINED:\n\t\t\t\tfprintf(mujstest_file, \"TEXT %d \", mujstest_count);\n\t\t\t\tescape_string(mujstest_file, len-3, lorem);\n\t\t\t\tfprintf(mujstest_file, \"\\n\");\n\t\t\t\tbreak;\n\t\t\tcase PDF_WIDGET_CONTENT_NUMBER:\n\t\t\t\tfprintf(mujstest_file, \"TEXT %d\\n\", mujstest_count);\n\t\t\t\tbreak;\n\t\t\tcase PDF_WIDGET_CONTENT_SPECIAL:\n#ifdef __MINGW32__\n\t\t\t\tfprintf(mujstest_file, \"TEXT %I64d\\n\", 46702919800LL + mujstest_count);\n#else\n\t\t\t\tfprintf(mujstest_file, \"TEXT %lld\\n\", 46702919800LL + mujstest_count);\n#endif\n\t\t\t\tbreak;\n\t\t\tcase PDF_WIDGET_CONTENT_DATE:\n\t\t\t\tfprintf(mujstest_file, \"TEXT Jun %d 1979\\n\", 1 + ((13 + mujstest_count) % 30));\n\t\t\t\tbreak;\n\t\t\tcase PDF_WIDGET_CONTENT_TIME:\n\t\t\t\t++mujstest_count;\n\t\t\t\tfprintf(mujstest_file, \"TEXT %02d:%02d\\n\", ((mujstest_count/60) % 24), mujstest_count % 60);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase PDF_WIDGET_TYPE_LISTBOX:\n\t\t\tfprintf(mujstest_file, \"%% LISTBOX %0.2f %0.2f %0.2f %0.2f\\n\", rect.x0, rect.y0, rect.x1, rect.y1);\n\t\t\tbreak;\n\t\tcase PDF_WIDGET_TYPE_COMBOBOX:\n\t\t\tfprintf(mujstest_file, \"%% COMBOBOX %0.2f %0.2f %0.2f %0.2f\\n\", rect.x0, rect.y0, rect.x1, rect.y1);\n\t\t\tbreak;\n\t\t}\n\t\tfprintf(mujstest_file, \"CLICK %0.2f %0.2f\\n\", (rect.x0+rect.x1)/2, (rect.y0+rect.y1)/2);\n\t}\n\n\tfz_flush_warnings(ctx);\n\n\tif (mujstest_file && needshot)\n\t{\n\t\tfprintf(mujstest_file, \"SCREENSHOT\\n\");\n\t}\n}\n\nstatic void processpages(fz_context *ctx, fz_document *doc)\n{\n\tint page, pagecount;\n\tpagecount = fz_count_pages(doc);\n\tfor (page = 1; page <= pagecount; ++page)\n\t\tprocesspage(ctx, doc, page);\n}\n\nint main(int argc, char **argv)\n{\n\tchar *password = \"\";\n\tfz_document *doc = NULL;\n\tfz_context *ctx;\n\tint c;\n\n\tfz_var(doc);\n\n\twhile ((c = fz_getopt(argc, argv, \"p:\")) != -1)\n\t{\n\t\tswitch (c)\n\t\t{\n\t\tdefault: usage(); break;\n\t\tcase 'p': password = fz_optarg; break;\n\t\t}\n\t}\n\n\tif (fz_optind + 2 != argc)\n\t\tusage();\n\n\tfilename = argv[fz_optind];\n\tmujstest_filename = argv[fz_optind+1];\n\n\tif (strcmp(mujstest_filename, \"-\") == 0)\n\t\tmujstest_file = stdout;\n\telse\n\t\tmujstest_file = fopen(mujstest_filename, \"wb\");\n\n\tctx = fz_new_context(NULL, NULL, FZ_STORE_DEFAULT);\n\tif (!ctx)\n\t{\n\t\tfprintf(stderr, \"cannot initialise context\\n\");\n\t\texit(1);\n\t}\n\n\tfz_register_document_handlers(ctx);\n\n\tfz_try(ctx)\n\t{\n\t\tdoc = fz_open_document(ctx, filename);\n\n\t\tif (fz_needs_password(doc))\n\t\t{\n\t\t\tif (!fz_authenticate_password(doc, password))\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot authenticate password: %s\", filename);\n\t\t\tfprintf(mujstest_file, \"PASSWORD %s\\n\", password);\n\t\t}\n\n\t\tfprintf(mujstest_file, \"OPEN %s\\n\", filename);\n\n\t\tprocesspages(ctx, doc);\n\n\t\tfz_close_document(doc);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfprintf(stderr, \"mjsgen: cannot process document: %s\\n\", filename);\n\t\treturn 1;\n\t}\n\n\tfclose(mujstest_file);\n\tfz_free_context(ctx);\n\treturn 0;\n}\n\n#ifdef _MSC_VER\nint wmain(int argc, wchar_t *wargv[])\n{\n\tchar **argv = fz_argv_from_wargv(argc, wargv);\n\tint ret = main(argc, argv);\n\tfz_free_argv(argc, argv);\n\treturn ret;\n}\n#endif\n"
  },
  {
    "path": "mupdf/source/tools/mudraw.c",
    "content": "/*\n * mudraw -- command line tool for drawing pdf/xps/cbz documents\n */\n\n#include \"mupdf/fitz.h\"\n#include \"mupdf/pdf.h\" /* for pdf output */\n\n#ifdef _MSC_VER\n#include <winsock2.h>\n#define main main_utf8\n#else\n#include <sys/time.h>\n#endif\n\nenum { TEXT_PLAIN = 1, TEXT_HTML = 2, TEXT_XML = 3 };\n\nenum { OUT_PNG, OUT_PPM, OUT_PNM, OUT_PAM, OUT_PGM, OUT_PBM, OUT_SVG, OUT_PWG, OUT_PCL, OUT_PDF, OUT_TGA };\n\nenum { CS_INVALID, CS_UNSET, CS_MONO, CS_GRAY, CS_GRAY_ALPHA, CS_RGB, CS_RGB_ALPHA, CS_CMYK, CS_CMYK_ALPHA };\n\ntypedef struct\n{\n\tchar *suffix;\n\tint format;\n} suffix_t;\n\nstatic const suffix_t suffix_table[] =\n{\n\t{ \".png\", OUT_PNG },\n\t{ \".pgm\", OUT_PGM },\n\t{ \".ppm\", OUT_PPM },\n\t{ \".pnm\", OUT_PNM },\n\t{ \".pam\", OUT_PAM },\n\t{ \".pbm\", OUT_PBM },\n\t{ \".svg\", OUT_SVG },\n\t{ \".pwg\", OUT_PWG },\n\t{ \".pcl\", OUT_PCL },\n\t{ \".pdf\", OUT_PDF },\n\t{ \".tga\", OUT_TGA },\n};\n\ntypedef struct\n{\n\tchar *name;\n\tint colorspace;\n} cs_name_t;\n\nstatic const cs_name_t cs_name_table[] =\n{\n\t{ \"m\", CS_MONO },\n\t{ \"mono\", CS_MONO },\n\t{ \"g\", CS_GRAY },\n\t{ \"gray\", CS_GRAY },\n\t{ \"grey\", CS_GRAY },\n\t{ \"ga\", CS_GRAY_ALPHA },\n\t{ \"grayalpha\", CS_GRAY_ALPHA },\n\t{ \"greyalpha\", CS_GRAY_ALPHA },\n\t{ \"rgb\", CS_RGB },\n\t{ \"rgba\", CS_RGB_ALPHA },\n\t{ \"rgbalpha\", CS_RGB_ALPHA },\n\t{ \"cmyk\", CS_CMYK },\n\t{ \"cmyka\", CS_CMYK_ALPHA },\n\t{ \"cmykalpha\", CS_CMYK_ALPHA },\n};\n\ntypedef struct\n{\n\tint format;\n\tint default_cs;\n\tint permitted_cs[6];\n} format_cs_table_t;\n\nstatic const format_cs_table_t format_cs_table[] =\n{\n\t{ OUT_PNG, CS_RGB, { CS_GRAY, CS_GRAY_ALPHA, CS_RGB, CS_RGB_ALPHA } },\n\t{ OUT_PPM, CS_RGB, { CS_GRAY, CS_RGB } },\n\t{ OUT_PNM, CS_GRAY, { CS_GRAY, CS_RGB } },\n\t{ OUT_PAM, CS_RGB_ALPHA, { CS_GRAY, CS_GRAY_ALPHA, CS_RGB, CS_RGB_ALPHA, CS_CMYK, CS_CMYK_ALPHA } },\n\t{ OUT_PGM, CS_GRAY, { CS_GRAY, CS_RGB } },\n\t{ OUT_PBM, CS_MONO, { CS_MONO } },\n\t{ OUT_SVG, CS_RGB, { CS_RGB } },\n\t{ OUT_PWG, CS_RGB, { CS_MONO, CS_GRAY, CS_RGB, CS_CMYK } },\n\t{ OUT_PCL, CS_MONO, { CS_MONO } },\n\t{ OUT_PDF, CS_RGB, { CS_RGB } },\n\t{ OUT_TGA, CS_RGB, { CS_GRAY, CS_GRAY_ALPHA, CS_RGB, CS_RGB_ALPHA } },\n};\n\n/*\n\tA useful bit of bash script to call this to generate mjs files:\n\tfor f in tests_private/pdf/forms/v1.3/ *.pdf ; do g=${f%.*} ; echo $g ; ../mupdf.git/win32/debug/mudraw.exe -j $g.mjs $g.pdf ; done\n\n\tRemove the space from \"/ *.pdf\" before running - can't leave that\n\tin here, as it causes a warning about a possibly malformed comment.\n*/\n\nstatic char *output = NULL;\nstatic char *format = NULL;\nstatic float resolution = 72;\nstatic int res_specified = 0;\nstatic float rotation = 0;\n\nstatic int showxml = 0;\nstatic int showtext = 0;\nstatic int showtime = 0;\nstatic int showmd5 = 0;\nstatic pdf_document *pdfout = NULL;\nstatic int showoutline = 0;\nstatic int uselist = 1;\nstatic int alphabits = 8;\nstatic float gamma_value = 1;\nstatic int invert = 0;\nstatic int width = 0;\nstatic int height = 0;\nstatic int fit = 0;\nstatic int errored = 0;\nstatic int ignore_errors = 0;\nstatic int output_format;\nstatic int append = 0;\nstatic int out_cs = CS_UNSET;\nstatic int bandheight = 0;\nstatic int memtrace_current = 0;\nstatic int memtrace_peak = 0;\nstatic int memtrace_total = 0;\nstatic int showmemory = 0;\nstatic int showfeatures = 0;\nstatic fz_text_sheet *sheet = NULL;\nstatic fz_colorspace *colorspace;\nstatic char *filename;\nstatic int files = 0;\nfz_output *out = NULL;\n\nstatic struct {\n\tint count, total;\n\tint min, max;\n\tint minpage, maxpage;\n\tchar *minfilename;\n\tchar *maxfilename;\n} timing;\n\nstatic void usage(void)\n{\n\tfprintf(stderr,\n\t\t\"usage: mudraw [options] input [pages]\\n\"\n\t\t\"\\t-o -\\toutput filename (%%d for page number)\\n\"\n\t\t\"\\t-F -\\toutput format (if no -F, -o will be examined)\\n\"\n\t\t\"\\t\\tsupported formats: png, tga, pnm, pam, pwg, pcl, svg, pdf\\n\"\n\t\t\"\\t-p -\\tpassword\\n\"\n\t\t\"\\t-r -\\tresolution in dpi (default: 72)\\n\"\n\t\t\"\\t-w -\\twidth (in pixels) (maximum width if -r is specified)\\n\"\n\t\t\"\\t-h -\\theight (in pixels) (maximum height if -r is specified)\\n\"\n\t\t\"\\t-f -\\tfit width and/or height exactly (ignore aspect)\\n\"\n\t\t\"\\t-c -\\tcolorspace {mono,gray,grayalpha,rgb,rgba,cmyk,cmykalpha}\\n\"\n\t\t\"\\t-b -\\tnumber of bits of antialiasing (0 to 8)\\n\"\n\t\t\"\\t-B -\\tmaximum bandheight (pgm, ppm, pam output only)\\n\"\n\t\t\"\\t-g\\trender in grayscale (equivalent to: -c gray)\\n\"\n\t\t\"\\t-m\\tshow timing information\\n\"\n\t\t\"\\t-M\\tshow memory use summary\\n\"\n\t\t\"\\t-t\\tshow text (-tt for xml, -ttt for more verbose xml)\\n\"\n\t\t\"\\t-x\\tshow display list\\n\"\n\t\t\"\\t-d\\tdisable use of display list\\n\"\n\t\t\"\\t-5\\tshow md5 checksums\\n\"\n\t\t\"\\t-R -\\trotate clockwise by given number of degrees\\n\"\n\t\t\"\\t-G -\\tgamma correct output\\n\"\n\t\t\"\\t-I\\tinvert output\\n\"\n\t\t\"\\t-l\\tprint outline\\n\"\n\t\t\"\\t-T\\ttest for features (grayscale or color)\\n\"\n\t\t\"\\t-i\\tignore errors and continue with the next file\\n\"\n\t\t\"\\tpages\\tcomma separated list of ranges\\n\");\n\texit(1);\n}\n\nstatic int gettime(void)\n{\n\tstatic struct timeval first;\n\tstatic int once = 1;\n\tstruct timeval now;\n\tif (once)\n\t{\n\t\tgettimeofday(&first, NULL);\n\t\tonce = 0;\n\t}\n\tgettimeofday(&now, NULL);\n\treturn (now.tv_sec - first.tv_sec) * 1000 + (now.tv_usec - first.tv_usec) / 1000;\n}\n\nstatic int isrange(char *s)\n{\n\twhile (*s)\n\t{\n\t\tif ((*s < '0' || *s > '9') && *s != '-' && *s != ',')\n\t\t\treturn 0;\n\t\ts++;\n\t}\n\treturn 1;\n}\n\nstatic void drawpage(fz_context *ctx, fz_document *doc, int pagenum)\n{\n\tfz_page *page;\n\tfz_display_list *list = NULL;\n\tfz_device *dev = NULL;\n\tint start;\n\tfz_cookie cookie = { 0 };\n\n\tfz_var(list);\n\tfz_var(dev);\n\n\tif (showtime)\n\t{\n\t\tstart = gettime();\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tpage = fz_load_page(doc, pagenum - 1);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_message(ctx, \"cannot load page %d in file '%s'\", pagenum, filename);\n\t}\n\n\tif (uselist)\n\t{\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tlist = fz_new_display_list(ctx);\n\t\t\tdev = fz_new_list_device(ctx, list);\n\t\t\tfz_run_page(doc, page, dev, &fz_identity, &cookie);\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tfz_free_device(dev);\n\t\t\tdev = NULL;\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_drop_display_list(ctx, list);\n\t\t\tfz_free_page(doc, page);\n\t\t\tfz_rethrow_message(ctx, \"cannot draw page %d in file '%s'\", pagenum, filename);\n\t\t}\n\t}\n\n\tif (showxml)\n\t{\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tdev = fz_new_trace_device(ctx);\n\t\t\tif (list)\n\t\t\t\tfz_run_display_list(list, dev, &fz_identity, &fz_infinite_rect, &cookie);\n\t\t\telse\n\t\t\t\tfz_run_page(doc, page, dev, &fz_identity, &cookie);\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tfz_free_device(dev);\n\t\t\tdev = NULL;\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_drop_display_list(ctx, list);\n\t\t\tfz_free_page(doc, page);\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t}\n\n\tif (showtext)\n\t{\n\t\tfz_text_page *text = NULL;\n\n\t\tfz_var(text);\n\n\t\tfz_try(ctx)\n\t\t{\n\t\t\ttext = fz_new_text_page(ctx);\n\t\t\tdev = fz_new_text_device(ctx, sheet, text);\n\t\t\tif (showtext == TEXT_HTML)\n\t\t\t\tfz_disable_device_hints(dev, FZ_IGNORE_IMAGE);\n\t\t\tif (list)\n\t\t\t\tfz_run_display_list(list, dev, &fz_identity, &fz_infinite_rect, &cookie);\n\t\t\telse\n\t\t\t\tfz_run_page(doc, page, dev, &fz_identity, &cookie);\n\t\t\tfz_free_device(dev);\n\t\t\tdev = NULL;\n\t\t\tif (showtext == TEXT_XML)\n\t\t\t{\n\t\t\t\tfz_print_text_page_xml(ctx, out, text);\n\t\t\t}\n\t\t\telse if (showtext == TEXT_HTML)\n\t\t\t{\n\t\t\t\tfz_analyze_text(ctx, sheet, text);\n\t\t\t\tfz_print_text_page_html(ctx, out, text);\n\t\t\t}\n\t\t\telse if (showtext == TEXT_PLAIN)\n\t\t\t{\n\t\t\t\tfz_print_text_page(ctx, out, text);\n\t\t\t\tfz_printf(out, \"\\f\\n\");\n\t\t\t}\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tfz_free_device(dev);\n\t\t\tdev = NULL;\n\t\t\tfz_free_text_page(ctx, text);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_drop_display_list(ctx, list);\n\t\t\tfz_free_page(doc, page);\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t}\n\n\tif (showmd5 || showtime || showfeatures)\n\t\tprintf(\"page %s %d\", filename, pagenum);\n\n\tif (showfeatures)\n\t{\n\t\tint iscolor;\n\t\tdev = fz_new_test_device(ctx, &iscolor, 0.02f);\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tif (list)\n\t\t\t\tfz_run_display_list(list, dev, &fz_identity, &fz_infinite_rect, NULL);\n\t\t\telse\n\t\t\t\tfz_run_page(doc, page, dev, &fz_identity, &cookie);\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tfz_free_device(dev);\n\t\t\tdev = NULL;\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t\tprintf(\" %s\", iscolor ? \"color\" : \"grayscale\");\n\t}\n\n\tif (pdfout)\n\t{\n\t\tfz_matrix ctm;\n\t\tfz_rect bounds, tbounds;\n\t\tpdf_page *newpage;\n\n\t\tfz_bound_page(doc, page, &bounds);\n\t\tfz_rotate(&ctm, rotation);\n\t\ttbounds = bounds;\n\t\tfz_transform_rect(&tbounds, &ctm);\n\n\t\tnewpage = pdf_create_page(pdfout, bounds, 72, 0);\n\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tdev = pdf_page_write(pdfout, newpage);\n\t\t\tif (list)\n\t\t\t\tfz_run_display_list(list, dev, &ctm, &tbounds, &cookie);\n\t\t\telse\n\t\t\t\tfz_run_page(doc, page, dev, &ctm, &cookie);\n\t\t\tfz_free_device(dev);\n\t\t\tdev = NULL;\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tfz_free_device(dev);\n\t\t\tdev = NULL;\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_drop_display_list(ctx, list);\n\t\t\tfz_free_page(doc, page);\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t\tpdf_insert_page(pdfout, newpage, INT_MAX);\n\t\tpdf_free_page(pdfout, newpage);\n\t}\n\n\tif (output && output_format == OUT_SVG)\n\t{\n\t\tfloat zoom;\n\t\tfz_matrix ctm;\n\t\tfz_rect bounds, tbounds;\n\t\tchar buf[512];\n\t\tFILE *file;\n\t\tfz_output *out;\n\n\t\tif (!strcmp(output, \"-\"))\n\t\t\tfile = stdout;\n\t\telse\n\t\t{\n\t\t\tsprintf(buf, output, pagenum);\n\t\t\tfile = fopen(buf, \"wb\");\n\t\t\tif (file == NULL)\n\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot open file '%s': %s\", buf, strerror(errno));\n\t\t}\n\n\t\tout = fz_new_output_with_file(ctx, file);\n\n\t\tfz_bound_page(doc, page, &bounds);\n\t\tzoom = resolution / 72;\n\t\tfz_pre_rotate(fz_scale(&ctm, zoom, zoom), rotation);\n\t\ttbounds = bounds;\n\t\tfz_transform_rect(&tbounds, &ctm);\n\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tdev = fz_new_svg_device(ctx, out, tbounds.x1-tbounds.x0, tbounds.y1-tbounds.y0);\n\t\t\tif (list)\n\t\t\t\tfz_run_display_list(list, dev, &ctm, &tbounds, &cookie);\n\t\t\telse\n\t\t\t\tfz_run_page(doc, page, dev, &ctm, &cookie);\n\t\t\tfz_free_device(dev);\n\t\t\tdev = NULL;\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tfz_free_device(dev);\n\t\t\tdev = NULL;\n\t\t\tfz_close_output(out);\n\t\t\tif (file != stdout)\n\t\t\t\tfclose(file);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_drop_display_list(ctx, list);\n\t\t\tfz_free_page(doc, page);\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t}\n\n\tif ((output && output_format != OUT_SVG && !pdfout)|| showmd5 || showtime)\n\t{\n\t\tfloat zoom;\n\t\tfz_matrix ctm;\n\t\tfz_rect bounds, tbounds;\n\t\tfz_irect ibounds;\n\t\tfz_pixmap *pix = NULL;\n\t\tint w, h;\n\t\tfz_output *output_file = NULL;\n\t\tfz_png_output_context *poc = NULL;\n\n\t\tfz_var(pix);\n\t\tfz_var(poc);\n\n\t\tfz_bound_page(doc, page, &bounds);\n\t\tzoom = resolution / 72;\n\t\tfz_pre_scale(fz_rotate(&ctm, rotation), zoom, zoom);\n\t\ttbounds = bounds;\n\t\tfz_round_rect(&ibounds, fz_transform_rect(&tbounds, &ctm));\n\n\t\t/* Make local copies of our width/height */\n\t\tw = width;\n\t\th = height;\n\n\t\t/* If a resolution is specified, check to see whether w/h are\n\t\t * exceeded; if not, unset them. */\n\t\tif (res_specified)\n\t\t{\n\t\t\tint t;\n\t\t\tt = ibounds.x1 - ibounds.x0;\n\t\t\tif (w && t <= w)\n\t\t\t\tw = 0;\n\t\t\tt = ibounds.y1 - ibounds.y0;\n\t\t\tif (h && t <= h)\n\t\t\t\th = 0;\n\t\t}\n\n\t\t/* Now w or h will be 0 unless they need to be enforced. */\n\t\tif (w || h)\n\t\t{\n\t\t\tfloat scalex = w / (tbounds.x1 - tbounds.x0);\n\t\t\tfloat scaley = h / (tbounds.y1 - tbounds.y0);\n\t\t\tfz_matrix scale_mat;\n\n\t\t\tif (fit)\n\t\t\t{\n\t\t\t\tif (w == 0)\n\t\t\t\t\tscalex = 1.0f;\n\t\t\t\tif (h == 0)\n\t\t\t\t\tscaley = 1.0f;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (w == 0)\n\t\t\t\t\tscalex = scaley;\n\t\t\t\tif (h == 0)\n\t\t\t\t\tscaley = scalex;\n\t\t\t}\n\t\t\tif (!fit)\n\t\t\t{\n\t\t\t\tif (scalex > scaley)\n\t\t\t\t\tscalex = scaley;\n\t\t\t\telse\n\t\t\t\t\tscaley = scalex;\n\t\t\t}\n\t\t\tfz_scale(&scale_mat, scalex, scaley);\n\t\t\tfz_concat(&ctm, &ctm, &scale_mat);\n\t\t\ttbounds = bounds;\n\t\t\tfz_transform_rect(&tbounds, &ctm);\n\t\t}\n\t\tfz_round_rect(&ibounds, &tbounds);\n\t\tfz_rect_from_irect(&tbounds, &ibounds);\n\n\t\t/* TODO: banded rendering and multi-page ppm */\n\t\tfz_try(ctx)\n\t\t{\n\t\t\tint savealpha = (out_cs == CS_GRAY_ALPHA || out_cs == CS_RGB_ALPHA || out_cs == CS_CMYK_ALPHA);\n\t\t\tfz_irect band_ibounds = ibounds;\n\t\t\tint band, bands = 1;\n\t\t\tchar filename_buf[512];\n\t\t\tint totalheight = ibounds.y1 - ibounds.y0;\n\t\t\tint drawheight = totalheight;\n\n\t\t\tif (bandheight != 0)\n\t\t\t{\n\t\t\t\t/* Banded rendering; we'll only render to a\n\t\t\t\t * given height at a time. */\n\t\t\t\tdrawheight = bandheight;\n\t\t\t\tif (totalheight > bandheight)\n\t\t\t\t\tband_ibounds.y1 = band_ibounds.y0 + bandheight;\n\t\t\t\tbands = (totalheight + bandheight-1)/bandheight;\n\t\t\t\ttbounds.y1 = tbounds.y0 + bandheight + 2;\n\t\t\t}\n\n\t\t\tpix = fz_new_pixmap_with_bbox(ctx, colorspace, &band_ibounds);\n\t\t\tfz_pixmap_set_resolution(pix, resolution);\n\n\t\t\tif (output)\n\t\t\t{\n\t\t\t\tif (!strcmp(output, \"-\"))\n\t\t\t\t\toutput_file = fz_new_output_with_file(ctx, stdout);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsprintf(filename_buf, output, pagenum);\n\t\t\t\t\toutput_file = fz_new_output_to_filename(ctx, filename_buf);\n\t\t\t\t}\n\n\t\t\t\tif (output_format == OUT_PGM || output_format == OUT_PPM || output_format == OUT_PNM)\n\t\t\t\t\tfz_output_pnm_header(output_file, pix->w, totalheight, pix->n);\n\t\t\t\telse if (output_format == OUT_PAM)\n\t\t\t\t\tfz_output_pam_header(output_file, pix->w, totalheight, pix->n, savealpha);\n\t\t\t\telse if (output_format == OUT_PNG)\n\t\t\t\t\tpoc = fz_output_png_header(output_file, pix->w, totalheight, pix->n, savealpha);\n\t\t\t}\n\n\t\t\tfor (band = 0; band < bands; band++)\n\t\t\t{\n\t\t\t\tif (savealpha)\n\t\t\t\t\tfz_clear_pixmap(ctx, pix);\n\t\t\t\telse\n\t\t\t\t\tfz_clear_pixmap_with_value(ctx, pix, 255);\n\n\t\t\t\tdev = fz_new_draw_device(ctx, pix);\n\t\t\t\tif (alphabits == 0)\n\t\t\t\t\tfz_enable_device_hints(dev, FZ_DONT_INTERPOLATE_IMAGES);\n\t\t\t\tif (list)\n\t\t\t\t\tfz_run_display_list(list, dev, &ctm, &tbounds, &cookie);\n\t\t\t\telse\n\t\t\t\t\tfz_run_page(doc, page, dev, &ctm, &cookie);\n\t\t\t\tfz_free_device(dev);\n\t\t\t\tdev = NULL;\n\n\t\t\t\tif (invert)\n\t\t\t\t\tfz_invert_pixmap(ctx, pix);\n\t\t\t\tif (gamma_value != 1)\n\t\t\t\t\tfz_gamma_pixmap(ctx, pix, gamma_value);\n\n\t\t\t\tif (savealpha)\n\t\t\t\t\tfz_unmultiply_pixmap(ctx, pix);\n\n\t\t\t\tif (output)\n\t\t\t\t{\n\t\t\t\t\tif (output_format == OUT_PGM || output_format == OUT_PPM || output_format == OUT_PNM)\n\t\t\t\t\t\tfz_output_pnm_band(output_file, pix->w, totalheight, pix->n, band, drawheight, pix->samples);\n\t\t\t\t\telse if (output_format == OUT_PAM)\n\t\t\t\t\t\tfz_output_pam_band(output_file, pix->w, totalheight, pix->n, band, drawheight, pix->samples, savealpha);\n\t\t\t\t\telse if (output_format == OUT_PNG)\n\t\t\t\t\t\tfz_output_png_band(output_file, pix->w, totalheight, pix->n, band, drawheight, pix->samples, savealpha, poc);\n\t\t\t\t\telse if (output_format == OUT_PWG)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (strstr(output, \"%d\") != NULL)\n\t\t\t\t\t\t\tappend = 0;\n\t\t\t\t\t\tif (out_cs == CS_MONO)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfz_bitmap *bit = fz_halftone_pixmap(ctx, pix, NULL);\n\t\t\t\t\t\t\tfz_write_pwg_bitmap(ctx, bit, filename_buf, append, NULL);\n\t\t\t\t\t\t\tfz_drop_bitmap(ctx, bit);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tfz_write_pwg(ctx, pix, filename_buf, append, NULL);\n\t\t\t\t\t\tappend = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse if (output_format == OUT_PCL)\n\t\t\t\t\t{\n\t\t\t\t\t\tfz_pcl_options options;\n\n\t\t\t\t\t\tfz_pcl_preset(ctx, &options, \"ljet4\");\n\n\t\t\t\t\t\tif (strstr(output, \"%d\") != NULL)\n\t\t\t\t\t\t\tappend = 0;\n\t\t\t\t\t\tif (out_cs == CS_MONO)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfz_bitmap *bit = fz_halftone_pixmap(ctx, pix, NULL);\n\t\t\t\t\t\t\tfz_write_pcl_bitmap(ctx, bit, filename_buf, append, &options);\n\t\t\t\t\t\t\tfz_drop_bitmap(ctx, bit);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tfz_write_pcl(ctx, pix, filename_buf, append, &options);\n\t\t\t\t\t\tappend = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse if (output_format == OUT_PBM) {\n\t\t\t\t\t\tfz_bitmap *bit = fz_halftone_pixmap(ctx, pix, NULL);\n\t\t\t\t\t\tfz_write_pbm(ctx, bit, filename_buf);\n\t\t\t\t\t\tfz_drop_bitmap(ctx, bit);\n\t\t\t\t\t}\n\t\t\t\t\telse if (output_format == OUT_TGA)\n\t\t\t\t\t{\n\t\t\t\t\t\tfz_write_tga(ctx, pix, filename_buf, savealpha);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tctm.f -= drawheight;\n\t\t\t}\n\n\t\t\tif (showmd5)\n\t\t\t{\n\t\t\t\tunsigned char digest[16];\n\t\t\t\tint i;\n\n\t\t\t\tfz_md5_pixmap(pix, digest);\n\t\t\t\tprintf(\" \");\n\t\t\t\tfor (i = 0; i < 16; i++)\n\t\t\t\t\tprintf(\"%02x\", digest[i]);\n\t\t\t}\n\t\t}\n\t\tfz_always(ctx)\n\t\t{\n\t\t\tif (output)\n\t\t\t{\n\t\t\t\tif (output_format == OUT_PNG)\n\t\t\t\t\tfz_output_png_trailer(output_file, poc);\n\t\t\t}\n\n\t\t\tfz_free_device(dev);\n\t\t\tdev = NULL;\n\t\t\tfz_drop_pixmap(ctx, pix);\n\t\t\tif (output_file)\n\t\t\t\tfz_close_output(output_file);\n\t\t}\n\t\tfz_catch(ctx)\n\t\t{\n\t\t\tfz_drop_display_list(ctx, list);\n\t\t\tfz_free_page(doc, page);\n\t\t\tfz_rethrow(ctx);\n\t\t}\n\t}\n\n\tif (list)\n\t\tfz_drop_display_list(ctx, list);\n\n\tfz_free_page(doc, page);\n\n\tif (showtime)\n\t{\n\t\tint end = gettime();\n\t\tint diff = end - start;\n\n\t\tif (diff < timing.min)\n\t\t{\n\t\t\ttiming.min = diff;\n\t\t\ttiming.minpage = pagenum;\n\t\t\ttiming.minfilename = filename;\n\t\t}\n\t\tif (diff > timing.max)\n\t\t{\n\t\t\ttiming.max = diff;\n\t\t\ttiming.maxpage = pagenum;\n\t\t\ttiming.maxfilename = filename;\n\t\t}\n\t\ttiming.total += diff;\n\t\ttiming.count ++;\n\n\t\tprintf(\" %dms\", diff);\n\t}\n\n\tif (showmd5 || showtime || showfeatures)\n\t\tprintf(\"\\n\");\n\n\tif (showmemory)\n\t{\n\t\tfz_dump_glyph_cache_stats(ctx);\n\t}\n\n\tfz_flush_warnings(ctx);\n\n\tif (cookie.errors)\n\t\terrored = 1;\n}\n\nstatic void drawrange(fz_context *ctx, fz_document *doc, char *range)\n{\n\tint page, spage, epage, pagecount;\n\tchar *spec, *dash;\n\n\tpagecount = fz_count_pages(doc);\n\tspec = fz_strsep(&range, \",\");\n\twhile (spec)\n\t{\n\t\tdash = strchr(spec, '-');\n\n\t\tif (dash == spec)\n\t\t\tspage = epage = pagecount;\n\t\telse\n\t\t\tspage = epage = atoi(spec);\n\n\t\tif (dash)\n\t\t{\n\t\t\tif (strlen(dash) > 1)\n\t\t\t\tepage = atoi(dash + 1);\n\t\t\telse\n\t\t\t\tepage = pagecount;\n\t\t}\n\n\t\tspage = fz_clampi(spage, 1, pagecount);\n\t\tepage = fz_clampi(epage, 1, pagecount);\n\n\t\tif (spage < epage)\n\t\t\tfor (page = spage; page <= epage; page++)\n\t\t\t\tdrawpage(ctx, doc, page);\n\t\telse\n\t\t\tfor (page = spage; page >= epage; page--)\n\t\t\t\tdrawpage(ctx, doc, page);\n\n\t\tspec = fz_strsep(&range, \",\");\n\t}\n}\n\nstatic void drawoutline(fz_context *ctx, fz_document *doc)\n{\n\tfz_outline *outline = fz_load_outline(doc);\n\tfz_output *out = NULL;\n\n\tfz_var(out);\n\tfz_try(ctx)\n\t{\n\t\tout = fz_new_output_with_file(ctx, stdout);\n\t\tif (showoutline > 1)\n\t\t\tfz_print_outline_xml(ctx, out, outline);\n\t\telse\n\t\t\tfz_print_outline(ctx, out, outline);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close_output(out);\n\t\tfz_free_outline(ctx, outline);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nstatic int\nparse_colorspace(const char *name)\n{\n\tint i;\n\n\tfor (i = 0; i < nelem(cs_name_table); i++)\n\t{\n\t\tif (!strcmp(name, cs_name_table[i].name))\n\t\t\treturn cs_name_table[i].colorspace;\n\t}\n\tfprintf(stderr, \"Unknown colorspace \\\"%s\\\"\\n\", name);\n\texit(1);\n}\n\nstatic void *\ntrace_malloc(void *arg, unsigned int size)\n{\n\tint *p;\n\tif (size == 0)\n\t\treturn NULL;\n\tp = malloc(size + sizeof(unsigned int));\n\tif (p == NULL)\n\t\treturn NULL;\n\tp[0] = size;\n\tmemtrace_current += size;\n\tmemtrace_total += size;\n\tif (memtrace_current > memtrace_peak)\n\t\tmemtrace_peak = memtrace_current;\n\treturn (void *)&p[1];\n}\n\nstatic void\ntrace_free(void *arg, void *p_)\n{\n\tint *p = (int *)p_;\n\n\tif (p == NULL)\n\t\treturn;\n\tmemtrace_current -= p[-1];\n\tfree(&p[-1]);\n}\n\nstatic void *\ntrace_realloc(void *arg, void *p_, unsigned int size)\n{\n\tint *p = (int *)p_;\n\tunsigned int oldsize;\n\n\tif (size == 0)\n\t{\n\t\ttrace_free(arg, p_);\n\t\treturn NULL;\n\t}\n\tif (p == NULL)\n\t\treturn trace_malloc(arg, size);\n\toldsize = p[-1];\n\tp = realloc(&p[-1], size + sizeof(unsigned int));\n\tif (p == NULL)\n\t\treturn NULL;\n\tmemtrace_current += size - oldsize;\n\tif (size > oldsize)\n\t\tmemtrace_total += size - oldsize;\n\tif (memtrace_current > memtrace_peak)\n\t\tmemtrace_peak = memtrace_current;\n\tp[0] = size;\n\treturn &p[1];\n}\n\nint main(int argc, char **argv)\n{\n\tchar *password = \"\";\n\tfz_document *doc = NULL;\n\tint c;\n\tfz_context *ctx;\n\tfz_alloc_context alloc_ctx = { NULL, trace_malloc, trace_realloc, trace_free };\n\n\tfz_var(doc);\n\n\twhile ((c = fz_getopt(argc, argv, \"lo:F:p:r:R:b:c:dgmTtx5G:Iw:h:fiMB:\")) != -1)\n\t{\n\t\tswitch (c)\n\t\t{\n\t\tcase 'o': output = fz_optarg; break;\n\t\tcase 'F': format = fz_optarg; break;\n\t\tcase 'p': password = fz_optarg; break;\n\t\tcase 'r': resolution = atof(fz_optarg); res_specified = 1; break;\n\t\tcase 'R': rotation = atof(fz_optarg); break;\n\t\tcase 'b': alphabits = atoi(fz_optarg); break;\n\t\tcase 'B': bandheight = atoi(fz_optarg); break;\n\t\tcase 'l': showoutline++; break;\n\t\tcase 'm': showtime++; break;\n\t\tcase 'M': showmemory++; break;\n\t\tcase 't': showtext++; break;\n\t\tcase 'x': showxml++; break;\n\t\tcase '5': showmd5++; break;\n\t\tcase 'T': showfeatures++; break;\n\t\tcase 'g': out_cs = CS_GRAY; break;\n\t\tcase 'd': uselist = 0; break;\n\t\tcase 'c': out_cs = parse_colorspace(fz_optarg); break;\n\t\tcase 'G': gamma_value = atof(fz_optarg); break;\n\t\tcase 'w': width = atof(fz_optarg); break;\n\t\tcase 'h': height = atof(fz_optarg); break;\n\t\tcase 'f': fit = 1; break;\n\t\tcase 'I': invert++; break;\n\t\tcase 'i': ignore_errors = 1; break;\n\t\tdefault: usage(); break;\n\t\t}\n\t}\n\n\tif (fz_optind == argc)\n\t\tusage();\n\n\tif (!showtext && !showxml && !showtime && !showmd5 && !showoutline && !showfeatures && !output)\n\t{\n\t\tprintf(\"nothing to do\\n\");\n\t\texit(0);\n\t}\n\n\tctx = fz_new_context((showmemory == 0 ? NULL : &alloc_ctx), NULL, FZ_STORE_DEFAULT);\n\tif (!ctx)\n\t{\n\t\tfprintf(stderr, \"cannot initialise context\\n\");\n\t\texit(1);\n\t}\n\n\tfz_set_aa_level(ctx, alphabits);\n\n\t/* SumatraPDF: use locally installed fonts */\n\tpdf_install_load_system_font_funcs(ctx);\n\n\t/* Determine output type */\n\tif (bandheight < 0)\n\t{\n\t\tfprintf(stderr, \"Bandheight must be > 0\\n\");\n\t\texit(1);\n\t}\n\n\toutput_format = OUT_PNG;\n\tif (format)\n\t{\n\t\tint i;\n\n\t\tfor (i = 0; i < nelem(suffix_table); i++)\n\t\t{\n\t\t\tif (!strcmp(format, suffix_table[i].suffix+1))\n\t\t\t{\n\t\t\t\toutput_format = suffix_table[i].format;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (i == nelem(suffix_table))\n\t\t{\n\t\t\tfprintf(stderr, \"Unknown output format '%s'\\n\", format);\n\t\t\texit(1);\n\t\t}\n\t}\n\telse if (output)\n\t{\n\t\tchar *suffix = output;\n\t\tint i;\n\n\t\tfor (i = 0; i < nelem(suffix_table); i++)\n\t\t{\n\t\t\tchar *s = strstr(suffix, suffix_table[i].suffix);\n\n\t\t\tif (s != NULL)\n\t\t\t{\n\t\t\t\tsuffix = s+1;\n\t\t\t\toutput_format = suffix_table[i].format;\n\t\t\t\ti = 0;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (bandheight)\n\t{\n\t\tif (output_format != OUT_PAM && output_format != OUT_PGM && output_format != OUT_PPM && output_format != OUT_PNM && output_format != OUT_PNG)\n\t\t{\n\t\t\tfprintf(stderr, \"Banded operation only possible with PAM, PGM, PPM, PNM and PNG outputs\\n\");\n\t\t\texit(1);\n\t\t}\n\t\tif (showmd5)\n\t\t{\n\t\t\tfprintf(stderr, \"Banded operation not compatible with MD5\\n\");\n\t\t\texit(1);\n\t\t}\n\t}\n\n\t{\n\t\tint i, j;\n\n\t\tfor (i = 0; i < nelem(format_cs_table); i++)\n\t\t{\n\t\t\tif (format_cs_table[i].format == output_format)\n\t\t\t{\n\t\t\t\tif (out_cs == CS_UNSET)\n\t\t\t\t\tout_cs = format_cs_table[i].default_cs;\n\t\t\t\tfor (j = 0; j < nelem(format_cs_table[i].permitted_cs); j++)\n\t\t\t\t{\n\t\t\t\t\tif (format_cs_table[i].permitted_cs[j] == out_cs)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (j == nelem(format_cs_table[i].permitted_cs))\n\t\t\t\t{\n\t\t\t\t\tfprintf(stderr, \"Unsupported colorspace for this format\\n\");\n\t\t\t\t\texit(1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tswitch (out_cs)\n\t{\n\tcase CS_MONO:\n\tcase CS_GRAY:\n\tcase CS_GRAY_ALPHA:\n\t\tcolorspace = fz_device_gray(ctx);\n\t\tbreak;\n\tcase CS_RGB:\n\tcase CS_RGB_ALPHA:\n\t\tcolorspace = fz_device_rgb(ctx);\n\t\tbreak;\n\tcase CS_CMYK:\n\tcase CS_CMYK_ALPHA:\n\t\tcolorspace = fz_device_cmyk(ctx);\n\t\tbreak;\n\tdefault:\n\t\tfprintf(stderr, \"Unknown colorspace!\\n\");\n\t\texit(1);\n\t\tbreak;\n\t}\n\n\tif (output_format == OUT_PDF)\n\t{\n\t\tpdfout = pdf_create_document(ctx);\n\t}\n\n\ttiming.count = 0;\n\ttiming.total = 0;\n\ttiming.min = 1 << 30;\n\ttiming.max = 0;\n\ttiming.minpage = 0;\n\ttiming.maxpage = 0;\n\ttiming.minfilename = \"\";\n\ttiming.maxfilename = \"\";\n\n\tif (showxml || showtext)\n\t\tout = fz_new_output_with_file(ctx, stdout);\n\n\tif (showxml || showtext == TEXT_XML)\n\t\tfz_printf(out, \"<?xml version=\\\"1.0\\\"?>\\n\");\n\n\tif (showtext)\n\t\tsheet = fz_new_text_sheet(ctx);\n\n\tif (showtext == TEXT_HTML)\n\t{\n\t\tfz_printf(out, \"<style>\\n\");\n\t\tfz_printf(out, \"body{background-color:gray;margin:12pt;}\\n\");\n\t\tfz_printf(out, \"div.page{background-color:white;margin:6pt;padding:6pt;}\\n\");\n\t\tfz_printf(out, \"div.block{border:1px solid gray;margin:6pt;padding:6pt;}\\n\");\n\t\tfz_printf(out, \"div.metaline{display:table;width:100%%}\\n\");\n\t\tfz_printf(out, \"div.line{display:table-row;padding:6pt}\\n\");\n\t\tfz_printf(out, \"div.cell{display:table-cell;padding-left:6pt;padding-right:6pt}\\n\");\n\t\tfz_printf(out, \"p{margin:0pt;padding:0pt;}\\n\");\n\t\tfz_printf(out, \"</style>\\n\");\n\t\tfz_printf(out, \"<body>\\n\");\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tfz_register_document_handlers(ctx);\n\n\t\twhile (fz_optind < argc)\n\t\t{\n\t\t\tfz_try(ctx)\n\t\t\t{\n\t\t\t\tfilename = argv[fz_optind++];\n\t\t\t\tfiles++;\n\n\t\t\t\tfz_try(ctx)\n\t\t\t\t{\n\t\t\t\t\tdoc = fz_open_document(ctx, filename);\n\t\t\t\t}\n\t\t\t\tfz_catch(ctx)\n\t\t\t\t{\n\t\t\t\t\tfz_rethrow_message(ctx, \"cannot open document: %s\", filename);\n\t\t\t\t}\n\n\t\t\t\tif (fz_needs_password(doc))\n\t\t\t\t{\n\t\t\t\t\tif (!fz_authenticate_password(doc, password))\n\t\t\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot authenticate password: %s\", filename);\n\t\t\t\t}\n\n\t\t\t\tif (showxml || showtext == TEXT_XML)\n\t\t\t\t\tfz_printf(out, \"<document name=\\\"%s\\\">\\n\", filename);\n\n\t\t\t\tif (showoutline)\n\t\t\t\t\tdrawoutline(ctx, doc);\n\n\t\t\t\tif (showtext || showxml || showtime || showmd5 || showfeatures || output)\n\t\t\t\t{\n\t\t\t\t\tif (fz_optind == argc || !isrange(argv[fz_optind]))\n\t\t\t\t\t\tdrawrange(ctx, doc, \"1-\");\n\t\t\t\t\tif (fz_optind < argc && isrange(argv[fz_optind]))\n\t\t\t\t\t\tdrawrange(ctx, doc, argv[fz_optind++]);\n\t\t\t\t}\n\n\t\t\t\tif (showxml || showtext == TEXT_XML)\n\t\t\t\t\tfz_printf(out, \"</document>\\n\");\n\n\t\t\t\tfz_close_document(doc);\n\t\t\t\tdoc = NULL;\n\t\t\t}\n\t\t\tfz_catch(ctx)\n\t\t\t{\n\t\t\t\tif (!ignore_errors)\n\t\t\t\t\tfz_rethrow(ctx);\n\n\t\t\t\tfz_close_document(doc);\n\t\t\t\tdoc = NULL;\n\t\t\t\tfz_warn(ctx, \"ignoring error in '%s'\", filename);\n\t\t\t}\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_close_document(doc);\n\t\tfprintf(stderr, \"error: cannot draw '%s'\\n\", filename);\n\t\terrored = 1;\n\t}\n\n\tif (pdfout)\n\t{\n\t\tfz_write_options opts = { 0 };\n\n\t\tpdf_write_document(pdfout, output, &opts);\n\t\tpdf_close_document(pdfout);\n\t}\n\n\tif (showtext == TEXT_HTML)\n\t{\n\t\tfz_printf(out, \"</body>\\n\");\n\t\tfz_printf(out, \"<style>\\n\");\n\t\tfz_print_text_sheet(ctx, out, sheet);\n\t\tfz_printf(out, \"</style>\\n\");\n\t}\n\n\tif (showtext)\n\t\tfz_free_text_sheet(ctx, sheet);\n\n\tif (showxml || showtext)\n\t{\n\t\tfz_close_output(out);\n\t\tout = NULL;\n\t}\n\n\tif (showtime && timing.count > 0)\n\t{\n\t\tif (files == 1)\n\t\t{\n\t\t\tprintf(\"total %dms / %d pages for an average of %dms\\n\",\n\t\t\t\ttiming.total, timing.count, timing.total / timing.count);\n\t\t\tprintf(\"fastest page %d: %dms\\n\", timing.minpage, timing.min);\n\t\t\tprintf(\"slowest page %d: %dms\\n\", timing.maxpage, timing.max);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprintf(\"total %dms / %d pages for an average of %dms in %d files\\n\",\n\t\t\t\ttiming.total, timing.count, timing.total / timing.count, files);\n\t\t\tprintf(\"fastest page %d: %dms (%s)\\n\", timing.minpage, timing.min, timing.minfilename);\n\t\t\tprintf(\"slowest page %d: %dms (%s)\\n\", timing.maxpage, timing.max, timing.maxfilename);\n\t\t}\n\t}\n\n\tfz_free_context(ctx);\n\n\tif (showmemory)\n\t{\n\t\tprintf(\"Total memory use = %d bytes\\n\", memtrace_total);\n\t\tprintf(\"Peak memory use = %d bytes\\n\", memtrace_peak);\n\t\tprintf(\"Current memory use = %d bytes\\n\", memtrace_current);\n\t}\n\n\treturn (errored != 0);\n}\n\n#ifdef _MSC_VER\nint wmain(int argc, wchar_t *wargv[])\n{\n\tchar **argv = fz_argv_from_wargv(argc, wargv);\n\tint ret = main(argc, argv);\n\tfz_free_argv(argc, argv);\n\treturn ret;\n}\n#endif\n"
  },
  {
    "path": "mupdf/source/tools/mutool.c",
    "content": "/*\n * mutool -- swiss army knife of pdf manipulation tools\n */\n\n#include \"mupdf/fitz.h\"\n\n#ifdef _MSC_VER\n#define main main_utf8\n#endif\n\nint pdfclean_main(int argc, char *argv[]);\nint pdfextract_main(int argc, char *argv[]);\nint pdfinfo_main(int argc, char *argv[]);\nint pdfposter_main(int argc, char *argv[]);\nint pdfshow_main(int argc, char *argv[]);\n\nstatic struct {\n\tint (*func)(int argc, char *argv[]);\n\tchar *name;\n\tchar *desc;\n} tools[] = {\n\t{ pdfclean_main, \"clean\", \"rewrite pdf file\" },\n\t{ pdfextract_main, \"extract\", \"extract font and image resources\" },\n\t{ pdfinfo_main, \"info\", \"show information about pdf resources\" },\n\t{ pdfposter_main, \"poster\", \"split large page into many tiles\" },\n\t{ pdfshow_main, \"show\", \"show internal pdf objects\" },\n};\n\nstatic int\nnamematch(const char *end, const char *start, const char *match)\n{\n\tint len = strlen(match);\n\treturn ((end-len >= start) && (strncmp(end-len, match, len) == 0));\n}\n\nint main(int argc, char **argv)\n{\n\tchar *start, *end;\n\tchar buf[32];\n\tint i;\n\n\tif (argc == 0)\n\t{\n\t\tfprintf(stderr, \"No command name found!\\n\");\n\t\treturn 1;\n\t}\n\n\t/* Check argv[0] */\n\n\tif (argc > 0)\n\t{\n\t\tend = start = argv[0];\n\t\twhile (*end)\n\t\t\tend++;\n\t\tif ((end-4 >= start) && (end[-4] == '.') && (end[-3] == 'e') && (end[-2] == 'x') && (end[-1] == 'e'))\n\t\t\tend = end-4;\n\t\tfor (i = 0; i < nelem(tools); i++)\n\t\t{\n\t\t\tstrcpy(buf, \"mupdf\");\n\t\t\tstrcat(buf, tools[i].name);\n\t\t\tif (namematch(end, start, buf) || namematch(end, start, buf+2))\n\t\t\t\treturn tools[i].func(argc, argv);\n\t\t}\n\t}\n\n\t/* Check argv[1] */\n\n\tif (argc > 1)\n\t{\n\t\tfor (i = 0; i < nelem(tools); i++)\n\t\t\tif (!strcmp(tools[i].name, argv[1]))\n\t\t\t\treturn tools[i].func(argc - 1, argv + 1);\n\t}\n\n\t/* Print usage */\n\n\tfprintf(stderr, \"usage: mutool <command> [options]\\n\");\n\n\tfor (i = 0; i < nelem(tools); i++)\n\t\tfprintf(stderr, \"\\t%s\\t-- %s\\n\", tools[i].name, tools[i].desc);\n\n\treturn 1;\n}\n\n#ifdef _MSC_VER\nint wmain(int argc, wchar_t *wargv[])\n{\n\tchar **argv = fz_argv_from_wargv(argc, wargv);\n\tint ret = main(argc, argv);\n\tfz_free_argv(argc, argv);\n\treturn ret;\n}\n#endif\n"
  },
  {
    "path": "mupdf/source/tools/pdfclean.c",
    "content": "/*\n * PDF cleaning tool: general purpose pdf syntax washer.\n *\n * Rewrite PDF with pretty printed objects.\n * Garbage collect unreachable objects.\n * Inflate compressed streams.\n * Create subset documents.\n *\n * TODO: linearize document for fast web view\n */\n\n#include \"mupdf/pdf.h\"\n\ntypedef struct globals_s\n{\n\tpdf_document *doc;\n\tfz_context *ctx;\n} globals;\n\nstatic void usage(void)\n{\n\tfprintf(stderr,\n\t\t\"usage: mutool clean [options] input.pdf [output.pdf] [pages]\\n\"\n\t\t\"\\t-p -\\tpassword\\n\"\n\t\t\"\\t-g\\tgarbage collect unused objects\\n\"\n\t\t\"\\t-gg\\tin addition to -g compact xref table\\n\"\n\t\t\"\\t-ggg\\tin addition to -gg merge duplicate objects\\n\"\n\t\t\"\\t-s\\tclean content streams\\n\"\n\t\t\"\\t-d\\tdecompress all streams\\n\"\n\t\t\"\\t-l\\tlinearize PDF\\n\"\n\t\t\"\\t-i\\ttoggle decompression of image streams\\n\"\n\t\t\"\\t-f\\ttoggle decompression of font streams\\n\"\n\t\t\"\\t-a\\tascii hex encode binary streams\\n\"\n\t\t\"\\tpages\\tcomma separated list of ranges\\n\");\n\texit(1);\n}\n\nstatic int\nstring_in_names_list(pdf_obj *p, pdf_obj *names_list)\n{\n\tint n = pdf_array_len(names_list);\n\tint i;\n\tchar *str = pdf_to_str_buf(p);\n\n\tfor (i = 0; i < n ; i += 2)\n\t{\n\t\tif (!strcmp(pdf_to_str_buf(pdf_array_get(names_list, i)), str))\n\t\t\treturn 1;\n\t}\n\treturn 0;\n}\n\n/*\n * Recreate page tree to only retain specified pages.\n */\n\nstatic void retainpage(pdf_document *doc, pdf_obj *parent, pdf_obj *kids, int page)\n{\n\tpdf_obj *pageref = pdf_lookup_page_obj(doc, page-1);\n\tpdf_obj *pageobj = pdf_resolve_indirect(pageref);\n\n\tpdf_dict_puts(pageobj, \"Parent\", parent);\n\n\t/* Store page object in new kids array */\n\tpdf_array_push(kids, pageref);\n}\n\nstatic void retainpages(globals *glo, int argc, char **argv)\n{\n\tpdf_obj *oldroot, *root, *pages, *kids, *countobj, *parent, *olddests;\n\tpdf_document *doc = glo->doc;\n\tint argidx = 0;\n\tpdf_obj *names_list = NULL;\n\tint pagecount;\n\tint i;\n\n\t/* Keep only pages/type and (reduced) dest entries to avoid\n\t * references to unretained pages */\n\toldroot = pdf_dict_gets(pdf_trailer(doc), \"Root\");\n\tpages = pdf_dict_gets(oldroot, \"Pages\");\n\tolddests = pdf_load_name_tree(doc, \"Dests\");\n\n\troot = pdf_new_dict(doc, 2);\n\tpdf_dict_puts(root, \"Type\", pdf_dict_gets(oldroot, \"Type\"));\n\tpdf_dict_puts(root, \"Pages\", pdf_dict_gets(oldroot, \"Pages\"));\n\n\tpdf_update_object(doc, pdf_to_num(oldroot), root);\n\n\tpdf_drop_obj(root);\n\n\t/* Create a new kids array with only the pages we want to keep */\n\tparent = pdf_new_indirect(doc, pdf_to_num(pages), pdf_to_gen(pages));\n\tkids = pdf_new_array(doc, 1);\n\n\t/* Retain pages specified */\n\twhile (argc - argidx)\n\t{\n\t\tint page, spage, epage;\n\t\tchar *spec, *dash;\n\t\tchar *pagelist = argv[argidx];\n\n\t\tpagecount = pdf_count_pages(doc);\n\t\tspec = fz_strsep(&pagelist, \",\");\n\t\twhile (spec)\n\t\t{\n\t\t\tdash = strchr(spec, '-');\n\n\t\t\tif (dash == spec)\n\t\t\t\tspage = epage = pagecount;\n\t\t\telse\n\t\t\t\tspage = epage = atoi(spec);\n\n\t\t\tif (dash)\n\t\t\t{\n\t\t\t\tif (strlen(dash) > 1)\n\t\t\t\t\tepage = atoi(dash + 1);\n\t\t\t\telse\n\t\t\t\t\tepage = pagecount;\n\t\t\t}\n\n\t\t\tspage = fz_clampi(spage, 1, pagecount);\n\t\t\tepage = fz_clampi(epage, 1, pagecount);\n\n\t\t\tif (spage < epage)\n\t\t\t\tfor (page = spage; page <= epage; ++page)\n\t\t\t\t\tretainpage(doc, parent, kids, page);\n\t\t\telse\n\t\t\t\tfor (page = spage; page >= epage; --page)\n\t\t\t\t\tretainpage(doc, parent, kids, page);\n\n\t\t\tspec = fz_strsep(&pagelist, \",\");\n\t\t}\n\n\t\targidx++;\n\t}\n\n\tpdf_drop_obj(parent);\n\n\t/* Update page count and kids array */\n\tcountobj = pdf_new_int(doc, pdf_array_len(kids));\n\tpdf_dict_puts(pages, \"Count\", countobj);\n\tpdf_drop_obj(countobj);\n\tpdf_dict_puts(pages, \"Kids\", kids);\n\tpdf_drop_obj(kids);\n\n\t/* Also preserve the (partial) Dests name tree */\n\tif (olddests)\n\t{\n\t\tpdf_obj *names = pdf_new_dict(doc, 1);\n\t\tpdf_obj *dests = pdf_new_dict(doc, 1);\n\t\tint len = pdf_dict_len(olddests);\n\n\t\tnames_list = pdf_new_array(doc, 32);\n\n\t\tfor (i = 0; i < len; i++)\n\t\t{\n\t\t\tpdf_obj *key = pdf_dict_get_key(olddests, i);\n\t\t\tpdf_obj *val = pdf_dict_get_val(olddests, i);\n\t\t\tpdf_obj *dest = pdf_dict_gets(val, \"D\");\n\n\t\t\tdest = pdf_array_get(dest ? dest : val, 0);\n\t\t\tif (pdf_array_contains(pdf_dict_gets(pages, \"Kids\"), dest))\n\t\t\t{\n\t\t\t\tpdf_obj *key_str = pdf_new_string(doc, pdf_to_name(key), strlen(pdf_to_name(key)));\n\t\t\t\tpdf_array_push(names_list, key_str);\n\t\t\t\tpdf_array_push(names_list, val);\n\t\t\t\tpdf_drop_obj(key_str);\n\t\t\t}\n\t\t}\n\n\t\troot = pdf_dict_gets(pdf_trailer(doc), \"Root\");\n\t\tpdf_dict_puts(dests, \"Names\", names_list);\n\t\tpdf_dict_puts(names, \"Dests\", dests);\n\t\tpdf_dict_puts(root, \"Names\", names);\n\n\t\tpdf_drop_obj(names);\n\t\tpdf_drop_obj(dests);\n\t\tpdf_drop_obj(names_list);\n\t\tpdf_drop_obj(olddests);\n\t}\n\n\t/* Force the next call to pdf_count_pages to recount */\n\tglo->doc->page_count = 0;\n\n\t/* Edit each pages /Annot list to remove any links that point to\n\t * nowhere. */\n\tpagecount = pdf_count_pages(doc);\n\tfor (i = 0; i < pagecount; i++)\n\t{\n\t\tpdf_obj *pageref = pdf_lookup_page_obj(doc, i);\n\t\tpdf_obj *pageobj = pdf_resolve_indirect(pageref);\n\n\t\tpdf_obj *annots = pdf_dict_gets(pageobj, \"Annots\");\n\n\t\tint len = pdf_array_len(annots);\n\t\tint j;\n\n\t\tfor (j = 0; j < len; j++)\n\t\t{\n\t\t\tpdf_obj *o = pdf_array_get(annots, j);\n\t\t\tpdf_obj *p;\n\n\t\t\tif (strcmp(pdf_to_name(pdf_dict_gets(o, \"Subtype\")), \"Link\"))\n\t\t\t\tcontinue;\n\n\t\t\tp = pdf_dict_gets(o, \"A\");\n\t\t\tif (strcmp(pdf_to_name(pdf_dict_gets(p, \"S\")), \"GoTo\"))\n\t\t\t\tcontinue;\n\n\t\t\tif (string_in_names_list(pdf_dict_gets(p, \"D\"), names_list))\n\t\t\t\tcontinue;\n\n\t\t\t/* FIXME: Should probably look at Next too */\n\n\t\t\t/* Remove this annotation */\n\t\t\tpdf_array_delete(annots, j);\n\t\t\tj--;\n\t\t}\n\t}\n}\n\nvoid pdfclean_clean(fz_context *ctx, char *infile, char *outfile, char *password, fz_write_options *opts, char *argv[], int argc)\n{\n\tglobals glo = { 0 };\n\n\tglo.ctx = ctx;\n\n\tfz_try(ctx)\n\t{\n\t\tglo.doc = pdf_open_document_no_run(ctx, infile);\n\t\tif (pdf_needs_password(glo.doc))\n\t\t\tif (!pdf_authenticate_password(glo.doc, password))\n\t\t\t\tfz_throw(glo.ctx, FZ_ERROR_GENERIC, \"cannot authenticate password: %s\", infile);\n\n\t\t/* Only retain the specified subset of the pages */\n\t\tif (argc)\n\t\t\tretainpages(&glo, argc, argv);\n\n\t\tpdf_write_document(glo.doc, outfile, opts);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tpdf_close_document(glo.doc);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tif (opts && opts->errors)\n\t\t\t*opts->errors = *opts->errors+1;\n\t}\n}\n\nint pdfclean_main(int argc, char **argv)\n{\n\tchar *infile;\n\tchar *outfile = \"out.pdf\";\n\tchar *password = \"\";\n\tint c;\n\tfz_write_options opts;\n\tint errors = 0;\n\tfz_context *ctx;\n\n\topts.do_incremental = 0;\n\topts.do_garbage = 0;\n\topts.do_expand = 0;\n\topts.do_ascii = 0;\n\topts.do_linear = 0;\n\topts.continue_on_error = 1;\n\topts.errors = &errors;\n\topts.do_clean = 0;\n\n\twhile ((c = fz_getopt(argc, argv, \"adfgilp:s\")) != -1)\n\t{\n\t\tswitch (c)\n\t\t{\n\t\tcase 'p': password = fz_optarg; break;\n\t\tcase 'g': opts.do_garbage ++; break;\n\t\tcase 'd': opts.do_expand ^= fz_expand_all; break;\n\t\tcase 'f': opts.do_expand ^= fz_expand_fonts; break;\n\t\tcase 'i': opts.do_expand ^= fz_expand_images; break;\n\t\tcase 'l': opts.do_linear ++; break;\n\t\tcase 'a': opts.do_ascii ++; break;\n\t\tcase 's': opts.do_clean ++; break;\n\t\tdefault: usage(); break;\n\t\t}\n\t}\n\n\tif (argc - fz_optind < 1)\n\t\tusage();\n\n\tinfile = argv[fz_optind++];\n\n\tif (argc - fz_optind > 0 &&\n\t\t(strstr(argv[fz_optind], \".pdf\") || strstr(argv[fz_optind], \".PDF\")))\n\t{\n\t\toutfile = argv[fz_optind++];\n\t}\n\n\tctx = fz_new_context(NULL, NULL, FZ_STORE_UNLIMITED);\n\tif (!ctx)\n\t{\n\t\tfprintf(stderr, \"cannot initialise context\\n\");\n\t\texit(1);\n\t}\n\n\tfz_try(ctx)\n\t{\n\t\tpdfclean_clean(ctx, infile, outfile, password, &opts, &argv[fz_optind], argc - fz_optind);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\terrors++;\n\t}\n\tfz_free_context(ctx);\n\n\treturn errors == 0;\n}\n"
  },
  {
    "path": "mupdf/source/tools/pdfextract.c",
    "content": "/*\n * pdfextract -- the ultimate way to extract images and fonts from pdfs\n */\n\n#include \"mupdf/pdf.h\"\n\nstatic pdf_document *doc = NULL;\nstatic fz_context *ctx = NULL;\nstatic int dorgb = 0;\n\nstatic void usage(void)\n{\n\tfprintf(stderr, \"usage: mutool extract [options] file.pdf [object numbers]\\n\");\n\tfprintf(stderr, \"\\t-p\\tpassword\\n\");\n\tfprintf(stderr, \"\\t-r\\tconvert images to rgb\\n\");\n\texit(1);\n}\n\nstatic int isimage(pdf_obj *obj)\n{\n\tpdf_obj *type = pdf_dict_gets(obj, \"Subtype\");\n\treturn pdf_is_name(type) && !strcmp(pdf_to_name(type), \"Image\");\n}\n\nstatic int isfontdesc(pdf_obj *obj)\n{\n\tpdf_obj *type = pdf_dict_gets(obj, \"Type\");\n\treturn pdf_is_name(type) && !strcmp(pdf_to_name(type), \"FontDescriptor\");\n}\n\nstatic void writepixmap(fz_context *ctx, fz_pixmap *pix, char *file, int rgb)\n{\n\tchar buf[1024];\n\tfz_pixmap *converted = NULL;\n\n\tif (!pix)\n\t\treturn;\n\n\tif (rgb && pix->colorspace && pix->colorspace != fz_device_rgb(ctx))\n\t{\n\t\tfz_irect bbox;\n\t\tconverted = fz_new_pixmap_with_bbox(ctx, fz_device_rgb(ctx), fz_pixmap_bbox(ctx, pix, &bbox));\n\t\tfz_convert_pixmap(ctx, converted, pix);\n\t\tpix = converted;\n\t}\n\n\tif (pix->n <= 4)\n\t{\n\t\tsnprintf(buf, sizeof(buf), \"%s.png\", file);\n\t\tprintf(\"extracting image %s\\n\", buf);\n\t\tfz_write_png(ctx, pix, buf, 0);\n\t}\n\telse\n\t{\n\t\tsnprintf(buf, sizeof(buf), \"%s.pam\", file);\n\t\tprintf(\"extracting image %s\\n\", buf);\n\t\tfz_write_pam(ctx, pix, buf, 0);\n\t}\n\n\tfz_drop_pixmap(ctx, converted);\n}\n\nstatic void saveimage(int num)\n{\n\tfz_image *image;\n\tfz_pixmap *pix;\n\tpdf_obj *ref;\n\tchar buf[32];\n\n\tref = pdf_new_indirect(doc, num, 0);\n\n\t/* TODO: detect DCTD and save as jpeg */\n\n\timage = pdf_load_image(doc, ref);\n\tpix = fz_new_pixmap_from_image(ctx, image, 0, 0);\n\tfz_drop_image(ctx, image);\n\n\tsnprintf(buf, sizeof(buf), \"img-%04d\", num);\n\twritepixmap(ctx, pix, buf, dorgb);\n\n\tfz_drop_pixmap(ctx, pix);\n\tpdf_drop_obj(ref);\n}\n\nstatic void savefont(pdf_obj *dict, int num)\n{\n\tchar namebuf[1024];\n\tchar *subtype;\n\tfz_buffer *buf;\n\tpdf_obj *stream = NULL;\n\tpdf_obj *obj;\n\tchar *ext = \"\";\n\tFILE *f;\n\tchar *fontname = \"font\";\n\tint n, len;\n\tunsigned char *data;\n\n\tobj = pdf_dict_gets(dict, \"FontName\");\n\tif (obj)\n\t\tfontname = pdf_to_name(obj);\n\n\tobj = pdf_dict_gets(dict, \"FontFile\");\n\tif (obj)\n\t{\n\t\tstream = obj;\n\t\text = \"pfa\";\n\t}\n\n\tobj = pdf_dict_gets(dict, \"FontFile2\");\n\tif (obj)\n\t{\n\t\tstream = obj;\n\t\text = \"ttf\";\n\t}\n\n\tobj = pdf_dict_gets(dict, \"FontFile3\");\n\tif (obj)\n\t{\n\t\tstream = obj;\n\n\t\tobj = pdf_dict_gets(obj, \"Subtype\");\n\t\tif (obj && !pdf_is_name(obj))\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"invalid font descriptor subtype\");\n\n\t\tsubtype = pdf_to_name(obj);\n\t\tif (!strcmp(subtype, \"Type1C\"))\n\t\t\text = \"cff\";\n\t\telse if (!strcmp(subtype, \"CIDFontType0C\"))\n\t\t\text = \"cid\";\n\t\telse if (!strcmp(subtype, \"OpenType\"))\n\t\t\text = \"otf\";\n\t\telse\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"unhandled font type '%s'\", subtype);\n\t}\n\n\tif (!stream)\n\t{\n\t\tfz_warn(ctx, \"unhandled font type\");\n\t\treturn;\n\t}\n\n\tbuf = pdf_load_stream(doc, pdf_to_num(stream), pdf_to_gen(stream));\n\n\tsnprintf(namebuf, sizeof(namebuf), \"%s-%04d.%s\", fontname, num, ext);\n\tprintf(\"extracting font %s\\n\", namebuf);\n\n\tf = fopen(namebuf, \"wb\");\n\tif (!f)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot create font file\");\n\n\tlen = fz_buffer_storage(ctx, buf, &data);\n\tn = fwrite(data, 1, len, f);\n\tif (n < len)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot write font file\");\n\n\tif (fclose(f) < 0)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot close font file\");\n\n\tfz_drop_buffer(ctx, buf);\n}\n\nstatic void showobject(int num)\n{\n\tpdf_obj *obj;\n\n\tif (!doc)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"no file specified\");\n\n\tfz_try(ctx)\n\t{\n\t\tobj = pdf_load_object(doc, num, 0);\n\n\t\tif (isimage(obj))\n\t\t\tsaveimage(num);\n\t\telse if (isfontdesc(obj))\n\t\t\tsavefont(obj, num);\n\n\t\tpdf_drop_obj(obj);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_warn(ctx, \"ignoring object %d\", num);\n\t}\n}\n\nint pdfextract_main(int argc, char **argv)\n{\n\tchar *infile;\n\tchar *password = \"\";\n\tint c, o;\n\n\twhile ((c = fz_getopt(argc, argv, \"p:r\")) != -1)\n\t{\n\t\tswitch (c)\n\t\t{\n\t\tcase 'p': password = fz_optarg; break;\n\t\tcase 'r': dorgb++; break;\n\t\tdefault: usage(); break;\n\t\t}\n\t}\n\n\tif (fz_optind == argc)\n\t\tusage();\n\n\tinfile = argv[fz_optind++];\n\n\tctx = fz_new_context(NULL, NULL, FZ_STORE_UNLIMITED);\n\tif (!ctx)\n\t{\n\t\tfprintf(stderr, \"cannot initialise context\\n\");\n\t\texit(1);\n\t}\n\n\tdoc = pdf_open_document_no_run(ctx, infile);\n\tif (pdf_needs_password(doc))\n\t\tif (!pdf_authenticate_password(doc, password))\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot authenticate password: %s\", infile);\n\n\tif (fz_optind == argc)\n\t{\n\t\tint len = pdf_count_objects(doc);\n\t\tfor (o = 1; o < len; o++)\n\t\t\tshowobject(o);\n\t}\n\telse\n\t{\n\t\twhile (fz_optind < argc)\n\t\t{\n\t\t\tshowobject(atoi(argv[fz_optind]));\n\t\t\tfz_optind++;\n\t\t}\n\t}\n\n\tpdf_close_document(doc);\n\tfz_flush_warnings(ctx);\n\tfz_free_context(ctx);\n\treturn 0;\n}\n"
  },
  {
    "path": "mupdf/source/tools/pdfinfo.c",
    "content": "/*\n * Information tool.\n * Print information about the input pdf.\n */\n\n#include \"mupdf/pdf.h\"\n\nenum\n{\n\tDIMENSIONS = 0x01,\n\tFONTS = 0x02,\n\tIMAGES = 0x04,\n\tSHADINGS = 0x08,\n\tPATTERNS = 0x10,\n\tXOBJS = 0x20,\n\tALL = DIMENSIONS | FONTS | IMAGES | SHADINGS | PATTERNS | XOBJS\n};\n\nstruct info\n{\n\tint page;\n\tpdf_obj *pageref;\n\tpdf_obj *pageobj;\n\tunion {\n\t\tstruct {\n\t\t\tpdf_obj *obj;\n\t\t} info;\n\t\tstruct {\n\t\t\tpdf_obj *obj;\n\t\t} crypt;\n\t\tstruct {\n\t\t\tpdf_obj *obj;\n\t\t\tfz_rect *bbox;\n\t\t} dim;\n\t\tstruct {\n\t\t\tpdf_obj *obj;\n\t\t\tpdf_obj *subtype;\n\t\t\tpdf_obj *name;\n\t\t} font;\n\t\tstruct {\n\t\t\tpdf_obj *obj;\n\t\t\tpdf_obj *width;\n\t\t\tpdf_obj *height;\n\t\t\tpdf_obj *bpc;\n\t\t\tpdf_obj *filter;\n\t\t\tpdf_obj *cs;\n\t\t\tpdf_obj *altcs;\n\t\t} image;\n\t\tstruct {\n\t\t\tpdf_obj *obj;\n\t\t\tpdf_obj *type;\n\t\t} shading;\n\t\tstruct {\n\t\t\tpdf_obj *obj;\n\t\t\tpdf_obj *type;\n\t\t\tpdf_obj *paint;\n\t\t\tpdf_obj *tiling;\n\t\t\tpdf_obj *shading;\n\t\t} pattern;\n\t\tstruct {\n\t\t\tpdf_obj *obj;\n\t\t\tpdf_obj *groupsubtype;\n\t\t\tpdf_obj *reference;\n\t\t} form;\n\t} u;\n};\n\ntypedef struct globals_s\n{\n\tpdf_document *doc;\n\tfz_context *ctx;\n\tfz_output *out;\n\tint pagecount;\n\tstruct info *dim;\n\tint dims;\n\tstruct info *font;\n\tint fonts;\n\tstruct info *image;\n\tint images;\n\tstruct info *shading;\n\tint shadings;\n\tstruct info *pattern;\n\tint patterns;\n\tstruct info *form;\n\tint forms;\n\tstruct info *psobj;\n\tint psobjs;\n} globals;\n\nstatic void closexref(globals *glo)\n{\n\tint i;\n\tif (glo->doc)\n\t{\n\t\tpdf_close_document(glo->doc);\n\t\tglo->doc = NULL;\n\t}\n\n\tif (glo->dim)\n\t{\n\t\tfor (i = 0; i < glo->dims; i++)\n\t\t\tfz_free(glo->ctx, glo->dim[i].u.dim.bbox);\n\t\tfz_free(glo->ctx, glo->dim);\n\t\tglo->dim = NULL;\n\t\tglo->dims = 0;\n\t}\n\n\tif (glo->font)\n\t{\n\t\tfz_free(glo->ctx, glo->font);\n\t\tglo->font = NULL;\n\t\tglo->fonts = 0;\n\t}\n\n\tif (glo->image)\n\t{\n\t\tfz_free(glo->ctx, glo->image);\n\t\tglo->image = NULL;\n\t\tglo->images = 0;\n\t}\n\n\tif (glo->shading)\n\t{\n\t\tfz_free(glo->ctx, glo->shading);\n\t\tglo->shading = NULL;\n\t\tglo->shadings = 0;\n\t}\n\n\tif (glo->pattern)\n\t{\n\t\tfz_free(glo->ctx, glo->pattern);\n\t\tglo->pattern = NULL;\n\t\tglo->patterns = 0;\n\t}\n\n\tif (glo->form)\n\t{\n\t\tfz_free(glo->ctx, glo->form);\n\t\tglo->form = NULL;\n\t\tglo->forms = 0;\n\t}\n\n\tif (glo->psobj)\n\t{\n\t\tfz_free(glo->ctx, glo->psobj);\n\t\tglo->psobj = NULL;\n\t\tglo->psobjs = 0;\n\t}\n}\n\nstatic void\ninfousage(void)\n{\n\tfprintf(stderr,\n\t\t\"usage: mutool info [options] [file.pdf ... ]\\n\"\n\t\t\"\\t-d -\\tpassword for decryption\\n\"\n\t\t\"\\t-f\\tlist fonts\\n\"\n\t\t\"\\t-i\\tlist images\\n\"\n\t\t\"\\t-m\\tlist dimensions\\n\"\n\t\t\"\\t-p\\tlist patterns\\n\"\n\t\t\"\\t-s\\tlist shadings\\n\"\n\t\t\"\\t-x\\tlist form and postscript xobjects\\n\");\n\texit(1);\n}\n\nstatic void\nshowglobalinfo(globals *glo)\n{\n\tpdf_obj *obj;\n\tfz_output *out = glo->out;\n\tpdf_document *doc = glo->doc;\n\n\tfz_printf(out, \"\\nPDF-%d.%d\\n\", doc->version / 10, doc->version % 10);\n\n\tobj = pdf_dict_gets(pdf_trailer(doc), \"Info\");\n\tif (obj)\n\t{\n\t\tfz_printf(out, \"Info object (%d %d R):\\n\", pdf_to_num(obj), pdf_to_gen(obj));\n\t\tpdf_output_obj(out, pdf_resolve_indirect(obj), 1);\n\t}\n\n\tobj = pdf_dict_gets(pdf_trailer(doc), \"Encrypt\");\n\tif (obj)\n\t{\n\t\tfz_printf(out, \"\\nEncryption object (%d %d R):\\n\", pdf_to_num(obj), pdf_to_gen(obj));\n\t\tpdf_output_obj(out, pdf_resolve_indirect(obj), 1);\n\t}\n\n\tfz_printf(out, \"\\nPages: %d\\n\\n\", glo->pagecount);\n}\n\nstatic void\ngatherdimensions(globals *glo, int page, pdf_obj *pageref, pdf_obj *pageobj)\n{\n\tfz_rect bbox;\n\tpdf_obj *obj;\n\tint j;\n\n\tobj = pdf_dict_gets(pageobj, \"MediaBox\");\n\tif (!pdf_is_array(obj))\n\t\treturn;\n\n\tpdf_to_rect(glo->ctx, obj, &bbox);\n\n\tobj = pdf_dict_gets(pageobj, \"UserUnit\");\n\tif (pdf_is_real(obj))\n\t{\n\t\tfloat unit = pdf_to_real(obj);\n\t\tbbox.x0 *= unit;\n\t\tbbox.y0 *= unit;\n\t\tbbox.x1 *= unit;\n\t\tbbox.y1 *= unit;\n\t}\n\n\tfor (j = 0; j < glo->dims; j++)\n\t\tif (!memcmp(glo->dim[j].u.dim.bbox, &bbox, sizeof (fz_rect)))\n\t\t\tbreak;\n\n\tif (j < glo->dims)\n\t\treturn;\n\n\tglo->dim = fz_resize_array(glo->ctx, glo->dim, glo->dims+1, sizeof(struct info));\n\tglo->dims++;\n\n\tglo->dim[glo->dims - 1].page = page;\n\tglo->dim[glo->dims - 1].pageref = pageref;\n\tglo->dim[glo->dims - 1].pageobj = pageobj;\n\tglo->dim[glo->dims - 1].u.dim.bbox = fz_malloc(glo->ctx, sizeof(fz_rect));\n\tmemcpy(glo->dim[glo->dims - 1].u.dim.bbox, &bbox, sizeof (fz_rect));\n\n\treturn;\n}\n\nstatic void\ngatherfonts(globals *glo, int page, pdf_obj *pageref, pdf_obj *pageobj, pdf_obj *dict)\n{\n\tint i, n;\n\n\tn = pdf_dict_len(dict);\n\tfor (i = 0; i < n; i++)\n\t{\n\t\tpdf_obj *fontdict = NULL;\n\t\tpdf_obj *subtype = NULL;\n\t\tpdf_obj *basefont = NULL;\n\t\tpdf_obj *name = NULL;\n\t\tint k;\n\n\t\tfontdict = pdf_dict_get_val(dict, i);\n\t\tif (!pdf_is_dict(fontdict))\n\t\t{\n\t\t\tfz_warn(glo->ctx, \"not a font dict (%d %d R)\", pdf_to_num(fontdict), pdf_to_gen(fontdict));\n\t\t\tcontinue;\n\t\t}\n\n\t\tsubtype = pdf_dict_gets(fontdict, \"Subtype\");\n\t\tbasefont = pdf_dict_gets(fontdict, \"BaseFont\");\n\t\tif (!basefont || pdf_is_null(basefont))\n\t\t\tname = pdf_dict_gets(fontdict, \"Name\");\n\n\t\tfor (k = 0; k < glo->fonts; k++)\n\t\t\tif (!pdf_objcmp(glo->font[k].u.font.obj, fontdict))\n\t\t\t\tbreak;\n\n\t\tif (k < glo->fonts)\n\t\t\tcontinue;\n\n\t\tglo->font = fz_resize_array(glo->ctx, glo->font, glo->fonts+1, sizeof(struct info));\n\t\tglo->fonts++;\n\n\t\tglo->font[glo->fonts - 1].page = page;\n\t\tglo->font[glo->fonts - 1].pageref = pageref;\n\t\tglo->font[glo->fonts - 1].pageobj = pageobj;\n\t\tglo->font[glo->fonts - 1].u.font.obj = fontdict;\n\t\tglo->font[glo->fonts - 1].u.font.subtype = subtype;\n\t\tglo->font[glo->fonts - 1].u.font.name = basefont ? basefont : name;\n\t}\n}\n\nstatic void\ngatherimages(globals *glo, int page, pdf_obj *pageref, pdf_obj *pageobj, pdf_obj *dict)\n{\n\tint i, n;\n\n\tn = pdf_dict_len(dict);\n\tfor (i = 0; i < n; i++)\n\t{\n\t\tpdf_obj *imagedict;\n\t\tpdf_obj *type;\n\t\tpdf_obj *width;\n\t\tpdf_obj *height;\n\t\tpdf_obj *bpc = NULL;\n\t\tpdf_obj *filter = NULL;\n\t\tpdf_obj *cs = NULL;\n\t\tpdf_obj *altcs;\n\t\tint k;\n\n\t\timagedict = pdf_dict_get_val(dict, i);\n\t\tif (!pdf_is_dict(imagedict))\n\t\t{\n\t\t\tfz_warn(glo->ctx, \"not an image dict (%d %d R)\", pdf_to_num(imagedict), pdf_to_gen(imagedict));\n\t\t\tcontinue;\n\t\t}\n\n\t\ttype = pdf_dict_gets(imagedict, \"Subtype\");\n\t\tif (strcmp(pdf_to_name(type), \"Image\"))\n\t\t\tcontinue;\n\n\t\tfilter = pdf_dict_gets(imagedict, \"Filter\");\n\n\t\taltcs = NULL;\n\t\tcs = pdf_dict_gets(imagedict, \"ColorSpace\");\n\t\tif (pdf_is_array(cs))\n\t\t{\n\t\t\tpdf_obj *cses = cs;\n\n\t\t\tcs = pdf_array_get(cses, 0);\n\t\t\tif (pdf_is_name(cs) && (!strcmp(pdf_to_name(cs), \"DeviceN\") || !strcmp(pdf_to_name(cs), \"Separation\")))\n\t\t\t{\n\t\t\t\taltcs = pdf_array_get(cses, 2);\n\t\t\t\tif (pdf_is_array(altcs))\n\t\t\t\t\taltcs = pdf_array_get(altcs, 0);\n\t\t\t}\n\t\t}\n\n\t\twidth = pdf_dict_gets(imagedict, \"Width\");\n\t\theight = pdf_dict_gets(imagedict, \"Height\");\n\t\tbpc = pdf_dict_gets(imagedict, \"BitsPerComponent\");\n\n\t\tfor (k = 0; k < glo->images; k++)\n\t\t\tif (!pdf_objcmp(glo->image[k].u.image.obj, imagedict))\n\t\t\t\tbreak;\n\n\t\tif (k < glo->images)\n\t\t\tcontinue;\n\n\t\tglo->image = fz_resize_array(glo->ctx, glo->image, glo->images+1, sizeof(struct info));\n\t\tglo->images++;\n\n\t\tglo->image[glo->images - 1].page = page;\n\t\tglo->image[glo->images - 1].pageref = pageref;\n\t\tglo->image[glo->images - 1].pageobj = pageobj;\n\t\tglo->image[glo->images - 1].u.image.obj = imagedict;\n\t\tglo->image[glo->images - 1].u.image.width = width;\n\t\tglo->image[glo->images - 1].u.image.height = height;\n\t\tglo->image[glo->images - 1].u.image.bpc = bpc;\n\t\tglo->image[glo->images - 1].u.image.filter = filter;\n\t\tglo->image[glo->images - 1].u.image.cs = cs;\n\t\tglo->image[glo->images - 1].u.image.altcs = altcs;\n\t}\n}\n\nstatic void\ngatherforms(globals *glo, int page, pdf_obj *pageref, pdf_obj *pageobj, pdf_obj *dict)\n{\n\tint i, n;\n\n\tn = pdf_dict_len(dict);\n\tfor (i = 0; i < n; i++)\n\t{\n\t\tpdf_obj *xobjdict;\n\t\tpdf_obj *type;\n\t\tpdf_obj *subtype;\n\t\tpdf_obj *group;\n\t\tpdf_obj *groupsubtype;\n\t\tpdf_obj *reference;\n\t\tint k;\n\n\t\txobjdict = pdf_dict_get_val(dict, i);\n\t\tif (!pdf_is_dict(xobjdict))\n\t\t{\n\t\t\tfz_warn(glo->ctx, \"not a xobject dict (%d %d R)\", pdf_to_num(xobjdict), pdf_to_gen(xobjdict));\n\t\t\tcontinue;\n\t\t}\n\n\t\ttype = pdf_dict_gets(xobjdict, \"Subtype\");\n\t\tif (strcmp(pdf_to_name(type), \"Form\"))\n\t\t\tcontinue;\n\n\t\tsubtype = pdf_dict_gets(xobjdict, \"Subtype2\");\n\t\tif (!strcmp(pdf_to_name(subtype), \"PS\"))\n\t\t\tcontinue;\n\n\t\tgroup = pdf_dict_gets(xobjdict, \"Group\");\n\t\tgroupsubtype = pdf_dict_gets(group, \"S\");\n\t\treference = pdf_dict_gets(xobjdict, \"Ref\");\n\n\t\tfor (k = 0; k < glo->forms; k++)\n\t\t\tif (!pdf_objcmp(glo->form[k].u.form.obj, xobjdict))\n\t\t\t\tbreak;\n\n\t\tif (k < glo->forms)\n\t\t\tcontinue;\n\n\t\tglo->form = fz_resize_array(glo->ctx, glo->form, glo->forms+1, sizeof(struct info));\n\t\tglo->forms++;\n\n\t\tglo->form[glo->forms - 1].page = page;\n\t\tglo->form[glo->forms - 1].pageref = pageref;\n\t\tglo->form[glo->forms - 1].pageobj = pageobj;\n\t\tglo->form[glo->forms - 1].u.form.obj = xobjdict;\n\t\tglo->form[glo->forms - 1].u.form.groupsubtype = groupsubtype;\n\t\tglo->form[glo->forms - 1].u.form.reference = reference;\n\t}\n}\n\nstatic void\ngatherpsobjs(globals *glo, int page, pdf_obj *pageref, pdf_obj *pageobj, pdf_obj *dict)\n{\n\tint i, n;\n\n\tn = pdf_dict_len(dict);\n\tfor (i = 0; i < n; i++)\n\t{\n\t\tpdf_obj *xobjdict;\n\t\tpdf_obj *type;\n\t\tpdf_obj *subtype;\n\t\tint k;\n\n\t\txobjdict = pdf_dict_get_val(dict, i);\n\t\tif (!pdf_is_dict(xobjdict))\n\t\t{\n\t\t\tfz_warn(glo->ctx, \"not a xobject dict (%d %d R)\", pdf_to_num(xobjdict), pdf_to_gen(xobjdict));\n\t\t\tcontinue;\n\t\t}\n\n\t\ttype = pdf_dict_gets(xobjdict, \"Subtype\");\n\t\tsubtype = pdf_dict_gets(xobjdict, \"Subtype2\");\n\t\tif (strcmp(pdf_to_name(type), \"PS\") &&\n\t\t\t(strcmp(pdf_to_name(type), \"Form\") || strcmp(pdf_to_name(subtype), \"PS\")))\n\t\t\tcontinue;\n\n\t\tfor (k = 0; k < glo->psobjs; k++)\n\t\t\tif (!pdf_objcmp(glo->psobj[k].u.form.obj, xobjdict))\n\t\t\t\tbreak;\n\n\t\tif (k < glo->psobjs)\n\t\t\tcontinue;\n\n\t\tglo->psobj = fz_resize_array(glo->ctx, glo->psobj, glo->psobjs+1, sizeof(struct info));\n\t\tglo->psobjs++;\n\n\t\tglo->psobj[glo->psobjs - 1].page = page;\n\t\tglo->psobj[glo->psobjs - 1].pageref = pageref;\n\t\tglo->psobj[glo->psobjs - 1].pageobj = pageobj;\n\t\tglo->psobj[glo->psobjs - 1].u.form.obj = xobjdict;\n\t}\n}\n\nstatic void\ngathershadings(globals *glo, int page, pdf_obj *pageref, pdf_obj *pageobj, pdf_obj *dict)\n{\n\tint i, n;\n\n\tn = pdf_dict_len(dict);\n\tfor (i = 0; i < n; i++)\n\t{\n\t\tpdf_obj *shade;\n\t\tpdf_obj *type;\n\t\tint k;\n\n\t\tshade = pdf_dict_get_val(dict, i);\n\t\tif (!pdf_is_dict(shade))\n\t\t{\n\t\t\tfz_warn(glo->ctx, \"not a shading dict (%d %d R)\", pdf_to_num(shade), pdf_to_gen(shade));\n\t\t\tcontinue;\n\t\t}\n\n\t\ttype = pdf_dict_gets(shade, \"ShadingType\");\n\t\tif (!pdf_is_int(type) || pdf_to_int(type) < 1 || pdf_to_int(type) > 7)\n\t\t{\n\t\t\tfz_warn(glo->ctx, \"not a shading type (%d %d R)\", pdf_to_num(shade), pdf_to_gen(shade));\n\t\t\ttype = NULL;\n\t\t}\n\n\t\tfor (k = 0; k < glo->shadings; k++)\n\t\t\tif (!pdf_objcmp(glo->shading[k].u.shading.obj, shade))\n\t\t\t\tbreak;\n\n\t\tif (k < glo->shadings)\n\t\t\tcontinue;\n\n\t\tglo->shading = fz_resize_array(glo->ctx, glo->shading, glo->shadings+1, sizeof(struct info));\n\t\tglo->shadings++;\n\n\t\tglo->shading[glo->shadings - 1].page = page;\n\t\tglo->shading[glo->shadings - 1].pageref = pageref;\n\t\tglo->shading[glo->shadings - 1].pageobj = pageobj;\n\t\tglo->shading[glo->shadings - 1].u.shading.obj = shade;\n\t\tglo->shading[glo->shadings - 1].u.shading.type = type;\n\t}\n}\n\nstatic void\ngatherpatterns(globals *glo, int page, pdf_obj *pageref, pdf_obj *pageobj, pdf_obj *dict)\n{\n\tint i, n;\n\n\tn = pdf_dict_len(dict);\n\tfor (i = 0; i < n; i++)\n\t{\n\t\tpdf_obj *patterndict;\n\t\tpdf_obj *type;\n\t\tpdf_obj *paint = NULL;\n\t\tpdf_obj *tiling = NULL;\n\t\tpdf_obj *shading = NULL;\n\t\tint k;\n\n\t\tpatterndict = pdf_dict_get_val(dict, i);\n\t\tif (!pdf_is_dict(patterndict))\n\t\t{\n\t\t\tfz_warn(glo->ctx, \"not a pattern dict (%d %d R)\", pdf_to_num(patterndict), pdf_to_gen(patterndict));\n\t\t\tcontinue;\n\t\t}\n\n\t\ttype = pdf_dict_gets(patterndict, \"PatternType\");\n\t\tif (!pdf_is_int(type) || pdf_to_int(type) < 1 || pdf_to_int(type) > 2)\n\t\t{\n\t\t\tfz_warn(glo->ctx, \"not a pattern type (%d %d R)\", pdf_to_num(patterndict), pdf_to_gen(patterndict));\n\t\t\ttype = NULL;\n\t\t}\n\n\t\tif (pdf_to_int(type) == 1)\n\t\t{\n\t\t\tpaint = pdf_dict_gets(patterndict, \"PaintType\");\n\t\t\tif (!pdf_is_int(paint) || pdf_to_int(paint) < 1 || pdf_to_int(paint) > 2)\n\t\t\t{\n\t\t\t\tfz_warn(glo->ctx, \"not a pattern paint type (%d %d R)\", pdf_to_num(patterndict), pdf_to_gen(patterndict));\n\t\t\t\tpaint = NULL;\n\t\t\t}\n\n\t\t\ttiling = pdf_dict_gets(patterndict, \"TilingType\");\n\t\t\tif (!pdf_is_int(tiling) || pdf_to_int(tiling) < 1 || pdf_to_int(tiling) > 3)\n\t\t\t{\n\t\t\t\tfz_warn(glo->ctx, \"not a pattern tiling type (%d %d R)\", pdf_to_num(patterndict), pdf_to_gen(patterndict));\n\t\t\t\ttiling = NULL;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshading = pdf_dict_gets(patterndict, \"Shading\");\n\t\t}\n\n\t\tfor (k = 0; k < glo->patterns; k++)\n\t\t\tif (!pdf_objcmp(glo->pattern[k].u.pattern.obj, patterndict))\n\t\t\t\tbreak;\n\n\t\tif (k < glo->patterns)\n\t\t\tcontinue;\n\n\t\tglo->pattern = fz_resize_array(glo->ctx, glo->pattern, glo->patterns+1, sizeof(struct info));\n\t\tglo->patterns++;\n\n\t\tglo->pattern[glo->patterns - 1].page = page;\n\t\tglo->pattern[glo->patterns - 1].pageref = pageref;\n\t\tglo->pattern[glo->patterns - 1].pageobj = pageobj;\n\t\tglo->pattern[glo->patterns - 1].u.pattern.obj = patterndict;\n\t\tglo->pattern[glo->patterns - 1].u.pattern.type = type;\n\t\tglo->pattern[glo->patterns - 1].u.pattern.paint = paint;\n\t\tglo->pattern[glo->patterns - 1].u.pattern.tiling = tiling;\n\t\tglo->pattern[glo->patterns - 1].u.pattern.shading = shading;\n\t}\n}\n\nstatic void\ngatherresourceinfo(globals *glo, int page, pdf_obj *rsrc, int show)\n{\n\tpdf_obj *pageobj;\n\tpdf_obj *pageref;\n\tpdf_obj *font;\n\tpdf_obj *xobj;\n\tpdf_obj *shade;\n\tpdf_obj *pattern;\n\tpdf_obj *subrsrc;\n\tint i;\n\n\tpageref = pdf_lookup_page_obj(glo->doc, page-1);\n\tpageobj = pdf_resolve_indirect(pageref);\n\n\tif (!pageobj)\n\t\tfz_throw(glo->ctx, FZ_ERROR_GENERIC, \"cannot retrieve info from page %d\", page);\n\n\tfont = pdf_dict_gets(rsrc, \"Font\");\n\tif (show & FONTS && font)\n\t{\n\t\tint n;\n\n\t\tgatherfonts(glo, page, pageref, pageobj, font);\n\t\tn = pdf_dict_len(font);\n\t\tfor (i = 0; i < n; i++)\n\t\t{\n\t\t\tpdf_obj *obj = pdf_dict_get_val(font, i);\n\n\t\t\tsubrsrc = pdf_dict_gets(obj, \"Resources\");\n\t\t\tif (subrsrc && pdf_objcmp(rsrc, subrsrc))\n\t\t\t\tgatherresourceinfo(glo, page, subrsrc, show);\n\t\t}\n\t}\n\n\txobj = pdf_dict_gets(rsrc, \"XObject\");\n\tif (show & XOBJS && xobj)\n\t{\n\t\tint n;\n\n\t\tgatherimages(glo, page, pageref, pageobj, xobj);\n\t\tgatherforms(glo, page, pageref, pageobj, xobj);\n\t\tgatherpsobjs(glo, page, pageref, pageobj, xobj);\n\t\tn = pdf_dict_len(xobj);\n\t\tfor (i = 0; i < n; i++)\n\t\t{\n\t\t\tpdf_obj *obj = pdf_dict_get_val(xobj, i);\n\t\t\tsubrsrc = pdf_dict_gets(obj, \"Resources\");\n\t\t\tif (subrsrc && pdf_objcmp(rsrc, subrsrc))\n\t\t\t\tgatherresourceinfo(glo, page, subrsrc, show);\n\t\t}\n\t}\n\n\tshade = pdf_dict_gets(rsrc, \"Shading\");\n\tif (show & SHADINGS && shade)\n\t\tgathershadings(glo, page, pageref, pageobj, shade);\n\n\tpattern = pdf_dict_gets(rsrc, \"Pattern\");\n\tif (show & PATTERNS && pattern)\n\t{\n\t\tint n;\n\t\tgatherpatterns(glo, page, pageref, pageobj, pattern);\n\t\tn = pdf_dict_len(pattern);\n\t\tfor (i = 0; i < n; i++)\n\t\t{\n\t\t\tpdf_obj *obj = pdf_dict_get_val(pattern, i);\n\t\t\tsubrsrc = pdf_dict_gets(obj, \"Resources\");\n\t\t\tif (subrsrc && pdf_objcmp(rsrc, subrsrc))\n\t\t\t\tgatherresourceinfo(glo, page, subrsrc, show);\n\t\t}\n\t}\n}\n\nstatic void\ngatherpageinfo(globals *glo, int page, int show)\n{\n\tpdf_obj *pageobj;\n\tpdf_obj *pageref;\n\tpdf_obj *rsrc;\n\n\tpageref = pdf_lookup_page_obj(glo->doc, page-1);\n\tpageobj = pdf_resolve_indirect(pageref);\n\n\tif (!pageobj)\n\t\tfz_throw(glo->ctx, FZ_ERROR_GENERIC, \"cannot retrieve info from page %d\", page);\n\n\tgatherdimensions(glo, page, pageref, pageobj);\n\n\trsrc = pdf_dict_gets(pageobj, \"Resources\");\n\tgatherresourceinfo(glo, page, rsrc, show);\n}\n\nstatic void\nprintinfo(globals *glo, char *filename, int show, int page)\n{\n\tint i;\n\tint j;\n\tfz_output *out = glo->out;\n\n#define PAGE_FMT \"\\t%d\\t(%d %d R):\\t\"\n\n\tif (show & DIMENSIONS && glo->dims > 0)\n\t{\n\t\tfz_printf(out, \"Mediaboxes (%d):\\n\", glo->dims);\n\t\tfor (i = 0; i < glo->dims; i++)\n\t\t{\n\t\t\tfz_printf(out, PAGE_FMT \"[ %g %g %g %g ]\\n\",\n\t\t\t\tglo->dim[i].page,\n\t\t\t\tpdf_to_num(glo->dim[i].pageref),\n\t\t\t\tpdf_to_gen(glo->dim[i].pageref),\n\t\t\t\tglo->dim[i].u.dim.bbox->x0,\n\t\t\t\tglo->dim[i].u.dim.bbox->y0,\n\t\t\t\tglo->dim[i].u.dim.bbox->x1,\n\t\t\t\tglo->dim[i].u.dim.bbox->y1);\n\t\t}\n\t\tfz_printf(out, \"\\n\");\n\t}\n\n\tif (show & FONTS && glo->fonts > 0)\n\t{\n\t\tfz_printf(out, \"Fonts (%d):\\n\", glo->fonts);\n\t\tfor (i = 0; i < glo->fonts; i++)\n\t\t{\n\t\t\tfz_printf(out, PAGE_FMT \"%s '%s' (%d %d R)\\n\",\n\t\t\t\tglo->font[i].page,\n\t\t\t\tpdf_to_num(glo->font[i].pageref),\n\t\t\t\tpdf_to_gen(glo->font[i].pageref),\n\t\t\t\tpdf_to_name(glo->font[i].u.font.subtype),\n\t\t\t\tpdf_to_name(glo->font[i].u.font.name),\n\t\t\t\tpdf_to_num(glo->font[i].u.font.obj),\n\t\t\t\tpdf_to_gen(glo->font[i].u.font.obj));\n\t\t}\n\t\tfz_printf(out, \"\\n\");\n\t}\n\n\tif (show & IMAGES && glo->images > 0)\n\t{\n\t\tfz_printf(out, \"Images (%d):\\n\", glo->images);\n\t\tfor (i = 0; i < glo->images; i++)\n\t\t{\n\t\t\tchar *cs = NULL;\n\t\t\tchar *altcs = NULL;\n\n\t\t\tfz_printf(out, PAGE_FMT \"[ \",\n\t\t\t\tglo->image[i].page,\n\t\t\t\tpdf_to_num(glo->image[i].pageref),\n\t\t\t\tpdf_to_gen(glo->image[i].pageref));\n\n\t\t\tif (pdf_is_array(glo->image[i].u.image.filter))\n\t\t\t{\n\t\t\t\tint n = pdf_array_len(glo->image[i].u.image.filter);\n\t\t\t\tfor (j = 0; j < n; j++)\n\t\t\t\t{\n\t\t\t\t\tpdf_obj *obj = pdf_array_get(glo->image[i].u.image.filter, j);\n\t\t\t\t\tchar *filter = fz_strdup(glo->ctx, pdf_to_name(obj));\n\n\t\t\t\t\tif (strstr(filter, \"Decode\"))\n\t\t\t\t\t\t*(strstr(filter, \"Decode\")) = '\\0';\n\n\t\t\t\t\tfz_printf(out, \"%s%s\",\n\t\t\t\t\t\tfilter,\n\t\t\t\t\t\tj == pdf_array_len(glo->image[i].u.image.filter) - 1 ? \"\" : \" \");\n\t\t\t\t\tfz_free(glo->ctx, filter);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (glo->image[i].u.image.filter)\n\t\t\t{\n\t\t\t\tpdf_obj *obj = glo->image[i].u.image.filter;\n\t\t\t\tchar *filter = fz_strdup(glo->ctx, pdf_to_name(obj));\n\n\t\t\t\tif (strstr(filter, \"Decode\"))\n\t\t\t\t\t*(strstr(filter, \"Decode\")) = '\\0';\n\n\t\t\t\tfz_printf(out, \"%s\", filter);\n\t\t\t\tfz_free(glo->ctx, filter);\n\t\t\t}\n\t\t\telse\n\t\t\t\tfz_printf(out, \"Raw\");\n\n\t\t\tif (glo->image[i].u.image.cs)\n\t\t\t{\n\t\t\t\tcs = fz_strdup(glo->ctx, pdf_to_name(glo->image[i].u.image.cs));\n\n\t\t\t\tif (!strncmp(cs, \"Device\", 6))\n\t\t\t\t{\n\t\t\t\t\tint len = strlen(cs + 6);\n\t\t\t\t\tmemmove(cs + 3, cs + 6, len + 1);\n\t\t\t\t\tcs[3 + len + 1] = '\\0';\n\t\t\t\t}\n\t\t\t\tif (strstr(cs, \"ICC\"))\n\t\t\t\t\tfz_strlcpy(cs, \"ICC\", 4);\n\t\t\t\tif (strstr(cs, \"Indexed\"))\n\t\t\t\t\tfz_strlcpy(cs, \"Idx\", 4);\n\t\t\t\tif (strstr(cs, \"Pattern\"))\n\t\t\t\t\tfz_strlcpy(cs, \"Pat\", 4);\n\t\t\t\tif (strstr(cs, \"Separation\"))\n\t\t\t\t\tfz_strlcpy(cs, \"Sep\", 4);\n\t\t\t}\n\t\t\tif (glo->image[i].u.image.altcs)\n\t\t\t{\n\t\t\t\taltcs = fz_strdup(glo->ctx, pdf_to_name(glo->image[i].u.image.altcs));\n\n\t\t\t\tif (!strncmp(altcs, \"Device\", 6))\n\t\t\t\t{\n\t\t\t\t\tint len = strlen(altcs + 6);\n\t\t\t\t\tmemmove(altcs + 3, altcs + 6, len + 1);\n\t\t\t\t\taltcs[3 + len + 1] = '\\0';\n\t\t\t\t}\n\t\t\t\tif (strstr(altcs, \"ICC\"))\n\t\t\t\t\tfz_strlcpy(altcs, \"ICC\", 4);\n\t\t\t\tif (strstr(altcs, \"Indexed\"))\n\t\t\t\t\tfz_strlcpy(altcs, \"Idx\", 4);\n\t\t\t\tif (strstr(altcs, \"Pattern\"))\n\t\t\t\t\tfz_strlcpy(altcs, \"Pat\", 4);\n\t\t\t\tif (strstr(altcs, \"Separation\"))\n\t\t\t\t\tfz_strlcpy(altcs, \"Sep\", 4);\n\t\t\t}\n\n\t\t\tfz_printf(out, \" ] %dx%d %dbpc %s%s%s (%d %d R)\\n\",\n\t\t\t\tpdf_to_int(glo->image[i].u.image.width),\n\t\t\t\tpdf_to_int(glo->image[i].u.image.height),\n\t\t\t\tglo->image[i].u.image.bpc ? pdf_to_int(glo->image[i].u.image.bpc) : 1,\n\t\t\t\tglo->image[i].u.image.cs ? cs : \"ImageMask\",\n\t\t\t\tglo->image[i].u.image.altcs ? \" \" : \"\",\n\t\t\t\tglo->image[i].u.image.altcs ? altcs : \"\",\n\t\t\t\tpdf_to_num(glo->image[i].u.image.obj),\n\t\t\t\tpdf_to_gen(glo->image[i].u.image.obj));\n\n\t\t\tfz_free(glo->ctx, cs);\n\t\t\tfz_free(glo->ctx, altcs);\n\t\t}\n\t\tfz_printf(out, \"\\n\");\n\t}\n\n\tif (show & SHADINGS && glo->shadings > 0)\n\t{\n\t\tfz_printf(out, \"Shading patterns (%d):\\n\", glo->shadings);\n\t\tfor (i = 0; i < glo->shadings; i++)\n\t\t{\n\t\t\tchar *shadingtype[] =\n\t\t\t{\n\t\t\t\t\"\",\n\t\t\t\t\"Function\",\n\t\t\t\t\"Axial\",\n\t\t\t\t\"Radial\",\n\t\t\t\t\"Triangle mesh\",\n\t\t\t\t\"Lattice\",\n\t\t\t\t\"Coons patch\",\n\t\t\t\t\"Tensor patch\",\n\t\t\t};\n\n\t\t\tfz_printf(out, PAGE_FMT \"%s (%d %d R)\\n\",\n\t\t\t\tglo->shading[i].page,\n\t\t\t\tpdf_to_num(glo->shading[i].pageref),\n\t\t\t\tpdf_to_gen(glo->shading[i].pageref),\n\t\t\t\tshadingtype[pdf_to_int(glo->shading[i].u.shading.type)],\n\t\t\t\tpdf_to_num(glo->shading[i].u.shading.obj),\n\t\t\t\tpdf_to_gen(glo->shading[i].u.shading.obj));\n\t\t}\n\t\tfz_printf(out, \"\\n\");\n\t}\n\n\tif (show & PATTERNS && glo->patterns > 0)\n\t{\n\t\tfz_printf(out, \"Patterns (%d):\\n\", glo->patterns);\n\t\tfor (i = 0; i < glo->patterns; i++)\n\t\t{\n\t\t\tif (pdf_to_int(glo->pattern[i].u.pattern.type) == 1)\n\t\t\t{\n\t\t\t\tchar *painttype[] =\n\t\t\t\t{\n\t\t\t\t\t\"\",\n\t\t\t\t\t\"Colored\",\n\t\t\t\t\t\"Uncolored\",\n\t\t\t\t};\n\t\t\t\tchar *tilingtype[] =\n\t\t\t\t{\n\t\t\t\t\t\"\",\n\t\t\t\t\t\"Constant\",\n\t\t\t\t\t\"No distortion\",\n\t\t\t\t\t\"Constant/fast tiling\",\n\t\t\t\t};\n\n\t\t\t\tfz_printf(out, PAGE_FMT \"Tiling %s %s (%d %d R)\\n\",\n\t\t\t\t\t\tglo->pattern[i].page,\n\t\t\t\t\t\tpdf_to_num(glo->pattern[i].pageref),\n\t\t\t\t\t\tpdf_to_gen(glo->pattern[i].pageref),\n\t\t\t\t\t\tpainttype[pdf_to_int(glo->pattern[i].u.pattern.paint)],\n\t\t\t\t\t\ttilingtype[pdf_to_int(glo->pattern[i].u.pattern.tiling)],\n\t\t\t\t\t\tpdf_to_num(glo->pattern[i].u.pattern.obj),\n\t\t\t\t\t\tpdf_to_gen(glo->pattern[i].u.pattern.obj));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfz_printf(out, PAGE_FMT \"Shading %d %d R (%d %d R)\\n\",\n\t\t\t\t\t\tglo->pattern[i].page,\n\t\t\t\t\t\tpdf_to_num(glo->pattern[i].pageref),\n\t\t\t\t\t\tpdf_to_gen(glo->pattern[i].pageref),\n\t\t\t\t\t\tpdf_to_num(glo->pattern[i].u.pattern.shading),\n\t\t\t\t\t\tpdf_to_gen(glo->pattern[i].u.pattern.shading),\n\t\t\t\t\t\tpdf_to_num(glo->pattern[i].u.pattern.obj),\n\t\t\t\t\t\tpdf_to_gen(glo->pattern[i].u.pattern.obj));\n\t\t\t}\n\t\t}\n\t\tfz_printf(out, \"\\n\");\n\t}\n\n\tif (show & XOBJS && glo->forms > 0)\n\t{\n\t\tfz_printf(out, \"Form xobjects (%d):\\n\", glo->forms);\n\t\tfor (i = 0; i < glo->forms; i++)\n\t\t{\n\t\t\tfz_printf(out, PAGE_FMT \"Form%s%s%s%s (%d %d R)\\n\",\n\t\t\t\tglo->form[i].page,\n\t\t\t\tpdf_to_num(glo->form[i].pageref),\n\t\t\t\tpdf_to_gen(glo->form[i].pageref),\n\t\t\t\tglo->form[i].u.form.groupsubtype ? \" \" : \"\",\n\t\t\t\tglo->form[i].u.form.groupsubtype ? pdf_to_name(glo->form[i].u.form.groupsubtype) : \"\",\n\t\t\t\tglo->form[i].u.form.groupsubtype ? \" Group\" : \"\",\n\t\t\t\tglo->form[i].u.form.reference ? \" Reference\" : \"\",\n\t\t\t\tpdf_to_num(glo->form[i].u.form.obj),\n\t\t\t\tpdf_to_gen(glo->form[i].u.form.obj));\n\t\t}\n\t\tfz_printf(out, \"\\n\");\n\t}\n\n\tif (show & XOBJS && glo->psobjs > 0)\n\t{\n\t\tfz_printf(out, \"Postscript xobjects (%d):\\n\", glo->psobjs);\n\t\tfor (i = 0; i < glo->psobjs; i++)\n\t\t{\n\t\t\tfz_printf(out, PAGE_FMT \"(%d %d R)\\n\",\n\t\t\t\tglo->psobj[i].page,\n\t\t\t\tpdf_to_num(glo->psobj[i].pageref),\n\t\t\t\tpdf_to_gen(glo->psobj[i].pageref),\n\t\t\t\tpdf_to_num(glo->psobj[i].u.form.obj),\n\t\t\t\tpdf_to_gen(glo->psobj[i].u.form.obj));\n\t\t}\n\t\tfz_printf(out, \"\\n\");\n\t}\n}\n\nstatic void\nshowinfo(globals *glo, char *filename, int show, char *pagelist)\n{\n\tint page, spage, epage;\n\tchar *spec, *dash;\n\tint allpages;\n\tint pagecount;\n\tfz_output *out = glo->out;\n\n\tif (!glo->doc)\n\t\tinfousage();\n\n\tallpages = !strcmp(pagelist, \"1-\");\n\n\tpagecount = pdf_count_pages(glo->doc);\n\tspec = fz_strsep(&pagelist, \",\");\n\twhile (spec && pagecount)\n\t{\n\t\tdash = strchr(spec, '-');\n\n\t\tif (dash == spec)\n\t\t\tspage = epage = pagecount;\n\t\telse\n\t\t\tspage = epage = atoi(spec);\n\n\t\tif (dash)\n\t\t{\n\t\t\tif (strlen(dash) > 1)\n\t\t\t\tepage = atoi(dash + 1);\n\t\t\telse\n\t\t\t\tepage = pagecount;\n\t\t}\n\n\t\tif (spage > epage)\n\t\t\tpage = spage, spage = epage, epage = page;\n\n\t\tspage = fz_clampi(spage, 1, pagecount);\n\t\tepage = fz_clampi(epage, 1, pagecount);\n\n\t\tif (allpages)\n\t\t\tfz_printf(out, \"Retrieving info from pages %d-%d...\\n\", spage, epage);\n\t\tfor (page = spage; page <= epage; page++)\n\t\t{\n\t\t\tgatherpageinfo(glo, page, show);\n\t\t\tif (!allpages)\n\t\t\t{\n\t\t\t\tfz_printf(out, \"Page %d:\\n\", page);\n\t\t\t\tprintinfo(glo, filename, show, page);\n\t\t\t\tfz_printf(out, \"\\n\");\n\t\t\t}\n\t\t}\n\n\t\tspec = fz_strsep(&pagelist, \",\");\n\t}\n\n\tif (allpages)\n\t\tprintinfo(glo, filename, show, -1);\n}\n\nstatic int arg_is_page_range(const char *arg)\n{\n\tint c;\n\n\twhile ((c = *arg++) != 0)\n\t{\n\t\tif ((c < '0' || c > '9') && (c != '-') && (c != ','))\n\t\t\treturn 0;\n\t}\n\treturn 1;\n}\n\nstatic void\npdfinfo_info(fz_context *ctx, fz_output *out, char *filename, char *password, int show, char *argv[], int argc)\n{\n\tenum { NO_FILE_OPENED, NO_INFO_GATHERED, INFO_SHOWN } state;\n\tint argidx = 0;\n\tglobals glo = { 0 };\n\n\tglo.ctx = ctx;\n\tglo.out = out;\n\n\tstate = NO_FILE_OPENED;\n\twhile (argidx < argc)\n\t{\n\t\tif (state == NO_FILE_OPENED || !arg_is_page_range(argv[argidx]))\n\t\t{\n\t\t\tif (state == NO_INFO_GATHERED)\n\t\t\t{\n\t\t\t\tshowinfo(&glo, filename, show, \"1-\");\n\t\t\t}\n\n\t\t\tclosexref(&glo);\n\n\t\t\tfilename = argv[argidx];\n\t\t\tfz_printf(out, \"%s:\\n\", filename);\n\t\t\tglo.doc = pdf_open_document_no_run(glo.ctx, filename);\n\t\t\tif (pdf_needs_password(glo.doc))\n\t\t\t\tif (!pdf_authenticate_password(glo.doc, password))\n\t\t\t\t\tfz_throw(glo.ctx, FZ_ERROR_GENERIC, \"cannot authenticate password: %s\", filename);\n\t\t\tglo.pagecount = pdf_count_pages(glo.doc);\n\n\t\t\tshowglobalinfo(&glo);\n\t\t\tstate = NO_INFO_GATHERED;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshowinfo(&glo, filename, show, argv[argidx]);\n\t\t\tstate = INFO_SHOWN;\n\t\t}\n\n\t\targidx++;\n\t}\n\n\tif (state == NO_INFO_GATHERED)\n\t\tshowinfo(&glo, filename, show, \"1-\");\n\n\tclosexref(&glo);\n}\n\nint pdfinfo_main(int argc, char **argv)\n{\n\tchar *filename = \"\";\n\tchar *password = \"\";\n\tint show = ALL;\n\tint c;\n\tfz_output *out = NULL;\n\tint ret;\n\tfz_context *ctx;\n\n\twhile ((c = fz_getopt(argc, argv, \"mfispxd:\")) != -1)\n\t{\n\t\tswitch (c)\n\t\t{\n\t\tcase 'm': if (show == ALL) show = DIMENSIONS; else show |= DIMENSIONS; break;\n\t\tcase 'f': if (show == ALL) show = FONTS; else show |= FONTS; break;\n\t\tcase 'i': if (show == ALL) show = IMAGES; else show |= IMAGES; break;\n\t\tcase 's': if (show == ALL) show = SHADINGS; else show |= SHADINGS; break;\n\t\tcase 'p': if (show == ALL) show = PATTERNS; else show |= PATTERNS; break;\n\t\tcase 'x': if (show == ALL) show = XOBJS; else show |= XOBJS; break;\n\t\tcase 'd': password = fz_optarg; break;\n\t\tdefault:\n\t\t\tinfousage();\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (fz_optind == argc)\n\t\tinfousage();\n\n\tctx = fz_new_context(NULL, NULL, FZ_STORE_UNLIMITED);\n\tif (!ctx)\n\t{\n\t\tfprintf(stderr, \"cannot initialise context\\n\");\n\t\texit(1);\n\t}\n\n\tfz_var(out);\n\n\tret = 0;\n\tfz_try(ctx)\n\t{\n\t\tout = fz_new_output_with_file(ctx, stdout);\n\t\tpdfinfo_info(ctx, out, filename, password, show, &argv[fz_optind], argc-fz_optind);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tret = 1;\n\t}\n\tfz_close_output(out);\n\tfz_free_context(ctx);\n\treturn ret;\n}\n"
  },
  {
    "path": "mupdf/source/tools/pdfposter.c",
    "content": "/*\n * PDF posteriser; split pages within a PDF file into smaller lumps.\n */\n\n#include \"mupdf/pdf.h\"\n\nstatic int x_factor = 0;\nstatic int y_factor = 0;\n\nstatic void usage(void)\n{\n\tfprintf(stderr,\n\t\t\"usage: mutool poster [options] input.pdf [output.pdf]\\n\"\n\t\t\"\\t-p -\\tpassword\\n\"\n\t\t\"\\t-x\\tx decimation factor\\n\"\n\t\t\"\\t-y\\ty decimation factor\\n\");\n\texit(1);\n}\n\n/*\n * Recreate page tree with our posterised pages in.\n */\n\nstatic void decimatepages(pdf_document *doc)\n{\n\tpdf_obj *oldroot, *root, *pages, *kids, *parent;\n\tint num_pages = pdf_count_pages(doc);\n\tint page, kidcount;\n\n\toldroot = pdf_dict_gets(pdf_trailer(doc), \"Root\");\n\tpages = pdf_dict_gets(oldroot, \"Pages\");\n\n\troot = pdf_new_dict(doc, 2);\n\tpdf_dict_puts(root, \"Type\", pdf_dict_gets(oldroot, \"Type\"));\n\tpdf_dict_puts(root, \"Pages\", pdf_dict_gets(oldroot, \"Pages\"));\n\n\tpdf_update_object(doc, pdf_to_num(oldroot), root);\n\n\tpdf_drop_obj(root);\n\n\t/* Create a new kids array with our new pages in */\n\tparent = pdf_new_indirect(doc, pdf_to_num(pages), pdf_to_gen(pages));\n\tkids = pdf_new_array(doc, 1);\n\n\tkidcount = 0;\n\tfor (page=0; page < num_pages; page++)\n\t{\n\t\tpdf_page *page_details = pdf_load_page(doc, page);\n\t\tint xf = x_factor, yf = y_factor;\n\t\tint x, y;\n\t\tfloat w = page_details->mediabox.x1 - page_details->mediabox.x0;\n\t\tfloat h = page_details->mediabox.y1 - page_details->mediabox.y0;\n\n\t\tif (xf == 0 && yf == 0)\n\t\t{\n\t\t\t/* Nothing specified, so split along the long edge */\n\t\t\tif (w > h)\n\t\t\t\txf = 2, yf = 1;\n\t\t\telse\n\t\t\t\txf = 1, yf = 2;\n\t\t}\n\t\telse if (xf == 0)\n\t\t\txf = 1;\n\t\telse if (yf == 0)\n\t\t\tyf = 1;\n\n\t\tfor (y = yf-1; y >= 0; y--)\n\t\t{\n\t\t\tfor (x = 0; x < xf; x++)\n\t\t\t{\n\t\t\t\tpdf_obj *newpageobj, *newpageref, *newmediabox;\n\t\t\t\tfz_rect mb;\n\t\t\t\tint num;\n\n\t\t\t\tnewpageobj = pdf_copy_dict(pdf_lookup_page_obj(doc, page));\n\t\t\t\tnum = pdf_create_object(doc);\n\t\t\t\tpdf_update_object(doc, num, newpageobj);\n\t\t\t\tnewpageref = pdf_new_indirect(doc, num, 0);\n\n\t\t\t\tnewmediabox = pdf_new_array(doc, 4);\n\n\t\t\t\tmb.x0 = page_details->mediabox.x0 + (w/xf)*x;\n\t\t\t\tif (x == xf-1)\n\t\t\t\t\tmb.x1 = page_details->mediabox.x1;\n\t\t\t\telse\n\t\t\t\t\tmb.x1 = page_details->mediabox.x0 + (w/xf)*(x+1);\n\t\t\t\tmb.y0 = page_details->mediabox.y0 + (h/yf)*y;\n\t\t\t\tif (y == yf-1)\n\t\t\t\t\tmb.y1 = page_details->mediabox.y1;\n\t\t\t\telse\n\t\t\t\t\tmb.y1 = page_details->mediabox.y0 + (h/yf)*(y+1);\n\n\t\t\t\tpdf_array_push(newmediabox, pdf_new_real(doc, mb.x0));\n\t\t\t\tpdf_array_push(newmediabox, pdf_new_real(doc, mb.y0));\n\t\t\t\tpdf_array_push(newmediabox, pdf_new_real(doc, mb.x1));\n\t\t\t\tpdf_array_push(newmediabox, pdf_new_real(doc, mb.y1));\n\n\t\t\t\tpdf_dict_puts(newpageobj, \"Parent\", parent);\n\t\t\t\tpdf_dict_puts(newpageobj, \"MediaBox\", newmediabox);\n\n\t\t\t\t/* Store page object in new kids array */\n\t\t\t\tpdf_array_push(kids, newpageref);\n\n\t\t\t\tkidcount++;\n\t\t\t}\n\t\t}\n\t}\n\n\tpdf_drop_obj(parent);\n\n\t/* Update page count and kids array */\n\tpdf_dict_puts(pages, \"Count\", pdf_new_int(doc, kidcount));\n\tpdf_dict_puts(pages, \"Kids\", kids);\n\tpdf_drop_obj(kids);\n}\n\nint pdfposter_main(int argc, char **argv)\n{\n\tchar *infile;\n\tchar *outfile = \"out.pdf\";\n\tchar *password = \"\";\n\tint c;\n\tfz_write_options opts = { 0 };\n\tpdf_document *doc;\n\tfz_context *ctx;\n\n\topts.do_incremental = 0;\n\topts.do_garbage = 0;\n\topts.do_expand = 0;\n\topts.do_ascii = 0;\n\topts.do_linear = 0;\n\n\twhile ((c = fz_getopt(argc, argv, \"x:y:\")) != -1)\n\t{\n\t\tswitch (c)\n\t\t{\n\t\tcase 'p': password = fz_optarg; break;\n\t\tcase 'x': x_factor = atoi(fz_optarg); break;\n\t\tcase 'y': y_factor = atoi(fz_optarg); break;\n\t\tdefault: usage(); break;\n\t\t}\n\t}\n\n\tif (argc - fz_optind < 1)\n\t\tusage();\n\n\tinfile = argv[fz_optind++];\n\n\tif (argc - fz_optind > 0 &&\n\t\t(strstr(argv[fz_optind], \".pdf\") || strstr(argv[fz_optind], \".PDF\")))\n\t{\n\t\toutfile = argv[fz_optind++];\n\t}\n\n\tctx = fz_new_context(NULL, NULL, FZ_STORE_UNLIMITED);\n\tif (!ctx)\n\t{\n\t\tfprintf(stderr, \"cannot initialise context\\n\");\n\t\texit(1);\n\t}\n\n\tdoc = pdf_open_document_no_run(ctx, infile);\n\tif (pdf_needs_password(doc))\n\t\tif (!pdf_authenticate_password(doc, password))\n\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot authenticate password: %s\", infile);\n\n\tdecimatepages(doc);\n\n\tpdf_write_document(doc, outfile, &opts);\n\n\tpdf_close_document(doc);\n\tfz_free_context(ctx);\n\treturn 0;\n}\n"
  },
  {
    "path": "mupdf/source/tools/pdfshow.c",
    "content": "/*\n * pdfshow -- the ultimate pdf debugging tool\n */\n\n#include \"mupdf/pdf.h\"\n\nstatic FILE *out = NULL;\n\nstatic pdf_document *doc = NULL;\nstatic fz_context *ctx = NULL;\nstatic int showbinary = 0;\nstatic int showdecode = 1;\nstatic int showcolumn;\n\nstatic void usage(void)\n{\n\tfprintf(stderr, \"usage: mutool show [options] file.pdf [grep] [xref] [trailer] [pages] [object numbers]\\n\");\n\tfprintf(stderr, \"\\t-b\\tprint streams as binary data\\n\");\n\tfprintf(stderr, \"\\t-e\\tprint encoded streams (don't decode)\\n\");\n\tfprintf(stderr, \"\\t-p\\tpassword\\n\");\n\tfprintf(stderr, \"\\t-o\\toutput file\\n\");\n\texit(1);\n}\n\nstatic void showtrailer(void)\n{\n\tif (!doc)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"no file specified\");\n\tfprintf(out, \"trailer\\n\");\n\tpdf_fprint_obj(out, pdf_trailer(doc), 0);\n\tfprintf(out, \"\\n\");\n}\n\nstatic void showencrypt(void)\n{\n\tpdf_obj *encrypt;\n\n\tif (!doc)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"no file specified\");\n\tencrypt = pdf_dict_gets(pdf_trailer(doc), \"Encrypt\");\n\tif (!encrypt)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"document not encrypted\");\n\tfprintf(out, \"encryption dictionary\\n\");\n\tpdf_fprint_obj(out, pdf_resolve_indirect(encrypt), 0);\n\tfprintf(out, \"\\n\");\n}\n\nstatic void showxref(void)\n{\n\tif (!doc)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"no file specified\");\n\tpdf_print_xref(doc);\n\tfprintf(out, \"\\n\");\n}\n\nstatic void showpagetree(void)\n{\n\tpdf_obj *ref;\n\tint count;\n\tint i;\n\n\tif (!doc)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"no file specified\");\n\n\tcount = pdf_count_pages(doc);\n\tfor (i = 0; i < count; i++)\n\t{\n\t\tref = pdf_lookup_page_obj(doc, i);\n\t\tfprintf(out, \"page %d = %d %d R\\n\", i + 1, pdf_to_num(ref), pdf_to_gen(ref));\n\t}\n\tfprintf(out, \"\\n\");\n}\n\nstatic void showsafe(unsigned char *buf, int n)\n{\n\tint i;\n\tfor (i = 0; i < n; i++) {\n\t\tif (buf[i] == '\\r' || buf[i] == '\\n') {\n\t\t\tputchar('\\n');\n\t\t\tshowcolumn = 0;\n\t\t}\n\t\telse if (buf[i] < 32 || buf[i] > 126) {\n\t\t\tputchar('.');\n\t\t\tshowcolumn ++;\n\t\t}\n\t\telse {\n\t\t\tputchar(buf[i]);\n\t\t\tshowcolumn ++;\n\t\t}\n\t\tif (showcolumn == 79) {\n\t\t\tputchar('\\n');\n\t\t\tshowcolumn = 0;\n\t\t}\n\t}\n}\n\nstatic void showstream(int num, int gen)\n{\n\tfz_stream *stm;\n\tunsigned char buf[2048];\n\tint n;\n\n\tshowcolumn = 0;\n\n\tif (showdecode)\n\t\tstm = pdf_open_stream(doc, num, gen);\n\telse\n\t\tstm = pdf_open_raw_stream(doc, num, gen);\n\n\twhile (1)\n\t{\n\t\tn = fz_read(stm, buf, sizeof buf);\n\t\tif (n == 0)\n\t\t\tbreak;\n\t\tif (showbinary)\n\t\t\tfwrite(buf, 1, n, out);\n\t\telse\n\t\t\tshowsafe(buf, n);\n\t}\n\n\tfz_close(stm);\n}\n\nstatic void showobject(int num, int gen)\n{\n\tpdf_obj *obj;\n\n\tif (!doc)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"no file specified\");\n\n\tobj = pdf_load_object(doc, num, gen);\n\n\tif (pdf_is_stream(doc, num, gen))\n\t{\n\t\tif (showbinary)\n\t\t{\n\t\t\tshowstream(num, gen);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfprintf(out, \"%d %d obj\\n\", num, gen);\n\t\t\tpdf_fprint_obj(out, obj, 0);\n\t\t\tfprintf(out, \"stream\\n\");\n\t\t\tshowstream(num, gen);\n\t\t\tfprintf(out, \"endstream\\n\");\n\t\t\tfprintf(out, \"endobj\\n\\n\");\n\t\t}\n\t}\n\telse\n\t{\n\t\tfprintf(out, \"%d %d obj\\n\", num, gen);\n\t\tpdf_fprint_obj(out, obj, 0);\n\t\tfprintf(out, \"endobj\\n\\n\");\n\t}\n\n\tpdf_drop_obj(obj);\n}\n\nstatic void showgrep(char *filename)\n{\n\tpdf_obj *obj;\n\tint i, len;\n\n\tlen = pdf_count_objects(doc);\n\tfor (i = 0; i < len; i++)\n\t{\n\t\tpdf_xref_entry *entry = pdf_get_xref_entry(doc, i);\n\t\tif (entry->type == 'n' || entry->type == 'o')\n\t\t{\n\t\t\tfz_try(ctx)\n\t\t\t{\n\t\t\t\tobj = pdf_load_object(doc, i, 0);\n\t\t\t}\n\t\t\tfz_catch(ctx)\n\t\t\t{\n\t\t\t\tfz_warn(ctx, \"skipping object (%d 0 R)\", i);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tpdf_sort_dict(obj);\n\n\t\t\tfprintf(out, \"%s:%d: \", filename, i);\n\t\t\tpdf_fprint_obj(out, obj, 1);\n\n\t\t\tpdf_drop_obj(obj);\n\t\t}\n\t}\n\n\tfprintf(out, \"%s:trailer: \", filename);\n\tpdf_fprint_obj(out, pdf_trailer(doc), 1);\n}\n\nint pdfshow_main(int argc, char **argv)\n{\n\tchar *password = NULL; /* don't throw errors if encrypted */\n\tchar *filename = NULL;\n\tchar *output = NULL;\n\tint c;\n\n\twhile ((c = fz_getopt(argc, argv, \"p:o:be\")) != -1)\n\t{\n\t\tswitch (c)\n\t\t{\n\t\tcase 'p': password = fz_optarg; break;\n\t\tcase 'b': showbinary = 1; break;\n\t\tcase 'e': showdecode = 0; break;\n\t\tcase 'o': output = fz_optarg; break;\n\t\tdefault: usage(); break;\n\t\t}\n\t}\n\n\tif (fz_optind == argc)\n\t\tusage();\n\n\tfilename = argv[fz_optind++];\n\n\tout = stdout;\n\tif (output)\n\t{\n\t\tout = fopen(output, \"wb\");\n\t\tif (!out)\n\t\t{\n\t\t\tfprintf(stderr, \"cannot open output file: '%s'\\n\", output);\n\t\t\texit(1);\n\t\t}\n\t}\n\n\tctx = fz_new_context(NULL, NULL, FZ_STORE_UNLIMITED);\n\tif (!ctx)\n\t{\n\t\tfprintf(stderr, \"cannot initialise context\\n\");\n\t\texit(1);\n\t}\n\n\tfz_var(doc);\n\tfz_try(ctx)\n\t{\n\t\tdoc = pdf_open_document_no_run(ctx, filename);\n\t\tif (pdf_needs_password(doc))\n\t\t\tif (!pdf_authenticate_password(doc, password))\n\t\t\t\tfz_warn(ctx, \"cannot authenticate password: %s\", filename);\n\n\t\tif (fz_optind == argc)\n\t\t\tshowtrailer();\n\n\t\twhile (fz_optind < argc)\n\t\t{\n\t\t\tswitch (argv[fz_optind][0])\n\t\t\t{\n\t\t\tcase 't': showtrailer(); break;\n\t\t\tcase 'e': showencrypt(); break;\n\t\t\tcase 'x': showxref(); break;\n\t\t\tcase 'p': showpagetree(); break;\n\t\t\tcase 'g': showgrep(filename); break;\n\t\t\tdefault: showobject(atoi(argv[fz_optind]), 0); break;\n\t\t\t}\n\t\t\tfz_optind++;\n\t\t}\n\t}\n\tfz_catch(ctx)\n\t{\n\t}\n\n\tif (out != stdout)\n\t\tfclose(out);\n\n\tpdf_close_document(doc);\n\tfz_free_context(ctx);\n\treturn 0;\n}\n"
  },
  {
    "path": "mupdf/source/xps/xps-common.c",
    "content": "#include \"mupdf/xps.h\"\n\nstatic inline int unhex(int a)\n{\n\tif (a >= 'A' && a <= 'F') return a - 'A' + 0xA;\n\tif (a >= 'a' && a <= 'f') return a - 'a' + 0xA;\n\tif (a >= '0' && a <= '9') return a - '0';\n\treturn 0;\n}\n\nfz_xml *\nxps_lookup_alternate_content(fz_xml *node)\n{\n\tfor (node = fz_xml_down(node); node; node = fz_xml_next(node))\n\t{\n\t\tif (fz_xml_is_tag(node, \"Choice\") && fz_xml_att(node, \"Requires\"))\n\t\t{\n\t\t\tchar list[64];\n\t\t\tchar *next = list, *item;\n\t\t\tfz_strlcpy(list, fz_xml_att(node, \"Requires\"), sizeof(list));\n\t\t\twhile ((item = fz_strsep(&next, \" \\t\\r\\n\")) != NULL && (!*item || !strcmp(item, \"xps\")));\n\t\t\tif (!item)\n\t\t\t\treturn fz_xml_down(node);\n\t\t}\n\t\telse if (fz_xml_is_tag(node, \"Fallback\"))\n\t\t\treturn fz_xml_down(node);\n\t}\n\treturn NULL;\n}\n\nvoid\nxps_parse_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, char *base_uri, xps_resource *dict, fz_xml *node)\n{\n\tif (doc->cookie && doc->cookie->abort)\n\t\treturn;\n\t/* SolidColorBrushes are handled in a special case and will never show up here */\n\tif (fz_xml_is_tag(node, \"ImageBrush\"))\n\t\txps_parse_image_brush(doc, ctm, area, base_uri, dict, node);\n\telse if (fz_xml_is_tag(node, \"VisualBrush\"))\n\t\txps_parse_visual_brush(doc, ctm, area, base_uri, dict, node);\n\telse if (fz_xml_is_tag(node, \"LinearGradientBrush\"))\n\t\txps_parse_linear_gradient_brush(doc, ctm, area, base_uri, dict, node);\n\telse if (fz_xml_is_tag(node, \"RadialGradientBrush\"))\n\t\txps_parse_radial_gradient_brush(doc, ctm, area, base_uri, dict, node);\n\telse\n\t\tfz_warn(doc->ctx, \"unknown brush tag: %s\", fz_xml_tag(node));\n}\n\nvoid\nxps_parse_element(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, char *base_uri, xps_resource *dict, fz_xml *node)\n{\n\tif (doc->cookie && doc->cookie->abort)\n\t\treturn;\n\tif (fz_xml_is_tag(node, \"Path\"))\n\t\txps_parse_path(doc, ctm, base_uri, dict, node);\n\tif (fz_xml_is_tag(node, \"Glyphs\"))\n\t\txps_parse_glyphs(doc, ctm, base_uri, dict, node);\n\tif (fz_xml_is_tag(node, \"Canvas\"))\n\t\txps_parse_canvas(doc, ctm, area, base_uri, dict, node);\n\tif (fz_xml_is_tag(node, \"AlternateContent\"))\n\t{\n\t\tnode = xps_lookup_alternate_content(node);\n\t\tif (node)\n\t\t\txps_parse_element(doc, ctm, area, base_uri, dict, node);\n\t}\n\t/* skip unknown tags (like Foo.Resources and similar) */\n}\n\nvoid\nxps_begin_opacity(xps_document *doc, const fz_matrix *ctm, const fz_rect *area,\n\tchar *base_uri, xps_resource *dict,\n\tchar *opacity_att, fz_xml *opacity_mask_tag)\n{\n\tfloat opacity;\n\n\tif (!opacity_att && !opacity_mask_tag)\n\t\treturn;\n\n\topacity = 1;\n\tif (opacity_att)\n\t\topacity = fz_atof(opacity_att);\n\n\tif (opacity_mask_tag && !strcmp(fz_xml_tag(opacity_mask_tag), \"SolidColorBrush\"))\n\t{\n\t\tchar *scb_opacity_att = fz_xml_att(opacity_mask_tag, \"Opacity\");\n\t\tchar *scb_color_att = fz_xml_att(opacity_mask_tag, \"Color\");\n\t\tif (scb_opacity_att)\n\t\t\topacity = opacity * fz_atof(scb_opacity_att);\n\t\tif (scb_color_att)\n\t\t{\n\t\t\tfz_colorspace *colorspace;\n\t\t\tfloat samples[FZ_MAX_COLORS];\n\t\t\txps_parse_color(doc, base_uri, scb_color_att, &colorspace, samples);\n\t\t\topacity = opacity * samples[0];\n\t\t}\n\t\topacity_mask_tag = NULL;\n\t}\n\n\tif (doc->opacity_top + 1 < nelem(doc->opacity))\n\t{\n\t\tdoc->opacity[doc->opacity_top + 1] = doc->opacity[doc->opacity_top] * opacity;\n\t\tdoc->opacity_top++;\n\t}\n\n\tif (opacity_mask_tag)\n\t{\n\t\tfz_begin_mask(doc->dev, area, 0, NULL, NULL);\n\t\txps_parse_brush(doc, ctm, area, base_uri, dict, opacity_mask_tag);\n\t\tfz_end_mask(doc->dev);\n\t}\n}\n\nvoid\nxps_end_opacity(xps_document *doc, char *base_uri, xps_resource *dict,\n\tchar *opacity_att, fz_xml *opacity_mask_tag)\n{\n\tif (!opacity_att && !opacity_mask_tag)\n\t\treturn;\n\n\tif (doc->opacity_top > 0)\n\t\tdoc->opacity_top--;\n\n\tif (opacity_mask_tag)\n\t{\n\t\tif (strcmp(fz_xml_tag(opacity_mask_tag), \"SolidColorBrush\"))\n\t\t\tfz_pop_clip(doc->dev);\n\t}\n}\n\nvoid\nxps_parse_render_transform(xps_document *doc, char *transform, fz_matrix *matrix)\n{\n\tfloat args[6];\n\tchar *s = transform;\n\tint i;\n\n\targs[0] = 1; args[1] = 0;\n\targs[2] = 0; args[3] = 1;\n\targs[4] = 0; args[5] = 0;\n\n\tfor (i = 0; i < 6 && *s; i++)\n\t{\n\t\targs[i] = fz_atof(s);\n\t\twhile (*s && *s != ',')\n\t\t\ts++;\n\t\tif (*s == ',')\n\t\t\ts++;\n\t}\n\n\tmatrix->a = args[0]; matrix->b = args[1];\n\tmatrix->c = args[2]; matrix->d = args[3];\n\tmatrix->e = args[4]; matrix->f = args[5];\n}\n\nvoid\nxps_parse_matrix_transform(xps_document *doc, fz_xml *root, fz_matrix *matrix)\n{\n\tchar *transform;\n\n\t*matrix = fz_identity;\n\n\tif (fz_xml_is_tag(root, \"MatrixTransform\"))\n\t{\n\t\ttransform = fz_xml_att(root, \"Matrix\");\n\t\tif (transform)\n\t\t\txps_parse_render_transform(doc, transform, matrix);\n\t}\n}\n\nvoid\nxps_parse_rectangle(xps_document *doc, char *text, fz_rect *rect)\n{\n\tfloat args[4];\n\tchar *s = text;\n\tint i;\n\n\targs[0] = 0; args[1] = 0;\n\targs[2] = 1; args[3] = 1;\n\n\tfor (i = 0; i < 4 && *s; i++)\n\t{\n\t\targs[i] = fz_atof(s);\n\t\twhile (*s && *s != ',')\n\t\t\ts++;\n\t\tif (*s == ',')\n\t\t\ts++;\n\t}\n\n\trect->x0 = args[0];\n\trect->y0 = args[1];\n\trect->x1 = args[0] + args[2];\n\trect->y1 = args[1] + args[3];\n}\n\nstatic int count_commas(char *s)\n{\n\tint n = 0;\n\twhile (*s)\n\t{\n\t\tif (*s == ',')\n\t\t\tn ++;\n\t\ts ++;\n\t}\n\treturn n;\n}\n\nvoid\nxps_parse_color(xps_document *doc, char *base_uri, char *string,\n\t\tfz_colorspace **csp, float *samples)\n{\n\tfz_context *ctx = doc->ctx;\n\tchar *p;\n\tint i, n;\n\tchar buf[1024];\n\tchar *profile;\n\n\t*csp = fz_device_rgb(ctx);\n\n\tsamples[0] = 1;\n\tsamples[1] = 0;\n\tsamples[2] = 0;\n\tsamples[3] = 0;\n\n\tif (string[0] == '#')\n\t{\n\t\tif (strlen(string) == 9)\n\t\t{\n\t\t\tsamples[0] = unhex(string[1]) * 16 + unhex(string[2]);\n\t\t\tsamples[1] = unhex(string[3]) * 16 + unhex(string[4]);\n\t\t\tsamples[2] = unhex(string[5]) * 16 + unhex(string[6]);\n\t\t\tsamples[3] = unhex(string[7]) * 16 + unhex(string[8]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsamples[0] = 255;\n\t\t\tsamples[1] = unhex(string[1]) * 16 + unhex(string[2]);\n\t\t\tsamples[2] = unhex(string[3]) * 16 + unhex(string[4]);\n\t\t\tsamples[3] = unhex(string[5]) * 16 + unhex(string[6]);\n\t\t}\n\n\t\tsamples[0] /= 255;\n\t\tsamples[1] /= 255;\n\t\tsamples[2] /= 255;\n\t\tsamples[3] /= 255;\n\t}\n\n\telse if (string[0] == 's' && string[1] == 'c' && string[2] == '#')\n\t{\n\t\tif (count_commas(string) == 2)\n\t\t\tsscanf(string, \"sc#%g,%g,%g\", samples + 1, samples + 2, samples + 3);\n\t\tif (count_commas(string) == 3)\n\t\t\tsscanf(string, \"sc#%g,%g,%g,%g\", samples, samples + 1, samples + 2, samples + 3);\n\t}\n\n\telse if (strstr(string, \"ContextColor \") == string)\n\t{\n\t\t/* Crack the string for profile name and sample values */\n\t\tfz_strlcpy(buf, string, sizeof buf);\n\n\t\tprofile = strchr(buf, ' ');\n\t\tif (!profile)\n\t\t{\n\t\t\tfz_warn(ctx, \"cannot find icc profile uri in '%s'\", string);\n\t\t\treturn;\n\t\t}\n\n\t\t*profile++ = 0;\n\t\tp = strchr(profile, ' ');\n\t\tif (!p)\n\t\t{\n\t\t\tfz_warn(ctx, \"cannot find component values in '%s'\", profile);\n\t\t\treturn;\n\t\t}\n\n\t\t*p++ = 0;\n\t\tn = count_commas(p) + 1;\n\t\tif (n > FZ_MAX_COLORS)\n\t\t{\n\t\t\tfz_warn(ctx, \"ignoring %d color components (max %d allowed)\", n - FZ_MAX_COLORS, FZ_MAX_COLORS);\n\t\t\tn = FZ_MAX_COLORS;\n\t\t}\n\t\ti = 0;\n\t\twhile (i < n)\n\t\t{\n\t\t\tsamples[i++] = fz_atof(p);\n\t\t\tp = strchr(p, ',');\n\t\t\tif (!p)\n\t\t\t\tbreak;\n\t\t\tp ++;\n\t\t\tif (*p == ' ')\n\t\t\t\tp ++;\n\t\t}\n\t\twhile (i < n)\n\t\t{\n\t\t\tsamples[i++] = 0;\n\t\t}\n\n\t\t/* TODO: load ICC profile */\n\t\tswitch (n)\n\t\t{\n\t\tcase 2: *csp = fz_device_gray(ctx); break;\n\t\tcase 4: *csp = fz_device_rgb(ctx); break;\n\t\tcase 5: *csp = fz_device_cmyk(ctx); break;\n\t\tdefault: *csp = fz_device_gray(ctx); break;\n\t\t}\n\t}\n}\n\nvoid\nxps_set_color(xps_document *doc, fz_colorspace *colorspace, float *samples)\n{\n\tint i;\n\tdoc->colorspace = colorspace;\n\tfor (i = 0; i < colorspace->n; i++)\n\t\tdoc->color[i] = samples[i + 1];\n\tdoc->alpha = samples[0] * doc->opacity[doc->opacity_top];\n}\n"
  },
  {
    "path": "mupdf/source/xps/xps-doc.c",
    "content": "#include \"mupdf/xps.h\"\n\n#define REL_START_PART \\\n\t\"http://schemas.microsoft.com/xps/2005/06/fixedrepresentation\"\n#define REL_DOC_STRUCTURE \\\n\t\"http://schemas.microsoft.com/xps/2005/06/documentstructure\"\n#define REL_REQUIRED_RESOURCE \\\n\t\"http://schemas.microsoft.com/xps/2005/06/required-resource\"\n#define REL_REQUIRED_RESOURCE_RECURSIVE \\\n\t\"http://schemas.microsoft.com/xps/2005/06/required-resource#recursive\"\n\n#define REL_START_PART_OXPS \\\n\t\"http://schemas.openxps.org/oxps/v1.0/fixedrepresentation\"\n#define REL_DOC_STRUCTURE_OXPS \\\n\t\"http://schemas.openxps.org/oxps/v1.0/documentstructure\"\n\nstatic void\nxps_rels_for_part(char *buf, char *name, int buflen)\n{\n\tchar *p, *basename;\n\tp = strrchr(name, '/');\n\tbasename = p ? p + 1 : name;\n\tfz_strlcpy(buf, name, buflen);\n\tp = strrchr(buf, '/');\n\tif (p) *p = 0;\n\tfz_strlcat(buf, \"/_rels/\", buflen);\n\tfz_strlcat(buf, basename, buflen);\n\tfz_strlcat(buf, \".rels\", buflen);\n}\n\n/*\n * The FixedDocumentSequence and FixedDocument parts determine\n * which parts correspond to actual pages, and the page order.\n */\n\nvoid\nxps_print_page_list(xps_document *doc)\n{\n\txps_fixdoc *fixdoc = doc->first_fixdoc;\n\txps_page *page = doc->first_page;\n\n\tif (doc->start_part)\n\t\tprintf(\"start part %s\\n\", doc->start_part);\n\n\twhile (fixdoc)\n\t{\n\t\tprintf(\"fixdoc %s\\n\", fixdoc->name);\n\t\tfixdoc = fixdoc->next;\n\t}\n\n\twhile (page)\n\t{\n\t\tprintf(\"page[%d] %s w=%d h=%d\\n\", page->number, page->name, page->width, page->height);\n\t\tpage = page->next;\n\t}\n}\n\nstatic void\nxps_add_fixed_document(xps_document *doc, char *name)\n{\n\txps_fixdoc *fixdoc;\n\n\t/* Check for duplicates first */\n\tfor (fixdoc = doc->first_fixdoc; fixdoc; fixdoc = fixdoc->next)\n\t\tif (!strcmp(fixdoc->name, name))\n\t\t\treturn;\n\n\tfixdoc = fz_malloc_struct(doc->ctx, xps_fixdoc);\n\tfixdoc->name = fz_strdup(doc->ctx, name);\n\tfixdoc->outline = NULL;\n\tfixdoc->next = NULL;\n\n\tif (!doc->first_fixdoc)\n\t{\n\t\tdoc->first_fixdoc = fixdoc;\n\t\tdoc->last_fixdoc = fixdoc;\n\t}\n\telse\n\t{\n\t\tdoc->last_fixdoc->next = fixdoc;\n\t\tdoc->last_fixdoc = fixdoc;\n\t}\n}\n\nvoid\nxps_add_link(xps_document *doc, const fz_rect *area, char *base_uri, char *target_uri)\n{\n\tint len;\n\tchar *buffer = NULL;\n\tchar *uri;\n\txps_target *target;\n\tfz_link_dest dest;\n\tfz_link *link;\n\tfz_context *ctx = doc->ctx;\n\n\tfz_var(buffer);\n\n\tif (doc->current_page == NULL || doc->current_page->links_resolved)\n\t\treturn;\n\n\tfz_try(ctx)\n\t{\n\t\tlen = 2 + (base_uri ? strlen(base_uri) : 0) +\n\t\t\t(target_uri ? strlen(target_uri) : 0);\n\t\tbuffer = fz_malloc(doc->ctx, len);\n\t\txps_resolve_url(buffer, base_uri, target_uri, len);\n\t\tif (xps_url_is_remote(buffer))\n\t\t{\n\t\t\tdest.kind = FZ_LINK_URI;\n\t\t\tdest.ld.uri.is_map = 0;\n\t\t\tdest.ld.uri.uri = buffer;\n\t\t\tbuffer = NULL;\n\t\t}\n\t\telse\n\t\t{\n\t\t\turi = buffer;\n\n\t\t\t/* FIXME: This won't work for remote docs */\n\t\t\t/* Skip until we find the fragment marker */\n\t\t\twhile (*uri && *uri != '#')\n\t\t\t\turi++;\n\t\t\tif (*uri == '#')\n\t\t\t\turi++;\n\n\t\t\tfor (target = doc->target; target; target = target->next)\n\t\t\t\tif (!strcmp(target->name, uri))\n\t\t\t\t\tbreak;\n\n\t\t\tif (target == NULL)\n\t\t\t\tbreak;\n\n\t\t\tdest.kind = FZ_LINK_GOTO;\n\t\t\tdest.ld.gotor.flags = 0;\n\t\t\tdest.ld.gotor.lt.x = 0;\n\t\t\tdest.ld.gotor.lt.y = 0;\n\t\t\tdest.ld.gotor.rb.x = 0;\n\t\t\tdest.ld.gotor.rb.y = 0;\n\t\t\tdest.ld.gotor.page = target->page;\n\t\t\tdest.ld.gotor.file_spec = NULL;\n\t\t\tdest.ld.gotor.new_window = 0;\n\t\t}\n\n\t\tlink = fz_new_link(doc->ctx, area, dest);\n\t\tlink->next = doc->current_page->links;\n\t\tdoc->current_page->links = link;\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_free(doc->ctx, buffer);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nfz_link *\nxps_load_links(xps_document *doc, xps_page *page)\n{\n\tif (!page->links_resolved)\n\t\tfz_warn(doc->ctx, \"xps_load_links before page has been executed!\");\n\treturn fz_keep_link(doc->ctx, page->links);\n}\n\nstatic void\nxps_add_fixed_page(xps_document *doc, char *name, int width, int height)\n{\n\txps_page *page;\n\n\t/* Check for duplicates first */\n\tfor (page = doc->first_page; page; page = page->next)\n\t\tif (!strcmp(page->name, name))\n\t\t\treturn;\n\n\tpage = fz_malloc_struct(doc->ctx, xps_page);\n\tpage->name = fz_strdup(doc->ctx, name);\n\tpage->number = doc->page_count++;\n\tpage->width = width;\n\tpage->height = height;\n\tpage->links = NULL;\n\tpage->links_resolved = 0;\n\tpage->root = NULL;\n\tpage->next = NULL;\n\n\tif (!doc->first_page)\n\t{\n\t\tdoc->first_page = page;\n\t\tdoc->last_page = page;\n\t}\n\telse\n\t{\n\t\tdoc->last_page->next = page;\n\t\tdoc->last_page = page;\n\t}\n}\n\nstatic void\nxps_add_link_target(xps_document *doc, char *name)\n{\n\txps_page *page = doc->last_page;\n\txps_target *target = fz_malloc_struct(doc->ctx, xps_target);\n\ttarget->name = fz_strdup(doc->ctx, name);\n\ttarget->page = page->number;\n\ttarget->rect = fz_empty_rect; /* SumatraPDF: extended link support */\n\ttarget->next = doc->target;\n\tdoc->target = target;\n}\n\n/* SumatraPDF: extended link support */\nxps_target *\nxps_lookup_link_target_obj(xps_document *doc, char *target_uri)\n{\n\txps_target *target;\n\tchar *needle = strrchr(target_uri, '#');\n\tif (!needle)\n\t\treturn NULL;\n\tfor (target = doc->target; target; target = target->next)\n\t\tif (!strcmp(target->name, needle + 1))\n\t\t\treturn target;\n\treturn NULL;\n}\n\nint\nxps_lookup_link_target(xps_document *doc, char *target_uri)\n{\n\txps_target *target = xps_lookup_link_target_obj(doc, target_uri);\n\treturn target ? target->page : -1;\n}\n\nstatic void\nxps_free_link_targets(xps_document *doc)\n{\n\txps_target *target = doc->target, *next;\n\twhile (target)\n\t{\n\t\tnext = target->next;\n\t\tfz_free(doc->ctx, target->name);\n\t\tfz_free(doc->ctx, target);\n\t\ttarget = next;\n\t}\n}\n\nstatic void\nxps_free_fixed_pages(xps_document *doc)\n{\n\txps_page *page = doc->first_page;\n\twhile (page)\n\t{\n\t\txps_page *next = page->next;\n\t\txps_free_page(doc, page);\n\t\tfz_drop_link(doc->ctx, page->links);\n\t\tfz_free(doc->ctx, page->name);\n\t\tfz_free(doc->ctx, page);\n\t\tpage = next;\n\t}\n\tdoc->first_page = NULL;\n\tdoc->last_page = NULL;\n}\n\nstatic void\nxps_free_fixed_documents(xps_document *doc)\n{\n\txps_fixdoc *fixdoc = doc->first_fixdoc;\n\twhile (fixdoc)\n\t{\n\t\txps_fixdoc *next = fixdoc->next;\n\t\tfz_free(doc->ctx, fixdoc->name);\n\t\tfz_free(doc->ctx, fixdoc->outline);\n\t\tfz_free(doc->ctx, fixdoc);\n\t\tfixdoc = next;\n\t}\n\tdoc->first_fixdoc = NULL;\n\tdoc->last_fixdoc = NULL;\n}\n\nvoid\nxps_free_page_list(xps_document *doc)\n{\n\txps_free_fixed_documents(doc);\n\txps_free_fixed_pages(doc);\n\txps_free_link_targets(doc);\n}\n\n/*\n * Parse the fixed document sequence structure and _rels/.rels to find the start part.\n */\n\nstatic void\nxps_parse_metadata_imp(xps_document *doc, fz_xml *item, xps_fixdoc *fixdoc)\n{\n\twhile (item)\n\t{\n\t\tif (fz_xml_is_tag(item, \"Relationship\"))\n\t\t{\n\t\t\tchar *target = fz_xml_att(item, \"Target\");\n\t\t\tchar *type = fz_xml_att(item, \"Type\");\n\t\t\tif (target && type)\n\t\t\t{\n\t\t\t\tchar tgtbuf[1024];\n\t\t\t\txps_resolve_url(tgtbuf, doc->base_uri, target, sizeof tgtbuf);\n\t\t\t\tif (!strcmp(type, REL_START_PART) || !strcmp(type, REL_START_PART_OXPS))\n\t\t\t\t\tdoc->start_part = fz_strdup(doc->ctx, tgtbuf);\n\t\t\t\tif ((!strcmp(type, REL_DOC_STRUCTURE) || !strcmp(type, REL_DOC_STRUCTURE_OXPS)) && fixdoc)\n\t\t\t\t\tfixdoc->outline = fz_strdup(doc->ctx, tgtbuf);\n\t\t\t\tif (!fz_xml_att(item, \"Id\"))\n\t\t\t\t\tfz_warn(doc->ctx, \"missing relationship id for %s\", target);\n\t\t\t}\n\t\t}\n\n\t\tif (fz_xml_is_tag(item, \"DocumentReference\"))\n\t\t{\n\t\t\tchar *source = fz_xml_att(item, \"Source\");\n\t\t\tif (source)\n\t\t\t{\n\t\t\t\tchar srcbuf[1024];\n\t\t\t\txps_resolve_url(srcbuf, doc->base_uri, source, sizeof srcbuf);\n\t\t\t\txps_add_fixed_document(doc, srcbuf);\n\t\t\t}\n\t\t}\n\n\t\tif (fz_xml_is_tag(item, \"PageContent\"))\n\t\t{\n\t\t\tchar *source = fz_xml_att(item, \"Source\");\n\t\t\tchar *width_att = fz_xml_att(item, \"Width\");\n\t\t\tchar *height_att = fz_xml_att(item, \"Height\");\n\t\t\tint width = width_att ? atoi(width_att) : 0;\n\t\t\tint height = height_att ? atoi(height_att) : 0;\n\t\t\tif (source)\n\t\t\t{\n\t\t\t\tchar srcbuf[1024];\n\t\t\t\txps_resolve_url(srcbuf, doc->base_uri, source, sizeof srcbuf);\n\t\t\t\txps_add_fixed_page(doc, srcbuf, width, height);\n\t\t\t}\n\t\t}\n\n\t\tif (fz_xml_is_tag(item, \"LinkTarget\"))\n\t\t{\n\t\t\tchar *name = fz_xml_att(item, \"Name\");\n\t\t\tif (name)\n\t\t\t\txps_add_link_target(doc, name);\n\t\t}\n\n\t\txps_parse_metadata_imp(doc, fz_xml_down(item), fixdoc);\n\n\t\titem = fz_xml_next(item);\n\t}\n}\n\nstatic void\nxps_parse_metadata(xps_document *doc, xps_part *part, xps_fixdoc *fixdoc)\n{\n\tfz_xml *root;\n\tchar buf[1024];\n\tchar *s;\n\n\t/* Save directory name part */\n\tfz_strlcpy(buf, part->name, sizeof buf);\n\ts = strrchr(buf, '/');\n\tif (s)\n\t\ts[0] = 0;\n\n\t/* _rels parts are voodoo: their URI references are from\n\t * the part they are associated with, not the actual _rels\n\t * part being parsed.\n\t */\n\ts = strstr(buf, \"/_rels\");\n\tif (s)\n\t\t*s = 0;\n\n\tdoc->base_uri = buf;\n\tdoc->part_uri = part->name;\n\n\troot = fz_parse_xml(doc->ctx, part->data, part->size, 0);\n\txps_parse_metadata_imp(doc, root, fixdoc);\n\tfz_free_xml(doc->ctx, root);\n\n\tdoc->base_uri = NULL;\n\tdoc->part_uri = NULL;\n}\n\nstatic void\nxps_read_and_process_metadata_part(xps_document *doc, char *name, xps_fixdoc *fixdoc)\n{\n\tfz_context *ctx = doc->ctx;\n\txps_part *part;\n\n\tif (!xps_has_part(doc, name))\n\t\treturn;\n\n\tpart = xps_read_part(doc, name);\n\tfz_try(ctx)\n\t{\n\t\txps_parse_metadata(doc, part, fixdoc);\n\t}\n\tfz_always(ctx)\n\t{\n\t\txps_free_part(doc, part);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow(ctx);\n\t}\n}\n\nvoid\nxps_read_page_list(xps_document *doc)\n{\n\txps_fixdoc *fixdoc;\n\n\txps_read_and_process_metadata_part(doc, \"/_rels/.rels\", NULL);\n\n\tif (!doc->start_part)\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"cannot find fixed document sequence start part\");\n\n\txps_read_and_process_metadata_part(doc, doc->start_part, NULL);\n\n\tfor (fixdoc = doc->first_fixdoc; fixdoc; fixdoc = fixdoc->next)\n\t{\n\t\tchar relbuf[1024];\n\t\tfz_try(doc->ctx)\n\t\t{\n\t\t\txps_rels_for_part(relbuf, fixdoc->name, sizeof relbuf);\n\t\t\txps_read_and_process_metadata_part(doc, relbuf, fixdoc);\n\t\t}\n\t\tfz_catch(doc->ctx)\n\t\t{\n\t\t\tfz_rethrow_if(doc->ctx, FZ_ERROR_TRYLATER);\n\t\t\tfz_warn(doc->ctx, \"cannot process FixedDocument rels part\");\n\t\t}\n\t\txps_read_and_process_metadata_part(doc, fixdoc->name, fixdoc);\n\t}\n}\n\nint\nxps_count_pages(xps_document *doc)\n{\n\treturn doc->page_count;\n}\n\nstatic void\nxps_load_fixed_page(xps_document *doc, xps_page *page)\n{\n\txps_part *part;\n\tfz_xml *root;\n\tchar *width_att;\n\tchar *height_att;\n\tfz_context *ctx = doc->ctx;\n\n\tpart = xps_read_part(doc, page->name);\n\tfz_try(ctx)\n\t{\n\t\troot = fz_parse_xml(doc->ctx, part->data, part->size, 0);\n\t}\n\tfz_always(ctx)\n\t{\n\t\txps_free_part(doc, part);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\troot = NULL;\n\t}\n\tif (!root)\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"FixedPage missing root element\");\n\n\tif (fz_xml_is_tag(root, \"AlternateContent\"))\n\t{\n\t\tfz_xml *node = xps_lookup_alternate_content(root);\n\t\tif (!node)\n\t\t{\n\t\t\tfz_free_xml(doc->ctx, root);\n\t\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"FixedPage missing alternate root element\");\n\t\t}\n\t\tfz_detach_xml(node);\n\t\tfz_free_xml(doc->ctx, root);\n\t\troot = node;\n\t}\n\n\tif (strcmp(fz_xml_tag(root), \"FixedPage\"))\n\t{\n\t\tfz_free_xml(doc->ctx, root);\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"expected FixedPage element\");\n\t}\n\n\twidth_att = fz_xml_att(root, \"Width\");\n\tif (!width_att)\n\t{\n\t\tfz_free_xml(doc->ctx, root);\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"FixedPage missing required attribute: Width\");\n\t}\n\n\theight_att = fz_xml_att(root, \"Height\");\n\tif (!height_att)\n\t{\n\t\tfz_free_xml(doc->ctx, root);\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"FixedPage missing required attribute: Height\");\n\t}\n\n\tpage->width = atoi(width_att);\n\tpage->height = atoi(height_att);\n\tpage->root = root;\n}\n\nxps_page *\nxps_load_page(xps_document *doc, int number)\n{\n\txps_page *page;\n\tint n = 0;\n\n\tfor (page = doc->first_page; page; page = page->next)\n\t{\n\t\tif (n == number)\n\t\t{\n\t\t\tdoc->current_page = page;\n\t\t\tif (!page->root)\n\t\t\t\txps_load_fixed_page(doc, page);\n\t\t\treturn page;\n\t\t}\n\t\tn ++;\n\t}\n\n\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"cannot find page %d\", number + 1);\n}\n\nfz_rect *\nxps_bound_page(xps_document *doc, xps_page *page, fz_rect *bounds)\n{\n\tbounds->x0 = bounds->y0 = 0;\n\tbounds->x1 = page->width * 72.0f / 96.0f;\n\tbounds->y1 = page->height * 72.0f / 96.0f;\n\treturn bounds;\n}\n\nvoid\nxps_free_page(xps_document *doc, xps_page *page)\n{\n\tif (page == NULL)\n\t\treturn;\n\t/* only free the XML contents */\n\tif (page->root)\n\t\tfz_free_xml(doc->ctx, page->root);\n\tpage->root = NULL;\n}\n\nstatic int\nxps_recognize(fz_context *doc, const char *magic)\n{\n\tchar *ext = strrchr(magic, '.');\n\n\tif (ext)\n\t{\n\t\tif (!fz_strcasecmp(ext, \".xps\") || !fz_strcasecmp(ext, \".rels\") || !fz_strcasecmp(ext, \".oxps\"))\n\t\t\treturn 100;\n\t}\n\tif (!strcmp(magic, \"xps\") || !strcmp(magic, \"oxps\") ||\n\t\t!strcmp(magic, \"application/vnd.ms-xpsdocument\") ||\n\t\t!strcmp(magic, \"application/xps\") ||\n\t\t!strcmp(magic, \"application/oxps\"))\n\t\treturn 100;\n\n\treturn 0;\n}\n\nfz_document_handler xps_document_handler =\n{\n\t(fz_document_recognize_fn *)&xps_recognize,\n\t(fz_document_open_fn *)&xps_open_document,\n\t(fz_document_open_with_stream_fn *)&xps_open_document_with_stream\n};\n"
  },
  {
    "path": "mupdf/source/xps/xps-glyphs.c",
    "content": "#include \"mupdf/xps.h\"\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_ADVANCES_H\n\nstatic inline int ishex(int a)\n{\n\treturn (a >= 'A' && a <= 'F') ||\n\t\t(a >= 'a' && a <= 'f') ||\n\t\t(a >= '0' && a <= '9');\n}\n\nstatic inline int unhex(int a)\n{\n\tif (a >= 'A' && a <= 'F') return a - 'A' + 0xA;\n\tif (a >= 'a' && a <= 'f') return a - 'a' + 0xA;\n\tif (a >= '0' && a <= '9') return a - '0';\n\treturn 0;\n}\n\nint\nxps_count_font_encodings(fz_font *font)\n{\n\tFT_Face face = font->ft_face;\n\treturn face->num_charmaps;\n}\n\nvoid\nxps_identify_font_encoding(fz_font *font, int idx, int *pid, int *eid)\n{\n\tFT_Face face = font->ft_face;\n\t*pid = face->charmaps[idx]->platform_id;\n\t*eid = face->charmaps[idx]->encoding_id;\n}\n\nvoid\nxps_select_font_encoding(fz_font *font, int idx)\n{\n\tFT_Face face = font->ft_face;\n\tFT_Set_Charmap(face, face->charmaps[idx]);\n}\n\nint\nxps_encode_font_char(fz_font *font, int code)\n{\n\tFT_Face face = font->ft_face;\n\tint gid = FT_Get_Char_Index(face, code);\n\tif (gid == 0 && face->charmap && face->charmap->platform_id == 3 && face->charmap->encoding_id == 0)\n\t\tgid = FT_Get_Char_Index(face, 0xF000 | code);\n\treturn gid;\n}\n\nvoid\nxps_measure_font_glyph(xps_document *doc, fz_font *font, int gid, xps_glyph_metrics *mtx)\n{\n\tint mask = FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM;\n\tFT_Face face = font->ft_face;\n\tFT_Fixed hadv = 0, vadv = 0;\n\tfz_context *ctx = doc->ctx;\n\n\tfz_lock(ctx, FZ_LOCK_FREETYPE);\n\tFT_Get_Advance(face, gid, mask, &hadv);\n\tFT_Get_Advance(face, gid, mask | FT_LOAD_VERTICAL_LAYOUT, &vadv);\n\tfz_unlock(ctx, FZ_LOCK_FREETYPE);\n\n\tmtx->hadv = hadv / (float)face->units_per_EM;\n\tmtx->vadv = vadv / (float)face->units_per_EM;\n\tmtx->vorg = face->ascender / (float) face->units_per_EM;\n}\n\nstatic fz_font *\nxps_lookup_font(xps_document *doc, char *name)\n{\n\txps_font_cache *cache;\n\tfor (cache = doc->font_table; cache; cache = cache->next)\n\t\tif (!xps_strcasecmp(cache->name, name))\n\t\t\treturn fz_keep_font(doc->ctx, cache->font);\n\treturn NULL;\n}\n\nstatic void\nxps_insert_font(xps_document *doc, char *name, fz_font *font)\n{\n\txps_font_cache *cache = fz_malloc_struct(doc->ctx, xps_font_cache);\n\tcache->name = fz_strdup(doc->ctx, name);\n\tcache->font = fz_keep_font(doc->ctx, font);\n\tcache->next = doc->font_table;\n\tdoc->font_table = cache;\n}\n\n/*\n * Some fonts in XPS are obfuscated by XOR:ing the first 32 bytes of the\n * data with the GUID in the fontname.\n */\nstatic void\nxps_deobfuscate_font_resource(xps_document *doc, xps_part *part)\n{\n\tunsigned char buf[33];\n\tunsigned char key[16];\n\tchar *p;\n\tint i;\n\n\tif (part->size < 32)\n\t{\n\t\tfz_warn(doc->ctx, \"insufficient data for font deobfuscation\");\n\t\treturn;\n\t}\n\n\tp = strrchr(part->name, '/');\n\tif (!p)\n\t\tp = part->name;\n\n\tfor (i = 0; i < 32 && *p; p++)\n\t{\n\t\tif (ishex(*p))\n\t\t\tbuf[i++] = *p;\n\t}\n\tbuf[i] = 0;\n\n\tif (i != 32)\n\t{\n\t\tfz_warn(doc->ctx, \"cannot extract GUID from obfuscated font part name\");\n\t\treturn;\n\t}\n\n\tfor (i = 0; i < 16; i++)\n\t\tkey[i] = unhex(buf[i*2+0]) * 16 + unhex(buf[i*2+1]);\n\n\tfor (i = 0; i < 16; i++)\n\t{\n\t\tpart->data[i] ^= key[15-i];\n\t\tpart->data[i+16] ^= key[15-i];\n\t}\n}\n\nstatic void\nxps_select_best_font_encoding(xps_document *doc, fz_font *font)\n{\n\tstatic struct { int pid, eid; } xps_cmap_list[] =\n\t{\n\t\t{ 3, 10 },\t\t/* Unicode with surrogates */\n\t\t{ 3, 1 },\t\t/* Unicode without surrogates */\n\t\t{ 3, 5 },\t\t/* Wansung */\n\t\t{ 3, 4 },\t\t/* Big5 */\n\t\t{ 3, 3 },\t\t/* Prc */\n\t\t{ 3, 2 },\t\t/* ShiftJis */\n\t\t{ 3, 0 },\t\t/* Symbol */\n\t\t{ 1, 0 },\n\t\t{ -1, -1 },\n\t};\n\n\tint i, k, n, pid, eid;\n\n\tn = xps_count_font_encodings(font);\n\tfor (k = 0; xps_cmap_list[k].pid != -1; k++)\n\t{\n\t\tfor (i = 0; i < n; i++)\n\t\t{\n\t\t\txps_identify_font_encoding(font, i, &pid, &eid);\n\t\t\tif (pid == xps_cmap_list[k].pid && eid == xps_cmap_list[k].eid)\n\t\t\t{\n\t\t\t\txps_select_font_encoding(font, i);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\tfz_warn(doc->ctx, \"cannot find a suitable cmap\");\n}\n\n/*\n * Parse and draw an XPS <Glyphs> element.\n *\n * Indices syntax:\n\n GlyphIndices\t= GlyphMapping ( \";\" GlyphMapping )\n GlyphMapping\t= ( [ClusterMapping] GlyphIndex ) [GlyphMetrics]\n ClusterMapping = \"(\" ClusterCodeUnitCount [\":\" ClusterGlyphCount] \")\"\n ClusterCodeUnitCount\t= * DIGIT\n ClusterGlyphCount\t\t= * DIGIT\n GlyphIndex\t\t= * DIGIT\n GlyphMetrics\t= \",\" AdvanceWidth [\",\" uOffset [\",\" vOffset]]\n AdvanceWidth\t= [\"+\"] RealNum\n uOffset\t\t= [\"+\" | \"-\"] RealNum\n vOffset\t\t= [\"+\" | \"-\"] RealNum\n RealNum\t\t= ((DIGIT [\".\" DIGIT]) | (\".\" DIGIT)) [Exponent]\n Exponent\t\t= ( (\"E\"|\"e\") (\"+\"|\"-\") DIGIT )\n\n */\n\nstatic char *\nxps_parse_digits(char *s, int *digit)\n{\n\t*digit = 0;\n\twhile (*s >= '0' && *s <= '9')\n\t{\n\t\t*digit = *digit * 10 + (*s - '0');\n\t\ts ++;\n\t}\n\treturn s;\n}\n\nstatic inline int is_real_num_char(int c)\n{\n\treturn (c >= '0' && c <= '9') ||\n\t\tc == 'e' || c == 'E' || c == '+' || c == '-' || c == '.';\n}\n\nstatic char *\nxps_parse_real_num(char *s, float *number)\n{\n\tchar buf[64];\n\tchar *p = buf;\n\twhile (is_real_num_char(*s))\n\t\t*p++ = *s++;\n\t*p = 0;\n\tif (buf[0])\n\t\t*number = fz_atof(buf);\n\treturn s;\n}\n\nstatic char *\nxps_parse_cluster_mapping(char *s, int *code_count, int *glyph_count)\n{\n\tif (*s == '(')\n\t\ts = xps_parse_digits(s + 1, code_count);\n\tif (*s == ':')\n\t\ts = xps_parse_digits(s + 1, glyph_count);\n\tif (*s == ')')\n\t\ts ++;\n\treturn s;\n}\n\nstatic char *\nxps_parse_glyph_index(char *s, int *glyph_index)\n{\n\tif (*s >= '0' && *s <= '9')\n\t\ts = xps_parse_digits(s, glyph_index);\n\treturn s;\n}\n\nstatic char *\nxps_parse_glyph_metrics(char *s, float *advance, float *uofs, float *vofs)\n{\n\tif (*s == ',')\n\t\ts = xps_parse_real_num(s + 1, advance);\n\tif (*s == ',')\n\t\ts = xps_parse_real_num(s + 1, uofs);\n\tif (*s == ',')\n\t\ts = xps_parse_real_num(s + 1, vofs);\n\treturn s;\n}\n\n/*\n * Parse unicode and indices strings and encode glyphs.\n * Calculate metrics for positioning.\n */\nstatic fz_text *\nxps_parse_glyphs_imp(xps_document *doc, const fz_matrix *ctm,\n\tfz_font *font, float size, float originx, float originy,\n\tint is_sideways, int bidi_level,\n\tchar *indices, char *unicode)\n{\n\txps_glyph_metrics mtx;\n\tfz_text *text;\n\tfz_matrix tm;\n\tfloat e, f;\n\tfloat x = originx;\n\tfloat y = originy;\n\tchar *us = unicode;\n\tchar *is = indices;\n\tint un = 0;\n\n\tif (!unicode && !indices)\n\t\tfz_warn(doc->ctx, \"glyphs element with neither characters nor indices\");\n\n\tif (us)\n\t{\n\t\tif (us[0] == '{' && us[1] == '}')\n\t\t\tus = us + 2;\n\t\tun = strlen(us);\n\t}\n\n\tif (is_sideways)\n\t{\n\t\tfz_pre_scale(fz_rotate(&tm, 90), -size, size);\n\t}\n\telse\n\t\tfz_scale(&tm, size, -size);\n\n\ttext = fz_new_text(doc->ctx, font, &tm, is_sideways);\n\n\twhile ((us && un > 0) || (is && *is))\n\t{\n\t\tint char_code = '?';\n\t\tint code_count = 1;\n\t\tint glyph_count = 1;\n\n\t\tif (is && *is)\n\t\t{\n\t\t\tis = xps_parse_cluster_mapping(is, &code_count, &glyph_count);\n\t\t}\n\n\t\tif (code_count < 1)\n\t\t\tcode_count = 1;\n\t\tif (glyph_count < 1)\n\t\t\tglyph_count = 1;\n\n\t\t/* TODO: add code chars with cluster mappings for text extraction */\n\n\t\twhile (code_count--)\n\t\t{\n\t\t\tif (us && un > 0)\n\t\t\t{\n\t\t\t\tint t = fz_chartorune(&char_code, us);\n\t\t\t\tus += t; un -= t;\n\t\t\t}\n\t\t}\n\n\t\twhile (glyph_count--)\n\t\t{\n\t\t\tint glyph_index = -1;\n\t\t\tfloat u_offset = 0;\n\t\t\tfloat v_offset = 0;\n\t\t\tfloat advance;\n\n\t\t\tif (is && *is)\n\t\t\t\tis = xps_parse_glyph_index(is, &glyph_index);\n\n\t\t\tif (glyph_index == -1)\n\t\t\t\tglyph_index = xps_encode_font_char(font, char_code);\n\n\t\t\txps_measure_font_glyph(doc, font, glyph_index, &mtx);\n\t\t\tif (is_sideways)\n\t\t\t\tadvance = mtx.vadv * 100;\n\t\t\telse if (bidi_level & 1)\n\t\t\t\tadvance = -mtx.hadv * 100;\n\t\t\telse\n\t\t\t\tadvance = mtx.hadv * 100;\n\n\t\t\tif (font->ft_bold)\n\t\t\t\tadvance *= 1.02f;\n\n\t\t\tif (is && *is)\n\t\t\t{\n\t\t\t\tis = xps_parse_glyph_metrics(is, &advance, &u_offset, &v_offset);\n\t\t\t\tif (*is == ';')\n\t\t\t\t\tis ++;\n\t\t\t}\n\n\t\t\tif (bidi_level & 1)\n\t\t\t\tu_offset = -mtx.hadv * 100 - u_offset;\n\n\t\t\tu_offset = u_offset * 0.01f * size;\n\t\t\tv_offset = v_offset * 0.01f * size;\n\n\t\t\tif (is_sideways)\n\t\t\t{\n\t\t\t\te = x + u_offset + (mtx.vorg * size);\n\t\t\t\tf = y - v_offset + (mtx.hadv * 0.5f * size);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\te = x + u_offset;\n\t\t\t\tf = y - v_offset;\n\t\t\t}\n\n\t\t\tfz_add_text(doc->ctx, text, glyph_index, char_code, e, f);\n\n\t\t\tx += advance * 0.01f * size;\n\t\t}\n\t}\n\n\treturn text;\n}\n\nvoid\nxps_parse_glyphs(xps_document *doc, const fz_matrix *ctm,\n\t\tchar *base_uri, xps_resource *dict, fz_xml *root)\n{\n\tfz_xml *node;\n\n\tchar *fill_uri;\n\tchar *opacity_mask_uri;\n\n\tchar *bidi_level_att;\n\tchar *fill_att;\n\tchar *font_size_att;\n\tchar *font_uri_att;\n\tchar *origin_x_att;\n\tchar *origin_y_att;\n\tchar *is_sideways_att;\n\tchar *indices_att;\n\tchar *unicode_att;\n\tchar *style_att;\n\tchar *transform_att;\n\tchar *clip_att;\n\tchar *opacity_att;\n\tchar *opacity_mask_att;\n\tchar *navigate_uri_att;\n\n\tfz_xml *transform_tag = NULL;\n\tfz_xml *clip_tag = NULL;\n\tfz_xml *fill_tag = NULL;\n\tfz_xml *opacity_mask_tag = NULL;\n\n\tchar *fill_opacity_att = NULL;\n\n\txps_part *part;\n\tfz_font *font;\n\n\tchar partname[1024];\n\tchar fakename[1024];\n\tchar *subfont;\n\n\tfloat font_size = 10;\n\tint subfontid = 0;\n\tint is_sideways = 0;\n\tint bidi_level = 0;\n\n\tfz_text *text;\n\tfz_rect area;\n\n\tfz_matrix local_ctm = *ctm;\n\n\t/*\n\t * Extract attributes and extended attributes.\n\t */\n\n\tbidi_level_att = fz_xml_att(root, \"BidiLevel\");\n\tfill_att = fz_xml_att(root, \"Fill\");\n\tfont_size_att = fz_xml_att(root, \"FontRenderingEmSize\");\n\tfont_uri_att = fz_xml_att(root, \"FontUri\");\n\torigin_x_att = fz_xml_att(root, \"OriginX\");\n\torigin_y_att = fz_xml_att(root, \"OriginY\");\n\tis_sideways_att = fz_xml_att(root, \"IsSideways\");\n\tindices_att = fz_xml_att(root, \"Indices\");\n\tunicode_att = fz_xml_att(root, \"UnicodeString\");\n\tstyle_att = fz_xml_att(root, \"StyleSimulations\");\n\ttransform_att = fz_xml_att(root, \"RenderTransform\");\n\tclip_att = fz_xml_att(root, \"Clip\");\n\topacity_att = fz_xml_att(root, \"Opacity\");\n\topacity_mask_att = fz_xml_att(root, \"OpacityMask\");\n\tnavigate_uri_att = fz_xml_att(root, \"FixedPage.NavigateUri\");\n\n\tfor (node = fz_xml_down(root); node; node = fz_xml_next(node))\n\t{\n\t\tif (fz_xml_is_tag(node, \"Glyphs.RenderTransform\"))\n\t\t\ttransform_tag = fz_xml_down(node);\n\t\tif (fz_xml_is_tag(node, \"Glyphs.OpacityMask\"))\n\t\t\topacity_mask_tag = fz_xml_down(node);\n\t\tif (fz_xml_is_tag(node, \"Glyphs.Clip\"))\n\t\t\tclip_tag = fz_xml_down(node);\n\t\tif (fz_xml_is_tag(node, \"Glyphs.Fill\"))\n\t\t\tfill_tag = fz_xml_down(node);\n\t}\n\n\tfill_uri = base_uri;\n\topacity_mask_uri = base_uri;\n\n\txps_resolve_resource_reference(doc, dict, &transform_att, &transform_tag, NULL);\n\txps_resolve_resource_reference(doc, dict, &clip_att, &clip_tag, NULL);\n\txps_resolve_resource_reference(doc, dict, &fill_att, &fill_tag, &fill_uri);\n\txps_resolve_resource_reference(doc, dict, &opacity_mask_att, &opacity_mask_tag, &opacity_mask_uri);\n\n\t/*\n\t * Check that we have all the necessary information.\n\t */\n\n\tif (!font_size_att || !font_uri_att || !origin_x_att || !origin_y_att) {\n\t\tfz_warn(doc->ctx, \"missing attributes in glyphs element\");\n\t\treturn;\n\t}\n\n\tif (!indices_att && !unicode_att)\n\t\treturn; /* nothing to draw */\n\n\tif (is_sideways_att)\n\t\tis_sideways = !strcmp(is_sideways_att, \"true\");\n\n\tif (bidi_level_att)\n\t\tbidi_level = atoi(bidi_level_att);\n\n\t/*\n\t * Find and load the font resource\n\t */\n\n\txps_resolve_url(partname, base_uri, font_uri_att, sizeof partname);\n\tsubfont = strrchr(partname, '#');\n\tif (subfont)\n\t{\n\t\tsubfontid = atoi(subfont + 1);\n\t\t*subfont = 0;\n\t}\n\n\t/* Make a new part name for font with style simulation applied */\n\tfz_strlcpy(fakename, partname, sizeof fakename);\n\tif (style_att)\n\t{\n\t\tif (!strcmp(style_att, \"BoldSimulation\"))\n\t\t\tfz_strlcat(fakename, \"#Bold\", sizeof fakename);\n\t\telse if (!strcmp(style_att, \"ItalicSimulation\"))\n\t\t\tfz_strlcat(fakename, \"#Italic\", sizeof fakename);\n\t\telse if (!strcmp(style_att, \"BoldItalicSimulation\"))\n\t\t\tfz_strlcat(fakename, \"#BoldItalic\", sizeof fakename);\n\t}\n\n\tfont = xps_lookup_font(doc, fakename);\n\tif (!font)\n\t{\n\t\tfz_buffer *buf = NULL;\n\t\tfz_var(buf);\n\n\t\tfz_try(doc->ctx)\n\t\t{\n\t\t\tpart = xps_read_part(doc, partname);\n\t\t}\n\t\tfz_catch(doc->ctx)\n\t\t{\n\t\t\tfz_rethrow_if(doc->ctx, FZ_ERROR_TRYLATER);\n\t\t\tfz_warn(doc->ctx, \"cannot find font resource part '%s'\", partname);\n\t\t\treturn;\n\t\t}\n\n\t\t/* deobfuscate if necessary */\n\t\tif (strstr(part->name, \".odttf\"))\n\t\t\txps_deobfuscate_font_resource(doc, part);\n\t\tif (strstr(part->name, \".ODTTF\"))\n\t\t\txps_deobfuscate_font_resource(doc, part);\n\n\t\tfz_try(doc->ctx)\n\t\t{\n\t\t\tbuf = fz_new_buffer_from_data(doc->ctx, part->data, part->size);\n\t\t\t/* part->data is now owned by buf */\n\t\t\tpart->data = NULL;\n\t\t\tfont = fz_new_font_from_buffer(doc->ctx, NULL, buf, subfontid, 1);\n\t\t}\n\t\tfz_always(doc->ctx)\n\t\t{\n\t\t\tfz_drop_buffer(doc->ctx, buf);\n\t\t\txps_free_part(doc, part);\n\t\t}\n\t\tfz_catch(doc->ctx)\n\t\t{\n\t\t\tfz_rethrow_if(doc->ctx, FZ_ERROR_TRYLATER);\n\t\t\tfz_warn(doc->ctx, \"cannot load font resource '%s'\", partname);\n\t\t\treturn;\n\t\t}\n\n\t\tif (style_att)\n\t\t{\n\t\t\tfont->ft_bold = !!strstr(style_att, \"Bold\");\n\t\t\tfont->ft_italic = !!strstr(style_att, \"Italic\");\n\t\t}\n\n\t\txps_select_best_font_encoding(doc, font);\n\t\txps_insert_font(doc, fakename, font);\n\n\t\t/* SumatraPDF: prevent assertion in Freetype 2.5 */\n\t\tFT_Set_Char_Size(font->ft_face, 64, 64, 72, 72);\n\t}\n\n\t/*\n\t * Set up graphics state.\n\t */\n\n\tif (transform_att || transform_tag)\n\t{\n\t\tfz_matrix transform;\n\t\tif (transform_att)\n\t\t\txps_parse_render_transform(doc, transform_att, &transform);\n\t\tif (transform_tag)\n\t\t\txps_parse_matrix_transform(doc, transform_tag, &transform);\n\t\tfz_concat(&local_ctm, &transform, &local_ctm);\n\t}\n\n\tif (clip_att || clip_tag)\n\t\txps_clip(doc, &local_ctm, dict, clip_att, clip_tag);\n\n\tfont_size = fz_atof(font_size_att);\n\n\ttext = xps_parse_glyphs_imp(doc, &local_ctm, font, font_size,\n\t\t\tfz_atof(origin_x_att), fz_atof(origin_y_att),\n\t\t\tis_sideways, bidi_level, indices_att, unicode_att);\n\n\tfz_bound_text(doc->ctx, text, NULL, &local_ctm, &area);\n\n\t/* SumatraPDF: extended link support */\n\txps_extract_anchor_info(doc, &area, navigate_uri_att, fz_xml_att(root, \"Name\"), 0);\n\tnavigate_uri_att = NULL;\n\n\tif (navigate_uri_att)\n\t\txps_add_link(doc, &area, base_uri, navigate_uri_att);\n\n\txps_begin_opacity(doc, &local_ctm, &area, opacity_mask_uri, dict, opacity_att, opacity_mask_tag);\n\n\t/* If it's a solid color brush fill/stroke do a simple fill */\n\n\tif (fill_tag && !strcmp(fz_xml_tag(fill_tag), \"SolidColorBrush\"))\n\t{\n\t\tfill_opacity_att = fz_xml_att(fill_tag, \"Opacity\");\n\t\tfill_att = fz_xml_att(fill_tag, \"Color\");\n\t\tfill_tag = NULL;\n\t}\n\n\tif (fill_att)\n\t{\n\t\tfloat samples[FZ_MAX_COLORS];\n\t\tfz_colorspace *colorspace;\n\n\t\txps_parse_color(doc, base_uri, fill_att, &colorspace, samples);\n\t\tif (fill_opacity_att)\n\t\t\tsamples[0] *= fz_atof(fill_opacity_att);\n\t\txps_set_color(doc, colorspace, samples);\n\n\t\tfz_fill_text(doc->dev, text, &local_ctm,\n\t\t\tdoc->colorspace, doc->color, doc->alpha);\n\t}\n\n\t/* If it's a complex brush, use the charpath as a clip mask */\n\n\tif (fill_tag)\n\t{\n\t\tfz_clip_text(doc->dev, text, &local_ctm, 0);\n\t\txps_parse_brush(doc, &local_ctm, &area, fill_uri, dict, fill_tag);\n\t\tfz_pop_clip(doc->dev);\n\t}\n\n\txps_end_opacity(doc, opacity_mask_uri, dict, opacity_att, opacity_mask_tag);\n\n\tfz_free_text(doc->ctx, text);\n\n\tif (clip_att || clip_tag)\n\t\tfz_pop_clip(doc->dev);\n\n\tfz_drop_font(doc->ctx, font);\n}\n"
  },
  {
    "path": "mupdf/source/xps/xps-gradient.c",
    "content": "#include \"mupdf/xps.h\"\n\n#define MAX_STOPS 256\n\nenum { SPREAD_PAD, SPREAD_REPEAT, SPREAD_REFLECT };\n\n/*\n * Parse a list of GradientStop elements.\n * Fill the offset and color arrays, and\n * return the number of stops parsed.\n */\n\nstruct stop\n{\n\tfloat offset;\n\tfloat r, g, b, a;\n\tint index;\n};\n\nstatic int cmp_stop(const void *a, const void *b)\n{\n\tconst struct stop *astop = a;\n\tconst struct stop *bstop = b;\n\tfloat diff = astop->offset - bstop->offset;\n\tif (diff < 0)\n\t\treturn -1;\n\tif (diff > 0)\n\t\treturn 1;\n\treturn astop->index - bstop->index;\n}\n\nstatic inline float lerp(float a, float b, float x)\n{\n\treturn a + (b - a) * x;\n}\n\nstatic int\nxps_parse_gradient_stops(xps_document *doc, char *base_uri, fz_xml *node,\n\tstruct stop *stops, int maxcount)\n{\n\tfz_colorspace *colorspace;\n\tfloat sample[FZ_MAX_COLORS];\n\tfloat rgb[3];\n\tint before, after;\n\tint count;\n\tint i;\n\n\t/* We may have to insert 2 extra stops when postprocessing */\n\tmaxcount -= 2;\n\n\tcount = 0;\n\twhile (node && count < maxcount)\n\t{\n\t\tif (fz_xml_is_tag(node, \"GradientStop\"))\n\t\t{\n\t\t\tchar *offset = fz_xml_att(node, \"Offset\");\n\t\t\tchar *color = fz_xml_att(node, \"Color\");\n\t\t\tif (offset && color)\n\t\t\t{\n\t\t\t\tstops[count].offset = fz_atof(offset);\n\t\t\t\tstops[count].index = count;\n\n\t\t\t\txps_parse_color(doc, base_uri, color, &colorspace, sample);\n\n\t\t\t\tfz_convert_color(doc->ctx, fz_device_rgb(doc->ctx), rgb, colorspace, sample + 1);\n\n\t\t\t\tstops[count].r = rgb[0];\n\t\t\t\tstops[count].g = rgb[1];\n\t\t\t\tstops[count].b = rgb[2];\n\t\t\t\tstops[count].a = sample[0];\n\n\t\t\t\tcount ++;\n\t\t\t}\n\t\t}\n\t\tnode = fz_xml_next(node);\n\t}\n\n\tif (count == 0)\n\t{\n\t\tfz_warn(doc->ctx, \"gradient brush has no gradient stops\");\n\t\tstops[0].offset = 0;\n\t\tstops[0].r = 0;\n\t\tstops[0].g = 0;\n\t\tstops[0].b = 0;\n\t\tstops[0].a = 1;\n\t\tstops[1].offset = 1;\n\t\tstops[1].r = 1;\n\t\tstops[1].g = 1;\n\t\tstops[1].b = 1;\n\t\tstops[1].a = 1;\n\t\treturn 2;\n\t}\n\n\tif (count == maxcount)\n\t\tfz_warn(doc->ctx, \"gradient brush exceeded maximum number of gradient stops\");\n\n\t/* Postprocess to make sure the range of offsets is 0.0 to 1.0 */\n\n\tqsort(stops, count, sizeof(struct stop), cmp_stop);\n\n\tbefore = -1;\n\tafter = -1;\n\n\tfor (i = 0; i < count; i++)\n\t{\n\t\tif (stops[i].offset < 0)\n\t\t\tbefore = i;\n\t\tif (stops[i].offset > 1)\n\t\t{\n\t\t\tafter = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/* Remove all stops < 0 except the largest one */\n\tif (before > 0)\n\t{\n\t\tmemmove(stops, stops + before, (count - before) * sizeof(struct stop));\n\t\tcount -= before;\n\t}\n\n\t/* Remove all stops > 1 except the smallest one */\n\tif (after >= 0)\n\t\tcount = after + 1;\n\n\t/* Expand single stop to 0 .. 1 */\n\tif (count == 1)\n\t{\n\t\tstops[1] = stops[0];\n\t\tstops[0].offset = 0;\n\t\tstops[1].offset = 1;\n\t\treturn 2;\n\t}\n\n\t/* First stop < 0 -- interpolate value to 0 */\n\tif (stops[0].offset < 0)\n\t{\n\t\tfloat d = -stops[0].offset / (stops[1].offset - stops[0].offset);\n\t\tstops[0].offset = 0;\n\t\tstops[0].r = lerp(stops[0].r, stops[1].r, d);\n\t\tstops[0].g = lerp(stops[0].g, stops[1].g, d);\n\t\tstops[0].b = lerp(stops[0].b, stops[1].b, d);\n\t\tstops[0].a = lerp(stops[0].a, stops[1].a, d);\n\t}\n\n\t/* Last stop > 1 -- interpolate value to 1 */\n\tif (stops[count-1].offset > 1)\n\t{\n\t\tfloat d = (1 - stops[count-2].offset) / (stops[count-1].offset - stops[count-2].offset);\n\t\tstops[count-1].offset = 1;\n\t\tstops[count-1].r = lerp(stops[count-2].r, stops[count-1].r, d);\n\t\tstops[count-1].g = lerp(stops[count-2].g, stops[count-1].g, d);\n\t\tstops[count-1].b = lerp(stops[count-2].b, stops[count-1].b, d);\n\t\tstops[count-1].a = lerp(stops[count-2].a, stops[count-1].a, d);\n\t}\n\n\t/* First stop > 0 -- insert a duplicate at 0 */\n\tif (stops[0].offset > 0)\n\t{\n\t\tmemmove(stops + 1, stops, count * sizeof(struct stop));\n\t\tstops[0] = stops[1];\n\t\tstops[0].offset = 0;\n\t\tcount++;\n\t}\n\n\t/* Last stop < 1 -- insert a duplicate at 1 */\n\tif (stops[count-1].offset < 1)\n\t{\n\t\tstops[count] = stops[count-1];\n\t\tstops[count].offset = 1;\n\t\tcount++;\n\t}\n\n\treturn count;\n}\n\nstatic void\nxps_sample_gradient_stops(fz_shade *shade, struct stop *stops, int count)\n{\n\tfloat offset, d;\n\tint i, k;\n\n\tk = 0;\n\tfor (i = 0; i < 256; i++)\n\t{\n\t\toffset = i / 255.0f;\n\t\twhile (k + 1 < count && offset > stops[k+1].offset)\n\t\t\tk++;\n\n\t\td = (offset - stops[k].offset) / (stops[k+1].offset - stops[k].offset);\n\n\t\tshade->function[i][0] = lerp(stops[k].r, stops[k+1].r, d);\n\t\tshade->function[i][1] = lerp(stops[k].g, stops[k+1].g, d);\n\t\tshade->function[i][2] = lerp(stops[k].b, stops[k+1].b, d);\n\t\tshade->function[i][3] = lerp(stops[k].a, stops[k+1].a, d);\n\t}\n}\n\n/*\n * Radial gradients map more or less to Radial shadings.\n * The inner circle is always a point.\n * The outer circle is actually an ellipse,\n * mess with the transform to squash the circle into the right aspect.\n */\n\nstatic void\nxps_draw_one_radial_gradient(xps_document *doc, const fz_matrix *ctm,\n\tstruct stop *stops, int count,\n\tint extend,\n\tfloat x0, float y0, float r0,\n\tfloat x1, float y1, float r1)\n{\n\tfz_shade *shade;\n\n\t/* TODO: this (and the stuff in pdf_shade) should move to res_shade.c */\n\tshade = fz_malloc_struct(doc->ctx, fz_shade);\n\tFZ_INIT_STORABLE(shade, 1, fz_free_shade_imp);\n\tshade->colorspace = fz_device_rgb(doc->ctx);\n\tshade->bbox = fz_infinite_rect;\n\tshade->matrix = fz_identity;\n\tshade->use_background = 0;\n\tshade->use_function = 1;\n\tshade->type = FZ_RADIAL;\n\tshade->u.l_or_r.extend[0] = extend;\n\tshade->u.l_or_r.extend[1] = extend;\n\n\txps_sample_gradient_stops(shade, stops, count);\n\n\tshade->u.l_or_r.coords[0][0] = x0;\n\tshade->u.l_or_r.coords[0][1] = y0;\n\tshade->u.l_or_r.coords[0][2] = r0;\n\tshade->u.l_or_r.coords[1][0] = x1;\n\tshade->u.l_or_r.coords[1][1] = y1;\n\tshade->u.l_or_r.coords[1][2] = r1;\n\n\tfz_fill_shade(doc->dev, shade, ctm, 1);\n\n\tfz_drop_shade(doc->ctx, shade);\n}\n\n/*\n * Linear gradients.\n */\n\nstatic void\nxps_draw_one_linear_gradient(xps_document *doc, const fz_matrix *ctm,\n\tstruct stop *stops, int count,\n\tint extend,\n\tfloat x0, float y0, float x1, float y1)\n{\n\tfz_shade *shade;\n\n\t/* TODO: this (and the stuff in pdf_shade) should move to res_shade.c */\n\tshade = fz_malloc_struct(doc->ctx, fz_shade);\n\tFZ_INIT_STORABLE(shade, 1, fz_free_shade_imp);\n\tshade->colorspace = fz_device_rgb(doc->ctx);\n\tshade->bbox = fz_infinite_rect;\n\tshade->matrix = fz_identity;\n\tshade->use_background = 0;\n\tshade->use_function = 1;\n\tshade->type = FZ_LINEAR;\n\tshade->u.l_or_r.extend[0] = extend;\n\tshade->u.l_or_r.extend[1] = extend;\n\n\txps_sample_gradient_stops(shade, stops, count);\n\n\tshade->u.l_or_r.coords[0][0] = x0;\n\tshade->u.l_or_r.coords[0][1] = y0;\n\tshade->u.l_or_r.coords[0][2] = 0;\n\tshade->u.l_or_r.coords[1][0] = x1;\n\tshade->u.l_or_r.coords[1][1] = y1;\n\tshade->u.l_or_r.coords[1][2] = 0;\n\n\tfz_fill_shade(doc->dev, shade, ctm, doc->opacity[doc->opacity_top]);\n\n\tfz_drop_shade(doc->ctx, shade);\n}\n\n/*\n * We need to loop and create many shading objects to account\n * for the Repeat and Reflect SpreadMethods.\n * I'm not smart enough to calculate this analytically\n * so we iterate and check each object until we\n * reach a reasonable limit for infinite cases.\n */\n\nstatic inline float point_inside_circle(float px, float py, float x, float y, float r)\n{\n\tfloat dx = px - x;\n\tfloat dy = py - y;\n\treturn dx * dx + dy * dy <= r * r;\n}\n\nstatic void\nxps_draw_radial_gradient(xps_document *doc, const fz_matrix *ctm, const fz_rect *area,\n\tstruct stop *stops, int count,\n\tfz_xml *root, int spread)\n{\n\tfloat x0, y0, r0;\n\tfloat x1, y1, r1;\n\tfloat xrad = 1;\n\tfloat yrad = 1;\n\tfloat invscale;\n\tint i, ma = 1;\n\tfz_matrix local_ctm = *ctm;\n\tfz_matrix inv;\n\tfz_rect local_area = *area;\n\n\tchar *center_att = fz_xml_att(root, \"Center\");\n\tchar *origin_att = fz_xml_att(root, \"GradientOrigin\");\n\tchar *radius_x_att = fz_xml_att(root, \"RadiusX\");\n\tchar *radius_y_att = fz_xml_att(root, \"RadiusY\");\n\n\tx0 = y0 = 0.0;\n\tx1 = y1 = 1.0;\n\txrad = 1.0;\n\tyrad = 1.0;\n\n\tif (origin_att)\n\t\txps_parse_point(origin_att, &x0, &y0);\n\tif (center_att)\n\t\txps_parse_point(center_att, &x1, &y1);\n\tif (radius_x_att)\n\t\txrad = fz_atof(radius_x_att);\n\tif (radius_y_att)\n\t\tyrad = fz_atof(radius_y_att);\n\n\txrad = fz_max(0.01f, xrad);\n\tyrad = fz_max(0.01f, yrad);\n\n\t/* scale the ctm to make ellipses */\n\tif (fz_abs(xrad) > FLT_EPSILON)\n\t{\n\t\tfz_pre_scale(&local_ctm, 1, yrad/xrad);\n\t}\n\n\tif (yrad != 0.0)\n\t{\n\t\tinvscale = xrad / yrad;\n\t\ty0 = y0 * invscale;\n\t\ty1 = y1 * invscale;\n\t}\n\n\tr0 = 0;\n\tr1 = xrad;\n\n\tfz_transform_rect(&local_area, fz_invert_matrix(&inv, &local_ctm));\n\tma = fz_maxi(ma, ceilf(hypotf(local_area.x0 - x0, local_area.y0 - y0) / xrad));\n\tma = fz_maxi(ma, ceilf(hypotf(local_area.x1 - x0, local_area.y0 - y0) / xrad));\n\tma = fz_maxi(ma, ceilf(hypotf(local_area.x0 - x0, local_area.y1 - y0) / xrad));\n\tma = fz_maxi(ma, ceilf(hypotf(local_area.x1 - x0, local_area.y1 - y0) / xrad));\n\n\tif (spread == SPREAD_REPEAT)\n\t{\n\t\tfor (i = ma - 1; i >= 0; i--)\n\t\t\txps_draw_one_radial_gradient(doc, &local_ctm, stops, count, 0, x0, y0, r0 + i * xrad, x1, y1, r1 + i * xrad);\n\t}\n\telse if (spread == SPREAD_REFLECT)\n\t{\n\t\tif ((ma % 2) != 0)\n\t\t\tma++;\n\t\tfor (i = ma - 2; i >= 0; i -= 2)\n\t\t{\n\t\t\txps_draw_one_radial_gradient(doc, &local_ctm, stops, count, 0, x0, y0, r0 + i * xrad, x1, y1, r1 + i * xrad);\n\t\t\txps_draw_one_radial_gradient(doc, &local_ctm, stops, count, 0, x0, y0, r0 + (i + 2) * xrad, x1, y1, r1 + i * xrad);\n\t\t}\n\t}\n\telse\n\t{\n\t\txps_draw_one_radial_gradient(doc, &local_ctm, stops, count, 1, x0, y0, r0, x1, y1, r1);\n\t}\n}\n\n/*\n * Calculate how many iterations are needed to cover\n * the bounding box.\n */\n\nstatic void\nxps_draw_linear_gradient(xps_document *doc, const fz_matrix *ctm, const fz_rect *area,\n\tstruct stop *stops, int count,\n\tfz_xml *root, int spread)\n{\n\tfloat x0, y0, x1, y1;\n\tint i, mi, ma;\n\tfloat dx, dy, x, y, k;\n\tfz_point p1, p2;\n\tfz_matrix inv;\n\tfz_rect local_area = *area;\n\n\tchar *start_point_att = fz_xml_att(root, \"StartPoint\");\n\tchar *end_point_att = fz_xml_att(root, \"EndPoint\");\n\n\tx0 = y0 = 0;\n\tx1 = y1 = 1;\n\n\tif (start_point_att)\n\t\txps_parse_point(start_point_att, &x0, &y0);\n\tif (end_point_att)\n\t\txps_parse_point(end_point_att, &x1, &y1);\n\n\tp1.x = x0; p1.y = y0; p2.x = x1; p2.y = y1;\n\tfz_transform_rect(&local_area, fz_invert_matrix(&inv, ctm));\n\tx = p2.x - p1.x; y = p2.y - p1.y;\n\tk = ((local_area.x0 - p1.x) * x + (local_area.y0 - p1.y) * y) / (x * x + y * y);\n\tmi = floorf(k); ma = ceilf(k);\n\tk = ((local_area.x1 - p1.x) * x + (local_area.y0 - p1.y) * y) / (x * x + y * y);\n\tmi = fz_mini(mi, floorf(k)); ma = fz_maxi(ma, ceilf(k));\n\tk = ((local_area.x0 - p1.x) * x + (local_area.y1 - p1.y) * y) / (x * x + y * y);\n\tmi = fz_mini(mi, floorf(k)); ma = fz_maxi(ma, ceilf(k));\n\tk = ((local_area.x1 - p1.x) * x + (local_area.y1 - p1.y) * y) / (x * x + y * y);\n\tmi = fz_mini(mi, floorf(k)); ma = fz_maxi(ma, ceilf(k));\n\tdx = x1 - x0; dy = y1 - y0;\n\n\tif (spread == SPREAD_REPEAT)\n\t{\n\t\tfor (i = mi; i < ma; i++)\n\t\t\txps_draw_one_linear_gradient(doc, ctm, stops, count, 0, x0 + i * dx, y0 + i * dy, x1 + i * dx, y1 + i * dy);\n\t}\n\telse if (spread == SPREAD_REFLECT)\n\t{\n\t\tif ((mi % 2) != 0)\n\t\t\tmi--;\n\t\tfor (i = mi; i < ma; i += 2)\n\t\t{\n\t\t\txps_draw_one_linear_gradient(doc, ctm, stops, count, 0, x0 + i * dx, y0 + i * dy, x1 + i * dx, y1 + i * dy);\n\t\t\txps_draw_one_linear_gradient(doc, ctm, stops, count, 0, x0 + (i + 2) * dx, y0 + (i + 2) * dy, x1 + i * dx, y1 + i * dy);\n\t\t}\n\t}\n\telse\n\t{\n\t\txps_draw_one_linear_gradient(doc, ctm, stops, count, 1, x0, y0, x1, y1);\n\t}\n}\n\n/*\n * Parse XML tag and attributes for a gradient brush, create color/opacity\n * function objects and call gradient drawing primitives.\n */\n\nstatic void\nxps_parse_gradient_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *area,\n\tchar *base_uri, xps_resource *dict, fz_xml *root,\n\tvoid (*draw)(xps_document *, const fz_matrix*, const fz_rect *, struct stop *, int, fz_xml *, int))\n{\n\tfz_xml *node;\n\n\tchar *opacity_att;\n\tchar *spread_att;\n\tchar *transform_att;\n\n\tfz_xml *transform_tag = NULL;\n\tfz_xml *stop_tag = NULL;\n\n\tstruct stop stop_list[MAX_STOPS];\n\tint stop_count;\n\tfz_matrix transform;\n\tint spread_method;\n\n\topacity_att = fz_xml_att(root, \"Opacity\");\n\tspread_att = fz_xml_att(root, \"SpreadMethod\");\n\ttransform_att = fz_xml_att(root, \"Transform\");\n\n\tfor (node = fz_xml_down(root); node; node = fz_xml_next(node))\n\t{\n\t\tif (fz_xml_is_tag(node, \"LinearGradientBrush.Transform\"))\n\t\t\ttransform_tag = fz_xml_down(node);\n\t\tif (fz_xml_is_tag(node, \"RadialGradientBrush.Transform\"))\n\t\t\ttransform_tag = fz_xml_down(node);\n\t\tif (fz_xml_is_tag(node, \"LinearGradientBrush.GradientStops\"))\n\t\t\tstop_tag = fz_xml_down(node);\n\t\tif (fz_xml_is_tag(node, \"RadialGradientBrush.GradientStops\"))\n\t\t\tstop_tag = fz_xml_down(node);\n\t}\n\n\txps_resolve_resource_reference(doc, dict, &transform_att, &transform_tag, NULL);\n\n\tspread_method = SPREAD_PAD;\n\tif (spread_att)\n\t{\n\t\tif (!strcmp(spread_att, \"Pad\"))\n\t\t\tspread_method = SPREAD_PAD;\n\t\tif (!strcmp(spread_att, \"Reflect\"))\n\t\t\tspread_method = SPREAD_REFLECT;\n\t\tif (!strcmp(spread_att, \"Repeat\"))\n\t\t\tspread_method = SPREAD_REPEAT;\n\t}\n\n\ttransform = fz_identity;\n\tif (transform_att)\n\t\txps_parse_render_transform(doc, transform_att, &transform);\n\tif (transform_tag)\n\t\txps_parse_matrix_transform(doc, transform_tag, &transform);\n\tfz_concat(&transform, &transform, ctm);\n\n\tif (!stop_tag) {\n\t\tfz_warn(doc->ctx, \"missing gradient stops tag\");\n\t\treturn;\n\t}\n\n\tstop_count = xps_parse_gradient_stops(doc, base_uri, stop_tag, stop_list, MAX_STOPS);\n\tif (stop_count == 0)\n\t{\n\t\tfz_warn(doc->ctx, \"no gradient stops found\");\n\t\treturn;\n\t}\n\n\txps_begin_opacity(doc, &transform, area, base_uri, dict, opacity_att, NULL);\n\n\tdraw(doc, &transform, area, stop_list, stop_count, root, spread_method);\n\n\txps_end_opacity(doc, base_uri, dict, opacity_att, NULL);\n}\n\nvoid\nxps_parse_linear_gradient_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *area,\n\tchar *base_uri, xps_resource *dict, fz_xml *root)\n{\n\txps_parse_gradient_brush(doc, ctm, area, base_uri, dict, root, xps_draw_linear_gradient);\n}\n\nvoid\nxps_parse_radial_gradient_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *area,\n\tchar *base_uri, xps_resource *dict, fz_xml *root)\n{\n\txps_parse_gradient_brush(doc, ctm, area, base_uri, dict, root, xps_draw_radial_gradient);\n}\n"
  },
  {
    "path": "mupdf/source/xps/xps-image.c",
    "content": "#include \"mupdf/xps.h\"\n\nstatic fz_image *\nxps_load_image(fz_context *ctx, xps_part *part)\n{\n\t/* Ownership of data always passes in here */\n\tunsigned char *data = part->data;\n\tpart->data = NULL;\n\treturn fz_new_image_from_data(ctx, data, part->size);\n}\n\n/* FIXME: area unused! */\nstatic void\nxps_paint_image_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, char *base_uri, xps_resource *dict,\n\tfz_xml *root, void *vimage)\n{\n\tfz_image *image = vimage;\n\tfloat xs, ys;\n\tfz_matrix local_ctm = *ctm;\n\n\tif (image->xres == 0 || image->yres == 0)\n\t\treturn;\n\txs = image->w * 96 / image->xres;\n\tys = image->h * 96 / image->yres;\n\tfz_pre_scale(&local_ctm, xs, ys);\n\tfz_fill_image(doc->dev, image, &local_ctm, doc->opacity[doc->opacity_top]);\n}\n\nstatic void\nxps_find_image_brush_source_part(xps_document *doc, char *base_uri, fz_xml *root, xps_part **image_part, xps_part **profile_part)\n{\n\tchar *image_source_att;\n\tchar buf[1024];\n\tchar partname[1024];\n\tchar *image_name;\n\tchar *profile_name;\n\tchar *p;\n\n\timage_source_att = fz_xml_att(root, \"ImageSource\");\n\tif (!image_source_att)\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"cannot find image source attribute\");\n\n\t/* \"{ColorConvertedBitmap /Resources/Image.tiff /Resources/Profile.icc}\" */\n\tif (strstr(image_source_att, \"{ColorConvertedBitmap\") == image_source_att)\n\t{\n\t\timage_name = NULL;\n\t\tprofile_name = NULL;\n\n\t\tfz_strlcpy(buf, image_source_att, sizeof buf);\n\t\tp = strchr(buf, ' ');\n\t\tif (p)\n\t\t{\n\t\t\timage_name = p + 1;\n\t\t\tp = strchr(p + 1, ' ');\n\t\t\tif (p)\n\t\t\t{\n\t\t\t\t*p = 0;\n\t\t\t\tprofile_name = p + 1;\n\t\t\t\tp = strchr(p + 1, '}');\n\t\t\t\tif (p)\n\t\t\t\t\t*p = 0;\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\timage_name = image_source_att;\n\t\tprofile_name = NULL;\n\t}\n\n\tif (!image_name)\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"cannot find image source\");\n\n\tif (image_part)\n\t{\n\t\txps_resolve_url(partname, base_uri, image_name, sizeof partname);\n\t\t*image_part = xps_read_part(doc, partname);\n\t}\n\n\tif (profile_part)\n\t{\n\t\tif (profile_name)\n\t\t{\n\t\t\txps_resolve_url(partname, base_uri, profile_name, sizeof partname);\n\t\t\t*profile_part = xps_read_part(doc, partname);\n\t\t}\n\t\telse\n\t\t\t*profile_part = NULL;\n\t}\n}\n\n/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=2094 */\ntypedef struct {\n\tfz_storable storable;\n\tchar *part_name;\n} xps_image_key;\n\nstatic void\nxps_free_image_key(fz_context *ctx, fz_storable *key)\n{\n\tfz_free(ctx, ((xps_image_key *)key)->part_name);\n\tfz_free(ctx, key);\n}\n\nstatic xps_image_key *\nxps_new_image_key(fz_context *ctx, char *name)\n{\n\txps_image_key *key = fz_malloc_struct(ctx, xps_image_key);\n\tkey->part_name = fz_strdup(ctx, name);\n\tFZ_INIT_STORABLE(key, 1, xps_free_image_key);\n\treturn key;\n}\n\nstatic int\nxps_cmp_image_key(void *k1, void *k2)\n{\n\treturn strcmp(((xps_image_key *)k1)->part_name, ((xps_image_key *)k2)->part_name);\n}\n\n#ifndef NDEBUG\nstatic void\nxps_debug_image(FILE *out, void *key)\n{\n\tfprintf(out, \"(image part=%s) \", ((xps_image_key *)key)->part_name);\n}\n#endif\n\nstatic fz_store_type xps_image_store_type =\n{\n\tNULL,\n\tfz_keep_storable,\n\tfz_drop_storable,\n\txps_cmp_image_key,\n#ifndef NDEBUG\n\txps_debug_image\n#endif\n};\n\nvoid\nxps_parse_image_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *area,\n\tchar *base_uri, xps_resource *dict, fz_xml *root)\n{\n\txps_part *part;\n\tfz_image *image;\n\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=2094 */\n\txps_image_key *key = NULL;\n\tfz_var(key);\n\n\tfz_try(doc->ctx)\n\t{\n\t\txps_find_image_brush_source_part(doc, base_uri, root, &part, NULL);\n\t}\n\tfz_catch(doc->ctx)\n\t{\n\t\tfz_rethrow_if(doc->ctx, FZ_ERROR_TRYLATER);\n\t\tfz_warn(doc->ctx, \"cannot find image source\");\n\t\treturn;\n\t}\n\n\tfz_try(doc->ctx)\n\t{\n\t\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=2094 */\n\t\tkey = xps_new_image_key(doc->ctx, part->name);\n\t\tif ((image = fz_find_item(doc->ctx, fz_free_image, key, &xps_image_store_type)) == NULL)\n\t\t{\n\n\t\timage = xps_load_image(doc->ctx, part);\n\t\timage->invert_cmyk_jpeg = 1;\n\n\t\t\tfz_store_item(doc->ctx, key, image, sizeof(fz_image) + part->size, &xps_image_store_type);\n\t\t}\n\t}\n\tfz_always(doc->ctx)\n\t{\n\t\tfz_drop_storable(doc->ctx, &key->storable);\n\t\txps_free_part(doc, part);\n\t}\n\tfz_catch(doc->ctx)\n\t{\n\t\tfz_rethrow_if(doc->ctx, FZ_ERROR_TRYLATER);\n\t\tfz_warn(doc->ctx, \"cannot decode image resource\");\n\t\treturn;\n\t}\n\n\txps_parse_tiling_brush(doc, ctm, area, base_uri, dict, root, xps_paint_image_brush, image);\n\n\tfz_drop_image(doc->ctx, image);\n}\n"
  },
  {
    "path": "mupdf/source/xps/xps-outline.c",
    "content": "#include \"mupdf/xps.h\"\n\n/*\n * Parse the document structure / outline parts referenced from fixdoc relationships.\n */\n\nstatic fz_outline *\nxps_lookup_last_outline_at_level(fz_outline *node, int level, int target_level)\n{\n\twhile (node->next)\n\t\tnode = node->next;\n\tif (level == target_level || !node->down)\n\t\treturn node;\n\treturn xps_lookup_last_outline_at_level(node->down, level + 1, target_level);\n}\n\nstatic fz_outline *\nxps_parse_document_outline(xps_document *doc, fz_xml *root)\n{\n\tfz_xml *node;\n\tfz_outline *head = NULL, *entry, *tail;\n\tint last_level = 1, this_level;\n\tfor (node = fz_xml_down(root); node; node = fz_xml_next(node))\n\t{\n\t\tif (fz_xml_is_tag(node, \"OutlineEntry\"))\n\t\t{\n\t\t\tchar *level = fz_xml_att(node, \"OutlineLevel\");\n\t\t\tchar *target = fz_xml_att(node, \"OutlineTarget\");\n\t\t\tchar *description = fz_xml_att(node, \"Description\");\n\t\t\t/* SumatraPDF: allow target-less outline entries */\n\t\t\tif (!description)\n\t\t\t\tcontinue;\n\n\t\t\tentry = fz_malloc_struct(doc->ctx, fz_outline);\n\t\t\tentry->title = fz_strdup(doc->ctx, description);\n\t\t\t/* SumatraPDF: extended outline actions */\n\t\t\tif (!target)\n\t\t\t\tentry->dest.kind = FZ_LINK_NONE;\n\t\t\telse if (!xps_url_is_remote(target))\n\t\t\t{\n\t\t\t\tentry->dest.kind = FZ_LINK_GOTO;\n\t\t\t\tentry->dest.ld.gotor.page = xps_lookup_link_target(doc, target);\n\t\t\t\t/* for retrieving updated target rectangles */\n\t\t\t\tentry->dest.ld.gotor.dest = fz_strdup(doc->ctx, target);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tentry->dest.kind = FZ_LINK_URI;\n\t\t\t\tentry->dest.ld.uri.uri = fz_strdup(doc->ctx, target);\n\t\t\t\tentry->dest.ld.uri.is_map = 0;\n\t\t\t}\n\t\t\tentry->down = NULL;\n\t\t\tentry->next = NULL;\n\n\t\t\tthis_level = level ? atoi(level) : 1;\n\n\t\t\tif (!head)\n\t\t\t{\n\t\t\t\thead = entry;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttail = xps_lookup_last_outline_at_level(head, 1, this_level);\n\t\t\t\tif (this_level > last_level)\n\t\t\t\t\ttail->down = entry;\n\t\t\t\telse\n\t\t\t\t\ttail->next = entry;\n\t\t\t}\n\n\t\t\tlast_level = this_level;\n\t\t}\n\t}\n\t/* SumatraPDF: support expansion states */\n\tif (head && (!head->next || !head->next->next))\n\t{\n\t\thead->is_open = 1;\n\t\tif (head->next)\n\t\t\thead->next->is_open = 1;\n\t}\n\treturn head;\n}\n\nstatic fz_outline *\nxps_parse_document_structure(xps_document *doc, fz_xml *root)\n{\n\tfz_xml *node;\n\tif (fz_xml_is_tag(root, \"DocumentStructure\"))\n\t{\n\t\tnode = fz_xml_down(root);\n\t\tif (node && fz_xml_is_tag(node, \"DocumentStructure.Outline\"))\n\t\t{\n\t\t\tnode = fz_xml_down(node);\n\t\t\tif (node && fz_xml_is_tag(node, \"DocumentOutline\"))\n\t\t\t\treturn xps_parse_document_outline(doc, node);\n\t\t}\n\t}\n\treturn NULL;\n}\n\nstatic fz_outline *\nxps_load_document_structure(xps_document *doc, xps_fixdoc *fixdoc)\n{\n\txps_part *part;\n\tfz_xml *root;\n\tfz_outline *outline;\n\n\tpart = xps_read_part(doc, fixdoc->outline);\n\tfz_try(doc->ctx)\n\t{\n\t\troot = fz_parse_xml(doc->ctx, part->data, part->size, 0);\n\t}\n\tfz_always(doc->ctx)\n\t{\n\t\txps_free_part(doc, part);\n\t}\n\tfz_catch(doc->ctx)\n\t{\n\t\tfz_rethrow(doc->ctx);\n\t}\n\tif (!root)\n\t\treturn NULL;\n\n\tfz_try(doc->ctx)\n\t{\n\t\toutline = xps_parse_document_structure(doc, root);\n\t}\n\tfz_always(doc->ctx)\n\t{\n\t\tfz_free_xml(doc->ctx, root);\n\t}\n\tfz_catch(doc->ctx)\n\t{\n\t\tfz_rethrow(doc->ctx);\n\t}\n\n\treturn outline;\n}\n\nfz_outline *\nxps_load_outline(xps_document *doc)\n{\n\txps_fixdoc *fixdoc;\n\tfz_outline *head = NULL, *tail, *outline;\n\n\tfor (fixdoc = doc->first_fixdoc; fixdoc; fixdoc = fixdoc->next)\n\t{\n\t\tif (fixdoc->outline)\n\t\t{\n\t\t\tfz_try(doc->ctx)\n\t\t\t{\n\t\t\t\toutline = xps_load_document_structure(doc, fixdoc);\n\t\t\t}\n\t\t\tfz_catch(doc->ctx)\n\t\t\t{\n\t\t\t\tfz_rethrow_if(doc->ctx, FZ_ERROR_TRYLATER);\n\t\t\t\toutline = NULL;\n\t\t\t}\n\t\t\tif (!outline)\n\t\t\t\tcontinue;\n\n\t\t\tif (!head)\n\t\t\t\thead = outline;\n\t\t\telse\n\t\t\t{\n\t\t\t\twhile (tail->next)\n\t\t\t\t\ttail = tail->next;\n\t\t\t\ttail->next = outline;\n\t\t\t}\n\t\t\ttail = outline;\n\t\t}\n\t}\n\treturn head;\n}\n\n/* SumatraPDF: extended link support */\n\nvoid\nxps_extract_anchor_info(xps_document *doc, const fz_rect *rect, char *target_uri, char *anchor_name, int step)\n{\n\tfz_link *new_link = NULL;\n\n\tif (!doc->current_page || doc->current_page->links_resolved)\n\t\treturn;\n\tassert((step != 2 || !target_uri) && (step != 1 || !anchor_name));\n\n\tif (target_uri)\n\t{\n\t\tfz_link_dest ld = { 0 };\n\t\tif (!xps_url_is_remote(target_uri))\n\t\t{\n\t\t\tld.kind = FZ_LINK_GOTO;\n\t\t\tld.ld.gotor.page = xps_lookup_link_target(doc, target_uri);\n\t\t\t/* for retrieving updated target rectangles */\n\t\t\tld.ld.gotor.dest = fz_strdup(doc->ctx, target_uri);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tld.kind = FZ_LINK_URI;\n\t\t\tld.ld.uri.uri = fz_strdup(doc->ctx, target_uri);\n\t\t\tld.ld.uri.is_map = 0;\n\t\t}\n\t\tnew_link = fz_new_link(doc->ctx, rect, ld);\n\t\tnew_link->next = doc->current_page->links;\n\t\tdoc->current_page->links = new_link;\n\t}\n\n\t/* canvas bounds estimates for link and target positioning */\n\tif (step == 1 && ++doc->_clinks_len <= nelem(doc->_clinks)) // canvas begin\n\t{\n\t\tdoc->_clinks[doc->_clinks_len-1].rect = fz_empty_rect;\n\t\tdoc->_clinks[doc->_clinks_len-1].link = new_link;\n\t}\n\tif (step == 2 && doc->_clinks_len-- <= nelem(doc->_clinks)) // canvas end\n\t{\n\t\tif (!fz_is_empty_rect(&doc->_clinks[doc->_clinks_len].rect))\n\t\t\trect = &doc->_clinks[doc->_clinks_len].rect;\n\t\tif (doc->_clinks[doc->_clinks_len].link)\n\t\t\tdoc->_clinks[doc->_clinks_len].link->rect = *rect;\n\t}\n\tif (step != 1 && doc->_clinks_len > 0 && doc->_clinks_len <= nelem(doc->_clinks))\n\t\tfz_union_rect(&doc->_clinks[doc->_clinks_len-1].rect, rect);\n\n\tif (anchor_name)\n\t{\n\t\txps_target *target;\n\t\tchar *value_id = fz_malloc(doc->ctx, strlen(anchor_name) + 2);\n\t\tsprintf(value_id, \"#%s\", anchor_name);\n\t\ttarget = xps_lookup_link_target_obj(doc, value_id);\n\t\tif (target)\n\t\t\ttarget->rect = *rect;\n\t\tfz_free(doc->ctx, value_id);\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/xps/xps-path.c",
    "content": "#include \"mupdf/xps.h\"\n\nstatic char *\nxps_parse_float_array(char *s, int num, float *x)\n{\n\tint k = 0;\n\n\tif (s == NULL || *s == 0)\n\t\treturn NULL;\n\n\twhile (*s)\n\t{\n\t\twhile (*s == 0x0d || *s == '\\t' || *s == ' ' || *s == 0x0a)\n\t\t\ts++;\n\t\tx[k] = (float)fz_strtod(s, &s);\n\t\twhile (*s == 0x0d || *s == '\\t' || *s == ' ' || *s == 0x0a)\n\t\t\ts++;\n\t\tif (*s == ',')\n\t\t\ts++;\n\t\tif (++k == num)\n\t\t\tbreak;\n\t}\n\treturn s;\n}\n\nchar *\nxps_parse_point(char *s_in, float *x, float *y)\n{\n\tchar *s_out = s_in;\n\tfloat xy[2];\n\n\ts_out = xps_parse_float_array(s_out, 2, &xy[0]);\n\t*x = xy[0];\n\t*y = xy[1];\n\treturn s_out;\n}\n\n/* Draw an arc segment transformed by the matrix, we approximate with straight\n * line segments. We cannot use the fz_arc function because they only draw\n * circular arcs, we need to transform the line to make them elliptical but\n * without transforming the line width.\n *\n * We are guaranteed that on entry the point is at the point that would be\n * calculated by th0, and on exit, a point is generated for us at th0.\n */\nstatic void\nxps_draw_arc_segment(fz_context *doc, fz_path *path, const fz_matrix *mtx, float th0, float th1, int iscw)\n{\n\tfloat t, d;\n\tfz_point p;\n\n\twhile (th1 < th0)\n\t\tth1 += (float)M_PI * 2;\n\n\td = (float)M_PI / 180; /* 1-degree precision */\n\n\tif (iscw)\n\t{\n\t\tfor (t = th0 + d; t < th1 - d/2; t += d)\n\t\t{\n\t\t\tfz_transform_point_xy(&p, mtx, cosf(t), sinf(t));\n\t\t\tfz_lineto(doc, path, p.x, p.y);\n\t\t}\n\t}\n\telse\n\t{\n\t\tth0 += (float)M_PI * 2;\n\t\tfor (t = th0 - d; t > th1 + d/2; t -= d)\n\t\t{\n\t\t\tfz_transform_point_xy(&p, mtx, cosf(t), sinf(t));\n\t\t\tfz_lineto(doc, path, p.x, p.y);\n\t\t}\n\t}\n}\n\n/* Given two vectors find the angle between them. */\nstatic float\nangle_between(const fz_point u, const fz_point v)\n{\n\tfloat det = u.x * v.y - u.y * v.x;\n\tfloat sign = (det < 0 ? -1 : 1);\n\tfloat magu = u.x * u.x + u.y * u.y;\n\tfloat magv = v.x * v.x + v.y * v.y;\n\tfloat udotv = u.x * v.x + u.y * v.y;\n\tfloat t = udotv / (magu * magv);\n\t/* guard against rounding errors when near |1| (where acos will return NaN) */\n\tif (t < -1) t = -1;\n\tif (t > 1) t = 1;\n\treturn sign * acosf(t);\n}\n\n/*\n\tSome explaination of the parameters here is warranted. See:\n\n\thttp://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes\n\n\tAdd an arc segment to path, that describes a section of an elliptical\n\tarc from the current point of path to (point_x,point_y), such that:\n\n\tThe arc segment is taken from an elliptical arc of semi major radius\n\tsize_x, semi minor radius size_y, where the semi major axis of the\n\tellipse is rotated by rotation_angle.\n\n\tIf is_large_arc, then the arc segment is selected to be > 180 degrees.\n\n\tIf is_clockwise, then the arc sweeps clockwise.\n*/\nstatic void\nxps_draw_arc(fz_context *doc, fz_path *path,\n\tfloat size_x, float size_y, float rotation_angle,\n\tint is_large_arc, int is_clockwise,\n\tfloat point_x, float point_y)\n{\n\tfz_matrix rotmat, revmat;\n\tfz_matrix mtx;\n\tfz_point pt;\n\tfloat rx, ry;\n\tfloat x1, y1, x2, y2;\n\tfloat x1t, y1t;\n\tfloat cxt, cyt, cx, cy;\n\tfloat t1, t2, t3;\n\tfloat sign;\n\tfloat th1, dth;\n\n\tpt = fz_currentpoint(doc, path);\n\tx1 = pt.x;\n\ty1 = pt.y;\n\tx2 = point_x;\n\ty2 = point_y;\n\trx = size_x;\n\try = size_y;\n\n\tif (is_clockwise != is_large_arc)\n\t\tsign = 1;\n\telse\n\t\tsign = -1;\n\n\tfz_rotate(&rotmat, rotation_angle);\n\tfz_rotate(&revmat, -rotation_angle);\n\n\t/* http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes */\n\t/* Conversion from endpoint to center parameterization */\n\n\t/* F.6.6.1 -- ensure radii are positive and non-zero */\n\trx = fabsf(rx);\n\try = fabsf(ry);\n\tif (rx < 0.001f || ry < 0.001f || (x1 == x2 && y1 == y2))\n\t{\n\t\tfz_lineto(doc, path, x2, y2);\n\t\treturn;\n\t}\n\n\t/* F.6.5.1 */\n\tpt.x = (x1 - x2) / 2;\n\tpt.y = (y1 - y2) / 2;\n\tfz_transform_vector(&pt, &revmat);\n\tx1t = pt.x;\n\ty1t = pt.y;\n\n\t/* F.6.6.2 -- ensure radii are large enough */\n\tt1 = (x1t * x1t) / (rx * rx) + (y1t * y1t) / (ry * ry);\n\tif (t1 > 1)\n\t{\n\t\trx = rx * sqrtf(t1);\n\t\try = ry * sqrtf(t1);\n\t}\n\n\t/* F.6.5.2 */\n\tt1 = (rx * rx * ry * ry) - (rx * rx * y1t * y1t) - (ry * ry * x1t * x1t);\n\tt2 = (rx * rx * y1t * y1t) + (ry * ry * x1t * x1t);\n\tt3 = t1 / t2;\n\t/* guard against rounding errors; sqrt of negative numbers is bad for your health */\n\tif (t3 < 0) t3 = 0;\n\tt3 = sqrtf(t3);\n\n\tcxt = sign * t3 * (rx * y1t) / ry;\n\tcyt = sign * t3 * -(ry * x1t) / rx;\n\n\t/* F.6.5.3 */\n\tpt.x = cxt;\n\tpt.y = cyt;\n\tfz_transform_vector(&pt, &rotmat);\n\tcx = pt.x + (x1 + x2) / 2;\n\tcy = pt.y + (y1 + y2) / 2;\n\n\t/* F.6.5.4 */\n\t{\n\t\tfz_point coord1, coord2, coord3, coord4;\n\t\tcoord1.x = 1;\n\t\tcoord1.y = 0;\n\t\tcoord2.x = (x1t - cxt) / rx;\n\t\tcoord2.y = (y1t - cyt) / ry;\n\t\tcoord3.x = (x1t - cxt) / rx;\n\t\tcoord3.y = (y1t - cyt) / ry;\n\t\tcoord4.x = (-x1t - cxt) / rx;\n\t\tcoord4.y = (-y1t - cyt) / ry;\n\t\tth1 = angle_between(coord1, coord2);\n\t\tdth = angle_between(coord3, coord4);\n\t\tif (dth < 0 && !is_clockwise)\n\t\t\tdth += (((float)M_PI / 180) * 360);\n\t\tif (dth > 0 && is_clockwise)\n\t\t\tdth -= (((float)M_PI / 180) * 360);\n\t}\n\n\tfz_pre_scale(fz_pre_rotate(fz_translate(&mtx, cx, cy), rotation_angle), rx, ry);\n\txps_draw_arc_segment(doc, path, &mtx, th1, th1 + dth, is_clockwise);\n\n\tfz_lineto(doc, path, point_x, point_y);\n}\n\n/*\n * Parse an abbreviated geometry string, and call\n * ghostscript moveto/lineto/curveto functions to\n * build up a path.\n */\n\nstatic fz_path *\nxps_parse_abbreviated_geometry(xps_document *doc, char *geom, int *fill_rule)\n{\n\tfz_path *path;\n\tchar **args;\n\tchar **pargs;\n\tchar *s = geom;\n\tfz_point pt;\n\tint i, n;\n\tint cmd, old;\n\tfloat x1, y1, x2, y2, x3, y3;\n\tfloat smooth_x, smooth_y; /* saved cubic bezier control point for smooth curves */\n\tint reset_smooth;\n\n\tpath = fz_new_path(doc->ctx);\n\n\targs = fz_malloc_array(doc->ctx, strlen(geom) + 1, sizeof(char*));\n\tpargs = args;\n\n\twhile (*s)\n\t{\n\t\tif ((*s >= 'A' && *s <= 'Z') || (*s >= 'a' && *s <= 'z'))\n\t\t{\n\t\t\t*pargs++ = s++;\n\t\t}\n\t\telse if ((*s >= '0' && *s <= '9') || *s == '.' || *s == '+' || *s == '-' || *s == 'e' || *s == 'E')\n\t\t{\n\t\t\t*pargs++ = s;\n\t\t\twhile ((*s >= '0' && *s <= '9') || *s == '.' || *s == '+' || *s == '-' || *s == 'e' || *s == 'E')\n\t\t\t\ts ++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\ts++;\n\t\t}\n\t}\n\n\t*pargs = s;\n\n\tn = pargs - args;\n\ti = 0;\n\n\told = 0;\n\n\treset_smooth = 1;\n\tsmooth_x = 0;\n\tsmooth_y = 0;\n\n\twhile (i < n)\n\t{\n\t\tcmd = args[i][0];\n\t\tif (cmd == '+' || cmd == '.' || cmd == '-' || (cmd >= '0' && cmd <= '9'))\n\t\t\tcmd = old; /* it's a number, repeat old command */\n\t\telse\n\t\t\ti ++;\n\n\t\tif (reset_smooth)\n\t\t{\n\t\t\tsmooth_x = 0;\n\t\t\tsmooth_y = 0;\n\t\t}\n\n\t\treset_smooth = 1;\n\n\t\tswitch (cmd)\n\t\t{\n\t\tcase 'F':\n\t\t\tif (i >= n) break;\n\t\t\t*fill_rule = atoi(args[i]);\n\t\t\ti ++;\n\t\t\tbreak;\n\n\t\tcase 'M':\n\t\t\tif (i + 1 >= n) break;\n\t\t\tfz_moveto(doc->ctx, path, fz_atof(args[i]), fz_atof(args[i+1]));\n\t\t\ti += 2;\n\t\t\tbreak;\n\t\tcase 'm':\n\t\t\tif (i + 1 >= n) break;\n\t\t\tpt = fz_currentpoint(doc->ctx, path);\n\t\t\tfz_moveto(doc->ctx, path, pt.x + fz_atof(args[i]), pt.y + fz_atof(args[i+1]));\n\t\t\ti += 2;\n\t\t\tbreak;\n\n\t\tcase 'L':\n\t\t\tif (i + 1 >= n) break;\n\t\t\tfz_lineto(doc->ctx, path, fz_atof(args[i]), fz_atof(args[i+1]));\n\t\t\ti += 2;\n\t\t\tbreak;\n\t\tcase 'l':\n\t\t\tif (i + 1 >= n) break;\n\t\t\tpt = fz_currentpoint(doc->ctx, path);\n\t\t\tfz_lineto(doc->ctx, path, pt.x + fz_atof(args[i]), pt.y + fz_atof(args[i+1]));\n\t\t\ti += 2;\n\t\t\tbreak;\n\n\t\tcase 'H':\n\t\t\tif (i >= n) break;\n\t\t\tpt = fz_currentpoint(doc->ctx, path);\n\t\t\tfz_lineto(doc->ctx, path, fz_atof(args[i]), pt.y);\n\t\t\ti += 1;\n\t\t\tbreak;\n\t\tcase 'h':\n\t\t\tif (i >= n) break;\n\t\t\tpt = fz_currentpoint(doc->ctx, path);\n\t\t\tfz_lineto(doc->ctx, path, pt.x + fz_atof(args[i]), pt.y);\n\t\t\ti += 1;\n\t\t\tbreak;\n\n\t\tcase 'V':\n\t\t\tif (i >= n) break;\n\t\t\tpt = fz_currentpoint(doc->ctx, path);\n\t\t\tfz_lineto(doc->ctx, path, pt.x, fz_atof(args[i]));\n\t\t\ti += 1;\n\t\t\tbreak;\n\t\tcase 'v':\n\t\t\tif (i >= n) break;\n\t\t\tpt = fz_currentpoint(doc->ctx, path);\n\t\t\tfz_lineto(doc->ctx, path, pt.x, pt.y + fz_atof(args[i]));\n\t\t\ti += 1;\n\t\t\tbreak;\n\n\t\tcase 'C':\n\t\t\tif (i + 5 >= n) break;\n\t\t\tx1 = fz_atof(args[i+0]);\n\t\t\ty1 = fz_atof(args[i+1]);\n\t\t\tx2 = fz_atof(args[i+2]);\n\t\t\ty2 = fz_atof(args[i+3]);\n\t\t\tx3 = fz_atof(args[i+4]);\n\t\t\ty3 = fz_atof(args[i+5]);\n\t\t\tfz_curveto(doc->ctx, path, x1, y1, x2, y2, x3, y3);\n\t\t\ti += 6;\n\t\t\treset_smooth = 0;\n\t\t\tsmooth_x = x3 - x2;\n\t\t\tsmooth_y = y3 - y2;\n\t\t\tbreak;\n\n\t\tcase 'c':\n\t\t\tif (i + 5 >= n) break;\n\t\t\tpt = fz_currentpoint(doc->ctx, path);\n\t\t\tx1 = fz_atof(args[i+0]) + pt.x;\n\t\t\ty1 = fz_atof(args[i+1]) + pt.y;\n\t\t\tx2 = fz_atof(args[i+2]) + pt.x;\n\t\t\ty2 = fz_atof(args[i+3]) + pt.y;\n\t\t\tx3 = fz_atof(args[i+4]) + pt.x;\n\t\t\ty3 = fz_atof(args[i+5]) + pt.y;\n\t\t\tfz_curveto(doc->ctx, path, x1, y1, x2, y2, x3, y3);\n\t\t\ti += 6;\n\t\t\treset_smooth = 0;\n\t\t\tsmooth_x = x3 - x2;\n\t\t\tsmooth_y = y3 - y2;\n\t\t\tbreak;\n\n\t\tcase 'S':\n\t\t\tif (i + 3 >= n) break;\n\t\t\tpt = fz_currentpoint(doc->ctx, path);\n\t\t\tx1 = fz_atof(args[i+0]);\n\t\t\ty1 = fz_atof(args[i+1]);\n\t\t\tx2 = fz_atof(args[i+2]);\n\t\t\ty2 = fz_atof(args[i+3]);\n\t\t\tfz_curveto(doc->ctx, path, pt.x + smooth_x, pt.y + smooth_y, x1, y1, x2, y2);\n\t\t\ti += 4;\n\t\t\treset_smooth = 0;\n\t\t\tsmooth_x = x2 - x1;\n\t\t\tsmooth_y = y2 - y1;\n\t\t\tbreak;\n\n\t\tcase 's':\n\t\t\tif (i + 3 >= n) break;\n\t\t\tpt = fz_currentpoint(doc->ctx, path);\n\t\t\tx1 = fz_atof(args[i+0]) + pt.x;\n\t\t\ty1 = fz_atof(args[i+1]) + pt.y;\n\t\t\tx2 = fz_atof(args[i+2]) + pt.x;\n\t\t\ty2 = fz_atof(args[i+3]) + pt.y;\n\t\t\tfz_curveto(doc->ctx, path, pt.x + smooth_x, pt.y + smooth_y, x1, y1, x2, y2);\n\t\t\ti += 4;\n\t\t\treset_smooth = 0;\n\t\t\tsmooth_x = x2 - x1;\n\t\t\tsmooth_y = y2 - y1;\n\t\t\tbreak;\n\n\t\tcase 'Q':\n\t\t\tif (i + 3 >= n) break;\n\t\t\tpt = fz_currentpoint(doc->ctx, path);\n\t\t\tx1 = fz_atof(args[i+0]);\n\t\t\ty1 = fz_atof(args[i+1]);\n\t\t\tx2 = fz_atof(args[i+2]);\n\t\t\ty2 = fz_atof(args[i+3]);\n\t\t\tfz_curveto(doc->ctx, path,\n\t\t\t\t(pt.x + 2 * x1) / 3, (pt.y + 2 * y1) / 3,\n\t\t\t\t(x2 + 2 * x1) / 3, (y2 + 2 * y1) / 3,\n\t\t\t\tx2, y2);\n\t\t\ti += 4;\n\t\t\tbreak;\n\t\tcase 'q':\n\t\t\tif (i + 3 >= n) break;\n\t\t\tpt = fz_currentpoint(doc->ctx, path);\n\t\t\tx1 = fz_atof(args[i+0]) + pt.x;\n\t\t\ty1 = fz_atof(args[i+1]) + pt.y;\n\t\t\tx2 = fz_atof(args[i+2]) + pt.x;\n\t\t\ty2 = fz_atof(args[i+3]) + pt.y;\n\t\t\tfz_curveto(doc->ctx, path,\n\t\t\t\t(pt.x + 2 * x1) / 3, (pt.y + 2 * y1) / 3,\n\t\t\t\t(x2 + 2 * x1) / 3, (y2 + 2 * y1) / 3,\n\t\t\t\tx2, y2);\n\t\t\ti += 4;\n\t\t\tbreak;\n\n\t\tcase 'A':\n\t\t\tif (i + 6 >= n) break;\n\t\t\txps_draw_arc(doc->ctx, path,\n\t\t\t\tfz_atof(args[i+0]), fz_atof(args[i+1]), fz_atof(args[i+2]),\n\t\t\t\tatoi(args[i+3]), atoi(args[i+4]),\n\t\t\t\tfz_atof(args[i+5]), fz_atof(args[i+6]));\n\t\t\ti += 7;\n\t\t\tbreak;\n\t\tcase 'a':\n\t\t\tif (i + 6 >= n) break;\n\t\t\tpt = fz_currentpoint(doc->ctx, path);\n\t\t\txps_draw_arc(doc->ctx, path,\n\t\t\t\tfz_atof(args[i+0]), fz_atof(args[i+1]), fz_atof(args[i+2]),\n\t\t\t\tatoi(args[i+3]), atoi(args[i+4]),\n\t\t\t\tfz_atof(args[i+5]) + pt.x, fz_atof(args[i+6]) + pt.y);\n\t\t\ti += 7;\n\t\t\tbreak;\n\n\t\tcase 'Z':\n\t\tcase 'z':\n\t\t\tfz_closepath(doc->ctx, path);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\t/* eek */\n\t\t\tfz_warn(doc->ctx, \"ignoring invalid command '%c'\", cmd);\n\t\t\t/* Skip any trailing numbers to avoid an infinite loop */\n\t\t\twhile (i < n && (args[i][0] == '+' || args[i][0] == '.' || args[i][0] == '-' || (args[i][0] >= '0' && args[i][0] <= '9')))\n\t\t\t\ti ++;\n\t\t\tbreak;\n\t\t}\n\n\t\told = cmd;\n\t}\n\n\tfz_free(doc->ctx, args);\n\treturn path;\n}\n\nstatic void\nxps_parse_arc_segment(fz_context *doc, fz_path *path, fz_xml *root, int stroking, int *skipped_stroke)\n{\n\t/* ArcSegment pretty much follows the SVG algorithm for converting an\n\t * arc in endpoint representation to an arc in centerpoint\n\t * representation. Once in centerpoint it can be given to the\n\t * graphics library in the form of a postscript arc. */\n\n\tfloat rotation_angle;\n\tint is_large_arc, is_clockwise;\n\tfloat point_x, point_y;\n\tfloat size_x, size_y;\n\tint is_stroked;\n\n\tchar *point_att = fz_xml_att(root, \"Point\");\n\tchar *size_att = fz_xml_att(root, \"Size\");\n\tchar *rotation_angle_att = fz_xml_att(root, \"RotationAngle\");\n\tchar *is_large_arc_att = fz_xml_att(root, \"IsLargeArc\");\n\tchar *sweep_direction_att = fz_xml_att(root, \"SweepDirection\");\n\tchar *is_stroked_att = fz_xml_att(root, \"IsStroked\");\n\n\tif (!point_att || !size_att || !rotation_angle_att || !is_large_arc_att || !sweep_direction_att)\n\t{\n\t\tfz_warn(doc, \"ArcSegment element is missing attributes\");\n\t\treturn;\n\t}\n\n\tis_stroked = 1;\n\tif (is_stroked_att && !strcmp(is_stroked_att, \"false\"))\n\t\t\tis_stroked = 0;\n\tif (!is_stroked)\n\t\t*skipped_stroke = 1;\n\n\tpoint_x = point_y = 0;\n\tsize_x = size_y = 0;\n\n\txps_parse_point(point_att, &point_x, &point_y);\n\txps_parse_point(size_att, &size_x, &size_y);\n\trotation_angle = fz_atof(rotation_angle_att);\n\tis_large_arc = !strcmp(is_large_arc_att, \"true\");\n\tis_clockwise = !strcmp(sweep_direction_att, \"Clockwise\");\n\n\tif (stroking && !is_stroked)\n\t{\n\t\tfz_moveto(doc, path, point_x, point_y);\n\t\treturn;\n\t}\n\n\txps_draw_arc(doc, path, size_x, size_y, rotation_angle, is_large_arc, is_clockwise, point_x, point_y);\n}\n\nstatic void\nxps_parse_poly_quadratic_bezier_segment(fz_context *doc, fz_path *path, fz_xml *root, int stroking, int *skipped_stroke)\n{\n\tchar *points_att = fz_xml_att(root, \"Points\");\n\tchar *is_stroked_att = fz_xml_att(root, \"IsStroked\");\n\tfloat x[2], y[2];\n\tint is_stroked;\n\tfz_point pt;\n\tchar *s;\n\tint n;\n\n\tif (!points_att)\n\t{\n\t\tfz_warn(doc, \"PolyQuadraticBezierSegment element has no points\");\n\t\treturn;\n\t}\n\n\tis_stroked = 1;\n\tif (is_stroked_att && !strcmp(is_stroked_att, \"false\"))\n\t\t\tis_stroked = 0;\n\tif (!is_stroked)\n\t\t*skipped_stroke = 1;\n\n\ts = points_att;\n\tn = 0;\n\twhile (*s != 0)\n\t{\n\t\twhile (*s == ' ') s++;\n\t\ts = xps_parse_point(s, &x[n], &y[n]);\n\t\tn ++;\n\t\tif (n == 2)\n\t\t{\n\t\t\tif (stroking && !is_stroked)\n\t\t\t{\n\t\t\t\tfz_moveto(doc, path, x[1], y[1]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpt = fz_currentpoint(doc, path);\n\t\t\t\tfz_curveto(doc, path,\n\t\t\t\t\t\t(pt.x + 2 * x[0]) / 3, (pt.y + 2 * y[0]) / 3,\n\t\t\t\t\t\t(x[1] + 2 * x[0]) / 3, (y[1] + 2 * y[0]) / 3,\n\t\t\t\t\t\tx[1], y[1]);\n\t\t\t}\n\t\t\tn = 0;\n\t\t}\n\t}\n}\n\nstatic void\nxps_parse_poly_bezier_segment(fz_context *doc, fz_path *path, fz_xml *root, int stroking, int *skipped_stroke)\n{\n\tchar *points_att = fz_xml_att(root, \"Points\");\n\tchar *is_stroked_att = fz_xml_att(root, \"IsStroked\");\n\tfloat x[3], y[3];\n\tint is_stroked;\n\tchar *s;\n\tint n;\n\n\tif (!points_att)\n\t{\n\t\tfz_warn(doc, \"PolyBezierSegment element has no points\");\n\t\treturn;\n\t}\n\n\tis_stroked = 1;\n\tif (is_stroked_att && !strcmp(is_stroked_att, \"false\"))\n\t\t\tis_stroked = 0;\n\tif (!is_stroked)\n\t\t*skipped_stroke = 1;\n\n\ts = points_att;\n\tn = 0;\n\twhile (*s != 0)\n\t{\n\t\twhile (*s == ' ') s++;\n\t\ts = xps_parse_point(s, &x[n], &y[n]);\n\t\tn ++;\n\t\tif (n == 3)\n\t\t{\n\t\t\tif (stroking && !is_stroked)\n\t\t\t\tfz_moveto(doc, path, x[2], y[2]);\n\t\t\telse\n\t\t\t\tfz_curveto(doc, path, x[0], y[0], x[1], y[1], x[2], y[2]);\n\t\t\tn = 0;\n\t\t}\n\t}\n}\n\nstatic void\nxps_parse_poly_line_segment(fz_context *doc, fz_path *path, fz_xml *root, int stroking, int *skipped_stroke)\n{\n\tchar *points_att = fz_xml_att(root, \"Points\");\n\tchar *is_stroked_att = fz_xml_att(root, \"IsStroked\");\n\tint is_stroked;\n\tfloat x, y;\n\tchar *s;\n\n\tif (!points_att)\n\t{\n\t\tfz_warn(doc, \"PolyLineSegment element has no points\");\n\t\treturn;\n\t}\n\n\tis_stroked = 1;\n\tif (is_stroked_att && !strcmp(is_stroked_att, \"false\"))\n\t\t\tis_stroked = 0;\n\tif (!is_stroked)\n\t\t*skipped_stroke = 1;\n\n\ts = points_att;\n\twhile (*s != 0)\n\t{\n\t\twhile (*s == ' ') s++;\n\t\ts = xps_parse_point(s, &x, &y);\n\t\tif (stroking && !is_stroked)\n\t\t\tfz_moveto(doc, path, x, y);\n\t\telse\n\t\t\tfz_lineto(doc, path, x, y);\n\t}\n}\n\nstatic void\nxps_parse_path_figure(fz_context *doc, fz_path *path, fz_xml *root, int stroking)\n{\n\tfz_xml *node;\n\n\tchar *is_closed_att;\n\tchar *start_point_att;\n\tchar *is_filled_att;\n\n\tint is_closed = 0;\n\tint is_filled = 1;\n\tfloat start_x = 0;\n\tfloat start_y = 0;\n\n\tint skipped_stroke = 0;\n\n\tis_closed_att = fz_xml_att(root, \"IsClosed\");\n\tstart_point_att = fz_xml_att(root, \"StartPoint\");\n\tis_filled_att = fz_xml_att(root, \"IsFilled\");\n\n\tif (is_closed_att)\n\t\tis_closed = !strcmp(is_closed_att, \"true\");\n\tif (is_filled_att)\n\t\tis_filled = !strcmp(is_filled_att, \"true\");\n\tif (start_point_att)\n\t\txps_parse_point(start_point_att, &start_x, &start_y);\n\n\tif (!stroking && !is_filled) /* not filled, when filling */\n\t\treturn;\n\n\tfz_moveto(doc, path, start_x, start_y);\n\n\tfor (node = fz_xml_down(root); node; node = fz_xml_next(node))\n\t{\n\t\tif (fz_xml_is_tag(node, \"ArcSegment\"))\n\t\t\txps_parse_arc_segment(doc, path, node, stroking, &skipped_stroke);\n\t\tif (fz_xml_is_tag(node, \"PolyBezierSegment\"))\n\t\t\txps_parse_poly_bezier_segment(doc, path, node, stroking, &skipped_stroke);\n\t\tif (fz_xml_is_tag(node, \"PolyLineSegment\"))\n\t\t\txps_parse_poly_line_segment(doc, path, node, stroking, &skipped_stroke);\n\t\tif (fz_xml_is_tag(node, \"PolyQuadraticBezierSegment\"))\n\t\t\txps_parse_poly_quadratic_bezier_segment(doc, path, node, stroking, &skipped_stroke);\n\t}\n\n\tif (is_closed)\n\t{\n\t\tif (stroking && skipped_stroke)\n\t\t\tfz_lineto(doc, path, start_x, start_y); /* we've skipped using fz_moveto... */\n\t\telse\n\t\t\tfz_closepath(doc, path); /* no skipped segments, safe to closepath properly */\n\t}\n}\n\nfz_path *\nxps_parse_path_geometry(xps_document *doc, xps_resource *dict, fz_xml *root, int stroking, int *fill_rule)\n{\n\tfz_xml *node;\n\n\tchar *figures_att;\n\tchar *fill_rule_att;\n\tchar *transform_att;\n\n\tfz_xml *transform_tag = NULL;\n\tfz_xml *figures_tag = NULL; /* only used by resource */\n\n\tfz_matrix transform;\n\tfz_path *path;\n\n\tfigures_att = fz_xml_att(root, \"Figures\");\n\tfill_rule_att = fz_xml_att(root, \"FillRule\");\n\ttransform_att = fz_xml_att(root, \"Transform\");\n\n\tfor (node = fz_xml_down(root); node; node = fz_xml_next(node))\n\t{\n\t\tif (fz_xml_is_tag(node, \"PathGeometry.Transform\"))\n\t\t\ttransform_tag = fz_xml_down(node);\n\t}\n\n\txps_resolve_resource_reference(doc, dict, &transform_att, &transform_tag, NULL);\n\txps_resolve_resource_reference(doc, dict, &figures_att, &figures_tag, NULL);\n\n\tif (fill_rule_att)\n\t{\n\t\tif (!strcmp(fill_rule_att, \"NonZero\"))\n\t\t\t*fill_rule = 1;\n\t\tif (!strcmp(fill_rule_att, \"EvenOdd\"))\n\t\t\t*fill_rule = 0;\n\t}\n\n\ttransform = fz_identity;\n\tif (transform_att)\n\t\txps_parse_render_transform(doc, transform_att, &transform);\n\tif (transform_tag)\n\t\txps_parse_matrix_transform(doc, transform_tag, &transform);\n\n\tif (figures_att)\n\t\tpath = xps_parse_abbreviated_geometry(doc, figures_att, fill_rule);\n\telse\n\t\tpath = fz_new_path(doc->ctx);\n\n\tif (figures_tag)\n\t\txps_parse_path_figure(doc->ctx, path, figures_tag, stroking);\n\n\tfor (node = fz_xml_down(root); node; node = fz_xml_next(node))\n\t{\n\t\tif (fz_xml_is_tag(node, \"PathFigure\"))\n\t\t\txps_parse_path_figure(doc->ctx, path, node, stroking);\n\t}\n\n\tif (transform_att || transform_tag)\n\t\tfz_transform_path(doc->ctx, path, &transform);\n\n\treturn path;\n}\n\nstatic int\nxps_parse_line_cap(char *attr)\n{\n\tif (attr)\n\t{\n\t\tif (!strcmp(attr, \"Flat\")) return 0;\n\t\tif (!strcmp(attr, \"Round\")) return 1;\n\t\tif (!strcmp(attr, \"Square\")) return 2;\n\t\tif (!strcmp(attr, \"Triangle\")) return 3;\n\t}\n\treturn 0;\n}\n\nvoid\nxps_clip(xps_document *doc, const fz_matrix *ctm, xps_resource *dict, char *clip_att, fz_xml *clip_tag)\n{\n\tfz_path *path;\n\tint fill_rule = 0;\n\tfz_rect rect;\n\n\tif (clip_att)\n\t\tpath = xps_parse_abbreviated_geometry(doc, clip_att, &fill_rule);\n\telse if (clip_tag)\n\t\tpath = xps_parse_path_geometry(doc, dict, clip_tag, 0, &fill_rule);\n\telse\n\t\tpath = fz_new_path(doc->ctx);\n\t/* SumatraPDF: try to match rendering with and without display list */\n\tfz_clip_path(doc->dev, path, fz_bound_path(doc->ctx, path, NULL, ctm, &rect), fill_rule == 0, ctm);\n\tfz_free_path(doc->ctx, path);\n}\n\n/*\n * Parse an XPS <Path> element, and call relevant ghostscript\n * functions for drawing and/or clipping the child elements.\n */\n\nvoid\nxps_parse_path(xps_document *doc, const fz_matrix *ctm, char *base_uri, xps_resource *dict, fz_xml *root)\n{\n\tfz_xml *node;\n\n\tchar *fill_uri;\n\tchar *stroke_uri;\n\tchar *opacity_mask_uri;\n\n\tchar *transform_att;\n\tchar *clip_att;\n\tchar *data_att;\n\tchar *fill_att;\n\tchar *stroke_att;\n\tchar *opacity_att;\n\tchar *opacity_mask_att;\n\n\tfz_xml *transform_tag = NULL;\n\tfz_xml *clip_tag = NULL;\n\tfz_xml *data_tag = NULL;\n\tfz_xml *fill_tag = NULL;\n\tfz_xml *stroke_tag = NULL;\n\tfz_xml *opacity_mask_tag = NULL;\n\n\tchar *fill_opacity_att = NULL;\n\tchar *stroke_opacity_att = NULL;\n\n\tchar *stroke_dash_array_att;\n\tchar *stroke_dash_cap_att;\n\tchar *stroke_dash_offset_att;\n\tchar *stroke_end_line_cap_att;\n\tchar *stroke_start_line_cap_att;\n\tchar *stroke_line_join_att;\n\tchar *stroke_miter_limit_att;\n\tchar *stroke_thickness_att;\n\tchar *navigate_uri_att;\n\n\tfz_stroke_state *stroke = NULL;\n\tfz_matrix transform;\n\tfloat samples[FZ_MAX_COLORS];\n\tfz_colorspace *colorspace;\n\tfz_path *path = NULL;\n\tfz_path *stroke_path = NULL;\n\tfz_rect area;\n\tint fill_rule;\n\tint dash_len = 0;\n\tfz_matrix local_ctm;\n\n\t/*\n\t * Extract attributes and extended attributes.\n\t */\n\n\ttransform_att = fz_xml_att(root, \"RenderTransform\");\n\tclip_att = fz_xml_att(root, \"Clip\");\n\tdata_att = fz_xml_att(root, \"Data\");\n\tfill_att = fz_xml_att(root, \"Fill\");\n\tstroke_att = fz_xml_att(root, \"Stroke\");\n\topacity_att = fz_xml_att(root, \"Opacity\");\n\topacity_mask_att = fz_xml_att(root, \"OpacityMask\");\n\n\tstroke_dash_array_att = fz_xml_att(root, \"StrokeDashArray\");\n\tstroke_dash_cap_att = fz_xml_att(root, \"StrokeDashCap\");\n\tstroke_dash_offset_att = fz_xml_att(root, \"StrokeDashOffset\");\n\tstroke_end_line_cap_att = fz_xml_att(root, \"StrokeEndLineCap\");\n\tstroke_start_line_cap_att = fz_xml_att(root, \"StrokeStartLineCap\");\n\tstroke_line_join_att = fz_xml_att(root, \"StrokeLineJoin\");\n\tstroke_miter_limit_att = fz_xml_att(root, \"StrokeMiterLimit\");\n\tstroke_thickness_att = fz_xml_att(root, \"StrokeThickness\");\n\tnavigate_uri_att = fz_xml_att(root, \"FixedPage.NavigateUri\");\n\n\tfor (node = fz_xml_down(root); node; node = fz_xml_next(node))\n\t{\n\t\tif (fz_xml_is_tag(node, \"Path.RenderTransform\"))\n\t\t\ttransform_tag = fz_xml_down(node);\n\t\tif (fz_xml_is_tag(node, \"Path.OpacityMask\"))\n\t\t\topacity_mask_tag = fz_xml_down(node);\n\t\tif (fz_xml_is_tag(node, \"Path.Clip\"))\n\t\t\tclip_tag = fz_xml_down(node);\n\t\tif (fz_xml_is_tag(node, \"Path.Fill\"))\n\t\t\tfill_tag = fz_xml_down(node);\n\t\tif (fz_xml_is_tag(node, \"Path.Stroke\"))\n\t\t\tstroke_tag = fz_xml_down(node);\n\t\tif (fz_xml_is_tag(node, \"Path.Data\"))\n\t\t\tdata_tag = fz_xml_down(node);\n\t}\n\n\tfill_uri = base_uri;\n\tstroke_uri = base_uri;\n\topacity_mask_uri = base_uri;\n\n\txps_resolve_resource_reference(doc, dict, &data_att, &data_tag, NULL);\n\txps_resolve_resource_reference(doc, dict, &clip_att, &clip_tag, NULL);\n\txps_resolve_resource_reference(doc, dict, &transform_att, &transform_tag, NULL);\n\txps_resolve_resource_reference(doc, dict, &fill_att, &fill_tag, &fill_uri);\n\txps_resolve_resource_reference(doc, dict, &stroke_att, &stroke_tag, &stroke_uri);\n\txps_resolve_resource_reference(doc, dict, &opacity_mask_att, &opacity_mask_tag, &opacity_mask_uri);\n\n\t/*\n\t * Act on the information we have gathered:\n\t */\n\n\tif (!data_att && !data_tag)\n\t\treturn;\n\n\tif (fill_tag && !strcmp(fz_xml_tag(fill_tag), \"SolidColorBrush\"))\n\t{\n\t\tfill_opacity_att = fz_xml_att(fill_tag, \"Opacity\");\n\t\tfill_att = fz_xml_att(fill_tag, \"Color\");\n\t\tfill_tag = NULL;\n\t}\n\n\tif (stroke_tag && !strcmp(fz_xml_tag(stroke_tag), \"SolidColorBrush\"))\n\t{\n\t\tstroke_opacity_att = fz_xml_att(stroke_tag, \"Opacity\");\n\t\tstroke_att = fz_xml_att(stroke_tag, \"Color\");\n\t\tstroke_tag = NULL;\n\t}\n\n\tif (stroke_att || stroke_tag)\n\t{\n\t\tif (stroke_dash_array_att)\n\t\t{\n\t\t\tchar *s = stroke_dash_array_att;\n\n\t\t\twhile (*s)\n\t\t\t{\n\t\t\t\twhile (*s == ' ')\n\t\t\t\t\ts++;\n\t\t\t\tif (*s) /* needed in case of a space before the last quote */\n\t\t\t\t\tdash_len++;\n\n\t\t\t\twhile (*s && *s != ' ')\n\t\t\t\t\ts++;\n\t\t\t}\n\t\t}\n\t\tstroke = fz_new_stroke_state_with_dash_len(doc->ctx, dash_len);\n\t\tstroke->start_cap = xps_parse_line_cap(stroke_start_line_cap_att);\n\t\tstroke->dash_cap = xps_parse_line_cap(stroke_dash_cap_att);\n\t\tstroke->end_cap = xps_parse_line_cap(stroke_end_line_cap_att);\n\n\t\tstroke->linejoin = FZ_LINEJOIN_MITER_XPS;\n\t\tif (stroke_line_join_att)\n\t\t{\n\t\t\tif (!strcmp(stroke_line_join_att, \"Miter\")) stroke->linejoin = FZ_LINEJOIN_MITER_XPS;\n\t\t\tif (!strcmp(stroke_line_join_att, \"Round\")) stroke->linejoin = FZ_LINEJOIN_ROUND;\n\t\t\tif (!strcmp(stroke_line_join_att, \"Bevel\")) stroke->linejoin = FZ_LINEJOIN_BEVEL;\n\t\t}\n\n\t\tstroke->miterlimit = 10;\n\t\tif (stroke_miter_limit_att)\n\t\t\tstroke->miterlimit = fz_atof(stroke_miter_limit_att);\n\n\t\tstroke->linewidth = 1;\n\t\tif (stroke_thickness_att)\n\t\t\tstroke->linewidth = fz_atof(stroke_thickness_att);\n\n\t\tstroke->dash_phase = 0;\n\t\tstroke->dash_len = 0;\n\t\tif (stroke_dash_array_att)\n\t\t{\n\t\t\tchar *s = stroke_dash_array_att;\n\n\t\t\tif (stroke_dash_offset_att)\n\t\t\t\tstroke->dash_phase = fz_atof(stroke_dash_offset_att) * stroke->linewidth;\n\n\t\t\twhile (*s)\n\t\t\t{\n\t\t\t\twhile (*s == ' ')\n\t\t\t\t\ts++;\n\t\t\t\tif (*s) /* needed in case of a space before the last quote */\n\t\t\t\t\tstroke->dash_list[stroke->dash_len++] = fz_atof(s) * stroke->linewidth;\n\t\t\t\twhile (*s && *s != ' ')\n\t\t\t\t\ts++;\n\t\t\t}\n\t\t\tif (dash_len > 0)\n\t\t\t{\n\t\t\t\t/* fz_stroke_path doesn't draw non-empty paths with phase length zero */\n\t\t\t\tfloat phase_len = 0;\n\t\t\t\tint i;\n\t\t\t\tfor (i = 0; i < dash_len; i++)\n\t\t\t\t\tphase_len += stroke->dash_list[i];\n\t\t\t\tif (phase_len == 0)\n\t\t\t\t\tdash_len = 0;\n\t\t\t}\n\t\t\tstroke->dash_len = dash_len;\n\t\t}\n\t}\n\n\ttransform = fz_identity;\n\tif (transform_att)\n\t\txps_parse_render_transform(doc, transform_att, &transform);\n\tif (transform_tag)\n\t\txps_parse_matrix_transform(doc, transform_tag, &transform);\n\tfz_concat(&local_ctm, &transform, ctm);\n\n\tif (clip_att || clip_tag)\n\t\txps_clip(doc, &local_ctm, dict, clip_att, clip_tag);\n\n\tfill_rule = 0;\n\tif (data_att)\n\t\tpath = xps_parse_abbreviated_geometry(doc, data_att, &fill_rule);\n\telse if (data_tag)\n\t{\n\t\tpath = xps_parse_path_geometry(doc, dict, data_tag, 0, &fill_rule);\n\t\tif (stroke_att || stroke_tag)\n\t\t\tstroke_path = xps_parse_path_geometry(doc, dict, data_tag, 1, &fill_rule);\n\t}\n\tif (!stroke_path)\n\t\tstroke_path = path;\n\n\tif (stroke_att || stroke_tag)\n\t{\n\t\tfz_bound_path(doc->ctx, stroke_path, stroke, &local_ctm, &area);\n\t\tif (stroke_path != path && (fill_att || fill_tag)) {\n\t\t\tfz_rect bounds;\n\t\t\tfz_bound_path(doc->ctx, path, NULL, &local_ctm, &bounds);\n\t\t\tfz_union_rect(&area, &bounds);\n\t\t}\n\t}\n\telse\n\t\tfz_bound_path(doc->ctx, path, NULL, &local_ctm, &area);\n\n\t/* SumatraPDF: extended link support */\n\txps_extract_anchor_info(doc, &area, navigate_uri_att, fz_xml_att(root, \"Name\"), 0);\n\tnavigate_uri_att = NULL;\n\n\tif (navigate_uri_att)\n\t\txps_add_link(doc, &area, base_uri, navigate_uri_att);\n\n\txps_begin_opacity(doc, &local_ctm, &area, opacity_mask_uri, dict, opacity_att, opacity_mask_tag);\n\n\tif (fill_att)\n\t{\n\t\txps_parse_color(doc, base_uri, fill_att, &colorspace, samples);\n\t\tif (fill_opacity_att)\n\t\t\tsamples[0] *= fz_atof(fill_opacity_att);\n\t\txps_set_color(doc, colorspace, samples);\n\n\t\tfz_fill_path(doc->dev, path, fill_rule == 0, &local_ctm,\n\t\t\tdoc->colorspace, doc->color, doc->alpha);\n\t}\n\n\tif (fill_tag)\n\t{\n\t\tfz_clip_path(doc->dev, path, &area, fill_rule == 0, &local_ctm);\n\t\txps_parse_brush(doc, &local_ctm, &area, fill_uri, dict, fill_tag);\n\t\tfz_pop_clip(doc->dev);\n\t}\n\n\tif (stroke_att)\n\t{\n\t\txps_parse_color(doc, base_uri, stroke_att, &colorspace, samples);\n\t\tif (stroke_opacity_att)\n\t\t\tsamples[0] *= fz_atof(stroke_opacity_att);\n\t\txps_set_color(doc, colorspace, samples);\n\n\t\tfz_stroke_path(doc->dev, stroke_path, stroke, &local_ctm,\n\t\t\tdoc->colorspace, doc->color, doc->alpha);\n\t}\n\n\tif (stroke_tag)\n\t{\n\t\tfz_clip_stroke_path(doc->dev, stroke_path, &area, stroke, &local_ctm);\n\t\txps_parse_brush(doc, &local_ctm, &area, stroke_uri, dict, stroke_tag);\n\t\tfz_pop_clip(doc->dev);\n\t}\n\n\txps_end_opacity(doc, opacity_mask_uri, dict, opacity_att, opacity_mask_tag);\n\n\tif (stroke_path != path)\n\t\tfz_free_path(doc->ctx, stroke_path);\n\tfz_free_path(doc->ctx, path);\n\tpath = NULL;\n\tfz_drop_stroke_state(doc->ctx, stroke);\n\n\tif (clip_att || clip_tag)\n\t\tfz_pop_clip(doc->dev);\n}\n"
  },
  {
    "path": "mupdf/source/xps/xps-resource.c",
    "content": "#include \"mupdf/xps.h\"\n\nstatic fz_xml *\nxps_lookup_resource(xps_document *doc, xps_resource *dict, char *name, char **urip)\n{\n\txps_resource *head, *node;\n\tfor (head = dict; head; head = head->parent)\n\t{\n\t\tfor (node = head; node; node = node->next)\n\t\t{\n\t\t\tif (!strcmp(node->name, name))\n\t\t\t{\n\t\t\t\tif (urip && head->base_uri)\n\t\t\t\t\t*urip = head->base_uri;\n\t\t\t\treturn node->data;\n\t\t\t}\n\t\t}\n\t}\n\treturn NULL;\n}\n\nstatic fz_xml *\nxps_parse_resource_reference(xps_document *doc, xps_resource *dict, char *att, char **urip)\n{\n\tchar name[1024];\n\tchar *s;\n\n\tif (strstr(att, \"{StaticResource \") != att)\n\t\treturn NULL;\n\n\tfz_strlcpy(name, att + 16, sizeof name);\n\ts = strrchr(name, '}');\n\tif (s)\n\t\t*s = 0;\n\n\treturn xps_lookup_resource(doc, dict, name, urip);\n}\n\nvoid\nxps_resolve_resource_reference(xps_document *doc, xps_resource *dict,\n\t\tchar **attp, fz_xml **tagp, char **urip)\n{\n\tif (*attp)\n\t{\n\t\tfz_xml *rsrc = xps_parse_resource_reference(doc, dict, *attp, urip);\n\t\tif (rsrc)\n\t\t{\n\t\t\t*attp = NULL;\n\t\t\t*tagp = rsrc;\n\t\t}\n\t}\n}\n\nstatic xps_resource *\nxps_parse_remote_resource_dictionary(xps_document *doc, char *base_uri, char *source_att)\n{\n\tchar part_name[1024];\n\tchar part_uri[1024];\n\txps_resource *dict;\n\txps_part *part;\n\tfz_xml *xml;\n\tchar *s;\n\tfz_context *ctx = doc->ctx;\n\n\t/* External resource dictionaries MUST NOT reference other resource dictionaries */\n\txps_resolve_url(part_name, base_uri, source_att, sizeof part_name);\n\tpart = xps_read_part(doc, part_name);\n\tfz_try(ctx)\n\t{\n\t\txml = fz_parse_xml(doc->ctx, part->data, part->size, 0);\n\t}\n\tfz_always(ctx)\n\t{\n\t\txps_free_part(doc, part);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_if(ctx, FZ_ERROR_TRYLATER);\n\t\txml = NULL;\n\t}\n\n\tif (!xml)\n\t\treturn NULL;\n\n\tif (strcmp(fz_xml_tag(xml), \"ResourceDictionary\"))\n\t{\n\t\tfz_free_xml(doc->ctx, xml);\n\t\tfz_throw(doc->ctx, FZ_ERROR_GENERIC, \"expected ResourceDictionary element\");\n\t}\n\n\tfz_strlcpy(part_uri, part_name, sizeof part_uri);\n\ts = strrchr(part_uri, '/');\n\tif (s)\n\t\ts[1] = 0;\n\n\tdict = xps_parse_resource_dictionary(doc, part_uri, xml);\n\tif (dict)\n\t\tdict->base_xml = xml; /* pass on ownership */\n\t/* cf. http://bugs.ghostscript.com/show_bug.cgi?id=696061 */\n\telse\n\t\tfz_free_xml(doc->ctx, xml);\n\n\treturn dict;\n}\n\nxps_resource *\nxps_parse_resource_dictionary(xps_document *doc, char *base_uri, fz_xml *root)\n{\n\txps_resource *head;\n\txps_resource *entry;\n\tfz_xml *node;\n\tchar *source;\n\tchar *key;\n\n\tsource = fz_xml_att(root, \"Source\");\n\tif (source)\n\t\treturn xps_parse_remote_resource_dictionary(doc, base_uri, source);\n\n\thead = NULL;\n\n\tfor (node = fz_xml_down(root); node; node = fz_xml_next(node))\n\t{\n\t\tkey = fz_xml_att(node, \"x:Key\");\n\t\tif (key)\n\t\t{\n\t\t\tentry = fz_malloc_struct(doc->ctx, xps_resource);\n\t\t\tentry->name = key;\n\t\t\tentry->base_uri = NULL;\n\t\t\tentry->base_xml = NULL;\n\t\t\tentry->data = node;\n\t\t\tentry->next = head;\n\t\t\tentry->parent = NULL;\n\t\t\thead = entry;\n\t\t}\n\t}\n\n\tif (head)\n\t\thead->base_uri = fz_strdup(doc->ctx, base_uri);\n\n\treturn head;\n}\n\nvoid\nxps_free_resource_dictionary(xps_document *doc, xps_resource *dict)\n{\n\txps_resource *next;\n\twhile (dict)\n\t{\n\t\tnext = dict->next;\n\t\tif (dict->base_xml)\n\t\t\tfz_free_xml(doc->ctx, dict->base_xml);\n\t\tif (dict->base_uri)\n\t\t\tfz_free(doc->ctx, dict->base_uri);\n\t\tfz_free(doc->ctx, dict);\n\t\tdict = next;\n\t}\n}\n\nvoid\nxps_print_resource_dictionary(xps_resource *dict)\n{\n\twhile (dict)\n\t{\n\t\tif (dict->base_uri)\n\t\t\tprintf(\"URI = '%s'\\n\", dict->base_uri);\n\t\tprintf(\"KEY = '%s' VAL = %p\\n\", dict->name, dict->data);\n\t\tif (dict->parent)\n\t\t{\n\t\t\tprintf(\"PARENT = {\\n\");\n\t\t\txps_print_resource_dictionary(dict->parent);\n\t\t\tprintf(\"}\\n\");\n\t\t}\n\t\tdict = dict->next;\n\t}\n}\n"
  },
  {
    "path": "mupdf/source/xps/xps-tile.c",
    "content": "#include \"mupdf/xps.h\"\n\n#define TILE\n\n/*\n * Parse a tiling brush (visual and image brushes at this time) common\n * properties. Use the callback to draw the individual tiles.\n */\n\nenum { TILE_NONE, TILE_TILE, TILE_FLIP_X, TILE_FLIP_Y, TILE_FLIP_X_Y };\n\nstruct closure\n{\n\tchar *base_uri;\n\txps_resource *dict;\n\tfz_xml *root;\n\tvoid *user;\n\tvoid (*func)(xps_document*, const fz_matrix *, const fz_rect *, char*, xps_resource*, fz_xml*, void*);\n};\n\nstatic void\nxps_paint_tiling_brush_clipped(xps_document *doc, const fz_matrix *ctm, const fz_rect *viewbox, struct closure *c)\n{\n\tfz_path *path = fz_new_path(doc->ctx);\n\tfz_rect rect;\n\tfz_moveto(doc->ctx, path, viewbox->x0, viewbox->y0);\n\tfz_lineto(doc->ctx, path, viewbox->x0, viewbox->y1);\n\tfz_lineto(doc->ctx, path, viewbox->x1, viewbox->y1);\n\tfz_lineto(doc->ctx, path, viewbox->x1, viewbox->y0);\n\tfz_closepath(doc->ctx, path);\n\t/* SumatraPDF: try to match rendering with and without display list */\n\tfz_clip_path(doc->dev, path, fz_bound_path(doc->ctx, path, NULL, ctm, &rect), 0, ctm);\n\tfz_free_path(doc->ctx, path);\n\tc->func(doc, ctm, viewbox, c->base_uri, c->dict, c->root, c->user);\n\tfz_pop_clip(doc->dev);\n}\n\nstatic void\nxps_paint_tiling_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *viewbox, int tile_mode, struct closure *c)\n{\n\tfz_matrix ttm;\n\n\txps_paint_tiling_brush_clipped(doc, ctm, viewbox, c);\n\n\tif (tile_mode == TILE_FLIP_X || tile_mode == TILE_FLIP_X_Y)\n\t{\n\t\tttm = *ctm;\n\t\tfz_pre_scale(fz_pre_translate(&ttm, viewbox->x1 * 2, 0), -1, 1);\n\t\txps_paint_tiling_brush_clipped(doc, &ttm, viewbox, c);\n\t}\n\n\tif (tile_mode == TILE_FLIP_Y || tile_mode == TILE_FLIP_X_Y)\n\t{\n\t\tttm = *ctm;\n\t\tfz_pre_scale(fz_pre_translate(&ttm, 0, viewbox->y1 * 2), 1, -1);\n\t\txps_paint_tiling_brush_clipped(doc, &ttm, viewbox, c);\n\t}\n\n\tif (tile_mode == TILE_FLIP_X_Y)\n\t{\n\t\tttm = *ctm;\n\t\tfz_pre_scale(fz_pre_translate(&ttm, viewbox->x1 * 2, viewbox->y1 * 2), -1, -1);\n\t\txps_paint_tiling_brush_clipped(doc, &ttm, viewbox, c);\n\t}\n}\n\nvoid\nxps_parse_tiling_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *area,\n\tchar *base_uri, xps_resource *dict, fz_xml *root,\n\tvoid (*func)(xps_document*, const fz_matrix*, const fz_rect*, char*, xps_resource*, fz_xml*, void*), void *user)\n{\n\tfz_xml *node;\n\tstruct closure c;\n\n\tchar *opacity_att;\n\tchar *transform_att;\n\tchar *viewbox_att;\n\tchar *viewport_att;\n\tchar *tile_mode_att;\n\n\tfz_xml *transform_tag = NULL;\n\n\tfz_matrix transform;\n\tfz_rect viewbox;\n\tfz_rect viewport;\n\tfloat xstep, ystep;\n\tfloat xscale, yscale;\n\tint tile_mode;\n\n\topacity_att = fz_xml_att(root, \"Opacity\");\n\ttransform_att = fz_xml_att(root, \"Transform\");\n\tviewbox_att = fz_xml_att(root, \"Viewbox\");\n\tviewport_att = fz_xml_att(root, \"Viewport\");\n\ttile_mode_att = fz_xml_att(root, \"TileMode\");\n\n\tc.base_uri = base_uri;\n\tc.dict = dict;\n\tc.root = root;\n\tc.user = user;\n\tc.func = func;\n\n\tfor (node = fz_xml_down(root); node; node = fz_xml_next(node))\n\t{\n\t\tif (fz_xml_is_tag(node, \"ImageBrush.Transform\"))\n\t\t\ttransform_tag = fz_xml_down(node);\n\t\tif (fz_xml_is_tag(node, \"VisualBrush.Transform\"))\n\t\t\ttransform_tag = fz_xml_down(node);\n\t}\n\n\txps_resolve_resource_reference(doc, dict, &transform_att, &transform_tag, NULL);\n\n\ttransform = fz_identity;\n\tif (transform_att)\n\t\txps_parse_render_transform(doc, transform_att, &transform);\n\tif (transform_tag)\n\t\txps_parse_matrix_transform(doc, transform_tag, &transform);\n\tfz_concat(&transform, &transform, ctm);\n\n\tviewbox = fz_unit_rect;\n\tif (viewbox_att)\n\t\txps_parse_rectangle(doc, viewbox_att, &viewbox);\n\n\tviewport = fz_unit_rect;\n\tif (viewport_att)\n\t\txps_parse_rectangle(doc, viewport_att, &viewport);\n\n\tif (fabsf(viewport.x1 - viewport.x0) < 0.01f || fabsf(viewport.y1 - viewport.y0) < 0.01f)\n\t\tfz_warn(doc->ctx, \"not drawing tile for viewport size %.4f x %.4f\", viewport.x1 - viewport.x0, viewport.y1 - viewport.y0);\n\telse if (fabsf(viewbox.x1 - viewbox.x0) < 0.01f || fabsf(viewbox.y1 - viewbox.y0) < 0.01f)\n\t\tfz_warn(doc->ctx, \"not drawing tile for viewbox size %.4f x %.4f\", viewbox.x1 - viewbox.x0, viewbox.y1 - viewbox.y0);\n\n\t/* some sanity checks on the viewport/viewbox size */\n\tif (fabsf(viewport.x1 - viewport.x0) < 0.01f) return;\n\tif (fabsf(viewport.y1 - viewport.y0) < 0.01f) return;\n\tif (fabsf(viewbox.x1 - viewbox.x0) < 0.01f) return;\n\tif (fabsf(viewbox.y1 - viewbox.y0) < 0.01f) return;\n\n\txstep = viewbox.x1 - viewbox.x0;\n\tystep = viewbox.y1 - viewbox.y0;\n\n\txscale = (viewport.x1 - viewport.x0) / xstep;\n\tyscale = (viewport.y1 - viewport.y0) / ystep;\n\n\ttile_mode = TILE_NONE;\n\tif (tile_mode_att)\n\t{\n\t\tif (!strcmp(tile_mode_att, \"None\"))\n\t\t\ttile_mode = TILE_NONE;\n\t\tif (!strcmp(tile_mode_att, \"Tile\"))\n\t\t\ttile_mode = TILE_TILE;\n\t\tif (!strcmp(tile_mode_att, \"FlipX\"))\n\t\t\ttile_mode = TILE_FLIP_X;\n\t\tif (!strcmp(tile_mode_att, \"FlipY\"))\n\t\t\ttile_mode = TILE_FLIP_Y;\n\t\tif (!strcmp(tile_mode_att, \"FlipXY\"))\n\t\t\ttile_mode = TILE_FLIP_X_Y;\n\t}\n\n\tif (tile_mode == TILE_FLIP_X || tile_mode == TILE_FLIP_X_Y)\n\t\txstep *= 2;\n\tif (tile_mode == TILE_FLIP_Y || tile_mode == TILE_FLIP_X_Y)\n\t\tystep *= 2;\n\n\txps_begin_opacity(doc, &transform, area, base_uri, dict, opacity_att, NULL);\n\n\tfz_pre_translate(&transform, viewport.x0, viewport.y0);\n\tfz_pre_scale(&transform, xscale, yscale);\n\tfz_pre_translate(&transform, -viewbox.x0, -viewbox.y0);\n\n\tif (tile_mode != TILE_NONE)\n\t{\n\t\tint x0, y0, x1, y1;\n\t\tfz_matrix invctm;\n\t\tfz_rect local_area = *area;\n\t\tfz_transform_rect(&local_area, fz_invert_matrix(&invctm, &transform));\n\t\t/* SumatraPDF: make sure that the intended area is covered */\n\t\t{\n\t\t\tfz_point tl;\n\t\t\tfz_irect bbox;\n\t\t\tfz_rect bigview = viewbox;\n\t\t\tbigview.x1 = bigview.x0 + xstep;\n\t\t\tbigview.y1 = bigview.y0 + ystep;\n\t\t\tfz_irect_from_rect(&bbox, fz_transform_rect(&bigview, &transform));\n\t\t\tfz_transform_point_xy(&tl, &invctm, bbox.x0, bbox.y0);\n\t\t\tlocal_area.x0 -= fz_max(tl.x, 0) - 0.001f;\n\t\t\tlocal_area.y0 -= fz_max(tl.y, 0) - 0.001f;\n\t\t\tlocal_area.x1 += xstep - fz_max(tl.x, 0) - 0.001f;\n\t\t\tlocal_area.y1 += ystep - fz_max(tl.y, 0) - 0.001f;\n\t\t}\n\t\tx0 = floorf(local_area.x0 / xstep);\n\t\ty0 = floorf(local_area.y0 / ystep);\n\t\tx1 = ceilf(local_area.x1 / xstep);\n\t\ty1 = ceilf(local_area.y1 / ystep);\n\n#ifdef TILE\n\t\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=2248 */\n\t\tif ((local_area.x1 - local_area.x0) / xstep > 1 || (local_area.y1 - local_area.y0) / ystep > 1)\n#else\n\t\tif (0)\n#endif\n\t\t{\n\t\t\tfz_rect bigview = viewbox;\n\t\t\tbigview.x1 = bigview.x0 + xstep;\n\t\t\tbigview.y1 = bigview.y0 + ystep;\n\t\t\tfz_begin_tile(doc->dev, &local_area, &bigview, xstep, ystep, &transform);\n\t\t\txps_paint_tiling_brush(doc, &transform, &viewbox, tile_mode, &c);\n\t\t\tfz_end_tile(doc->dev);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tint x, y;\n\t\t\tfor (y = y0; y < y1; y++)\n\t\t\t{\n\t\t\t\tfor (x = x0; x < x1; x++)\n\t\t\t\t{\n\t\t\t\t\tfz_matrix ttm = transform;\n\t\t\t\t\tfz_pre_translate(&ttm, xstep * x, ystep * y);\n\t\t\t\t\txps_paint_tiling_brush(doc, &ttm, &viewbox, tile_mode, &c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\txps_paint_tiling_brush(doc, &transform, &viewbox, tile_mode, &c);\n\t}\n\n\txps_end_opacity(doc, base_uri, dict, opacity_att, NULL);\n}\n\nstatic void\nxps_paint_visual_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *area,\n\tchar *base_uri, xps_resource *dict, fz_xml *root, void *visual_tag)\n{\n\txps_parse_element(doc, ctm, area, base_uri, dict, (fz_xml *)visual_tag);\n}\n\nvoid\nxps_parse_visual_brush(xps_document *doc, const fz_matrix *ctm, const fz_rect *area,\n\tchar *base_uri, xps_resource *dict, fz_xml *root)\n{\n\tfz_xml *node;\n\n\tchar *visual_uri;\n\tchar *visual_att;\n\tfz_xml *visual_tag = NULL;\n\n\tvisual_att = fz_xml_att(root, \"Visual\");\n\n\tfor (node = fz_xml_down(root); node; node = fz_xml_next(node))\n\t{\n\t\tif (fz_xml_is_tag(node, \"VisualBrush.Visual\"))\n\t\t\tvisual_tag = fz_xml_down(node);\n\t}\n\n\tvisual_uri = base_uri;\n\txps_resolve_resource_reference(doc, dict, &visual_att, &visual_tag, &visual_uri);\n\n\tif (visual_tag)\n\t{\n\t\txps_parse_tiling_brush(doc, ctm, area,\n\t\t\tvisual_uri, dict, root, xps_paint_visual_brush, visual_tag);\n\t}\n}\n\nvoid\nxps_parse_canvas(xps_document *doc, const fz_matrix *ctm, const fz_rect *area, char *base_uri, xps_resource *dict, fz_xml *root)\n{\n\txps_resource *new_dict = NULL;\n\tfz_xml *node;\n\tchar *opacity_mask_uri;\n\n\tchar *transform_att;\n\tchar *clip_att;\n\tchar *opacity_att;\n\tchar *opacity_mask_att;\n\tchar *navigate_uri_att;\n\n\tfz_xml *transform_tag = NULL;\n\tfz_xml *clip_tag = NULL;\n\tfz_xml *opacity_mask_tag = NULL;\n\n\tfz_matrix transform;\n\n\ttransform_att = fz_xml_att(root, \"RenderTransform\");\n\tclip_att = fz_xml_att(root, \"Clip\");\n\topacity_att = fz_xml_att(root, \"Opacity\");\n\topacity_mask_att = fz_xml_att(root, \"OpacityMask\");\n\tnavigate_uri_att = fz_xml_att(root, \"FixedPage.NavigateUri\");\n\n\tfor (node = fz_xml_down(root); node; node = fz_xml_next(node))\n\t{\n\t\tif (fz_xml_is_tag(node, \"Canvas.Resources\") && fz_xml_down(node))\n\t\t{\n\t\t\tif (new_dict)\n\t\t\t{\n\t\t\t\tfz_warn(doc->ctx, \"ignoring follow-up resource dictionaries\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tnew_dict = xps_parse_resource_dictionary(doc, base_uri, fz_xml_down(node));\n\t\t\t\tif (new_dict)\n\t\t\t\t{\n\t\t\t\t\tnew_dict->parent = dict;\n\t\t\t\t\tdict = new_dict;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (fz_xml_is_tag(node, \"Canvas.RenderTransform\"))\n\t\t\ttransform_tag = fz_xml_down(node);\n\t\tif (fz_xml_is_tag(node, \"Canvas.Clip\"))\n\t\t\tclip_tag = fz_xml_down(node);\n\t\tif (fz_xml_is_tag(node, \"Canvas.OpacityMask\"))\n\t\t\topacity_mask_tag = fz_xml_down(node);\n\t}\n\n\topacity_mask_uri = base_uri;\n\txps_resolve_resource_reference(doc, dict, &transform_att, &transform_tag, NULL);\n\txps_resolve_resource_reference(doc, dict, &clip_att, &clip_tag, NULL);\n\txps_resolve_resource_reference(doc, dict, &opacity_mask_att, &opacity_mask_tag, &opacity_mask_uri);\n\n\ttransform = fz_identity;\n\tif (transform_att)\n\t\txps_parse_render_transform(doc, transform_att, &transform);\n\tif (transform_tag)\n\t\txps_parse_matrix_transform(doc, transform_tag, &transform);\n\tfz_concat(&transform, &transform, ctm);\n\n\t/* SumatraPDF: extended link support */\n\txps_extract_anchor_info(doc, &fz_empty_rect, navigate_uri_att, NULL, 1);\n\tnavigate_uri_att = NULL;\n\n\tif (navigate_uri_att)\n\t\txps_add_link(doc, area, base_uri, navigate_uri_att);\n\n\tif (clip_att || clip_tag)\n\t\txps_clip(doc, &transform, dict, clip_att, clip_tag);\n\n\txps_begin_opacity(doc, &transform, area, opacity_mask_uri, dict, opacity_att, opacity_mask_tag);\n\n\tfor (node = fz_xml_down(root); node; node = fz_xml_next(node))\n\t{\n\t\txps_parse_element(doc, &transform, area, base_uri, dict, node);\n\t}\n\n\txps_end_opacity(doc, opacity_mask_uri, dict, opacity_att, opacity_mask_tag);\n\n\t/* SumatraPDF: extended link support */\n\txps_extract_anchor_info(doc, area, NULL, fz_xml_att(root, \"Name\"), 2);\n\n\tif (clip_att || clip_tag)\n\t\tfz_pop_clip(doc->dev);\n\n\tif (new_dict)\n\t\txps_free_resource_dictionary(doc, new_dict);\n}\n\nvoid\nxps_parse_fixed_page(xps_document *doc, const fz_matrix *ctm, xps_page *page)\n{\n\tfz_xml *node;\n\txps_resource *dict;\n\tchar base_uri[1024];\n\tfz_rect area;\n\tchar *s;\n\tfz_matrix scm;\n\n\tfz_strlcpy(base_uri, page->name, sizeof base_uri);\n\ts = strrchr(base_uri, '/');\n\tif (s)\n\t\ts[1] = 0;\n\n\tdict = NULL;\n\n\tdoc->opacity_top = 0;\n\tdoc->opacity[0] = 1;\n\n\tif (!page->root)\n\t\treturn;\n\n\tarea = fz_unit_rect;\n\tfz_transform_rect(&area, fz_scale(&scm, page->width, page->height));\n\n\tfor (node = fz_xml_down(page->root); node; node = fz_xml_next(node))\n\t{\n\t\tif (fz_xml_is_tag(node, \"FixedPage.Resources\") && fz_xml_down(node))\n\t\t{\n\t\t\tif (dict)\n\t\t\t\tfz_warn(doc->ctx, \"ignoring follow-up resource dictionaries\");\n\t\t\telse\n\t\t\t\tdict = xps_parse_resource_dictionary(doc, base_uri, fz_xml_down(node));\n\t\t}\n\t\txps_parse_element(doc, ctm, &area, base_uri, dict, node);\n\t}\n\n\tif (dict)\n\t\txps_free_resource_dictionary(doc, dict);\n}\n\nvoid\nxps_run_page(xps_document *doc, xps_page *page, fz_device *dev, const fz_matrix *ctm, fz_cookie *cookie)\n{\n\tfz_matrix page_ctm = *ctm;\n\n\tfz_pre_scale(&page_ctm, 72.0f / 96.0f, 72.0f / 96.0f);\n\n\tdoc->cookie = cookie;\n\tdoc->dev = dev;\n\txps_parse_fixed_page(doc, &page_ctm, page);\n\tdoc->cookie = NULL;\n\tdoc->dev = NULL;\n\tpage->links_resolved = 1;\n}\n"
  },
  {
    "path": "mupdf/source/xps/xps-util.c",
    "content": "#include \"mupdf/xps.h\"\n\nstatic inline int xps_tolower(int c)\n{\n\tif (c >= 'A' && c <= 'Z')\n\t\treturn c + 32;\n\treturn c;\n}\n\nint\nxps_strcasecmp(char *a, char *b)\n{\n\twhile (xps_tolower(*a) == xps_tolower(*b))\n\t{\n\t\tif (*a++ == 0)\n\t\t\treturn 0;\n\t\tb++;\n\t}\n\treturn xps_tolower(*a) - xps_tolower(*b);\n}\n\n/* A URL is defined as consisting of a:\n * SCHEME (e.g. http:)\n * AUTHORITY (username, password, hostname, port, eg //test:passwd@mupdf.com:999)\n * PATH (e.g. /download)\n * QUERY (e.g. ?view=page)\n * FRAGMENT (e.g. #fred) (not strictly part of the URL)\n */\nstatic char *\nskip_scheme(char *path)\n{\n\tchar *p = path;\n\n\t/* Skip over: alpha *(alpha | digit | \"+\" | \"-\" | \".\") looking for : */\n\tif (*p >= 'a' && *p <= 'z')\n\t{}\n\telse if (*p >= 'A' && *p <= 'Z')\n\t{}\n\telse\n\t\treturn path;\n\n\twhile (*++p)\n\t{\n\t\tif (*p >= 'a' && *p <= 'z')\n\t\t{}\n\t\telse if (*p >= 'A' && *p <= 'Z')\n\t\t{}\n\t\telse if (*p >= '0' && *p <= '9')\n\t\t{}\n\t\telse if (*p == '+')\n\t\t{}\n\t\telse if (*p == '-')\n\t\t{}\n\t\telse if (*p == '.')\n\t\t{}\n\t\telse if (*p == ':')\n\t\t\treturn p+1;\n\t\telse\n\t\t\tbreak;\n\t}\n\treturn path;\n}\n\nstatic char *\nskip_authority(char *path)\n{\n\tchar *p = path;\n\n\t/* Authority section must start with '//' */\n\tif (p[0] != '/' || p[1] != '/')\n\t\treturn path;\n\tp += 2;\n\n\t/* Authority is terminated by end of URL, '/' or '?' */\n\twhile (*p && *p != '/' && *p != '?')\n\t\tp++;\n\n\treturn p;\n}\n\n#define SEP(x) ((x)=='/' || (x) == 0)\n\nstatic char *\nxps_clean_path(char *name)\n{\n\tchar *p, *q, *dotdot, *start;\n\tint rooted;\n\n\tstart = skip_scheme(name);\n\tstart = skip_authority(start);\n\trooted = start[0] == '/';\n\n\t/*\n\t * invariants:\n\t *\t\tp points at beginning of path element we're considering.\n\t *\t\tq points just past the last path element we wrote (no slash).\n\t *\t\tdotdot points just past the point where .. cannot backtrack\n\t *\t\t\t\tany further (no slash).\n\t */\n\tp = q = dotdot = start + rooted;\n\twhile (*p)\n\t{\n\t\tif(p[0] == '/') /* null element */\n\t\t\tp++;\n\t\telse if (p[0] == '.' && SEP(p[1]))\n\t\t\tp += 1; /* don't count the separator in case it is nul */\n\t\telse if (p[0] == '.' && p[1] == '.' && SEP(p[2]))\n\t\t{\n\t\t\tp += 2;\n\t\t\tif (q > dotdot) /* can backtrack */\n\t\t\t{\n\t\t\t\twhile(--q > dotdot && *q != '/')\n\t\t\t\t\t;\n\t\t\t}\n\t\t\telse if (!rooted) /* /.. is / but ./../ is .. */\n\t\t\t{\n\t\t\t\tif (q != start)\n\t\t\t\t\t*q++ = '/';\n\t\t\t\t*q++ = '.';\n\t\t\t\t*q++ = '.';\n\t\t\t\tdotdot = q;\n\t\t\t}\n\t\t}\n\t\telse /* real path element */\n\t\t{\n\t\t\tif (q != start+rooted)\n\t\t\t\t*q++ = '/';\n\t\t\twhile ((*q = *p) != '/' && *q != 0)\n\t\t\t\tp++, q++;\n\t\t}\n\t}\n\n\tif (q == start) /* empty string is really \".\" */\n\t\t*q++ = '.';\n\t*q = '\\0';\n\n\treturn name;\n}\n\nvoid\nxps_resolve_url(char *output, char *base_uri, char *path, int output_size)\n{\n\tchar *p = skip_authority(skip_scheme(path));\n\n\tif (p != path || path[0] == '/')\n\t{\n\t\tfz_strlcpy(output, path, output_size);\n\t}\n\telse\n\t{\n\t\tint len = fz_strlcpy(output, base_uri, output_size);\n\t\tif (len == 0 || output[len-1] != '/')\n\t\t\tfz_strlcat(output, \"/\", output_size);\n\t\tfz_strlcat(output, path, output_size);\n\t}\n\txps_clean_path(output);\n}\n\nint\nxps_url_is_remote(char *path)\n{\n\tchar *p = skip_authority(skip_scheme(path));\n\n\treturn p != path;\n}\n"
  },
  {
    "path": "mupdf/source/xps/xps-zip.c",
    "content": "#include \"mupdf/xps.h\"\n\nstatic void xps_init_document(xps_document *doc);\n\nxps_part *\nxps_new_part(xps_document *doc, char *name, unsigned char *data, int size)\n{\n\txps_part *part;\n\n\tpart = fz_malloc_struct(doc->ctx, xps_part);\n\tfz_try(doc->ctx)\n\t{\n\t\tpart->name = fz_strdup(doc->ctx, name);\n\t\tpart->data = data;\n\t\tpart->size = size;\n\t}\n\tfz_catch(doc->ctx)\n\t{\n\t\tfz_free(doc->ctx, part->name);\n\t\tfz_free(doc->ctx, part->data);\n\t\tfz_free(doc->ctx, part);\n\t\tfz_rethrow(doc->ctx);\n\t}\n\n\treturn part;\n}\n\nvoid\nxps_free_part(xps_document *doc, xps_part *part)\n{\n\tfz_free(doc->ctx, part->name);\n\tfz_free(doc->ctx, part->data);\n\tfz_free(doc->ctx, part);\n}\n\n/*\n * Read and interleave split parts from a ZIP file.\n */\nxps_part *\nxps_read_part(xps_document *doc, char *partname)\n{\n\tfz_context *ctx = doc->ctx;\n\tfz_archive *zip = doc->zip;\n\tfz_buffer *buf, *tmp;\n\tchar path[2048];\n\tunsigned char *data;\n\tint size;\n\tint count;\n\tchar *name;\n\tint seen_last;\n\n\tname = partname;\n\tif (name[0] == '/')\n\t\tname ++;\n\n\t/* All in one piece */\n\tif (fz_has_archive_entry(ctx, zip, name))\n\t{\n\t\tbuf = fz_read_archive_entry(ctx, zip, name);\n\t}\n\n\t/* Assemble all the pieces */\n\telse\n\t{\n\t\tbuf = fz_new_buffer(ctx, 512);\n\t\tseen_last = 0;\n\t\tfor (count = 0; !seen_last; ++count)\n\t\t{\n\t\t\tsprintf(path, \"%s/[%d].piece\", name, count);\n\t\t\tif (fz_has_archive_entry(ctx, zip, path))\n\t\t\t{\n\t\t\t\ttmp = fz_read_archive_entry(ctx, zip, path);\n\t\t\t\tfz_buffer_cat(ctx, buf, tmp);\n\t\t\t\tfz_drop_buffer(ctx, tmp);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsprintf(path, \"%s/[%d].last.piece\", name, count);\n\t\t\t\tif (fz_has_archive_entry(ctx, zip, path))\n\t\t\t\t{\n\t\t\t\t\ttmp = fz_read_archive_entry(ctx, zip, path);\n\t\t\t\t\tfz_buffer_cat(ctx, buf, tmp);\n\t\t\t\t\tfz_drop_buffer(ctx, tmp);\n\t\t\t\t\tseen_last = 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfz_drop_buffer(ctx, buf);\n\t\t\t\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot find all pieces for part '%s'\", partname);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfz_write_buffer_byte(ctx, buf, 0); /* zero-terminate */\n\n\t/* take over the data */\n\tdata = buf->data;\n\t/* size doesn't include the added zero-terminator */\n\tsize = buf->len - 1;\n\tfz_free(ctx, buf);\n\n\treturn xps_new_part(doc, partname, data, size);\n}\n\nint\nxps_has_part(xps_document *doc, char *name)\n{\n\tchar buf[2048];\n\tif (name[0] == '/')\n\t\tname++;\n\tif (fz_has_archive_entry(doc->ctx, doc->zip, name))\n\t\treturn 1;\n\tsprintf(buf, \"%s/[0].piece\", name);\n\tif (fz_has_archive_entry(doc->ctx, doc->zip, buf))\n\t\treturn 1;\n\tsprintf(buf, \"%s/[0].last.piece\", name);\n\tif (fz_has_archive_entry(doc->ctx, doc->zip, buf))\n\t\treturn 1;\n\treturn 0;\n}\n\nstatic xps_document *\nxps_open_document_with_directory(fz_context *ctx, const char *directory)\n{\n\txps_document *doc;\n\n\tdoc = fz_malloc_struct(ctx, xps_document);\n\txps_init_document(doc);\n\tdoc->ctx = ctx;\n\tdoc->zip = fz_open_directory(ctx, directory);\n\n\tfz_try(ctx)\n\t{\n\t\txps_read_page_list(doc);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\txps_close_document(doc);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn doc;\n}\n\nxps_document *\nxps_open_document_with_stream(fz_context *ctx, fz_stream *file)\n{\n\txps_document *doc;\n\n\tdoc = fz_malloc_struct(ctx, xps_document);\n\txps_init_document(doc);\n\tdoc->ctx = ctx;\n\n\tfz_try(ctx)\n\t{\n\t\tdoc->zip = fz_open_archive_with_stream(ctx, file);\n\t\txps_read_page_list(doc);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\txps_close_document(doc);\n\t\tfz_rethrow(ctx);\n\t}\n\n\treturn doc;\n}\n\nxps_document *\nxps_open_document(fz_context *ctx, const char *filename)\n{\n\tchar buf[2048];\n\tfz_stream *file;\n\tchar *p;\n\txps_document *doc;\n\n\tif (strstr(filename, \"/_rels/.rels\") || strstr(filename, \"\\\\_rels\\\\.rels\"))\n\t{\n\t\tfz_strlcpy(buf, filename, sizeof buf);\n\t\tp = strstr(buf, \"/_rels/.rels\");\n\t\tif (!p)\n\t\t\tp = strstr(buf, \"\\\\_rels\\\\.rels\");\n\t\t*p = 0;\n\t\treturn xps_open_document_with_directory(ctx, buf);\n\t}\n\n\tfile = fz_open_file(ctx, filename);\n\tif (!file)\n\t\tfz_throw(ctx, FZ_ERROR_GENERIC, \"cannot open file '%s': %s\", filename, strerror(errno));\n\n\tfz_try(ctx)\n\t{\n\t\tdoc = xps_open_document_with_stream(ctx, file);\n\t}\n\tfz_always(ctx)\n\t{\n\t\tfz_close(file);\n\t}\n\tfz_catch(ctx)\n\t{\n\t\tfz_rethrow_message(ctx, \"cannot load document '%s'\", filename);\n\t}\n\treturn doc;\n}\n\nvoid\nxps_close_document(xps_document *doc)\n{\n\txps_font_cache *font, *next;\n\n\tif (!doc)\n\t\treturn;\n\n\tif (doc->zip)\n\t\tfz_close_archive(doc->ctx, doc->zip);\n\n\tfont = doc->font_table;\n\twhile (font)\n\t{\n\t\tnext = font->next;\n\t\tfz_drop_font(doc->ctx, font->font);\n\t\tfz_free(doc->ctx, font->name);\n\t\tfz_free(doc->ctx, font);\n\t\tfont = next;\n\t}\n\n\t/* cf. http://code.google.com/p/sumatrapdf/issues/detail?id=2094 */\n\tfz_empty_store(doc->ctx);\n\n\txps_free_page_list(doc);\n\n\tfz_free(doc->ctx, doc->start_part);\n\tfz_free(doc->ctx, doc);\n}\n\nstatic int\nxps_meta(xps_document *doc, int key, void *ptr, int size)\n{\n\tswitch (key)\n\t{\n\tcase FZ_META_FORMAT_INFO:\n\t\tsprintf((char *)ptr, \"XPS\");\n\t\treturn FZ_META_OK;\n\tdefault:\n\t\treturn FZ_META_UNKNOWN_KEY;\n\t}\n}\n\nstatic void\nxps_rebind(xps_document *doc, fz_context *ctx)\n{\n\tdoc->ctx = ctx;\n\tfz_rebind_archive(doc->zip, ctx);\n\tfz_rebind_device(doc->dev, ctx);\n}\n\nstatic void\nxps_init_document(xps_document *doc)\n{\n\tdoc->super.close = (fz_document_close_fn *)xps_close_document;\n\tdoc->super.load_outline = (fz_document_load_outline_fn *)xps_load_outline;\n\tdoc->super.count_pages = (fz_document_count_pages_fn *)xps_count_pages;\n\tdoc->super.load_page = (fz_document_load_page_fn *)xps_load_page;\n\tdoc->super.load_links = (fz_document_load_links_fn *)xps_load_links;\n\tdoc->super.bound_page = (fz_document_bound_page_fn *)xps_bound_page;\n\tdoc->super.run_page_contents = (fz_document_run_page_contents_fn *)xps_run_page;\n\tdoc->super.free_page = (fz_document_free_page_fn *)xps_free_page;\n\tdoc->super.meta = (fz_document_meta_fn *)xps_meta;\n\tdoc->super.rebind = (fz_document_rebind_fn *)xps_rebind;\n}\n"
  },
  {
    "path": "premake5.files.lua",
    "content": "function files_in_dir(dir, files_in_dir)\r\n  local paths = {}\r\n  for _, file in ipairs(files_in_dir) do\r\n    -- TODO: don't add \"/\" if dir ends with it of file starts with it\r\n    local path = dir .. \"/\" .. file\r\n    table.insert(paths, path)\r\n  end\r\n  files(paths)\r\nend\r\n\r\nfunction zlib_files()\r\n  files_in_dir(\"ext/zlib\", {\r\n    \"adler32.c\",\r\n    \"compress.c\",\r\n    \"crc32.c\",\r\n    \"deflate.c\",\r\n    \"inffast.c\",\r\n    \"inflate.c\",\r\n    \"inftrees.c\",\r\n    \"trees.c\",\r\n    \"zutil.c\",\r\n    \"gzlib.c\",\r\n    \"gzread.c\",\r\n    \"gzwrite.c\",\r\n    \"gzclose.c\",\r\n  })\r\nend\r\n\r\nfunction libdjvu_files()\r\n  files_in_dir(\"ext/libdjvu\", {\r\n    \"Arrays.cpp\",\r\n    \"atomic.cpp\",\r\n    \"BSByteStream.cpp\",\r\n    \"BSEncodeByteStream.cpp\",\r\n    \"ByteStream.cpp\",\r\n    \"DataPool.cpp\",\r\n    \"DjVmDir0.cpp\",\r\n    \"DjVmDoc.cpp\",\r\n    \"DjVmNav.cpp\",\r\n    \"DjVuAnno.cpp\",\r\n    \"DjVuDocEditor.cpp\",\r\n    \"DjVuDocument.cpp\",\r\n    \"DjVuDumpHelper.cpp\",\r\n    \"DjVuErrorList.cpp\",\r\n    \"DjVuFile.cpp\",\r\n    \"DjVuFileCache.cpp\",\r\n    \"DjVuGlobal.cpp\",\r\n    \"DjVuGlobalMemory.cpp\",\r\n    \"DjVuImage.cpp\",\r\n    \"DjVuInfo.cpp\",\r\n    \"DjVuMessage.cpp\",\r\n    \"DjVuMessageLite.cpp\",\r\n    \"DjVuNavDir.cpp\",\r\n    \"DjVuPalette.cpp\",\r\n    \"DjVuPort.cpp\",\r\n    \"DjVuText.cpp\",\r\n    \"DjVuToPS.cpp\",\r\n    \"GBitmap.cpp\",\r\n    \"GContainer.cpp\",\r\n    \"GException.cpp\",\r\n    \"GIFFManager.cpp\",\r\n    \"GMapAreas.cpp\",\r\n    \"GOS.cpp\",\r\n    \"GPixmap.cpp\",\r\n    \"GRect.cpp\",\r\n    \"GScaler.cpp\",\r\n    \"GSmartPointer.cpp\",\r\n    \"GString.cpp\",\r\n    \"GThreads.cpp\",\r\n    \"GUnicode.cpp\",\r\n    \"GURL.cpp\",\r\n    \"IFFByteStream.cpp\",\r\n    \"IW44EncodeCodec.cpp\",\r\n    \"IW44Image.cpp\",\r\n    \"JB2EncodeCodec.cpp\",\r\n    \"DjVmDir.cpp\",\r\n    \"JB2Image.cpp\",\r\n    \"JPEGDecoder.cpp\",\r\n    \"MMRDecoder.cpp\",\r\n    \"MMX.cpp\",\r\n    \"UnicodeByteStream.cpp\",\r\n    \"XMLParser.cpp\",\r\n    \"XMLTags.cpp\",\r\n    \"ZPCodec.cpp\",\r\n    \"ddjvuapi.cpp\",\r\n    \"debug.cpp\",\r\n    \"miniexp.cpp\",\r\n  })\r\nend\r\n\r\nfunction unarr_files()\r\n  files {\r\n    \"ext/unarr/common/conv.c\",\r\n    \"ext/unarr/common/crc32.c\",\r\n    \"ext/unarr/common/stream.c\",\r\n    \"ext/unarr/common/unarr.c\",\r\n\r\n    \"ext/unarr/lzmasdk/CpuArch.c\",\r\n    \"ext/unarr/lzmasdk/Ppmd7.c\",\r\n    \"ext/unarr/lzmasdk/Ppmd7Dec.c\",\r\n    \"ext/unarr/lzmasdk/Ppmd8.c\",\r\n    \"ext/unarr/lzmasdk/Ppmd8Dec.c\",\r\n\r\n    \"ext/unarr/rar/filter-rar.c\",\r\n    \"ext/unarr/rar/parse-rar.c\",\r\n    \"ext/unarr/rar/rar.c\",\r\n    \"ext/unarr/rar/rarvm.c\",\r\n    \"ext/unarr/rar/uncompress-rar.c\",\r\n    \"ext/unarr/rar/huffman-rar.c\",\r\n\r\n    \"ext/unarr/zip/parse-zip.c\",\r\n    \"ext/unarr/zip/uncompress-zip.c\",\r\n    \"ext/unarr/zip/zip.c\",\r\n    \"ext/unarr/zip/inflate.c\",\r\n\r\n    \"ext/unarr/_7z/_7z.c\",\r\n\r\n    \"ext/unarr/tar/tar.c\",\r\n    \"ext/unarr/tar/parse-tar.c\",\r\n\r\n    \"ext/bzip2/bzip_all.c\",\r\n\r\n    \"ext/lzma/C/LzmaDec.c\",\r\n    \"ext/lzma/C/Bra86.c\",\r\n    \"ext/lzma/C/LzmaEnc.c\",\r\n    \"ext/lzma/C/LzFind.c\",\r\n    \"ext/lzma/C/LzFindMt.c\",\r\n    \"ext/lzma/C/Threads.c\",\r\n    \"ext/lzma/C/7zBuf.c\",\r\n    \"ext/lzma/C/7zDec.c\",\r\n    \"ext/lzma/C/7zIn.c\",\r\n    \"ext/lzma/C/7zStream.c\",\r\n    \"ext/lzma/C/Bcj2.c\",\r\n    \"ext/lzma/C/Bra.c\",\r\n    \"ext/lzma/C/Lzma2Dec.c\",\r\n  }\r\nend\r\n\r\nfunction unarr_no_bzip_files()\r\n  files {\r\n    \"ext/unarr/common/conv.c\",\r\n    \"ext/unarr/common/crc32.c\",\r\n    \"ext/unarr/common/stream.c\",\r\n    \"ext/unarr/common/unarr.c\",\r\n\r\n    \"ext/unarr/lzmasdk/CpuArch.c\",\r\n    \"ext/unarr/lzmasdk/Ppmd7.c\",\r\n    \"ext/unarr/lzmasdk/Ppmd7Dec.c\",\r\n    \"ext/unarr/lzmasdk/Ppmd8.c\",\r\n    \"ext/unarr/lzmasdk/Ppmd8Dec.c\",\r\n\r\n    \"ext/unarr/rar/filter-rar.c\",\r\n    \"ext/unarr/rar/parse-rar.c\",\r\n    \"ext/unarr/rar/rar.c\",\r\n    \"ext/unarr/rar/rarvm.c\",\r\n    \"ext/unarr/rar/uncompress-rar.c\",\r\n    \"ext/unarr/rar/huffman-rar.c\",\r\n\r\n    \"ext/unarr/zip/parse-zip.c\",\r\n    \"ext/unarr/zip/uncompress-zip.c\",\r\n    \"ext/unarr/zip/zip.c\",\r\n    \"ext/unarr/zip/inflate.c\",\r\n\r\n    \"ext/unarr/_7z/_7z.c\",\r\n\r\n    \"ext/unarr/tar/tar.c\",\r\n    \"ext/unarr/tar/parse-tar.c\",\r\n\r\n    \"ext/lzma/C/LzmaDec.c\",\r\n    \"ext/lzma/C/Bra86.c\",\r\n    \"ext/lzma/C/LzmaEnc.c\",\r\n    \"ext/lzma/C/LzFind.c\",\r\n    \"ext/lzma/C/LzFindMt.c\",\r\n    \"ext/lzma/C/Threads.c\",\r\n    \"ext/lzma/C/7zBuf.c\",\r\n    \"ext/lzma/C/7zDec.c\",\r\n    \"ext/lzma/C/7zIn.c\",\r\n    \"ext/lzma/C/7zStream.c\",\r\n    \"ext/lzma/C/Bcj2.c\",\r\n    \"ext/lzma/C/Bra.c\",\r\n    \"ext/lzma/C/Lzma2Dec.c\",\r\n  }\r\nend\r\n\r\nfunction jbig2dec_files()\r\n  -- TODO: probably can be\r\n  -- files { \"ext/jbig2dec/jbig2*.c\", \"ext/jbig2dec/jbig2*.h\" }\r\n  files_in_dir(\"ext/jbig2dec\", {\r\n    \"jbig2.c\",\r\n    \"jbig2_arith.c\",\r\n    \"jbig2_arith_iaid.c\",\r\n    \"jbig2_arith_int.c\",\r\n    \"jbig2_generic.c\",\r\n    \"jbig2_huffman.c\",\r\n    \"jbig2_halftone.c\",\r\n    \"jbig2_image.c\",\r\n    \"jbig2_metadata.c\",\r\n    \"jbig2_mmr.c\",\r\n    \"jbig2_page.c\",\r\n    \"jbig2_refinement.c\",\r\n    \"jbig2_segment.c\",\r\n    \"jbig2_symbol_dict.c\",\r\n    \"jbig2_text.c\",\r\n  })\r\nend\r\n\r\nfunction openjpeg_files()\r\n  files_in_dir( \"ext/openjpeg\", {\r\n    \"bio.*\",\r\n    \"cidx_manager.*\",\r\n    \"cio.*\",\r\n    \"dwt.*\",\r\n    \"event.*\",\r\n    \"function_list.*\",\r\n    \"image.*\",\r\n    \"invert.*\",\r\n    \"j2k.*\",\r\n    \"jp2.*\",\r\n    \"mct.*\",\r\n    \"mqc.*\",\r\n    \"openjpeg.*\",\r\n    \"opj_clock.*\",\r\n    \"opj_config.h\",\r\n    \"phix_manager.*\",\r\n    \"pi.*\",\r\n    \"ppix_manager.\",\r\n    \"raw.*\",\r\n    \"t1.*\",\r\n    \"t2.*\",\r\n    \"tcd.*\",\r\n    \"tgt.*\",\r\n    \"thix_manager.*\",\r\n    \"tpix_manager.*\",\r\n  })\r\nend\r\n\r\nfunction libwebp_files()\r\n  files_in_dir(\"ext/libwebp\", {\r\n    \"dec/alpha.c\",\r\n    \"dec/buffer.c\",\r\n    \"dec/frame.c\",\r\n    \"dec/idec.c\",\r\n    \"dec/io.c\",\r\n    \"dec/quant.c\",\r\n    \"dec/tree.c\",\r\n    \"dec/vp8.c\",\r\n    \"dec/vp8l.c\",\r\n    \"dec/webp.c\",\r\n\r\n    \"dsp/alpha_processing.c\",\r\n    \"dsp/cpu.c\",\r\n    \"dsp/dec.c\",\r\n    \"dsp/dec_sse2.c\",\r\n    \"dsp/lossless.c\",\r\n    \"dsp/lossless_sse2.c\",\r\n    \"dsp/upsampling.c\",\r\n    \"dsp/upsampling_sse2.c\",\r\n    \"dsp/yuv.c\",\r\n    \"dsp/yuv_sse2.c\",\r\n    \"dsp/dec_clip_tables.c\",\r\n    \"dsp/alpha_processing_sse2.c\",\r\n\r\n    \"utils/bit_reader.c\",\r\n    \"utils/color_cache.c\",\r\n    \"utils/filters.c\",\r\n    \"utils/huffman.c\",\r\n    \"utils/quant_levels_dec.c\",\r\n    \"utils/rescaler.c\",\r\n    \"utils/thread.c\",\r\n    \"utils/utils.c\",\r\n    \"utils/random.c\",\r\n  })\r\nend\r\n\r\nfunction libjpeg_turbo_files()\r\n  files_in_dir(\"ext/libjpeg-turbo\", {\r\n    \"jcomapi.c\",\r\n    \"jdapimin.c\",\r\n    \"jdapistd.c\",\r\n    \"jdatadst.c\",\r\n    \"jdatasrc.c\",\r\n    \"jdcoefct.c\",\r\n    \"jdcolor.c\",\r\n    \"jddctmgr.c\",\r\n    \"jdhuff.c\",\r\n    \"jdinput.c\",\r\n    \"jdmainct.c\",\r\n    \"jdmarker.c\",\r\n    \"jdmaster.c\",\r\n    \"jdmerge.c\",\r\n    \"jdpostct.c\",\r\n    \"jdsample.c\",\r\n    \"jdtrans.c\",\r\n    \"jerror.c\",\r\n    \"jfdctflt.c\",\r\n    \"jfdctint.c\",\r\n    \"jidctflt.c\",\r\n    \"jidctfst.c\",\r\n    \"jidctint.c\",\r\n    \"jquant1.c\",\r\n    \"jquant2.c\",\r\n    \"jutils.c\",\r\n    \"jmemmgr.c\",\r\n    \"jmemnobs.c\",\r\n    \"jaricom.c\",\r\n    \"jdarith.c\",\r\n    \"jfdctfst.c\",\r\n    \"jdphuff.c\",\r\n    \"jidctred.c\",\r\n  })\r\n\r\n  --to build non-assembly version, use this:\r\n  --files {\"ext/libjpeg-turbo/jsimd_none.c\"}\r\n\r\n  filter {'platforms:x32'}\r\n    files_in_dir(\"ext/libjpeg-turbo/simd\", {\r\n      \"jsimdcpu.asm\", \"jccolmmx.asm\", \"jcgrammx.asm\", \"jdcolmmx.asm\",\r\n    \t\"jcsammmx.asm\", \"jdsammmx.asm\", \"jdmermmx.asm\", \"jcqntmmx.asm\",\r\n    \t\"jfmmxfst.asm\", \"jfmmxint.asm\", \"jimmxred.asm\", \"jimmxint.asm\",\r\n    \t\"jimmxfst.asm\", \"jcqnt3dn.asm\", \"jf3dnflt.asm\", \"ji3dnflt.asm\",\r\n    \t\"jcqntsse.asm\", \"jfsseflt.asm\", \"jisseflt.asm\", \"jccolss2.asm\",\r\n    \t\"jcgrass2.asm\", \"jdcolss2.asm\", \"jcsamss2.asm\", \"jdsamss2.asm\",\r\n    \t\"jdmerss2.asm\", \"jcqnts2i.asm\", \"jfss2fst.asm\", \"jfss2int.asm\",\r\n    \t\"jiss2red.asm\", \"jiss2int.asm\", \"jiss2fst.asm\", \"jcqnts2f.asm\",\r\n    \t\"jiss2flt.asm\",\r\n    })\r\n    files {\"ext/libjpeg-turbo/simd/jsimd_i386.c\"}\r\n\r\n  filter {'platforms:x64'}\r\n    files_in_dir(\"ext/libjpeg-turbo/simd\", {\r\n      \"jfsseflt-64.asm\", \"jccolss2-64.asm\", \"jdcolss2-64.asm\", \"jcgrass2-64.asm\",\r\n    \t\"jcsamss2-64.asm\", \"jdsamss2-64.asm\", \"jdmerss2-64.asm\", \"jcqnts2i-64.asm\",\r\n    \t\"jfss2fst-64.asm\", \"jfss2int-64.asm\", \"jiss2red-64.asm\", \"jiss2int-64.asm\",\r\n    \t\"jiss2fst-64.asm\", \"jcqnts2f-64.asm\", \"jiss2flt-64.asm\",\r\n    })\r\n    files {\"ext/libjpeg-turbo/simd/jsimd_x86_64.c\"}\r\n\r\n  filter {}\r\n\r\nend\r\n\r\nfunction freetype_files()\r\n  files_in_dir(\"ext/freetype2/src/base\", {\r\n    \"ftbase.c\",\r\n    \"ftbbox.c\",\r\n    \"ftbitmap.c\",\r\n    \"ftgasp.c\",\r\n    \"ftglyph.c\",\r\n    \"ftinit.c\",\r\n    \"ftstroke.c\",\r\n    \"ftsynth.c\",\r\n    \"ftsystem.c\",\r\n    \"fttype1.c\",\r\n    \"ftxf86.c\",\r\n    \"ftotval.c\",\r\n  })\r\n\r\n  files_in_dir(\"ext/freetype2/src\", {\r\n    \"cff/cff.c\",\r\n    \"cid/type1cid.c\",\r\n    \"psaux/psaux.c\",\r\n    \"psnames/psnames.c\",\r\n    \"smooth/smooth.c\",\r\n    \"sfnt/sfnt.c\",\r\n    \"truetype/truetype.c\",\r\n    \"type1/type1.c\",\r\n    \"raster/raster.c\",\r\n    \"otvalid/otvalid.c\",\r\n    \"pshinter/pshinter.c\",\r\n    \"gzip/ftgzip.c\",\r\n  })\r\n\r\n  filter \"configurations:Debug*\"\r\n    files { \"ext/freetype2/src/base/ftdebug.c\" }\r\n  filter {}\r\n\r\nend\r\n\r\nfunction sumatra_files()\r\n  files_in_dir(\"src\", {\r\n    \"AppPrefs.*\",\r\n    \"AppTools.*\",\r\n    \"AppUtil.*\",\r\n    \"Caption.*\",\r\n    \"Canvas.*\",\r\n    \"ChmModel.*\",\r\n    \"CrashHandler.*\",\r\n    \"DisplayModel.*\",\r\n    \"Doc.*\",\r\n    \"EbookController.*\",\r\n    \"EbookControls.*\",\r\n    \"ExternalViewers.*\",\r\n    \"Favorites.*\",\r\n    \"FileHistory.*\",\r\n    \"FileThumbnails.*\",\r\n    \"GlobalPrefs.*\",\r\n    \"Menu.*\",\r\n    \"MuiEbookPageDef.*\",\r\n    \"Notifications.*\",\r\n    \"PagesLayoutDef.*\",\r\n    \"ParseCommandLine.*\",\r\n    \"PdfSync.*\",\r\n    \"Print.*\",\r\n    \"RenderCache.*\",\r\n    \"Search.*\",\r\n    \"Selection.*\",\r\n    \"SettingsStructs.*\",\r\n    \"SumatraAbout.*\",\r\n    \"SumatraAbout2.*\",\r\n    \"SumatraDialogs.*\",\r\n    \"SumatraProperties.*\",\r\n    \"StressTesting.*\",\r\n    \"TabInfo.*\",\r\n    \"TableOfContents.*\",\r\n    \"Tabs.*\",\r\n    \"Tester.*\",\r\n    \"TextSearch.*\",\r\n    \"TextSelection.*\",\r\n    \"Toolbar.*\",\r\n    \"Translations.*\",\r\n    \"Trans_sumatra_txt.cpp\",\r\n    \"Version.h\",\r\n    \"WindowInfo.*\",\r\n\r\n    \"regress/Regress.*\",\r\n  })\r\nend\r\n\r\n\r\nfunction uia_files()\r\n  files_in_dir(\"src/uia\", {\r\n    \"Provider.*\",\r\n    \"StartPageProvider.*\",\r\n    \"DocumentProvider.*\",\r\n    \"PageProvider.*\",\r\n    \"TextRange.*\",\r\n  })\r\nend\r\n\r\nfunction utils_files()\r\n  files_in_dir(\"src/utils\", {\r\n    \"ArchUtil.*\",\r\n    \"BaseUtil.*\",\r\n    \"BitReader.*\",\r\n    \"BuildConfig.h\",\r\n    \"ByteOrderDecoder.*\",\r\n    \"CmdLineParser.*\",\r\n    \"CryptoUtil.*\",\r\n    \"CssParser.*\",\r\n    \"DbgHelpDyn.*\",\r\n    \"DebugLog.*\",\r\n    \"Dict.*\",\r\n    \"DirIter.*\",\r\n    \"Dpi.*\",\r\n    \"FileTransactions.*\",\r\n    \"FileUtil.*\",\r\n    \"FileWatcher.*\",\r\n    \"FzImgReader.*\",\r\n    \"GdiPlusUtil.*\",\r\n    \"HtmlWindow.*\",\r\n    \"HtmlParserLookup.*\",\r\n    \"HtmlPullParser.*\",\r\n    \"HtmlPrettyPrint.*\",\r\n    \"HttpUtil.*\",\r\n    \"JsonParser.*\",\r\n    \"LzmaSimpleArchive.*\",\r\n    \"SerializeTxt.*\",\r\n    \"SettingsUtil.*\",\r\n    \"StrUtil.*\",\r\n    \"StrFormat.*\",\r\n    \"StrSlice.*\",\r\n    \"SquareTreeParser.*\",\r\n    \"ThreadUtil.*\",\r\n    \"TgaReader.*\",\r\n    \"TrivialHtmlParser.*\",\r\n    \"TxtParser.*\",\r\n    \"UITask.*\",\r\n    \"ZipUtil.*\",\r\n    \"WebpReader.*\",\r\n    \"WinDynCalls.*\",\r\n    \"WinUtil.*\",\r\n  })\r\n\r\n  files_in_dir(\"src/wingui\", {\r\n    \"DialogSizer.*\",\r\n    \"EditCtrl.*\",\r\n    \"FrameRateWnd.*\",\r\n    \"LabelWithCloseWnd.*\",\r\n    \"SplitterWnd.*\",\r\n    \"TabsWnd.*\",\r\n    \"Win32Window.*\",\r\n  })\r\nend\r\n\r\nfunction mui_files()\r\n  files_in_dir(\"src/mui\", {\r\n    \"MuiBase.*\",\r\n    \"Mui.*\",\r\n    \"MuiCss.*\",\r\n    \"MuiLayout.*\",\r\n    \"MuiPainter.*\",\r\n    \"MuiControl.*\",\r\n    \"MuiButton.*\",\r\n    \"MuiScrollBar.*\",\r\n    \"MuiEventMgr.*\",\r\n    \"MuiHwndWrapper.*\",\r\n    \"MuiGrid.*\",\r\n    \"SvgPath.*\",\r\n    \"MuiDefs.*\",\r\n    \"MuiFromText.*\",\r\n    \"TextRender.*\",\r\n  })\r\nend\r\n\r\nfunction engines_files()\r\n  files_in_dir(\"src\", {\r\n    \"ChmDoc.*\",\r\n    \"DjVuEngine.*\",\r\n    \"EbookDoc.*\",\r\n    \"EbookEngine.*\",\r\n    \"EbookFormatter.*\",\r\n    \"EngineManager.*\",\r\n    \"FileModifications.*\",\r\n    \"HtmlFormatter.*\",\r\n    \"ImagesEngine.*\",\r\n    \"MobiDoc.*\",\r\n    \"PdfCreator.*\",\r\n    \"PdfEngine.*\",\r\n    \"PsEngine.*\",\r\n\r\n    \"utils/PalmDbReader.*\",\r\n  })\r\nend\r\n\r\nfunction mupdf_files()\r\n  files {\r\n    \"mupdf/font_base14.asm\",\r\n  }\r\n\r\n  files_in_dir(\"mupdf/source/fitz\", {\r\n    \"bbox-device.c\",\r\n    \"bitmap.c\",\r\n    \"buffer.c\",\r\n    \"colorspace.c\",\r\n    \"compressed-buffer.c\",\r\n    \"context.c\",\r\n    \"crypt-aes.c\",\r\n    \"crypt-arc4.c\",\r\n    \"crypt-md5.c\",\r\n    \"crypt-sha2.c\",\r\n    \"device.c\",\r\n    \"error.c\",\r\n    \"filter-basic.c\",\r\n    \"filter-dct.c\",\r\n    \"filter-fax.c\",\r\n    \"filter-flate.c\",\r\n    \"filter-jbig2.c\",\r\n    \"filter-lzw.c\",\r\n    \"filter-predict.c\",\r\n    \"font.c\",\r\n    \"function.c\",\r\n    \"geometry.c\",\r\n    \"getopt.c\",\r\n    \"halftone.c\",\r\n    \"hash.c\",\r\n    \"image.c\",\r\n    \"link.c\",\r\n    \"list-device.c\",\r\n    \"load-jpeg.c\",\r\n    \"load-jpx.c\",\r\n    \"load-jxr.c\",\r\n    \"load-png.c\",\r\n    \"load-tiff.c\",\r\n    \"memory.c\",\r\n    \"outline.c\",\r\n    \"output.c\",\r\n    \"path.c\",\r\n    \"pixmap.c\",\r\n    \"shade.c\",\r\n    \"stext-device.c\",\r\n    \"stext-output.c\",\r\n    \"stext-paragraph.c\",\r\n    \"stext-search.c\",\r\n    \"store.c\",\r\n    \"stream-open.c\",\r\n    \"stream-read.c\",\r\n    \"string.c\",\r\n    \"text.c\",\r\n    \"time.c\",\r\n    \"trace-device.c\",\r\n    \"transition.c\",\r\n    \"ucdn.c\",\r\n    \"xml.c\",\r\n    \"glyph.c\",\r\n    \"tree.c\",\r\n    \"document.c\",\r\n    \"filter-leech.c\",\r\n    \"printf.c\",\r\n    \"strtod.c\",\r\n    \"ftoa.c\",\r\n    \"unzip.c\",\r\n    \"draw-affine.c\",\r\n    \"draw-blend.c\",\r\n    \"draw-device.c\",\r\n    \"draw-edge.c\",\r\n    \"draw-glyph.c\",\r\n    \"draw-mesh.c\",\r\n    \"draw-paint.c\",\r\n    \"draw-path.c\",\r\n    \"draw-scale-simple.c\",\r\n    \"draw-unpack.c\",\r\n  })\r\n\r\n  files_in_dir(\"mupdf/source/pdf\", {\r\n    \"pdf-annot.c\",\r\n    \"pdf-cmap-load.c\",\r\n    \"pdf-cmap-parse.c\",\r\n    \"pdf-cmap-table.c\",\r\n    \"pdf-cmap.c\",\r\n    \"pdf-colorspace.c\",\r\n    \"pdf-crypt.c\",\r\n    \"pdf-device.c\",\r\n    \"pdf-encoding.c\",\r\n    \"pdf-event.c\",\r\n    \"pdf-field.c\",\r\n    \"pdf-font.c\",\r\n    \"pdf-fontfile.c\",\r\n    \"pdf-form.c\",\r\n    \"pdf-ft-tools.c\",\r\n    \"pdf-function.c\",\r\n    \"pdf-image.c\",\r\n    \"pdf-interpret.c\",\r\n    \"pdf-lex.c\",\r\n    \"pdf-metrics.c\",\r\n    \"pdf-nametree.c\",\r\n    \"pdf-object.c\",\r\n    \"pdf-outline.c\",\r\n    \"pdf-page.c\",\r\n    \"pdf-parse.c\",\r\n    \"pdf-pattern.c\",\r\n    \"pdf-pkcs7.c\",\r\n    \"pdf-repair.c\",\r\n    \"pdf-shade.c\",\r\n    \"pdf-store.c\",\r\n    \"pdf-stream.c\",\r\n    \"pdf-type3.c\",\r\n    \"pdf-unicode.c\",\r\n    \"pdf-write.c\",\r\n    \"pdf-xobject.c\",\r\n    \"pdf-xref-aux.c\",\r\n    \"pdf-xref.c\",\r\n    \"pdf-appearance.c\",\r\n    \"pdf-run.c\",\r\n    \"pdf-op-run.c\",\r\n    \"pdf-op-buffer.c\",\r\n    \"pdf-op-filter.c\",\r\n    \"pdf-clean.c\",\r\n    \"pdf-annot-edit.c\",\r\n  })\r\n\r\n  files_in_dir(\"mupdf/source/xps\", {\r\n    \"xps-common.c\",\r\n    \"xps-doc.c\",\r\n    \"xps-glyphs.c\",\r\n    \"xps-gradient.c\",\r\n    \"xps-image.c\",\r\n    \"xps-outline.c\",\r\n    \"xps-path.c\",\r\n    \"xps-resource.c\",\r\n    \"xps-tile.c\",\r\n    \"xps-util.c\",\r\n    \"xps-zip.c\",\r\n  })\r\n\r\n  files {\r\n    \"mupdf/source/pdf/js/pdf-js-none.c\",\r\n  }\r\nend\r\n\r\nfunction mudoc_files()\r\n  files_in_dir(\"mupdf/source\", {\r\n    \"cbz/mucbz.c\",\r\n    \"img/muimage.c\",\r\n    \"tiff/mutiff.c\",\r\n    \"fitz/document-all.c\",\r\n    \"fitz/document-no-run.c\",\r\n    \"fitz/svg-device.c\",\r\n    \"fitz/output-pcl.c\",\r\n    \"fitz/output-pwg.c\",\r\n    \"fitz/stream-prog.c\",\r\n    \"fitz/test-device.c\",\r\n  })\r\nend\r\n\r\nfunction mutools_files()\r\n  files_in_dir(\"mupdf/source/tools\", {\r\n      \"mudraw.c\",\r\n      \"mutool.c\",\r\n      \"pdfclean.c\",\r\n      \"pdfextract.c\",\r\n      \"pdfinfo.c\",\r\n      \"pdfposter.c\",\r\n      \"pdfshow.c\",\r\n  })\r\nend\r\n\r\nfunction mutool_files()\r\n  mudoc_files() -- TODO: could turn into a .lib\r\n  files_in_dir(\"mupdf/source/tools\", {\r\n      \"mutool.c\",\r\n      \"pdfshow.c\",\r\n      \"pdfclean.c\",\r\n      \"pdfinfo.c\",\r\n      \"pdfextract.c\",\r\n      \"pdfposter.c\",\r\n  })\r\nend\r\n\r\nfunction mudraw_files()\r\n  mudoc_files()\r\n  files_in_dir(\"mupdf/source/tools\", {\r\n      \"mudraw.c\",\r\n  })\r\nend\r\n\r\nfunction sumatrapdf_files()\r\n  files {\r\n    \"src/SumatraPDF.cpp\",\r\n    \"src/SumatraStartup.cpp\",\r\n    \"src/Tests.cpp\",\r\n    \"src/SumatraPDF.rc\",\r\n  }\r\nend\r\n\r\nfunction synctex_files()\r\n  files {\r\n    \"ext/synctex/synctex_parser_utils.c\",\r\n    \"ext/synctex/synctex_parser.c\",\r\n  }\r\nend\r\n\r\nfunction efi_files()\r\n  files {\r\n    \"tools/efi/*.h\",\r\n    \"tools/efi/*.cpp\",\r\n    \"src/utils/BaseUtil*\",\r\n    \"src/utils/BitManip.h\",\r\n    \"src/utils/Dict*\",\r\n    \"src/utils/StrUtil*\",\r\n  }\r\nend\r\n\r\nfunction test_util_files()\r\n  files_in_dir( \"src/utils\", {\r\n    \"BaseUtil*\",\r\n    \"BitManip*\",\r\n    \"ByteOrderDecoder*\",\r\n    \"CmdLineParser*\",\r\n    \"CryptoUtil*\",\r\n    \"CssParser*\",\r\n    \"Dict*\",\r\n    \"DebugLog*\",\r\n    \"FileUtil*\",\r\n    \"GeomUtil.*\",\r\n    \"HtmlParserLookup*\",\r\n    \"HtmlPrettyPrint*\",\r\n    \"HtmlPullParser*\",\r\n    \"JsonParser*\",\r\n    \"Scoped.*\",\r\n    \"SettingsUtil*\",\r\n    \"SimpleLog*\",\r\n    \"StrFormat*\",\r\n    \"StrUtil*\",\r\n    \"SquareTreeParser*\",\r\n    \"TrivialHtmlParser*\",\r\n    \"UtAssert*\",\r\n    \"VarintGob*\",\r\n    \"Vec.*\",\r\n    \"WinUtil*\",\r\n    \"WinDynCalls.*\",\r\n    \"tests/*\"\r\n  })\r\n  files_in_dir(\"src\", {\r\n    --\"AppTools.*\",\r\n    --\"StressTesting.*\",\r\n    \"AppUtil.*\",\r\n    \"ParseCommandLine.*\",\r\n    \"SettingsStructs.*\",\r\n    \"UnitTests.cpp\",\r\n    \"mui/SvgPath*\",\r\n    \"tools/test_util.cpp\"\r\n  })\r\nend\r\n\r\nfunction engine_dump_files()\r\n  files_in_dir(\"src\", {\r\n    \"EngineDump.cpp\",\r\n    \"mui/MiniMui.*\",\r\n    \"mui/TextRender.*\",\r\n  })\r\nend\r\n\r\nfunction pdf_preview_files()\r\n  files_in_dir(\"src/previewer\", {\r\n    \"PdfPreview.*\",\r\n    \"PdfPreviewDll.cpp\",\r\n  })\r\n  files { \"src/MUPDF_Exports.cpp\", \"src/PdfEngine.*\" }\r\n\r\n  filter {\"configurations:Debug\"}\r\n    files_in_dir(\"src\", {\r\n      \"ChmDoc.*\",\r\n      \"DjVuEngine.*\",\r\n      \"EbookDoc.*\",\r\n      \"EbookEngine.*\",\r\n      \"EbookFormatter.*\",\r\n      \"HtmlFormatter.*\",\r\n      \"ImagesEngine.*\",\r\n      \"MobiDoc.*\",\r\n      \"PdfCreator.*\",\r\n      \"utils/PalmDbReader.*\",\r\n      \"mui/MiniMui.*\",\r\n      \"mui/TextRender.*\",\r\n    })\r\n  filter {}\r\nend\r\n\r\nfunction pdf_filter_files()\r\n  files_in_dir(\"src/ifilter\", {\r\n    \"PdfFilter.*\",\r\n    \"PdfFilterDll.cpp\",\r\n    \"CPdfFilter.*\",\r\n    \"FilterBase.h\",\r\n  })\r\n  files { \"src/MUPDF_Exports.cpp\", \"src/PdfEngine.cpp\" }\r\n\r\n  filter {\"configurations:Debug\"}\r\n    files_in_dir(\"src/ifilter\", {\r\n      \"CTeXFilter.*\",\r\n      \"CEpubFilter.*\",\r\n    })\r\n    files {\r\n      \"src/EbookDoc.*\",\r\n      \"src/MobiDoc.*\",\r\n      \"src/utils/PalmDbReader.*\",\r\n    }\r\n  filter {}\r\nend\r\n\r\nfunction installer_utils_files()\r\n  files_in_dir(\"src/utils\", {\r\n    \"ArchUtil.*\",\r\n    \"BaseUtil.*\",\r\n    \"BitReader.*\",\r\n    \"ByteOrderDecoder.*\",\r\n    \"CmdLineParser.*\",\r\n    \"DbgHelpDyn.*\",\r\n    \"DebugLog.*\",\r\n    \"Dict.*\",\r\n    \"DirIter.*\",\r\n    \"Dpi.*\",\r\n    \"FileTransactions.*\",\r\n    \"FileUtil.*\",\r\n    \"FzImgReader.*\",\r\n    \"GdiPlusUtil.*\",\r\n    \"HttpUtil.*\",\r\n    \"LzmaSimpleArchive.*\",\r\n    \"StrUtil.*\",\r\n    \"StrFormat.*\",\r\n    \"StrSlice.*\",\r\n    \"ThreadUtil.*\",\r\n    \"TgaReader.*\",\r\n    \"UITask.*\",\r\n    \"WebpReader.*\",\r\n    \"WinDynCalls.*\",\r\n    \"WinUtil.*\",\r\n  })\r\nend\r\n\r\nfunction installer_files()\r\n  zlib_files()\r\n  unarr_files()\r\n  installer_utils_files()\r\n  files_in_dir( \"src\", {\r\n    \"CrashHandler.*\",\r\n    \"Translations.*\",\r\n    \"installer/Installer.cpp\",\r\n    \"installer/Installer.h\",\r\n    \"installer/Trans_installer_txt.cpp\",\r\n    \"installer/Resource.h\",\r\n    \"installer/Installer.rc\",\r\n  })\r\nend\r\n\r\nfunction uninstaller_files()\r\n  files_in_dir(\"src\", {\r\n    \"CrashHandler.*\",\r\n    \"Translations.*\",\r\n    \"installer/Installer.*\",\r\n    \"installer/Trans_installer_txt.cpp\",\r\n  })\r\nend\r\n"
  },
  {
    "path": "premake5.lua",
    "content": "--[[\r\nTo generate Visual Studio files in vs2015 directory, run: premake5 vs2015\r\n\r\nI'm using premake5 alpha9 from http://premake.github.io/download.html#v5\r\n(premake4 won't work, it doesn't support VS 2013+)\r\n\r\nNote about nasm: when providing \"-I foo/bar/\" flag to nasm.exe, it must be\r\n\"foo/bar/\" and not just \"foo/bar\".\r\n\r\nReference for warnings:\r\n 4018 - signed/unsigned mismatch\r\n 4057 - function X differs in indirection to slightly different base types\r\n 4100 - unreferenced formal parameter\r\n 4127 - conditional expression is constant\r\n 4131 - uses old-style declarator\r\n 4189 - local variable is initialized but not referenced\r\n 4204 - non-standard extension: non-constant aggregate initializer\r\n 4206 - non-standard extension: translation unit is empty\r\n 4244 - 64bit, conversion with possible loss of data\r\n 4267 - 64bit, conversion with possible loss of data\r\n 4302 - 64bit, type caset truncation\r\n 4311 - 64bit, type cast pointer truncation\r\n 4312 - 64bit, conversion to X of greater size\r\n 4324 - 64bit, structure was padded\r\n 4458 - declaraion of X hides class member\r\n 4530 - exception mismatch\r\n 4702 - unreachable code\r\n 4706 - assignment within conditional expression\r\n 4800 - forcing value to bool (performance warning)\r\n 4819 - The file contains a character that cannot be represented in the current code page\r\n 4838 - conversion from X to Y requires a narrowing conversion\r\n 4996 - POSIX name deprecated\r\n\r\nPrefast:\r\n 28125 - function X must be called in try/except (InitializeCriticalSection)\r\n 28252 - Inconsistent annotaion\r\n 28253 - Inconsistent annotaion\r\n--]]\r\n\r\ninclude(\"premake5.files.lua\")\r\n\r\nworkspace \"SumatraPDF\"\r\n  configurations { \"Debug\", \"Release\", \"ReleasePrefast\" }\r\n  platforms { \"x32\", \"x64\" }\r\n  startproject \"SumatraPDF\"\r\n\r\n  filter \"platforms:x32\"\r\n     architecture \"x86\"\r\n     toolset \"v140_xp\"\r\n     buildoptions { \"/arch:IA32\" } -- disable the default /arch:SSE2 for 32-bit builds\r\n     filter \"action:vs2013\"\r\n      toolset \"v120_xp\"\r\n  filter {}\r\n\r\n  filter \"platforms:x64\"\r\n     architecture \"x86_64\"\r\n     toolset \"v140_xp\"\r\n     filter \"action:vs2013\"\r\n      toolset \"v120_xp\"\r\n  filter {}\r\n\r\n  disablewarnings { \"4127\", \"4324\", \"4458\", \"4800\" }\r\n  warnings \"Extra\"\r\n\r\n  location \"this_is_invalid_location\"\r\n\r\n  filter \"action:vs2015\"\r\n    location \"vs2015\"\r\n  filter {}\r\n\r\n  filter \"action:vs2013\"\r\n    location \"vs2013\"\r\n  filter {}\r\n\r\n  filter \"action:gmake\"\r\n    location \"gmake\"\r\n  filter {}\r\n\r\n  filter {\"platforms:x32\", \"configurations:Release\"}\r\n    targetdir \"rel\"\r\n  filter {\"platforms:x32\", \"configurations:ReleasePrefast\"}\r\n    targetdir \"relPrefast\"\r\n  filter {\"platforms:x32\", \"configurations:Debug\"}\r\n    targetdir \"dbg\"\r\n\r\n  filter {\"platforms:x64\", \"configurations:Release\"}\r\n    targetdir \"rel64\"\r\n  filter {\"platforms:x64\", \"configurations:ReleasePrefast\"}\r\n    targetdir \"relPrefast64\"\r\n  filter {\"platforms:x64\", \"configurations:Debug\"}\r\n    targetdir \"dbg64\"\r\n  filter {}\r\n  objdir \"%{cfg.targetdir}/obj\"\r\n\r\n  -- https://github.com/premake/premake-core/wiki/flags\r\n  flags {\r\n    \"MultiProcessorCompile\",\r\n    \"StaticRuntime\",\r\n    \"Symbols\",\r\n    -- \"Unicode\", TODO: breaks libdjuv?\r\n  }\r\n\r\n  filter {\"configurations:not ReleasePrefast\"}\r\n    flags { \"FatalWarnings\" }\r\n  filter {}\r\n\r\n  exceptionhandling \"Off\"\r\n  rtti \"Off\"\r\n\r\n  defines { \"WIN32\", \"_WIN32\", \"_CRT_SECURE_NO_WARNINGS\", \"WINVER=0x0501\", \"_WIN32_WINNT=0x0501\" }\r\n  defines { \"_HAS_EXCEPTIONS=0\" }\r\n\r\n  filter \"configurations:Debug\"\r\n    defines { \"DEBUG\" }\r\n\r\n  filter \"configurations:Release*\"\r\n    defines { \"NDEBUG\" }\r\n    flags {\r\n      \"LinkTimeOptimization\",\r\n    }\r\n    optimize \"On\"\r\n\r\n    filter \"configurations:ReleasePrefast\"\r\n      toolset \"v140\" -- xp toolset doesn't have prefast\r\n      -- TODO: somehow /analyze- is default which creates warning about\r\n      -- over-ride from cl.exe. Don't know how to disable the warning\r\n      buildoptions { \"/analyze\" }\r\n      disablewarnings { \"28125\", \"28252\", \"28253\" }\r\n  filter {}\r\n\r\n\r\n  project \"zlib\"\r\n    kind \"StaticLib\"\r\n    language \"C\"\r\n    disablewarnings { \"4131\", \"4244\", \"4996\" }\r\n    zlib_files()\r\n\r\n\r\n  project \"libdjvu\"\r\n    kind \"StaticLib\"\r\n    characterset (\"MBCS\")\r\n    language \"C++\"\r\n    -- TODO: try /D USE_EXCEPTION_EMULATION to see if it reduces the size\r\n    -- and disables the exceptions warnings\r\n    defines { \"NEED_JPEG_DECODER\", \"THREADMODEL=0\", \"DDJVUAPI=/**/\",  \"MINILISPAPI=/**/\", \"DO_CHANGELOCALE=0\" }\r\n    disablewarnings { \"4100\", \"4189\", \"4244\", \"4267\", \"4302\", \"4311\", \"4312\" }\r\n    disablewarnings { \"4456\", \"4457\", \"4459\", \"4530\", \"4611\", \"4701\", \"4702\", \"4703\", \"4706\" }\r\n    includedirs { \"ext/libjpeg-turbo\" }\r\n    libdjvu_files()\r\n\r\n\r\n  project \"unarrlib\"\r\n    kind \"StaticLib\"\r\n    language \"C\"\r\n    -- TODO: for bzip2, need BZ_NO_STDIO and BZ_DEBUG=0\r\n    -- TODO: for lzma, need _7ZIP_PPMD_SUPPPORT\r\n    defines { \"HAVE_ZLIB\", \"HAVE_BZIP2\", \"HAVE_7Z\", \"BZ_NO_STDIO\", \"_7ZIP_PPMD_SUPPPORT\" }\r\n    -- TODO: most of these warnings are due to bzip2 and lzma\r\n    disablewarnings { \"4100\", \"4244\", \"4267\", \"4456\", \"4457\", \"4996\" }\r\n    includedirs { \"ext/zlib\", \"ext/bzip2\", \"ext/lzma/C\" }\r\n    unarr_files()\r\n\r\n\r\n  project \"jbig2dec\"\r\n    kind \"StaticLib\"\r\n    language \"C\"\r\n    defines { \"HAVE_STRING_H=1\", \"JBIG_NO_MEMENTO\" }\r\n    disablewarnings { \"4018\", \"4100\", \"4244\", \"4267\", \"4701\" }\r\n    includedirs { \"ext/jbig2dec\" }\r\n    jbig2dec_files()\r\n\r\n\r\n  project \"openjpeg\"\r\n    kind \"StaticLib\"\r\n    language \"C\"\r\n    disablewarnings { \"4100\", \"4244\", \"4819\" }\r\n    includedirs { \"ext/openjpeg\" }\r\n    openjpeg_files()\r\n\r\n\r\n  project \"libwebp\"\r\n    kind \"StaticLib\"\r\n    language \"C\"\r\n    disablewarnings { \"4204\", \"4244\", \"4057\" }\r\n    includedirs { \"ext/libwebp\" }\r\n    libwebp_files()\r\n\r\n\r\n  project \"libjpeg-turbo\"\r\n    kind \"StaticLib\"\r\n    language \"C\"\r\n    disablewarnings { \"4018\", \"4100\", \"4244\", \"4245\" }\r\n    includedirs { \"ext/libjpeg-turbo\", \"ext/libjpeg-turbo/simd\" }\r\n\r\n    -- nasm.exe -I .\\ext\\libjpeg-turbo\\simd\\\r\n    -- -I .\\ext\\libjpeg-turbo\\win\\ -f win32\r\n    -- -o .\\obj-rel\\jpegturbo\\jsimdcpu.obj\r\n    -- .\\ext\\libjpeg-turbo\\simd\\jsimdcpu.asm\r\n    filter {'files:**.asm', 'platforms:x32'}\r\n       buildmessage '%{file.relpath}'\r\n       buildoutputs { '%{cfg.objdir}/%{file.basename}.obj' }\r\n       buildcommands {\r\n          '..\\\\bin\\\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"%{cfg.objdir}/%{file.basename}.obj\" \"%{file.relpath}\"'\r\n       }\r\n    filter {}\r\n\r\n    filter {'files:**.asm', 'platforms:x64'}\r\n      buildmessage '%{file.relpath}'\r\n      buildoutputs { '%{cfg.objdir}/%{file.basename}.obj' }\r\n      buildcommands {\r\n        '..\\\\bin\\\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"%{cfg.objdir}/%{file.basename}.obj\" \"%{file.relpath}\"'\r\n      }\r\n    filter {}\r\n    libjpeg_turbo_files()\r\n\r\n\r\n  project \"freetype\"\r\n    kind \"StaticLib\"\r\n    language \"C\"\r\n    defines { \"FT2_BUILD_LIBRARY\", \"FT_OPTION_AUTOFIT2\"}\r\n    disablewarnings { \"4018\", \"4996\" }\r\n    includedirs { \"ext/freetype2/config\" }\r\n    includedirs { \"ext/freetype2/include\" }\r\n    freetype_files()\r\n\r\n\r\n  project \"chm\"\r\n    kind \"StaticLib\"\r\n    language \"C\"\r\n    defines { \"UNICODE\", \"_UNICODE\", \"PPC_BSTR\"}\r\n    disablewarnings { \"4018\", \"4057\", \"4189\", \"4244\", \"4267\", \"4295\", \"4701\", \"4706\", \"4996\" }\r\n    files { \"ext/CHMLib/src/chm_lib.c\", \"ext/CHMLib/src/lzx.c\" }\r\n\r\n\r\n  project \"engines\"\r\n    kind \"StaticLib\"\r\n    language \"C++\"\r\n    disablewarnings { \"4018\", \"4057\", \"4189\", \"4244\", \"4267\", \"4295\", \"4819\" }\r\n    disablewarnings { \"4701\", \"4706\", \"4838\"  }\r\n    includedirs { \"src/utils\", \"src/wingui\", \"src/mui\" }\r\n    includedirs { \"ext/synctex\", \"ext/libdjvu\", \"ext/CHMLib/src\", \"ext/zlib\", \"mupdf/include\" }\r\n    engines_files()\r\n    links { \"chm\" }\r\n\r\n\r\n  project \"mupdf\"\r\n    kind \"StaticLib\"\r\n    language \"C\"\r\n    defines { \"NOCJKFONT\", \"SHARE_JPEG\" }\r\n    disablewarnings {  \"4244\", \"4267\", }\r\n    includedirs {\r\n      \"mupdf/include\", \"mupdf/generated\", \"ext/zlib\",\r\n      \"ext/freetype2/config\", \"ext/freetype2/include\",\r\n      \"ext/jbig2dec\", \"ext/libjpeg-turbo\", \"ext/openjpeg\"\r\n    }\r\n    -- .\\ext\\..\\bin\\nasm.exe -I .\\mupdf\\ -f win32 -o .\\obj-rel\\mupdf\\font_base14.obj\r\n    -- .\\mupdf\\font_base14.asm\r\n    filter {'files:**.asm', 'platforms:x32'}\r\n       buildmessage 'Compiling %{file.relpath}'\r\n       buildoutputs { '%{cfg.objdir}/%{file.basename}.obj' }\r\n       buildcommands {\r\n          '..\\\\bin\\\\nasm.exe -f win32 -I ../mupdf/ -o \"%{cfg.objdir}/%{file.basename}.obj\" \"%{file.relpath}\"'\r\n       }\r\n    filter {}\r\n\r\n    filter {'files:**.asm', 'platforms:x64'}\r\n      buildmessage 'Compiling %{file.relpath}'\r\n      buildoutputs { '%{cfg.objdir}/%{file.basename}.obj' }\r\n      buildcommands {\r\n        '..\\\\bin\\\\nasm.exe -f win64 -DWIN64 -I ../mupdf/ -o \"%{cfg.objdir}/%{file.basename}.obj\" \"%{file.relpath}\"'\r\n      }\r\n    filter {}\r\n    mupdf_files()\r\n    links { \"zlib\", \"freetype\", \"libjpeg-turbo\", \"jbig2dec\", \"openjpeg\" }\r\n    dependson \"buildcmap\"\r\n\r\n\r\n  project \"libmupdf\"\r\n    kind \"SharedLib\"\r\n    language \"C\"\r\n    disablewarnings { \"4206\" }\r\n    -- premake has logic in vs2010_vcxproj.lua that only sets PlatformToolset\r\n    -- if there is a c/c++ file, so we add a no-op cpp file to force This logic\r\n    files { \"src/libmupdf.rc\", \"tools/premake/no_op_for_premake.cpp\" }\r\n    implibname \"libmupdf\"\r\n    -- TODO: is thre a better way to do it?\r\n    -- TODO: only for windows\r\n    linkoptions { \"/DEF:..\\\\src\\\\libmupdf.def\" }\r\n    links { \"mupdf\", \"libdjvu\", \"unarrlib\", \"libwebp\" }\r\n    links {\r\n      \"advapi32\", \"kernel32\", \"user32\", \"gdi32\", \"comdlg32\",\r\n      \"shell32\", \"windowscodecs\", \"comctl32\", \"msimg32\",\r\n      \"winspool\", \"wininet\", \"urlmon\", \"gdiplus\", \"ole32\",\r\n      \"oleAut32\", \"shlwapi\", \"version\", \"crypt32\"\r\n    }\r\n\r\n\r\n  project \"synctex\"\r\n    kind \"StaticLib\"\r\n    language \"C\"\r\n    disablewarnings { \"4100\", \"4244\", \"4267\", \"4702\", \"4706\" }\r\n    includedirs { \"ext/zlib\", \"ext/synctex\" }\r\n    synctex_files()\r\n\r\n\r\n  project \"utils\"\r\n    kind \"StaticLib\"\r\n    language \"C++\"\r\n    -- QITABENT in shlwapi.h has incorrect definition and causes 4838\r\n    disablewarnings { \"4838\" }\r\n    includedirs { \"src/utils\", \"src/wingui\", \"src/mui\", \"ext/zlib\", \"ext/lzma/C\" }\r\n    includedirs { \"ext/libwebp\", \"ext/unarr\", \"mupdf/include\" }\r\n    utils_files()\r\n\r\n\r\n  project \"mui\"\r\n    kind \"StaticLib\"\r\n    language \"C++\"\r\n    includedirs { \"src/utils\", \"src/wingui\", \"src/mui\" }\r\n    mui_files()\r\n\r\n\r\n  project \"uia\"\r\n    kind \"StaticLib\"\r\n    language \"C++\"\r\n    disablewarnings { \"4302\", \"4311\", \"4838\" }\r\n    includedirs { \"src\", \"src/utils\" }\r\n    uia_files()\r\n\r\n\r\n  project \"sumatra\"\r\n    kind \"StaticLib\"\r\n    language \"C++\"\r\n    -- TODO: 4838 only in settingsstructs.h(642)\r\n    disablewarnings { \"4838\" }\r\n    includedirs { \"src\", \"src/utils\", \"src/wingui\", \"src/mui\", \"ext/synctex\" }\r\n    sumatra_files()\r\n\r\n\r\n  ---- executables\r\n  project \"efi\"\r\n    kind \"ConsoleApp\"\r\n    language \"C++\"\r\n    disablewarnings { \"4091\", \"4577\" }\r\n    includedirs { \"src/utils\" }\r\n    efi_files()\r\n\r\n\r\n  project \"mutool\"\r\n    kind \"ConsoleApp\"\r\n    language \"C\"\r\n    disablewarnings { \"4100\", \"4267\" }\r\n    includedirs { \"ext/zlib\", \"ext/lzma/C\", \"ext/unarr\", \"mupdf/include\" }\r\n    mutool_files()\r\n    links { \"mupdf\" }\r\n    links { \"windowscodecs\" }\r\n    entrypoint \"wmainCRTStartup\"\r\n\r\n\r\n  project \"mudraw\"\r\n    kind \"ConsoleApp\"\r\n    language \"C\"\r\n    disablewarnings { \"4100\", \"4267\" }\r\n    includedirs { \"ext/zlib\", \"ext/lzma/C\", \"ext/unarr\", \"mupdf/include\" }\r\n    mudraw_files()\r\n    links { \"mupdf\" }\r\n    links { \"windowscodecs\" }\r\n    linkoptions { \"/ENTRY:\\\"wmainCRTStartup\\\"\" }\r\n    entrypoint \"wmainCRTStartup\"\r\n\r\n\r\n  project \"cmapdump\"\r\n    kind \"ConsoleApp\"\r\n    language \"C\"\r\n    -- force 32build so that we can compile 64-bit Sumatra even on 32bit machines\r\n    -- that couldn't run 64-bit cmapdump\r\n    architecture \"x86\"\r\n    disablewarnings { \"4100\", \"4267\" }\r\n    includedirs { \"mupdf/include\" }\r\n    files { \"mupdf/scripts/cmapdump.c\" }\r\n\r\n\r\n  -- unfortunate we need buildcmap re-direction but we can do\r\n  -- dependson { \"cmapdump\" } in \"mupdf\" as it'll break mupdf project\r\n  project \"buildcmap\"\r\n    kind \"ConsoleApp\"\r\n    language \"C\"\r\n    -- premake has logic in vs2010_vcxproj.lua that only sets PlatformToolset\r\n    -- if there is a c/c++ file, so we add a no-op cpp file to force This logic\r\n    files { \"tools/premake/no_op_console.c\" }\r\n    dependson { \"cmapdump\" }\r\n    postbuildcommands { \"{COPY} %{cfg.targetdir}\\\\cmapdump.exe ..\\\\bin\" }\r\n    postbuildcommands { \"cd .. & call scripts\\\\gen_mupdf_generated.bat bin\\\\cmapdump.exe\"}\r\n\r\n\r\n  project \"enginedump\"\r\n    kind \"ConsoleApp\"\r\n    language \"C++\"\r\n    includedirs { \"src\", \"src/utils\", \"src/mui\", \"mupdf/include\" }\r\n    engine_dump_files()\r\n    links { \"engines\", \"utils\", \"mupdf\", \"unarrlib\", \"libwebp\", \"libdjvu\" }\r\n    links {\r\n      \"comctl32\", \"gdiplus\", \"msimg32\", \"shlwapi\",\r\n      \"version\", \"windowscodecs\"\r\n    }\r\n\r\n\r\n  project \"unarr\"\r\n    kind \"ConsoleApp\"\r\n    language \"C\"\r\n    disablewarnings { \"4100\" }\r\n    files { \"ext/unarr/main.c\" }\r\n    links { \"unarrlib\", \"zlib\" }\r\n\r\n\r\n  project \"test_util\"\r\n    kind \"ConsoleApp\"\r\n    language \"C++\"\r\n    disablewarnings { \"4838\" }\r\n    defines { \"NO_LIBMUPDF\" }\r\n    includedirs { \"src/utils\" }\r\n    test_util_files()\r\n    links { \"gdiplus\", \"comctl32\", \"shlwapi\", \"Version\" }\r\n\r\n\r\n  project \"signfile\"\r\n    kind \"ConsoleApp\"\r\n    language \"C++\"\r\n    includedirs { \"src/utils\", \"mupdf/include\"}\r\n    files { \"src/tools/signfile.cpp\" }\r\n    links { \"utils\", \"mupdf\" }\r\n    links { \"crypt32\", \"shlwapi\" }\r\n\r\n\r\n  project \"plugin-test\"\r\n    kind \"WindowedApp\"\r\n    language \"C++\"\r\n    flags { \"WinMain\" }\r\n    includedirs { \"src/utils\" }\r\n    files { \"src/tools/plugin-test.cpp\" }\r\n    links { \"utils\", \"mupdf\" }\r\n    links { \"shlwapi\" }\r\n\r\n\r\n  project \"MakeLZSA\"\r\n    kind \"ConsoleApp\"\r\n    language \"C++\"\r\n    files { \"src/tools/MakeLzSA.cpp\" }\r\n    includedirs { \"src/utils\", \"ext/zlib\", \"ext/lzma/C\", \"ext/unarr\" }\r\n    links { \"unarrlib\", \"utils\", \"zlib\" }\r\n    links { \"shlwapi\" }\r\n\r\n\r\n  project \"PdfFilter\"\r\n    kind \"SharedLib\"\r\n    language \"C++\"\r\n    disablewarnings { \"4838\" }\r\n    filter {\"configurations:Debug\"}\r\n      defines { \"BUILD_TEX_IFILTER\", \"BUILD_EPUB_IFILTER\" }\r\n    filter {}\r\n    includedirs { \"src\", \"src/utils\", \"src/wingui\", \"src/mui\", \"mupdf/include\" }\r\n    pdf_filter_files()\r\n    links { \"utils\", \"libmupdf\" }\r\n    links { \"comctl32\", \"gdiplus\", \"shlwapi\", \"version\"  }\r\n\r\n\r\n  project \"PdfPreview\"\r\n    kind \"SharedLib\"\r\n    language \"C++\"\r\n    disablewarnings { \"4838\" }\r\n    includedirs {\r\n      \"src\", \"src/utils\", \"src/wingui\", \"src/mui\", \"mupdf/include\",\r\n      \"ext/libdjvu\", \"ext/CHMLib/src\", \"ext/zlib\"\r\n    }\r\n    pdf_preview_files()\r\n    filter {\"configurations:Debug\"}\r\n      defines {\r\n        \"BUILD_XPS_PREVIEW\", \"BUILD_DJVU_PREVIEW\", \"BUILD_EPUB_PREVIEW\",\r\n        \"BUILD_FB2_PREVIEW\", \"BUILD_MOBI_PREVIEW\", \"BUILD_CBZ_PREVIEW\",\r\n        \"BUILD_CBR_PREVIEW\", \"BUILD_CB7_PREVIEW\", \"BUILD_CBT_PREVIEW\",\r\n        \"BUILD_TGA_PREVIEW\"\r\n      }\r\n    filter {}\r\n    -- TODO: \"chm\" should only be for Debug config but doing links { \"chm\" }\r\n    -- in the filter breaks linking by setting LinkLibraryDependencies to false\r\n    links { \"utils\", \"libmupdf\", \"chm\" }\r\n    links { \"comctl32\", \"gdiplus\", \"msimg32\", \"shlwapi\", \"version\" }\r\n\r\n\r\n  project \"SumatraPDF\"\r\n    kind \"WindowedApp\"\r\n    language \"C++\"\r\n    flags { \"NoManifest\", \"WinMain\" }\r\n    includedirs { \"src\", \"src/utils\", \"src/wingui\", \"src/mui\" }\r\n    sumatrapdf_files()\r\n    files {\r\n      \"docs/releasenotes.txt\",\r\n      \"docs/releaseplan.txt\",\r\n    }\r\n    links {\r\n      \"engines\", \"libdjvu\",  \"libwebp\", \"mui\", \"mupdf\", \"sumatra\", \"synctex\",\r\n      \"uia\", \"unarrlib\", \"utils\"\r\n    }\r\n    links {\r\n      \"comctl32\", \"gdiplus\", \"msimg32\", \"shlwapi\", \"urlmon\",\r\n      \"version\", \"windowscodecs\", \"wininet\"\r\n    }\r\n\r\n\r\n  project \"SumatraPDF-no-MUPDF\"\r\n    kind \"WindowedApp\"\r\n    language \"C++\"\r\n    flags { \"NoManifest\", \"WinMain\" }\r\n    includedirs { \"src\", \"src/utils\", \"src/wingui\", \"src/mui\", \"mupdf/include\" }\r\n    sumatrapdf_files()\r\n    files { \"src/MuPDF_Exports.cpp\" }\r\n    links {\r\n      \"synctex\", \"sumatra\", \"libmupdf\", \"utils\", \"mui\", \"engines\",\r\n      \"uia\", \"unarrlib\", \"libwebp\"\r\n    }\r\n    links {\r\n      \"comctl32\", \"gdiplus\", \"msimg32\", \"shlwapi\", \"urlmon\",\r\n      \"version\", \"windowscodecs\", \"wininet\"\r\n    }\r\n\r\n\r\n  project \"Uninstaller\"\r\n    kind \"WindowedApp\"\r\n    language \"C++\"\r\n    defines { \"BUILD_UNINSTALLER\" }\r\n    flags { \"NoManifest\", \"WinMain\" }\r\n    disablewarnings { \"4018\", \"4244\", \"4264\", \"4838\", \"4702\", \"4706\" }\r\n    uninstaller_files()\r\n    includedirs { \"src\", \"src/utils\", \"ext/zlib\", \"ext/unarr\", \"ext/lzma/C\" }\r\n    links { \"utils\", \"zlib\", \"unarrlib\" }\r\n    links {\r\n      \"comctl32\", \"gdiplus\", \"msimg32\", \"shlwapi\", \"urlmon\",\r\n       \"version\", \"windowscodecs\", \"wininet\"\r\n    }\r\n\r\n\r\n  -- faster to compile than Installer\r\n  project \"InstallerNoData\"\r\n    kind \"WindowedApp\"\r\n    language \"C++\"\r\n    flags { \"NoManifest\", \"WinMain\" }\r\n    defines { \"NO_LIBWEBP\", \"NO_LIBMUPDF\", \"HAVE_ZLIB\", \"HAVE_BZIP2\", \"HAVE_7Z\" }\r\n    disablewarnings {\r\n      \"4018\", \"4100\", \"4131\", \"4244\", \"4267\", \"4302\", \"4311\", \"4312\", \"4456\",\r\n      \"4457\", \"4838\", \"4702\", \"4706\", \"4996\"\r\n    }\r\n    installer_files()\r\n    includedirs { \"src\", \"src/utils\", \"ext/zlib\", \"ext/unarr\", \"ext/lzma/C\", \"ext/bzip2\" }\r\n    links {\r\n      \"comctl32\", \"gdiplus\", \"msimg32\", \"shlwapi\", \"urlmon\",\r\n      \"version\", \"windowscodecs\", \"wininet\"\r\n    }\r\n\r\n\r\n  project \"Installer\"\r\n    kind \"WindowedApp\"\r\n    language \"C++\"\r\n    flags { \"NoManifest\", \"WinMain\" }\r\n    defines { \"NO_LIBWEBP\", \"NO_LIBMUPDF\", \"HAVE_ZLIB\", \"HAVE_BZIP2\", \"HAVE_7Z\" }\r\n    resdefines { \"INSTALL_PAYLOAD_ZIP=.\\\\%{cfg.targetdir}\\\\InstallerData.dat\" }\r\n    disablewarnings {\r\n      \"4018\", \"4100\", \"4131\", \"4244\", \"4267\", \"4302\", \"4311\",\r\n      \"4312\", \"4456\", \"4457\", \"4838\", \"4702\", \"4706\", \"4996\"\r\n    }\r\n    installer_files()\r\n    includedirs { \"src\", \"src/utils\", \"ext/zlib\", \"ext/unarr\", \"ext/lzma/C\", \"ext/bzip2\" }\r\n    links {\r\n      \"comctl32\", \"gdiplus\", \"msimg32\", \"shlwapi\", \"urlmon\",\r\n      \"version\", \"windowscodecs\", \"wininet\"\r\n    }\r\n    dependson { \"MakeLZSA\", \"SumatraPDF-no-MUPDF\", \"PdfFilter\", \"PdfPreview\", \"Uninstaller\" }\r\n    -- Note: to allow 64-bit builds on 32-bit machine, always use 32-bit MakeLZSA.exe\r\n    -- TODO: checkin MakeLZSA.exe to bin and use that because this might still fail\r\n    -- if we didn't build 32-bit build first\r\n    prebuildcommands { \"cd %{cfg.targetdir} & ..\\\\rel\\\\MakeLZSA.exe InstallerData.dat SumatraPDF-no-MUPDF.exe:SumatraPDF.exe libmupdf.dll:libmupdf.dll PdfFilter.dll:PdfFilter.dll PdfPreview.dll:PdfPreview.dll Uninstaller.exe:uninstall.exe ..\\\\mupdf\\\\resources\\\\fonts\\\\droid\\\\DroidSansFallback.ttf:DroidSansFallback.ttf\"  }\r\n\r\n\r\n  -- dummy project that builds all other projects\r\n  project \"all\"\r\n    kind \"ConsoleApp\"\r\n    language \"C\"\r\n    -- premake has logic in vs2010_vcxproj.lua that only sets PlatformToolset\r\n    -- if there is a c/c++ file, so we add a no-op cpp file to force This logic\r\n    files { \"tools/premake/no_op_console.c\" }\r\n    dependson {\r\n      \"PdfPreview\", \"PdfFilter\", \"SumatraPDF\", \"SumatraPDF-no-MUPDF\",\r\n      \"test_util\", \"cmapdump\", \"signfile\", \"plugin-test\", \"MakeLZSA\",\r\n      \"mutool\", \"mudraw\", \"Uninstaller\", \"enginedump\", \"efi\", \"unarr\"\r\n    }\r\n"
  },
  {
    "path": "readme.md",
    "content": "##修改说明\r\n \r\nSumatraPDF 是非常优秀的epub/mobi/pdf阅读器,启动速度快,轻量小巧。但有些美中不足的是对中文书籍的支持不太好，经常出现标点符号导致不正确的换行，看起来很扎眼。\r\n\r\n\r\n\r\n所幸这是个开源软件，我就把下面的问题改了一下：\r\n\r\n- 每行固定字数，遇到标点不会导致换行，排版很工整\r\n- 把行间的行距加大了一些，看书时更舒服\r\n\r\n\r\n\r\n修改版下载地址\r\n\r\nhttps://github.com/jijinggang/sumatrapdf/raw/master/download/SumatraPDF.zip\r\n\r\n![截图](ScreenSnap.png)\r\n\r\n## SumatraPDF Reader\r\n\r\nSumatraPDF is a multi-format (PDF, EPUB, MOBI, FB2, CHM, XPS, DjVu) reader\r\nfor Windows under (A)GPLv3 license, with some code under BSD license (see\r\nAUTHORS).\r\n\r\nMore information:\r\n* [main website](http://www.sumatrapdfreader.org) with downloads and documentation\r\n* [wiki with more docs](https://github.com/sumatrapdfreader/sumatrapdf/wiki)\r\n\r\nTo compile you need Visual Studio 2015. [Free Community edition](https://www.visualstudio.com/products/visual-studio-community-vs)\r\nworks.\r\n\r\nOpen `vs2015/SumatraPDF.sln`.\r\n\r\n[![Build status](https://ci.appveyor.com/api/projects/status/tesjtgmpy26uf8p7?svg=true)](https://ci.appveyor.com/project/kjk/sumatrapdf)\r\n"
  },
  {
    "path": "scripts/SquareTree.py",
    "content": "\"\"\"\r\nThis is a helper library for parsing SquareTree files into a Python tree\r\nfor data extraction and for reserializing such data trees. See\r\n../src/utils/SquareTreeParser.cpp for the full specification of the format.\r\n\r\nUsage:\r\n\timport SquareTree\r\n\troot = SquareTree.Parse(data)\r\n\tprint root.GetValue(\"key\") # returns a string\r\n\tprint root.GetChild(\"node\") # returns a Node\r\n\t# returns the value of key of the second node named \"node\"\r\n\tprint root.GetChild(\"node\", 1).GetValue(\"key\")\r\n\tprint SquareTree.Serialize(root)\r\n\"\"\"\r\n\r\nimport os, re, util\r\n\r\nclass Node(object):\r\n\tdef __init__(self):\r\n\t\tself.data = []\r\n\r\n\tdef __repr__(self):\r\n\t\treturn repr(self.data)\r\n\r\n\tdef GetChild(self, name, idx=0):\r\n\t\tchildren = [item for item in self.data if type(item[1]) is Node and item[0].lower() == name.lower()]\r\n\t\treturn (children + [(name, None)] * (idx + 1))[idx][1]\r\n\r\n\tdef GetValue(self, name, idx=0):\r\n\t\tvalues = [item for item in self.data if type(item[1]) is not Node and item[0].lower() == name.lower()]\r\n\t\treturn (values + [(name, None)] * (idx + 1))[idx][1]\r\n\r\ndef Parse(data, level=0):\r\n\tif level == 0:\r\n\t\t# decode the file from UTF-8, UTF-16 or ANSI\r\n\t\tif data.startswith(\"\\xef\\xbb\\xbf\"):\r\n\t\t\tdata = data.decode(\"utf-8-sig\")\r\n\t\telif data.startswith(\"\\xff\\xfe\"):\r\n\t\t\tdata = data[2:].decode(\"utf-16\")\r\n\t\telse:\r\n\t\t\timport locale\r\n\t\t\tdata = data.decode(locale.getpreferredencoding())\r\n\t\tdata += \"\\n\"\r\n\r\n\tnode = Node()\r\n\twhile data:\r\n\t\t# skip blank lines, comments and whitespace at the beginning of a line\r\n\t\tskip = re.match(r\"(?:\\s+|[#;].*)+\", data)\r\n\t\tif skip:\r\n\t\t\tdata = data[len(skip.group(0)):]\r\n\t\t\tif not data:\r\n\t\t\t\tbreak\r\n\t\t# parse a single line into key, separator and value\r\n\t\tline = re.match(r\"([^=:\\[\\]\\n]*?)[^\\S\\n]*([=:\\[\\]])[^\\S\\n]*([^\\n]*?)[^\\S\\n]*\\n\", data)\r\n\t\tif not line:\r\n\t\t\tline = re.match(r\"([^=:\\[\\]\\n]*?)((?=\\s))[^\\S\\n]*([^\\n]*?)[^\\S\\n]*\\n\", data)\r\n\t\tassert line and len(line.groups()) == 3\r\n\t\tkey, sep, value = line.groups()\r\n\t\tassert sep in [\"=\", \":\", \"[\", \"]\", \"\"]\r\n\t\t# if a line contains just a key and the next non-empty line contains an opening bracket,\r\n\t\t# the key is the name of that subnode (instead of having a key with an empty value and a\r\n\t\t# subnode with an empty key)\r\n\t\tnodeKey = re.match(r\"([^=:\\[\\]\\n]*?)(?:\\s*(?:[#;].*\\n)?)+\\[\", data) if not sep and not value else None\r\n\t\tif sep == \"[\" and (not value or value[0] in [\"#\", \";\"]) or nodeKey:\r\n\t\t\t# parse the subnode\r\n\t\t\tdata = data[len(nodeKey.group(0) if nodeKey else line.group(0)):]\r\n\t\t\tsubnode, data = Parse(data, level + 1)\r\n\t\t\tnode.data.append((key, subnode))\r\n\t\t\t# if a subnode is directly followed by another unnamed subnode, reuse the same key\r\n\t\t\t# (instead of giving it an empty key or ignoring the line)\r\n\t\t\twhile True:\r\n\t\t\t\tnext = re.match(r\"(?:\\s*(?:[#;].*\\n)?)*\\[(?=\\s*?[#;\\n])\", data)\r\n\t\t\t\tif not next:\r\n\t\t\t\t\tbreak\r\n\t\t\t\tdata = data[len(next.group(0)):]\r\n\t\t\t\tsubnode, data = Parse(data, level + 1)\r\n\t\t\t\tnode.data.append((key, subnode))\r\n\t\telif sep == \"]\" and not key:\r\n\t\t\t# close the subnode (or ignore it if we're already at the top level)\r\n\t\t\tif level > 0:\r\n\t\t\t\treturn node, data[1:]\r\n\t\t\tdata = data[1:]\r\n\t\telif not key and sep == \"[\" and value.endswith(\"]\"):\r\n\t\t\t# interpret INI style section headers as the names of top-level nodes\r\n\t\t\tif level > 0:\r\n\t\t\t\treturn node, data\r\n\t\t\tdata = data[len(line.group(0)):]\r\n\t\t\tkey = line.group(0).strip()[1:-1].strip()\r\n\t\t\tsubnode, data = Parse(data, level + 1)\r\n\t\t\tnode.data.append((key, subnode))\r\n\t\telif sep in [\"=\", \":\", \"\"]:\r\n\t\t\t# this is a plain key-value pair\r\n\t\t\tdata = data[len(line.group(0)):]\r\n\t\t\tnode.data.append((key, value))\r\n\t\telse:\r\n\t\t\tassert False, \"invalid data line: %s\" % line.group(0)\r\n\r\n\tif level > 0:\r\n\t\treturn node, data\r\n\treturn node\r\n\r\ndef Serialize(root, level=0):\r\n\tresult = []\r\n\tfor node in (root.data if type(root) is Node else root):\r\n\t\tif type(node[1]) in [Node, list]:\r\n\t\t\tresult += [\"\\t\" * level + (node[0] + \" [\" if node[0] else \"[\")]\r\n\t\t\tresult += Serialize(node[1], level + 1)\r\n\t\t\tresult += [\"\\t\" * level + \"]\"]\r\n\t\telif type(node[1]) in [str, unicode]:\r\n\t\t\tresult += [\"\\t\" * level + node[0] + \" = \" + node[1]]\r\n\t\telse:\r\n\t\t\tassert False, \"value must be Node/list or string\"\r\n\r\n\tif level > 0:\r\n\t\treturn result\r\n\t# encode the result as UTF-8\r\n\treturn (\"\\n\".join(result) + \"\\n\").encode(\"utf-8-sig\")\r\n\r\nif __name__ == \"__main__\":\r\n\tutil.chdir_top()\r\n\r\n\tdata = \" Key : Value \\nNode\\n[\\n[ Node ]\\nKey=Value2\".encode(\"utf-8-sig\")\r\n\troot = Parse(data)\r\n\tassert root.GetValue(\"key\") == \"Value\"\r\n\tassert root.GetChild(\"node\")\r\n\tassert root.GetChild(\"node\", 1).GetValue(\"key\") == \"Value2\"\r\n\tdata = Serialize(root)\r\n\tassert Serialize(Parse(data)) == data\r\n\r\n\tpath = os.path.join(\"obj-dbg\", \"SumatraPDF-settings.txt\")\r\n\tif os.path.exists(path):\r\n\t\tdata = open(path).read()\r\n\t\troot = Parse(data)\r\n\t\t# modification example: filter out all states for missing files\r\n\t\troot.GetChild(\"FileStates\").data = [\r\n\t\t\tstate\r\n\t\t\tfor state in root.GetChild(\"FileStates\").data\r\n\t\t\tif state[1].GetValue(\"IsMissing\") != u\"true\"\r\n\t\t]\r\n\t\tdata = Serialize(root)\r\n\t\tassert Serialize(Parse(data)) == data\r\n"
  },
  {
    "path": "scripts/appveyor-build.bat",
    "content": "@ECHO OFF\r\nSETLOCAL\r\n\r\nREM assumes we're being run from top-level directory as:\r\nREM scripts\\appveyor-build-2.bat\r\n\r\nCALL scripts\\vc.bat\r\nIF ERRORLEVEL 1 EXIT /B 1\r\n\r\nmsbuild.exe \"vs2015\\SumatraPDF.sln\" \"/t:SumatraPDF;Installer;test_util\" \"/p:Configuration=Release;Platform=Win32\" /m\r\nIF ERRORLEVEL 1 EXIT /B 1\r\n\r\nmsbuild.exe \"vs2015\\SumatraPDF.sln\" \"/t:SumatraPDF;Installer;test_util\" \"/p:Configuration=Release;Platform=x64\" /m\r\nIF ERRORLEVEL 1 EXIT /B 1\r\n\r\nrel\\test_util.exe\r\nIF ERRORLEVEL 1 EXIT /B 1\r\n\r\nrel64\\test_util.exe\r\nIF ERRORLEVEL 1 EXIT /B 1\r\n\r\ncd rel\r\n.\\MakeLZSA.exe SumatraPDF.pdb.lzsa libmupdf.pdb:libmupdf.pdb Installer.pdb:Installer.pdb SumatraPDF-no-MuPDF.pdb:SumatraPDF-no-MuPDF.pdb SumatraPDF.pdb:SumatraPDF.pdb\r\nIF ERRORLEVEL 1 EXIT /B 1\r\n\r\ncd ..\\rel64\r\n.\\MakeLZSA.exe SumatraPDF.pdb.lzsa libmupdf.pdb:libmupdf.pdb Installer.pdb:Installer.pdb SumatraPDF-no-MuPDF.pdb:SumatraPDF-no-MuPDF.pdb SumatraPDF.pdb:SumatraPDF.pdb\r\nIF ERRORLEVEL 1 EXIT /B 1\r\n"
  },
  {
    "path": "scripts/build-pre-release-and-upload.bat",
    "content": "go run .\\tools\\build\\analyze.go .\\tools\\build\\cmd.go .\\tools\\build\\main.go .\\tools\\build\\s3.go .\\tools\\build\\util.go  -prerelease -upload %1 %2 %3\r\n"
  },
  {
    "path": "scripts/build-release-and-upload.bat",
    "content": "go run .\\tools\\build\\analyze.go .\\tools\\build\\cmd.go .\\tools\\build\\main.go .\\tools\\build\\s3.go .\\tools\\build\\util.go  -release -upload %1 %2 %3\n"
  },
  {
    "path": "scripts/build-release.bat",
    "content": "go run .\\tools\\build\\analyze.go .\\tools\\build\\cmd.go .\\tools\\build\\main.go .\\tools\\build\\s3.go .\\tools\\build\\util.go  -release %1 %2 %3\r\n"
  },
  {
    "path": "scripts/build-unarr.bat",
    "content": "@ECHO OFF\r\nSETLOCAL\r\n\r\nREM assumes we're being run from top-level directory as:\r\nREM scripts\\build-release.bat\r\n\r\nREM You can add Python to PATH if it's not already there\r\nREM SET PATH=C:\\Python;%PATH%\r\n\r\nCALL scripts\\vc.bat\r\nIF ERRORLEVEL 1 EXIT /B 1\r\n\r\nREM add our nasm.exe to the path\r\nSET PATH=%CD%\\bin;%PATH%\r\nnmake -f makefile.msvc unarr_test\r\n"
  },
  {
    "path": "scripts/build.bat",
    "content": "@rem flags:\r\n@rem   -release\r\n@rem   -prerelease\r\n@rem   -upload\r\n@rem   -no-clean-check\r\n\r\ngo run .\\tools\\build\\analyze.go .\\tools\\build\\cmd.go .\\tools\\build\\main.go .\\tools\\build\\s3.go .\\tools\\build\\util.go %1 %2 %3 %4 %5\r\n"
  },
  {
    "path": "scripts/check_accesskeys.py",
    "content": "\"\"\"\r\nLooks for accesskey collisions in translations.\r\n\r\nGroups of menu or dialog items which appear together can be marked as\r\n\r\n//[ ACCESSKEY_GROUP <name>\r\n... _TRN(\"Menu &Item\") ... _TRN(\"&Another Menu Item\") ...\r\n//] ACCESSKEY_GROUP <name>\r\n\r\nAll accesskeys used within a group are compared per translation and\r\nitems which share the same accesskey are reported so that they could\r\nbe changed to unique accesskeys.\r\n\"\"\"\r\n\r\nimport re, trans_download, trans_gen, trans_langs, util\r\n\r\ndef extract_accesskey_groups(path):\r\n\tgroups = {}\r\n\tgroup, group_name = None, None\r\n\talt_group = None\r\n\r\n\tfor line in open(path, \"r\").readlines():\r\n\t\tif line.startswith(\"//[ ACCESSKEY_GROUP \") or line.startswith(\"//] ACCESSKEY_GROUP \"):\r\n\t\t\tnew_name = line[20:].strip()\r\n\t\t\tif line[2] == '[':\r\n\t\t\t\tassert group is None, \"Group '%s' doesn't end before group '%s' starts\" % (group_name, new_name)\r\n\t\t\t\tgroup_name = new_name\r\n\t\t\t\tgroup = groups[group_name] = groups.get(group_name, [[]])\r\n\t\t\telse:\r\n\t\t\t\tassert group is not None, \"Unexpected group end ('%s')\" % new_name\r\n\t\t\t\tassert group_name == new_name, \"Group end mismatch: '%s' != '%s'\" (new_name, group_name)\r\n\t\t\t\tgroup = None\r\n\r\n\t\telif line.startswith(\"//[ ACCESSKEY_ALTERNATIVE\") or  line.startswith(\"//| ACCESSKEY_ALTERNATIVE\") or  line.startswith(\"//] ACCESSKEY_ALTERNATIVE\"):\r\n\t\t\tassert group is not None, \"Can't use ACCESSKEY_ALTERNATIVE outside of group\"\r\n\t\t\tassert line[25].isspace(), \"Typo?\"\r\n\t\t\tif line[2] == '[':\r\n\t\t\t\tassert alt_group is None, \"Nested ACCESSKEY_ALTERNATIVE isn't supported\"\r\n\t\t\t\talt_group = [[]]\r\n\t\t\t\tgroup[0].append(alt_group)\r\n\t\t\telif line[2] == '|':\r\n\t\t\t\tassert alt_group is not None, \"Unexpected ACCESSKEY_ALTERNATIVE alternative\"\r\n\t\t\t\talt_group.append([])\r\n\t\t\telse:\r\n\t\t\t\tassert alt_group is not None, \"Unexpected ACCESSKEY_ALTERNATIVE end\"\r\n\t\t\t\talt_group = None\r\n\r\n\t\telif group is not None:\r\n\t\t\tstrings = re.findall(trans_gen.TRANSLATION_PATTERN, line)\r\n\t\t\tfor string in strings:\r\n\t\t\t\tif string not in group:\r\n\t\t\t\t\tassert len(re.findall(\"&\", string)) <= 1, \"TODO: handle multiple '&' in strings\"\r\n\t\t\t\t\tgroup.append(string)\r\n\t\t\t\tif alt_group is not None:\r\n\t\t\t\t\talt_group[-1].append(string)\r\n\r\n\treturn groups\r\n\r\ndef get_alternate_ix(alternates, string):\r\n\tfor i in range(len(alternates)):\r\n\t\tfor j in range(len(alternates[i])):\r\n\t\t\tif string in alternates[i][j]:\r\n\t\t\t\treturn (i, j)\r\n\treturn None\r\n\r\ndef detect_accesskey_clashes(groups, translations):\r\n\tfor lang in trans_langs.g_langs:\r\n\t\tprint \"Accesskey issues for '%s'\" % lang[1]\r\n\t\tprint \"=\" * (23 + len(lang[1]))\r\n\t\twarnings = []\r\n\r\n\t\tfor (name, strings) in groups.items():\r\n\t\t\tused_keys, duplicates, alternates = {}, [], {}\r\n\r\n\t\t\tfor string in strings[1:]:\r\n\t\t\t\ttrans = ([item[1] for item in translations[string] if item[0] == lang[0]] + [string])[0]\r\n\t\t\t\tix = trans.find(\"&\")\r\n\t\t\t\tif ix == -1:\r\n\t\t\t\t\tif \"&\" in string:\r\n\t\t\t\t\t\twarnings.append(\"WARNING: Translation has no accesskey where original does:\")\r\n\t\t\t\t\t\twarnings.append(\"         \\\"%s\\\", \\\"%s\\\"\" % (string, trans))\r\n\t\t\t\t\tcontinue\r\n\t\t\t\tif ix == len(trans) - 1:\r\n\t\t\t\t\twarnings.append(\"ERROR: '&' must be followed by a letter (\\\"%s\\\")\" % trans)\r\n\t\t\t\t\tcontinue\r\n\t\t\t\tif \"&\" not in string:\r\n\t\t\t\t\twarnings.append(\"WARNING: Translation has accesskey where original doesn't:\")\r\n\t\t\t\t\twarnings.append(\"         \\\"%s\\\", \\\"%s\\\"\" % (string, trans))\r\n\r\n\t\t\t\tkey = trans[ix + 1].upper()\r\n\t\t\t\talternates[key] = alternates.get(key, [])\r\n\t\t\t\tif key in used_keys.keys():\r\n\t\t\t\t\tif None in alternates[key] or get_alternate_ix(strings[0], string) in alternates[key]:\r\n\t\t\t\t\t\tduplicates.append((key, trans))\r\n\t\t\t\t\telse:\r\n\t\t\t\t\t\talternates[key].append(get_alternate_ix(strings[0], string))\r\n\t\t\t\telse:\r\n\t\t\t\t\tif not key.isalnum():\r\n\t\t\t\t\t\twarnings.append(\"WARNING: Access key '%s' might not work on all keyboards (\\\"%s\\\")\" % (key, trans))\r\n\t\t\t\t\tused_keys[key] = trans\r\n\t\t\t\t\talternates[key].append(get_alternate_ix(strings[0], string))\r\n\r\n\t\t\tif duplicates:\r\n\t\t\t\tprint \"Clashes in accesskey group '%s':\" % name\r\n\t\t\t\tfor item in duplicates:\r\n\t\t\t\t\tprint \" * %s: \\\"%s\\\" and \\\"%s\\\"\" % (item[0].upper(), item[1], used_keys[item[0].upper()])\r\n\t\t\t\tavailable = [chr(i) for i in range(ord(\"A\"), ord(\"Z\") + 1) if chr(i) not in used_keys.keys()]\r\n\t\t\t\tprint \"   (available keys: %s)\" % \"\".join(available)\r\n\t\t\t\tprint\r\n\r\n\t\tprint \"\\n\".join(warnings)\r\n\t\tprint\r\n\r\ndef main():\r\n\tutil.chdir_top()\r\n\r\n\tgroups = {}\r\n\tfor file in trans_gen.C_FILES_TO_PROCESS:\r\n\t\tgroups.update(extract_accesskey_groups(file))\r\n\r\n\ttranslations = open(trans_download.lastDownloadFilePath(), \"rb\").read()\r\n\ttranslations = trans_download.parseTranslations(translations)\r\n\r\n\tdetect_accesskey_clashes(groups, translations)\r\n\r\nif __name__ == \"__main__\":\r\n\tmain()\r\n"
  },
  {
    "path": "scripts/clang-fmt.bat",
    "content": "@rem This requires clang-format to be installed and in %PATH%\r\n@rem http://llvm.org/releases/download.html\r\n@rem it's part of clang installer\r\n\r\ngo run .\\tools\\clang-fmt.go\r\n"
  },
  {
    "path": "scripts/coverity.bat",
    "content": "@rem CALL scripts\\vc.bat\r\n\r\nIF EXIST \"cov-int\" RD /q /s \"cov-int\"\r\nIF EXIST \"obj-rel\" RD /q /s \"obj-rel\"\r\nIF EXIST \"obj-dbg\" RD /q /s \"obj-dbg\"\r\nIF EXIST \"sumatrapdf-cov.lzma\" DEL \"sumatrapdf-cov.lzma\"\r\n\r\n@rem this should work but hangs on my (kjk) machine\r\n@rem cov-build --dir cov-int nmake -f makefile.msvc\r\n\r\n@rem this must be run from cygwin on my (kjk) machine because I don't have\r\n@rem svn installed\r\ncov-build --dir cov-int \"scripts\\build-release.bat\" -prerelease -noapptrans\r\ntar caf sumatrapdf-cov.lzma cov-int\r\n\r\n@echo \"now you must upload sumatrapdf-cov.lzma to https://scan.coverity.com/projects/1227\"\r\n"
  },
  {
    "path": "scripts/dedup_callstacks.py",
    "content": "#!/usr/bin/env python\r\n\r\n\"\"\"\r\nThis de-duplicates callstacks generated via SaveCallstackLogs() in Sumatra.\r\nThis is a debugging aid.\r\n\r\nThe process is:\r\n- call dbghelp::RememberCallstackLogs() at the beginning of WinMain\r\n- add dbghelp::LogCallstack() to functions you want to instrument\r\n- call SaveCallstackLogs() to save callstacks to callstacks.txt file in the\r\n  same directory where SumatraPDF.exe lives. Presumably, it'll be obj-dbg\r\n- run this script to generated callstacks_2.txt, which collapses the same\r\n  callstacks\r\n\r\nThis was written to help track down AddRef()/Release() mismatch, where\r\nlots of calls make analyzing the raw output difficult. It might be applicable\r\nin other scenarios.\r\n\"\"\"\r\n\r\nimport os\r\nimport sys\r\n\r\n# if True, will indent callstacks with Release() with spaces, to make\r\n# it easier to tell them from AddRef callstacks\r\ng_indent_release = True\r\n\r\ng_scripts_dir = os.path.dirname(os.path.realpath(__file__))\r\n\r\n\r\ndef top_dir():\r\n    return os.path.dirname(g_scripts_dir)\r\n\r\n\r\ndef verify_file_exists(path):\r\n    if not os.path.exists(path):\r\n        print(\"file %s doesn't exist\" % path)\r\n        sys.exit(1)\r\n\r\n\"\"\"\r\nTurns:\r\n00FD0389 01:0013F389 sumatrapdf.exe!dbghelp::LogCallstack+0x39 c:\\users\\kkowalczyk\\src\\sumatrapdf\\src\\utils\\dbghelpdyn.cpp+497\r\ninto:\r\nsumatrapdf.exe!dbghelp::LogCallstack+0x39 c:\\users\\kkowalczyk\\src\\sumatrapdf\\src\\utils\\dbghelpdyn.cpp+497\r\n\"\"\"\r\n\r\n\r\ndef shorten_cs_line(s):\r\n    parts = s.split(\" \", 3)\r\n    return parts[2]\r\n\r\n\r\ndef iter_callstacks(file_path):\r\n    curr = []\r\n    for l in open(file_path, \"r\"):\r\n        l = l.strip()\r\n        if 0 == len(l):\r\n            if len(curr) > 0:\r\n                yield curr\r\n                curr = []\r\n        else:\r\n            l = shorten_cs_line(l)\r\n            # omit first if it's sumatrapdf.exe!dbghelp::LogCallstack\r\n            if 0 == len(curr) and \"dbghelp::LogCallstack\" in l:\r\n                continue\r\n            curr.append(l)\r\n    if len(curr) > 0:\r\n        yield curr\r\n\r\n\r\ndef is_release(txt):\r\n    lines = txt.split(\"\\n\")\r\n    return len(lines) > 0 and \"::Release+\" in lines[0]\r\n\r\n\r\ndef fmt_release(txt):\r\n    lines = txt.split(\"\\n\")\r\n    return \"    \" + \"\\n    \".join(lines)\r\n\r\n\r\nclass CallStack(object):\r\n\r\n    def __init__(self, txt):\r\n        self.txt = txt\r\n        self.count = 1\r\n\r\n\r\ndef cs_add_or_inc_count(callstacks, txt):\r\n    for cs in callstacks:\r\n        if cs.txt == txt:\r\n            cs.count += 1\r\n            return\r\n    callstacks.append(CallStack(txt))\r\n\r\n\r\ndef parse_callstacks(file_path):\r\n    callstacks = []\r\n    for cs_lines in iter_callstacks(file_path):\r\n        txt = \"\\n\".join(cs_lines)\r\n        cs_add_or_inc_count(callstacks, txt)\r\n    return callstacks\r\n\r\n\r\ndef save_callstacks(file_path, callstacks):\r\n    fo = open(file_path, \"w\")\r\n    for cs in callstacks:\r\n        fo.write(\"count: %d\\n\" % cs.count)\r\n        txt = cs.txt\r\n        if g_indent_release and is_release(txt):\r\n            txt = fmt_release(txt)\r\n        fo.write(txt + \"\\n\\n\")\r\n    fo.close()\r\n\r\n\r\ndef main():\r\n    file_name = os.path.join(top_dir(), \"obj-dbg\", \"callstacks.txt\")\r\n    if len(sys.argv) > 1:\r\n        file_name = sys.argv[1]\r\n    verify_file_exists(file_name)\r\n    callstacks = parse_callstacks(file_name)\r\n    dst_name = file_name.replace(\".txt\", \"_2.txt\")\r\n    save_callstacks(dst_name, callstacks)\r\n    total = 0\r\n    for cs in callstacks:\r\n        total += cs.count\r\n    print(\"Collapsed %d callstacks into %d unique\" % (total, len(callstacks)))\r\n\r\nif __name__ == \"__main__\":\r\n    main()\r\n"
  },
  {
    "path": "scripts/diff.bat",
    "content": "go run .\\tools\\diff-preview.go\r\n"
  },
  {
    "path": "scripts/efi_cmp.bat",
    "content": "@ECHO OFF\r\n\r\nCALL scripts\\vc.bat\r\nIF NOT ERRORLEVEL 1 GOTO VSFOUND\r\nECHO Visual Studio 2013 doesn't seem to be installed\r\nEXIT /B 1\r\n\r\n:VSFOUND\r\n\r\nREM add our nasm.exe and StripReloc.exe to the path\r\nSET PATH=%CD%\\bin;%PATH%\r\n\r\npython -u -B scripts/efi_cmp.py %1 %2 %3 %4\r\n"
  },
  {
    "path": "scripts/efi_cmp.py",
    "content": "#!/usr/bin/env python\r\n\r\n\"\"\"\r\nUsage: efi_cmp.py $svn_ver1 $svn_ver2\r\n\r\nBuilds release build of both version. Uses efi.exe to dump symbol information\r\nfor each version and shows differences.\r\n\r\nRequires:\r\n - efi.exe to be in %PATH%\r\n - ../sumatrapdf_efi directory with Sumatra's svn checkout to exist.\r\n\r\nIt caches build artifacts (.exe, .pdb etc.) in ../sumatrapdf_efi/efi_cache\r\ndirectory. You might occasionally delete it, if disk space is a concern.\r\n\"\"\"\r\n\r\n\"\"\"\r\nTODO:\r\n - summary of biggest functions\r\n\r\nMaybe:\r\n - record data type (http://msdn.microsoft.com/en-US/library/w3a9kc5s(v=vs.80).aspx,\r\n   http://msdn.microsoft.com/en-US/library/b2x2t313(v=vs.80).aspx)\r\n\"\"\"\r\n\r\nimport sys\r\nimport os\r\n# assumes is being run as ./scripts/efi_cmp.py\r\nefi_scripts_dir = os.path.join(\"tools\", \"efi\")\r\nsys.path.append(efi_scripts_dir)\r\n\r\nimport os\r\nimport sys\r\nimport shutil\r\nimport util\r\nimport efiparse\r\n\r\ng_top_dir = os.path.realpath(\"..\")\r\n\r\ng_src_dir = os.path.join(\r\n    os.path.realpath(os.path.join(os.path.dirname(__file__), \"..\")))\r\n\r\n\r\ndef sum_efi_dir():\r\n    return os.path.join(g_top_dir, \"sumatrapdf_efi\")\r\n\r\n\r\ndef sumatra_dir():\r\n    return os.path.joing()\r\n\r\n\r\ndef sum_efi_cache_dir(ver):\r\n    # make it outside of sumatrapdf_efi directory?\r\n    d = os.path.join(sum_efi_dir(), \"efi_cache\", str(ver))\r\n    return util.create_dir(d)\r\n\r\n\r\ndef efi_result_file(ver):\r\n    return os.path.join(sum_efi_cache_dir(ver), \"efi.txt\")\r\n\r\n\r\ndef efi_result_bz2_file(ver):\r\n    return os.path.join(sum_efi_cache_dir(ver), \"efi.txt.bz2\")\r\n\r\n\r\ndef usage():\r\n    name = os.path.basename(__file__)\r\n    print(\"Usage: %s $svn_ver1 $svn_ver2\" % name)\r\n    sys.exit(1)\r\n\r\n\r\ndef verify_efi_present():\r\n    try:\r\n        (out, err, errcode) = util.run_cmd(\"efi.exe\")\r\n    except:\r\n        print(\"Must have efi.exe in the %PATH%!!!\")\r\n        sys.exit(1)\r\n    if \"Usage:\" not in out:\r\n        print(\"efi.exe created unexpected output:\\n%s\" % out)\r\n        sys.exit(1)\r\n\r\ng_build_artifacts = [\"SumatraPDF.exe\", \"SumatraPDF.pdb\"]\r\n\r\n\r\ndef already_built(ver):\r\n    d = sum_efi_cache_dir(ver)\r\n    for f in g_build_artifacts:\r\n        p = os.path.join(d, f)\r\n        if not os.path.exists(p):\r\n            return False\r\n    return True\r\n\r\n\r\ndef build_clean(ver):\r\n    config = \"CFG=rel\"\r\n    obj_dir = \"obj-rel\"\r\n    extcflags = \"EXTCFLAGS=-DSVN_PRE_RELEASE_VER=%s\" % str(ver)\r\n    platform = \"PLATFORM=X86\"\r\n    shutil.rmtree(obj_dir, ignore_errors=True)\r\n    shutil.rmtree(os.path.join(\"mupdf\", \"generated\"), ignore_errors=True)\r\n    (out, err, errcode) = util.run_cmd(\"nmake\", \"-f\",\r\n                                       \"makefile.msvc\", config, extcflags, platform, \"all_sumatrapdf\")\r\n\r\n\r\ndef build_ver(ver):\r\n    raise BaseException(\"NYI for git\")\r\n\r\n    print(\"Building release version %d\" % ver)\r\n    obj_dir = \"obj-rel\"\r\n\r\n    if already_built(ver):\r\n        print(\"Version %d already built!\" % ver)\r\n        return\r\n    os.chdir(sum_efi_dir())\r\n    util.run_cmd_throw(\"svn\", \"update\", \"-r%d\" % ver)\r\n    build_clean(ver)\r\n\r\n    for f in g_build_artifacts:\r\n        src = os.path.join(obj_dir, f)\r\n        dst = os.path.join(sum_efi_cache_dir(ver), f)\r\n        shutil.copyfile(src, dst)\r\n\r\n\r\ndef build_efi_result(ver):\r\n    path = efi_result_file(ver)\r\n    if os.path.exists(path):\r\n        return  # was already done\r\n    os.chdir(sum_efi_cache_dir(ver))\r\n    util.run_cmd_throw(\"efi\", \"SumatraPDF.exe\", \">efi.txt\")\r\n    util.bz_file_compress(\"efi.txt\", \"efi.txt.bz2\")\r\n\r\n\r\ndef build_efi_result_current():\r\n    os.chdir(\"obj-rel\")\r\n    util.run_cmd_throw(\"efi\", \"SumatraPDF.exe\", \">efi.txt\")\r\n    util.bz_file_compress(\"efi.txt\", \"efi.txt.bz2\")\r\n\r\n\r\ndef print_side_by_size(diff):\r\n    added = diff.added\r\n    removed = diff.removed\r\n    n = max(len(added), len(removed))\r\n    rows = [[\"\", \"added\", \"\", \"removed\"]]\r\n    for i in range(n):\r\n        s1 = \"\"\r\n        n1 = \"\"\r\n        if i < len(added):\r\n            sym = added[i]\r\n            s1 = str(sym.size)\r\n            n1 = sym.full_name()\r\n        s2 = \"\"\r\n        n2 = \"\"\r\n        if i < len(removed):\r\n            sym = removed[i]\r\n            s2 = str(sym.size)\r\n            n2 = sym.full_name()\r\n        rows.append([s1, n1, s2, n2])\r\n    rows = util.fmt_rows(\r\n        rows, [util.FMT_LEFT, util.FMT_RIGHT, util.FMT_LEFT, util.FMT_RIGHT])\r\n    lines = [\"  %s : %s | %s : %s\" % (e1, e2, e3, e4)\r\n             for (e1, e2, e3, e4) in rows]\r\n    s = \"\\n\".join(lines)\r\n    print(s)\r\n\r\n\r\ndef diff_as_str(diff, max=-1):\r\n    lines = []\r\n    added = diff.added\r\n    if len(added) > 0:\r\n        lines.append(\"\\nAdded symbols:\")\r\n        if max != -1:\r\n            added = added[:max]\r\n        for sym in added:\r\n            #sym = diff.syms2.name_to_sym[sym_name]\r\n            size = sym.size\r\n            s = \"%4d : %s\" % (size, sym.full_name())\r\n            lines.append(s)\r\n\r\n    removed = diff.removed\r\n    if len(removed) > 0:\r\n        lines.append(\"\\nRemoved symbols:\")\r\n        if max != -1:\r\n            removed = removed[:max]\r\n        for sym in removed:\r\n            #sym = diff.syms2.name_to_sym[sym_name]\r\n            size = sym.size\r\n            s = \"%4d : %s\" % (size, sym.full_name())\r\n            lines.append(s)\r\n\r\n    changed = diff.changed\r\n    if len(changed) > 0:\r\n        lines.append(\"\\nChanged symbols:\")\r\n        if max != -1:\r\n            changed = changed[:max]\r\n        for sym in changed:\r\n            size = sym.size_diff\r\n            s = \"%4d : %s\" % (size, sym.full_name())\r\n            lines.append(s)\r\n    return \"\\n\".join(lines)\r\n\r\n\r\ndef diff_efi(efi1_path, efi2_path):\r\n    obj_file_splitters = [\"obj-rel\\\\\", \"INTEL\\\\\"]\r\n    efi1 = efiparse.parse_file(efi1_path, obj_file_splitters)\r\n    efi2 = efiparse.parse_file(efi2_path, obj_file_splitters)\r\n    diff = efiparse.diff(efi1, efi2)\r\n    #print(\"Diffing done\")\r\n    s = str(diff)\r\n    diff.added.sort(key=lambda sym: sym.size, reverse=True)\r\n    diff.removed.sort(key=lambda sym: sym.size, reverse=True)\r\n    diff.changed.sort(key=lambda sym: sym.size_diff, reverse=True)\r\n    s = s + diff_as_str(diff)\r\n    return s\r\n\r\n# compare the build of the current state of the tree (including changes not\r\n# checked in) with the last svn revision.\r\n# last svn revision is built in ../sumatrapdf_efi\r\n\r\n\r\ndef cmp_with_last():\r\n    os.chdir(sum_efi_dir())\r\n    (local_ver, latest_ver) = util.get_svn_versions()\r\n    latest_ver = int(latest_ver)\r\n    build_ver(latest_ver)\r\n    build_efi_result(latest_ver)\r\n    os.chdir(g_src_dir)\r\n    build_clean(latest_ver + 1)\r\n    build_efi_result_current()\r\n    s = diff_efi(efi_result_bz2_file(latest_ver), \"efi.txt.bz2\")\r\n    print(s)\r\n    with open(\"last_efi_cmp.txt\", \"w\") as fo:\r\n        fo.write(s)\r\n\r\n\r\ndef main():\r\n    # early checks\r\n    assert os.path.exists(sum_efi_dir()), \"Need %s directory\" % sum_efi_dir()\r\n    verify_efi_present()\r\n\r\n    if \"-with-last\" in sys.argv:\r\n        cmp_with_last()\r\n        sys.exit(1)\r\n\r\n    if len(sys.argv) != 3:\r\n        usage()\r\n    svn_ver1 = int(sys.argv[1])\r\n    svn_ver2 = int(sys.argv[2])\r\n    if svn_ver1 == svn_ver2:\r\n        print(\"Versions have to be different!\")\r\n        usage()\r\n    print(\"Comparing %d to %d\" % (svn_ver1, svn_ver2))\r\n    build_ver(svn_ver1)\r\n    build_efi_result(svn_ver1)\r\n    build_ver(svn_ver2)\r\n    build_efi_result(svn_ver2)\r\n    s = diff_efi(efi_result_bz2_file(svn_ver1), efi_result_bz2_file(svn_ver2))\r\n    print(s)\r\n\r\nif __name__ == \"__main__\":\r\n    main()\r\n"
  },
  {
    "path": "scripts/efi_cmp_with_last.bat",
    "content": "@ECHO OFF\r\n\r\nCALL scripts\\vc.bat\r\nIF NOT ERRORLEVEL 1 GOTO VSFOUND\r\nECHO Visual Studio 2013 doesn't seem to be installed\r\nEXIT /B 1\r\n\r\n:VSFOUND\r\n\r\nREM add our nasm.exe and StripReloc.exe to the path\r\nSET PATH=%CD%\\bin;%PATH%\r\n\r\npython -u -B scripts/efi_cmp.py -with-last\r\n"
  },
  {
    "path": "scripts/gen_htmlparserlookup.py",
    "content": "#!/usr/bin/env python\r\n\"\"\"\r\nThis script generates fairly fast C code for the following function:\r\nGiven a string, see if it belongs to a known set of strings. If it does,\r\nreturn a value corresponding to that string.\r\n\"\"\"\r\n\r\nimport util\r\n\r\nTemplate_Defines = \"\"\"\\\r\n#define CS1(c1)             (c1)\r\n#define CS2(c1, c2)         (CS1(c1) | (c2 << 8))\r\n#define CS3(c1, c2, c3)     (CS2(c1, c2) | (c3 << 16))\r\n#define CS4(c1, c2, c3, c4) (CS3(c1, c2, c3) | (c4 << 24))\r\n\r\n#define STR1(s) ((s)[0])\r\n#define STR2(s) (STR1(s) | ((s)[1] << 8))\r\n#define STR3(s) (STR2(s) | ((s)[2] << 16))\r\n#define STR4(s) (STR3(s) | ((s)[3] << 24))\r\n\r\n#define lower(c) ((c) < 'A' || (c) > 'Z' ? (c) : (c) - 'A' + 'a')\r\n\r\n#define STR1i(s) (lower((s)[0]))\r\n#define STR2i(s) (STR1i(s) | (lower((s)[1]) << 8))\r\n#define STR3i(s) (STR2i(s) | (lower((s)[2]) << 16))\r\n#define STR4i(s) (STR3i(s) | (lower((s)[3]) << 24))\r\n\"\"\"\r\n\r\nTemplate_Find_Function = \"\"\"\\\r\n%s Find%s(const char *name, size_t len)\r\n{\r\n\tuint32_t key = 0 == len ? 0 : 1 == len ? STR1i(name) :\r\n\t               2 == len ? STR2i(name) : 3 == len ? STR3i(name) : STR4i(name);\r\n\tswitch (key) {\r\n\t%s\r\n\t}\r\n\treturn %s;\r\n}\r\n\"\"\"\r\n\r\nTemplate_Enumeration = \"\"\"\\\r\nenum %s {\r\n\t%s\r\n};\r\n\"\"\"\r\n\r\nTemplate_Selector = \"\"\"\\\r\nbool %s(%s item)\r\n{\r\n\tswitch (item) {\r\n\t%s\r\n\t\treturn true;\r\n\tdefault:\r\n\t\treturn false;\r\n\t}\r\n}\r\n\"\"\"\r\n\r\n# given e.g. \"br\" returns \"Tag_Br\"\r\ndef getEnumName(name, prefix):\r\n\tparts = name.replace(\"-\", \":\").split(\":\")\r\n\tparts = [p[0].upper() + p[1:].lower() for p in parts]\r\n\treturn \"_\".join([prefix] + parts)\r\n\r\n# given e.g. \"abcd\" returns \"'a','b','c','d'\"\r\ndef splitChars(chars):\r\n\treturn \"'\" + \"','\".join(chars) + \"'\"\r\n\r\ndef unTab(string):\r\n\treturn string.replace(\"\\t\", \"    \")\r\n\r\n# creates a lookup function that works with one switch for quickly\r\n# finding (or failing to find) the correct value\r\ndef createFastFinder(list, type, default, caseInsensitive, funcName=None):\r\n\tlist = sorted(list, key=lambda a: a[0])\r\n\toutput = []\r\n\twhile list:\r\n\t\tname, value = list.pop(0)\r\n\t\tif len(name) < 4:\r\n\t\t\t# no further comparison is needed for names less than 4 characters in length\r\n\t\t\toutput.append('case CS%d(%s): return %s;' % (len(name), splitChars(name), value))\r\n\t\telse:\r\n\t\t\t# for longer names, do either another quick check (up to 8 characters)\r\n\t\t\t# or use str::EqN(I) for longer names\r\n\t\t\toutput.append('case CS4(%s):' % \"'%s'\" % \"','\".join(name[:4]))\r\n\t\t\twhile True:\r\n\t\t\t\tif len(name) == 4:\r\n\t\t\t\t\toutput.append(\"\tif (4 == len) return %s;\" % value)\r\n\t\t\t\telif len(name) <= 8:\r\n\t\t\t\t\trest = name[4:]\r\n\t\t\t\t\toutput.append('\tif (%d == len && CS%d(%s) == STR%di(name + 4)) return %s;' %\r\n\t\t\t\t\t\t(len(name), len(rest), splitChars(rest), len(rest), value))\r\n\t\t\t\telse:\r\n\t\t\t\t\toutput.append('\tif (%d == len && str::EqNI(name + 4, \"%s\", %d)) return %s;' %\r\n\t\t\t\t\t\t(len(name), name[4:], len(name) - 4, value))\r\n\t\t\t\t# reuse the same case for names that start the same\r\n\t\t\t\tif not list or list[0][0][:4] != name[:4]:\r\n\t\t\t\t\tbreak\r\n\t\t\t\tname, value = list.pop(0)\r\n\t\t\toutput.append('\tbreak;')\r\n\r\n\toutput = Template_Find_Function % (type, funcName or type, \"\\n\t\".join(output), default)\r\n\tif not caseInsensitive:\r\n\t\toutput = output.replace(\"STR1i(\", \"STR1(\").replace(\"STR2i(\", \"STR2(\")\r\n\t\toutput = output.replace(\"STR3i(\", \"STR3(\").replace(\"STR4i(\", \"STR4(\")\r\n\t\toutput = output.replace(\"str::EqNI(\", \"str::EqN(\")\r\n\telse:\r\n\t\tassert not [c for c in output if c > '\\x7f'], \"lower() only supports ASCII letters\"\r\n\treturn unTab(output)\r\n\r\n# creates an enumeration that can be used as a result for the lookup function\r\n# (which would allow to \"internalize\" a string)\r\ndef createTypeEnum(list, type, default):\r\n\tlist = sorted(list, key=lambda a: a[0])\r\n\tparts = util.group([item[1] for item in list] + [default], 5)\r\n\treturn unTab(Template_Enumeration % (type, \",\\n\t\".join([\", \".join(part) for part in parts])))\r\n\r\ndef createFastSelector(fullList, nameList, funcName, type):\r\n\tcases = [\"case %s:\" % value for (name, value) in fullList if name in nameList]\r\n\treturn unTab(Template_Selector % (funcName, type, \"\\n\t\".join([\" \".join(part) for part in util.group(cases, 4)])))\r\n\r\n########## HTML tags and attributes ##########\r\n\r\n# This list has been generated by instrumenting HtmlFormatter.cpp\r\n# to dump all tags we see in a mobi file and also some from EPUB and FB2 files\r\nList_HTML_Tags = \"a abbr acronym area audio b base basefont blockquote body br center code col dd div dl dt em font frame h1 h2 h3 h4 h5 h6 head hr html i img input lh li link meta nav object ol p param pre s script section small span strike strong style sub sup table td th title tr tt u ul video\"\r\nList_Other_Tags = \"image mbp:pagebreak pagebreak subtitle svg svg:image\"\r\nList_Align_Values = \"center justify left right\"\r\n# TODO: this incomplete list is currently unused\r\nList_HTML_Attrs = \"align bgcolor border class clear colspan color controls face height href id lang link rowspan size style title valign value vlink width\"\r\nList_Other_Attrs = \"filepos mediarecindex recindex xmlns\"\r\n\r\n# these tags must all also appear in List_HTML_Tags or List_Other_Tags (else they're ignored)\r\nList_Self_Closing_Tags = \"area base basefont br col frame hr img input link mbp:pagebreak meta pagebreak param\"\r\nList_Inline_Tags = \"a abbr acronym audio b code em font i s small span strike strong sub sup tt u video\"\r\n\r\n########## HTML and XML entities ##########\r\n\r\nTemplate_Entities_Comment = \"\"\"\\\r\n// map of entity names to their Unicode runes, cf.\r\n// http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references\r\n// and http://www.w3.org/TR/MathML2/bycodes.html\r\n\"\"\"\r\n\r\n# selection of MathML2 entities that aren't HTML entities\r\nList_MathML2_Entities = [(\"DoubleDot\", 168), (\"OverBar\", 175), (\"PlusMinus\", 177), (\"Cedilla\", 184), (\"Amacr\", 256), (\"amacr\", 257), (\"Abreve\", 258), (\"abreve\", 259), (\"Aogon\", 260), (\"aogon\", 261), (\"Cacute\", 262), (\"cacute\", 263), (\"Ccirc\", 264), (\"ccirc\", 265), (\"Cdot\", 266), (\"cdot\", 267), (\"Ccaron\", 268), (\"ccaron\", 269), (\"Dcaron\", 270), (\"dcaron\", 271), (\"Dstrok\", 272), (\"dstrok\", 273), (\"Emacr\", 274), (\"emacr\", 275), (\"Edot\", 278), (\"edot\", 279), (\"Eogon\", 280), (\"eogon\", 281), (\"Ecaron\", 282), (\"ecaron\", 283), (\"Gcirc\", 284), (\"gcirc\", 285), (\"Gbreve\", 286), (\"gbreve\", 287), (\"Gdot\", 288), (\"gdot\", 289), (\"Gcedil\", 290), (\"Hcirc\", 292), (\"hcirc\", 293), (\"Hstrok\", 294), (\"hstrok\", 295), (\"Itilde\", 296), (\"itilde\", 297), (\"Imacr\", 298), (\"imacr\", 299), (\"Iogon\", 302), (\"iogon\", 303), (\"Idot\", 304), (\"IJlig\", 306), (\"ijlig\", 307), (\"Jcirc\", 308), (\"jcirc\", 309), (\"Kcedil\", 310), (\"kcedil\", 311), (\"kgreen\", 312), (\"Lacute\", 313), (\"lacute\", 314), (\"Lcedil\", 315), (\"lcedil\", 316), (\"Lcaron\", 317), (\"lcaron\", 318), (\"Lmidot\", 319), (\"lmidot\", 320), (\"Lstrok\", 321), (\"lstrok\", 322), (\"Nacute\", 323), (\"nacute\", 324), (\"Ncedil\", 325), (\"ncedil\", 326), (\"Ncaron\", 327), (\"ncaron\", 328), (\"napos\", 329), (\"ENG\", 330), (\"eng\", 331), (\"Omacr\", 332), (\"omacr\", 333), (\"Odblac\", 336), (\"odblac\", 337), (\"Racute\", 340), (\"racute\", 341), (\"Rcedil\", 342), (\"rcedil\", 343), (\"Rcaron\", 344), (\"rcaron\", 345), (\"Sacute\", 346), (\"sacute\", 347), (\"Scirc\", 348), (\"scirc\", 349), (\"Scedil\", 350), (\"scedil\", 351), (\"Tcedil\", 354), (\"tcedil\", 355), (\"Tcaron\", 356), (\"tcaron\", 357), (\"Tstrok\", 358), (\"tstrok\", 359), (\"Utilde\", 360), (\"utilde\", 361), (\"Umacr\", 362), (\"umacr\", 363), (\"Ubreve\", 364), (\"ubreve\", 365), (\"Uring\", 366), (\"uring\", 367), (\"Udblac\", 368), (\"udblac\", 369), (\"Uogon\", 370), (\"uogon\", 371), (\"Wcirc\", 372), (\"wcirc\", 373), (\"Ycirc\", 374), (\"ycirc\", 375), (\"Zacute\", 377), (\"zacute\", 378), (\"Zdot\", 379), (\"zdot\", 380), (\"Zcaron\", 381), (\"zcaron\", 382), (\"imped\", 437), (\"gacute\", 501), (\"Hacek\", 711), (\"Breve\", 728), (\"DiacriticalDot\", 729), (\"ring\", 730), (\"ogon\", 731), (\"DiacriticalTilde\", 732), (\"DiacriticalDoubleAcute\", 733), (\"DownBreve\", 785), (\"UnderBar\", 818), (\"varepsilon\", 949), (\"varsigma\", 962), (\"varphi\", 966), (\"vartheta\", 977), (\"Upsi\", 978), (\"straightphi\", 981), (\"varpi\", 982), (\"Gammad\", 988), (\"digamma\", 989), (\"varkappa\", 1008), (\"varrho\", 1009), (\"straightepsilon\", 1013), (\"backepsilon\", 1014)]\r\n\r\nfrom htmlentitydefs import entitydefs\r\nentitydefs['apos'] = \"'\" # only XML entity that isn't an HTML entity as well\r\nList_HTML_Entities = []\r\nfor name, value in entitydefs.items():\r\n\tList_HTML_Entities.append((name, value[2:-1] or str(ord(value))))\r\nfor (name, value) in List_MathML2_Entities:\r\n\tassert name not in entitydefs\r\n\tList_HTML_Entities.append((name, str(value)))\r\n\r\n########## CSS properties ##########\r\n\r\nList_CSS_Props = \"color display font font-family font-size font-style font-weight list-style margin margin-bottom margin-left margin-right margin-top max-width opacity padding padding-bottom padding-left padding-right padding-top page-break-after page-break-before text-align text-decoration text-indent text-underline white-space word-wrap\"\r\n\r\n########## CSS colors ##########\r\n\r\n# array of name/value for css colors, value is what goes inside MKRGB()\r\n# based on https://developer.mozilla.org/en/CSS/color_value\r\n# TODO: add more colors\r\nList_CSS_Colors = [\r\n\t(\"black\",        \"  0,  0,  0\"),\r\n\t(\"white\",        \"255,255,255\"),\r\n\t(\"gray\",         \"128,128,128\"),\r\n\t(\"red\",          \"255,  0,  0\"),\r\n\t(\"green\",        \"  0,128,  0\"),\r\n\t(\"blue\",         \"  0,  0,255\"),\r\n\t(\"yellow\",       \"255,255,  0\"),\r\n];\r\n# fallback is the transparent color MKRGBA(0,0,0,0)\r\n\r\n########## main ##########\r\n\r\nTemplate_Lookup_Header = \"\"\"\\\r\n/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// This file is auto-generated by gen_htmlparserlookup.py\r\n\r\n%(enum_htmltag)s\r\n%(enum_alignattr)s\r\nHtmlTag         FindHtmlTag(const char *name, size_t len);\r\nbool            IsTagSelfClosing(HtmlTag item);\r\nbool            IsInlineTag(HtmlTag item);\r\nAlignAttr       FindAlignAttr(const char *name, size_t len);\r\nuint32_t        FindHtmlEntityRune(const char *name, size_t len);\r\n\r\n%(enum_cssprop)s\r\nCssProp         FindCssProp(const char *name, size_t len);\r\n\"\"\"\r\n\r\nTemplate_Lookup_Code = \"\"\"\\\r\n/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// This file is auto-generated by gen_htmlparserlookup.py\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n\r\n%(code_defines)s\r\n%(code_htmltag)s\r\n%(code_selfclosing)s\r\n%(code_inlinetag)s\r\n%(code_alignattr)s\r\n%(code_htmlentity)s\r\n%(code_cssprop)s\r\n\"\"\"\r\n\r\ndef main():\r\n\tutil.chdir_top()\r\n\r\n\ttags = [(name, getEnumName(name, \"Tag\")) for name in sorted(List_HTML_Tags.split() + List_Other_Tags.split())]\r\n\tattrs = [(name, getEnumName(name, \"Attr\")) for name in sorted(List_HTML_Attrs.split() + List_Other_Attrs.split())]\r\n\taligns = [(name, getEnumName(name, \"Align\")) for name in sorted(List_Align_Values.split())]\r\n\tcssProps = [(name, getEnumName(name, \"Css\")) for name in sorted(List_CSS_Props.split())]\r\n\tcssColors = [(name, \"MKRGB(%s)\" % value) for (name, value) in sorted(List_CSS_Colors)]\r\n\r\n\tenum_htmltag = createTypeEnum(tags, \"HtmlTag\", \"Tag_NotFound\")\r\n\tenum_htmlattr = createTypeEnum(attrs, \"HtmlAttr\", \"Attr_NotFound\")\r\n\tenum_alignattr = createTypeEnum(aligns, \"AlignAttr\", \"Align_NotFound\")\r\n\tenum_cssprop = createTypeEnum(cssProps, \"CssProp\", \"Css_Unknown\")\r\n\r\n\tcode_defines = Template_Defines\r\n\tcode_htmltag = createFastFinder(tags, \"HtmlTag\", \"Tag_NotFound\", True)\r\n\tcode_htmlattr = createFastFinder(attrs, \"HtmlAttr\", \"Attr_NotFound\", True)\r\n\tcode_selfclosing = createFastSelector(tags, List_Self_Closing_Tags.split(), \"IsTagSelfClosing\", \"HtmlTag\")\r\n\tcode_inlinetag = createFastSelector(tags, List_Inline_Tags.split(), \"IsInlineTag\", \"HtmlTag\")\r\n\tcode_alignattr = createFastFinder(aligns, \"AlignAttr\", \"Align_NotFound\", True)\r\n\tcode_htmlentity = Template_Entities_Comment + \"\\n\" + createFastFinder(List_HTML_Entities, \"uint32_t\", \"(uint32_t)-1\", False, \"HtmlEntityRune\")\r\n\tcode_cssprop = createFastFinder(cssProps, \"CssProp\", \"Css_Unknown\", True)\r\n\tcode_csscolor = createFastFinder(cssColors, \"ARGB\", \"MKRGBA(0,0,0,0)\", True, \"CssColor\")\r\n\r\n\tcontent = Template_Lookup_Header % locals()\r\n\topen(\"src/utils/HtmlParserLookup.h\", \"wb\").write(content.replace(\"\\n\", \"\\r\\n\"))\r\n\tcontent = Template_Lookup_Code[:-1] % locals()\r\n\topen(\"src/utils/HtmlParserLookup.cpp\", \"wb\").write(content.replace(\"\\n\", \"\\r\\n\"))\r\n\r\nif __name__ == \"__main__\":\r\n\tmain()\r\n"
  },
  {
    "path": "scripts/gen_libmupdf.def.py",
    "content": "#!/usr/bin/env python\r\n\r\n\"\"\"\r\nGenerates a list of all exports from libmupdf.dll from the function lists\r\ncontained in the mupdf/include/* headers (only MuPDF and MuXPS are included)\r\nand adds exports for the other libraries contained within libmupdf.dll but\r\nused by SumatraPDF-no-MuPDF.exe (unarr, libdjvu, zlib, lzma, libwebp).\r\n\"\"\"\r\n\r\nimport os, re, util\r\n\r\ndef generateExports(header, exclude=[]):\r\n\tif os.path.isdir(header):\r\n\t\treturn \"\\n\".join([generateExports(os.path.join(header, file), exclude) for file in os.listdir(header)])\r\n\r\n\tdata = open(header, \"r\").read()\r\n\tdata = re.sub(r\"(?sm)^#ifndef NDEBUG\\s.*?^#endif\", \"\", data, 0)\r\n\tdata = re.sub(r\"(?sm)^#ifdef ARCH_ARM\\s.*?^#endif\", \"\", data, 0)\r\n\tdata = re.sub(r\"(?sm)^#ifdef FITZ_DEBUG_LOCKING\\s.*?^#endif\", \"\", data, 0)\r\n\tdata = data.replace(\" FZ_NORETURN;\", \";\")\r\n\tfunctions = re.findall(r\"(?sm)^\\w+ (?:\\w+ )?\\*?(\\w+)\\(.*?\\);\", data)\r\n\treturn \"\\n\".join([\"\\t\" + name for name in functions if name not in exclude])\r\n\r\ndef collectFunctions(file):\r\n\tdata = open(file, \"r\").read()\r\n\treturn re.findall(r\"(?sm)^\\w+(?: \\*\\n|\\n| \\*| )((?:fz_|pdf_|xps_)\\w+)\\(\", data)\r\n\r\nLIBMUPDF_DEF = \"\"\"\\\r\n; This file is auto-generated by gen_libmupdf.def.py\r\n\r\nLIBRARY libmupdf\r\nEXPORTS\r\n\r\n; Fitz exports\r\n\r\n%(fitz_exports)s\r\n\r\n; MuPDF exports\r\n\r\n%(mupdf_exports)s\r\n\r\n; MuXPS exports\r\n\r\n%(muxps_exports)s\r\n\r\n; unarr exports (required for ArchUtil, ZipUtil)\r\n\r\n%(unarr_exports)s\r\n\r\n; djvu exports (required for DjVuEngine)\r\n\r\n\tddjvu_anno_get_hyperlinks\r\n\tddjvu_context_create\r\n\tddjvu_context_release\r\n\tddjvu_document_create_by_data\r\n\tddjvu_document_create_by_filename_utf8\r\n\tddjvu_document_get_fileinfo_imp\r\n\tddjvu_document_get_filenum\r\n\tddjvu_document_get_outline\r\n\tddjvu_document_get_pageanno\r\n\tddjvu_document_get_pageinfo_imp\r\n\tddjvu_document_get_pagenum\r\n\tddjvu_document_get_pagetext\r\n\tddjvu_document_job\r\n\tddjvu_format_create\r\n\tddjvu_format_release\r\n\tddjvu_format_set_row_order\r\n\tddjvu_free\r\n\tddjvu_job_release\r\n\tddjvu_job_status\r\n\tddjvu_message_peek\r\n\tddjvu_message_pop\r\n\tddjvu_message_wait\r\n\tddjvu_miniexp_release\r\n\tddjvu_page_create_by_pageno\r\n\tddjvu_page_get_type\r\n\tddjvu_page_job\r\n\tddjvu_page_render\r\n\tddjvu_page_set_rotation\r\n\tddjvu_stream_close\r\n\tddjvu_stream_write\r\n\tminiexp_caddr\r\n\tminiexp_cadr\r\n\tminiexp_cddr\r\n\tminiexp_stringp\r\n\tminiexp_symbol\r\n\tminiexp_to_str\r\n\tminilisp_finish\r\n\r\n; zlib exports (required for ZipUtil, PsEngine, PdfCreator, LzmaSimpleArchive)\r\n\r\n\tcrc32\r\n\tdeflate\r\n\tdeflateEnd\r\n\tdeflateInit_\r\n\tdeflateInit2_\r\n\tgzclose\r\n\tgzerror\r\n\tgzopen\r\n\tgzopen_w\r\n\tgzprintf\r\n\tgzread\r\n\tgzseek\r\n\tgztell\r\n\tinflate\r\n\tinflateEnd\r\n\tinflateInit_\r\n\tinflateInit2_\r\n\r\n; lzma exports (required for LzmaSimpleArchive)\r\n\r\n\tLzmaDecode\r\n\tx86_Convert\r\n\r\n; libwebp exports (required for WebpReader)\r\n\r\n\tWebPDecodeBGRAInto\r\n\tWebPGetInfo\r\n\"\"\"\r\n\r\ndef main():\r\n\tutil.chdir_top()\r\n\tos.chdir(\"mupdf\")\r\n\r\n\t# don't include/export doc_* functions, support for additional input/output formats and form support\r\n\tdoc_exports = collectFunctions(\"source/fitz/document.c\") + collectFunctions(\"source/fitz/document-all.c\") + collectFunctions(\"source/fitz/document-no-run.c\") + [\"fz_get_annot_type\"]\r\n\tmore_formats = collectFunctions(\"source/fitz/svg-device.c\") + collectFunctions(\"source/fitz/output-pcl.c\") + collectFunctions(\"source/fitz/output-pwg.c\")\r\n\tform_exports = collectFunctions(\"source/pdf/pdf-form.c\") + collectFunctions(\"source/pdf/pdf-event.c\") + collectFunctions(\"source/pdf/pdf-appearance.c\") + collectFunctions(\"source/pdf/js/pdf-jsimp-cpp.c\") + [\"pdf_access_submit_event\", \"pdf_init_ui_pointer_event\"]\r\n\tmisc_exports = collectFunctions(\"source/fitz/stream-prog.c\") + collectFunctions(\"source/fitz/test-device.c\")\r\n\tsign_exports = [\"pdf_crypt_buffer\", \"pdf_read_pfx\", \"pdf_sign_signature\", \"pdf_signer_designated_name\", \"pdf_free_designated_name\"]\r\n\r\n\tfitz_exports = generateExports(\"include/mupdf/fitz\", doc_exports + more_formats + misc_exports)\r\n\tmupdf_exports = generateExports(\"include/mupdf/pdf\", form_exports + sign_exports + [\"pdf_open_compressed_stream\"])\r\n\tmuxps_exports = generateExports(\"include/mupdf/xps.h\", [\"xps_parse_solid_color_brush\", \"xps_print_path\"])\r\n\tunarr_exports = generateExports(\"../ext/unarr/unarr.h\")\r\n\r\n\tlist = LIBMUPDF_DEF % locals()\r\n\topen(\"../src/libmupdf.def\", \"wb\").write(list.replace(\"\\n\", \"\\r\\n\"))\r\n\r\nif __name__ == \"__main__\":\r\n\tmain()\r\n"
  },
  {
    "path": "scripts/gen_mupdf_generated.bat",
    "content": "@echo off\nif not exist mupdf\\generated mkdir mupdf\\generated\n\n@rem set cmap=dbg\\cmapdump.exe\nset cmap=%1\n@rem echo cmap=%cmap%\n\n@echo off\nsetlocal disableDelayedExpansion\n\nif exist mupdf\\generated\\gen_cmap_cns.h goto skip_cns\n\nset \"files=\"\nfor %%a in (mupdf\\resources\\cmaps\\cns\\*) do call set files=%%files%% \"%%a\"\necho %files%\n%cmap% mupdf\\generated\\gen_cmap_cns.h %files%\necho \"generated mupdf\\generated\\gen_cmap_cns.h\"\n\n:skip_cns\nif exist mupdf\\generated\\gen_cmap_gb.h goto skip_gb\n\nset \"files=\"\nfor %%a in (mupdf\\resources\\cmaps\\gb\\*) do call set files=%%files%% \"%%a\"\necho %files%\n%cmap% mupdf\\generated\\gen_cmap_gb.h %files%\necho \"generated mupdf\\generated\\gen_cmap_gb.h\"\n\n:skip_gb\nif exist mupdf\\generated\\gen_cmap_japan.h goto skip_japan\n\nset \"files=\"\nfor %%a in (mupdf\\resources\\cmaps\\japan\\*) do call set files=%%files%% \"%%a\"\necho %files%\n%cmap% mupdf\\generated\\gen_cmap_japan.h %files%\necho \"generated mupdf\\generated\\gen_cmap_japan.h\"\n\n:skip_japan\nif exist mupdf\\generated\\gen_cmap_korea.h goto skip_korea\n\nset \"files=\"\nfor %%a in (mupdf\\resources\\cmaps\\korea\\*) do call set files=%%files%% \"%%a\"\necho %files%\n%cmap% mupdf\\generated\\gen_cmap_korea.h %files%\necho \"generated mupdf\\generated\\gen_cmap_korea.h\"\n\n:skip_korea\n"
  },
  {
    "path": "scripts/gen_settings_html.py",
    "content": "#!/usr/bin/env python\r\n\r\nimport cgi\r\nimport os\r\nimport util\r\nimport gen_settingsstructs\r\nimport trans_langs\r\n\r\n\"\"\"\r\nTODO:\r\n * for gen_langs_html, show languages that don't have enough translations\r\n   in a separate table\r\n\"\"\"\r\n\r\ng_version = util.get_sumatrapdf_version()\r\n\r\nhtml_tmpl = \"\"\"\\\r\n<!doctype html>\r\n\r\n<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n<title>Customizing SumatraPDF %VER%</title>\r\n<style type=\"text/css\">\r\nbody {\r\n    font-size: 90%;\r\n    background-color: #f5f5f5;\r\n}\r\n\r\n.desc {\r\n    padding: 0px 10px 0px 10px;\r\n}\r\n\r\n.txt1 {\r\n    /* bold doesn't look good in the fonts above */\r\n    font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;\r\n    font-size: 88%;\r\n    color: #800; /* this is brown */\r\n}\r\n\r\n.txt2 {\r\n    font-family: Verdana, Arial, sans-serif;\r\n    font-family: serif;\r\n    font-size: 90%;\r\n    font-weight: bold;\r\n    color: #800; /* this is brown */\r\n}\r\n\r\n.txt {\r\n    font-family: serif;\r\n    font-size: 95%;\r\n    font-weight: bold;\r\n    color: #800; /* this is brown */\r\n    color: #000;\r\n    background-color: #ececec;\r\n    border: 1px solid #fff;\r\n    border-radius: 10px;\r\n    -webkit-border-radius: 10px;\r\n    box-shadow: rgba(0, 0, 0, .15) 3px 3px 4px;\r\n    -webkit-box-shadow: rgba(0, 0, 0, .15) 3px 3px 4px;\r\n    padding: 10px 10px 10px 20px;\r\n}\r\n\r\n.cm {\r\n    color: #800;   /* this is brown, a bit aggressive */\r\n    color: #8c8c8c; /* this is gray */\r\n    color: #555; /* this is darker gray */\r\n    font-weight: normal;\r\n}\r\n\r\n</style>\r\n</head>\r\n\r\n<body>\r\n\r\n<div class=\"desc\">\r\n\r\n<h2>Customizing SumatraPDF %VER%</h2>\r\n\r\n<p>You can change the look and behavior of\r\n<a href=\"http://www.sumatrapdfreader.org/\">SumatraPDF</a>\r\nby editing the file <code>SumatraPDF-settings.txt</code>. The file is stored in\r\n<code>%APPDATA%\\SumatraPDF</code> directory for the installed version or in the\r\nsame directory as <code>SumatraPDF.exe</code> executable for the portable version.</p>\r\n\r\n<p>Use the menu item <code>Settings -> Advanced Settings...</code> to open the settings file\r\nwith your default text editor.</p>\r\n\r\n<p>The file is in a simple text format. Below is an explanation of\r\nwhat the different settings mean and what their default values are.</p>\r\n\r\n<p>Highlighted settings can't be changed from the UI. Modifying other settings\r\ndirectly in this file is not recommended.</p>\r\n\r\n<p>If you add or remove lines with square brackets, <b>make sure to always add/remove\r\nsquare brackets in pairs</b>! Else you risk losing all the data following them.</p>\r\n\r\n</div>\r\n\r\n<pre class=\"txt\">\r\n%INSIDE%\r\n</pre>\r\n\r\n<div class=\"desc\">\r\n<h3 id=\"color\">Syntax for color values</h3>\r\n\r\n<p>\r\nThe syntax for colors is: <code>#rrggbb</code>.</p>\r\n<p>The components are hex values (ranging from 00 to FF) and stand for:\r\n<ul>\r\n  <li><code>rr</code> : red component</li>\r\n  <li><code>gg</code> : green component</li>\r\n  <li><code>bb</code> : blue component</li>\r\n</ul>\r\nFor example #ff0000 means red color. You can use <a href=\"http://www.colorpicker.com/\">\r\nColor Picker</a> or <a href=\"http://mudcu.be/sphere/\">Sphere</a> or\r\n<a href=\"http://colorschemedesigner.com/\">ColorScheme Designer</a> to pick a color.\r\n</p>\r\n</div>\r\n\r\n</body>\r\n</html>\r\n\"\"\"\r\n\r\nlangs_html_tmpl = \"\"\"\\\r\n<!doctype html>\r\n\r\n<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n<title>Languages supported by SumatraPDF %VER%</title>\r\n<style type=\"text/css\">\r\nbody {\r\n    font-size: 90%;\r\n    background-color: #f5f5f5;\r\n}\r\n\r\n.txt1 {\r\n    /* bold doesn't look good in the fonts above */\r\n    font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;\r\n    font-size: 88%;\r\n    color: #800; /* this is brown */\r\n}\r\n\r\n.txt2 {\r\n    font-family: Verdana, Arial, sans-serif;\r\n    font-family: serif;\r\n    font-size: 90%;\r\n    font-weight: bold;\r\n    color: #800; /* this is brown */\r\n}\r\n\r\n.txt {\r\n    font-family: serif;\r\n    font-size: 95%;\r\n    font-weight: bold;\r\n    color: #800; /* this is brown */\r\n    color: #000;\r\n    background-color: #ececec;\r\n}\r\n\r\n.cm {\r\n    color: #800;   /* this is brown, a bit aggressive */\r\n    color: #8c8c8c; /* this is gray */\r\n    color: #555; /* this is darker gray */\r\n    font-weight: normal;\r\n}\r\n</style>\r\n</head>\r\n\r\n<body>\r\n\r\n<h2>Languages supported by SumatraPDF %VER%</h2>\r\n\r\n<p>Languages supported by SumatraPDF. You can use ISO code as a value\r\nof <code>UiLanguage</code> setting in <a href=\"settings%VER%.html\">settings file</a>.\r\n</p>\r\n\r\n<p>Note: not all languages are fully translated. Help us <a href=\"http://www.apptranslator.org/app/SumatraPDF\">translate SumatraPDF</a>.</p>\r\n\r\n<table>\r\n<tr><th>Language name</th><th>ISO code</th></tr>\r\n%INSIDE%\r\n</table>\r\n\r\n</body>\r\n</html>\r\n\"\"\"\r\n\r\n#indent_str = \"&nbsp;&nbsp;\"\r\nindent_str = \"    \"\r\n\r\n# if s in the form: \"foo](bar.html)\", returns [\"foo\", \"bar.html\"].\r\n# otherwise returns [\"foo\"]\r\n\r\n\r\ndef create_dir(d):\r\n    if not os.path.exists(d):\r\n        os.makedirs(d)\r\n    return d\r\n\r\n\r\ndef extract_url(s):\r\n    if not s.endswith(\")\"):\r\n        return [s]\r\n    word_end = s.find(\"]\")\r\n    assert word_end != -1\r\n    word = s[:word_end]\r\n    assert s[word_end + 1] == \"(\"\r\n    url = s[word_end + 2:-1]\r\n    return [word, url]\r\n\r\n\r\ndef gen_comment(comment, field_id, start, first=False):\r\n    line_len = 100\r\n    s = start + '<span class=\"cm\" id=\"%s\">' % field_id\r\n    if not first:\r\n        s = \"\\n\" + s\r\n    left = line_len - len(start)\r\n    # [foo](bar.html) is turned into <a href=\"bar.html\">foo</a>\r\n    href_text = None\r\n    comment = cgi.escape(comment)\r\n    for word in comment.split():\r\n        if word[0] == \"[\":\r\n            word_url = extract_url(word[1:])\r\n            if len(word_url) == 2:\r\n                s += '<a href=\"%s\">%s</a>' % (word_url[1], word_url[0])\r\n                continue\r\n            href_text = word_url[0]\r\n            continue\r\n        elif href_text != None:\r\n            word_url = extract_url(word)\r\n            href_text = href_text + \" \" + word_url[0]\r\n            if len(word_url) == 2:\r\n                s += '<a href=\"%s\">%s</a> ' % (word_url[1], href_text)\r\n                href_text = None\r\n            continue\r\n\r\n        if left < len(word):\r\n            s += \"\\n\" + start\r\n            left = line_len - len(start)\r\n        word += \" \"\r\n        left -= len(word)\r\n        if word == \"color \":\r\n            word = '<a href=\"#color\">color</a> '\r\n        elif word == \"colors \":\r\n            word = '<a href=\"#color\">colors</a> '\r\n        s += word\r\n    s = s.rstrip()\r\n    s += '</span>'\r\n    return [s]\r\n\r\n\r\ndef gen_struct(struct, indent=\"\", prerelease=False):\r\n    lines = []\r\n    first = True\r\n    inside_expert = False\r\n    for field in struct.default:\r\n        if field.internal or type(field) is gen_settingsstructs.Comment or not prerelease and field.prerelease:\r\n            continue\r\n        start_idx = len(lines)\r\n        comment = field.docComment\r\n        if field.version != \"2.3\":\r\n            comment += \" (introduced in version %s)\" % field.version\r\n        field_id = struct.name + \"_\" + field.name if indent else field.name\r\n        lines += gen_comment(comment, field_id, indent, first)\r\n        if type(field) is gen_settingsstructs.Array:\r\n            indent2 = indent + indent_str[:len(indent_str) / 2]\r\n            start = \"%s%s [\\n%s[\" % (indent, field.name, indent2)\r\n            end = \"%s]\\n%s]\" % (indent2, indent)\r\n            inside = gen_struct(field, indent + indent_str, prerelease)\r\n            lines += [start, inside, end]\r\n        elif type(field) is gen_settingsstructs.Struct:\r\n            start = \"%s%s [\" % (indent, field.name)\r\n            end = \"%s]\" % indent\r\n            inside = gen_struct(field, indent + indent_str, prerelease)\r\n            lines += [start, inside, end]\r\n        else:\r\n            s = field.inidefault(commentChar=\"\").lstrip()\r\n            lines += [indent + s]\r\n        first = False\r\n        if field.expert and not inside_expert:\r\n            lines[start_idx] = '<div>' + lines[start_idx]\r\n        elif not field.expert and inside_expert:\r\n            lines[start_idx] = '</div>' + lines[start_idx]\r\n        inside_expert = field.expert\r\n    return \"\\n\".join(lines)\r\n\r\n\r\nclass Lang(object):\r\n\r\n    def __init__(self, name, code):\r\n        self.name = name\r\n        self.code = code\r\n\r\n\r\ndef settings_dir():\r\n    d = os.path.join(\"docs\", \"settings\")\r\n    create_dir(d)\r\n    return d\r\n\r\n\r\ndef blog_dir():\r\n    script_dir = os.path.realpath(os.path.dirname(__file__))\r\n    d = os.path.realpath(\r\n        os.path.join(script_dir, \"..\", \"..\", \"go\", \"src\", \"github.com\", \"kjk\", \"sumatra-website\", \"www\"))\r\n    if os.path.exists(d):\r\n        return d\r\n    print(\"blog dir '%s' doesn't exist\" % d)\r\n    return None\r\n\r\n\r\ndef langs_file_name():\r\n    return \"langs%s.html\" % g_version\r\n\r\n\r\ndef settings_file_name():\r\n    return \"settings%s.html\" % g_version\r\n\r\n\r\ndef gen_langs_html():\r\n    langs = trans_langs.g_langs\r\n    langs = [Lang(el[1], el[0]) for el in langs]\r\n    lines = []\r\n    langs = sorted(langs, key=lambda lang: lang.name)\r\n    for l in langs:\r\n        s = '<tr><td>%s</td><td>%s</td></tr>' % (l.name, l.code)\r\n        lines += [s]\r\n    inside = \"\\n\".join(lines)\r\n    s = langs_html_tmpl.replace(\"%INSIDE%\", inside)\r\n    s = s.replace(\"%VER%\", str(g_version))\r\n    s = s.replace(\"settings.html\", settings_file_name())\r\n    p = os.path.join(settings_dir(), langs_file_name())\r\n    open(p, \"w\").write(s)\r\n    if blog_dir() is not None:\r\n        p = os.path.join(blog_dir(), langs_file_name())\r\n        open(p, \"w\").write(s)\r\n\r\n\r\ndef gen_settings_html():\r\n    prefs = gen_settingsstructs.GlobalPrefs\r\n    inside = gen_struct(prefs)\r\n    s = html_tmpl.replace(\"%INSIDE%\", inside)\r\n    print(\"g_version: '%s'\\n\" % g_version)\r\n    s = s.replace(\"%VER%\", str(g_version))\r\n    s = s.replace(\"langs.html\", langs_file_name())\r\n    p = os.path.join(settings_dir(), settings_file_name())\r\n    open(p, \"w\").write(s)\r\n    if blog_dir() is not None:\r\n        p = os.path.join(blog_dir(), settings_file_name())\r\n        open(p, \"w\").write(s)\r\n\r\n\r\nif __name__ == \"__main__\":\r\n    util.chdir_top()\r\n    gen_langs_html()\r\n    gen_settings_html()\r\n    gen_settingsstructs.gen()\r\n"
  },
  {
    "path": "scripts/gen_settingsstructs.py",
    "content": "#!/usr/bin/env python\r\n\r\n\"\"\"\r\nThis script generates structs and enough metadata for reading\r\na variety of preference values from user provided settings files.\r\nSee further below for the definition of all currently supported options.\r\n\"\"\"\r\n\r\nimport util\r\n\r\nclass Type(object):\r\n\tdef __init__(self, name, ctype):\r\n\t\tself.name = name; self.ctype = ctype\r\n\r\nBool = Type(\"Bool\", \"bool\")\r\nColor = Type(\"Color\", \"COLORREF\")\r\nFloat = Type(\"Float\", \"float\")\r\nInt = Type(\"Int\", \"int\")\r\nString = Type(\"String\", \"WCHAR *\")\r\nUtf8String = Type(\"Utf8String\", \"char *\")\r\n\r\nclass Field(object):\r\n\tdef __init__(self, name, type, default, comment, internal=False, expert=False, doc=None, version=None, prerelease=False):\r\n\t\tself.name = name; self.type = type; self.default = default; self.comment = comment\r\n\t\tself.internal = internal; self.cname = name[0].lower() + name[1:] if name else None\r\n\t\tself.expert = expert # \"expert\" prefs are the ones not exposed by the UI\r\n\t\tself.docComment = doc or comment\r\n\t\tself.version = version or \"2.3\" # version in which this setting was introduced\r\n\t\tself.prerelease = prerelease # prefs which aren't written out in release builds\r\n\r\n\tdef cdefault(self, built):\r\n\t\tif self.type is Bool:\r\n\t\t\treturn \"true\" if self.default else \"false\"\r\n\t\tif self.type is Color:\r\n\t\t\treturn \"0x%06x\" % self.default\r\n\t\tif self.type is Float:\r\n\t\t\treturn '(intptr_t)\"%g\"' % self.default # converting float to intptr_t rounds the value\r\n\t\tif self.type is Int:\r\n\t\t\treturn \"%d\" % self.default\r\n\t\tif self.type is String:\r\n\t\t\treturn '(intptr_t)L\"%s\"' % self.default if self.default is not None else \"0\"\r\n\t\tif self.type is Utf8String:\r\n\t\t\treturn '(intptr_t)\"%s\"' % self.default.encode(\"utf-8\") if self.default is not None else \"0\"\r\n\t\tif self.type.name in [\"Struct\", \"Array\", \"Compact\", \"Prerelease\"]:\r\n\t\t\tid = built.count(self.structName)\r\n\t\t\treturn \"(intptr_t)&g%sInfo\" % (self.structName + (\"\" if not id else \"_%d_\" % id))\r\n\t\tif self.type.name in [\"ColorArray\", \"FloatArray\", \"IntArray\"]:\r\n\t\t\treturn '(intptr_t)\"%s\"' % self.default if self.default is not None else \"0\"\r\n\t\tif self.type.name == \"StringArray\":\r\n\t\t\treturn '(intptr_t)\"%s\"' % self.default.encode(\"utf-8\") if self.default is not None else \"0\"\r\n\t\tif self.type.name == \"Comment\":\r\n\t\t\treturn '(intptr_t)\"%s\"' % self.comment.encode(\"utf-8\") if self.comment is not None else \"0\"\r\n\t\treturn None\r\n\r\n\tdef inidefault(self, commentChar=\";\"):\r\n\t\tif self.type is Bool:\r\n\t\t\treturn \"%s = %s\" % (self.name, \"true\" if self.default else \"false\")\r\n\t\tif self.type is Color:\r\n\t\t\treturn \"%s = #%02x%02x%02x\" % (self.name, self.default & 0xFF, (self.default >> 8) & 0xFF, (self.default >> 16) & 0xFF)\r\n\t\tif self.type is Float:\r\n\t\t\treturn \"%s = %g\" % (self.name, self.default)\r\n\t\tif self.type is Int:\r\n\t\t\treturn \"%s = %d\" % (self.name, self.default)\r\n\t\tif self.type is String:\r\n\t\t\tif self.default is not None:\r\n\t\t\t\treturn \"%s = %s\" % (self.name, self.default.encode(\"UTF-8\"))\r\n\t\t\treturn \"%s %s =\" % (commentChar, self.name)\r\n\t\tif self.type is Utf8String:\r\n\t\t\tif self.default is not None:\r\n\t\t\t\treturn \"%s = %s\" % (self.name, self.default)\r\n\t\t\treturn \"%s %s =\" % (commentChar, self.name)\r\n\t\tif self.type.name == \"Compact\":\r\n\t\t\treturn \"%s = %s\" % (self.name, \" \".join(field.inidefault().split(\" = \", 1)[1] for field in self.default))\r\n\t\tif self.type.name in [\"ColorArray\", \"FloatArray\", \"IntArray\"]:\r\n\t\t\tif self.default is not None:\r\n\t\t\t\treturn \"%s = %s\" % (self.name, self.default)\r\n\t\t\treturn \"%s %s =\" % (commentChar, self.name)\r\n\t\tif self.type.name == \"StringArray\":\r\n\t\t\tif self.default is not None:\r\n\t\t\t\treturn \"%s = %s\" % (self.name, self.default.encode(\"UTF-8\"))\r\n\t\t\treturn \"%s %s =\" % (commentChar, self.name)\r\n\t\tassert False\r\n\r\nclass Struct(Field):\r\n\tdef __init__(self, name, fields, comment, structName=None, internal=False, expert=False, doc=None, version=None, prerelease=False):\r\n\t\tself.structName = structName or name\r\n\t\tsuper(Struct, self).__init__(name, Type(\"Struct\", \"%s\" % self.structName), fields, comment, internal, expert, doc, version, prerelease)\r\n\t\tif prerelease: self.type.name = \"Prerelease\"\r\n\r\nclass CompactStruct(Struct):\r\n\tdef __init__(self, name, fields, comment, structName=None, internal=False, expert=False, doc=None, version=None):\r\n\t\tsuper(CompactStruct, self).__init__(name, fields, comment, structName, internal, expert, doc, version)\r\n\t\tself.type.name = \"Compact\"\r\n\r\nclass Array(Field):\r\n\tdef __init__(self, name, fields, comment, structName=None, internal=False, expert=False, doc=None, version=None):\r\n\t\tself.structName = structName or name\r\n\t\tif not structName and name.endswith(\"s\"):\r\n\t\t\t# trim plural 's' from struct name\r\n\t\t\tself.structName = name[:-1]\r\n\t\tsuper(Array, self).__init__(name, Type(\"Array\", \"Vec<%s *> *\" % self.structName), fields, comment, internal, expert, doc, version)\r\n\r\nclass CompactArray(Field):\r\n\tdef __init__(self, name, type, default, comment, internal=False, expert=False, doc=None, version=None):\r\n\t\tsuper(CompactArray, self).__init__(name, Type(\"%sArray\" % type.name, \"Vec<%s> *\" % type.ctype), default, comment, internal, expert, doc, version)\r\n\r\nclass Comment(Field):\r\n\tdef __init__(self, comment, expert=False, version=None):\r\n\t\tsuper(Comment, self).__init__(\"\", Type(\"Comment\", None), None, comment, False, expert)\r\n\r\ndef EmptyLine(expert=False):\r\n\treturn Comment(None, expert)\r\n\r\ndef RGB(r, g, b, a=0):\r\n\treturn r | (g << 8) | (b << 16) | (a << 24)\r\n\r\n# ##### setting definitions for SumatraPDF #####\r\n\r\nWindowPos = [\r\n\tField(\"X\", Int, 0, \"x coordinate\"),\r\n\tField(\"Y\", Int, 0, \"y coordinate\"),\r\n\tField(\"Dx\", Int, 0, \"width\"),\r\n\tField(\"Dy\", Int, 0, \"height\"),\r\n]\r\n\r\nScrollPos = [\r\n\tField(\"X\", Int, 0, \"x coordinate\"),\r\n\tField(\"Y\", Int, 0, \"y coordinate\"),\r\n]\r\n\r\nFileTime = [\r\n\tField(\"DwHighDateTime\", Int, 0, \"\"),\r\n\tField(\"DwLowDateTime\", Int, 0, \"\"),\r\n]\r\n\r\nPrinterDefaults = [\r\n\tField(\"PrintScale\", Utf8String, \"shrink\", \"default value for scaling (shrink, fit, none)\"),\r\n]\r\n\r\nForwardSearch = [\r\n\tField(\"HighlightOffset\", Int, 0,\r\n\t\t\"when set to a positive value, the forward search highlight style will \" +\r\n\t\t\"be changed to a rectangle at the left of the page (with the indicated \" +\r\n\t\t\"amount of margin from the page margin)\"),\r\n\tField(\"HighlightWidth\", Int, 15,\r\n\t\t\"width of the highlight rectangle (if HighlightOffset is > 0)\"),\r\n\tField(\"HighlightColor\", Color, RGB(0x65, 0x81, 0xFF),\r\n\t\t\"color used for the forward search highlight\"),\r\n\tField(\"HighlightPermanent\", Bool, False,\r\n\t\t\"if true, highlight remains visible until the next mouse click \" +\r\n\t\t\"(instead of fading away immediately)\"),\r\n]\r\n\r\nWindowMargin_FixedPageUI = [\r\n\tField(\"Top\", Int, 2, \"size of the top margin between window and document\"),\r\n\tField(\"Right\", Int, 4, \"size of the right margin between window and document\"),\r\n\tField(\"Bottom\", Int, 2, \"size of the bottom margin between window and document\"),\r\n\tField(\"Left\", Int, 4, \"size of the left margin between window and document\"),\r\n]\r\n\r\nWindowMargin_ComicBookUI = [\r\n\tField(\"Top\", Int, 0, \"size of the top margin between window and document\"),\r\n\tField(\"Right\", Int, 0, \"size of the right margin between window and document\"),\r\n\tField(\"Bottom\", Int, 0, \"size of the bottom margin between window and document\"),\r\n\tField(\"Left\", Int, 0, \"size of the left margin between window and document\"),\r\n]\r\n\r\nPageSpacing = [\r\n\tField(\"Dx\", Int, 4, \"horizontal difference\"),\r\n\tField(\"Dy\", Int, 4, \"vertical difference\"),\r\n]\r\n\r\nFixedPageUI = [\r\n\tField(\"TextColor\", Color, RGB(0x00, 0x00, 0x00),\r\n\t\t\"color value with which black (text) will be substituted\"),\r\n\tField(\"BackgroundColor\", Color, RGB(0xFF, 0xFF, 0xFF),\r\n\t\t\"color value with which white (background) will be substituted\"),\r\n\tField(\"SelectionColor\", Color, RGB(0xF5, 0xFC, 0x0C),\r\n\t\t\"color value for the text selection rectangle (also used to highlight found text)\", version=\"2.4\"),\r\n\tCompactStruct(\"WindowMargin\", WindowMargin_FixedPageUI,\r\n\t\t\"top, right, bottom and left margin (in that order) between window and document\"),\r\n\tCompactStruct(\"PageSpacing\", PageSpacing,\r\n\t\t\"horizontal and vertical distance between two pages in facing and book view modes\",\r\n\t\tstructName=\"SizeI\"),\r\n\tCompactArray(\"GradientColors\", Color, None, # \"#2828aa #28aa28 #aa2828\",\r\n\t\t\"colors to use for the gradient from top to bottom (stops will be inserted \" +\r\n\t\t\"at regular intervals throughout the document); currently only up to three \" +\r\n\t\t\"colors are supported; the idea behind this experimental feature is that the \" +\r\n\t\t\"background might allow to subconsciously determine reading progress; \" +\r\n\t\t\"suggested values: #2828aa #28aa28 #aa2828\"),\r\n\tField(\"InvertColors\", Bool, False,\r\n\t\t\"if true, TextColor and BackgroundColor will be temporarily swapped\",\r\n\t\tinternal=True),\r\n]\r\n\r\nEbookUI = [\r\n\t# default serif font, a different font is used for monospaced text (currently always \"Courier New\")\r\n\tField(\"FontName\", String, \"Georgia\", \"name of the font. takes effect after re-opening the document\"),\r\n\tField(\"FontSize\", Float, 12.5, \"size of the font. takes effect after re-opening the document\"),\r\n\tField(\"TextColor\", Color, RGB(0x5F, 0x4B, 0x32), \"color for text\"),\r\n\tField(\"BackgroundColor\", Color, RGB(0xFB, 0xF0, 0xD9), \"color of the background (page)\"),\r\n\tField(\"UseFixedPageUI\", Bool, False,\r\n\t\t\"if true, the UI used for PDF documents will be used for ebooks as well \" +\r\n\t\t\"(enables printing and searching, disables automatic reflow)\"),\r\n]\r\n\r\nComicBookUI = [\r\n\tCompactStruct(\"WindowMargin\", WindowMargin_ComicBookUI,\r\n\t\t\"top, right, bottom and left margin (in that order) between window and document\"),\r\n\tCompactStruct(\"PageSpacing\", PageSpacing,\r\n\t\t\"horizontal and vertical distance between two pages in facing and book view modes\",\r\n\t\tstructName=\"SizeI\"),\r\n\tField(\"CbxMangaMode\", Bool, False,\r\n\t\t\"if true, default to displaying Comic Book files in manga mode (from right to left if showing 2 pages at a time)\"),\r\n]\r\n\r\nChmUI = [\r\n\tField(\"UseFixedPageUI\", Bool, False,\r\n\t\t\"if true, the UI used for PDF documents will be used for CHM documents as well\"),\r\n]\r\n\r\nExternalViewer = [\r\n\tField(\"CommandLine\", String, None,\r\n\t\t\"command line with which to call the external viewer, may contain \" +\r\n\t\t\"%p for page numer and \\\"%1\\\" for the file name (add quotation \" +\r\n\t\t\"marks around paths containing spaces)\"),\r\n\tField(\"Name\", String, None,\r\n\t\t\"name of the external viewer to be shown in the menu (implied by CommandLine if missing)\"),\r\n\tField(\"Filter\", String, None,\r\n\t\t\"optional filter for which file types the menu item is to be shown; separate multiple entries using ';' and don't include any spaces (e.g. *.pdf;*.xps for all PDF and XPS documents)\"),\r\n]\r\n\r\nPrereleaseSettings = [\r\n\tField(\"TabWidth\", Int, 300,\r\n\t\t\"maximum width of a single tab\"),\r\n]\r\n\r\nAnnotationDefaults = [\r\n\tField(\"HighlightColor\", Color, RGB(0xFF, 0xFF, 0x60),\r\n\t\t\"color used for the highlight tool (in prerelease builds, the current selection \" +\r\n\t\t\"can be converted into a highlight annotation by pressing the 'h' key)\"),\r\n\tField(\"SaveIntoDocument\", Bool, True,\r\n\t\t\"if true, annotations are appended to PDF documents, \" +\r\n\t\t\"else they're always saved to an external .smx file\"),\r\n]\r\n\r\nFavorite = [\r\n\tField(\"Name\", String, None,\r\n\t\t\"name of this favorite as shown in the menu\"),\r\n\tField(\"PageNo\", Int, 0,\r\n\t\t\"number of the bookmarked page\"),\r\n\tField(\"PageLabel\", String, None,\r\n\t\t\"label for this page (only present if logical and physical page numbers are not the same)\"),\r\n\tField(\"MenuId\", Int, 0,\r\n\t\t\"id of this favorite in the menu (assigned by AppendFavMenuItems)\",\r\n\t\tinternal=True),\r\n]\r\n\r\nFileSettings = [\r\n\tField(\"FilePath\", String, None,\r\n\t\t\"path of the document\"),\r\n\tArray(\"Favorites\", Favorite,\r\n\t\t\"Values which are persisted for bookmarks/favorites\"),\r\n\tField(\"IsPinned\", Bool, False,\r\n\t\t\"a document can be \\\"pinned\\\" to the Frequently Read list so that it \" +\r\n\t\t\"isn't displaced by recently opened documents\"),\r\n\tField(\"IsMissing\", Bool, False,\r\n\t\t\"if a document can no longer be found but we still remember valuable state, \" +\r\n\t\t\"it's classified as missing so that it can be hidden instead of removed\",\r\n\t\tdoc=\"if true, the file is considered missing and won't be shown in any list\"),\r\n\tField(\"OpenCount\", Int, 0,\r\n\t\t\"in order to prevent documents that haven't been opened for a while \" +\r\n\t\t\"but used to be opened very frequently constantly remain in top positions, \" +\r\n\t\t\"the openCount will be cut in half after every week, so that the \" +\r\n\t\t\"Frequently Read list hopefully better reflects the currently relevant documents\",\r\n\t\tdoc=\"number of times this document has been opened recently\"),\r\n\tField(\"DecryptionKey\", Utf8String, None,\r\n\t\t\"Hex encoded MD5 fingerprint of file content (32 chars) followed by \" +\r\n\t\t\"crypt key (64 chars) - only applies for PDF documents\",\r\n\t\tdoc=\"data required to open a password protected document without having to \" +\r\n\t\t\"ask for the password again\"),\r\n\tField(\"UseDefaultState\", Bool, False,\r\n\t\t\"if true, we use global defaults when opening this file (instead of \" +\r\n\t\t\"the values below)\"),\r\n\t# NOTE: fields below UseDefaultState aren't serialized if UseDefaultState is true!\r\n\tField(\"DisplayMode\", String, \"automatic\",\r\n\t\t\"how pages should be laid out for this document, needs to be synchronized with \" +\r\n\t\t\"DefaultDisplayMode after deserialization and before serialization\",\r\n\t\tdoc=\"layout of pages. valid values: automatic, single page, facing, book view, \" +\r\n\t\t\"continuous, continuous facing, continuous book view\"),\r\n\tCompactStruct(\"ScrollPos\", ScrollPos,\r\n\t\t\"how far this document has been scrolled (in x and y direction)\",\r\n\t\tstructName=\"PointI\"),\r\n\tField(\"PageNo\", Int, 1,\r\n\t\t\"number of the last read page\"),\r\n\tField(\"Zoom\", Utf8String, \"fit page\",\r\n\t\t\"zoom (in %) or one of those values: fit page, fit width, fit content\"),\r\n\tField(\"Rotation\", Int, 0,\r\n\t\t\"how far pages have been rotated as a multiple of 90 degrees\"),\r\n\tField(\"WindowState\", Int, 0,\r\n\t\t\"state of the window. 1 is normal, 2 is maximized, \"+\r\n\t\t\"3 is fullscreen, 4 is minimized\"),\r\n\tCompactStruct(\"WindowPos\", WindowPos,\r\n\t\t\"default position (can be on any monitor)\", structName=\"RectI\"),\r\n\tField(\"ShowToc\", Bool, True,\r\n\t\t\"if true, we show table of contents (Bookmarks) sidebar if it's present \" +\r\n\t\t\"in the document\"),\r\n\tField(\"SidebarDx\", Int, 0,\r\n\t\t\"width of the left sidebar panel containing the table of contents\"),\r\n\tField(\"DisplayR2L\", Bool, False,\r\n\t\t\"if true, the document is displayed right-to-left in facing and book view modes \" +\r\n\t\t\"(only used for comic book documents)\"),\r\n\tField(\"ReparseIdx\", Int, 0,\r\n\t\t\"index into an ebook's HTML data from which reparsing has to happen \" +\r\n\t\t\"in order to restore the last viewed page (i.e. the equivalent of PageNo for the ebook UI)\",\r\n\t\tdoc=\"data required to restore the last read page in the ebook UI\"),\r\n\tCompactArray(\"TocState\", Int, None,\r\n\t\t\"tocState is an array of ids for ToC items that have been toggled by \" +\r\n\t\t\"the user (i.e. aren't in their default expansion state). - \" +\r\n\t\t\"Note: We intentionally track toggle state as opposed to expansion state \" +\r\n\t\t\"so that we only have to save a diff instead of all states for the whole \" +\r\n\t\t\"tree (which can be quite large) (internal)\",\r\n\t\tdoc=\"data required to determine which parts of the table of contents have been expanded\"),\r\n\t# NOTE: fields below UseDefaultState aren't serialized if UseDefaultState is true!\r\n\tField(\"Thumbnail\", Type(None, \"RenderedBitmap *\"), \"NULL\",\r\n\t\t\"thumbnails are saved as PNG files in sumatrapdfcache directory\",\r\n\t\tinternal=True),\r\n\tField(\"Index\", Type(None, \"size_t\"), \"0\",\r\n\t\t\"temporary value needed for FileHistory::cmpOpenCount\",\r\n\t\tinternal=True),\r\n]\r\n\r\n# list of fields which aren't serialized when UseDefaultState is set\r\nrememberedDisplayState = [\"DisplayMode\", \"ScrollPos\", \"PageNo\", \"Zoom\", \"Rotation\", \"WindowState\", \"WindowPos\", \"ShowToc\", \"SidebarDx\", \"DisplayR2L\", \"ReparseIdx\", \"TocState\"]\r\n\r\nTabState = [\r\n\tField(\"FilePath\", String, None,\r\n\t\t\"path of the document\"),\r\n\tField(\"DisplayMode\", String, \"automatic\",\r\n\t\t\"same as FileStates -> DisplayMode\"),\r\n\tField(\"PageNo\", Int, 1,\r\n\t\t\"number of the last read page\"),\r\n\tField(\"Zoom\", Utf8String, \"fit page\",\r\n\t\t\"same as FileStates -> Zoom\"),\r\n\tField(\"Rotation\", Int, 0,\r\n\t\t\"same as FileStates -> Rotation\"),\r\n\tCompactStruct(\"ScrollPos\", ScrollPos,\r\n\t\t\"how far this document has been scrolled (in x and y direction)\",\r\n\t\tstructName=\"PointI\"),\r\n\tField(\"ShowToc\", Bool, True,\r\n\t\t\"if true, the table of contents was shown when the document was closed\"),\r\n\tCompactArray(\"TocState\", Int, None,\r\n\t\t\"same as FileStates -> TocState\"),\r\n]\r\n\r\nSessionData = [\r\n\tArray(\"TabStates\", TabState,\r\n\t\t\"a subset of FileState required for restoring the state of a single tab \" +\r\n\t\t\"(required for handling documents being opened twice)\",\r\n\t\tdoc=\"data required for restoring the view state of a single tab\"),\r\n\tField(\"TabIndex\", Int, 1, \"index of the currently selected tab (1-based)\"),\r\n\tField(\"WindowState\", Int, 0,\r\n\t\t\"same as FileState -> WindowState\"),\r\n\tCompactStruct(\"WindowPos\", WindowPos,\r\n\t\t\"default position (can be on any monitor)\", structName=\"RectI\"),\r\n\tField(\"SidebarDx\", Int, 0,\r\n\t\t\"width of favorites/bookmarks sidebar (if shown)\"),\r\n]\r\n\r\nGlobalPrefs = [\r\n\tComment(\"For documentation, see http://www.sumatrapdfreader.org/settings%s.html\" % util.get_sumatrapdf_version()),\r\n\tEmptyLine(),\r\n\r\n\tField(\"MainWindowBackground\", Color, RGB(0xFF, 0xF2, 0x00, a=0x80),\r\n\t\t\"background color of the non-document windows, traditionally yellow\",\r\n\t\texpert=True),\r\n\tField(\"EscToExit\", Bool, False,\r\n\t\t\"if true, Esc key closes SumatraPDF\",\r\n\t\texpert=True),\r\n\tField(\"ReuseInstance\", Bool, False,\r\n\t\t\"if true, we'll always open files using existing SumatraPDF process\",\r\n\t\texpert=True),\r\n\tField(\"UseSysColors\", Bool, False,\r\n\t\t\"if true, we use Windows system colors for background/text color. Over-rides other settings\",\r\n\t\texpert=True),\r\n\tField(\"RestoreSession\", Bool, True,\r\n\t\t\"if true and SessionData isn't empty, that session will be restored at startup\",\r\n\t\texpert=True),\r\n\tEmptyLine(),\r\n\r\n\tStruct(\"FixedPageUI\", FixedPageUI,\r\n\t\t\"customization options for PDF, XPS, DjVu and PostScript UI\",\r\n\t\texpert=True),\r\n\tStruct(\"EbookUI\", EbookUI,\r\n\t\t\"customization options for eBooks (EPUB, Mobi, FictionBook) UI. If UseFixedPageUI is true, FixedPageUI settings apply instead\",\r\n\t\texpert=True),\r\n\tStruct(\"ComicBookUI\", ComicBookUI,\r\n\t\t\"customization options for Comic Book and images UI\",\r\n\t\texpert=True),\r\n\tStruct(\"ChmUI\", ChmUI,\r\n\t\t\"customization options for CHM UI. If UseFixedPageUI is true, FixedPageUI settings apply instead\",\r\n\t\texpert=True),\r\n\tArray(\"ExternalViewers\", ExternalViewer,\r\n\t\t\"list of additional external viewers for various file types \" +\r\n\t\t\"(can have multiple entries for the same format)\",\r\n\t\texpert=True),\r\n\tStruct(\"PrereleaseSettings\", PrereleaseSettings,\r\n\t\t\"unsupported settings for experimentation in prerelease builds\",\r\n\t\texpert=True, prerelease=True),\r\n\tField(\"ShowMenubar\", Bool, True,\r\n\t\t\"if false, the menu bar will be hidden for all newly opened windows \" +\r\n\t\t\"(use F9 to show it until the window closes or Alt to show it just briefly), only applies if UseTabs is false\",\r\n\t\texpert=True, version=\"2.5\"),\r\n\tField(\"ReloadModifiedDocuments\", Bool, True,\r\n\t\t\"if true, a document will be reloaded automatically whenever it's changed \" +\r\n\t\t\"(currently doesn't work for documents shown in the ebook UI)\",\r\n\t\texpert=True, version=\"2.5\"),\r\n\tField(\"FullPathInTitle\", Bool, False,\r\n\t\t\"if true, we show the full path to a file in the title bar\",\r\n\t\texpert=True, version=\"3.0\"),\r\n\t# the below prefs don't apply to EbookUI (so far)\r\n\tCompactArray(\"ZoomLevels\", Float, \"8.33 12.5 18 25 33.33 50 66.67 75 100 125 150 200 300 400 600 800 1000 1200 1600 2000 2400 3200 4800 6400\",\r\n\t\t\"zoom levels which zooming steps through in addition to Fit Page, Fit Width and \" +\r\n\t\t\"the minimum and maximum allowed values (8.33 and 6400)\",\r\n\t\texpert=True,\r\n\t\tdoc=\"sequence of zoom levels when zooming in/out; all values must lie between 8.33 and 6400\"),\r\n\tField(\"ZoomIncrement\", Float, 0,\r\n\t\t\"zoom step size in percents relative to the current zoom level. \" +\r\n\t\t\"if zero or negative, the values from ZoomLevels are used instead\",\r\n\t\texpert=True),\r\n\tEmptyLine(),\r\n\r\n\t# the below prefs apply only to FixedPageUI and ComicBookUI (so far)\r\n\tStruct(\"PrinterDefaults\", PrinterDefaults,\r\n\t\t\"these override the default settings in the Print dialog\",\r\n\t\texpert=True),\r\n\tStruct(\"ForwardSearch\", ForwardSearch,\r\n\t\t\"customization options for how we show forward search results (used from \" +\r\n\t\t\"LaTeX editors)\",\r\n\t\texpert=True),\r\n\tStruct(\"AnnotationDefaults\", AnnotationDefaults,\r\n\t\t\"default values for user added annotations in FixedPageUI documents \" +\r\n\t\t\"(preliminary and still subject to change)\",\r\n\t\texpert=True, prerelease=True),\r\n\tCompactArray(\"DefaultPasswords\", String, None,\r\n\t\t\"passwords to try when opening a password protected document\",\r\n\t\tdoc=\"a whitespace separated list of passwords to try when opening a password protected document \" +\r\n\t\t\"(passwords containing spaces must be quoted)\",\r\n\t\texpert=True, version=\"2.4\"),\r\n\tField(\"CustomScreenDPI\", Int, 0,\r\n\t\t\"actual resolution of the main screen in DPI (if this value \" +\r\n\t\t\" isn't positive, the system's UI setting is used)\",\r\n\t\texpert=True, version=\"2.5\"),\r\n\tEmptyLine(),\r\n\r\n\tField(\"RememberStatePerDocument\", Bool, True,\r\n\t\t\"if true, we store display settings for each document separately (i.e. everything \" +\r\n\t\t\"after UseDefaultState in FileStates)\"),\r\n\tField(\"UiLanguage\", Utf8String, None,\r\n\t\t\"ISO code of the current UI language\",\r\n\t\tdoc=\"[ISO code](langs.html) of the current UI language\"),\r\n\tField(\"ShowToolbar\", Bool, True,\r\n\t\t\"if true, we show the toolbar at the top of the window\"),\r\n\tField(\"ShowFavorites\", Bool, False,\r\n\t\t\"if true, we show the Favorites sidebar\"),\r\n\tField(\"AssociatedExtensions\", String, None,\r\n\t\t\"a list of extensions that SumatraPDF has associated itself with and will \" +\r\n\t\t\"reassociate if a different application takes over (e.g. \\\".pdf .xps .epub\\\")\"),\r\n\tField(\"AssociateSilently\", Bool, False,\r\n\t\t\"whether file associations should be fixed silently or only after user feedback\"),\r\n\tField(\"CheckForUpdates\", Bool, True,\r\n\t\t\"if true, we check once a day if an update is available\"),\r\n\tField(\"VersionToSkip\", String, None,\r\n\t\t\"we won't ask again to update to this version\"),\r\n\tField(\"RememberOpenedFiles\", Bool, True,\r\n\t\t\"if true, we remember which files we opened and their display settings\"),\r\n\tField(\"InverseSearchCmdLine\", String, None,\r\n\t\t\"pattern used to launch the LaTeX editor when doing inverse search\"),\r\n\tField(\"EnableTeXEnhancements\", Bool, False,\r\n\t\t\"if true, we expose the SyncTeX inverse search command line in Settings -> Options\"),\r\n\tField(\"DefaultDisplayMode\", String, \"automatic\",\r\n\t\t\"how pages should be laid out by default, needs to be synchronized with \" +\r\n\t\t\"DefaultDisplayMode after deserialization and before serialization\",\r\n\t\tdoc=\"default layout of pages. valid values: automatic, single page, facing, \" +\r\n\t\t\"book view, continuous, continuous facing, continuous book view\"),\r\n\tField(\"DefaultZoom\", Utf8String, \"fit page\",\r\n\t\t\"default zoom (in %) or one of those values: fit page, fit width, fit content\"),\r\n\tField(\"WindowState\", Int, 1,\r\n\t\t\"default state of new windows (same as the last closed)\",\r\n\t\tdoc=\"default state of the window. 1 is normal, 2 is maximized, \"+\r\n\t\t\"3 is fullscreen, 4 is minimized\"),\r\n\tCompactStruct(\"WindowPos\", WindowPos,\r\n\t\t\"default position (can be on any monitor)\", structName=\"RectI\",\r\n\t\tdoc=\"default position (x, y) and size (width, height) of the window\"),\r\n\tField(\"ShowToc\", Bool, True,\r\n\t\t\"if true, we show table of contents (Bookmarks) sidebar if it's present \" +\r\n\t\t\"in the document\"),\r\n\tField(\"SidebarDx\", Int, 0,\r\n\t\t\"width of favorites/bookmarks sidebar (if shown)\"),\r\n\tField(\"TocDy\", Int, 0,\r\n\t\t\"if both favorites and bookmarks parts of sidebar are visible, this is \" +\r\n\t\t\"the height of bookmarks (table of contents) part\"),\r\n\tField(\"ShowStartPage\", Bool, True,\r\n\t\t\"if true, we show a list of frequently read documents when no document is loaded\"),\r\n\tField(\"UseTabs\", Bool, True,\r\n\t\t\"if true, documents are opened in tabs instead of new windows\",\r\n\t\tversion=\"3.0\"),\r\n\tEmptyLine(),\r\n\r\n\t# file history and favorites\r\n\tArray(\"FileStates\", FileSettings,\r\n\t\t\"information about opened files (in most recently used order)\"),\r\n\tArray(\"SessionData\", SessionData,\r\n\t\t\"state of the last session, usage depends on RestoreSession\",\r\n\t\tversion=\"3.1\"),\r\n\tCompactArray(\"ReopenOnce\", String, None,\r\n\t\t\"a list of paths for files to be reopened at the next start \" +\r\n\t\t\"or the string \\\"SessionData\\\" if this data is saved in SessionData \" +\r\n\t\t\"(needed for auto-updating)\",\r\n\t\tdoc=\"data required for reloading documents after an auto-update\",\r\n\t\tversion=\"3.0\"),\r\n\tCompactStruct(\"TimeOfLastUpdateCheck\", FileTime,\r\n\t\t\"timestamp of the last update check\", structName=\"FILETIME\",\r\n\t\tdoc=\"data required to determine when SumatraPDF last checked for updates\"),\r\n\tField(\"OpenCountWeek\", Int, 0,\r\n\t\t\"week count since 2011-01-01 needed to \\\"age\\\" openCount values in file history\",\r\n\t\tdoc=\"value required to determine recency for the OpenCount value in FileStates\"),\r\n\t# non-serialized fields\r\n\tCompactStruct(\"LastPrefUpdate\", FileTime,\r\n\t\t\"modification time of the preferences file when it was last read\",\r\n\t\tstructName=\"FILETIME\", internal=True),\r\n\tField(\"DefaultDisplayModeEnum\", Type(None, \"DisplayMode\"), \"DM_AUTOMATIC\",\r\n\t\t\"value of DefaultDisplayMode for internal usage\",\r\n\t\tinternal=True),\r\n\tField(\"DefaultZoomFloat\", Float, -1,\r\n\t\t\"value of DefaultZoom for internal usage\",\r\n\t\tinternal=True),\r\n\tEmptyLine(),\r\n\tComment(\"Settings after this line have not been recognized by the current version\"),\r\n]\r\n\r\nGlobalPrefs = Struct(\"GlobalPrefs\", GlobalPrefs,\r\n\t\"Most values on this structure can be updated through the UI and are persisted \" +\r\n\t\"in SumatraPDF-settings.txt (previously in sumatrapdfprefs.dat)\")\r\n\r\n# ##### end of setting definitions for SumatraPDF #####\r\n\r\ndef FormatComment(comment, start):\r\n\tresult, parts, line = [], comment.split(), start\r\n\twhile parts:\r\n\t\twhile parts and (line == start or len(line + parts[0]) < 72):\r\n\t\t\tline += \" \" + parts.pop(0)\r\n\t\tresult.append(line)\r\n\t\tline = start\r\n\treturn result\r\n\r\ndef FormatArrayLine(data, fmt):\r\n\tmaxs = [0] * len(data[0])\r\n\tfmts = fmt.split()\r\n\tdata2 = []\r\n\tfor item in data:\r\n\t\tassert len(item) == len(maxs) and len(fmts) == len(maxs)\r\n\t\titem2 = []\r\n\t\tfor i in range(len(item)):\r\n\t\t\titem2.append(fmts[i] % item[i])\r\n\t\t\tmaxs[i] = max(maxs[i], len(item2[-1]))\r\n\t\tdata2.append(item2)\r\n\tfor item in data2:\r\n\t\tfor i in range(len(item)):\r\n\t\t\titem[i] += \" \" * (maxs[i] - len(item[i]))\r\n\t\tyield \" \".join(item)\r\n\r\ndef BuildStruct(struct, built=[]):\r\n\tlines, required = [\"struct %s {\" % struct.structName], []\r\n\tif struct.comment:\r\n\t\tlines = FormatComment(struct.comment, \"//\") + lines\r\n\tfor field in struct.default:\r\n\t\tif type(field) is Comment:\r\n\t\t\tcontinue\r\n\t\tlines += FormatComment(field.comment, \"\\t//\")\r\n\t\tlines.append(\"\\t%s %s;\" % (field.type.ctype, field.cname))\r\n\t\tif type(field) in [Struct, CompactStruct, Array] and field.name in [field.structName, field.structName + \"s\"] and field.name not in built:\r\n\t\t\trequired += [BuildStruct(field), \"\"]\r\n\t\t\tbuilt.append(field.name)\r\n\tlines.append(\"};\")\r\n\treturn \"\\n\".join(required + lines)\r\n\r\ndef BuildMetaData(struct, built=[]):\r\n\tlines, data, names = [], [], []\r\n\tfullName = struct.structName + (\"\" if struct.structName not in built else \"_%d_\" % built.count(struct.structName))\r\n\tfor field in struct.default:\r\n\t\tif field.internal:\r\n\t\t\tcontinue\r\n\t\tdata.append((\"offsetof(%s, %s)\" % (struct.structName, field.cname), \"Type_%s\" % field.type.name, field.cdefault(built)))\r\n\t\tnames.append(field.name)\r\n\t\tif type(field) in [Struct, CompactStruct, Array]:\r\n\t\t\tlines += [BuildMetaData(field), \"\"]\r\n\t\t\tbuilt.append(field.structName)\r\n\t\telif type(field) is Comment:\r\n\t\t\tdata[-1] = tuple([\"(size_t)-1\"] + list(data[-1][1:]))\r\n\tlines.append(\"static const FieldInfo g%sFields[] = {\" % fullName)\r\n\tlines += [\"\\t{ %s },\" % line for line in FormatArrayLine(data, \"%s, %s, %s\")]\r\n\tlines.append(\"};\")\r\n\t# gFileStateInfo isn't const so that the number of fields can be changed at runtime (cf. UseDefaultState)\r\n\tlines.append(\"static %sStructInfo g%sInfo = { sizeof(%s), %d, g%sFields, \\\"%s\\\" };\" % (\"const \" if fullName != \"FileState\" else \"\", fullName, struct.structName, len(names), fullName, \"\\\\0\".join(names)))\r\n\treturn \"\\n\".join(lines)\r\n\r\nSettingsStructs_Header = \"\"\"\\\r\n/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 (see COPYING) */\r\n\r\n// This file is auto-generated by gen_settingsstructs.py\r\n\r\nenum DisplayMode {\r\n\t// automatic means: the continuous form of single page, facing or\r\n\t// book view - depending on the document's desired PageLayout\r\n\tDM_AUTOMATIC,\r\n\tDM_SINGLE_PAGE,\r\n\tDM_FACING,\r\n\tDM_BOOK_VIEW,\r\n\tDM_CONTINUOUS,\r\n\tDM_CONTINUOUS_FACING,\r\n\tDM_CONTINUOUS_BOOK_VIEW,\r\n};\r\n\r\nclass RenderedBitmap;\r\n\r\ntypedef struct FileState DisplayState;\r\n\r\n%(structDef)s\r\n\r\n#ifdef INCLUDE_SETTINGSSTRUCTS_METADATA\r\n\r\n%(structMetadata)s\r\n\r\n#endif\r\n\"\"\"\r\n\r\n\r\ndef gen():\r\n\tstructDef = BuildStruct(GlobalPrefs)\r\n\tstructMetadata = BuildMetaData(GlobalPrefs)\r\n\r\n\tcontent = SettingsStructs_Header % locals()\r\n\topen(\"src/SettingsStructs.h\", \"wb\").write(content.replace(\"\\n\", \"\\r\\n\").replace(\"\\t\", \"    \"))\r\n\r\n\tbeforeUseDefaultState = True\r\n\tfor field in FileSettings:\r\n\t\tif field.name == \"UseDefaultState\":\r\n\t\t\tbeforeUseDefaultState = False\r\n\t\telif beforeUseDefaultState:\r\n\t\t\tassert field.name not in rememberedDisplayState, \"%s shouldn't be serialized when UseDefaultState is true\" % field.name\r\n\t\telse:\r\n\t\t\tassert field.name in rememberedDisplayState or field.internal, \"%s won't be serialized when UseDefaultState is true\" % field.name\r\n"
  },
  {
    "path": "scripts/loc.py",
    "content": "#!/usr/bin/env python\r\n\r\n\"\"\"\r\nCalculates the size (in lines of code) of Sumatra source code\r\n(excluding dependencies i.e. code not written by us).\r\n\"\"\"\r\n\r\nimport os\r\npj = os.path.join\r\n\r\nDIRS = [\"src\",\r\n        pj(\"src\", \"utils\"),\r\n        pj(\"src\", \"tools\"),\r\n        pj(\"src\", \"mui\"),\r\n        pj(\"src\", \"wingui\"),\r\n        pj(\"src\", \"installer\"),\r\n        pj(\"src\", \"ifilter\"),\r\n        pj(\"src\", \"previewer\"),\r\n        pj(\"src\", \"uia\"),\r\n        ]\r\n\r\ng_long_fmt = False\r\n\r\ndef is_blacklisted(name):\r\n    if name in [\"DialogSizer.cpp\", \"DialogSizer.h\",\r\n                \"UtilTests.cpp\", \"UnitTests.cpp\"]:\r\n            return True\r\n    if name.endswith(\"_ut.cpp\"):\r\n        return True\r\n    if name.endswith(\"_txt.cpp\"):\r\n        return True  # translation files\r\n    return False\r\n\r\n\r\ndef count_file(name):\r\n    return (name.endswith(\".cpp\") or name.endswith(\".h\")) and not is_blacklisted(name)\r\n\r\n\r\ndef loc_for_file(filePath):\r\n    loc = 0\r\n    with open(filePath, \"r\") as f:\r\n        for line in f:\r\n            loc += 1\r\n    return loc\r\n\r\n\r\ndef get_locs_for_dir(srcDir, dir):\r\n    d = pj(srcDir, dir)\r\n    files = os.listdir(dir)\r\n    locs_per_file = {}\r\n    for f in files:\r\n        if not count_file(f):\r\n            continue\r\n        locs_per_file[f] = loc_for_file(pj(d, f))\r\n    return locs_per_file\r\n\r\n\r\ndef get_dir_loc(locs_per_file):\r\n    return sum(locs_per_file.values())\r\n\r\n\r\ndef short_format(locs_per_dir):\r\n    loc_total = 0\r\n    for dir in sorted(locs_per_dir.keys()):\r\n        locs_per_file = locs_per_dir[dir]\r\n        print(\"%6d %s\" % (get_dir_loc(locs_per_file), dir))\r\n\r\n        for file in sorted(locs_per_file.keys()):\r\n            loc = locs_per_file[file]\r\n            loc_total += loc\r\n    print(\"\\nTotal: %d\" % loc_total)\r\n\r\ndef long_format(locs_per_dir):\r\n    loc_total = 0\r\n    for dir in sorted(locs_per_dir.keys()):\r\n        locs_per_file = locs_per_dir[dir]\r\n        print(\"\\n%s: %6d \" % (dir, get_dir_loc(locs_per_file)))\r\n\r\n        for file in sorted(locs_per_file.keys()):\r\n            loc = locs_per_file[file]\r\n            print(\" %-25s %d\" % (file, loc))\r\n            loc_total += loc\r\n    print(\"\\nTotal: %d\" % loc_total)\r\n\r\ndef main():\r\n    # we assume the script is run from top-level directory as\r\n    # python ./script/loc.py\r\n    srcDir = \".\"\r\n    locs_per_dir = {}\r\n    for dir in DIRS:\r\n        locs_per_dir[dir] = get_locs_for_dir(srcDir, dir)\r\n\r\n    if g_long_fmt:\r\n        long_format(locs_per_dir)\r\n    else:\r\n        short_format(locs_per_dir)\r\n\r\nif __name__ == \"__main__\":\r\n    main()\r\n"
  },
  {
    "path": "scripts/metadata/gen_mui.py",
    "content": "#!/usr/bin/env python\r\nimport os\r\nfrom metadata import Struct, Field, String, WString, I32, Array, Compact\r\nfrom gen_txt import gen_for_top_level_vals\r\n\r\nimport sys\r\nsys.path.append(\"scripts\")  # assumes is being run as ./scrpts/metadata/gen_mui.py\r\nimport util\r\n\r\ng_script_dir = os.path.realpath(os.path.dirname(__file__))\r\ndef mui_src_dir():\r\n    d = os.path.join(g_script_dir, \"..\", \"..\", \"src\", \"mui\")\r\n    return util.verify_path_exists(os.path.realpath(d))\r\n\r\ndef src_dir():\r\n    d = os.path.join(g_script_dir, \"..\", \"..\", \"src\")\r\n    return util.verify_path_exists(os.path.realpath(d))\r\n\r\nclass ButtonVectorDef(Struct):\r\n    fields = [\r\n        Field(\"name\", String(None)),\r\n        Field(\"clicked\", String(None)),\r\n        Field(\"path\", String(None)),\r\n        Field(\"styleDefault\", String(None)),\r\n        Field(\"styleMouseOver\", String(None)),\r\n    ]\r\n\r\nclass ButtonDef(Struct):\r\n    fields = [\r\n        Field(\"name\", String(None)),\r\n        Field(\"text\", WString(None)),\r\n        Field(\"style\", String(None)),\r\n    ]\r\n\r\nclass ScrollBarDef(Struct):\r\n    fields = [\r\n        Field(\"name\", String(None)),\r\n        Field(\"style\", String(None)),\r\n        Field(\"cursor\", String(None)),\r\n    ]\r\n\r\nclass EbookPageDef(Struct):\r\n    fields = [\r\n        Field(\"name\", String(None)),\r\n        Field(\"style\", String(None)),\r\n    ]\r\n\r\nclass DirectionalLayoutDataDef(Struct):\r\n    fields = [\r\n        Field(\"controlName\", String(None)),\r\n        Field(\"sla\", String(None)),  # this is really a float\r\n        Field(\"snla\", String(None)),  # this is really a float\r\n        Field(\"align\", String(None)),\r\n    ]\r\n\r\nclass HorizontalLayoutDef(Struct):\r\n    fields = [\r\n        Field(\"name\", String(None)),\r\n        Field(\"children\", Array(DirectionalLayoutDataDef, []), Compact),\r\n    ]\r\n\r\nclass VerticalLayoutDef(Struct):\r\n    fields = [\r\n        Field(\"name\", String(None)),\r\n        Field(\"children\", Array(DirectionalLayoutDataDef, []), Compact),\r\n    ]\r\n\r\nclass PagesLayoutDef(Struct):\r\n    fields = [\r\n        Field(\"name\", String(None)),\r\n        Field(\"page1\", String(None)),\r\n        Field(\"page2\", String(None)),\r\n        Field(\"spaceDx\", I32(4))\r\n    ]\r\n\r\ndef gen_mui():\r\n    dst_dir = mui_src_dir()\r\n    structs = [\r\n        ButtonVectorDef(), ButtonDef(), ScrollBarDef(),\r\n        DirectionalLayoutDataDef(), HorizontalLayoutDef(),\r\n        VerticalLayoutDef()\r\n    ]\r\n\r\n    file_path_base = os.path.join(dst_dir, \"MuiDefs\")\r\n    gen_for_top_level_vals(structs, file_path_base)\r\n\r\n    file_path_base = os.path.join(src_dir(), \"MuiEbookPageDef\")\r\n    gen_for_top_level_vals([EbookPageDef()], file_path_base)\r\n\r\n    file_path_base = os.path.join(src_dir(), \"PagesLayoutDef\")\r\n    gen_for_top_level_vals([PagesLayoutDef()], file_path_base)\r\n\r\ndef main():\r\n    gen_mui()\r\n\r\nif __name__ == \"__main__\":\r\n    main()\r\n"
  },
  {
    "path": "scripts/metadata/gen_txt.py",
    "content": "import sys, os, codecs, random, metadata\r\nfrom metadata import Field\r\n\r\nsys.path.append(\"scripts\")  # assumes is being run as ./scrpts/metadata/gen_txt.py\r\nimport util\r\n\r\n\"\"\"\r\nTODO:\r\n  - test perf on a large document i.e. ~ 1 MB. Randomly generate a big\r\n    file and see how fast is SerializeTxtParser.cpp on that file\r\n  - add a way to pass Allocator to Serialize/Deserialize\r\n\r\nTodo maybe: arrays of basic types\r\n\"\"\"\r\n\r\n# kind of ugly that those are globals\r\n\r\n# character we use for escaping strings\r\ng_escape_char = \"$\"\r\n\r\n# if true, will add whitespace at the end of the string, just for testing\r\ng_add_whitespace = False\r\n\r\n# if True, adds per-object reflection info. Not really working\r\ng_with_reflection = False\r\n\r\ndef to_win_newlines(s):\r\n    #s = s.replace(\"\\r\\n\", \"\\n\")\r\n    s = s.replace(\"\\n\", \"\\r\\n\")\r\n    return s\r\n\r\ndef write_to_file(file_path, s): file(file_path, \"w\").write(to_win_newlines(s))\r\n\r\ndef write_to_file_utf8_bom(file_path, s):\r\n    with codecs.open(file_path, \"w\", \"utf-8-sig\") as fo:\r\n        fo.write(to_win_newlines(s))\r\n\r\n# fooBar => foo_bar\r\ndef name2name(s):\r\n    if s is None:\r\n        return None\r\n    res = \"\"\r\n    n_upper = 0\r\n    for c in s:\r\n        if c.isupper():\r\n            if n_upper == 0:\r\n                res += \"_\"\r\n            n_upper += 1\r\n            res += c.lower()\r\n        else:\r\n            if n_upper > 1:\r\n                res += \"_\"\r\n            res += c\r\n            n_upper = 0\r\n    return res\r\n\r\ndef prefix_str(indent): return \"  \" * indent\r\n\r\ndef field_val_as_str(field):\r\n    assert isinstance(field, Field)\r\n    if field.is_bool():\r\n        if field.val:\r\n            return \"true\"\r\n        else:\r\n            return \"false\"\r\n    if field.is_color():\r\n        if field.val > 0xffffff:\r\n            return \"#%08x\" % field.val\r\n        else:\r\n            return \"#%06x\" % field.val\r\n    if field.is_signed() or field.is_unsigned() or field.is_float():\r\n        return str(field.val)\r\n    if field.is_string():\r\n        return field.val\r\n    assert False, \"don't know how to serialize %s\" % str(field.typ)\r\n\r\ndef _field_def_val_for_FieldMetada(field):\r\n    if field.is_struct() or field.is_array():\r\n        return \"&g%sMetadata\" % field.typ.name()\r\n    if field.is_bool():\r\n        return [\"0\", \"1\"][field.val]\r\n    if field.is_color():\r\n        if field.val > 0xffffff:\r\n            return \"0x%08x\" % field.val\r\n        else:\r\n            return \"0x%06x\" % field.val\r\n    # Note: doesn't handle default values outside of uintptr_t range,\r\n    # which is 32bits on 32-bit arch\r\n    if field.is_signed():\r\n        assert metadata.is_valid_signed(32, field.val)\r\n        return str(field.val)\r\n    if field.is_unsigned():\r\n        assert metadata.is_valid_unsigned(32, field.val)\r\n        return str(field.val)\r\n    # TODO: too lazy to do proper utf8 conversion and escaping, so\r\n    # just returning NULL. We use non-null only for testing\r\n    if field.is_string():\r\n        return \"NULL\"\r\n    if field.is_float():\r\n        return '\"%s\"' % str(field.val)\r\n    assert False, \"don't know how to serialize %s\" % str(field.typ)\r\n\r\ndef field_def_val_for_FieldMetada(field):\r\n    s = _field_def_val_for_FieldMetada(field)\r\n    if s != \"NULL\": s = \"(uintptr_t)\" + s\r\n    return s\r\n\r\ndef escape_char(c):\r\n    if c == g_escape_char:\r\n        return c + c\r\n    if c in \"[]\":\r\n        return g_escape_char + c\r\n    if c == '\\r':\r\n        return g_escape_char + 'r'\r\n    if c == '\\n':\r\n        return g_escape_char + 'n'\r\n    return c\r\n\r\ndef escape_str(s):\r\n    if 0 == g_escape_char: return s\r\n    res = \"\"\r\n    for c in s:\r\n        res += escape_char(c)\r\n    return res\r\n\r\ndef ser_field(field, lines, indent):\r\n    val_str = field_val_as_str(field)\r\n    # omit serializing empty strings\r\n    if val_str is None: return\r\n    val_str = escape_str(val_str)\r\n    var_name = name2name(field.name)\r\n    prefix = prefix_str(indent)\r\n    lines += [\"%s%s: %s\" % (prefix, var_name, val_str)]\r\n\r\ndef ser_array(field, lines, indent):\r\n    assert field.is_array()\r\n\r\n    n = len(field.val.values)\r\n    if 0 == n: return\r\n\r\n    prefix = prefix_str(indent)\r\n    var_name = name2name(field.name)\r\n    lines += [\"%s%s [\" % (prefix, var_name)]\r\n    prefix += \"  \"\r\n    for val in field.val.values:\r\n        #print(str(val))\r\n        #print(val.as_str())\r\n        lines += [prefix + \"[\"]\r\n        ser_struct(val, None, lines, indent + 1)\r\n        lines += [prefix + \"]\"]\r\n    prefix = prefix[:-2]\r\n    lines += [\"%s]\" % prefix]\r\n\r\ndef ser_struct_compact(struct, name, lines, indent):\r\n    assert struct.is_struct()\r\n    vals = []\r\n    for field in struct.values:\r\n        val_str = escape_str(field_val_as_str(field))\r\n        assert \" \" not in val_str\r\n        vals += [val_str]\r\n    prefix = prefix_str(indent)\r\n    lines += [prefix + name2name(name) + \": \" + \" \".join(vals)]\r\n\r\ndef ser_struct(struct, name, lines, indent):\r\n    assert struct.is_struct()\r\n    prefix = prefix_str(indent)\r\n\r\n    #print(\"name: %s, indent: %d, prefix: '%s'\" % (name, indent, prefix))\r\n\r\n    if name is not None:\r\n        lines += [\"%s%s [\" % (prefix, name2name(name))]\r\n\r\n    for field in struct.values:\r\n        if field.is_no_store():\r\n            continue\r\n\r\n        if field.is_array():\r\n            ser_array(field, lines, indent + 1)\r\n            continue\r\n\r\n        if field.is_compact():\r\n            ser_struct_compact(field.val, field.name, lines, indent + 1)\r\n            continue\r\n\r\n        if field.is_struct():\r\n            if field.val.offset == 0:\r\n                if False:  # Note: this omits empty values\r\n                    lines += [\"%s%s: \" % (prefix, name2name(field.name))]\r\n                continue\r\n            ser_struct(field.val, field.name, lines, indent + 1)\r\n            continue\r\n\r\n        ser_field(field, lines, indent + 1)\r\n\r\n    if name is not None:\r\n        lines += [\"%s]\" % prefix]\r\n\r\ndef gen_struct_def(stru_cls):\r\n    name = stru_cls.__name__\r\n    lines = [\"struct %s {\" % name]\r\n    rows = [[field.c_type(), field.name] for field in stru_cls.fields]\r\n    if g_with_reflection:\r\n        rows = [[\"const StructMetadata *\", \"def\"]] + rows\r\n    lines += [\"    %s  %s;\" % (e1, e2) for (e1, e2) in util.fmt_rows(rows, [util.FMT_RIGHT])]\r\n    lines += [\"};\\n\"]\r\n    return \"\\n\".join(lines)\r\n\r\ndef gen_struct_defs(structs):\r\n    return \"\\n\".join([gen_struct_def(stru) for stru in structs])\r\n\r\nprototypes_tmpl = \"\"\"extern const StructMetadata g%(name)sMetadata;\r\n\r\ninline %(name)s *Deserialize%(name)s(char *data, size_t dataLen)\r\n{\r\n    return (%(name)s*)Deserialize(data, dataLen, &g%(name)sMetadata);\r\n}\r\n\r\ninline %(name)s *Deserialize%(name)s(TxtNode* root)\r\n{\r\n    return (%(name)s*)Deserialize(root, &g%(name)sMetadata);\r\n}\r\n\r\ninline uint8_t *Serialize%(name)s(%(name)s *val, size_t *dataLenOut)\r\n{\r\n    return Serialize((const uint8_t*)val, &g%(name)sMetadata, dataLenOut);\r\n}\r\n\r\ninline void Free%(name)s(%(name)s *val)\r\n{\r\n    FreeStruct((uint8_t*)val, &g%(name)sMetadata);\r\n}\r\n\"\"\"\r\n\r\ntop_level_funcs_txt_tmpl = \"\"\"\r\n\"\"\"\r\n\r\nh_txt_tmpl = \"\"\"// DON'T EDIT MANUALLY !!!!\r\n// auto-generated by gen_txt.py !!!!\r\n\r\nusing namespace sertxt;\r\n\r\n%(struct_defs)s\r\n%(prototypes)s\r\n\"\"\"\r\n\r\ncpp_txt_tmpl = \"\"\"// DON'T EDIT MANUALLY !!!!\r\n// auto-generated by gen_txt.py !!!!\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"SerializeTxt.h\"\r\n#include \"%(file_name)s.h\"\r\n\r\nusing namespace sertxt;\r\n\r\n#define of offsetof\r\n%(structs_metadata)s\r\n#undef of\r\n%(top_level_funcs)s\r\n\"\"\"\r\n\r\ndef gen_prototypes(stru_cls):\r\n    name = stru_cls.__name__\r\n    return prototypes_tmpl % locals()\r\n\r\n\r\n\"\"\"\r\nconst FieldMetadata g${name}FieldMetadata[] = {\r\n    { $offset, $type, &g${name}StructMetadata },\r\n};\r\n\"\"\"\r\ndef gen_struct_fields_txt(stru_cls):\r\n    struct_name = stru_cls.__name__\r\n    lines = [\"const FieldMetadata g%sFieldMetadata[] = {\" % struct_name]\r\n    rows = []\r\n    for field in stru_cls.fields:\r\n        assert isinstance(field, Field)\r\n        typ_enum = field.get_typ_enum()\r\n        offset = \"of(%s, %s)\" % (struct_name, field.name)\r\n        stru_cls.field_names.add(name2name(field.name))\r\n        val = field_def_val_for_FieldMetada(field)\r\n        col = [offset + \",\", typ_enum + \",\", val]\r\n        rows.append(col)\r\n    rows = util.fmt_rows(rows, [util.FMT_RIGHT, util.FMT_RIGHT, util.FMT_RIGHT])\r\n    lines += [\"    { %s %s %s },\" % (e1, e2, e3) for (e1, e2, e3) in rows]\r\n    lines += [\"};\\n\"]\r\n    return lines\r\n\r\n\"\"\"\r\nconst StructMetadata g${name}StructMetadata = {\r\n    $size,\r\n    $nFields,\r\n    $fieldNames,\r\n    $fields\r\n};\r\n\"\"\"\r\ndef gen_structs_metadata_txt(structs):\r\n    lines = []\r\n    for stru_cls in structs:\r\n        stru_cls.field_names = util.SeqStrings()\r\n        struct_name = stru_cls.__name__\r\n        nFields = len(stru_cls.fields)\r\n        fields = \"&g%sFieldMetadata[0]\" % struct_name\r\n        lines += gen_struct_fields_txt(stru_cls)\r\n        field_names = stru_cls.field_names.get_all_c_escaped()\r\n        lines += [\"\"\"const StructMetadata g%(struct_name)sMetadata = {\r\n    sizeof(%(struct_name)s),\r\n    %(nFields)d,\r\n    %(field_names)s,\r\n    %(fields)s\r\n};\\n\"\"\" % locals()]\r\n    return \"\\n\".join(lines)\r\n\r\ndef add_cls(cls, structs):\r\n    if cls not in structs:\r\n        structs.append(cls)\r\n\r\n# return a list of Struct subclasses that are needed to define val\r\ndef structs_from_top_level_value_rec(struct, structs):\r\n    assert struct.is_struct()\r\n    for field in struct.values:\r\n        if field.is_array():\r\n            try:\r\n                add_cls(field.val.typ, structs)\r\n            except:\r\n                print(field)\r\n                print(field.name)\r\n                raise\r\n        elif field.is_struct():\r\n            structs_from_top_level_value_rec(field.val, structs)\r\n    add_cls(struct.__class__, structs)\r\n\r\ndef gen_top_level_funcs_txt(top_level):\r\n    assert top_level.is_struct()\r\n    name = top_level.name()\r\n    return top_level_funcs_txt_tmpl % locals()\r\n\r\ndef _gen_for_top_level_vals(top_level_vals, file_path):\r\n    structs = []\r\n    for v in top_level_vals:\r\n        structs_from_top_level_value_rec(v, structs)\r\n\r\n    prototypes = \"\"\r\n    for v in top_level_vals:\r\n        prototypes += gen_prototypes(v.__class__)\r\n\r\n    struct_defs = gen_struct_defs(structs)\r\n    structs_metadata = gen_structs_metadata_txt(structs)\r\n    top_level_funcs = \"\"\r\n    for v in top_level_vals:\r\n        top_level_funcs += gen_top_level_funcs_txt(v)\r\n\r\n    file_name = os.path.basename(file_path)\r\n    write_to_file(file_path + \".h\", h_txt_tmpl % locals())\r\n    write_to_file(file_path + \".cpp\", cpp_txt_tmpl % locals())\r\n\r\ndef gen_for_top_level_vals(top_level_vals, file_path):\r\n    # TODO: if element, wrap in a list\r\n    _gen_for_top_level_vals(top_level_vals, file_path)\r\n\r\n# we add whitespace to all lines that don't have \"str\" in them\r\n# which is how we prevent adding whitespace to string fields,\r\n# where whitespace at end is significant. For that to work all\r\n# string field names must have \"str\" in them. This is only for testing\r\ndef add_random_ws(s):\r\n    if \"str\" in s: return s\r\n    return s + \" \" * random.randint(1, 4)\r\n\r\ndef gen_txt_for_top_level_val(top_level_val, file_path):\r\n    lines = []\r\n    # -1 is a bit hackish, because we elide the name of the top-level struct\r\n    # to make it more readable\r\n    ser_struct(top_level_val, None, lines, -1)\r\n    if g_add_whitespace:\r\n        new_lines = []\r\n        for l in lines:\r\n            # add empty lines to test resilience of the parser\r\n            if 1 == random.randint(1, 3):\r\n                new_lines.append(add_random_ws(\" \"))\r\n            new_lines.append(add_random_ws(l))\r\n        lines = new_lines\r\n    s = \"\\n\".join(lines) + \"\\n\"  # for consistency with how C code does it\r\n    write_to_file_utf8_bom(file_path, s)\r\n\r\ndef set_whitespace(add_whitespace):\r\n    global g_add_whitespace\r\n    g_add_whitespace = add_whitespace\r\n"
  },
  {
    "path": "scripts/metadata/metadata.py",
    "content": "import types\r\n\r\ndef is_valid_signed(bits, val):\r\n    if type(val) not in (types.IntType, types.LongType): return False\r\n    e = bits - 1\r\n    min_val = -(2 ** e)\r\n    if val < min_val: return False\r\n    max_val = (2 ** e) - 1\r\n    if val > max_val: return False\r\n    return True\r\n\r\ndef is_valid_unsigned(bits, val):\r\n    if type(val) not in (types.IntType, types.LongType): return False\r\n    if val < 0: return False\r\n    if val > 2 ** bits: return False\r\n    return True\r\n\r\ndef is_valid_string(val):\r\n    if val is None: return True\r\n    return type(val) in (types.StringType, types.UnicodeType)\r\n\r\nclass Type(object):\r\n    def __init__(self, def_val):\r\n        self.c_type_override = None\r\n        self.set_val(def_val)\r\n\r\n    def set_val(self, val):\r\n        assert self.is_valid_val(val), \"%s is not a valid value of %s\" % (str(self.val), str(self))\r\n        self.val = val\r\n\r\n    def c_type(self):\r\n        if self.c_type_override is not None:\r\n            return self.c_type_override\r\n        return self.c_type_class\r\n\r\n    def get_type_typ_enum(self):\r\n        return self.type_enum\r\n\r\n    def is_struct(self):\r\n        return isinstance(self, Struct)\r\n\r\n    def is_array(self):\r\n        return isinstance(self, Array)\r\n\r\nclass Bool(Type):\r\n    c_type_class = \"bool\"\r\n    type_enum = \"TYPE_BOOL\"\r\n\r\n    def __init__(self, def_val):\r\n        super(Bool, self).__init__(def_val)\r\n\r\n    def is_valid_val(self, val):\r\n        return val in (True, False)\r\n\r\nclass U16(Type):\r\n    c_type_class = \"uint16_t\"\r\n    type_enum = \"TYPE_U16\"\r\n\r\n    def is_valid_val(self, val):\r\n        return is_valid_unsigned(16, val)\r\n\r\nclass I32(Type):\r\n    c_type_class = \"int32_t\"\r\n    type_enum = \"TYPE_I32\"\r\n\r\n    def __init__(self, def_val=0):\r\n        super(I32, self).__init__(def_val)\r\n\r\n    def is_valid_val(self, val):\r\n        return is_valid_signed(32, val)\r\n\r\nclass U32(Type):\r\n    c_type_class = \"uint32_t\"\r\n    type_enum = \"TYPE_U32\"\r\n\r\n    def is_valid_val(self, val):\r\n        return is_valid_unsigned(32, val)\r\n\r\nclass U64(Type):\r\n    c_type_class = \"uint64_t\"\r\n    type_enum = \"TYPE_U64\"\r\n\r\n    def is_valid_val(self, val):\r\n        return is_valid_unsigned(64, val)\r\n\r\n# behaves like uint32_t, using unique name to signal intent\r\nclass Color(U32):\r\n    type_enum = \"TYPE_COLOR\"\r\n\r\nclass String(Type):\r\n    c_type_class = \"const char *\"\r\n    type_enum = \"TYPE_STR\"\r\n\r\n    def is_valid_val(self, val):\r\n        return is_valid_string(val)\r\n\r\nclass WString(Type):\r\n    c_type_class = \"const WCHAR *\"\r\n    type_enum = \"TYPE_WSTR\"\r\n\r\n    def is_valid_val(self, val):\r\n        return is_valid_string(val)\r\n\r\nclass Float(Type):\r\n    c_type_class = \"float\"\r\n    type_enum = \"TYPE_FLOAT\"\r\n\r\n    def is_valid_val(self, val):\r\n        return type(val) in (types.IntType, types.LongType, types.FloatType)\r\n\r\n# struct is just a base class\r\n# subclasses should have class instance fields which is a list of tuples:\r\n# defining name and type of the struct members:\r\n# fields = [ (\"boolField\", Bool(True), (\"u32Field\", U32(32))]\r\n#\r\n# TODO: implement struct inheritance i.e. a subclass should inherit all\r\n# fields from its parent\r\nclass Struct(Type):\r\n    c_type_class = \"\"\r\n    type_enum = \"TYPE_STRUCT_PTR\"\r\n    fields = []\r\n\r\n    def __init__(self, *vals):\r\n        # fields must be a class variable in Struct's subclass\r\n        self.values = [Field(f.name, f.typ, f.flags) for f in self.fields]\r\n        self.c_type_override = \"%s *\" % self.name()\r\n        self.offset = None\r\n        for i in range(len(vals)):\r\n            self.values[i].set_val(vals[i])\r\n\r\n    def is_valid_val(self, val):\r\n        return issubclass(val, Struct)\r\n\r\n    def name(self):\r\n        return self.__class__.__name__\r\n\r\n    def as_str(self):\r\n        s = str(self) + \"\\n\"\r\n        for v in self.values:\r\n            if isinstance(v, Field):\r\n                s += \"%s: %s\\n\" % (v.name, str(v.val))\r\n        return s\r\n\r\n    def __setattr__(self, name, value):\r\n        # special-case self.values, which we refer to\r\n        if name == \"values\":\r\n            object.__setattr__(self, name, value)\r\n            return\r\n\r\n        for field in self.values:\r\n            if field.name == name:\r\n                field.set_val(value)\r\n                return\r\n        object.__setattr__(self, name, value)\r\n\r\nclass Array(Type):\r\n    c_type_class = \"\"\r\n    type_enum = \"TYPE_ARRAY\"\r\n\r\n    def __init__(self, typ, values):\r\n        # TODO: we don't support arrays of primitve values, just structs\r\n        assert issubclass(typ, Struct)\r\n        self.typ = typ\r\n        self.values = values\r\n        for v in values:\r\n            assert self.is_valid_val(v)\r\n        self.c_type_override = \"Vec<%s*> *\" % typ.__name__\r\n        self.offset = None\r\n\r\n    def is_valid_val(self, val):\r\n        return isinstance(val, self.typ)\r\n\r\n    def name(self):\r\n        try:\r\n            return self.typ.__name__\r\n        except:\r\n            print(self.typ)\r\n            raise\r\n\r\n# those are bit flags\r\nNoStore = 1\r\nCompact = 2\r\n\r\nclass Field(object):\r\n    def __init__(self, name, typ_val, flags=0):\r\n        self.name = name\r\n        self.typ = typ_val\r\n        self.flags = flags\r\n\r\n        if self.is_no_store(): assert not self.is_compact()\r\n        if self.is_compact():\r\n            to_test = typ_val\r\n            if typ_val.is_array():\r\n                to_test = typ_val.typ\r\n            else:\r\n                assert to_test.is_struct()\r\n            for field in to_test.fields:\r\n                assert not field.is_struct()\r\n\r\n        if typ_val.is_struct():\r\n            # TODO: support NULL values for the struct, represented by using\r\n            # class for typ_val\r\n            self.val = typ_val\r\n        elif typ_val.is_array():\r\n            self.val = typ_val\r\n        else:\r\n            self.val = typ_val.val\r\n\r\n    def c_type(self):\r\n        return self.typ.c_type()\r\n\r\n    def is_struct(self):\r\n        return self.typ.is_struct()\r\n\r\n    def is_signed(self):\r\n        return type(self.typ) == I32\r\n\r\n    def is_unsigned(self):\r\n        return type(self.typ) in (Bool, U16, U32, U64, Color)\r\n\r\n    def is_bool(self):\r\n        return type(self.typ) == Bool\r\n\r\n    def is_color(self):\r\n        return type(self.typ) == Color\r\n\r\n    def is_string(self):\r\n        return type(self.typ) in (String, WString)\r\n\r\n    def is_float(self):\r\n        return type(self.typ) == Float\r\n\r\n    def is_no_store(self):\r\n        return self.flags & NoStore == NoStore\r\n\r\n    def is_compact(self):\r\n        return self.flags & Compact == Compact\r\n\r\n    def is_array(self):\r\n        return type(self.typ) == Array\r\n\r\n    def set_val(self, val):\r\n        # Note: we don't support this for struct or arrays\r\n        assert not (self.is_struct() or self.is_array())\r\n        assert self.typ.is_valid_val(val)\r\n        self.val = val\r\n\r\n    def get_typ_enum(self, for_bin=False):\r\n        type_enum = self.typ.get_type_typ_enum()\r\n        # binary doesn't have a notion of compact storage\r\n        is_compact = self.is_compact() and not for_bin\r\n        if self.is_no_store() or is_compact:\r\n            s = \"(Type)(\" + type_enum\r\n            if self.is_no_store():\r\n                s = s + \" | TYPE_NO_STORE_MASK\"\r\n            if self.is_compact():\r\n                s = s + \" | TYPE_STORE_COMPACT_MASK\"\r\n            return s + \")\"\r\n        return type_enum\r\n"
  },
  {
    "path": "scripts/obsolete/build.py",
    "content": "#!/usr/bin/env python\r\n\r\n\"\"\"\r\nBuilds a (pre)release build of SumatraPDF, including the installer,\r\nand optionally uploads it to s3.\r\n\r\nTerms:\r\n static build  - SumatraPDF.exe single executable with mupdf code statically\r\n                 linked in\r\n library build - SumatraPDF.exe executable that uses libmupdf.dll\r\n\r\nBuilding release version:\r\n  * extract version from Version.h\r\n  * build with nmake, sending version as argument\r\n  * build an installer\r\n  * upload to s3 kjkpub bucket. Uploaded files:\r\n      sumatrapdf/rel/SumatraPDF-<ver>.exe\r\n         uncompressed portable executable, for archival\r\n      sumatrapdf/rel/SumatraPDF-<ver>.pdb.zip\r\n         pdb symbols for libmupdf.dll, and Sumatra's static and library builds\r\n      sumatrapdf/rel/SumatraPDF-<ver>-install.exe\r\n         installer for library build\r\n      sumatrapdf/sumpdf-update.txt\r\n         updates Latest version, keeps Stable version\r\n  * files sumatrapdf/sumpdf-update.txt and sumatrapdf/sumpdf-latest.txt\r\n    must be manually updated using update_auto_update_ver.py in order to\r\n    make automated update checks find the latest version\r\n\r\nBuilding pre-release version:\r\n  * get git version\r\n  * build with nmake, sending svn version as argument\r\n  * build an installer\r\n  * upload to s3 kjkpub bucket. Uploaded files:\r\n      sumatrapdf/prerel/SumatraPDF-prerelease-<svnrev>.exe\r\n        static, portable executable\r\n      sumatrapdf/prerel/SumatraPDF-prerelease-<svnrev>.pdb.zip\r\n         pdb symbols for libmupdf.dll and Sumatra's static and library builds\r\n      sumatrapdf/prerel/SumatraPDF-prerelease-<svnrev>-install.exe\r\n         installer for library build\r\n      sumatrapdf/sumatralatest.js\r\n      sumatrapdf/sumpdf-prerelease-update.txt\r\n      sumatrapdf/sumpdf-prerelease-latest.txt\r\n\"\"\"\r\n\r\nimport os\r\nimport shutil\r\nimport sys\r\nimport time\r\nimport re\r\nimport struct\r\nimport types\r\nimport subprocess\r\nimport s3\r\nimport util\r\nfrom util import test_for_flag, run_cmd_throw, run_cmd\r\nfrom util import verify_started_in_right_directory, log\r\nfrom util import extract_sumatra_version, zip_file, get_git_linear_version\r\nfrom util import load_config, verify_path_exists, strip_empty_lines\r\nimport trans_upload\r\nimport trans_download\r\nimport upload_sources\r\n\r\n\r\ndef usage():\r\n    print(\r\n        \"build.py [-upload][-uploadtmp][-test][-test-installer][-prerelease][-platform=X64]\")\r\n    sys.exit(1)\r\n\r\n\r\n@util.memoize\r\ndef get_top_dir():\r\n    scripts_dir = os.path.realpath(os.path.dirname(__file__))\r\n    return os.path.realpath(os.path.join(scripts_dir, \"..\"))\r\n\r\n\r\ndef copy_to_dst_dir(src_path, dst_dir):\r\n    name_in_obj_rel = os.path.basename(src_path)\r\n    dst_path = os.path.join(dst_dir, name_in_obj_rel)\r\n    shutil.copy(src_path, dst_path)\r\n\r\n\r\ndef create_pdb_lzsa_archive(dir, archive_name):\r\n    archive_path = os.path.join(dir, archive_name)\r\n    MakeLzsa = os.path.join(dir, \"MakeLzsa.exe\")\r\n    files = [\"libmupdf.pdb\", \"Installer.pdb\",\r\n             \"SumatraPDF-no-MuPDF.pdb\", \"SumatraPDF.pdb\"]\r\n    files = [os.path.join(dir, file) + \":\" + file for file in files]\r\n    run_cmd_throw(MakeLzsa, archive_path, *files)\r\n    return archive_path\r\n\r\n\r\ndef create_pdb_zip_archive(dir, archive_name):\r\n    archive_path = os.path.join(dir, archive_name)\r\n    files = [\"libmupdf.pdb\", \"Installer.pdb\",\r\n             \"SumatraPDF-no-MuPDF.pdb\", \"SumatraPDF.pdb\"]\r\n    for file_name in files:\r\n        file_path = os.path.join(dir, file_name)\r\n        zip_file(archive_path, file_path, file_name, compress=True, append=True)\r\n    print(\"Created zip archive: %s\" % archive_path)\r\n    return archive_path\r\n\r\n\r\n# delete all but the last 3 pre-release builds in order to use less s3 storage\r\ndef delete_old_pre_release_builds():\r\n    s3Dir = \"sumatrapdf/prerel/\"\r\n    keys = s3.list(s3Dir)\r\n    files_by_ver = {}\r\n    for k in keys:\r\n        # print(k.name)\r\n        # sumatrapdf/prerel/SumatraPDF-prerelease-4819.pdb.zip\r\n        ver = re.findall(\r\n            r'sumatrapdf/prerel/SumatraPDF-prerelease-(\\d+)*', k.name)\r\n        ver = int(ver[0])\r\n        # print(ver)\r\n        val = files_by_ver.get(ver, [])\r\n        # print(val)\r\n        val.append(k.name)\r\n        # print(val)\r\n        files_by_ver[ver] = val\r\n    versions = files_by_ver.keys()\r\n    versions.sort()\r\n    # print(versions)\r\n    todelete = versions[:-3]\r\n    # print(todelete)\r\n    for vertodelete in todelete:\r\n        for f in files_by_ver[vertodelete]:\r\n            #print(\"Deleting %s\" % f)\r\n            s3.delete(f)\r\n\r\n\r\ndef sign(file_path, cert_pwd):\r\n    # not everyone has a certificate, in which case don't sign\r\n    if cert_pwd is None:\r\n        print(\"Skipping signing %s\" % file_path)\r\n        return\r\n    # the sign tool is finicky, so copy it and cert to the same dir as\r\n    # exe we're signing\r\n    file_dir = os.path.dirname(file_path)\r\n    file_name = os.path.basename(file_path)\r\n    cert_src = os.path.join(\"scripts\", \"cert.pfx\")\r\n    cert_dest = os.path.join(file_dir, \"cert.pfx\")\r\n    if not os.path.exists(cert_dest):\r\n        shutil.copy(cert_src, cert_dest)\r\n    curr_dir = os.getcwd()\r\n    os.chdir(file_dir)\r\n    run_cmd_throw(\r\n        \"signtool.exe\", \"sign\", \"/t\", \"http://timestamp.verisign.com/scripts/timstamp.dll\",\r\n        \"/du\", \"http://blog.kowalczyk.info/software/sumatrapdf/\", \"/f\", \"cert.pfx\", \"/p\", cert_pwd, file_name)\r\n    os.chdir(curr_dir)\r\n\r\n\r\n# sometimes sign() fails, probably because of time-stamping, so we retry 3 times,\r\n# 1 minute apart\r\ndef sign_retry(file_path, cert_pwd):\r\n    nRetries = 3\r\n    while nRetries > 1:  # the last one will rethrow\r\n        try:\r\n            sign(file_path, cert_pwd)\r\n            return\r\n        except:\r\n            time.sleep(60)  # 1 min\r\n        nRetries -= 1\r\n    sign(file_path, cert_pwd)\r\n\r\n\r\ndef print_run_resp(out, err):\r\n    if len(out) > 0:\r\n        print(out)\r\n    if len(err) > 0:\r\n        print(err)\r\n\r\n\r\ndef zip_one_file(dir, to_pack, zip_name):\r\n    verify_path_exists(dir)\r\n    # for the benefit of pigz, we have to cd to the directory, because\r\n    # we don't control the name of the file inside created zip file - it's\r\n    # the same as path of the file we're compressing\r\n    curr_dir = os.getcwd()\r\n    os.chdir(dir)\r\n    verify_path_exists(to_pack)\r\n    util.delete_file(zip_name)  # ensure destination doesn't exist\r\n    try:\r\n        # -11 for zopfil compression\r\n        # --keep to not delete the source file\r\n        # --zip to create a single-file zip archive\r\n        # we can't control the name of the file pigz will create, so rename\r\n        # to desired name after it's created\r\n        pigz_dst = to_pack + \".zip\"\r\n        util.delete_file(pigz_dst)\r\n        run_cmd_throw(\"pigz\", \"-11\", \"--keep\", \"--zip\", to_pack)\r\n        print(\"Compressed using pigz.exe\")\r\n        if pigz_dst != zip_name:\r\n            print(\"moving %s => %s\" % (pigz_dst, zip_name))\r\n            shutil.move(pigz_dst, zip_name)\r\n    except:\r\n        # if pigz.exe is not in path, use regular zip compression\r\n        zip_file(zip_name, to_pack, to_pack, compress=True)\r\n        print(\"Compressed using regular zip\")\r\n    verify_path_exists(zip_name)\r\n    os.chdir(curr_dir)\r\n\r\n\r\n# returns a ver up to first decimal point i.e. \"2.3.1\" => \"2.3\"\r\ndef get_short_ver(ver):\r\n    parts = ver.split(\".\")\r\n    if len(parts) <= 2:\r\n        return ver\r\n    return parts[0] + \".\" + parts[1]\r\n\r\n\r\n# when doing a release build, we must be on /svn/branches/${ver_short}working\r\n# branch\r\ndef verify_correct_branch(ver):\r\n    # TODO: update for git\r\n    raise BaseException(\"implement for git\")\r\n    #short_ver = get_short_ver(ver)\r\n    #branch = get_svn_branch()\r\n    #expected = \"/branches/%sworking\" % short_ver\r\n    #assert branch == expected, \"svn branch is '%s' and should be '%s' for version %s (%s)\" % (branch, expected, ver, short_ver)\r\n\r\n\r\n# if we haven't tagged this release in svn yet, svn info for the /tags/${ver}rel\r\n# must fail\r\ndef verify_not_tagged_yet(ver):\r\n    # TODO: update for git\r\n    raise BaseException(\"implement for git\")\r\n    #out, err, errcode = run_cmd(\"svn\", \"info\", \"https://sumatrapdf.googlecode.com/svn/tags/%srel\" % ver)\r\n    #assert errcode == 1, \"out: '%s'\\nerr:'%s'\\nerrcode:%d\" % (out, err, errcode)\r\n\r\n\r\ndef svn_tag_release(ver):\r\n    raise BaseException(\"implement for git\")\r\n    #working = \"https://sumatrapdf.googlecode.com/svn/branches/%sworking\" % get_short_ver(ver)\r\n    #rel = \"https://sumatrapdf.googlecode.com/svn/tags/%srel\" % ver\r\n    #msg = \"tag %s release\" % ver\r\n    #run_cmd_throw(\"svn\", \"copy\", working, rel, \"-m\", msg)\r\n\r\n\r\ndef try_find_scripts_file(file_name):\r\n    top_dir = get_top_dir()\r\n    dst = os.path.join(top_dir, \"scripts\", file_name)\r\n    src = os.path.join(top_dir, \"..\", \"sumatrapdf\", \"scripts\", file_name)\r\n    if not os.path.exists(dst) and os.path.exists(src):\r\n        shutil.copyfile(src, dst)\r\n\r\n\r\n# returns the version marked as Stable at the given url;\r\n# returns the Latest version or the provided fallback if it's missing\r\ndef get_stable_version(url, fallback):\r\n    import urllib2\r\n    import SquareTree\r\n    try:\r\n        data = urllib2.urlopen(url).read()\r\n        root = SquareTree.Parse(data)\r\n        node = root.GetChild(\"SumatraPDF\")\r\n        return node.GetValue(\"Stable\") or node.GetValue(\"Latest\") or fallback\r\n    except:\r\n        return fallback\r\n\r\n\r\n# if scripts/cert.pfx and scripts/config.py don't exist, try to copy them from\r\n# ../../sumatrapdf/scripts directory\r\ndef try_find_config_files():\r\n    try_find_scripts_file(\"config.py\")\r\n    try_find_scripts_file(\"cert.pfx\")\r\n\r\n\r\ndef append_to_file(path, s):\r\n    with open(path, \"a\") as fo:\r\n        fo.write(s)\r\n        fo.write(\"\\n---------------------------------------------\\n\\n\")\r\n\r\n\r\ndef build(upload, upload_tmp, testing, build_test_installer, build_rel_installer, build_prerelease, skip_transl_update, svn_revision, target_platform):\r\n\r\n    verify_started_in_right_directory()\r\n    try_find_config_files()\r\n    if build_prerelease:\r\n        if svn_revision is None:\r\n            ver = str(get_git_linear_version())\r\n        else:\r\n            # allow to pass in an SVN revision, in case SVN itself isn't\r\n            # available\r\n            ver = svn_revision\r\n    else:\r\n        ver = extract_sumatra_version(os.path.join(\"src\", \"Version.h\"))\r\n        if upload:\r\n            verify_correct_branch(ver)\r\n            verify_not_tagged_yet(ver)\r\n\r\n    log(\"Version: '%s'\" % ver)\r\n\r\n    # don't update translations for release versions to prevent Trunk changes\r\n    # from messing up the compilation of a point release on a branch\r\n    if build_prerelease and not skip_transl_update:\r\n        trans_upload.uploadStringsIfChanged()\r\n        changed = trans_download.downloadAndUpdateTranslationsIfChanged()\r\n        # Note: this is not a perfect check since re-running the script will\r\n        # proceed\r\n        if changed:\r\n            print(\r\n                \"\\nNew translations have been downloaded from apptranslator.org\")\r\n            print(\r\n                \"Please verify and checkin src/Translations_txt.cpp and strings/translations.txt\")\r\n            sys.exit(1)\r\n\r\n    filename_base = \"SumatraPDF-%s\" % ver\r\n    if build_prerelease:\r\n        filename_base = \"SumatraPDF-prerelease-%s\" % ver\r\n\r\n    s3_dir = \"sumatrapdf/rel\"\r\n    if build_prerelease:\r\n        s3_dir = \"sumatrapdf/prerel\"\r\n    if upload_tmp:\r\n        upload = True\r\n        s3_dir += \"tmp\"\r\n\r\n    if upload:\r\n        log(\"Will upload to s3 at %s\" % s3_dir)\r\n        conf = load_config()\r\n        s3.set_secrets(conf.aws_access, conf.aws_secret)\r\n        s3.set_bucket(\"kjkpub\")\r\n\r\n    s3_prefix = \"%s/%s\" % (s3_dir, filename_base)\r\n    s3_exe = s3_prefix + \".exe\"\r\n    s3_installer = s3_prefix + \"-install.exe\"\r\n    s3_pdb_lzsa = s3_prefix + \".pdb.lzsa\"\r\n    s3_pdb_zip = s3_prefix + \".pdb.zip\"\r\n    s3_exe_zip = s3_prefix + \".zip\"\r\n\r\n    s3_files = [s3_exe, s3_installer, s3_pdb_lzsa, s3_pdb_zip]\r\n    if not build_prerelease:\r\n        s3_files.append(s3_exe_zip)\r\n\r\n    cert_pwd = None\r\n    cert_path = os.path.join(\"scripts\", \"cert.pfx\")\r\n    if upload:\r\n        map(s3.verify_doesnt_exist, s3_files)\r\n        verify_path_exists(cert_path)\r\n        conf = load_config()\r\n        cert_pwd = conf.GetCertPwdMustExist()\r\n\r\n    obj_dir = \"obj-rel\"\r\n    if target_platform == \"X64\":\r\n        obj_dir += \"64\"\r\n\r\n    log_file_path = os.path.join(obj_dir, \"build_log.txt\")\r\n    if not testing and not build_test_installer and not build_rel_installer:\r\n        shutil.rmtree(obj_dir, ignore_errors=True)\r\n        shutil.rmtree(os.path.join(\"mupdf\", \"generated\"), ignore_errors=True)\r\n\r\n    config = \"CFG=rel\"\r\n    if build_test_installer and not build_prerelease:\r\n        obj_dir = \"obj-dbg\"\r\n        config = \"CFG=dbg\"\r\n    extcflags = \"\"\r\n    if build_prerelease:\r\n        extcflags = \"EXTCFLAGS=-DSVN_PRE_RELEASE_VER=%s\" % ver\r\n    platform = \"PLATFORM=%s\" % (target_platform or \"X86\")\r\n\r\n    # build executables for signing (building the installer will build the rest)\r\n    (out, err) = run_cmd_throw(\"nmake\", \"-f\", \"makefile.msvc\",\r\n                               config, extcflags, platform,\r\n                               \"SumatraPDF\", \"Uninstaller\")\r\n    if build_test_installer:\r\n        print_run_resp(out, err)\r\n\r\n    append_to_file(log_file_path, strip_empty_lines(out))\r\n\r\n    exe = os.path.join(obj_dir, \"SumatraPDF.exe\")\r\n    sign_retry(exe, cert_pwd)\r\n    sign_retry(os.path.join(obj_dir, \"SumatraPDF-no-MuPDF.exe\"), cert_pwd)\r\n    sign_retry(os.path.join(obj_dir, \"uninstall.exe\"), cert_pwd)\r\n\r\n    (out, err) = run_cmd_throw(\"nmake\", \"-f\", \"makefile.msvc\",\r\n                               \"Installer\", config, platform, extcflags)\r\n    if build_test_installer:\r\n        print_run_resp(out, err)\r\n\r\n    append_to_file(log_file_path, strip_empty_lines(out))\r\n\r\n    if build_test_installer or build_rel_installer:\r\n        sys.exit(0)\r\n\r\n    installer = os.path.join(obj_dir, \"Installer.exe\")\r\n    sign_retry(installer, cert_pwd)\r\n\r\n    pdb_lzsa_archive = create_pdb_lzsa_archive(obj_dir, \"%s.pdb.lzsa\" % filename_base)\r\n    pdb_zip_archive = create_pdb_zip_archive(obj_dir, \"%s.pdb.zip\" % filename_base)\r\n\r\n    builds_dir = os.path.join(\"builds\", ver)\r\n    if os.path.exists(builds_dir):\r\n        shutil.rmtree(builds_dir)\r\n    os.makedirs(builds_dir)\r\n\r\n    copy_to_dst_dir(exe, builds_dir)\r\n    copy_to_dst_dir(installer, builds_dir)\r\n    copy_to_dst_dir(pdb_lzsa_archive, builds_dir)\r\n    copy_to_dst_dir(pdb_zip_archive, builds_dir)\r\n\r\n    # package portable version in a .zip file\r\n    if not build_prerelease:\r\n        exe_zip_name = \"%s.zip\" % filename_base\r\n        zip_one_file(obj_dir, \"SumatraPDF.exe\", exe_zip_name)\r\n        exe_zip_path = os.path.join(obj_dir, exe_zip_name)\r\n        copy_to_dst_dir(exe_zip_path, builds_dir)\r\n\r\n    if not upload:\r\n        return\r\n\r\n    if build_prerelease:\r\n        jstxt = 'var sumLatestVer = %s;\\n' % ver\r\n        jstxt += 'var sumBuiltOn = \"%s\";\\n' % time.strftime(\"%Y-%m-%d\")\r\n        jstxt += 'var sumLatestName = \"%s\";\\n' % s3_exe.split(\"/\")[-1]\r\n        jstxt += 'var sumLatestExe = \"https://kjkpub.s3.amazonaws.com/%s\";\\n' % s3_exe\r\n        jstxt += 'var sumLatestPdb = \"https://kjkpub.s3.amazonaws.com/%s\";\\n' % s3_pdb_zip\r\n        jstxt += 'var sumLatestInstaller = \"https://kjkpub.s3.amazonaws.com/%s\";\\n' % s3_installer\r\n\r\n    s3.upload_file_public(installer, s3_installer)\r\n    s3.upload_file_public(pdb_lzsa_archive, s3_pdb_lzsa)\r\n    s3.upload_file_public(pdb_zip_archive, s3_pdb_zip)\r\n    s3.upload_file_public(exe, s3_exe)\r\n\r\n    if build_prerelease:\r\n        s3.upload_data_public(jstxt, \"sumatrapdf/sumatralatest.js\")\r\n        # don't set a Stable version for prerelease builds\r\n        txt = \"[SumatraPDF]\\nLatest %s\\n\" % ver\r\n        s3.upload_data_public(txt, \"sumatrapdf/sumpdf-prerelease-update.txt\")\r\n        # keep updating the legacy file for now\r\n        txt = \"%s\\n\" % ver\r\n        s3.upload_data_public(txt, \"sumatrapdf/sumpdf-prerelease-latest.txt\")\r\n        delete_old_pre_release_builds()\r\n    else:\r\n        # update the Latest version for manual update checks but\r\n        # leave the Stable version for automated update checks\r\n        update_url = \"https://kjkpub.s3.amazonaws.com/sumatrapdf/sumpdf-update.txt\"\r\n        ver_stable = get_stable_version(update_url, \"2.5.2\")\r\n        s3.upload_file_public(exe_zip_path, s3_exe_zip)\r\n        s3.upload_data_public(\"[SumatraPDF]\\nLatest %s\\nStable %s\\n\" % (ver, ver_stable), \"sumatrapdf/sumpdf-update.txt\")\r\n\r\n    if not build_prerelease:\r\n        svn_tag_release(ver)\r\n        upload_sources.upload(ver)\r\n\r\n    # Note: for release builds, must run scripts/update_auto_update_ver.py\r\n\r\n\r\ndef build_pre_release():\r\n    build(\r\n        upload=True, upload_tmp=False, testing=False, build_test_installer=False,\r\n        build_rel_installer=False, build_prerelease=True, skip_transl_update=True,\r\n        svn_revision=None, target_platform=None)\r\n\r\n\r\ndef main():\r\n    args = sys.argv[1:]\r\n    upload = test_for_flag(args, \"-upload\")\r\n    upload_tmp = test_for_flag(args, \"-uploadtmp\")\r\n    testing = test_for_flag(\r\n        args, \"-test\") or test_for_flag(args, \"-testing\")\r\n    build_test_installer = test_for_flag(\r\n        args, \"-test-installer\") or test_for_flag(args, \"-testinst\") or test_for_flag(args, \"-testinstaller\")\r\n    build_rel_installer = test_for_flag(args, \"-testrelinst\")\r\n    build_prerelease = test_for_flag(args, \"-prerelease\")\r\n    skip_transl_update = test_for_flag(args, \"-noapptrans\")\r\n    svn_revision = test_for_flag(args, \"-svn-revision\", True)\r\n    target_platform = test_for_flag(args, \"-platform\", True)\r\n\r\n    if len(args) != 0:\r\n        usage()\r\n    build(\r\n        upload, upload_tmp, testing, build_test_installer, build_rel_installer,\r\n        build_prerelease, skip_transl_update, svn_revision, target_platform)\r\n\r\n\r\ndef test_zip():\r\n    dir = \"obj-rel\"\r\n    to_pack = \"SumatraPDF.exe\"\r\n    zip_name = \"SumatraPDF-2.3.zip\"\r\n    zip_one_file(dir, to_pack, zip_name)\r\n    sys.exit(0)\r\n\r\nif __name__ == \"__main__\":\r\n    #print(\"svn ver: %d\"  % get_git_linear_version())\r\n    main()\r\n"
  },
  {
    "path": "scripts/obsolete/buildbot-fix.py",
    "content": "#!/usr/bin/env python\r\n\r\n# Sometimes a file generated by buildbot doesn't get saved\r\n# in S3, breaking buildbot\r\n# This tool fixes such problems by deleting files from s3 and cache, so that\r\n# they can be re-generated\r\n\r\nimport sys\r\nimport os\r\nimport s3\r\nfrom util import file_remove_try_hard, verify_path_exists, run_cmd_throw, load_config\r\nfrom buildbot import get_stats_cache_dir\r\nfrom buildbot import verify_started_in_right_directory\r\n\r\n# if True, won't actually delete files (locally or in s3)\r\ng_dry_run = False\r\n\r\n# convert string in the form \"7178.txt\" => 7178\r\n\r\n\r\ndef stats_txt_name_to_svn_no(s):\r\n    return int(s.split(\".\")[0])\r\n\r\n# cached\r\ng_s3_files = None\r\n\r\n\r\ndef get_s3_files():\r\n    global g_s3_files\r\n    if g_s3_files == None:\r\n        files = s3.list(\"sumatrapdf/buildbot/\")\r\n        g_s3_files = [f.name for f in files]\r\n    return g_s3_files\r\n\r\ng_s3_files_dict = None\r\n\r\n\r\ndef get_s3_files_dict():\r\n    global g_s3_files_dict\r\n    if g_s3_files_dict == None:\r\n        files = get_s3_files()\r\n        g_s3_files_dict = {}\r\n        for f in files:\r\n            g_s3_files_dict[f] = True\r\n    return g_s3_files_dict\r\n\r\n\r\ndef get_s3_vers():\r\n    files = get_s3_files()\r\n    vers = {}\r\n    for f in files:\r\n        parts = f.split(\"/\")\r\n        if len(parts) != 4:\r\n            continue\r\n        ver = int(parts[2])\r\n        vers[ver] = True\r\n    res = vers.keys()\r\n    res.sort()\r\n    return res\r\n\r\n\r\ndef valid_s3_ver(ver):\r\n    files = get_s3_files_dict()\r\n    s3Dir = \"sumatrapdf/buildbot/%d/\" % ver\r\n    name = s3Dir + \"stats.txt\"\r\n    if not name in files:\r\n        print(\"ver %d invalid because s3 file %s not present\" % (ver, name))\r\n        return False\r\n    name = s3Dir + \"analyze.html\"\r\n    if name in files:\r\n        return True\r\n    name = s3Dir + \"release_build_log.txt\"\r\n    if name in files:\r\n        return True\r\n    print(\r\n        \"ver %d invalid because neither analyze.html nor release_build_log.txt not present in %s\" %\r\n        (ver, s3Dir))\r\n    return False\r\n\r\n\r\ndef s3_files_for_ver(ver):\r\n    files = get_s3_files()\r\n    res = []\r\n    s3_dir = \"sumatrapdf/buildbot/%d/\" % ver\r\n    for f in files:\r\n        if f.startswith(s3_dir):\r\n            res.append(f)\r\n    return res\r\n\r\n\r\ndef delete_ver(ver):\r\n    print(\"deleting ver %d\" % ver)\r\n    d = get_stats_cache_dir()\r\n    stats_file = os.path.join(d, \"%d.txt\" % ver)\r\n    if os.path.exists(stats_file):\r\n        print(\"  deleting %s\" % stats_file)\r\n        if not g_dry_run:\r\n            file_remove_try_hard(stats_file)\r\n    s3_files = s3_files_for_ver(ver)\r\n    for f in s3_files:\r\n        print(\"  deleting s3 %s\" % f)\r\n        if not g_dry_run:\r\n            s3.delete(f)\r\n\r\n# delete all stats.txt files cached locally and all files from s3 for\r\n# a given version and later\r\n\r\n\r\ndef fix_from_ver(ver, all_vers, all_vers_s3):\r\n    to_delete = {}\r\n    for v in all_vers:\r\n        if v >= ver:\r\n            to_delete[v] = True\r\n    for v in all_vers_s3:\r\n        if v >= ver:\r\n            to_delete[v] = True\r\n    to_delete = to_delete.keys()\r\n    if len(to_delete) > 10:  # safety check\r\n        to_delete.sort()\r\n        to_delete.reverse()\r\n        print(to_delete)\r\n        print(\"won't delete because too many version: %d\" % len(to_delete))\r\n        return\r\n\r\n    map(delete_ver, to_delete)\r\n\r\n    src_path = os.path.join(\"..\", \"sumatrapdf_buildbot\")\r\n    verify_path_exists(src_path)\r\n    os.chdir(src_path)\r\n\r\n    run_cmd_throw(\"svn\", \"update\", \"-r\", str(ver))\r\n    print(\"Finished fixing\")\r\n    sys.exit(1)\r\n\r\n\r\ndef fix():\r\n    verify_started_in_right_directory()\r\n    conf = load_config()\r\n    s3.set_secrets(conf.aws_access, conf.aws_secret)\r\n    s3.set_bucket(\"kjkpub\")\r\n\r\n    d = get_stats_cache_dir()\r\n    files = os.listdir(d)\r\n    all_vers = [stats_txt_name_to_svn_no(f) for f in files]\r\n    all_vers_s3 = get_s3_vers()\r\n\r\n    get_s3_files()\r\n    for ver in all_vers_s3:\r\n        if not valid_s3_ver(ver):\r\n            fix_from_ver(ver, all_vers, all_vers_s3)\r\n\r\n    prev_ver = all_vers[0]\r\n    to_check = all_vers[1:-1]\r\n    for ver in to_check:\r\n        if ver != prev_ver + 1:\r\n            missing_ver = prev_ver + 1\r\n            print(\"missing ver %d\" % missing_ver)\r\n            fix_from_ver(missing_ver, all_vers, all_vers_s3)\r\n            return\r\n        prev_ver = ver\r\n    print(\"All are ok!\")\r\n\r\nif __name__ == \"__main__\":\r\n    fix()\r\n"
  },
  {
    "path": "scripts/obsolete/buildbot-obsolete.py",
    "content": "\"\"\"\r\nBuilds sumatra and uploads results to s3 for easy analysis, viewable at:\r\nhttps://kjkpub.s3.amazonaws.com/sumatrapdf/buildbot/index.html\r\n\"\"\"\r\nimport sys\r\nimport os\r\n# assumes is being run as ./scripts/buildbot.py\r\nefi_scripts_dir = os.path.join(\"tools\", \"efi\")\r\nsys.path.append(efi_scripts_dir)\r\n\r\nimport shutil\r\nimport time\r\nimport datetime\r\nimport cPickle\r\nimport traceback\r\nimport s3\r\nimport util\r\nimport efiparse\r\nimport build\r\nfrom util import file_remove_try_hard, run_cmd_throw, pretty_print_secs\r\nfrom util import Serializable, create_dir\r\nfrom util import load_config, run_cmd, strip_empty_lines\r\nfrom util import verify_path_exists, verify_started_in_right_directory\r\nfrom buildbot_html import gen_analyze_html, build_index_html, rebuild_trans_src_path_cache\r\nfrom buildbot_html import build_sizes_json, g_first_analyze_build\r\nimport runtests\r\n\r\n\"\"\"\r\nTODO:\r\n - diff for symbols in html format\r\n - upload efi html diff as part of buildbot\r\n\r\n MAYBE:\r\n - aggressive optimization cause symbol churn which makes reading efi output\r\n   hard. One option would be to run efi on an executable compiled with less\r\n   aggressive optimization. Another would be to post-process the result\r\n   and use heuristic to suppress bogus changes\r\n\"\"\"\r\n\r\n\r\nclass Stats(Serializable):\r\n    fields = {\r\n        \"analyze_sumatra_warnings_count\": 0,\r\n        \"analyze_mupdf_warnings_count\": 0,\r\n        \"analyze_ext_warnings_count\": 0,\r\n        \"rel_sumatrapdf_exe_size\": 0,\r\n        \"rel_sumatrapdf_no_mupdf_exe_size\": 0,\r\n        \"rel_installer_exe_size\": 0,\r\n        \"rel_libmupdf_dll_size\": 0,\r\n        \"rel_nppdfviewer_dll_size\": 0,\r\n        \"rel_pdffilter_dll_size\": 0,\r\n        \"rel_pdfpreview_dll_size\": 0,\r\n        \"rel_failed\": False,\r\n        \"rel_build_log\": \"\",\r\n        \"analyze_out\": \"\",\r\n    }\r\n    fields_no_serialize = [\"rel_build_log\", \"analyze_out\"]\r\n\r\n    def __init__(self, read_from_file=None):\r\n        Serializable.__init__(self, Stats.fields,\r\n                              Stats.fields_no_serialize, read_from_file)\r\n\r\n\r\ndef file_size(p):\r\n    return os.path.getsize(p)\r\n\r\n\r\ndef str2bool(s):\r\n    if s.lower() in (\"true\", \"1\"):\r\n        return True\r\n    if s.lower() in (\"false\", \"0\"):\r\n        return False\r\n    assert(False)\r\n\r\n\r\nTIME_BETWEEN_PRE_RELEASE_BUILDS_IN_SECS = 60 * 60 * 8  # 8hrs\r\ng_time_of_last_build = None\r\ng_cache_dir = create_dir(\r\n    os.path.realpath(os.path.join(\"..\", \"sumatrapdfcache\", \"buildbot\")))\r\ng_stats_cache_dir = create_dir(os.path.join(g_cache_dir, \"stats\"))\r\ng_logs_cache_dir = create_dir(os.path.join(g_cache_dir, \"logs\"))\r\n\r\n\r\ndef get_cache_dir():\r\n    return g_cache_dir\r\n\r\n\r\ndef get_stats_cache_dir():\r\n    return g_stats_cache_dir\r\n\r\n\r\ndef get_logs_cache_dir():\r\n    return g_logs_cache_dir\r\n\r\n\r\n@util.memoize\r\ndef cert_path():\r\n    scripts_dir = os.path.realpath(os.path.dirname(__file__))\r\n    cert_path = os.path.join(scripts_dir, \"cert.pfx\")\r\n    return verify_path_exists(cert_path)\r\n\r\n\r\ndef logs_efi_out_path(ver):\r\n    return os.path.join(get_logs_cache_dir(), str(ver) + \"_efi.txt.bz2\")\r\n\r\n\r\n# logs are only kept for potential troubleshooting and they're quite big,\r\n# so we delete old files (we keep logs for the last $to_keep revisions)\r\ndef delete_old_logs(to_keep=10):\r\n    files = os.listdir(get_logs_cache_dir())\r\n    versions = []\r\n    for f in files:\r\n        ver = int(f.split(\"_\")[0])\r\n        if ver not in versions:\r\n            versions.append(ver)\r\n    versions.sort(reverse=True)\r\n    if len(versions) <= to_keep:\r\n        return\r\n    to_delete = versions[to_keep:]\r\n    for f in files:\r\n        ver = int(f.split(\"_\")[0])\r\n        if ver in to_delete:\r\n            p = os.path.join(get_logs_cache_dir(), f)\r\n            os.remove(p)\r\n\r\n\r\n# return Stats object or None if we don't have it for this version\r\ndef stats_for_ver(ver):\r\n    local_path = os.path.join(get_stats_cache_dir(), ver + \".txt\")\r\n    if not os.path.exists(local_path):\r\n        s3_path = \"sumatrapdf/buildbot/%s/stats.txt\" % ver\r\n        if not s3.exists(s3_path):\r\n            return None\r\n        s3.download_to_file(s3_path, local_path)\r\n        assert(os.path.exists(local_path))\r\n    return Stats(local_path)\r\n\r\n\r\ndef previous_successful_build_ver(ver):\r\n    ver = int(ver) - 1\r\n    while True:\r\n        stats = stats_for_ver(str(ver))\r\n        if None == stats:\r\n            return 0\r\n        if not stats.rel_failed:\r\n            return ver\r\n        ver -= 1\r\n\r\n\r\n# We cache results of running svn log in a dict mapping\r\n# version to string returned by svn log\r\ng_svn_log_per_ver = None\r\n\r\n\r\ndef load_svn_log_data():\r\n    try:\r\n        path = os.path.join(get_cache_dir(), \"snv_log.dat\")\r\n        fo = open(path, \"rb\")\r\n    except IOError:\r\n        # it's ok if doesn't exist\r\n        return {}\r\n    try:\r\n        res = cPickle.load(fo)\r\n        fo.close()\r\n        return res\r\n    except:\r\n        fo.close()\r\n        file_remove_try_hard(path)\r\n        return {}\r\n\r\n\r\ndef save_svn_log_data(data):\r\n    p = os.path.join(get_cache_dir(), \"snv_log.dat\")\r\n    fo = open(p, \"wb\")\r\n    cPickle.dump(data, fo, protocol=cPickle.HIGHEST_PROTOCOL)\r\n    fo.close()\r\n\r\n\r\ndef checkin_comment_for_ver(ver):\r\n    global g_svn_log_per_ver\r\n    raise BaseException(\"NYI for git\")\r\n    ver = str(ver)\r\n    if g_svn_log_per_ver is None:\r\n        g_svn_log_per_ver = load_svn_log_data()\r\n    if ver not in g_svn_log_per_ver:\r\n        # TODO: retry few times to make it robust against temporary network\r\n        # failures\r\n        (out, err) = run_cmd_throw(\"svn\", \"log\", \"-r%s\" % ver, \"-v\")\r\n        g_svn_log_per_ver[ver] = out\r\n        save_svn_log_data(g_svn_log_per_ver)\r\n    s = g_svn_log_per_ver[ver]\r\n    res = parse_svnlog_out(s)\r\n    if res is None:\r\n        return \"not a source code change\"\r\n    return res[1]\r\n\r\n\r\n# return true if we already have results for a given build number in s3\r\ndef has_already_been_built(ver):\r\n    s3_dir = \"sumatrapdf/buildbot/\"\r\n    n1 = s3_dir + ver + \"/analyze.html\"\r\n    n2 = s3_dir + ver + \"/release_build_log.txt\"\r\n    keys = s3.list(s3_dir)\r\n    for k in keys:\r\n        if k.name in [n1, n2]:\r\n            return True\r\n    return False\r\n\r\n\r\ndef verify_efi_present():\r\n    try:\r\n        (out, err, errcode) = util.run_cmd(\"efi.exe\")\r\n    except:\r\n        print(\"Must have efi.exe in the %PATH%!!!\")\r\n        sys.exit(1)\r\n    if \"Usage:\" not in out:\r\n        print(\"efi.exe created unexpected output:\\n%s\" % out)\r\n        sys.exit(1)\r\n\r\n\r\ndef file_size_in_obj(file_name, defSize=None):\r\n    p = os.path.join(\"obj-rel\", file_name)\r\n    if not os.path.exists(p) and defSize is not None:\r\n        return defSize\r\n    return file_size(p)\r\n\r\n\r\ndef clean_release():\r\n    shutil.rmtree(\"obj-rel\", ignore_errors=True)\r\n    shutil.rmtree(\"vs-premake\", ignore_errors=True)\r\n    shutil.rmtree(os.path.join(\"mupdf\", \"generated\"), ignore_errors=True)\r\n\r\n\r\ndef build_release(stats, ver):\r\n    config = \"CFG=rel\"\r\n    obj_dir = \"obj-rel\"\r\n    extcflags = \"EXTCFLAGS=-DSVN_PRE_RELEASE_VER=%s\" % ver\r\n    platform = \"PLATFORM=X86\"\r\n\r\n    clean_release()\r\n    (out, err, errcode) = run_cmd(\"nmake\", \"-f\", \"makefile.msvc\",\r\n                                  config, extcflags, platform,\r\n                                  \"all_sumatrapdf\")\r\n\r\n    log_path = os.path.join(get_logs_cache_dir(), ver + \"_rel_log.txt\")\r\n    build_log = out + \"\\n====STDERR:\\n\" + err\r\n    build_log = strip_empty_lines(build_log)\r\n    open(log_path, \"w\").write(build_log)\r\n\r\n    stats.rel_build_log = \"\"\r\n    stats.rel_failed = False\r\n    if errcode != 0:\r\n        stats.rel_build_log = build_log\r\n        stats.rel_failed = True\r\n        return\r\n\r\n    stats.rel_sumatrapdf_exe_size = file_size_in_obj(\"SumatraPDF.exe\")\r\n    stats.rel_sumatrapdf_no_mupdf_exe_size = file_size_in_obj(\r\n        \"SumatraPDF-no-MuPDF.exe\")\r\n    stats.rel_libmupdf_dll_size = file_size_in_obj(\"libmupdf.dll\")\r\n    stats.rel_nppdfviewer_dll_size = file_size_in_obj(\"npPdfViewer.dll\", 0)\r\n    stats.rel_pdffilter_dll_size = file_size_in_obj(\"PdfFilter.dll\")\r\n    stats.rel_pdfpreview_dll_size = file_size_in_obj(\"PdfPreview.dll\")\r\n    stats.rel_installer_exe_size = file_size_in_obj(\"Installer.exe\")\r\n\r\n\r\ndef build_analyze(stats, ver):\r\n    config = \"CFG=rel\"\r\n    obj_dir = \"obj-rel\"\r\n    extcflags = \"EXTCFLAGS=-DSVN_PRE_RELEASE_VER=%s\" % ver\r\n    platform = \"PLATFORM=X86\"\r\n\r\n    shutil.rmtree(obj_dir, ignore_errors=True)\r\n    shutil.rmtree(os.path.join(\"mupdf\", \"generated\"), ignore_errors=True)\r\n    (out, err, errcode) = run_cmd(\"nmake\", \"-f\", \"makefile.msvc\",\r\n                                  \"WITH_ANALYZE=yes\", config, extcflags, platform, \"all_sumatrapdf\")\r\n    stats.analyze_out = out\r\n\r\n    log_path = os.path.join(get_logs_cache_dir(), ver + \"_analyze_log.txt\")\r\n    s = out + \"\\n====STDERR:\\n\" + err\r\n    open(log_path, \"w\").write(strip_empty_lines(s))\r\n\r\n\r\ndef svn_update_to_ver(ver):\r\n    run_cmd_throw(\"svn\", \"update\", \"-r\" + ver)\r\n    rebuild_trans_src_path_cache()\r\n\r\n\r\n# runs efi.exe on obj-rel/SumatraPDF.exe, stores the data in obj-rel/efi.txt.bz2\r\n# and uploads to s3 as efi.txt.bz2\r\ndef build_and_upload_efi_out(ver):\r\n    obj_dir = \"obj-rel\"\r\n    s3dir = \"sumatrapdf/buildbot/%s/\" % ver\r\n    os.chdir(obj_dir)\r\n    util.run_cmd_throw(\"efi\", \"SumatraPDF.exe\", \">efi.txt\")\r\n    util.bz_file_compress(\"efi.txt\", \"efi.txt.bz2\")\r\n    s3.upload_file_public(\"efi.txt.bz2\", s3dir + \"efi.txt.bz2\", silent=True)\r\n    shutil.copyfile(\"efi.txt.bz2\", logs_efi_out_path(ver))\r\n    os.chdir(\"..\")\r\n\r\n\r\ndef get_efi_out(ver):\r\n    ver = str(ver)\r\n    p = logs_efi_out_path(ver)\r\n    if os.path.exists(p):\r\n        return p\r\n    # TODO: try download from s3 if doesn't exist? For now we rely on the fact\r\n    # that it was build on this machine, so the results should still be in logs\r\n    # cache\r\n    return None\r\n\r\n\r\ndef efi_diff_as_txt(diff, max=-1):\r\n    lines = []\r\n    diff.added.sort(key=lambda sym: sym.size, reverse=True)\r\n    diff.removed.sort(key=lambda sym: sym.size, reverse=True)\r\n    diff.changed.sort(key=lambda sym: sym.size_diff, reverse=True)\r\n\r\n    added = diff.added\r\n    if len(added) > 0:\r\n        lines.append(\"\\nAdded symbols:\")\r\n        if max != -1:\r\n            added = added[:max]\r\n        for sym in added:\r\n            #sym = diff.syms2.name_to_sym[sym_name]\r\n            size = sym.size\r\n            s = \"%4d : %s\" % (size, sym.full_name())\r\n            lines.append(s)\r\n\r\n    removed = diff.removed\r\n    if len(removed) > 0:\r\n        lines.append(\"\\nRemoved symbols:\")\r\n        if max != -1:\r\n            removed = removed[:max]\r\n        for sym in removed:\r\n            #sym = diff.syms2.name_to_sym[sym_name]\r\n            size = sym.size\r\n            s = \"%4d : %s\" % (size, sym.full_name())\r\n            lines.append(s)\r\n\r\n    changed = diff.changed\r\n    if len(changed) > 0:\r\n        lines.append(\"\\nChanged symbols:\")\r\n        if max != -1:\r\n            changed = changed[:max]\r\n        for sym in changed:\r\n            size = sym.size_diff\r\n            lines.append(\"%4d : %s\" % (size, sym.full_name()))\r\n    return \"\\n\".join(lines)\r\n\r\n\r\n# builds efi diff between this version and previous succesful version\r\n# and uploads as efi_diff.txt\r\ndef build_and_upload_efi_txt_diff(ver):\r\n    prev_ver = previous_successful_build_ver(ver)\r\n    if 0 == prev_ver:\r\n        return\r\n    efi_path_curr = get_efi_out(ver)\r\n    if not efi_path_curr:\r\n        print(\"didn't find efi output for %s\" % str(ver))\r\n        return\r\n    efi_path_prev = get_efi_out(prev_ver)\r\n    if not efi_path_prev:\r\n        print(\"didn't find efi output for %s\" % str(prev_ver))\r\n        return\r\n    obj_file_splitters = [\"obj-rel\\\\\", \"INTEL\\\\\"]\r\n    efi1 = efiparse.parse_file(efi_path_prev, obj_file_splitters)\r\n    efi2 = efiparse.parse_file(efi_path_curr, obj_file_splitters)\r\n    diff = efiparse.diff(efi1, efi2)\r\n    s = str(diff)\r\n    s = s + \"\\n\" + efi_diff_as_txt(diff)\r\n    s = \"\"\r\n    s3dir = \"sumatrapdf/buildbot/%s/\" % str(ver)\r\n    s3.upload_data_public_with_content_type(\r\n        s, s3dir + \"efi_diff.txt\", silent=True)\r\n\r\n\r\n# TODO: maybe add debug build and 64bit release?\r\n# skip_release is just for testing\r\ndef build_version(ver, skip_release=False):\r\n    print(\"Building version %s\" % ver)\r\n\r\n    clean_release()\r\n    # a hack: checkin_comment_for_ver() might call svn log, which doesn't like\r\n    # unversioning directories (like obj-rel or vs-premake), so we call it here,\r\n    # after clean, to cache the result\r\n    checkin_comment_for_ver(ver)\r\n\r\n    svn_update_to_ver(ver)\r\n    s3dir = \"sumatrapdf/buildbot/%s/\" % ver\r\n\r\n    stats = Stats()\r\n    # only run /analyze on newer builds since we didn't have the necessary\r\n    # makefile logic before\r\n    run_analyze = int(ver) >= g_first_analyze_build\r\n\r\n    if not skip_release:\r\n        start_time = datetime.datetime.now()\r\n        build_release(stats, ver)\r\n        dur = datetime.datetime.now() - start_time\r\n        print(\"%s for release build\" % str(dur))\r\n        if stats.rel_failed:\r\n            # don't bother running analyze if release failed\r\n            run_analyze = False\r\n            s3.upload_data_public_with_content_type(\r\n                stats.rel_build_log, s3dir + \"release_build_log.txt\", silent=True)\r\n\r\n    if not stats.rel_failed:\r\n        build_and_upload_efi_out(ver)\r\n\r\n    if run_analyze:\r\n        start_time = datetime.datetime.now()\r\n        build_analyze(stats, ver)\r\n        dur = datetime.datetime.now() - start_time\r\n        print(\"%s for analyze build\" % str(dur))\r\n        html = gen_analyze_html(stats, ver)\r\n        p = os.path.join(get_logs_cache_dir(), \"%s_analyze.html\" % str(ver))\r\n        open(p, \"w\").write(html)\r\n        s3.upload_data_public_with_content_type(\r\n            html, s3dir + \"analyze.html\", silent=True)\r\n\r\n    if not stats.rel_failed:\r\n        build_and_upload_efi_txt_diff(ver)\r\n\r\n    # TODO: it appears we might throw an exception after uploading analyze.html but\r\n    # before/dufing uploading stats.txt. Would have to implement transactional\r\n    # multi-upload to be robust aginst that, so will just let it be\r\n    stats_txt = stats.to_s()\r\n    s3.upload_data_public_with_content_type(\r\n        stats_txt, s3dir + \"stats.txt\", silent=True)\r\n    html = build_index_html(stats_for_ver, checkin_comment_for_ver)\r\n    s3.upload_data_public_with_content_type(\r\n        html, \"sumatrapdf/buildbot/index.html\", silent=True)\r\n    json_s = build_sizes_json(get_stats_cache_dir, stats_for_ver)\r\n    s3.upload_data_public_with_content_type(\r\n        json_s, \"sumatrapdf/buildbot/sizes.js\", silent=True)\r\n    if stats.rel_failed:\r\n        email_build_failed(ver)\r\n        return  # don't run tests if build fails\r\n\r\n    # TODO: can't run tests anymore because premake4 only generates\r\n    # vs 2010 solution, which can't be executed by vs 2013\r\n    #err = runtests.run_tests()\r\n    err = None\r\n    if err != None:\r\n        s3.upload_data_public_with_content_type(\r\n            err, s3dir + \"tests_error.txt\", silent=True)\r\n        email_tests_failed(ver, err)\r\n        print(\"Tests failed. Error message:\\n\" + err)\r\n    else:\r\n        print(\"Tests passed!\")\r\n\r\n\r\ndef test_build_html_index():\r\n    print(\"test_build_html_index()\")\r\n    html = build_index_html(stats_for_ver, checkin_comment_for_ver)\r\n    print(\"after build_index_html()\")\r\n    import codecs\r\n    codecs.open(\"index.html\", \"w\", \"utf8\").write(html)\r\n    print(\"after write\")\r\n    sys.exit(1)\r\n\r\n\r\ng_email_to = [\"kkowalczyk@gmail.com\", \"zeniko@gmail.com\"]\r\n\r\n\r\ndef email_tests_failed(ver, err):\r\n    s3_url_start = \"https://kjkpub.s3.amazonaws.com/sumatrapdf/buildbot/\"\r\n    c = load_config()\r\n    if not c.HasNotifierEmail():\r\n        print(\"email_tests_failed() not ran because not c.HasNotifierEmail()\")\r\n        return\r\n    sender, senderpwd = c.GetNotifierEmailAndPwdMustExist()\r\n    subject = \"SumatraPDF tests failed for build %s\" % str(ver)\r\n    checkin_url = \"https://code.google.com/p/sumatrapdf/source/detail?r=%s\" % str(ver)\r\n    body = \"Checkin: %s\\n\\n\" % checkin_url\r\n    log_url = s3_url_start + str(ver) + \"/tests_error.txt\"\r\n    body += \"Build log: %s\\n\\n\" % log_url\r\n    buildbot_index_url = s3_url_start + \"index.html\"\r\n    body += \"Buildbot: %s\\n\\n\" % buildbot_index_url\r\n    body += \"Error: %s\\n\\n\" % err\r\n    util.sendmail(sender, senderpwd, g_email_to, subject, body)\r\n\r\n\r\ndef email_msg(msg):\r\n    c = load_config()\r\n    if not c.HasNotifierEmail():\r\n        print(\"email_build_failed() not ran because not c.HasNotifierEmail()\")\r\n        return\r\n    sender, senderpwd = c.GetNotifierEmailAndPwdMustExist()\r\n    subject = \"SumatraPDF buildbot failed\"\r\n    util.sendmail(sender, senderpwd, [\"kkowalczyk@gmail.com\"], subject, msg)\r\n\r\n\r\ndef email_build_failed(ver):\r\n    s3_url_start = \"https://kjkpub.s3.amazonaws.com/sumatrapdf/buildbot/\"\r\n    c = load_config()\r\n    if not c.HasNotifierEmail():\r\n        print(\"email_build_failed() not ran because not c.HasNotifierEmail()\")\r\n        return\r\n    sender, senderpwd = c.GetNotifierEmailAndPwdMustExist()\r\n    subject = \"SumatraPDF build %s failed\" % str(ver)\r\n    checkin_url = \"https://code.google.com/p/sumatrapdf/source/detail?r=%s\" % str(ver)\r\n    body = \"Checkin: %s\\n\\n\" % checkin_url\r\n    build_log_url = s3_url_start + str(ver) + \"/release_build_log.txt\"\r\n    body += \"Build log: %s\\n\\n\" % build_log_url\r\n    buildbot_index_url = s3_url_start + \"index.html\"\r\n    body += \"Buildbot: %s\\n\\n\" % buildbot_index_url\r\n    util.sendmail(sender, senderpwd, g_email_to, subject, body)\r\n\r\n\r\n# for testing\r\ndef build_curr(force=False):\r\n    raise BaseException(\"NYI for git\")\r\n    (local_ver, latest_ver) = util.get_svn_versions()\r\n    print(\"local ver: %s, latest ver: %s\" % (local_ver, latest_ver))\r\n    if not has_already_been_built(local_ver) or force:\r\n        build_version(local_ver)\r\n    else:\r\n        print(\"We have already built revision %s\" % local_ver)\r\n\r\n\r\ndef build_version_retry(ver, try_count=2):\r\n    # it can happen we get a valid but intermitten exception e.g.\r\n    # due to svn command failing due to server hiccup\r\n    # in that case we'll retry, waiting 1 min in between,\r\n    # but only up to try_count times\r\n    while True:\r\n        try:\r\n            build_version(ver)\r\n        except Exception, e:\r\n            # rethrow assert() exceptions, they come from our code\r\n            # and we should stop\r\n            if isinstance(e, AssertionError):\r\n                print(\"assert happened:\")\r\n                print(str(e))\r\n                traceback.print_exc()\r\n                raise e\r\n            print(str(e))\r\n            traceback.print_exc()\r\n            try_count -= 1\r\n            if 0 == try_count:\r\n                raise\r\n            time.sleep(60)\r\n        return\r\n\r\n\r\ndef buildbot_loop():\r\n    global g_time_of_last_build\r\n    while True:\r\n        # util.get_svn_versions() might throw an exception due to\r\n        # temporary network problems, so retry\r\n        try:\r\n            (local_ver, latest_ver) = util.get_svn_versions()\r\n        except:\r\n            print(\"get_svn_versions() threw an exception\")\r\n            time.sleep(120)\r\n            continue\r\n\r\n        print(\"local ver: %s, latest ver: %s\" % (local_ver, latest_ver))\r\n        revs_built = 0\r\n        while int(local_ver) <= int(latest_ver):\r\n            if not has_already_been_built(local_ver):\r\n                build_version_retry(local_ver)\r\n                revs_built += 1\r\n            else:\r\n                print(\"We have already built revision %s\" % local_ver)\r\n            local_ver = str(int(local_ver) + 1)\r\n        delete_old_logs()\r\n        # don't sleep if we built something in this cycle. a new checkin might\r\n        # have happened while we were working\r\n        if revs_built > 0:\r\n            g_time_of_last_build = datetime.datetime.now()\r\n            continue\r\n\r\n        secs_until_prerelease = None\r\n        if g_time_of_last_build is not None:\r\n            td = datetime.datetime.now() - g_time_of_last_build\r\n            secs_until_prerelease = TIME_BETWEEN_PRE_RELEASE_BUILDS_IN_SECS - \\\r\n                int(td.total_seconds())\r\n            if secs_until_prerelease < 0:\r\n                build_pre_release()\r\n                g_time_of_last_build = None\r\n\r\n        if secs_until_prerelease is None:\r\n            print(\"Sleeping for 15 minutes to wait for new checkin\")\r\n        else:\r\n            print(\"Sleeping for 15 minutes, %s until pre-release\" %\r\n                  pretty_print_secs(secs_until_prerelease))\r\n        time.sleep(60 * 15)  # 15 mins\r\n\r\n\r\ndef ignore_pre_release_build_error(s):\r\n    # it's possible we did a pre-release build outside of buildbot and that\r\n    # shouldn't be a fatal error\r\n    if \"already exists in s3\" in s:\r\n        return True\r\n    return False\r\n\r\n\r\ndef build_pre_release():\r\n    try:\r\n        cert_dst_path = os.path.join(\"scripts\", \"cert.pfx\")\r\n        if not os.path.exists(cert_dst_path):\r\n            shutil.copyfile(cert_path(), cert_dst_path)\r\n        print(\"Building pre-release\")\r\n        build.build_pre_release()\r\n    except BaseException, e:\r\n        s = str(e)\r\n        print(s)\r\n        # a bit of a hack. not every kind of failure should stop the buildbot\r\n        if not ignore_pre_release_build_error(s):\r\n            traceback.print_exc()\r\n            raise\r\n\r\n\r\ndef test_email_tests_failed():\r\n    email_tests_failed(\"200\", \"hello\")\r\n    sys.exit(1)\r\n\r\n\r\ndef verify_can_send_email():\r\n    c = load_config()\r\n    if not c.HasNotifierEmail():\r\n        print(\"can't run. scripts/config.py missing notifier_email and/or notifier_email_pwd\")\r\n        sys.exit(1)\r\n\r\n\r\ndef main():\r\n    verify_can_send_email()\r\n    cert_path()  # early check and ensures value is memoized\r\n    verify_efi_present()\r\n    verify_started_in_right_directory()\r\n    # to avoid problems, we build a separate source tree, just for the buildbot\r\n    src_path = os.path.join(\"..\", \"sumatrapdf_buildbot\")\r\n    verify_path_exists(src_path)\r\n    conf = load_config()\r\n    s3.set_secrets(conf.aws_access, conf.aws_secret)\r\n    s3.set_bucket(\"kjkpub\")\r\n    os.chdir(src_path)\r\n\r\n    # test_email_tests_failed()\r\n    #build_version(\"8190\", skip_release=True)\r\n    # test_build_html_index()\r\n    # build_sizes_json()\r\n    # build_curr(force=True)\r\n\r\n    # TODO: add a try/catch and e-mail if failed for unexpected reasons\r\n    buildbot_loop()\r\n\r\nif __name__ == \"__main__\":\r\n    try:\r\n        main()\r\n    except Exception, e:\r\n        msg = \"buildbot failed\\nException: \" + str(e) + \"\\n\"\r\n        email_msg(msg)\r\n"
  },
  {
    "path": "scripts/obsolete/buildbot.bat",
    "content": "@ECHO OFF\r\n\r\nCALL scripts\\vc.bat\r\nIF NOT ERRORLEVEL 1 GOTO VSFOUND\r\nECHO Visual Studio 2013 doesn't seem to be installed\r\nEXIT /B 1\r\n\r\n:VSFOUND\r\n\r\nREM add our nasm.exe and StripReloc.exe to the path\r\nSET PATH=%CD%\\bin;c:\\Python27;%PATH%\r\n\r\nrem work-around cygwin/msdev issue\r\nset tmp=\r\nset temp=\r\n\r\npython -u -B scripts/buildbot.py\r\n"
  },
  {
    "path": "scripts/obsolete/buildbot.py",
    "content": "import sys\r\nimport os\r\nimport shutil\r\nimport time\r\nimport datetime\r\nimport cPickle\r\nimport traceback\r\nimport s3\r\nimport util\r\nimport build\r\nimport subprocess\r\nfrom util import file_remove_try_hard, pretty_print_secs\r\nfrom util import Serializable, create_dir\r\nfrom util import load_config, strip_empty_lines\r\nfrom util import verify_path_exists, verify_started_in_right_directory\r\nimport runtests\r\n\r\nTIME_BETWEEN_PRE_RELEASE_BUILDS_IN_SECS = 60 * 60 * 8  # 8hrs\r\n\r\n@util.memoize\r\ndef cert_path():\r\n    scripts_dir = os.path.realpath(os.path.dirname(__file__))\r\n    cert_path = os.path.join(scripts_dir, \"cert.pfx\")\r\n    return verify_path_exists(cert_path)\r\n\r\ndef email_msg(msg):\r\n    c = load_config()\r\n    if not c.HasNotifierEmail():\r\n        print(\"email_build_failed() not ran because not c.HasNotifierEmail()\")\r\n        return\r\n    sender, senderpwd = c.GetNotifierEmailAndPwdMustExist()\r\n    subject = \"SumatraPDF buildbot failed\"\r\n    util.sendmail(sender, senderpwd, [\"kkowalczyk@gmail.com\"], subject, msg)\r\n\r\ndef verify_can_send_email():\r\n    c = load_config()\r\n    if not c.HasNotifierEmail():\r\n        print(\"can't run. scripts/config.py missing notifier_email and/or notifier_email_pwd\")\r\n        sys.exit(1)\r\n\r\ndef is_git_up_to_date():\r\n    out = subprocess.check_output([\"git\", \"pull\"])\r\n    return \"Already up-to-date\" in out\r\n\r\ndef ignore_pre_release_build_error(s):\r\n    # it's possible we did a pre-release build outside of buildbot and that\r\n    # shouldn't be a fatal error\r\n    if \"already exists in s3\" in s:\r\n        return True\r\n    return False\r\n\r\ndef build_pre_release():\r\n    try:\r\n        cert_dst_path = os.path.join(\"scripts\", \"cert.pfx\")\r\n        if not os.path.exists(cert_dst_path):\r\n            shutil.copyfile(cert_path(), cert_dst_path)\r\n        print(\"Building pre-release\")\r\n        build.build_pre_release()\r\n    except BaseException, e:\r\n        s = str(e)\r\n        print(s)\r\n        # a bit of a hack. not every kind of failure should stop the buildbot\r\n        if not ignore_pre_release_build_error(s):\r\n            traceback.print_exc()\r\n            raise\r\n\r\ndef buildbot_loop():\r\n    time_of_last_change = None\r\n    while True:\r\n        if not is_git_up_to_date():\r\n            # there was a new checking, it resets the wait time\r\n            time_of_last_change = datetime.datetime.now()\r\n            print(\"New checkins detected, sleeping for 15 minutes, %s until pre-release\" %\r\n                  pretty_print_secs(TIME_BETWEEN_PRE_RELEASE_BUILDS_IN_SECS))\r\n            time.sleep(60 * 15)  # 15 mins\r\n            continue\r\n\r\n        if time_of_last_change == None:\r\n            # no changes since last pre-relase, sleep until there is a checkin\r\n            print(\"No checkins since last pre-release, sleeping for 15 minutes\")\r\n            time.sleep(60 * 15)  # 15 mins\r\n            continue\r\n\r\n        td = datetime.datetime.now() - time_of_last_change\r\n        secs_until_prerelease = TIME_BETWEEN_PRE_RELEASE_BUILDS_IN_SECS - \\\r\n            int(td.total_seconds())\r\n        if secs_until_prerelease > 0:\r\n            print(\"Sleeping for 15 minutes, %s until pre-release\" %\r\n                  pretty_print_secs(secs_until_prerelease))\r\n            time.sleep(60 * 15)  # 15 mins\r\n            continue\r\n\r\n        build_pre_release()\r\n        time_of_last_change = None\r\n\r\ndef main():\r\n    verify_can_send_email()\r\n    cert_path()  # early check and ensures value is memoized\r\n    verify_started_in_right_directory()\r\n    # to avoid problems, we build a separate source tree, just for the buildbot\r\n    src_path = os.path.join(\"..\", \"sumatrapdf_buildbot\")\r\n    verify_path_exists(src_path)\r\n    conf = load_config()\r\n    s3.set_secrets(conf.aws_access, conf.aws_secret)\r\n    s3.set_bucket(\"kjkpub\")\r\n    os.chdir(src_path)\r\n\r\n    # test_email_tests_failed()\r\n    #build_version(\"8190\", skip_release=True)\r\n    # test_build_html_index()\r\n    # build_sizes_json()\r\n    # build_curr(force=True)\r\n\r\n    buildbot_loop()\r\n\r\nif __name__ == \"__main__\":\r\n    try:\r\n        main()\r\n    except BaseException, e:\r\n        msg = \"buildbot failed\\nException: \" + str(e) + \"\\n\" + traceback.format_exc() + \"\\n\"\r\n        print(msg)\r\n        email_msg(msg)\r\n\r\n"
  },
  {
    "path": "scripts/obsolete/buildbot_html.py",
    "content": "import os\r\nimport string\r\nimport json\r\nimport cgi\r\nimport util\r\nimport s3\r\nfrom util import formatInt\r\n\r\ng_first_analyze_build = 6000\r\n\r\ng_index_html_css = \"\"\"\r\n<style type=\"text/css\">\r\n#table-5 {\r\n    background-color: #f5f5f5;\r\n    padding: 5px;\r\n    border-radius: 5px;\r\n    -moz-border-radius: 5px;\r\n    -webkit-border-radius: 5px;\r\n    border: 1px solid #ebebeb;\r\n}\r\n#table-5 td, #table-5 th {\r\n    padding: 1px 5px;\r\n}\r\n#table-5 thead {\r\n    font: normal 15px Helvetica Neue,Helvetica,sans-serif;\r\n    text-shadow: 0 1px 0 white;\r\n    color: #999;\r\n}\r\n#table-5 th {\r\n    text-align: left;\r\n    border-bottom: 1px solid #fff;\r\n}\r\n#table-5 td {\r\n    font-size: 14px;\r\n}\r\n#table-5 td:hover {\r\n    background-color: #fff;\r\n}\r\n</style>\"\"\"\r\n\r\n\r\ndef a(url, txt):\r\n    return '<a href=\"' + url + '\">' + txt + '</a>'\r\n\r\n\r\ndef pre(s):\r\n    return '<pre style=\"white-space: pre-wrap;\">' + s + '</pre>'\r\n\r\n\r\ndef td(s, off=0):\r\n    return \" \" * off + '<td>%s</td>' % s\r\n\r\n\r\ndef th(s):\r\n    return '<th style=\"font-size:80%%\">%s</th>' % s\r\n\r\n\r\ndef size_diff_html(n):\r\n    if n > 0:\r\n        return ' (<font color=red>+' + str(n) + '</font>)'\r\n    elif n < 0:\r\n        return ' (<font color=green>' + str(n) + '</font>)'\r\n    else:\r\n        return ''\r\n\r\n# given a list of files from s3 in the form ${ver}/${name}, group them\r\n# into a list of lists, [[${ver}, [${name1}, ${name2}]], ${ver2}, [${name1}]] etc.\r\n# we rely that the files are already sorted by ${ver}\r\n\r\n\r\ndef group_by_ver(files):\r\n    res = []\r\n    curr_ver = None\r\n    curr_ver_names = []\r\n    for f in files:\r\n        (ver, name) = f.split(\"/\", 1)\r\n        if ver == curr_ver:\r\n            curr_ver_names.append(name)\r\n        else:\r\n            if curr_ver != None:\r\n                assert(len(curr_ver_names) > 0)\r\n                res.append([curr_ver, curr_ver_names])\r\n            curr_ver = ver\r\n            curr_ver_names = [name]\r\n    if curr_ver != None:\r\n        assert(len(curr_ver_names) > 0)\r\n        res.append([curr_ver, curr_ver_names])\r\n    return res\r\n\r\n# TODO: would be nicer if \"sumatrapdf_buildbot\" wasn't hard-coded, but don't know\r\n# how to get this reliably\r\ng_buildbot_src_path = \"sumatrapdf_buildbot\\\\\"\r\n\r\n# Turn:\r\n# c:\\users\\kkowalczyk\\src\\sumatrapdf\\src\\utils\\allocator.h(156) : warning C6011: Dereferencing NULL pointer 'node'. : Lines: 149, 150, 151, 153, 154, 156\r\n# Into:\r\n# <a href=\"https://code.google.com/p/sumatrapdf/source/browse/trunk/src/utils/allocator.h#156\">src\\utils\\allocator.h(156)</a>:<br>\r\n# warning C6011: Dereferencing NULL pointer 'node'. : Lines: 149, 150,\r\n# 151, 153, 154, 156\r\n\r\n\r\ndef htmlize_error_lines(lines, ver):\r\n    if len(lines) == 0:\r\n        return ([], [], [])\r\n    sumatra_errors = []\r\n    mupdf_errors = []\r\n    ext_errors = []\r\n    for l in lines:\r\n        if g_buildbot_src_path not in l:\r\n            ext_errors.append(l)  # system includes\r\n            continue\r\n        rel_path_start = l.find(g_buildbot_src_path) + len(g_buildbot_src_path)\r\n        l = l[rel_path_start:]\r\n        err_start = l.find(\" : \")\r\n        src = l[:err_start]\r\n        msg = l[err_start + 3:]\r\n        a = htmlize_src_link(src, ver)\r\n        s = a + \" \" + msg\r\n        if l.startswith(\"src\\\\\"):\r\n            sumatra_errors.append(s)\r\n        elif l.startswith(\"mupdf\\\\\"):\r\n            mupdf_errors.append(s)\r\n        elif l.startswith(\"ext\\\\\"):\r\n            ext_errors.append(s)\r\n        else:\r\n            ext_errors.append(s)\r\n    return (sumatra_errors, mupdf_errors, ext_errors)\r\n\r\n\r\ndef stats_for_previous_successful_build(ver, stats_for_ver):\r\n    ver = int(ver) - 1\r\n    while True:\r\n        stats = stats_for_ver(str(ver))\r\n        if None == stats:\r\n            return None\r\n        if not stats.rel_failed:\r\n            return stats\r\n        ver -= 1\r\n\r\n# build sumatrapdf/buildbot/index.html summary page that links to each\r\n# sumatrapdf/buildbot/${ver}/analyze.html\r\n\r\n\r\ndef build_index_html(stats_for_ver, checkin_comment_for_ver):\r\n    s3_dir = \"sumatrapdf/buildbot/\"\r\n    html = '<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>%s</head><body>\\n' % g_index_html_css\r\n    html += \"<p>SumatraPDF buildbot results:</p>\\n\"\r\n    names = [n.name for n in s3.list(s3_dir)]\r\n    # filter out top-level files like index.html and sizes.js\r\n    names = [n[len(s3_dir):] for n in names if len(n.split(\"/\")) == 4]\r\n    names.sort(reverse=True, key=lambda name: int(name.split(\"/\")[0]))\r\n\r\n    html += '<table id=\"table-5\"><tr>' + th(\"svn\") + th(\"/analyze\")\r\n    html += th(\"build\") + th(\"tests\") + th(\"SumatraPDF.exe\")\r\n    html += th(\"Installer.exe\") + th(\"efi\") + th(\"checkin comment\") + '</tr>\\n'\r\n    files_by_ver = group_by_ver(names)\r\n    for arr in files_by_ver[:512]:\r\n        (ver, files) = arr\r\n        if \"stats.txt\" not in files:\r\n            print(\"stats.txt missing in %s (%s)\" % (ver, str(files)))\r\n            assert(\"stats.txt\" in files)\r\n        try:\r\n            stats = stats_for_ver(ver)\r\n        except:\r\n            print(\"names: %s\" % str(names))\r\n            print(\"ver:   %s\" % str(ver))\r\n            print(\"files: %s\" % str(files))\r\n            raise\r\n        total_warnings = stats.analyze_sumatra_warnings_count + \\\r\n            stats.analyze_mupdf_warnings_count + \\\r\n            stats.analyze_ext_warnings_count\r\n        if int(ver) >= g_first_analyze_build and total_warnings > 0 and not stats.rel_failed:\r\n            assert(\"analyze.html\" in files)\r\n\r\n        s3_ver_url = \"https://kjkpub.s3.amazonaws.com/\" + s3_dir + ver + \"/\"\r\n        html += \"  <tr>\\n\"\r\n\r\n        # build number\r\n        src_url = \"https://code.google.com/p/sumatrapdf/source/detail?r=\" + ver\r\n        html += td(a(src_url, ver), 4) + \"\\n\"\r\n\r\n        # /analyze warnings count\r\n        if int(ver) >= g_first_analyze_build and total_warnings > 0:\r\n            url = s3_ver_url + \"analyze.html\"\r\n            s = \"%d %d %d\" % (stats.analyze_sumatra_warnings_count,\r\n                              stats.analyze_mupdf_warnings_count, stats.analyze_ext_warnings_count)\r\n            html += td(a(url, s), 4)\r\n        else:\r\n            html += td(\"\", 4)\r\n\r\n        # release build status\r\n        if stats.rel_failed:\r\n            url = s3_ver_url + \"release_build_log.txt\"\r\n            s = '<b>' + a(url, \"fail\") + '</b>'\r\n        else:\r\n            s = '<font color=\"green\"<b>ok!</b></font>'\r\n        html += td(s, 4) + \"\\n\"\r\n\r\n        # tests status\r\n        if \"tests_error.txt\" in files:\r\n            url = s3_ver_url + \"tests_error.txt\"\r\n            s = '<b>' + a(url, \"fail\") + '</b>'\r\n        else:\r\n            s = '<font color=\"green\"<b>ok!</b></font>'\r\n        html += td(s, 4) + \"\\n\"\r\n\r\n        # SumatraPDF.exe, Installer.exe size\r\n        if stats.rel_failed:\r\n            html += td(\"\", 4) + \"\\n\" + td(\"\", 4) + \"\\n\"\r\n        else:\r\n            prev_stats = stats_for_previous_successful_build(\r\n                ver, stats_for_ver)\r\n            if None == prev_stats:\r\n                num_s = formatInt(stats.rel_sumatrapdf_exe_size)\r\n                html += td(num_s, 4) + \"\\n\"\r\n                num_s = formatInt(stats.rel_installer_exe_size)\r\n                html += td(num_s, 4) + \"\\n\"\r\n            else:\r\n                s = size_diff_html(\r\n                    stats.rel_sumatrapdf_exe_size - prev_stats.rel_sumatrapdf_exe_size)\r\n                num_s = formatInt(stats.rel_sumatrapdf_exe_size)\r\n                s = num_s + s\r\n                html += td(s, 4) + \"\\n\"\r\n                s = size_diff_html(\r\n                    stats.rel_installer_exe_size - prev_stats.rel_installer_exe_size)\r\n                num_s = formatInt(stats.rel_installer_exe_size)\r\n                s = num_s + s\r\n                html += td(s, 4) + \"\\n\"\r\n\r\n        # efi diff\r\n        if \"efi_diff.txt\" in files:\r\n            url = s3_ver_url + \"efi_diff.txt\"\r\n            html += td(a(url, \"diff\"), 4)\r\n        else:\r\n            html += td(\"\")\r\n\r\n        # checkin comment\r\n        (comment, trimmed) = util.trim_str(checkin_comment_for_ver(ver))\r\n        comment = comment.decode('utf-8')\r\n        comment = cgi.escape(comment)\r\n        if trimmed:\r\n            comment += a(src_url, \"...\")\r\n        html += td(comment, 4) + \"\\n\"\r\n        html += \"  </tr>\\n\"\r\n    html += \"</table>\"\r\n    html += \"</body></html>\\n\"\r\n    return html\r\n\r\ng_src_trans_map = None\r\n\r\n\r\ndef rebuild_trans_src_path_cache():\r\n    global g_src_trans_map\r\n    g_src_trans_map = {}\r\n    for root, dirs, files in os.walk(\"src\"):\r\n        for file in files:\r\n            file_path = os.path.join(root, file)\r\n            g_src_trans_map[file_path.lower()] = file_path\r\n    for root, dirs, files in os.walk(\"ext\"):\r\n        for file in files:\r\n            file_path = os.path.join(root, file)\r\n            g_src_trans_map[file_path.lower()] = file_path\r\n    for root, dirs, files in os.walk(\"mupdf\"):\r\n        for file in files:\r\n            file_path = os.path.join(root, file)\r\n            g_src_trans_map[file_path.lower()] = file_path\r\n\r\n# for some reason file names are lower-cased and the url has exact case\r\n# we need to convert src_path to have the exact case for urls to work\r\n# i.e. given \"src\\doc.h\" we need to return \"src\\Doc.h\"\r\n\r\n\r\ndef trans_src_path(s):\r\n    if s not in g_src_trans_map:\r\n        #print(\"%s not in g_src_trans_map\" % s)\r\n        # print(g_src_trans_map.keys())\r\n        # can happen for system includes e.g. objbase.h\r\n        return s\r\n    return g_src_trans_map[s]\r\n\r\n# Turn:\r\n# src\\utils\\allocator.h(156)\r\n# Into:\r\n# <a href=\"https://code.google.com/p/sumatrapdf/source/browse/trunk/src/utils/allocator.h#156\">src\\utils\\allocator.h(156)</a>\r\n\r\n\r\ndef htmlize_src_link(s, ver):\r\n    try:\r\n        parts = s.split(\"(\")\r\n        src_path = parts[0]  # src\\utils\\allocator.h\r\n        src_path = trans_src_path(src_path)  # src\\utils\\Allocator.h\r\n        src_path_in_url = src_path.replace(\"\\\\\", \"/\")\r\n        src_line = parts[1][:-1]  # \"156)\"\" => \"156\"\r\n        base = \"https://code.google.com/p/sumatrapdf/source/browse/trunk/\"\r\n        # url = base + src_path_in_url + \"#\" + src_line\r\n        url = base + src_path_in_url + \"?r=%s#%s\" % (str(ver), str(src_line))\r\n    except:\r\n        print(\"htmlize_src_link: s: '%s', ver: '%s'\" % (str(s), str(ver)))\r\n        return s\r\n    return a(url, src_path + \"(\" + src_line + \")\")\r\n\r\n\r\ndef skip_error(s):\r\n    # C2220 - warning treated as error\r\n    # LNK2019 - linker error unresolved external symbol\r\n    for err in (\"C2220\", \"LNK2019\"):\r\n        if err in s:\r\n            return True\r\n    return False\r\n\r\n# given a text generated with /analyze, extract the lines that contain\r\n# error information\r\n\r\n\r\ndef extract_analyze_errors(s):\r\n    errors = []\r\n    for l in s.split('\\n'):\r\n        if \": error \" in l or \": warning \" in l:\r\n            if not skip_error(l) and l not in errors:\r\n                errors.append(l)\r\n    return errors\r\n\r\n\r\ndef gen_analyze_html(stats, ver):\r\n    (sumatra_errors, mupdf_errors, ext_errors) = htmlize_error_lines(\r\n        extract_analyze_errors(stats.analyze_out), ver)\r\n    stats.analyze_sumatra_warnings_count = len(sumatra_errors)\r\n    stats.analyze_mupdf_warnings_count = len(mupdf_errors)\r\n    stats.analyze_ext_warnings_count = len(ext_errors)\r\n    s = \"<html><body>\"\r\n    s += a(\"../index.html\", \"Home\")\r\n    s += \": build %s, %d warnings in sumatra code, %d in mupdf, %d in ext:\" % (\r\n        str(ver), stats.analyze_sumatra_warnings_count, stats.analyze_mupdf_warnings_count, stats.analyze_ext_warnings_count)\r\n    s += pre(string.join(sumatra_errors, \"\"))\r\n    s += \"<p>Warnings in mupdf code:</p>\"\r\n    s += pre(string.join(mupdf_errors, \"\"))\r\n    s += \"<p>Warnings in ext code:</p>\"\r\n    s += pre(string.join(ext_errors, \"\"))\r\n    s += \"</pre>\"\r\n    s += \"</body></html>\"\r\n    return s\r\n\r\n\r\ndef build_sizes_json(stats_cache_dir, stats_for_ver):\r\n    files = os.listdir(stats_cache_dir())\r\n    versions = [int(f.split(\".\")[0]) for f in files]\r\n    versions.sort()\r\n    # print(versions)\r\n    sumatra_sizes = []\r\n    installer_sizes = []\r\n    prev_sumatra_size = 0\r\n    prev_installer_size = 0\r\n    for ver in versions:\r\n        stats = stats_for_ver(str(ver))\r\n        sumatra_size = stats.rel_sumatrapdf_exe_size\r\n        installer_size = stats.rel_installer_exe_size\r\n        if sumatra_size == prev_sumatra_size and installer_size == prev_installer_size:\r\n            continue\r\n        sumatra_sizes.append(sumatra_size)\r\n        installer_sizes.append(installer_size)\r\n        prev_sumatra_size = sumatra_size\r\n        prev_installer_size = installer_size\r\n    sumatra_json = json.dumps(sumatra_sizes)\r\n    installer_json = json.dumps(installer_sizes)\r\n    s = \"var g_sumatra_sizes = %s;\\nvar g_installer_sizes = %s;\\n\" % (\r\n        sumatra_json, installer_json)\r\n    return s\r\n"
  },
  {
    "path": "scripts/obsolete/runtests.bat",
    "content": "@ECHO OFF\r\nSETLOCAL\r\n\r\nREM assume Python is installed in Python27 if it isn't in the path already\r\nFOR %%p IN (python.exe) DO IF \"%%~$PATH:p\" == \"\" SET PATH=C:\\Python27;%PATH%\r\n\r\nREM assumes we're being run from top-level directory as:\r\nREM scripts\\runtests.bat\r\nIF NOT EXIST scripts\\vc.bat CD %~dp0.. && SET NO_CONSOLE=1\r\n\r\nCALL scripts\\vc.bat\r\nIF ERRORLEVEL 1 EXIT /B 1\r\n\r\nrem work-around cygwin/msdev issue\r\nset tmp=\r\nset temp=\r\n\r\npython -u -B scripts\\runtests.py %1 %2 %3 %4 %5\r\n\r\nREM allow running runtests.bat from Explorer\r\nIF \"%NO_CONSOLE%\" == \"1\" PAUSE\r\n"
  },
  {
    "path": "scripts/obsolete/runtests.py",
    "content": "\"\"\"\r\nBuilds test executable(s), runs them and checks for failures.\r\n\r\nThe conventions are:\r\n - premake4.lua defines all_tests.sln which contains one or more\r\n   test projects\r\n - we build Release version of all projects\r\n - they end up as obj-rel/test_*.exe executables\r\n - we run all those test executables\r\n - a test executable returns 0 if all tests passed or > 0 if\r\n   one or more tests failed. Additionally, stderr might contain\r\n   an error message pin-pointing the problem. stderr is used by\r\n   buildbot. stdout can be used for interactive use\r\n\"\"\"\r\nimport os\r\nimport util\r\n\r\n\r\ndef run_premake(action=\"vs2010\"):\r\n    try:\r\n        (out, err, errcode) = util.run_cmd(\"premake4\", action)\r\n        if errcode != 0:\r\n            return out + err\r\n    except:\r\n        return \"premake4.exe not in %PATH%\"\r\n    return None\r\n\r\n\r\ndef is_test_exe(file_name):\r\n    return file_name.startswith(\"test_\") and file_name.endswith(\".exe\")\r\n\r\n\r\ndef is_empty_str(s):\r\n    return s == None or len(s) == 0\r\n\r\n\r\ndef fmt_out_err(out, err):\r\n    if is_empty_str(out) and is_empty_str(err):\r\n        return \"\"\r\n    if is_empty_str(out):\r\n        return err\r\n    if is_empty_str(err):\r\n        return out\r\n    return out + \"\\n\" + err\r\n\r\n# returns None if all tests succeeded or an error string if one\r\n# or more tests failed\r\n# assumes current directory is top-level sumatra dir\r\n\r\n\r\ndef run_tests2():\r\n    if not os.path.exists(\"premake4.lua\"):\r\n        return \"premake4.lua doesn't exist in current directory (%s)\" % os.getcwd()\r\n    err = run_premake()\r\n    if err != None:\r\n        return err\r\n    p = os.path.join(\"vs-premake\", \"all_tests.sln\")\r\n    if not os.path.exists(p):\r\n        return \"%s doesn't exist\" % p\r\n    os.chdir(\"vs-premake\")\r\n    try:\r\n        util.kill_msbuild()\r\n    except:\r\n        return \"util.kill_msbuild() failed\"\r\n    try:\r\n        (out, err, errcode) = util.run_cmd(\"devenv\",\r\n                                           \"all_tests.sln\", \"/build\", \"Release\")\r\n        if errcode != 0:\r\n            return \"devenv.exe failed to build all_tests.sln\\n\" + fmt_out_err(out, err)\r\n    except:\r\n        return \"devenv.exe not found\"\r\n    p = os.path.join(\"..\", \"obj-rel\")\r\n    os.chdir(p)\r\n    test_files = [f for f in os.listdir(\".\") if is_test_exe(f)]\r\n    print(\"Running %d test executables\" % len(test_files))\r\n    for f in test_files:\r\n        try:\r\n            (out, err, errcode) = util.run_cmd(f)\r\n            if errcode != 0:\r\n                return \"%s failed with:\\n%s\" % (f, fmt_out_err(out, err))\r\n            print(fmt_out_err(out, err))\r\n        except:\r\n            return \"%s failed to run\" % f\r\n    return None\r\n\r\n\r\ndef run_tests():\r\n    d = os.getcwd()\r\n    res = run_tests2()\r\n    os.chdir(d)\r\n    return res\r\n\r\n\r\ndef main():\r\n    err = run_tests()\r\n    if None == err:\r\n        print(\"Tests passed!\")\r\n    else:\r\n        print(\"Tests failed. Error message:\\n\" + err)\r\n\r\nif __name__ == \"__main__\":\r\n    main()\r\n"
  },
  {
    "path": "scripts/reftest.py",
    "content": "\"\"\"\r\nRenders all files in a directory to page TGA images and an XML dump\r\nand checks these renderings against a previous known-good reference\r\nrendering, creating TGA difference files for easier comparison.\r\n\r\nUse for regression testing:\r\n\r\nreftest.py /dir/to/test -refdir /dir/for/references\r\nreftest.py /dir/one /dir/two /dir/three\r\n\"\"\"\r\n\r\nimport os, sys, struct, fnmatch\r\nfrom subprocess import Popen, PIPE\r\npjoin = os.path.join\r\n\r\ndef EngineDump(EngineDumpExe, file, tgaPath):\r\n\tproc = Popen([EngineDumpExe, file, \"-full\", \"-render\", tgaPath], stdout=PIPE)\r\n\txmlDump, _ = proc.communicate()\r\n\treturn xmlDump\r\n\r\ndef TgaRleUnpack(data):\r\n\t# unpacks data from a type 2 TGA file (24-bit uncompressed)\r\n\t# or a type 10 TGA file (24-bit run-length encoded)\r\n\tif len(data) >= 18 and struct.unpack(\"B\", data[2]) == 2:\r\n\t\treturn data[18:]\r\n\texp, i = [], 18\r\n\twhile i + 4 < len(data):\r\n\t\tbit = struct.unpack(\"B\", data[i])[0] + 1\r\n\t\ti += 1\r\n\t\tif bit <= 128:\r\n\t\t\texp.append(data[i:i + bit * 3])\r\n\t\t\ti += bit * 3\r\n\t\telse:\r\n\t\t\texp.append(data[i:i + 3] * (bit - 128))\r\n\t\t\ti += 3\r\n\treturn \"\".join(exp)\r\n\r\ndef TgaCmpColor(col1, col2):\r\n\t# returns 0 for identical colors, 1 for similar colors and 2 for different colors\r\n\tif col1 == col2:\r\n\t\treturn 0\r\n\trgb1, rgb2 = struct.unpack(\"<BBB\", col1), struct.unpack(\"<BBB\", col2)\r\n\tif (rgb1[0] - rgb2[0]) ** 2 + (rgb1[1] - rgb2[1]) ** 2 + (rgb1[2] - rgb2[2]) ** 2 < 75:\r\n\t\treturn 1\r\n\treturn 2\r\n\r\ndef BitmapDiff(tgaRef, tgaCmp, tgaDiff):\r\n\t# ensure that the comparison bitmap exists\r\n\tif not os.path.isfile(tgaCmp):\r\n\t\topen(tgaCmp, \"wb\").write(\"\")\r\n\tref = open(tgaRef, \"rb\").read()\r\n\tcmp = open(tgaCmp, \"rb\").read()\r\n\t\r\n\t# bail if the files are either identical or the reference is broken\r\n\tif ref == cmp:\r\n\t\treturn False\r\n\tif len(ref) < 18:\r\n\t\treturn True\r\n\t\r\n\t# determine bitmap dimensions\r\n\twidth, height = struct.unpack(\"<HH\", ref[12:16])\r\n\t\r\n\t# unpack the run-length encoded data\r\n\trefData = TgaRleUnpack(ref)\r\n\tif len(refData) < width * height * 3:\r\n\t\trefData += \"\\x00\" * (width * height * 3 - len(refData))\r\n\tcmpData = TgaRleUnpack(cmp)\r\n\tif len(cmpData) < width * height * 3:\r\n\t\tcmpData += \"\\xFF\" * (width * height * 3 - len(cmpData))\r\n\t\r\n\t# bail if the files are just differently compressed\r\n\tif refData == cmpData:\r\n\t\treturn False\r\n\t\r\n\t# write a black pixel for identical, a dark red pixel for similar and a\r\n\t# bright red pixel for different color values (packed as a type 9 TGA file,\r\n\t# 8-bit indexed run-length encoded)\r\n\tdiff = [struct.pack(\"<BBBHHBHHHHBB\", 0, 1, 9, 0, 3, 24, 0, 0, width, height, 8, 0), \"\\x00\\x00\\x00\", \"\\x00\\x00\\x80\", \"\\x00\\x00\\xFF\"]\r\n\tfor i in range(height):\r\n\t\trefLine = refData[i * width * 3:(i + 1) * width * 3]\r\n\t\tcmpLine = cmpData[i * width * 3:(i + 1) * width * 3]\r\n\t\tj = 0\r\n\t\t# reencode the difference file line-by-line\r\n\t\twhile j < width:\r\n\t\t\tcolor = TgaCmpColor(refLine[j*3:j*3+3], cmpLine[j*3:j*3+3])\r\n\t\t\tk = j + 1\r\n\t\t\twhile k < width and k - j < 128 and color == TgaCmpColor(refLine[k*3:k*3+3], cmpLine[k*3:k*3+3]):\r\n\t\t\t\tk += 1\r\n\t\t\tdiff.append(struct.pack(\"BB\", k - j - 1 + 128, color))\r\n\t\t\tj = k\r\n\t\r\n\t# add the file footer\r\n\tdiff.append(\"\\x00\" * 8 + \"TRUEVISION-XFILE.\\x00\")\r\n\t\r\n\t# write the red-on-black difference file to disk\r\n\topen(tgaDiff, \"wb\").write(\"\".join(diff))\r\n\treturn True\r\n\r\ndef RefTestFile(EngineDumpExe, file, refdir):\r\n\t# create an XML dump and bitmap renderings of all pages\r\n\tbase = os.path.splitext(os.path.split(file)[1])[0]\r\n\ttgaPath = pjoin(refdir, base + \"-%d.cmp.tga\")\r\n\txmlDump = EngineDump(EngineDumpExe, file, tgaPath)\r\n\t\r\n\t# compare the XML dumps (remove the dump if it's the same as the reference)\r\n\txmlRefPath = pjoin(refdir, base + \".ref.xml\")\r\n\txmlCmpPath = pjoin(refdir, base + \".cmp.xml\")\r\n\tif not os.path.isfile(xmlRefPath):\r\n\t\topen(xmlRefPath, \"wb\").write(xmlDump)\r\n\telif open(xmlRefPath, \"rb\").read() != xmlDump:\r\n\t\topen(xmlCmpPath, \"wb\").write(xmlDump)\r\n\t\tprint \"  FAIL!\", xmlCmpPath\r\n\telif os.path.isfile(xmlCmpPath):\r\n\t\tos.remove(xmlCmpPath)\r\n\t\r\n\t# compare all bitmap renderings (and create diff bitmaps where needed)\r\n\tfor file in fnmatch.filter(os.listdir(refdir), base + \"-[0-9]*.ref.tga\"):\r\n\t\ttgaRefPath = pjoin(refdir, file)\r\n\t\ttgaCmpPath, tgaDiffPath = tgaRefPath[:-8] + \".cmp.tga\", tgaRefPath[:-8] + \".diff.tga\"\r\n\t\tif BitmapDiff(tgaRefPath, tgaCmpPath, tgaDiffPath):\r\n\t\t\tprint \"  FAIL!\", tgaCmpPath\r\n\t\telse:\r\n\t\t\tos.remove(tgaCmpPath)\r\n\t\t\tif os.path.isfile(tgaDiffPath):\r\n\t\t\t\tos.remove(tgaDiffPath)\r\n\tfor file in fnmatch.filter(os.listdir(refdir), base + \"-[0-9]*.cmp.tga\"):\r\n\t\ttgaCmpPath = pjoin(refdir, file)\r\n\t\ttgaRefPath = tgaCmpPath[:-8] + \".ref.tga\"\r\n\t\tif not os.path.isfile(tgaRefPath):\r\n\t\t\tos.rename(tgaCmpPath, tgaRefPath)\r\n\r\ndef RefTestDir(EngineDumpExe, dir, refdir):\r\n\t# create reference directory, if it doesn't exists yet\r\n\tif not os.path.isdir(refdir):\r\n\t\tos.makedirs(refdir)\r\n\t\r\n\t# test all files in the directory to test\r\n\tfor file in os.listdir(dir):\r\n\t\tfile = pjoin(dir, file)\r\n\t\tif os.path.isfile(file):\r\n\t\t\tprint \"Testing\", file\r\n\t\t\tRefTestFile(EngineDumpExe, file, refdir)\r\n\t\r\n\t# list all differences (again)\r\n\tdiffs = fnmatch.filter(os.listdir(refdir), \"*.cmp.*\")\r\n\tif diffs:\r\n\t\tprint \"\\n\" + \"=\" * 25 + \" RENDERING DIFFERENCES \" + \"=\" * 25\r\n\t\tfor file in diffs:\r\n\t\t\tprint pjoin(refdir, file)\r\n\t\tprint\r\n\t\r\n\treturn len(diffs)\r\n\r\ndef main(args):\r\n\t# find a path to EngineDump.exe (defaults to ../obj-dbg/EngineDump.exe)\r\n\tif len(args) > 1 and args[1].lower().endswith(\".exe\"):\r\n\t\tEngineDumpExe = args.pop(1)\r\n\telse:\r\n\t\tEngineDumpExe = pjoin(os.path.dirname(__file__), \"..\", \"obj-dbg\", \"EngineDump.exe\")\r\n\t\r\n\t# minimal sanity check of arguments\r\n\tif not args[1:] or not os.path.isdir(args[1]):\r\n\t\tprint \"Usage: %s [EngineDump.exe] <dir> [-refdir <dir>] [<dir> ...]\" % (os.path.split(args[0])[1])\r\n\t\treturn\r\n\t\r\n\t# collect all directories to test (and the corresonding reference directories)\r\n\tdirs, ix = [], 1\r\n\twhile ix < len(args):\r\n\t\tif ix + 2 < len(args) and args[ix + 1] == \"-refdir\":\r\n\t\t\tdirs.append((args[ix], args[ix + 2]))\r\n\t\t\tix += 3\r\n\t\telse:\r\n\t\t\tdirs.append((args[ix], pjoin(args[ix], \"references\")))\r\n\t\t\tix += 1\r\n\t\r\n\t# run the test\r\n\tfails = 0\r\n\tfor (dir, refdir) in dirs:\r\n\t\tfails += RefTestDir(EngineDumpExe, dir, refdir)\r\n\tsys.exit(fails)\r\n\r\nif __name__ == \"__main__\":\r\n\tmain(sys.argv[:])\r\n"
  },
  {
    "path": "scripts/render-benchmark.py",
    "content": "\"\"\"\r\nRuns a loading and rendering benchmark for a given number of files\r\n(10 times each).\r\n\r\nNote: If SumatraPDF.exe can't be found in either ..\\obj-rel\\ or %PATH%,\r\n      pass a path to it as the first argument.\r\n\r\nrender-benchmark.py obj-dbg\\SumatraPDF.exe file1.pdf file2.xps\r\n\"\"\"\r\n\r\nimport os, re, sys\r\nfrom subprocess import Popen, PIPE\r\n\r\ndef log(str):\r\n\tsys.stderr.write(str + \"\\n\")\r\n\r\ndef runBenchmark(SumatraPDFExe, file, repeats):\r\n\tlog(\"-> %s (%d times)\" % (file, repeats))\r\n\tproc = Popen([SumatraPDFExe] + [\"-bench\", file] * repeats, stdout=PIPE, stderr=PIPE)\r\n\treturn proc.communicate()[1]\r\n\r\ndef matchLine(line, regex, result=None):\r\n\tmatch = re.findall(regex, line)\r\n\tif match and type(match[0]) == str:\r\n\t\tmatch[0] = (match[0],)\r\n\tif match and result is not None:\r\n\t\tresult.extend(match[0])\r\n\treturn match\r\n\r\ndef parseBenchOutput(output):\r\n\tresult = {}\r\n\tcurrent, data = None, []\r\n\t\r\n\tfor line in output.replace(\"\\r\", \"\\n\").split(\"\\n\"):\r\n\t\tmatch = []\r\n\t\tif matchLine(line, r\"Starting: (.*)\", match):\r\n\t\t\tif current or data:\r\n\t\t\t\tlog(\"Ignoring data for failed run for %s\" % (current))\r\n\t\t\tcurrent, data = match[0], []\r\n\t\t\tif not current in result:\r\n\t\t\t\tresult[current] = []\r\n\t\t\r\n\t\telif matchLine(line, r\"load: (\\d+(?:\\.\\d+)?) ms\", match):\r\n\t\t\tassert not data\r\n\t\t\tdata.append(float(match[0]))\r\n\t\t\r\n\t\telif matchLine(line, r\"Finished \\(in (\\d+(?:\\.\\d+)?) ms\\): (.*)\", match):\r\n\t\t\tassert len(data) == 1\r\n\t\t\tdata.append(float(match[0]))\r\n\t\t\tresult[current].append(data)\r\n\t\t\tcurrent, data = None, []\r\n\t\r\n\treturn result\r\n\r\ndef displayBenchResults(result):\r\n\tprint \"Filename\\tLoad time (in ms)\\tRender time (in ms)\\tRuns\"\r\n\tfor (file, data) in result.items():\r\n\t\tcount = len(data)\r\n\t\t\r\n\t\tloadMin = min([item[0] for item in data])\r\n\t\trenderMin = min([item[1] for item in data])\r\n\t\t\r\n\t\tprint \"%(file)s\\t%(loadMin).2f\\t%(renderMin).2f\\t%(count)d\" % locals()\r\n\r\ndef main():\r\n\tif not sys.argv[1:]:\r\n\t\tlog(\"Usage: %s [<SumatraPDF.exe>] <file1.pdf> [<file2.pdf> ...]\" % (os.path.split(sys.argv[0])[1]))\r\n\t\tsys.exit(0)\r\n\t\r\n\tif sys.argv[1].lower().endswith(\".exe\"):\r\n\t\tSumatraPDFExe = sys.argv.pop(1)\r\n\telse:\r\n\t\tSumatraPDFExe = os.path.join(os.path.dirname(__file__), \"..\", \"obj-rel\", \"SumatraPDF.exe\")\r\n\t\tif not os.path.exists(SumatraPDFExe):\r\n\t\t\tSumatraPDFExe = \"SumatraPDF.exe\"\r\n\t\r\n\tbenchData = \"\"\r\n\tlog(\"Running benchmark with %s...\" % os.path.relpath(SumatraPDFExe))\r\n\tfor file in sys.argv[1:]:\r\n\t\ttry:\r\n\t\t\tbenchData += runBenchmark(SumatraPDFExe, file, 10) + \"\\n\"\r\n\t\texcept:\r\n\t\t\tlog(\"Error: %s not found\" % os.path.relpath(SumatraPDFExe))\r\n\t\t\treturn\r\n\tlog(\"\")\r\n\t\r\n\tdisplayBenchResults(parseBenchOutput(benchData))\r\n\r\nif __name__ == \"__main__\":\r\n\tmain()\r\n"
  },
  {
    "path": "scripts/run-regress.bat",
    "content": "go run tools\\regress\\main.go\r\n"
  },
  {
    "path": "scripts/runflint.py",
    "content": "#!/usr/bin/env python\n\n# This is a script to automate runnig of flint\n# (https://code.facebook.com/posts/729709347050548/under-the-hood-building-and-open-sourcing-flint/), facebook's C++ linter.\n# So far I only got it to compile on Mac.\n# Things to know about flint:\n# - it dumps output to stderr\n# - it contains rules we don't care about, so we need to filter thouse out\n\nimport os\nimport sys\n#import glob\nimport subprocess\nimport util\n\n\ndef verify_flint_installed():\n    try:\n        util.run_cmd_throw(\"flint\")\n    except:\n        print(\"flint doesn't seem to be installed\")\n        print(\"https://github.com/facebook/flint\")\n        sys.exit(1)\n\n\n@util.memoize\ndef src_dir():\n    return \"src\"\n\n\n@util.memoize\ndef src_utils_dir():\n    return os.path.join(\"src\", \"utils\")\n\ndef run_flint_in_dir(dir):\n    curr_dir = os.getcwd()\n    os.chdir(dir)\n\n    res = subprocess.check_output(\"flint *.cpp *.h\", stderr=subprocess.STDOUT, shell=True, universal_newlines=True)\n\n    #cpp_files = glob.glob(\"*.cpp\")\n    #h_files = glob.glob(\"*.h\")\n    #files = \" \".join(cpp_files) #+ \" \".join(h_files)\n    #out, err = util.run_cmd_throw(\"flint\" + \" \" + files)\n    os.chdir(curr_dir)\n    #print(out)\n    #print(err)\n    return res\n\n\ndef run_flint_all():\n    out1 = run_flint_in_dir(src_dir())\n    out2 = run_flint_in_dir(src_utils_dir())\n    return out1 + out2\n\n\ndef should_filter(s):\n    to_filter = [\n        \"Advice: Prefer `nullptr' to `NULL' in new C++ code\",\n        \"A symbol may not start with an underscore followed by a capital letter.\",\n        \"Warning: Avoid using static at global or namespace scope in C++ header files.\",\n        \"Using directive not allowed at top level or inside namespace\",\n        \"The associated header file of .cpp files should be included before any other includes\",\n        \"This helps catch missing header file dependencies in the .h\",\n        # VS 2010 doesn't seem to support 'explicit' on conversion operators\n        \"Implicit conversion to '\",\n        \"Symbol __IDownloadManager_INTERFACE_DEFINED__\"\n    ]\n    for f in to_filter:\n        if f in s:\n            return True\n    valid_missing_inlude = [\"Vec.h\", \"StrUtil.h\", \"StrFormat.h\", \"resource.h\", \"Allocator.h\", \"GeomUtil.h\", \"Scoped.h\"]\n    if \"Missing include guard\" in s:\n        for v in valid_missing_inlude:\n            if s.startswith(v):\n                return True\n    return False\n\n\ndef filter(out):\n    lines = out.split(\"\\n\")\n    warnings = []\n    filtered = []\n    for l in lines:\n        if should_filter(l):\n            filtered.append(l)\n        else:\n            warnings.append(l)\n    return (warnings, filtered)\n\ndef main():\n    verify_flint_installed()\n    res = run_flint_all()\n    (warnings, filtered) = filter(res)\n    for w in warnings:\n        print(w + \"\\n\")\n    print(\"%d warnings, %d filtered\" % (len(warnings), len(filtered)))\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "scripts/s3.py",
    "content": "import os\nimport sys\nimport tempfile\n\ng_aws_access = None\ng_aws_secret = None\ng_bucket = None\ng_conn = None\n\n\ndef log(s):\n    print(s)\n    sys.stdout.flush()\n\n\ndef set_secrets(access, secret):\n    global g_aws_access, g_aws_secret\n    g_aws_access = access\n    g_aws_secret = secret\n\n\ndef set_bucket(bucket):\n    global g_bucket\n    g_bucket = bucket\n\n\ndef get_conn():\n    global g_conn\n    from boto.s3.connection import S3Connection\n    if g_conn is None:\n        g_conn = S3Connection(g_aws_access, g_aws_secret, True)\n    return g_conn\n\n\ndef get_bucket():\n    return get_conn().get_bucket(g_bucket)\n\n\ndef ul_cb(sofar, total):\n    log(\"So far: %d, total: %d\" % (sofar, total))\n\n\ndef upload_file_public(local_path, remote_path, silent=False):\n    size = os.path.getsize(local_path)\n    log(\"s3 upload %d bytes of '%s' as '%s'\" % (size, local_path, remote_path))\n    k = get_bucket().new_key(remote_path)\n    if silent:\n        k.set_contents_from_filename(local_path)\n    else:\n        k.set_contents_from_filename(local_path, cb=ul_cb)\n    k.make_public()\n\n\ndef upload_data_public(data, remote_path):\n    log(\"s3 upload %d bytes of data as '%s'\" % (len(data), remote_path))\n    k = get_bucket().new_key(remote_path)\n    k.set_contents_from_string(data)\n    k.make_public()\n\n\ndef upload_data_public_with_content_type(data, remote_path, silent=False):\n    # writing to a file to force boto to set Content-Type based on file extension.\n    # TODO: there must be a simpler way\n    tmp_name = os.path.basename(remote_path)\n    tmp_path = os.path.join(tempfile.gettempdir(), tmp_name)\n    open(tmp_path, \"w\").write(data.encode(\"utf-8\"))\n    upload_file_public(tmp_path, remote_path, silent)\n    os.remove(tmp_path)\n\n\ndef download_to_file(remote_path, local_path):\n    log(\"s3 download '%s' as '%s'\" % (remote_path, local_path))\n    k = get_bucket().new_key(remote_path)\n    k.get_contents_to_filename(local_path)\n\n\ndef list(s3dir):\n    from boto.s3.bucketlistresultset import bucket_lister\n    b = get_bucket()\n    return bucket_lister(b, s3dir)\n\n\ndef delete(remote_path):\n    log(\"s3 delete '%s'\" % remote_path)\n    get_bucket().new_key(remote_path).delete()\n\n\ndef exists(remote_path):\n    return get_bucket().get_key(remote_path)\n\n\ndef verify_doesnt_exist(remote_path):\n    if not exists(remote_path):\n        return\n    raise BaseException(\"'%s' already exists in s3\" % remote_path)\n"
  },
  {
    "path": "scripts/test-unarr.py",
    "content": "import sys\r\nimport os\r\nimport subprocess\r\nimport shutil\r\nimport util\r\n\r\ng_get_files = False\r\ng_show_files = False\r\n\r\ndef usage_and_exit():\r\n    print(\"Usage: test-unrar.py dir\")\r\n    print(\"       test-unrar.py summary [file]\")\r\n    sys.exit(1)\r\n\r\n\r\n@util.memoize\r\ndef detect_unarr_exe():\r\n    p = os.path.join(\"obj-rel\", \"unarr.exe\")\r\n    if os.path.exists(p):\r\n        return p\r\n    p = os.path.join(\"obj-dbg\", \"unarr.exe\")\r\n    if os.path.exists(p):\r\n        return p\r\n    print(\"didn't find unarr.exe in obj-rel or obj-dbg. Run scripts/build-unarr.bat first.\")\r\n    sys.exit(1)\r\n\r\n\r\ndef should_test_file(f):\r\n    exts = [\r\n        \".rar\", \".cbr\",\r\n        \".zip\", \".cbz\", \".epub\", \".xps\", \".fb2z\",\r\n        \".7z\", \".cb7\",\r\n        \".tar\", \".cbt\"\r\n    ]\r\n    f = f.lower()\r\n    for ext in exts:\r\n        if f.endswith(ext):\r\n            return True\r\n    return False\r\n\r\n\r\nfiles_tested = 0\r\nfiles_failed = []\r\nfo = None\r\n\r\n# Apparently shell argument to Popen it must be False on unix/mac and True\r\n# on windows\r\ndef shell_arg():\r\n    if os.name == \"nt\":\r\n        return True\r\n    return False\r\n\r\n\r\ndef subprocess_flags():\r\n    # this magic disables the modal dialog that windows shows if the process crashes\r\n    # TODO: it doesn't seem to work, maybe because it was actually a crash in a process\r\n    # sub-launched from the process I'm launching. I had to manually disable this in\r\n    # registry, as per http://stackoverflow.com/questions/396369/how-do-i-disable-the-debug-close-application-dialog-on-windows-vista:\r\n    # DWORD HKLM or HKCU\\Software\\Microsoft\\Windows\\Windows Error Reporting\\DontShowUI = \"1\"\r\n    # DWORD HKLM or HKCU\\Software\\Microsoft\\Windows\\Windows Error Reporting\\Disabled = \"1\"\r\n    # see: http://msdn.microsoft.com/en-us/library/bb513638.aspx\r\n    if sys.platform.startswith(\"win\"):\r\n        import ctypes\r\n        SEM_NOGPFAULTERRORBOX = 0x0002  # From MSDN\r\n        ctypes.windll.kernel32.SetErrorMode(SEM_NOGPFAULTERRORBOX)\r\n        return 0x8000000  # win32con.CREATE_NO_WINDOW?\r\n    return 0\r\n\r\n\r\n# will throw an exception if a command doesn't exist\r\n# otherwise returns a tuple:\r\n# (stdout, stderr, errcode)\r\ndef run_cmd(*args):\r\n    cmd = \" \".join(args)\r\n    cmdproc = subprocess.Popen(args, shell=shell_arg(), stdout=subprocess.PIPE,\r\n                               stderr=subprocess.PIPE, creationflags=subprocess_flags())\r\n    res = cmdproc.communicate()\r\n    return (res[0], res[1], cmdproc.returncode)\r\n\r\n\r\ndef strip_empty_lines_and_dedup(s, only_last=-1):\r\n    lines = []\r\n    for l in s.splitlines():\r\n        l = l.strip()\r\n        if len(l) == 0:\r\n            continue\r\n        if l not in lines:\r\n            lines.append(l)\r\n    if only_last != -1:\r\n        lines = lines[-only_last:]\r\n    return \"\\n\".join(lines)\r\n\r\n\r\ndef shorten_err(s):\r\n    return strip_empty_lines_and_dedup(s)\r\n\r\n\r\ndef shorten_out(s):\r\n    return strip_empty_lines_and_dedup(s, 3)\r\n\r\n\r\ndef get_file_size(p):\r\n    try:\r\n        si = os.stat(p)\r\n        return si.st_size\r\n    except:\r\n        return 0\r\n\r\n\r\n# some errors we don't want to fix\r\ndef err_whitelisted(s):\r\n    if \"Splitting files isn't really supported\" in s:\r\n        return True\r\n    if \"Unsupported compression version: 15\" in s:\r\n        return True\r\n    if \"Encrypted entries will fail to uncompress\" in s:\r\n        return True\r\n    return False\r\n\r\n\r\ndef test_unarr(dir):\r\n    global files_tested, files_failed, fo\r\n    #print(\"Directory: %s\" % dir)\r\n    unarr = detect_unarr_exe()\r\n    try:\r\n        files = os.listdir(dir)\r\n    except:\r\n        return\r\n    for f in files:\r\n        p = os.path.join(dir, f)\r\n        if os.path.isdir(p):\r\n            test_unarr(p)\r\n            continue\r\n        if not should_test_file(f):\r\n            continue\r\n        (out, err, errcode) = run_cmd(unarr, p)\r\n        if errcode != 0:\r\n            out = shorten_out(out)\r\n            err = shorten_err(err)\r\n            if err_whitelisted(err):\r\n                continue\r\n            files_failed.append(p)\r\n            files_failed.append(out)\r\n            files_failed.append(err)\r\n            file_size = get_file_size(p)\r\n            print(\"%s of %d failed with out:\\n%s\\nerr:\\n%s\\n\" % (p, file_size, out, err))\r\n            fo.write(\"%s of %d failed with out:\\n%s\\nerr:\\n%s\\n\\n\" % (p, file_size, out, err))\r\n        files_tested += 1\r\n        if files_tested % 100 == 0:\r\n            print(\"tested %d files\" % files_tested)\r\n\r\n\r\ndef dump_failures():\r\n    global files_failed, files_tested, fo\r\n    # print just the names of files failed\r\n    fo.write(\"\\n-------------------------------------------\\n\")\r\n    n = len(files_failed) / 3\r\n    i = 0\r\n    while i < n:\r\n        p = files_failed[i*3]\r\n        size = get_file_size(p)\r\n        fo.write(\"%s of %d failed\\n\" % (p, size))\r\n        i += 1\r\n    print(\"Failed %d out of %d\" % (n, files_tested))\r\n    fo.write(\"Failed %d out of %d\\n\" % (n, files_tested))\r\n\r\n\r\ndef errors_to_sorted_array(errors):\r\n    a = []\r\n    for (err, count) in errors.items():\r\n        a.append([count, err])\r\n    return sorted(a, cmp=lambda x,y: cmp(y[0], x[0]))\r\n\r\n\r\ndef get_files_for_error(error_to_files, err):\r\n    res = []\r\n    files = error_to_files[err]\r\n    for f in files:\r\n        try:\r\n            size = os.path.getsize(f)\r\n            res.append([size, f])\r\n        except:\r\n            pass\r\n    return sorted(res, cmp=lambda x,y: cmp(x[0], y[0]))\r\n\r\n\r\ndef copy_file_here(f, n, m):\r\n    fn, ext = os.path.splitext(f)\r\n    dst = \"%2d-%2d%s\" % (n, m, ext)\r\n    dst = os.path.join(\"files\", dst)\r\n    shutil.copyfile(f, dst)\r\n\r\n\r\ndef get_all_files(files, n):\r\n    m = 1\r\n    for f in files:\r\n        print(\" %6d %s\" % (f[0], f[1]))\r\n        copy_file_here(f[1], n, m)\r\n        m += 1\r\n\r\n\r\ndef show_files(files):\r\n    for f in files:\r\n        print(\" %6d %s\" % (f[0], f[1]))\r\n    print(\"\")\r\n    print(\"\")\r\n\r\n\r\ndef print_errors(arr, error_to_files):\r\n    global g_get_files, g_show_files\r\n    n = 1\r\n    total = 0\r\n    for el in arr:\r\n        print(\"%s: %d\" % (el[1], el[0]))\r\n        files = get_files_for_error(error_to_files, el[1])\r\n        total += el[0]\r\n        if g_get_files or g_show_files:\r\n            show_files(files)\r\n        if g_get_files:\r\n            get_all_files(files, n)\r\n        n += 1\r\n    print(\"\\nTotal: %d\" % total)\r\n\r\n\r\ndef extract_file_path(l):\r\n    idx = l.find(\" of \")\r\n    if idx == -1:\r\n        return None\r\n    return l[:idx]\r\n\r\n\r\ndef do_summary_on_file(path):\r\n    fo = open(path, \"r\")\r\n    errors = {}  # map error string to number of failures\r\n    error_to_files = {}\r\n    seen_error = False\r\n    file_path = None\r\n    for l in fo:\r\n        l = l.strip()\r\n        if \"failed with out\" in l:\r\n            file_path = extract_file_path(l)\r\n        if l == \"err:\":\r\n            seen_error = False\r\n            continue\r\n        if seen_error:\r\n            continue\r\n        if not l.startswith(\"!\"):\r\n            continue\r\n        seen_error = True\r\n        if file_path is not None and os.path.exists(file_path):\r\n            errors[l] = errors.get(l, 0) + 1\r\n            a = error_to_files.get(l, [])\r\n            a.append(file_path)\r\n            error_to_files[l] = a\r\n    fo.close()\r\n    arr = errors_to_sorted_array(errors)\r\n    print_errors(arr, error_to_files)\r\n\r\n\r\ndef do_summary():\r\n    fn = \"unarr_failed.txt\"\r\n    if len(sys.argv) > 2:\r\n        fn = sys.argv[2]\r\n    do_summary_on_file(fn)\r\n\r\n\r\ndef do_getfiles():\r\n    global g_get_files\r\n    g_get_files = True\r\n    if not os.path.exists(\"files\"):\r\n        os.makedirs(\"files\")\r\n    do_summary()\r\n\r\n\r\ndef main():\r\n    global fo\r\n    detect_unarr_exe()  # detect early if doesn't exist\r\n    if len(sys.argv) < 2:\r\n        usage_and_exit()\r\n    if sys.argv[1] == \"summary\":\r\n        do_summary()\r\n        return\r\n    if sys.argv[1] == \"getfiles\":\r\n        do_getfiles()\r\n        return\r\n\r\n    if len(sys.argv) != 2:\r\n        usage_and_exit()\r\n    fo = open(\"unarr_failed.txt\", \"w\")\r\n    test_unarr(sys.argv[1])\r\n    dump_failures()\r\n    fo.close()\r\n\r\n\r\nif __name__ == \"__main__\":\r\n    main()\r\n"
  },
  {
    "path": "scripts/test_build.bat",
    "content": "call \"%VS140COMNTOOLS%vsvars32.bat\"\nIF NOT ERRORLEVEL 1 GOTO VSFOUND\nECHO Visual Studio 2015 doesn't seem to be installed\nEXIT /B 1\n\n:VSFOUND\n@rem http://www.hanselman.com/blog/DevEnvcomSairamasTipOfTheDay.aspx\n@rem https://msdn.microsoft.com/en-us/library/abtk353z.aspx\n@rem devenv.exe vs2015\\SumatraPDF.sln /Rebuild \"Release|Win32\" /Project vs2015\\all.vcxproj\n\ncd vs2015\n@rem /p:AdditionalPreprocessorDefinitions=\"SOMEDEF;ANOTHERDEF\"\n@rem /p:Configuration=Release;Platform=Win32 /t:proj:Rebuild\n@rem https://msdn.microsoft.com/en-us/library/ms171462.aspx\n@rem msbuild.exe SumatraPDF.sln /p:Configuration=Release;Platform=Win32\n\n@rem msbuild.exe SumatraPDF.vcxproj /p:Configuration=Release;Platform=Win32\n\n@rem msbuild.exe Installer.vcxproj /p:Configuration=Release;Platform=Win32\n\n@rem msbuild.exe SumatraPDF.sln /t:SumatraPDF-no-MUPDF:Rebuild /p:Configuration=Release;Platform=Win32\n\nmsbuild.exe SumatraPDF.sln /t:Installer:Rebuild /p:Configuration=Release;Platform=Win32\n"
  },
  {
    "path": "scripts/trans_download.py",
    "content": "#!/usr/bin/env python\r\n\r\n# Downloads latest translations from apptranslator.org.\r\n# If changed, saves them as strings/translations.txt and\r\n# re-generates src/Translations_txt.cpp etc.\r\n\r\nimport os\r\nimport sys\r\nimport urllib2\r\nimport util\r\nfrom trans_gen import gen_c_code, extract_strings_from_c_files\r\n\r\ng_my_dir = os.path.dirname(__file__)\r\ng_strings_dir = os.path.join(g_my_dir, \"..\", \"strings\")\r\n\r\nuse_local_for_testing = False\r\n\r\nif use_local_for_testing:\r\n    SERVER = \"172.21.12.12\"  # mac book\r\n    # SERVER = \"10.37.129.2\"    # mac pro\r\n    PORT = 5000\r\nelse:\r\n    SERVER = \"www.apptranslator.org\"\r\n    PORT = 80\r\n\r\n\r\ndef lastDownloadFilePath():\r\n    return os.path.join(g_strings_dir, \"translations.txt\")\r\n\r\n\r\ndef validSha1(s):\r\n    return len(s) == 40\r\n\r\n\r\ndef lastDownloadHash():\r\n    f = lastDownloadFilePath()\r\n    if not os.path.exists(f):\r\n        return \"0\" * 40\r\n    lines = open(f, \"rb\").read().split(\"\\n\")\r\n    sha1 = lines[1]\r\n    assert(validSha1(sha1))\r\n    #print(\"lastDownloadHash(): %s\" % sha1)\r\n    return sha1\r\n\r\n\r\ndef saveLastDownload(s):\r\n    open(lastDownloadFilePath(), \"wb\").write(s)\r\n\r\n\r\ndef downloadTranslations():\r\n    print(\"Downloading translations from the server...\")\r\n    vals = (SERVER, str(PORT), \"SumatraPDF\",  lastDownloadHash())\r\n    url = \"http://%s:%s/dltrans?app=%s&sha1=%s\" % vals\r\n    s = urllib2.urlopen(url).read()\r\n    print(\"Download done\")\r\n    return s\r\n\r\n\r\n# Returns 'strings' dict that maps an original, untranslated string to\r\n# an array of translation, where each translation is a tuple\r\n# (language, text translated into this language)\r\ndef parseTranslations(s):\r\n    lines = [l for l in s.split(\"\\n\")[2:]]\r\n    # strip empty lines from the end\r\n    if len(lines[-1]) == 0:\r\n        lines = lines[:-1]\r\n    strings = {}\r\n    curr_str = None\r\n    curr_translations = None\r\n    for l in lines:\r\n        #print(\"'%s'\" % l)\r\n        #TODO: looks like apptranslator doesn't deal well with strings that\r\n        # have newlines in them. Newline at the end ends up as an empty line\r\n        # apptranslator should escape newlines and tabs etc. but for now\r\n        # skip those lines as harmless\r\n        if len(l) == 0:\r\n            continue\r\n        if l[0] == ':':\r\n            if curr_str != None:\r\n                assert curr_translations != None\r\n                strings[curr_str] = curr_translations\r\n            curr_str = l[1:]\r\n            curr_translations = []\r\n        else:\r\n            (lang, trans) = l.split(\":\", 1)\r\n            curr_translations.append([lang, trans])\r\n    if curr_str != None:\r\n        assert curr_translations != None\r\n        strings[curr_str] = curr_translations\r\n    return strings\r\n\r\ng_src_dir = os.path.join(os.path.dirname(__file__), \"..\", \"src\")\r\n\r\n\r\ndef get_lang_list(strings_dict):\r\n    langs = []\r\n    for translations in strings_dict.values():\r\n        for t in translations:\r\n            lang = t[0]\r\n            if lang not in langs:\r\n                langs.append(lang)\r\n    return langs\r\n\r\n\r\ndef get_missing_for_language(strings, strings_dict, lang):\r\n    untranslated = []\r\n    for s in strings:\r\n        if not s in strings_dict:\r\n            untranslated.append(s)\r\n            continue\r\n        translations = strings_dict[s]\r\n        found = filter(lambda tr: tr[0] == lang, translations)\r\n        if not found and s not in untranslated:\r\n            untranslated.append(s)\r\n    return untranslated\r\n\r\n\r\ndef langs_sort_func(x, y):\r\n    return cmp(len(y[1]), len(x[1])) or cmp(x[0], y[0])\r\n\r\n# strings_dict maps a string to a list of [lang, translations...] list\r\n\r\n\r\ndef dump_missing_per_language(strings, strings_dict, dump_strings=False):\r\n    untranslated_dict = {}\r\n    for lang in get_lang_list(strings_dict):\r\n        untranslated_dict[lang] = get_missing_for_language(\r\n            strings, strings_dict, lang)\r\n    items = untranslated_dict.items()\r\n    items.sort(langs_sort_func)\r\n\r\n    print(\"\\nMissing translations:\")\r\n    strs = []\r\n    for (lang, untranslated) in items:\r\n        strs.append(\"%5s: %3d\" % (lang, len(untranslated)))\r\n    per_line = 5\r\n    while len(strs) > 0:\r\n        line_strs = strs[:per_line]\r\n        strs = strs[per_line:]\r\n        print(\"  \".join(line_strs))\r\n    return untranslated_dict\r\n\r\n\r\ndef get_untranslated_as_list(untranslated_dict):\r\n    return util.uniquify(sum(untranslated_dict.values(), []))\r\n\r\n# Generate the various Translations_txt.cpp files based on translations\r\n# in s that we downloaded from the server\r\n\r\n\r\ndef generate_code(s):\r\n    strings_dict = parseTranslations(s)\r\n    strings = extract_strings_from_c_files(True)\r\n    strings_list = [tmp[0] for tmp in strings]\r\n    for s in strings_dict.keys():\r\n        if s not in strings_list:\r\n            del strings_dict[s]\r\n    untranslated_dict = dump_missing_per_language(strings_list, strings_dict)\r\n    untranslated = get_untranslated_as_list(untranslated_dict)\r\n    for s in untranslated:\r\n        if s not in strings_dict:\r\n            strings_dict[s] = []\r\n    gen_c_code(strings_dict, strings)\r\n\r\n# returns True if translation files have been re-generated and\r\n# need to be commited\r\n\r\n\r\ndef downloadAndUpdateTranslationsIfChanged():\r\n    try:\r\n        s = downloadTranslations()\r\n    except:\r\n        # might fail due to intermitten network problems, ignore that\r\n        print(\"skipping because downloadTranslations() failed\")\r\n        return\r\n    lines = s.split(\"\\n\")\r\n    if len(lines) < 2:\r\n        print(\"Bad response, less than 2 lines: '%s'\" % s)\r\n        return False\r\n    if lines[0] != \"AppTranslator: SumatraPDF\":\r\n        print(\"Bad response, invalid first line: '%s'\" % lines[0])\r\n        print(s)\r\n        return False\r\n    sha1 = lines[1]\r\n    if sha1.startswith(\"No change\"):\r\n        print(\"skipping because translations haven't changed\")\r\n        return False\r\n    if not validSha1(sha1):\r\n        print(\"Bad reponse, invalid sha1 on second line: '%s'\", sha1)\r\n        return False\r\n    print(\"Translation data size: %d\" % len(s))\r\n    # print(s)\r\n    generate_code(s)\r\n    saveLastDownload(s)\r\n    return True\r\n\r\n\r\ndef regenerateLangs():\r\n    s = open(lastDownloadFilePath(), \"rb\").read()\r\n    generate_code(s)\r\n    sys.exit(1)\r\n\r\n\r\ndef main():\r\n    changed = downloadAndUpdateTranslationsIfChanged()\r\n    if changed:\r\n        print(\"\\nNew translations downloaded from the server! Check them in!\")\r\n\r\nif __name__ == \"__main__\":\r\n    main()\r\n"
  },
  {
    "path": "scripts/trans_gen.py",
    "content": "#!/usr/bin/env python\r\n\r\nimport os\r\nimport re\r\nimport util\r\nimport codecs\r\nimport trans_langs\r\nimport bz2\r\nimport zlib\r\n\r\n\r\nclass Lang(object):\r\n\r\n    def __init__(self, desc):\r\n        assert len(desc) <= 4\r\n        self.desc = desc\r\n        self.code = desc[0]  # \"af\"\r\n        self.name = desc[1]  # \"Afrikaans\"\r\n        self.ms_lang_id = desc[2]\r\n        self.isRtl = False\r\n        if len(desc) > 3:\r\n            assert desc[3] == 'RTL'\r\n            self.isRtl = True\r\n\r\n        # code that can be used as part of C identifier i.e.:\r\n        # \"ca-xv\" => \"ca_xv\"\r\n        self.code_safe = self.code.replace(\"-\", \"_\")\r\n        self.c_translations_array_name = \"gTranslations_\" + self.code_safe\r\n        self.translations = []\r\n\r\n\r\ndef get_lang_objects(langs_defs):\r\n    return [Lang(desc) for desc in langs_defs]\r\n\r\n# number of missing translations for a language to be considered\r\n# incomplete (will be excluded from Translations_txt.cpp) as a\r\n# percentage of total string count of that specific file\r\nINCOMPLETE_MISSING_THRESHOLD = 0.2\r\n\r\nSRC_DIR = os.path.join(os.path.dirname(__file__), \"..\", \"src\")\r\n\r\nC_DIRS_TO_PROCESS = [\".\", \"installer\"]\r\n\r\n\r\ndef should_translate(file_name):\r\n    file_name = file_name.lower()\r\n    return file_name.endswith(\".cpp\")\r\n\r\nC_FILES_TO_PROCESS = []\r\nfor dir in C_DIRS_TO_PROCESS:\r\n    d = os.path.join(SRC_DIR, dir)\r\n    C_FILES_TO_PROCESS += [os.path.join(d, f)\r\n                           for f in os.listdir(d) if should_translate(f)]\r\n\r\nTRANSLATION_PATTERN = r'\\b_TRN?\\(\"(.*?)\"\\)'\r\n\r\n\r\ndef extract_strings_from_c_files(with_paths=False):\r\n    strings = []\r\n    for f in C_FILES_TO_PROCESS:\r\n        file_content = open(f, \"r\").read()\r\n        file_strings = re.findall(TRANSLATION_PATTERN, file_content)\r\n        if with_paths:\r\n            strings += [(s, os.path.basename(os.path.dirname(f)))\r\n                        for s in file_strings]\r\n        else:\r\n            strings += file_strings\r\n    return util.uniquify(strings)\r\n\r\n# use octal escapes because hexadecimal ones can consist of\r\n# up to four characters, e.g. \\xABc isn't the same as \\253c\r\n\r\n\r\ndef c_oct(c):\r\n    o = \"00\" + oct(ord(c))\r\n    return \"\\\\\" + o[-3:]\r\n\r\n\r\ndef c_escape(txt):\r\n    if txt is None:\r\n        return \"NULL\"\r\n    # escape all quotes\r\n    txt = txt.replace('\"', r'\\\"')\r\n    # and all non-7-bit characters of the UTF-8 encoded string\r\n    txt = re.sub(r\"[\\x80-\\xFF]\", lambda m: c_oct(m.group(0)[0]), txt)\r\n    return '\"%s\"' % txt\r\n\r\n\r\ndef c_escape_for_compact(txt):\r\n    if txt is None:\r\n        return '\"\\\\0\"'\r\n    # escape all quotes\r\n    txt = txt.replace('\"', r'\\\"')\r\n    # and all non-7-bit characters of the UTF-8 encoded string\r\n    txt = re.sub(r\"[\\x80-\\xFF]\", lambda m: c_oct(m.group(0)[0]), txt)\r\n    return '\"%s\\\\0\"' % txt\r\n\r\n\r\ndef get_trans_for_lang(strings_dict, keys, lang_arg):\r\n    if lang_arg == \"en\":\r\n        return keys\r\n    trans, untrans = [], []\r\n    for k in keys:\r\n        found = [tr for (lang, tr) in strings_dict[k] if lang == lang_arg]\r\n        if found:\r\n            assert len(found) == 1\r\n            # don't include a translation, if it's the same as the default\r\n            if found[0] == k:\r\n                found[0] = None\r\n            trans.append(found[0])\r\n        else:\r\n            trans.append(None)\r\n            untrans.append(k)\r\n    if len(untrans) > INCOMPLETE_MISSING_THRESHOLD * len(keys):\r\n        return None\r\n    return trans\r\n\r\n\r\ndef lang_sort_func(x, y):\r\n    # special case: default language is first\r\n    if x[0] == \"en\":\r\n        return -1\r\n    if y[0] == \"en\":\r\n        return 1\r\n    return cmp(x[1], y[1])\r\n\r\n# correctly sorts strings containing escaped tabulators\r\n\r\n\r\ndef key_sort_func(a, b):\r\n    return cmp(a.replace(r\"\\t\", \"\\t\"), b.replace(r\"\\t\", \"\\t\"))\r\n\r\ng_incomplete_langs = None\r\n\r\n\r\ndef build_trans_for_langs(langs, strings_dict, keys):\r\n    global g_incomplete_langs\r\n    g_incomplete_langs = []\r\n    for lang in langs:\r\n        lang.translations = get_trans_for_lang(strings_dict, keys, lang.code)\r\n        if not lang.translations:\r\n            g_incomplete_langs.append(lang)\r\n    for lang in g_incomplete_langs:\r\n        langs.remove(lang)\r\n    return langs\r\n\r\ncompact_c_tmpl = \"\"\"\\\r\n/*\r\n DO NOT EDIT MANUALLY !!!\r\n Generated by scripts\\\\trans_gen.py\r\n*/\r\n\r\n#include \"BaseUtil.h\"\r\n\r\nnamespace trans {\r\n\r\n#define LANGS_COUNT   %(langs_count)d\r\n#define STRINGS_COUNT %(translations_count)d\r\n\r\nconst char *gOriginalStrings[STRINGS_COUNT] = {\r\n%(orignal_strings)s\r\n};\r\n\r\nconst char **GetOriginalStrings() { return &gOriginalStrings[0]; }\r\n\r\n%(translations)s\r\n\r\nconst char *gLangCodes = \\\r\n%(langcodes)s \"\\\\0\";\r\n\r\nconst char *gLangNames = \\\r\n%(langnames)s \"\\\\0\";\r\n\r\n// from http://msdn.microsoft.com/en-us/library/windows/desktop/dd318693(v=vs.85).aspx\r\n// those definition are not present in 7.0A SDK my VS 2010 uses\r\n#ifndef LANG_CENTRAL_KURDISH\r\n#define LANG_CENTRAL_KURDISH 0x92\r\n#endif\r\n\r\n#ifndef SUBLANG_CENTRAL_KURDISH_CENTRAL_KURDISH_IRAQ\r\n#define SUBLANG_CENTRAL_KURDISH_CENTRAL_KURDISH_IRAQ 0x01\r\n#endif\r\n\r\n#define _LANGID(lang) MAKELANGID(lang, SUBLANG_NEUTRAL)\r\nconst LANGID gLangIds[LANGS_COUNT] = {\r\n%(langids)s\r\n};\r\n#undef _LANGID\r\n\r\nbool IsLangRtl(int idx)\r\n{\r\n  %(islangrtl)s\r\n}\r\n\r\nint gLangsCount = LANGS_COUNT;\r\nint gStringsCount = STRINGS_COUNT;\r\n\r\nconst LANGID *GetLangIds() { return &gLangIds[0]; }\r\n\r\n} // namespace trans\r\n\"\"\"\r\n\r\n# generate unique names for translations files for each binary, to\r\n# simplify build\r\n\r\n\r\ndef file_name_from_dir_name(dir_name):\r\n    if dir_name == \".\":\r\n        return \"Trans_sumatra_txt.cpp\"\r\n    return \"Trans_%s_txt.cpp\" % dir_name\r\n\r\n\r\ndef build_translations(langs):\r\n    for lang in langs[1:]:\r\n        c_escaped = []\r\n        seq = \"\"\r\n        for t in lang.translations:\r\n            c_escaped.append(\"  %s\" % c_escape_for_compact(t))\r\n            if t != None:\r\n                seq += t\r\n            seq += \"\\0\"\r\n        lang.c_escaped_lines = c_escaped\r\n        lang.seq = seq\r\n        lang.seq_zip = zlib.compress(seq, 9)\r\n        lang.seq_bzip = bz2.compress(seq, 9)\r\n\r\n\r\ndef gen_translations(langs):\r\n    lines = []\r\n    for lang in langs[1:]:\r\n        s = \"\\\\\\n\".join(lang.c_escaped_lines)\r\n        lines.append(\"const char * %s = \\n%s;\\n\" %\r\n                     (lang.c_translations_array_name, s))\r\n    return \"\\n\".join(lines)\r\n\r\n\r\ndef gen_trans_compressed_for_lang(lang):\r\n    lines = []\r\n    per_line = 24\r\n    rest = lang.seq_zip\r\n    while len(rest) > 0:\r\n        tmp = [str(ord(c)) for c in rest[:per_line]]\r\n        lines.append(\",\".join(tmp))\r\n        rest = rest[per_line:]\r\n    s = \",\\n  \".join(lines)\r\n    return \"static unsigned char %s[] = {\\n  %s\\n};\\n\" % (lang.c_translations_array_name, s)\r\n\r\ncompressed_tmpl = \"\"\"\r\n%(translations)s\r\n\r\n// for each lang: uncompressed size, compressed size\r\nconst uint32_t gLangsCompressionInfo[LANGS_COUNT*2] = {\r\n%(compressed_sizes)s\r\n};\r\n\r\nstatic const unsigned char *gTranslations[LANGS_COUNT] = {\r\n%(translations_refs)s\r\n};\r\n\r\nconst unsigned char *GetTranslationsForLang(int langIdx, uint32_t *uncompressedSizeOut, uint32_t *compressedSizeOut) {\r\n    *uncompressedSizeOut = gLangsCompressionInfo[langIdx*2];\r\n    *compressedSizeOut = gLangsCompressionInfo[langIdx*2+1];\r\n    return gTranslations[langIdx];\r\n}\r\n\"\"\"\r\n\r\nuncompressed_tmpl = \"\"\"\r\n%(translations)s\r\n\r\nstatic const char *gTranslations[LANGS_COUNT] = {\r\n%(translations_refs)s\r\n};\r\n\r\nconst char *GetTranslationsForLang(int langIdx) { return gTranslations[langIdx]; }\r\n\"\"\"\r\n\r\n\r\ndef gen_translations_compressed(langs):\r\n    lines = []\r\n    sizes = [\"0\", \"0\"]\r\n    for lang in langs[1:]:\r\n        lines.append(gen_trans_compressed_for_lang(lang))\r\n        sizes.append(str(len(lang.seq)))\r\n        sizes.append(str(len(lang.seq_zip)))\r\n    translations = \"\\n\".join(lines)\r\n    compressed_sizes = \"  \" + \", \".join(sizes)\r\n    return (translations, compressed_sizes)\r\n\r\n# what percentage of total is x (x=60 is 60% of total=100)\r\n\r\n\r\ndef perc(total, x):\r\n    return x * 100.0 / total\r\n\r\n\r\ndef print_stats(langs):\r\n    uncompressed = 0\r\n    compressed_zip = 0\r\n    compressed_bzip = 0\r\n    for lang in langs[1:]:\r\n        uncompressed += len(lang.seq)\r\n        compressed_zip += len(lang.seq_zip)\r\n        compressed_bzip += len(lang.seq_bzip)\r\n    pzip = perc(uncompressed, compressed_zip)\r\n    pbzip = perc(uncompressed, compressed_bzip)\r\n    savezip = uncompressed - compressed_zip\r\n    savebzip = uncompressed - compressed_bzip\r\n    savebzip_over_zip = savebzip - savezip\r\n    vals = (uncompressed, compressed_zip, pzip, savezip,\r\n            compressed_bzip, pbzip, savebzip, savebzip_over_zip)\r\n    print(\r\n        \"\\nLen: %d zip: %d %.2f%% (-%d), bzip: %d %.2f%% (-%d), bzip over zip: %d\" %\r\n        vals)\r\n\r\n\r\ndef print_incomplete_langs(dir_name):\r\n    langs = \", \".join([lang.code for lang in g_incomplete_langs])\r\n    count = \"%d out of %d\" % (\r\n        len(g_incomplete_langs), len(trans_langs.g_langs))\r\n    print(\"\\nIncomplete langs in %s: %s %s\" %\r\n          (file_name_from_dir_name(dir_name), count, langs))\r\n\r\n\r\ndef gen_c_code_for_dir(strings_dict, keys, dir_name, compressed=False):\r\n    langs = get_lang_objects(sorted(trans_langs.g_langs, cmp=lang_sort_func))\r\n    assert \"en\" == langs[0].code\r\n    langs = build_trans_for_langs(langs, strings_dict, keys)\r\n\r\n    langcodes = \" \\\\\\n\".join([\"  %s\" % c_escape_for_compact(lang.code)\r\n                             for lang in langs])\r\n\r\n    langnames = \" \\\\\\n\".join([\"  %s\" % c_escape_for_compact(lang.name)\r\n                             for lang in langs])\r\n    langids = \",\\n\".join([\"  %s\" % lang.ms_lang_id for lang in langs])\r\n\r\n    rtl_info = [\"(%d == idx)\" % langs.index(lang)\r\n                for lang in langs if lang.isRtl]\r\n    islangrtl = \"return %s;\" % (\" || \".join(rtl_info) or \"false\")\r\n\r\n    build_translations(langs)\r\n\r\n    translations_refs = \"  NULL,\\n\" + \\\r\n        \", \\n\".join([\"  %s\" %\r\n                    lang.c_translations_array_name for lang in langs[1:]])\r\n    if compressed:\r\n        (translations, compressed_sizes) = gen_translations_compressed(langs)\r\n        translations = compressed_tmpl % locals()\r\n    else:\r\n        translations = gen_translations(langs)\r\n        translations = uncompressed_tmpl % locals()\r\n\r\n    lines = [\"  %s\" % c_escape(t) for t in langs[0].translations]\r\n    orignal_strings = \",\\n\".join(lines)\r\n\r\n    langs_count = len(langs)\r\n    translations_count = len(keys)\r\n    file_content = compact_c_tmpl % locals()\r\n    file_path = os.path.join(\r\n        SRC_DIR, dir_name, file_name_from_dir_name(dir_name))\r\n    file(file_path, \"wb\").write(file_content)\r\n\r\n    print_incomplete_langs(dir_name)\r\n    # print_stats(langs)\r\n\r\n\r\ndef gen_c_code(strings_dict, strings):\r\n    for dir in C_DIRS_TO_PROCESS:\r\n        keys = [s[0] for s in strings if s[1] == dir and s[0] in strings_dict]\r\n        keys.sort(cmp=key_sort_func)\r\n        gen_c_code_for_dir(strings_dict, keys, dir)\r\n\r\n\r\ndef main():\r\n    import trans_download\r\n    trans_download.regenerateLangs()\r\n\r\nif __name__ == \"__main__\":\r\n    main()\r\n"
  },
  {
    "path": "scripts/trans_langs.py",
    "content": "﻿# List of languages we support, their iso codes and id as understood\r\n# by Windows SDK (LANG_* and SUBLANG_*_*).\r\n# See http://msdn.microsoft.com/en-us/library/dd318693.aspx for the full list.\r\ng_langs = [\r\n    ('af', 'Afrikaans', '_LANGID(LANG_AFRIKAANS)'),\r\n    ('am', 'Armenian (Հայերեն)', '_LANGID(LANG_ARMENIAN)'),\r\n    ('ar', 'Arabic (الْعَرَبيّة)', '_LANGID(LANG_ARABIC)', 'RTL'),\r\n    ('az', 'Azerbaijani (Azərbaycanca)', '_LANGID(LANG_AZERI)'),\r\n    ('bg', 'Bulgarian (Български)', '_LANGID(LANG_BULGARIAN)'),\r\n    ('bn', 'Bengali (বাংলা)', '_LANGID(LANG_BENGALI)'),\r\n    ('br', 'Portuguese - Brazil (Português)', 'MAKELANGID(LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN)'),\r\n    ('bs', 'Bosnian (Bosanski)', 'MAKELANGID(LANG_BOSNIAN, SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN)'),\r\n    ('by', 'Belarusian (Беларуская)', '_LANGID(LANG_BELARUSIAN)'),\r\n    ('ca', 'Catalan (Català)', '_LANGID(LANG_CATALAN)'),\r\n    ('ca-xv', 'Catalan-Valencian (Català-Valencià)', '(LANGID)-1'),\r\n    ('cn', 'Chinese Simplified (简体中文)', 'MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED)'),\r\n    ('cy', 'Welsh (Cymraeg)', '_LANGID(LANG_WELSH)'),\r\n    ('cz', 'Czech (Čeština)', '_LANGID(LANG_CZECH)'),\r\n    ('de', 'German (Deutsch)', '_LANGID(LANG_GERMAN)'),\r\n    ('dk', 'Danish (Dansk)', '_LANGID(LANG_DANISH)'),\r\n    ('el', 'Greek (Ελληνικά)', '_LANGID(LANG_GREEK)'),\r\n    ('en', 'English', '_LANGID(LANG_ENGLISH)'),\r\n    ('es', 'Spanish (Español)', '_LANGID(LANG_SPANISH)'),\r\n    ('et', 'Estonian (Eesti)', '_LANGID(LANG_ESTONIAN)'),\r\n    ('eu', 'Basque (Euskara)', '_LANGID(LANG_BASQUE)'),\r\n    ('fa', 'Persian (فارسی)', '_LANGID(LANG_FARSI)', 'RTL'),\r\n    ('fi', 'Finnish (Suomi)', '_LANGID(LANG_FINNISH)'),\r\n    ('fr', 'French (Français)', '_LANGID(LANG_FRENCH)'),\r\n    ('fy-nl', 'Frisian (Frysk)', '_LANGID(LANG_FRISIAN)'),\r\n    ('ga', 'Irish (Gaeilge)', '_LANGID(LANG_IRISH)'),\r\n    ('gl', 'Galician (Galego)', '_LANGID(LANG_GALICIAN)'),\r\n    ('he', 'Hebrew (עברית)', '_LANGID(LANG_HEBREW)', 'RTL'),\r\n    ('hi', 'Hindi (हिंदी)', '_LANGID(LANG_HINDI)'),\r\n    ('hr', 'Croatian (Hrvatski)', '_LANGID(LANG_CROATIAN)'),\r\n    ('hu', 'Hungarian (Magyar)', '_LANGID(LANG_HUNGARIAN)'),\r\n    ('id', 'Indonesian (Bahasa Indonesia)', '_LANGID(LANG_INDONESIAN)'),\r\n    ('it', 'Italian (Italiano)', '_LANGID(LANG_ITALIAN)'),\r\n    ('ja', 'Japanese (日本語)', '_LANGID(LANG_JAPANESE)'),\r\n    ('jv', 'Javanese (ꦧꦱꦗꦮ)', '(LANGID)-1'),\r\n    ('ka', 'Georgian (ქართული)', '_LANGID(LANG_GEORGIAN)'),\r\n    ('kr', 'Korean (한국어)', '_LANGID(LANG_KOREAN)'),\r\n    ('ku', 'Kurdish (كوردی)', 'MAKELANGID(LANG_CENTRAL_KURDISH, SUBLANG_CENTRAL_KURDISH_CENTRAL_KURDISH_IRAQ)', 'RTL'),\r\n    ('kw', 'Cornish (Kernewek)', '(LANGID)-1'),\r\n    ('lt', 'Lithuanian (Lietuvių)', '_LANGID(LANG_LITHUANIAN)'),\r\n    ('lv', 'Latvian (latviešu valoda)', '_LANGID(LANG_LATVIAN)'),\r\n    ('mk', 'Macedonian (македонски)', '_LANGID(LANG_MACEDONIAN)'),\r\n    ('ml', 'Malayalam (മലയാളം)', '_LANGID(LANG_MALAYALAM)'),\r\n    ('mm', 'Burmese (ဗမာ စာ)', '(LANGID)-1'),\r\n    ('my', 'Malaysian (Bahasa Melayu)', '_LANGID(LANG_MALAY)'),\r\n    ('ne', 'Nepali (नेपाली)', '_LANGID(LANG_NEPALI)'),\r\n    ('nl', 'Dutch (Nederlands)', '_LANGID(LANG_DUTCH)'),\r\n    ('nn', 'Norwegian Neo-Norwegian (Norsk nynorsk)', 'MAKELANGID(LANG_NORWEGIAN, SUBLANG_NORWEGIAN_NYNORSK)'),\r\n    ('no', 'Norwegian (Norsk)', 'MAKELANGID(LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL)'),\r\n    ('pa', 'Punjabi (ਪੰਜਾਬੀ)', '_LANGID(LANG_PUNJABI)'),\r\n    ('pl', 'Polish (Polski)', '_LANGID(LANG_POLISH)'),\r\n    ('pt', 'Portuguese - Portugal (Português)', '_LANGID(LANG_PORTUGUESE)'),\r\n    ('ro', 'Romanian (Română)', '_LANGID(LANG_ROMANIAN)'),\r\n    ('ru', 'Russian (Русский)', '_LANGID(LANG_RUSSIAN)'),\r\n    ('si', 'Sinhala (සිංහල)', '_LANGID(LANG_SINHALESE)'),\r\n    ('sk', 'Slovak (Slovenčina)', '_LANGID(LANG_SLOVAK)'),\r\n    ('sl', 'Slovenian (Slovenščina)', '_LANGID(LANG_SLOVENIAN)'),\r\n    ('sn', 'Shona (Shona)', '(LANGID)-1'),\r\n    ('sp-rs', 'Serbian (Latin)', 'MAKELANGID(LANG_SERBIAN, SUBLANG_SERBIAN_LATIN)'),\r\n    ('sq', 'Albanian (Shqip)', '_LANGID(LANG_ALBANIAN)'),\r\n    ('sr-rs', 'Serbian (Cyrillic)', 'MAKELANGID(LANG_SERBIAN, SUBLANG_SERBIAN_CYRILLIC)'),\r\n    ('sv', 'Swedish (Svenska)', '_LANGID(LANG_SWEDISH)'),\r\n    ('ta', 'Tamil (தமிழ்)', '_LANGID(LANG_TAMIL)'),\r\n    ('th', 'Thai (ภาษาไทย)', '_LANGID(LANG_THAI)'),\r\n    ('tl', 'Tagalog (Tagalog)', '_LANGID(LANG_FILIPINO)'),\r\n    ('tr', 'Turkish (Türkçe)', '_LANGID(LANG_TURKISH)'),\r\n    ('tw', 'Chinese Traditional (繁體中文)', 'MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL)'),\r\n    ('uk', 'Ukrainian (Українська)', '_LANGID(LANG_UKRAINIAN)'),\r\n    ('uz', 'Uzbek (O\\'zbek)', '_LANGID(LANG_UZBEK)'),\r\n    ('vn', 'Vietnamese (Việt Nam)', '_LANGID(LANG_VIETNAMESE)'),\r\n]\r\n"
  },
  {
    "path": "scripts/trans_upload.py",
    "content": "#!/usr/bin/env python\nimport os\nimport sys\nimport string\nimport httplib\nimport urllib\nimport util\nfrom trans_gen import extract_strings_from_c_files\n\n# Extracts english strings from the source code and uploads them\n# to apptranslator.org\ng_strings_dir = os.path.join(os.path.dirname(__file__), \"..\", \"strings\")\n\nuse_local_for_testing = False\n\nif use_local_for_testing:\n    SERVER = \"172.21.12.12\"\n    PORT = 5000\nelse:\n    SERVER = \"www.apptranslator.org\"\n    PORT = 80\n\n\ndef lastUploadedFilePath():\n    return os.path.join(g_strings_dir, \"last_uploaded.txt\")\n\n\ndef lastUploaded():\n    f = lastUploadedFilePath()\n    if not os.path.exists(f):\n        return \"\"\n    return open(f, \"rb\").read()\n\n\ndef saveLastUploaded(s):\n    open(lastUploadedFilePath(), \"wb\").write(s)\n\n\ndef uploadStringsToServer(strings, secret):\n    print(\"Uploading strings to the server...\")\n    params = urllib.urlencode(\n        {'strings': strings, 'app': 'SumatraPDF', 'secret': secret})\n    headers = {\"Content-type\": \"application/x-www-form-urlencoded\",\n               \"Accept\": \"text/plain\"}\n    conn = httplib.HTTPConnection(SERVER, PORT)\n    conn.request(\"POST\", \"/uploadstrings\", params, headers)\n    resp = conn.getresponse()\n    print resp.status\n    print resp.reason\n    print resp.read()\n    conn.close()\n    print(\"Upload done\")\n\n\ndef uploadStringsIfChanged():\n    # needs to have upload secret to protect apptranslator.org server from abuse\n    config = util.load_config()\n    uploadsecret = config.trans_ul_secret\n    if None is uploadsecret:\n        print(\"Skipping string upload because don't have upload secret\")\n        return\n\n    # TODO: we used to have a check if svn is up-to-date\n    # should we restore it for git?\n\n    strings = extract_strings_from_c_files()\n    strings.sort()\n    s = \"AppTranslator strings\\n\" + string.join(strings, \"\\n\")\n    s = s.encode(\"utf8\")\n\n    if lastUploaded() == s:\n        print(\n            \"Skipping upload because strings haven't changed since last upload\")\n    else:\n        uploadStringsToServer(s, uploadsecret)\n        saveLastUploaded(s)\n        print(\"Don't forget to checkin strings/last_uploaded.txt\")\n\nif __name__ == \"__main__\":\n    uploadStringsIfChanged()\n"
  },
  {
    "path": "scripts/update_auto_update_ver.py",
    "content": "#!/usr/bin/env python\r\n\r\nimport SquareTree\r\nimport sys\r\nimport urllib2\r\nfrom util import load_config\r\nimport s3\r\n\r\n\r\ndef getch_unix():\r\n    import sys, tty, termios\r\n    fd = sys.stdin.fileno()\r\n    old_settings = termios.tcgetattr(fd)\r\n    try:\r\n        tty.setraw(sys.stdin.fileno())\r\n        ch = sys.stdin.read(1)\r\n    finally:\r\n        termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)\r\n    return ch\r\n\r\n\r\ndef getch_win():\r\n    import msvcrt\r\n    return msvcrt.getch()\r\n\r\n\r\ndef discover_getch():\r\n    try:\r\n        import msvcrt\r\n        return getch_win\r\n    except ImportError:\r\n        return getch_unix\r\n\r\n\r\ngetch = discover_getch()\r\n\r\n\r\ndef report_invalid_ver(ver):\r\n    print(\"'%s' is not a valid program version\" % ver)\r\n    sys.exit(1)\r\n\r\n\r\ndef is_num(s):\r\n    try:\r\n    \treturn str(int(s)) == s\r\n    except:\r\n        return False\r\n\r\n\r\ndef validate_ver(ver):\r\n    parts = ver.split(\".\")\r\n    for p in parts:\r\n        if not is_num(p):\r\n            report_invalid_ver(ver)\r\n\r\n\r\ndef get_update_versions(url):\r\n    try:\r\n        data = urllib2.urlopen(url).read()\r\n        root = SquareTree.Parse(data)\r\n        node = root.GetChild(\"SumatraPDF\")\r\n        return (node.GetValue(\"Stable\"), node.GetValue(\"Latest\"))\r\n    except:\r\n        return (None, None)\r\n\r\n\r\ndef get_latest_version(url):\r\n    try:\r\n        s = urllib2.urlopen(url).read()\r\n        return s.strip()\r\n    except:\r\n        return None\r\n\r\n\r\ndef v2fhelper(v, suff, version, weight):\r\n    parts = v.split(suff)\r\n    if 2 != len(parts):\r\n        return v\r\n    version[4] = weight\r\n    version[5] = parts[1]\r\n    return parts[0]\r\n\r\n\r\n# Convert a Mozilla-style version string into a floating-point number\r\n#   1.2.3.4, 1.2a5, 2.3.4b1pre, 3.0rc2, etc\r\ndef version2float(v):\r\n    version = [\r\n        0, 0, 0, 0, # 4-part numerical revision\r\n        4, # Alpha, beta, RC or (default) final\r\n        0, # Alpha, beta, or RC version revision\r\n        1  # Pre or (default) final\r\n    ]\r\n    parts = v.split(\"pre\")\r\n    if 2 == len(parts):\r\n        version[6] = 0\r\n        v = parts[0]\r\n\r\n    v = v2fhelper(v, \"a\",  version, 1)\r\n    v = v2fhelper(v, \"b\",  version, 2)\r\n    v = v2fhelper(v, \"rc\", version, 3)\r\n\r\n    parts = v.split(\".\")[:4]\r\n    for (p, i) in zip(parts, range(len(parts))):\r\n        version[i] = p\r\n    ver = float(version[0])\r\n    ver += float(version[1]) / 100.\r\n    ver += float(version[2]) / 10000.\r\n    ver += float(version[3]) / 1000000.\r\n    ver += float(version[4]) / 100000000.\r\n    ver += float(version[5]) / 10000000000.\r\n    ver += float(version[6]) / 1000000000000.\r\n    return ver\r\n\r\n\r\n# Return True if ver1 > ver2 using semantics of comparing version\r\n# numbers\r\ndef ProgramVersionGreater(ver1, ver2):\r\n    v1f = version2float(ver1)\r\n    v2f = version2float(ver2)\r\n    return v1f > v2f\r\n\r\n\r\ndef verify_version_not_lower(myver, curr1, curr2):\r\n    if curr1 != None and ProgramVersionGreater(curr1, myver):\r\n        print(\"version you gave is less than sumpdf-latest.txt (%s < %s)\" % (myver, curr1))\r\n        sys.exit(1)\r\n    if curr2 != None and ProgramVersionGreater(curr2, myver):\r\n        print(\"version you gave is less than sumpdf-latest.txt (%s < %s)\" % (myver, curr2))\r\n        sys.exit(1)\r\n\r\n\r\n# TODO: we don't use two-tier version so could be simplified\r\ndef main(new_ver):\r\n    url_update = \"https://kjkpub.s3.amazonaws.com/sumatrapdf/sumpdf-update.txt\"\r\n    url_latest = \"https://kjkpub.s3.amazonaws.com/sumatrapdf/sumpdf-latest.txt\"\r\n\r\n    conf = load_config()\r\n    aws_access, aws_secret = conf.GetAwsCredsMustExist()\r\n    s3.set_secrets(aws_access, aws_secret)\r\n    s3.set_bucket(\"kjkpub\")\r\n\r\n    v1 = get_latest_version(url_latest)\r\n    (v2, ver_4) = get_update_versions(url_update)\r\n    validate_ver(ver_4)\r\n    assert not v2 or v1 == v2, \"sumpdf-update.txt and sumpdf-latest.txt don't agree on Stable version, run build.py -release first\"\r\n\r\n    if not new_ver:\r\n        print(\"Current version: %s. To update run:\\npython scripts\\update_auto_update_ver.py <new_version>\" % v1)\r\n        return\r\n\r\n    verify_version_not_lower(new_ver, v1, v2)\r\n    sys.stdout.write(\"Current version: %s\\nGoing to update auto-update version to %s. Are you sure? [y/N] \" % (v1, new_ver))\r\n    sys.stdout.flush()\r\n    ch = getch()\r\n    print()\r\n    if ch not in ['y', 'Y']:\r\n        print(\"Didn't update because you didn't press 'y'\")\r\n        sys.exit(1)\r\n\r\n    # remove the Stable version from sumpdf-update.txt\r\n    s = \"[SumatraPDF]\\nLatest %s\\n\" % new_ver\r\n    s3.upload_data_public(s, \"sumatrapdf/sumpdf-update.txt\")\r\n    # keep updating the legacy file for now\r\n    s = \"%s\\n\" % new_ver\r\n    s3.upload_data_public(s, \"sumatrapdf/sumpdf-latest.txt\")\r\n    v1 = get_latest_version(url_latest)\r\n    (v2, v3) = get_update_versions(url_update)\r\n    if v1 != new_ver or v2 != None or v3 != new_ver:\r\n        print(\"Upload failed because v1 or v3 != ver ('%s' or '%s' != '%s'\" % (v1, v3, new_ver))\r\n        sys.exit(1)\r\n    print(\"Successfully update auto-update version to '%s'\" % new_ver)\r\n\r\n\r\nif __name__ == \"__main__\":\r\n    new_ver = None\r\n    if len(sys.argv) == 2:\r\n        new_ver = sys.argv[1]\r\n        validate_ver(new_ver)\r\n    main(new_ver)\r\n"
  },
  {
    "path": "scripts/util.py",
    "content": "import os\r\nimport re\r\nimport subprocess\r\nimport sys\r\nimport hashlib\r\nimport string\r\nimport time\r\nimport types\r\nimport zipfile\r\nimport bz2\r\nimport shutil\r\n\r\n\r\ndef log(s):\r\n    print(s)\r\n    sys.stdout.flush()\r\n\r\n\r\ndef strip_empty_lines(s):\r\n    s = s.replace(\"\\r\\n\", \"\\n\")\r\n    lines = [l.strip() for l in s.split(\"\\n\") if len(l.strip()) > 0]\r\n    return string.join(lines, \"\\n\")\r\n\r\n\r\ndef trim_str(s):\r\n    if len(s) < 75:\r\n        return (s, False)\r\n    # we don't want to trim if adding \"...\" would make it bigger than original\r\n    if len(s) < 78:\r\n        return (s, False)\r\n    return (s[:75], True)\r\n\r\n\r\ndef test_for_flag(args, arg, has_data=False):\r\n    if arg not in args:\r\n        if not has_data:\r\n            return False\r\n        for argx in args:\r\n            if argx.startswith(arg + \"=\"):\r\n                args.remove(argx)\r\n                return argx[len(arg) + 1:]\r\n        return None\r\n\r\n    if not has_data:\r\n        args.remove(arg)\r\n        return True\r\n\r\n    idx = args.index(arg)\r\n    if idx == len(args) - 1:\r\n        return None\r\n    data = args[idx + 1]\r\n    args.pop(idx + 1)\r\n    args.pop(idx)\r\n    return data\r\n\r\n\r\ndef file_sha1(fp):\r\n    data = open(fp, \"rb\").read()\r\n    m = hashlib.sha1()\r\n    m.update(data)\r\n    return m.hexdigest()\r\n\r\n\r\ndef delete_file(path):\r\n    if os.path.exists(path):\r\n        os.remove(path)\r\n\r\n\r\ndef create_dir(d):\r\n    if not os.path.exists(d):\r\n        os.makedirs(d)\r\n    return d\r\n\r\n\r\ndef verify_path_exists(path):\r\n    if not os.path.exists(path):\r\n        print(\"path '%s' doesn't exist\" % path)\r\n        sys.exit(1)\r\n    return path\r\n\r\n\r\ndef verify_started_in_right_directory():\r\n    if os.path.exists(os.path.join(\"scripts\", \"build.py\")):\r\n        return\r\n    if os.path.exists(os.path.join(os.getcwd(), \"scripts\", \"build.py\")):\r\n        return\r\n    print(\"This script must be run from top of the source tree\")\r\n    sys.exit(1)\r\n\r\n\r\ndef subprocess_flags():\r\n    # this magic disables the modal dialog that windows shows if the process crashes\r\n    # TODO: it doesn't seem to work, maybe because it was actually a crash in a process\r\n    # sub-launched from the process I'm launching. I had to manually disable this in\r\n    # registry, as per http://stackoverflow.com/questions/396369/how-do-i-disable-the-debug-close-application-dialog-on-windows-vista:\r\n    # DWORD HKLM or HKCU\\Software\\Microsoft\\Windows\\Windows Error Reporting\\DontShowUI = \"1\"\r\n    # DWORD HKLM or HKCU\\Software\\Microsoft\\Windows\\Windows Error Reporting\\Disabled = \"1\"\r\n    # see: http://msdn.microsoft.com/en-us/library/bb513638.aspx\r\n    if sys.platform.startswith(\"win\"):\r\n        import ctypes\r\n        SEM_NOGPFAULTERRORBOX = 0x0002  # From MSDN\r\n        ctypes.windll.kernel32.SetErrorMode(SEM_NOGPFAULTERRORBOX)\r\n        return 0x8000000  # win32con.CREATE_NO_WINDOW?\r\n    return 0\r\n\r\n\r\n# Apparently shell argument to Popen it must be False on unix/mac and True\r\n# on windows\r\ndef shell_arg():\r\n    if os.name == \"nt\":\r\n        return True\r\n    return False\r\n\r\n\r\ndef write_to_file(path, s):\r\n    with open(path, \"w\") as fo:\r\n        fo.write(s)\r\n\r\n\r\n# will throw an exception if a command doesn't exist\r\n# otherwise returns a tuple:\r\n# (stdout, stderr, errcode)\r\ndef run_cmd(*args):\r\n    cmd = \" \".join(args)\r\n    print(\"run_cmd: '%s'\" % cmd)\r\n    cmdproc = subprocess.Popen(args, shell=shell_arg(), stdout=subprocess.PIPE,\r\n                               stderr=subprocess.PIPE, creationflags=subprocess_flags())\r\n    res = cmdproc.communicate()\r\n    return (res[0], res[1], cmdproc.returncode)\r\n\r\n\r\n# like run_cmd() but throws an exception if command returns non-0 error code\r\ndef run_cmd_throw(*args):\r\n    cmd = \" \".join(args)\r\n    print(\"run_cmd_throw: '%s'\" % cmd)\r\n\r\n    cmdproc = subprocess.Popen(args, shell=shell_arg(), stdout=subprocess.PIPE,\r\n                               stderr=subprocess.PIPE, creationflags=subprocess_flags())\r\n    res = cmdproc.communicate()\r\n    errcode = cmdproc.returncode\r\n    if 0 != errcode:\r\n        print(\"Failed with error code %d\" % errcode)\r\n        if len(res[0]) > 0:\r\n            write_to_file(\"run_cmd_throw_stdout.txt\", strip_empty_lines(res[0]))\r\n        if len(res[1]) > 0:\r\n            write_to_file(\"run_cmd_throw_stderr.txt\", strip_empty_lines(res[1]))\r\n        raise Exception(\"'%s' failed with error code %d\" % (cmd, errcode))\r\n    return (res[0], res[1])\r\n\r\n\r\n# work-around a problem with running devenv from command-line:\r\n# http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/9d8b9d4a-c453-4f17-8dc6-838681af90f4\r\ndef kill_msbuild():\r\n    (stdout, stderr, err) = run_cmd(\"taskkill\", \"/F\", \"/IM\", \"msbuild.exe\")\r\n    if err not in (0, 128):  # 0 is no error, 128 is 'process not found'\r\n        print(\"err: %d\\n%s%s\" % (err, stdout, stderr))\r\n        print(\"exiting\")\r\n        sys.exit(1)\r\n\r\n\r\n# get a linear version from git by counting number of commits\r\ndef get_git_linear_version():\r\n    subprocess.check_call([\"git\", \"pull\"])\r\n    out = subprocess.check_output([\"git\", \"log\", \"--oneline\"])\r\n    lines = [l for l in out.split('\\n') if len(l.strip()) > 0]\r\n    # we add 1000 to create a version that is larger than the svn version\r\n    # from the time we used svn\r\n    nLines = len(lines) + 1000\r\n    return nLines\r\n\r\n\r\n# version line is in the format:\r\n# define CURR_VERSION 1.1\r\ndef extract_sumatra_version(file_path):\r\n    content = open(file_path).read()\r\n    ver = re.findall(r'CURR_VERSION (\\d+(?:\\.\\d+)*)', content)[0]\r\n    return ver\r\n\r\n\r\ndef file_remove_try_hard(path):\r\n    removeRetryCount = 0\r\n    while removeRetryCount < 3:\r\n        try:\r\n            os.remove(path)\r\n            return\r\n        except:\r\n            # try to sleep to make the time for the file not be used anymore\r\n            time.sleep(1)\r\n            print \"exception: n  %s, n  %s, n  %s n  when trying to remove file %s\" % (sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2], path)\r\n        removeRetryCount += 1\r\n\r\n\r\ndef zip_file(dst_zip_file, src_path, in_zip_name=None, compress=True, append=False):\r\n    mode = \"w\"\r\n    if append:\r\n        mode = \"a\"\r\n    if compress:\r\n        zf = zipfile.ZipFile(dst_zip_file, mode, zipfile.ZIP_DEFLATED)\r\n    else:\r\n        zf = zipfile.ZipFile(dst_zip_file, mode, zipfile.ZIP_STORED)\r\n    if in_zip_name is None:\r\n        in_zip_name = os.path.basename(src_path)\r\n    zf.write(src_path, in_zip_name)\r\n    zf.close()\r\n\r\n\r\ndef bz_file_compress(src, dst):\r\n    with open(src, \"rb\") as src_fo:\r\n        with bz2.BZ2File(dst, \"w\", buffering=16 * 1024 * 1024, compresslevel=9) as dst_fo:\r\n            shutil.copyfileobj(src_fo, dst_fo, length=1 * 1024 * 1024)\r\n\r\n\r\ndef formatInt(x):\r\n    if x < 0:\r\n        return '-' + formatInt(-x)\r\n    result = ''\r\n    while x >= 1000:\r\n        x, r = divmod(x, 1000)\r\n        result = \".%03d%s\" % (r, result)\r\n    return \"%d%s\" % (x, result)\r\n\r\n\r\ndef str2bool(s):\r\n    if s.lower() in (\"true\", \"1\"):\r\n        return True\r\n    if s.lower() in (\"false\", \"0\"):\r\n        return False\r\n    assert(False)\r\n\r\n\r\nclass Serializable(object):\r\n\r\n    def __init__(self, fields, fields_no_serialize, read_from_file=None):\r\n        self.fields = fields\r\n        self.fields_no_serialize = fields_no_serialize\r\n        self.vals = {}\r\n\r\n        if read_from_file != None:\r\n            self.from_s(open(read_from_file, \"r\").read())\r\n\r\n    def type_of_field(self, name):\r\n        return type(self.fields[name])\r\n\r\n    def from_s(self, s):\r\n        # print(s)\r\n        lines = s.split(\"\\n\")\r\n        for l in lines:\r\n            (name, val) = l.split(\": \", 1)\r\n            tp = self.type_of_field(name)\r\n            if tp == types.IntType:\r\n                self.vals[name] = int(val)\r\n            elif tp == types.LongType:\r\n                self.vals[name] = long(val)\r\n            elif tp == types.BooleanType:\r\n                self.vals[name] = str2bool(val)\r\n            elif tp in (types.StringType, types.UnicodeType):\r\n                self.vals[name] = val\r\n            else:\r\n                print(name)\r\n                assert(False)\r\n\r\n    def to_s(self):\r\n        res = []\r\n        for k, v in self.vals.items():\r\n            if k in self.fields_no_serialize:\r\n                continue\r\n            res.append(\"%s: %s\" % (k, str(v)))\r\n        return string.join(res, \"\\n\")\r\n\r\n    def write_to_file(self, filename):\r\n        open(filename, \"w\").write(self.to_s())\r\n\r\n    def compat_types(self, tp1, tp2):\r\n        if tp1 == tp2:\r\n            return True\r\n        num_types = (types.IntType, types.LongType)\r\n        if tp1 in num_types and tp2 in num_types:\r\n            return True\r\n        return False\r\n\r\n    def __setattr__(self, k, v):\r\n        if k in self.fields:\r\n            if not self.compat_types(type(v), type(self.fields[k])):\r\n                print(\"k='%s', %s != %s (type(v) != type(self.fields[k]))\" % (\r\n                    k, type(v), type(self.fields[k])))\r\n                assert type(v) == type(self.fields[k])\r\n            self.vals[k] = v\r\n        else:\r\n            super(Serializable, self).__setattr__(k, v)\r\n\r\n    def __getattr__(self, k):\r\n        if k in self.vals:\r\n            return self.vals[k]\r\n        if k in self.fields:\r\n            return self.fields[k]\r\n        return super(Serializable, self).__getattribute__(k)\r\n\r\n\r\nimport smtplib\r\nfrom email.MIMEMultipart import MIMEMultipart\r\nfrom email.MIMEText import MIMEText\r\n\r\n\r\ndef sendmail(sender, senderpwd, to, subject, body):\r\n    # print(\"sendmail is disabled\"); return\r\n    mail = MIMEMultipart()\r\n    mail['From'] = sender\r\n    toHdr = to\r\n    if isinstance(toHdr, list):\r\n        toHdr = \", \".join(toHdr)\r\n    mail['To'] = toHdr\r\n    mail['Subject'] = subject\r\n    mail.attach(MIMEText(body))\r\n    msg = mail.as_string()\r\n    # print(msg)\r\n    mailServer = smtplib.SMTP(\"smtp.mandrillapp.com\", 587)\r\n    mailServer.ehlo()\r\n    mailServer.starttls()\r\n    mailServer.ehlo()\r\n    mailServer.login(sender, senderpwd)\r\n    mailServer.sendmail(sender, to, msg)\r\n    mailServer.close()\r\n\r\n\r\n# Some operations, like uploading to s3, require knowing s3 credential\r\n# We store all such information that cannot be publicly known in a file\r\n# config.py. This object is just a wrapper to documents the fields\r\n# and given default values if config.py doesn't exist\r\nclass Config(object):\r\n\r\n    def __init__(self):\r\n        self.aws_access = None\r\n        self.aws_secret = None\r\n        self.cert_pwd = None\r\n        self.trans_ul_secret = None\r\n        self.notifier_email = None\r\n        self.notifier_email_pwd = None\r\n\r\n    def GetNotifierEmailAndPwdMustExist(self):\r\n        assert(None != self.notifier_email and None != self.notifier_email_pwd)\r\n        return (self.notifier_email, self.notifier_email_pwd)\r\n\r\n    def HasNotifierEmail(self):\r\n        return self.notifier_email != None and self.notifier_email_pwd != None\r\n\r\n    def GetCertPwdMustExist(self):\r\n        assert(None != self.cert_pwd)\r\n        return self.cert_pwd\r\n\r\n    def GetTransUploadSecret(self):\r\n        assert(None != self.trans_ul_secret)\r\n        return self.trans_ul_secret\r\n\r\n    # TODO: could verify aws creds better i.e. check the lengths\r\n    def GetAwsCredsMustExist(self):\r\n        assert(None != self.aws_access)\r\n        assert(None != self.aws_secret)\r\n        return (self.aws_access, self.aws_secret)\r\n\r\n    def HasAwsCreds(self):\r\n        if None is self.aws_access:\r\n            return False\r\n        if None is self.aws_secret:\r\n            return False\r\n        return True\r\n\r\n\r\ng_config = None\r\ndef load_config():\r\n    global g_config\r\n    if g_config != None:\r\n        return g_config\r\n    c = Config()\r\n    try:\r\n        import config\r\n        c.aws_access = config.aws_access\r\n        c.aws_secret = config.aws_secret\r\n        c.cert_pwd = config.cert_pwd\r\n        c.notifier_email = config.notifier_email\r\n        c.notifier_email_pwd = config.notifier_email_pwd\r\n        c.trans_ul_secret = config.trans_ul_secret\r\n    except:\r\n        # it's ok if doesn't exist, we just won't have the config data\r\n        exctype, excval = sys.exc_info()[:2]\r\n        print \"exception '%s' ('%s') when loading config.py\" % (exctype, excval)\r\n\r\n    g_config = c\r\n    return g_config\r\n\r\n\r\ndef test_load_config():\r\n    c = load_config()\r\n    vals = (c.aws_access, c.aws_secret, c.cert_pwd, c.trans_ul_secret)\r\n    print(\"aws_secret: %s\\naws_secret: %s\\ncert_pwd: %s\\ntrans_ul_secret: %s\" %\r\n          vals)\r\n\r\n\r\ndef gob_uvarint_encode(i):\r\n    assert i >= 0\r\n    if i <= 0x7f:\r\n        return chr(i)\r\n    res = \"\"\r\n    while i > 0:\r\n        b = i & 0xff\r\n        res += chr(b)\r\n        i = i >> 8\r\n    l = 256 - len(res)\r\n    res = res[::-1]  # reverse string\r\n    return chr(l) + res\r\n\r\n\r\ndef gob_varint_encode(i):\r\n    if i < 0:\r\n        i = (~i << 1) | 1\r\n    else:\r\n        i = i << 1\r\n    return gob_uvarint_encode(i)\r\n\r\n\r\n# data generated with UtilTests.cpp (define GEN_PYTHON_TESTS to 1)\r\ndef test_gob():\r\n    assert gob_varint_encode(0) == chr(0)\r\n    assert gob_varint_encode(1) == chr(2)\r\n    assert gob_varint_encode(127) == chr(255) + chr(254)\r\n    assert gob_varint_encode(128) == chr(254) + chr(1) + chr(0)\r\n    assert gob_varint_encode(129) == chr(254) + chr(1) + chr(2)\r\n    assert gob_varint_encode(254) == chr(254) + chr(1) + chr(252)\r\n    assert gob_varint_encode(255) == chr(254) + chr(1) + chr(254)\r\n    assert gob_varint_encode(256) == chr(254) + chr(2) + chr(0)\r\n    assert gob_varint_encode(4660) == chr(254) + chr(36) + chr(104)\r\n    assert gob_varint_encode(74565) == chr(253) + chr(2) + chr(70) + chr(138)\r\n    assert gob_varint_encode(1193046) == chr(253) + \\\r\n        chr(36) + chr(104) + chr(172)\r\n    assert gob_varint_encode(19088743) == chr(252) + \\\r\n        chr(2) + chr(70) + chr(138) + chr(206)\r\n    assert gob_varint_encode(305419896) == chr(252) + \\\r\n        chr(36) + chr(104) + chr(172) + chr(240)\r\n    assert gob_varint_encode(2147483647) == chr(252) + \\\r\n        chr(255) + chr(255) + chr(255) + chr(254)\r\n    assert gob_varint_encode(-1) == chr(1)\r\n    assert gob_varint_encode(-2) == chr(3)\r\n    assert gob_varint_encode(-255) == chr(254) + chr(1) + chr(253)\r\n    assert gob_varint_encode(-256) == chr(254) + chr(1) + chr(255)\r\n    assert gob_varint_encode(-257) == chr(254) + chr(2) + chr(1)\r\n    assert gob_varint_encode(-4660) == chr(254) + chr(36) + chr(103)\r\n    assert gob_varint_encode(-74565) == chr(253) + chr(2) + chr(70) + chr(137)\r\n    assert gob_varint_encode(-1193046) == chr(253) + \\\r\n        chr(36) + chr(104) + chr(171)\r\n    assert gob_varint_encode(-1197415) == chr(253) + \\\r\n        chr(36) + chr(138) + chr(205)\r\n    assert gob_varint_encode(-19158648) == chr(252) + \\\r\n        chr(2) + chr(72) + chr(172) + chr(239)\r\n    assert gob_uvarint_encode(0) == chr(0)\r\n    assert gob_uvarint_encode(1) == chr(1)\r\n    assert gob_uvarint_encode(127) == chr(127)\r\n    assert gob_uvarint_encode(128) == chr(255) + chr(128)\r\n    assert gob_uvarint_encode(129) == chr(255) + chr(129)\r\n    assert gob_uvarint_encode(254) == chr(255) + chr(254)\r\n    assert gob_uvarint_encode(255) == chr(255) + chr(255)\r\n    assert gob_uvarint_encode(256) == chr(254) + chr(1) + chr(0)\r\n    assert gob_uvarint_encode(4660) == chr(254) + chr(18) + chr(52)\r\n    assert gob_uvarint_encode(74565) == chr(253) + chr(1) + chr(35) + chr(69)\r\n    assert gob_uvarint_encode(1193046) == chr(253) + \\\r\n        chr(18) + chr(52) + chr(86)\r\n    assert gob_uvarint_encode(19088743) == chr(252) + \\\r\n        chr(1) + chr(35) + chr(69) + chr(103)\r\n    assert gob_uvarint_encode(305419896) == chr(252) + \\\r\n        chr(18) + chr(52) + chr(86) + chr(120)\r\n    assert gob_uvarint_encode(2147483647) == chr(252) + \\\r\n        chr(127) + chr(255) + chr(255) + chr(255)\r\n    assert gob_uvarint_encode(2147483648) == chr(252) + \\\r\n        chr(128) + chr(0) + chr(0) + chr(0)\r\n    assert gob_uvarint_encode(2147483649) == chr(252) + \\\r\n        chr(128) + chr(0) + chr(0) + chr(1)\r\n    assert gob_uvarint_encode(4294967294) == chr(252) + \\\r\n        chr(255) + chr(255) + chr(255) + chr(254)\r\n    assert gob_uvarint_encode(4294967295) == chr(252) + \\\r\n        chr(255) + chr(255) + chr(255) + chr(255)\r\n\r\n\r\n# for easy generation of the compact form of storing strings in C\r\nclass SeqStrings(object):\r\n\r\n    def __init__(self):\r\n        self.strings = {}\r\n        self.strings_seq = \"\"\r\n\r\n    def get_all(self):\r\n        return self.strings_seq + chr(0)\r\n\r\n    # Note: this only works if strings are ascii, which is the case for us so\r\n    # far\r\n    def get_all_c_escaped(self):\r\n        s = self.get_all()\r\n        s = s.replace(chr(0), \"\\\\0\")\r\n        return '\"' + s + '\"'\r\n\r\n    def add(self, s):\r\n        self.get_offset(s)\r\n\r\n    def get_offset(self, s):\r\n        if s not in self.strings:\r\n            self.strings[s] = len(self.strings_seq)\r\n            self.strings_seq = self.strings_seq + s + chr(0)\r\n        return self.strings[s]\r\n\r\n\r\n(FMT_NONE, FMT_LEFT, FMT_RIGHT) = (0, 1, 2)\r\ndef get_col_fmt(col_fmt, col):\r\n    if col >= len(col_fmt):\r\n        return FMT_NONE\r\n    return col_fmt[col]\r\n\r\n\r\ndef fmt_str(s, max, fmt):\r\n    add = max - len(s)\r\n    if fmt == FMT_LEFT:\r\n        return \" \" * add + s\r\n    elif fmt == FMT_RIGHT:\r\n        return s + \" \" * add\r\n    return s\r\n\r\n\r\n\"\"\"\r\n[\r\n  [\"a\",  \"bc\",   \"def\"],\r\n  [\"ab\", \"fabo\", \"d\"]\r\n]\r\n=>\r\n[\r\n  [\"a \", \"bc  \", \"def\"],\r\n  [\"ab\", \"fabo\", \"d  \"]\r\n]\r\n\"\"\"\r\ndef fmt_rows(rows, col_fmt=[]):\r\n    col_max_len = {}\r\n    for row in rows:\r\n        for col in range(len(row)):\r\n            el_len = len(row[col])\r\n            curr_max = col_max_len.get(col, 0)\r\n            if el_len > curr_max:\r\n                col_max_len[col] = el_len\r\n    res = []\r\n    for row in rows:\r\n        res_row = []\r\n        for col in range(len(row)):\r\n            s = fmt_str(row[col], col_max_len[col], get_col_fmt(col_fmt, col))\r\n            res_row.append(s)\r\n        res.append(res_row)\r\n    return res\r\n\r\nif __name__ == \"__main__\":\r\n    # test_load_config()\r\n    test_gob()\r\n\r\n\r\ndef plural(n, suff):\r\n    if n == 1:\r\n        return \"%d %s\" % (n, suff)\r\n    return \"%d %ss\" % (n, suff)\r\n\r\n\r\ndef pretty_print_secs(secs):\r\n    hrs = 0\r\n    mins = 0\r\n    if secs > 60:\r\n        mins = secs / 60\r\n        secs = secs % 60\r\n    if mins > 60:\r\n        hrs = mins / 60\r\n        mins = mins % 60\r\n    if hrs > 0:\r\n        return \"%s %s %s\" % (plural(hrs, \"hr\"), plural(mins, \"min\"), plural(secs, \"sec\"))\r\n    if mins > 0:\r\n        return \"%s %s\" % (plural(mins, \"min\"), plural(secs, \"sec\"))\r\n    return \"%s\" % plural(secs, \"sec\")\r\n\r\n\r\ndef chdir_top():\r\n\tos.chdir(os.path.join(os.path.dirname(__file__), \"..\"))\r\n\r\n\r\ndef group(list, size):\r\n\ti = 0\r\n\twhile list[i:]:\r\n\t\tyield list[i:i + size]\r\n\t\ti += size\r\n\r\n\r\ndef uniquify(array):\r\n\treturn list(set(array))\r\n\r\n\r\ndef memoize(func):\r\n\tmemory = {}\r\n\tdef __decorated(*args):\r\n\t\tif args not in memory:\r\n\t\t\tmemory[args] = func(*args)\r\n\t\treturn memory[args]\r\n\treturn __decorated\r\n\r\n\r\ndef get_sumatrapdf_version():\r\n\tpath = os.path.join(os.path.dirname(__file__), \"..\", \"src\", \"Version.h\")\r\n\treturn re.findall(r'CURR_VERSION (\\d+(?:\\.\\d+)*)', open(path).read())[0]\r\n"
  },
  {
    "path": "scripts/vc.bat",
    "content": "@ECHO OFF\r\n\r\nREM append ..\\bin to PATH to make nasm.exe available\r\nFOR %%p IN (nasm.exe) DO IF \"%%~$PATH:p\" == \"\" SET PATH=%PATH%;%~dp0..\\bin\r\n\r\nIF EXIST C:\\Python27\\python.exe SET PATH=%PATH%;C:\\Python27\r\n\r\nREM for an alternative approach, see\r\nREM https://github.com/HaxeFoundation/hxcpp/blob/master/toolchain/msvc-setup.bat\r\n\r\nIF \"%1\" == \"2015\" GOTO VS_2015\r\nIF \"%1\" == \"2013\" GOTO VS_2013\r\nIF EXIST \"%VS140COMNTOOLS%\\vsvars32.bat\" GOTO VS_2015\r\nIF EXIST \"%VS120COMNTOOLS%\\vsvars32.bat\" GOTO VS_2013\r\n\r\nECHO Visual Studio 2013 or 2015 doesn't seem to be installed\r\nEXIT /B 1\r\n\r\n:VS_2015\r\nCALL \"%VS140COMNTOOLS%\\vsvars32.bat\"\r\nSET _VS_VERSION=VS 2015\r\nREM defining _USING_V140_SDK71_ is only needed for MFC/ATL headers\r\nGOTO SELECT_PLATFORM\r\n\r\n:VS_2013\r\nCALL \"%VS120COMNTOOLS%\\vsvars32.bat\"\r\nSET _VS_VERSION=VS 2013\r\nREM defining _USING_V120_SDK71_ is only needed for MFC/ATL headers\r\nGOTO SELECT_PLATFORM\r\n\r\n:SELECT_PLATFORM\r\nIF NOT \"%ProgramFiles(x86)%\"==\"\" GOTO XP_WIN64\r\nREM TODO: for /analyze, we shouldn't use XP toolset\r\nGOTO XP_WIN32\r\n\r\n:XP_WIN32\r\nECHO Setting up %_VS_VERSION% with XP toolkit for Win32\r\nSET \"INCLUDE=%PROGRAMFILES%\\Microsoft SDKs\\Windows\\7.1A\\Include;%INCLUDE%\"\r\nSET \"PATH=%PROGRAMFILES%\\Microsoft SDKs\\Windows\\7.1A\\Bin;%PATH%\"\r\nSET \"LIB=%PROGRAMFILES%\\Microsoft SDKs\\Windows\\7.1A\\Lib;%LIB%\"\r\nEXIT /B\r\n\r\n:XP_WIN64\r\nECHO Setting up %_VS_VERSION% with XP toolkit for Win64\r\nSET \"INCLUDE=%ProgramFiles(x86)%\\Microsoft SDKs\\Windows\\7.1A\\Include;%INCLUDE%\"\r\nSET \"PATH=%ProgramFiles(x86)%\\Microsoft SDKs\\Windows\\7.1A\\Bin;%PATH%\"\r\nSET \"LIB=%ProgramFiles(x86)%\\Microsoft SDKs\\Windows\\7.1A\\Lib;%LIB%\"\r\n@REM TODO: should it rather be ...?\r\n@REM SET LIB=%ProgramFiles(x86)%\\Microsoft SDKs\\Windows\\7.1A\\Lib\\x64;%LIB%\r\nEXIT /B\r\n"
  },
  {
    "path": "src/AppPrefs.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"FileTransactions.h\"\r\n#include \"FileUtil.h\"\r\n#include \"FileWatcher.h\"\r\n#include \"UITask.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EbookEngine.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"FileHistory.h\"\r\n#include \"GlobalPrefs.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"ParseCommandLine.h\"\r\n#include \"WindowInfo.h\"\r\n#include \"AppPrefs.h\"\r\n#include \"AppTools.h\"\r\n#include \"Favorites.h\"\r\n#include \"Toolbar.h\"\r\n#include \"Translations.h\"\r\n\r\n#define PREFS_FILE_NAME     L\"SumatraPDF-settings.txt\"\r\n\r\nstatic WatchedFile * gWatchedSettingsFile = nullptr;\r\n\r\n// number of weeks past since 2011-01-01\r\nstatic int GetWeekCount()\r\n{\r\n    SYSTEMTIME date20110101 = { 0 };\r\n    date20110101.wYear = 2011; date20110101.wMonth = 1; date20110101.wDay = 1;\r\n    FILETIME origTime, currTime;\r\n    BOOL ok = SystemTimeToFileTime(&date20110101, &origTime);\r\n    CrashIf(!ok);\r\n    GetSystemTimeAsFileTime(&currTime);\r\n    return (currTime.dwHighDateTime - origTime.dwHighDateTime) / 1408;\r\n    // 1408 == (10 * 1000 * 1000 * 60 * 60 * 24 * 7) / (1 << 32)\r\n}\r\n\r\nstatic int cmpFloat(const void *a, const void *b)\r\n{\r\n    return *(float *)a < *(float *)b ? -1 : *(float *)a > *(float *)b ? 1 : 0;\r\n}\r\n\r\nnamespace prefs {\r\n\r\nWCHAR *GetSettingsPath()\r\n{\r\n    return AppGenDataFilename(PREFS_FILE_NAME);\r\n}\r\n\r\n/* Caller needs to prefs::CleanUp() */\r\nbool Load()\r\n{\r\n    CrashIf(gGlobalPrefs);\r\n\r\n    ScopedMem<WCHAR> path(GetSettingsPath());\r\n    ScopedMem<char> prefsData(file::ReadAll(path, nullptr));\r\n    gGlobalPrefs = NewGlobalPrefs(prefsData);\r\n    CrashAlwaysIf(!gGlobalPrefs);\r\n\r\n    // in pre-release builds between 3.1.10079 and 3.1.10377,\r\n    // RestoreSession was a string with the additional option \"auto\"\r\n    // TODO: remove this after 3.2 has been released\r\n#if defined(DEBUG) || defined(SVN_PRE_RELEASE_VER)\r\n    if (!gGlobalPrefs->restoreSession && prefsData && str::Find(prefsData, \"\\nRestoreSession = auto\"))\r\n        gGlobalPrefs->restoreSession = true;\r\n#endif\r\n\r\n#ifdef DISABLE_EBOOK_UI\r\n    if (!prefsData || !str::Find(prefsData, \"UseFixedPageUI =\"))\r\n        gGlobalPrefs->ebookUI.useFixedPageUI = gGlobalPrefs->chmUI.useFixedPageUI = true;\r\n#endif\r\n#ifdef DISABLE_TABS\r\n    if (!prefsData || !str::Find(prefsData, \"UseTabs =\"))\r\n        gGlobalPrefs->useTabs = false;\r\n#endif\r\n\r\n    if (!gGlobalPrefs->uiLanguage || !trans::ValidateLangCode(gGlobalPrefs->uiLanguage)) {\r\n        // guess the ui language on first start\r\n        str::ReplacePtr(&gGlobalPrefs->uiLanguage, trans::DetectUserLang());\r\n    }\r\n    gGlobalPrefs->lastPrefUpdate = file::GetModificationTime(path);\r\n    gGlobalPrefs->defaultDisplayModeEnum = conv::ToDisplayMode(gGlobalPrefs->defaultDisplayMode, DM_AUTOMATIC);\r\n    gGlobalPrefs->defaultZoomFloat = conv::ToZoom(gGlobalPrefs->defaultZoom, ZOOM_ACTUAL_SIZE);\r\n    CrashIf(!IsValidZoom(gGlobalPrefs->defaultZoomFloat));\r\n\r\n    int weekDiff = GetWeekCount() - gGlobalPrefs->openCountWeek;\r\n    gGlobalPrefs->openCountWeek = GetWeekCount();\r\n    if (weekDiff > 0) {\r\n        // \"age\" openCount statistics (cut in in half after every week)\r\n        for (DisplayState *ds : *gGlobalPrefs->fileStates) {\r\n            ds->openCount >>= weekDiff;\r\n        }\r\n    }\r\n\r\n    // make sure that zoom levels are in the order expected by DisplayModel\r\n    gGlobalPrefs->zoomLevels->Sort(cmpFloat);\r\n    while (gGlobalPrefs->zoomLevels->Count() > 0 &&\r\n           gGlobalPrefs->zoomLevels->At(0) < ZOOM_MIN) {\r\n        gGlobalPrefs->zoomLevels->PopAt(0);\r\n    }\r\n    while (gGlobalPrefs->zoomLevels->Count() > 0 &&\r\n           gGlobalPrefs->zoomLevels->Last() > ZOOM_MAX) {\r\n        gGlobalPrefs->zoomLevels->Pop();\r\n    }\r\n\r\n    // TODO: verify that all states have a non-nullptr file path?\r\n    gFileHistory.UpdateStatesSource(gGlobalPrefs->fileStates);\r\n    SetDefaultEbookFont(gGlobalPrefs->ebookUI.fontName, gGlobalPrefs->ebookUI.fontSize);\r\n\r\n    if (!file::Exists(path))\r\n        Save();\r\n    return true;\r\n}\r\n\r\n// called whenever global preferences change or a file is\r\n// added or removed from gFileHistory (in order to keep\r\n// the list of recently opened documents in sync)\r\nbool Save()\r\n{\r\n    // don't save preferences without the proper permission\r\n    if (!HasPermission(Perm_SavePreferences))\r\n        return false;\r\n\r\n    // update display states for all tabs\r\n    for (WindowInfo *win : gWindows) {\r\n        for (TabInfo *tab : win->tabs) {\r\n            UpdateTabFileDisplayStateForWin(win, tab);\r\n        }\r\n    }\r\n\r\n    // remove entries which should (no longer) be remembered\r\n    gFileHistory.Purge(!gGlobalPrefs->rememberStatePerDocument);\r\n    // update display mode and zoom fields from internal values\r\n    str::ReplacePtr(&gGlobalPrefs->defaultDisplayMode, conv::FromDisplayMode(gGlobalPrefs->defaultDisplayModeEnum));\r\n    conv::FromZoom(&gGlobalPrefs->defaultZoom, gGlobalPrefs->defaultZoomFloat);\r\n\r\n    ScopedMem<WCHAR> path(GetSettingsPath());\r\n    CrashIfDebugOnly(!path);\r\n    if (!path)\r\n        return false;\r\n    size_t prevPrefsDataSize = 0;\r\n    ScopedMem<char> prevPrefsData(file::ReadAll(path, &prevPrefsDataSize));\r\n    size_t prefsDataSize = 0;\r\n    ScopedMem<char> prefsData(SerializeGlobalPrefs(gGlobalPrefs, prevPrefsData, &prefsDataSize));\r\n\r\n    CrashIf(!prefsData || 0 == prefsDataSize);\r\n    if (!prefsData || 0 == prefsDataSize)\r\n        return false;\r\n\r\n    // only save if anything's changed at all\r\n    if (prevPrefsDataSize == prefsDataSize && str::Eq(prefsData, prevPrefsData))\r\n        return true;\r\n\r\n    FileTransaction trans;\r\n    bool ok = trans.WriteAll(path, prefsData, prefsDataSize) && trans.Commit();\r\n    if (!ok)\r\n        return false;\r\n    gGlobalPrefs->lastPrefUpdate = file::GetModificationTime(path);\r\n    return true;\r\n}\r\n\r\n// refresh the preferences when a different SumatraPDF process saves them\r\n// or if they are edited by the user using a text editor\r\nbool Reload()\r\n{\r\n    ScopedMem<WCHAR> path(GetSettingsPath());\r\n    if (!file::Exists(path))\r\n        return false;\r\n\r\n    // make sure that the settings file is readable - else wait\r\n    // a short while to prevent accidental dataloss\r\n    int tryAgainCount = 5;\r\n    HANDLE h = file::OpenReadOnly(path);\r\n    while (INVALID_HANDLE_VALUE == h && tryAgainCount-- > 0) {\r\n        Sleep(200);\r\n        h = file::OpenReadOnly(path);\r\n    }\r\n    if (INVALID_HANDLE_VALUE == h) {\r\n        // prefer not reloading to resetting all settings\r\n        return false;\r\n    }\r\n\r\n    ScopedHandle hScope(h);\r\n\r\n    FILETIME time = file::GetModificationTime(path);\r\n    if (FileTimeEq(time, gGlobalPrefs->lastPrefUpdate))\r\n        return true;\r\n\r\n    ScopedMem<char> uiLanguage(str::Dup(gGlobalPrefs->uiLanguage));\r\n    bool showToolbar = gGlobalPrefs->showToolbar;\r\n    bool invertColors = gGlobalPrefs->fixedPageUI.invertColors;\r\n\r\n    gFileHistory.UpdateStatesSource(nullptr);\r\n    CleanUp();\r\n\r\n    bool ok = Load();\r\n    CrashAlwaysIf(!ok || !gGlobalPrefs);\r\n\r\n    gGlobalPrefs->fixedPageUI.invertColors = invertColors;\r\n\r\n    // TODO: about window doesn't have to be at position 0\r\n    if (gWindows.Count() > 0 && gWindows.At(0)->IsAboutWindow()) {\r\n        gWindows.At(0)->DeleteInfotip();\r\n        gWindows.At(0)->staticLinks.Reset();\r\n        gWindows.At(0)->RedrawAll(true);\r\n    }\r\n\r\n    if (!str::Eq(uiLanguage, gGlobalPrefs->uiLanguage))\r\n        SetCurrentLanguageAndRefreshUI(gGlobalPrefs->uiLanguage);\r\n\r\n    for (WindowInfo *win : gWindows) {\r\n        if (gGlobalPrefs->showToolbar != showToolbar)\r\n            ShowOrHideToolbar(win);\r\n        UpdateFavoritesTree(win);\r\n    }\r\n\r\n    UpdateDocumentColors();\r\n\r\n    return true;\r\n}\r\n\r\nvoid UpdateGlobalPrefs(const CommandLineInfo& i) {\r\n    if (i.inverseSearchCmdLine) {\r\n        str::ReplacePtr(&gGlobalPrefs->inverseSearchCmdLine, i.inverseSearchCmdLine);\r\n        gGlobalPrefs->enableTeXEnhancements = true;\r\n    }\r\n    gGlobalPrefs->fixedPageUI.invertColors = i.invertColors;\r\n\r\n    for (size_t n = 0; n <i.globalPrefArgs.Count(); n++) {\r\n        if (str::EqI(i.globalPrefArgs.At(n), L\"-esc-to-exit\")) {\r\n            gGlobalPrefs->escToExit = true;\r\n        } else if (str::EqI(i.globalPrefArgs.At(n), L\"-bgcolor\") ||\r\n                   str::EqI(i.globalPrefArgs.At(n), L\"-bg-color\")) {\r\n            // -bgcolor is for backwards compat (was used pre-1.3)\r\n            // -bg-color is for consistency\r\n            ParseColor(&gGlobalPrefs->mainWindowBackground, i.globalPrefArgs.At(++n));\r\n        } else if (str::EqI(i.globalPrefArgs.At(n), L\"-set-color-range\")) {\r\n            ParseColor(&gGlobalPrefs->fixedPageUI.textColor, i.globalPrefArgs.At(++n));\r\n            ParseColor(&gGlobalPrefs->fixedPageUI.backgroundColor, i.globalPrefArgs.At(++n));\r\n        } else if (str::EqI(i.globalPrefArgs.At(n), L\"-fwdsearch-offset\")) {\r\n            gGlobalPrefs->forwardSearch.highlightOffset = _wtoi(i.globalPrefArgs.At(++n));\r\n            gGlobalPrefs->enableTeXEnhancements = true;\r\n        } else if (str::EqI(i.globalPrefArgs.At(n), L\"-fwdsearch-width\")) {\r\n            gGlobalPrefs->forwardSearch.highlightWidth = _wtoi(i.globalPrefArgs.At(++n));\r\n            gGlobalPrefs->enableTeXEnhancements = true;\r\n        } else if (str::EqI(i.globalPrefArgs.At(n), L\"-fwdsearch-color\")) {\r\n            ParseColor(&gGlobalPrefs->forwardSearch.highlightColor, i.globalPrefArgs.At(++n));\r\n            gGlobalPrefs->enableTeXEnhancements = true;\r\n        } else if (str::EqI(i.globalPrefArgs.At(n), L\"-fwdsearch-permanent\")) {\r\n            gGlobalPrefs->forwardSearch.highlightPermanent = _wtoi(i.globalPrefArgs.At(++n));\r\n            gGlobalPrefs->enableTeXEnhancements = true;\r\n        } else if (str::EqI(i.globalPrefArgs.At(n), L\"-manga-mode\")) {\r\n            const WCHAR *s = i.globalPrefArgs.At(++n);\r\n            gGlobalPrefs->comicBookUI.cbxMangaMode = str::EqI(L\"true\", s) || str::Eq(L\"1\", s);\r\n        }\r\n    }\r\n}\r\n\r\nvoid CleanUp()\r\n{\r\n    DeleteGlobalPrefs(gGlobalPrefs);\r\n    gGlobalPrefs = nullptr;\r\n}\r\n\r\nclass SettingsFileObserver : public FileChangeObserver {\r\npublic:\r\n    SettingsFileObserver() { }\r\n\r\n    virtual void OnFileChanged() {\r\n        // don't Reload directly so as to prevent potential race conditions\r\n        uitask::Post([] { prefs::Reload(); });\r\n    }\r\n};\r\n\r\nvoid RegisterForFileChanges()\r\n{\r\n    if (!HasPermission(Perm_SavePreferences))\r\n        return;\r\n\r\n    CrashIf(gWatchedSettingsFile); // only call me once\r\n    ScopedMem<WCHAR> path(GetSettingsPath());\r\n    gWatchedSettingsFile = FileWatcherSubscribe(path, new SettingsFileObserver());\r\n}\r\n\r\nvoid UnregisterForFileChanges()\r\n{\r\n    FileWatcherUnsubscribe(gWatchedSettingsFile);\r\n}\r\n\r\n}; // namespace prefs\r\n"
  },
  {
    "path": "src/AppPrefs.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: GPLv3 */\n\n/* enum from windowState */\nenum {\n    WIN_STATE_NORMAL = 1, /* use remembered position and size */\n    WIN_STATE_MAXIMIZED,  /* ignore position and size, maximize the window */\n    WIN_STATE_FULLSCREEN,\n    WIN_STATE_MINIMIZED,\n};\n\nnamespace prefs {\n\nWCHAR *GetSettingsPath();\n\nbool Load();\nbool Save();\nbool Reload();\nvoid CleanUp();\n\nvoid RegisterForFileChanges();\nvoid UnregisterForFileChanges();\nvoid UpdateGlobalPrefs(const CommandLineInfo& i);\n\n};\n"
  },
  {
    "path": "src/AppTools.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"WinDynCalls.h\"\r\n#include \"CmdLineParser.h\"\r\n#include \"DbgHelpDyn.h\"\r\n#include \"FileUtil.h\"\r\n#include \"WinUtil.h\"\r\n// ui\r\n#include \"AppTools.h\"\r\n#include \"Translations.h\"\r\n#include \"Version.h\"\r\n\r\n#define REG_PATH_UNINST L\"Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Uninstall\\\\\" APP_NAME_STR\r\n\r\n/* Returns true, if a Registry entry indicates that this executable has been\r\n   created by an installer (and should be updated through an installer) */\r\nbool HasBeenInstalled()\r\n{\r\n    ScopedMem<WCHAR> installedPath;\r\n    // cf. GetInstallationDir() in installer\\Installer.cpp\r\n    installedPath.Set(ReadRegStr(HKEY_CURRENT_USER, REG_PATH_UNINST, L\"InstallLocation\"));\r\n    if (!installedPath)\r\n        installedPath.Set(ReadRegStr(HKEY_LOCAL_MACHINE, REG_PATH_UNINST, L\"InstallLocation\"));\r\n    if (!installedPath)\r\n        return false;\r\n\r\n    ScopedMem<WCHAR> exePath(GetExePath());\r\n    if (!exePath)\r\n        return false;\r\n\r\n    if (!str::EndsWithI(installedPath, L\".exe\"))\r\n        installedPath.Set(path::Join(installedPath, path::GetBaseName(exePath)));\r\n    return path::IsSame(installedPath, exePath);\r\n}\r\n\r\n/* Return false if this program has been started from \"Program Files\" directory\r\n   (which is an indicator that it has been installed) or from the last known\r\n   location of a SumatraPDF installation: */\r\nbool IsRunningInPortableMode()\r\n{\r\n    // cache the result so that it will be consistent during the lifetime of the process\r\n    static int sCacheIsPortable = -1; // -1 == uninitialized, 0 == installed, 1 == portable\r\n    if (sCacheIsPortable != -1)\r\n        return sCacheIsPortable != 0;\r\n    sCacheIsPortable = 1;\r\n\r\n    if (HasBeenInstalled()) {\r\n        sCacheIsPortable = 0;\r\n        return false;\r\n    }\r\n\r\n    ScopedMem<WCHAR> exePath(GetExePath());\r\n    ScopedMem<WCHAR> programFilesDir(GetSpecialFolder(CSIDL_PROGRAM_FILES));\r\n    // if we can't get a path, assume we're not running from \"Program Files\"\r\n    if (!exePath || !programFilesDir)\r\n        return true;\r\n\r\n    // check if one of the exePath's parent directories is \"Program Files\"\r\n    // (or a junction to it)\r\n    WCHAR *baseName;\r\n    while ((baseName = (WCHAR*)path::GetBaseName(exePath)) > exePath) {\r\n        baseName[-1] = '\\0';\r\n        if (path::IsSame(programFilesDir, exePath)) {\r\n            sCacheIsPortable = 0;\r\n            return false;\r\n        }\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nstatic ScopedMem<WCHAR> gAppDataPath;\r\n\r\nvoid SetAppDataPath(const WCHAR *path)\r\n{\r\n    gAppDataPath.Set(path::Normalize(path));\r\n}\r\n\r\n/* Generate the full path for a filename used by the app in the userdata path. */\r\n/* Caller needs to free() the result. */\r\nWCHAR *AppGenDataFilename(const WCHAR *fileName)\r\n{\r\n    if (!fileName)\r\n        return nullptr;\r\n\r\n    if (gAppDataPath && dir::Exists(gAppDataPath)) {\r\n        return path::Join(gAppDataPath, fileName);\r\n    }\r\n\r\n    if (IsRunningInPortableMode()) {\r\n        /* Use the same path as the binary */\r\n        return path::GetAppPath(fileName);\r\n    }\r\n\r\n    /* Use %APPDATA% */\r\n    ScopedMem<WCHAR> path(GetSpecialFolder(CSIDL_APPDATA, true));\r\n    CrashIf(!path);\r\n    if (!path)\r\n        return nullptr;\r\n    path.Set(path::Join(path, APP_NAME_STR));\r\n    if (!path)\r\n        return nullptr;\r\n    bool ok = dir::Create(path);\r\n    if (!ok)\r\n        return nullptr;\r\n    return path::Join(path, fileName);\r\n}\r\n\r\n/*\r\nStructure of registry entries for associating Sumatra with PDF files.\r\n\r\nThe following paths exist under both HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER.\r\nHKCU has precedence over HKLM.\r\n\r\nSoftware\\Classes\\.pdf default key is name of reg entry describing the app\r\n  handling opening PDF files. In our case it's SumatraPDF\r\nSoftware\\Classes\\.pdf\\OpenWithProgids\r\n  should contain SumatraPDF so that it's easier for the user to later\r\n  restore SumatraPDF to become the default app through Windows Explorer,\r\n  cf. http://msdn.microsoft.com/en-us/library/cc144148(v=vs.85).aspx\r\n\r\nSoftware\\Classes\\SumatraPDF\\DefaultIcon = $exePath,1\r\n  1 means the second icon resource within the executable\r\nSoftware\\Classes\\SumatraPDF\\shell\\open\\command = \"$exePath\" \"%1\"\r\n  tells how to call sumatra to open PDF file. %1 is replaced by PDF file path\r\n\r\nSoftware\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\.pdf\\Progid\r\n  should be SumatraPDF (FoxIt takes it over); only needed for HKEY_CURRENT_USER\r\n  TODO: No other app seems to set this one, and only UserChoice seems to make\r\n        a difference - is this still required for Windows XP?\r\n\r\nSoftware\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\.pdf\\Application\r\n  should be SumatraPDF.exe; only needed for HKEY_CURRENT_USER\r\n  Windows XP seems to use this instead of:\r\n\r\nSoftware\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\.pdf\\UserChoice\\Progid\r\n  should be SumatraPDF as well (also only needed for HKEY_CURRENT_USER);\r\n  this key is used for remembering a user's choice with Explorer's Open With dialog\r\n  and can't be written to - so we delete it instead!\r\n\r\nHKEY_CLASSES_ROOT\\.pdf\\OpenWithList\r\n  list of all apps that can be used to open PDF files. We don't touch that.\r\n\r\nHKEY_CLASSES_ROOT\\.pdf default comes from either HKCU\\Software\\Classes\\.pdf or\r\nHKLM\\Software\\Classes\\.pdf (HKCU has priority over HKLM)\r\n\r\nNote: When making changes below, please also adjust WriteExtendedFileExtensionInfo(),\r\nUnregisterFromBeingDefaultViewer() and RemoveOwnRegistryKeys() in Installer.cpp.\r\n\r\n*/\r\n#define REG_CLASSES_APP     L\"Software\\\\Classes\\\\\" APP_NAME_STR\r\n#define REG_CLASSES_PDF     L\"Software\\\\Classes\\\\.pdf\"\r\n\r\n#define REG_WIN_CURR        L\"Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\"\r\n#define REG_EXPLORER_PDF_EXT REG_WIN_CURR L\"\\\\Explorer\\\\FileExts\\\\.pdf\"\r\n\r\nvoid DoAssociateExeWithPdfExtension(HKEY hkey)\r\n{\r\n    ScopedMem<WCHAR> exePath(GetExePath());\r\n    if (!exePath)\r\n        return;\r\n\r\n    ScopedMem<WCHAR> prevHandler(nullptr);\r\n    // Remember the previous default app for the Uninstaller\r\n    prevHandler.Set(ReadRegStr(hkey, REG_CLASSES_PDF, nullptr));\r\n    if (prevHandler && !str::Eq(prevHandler, APP_NAME_STR))\r\n        WriteRegStr(hkey, REG_CLASSES_APP, L\"previous.pdf\", prevHandler);\r\n\r\n    WriteRegStr(hkey, REG_CLASSES_APP, nullptr, _TR(\"PDF Document\"));\r\n    WCHAR *icon_path = str::Join(exePath, L\",1\");\r\n    WriteRegStr(hkey, REG_CLASSES_APP L\"\\\\DefaultIcon\", nullptr, icon_path);\r\n    free(icon_path);\r\n\r\n    WriteRegStr(hkey, REG_CLASSES_APP L\"\\\\shell\", nullptr, L\"open\");\r\n\r\n    ScopedMem<WCHAR> cmdPath(str::Format(L\"\\\"%s\\\" \\\"%%1\\\" %%*\", exePath.Get())); // \"${exePath}\" \"%1\" %*\r\n    bool ok = WriteRegStr(hkey, REG_CLASSES_APP L\"\\\\shell\\\\open\\\\command\", nullptr, cmdPath);\r\n\r\n    // also register for printing\r\n    cmdPath.Set(str::Format(L\"\\\"%s\\\" -print-to-default \\\"%%1\\\"\", exePath.Get())); // \"${exePath}\" -print-to-default \"%1\"\r\n    WriteRegStr(hkey, REG_CLASSES_APP L\"\\\\shell\\\\print\\\\command\", nullptr, cmdPath);\r\n\r\n    // also register for printing to specific printer\r\n    cmdPath.Set(str::Format(L\"\\\"%s\\\" -print-to \\\"%%2\\\" \\\"%%1\\\"\", exePath.Get())); // \"${exePath}\" -print-to \"%2\" \"%1\"\r\n    WriteRegStr(hkey, REG_CLASSES_APP L\"\\\\shell\\\\printto\\\\command\", nullptr, cmdPath);\r\n\r\n    // Only change the association if we're confident, that we've registered ourselves well enough\r\n    if (!ok)\r\n        return;\r\n\r\n    WriteRegStr(hkey, REG_CLASSES_PDF, nullptr, APP_NAME_STR);\r\n    // TODO: also add SumatraPDF to the Open With lists for the other supported extensions?\r\n    WriteRegStr(hkey, REG_CLASSES_PDF L\"\\\\OpenWithProgids\", APP_NAME_STR, L\"\");\r\n    if (hkey == HKEY_CURRENT_USER) {\r\n        WriteRegStr(hkey, REG_EXPLORER_PDF_EXT, L\"Progid\", APP_NAME_STR);\r\n        CrashIf(hkey == 0); // to appease prefast\r\n        SHDeleteValue(hkey, REG_EXPLORER_PDF_EXT, L\"Application\");\r\n        DeleteRegKey(hkey, REG_EXPLORER_PDF_EXT L\"\\\\UserChoice\", true);\r\n    }\r\n}\r\n\r\n// verify that all registry entries that need to be set in order to associate\r\n// Sumatra with .pdf files exist and have the right values\r\nbool IsExeAssociatedWithPdfExtension()\r\n{\r\n    // this one doesn't have to exist but if it does, it must be APP_NAME_STR\r\n    ScopedMem<WCHAR> tmp(ReadRegStr(HKEY_CURRENT_USER, REG_EXPLORER_PDF_EXT, L\"Progid\"));\r\n    if (tmp && !str::Eq(tmp, APP_NAME_STR))\r\n        return false;\r\n\r\n    // this one doesn't have to exist but if it does, it must be APP_NAME_STR.exe\r\n    tmp.Set(ReadRegStr(HKEY_CURRENT_USER, REG_EXPLORER_PDF_EXT, L\"Application\"));\r\n    if (tmp && !str::EqI(tmp, APP_NAME_STR L\".exe\"))\r\n        return false;\r\n\r\n    // this one doesn't have to exist but if it does, it must be APP_NAME_STR\r\n    tmp.Set(ReadRegStr(HKEY_CURRENT_USER, REG_EXPLORER_PDF_EXT L\"\\\\UserChoice\", L\"Progid\"));\r\n    if (tmp && !str::Eq(tmp, APP_NAME_STR))\r\n        return false;\r\n\r\n    // HKEY_CLASSES_ROOT\\.pdf default key must exist and be equal to APP_NAME_STR\r\n    tmp.Set(ReadRegStr(HKEY_CLASSES_ROOT, L\".pdf\", nullptr));\r\n    if (!str::Eq(tmp, APP_NAME_STR))\r\n        return false;\r\n\r\n    // HKEY_CLASSES_ROOT\\SumatraPDF\\shell\\open default key must be: open\r\n    tmp.Set(ReadRegStr(HKEY_CLASSES_ROOT, APP_NAME_STR L\"\\\\shell\", nullptr));\r\n    if (!str::EqI(tmp, L\"open\"))\r\n        return false;\r\n\r\n    // HKEY_CLASSES_ROOT\\SumatraPDF\\shell\\open\\command default key must be: \"${exe_path}\" \"%1\"\r\n    tmp.Set(ReadRegStr(HKEY_CLASSES_ROOT, APP_NAME_STR L\"\\\\shell\\\\open\\\\command\", nullptr));\r\n    if (!tmp)\r\n        return false;\r\n\r\n    WStrVec argList;\r\n    ParseCmdLine(tmp, argList);\r\n    ScopedMem<WCHAR> exePath(GetExePath());\r\n    if (!exePath || !argList.Contains(L\"%1\") || !str::Find(tmp, L\"\\\"%1\\\"\"))\r\n        return false;\r\n\r\n    return path::IsSame(exePath, argList.At(0));\r\n}\r\n\r\n// List of rules used to detect TeX editors.\r\n\r\n// type of path information retrieved from the registy\r\nenum EditorPathType {\r\n    BinaryPath,         // full path to the editor's binary file\r\n    BinaryDir,          // directory containing the editor's binary file\r\n    SiblingPath,        // full path to a sibling file of the editor's binary file\r\n};\r\n\r\nstatic struct {\r\n    const WCHAR *  BinaryFilename;      // Editor's binary file name\r\n    const WCHAR *  InverseSearchArgs;   // Parameters to be passed to the editor;\r\n                                        // use placeholder '%f' for path to source file and '%l' for line number.\r\n    EditorPathType Type;                // Type of the path information obtained from the registry\r\n    HKEY           RegRoot;             // Root of the regkey\r\n    const WCHAR *  RegKey;              // Registry key path\r\n    const WCHAR *  RegValue;            // Registry value name\r\n} editor_rules[] = {\r\n    L\"WinEdt.exe\",      L\"\\\"[Open(|%f|);SelPar(%l,8)]\\\"\",   BinaryPath,\r\n                        HKEY_LOCAL_MACHINE, REG_WIN_CURR L\"\\\\App Paths\\\\WinEdt.exe\", nullptr,\r\n    L\"WinEdt.exe\",      L\"\\\"[Open(|%f|);SelPar(%l,8)]\\\"\",   BinaryDir,\r\n                        HKEY_CURRENT_USER,  L\"Software\\\\WinEdt\", L\"Install Root\",\r\n    L\"notepad++.exe\",   L\"-n%l \\\"%f\\\"\",                     BinaryPath,\r\n                        HKEY_LOCAL_MACHINE, REG_WIN_CURR L\"\\\\App Paths\\\\notepad++.exe\", nullptr,\r\n    L\"notepad++.exe\",   L\"-n%l \\\"%f\\\"\",                     BinaryDir,\r\n                        HKEY_LOCAL_MACHINE, L\"Software\\\\Notepad++\", nullptr,\r\n    L\"notepad++.exe\",   L\"-n%l \\\"%f\\\"\",                     BinaryPath,\r\n                        HKEY_LOCAL_MACHINE, REG_WIN_CURR L\"\\\\Uninstall\\\\Notepad++\", L\"DisplayIcon\",\r\n    L\"TeXnicCenter.exe\",L\"/ddecmd \\\"[goto('%f', '%l')]\\\"\",  BinaryDir,\r\n                        HKEY_LOCAL_MACHINE, L\"Software\\\\ToolsCenter\\\\TeXnicCenterNT\", L\"AppPath\",\r\n    L\"TeXnicCenter.exe\",L\"/ddecmd \\\"[goto('%f', '%l')]\\\"\",  BinaryDir,\r\n                        HKEY_LOCAL_MACHINE, REG_WIN_CURR L\"\\\\Uninstall\\\\TeXnicCenter_is1\", L\"InstallLocation\",\r\n    L\"TeXnicCenter.exe\",L\"/ddecmd \\\"[goto('%f', '%l')]\\\"\",  BinaryDir,\r\n                        HKEY_LOCAL_MACHINE, REG_WIN_CURR L\"\\\\Uninstall\\\\TeXnicCenter Alpha_is1\", L\"InstallLocation\",\r\n    L\"TEXCNTR.exe\",     L\"/ddecmd \\\"[goto('%f', '%l')]\\\"\",  BinaryDir,\r\n                        HKEY_LOCAL_MACHINE, L\"Software\\\\ToolsCenter\\\\TeXnicCenter\", L\"AppPath\",\r\n    L\"TEXCNTR.exe\",     L\"/ddecmd \\\"[goto('%f', '%l')]\\\"\",  BinaryDir,\r\n                        HKEY_LOCAL_MACHINE, REG_WIN_CURR L\"\\\\Uninstall\\\\TeXnicCenter_is1\", L\"InstallLocation\",\r\n    L\"WinShell.exe\",    L\"-c \\\"%f\\\" -l %l\",                 BinaryDir,\r\n                        HKEY_LOCAL_MACHINE, REG_WIN_CURR L\"\\\\Uninstall\\\\WinShell_is1\", L\"InstallLocation\",\r\n    L\"gvim.exe\",        L\"\\\"%f\\\" +%l\",                      BinaryPath,\r\n                        HKEY_LOCAL_MACHINE, L\"Software\\\\Vim\\\\Gvim\", L\"path\",\r\n    // TODO: add this rule only if the latex-suite for ViM is installed (http://vim-latex.sourceforge.net/documentation/latex-suite.txt)\r\n    L\"gvim.exe\",        L\"-c \\\":RemoteOpen +%l %f\\\"\",       BinaryPath,\r\n                        HKEY_LOCAL_MACHINE, L\"Software\\\\Vim\\\\Gvim\", L\"path\",\r\n    L\"texmaker.exe\",    L\"\\\"%f\\\" -line %l\",                 SiblingPath,\r\n                        HKEY_LOCAL_MACHINE, REG_WIN_CURR L\"\\\\Uninstall\\\\Texmaker\", L\"UninstallString\",\r\n    L\"TeXworks.exe\",    L\"-p=%l \\\"%f\\\"\",                    BinaryDir,\r\n                        HKEY_LOCAL_MACHINE, REG_WIN_CURR L\"\\\\Uninstall\\\\{41DA4817-4D2A-4D83-AD02-6A2D95DC8DCB}_is1\", L\"InstallLocation\",\r\n    // TODO: find a way to detect where emacs is installed\r\n    // L\"emacsclientw.exe\",L\"+%l \\\"%f\\\"\", BinaryPath, HKEY_LOCAL_MACHINE, L\"???\", L\"???\",\r\n};\r\n\r\n// Detect TeX editors installed on the system and construct the\r\n// corresponding inverse search commands.\r\n//\r\n// Parameters:\r\n//      hwndCombo   -- (optional) handle to a combo list that will be filled with the list of possible inverse search commands.\r\n// Returns:\r\n//      the inverse search command of the first detected editor (the caller needs to free() the result).\r\nWCHAR *AutoDetectInverseSearchCommands(HWND hwndCombo)\r\n{\r\n    WCHAR *firstEditor = nullptr;\r\n    WStrList foundExes;\r\n\r\n    for (int i = 0; i < dimof(editor_rules); i++) {\r\n        ScopedMem<WCHAR> path(ReadRegStr(editor_rules[i].RegRoot, editor_rules[i].RegKey, editor_rules[i].RegValue));\r\n        if (!path)\r\n            continue;\r\n\r\n        ScopedMem<WCHAR> exePath;\r\n        if (editor_rules[i].Type == SiblingPath) {\r\n            // remove file part\r\n            ScopedMem<WCHAR> dir(path::GetDir(path));\r\n            exePath.Set(path::Join(dir, editor_rules[i].BinaryFilename));\r\n        }\r\n        else if (editor_rules[i].Type == BinaryDir)\r\n            exePath.Set(path::Join(path, editor_rules[i].BinaryFilename));\r\n        else // if (editor_rules[i].Type == BinaryPath)\r\n            exePath.Set(path.StealData());\r\n        // don't show duplicate entries\r\n        if (foundExes.FindI(exePath) != -1)\r\n            continue;\r\n        // don't show inexistent paths (and don't try again for them)\r\n        if (!file::Exists(exePath)) {\r\n            foundExes.Append(exePath.StealData());\r\n            continue;\r\n        }\r\n\r\n        ScopedMem<WCHAR> editorCmd(str::Format(L\"\\\"%s\\\" %s\", exePath.Get(), editor_rules[i].InverseSearchArgs));\r\n\r\n        if (!hwndCombo) {\r\n            // no need to fill a combo box: return immeditately after finding an editor.\r\n            return editorCmd.StealData();\r\n        }\r\n\r\n        ComboBox_AddString(hwndCombo, editorCmd);\r\n        if (!firstEditor)\r\n            firstEditor = editorCmd.StealData();\r\n        foundExes.Append(exePath.StealData());\r\n    }\r\n\r\n    // Fall back to notepad as a default handler\r\n    if (!firstEditor) {\r\n        firstEditor = str::Dup(L\"notepad %f\");\r\n        if (hwndCombo)\r\n            ComboBox_AddString(hwndCombo, firstEditor);\r\n    }\r\n    return firstEditor;\r\n}\r\n\r\n#define UWM_DELAYED_SET_FOCUS (WM_APP + 1)\r\n#define UWM_DELAYED_CTRL_BACK (WM_APP + 2)\r\n\r\n// selects all text in an edit box if it's selected either\r\n// through a keyboard shortcut or a non-selecting mouse click\r\n// (or responds to Ctrl+Backspace as nowadays expected)\r\nbool ExtendedEditWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)\r\n{\r\n    UNUSED(lParam);\r\n\r\n    static bool delayFocus = false;\r\n\r\n    switch (message) {\r\n    case WM_LBUTTONDOWN:\r\n        delayFocus = GetFocus() != hwnd;\r\n        return true;\r\n\r\n    case WM_LBUTTONUP:\r\n        if (delayFocus) {\r\n            DWORD sel = Edit_GetSel(hwnd);\r\n            if (LOWORD(sel) == HIWORD(sel))\r\n                PostMessage(hwnd, UWM_DELAYED_SET_FOCUS, 0, 0);\r\n            delayFocus = false;\r\n        }\r\n        return true;\r\n\r\n    case WM_KILLFOCUS:\r\n        return false; // for easier debugging (make setting a breakpoint possible)\r\n\r\n    case WM_SETFOCUS:\r\n        if (!delayFocus)\r\n            PostMessage(hwnd, UWM_DELAYED_SET_FOCUS, 0, 0);\r\n        return true;\r\n\r\n    case UWM_DELAYED_SET_FOCUS:\r\n        Edit_SelectAll(hwnd);\r\n        return true;\r\n\r\n    case WM_KEYDOWN:\r\n        if (VK_BACK != wParam || !IsCtrlPressed() || IsShiftPressed())\r\n            return false;\r\n        PostMessage(hwnd, UWM_DELAYED_CTRL_BACK, 0, 0);\r\n        return true;\r\n\r\n    case UWM_DELAYED_CTRL_BACK:\r\n        {\r\n            ScopedMem<WCHAR> text(win::GetText(hwnd));\r\n            int selStart = LOWORD(Edit_GetSel(hwnd)), selEnd = selStart;\r\n            // remove the rectangle produced by Ctrl+Backspace\r\n            if (selStart > 0 && text[selStart - 1] == '\\x7F') {\r\n                memmove(text + selStart - 1, text + selStart, str::Len(text + selStart - 1) * sizeof(WCHAR));\r\n                win::SetText(hwnd, text);\r\n                selStart = selEnd = selStart - 1;\r\n            }\r\n            // remove the previous word (and any spacing after it)\r\n            for (; selStart > 0 && str::IsWs(text[selStart - 1]); selStart--);\r\n            for (; selStart > 0 && !str::IsWs(text[selStart - 1]); selStart--);\r\n            Edit_SetSel(hwnd, selStart, selEnd);\r\n            SendMessage(hwnd, WM_CLEAR, 0, 0);\r\n        }\r\n        return true;\r\n\r\n    default:\r\n        return false;\r\n    }\r\n}\r\n\r\n/* Default size for the window, happens to be american A4 size (I think) */\r\n#define DEF_PAGE_RATIO          (612.0/792.0)\r\n\r\n#define MIN_WIN_DX 50\r\n#define MIN_WIN_DY 50\r\n\r\nvoid EnsureAreaVisibility(RectI& r)\r\n{\r\n    // adjust to the work-area of the current monitor (not necessarily the primary one)\r\n    RectI work = GetWorkAreaRect(r);\r\n\r\n    // make sure that the window is neither too small nor bigger than the monitor\r\n    if (r.dx < MIN_WIN_DX || r.dx > work.dx)\r\n        r.dx = std::min((int)((double)work.dy * DEF_PAGE_RATIO), work.dx);\r\n    if (r.dy < MIN_WIN_DY || r.dy > work.dy)\r\n        r.dy = work.dy;\r\n\r\n    // check whether the lower half of the window's title bar is\r\n    // inside a visible working area\r\n    int captionDy = GetSystemMetrics(SM_CYCAPTION);\r\n    RectI halfCaption(r.x, r.y + captionDy / 2, r.dx, captionDy / 2);\r\n    if (halfCaption.Intersect(work).IsEmpty())\r\n        r = RectI(work.TL(), r.Size());\r\n}\r\n\r\nRectI GetDefaultWindowPos()\r\n{\r\n    RECT workArea;\r\n    SystemParametersInfo(SPI_GETWORKAREA, 0, &workArea, 0);\r\n    RectI work = RectI::FromRECT(workArea);\r\n\r\n    RectI r = work;\r\n    r.dx = std::min((int)((double)r.dy * DEF_PAGE_RATIO), work.dx);\r\n    r.x = (work.dx - r.dx) / 2;\r\n\r\n    return r;\r\n}\r\n\r\nvoid SaveCallstackLogs()\r\n{\r\n    char *s = dbghelp::GetCallstacks();\r\n    if (!s)\r\n        return;\r\n    ScopedMem<WCHAR> filePath(AppGenDataFilename(L\"callstacks.txt\"));\r\n    file::WriteAll(filePath.Get(), s, str::Len(s));\r\n    free(s);\r\n}\r\n"
  },
  {
    "path": "src/AppTools.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: GPLv3 */\n\nbool HasBeenInstalled();\nbool IsRunningInPortableMode();\nWCHAR *AppGenDataFilename(const WCHAR *pFilename);\nvoid SetAppDataPath(const WCHAR *path);\n\nvoid DoAssociateExeWithPdfExtension(HKEY hkey);\nbool IsExeAssociatedWithPdfExtension();\n\nWCHAR* AutoDetectInverseSearchCommands(HWND hwndCombo=nullptr);\n\nbool ExtendedEditWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);\n\nvoid EnsureAreaVisibility(RectI& rect);\nRectI GetDefaultWindowPos();\nvoid SaveCallstackLogs();\n"
  },
  {
    "path": "src/AppUtil.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"FileUtil.h\"\r\n// this file should have no further dependencies on src/* so that adding\r\n// unit tests for its content doesn't require for half of SumatraPDF\r\n// to be included (helpers with dependencies belong into AppTools.cpp)\r\n#include \"AppUtil.h\"\r\n\r\n// the only valid chars are 0-9, . and newlines.\r\n// a valid version has to match the regex /^\\d+(\\.\\d+)*(\\r?\\n)?$/\r\n// Return false if it contains anything else.\r\nbool IsValidProgramVersion(const char *txt)\r\n{\r\n    if (!str::IsDigit(*txt))\r\n        return false;\r\n\r\n    for (; *txt; txt++) {\r\n        if (str::IsDigit(*txt))\r\n            continue;\r\n        if (*txt == '.' && str::IsDigit(*(txt + 1)))\r\n            continue;\r\n        if (*txt == '\\r' && *(txt + 1) == '\\n')\r\n            continue;\r\n        if (*txt == '\\n' && !*(txt + 1))\r\n            continue;\r\n        return false;\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\n// extract the next (positive) number from the string *txt\r\nstatic unsigned int ExtractNextNumber(const WCHAR **txt)\r\n{\r\n    unsigned int val = 0;\r\n    const WCHAR *next = str::Parse(*txt, L\"%u%?.\", &val);\r\n    *txt = next ? next : *txt + str::Len(*txt);\r\n    return val;\r\n}\r\n\r\n// compare two version string. Return 0 if they are the same,\r\n// > 0 if the first is greater than the second and < 0 otherwise.\r\n// e.g.\r\n//   0.9.3.900 is greater than 0.9.3\r\n//   1.09.300 is greater than 1.09.3 which is greater than 1.9.1\r\n//   1.2.0 is the same as 1.2\r\nint CompareVersion(const WCHAR *txt1, const WCHAR *txt2)\r\n{\r\n    while (*txt1 || *txt2) {\r\n        unsigned int v1 = ExtractNextNumber(&txt1);\r\n        unsigned int v2 = ExtractNextNumber(&txt2);\r\n        if (v1 != v2)\r\n            return v1 - v2;\r\n    }\r\n\r\n    return 0;\r\n}\r\n\r\n// Updates the drive letter for a path that could have been on a removable drive,\r\n// if that same path can be found on a different removable drive\r\n// returns true if the path has been changed\r\nbool AdjustVariableDriveLetter(WCHAR *path)\r\n{\r\n    // Don't bother if the file path is still valid\r\n    if (file::Exists(path))\r\n        return false;\r\n    // Don't bother for files on non-removable drives\r\n    if (!path::HasVariableDriveLetter(path))\r\n        return false;\r\n\r\n    // Iterate through all (other) removable drives and try to find the file there\r\n    WCHAR szDrive[] = L\"A:\\\\\";\r\n    WCHAR origDrive = path[0];\r\n    for (DWORD driveMask = GetLogicalDrives(); driveMask; driveMask >>= 1) {\r\n        if ((driveMask & 1) && szDrive[0] != origDrive && path::HasVariableDriveLetter(szDrive)) {\r\n            path[0] = szDrive[0];\r\n            if (file::Exists(path))\r\n                return true;\r\n        }\r\n        szDrive[0]++;\r\n    }\r\n    path[0] = origDrive;\r\n    return false;\r\n}\r\n\r\n// files are considered untrusted, if they're either loaded from a\r\n// non-file URL in plugin mode, or if they're marked as being from\r\n// an untrusted zone (e.g. by the browser that's downloaded them)\r\nbool IsUntrustedFile(const WCHAR *filePath, const WCHAR *fileURL)\r\n{\r\n    ScopedMem<WCHAR> protocol;\r\n    if (fileURL && str::Parse(fileURL, L\"%S:\", &protocol))\r\n        if (str::Len(protocol) > 1 && !str::EqI(protocol, L\"file\"))\r\n            return true;\r\n\r\n    if (file::GetZoneIdentifier(filePath) >= URLZONE_INTERNET)\r\n        return true;\r\n\r\n    // check all parents of embedded files and ADSs as well\r\n    ScopedMem<WCHAR> path(str::Dup(filePath));\r\n    while (str::Len(path) > 2 && str::FindChar(path + 2, ':')) {\r\n        *str::FindCharLast(path, ':') = '\\0';\r\n        if (file::GetZoneIdentifier(path) >= URLZONE_INTERNET)\r\n            return true;\r\n    }\r\n\r\n    return false;\r\n}\r\n"
  },
  {
    "path": "src/AppUtil.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: GPLv3 */\n\nbool IsValidProgramVersion(const char *txt);\nint CompareVersion(const WCHAR *txt1, const WCHAR *txt2);\n\nbool AdjustVariableDriveLetter(WCHAR *path);\n\nbool IsUntrustedFile(const WCHAR *filePath, const WCHAR *fileUrl=nullptr);\n"
  },
  {
    "path": "src/BaseEngine.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n/* certain OCGs will only be rendered for some of these (e.g. watermarks) */\r\nenum RenderTarget { Target_View, Target_Print, Target_Export };\r\n\r\nenum PageLayoutType { Layout_Single = 0, Layout_Facing = 1, Layout_Book = 2,\r\n                      Layout_R2L = 16, Layout_NonContinuous = 32 };\r\n\r\nenum PageElementType { Element_Link, Element_Image, Element_Comment };\r\n\r\nenum PageDestType { Dest_None,\r\n    Dest_ScrollTo, Dest_LaunchURL, Dest_LaunchEmbedded, Dest_LaunchFile,\r\n    Dest_NextPage, Dest_PrevPage, Dest_FirstPage, Dest_LastPage,\r\n    Dest_FindDialog, Dest_FullScreen, Dest_GoBack, Dest_GoForward,\r\n    Dest_GoToPageDialog, Dest_PrintDialog, Dest_SaveAsDialog, Dest_ZoomToDialog,\r\n};\r\n\r\nenum PageAnnotType {\r\n    Annot_None,\r\n    Annot_Highlight, Annot_Underline, Annot_StrikeOut, Annot_Squiggly,\r\n};\r\n\r\nenum DocumentProperty {\r\n    Prop_Title, Prop_Author, Prop_Copyright, Prop_Subject,\r\n    Prop_CreationDate, Prop_ModificationDate, Prop_CreatorApp,\r\n    Prop_UnsupportedFeatures, Prop_FontList,\r\n    Prop_PdfVersion, Prop_PdfProducer, Prop_PdfFileStructure,\r\n};\r\n\r\nclass RenderedBitmap {\r\nprotected:\r\n    HBITMAP hbmp;\r\n    SizeI size;\r\n    ScopedHandle hMap;\r\n\r\npublic:\r\n    RenderedBitmap(HBITMAP hbmp, SizeI size, HANDLE hMap=nullptr) : hbmp(hbmp), size(size), hMap(hMap) { }\r\n    ~RenderedBitmap() { DeleteObject(hbmp); }\r\n\r\n    RenderedBitmap *Clone() const {\r\n        HBITMAP hbmp2 = (HBITMAP)CopyImage(hbmp, IMAGE_BITMAP, size.dx, size.dy, 0);\r\n        return new RenderedBitmap(hbmp2, size);\r\n    }\r\n\r\n    // callers must not delete this (use Clone if you have to modify it)\r\n    HBITMAP GetBitmap() const { return hbmp; }\r\n    SizeI Size() const { return size; }\r\n\r\n    // render the bitmap into the target rectangle (streching and skewing as requird)\r\n    bool StretchDIBits(HDC hdc, RectI target) const {\r\n        HDC bmpDC = CreateCompatibleDC(hdc);\r\n        if (!bmpDC)\r\n            return false;\r\n        HGDIOBJ oldBmp = SelectObject(bmpDC, hbmp);\r\n        if (!oldBmp) {\r\n            DeleteDC(bmpDC);\r\n            return false;\r\n        }\r\n        SetStretchBltMode(hdc, HALFTONE);\r\n        bool ok = StretchBlt(hdc, target.x, target.y, target.dx, target.dy,\r\n                             bmpDC, 0, 0, size.dx, size.dy, SRCCOPY);\r\n        SelectObject(bmpDC, oldBmp);\r\n        DeleteDC(bmpDC);\r\n        return ok;\r\n    }\r\n};\r\n\r\n// interface to be implemented for saving embedded documents that a link points to\r\nclass LinkSaverUI {\r\npublic:\r\n    virtual bool SaveEmbedded(const unsigned char *data, size_t cbCount) = 0;\r\n    virtual ~LinkSaverUI() { }\r\n};\r\n\r\n// a link destination\r\nclass PageDestination {\r\npublic:\r\n    virtual ~PageDestination() { }\r\n    // type of the destination (most common are Dest_ScrollTo and Dest_LaunchURL)\r\n    virtual PageDestType GetDestType() const = 0;\r\n    // page the destination points to (0 for external destinations such as URLs)\r\n    virtual int GetDestPageNo() const = 0;\r\n    // rectangle of the destination on the above returned page\r\n    virtual RectD GetDestRect() const = 0;\r\n    // string value associated with the destination (e.g. a path or a URL)\r\n    // caller must free() the result\r\n    virtual WCHAR *GetDestValue() const { return nullptr; }\r\n    // the name of this destination (reverses BaseEngine::GetNamedDest) or nullptr\r\n    // (mainly applicable for links of type \"LaunchFile\" to PDF documents)\r\n    // caller must free() the result\r\n    virtual WCHAR *GetDestName() const { return nullptr; }\r\n\r\n    // if this destination's target is an embedded file, this allows to\r\n    // save that file efficiently (the LinkSaverUI might get passed a link\r\n    // to an internal buffer in order to avoid unnecessary memory allocations)\r\n    virtual bool SaveEmbedded(LinkSaverUI &saveUI) { UNUSED(saveUI);  return false; }\r\n};\r\n\r\n// an user annotation on page\r\nstruct PageAnnotation {\r\n    struct Color {\r\n        uint8_t r, g, b, a;\r\n        Color() : r(0), g(0), b(0), a(0) { }\r\n        Color(uint8_t r, uint8_t g, uint8_t b, uint8_t a=255) : r(r), g(g), b(b), a(a) { }\r\n        explicit Color(COLORREF c, uint8_t a=255) :\r\n            r(GetRValueSafe(c)), g(GetGValueSafe(c)), b(GetBValueSafe(c)), a(a) { }\r\n        bool operator==(const Color& other) const {\r\n            return other.r == r && other.g == g && other.b == b && other.a == a;\r\n        }\r\n    };\r\n\r\n    PageAnnotType type;\r\n    int pageNo;\r\n    RectD rect;\r\n    Color color;\r\n\r\n    PageAnnotation() : type(Annot_None), pageNo(-1) { }\r\n    PageAnnotation(PageAnnotType type, int pageNo, RectD rect, Color color) :\r\n        type(type), pageNo(pageNo), rect(rect), color(color) { }\r\n    bool operator==(const PageAnnotation& other) const {\r\n        return other.type == type && other.pageNo == pageNo &&\r\n               other.rect == rect && other.color == color;\r\n    }\r\n};\r\n\r\n// use in PageDestination::GetDestRect for values that don't matter\r\n#define DEST_USE_DEFAULT    -999.9\r\n\r\n// hoverable (and maybe interactable) element on a single page\r\nclass PageElement {\r\npublic:\r\n    virtual ~PageElement() { }\r\n    // the type of this page element\r\n    virtual PageElementType GetType() const = 0;\r\n    // page this element lives on (0 for elements in a ToC)\r\n    virtual int GetPageNo() const = 0;\r\n    // rectangle that can be interacted with\r\n    virtual RectD GetRect() const = 0;\r\n    // string value associated with this element (e.g. displayed in an infotip)\r\n    // caller must free() the result\r\n    virtual WCHAR *GetValue() const = 0;\r\n\r\n    // if this element is a link, this returns information about the link's destination\r\n    // (the result is owned by the PageElement and MUST NOT be deleted)\r\n    virtual PageDestination *AsLink() { return nullptr; }\r\n    // if this element is an image, this returns it\r\n    // caller must delete the result\r\n    virtual RenderedBitmap *GetImage() { return nullptr; }\r\n};\r\n\r\n// an item in a document's Table of Content\r\nclass DocTocItem {\r\n    DocTocItem *last; // only updated by AddSibling\r\n\r\npublic:\r\n    // the item's visible label\r\n    WCHAR *title;\r\n    // whether any child elements are to be displayed\r\n    bool open;\r\n    // page this item points to (0 for non-page destinations)\r\n    // if GetLink() returns a destination to a page, the two should match\r\n    int pageNo;\r\n    // arbitrary number allowing to distinguish this DocTocItem\r\n    // from any other of the same ToC tree (must be constant\r\n    // between runs so that it can be persisted in FileState::tocState)\r\n    int id;\r\n\r\n    // first child item\r\n    DocTocItem *child;\r\n    // next sibling\r\n    DocTocItem *next;\r\n\r\n    explicit DocTocItem(WCHAR *title, int pageNo=0) :\r\n        title(title), open(false), pageNo(pageNo), id(0), child(nullptr), next(nullptr), last(nullptr) { }\r\n\r\n    virtual ~DocTocItem() {\r\n        delete child;\r\n        while (next) {\r\n            DocTocItem *tmp = next->next;\r\n            next->next = nullptr;\r\n            delete next;\r\n            next = tmp;\r\n        }\r\n        free(title);\r\n    }\r\n\r\n    void AddSibling(DocTocItem *sibling) {\r\n        DocTocItem *item;\r\n        for (item = last ? last : this; item->next; item = item->next);\r\n        last = item->next = sibling;\r\n    }\r\n\r\n    void OpenSingleNode() {\r\n        // only open (root level) ToC nodes if there's at most two\r\n        if (!next || !next->next) {\r\n            open = true;\r\n            if (next)\r\n                next->open = true;\r\n        }\r\n    }\r\n\r\n    // returns the destination this ToC item points to or nullptr\r\n    // (the result is owned by the DocTocItem and MUST NOT be deleted)\r\n    virtual PageDestination *GetLink() = 0;\r\n};\r\n\r\n// a helper that allows for rendering interruptions in an engine-agnostic way\r\nclass AbortCookie {\r\npublic:\r\n    virtual ~AbortCookie() { }\r\n    // aborts a rendering request (as far as possible)\r\n    // note: must be thread-safe\r\n    virtual void Abort() = 0;\r\n};\r\n\r\nclass BaseEngine {\r\npublic:\r\n    virtual ~BaseEngine() { }\r\n    // creates a clone of this engine (e.g. for printing on a different thread)\r\n    virtual BaseEngine *Clone() = 0;\r\n\r\n    // the name of the file this engine handles\r\n    virtual const WCHAR *FileName() const = 0;\r\n    // number of pages the loaded document contains\r\n    virtual int PageCount() const = 0;\r\n\r\n    // the box containing the visible page content (usually RectD(0, 0, pageWidth, pageHeight))\r\n    virtual RectD PageMediabox(int pageNo) = 0;\r\n    // the box inside PageMediabox that actually contains any relevant content\r\n    // (used for auto-cropping in Fit Content mode, can be PageMediabox)\r\n    virtual RectD PageContentBox(int pageNo, RenderTarget target=Target_View) {\r\n        UNUSED(target);\r\n        return PageMediabox(pageNo);\r\n    }\r\n\r\n    // renders a page into a cacheable RenderedBitmap\r\n    // (*cookie_out must be deleted after the call returns)\r\n    virtual RenderedBitmap *RenderBitmap(int pageNo, float zoom, int rotation,\r\n                         RectD *pageRect=nullptr, /* if nullptr: defaults to the page's mediabox */\r\n                         RenderTarget target=Target_View, AbortCookie **cookie_out=nullptr) = 0;\r\n\r\n    // applies zoom and rotation to a point in user/page space converting\r\n    // it into device/screen space - or in the inverse direction\r\n    virtual PointD Transform(PointD pt, int pageNo, float zoom, int rotation, bool inverse=false) = 0;\r\n    virtual RectD Transform(RectD rect, int pageNo, float zoom, int rotation, bool inverse=false) = 0;\r\n\r\n    // returns the binary data for the current file\r\n    // (e.g. for saving again when the file has already been deleted)\r\n    // caller needs to free() the result\r\n    virtual unsigned char *GetFileData(size_t *cbCount) = 0;\r\n    // saves a copy of the current file under a different name (overwriting an existing file)\r\n    // (includeUserAnnots only has an effect if SupportsAnnotation(true) returns true)\r\n    virtual bool SaveFileAs(const WCHAR *copyFileName, bool includeUserAnnots=false) = 0;\r\n    // converts the current file to a PDF file and saves it (overwriting an existing file),\r\n    // (includeUserAnnots should always have an effect)\r\n    virtual bool SaveFileAsPDF(const WCHAR *pdfFileName, bool includeUserAnnots=false) {\r\n        UNUSED(pdfFileName);\r\n        UNUSED(includeUserAnnots);\r\n        return false;\r\n    }\r\n    // extracts all text found in the given page (and optionally also the\r\n    // coordinates of the individual glyphs)\r\n    // caller needs to free() the result and *coordsOut (if coordsOut is non-nullptr)\r\n    virtual WCHAR * ExtractPageText(int pageNo, const WCHAR *lineSep, RectI **coordsOut=nullptr,\r\n                                    RenderTarget target=Target_View) = 0;\r\n    // pages where clipping doesn't help are rendered in larger tiles\r\n    virtual bool HasClipOptimizations(int pageNo) = 0;\r\n    // the layout type this document's author suggests (if the user doesn't care)\r\n    virtual PageLayoutType PreferredLayout() { return Layout_Single; }\r\n    // whether the content should be displayed as images instead of as document pages\r\n    // (e.g. with a black background and less padding in between and without search UI)\r\n    virtual bool IsImageCollection() const { return false; }\r\n\r\n    // access to various document properties (such as Author, Title, etc.)\r\n    virtual WCHAR *GetProperty(DocumentProperty prop) = 0;\r\n\r\n    // TODO: generalize from PageAnnotation to PageModification\r\n    // whether this engine supports adding user annotations of all available types\r\n    // (either for rendering or for saving)\r\n    virtual bool SupportsAnnotation(bool forSaving=false) const = 0;\r\n    // informs the engine about annotations the user made so that they can be rendered, etc.\r\n    // (this call supercedes any prior call to UpdateUserAnnotations)\r\n    virtual void UpdateUserAnnotations(Vec<PageAnnotation> *list) = 0;\r\n\r\n    // TODO: needs a more general interface\r\n    // whether it is allowed to print the current document\r\n    virtual bool AllowsPrinting() const { return true; }\r\n    // whether it is allowed to extract text from the current document\r\n    // (except for searching an accessibility reasons)\r\n    virtual bool AllowsCopyingText() const { return true; }\r\n\r\n    // the DPI for a file is needed when converting internal measures to physical ones\r\n    virtual float GetFileDPI() const { return 96.0f; }\r\n    // the default file extension for a document like the currently loaded one (e.g. L\".pdf\")\r\n    virtual const WCHAR *GetDefaultFileExt() const = 0;\r\n\r\n    // returns a list of all available elements for this page\r\n    // caller must delete the result (including all elements contained in the Vec)\r\n    virtual Vec<PageElement *> *GetElements(int pageNo) = 0;\r\n    // returns the element at a given point or nullptr if there's none\r\n    // caller must delete the result\r\n    virtual PageElement *GetElementAtPos(int pageNo, PointD pt) = 0;\r\n\r\n    // creates a PageDestination from a name (or nullptr for invalid names)\r\n    // caller must delete the result\r\n    virtual PageDestination *GetNamedDest(const WCHAR *name) {\r\n        UNUSED(name);\r\n        return nullptr;\r\n    }\r\n    // checks whether this document has an associated Table of Contents\r\n    virtual bool HasTocTree() const { return false; }\r\n    // returns the root element for the loaded document's Table of Contents\r\n    // caller must delete the result (when no longer needed)\r\n    virtual DocTocItem *GetTocTree() { return nullptr; }\r\n\r\n    // checks whether this document has explicit labels for pages (such as\r\n    // roman numerals) instead of the default plain arabic numbering\r\n    virtual bool HasPageLabels() const { return false; }\r\n    // returns a label to be displayed instead of the page number\r\n    // caller must free() the result\r\n    virtual WCHAR *GetPageLabel(int pageNo) const { return str::Format(L\"%d\", pageNo); }\r\n    // reverts GetPageLabel by returning the first page number having the given label\r\n    virtual int GetPageByLabel(const WCHAR *label) const { return _wtoi(label); }\r\n\r\n    // whether this document required a password in order to be loaded\r\n    virtual bool IsPasswordProtected() const { return false; }\r\n    // returns a string to remember when the user wants to save a document's password\r\n    // (don't implement for document types that don't support password protection)\r\n    // caller must free() the result\r\n    virtual char *GetDecryptionKey() const { return nullptr; }\r\n\r\n    // loads the given page so that the time required can be measured\r\n    // without also measuring rendering times\r\n    virtual bool BenchLoadPage(int pageNo) = 0;\r\n};\r\n\r\nclass PasswordUI {\r\npublic:\r\n    virtual WCHAR * GetPassword(const WCHAR *fileName, unsigned char *fileDigest,\r\n                                unsigned char decryptionKeyOut[32], bool *saveKey) = 0;\r\n    virtual ~PasswordUI() { }\r\n};\r\n"
  },
  {
    "path": "src/Canvas.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"WinDynCalls.h\"\r\n#include \"Dpi.h\"\r\n#include \"FileUtil.h\"\r\n#include \"FrameRateWnd.h\"\r\n#include \"Timer.h\"\r\n#include \"UITask.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EngineManager.h\"\r\n#include \"Doc.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"DisplayModel.h\"\r\n#include \"EbookController.h\"\r\n#include \"GlobalPrefs.h\"\r\n#include \"RenderCache.h\"\r\n#include \"TextSelection.h\"\r\n#include \"TextSearch.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"WindowInfo.h\"\r\n#include \"TabInfo.h\"\r\n#include \"resource.h\"\r\n#include \"Canvas.h\"\r\n#include \"Caption.h\"\r\n#include \"Menu.h\"\r\n#include \"Notifications.h\"\r\n#include \"uia/Provider.h\"\r\n#include \"Search.h\"\r\n#include \"Selection.h\"\r\n#include \"SumatraAbout.h\"\r\n#include \"Tabs.h\"\r\n#include \"Toolbar.h\"\r\n#include \"Translations.h\"\r\n\r\n// these can be global, as the mouse wheel can't affect more than one window at once\r\nstatic int gDeltaPerLine = 0;\r\n// set when WM_MOUSEWHEEL has been passed on (to prevent recursion)\r\nstatic bool gWheelMsgRedirect = false;\r\n\r\nvoid UpdateDeltaPerLine()\r\n{\r\n    ULONG ulScrollLines;\r\n    BOOL ok = SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &ulScrollLines, 0);\r\n    if (!ok)\r\n        return;\r\n    // ulScrollLines usually equals 3 or 0 (for no scrolling) or -1 (for page scrolling)\r\n    // WHEEL_DELTA equals 120, so iDeltaPerLine will be 40\r\n    if (ulScrollLines == (ULONG)-1)\r\n        gDeltaPerLine = -1;\r\n    else if (ulScrollLines != 0)\r\n        gDeltaPerLine = WHEEL_DELTA / ulScrollLines;\r\n    else\r\n        gDeltaPerLine = 0;\r\n}\r\n\r\n///// methods needed for FixedPageUI canvases with document loaded /////\r\n\r\nstatic void OnVScroll(WindowInfo& win, WPARAM wParam)\r\n{\r\n    AssertCrash(win.AsFixed());\r\n\r\n    SCROLLINFO si = { 0 };\r\n    si.cbSize = sizeof (si);\r\n    si.fMask  = SIF_ALL;\r\n    GetScrollInfo(win.hwndCanvas, SB_VERT, &si);\r\n\r\n    int iVertPos = si.nPos;\r\n    int lineHeight = DpiScaleY(win.hwndCanvas, 16);\r\n    if (!IsContinuous(win.ctrl->GetDisplayMode()) && ZOOM_FIT_PAGE == win.ctrl->GetZoomVirtual())\r\n        lineHeight = 1;\r\n\r\n    USHORT message = LOWORD(wParam);\r\n    switch (message) {\r\n    case SB_TOP:        si.nPos = si.nMin; break;\r\n    case SB_BOTTOM:     si.nPos = si.nMax; break;\r\n    case SB_LINEUP:     si.nPos -= lineHeight; break;\r\n    case SB_LINEDOWN:   si.nPos += lineHeight; break;\r\n    case SB_HPAGEUP:    si.nPos -= si.nPage / 2; break;\r\n    case SB_HPAGEDOWN:  si.nPos += si.nPage / 2; break;\r\n    case SB_PAGEUP:     si.nPos -= si.nPage; break;\r\n    case SB_PAGEDOWN:   si.nPos += si.nPage; break;\r\n    case SB_THUMBTRACK: si.nPos = si.nTrackPos; break;\r\n    }\r\n\r\n    // Set the position and then retrieve it.  Due to adjustments\r\n    // by Windows it may not be the same as the value set.\r\n    si.fMask = SIF_POS;\r\n    SetScrollInfo(win.hwndCanvas, SB_VERT, &si, TRUE);\r\n    GetScrollInfo(win.hwndCanvas, SB_VERT, &si);\r\n\r\n    // If the position has changed or we're dealing with a touchpad scroll event, \r\n    // scroll the window and update it\r\n    if (si.nPos != iVertPos || message == SB_THUMBTRACK)\r\n        win.AsFixed()->ScrollYTo(si.nPos);\r\n}\r\n\r\nstatic void OnHScroll(WindowInfo& win, WPARAM wParam)\r\n{\r\n    AssertCrash(win.AsFixed());\r\n\r\n    SCROLLINFO si = { 0 };\r\n    si.cbSize = sizeof (si);\r\n    si.fMask  = SIF_ALL;\r\n    GetScrollInfo(win.hwndCanvas, SB_HORZ, &si);\r\n\r\n    int iHorzPos = si.nPos;\r\n    USHORT message = LOWORD(wParam);\r\n    switch (message) {\r\n    case SB_LEFT:       si.nPos = si.nMin; break;\r\n    case SB_RIGHT:      si.nPos = si.nMax; break;\r\n    case SB_LINELEFT:   si.nPos -= DpiScaleX(win.hwndCanvas, 16); break;\r\n    case SB_LINERIGHT:  si.nPos += DpiScaleX(win.hwndCanvas, 16); break;\r\n    case SB_PAGELEFT:   si.nPos -= si.nPage; break;\r\n    case SB_PAGERIGHT:  si.nPos += si.nPage; break;\r\n    case SB_THUMBTRACK: si.nPos = si.nTrackPos; break;\r\n    }\r\n\r\n    // Set the position and then retrieve it.  Due to adjustments\r\n    // by Windows it may not be the same as the value set.\r\n    si.fMask = SIF_POS;\r\n    SetScrollInfo(win.hwndCanvas, SB_HORZ, &si, TRUE);\r\n    GetScrollInfo(win.hwndCanvas, SB_HORZ, &si);\r\n\r\n    // If the position has changed or we're dealing with a touchpad scroll event, \r\n    // scroll the window and update it\r\n    if (si.nPos != iHorzPos || message == SB_THUMBTRACK)\r\n        win.AsFixed()->ScrollXTo(si.nPos);\r\n}\r\n\r\nstatic void OnDraggingStart(WindowInfo& win, int x, int y, bool right=false)\r\n{\r\n    SetCapture(win.hwndCanvas);\r\n    win.mouseAction = right ? MA_DRAGGING_RIGHT : MA_DRAGGING;\r\n    win.dragPrevPos = PointI(x, y);\r\n    if (GetCursor())\r\n        SetCursor(gCursorDrag);\r\n}\r\n\r\nstatic void OnDraggingStop(WindowInfo& win, int x, int y, bool aborted)\r\n{\r\n    if (GetCapture() != win.hwndCanvas)\r\n        return;\r\n\r\n    if (GetCursor())\r\n        SetCursor(IDC_ARROW);\r\n    ReleaseCapture();\r\n\r\n    if (aborted)\r\n        return;\r\n\r\n    SizeI drag(x - win.dragPrevPos.x, y - win.dragPrevPos.y);\r\n    win.MoveDocBy(drag.dx, -2 * drag.dy);\r\n}\r\n\r\nstatic void OnMouseMove(WindowInfo& win, int x, int y, WPARAM flags)\r\n{\r\n    UNUSED(flags);\r\n    AssertCrash(win.AsFixed());\r\n\r\n    if (win.presentation) {\r\n        if (PM_BLACK_SCREEN == win.presentation || PM_WHITE_SCREEN == win.presentation) {\r\n            SetCursor((HCURSOR)nullptr);\r\n            return;\r\n        }\r\n        // shortly display the cursor if the mouse has moved and the cursor is hidden\r\n        if (PointI(x, y) != win.dragPrevPos && !GetCursor()) {\r\n            if (win.mouseAction == MA_IDLE)\r\n                SetCursor(IDC_ARROW);\r\n            else\r\n                SendMessage(win.hwndCanvas, WM_SETCURSOR, 0, 0);\r\n            SetTimer(win.hwndCanvas, HIDE_CURSOR_TIMER_ID, HIDE_CURSOR_DELAY_IN_MS, nullptr);\r\n        }\r\n    }\r\n\r\n    if (win.dragStartPending) {\r\n        // have we already started a proper drag?\r\n        if (abs(x - win.dragStart.x) <= GetSystemMetrics(SM_CXDRAG) &&\r\n            abs(y - win.dragStart.y) <= GetSystemMetrics(SM_CYDRAG)) {\r\n            return;\r\n        }\r\n        win.dragStartPending = false;\r\n        delete win.linkOnLastButtonDown;\r\n        win.linkOnLastButtonDown = nullptr;\r\n    }\r\n\r\n    switch (win.mouseAction) {\r\n    case MA_SCROLLING:\r\n        win.yScrollSpeed = (y - win.dragStart.y) / SMOOTHSCROLL_SLOW_DOWN_FACTOR;\r\n        win.xScrollSpeed = (x - win.dragStart.x) / SMOOTHSCROLL_SLOW_DOWN_FACTOR;\r\n        break;\r\n    case MA_SELECTING_TEXT:\r\n        if (GetCursor())\r\n            SetCursor(IDC_IBEAM);\r\n        /* fall through */\r\n    case MA_SELECTING:\r\n        win.selectionRect.dx = x - win.selectionRect.x;\r\n        win.selectionRect.dy = y - win.selectionRect.y;\r\n        OnSelectionEdgeAutoscroll(&win, x, y);\r\n        win.RepaintAsync();\r\n        break;\r\n    case MA_DRAGGING:\r\n    case MA_DRAGGING_RIGHT:\r\n        win.MoveDocBy(win.dragPrevPos.x - x, win.dragPrevPos.y - y);\r\n        break;\r\n    }\r\n    // needed also for detecting cursor movement in presentation mode\r\n    win.dragPrevPos = PointI(x, y);\r\n\r\n    NotificationWnd *wnd = win.notifications->GetForGroup(NG_CURSOR_POS_HELPER);\r\n    if (wnd) {\r\n        if (MA_SELECTING == win.mouseAction)\r\n            win.selectionMeasure = win.AsFixed()->CvtFromScreen(win.selectionRect).Size();\r\n        UpdateCursorPositionHelper(&win, PointI(x, y), wnd);\r\n    }\r\n}\r\n\r\nstatic void OnMouseLeftButtonDown(WindowInfo& win, int x, int y, WPARAM key)\r\n{\r\n    //lf(\"Left button clicked on %d %d\", x, y);\r\n    if (MA_DRAGGING_RIGHT == win.mouseAction)\r\n        return;\r\n\r\n    if (MA_SCROLLING == win.mouseAction) {\r\n        win.mouseAction = MA_IDLE;\r\n        return;\r\n    }\r\n\r\n    CrashIfDebugOnly(win.mouseAction != MA_IDLE); // happened e.g. in crash 50539\r\n    CrashIf(!win.AsFixed());\r\n\r\n    SetFocus(win.hwndFrame);\r\n\r\n    AssertCrash(!win.linkOnLastButtonDown);\r\n    DisplayModel *dm = win.AsFixed();\r\n    PageElement *pageEl = dm->GetElementAtPos(PointI(x, y));\r\n    if (pageEl && pageEl->GetType() == Element_Link)\r\n        win.linkOnLastButtonDown = pageEl;\r\n    else\r\n        delete pageEl;\r\n    win.dragStartPending = true;\r\n    win.dragStart = PointI(x, y);\r\n\r\n    // - without modifiers, clicking on text starts a text selection\r\n    //   and clicking somewhere else starts a drag\r\n    // - pressing Shift forces dragging\r\n    // - pressing Ctrl forces a rectangular selection\r\n    // - pressing Ctrl+Shift forces text selection\r\n    // - not having CopySelection permission forces dragging\r\n    bool isShift = IsShiftPressed();\r\n    bool isCtrl = IsCtrlPressed();\r\n    bool canCopy = HasPermission(Perm_CopySelection);\r\n    bool isOverText = dm->IsOverText(PointI(x,y));\r\n    if (!canCopy || (isShift || !isOverText) && !isCtrl) {\r\n        OnDraggingStart(win, x, y);\r\n    } else {\r\n        OnSelectionStart(&win, x, y, key);\r\n    }\r\n}\r\n\r\nstatic void OnMouseLeftButtonUp(WindowInfo& win, int x, int y, WPARAM key)\r\n{\r\n    AssertCrash(win.AsFixed());\r\n    if (MA_IDLE == win.mouseAction || MA_DRAGGING_RIGHT == win.mouseAction)\r\n        return;\r\n    AssertCrash(MA_SELECTING == win.mouseAction || MA_SELECTING_TEXT == win.mouseAction || MA_DRAGGING == win.mouseAction);\r\n\r\n    bool didDragMouse = !win.dragStartPending ||\r\n        abs(x - win.dragStart.x) > GetSystemMetrics(SM_CXDRAG) ||\r\n        abs(y - win.dragStart.y) > GetSystemMetrics(SM_CYDRAG);\r\n    if (MA_DRAGGING == win.mouseAction)\r\n        OnDraggingStop(win, x, y, !didDragMouse);\r\n    else {\r\n        OnSelectionStop(&win, x, y, !didDragMouse);\r\n        if (MA_SELECTING == win.mouseAction && win.showSelection)\r\n            win.selectionMeasure = win.AsFixed()->CvtFromScreen(win.selectionRect).Size();\r\n    }\r\n\r\n    DisplayModel *dm = win.AsFixed();\r\n    PointD ptPage = dm->CvtFromScreen(PointI(x, y));\r\n    // TODO: win.linkHandler->GotoLink might spin the event loop\r\n    PageElement *link = win.linkOnLastButtonDown;\r\n    win.linkOnLastButtonDown = nullptr;\r\n    win.mouseAction = MA_IDLE;\r\n\r\n    if (didDragMouse)\r\n        /* pass */;\r\n    /* return from white/black screens in presentation mode */\r\n    else if (PM_BLACK_SCREEN == win.presentation || PM_WHITE_SCREEN == win.presentation)\r\n        win.ChangePresentationMode(PM_ENABLED);\r\n    /* follow an active link */\r\n    else if (link && link->GetRect().Contains(ptPage)) {\r\n        PageDestination *dest = link->AsLink();\r\n        // highlight the clicked link (as a reminder of the last action once the user returns)\r\n        if (dest && (Dest_LaunchURL == dest->GetDestType() || Dest_LaunchFile == dest->GetDestType())) {\r\n            DeleteOldSelectionInfo(&win, true);\r\n            win.currentTab->selectionOnPage = SelectionOnPage::FromRectangle(dm, dm->CvtToScreen(link->GetPageNo(), link->GetRect()));\r\n            win.showSelection = win.currentTab->selectionOnPage != nullptr;\r\n            win.RepaintAsync();\r\n        }\r\n        SetCursor(IDC_ARROW);\r\n        win.linkHandler->GotoLink(dest);\r\n    }\r\n    /* if we had a selection and this was just a click, hide the selection */\r\n    else if (win.showSelection)\r\n        ClearSearchResult(&win);\r\n    /* if there's a permanent forward search mark, hide it */\r\n    else if (win.fwdSearchMark.show && gGlobalPrefs->forwardSearch.highlightPermanent) {\r\n        win.fwdSearchMark.show = false;\r\n        win.RepaintAsync();\r\n    }\r\n    /* in presentation mode, change pages on left/right-clicks */\r\n    else if (PM_ENABLED == win.presentation) {\r\n        if ((key & MK_SHIFT))\r\n            win.ctrl->GoToPrevPage();\r\n        else\r\n            win.ctrl->GoToNextPage();\r\n    }\r\n\r\n    delete link;\r\n}\r\n\r\nstatic void OnMouseLeftButtonDblClk(WindowInfo& win, int x, int y, WPARAM key)\r\n{\r\n    //lf(\"Left button clicked on %d %d\", x, y);\r\n    if (win.presentation && !(key & ~MK_LBUTTON)) {\r\n        // in presentation mode, left clicks turn the page,\r\n        // make two quick left clicks (AKA one double-click) turn two pages\r\n        OnMouseLeftButtonDown(win, x, y, key);\r\n        return;\r\n    }\r\n\r\n    bool dontSelect = false;\r\n    if (gGlobalPrefs->enableTeXEnhancements && !(key & ~MK_LBUTTON))\r\n        dontSelect = OnInverseSearch(&win, x, y);\r\n    if (dontSelect)\r\n        return;\r\n\r\n    DisplayModel *dm = win.AsFixed();\r\n    if (dm->IsOverText(PointI(x, y))) {\r\n        int pageNo = dm->GetPageNoByPoint(PointI(x, y));\r\n        if (win.ctrl->ValidPageNo(pageNo)) {\r\n            PointD pt = dm->CvtFromScreen(PointI(x, y), pageNo);\r\n            dm->textSelection->SelectWordAt(pageNo, pt.x, pt.y);\r\n            UpdateTextSelection(&win, false);\r\n            win.RepaintAsync();\r\n        }\r\n        return;\r\n    }\r\n\r\n    PageElement *pageEl = dm->GetElementAtPos(PointI(x, y));\r\n    if (pageEl && pageEl->GetType() == Element_Link) {\r\n        // speed up navigation in a file where navigation links are in a fixed position\r\n        OnMouseLeftButtonDown(win, x, y, key);\r\n    }\r\n    else if (pageEl && pageEl->GetType() == Element_Image) {\r\n        // select an image that could be copied to the clipboard\r\n        RectI rc = dm->CvtToScreen(pageEl->GetPageNo(), pageEl->GetRect());\r\n\r\n        DeleteOldSelectionInfo(&win, true);\r\n        win.currentTab->selectionOnPage = SelectionOnPage::FromRectangle(dm, rc);\r\n        win.showSelection = win.currentTab->selectionOnPage != nullptr;\r\n        win.RepaintAsync();\r\n    }\r\n    delete pageEl;\r\n}\r\n\r\nstatic void OnMouseMiddleButtonDown(WindowInfo& win, int x, int y, WPARAM key)\r\n{\r\n    // Handle message by recording placement then moving document as mouse moves.\r\n    UNUSED(key);\r\n\r\n    switch (win.mouseAction) {\r\n    case MA_IDLE:\r\n        win.mouseAction = MA_SCROLLING;\r\n\r\n        // record current mouse position, the farther the mouse is moved\r\n        // from this position, the faster we scroll the document\r\n        win.dragStart = PointI(x, y);\r\n        SetCursor(IDC_SIZEALL);\r\n        break;\r\n\r\n    case MA_SCROLLING:\r\n        win.mouseAction = MA_IDLE;\r\n        break;\r\n    }\r\n}\r\n\r\nstatic void OnMouseRightButtonDown(WindowInfo& win, int x, int y, WPARAM key)\r\n{\r\n    UNUSED(key);\r\n    //lf(\"Right button clicked on %d %d\", x, y);\r\n    if (MA_SCROLLING == win.mouseAction)\r\n        win.mouseAction = MA_IDLE;\r\n    else if (win.mouseAction != MA_IDLE)\r\n        return;\r\n    AssertCrash(win.AsFixed());\r\n\r\n    SetFocus(win.hwndFrame);\r\n\r\n    win.dragStartPending = true;\r\n    win.dragStart = PointI(x, y);\r\n\r\n    OnDraggingStart(win, x, y, true);\r\n}\r\n\r\nstatic void OnMouseRightButtonUp(WindowInfo& win, int x, int y, WPARAM key)\r\n{\r\n    AssertCrash(win.AsFixed());\r\n    if (MA_DRAGGING_RIGHT != win.mouseAction)\r\n        return;\r\n\r\n    bool didDragMouse = !win.dragStartPending ||\r\n        abs(x - win.dragStart.x) > GetSystemMetrics(SM_CXDRAG) ||\r\n        abs(y - win.dragStart.y) > GetSystemMetrics(SM_CYDRAG);\r\n    OnDraggingStop(win, x, y, !didDragMouse);\r\n\r\n    win.mouseAction = MA_IDLE;\r\n\r\n    if (didDragMouse)\r\n        /* pass */;\r\n    else if (PM_ENABLED == win.presentation) {\r\n        if ((key & MK_CONTROL))\r\n            OnContextMenu(&win, x, y);\r\n        else if ((key & MK_SHIFT))\r\n            win.ctrl->GoToNextPage();\r\n        else\r\n            win.ctrl->GoToPrevPage();\r\n    }\r\n    /* return from white/black screens in presentation mode */\r\n    else if (PM_BLACK_SCREEN == win.presentation || PM_WHITE_SCREEN == win.presentation)\r\n        win.ChangePresentationMode(PM_ENABLED);\r\n    else\r\n        OnContextMenu(&win, x, y);\r\n}\r\n\r\nstatic void OnMouseRightButtonDblClick(WindowInfo& win, int x, int y, WPARAM key)\r\n{\r\n    if (win.presentation && !(key & ~MK_RBUTTON)) {\r\n        // in presentation mode, right clicks turn the page,\r\n        // make two quick right clicks (AKA one double-click) turn two pages\r\n        OnMouseRightButtonDown(win, x, y, key);\r\n        return;\r\n    }\r\n}\r\n\r\n#ifdef DRAW_PAGE_SHADOWS\r\n#define BORDER_SIZE   1\r\n#define SHADOW_OFFSET 4\r\nstatic void PaintPageFrameAndShadow(HDC hdc, RectI& bounds, RectI& pageRect, bool presentation)\r\n{\r\n    // Frame info\r\n    RectI frame = bounds;\r\n    frame.Inflate(BORDER_SIZE, BORDER_SIZE);\r\n\r\n    // Shadow info\r\n    RectI shadow = frame;\r\n    shadow.Offset(SHADOW_OFFSET, SHADOW_OFFSET);\r\n    if (frame.x < 0) {\r\n        // the left of the page isn't visible, so start the shadow at the left\r\n        int diff = std::min(-pageRect.x, SHADOW_OFFSET);\r\n        shadow.x -= diff; shadow.dx += diff;\r\n    }\r\n    if (frame.y < 0) {\r\n        // the top of the page isn't visible, so start the shadow at the top\r\n        int diff = std::min(-pageRect.y, SHADOW_OFFSET);\r\n        shadow.y -= diff; shadow.dy += diff;\r\n    }\r\n\r\n    // Draw shadow\r\n    if (!presentation) {\r\n        ScopedGdiObj<HBRUSH> brush(CreateSolidBrush(COL_PAGE_SHADOW));\r\n        FillRect(hdc, &shadow.ToRECT(), brush);\r\n    }\r\n\r\n    // Draw frame\r\n    ScopedGdiObj<HPEN> pe(CreatePen(PS_SOLID, 1, presentation ? TRANSPARENT : COL_PAGE_FRAME));\r\n    ScopedGdiObj<HBRUSH> brush(CreateSolidBrush(gRenderCache.backgroundColor));\r\n    SelectObject(hdc, pe);\r\n    SelectObject(hdc, brush);\r\n    Rectangle(hdc, frame.x, frame.y, frame.x + frame.dx, frame.y + frame.dy);\r\n}\r\n#else\r\nstatic void PaintPageFrameAndShadow(HDC hdc, RectI& bounds, RectI& pageRect, bool presentation)\r\n{\r\n    UNUSED(pageRect);  UNUSED(presentation);\r\n    ScopedPen pen(CreatePen(PS_NULL, 0, 0));\r\n    ScopedBrush brush(CreateSolidBrush(gRenderCache.backgroundColor));\r\n    ScopedHdcSelect restorePen(hdc, pen);\r\n    ScopedHdcSelect restoreBrush(hdc, brush);\r\n    Rectangle(hdc, bounds.x, bounds.y, bounds.x + bounds.dx + 1, bounds.y + bounds.dy + 1);\r\n}\r\n#endif\r\n\r\n/* debug code to visualize links (can block while rendering) */\r\nstatic void DebugShowLinks(DisplayModel& dm, HDC hdc)\r\n{\r\n    if (!gDebugShowLinks)\r\n        return;\r\n\r\n    RectI viewPortRect(PointI(), dm.GetViewPort().Size());\r\n    HPEN pen = CreatePen(PS_SOLID, 1, RGB(0x00, 0xff, 0xff));\r\n    HGDIOBJ oldPen = SelectObject(hdc, pen);\r\n\r\n    for (int pageNo = dm.PageCount(); pageNo >= 1; --pageNo) {\r\n        PageInfo *pageInfo = dm.GetPageInfo(pageNo);\r\n        if (!pageInfo || !pageInfo->shown || 0.0 == pageInfo->visibleRatio)\r\n            continue;\r\n\r\n        Vec<PageElement *> *els = dm.GetEngine()->GetElements(pageNo);\r\n        if (els) {\r\n            for (size_t i = 0; i < els->Count(); i++) {\r\n                if (els->At(i)->GetType() == Element_Image)\r\n                    continue;\r\n                RectI rect = dm.CvtToScreen(pageNo, els->At(i)->GetRect());\r\n                RectI isect = viewPortRect.Intersect(rect);\r\n                if (!isect.IsEmpty())\r\n                    PaintRect(hdc, isect);\r\n            }\r\n            DeleteVecMembers(*els);\r\n            delete els;\r\n        }\r\n    }\r\n\r\n    DeletePen(SelectObject(hdc, oldPen));\r\n\r\n    if (dm.GetZoomVirtual() == ZOOM_FIT_CONTENT) {\r\n        // also display the content box when fitting content\r\n        pen = CreatePen(PS_SOLID, 1, RGB(0xff, 0x00, 0xff));\r\n        oldPen = SelectObject(hdc, pen);\r\n\r\n        for (int pageNo = dm.PageCount(); pageNo >= 1; --pageNo) {\r\n            PageInfo *pageInfo = dm.GetPageInfo(pageNo);\r\n            if (!pageInfo->shown || 0.0 == pageInfo->visibleRatio)\r\n                continue;\r\n\r\n            RectI rect = dm.CvtToScreen(pageNo, dm.GetEngine()->PageContentBox(pageNo));\r\n            PaintRect(hdc, rect);\r\n        }\r\n\r\n        DeletePen(SelectObject(hdc, oldPen));\r\n    }\r\n}\r\n\r\n// cf. http://forums.fofou.org/sumatrapdf/topic?id=3183580\r\nstatic void GetGradientColor(COLORREF a, COLORREF b, float perc, TRIVERTEX *tv)\r\n{\r\n    tv->Red = (COLOR16)((GetRValueSafe(a) + perc * (GetRValueSafe(b) - GetRValueSafe(a))) * 256);\r\n    tv->Green = (COLOR16)((GetGValueSafe(a) + perc * (GetGValueSafe(b) - GetGValueSafe(a))) * 256);\r\n    tv->Blue = (COLOR16)((GetBValueSafe(a) + perc * (GetBValueSafe(b) - GetBValueSafe(a))) * 256);\r\n}\r\n\r\nstatic void DrawDocument(WindowInfo& win, HDC hdc, RECT *rcArea)\r\n{\r\n    AssertCrash(win.AsFixed());\r\n    if (!win.AsFixed()) return;\r\n    DisplayModel* dm = win.AsFixed();\r\n\r\n    bool paintOnBlackWithoutShadow = win.presentation ||\r\n    // draw comic books and single images on a black background (without frame and shadow)\r\n                                     dm->GetEngine()->IsImageCollection();\r\n    if (paintOnBlackWithoutShadow) {\r\n        ScopedGdiObj<HBRUSH> brush(CreateSolidBrush(WIN_COL_BLACK));\r\n        FillRect(hdc, rcArea, brush);\r\n    }\r\n    else if (0 == gGlobalPrefs->fixedPageUI.gradientColors->Count()) {\r\n        ScopedGdiObj<HBRUSH> brush(CreateSolidBrush(GetNoDocBgColor()));\r\n        FillRect(hdc, rcArea, brush);\r\n    }\r\n    else {\r\n        COLORREF colors[3];\r\n        colors[0] = gGlobalPrefs->fixedPageUI.gradientColors->At(0);\r\n        if (gGlobalPrefs->fixedPageUI.gradientColors->Count() == 1) {\r\n            colors[1] = colors[2] = colors[0];\r\n        }\r\n        else if (gGlobalPrefs->fixedPageUI.gradientColors->Count() == 2) {\r\n            colors[2] = gGlobalPrefs->fixedPageUI.gradientColors->At(1);\r\n            colors[1] = RGB((GetRValueSafe(colors[0]) + GetRValueSafe(colors[2])) / 2,\r\n                            (GetGValueSafe(colors[0]) + GetGValueSafe(colors[2])) / 2,\r\n                            (GetBValueSafe(colors[0]) + GetBValueSafe(colors[2])) / 2);\r\n        }\r\n        else {\r\n            colors[1] = gGlobalPrefs->fixedPageUI.gradientColors->At(1);\r\n            colors[2] = gGlobalPrefs->fixedPageUI.gradientColors->At(2);\r\n        }\r\n        SizeI size = dm->GetCanvasSize();\r\n        float percTop = 1.0f * dm->GetViewPort().y / size.dy;\r\n        float percBot = 1.0f * dm->GetViewPort().BR().y / size.dy;\r\n        if (!IsContinuous(dm->GetDisplayMode())) {\r\n            percTop += dm->CurrentPageNo() - 1; percTop /= dm->PageCount();\r\n            percBot += dm->CurrentPageNo() - 1; percBot /= dm->PageCount();\r\n        }\r\n        SizeI vp = dm->GetViewPort().Size();\r\n        TRIVERTEX tv[4] = { { 0, 0 }, { vp.dx, vp.dy / 2 }, { 0, vp.dy / 2 }, { vp.dx, vp.dy } };\r\n        GRADIENT_RECT gr[2] = { { 0, 1 }, { 2, 3 } };\r\n        if (percTop < 0.5f)\r\n            GetGradientColor(colors[0], colors[1], 2 * percTop, &tv[0]);\r\n        else\r\n            GetGradientColor(colors[1], colors[2], 2 * (percTop - 0.5f), &tv[0]);\r\n        if (percBot < 0.5f)\r\n            GetGradientColor(colors[0], colors[1], 2 * percBot, &tv[3]);\r\n        else\r\n            GetGradientColor(colors[1], colors[2], 2 * (percBot - 0.5f), &tv[3]);\r\n        bool needCenter = percTop < 0.5f && percBot > 0.5f;\r\n        if (needCenter) {\r\n            GetGradientColor(colors[1], colors[1], 0, &tv[1]);\r\n            GetGradientColor(colors[1], colors[1], 0, &tv[2]);\r\n            tv[1].y = tv[2].y = (LONG)((0.5f - percTop) / (percBot - percTop) * vp.dy);\r\n        }\r\n        else\r\n            gr[0].LowerRight = 3;\r\n        // TODO: disable for less than about two screen heights?\r\n        GradientFill(hdc, tv, dimof(tv), gr, needCenter ? 2 : 1, GRADIENT_FILL_RECT_V);\r\n    }\r\n\r\n    bool rendering = false;\r\n    RectI screen(PointI(), dm->GetViewPort().Size());\r\n\r\n    for (int pageNo = 1; pageNo <= dm->PageCount(); ++pageNo) {\r\n        PageInfo *pageInfo = dm->GetPageInfo(pageNo);\r\n        if (!pageInfo || 0.0f == pageInfo->visibleRatio)\r\n            continue;\r\n        AssertCrash(pageInfo->shown);\r\n        if (!pageInfo->shown)\r\n            continue;\r\n\r\n        RectI bounds = pageInfo->pageOnScreen.Intersect(screen);\r\n        // don't paint the frame background for images\r\n        if (!dm->GetEngine()->IsImageCollection())\r\n            PaintPageFrameAndShadow(hdc, bounds, pageInfo->pageOnScreen, win.presentation);\r\n\r\n        bool renderOutOfDateCue = false;\r\n        UINT renderDelay = gRenderCache.Paint(hdc, bounds, dm, pageNo, pageInfo, &renderOutOfDateCue);\r\n\r\n        if (renderDelay) {\r\n            ScopedFont fontRightTxt(CreateSimpleFont(hdc, L\"MS Shell Dlg\", 14));\r\n            HGDIOBJ hPrevFont = SelectObject(hdc, fontRightTxt);\r\n            SetTextColor(hdc, gRenderCache.textColor);\r\n            if (renderDelay != RENDER_DELAY_FAILED) {\r\n                if (renderDelay < REPAINT_MESSAGE_DELAY_IN_MS)\r\n                    win.RepaintAsync(REPAINT_MESSAGE_DELAY_IN_MS / 4);\r\n                else\r\n                    DrawCenteredText(hdc, bounds, _TR(\"Please wait - rendering...\"), IsUIRightToLeft());\r\n                rendering = true;\r\n            } else {\r\n                DrawCenteredText(hdc, bounds, _TR(\"Couldn't render the page\"), IsUIRightToLeft());\r\n            }\r\n            SelectObject(hdc, hPrevFont);\r\n            continue;\r\n        }\r\n\r\n        if (!renderOutOfDateCue)\r\n            continue;\r\n\r\n        HDC bmpDC = CreateCompatibleDC(hdc);\r\n        if (bmpDC) {\r\n            SelectObject(bmpDC, gBitmapReloadingCue);\r\n            int size = DpiScaleY(win.hwndFrame, 16);\r\n            int cx = std::min(bounds.dx, 2 * size);\r\n            int cy = std::min(bounds.dy, 2 * size);\r\n            int x = bounds.x + bounds.dx - std::min((cx + size) / 2, cx);\r\n            int y = bounds.y + std::max((cy - size) / 2, 0);\r\n            int dxDest = std::min(cx, size);\r\n            int dyDest = std::min(cy, size);\r\n            StretchBlt(hdc, x, y, dxDest, dyDest, bmpDC, 0, 0, 16, 16, SRCCOPY);\r\n            DeleteDC(bmpDC);\r\n        }\r\n    }\r\n\r\n    if (win.showSelection)\r\n        PaintSelection(&win, hdc);\r\n\r\n    if (win.fwdSearchMark.show)\r\n        PaintForwardSearchMark(&win, hdc);\r\n\r\n    if (!rendering)\r\n        DebugShowLinks(*dm, hdc);\r\n}\r\n\r\nstatic void OnPaintDocument(WindowInfo& win)\r\n{\r\n    Timer t;\r\n    PAINTSTRUCT ps;\r\n    HDC hdc = BeginPaint(win.hwndCanvas, &ps);\r\n\r\n    switch (win.presentation) {\r\n    case PM_BLACK_SCREEN:\r\n        FillRect(hdc, &ps.rcPaint, GetStockBrush(BLACK_BRUSH));\r\n        break;\r\n    case PM_WHITE_SCREEN:\r\n        FillRect(hdc, &ps.rcPaint, GetStockBrush(WHITE_BRUSH));\r\n        break;\r\n    default:\r\n        DrawDocument(win, win.buffer->GetDC(), &ps.rcPaint);\r\n        win.buffer->Flush(hdc);\r\n    }\r\n\r\n    EndPaint(win.hwndCanvas, &ps);\r\n    if (gShowFrameRate) {\r\n        ShowFrameRateDur(win.frameRateWnd, t.GetTimeInMs());\r\n    }\r\n}\r\n\r\nstatic LRESULT OnSetCursor(WindowInfo& win, HWND hwnd)\r\n{\r\n    PointI pt;\r\n\r\n    if (win.mouseAction != MA_IDLE)\r\n        win.DeleteInfotip();\r\n\r\n    switch (win.mouseAction) {\r\n    case MA_DRAGGING:\r\n    case MA_DRAGGING_RIGHT:\r\n        SetCursor(gCursorDrag);\r\n        return TRUE;\r\n    case MA_SCROLLING:\r\n        SetCursor(IDC_SIZEALL);\r\n        return TRUE;\r\n    case MA_SELECTING_TEXT:\r\n        SetCursor(IDC_IBEAM);\r\n        return TRUE;\r\n    case MA_SELECTING:\r\n        break;\r\n    case MA_IDLE:\r\n        if (GetCursor() && GetCursorPosInHwnd(hwnd, pt) && win.AsFixed()) {\r\n            if (win.notifications->GetForGroup(NG_CURSOR_POS_HELPER)) {\r\n                SetCursor(IDC_CROSS);\r\n                return TRUE;\r\n            }\r\n            DisplayModel *dm = win.AsFixed();\r\n            PageElement *pageEl = dm->GetElementAtPos(pt);\r\n            if (pageEl) {\r\n                ScopedMem<WCHAR> text(pageEl->GetValue());\r\n                RectI rc = dm->CvtToScreen(pageEl->GetPageNo(), pageEl->GetRect());\r\n                win.CreateInfotip(text, rc, true);\r\n\r\n                bool isLink = pageEl->GetType() == Element_Link;\r\n                delete pageEl;\r\n\r\n                if (isLink) {\r\n                    SetCursor(IDC_HAND);\r\n                    return TRUE;\r\n                }\r\n            }\r\n            else\r\n                win.DeleteInfotip();\r\n            if (dm->IsOverText(pt))\r\n                SetCursor(IDC_IBEAM);\r\n            else\r\n                SetCursor(IDC_ARROW);\r\n            return TRUE;\r\n        }\r\n        win.DeleteInfotip();\r\n        break;\r\n    }\r\n    return win.presentation ? TRUE : FALSE;\r\n}\r\n\r\nstatic LRESULT CanvasOnMouseWheel(WindowInfo& win, UINT message, WPARAM wParam, LPARAM lParam)\r\n{\r\n    // Scroll the ToC sidebar, if it's visible and the cursor is in it\r\n    if (win.tocVisible && IsCursorOverWindow(win.hwndTocTree) && !gWheelMsgRedirect) {\r\n        // Note: hwndTocTree's window procedure doesn't always handle\r\n        //       WM_MOUSEWHEEL and when it's bubbling up, we'd return\r\n        //       here recursively - prevent that\r\n        gWheelMsgRedirect = true;\r\n        LRESULT res = SendMessage(win.hwndTocTree, message, wParam, lParam);\r\n        gWheelMsgRedirect = false;\r\n        return res;\r\n    }\r\n\r\n    short delta = GET_WHEEL_DELTA_WPARAM(wParam);\r\n\r\n    // Note: not all mouse drivers correctly report the Ctrl key's state\r\n    if ((LOWORD(wParam) & MK_CONTROL) || IsCtrlPressed() || (LOWORD(wParam) & MK_RBUTTON)) {\r\n        PointI pt;\r\n        GetCursorPosInHwnd(win.hwndCanvas, pt);\r\n\r\n        float zoom = win.ctrl->GetNextZoomStep(delta < 0 ? ZOOM_MIN : ZOOM_MAX);\r\n        win.ctrl->SetZoomVirtual(zoom, &pt);\r\n        UpdateToolbarState(&win);\r\n\r\n        // don't show the context menu when zooming with the right mouse-button down\r\n        if ((LOWORD(wParam) & MK_RBUTTON))\r\n            win.dragStartPending = false;\r\n\r\n        return 0;\r\n    }\r\n\r\n    // make sure to scroll whole pages in non-continuous Fit Content mode\r\n    if (!IsContinuous(win.ctrl->GetDisplayMode()) &&\r\n        ZOOM_FIT_CONTENT == win.ctrl->GetZoomVirtual()) {\r\n        if (delta > 0)\r\n            win.ctrl->GoToPrevPage();\r\n        else\r\n            win.ctrl->GoToNextPage();\r\n        return 0;\r\n    }\r\n\r\n    if (gDeltaPerLine == 0)\r\n        return 0;\r\n\r\n    bool horizontal = (LOWORD(wParam) & MK_ALT) || IsAltPressed();\r\n    if (horizontal)\r\n        gSuppressAltKey = true;\r\n\r\n    if (gDeltaPerLine < 0 && win.AsFixed()) {\r\n        // scroll by (fraction of a) page\r\n        SCROLLINFO si = { 0 };\r\n        si.cbSize = sizeof(si);\r\n        si.fMask  = SIF_PAGE;\r\n        GetScrollInfo(win.hwndCanvas, horizontal ? SB_HORZ : SB_VERT, &si);\r\n        if (horizontal)\r\n            win.AsFixed()->ScrollXBy(-MulDiv(si.nPage, delta, WHEEL_DELTA));\r\n        else\r\n            win.AsFixed()->ScrollYBy(-MulDiv(si.nPage, delta, WHEEL_DELTA), true);\r\n        return 0;\r\n    }\r\n    \r\n   // added: shift while scrolling will scroll by half a page per tick\r\n   //        really usefull for browsing long files\r\n\tif ((LOWORD(wParam) & MK_SHIFT) || IsShiftPressed()) {\r\n\t\tSendMessage(win.hwndCanvas, WM_VSCROLL, (delta>0) ? SB_HPAGEUP : SB_HPAGEDOWN, 0);\r\n\t\treturn 0;\r\n\t}\r\n\r\n    win.wheelAccumDelta += delta;\r\n    int currentScrollPos = GetScrollPos(win.hwndCanvas, SB_VERT);\r\n\r\n    while (win.wheelAccumDelta >= gDeltaPerLine) {\r\n        if (horizontal)\r\n            SendMessage(win.hwndCanvas, WM_HSCROLL, SB_LINELEFT, 0);\r\n        else\r\n            SendMessage(win.hwndCanvas, WM_VSCROLL, SB_LINEUP, 0);\r\n        win.wheelAccumDelta -= gDeltaPerLine;\r\n    }\r\n    while (win.wheelAccumDelta <= -gDeltaPerLine) {\r\n        if (horizontal)\r\n            SendMessage(win.hwndCanvas, WM_HSCROLL, SB_LINERIGHT, 0);\r\n        else\r\n            SendMessage(win.hwndCanvas, WM_VSCROLL, SB_LINEDOWN, 0);\r\n        win.wheelAccumDelta += gDeltaPerLine;\r\n    }\r\n\r\n    if (!horizontal && !IsContinuous(win.ctrl->GetDisplayMode()) &&\r\n        GetScrollPos(win.hwndCanvas, SB_VERT) == currentScrollPos) {\r\n        if (delta > 0)\r\n            win.ctrl->GoToPrevPage(true);\r\n        else\r\n            win.ctrl->GoToNextPage();\r\n    }\r\n\r\n    return 0;\r\n}\r\n\r\nstatic LRESULT CanvasOnMouseHWheel(WindowInfo& win, UINT message, WPARAM wParam, LPARAM lParam)\r\n{\r\n    // Scroll the ToC sidebar, if it's visible and the cursor is in it\r\n    if (win.tocVisible && IsCursorOverWindow(win.hwndTocTree) && !gWheelMsgRedirect) {\r\n        // Note: hwndTocTree's window procedure doesn't always handle\r\n        //       WM_MOUSEHWHEEL and when it's bubbling up, we'd return\r\n        //       here recursively - prevent that\r\n        gWheelMsgRedirect = true;\r\n        LRESULT res = SendMessage(win.hwndTocTree, message, wParam, lParam);\r\n        gWheelMsgRedirect = false;\r\n        return res;\r\n    }\r\n\r\n    short delta = GET_WHEEL_DELTA_WPARAM(wParam);\r\n    win.wheelAccumDelta += delta;\r\n\r\n    while (win.wheelAccumDelta >= gDeltaPerLine) {\r\n        SendMessage(win.hwndCanvas, WM_HSCROLL, SB_LINERIGHT, 0);\r\n        win.wheelAccumDelta -= gDeltaPerLine;\r\n    }\r\n    while (win.wheelAccumDelta <= -gDeltaPerLine) {\r\n        SendMessage(win.hwndCanvas, WM_HSCROLL, SB_LINELEFT, 0);\r\n        win.wheelAccumDelta += gDeltaPerLine;\r\n    }\r\n\r\n    return TRUE;\r\n}\r\n\r\nstatic LRESULT OnGesture(WindowInfo& win, UINT message, WPARAM wParam, LPARAM lParam)\r\n{\r\n    if (!touch::SupportsGestures())\r\n        return DefWindowProc(win.hwndFrame, message, wParam, lParam);\r\n\r\n    HGESTUREINFO hgi = (HGESTUREINFO)lParam;\r\n    GESTUREINFO gi = { 0 };\r\n    gi.cbSize = sizeof(GESTUREINFO);\r\n\r\n    BOOL ok = touch::GetGestureInfo(hgi, &gi);\r\n    if (!ok) {\r\n        touch::CloseGestureInfoHandle(hgi);\r\n        return 0;\r\n    }\r\n\r\n    switch (gi.dwID) {\r\n        case GID_ZOOM:\r\n            if (gi.dwFlags != GF_BEGIN && win.AsFixed()) {\r\n                float zoom = (float)LODWORD(gi.ullArguments) / (float)win.touchState.startArg;\r\n                ZoomToSelection(&win, zoom, false, true);\r\n            }\r\n            win.touchState.startArg = LODWORD(gi.ullArguments);\r\n            break;\r\n\r\n        case GID_PAN:\r\n            // Flicking left or right changes the page,\r\n            // panning moves the document in the scroll window\r\n            if (gi.dwFlags == GF_BEGIN) {\r\n                win.touchState.panStarted = true;\r\n                win.touchState.panPos = gi.ptsLocation;\r\n                win.touchState.panScrollOrigX = GetScrollPos(win.hwndCanvas, SB_HORZ);\r\n            }\r\n            else if (win.touchState.panStarted) {\r\n                int deltaX = win.touchState.panPos.x - gi.ptsLocation.x;\r\n                int deltaY = win.touchState.panPos.y - gi.ptsLocation.y;\r\n                win.touchState.panPos = gi.ptsLocation;\r\n\r\n                if ((!win.AsFixed() || !IsContinuous(win.AsFixed()->GetDisplayMode())) &&\r\n                    (gi.dwFlags & GF_INERTIA) && abs(deltaX) > abs(deltaY)) {\r\n                    // Switch pages once we hit inertia in a horizontal direction (only in\r\n                    // non-continuous modes, cf. https://github.com/sumatrapdfreader/sumatrapdf/issues/9 )\r\n                    if (deltaX < 0)\r\n                        win.ctrl->GoToPrevPage();\r\n                    else if (deltaX > 0)\r\n                        win.ctrl->GoToNextPage();\r\n                    // When we switch pages, go back to the initial scroll position\r\n                    // and prevent further pan movement caused by the inertia\r\n                    if (win.AsFixed())\r\n                        win.AsFixed()->ScrollXTo(win.touchState.panScrollOrigX);\r\n                    win.touchState.panStarted = false;\r\n                }\r\n                else if (win.AsFixed()) {\r\n                    // Pan/Scroll\r\n                    win.MoveDocBy(deltaX, deltaY);\r\n                }\r\n            }\r\n            break;\r\n\r\n        case GID_ROTATE:\r\n            // Rotate the PDF 90 degrees in one direction\r\n            if (gi.dwFlags == GF_END && win.AsFixed()) {\r\n                // This is in radians\r\n                double rads = GID_ROTATE_ANGLE_FROM_ARGUMENT(LODWORD(gi.ullArguments));\r\n                // The angle from the rotate is the opposite of the Sumatra rotate, thus the negative\r\n                double degrees = -rads * 180 / M_PI;\r\n\r\n                // Playing with the app, I found that I often didn't go quit a full 90 or 180\r\n                // degrees. Allowing rotate without a full finger rotate seemed more natural.\r\n                if (degrees < -120 || degrees > 120)\r\n                    win.AsFixed()->RotateBy(180);\r\n                else if (degrees < -45)\r\n                    win.AsFixed()->RotateBy(-90);\r\n                else if (degrees > 45)\r\n                    win.AsFixed()->RotateBy(90);\r\n            }\r\n            break;\r\n\r\n        case GID_TWOFINGERTAP:\r\n            // Two-finger tap toggles fullscreen mode\r\n            OnMenuViewFullscreen(&win);\r\n            break;\r\n\r\n        case GID_PRESSANDTAP:\r\n            // Toggle between Fit Page, Fit Width and Fit Content (same as 'z')\r\n            if (gi.dwFlags == GF_BEGIN)\r\n                win.ToggleZoom();\r\n            break;\r\n\r\n        default:\r\n            // A gesture was not recognized\r\n            break;\r\n    }\r\n\r\n    touch::CloseGestureInfoHandle(hgi);\r\n    return 0;\r\n}\r\n\r\nstatic LRESULT WndProcCanvasFixedPageUI(WindowInfo& win, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    switch (msg) {\r\n    case WM_PAINT:\r\n        OnPaintDocument(win);\r\n        return 0;\r\n\r\n    case WM_MOUSEMOVE:\r\n        OnMouseMove(win, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), wParam);\r\n        return 0;\r\n\r\n    case WM_LBUTTONDOWN:\r\n        OnMouseLeftButtonDown(win, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), wParam);\r\n        return 0;\r\n\r\n    case WM_LBUTTONUP:\r\n        OnMouseLeftButtonUp(win, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), wParam);\r\n        return 0;\r\n\r\n    case WM_LBUTTONDBLCLK:\r\n        OnMouseLeftButtonDblClk(win, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), wParam);\r\n        return 0;\r\n\r\n    case WM_MBUTTONDOWN:\r\n        SetTimer(hwnd, SMOOTHSCROLL_TIMER_ID, SMOOTHSCROLL_DELAY_IN_MS, nullptr);\r\n        // TODO: Create window that shows location of initial click for reference\r\n        OnMouseMiddleButtonDown(win, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), wParam);\r\n        return 0;\r\n\r\n    case WM_RBUTTONDOWN:\r\n        OnMouseRightButtonDown(win, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), wParam);\r\n        return 0;\r\n\r\n    case WM_RBUTTONUP:\r\n        OnMouseRightButtonUp(win, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), wParam);\r\n        return 0;\r\n\r\n    case WM_RBUTTONDBLCLK:\r\n        OnMouseRightButtonDblClick(win, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), wParam);\r\n        return 0;\r\n\r\n    case WM_VSCROLL:\r\n        OnVScroll(win, wParam);\r\n        return 0;\r\n\r\n    case WM_HSCROLL:\r\n        OnHScroll(win, wParam);\r\n        return 0;\r\n\r\n    case WM_MOUSEWHEEL:\r\n        return CanvasOnMouseWheel(win, msg, wParam, lParam);\r\n\r\n    case WM_MOUSEHWHEEL:\r\n        return CanvasOnMouseHWheel(win, msg, wParam, lParam);\r\n\r\n    case WM_SETCURSOR:\r\n        if (OnSetCursor(win, hwnd))\r\n            return TRUE;\r\n        return DefWindowProc(hwnd, msg, wParam, lParam);\r\n\r\n    case WM_CONTEXTMENU:\r\n        OnContextMenu(&win, 0, 0);\r\n        return 0;\r\n\r\n    case WM_GESTURE:\r\n        return OnGesture(win, msg, wParam, lParam);\r\n\r\n    default:\r\n        return DefWindowProc(hwnd, msg, wParam, lParam);\r\n    }\r\n}\r\n\r\n///// methods needed for ChmUI canvases (should be subclassed by HtmlHwnd) /////\r\n\r\nstatic LRESULT WndProcCanvasChmUI(WindowInfo& win, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    switch (msg) {\r\n    case WM_SETCURSOR:\r\n        // TODO: make (re)loading a document always clear the infotip\r\n        win.DeleteInfotip();\r\n        return DefWindowProc(hwnd, msg, wParam, lParam);\r\n\r\n    default:\r\n        return DefWindowProc(hwnd, msg, wParam, lParam);\r\n    }\r\n}\r\n\r\n///// methods needed for EbookUI canvases /////\r\n\r\n// NO_INLINE to help in debugging https://github.com/sumatrapdfreader/sumatrapdf/issues/292\r\nstatic NO_INLINE LRESULT CanvasOnMouseWheelEbook(WindowInfo& win, UINT message, WPARAM wParam, LPARAM lParam)\r\n{\r\n    // Scroll the ToC sidebar, if it's visible and the cursor is in it\r\n    if (win.tocVisible && IsCursorOverWindow(win.hwndTocTree)) {\r\n        // Note: hwndTocTree's window procedure doesn't always handle\r\n        //       WM_MOUSEWHEEL and when it's bubbling up, we'd return\r\n        //       here recursively - prevent that\r\n        LRESULT res = 0;\r\n        if (!gWheelMsgRedirect) {\r\n            gWheelMsgRedirect = true;\r\n            res = SendMessage(win.hwndTocTree, message, wParam, lParam);\r\n            gWheelMsgRedirect = false;\r\n        }\r\n        return res;\r\n    }\r\n\r\n    short delta = GET_WHEEL_DELTA_WPARAM(wParam);\r\n    if (delta > 0)\r\n        win.ctrl->GoToPrevPage();\r\n    else\r\n        win.ctrl->GoToNextPage();\r\n    return 0;\r\n}\r\n\r\nstatic LRESULT WndProcCanvasEbookUI(WindowInfo& win, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    bool wasHandled;\r\n    LRESULT res = win.AsEbook()->HandleMessage(msg, wParam, lParam, wasHandled);\r\n    if (wasHandled)\r\n        return res;\r\n\r\n    switch (msg) {\r\n    case WM_SETCURSOR:\r\n        // TODO: make (re)loading a document always clear the infotip\r\n        win.DeleteInfotip();\r\n        return DefWindowProc(hwnd, msg, wParam, lParam);\r\n\r\n    case WM_MOUSEWHEEL:\r\n    case WM_MOUSEHWHEEL:\r\n        return CanvasOnMouseWheelEbook(win, msg, wParam, lParam);\r\n\r\n    case WM_GESTURE:\r\n        return OnGesture(win, msg, wParam, lParam);\r\n\r\n    default:\r\n        return DefWindowProc(hwnd, msg, wParam, lParam);\r\n    }\r\n}\r\n\r\n///// methods needed for the About/Start screen /////\r\n\r\nstatic void OnPaintAbout(WindowInfo& win)\r\n{\r\n    Timer t;\r\n    PAINTSTRUCT ps;\r\n    HDC hdc = BeginPaint(win.hwndCanvas, &ps);\r\n\r\n    if (HasPermission(Perm_SavePreferences | Perm_DiskAccess) && gGlobalPrefs->rememberOpenedFiles && gGlobalPrefs->showStartPage) {\r\n        DrawStartPage(win, win.buffer->GetDC(), gFileHistory, gRenderCache.textColor, gRenderCache.backgroundColor);\r\n    } else {\r\n        DrawAboutPage(win, win.buffer->GetDC());\r\n    }\r\n    win.buffer->Flush(hdc);\r\n\r\n    EndPaint(win.hwndCanvas, &ps);\r\n    if (gShowFrameRate) {\r\n        ShowFrameRateDur(win.frameRateWnd, t.GetTimeInMs());\r\n    }\r\n}\r\n\r\nstatic void OnMouseLeftButtonDownAbout(WindowInfo& win, int x, int y, WPARAM key)\r\n{\r\n    UNUSED(key);\r\n    //lf(\"Left button clicked on %d %d\", x, y);\r\n\r\n    // remember a link under so that on mouse up we only activate\r\n    // link if mouse up is on the same link as mouse down\r\n    win.url = GetStaticLink(win.staticLinks, x, y);\r\n}\r\n\r\nstatic void OnMouseLeftButtonUpAbout(WindowInfo& win, int x, int y, WPARAM key)\r\n{\r\n    UNUSED(key);\r\n    SetFocus(win.hwndFrame);\r\n\r\n    const WCHAR *url = GetStaticLink(win.staticLinks, x, y);\r\n    if (url && url == win.url) {\r\n        if (str::Eq(url, SLINK_OPEN_FILE))\r\n            SendMessage(win.hwndFrame, WM_COMMAND, IDM_OPEN, 0);\r\n        else if (str::Eq(url, SLINK_LIST_HIDE)) {\r\n            gGlobalPrefs->showStartPage = false;\r\n            win.RedrawAll(true);\r\n        } else if (str::Eq(url, SLINK_LIST_SHOW)) {\r\n            gGlobalPrefs->showStartPage = true;\r\n            win.RedrawAll(true);\r\n        } else if (!str::StartsWithI(url, L\"http:\") &&\r\n                   !str::StartsWithI(url, L\"https:\") &&\r\n                   !str::StartsWithI(url, L\"mailto:\"))\r\n        {\r\n            LoadArgs args(url, &win);\r\n            LoadDocument(args);\r\n        } else\r\n            LaunchBrowser(url);\r\n    }\r\n    win.url = nullptr;\r\n}\r\n\r\nstatic void OnMouseRightButtonDownAbout(WindowInfo& win, int x, int y, WPARAM key)\r\n{\r\n    UNUSED(key);\r\n    //lf(\"Right button clicked on %d %d\", x, y);\r\n    SetFocus(win.hwndFrame);\r\n    win.dragStart = PointI(x, y);\r\n}\r\n\r\nstatic void OnMouseRightButtonUpAbout(WindowInfo& win, int x, int y, WPARAM key)\r\n{\r\n    UNUSED(key);\r\n    bool didDragMouse =\r\n        abs(x - win.dragStart.x) > GetSystemMetrics(SM_CXDRAG) ||\r\n        abs(y - win.dragStart.y) > GetSystemMetrics(SM_CYDRAG);\r\n    if (!didDragMouse)\r\n        OnAboutContextMenu(&win, x, y);\r\n}\r\n\r\nstatic LRESULT OnSetCursorAbout(WindowInfo& win, HWND hwnd)\r\n{\r\n    PointI pt;\r\n    if (GetCursorPosInHwnd(hwnd, pt)) {\r\n        StaticLinkInfo linkInfo;\r\n        if (GetStaticLink(win.staticLinks, pt.x, pt.y, &linkInfo)) {\r\n            win.CreateInfotip(linkInfo.infotip, linkInfo.rect);\r\n            SetCursor(IDC_HAND);\r\n        }\r\n        else {\r\n            win.DeleteInfotip();\r\n            SetCursor(IDC_ARROW);\r\n        }\r\n        return TRUE;\r\n    }\r\n\r\n    win.DeleteInfotip();\r\n    return FALSE;\r\n}\r\n\r\nstatic LRESULT WndProcCanvasAbout(WindowInfo& win, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    switch (msg) {\r\n    case WM_LBUTTONDOWN:\r\n        OnMouseLeftButtonDownAbout(win, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), wParam);\r\n        return 0;\r\n\r\n    case WM_LBUTTONUP:\r\n        OnMouseLeftButtonUpAbout(win, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), wParam);\r\n        return 0;\r\n\r\n    case WM_LBUTTONDBLCLK:\r\n        OnMouseLeftButtonDownAbout(win, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), wParam);\r\n        return 0;\r\n\r\n    case WM_RBUTTONDOWN:\r\n        OnMouseRightButtonDownAbout(win, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), wParam);\r\n        return 0;\r\n\r\n    case WM_RBUTTONUP:\r\n        OnMouseRightButtonUpAbout(win, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), wParam);\r\n        return 0;\r\n\r\n    case WM_SETCURSOR:\r\n        if (OnSetCursorAbout(win, hwnd))\r\n            return TRUE;\r\n        return DefWindowProc(hwnd, msg, wParam, lParam);\r\n\r\n    case WM_CONTEXTMENU:\r\n        OnAboutContextMenu(&win, 0, 0);\r\n        return 0;\r\n\r\n    case WM_PAINT:\r\n        OnPaintAbout(win);\r\n        return 0;\r\n\r\n    default:\r\n        return DefWindowProc(hwnd, msg, wParam, lParam);\r\n    }\r\n}\r\n\r\n///// methods needed for FixedPageUI canvases with loading error /////\r\n\r\nstatic void OnPaintError(WindowInfo& win)\r\n{\r\n    PAINTSTRUCT ps;\r\n    HDC hdc = BeginPaint(win.hwndCanvas, &ps);\r\n\r\n    ScopedFont fontRightTxt(CreateSimpleFont(hdc, L\"MS Shell Dlg\", 14));\r\n    HGDIOBJ hPrevFont = SelectObject(hdc, fontRightTxt);\r\n    ScopedGdiObj<HBRUSH> brush(CreateSolidBrush(GetNoDocBgColor()));\r\n    FillRect(hdc, &ps.rcPaint, brush);\r\n    // TODO: should this be \"Error opening %s\"?\r\n    ScopedMem<WCHAR> msg(str::Format(_TR(\"Error loading %s\"), win.currentTab->filePath));\r\n    DrawCenteredText(hdc, ClientRect(win.hwndCanvas), msg, IsUIRightToLeft());\r\n    SelectObject(hdc, hPrevFont);\r\n\r\n    EndPaint(win.hwndCanvas, &ps);\r\n}\r\n\r\nstatic LRESULT WndProcCanvasLoadError(WindowInfo& win, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    switch (msg) {\r\n    case WM_PAINT:\r\n        OnPaintError(win);\r\n        return 0;\r\n\r\n    case WM_SETCURSOR:\r\n        // TODO: make (re)loading a document always clear the infotip\r\n        win.DeleteInfotip();\r\n        return DefWindowProc(hwnd, msg, wParam, lParam);\r\n\r\n    default:\r\n        return DefWindowProc(hwnd, msg, wParam, lParam);\r\n    }\r\n}\r\n\r\n///// methods needed for all types of canvas /////\r\n\r\nvoid WindowInfo::RepaintAsync(UINT delay)\r\n{\r\n    // even though RepaintAsync is mostly called from the UI thread,\r\n    // we depend on the repaint message to happen asynchronously\r\n    uitask::Post([=]{\r\n        if (!WindowInfoStillValid(this))\r\n            return;\r\n        if (!delay)\r\n            WndProcCanvas(this->hwndCanvas, WM_TIMER, REPAINT_TIMER_ID, 0);\r\n        else if (!this->delayedRepaintTimer)\r\n            this->delayedRepaintTimer = SetTimer(this->hwndCanvas, REPAINT_TIMER_ID, delay, nullptr);\r\n    });\r\n}\r\n\r\nstatic void OnTimer(WindowInfo& win, HWND hwnd, WPARAM timerId)\r\n{\r\n    PointI pt;\r\n\r\n    switch (timerId) {\r\n    case REPAINT_TIMER_ID:\r\n        win.delayedRepaintTimer = 0;\r\n        KillTimer(hwnd, REPAINT_TIMER_ID);\r\n        win.RedrawAll();\r\n        break;\r\n\r\n    case SMOOTHSCROLL_TIMER_ID:\r\n        if (MA_SCROLLING == win.mouseAction)\r\n            win.MoveDocBy(win.xScrollSpeed, win.yScrollSpeed);\r\n        else if (MA_SELECTING == win.mouseAction || MA_SELECTING_TEXT == win.mouseAction) {\r\n            GetCursorPosInHwnd(win.hwndCanvas, pt);\r\n            if (NeedsSelectionEdgeAutoscroll(&win, pt.x, pt.y))\r\n                OnMouseMove(win, pt.x, pt.y, MK_CONTROL);\r\n        }\r\n        else {\r\n            KillTimer(hwnd, SMOOTHSCROLL_TIMER_ID);\r\n            win.yScrollSpeed = 0;\r\n            win.xScrollSpeed = 0;\r\n        }\r\n        break;\r\n\r\n    case HIDE_CURSOR_TIMER_ID:\r\n        KillTimer(hwnd, HIDE_CURSOR_TIMER_ID);\r\n        if (win.presentation)\r\n            SetCursor((HCURSOR)nullptr);\r\n        break;\r\n\r\n    case HIDE_FWDSRCHMARK_TIMER_ID:\r\n        win.fwdSearchMark.hideStep++;\r\n        if (1 == win.fwdSearchMark.hideStep) {\r\n            SetTimer(hwnd, HIDE_FWDSRCHMARK_TIMER_ID, HIDE_FWDSRCHMARK_DECAYINTERVAL_IN_MS, nullptr);\r\n        }\r\n        else if (win.fwdSearchMark.hideStep >= HIDE_FWDSRCHMARK_STEPS) {\r\n            KillTimer(hwnd, HIDE_FWDSRCHMARK_TIMER_ID);\r\n            win.fwdSearchMark.show = false;\r\n            win.RepaintAsync();\r\n        }\r\n        else\r\n            win.RepaintAsync();\r\n        break;\r\n\r\n    case AUTO_RELOAD_TIMER_ID:\r\n        KillTimer(hwnd, AUTO_RELOAD_TIMER_ID);\r\n        if (win.currentTab && win.currentTab->reloadOnFocus)\r\n            ReloadDocument(&win, true);\r\n        break;\r\n\r\n    case EBOOK_LAYOUT_TIMER_ID:\r\n        KillTimer(hwnd, EBOOK_LAYOUT_TIMER_ID);\r\n        for (TabInfo *tab : win.tabs) {\r\n            if (tab->AsEbook())\r\n                tab->AsEbook()->TriggerLayout();\r\n        }\r\n        break;\r\n    }\r\n}\r\n\r\nstatic void OnDropFiles(HDROP hDrop, bool dragFinish)\r\n{\r\n    WCHAR filePath[MAX_PATH];\r\n    const int count = DragQueryFile(hDrop, DRAGQUERY_NUMFILES, 0, 0);\r\n\r\n    for (int i = 0; i < count; i++) {\r\n        DragQueryFile(hDrop, i, filePath, dimof(filePath));\r\n        if (str::EndsWithI(filePath, L\".lnk\")) {\r\n            ScopedMem<WCHAR> resolved(ResolveLnk(filePath));\r\n            if (resolved)\r\n                str::BufSet(filePath, dimof(filePath), resolved);\r\n        }\r\n        // The first dropped document may override the current window\r\n        LoadArgs args(filePath);\r\n        LoadDocument(args);\r\n    }\r\n    if (dragFinish)\r\n        DragFinish(hDrop);\r\n}\r\n\r\nLRESULT CALLBACK WndProcCanvas(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    // messages that don't require win\r\n    switch (msg) {\r\n    case WM_DROPFILES:\r\n        CrashIf(lParam != 0 && lParam != 1);\r\n        OnDropFiles((HDROP)wParam, !lParam);\r\n        return 0;\r\n\r\n    case WM_ERASEBKGND:\r\n        // do nothing, helps to avoid flicker\r\n        return TRUE;\r\n    }\r\n\r\n    WindowInfo *win = FindWindowInfoByHwnd(hwnd);\r\n    if (!win)\r\n        return DefWindowProc(hwnd, msg, wParam, lParam);\r\n\r\n    // messages that require win\r\n    switch (msg) {\r\n    case WM_TIMER:\r\n        OnTimer(*win, hwnd, wParam);\r\n        return 0;\r\n\r\n    case WM_SIZE:\r\n        if (!IsIconic(win->hwndFrame))\r\n            win->UpdateCanvasSize();\r\n        return 0;\r\n\r\n    case WM_GETOBJECT:\r\n        // TODO: should we check for UiaRootObjectId, as in http://msdn.microsoft.com/en-us/library/windows/desktop/ff625912.aspx ???\r\n        // On the other hand http://code.msdn.microsoft.com/windowsdesktop/UI-Automation-Clean-94993ac6/sourcecode?fileId=42883&pathId=2071281652\r\n        // says that UiaReturnRawElementProvider() should be called regardless of lParam\r\n        // Don't expose UIA automation in plugin mode yet. UIA is still too experimental\r\n        if (!gPluginMode) {\r\n            // disable UIAutomation in release builds until concurrency issues and\r\n            // memory leaks have been figured out and fixed\r\n#ifdef DEBUG\r\n            if (win->CreateUIAProvider()) {\r\n                // TODO: should win->uia_provider->Release() as in http://msdn.microsoft.com/en-us/library/windows/desktop/gg712214.aspx\r\n                // and http://www.code-magazine.com/articleprint.aspx?quickid=0810112&printmode=true ?\r\n                // Maybe instead of having a single provider per win, we should always create a new one\r\n                // like in this sample: http://code.msdn.microsoft.com/windowsdesktop/UI-Automation-Clean-94993ac6/sourcecode?fileId=42883&pathId=2071281652\r\n                // currently win->uia_provider refCount is really out of wack in WindowInfo::~WindowInfo\r\n                // from logging it seems that UiaReturnRawElementProvider() increases refCount by 1\r\n                // and since WM_GETOBJECT is called many times, it accumulates\r\n                return uia::ReturnRawElementProvider(hwnd, wParam, lParam, win->uia_provider);\r\n            }\r\n#endif\r\n        }\r\n        return DefWindowProc(hwnd, msg, wParam, lParam);\r\n\r\n    default:\r\n        // TODO: achieve this split through subclassing or different window classes\r\n        if (win->AsFixed())\r\n            return WndProcCanvasFixedPageUI(*win, hwnd, msg, wParam, lParam);\r\n\r\n        if (win->AsChm())\r\n            return WndProcCanvasChmUI(*win, hwnd, msg, wParam, lParam);\r\n\r\n        if (win->AsEbook())\r\n            return WndProcCanvasEbookUI(*win, hwnd, msg, wParam, lParam);\r\n\r\n        if (win->IsAboutWindow())\r\n            return WndProcCanvasAbout(*win, hwnd, msg, wParam, lParam);\r\n\r\n        return WndProcCanvasLoadError(*win, hwnd, msg, wParam, lParam);\r\n    }\r\n}\r\n"
  },
  {
    "path": "src/Canvas.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: GPLv3 */\n\nvoid UpdateDeltaPerLine();\n\nLRESULT CALLBACK WndProcCanvas(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);\n"
  },
  {
    "path": "src/Caption.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"WinDynCalls.h\"\r\n#include \"WinUtil.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"WindowInfo.h\"\r\n#include \"Caption.h\"\r\n#include \"Tabs.h\"\r\n#include \"Translations.h\"\r\n\r\nusing namespace Gdiplus;\r\n\r\n#define CUSTOM_CAPTION_CLASS_NAME  L\"CustomCaption\"\r\n#define UNDOCUMENTED_MENU_CLASS_NAME L\"#32768\"\r\n\r\n#define BTN_ID_FIRST  100\r\n\r\n// This will prevent menu reopening, if we click the menu button,\r\n// while the menu is open.\r\n#define DO_NOT_REOPEN_MENU_TIMER_ID       1\r\n#define DO_NOT_REOPEN_MENU_DELAY_IN_MS    1\r\n\r\n// undocumented caption buttons state\r\n#define CBS_INACTIVE  5\r\n\r\n// undocumented window messages\r\n#define WM_NCUAHDRAWCAPTION  0xAE\r\n#define WM_NCUAHDRAWFRAME    0xAF\r\n#define WM_POPUPSYSTEMMENU   0x313\r\n\r\n// When a top level window is maximized the window manager checks whether its client\r\n// area covers the entire screen. If it does, the manager assumes that this is a fullscreen\r\n// window and hides the taskbar and any topmost window. A simple workaround is to\r\n// expand the non-client border at the expense of client area.\r\n#define NON_CLIENT_BAND  1\r\n// This non-client-band hack is only needed for maximized non-fullscreen windows:\r\nstatic inline bool NeedsNonClientBandHack(HWND hwnd) { return IsZoomed(hwnd) && win::HasCaption(hwnd); }\r\n\r\n// http://withinwindows.com/2010/07/01/retrieving-aero-glass-base-color-for-opaque-surface-rendering/\r\n#define REG_DWM  L\"Software\\\\Microsoft\\\\Windows\\\\DWM\"\r\n\r\n// When DWM composition is enabled, this is the ratio between alpha channels of active and inactive caption colors.\r\n#define ACTIVE_INACTIVE_ALPHA_RATIO  2.0f\r\n\r\nstatic void DrawCaptionButton(DRAWITEMSTRUCT *item, WindowInfo *win);\r\nstatic void PaintCaptionBackground(HDC hdc, WindowInfo *win, bool useDoubleBuffer);\r\nstatic HMENU GetUpdatedSystemMenu(HWND hwnd);\r\nstatic void MenuBarAsPopupMenu(WindowInfo *win, int x, int y);\r\n\r\nCaptionInfo::CaptionInfo(HWND hwndCaption): hwnd(hwndCaption), theme(nullptr), isMenuOpen(false) {\r\n    UpdateTheme();\r\n    UpdateColors(true);\r\n    UpdateBackgroundAlpha();\r\n}\r\n\r\nCaptionInfo::~CaptionInfo() {\r\n    if (theme)\r\n        theme::CloseThemeData(theme);\r\n}\r\n\r\nvoid CaptionInfo::UpdateBackgroundAlpha()\r\n{\r\n    bgAlpha = dwm::IsCompositionEnabled() ? 0 : 255;\r\n}\r\n\r\nvoid CaptionInfo::UpdateTheme()\r\n{\r\n    if (theme) {\r\n        theme::CloseThemeData(theme);\r\n        theme = nullptr;\r\n    }\r\n    if (theme::IsThemeActive())\r\n        theme = theme::OpenThemeData(hwnd, L\"WINDOW\");\r\n}\r\n\r\nvoid CaptionInfo::UpdateColors(bool activeWindow)\r\n{\r\n    ARGB colorizationColor;\r\n    if (dwm::IsCompositionEnabled() &&\r\n        // get the color from the Registry and blend it with white background\r\n        ReadRegDWORD(HKEY_CURRENT_USER, REG_DWM, L\"ColorizationColor\", colorizationColor)) {\r\n            BYTE A, R, G, B, white;\r\n            A = BYTE((colorizationColor >> 24) & 0xff);\r\n            if (!activeWindow)\r\n                A = (BYTE)floor(A / ACTIVE_INACTIVE_ALPHA_RATIO + 0.5f);\r\n            R = BYTE((colorizationColor >> 16) & 0xff);\r\n            G = BYTE((colorizationColor >> 8) & 0xff);\r\n            B = BYTE(colorizationColor & 0xff);\r\n            white = BYTE(255 - A);\r\n            float factor = A / 255.0f;\r\n            R = BYTE((int)floor(R * factor + 0.5f) + white);\r\n            G = BYTE((int)floor(G * factor + 0.5f) + white);\r\n            B = BYTE((int)floor(B * factor + 0.5f) + white);\r\n            bgColor = RGB(R, G, B);\r\n    }\r\n    else if (!theme || !SUCCEEDED(theme::GetThemeColor(theme, WP_CAPTION, 0,\r\n        activeWindow ? TMT_FILLCOLORHINT : TMT_BORDERCOLORHINT, &bgColor))) {\r\n            bgColor = activeWindow ? GetSysColor(COLOR_GRADIENTACTIVECAPTION)\r\n                                   : GetSysColor(COLOR_GRADIENTINACTIVECAPTION);\r\n    }\r\n    if (!theme || !SUCCEEDED(theme::GetThemeColor(theme, WP_CAPTION, 0,\r\n        (activeWindow || dwm::IsCompositionEnabled()) ? TMT_CAPTIONTEXT : TMT_INACTIVECAPTIONTEXT, &textColor))) {\r\n            textColor = (activeWindow || dwm::IsCompositionEnabled()) ? GetSysColor(COLOR_CAPTIONTEXT)\r\n                                                                      : GetSysColor(COLOR_INACTIVECAPTIONTEXT);\r\n    }\r\n}\r\n\r\nButtonInfo::ButtonInfo(): hwnd(nullptr), highlighted(false), inactive(false) {\r\n    SetMargins(0, 0, 0, 0);\r\n}\r\n\r\nvoid ButtonInfo::SetMargins(LONG left, LONG top, LONG right, LONG bottom)\r\n{\r\n    margins.left   = left;\r\n    margins.top    = top;\r\n    margins.right  = right;\r\n    margins.bottom = bottom;\r\n}\r\n\r\nstatic LRESULT CALLBACK WndProcCaption(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)\r\n{\r\n    WindowInfo *win = FindWindowInfoByHwnd(hwnd);\r\n\r\n    switch (message)\r\n    {\r\n    case WM_COMMAND:\r\n        if (win && BN_CLICKED == HIWORD(wParam)) {\r\n            WPARAM cmd;\r\n            WORD button = LOWORD(wParam) - BTN_ID_FIRST;\r\n            switch (button)\r\n            {\r\n                case CB_MINIMIZE:  cmd = SC_MINIMIZE; break;\r\n                case CB_MAXIMIZE:  cmd = SC_MAXIMIZE; break;\r\n                case CB_RESTORE:   cmd = SC_RESTORE;  break;\r\n                case CB_CLOSE:     cmd = SC_CLOSE;    break;\r\n                default:           cmd = 0;           break;\r\n            }\r\n            if (cmd)\r\n                PostMessage(win->hwndFrame, WM_SYSCOMMAND, cmd, 0);\r\n\r\n            if (button == CB_MENU) {\r\n                if (!KillTimer(hwnd, DO_NOT_REOPEN_MENU_TIMER_ID) && !win->caption->isMenuOpen) {\r\n                    HWND hMenuButton = win->caption->btn[CB_MENU].hwnd;\r\n                    WindowRect wr(hMenuButton);\r\n                    win->caption->isMenuOpen = true;\r\n                    if (!lParam)    // if the WM_COMMAND message was sent as a result of keyboard command\r\n                        InvalidateRgn(hMenuButton, nullptr, FALSE);\r\n                    MenuBarAsPopupMenu(win, wr.x, wr.y + wr.dy);\r\n                    win->caption->isMenuOpen = false;\r\n                    if (!lParam)\r\n                        InvalidateRgn(hMenuButton, nullptr, FALSE);\r\n                    SetTimer(hwnd, DO_NOT_REOPEN_MENU_TIMER_ID, DO_NOT_REOPEN_MENU_DELAY_IN_MS, nullptr);\r\n                }\r\n                SetFocus(win->hwndFrame);\r\n            }\r\n        }\r\n        break;\r\n\r\n    case WM_TIMER:\r\n        if (wParam == DO_NOT_REOPEN_MENU_TIMER_ID)\r\n            KillTimer(hwnd, DO_NOT_REOPEN_MENU_TIMER_ID);\r\n        break;\r\n\r\n    case WM_SIZE:\r\n        if (win)\r\n            RelayoutCaption(win);\r\n        break;\r\n\r\n    case WM_NCHITTEST:\r\n        return HTTRANSPARENT;\r\n\r\n    case WM_ERASEBKGND:\r\n        if (win)\r\n            PaintCaptionBackground((HDC)wParam, win, true);\r\n        return TRUE;\r\n\r\n    case WM_DRAWITEM:\r\n        if (win) {\r\n            DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)lParam;\r\n            int index = dis->CtlID - BTN_ID_FIRST;\r\n            if (CB_MENU == index && win->caption->isMenuOpen)\r\n                dis->itemState |= ODS_SELECTED;\r\n            if (win->caption->btn[index].highlighted)\r\n                dis->itemState |= ODS_HOTLIGHT;\r\n            else if (win->caption->btn[index].inactive)\r\n                dis->itemState |= ODS_INACTIVE;\r\n            DrawCaptionButton(dis, win);\r\n        }\r\n        return TRUE;\r\n\r\n    case WM_THEMECHANGED:\r\n        if (win)\r\n            win->caption->UpdateTheme();\r\n        break;\r\n\r\n    default:\r\n        return DefWindowProc(hwnd, message, wParam, lParam);\r\n    }\r\n    return 0;\r\n}\r\n\r\nstatic WNDPROC DefWndProcButton = nullptr;\r\nstatic LRESULT CALLBACK WndProcButton(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)\r\n{\r\n    WindowInfo *win = FindWindowInfoByHwnd(hwnd);\r\n    int index = (int)GetWindowLongPtr(hwnd, GWLP_ID) - BTN_ID_FIRST;\r\n\r\n    switch (message)\r\n    {\r\n        case WM_MOUSEMOVE:\r\n            {\r\n                ClientRect rc(hwnd);\r\n                if (!rc.Contains(PointI(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)))) {\r\n                    ReleaseCapture();\r\n                    return 0;\r\n                }\r\n                if (win) {\r\n                    TRACKMOUSEEVENT tme;\r\n                    tme.cbSize = sizeof(TRACKMOUSEEVENT);\r\n                    tme.dwFlags = TME_QUERY;\r\n                    tme.hwndTrack = hwnd;\r\n                    TrackMouseEvent(&tme);\r\n                    if (0 == (tme.dwFlags & TME_LEAVE)) {\r\n                        tme.dwFlags = TME_LEAVE;\r\n                        tme.hwndTrack = hwnd;\r\n                        TrackMouseEvent(&tme);\r\n                        win->caption->btn[index].highlighted = true;\r\n                        InvalidateRgn(hwnd, nullptr, FALSE);\r\n                    }\r\n                    return 0;\r\n                }\r\n            }\r\n            break;\r\n\r\n        case WM_MOUSELEAVE:\r\n            if (win) {\r\n                win->caption->btn[index].highlighted = false;\r\n                InvalidateRgn(hwnd, nullptr, FALSE);\r\n                return 0;\r\n            }\r\n            break;\r\n\r\n        case WM_ERASEBKGND:\r\n            return TRUE;\r\n\r\n        case WM_LBUTTONDOWN:\r\n            if (CB_MENU == index)\r\n                PostMessage(hwnd, WM_LBUTTONUP, 0, lParam);\r\n            return CallWindowProc(DefWndProcButton, hwnd, message, wParam, lParam);\r\n\r\n        case WM_KEYDOWN:\r\n            if (CB_MENU == index && win && !win->caption->isMenuOpen &&\r\n                (VK_RETURN == wParam || VK_SPACE == wParam || VK_UP == wParam || VK_DOWN == wParam))\r\n                PostMessage(hwnd, BM_CLICK, 0, 0);\r\n            return CallWindowProc(DefWndProcButton, hwnd, message, wParam, lParam);\r\n    }\r\n    return CallWindowProc(DefWndProcButton, hwnd, message, wParam, lParam);\r\n}\r\n\r\nvoid CreateCaption(WindowInfo *win)\r\n{\r\n    win->hwndCaption = CreateWindow(CUSTOM_CAPTION_CLASS_NAME, L\"\", WS_CHILDWINDOW | WS_CLIPCHILDREN,\r\n        0, 0, 0, 0, win->hwndFrame, (HMENU)0, GetModuleHandle(nullptr), nullptr);\r\n\r\n    win->caption = new CaptionInfo(win->hwndCaption);\r\n\r\n    for (UINT_PTR i = CB_BTN_FIRST; i < CB_BTN_COUNT; i++) {\r\n        HWND btn = CreateWindowExW(0, L\"BUTTON\", L\"\", WS_CHILDWINDOW | WS_VISIBLE | BS_OWNERDRAW,\r\n            0, 0, 0, 0, win->hwndCaption, (HMENU)(BTN_ID_FIRST + i), GetModuleHandle(nullptr), nullptr);\r\n\r\n        if (!DefWndProcButton)\r\n            DefWndProcButton = (WNDPROC)GetWindowLongPtr(btn, GWLP_WNDPROC);\r\n        SetWindowLongPtr(btn, GWLP_WNDPROC, (LONG_PTR)WndProcButton);\r\n\r\n        win->caption->btn[i].hwnd = btn;\r\n    }\r\n}\r\n\r\nvoid RegisterCaptionWndClass()\r\n{\r\n    WNDCLASSEX wcex;\r\n    FillWndClassEx(wcex, CUSTOM_CAPTION_CLASS_NAME, WndProcCaption);\r\n    wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);\r\n    RegisterClassEx(&wcex);\r\n}\r\n\r\nvoid RelayoutCaption(WindowInfo *win)\r\n{\r\n    ClientRect rc(win->hwndCaption);\r\n    CaptionInfo *ci = win->caption;\r\n    ButtonInfo *button;\r\n    DeferWinPosHelper dh;\r\n\r\n    if (dwm::IsCompositionEnabled()) {\r\n        // hide the buttons, because DWM paints and serves them, when the composition is enabled\r\n        for (int i = CB_MINIMIZE; i <= CB_CLOSE; i++) {\r\n            ShowWindow(ci->btn[i].hwnd, SW_HIDE);\r\n        }\r\n    }\r\n    else {\r\n        int xEdge = GetSystemMetrics(SM_CXEDGE);\r\n        int yEdge = GetSystemMetrics(SM_CYEDGE);\r\n        bool isClassicStyle = win->caption->theme == nullptr;\r\n        // Under WIN XP GetSystemMetrics(SM_CXSIZE) returns wrong (previous) value, after theme change\r\n        // or font size change. For this to work, I assume that SM_CXSIZE == SM_CYSIZE.\r\n        int btnDx = GetSystemMetrics(IsVistaOrGreater() ? SM_CXSIZE : SM_CYSIZE) - xEdge * (isClassicStyle ? 1 : 2);\r\n        int btnDy = GetSystemMetrics(SM_CYSIZE) - yEdge * 2;\r\n        bool maximized = IsZoomed(win->hwndFrame);\r\n        int yPosBtn = rc.y + (maximized ? 0 : yEdge);\r\n        int topMargin = maximized ? yEdge : 0;\r\n\r\n        button = &ci->btn[CB_CLOSE];\r\n        rc.dx -= btnDx + xEdge;\r\n        int rightMargin = maximized ? xEdge : 0;\r\n        dh.SetWindowPos(button->hwnd, nullptr, rc.x + rc.dx, yPosBtn, btnDx + rightMargin, btnDy + topMargin, SWP_NOZORDER | SWP_SHOWWINDOW);\r\n        button->SetMargins(0, topMargin, rightMargin, 0);\r\n\r\n        button = &ci->btn[CB_RESTORE];\r\n        rc.dx -= btnDx + xEdge;\r\n        dh.SetWindowPos(button->hwnd, nullptr, rc.x + rc.dx, yPosBtn, btnDx, btnDy + topMargin,\r\n                        SWP_NOZORDER | (maximized ? SWP_SHOWWINDOW : SWP_HIDEWINDOW));\r\n        button->SetMargins(0, topMargin, 0, 0);\r\n\r\n        button = &ci->btn[CB_MAXIMIZE];\r\n        dh.SetWindowPos(button->hwnd, nullptr, rc.x + rc.dx, yPosBtn, btnDx, btnDy + topMargin,\r\n                        SWP_NOZORDER | (maximized ? SWP_HIDEWINDOW : SWP_SHOWWINDOW));\r\n        button->SetMargins(0, topMargin, 0, 0);\r\n\r\n        button = &ci->btn[CB_MINIMIZE];\r\n        rc.dx -= btnDx + (isClassicStyle ? 0 : xEdge);\r\n        dh.SetWindowPos(button->hwnd, nullptr, rc.x + rc.dx, yPosBtn, btnDx, btnDy + topMargin, SWP_NOZORDER | SWP_SHOWWINDOW);\r\n        button->SetMargins(0, topMargin, 0, 0);\r\n    }\r\n\r\n    button = &ci->btn[CB_MENU];\r\n    int tabHeight = GetTabbarHeight(win->hwndFrame);\r\n    rc.y += rc.dy - tabHeight;\r\n    dh.SetWindowPos(button->hwnd, nullptr, rc.x, rc.y, tabHeight, tabHeight, SWP_NOZORDER);\r\n    button->SetMargins(0, 0, 0, 0);\r\n\r\n    rc.x += tabHeight;\r\n    rc.dx -= tabHeight;\r\n    dh.SetWindowPos(win->hwndTabBar, nullptr, rc.x, rc.y, rc.dx, tabHeight, SWP_NOZORDER);\r\n    dh.End();\r\n}\r\n\r\nstatic void DrawCaptionButton(DRAWITEMSTRUCT *item, WindowInfo *win)\r\n{\r\n    if (!item || item->CtlType != ODT_BUTTON)\r\n        return;\r\n\r\n    RectI rButton = RectI::FromRECT(item->rcItem);\r\n\r\n    DoubleBuffer buffer(item->hwndItem, rButton);\r\n    HDC memDC = buffer.GetDC();\r\n\r\n    UINT button = item->CtlID - BTN_ID_FIRST;\r\n    ButtonInfo *bi = &win->caption->btn[button];\r\n    RectI rc(rButton);\r\n    rc.x += bi->margins.left;\r\n    rc.y += bi->margins.top;\r\n    rc.dx -= bi->margins.left + bi->margins.right;\r\n    rc.dy -= bi->margins.top + bi->margins.bottom;\r\n\r\n    int partId = 0, stateId;\r\n    UINT state = (UINT)-1;\r\n    switch (button)\r\n    {\r\n        case CB_MINIMIZE:\r\n            partId = WP_MINBUTTON;\r\n            state = DFCS_CAPTIONMIN;\r\n            break;\r\n        case CB_MAXIMIZE:\r\n            partId = WP_MAXBUTTON;\r\n            state = DFCS_CAPTIONMAX;\r\n            break;\r\n        case CB_RESTORE:\r\n            partId = WP_RESTOREBUTTON;\r\n            state = DFCS_CAPTIONRESTORE;\r\n            break;\r\n        case CB_CLOSE:\r\n            partId = WP_CLOSEBUTTON;\r\n            state = DFCS_CAPTIONCLOSE;\r\n            break;\r\n    }\r\n\r\n    if (ODS_SELECTED & item->itemState) {\r\n        stateId = CBS_PUSHED;\r\n        state |= DFCS_PUSHED;\r\n    }\r\n    else if (ODS_HOTLIGHT & item->itemState) {\r\n        stateId = CBS_HOT;\r\n        state |= DFCS_HOT;\r\n    }\r\n    else if (ODS_DISABLED & item->itemState) {\r\n        stateId = CBS_DISABLED;\r\n        state |= DFCS_INACTIVE;\r\n    }\r\n    else if (ODS_INACTIVE & item->itemState)\r\n        stateId = CBS_INACTIVE;\r\n    else\r\n        stateId = CBS_NORMAL;\r\n\r\n    // draw system button\r\n    if (partId) {\r\n        if (rc != rButton || theme::IsThemeBackgroundPartiallyTransparent(win->caption->theme, partId, stateId))\r\n            PaintCaptionBackground(memDC, win, false);\r\n\r\n        RECT r = rc.ToRECT();\r\n        if (win->caption->theme)\r\n            theme::DrawThemeBackground(win->caption->theme, memDC, partId, stateId, &r, nullptr);\r\n        else\r\n            DrawFrameControl(memDC, &r, DFC_CAPTION, state);\r\n    }\r\n\r\n    // draw menu's button\r\n    if (button == CB_MENU) {\r\n        PaintCaptionBackground(memDC, win, false);\r\n        Graphics graphics(memDC);\r\n\r\n        if (CBS_PUSHED != stateId && ODS_FOCUS & item->itemState)\r\n            stateId = CBS_HOT;\r\n\r\n        BYTE buttonRGB = 1;\r\n        if (CBS_PUSHED == stateId)\r\n            buttonRGB = 0;\r\n        else if (CBS_HOT == stateId)\r\n            buttonRGB = 255;\r\n\r\n        if (buttonRGB != 1) {\r\n            // paint the background\r\n            if (GetLightness(win->caption->textColor) > GetLightness(win->caption->bgColor))\r\n                buttonRGB ^= 0xff;\r\n            BYTE buttonAlpha = BYTE((255 - abs((int)GetLightness(win->caption->bgColor) - buttonRGB)) / 2);\r\n            SolidBrush br(Color(buttonAlpha, buttonRGB, buttonRGB, buttonRGB));\r\n            graphics.FillRectangle(&br, rc.x, rc.y, rc.dx, rc.dy);\r\n        }\r\n        // draw the three lines\r\n        COLORREF c = win->caption->textColor;\r\n        Pen p(Color(GetRValueSafe(c), GetGValueSafe(c), GetBValueSafe(c)), floor((float)rc.dy / 8.0f));\r\n        rc.Inflate(-int(rc.dx * 0.2f + 0.5f), -int(rc.dy * 0.3f + 0.5f));\r\n        for (int i = 0; i < 3; i++) {\r\n            graphics.DrawLine(&p, rc.x, rc.y + i * rc.dy / 2, rc.x + rc.dx, rc.y + i * rc.dy / 2);\r\n        }\r\n    }\r\n\r\n    buffer.Flush(item->hDC);\r\n}\r\n\r\nvoid PaintParentBackground(HWND hwnd, HDC hdc)\r\n{\r\n    HWND parent = GetParent(hwnd);\r\n    POINT pt = {0, 0};\r\n    MapWindowPoints(hwnd, parent, &pt, 1);\r\n    SetViewportOrgEx(hdc, -pt.x, -pt.y, &pt);\r\n    SendMessage(parent, WM_ERASEBKGND, (WPARAM)hdc, 0);\r\n    SetViewportOrgEx(hdc, pt.x, pt.y, nullptr);\r\n}\r\n\r\nstatic void PaintCaptionBackground(HDC hdc, WindowInfo *win, bool useDoubleBuffer)\r\n{\r\n    RECT rClip;\r\n    GetClipBox(hdc, &rClip);\r\n    RectI r = RectI::FromRECT(rClip);\r\n\r\n    COLORREF c = win->caption->bgColor;\r\n\r\n    if (win->caption->bgAlpha == 0) {\r\n        PaintParentBackground(win->hwndCaption, hdc);\r\n    }\r\n    else if (win->caption->bgAlpha == 255) {\r\n        Graphics graphics(hdc);\r\n        SolidBrush br(Color(GetRValueSafe(c), GetGValueSafe(c), GetBValueSafe(c)));\r\n        graphics.FillRectangle(&br, r.x, r.y, r.dx, r.dy);\r\n    }\r\n    else {\r\n        DoubleBuffer buffer(win->hwndCaption, r);\r\n        HDC memDC = useDoubleBuffer ? buffer.GetDC() : hdc;\r\n        PaintParentBackground(win->hwndCaption, memDC);\r\n        Graphics graphics(memDC);\r\n        SolidBrush br(Color(win->caption->bgAlpha, GetRValueSafe(c), GetGValueSafe(c), GetBValueSafe(c)));\r\n        graphics.FillRectangle(&br, r.x, r.y, r.dx, r.dy);\r\n        if (useDoubleBuffer)\r\n            buffer.Flush(hdc);\r\n    }\r\n}\r\n\r\nstatic void DrawFrame(HWND hwnd, COLORREF color, bool drawEdge=true)\r\n{\r\n    HDC hdc = GetWindowDC(hwnd);\r\n\r\n    RECT rWindow, rClient;\r\n    GetWindowRect(hwnd, &rWindow);\r\n    GetClientRect(hwnd, &rClient);\r\n    // convert the client rectangle to window coordinates and exclude it from the clipping region\r\n    MapWindowPoints(hwnd, HWND_DESKTOP, (LPPOINT)&rClient, 2);\r\n    OffsetRect(&rClient, -rWindow.left, -rWindow.top);\r\n    ExcludeClipRect(hdc, rClient.left, rClient.top, rClient.right, rClient.bottom);\r\n    // convert the window rectangle, from screen to window coordinates, and draw the frame\r\n    OffsetRect(&rWindow, -rWindow.left, -rWindow.top);\r\n    HBRUSH br = CreateSolidBrush(color);\r\n    FillRect(hdc, &rWindow, br);\r\n    DeleteObject(br);\r\n    if (drawEdge)\r\n        DrawEdge(hdc, &rWindow, EDGE_RAISED, BF_RECT | BF_FLAT);\r\n\r\n    ReleaseDC(hwnd, hdc);\r\n}\r\n\r\n// accelerator key which was pressed when invoking the \"menubar\",\r\n// needs to be passed from WM_SYSCOMMAND to WM_INITMENUPOPUP\r\n// (can be static because there can only be one menu active at a time)\r\nstatic WCHAR gMenuAccelPressed = 0;\r\n\r\nLRESULT CustomCaptionFrameProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, bool *callDef, WindowInfo *win)\r\n{\r\n    if (dwm::IsCompositionEnabled()) {\r\n        // Pass the messages to DwmDefWindowProc first. It serves the hit testing for the buttons.\r\n        LRESULT res;\r\n        if (dwm::DefWindowProc_(hwnd, msg, wParam, lParam, &res)) {\r\n            *callDef = false;\r\n            return res;\r\n        }\r\n\r\n        switch (msg)\r\n        {\r\n        case WM_NCPAINT:\r\n#if NON_CLIENT_BAND > 0\r\n            if (NeedsNonClientBandHack(hwnd))\r\n                DrawFrame(hwnd, RGB(0,0,0), false);\r\n#endif\r\n            break;\r\n\r\n        case WM_ERASEBKGND:\r\n            {\r\n                // Erase the background only under the extended frame.\r\n                *callDef = false;\r\n                if (win->extendedFrameHeight == 0)\r\n                    return TRUE;\r\n                ClientRect rc(hwnd);\r\n                rc.dy = win->extendedFrameHeight;\r\n                HRGN extendedFrameRegion = CreateRectRgn(rc.x, rc.y, rc.x + rc.dx, rc.y + rc.dy);\r\n                int newRegionComplexity = ExtSelectClipRgn((HDC)wParam, extendedFrameRegion, RGN_AND);\r\n                DeleteObject(extendedFrameRegion);\r\n                if (newRegionComplexity == NULLREGION)\r\n                    return TRUE;\r\n            }\r\n            return DefWindowProc(hwnd, msg, wParam, lParam);\r\n\r\n        case WM_SIZE:\r\n            // Extend the translucent frame in the client area.\r\n            if (wParam == SIZE_MAXIMIZED || wParam == SIZE_RESTORED) {\r\n                int frameThickness = 0;\r\n                if (win::HasFrameThickness(hwnd)) {\r\n                    frameThickness = GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CXPADDEDBORDER);\r\n                }\r\n                int captionHeight = 0;\r\n                if (win::HasCaption(hwnd)) {\r\n                    float tabScale = CAPTION_TABBAR_HEIGHT_FACTOR;\r\n                    if (IsZoomed(hwnd)) {\r\n                        tabScale = 1.f;\r\n                    }\r\n                    captionHeight = GetTabbarHeight(win->hwndFrame, tabScale);\r\n                }\r\n                int top = frameThickness + captionHeight;\r\n                int bottom = NeedsNonClientBandHack(hwnd) ? NON_CLIENT_BAND : 0;\r\n                MARGINS margins = { 0, 0, top, bottom };\r\n                dwm::ExtendFrameIntoClientArea(hwnd, &margins);\r\n                win->extendedFrameHeight = frameThickness + captionHeight;\r\n            }\r\n            break;\r\n\r\n        case WM_NCACTIVATE:\r\n            win->caption->UpdateColors((bool)wParam);\r\n            if (!IsIconic(hwnd))\r\n                RedrawWindow(win->hwndCaption, nullptr, nullptr, RDW_ERASE | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN);\r\n            break;\r\n        }\r\n    }\r\n    else {\r\n        switch (msg)\r\n        {\r\n        case WM_SETTINGCHANGE:\r\n            if (wParam == SPI_SETNONCLIENTMETRICS)\r\n                RelayoutCaption(win);\r\n            break;\r\n\r\n        case WM_NCPAINT:\r\n            DrawFrame(hwnd, win->caption->bgColor);\r\n            *callDef = false;\r\n            return 0;\r\n\r\n        case WM_NCACTIVATE:\r\n            win->caption->UpdateColors((bool)wParam);\r\n            for (int i = CB_BTN_FIRST; i < CB_BTN_COUNT; i++)\r\n                win->caption->btn[i].inactive = wParam == FALSE;\r\n            if (!IsIconic(hwnd)) {\r\n                DrawFrame(hwnd, win->caption->bgColor);\r\n                RedrawWindow(win->hwndCaption, nullptr, nullptr, RDW_ERASE | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN);\r\n                *callDef = false;\r\n                return TRUE;\r\n            }\r\n            break;\r\n\r\n        case WM_NCUAHDRAWCAPTION:\r\n        case WM_NCUAHDRAWFRAME:\r\n            DrawFrame(hwnd, win->caption->bgColor);\r\n            *callDef = false;\r\n            return TRUE;\r\n\r\n        case WM_POPUPSYSTEMMENU:\r\n        case WM_SETCURSOR:\r\n        case WM_SETTEXT:\r\n        case WM_SETICON:\r\n            if (!win->caption->theme && IsWindowVisible(hwnd)) {\r\n                // Remove the WS_VISIBLE style to prevent DefWindowProc from drawing\r\n                // in the caption's area when processing these mesages.\r\n                // TODO: can't such drawing be prevented by handling WM_(NC)PAINT instead?\r\n                ToggleWindowStyle(hwnd, WS_VISIBLE, false);\r\n                LRESULT res = DefWindowProc(hwnd, msg, wParam, lParam);\r\n                ToggleWindowStyle(hwnd, WS_VISIBLE, true);\r\n                *callDef = false;\r\n                return res;\r\n            }\r\n            break;\r\n        }\r\n    }\r\n\r\n    // These messages must be handled in both modes - with or without DWM composition.\r\n    switch (msg)\r\n    {\r\n    case WM_NCCALCSIZE:\r\n        {\r\n            // In order to have custom caption, we have to include its area in the client rectangle.\r\n            RECT *r = wParam == TRUE ? &((NCCALCSIZE_PARAMS *)lParam)->rgrc[0] : (RECT *)lParam;\r\n            RECT rWindow = *r;\r\n            // Let DefWindowProc calculate the client rectangle.\r\n            DefWindowProc(hwnd, msg, wParam, lParam);\r\n            RECT rClient = *r;\r\n            // Modify the client rectangle to include the caption's area.\r\n            if (dwm::IsCompositionEnabled())\r\n                rClient.top = rWindow.top;\r\n            else\r\n                rClient.top = rWindow.top + rWindow.bottom - rClient.bottom;\r\n            // prevents the hiding of the topmost windows, when this window is maximized\r\n            if (NeedsNonClientBandHack(hwnd))\r\n                rClient.bottom -= NON_CLIENT_BAND;\r\n            *r = rClient;\r\n            *callDef = false;\r\n        }\r\n        return 0;\r\n\r\n    case WM_NCHITTEST:\r\n        {\r\n            // Provide hit testing for the caption.\r\n            PointI pt(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));\r\n            RectI rClient = MapRectToWindow(ClientRect(hwnd), hwnd, HWND_DESKTOP);\r\n            WindowRect rCaption(win->hwndCaption);\r\n            if (rClient.Contains(pt) && pt.y < rCaption.y + rCaption.dy) {\r\n                *callDef = false;\r\n                if (pt.y < rCaption.y)\r\n                    return HTTOP;\r\n                return HTCAPTION;\r\n            }\r\n        }\r\n        break;\r\n\r\n    case WM_NCRBUTTONUP:\r\n        // Prepare and show the system menu.\r\n        if (wParam == HTCAPTION) {\r\n            HMENU menu = GetUpdatedSystemMenu(hwnd);\r\n            UINT flags = TPM_RIGHTBUTTON | TPM_NONOTIFY | TPM_RETURNCMD;\r\n            if (GetSystemMetrics(SM_MENUDROPALIGNMENT))\r\n                flags |= TPM_RIGHTALIGN;\r\n            WPARAM cmd = TrackPopupMenu(menu, flags, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0, hwnd, nullptr);\r\n            if (cmd)\r\n                PostMessage(hwnd, WM_SYSCOMMAND, cmd, 0);\r\n            *callDef = false;\r\n            return 0;\r\n        }\r\n        break;\r\n\r\n    case WM_SYSCOMMAND:\r\n        if (wParam == SC_KEYMENU) {\r\n            // Show the \"menu bar\" (and the desired submenu)\r\n            gMenuAccelPressed = (WCHAR)lParam;\r\n            if (' ' == gMenuAccelPressed) {\r\n                // map space to the accelerator of the Window menu\r\n                if (str::FindChar(_TR(\"&Window\"), '&'))\r\n                    gMenuAccelPressed = *(str::FindChar(_TR(\"&Window\"), '&') + 1);\r\n            }\r\n            PostMessage(win->hwndCaption, WM_COMMAND, MAKELONG(BTN_ID_FIRST + CB_MENU, BN_CLICKED), 0);\r\n            *callDef = false;\r\n            return 0;\r\n        }\r\n        break;\r\n\r\n    case WM_INITMENUPOPUP:\r\n        if (gMenuAccelPressed) {\r\n            // poorly documented hack: find the menu window and send it the accelerator key\r\n            HWND hMenu = FindWindow(UNDOCUMENTED_MENU_CLASS_NAME, nullptr);\r\n            if (hMenu) {\r\n                if ('a' <= gMenuAccelPressed && gMenuAccelPressed <= 'z')\r\n                    gMenuAccelPressed -= 'a' - 'A';\r\n                if ('A' <= gMenuAccelPressed && gMenuAccelPressed <= 'Z')\r\n                    PostMessage(hMenu, WM_KEYDOWN, gMenuAccelPressed, 0);\r\n                else\r\n                    PostMessage(hMenu, WM_CHAR, gMenuAccelPressed, 0);\r\n            }\r\n            gMenuAccelPressed = 0;\r\n        }\r\n        break;\r\n\r\n    case WM_SYSCOLORCHANGE:\r\n        win->caption->UpdateColors(hwnd == GetForegroundWindow());\r\n        break;\r\n\r\n    case WM_DWMCOLORIZATIONCOLORCHANGED:\r\n        win->caption->UpdateColors(hwnd == GetForegroundWindow());\r\n        if (!IsIconic(hwnd))\r\n            RedrawWindow(win->hwndCaption, nullptr, nullptr, RDW_ERASE | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN);\r\n        break;\r\n\r\n    case WM_DWMCOMPOSITIONCHANGED:\r\n        win->caption->UpdateBackgroundAlpha();\r\n        ClientRect cr(hwnd);\r\n        SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE);\r\n        if (ClientRect(hwnd) == cr)\r\n            SendMessage(hwnd, WM_SIZE, 0, MAKELONG(cr.dx, cr.dy));\r\n        *callDef = false;\r\n        return 0;\r\n    }\r\n\r\n    *callDef = true;\r\n    return 0;\r\n}\r\n\r\nstatic HMENU GetUpdatedSystemMenu(HWND hwnd)\r\n{\r\n    // don't reset the system menu (in case other applications have added to it)\r\n    HMENU menu = GetSystemMenu(hwnd, FALSE);\r\n\r\n    // prevents drawing in the caption's area\r\n    // TODO: how can this even happen?\r\n    ToggleWindowStyle(hwnd, WS_VISIBLE, false);\r\n\r\n    bool maximized = IsZoomed(hwnd);\r\n    EnableMenuItem(menu, SC_SIZE, maximized ? MF_GRAYED : MF_ENABLED);\r\n    EnableMenuItem(menu, SC_MOVE, maximized ? MF_GRAYED : MF_ENABLED);\r\n    EnableMenuItem(menu, SC_MINIMIZE, MF_ENABLED);\r\n    EnableMenuItem(menu, SC_MAXIMIZE, maximized ? MF_GRAYED : MF_ENABLED);\r\n    EnableMenuItem(menu, SC_CLOSE, MF_ENABLED);\r\n    EnableMenuItem(menu, SC_RESTORE, maximized ? MF_ENABLED : MF_GRAYED);\r\n    SetMenuDefaultItem(menu, maximized ? SC_RESTORE : SC_MAXIMIZE, FALSE);\r\n\r\n    ToggleWindowStyle(hwnd, WS_VISIBLE, true);\r\n\r\n    return menu;\r\n}\r\n\r\nstatic void MenuBarAsPopupMenu(WindowInfo *win, int x, int y)\r\n{\r\n    int count = GetMenuItemCount(win->menu);\r\n    if (count <= 0)\r\n        return;\r\n    HMENU popup = CreatePopupMenu();\r\n\r\n    MENUITEMINFO mii = { 0 };\r\n    mii.cbSize = sizeof(MENUITEMINFO);\r\n    mii.fMask = MIIM_SUBMENU | MIIM_STRING;\r\n    for (int i = 0; i < count; i++) {\r\n        mii.dwTypeData = nullptr;\r\n        GetMenuItemInfo(win->menu, i, TRUE, &mii);\r\n        if (!mii.hSubMenu || !mii.cch)\r\n            continue;\r\n        mii.cch++;\r\n        ScopedMem<WCHAR> subMenuName(AllocArray<WCHAR>(mii.cch));\r\n        mii.dwTypeData = subMenuName;\r\n        GetMenuItemInfo(win->menu, i, TRUE, &mii);\r\n        AppendMenu(popup, MF_POPUP | MF_STRING, (UINT_PTR)mii.hSubMenu, subMenuName);\r\n    }\r\n    AppendMenu(popup, MF_POPUP | MF_STRING, (UINT_PTR)GetUpdatedSystemMenu(win->hwndFrame), _TR(\"&Window\"));\r\n    count++;\r\n\r\n    if (IsUIRightToLeft())\r\n        x += ClientRect(win->caption->btn[CB_MENU].hwnd).dx;\r\n    TrackPopupMenu(popup, TPM_LEFTALIGN, x, y, 0, win->hwndFrame, nullptr);\r\n\r\n    while (count > 0) {\r\n        --count;\r\n        RemoveMenu(popup, count, MF_BYPOSITION);\r\n    }\r\n    DestroyMenu(popup);\r\n}\r\n\r\n"
  },
  {
    "path": "src/Caption.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// factor by how large the non-maximized caption should be in relation to the tabbar\r\n#define CAPTION_TABBAR_HEIGHT_FACTOR  1.25f\r\n\r\nvoid CreateCaption(WindowInfo *win);\r\nvoid RegisterCaptionWndClass();\r\nLRESULT CustomCaptionFrameProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, bool *callDef, WindowInfo *win);\r\nvoid PaintParentBackground(HWND hwnd, HDC hdc);\r\nvoid RelayoutCaption(WindowInfo *win);\r\n\r\nenum CaptionButtons {\r\n    CB_BTN_FIRST = 0,\r\n    CB_MINIMIZE = CB_BTN_FIRST,\r\n    CB_MAXIMIZE,\r\n    CB_RESTORE,\r\n    CB_CLOSE,\r\n    CB_MENU,\r\n    CB_BTN_COUNT\r\n};\r\n\r\nstruct ButtonInfo\r\n{\r\n    HWND hwnd;\r\n    bool highlighted;\r\n    bool inactive;\r\n    // form the inner rectangle where the button image is drawn\r\n    RECT margins;\r\n\r\n    ButtonInfo();\r\n\r\n    void SetMargins(LONG left, LONG top, LONG right, LONG bottom);\r\n};\r\n\r\nclass CaptionInfo\r\n{\r\n    HWND hwnd;\r\n\r\npublic:\r\n    ButtonInfo  btn[CB_BTN_COUNT];\r\n    HTHEME      theme;\r\n    COLORREF    bgColor;\r\n    COLORREF    textColor;\r\n    BYTE        bgAlpha;\r\n    bool        isMenuOpen;\r\n\r\n    explicit CaptionInfo(HWND hwndCaption);\r\n    ~CaptionInfo();\r\n\r\n    void UpdateTheme();\r\n    void UpdateColors(bool activeWindow);\r\n    void UpdateBackgroundAlpha();\r\n};\r\n"
  },
  {
    "path": "src/ChmDoc.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#define PPC_BSTR\r\n#include <chm_lib.h>\r\n#include \"ByteReader.h\"\r\n#include \"FileUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"TrivialHtmlParser.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EbookBase.h\"\r\n#include \"ChmDoc.h\"\r\n\r\nChmDoc::~ChmDoc()\r\n{\r\n    chm_close(chmHandle);\r\n}\r\n\r\nbool ChmDoc::HasData(const char *fileName)\r\n{\r\n    if (!fileName)\r\n        return nullptr;\r\n\r\n    ScopedMem<char> tmpName;\r\n    if (!str::StartsWith(fileName, \"/\")) {\r\n        tmpName.Set(str::Join(\"/\", fileName));\r\n        fileName = tmpName;\r\n    }\r\n    else if (str::StartsWith(fileName, \"///\"))\r\n        fileName += 2;\r\n\r\n    struct chmUnitInfo info;\r\n    return chm_resolve_object(chmHandle, fileName, &info) == CHM_RESOLVE_SUCCESS;\r\n}\r\n\r\nunsigned char *ChmDoc::GetData(const char *fileName, size_t *lenOut)\r\n{\r\n    ScopedMem<char> fileNameTmp;\r\n    if (!str::StartsWith(fileName, \"/\")) {\r\n        fileNameTmp.Set(str::Join(\"/\", fileName));\r\n        fileName = fileNameTmp;\r\n    } else if (str::StartsWith(fileName, \"///\")) {\r\n        fileName += 2;\r\n    }\r\n\r\n    struct chmUnitInfo info;\r\n    int res = chm_resolve_object(chmHandle, fileName, &info);\r\n    if (CHM_RESOLVE_SUCCESS != res && str::FindChar(fileName, '\\\\')) {\r\n        // Microsoft's HTML Help CHM viewer tolerates backslashes in URLs\r\n        fileNameTmp.Set(str::Dup(fileName));\r\n        str::TransChars(fileNameTmp, \"\\\\\", \"/\");\r\n        fileName = fileNameTmp;\r\n        res = chm_resolve_object(chmHandle, fileName, &info);\r\n    }\r\n    if (CHM_RESOLVE_SUCCESS != res)\r\n        return nullptr;\r\n    size_t len = (size_t)info.length;\r\n    if (len > 128 * 1024 * 1024) {\r\n        // don't allow anything above 128 MB\r\n        return nullptr;\r\n    }\r\n\r\n    // +1 for 0 terminator for C string compatibility\r\n    ScopedMem<unsigned char> data((unsigned char *)malloc(len + 1));\r\n    if (!data)\r\n        return nullptr;\r\n    if (!chm_retrieve_object(chmHandle, &info, data.Get(), 0, len))\r\n        return nullptr;\r\n    data[len] = '\\0';\r\n\r\n    if (lenOut)\r\n        *lenOut = len;\r\n    return data.StealData();\r\n}\r\n\r\nchar *ChmDoc::ToUtf8(const unsigned char *text, UINT overrideCP)\r\n{\r\n    const char *s = (char *)text;\r\n    if (str::StartsWith(s, UTF8_BOM))\r\n        return str::Dup(s + 3);\r\n    if (overrideCP)\r\n        return str::ToMultiByte(s, overrideCP, CP_UTF8);\r\n    if (CP_UTF8 == codepage)\r\n        return str::Dup(s);\r\n    return str::ToMultiByte(s, codepage, CP_UTF8);\r\n}\r\n\r\nWCHAR *ChmDoc::ToStr(const char *text)\r\n{\r\n    return str::conv::FromCodePage(text, codepage);\r\n}\r\n\r\nstatic char *GetCharZ(const unsigned char *data, size_t len, size_t off)\r\n{\r\n    if (off >= len)\r\n        return nullptr;\r\n    CrashIf(!memchr(data + off, '\\0', len - off + 1)); // data is zero-terminated\r\n    const char *str = (char *)data + off;\r\n    if (str::IsEmpty(str))\r\n        return nullptr;\r\n    return str::Dup(str);\r\n}\r\n\r\n// http://www.nongnu.org/chmspec/latest/Internal.html#WINDOWS\r\nvoid ChmDoc::ParseWindowsData()\r\n{\r\n    size_t windowsLen, stringsLen;\r\n    ScopedMem<unsigned char> windowsData(GetData(\"/#WINDOWS\", &windowsLen));\r\n    ScopedMem<unsigned char> stringsData(GetData(\"/#STRINGS\", &stringsLen));\r\n    if (!windowsData || !stringsData)\r\n        return;\r\n    if (windowsLen <= 8)\r\n        return;\r\n\r\n    ByteReader rw(windowsData, windowsLen);\r\n    DWORD entries = rw.DWordLE(0);\r\n    DWORD entrySize = rw.DWordLE(4);\r\n    if (entrySize < 188)\r\n        return;\r\n\r\n    for (DWORD i = 0; i < entries && (i + 1) * entrySize <= windowsLen; i++) {\r\n        DWORD off = 8 + i * entrySize;\r\n        if (!title) {\r\n            DWORD strOff = rw.DWordLE(off + 0x14);\r\n            title.Set(GetCharZ(stringsData, stringsLen, strOff));\r\n        }\r\n        if (!tocPath) {\r\n            DWORD strOff = rw.DWordLE(off + 0x60);\r\n            tocPath.Set(GetCharZ(stringsData, stringsLen, strOff));\r\n        }\r\n        if (!indexPath) {\r\n            DWORD strOff = rw.DWordLE(off + 0x64);\r\n            indexPath.Set(GetCharZ(stringsData, stringsLen, strOff));\r\n        }\r\n        if (!homePath) {\r\n            DWORD strOff = rw.DWordLE(off + 0x68);\r\n            homePath.Set(GetCharZ(stringsData, stringsLen, strOff));\r\n        }\r\n    }\r\n}\r\n\r\n#define CP_CHM_DEFAULT 1252\r\n\r\nstatic UINT LcidToCodepage(DWORD lcid)\r\n{\r\n    // cf. http://msdn.microsoft.com/en-us/library/bb165625(v=VS.90).aspx\r\n    static struct {\r\n        DWORD lcid;\r\n        UINT codepage;\r\n    } lcidToCodepage[] = {\r\n        { 1025, 1256 }, { 2052,  936 }, { 1028,  950 }, { 1029, 1250 },\r\n        { 1032, 1253 }, { 1037, 1255 }, { 1038, 1250 }, { 1041,  932 },\r\n        { 1042,  949 }, { 1045, 1250 }, { 1049, 1251 }, { 1051, 1250 },\r\n        { 1060, 1250 }, { 1055, 1254 }, { 1026, 1251 },\r\n    };\r\n\r\n    for (int i = 0; i < dimof(lcidToCodepage); i++) {\r\n        if (lcid == lcidToCodepage[i].lcid)\r\n            return lcidToCodepage[i].codepage;\r\n    }\r\n\r\n    return CP_CHM_DEFAULT;\r\n}\r\n\r\n// http://www.nongnu.org/chmspec/latest/Internal.html#SYSTEM\r\nbool ChmDoc::ParseSystemData()\r\n{\r\n    size_t dataLen;\r\n    ScopedMem<unsigned char> data(GetData(\"/#SYSTEM\", &dataLen));\r\n    if (!data)\r\n        return false;\r\n\r\n    ByteReader r(data, dataLen);\r\n    DWORD len = 0;\r\n    // Note: skipping DWORD version at offset 0. It's supposed to be 2 or 3.\r\n    for (size_t off = 4; off + 4 < dataLen; off += len + 4) {\r\n        // Note: at some point we seem to get off-sync i.e. I'm seeing\r\n        // many entries with type == 0 and len == 0. Seems harmless.\r\n        len = r.WordLE(off + 2);\r\n        if (len == 0)\r\n            continue;\r\n        WORD type = r.WordLE(off);\r\n        switch (type) {\r\n        case 0:\r\n            if (!tocPath)\r\n                tocPath.Set(GetCharZ(data, dataLen, off + 4));\r\n            break;\r\n        case 1:\r\n            if (!indexPath)\r\n                indexPath.Set(GetCharZ(data, dataLen, off + 4));\r\n            break;\r\n        case 2:\r\n            if (!homePath)\r\n                homePath.Set(GetCharZ(data, dataLen, off + 4));\r\n            break;\r\n        case 3:\r\n            if (!title)\r\n                title.Set(GetCharZ(data, dataLen, off + 4));\r\n            break;\r\n        case 4:\r\n            if (!codepage && len >= 4)\r\n                codepage = LcidToCodepage(r.DWordLE(off + 4));\r\n            break;\r\n        case 6:\r\n            // compiled file - ignore\r\n            break;\r\n        case 9:\r\n            if (!creator)\r\n                creator.Set(GetCharZ(data, dataLen, off + 4));\r\n            break;\r\n        case 16:\r\n            // default font - ignore\r\n            break;\r\n        }\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nchar *ChmDoc::ResolveTopicID(unsigned int id)\r\n{\r\n    size_t ivbLen = 0;\r\n    ScopedMem<unsigned char> ivbData(GetData(\"/#IVB\", &ivbLen));\r\n    ByteReader br(ivbData, ivbLen);\r\n    if ((ivbLen % 8) != 4 || ivbLen - 4 != br.DWordLE(0))\r\n        return nullptr;\r\n\r\n    for (size_t off = 4; off < ivbLen; off += 8) {\r\n        if (br.DWordLE(off) == id) {\r\n            size_t stringsLen = 0;\r\n            ScopedMem<unsigned char> stringsData(GetData(\"/#STRINGS\", &stringsLen));\r\n            return GetCharZ(stringsData, stringsLen, br.DWordLE(off + 4));\r\n        }\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nvoid ChmDoc::FixPathCodepage(ScopedMem<char>& path, UINT& fileCP)\r\n{\r\n    if (!path || HasData(path))\r\n        return;\r\n\r\n    ScopedMem<char> utf8Path(ToUtf8((unsigned char *)path.Get()));\r\n    if (HasData(utf8Path)) {\r\n        path.Set(utf8Path.StealData());\r\n        fileCP = codepage;\r\n    }\r\n    else if (fileCP != codepage) {\r\n        utf8Path.Set(ToUtf8((unsigned char *)path.Get(), fileCP));\r\n        if (HasData(utf8Path)) {\r\n            path.Set(utf8Path.StealData());\r\n            codepage = fileCP;\r\n        }\r\n    }\r\n}\r\n\r\nbool ChmDoc::Load(const WCHAR *fileName)\r\n{\r\n    chmHandle = chm_open((WCHAR *)fileName);\r\n    if (!chmHandle)\r\n        return false;\r\n\r\n    ParseWindowsData();\r\n    if (!ParseSystemData())\r\n        return false;\r\n\r\n    UINT fileCodepage = codepage;\r\n    char header[24] = { 0 };\r\n    if (file::ReadN(fileName, header, sizeof(header))) {\r\n        DWORD lcid = ByteReader(header, sizeof(header)).DWordLE(20);\r\n        fileCodepage = LcidToCodepage(lcid);\r\n    }\r\n    if (!codepage)\r\n        codepage = fileCodepage;\r\n    // if file and #SYSTEM codepage disagree, prefer #SYSTEM's (unless it leads to wrong paths)\r\n    FixPathCodepage(homePath, fileCodepage);\r\n    FixPathCodepage(tocPath, fileCodepage);\r\n    FixPathCodepage(indexPath, fileCodepage);\r\n    if (GetACP() == codepage)\r\n        codepage = CP_ACP;\r\n\r\n    if (!HasData(homePath)) {\r\n        const char *pathsToTest[] = {\r\n            \"/index.htm\", \"/index.html\", \"/default.htm\", \"/default.html\"\r\n        };\r\n        for (int i = 0; i < dimof(pathsToTest); i++) {\r\n            if (HasData(pathsToTest[i]))\r\n                homePath.Set(str::Dup(pathsToTest[i]));\r\n        }\r\n        if (!HasData(homePath))\r\n            return false;\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nWCHAR *ChmDoc::GetProperty(DocumentProperty prop)\r\n{\r\n    ScopedMem<WCHAR> result;\r\n    if (Prop_Title == prop && title)\r\n        result.Set(ToStr(title));\r\n    else if (Prop_CreatorApp == prop && creator)\r\n        result.Set(ToStr(creator));\r\n    // TODO: shouldn't it be up to the front-end to normalize whitespace?\r\n    if (result) {\r\n        // TODO: original code called str::RemoveChars(result, \"\\n\\r\\t\")\r\n        str::NormalizeWS(result);\r\n    }\r\n    return result.StealData();\r\n}\r\n\r\nconst char *ChmDoc::GetHomePath()\r\n{\r\n    return homePath;\r\n}\r\n\r\nstatic int ChmEnumerateEntry(struct chmFile *chmHandle, struct chmUnitInfo *info, void *data)\r\n{\r\n    UNUSED(chmHandle);\r\n    if (info->path) {\r\n        Vec<char *> *paths = (Vec<char *> *)data;\r\n        paths->Append(str::Dup(info->path));\r\n    }\r\n    return CHM_ENUMERATOR_CONTINUE;\r\n}\r\n\r\nVec<char *> *ChmDoc::GetAllPaths()\r\n{\r\n    Vec<char *> *paths = new Vec<char *>();\r\n    chm_enumerate(chmHandle, CHM_ENUMERATE_FILES | CHM_ENUMERATE_NORMAL, ChmEnumerateEntry, paths);\r\n    return paths;\r\n}\r\n\r\n/* The html looks like:\r\n<li>\r\n  <object type=\"text/sitemap\">\r\n    <param name=\"Name\" value=\"Main Page\">\r\n    <param name=\"Local\" value=\"0789729717_main.html\">\r\n    <param name=\"ImageNumber\" value=\"12\">\r\n  </object>\r\n  <ul> ... children ... </ul>\r\n<li>\r\n  ... siblings ...\r\n*/\r\nstatic bool VisitChmTocItem(EbookTocVisitor *visitor, HtmlElement *el, UINT cp, int level)\r\n{\r\n    CrashIf(el->tag != Tag_Object || level > 1 && (!el->up || el->up->tag != Tag_Li));\r\n\r\n    ScopedMem<WCHAR> name, local;\r\n    for (el = el->GetChildByTag(Tag_Param); el; el = el->next) {\r\n        if (Tag_Param != el->tag)\r\n            continue;\r\n        ScopedMem<WCHAR> attrName(el->GetAttribute(\"name\"));\r\n        ScopedMem<WCHAR> attrVal(el->GetAttribute(\"value\"));\r\n        if (attrName && attrVal && cp != CP_CHM_DEFAULT) {\r\n            ScopedMem<char> bytes(str::conv::ToCodePage(attrVal, CP_CHM_DEFAULT));\r\n            attrVal.Set(str::conv::FromCodePage(bytes, cp));\r\n        }\r\n        if (!attrName || !attrVal)\r\n            /* ignore incomplete/unneeded <param> */;\r\n        else if (str::EqI(attrName, L\"Name\"))\r\n            name.Set(attrVal.StealData());\r\n        else if (str::EqI(attrName, L\"Local\")) {\r\n            // remove the ITS protocol and any filename references from the URLs\r\n            if (str::Find(attrVal, L\"::/\"))\r\n                attrVal.Set(str::Dup(str::Find(attrVal, L\"::/\") + 3));\r\n            local.Set(attrVal.StealData());\r\n        }\r\n    }\r\n    if (!name)\r\n        return false;\r\n\r\n    visitor->Visit(name, local, level);\r\n    return true;\r\n}\r\n\r\n/* The html looks like:\r\n<li>\r\n  <object type=\"text/sitemap\">\r\n    <param name=\"Keyword\" value=\"- operator\">\r\n    <param name=\"Name\" value=\"Subtraction Operator (-)\">\r\n    <param name=\"Local\" value=\"html/vsoprsubtract.htm\">\r\n    <param name=\"Name\" value=\"Subtraction Operator (-)\">\r\n    <param name=\"Local\" value=\"html/js56jsoprsubtract.htm\">\r\n  </object>\r\n  <ul> ... optional children ... </ul>\r\n<li>\r\n  ... siblings ...\r\n*/\r\nstatic bool VisitChmIndexItem(EbookTocVisitor *visitor, HtmlElement *el, UINT cp, int level)\r\n{\r\n    CrashIf(el->tag != Tag_Object || level > 1 && (!el->up || el->up->tag != Tag_Li));\r\n\r\n    WStrVec references;\r\n    ScopedMem<WCHAR> keyword, name;\r\n    for (el = el->GetChildByTag(Tag_Param); el; el = el->next) {\r\n        if (Tag_Param != el->tag)\r\n            continue;\r\n        ScopedMem<WCHAR> attrName(el->GetAttribute(\"name\"));\r\n        ScopedMem<WCHAR> attrVal(el->GetAttribute(\"value\"));\r\n        if (attrName && attrVal && cp != CP_CHM_DEFAULT) {\r\n            ScopedMem<char> bytes(str::conv::ToCodePage(attrVal, CP_CHM_DEFAULT));\r\n            attrVal.Set(str::conv::FromCodePage(bytes, cp));\r\n        }\r\n        if (!attrName || !attrVal)\r\n            /* ignore incomplete/unneeded <param> */;\r\n        else if (str::EqI(attrName, L\"Keyword\"))\r\n            keyword.Set(attrVal.StealData());\r\n        else if (str::EqI(attrName, L\"Name\")) {\r\n            name.Set(attrVal.StealData());\r\n            // some CHM documents seem to use a lonely Name instead of Keyword\r\n            if (!keyword)\r\n                keyword.Set(str::Dup(name));\r\n        }\r\n        else if (str::EqI(attrName, L\"Local\") && name) {\r\n            // remove the ITS protocol and any filename references from the URLs\r\n            if (str::Find(attrVal, L\"::/\"))\r\n                attrVal.Set(str::Dup(str::Find(attrVal, L\"::/\") + 3));\r\n            references.Append(name.StealData());\r\n            references.Append(attrVal.StealData());\r\n        }\r\n    }\r\n    if (!keyword)\r\n        return false;\r\n\r\n    if (references.Count() == 2) {\r\n        visitor->Visit(keyword, references.At(1), level);\r\n        return true;\r\n    }\r\n    visitor->Visit(keyword, nullptr, level);\r\n    for (size_t i = 0; i < references.Count(); i += 2) {\r\n        visitor->Visit(references.At(i), references.At(i + 1), level + 1);\r\n    }\r\n    return true;\r\n}\r\n\r\nstatic void WalkChmTocOrIndex(EbookTocVisitor *visitor, HtmlElement *list, UINT cp, bool isIndex, int level=1)\r\n{\r\n    CrashIf(Tag_Ul != list->tag);\r\n\r\n    // some broken ToCs wrap every <li> into its own <ul>\r\n    for (; list && Tag_Ul == list->tag; list = list->next) {\r\n        for (HtmlElement *el = list->down; el; el = el->next) {\r\n            if (Tag_Li != el->tag)\r\n                continue; // ignore unexpected elements\r\n\r\n            bool valid;\r\n            HtmlElement *elObj = el->GetChildByTag(Tag_Object);\r\n            if (!elObj)\r\n                valid = false;\r\n            else if (isIndex)\r\n                valid = VisitChmIndexItem(visitor, elObj, cp, level);\r\n            else\r\n                valid = VisitChmTocItem(visitor, elObj, cp, level);\r\n            if (!valid)\r\n                continue; // skip incomplete elements and all their children\r\n\r\n            HtmlElement *nested = el->GetChildByTag(Tag_Ul);\r\n            // some broken ToCs have the <ul> follow right *after* a <li>\r\n            if (!nested && el->next && Tag_Ul == el->next->tag)\r\n                nested = el->next;\r\n            if (nested)\r\n                WalkChmTocOrIndex(visitor, nested, cp, isIndex, level + 1);\r\n        }\r\n    }\r\n}\r\n\r\n// ignores any <ul><li> list structure and just extracts a linear list of <object type=\"text/sitemap\">...</object>\r\nstatic bool WalkBrokenChmTocOrIndex(EbookTocVisitor *visitor, HtmlParser& p, UINT cp, bool isIndex)\r\n{\r\n    bool hadOne = false;\r\n\r\n    HtmlElement *el = p.FindElementByName(\"body\");\r\n    while ((el = p.FindElementByName(\"object\", el)) != nullptr) {\r\n        ScopedMem<WCHAR> type(el->GetAttribute(\"type\"));\r\n        if (!str::EqI(type, L\"text/sitemap\"))\r\n            continue;\r\n        if (isIndex)\r\n            hadOne |= VisitChmIndexItem(visitor, el, cp, 1);\r\n        else\r\n            hadOne |= VisitChmTocItem(visitor, el, cp, 1);\r\n    }\r\n\r\n    return hadOne;\r\n}\r\n\r\nbool ChmDoc::ParseTocOrIndex(EbookTocVisitor *visitor, const char *path, bool isIndex)\r\n{\r\n    if (!path)\r\n        return false;\r\n    ScopedMem<unsigned char> htmlData(GetData(path, nullptr));\r\n    const char *html = (char *)htmlData.Get();\r\n    if (!html)\r\n        return false;\r\n\r\n    HtmlParser p;\r\n    UINT cp = codepage;\r\n    // detect UTF-8 content by BOM\r\n    if (str::StartsWith(html, UTF8_BOM)) {\r\n        html += 3;\r\n        cp = CP_UTF8;\r\n    }\r\n    // enforce the default codepage, so that pre-encoded text and\r\n    // entities are in the same codepage and VisitChmTocItem yields\r\n    // consistent results\r\n    HtmlElement *el = p.Parse(html, CP_CHM_DEFAULT);\r\n    if (!el)\r\n        return false;\r\n    el = p.FindElementByName(\"body\");\r\n    // since <body> is optional, also continue without one\r\n    el = p.FindElementByName(\"ul\", el);\r\n    if (!el)\r\n        return WalkBrokenChmTocOrIndex(visitor, p, cp, isIndex);\r\n    WalkChmTocOrIndex(visitor, el, cp, isIndex);\r\n    return true;\r\n}\r\n\r\nbool ChmDoc::HasToc() const\r\n{\r\n    return tocPath != nullptr;\r\n}\r\n\r\nbool ChmDoc::ParseToc(EbookTocVisitor *visitor)\r\n{\r\n    return ParseTocOrIndex(visitor, tocPath, false);\r\n}\r\n\r\nbool ChmDoc::HasIndex() const\r\n{\r\n    return indexPath != nullptr;\r\n}\r\n\r\nbool ChmDoc::ParseIndex(EbookTocVisitor *visitor)\r\n{\r\n    return ParseTocOrIndex(visitor, indexPath, true);\r\n}\r\n\r\nbool ChmDoc::IsSupportedFile(const WCHAR *fileName, bool sniff)\r\n{\r\n    if (sniff)\r\n        return file::StartsWith(fileName, \"ITSF\");\r\n\r\n    return str::EndsWithI(fileName, L\".chm\");\r\n}\r\n\r\nChmDoc *ChmDoc::CreateFromFile(const WCHAR *fileName)\r\n{\r\n    ChmDoc *doc = new ChmDoc();\r\n    if (!doc || !doc->Load(fileName)) {\r\n        delete doc;\r\n        return nullptr;\r\n    }\r\n    return doc;\r\n}\r\n"
  },
  {
    "path": "src/ChmDoc.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nclass ChmDoc {\r\n    struct chmFile *chmHandle;\r\n\r\n    // Data parsed from /#WINDOWS, /#STRINGS, /#SYSTEM files inside CHM file\r\n    ScopedMem<char> title;\r\n    ScopedMem<char> tocPath;\r\n    ScopedMem<char> indexPath;\r\n    ScopedMem<char> homePath;\r\n    ScopedMem<char> creator;\r\n    UINT codepage;\r\n\r\n    void ParseWindowsData();\r\n    bool ParseSystemData();\r\n    bool ParseTocOrIndex(EbookTocVisitor *visitor, const char *path, bool isIndex);\r\n    void FixPathCodepage(ScopedMem<char>& path, UINT& fileCP);\r\n\r\n    bool Load(const WCHAR *fileName);\r\n\r\npublic:\r\n    ChmDoc() : chmHandle(nullptr), codepage(0) { }\r\n    ~ChmDoc();\r\n\r\n    bool HasData(const char *fileName);\r\n    unsigned char *GetData(const char *fileName, size_t *lenOut);\r\n    char *ResolveTopicID(unsigned int id);\r\n\r\n    char *ToUtf8(const unsigned char *text, UINT overrideCP=0);\r\n    WCHAR *ToStr(const char *text);\r\n\r\n    WCHAR *GetProperty(DocumentProperty prop);\r\n    const char *GetHomePath();\r\n    Vec<char *> *GetAllPaths();\r\n\r\n    bool HasToc() const;\r\n    bool ParseToc(EbookTocVisitor *visitor);\r\n    bool HasIndex() const;\r\n    bool ParseIndex(EbookTocVisitor *visitor);\r\n\r\n    static bool IsSupportedFile(const WCHAR *fileName, bool sniff=false);\r\n    static ChmDoc *CreateFromFile(const WCHAR *fileName);\r\n};\r\n"
  },
  {
    "path": "src/ChmModel.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"Dict.h\"\r\n#include \"HtmlWindow.h\"\r\n#include \"UITask.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EbookBase.h\"\r\n#include \"ChmDoc.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"ChmModel.h\"\r\n#include \"GlobalPrefs.h\"\r\n\r\nstatic bool IsExternalUrl(const WCHAR *url)\r\n{\r\n    return str::StartsWithI(url, L\"http://\") ||\r\n           str::StartsWithI(url, L\"https://\") ||\r\n           str::StartsWithI(url, L\"mailto:\");\r\n}\r\n\r\nclass ChmTocItem : public DocTocItem, public PageDestination {\r\npublic:\r\n    const WCHAR *url; // owned by ChmModel::poolAllocator or ChmNamedDest::myUrl\r\n\r\n    ChmTocItem(const WCHAR *title, int pageNo, const WCHAR *url) :\r\n        DocTocItem((WCHAR *)title, pageNo), url(url) { }\r\n    virtual ~ChmTocItem() {\r\n        // prevent title from being freed\r\n        title = nullptr;\r\n    }\r\n\r\n    virtual PageDestination *GetLink() { return url ? this : nullptr; }\r\n\r\n    // PageDestination\r\n    PageDestType GetDestType() const override {\r\n        return !url ? Dest_None : IsExternalUrl(url) ? Dest_LaunchURL : Dest_ScrollTo;\r\n    }\r\n    int GetDestPageNo() const override { return pageNo; }\r\n    RectD GetDestRect() const override {\r\n        return RectD(DEST_USE_DEFAULT, DEST_USE_DEFAULT, DEST_USE_DEFAULT, DEST_USE_DEFAULT);\r\n    }\r\n    WCHAR *GetDestValue() const override {\r\n        return url && IsExternalUrl(url) ? str::Dup(url) : nullptr;\r\n    }\r\n    WCHAR *GetDestName() const override {\r\n        return url && !IsExternalUrl(url) ? str::Dup(url) : nullptr;\r\n    }\r\n};\r\n\r\nclass ChmNamedDest : public ChmTocItem {\r\n    ScopedMem<WCHAR> myUrl;\r\n\r\npublic:\r\n    ChmNamedDest(const WCHAR *url, int pageNo) :\r\n        ChmTocItem(nullptr, pageNo, nullptr), myUrl(str::Dup(url)) {\r\n        this->url = this->title = myUrl;\r\n    }\r\n    virtual ~ChmNamedDest() { }\r\n};\r\n\r\nclass HtmlWindowHandler : public HtmlWindowCallback {\r\n    ChmModel *cm;\r\n\r\npublic:\r\n    HtmlWindowHandler(ChmModel *cm) : cm(cm) { }\r\n    virtual ~HtmlWindowHandler() { }\r\n\r\n    virtual bool OnBeforeNavigate(const WCHAR *url, bool newWindow) { return cm->OnBeforeNavigate(url, newWindow); }\r\n    virtual void OnDocumentComplete(const WCHAR *url) { cm->OnDocumentComplete(url); }\r\n    virtual void OnLButtonDown() { cm->OnLButtonDown(); }\r\n    virtual const unsigned char *GetDataForUrl(const WCHAR *url, size_t *len) { return cm->GetDataForUrl(url, len); }\r\n    virtual void DownloadData(const WCHAR *url, const unsigned char *data, size_t len) { cm->DownloadData(url, data, len); }\r\n};\r\n\r\nstruct ChmTocTraceItem {\r\n    const WCHAR *title; // owned by ChmModel::poolAllocator\r\n    const WCHAR *url;   // owned by ChmModel::poolAllocator\r\n    int level;\r\n    int pageNo;\r\n\r\n    explicit ChmTocTraceItem(const WCHAR *title=nullptr, const WCHAR *url=nullptr, int level=0, int pageNo=0) :\r\n        title(title), url(url), level(level), pageNo(pageNo) { }\r\n};\r\n\r\nChmModel::ChmModel(ControllerCallback *cb) : Controller(cb),\r\n    doc(nullptr), htmlWindow(nullptr), htmlWindowCb(nullptr), tocTrace(nullptr),\r\n    currentPageNo(1), initZoom(INVALID_ZOOM)\r\n{\r\n    InitializeCriticalSection(&docAccess);\r\n}\r\n\r\nChmModel::~ChmModel()\r\n{\r\n    EnterCriticalSection(&docAccess);\r\n    // TODO: deleting htmlWindow seems to spin a modal loop which\r\n    //       can lead to WM_PAINT being dispatched for the parent\r\n    //       hwnd and then crashing in SumatraPDF.cpp's DrawDocument\r\n    delete htmlWindow;\r\n    delete htmlWindowCb;\r\n    delete doc;\r\n    delete tocTrace;\r\n    DeleteVecMembers(urlDataCache);\r\n    LeaveCriticalSection(&docAccess);\r\n    DeleteCriticalSection(&docAccess);\r\n}\r\n\r\nint ChmModel::PageCount() const\r\n{\r\n    return (int)pages.Count();\r\n}\r\n\r\nWCHAR *ChmModel::GetProperty(DocumentProperty prop)\r\n{\r\n    return doc->GetProperty(prop);\r\n}\r\n\r\nbool ChmModel::SetParentHwnd(HWND hwnd)\r\n{\r\n    CrashIf(htmlWindow || htmlWindowCb);\r\n    htmlWindowCb = new HtmlWindowHandler(this);\r\n    htmlWindow = HtmlWindow::Create(hwnd, htmlWindowCb);\r\n    if (!htmlWindow) {\r\n        delete htmlWindowCb;\r\n        htmlWindowCb = nullptr;\r\n        return false;\r\n    }\r\n    return true;\r\n}\r\n\r\nvoid ChmModel::RemoveParentHwnd()\r\n{\r\n    delete htmlWindow;\r\n    htmlWindow = nullptr;\r\n    delete htmlWindowCb;\r\n    htmlWindowCb = nullptr;\r\n}\r\n\r\nvoid ChmModel::PrintCurrentPage(bool showUI)\r\n{\r\n    if (htmlWindow)\r\n        htmlWindow->PrintCurrentPage(showUI);\r\n}\r\n\r\nvoid ChmModel::FindInCurrentPage()\r\n{\r\n    if (htmlWindow)\r\n        htmlWindow->FindInCurrentPage();\r\n}\r\n\r\nvoid ChmModel::SelectAll()\r\n{\r\n    if (htmlWindow)\r\n        htmlWindow->SelectAll();\r\n}\r\n\r\nvoid ChmModel::CopySelection()\r\n{\r\n    if (htmlWindow)\r\n        htmlWindow->CopySelection();\r\n}\r\n\r\nLRESULT ChmModel::PassUIMsg(UINT msg, WPARAM wParam, LPARAM lParam) {\r\n    if (!htmlWindow)\r\n        return 0;\r\n    return htmlWindow->SendMsg(msg, wParam, lParam);\r\n}\r\n\r\nvoid ChmModel::DisplayPage(const WCHAR *pageUrl)\r\n{\r\n    if (IsExternalUrl(pageUrl)) {\r\n        // open external links in an external browser\r\n        // (same as for PDF, XPS, etc. documents)\r\n        if (cb) {\r\n            ChmTocItem item(nullptr, 0, pageUrl);\r\n            cb->GotoLink(&item);\r\n        }\r\n        return;\r\n    }\r\n\r\n    int pageNo = pages.Find(ScopedMem<WCHAR>(url::GetFullPath(pageUrl))) + 1;\r\n    if (pageNo)\r\n        currentPageNo = pageNo;\r\n\r\n    // This is a hack that seems to be needed for some chm files where\r\n    // url starts with \"..\\\" even though it's not accepted by ie as\r\n    // a correct its: url. There's a possibility it breaks some other\r\n    // chm files (I don't know such cases, though).\r\n    // A more robust solution would try to match with the actual\r\n    // names of files inside chm package.\r\n    if (str::StartsWith(pageUrl, L\"..\\\\\"))\r\n        pageUrl += 3;\r\n\r\n    if (str::StartsWith(pageUrl, L\"/\"))\r\n        pageUrl++;\r\n\r\n    CrashIf(!htmlWindow);\r\n    if (htmlWindow)\r\n        htmlWindow->NavigateToDataUrl(pageUrl);\r\n}\r\n\r\nvoid ChmModel::ScrollToLink(PageDestination *link)\r\n{\r\n    CrashIf(link->GetDestType() != Dest_ScrollTo);\r\n    ScopedMem<WCHAR> url(link->GetDestName());\r\n    if (url)\r\n        DisplayPage(url);\r\n}\r\n\r\nbool ChmModel::CanNavigate(int dir) const\r\n{\r\n    if (!htmlWindow)\r\n        return false;\r\n    if (dir < 0)\r\n        return htmlWindow->canGoBack;\r\n    return htmlWindow->canGoForward;\r\n}\r\n\r\nvoid ChmModel::Navigate(int dir)\r\n{\r\n    if (!htmlWindow)\r\n        return;\r\n    if (dir < 0) {\r\n        for (; dir < 0 && CanNavigate(dir); dir++)\r\n            htmlWindow->GoBack();\r\n    } else {\r\n        for (; dir > 0 && CanNavigate(dir); dir--)\r\n            htmlWindow->GoForward();\r\n    }\r\n}\r\n\r\nvoid ChmModel::SetZoomVirtual(float zoom, PointI *fixPt)\r\n{\r\n    UNUSED(fixPt);\r\n    if (zoom > 0)\r\n        zoom = limitValue(zoom, ZOOM_MIN, ZOOM_MAX);\r\n    if (zoom <= 0 || !IsValidZoom(zoom))\r\n        zoom = 100.0f;\r\n    ZoomTo(zoom);\r\n    initZoom = zoom;\r\n}\r\n\r\nvoid ChmModel::ZoomTo(float zoomLevel)\r\n{\r\n    if (htmlWindow)\r\n        htmlWindow->SetZoomPercent((int)zoomLevel);\r\n}\r\n\r\nfloat ChmModel::GetZoomVirtual(bool absolute) const\r\n{\r\n    UNUSED(absolute);\r\n    if (!htmlWindow)\r\n        return 100;\r\n    return (float)htmlWindow->GetZoomPercent();\r\n}\r\n\r\nclass ChmTocBuilder : public EbookTocVisitor {\r\n    ChmDoc *doc;\r\n\r\n    WStrList *pages;\r\n    Vec<ChmTocTraceItem> *tocTrace;\r\n    Allocator *allocator;\r\n    // TODO: could use dict::MapWStrToInt instead of StrList in the caller as well\r\n    dict::MapWStrToInt urlsSet;\r\n\r\n    // We fake page numbers by doing a depth-first traversal of\r\n    // toc tree and considering each unique html page in toc tree\r\n    // as a page\r\n    int CreatePageNoForURL(const WCHAR *url) {\r\n        if (!url || IsExternalUrl(url))\r\n            return 0;\r\n\r\n        ScopedMem<WCHAR> plainUrl(url::GetFullPath(url));\r\n        int pageNo = (int)pages->Count() + 1;\r\n        bool inserted = urlsSet.Insert(plainUrl, pageNo, &pageNo);\r\n        if (inserted) {\r\n            pages->Append(plainUrl.StealData());\r\n            CrashIf((size_t)pageNo != pages->Count());\r\n        } else {\r\n            CrashIf((size_t)pageNo == pages->Count() + 1);\r\n        }\r\n        return pageNo;\r\n    }\r\n\r\npublic:\r\n    ChmTocBuilder(ChmDoc *doc, WStrList *pages, Vec<ChmTocTraceItem> *tocTrace, Allocator *allocator) :\r\n        doc(doc), pages(pages), tocTrace(tocTrace), allocator(allocator)\r\n        {\r\n            for (int i = 0; i < (int)pages->Count(); i++) {\r\n                const WCHAR *url = pages->At(i);\r\n                bool inserted = urlsSet.Insert(url, i + 1, nullptr);\r\n                CrashIf(!inserted);\r\n            }\r\n        }\r\n\r\n    virtual void Visit(const WCHAR *name, const WCHAR *url, int level) {\r\n        int pageNo = CreatePageNoForURL(url);\r\n        name = Allocator::StrDup(allocator, name);\r\n        url = Allocator::StrDup(allocator, url);\r\n        tocTrace->Append(ChmTocTraceItem(name, url, level, pageNo));\r\n    }\r\n};\r\n\r\nbool ChmModel::Load(const WCHAR *fileName)\r\n{\r\n    this->fileName.Set(str::Dup(fileName));\r\n    doc = ChmDoc::CreateFromFile(fileName);\r\n    if (!doc)\r\n        return false;\r\n\r\n    // always make the document's homepage page 1\r\n    pages.Append(str::conv::FromAnsi(doc->GetHomePath()));\r\n\r\n    // parse the ToC here, since page numbering depends on it\r\n    tocTrace = new Vec<ChmTocTraceItem>();\r\n    ChmTocBuilder tmpTocBuilder(doc, &pages, tocTrace, &poolAlloc);\r\n    doc->ParseToc(&tmpTocBuilder);\r\n    CrashIf(pages.Count() == 0);\r\n    return pages.Count() > 0;\r\n}\r\n\r\nclass ChmCacheEntry {\r\npublic:\r\n    const WCHAR *url; // owned by ChmModel::poolAllocator\r\n    unsigned char *data;\r\n    size_t size;\r\n\r\n    explicit ChmCacheEntry(const WCHAR *url) : url(url), data(nullptr), size(0) { }\r\n    ~ChmCacheEntry() { free(data); }\r\n};\r\n\r\nChmCacheEntry *ChmModel::FindDataForUrl(const WCHAR *url)\r\n{\r\n    for (size_t i = 0; i < urlDataCache.Count(); i++) {\r\n        ChmCacheEntry *e = urlDataCache.At(i);\r\n        if (str::Eq(url, e->url))\r\n            return e;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\n// Called after html document has been loaded.\r\n// Sync the state of the ui with the page (show\r\n// the right page number, select the right item in toc tree)\r\nvoid ChmModel::OnDocumentComplete(const WCHAR *url)\r\n{\r\n    if (!url || IsBlankUrl(url))\r\n        return;\r\n    if (*url == '/')\r\n        ++url;\r\n    int pageNo = pages.Find(ScopedMem<WCHAR>(url::GetFullPath(url))) + 1;\r\n    if (pageNo) {\r\n        currentPageNo = pageNo;\r\n        // TODO: setting zoom before the first page is loaded seems not to work\r\n        // (might be a regression from between r4593 and r4629)\r\n        if (IsValidZoom(initZoom)) {\r\n            SetZoomVirtual(initZoom);\r\n            initZoom = INVALID_ZOOM;\r\n        }\r\n        if (cb)\r\n            cb->PageNoChanged(this, pageNo);\r\n    }\r\n}\r\n\r\n// Called before we start loading html for a given url. Will block\r\n// loading if returns false.\r\nbool ChmModel::OnBeforeNavigate(const WCHAR *url, bool newWindow)\r\n{\r\n    // ensure that JavaScript doesn't keep the focus\r\n    // in the HtmlWindow when a new page is loaded\r\n    if (cb)\r\n        cb->FocusFrame(false);\r\n\r\n    if (newWindow) {\r\n        // don't allow new MSIE windows to be opened\r\n        // instead pass the URL to the system's default browser\r\n        if (url && cb) {\r\n            ChmTocItem item(nullptr, 0, url);\r\n            cb->GotoLink(&item);\r\n        }\r\n        return false;\r\n    }\r\n    return true;\r\n}\r\n\r\n// Load and cache data for a given url inside CHM file.\r\nconst unsigned char *ChmModel::GetDataForUrl(const WCHAR *url, size_t *len)\r\n{\r\n    ScopedCritSec scope(&docAccess);\r\n    ScopedMem<WCHAR> plainUrl(url::GetFullPath(url));\r\n    ChmCacheEntry *e = FindDataForUrl(plainUrl);\r\n    if (!e) {\r\n        e = new ChmCacheEntry(Allocator::StrDup(&poolAlloc, plainUrl));\r\n        ScopedMem<char> urlUtf8(str::conv::ToUtf8(plainUrl));\r\n        e->data = doc->GetData(urlUtf8, &e->size);\r\n        if (!e->data) {\r\n            delete e;\r\n            return nullptr;\r\n        }\r\n        urlDataCache.Append(e);\r\n    }\r\n    if (len)\r\n        *len = e->size;\r\n    return e->data;\r\n}\r\n\r\nvoid ChmModel::DownloadData(const WCHAR *url, const unsigned char *data, size_t len)\r\n{\r\n    if (cb)\r\n        cb->SaveDownload(url, data, len);\r\n}\r\n\r\nvoid ChmModel::OnLButtonDown()\r\n{\r\n    if (cb)\r\n        cb->FocusFrame(true);\r\n}\r\n\r\n// named destinations are either in-document URLs or Alias topic IDs\r\nPageDestination *ChmModel::GetNamedDest(const WCHAR *name)\r\n{\r\n    ScopedMem<WCHAR> plainUrl(url::GetFullPath(name));\r\n    ScopedMem<char> urlUtf8(str::conv::ToUtf8(plainUrl));\r\n    if (!doc->HasData(urlUtf8)) {\r\n        unsigned int topicID;\r\n        if (str::Parse(name, L\"%u%$\", &topicID)) {\r\n            urlUtf8.Set(doc->ResolveTopicID(topicID));\r\n            if (urlUtf8 && doc->HasData(urlUtf8)) {\r\n                plainUrl.Set(str::conv::FromUtf8(urlUtf8));\r\n                name = plainUrl;\r\n            }\r\n            else\r\n                urlUtf8.Set(nullptr);\r\n        }\r\n        else\r\n            urlUtf8.Set(nullptr);\r\n    }\r\n    int pageNo = pages.Find(plainUrl) + 1;\r\n    if (!pageNo && !str::IsEmpty(urlUtf8.Get())) {\r\n        // some documents use redirection URLs which aren't listed in the ToC\r\n        // return pageNo=1 for these, as ScrollToLink will ignore that anyway\r\n        // but LinkHandler::ScrollTo doesn't\r\n        pageNo = 1;\r\n    }\r\n    if (pageNo > 0)\r\n        return new ChmNamedDest(name, pageNo);\r\n    return nullptr;\r\n}\r\n\r\nbool ChmModel::HasTocTree() const\r\n{\r\n     return tocTrace->Count() > 0;\r\n}\r\n\r\n// Callers delete the ToC tree, so we re-create it from prerecorded\r\n// values (which is faster than re-creating it from html every time)\r\nDocTocItem *ChmModel::GetTocTree()\r\n{\r\n    DocTocItem *root = nullptr, **nextChild = &root;\r\n    Vec<DocTocItem *> levels;\r\n    int idCounter = 0;\r\n\r\n    for (ChmTocTraceItem& ti : *tocTrace) {\r\n        ChmTocItem *item = new ChmTocItem(ti.title, ti.pageNo, ti.url);\r\n        item->id = ++idCounter;\r\n        // append the item at the correct level\r\n        CrashIf(ti.level < 1);\r\n        if ((size_t)ti.level <= levels.Count()) {\r\n            levels.RemoveAt(ti.level, levels.Count() - ti.level);\r\n            levels.Last()->AddSibling(item);\r\n        }\r\n        else {\r\n            (*nextChild) = item;\r\n            levels.Append(item);\r\n        }\r\n        nextChild = &item->child;\r\n    }\r\n\r\n    if (root)\r\n        root->OpenSingleNode();\r\n    return root;\r\n}\r\n\r\n// adapted from DisplayModel::NextZoomStep\r\nfloat ChmModel::GetNextZoomStep(float towardsLevel) const\r\n{\r\n    float currZoom = GetZoomVirtual(true);\r\n\r\n    if (gGlobalPrefs->zoomIncrement > 0) {\r\n        if (currZoom < towardsLevel)\r\n            return std::min(currZoom * (gGlobalPrefs->zoomIncrement / 100 + 1), towardsLevel);\r\n        if (currZoom > towardsLevel)\r\n            return std::max(currZoom / (gGlobalPrefs->zoomIncrement / 100 + 1), towardsLevel);\r\n        return currZoom;\r\n    }\r\n\r\n    Vec<float> *zoomLevels = gGlobalPrefs->zoomLevels;\r\n    CrashIf(zoomLevels->Count() != 0 && (zoomLevels->At(0) < ZOOM_MIN || zoomLevels->Last() > ZOOM_MAX));\r\n    CrashIf(zoomLevels->Count() != 0 && zoomLevels->At(0) > zoomLevels->Last());\r\n\r\n    const float FUZZ = 0.01f;\r\n    float newZoom = towardsLevel;\r\n    if (currZoom < towardsLevel) {\r\n        for (size_t i = 0; i < zoomLevels->Count(); i++) {\r\n            if (zoomLevels->At(i) - FUZZ > currZoom) {\r\n                newZoom = zoomLevels->At(i);\r\n                break;\r\n            }\r\n        }\r\n    }\r\n    else if (currZoom > towardsLevel) {\r\n        for (size_t i = zoomLevels->Count(); i > 0; i--) {\r\n            if (zoomLevels->At(i - 1) + FUZZ < currZoom) {\r\n                newZoom = zoomLevels->At(i - 1);\r\n                break;\r\n            }\r\n        }\r\n    }\r\n\r\n    return newZoom;\r\n}\r\n\r\nvoid ChmModel::UpdateDisplayState(DisplayState *ds)\r\n{\r\n    if (!ds->filePath || !str::EqI(ds->filePath, fileName))\r\n        str::ReplacePtr(&ds->filePath, fileName);\r\n\r\n    ds->useDefaultState = !gGlobalPrefs->rememberStatePerDocument;\r\n\r\n    str::ReplacePtr(&ds->displayMode, prefs::conv::FromDisplayMode(GetDisplayMode()));\r\n    prefs::conv::FromZoom(&ds->zoom, GetZoomVirtual(), ds);\r\n\r\n    ds->pageNo = CurrentPageNo();\r\n    ds->scrollPos = PointI();\r\n}\r\n\r\nclass ChmThumbnailTask : public HtmlWindowCallback\r\n{\r\n    ChmDoc *doc;\r\n    HWND hwnd;\r\n    HtmlWindow *hw;\r\n    SizeI size;\r\n    std::function<void(RenderedBitmap*)> saveThumbnail;\r\n    ScopedMem<WCHAR> homeUrl;\r\n    Vec<unsigned char *> data;\r\n    CRITICAL_SECTION docAccess;\r\n\r\npublic:\r\n    ChmThumbnailTask(ChmDoc *doc, HWND hwnd, SizeI size, const std::function<void(RenderedBitmap*)> saveThumbnail) :\r\n        doc(doc), hwnd(hwnd), hw(nullptr), size(size), saveThumbnail(saveThumbnail) {\r\n        InitializeCriticalSection(&docAccess);\r\n    }\r\n\r\n    ~ChmThumbnailTask() {\r\n        EnterCriticalSection(&docAccess);\r\n        delete hw;\r\n        DestroyWindow(hwnd);\r\n        delete doc;\r\n        data.FreeMembers();\r\n        LeaveCriticalSection(&docAccess);\r\n        DeleteCriticalSection(&docAccess);\r\n    }\r\n\r\n    void CreateThumbnail(HtmlWindow *hw) {\r\n        this->hw = hw;\r\n        homeUrl.Set(str::conv::FromAnsi(doc->GetHomePath()));\r\n        if (*homeUrl == '/')\r\n            homeUrl.Set(str::Dup(homeUrl + 1));\r\n        hw->NavigateToDataUrl(homeUrl);\r\n    }\r\n\r\n    virtual bool OnBeforeNavigate(const WCHAR *url, bool newWindow) { UNUSED(url);  return !newWindow; }\r\n    virtual void OnDocumentComplete(const WCHAR *url) {\r\n        if (url && *url == '/')\r\n            url++;\r\n        if (str::Eq(url, homeUrl)) {\r\n            RectI area(0, 0, size.dx * 2, size.dy * 2);\r\n            HBITMAP hbmp = hw->TakeScreenshot(area, size);\r\n            if (hbmp) {\r\n                RenderedBitmap *bmp = new RenderedBitmap(hbmp, size);\r\n                saveThumbnail(bmp);\r\n            }\r\n            // TODO: why is destruction on the UI thread necessary?\r\n            uitask::Post([=] { delete this; });\r\n        }\r\n    }\r\n    virtual void OnLButtonDown() { }\r\n    virtual const unsigned char *GetDataForUrl(const WCHAR *url, size_t *len) {\r\n        UNUSED(len);\r\n        ScopedCritSec scope(&docAccess);\r\n        ScopedMem<WCHAR> plainUrl(url::GetFullPath(url));\r\n        ScopedMem<char> urlUtf8(str::conv::ToUtf8(plainUrl));\r\n        data.Append(doc->GetData(urlUtf8, len));\r\n        return data.Last();\r\n    }\r\n    virtual void DownloadData(const WCHAR *url, const unsigned char *data, size_t len) { \r\n        UNUSED(url); UNUSED(data); UNUSED(len);\r\n    }\r\n};\r\n\r\n// Create a thumbnail of chm document by loading it again and rendering\r\n// its first page to a hwnd specially created for it.\r\nvoid ChmModel::CreateThumbnail(SizeI size, const std::function<void(RenderedBitmap*)> &saveThumbnail)\r\n{\r\n    // doc and window will be destroyed by the callback once it's invoked\r\n    ChmDoc *doc = ChmDoc::CreateFromFile(fileName);\r\n    if (!doc) {\r\n        return;\r\n    }\r\n\r\n    // We render twice the size of thumbnail and scale it down\r\n    int winDx = size.dx * 2 + GetSystemMetrics(SM_CXVSCROLL);\r\n    int winDy = size.dy * 2 + GetSystemMetrics(SM_CYHSCROLL);\r\n    // reusing WC_STATIC. I don't think exact class matters (WndProc\r\n    // will be taken over by HtmlWindow anyway) but it can't be nullptr.\r\n    HWND hwnd = CreateWindow(WC_STATIC, L\"BrowserCapture\", WS_POPUP,\r\n                             0, 0, winDx, winDy, nullptr, nullptr, nullptr, nullptr);\r\n    if (!hwnd) {\r\n        delete doc;\r\n        return;\r\n    }\r\n#if 0 // when debugging set to 1 to see the window\r\n    ShowWindow(hwnd, SW_SHOW);\r\n#endif\r\n\r\n    ChmThumbnailTask *thumbnailTask = new ChmThumbnailTask(doc, hwnd, size, saveThumbnail);\r\n    HtmlWindow *hw = HtmlWindow::Create(hwnd, thumbnailTask);\r\n    if (!hw) {\r\n        delete thumbnailTask;\r\n        return;\r\n    }\r\n    thumbnailTask->CreateThumbnail(hw);\r\n}\r\n\r\nbool ChmModel::IsSupportedFile(const WCHAR *fileName, bool sniff)\r\n{\r\n    return ChmDoc::IsSupportedFile(fileName, sniff);\r\n}\r\n\r\nChmModel *ChmModel::Create(const WCHAR *fileName, ControllerCallback *cb)\r\n{\r\n    ChmModel *cm = new ChmModel(cb);\r\n    if (!cm->Load(fileName)) {\r\n        delete cm;\r\n        return nullptr;\r\n    }\r\n    return cm;\r\n}\r\n"
  },
  {
    "path": "src/ChmModel.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nclass ChmDoc;\r\nstruct ChmTocTraceItem;\r\nclass HtmlWindow;\r\nclass HtmlWindowCallback;\r\nclass ChmCacheEntry;\r\n\r\nclass ChmModel : public Controller {\r\npublic:\r\n    explicit ChmModel(ControllerCallback *cb);\r\n    virtual ~ChmModel();\r\n\r\n    // meta data\r\n    virtual const WCHAR *FilePath() const { return fileName; }\r\n    virtual const WCHAR *DefaultFileExt() const { return L\".chm\"; }\r\n    virtual int PageCount() const;\r\n    virtual WCHAR *GetProperty(DocumentProperty prop);\r\n\r\n    // page navigation (stateful)\r\n    virtual int CurrentPageNo() const { return currentPageNo; }\r\n    virtual void GoToPage(int pageNo, bool addNavPoint) {\r\n        UNUSED(addNavPoint);\r\n        CrashIf(!ValidPageNo(pageNo));\r\n        if (ValidPageNo(pageNo))\r\n            DisplayPage(pages.At(pageNo - 1));\r\n    }\r\n    virtual bool CanNavigate(int dir) const;\r\n    virtual void Navigate(int dir);\r\n\r\n    // view settings\r\n    virtual void SetDisplayMode(DisplayMode mode, bool keepContinuous = false) { UNUSED(mode); UNUSED(keepContinuous); /* not supported */ }\r\n    virtual DisplayMode GetDisplayMode() const { return DM_SINGLE_PAGE; }\r\n    virtual void SetPresentationMode(bool enable) { UNUSED(enable); /* not supported */ }\r\n    virtual void SetZoomVirtual(float zoom, PointI *fixPt=nullptr);\r\n    virtual float GetZoomVirtual(bool absolute=false) const;\r\n    virtual float GetNextZoomStep(float towards) const;\r\n    virtual void SetViewPortSize(SizeI size) { UNUSED(size); /* not needed(?) */ }\r\n\r\n    // table of contents\r\n    virtual bool HasTocTree() const;\r\n    virtual DocTocItem *GetTocTree();\r\n    virtual void ScrollToLink(PageDestination *dest);\r\n    virtual PageDestination *GetNamedDest(const WCHAR *name);\r\n\r\n    // state export\r\n    virtual void UpdateDisplayState(DisplayState *ds);\r\n    // asynchronously calls saveThumbnail (fails silently)\r\n    virtual void CreateThumbnail(SizeI size, const std::function<void(RenderedBitmap*)> &saveThumbnail);\r\n\r\n    // for quick type determination and type-safe casting\r\n    virtual ChmModel *AsChm() { return this; }\r\n\r\n    static bool IsSupportedFile(const WCHAR *fileName, bool sniff=false);\r\n    static ChmModel *Create(const WCHAR *fileName, ControllerCallback *cb=nullptr);\r\n\r\npublic:\r\n    // the following is specific to ChmModel\r\n\r\n    bool SetParentHwnd(HWND hwnd);\r\n    void RemoveParentHwnd();\r\n\r\n    void PrintCurrentPage(bool showUI);\r\n    void FindInCurrentPage();\r\n    void SelectAll();\r\n    void CopySelection();\r\n    LRESULT PassUIMsg(UINT msg, WPARAM wParam, LPARAM lParam);\r\n\r\n    // for HtmlWindowCallback (called through htmlWindowCb)\r\n    bool OnBeforeNavigate(const WCHAR *url, bool newWindow);\r\n    void OnDocumentComplete(const WCHAR *url);\r\n    void OnLButtonDown();\r\n    const unsigned char *GetDataForUrl(const WCHAR *url, size_t *len);\r\n    void DownloadData(const WCHAR *url, const unsigned char *data, size_t len);\r\n\r\nprotected:\r\n    ScopedMem<WCHAR> fileName;\r\n    ChmDoc *doc;\r\n    CRITICAL_SECTION docAccess;\r\n    Vec<ChmTocTraceItem> *tocTrace;\r\n\r\n    WStrList pages;\r\n    int currentPageNo;\r\n    HtmlWindow *htmlWindow;\r\n    HtmlWindowCallback *htmlWindowCb;\r\n    float initZoom;\r\n\r\n    Vec<ChmCacheEntry*> urlDataCache;\r\n    // use a pool allocator for strings that aren't freed until this ChmModel\r\n    // is deleted (e.g. for titles and URLs for ChmTocItem and ChmCacheEntry)\r\n    PoolAllocator poolAlloc;\r\n\r\n    bool Load(const WCHAR *fileName);\r\n    void DisplayPage(const WCHAR *pageUrl);\r\n\r\n    ChmCacheEntry *FindDataForUrl(const WCHAR *url);\r\n\r\n    void ZoomTo(float zoomLevel);\r\n};\r\n"
  },
  {
    "path": "src/Controller.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nclass Controller;\r\nclass ChmModel;\r\nclass DisplayModel;\r\nclass EbookController;\r\nstruct EbookFormattingData;\r\n\r\nclass ControllerCallback {\r\npublic:\r\n    virtual ~ControllerCallback() { }\r\n    // tell the UI to show the pageNo as current page (which also syncs\r\n    // the toc with the curent page). Needed for when a page change happens\r\n    // indirectly or is initiated from within the model\r\n    virtual void PageNoChanged(Controller *ctrl, int pageNo) = 0;\r\n    // tell the UI to open the linked document or URL\r\n    virtual void GotoLink(PageDestination *dest) = 0;\r\n    // DisplayModel //\r\n    virtual void Repaint() = 0;\r\n    virtual void UpdateScrollbars(SizeI canvas) = 0;\r\n    virtual void RequestRendering(int pageNo) = 0;\r\n    virtual void CleanUp(DisplayModel *dm) = 0;\r\n    virtual void RenderThumbnail(DisplayModel *dm, SizeI size, const std::function<void(RenderedBitmap*)>&) = 0;\r\n    // ChmModel //\r\n    // tell the UI to move focus back to the main window\r\n    // (if always == false, then focus is only moved if it's inside\r\n    // an HtmlWindow and thus outside the reach of the main UI)\r\n    virtual void FocusFrame(bool always) = 0;\r\n    // tell the UI to let the user save the provided data to a file\r\n    virtual void SaveDownload(const WCHAR *url, const unsigned char *data, size_t len) = 0;\r\n    // EbookController //\r\n    virtual void HandleLayoutedPages(EbookController *ctrl, EbookFormattingData *data) = 0;\r\n    virtual void RequestDelayedLayout(int delay) = 0;\r\n};\r\n\r\nclass Controller {\r\nprotected:\r\n    ControllerCallback *cb;\r\n\r\npublic:\r\n    explicit Controller(ControllerCallback *cb) : cb(cb) { CrashIf(!cb); }\r\n    virtual ~Controller() { }\r\n\r\n    // meta data\r\n    virtual const WCHAR *FilePath() const = 0;\r\n    virtual const WCHAR *DefaultFileExt() const = 0;\r\n    virtual int PageCount() const = 0;\r\n    virtual WCHAR *GetProperty(DocumentProperty prop) = 0;\r\n\r\n    // page navigation (stateful)\r\n    virtual int CurrentPageNo() const = 0;\r\n    virtual void GoToPage(int pageNo, bool addNavPoint) = 0;\r\n    virtual bool CanNavigate(int dir) const = 0;\r\n    virtual void Navigate(int dir) = 0;\r\n\r\n    // view settings\r\n    virtual void SetDisplayMode(DisplayMode mode, bool keepContinuous=false) = 0;\r\n    virtual DisplayMode GetDisplayMode() const = 0;\r\n    virtual void SetPresentationMode(bool enable) = 0;\r\n    virtual void SetZoomVirtual(float zoom, PointI *fixPt=nullptr) = 0;\r\n    virtual float GetZoomVirtual(bool absolute=false) const = 0;\r\n    virtual float GetNextZoomStep(float towards) const = 0;\r\n    virtual void SetViewPortSize(SizeI size) = 0;\r\n\r\n    // table of contents\r\n    virtual bool HasTocTree() const = 0;\r\n    virtual DocTocItem *GetTocTree() = 0;\r\n    virtual void ScrollToLink(PageDestination *dest) = 0;\r\n    virtual PageDestination *GetNamedDest(const WCHAR *name) = 0;\r\n\r\n    // state export\r\n    virtual void UpdateDisplayState(DisplayState *ds) = 0;\r\n    // asynchronously calls saveThumbnail (fails silently)\r\n    virtual void CreateThumbnail(SizeI size, const std::function<void(RenderedBitmap *)>& saveThumbnail) = 0;\r\n\r\n    // page labels (optional)\r\n    virtual bool HasPageLabels() const { return false; }\r\n    virtual WCHAR *GetPageLabel(int pageNo) const { return str::Format(L\"%d\", pageNo); }\r\n    virtual int GetPageByLabel(const WCHAR *label) const { return _wtoi(label); }\r\n\r\n    // common shortcuts\r\n    virtual bool ValidPageNo(int pageNo) const {\r\n        return 1 <= pageNo && pageNo <= PageCount();\r\n    }\r\n    virtual bool GoToNextPage() {\r\n        if (CurrentPageNo() == PageCount())\r\n            return false;\r\n        GoToPage(CurrentPageNo() + 1, false);\r\n        return true;\r\n    }\r\n    virtual bool GoToPrevPage(bool toBottom=false) {\r\n        UNUSED(toBottom);\r\n        if (CurrentPageNo() == 1)\r\n            return false;\r\n        GoToPage(CurrentPageNo() - 1, false);\r\n        return true;\r\n    }\r\n    virtual bool GoToFirstPage() {\r\n        if (CurrentPageNo() == 1)\r\n            return false;\r\n        GoToPage(1, true);\r\n        return true;\r\n    }\r\n    virtual bool GoToLastPage() {\r\n        if (CurrentPageNo() == PageCount())\r\n            return false;\r\n        GoToPage(PageCount(), true);\r\n        return true;\r\n    }\r\n\r\n    // for quick type determination and type-safe casting\r\n    virtual DisplayModel *AsFixed() { return nullptr; }\r\n    virtual ChmModel *AsChm() { return nullptr; }\r\n    virtual EbookController *AsEbook() { return nullptr; }\r\n};\r\n"
  },
  {
    "path": "src/CrashHandler.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include <exception>\r\n#include <tlhelp32.h>\r\n#include <signal.h>\r\n#include \"WinDynCalls.h\"\r\n#include \"DbgHelpDyn.h\"\r\n#include \"FileUtil.h\"\r\n#include \"HttpUtil.h\"\r\n#include \"LzmaSimpleArchive.h\"\r\n#include \"WinUtil.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"AppTools.h\"\r\n#include \"CrashHandler.h\"\r\n#include \"Version.h\"\r\n#define NOLOG 1 // 0 for more detailed debugging, 1 to disable lf()\r\n#include \"DebugLog.h\"\r\n\r\n#if !defined(CRASH_SUBMIT_SERVER) || !defined(CRASH_SUBMIT_URL)\r\n#define CRASH_SUBMIT_SERVER L\"kjktools.org\"\r\n#define CRASH_SUBMIT_URL    L\"/crashreports/submit?app=SumatraPDF&ver=\" CURR_VERSION_STR\r\n#endif\r\n\r\n// The following functions allow crash handler to be used by both installer\r\n// and sumatra proper. They must be implemented for each app.\r\nextern void GetStressTestInfo(str::Str<char>* s);\r\nextern bool CrashHandlerCanUseNet();\r\nextern void ShowCrashHandlerMessage();\r\nextern void GetProgramInfo(str::Str<char>& s);\r\n\r\n/* Note: we cannot use standard malloc()/free()/new()/delete() in crash handler.\r\nFor multi-thread safety, there is a per-heap lock taken by HeapAlloc() etc.\r\nIt's possible that a crash originates from  inside such functions after a lock\r\nhas been taken. If we then try to allocate memory from the same heap, we'll\r\ndeadlock and won't send crash report.\r\nFor that reason we create a heap used only for crash handler and must only\r\nallocate, directly or indirectly, from that heap.\r\nI'm not sure what happens if a Windows function (e.g. http calls) has to\r\nallocate memory. I assume it'll use GetProcessHeap() heap and further assume\r\nthat CRT creates its own heap for malloc()/free() etc. so that while a deadlock\r\nis still possible, the probability should be greatly reduced. */\r\n\r\nclass CrashHandlerAllocator : public Allocator {\r\n    HANDLE allocHeap;\r\n\r\npublic:\r\n    CrashHandlerAllocator() {\r\n        allocHeap = HeapCreate(0, 128 * 1024, 0);\r\n    }\r\n    virtual ~CrashHandlerAllocator() {\r\n        HeapDestroy(allocHeap);\r\n    }\r\n    virtual void *Alloc(size_t size) {\r\n        return HeapAlloc(allocHeap, 0, size);\r\n    }\r\n    virtual void *Realloc(void *mem, size_t size) {\r\n        return HeapReAlloc(allocHeap, 0, mem, size);\r\n    }\r\n    virtual void Free(void *mem) {\r\n        HeapFree(allocHeap, 0, mem);\r\n    }\r\n};\r\n\r\nenum ExeType {\r\n    // this is an installer, SumatraPDF-${ver}-install.exe\r\n    ExeInstaller,\r\n    // this is a single-executable (portable) build (doesn't have libmupdf.dll)\r\n    ExeSumatraStatic,\r\n    // an installable build (has libmupdf.dll)\r\n    ExeSumatraLib\r\n};\r\n\r\nstatic CrashHandlerAllocator *gCrashHandlerAllocator = nullptr;\r\n\r\n// Note: intentionally not using ScopedMem<> to avoid\r\n// static initializers/destructors, which are bad\r\nstatic WCHAR *  gSymbolsUrl = nullptr;\r\nstatic WCHAR *  gCrashDumpPath = nullptr;\r\nstatic WCHAR *  gSymbolPathW = nullptr;\r\nstatic WCHAR *  gSymbolsDir = nullptr;\r\nstatic WCHAR *  gPdbZipPath = nullptr;\r\nstatic WCHAR *  gLibMupdfPdbPath = nullptr;\r\nstatic WCHAR *  gSumatraPdfPdbPath = nullptr;\r\nstatic WCHAR *  gInstallerPdbPath = nullptr;\r\nstatic char *   gSystemInfo = nullptr;\r\nstatic char *   gModulesInfo = nullptr;\r\nstatic HANDLE   gDumpEvent = nullptr;\r\nstatic HANDLE   gDumpThread = nullptr;\r\nstatic ExeType  gExeType = ExeSumatraStatic;\r\nstatic bool     gCrashed = false;\r\n\r\nstatic MINIDUMP_EXCEPTION_INFORMATION gMei = { 0 };\r\nstatic LPTOP_LEVEL_EXCEPTION_FILTER gPrevExceptionFilter = nullptr;\r\n\r\nstatic char *BuildCrashInfoText()\r\n{\r\n    lf(\"BuildCrashInfoText(): start\");\r\n\r\n    str::Str<char> s(16 * 1024, gCrashHandlerAllocator);\r\n    if (gSystemInfo)\r\n        s.Append(gSystemInfo);\r\n\r\n    GetStressTestInfo(&s);\r\n    s.Append(\"\\r\\n\");\r\n\r\n    dbghelp::GetExceptionInfo(s, gMei.ExceptionPointers);\r\n    dbghelp::GetAllThreadsCallstacks(s);\r\n    s.Append(\"\\r\\n\");\r\n    s.Append(gModulesInfo);\r\n\r\n    s.Append(\"\\r\\n\");\r\n    s.Append(dbglog::GetCrashLog());\r\n\r\n    return s.StealData();\r\n}\r\n\r\nstatic void SendCrashInfo(char *s)\r\n{\r\n    lf(\"SendCrashInfo(): started\");\r\n    if (str::IsEmpty(s)) {\r\n        plog(\"SendCrashInfo(): s is empty\");\r\n        return;\r\n    }\r\n\r\n    const char *boundary = \"0xKhTmLbOuNdArY\";\r\n    str::Str<char> headers(256, gCrashHandlerAllocator);\r\n    headers.AppendFmt(\"Content-Type: multipart/form-data; boundary=%s\", boundary);\r\n\r\n    str::Str<char> data(2048, gCrashHandlerAllocator);\r\n    data.AppendFmt(\"--%s\\r\\n\", boundary);\r\n    data.Append(\"Content-Disposition: form-data; name=\\\"file\\\"; filename=\\\"test.bin\\\"\\r\\n\\r\\n\");\r\n    data.Append(s);\r\n    data.Append(\"\\r\\n\");\r\n    data.AppendFmt(\"\\r\\n--%s--\\r\\n\", boundary);\r\n\r\n    HttpPost(CRASH_SUBMIT_SERVER, CRASH_SUBMIT_URL, &headers, &data);\r\n    plogf(\"SendCrashInfo() finished\");\r\n}\r\n\r\n// We might have symbol files for older builds. If we're here, then we\r\n// didn't get the symbols so we assume it's because symbols didn't match\r\n// Returns false if files were there but we couldn't delete them\r\nstatic bool DeleteSymbolsIfExist()\r\n{\r\n    bool ok1 = file::Delete(gLibMupdfPdbPath);\r\n    bool ok2 = file::Delete(gSumatraPdfPdbPath);\r\n    bool ok3 = file::Delete(gInstallerPdbPath);\r\n    bool ok = ok1 && ok2 && ok3;\r\n    if (!ok)\r\n        plog(\"DeleteSymbolsIfExist() failed to delete\");\r\n    return ok;\r\n}\r\n\r\n#ifndef DEBUG\r\n// static (single .exe) build\r\nstatic bool UnpackStaticSymbols(const char *pdbZipPath, const char *symDir)\r\n{\r\n    lf(\"UnpackStaticSymbols(): unpacking %s to dir %s\", pdbZipPath, symDir);\r\n    const char *files[2] = { \"SumatraPDF.pdb\", nullptr };\r\n    bool ok = lzma::ExtractFiles(pdbZipPath, symDir, &files[0], gCrashHandlerAllocator);\r\n    if (!ok) {\r\n        plog(\"Failed to unpack SumatraPDF.pdb\");\r\n        return false;\r\n    }\r\n    return true;\r\n}\r\n\r\n// lib (.exe + libmupdf.dll) release and pre-release builds\r\nstatic bool UnpackLibSymbols(const char *pdbZipPath, const char *symDir)\r\n{\r\n    lf(\"UnpackLibSymbols(): unpacking %s to dir %s\", pdbZipPath, symDir);\r\n    const char *files[3] = { \"libmupdf.pdb\", \"SumatraPDF-no-MuPDF.pdb\", nullptr };\r\n    bool ok = lzma::ExtractFiles(pdbZipPath, symDir, &files[0], gCrashHandlerAllocator);\r\n    if (!ok) {\r\n        plog(\"Failed to unpack libmupdf.pdb or SumatraPDF-no-MuPDF.pdb\");\r\n        return false;\r\n    }\r\n    return true;\r\n}\r\n\r\nstatic bool UnpackInstallerSymbols(const char *pdbZipPath, const char *symDir)\r\n{\r\n    lf(\"UnpackInstallerSymbols(): unpacking %s to dir %s\", pdbZipPath, symDir);\r\n    const char *files[2] = { \"Installer.pdb\", nullptr };\r\n    bool ok = lzma::ExtractFiles(pdbZipPath, symDir, &files[0], gCrashHandlerAllocator);\r\n    if (!ok) {\r\n        plog(\"Failed to unpack Installer.pdb\");\r\n        return false;\r\n    }\r\n    return true;\r\n}\r\n#endif\r\n\r\n// .pdb files are stored in a .zip file on a web server. Download that .zip\r\n// file as pdbZipPath, extract the symbols relevant to our executable\r\n// to symDir directory.\r\n// Returns false if downloading or extracting failed\r\n// note: to simplify callers, it could choose pdbZipPath by itself (in a temporary\r\n// directory) as the file is deleted on exit anyway\r\nstatic bool DownloadAndUnzipSymbols(const WCHAR *pdbZipPath, const WCHAR *symDir)\r\n{\r\n    lf(\"DownloadAndUnzipSymbols() started\");\r\n    if (!symDir || !dir::Exists(symDir)) {\r\n        plog(\"DownloadAndUnzipSymbols(): exiting because symDir doesn't exist\");\r\n        return false;\r\n    }\r\n\r\n    if (!DeleteSymbolsIfExist()) {\r\n        plog(\"DownloadAndUnzipSymbols(): DeleteSymbolsIfExist() failed\");\r\n        return false;\r\n    }\r\n\r\n    if (!file::Delete(pdbZipPath)) {\r\n        plog(\"DownloadAndUnzipSymbols(): deleting pdbZipPath failed\");\r\n        return false;\r\n    }\r\n\r\n#ifdef DEBUG\r\n    // don't care about debug builds because we don't release them\r\n    plog(\"DownloadAndUnzipSymbols(): DEBUG build so not doing anything\");\r\n    return false;\r\n#else\r\n    if (!HttpGetToFile(gSymbolsUrl, pdbZipPath)) {\r\n        plog(\"DownloadAndUnzipSymbols(): couldn't download symbols\");\r\n        return false;\r\n    }\r\n\r\n    char pdbZipPathUtf[512];\r\n    char symDirUtf[512];\r\n\r\n    str::WcharToUtf8Buf(pdbZipPath, pdbZipPathUtf, sizeof(pdbZipPathUtf));\r\n    str::WcharToUtf8Buf(symDir, symDirUtf, sizeof(symDirUtf));\r\n\r\n    bool ok = false;\r\n    if (ExeSumatraStatic == gExeType) {\r\n        ok = UnpackStaticSymbols(pdbZipPathUtf, symDirUtf);\r\n    } else if (ExeSumatraLib == gExeType) {\r\n        ok = UnpackLibSymbols(pdbZipPathUtf, symDirUtf);\r\n    } else if (ExeInstaller == gExeType) {\r\n        ok = UnpackInstallerSymbols(pdbZipPathUtf, symDirUtf);\r\n    } else {\r\n        plog(\"DownloadAndUnzipSymbols(): unknown exe type\");\r\n    }\r\n\r\n    file::Delete(pdbZipPath);\r\n    return ok;\r\n#endif\r\n}\r\n\r\n// If we can't resolve the symbols, we assume it's because we don't have symbols\r\n// so we'll try to download them and retry. If we can resolve symbols, we'll\r\n// get the callstacks etc. and submit to our server for analysis.\r\nvoid SubmitCrashInfo()\r\n{\r\n    if (!dir::Create(gSymbolsDir)) {\r\n        plog(\"SubmitCrashInfo(): couldn't create symbols dir\");\r\n        return;\r\n    }\r\n\r\n    lf(\"SubmitCrashInfo(): start\");\r\n    lf(L\"SubmitCrashInfo(): gSymbolPathW: '%s'\", gSymbolPathW);\r\n    if (!CrashHandlerCanUseNet()) {\r\n        plog(\"SubmitCrashInfo(): internet access not allowed\");\r\n        return;\r\n    }\r\n\r\n    char *s = nullptr;\r\n    if (!dbghelp::Initialize(gSymbolPathW, false)) {\r\n        plog(\"SubmitCrashInfo(): dbghelp::Initialize() failed\");\r\n        return;\r\n    }\r\n\r\n    if (!dbghelp::HasSymbols()) {\r\n        if (!DownloadAndUnzipSymbols(gPdbZipPath, gSymbolsDir)) {\r\n            plog(\"SubmitCrashInfo(): failed to download symbols\");\r\n            return;\r\n        }\r\n\r\n        if (!dbghelp::Initialize(gSymbolPathW, true)) {\r\n            plog(\"SubmitCrashInfo(): second dbghelp::Initialize() failed\");\r\n            return;\r\n        }\r\n    }\r\n\r\n    if (!dbghelp::HasSymbols()) {\r\n        plog(\"SubmitCrashInfo(): HasSymbols() false after downloading symbols\");\r\n        return;\r\n    }\r\n\r\n    s = BuildCrashInfoText();\r\n    if (!s)\r\n        return;\r\n    SendCrashInfo(s);\r\n    gCrashHandlerAllocator->Free(s);\r\n}\r\n\r\nstatic DWORD WINAPI CrashDumpThread(LPVOID data)\r\n{\r\n    UNUSED(data);\r\n    WaitForSingleObject(gDumpEvent, INFINITE);\r\n    if (!gCrashed)\r\n        return 0;\r\n\r\n#ifndef HAS_NO_SYMBOLS\r\n    SubmitCrashInfo();\r\n#endif\r\n    // always write a MiniDump (for the latest crash only)\r\n    // set the SUMATRAPDF_FULLDUMP environment variable for more complete dumps\r\n    DWORD n = GetEnvironmentVariableA(\"SUMATRAPDF_FULLDUMP\", nullptr, 0);\r\n    bool fullDump = (0 != n);\r\n    dbghelp::WriteMiniDump(gCrashDumpPath, &gMei, fullDump);\r\n    return 0;\r\n}\r\n\r\nstatic LONG WINAPI DumpExceptionHandler(EXCEPTION_POINTERS *exceptionInfo)\r\n{\r\n    if (!exceptionInfo || (EXCEPTION_BREAKPOINT == exceptionInfo->ExceptionRecord->ExceptionCode))\r\n        return EXCEPTION_CONTINUE_SEARCH;\r\n\r\n    static bool wasHere = false;\r\n    if (wasHere)\r\n        return EXCEPTION_CONTINUE_SEARCH; // Note: or should TerminateProcess()?\r\n    wasHere = true;\r\n    gCrashed = true;\r\n\r\n    gMei.ThreadId = GetCurrentThreadId();\r\n    gMei.ExceptionPointers = exceptionInfo;\r\n    // per msdn (which is backed by my experience), MiniDumpWriteDump() doesn't\r\n    // write callstack for the calling thread correctly. We use msdn-recommended\r\n    // work-around of spinning a thread to do the writing\r\n    SetEvent(gDumpEvent);\r\n    WaitForSingleObject(gDumpThread, INFINITE);\r\n\r\n    ShowCrashHandlerMessage();\r\n    TerminateProcess(GetCurrentProcess(), 1);\r\n\r\n    return EXCEPTION_CONTINUE_SEARCH;\r\n}\r\n\r\nstatic const char *OsNameFromVer(OSVERSIONINFOEX ver)\r\n{\r\n    if (VER_PLATFORM_WIN32_NT != ver.dwPlatformId)\r\n        return \"9x\";\r\n    if (ver.dwMajorVersion == 6 && ver.dwMinorVersion == 3)\r\n        return \"8.1\"; // or Server 2012 R2\r\n    if (ver.dwMajorVersion == 6 && ver.dwMinorVersion == 2)\r\n        return \"8\"; // or Server 2012\r\n    if (ver.dwMajorVersion == 6 && ver.dwMinorVersion == 1)\r\n        return \"7\"; // or Server 2008 R2\r\n    if (ver.dwMajorVersion == 6 && ver.dwMinorVersion == 0)\r\n        return \"Vista\"; // or Server 2008\r\n    if (ver.dwMajorVersion == 5 && ver.dwMinorVersion == 2)\r\n        return \"Server 2003\";\r\n    if (ver.dwMajorVersion == 5 && ver.dwMinorVersion == 1)\r\n        return \"XP\";\r\n    if (ver.dwMajorVersion == 5 && ver.dwMinorVersion == 0)\r\n        return \"2000\";\r\n    if (ver.dwMajorVersion == 10) {\r\n        // ver.dwMinorVersion seems to always be 0\r\n        return \"10\";\r\n    }\r\n\r\n    // either a newer or an older NT version, neither of which we support\r\n    static char osVerStr[32];\r\n    wsprintfA(osVerStr, \"NT %u.%u\", ver.dwMajorVersion, ver.dwMinorVersion);\r\n    return osVerStr;\r\n}\r\n\r\nstatic void GetOsVersion(str::Str<char>& s)\r\n{\r\n    OSVERSIONINFOEX ver;\r\n    ZeroMemory(&ver, sizeof(ver));\r\n    ver.dwOSVersionInfoSize = sizeof(ver);\r\n#pragma warning(push)\r\n#pragma warning(disable: 4996) // 'GetVersionEx': was declared deprecated\r\n#pragma warning(disable: 28159) // Consider using 'IsWindows*' instead of 'GetVersionExW'\r\n    // see: https://msdn.microsoft.com/en-us/library/windows/desktop/dn424972(v=vs.85).aspx\r\n    // starting with Windows 8.1, GetVersionEx will report a wrong version number\r\n    // unless the OS's GUID has been explicitly added to the compatibility manifest\r\n    BOOL ok = GetVersionEx((OSVERSIONINFO*)&ver);\r\n#pragma warning(pop)\r\n    if (!ok)\r\n        return;\r\n    const char *os = OsNameFromVer(ver);\r\n    int servicePackMajor = ver.wServicePackMajor;\r\n    int servicePackMinor = ver.wServicePackMinor;\r\n    int buildNumber = ver.dwBuildNumber & 0xFFFF;\r\n#ifdef _WIN64\r\n    const char *arch = \"64-bit\";\r\n#else\r\n    const char *arch = IsRunningInWow64() ? \"Wow64\" : \"32-bit\";\r\n#endif\r\n    if (0 == servicePackMajor)\r\n        s.AppendFmt(\"OS: Windows %s build %d %s\\r\\n\", os, buildNumber, arch);\r\n    else if (0 == servicePackMinor)\r\n        s.AppendFmt(\"OS: Windows %s SP%d build %d %s\\r\\n\", os, servicePackMajor, buildNumber, arch);\r\n    else\r\n        s.AppendFmt(\"OS: Windows %s %d.%d build %d %s\\r\\n\", os, servicePackMajor, servicePackMinor, buildNumber, arch);\r\n}\r\n\r\nstatic void GetProcessorName(str::Str<char>& s)\r\n{\r\n    WCHAR *name = ReadRegStr(HKEY_LOCAL_MACHINE, L\"HARDWARE\\\\DESCRIPTION\\\\System\\\\CentralProcessor\", L\"ProcessorNameString\");\r\n    if (!name) // if more than one processor\r\n        name = ReadRegStr(HKEY_LOCAL_MACHINE, L\"HARDWARE\\\\DESCRIPTION\\\\System\\\\CentralProcessor\\\\0\", L\"ProcessorNameString\");\r\n    if (!name)\r\n        return;\r\n\r\n    ScopedMem<char> tmp(str::conv::ToUtf8(name));\r\n    s.AppendFmt(\"Processor: %s\\r\\n\", tmp.Get());\r\n    free(name);\r\n}\r\n\r\nstatic void GetMachineName(str::Str<char>& s)\r\n{\r\n    WCHAR *s1 = ReadRegStr(HKEY_LOCAL_MACHINE, L\"HARDWARE\\\\DESCRIPTION\\\\System\\\\BIOS\", L\"SystemFamily\");\r\n    WCHAR *s2 = ReadRegStr(HKEY_LOCAL_MACHINE, L\"HARDWARE\\\\DESCRIPTION\\\\System\\\\BIOS\", L\"SystemVersion\");\r\n    ScopedMem<char> s1u(s1 ? str::conv::ToUtf8(s1) : nullptr);\r\n    ScopedMem<char> s2u(s2 ? str::conv::ToUtf8(s2) : nullptr);\r\n\r\n    if (!s1u && !s2u)\r\n        ; // pass\r\n    else if (!s1u)\r\n        s.AppendFmt(\"Machine: %s\\r\\n\", s2u.Get());\r\n    else if (!s2u || str::EqI(s1u, s2u))\r\n        s.AppendFmt(\"Machine: %s\\r\\n\", s1u.Get());\r\n    else\r\n        s.AppendFmt(\"Machine: %s %s\\r\\n\", s1u.Get(), s2u.Get());\r\n\r\n    free(s1);\r\n    free(s2);\r\n}\r\n\r\n#define GFX_DRIVER_KEY_FMT L\"SYSTEM\\\\CurrentControlSet\\\\Control\\\\Class\\\\{4d36e968-e325-11ce-bfc1-08002be10318}\\\\%04d\"\r\n\r\nstatic void GetGraphicsDriverInfo(str::Str<char>& s)\r\n{\r\n    // the info is in registry in:\r\n    // HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4d36e968-e325-11ce-bfc1-08002be10318}\\0000\\\r\n    //   Device Description REG_SZ (same as DriverDesc, so we don't read it)\r\n    //   DriverDesc REG_SZ\r\n    //   DriverVersion REG_SZ\r\n    //   UserModeDriverName REG_MULTI_SZ\r\n    //\r\n    // There can be more than one driver, they are in 0000, 0001 etc.\r\n    for (int i=0; ; i++)\r\n    {\r\n        ScopedMem<WCHAR> key(str::Format(GFX_DRIVER_KEY_FMT, i));\r\n        ScopedMem<WCHAR> v1(ReadRegStr(HKEY_LOCAL_MACHINE, key, L\"DriverDesc\"));\r\n        // I assume that if I can't read the value, there are no more drivers\r\n        if (!v1)\r\n            break;\r\n        ScopedMem<char> v1a(str::conv::ToUtf8(v1));\r\n        s.AppendFmt(\"Graphics driver %d\\r\\n\", i);\r\n        s.AppendFmt(\"  DriverDesc:         %s\\r\\n\", v1.Get());\r\n        v1.Set(ReadRegStr(HKEY_LOCAL_MACHINE, key, L\"DriverVersion\"));\r\n        if (v1) {\r\n            v1a.Set(str::conv::ToUtf8(v1));\r\n            s.AppendFmt(\"  DriverVersion:      %s\\r\\n\", v1a.Get());\r\n        }\r\n        v1.Set(ReadRegStr(HKEY_LOCAL_MACHINE, key, L\"UserModeDriverName\"));\r\n        if (v1) {\r\n            v1a.Set(str::conv::ToUtf8(v1));\r\n            s.AppendFmt(\"  UserModeDriverName: %s\\r\\n\", v1a.Get());\r\n        }\r\n    }\r\n}\r\n\r\nstatic void GetLanguage(str::Str<char>& s)\r\n{\r\n    char country[32] = { 0 }, lang[32] = { 0 };\r\n    GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SISO3166CTRYNAME, country, dimof(country) - 1);\r\n    GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SISO639LANGNAME, lang, dimof(lang) - 1);\r\n    s.AppendFmt(\"Lang: %s %s\\r\\n\", lang, country);\r\n}\r\n\r\nstatic void GetSystemInfo(str::Str<char>& s)\r\n{\r\n    SYSTEM_INFO si;\r\n    GetSystemInfo(&si);\r\n    s.AppendFmt(\"Number Of Processors: %d\\r\\n\", si.dwNumberOfProcessors);\r\n    GetProcessorName(s);\r\n\r\n    MEMORYSTATUSEX ms;\r\n    ms.dwLength = sizeof(ms);\r\n    GlobalMemoryStatusEx(&ms);\r\n\r\n    float physMemGB   = (float)ms.ullTotalPhys     / (float)(1024 * 1024 * 1024);\r\n    float totalPageGB = (float)ms.ullTotalPageFile / (float)(1024 * 1024 * 1024);\r\n    DWORD usedPerc = ms.dwMemoryLoad;\r\n    s.AppendFmt(\"Physical Memory: %.2f GB\\r\\nCommit Charge Limit: %.2f GB\\r\\nMemory Used: %d%%\\r\\n\", physMemGB, totalPageGB, usedPerc);\r\n\r\n    GetMachineName(s);\r\n    GetLanguage(s);\r\n    GetGraphicsDriverInfo(s);\r\n\r\n    // Note: maybe more information, like:\r\n    // * processor capabilities (mmx, sse, sse2 etc.)\r\n}\r\n\r\n// returns true if running on wine (winex11.drv is present)\r\n// it's not a logical, but convenient place to do it\r\nstatic bool GetModules(str::Str<char>& s)\r\n{\r\n    bool isWine = false;\r\n    HANDLE snap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetCurrentProcessId());\r\n    if (snap == INVALID_HANDLE_VALUE)\r\n        return true;\r\n\r\n    MODULEENTRY32 mod;\r\n    mod.dwSize = sizeof(mod);\r\n    BOOL cont = Module32First(snap, &mod);\r\n    while (cont) {\r\n        ScopedMem<char> nameA(str::conv::ToUtf8(mod.szModule));\r\n        if (str::EqI(nameA.Get(), \"winex11.drv\"))\r\n            isWine = true;\r\n        ScopedMem<char> pathA(str::conv::ToUtf8(mod.szExePath));\r\n        s.AppendFmt(\"Module: %p %06X %-16s %s\\r\\n\", mod.modBaseAddr, mod.modBaseSize, nameA.Get(), pathA.Get());\r\n        cont = Module32Next(snap, &mod);\r\n    }\r\n    CloseHandle(snap);\r\n    return isWine;\r\n}\r\n\r\n// returns true if running on wine\r\nstatic bool BuildModulesInfo()\r\n{\r\n    str::Str<char> s(1024);\r\n    bool isWine = GetModules(s);\r\n    gModulesInfo = s.StealData();\r\n    return isWine;\r\n}\r\n\r\nstatic void BuildSystemInfo()\r\n{\r\n    str::Str<char> s(1024);\r\n    GetProgramInfo(s);\r\n    GetOsVersion(s);\r\n    GetSystemInfo(s);\r\n    gSystemInfo = s.StealData();\r\n}\r\n\r\nstatic bool StoreCrashDumpPaths(const WCHAR *symDir)\r\n{\r\n    if (!symDir)\r\n        return false;\r\n    gSymbolsDir = str::Dup(symDir);\r\n    gPdbZipPath = path::Join(symDir, L\"symbols_tmp.zip\");\r\n    gLibMupdfPdbPath = path::Join(symDir, L\"SumatraPDF.pdb\");\r\n    gSumatraPdfPdbPath = path::Join(symDir, L\"libmupdf.pdb\");\r\n    gInstallerPdbPath = path::Join(symDir, L\"Installer.pdb\");\r\n    return true;\r\n}\r\n\r\n/* Setting symbol path:\r\nadd GetEnvironmentVariableA(\"_NT_SYMBOL_PATH\", ..., ...)\r\nadd GetEnvironmentVariableA(\"_NT_ALTERNATE_SYMBOL_PATH\", ..., ...)\r\nadd: \"srv*c:\\\\symbols*http://msdl.microsoft.com/download/symbols;cache*c:\\\\symbols\"\r\n(except a better directory than c:\\\\symbols\r\n\r\nNote: I've decided to use just one, known to me location rather than the\r\nmore comprehensive list. It works so why give dbghelp.dll more directories\r\nto scan?\r\n*/\r\nstatic bool BuildSymbolPath()\r\n{\r\n    str::Str<WCHAR> path(1024);\r\n\r\n#if 0\r\n    WCHAR buf[512];\r\n    DWORD res = GetEnvironmentVariable(L\"_NT_SYMBOL_PATH\", buf, dimof(buf));\r\n    if (0 < res && res < dimof(buf)) {\r\n        path.Append(buf);\r\n        path.Append(L\";\");\r\n    }\r\n    res = GetEnvironmentVariable(L\"_NT_ALTERNATE_SYMBOL_PATH\", buf, dimof(buf));\r\n    if (0 < res && res < dimof(buf)) {\r\n        path.Append(buf);\r\n        path.Append(L\";\");\r\n    }\r\n#endif\r\n\r\n    path.Append(gSymbolsDir);\r\n    //path.Append(L\";\");\r\n#if 0\r\n    // this probably wouldn't work anyway because it requires symsrv.dll in the same directory\r\n    // as dbghelp.dll and it's not present with the os-provided dbghelp.dll\r\n    path.Append(L\"srv*\");\r\n    path.Append(symDir);\r\n    path.Append(L\"*http://msdl.microsoft.com/download/symbols;cache*\");\r\n    path.Append(symDir);\r\n#endif\r\n#if 0\r\n    // when running local builds, *.pdb is in the same dir as *.exe\r\n    ScopedMem<WCHAR> exePath(GetExePath());\r\n    path.Append(exePath);\r\n#endif\r\n    gSymbolPathW = path.StealData();\r\n    if (!gSymbolPathW)\r\n        return false;\r\n    return true;\r\n}\r\n\r\n// Get url for file with symbols. Caller needs to free().\r\nstatic WCHAR *BuildSymbolsUrl() {\r\n#ifdef SYMBOL_DOWNLOAD_URL\r\n    return str::Dup(SYMBOL_DOWNLOAD_URL);\r\n#else\r\n#ifdef SVN_PRE_RELEASE_VER\r\n    WCHAR *urlBase = L\"https://kjkpub.s3.amazonaws.com/sumatrapdf/prerel/SumatraPDF-prerelease-\" TEXT(QM(SVN_PRE_RELEASE_VER));\r\n#else\r\n    WCHAR *urlBase = L\"https://kjkpub.s3.amazonaws.com/sumatrapdf/rel/SumatraPDF-\" TEXT(QM(CURR_VERSION));\r\n#endif\r\n    WCHAR *is64 = IsProcess64() ? L\"-64\" : L\"\";\r\n    return str::Format(L\"%s%s.pdb.lzsa\", urlBase, is64);\r\n#endif\r\n}\r\n\r\n// detect which exe it is (installer, sumatra static or sumatra with dlls)\r\nstatic ExeType DetectExeType()\r\n{\r\n    ExeType exeType = ExeSumatraStatic;\r\n    HANDLE snap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetCurrentProcessId());\r\n    if (snap == INVALID_HANDLE_VALUE) {\r\n        plog(\"DetectExeType(): failed to detect type\");\r\n        return exeType;\r\n    }\r\n    MODULEENTRY32 mod;\r\n    mod.dwSize = sizeof(mod);\r\n    BOOL cont = Module32First(snap, &mod);\r\n    while (cont) {\r\n        WCHAR *name = mod.szModule;\r\n        if (str::EqI(name, L\"libmupdf.dll\")) {\r\n            exeType = ExeSumatraLib;\r\n            break;\r\n        }\r\n        if (str::StartsWithI(name, L\"SumatraPDF-\") && str::EndsWithI(name, L\"install.exe\")) {\r\n            exeType = ExeInstaller;\r\n            break;\r\n        }\r\n        cont = Module32Next(snap, &mod);\r\n    }\r\n    CloseHandle(snap);\r\n    return exeType;\r\n}\r\n\r\nvoid __cdecl onSignalAbort(int code) {\r\n    UNUSED(code);\r\n    // put the signal back because can be called many times\r\n    // (from multiple threads) and raise() resets the handler\r\n    signal(SIGABRT, onSignalAbort);\r\n    CrashMe();\r\n}\r\n\r\nvoid onTerminate() {\r\n    CrashMe();\r\n}\r\n\r\nvoid onUnexpected() {\r\n    CrashMe();\r\n}\r\n\r\n// shadow crt's _purecall() so that we're called instead of CRT\r\nint __cdecl _purecall() {\r\n    CrashMe();\r\n    return 0;\r\n}\r\n\r\nvoid InstallCrashHandler(const WCHAR *crashDumpPath, const WCHAR *symDir)\r\n{\r\n    assert(!gDumpEvent && !gDumpThread);\r\n\r\n    if (!crashDumpPath)\r\n        return;\r\n    if (!StoreCrashDumpPaths(symDir))\r\n        return;\r\n    if (!BuildSymbolPath())\r\n        return;\r\n\r\n    // don't bother sending crash reports when running under Wine\r\n    // as they're not helpful\r\n    bool isWine= BuildModulesInfo();\r\n    if (isWine)\r\n        return;\r\n\r\n    BuildSystemInfo();\r\n    // at this point list of modules should be complete (except\r\n    // dbghlp.dll which shouldn't be loaded yet)\r\n\r\n    gExeType = DetectExeType();\r\n    // we pre-allocate as much as possible to minimize allocations\r\n    // when crash handler is invoked. It's ok to use standard\r\n    // allocation functions here.\r\n    gCrashHandlerAllocator = new CrashHandlerAllocator();\r\n    gSymbolsUrl = BuildSymbolsUrl();\r\n    gCrashDumpPath = str::Dup(crashDumpPath);\r\n    gDumpEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);\r\n    if (!gDumpEvent)\r\n        return;\r\n    gDumpThread = CreateThread(nullptr, 0, CrashDumpThread, nullptr, 0, 0);\r\n    if (!gDumpThread)\r\n        return;\r\n    gPrevExceptionFilter = SetUnhandledExceptionFilter(DumpExceptionHandler);\r\n\r\n    signal(SIGABRT, onSignalAbort);\r\n#if defined(_MSC_VER)\r\n    // those are only in msvc? There is std::set_terminate() and\r\n    // std::set_unexpected() in C++ in <exception>\r\n    std::set_terminate(onTerminate);\r\n    std::set_unexpected(onUnexpected);\r\n#endif\r\n}\r\n\r\nvoid UninstallCrashHandler()\r\n{\r\n    if (!gDumpEvent || !gDumpThread)\r\n        return;\r\n\r\n    if (gPrevExceptionFilter)\r\n        SetUnhandledExceptionFilter(gPrevExceptionFilter);\r\n\r\n    SetEvent(gDumpEvent);\r\n    WaitForSingleObject(gDumpThread, 1000); // 1 sec\r\n\r\n    CloseHandle(gDumpThread);\r\n    CloseHandle(gDumpEvent);\r\n\r\n    free(gCrashDumpPath);\r\n    free(gSymbolsUrl);\r\n    free(gSymbolsDir);\r\n    free(gPdbZipPath);\r\n    free(gLibMupdfPdbPath);\r\n    free(gSumatraPdfPdbPath);\r\n    free(gInstallerPdbPath);\r\n\r\n    free(gSymbolPathW);\r\n    free(gSystemInfo);\r\n    free(gModulesInfo);\r\n    delete gCrashHandlerAllocator;\r\n}\r\n"
  },
  {
    "path": "src/CrashHandler.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD */\r\n\r\nvoid InstallCrashHandler(const WCHAR *crashDumpPath, const WCHAR *symDir);\r\nvoid SubmitCrashInfo();\r\nvoid UninstallCrashHandler();\r\n"
  },
  {
    "path": "src/DisplayModel.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n/* How to think of display logic: physical screen of size\r\n   viewPort.Size() is a window into (possibly much larger)\r\n   total area (canvas) of size canvasSize.\r\n\r\n   In DM_SINGLE_PAGE mode total area is the size of currently displayed page\r\n   given current zoom level and rotation.\r\n   In DM_CONTINUOUS mode canvas area consist of all pages rendered sequentially\r\n   with a given zoom level and rotation. canvasSize.dy is the sum of heights\r\n   of all pages plus spaces between them and canvasSize.dx is the size of\r\n   the widest page.\r\n\r\n   A possible configuration could look like this:\r\n\r\n -----------------------------------\r\n |                                 |\r\n |          -------------          |\r\n |          | window    |          |\r\n |          | i.e.      |          |\r\n |          | view port |          |\r\n |          -------------          |\r\n |                                 |\r\n |                                 |\r\n |    canvas                       |\r\n |                                 |\r\n |                                 |\r\n |                                 |\r\n |                                 |\r\n -----------------------------------\r\n\r\n  We calculate the canvas size and position of each page we display on the\r\n  canvas.\r\n\r\n  Changing zoom level or rotation requires recalculation of canvas size and\r\n  position of pages in it.\r\n\r\n  We keep the offset of view port relative to canvas. The offset changes\r\n  due to scrolling (with keys or using scrollbars).\r\n\r\n  To draw we calculate which part of each page overlaps draw area, we render\r\n  those pages to a bitmap and display those bitmaps.\r\n*/\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EngineManager.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"DisplayModel.h\"\r\n#include \"GlobalPrefs.h\"\r\n#include \"PdfSync.h\"\r\n#include \"TextSelection.h\"\r\n#include \"TextSearch.h\"\r\n\r\n// if true, we pre-render the pages right before and after the visible pages\r\nstatic bool gPredictiveRender = true;\r\n\r\nstatic int ColumnsFromDisplayMode(DisplayMode displayMode)\r\n{\r\n    if (!IsSingle(displayMode))\r\n        return 2;\r\n    return 1;\r\n}\r\n\r\nint NormalizeRotation(int rotation)\r\n{\r\n    assert((rotation % 90) == 0);\r\n    rotation = rotation % 360;\r\n    if (rotation < 0)\r\n        rotation += 360;\r\n    if (rotation < 0 || rotation >= 360 || (rotation % 90) != 0) {\r\n        assert(0);\r\n        return 0;\r\n    }\r\n    return rotation;\r\n}\r\n\r\nvoid DisplayModel::UpdateDisplayState(DisplayState *ds)\r\n{\r\n    if (!ds->filePath || !str::EqI(ds->filePath, engine->FileName()))\r\n        str::ReplacePtr(&ds->filePath, engine->FileName());\r\n\r\n    ds->useDefaultState = !gGlobalPrefs->rememberStatePerDocument;\r\n\r\n    str::ReplacePtr(&ds->displayMode, prefs::conv::FromDisplayMode(presentationMode ? presDisplayMode : GetDisplayMode()));\r\n    prefs::conv::FromZoom(&ds->zoom, presentationMode ? presZoomVirtual : zoomVirtual, ds);\r\n\r\n    ScrollState ss = GetScrollState();\r\n    ds->pageNo = ss.page;\r\n    if (presentationMode)\r\n        ds->scrollPos = PointI();\r\n    else\r\n        ds->scrollPos = PointD(ss.x, ss.y).ToInt();\r\n    ds->rotation = rotation;\r\n    ds->displayR2L = displayR2L;\r\n\r\n    free(ds->decryptionKey);\r\n    ds->decryptionKey = engine->GetDecryptionKey();\r\n}\r\n\r\nSizeD DisplayModel::PageSizeAfterRotation(int pageNo, bool fitToContent) const\r\n{\r\n    PageInfo *pageInfo = GetPageInfo(pageNo);\r\n    if (fitToContent && pageInfo->contentBox.IsEmpty()) {\r\n        pageInfo->contentBox = engine->PageContentBox(pageNo);\r\n        if (pageInfo->contentBox.IsEmpty())\r\n            return PageSizeAfterRotation(pageNo);\r\n    }\r\n\r\n    RectD box = fitToContent ? pageInfo->contentBox : pageInfo->page;\r\n    return engine->Transform(box, pageNo, 1.0, rotation).Size();\r\n}\r\n\r\n/* given 'columns' and an absolute 'pageNo', return the number of the first\r\n   page in a row to which a 'pageNo' belongs e.g. if 'columns' is 2 and we\r\n   have 5 pages in 3 rows (depending on showCover):\r\n\r\n   Pages   Result           Pages   Result           Pages   Result (R2L)\r\n   (1,2)   1                  (1)   1                (2,1)   1\r\n   (3,4)   3                (2,3)   2                (4,3)   3\r\n   (5)     5                (4,5)   4                  (5)   5\r\n */\r\nstatic int FirstPageInARowNo(int pageNo, int columns, bool showCover)\r\n{\r\n    if (showCover && columns > 1)\r\n        pageNo++;\r\n    int firstPageNo = pageNo - ((pageNo - 1) % columns);\r\n    if (showCover && columns > 1 && firstPageNo > 1)\r\n        firstPageNo--;\r\n    return firstPageNo;\r\n}\r\n\r\nstatic int LastPageInARowNo(int pageNo, int columns, bool showCover, int pageCount)\r\n{\r\n    int lastPageNo = FirstPageInARowNo(pageNo, columns, showCover) + columns - 1;\r\n    if (showCover && pageNo < columns)\r\n        lastPageNo--;\r\n    return std::min(lastPageNo, pageCount);\r\n}\r\n\r\n// must call SetInitialViewSettings() after creation\r\nDisplayModel::DisplayModel(BaseEngine *engine, EngineType type, ControllerCallback *cb) :\r\n    Controller(cb), engine(engine),\r\n    userAnnots(nullptr), userAnnotsModified(false), engineType(type), pdfSync(nullptr),\r\n    pagesInfo(nullptr), displayMode(DM_AUTOMATIC), startPage(1),\r\n    zoomReal(INVALID_ZOOM), zoomVirtual(INVALID_ZOOM),\r\n    rotation(0), dpiFactor(1.0f), displayR2L(false),\r\n    presentationMode(false), presZoomVirtual(INVALID_ZOOM),\r\n    presDisplayMode(DM_AUTOMATIC), navHistoryIx(0),\r\n    dontRenderFlag(false)\r\n{\r\n    CrashIf(!engine || engine->PageCount() <= 0);\r\n\r\n    if (!engine->IsImageCollection()) {\r\n        windowMargin = gGlobalPrefs->fixedPageUI.windowMargin;\r\n        pageSpacing = gGlobalPrefs->fixedPageUI.pageSpacing;\r\n    }\r\n    else {\r\n        windowMargin = gGlobalPrefs->comicBookUI.windowMargin;\r\n        pageSpacing = gGlobalPrefs->comicBookUI.pageSpacing;\r\n    }\r\n#ifdef DRAW_PAGE_SHADOWS\r\n    windowMargin.top += 3; windowMargin.bottom += 5;\r\n    windowMargin.right += 3; windowMargin.left += 1;\r\n    pageSpacing.dx += 4; pageSpacing.dy += 4;\r\n#endif\r\n\r\n    textCache = new PageTextCache(engine);\r\n    textSelection = new TextSelection(engine, textCache);\r\n    textSearch = new TextSearch(engine, textCache);\r\n}\r\n\r\nDisplayModel::~DisplayModel()\r\n{\r\n    dontRenderFlag = true;\r\n    cb->CleanUp(this);\r\n\r\n    delete pdfSync;\r\n    delete userAnnots;\r\n    delete textSearch;\r\n    delete textSelection;\r\n    delete textCache;\r\n    delete engine;\r\n    free(pagesInfo);\r\n}\r\n\r\nPageInfo *DisplayModel::GetPageInfo(int pageNo) const\r\n{\r\n    if (!ValidPageNo(pageNo))\r\n        return nullptr;\r\n    assert(pagesInfo);\r\n    if (!pagesInfo) return nullptr;\r\n    return &(pagesInfo[pageNo-1]);\r\n}\r\n\r\n// Call this before the first Relayout\r\nvoid DisplayModel::SetInitialViewSettings(DisplayMode newDisplayMode, int newStartPage, SizeI viewPort, int screenDPI)\r\n{\r\n    totalViewPortSize = viewPort;\r\n    dpiFactor = 1.0f * screenDPI / engine->GetFileDPI();\r\n    if (ValidPageNo(newStartPage))\r\n        startPage = newStartPage;\r\n\r\n    displayMode = newDisplayMode;\r\n    presDisplayMode = newDisplayMode;\r\n    PageLayoutType layout = engine->PreferredLayout();\r\n    if (DM_AUTOMATIC == displayMode) {\r\n        switch (layout & ~Layout_R2L) {\r\n        case Layout_Single: displayMode = DM_CONTINUOUS; break;\r\n        case Layout_Facing: displayMode = DM_CONTINUOUS_FACING; break;\r\n        case Layout_Book: displayMode = DM_CONTINUOUS_BOOK_VIEW; break;\r\n        case Layout_Single | Layout_NonContinuous: displayMode = DM_SINGLE_PAGE; break;\r\n        case Layout_Facing | Layout_NonContinuous: displayMode = DM_FACING; break;\r\n        case Layout_Book | Layout_NonContinuous: displayMode = DM_BOOK_VIEW; break;\r\n        }\r\n    }\r\n    displayR2L = (layout & Layout_R2L) != 0;\r\n    BuildPagesInfo();\r\n}\r\n\r\nvoid DisplayModel::BuildPagesInfo()\r\n{\r\n    AssertCrash(!pagesInfo);\r\n    int pageCount = PageCount();\r\n    pagesInfo = AllocArray<PageInfo>(pageCount);\r\n\r\n    RectD defaultRect;\r\n    if (0 == GetMeasurementSystem())\r\n        defaultRect = RectD(0, 0, 21.0 / 2.54 * engine->GetFileDPI(), 29.7 / 2.54 * engine->GetFileDPI());\r\n    else\r\n        defaultRect = RectD(0, 0, 8.5 * engine->GetFileDPI(), 11 * engine->GetFileDPI());\r\n\r\n    int columns = ColumnsFromDisplayMode(displayMode);\r\n    int newStartPage = startPage;\r\n    if (IsBookView(displayMode) && newStartPage == 1 && columns > 1)\r\n        newStartPage--;\r\n    for (int pageNo = 1; pageNo <= pageCount; pageNo++) {\r\n        PageInfo *pageInfo = GetPageInfo(pageNo);\r\n        pageInfo->page = engine->PageMediabox(pageNo);\r\n        // layout pages with an empty mediabox as A4 size (resp. letter size)\r\n        if (pageInfo->page.IsEmpty())\r\n            pageInfo->page = defaultRect;\r\n        pageInfo->visibleRatio = 0.0;\r\n        pageInfo->shown = false;\r\n        if (IsContinuous(displayMode))\r\n            pageInfo->shown = true;\r\n        else if (newStartPage <= pageNo && pageNo < newStartPage + columns)\r\n            pageInfo->shown = true;\r\n    }\r\n}\r\n\r\n// TODO: a better name e.g. ShouldShow() to better distinguish between\r\n// before-layout info and after-layout visibility checks\r\nbool DisplayModel::PageShown(int pageNo) const\r\n{\r\n    PageInfo *pageInfo = GetPageInfo(pageNo);\r\n    if (!pageInfo)\r\n        return false;\r\n    return pageInfo->shown;\r\n}\r\n\r\nbool DisplayModel::PageVisible(int pageNo) const\r\n{\r\n    PageInfo *pageInfo = GetPageInfo(pageNo);\r\n    if (!pageInfo)\r\n        return false;\r\n    return pageInfo->visibleRatio > 0.0;\r\n}\r\n\r\n/* Return true if a page is visible or a page in a row below or above is visible */\r\nbool DisplayModel::PageVisibleNearby(int pageNo) const\r\n{\r\n    DisplayMode mode = GetDisplayMode();\r\n    int columns = ColumnsFromDisplayMode(mode);\r\n\r\n    pageNo = FirstPageInARowNo(pageNo, columns, IsBookView(mode));\r\n    for (int i = pageNo - columns; i < pageNo + 2 * columns; i++) {\r\n        if (ValidPageNo(i) && PageVisible(i))\r\n            return true;\r\n    }\r\n    return false;\r\n}\r\n\r\n/* Return true if the first page is fully visible and alone on a line in\r\n   show cover mode (i.e. it's not possible to flip to a previous page) */\r\nbool DisplayModel::FirstBookPageVisible() const\r\n{\r\n    if (!IsBookView(GetDisplayMode()))\r\n        return false;\r\n    if (CurrentPageNo() != 1)\r\n        return false;\r\n    return true;\r\n}\r\n\r\n/* Return true if the last page is fully visible and alone on a line in\r\n   facing or show cover mode (i.e. it's not possible to flip to a next page) */\r\nbool DisplayModel::LastBookPageVisible() const\r\n{\r\n    int count = PageCount();\r\n    DisplayMode mode = GetDisplayMode();\r\n    if (IsSingle(mode))\r\n        return false;\r\n    if (CurrentPageNo() == count)\r\n        return true;\r\n    if (GetPageInfo(count)->visibleRatio < 1.0)\r\n        return false;\r\n    if (FirstPageInARowNo(count, ColumnsFromDisplayMode(mode),\r\n                          IsBookView(mode)) < count)\r\n        return false;\r\n    return true;\r\n}\r\n\r\n/* Given a zoom level that can include a \"virtual\" zoom levels like ZOOM_FIT_WIDTH,\r\n   ZOOM_FIT_PAGE or ZOOM_FIT_CONTENT, calculate an absolute zoom level */\r\nfloat DisplayModel::ZoomRealFromVirtualForPage(float zoomVirtual, int pageNo) const\r\n{\r\n    if (zoomVirtual != ZOOM_FIT_WIDTH && zoomVirtual != ZOOM_FIT_PAGE && zoomVirtual != ZOOM_FIT_CONTENT)\r\n        return zoomVirtual * 0.01f * dpiFactor;\r\n\r\n    SizeD row;\r\n    int columns = ColumnsFromDisplayMode(GetDisplayMode());\r\n\r\n    bool fitToContent = (ZOOM_FIT_CONTENT == zoomVirtual);\r\n    if (fitToContent && columns > 1) {\r\n        // Fit the content of all the pages in the same row into the visible area\r\n        // (i.e. don't crop inner margins but just the left-most, right-most, etc.)\r\n        int first = FirstPageInARowNo(pageNo, columns, IsBookView(GetDisplayMode()));\r\n        int last = LastPageInARowNo(pageNo, columns, IsBookView(GetDisplayMode()), PageCount());\r\n        RectD box;\r\n        for (int i = first; i <= last; i++) {\r\n            PageInfo *pageInfo = GetPageInfo(i);\r\n            if (pageInfo->contentBox.IsEmpty())\r\n                pageInfo->contentBox = engine->PageContentBox(i);\r\n\r\n            RectD pageBox = engine->Transform(pageInfo->page, i, 1.0, rotation);\r\n            RectD contentBox = engine->Transform(pageInfo->contentBox, i, 1.0, rotation);\r\n            if (contentBox.IsEmpty())\r\n                contentBox = pageBox;\r\n\r\n            contentBox.x += row.dx;\r\n            box = box.Union(contentBox);\r\n            row.dx += pageBox.dx + pageSpacing.dx;\r\n        }\r\n        row = box.Size();\r\n    } else {\r\n        row = PageSizeAfterRotation(pageNo, fitToContent);\r\n        row.dx *= columns;\r\n        row.dx += pageSpacing.dx * (columns - 1);\r\n    }\r\n\r\n    assert(!RectD(PointD(), row).IsEmpty());\r\n    if (RectD(PointD(), row).IsEmpty())\r\n        return 0;\r\n\r\n    int areaForPagesDx = viewPort.dx - windowMargin.left - windowMargin.right;\r\n    int areaForPagesDy = viewPort.dy - windowMargin.top - windowMargin.bottom;\r\n    if (areaForPagesDx <= 0 || areaForPagesDy <= 0)\r\n        return 0;\r\n\r\n    float zoomX = areaForPagesDx / (float)row.dx;\r\n    float zoomY = areaForPagesDy / (float)row.dy;\r\n    if (zoomX < zoomY || ZOOM_FIT_WIDTH == zoomVirtual)\r\n        return zoomX;\r\n    return zoomY;\r\n}\r\n\r\nint DisplayModel::FirstVisiblePageNo() const\r\n{\r\n    assert(pagesInfo);\r\n    if (!pagesInfo) return INVALID_PAGE_NO;\r\n\r\n    for (int pageNo = 1; pageNo <= PageCount(); ++pageNo) {\r\n        PageInfo *pageInfo = GetPageInfo(pageNo);\r\n        if (pageInfo->visibleRatio > 0.0)\r\n            return pageNo;\r\n    }\r\n\r\n    /* If no pages are visible */\r\n    return INVALID_PAGE_NO;\r\n}\r\n\r\n// we consider the most visible page the current one\r\n// (in continuous layout, there's no better criteria)\r\nint DisplayModel::CurrentPageNo() const\r\n{\r\n    if (!IsContinuous(GetDisplayMode()))\r\n        return startPage;\r\n\r\n    assert(pagesInfo);\r\n    if (!pagesInfo) return INVALID_PAGE_NO;\r\n    // determine the most visible page\r\n    int mostVisiblePage = INVALID_PAGE_NO;\r\n    float ratio = 0;\r\n\r\n    for (int pageNo = 1; pageNo <= PageCount(); pageNo++) {\r\n        PageInfo *pageInfo = GetPageInfo(pageNo);\r\n        if (pageInfo->visibleRatio > ratio) {\r\n            mostVisiblePage = pageNo;\r\n            ratio = pageInfo->visibleRatio;\r\n        }\r\n    }\r\n\r\n    /* if no page is visible, default to either the first or the last one */\r\n    if (INVALID_PAGE_NO == mostVisiblePage) {\r\n        PageInfo *pageInfo = GetPageInfo(1);\r\n        if (pageInfo && viewPort.y > pageInfo->pos.y + pageInfo->pos.dy)\r\n            mostVisiblePage = PageCount();\r\n        else\r\n            mostVisiblePage = 1;\r\n    }\r\n\r\n    return mostVisiblePage;\r\n}\r\n\r\nvoid DisplayModel::CalcZoomVirtual(float newZoomVirtual)\r\n{\r\n    CrashIf(!IsValidZoom(newZoomVirtual));\r\n    zoomVirtual = newZoomVirtual;\r\n    if ((ZOOM_FIT_WIDTH == newZoomVirtual) || (ZOOM_FIT_PAGE == newZoomVirtual)) {\r\n        /* we want the same zoom for all pages, so use the smallest zoom\r\n           across the pages so that the largest page fits. In most documents\r\n           all pages are the same size anyway */\r\n        float minZoom = (float)HUGE_VAL;\r\n        for (int pageNo = 1; pageNo <= PageCount(); pageNo++) {\r\n            if (PageShown(pageNo)) {\r\n                float thisPageZoom = ZoomRealFromVirtualForPage(newZoomVirtual, pageNo);\r\n                if (minZoom > thisPageZoom)\r\n                    minZoom = thisPageZoom;\r\n            }\r\n        }\r\n        assert(minZoom != (float)HUGE_VAL);\r\n        zoomReal = minZoom;\r\n    } else if (ZOOM_FIT_CONTENT == newZoomVirtual) {\r\n        float newZoom = ZoomRealFromVirtualForPage(newZoomVirtual, CurrentPageNo());\r\n        // limit zooming in to 800% on almost empty pages\r\n        if (newZoom > 8.0)\r\n            newZoom = 8.0;\r\n        // don't zoom in by just a few pixels (throwing away a prerendered page)\r\n        if (newZoom < zoomReal || zoomReal / newZoom < 0.95 ||\r\n            zoomReal < ZoomRealFromVirtualForPage(ZOOM_FIT_PAGE, CurrentPageNo()))\r\n            zoomReal = newZoom;\r\n    } else {\r\n        zoomReal = zoomVirtual * 0.01f * dpiFactor;\r\n    }\r\n}\r\n\r\nfloat DisplayModel::GetZoomReal(int pageNo) const\r\n{\r\n    DisplayMode mode = GetDisplayMode();\r\n    if (IsContinuous(mode))\r\n        return zoomReal;\r\n    if (IsSingle(mode))\r\n        return ZoomRealFromVirtualForPage(zoomVirtual, pageNo);\r\n    pageNo = FirstPageInARowNo(pageNo, ColumnsFromDisplayMode(mode), IsBookView(mode));\r\n    if (pageNo == PageCount() || pageNo == 1 && IsBookView(mode))\r\n        return ZoomRealFromVirtualForPage(zoomVirtual, pageNo);\r\n    return std::min(ZoomRealFromVirtualForPage(zoomVirtual, pageNo), ZoomRealFromVirtualForPage(zoomVirtual, pageNo + 1));\r\n}\r\n\r\n/* Given zoom and rotation, calculate the position of each page on a\r\n   large sheet that is continous view. Needs to be recalculated when:\r\n     * zoom changes\r\n     * rotation changes\r\n     * switching between display modes\r\n     * navigating to another page in non-continuous mode */\r\nvoid DisplayModel::Relayout(float newZoomVirtual, int newRotation)\r\n{\r\n    assert(pagesInfo);\r\n    if (!pagesInfo)\r\n        return;\r\n\r\n    rotation = NormalizeRotation(newRotation);\r\n\r\n    bool needHScroll = false;\r\n    bool needVScroll = false;\r\n    viewPort = RectI(viewPort.TL(), totalViewPortSize);\r\n\r\nRestartLayout:\r\n    int currPosY = windowMargin.top;\r\n    float currZoomReal = zoomReal;\r\n    CalcZoomVirtual(newZoomVirtual);\r\n\r\n    int newViewPortOffsetX = 0;\r\n    if (0 != currZoomReal && INVALID_ZOOM != currZoomReal)\r\n        newViewPortOffsetX = (int)(viewPort.x * zoomReal / currZoomReal);\r\n    viewPort.x = newViewPortOffsetX;\r\n    /* calculate the position of each page on the canvas, given current zoom,\r\n       rotation, columns parameters. You can think of it as a simple\r\n       table layout i.e. rows with a fixed number of columns. */\r\n    int columns = ColumnsFromDisplayMode(GetDisplayMode());\r\n    int columnMaxWidth[2] = { 0, 0 };\r\n    int pageInARow = 0;\r\n    int rowMaxPageDy = 0;\r\n    for (int pageNo = 1; pageNo <= PageCount(); ++pageNo) {\r\n        PageInfo *pageInfo = GetPageInfo(pageNo);\r\n        if (!pageInfo->shown) {\r\n            assert(0.0 == pageInfo->visibleRatio);\r\n            continue;\r\n        }\r\n        SizeD pageSize = PageSizeAfterRotation(pageNo);\r\n        RectI pos;\r\n        // don't add the full 0.5 for rounding to account for precision errors\r\n        pos.dx = (int)(pageSize.dx * zoomReal + 0.499);\r\n        pos.dy = (int)(pageSize.dy * zoomReal + 0.499);\r\n\r\n        if (rowMaxPageDy < pos.dy)\r\n            rowMaxPageDy = pos.dy;\r\n        pos.y = currPosY;\r\n\r\n        // restart the layout if we detect we need to show scrollbars\r\n        if (!needVScroll && viewPort.dy < currPosY + rowMaxPageDy) {\r\n            needVScroll = true;\r\n            viewPort.dx -= GetSystemMetrics(SM_CXVSCROLL);\r\n            goto RestartLayout;\r\n        }\r\n\r\n        if (IsBookView(GetDisplayMode()) && pageNo == 1 && columns - pageInARow > 1)\r\n            pageInARow++;\r\n        CrashIf(pageInARow >= dimof(columnMaxWidth));\r\n        if (columnMaxWidth[pageInARow] < pos.dx)\r\n            columnMaxWidth[pageInARow] = pos.dx;\r\n\r\n        if (!needHScroll && viewPort.dx < windowMargin.left + columnMaxWidth[0] + (columns == 2 ? pageSpacing.dx + columnMaxWidth[1] : 0) + windowMargin.right) {\r\n            needHScroll = true;\r\n            viewPort.dy -= GetSystemMetrics(SM_CYHSCROLL);\r\n            goto RestartLayout;\r\n        }\r\n\r\n        pageInfo->pos = pos;\r\n\r\n        pageInARow++;\r\n        assert(pageInARow <= columns);\r\n        if (pageInARow == columns) {\r\n            /* starting next row */\r\n            currPosY += rowMaxPageDy + pageSpacing.dy;\r\n            rowMaxPageDy = 0;\r\n            pageInARow = 0;\r\n        }\r\n    }\r\n\r\n    if (pageInARow != 0) {\r\n        /* this is a partial row */\r\n        currPosY += rowMaxPageDy + pageSpacing.dy;\r\n    }\r\n    // restart the layout if we detect we need to show scrollbars\r\n    // (there are some edge cases we can't catch in the above loop)\r\n    const int canvasDy = currPosY + windowMargin.bottom - pageSpacing.dy;\r\n    if (!needVScroll && canvasDy > viewPort.dy) {\r\n        needVScroll = true;\r\n        viewPort.dx -= GetSystemMetrics(SM_CXVSCROLL);\r\n        goto RestartLayout;\r\n    }\r\n\r\n    if (columns == 2 && PageCount() == 1) {\r\n        /* don't center a single page over two columns */\r\n        if (IsBookView(GetDisplayMode()))\r\n            columnMaxWidth[0] = columnMaxWidth[1];\r\n        else\r\n            columnMaxWidth[1] = columnMaxWidth[0];\r\n    }\r\n\r\n    // restart the layout if we detect we need to show scrollbars\r\n    // (there are some edge cases we can't catch in the above loop)\r\n    int canvasDx = windowMargin.left + columnMaxWidth[0] + (columns == 2 ? pageSpacing.dx + columnMaxWidth[1] : 0) + windowMargin.right;\r\n    if (!needHScroll && canvasDx > viewPort.dx) {\r\n        needHScroll = true;\r\n        viewPort.dy -= GetSystemMetrics(SM_CYHSCROLL);\r\n        goto RestartLayout;\r\n    }\r\n\r\n    /* since pages can be smaller than the drawing area, center them in x axis */\r\n    int offX = 0;\r\n    if (canvasDx < viewPort.dx) {\r\n        viewPort.x = 0;\r\n        offX = (viewPort.dx - canvasDx) / 2;\r\n        canvasDx = viewPort.dx;\r\n    }\r\n\r\n    assert(offX >= 0);\r\n    pageInARow = 0;\r\n    int pageOffX = offX + windowMargin.left;\r\n    for (int pageNo = 1; pageNo <= PageCount(); ++pageNo) {\r\n        PageInfo *pageInfo = GetPageInfo(pageNo);\r\n        if (!pageInfo->shown) {\r\n            assert(0.0 == pageInfo->visibleRatio);\r\n            continue;\r\n        }\r\n        // leave first spot empty in cover page mode\r\n        if (IsBookView(GetDisplayMode()) && pageNo == 1) {\r\n            CrashIf(pageInARow >= dimof(columnMaxWidth));\r\n            pageOffX += columnMaxWidth[pageInARow] + pageSpacing.dx;\r\n            ++pageInARow;\r\n        }\r\n        CrashIf(pageInARow >= dimof(columnMaxWidth));\r\n        // center pages in a single column but right/left align them when using two columns\r\n        if (1 == columns)\r\n            pageInfo->pos.x = pageOffX + (columnMaxWidth[0] - pageInfo->pos.dx) / 2;\r\n        else if (0 == pageInARow)\r\n            pageInfo->pos.x = pageOffX + columnMaxWidth[0] - pageInfo->pos.dx;\r\n        else\r\n            pageInfo->pos.x = pageOffX;\r\n        // center the cover page over the first two spots in non-continuous mode\r\n        if (IsBookView(GetDisplayMode()) && pageNo == 1 && !IsContinuous(GetDisplayMode())) {\r\n            pageInfo->pos.x = offX + windowMargin.left + (columnMaxWidth[0] + pageSpacing.dx + columnMaxWidth[1] - pageInfo->pos.dx) / 2;\r\n        }\r\n        // mirror the page layout when displaying a Right-to-Left document\r\n        if (displayR2L && columns > 1)\r\n            pageInfo->pos.x = canvasDx - pageInfo->pos.x - pageInfo->pos.dx;\r\n\r\n        CrashIf(pageInARow >= dimof(columnMaxWidth));\r\n        pageOffX += columnMaxWidth[pageInARow] + pageSpacing.dx;\r\n        ++pageInARow;\r\n        assert(pageOffX >= 0 && pageInfo->pos.x >= 0);\r\n\r\n        if (pageInARow == columns) {\r\n            pageOffX = offX + windowMargin.left;\r\n            pageInARow = 0;\r\n        }\r\n    }\r\n\r\n    /* if after resizing we would have blank space on the right due to x offset\r\n       being too much, make x offset smaller so that there's no blank space */\r\n    if (viewPort.dx - (canvasDx - newViewPortOffsetX) > 0)\r\n        viewPort.x = canvasDx - viewPort.dx;\r\n\r\n    /* if a page is smaller than drawing area in y axis, y-center the page */\r\n    if (canvasDy < viewPort.dy) {\r\n        int offY = windowMargin.top + (viewPort.dy - canvasDy) / 2;\r\n        assert(offY >= 0.0);\r\n        for (int pageNo = 1; pageNo <= PageCount(); ++pageNo) {\r\n            PageInfo *pageInfo = GetPageInfo(pageNo);\r\n            if (!pageInfo->shown) {\r\n                assert(0.0 == pageInfo->visibleRatio);\r\n                continue;\r\n            }\r\n            pageInfo->pos.y += offY;\r\n        }\r\n    }\r\n\r\n    canvasSize = SizeI(std::max(canvasDx, viewPort.dx), std::max(canvasDy, viewPort.dy));\r\n}\r\n\r\nvoid DisplayModel::ChangeStartPage(int newStartPage)\r\n{\r\n    assert(ValidPageNo(newStartPage));\r\n    assert(!IsContinuous(GetDisplayMode()));\r\n\r\n    int columns = ColumnsFromDisplayMode(GetDisplayMode());\r\n    startPage = newStartPage;\r\n    if (IsBookView(GetDisplayMode()) && newStartPage == 1 && columns > 1)\r\n        newStartPage--;\r\n    for (int pageNo = 1; pageNo <= PageCount(); pageNo++) {\r\n        PageInfo *pageInfo = GetPageInfo(pageNo);\r\n        if (IsContinuous(GetDisplayMode()))\r\n            pageInfo->shown = true;\r\n        else if (pageNo >= newStartPage && pageNo < newStartPage + columns) {\r\n            //lf(\"DisplayModel::changeStartPage() set page %d as shown\", pageNo);\r\n            pageInfo->shown = true;\r\n        } else\r\n            pageInfo->shown = false;\r\n        pageInfo->visibleRatio = 0.0;\r\n    }\r\n    Relayout(zoomVirtual, rotation);\r\n}\r\n\r\n/* Given positions of each page in a large sheet that is continous view and\r\n   coordinates of a current view into that large sheet, calculate which\r\n   parts of each page is visible on the screen.\r\n   Needs to be recalucated after scrolling the view. */\r\nvoid DisplayModel::RecalcVisibleParts()\r\n{\r\n    assert(pagesInfo);\r\n    if (!pagesInfo)\r\n        return;\r\n\r\n    for (int pageNo = 1; pageNo <= PageCount(); ++pageNo) {\r\n        PageInfo *pageInfo = GetPageInfo(pageNo);\r\n        if (!pageInfo->shown) {\r\n            assert(0.0 == pageInfo->visibleRatio);\r\n            continue;\r\n        }\r\n\r\n        RectI pageRect = pageInfo->pos;\r\n        RectI visiblePart = pageRect.Intersect(viewPort);\r\n\r\n        pageInfo->visibleRatio = 0.0;\r\n        if (!visiblePart.IsEmpty()) {\r\n            assert(pageRect.dx > 0 && pageRect.dy > 0);\r\n            // calculate with floating point precision to prevent an integer overflow\r\n            pageInfo->visibleRatio = 1.0f * visiblePart.dx * visiblePart.dy / ((float)pageRect.dx * pageRect.dy);\r\n        }\r\n        pageInfo->pageOnScreen = pageRect;\r\n        pageInfo->pageOnScreen.Offset(-viewPort.x, -viewPort.y);\r\n    }\r\n}\r\n\r\nint DisplayModel::GetPageNoByPoint(PointI pt)\r\n{\r\n    // no reasonable answer possible, if zoom hasn't been set yet\r\n    if (zoomReal <= 0)\r\n        return -1;\r\n\r\n    for (int pageNo = 1; pageNo <= PageCount(); ++pageNo) {\r\n        PageInfo *pageInfo = GetPageInfo(pageNo);\r\n        AssertCrash(0.0 == pageInfo->visibleRatio || pageInfo->shown);\r\n        if (!pageInfo->shown)\r\n            continue;\r\n\r\n        if (pageInfo->pageOnScreen.Contains(pt))\r\n            return pageNo;\r\n    }\r\n\r\n    return -1;\r\n}\r\n\r\nint DisplayModel::GetPageNextToPoint(PointI pt)\r\n{\r\n    if (zoomReal <= 0)\r\n        return startPage;\r\n\r\n    unsigned int maxDist = UINT_MAX;\r\n    int closest = startPage;\r\n\r\n    for (int pageNo = 1; pageNo <= PageCount(); ++pageNo) {\r\n        PageInfo *pageInfo = GetPageInfo(pageNo);\r\n        AssertCrash(0.0 == pageInfo->visibleRatio || pageInfo->shown);\r\n        if (!pageInfo->shown)\r\n            continue;\r\n\r\n        if (pageInfo->pageOnScreen.Contains(pt))\r\n            return pageNo;\r\n\r\n        unsigned int dist = distSq(pt.x - pageInfo->pageOnScreen.x - pageInfo->pageOnScreen.dx / 2,\r\n                                   pt.y - pageInfo->pageOnScreen.y - pageInfo->pageOnScreen.dy / 2);\r\n        if (dist < maxDist) {\r\n            closest = pageNo;\r\n            maxDist = dist;\r\n        }\r\n    }\r\n\r\n    return closest;\r\n}\r\n\r\nPointI DisplayModel::CvtToScreen(int pageNo, PointD pt)\r\n{\r\n    PageInfo *pageInfo = GetPageInfo(pageNo);\r\n    CrashIf(!pageInfo);\r\n    if (!pageInfo)\r\n        return PointI();\r\n\r\n    PointD p = engine->Transform(pt, pageNo, zoomReal, rotation);\r\n    // don't add the full 0.5 for rounding to account for precision errors\r\n    p.x += 0.499 + pageInfo->pageOnScreen.x;\r\n    p.y += 0.499 + pageInfo->pageOnScreen.y;\r\n\r\n    return p.ToInt();\r\n}\r\n\r\nRectI DisplayModel::CvtToScreen(int pageNo, RectD r)\r\n{\r\n    PointI TL = CvtToScreen(pageNo, r.TL());\r\n    PointI BR = CvtToScreen(pageNo, r.BR());\r\n    return RectI::FromXY(TL, BR);\r\n}\r\n\r\nPointD DisplayModel::CvtFromScreen(PointI pt, int pageNo)\r\n{\r\n    if (!ValidPageNo(pageNo))\r\n        pageNo = GetPageNextToPoint(pt);\r\n\r\n    const PageInfo *pageInfo = GetPageInfo(pageNo);\r\n    CrashIf(!pageInfo);\r\n    if (!pageInfo)\r\n        return PointD();\r\n\r\n    // don't add the full 0.5 for rounding to account for precision errors\r\n    PointD p = PointD(pt.x - 0.499 - pageInfo->pageOnScreen.x,\r\n                      pt.y - 0.499 - pageInfo->pageOnScreen.y);\r\n    return engine->Transform(p, pageNo, zoomReal, rotation, true);\r\n}\r\n\r\nRectD DisplayModel::CvtFromScreen(RectI r, int pageNo)\r\n{\r\n    if (!ValidPageNo(pageNo))\r\n        pageNo = GetPageNextToPoint(r.TL());\r\n\r\n    PointD TL = CvtFromScreen(r.TL(), pageNo);\r\n    PointD BR = CvtFromScreen(r.BR(), pageNo);\r\n    return RectD::FromXY(TL, BR);\r\n}\r\n\r\n/* Given position 'x'/'y' in the draw area, returns a structure describing\r\n   a link or nullptr if there is no link at this position. */\r\nPageElement *DisplayModel::GetElementAtPos(PointI pt)\r\n{\r\n    int pageNo = GetPageNoByPoint(pt);\r\n    if (!ValidPageNo(pageNo))\r\n        return nullptr;\r\n    // only return visible elements (for cursor interaction)\r\n    if (!RectI(PointI(), viewPort.Size()).Contains(pt))\r\n        return nullptr;\r\n\r\n    PointD pos = CvtFromScreen(pt, pageNo);\r\n    return engine->GetElementAtPos(pageNo, pos);\r\n}\r\n\r\n// note: returns false for pages that haven't been rendered yet\r\nbool DisplayModel::IsOverText(PointI pt)\r\n{\r\n    int pageNo = GetPageNoByPoint(pt);\r\n    if (!ValidPageNo(pageNo))\r\n        return false;\r\n    // only return visible elements (for cursor interaction)\r\n    if (!RectI(PointI(), viewPort.Size()).Contains(pt))\r\n        return false;\r\n    if (!textCache->HasData(pageNo))\r\n        return false;\r\n\r\n    PointD pos = CvtFromScreen(pt, pageNo);\r\n    return textSelection->IsOverGlyph(pageNo, pos.x, pos.y);\r\n}\r\n\r\nvoid DisplayModel::RenderVisibleParts()\r\n{\r\n    int firstVisiblePage = 0;\r\n    int lastVisiblePage = 0;\r\n\r\n    for (int pageNo = 1; pageNo <= PageCount(); ++pageNo) {\r\n        PageInfo *pageInfo = GetPageInfo(pageNo);\r\n        if (pageInfo->visibleRatio > 0.0) {\r\n            assert(pageInfo->shown);\r\n            if (0 == firstVisiblePage)\r\n                firstVisiblePage = pageNo;\r\n            lastVisiblePage = pageNo;\r\n        }\r\n    }\r\n    // no page is visible if e.g. the window is resized\r\n    // vertically until only the title bar remains visible\r\n    if (0 == firstVisiblePage)\r\n        return;\r\n\r\n    // rendering happens LIFO except if the queue is currently\r\n    // empty, so request the visible pages first and last to\r\n    // make sure they're rendered before the predicted pages\r\n    for (int pageNo = firstVisiblePage; pageNo <= lastVisiblePage; pageNo++) {\r\n        cb->RequestRendering(pageNo);\r\n    }\r\n\r\n    if (gPredictiveRender) {\r\n        // prerender two more pages in facing and book view modes\r\n        // if the rendering queue still has place for them\r\n        if (!IsSingle(GetDisplayMode())) {\r\n            if (firstVisiblePage > 2)\r\n                cb->RequestRendering(firstVisiblePage - 2);\r\n            if (lastVisiblePage + 1 < PageCount())\r\n                cb->RequestRendering(lastVisiblePage + 2);\r\n        }\r\n        if (firstVisiblePage > 1)\r\n            cb->RequestRendering(firstVisiblePage - 1);\r\n        if (lastVisiblePage < PageCount())\r\n            cb->RequestRendering(lastVisiblePage + 1);\r\n    }\r\n\r\n    // request the visible pages last so that the above requested\r\n    // invisible pages are not rendered if the queue fills up\r\n    for (int pageNo = lastVisiblePage; pageNo >= firstVisiblePage; pageNo--) {\r\n        cb->RequestRendering(pageNo);\r\n    }\r\n}\r\n\r\nvoid DisplayModel::SetViewPortSize(SizeI newViewPortSize)\r\n{\r\n    ScrollState ss;\r\n\r\n    bool isDocReady = ValidPageNo(startPage) && zoomReal != 0;\r\n    if (isDocReady)\r\n        ss = GetScrollState();\r\n\r\n    totalViewPortSize = newViewPortSize;\r\n    Relayout(zoomVirtual, rotation);\r\n\r\n    if (isDocReady) {\r\n        // when fitting to content, let GoToPage do the necessary scrolling\r\n        if (zoomVirtual != ZOOM_FIT_CONTENT)\r\n            SetScrollState(ss);\r\n        else\r\n            GoToPage(ss.page, 0);\r\n    } else {\r\n        RecalcVisibleParts();\r\n        RenderVisibleParts();\r\n        cb->UpdateScrollbars(canvasSize);\r\n    }\r\n}\r\n\r\nRectD DisplayModel::GetContentBox(int pageNo, RenderTarget target)\r\n{\r\n    RectD cbox;\r\n    // we cache the contentBox for the View target\r\n    if (Target_View == target) {\r\n        PageInfo *pageInfo = GetPageInfo(pageNo);\r\n        if (pageInfo->contentBox.IsEmpty())\r\n            pageInfo->contentBox = engine->PageContentBox(pageNo);\r\n        cbox = pageInfo->contentBox;\r\n    }\r\n    else\r\n        cbox = engine->PageContentBox(pageNo, target);\r\n\r\n    return engine->Transform(cbox, pageNo, zoomReal, rotation);\r\n}\r\n\r\n/* get the (screen) coordinates of the point where a page's actual\r\n   content begins (relative to the page's top left corner) */\r\nPointI DisplayModel::GetContentStart(int pageNo)\r\n{\r\n    RectD contentBox = GetContentBox(pageNo);\r\n    if (contentBox.IsEmpty())\r\n        return PointI(0, 0);\r\n    return contentBox.TL().ToInt();\r\n}\r\n\r\n// TODO: what's GoToPage supposed to do for Facing at 400% zoom?\r\nvoid DisplayModel::GoToPage(int pageNo, int scrollY, bool addNavPt, int scrollX)\r\n{\r\n    assert(ValidPageNo(pageNo));\r\n    if (!ValidPageNo(pageNo))\r\n        return;\r\n\r\n    if (addNavPt)\r\n        AddNavPoint();\r\n\r\n    /* in facing mode only start at odd pages (odd because page\r\n       numbering starts with 1, so odd is really an even page) */\r\n    bool scrollToNextPage = false;\r\n    if (!IsSingle(GetDisplayMode())) {\r\n        int actualPageNo = pageNo;\r\n        pageNo = FirstPageInARowNo(pageNo, ColumnsFromDisplayMode(GetDisplayMode()), IsBookView(GetDisplayMode()));\r\n        scrollToNextPage = pageNo == actualPageNo - 1;\r\n    }\r\n\r\n    if (!IsContinuous(GetDisplayMode())) {\r\n        /* in single page mode going to another page involves recalculating\r\n           the size of canvas */\r\n        ChangeStartPage(pageNo);\r\n    } else if (ZOOM_FIT_CONTENT == zoomVirtual) {\r\n        // make sure that CalcZoomVirtual uses the correct page to calculate\r\n        // the zoom level for (visibility will be recalculated below anyway)\r\n        for (int i =  PageCount(); i > 0; i--)\r\n            GetPageInfo(i)->visibleRatio = (i == pageNo ? 1.0f : 0);\r\n        Relayout(zoomVirtual, rotation);\r\n    }\r\n    //lf(\"DisplayModel::GoToPage(pageNo=%d, scrollY=%d)\", pageNo, scrollY);\r\n    PageInfo * pageInfo = GetPageInfo(pageNo);\r\n\r\n    // intentionally ignore scrollX and scrollY when fitting to content\r\n    if (ZOOM_FIT_CONTENT == zoomVirtual) {\r\n        // scroll down to where the actual content starts\r\n        PointI start = GetContentStart(pageNo);\r\n        scrollX = start.x;\r\n        scrollY = start.y;\r\n        if (ColumnsFromDisplayMode(GetDisplayMode()) > 1) {\r\n            int lastPageNo = LastPageInARowNo(pageNo, ColumnsFromDisplayMode(GetDisplayMode()), IsBookView(GetDisplayMode()), PageCount());\r\n            PointI second = GetContentStart(lastPageNo);\r\n            scrollY = std::min(scrollY, second.y);\r\n        }\r\n        viewPort.x = scrollX + pageInfo->pos.x - windowMargin.left;\r\n    }\r\n    else if (-1 != scrollX)\r\n        viewPort.x = scrollX;\r\n    // make sure to not display the blank space beside the first page in cover mode\r\n    else if (-1 == scrollX && 1 == pageNo && IsBookView(GetDisplayMode()))\r\n        viewPort.x = pageInfo->pos.x - windowMargin.left;\r\n    // make sure that at least part of the page is visible\r\n    else if (viewPort.x >= pageInfo->pos.x + pageInfo->pos.dx)\r\n        viewPort.x = pageInfo->pos.x;\r\n    // make sure to scroll to the correct page\r\n    if (-1 != scrollX && scrollToNextPage)\r\n        viewPort.x += pageInfo->pos.dx;\r\n\r\n    /* Hack: if an image is smaller in Y axis than the draw area, then we center\r\n       the image by setting pageInfo->currPos.y in RecalcPagesInfo. So we shouldn't\r\n       scroll (adjust viewPort.y) there because it defeats the purpose.\r\n       TODO: is there a better way of y-centering? */\r\n    viewPort.y = scrollY;\r\n    // Move the next page to the top (unless the remaining pages fit onto a single screen)\r\n    if (IsContinuous(GetDisplayMode()))\r\n        viewPort.y = pageInfo->pos.y - windowMargin.top + scrollY;\r\n\r\n    viewPort.x = limitValue(viewPort.x, 0, canvasSize.dx - viewPort.dx);\r\n    viewPort.y = limitValue(viewPort.y, 0, canvasSize.dy - viewPort.dy);\r\n\r\n    RecalcVisibleParts();\r\n    RenderVisibleParts();\r\n    cb->UpdateScrollbars(canvasSize);\r\n    cb->PageNoChanged(this, pageNo);\r\n    RepaintDisplay();\r\n}\r\n\r\nvoid DisplayModel::SetDisplayMode(DisplayMode newDisplayMode, bool keepContinuous)\r\n{\r\n    if (keepContinuous && IsContinuous(displayMode)) {\r\n        switch (newDisplayMode) {\r\n        case DM_SINGLE_PAGE: newDisplayMode = DM_CONTINUOUS; break;\r\n        case DM_FACING: newDisplayMode = DM_CONTINUOUS_FACING; break;\r\n        case DM_BOOK_VIEW: newDisplayMode = DM_CONTINUOUS_BOOK_VIEW; break;\r\n        }\r\n    }\r\n    if (displayMode == newDisplayMode)\r\n        return;\r\n\r\n    int currPageNo = CurrentPageNo();\r\n    if (IsFacing(newDisplayMode) && IsBookView(displayMode) && currPageNo < PageCount())\r\n        currPageNo++;\r\n    displayMode = newDisplayMode;\r\n    if (IsContinuous(newDisplayMode)) {\r\n        /* mark all pages as shown but not yet visible. The equivalent code\r\n           for non-continuous mode is in DisplayModel::changeStartPage() called\r\n           from DisplayModel::GoToPage() */\r\n        for (int pageNo = 1; pageNo <= PageCount(); pageNo++) {\r\n            PageInfo *pageInfo = &(pagesInfo[pageNo-1]);\r\n            pageInfo->shown = true;\r\n            pageInfo->visibleRatio = 0.0;\r\n        }\r\n        Relayout(zoomVirtual, rotation);\r\n    }\r\n    GoToPage(currPageNo, 0);\r\n}\r\n\r\nvoid DisplayModel::SetPresentationMode(bool enable)\r\n{\r\n    presentationMode = enable;\r\n    if (enable) {\r\n        presDisplayMode = displayMode;\r\n        presZoomVirtual = zoomVirtual;\r\n        // disable the window margin during presentations\r\n        windowMargin.top = windowMargin.right = windowMargin.bottom = windowMargin.left = 0;\r\n        SetDisplayMode(DM_SINGLE_PAGE);\r\n        SetZoomVirtual(ZOOM_FIT_PAGE);\r\n    }\r\n    else {\r\n        if (engine && engine->IsImageCollection())\r\n            windowMargin = gGlobalPrefs->comicBookUI.windowMargin;\r\n        else\r\n            windowMargin = gGlobalPrefs->fixedPageUI.windowMargin;\r\n#ifdef DRAW_PAGE_SHADOWS\r\n        windowMargin.top += 3; windowMargin.bottom += 5;\r\n        windowMargin.right += 3; windowMargin.left += 1;\r\n#endif\r\n        SetDisplayMode(presDisplayMode);\r\n        if (!IsValidZoom(presZoomVirtual))\r\n            presZoomVirtual = zoomVirtual;\r\n        SetZoomVirtual(presZoomVirtual);\r\n    }\r\n}\r\n\r\n/* In continuous mode just scrolls to the next page. In single page mode\r\n   rebuilds the display model for the next page.\r\n   Returns true if advanced to the next page or false if couldn't advance\r\n   (e.g. because already was at the last page) */\r\nbool DisplayModel::GoToNextPage()\r\n{\r\n    int columns = ColumnsFromDisplayMode(GetDisplayMode());\r\n    int currPageNo = CurrentPageNo();\r\n    // Fully display the current page, if the previous page is still visible\r\n    if (ValidPageNo(currPageNo - columns) && PageVisible(currPageNo - columns) && GetPageInfo(currPageNo)->visibleRatio < 1.0) {\r\n        GoToPage(currPageNo, false);\r\n        return true;\r\n    }\r\n    int firstPageInNewRow = FirstPageInARowNo(currPageNo + columns, columns, IsBookView(GetDisplayMode()));\r\n    if (firstPageInNewRow > PageCount()) {\r\n        /* we're on a last row or after it, can't go any further */\r\n        return false;\r\n    }\r\n    GoToPage(firstPageInNewRow, false);\r\n    return true;\r\n}\r\n\r\nbool DisplayModel::GoToPrevPage(int scrollY)\r\n{\r\n    int columns = ColumnsFromDisplayMode(GetDisplayMode());\r\n    int currPageNo = CurrentPageNo();\r\n\r\n    PointI top;\r\n    if ((0 == scrollY || -1 == scrollY) && zoomVirtual == ZOOM_FIT_CONTENT) {\r\n        currPageNo = FirstVisiblePageNo();\r\n        top = GetContentStart(currPageNo);\r\n    }\r\n\r\n    PageInfo * pageInfo = GetPageInfo(currPageNo);\r\n    if (zoomVirtual == ZOOM_FIT_CONTENT && -pageInfo->pageOnScreen.y <= top.y)\r\n        scrollY = 0; // continue, even though the current page isn't fully visible\r\n    else if (std::max(-pageInfo->pageOnScreen.y, 0) > scrollY && IsContinuous(GetDisplayMode())) {\r\n        /* the current page isn't fully visible, so show it first */\r\n        GoToPage(currPageNo, scrollY);\r\n        return true;\r\n    }\r\n    int firstPageInNewRow = FirstPageInARowNo(currPageNo - columns, columns, IsBookView(GetDisplayMode()));\r\n    if (firstPageInNewRow < 1 || 1 == currPageNo) {\r\n        /* we're on a first page, can't go back */\r\n        return false;\r\n    }\r\n\r\n    // scroll to the bottom of the page\r\n    if (-1 == scrollY)\r\n        scrollY = GetPageInfo(firstPageInNewRow)->pageOnScreen.dy;\r\n\r\n    GoToPage(firstPageInNewRow, scrollY);\r\n    return true;\r\n}\r\n\r\nbool DisplayModel::GoToLastPage()\r\n{\r\n    int columns = ColumnsFromDisplayMode(GetDisplayMode());\r\n    int currPageNo = CurrentPageNo();\r\n    int newPageNo = PageCount();\r\n    int firstPageInLastRow = FirstPageInARowNo(newPageNo, columns, IsBookView(GetDisplayMode()));\r\n\r\n    if (currPageNo == firstPageInLastRow) /* are we on the last page already ? */\r\n        return false;\r\n    GoToPage(firstPageInLastRow, 0, true);\r\n    return true;\r\n}\r\n\r\nbool DisplayModel::GoToFirstPage()\r\n{\r\n    if (IsContinuous(GetDisplayMode())) {\r\n        if (0 == viewPort.y) {\r\n            return false;\r\n        }\r\n    } else {\r\n        assert(PageShown(startPage));\r\n        if (1 == startPage) {\r\n            /* we're on a first page already */\r\n            return false;\r\n        }\r\n    }\r\n    GoToPage(1, 0, true);\r\n    return true;\r\n}\r\n\r\nvoid DisplayModel::ScrollXTo(int xOff)\r\n{\r\n    int currPageNo = CurrentPageNo();\r\n    viewPort.x = xOff;\r\n    RecalcVisibleParts();\r\n    cb->UpdateScrollbars(canvasSize);\r\n\r\n    if (CurrentPageNo() != currPageNo)\r\n        cb->PageNoChanged(this, CurrentPageNo());\r\n    RepaintDisplay();\r\n}\r\n\r\nvoid DisplayModel::ScrollXBy(int dx)\r\n{\r\n    int newOffX = limitValue(viewPort.x + dx, 0, canvasSize.dx - viewPort.dx);\r\n    if (newOffX != viewPort.x)\r\n        ScrollXTo(newOffX);\r\n}\r\n\r\nvoid DisplayModel::ScrollYTo(int yOff)\r\n{\r\n    int currPageNo = CurrentPageNo();\r\n    viewPort.y = yOff;\r\n    RecalcVisibleParts();\r\n    RenderVisibleParts();\r\n\r\n    int newPageNo = CurrentPageNo();\r\n    if (newPageNo != currPageNo)\r\n        cb->PageNoChanged(this, newPageNo);\r\n    RepaintDisplay();\r\n}\r\n\r\n/* Scroll the doc in y-axis by 'dy'. If 'changePage' is TRUE, automatically\r\n   switch to prev/next page in non-continuous mode if we scroll past the edges\r\n   of current page */\r\nvoid DisplayModel::ScrollYBy(int dy, bool changePage)\r\n{\r\n    PageInfo *      pageInfo;\r\n    int             currYOff = viewPort.y;\r\n    int             newPageNo;\r\n    int             currPageNo;\r\n\r\n    assert(0 != dy);\r\n    if (0 == dy) return;\r\n\r\n    int newYOff = currYOff;\r\n\r\n    if (!IsContinuous(GetDisplayMode()) && changePage) {\r\n        if ((dy < 0) && (0 == currYOff)) {\r\n            if (startPage > 1) {\r\n                newPageNo = startPage - 1;\r\n                assert(ValidPageNo(newPageNo));\r\n                pageInfo = GetPageInfo(newPageNo);\r\n                newYOff = pageInfo->pos.dy - viewPort.dy;\r\n                if (newYOff < 0)\r\n                    newYOff = 0; /* TODO: center instead? */\r\n                GoToPrevPage(newYOff);\r\n                return;\r\n            }\r\n        }\r\n\r\n        /* see if we have to change page when scrolling forward */\r\n        if ((dy > 0) && (startPage < PageCount())) {\r\n            if (viewPort.y + viewPort.dy >= canvasSize.dy) {\r\n                GoToNextPage();\r\n                return;\r\n            }\r\n        }\r\n    }\r\n\r\n    newYOff += dy;\r\n    newYOff = limitValue(newYOff, 0, canvasSize.dy - viewPort.dy);\r\n    if (newYOff == currYOff)\r\n        return;\r\n\r\n    currPageNo = CurrentPageNo();\r\n    viewPort.y = newYOff;\r\n    RecalcVisibleParts();\r\n    RenderVisibleParts();\r\n    cb->UpdateScrollbars(canvasSize);\r\n    newPageNo = CurrentPageNo();\r\n    if (newPageNo != currPageNo)\r\n        cb->PageNoChanged(this, newPageNo);\r\n    RepaintDisplay();\r\n}\r\n\r\nvoid DisplayModel::SetZoomVirtual(float zoomLevel, PointI *fixPt)\r\n{\r\n    if (zoomLevel > 0)\r\n        zoomLevel = limitValue(zoomLevel, ZOOM_MIN, ZOOM_MAX);\r\n    if (!IsValidZoom(zoomLevel))\r\n        return;\r\n\r\n    bool scrollToFitPage = ZOOM_FIT_PAGE == zoomLevel || ZOOM_FIT_CONTENT == zoomLevel;\r\n    if (zoomVirtual == zoomLevel && (fixPt || !scrollToFitPage))\r\n        return;\r\n\r\n    ScrollState ss = GetScrollState();\r\n\r\n    int centerPage = -1;\r\n    PointD centerPt;\r\n    if (fixPt) {\r\n        centerPage = GetPageNoByPoint(*fixPt);\r\n        if (ValidPageNo(centerPage))\r\n            centerPt = CvtFromScreen(*fixPt, centerPage);\r\n        else\r\n            fixPt = nullptr;\r\n    }\r\n\r\n    if (scrollToFitPage) {\r\n        ss.page = CurrentPageNo();\r\n        // SetScrollState's first call to GoToPage will already scroll to fit\r\n        ss.x = ss.y = -1;\r\n    }\r\n\r\n    //lf(\"DisplayModel::SetZoomVirtual() zoomLevel=%.6f\", _zoomLevel);\r\n    Relayout(zoomLevel, rotation);\r\n    SetScrollState(ss);\r\n\r\n    if (fixPt) {\r\n        // scroll so that the fix point remains in the same screen location after zooming\r\n        PointI centerI = CvtToScreen(centerPage, centerPt);\r\n        if (centerI.x - fixPt->x != 0)\r\n            ScrollXBy(centerI.x - fixPt->x);\r\n        if (centerI.y - fixPt->y != 0)\r\n            ScrollYBy(centerI.y - fixPt->y, false);\r\n    }\r\n}\r\n\r\nfloat DisplayModel::GetZoomVirtual(bool absolute) const\r\n{\r\n    if (absolute) {\r\n        // revert the dpiFactor premultiplication for converting zoomReal back to zoomVirtual\r\n        return zoomReal * 100 / dpiFactor;\r\n    }\r\n    return zoomVirtual;\r\n}\r\n\r\nfloat DisplayModel::GetNextZoomStep(float towardsLevel) const\r\n{\r\n    if (gGlobalPrefs->zoomIncrement > 0) {\r\n        float zoom = GetZoomVirtual(true);\r\n        if (zoom < towardsLevel)\r\n            return std::min(zoom * (gGlobalPrefs->zoomIncrement / 100 + 1), towardsLevel);\r\n        if (zoom > towardsLevel)\r\n            return std::max(zoom / (gGlobalPrefs->zoomIncrement / 100 + 1), towardsLevel);\r\n        return zoom;\r\n    }\r\n\r\n#if 0\r\n    // differences to Adobe Reader: starts at 8.33 (instead of 1 and 6.25)\r\n    // and has four additional intermediary zoom levels (\"added\")\r\n    static float zoomLevels[] = {\r\n        8.33f, 12.5f, 18 /* added */, 25, 33.33f, 50, 66.67f, 75,\r\n        100, 125, 150, 200, 300, 400, 600, 800, 1000 /* added */,\r\n        1200, 1600, 2000 /* added */, 2400, 3200, 4800 /* added */, 6400\r\n    };\r\n    CrashIf(zoomLevels[0] != ZOOM_MIN || zoomLevels[dimof(zoomLevels)-1] != ZOOM_MAX);\r\n#endif\r\n    Vec<float> *zoomLevels = gGlobalPrefs->zoomLevels;\r\n    CrashIf(zoomLevels->Count() != 0 && (zoomLevels->At(0) < ZOOM_MIN || zoomLevels->Last() > ZOOM_MAX));\r\n    CrashIf(zoomLevels->Count() != 0 && zoomLevels->At(0) > zoomLevels->Last());\r\n\r\n    float currZoom = GetZoomVirtual(true);\r\n    float pageZoom = (float)HUGE_VAL, widthZoom = (float)HUGE_VAL;\r\n    for (int pageNo = 1; pageNo <= PageCount(); pageNo++) {\r\n        if (PageShown(pageNo)) {\r\n            float pagePageZoom = ZoomRealFromVirtualForPage(ZOOM_FIT_PAGE, pageNo);\r\n            pageZoom = std::min(pageZoom, pagePageZoom);\r\n            float pageWidthZoom = ZoomRealFromVirtualForPage(ZOOM_FIT_WIDTH, pageNo);\r\n            widthZoom = std::min(widthZoom, pageWidthZoom);\r\n        }\r\n    }\r\n    CrashIf(pageZoom == (float)HUGE_VAL || widthZoom == (float)HUGE_VAL);\r\n    CrashIf(pageZoom > widthZoom);\r\n    pageZoom *= 100 / dpiFactor; widthZoom *= 100 / dpiFactor;\r\n\r\n    const float FUZZ = 0.01f;\r\n    float newZoom = towardsLevel;\r\n    if (currZoom < towardsLevel) {\r\n        for (size_t i = 0; i < zoomLevels->Count(); i++) {\r\n            if (zoomLevels->At(i) - FUZZ > currZoom) {\r\n                newZoom = zoomLevels->At(i);\r\n                break;\r\n            }\r\n        }\r\n        if (currZoom + FUZZ < pageZoom && pageZoom < newZoom - FUZZ)\r\n            newZoom = ZOOM_FIT_PAGE;\r\n        else if (currZoom + FUZZ < widthZoom && widthZoom < newZoom - FUZZ)\r\n            newZoom = ZOOM_FIT_WIDTH;\r\n    } else if (currZoom > towardsLevel) {\r\n        for (size_t i = zoomLevels->Count(); i > 0; i--) {\r\n            if (zoomLevels->At(i - 1) + FUZZ < currZoom) {\r\n                newZoom = zoomLevels->At(i - 1);\r\n                break;\r\n            }\r\n        }\r\n        // skip Fit Width if it results in the same value as Fit Page (same as when zooming in)\r\n        if (newZoom + FUZZ < widthZoom && widthZoom < currZoom - FUZZ && widthZoom != pageZoom)\r\n            newZoom = ZOOM_FIT_WIDTH;\r\n        else if (newZoom + FUZZ < pageZoom && pageZoom < currZoom - FUZZ)\r\n            newZoom = ZOOM_FIT_PAGE;\r\n    }\r\n\r\n    return newZoom;\r\n}\r\n\r\nvoid DisplayModel::RotateBy(int newRotation)\r\n{\r\n    newRotation = NormalizeRotation(newRotation);\r\n    assert(0 != newRotation);\r\n    if (0 == newRotation)\r\n        return;\r\n    newRotation = NormalizeRotation(newRotation + rotation);\r\n\r\n    int currPageNo = CurrentPageNo();\r\n    Relayout(zoomVirtual, newRotation);\r\n    GoToPage(currPageNo, 0);\r\n}\r\n\r\n/* Given <region> (in user coordinates ) on page <pageNo>, copies text in that region\r\n * into a newly allocated buffer (which the caller needs to free()). */\r\nWCHAR *DisplayModel::GetTextInRegion(int pageNo, RectD region)\r\n{\r\n    RectI *coords;\r\n    const WCHAR *pageText = textCache->GetData(pageNo, nullptr, &coords);\r\n    if (str::IsEmpty(pageText))\r\n        return nullptr;\r\n\r\n    str::Str<WCHAR> result;\r\n    RectI regionI = region.Round();\r\n    for (const WCHAR *src = pageText; *src; src++) {\r\n        if (*src != '\\n') {\r\n            RectI rect = coords[src - pageText];\r\n            RectI isect = regionI.Intersect(rect);\r\n            if (!isect.IsEmpty() && 1.0 * isect.dx * isect.dy / (rect.dx * rect.dy) >= 0.3)\r\n                result.Append(*src);\r\n        }\r\n        else if (result.Count() > 0 && result.Last() != '\\n')\r\n            result.Append(L\"\\r\\n\", 2);\r\n    }\r\n\r\n    return result.StealData();\r\n}\r\n\r\n// returns true if it was necessary to scroll the display (horizontally or vertically)\r\nbool DisplayModel::ShowResultRectToScreen(TextSel *res)\r\n{\r\n    if (!res->len)\r\n        return false;\r\n\r\n    RectI extremes;\r\n    for (int i = 0; i < res->len; i++) {\r\n        RectI rc = CvtToScreen(res->pages[i], res->rects[i].Convert<double>());\r\n        extremes = extremes.Union(rc);\r\n    }\r\n\r\n    // don't scroll if the whole result is already visible\r\n    if (RectI(PointI(), viewPort.Size()).Intersect(extremes) == extremes)\r\n        return false;\r\n\r\n    PageInfo *pageInfo = GetPageInfo(res->pages[0]);\r\n    int sx = 0, sy = 0;\r\n\r\n    // vertically, we try to position the search result between 40%\r\n    // (scrolling up) and 60% (scrolling down) of the screen, so that\r\n    // the search direction remains obvious and we still display some\r\n    // context before and after the found text\r\n    if (extremes.y < viewPort.dy * 2 / 5)\r\n        sy = extremes.y - viewPort.dy * 2 / 5;\r\n    else if (extremes.y + extremes.dy > viewPort.dy * 3 / 5)\r\n        sy = std::min(extremes.y + extremes.dy - viewPort.dy * 3 / 5,\r\n                 extremes.y + extremes.dy / 2 - viewPort.dy * 2 / 5);\r\n\r\n    // horizontally, we try to position the search result at the\r\n    // center of the screen, but don't scroll further than page\r\n    // boundaries, so that as much context as possible remains visible\r\n    if (extremes.x < 0)\r\n        sx = std::max(extremes.x + extremes.dx / 2 - viewPort.dx / 2,\r\n        pageInfo->pageOnScreen.x);\r\n    else if (extremes.x + extremes.dx >= viewPort.dx)\r\n        sx = std::min(extremes.x + extremes.dx / 2 - viewPort.dx / 2,\r\n                 pageInfo->pageOnScreen.x + pageInfo->pageOnScreen.dx - viewPort.dx);\r\n\r\n    if (sx != 0)\r\n        ScrollXBy(sx);\r\n    if (sy != 0)\r\n        ScrollYBy(sy, false);\r\n\r\n    return sx != 0 || sy != 0;\r\n}\r\n\r\nScrollState DisplayModel::GetScrollState()\r\n{\r\n    ScrollState state(FirstVisiblePageNo(), -1, -1);\r\n    if (!ValidPageNo(state.page))\r\n        state.page = CurrentPageNo();\r\n\r\n    PageInfo *pageInfo = GetPageInfo(state.page);\r\n    // Shortcut: don't calculate precise positions, if the\r\n    // page wasn't scrolled right/down at all\r\n    if (!pageInfo || pageInfo->pageOnScreen.x > 0 && pageInfo->pageOnScreen.y > 0)\r\n        return state;\r\n\r\n    RectI screen(PointI(), viewPort.Size());\r\n    RectI pageVis = pageInfo->pageOnScreen.Intersect(screen);\r\n    state.page = GetPageNextToPoint(pageVis.TL());\r\n    PointD ptD = CvtFromScreen(pageVis.TL(), state.page);\r\n\r\n    // Remember to show the margin, if it's currently visible\r\n    if (pageInfo->pageOnScreen.x <= 0)\r\n        state.x = ptD.x;\r\n    if (pageInfo->pageOnScreen.y <= 0)\r\n        state.y = ptD.y;\r\n\r\n    return state;\r\n}\r\n\r\nvoid DisplayModel::SetScrollState(ScrollState state)\r\n{\r\n    // Update the internal metrics first\r\n    GoToPage(state.page, 0);\r\n    // Bail out, if the page wasn't scrolled\r\n    if (state.x < 0 && state.y < 0)\r\n        return;\r\n\r\n    PointD newPtD(std::max(state.x, (double)0), std::max(state.y, (double)0));\r\n    PointI newPt = CvtToScreen(state.page, newPtD);\r\n\r\n    // Also show the margins, if this has been requested\r\n    if (state.x < 0)\r\n        newPt.x = -1;\r\n    else\r\n        newPt.x += viewPort.x;\r\n    if (state.y < 0)\r\n        newPt.y = 0;\r\n    GoToPage(state.page, newPt.y, false, newPt.x);\r\n}\r\n\r\n// don't remember more than \"enough\" history entries (same number as Firefox uses)\r\n#define MAX_NAV_HISTORY_LEN 50\r\n\r\n/* Records the current scroll state for later navigating back to. */\r\nvoid DisplayModel::AddNavPoint()\r\n{\r\n    ScrollState ss = GetScrollState();\r\n    // remove the current and all Forward history entries\r\n    if (navHistoryIx < navHistory.Count())\r\n        navHistory.RemoveAt(navHistoryIx, navHistory.Count() - navHistoryIx);\r\n    // don't add another entry for the exact same position\r\n    if (navHistoryIx > 0 && ss == navHistory.At(navHistoryIx - 1))\r\n        return;\r\n    // make sure that the history doesn't grow overly large\r\n    if (navHistoryIx >= MAX_NAV_HISTORY_LEN) {\r\n        CrashIf(navHistoryIx > MAX_NAV_HISTORY_LEN);\r\n        navHistory.RemoveAt(0, navHistoryIx - MAX_NAV_HISTORY_LEN + 1);\r\n        navHistoryIx = MAX_NAV_HISTORY_LEN - 1;\r\n    }\r\n    // add a new Back history entry\r\n    navHistory.Append(ss);\r\n    navHistoryIx++;\r\n}\r\n\r\nbool DisplayModel::CanNavigate(int dir) const\r\n{\r\n    CrashIf(navHistoryIx > navHistory.Count());\r\n    if (dir < 0)\r\n        return navHistoryIx >= (size_t)-dir;\r\n    return navHistoryIx + dir < navHistory.Count();\r\n}\r\n\r\n/* Navigates |dir| steps forward or backwards. */\r\nvoid DisplayModel::Navigate(int dir)\r\n{\r\n    if (!CanNavigate(dir))\r\n        return;\r\n    // update the current history entry\r\n    ScrollState ss = GetScrollState();\r\n    if (navHistoryIx < navHistory.Count())\r\n        navHistory.At(navHistoryIx) = ss;\r\n    else\r\n        navHistory.Append(ss);\r\n    navHistoryIx += dir;\r\n    SetScrollState(navHistory.At(navHistoryIx));\r\n}\r\n\r\nvoid DisplayModel::CopyNavHistory(DisplayModel& orig)\r\n{\r\n    navHistory = orig.navHistory;\r\n    navHistoryIx = orig.navHistoryIx;\r\n    // remove navigation history entries for all no longer valid pages\r\n    for (size_t i = navHistory.Count(); i > 0; i--) {\r\n        if (!ValidPageNo(navHistory.At(i - 1).page)) {\r\n            navHistory.RemoveAt(i - 1);\r\n            if (i - 1 < navHistoryIx)\r\n                navHistoryIx--;\r\n        }\r\n    }\r\n}\r\n\r\nbool DisplayModel::ShouldCacheRendering(int pageNo)\r\n{\r\n    // recommend caching for all documents which are non-trivial to render\r\n    if (!engine->IsImageCollection())\r\n        return true;\r\n\r\n    // recommend caching large images (mainly photos) as well, as shrinking\r\n    // them for every UI update (WM_PAINT) can cause notable lags, and also\r\n    // for smaller images which are scaled up\r\n    PageInfo *info = GetPageInfo(pageNo);\r\n    return info->page.dx * info->page.dy > 1024 * 1024 ||\r\n           info->pageOnScreen.dx * info->pageOnScreen.dy > 1024 * 1024;\r\n}\r\n\r\nvoid DisplayModel::ScrollToLink(PageDestination *dest)\r\n{\r\n    CrashIf(!dest || dest->GetDestPageNo() <= 0);\r\n\r\n    PointI scroll(-1, 0);\r\n    RectD rect = dest->GetDestRect();\r\n    int pageNo = dest->GetDestPageNo();\r\n\r\n    if (rect.IsEmpty()) {\r\n        // PDF: /XYZ top left\r\n        // scroll to rect.TL()\r\n        PointD scrollD = engine->Transform(rect.TL(), pageNo, zoomReal, rotation);\r\n        scroll = scrollD.ToInt();\r\n\r\n        // default values for the coordinates mean: keep the current position\r\n        if (DEST_USE_DEFAULT == rect.x)\r\n            scroll.x = -1;\r\n        if (DEST_USE_DEFAULT == rect.y) {\r\n            PageInfo *pageInfo = GetPageInfo(CurrentPageNo());\r\n            scroll.y = -(pageInfo->pageOnScreen.y - windowMargin.top);\r\n        }\r\n    }\r\n    else if (rect.dx != DEST_USE_DEFAULT && rect.dy != DEST_USE_DEFAULT) {\r\n        // PDF: /FitR left bottom right top\r\n        RectD rectD = engine->Transform(rect, pageNo, zoomReal, rotation);\r\n        scroll = rectD.TL().ToInt();\r\n\r\n        // Rect<float> rectF = _engine->Transform(rect, pageNo, 1.0, rotation).Convert<float>();\r\n        // zoom = 100.0f * std::min(viewPort.dx / rectF.dx, viewPort.dy / rectF.dy);\r\n    }\r\n    else if (rect.y != DEST_USE_DEFAULT) {\r\n        // PDF: /FitH top  or  /FitBH top\r\n        PointD scrollD = engine->Transform(rect.TL(), pageNo, zoomReal, rotation);\r\n        scroll.y = scrollD.ToInt().y;\r\n\r\n        // zoom = FitBH ? ZOOM_FIT_CONTENT : ZOOM_FIT_WIDTH\r\n    }\r\n    // else if (Fit || FitV) zoom = ZOOM_FIT_PAGE\r\n    // else if (FitB || FitBV) zoom = ZOOM_FIT_CONTENT\r\n    /* // ignore author-set zoom settings (at least as long as there's no way to overrule them)\r\n    if (zoom != INVALID_ZOOM) {\r\n        // TODO: adjust the zoom level before calculating the scrolling coordinates\r\n        SetZoomVirtual(zoom);\r\n        UpdateToolbarState(owner);\r\n    }\r\n    // */\r\n    // TODO: prevent scroll.y from getting too large?\r\n    if (scroll.y < 0)\r\n        scroll.y = 0; // Adobe Reader never shows the previous page\r\n    GoToPage(pageNo, scroll.y, true, scroll.x);\r\n}\r\n"
  },
  {
    "path": "src/DisplayModel.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: GPLv3 */\n\n// define the following if you want shadows drawn around the pages\n// #define DRAW_PAGE_SHADOWS\n\n#define INVALID_PAGE_NO     -1\n\n/* Describes many attributes of one page in one, convenient place */\nstruct PageInfo {\n    /* data that is constant for a given page. page size in document units */\n    RectD           page;\n\n    /* data that is calculated when needed. actual content size within a page (View target) */\n    RectD           contentBox;\n\n    /* data that needs to be set before DisplayModel::Relayout().\n       Determines whether a given page should be shown on the screen. */\n    bool            shown;\n\n    /* data that changes when zoom and rotation changes */\n    /* position and size within total area after applying zoom and rotation.\n       Represents display rectangle for a given page.\n       Calculated in DisplayModel::Relayout() */\n    RectI           pos;\n\n    /* data that changes due to scrolling. Calculated in DisplayModel::RecalcVisibleParts() */\n    float           visibleRatio; /* (0.0 = invisible, 1.0 = fully visible) */\n    /* position of page relative to visible view port: pos.Offset(-viewPort.x, -viewPort.y) */\n    RectI           pageOnScreen;\n};\n\n/* The current scroll state (needed for saving/restoring the scroll position) */\n/* coordinates are in user space units (per page) */\nstruct ScrollState {\n    explicit ScrollState(int page=0, double x=0, double y=0) : page(page), x(x), y(y) { }\n    bool operator==(const ScrollState& other) const {\n        return page == other.page && x == other.x && y == other.y;\n    }\n\n    int page;\n    double x, y;\n};\n\nclass PageTextCache;\nclass TextSelection;\nclass TextSearch;\nstruct TextSel;\nclass Synchronizer;\n\n// TODO: in hindsight, zoomVirtual is not a good name since it's either\n// virtual zoom level OR physical zoom level. Would be good to find\n// better naming scheme (call it zoomLevel?)\n\n/* Information needed to drive the display of a given document on a screen.\n   You can think of it as a model in the MVC pardigm.\n   All the display changes should be done through changing this model via\n   API and re-displaying things based on new display information */\nclass DisplayModel : public Controller\n{\npublic:\n    DisplayModel(BaseEngine *engine, EngineType type, ControllerCallback *cb);\n    ~DisplayModel();\n\n    // meta data\n    virtual const WCHAR *FilePath() const { return engine->FileName(); }\n    virtual const WCHAR *DefaultFileExt() const { return engine->GetDefaultFileExt(); }\n    virtual int PageCount() const { return engine->PageCount(); }\n    virtual WCHAR *GetProperty(DocumentProperty prop) { return engine->GetProperty(prop); }\n\n    // page navigation (stateful)\n    virtual int CurrentPageNo() const;\n    virtual void GoToPage(int pageNo, bool addNavPoint) { GoToPage(pageNo, 0, addNavPoint); }\n    virtual bool CanNavigate(int dir) const;\n    virtual void Navigate(int dir);\n\n    // view settings\n    virtual void SetDisplayMode(DisplayMode mode, bool keepContinuous=false);\n    virtual DisplayMode GetDisplayMode() const { return displayMode; }\n    virtual void SetPresentationMode(bool enable);\n    virtual void SetZoomVirtual(float zoom, PointI *fixPt=nullptr);\n    virtual float GetZoomVirtual(bool absolute=false) const;\n    virtual float GetNextZoomStep(float towards) const;\n    virtual void SetViewPortSize(SizeI size);\n\n    // table of contents\n    virtual bool HasTocTree() const { return engine->HasTocTree(); }\n    virtual DocTocItem *GetTocTree() { return engine->GetTocTree(); }\n    virtual void ScrollToLink(PageDestination *dest);\n    virtual PageDestination *GetNamedDest(const WCHAR *name) { return engine->GetNamedDest(name); }\n\n    // state export\n    virtual void UpdateDisplayState(DisplayState *ds);\n    // asynchronously calls saveThumbnail (fails silently)\n    virtual void CreateThumbnail(SizeI size, const std::function<void(RenderedBitmap*)> &saveThumbnail) {\n        cb->RenderThumbnail(this, size, saveThumbnail);\n    }\n\n    // page labels (optional)\n    virtual bool HasPageLabels() const { return engine->HasPageLabels(); }\n    virtual WCHAR *GetPageLabel(int pageNo) const { return engine->GetPageLabel(pageNo); }\n    virtual int GetPageByLabel(const WCHAR *label) const { return engine->GetPageByLabel(label); }\n\n    // common shortcuts\n    virtual bool ValidPageNo(int pageNo) const { return 1 <= pageNo && pageNo <= engine->PageCount(); }\n    virtual bool GoToNextPage();\n    virtual bool GoToPrevPage(bool toBottom=false) { return GoToPrevPage(toBottom ? -1 : 0); }\n    virtual bool GoToFirstPage();\n    virtual bool GoToLastPage();\n\n    // for quick type determination and type-safe casting\n    virtual DisplayModel *AsFixed() { return this; }\n\npublic:\n    // the following is specific to DisplayModel\n\n    BaseEngine *GetEngine() const { return engine; }\n\n    // controller-specific data (easier to save here than on WindowInfo)\n    EngineType      engineType;\n    Vec<PageAnnotation> *userAnnots;\n    bool            userAnnotsModified;\n    Synchronizer *  pdfSync;\n\n    PageTextCache * textCache;\n    TextSelection * textSelection;\n    // access only from Search thread\n    TextSearch *    textSearch;\n\n    PageInfo *      GetPageInfo(int pageNo) const;\n\n    /* current rotation selected by user */\n    int             GetRotation() const { return rotation; }\n    // Note: zoomReal contains dpiFactor premultiplied\n    float           GetZoomReal() const { return zoomReal; }\n    float           GetZoomReal(int pageNo) const;\n    void            Relayout(float zoomVirtual, int rotation);\n\n    RectI           GetViewPort() const { return viewPort; }\n    bool            NeedHScroll() const { return viewPort.dy < totalViewPortSize.dy; }\n    bool            NeedVScroll() const { return viewPort.dx < totalViewPortSize.dx; }\n    SizeI           GetCanvasSize() const { return canvasSize; }\n\n    bool            PageShown(int pageNo) const;\n    bool            PageVisible(int pageNo) const;\n    bool            PageVisibleNearby(int pageNo) const;\n    int             FirstVisiblePageNo() const;\n    bool            FirstBookPageVisible() const;\n    bool            LastBookPageVisible() const;\n\n    void            ScrollXTo(int xOff);\n    void            ScrollXBy(int dx);\n    void            ScrollYTo(int yOff);\n    void            ScrollYBy(int dy, bool changePage);\n    /* a \"virtual\" zoom level. Can be either a real zoom level in percent\n       (i.e. 100.0 is original size) or one of virtual values ZOOM_FIT_PAGE,\n       ZOOM_FIT_WIDTH or ZOOM_FIT_CONTENT, whose real value depends on draw area size */\n    void            RotateBy(int rotation);\n\n    WCHAR *         GetTextInRegion(int pageNo, RectD region);\n    bool            IsOverText(PointI pt);\n    PageElement *   GetElementAtPos(PointI pt);\n\n    int             GetPageNoByPoint(PointI pt);\n    PointI          CvtToScreen(int pageNo, PointD pt);\n    RectI           CvtToScreen(int pageNo, RectD r);\n    PointD          CvtFromScreen(PointI pt, int pageNo=INVALID_PAGE_NO);\n    RectD           CvtFromScreen(RectI r, int pageNo=INVALID_PAGE_NO);\n\n    bool            ShowResultRectToScreen(TextSel *res);\n\n    ScrollState     GetScrollState();\n    void            SetScrollState(ScrollState state);\n\n    void            CopyNavHistory(DisplayModel& orig);\n\n    void            SetInitialViewSettings(DisplayMode displayMode, int newStartPage, SizeI viewPort, int screenDPI);\n    void            SetDisplayR2L(bool r2l) { displayR2L = r2l; }\n    bool            GetDisplayR2L() const { return displayR2L; }\n\n    bool            ShouldCacheRendering(int pageNo);\n    // called when we decide that the display needs to be redrawn\n    void            RepaintDisplay() { cb->Repaint(); }\n\n    /* allow resizing a window without triggering a new rendering (needed for window destruction) */\n    bool            dontRenderFlag;\n\n    bool            GetPresentationMode() const { return presentationMode; }\n\nprotected:\n\n    void            BuildPagesInfo();\n    float           ZoomRealFromVirtualForPage(float zoomVirtual, int pageNo) const;\n    SizeD           PageSizeAfterRotation(int pageNo, bool fitToContent=false) const;\n    void            ChangeStartPage(int startPage);\n    PointI          GetContentStart(int pageNo);\n    void            RecalcVisibleParts();\n    void            RenderVisibleParts();\n    void            AddNavPoint();\n    RectD           GetContentBox(int pageNo, RenderTarget target=Target_View);\n    void            CalcZoomVirtual(float zoomVirtual);\n    void            GoToPage(int pageNo, int scrollY, bool addNavPt=false, int scrollX=-1);\n    bool            GoToPrevPage(int scrollY);\n    int             GetPageNextToPoint(PointI pt);\n\n    BaseEngine *    engine;\n\n    /* an array of PageInfo, len of array is pageCount */\n    PageInfo *      pagesInfo;\n\n    DisplayMode     displayMode;\n    /* In non-continuous mode is the first page from a file that we're\n       displaying.\n       No meaning in continous mode. */\n    int             startPage;\n\n    /* size of virtual canvas containing all rendered pages. */\n    SizeI           canvasSize;\n    /* size and position of the viewport on the canvas (resp size of the visible\n       part of the canvase available for content (totalViewPortSize minus scroll bars)\n       (canvasSize is always at least as big as viewPort.Size()) */\n    RectI           viewPort;\n    /* total size of view port (draw area), including scroll bars */\n    SizeI           totalViewPortSize;\n\n    WindowMargin    windowMargin;\n    SizeI           pageSpacing;\n\n    /* real zoom value calculated from zoomVirtual. Same as\n       zoomVirtual * 0.01 * dpiFactor\n       except for ZOOM_FIT_PAGE, ZOOM_FIT_WIDTH and ZOOM_FIT_CONTENT */\n    float           zoomReal;\n    float           zoomVirtual;\n    int             rotation;\n    /* dpi correction factor by which _zoomVirtual has to be multiplied in\n       order to get _zoomReal */\n    float           dpiFactor;\n    /* whether to display pages Left-to-Right or Right-to-Left.\n       this value is extracted from the PDF document */\n    bool            displayR2L;\n\n    /* when we're in presentation mode, _pres* contains the pre-presentation values */\n    bool            presentationMode;\n    float           presZoomVirtual;\n    DisplayMode     presDisplayMode;\n\n    Vec<ScrollState>navHistory;\n    /* index of the \"current\" history entry (to be updated on navigation),\n       resp. number of Back history entries */\n    size_t          navHistoryIx;\n};\n\nint     NormalizeRotation(int rotation);\n"
  },
  {
    "path": "src/DjVuEngine.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// hack to prevent libdjvu from being built as an export/import library\r\n#define DDJVUAPI /**/\r\n#define MINILISPAPI /**/\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include <ddjvuapi.h>\r\n#include <miniexp.h>\r\n#include \"ByteReader.h\"\r\n#include \"FileUtil.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"DjVuEngine.h\"\r\n\r\n// TODO: libdjvu leaks memory - among others\r\n//       DjVuPort::corpse_lock, DjVuPort::corpse_head, pcaster,\r\n//       DataPool::OpenFiles::global_ptr, FCPools::global_ptr\r\n//       cf. http://sourceforge.net/projects/djvu/forums/forum/103286/topic/3553602\r\n\r\nclass DjVuDestination : public PageDestination {\r\n    // the link format can be any of\r\n    //   #[ ]<pageNo>      e.g. #1 for FirstPage and # 13 for page 13\r\n    //   #[+-]<pageCount>  e.g. #+1 for NextPage and #-1 for PrevPage\r\n    //   #filename.djvu    use ResolveNamedDest to get a link in #<pageNo> format\r\n    //   http://example.net/#hyperlink\r\n    ScopedMem<char> link;\r\n\r\n    bool IsPageLink(const char *link) const {\r\n        return link && link[0] == '#' && (str::IsDigit(link[1]) || link[1] == ' ' && str::IsDigit(link[2]));\r\n    }\r\n\r\npublic:\r\n    explicit DjVuDestination(const char *link) : link(str::Dup(link)) { }\r\n\r\n    PageDestType GetDestType() const override {\r\n        if (IsPageLink(link))\r\n            return Dest_ScrollTo;\r\n        if (str::Eq(link, \"#+1\"))\r\n            return Dest_NextPage;\r\n        if (str::Eq(link, \"#-1\"))\r\n            return Dest_PrevPage;\r\n        if (str::StartsWithI(link, \"http:\") || str::StartsWithI(link, \"https:\") || str::StartsWithI(link, \"mailto:\"))\r\n            return Dest_LaunchURL;\r\n        return Dest_None;\r\n    }\r\n    int GetDestPageNo() const override {\r\n        if (IsPageLink(link))\r\n            return atoi(link + 1);\r\n        return 0;\r\n    }\r\n    RectD GetDestRect() const override {\r\n        return RectD(DEST_USE_DEFAULT, DEST_USE_DEFAULT, DEST_USE_DEFAULT, DEST_USE_DEFAULT);\r\n    }\r\n    WCHAR *GetDestValue() const override {\r\n        if (Dest_LaunchURL == GetDestType())\r\n            return str::conv::FromUtf8(link);\r\n        return nullptr;\r\n    }\r\n};\r\n\r\nclass DjVuLink : public PageElement {\r\n    DjVuDestination *dest;\r\n    int pageNo;\r\n    RectD rect;\r\n    WCHAR *value;\r\n\r\npublic:\r\n    DjVuLink(int pageNo, RectI rect, const char *link, const char *comment) :\r\n        pageNo(pageNo), rect(rect.Convert<double>()), value(nullptr) {\r\n        dest = new DjVuDestination(link);\r\n        if (!str::IsEmpty(comment))\r\n            value = str::conv::FromUtf8(comment);\r\n    }\r\n    ~DjVuLink()  override {\r\n        delete dest;\r\n        free(value);\r\n    }\r\n\r\n    PageElementType GetType() const  override { return Element_Link; }\r\n    int GetPageNo() const  override { return pageNo; }\r\n    RectD GetRect() const override { return rect; }\r\n    WCHAR *GetValue() const override {\r\n        if (value)\r\n            return str::Dup(value);\r\n        if (Dest_LaunchURL == dest->GetDestType())\r\n            return dest->GetDestValue();\r\n        return nullptr;\r\n    }\r\n\r\n    virtual PageDestination *AsLink() { return dest; }\r\n};\r\n\r\nclass DjVuTocItem : public DocTocItem {\r\n    DjVuDestination *dest;\r\n\r\npublic:\r\n    DjVuTocItem(const char *title, const char *link) :\r\n        DocTocItem(str::conv::FromUtf8(title)) {\r\n        dest = new DjVuDestination(link);\r\n        pageNo = dest->GetDestPageNo();\r\n    }\r\n    virtual ~DjVuTocItem() { delete dest; }\r\n\r\n    virtual PageDestination *GetLink() { return dest; }\r\n};\r\n\r\nclass DjVuContext {\r\n    bool initialized;\r\n    ddjvu_context_t *ctx;\r\n\r\npublic:\r\n    CRITICAL_SECTION lock;\r\n\r\n    DjVuContext() : ctx(nullptr), initialized(false) { }\r\n    ~DjVuContext() {\r\n        if (initialized) {\r\n            EnterCriticalSection(&lock);\r\n            if (ctx)\r\n                ddjvu_context_release(ctx);\r\n            LeaveCriticalSection(&lock);\r\n            DeleteCriticalSection(&lock);\r\n        }\r\n        minilisp_finish();\r\n    }\r\n\r\n    bool Initialize() {\r\n        if (!initialized) {\r\n            initialized = true;\r\n            InitializeCriticalSection(&lock);\r\n            ctx = ddjvu_context_create(\"DjVuEngine\");\r\n            // reset the locale to \"C\" as most other code expects\r\n            setlocale(LC_ALL, \"C\");\r\n        }\r\n\r\n        return ctx != nullptr;\r\n    }\r\n\r\n    void SpinMessageLoop(bool wait=true) {\r\n        UNUSED(wait);\r\n        const ddjvu_message_t *msg;\r\n#if THREADMODEL!=NOTHREADS\r\n        if (wait)\r\n            ddjvu_message_wait(ctx);\r\n#endif\r\n        while ((msg = ddjvu_message_peek(ctx)) != nullptr) {\r\n            if (DDJVU_NEWSTREAM == msg->m_any.tag && msg->m_newstream.streamid != 0)\r\n                ddjvu_stream_close(msg->m_any.document, msg->m_newstream.streamid, /* stop */ FALSE);\r\n            ddjvu_message_pop(ctx);\r\n        }\r\n    }\r\n\r\n    ddjvu_document_t *OpenFile(const WCHAR *fileName) {\r\n        ScopedCritSec scope(&lock);\r\n        ScopedMem<char> fileNameUtf8(str::conv::ToUtf8(fileName));\r\n        // TODO: libdjvu sooner or later crashes inside its caching code; cf.\r\n        //       http://code.google.com/p/sumatrapdf/issues/detail?id=1434\r\n        return ddjvu_document_create_by_filename_utf8(ctx, fileNameUtf8, /* cache */ FALSE);\r\n    }\r\n\r\n    ddjvu_document_t *OpenStream(IStream *stream) {\r\n        ScopedCritSec scope(&lock);\r\n        size_t datalen;\r\n        ScopedMem<char> data((char *)GetDataFromStream(stream, &datalen));\r\n        if (!data || datalen > ULONG_MAX)\r\n            return nullptr;\r\n        return ddjvu_document_create_by_data(ctx, data, (ULONG)datalen);\r\n    }\r\n};\r\n\r\nstatic DjVuContext gDjVuContext;\r\n\r\nclass DjVuEngineImpl : public BaseEngine {\r\npublic:\r\n    DjVuEngineImpl();\r\n    virtual ~DjVuEngineImpl();\r\n    BaseEngine *Clone() override {\r\n        if (stream)\r\n            return CreateFromStream(stream);\r\n        return fileName ? CreateFromFile(fileName) : nullptr;\r\n    }\r\n\r\n    const WCHAR *FileName() const override { return fileName; };\r\n    int PageCount() const override { return pageCount; }\r\n\r\n    RectD PageMediabox(int pageNo) override {\r\n        assert(1 <= pageNo && pageNo <= PageCount());\r\n        return mediaboxes[pageNo-1];\r\n    }\r\n    RectD PageContentBox(int pageNo, RenderTarget target=Target_View) override;\r\n\r\n    RenderedBitmap *RenderBitmap(int pageNo, float zoom, int rotation,\r\n                         RectD *pageRect=nullptr, /* if nullptr: defaults to the page's mediabox */\r\n                         RenderTarget target=Target_View, AbortCookie **cookie_out=nullptr) override;\r\n\r\n    PointD Transform(PointD pt, int pageNo, float zoom, int rotation, bool inverse=false) override;\r\n    RectD Transform(RectD rect, int pageNo, float zoom, int rotation, bool inverse=false) override;\r\n\r\n    unsigned char *GetFileData(size_t *cbCount) override;\r\n    bool SaveFileAs(const WCHAR *copyFileName, bool includeUserAnnots=false) override;\r\n    WCHAR * ExtractPageText(int pageNo, const WCHAR *lineSep, RectI **coordsOut=nullptr,\r\n                                    RenderTarget target=Target_View) override;\r\n    bool HasClipOptimizations(int pageNo) override { UNUSED(pageNo);  return false; }\r\n    PageLayoutType PreferredLayout() override { return Layout_Single; }\r\n\r\n    WCHAR *GetProperty(DocumentProperty prop) override { UNUSED(prop);  return nullptr; }\r\n\r\n    bool SupportsAnnotation(bool forSaving=false) const override { return !forSaving; }\r\n    void UpdateUserAnnotations(Vec<PageAnnotation> *list) override;\r\n\r\n    // DPI isn't constant for all pages and thus premultiplied\r\n    float GetFileDPI() const override { return 300.0f; }\r\n    const WCHAR *GetDefaultFileExt() const override { return L\".djvu\"; }\r\n\r\n    // we currently don't load pages lazily, so there's nothing to do here\r\n    bool BenchLoadPage(int pageNo) override { UNUSED(pageNo); return true; }\r\n\r\n    Vec<PageElement *> *GetElements(int pageNo) override;\r\n    PageElement *GetElementAtPos(int pageNo, PointD pt) override;\r\n\r\n    PageDestination *GetNamedDest(const WCHAR *name) override;\r\n    bool HasTocTree() const override { return outline != miniexp_nil; }\r\n    DocTocItem *GetTocTree() override;\r\n\r\n    bool HasPageLabels() const override { return hasPageLabels; }\r\n    WCHAR *GetPageLabel(int pageNo) const override;\r\n    int GetPageByLabel(const WCHAR *label) const override;\r\n\r\n    static BaseEngine *CreateFromFile(const WCHAR *fileName);\r\n    static BaseEngine *CreateFromStream(IStream *stream);\r\n\r\nprotected:\r\n    WCHAR *fileName;\r\n    IStream *stream;\r\n\r\n    int pageCount;\r\n    RectD *mediaboxes;\r\n\r\n    ddjvu_document_t *doc;\r\n    miniexp_t outline;\r\n    miniexp_t *annos;\r\n    Vec<PageAnnotation> userAnnots;\r\n    bool hasPageLabels;\r\n\r\n    Vec<ddjvu_fileinfo_t> fileInfo;\r\n\r\n    RenderedBitmap *CreateRenderedBitmap(const char *bmpData, SizeI size, bool grayscale) const;\r\n    void AddUserAnnots(RenderedBitmap *bmp, int pageNo, float zoom, int rotation, RectI screen);\r\n    bool ExtractPageText(miniexp_t item, const WCHAR *lineSep,\r\n                         str::Str<WCHAR>& extracted, Vec<RectI>& coords);\r\n    char *ResolveNamedDest(const char *name);\r\n    DjVuTocItem *BuildTocTree(miniexp_t entry, int& idCounter);\r\n    bool Load(const WCHAR *fileName);\r\n    bool Load(IStream *stream);\r\n    bool FinishLoading();\r\n    bool LoadMediaboxes();\r\n};\r\n\r\nDjVuEngineImpl::DjVuEngineImpl() : fileName(nullptr), stream(nullptr),\r\n    pageCount(0), mediaboxes(nullptr), doc(nullptr),\r\n    outline(miniexp_nil), annos(nullptr), hasPageLabels(false)\r\n{\r\n}\r\n\r\nDjVuEngineImpl::~DjVuEngineImpl()\r\n{\r\n    ScopedCritSec scope(&gDjVuContext.lock);\r\n\r\n    free(mediaboxes);\r\n    free(fileName);\r\n\r\n    if (annos) {\r\n        for (int i = 0; i < pageCount; i++) {\r\n            if (annos[i])\r\n                ddjvu_miniexp_release(doc, annos[i]);\r\n        }\r\n        free(annos);\r\n    }\r\n    if (outline != miniexp_nil)\r\n        ddjvu_miniexp_release(doc, outline);\r\n    if (doc)\r\n        ddjvu_document_release(doc);\r\n    if (stream)\r\n        stream->Release();\r\n}\r\n\r\n// Most functions of the ddjvu API such as ddjvu_document_get_pageinfo\r\n// are quite inefficient when used for all pages of a document in a row,\r\n// so try to either only use them when actually needed or replace them\r\n// with a function that extracts all the data at once:\r\n\r\nstatic bool ReadBytes(HANDLE h, DWORD offset, void *buffer, DWORD count)\r\n{\r\n    DWORD res = SetFilePointer(h, offset, nullptr, FILE_BEGIN);\r\n    if (res != offset)\r\n        return false;\r\n    bool ok = ReadFile(h, buffer, count, &res, nullptr);\r\n    return ok && res == count;\r\n}\r\n\r\n#define DJVU_MARK_MAGIC 0x41542654L /* AT&T */\r\n#define DJVU_MARK_FORM  0x464F524DL /* FORM */\r\n#define DJVU_MARK_DJVM  0x444A564DL /* DJVM */\r\n#define DJVU_MARK_DJVU  0x444A5655L /* DJVU */\r\n#define DJVU_MARK_INFO  0x494E464FL /* INFO */\r\n\r\n#include <pshpack1.h>\r\n\r\nstruct DjVuInfoChunk {\r\n    WORD width, height;\r\n    BYTE minor, major;\r\n    BYTE dpiLo, dpiHi;\r\n    BYTE gamma, flags;\r\n};\r\n\r\n#include <poppack.h>\r\n\r\nstatic_assert(sizeof(DjVuInfoChunk) == 10, \"wrong size of DjVuInfoChunk structure\");\r\n\r\nbool DjVuEngineImpl::LoadMediaboxes()\r\n{\r\n    if (!fileName)\r\n        return false;\r\n    ScopedHandle h(file::OpenReadOnly(fileName));\r\n    if (h == INVALID_HANDLE_VALUE)\r\n        return false;\r\n    char buffer[16];\r\n    ByteReader r(buffer, sizeof(buffer));\r\n    if (!ReadBytes(h, 0, buffer, 16) || r.DWordBE(0) != DJVU_MARK_MAGIC || r.DWordBE(4) != DJVU_MARK_FORM)\r\n        return false;\r\n\r\n    DWORD offset = r.DWordBE(12) == DJVU_MARK_DJVM ? 16 : 4;\r\n    for (int pages = 0; pages < pageCount; ) {\r\n        if (!ReadBytes(h, offset, buffer, 16))\r\n            return false;\r\n        int partLen = r.DWordBE(4);\r\n        if (partLen < 0)\r\n            return false;\r\n        if (r.DWordBE(0) == DJVU_MARK_FORM && r.DWordBE(8) == DJVU_MARK_DJVU &&\r\n            r.DWordBE(12) == DJVU_MARK_INFO) {\r\n            if (!ReadBytes(h, offset + 16, buffer, 14))\r\n                return false;\r\n            DjVuInfoChunk info;\r\n            bool ok = r.UnpackBE(&info, sizeof(info), \"2w6b\", 4);\r\n            CrashIf(!ok);\r\n            int dpi = MAKEWORD(info.dpiLo, info.dpiHi); // dpi is little-endian\r\n            // DjVuLibre ignores DPI values outside 25 to 6000 in DjVuInfo::decode\r\n            if (dpi < 25 || 6000 < dpi)\r\n                dpi = 300;\r\n            mediaboxes[pages].dx = GetFileDPI() * info.width / dpi;\r\n            mediaboxes[pages].dy = GetFileDPI() * info.height / dpi;\r\n            if ((info.flags & 4))\r\n                std::swap(mediaboxes[pages].dx, mediaboxes[pages].dy);\r\n            pages++;\r\n        }\r\n        offset += 8 + partLen + (partLen & 1);\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nbool DjVuEngineImpl::Load(const WCHAR *fileName)\r\n{\r\n    if (!gDjVuContext.Initialize())\r\n        return false;\r\n\r\n    this->fileName = str::Dup(fileName);\r\n    doc = gDjVuContext.OpenFile(fileName);\r\n\r\n    return FinishLoading();\r\n}\r\n\r\nbool DjVuEngineImpl::Load(IStream *stream)\r\n{\r\n    if (!gDjVuContext.Initialize())\r\n        return false;\r\n\r\n    doc = gDjVuContext.OpenStream(stream);\r\n\r\n    return FinishLoading();\r\n}\r\n\r\nbool DjVuEngineImpl::FinishLoading()\r\n{\r\n    if (!doc)\r\n        return false;\r\n\r\n    ScopedCritSec scope(&gDjVuContext.lock);\r\n\r\n    while (!ddjvu_document_decoding_done(doc))\r\n        gDjVuContext.SpinMessageLoop();\r\n    if (ddjvu_document_decoding_error(doc))\r\n        return false;\r\n\r\n    pageCount = ddjvu_document_get_pagenum(doc);\r\n    if (0 == pageCount)\r\n        return false;\r\n\r\n    mediaboxes = AllocArray<RectD>(pageCount);\r\n    bool ok = LoadMediaboxes();\r\n    if (!ok) {\r\n        // fall back to the slower but safer way to extract page mediaboxes\r\n        for (int i = 0; i < pageCount; i++) {\r\n            ddjvu_status_t status;\r\n            ddjvu_pageinfo_t info;\r\n            while ((status = ddjvu_document_get_pageinfo(doc, i, &info)) < DDJVU_JOB_OK)\r\n                gDjVuContext.SpinMessageLoop();\r\n            if (DDJVU_JOB_OK == status)\r\n                mediaboxes[i] = RectD(0, 0, info.width * GetFileDPI() / info.dpi,\r\n                                            info.height * GetFileDPI() / info.dpi);\r\n        }\r\n    }\r\n\r\n    annos = AllocArray<miniexp_t>(pageCount);\r\n    for (int i = 0; i < pageCount; i++)\r\n        annos[i] = miniexp_dummy;\r\n\r\n    while ((outline = ddjvu_document_get_outline(doc)) == miniexp_dummy)\r\n        gDjVuContext.SpinMessageLoop();\r\n    if (!miniexp_consp(outline) || miniexp_car(outline) != miniexp_symbol(\"bookmarks\")) {\r\n        ddjvu_miniexp_release(doc, outline);\r\n        outline = miniexp_nil;\r\n    }\r\n\r\n    int fileCount = ddjvu_document_get_filenum(doc);\r\n    for (int i = 0; i < fileCount; i++) {\r\n        ddjvu_status_t status;\r\n        ddjvu_fileinfo_s info;\r\n        while ((status = ddjvu_document_get_fileinfo(doc, i, &info)) < DDJVU_JOB_OK)\r\n            gDjVuContext.SpinMessageLoop();\r\n        if (DDJVU_JOB_OK == status && info.type == 'P' && info.pageno >= 0) {\r\n            fileInfo.Append(info);\r\n            hasPageLabels = hasPageLabels || !str::Eq(info.title, info.id);\r\n        }\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\n// TODO: use AdjustLightness instead to compensate for the alpha?\r\nstatic Gdiplus::Color Unblend(PageAnnotation::Color c, BYTE alpha)\r\n{\r\n    alpha = (BYTE)(alpha * c.a / 255.f);\r\n    BYTE R = (BYTE)floorf(std::max(c.r - (255 - alpha), 0) * 255.0f / alpha + 0.5f);\r\n    BYTE G = (BYTE)floorf(std::max(c.g - (255 - alpha), 0) * 255.0f / alpha + 0.5f);\r\n    BYTE B = (BYTE)floorf(std::max(c.b - (255 - alpha), 0) * 255.0f / alpha + 0.5f);\r\n    return Gdiplus::Color(alpha, R, G, B);\r\n}\r\n\r\nstatic inline Gdiplus::Color FromColor(PageAnnotation::Color c)\r\n{\r\n    return Gdiplus::Color(c.a, c.r, c.g, c.b);\r\n}\r\n\r\nvoid DjVuEngineImpl::AddUserAnnots(RenderedBitmap *bmp, int pageNo, float zoom, int rotation, RectI screen)\r\n{\r\n    using namespace Gdiplus;\r\n\r\n    if (!bmp || userAnnots.Count() == 0)\r\n        return;\r\n\r\n    HDC hdc = CreateCompatibleDC(nullptr);\r\n    {\r\n        ScopedHdcSelect bmpScope(hdc, bmp->GetBitmap());\r\n        Graphics g(hdc);\r\n        g.SetCompositingQuality(CompositingQualityHighQuality);\r\n        g.SetPageUnit(UnitPixel);\r\n\r\n        for (size_t i = 0; i < userAnnots.Count(); i++) {\r\n            PageAnnotation& annot = userAnnots.At(i);\r\n            if (annot.pageNo != pageNo)\r\n                continue;\r\n            RectD arect;\r\n            switch (annot.type) {\r\n            case Annot_Highlight:\r\n                arect = Transform(annot.rect, pageNo, zoom, rotation);\r\n                arect.Offset(-screen.x, -screen.y);\r\n                {\r\n                SolidBrush tmpBrush(Unblend(annot.color, 119));\r\n                g.FillRectangle(&tmpBrush, arect.ToGdipRectF());\r\n                }\r\n                break;\r\n            case Annot_Underline:\r\n            case Annot_StrikeOut:\r\n                arect = RectD(annot.rect.x, annot.rect.BR().y, annot.rect.dx, 0);\r\n                if (Annot_StrikeOut == annot.type)\r\n                    arect.y -= annot.rect.dy / 2;\r\n                arect = Transform(arect, pageNo, zoom, rotation);\r\n                arect.Offset(-screen.x, -screen.y);\r\n                {\r\n                Pen tmpPen(FromColor(annot.color), zoom);\r\n                g.DrawLine(&tmpPen, (float)arect.x,\r\n                           (float)arect.y, (float)arect.BR().x, (float)arect.BR().y);\r\n                }\r\n                break;\r\n            case Annot_Squiggly:\r\n                {\r\n                    Pen p(FromColor(annot.color), 0.5f * zoom);\r\n                    REAL dash[2] = { 2, 2 };\r\n                    p.SetDashPattern(dash, dimof(dash));\r\n                    p.SetDashOffset(1);\r\n                    arect = Transform(RectD(annot.rect.x, annot.rect.BR().y - 0.25f, annot.rect.dx, 0), pageNo, zoom, rotation);\r\n                    arect.Offset(-screen.x, -screen.y);\r\n                    g.DrawLine(&p, (float)arect.x, (float)arect.y, (float)arect.BR().x, (float)arect.BR().y);\r\n                    p.SetDashOffset(3);\r\n                    arect = Transform(RectD(annot.rect.x, annot.rect.BR().y + 0.25f, annot.rect.dx, 0), pageNo, zoom, rotation);\r\n                    arect.Offset(-screen.x, -screen.y);\r\n                    g.DrawLine(&p, (float)arect.x, (float)arect.y, (float)arect.BR().x, (float)arect.BR().y);\r\n                }\r\n                break;\r\n            }\r\n        }\r\n    }\r\n    DeleteDC(hdc);\r\n}\r\n\r\nRenderedBitmap *DjVuEngineImpl::CreateRenderedBitmap(const char *bmpData, SizeI size, bool grayscale) const\r\n{\r\n    int stride = ((size.dx * (grayscale ? 1 : 3) + 3) / 4) * 4;\r\n\r\n    BITMAPINFO *bmi = (BITMAPINFO *)calloc(1, sizeof(BITMAPINFOHEADER) + (grayscale ? 256 * sizeof(RGBQUAD) : 0));\r\n    if (!bmi)\r\n        return nullptr;\r\n\r\n    if (grayscale) {\r\n        for (int i = 0; i < 256; i++) {\r\n            bmi->bmiColors[i].rgbRed = bmi->bmiColors[i].rgbGreen = bmi->bmiColors[i].rgbBlue = (BYTE)i;\r\n        }\r\n    }\r\n\r\n    bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);\r\n    bmi->bmiHeader.biWidth = size.dx;\r\n    bmi->bmiHeader.biHeight = -size.dy;\r\n    bmi->bmiHeader.biPlanes = 1;\r\n    bmi->bmiHeader.biCompression = BI_RGB;\r\n    bmi->bmiHeader.biBitCount = grayscale ? 8 : 24;\r\n    bmi->bmiHeader.biSizeImage = size.dy * stride;\r\n    bmi->bmiHeader.biClrUsed = grayscale ? 256 : 0;\r\n\r\n    void *data = nullptr;\r\n    HANDLE hMap = CreateFileMapping(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0, bmi->bmiHeader.biSizeImage, nullptr);\r\n    HBITMAP hbmp = CreateDIBSection(nullptr, bmi, DIB_RGB_COLORS, &data, hMap, 0);\r\n    if (hbmp)\r\n        memcpy(data, bmpData, bmi->bmiHeader.biSizeImage);\r\n\r\n    free(bmi);\r\n\r\n    return new RenderedBitmap(hbmp, size, hMap);\r\n}\r\n\r\nRenderedBitmap *DjVuEngineImpl::RenderBitmap(int pageNo, float zoom, int rotation, RectD *pageRect, RenderTarget target, AbortCookie **cookieOut)\r\n{\r\n    UNUSED(cookieOut); UNUSED(target);\r\n\r\n    ScopedCritSec scope(&gDjVuContext.lock);\r\n\r\n    RectD pageRc = pageRect ? *pageRect : PageMediabox(pageNo);\r\n    RectI screen = Transform(pageRc, pageNo, zoom, rotation).Round();\r\n    RectI full = Transform(PageMediabox(pageNo), pageNo, zoom, rotation).Round();\r\n    screen = full.Intersect(screen);\r\n\r\n    ddjvu_page_t *page = ddjvu_page_create_by_pageno(doc, pageNo-1);\r\n    if (!page)\r\n        return nullptr;\r\n    int rotation4 = (((-rotation / 90) % 4) + 4) % 4;\r\n    ddjvu_page_set_rotation(page, (ddjvu_page_rotation_t)rotation4);\r\n\r\n    while (!ddjvu_page_decoding_done(page))\r\n        gDjVuContext.SpinMessageLoop();\r\n    if (ddjvu_page_decoding_error(page))\r\n        return nullptr;\r\n\r\n    bool isBitonal = DDJVU_PAGETYPE_BITONAL == ddjvu_page_get_type(page);\r\n    ddjvu_format_t *fmt = ddjvu_format_create(isBitonal ? DDJVU_FORMAT_GREY8 : DDJVU_FORMAT_BGR24, 0, nullptr);\r\n    ddjvu_format_set_row_order(fmt, /* top_to_bottom */ TRUE);\r\n    ddjvu_rect_t prect = { full.x, full.y, full.dx, full.dy };\r\n    ddjvu_rect_t rrect = { screen.x, 2 * full.y - screen.y + full.dy - screen.dy, screen.dx, screen.dy };\r\n\r\n    RenderedBitmap *bmp = nullptr;\r\n    int stride = ((screen.dx * (isBitonal ? 1 : 3) + 3) / 4) * 4;\r\n    ScopedMem<char> bmpData(AllocArray<char>(stride * (screen.dy + 5)));\r\n    if (bmpData) {\r\n#ifndef DEBUG\r\n        ddjvu_render_mode_t mode = isBitonal ? DDJVU_RENDER_MASKONLY : DDJVU_RENDER_COLOR;\r\n#else\r\n        // TODO: there seems to be a heap corruption in IW44Image.cpp\r\n        //       in debug builds when passing in DDJVU_RENDER_COLOR\r\n        ddjvu_render_mode_t mode = DDJVU_RENDER_MASKONLY;\r\n#endif\r\n        if (!ddjvu_page_render(page, mode, &prect, &rrect, fmt, stride, bmpData.Get())) {\r\n            // nothing was rendered, leave the page blank (same as WinDjView)\r\n            memset(bmpData, 0xFF, stride * screen.dy);\r\n            isBitonal = true;\r\n        }\r\n        bmp = CreateRenderedBitmap(bmpData, screen.Size(), isBitonal);\r\n        AddUserAnnots(bmp, pageNo, zoom, rotation, screen);\r\n    }\r\n\r\n    ddjvu_format_release(fmt);\r\n    ddjvu_page_release(page);\r\n\r\n    return bmp;\r\n}\r\n\r\nRectD DjVuEngineImpl::PageContentBox(int pageNo, RenderTarget target)\r\n{\r\n    UNUSED(target);\r\n    ScopedCritSec scope(&gDjVuContext.lock);\r\n\r\n    RectD pageRc = PageMediabox(pageNo);\r\n    ddjvu_page_t *page = ddjvu_page_create_by_pageno(doc, pageNo-1);\r\n    if (!page)\r\n        return pageRc;\r\n    ddjvu_page_set_rotation(page, DDJVU_ROTATE_0);\r\n\r\n    while (!ddjvu_page_decoding_done(page))\r\n        gDjVuContext.SpinMessageLoop();\r\n    if (ddjvu_page_decoding_error(page))\r\n        return pageRc;\r\n\r\n    // render the page in 8-bit grayscale up to 250x250 px in size\r\n    ddjvu_format_t *fmt = ddjvu_format_create(DDJVU_FORMAT_GREY8, 0, nullptr);\r\n    ddjvu_format_set_row_order(fmt, /* top_to_bottom */ TRUE);\r\n    double zoom = std::min(std::min(250.0 / pageRc.dx, 250.0 / pageRc.dy), 1.0);\r\n    RectI full = RectD(0, 0, pageRc.dx * zoom, pageRc.dy * zoom).Round();\r\n    ddjvu_rect_t prect = { full.x, full.y, full.dx, full.dy }, rrect = prect;\r\n\r\n    ScopedMem<char> bmpData(AllocArray<char>(full.dx * full.dy + 1));\r\n    if (bmpData && ddjvu_page_render(page, DDJVU_RENDER_MASKONLY, &prect, &rrect, fmt, full.dx, bmpData.Get())) {\r\n        // determine the content box by counting white pixels from the edges\r\n        RectD content(full.dx, -1, 0, 0);\r\n        for (int y = 0; y < full.dy; y++) {\r\n            int x;\r\n            for (x = 0; x < full.dx && bmpData[y * full.dx + x] == '\\xFF'; x++);\r\n            if (x < full.dx) {\r\n                // narrow the left margin down (if necessary)\r\n                if (x < content.x)\r\n                    content.x = x;\r\n                // narrow the right margin down (if necessary)\r\n                for (x = full.dx - 1; x > content.x + content.dx && bmpData[y * full.dx + x] == '\\xFF'; x--);\r\n                if (x > content.x + content.dx)\r\n                    content.dx = x - content.x + 1;\r\n                // narrow either the top or the bottom margin down\r\n                if (content.y == -1)\r\n                    content.y = y;\r\n                else\r\n                    content.dy = y - content.y + 1;\r\n            }\r\n        }\r\n        if (!content.IsEmpty()) {\r\n            // undo the zoom and round generously\r\n            content.x /= zoom; content.dx /= zoom;\r\n            content.y /= zoom; content.dy /= zoom;\r\n            pageRc = content.Round().Convert<double>();\r\n        }\r\n    }\r\n\r\n    ddjvu_format_release(fmt);\r\n    ddjvu_page_release(page);\r\n\r\n    return pageRc;\r\n}\r\n\r\nPointD DjVuEngineImpl::Transform(PointD pt, int pageNo, float zoom, int rotation, bool inverse)\r\n{\r\n    assert(zoom > 0);\r\n    if (zoom <= 0)\r\n        return pt;\r\n\r\n    SizeD page = PageMediabox(pageNo).Size();\r\n\r\n    if (inverse) {\r\n        // transform the page size to get a correct frame of reference\r\n        page.dx *= zoom; page.dy *= zoom;\r\n        if (rotation % 180 != 0)\r\n            std::swap(page.dx, page.dy);\r\n        // invert rotation and zoom\r\n        rotation = -rotation;\r\n        zoom = 1.0f / zoom;\r\n    }\r\n\r\n    PointD res;\r\n    rotation = rotation % 360;\r\n    if (rotation < 0) rotation += 360;\r\n    if (90 == rotation)\r\n        res = PointD(page.dy - pt.y, pt.x);\r\n    else if (180 == rotation)\r\n        res = PointD(page.dx - pt.x, page.dy - pt.y);\r\n    else if (270 == rotation)\r\n        res = PointD(pt.y, page.dx - pt.x);\r\n    else // if (0 == rotation)\r\n        res = pt;\r\n\r\n    res.x *= zoom; res.y *= zoom;\r\n    return res;\r\n}\r\n\r\nRectD DjVuEngineImpl::Transform(RectD rect, int pageNo, float zoom, int rotation, bool inverse)\r\n{\r\n    PointD TL = Transform(rect.TL(), pageNo, zoom, rotation, inverse);\r\n    PointD BR = Transform(rect.BR(), pageNo, zoom, rotation, inverse);\r\n    return RectD::FromXY(TL, BR);\r\n}\r\n\r\nunsigned char *DjVuEngineImpl::GetFileData(size_t *cbCount)\r\n{\r\n    if (stream) {\r\n        ScopedMem<void> data(GetDataFromStream(stream, cbCount));\r\n        if (data)\r\n            return (unsigned char *)data.StealData();\r\n    }\r\n    if (!fileName)\r\n        return nullptr;\r\n    return (unsigned char *)file::ReadAll(fileName, cbCount);\r\n}\r\n\r\nbool DjVuEngineImpl::SaveFileAs(const WCHAR *copyFileName, bool includeUserAnnots)\r\n{\r\n    UNUSED(includeUserAnnots);\r\n    if (stream) {\r\n        size_t len;\r\n        ScopedMem<void> data(GetDataFromStream(stream, &len));\r\n        if (data && file::WriteAll(copyFileName, data, len))\r\n            return true;\r\n    }\r\n    if (!fileName)\r\n        return false;\r\n    return CopyFile(fileName, copyFileName, FALSE);\r\n}\r\n\r\nstatic void AppendNewline(str::Str<WCHAR>& extracted, Vec<RectI>& coords, const WCHAR *lineSep)\r\n{\r\n    if (extracted.Count() > 0 && ' ' == extracted.Last()) {\r\n        extracted.Pop();\r\n        coords.Pop();\r\n    }\r\n    extracted.Append(lineSep);\r\n    coords.AppendBlanks(str::Len(lineSep));\r\n}\r\n\r\nbool DjVuEngineImpl::ExtractPageText(miniexp_t item, const WCHAR *lineSep, str::Str<WCHAR>& extracted, Vec<RectI>& coords)\r\n{\r\n    miniexp_t type = miniexp_car(item);\r\n    if (!miniexp_symbolp(type))\r\n        return false;\r\n    item = miniexp_cdr(item);\r\n\r\n    if (!miniexp_numberp(miniexp_car(item))) return false;\r\n    int x0 = miniexp_to_int(miniexp_car(item)); item = miniexp_cdr(item);\r\n    if (!miniexp_numberp(miniexp_car(item))) return false;\r\n    int y0 = miniexp_to_int(miniexp_car(item)); item = miniexp_cdr(item);\r\n    if (!miniexp_numberp(miniexp_car(item))) return false;\r\n    int x1 = miniexp_to_int(miniexp_car(item)); item = miniexp_cdr(item);\r\n    if (!miniexp_numberp(miniexp_car(item))) return false;\r\n    int y1 = miniexp_to_int(miniexp_car(item)); item = miniexp_cdr(item);\r\n    RectI rect = RectI::FromXY(x0, y0, x1, y1);\r\n\r\n    miniexp_t str = miniexp_car(item);\r\n    if (miniexp_stringp(str) && !miniexp_cdr(item)) {\r\n        if (type != miniexp_symbol(\"char\") && type != miniexp_symbol(\"word\") ||\r\n            coords.Count() > 0 && rect.y < coords.Last().y - coords.Last().dy * 0.8) {\r\n            AppendNewline(extracted, coords, lineSep);\r\n        }\r\n        const char *content = miniexp_to_str(str);\r\n        WCHAR *value = str::conv::FromUtf8(content);\r\n        if (value) {\r\n            size_t len = str::Len(value);\r\n            // TODO: split the rectangle into individual parts per glyph\r\n            for (size_t i = 0; i < len; i++)\r\n                coords.Append(RectI(rect.x, rect.y, rect.dx, rect.dy));\r\n            extracted.AppendAndFree(value);\r\n        }\r\n        if (miniexp_symbol(\"word\") == type) {\r\n            extracted.Append(' ');\r\n            coords.Append(RectI(rect.x + rect.dx, rect.y, 2, rect.dy));\r\n        }\r\n        item = miniexp_cdr(item);\r\n    }\r\n    while (miniexp_consp(str)) {\r\n        ExtractPageText(str, lineSep, extracted, coords);\r\n        item = miniexp_cdr(item);\r\n        str = miniexp_car(item);\r\n    }\r\n    return !item;\r\n}\r\n\r\nWCHAR *DjVuEngineImpl::ExtractPageText(int pageNo, const WCHAR *lineSep, RectI **coordsOut, RenderTarget target)\r\n{\r\n    UNUSED(target);\r\n    ScopedCritSec scope(&gDjVuContext.lock);\r\n\r\n    miniexp_t pagetext;\r\n    while ((pagetext = ddjvu_document_get_pagetext(doc, pageNo-1, nullptr)) == miniexp_dummy)\r\n        gDjVuContext.SpinMessageLoop();\r\n    if (miniexp_nil == pagetext)\r\n        return nullptr;\r\n\r\n    str::Str<WCHAR> extracted;\r\n    Vec<RectI> coords;\r\n    bool success = ExtractPageText(pagetext, lineSep, extracted, coords);\r\n    ddjvu_miniexp_release(doc, pagetext);\r\n    if (!success)\r\n        return nullptr;\r\n    if (extracted.Count() > 0 && !str::EndsWith(extracted.Get(), lineSep))\r\n        AppendNewline(extracted, coords, lineSep);\r\n\r\n    assert(str::Len(extracted.Get()) == coords.Count());\r\n    if (coordsOut) {\r\n        ddjvu_status_t status;\r\n        ddjvu_pageinfo_t info;\r\n        while ((status = ddjvu_document_get_pageinfo(doc, pageNo-1, &info)) < DDJVU_JOB_OK)\r\n            gDjVuContext.SpinMessageLoop();\r\n        float dpiFactor = 1.0;\r\n        if (DDJVU_JOB_OK == status)\r\n            dpiFactor = GetFileDPI() / info.dpi;\r\n\r\n        // TODO: the coordinates aren't completely correct yet\r\n        RectI page = PageMediabox(pageNo).Round();\r\n        for (size_t i = 0; i < coords.Count(); i++) {\r\n            if (coords.At(i) != RectI()) {\r\n                if (dpiFactor != 1.0) {\r\n                    geomutil::RectT<float> pageF = coords.At(i).Convert<float>();\r\n                    pageF.x *= dpiFactor; pageF.dx *= dpiFactor;\r\n                    pageF.y *= dpiFactor; pageF.dy *= dpiFactor;\r\n                    coords.At(i) = pageF.Round();\r\n                }\r\n                coords.At(i).y = page.dy - coords.At(i).y - coords.At(i).dy;\r\n            }\r\n        }\r\n        CrashIf(coords.Count() != extracted.Count());\r\n        *coordsOut = coords.StealData();\r\n    }\r\n\r\n    return extracted.StealData();\r\n}\r\n\r\nvoid DjVuEngineImpl::UpdateUserAnnotations(Vec<PageAnnotation> *list)\r\n{\r\n    ScopedCritSec scope(&gDjVuContext.lock);\r\n    if (list)\r\n        userAnnots = *list;\r\n    else\r\n        userAnnots.Reset();\r\n}\r\n\r\nVec<PageElement *> *DjVuEngineImpl::GetElements(int pageNo)\r\n{\r\n    assert(1 <= pageNo && pageNo <= PageCount());\r\n    if (annos && miniexp_dummy == annos[pageNo-1]) {\r\n        ScopedCritSec scope(&gDjVuContext.lock);\r\n        while ((annos[pageNo-1] = ddjvu_document_get_pageanno(doc, pageNo-1)) == miniexp_dummy)\r\n            gDjVuContext.SpinMessageLoop();\r\n    }\r\n    if (!annos || !annos[pageNo-1])\r\n        return nullptr;\r\n\r\n    ScopedCritSec scope(&gDjVuContext.lock);\r\n\r\n    Vec<PageElement *> *els = new Vec<PageElement *>();\r\n    RectI page = PageMediabox(pageNo).Round();\r\n\r\n    ddjvu_status_t status;\r\n    ddjvu_pageinfo_t info;\r\n    while ((status = ddjvu_document_get_pageinfo(doc, pageNo-1, &info)) < DDJVU_JOB_OK)\r\n        gDjVuContext.SpinMessageLoop();\r\n    float dpiFactor = 1.0;\r\n    if (DDJVU_JOB_OK == status)\r\n        dpiFactor = GetFileDPI() / info.dpi;\r\n\r\n    miniexp_t *links = ddjvu_anno_get_hyperlinks(annos[pageNo-1]);\r\n    for (int i = 0; links[i]; i++) {\r\n        miniexp_t anno = miniexp_cdr(links[i]);\r\n\r\n        miniexp_t url = miniexp_car(anno);\r\n        const char *urlUtf8 = nullptr;\r\n        if (miniexp_stringp(url))\r\n            urlUtf8 = miniexp_to_str(url);\r\n        else if (miniexp_consp(url) && miniexp_car(url) == miniexp_symbol(\"url\") &&\r\n                 miniexp_stringp(miniexp_cadr(url)) && miniexp_stringp(miniexp_caddr(url))) {\r\n            urlUtf8 = miniexp_to_str(miniexp_cadr(url));\r\n        }\r\n        if (!urlUtf8)\r\n            continue;\r\n\r\n        anno = miniexp_cdr(anno);\r\n        miniexp_t comment = miniexp_car(anno);\r\n        const char *commentUtf8 = nullptr;\r\n        if (miniexp_stringp(comment))\r\n            commentUtf8 = miniexp_to_str(comment);\r\n\r\n        anno = miniexp_cdr(anno);\r\n        miniexp_t area = miniexp_car(anno);\r\n        miniexp_t type = miniexp_car(area);\r\n        if (type != miniexp_symbol(\"rect\") && type != miniexp_symbol(\"oval\") && type != miniexp_symbol(\"text\"))\r\n            continue; // unsupported shape;\r\n\r\n        area = miniexp_cdr(area);\r\n        if (!miniexp_numberp(miniexp_car(area))) continue;\r\n        int x = miniexp_to_int(miniexp_car(area)); area = miniexp_cdr(area);\r\n        if (!miniexp_numberp(miniexp_car(area))) continue;\r\n        int y = miniexp_to_int(miniexp_car(area)); area = miniexp_cdr(area);\r\n        if (!miniexp_numberp(miniexp_car(area))) continue;\r\n        int w = miniexp_to_int(miniexp_car(area)); area = miniexp_cdr(area);\r\n        if (!miniexp_numberp(miniexp_car(area))) continue;\r\n        int h = miniexp_to_int(miniexp_car(area)); area = miniexp_cdr(area);\r\n        if (dpiFactor != 1.0) {\r\n            x = (int)(x * dpiFactor); w = (int)(w * dpiFactor);\r\n            y = (int)(y * dpiFactor); h = (int)(h * dpiFactor);\r\n        }\r\n        RectI rect(x, page.dy - y - h, w, h);\r\n\r\n        ScopedMem<char> link(ResolveNamedDest(urlUtf8));\r\n        els->Append(new DjVuLink(pageNo, rect, link ? link : urlUtf8, commentUtf8));\r\n    }\r\n    ddjvu_free(links);\r\n\r\n    return els;\r\n}\r\n\r\nPageElement *DjVuEngineImpl::GetElementAtPos(int pageNo, PointD pt)\r\n{\r\n    Vec<PageElement *> *els = GetElements(pageNo);\r\n    if (!els)\r\n        return nullptr;\r\n\r\n    // elements are extracted bottom-to-top but are accessed\r\n    // in top-to-bottom order, so reverse the list first\r\n    els->Reverse();\r\n\r\n    PageElement *el = nullptr;\r\n    for (size_t i = 0; i < els->Count() && !el; i++)\r\n        if (els->At(i)->GetRect().Contains(pt))\r\n            el = els->At(i);\r\n\r\n    if (el)\r\n        els->Remove(el);\r\n    DeleteVecMembers(*els);\r\n    delete els;\r\n\r\n    return el;\r\n}\r\n\r\n// returns a numeric DjVu link to a named page (if the name resolves)\r\n// caller needs to free() the result\r\nchar *DjVuEngineImpl::ResolveNamedDest(const char *name)\r\n{\r\n    if (!str::StartsWith(name, \"#\"))\r\n        return nullptr;\r\n    for (size_t i = 0; i < fileInfo.Count(); i++) {\r\n        if (str::EqI(name + 1, fileInfo.At(i).id))\r\n            return str::Format(\"#%d\", fileInfo.At(i).pageno + 1);\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nPageDestination *DjVuEngineImpl::GetNamedDest(const WCHAR *name)\r\n{\r\n    ScopedMem<char> nameUtf8(str::conv::ToUtf8(name));\r\n    if (!str::StartsWith(nameUtf8.Get(), \"#\"))\r\n        nameUtf8.Set(str::Join(\"#\", nameUtf8));\r\n\r\n    ScopedMem<char> link(ResolveNamedDest(nameUtf8));\r\n    if (link)\r\n        return new DjVuDestination(link);\r\n    return nullptr;\r\n}\r\n\r\nDjVuTocItem *DjVuEngineImpl::BuildTocTree(miniexp_t entry, int& idCounter)\r\n{\r\n    DjVuTocItem *node = nullptr;\r\n\r\n    for (miniexp_t rest = entry; miniexp_consp(rest); rest = miniexp_cdr(rest)) {\r\n        miniexp_t item = miniexp_car(rest);\r\n        if (!miniexp_consp(item) || !miniexp_consp(miniexp_cdr(item)) ||\r\n            !miniexp_stringp(miniexp_car(item)) || !miniexp_stringp(miniexp_cadr(item)))\r\n            continue;\r\n\r\n        const char *name = miniexp_to_str(miniexp_car(item));\r\n        const char *link = miniexp_to_str(miniexp_cadr(item));\r\n\r\n        DjVuTocItem *tocItem = nullptr;\r\n        ScopedMem<char> linkNo(ResolveNamedDest(link));\r\n        if (!linkNo)\r\n            tocItem = new DjVuTocItem(name, link);\r\n        else if (!str::IsEmpty(name) && !str::Eq(name, link + 1))\r\n            tocItem = new DjVuTocItem(name, linkNo);\r\n        else {\r\n            // ignore generic (name-less) entries\r\n            delete BuildTocTree(miniexp_cddr(item), idCounter);\r\n            continue;\r\n        }\r\n\r\n        tocItem->id = ++idCounter;\r\n        tocItem->child = BuildTocTree(miniexp_cddr(item), idCounter);\r\n\r\n        if (!node)\r\n            node = tocItem;\r\n        else\r\n            node->AddSibling(tocItem);\r\n    }\r\n\r\n    return node;\r\n}\r\n\r\nDocTocItem *DjVuEngineImpl::GetTocTree()\r\n{\r\n    if (!HasTocTree())\r\n        return nullptr;\r\n\r\n    ScopedCritSec scope(&gDjVuContext.lock);\r\n    int idCounter = 0;\r\n    DjVuTocItem *root = BuildTocTree(outline, idCounter);\r\n    if (root)\r\n        root->OpenSingleNode();\r\n    return root;\r\n}\r\n\r\nWCHAR *DjVuEngineImpl::GetPageLabel(int pageNo) const\r\n{\r\n    for (size_t i = 0; i < fileInfo.Count(); i++) {\r\n        ddjvu_fileinfo_t& info = fileInfo.At(i);\r\n        if (pageNo - 1 == info.pageno && !str::Eq(info.title, info.id))\r\n            return str::conv::FromUtf8(info.title);\r\n    }\r\n    return BaseEngine::GetPageLabel(pageNo);\r\n}\r\n\r\nint DjVuEngineImpl::GetPageByLabel(const WCHAR *label) const\r\n{\r\n    ScopedMem<char> labelUtf8(str::conv::ToUtf8(label));\r\n    for (size_t i = 0; i < fileInfo.Count(); i++) {\r\n        ddjvu_fileinfo_t& info = fileInfo.At(i);\r\n        if (str::EqI(info.title, labelUtf8) && !str::Eq(info.title, info.id))\r\n            return info.pageno + 1;\r\n    }\r\n    return BaseEngine::GetPageByLabel(label);\r\n}\r\n\r\nBaseEngine *DjVuEngineImpl::CreateFromFile(const WCHAR *fileName)\r\n{\r\n    DjVuEngineImpl *engine = new DjVuEngineImpl();\r\n    if (!engine->Load(fileName)) {\r\n        delete engine;\r\n        return nullptr;\r\n    }\r\n    return engine;\r\n}\r\n\r\nBaseEngine *DjVuEngineImpl::CreateFromStream(IStream *stream)\r\n{\r\n    DjVuEngineImpl *engine = new DjVuEngineImpl();\r\n    if (!engine->Load(stream)) {\r\n        delete engine;\r\n        return nullptr;\r\n    }\r\n    return engine;\r\n}\r\n\r\nnamespace DjVuEngine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff)\r\n{\r\n    if (sniff)\r\n        return file::StartsWith(fileName, \"AT&T\");\r\n\r\n    return str::EndsWithI(fileName, L\".djvu\");\r\n}\r\n\r\nBaseEngine *CreateFromFile(const WCHAR *fileName)\r\n{\r\n    return DjVuEngineImpl::CreateFromFile(fileName);\r\n}\r\n\r\nBaseEngine *CreateFromStream(IStream *stream)\r\n{\r\n    return DjVuEngineImpl::CreateFromStream(stream);\r\n}\r\n\r\n}\r\n"
  },
  {
    "path": "src/DjVuEngine.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nnamespace DjVuEngine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff=false);\r\nBaseEngine *CreateFromFile(const WCHAR *fileName);\r\nBaseEngine *CreateFromStream(IStream *stream);\r\n\r\n}\r\n"
  },
  {
    "path": "src/Doc.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"ArchUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"HtmlPullParser.h\"\r\n#include \"Mui.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EbookBase.h\"\r\n#include \"EbookDoc.h\"\r\n#include \"MobiDoc.h\"\r\n#include \"HtmlFormatter.h\"\r\n#include \"EbookFormatter.h\"\r\n#include \"Doc.h\"\r\n\r\nDoc::Doc(const Doc& other)\r\n{\r\n    Clear();\r\n    type = other.type;\r\n    generic = other.generic;\r\n    error = other.error;\r\n    filePath.Set(str::Dup(other.filePath));\r\n}\r\n\r\nDoc& Doc::operator=(const Doc& other)\r\n{\r\n    if (this != &other) {\r\n        type = other.type;\r\n        generic = other.generic;\r\n        error = other.error;\r\n        filePath.Set(str::Dup(other.filePath));\r\n    }\r\n    return *this;\r\n}\r\n\r\nDoc::~Doc()\r\n{\r\n}\r\n\r\n// delete underlying object\r\nvoid Doc::Delete()\r\n{\r\n    switch (type) {\r\n    case Doc_Epub:\r\n        delete epubDoc;\r\n        break;\r\n    case Doc_Fb2:\r\n        delete fb2Doc;\r\n        break;\r\n    case Doc_Mobi:\r\n        delete mobiDoc;\r\n        break;\r\n    case Doc_Pdb:\r\n        delete palmDoc;\r\n        break;\r\n    case Doc_None:\r\n        break;\r\n    default:\r\n        CrashIf(true);\r\n        break;\r\n    }\r\n\r\n    Clear();\r\n}\r\n\r\nDoc::Doc(EpubDoc *doc)\r\n{\r\n    Clear();\r\n    type = doc ? Doc_Epub : Doc_None;\r\n    epubDoc = doc;\r\n}\r\n\r\nDoc::Doc(Fb2Doc *doc)\r\n{\r\n    Clear();\r\n    type = doc ? Doc_Fb2 : Doc_None;\r\n    fb2Doc = doc;\r\n}\r\n\r\nDoc::Doc(MobiDoc *doc)\r\n{\r\n    Clear();\r\n    type = doc ? Doc_Mobi : Doc_None;\r\n    mobiDoc = doc;\r\n}\r\n\r\nDoc::Doc(PalmDoc *doc)\r\n{\r\n    Clear();\r\n    type = doc ? Doc_Pdb : Doc_None;\r\n    palmDoc = doc;\r\n}\r\n\r\nvoid Doc::Clear()\r\n{\r\n    type = Doc_None;\r\n    generic = nullptr;\r\n    error = Error_None;\r\n    filePath.Set(nullptr);\r\n}\r\n\r\n// the caller should make sure there is a document object\r\nconst WCHAR *Doc::GetFilePathFromDoc() const\r\n{\r\n    switch (type) {\r\n    case Doc_Epub:\r\n        return epubDoc->GetFileName();\r\n    case Doc_Fb2:\r\n        return fb2Doc->GetFileName();\r\n    case Doc_Mobi:\r\n        return mobiDoc->GetFileName();\r\n    case Doc_Pdb:\r\n        return palmDoc->GetFileName();\r\n    case Doc_None:\r\n        return nullptr;\r\n    default:\r\n        CrashIf(true);\r\n        return nullptr;\r\n    }\r\n}\r\n\r\nconst WCHAR *Doc::GetFilePath() const\r\n{\r\n    if (filePath) {\r\n        // verify it's consistent with the path in the doc\r\n        const WCHAR *docPath = GetFilePathFromDoc();\r\n        CrashIf(docPath && !str::Eq(filePath, docPath));\r\n        return filePath;\r\n    }\r\n    CrashIf(!generic && !IsNone());\r\n    return GetFilePathFromDoc();\r\n}\r\n\r\nconst WCHAR *Doc::GetDefaultFileExt() const\r\n{\r\n    switch (type) {\r\n    case Doc_Epub:\r\n        return L\".epub\";\r\n    case Doc_Fb2:\r\n        return fb2Doc->IsZipped() ? L\".fb2z\" : L\".fb2\";\r\n    case Doc_Mobi:\r\n        return L\".mobi\";\r\n    case Doc_Pdb:\r\n        return L\".pdb\";\r\n    case Doc_None:\r\n        return nullptr;\r\n    default:\r\n        CrashIf(true);\r\n        return nullptr;\r\n    }\r\n}\r\n\r\nWCHAR *Doc::GetProperty(DocumentProperty prop) const\r\n{\r\n    switch (type) {\r\n    case Doc_Epub:\r\n        return epubDoc->GetProperty(prop);\r\n    case Doc_Fb2:\r\n        return fb2Doc->GetProperty(prop);\r\n    case Doc_Mobi:\r\n        return mobiDoc->GetProperty(prop);\r\n    case Doc_Pdb:\r\n        return palmDoc->GetProperty(prop);\r\n    case Doc_None:\r\n        return nullptr;\r\n    default:\r\n        CrashIf(true);\r\n        return nullptr;\r\n    }\r\n}\r\n\r\nconst char *Doc::GetHtmlData(size_t &len) const\r\n{\r\n    switch (type) {\r\n    case Doc_Epub:\r\n        return epubDoc->GetHtmlData(&len);\r\n    case Doc_Fb2:\r\n        return fb2Doc->GetXmlData(&len);\r\n    case Doc_Mobi:\r\n        return mobiDoc->GetHtmlData(len);\r\n    case Doc_Pdb:\r\n        return palmDoc->GetHtmlData(&len);\r\n    default:\r\n        CrashIf(true);\r\n        return nullptr;\r\n    }\r\n}\r\n\r\nsize_t Doc::GetHtmlDataSize() const\r\n{\r\n    switch (type) {\r\n    case Doc_Epub:\r\n        return epubDoc->GetHtmlDataSize();\r\n    case Doc_Fb2:\r\n        return fb2Doc->GetXmlDataSize();\r\n    case Doc_Mobi:\r\n        return mobiDoc->GetHtmlDataSize();\r\n    case Doc_Pdb:\r\n        return palmDoc->GetHtmlDataSize();\r\n    default:\r\n        CrashIf(true);\r\n        return 0;\r\n    }\r\n}\r\n\r\nImageData *Doc::GetCoverImage() const\r\n{\r\n    switch (type) {\r\n    case Doc_Fb2:\r\n        return fb2Doc->GetCoverImage();\r\n    case Doc_Mobi:\r\n        return mobiDoc->GetCoverImage();\r\n    case Doc_Epub:\r\n    case Doc_Pdb:\r\n    default:\r\n        return nullptr;\r\n    }\r\n}\r\n\r\nbool Doc::HasToc() const\r\n{\r\n    switch (type) {\r\n    case Doc_Epub:\r\n        return epubDoc->HasToc();\r\n    case Doc_Fb2:\r\n        return fb2Doc->HasToc();\r\n    case Doc_Mobi:\r\n        return mobiDoc->HasToc();\r\n    case Doc_Pdb:\r\n        return palmDoc->HasToc();\r\n    default:\r\n        return false;\r\n    }\r\n}\r\n\r\nbool Doc::ParseToc(EbookTocVisitor *visitor) const\r\n{\r\n    switch (type) {\r\n    case Doc_Epub:\r\n        return epubDoc->ParseToc(visitor);\r\n    case Doc_Fb2:\r\n        return fb2Doc->ParseToc(visitor);\r\n    case Doc_Mobi:\r\n        return mobiDoc->ParseToc(visitor);\r\n    case Doc_Pdb:\r\n        return palmDoc->ParseToc(visitor);\r\n    default:\r\n        return false;\r\n    }\r\n}\r\n\r\nHtmlFormatter *Doc::CreateFormatter(HtmlFormatterArgs *args) const\r\n{\r\n    switch (type) {\r\n    case Doc_Epub:\r\n        return new EpubFormatter(args, epubDoc);\r\n    case Doc_Fb2:\r\n        return new Fb2Formatter(args, fb2Doc);\r\n    case Doc_Mobi:\r\n        return new MobiFormatter(args, mobiDoc);\r\n    case Doc_Pdb:\r\n        return new HtmlFormatter(args);\r\n    default:\r\n        CrashIf(true);\r\n        return nullptr;\r\n    }\r\n}\r\n\r\nDoc Doc::CreateFromFile(const WCHAR *filePath)\r\n{\r\n    Doc doc;\r\n    if (EpubDoc::IsSupportedFile(filePath))\r\n        doc = Doc(EpubDoc::CreateFromFile(filePath));\r\n    else if (Fb2Doc::IsSupportedFile(filePath))\r\n        doc = Doc(Fb2Doc::CreateFromFile(filePath));\r\n    else if (MobiDoc::IsSupportedFile(filePath)) {\r\n        doc = Doc(MobiDoc::CreateFromFile(filePath));\r\n        // MobiDoc is also used for loading PalmDoc - don't expose that to Doc users, though\r\n        if (doc.mobiDoc && doc.mobiDoc->GetDocType() != Pdb_Mobipocket) {\r\n            doc.Delete();\r\n            // .prc files can be both MobiDoc or PalmDoc\r\n            if (PalmDoc::IsSupportedFile(filePath))\r\n                doc = Doc(PalmDoc::CreateFromFile(filePath));\r\n        }\r\n    }\r\n    else if (PalmDoc::IsSupportedFile(filePath))\r\n        doc = Doc(PalmDoc::CreateFromFile(filePath));\r\n\r\n    // if failed to load and more specific error message hasn't been\r\n    // set above, set a generic error message\r\n    if (doc.IsNone()) {\r\n        CrashIf(doc.error);\r\n        doc.error = Error_Unknown;\r\n        doc.filePath.Set(str::Dup(filePath));\r\n    }\r\n    else {\r\n        CrashIf(!Doc::IsSupportedFile(filePath));\r\n    }\r\n    CrashIf(!doc.generic && !doc.IsNone());\r\n    return doc;\r\n}\r\n\r\nbool Doc::IsSupportedFile(const WCHAR *filePath, bool sniff)\r\n{\r\n    return EpubDoc::IsSupportedFile(filePath, sniff) ||\r\n           Fb2Doc::IsSupportedFile(filePath, sniff) ||\r\n           MobiDoc::IsSupportedFile(filePath, sniff) ||\r\n           PalmDoc::IsSupportedFile(filePath, sniff);\r\n}\r\n"
  },
  {
    "path": "src/Doc.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// Doc is to EbookController what BaseEngine is to DisplayModel:\r\n// It simply abstracts all document objects, allows querying the type, casting\r\n// to the wrapped object and present as much of the unified interface as\r\n// possible.\r\n// It's small enough to be passed by value.\r\n\r\nclass EpubDoc;\r\nclass Fb2Doc;\r\nclass MobiDoc;\r\nclass PalmDoc;\r\n\r\nstruct ImageData;\r\nclass EbookTocVisitor;\r\nclass HtmlFormatter;\r\nclass HtmlFormatterArgs;\r\n\r\nenum DocType { Doc_None, Doc_Epub, Doc_Fb2, Doc_Mobi, Doc_Pdb };\r\nenum DocError { Error_None, Error_Unknown };\r\n\r\nclass Doc\r\n{\r\nprotected:\r\n    DocType type;\r\n\r\n    // If there was an error loading a file in CreateFromFile(),\r\n    // this is an error message to be shown to the user. Most\r\n    // of the time it's a generic error message but can be\r\n    // more specific e.g. mobi loading might specify that\r\n    // loading failed due to DRM\r\n    DocError error;\r\n\r\n    // A copy of the file path which is needed in case of an error (else\r\n    // the file path is supposed to be stored inside the wrapped *Doc)\r\n    ScopedMem<WCHAR> filePath;\r\n\r\n    union {\r\n        void *      generic;\r\n        EpubDoc *   epubDoc;\r\n        Fb2Doc *    fb2Doc;\r\n        MobiDoc *   mobiDoc;\r\n        PalmDoc *   palmDoc;\r\n    };\r\n\r\n    const WCHAR *GetFilePathFromDoc() const;\r\n\r\npublic:\r\n    Doc(const Doc& other);\r\n    Doc& operator=(const Doc& other);\r\n    ~Doc();\r\n\r\n    void Clear();\r\n    Doc() { Clear(); }\r\n    explicit Doc(EpubDoc *doc);\r\n    explicit Doc(Fb2Doc *doc);\r\n    explicit Doc(MobiDoc *doc);\r\n    explicit Doc(PalmDoc *doc);\r\n\r\n    void Delete();\r\n\r\n    // note: find a better name, if possible\r\n    bool IsNone() const { return Doc_None == type; }\r\n    bool IsDocLoaded() const { return !IsNone(); }\r\n    DocType Type() const { return type; }\r\n\r\n    bool LoadingFailed() const {\r\n        CrashIf(error && !IsNone());\r\n        return error != Error_None;\r\n    }\r\n\r\n    // instead of adding these to Doc, they could also be part\r\n    // of a virtual EbookDoc interface that *Doc implement\r\n    const WCHAR *GetFilePath() const;\r\n    const WCHAR *GetDefaultFileExt() const;\r\n    WCHAR *GetProperty(DocumentProperty prop) const;\r\n    const char *GetHtmlData(size_t &len) const;\r\n    size_t GetHtmlDataSize() const;\r\n    ImageData *GetCoverImage() const;\r\n    bool HasToc() const;\r\n    bool ParseToc(EbookTocVisitor *visitor) const;\r\n    HtmlFormatter *CreateFormatter(HtmlFormatterArgs *args) const;\r\n\r\n    static Doc CreateFromFile(const WCHAR *filePath);\r\n    static bool IsSupportedFile(const WCHAR *filePath, bool sniff=false);\r\n};\r\n"
  },
  {
    "path": "src/EbookBase.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// this is a collection of structs and classes that are\r\n// useful for more than one ebook format\r\n\r\nstruct ImageData {\r\n    char *      data;\r\n    size_t      len;\r\n};\r\n\r\nclass EbookTocVisitor {\r\npublic:\r\n    virtual void Visit(const WCHAR *name, const WCHAR *url, int level) = 0;\r\n    virtual ~EbookTocVisitor() { }\r\n};\r\n"
  },
  {
    "path": "src/EbookController.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"ArchUtil.h\"\r\n#include \"GdiPlusUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"HtmlPullParser.h\"\r\n#include \"Mui.h\"\r\n#include \"ThreadUtil.h\"\r\n#include \"Timer.h\"\r\n#include \"TrivialHtmlParser.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EbookBase.h\"\r\n#include \"EbookDoc.h\"\r\n#include \"MobiDoc.h\"\r\n#include \"HtmlFormatter.h\"\r\n#include \"Doc.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"EbookController.h\"\r\n#include \"GlobalPrefs.h\"\r\n// ui\r\n#include \"EbookControls.h\"\r\n#include \"Translations.h\"\r\n//#define NOLOG 0\r\n#include \"DebugLog.h\"\r\n\r\nstatic const WCHAR *GetFontName()\r\n{\r\n    // TODO: validate the name?\r\n    return gGlobalPrefs->ebookUI.fontName;\r\n}\r\n\r\nstatic float GetFontSize()\r\n{\r\n    float fontSize = gGlobalPrefs->ebookUI.fontSize;\r\n    if (fontSize < 7.f || fontSize > 32.f)\r\n        fontSize = 12.5;\r\n    return fontSize;\r\n}\r\n\r\nHtmlFormatterArgs *CreateFormatterArgsDoc(Doc doc, int dx, int dy, Allocator *textAllocator)\r\n{\r\n    HtmlFormatterArgs *args = CreateFormatterDefaultArgs(dx, dy, textAllocator);\r\n    args->htmlStr = doc.GetHtmlData(args->htmlStrLen);\r\n    args->SetFontName(GetFontName());\r\n    args->fontSize = GetFontSize();\r\n    return args;\r\n}\r\n\r\nclass EbookTocDest : public DocTocItem, public PageDestination {\r\n    ScopedMem<WCHAR> url;\r\n\r\npublic:\r\n    EbookTocDest(const WCHAR *title, int reparseIdx) :\r\n        DocTocItem(str::Dup(title), reparseIdx), url(nullptr) { }\r\n    EbookTocDest(const WCHAR *title, const WCHAR *url) :\r\n        DocTocItem(str::Dup(title)), url(str::Dup(url)) { }\r\n\r\n    virtual PageDestination *GetLink() { return this; }\r\n\r\n    // PageDestination\r\n    PageDestType GetDestType() const override { return url ? Dest_LaunchURL : Dest_ScrollTo; }\r\n    int GetDestPageNo() const override { return pageNo; }\r\n    RectD GetDestRect() const override { return RectD(); }\r\n    WCHAR *GetDestValue() const  override { return str::Dup(url); }\r\n};\r\n\r\nstruct EbookFormattingData {\r\n    enum { MAX_PAGES = 256 };\r\n    HtmlPage *         pages[MAX_PAGES];\r\n    size_t             pageCount;\r\n    bool               finished;\r\n    LONG               threadNo;\r\n\r\n    EbookFormattingData(HtmlPage **pages, size_t pageCount, bool finished, LONG threadNo) :\r\n        pageCount(pageCount), finished(finished), threadNo(threadNo) {\r\n        CrashIf(pageCount > MAX_PAGES);\r\n        memcpy(this->pages, pages, pageCount * sizeof(*pages));\r\n    }\r\n};\r\n\r\nclass EbookFormattingThread : public ThreadBase {\r\n    HtmlFormatterArgs * formatterArgs; // we own it\r\n\r\n    Doc                 doc;\r\n    EbookController *   controller;\r\n    ControllerCallback *cb;\r\n\r\n    // state used during layout process\r\n    HtmlPage *  pages[EbookFormattingData::MAX_PAGES];\r\n    int         pageCount;\r\n\r\n    // we want to send 2 pages after reparseIdx as soon as we have them,\r\n    // so that we can show them to the user as quickly as possible\r\n    // We want 2 to accomodate possible 2 page view\r\n    int         reparseIdx;\r\n    int         pagesAfterReparseIdx;\r\n\r\npublic:\r\n    void        SendPagesIfNecessary(bool force, bool finished);\r\n    bool        Format();\r\n\r\n    EbookFormattingThread(Doc doc, HtmlFormatterArgs *args,\r\n                          EbookController *ctrl, int reparseIdx, ControllerCallback *cb);\r\n    virtual ~EbookFormattingThread();\r\n\r\n    // ThreadBase\r\n    virtual void Run();\r\n};\r\n\r\nEbookFormattingThread::EbookFormattingThread(Doc doc, HtmlFormatterArgs *args, EbookController *ctrl, int reparseIdx, ControllerCallback *cb) :\r\n    doc(doc), formatterArgs(args), cb(cb), controller(ctrl), pageCount(0), reparseIdx(reparseIdx), pagesAfterReparseIdx(0)\r\n{\r\n    CrashIf(reparseIdx < 0);\r\n    AssertCrash(doc.IsDocLoaded() || (doc.IsNone() && (nullptr != args->htmlStr)));\r\n}\r\n\r\nEbookFormattingThread::~EbookFormattingThread()\r\n{\r\n    //lf(\"ThreadLayoutEbook::~ThreadLayoutEbook()\");\r\n    delete formatterArgs;\r\n}\r\n\r\n// send accumulated pages if we filled the buffer or the caller forces us\r\nvoid EbookFormattingThread::SendPagesIfNecessary(bool force, bool finished)\r\n{\r\n    if (finished)\r\n        force = true;\r\n    if (!force && (pageCount < dimof(pages)))\r\n        return;\r\n    EbookFormattingData *msg = new EbookFormattingData(pages, pageCount, finished, GetNo());\r\n    //lf(\"ThreadLayoutEbook::SendPagesIfNecessary() sending %d pages, finished=%d\", pageCount, (int)finished);\r\n    pageCount = 0;\r\n    memset(pages, 0, sizeof(pages));\r\n    cb->HandleLayoutedPages(controller, msg);\r\n}\r\n\r\n// layout pages from a given reparse point (beginning if nullptr)\r\n// returns true if layout thread was cancelled\r\nbool EbookFormattingThread::Format()\r\n{\r\n    //lf(\"Started laying out ebook, reparseIdx=%d\", reparseIdx);\r\n    int totalPageCount = 0;\r\n    formatterArgs->reparseIdx = 0;\r\n    pagesAfterReparseIdx = 0;\r\n    HtmlFormatter *formatter = doc.CreateFormatter(formatterArgs);\r\n    for (HtmlPage *pd = formatter->Next(); pd; pd = formatter->Next()) {\r\n        if (WasCancelRequested()) {\r\n            //lf(\"layout cancelled\");\r\n            for (int i = 0; i < pageCount; i++) {\r\n                delete pages[i];\r\n            }\r\n            pageCount = 0;\r\n            delete pd;\r\n            // send a 'finished' message so that the thread object gets deleted\r\n            SendPagesIfNecessary(true, true /* finished */);\r\n            delete formatter;\r\n            return true;\r\n        }\r\n        pages[pageCount++] = pd;\r\n        ++totalPageCount;\r\n        if (pd->reparseIdx >= reparseIdx) {\r\n            ++pagesAfterReparseIdx;\r\n        }\r\n        // force sending accumulated pages\r\n        bool force = false;\r\n        if (2 == pagesAfterReparseIdx) {\r\n            force = true;\r\n            //lf(\"EbookFormattingThread::Format: sending pages because pagesAfterReparseIdx == %d\", pagesAfterReparseIdx);\r\n        }\r\n        SendPagesIfNecessary(force, false);\r\n        CrashIf(pageCount >= dimof(pages));\r\n    }\r\n    SendPagesIfNecessary(true, true /* finished */);\r\n    delete formatter;\r\n    return false;\r\n}\r\n\r\nvoid EbookFormattingThread::Run()\r\n{\r\n    Timer t;\r\n    Format();\r\n    //lf(\"Formatting time: %.2f ms\", t.Stop());\r\n}\r\n\r\nstatic void DeletePages(Vec<HtmlPage*>** toDeletePtr)\r\n{\r\n    if (!*toDeletePtr)\r\n        return;\r\n\r\n    DeleteVecMembers(**toDeletePtr);\r\n    delete *toDeletePtr;\r\n    *toDeletePtr = nullptr;\r\n}\r\n\r\nEbookController::EbookController(Doc doc, EbookControls *ctrls, ControllerCallback *cb) :\r\n    doc(doc), Controller(cb), ctrls(ctrls), pages(nullptr), incomingPages(nullptr),\r\n    currPageNo(0), pageSize(0, 0), formattingThread(nullptr), formattingThreadNo(-1),\r\n    currPageReparseIdx(0), handleMsgs(false), pageAnchorIds(nullptr), pageAnchorIdxs(nullptr),\r\n    navHistoryIx(0)\r\n{\r\n    CrashIf(!doc.IsDocLoaded());\r\n\r\n    EventMgr *em = ctrls->mainWnd->evtMgr;\r\n    // TODO: do I need lambada here, can I just pass EbookController::ClickedNext directly?\r\n    em->EventsForName(\"next\")->Clicked = [=](Control *c, int x, int y) {\r\n        this->ClickedNext(c, x, y);\r\n    };\r\n    em->EventsForName(\"prev\")->Clicked = [=](Control *c, int x, int y) {\r\n        this->ClickedPrev(c, x, y);\r\n    };\r\n    em->EventsForControl(ctrls->progress)->Clicked = [=](Control *c, int x, int y) {\r\n        this->ClickedProgress(c, x, y);\r\n    };\r\n    PageControl *page1 = ctrls->pagesLayout->GetPage1();\r\n    PageControl *page2 = ctrls->pagesLayout->GetPage2();\r\n    em->EventsForControl(page1)->SizeChanged = [=](Control *c, int dx, int dy) {\r\n        this->SizeChangedPage(c, dx, dy);\r\n    };\r\n    em->EventsForControl(page2)->SizeChanged = [=](Control *c, int dx, int dy) {\r\n        this->SizeChangedPage(c, dx, dy);\r\n    };\r\n    em->EventsForControl(page1)->Clicked = [=](Control *c, int x, int y) {\r\n        this->ClickedPage1(c, x, y);\r\n    };\r\n    em->EventsForControl(page2)->Clicked = [=](Control *c, int x, int y) {\r\n        this->ClickedPage2(c, x, y);\r\n    };\r\n}\r\n\r\nEbookController::~EbookController()\r\n{\r\n    StopFormattingThread();\r\n    // we must manually disconnect all events becuase evtMgr is\r\n    // destroyed after EbookController, and EbookController destructor\r\n    // will disconnect slots without deleting them, causing leaks\r\n    // TODO: this seems fragile\r\n    EnableMessageHandling(false);\r\n    CloseCurrentDocument();\r\n    DestroyEbookControls(ctrls);\r\n    delete pageAnchorIds;\r\n    delete pageAnchorIdxs;\r\n}\r\n\r\n// stop layout thread (if we're closing a document we'll delete\r\n// the ebook data, so we can't have the thread keep using it)\r\nvoid EbookController::StopFormattingThread()\r\n{\r\n    if (!formattingThread)\r\n        return;\r\n    formattingThread->RequestCancel();\r\n    bool ok = formattingThread->Join();\r\n    CrashIf(!ok);\r\n    delete formattingThread;\r\n    formattingThread = nullptr;\r\n    formattingThreadNo = -1;\r\n    DeletePages(&incomingPages);\r\n}\r\n\r\nvoid EbookController::CloseCurrentDocument()\r\n{\r\n    ctrls->pagesLayout->GetPage1()->SetPage(nullptr);\r\n    ctrls->pagesLayout->GetPage2()->SetPage(nullptr);\r\n    StopFormattingThread();\r\n    DeletePages(&pages);\r\n    doc.Delete();\r\n    pageSize = SizeI(0, 0);\r\n}\r\n\r\n// returns page whose content contains reparseIdx\r\n// page is in 1..$pageCount range to match currPageNo\r\n// returns 0 if not found (or maybe on the last page)\r\n// returns -1 if no pages are available\r\nstatic int PageForReparsePoint(Vec<HtmlPage*> *pages, int reparseIdx)\r\n{\r\n    if (!pages || pages->Count() == 0) {\r\n        return -1;\r\n    }\r\n\r\n    // sometimes reparseIdx of first page is > 0 and the code below\r\n    // doesn't handle that, so do that case first\r\n    if (reparseIdx < pages->At(0)->reparseIdx) {\r\n        return 1;\r\n    }\r\n\r\n    for (size_t i = 0; i < pages->Count(); i++) {\r\n        HtmlPage *pd = pages->At(i);\r\n        if (pd->reparseIdx == reparseIdx) {\r\n            return (int)i + 1;\r\n        }\r\n        // this is the first page whose content is after reparseIdx, so\r\n        // the page contining reparseIdx must be the one before\r\n        if (pd->reparseIdx > reparseIdx) {\r\n            CrashIf(0 == i);\r\n            return (int)i;\r\n        }\r\n    }\r\n    return 0;\r\n}\r\n\r\n// gets pages as formatted from beginning, either from a temporary state\r\n// when layout is in progress or final formatted pages\r\nVec<HtmlPage*> *EbookController::GetPages()\r\n{\r\n    return pages;\r\n}\r\n\r\nvoid EbookController::HandlePagesFromEbookLayout(EbookFormattingData *ft)\r\n{\r\n    if (formattingThreadNo != ft->threadNo) {\r\n        // this is a message from cancelled thread, we can disregard\r\n        lf(\"EbookController::HandlePagesFromEbookLayout() thread msg discarded, curr thread: %d, sending thread: %d\", formattingThreadNo, ft->threadNo);\r\n        DeleteEbookFormattingData(ft);\r\n        return;\r\n    }\r\n    //lf(\"EbookController::HandlePagesFromEbookLayout() %d pages, ft=0x%x\", ft->pageCount, (int)ft);\r\n    if (incomingPages) {\r\n        for (size_t i = 0; i < ft->pageCount; i++) {\r\n            incomingPages->Append(ft->pages[i]);\r\n        }\r\n        int pageNo = PageForReparsePoint(incomingPages, currPageReparseIdx);\r\n        if (pageNo > 0) {\r\n            Vec<HtmlPage*> *toDelete = pages;\r\n            pages = incomingPages;\r\n            incomingPages = nullptr;\r\n            DeletePages(&toDelete);\r\n            GoToPage(pageNo, false);\r\n        }\r\n    } else {\r\n        CrashIf(!pages);\r\n        for (size_t i = 0; i < ft->pageCount; i++) {\r\n            pages->Append(ft->pages[i]);\r\n        }\r\n    }\r\n\r\n    if (ft->finished) {\r\n        CrashIf(!pages);\r\n        StopFormattingThread();\r\n    }\r\n    UpdateStatus();\r\n    // don't call DeleteEbookFormattingData since\r\n    // ft->pages are now owned by incomingPages or pages\r\n    delete ft;\r\n}\r\n\r\nvoid EbookController::TriggerLayout()\r\n{\r\n    Size s = ctrls->pagesLayout->GetPage1()->GetDrawableSize();\r\n    SizeI size(s.Width, s.Height);\r\n    if (size.IsEmpty()) {\r\n        // we haven't been sized yet\r\n        return;\r\n    }\r\n    // CrashIf(size.dx < 100 || size.dy < 40);\r\n    if (!doc.IsDocLoaded())\r\n        return;\r\n\r\n    if (pageSize == size) {\r\n        //lf(\"EbookController::TriggerLayout() - skipping layout because same as last size\");\r\n        return;\r\n    }\r\n\r\n    //lf(\"(%3d,%3d) EbookController::TriggerLayout\",size.dx, size.dy);\r\n    pageSize = size; // set it early to prevent re-doing layout at the same size\r\n\r\n    StopFormattingThread();\r\n    CrashIf(incomingPages);\r\n    incomingPages = new Vec<HtmlPage*>(1024);\r\n\r\n    HtmlFormatterArgs *args = CreateFormatterArgsDoc(doc, size.dx, size.dy, &textAllocator);\r\n    formattingThread = new EbookFormattingThread(doc, args, this, currPageReparseIdx, cb);\r\n    formattingThreadNo = formattingThread->GetNo();\r\n    formattingThread->Start();\r\n    UpdateStatus();\r\n}\r\n\r\nvoid EbookController::SizeChangedPage(Control *c, int dx, int dy)\r\n{\r\n    UNUSED(dx); UNUSED(dy);\r\n    CrashIf(!(c == ctrls->pagesLayout->GetPage1() || c==ctrls->pagesLayout->GetPage2()));\r\n    // delay re-layout so that we don't unnecessarily do the\r\n    // work as long as the user is still resizing the window\r\n    // TODO: previously, the delay was 100 while inSizeMove and 600 else\r\n    // (to delay a bit if the user resizes but not when e.g. switching to fullscreen)\r\n    cb->RequestDelayedLayout(200);\r\n}\r\n\r\nvoid EbookController::ClickedNext(Control *c, int x, int y)\r\n{\r\n    UNUSED(c);  UNUSED(x); UNUSED(y);\r\n    //CrashIf(c != ctrls->next);\r\n    GoToNextPage();\r\n}\r\n\r\nvoid EbookController::ClickedPrev(Control *c, int x, int y)\r\n{\r\n    UNUSED(c);  UNUSED(x); UNUSED(y);\r\n    //CrashIf(c != ctrls->prev);\r\n    GoToPrevPage();\r\n}\r\n\r\n// (x, y) is in the coordinates of c\r\nvoid EbookController::ClickedProgress(Control *c, int x, int y)\r\n{\r\n    UNUSED(x); UNUSED(y);\r\n    CrashIf(c != ctrls->progress);\r\n    float perc = ctrls->progress->GetPercAt(x);\r\n    int pageCount = (int)GetPages()->Count();\r\n    int newPageNo = IntFromPerc(pageCount, perc) + 1;\r\n    GoToPage(newPageNo, true);\r\n}\r\n\r\nvoid EbookController::OnClickedLink(int pageNo, DrawInstr *link)\r\n{\r\n    ScopedMem<WCHAR> url(str::conv::FromHtmlUtf8(link->str.s, link->str.len));\r\n    if (url::IsAbsolute(url)) {\r\n        EbookTocDest dest(nullptr, url);\r\n        cb->GotoLink(&dest);\r\n        return;\r\n    }\r\n\r\n    if (Doc_Epub == doc.Type() && pages && (size_t)pageNo <= pages->Count()) {\r\n        // normalize the URL by combining it with the chapter's base path\r\n        for (int j = pageNo; j > 0; j--) {\r\n            HtmlPage *p = pages->At(j - 1);\r\n            // <pagebreak src=\"...\" page_marker /> is usually the second instruction on a page\r\n            for (size_t k = 0; k < std::min((size_t)2, p->instructions.Count()); k++) {\r\n                DrawInstr& di = p->instructions.At(k);\r\n                if (InstrAnchor == di.type && str::StartsWith(di.str.s + di.str.len, \"\\\" page_marker />\")) {\r\n                    ScopedMem<char> basePath(str::DupN(di.str.s, di.str.len));\r\n                    ScopedMem<char> relPath(ResolveHtmlEntities(link->str.s, link->str.len));\r\n                    ScopedMem<char> absPath(NormalizeURL(relPath, basePath));\r\n                    url.Set(str::conv::FromUtf8(absPath));\r\n                    j = 0; // done\r\n                    break;\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    int idx = ResolvePageAnchor(url);\r\n    if (-1 == idx && str::FindChar(url, '%')) {\r\n        url::DecodeInPlace(url);\r\n        idx = ResolvePageAnchor(url);\r\n    }\r\n    if (idx != -1) {\r\n        EbookTocDest dest(nullptr, idx);\r\n        cb->GotoLink(&dest);\r\n    }\r\n}\r\n\r\nvoid EbookController::ClickedPage1(Control *c, int x, int y)\r\n{\r\n    cb->FocusFrame(true);\r\n\r\n    CrashIf(c != ctrls->pagesLayout->GetPage1());\r\n    DrawInstr *link = ctrls->pagesLayout->GetPage1()->GetLinkAt(x, y);\r\n    if (link)\r\n        OnClickedLink(currPageNo, link);\r\n}\r\n\r\nvoid EbookController::ClickedPage2(Control *c, int x, int y)\r\n{\r\n    cb->FocusFrame(true);\r\n\r\n    CrashIf(!IsDoublePage());\r\n    CrashIf(c != ctrls->pagesLayout->GetPage2());\r\n    DrawInstr *link = ctrls->pagesLayout->GetPage2()->GetLinkAt(x, y);\r\n    if (link)\r\n        OnClickedLink(currPageNo + 1, link);\r\n}\r\n\r\nint EbookController::GetMaxPageCount() const\r\n{\r\n    Vec<HtmlPage *> *pagesTmp = pages;\r\n    if (incomingPages) {\r\n        CrashIf(!FormattingInProgress());\r\n        pagesTmp = incomingPages;\r\n    }\r\n    if (!pagesTmp)\r\n        return 0;\r\n    return (int)pagesTmp->Count();\r\n}\r\n\r\n// show the status text based on current state\r\nvoid EbookController::UpdateStatus()\r\n{\r\n    int pageCount = GetMaxPageCount();\r\n    if (FormattingInProgress()) {\r\n        ScopedMem<WCHAR> s(str::Format(_TR(\"Formatting the book... %d pages\"), pageCount));\r\n        ctrls->status->SetText(s);\r\n        ctrls->progress->SetFilled(0.f);\r\n        return;\r\n    }\r\n\r\n    ScopedMem<WCHAR> s(str::Format(L\"%s %d / %d\", _TR(\"Page:\"), currPageNo, pageCount));\r\n    ctrls->status->SetText(s);\r\n#if 1\r\n    ctrls->progress->SetFilled(PercFromInt(pageCount, currPageNo));\r\n#else\r\n    if (GetPages())\r\n        ctrls->progress->SetFilled(PercFromInt(pageCount, currPageNo));\r\n    else\r\n        ctrls->progress->SetFilled(0.f);\r\n#endif\r\n}\r\n\r\nvoid EbookController::GoToPage(int pageNo, bool addNavPoint)\r\n{\r\n    // we're still formatting, disable page movement\r\n    if (incomingPages) {\r\n        //lf(\"EbookController::GoToPage(%d): skipping because incomingPages != nullptr\", pageNo);\r\n        return;\r\n    }\r\n\r\n    CrashIf(!pages);\r\n    // Hopefully prevent crashes like 55175\r\n    if (!pages) {\r\n        return;\r\n    }\r\n\r\n    if (addNavPoint)\r\n        AddNavPoint();\r\n\r\n    int pageCount = PageCount();\r\n    int n = IsDoublePage() ? 1 : 0;\r\n    if (pageNo + n > pageCount)\r\n        pageNo = pageCount - n;\r\n    // if have only 1 page and showing double, we could go below 1\r\n    if (pageNo < 1)\r\n        pageNo = 1;\r\n\r\n    HtmlPage *p = pages->At(pageNo - 1);\r\n    currPageNo = pageNo;\r\n    currPageReparseIdx = p->reparseIdx;\r\n    ctrls->pagesLayout->GetPage1()->SetPage(p);\r\n    if (IsDoublePage() && pages->Count() > 1) {\r\n        p = pages->At(pageNo);\r\n        ctrls->pagesLayout->GetPage2()->SetPage(p);\r\n    } else {\r\n        ctrls->pagesLayout->GetPage2()->SetPage(nullptr);\r\n    }\r\n    UpdateStatus();\r\n    // update the ToC selection\r\n    cb->PageNoChanged(this, pageNo);\r\n}\r\n\r\nbool EbookController::GoToNextPage()\r\n{\r\n    int dist = IsDoublePage() ? 2 : 1;\r\n    if (currPageNo + dist > PageCount())\r\n        return false;\r\n    GoToPage(currPageNo + dist, false);\r\n    return true;\r\n}\r\n\r\nbool EbookController::GoToPrevPage(bool toBottom)\r\n{\r\n    UNUSED(toBottom);\r\n    int dist = IsDoublePage() ? 2 : 1;\r\n    if (currPageNo == 1)\r\n        return false;\r\n    GoToPage(currPageNo - dist, false);\r\n    return true;\r\n}\r\n\r\nvoid EbookController::StartLayouting(int startReparseIdxArg, DisplayMode displayMode)\r\n{\r\n    if ((size_t)startReparseIdxArg >= doc.GetHtmlDataSize())\r\n        startReparseIdxArg = 0;\r\n    currPageReparseIdx = startReparseIdxArg;\r\n    // displayMode could be any value if alternate UI was used, we have to limit it to\r\n    // either DM_SINGLE_PAGE or DM_FACING\r\n    if (DM_AUTOMATIC == displayMode)\r\n        displayMode = gGlobalPrefs->defaultDisplayModeEnum;\r\n\r\n    EnableMessageHandling(true);\r\n    SetDisplayMode(displayMode);\r\n    TriggerLayout();\r\n    UpdateStatus();\r\n}\r\n\r\nbool EbookController::IsDoublePage() const\r\n{\r\n    return ctrls->pagesLayout->GetPage2()->IsVisible();\r\n}\r\n\r\nstatic RenderedBitmap *RenderFirstDocPageToBitmap(Doc doc, SizeI pageSize, SizeI bmpSize, int border)\r\n{\r\n    PoolAllocator textAllocator;\r\n    HtmlFormatterArgs *args = CreateFormatterArgsDoc(doc, pageSize.dx - 2 * border, pageSize.dy - 2 * border, &textAllocator);\r\n    TextRenderMethod renderMethod = args->textRenderMethod;\r\n    HtmlFormatter *formatter = doc.CreateFormatter(args);\r\n    HtmlPage *pd = formatter->Next();\r\n    delete formatter;\r\n    delete args;\r\n    args = nullptr;\r\n    if (!pd)\r\n        return nullptr;\r\n\r\n    Bitmap pageBmp(pageSize.dx, pageSize.dy, PixelFormat24bppRGB);\r\n    Graphics g(&pageBmp);\r\n    Rect r(0, 0, pageSize.dx, pageSize.dy);\r\n    r.Inflate(1, 1);\r\n    SolidBrush br(Color(255, 255, 255));\r\n    g.FillRectangle(&br, r);\r\n\r\n    ITextRender *textRender = CreateTextRender(renderMethod, &g, pageSize.dx, pageSize.dy);\r\n    textRender->SetTextBgColor(Color(255,255,255));\r\n    DrawHtmlPage(&g, textRender, &pd->instructions, (REAL)border, (REAL)border, false, Color((ARGB)Color::Black));\r\n    delete pd;\r\n    delete textRender;\r\n\r\n    Bitmap res(bmpSize.dx, bmpSize.dy, PixelFormat24bppRGB);\r\n    Graphics g2(&res);\r\n    g2.SetInterpolationMode(InterpolationModeHighQualityBicubic);\r\n    g2.DrawImage(&pageBmp, Rect(0, 0, bmpSize.dx, bmpSize.dy),\r\n                 0, 0, pageSize.dx, pageSize.dy, UnitPixel);\r\n\r\n    HBITMAP hbmp;\r\n    Status ok = res.GetHBITMAP((ARGB)Color::White, &hbmp);\r\n    if (ok != Ok)\r\n        return nullptr;\r\n    return new RenderedBitmap(hbmp, bmpSize);\r\n}\r\n\r\nstatic RenderedBitmap *ThumbFromCoverPage(Doc doc, SizeI size)\r\n{\r\n    ImageData *coverImage = doc.GetCoverImage();\r\n    if (!coverImage)\r\n        return nullptr;\r\n    Bitmap *coverBmp = BitmapFromData(coverImage->data, coverImage->len);\r\n    if (!coverBmp)\r\n        return nullptr;\r\n\r\n    Bitmap res(size.dx, size.dy, PixelFormat24bppRGB);\r\n    float scale = (float)size.dx / (float)coverBmp->GetWidth();\r\n    int fromDy = size.dy;\r\n    if (scale < 1.f)\r\n        fromDy = (int)((float)coverBmp->GetHeight() * scale);\r\n    Graphics g(&res);\r\n    g.SetInterpolationMode(InterpolationModeHighQualityBicubic);\r\n    Status ok = g.DrawImage(coverBmp, Rect(0, 0, size.dx, size.dy),\r\n                            0, 0, coverBmp->GetWidth(), fromDy, UnitPixel);\r\n    if (ok != Ok) {\r\n        delete coverBmp;\r\n        return nullptr;\r\n    }\r\n    HBITMAP hbmp;\r\n    ok = res.GetHBITMAP((ARGB)Color::White, &hbmp);\r\n    delete coverBmp;\r\n    if (ok == Ok)\r\n        return new RenderedBitmap(hbmp, SizeI(size.dx, size.dy));\r\n    return nullptr;\r\n}\r\n\r\nvoid EbookController::CreateThumbnail(SizeI size, const std::function<void(RenderedBitmap*)> &saveThumbnail)\r\n{\r\n    // TODO: create thumbnail asynchronously\r\n    CrashIf(!doc.IsDocLoaded());\r\n    // if there is cover image, we use it to generate thumbnail by scaling\r\n    // image width to thumbnail dx, scaling height proportionally and using\r\n    // as much of it as fits in thumbnail dy\r\n    RenderedBitmap *bmp = ThumbFromCoverPage(doc, size);\r\n    if (!bmp) {\r\n        // no cover image so generate thumbnail from first page\r\n        SizeI pageSize(size.dx * 3, size.dy * 3);\r\n        bmp = RenderFirstDocPageToBitmap(doc, pageSize, size, 10);\r\n    }\r\n    saveThumbnail(bmp);\r\n}\r\n\r\nvoid EbookController::SetDisplayMode(DisplayMode mode, bool keepContinuous)\r\n{\r\n    UNUSED(keepContinuous);\r\n    bool newDouble = !IsSingle(mode);\r\n    if (IsDoublePage() == newDouble)\r\n        return;\r\n    // showing/hiding a control will trigger re-layout which will\r\n    // trigger book re-formatting\r\n    if (newDouble)\r\n        ctrls->pagesLayout->GetPage2()->Show();\r\n    else\r\n        ctrls->pagesLayout->GetPage2()->Hide();\r\n}\r\n\r\nvoid EbookController::ExtractPageAnchors()\r\n{\r\n    if (pageAnchorIds || pageAnchorIdxs) {\r\n        CrashIf(!pageAnchorIds || !pageAnchorIdxs);\r\n        return;\r\n    }\r\n\r\n    pageAnchorIds = new WStrVec();\r\n    pageAnchorIdxs = new Vec<int>();\r\n\r\n    ScopedMem<WCHAR> epubPagePath;\r\n    int fb2TitleCount = 0;\r\n    size_t len;\r\n    const char *data = doc.GetHtmlData(len);\r\n    HtmlPullParser parser(data, len);\r\n    HtmlToken *tok;\r\n    while ((tok = parser.Next()) != nullptr && !tok->IsError()) {\r\n        if (!tok->IsStartTag() && !tok->IsEmptyElementEndTag())\r\n            continue;\r\n        AttrInfo *attr = tok->GetAttrByName(\"id\");\r\n        if (!attr && Tag_A == tok->tag && doc.Type() != Doc_Fb2)\r\n            attr = tok->GetAttrByName(\"name\");\r\n        if (attr) {\r\n            ScopedMem<WCHAR> id(str::conv::FromUtf8(attr->val, attr->valLen));\r\n            pageAnchorIds->Append(str::Format(L\"%s#%s\", epubPagePath ? epubPagePath : L\"\", id.Get()));\r\n            pageAnchorIdxs->Append((int)(tok->GetReparsePoint() - parser.Start()));\r\n        }\r\n        // update EPUB page paths and create an anchor per chapter\r\n        if (Tag_Pagebreak == tok->tag &&\r\n            (attr = tok->GetAttrByName(\"page_path\")) != nullptr &&\r\n            str::StartsWith(attr->val + attr->valLen, \"\\\" page_marker />\")) {\r\n            CrashIf(doc.Type() != Doc_Epub);\r\n            epubPagePath.Set(str::conv::FromUtf8(attr->val, attr->valLen));\r\n            pageAnchorIds->Append(str::Dup(epubPagePath));\r\n            pageAnchorIdxs->Append((int)(tok->GetReparsePoint() - parser.Start()));\r\n        }\r\n        // create FB2 title anchors (cf. Fb2Doc::ParseToc)\r\n        if (Tag_Title == tok->tag && tok->IsStartTag() && Doc_Fb2 == doc.Type()) {\r\n            ScopedMem<WCHAR> id(str::Format(TEXT(FB2_TOC_ENTRY_MARK) L\"%d\", ++fb2TitleCount));\r\n            pageAnchorIds->Append(id.StealData());\r\n            pageAnchorIdxs->Append((int)(tok->GetReparsePoint() - parser.Start()));\r\n        }\r\n    }\r\n}\r\n\r\nint EbookController::ResolvePageAnchor(const WCHAR *id)\r\n{\r\n    ExtractPageAnchors();\r\n\r\n    int reparseIdx = -1;\r\n    if (Doc_Mobi == doc.Type() && str::Parse(id, L\"%d%$\", &reparseIdx) &&\r\n        0 <= reparseIdx && (size_t)reparseIdx <= doc.GetHtmlDataSize()) {\r\n        // Mobi uses filepos (reparseIdx) for in-document links\r\n        return reparseIdx;\r\n    }\r\n\r\n    int idx = pageAnchorIds->Find(id);\r\n    if (idx != -1)\r\n        return pageAnchorIdxs->At(idx);\r\n    if (doc.Type() != Doc_Epub || !str::FindChar(id, '#'))\r\n        return -1;\r\n\r\n    ScopedMem<WCHAR> chapterPath(str::DupN(id, str::FindChar(id, '#') - id));\r\n    idx = pageAnchorIds->Find(chapterPath);\r\n    if (idx != -1)\r\n        return pageAnchorIdxs->At(idx);\r\n    return -1;\r\n}\r\n\r\nclass EbookTocCollector : public EbookTocVisitor {\r\n    EbookController *ctrl;\r\n    EbookTocDest *root;\r\n    int idCounter;\r\n\r\npublic:\r\n    explicit EbookTocCollector(EbookController *ctrl) :\r\n        ctrl(ctrl), root(nullptr), idCounter(0) { }\r\n\r\n    virtual void Visit(const WCHAR *name, const WCHAR *url, int level) {\r\n        EbookTocDest *item = nullptr;\r\n        if (!url)\r\n            item = new EbookTocDest(name, 0);\r\n        else if (url::IsAbsolute(url))\r\n            item = new EbookTocDest(name, url);\r\n        else {\r\n            int idx = ctrl->ResolvePageAnchor(url);\r\n            if (-1 == idx && str::FindChar(url, '%')) {\r\n                ScopedMem<WCHAR> decodedUrl(str::Dup(url));\r\n                url::DecodeInPlace(decodedUrl);\r\n                idx = ctrl->ResolvePageAnchor(decodedUrl);\r\n            }\r\n            item = new EbookTocDest(name, idx + 1);\r\n        }\r\n        item->id = ++idCounter;\r\n        // find the last child at each level, until finding the parent of the new item\r\n        if (!root) {\r\n            root = item;\r\n        }\r\n        else {\r\n            DocTocItem *r2 = root;\r\n            for (level--; level > 0; level--) {\r\n                for (; r2->next; r2 = r2->next);\r\n                if (!r2->child)\r\n                    break;\r\n                r2 = r2->child;\r\n            }\r\n            if (level <= 0)\r\n                r2->AddSibling(item);\r\n            else\r\n                r2->child = item;\r\n        }\r\n    }\r\n\r\n    EbookTocDest *GetRoot() { return root; }\r\n};\r\n\r\nDocTocItem *EbookController::GetTocTree()\r\n{\r\n    EbookTocCollector visitor(this);\r\n    doc.ParseToc(&visitor);\r\n    EbookTocDest *root = visitor.GetRoot();\r\n    if (root)\r\n        root->OpenSingleNode();\r\n    return root;\r\n}\r\n\r\nvoid EbookController::ScrollToLink(PageDestination *dest)\r\n{\r\n    int reparseIdx = dest->GetDestPageNo() - 1;\r\n    int pageNo = PageForReparsePoint(pages, reparseIdx);\r\n    if (pageNo > 0)\r\n        GoToPage(pageNo, true);\r\n    else if (0 == pageNo)\r\n        GoToLastPage();\r\n}\r\n\r\nPageDestination *EbookController::GetNamedDest(const WCHAR *name)\r\n{\r\n    int reparseIdx = -1;\r\n    if (Doc_Mobi == doc.Type() && str::Parse(name, L\"%d%$\", &reparseIdx) &&\r\n        0 <= reparseIdx && (size_t)reparseIdx <= doc.GetHtmlDataSize()) {\r\n        // Mobi uses filepos (reparseIdx) for in-document links\r\n    }\r\n    else if (!str::FindChar(name, '#')) {\r\n        ScopedMem<WCHAR> id(str::Format(L\"#%s\", name));\r\n        reparseIdx = ResolvePageAnchor(id);\r\n    }\r\n    else {\r\n        reparseIdx = ResolvePageAnchor(name);\r\n    }\r\n    if (reparseIdx < 0)\r\n        return nullptr;\r\n    CrashIf((size_t)reparseIdx > doc.GetHtmlDataSize());\r\n    return new EbookTocDest(nullptr, reparseIdx + 1);\r\n}\r\n\r\nint EbookController::CurrentTocPageNo() const\r\n{\r\n     return currPageReparseIdx + 1;\r\n}\r\n\r\nvoid EbookController::UpdateDisplayState(DisplayState *ds)\r\n{\r\n    if (!ds->filePath || !str::EqI(ds->filePath, doc.GetFilePath()))\r\n        str::ReplacePtr(&ds->filePath, doc.GetFilePath());\r\n\r\n    ds->useDefaultState = !gGlobalPrefs->rememberStatePerDocument;\r\n\r\n    // don't modify any of the other DisplayState values\r\n    // as long as they're not used, so that the same\r\n    // DisplayState settings can also be used for EbookEngine;\r\n    // we get reasonable defaults from DisplayState's constructor anyway\r\n    ds->reparseIdx = currPageReparseIdx;\r\n    str::ReplacePtr(&ds->displayMode, prefs::conv::FromDisplayMode(GetDisplayMode()));\r\n}\r\n\r\nvoid EbookController::SetViewPortSize(SizeI size)\r\n{\r\n    UNUSED(size);\r\n    // relayouting gets the size from the canvas hwnd\r\n    ctrls->mainWnd->RequestLayout();\r\n}\r\n\r\nLRESULT EbookController::HandleMessage(UINT msg, WPARAM wParam, LPARAM lParam, bool& wasHandled)\r\n{\r\n    if (!handleMsgs) {\r\n        wasHandled = false;\r\n        return 0;\r\n    }\r\n    return ctrls->mainWnd->evtMgr->OnMessage(msg, wParam, lParam, wasHandled);\r\n}\r\n\r\n// TODO: also needs to update for font name/size changes, but it's more complicated\r\n// because requires re-layout\r\nvoid EbookController::UpdateDocumentColors()\r\n{\r\n    SetMainWndBgCol(ctrls);\r\n    // changing background will repaint mainWnd control but changing\r\n    // of text color will not, so we request uncoditional repaint\r\n    // TODO: in PageControl::Paint() use a property for text color, instead of\r\n    // taking it directly from prefs\r\n    ::RequestRepaint(ctrls->mainWnd);\r\n}\r\n\r\nvoid EbookController::RequestRepaint()\r\n{\r\n    ctrls->mainWnd->MarkForRepaint();\r\n}\r\n\r\n// cf. DisplayModel.cpp\r\n#define MAX_NAV_HISTORY_LEN 50\r\n\r\nvoid EbookController::AddNavPoint()\r\n{\r\n    int idx = currPageReparseIdx;\r\n    // remove the current and all Forward history entries\r\n    if (navHistoryIx < navHistory.Count())\r\n        navHistory.RemoveAt(navHistoryIx, navHistory.Count() - navHistoryIx);\r\n    // don't add another entry for the exact same position\r\n    if (navHistoryIx > 0 && idx == navHistory.At(navHistoryIx - 1))\r\n        return;\r\n    // make sure that the history doesn't grow overly large\r\n    if (navHistoryIx >= MAX_NAV_HISTORY_LEN) {\r\n        CrashIf(navHistoryIx > MAX_NAV_HISTORY_LEN);\r\n        navHistory.RemoveAt(0, navHistoryIx - MAX_NAV_HISTORY_LEN + 1);\r\n        navHistoryIx = MAX_NAV_HISTORY_LEN - 1;\r\n    }\r\n    // add a new Back history entry\r\n    navHistory.Append(idx);\r\n    navHistoryIx++;\r\n}\r\n\r\nbool EbookController::CanNavigate(int dir) const\r\n{\r\n    CrashIf(navHistoryIx > navHistory.Count());\r\n    if (dir < 0)\r\n        return navHistoryIx >= (size_t)-dir;\r\n    return navHistoryIx + dir < navHistory.Count();\r\n}\r\n\r\nvoid EbookController::Navigate(int dir)\r\n{\r\n    if (!CanNavigate(dir))\r\n        return;\r\n    // update the current history entry\r\n    int idx = currPageReparseIdx;\r\n    if (navHistoryIx < navHistory.Count())\r\n        navHistory.At(navHistoryIx) = idx;\r\n    else\r\n        navHistory.Append(idx);\r\n    navHistoryIx += dir;\r\n    idx = navHistory.At(navHistoryIx);\r\n    int pageNo = PageForReparsePoint(pages, idx);\r\n    if (0 == pageNo)\r\n        pageNo = GetMaxPageCount();\r\n    if (pageNo > 0)\r\n        GoToPage(pageNo, false);\r\n}\r\n\r\nvoid EbookController::CopyNavHistory(EbookController& orig)\r\n{\r\n    navHistory = orig.navHistory;\r\n    navHistoryIx = orig.navHistoryIx;\r\n}\r\n\r\nEbookController *EbookController::Create(Doc doc, HWND hwnd, ControllerCallback *cb, FrameRateWnd *frameRateWnd)\r\n{\r\n    EbookControls *ctrls = CreateEbookControls(hwnd, frameRateWnd);\r\n    if (!ctrls)\r\n        return nullptr;\r\n    return new EbookController(doc, ctrls, cb);\r\n}\r\n\r\n// not a destructor so that EbookFormattingData don't have to be exposed in EbookController.h\r\n// and so that EbookFormattingData::pages aren't always deleted (when ownership has been passed on)\r\nvoid EbookController::DeleteEbookFormattingData(EbookFormattingData *data)\r\n{\r\n    for (size_t i = 0; i < data->pageCount; i++) {\r\n        delete data->pages[i];\r\n    }\r\n    delete data;\r\n}\r\n"
  },
  {
    "path": "src/EbookController.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nstruct  DrawInstr;\r\nstruct  EbookControls;\r\nstruct  EbookFormattingData;\r\nstruct  FrameRateWnd;\r\n\r\nclass   EbookController;\r\nclass   EbookFormattingThread;\r\nclass   HtmlFormatter;\r\nclass   HtmlFormatterArgs;\r\nclass   HtmlPage;\r\n\r\nnamespace mui { class Control; }\r\nusing namespace mui;\r\n\r\nclass EbookController : public Controller\r\n{\r\npublic:\r\n    EbookController(Doc doc, EbookControls *ctrls, ControllerCallback *cb);\r\n    virtual ~EbookController();\r\n\r\n    virtual const WCHAR *FilePath() const { return doc.GetFilePath(); }\r\n    virtual const WCHAR *DefaultFileExt() const { return doc.GetDefaultFileExt(); }\r\n    virtual int PageCount() const { return GetMaxPageCount(); }\r\n    virtual WCHAR *GetProperty(DocumentProperty prop) { return doc.GetProperty(prop); }\r\n\r\n    virtual int CurrentPageNo() const { return currPageNo; }\r\n    virtual void GoToPage(int pageNo, bool addNavPoint);\r\n    virtual bool CanNavigate(int dir) const;\r\n    virtual void Navigate(int dir);\r\n\r\n    virtual void SetDisplayMode(DisplayMode mode, bool keepContinuous=false);\r\n    virtual DisplayMode GetDisplayMode() const { return IsDoublePage() ? DM_FACING : DM_SINGLE_PAGE; }\r\n    virtual void SetPresentationMode(bool enable) { UNUSED(enable); /* not supported */ }\r\n    virtual void SetZoomVirtual(float zoom, PointI *fixPt = nullptr) { UNUSED(zoom); UNUSED(fixPt); /* not supported */ }\r\n    virtual float GetZoomVirtual(bool absolute = false) const { UNUSED(absolute);  return 100; }\r\n    virtual float GetNextZoomStep(float towards) const { UNUSED(towards);  return 100; }\r\n    virtual void SetViewPortSize(SizeI size);\r\n\r\n    virtual bool HasTocTree() const { return doc.HasToc(); }\r\n    virtual DocTocItem *GetTocTree();\r\n    virtual void ScrollToLink(PageDestination *dest);\r\n    virtual PageDestination *GetNamedDest(const WCHAR *name);\r\n\r\n    virtual void UpdateDisplayState(DisplayState *ds);\r\n    virtual void CreateThumbnail(SizeI size, const std::function<void(RenderedBitmap*)>&);\r\n\r\n    virtual bool GoToNextPage();\r\n    virtual bool GoToPrevPage(bool toBottom=false);\r\n\r\n    virtual EbookController *AsEbook() { return this; }\r\n\r\npublic:\r\n    // the following is specific to EbookController\r\n\r\n    DocType GetDocType() const { return doc.Type(); }\r\n    LRESULT HandleMessage(UINT msg, WPARAM wParam, LPARAM lParam, bool& wasHandled);\r\n    void EnableMessageHandling(bool enable) { handleMsgs = enable; }\r\n    void UpdateDocumentColors();\r\n    void RequestRepaint();\r\n    void HandlePagesFromEbookLayout(EbookFormattingData *ebookLayout);\r\n    void TriggerLayout();\r\n    void StartLayouting(int startReparseIdxArg=-1, DisplayMode displayMode=DM_AUTOMATIC);\r\n    int  ResolvePageAnchor(const WCHAR *id);\r\n    void CopyNavHistory(EbookController& orig);\r\n    int  CurrentTocPageNo() const;\r\n\r\n    // call StartLayouting before using this EbookController\r\n    static EbookController *Create(Doc doc, HWND hwnd, ControllerCallback *cb, FrameRateWnd *);\r\n\r\n    static void DeleteEbookFormattingData(EbookFormattingData *data);\r\n\r\nprotected:\r\n\r\n    EbookControls * ctrls;\r\n\r\n    Doc             doc;\r\n\r\n    // TODO: this should be recycled along with pages so that its\r\n    // memory use doesn't grow without bounds\r\n    PoolAllocator   textAllocator;\r\n\r\n    Vec<HtmlPage*> *    pages;\r\n\r\n    // pages being sent from background formatting thread\r\n    Vec<HtmlPage*> *    incomingPages;\r\n\r\n    // currPageNo is in range 1..$numberOfPages.\r\n    int             currPageNo;\r\n    // reparseIdx of the current page (the first one if we're showing 2)\r\n    int             currPageReparseIdx;\r\n\r\n    // size of the page for which pages were generated\r\n    SizeI           pageSize;\r\n\r\n    EbookFormattingThread * formattingThread;\r\n    int                     formattingThreadNo;\r\n\r\n    // whether HandleMessage passes messages on to ctrls->mainWnd\r\n    bool            handleMsgs;\r\n\r\n    // parallel lists mapping anchor IDs to reparseIdxs\r\n    WStrVec *   pageAnchorIds;\r\n    Vec<int> *  pageAnchorIdxs;\r\n\r\n    Vec<int>    navHistory;\r\n    size_t      navHistoryIx;\r\n\r\n    Vec<HtmlPage*> *GetPages();\r\n    void        UpdateStatus();\r\n    bool        FormattingInProgress() const { return formattingThread != nullptr; }\r\n    void        StopFormattingThread();\r\n    void        CloseCurrentDocument();\r\n    int         GetMaxPageCount() const;\r\n    bool        IsDoublePage() const;\r\n    void        ExtractPageAnchors();\r\n    void        AddNavPoint();\r\n    void        OnClickedLink(int pageNo, DrawInstr *link);\r\n\r\n    // event handlers\r\n    void        ClickedNext(Control *c, int x, int y);\r\n    void        ClickedPrev(Control *c, int x, int y);\r\n    void        ClickedProgress(Control *c, int x, int y);\r\n    void        SizeChangedPage(Control *c, int dx, int dy);\r\n    void        ClickedPage1(Control *c, int x, int y);\r\n    void        ClickedPage2(Control *c, int x, int y);\r\n};\r\n\r\nHtmlFormatterArgs *CreateFormatterArgsDoc(Doc doc, int dx, int dy, Allocator *textAllocator=nullptr);\r\n"
  },
  {
    "path": "src/EbookControls.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"BitManip.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"Mui.h\"\r\n#include \"SerializeTxt.h\"\r\n#include \"StrSlice.h\"\r\n#include \"Timer.h\"\r\n#include \"TrivialHtmlParser.h\"\r\n#include \"TxtParser.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"EbookBase.h\"\r\n#include \"HtmlFormatter.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"resource.h\"\r\n#include \"EbookControls.h\"\r\n#include \"MuiEbookPageDef.h\"\r\n#include \"PagesLayoutDef.h\"\r\n#define NOLOG 1\r\n#include \"DebugLog.h\"\r\n\r\nPageControl::PageControl() : page(nullptr), cursorX(-1), cursorY(-1)\r\n{\r\n    bit::Set(wantedInputBits, WantsMouseMoveBit, WantsMouseClickBit);\r\n}\r\n\r\nPageControl::~PageControl()\r\n{\r\n    if (toolTip) {\r\n        // TODO: make Control's destructor clear the tooltip?\r\n        Control::NotifyMouseLeave();\r\n    }\r\n}\r\n\r\nvoid PageControl::SetPage(HtmlPage *newPage)\r\n{\r\n    page = newPage;\r\n    RequestRepaint(this);\r\n}\r\n\r\nDrawInstr *PageControl::GetLinkAt(int x, int y) const\r\n{\r\n    if (!page)\r\n        return nullptr;\r\n\r\n    PointF pt((REAL)(x - cachedStyle->padding.left), (REAL)(y - cachedStyle->padding.top));\r\n    for (DrawInstr& i : page->instructions) {\r\n        if (InstrLinkStart == i.type && !i.bbox.IsEmptyArea() && i.bbox.Contains(pt)) {\r\n            return &i;\r\n        }\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nvoid PageControl::NotifyMouseMove(int x, int y)\r\n{\r\n    DrawInstr *link = GetLinkAt(x, y);\r\n    if (!link) {\r\n        SetCursor(IDC_ARROW);\r\n        if (toolTip) {\r\n            Control::NotifyMouseLeave();\r\n            str::ReplacePtr(&toolTip, nullptr);\r\n        }\r\n        return;\r\n    }\r\n\r\n    SetCursor(IDC_HAND);\r\n    ScopedMem<WCHAR> url(str::conv::FromHtmlUtf8(link->str.s, link->str.len));\r\n    if (toolTip && (!url::IsAbsolute(url) || !str::Eq(toolTip, url))) {\r\n        Control::NotifyMouseLeave();\r\n        str::ReplacePtr(&toolTip, nullptr);\r\n    }\r\n    if (!toolTip && url::IsAbsolute(url)) {\r\n        toolTip = url.StealData();\r\n        Control::NotifyMouseEnter();\r\n    }\r\n}\r\n\r\n// size of the drawable area i.e. size minus padding\r\nSize PageControl::GetDrawableSize() const\r\n{\r\n    Size s;\r\n    pos.GetSize(&s);\r\n    Padding pad = cachedStyle->padding;\r\n    s.Width  -= (pad.left + pad.right);\r\n    s.Height -= (pad.top + pad.bottom);\r\n    if ((s.Width <= 0) || (s.Height <= 0))\r\n        return Size();\r\n    return s;\r\n}\r\n\r\nvoid PageControl::Paint(Graphics *gfx, int offX, int offY)\r\n{\r\n    CrashIf(!IsVisible());\r\n\r\n    Timer timerAll;\r\n\r\n    CachedStyle *s = cachedStyle;\r\n    Timer timerFill;\r\n    Rect r(offX, offY, pos.Width, pos.Height);\r\n    if (!s->bgColor->IsTransparent()) {\r\n        Brush *br = BrushFromColorData(s->bgColor, r);\r\n        gfx->FillRectangle(br, r);\r\n    }\r\n    double durFill = timerFill.Stop();\r\n\r\n    if (!page)\r\n        return;\r\n\r\n    // during resize the page we currently show might be bigger than\r\n    // our area. To avoid drawing outside our area we clip\r\n    Region origClipRegion;\r\n    gfx->GetClip(&origClipRegion);\r\n    r.X += s->padding.left;\r\n    r.Y += s->padding.top;\r\n    r.Width  -= (s->padding.left + s->padding.right);\r\n    r.Height -= (s->padding.top  + s->padding.bottom);\r\n    r.Inflate(1,0);\r\n    gfx->SetClip(r, CombineModeReplace);\r\n\r\n    COLORREF txtCol, bgCol;\r\n    GetEbookUiColors(txtCol, bgCol);\r\n    Color textColor, bgColor;\r\n    textColor.SetFromCOLORREF(txtCol);\r\n\r\n    ITextRender *textRender = CreateTextRender(GetTextRenderMethod(), gfx, pos.Width, pos.Height);\r\n    //ITextRender *textRender = CreateTextRender(TextRenderMethodHdc, gfx, pos.Width, pos.Height);\r\n\r\n    bgColor.SetFromCOLORREF(bgCol);\r\n    textRender->SetTextBgColor(bgColor);\r\n\r\n    Timer timerDrawHtml;\r\n    DrawHtmlPage(gfx, textRender, &page->instructions, (REAL)r.X, (REAL)r.Y, IsDebugPaint(), textColor);\r\n    double durDraw = timerDrawHtml.Stop();\r\n    gfx->SetClip(&origClipRegion, CombineModeReplace);\r\n    delete textRender;\r\n\r\n    double durAll = timerAll.Stop();\r\n    lf(\"all: %.2f, fill: %.2f, draw html: %.2f\", durAll, durFill, durDraw);\r\n}\r\n\r\nControl *CreatePageControl(TxtNode *structDef)\r\n{\r\n    CrashIf(!structDef->IsStructWithName(\"EbookPage\"));\r\n    EbookPageDef *def = DeserializeEbookPageDef(structDef);\r\n    PageControl *c = new PageControl();\r\n    Style *style = StyleByName(def->style);\r\n    c->SetStyle(style);\r\n\r\n    if (def->name)\r\n        c->SetName(def->name);\r\n\r\n    FreeEbookPageDef(def);\r\n    return c;\r\n}\r\n\r\nILayout *CreatePagesLayout(ParsedMui *parsedMui, TxtNode *structDef)\r\n{\r\n    CrashIf(!structDef->IsStructWithName(\"PagesLayout\"));\r\n    PagesLayoutDef *def = DeserializePagesLayoutDef(structDef);\r\n    CrashIf(!def->page1 || !def->page2);\r\n    PageControl *page1 = static_cast<PageControl*>(FindControlNamed(*parsedMui, def->page1));\r\n    PageControl *page2 = static_cast<PageControl*>(FindControlNamed(*parsedMui, def->page2));\r\n    CrashIf(!page1 || !page2);\r\n    PagesLayout *layout = new PagesLayout(page1, page2, def->spaceDx);\r\n    if (def->name)\r\n        layout->SetName(def->name);\r\n    FreePagesLayoutDef(def);\r\n    return layout;\r\n}\r\n\r\nvoid SetMainWndBgCol(EbookControls *ctrls)\r\n{\r\n    COLORREF txtColor, bgColor;\r\n    GetEbookUiColors(txtColor, bgColor);\r\n\r\n    Style *styleMainWnd = StyleByName(\"styleMainWnd\");\r\n    CrashIf(!styleMainWnd);\r\n    styleMainWnd->Set(Prop::AllocColorSolid(PropBgColor, GetRValueSafe(bgColor), GetGValueSafe(bgColor), GetBValueSafe(bgColor)));\r\n    ctrls->mainWnd->SetStyle(styleMainWnd);\r\n\r\n    Style *styleStatus = StyleByName(\"styleStatus\");\r\n    styleStatus->Set(Prop::AllocColorSolid(PropBgColor, GetRValueSafe(bgColor), GetGValueSafe(bgColor), GetBValueSafe(bgColor)));\r\n    ctrls->status->SetStyle(styleStatus);\r\n\r\n    // TODO: should also allow to change text color\r\n    // TODO: also match the colors of progress bar to be based on background color\r\n    // TODO: update tab color\r\n\r\n    // note: callers are expected to update the background of tree control and\r\n    // other colors that are supposed to match background color\r\n}\r\n\r\nEbookControls *CreateEbookControls(HWND hwnd, FrameRateWnd *frameRateWnd)\r\n{\r\n    static bool wasRegistered = false;\r\n    if (!wasRegistered) {\r\n        RegisterControlCreatorFor(\"EbookPage\", &CreatePageControl);\r\n        RegisterLayoutCreatorFor(\"PagesLayout\", &CreatePagesLayout);\r\n        wasRegistered = true;\r\n    }\r\n\r\n    ParsedMui *muiDef = new ParsedMui();\r\n    char *s = LoadTextResource(IDD_EBOOK_WIN_DESC);\r\n    MuiFromText(s, *muiDef);\r\n    free(s);\r\n\r\n    EbookControls *ctrls = new EbookControls;\r\n    ctrls->muiDef = muiDef;\r\n    CrashIf(!FindButtonVectorNamed(*muiDef, \"nextButton\"));\r\n    CrashIf(!FindButtonVectorNamed(*muiDef, \"prevButton\"));\r\n    ctrls->status = FindButtonNamed(*muiDef, \"statusButton\");\r\n    CrashIf(!ctrls->status);\r\n    ctrls->progress = FindScrollBarNamed(*muiDef, \"progressScrollBar\");\r\n    CrashIf(!ctrls->progress);\r\n    ctrls->progress->hCursor = GetCursor(IDC_HAND);\r\n\r\n    ctrls->topPart = FindLayoutNamed(*muiDef, \"top\");\r\n    CrashIf(!ctrls->topPart);\r\n    ctrls->pagesLayout = static_cast<PagesLayout*>(FindLayoutNamed(*muiDef, \"pagesLayout\"));\r\n    CrashIf(!ctrls->pagesLayout);\r\n\r\n    ctrls->mainWnd = new HwndWrapper(hwnd);\r\n    ctrls->mainWnd->frameRateWnd = frameRateWnd;\r\n    ctrls->mainWnd->SetMinSize(Size(320, 200));\r\n\r\n    SetMainWndBgCol(ctrls);\r\n    ctrls->mainWnd->layout = FindLayoutNamed(*muiDef, \"mainLayout\");\r\n    CrashIf(!ctrls->mainWnd->layout);\r\n\r\n    for (size_t i = 0; i < muiDef->allControls.Count(); i++) {\r\n        Control *c = muiDef->allControls.At(i);\r\n        ctrls->mainWnd->AddChild(c);\r\n    }\r\n    return ctrls;\r\n}\r\n\r\nvoid DestroyEbookControls(EbookControls* ctrls)\r\n{\r\n    delete ctrls->mainWnd;\r\n    delete ctrls->topPart;\r\n    delete ctrls->pagesLayout;\r\n    delete ctrls->muiDef;\r\n    delete ctrls;\r\n}\r\n\r\nSize PagesLayout::Measure(const Size availableSize)\r\n{\r\n    desiredSize = availableSize;\r\n    return desiredSize;\r\n}\r\n\r\nvoid PagesLayout::Arrange(const Rect finalRect)\r\n{\r\n    // only page2 can be hidden\r\n    CrashIf(!page1->IsVisible());\r\n\r\n    // if only page1 visible, give it the whole area\r\n    if (!page2->IsVisible()) {\r\n        page1->Arrange(finalRect);\r\n        return;\r\n    }\r\n\r\n    // when both visible, give them equally sized areas\r\n    // with spaceDx between them\r\n    int dx = finalRect.Width;\r\n    if (page2->IsVisible()) {\r\n        dx = (dx / 2) - spaceDx;\r\n        // protect against excessive spaceDx values\r\n        if (dx <= 100) {\r\n            spaceDx = 0;\r\n            dx = dx /2;\r\n            CrashIf(dx < 10);\r\n        }\r\n    }\r\n    Rect r = finalRect;\r\n    r.Width = dx;\r\n    page1->Arrange(r);\r\n    r.X = r.X + dx + spaceDx;\r\n    page2->Arrange(r);\r\n}\r\n"
  },
  {
    "path": "src/EbookControls.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nstruct FrameRateWnd;\r\n\r\nclass HtmlFormatter;\r\nclass HtmlFormatterArgs;\r\nclass PageControl;\r\nclass PagesLayout;\r\nusing namespace mui;\r\n\r\n// controls managed by EbookController\r\nstruct EbookControls {\r\n    ParsedMui *         muiDef;\r\n    HwndWrapper *       mainWnd;\r\n\r\n    ScrollBar *         progress;\r\n    Button *            status;\r\n    ILayout *           topPart;\r\n    PagesLayout *       pagesLayout;\r\n};\r\n\r\nEbookControls * CreateEbookControls(HWND hwnd, FrameRateWnd *);\r\nvoid            DestroyEbookControls(EbookControls* controls);\r\nvoid            SetMainWndBgCol(EbookControls *ctrls);\r\n\r\nclass HtmlPage;\r\nstruct DrawInstr;\r\n\r\n// control that shows a single ebook page\r\n// TODO: move to a separate file\r\nclass PageControl : public Control\r\n{\r\n    HtmlPage *  page;\r\n    int         cursorX, cursorY;\r\n\r\npublic:\r\n    PageControl();\r\n    virtual ~PageControl();\r\n\r\n    void      SetPage(HtmlPage *newPage);\r\n    HtmlPage* GetPage() const { return page; }\r\n\r\n    Size GetDrawableSize() const;\r\n    DrawInstr *GetLinkAt(int x, int y) const;\r\n\r\n    virtual void Paint(Graphics *gfx, int offX, int offY);\r\n\r\n    virtual void NotifyMouseMove(int x, int y);\r\n};\r\n\r\n// PagesLayout is for 2 controls separated with a space:\r\n// [ ctrl1 ][ spaceDx ][ ctrl2]\r\n// It sets the size of child controls to fit within its space\r\n// One of the controls can be hidden, in which case it takes\r\n// all the space\r\nclass PagesLayout : public ILayout\r\n{\r\nprotected:\r\n    Size                       desiredSize;\r\n    PageControl *              page1;\r\n    PageControl *              page2;\r\n    int                        spaceDx;\r\n\r\npublic:\r\n    PagesLayout(PageControl *p1, PageControl *p2, int dx = 8) {\r\n        page1 = p1;\r\n        page2 = p2;\r\n        CrashIf(dx < 0);\r\n        spaceDx = dx;\r\n    }\r\n    virtual ~PagesLayout() { }\r\n    virtual Size DesiredSize() { return desiredSize; }\r\n\r\n    virtual Size Measure(const Size availableSize);\r\n    virtual void Arrange(const Rect finalRect);\r\n\r\n    PageControl *GetPage1() const { return page1; }\r\n    PageControl *GetPage2() const { return page2; }\r\n    void SetSpaceDx(int dx) {\r\n        spaceDx = dx;\r\n        // TODO: trigger re-layout ?\r\n    }\r\n    int GetSpaceDx() const { return spaceDx; }\r\n};\r\n"
  },
  {
    "path": "src/EbookDoc.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"ArchUtil.h\"\r\n#include \"FileUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"HtmlPullParser.h\"\r\n#include \"PalmDbReader.h\"\r\n#include \"TrivialHtmlParser.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EbookBase.h\"\r\n#include \"EbookDoc.h\"\r\n#include \"MobiDoc.h\"\r\n\r\n// tries to extract an encoding from <?xml encoding=\"...\"?>\r\n// returns CP_ACP on failure\r\nstatic UINT GetCodepageFromPI(const char *xmlPI)\r\n{\r\n    if (!str::StartsWith(xmlPI, \"<?xml\"))\r\n        return CP_ACP;\r\n    const char *xmlPIEnd = str::Find(xmlPI, \"?>\");\r\n    if (!xmlPIEnd)\r\n        return CP_ACP;\r\n    HtmlToken pi;\r\n    pi.SetTag(HtmlToken::EmptyElementTag, xmlPI + 2, xmlPIEnd);\r\n    pi.nLen = 4;\r\n    AttrInfo *enc = pi.GetAttrByName(\"encoding\");\r\n    if (!enc)\r\n        return CP_ACP;\r\n\r\n    ScopedMem<char> encoding(str::DupN(enc->val, enc->valLen));\r\n    struct {\r\n        const char *namePart;\r\n        UINT codePage;\r\n    } encodings[] = {\r\n        { \"UTF\", CP_UTF8 }, { \"utf\", CP_UTF8 },\r\n        { \"1252\", 1252 }, { \"1251\", 1251 },\r\n        // TODO: any other commonly used codepages?\r\n    };\r\n    for (size_t i = 0; i < dimof(encodings); i++) {\r\n        if (str::Find(encoding, encodings[i].namePart))\r\n            return encodings[i].codePage;\r\n    }\r\n    return CP_ACP;\r\n}\r\n\r\nstatic bool IsValidUtf8(const char *string)\r\n{\r\n    for (const unsigned char *s = (const unsigned char *)string; *s; s++) {\r\n        int skip;\r\n        if (*s < 0x80)\r\n            skip = 0;\r\n        else if (*s < 0xC0)\r\n            return false;\r\n        else if (*s < 0xE0)\r\n            skip = 1;\r\n        else if (*s < 0xF0)\r\n            skip = 2;\r\n        else if (*s < 0xF5)\r\n            skip = 3;\r\n        else\r\n            return false;\r\n        while (skip-- > 0) {\r\n            if ((*++s & 0xC0) != 0x80)\r\n                return false;\r\n        }\r\n    }\r\n    return true;\r\n}\r\n\r\nstatic char *DecodeTextToUtf8(const char *s, bool isXML=false)\r\n{\r\n    ScopedMem<char> tmp;\r\n    if (str::StartsWith(s, UTF16BE_BOM)) {\r\n        size_t byteCount = (str::Len((WCHAR *)s) + 1) * sizeof(WCHAR);\r\n        tmp.Set((char *)memdup(s, byteCount));\r\n        for (size_t i = 0; i + 1 < byteCount; i += 2) {\r\n            std::swap(tmp[i], tmp[i+1]);\r\n        }\r\n        s = tmp;\r\n    }\r\n    if (str::StartsWith(s, UTF16_BOM))\r\n        return str::conv::ToUtf8((WCHAR *)(s + 2));\r\n    if (str::StartsWith(s, UTF8_BOM))\r\n        return str::Dup(s + 3);\r\n    UINT codePage = isXML ? GetCodepageFromPI(s) : CP_ACP;\r\n    if (CP_ACP == codePage && IsValidUtf8(s))\r\n        return str::Dup(s);\r\n    if (CP_ACP == codePage)\r\n        codePage = GuessTextCodepage(s, str::Len(s), CP_ACP);\r\n    return str::ToMultiByte(s, codePage, CP_UTF8);\r\n}\r\n\r\nchar *NormalizeURL(const char *url, const char *base)\r\n{\r\n    CrashIf(!url || !base);\r\n    if (*url == '/' || str::FindChar(url, ':'))\r\n        return str::Dup(url);\r\n\r\n    const char *baseEnd = str::FindCharLast(base, '/');\r\n    const char *hash = str::FindChar(base, '#');\r\n    if (*url == '#') {\r\n        baseEnd = hash ? hash - 1 : base + str::Len(base) - 1;\r\n    }\r\n    else if (baseEnd && hash && hash < baseEnd) {\r\n        for (baseEnd = hash - 1; baseEnd > base && *baseEnd != '/'; baseEnd--);\r\n    }\r\n    if (baseEnd)\r\n        baseEnd++;\r\n    else\r\n        baseEnd = base;\r\n    ScopedMem<char> basePath(str::DupN(base, baseEnd - base));\r\n    ScopedMem<char> norm(str::Join(basePath, url));\r\n\r\n    char *dst = norm;\r\n    for (char *src = norm; *src; src++) {\r\n        if (*src != '/')\r\n            *dst++ = *src;\r\n        else if (str::StartsWith(src, \"/./\"))\r\n            src++;\r\n        else if (str::StartsWith(src, \"/../\")) {\r\n            for (; dst > norm && *(dst - 1) != '/'; dst--);\r\n            src += 3;\r\n        }\r\n        else\r\n            *dst++ = '/';\r\n    }\r\n    *dst = '\\0';\r\n    return norm.StealData();\r\n}\r\n\r\ninline char decode64(char c)\r\n{\r\n    if ('A' <= c && c <= 'Z')\r\n        return c - 'A';\r\n    if ('a' <= c && c <= 'z')\r\n        return c - 'a' + 26;\r\n    if ('0' <= c && c <= '9')\r\n        return c - '0' + 52;\r\n    if ('+' == c)\r\n        return 62;\r\n    if ('/' == c)\r\n        return 63;\r\n    return -1;\r\n}\r\n\r\nstatic char *Base64Decode(const char *s, size_t sLen, size_t *lenOut)\r\n{\r\n    const char *end = s + sLen;\r\n    char *result = AllocArray<char>(sLen * 3 / 4);\r\n    char *curr = result;\r\n    unsigned char c = 0;\r\n    int step = 0;\r\n    for (; s < end && *s != '='; s++) {\r\n        char n = decode64(*s);\r\n        if (-1 == n) {\r\n            if (str::IsWs(*s))\r\n                continue;\r\n            free(result);\r\n            return nullptr;\r\n        }\r\n        switch (step++ % 4) {\r\n        case 0: c = n; break;\r\n        case 1: *curr++ = (c << 2) | (n >> 4); c = n & 0xF; break;\r\n        case 2: *curr++ = (c << 4) | (n >> 2); c = n & 0x3; break;\r\n        case 3: *curr++ = (c << 6) | (n >> 0); break;\r\n        }\r\n    }\r\n    if (lenOut)\r\n        *lenOut = curr - result;\r\n    return result;\r\n}\r\n\r\nstatic inline void AppendChar(str::Str<char>& htmlData, char c)\r\n{\r\n    switch (c) {\r\n    case '&': htmlData.Append(\"&amp;\"); break;\r\n    case '<': htmlData.Append(\"&lt;\"); break;\r\n    case '\"': htmlData.Append(\"&quot;\"); break;\r\n    default:  htmlData.Append(c); break;\r\n    }\r\n}\r\n\r\nstatic char *DecodeDataURI(const char *url, size_t *lenOut)\r\n{\r\n    const char *comma = str::FindChar(url, ',');\r\n    if (!comma)\r\n        return nullptr;\r\n    const char *data = comma + 1;\r\n    if (comma - url >= 12 && str::EqN(comma - 7, \";base64\", 7))\r\n        return Base64Decode(data, str::Len(data), lenOut);\r\n    if (lenOut)\r\n        *lenOut = str::Len(data);\r\n    return str::Dup(data);\r\n}\r\n\r\nint PropertyMap::Find(DocumentProperty prop) const\r\n{\r\n    if (0 <= prop && prop < dimof(values))\r\n        return prop;\r\n    return -1;\r\n}\r\n\r\nvoid PropertyMap::Set(DocumentProperty prop, char *valueUtf8, bool replace)\r\n{\r\n    int idx = Find(prop);\r\n    CrashIf(-1 == idx);\r\n    if (-1 == idx || !replace && values[idx])\r\n        free(valueUtf8);\r\n    else\r\n        values[idx].Set(valueUtf8);\r\n}\r\n\r\nWCHAR *PropertyMap::Get(DocumentProperty prop) const\r\n{\r\n    int idx = Find(prop);\r\n    if (idx >= 0 && values[idx])\r\n        return str::conv::FromUtf8(values[idx]);\r\n    return nullptr;\r\n}\r\n\r\n/* ********** EPUB ********** */\r\n\r\nconst char *EPUB_CONTAINER_NS = \"urn:oasis:names:tc:opendocument:xmlns:container\";\r\nconst char *EPUB_OPF_NS = \"http://www.idpf.org/2007/opf\";\r\nconst char *EPUB_NCX_NS = \"http://www.daisy.org/z3986/2005/ncx/\";\r\nconst char *EPUB_ENC_NS = \"http://www.w3.org/2001/04/xmlenc#\";\r\n\r\nEpubDoc::EpubDoc(const WCHAR *fileName) :\r\n    zip(fileName, true), fileName(str::Dup(fileName)),\r\n    isNcxToc(false), isRtlDoc(false) {\r\n    InitializeCriticalSection(&zipAccess);\r\n}\r\n\r\nEpubDoc::EpubDoc(IStream *stream) :\r\n    zip(stream, true), fileName(nullptr),\r\n    isNcxToc(false), isRtlDoc(false) {\r\n    InitializeCriticalSection(&zipAccess);\r\n}\r\n\r\nEpubDoc::~EpubDoc()\r\n{\r\n    EnterCriticalSection(&zipAccess);\r\n\r\n    for (size_t i = 0; i < images.Count(); i++) {\r\n        free(images.At(i).base.data);\r\n        free(images.At(i).id);\r\n    }\r\n\r\n    LeaveCriticalSection(&zipAccess);\r\n    DeleteCriticalSection(&zipAccess);\r\n}\r\n\r\nbool EpubDoc::Load()\r\n{\r\n    ScopedMem<char> container(zip.GetFileDataByName(L\"META-INF/container.xml\"));\r\n    if (!container)\r\n        return false;\r\n    HtmlParser parser;\r\n    HtmlElement *node = parser.ParseInPlace(container);\r\n    if (!node)\r\n        return false;\r\n    // only consider the first <rootfile> element (default rendition)\r\n    node = parser.FindElementByNameNS(\"rootfile\", EPUB_CONTAINER_NS);\r\n    if (!node)\r\n        return false;\r\n    ScopedMem<WCHAR> contentPath(node->GetAttribute(\"full-path\"));\r\n    if (!contentPath)\r\n        return false;\r\n    url::DecodeInPlace(contentPath);\r\n\r\n    // encrypted files will be ignored (TODO: support decryption)\r\n    WStrList encList;\r\n    ScopedMem<char> encryption(zip.GetFileDataByName(L\"META-INF/encryption.xml\"));\r\n    if (encryption) {\r\n        (void)parser.ParseInPlace(encryption);\r\n        HtmlElement *cr = parser.FindElementByNameNS(\"CipherReference\", EPUB_ENC_NS);\r\n        while (cr) {\r\n            WCHAR *uri = cr->GetAttribute(\"URI\");\r\n            if (uri) {\r\n                url::DecodeInPlace(uri);\r\n                encList.Append(uri);\r\n            }\r\n            cr = parser.FindElementByNameNS(\"CipherReference\", EPUB_ENC_NS, cr);\r\n        }\r\n    }\r\n\r\n    ScopedMem<char> content(zip.GetFileDataByName(contentPath));\r\n    if (!content)\r\n        return false;\r\n    ParseMetadata(content);\r\n    node = parser.ParseInPlace(content);\r\n    if (!node)\r\n        return false;\r\n    node = parser.FindElementByNameNS(\"manifest\", EPUB_OPF_NS);\r\n    if (!node)\r\n        return false;\r\n\r\n    WCHAR *slashPos = str::FindCharLast(contentPath, '/');\r\n    if (slashPos)\r\n        *(slashPos + 1) = '\\0';\r\n    else\r\n        *contentPath = '\\0';\r\n\r\n    WStrList idList, pathList;\r\n\r\n    for (node = node->down; node; node = node->next) {\r\n        ScopedMem<WCHAR> mediatype(node->GetAttribute(\"media-type\"));\r\n        if (str::Eq(mediatype, L\"image/png\")  ||\r\n            str::Eq(mediatype, L\"image/jpeg\") ||\r\n            str::Eq(mediatype, L\"image/gif\")) {\r\n            ScopedMem<WCHAR> imgPath(node->GetAttribute(\"href\"));\r\n            if (!imgPath)\r\n                continue;\r\n            url::DecodeInPlace(imgPath);\r\n            imgPath.Set(str::Join(contentPath, imgPath));\r\n            if (encList.Contains(imgPath))\r\n                continue;\r\n            // load the image lazily\r\n            ImageData2 data = { 0 };\r\n            data.id = str::conv::ToUtf8(imgPath);\r\n            data.idx = zip.GetFileIndex(imgPath);\r\n            images.Append(data);\r\n        }\r\n        else if (str::Eq(mediatype, L\"application/xhtml+xml\") ||\r\n                 str::Eq(mediatype, L\"application/html+xml\") ||\r\n                 str::Eq(mediatype, L\"application/x-dtbncx+xml\") ||\r\n                 str::Eq(mediatype, L\"text/html\") ||\r\n                 str::Eq(mediatype, L\"text/xml\")) {\r\n            ScopedMem<WCHAR> htmlPath(node->GetAttribute(\"href\"));\r\n            if (!htmlPath)\r\n                continue;\r\n            url::DecodeInPlace(htmlPath);\r\n            ScopedMem<WCHAR> htmlId(node->GetAttribute(\"id\"));\r\n            // EPUB 3 ToC\r\n            ScopedMem<WCHAR> properties(node->GetAttribute(\"properties\"));\r\n            if (properties && str::Find(properties, L\"nav\") && str::Eq(mediatype, L\"application/xhtml+xml\"))\r\n                tocPath.Set(str::Join(contentPath, htmlPath));\r\n            if (encList.Count() > 0 && encList.Contains(ScopedMem<WCHAR>(str::Join(contentPath, htmlPath))))\r\n                continue;\r\n            if (htmlPath && htmlId) {\r\n                idList.Append(htmlId.StealData());\r\n                pathList.Append(htmlPath.StealData());\r\n            }\r\n        }\r\n    }\r\n\r\n    node = parser.FindElementByNameNS(\"spine\", EPUB_OPF_NS);\r\n    if (!node)\r\n        return false;\r\n    // EPUB 2 ToC\r\n    ScopedMem<WCHAR> tocId(node->GetAttribute(\"toc\"));\r\n    if (tocId && !tocPath && idList.Contains(tocId)) {\r\n        tocPath.Set(str::Join(contentPath, pathList.At(idList.Find(tocId))));\r\n        isNcxToc = true;\r\n    }\r\n    ScopedMem<WCHAR> readingDir(node->GetAttribute(\"page-progression-direction\"));\r\n    if (readingDir)\r\n        isRtlDoc = str::EqI(readingDir, L\"rtl\");\r\n\r\n    for (node = node->down; node; node = node->next) {\r\n        if (!node->NameIsNS(\"itemref\", EPUB_OPF_NS))\r\n            continue;\r\n        ScopedMem<WCHAR> idref(node->GetAttribute(\"idref\"));\r\n        if (!idref || !idList.Contains(idref))\r\n            continue;\r\n\r\n        ScopedMem<WCHAR> fullPath(str::Join(contentPath, pathList.At(idList.Find(idref))));\r\n        ScopedMem<char> html(zip.GetFileDataByName(fullPath));\r\n        if (!html)\r\n            continue;\r\n        html.Set(DecodeTextToUtf8(html, true));\r\n        if (!html)\r\n            continue;\r\n        // insert explicit page-breaks between sections including\r\n        // an anchor with the file name at the top (for internal links)\r\n        ScopedMem<char> utf8_path(str::conv::ToUtf8(fullPath));\r\n        CrashIfDebugOnly(str::FindChar(utf8_path, '\"'));\r\n        str::TransChars(utf8_path, \"\\\"\", \"'\");\r\n        htmlData.AppendFmt(\"<pagebreak page_path=\\\"%s\\\" page_marker />\", utf8_path.Get());\r\n        htmlData.Append(html);\r\n    }\r\n\r\n    return htmlData.Count() > 0;\r\n}\r\n\r\nvoid EpubDoc::ParseMetadata(const char *content)\r\n{\r\n    struct {\r\n        DocumentProperty prop;\r\n        const char *name;\r\n    } metadataMap[] = {\r\n        { Prop_Title,           \"dc:title\" },\r\n        { Prop_Author,          \"dc:creator\" },\r\n        { Prop_CreationDate,    \"dc:date\" },\r\n        { Prop_ModificationDate,\"dcterms:modified\" },\r\n        { Prop_Subject,         \"dc:description\" },\r\n        { Prop_Copyright,       \"dc:rights\" },\r\n    };\r\n\r\n    HtmlPullParser pullParser(content, str::Len(content));\r\n    int insideMetadata = 0;\r\n    HtmlToken *tok;\r\n\r\n    while ((tok = pullParser.Next()) != nullptr) {\r\n        if (tok->IsStartTag() && tok->NameIsNS(\"metadata\", EPUB_OPF_NS))\r\n            insideMetadata++;\r\n        else if (tok->IsEndTag() && tok->NameIsNS(\"metadata\", EPUB_OPF_NS))\r\n            insideMetadata--;\r\n        if (!insideMetadata)\r\n            continue;\r\n        if (!tok->IsStartTag())\r\n            continue;\r\n\r\n        for (int i = 0; i < dimof(metadataMap); i++) {\r\n            // TODO: implement proper namespace support\r\n            if (tok->NameIs(metadataMap[i].name) ||\r\n                Tag_Meta == tok->tag && tok->GetAttrByName(\"property\") &&\r\n                tok->GetAttrByName(\"property\")->ValIs(metadataMap[i].name)) {\r\n                tok = pullParser.Next();\r\n                if (tok && tok->IsText())\r\n                    props.Set(metadataMap[i].prop, ResolveHtmlEntities(tok->s, tok->sLen));\r\n                break;\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\nconst char *EpubDoc::GetHtmlData(size_t *lenOut) const\r\n{\r\n    *lenOut = htmlData.Size();\r\n    return htmlData.Get();\r\n}\r\n\r\nsize_t EpubDoc::GetHtmlDataSize() const\r\n{\r\n    return htmlData.Size();\r\n}\r\n\r\nImageData *EpubDoc::GetImageData(const char *id, const char *pagePath)\r\n{\r\n    ScopedCritSec scope(&zipAccess);\r\n\r\n    if (!pagePath) {\r\n        CrashIf(true);\r\n        // if we're reparsing, we might not have pagePath, which is needed to\r\n        // build the exact url so try to find a partial match\r\n        // TODO: the correct approach would be to extend reparseIdx into a\r\n        // struct ReparseData, which would include pagePath and all other\r\n        // styling related state (such as nextPageStyle, listDepth, etc. including\r\n        // format specific state such as hiddenDepth and titleCount) and store it\r\n        // in every HtmlPage, but this should work well enough for now\r\n        for (size_t i = 0; i < images.Count(); i++) {\r\n            ImageData2 *img = &images.At(i);\r\n            if (str::EndsWithI(img->id, id)) {\r\n                if (!img->base.data)\r\n                    img->base.data = zip.GetFileDataByIdx(img->idx, &img->base.len);\r\n                if (img->base.data)\r\n                    return &img->base;\r\n            }\r\n        }\r\n        return nullptr;\r\n    }\r\n\r\n    ScopedMem<char> url(NormalizeURL(id, pagePath));\r\n    // some EPUB producers use wrong path separators\r\n    if (str::FindChar(url, '\\\\'))\r\n        str::TransChars(url, \"\\\\\", \"/\");\r\n    for (size_t i = 0; i < images.Count(); i++) {\r\n        ImageData2 *img = &images.At(i);\r\n        if (str::Eq(img->id, url)) {\r\n            if (!img->base.data)\r\n                img->base.data = zip.GetFileDataByIdx(img->idx, &img->base.len);\r\n            if (img->base.data)\r\n                return &img->base;\r\n        }\r\n    }\r\n\r\n    // try to also load images which aren't registered in the manifest\r\n    ImageData2 data = { 0 };\r\n    ScopedMem<WCHAR> imgPath(str::conv::FromUtf8(url));\r\n    data.idx = zip.GetFileIndex(imgPath);\r\n    if (data.idx != (size_t)-1) {\r\n        data.base.data = zip.GetFileDataByIdx(data.idx, &data.base.len);\r\n        if (data.base.data) {\r\n            data.id = str::Dup(url);\r\n            images.Append(data);\r\n            return &images.Last().base;\r\n        }\r\n    }\r\n\r\n    return nullptr;\r\n}\r\n\r\nchar *EpubDoc::GetFileData(const char *relPath, const char *pagePath, size_t *lenOut)\r\n{\r\n    if (!pagePath) {\r\n        CrashIf(true);\r\n        return nullptr;\r\n    }\r\n\r\n    ScopedCritSec scope(&zipAccess);\r\n\r\n    ScopedMem<char> url(NormalizeURL(relPath, pagePath));\r\n    ScopedMem<WCHAR> zipPath(str::conv::FromUtf8(url));\r\n    return zip.GetFileDataByName(zipPath, lenOut);\r\n}\r\n\r\nWCHAR *EpubDoc::GetProperty(DocumentProperty prop) const\r\n{\r\n    return props.Get(prop);\r\n}\r\n\r\nconst WCHAR *EpubDoc::GetFileName() const\r\n{\r\n    return fileName;\r\n}\r\n\r\nbool EpubDoc::IsRTL() const\r\n{\r\n    return isRtlDoc;\r\n}\r\n\r\nbool EpubDoc::HasToc() const\r\n{\r\n    return tocPath != nullptr;\r\n}\r\n\r\nbool EpubDoc::ParseNavToc(const char *data, size_t dataLen, const char *pagePath, EbookTocVisitor *visitor)\r\n{\r\n    HtmlPullParser parser(data, dataLen);\r\n    HtmlToken *tok;\r\n    // skip to the start of the <nav epub:type=\"toc\">\r\n    while ((tok = parser.Next()) != nullptr && !tok->IsError()) {\r\n        if (tok->IsStartTag() && Tag_Nav == tok->tag) {\r\n            AttrInfo *attr = tok->GetAttrByName(\"epub:type\");\r\n            if (attr && attr->ValIs(\"toc\"))\r\n                break;\r\n        }\r\n    }\r\n    if (!tok || tok->IsError())\r\n        return false;\r\n\r\n    int level = 0;\r\n    while ((tok = parser.Next()) != nullptr && !tok->IsError() &&\r\n           (!tok->IsEndTag() || Tag_Nav != tok->tag)) {\r\n        if (tok->IsStartTag() && Tag_Ol == tok->tag)\r\n            level++;\r\n        else if (tok->IsEndTag() && Tag_Ol == tok->tag && level > 0)\r\n            level--;\r\n        if (tok->IsStartTag() && (Tag_A == tok->tag || Tag_Span == tok->tag)) {\r\n            HtmlTag itemTag = tok->tag;\r\n            ScopedMem<char> text, href;\r\n            if (Tag_A == tok->tag) {\r\n                AttrInfo *attrInfo = tok->GetAttrByName(\"href\");\r\n                if (attrInfo)\r\n                    href.Set(str::DupN(attrInfo->val, attrInfo->valLen));\r\n            }\r\n            while ((tok = parser.Next()) != nullptr && !tok->IsError() &&\r\n                   (!tok->IsEndTag() || itemTag != tok->tag)) {\r\n                if (tok->IsText()) {\r\n                    ScopedMem<char> part(str::DupN(tok->s, tok->sLen));\r\n                    if (!text)\r\n                        text.Set(part.StealData());\r\n                    else\r\n                        text.Set(str::Join(text, part));\r\n                }\r\n            }\r\n            if (!text)\r\n                continue;\r\n            ScopedMem<WCHAR> itemText(str::conv::FromUtf8(text));\r\n            str::NormalizeWS(itemText);\r\n            ScopedMem<WCHAR> itemSrc;\r\n            if (href) {\r\n                href.Set(NormalizeURL(href, pagePath));\r\n                itemSrc.Set(str::conv::FromHtmlUtf8(href, str::Len(href)));\r\n            }\r\n            visitor->Visit(itemText, itemSrc, level);\r\n        }\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nbool EpubDoc::ParseNcxToc(const char *data, size_t dataLen, const char *pagePath, EbookTocVisitor *visitor)\r\n{\r\n    HtmlPullParser parser(data, dataLen);\r\n    HtmlToken *tok;\r\n    // skip to the start of the navMap\r\n    while ((tok = parser.Next()) != nullptr && !tok->IsError()) {\r\n        if (tok->IsStartTag() && tok->NameIsNS(\"navMap\", EPUB_NCX_NS))\r\n            break;\r\n    }\r\n    if (!tok || tok->IsError())\r\n        return false;\r\n\r\n    ScopedMem<WCHAR> itemText, itemSrc;\r\n    int level = 0;\r\n    while ((tok = parser.Next()) != nullptr && !tok->IsError() &&\r\n           (!tok->IsEndTag() || !tok->NameIsNS(\"navMap\", EPUB_NCX_NS))) {\r\n        if (tok->IsTag() && tok->NameIsNS(\"navPoint\", EPUB_NCX_NS)) {\r\n            if (itemText) {\r\n                visitor->Visit(itemText, itemSrc, level);\r\n                itemText.Set(nullptr);\r\n                itemSrc.Set(nullptr);\r\n            }\r\n            if (tok->IsStartTag())\r\n                level++;\r\n            else if (tok->IsEndTag() && level > 0)\r\n                level--;\r\n        }\r\n        else if (tok->IsStartTag() && tok->NameIsNS(\"text\", EPUB_NCX_NS)) {\r\n            if ((tok = parser.Next()) == nullptr || tok->IsError())\r\n                break;\r\n            if (tok->IsText())\r\n                itemText.Set(str::conv::FromHtmlUtf8(tok->s, tok->sLen));\r\n        }\r\n        else if (tok->IsTag() && !tok->IsEndTag() && tok->NameIsNS(\"content\", EPUB_NCX_NS)) {\r\n            AttrInfo *attrInfo = tok->GetAttrByName(\"src\");\r\n            if (attrInfo) {\r\n                ScopedMem<char> src(str::DupN(attrInfo->val, attrInfo->valLen));\r\n                src.Set(NormalizeURL(src, pagePath));\r\n                itemSrc.Set(str::conv::FromHtmlUtf8(src, str::Len(src)));\r\n            }\r\n        }\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nbool EpubDoc::ParseToc(EbookTocVisitor *visitor)\r\n{\r\n    if (!tocPath)\r\n        return false;\r\n    size_t tocDataLen;\r\n    ScopedMem<char> tocData;\r\n    {\r\n        ScopedCritSec scope(&zipAccess);\r\n        tocData.Set(zip.GetFileDataByName(tocPath, &tocDataLen));\r\n    }\r\n    if (!tocData)\r\n        return false;\r\n\r\n    ScopedMem<char> pagePath(str::conv::ToUtf8(tocPath));\r\n    if (isNcxToc)\r\n        return ParseNcxToc(tocData, tocDataLen, pagePath, visitor);\r\n    return ParseNavToc(tocData, tocDataLen, pagePath, visitor);\r\n}\r\n\r\nbool EpubDoc::IsSupportedFile(const WCHAR *fileName, bool sniff)\r\n{\r\n    if (sniff) {\r\n        ZipFile zip(fileName, true);\r\n        ScopedMem<char> mimetype(zip.GetFileDataByName(L\"mimetype\"));\r\n        if (!mimetype)\r\n            return false;\r\n        // trailing whitespace is allowed for the mimetype file\r\n        for (size_t i = str::Len(mimetype); i > 0; i--) {\r\n            if (!str::IsWs(mimetype[i-1]))\r\n                break;\r\n            mimetype[i-1] = '\\0';\r\n        }\r\n        // a proper EPUB document has a \"mimetype\" file with content\r\n        // \"application/epub+zip\" as the first entry in its ZIP structure\r\n        /* cf. http://forums.fofou.org/sumatrapdf/topic?id=2599331\r\n        if (!str::Eq(zip.GetFileName(0), L\"mimetype\"))\r\n            return false; */\r\n        return str::Eq(mimetype, \"application/epub+zip\") ||\r\n               // also open renamed .ibooks files\r\n               // cf. http://en.wikipedia.org/wiki/IBooks#Formats\r\n               str::Eq(mimetype, \"application/x-ibooks+zip\");\r\n    }\r\n    return str::EndsWithI(fileName, L\".epub\");\r\n}\r\n\r\nEpubDoc *EpubDoc::CreateFromFile(const WCHAR *fileName)\r\n{\r\n    EpubDoc *doc = new EpubDoc(fileName);\r\n    if (!doc || !doc->Load()) {\r\n        delete doc;\r\n        return nullptr;\r\n    }\r\n    return doc;\r\n}\r\n\r\nEpubDoc *EpubDoc::CreateFromStream(IStream *stream)\r\n{\r\n    EpubDoc *doc = new EpubDoc(stream);\r\n    if (!doc || !doc->Load()) {\r\n        delete doc;\r\n        return nullptr;\r\n    }\r\n    return doc;\r\n}\r\n\r\n/* ********** FictionBook (FB2) ********** */\r\n\r\nconst char *FB2_MAIN_NS = \"http://www.gribuser.ru/xml/fictionbook/2.0\";\r\nconst char *FB2_XLINK_NS = \"http://www.w3.org/1999/xlink\";\r\n\r\nFb2Doc::Fb2Doc(const WCHAR *fileName) : fileName(str::Dup(fileName)),\r\n    stream(nullptr), isZipped(false), hasToc(false) { }\r\n\r\nFb2Doc::Fb2Doc(IStream *stream) : fileName(nullptr),\r\n    stream(stream), isZipped(false), hasToc(false) {\r\n    stream->AddRef();\r\n}\r\n\r\nFb2Doc::~Fb2Doc()\r\n{\r\n    for (size_t i = 0; i < images.Count(); i++) {\r\n        free(images.At(i).base.data);\r\n        free(images.At(i).id);\r\n    }\r\n    if (stream)\r\n        stream->Release();\r\n}\r\n\r\nbool Fb2Doc::Load()\r\n{\r\n    CrashIf(!stream && !fileName);\r\n    ScopedMem<char> data;\r\n    if (fileName) {\r\n        ZipFile archive(fileName);\r\n        isZipped = archive.GetFileCount() > 0;\r\n        if (archive.GetFileCount() > 1) {\r\n            // if the ZIP file contains more than one file, we try to be rather\r\n            // restrictive in what we accept in order not to accidentally accept\r\n            // too many archives which only contain FB2 files among others:\r\n            // the file must contain a single .fb2 file and may only contain\r\n            // .url files in addition (TODO: anything else?)\r\n            for (size_t i = 0; i < archive.GetFileCount(); i++) {\r\n                const WCHAR *ext = path::GetExt(archive.GetFileName(i));\r\n                if (str::EqI(ext, L\".fb2\") && !data)\r\n                    data.Set(archive.GetFileDataByIdx(i));\r\n                else if (!str::EqI(ext, L\".url\"))\r\n                    return false;\r\n            }\r\n        }\r\n        else if (isZipped)\r\n            data.Set(archive.GetFileDataByIdx(0));\r\n        else\r\n            data.Set(file::ReadAll(fileName, nullptr));\r\n    }\r\n    else if (stream) {\r\n        data.Set((char *)GetDataFromStream(stream, nullptr));\r\n        if (str::StartsWith(data.Get(), \"PK\\x03\\x04\")) {\r\n            ZipFile archive(stream);\r\n            if (archive.GetFileCount() == 1) {\r\n                isZipped = true;\r\n                data.Set(archive.GetFileDataByIdx(0));\r\n            }\r\n        }\r\n    }\r\n    if (!data)\r\n        return false;\r\n    data.Set(DecodeTextToUtf8(data, true));\r\n    if (!data)\r\n        return false;\r\n\r\n    HtmlPullParser parser(data, str::Len(data));\r\n    HtmlToken *tok;\r\n    int inBody = 0, inTitleInfo = 0, inDocInfo = 0;\r\n    const char *bodyStart = nullptr;\r\n    while ((tok = parser.Next()) != nullptr && !tok->IsError()) {\r\n        if (!inTitleInfo && !inDocInfo && tok->IsStartTag() && Tag_Body == tok->tag) {\r\n            if (!inBody++)\r\n                bodyStart = tok->s;\r\n        }\r\n        else if (inBody && tok->IsEndTag() && Tag_Body == tok->tag) {\r\n            if (!--inBody) {\r\n                if (xmlData.Count() > 0)\r\n                    xmlData.Append(\"<pagebreak />\");\r\n                xmlData.Append('<');\r\n                xmlData.Append(bodyStart, tok->s - bodyStart + tok->sLen);\r\n                xmlData.Append('>');\r\n            }\r\n        }\r\n        else if (inBody && tok->IsStartTag() && Tag_Title == tok->tag)\r\n            hasToc = true;\r\n        else if (inBody)\r\n            continue;\r\n        else if (inTitleInfo && tok->IsEndTag() && tok->NameIsNS(\"title-info\", FB2_MAIN_NS))\r\n            inTitleInfo--;\r\n        else if (inDocInfo && tok->IsEndTag() && tok->NameIsNS(\"document-info\", FB2_MAIN_NS))\r\n            inDocInfo--;\r\n        else if (inTitleInfo && tok->IsStartTag() && tok->NameIsNS(\"book-title\", FB2_MAIN_NS)) {\r\n            if ((tok = parser.Next()) == nullptr || tok->IsError())\r\n                break;\r\n            if (tok->IsText())\r\n                props.Set(Prop_Title, ResolveHtmlEntities(tok->s, tok->sLen));\r\n        }\r\n        else if ((inTitleInfo || inDocInfo) && tok->IsStartTag() && tok->NameIsNS(\"author\", FB2_MAIN_NS)) {\r\n            ScopedMem<char> docAuthor;\r\n            while ((tok = parser.Next()) != nullptr && !tok->IsError() &&\r\n                !(tok->IsEndTag() && tok->NameIsNS(\"author\", FB2_MAIN_NS))) {\r\n                if (tok->IsText()) {\r\n                    ScopedMem<char> author(ResolveHtmlEntities(tok->s, tok->sLen));\r\n                    if (docAuthor)\r\n                        docAuthor.Set(str::Join(docAuthor, \" \", author));\r\n                    else\r\n                        docAuthor.Set(author.StealData());\r\n                }\r\n            }\r\n            if (docAuthor) {\r\n                str::NormalizeWS(docAuthor);\r\n                if (!str::IsEmpty(docAuthor.Get()))\r\n                    props.Set(Prop_Author, docAuthor.StealData(), inTitleInfo != 0);\r\n            }\r\n        }\r\n        else if (inTitleInfo && tok->IsStartTag() && tok->NameIsNS(\"date\", FB2_MAIN_NS)) {\r\n            AttrInfo *attr = tok->GetAttrByNameNS(\"value\", FB2_MAIN_NS);\r\n            if (attr)\r\n                props.Set(Prop_CreationDate, ResolveHtmlEntities(attr->val, attr->valLen));\r\n        }\r\n        else if (inDocInfo && tok->IsStartTag() && tok->NameIsNS(\"date\", FB2_MAIN_NS)) {\r\n            AttrInfo *attr = tok->GetAttrByNameNS(\"value\", FB2_MAIN_NS);\r\n            if (attr)\r\n                props.Set(Prop_ModificationDate, ResolveHtmlEntities(attr->val, attr->valLen));\r\n        }\r\n        else if (inDocInfo && tok->IsStartTag() && tok->NameIsNS(\"program-used\", FB2_MAIN_NS)) {\r\n            if ((tok = parser.Next()) == nullptr || tok->IsError())\r\n                break;\r\n            if (tok->IsText())\r\n                props.Set(Prop_CreatorApp, ResolveHtmlEntities(tok->s, tok->sLen));\r\n        }\r\n        else if (inTitleInfo && tok->IsStartTag() && tok->NameIsNS(\"coverpage\", FB2_MAIN_NS)) {\r\n            tok = parser.Next();\r\n            if (tok && tok->IsText())\r\n                tok = parser.Next();\r\n            if (tok && tok->IsEmptyElementEndTag() && Tag_Image == tok->tag) {\r\n                AttrInfo *attr = tok->GetAttrByNameNS(\"href\", FB2_XLINK_NS);\r\n                if (attr)\r\n                    coverImage.Set(str::DupN(attr->val, attr->valLen));\r\n            }\r\n        }\r\n        else if (inTitleInfo || inDocInfo)\r\n            continue;\r\n        else if (tok->IsStartTag() && tok->NameIsNS(\"title-info\", FB2_MAIN_NS))\r\n            inTitleInfo++;\r\n        else if (tok->IsStartTag() && tok->NameIsNS(\"document-info\", FB2_MAIN_NS))\r\n            inDocInfo++;\r\n        else if (tok->IsStartTag() && tok->NameIsNS(\"binary\", FB2_MAIN_NS))\r\n            ExtractImage(&parser, tok);\r\n    }\r\n\r\n    return xmlData.Size() > 0;\r\n}\r\n\r\nvoid Fb2Doc::ExtractImage(HtmlPullParser *parser, HtmlToken *tok)\r\n{\r\n    ScopedMem<char> id;\r\n    AttrInfo *attrInfo = tok->GetAttrByNameNS(\"id\", FB2_MAIN_NS);\r\n    if (attrInfo) {\r\n        id.Set(str::DupN(attrInfo->val, attrInfo->valLen));\r\n        url::DecodeInPlace(id);\r\n    }\r\n\r\n    tok = parser->Next();\r\n    if (!tok || !tok->IsText())\r\n        return;\r\n\r\n    ImageData2 data = { 0 };\r\n    data.base.data = Base64Decode(tok->s, tok->sLen, &data.base.len);\r\n    if (!data.base.data)\r\n        return;\r\n    data.id = str::Join(\"#\", id);\r\n    data.idx = images.Count();\r\n    images.Append(data);\r\n}\r\n\r\nconst char *Fb2Doc::GetXmlData(size_t *lenOut) const\r\n{\r\n    *lenOut = xmlData.Size();\r\n    return xmlData.Get();\r\n}\r\n\r\nsize_t Fb2Doc::GetXmlDataSize() const\r\n{\r\n    return xmlData.Size();\r\n}\r\n\r\nImageData *Fb2Doc::GetImageData(const char *id)\r\n{\r\n    for (size_t i = 0; i < images.Count(); i++) {\r\n        if (str::Eq(images.At(i).id, id))\r\n            return &images.At(i).base;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nImageData *Fb2Doc::GetCoverImage()\r\n{\r\n    if (!coverImage)\r\n        return nullptr;\r\n    return GetImageData(coverImage);\r\n}\r\n\r\nWCHAR *Fb2Doc::GetProperty(DocumentProperty prop) const\r\n{\r\n    return props.Get(prop);\r\n}\r\n\r\nconst WCHAR *Fb2Doc::GetFileName() const\r\n{\r\n    return fileName;\r\n}\r\n\r\nbool Fb2Doc::IsZipped() const\r\n{\r\n    return isZipped;\r\n}\r\n\r\nbool Fb2Doc::HasToc() const\r\n{\r\n    return hasToc;\r\n}\r\n\r\nbool Fb2Doc::ParseToc(EbookTocVisitor *visitor)\r\n{\r\n    ScopedMem<WCHAR> itemText;\r\n    bool inTitle = false;\r\n    int titleCount = 0;\r\n    int level = 0;\r\n\r\n    size_t xmlLen;\r\n    const char *xmlData = GetXmlData(&xmlLen);\r\n    HtmlPullParser parser(xmlData, xmlLen);\r\n    HtmlToken *tok;\r\n    while ((tok = parser.Next()) != nullptr && !tok->IsError()) {\r\n        if (tok->IsStartTag() && Tag_Section == tok->tag)\r\n            level++;\r\n        else if (tok->IsEndTag() && Tag_Section == tok->tag && level > 0)\r\n            level--;\r\n        else if (tok->IsStartTag() && Tag_Title == tok->tag) {\r\n            inTitle = true;\r\n            titleCount++;\r\n        }\r\n        else if (tok->IsEndTag() && Tag_Title == tok->tag) {\r\n            if (itemText)\r\n                str::NormalizeWS(itemText);\r\n            if (!str::IsEmpty(itemText.Get())) {\r\n                ScopedMem<WCHAR> url(str::Format(TEXT(FB2_TOC_ENTRY_MARK) L\"%d\", titleCount));\r\n                visitor->Visit(itemText, url, level);\r\n                itemText.Set(nullptr);\r\n            }\r\n            inTitle = false;\r\n        }\r\n        else if (inTitle && tok->IsText()) {\r\n            ScopedMem<WCHAR> text(str::conv::FromHtmlUtf8(tok->s, tok->sLen));\r\n            if (str::IsEmpty(itemText.Get()))\r\n                itemText.Set(text.StealData());\r\n            else\r\n                itemText.Set(str::Join(itemText, L\" \", text));\r\n        }\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nbool Fb2Doc::IsSupportedFile(const WCHAR *fileName, bool sniff)\r\n{\r\n    UNUSED(sniff);\r\n    // TODO: implement sniffing\r\n    return str::EndsWithI(fileName, L\".fb2\")  ||\r\n           str::EndsWithI(fileName, L\".fb2z\") ||\r\n           str::EndsWithI(fileName, L\".zfb2\") ||\r\n           str::EndsWithI(fileName, L\".fb2.zip\");\r\n}\r\n\r\nFb2Doc *Fb2Doc::CreateFromFile(const WCHAR *fileName)\r\n{\r\n    Fb2Doc *doc = new Fb2Doc(fileName);\r\n    if (!doc || !doc->Load()) {\r\n        delete doc;\r\n        return nullptr;\r\n    }\r\n    return doc;\r\n}\r\n\r\nFb2Doc *Fb2Doc::CreateFromStream(IStream *stream)\r\n{\r\n    Fb2Doc *doc = new Fb2Doc(stream);\r\n    if (!doc || !doc->Load()) {\r\n        delete doc;\r\n        return nullptr;\r\n    }\r\n    return doc;\r\n}\r\n\r\n/* ********** PalmDOC (and TealDoc) ********** */\r\n\r\nPalmDoc::PalmDoc(const WCHAR *fileName) : fileName(str::Dup(fileName)) { }\r\n\r\nPalmDoc::~PalmDoc() {\r\n}\r\n\r\n#define PDB_TOC_ENTRY_MARK \"ToC!Entry!\"\r\n\r\n// cf. http://wiki.mobileread.com/wiki/TealDoc\r\nstatic const char *HandleTealDocTag(str::Str<char>& builder, WStrVec& tocEntries, const char *text, size_t len, UINT codePage)\r\n{\r\n    UNUSED(codePage);\r\n    if (len < 9) {\r\nFallback:\r\n        builder.Append(\"&lt;\");\r\n        return text;\r\n    }\r\n    if (!str::StartsWithI(text, \"<BOOKMARK\") &&\r\n        !str::StartsWithI(text, \"<HEADER\") &&\r\n        !str::StartsWithI(text, \"<HRULE\") &&\r\n        !str::StartsWithI(text, \"<LABEL\") &&\r\n        !str::StartsWithI(text, \"<LINK\") &&\r\n        !str::StartsWithI(text, \"<TEALPAINT\")) {\r\n        goto Fallback;\r\n    }\r\n    HtmlPullParser parser(text, len);\r\n    HtmlToken *tok = parser.Next();\r\n    if (!tok || !tok->IsStartTag())\r\n        goto Fallback;\r\n\r\n    if (tok->NameIs(\"BOOKMARK\")) {\r\n        // <BOOKMARK NAME=\"Contents\">\r\n        AttrInfo *attr = tok->GetAttrByName(\"NAME\");\r\n        if (attr && attr->valLen > 0) {\r\n            tocEntries.Append(str::conv::FromHtmlUtf8(attr->val, attr->valLen));\r\n            builder.AppendFmt(\"<a name=\" PDB_TOC_ENTRY_MARK \"%d>\", tocEntries.Count());\r\n            return tok->s + tok->sLen;\r\n        }\r\n    }\r\n    else if (tok->NameIs(\"HEADER\")) {\r\n        // <HEADER TEXT=\"Contents\" ALIGN=CENTER STYLE=UNDERLINE>\r\n        int hx = 2;\r\n        AttrInfo *attr = tok->GetAttrByName(\"FONT\");\r\n        if (attr && attr->valLen > 0)\r\n            hx = '0' == *attr->val ? 5 : '2' == *attr->val ? 1 : 3;\r\n        attr = tok->GetAttrByName(\"TEXT\");\r\n        if (attr) {\r\n            builder.AppendFmt(\"<h%d>\", hx);\r\n            builder.Append(attr->val, attr->valLen);\r\n            builder.AppendFmt(\"</h%d>\", hx);\r\n            return tok->s + tok->sLen;\r\n        }\r\n    }\r\n    else if (tok->NameIs(\"HRULE\")) {\r\n        // <HRULE STYLE=OUTLINE>\r\n        builder.Append(\"<hr>\");\r\n        return tok->s + tok->sLen;\r\n    }\r\n    else if (tok->NameIs(\"LABEL\")) {\r\n        // <LABEL NAME=\"Contents\">\r\n        AttrInfo *attr = tok->GetAttrByName(\"NAME\");\r\n        if (attr && attr->valLen > 0) {\r\n            builder.Append(\"<a name=\\\"\");\r\n            builder.Append(attr->val, attr->valLen);\r\n            builder.Append(\"\\\">\");\r\n            return tok->s + tok->sLen;\r\n        }\r\n    }\r\n    else if (tok->NameIs(\"LINK\")) {\r\n        // <LINK TEXT=\"Press Me\" TAG=\"Contents\" FILE=\"My Novels\">\r\n        AttrInfo *attrTag = tok->GetAttrByName(\"TAG\");\r\n        AttrInfo *attrText = tok->GetAttrByName(\"TEXT\");\r\n        if (attrTag && attrText) {\r\n            if (tok->GetAttrByName(\"FILE\")) {\r\n                // skip links to other files\r\n                return tok->s + tok->sLen;\r\n            }\r\n            builder.Append(\"<a href=\\\"#\");\r\n            builder.Append(attrTag->val, attrTag->valLen);\r\n            builder.Append(\"\\\">\");\r\n            builder.Append(attrText->val, attrText->valLen);\r\n            builder.Append(\"</a>\");\r\n            return tok->s + tok->sLen;\r\n        }\r\n    }\r\n    else if (tok->NameIs(\"TEALPAINT\")) {\r\n        // <TEALPAINT SRC=\"Pictures\" INDEX=0 LINK=SUPERMAP SUPERIMAGE=1 SUPERW=640 SUPERH=480>\r\n        // support removed in r7047\r\n        return tok->s + tok->sLen;\r\n    }\r\n    goto Fallback;\r\n}\r\n\r\nbool PalmDoc::Load()\r\n{\r\n    MobiDoc *mobiDoc = MobiDoc::CreateFromFile(fileName);\r\n    if (!mobiDoc)\r\n        return false;\r\n    if (Pdb_PalmDoc != mobiDoc->GetDocType() && Pdb_TealDoc != mobiDoc->GetDocType()) {\r\n        delete mobiDoc;\r\n        return false;\r\n    }\r\n\r\n    size_t textLen;\r\n    const char *text = mobiDoc->GetHtmlData(textLen);\r\n    UINT codePage = GuessTextCodepage(text, textLen, CP_ACP);\r\n    ScopedMem<char> textUtf8(str::ToMultiByte(text, codePage, CP_UTF8));\r\n    textLen = str::Len(textUtf8);\r\n\r\n    for (const char *curr = textUtf8; curr < textUtf8 + textLen; curr++) {\r\n        if ('&' == *curr)\r\n            htmlData.Append(\"&amp;\");\r\n        else if ('<' == *curr)\r\n            curr = HandleTealDocTag(htmlData, tocEntries, curr, textUtf8 + textLen - curr, codePage);\r\n        else if ('\\n' == *curr || '\\r' == *curr && curr + 1 < textUtf8 + textLen && '\\n' != *(curr + 1))\r\n            htmlData.Append(\"\\n<br>\");\r\n        else\r\n            htmlData.Append(*curr);\r\n    }\r\n\r\n    delete mobiDoc;\r\n    return true;\r\n}\r\n\r\nconst char *PalmDoc::GetHtmlData(size_t *lenOut) const\r\n{\r\n    *lenOut = htmlData.Size();\r\n    return htmlData.Get();\r\n}\r\n\r\nsize_t PalmDoc::GetHtmlDataSize() const\r\n{\r\n    return htmlData.Size();\r\n}\r\n\r\nWCHAR *PalmDoc::GetProperty(DocumentProperty prop) const\r\n{\r\n    UNUSED(prop);\r\n    return nullptr;\r\n}\r\n\r\nconst WCHAR *PalmDoc::GetFileName() const\r\n{\r\n    return fileName;\r\n}\r\n\r\nbool PalmDoc::HasToc() const\r\n{\r\n    return tocEntries.Count() > 0;\r\n}\r\n\r\nbool PalmDoc::ParseToc(EbookTocVisitor *visitor)\r\n{\r\n    for (size_t i = 0; i < tocEntries.Count(); i++) {\r\n        ScopedMem<WCHAR> name(str::Format(TEXT(PDB_TOC_ENTRY_MARK) L\"%d\", i + 1));\r\n        visitor->Visit(tocEntries.At(i), name, 1);\r\n    }\r\n    return true;\r\n}\r\n\r\nbool PalmDoc::IsSupportedFile(const WCHAR *fileName, bool sniff)\r\n{\r\n    if (sniff) {\r\n        PdbReader pdbReader(fileName);\r\n        return str::Eq(pdbReader.GetDbType(), \"TEXtREAd\") ||\r\n               str::Eq(pdbReader.GetDbType(), \"TEXtTlDc\");\r\n    }\r\n\r\n    return str::EndsWithI(fileName, L\".pdb\") ||\r\n           str::EndsWithI(fileName, L\".prc\");\r\n}\r\n\r\nPalmDoc *PalmDoc::CreateFromFile(const WCHAR *fileName)\r\n{\r\n    PalmDoc *doc = new PalmDoc(fileName);\r\n    if (!doc || !doc->Load()) {\r\n        delete doc;\r\n        return nullptr;\r\n    }\r\n    return doc;\r\n}\r\n\r\n/* ********** Plain HTML ********** */\r\n\r\nHtmlDoc::HtmlDoc(const WCHAR *fileName) : fileName(str::Dup(fileName)) { }\r\n\r\nHtmlDoc::~HtmlDoc()\r\n{\r\n    for (size_t i = 0; i < images.Count(); i++) {\r\n        free(images.At(i).base.data);\r\n        free(images.At(i).id);\r\n    }\r\n}\r\n\r\nbool HtmlDoc::Load()\r\n{\r\n    ScopedMem<char> data(file::ReadAll(fileName, nullptr));\r\n    if (!data)\r\n        return false;\r\n    htmlData.Set(DecodeTextToUtf8(data, true));\r\n    if (!htmlData)\r\n        return false;\r\n\r\n    pagePath.Set(str::conv::ToUtf8(fileName));\r\n    str::TransChars(pagePath, \"\\\\\", \"/\");\r\n\r\n    HtmlPullParser parser(htmlData, str::Len(htmlData));\r\n    HtmlToken *tok;\r\n    while ((tok = parser.Next()) != nullptr && !tok->IsError() &&\r\n           (!tok->IsTag() || Tag_Body != tok->tag && Tag_P != tok->tag)) {\r\n        if (tok->IsStartTag() && Tag_Title == tok->tag) {\r\n            tok = parser.Next();\r\n            if (tok && tok->IsText())\r\n                props.Set(Prop_Title, ResolveHtmlEntities(tok->s, tok->sLen));\r\n        }\r\n        else if ((tok->IsStartTag() || tok->IsEmptyElementEndTag()) && Tag_Meta == tok->tag) {\r\n            AttrInfo *attrName = tok->GetAttrByName(\"name\");\r\n            AttrInfo *attrValue = tok->GetAttrByName(\"content\");\r\n            if (!attrName || !attrValue)\r\n                /* ignore this tag */;\r\n            else if (attrName->ValIs(\"author\"))\r\n                props.Set(Prop_Author, ResolveHtmlEntities(attrValue->val, attrValue->valLen));\r\n            else if (attrName->ValIs(\"date\"))\r\n                props.Set(Prop_CreationDate, ResolveHtmlEntities(attrValue->val, attrValue->valLen));\r\n            else if (attrName->ValIs(\"copyright\"))\r\n                props.Set(Prop_Copyright, ResolveHtmlEntities(attrValue->val, attrValue->valLen));\r\n        }\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nconst char *HtmlDoc::GetHtmlData(size_t *lenOut) const\r\n{\r\n    *lenOut = str::Len(htmlData);\r\n    return htmlData;\r\n}\r\n\r\nImageData *HtmlDoc::GetImageData(const char *id)\r\n{\r\n    // TODO: this isn't thread-safe (might leak image data when called concurrently),\r\n    //       so add a critical section once it's used for EbookController\r\n\r\n    ScopedMem<char> url(NormalizeURL(id, pagePath));\r\n    for (size_t i = 0; i < images.Count(); i++) {\r\n        if (str::Eq(images.At(i).id, url))\r\n            return &images.At(i).base;\r\n    }\r\n\r\n    ImageData2 data = { 0 };\r\n    data.base.data = LoadURL(url, &data.base.len);\r\n    if (!data.base.data)\r\n        return nullptr;\r\n    data.id = url.StealData();\r\n    images.Append(data);\r\n    return &images.Last().base;\r\n}\r\n\r\nchar *HtmlDoc::GetFileData(const char *relPath, size_t *lenOut)\r\n{\r\n    ScopedMem<char> url(NormalizeURL(relPath, pagePath));\r\n    return LoadURL(url, lenOut);\r\n}\r\n\r\nchar *HtmlDoc::LoadURL(const char *url, size_t *lenOut)\r\n{\r\n    if (str::StartsWith(url, \"data:\"))\r\n        return DecodeDataURI(url, lenOut);\r\n    if (str::FindChar(url, ':'))\r\n        return nullptr;\r\n    ScopedMem<WCHAR> path(str::conv::FromUtf8(url));\r\n    str::TransChars(path, L\"/\", L\"\\\\\");\r\n    return file::ReadAll(path, lenOut);\r\n}\r\n\r\nWCHAR *HtmlDoc::GetProperty(DocumentProperty prop) const\r\n{\r\n    return props.Get(prop);\r\n}\r\n\r\nconst WCHAR *HtmlDoc::GetFileName() const\r\n{\r\n    return fileName;\r\n}\r\n\r\nbool HtmlDoc::IsSupportedFile(const WCHAR *fileName, bool sniff)\r\n{\r\n    UNUSED(sniff);\r\n    return str::EndsWithI(fileName, L\".html\") ||\r\n           str::EndsWithI(fileName, L\".htm\") ||\r\n           str::EndsWithI(fileName, L\".xhtml\");\r\n}\r\n\r\nHtmlDoc *HtmlDoc::CreateFromFile(const WCHAR *fileName)\r\n{\r\n    HtmlDoc *doc = new HtmlDoc(fileName);\r\n    if (!doc || !doc->Load()) {\r\n        delete doc;\r\n        return nullptr;\r\n    }\r\n    return doc;\r\n}\r\n\r\n/* ********** Plain Text (and RFCs and TCR) ********** */\r\n\r\nTxtDoc::TxtDoc(const WCHAR *fileName) : fileName(str::Dup(fileName)), isRFC(false) { }\r\n\r\n// cf. http://www.cix.co.uk/~gidds/Software/TCR.html\r\n#define TCR_HEADER \"!!8-Bit!!\"\r\n\r\nstatic char *DecompressTcrText(const char *data, size_t dataLen)\r\n{\r\n    CrashIf(!str::StartsWith(data, TCR_HEADER));\r\n    const char *curr = data + str::Len(TCR_HEADER);\r\n    const char *end = data + dataLen;\r\n\r\n    const char *dict[256];\r\n    for (int n = 0; n < dimof(dict); n++) {\r\n        if (curr >= end)\r\n            return str::Dup(data);\r\n        dict[n] = curr;\r\n        curr += 1 + (uint8_t)*curr;\r\n    }\r\n\r\n    str::Str<char> text(dataLen * 2);\r\n    for (; curr < end; curr++) {\r\n        const char *entry = dict[(uint8_t)*curr];\r\n        bool ok = text.AppendChecked(entry + 1, (uint8_t)*entry);\r\n        if (!ok)\r\n            return nullptr;\r\n    }\r\n\r\n    return text.StealData();\r\n}\r\n\r\nstatic const char *TextFindLinkEnd(str::Str<char>& htmlData, const char *curr, char prevChar, bool fromWww=false)\r\n{\r\n    const char *end, *quote;\r\n\r\n    // look for the end of the URL (ends in a space preceded maybe by interpunctuation)\r\n    for (end = curr; *end && !str::IsWs(*end); end++);\r\n    if (',' == end[-1] || '.' == end[-1] || '?' == end[-1] || '!' == end[-1])\r\n        end--;\r\n    // also ignore a closing parenthesis, if the URL doesn't contain any opening one\r\n    if (')' == end[-1] && (!str::FindChar(curr, '(') || str::FindChar(curr, '(') >= end))\r\n        end--;\r\n    // cut the link at the first quotation mark, if it's also preceded by one\r\n    if (('\"' == prevChar || '\\'' == prevChar) && (quote = str::FindChar(curr, prevChar)) != nullptr && quote < end)\r\n        end = quote;\r\n\r\n    if (fromWww && (end - curr <= 4 || !str::FindChar(curr + 5, '.') ||\r\n                    str::FindChar(curr + 5, '.') >= end)) {\r\n        // ignore www. links without a top-level domain\r\n        return nullptr;\r\n    }\r\n\r\n    htmlData.Append(\"<a href=\\\"\");\r\n    if (fromWww)\r\n        htmlData.Append(\"http://\");\r\n    for (; curr < end; curr++) {\r\n        AppendChar(htmlData, *curr);\r\n    }\r\n    htmlData.Append(\"\\\">\");\r\n\r\n    return end;\r\n}\r\n\r\n// cf. http://weblogs.mozillazine.org/gerv/archives/2011/05/html5_email_address_regexp.html\r\ninline bool IsEmailUsernameChar(char c)\r\n{\r\n    // explicitly excluding the '/' from the list, as it is more\r\n    // often part of a URL or path than of an email address\r\n    return isalnum((unsigned char)c) || c && str::FindChar(\".!#$%&'*+=?^_`{|}~-\", c);\r\n}\r\ninline bool IsEmailDomainChar(char c)\r\n{\r\n    return isalnum((unsigned char)c) || '-' == c;\r\n}\r\n\r\nstatic const char *TextFindEmailEnd(str::Str<char>& htmlData, const char *curr)\r\n{\r\n    ScopedMem<char> beforeAt;\r\n    const char *end = curr;\r\n    if ('@' == *curr) {\r\n        if (htmlData.Count() == 0 || !IsEmailUsernameChar(htmlData.Last()))\r\n            return nullptr;\r\n        size_t idx = htmlData.Count();\r\n        for (; idx > 1 && IsEmailUsernameChar(htmlData.At(idx - 1)); idx--);\r\n        beforeAt.Set(str::Dup(&htmlData.At(idx)));\r\n    } else {\r\n        CrashIf(!str::StartsWith(curr, \"mailto:\"));\r\n        end = curr = curr + 7; // skip mailto:\r\n        if (!IsEmailUsernameChar(*end))\r\n            return nullptr;\r\n        for (; IsEmailUsernameChar(*end); end++);\r\n    }\r\n\r\n    if (*end != '@' || !IsEmailDomainChar(*(end + 1)))\r\n        return nullptr;\r\n    for (end++; IsEmailDomainChar(*end); end++);\r\n    if ('.' != *end || !IsEmailDomainChar(*(end + 1)))\r\n        return nullptr;\r\n    do {\r\n        for (end++; IsEmailDomainChar(*end); end++);\r\n    } while ('.' == *end && IsEmailDomainChar(*(end + 1)));\r\n\r\n    if (beforeAt) {\r\n        size_t idx = htmlData.Count() - str::Len(beforeAt);\r\n        htmlData.RemoveAt(idx, htmlData.Count() - idx);\r\n    }\r\n    htmlData.Append(\"<a href=\\\"mailto:\");\r\n    htmlData.Append(beforeAt);\r\n    for (; curr < end; curr++) {\r\n        AppendChar(htmlData, *curr);\r\n    }\r\n    htmlData.Append(\"\\\">\");\r\n    htmlData.Append(beforeAt);\r\n\r\n    return end;\r\n}\r\n\r\nstatic const char *TextFindRfcEnd(str::Str<char>& htmlData, const char *curr)\r\n{\r\n    if (isalnum((unsigned char)*(curr - 1)))\r\n        return nullptr;\r\n    int rfc;\r\n    const char *end = str::Parse(curr, \"RFC %d\", &rfc);\r\n    // cf. http://en.wikipedia.org/wiki/Request_for_Comments#Obtaining_RFCs\r\n    htmlData.AppendFmt(\"<a href='http://www.rfc-editor.org/rfc/rfc%d.txt'>\", rfc);\r\n    return end;\r\n}\r\n\r\nbool TxtDoc::Load()\r\n{\r\n    size_t dataLen;\r\n    ScopedMem<char> text(file::ReadAll(fileName, &dataLen));\r\n    if (str::EndsWithI(fileName, L\".tcr\") && str::StartsWith(text.Get(), TCR_HEADER))\r\n        text.Set(DecompressTcrText(text, dataLen));\r\n    if (!text)\r\n        return false;\r\n    text.Set(DecodeTextToUtf8(text));\r\n    if (!text)\r\n        return false;\r\n\r\n    int rfc;\r\n    isRFC = str::Parse(path::GetBaseName(fileName), L\"rfc%d.txt%$\", &rfc) != nullptr;\r\n\r\n    const char *linkEnd = nullptr;\r\n    bool rfcHeader = false;\r\n    int sectionCount = 0;\r\n\r\n    htmlData.Append(\"<pre>\");\r\n    for (const char *curr = text; *curr; curr++) {\r\n        // similar logic to LinkifyText in PdfEngine.cpp\r\n        if (linkEnd == curr) {\r\n            htmlData.Append(\"</a>\");\r\n            linkEnd = nullptr;\r\n        }\r\n        else if (linkEnd)\r\n            /* don't check for hyperlinks inside a link */;\r\n        else if ('@' == *curr)\r\n            linkEnd = TextFindEmailEnd(htmlData, curr);\r\n        else if (curr > text && ('/' == curr[-1] || isalnum((unsigned char)curr[-1])))\r\n            /* don't check for a link at this position */;\r\n        else if ('h' == *curr && str::Parse(curr, \"http%?s://\"))\r\n            linkEnd = TextFindLinkEnd(htmlData, curr, curr > text ? curr[-1] : ' ');\r\n        else if ('w' == *curr && str::StartsWith(curr, \"www.\"))\r\n            linkEnd = TextFindLinkEnd(htmlData, curr, curr > text ? curr[-1] : ' ', true);\r\n        else if ('m' == *curr && str::StartsWith(curr, \"mailto:\"))\r\n            linkEnd = TextFindEmailEnd(htmlData, curr);\r\n        else if (isRFC && curr > text && 'R' == *curr && str::Parse(curr, \"RFC %d\", &rfc))\r\n            linkEnd = TextFindRfcEnd(htmlData, curr);\r\n\r\n        // RFCs use (among others) form feeds as page separators\r\n        if ('\\f' == *curr && (curr == text || '\\n' == *(curr - 1)) &&\r\n            (!*(curr + 1) || '\\r' == *(curr + 1) || '\\n' == *(curr + 1))) {\r\n            // only insert pagebreaks if not at the very beginning or end\r\n            if (curr > text && *(curr + 2) && (*(curr + 3) || *(curr + 2) != '\\n'))\r\n                htmlData.Append(\"<pagebreak />\");\r\n            continue;\r\n        }\r\n\r\n        if (isRFC && curr > text && '\\n' == *(curr - 1) &&\r\n            (str::IsDigit(*curr) || str::StartsWith(curr, \"APPENDIX\")) &&\r\n            str::FindChar(curr, '\\n') && str::Parse(str::FindChar(curr, '\\n') + 1, \"%?\\r\\n\")) {\r\n            htmlData.AppendFmt(\"<b id='section%d' title=\\\"\", ++sectionCount);\r\n            for (const char *c = curr; *c != '\\r' && *c != '\\n'; c++) {\r\n                AppendChar(htmlData, *c);\r\n            }\r\n            htmlData.Append(\"\\\">\");\r\n            rfcHeader = true;\r\n        }\r\n        if (rfcHeader && ('\\r' == *curr || '\\n' == *curr)) {\r\n            htmlData.Append(\"</b>\");\r\n            rfcHeader = false;\r\n        }\r\n\r\n        AppendChar(htmlData, *curr);\r\n    }\r\n    if (linkEnd)\r\n        htmlData.Append(\"</a>\");\r\n    htmlData.Append(\"</pre>\");\r\n\r\n    return true;\r\n}\r\n\r\nconst char *TxtDoc::GetHtmlData(size_t *lenOut) const\r\n{\r\n    *lenOut = htmlData.Size();\r\n    return htmlData.Get();\r\n}\r\n\r\nWCHAR *TxtDoc::GetProperty(DocumentProperty prop) const\r\n{\r\n    UNUSED(prop);\r\n    return nullptr;\r\n}\r\n\r\nconst WCHAR *TxtDoc::GetFileName() const\r\n{\r\n    return fileName;\r\n}\r\n\r\nbool TxtDoc::IsRFC() const\r\n{\r\n    return isRFC;\r\n}\r\n\r\nbool TxtDoc::HasToc() const\r\n{\r\n    return isRFC;\r\n}\r\n\r\nstatic inline const WCHAR *SkipDigits(const WCHAR *s)\r\n{\r\n    while (str::IsDigit(*s))\r\n        s++;\r\n    return s;\r\n}\r\n\r\nbool TxtDoc::ParseToc(EbookTocVisitor *visitor)\r\n{\r\n    if (!isRFC)\r\n        return false;\r\n\r\n    HtmlParser parser;\r\n    parser.Parse(htmlData.Get(), CP_UTF8);\r\n    HtmlElement *el = nullptr;\r\n    while ((el = parser.FindElementByName(\"b\", el)) != nullptr) {\r\n        ScopedMem<WCHAR> title(el->GetAttribute(\"title\"));\r\n        ScopedMem<WCHAR> id(el->GetAttribute(\"id\"));\r\n        int level = 1;\r\n        if (str::IsDigit(*title)) {\r\n            const WCHAR *dot = SkipDigits(title);\r\n            while ('.' == *dot && str::IsDigit(*(dot + 1))) {\r\n                level++;\r\n                dot = SkipDigits(dot + 1);\r\n            }\r\n        }\r\n        visitor->Visit(title, id, level);\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nbool TxtDoc::IsSupportedFile(const WCHAR *fileName, bool sniff)\r\n{\r\n    UNUSED(sniff);\r\n    return str::EndsWithI(fileName, L\".txt\") ||\r\n           str::EndsWithI(fileName, L\".log\") ||\r\n           // http://en.wikipedia.org/wiki/.nfo\r\n           str::EndsWithI(fileName, L\".nfo\") ||\r\n           // http://en.wikipedia.org/wiki/FILE_ID.DIZ\r\n           str::EndsWithI(fileName, L\"\\\\file_id.diz\") ||\r\n           // http://en.wikipedia.org/wiki/Read.me\r\n           str::EndsWithI(fileName, L\"\\\\Read.me\") ||\r\n           // http://www.cix.co.uk/~gidds/Software/TCR.html\r\n           str::EndsWithI(fileName, L\".tcr\");\r\n}\r\n\r\nTxtDoc *TxtDoc::CreateFromFile(const WCHAR *fileName)\r\n{\r\n    TxtDoc *doc = new TxtDoc(fileName);\r\n    if (!doc || !doc->Load()) {\r\n        delete doc;\r\n        return nullptr;\r\n    }\r\n    return doc;\r\n}\r\n"
  },
  {
    "path": "src/EbookDoc.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nclass HtmlPullParser;\r\nstruct HtmlToken;\r\n\r\nstruct ImageData2 {\r\n    ImageData base;\r\n    char *  id;  // path by which content refers to this image\r\n    size_t  idx; // document specific index at which to find this image\r\n};\r\n\r\nchar *NormalizeURL(const char *url, const char *base);\r\n\r\nclass PropertyMap {\r\n    ScopedMem<char> values[Prop_PdfVersion];\r\n\r\n    int Find(DocumentProperty prop) const;\r\n\r\npublic:\r\n    void Set(DocumentProperty prop, char *valueUtf8, bool replace=false);\r\n    WCHAR *Get(DocumentProperty prop) const;\r\n};\r\n\r\n/* ********** EPUB ********** */\r\n\r\nclass EpubDoc {\r\n    ZipFile zip;\r\n    // zip and images are the only mutable members of EpubDoc after initialization;\r\n    // access to them must be serialized for multi-threaded users (such as EbookController)\r\n    CRITICAL_SECTION zipAccess;\r\n\r\n    str::Str<char> htmlData;\r\n    Vec<ImageData2> images;\r\n    ScopedMem<WCHAR> tocPath;\r\n    ScopedMem<WCHAR> fileName;\r\n    PropertyMap props;\r\n    bool isNcxToc;\r\n    bool isRtlDoc;\r\n\r\n    bool Load();\r\n    void ParseMetadata(const char *content);\r\n    bool ParseNavToc(const char *data, size_t dataLen, const char *pagePath, EbookTocVisitor *visitor);\r\n    bool ParseNcxToc(const char *data, size_t dataLen, const char *pagePath, EbookTocVisitor *visitor);\r\n\r\npublic:\r\n    explicit EpubDoc(const WCHAR *fileName);\r\n    explicit EpubDoc(IStream *stream);\r\n    ~EpubDoc();\r\n\r\n    const char *GetHtmlData(size_t *lenOut) const;\r\n    size_t GetHtmlDataSize() const;\r\n    ImageData *GetImageData(const char *id, const char *pagePath);\r\n    char *GetFileData(const char *relPath, const char *pagePath, size_t *lenOut);\r\n\r\n    WCHAR *GetProperty(DocumentProperty prop) const;\r\n    const WCHAR *GetFileName() const;\r\n    bool IsRTL() const;\r\n\r\n    bool HasToc() const;\r\n    bool ParseToc(EbookTocVisitor *visitor);\r\n\r\n    static bool IsSupportedFile(const WCHAR *fileName, bool sniff=false);\r\n    static EpubDoc *CreateFromFile(const WCHAR *fileName);\r\n    static EpubDoc *CreateFromStream(IStream *stream);\r\n};\r\n\r\n/* ********** FictionBook (FB2) ********** */\r\n\r\n#define FB2_TOC_ENTRY_MARK \"ToC!Entry!\"\r\n\r\nclass Fb2Doc {\r\n    ScopedMem<WCHAR> fileName;\r\n    IStream *stream;\r\n\r\n    str::Str<char> xmlData;\r\n    Vec<ImageData2> images;\r\n    ScopedMem<char> coverImage;\r\n    PropertyMap props;\r\n    bool isZipped;\r\n    bool hasToc;\r\n\r\n    bool Load();\r\n    void ExtractImage(HtmlPullParser *parser, HtmlToken *tok);\r\n\r\npublic:\r\n    explicit Fb2Doc(const WCHAR *fileName);\r\n    explicit Fb2Doc(IStream *stream);\r\n    ~Fb2Doc();\r\n\r\n    const char *GetXmlData(size_t *lenOut) const;\r\n    size_t GetXmlDataSize() const;\r\n    ImageData *GetImageData(const char *id);\r\n    ImageData *GetCoverImage();\r\n\r\n    WCHAR *GetProperty(DocumentProperty prop) const;\r\n    const WCHAR *GetFileName() const;\r\n    bool IsZipped() const;\r\n\r\n    bool HasToc() const;\r\n    bool ParseToc(EbookTocVisitor *visitor);\r\n\r\n    static bool IsSupportedFile(const WCHAR *fileName, bool sniff=false);\r\n    static Fb2Doc *CreateFromFile(const WCHAR *fileName);\r\n    static Fb2Doc *CreateFromStream(IStream *stream);\r\n};\r\n\r\n/* ********** PalmDOC (and TealDoc) ********** */\r\n\r\nclass PdbReader;\r\n\r\nclass PalmDoc {\r\n    ScopedMem<WCHAR> fileName;\r\n    str::Str<char> htmlData;\r\n    WStrVec tocEntries;\r\n\r\n    bool Load();\r\n\r\npublic:\r\n    explicit PalmDoc(const WCHAR *fileName);\r\n    ~PalmDoc();\r\n\r\n    const char *GetHtmlData(size_t *lenOut) const;\r\n    size_t GetHtmlDataSize() const;\r\n\r\n    WCHAR *GetProperty(DocumentProperty prop) const;\r\n    const WCHAR *GetFileName() const;\r\n\r\n    bool HasToc() const;\r\n    bool ParseToc(EbookTocVisitor *visitor);\r\n\r\n    static bool IsSupportedFile(const WCHAR *fileName, bool sniff=false);\r\n    static PalmDoc *CreateFromFile(const WCHAR *fileName);\r\n};\r\n\r\n/* ********** Plain HTML ********** */\r\n\r\nclass HtmlDoc {\r\n    ScopedMem<WCHAR> fileName;\r\n    ScopedMem<char> htmlData;\r\n    ScopedMem<char> pagePath;\r\n    Vec<ImageData2> images;\r\n    PropertyMap props;\r\n\r\n    bool Load();\r\n    char *LoadURL(const char *url, size_t *lenOut);\r\n\r\npublic:\r\n    explicit HtmlDoc(const WCHAR *fileName);\r\n    ~HtmlDoc();\r\n\r\n    const char *GetHtmlData(size_t *lenOut) const;\r\n    ImageData *GetImageData(const char *id);\r\n    char *GetFileData(const char *relPath, size_t *lenOut);\r\n\r\n    WCHAR *GetProperty(DocumentProperty prop) const;\r\n    const WCHAR *GetFileName() const;\r\n\r\n    static bool IsSupportedFile(const WCHAR *fileName, bool sniff=false);\r\n    static HtmlDoc *CreateFromFile(const WCHAR *fileName);\r\n};\r\n\r\n/* ********** Plain Text (and RFCs and TCR) ********** */\r\n\r\nclass TxtDoc {\r\n    ScopedMem<WCHAR> fileName;\r\n    str::Str<char> htmlData;\r\n    bool isRFC;\r\n\r\n    bool Load();\r\n\r\npublic:\r\n    explicit TxtDoc(const WCHAR *fileName);\r\n\r\n    const char *GetHtmlData(size_t *lenOut) const;\r\n\r\n    WCHAR *GetProperty(DocumentProperty prop) const;\r\n    const WCHAR *GetFileName() const;\r\n\r\n    bool IsRFC() const;\r\n    bool HasToc() const;\r\n    bool ParseToc(EbookTocVisitor *visitor);\r\n\r\n    static bool IsSupportedFile(const WCHAR *fileName, bool sniff=false);\r\n    static TxtDoc *CreateFromFile(const WCHAR *fileName);\r\n};\r\n"
  },
  {
    "path": "src/EbookEngine.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// engines which render flowed ebook formats into fixed pages through the BaseEngine API\r\n// (pages are mostly layed out the same as for a \"B Format\" paperback: 5.12\" x 7.8\")\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"ArchUtil.h\"\r\n#include \"Dpi.h\"\r\n#include \"FileUtil.h\"\r\n#include \"GdiPlusUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"HtmlPullParser.h\"\r\n#include \"Mui.h\"\r\n#include \"PalmDbReader.h\"\r\n#include \"TrivialHtmlParser.h\"\r\n#include \"WinUtil.h\"\r\n#include \"ZipUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EbookEngine.h\"\r\n#include \"EbookBase.h\"\r\n#include \"EbookDoc.h\"\r\n#include \"HtmlFormatter.h\"\r\n#include \"EbookFormatter.h\"\r\n\r\nstatic ScopedMem<WCHAR> gDefaultFontName;\r\nstatic float gDefaultFontSize = 10.f;\r\n\r\nstatic const WCHAR *GetDefaultFontName()\r\n{\r\n    return gDefaultFontName ? gDefaultFontName : L\"Georgia\";\r\n}\r\n\r\nstatic float GetDefaultFontSize()\r\n{\r\n    // fonts are scaled at higher DPI settings,\r\n    // undo this here for (mostly) consistent results\r\n    return gDefaultFontSize * 96.0f / DpiGetPreciseY(HWND_DESKTOP);\r\n}\r\n\r\nvoid SetDefaultEbookFont(const WCHAR *name, float size)\r\n{\r\n    // intentionally don't validate the input\r\n    gDefaultFontName.Set(str::Dup(name));\r\n    // use a somewhat smaller size than in the EbookUI, since fit page/width\r\n    // is likely to be above 100% for the paperback page dimensions\r\n    gDefaultFontSize = size * 0.8f;\r\n}\r\n\r\n/* common classes for EPUB, FictionBook2, Mobi, PalmDOC, CHM, HTML and TXT engines */\r\n\r\nstruct PageAnchor {\r\n    DrawInstr *instr;\r\n    int pageNo;\r\n\r\n    explicit PageAnchor(DrawInstr *instr=nullptr, int pageNo=-1) : instr(instr), pageNo(pageNo) { }\r\n};\r\n\r\nclass EbookAbortCookie : public AbortCookie {\r\npublic:\r\n    bool abort;\r\n    EbookAbortCookie() : abort(false) { }\r\n    void Abort() override { abort = true; }\r\n};\r\n\r\nclass EbookEngine : public BaseEngine {\r\npublic:\r\n    EbookEngine();\r\n    virtual ~EbookEngine();\r\n\r\n    const WCHAR *FileName() const override { return fileName; };\r\n    int PageCount() const override { return pages ? (int)pages->Count() : 0; }\r\n\r\n    RectD PageMediabox(int pageNo) override { UNUSED(pageNo);  return pageRect; }\r\n    RectD PageContentBox(int pageNo, RenderTarget target=Target_View) override {\r\n        UNUSED(target);\r\n        RectD mbox = PageMediabox(pageNo);\r\n        mbox.Inflate(-pageBorder, -pageBorder);\r\n        return mbox;\r\n    }\r\n\r\n    RenderedBitmap *RenderBitmap(int pageNo, float zoom, int rotation,\r\n                         RectD *pageRect=nullptr, /* if nullptr: defaults to the page's mediabox */\r\n                         RenderTarget target=Target_View, AbortCookie **cookie_out=nullptr) override;\r\n\r\n    PointD Transform(PointD pt, int pageNo, float zoom, int rotation, bool inverse=false) override;\r\n    RectD Transform(RectD rect, int pageNo, float zoom, int rotation, bool inverse=false) override;\r\n\r\n    unsigned char *GetFileData(size_t *cbCount) override {\r\n        return fileName ? (unsigned char *)file::ReadAll(fileName, cbCount) : nullptr;\r\n    }\r\n    bool SaveFileAs(const WCHAR *copyFileName, bool includeUserAnnots=false) override {\r\n        UNUSED(includeUserAnnots);\r\n        return fileName ? CopyFile(fileName, copyFileName, FALSE) : false;\r\n    }\r\n    WCHAR * ExtractPageText(int pageNo, const WCHAR *lineSep, RectI **coordsOut=nullptr,\r\n                                    RenderTarget target=Target_View) override;\r\n    // make RenderCache request larger tiles than per default\r\n    bool HasClipOptimizations(int pageNo) override { UNUSED(pageNo);  return false; }\r\n    PageLayoutType PreferredLayout() override { return Layout_Book; }\r\n\r\n    bool SupportsAnnotation(bool forSaving=false) const override { return !forSaving; }\r\n    void UpdateUserAnnotations(Vec<PageAnnotation> *list) override;\r\n\r\n    Vec<PageElement *> *GetElements(int pageNo) override;\r\n    PageElement *GetElementAtPos(int pageNo, PointD pt) override;\r\n\r\n    PageDestination *GetNamedDest(const WCHAR *name) override;\r\n\r\n    bool BenchLoadPage(int pageNo) override { UNUSED(pageNo); return true; }\r\n\r\nprotected:\r\n    WCHAR *fileName;\r\n    Vec<HtmlPage *> *pages;\r\n    Vec<PageAnchor> anchors;\r\n    // contains for each page the last anchor indicating\r\n    // a break between two merged documents\r\n    Vec<DrawInstr *> baseAnchors;\r\n    // needed so that memory allocated by ResolveHtmlEntities isn't leaked\r\n    PoolAllocator allocator;\r\n    // TODO: still needed?\r\n    CRITICAL_SECTION pagesAccess;\r\n    // access to userAnnots is protected by pagesAccess\r\n    Vec<PageAnnotation> userAnnots;\r\n    // page dimensions can vary between filetypes\r\n    RectD pageRect;\r\n    float pageBorder;\r\n\r\n    void GetTransform(Matrix& m, float zoom, int rotation) {\r\n        GetBaseTransform(m, pageRect.ToGdipRectF(), zoom, rotation);\r\n    }\r\n    bool ExtractPageAnchors();\r\n    WCHAR *ExtractFontList();\r\n\r\n    virtual PageElement *CreatePageLink(DrawInstr *link, RectI rect, int pageNo);\r\n\r\n    Vec<DrawInstr> *GetHtmlPage(int pageNo) {\r\n        CrashIf(pageNo < 1 || PageCount() < pageNo);\r\n        if (pageNo < 1 || PageCount() < pageNo)\r\n            return nullptr;\r\n        return &pages->At(pageNo - 1)->instructions;\r\n    }\r\n};\r\n\r\nclass SimpleDest2 : public PageDestination {\r\nprotected:\r\n    int pageNo;\r\n    RectD rect;\r\n    ScopedMem<WCHAR> value;\r\n\r\npublic:\r\n    SimpleDest2(int pageNo, RectD rect, WCHAR *value=nullptr) :\r\n        pageNo(pageNo), rect(rect), value(value) { }\r\n\r\n    PageDestType GetDestType() const override { return value ? Dest_LaunchURL : Dest_ScrollTo; }\r\n    int GetDestPageNo() const override { return pageNo; }\r\n    RectD GetDestRect() const override { return rect; }\r\n    WCHAR *GetDestValue() const override { return str::Dup(value); }\r\n};\r\n\r\nclass EbookLink : public PageElement, public PageDestination {\r\n    PageDestination *dest; // required for internal links, nullptr for external ones\r\n    DrawInstr *link; // owned by *EngineImpl::pages\r\n    RectI rect;\r\n    int pageNo;\r\n    bool showUrl;\r\n\r\npublic:\r\n    EbookLink() : dest(nullptr), link(nullptr), pageNo(-1), showUrl(false) { }\r\n    EbookLink(DrawInstr *link, RectI rect, PageDestination *dest, int pageNo=-1, bool showUrl=false) :\r\n        link(link), rect(rect), dest(dest), pageNo(pageNo), showUrl(showUrl) { }\r\n    virtual ~EbookLink() { delete dest; }\r\n\r\n    PageElementType GetType() const override { return Element_Link; }\r\n    int GetPageNo() const override { return pageNo; }\r\n    RectD GetRect() const override { return rect.Convert<double>(); }\r\n    WCHAR *GetValue() const override {\r\n        if (!dest || showUrl)\r\n            return str::conv::FromHtmlUtf8(link->str.s, link->str.len);\r\n        return nullptr;\r\n    }\r\n    virtual PageDestination *AsLink() { return dest ? dest : this; }\r\n\r\n    PageDestType GetDestType() const override { return Dest_LaunchURL; }\r\n    int GetDestPageNo() const override { return 0; }\r\n    RectD GetDestRect() const override { return RectD(); }\r\n    WCHAR *GetDestValue() const override { return GetValue(); }\r\n};\r\n\r\nclass ImageDataElement : public PageElement {\r\n    int pageNo;\r\n    ImageData *id; // owned by *EngineImpl::pages\r\n    RectI bbox;\r\n\r\npublic:\r\n    ImageDataElement(int pageNo, ImageData *id, RectI bbox) :\r\n        pageNo(pageNo), id(id), bbox(bbox) { }\r\n\r\n    virtual PageElementType GetType() const { return Element_Image; }\r\n    virtual int GetPageNo() const { return pageNo; }\r\n    virtual RectD GetRect() const { return bbox.Convert<double>(); }\r\n    virtual WCHAR *GetValue() const { return nullptr; }\r\n\r\n    virtual RenderedBitmap *GetImage() {\r\n        HBITMAP hbmp;\r\n        Bitmap *bmp = BitmapFromData(id->data, id->len);\r\n        if (!bmp || bmp->GetHBITMAP((ARGB)Color::White, &hbmp) != Ok) {\r\n            delete bmp;\r\n            return nullptr;\r\n        }\r\n        SizeI size(bmp->GetWidth(), bmp->GetHeight());\r\n        delete bmp;\r\n        return new RenderedBitmap(hbmp, size);\r\n    }\r\n};\r\n\r\nclass EbookTocItem : public DocTocItem {\r\n    PageDestination *dest;\r\n\r\npublic:\r\n    EbookTocItem(WCHAR *title, PageDestination *dest) :\r\n        DocTocItem(title, dest ? dest->GetDestPageNo() : 0), dest(dest) { }\r\n    ~EbookTocItem() { delete dest; }\r\n\r\n    virtual PageDestination *GetLink() { return dest; }\r\n};\r\n\r\nEbookEngine::EbookEngine() : fileName(nullptr), pages(nullptr),\r\n    pageRect(0, 0, 5.12 * GetFileDPI(), 7.8 * GetFileDPI()), // \"B Format\" paperback\r\n    pageBorder(0.4f * GetFileDPI())\r\n{\r\n    InitializeCriticalSection(&pagesAccess);\r\n}\r\n\r\nEbookEngine::~EbookEngine()\r\n{\r\n    EnterCriticalSection(&pagesAccess);\r\n\r\n    if (pages)\r\n        DeleteVecMembers(*pages);\r\n    delete pages;\r\n    free(fileName);\r\n\r\n    LeaveCriticalSection(&pagesAccess);\r\n    DeleteCriticalSection(&pagesAccess);\r\n}\r\n\r\nbool EbookEngine::ExtractPageAnchors()\r\n{\r\n    ScopedCritSec scope(&pagesAccess);\r\n\r\n    DrawInstr *baseAnchor = nullptr;\r\n    for (int pageNo = 1; pageNo <= PageCount(); pageNo++) {\r\n        Vec<DrawInstr> *pageInstrs = GetHtmlPage(pageNo);\r\n        if (!pageInstrs)\r\n            return false;\r\n\r\n        for (size_t k = 0; k < pageInstrs->Count(); k++) {\r\n            DrawInstr *i = &pageInstrs->At(k);\r\n            if (InstrAnchor != i->type)\r\n                continue;\r\n            anchors.Append(PageAnchor(i, pageNo));\r\n            if (k < 2 && str::StartsWith(i->str.s + i->str.len, \"\\\" page_marker />\"))\r\n                baseAnchor = i;\r\n        }\r\n        baseAnchors.Append(baseAnchor);\r\n    }\r\n\r\n    CrashIf(baseAnchors.Count() != pages->Count());\r\n    return true;\r\n}\r\n\r\nPointD EbookEngine::Transform(PointD pt, int pageNo, float zoom, int rotation, bool inverse)\r\n{\r\n    RectD rect = Transform(RectD(pt, SizeD()), pageNo, zoom, rotation, inverse);\r\n    return PointD(rect.x, rect.y);\r\n}\r\n\r\nRectD EbookEngine::Transform(RectD rect, int pageNo, float zoom, int rotation, bool inverse)\r\n{\r\n    UNUSED(pageNo);\r\n    geomutil::RectT<REAL> rcF = rect.Convert<REAL>();\r\n    PointF pts[2] = { PointF(rcF.x, rcF.y), PointF(rcF.x + rcF.dx, rcF.y + rcF.dy) };\r\n    Matrix m;\r\n    GetTransform(m, zoom, rotation);\r\n    if (inverse)\r\n        m.Invert();\r\n    m.TransformPoints(pts, 2);\r\n    return RectD::FromXY(pts[0].X, pts[0].Y, pts[1].X, pts[1].Y);\r\n}\r\n\r\n// TODO: use AdjustLightness instead to compensate for the alpha?\r\nstatic Gdiplus::Color Unblend(PageAnnotation::Color c, BYTE alpha)\r\n{\r\n    alpha = (BYTE)(alpha * c.a / 255.f);\r\n    BYTE R = (BYTE)floorf(std::max(c.r - (255 - alpha), 0) * 255.0f / alpha + 0.5f);\r\n    BYTE G = (BYTE)floorf(std::max(c.g - (255 - alpha), 0) * 255.0f / alpha + 0.5f);\r\n    BYTE B = (BYTE)floorf(std::max(c.b - (255 - alpha), 0) * 255.0f / alpha + 0.5f);\r\n    return Gdiplus::Color(alpha, R, G, B);\r\n}\r\n\r\nstatic inline Gdiplus::Color FromColor(PageAnnotation::Color c)\r\n{\r\n    return Gdiplus::Color(c.a, c.r, c.g, c.b);\r\n}\r\n\r\nstatic void DrawAnnotations(Graphics& g, Vec<PageAnnotation>& userAnnots, int pageNo)\r\n{\r\n    for (size_t i = 0; i < userAnnots.Count(); i++) {\r\n        PageAnnotation& annot = userAnnots.At(i);\r\n        if (annot.pageNo != pageNo)\r\n            continue;\r\n        PointF p1, p2;\r\n        switch (annot.type) {\r\n        case Annot_Highlight:\r\n            {\r\n            SolidBrush tmpBrush(Unblend(annot.color, 119));\r\n            g.FillRectangle(&tmpBrush, annot.rect.ToGdipRectF());\r\n            }\r\n            break;\r\n        case Annot_Underline:\r\n            p1 = PointF((float)annot.rect.x, (float)annot.rect.BR().y);\r\n            p2 = PointF((float)annot.rect.BR().x, p1.Y);\r\n            {\r\n            Pen tmpPen(FromColor(annot.color));\r\n            g.DrawLine(&tmpPen, p1, p2);\r\n            }\r\n            break;\r\n        case Annot_StrikeOut:\r\n            p1 = PointF((float)annot.rect.x, (float)annot.rect.y + (float)annot.rect.dy / 2);\r\n            p2 = PointF((float)annot.rect.BR().x, p1.Y);\r\n            {\r\n            Pen tmpPen(FromColor(annot.color));\r\n            g.DrawLine(&tmpPen, p1, p2);\r\n            }\r\n            break;\r\n        case Annot_Squiggly:\r\n            {\r\n                Pen p(FromColor(annot.color), 0.5f);\r\n                REAL dash[2] = { 2, 2 };\r\n                p.SetDashPattern(dash, dimof(dash));\r\n                p.SetDashOffset(1);\r\n                p1 = PointF((float)annot.rect.x, (float)annot.rect.BR().y - 0.25f);\r\n                p2 = PointF((float)annot.rect.BR().x, p1.Y);\r\n                g.DrawLine(&p, p1, p2);\r\n                p.SetDashOffset(3);\r\n                p1.Y += 0.5f;\r\n                p2.Y += 0.5f;\r\n                g.DrawLine(&p, p1, p2);\r\n            }\r\n            break;\r\n        }\r\n    }\r\n}\r\n\r\nRenderedBitmap *EbookEngine::RenderBitmap(int pageNo, float zoom, int rotation, RectD *pageRect, RenderTarget target, AbortCookie **cookieOut)\r\n{\r\n    UNUSED(target);\r\n    RectD pageRc = pageRect ? *pageRect : PageMediabox(pageNo);\r\n    RectI screen = Transform(pageRc, pageNo, zoom, rotation).Round();\r\n    PointI screenTL = screen.TL();\r\n    screen.Offset(-screen.x, -screen.y);\r\n\r\n    HANDLE hMap = nullptr;\r\n    HBITMAP hbmp = CreateMemoryBitmap(screen.Size(), &hMap);\r\n    HDC hDC = CreateCompatibleDC(nullptr);\r\n    DeleteObject(SelectObject(hDC, hbmp));\r\n\r\n    Graphics g(hDC);\r\n    mui::InitGraphicsMode(&g);\r\n\r\n    Color white(0xFF, 0xFF, 0xFF);\r\n    SolidBrush tmpBrush(white);\r\n    Rect screenR(screen.ToGdipRect());\r\n    screenR.Inflate(1, 1);\r\n    g.FillRectangle(&tmpBrush, screenR);\r\n\r\n    Matrix m;\r\n    GetTransform(m, zoom, rotation);\r\n    m.Translate((REAL)-screenTL.x, (REAL)-screenTL.y, MatrixOrderAppend);\r\n    g.SetTransform(&m);\r\n\r\n    EbookAbortCookie *cookie = nullptr;\r\n    if (cookieOut)\r\n        *cookieOut = cookie = new EbookAbortCookie();\r\n\r\n    ScopedCritSec scope(&pagesAccess);\r\n\r\n    mui::ITextRender *textDraw = mui::TextRenderGdiplus::Create(&g);\r\n    DrawHtmlPage(&g, textDraw, GetHtmlPage(pageNo), pageBorder, pageBorder, false, Color((ARGB)Color::Black), cookie ? &cookie->abort : nullptr);\r\n    DrawAnnotations(g, userAnnots, pageNo);\r\n    delete textDraw;\r\n    DeleteDC(hDC);\r\n\r\n    if (cookie && cookie->abort) {\r\n        DeleteObject(hbmp);\r\n        CloseHandle(hMap);\r\n        return nullptr;\r\n    }\r\n\r\n    return new RenderedBitmap(hbmp, screen.Size(), hMap);\r\n}\r\n\r\nstatic RectI GetInstrBbox(DrawInstr& instr, float pageBorder)\r\n{\r\n    geomutil::RectT<float> bbox(instr.bbox.X, instr.bbox.Y, instr.bbox.Width, instr.bbox.Height);\r\n    bbox.Offset(pageBorder, pageBorder);\r\n    return bbox.Round();\r\n}\r\n\r\nWCHAR *EbookEngine::ExtractPageText(int pageNo, const WCHAR *lineSep, RectI **coordsOut, RenderTarget target)\r\n{\r\n    UNUSED(target);\r\n    ScopedCritSec scope(&pagesAccess);\r\n\r\n    str::Str<WCHAR> content;\r\n    Vec<RectI> coords;\r\n    bool insertSpace = false;\r\n\r\n    Vec<DrawInstr> *pageInstrs = GetHtmlPage(pageNo);\r\n    for (DrawInstr& i : *pageInstrs) {\r\n        RectI bbox = GetInstrBbox(i, pageBorder);\r\n        switch (i.type) {\r\n        case InstrString:\r\n            if (coords.Count() > 0 && (bbox.x < coords.Last().BR().x ||\r\n                                       bbox.y > coords.Last().y + coords.Last().dy * 0.8)) {\r\n                content.Append(lineSep);\r\n                coords.AppendBlanks(str::Len(lineSep));\r\n                CrashIf(*lineSep && !coords.Last().IsEmpty());\r\n            }\r\n            else if (insertSpace && coords.Count() > 0) {\r\n                int swidth = bbox.x - coords.Last().BR().x;\r\n                if (swidth > 0) {\r\n                    content.Append(' ');\r\n                    coords.Append(RectI(bbox.x - swidth, bbox.y, swidth, bbox.dy));\r\n                }\r\n            }\r\n            insertSpace = false;\r\n            {\r\n                ScopedMem<WCHAR> s(str::conv::FromHtmlUtf8(i.str.s, i.str.len));\r\n                content.Append(s);\r\n                size_t len = str::Len(s);\r\n                double cwidth = 1.0 * bbox.dx / len;\r\n                for (size_t k = 0; k < len; k++)\r\n                    coords.Append(RectI((int)(bbox.x + k * cwidth), bbox.y, (int)cwidth, bbox.dy));\r\n            }\r\n            break;\r\n        case InstrRtlString:\r\n            if (coords.Count() > 0 && (bbox.BR().x > coords.Last().x ||\r\n                                       bbox.y > coords.Last().y + coords.Last().dy * 0.8)) {\r\n                content.Append(lineSep);\r\n                coords.AppendBlanks(str::Len(lineSep));\r\n                CrashIf(*lineSep && !coords.Last().IsEmpty());\r\n            }\r\n            else if (insertSpace && coords.Count() > 0) {\r\n                int swidth = coords.Last().x - bbox.BR().x;\r\n                if (swidth > 0) {\r\n                    content.Append(' ');\r\n                    coords.Append(RectI(bbox.BR().x, bbox.y, swidth, bbox.dy));\r\n                }\r\n            }\r\n            insertSpace = false;\r\n            {\r\n                ScopedMem<WCHAR> s(str::conv::FromHtmlUtf8(i.str.s, i.str.len));\r\n                content.Append(s);\r\n                size_t len = str::Len(s);\r\n                double cwidth = 1.0 * bbox.dx / len;\r\n                for (size_t k = 0; k < len; k++)\r\n                    coords.Append(RectI((int)(bbox.x + (len - k - 1) * cwidth), bbox.y, (int)cwidth, bbox.dy));\r\n            }\r\n            break;\r\n        case InstrElasticSpace:\r\n        case InstrFixedSpace:\r\n            insertSpace = true;\r\n            break;\r\n        }\r\n    }\r\n    if (content.Count() > 0 && !str::EndsWith(content.Get(), lineSep)) {\r\n        content.Append(lineSep);\r\n        coords.AppendBlanks(str::Len(lineSep));\r\n    }\r\n\r\n    if (coordsOut) {\r\n        CrashIf(coords.Count() != content.Count());\r\n        *coordsOut = coords.StealData();\r\n    }\r\n    return content.StealData();\r\n}\r\n\r\nvoid EbookEngine::UpdateUserAnnotations(Vec<PageAnnotation> *list)\r\n{\r\n    ScopedCritSec scope(&pagesAccess);\r\n    if (list)\r\n        userAnnots = *list;\r\n    else\r\n        userAnnots.Reset();\r\n}\r\n\r\nPageElement *EbookEngine::CreatePageLink(DrawInstr *link, RectI rect, int pageNo)\r\n{\r\n    ScopedMem<WCHAR> url(str::conv::FromHtmlUtf8(link->str.s, link->str.len));\r\n    if (url::IsAbsolute(url))\r\n        return new EbookLink(link, rect, nullptr, pageNo);\r\n\r\n    DrawInstr *baseAnchor = baseAnchors.At(pageNo-1);\r\n    if (baseAnchor) {\r\n        ScopedMem<char> basePath(str::DupN(baseAnchor->str.s, baseAnchor->str.len));\r\n        ScopedMem<char> relPath(ResolveHtmlEntities(link->str.s, link->str.len));\r\n        ScopedMem<char> absPath(NormalizeURL(relPath, basePath));\r\n        url.Set(str::conv::FromUtf8(absPath));\r\n    }\r\n\r\n    PageDestination *dest = GetNamedDest(url);\r\n    if (!dest)\r\n        return nullptr;\r\n    return new EbookLink(link, rect, dest, pageNo);\r\n}\r\n\r\nVec<PageElement *> *EbookEngine::GetElements(int pageNo)\r\n{\r\n    Vec<PageElement *> *els = new Vec<PageElement *>();\r\n\r\n    Vec<DrawInstr> *pageInstrs = GetHtmlPage(pageNo);\r\n    for (DrawInstr& i : *pageInstrs) {\r\n        if (InstrImage == i.type)\r\n            els->Append(new ImageDataElement(pageNo, &i.img, GetInstrBbox(i, pageBorder)));\r\n        else if (InstrLinkStart == i.type && !i.bbox.IsEmptyArea()) {\r\n            PageElement *link = CreatePageLink(&i, GetInstrBbox(i, pageBorder), pageNo);\r\n            if (link)\r\n                els->Append(link);\r\n        }\r\n    }\r\n\r\n    return els;\r\n}\r\n\r\nPageElement *EbookEngine::GetElementAtPos(int pageNo, PointD pt)\r\n{\r\n    Vec<PageElement *> *els = GetElements(pageNo);\r\n    if (!els)\r\n        return nullptr;\r\n\r\n    PageElement *el = nullptr;\r\n    for (size_t i = 0; i < els->Count() && !el; i++)\r\n        if (els->At(i)->GetRect().Contains(pt))\r\n            el = els->At(i);\r\n\r\n    if (el)\r\n        els->Remove(el);\r\n    DeleteVecMembers(*els);\r\n    delete els;\r\n\r\n    return el;\r\n}\r\n\r\nPageDestination *EbookEngine::GetNamedDest(const WCHAR *name)\r\n{\r\n    ScopedMem<char> name_utf8(str::conv::ToUtf8(name));\r\n    const char *id = name_utf8;\r\n    if (str::FindChar(id, '#'))\r\n        id = str::FindChar(id, '#') + 1;\r\n\r\n    // if the name consists of both path and ID,\r\n    // try to first skip to the page with the desired\r\n    // path before looking for the ID to allow\r\n    // for the same ID to be reused on different pages\r\n    DrawInstr *baseAnchor = nullptr;\r\n    int basePageNo = 0;\r\n    if (id > name_utf8 + 1) {\r\n        size_t base_len = id - name_utf8 - 1;\r\n        for (size_t i = 0; i < baseAnchors.Count(); i++) {\r\n            DrawInstr *anchor = baseAnchors.At(i);\r\n            if (anchor && base_len == anchor->str.len &&\r\n                str::EqNI(name_utf8, anchor->str.s, base_len)) {\r\n                baseAnchor = anchor;\r\n                basePageNo = (int)i + 1;\r\n                break;\r\n            }\r\n        }\r\n    }\r\n\r\n    size_t id_len = str::Len(id);\r\n    for (size_t i = 0; i < anchors.Count(); i++) {\r\n        PageAnchor *anchor = &anchors.At(i);\r\n        if (baseAnchor) {\r\n            if (anchor->instr == baseAnchor)\r\n                baseAnchor = nullptr;\r\n            continue;\r\n        }\r\n        // note: at least CHM treats URLs as case-independent\r\n        if (id_len == anchor->instr->str.len &&\r\n            str::EqNI(id, anchor->instr->str.s, id_len)) {\r\n            RectD rect(0, anchor->instr->bbox.Y + pageBorder, pageRect.dx, 10);\r\n            rect.Inflate(-pageBorder, 0);\r\n            return new SimpleDest2(anchor->pageNo, rect);\r\n        }\r\n    }\r\n\r\n    // don't fail if an ID doesn't exist in a merged document\r\n    if (basePageNo != 0) {\r\n        RectD rect(0, pageBorder, pageRect.dx, 10);\r\n        rect.Inflate(-pageBorder, 0);\r\n        return new SimpleDest2(basePageNo, rect);\r\n    }\r\n\r\n    return nullptr;\r\n}\r\n\r\nWCHAR *EbookEngine::ExtractFontList()\r\n{\r\n    ScopedCritSec scope(&pagesAccess);\r\n\r\n    Vec<mui::CachedFont *> seenFonts;\r\n    WStrVec fonts;\r\n\r\n    for (int pageNo = 1; pageNo <= PageCount(); pageNo++) {\r\n        Vec<DrawInstr> *pageInstrs = GetHtmlPage(pageNo);\r\n        if (!pageInstrs)\r\n            continue;\r\n\r\n        for (DrawInstr& i : *pageInstrs) {\r\n            if (InstrSetFont != i.type || seenFonts.Contains(i.font))\r\n                continue;\r\n            seenFonts.Append(i.font);\r\n\r\n            FontFamily family;\r\n            if (!i.font->font) {\r\n                // TODO: handle gdi\r\n                CrashIf(!i.font->GetHFont());\r\n                continue;\r\n            }\r\n            Status ok = i.font->font->GetFamily(&family);\r\n            if (ok != Ok)\r\n                continue;\r\n            WCHAR fontName[LF_FACESIZE];\r\n            ok = family.GetFamilyName(fontName);\r\n            if (ok != Ok || fonts.FindI(fontName) != -1)\r\n                continue;\r\n            fonts.Append(str::Dup(fontName));\r\n        }\r\n    }\r\n    if (fonts.Count() == 0)\r\n        return nullptr;\r\n\r\n    fonts.SortNatural();\r\n    return fonts.Join(L\"\\n\");\r\n}\r\n\r\nstatic void AppendTocItem(EbookTocItem *& root, EbookTocItem *item, int level)\r\n{\r\n    if (!root) {\r\n        root = item;\r\n        return;\r\n    }\r\n    // find the last child at each level, until finding the parent of the new item\r\n    DocTocItem *r2 = root;\r\n    while (--level > 0) {\r\n        for (; r2->next; r2 = r2->next);\r\n        if (r2->child)\r\n            r2 = r2->child;\r\n        else {\r\n            r2->child = item;\r\n            return;\r\n        }\r\n    }\r\n    r2->AddSibling(item);\r\n}\r\n\r\nclass EbookTocBuilder : public EbookTocVisitor {\r\n    BaseEngine *engine;\r\n    EbookTocItem *root;\r\n    int idCounter;\r\n    bool isIndex;\r\n\r\npublic:\r\n    explicit EbookTocBuilder(BaseEngine *engine) :\r\n        engine(engine), root(nullptr), idCounter(0), isIndex(false) { }\r\n\r\n    virtual void Visit(const WCHAR *name, const WCHAR *url, int level) {\r\n        PageDestination *dest;\r\n        if (!url)\r\n            dest = nullptr;\r\n        else if (url::IsAbsolute(url))\r\n            dest = new SimpleDest2(0, RectD(), str::Dup(url));\r\n        else {\r\n            dest = engine->GetNamedDest(url);\r\n            if (!dest && str::FindChar(url, '%')) {\r\n                ScopedMem<WCHAR> decodedUrl(str::Dup(url));\r\n                url::DecodeInPlace(decodedUrl);\r\n                dest = engine->GetNamedDest(decodedUrl);\r\n            }\r\n        }\r\n\r\n        EbookTocItem *item = new EbookTocItem(str::Dup(name), dest);\r\n        item->id = ++idCounter;\r\n        if (isIndex) {\r\n            item->pageNo = 0;\r\n            level++;\r\n        }\r\n        AppendTocItem(root, item, level);\r\n    }\r\n\r\n    EbookTocItem *GetRoot() { return root; }\r\n    void SetIsIndex(bool value) { isIndex = value; }\r\n};\r\n\r\n/* BaseEngine for handling EPUB documents */\r\n\r\nclass EpubEngineImpl : public EbookEngine {\r\npublic:\r\n    EpubEngineImpl() : EbookEngine(), doc(nullptr), stream(nullptr) { }\r\n    virtual ~EpubEngineImpl();\r\n    BaseEngine *Clone() override {\r\n        if (stream)\r\n            return CreateFromStream(stream);\r\n        return fileName ? CreateFromFile(fileName) : nullptr;\r\n    }\r\n\r\n    unsigned char *GetFileData(size_t *cbCount) override;\r\n    bool SaveFileAs(const WCHAR *copyFileName, bool includeUserAnnots=false) override;\r\n\r\n    PageLayoutType PreferredLayout() override;\r\n\r\n    WCHAR *GetProperty(DocumentProperty prop) override {\r\n        return prop != Prop_FontList ? doc->GetProperty(prop) : ExtractFontList();\r\n    }\r\n    const WCHAR *GetDefaultFileExt() const override { return L\".epub\"; }\r\n\r\n    bool HasTocTree() const override { return doc->HasToc(); }\r\n    DocTocItem *GetTocTree() override;\r\n\r\n    static BaseEngine *CreateFromFile(const WCHAR *fileName);\r\n    static BaseEngine *CreateFromStream(IStream *stream);\r\n\r\nprotected:\r\n    EpubDoc *doc;\r\n    IStream *stream;\r\n\r\n    bool Load(const WCHAR *fileName);\r\n    bool Load(IStream *stream);\r\n    bool FinishLoading();\r\n};\r\n\r\nEpubEngineImpl::~EpubEngineImpl()\r\n{\r\n    delete doc;\r\n    if (stream)\r\n        stream->Release();\r\n}\r\n\r\nbool EpubEngineImpl::Load(const WCHAR *fileName)\r\n{\r\n    this->fileName = str::Dup(fileName);\r\n    if (dir::Exists(fileName)) {\r\n        // load uncompressed documents as a recompressed ZIP stream\r\n        ScopedComPtr<IStream> zipStream(OpenDirAsZipStream(fileName, true));\r\n        if (!zipStream)\r\n            return false;\r\n        return Load(zipStream);\r\n    }\r\n    doc = EpubDoc::CreateFromFile(fileName);\r\n    return FinishLoading();\r\n}\r\n\r\nbool EpubEngineImpl::Load(IStream *stream)\r\n{\r\n    stream->AddRef();\r\n    this->stream = stream;\r\n    doc = EpubDoc::CreateFromStream(stream);\r\n    return FinishLoading();\r\n}\r\n\r\nbool EpubEngineImpl::FinishLoading()\r\n{\r\n    if (!doc)\r\n        return false;\r\n\r\n    HtmlFormatterArgs args;\r\n    args.htmlStr = doc->GetHtmlData(&args.htmlStrLen);\r\n    args.pageDx = (float)pageRect.dx - 2 * pageBorder;\r\n    args.pageDy = (float)pageRect.dy - 2 * pageBorder;\r\n    args.SetFontName(GetDefaultFontName());\r\n    args.fontSize = GetDefaultFontSize();\r\n    args.textAllocator = &allocator;\r\n    args.textRenderMethod = mui::TextRenderMethodGdiplusQuick;\r\n\r\n    pages = EpubFormatter(&args, doc).FormatAllPages(false);\r\n    if (!ExtractPageAnchors())\r\n        return false;\r\n\r\n    return pages->Count() > 0;\r\n}\r\n\r\nunsigned char *EpubEngineImpl::GetFileData(size_t *cbCount)\r\n{\r\n    if (stream) {\r\n        ScopedMem<void> data(GetDataFromStream(stream, cbCount));\r\n        if (data)\r\n            return (unsigned char *)data.StealData();\r\n    }\r\n    if (!fileName)\r\n        return nullptr;\r\n    return (unsigned char *)file::ReadAll(fileName, cbCount);\r\n}\r\n\r\nbool EpubEngineImpl::SaveFileAs(const WCHAR *copyFileName, bool includeUserAnnots)\r\n{\r\n    UNUSED(includeUserAnnots);\r\n    if (stream) {\r\n        size_t len;\r\n        ScopedMem<void> data(GetDataFromStream(stream, &len));\r\n        if (data && file::WriteAll(copyFileName, data, len))\r\n            return true;\r\n    }\r\n    if (!fileName)\r\n        return false;\r\n    return CopyFile(fileName, copyFileName, FALSE);\r\n}\r\n\r\nPageLayoutType EpubEngineImpl::PreferredLayout()\r\n{\r\n    if (doc->IsRTL())\r\n        return (PageLayoutType)(Layout_Book | Layout_R2L);\r\n    return Layout_Book;\r\n}\r\n\r\nDocTocItem *EpubEngineImpl::GetTocTree()\r\n{\r\n    EbookTocBuilder builder(this);\r\n    doc->ParseToc(&builder);\r\n    EbookTocItem *root = builder.GetRoot();\r\n    if (root)\r\n        root->OpenSingleNode();\r\n    return root;\r\n}\r\n\r\nBaseEngine *EpubEngineImpl::CreateFromFile(const WCHAR *fileName)\r\n{\r\n    EpubEngineImpl *engine = new EpubEngineImpl();\r\n    if (!engine->Load(fileName)) {\r\n        delete engine;\r\n        return nullptr;\r\n    }\r\n    return engine;\r\n}\r\n\r\nBaseEngine *EpubEngineImpl::CreateFromStream(IStream *stream)\r\n{\r\n    EpubEngineImpl *engine = new EpubEngineImpl();\r\n    if (!engine->Load(stream)) {\r\n        delete engine;\r\n        return nullptr;\r\n    }\r\n    return engine;\r\n}\r\n\r\nnamespace EpubEngine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff)\r\n{\r\n    if (sniff && dir::Exists(fileName)) {\r\n        ScopedMem<WCHAR> mimetypePath(path::Join(fileName, L\"mimetype\"));\r\n        return file::StartsWith(mimetypePath, \"application/epub+zip\");\r\n    }\r\n    return EpubDoc::IsSupportedFile(fileName, sniff);\r\n}\r\n\r\nBaseEngine *CreateFromFile(const WCHAR *fileName)\r\n{\r\n    return EpubEngineImpl::CreateFromFile(fileName);\r\n}\r\n\r\nBaseEngine *CreateFromStream(IStream *stream)\r\n{\r\n    return EpubEngineImpl::CreateFromStream(stream);\r\n}\r\n\r\n}\r\n\r\n/* BaseEngine for handling FictionBook2 documents */\r\n\r\nclass Fb2EngineImpl : public EbookEngine {\r\npublic:\r\n    Fb2EngineImpl() : EbookEngine(), doc(nullptr) { }\r\n    virtual ~Fb2EngineImpl() { delete doc; }\r\n    BaseEngine *Clone() override {\r\n        return fileName ? CreateFromFile(fileName) : nullptr;\r\n    }\r\n\r\n    WCHAR *GetProperty(DocumentProperty prop) override {\r\n        return prop != Prop_FontList ? doc->GetProperty(prop) : ExtractFontList();\r\n    }\r\n    const WCHAR *GetDefaultFileExt() const override {\r\n        return doc->IsZipped() ? L\".fb2z\" : L\".fb2\";\r\n    }\r\n\r\n    bool HasTocTree() const override { return doc->HasToc(); }\r\n    DocTocItem *GetTocTree() override;\r\n\r\n    static BaseEngine *CreateFromFile(const WCHAR *fileName);\r\n    static BaseEngine *CreateFromStream(IStream *stream);\r\n\r\nprotected:\r\n    Fb2Doc *doc;\r\n\r\n    bool Load(const WCHAR *fileName);\r\n    bool Load(IStream *stream);\r\n    bool FinishLoading();\r\n};\r\n\r\nbool Fb2EngineImpl::Load(const WCHAR *fileName)\r\n{\r\n    this->fileName = str::Dup(fileName);\r\n    doc = Fb2Doc::CreateFromFile(fileName);\r\n    return FinishLoading();\r\n}\r\n\r\nbool Fb2EngineImpl::Load(IStream *stream)\r\n{\r\n    doc = Fb2Doc::CreateFromStream(stream);\r\n    return FinishLoading();\r\n}\r\n\r\nbool Fb2EngineImpl::FinishLoading()\r\n{\r\n    if (!doc)\r\n        return false;\r\n\r\n    HtmlFormatterArgs args;\r\n    args.htmlStr = doc->GetXmlData(&args.htmlStrLen);\r\n    args.pageDx = (float)pageRect.dx - 2 * pageBorder;\r\n    args.pageDy = (float)pageRect.dy - 2 * pageBorder;\r\n    args.SetFontName(GetDefaultFontName());\r\n    args.fontSize = GetDefaultFontSize();\r\n    args.textAllocator = &allocator;\r\n    args.textRenderMethod = mui::TextRenderMethodGdiplusQuick;\r\n\r\n    pages = Fb2Formatter(&args, doc).FormatAllPages(false);\r\n    if (!ExtractPageAnchors())\r\n        return false;\r\n\r\n    return pages->Count() > 0;\r\n}\r\n\r\nDocTocItem *Fb2EngineImpl::GetTocTree()\r\n{\r\n    EbookTocBuilder builder(this);\r\n    doc->ParseToc(&builder);\r\n    EbookTocItem *root = builder.GetRoot();\r\n    if (root)\r\n        root->OpenSingleNode();\r\n    return root;\r\n}\r\n\r\nBaseEngine *Fb2EngineImpl::CreateFromFile(const WCHAR *fileName)\r\n{\r\n    Fb2EngineImpl *engine = new Fb2EngineImpl();\r\n    if (!engine->Load(fileName)) {\r\n        delete engine;\r\n        return nullptr;\r\n    }\r\n    return engine;\r\n}\r\n\r\nBaseEngine *Fb2EngineImpl::CreateFromStream(IStream *stream)\r\n{\r\n    Fb2EngineImpl *engine = new Fb2EngineImpl();\r\n    if (!engine->Load(stream)) {\r\n        delete engine;\r\n        return nullptr;\r\n    }\r\n    return engine;\r\n}\r\n\r\nnamespace Fb2Engine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff)\r\n{\r\n    return Fb2Doc::IsSupportedFile(fileName, sniff);\r\n}\r\n\r\nBaseEngine *CreateFromFile(const WCHAR *fileName)\r\n{\r\n    return Fb2EngineImpl::CreateFromFile(fileName);\r\n}\r\n\r\nBaseEngine *CreateFromStream(IStream *stream)\r\n{\r\n    return Fb2EngineImpl::CreateFromStream(stream);\r\n}\r\n\r\n}\r\n\r\n/* BaseEngine for handling Mobi documents */\r\n\r\n#include \"MobiDoc.h\"\r\n\r\nclass MobiEngineImpl : public EbookEngine {\r\npublic:\r\n    MobiEngineImpl() : EbookEngine(), doc(nullptr) { }\r\n    ~MobiEngineImpl() override { delete doc; }\r\n    BaseEngine *Clone() override {\r\n        return fileName ? CreateFromFile(fileName) : nullptr;\r\n    }\r\n\r\n    WCHAR *GetProperty(DocumentProperty prop) override {\r\n        return prop != Prop_FontList ? doc->GetProperty(prop) : ExtractFontList();\r\n    }\r\n    const WCHAR *GetDefaultFileExt() const override { return L\".mobi\"; }\r\n\r\n    PageDestination *GetNamedDest(const WCHAR *name) override;\r\n    bool HasTocTree() const override { return doc->HasToc(); }\r\n    DocTocItem *GetTocTree() override;\r\n\r\n    static BaseEngine *CreateFromFile(const WCHAR *fileName);\r\n    static BaseEngine *CreateFromStream(IStream *stream);\r\n\r\nprotected:\r\n    MobiDoc *doc;\r\n\r\n    bool Load(const WCHAR *fileName);\r\n    bool Load(IStream *stream);\r\n    bool FinishLoading();\r\n};\r\n\r\nbool MobiEngineImpl::Load(const WCHAR *fileName)\r\n{\r\n    this->fileName = str::Dup(fileName);\r\n    doc = MobiDoc::CreateFromFile(fileName);\r\n    return FinishLoading();\r\n}\r\n\r\nbool MobiEngineImpl::Load(IStream *stream)\r\n{\r\n    doc = MobiDoc::CreateFromStream(stream);\r\n    return FinishLoading();\r\n}\r\n\r\nbool MobiEngineImpl::FinishLoading()\r\n{\r\n    if (!doc || Pdb_Mobipocket != doc->GetDocType())\r\n        return false;\r\n\r\n    HtmlFormatterArgs args;\r\n    args.htmlStr = doc->GetHtmlData(args.htmlStrLen);\r\n    args.pageDx = (float)pageRect.dx - 2 * pageBorder;\r\n    args.pageDy = (float)pageRect.dy - 2 * pageBorder;\r\n    args.SetFontName(GetDefaultFontName());\r\n    args.fontSize = GetDefaultFontSize();\r\n    args.textAllocator = &allocator;\r\n    args.textRenderMethod = mui::TextRenderMethodGdiplusQuick;\r\n\r\n    pages = MobiFormatter(&args, doc).FormatAllPages();\r\n    if (!ExtractPageAnchors())\r\n        return false;\r\n\r\n    return pages->Count() > 0;\r\n}\r\n\r\nPageDestination *MobiEngineImpl::GetNamedDest(const WCHAR *name)\r\n{\r\n    int filePos = _wtoi(name);\r\n    if (filePos < 0 || 0 == filePos && *name != '0')\r\n        return nullptr;\r\n    int pageNo;\r\n    for (pageNo = 1; pageNo < PageCount(); pageNo++) {\r\n        if (pages->At(pageNo)->reparseIdx > filePos)\r\n            break;\r\n    }\r\n    CrashIf(pageNo < 1 || pageNo > PageCount());\r\n\r\n    size_t htmlLen;\r\n    char *start = doc->GetHtmlData(htmlLen);\r\n    if ((size_t)filePos > htmlLen)\r\n        return nullptr;\r\n\r\n    ScopedCritSec scope(&pagesAccess);\r\n    Vec<DrawInstr> *pageInstrs = GetHtmlPage(pageNo);\r\n    // link to the bottom of the page, if filePos points\r\n    // beyond the last visible DrawInstr of a page\r\n    float currY = (float)pageRect.dy;\r\n    for (DrawInstr& i : *pageInstrs) {\r\n        if ((InstrString == i.type || InstrRtlString == i.type) &&\r\n            i.str.s >= start && i.str.s <= start + htmlLen &&\r\n            i.str.s - start >= filePos) {\r\n            currY = i.bbox.Y;\r\n            break;\r\n        }\r\n    }\r\n    RectD rect(0, currY + pageBorder, pageRect.dx, 10);\r\n    rect.Inflate(-pageBorder, 0);\r\n    return new SimpleDest2(pageNo, rect);\r\n}\r\n\r\nDocTocItem *MobiEngineImpl::GetTocTree()\r\n{\r\n    EbookTocBuilder builder(this);\r\n    doc->ParseToc(&builder);\r\n    EbookTocItem *root = builder.GetRoot();\r\n    if (root)\r\n        root->OpenSingleNode();\r\n    return root;\r\n}\r\n\r\nBaseEngine *MobiEngineImpl::CreateFromFile(const WCHAR *fileName)\r\n{\r\n    MobiEngineImpl *engine = new MobiEngineImpl();\r\n    if (!engine->Load(fileName)) {\r\n        delete engine;\r\n        return nullptr;\r\n    }\r\n    return engine;\r\n}\r\n\r\nBaseEngine *MobiEngineImpl::CreateFromStream(IStream *stream)\r\n{\r\n    MobiEngineImpl *engine = new MobiEngineImpl();\r\n    if (!engine->Load(stream)) {\r\n        delete engine;\r\n        return nullptr;\r\n    }\r\n    return engine;\r\n}\r\n\r\nnamespace MobiEngine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff)\r\n{\r\n    return MobiDoc::IsSupportedFile(fileName, sniff);\r\n}\r\n\r\nBaseEngine *CreateFromFile(const WCHAR *fileName)\r\n{\r\n    return MobiEngineImpl::CreateFromFile(fileName);\r\n}\r\n\r\nBaseEngine *CreateFromStream(IStream *stream)\r\n{\r\n    return MobiEngineImpl::CreateFromStream(stream);\r\n}\r\n\r\n}\r\n\r\n/* BaseEngine for handling PalmDOC documents (and extensions such as TealDoc) */\r\n\r\nclass PdbEngineImpl : public EbookEngine {\r\npublic:\r\n    PdbEngineImpl() : EbookEngine(), doc(nullptr) { }\r\n    virtual ~PdbEngineImpl() { delete doc; }\r\n    BaseEngine *Clone() override {\r\n        return fileName ? CreateFromFile(fileName) : nullptr;\r\n    }\r\n\r\n    WCHAR *GetProperty(DocumentProperty prop) override {\r\n        return prop != Prop_FontList ? doc->GetProperty(prop) : ExtractFontList();\r\n    }\r\n    const WCHAR *GetDefaultFileExt() const override { return L\".pdb\"; }\r\n\r\n    bool HasTocTree() const override { return doc->HasToc(); }\r\n    DocTocItem *GetTocTree() override;\r\n\r\n    static BaseEngine *CreateFromFile(const WCHAR *fileName);\r\n\r\nprotected:\r\n    PalmDoc *doc;\r\n\r\n    bool Load(const WCHAR *fileName);\r\n};\r\n\r\nbool PdbEngineImpl::Load(const WCHAR *fileName)\r\n{\r\n    this->fileName = str::Dup(fileName);\r\n\r\n    doc = PalmDoc::CreateFromFile(fileName);\r\n    if (!doc)\r\n        return false;\r\n\r\n    HtmlFormatterArgs args;\r\n    args.htmlStr = doc->GetHtmlData(&args.htmlStrLen);\r\n    args.pageDx = (float)pageRect.dx - 2 * pageBorder;\r\n    args.pageDy = (float)pageRect.dy - 2 * pageBorder;\r\n    args.SetFontName(GetDefaultFontName());\r\n    args.fontSize = GetDefaultFontSize();\r\n    args.textAllocator = &allocator;\r\n    args.textRenderMethod = mui::TextRenderMethodGdiplusQuick;\r\n\r\n    pages = HtmlFormatter(&args).FormatAllPages();\r\n    if (!ExtractPageAnchors())\r\n        return false;\r\n\r\n    return pages->Count() > 0;\r\n}\r\n\r\nDocTocItem *PdbEngineImpl::GetTocTree()\r\n{\r\n    EbookTocBuilder builder(this);\r\n    doc->ParseToc(&builder);\r\n    return builder.GetRoot();\r\n}\r\n\r\nBaseEngine *PdbEngineImpl::CreateFromFile(const WCHAR *fileName)\r\n{\r\n    PdbEngineImpl *engine = new PdbEngineImpl();\r\n    if (!engine->Load(fileName)) {\r\n        delete engine;\r\n        return nullptr;\r\n    }\r\n    return engine;\r\n}\r\n\r\nnamespace PdbEngine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff)\r\n{\r\n    return PalmDoc::IsSupportedFile(fileName, sniff);\r\n}\r\n\r\nBaseEngine *CreateFromFile(const WCHAR *fileName)\r\n{\r\n    return PdbEngineImpl::CreateFromFile(fileName);\r\n}\r\n\r\n}\r\n\r\n/* formatting extensions for CHM */\r\n\r\n#include \"ChmDoc.h\"\r\n\r\nclass ChmDataCache {\r\n    ChmDoc *doc; // owned by creator\r\n    ScopedMem<char> html;\r\n    Vec<ImageData2> images;\r\n\r\npublic:\r\n    ChmDataCache(ChmDoc *doc, char *html) : doc(doc), html(html) { }\r\n    ~ChmDataCache() {\r\n        for (size_t i = 0; i < images.Count(); i++) {\r\n            free(images.At(i).base.data);\r\n            free(images.At(i).id);\r\n        }\r\n    }\r\n\r\n    const char *GetHtmlData(size_t *lenOut) {\r\n        *lenOut = str::Len(html);\r\n        return html;\r\n    }\r\n\r\n    ImageData *GetImageData(const char *id, const char *pagePath) {\r\n        ScopedMem<char> url(NormalizeURL(id, pagePath));\r\n        for (size_t i = 0; i < images.Count(); i++) {\r\n            if (str::Eq(images.At(i).id, url))\r\n                return &images.At(i).base;\r\n        }\r\n\r\n        ImageData2 data = { 0 };\r\n        data.base.data = (char *)doc->GetData(url, &data.base.len);\r\n        if (!data.base.data)\r\n            return nullptr;\r\n        data.id = url.StealData();\r\n        images.Append(data);\r\n        return &images.Last().base;\r\n    }\r\n\r\n    char *GetFileData(const char *relPath, const char *pagePath, size_t *lenOut) {\r\n        ScopedMem<char> url(NormalizeURL(relPath, pagePath));\r\n        return (char *)doc->GetData(url, lenOut);\r\n    }\r\n};\r\n\r\nclass ChmFormatter : public HtmlFormatter {\r\nprotected:\r\n    virtual void HandleTagImg(HtmlToken *t);\r\n    virtual void HandleTagPagebreak(HtmlToken *t);\r\n    virtual void HandleTagLink(HtmlToken *t);\r\n\r\n    ChmDataCache *chmDoc;\r\n    ScopedMem<char> pagePath;\r\n\r\npublic:\r\n    ChmFormatter(HtmlFormatterArgs *args, ChmDataCache *doc) :\r\n        HtmlFormatter(args), chmDoc(doc) { }\r\n};\r\n\r\nvoid ChmFormatter::HandleTagImg(HtmlToken *t)\r\n{\r\n    CrashIf(!chmDoc);\r\n    if (t->IsEndTag())\r\n        return;\r\n    bool needAlt = true;\r\n    AttrInfo *attr = t->GetAttrByName(\"src\");\r\n    if (attr) {\r\n        ScopedMem<char> src(str::DupN(attr->val, attr->valLen));\r\n        url::DecodeInPlace(src);\r\n        ImageData *img = chmDoc->GetImageData(src, pagePath);\r\n        needAlt = !img || !EmitImage(img);\r\n    }\r\n    if (needAlt && (attr = t->GetAttrByName(\"alt\")) != nullptr)\r\n        HandleText(attr->val, attr->valLen);\r\n}\r\n\r\nvoid ChmFormatter::HandleTagPagebreak(HtmlToken *t)\r\n{\r\n    AttrInfo *attr = t->GetAttrByName(\"page_path\");\r\n    if (!attr || pagePath)\r\n        ForceNewPage();\r\n    if (attr) {\r\n        RectF bbox(0, currY, pageDx, 0);\r\n        currPage->instructions.Append(DrawInstr::Anchor(attr->val, attr->valLen, bbox));\r\n        pagePath.Set(str::DupN(attr->val, attr->valLen));\r\n        // reset CSS style rules for the new document\r\n        styleRules.Reset();\r\n    }\r\n}\r\n\r\nvoid ChmFormatter::HandleTagLink(HtmlToken *t)\r\n{\r\n    CrashIf(!chmDoc);\r\n    if (t->IsEndTag())\r\n        return;\r\n    AttrInfo *attr = t->GetAttrByName(\"rel\");\r\n    if (!attr || !attr->ValIs(\"stylesheet\"))\r\n        return;\r\n    attr = t->GetAttrByName(\"type\");\r\n    if (attr && !attr->ValIs(\"text/css\"))\r\n        return;\r\n    attr = t->GetAttrByName(\"href\");\r\n    if (!attr)\r\n        return;\r\n\r\n    size_t len;\r\n    ScopedMem<char> src(str::DupN(attr->val, attr->valLen));\r\n    url::DecodeInPlace(src);\r\n    ScopedMem<char> data(chmDoc->GetFileData(src, pagePath, &len));\r\n    if (data)\r\n        ParseStyleSheet(data, len);\r\n}\r\n\r\n/* BaseEngine for handling CHM documents */\r\n\r\nclass ChmEmbeddedDest;\r\n\r\nclass ChmEngineImpl : public EbookEngine {\r\n    friend ChmEmbeddedDest;\r\n\r\npublic:\r\n    ChmEngineImpl() : EbookEngine(), doc(nullptr), dataCache(nullptr) {\r\n        // ISO 216 A4 (210mm x 297mm)\r\n        pageRect = RectD(0, 0, 8.27 * GetFileDPI(), 11.693 * GetFileDPI());\r\n    }\r\n    virtual ~ChmEngineImpl() {\r\n        delete dataCache;\r\n        delete doc;\r\n    }\r\n    BaseEngine *Clone() override {\r\n        return fileName ? CreateFromFile(fileName) : nullptr;\r\n    }\r\n\r\n    WCHAR *GetProperty(DocumentProperty prop) override {\r\n        return prop != Prop_FontList ? doc->GetProperty(prop) : ExtractFontList();\r\n    }\r\n    const WCHAR *GetDefaultFileExt() const override { return L\".chm\"; }\r\n\r\n    PageLayoutType PreferredLayout() override { return Layout_Single; }\r\n\r\n    PageDestination *GetNamedDest(const WCHAR *name) override;\r\n    bool HasTocTree() const override { return doc->HasToc() || doc->HasIndex(); }\r\n    DocTocItem *GetTocTree() override;\r\n\r\n    static BaseEngine *CreateFromFile(const WCHAR *fileName);\r\n\r\nprotected:\r\n    ChmDoc *doc;\r\n    ChmDataCache *dataCache;\r\n\r\n    bool Load(const WCHAR *fileName);\r\n\r\n    virtual PageElement *CreatePageLink(DrawInstr *link, RectI rect, int pageNo);\r\n    bool SaveEmbedded(LinkSaverUI& saveUI, const char *path);\r\n};\r\n\r\n// cf. http://www.w3.org/TR/html4/charset.html#h-5.2.2\r\nstatic UINT ExtractHttpCharset(const char *html, size_t htmlLen)\r\n{\r\n    if (!strstr(html, \"charset=\"))\r\n        return 0;\r\n\r\n    HtmlPullParser parser(html, std::min(htmlLen, (size_t)1024));\r\n    HtmlToken *tok;\r\n    while ((tok = parser.Next()) != nullptr && !tok->IsError()) {\r\n        if (tok->tag != Tag_Meta)\r\n            continue;\r\n        AttrInfo *attr = tok->GetAttrByName(\"http-equiv\");\r\n        if (!attr || !attr->ValIs(\"Content-Type\"))\r\n            continue;\r\n        attr = tok->GetAttrByName(\"content\");\r\n        ScopedMem<char> mimetype, charset;\r\n        if (!attr || !str::Parse(attr->val, attr->valLen, \"%S;%_charset=%S\", &mimetype, &charset))\r\n            continue;\r\n\r\n        static struct {\r\n            const char *name;\r\n            UINT codepage;\r\n        } codepages[] = {\r\n            { \"ISO-8859-1\", 1252 }, { \"Latin1\", 1252 }, { \"CP1252\", 1252 }, { \"Windows-1252\", 1252 },\r\n            { \"ISO-8859-2\", 28592 }, { \"Latin2\", 28592 },\r\n            { \"CP1251\", 1251 }, { \"Windows-1251\", 1251 }, { \"KOI8-R\", 20866 },\r\n            { \"shift-jis\", 932 }, { \"x-euc\", 932 }, { \"euc-kr\", 949 },\r\n            { \"Big5\", 950 }, { \"GB2312\", 936 },\r\n            { \"UTF-8\", CP_UTF8 },\r\n        };\r\n        for (int i = 0; i < dimof(codepages); i++) {\r\n            if (str::EqI(charset, codepages[i].name))\r\n                return codepages[i].codepage;\r\n        }\r\n        break;\r\n    }\r\n\r\n    return 0;\r\n}\r\n\r\nclass ChmHtmlCollector : public EbookTocVisitor {\r\n    ChmDoc *doc;\r\n    WStrList added;\r\n    str::Str<char> html;\r\n\r\npublic:\r\n    explicit ChmHtmlCollector(ChmDoc *doc) : doc(doc) { }\r\n\r\n    char *GetHtml() {\r\n        // first add the homepage\r\n        const char *index = doc->GetHomePath();\r\n        ScopedMem<WCHAR> url(doc->ToStr(index));\r\n        Visit(nullptr, url, 0);\r\n\r\n        // then add all pages linked to from the table of contents\r\n        doc->ParseToc(this);\r\n\r\n        // finally add all the remaining HTML files\r\n        Vec<char *> *paths = doc->GetAllPaths();\r\n        for (size_t i = 0; i < paths->Count(); i++) {\r\n            char *path = paths->At(i);\r\n            if (str::EndsWithI(path, \".htm\") || str::EndsWithI(path, \".html\")) {\r\n                if (*path == '/')\r\n                    path++;\r\n                url.Set(str::conv::FromUtf8(path));\r\n                Visit(nullptr, url, -1);\r\n            }\r\n        }\r\n        paths->FreeMembers();\r\n        delete paths;\r\n\r\n        return html.StealData();\r\n    }\r\n\r\n    virtual void Visit(const WCHAR *name, const WCHAR *url, int level) {\r\n        UNUSED(name); UNUSED(level);\r\n        if (!url || url::IsAbsolute(url))\r\n            return;\r\n        ScopedMem<WCHAR> plainUrl(url::GetFullPath(url));\r\n        if (added.FindI(plainUrl) != -1)\r\n            return;\r\n        ScopedMem<char> urlUtf8(str::conv::ToUtf8(plainUrl));\r\n        size_t pageHtmlLen;\r\n        ScopedMem<unsigned char> pageHtml(doc->GetData(urlUtf8, &pageHtmlLen));\r\n        if (!pageHtml)\r\n            return;\r\n        html.AppendFmt(\"<pagebreak page_path=\\\"%s\\\" page_marker />\", urlUtf8.Get());\r\n        html.AppendAndFree(doc->ToUtf8(pageHtml, ExtractHttpCharset((const char *)pageHtml.Get(), pageHtmlLen)));\r\n        added.Append(plainUrl.StealData());\r\n    }\r\n};\r\n\r\nbool ChmEngineImpl::Load(const WCHAR *fileName)\r\n{\r\n    this->fileName = str::Dup(fileName);\r\n    doc = ChmDoc::CreateFromFile(fileName);\r\n    if (!doc)\r\n        return false;\r\n\r\n    char *html = ChmHtmlCollector(doc).GetHtml();\r\n    dataCache = new ChmDataCache(doc, html);\r\n\r\n    HtmlFormatterArgs args;\r\n    args.htmlStr = dataCache->GetHtmlData(&args.htmlStrLen);\r\n    args.pageDx = (float)pageRect.dx - 2 * pageBorder;\r\n    args.pageDy = (float)pageRect.dy - 2 * pageBorder;\r\n    args.SetFontName(GetDefaultFontName());\r\n    args.fontSize = GetDefaultFontSize();\r\n    args.textAllocator = &allocator;\r\n    args.textRenderMethod = mui::TextRenderMethodGdiplusQuick;\r\n\r\n    pages = ChmFormatter(&args, dataCache).FormatAllPages(false);\r\n    if (!ExtractPageAnchors())\r\n        return false;\r\n\r\n    return pages->Count() > 0;\r\n}\r\n\r\nPageDestination *ChmEngineImpl::GetNamedDest(const WCHAR *name)\r\n{\r\n    PageDestination *dest = EbookEngine::GetNamedDest(name);\r\n    if (!dest) {\r\n        unsigned int topicID;\r\n        if (str::Parse(name, L\"%u%$\", &topicID)) {\r\n            ScopedMem<char> urlUtf8(doc->ResolveTopicID(topicID));\r\n            if (urlUtf8) {\r\n                ScopedMem<WCHAR> url(str::conv::FromUtf8(urlUtf8));\r\n                dest = EbookEngine::GetNamedDest(url);\r\n            }\r\n        }\r\n    }\r\n    return dest;\r\n}\r\n\r\nDocTocItem *ChmEngineImpl::GetTocTree()\r\n{\r\n    EbookTocBuilder builder(this);\r\n    doc->ParseToc(&builder);\r\n    if (doc->HasIndex()) {\r\n        // TODO: ToC code doesn't work too well for displaying an index,\r\n        //       so this should really become a tree of its own (which\r\n        //       doesn't rely on entries being in the same order as pages)\r\n        builder.Visit(L\"Index\", nullptr, 1);\r\n        builder.SetIsIndex(true);\r\n        doc->ParseIndex(&builder);\r\n    }\r\n    EbookTocItem *root = builder.GetRoot();\r\n    if (root)\r\n        root->OpenSingleNode();\r\n    return root;\r\n}\r\n\r\nclass ChmEmbeddedDest : public PageDestination {\r\n    ChmEngineImpl *engine;\r\n    ScopedMem<char> path;\r\n\r\npublic:\r\n    ChmEmbeddedDest(ChmEngineImpl *engine, const char *path) : engine(engine), path(str::Dup(path)) { }\r\n\r\n    PageDestType GetDestType() const  override { return Dest_LaunchEmbedded; }\r\n    int GetDestPageNo() const  override { return 0; }\r\n    RectD GetDestRect() const  override { return RectD(); }\r\n    WCHAR *GetDestValue() const  override { return str::conv::FromUtf8(path::GetBaseName(path)); }\r\n\r\n    bool SaveEmbedded(LinkSaverUI& saveUI)  override { return engine->SaveEmbedded(saveUI, path); }\r\n};\r\n\r\nPageElement *ChmEngineImpl::CreatePageLink(DrawInstr *link, RectI rect, int pageNo)\r\n{\r\n    PageElement *linkEl = EbookEngine::CreatePageLink(link, rect, pageNo);\r\n    if (linkEl)\r\n        return linkEl;\r\n\r\n    DrawInstr *baseAnchor = baseAnchors.At(pageNo-1);\r\n    ScopedMem<char> basePath(str::DupN(baseAnchor->str.s, baseAnchor->str.len));\r\n    ScopedMem<char> url(str::DupN(link->str.s, link->str.len));\r\n    url.Set(NormalizeURL(url, basePath));\r\n    if (!doc->HasData(url))\r\n        return nullptr;\r\n\r\n    PageDestination *dest = new ChmEmbeddedDest(this, url);\r\n    return new EbookLink(link, rect, dest, pageNo);\r\n}\r\n\r\nbool ChmEngineImpl::SaveEmbedded(LinkSaverUI& saveUI, const char *path)\r\n{\r\n    size_t len;\r\n    ScopedMem<unsigned char> data(doc->GetData(path, &len));\r\n    if (!data)\r\n        return false;\r\n    return saveUI.SaveEmbedded(data, len);\r\n}\r\n\r\nBaseEngine *ChmEngineImpl::CreateFromFile(const WCHAR *fileName)\r\n{\r\n    ChmEngineImpl *engine = new ChmEngineImpl();\r\n    if (!engine->Load(fileName)) {\r\n        delete engine;\r\n        return nullptr;\r\n    }\r\n    return engine;\r\n}\r\n\r\nnamespace ChmEngine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff)\r\n{\r\n    return ChmDoc::IsSupportedFile(fileName, sniff);\r\n}\r\n\r\nBaseEngine *CreateFromFile(const WCHAR *fileName)\r\n{\r\n    return ChmEngineImpl::CreateFromFile(fileName);\r\n}\r\n\r\n}\r\n\r\n/* BaseEngine for handling HTML documents */\r\n/* (mainly to allow creating minimal regression test testcases more easily) */\r\n\r\nclass HtmlEngineImpl : public EbookEngine {\r\npublic:\r\n    HtmlEngineImpl() : EbookEngine(), doc(nullptr) {\r\n        // ISO 216 A4 (210mm x 297mm)\r\n        pageRect = RectD(0, 0, 8.27 * GetFileDPI(), 11.693 * GetFileDPI());\r\n    }\r\n    virtual ~HtmlEngineImpl() {\r\n        delete doc;\r\n    }\r\n    BaseEngine *Clone() override {\r\n        return fileName ? CreateFromFile(fileName) : nullptr;\r\n    }\r\n\r\n    WCHAR *GetProperty(DocumentProperty prop) override {\r\n        return prop != Prop_FontList ? doc->GetProperty(prop) : ExtractFontList();\r\n    }\r\n    const WCHAR *GetDefaultFileExt() const override { return L\".html\"; }\r\n    PageLayoutType PreferredLayout() override { return Layout_Single; }\r\n\r\n    static BaseEngine *CreateFromFile(const WCHAR *fileName);\r\n\r\nprotected:\r\n    HtmlDoc *doc;\r\n\r\n    bool Load(const WCHAR *fileName);\r\n\r\n    virtual PageElement *CreatePageLink(DrawInstr *link, RectI rect, int pageNo);\r\n};\r\n\r\nbool HtmlEngineImpl::Load(const WCHAR *fileName)\r\n{\r\n    this->fileName = str::Dup(fileName);\r\n\r\n    doc = HtmlDoc::CreateFromFile(fileName);\r\n    if (!doc)\r\n        return false;\r\n\r\n    HtmlFormatterArgs args;\r\n    args.htmlStr = doc->GetHtmlData(&args.htmlStrLen);\r\n    args.pageDx = (float)pageRect.dx - 2 * pageBorder;\r\n    args.pageDy = (float)pageRect.dy - 2 * pageBorder;\r\n    args.SetFontName(GetDefaultFontName());\r\n    args.fontSize = GetDefaultFontSize();\r\n    args.textAllocator = &allocator;\r\n    args.textRenderMethod = mui::TextRenderMethodGdiplus;\r\n\r\n    pages = HtmlFileFormatter(&args, doc).FormatAllPages(false);\r\n    if (!ExtractPageAnchors())\r\n        return false;\r\n\r\n    return pages->Count() > 0;\r\n}\r\n\r\nclass RemoteHtmlDest : public SimpleDest2 {\r\n    ScopedMem<WCHAR> name;\r\n\r\npublic:\r\n    explicit RemoteHtmlDest(const WCHAR *relativeURL) : SimpleDest2(0, RectD()) {\r\n        const WCHAR *id = str::FindChar(relativeURL, '#');\r\n        if (id) {\r\n            value.Set(str::DupN(relativeURL, id - relativeURL));\r\n            name.Set(str::Dup(id));\r\n        }\r\n        else\r\n            value.Set(str::Dup(relativeURL));\r\n    }\r\n\r\n    virtual PageDestType GetDestType() const { return Dest_LaunchFile; }\r\n    virtual WCHAR *GetDestName() const { return str::Dup(name); }\r\n};\r\n\r\nPageElement *HtmlEngineImpl::CreatePageLink(DrawInstr *link, RectI rect, int pageNo)\r\n{\r\n    if (0 == link->str.len)\r\n        return nullptr;\r\n\r\n    ScopedMem<WCHAR> url(str::conv::FromHtmlUtf8(link->str.s, link->str.len));\r\n    if (url::IsAbsolute(url) || '#' == *url)\r\n        return EbookEngine::CreatePageLink(link, rect, pageNo);\r\n\r\n    PageDestination *dest = new RemoteHtmlDest(url);\r\n    return new EbookLink(link, rect, dest, pageNo, true);\r\n}\r\n\r\nBaseEngine *HtmlEngineImpl::CreateFromFile(const WCHAR *fileName)\r\n{\r\n    HtmlEngineImpl *engine = new HtmlEngineImpl();\r\n    if (!engine->Load(fileName)) {\r\n        delete engine;\r\n        return nullptr;\r\n    }\r\n    return engine;\r\n}\r\n\r\nnamespace HtmlEngine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff)\r\n{\r\n    return HtmlDoc::IsSupportedFile(fileName, sniff);\r\n}\r\n\r\nBaseEngine *CreateFromFile(const WCHAR *fileName)\r\n{\r\n    return HtmlEngineImpl::CreateFromFile(fileName);\r\n}\r\n\r\n}\r\n\r\n/* BaseEngine for handling TXT documents */\r\n\r\nclass TxtEngineImpl : public EbookEngine {\r\npublic:\r\n    TxtEngineImpl() : EbookEngine(), doc(nullptr) {\r\n        // ISO 216 A4 (210mm x 297mm)\r\n        pageRect = RectD(0, 0, 8.27 * GetFileDPI(), 11.693 * GetFileDPI());\r\n    }\r\n    virtual ~TxtEngineImpl() { delete doc; }\r\n    BaseEngine *Clone() override {\r\n        return fileName ? CreateFromFile(fileName) : nullptr;\r\n    }\r\n\r\n    WCHAR *GetProperty(DocumentProperty prop) override {\r\n        return prop != Prop_FontList ? doc->GetProperty(prop) : ExtractFontList();\r\n    }\r\n    const WCHAR *GetDefaultFileExt() const override {\r\n        return fileName ? path::GetExt(fileName) : L\".txt\";\r\n    }\r\n    PageLayoutType PreferredLayout() override { return Layout_Single; }\r\n\r\n    bool HasTocTree() const override { return doc->HasToc(); }\r\n    DocTocItem *GetTocTree() override;\r\n\r\n    static BaseEngine *CreateFromFile(const WCHAR *fileName);\r\n\r\nprotected:\r\n    TxtDoc *doc;\r\n\r\n    bool Load(const WCHAR *fileName);\r\n};\r\n\r\nbool TxtEngineImpl::Load(const WCHAR *fileName)\r\n{\r\n    this->fileName = str::Dup(fileName);\r\n\r\n    doc = TxtDoc::CreateFromFile(fileName);\r\n    if (!doc)\r\n        return false;\r\n\r\n    if (doc->IsRFC()) {\r\n        // RFCs are targeted at letter size pages\r\n        pageRect = RectD(0, 0, 8.5 * GetFileDPI(), 11 * GetFileDPI());\r\n    }\r\n\r\n    HtmlFormatterArgs args;\r\n    args.htmlStr = doc->GetHtmlData(&args.htmlStrLen);\r\n    args.pageDx = (float)pageRect.dx - 2 * pageBorder;\r\n    args.pageDy = (float)pageRect.dy - 2 * pageBorder;\r\n    args.SetFontName(GetDefaultFontName());\r\n    args.fontSize = GetDefaultFontSize();\r\n    args.textAllocator = &allocator;\r\n    args.textRenderMethod = mui::TextRenderMethodGdiplus;\r\n\r\n    pages = TxtFormatter(&args).FormatAllPages(false);\r\n    if (!ExtractPageAnchors())\r\n        return false;\r\n\r\n    return pages->Count() > 0;\r\n}\r\n\r\nDocTocItem *TxtEngineImpl::GetTocTree()\r\n{\r\n    EbookTocBuilder builder(this);\r\n    doc->ParseToc(&builder);\r\n    return builder.GetRoot();\r\n}\r\n\r\nBaseEngine *TxtEngineImpl::CreateFromFile(const WCHAR *fileName)\r\n{\r\n    TxtEngineImpl *engine = new TxtEngineImpl();\r\n    if (!engine->Load(fileName)) {\r\n        delete engine;\r\n        return nullptr;\r\n    }\r\n    return engine;\r\n}\r\n\r\nnamespace TxtEngine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff)\r\n{\r\n    return TxtDoc::IsSupportedFile(fileName, sniff);\r\n}\r\n\r\nBaseEngine *CreateFromFile(const WCHAR *fileName)\r\n{\r\n    return TxtEngineImpl::CreateFromFile(fileName);\r\n}\r\n\r\n}\r\n"
  },
  {
    "path": "src/EbookEngine.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nnamespace EpubEngine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff=false);\r\nBaseEngine *CreateFromFile(const WCHAR *fileName);\r\nBaseEngine *CreateFromStream(IStream *stream);\r\n\r\n}\r\n\r\nnamespace Fb2Engine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff=false);\r\nBaseEngine *CreateFromFile(const WCHAR *fileName);\r\nBaseEngine *CreateFromStream(IStream *stream);\r\n\r\n}\r\n\r\nnamespace MobiEngine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff=false);\r\nBaseEngine *CreateFromFile(const WCHAR *fileName);\r\nBaseEngine *CreateFromStream(IStream *stream);\r\n\r\n}\r\n\r\nnamespace PdbEngine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff=false);\r\nBaseEngine *CreateFromFile(const WCHAR *fileName);\r\n\r\n}\r\n\r\nnamespace ChmEngine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff=false);\r\nBaseEngine *CreateFromFile(const WCHAR *fileName);\r\n\r\n}\r\n\r\nnamespace HtmlEngine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff=false);\r\nBaseEngine *CreateFromFile(const WCHAR *fileName);\r\n\r\n}\r\n\r\nnamespace TxtEngine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff=false);\r\nBaseEngine *CreateFromFile(const WCHAR *fileName);\r\n\r\n}\r\n\r\nvoid SetDefaultEbookFont(const WCHAR *name, float size);\r\n"
  },
  {
    "path": "src/EbookFormatter.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"ArchUtil.h\"\r\n#include \"GdiPlusUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"HtmlPullParser.h\"\r\n#include \"Mui.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EbookBase.h\"\r\n#include \"EbookDoc.h\"\r\n#include \"MobiDoc.h\"\r\n#include \"HtmlFormatter.h\"\r\n#include \"EbookFormatter.h\"\r\n\r\n/* Mobi-specific formatting methods */\r\n\r\nMobiFormatter::MobiFormatter(HtmlFormatterArgs* args, MobiDoc *doc) :\r\n    HtmlFormatter(args), doc(doc)\r\n{\r\n    bool fromBeginning = (0 == args->reparseIdx);\r\n    if (!doc || !fromBeginning)\r\n        return;\r\n\r\n    ImageData *img = doc->GetCoverImage();\r\n    if (!img)\r\n        return;\r\n\r\n    // TODO: vertically center the cover image?\r\n    EmitImage(img);\r\n    // only add a new page if the image isn't broken\r\n    if (currLineInstr.Count() > 0)\r\n        ForceNewPage();\r\n}\r\n\r\n// parses size in the form \"1em\" or \"3pt\". To interpret ems we need emInPoints\r\n// to be passed by the caller\r\nstatic float ParseSizeAsPixels(const char *s, size_t len, float emInPoints)\r\n{\r\n    float sizeInPoints = 0;\r\n    if (str::Parse(s, len, \"%fem\", &sizeInPoints)) {\r\n        sizeInPoints *= emInPoints;\r\n    } else if (str::Parse(s, len, \"%fin\", &sizeInPoints)) {\r\n        sizeInPoints *= 72;\r\n    } else if (str::Parse(s, len, \"%fpt\", &sizeInPoints)) {\r\n        // no conversion needed\r\n    } else if (str::Parse(s, len, \"%fpx\", &sizeInPoints)) {\r\n        return sizeInPoints;\r\n    } else {\r\n        return 0;\r\n    }\r\n    // TODO: take dpi into account\r\n    float sizeInPixels = sizeInPoints;\r\n    return sizeInPixels;\r\n}\r\n\r\nvoid MobiFormatter::HandleSpacing_Mobi(HtmlToken *t)\r\n{\r\n    if (!t->IsStartTag())\r\n        return;\r\n\r\n    // best I can tell, in mobi <p width=\"1em\" height=\"3pt> means that\r\n    // the first line of the paragrap is indented by 1em and there's\r\n    // 3pt top padding (the same seems to apply for <blockquote>)\r\n    AttrInfo *attr = t->GetAttrByName(\"width\");\r\n    if (attr) {\r\n        float lineIndent = ParseSizeAsPixels(attr->val, attr->valLen, CurrFont()->GetSize());\r\n        // there are files with negative width which produces partially invisible\r\n        // text, so don't allow that\r\n        if (lineIndent > 0) {\r\n            // this should replace the previously emitted paragraph/quote block\r\n            EmitParagraph(lineIndent);\r\n        }\r\n    }\r\n    attr = t->GetAttrByName(\"height\");\r\n    if (attr) {\r\n        // for use it in FlushCurrLine()\r\n        currLineTopPadding = ParseSizeAsPixels(attr->val, attr->valLen, CurrFont()->GetSize());\r\n    }\r\n}\r\n\r\n// mobi format has image tags in the form:\r\n// <img recindex=\"0000n\" alt=\"\"/>\r\n// where recindex is the record number of pdb record\r\n// that holds the image (within image record array, not a\r\n// global record)\r\nvoid MobiFormatter::HandleTagImg(HtmlToken *t)\r\n{\r\n    // we allow formatting raw html which can't require doc\r\n    if (!doc)\r\n        return;\r\n    bool needAlt = true;\r\n    AttrInfo *attr = t->GetAttrByName(\"recindex\");\r\n    if (attr) {\r\n        int n;\r\n        if (str::Parse(attr->val, attr->valLen, \"%d\", &n)) {\r\n            ImageData *img = doc->GetImage(n);\r\n            needAlt = !img || !EmitImage(img);\r\n        }\r\n    }\r\n    if (needAlt && (attr = t->GetAttrByName(\"alt\")) != nullptr)\r\n        HandleText(attr->val, attr->valLen);\r\n}\r\n\r\nvoid MobiFormatter::HandleHtmlTag(HtmlToken *t)\r\n{\r\n    CrashIf(!t->IsTag());\r\n\r\n    if (Tag_P == t->tag || Tag_Blockquote == t->tag) {\r\n        HtmlFormatter::HandleHtmlTag(t);\r\n        HandleSpacing_Mobi(t);\r\n    } else if (Tag_Mbp_Pagebreak == t->tag) {\r\n        ForceNewPage();\r\n    } else if (Tag_A == t->tag) {\r\n        HandleAnchorAttr(t);\r\n        // handle internal and external links (prefer internal ones)\r\n        if (!HandleTagA(t, \"filepos\"))\r\n            HandleTagA(t);\r\n    } else if (Tag_Hr == t->tag) {\r\n        // imitating Kindle: hr is proceeded by an empty line\r\n        FlushCurrLine(false);\r\n        EmitEmptyLine(lineSpacing);\r\n        EmitHr();\r\n    } else {\r\n        HtmlFormatter::HandleHtmlTag(t);\r\n    }\r\n}\r\n\r\n/* EPUB-specific formatting methods */\r\n\r\nvoid EpubFormatter::HandleTagImg(HtmlToken *t)\r\n{\r\n    CrashIf(!epubDoc);\r\n    if (t->IsEndTag())\r\n        return;\r\n    bool needAlt = true;\r\n    AttrInfo *attr = t->GetAttrByName(\"src\");\r\n    if (attr) {\r\n        ScopedMem<char> src(str::DupN(attr->val, attr->valLen));\r\n        url::DecodeInPlace(src);\r\n        ImageData *img = epubDoc->GetImageData(src, pagePath);\r\n        needAlt = !img || !EmitImage(img);\r\n    }\r\n    if (needAlt && (attr = t->GetAttrByName(\"alt\")) != nullptr)\r\n        HandleText(attr->val, attr->valLen);\r\n}\r\n\r\nvoid EpubFormatter::HandleTagPagebreak(HtmlToken *t)\r\n{\r\n    AttrInfo *attr = t->GetAttrByName(\"page_path\");\r\n    if (!attr || pagePath)\r\n        ForceNewPage();\r\n    if (attr) {\r\n        RectF bbox(0, currY, pageDx, 0);\r\n        currPage->instructions.Append(DrawInstr::Anchor(attr->val, attr->valLen, bbox));\r\n        pagePath.Set(str::DupN(attr->val, attr->valLen));\r\n        // reset CSS style rules for the new document\r\n        styleRules.Reset();\r\n    }\r\n}\r\n\r\nvoid EpubFormatter::HandleTagLink(HtmlToken *t)\r\n{\r\n    CrashIf(!epubDoc);\r\n    if (t->IsEndTag())\r\n        return;\r\n    AttrInfo *attr = t->GetAttrByName(\"rel\");\r\n    if (!attr || !attr->ValIs(\"stylesheet\"))\r\n        return;\r\n    attr = t->GetAttrByName(\"type\");\r\n    if (attr && !attr->ValIs(\"text/css\"))\r\n        return;\r\n    attr = t->GetAttrByName(\"href\");\r\n    if (!attr)\r\n        return;\r\n\r\n    size_t len;\r\n    ScopedMem<char> src(str::DupN(attr->val, attr->valLen));\r\n    url::DecodeInPlace(src);\r\n    ScopedMem<char> data(epubDoc->GetFileData(src, pagePath, &len));\r\n    if (data)\r\n        ParseStyleSheet(data, len);\r\n}\r\n\r\nvoid EpubFormatter::HandleTagSvgImage(HtmlToken *t)\r\n{\r\n    CrashIf(!epubDoc);\r\n    if (t->IsEndTag())\r\n        return;\r\n    if (!tagNesting.Contains(Tag_Svg) && Tag_Svg_Image != t->tag)\r\n        return;\r\n    AttrInfo *attr = t->GetAttrByNameNS(\"href\", \"http://www.w3.org/1999/xlink\");\r\n    if (!attr)\r\n        return;\r\n    ScopedMem<char> src(str::DupN(attr->val, attr->valLen));\r\n    url::DecodeInPlace(src);\r\n    ImageData *img = epubDoc->GetImageData(src, pagePath);\r\n    if (img)\r\n        EmitImage(img);\r\n}\r\n\r\nvoid EpubFormatter::HandleHtmlTag(HtmlToken *t)\r\n{\r\n    CrashIf(!t->IsTag());\r\n    if (hiddenDepth && t->IsEndTag() && tagNesting.Count() == hiddenDepth &&\r\n        t->tag == tagNesting.Last()) {\r\n        hiddenDepth = 0;\r\n        UpdateTagNesting(t);\r\n        return;\r\n    }\r\n    if (0 == hiddenDepth && t->IsStartTag() && t->GetAttrByName(\"hidden\"))\r\n        hiddenDepth = tagNesting.Count() + 1;\r\n    if (hiddenDepth > 0)\r\n        UpdateTagNesting(t);\r\n    else if (Tag_Image == t->tag || Tag_Svg_Image == t->tag)\r\n        HandleTagSvgImage(t);\r\n    else\r\n        HtmlFormatter::HandleHtmlTag(t);\r\n}\r\n\r\nbool EpubFormatter::IgnoreText()\r\n{\r\n    return hiddenDepth > 0 || HtmlFormatter::IgnoreText();\r\n}\r\n\r\n/* FictionBook-specific formatting methods */\r\n\r\nFb2Formatter::Fb2Formatter(HtmlFormatterArgs *args, Fb2Doc *doc) :\r\n    HtmlFormatter(args), fb2Doc(doc), section(1), titleCount(0)\r\n{\r\n    if (args->reparseIdx != 0)\r\n        return;\r\n    ImageData *cover = doc->GetCoverImage();\r\n    if (!cover)\r\n        return;\r\n    EmitImage(cover);\r\n    // render larger images alone on the cover page,\r\n    // smaller images just separated by a horizontal line\r\n    if (0 == currLineInstr.Count())\r\n        /* the image was broken */;\r\n    else if (currLineInstr.Last().bbox.Height > args->pageDy / 2)\r\n        ForceNewPage();\r\n    else\r\n        EmitHr();\r\n}\r\n\r\nvoid Fb2Formatter::HandleTagImg(HtmlToken *t)\r\n{\r\n    CrashIf(!fb2Doc);\r\n    if (t->IsEndTag())\r\n        return;\r\n    ImageData *img = nullptr;\r\n    AttrInfo *attr = t->GetAttrByNameNS(\"href\", \"http://www.w3.org/1999/xlink\");\r\n    if (attr) {\r\n        ScopedMem<char> src(str::DupN(attr->val, attr->valLen));\r\n        url::DecodeInPlace(src);\r\n        img = fb2Doc->GetImageData(src);\r\n    }\r\n    if (img)\r\n        EmitImage(img);\r\n}\r\n\r\nvoid Fb2Formatter::HandleTagAsHtml(HtmlToken *t, const char *name)\r\n{\r\n    HtmlToken tok;\r\n    tok.SetTag(t->type, name, name + str::Len(name));\r\n    HtmlFormatter::HandleHtmlTag(&tok);\r\n}\r\n\r\n// the name doesn't quite fit: this handles FB2 tags\r\nvoid Fb2Formatter::HandleHtmlTag(HtmlToken *t)\r\n{\r\n    if (Tag_Title == t->tag || Tag_Subtitle == t->tag) {\r\n        bool isSubtitle = Tag_Subtitle == t->tag;\r\n        ScopedMem<char> name(str::Format(\"h%d\", section + (isSubtitle ? 1 : 0)));\r\n        HtmlToken tok;\r\n        tok.SetTag(t->type, name, name + str::Len(name));\r\n        HandleTagHx(&tok);\r\n        HandleAnchorAttr(t);\r\n        if (!isSubtitle && t->IsStartTag()) {\r\n            char *link = (char *)Allocator::Alloc(textAllocator, 24);\r\n            sprintf_s(link, 24, FB2_TOC_ENTRY_MARK \"%d\", ++titleCount);\r\n            currPage->instructions.Append(DrawInstr::Anchor(link, str::Len(link), RectF(0, currY, pageDx, 0)));\r\n        }\r\n    }\r\n    else if (Tag_Section == t->tag) {\r\n        if (t->IsStartTag())\r\n            section++;\r\n        else if (t->IsEndTag() && section > 1)\r\n            section--;\r\n        FlushCurrLine(true);\r\n        HandleAnchorAttr(t);\r\n    }\r\n    else if (Tag_P == t->tag) {\r\n        if (!tagNesting.Contains(Tag_Title))\r\n            HtmlFormatter::HandleHtmlTag(t);\r\n    }\r\n    else if (Tag_Image == t->tag) {\r\n        HandleTagImg(t);\r\n        HandleAnchorAttr(t);\r\n    }\r\n    else if (Tag_A == t->tag) {\r\n        HandleTagA(t, \"href\", \"http://www.w3.org/1999/xlink\");\r\n        HandleAnchorAttr(t, true);\r\n    }\r\n    else if (Tag_Pagebreak == t->tag)\r\n        ForceNewPage();\r\n    else if (Tag_Strong == t->tag)\r\n        HandleTagAsHtml(t, \"b\");\r\n    else if (t->NameIs(\"emphasis\"))\r\n        HandleTagAsHtml(t, \"i\");\r\n    else if (t->NameIs(\"epigraph\"))\r\n        HandleTagAsHtml(t, \"blockquote\");\r\n    else if (t->NameIs(\"empty-line\")) {\r\n        if (!t->IsEndTag())\r\n            EmitParagraph(0);\r\n    }\r\n    else if (t->NameIs(\"stylesheet\"))\r\n        HandleTagAsHtml(t, \"style\");\r\n}\r\n\r\n/* standalone HTML-specific formatting methods */\r\n\r\nvoid HtmlFileFormatter::HandleTagImg(HtmlToken *t)\r\n{\r\n    CrashIf(!htmlDoc);\r\n    if (t->IsEndTag())\r\n        return;\r\n    bool needAlt = true;\r\n    AttrInfo *attr = t->GetAttrByName(\"src\");\r\n    if (attr) {\r\n        ScopedMem<char> src(str::DupN(attr->val, attr->valLen));\r\n        url::DecodeInPlace(src);\r\n        ImageData *img = htmlDoc->GetImageData(src);\r\n        needAlt = !img || !EmitImage(img);\r\n    }\r\n    if (needAlt && (attr = t->GetAttrByName(\"alt\")) != nullptr)\r\n        HandleText(attr->val, attr->valLen);\r\n}\r\n\r\nvoid HtmlFileFormatter::HandleTagLink(HtmlToken *t)\r\n{\r\n    CrashIf(!htmlDoc);\r\n    if (t->IsEndTag())\r\n        return;\r\n    AttrInfo *attr = t->GetAttrByName(\"rel\");\r\n    if (!attr || !attr->ValIs(\"stylesheet\"))\r\n        return;\r\n    attr = t->GetAttrByName(\"type\");\r\n    if (attr && !attr->ValIs(\"text/css\"))\r\n        return;\r\n    attr = t->GetAttrByName(\"href\");\r\n    if (!attr)\r\n        return;\r\n\r\n    size_t len;\r\n    ScopedMem<char> src(str::DupN(attr->val, attr->valLen));\r\n    url::DecodeInPlace(src);\r\n    ScopedMem<char> data(htmlDoc->GetFileData(src, &len));\r\n    if (data)\r\n        ParseStyleSheet(data, len);\r\n}\r\n"
  },
  {
    "path": "src/EbookFormatter.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n/* formatting extensions for Mobi */\r\n\r\nclass MobiDoc;\r\n\r\nclass MobiFormatter : public HtmlFormatter {\r\n    // accessor to images (and other format-specific data)\r\n    // it can be nullptr (enables testing by feeding raw html)\r\n    MobiDoc *           doc;\r\n\r\n    void HandleSpacing_Mobi(HtmlToken *t);\r\n    virtual void HandleTagImg(HtmlToken *t);\r\n    virtual void HandleHtmlTag(HtmlToken *t);\r\n\r\npublic:\r\n    MobiFormatter(HtmlFormatterArgs *args, MobiDoc *doc);\r\n};\r\n\r\n/* formatting extensions for EPUB */\r\n\r\nclass EpubDoc;\r\n\r\nclass EpubFormatter : public HtmlFormatter {\r\n    virtual void HandleTagImg(HtmlToken *t);\r\n    virtual void HandleTagPagebreak(HtmlToken *t);\r\n    virtual void HandleTagLink(HtmlToken *t);\r\n    virtual void HandleHtmlTag(HtmlToken *t);\r\n    virtual bool IgnoreText();\r\n\r\n    void HandleTagSvgImage(HtmlToken *t);\r\n\r\n    EpubDoc *epubDoc;\r\n    ScopedMem<char> pagePath;\r\n    size_t hiddenDepth;\r\n\r\npublic:\r\n    EpubFormatter(HtmlFormatterArgs *args, EpubDoc *doc) :\r\n        HtmlFormatter(args), epubDoc(doc), hiddenDepth(0) { }\r\n};\r\n\r\n/* formatting extensions for FictionBook */\r\n\r\nclass Fb2Doc;\r\n\r\nclass Fb2Formatter : public HtmlFormatter {\r\n    int section;\r\n    int titleCount;\r\n\r\n    virtual void HandleTagImg(HtmlToken *t);\r\n    void HandleTagAsHtml(HtmlToken *t, const char *name);\r\n    virtual void HandleHtmlTag(HtmlToken *t);\r\n\r\n    virtual bool IgnoreText() { return false; }\r\n\r\n    Fb2Doc *fb2Doc;\r\n\r\npublic:\r\n    Fb2Formatter(HtmlFormatterArgs *args, Fb2Doc *doc);\r\n};\r\n\r\n/* formatting extensions for standalone HTML */\r\n\r\nclass HtmlDoc;\r\n\r\nclass HtmlFileFormatter : public HtmlFormatter {\r\nprotected:\r\n    virtual void HandleTagImg(HtmlToken *t);\r\n    virtual void HandleTagLink(HtmlToken *t);\r\n\r\n    HtmlDoc *htmlDoc;\r\n\r\npublic:\r\n    HtmlFileFormatter(HtmlFormatterArgs *args, HtmlDoc *doc) :\r\n        HtmlFormatter(args), htmlDoc(doc) { }\r\n};\r\n\r\n/* formatting extensions for TXT */\r\n\r\nclass TxtFormatter : public HtmlFormatter {\r\nprotected:\r\n    virtual void HandleTagPagebreak(HtmlToken *t) { UNUSED(t);  ForceNewPage(); }\r\n\r\npublic:\r\n    explicit TxtFormatter(HtmlFormatterArgs *args) : HtmlFormatter(args) { }\r\n};\r\n"
  },
  {
    "path": "src/EbookWinDesc.txt",
    "content": "Style [\r\n    name: styleMainWnd\r\n    bg_col: sepia\r\n]\r\n\r\nStyle [\r\n    name: stylePage\r\n    padding: 32 16\r\n    bg_col: transparent\r\n]\r\n\r\nStyle [\r\n    name: styleNextDefault\r\n    parent: buttonDefault\r\n    border_width: 0\r\n    padding: 0 8\r\n    stroke_width: 0\r\n    fill: gray\r\n    bg_col: transparent\r\n    vert_align: center\r\n]\r\n\r\nStyle [\r\n    name: styleNextMouseOver\r\n    parent: styleNextDefault\r\n    fill: black\r\n]\r\n\r\nStyle [\r\n    name: styleStatus\r\n    parent: buttonDefault\r\n    bg_col: sepia\r\n    col: black\r\n    font_size: 8\r\n    font_weight: regular\r\n    padding: 3 0\r\n    border_width: 0\r\n    text_align: center\r\n]\r\n\r\nStyle [\r\n    name: styleProgress\r\n    bg_col: light gray\r\n    col: light blue\r\n]\r\n\r\nButtonVector [\r\n    name: nextButton\r\n    clicked: next\r\n    path: M0 0  L10 13 L0 ,26 Z\r\n    style_default: styleNextDefault\r\n    style_mouse_over: styleNextMouseOver\r\n]\r\n\r\nButtonVector [\r\n    name: prevButton\r\n    clicked: prev\r\n    path: M10 0 L0,  13 L10 26 z\r\n    style_default: styleNextDefault\r\n    style_mouse_over: styleNextMouseOver\r\n]\r\n\r\nButton [\r\n    name: statusButton\r\n    style: styleStatus\r\n]\r\n\r\nScrollBar [\r\n    name: progressScrollBar\r\n    style: styleProgress\r\n    cursor: hand\r\n]\r\n\r\nEbookPage [\r\n    name: page1\r\n    style: stylePage\r\n]\r\n\r\nEbookPage [\r\n    name: page2\r\n    style: stylePage\r\n]\r\n\r\nPagesLayout [\r\n    name: pagesLayout\r\n    page1: page1\r\n    page2: page2\r\n    spaceDx: 12\r\n]\r\n\r\nHorizontalLayout [\r\n    name: top\r\n    children [\r\n        prevButton self 1 bottom\r\n        pagesLayout 1 1 top\r\n        nextButton self 1 center\r\n    ]\r\n]\r\n\r\nVerticalLayout [\r\n    name: mainLayout\r\n    children [\r\n        top 1 1 top\r\n        progressScrollBar self 1 center\r\n        statusButton self 1 center\r\n    ]\r\n]\r\n"
  },
  {
    "path": "src/EngineDump.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"CmdLineParser.h\"\r\n#include \"FileUtil.h\"\r\n#include \"GdiPlusUtil.h\"\r\n#include \"MiniMui.h\"\r\n#include \"TgaReader.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"DjVuEngine.h\"\r\n#include \"EngineManager.h\"\r\n#include \"FileModifications.h\"\r\n#include \"PdfCreator.h\"\r\n\r\n#define Out(msg, ...) printf(msg, __VA_ARGS__)\r\n\r\n// caller must free() the result\r\nchar *Escape(WCHAR *string)\r\n{\r\n    ScopedMem<WCHAR> freeOnReturn(string);\r\n\r\n    if (str::IsEmpty(string))\r\n        return nullptr;\r\n\r\n    if (!str::FindChar(string, '<') && !str::FindChar(string, '&') && !str::FindChar(string, '\"'))\r\n        return str::conv::ToUtf8(string);\r\n\r\n    str::Str<WCHAR> escaped(256);\r\n    for (const WCHAR *s = string; *s; s++) {\r\n        switch (*s) {\r\n        case '&': escaped.Append(L\"&amp;\"); break;\r\n        case '<': escaped.Append(L\"&lt;\"); break;\r\n        case '>': escaped.Append(L\"&gt;\"); break;\r\n        case '\"': escaped.Append(L\"&quot;\"); break;\r\n        case '\\'': escaped.Append(L\"&amp;\"); break;\r\n        default: escaped.Append(*s); break;\r\n        }\r\n    }\r\n    return str::conv::ToUtf8(escaped.Get());\r\n}\r\n\r\nvoid DumpProperties(BaseEngine *engine, bool fullDump)\r\n{\r\n    Out(\"\\t<Properties\\n\");\r\n    ScopedMem<char> str;\r\n    str.Set(Escape(str::Dup(engine->FileName())));\r\n    Out(\"\\t\\tFilePath=\\\"%s\\\"\\n\", str.Get());\r\n    str.Set(Escape(engine->GetProperty(Prop_Title)));\r\n    if (str)\r\n        Out(\"\\t\\tTitle=\\\"%s\\\"\\n\", str.Get());\r\n    str.Set(Escape(engine->GetProperty(Prop_Subject)));\r\n    if (str)\r\n        Out(\"\\t\\tSubject=\\\"%s\\\"\\n\", str.Get());\r\n    str.Set(Escape(engine->GetProperty(Prop_Author)));\r\n    if (str)\r\n        Out(\"\\t\\tAuthor=\\\"%s\\\"\\n\", str.Get());\r\n    str.Set(Escape(engine->GetProperty(Prop_Copyright)));\r\n    if (str)\r\n        Out(\"\\t\\tCopyright=\\\"%s\\\"\\n\", str.Get());\r\n    str.Set(Escape(engine->GetProperty(Prop_CreationDate)));\r\n    if (str)\r\n        Out(\"\\t\\tCreationDate=\\\"%s\\\"\\n\", str.Get());\r\n    str.Set(Escape(engine->GetProperty(Prop_ModificationDate)));\r\n    if (str)\r\n        Out(\"\\t\\tModDate=\\\"%s\\\"\\n\", str.Get());\r\n    str.Set(Escape(engine->GetProperty(Prop_CreatorApp)));\r\n    if (str)\r\n        Out(\"\\t\\tCreator=\\\"%s\\\"\\n\", str.Get());\r\n    str.Set(Escape(engine->GetProperty(Prop_PdfProducer)));\r\n    if (str)\r\n        Out(\"\\t\\tPdfProducer=\\\"%s\\\"\\n\", str.Get());\r\n    str.Set(Escape(engine->GetProperty(Prop_PdfVersion)));\r\n    if (str)\r\n        Out(\"\\t\\tPdfVersion=\\\"%s\\\"\\n\", str.Get());\r\n    str.Set(Escape(engine->GetProperty(Prop_PdfFileStructure)));\r\n    if (str)\r\n        Out(\"\\t\\tPdfFileStructure=\\\"%s\\\"\\n\", str.Get());\r\n    str.Set(Escape(engine->GetProperty(Prop_UnsupportedFeatures)));\r\n    if (str)\r\n        Out(\"\\t\\tUnsupportedFeatures=\\\"%s\\\"\\n\", str.Get());\r\n    if (!engine->AllowsPrinting())\r\n        Out(\"\\t\\tPrintingAllowed=\\\"no\\\"\\n\");\r\n    if (!engine->AllowsCopyingText())\r\n        Out(\"\\t\\tCopyingTextAllowed=\\\"no\\\"\\n\");\r\n    if (engine->IsImageCollection())\r\n        Out(\"\\t\\tImageFileDPI=\\\"%g\\\"\\n\", engine->GetFileDPI());\r\n    if (engine->PreferredLayout())\r\n        Out(\"\\t\\tPreferredLayout=\\\"%d\\\"\\n\", engine->PreferredLayout());\r\n    Out(\"\\t/>\\n\");\r\n\r\n    if (fullDump) {\r\n        ScopedMem<WCHAR> fontlist(engine->GetProperty(Prop_FontList));\r\n        if (fontlist) {\r\n            WStrVec fonts;\r\n            fonts.Split(fontlist, L\"\\n\");\r\n            str.Set(Escape(fonts.Join(L\"\\n\\t\\t\")));\r\n            Out(\"\\t<FontList>\\n\\t\\t%s\\n\\t</FontList>\\n\", str.Get());\r\n        }\r\n    }\r\n}\r\n\r\n// caller must free() the result\r\nchar *DestRectToStr(BaseEngine *engine, PageDestination *dest)\r\n{\r\n    if (ScopedMem<WCHAR>(dest->GetDestName())) {\r\n        ScopedMem<char> name(Escape(dest->GetDestName()));\r\n        return str::Format(\"Name=\\\"%s\\\"\", name);\r\n    }\r\n    // as handled by LinkHandler::ScrollTo in WindowInfo.cpp\r\n    int pageNo = dest->GetDestPageNo();\r\n    if (pageNo <= 0 || pageNo > engine->PageCount())\r\n        return nullptr;\r\n    RectD rect = dest->GetDestRect();\r\n    if (rect.IsEmpty()) {\r\n        PointD pt = engine->Transform(rect.TL(), pageNo, 1.0, 0);\r\n        return str::Format(\"Point=\\\"%.0f %.0f\\\"\", pt.x, pt.y);\r\n    }\r\n    if (rect.dx != DEST_USE_DEFAULT && rect.dy != DEST_USE_DEFAULT) {\r\n        RectI rc = engine->Transform(rect, pageNo, 1.0, 0).Round();\r\n        return str::Format(\"Rect=\\\"%d %d %d %d\\\"\", rc.x, rc.y, rc.dx, rc.dy);\r\n    }\r\n    if (rect.y != DEST_USE_DEFAULT) {\r\n        PointD pt = engine->Transform(rect.TL(), pageNo, 1.0, 0);\r\n        return str::Format(\"Point=\\\"x %.0f\\\"\", pt.y);\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nvoid DumpTocItem(BaseEngine *engine, DocTocItem *item, int level, int& idCounter)\r\n{\r\n    for (; item; item = item->next) {\r\n        ScopedMem<char> title(Escape(str::Dup(item->title)));\r\n        for (int i = 0; i < level; i++) Out(\"\\t\");\r\n        Out(\"<Item Title=\\\"%s\\\"\", title.Get());\r\n        if (item->pageNo)\r\n            Out(\" Page=\\\"%d\\\"\", item->pageNo);\r\n        if (item->id != ++idCounter)\r\n            Out(\" Id=\\\"%d\\\"\", item->id);\r\n        if (item->GetLink()) {\r\n            PageDestination *dest = item->GetLink();\r\n            ScopedMem<char> target(Escape(dest->GetDestValue()));\r\n            if (target)\r\n                Out(\" Target=\\\"%s\\\"\", target.Get());\r\n            if (item->pageNo != dest->GetDestPageNo())\r\n                Out(\" TargetPage=\\\"%d\\\"\", dest->GetDestPageNo());\r\n            ScopedMem<char> rectStr(DestRectToStr(engine, dest));\r\n            if (rectStr)\r\n                Out(\" Target%s\", rectStr.Get());\r\n        }\r\n        if (!item->child)\r\n            Out(\" />\\n\");\r\n        else {\r\n            if (item->open)\r\n                Out(\" Expanded=\\\"yes\\\"\");\r\n            Out(\">\\n\");\r\n            DumpTocItem(engine, item->child, level + 1, idCounter);\r\n            for (int i = 0; i < level; i++) Out(\"\\t\");\r\n            Out(\"</Item>\\n\");\r\n        }\r\n    }\r\n}\r\n\r\nvoid DumpToc(BaseEngine *engine)\r\n{\r\n    DocTocItem *root = engine->GetTocTree();\r\n    if (root) {\r\n        Out(\"\\t<TocTree%s>\\n\", engine->HasTocTree() ? \"\" : \" Expected=\\\"no\\\"\");\r\n        int idCounter = 0;\r\n        DumpTocItem(engine, root, 2, idCounter);\r\n        Out(\"\\t</TocTree>\\n\");\r\n    }\r\n    else if (engine->HasTocTree())\r\n        Out(\"\\t<TocTree />\\n\");\r\n    delete root;\r\n}\r\n\r\nconst char *ElementTypeToStr(PageElement *el)\r\n{\r\n    switch (el->GetType()) {\r\n    case Element_Link: return \"Link\";\r\n    case Element_Image: return \"Image\";\r\n    case Element_Comment: return \"Comment\";\r\n    default: return \"Unknown\";\r\n    }\r\n}\r\n\r\nconst char *PageDestToStr(PageDestType destType)\r\n{\r\n#define HandleType(type) if (destType == Dest_ ## type) return #type;\r\n#define HandleTypeDialog(type) if (destType == Dest_ ## type ## Dialog) return #type;\r\n    // common actions\r\n    HandleType(ScrollTo);\r\n    HandleType(LaunchURL);\r\n    HandleType(LaunchEmbedded);\r\n    HandleType(LaunchFile);\r\n    // named actions\r\n    HandleType(NextPage);\r\n    HandleType(PrevPage);\r\n    HandleType(FirstPage);\r\n    HandleType(LastPage);\r\n    HandleTypeDialog(Find);\r\n    HandleType(FullScreen);\r\n    HandleType(GoBack);\r\n    HandleType(GoForward);\r\n    HandleTypeDialog(GoToPage);\r\n    HandleTypeDialog(Print);\r\n    HandleTypeDialog(SaveAs);\r\n    HandleTypeDialog(ZoomTo);\r\n#undef HandleType\r\n#undef HandleTypeDialog\r\n    CrashIf(destType != Dest_None);\r\n    return nullptr;\r\n}\r\n\r\nvoid DumpPageContent(BaseEngine *engine, int pageNo, bool fullDump)\r\n{\r\n    // ensure that the page is loaded\r\n    engine->BenchLoadPage(pageNo);\r\n\r\n    Out(\"\\t<Page Number=\\\"%d\\\"\\n\", pageNo);\r\n    if (engine->HasPageLabels()) {\r\n        ScopedMem<char> label(Escape(engine->GetPageLabel(pageNo)));\r\n        Out(\"\\t\\tLabel=\\\"%s\\\"\\n\", label.Get());\r\n    }\r\n    RectI bbox = engine->PageMediabox(pageNo).Round();\r\n    Out(\"\\t\\tMediaBox=\\\"%d %d %d %d\\\"\\n\", bbox.x, bbox.y, bbox.dx, bbox.dy);\r\n    RectI cbox = engine->PageContentBox(pageNo).Round();\r\n    if (cbox != bbox)\r\n        Out(\"\\t\\tContentBox=\\\"%d %d %d %d\\\"\\n\", cbox.x, cbox.y, cbox.dx, cbox.dy);\r\n    if (!engine->HasClipOptimizations(pageNo))\r\n        Out(\"\\t\\tHasClipOptimizations=\\\"no\\\"\\n\");\r\n    Out(\"\\t>\\n\");\r\n\r\n    if (fullDump) {\r\n        ScopedMem<char> text(Escape(engine->ExtractPageText(pageNo, L\"\\n\")));\r\n        if (text)\r\n            Out(\"\\t\\t<TextContent>\\n%s\\t\\t</TextContent>\\n\", text.Get());\r\n    }\r\n\r\n    Vec<PageElement *> *els = engine->GetElements(pageNo);\r\n    if (els && els->Count() > 0) {\r\n        Out(\"\\t\\t<PageElements>\\n\");\r\n        for (size_t i = 0; i < els->Count(); i++) {\r\n            RectD rect = els->At(i)->GetRect();\r\n            Out(\"\\t\\t\\t<Element Type=\\\"%s\\\"\\n\\t\\t\\t\\tRect=\\\"%.0f %.0f %.0f %.0f\\\"\\n\",\r\n                ElementTypeToStr(els->At(i)), rect.x, rect.y, rect.dx, rect.dy);\r\n            PageDestination *dest = els->At(i)->AsLink();\r\n            if (dest) {\r\n                if (dest->GetDestType() != Dest_None)\r\n                    Out(\"\\t\\t\\t\\tLinkType=\\\"%s\\\"\\n\", PageDestToStr(dest->GetDestType()));\r\n                ScopedMem<char> value(Escape(dest->GetDestValue()));\r\n                if (value)\r\n                    Out(\"\\t\\t\\t\\tLinkTarget=\\\"%s\\\"\\n\", value.Get());\r\n                if (dest->GetDestPageNo())\r\n                    Out(\"\\t\\t\\t\\tLinkedPage=\\\"%d\\\"\\n\", dest->GetDestPageNo());\r\n                ScopedMem<char> rectStr(DestRectToStr(engine, dest));\r\n                if (rectStr)\r\n                    Out(\"\\t\\t\\t\\tLinked%s\\n\", rectStr.Get());\r\n            }\r\n            ScopedMem<char> name(Escape(els->At(i)->GetValue()));\r\n            if (name)\r\n                Out(\"\\t\\t\\t\\tLabel=\\\"%s\\\"\\n\", name.Get());\r\n            Out(\"\\t\\t\\t/>\\n\");\r\n        }\r\n        Out(\"\\t\\t</PageElements>\\n\");\r\n        DeleteVecMembers(*els);\r\n    }\r\n    delete els;\r\n\r\n    Out(\"\\t</Page>\\n\");\r\n}\r\n\r\nvoid DumpThumbnail(BaseEngine *engine)\r\n{\r\n    RectD rect = engine->Transform(engine->PageMediabox(1), 1, 1.0, 0);\r\n    if (rect.IsEmpty()) {\r\n        Out(\"\\t<Thumbnail />\\n\");\r\n        return;\r\n    }\r\n\r\n    float zoom = std::min(128 / (float)rect.dx, 128 / (float)rect.dy) - 0.001f;\r\n    RectI thumb = RectD(0, 0, rect.dx * zoom, rect.dy * zoom).Round();\r\n    rect = engine->Transform(thumb.Convert<double>(), 1, zoom, 0, true);\r\n    RenderedBitmap *bmp = engine->RenderBitmap(1, zoom, 0, &rect);\r\n    if (!bmp) {\r\n        Out(\"\\t<Thumbnail />\\n\");\r\n        return;\r\n    }\r\n\r\n    size_t len;\r\n    ScopedMem<unsigned char> data(tga::SerializeBitmap(bmp->GetBitmap(), &len));\r\n    ScopedMem<char> hexData(data ? str::MemToHex(data, len) : nullptr);\r\n    if (hexData)\r\n        Out(\"\\t<Thumbnail>\\n\\t\\t%s\\n\\t</Thumbnail>\\n\", hexData.Get());\r\n    else\r\n        Out(\"\\t<Thumbnail />\\n\");\r\n\r\n    delete bmp;\r\n}\r\n\r\nvoid DumpData(BaseEngine *engine, bool fullDump)\r\n{\r\n    Out(UTF8_BOM);\r\n    Out(\"<?xml version=\\\"1.0\\\"?>\\n\");\r\n    Out(\"<EngineDump>\\n\");\r\n    DumpProperties(engine, fullDump);\r\n    DumpToc(engine);\r\n    for (int i = 1; i <= engine->PageCount(); i++)\r\n        DumpPageContent(engine, i, fullDump);\r\n    if (fullDump)\r\n        DumpThumbnail(engine);\r\n    Out(\"</EngineDump>\\n\");\r\n}\r\n\r\n#define ErrOut(msg, ...) fwprintf(stderr, TEXT(msg) TEXT(\"\\n\"), __VA_ARGS__)\r\n\r\nbool CheckRenderPath(const WCHAR *path)\r\n{\r\n    CrashIf(!path);\r\n    bool hasArg = false;\r\n    const WCHAR *p = path - 1;\r\n    while ((p = str::FindChar(p + 1, '%')) != nullptr) {\r\n        p++;\r\n        if (*p == '%')\r\n            continue;\r\n        if (*p == '0' && '1' <= *(p + 1) && *(p + 1) <= '9')\r\n            p += 2;\r\n        if (hasArg || *p != 'd') {\r\n            ErrOut(\"Error: Render path may contain '%%d' only once, other '%%' signs must be doubled!\");\r\n            return false;\r\n        }\r\n        hasArg = true;\r\n    }\r\n    return true;\r\n}\r\n\r\nbool RenderDocument(BaseEngine *engine, const WCHAR *renderPath, float zoom=1.f, bool silent=false)\r\n{\r\n    if (!CheckRenderPath(renderPath))\r\n        return false;\r\n\r\n    if (str::EndsWithI(renderPath, L\".txt\")) {\r\n        str::Str<WCHAR> text(1024);\r\n        for (int pageNo = 1; pageNo <= engine->PageCount(); pageNo++)\r\n            text.AppendAndFree(engine->ExtractPageText(pageNo, L\"\\r\\n\", nullptr, Target_Export));\r\n        if (silent)\r\n            return true;\r\n        ScopedMem<WCHAR> txtFilePath(str::Format(renderPath, 0));\r\n        ScopedMem<char> textUTF8(str::conv::ToUtf8(text.Get()));\r\n        ScopedMem<char> textUTF8BOM(str::Join(UTF8_BOM, textUTF8));\r\n        return file::WriteAll(txtFilePath, textUTF8BOM, str::Len(textUTF8BOM));\r\n    }\r\n\r\n    if (str::EndsWithI(renderPath, L\".pdf\")) {\r\n        if (silent)\r\n            return false;\r\n        ScopedMem<WCHAR> pdfFilePath(str::Format(renderPath, 0));\r\n        return engine->SaveFileAsPDF(pdfFilePath, true) || PdfCreator::RenderToFile(pdfFilePath, engine);\r\n    }\r\n\r\n    bool success = true;\r\n    for (int pageNo = 1; pageNo <= engine->PageCount(); pageNo++) {\r\n        RenderedBitmap *bmp = engine->RenderBitmap(pageNo, zoom, 0);\r\n        success &= bmp != nullptr;\r\n        if (!bmp && !silent)\r\n            ErrOut(\"Error: Failed to render page %d for %s!\", pageNo, engine->FileName());\r\n        if (!bmp || silent) {\r\n            delete bmp;\r\n            continue;\r\n        }\r\n        ScopedMem<WCHAR> pageBmpPath(str::Format(renderPath, pageNo));\r\n        if (str::EndsWithI(pageBmpPath, L\".png\")) {\r\n            Bitmap gbmp(bmp->GetBitmap(), nullptr);\r\n            CLSID pngEncId = GetEncoderClsid(L\"image/png\");\r\n            gbmp.Save(pageBmpPath, &pngEncId);\r\n        }\r\n        else if (str::EndsWithI(pageBmpPath, L\".bmp\")) {\r\n            size_t bmpDataLen;\r\n            ScopedMem<char> bmpData((char *)SerializeBitmap(bmp->GetBitmap(), &bmpDataLen));\r\n            if (bmpData)\r\n                file::WriteAll(pageBmpPath, bmpData, bmpDataLen);\r\n        }\r\n        else { // render as TGA for all other file extensions\r\n            size_t tgaDataLen;\r\n            ScopedMem<unsigned char> tgaData(tga::SerializeBitmap(bmp->GetBitmap(), &tgaDataLen));\r\n            if (tgaData)\r\n                file::WriteAll(pageBmpPath, tgaData, tgaDataLen);\r\n        }\r\n        delete bmp;\r\n    }\r\n\r\n    return success;\r\n}\r\n\r\nclass PasswordHolder : public PasswordUI {\r\n    const WCHAR *password;\r\npublic:\r\n    explicit PasswordHolder(const WCHAR *password) : password(password) { }\r\n    virtual WCHAR * GetPassword(const WCHAR *fileName, unsigned char *fileDigest,\r\n                                unsigned char decryptionKeyOut[32], bool *saveKey) {\r\n        UNUSED(fileName); UNUSED(fileDigest);\r\n        UNUSED(decryptionKeyOut);  UNUSED(saveKey);\r\n        return str::Dup(password);\r\n    }\r\n};\r\n\r\nint main(int argc, char **argv)\r\n{\r\n    UNUSED(argc); UNUSED(argv);\r\n    setlocale(LC_ALL, \"C\");\r\n    DisableDataExecution();\r\n\r\n    WStrVec argList;\r\n    ParseCmdLine(GetCommandLine(), argList);\r\n    if (argList.Count() < 2) {\r\nUsage:\r\n        ErrOut(\"%s [-pwd <password>][-quick][-render <path-%%d.tga>] <filename>\",\r\n            path::GetBaseName(argList.At(0)));\r\n        return 2;\r\n    }\r\n\r\n    ScopedMem<WCHAR> filePath;\r\n    WCHAR *password = nullptr;\r\n    bool fullDump = true;\r\n    WCHAR *renderPath = nullptr;\r\n    float renderZoom = 1.f;\r\n    bool loadOnly = false, silent = false;\r\n#ifdef DEBUG\r\n    int breakAlloc = 0;\r\n#endif\r\n\r\n    for (size_t i = 1; i < argList.Count(); i++) {\r\n        if (str::Eq(argList.At(i), L\"-pwd\") && i + 1 < argList.Count() && !password)\r\n            password = argList.At(++i);\r\n        else if (str::Eq(argList.At(i), L\"-quick\"))\r\n            fullDump = false;\r\n        else if (str::Eq(argList.At(i), L\"-render\") && i + 1 < argList.Count() && !renderPath) {\r\n            // optional zoom argument (e.g. -render 50% file.pdf)\r\n            float zoom;\r\n            if (i + 2 < argList.Count() && str::Parse(argList.At(i + 1), L\"%f%%%$\", &zoom) && zoom > 0.f) {\r\n                renderZoom = zoom / 100.f;\r\n                i++;\r\n            }\r\n            renderPath = argList.At(++i);\r\n        }\r\n        // -loadonly and -silent are only meant for profiling\r\n        else if (str::Eq(argList.At(i), L\"-loadonly\"))\r\n            loadOnly = true;\r\n        else if (str::Eq(argList.At(i), L\"-silent\"))\r\n            silent = true;\r\n        // -full is for backward compatibility\r\n        else if (str::Eq(argList.At(i), L\"-full\"))\r\n            fullDump = true;\r\n#ifdef DEBUG\r\n        else if (str::Eq(argList.At(i), L\"-breakalloc\") && i + 1 < argList.Count())\r\n            breakAlloc = _wtoi(argList.At(++i));\r\n#endif\r\n        else if (!filePath)\r\n            filePath.Set(str::Dup(argList.At(i)));\r\n        else\r\n            goto Usage;\r\n    }\r\n    if (!filePath)\r\n        goto Usage;\r\n\r\n#ifdef DEBUG\r\n    if (breakAlloc) {\r\n        _CrtSetBreakAlloc(breakAlloc);\r\n        if (!IsDebuggerPresent())\r\n            MessageBox(nullptr, L\"Keep your debugger ready for the allocation breakpoint...\", L\"EngineDump\", MB_ICONINFORMATION);\r\n    }\r\n#endif\r\n    if (silent) {\r\n        FILE *nul;\r\n        freopen_s(&nul, \"NUL\", \"w\", stdout);\r\n        freopen_s(&nul, \"NUL\", \"w\", stderr);\r\n    }\r\n\r\n    ScopedGdiPlus gdiPlus;\r\n    ScopedMiniMui miniMui;\r\n\r\n    WIN32_FIND_DATA fdata;\r\n    HANDLE hfind = FindFirstFile(filePath, &fdata);\r\n    // embedded documents are referred to by an invalid path\r\n    // containing more information after a colon (e.g. \"C:\\file.pdf:3:0\")\r\n    if (INVALID_HANDLE_VALUE != hfind) {\r\n        ScopedMem<WCHAR> dir(path::GetDir(filePath));\r\n        filePath.Set(path::Join(dir, fdata.cFileName));\r\n        FindClose(hfind);\r\n    }\r\n\r\n    EngineType engineType;\r\n    PasswordHolder pwdUI(password);\r\n    BaseEngine *engine = EngineManager::CreateEngine(filePath, &pwdUI, &engineType);\r\n#ifdef DEBUG\r\n    bool couldLeak = engineType == Engine_DjVu || DjVuEngine::IsSupportedFile(filePath) || DjVuEngine::IsSupportedFile(filePath, true);\r\n    if (!couldLeak) {\r\n        // report memory leaks on stderr for engines that shouldn't leak\r\n        _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);\r\n        _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);\r\n        _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);\r\n    }\r\n#endif\r\n    if (!engine) {\r\n        ErrOut(\"Error: Couldn't create an engine for %s!\", path::GetBaseName(filePath));\r\n        return 1;\r\n    }\r\n    Vec<PageAnnotation> *userAnnots = LoadFileModifications(engine->FileName());\r\n    engine->UpdateUserAnnotations(userAnnots);\r\n    delete userAnnots;\r\n    if (!loadOnly)\r\n        DumpData(engine, fullDump);\r\n    if (renderPath)\r\n        RenderDocument(engine, renderPath, renderZoom, silent);\r\n    delete engine;\r\n\r\n    return 0;\r\n}\r\n"
  },
  {
    "path": "src/EngineManager.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"DjVuEngine.h\"\r\n#include \"EbookEngine.h\"\r\n#include \"ImagesEngine.h\"\r\n#include \"PdfEngine.h\"\r\n#include \"PsEngine.h\"\r\n#include \"EngineManager.h\"\r\n\r\nnamespace EngineManager {\r\n\r\nbool IsSupportedFile(const WCHAR *filePath, bool sniff, bool enableEbookEngines)\r\n{\r\n    return PdfEngine::IsSupportedFile(filePath, sniff)  ||\r\n           XpsEngine::IsSupportedFile(filePath, sniff)  ||\r\n           DjVuEngine::IsSupportedFile(filePath, sniff) ||\r\n           ImageEngine::IsSupportedFile(filePath, sniff)||\r\n           ImageDirEngine::IsSupportedFile(filePath, sniff) ||\r\n           CbxEngine::IsSupportedFile(filePath, sniff)  ||\r\n           PsEngine::IsSupportedFile(filePath, sniff)   ||\r\n           ChmEngine::IsSupportedFile(filePath, sniff) ||\r\n           enableEbookEngines && (\r\n               EpubEngine::IsSupportedFile(filePath, sniff) ||\r\n               Fb2Engine::IsSupportedFile(filePath, sniff)  ||\r\n               MobiEngine::IsSupportedFile(filePath, sniff) ||\r\n               PdbEngine::IsSupportedFile(filePath, sniff)  ||\r\n               HtmlEngine::IsSupportedFile(filePath, sniff) ||\r\n               TxtEngine::IsSupportedFile(filePath, sniff)\r\n           );\r\n}\r\n\r\nBaseEngine *CreateEngine(const WCHAR *filePath, PasswordUI *pwdUI, EngineType *typeOut, bool enableChmEngine, bool enableEbookEngines)\r\n{\r\n    CrashIf(!filePath);\r\n\r\n    BaseEngine *engine = nullptr;\r\n    EngineType engineType = Engine_None;\r\n    bool sniff = false;\r\nRetrySniffing:\r\n    if (PdfEngine::IsSupportedFile(filePath, sniff) && engineType != Engine_PDF) {\r\n        engine = PdfEngine::CreateFromFile(filePath, pwdUI);\r\n        engineType = Engine_PDF;\r\n    } else if (XpsEngine::IsSupportedFile(filePath, sniff) && engineType != Engine_XPS) {\r\n        engine = XpsEngine::CreateFromFile(filePath);\r\n        engineType = Engine_XPS;\r\n    } else if (DjVuEngine::IsSupportedFile(filePath, sniff) && engineType != Engine_DjVu) {\r\n        engine = DjVuEngine::CreateFromFile(filePath);\r\n        engineType = Engine_DjVu;\r\n    } else if (ImageEngine::IsSupportedFile(filePath, sniff) && engineType != Engine_Image) {\r\n        engine = ImageEngine::CreateFromFile(filePath);\r\n        engineType = Engine_Image;\r\n    } else if (ImageDirEngine::IsSupportedFile(filePath, sniff) && engineType != Engine_ImageDir) {\r\n        engine = ImageDirEngine::CreateFromFile(filePath);\r\n        engineType = Engine_ImageDir;\r\n    } else if (CbxEngine::IsSupportedFile(filePath, sniff) && engineType != Engine_ComicBook) {\r\n        engine = CbxEngine::CreateFromFile(filePath);\r\n        engineType = Engine_ComicBook;\r\n    } else if (PsEngine::IsSupportedFile(filePath, sniff) && engineType != Engine_PS) {\r\n        engine = PsEngine::CreateFromFile(filePath);\r\n        engineType = Engine_PS;\r\n    } else if (enableChmEngine && ChmEngine::IsSupportedFile(filePath, sniff) && engineType != Engine_Chm) {\r\n        engine = ChmEngine::CreateFromFile(filePath);\r\n        engineType = Engine_Chm;\r\n    } else if (!enableEbookEngines) {\r\n        // don't try to create any of the below ebook engines\r\n    } else if (EpubEngine::IsSupportedFile(filePath, sniff) && engineType != Engine_Epub) {\r\n        engine = EpubEngine::CreateFromFile(filePath);\r\n        engineType = Engine_Epub;\r\n    } else if (Fb2Engine::IsSupportedFile(filePath, sniff) && engineType != Engine_Fb2) {\r\n        engine = Fb2Engine::CreateFromFile(filePath);\r\n        engineType = Engine_Fb2;\r\n    } else if (MobiEngine::IsSupportedFile(filePath, sniff) && engineType != Engine_Mobi) {\r\n        engine = MobiEngine::CreateFromFile(filePath);\r\n        engineType = Engine_Mobi;\r\n    } else if (PdbEngine::IsSupportedFile(filePath, sniff) && engineType != Engine_Pdb) {\r\n        engine = PdbEngine::CreateFromFile(filePath);\r\n        engineType = Engine_Pdb;\r\n    } else if (HtmlEngine::IsSupportedFile(filePath, sniff) && engineType != Engine_Html) {\r\n        engine = HtmlEngine::CreateFromFile(filePath);\r\n        engineType = Engine_Html;\r\n    } else if (TxtEngine::IsSupportedFile(filePath, sniff) && engineType != Engine_Txt) {\r\n        engine = TxtEngine::CreateFromFile(filePath);\r\n        engineType = Engine_Txt;\r\n    }\r\n\r\n    if (!engine && !sniff) {\r\n        // try sniffing the file instead\r\n        sniff = true;\r\n        goto RetrySniffing;\r\n    }\r\n    CrashIf(engine && !IsSupportedFile(filePath, sniff, enableEbookEngines));\r\n\r\n    if (typeOut)\r\n        *typeOut = engine ? engineType : Engine_None;\r\n    return engine;\r\n}\r\n\r\n} // namespace EngineManager\r\n"
  },
  {
    "path": "src/EngineManager.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nenum EngineType {\r\n    Engine_None = 0,\r\n    // the EngineManager tries to create a new engine\r\n    // in the following order (types on the same line\r\n    // share common code and reside in the same file)\r\n    Engine_PDF, Engine_XPS,\r\n    Engine_DjVu,\r\n    Engine_Image, Engine_ImageDir, Engine_ComicBook,\r\n    Engine_PS,\r\n    Engine_Epub, Engine_Fb2, Engine_Mobi, Engine_Pdb,\r\n        Engine_Chm, Engine_Html, Engine_Txt,\r\n};\r\n\r\nnamespace EngineManager {\r\n\r\nbool IsSupportedFile(const WCHAR *filePath, bool sniff=false, bool enableEbookEngines=true);\r\nBaseEngine *CreateEngine(const WCHAR *filePath, PasswordUI *pwdUI=nullptr, EngineType *typeOut=nullptr, bool enableChmEngine=true, bool enableEbookEngines=true);\r\n\r\n}\r\n"
  },
  {
    "path": "src/ExternalViewers.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"CmdLineParser.h\"\r\n#include \"FileUtil.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EngineManager.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"GlobalPrefs.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"TabInfo.h\"\r\n#include \"ExternalViewers.h\"\r\n\r\nstatic WCHAR *GetAcrobatPath()\r\n{\r\n    // Try Adobe Acrobat as a fall-back, if the Reader isn't installed\r\n    ScopedMem<WCHAR> path(ReadRegStr(HKEY_LOCAL_MACHINE, L\"Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\App Paths\\\\AcroRd32.exe\", nullptr));\r\n    if (!path)\r\n        path.Set(ReadRegStr(HKEY_LOCAL_MACHINE, L\"Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\App Paths\\\\Acrobat.exe\", nullptr));\r\n    if (path && file::Exists(path))\r\n        return path.StealData();\r\n    return nullptr;\r\n}\r\n\r\nstatic WCHAR *GetFoxitPath()\r\n{\r\n    ScopedMem<WCHAR> path(ReadRegStr(HKEY_LOCAL_MACHINE, L\"Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Uninstall\\\\Foxit Reader\", L\"DisplayIcon\"));\r\n    if (path && file::Exists(path))\r\n        return path.StealData();\r\n    // Registry value for Foxit 5 (and maybe later)\r\n    path.Set(ReadRegStr(HKEY_LOCAL_MACHINE, L\"Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Uninstall\\\\Foxit Reader_is1\", L\"DisplayIcon\"));\r\n    if (path && file::Exists(path))\r\n        return path.StealData();\r\n    // Registry value for Foxit 5.5 MSI installer\r\n    path.Set(ReadRegStr(HKEY_LOCAL_MACHINE, L\"Software\\\\Foxit Software\\\\Foxit Reader\", L\"InstallPath\"));\r\n    if (path)\r\n        path.Set(path::Join(path, L\"Foxit Reader.exe\"));\r\n    if (path && file::Exists(path))\r\n        return path.StealData();\r\n    return nullptr;\r\n}\r\n\r\nstatic WCHAR *GetPDFXChangePath()\r\n{\r\n    ScopedMem<WCHAR> path(ReadRegStr(HKEY_LOCAL_MACHINE, L\"Software\\\\Tracker Software\\\\PDFViewer\", L\"InstallPath\"));\r\n    if (!path)\r\n        path.Set(ReadRegStr(HKEY_CURRENT_USER, L\"Software\\\\Tracker Software\\\\PDFViewer\", L\"InstallPath\"));\r\n    if (!path)\r\n        return nullptr;\r\n    ScopedMem<WCHAR> exePath(path::Join(path, L\"PDFXCview.exe\"));\r\n    if (file::Exists(exePath))\r\n        return exePath.StealData();\r\n    return nullptr;\r\n}\r\n\r\nstatic WCHAR *GetXPSViewerPath()\r\n{\r\n    // the XPS-Viewer seems to always be installed into %WINDIR%\\system32\r\n    WCHAR buffer[MAX_PATH];\r\n    UINT res = GetSystemDirectory(buffer, dimof(buffer));\r\n    if (!res || res >= dimof(buffer))\r\n        return nullptr;\r\n    ScopedMem<WCHAR> exePath(path::Join(buffer, L\"xpsrchvw.exe\"));\r\n    if (file::Exists(exePath))\r\n        return exePath.StealData();\r\n#ifndef _WIN64\r\n    // Wow64 redirects access to system32 to syswow64 instead, so we\r\n    // disable file system redirection using the recommended method from\r\n    // http://msdn.microsoft.com/en-us/library/aa384187(v=vs.85).aspx\r\n    if (IsRunningInWow64()) {\r\n        res = GetWindowsDirectory(buffer, dimof(buffer));\r\n        if (!res || res >= dimof(buffer))\r\n            return nullptr;\r\n        exePath.Set(path::Join(buffer, L\"Sysnative\\\\xpsrchvw.exe\"));\r\n        if (file::Exists(exePath))\r\n            return exePath.StealData();\r\n    }\r\n#endif\r\n    return nullptr;\r\n}\r\n\r\nstatic WCHAR *GetHtmlHelpPath()\r\n{\r\n    // the Html Help viewer seems to be installed either into %WINDIR% or %WINDIR%\\system32\r\n    WCHAR buffer[MAX_PATH];\r\n    UINT res = GetWindowsDirectory(buffer, dimof(buffer));\r\n    if (!res || res >= dimof(buffer))\r\n        return nullptr;\r\n    ScopedMem<WCHAR> exePath(path::Join(buffer, L\"hh.exe\"));\r\n    if (file::Exists(exePath))\r\n        return exePath.StealData();\r\n    res = GetSystemDirectory(buffer, dimof(buffer));\r\n    if (!res || res >= dimof(buffer))\r\n        return nullptr;\r\n    exePath.Set(path::Join(buffer, L\"hh.exe\"));\r\n    if (file::Exists(exePath))\r\n        return exePath.StealData();\r\n    return nullptr;\r\n}\r\n\r\nstatic bool CanViewExternally(TabInfo *tab)\r\n{\r\n    if (!HasPermission(Perm_DiskAccess))\r\n        return false;\r\n    // if tab is nullptr, we're queried for the\r\n    // About window with disabled menu items\r\n    if (!tab)\r\n        return true;\r\n    return file::Exists(tab->filePath);\r\n}\r\n\r\nbool CouldBePDFDoc(TabInfo *tab)\r\n{\r\n    // consider any error state a potential PDF document\r\n    return !tab || !tab->ctrl || tab->GetEngineType() == Engine_PDF;\r\n}\r\n\r\nbool CanViewWithFoxit(TabInfo *tab)\r\n{\r\n    // Requirements: a valid filename and a valid path to Foxit\r\n    if (!CouldBePDFDoc(tab) || !CanViewExternally(tab))\r\n        return false;\r\n    ScopedMem<WCHAR> path(GetFoxitPath());\r\n    return path != nullptr;\r\n}\r\n\r\nbool ViewWithFoxit(TabInfo *tab, const WCHAR *args)\r\n{\r\n    if (!tab || !CanViewWithFoxit(tab))\r\n        return false;\r\n\r\n    ScopedMem<WCHAR> exePath(GetFoxitPath());\r\n    if (!exePath)\r\n        return false;\r\n    if (!args)\r\n        args = L\"\";\r\n\r\n    // Foxit cmd-line format:\r\n    // [PDF filename] [-n <page number>] [-pwd <password>] [-z <zoom>]\r\n    // TODO: Foxit allows passing password and zoom\r\n    ScopedMem<WCHAR> params;\r\n    if (tab->ctrl)\r\n        params.Set(str::Format(L\"\\\"%s\\\" %s -n %d\", tab->ctrl->FilePath(), args, tab->ctrl->CurrentPageNo()));\r\n    else\r\n        params.Set(str::Format(L\"\\\"%s\\\" %s\", tab->filePath, args));\r\n    return LaunchFile(exePath, params);\r\n}\r\n\r\nbool CanViewWithPDFXChange(TabInfo *tab)\r\n{\r\n    // Requirements: a valid filename and a valid path to PDF X-Change\r\n    if (!CouldBePDFDoc(tab) || !CanViewExternally(tab))\r\n        return false;\r\n    ScopedMem<WCHAR> path(GetPDFXChangePath());\r\n    return path != nullptr;\r\n}\r\n\r\nbool ViewWithPDFXChange(TabInfo *tab, const WCHAR *args)\r\n{\r\n    if (!tab || !CanViewWithPDFXChange(tab))\r\n        return false;\r\n\r\n    ScopedMem<WCHAR> exePath(GetPDFXChangePath());\r\n    if (!exePath)\r\n        return false;\r\n    if (!args)\r\n        args = L\"\";\r\n\r\n    // PDFXChange cmd-line format:\r\n    // [/A \"param=value [&param2=value ...\"] [PDF filename]\r\n    // /A params: page=<page number>\r\n    ScopedMem<WCHAR> params;\r\n    if (tab->ctrl)\r\n        params.Set(str::Format(L\"%s /A \\\"page=%d\\\" \\\"%s\\\"\", args, tab->ctrl->CurrentPageNo(), tab->ctrl->FilePath()));\r\n    else\r\n        params.Set(str::Format(L\"%s \\\"%s\\\"\", args, tab->filePath));\r\n    return LaunchFile(exePath, params);\r\n}\r\n\r\nbool CanViewWithAcrobat(TabInfo *tab)\r\n{\r\n    // Requirements: a valid filename and a valid path to Adobe Reader\r\n    if (!CouldBePDFDoc(tab) || !CanViewExternally(tab))\r\n        return false;\r\n    ScopedMem<WCHAR> exePath(GetAcrobatPath());\r\n    return exePath != nullptr;\r\n}\r\n\r\nbool ViewWithAcrobat(TabInfo *tab, const WCHAR *args)\r\n{\r\n    if (!tab || !CanViewWithAcrobat(tab))\r\n        return false;\r\n\r\n    ScopedMem<WCHAR> exePath(GetAcrobatPath());\r\n    if (!exePath)\r\n        return false;\r\n\r\n    if (!args)\r\n        args = L\"\";\r\n\r\n    ScopedMem<WCHAR> params;\r\n    // Command line format for version 6 and later:\r\n    //   /A \"page=%d&zoom=%.1f,%d,%d&...\" <filename>\r\n    // see http://www.adobe.com/devnet/acrobat/pdfs/pdf_open_parameters.pdf#page=5\r\n    //   /P <filename>\r\n    // see http://www.adobe.com/devnet/acrobat/pdfs/Acrobat_SDK_developer_faq.pdf#page=24\r\n    // TODO: Also set zoom factor and scroll to current position?\r\n    if (tab->ctrl && HIWORD(GetFileVersion(exePath)) >= 6)\r\n        params.Set(str::Format(L\"/A \\\"page=%d\\\" %s \\\"%s\\\"\", tab->ctrl->CurrentPageNo(), args, tab->ctrl->FilePath()));\r\n    else\r\n        params.Set(str::Format(L\"%s \\\"%s\\\"\", args, tab->filePath));\r\n\r\n    return LaunchFile(exePath, params);\r\n}\r\n\r\nbool CanViewWithXPSViewer(TabInfo *tab)\r\n{\r\n    // Requirements: a valid filename and a valid path to XPS-Viewer\r\n    if (!tab || !CanViewExternally(tab))\r\n        return false;\r\n    // allow viewing with XPS-Viewer, if either an XPS document is loaded...\r\n    if (tab->ctrl && tab->GetEngineType() != Engine_XPS)\r\n        return false;\r\n    // or a file ending in .xps or .oxps has failed to be loaded\r\n    if (!tab->ctrl && !str::EndsWithI(tab->filePath, L\".xps\") && !str::EndsWithI(tab->filePath, L\".oxps\"))\r\n        return false;\r\n    ScopedMem<WCHAR> path(GetXPSViewerPath());\r\n    return path != nullptr;\r\n}\r\n\r\nbool ViewWithXPSViewer(TabInfo *tab, const WCHAR *args)\r\n{\r\n    if (!tab || !CanViewWithXPSViewer(tab))\r\n        return false;\r\n\r\n    ScopedMem<WCHAR> exePath(GetXPSViewerPath());\r\n    if (!exePath)\r\n        return false;\r\n\r\n    if (!args)\r\n        args = L\"\";\r\n\r\n    ScopedMem<WCHAR> params;\r\n    if (tab->ctrl)\r\n        params.Set(str::Format(L\"%s \\\"%s\\\"\", args, tab->ctrl->FilePath()));\r\n    else\r\n        params.Set(str::Format(L\"%s \\\"%s\\\"\", args, tab->filePath));\r\n    return LaunchFile(exePath, params);\r\n}\r\n\r\nbool CanViewWithHtmlHelp(TabInfo *tab)\r\n{\r\n    // Requirements: a valid filename and a valid path to HTML Help\r\n    if (!tab || !CanViewExternally(tab))\r\n        return false;\r\n    // allow viewing with HTML Help, if either an CHM document is loaded...\r\n    if (tab->ctrl && tab->GetEngineType() != Engine_Chm && !tab->AsChm())\r\n        return false;\r\n    // or a file ending in .chm has failed to be loaded\r\n    if (!tab->ctrl && !str::EndsWithI(tab->filePath, L\".chm\"))\r\n        return false;\r\n    ScopedMem<WCHAR> path(GetHtmlHelpPath());\r\n    return path != nullptr;\r\n}\r\n\r\nbool ViewWithHtmlHelp(TabInfo *tab, const WCHAR *args)\r\n{\r\n    if (!tab || !CanViewWithHtmlHelp(tab))\r\n        return false;\r\n\r\n    ScopedMem<WCHAR> exePath(GetHtmlHelpPath());\r\n    if (!exePath)\r\n        return false;\r\n\r\n    if (!args)\r\n        args = L\"\";\r\n\r\n    ScopedMem<WCHAR> params;\r\n    if (tab->ctrl)\r\n        params.Set(str::Format(L\"%s \\\"%s\\\"\", args, tab->ctrl->FilePath()));\r\n    else\r\n        params.Set(str::Format(L\"%s \\\"%s\\\"\", args, tab->filePath));\r\n    return LaunchFile(exePath, params);\r\n}\r\n\r\nbool ViewWithExternalViewer(TabInfo *tab, size_t idx)\r\n{\r\n    if (!HasPermission(Perm_DiskAccess) || !tab || !file::Exists(tab->filePath))\r\n        return false;\r\n    for (size_t i = 0; i < gGlobalPrefs->externalViewers->Count() && i <= idx; i++) {\r\n        ExternalViewer *ev = gGlobalPrefs->externalViewers->At(i);\r\n        // cf. AppendExternalViewersToMenu in Menu.cpp\r\n        if (!ev->commandLine || ev->filter && !str::Eq(ev->filter, L\"*\") && !path::Match(tab->filePath, ev->filter))\r\n            idx++;\r\n    }\r\n    if (idx >= gGlobalPrefs->externalViewers->Count() || !gGlobalPrefs->externalViewers->At(idx)->commandLine)\r\n        return false;\r\n\r\n    ExternalViewer *ev = gGlobalPrefs->externalViewers->At(idx);\r\n    WStrVec args;\r\n    ParseCmdLine(ev->commandLine, args, 2);\r\n    if (args.Count() == 0 || !file::Exists(args.At(0)))\r\n        return false;\r\n\r\n    // if the command line contains %p, it's replaced with the current page number\r\n    // if it contains %1, it's replaced with the file path (else the file path is appended)\r\n    const WCHAR *cmdLine = args.Count() > 1 ? args.At(1) : L\"\\\"%1\\\"\";\r\n    ScopedMem<WCHAR> params;\r\n    if (str::Find(cmdLine, L\"%p\")) {\r\n        ScopedMem<WCHAR> pageNoStr(str::Format(L\"%d\", tab->ctrl ? tab->ctrl->CurrentPageNo() : 0));\r\n        params.Set(str::Replace(cmdLine, L\"%p\", pageNoStr));\r\n        cmdLine = params;\r\n    }\r\n    if (str::Find(cmdLine, L\"%1\"))\r\n        params.Set(str::Replace(cmdLine, L\"%1\", tab->filePath));\r\n    else\r\n        params.Set(str::Format(L\"%s \\\"%s\\\"\", cmdLine, tab->filePath));\r\n    return LaunchFile(args.At(0), params);\r\n}\r\n\r\n#define DEFINE_GUID_STATIC(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \\\r\n    static const GUID name = { l, w1, w2, { b1, b2,  b3,  b4,  b5,  b6,  b7,  b8 } }\r\nDEFINE_GUID_STATIC(CLSID_SendMail, 0x9E56BE60, 0xC50F, 0x11CF, 0x9A, 0x2C, 0x00, 0xA0, 0xC9, 0x0A, 0x90, 0xCE);\r\n\r\nbool CanSendAsEmailAttachment(TabInfo *tab)\r\n{\r\n    // Requirements: a valid filename and access to SendMail's IDropTarget interface\r\n    if (!CanViewExternally(tab))\r\n        return false;\r\n\r\n    ScopedComPtr<IDropTarget> pDropTarget;\r\n    return pDropTarget.Create(CLSID_SendMail);\r\n}\r\n\r\nbool SendAsEmailAttachment(TabInfo *tab, HWND hwndParent)\r\n{\r\n    if (!tab || !CanSendAsEmailAttachment(tab))\r\n        return false;\r\n\r\n    // We use the SendTo drop target provided by SendMail.dll, which should ship with all\r\n    // commonly used Windows versions, instead of MAPISendMail, which doesn't support\r\n    // Unicode paths and might not be set up on systems not having Microsoft Outlook installed.\r\n    ScopedComPtr<IDataObject> pDataObject(GetDataObjectForFile(tab->filePath, hwndParent));\r\n    if (!pDataObject)\r\n        return false;\r\n\r\n    ScopedComPtr<IDropTarget> pDropTarget;\r\n    if (!pDropTarget.Create(CLSID_SendMail))\r\n        return false;\r\n\r\n    POINTL pt = { 0, 0 };\r\n    DWORD dwEffect = 0;\r\n    pDropTarget->DragEnter(pDataObject, MK_LBUTTON, pt, &dwEffect);\r\n    HRESULT hr = pDropTarget->Drop(pDataObject, MK_LBUTTON, pt, &dwEffect);\r\n    return SUCCEEDED(hr);\r\n}\r\n"
  },
  {
    "path": "src/ExternalViewers.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nbool CouldBePDFDoc(TabInfo *tab);\r\n\r\nbool CanViewWithFoxit(TabInfo *tab=nullptr);\r\nbool ViewWithFoxit(TabInfo *tab, const WCHAR *args=nullptr);\r\nbool CanViewWithPDFXChange(TabInfo *tab=nullptr);\r\nbool ViewWithPDFXChange(TabInfo *tab, const WCHAR *args=nullptr);\r\nbool CanViewWithAcrobat(TabInfo *tab=nullptr);\r\nbool ViewWithAcrobat(TabInfo *tab, const WCHAR *args=nullptr);\r\n\r\nbool CanViewWithXPSViewer(TabInfo *tab);\r\nbool ViewWithXPSViewer(TabInfo *tab, const WCHAR *args=nullptr);\r\n\r\nbool CanViewWithHtmlHelp(TabInfo *tab);\r\nbool ViewWithHtmlHelp(TabInfo *tab, const WCHAR *args=nullptr);\r\n\r\nbool ViewWithExternalViewer(TabInfo *tab, size_t idx);\r\n\r\nbool CanSendAsEmailAttachment(TabInfo *tab=nullptr);\r\nbool SendAsEmailAttachment(TabInfo *tab, HWND hwndParent=nullptr);\r\n"
  },
  {
    "path": "src/Favorites.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"Dpi.h\"\r\n#include \"FileUtil.h\"\r\n#include \"GdiPlusUtil.h\"\r\n#include \"LabelWithCloseWnd.h\"\r\n#include \"UITask.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EngineManager.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"FileHistory.h\"\r\n#include \"GlobalPrefs.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"WindowInfo.h\"\r\n#include \"TabInfo.h\"\r\n#include \"resource.h\"\r\n#include \"ParseCommandLine.h\"\r\n#include \"AppPrefs.h\"\r\n#include \"Favorites.h\"\r\n#include \"Menu.h\"\r\n#include \"SumatraDialogs.h\"\r\n#include \"Tabs.h\"\r\n#include \"Translations.h\"\r\n\r\nFavorite *Favorites::GetByMenuId(int menuId, DisplayState **dsOut)\r\n{\r\n    DisplayState *ds;\r\n    for (size_t i = 0; (ds = gFileHistory.Get(i)) != nullptr; i++) {\r\n        for (size_t j = 0; j < ds->favorites->Count(); j++) {\r\n            if (menuId == ds->favorites->At(j)->menuId) {\r\n                if (dsOut)\r\n                    *dsOut = ds;\r\n                return ds->favorites->At(j);\r\n            }\r\n        }\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nDisplayState *Favorites::GetByFavorite(Favorite *fn)\r\n{\r\n    DisplayState *ds;\r\n    for (size_t i = 0; (ds = gFileHistory.Get(i)) != nullptr; i++) {\r\n        if (ds->favorites->Contains(fn))\r\n            return ds;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nvoid Favorites::ResetMenuIds()\r\n{\r\n    DisplayState *ds;\r\n    for (size_t i = 0; (ds = gFileHistory.Get(i)) != nullptr; i++) {\r\n        for (size_t j = 0; j < ds->favorites->Count(); j++) {\r\n            ds->favorites->At(j)->menuId = 0;\r\n        }\r\n    }\r\n}\r\n\r\nDisplayState *Favorites::GetFavByFilePath(const WCHAR *filePath)\r\n{\r\n    // it's likely that we'll ask about the info for the same\r\n    // file as in previous call, so use one element cache\r\n    DisplayState *ds = gFileHistory.Get(idxCache);\r\n    if (!ds || !str::Eq(ds->filePath, filePath))\r\n        ds = gFileHistory.Find(filePath, &idxCache);\r\n    return ds;\r\n}\r\n\r\nbool Favorites::IsPageInFavorites(const WCHAR *filePath, int pageNo)\r\n{\r\n    DisplayState *fav = GetFavByFilePath(filePath);\r\n    if (!fav)\r\n        return false;\r\n    for (size_t i = 0; i < fav->favorites->Count(); i++) {\r\n        if (pageNo == fav->favorites->At(i)->pageNo)\r\n            return true;\r\n    }\r\n    return false;\r\n}\r\n\r\nstatic Favorite *FindByPage(DisplayState *ds, int pageNo, const WCHAR *pageLabel=nullptr)\r\n{\r\n    if (pageLabel) {\r\n        for (size_t i = 0; i < ds->favorites->Count(); i++) {\r\n            if (str::Eq(ds->favorites->At(i)->pageLabel, pageLabel))\r\n                return ds->favorites->At(i);\r\n        }\r\n    }\r\n    for (size_t i = 0; i < ds->favorites->Count(); i++) {\r\n        if (pageNo == ds->favorites->At(i)->pageNo)\r\n            return ds->favorites->At(i);\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nstatic int SortByPageNo(const void *a, const void *b)\r\n{\r\n    Favorite *na = *(Favorite **)a;\r\n    Favorite *nb = *(Favorite **)b;\r\n    // sort lower page numbers first\r\n    return na->pageNo - nb->pageNo;\r\n}\r\n\r\nvoid Favorites::AddOrReplace(const WCHAR *filePath, int pageNo, const WCHAR *name, const WCHAR *pageLabel)\r\n{\r\n    DisplayState *fav = GetFavByFilePath(filePath);\r\n    if (!fav) {\r\n        CrashIf(gGlobalPrefs->rememberOpenedFiles);\r\n        fav = NewDisplayState(filePath);\r\n        gFileHistory.Append(fav);\r\n    }\r\n\r\n    Favorite *fn = FindByPage(fav, pageNo, pageLabel);\r\n    if (fn) {\r\n        str::ReplacePtr(&fn->name, name);\r\n        CrashIf(fn->pageLabel && !str::Eq(fn->pageLabel, pageLabel));\r\n    }\r\n    else {\r\n        fn = NewFavorite(pageNo, name, pageLabel);\r\n        fav->favorites->Append(fn);\r\n        fav->favorites->Sort(SortByPageNo);\r\n    }\r\n}\r\n\r\nvoid Favorites::Remove(const WCHAR *filePath, int pageNo)\r\n{\r\n    DisplayState *fav = GetFavByFilePath(filePath);\r\n    if (!fav)\r\n        return;\r\n    Favorite *fn = FindByPage(fav, pageNo);\r\n    if (!fn)\r\n        return;\r\n\r\n    fav->favorites->Remove(fn);\r\n    DeleteFavorite(fn);\r\n\r\n    if (!gGlobalPrefs->rememberOpenedFiles && 0 == fav->favorites->Count()) {\r\n        gFileHistory.Remove(fav);\r\n        DeleteDisplayState(fav);\r\n    }\r\n}\r\n\r\nvoid Favorites::RemoveAllForFile(const WCHAR *filePath)\r\n{\r\n    DisplayState *fav = GetFavByFilePath(filePath);\r\n    if (!fav)\r\n        return;\r\n\r\n    for (size_t i = 0; i < fav->favorites->Count(); i++) {\r\n        DeleteFavorite(fav->favorites->At(i));\r\n    }\r\n    fav->favorites->Reset();\r\n\r\n    if (!gGlobalPrefs->rememberOpenedFiles) {\r\n        gFileHistory.Remove(fav);\r\n        DeleteDisplayState(fav);\r\n    }\r\n}\r\n\r\n// Note: those might be too big\r\n#define MAX_FAV_SUBMENUS 10\r\n#define MAX_FAV_MENUS 10\r\n\r\nMenuDef menuDefFavContext[] = {\r\n    { _TRN(\"Remove from favorites\"),        IDM_FAV_DEL,                0 }\r\n};\r\n\r\nstatic bool HasFavorites()\r\n{\r\n    DisplayState *ds;\r\n    for (size_t i = 0; (ds = gFileHistory.Get(i)) != nullptr; i++) {\r\n        if (ds->favorites->Count() > 0)\r\n            return true;\r\n    }\r\n    return false;\r\n}\r\n\r\n// caller has to free() the result\r\nstatic WCHAR *FavReadableName(Favorite *fn)\r\n{\r\n    ScopedMem<WCHAR> plainLabel(str::Format(L\"%d\", fn->pageNo));\r\n    const WCHAR *label = fn->pageLabel ? fn->pageLabel : plainLabel;\r\n    if (fn->name) {\r\n        ScopedMem<WCHAR> pageNo(str::Format(_TR(\"(page %s)\"), label));\r\n        return str::Join(fn->name, L\" \", pageNo);\r\n    }\r\n    return str::Format(_TR(\"Page %s\"), label);\r\n}\r\n\r\n// caller has to free() the result\r\nstatic WCHAR *FavCompactReadableName(DisplayState *fav, Favorite *fn, bool isCurrent=false)\r\n{\r\n    ScopedMem<WCHAR> rn(FavReadableName(fn));\r\n    if (isCurrent)\r\n        return str::Format(L\"%s : %s\", _TR(\"Current file\"), rn.Get());\r\n    const WCHAR *fp = path::GetBaseName(fav->filePath);\r\n    return str::Format(L\"%s : %s\", fp, rn.Get());\r\n}\r\n\r\nstatic void AppendFavMenuItems(HMENU m, DisplayState *f, UINT& idx, bool combined, bool isCurrent)\r\n{\r\n    for (size_t i = 0; i < f->favorites->Count(); i++) {\r\n        if (i >= MAX_FAV_MENUS)\r\n            return;\r\n        Favorite *fn = f->favorites->At(i);\r\n        fn->menuId = idx++;\r\n        ScopedMem<WCHAR> s;\r\n        if (combined)\r\n            s.Set(FavCompactReadableName(f, fn, isCurrent));\r\n        else\r\n            s.Set(FavReadableName(fn));\r\n        AppendMenu(m, MF_STRING, (UINT_PTR)fn->menuId, win::menu::ToSafeString(s, s));\r\n    }\r\n}\r\n\r\nstatic int SortByBaseFileName(const void *a, const void *b)\r\n{\r\n    const WCHAR *filePathA = *(const WCHAR **)a;\r\n    const WCHAR *filePathB = *(const WCHAR **)b;\r\n    return str::CmpNatural(path::GetBaseName(filePathA), path::GetBaseName(filePathB));\r\n}\r\n\r\nstatic void GetSortedFilePaths(Vec<const WCHAR *>& filePathsSortedOut, DisplayState *toIgnore=nullptr)\r\n{\r\n    DisplayState *ds;\r\n    for (size_t i = 0; (ds = gFileHistory.Get(i)) != nullptr; i++) {\r\n        if (ds->favorites->Count() > 0 && ds != toIgnore)\r\n            filePathsSortedOut.Append(ds->filePath);\r\n    }\r\n    filePathsSortedOut.Sort(SortByBaseFileName);\r\n}\r\n\r\n// For easy access, we try to show favorites in the menu, similar to a list of\r\n// recently opened files.\r\n// The first menu items are for currently opened file (up to MAX_FAV_MENUS), based\r\n// on the assumption that user is usually interested in navigating current file.\r\n// Then we have a submenu for each file for which there are bookmarks (up to\r\n// MAX_FAV_SUBMENUS), each having up to MAX_FAV_MENUS menu items.\r\n// If not all favorites can be shown, we also enable \"Show all favorites\" menu which\r\n// will provide a way to see all favorites.\r\n// Note: not sure if that's the best layout. Maybe we should always use submenu and\r\n// put the submenu for current file as the first one (potentially named as \"Current file\"\r\n// or some such, to make it stand out from other submenus)\r\nstatic void AppendFavMenus(HMENU m, const WCHAR *currFilePath)\r\n{\r\n    // To minimize mouse movement when navigating current file via favorites\r\n    // menu, put favorites for current file first\r\n    DisplayState *currFileFav = nullptr;\r\n    if (currFilePath) {\r\n        currFileFav = gFavorites.GetFavByFilePath(currFilePath);\r\n    }\r\n\r\n    // sort the files with favorites by base file name of file path\r\n    Vec<const WCHAR *> filePathsSorted;\r\n    if (HasPermission(Perm_DiskAccess)) {\r\n        // only show favorites for other files, if we're allowed to open them\r\n        GetSortedFilePaths(filePathsSorted, currFileFav);\r\n    }\r\n    if (currFileFav && currFileFav->favorites->Count() > 0)\r\n        filePathsSorted.InsertAt(0, currFileFav->filePath);\r\n\r\n    if (filePathsSorted.Count() == 0)\r\n        return;\r\n\r\n    AppendMenu(m, MF_SEPARATOR, 0, nullptr);\r\n\r\n    gFavorites.ResetMenuIds();\r\n    UINT menuId = IDM_FAV_FIRST;\r\n\r\n    size_t menusCount = filePathsSorted.Count();\r\n    if (menusCount > MAX_FAV_MENUS)\r\n        menusCount = MAX_FAV_MENUS;\r\n    for (size_t i = 0; i < menusCount; i++) {\r\n        const WCHAR *filePath = filePathsSorted.At(i);\r\n        DisplayState *f = gFavorites.GetFavByFilePath(filePath);\r\n        CrashIf(!f);\r\n        HMENU sub = m;\r\n        bool combined = (f->favorites->Count() == 1);\r\n        if (!combined)\r\n            sub = CreateMenu();\r\n        AppendFavMenuItems(sub, f, menuId, combined, f == currFileFav);\r\n        if (!combined) {\r\n            if (f == currFileFav) {\r\n                AppendMenu(m, MF_POPUP | MF_STRING, (UINT_PTR)sub, _TR(\"Current file\"));\r\n            } else {\r\n                ScopedMem<WCHAR> tmp;\r\n                const WCHAR *fileName = win::menu::ToSafeString(path::GetBaseName(filePath), tmp);\r\n                AppendMenu(m, MF_POPUP | MF_STRING, (UINT_PTR)sub, fileName);\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n// Called when a user opens \"Favorites\" top-level menu. We need to construct\r\n// the menu:\r\n// - disable add/remove menu items if no document is opened\r\n// - if a document is opened and the page is already bookmarked,\r\n//   disable \"add\" menu item and enable \"remove\" menu item\r\n// - if a document is opened and the page is not bookmarked,\r\n//   enable \"add\" menu item and disable \"remove\" menu item\r\nvoid RebuildFavMenu(WindowInfo *win, HMENU menu)\r\n{\r\n    if (!win->IsDocLoaded()) {\r\n        win::menu::SetEnabled(menu, IDM_FAV_ADD, false);\r\n        win::menu::SetEnabled(menu, IDM_FAV_DEL, false);\r\n        AppendFavMenus(menu, nullptr);\r\n    } else {\r\n        ScopedMem<WCHAR> label(win->ctrl->GetPageLabel(win->currPageNo));\r\n        bool isBookmarked = gFavorites.IsPageInFavorites(win->ctrl->FilePath(), win->currPageNo);\r\n        if (isBookmarked) {\r\n            win::menu::SetEnabled(menu, IDM_FAV_ADD, false);\r\n            ScopedMem<WCHAR> s(str::Format(_TR(\"Remove page %s from favorites\"), label.Get()));\r\n            win::menu::SetText(menu, IDM_FAV_DEL, s);\r\n        } else {\r\n            win::menu::SetEnabled(menu, IDM_FAV_DEL, false);\r\n            ScopedMem<WCHAR> s(str::Format(_TR(\"Add page %s to favorites\"), label.Get()));\r\n            win::menu::SetText(menu, IDM_FAV_ADD, s);\r\n        }\r\n        AppendFavMenus(menu, win->ctrl->FilePath());\r\n    }\r\n    win::menu::SetEnabled(menu, IDM_FAV_TOGGLE, HasFavorites());\r\n}\r\n\r\nvoid ToggleFavorites(WindowInfo *win)\r\n{\r\n    if (gGlobalPrefs->showFavorites) {\r\n        SetSidebarVisibility(win, win->tocVisible, false);\r\n    } else {\r\n        SetSidebarVisibility(win, win->tocVisible, true);\r\n        SetFocus(win->hwndFavTree);\r\n    }\r\n}\r\n\r\nstatic void GoToFavorite(WindowInfo *win, int pageNo) {\r\n    if (!WindowInfoStillValid(win))\r\n        return;\r\n    if (win->IsDocLoaded() && win->ctrl->ValidPageNo(pageNo))\r\n        win->ctrl->GoToPage(pageNo, true);\r\n    // we might have been invoked by clicking on a tree view\r\n    // switch focus so that keyboard navigation works, which enables\r\n    // a fluid experience\r\n    win->Focus();\r\n}\r\n\r\n// Going to a bookmark within current file scrolls to a given page.\r\n// Going to a bookmark in another file, loads the file and scrolls to a page\r\n// (similar to how invoking one of the recently opened files works)\r\nstatic void GoToFavorite(WindowInfo *win, DisplayState *f, Favorite *fn)\r\n{\r\n    assert(f && fn);\r\n    if (!f || !fn) return;\r\n\r\n    WindowInfo *existingWin = FindWindowInfoByFile(f->filePath, true);\r\n    if (existingWin) {\r\n        int pageNo = fn->pageNo;\r\n        uitask::Post([=] { GoToFavorite(existingWin, pageNo); });\r\n        return;\r\n    }\r\n\r\n    if (!HasPermission(Perm_DiskAccess))\r\n        return;\r\n\r\n    // When loading a new document, go directly to selected page instead of\r\n    // first showing last seen page stored in file history\r\n    // A hacky solution because I don't want to add even more parameters to\r\n    // LoadDocument() and LoadDocumentInto()\r\n    int pageNo = fn->pageNo;\r\n    DisplayState *ds = gFileHistory.Find(f->filePath);\r\n    if (ds && !ds->useDefaultState && gGlobalPrefs->rememberStatePerDocument) {\r\n        ds->pageNo = fn->pageNo;\r\n        ds->scrollPos = PointI(-1, -1); // don't scroll the page\r\n        pageNo = -1;\r\n    }\r\n\r\n    LoadArgs args(f->filePath, win);\r\n    win = LoadDocument(args);\r\n    if (win) {\r\n        uitask::Post([=] { (win, pageNo); });\r\n    }\r\n}\r\n\r\nvoid GoToFavoriteByMenuId(WindowInfo *win, int wmId)\r\n{\r\n    DisplayState *f;\r\n    Favorite *fn = gFavorites.GetByMenuId(wmId, &f);\r\n    if (fn)\r\n        GoToFavorite(win, f, fn);\r\n}\r\n\r\nstatic void GoToFavForTVItem(WindowInfo* win, HWND hTV, HTREEITEM hItem=nullptr)\r\n{\r\n    if (nullptr == hItem)\r\n        hItem = TreeView_GetSelection(hTV);\r\n\r\n    TVITEM item;\r\n    item.hItem = hItem;\r\n    item.mask = TVIF_PARAM;\r\n    TreeView_GetItem(hTV, &item);\r\n\r\n    Favorite *fn = (Favorite *)item.lParam;\r\n    if (!fn) {\r\n        // can happen for top-level node which is not associated with a favorite\r\n        // but only serves a parent node for favorites for a given file\r\n        return;\r\n    }\r\n    DisplayState *f = gFavorites.GetByFavorite(fn);\r\n    GoToFavorite(win, f, fn);\r\n}\r\n\r\nstatic HTREEITEM InsertFavSecondLevelNode(HWND hwnd, HTREEITEM parent, Favorite *fn)\r\n{\r\n    TV_INSERTSTRUCT tvinsert;\r\n    tvinsert.hParent = parent;\r\n    tvinsert.hInsertAfter = TVI_LAST;\r\n    tvinsert.itemex.mask = TVIF_TEXT | TVIF_STATE | TVIF_PARAM;\r\n    tvinsert.itemex.state = 0;\r\n    tvinsert.itemex.stateMask = TVIS_EXPANDED;\r\n    tvinsert.itemex.lParam = (LPARAM)fn;\r\n    ScopedMem<WCHAR> s(FavReadableName(fn));\r\n    tvinsert.itemex.pszText = s;\r\n    return TreeView_InsertItem(hwnd, &tvinsert);\r\n}\r\n\r\nstatic void InsertFavSecondLevelNodes(HWND hwnd, HTREEITEM parent, DisplayState *f)\r\n{\r\n    for (size_t i = 0; i < f->favorites->Count(); i++) {\r\n        InsertFavSecondLevelNode(hwnd, parent, f->favorites->At(i));\r\n    }\r\n}\r\n\r\nstatic HTREEITEM InsertFavTopLevelNode(HWND hwnd, DisplayState *fav, bool isExpanded)\r\n{\r\n    WCHAR *s = nullptr;\r\n    bool collapsed = fav->favorites->Count() == 1;\r\n    if (collapsed)\r\n        isExpanded = false;\r\n    TV_INSERTSTRUCT tvinsert;\r\n    tvinsert.hParent = nullptr;\r\n    tvinsert.hInsertAfter = TVI_LAST;\r\n    tvinsert.itemex.mask = TVIF_TEXT | TVIF_STATE | TVIF_PARAM;\r\n    tvinsert.itemex.state = isExpanded ? TVIS_EXPANDED : 0;\r\n    tvinsert.itemex.stateMask = TVIS_EXPANDED;\r\n    tvinsert.itemex.lParam = 0;\r\n    if (collapsed) {\r\n        Favorite *fn = fav->favorites->At(0);\r\n        tvinsert.itemex.lParam = (LPARAM)fn;\r\n        s = FavCompactReadableName(fav, fn);\r\n        tvinsert.itemex.pszText = s;\r\n    } else {\r\n        tvinsert.itemex.pszText = (WCHAR*)path::GetBaseName(fav->filePath);\r\n    }\r\n    HTREEITEM ret = TreeView_InsertItem(hwnd, &tvinsert);\r\n    free(s);\r\n    return ret;\r\n}\r\n\r\nvoid PopulateFavTreeIfNeeded(WindowInfo *win)\r\n{\r\n    HWND hwndTree = win->hwndFavTree;\r\n    if (TreeView_GetCount(hwndTree) > 0)\r\n        return;\r\n\r\n    Vec<const WCHAR *> filePathsSorted;\r\n    GetSortedFilePaths(filePathsSorted);\r\n\r\n    SendMessage(hwndTree, WM_SETREDRAW, FALSE, 0);\r\n    for (size_t i = 0; i < filePathsSorted.Count(); i++) {\r\n        DisplayState *f = gFavorites.GetFavByFilePath(filePathsSorted.At(i));\r\n        bool isExpanded = win->expandedFavorites.Contains(f);\r\n        HTREEITEM node = InsertFavTopLevelNode(hwndTree, f, isExpanded);\r\n        if (f->favorites->Count() > 1)\r\n            InsertFavSecondLevelNodes(hwndTree, node, f);\r\n    }\r\n\r\n    SendMessage(hwndTree, WM_SETREDRAW, TRUE, 0);\r\n    UINT fl = RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN;\r\n    RedrawWindow(hwndTree, nullptr, nullptr, fl);\r\n}\r\n\r\nvoid UpdateFavoritesTree(WindowInfo *win)\r\n{\r\n    HWND hwndTree = win->hwndFavTree;\r\n\r\n    if (TreeView_GetCount(hwndTree) > 0) {\r\n        // PopulateFavTreeIfNeeded will re-enable WM_SETREDRAW\r\n        SendMessage(hwndTree, WM_SETREDRAW, FALSE, 0);\r\n        TreeView_DeleteAllItems(hwndTree);\r\n        PopulateFavTreeIfNeeded(win);\r\n    }\r\n\r\n    // hide the favorites tree if we've removed the last favorite\r\n    if (0 == TreeView_GetCount(hwndTree)) {\r\n        SetSidebarVisibility(win, win->tocVisible, false);\r\n    }\r\n}\r\n\r\nvoid UpdateFavoritesTreeForAllWindows()\r\n{\r\n    for (WindowInfo *win : gWindows) {\r\n        UpdateFavoritesTree(win);\r\n    }\r\n}\r\n\r\nstatic DocTocItem *TocItemForPageNo(DocTocItem *item, int pageNo)\r\n{\r\n    DocTocItem *currItem = nullptr;\r\n\r\n    for (; item; item = item->next) {\r\n        if (1 <= item->pageNo && item->pageNo <= pageNo)\r\n            currItem = item;\r\n        if (item->pageNo >= pageNo)\r\n            break;\r\n\r\n        // find any child item closer to the specified page\r\n        DocTocItem *subItem = TocItemForPageNo(item->child, pageNo);\r\n        if (subItem)\r\n            currItem = subItem;\r\n    }\r\n\r\n    return currItem;\r\n}\r\n\r\nvoid AddFavorite(WindowInfo *win)\r\n{\r\n    TabInfo *tab = win->currentTab;\r\n    CrashIf(!tab);\r\n    int pageNo = win->currPageNo;\r\n    ScopedMem<WCHAR> name;\r\n    if (tab->ctrl->HasTocTree()) {\r\n        // use the current ToC heading as default name\r\n        DocTocItem *root = tab->ctrl->GetTocTree();\r\n        DocTocItem *item = TocItemForPageNo(root, pageNo);\r\n        if (item)\r\n            name.Set(str::Dup(item->title));\r\n        delete root;\r\n    }\r\n    ScopedMem<WCHAR> pageLabel(tab->ctrl->GetPageLabel(pageNo));\r\n\r\n    bool shouldAdd = Dialog_AddFavorite(win->hwndFrame, pageLabel, name);\r\n    if (!shouldAdd)\r\n        return;\r\n\r\n    ScopedMem<WCHAR> plainLabel(str::Format(L\"%d\", pageNo));\r\n    bool needsLabel = !str::Eq(plainLabel, pageLabel);\r\n\r\n    RememberFavTreeExpansionStateForAllWindows();\r\n    gFavorites.AddOrReplace(tab->filePath, pageNo, name, needsLabel ? pageLabel.Get() : nullptr);\r\n    // expand newly added favorites by default\r\n    DisplayState *fav = gFavorites.GetFavByFilePath(tab->filePath);\r\n    if (fav && fav->favorites->Count() == 2)\r\n        win->expandedFavorites.Append(fav);\r\n    UpdateFavoritesTreeForAllWindows();\r\n    prefs::Save();\r\n}\r\n\r\nvoid DelFavorite(WindowInfo *win)\r\n{\r\n    CrashIf(!win->currentTab);\r\n    RememberFavTreeExpansionStateForAllWindows();\r\n    gFavorites.Remove(win->currentTab->filePath, win->currPageNo);\r\n    UpdateFavoritesTreeForAllWindows();\r\n    prefs::Save();\r\n}\r\n\r\nvoid RememberFavTreeExpansionState(WindowInfo *win)\r\n{\r\n    win->expandedFavorites.Reset();\r\n    HTREEITEM treeItem = TreeView_GetRoot(win->hwndFavTree);\r\n    while (treeItem) {\r\n        TVITEM item;\r\n        item.hItem = treeItem;\r\n        item.mask = TVIF_PARAM | TVIF_STATE;\r\n        item.stateMask = TVIS_EXPANDED;\r\n        TreeView_GetItem(win->hwndFavTree, &item);\r\n        if ((item.state & TVIS_EXPANDED) != 0) {\r\n            item.hItem = TreeView_GetChild(win->hwndFavTree, treeItem);\r\n            item.mask = TVIF_PARAM;\r\n            TreeView_GetItem(win->hwndFavTree, &item);\r\n            Favorite *fn = (Favorite *)item.lParam;\r\n            DisplayState *f = gFavorites.GetByFavorite(fn);\r\n            win->expandedFavorites.Append(f);\r\n        }\r\n\r\n        treeItem = TreeView_GetNextSibling(win->hwndFavTree, treeItem);\r\n    }\r\n}\r\n\r\nvoid RememberFavTreeExpansionStateForAllWindows()\r\n{\r\n    for (size_t i = 0; i < gWindows.Count(); i++) {\r\n        RememberFavTreeExpansionState(gWindows.At(i));\r\n    }\r\n}\r\n\r\nstatic LRESULT OnFavTreeNotify(WindowInfo *win, LPNMTREEVIEW pnmtv)\r\n{\r\n    switch (pnmtv->hdr.code)\r\n    {\r\n        // TVN_SELCHANGED intentionally not implemented (mouse clicks are handled\r\n        // in NM_CLICK, and keyboard navigation in NM_RETURN and TVN_KEYDOWN)\r\n\r\n        case TVN_KEYDOWN: {\r\n            TV_KEYDOWN *ptvkd = (TV_KEYDOWN *)pnmtv;\r\n            if (VK_TAB == ptvkd->wVKey) {\r\n                if (win->tabsVisible && IsCtrlPressed())\r\n                    TabsOnCtrlTab(win, IsShiftPressed());\r\n                else\r\n                    AdvanceFocus(win);\r\n                return 1;\r\n            }\r\n            break;\r\n        }\r\n\r\n        case NM_CLICK: {\r\n            // Determine which item has been clicked (if any)\r\n            TVHITTESTINFO ht = { 0 };\r\n            DWORD pos = GetMessagePos();\r\n            ht.pt.x = GET_X_LPARAM(pos);\r\n            ht.pt.y = GET_Y_LPARAM(pos);\r\n            MapWindowPoints(HWND_DESKTOP, pnmtv->hdr.hwndFrom, &ht.pt, 1);\r\n            TreeView_HitTest(pnmtv->hdr.hwndFrom, &ht);\r\n\r\n            if ((ht.flags & TVHT_ONITEM))\r\n                GoToFavForTVItem(win, pnmtv->hdr.hwndFrom, ht.hItem);\r\n            break;\r\n        }\r\n\r\n        case NM_RETURN:\r\n            GoToFavForTVItem(win, pnmtv->hdr.hwndFrom);\r\n            break;\r\n\r\n        case NM_CUSTOMDRAW:\r\n            return CDRF_DODEFAULT;\r\n    }\r\n    return -1;\r\n}\r\n\r\nstatic void OnFavTreeContextMenu(WindowInfo *win, PointI pt)\r\n{\r\n    TVITEM item;\r\n    if (pt.x != -1 || pt.y != -1) {\r\n        TVHITTESTINFO ht = { 0 };\r\n        ht.pt.x = pt.x;\r\n        ht.pt.y = pt.y;\r\n\r\n        MapWindowPoints(HWND_DESKTOP, win->hwndFavTree, &ht.pt, 1);\r\n        TreeView_HitTest(win->hwndFavTree, &ht);\r\n        if ((ht.flags & TVHT_ONITEM) == 0)\r\n            return; // only display menu if over a node in tree\r\n\r\n        TreeView_SelectItem(win->hwndFavTree, ht.hItem);\r\n        item.hItem = ht.hItem;\r\n    }\r\n    else {\r\n        item.hItem = TreeView_GetSelection(win->hwndFavTree);\r\n        if (!item.hItem)\r\n            return;\r\n        RECT rcItem;\r\n        if (TreeView_GetItemRect(win->hwndFavTree, item.hItem, &rcItem, TRUE)) {\r\n            MapWindowPoints(win->hwndFavTree, HWND_DESKTOP, (POINT *)&rcItem, 2);\r\n            pt.x = rcItem.left;\r\n            pt.y = rcItem.bottom;\r\n        }\r\n        else {\r\n            WindowRect rc(win->hwndFavTree);\r\n            pt = rc.TL();\r\n        }\r\n    }\r\n\r\n    item.mask = TVIF_PARAM;\r\n    TreeView_GetItem(win->hwndFavTree, &item);\r\n    Favorite *toDelete = (Favorite *)item.lParam;\r\n\r\n    HMENU popup = BuildMenuFromMenuDef(menuDefFavContext, dimof(menuDefFavContext), CreatePopupMenu());\r\n\r\n    INT cmd = TrackPopupMenu(popup, TPM_RETURNCMD | TPM_RIGHTBUTTON,\r\n                             pt.x, pt.y, 0, win->hwndFavTree, nullptr);\r\n    DestroyMenu(popup);\r\n    if (IDM_FAV_DEL == cmd) {\r\n        RememberFavTreeExpansionStateForAllWindows();\r\n        if (toDelete) {\r\n            DisplayState *f = gFavorites.GetByFavorite(toDelete);\r\n            gFavorites.Remove(f->filePath, toDelete->pageNo);\r\n        } else {\r\n            // toDelete == nullptr => this is a parent node signifying all bookmarks in a file\r\n            item.hItem = TreeView_GetChild(win->hwndFavTree, item.hItem);\r\n            item.mask = TVIF_PARAM;\r\n            TreeView_GetItem(win->hwndFavTree, &item);\r\n            toDelete = (Favorite *)item.lParam;\r\n            DisplayState *f = gFavorites.GetByFavorite(toDelete);\r\n            gFavorites.RemoveAllForFile(f->filePath);\r\n        }\r\n        UpdateFavoritesTreeForAllWindows();\r\n        prefs::Save();\r\n\r\n        // TODO: it would be nice to have a system for undo-ing things, like in Gmail,\r\n        // so that we can do destructive operations without asking for permission via\r\n        // invasive model dialog boxes but also allow reverting them if were done\r\n        // by mistake\r\n    }\r\n}\r\n\r\nstatic WNDPROC DefWndProcFavTree = nullptr;\r\nstatic LRESULT CALLBACK WndProcFavTree(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    WindowInfo *win = FindWindowInfoByHwnd(hwnd);\r\n    if (!win)\r\n        return CallWindowProc(DefWndProcFavTree, hwnd, msg, wParam, lParam);\r\n\r\n    switch (msg) {\r\n\r\n        case WM_ERASEBKGND:\r\n            return FALSE;\r\n\r\n        case WM_CHAR:\r\n            if (VK_ESCAPE == wParam && gGlobalPrefs->escToExit && MayCloseWindow(win))\r\n                CloseWindow(win, true);\r\n            break;\r\n\r\n        case WM_MOUSEWHEEL:\r\n        case WM_MOUSEHWHEEL:\r\n            // scroll the canvas if the cursor isn't over the ToC tree\r\n            if (!IsCursorOverWindow(win->hwndFavTree))\r\n                return SendMessage(win->hwndCanvas, msg, wParam, lParam);\r\n            break;\r\n    }\r\n\r\n    return CallWindowProc(DefWndProcFavTree, hwnd, msg, wParam, lParam);\r\n}\r\n\r\nstatic WNDPROC DefWndProcFavBox = nullptr;\r\nstatic LRESULT CALLBACK WndProcFavBox(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)\r\n{\r\n    WindowInfo *win = FindWindowInfoByHwnd(hwnd);\r\n    if (!win)\r\n        return CallWindowProc(DefWndProcFavBox, hwnd, message, wParam, lParam);\r\n    switch (message) {\r\n\r\n        case WM_SIZE:\r\n            LayoutTreeContainer(win->favLabelWithClose, win->hwndFavTree);\r\n            break;\r\n\r\n        case WM_COMMAND:\r\n            if (LOWORD(wParam) == IDC_FAV_LABEL_WITH_CLOSE)\r\n                ToggleFavorites(win);\r\n            break;\r\n\r\n        case WM_NOTIFY:\r\n            if (LOWORD(wParam) == IDC_FAV_TREE) {\r\n                LPNMTREEVIEW pnmtv = (LPNMTREEVIEW) lParam;\r\n                LRESULT res = OnFavTreeNotify(win, pnmtv);\r\n                if (res != -1)\r\n                    return res;\r\n            }\r\n            break;\r\n\r\n        case WM_CONTEXTMENU:\r\n            if (win->hwndFavTree == (HWND)wParam) {\r\n                OnFavTreeContextMenu(win, PointI(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)));\r\n                return 0;\r\n            }\r\n            break;\r\n\r\n    }\r\n    return CallWindowProc(DefWndProcFavBox, hwnd, message, wParam, lParam);\r\n}\r\n\r\nvoid CreateFavorites(WindowInfo *win)\r\n{\r\n    win->hwndFavBox = CreateWindow(WC_STATIC, L\"\", WS_CHILD|WS_CLIPCHILDREN,\r\n                                   0, 0, gGlobalPrefs->sidebarDx, 0,\r\n                                   win->hwndFrame, (HMENU)0, GetModuleHandle(nullptr), nullptr);\r\n\r\n    LabelWithCloseWnd *l = CreateLabelWithCloseWnd(win->hwndFavBox, IDC_FAV_LABEL_WITH_CLOSE);\r\n    win->favLabelWithClose = l;\r\n    SetPaddingXY(l, 2, 2);\r\n    SetFont(l, GetDefaultGuiFont());\r\n    // label is set in UpdateToolbarSidebarText()\r\n\r\n    win->hwndFavTree = CreateWindowEx(WS_EX_STATICEDGE, WC_TREEVIEW, L\"Fav\",\r\n                                      TVS_HASBUTTONS|TVS_HASLINES|TVS_LINESATROOT|TVS_SHOWSELALWAYS|\r\n                                      TVS_TRACKSELECT|TVS_DISABLEDRAGDROP|TVS_NOHSCROLL|TVS_INFOTIP|\r\n                                      WS_TABSTOP|WS_VISIBLE|WS_CHILD,\r\n                                      0, 0, 0, 0, win->hwndFavBox, (HMENU)IDC_FAV_TREE, GetModuleHandle(nullptr), nullptr);\r\n\r\n    TreeView_SetUnicodeFormat(win->hwndFavTree, true);\r\n\r\n    if (nullptr == DefWndProcFavTree)\r\n        DefWndProcFavTree = (WNDPROC)GetWindowLongPtr(win->hwndFavTree, GWLP_WNDPROC);\r\n    SetWindowLongPtr(win->hwndFavTree, GWLP_WNDPROC, (LONG_PTR)WndProcFavTree);\r\n\r\n    if (nullptr == DefWndProcFavBox)\r\n        DefWndProcFavBox = (WNDPROC)GetWindowLongPtr(win->hwndFavBox, GWLP_WNDPROC);\r\n    SetWindowLongPtr(win->hwndFavBox, GWLP_WNDPROC, (LONG_PTR)WndProcFavBox);\r\n}\r\n"
  },
  {
    "path": "src/Favorites.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n/*\r\nA favorite is a bookmark (we call it a favorite, like Internet Explorer, to\r\ndifferentiate from bookmarks inside a PDF file (which really are\r\ntable of contents)).\r\n\r\nWe can have multiple favorites per file.\r\n\r\nFavorites are accurate to a page - it's simple and should be good enough\r\nfor the user.\r\n\r\nA favorite is identified by a (mandatory) page number and (optional) name\r\n(provided by the user) and page label (from BaseEngine::GetPageLabel).\r\n\r\nFavorites do not remember presentation settings like zoom or viewing mode -\r\nthey are for navigation only. Presentation settings are remembered on a\r\nper-file basis in FileHistory.\r\n*/\r\n\r\n// Favorites is a convenience interface into gFileHistory\r\nclass Favorites {\r\n    size_t idxCache;\r\n\r\npublic:\r\n    Favorites() : idxCache((size_t)-1) { }\r\n\r\n    Favorite *GetByMenuId(int menuId, DisplayState **dsOut=nullptr);\r\n    void ResetMenuIds();\r\n    DisplayState *GetFavByFilePath(const WCHAR *filePath);\r\n    DisplayState *GetByFavorite(Favorite *fn);\r\n    bool IsPageInFavorites(const WCHAR *filePath, int pageNo);\r\n    void AddOrReplace(const WCHAR *filePath, int pageNo, const WCHAR *name, const WCHAR *pageLabel=nullptr);\r\n    void Remove(const WCHAR *filePath, int pageNo);\r\n    void RemoveAllForFile(const WCHAR *filePath);\r\n};\r\n\r\nvoid AddFavorite(WindowInfo *win);\r\nvoid DelFavorite(WindowInfo *win);\r\nvoid RebuildFavMenu(WindowInfo *win, HMENU menu);\r\nvoid CreateFavorites(WindowInfo *win);\r\nvoid ToggleFavorites(WindowInfo *win);\r\nvoid PopulateFavTreeIfNeeded(WindowInfo *win);\r\nvoid RememberFavTreeExpansionStateForAllWindows();\r\nvoid GoToFavoriteByMenuId(WindowInfo *win, int wmId);\r\nvoid UpdateFavoritesTree(WindowInfo *win);\r\nvoid UpdateFavoritesTreeForAllWindows();\r\n"
  },
  {
    "path": "src/FileHistory.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\nLicense: GPLv3 */\n\n// utils\n#include \"BaseUtil.h\"\n#include \"FileUtil.h\"\n// layout controllers\n#include \"BaseEngine.h\"\n#include \"SettingsStructs.h\"\n#include \"FileHistory.h\"\n#include \"GlobalPrefs.h\"\n\n/* Handling of file history list.\n\nWe keep a mostly infinite list of all (still existing in the file system)\nfiles that a user has ever opened. For each file we also keep a bunch of\nattributes describing the display state at the time the file was closed.\n\nWe persist this list inside preferences file to something looking like this:\n\nFileStates [\nFilePath =  C:\\path\\to\\file.pdf\nDisplayMode = single page\nPageNo =  1\nZoomVirtual = 123.4567\nWindow State = 2\n...\n]\netc...\n\nWe deserialize this info at startup and serialize when the application\nquits.\n*/\n\n// maximum number of files to remember in total\n// (to keep the settings file within reasonable bounds)\n#define FILE_HISTORY_MAX_FILES 1000\n\n// sorts the most often used files first\nstatic int cmpOpenCount(const void *a, const void *b) {\n    DisplayState *dsA = *(DisplayState **) a;\n    DisplayState *dsB = *(DisplayState **) b;\n    // sort pinned documents before unpinned ones\n    if (dsA->isPinned != dsB->isPinned)\n        return dsA->isPinned ? -1 : 1;\n    // sort pinned documents alphabetically\n    if (dsA->isPinned)\n        return str::CmpNatural(path::GetBaseName(dsA->filePath), path::GetBaseName(dsB->filePath));\n    // sort often opened documents first\n    if (dsA->openCount != dsB->openCount)\n        return dsB->openCount - dsA->openCount;\n    // use recency as the criterion in case of equal open counts\n    return dsA->index < dsB->index ? -1 : 1;\n}\n\nvoid FileHistory::Clear(bool keepFavorites) {\n    if (!states)\n        return;\n    Vec<DisplayState *> keep;\n    for (size_t i = 0; i < states->Count(); i++) {\n        if (keepFavorites && states->At(i)->favorites->Count() > 0) {\n            states->At(i)->openCount = 0;\n            keep.Append(states->At(i));\n        } else {\n            DeleteDisplayState(states->At(i));\n        }\n    }\n    *states = keep;\n}\n\nDisplayState *FileHistory::Get(size_t index) const {\n    if (index < states->Count())\n        return states->At(index);\n    return nullptr;\n}\n\nDisplayState *FileHistory::Find(const WCHAR *filePath, size_t *idxOut) const {\n    for (size_t i = 0; i < states->Count(); i++) {\n        if (str::EqI(states->At(i)->filePath, filePath)) {\n            if (idxOut)\n                *idxOut = i;\n            return states->At(i);\n        }\n    }\n    return nullptr;\n}\n\nDisplayState *FileHistory::MarkFileLoaded(const WCHAR *filePath) {\n    CrashIf(!filePath);\n    // if a history entry with the same name already exists,\n    // then reuse it. That way we don't have duplicates and\n    // the file moves to the front of the list\n    DisplayState *state = Find(filePath);\n    if (!state) {\n        state = NewDisplayState(filePath);\n        state->useDefaultState = true;\n    } else {\n        states->Remove(state);\n        state->isMissing = false;\n    }\n    states->InsertAt(0, state);\n    state->openCount++;\n    return state;\n}\n\nbool FileHistory::MarkFileInexistent(const WCHAR *filePath, bool hide) {\n    CrashIf(!filePath);\n    DisplayState *state = Find(filePath);\n    if (!state)\n        return false;\n    // move the file history entry to the end of the list\n    // of recently opened documents (if it exists at all),\n    // so that the user could still try opening it again\n    // and so that we don't completely forget the settings,\n    // should the file reappear later on\n    int newIdx = hide ? INT_MAX : FILE_HISTORY_MAX_RECENT - 1;\n    int idx = states->Find(state);\n    if (idx < newIdx && state != states->Last()) {\n        states->Remove(state);\n        if (states->Count() <= (size_t) newIdx)\n            states->Append(state);\n        else\n            states->InsertAt(newIdx, state);\n    }\n    // also delete the thumbnail and move the link towards the\n    // back in the Frequently Read list\n    delete state->thumbnail;\n    state->thumbnail = nullptr;\n    state->openCount >>= 2;\n    state->isMissing = hide;\n    return true;\n}\n\n// returns a shallow copy of the file history list, sorted\n// by open count (which has a pre-multiplied recency factor)\n// and with all missing states filtered out\n// caller needs to delete the result (but not the contained states)\nvoid FileHistory::GetFrequencyOrder(Vec<DisplayState *>& list) {\n    CrashIf(list.Count() > 0);\n    size_t i = 0;\n    for (DisplayState *ds : *states) {\n        ds->index = i++;\n        if (!ds->isMissing || ds->isPinned)\n            list.Append(ds);\n    }\n    list.Sort(cmpOpenCount);\n}\n\n// removes file history entries which shouldn't be saved anymore\n// (see the loop below for the details)\nvoid FileHistory::Purge(bool alwaysUseDefaultState) {\n    // minOpenCount is set to the number of times a file must have been\n    // opened to be kept (provided that there is no other valuable\n    // information about the file to be remembered)\n    int minOpenCount = 0;\n    if (alwaysUseDefaultState) {\n        Vec<DisplayState *> frequencyList;\n        GetFrequencyOrder(frequencyList);\n        if (frequencyList.Count() > FILE_HISTORY_MAX_RECENT)\n            minOpenCount = frequencyList.At(FILE_HISTORY_MAX_FREQUENT)->openCount / 2;\n    }\n\n    for (size_t j = states->Count(); j > 0; j--) {\n        DisplayState *state = states->At(j - 1);\n        // never forget pinned documents, documents we've remembered a password for and\n        // documents for which there are favorites\n        if (state->isPinned || state->decryptionKey != nullptr || state->favorites->Count() > 0)\n            continue;\n        // forget about missing documents without valuable state\n        if (state->isMissing && (alwaysUseDefaultState || state->useDefaultState))\n            states->RemoveAt(j - 1);\n        // forget about files last opened longer ago than the last FILE_HISTORY_MAX_FILES ones\n        else if (j > FILE_HISTORY_MAX_FILES)\n            states->RemoveAt(j - 1);\n        // forget about files that were hardly used (and without valuable state)\n        else if (alwaysUseDefaultState && state->openCount < minOpenCount && j > FILE_HISTORY_MAX_RECENT)\n            states->RemoveAt(j - 1);\n        else\n            continue;\n        DeleteDisplayState(state);\n    }\n}\n"
  },
  {
    "path": "src/FileHistory.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: GPLv3 */\n\n// number of most recently used files that will be shown in the menu\n// (and remembered in the preferences file, if just filenames are\n//  to be remembered and not individual view settings per document)\n#define FILE_HISTORY_MAX_RECENT     10\n\n// maximum number of most frequently used files that will be shown on the\n// Frequent Read list (space permitting)\n#define FILE_HISTORY_MAX_FREQUENT   10\n\nclass FileHistory {\n    // owned by gGlobalPrefs->fileStates\n    Vec<DisplayState *> *states;\n\npublic:\n    FileHistory() : states(nullptr) { }\n    ~FileHistory() { }\n\n    void Clear(bool keepFavorites);\n    void Append(DisplayState *state) { states->Append(state); }\n    void Remove(DisplayState *state) { states->Remove(state); }\n    DisplayState *Get(size_t index) const;\n    DisplayState *Find(const WCHAR *filePath, size_t *idxOut = nullptr) const;\n    DisplayState *MarkFileLoaded(const WCHAR *filePath);\n    bool MarkFileInexistent(const WCHAR *filePath, bool hide = false);\n    void GetFrequencyOrder(Vec<DisplayState *>& list);\n    void Purge(bool alwaysUseDefaultState = false);\n    void UpdateStatesSource(Vec<DisplayState *> *states) { this->states = states; }\n};\n"
  },
  {
    "path": "src/FileModifications.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"FileTransactions.h\"\r\n#include \"FileUtil.h\"\r\n#include \"SquareTreeParser.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"FileModifications.h\"\r\n// ui\r\n#include \"Version.h\"\r\n\r\n/*\r\nThe following format (SumatraPDF Modifications eXtensible) is used for\r\nstoring file modifications for file formats which don't allow to save\r\nsuch modifications portably within the file structure (i.e. currently\r\nany format but PDF). The format uses SquareTree syntax (using its INI\r\nserialization for better interoperability):\r\n\r\n[@meta]\r\nversion = 2.3\r\nfilesize = 98765\r\ntimestamp = 2013-03-09T12:34:56Z\r\n\r\n[highlight]\r\npage = 1\r\nrect = 10 10 100 100\r\ncolor = #ff0000\r\nopacity = 0.8\r\n\r\n[annotType]\r\npage = no\r\nrect = x y w h\r\ncolor = #rrggbb\r\nopacity = 1\r\n\r\n...\r\n\r\n[@update]\r\nversion = 2.3\r\nfilesize = 98765\r\ntimestamp = 2013-03-10T05:43:21Z\r\n\r\n...\r\n\r\n(Currently, the only supported modifications are adding annotations.)\r\n*/\r\n\r\n#define SMX_FILE_EXT        L\".smx\"\r\n#define SMX_CURR_VERSION    CURR_VERSION_STRA\r\n\r\nstatic Vec<PageAnnotation> *ParseFileModifications(const char *data)\r\n{\r\n    if (!data)\r\n        return nullptr;\r\n\r\n    SquareTree sqt(data);\r\n    if (!sqt.root || sqt.root->data.Count() == 0)\r\n        return nullptr;\r\n    SquareTreeNode::DataItem& item = sqt.root->data.At(0);\r\n    if (!item.isChild || !str::EqI(item.key, \"@meta\"))\r\n        return nullptr;\r\n    if (!item.value.child->GetValue(\"version\")) {\r\n        // don't check the version value - rather extend the format\r\n        // in a way to ensure backwards compatibility\r\n        return nullptr;\r\n    }\r\n\r\n    Vec<PageAnnotation> *list = new Vec<PageAnnotation>();\r\n    for (SquareTreeNode::DataItem& i : sqt.root->data) {\r\n        PageAnnotType type = str::EqI(i.key, \"highlight\") ? Annot_Highlight :\r\n                             str::EqI(i.key, \"underline\") ? Annot_Underline :\r\n                             str::EqI(i.key, \"strikeout\") ? Annot_StrikeOut :\r\n                             str::EqI(i.key, \"squiggly\")  ? Annot_Squiggly  :\r\n                             Annot_None;\r\n        CrashIf(!i.isChild);\r\n        if (Annot_None == type || !i.isChild)\r\n            continue;\r\n\r\n        int pageNo;\r\n        geomutil::RectT<float> rect;\r\n        PageAnnotation::Color color;\r\n        float opacity;\r\n        int r, g, b;\r\n\r\n        SquareTreeNode *node = i.value.child;\r\n        const char *value = node->GetValue(\"page\");\r\n        if (!value || !str::Parse(value, \"%d%$\", &pageNo))\r\n            continue;\r\n        value = node->GetValue(\"rect\");\r\n        if (!value || !str::Parse(value, \"%f %f %f %f%$\", &rect.x, &rect.y, &rect.dx, &rect.dy))\r\n            continue;\r\n        value = node->GetValue(\"color\");\r\n        if (!value || !str::Parse(value, \"#%2x%2x%2x%$\", &r, &g, &b))\r\n            continue;\r\n        value = node->GetValue(\"opacity\");\r\n        if (!value || !str::Parse(value, \"%f%$\", &opacity))\r\n            opacity = 1.0f;\r\n        color = PageAnnotation::Color((uint8_t)r, (uint8_t)g, (uint8_t)b, (uint8_t)(255 * opacity));\r\n        list->Append(PageAnnotation(type, pageNo, rect.Convert<double>(), color));\r\n    }\r\n\r\n    return list;\r\n}\r\n\r\nVec<PageAnnotation> *LoadFileModifications(const WCHAR *filePath)\r\n{\r\n    ScopedMem<WCHAR> modificationsPath(str::Join(filePath, SMX_FILE_EXT));\r\n    ScopedMem<char> data(file::ReadAll(modificationsPath, nullptr));\r\n    return ParseFileModifications(data);\r\n}\r\n\r\nbool SaveFileModifictions(const WCHAR *filePath, Vec<PageAnnotation> *list)\r\n{\r\n    if (!list)\r\n        return false;\r\n\r\n    ScopedMem<WCHAR> modificationsPath(str::Join(filePath, SMX_FILE_EXT));\r\n    str::Str<char> data;\r\n    size_t offset = 0;\r\n\r\n    ScopedMem<char> prevData(file::ReadAll(modificationsPath, nullptr));\r\n    Vec<PageAnnotation> *prevList = ParseFileModifications(prevData);\r\n    bool isUpdate = prevList != nullptr;\r\n    if (isUpdate) {\r\n        // in the case of an update, append changed annotations to the existing ones\r\n        // (don't rewrite the existing ones in case they're by a newer version which\r\n        // added annotation types and properties this version doesn't know anything about)\r\n        for (; offset < prevList->Count() && prevList->At(offset) == list->At(offset); offset++);\r\n        CrashIfDebugOnly(offset != prevList->Count());\r\n        data.AppendAndFree(prevData.StealData());\r\n        delete prevList;\r\n    }\r\n    else {\r\n        data.AppendFmt(\"# SumatraPDF: modifications to \\\"%S\\\"\\r\\n\", path::GetBaseName(filePath));\r\n    }\r\n    data.Append(\"\\r\\n\");\r\n\r\n    if (list->Count() == offset)\r\n        return true; // nothing (new) to save\r\n\r\n    data.AppendFmt(\"[@%s]\\r\\n\", isUpdate ? \"update\" : \"meta\");\r\n    data.AppendFmt(\"version = %s\\r\\n\", SMX_CURR_VERSION);\r\n    int64 size = file::GetSize(filePath);\r\n    if (0 <= size && size <= UINT_MAX)\r\n        data.AppendFmt(\"filesize = %u\\r\\n\", (UINT)size);\r\n    SYSTEMTIME time;\r\n    GetSystemTime(&time);\r\n    data.AppendFmt(\"timestamp = %04d-%02d-%02dT%02d:%02d:%02dZ\\r\\n\",\r\n        time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond);\r\n    data.Append(\"\\r\\n\");\r\n\r\n    for (size_t i = offset; i < list->Count(); i++) {\r\n        PageAnnotation& annot = list->At(i);\r\n        switch (annot.type) {\r\n        case Annot_Highlight: data.Append(\"[highlight]\\r\\n\"); break;\r\n        case Annot_Underline: data.Append(\"[underline]\\r\\n\"); break;\r\n        case Annot_StrikeOut: data.Append(\"[strikeout]\\r\\n\"); break;\r\n        case Annot_Squiggly:  data.Append(\"[squiggly]\\r\\n\");  break;\r\n        default: continue;\r\n        }\r\n        data.AppendFmt(\"page = %d\\r\\n\", annot.pageNo);\r\n        data.AppendFmt(\"rect = %g %g %g %g\\r\\n\", annot.rect.x, annot.rect.y, annot.rect.dx, annot.rect.dy);\r\n        data.AppendFmt(\"color = #%02x%02x%02x\\r\\n\", annot.color.r, annot.color.g, annot.color.b);\r\n        data.AppendFmt(\"opacity = %g\\r\\n\", annot.color.a / 255.f);\r\n        data.Append(\"\\r\\n\");\r\n    }\r\n    data.RemoveAt(data.Size() - 2, 2);\r\n\r\n    FileTransaction trans;\r\n    return trans.WriteAll(modificationsPath, data.LendData(), data.Size()) && trans.Commit();\r\n}\r\n\r\nbool IsModificationsFile(const WCHAR *filePath)\r\n{\r\n    if (!str::EndsWithI(filePath, SMX_FILE_EXT))\r\n        return false;\r\n    ScopedMem<WCHAR> origPath(str::DupN(filePath, str::Len(filePath) - str::Len(SMX_FILE_EXT)));\r\n    return file::Exists(origPath);\r\n}\r\n"
  },
  {
    "path": "src/FileModifications.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nstruct PageAnnotation;\r\n\r\nVec<PageAnnotation> *LoadFileModifications(const WCHAR *filePath);\r\nbool SaveFileModifictions(const WCHAR *filePath, Vec<PageAnnotation> *list);\r\nbool IsModificationsFile(const WCHAR *filePath);\r\n"
  },
  {
    "path": "src/FileThumbnails.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"CryptoUtil.h\"\r\n#include \"FileUtil.h\"\r\n#include \"GdiPlusUtil.h\"\r\n#include \"WinUtil.h\"\r\n// layout controllers\r\n#include \"BaseEngine.h\"\r\n#include \"SettingsStructs.h\"\r\n#include \"FileHistory.h\"\r\n// ui\r\n#include \"AppTools.h\"\r\n#include \"FileThumbnails.h\"\r\n\r\n#define THUMBNAILS_DIR_NAME L\"sumatrapdfcache\"\r\n\r\n// TODO: create in TEMP directory instead?\r\nstatic WCHAR *GetThumbnailPath(const WCHAR *filePath)\r\n{\r\n    // create a fingerprint of a (normalized) path for the file name\r\n    // I'd have liked to also include the file's last modification time\r\n    // in the fingerprint (much quicker than hashing the entire file's\r\n    // content), but that's too expensive for files on slow drives\r\n    unsigned char digest[16];\r\n    // TODO: why is this happening? Seen in crash reports e.g. 35043\r\n    if (!filePath)\r\n        return nullptr;\r\n    ScopedMem<char> pathU(str::conv::ToUtf8(filePath));\r\n    if (!pathU)\r\n        return nullptr;\r\n    if (path::HasVariableDriveLetter(filePath))\r\n        pathU[0] = '?'; // ignore the drive letter, if it might change\r\n    CalcMD5Digest((unsigned char *)pathU.Get(), str::Len(pathU), digest);\r\n    ScopedMem<char> fingerPrint(_MemToHex(&digest));\r\n\r\n    ScopedMem<WCHAR> thumbsPath(AppGenDataFilename(THUMBNAILS_DIR_NAME));\r\n    if (!thumbsPath)\r\n        return nullptr;\r\n    ScopedMem<WCHAR> fname(str::conv::FromAnsi(fingerPrint));\r\n\r\n    return str::Format(L\"%s\\\\%s.png\", thumbsPath.Get(), fname.Get());\r\n}\r\n\r\n// removes thumbnails that don't belong to any frequently used item in file history\r\nvoid CleanUpThumbnailCache(FileHistory& fileHistory)\r\n{\r\n    ScopedMem<WCHAR> thumbsPath(AppGenDataFilename(THUMBNAILS_DIR_NAME));\r\n    if (!thumbsPath)\r\n        return;\r\n    ScopedMem<WCHAR> pattern(path::Join(thumbsPath, L\"*.png\"));\r\n\r\n    WStrVec files;\r\n    WIN32_FIND_DATA fdata;\r\n\r\n    HANDLE hfind = FindFirstFile(pattern, &fdata);\r\n    if (INVALID_HANDLE_VALUE == hfind)\r\n        return;\r\n    do {\r\n        if (!(fdata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))\r\n            files.Append(str::Dup(fdata.cFileName));\r\n    } while (FindNextFile(hfind, &fdata));\r\n    FindClose(hfind);\r\n\r\n    Vec<DisplayState *> list;\r\n    fileHistory.GetFrequencyOrder(list);\r\n    for (size_t i = 0; i < list.Count() && i < FILE_HISTORY_MAX_FREQUENT * 2; i++) {\r\n        ScopedMem<WCHAR> bmpPath(GetThumbnailPath(list.At(i)->filePath));\r\n        if (!bmpPath)\r\n            continue;\r\n        int idx = files.Find(path::GetBaseName(bmpPath));\r\n        if (idx != -1) {\r\n            CrashIf(idx < 0 || files.Count() <= (size_t)idx);\r\n            free(files.PopAt(idx));\r\n        }\r\n    }\r\n\r\n    for (size_t i = 0; i < files.Count(); i++) {\r\n        ScopedMem<WCHAR> bmpPath(path::Join(thumbsPath, files.At(i)));\r\n        file::Delete(bmpPath);\r\n    }\r\n}\r\n\r\nstatic RenderedBitmap *LoadRenderedBitmap(const WCHAR *filePath)\r\n{\r\n    size_t len;\r\n    ScopedMem<char> data(file::ReadAll(filePath, &len));\r\n    if (!data)\r\n        return nullptr;\r\n    Bitmap *bmp = BitmapFromData(data, len);\r\n    if (!bmp)\r\n        return nullptr;\r\n\r\n    HBITMAP hbmp;\r\n    RenderedBitmap *rendered = nullptr;\r\n    if (bmp->GetHBITMAP((ARGB)Color::White, &hbmp) == Ok)\r\n        rendered = new RenderedBitmap(hbmp, SizeI(bmp->GetWidth(), bmp->GetHeight()));\r\n    delete bmp;\r\n\r\n    return rendered;\r\n}\r\n\r\nbool LoadThumbnail(DisplayState& ds)\r\n{\r\n    delete ds.thumbnail;\r\n    ds.thumbnail = nullptr;\r\n\r\n    ScopedMem<WCHAR> bmpPath(GetThumbnailPath(ds.filePath));\r\n    if (!bmpPath)\r\n        return false;\r\n\r\n    RenderedBitmap *bmp = LoadRenderedBitmap(bmpPath);\r\n    if (!bmp || bmp->Size().IsEmpty()) {\r\n        delete bmp;\r\n        return false;\r\n    }\r\n\r\n    ds.thumbnail = bmp;\r\n    return true;\r\n}\r\n\r\nbool HasThumbnail(DisplayState& ds)\r\n{\r\n    if (!ds.thumbnail && !LoadThumbnail(ds))\r\n        return false;\r\n\r\n    ScopedMem<WCHAR> bmpPath(GetThumbnailPath(ds.filePath));\r\n    if (!bmpPath)\r\n        return true;\r\n    FILETIME bmpTime = file::GetModificationTime(bmpPath);\r\n    FILETIME fileTime = file::GetModificationTime(ds.filePath);\r\n    // delete the thumbnail if the file is newer than the thumbnail\r\n    if (FileTimeDiffInSecs(fileTime, bmpTime) > 0) {\r\n        delete ds.thumbnail;\r\n        ds.thumbnail = nullptr;\r\n    }\r\n\r\n    return ds.thumbnail != nullptr;\r\n}\r\n\r\nvoid SetThumbnail(DisplayState *ds, RenderedBitmap *bmp)\r\n{\r\n    CrashIf(bmp && bmp->Size().IsEmpty());\r\n    if (!ds || !bmp || bmp->Size().IsEmpty()) {\r\n        delete bmp;\r\n        return;\r\n    }\r\n    delete ds->thumbnail;\r\n    ds->thumbnail = bmp;\r\n    SaveThumbnail(*ds);\r\n}\r\n\r\nvoid SaveThumbnail(DisplayState& ds)\r\n{\r\n    if (!ds.thumbnail)\r\n        return;\r\n\r\n    ScopedMem<WCHAR> bmpPath(GetThumbnailPath(ds.filePath));\r\n    if (!bmpPath)\r\n        return;\r\n    ScopedMem<WCHAR> thumbsPath(path::GetDir(bmpPath));\r\n    if (dir::Create(thumbsPath)) {\r\n        CrashIf(!str::EndsWithI(bmpPath, L\".png\"));\r\n        Bitmap bmp(ds.thumbnail->GetBitmap(), nullptr);\r\n        CLSID tmpClsid = GetEncoderClsid(L\"image/png\");\r\n        bmp.Save(bmpPath.Get(), &tmpClsid, nullptr);\r\n    }\r\n}\r\n\r\nvoid RemoveThumbnail(DisplayState& ds)\r\n{\r\n    if (!HasThumbnail(ds))\r\n        return;\r\n\r\n    ScopedMem<WCHAR> bmpPath(GetThumbnailPath(ds.filePath));\r\n    if (bmpPath)\r\n        file::Delete(bmpPath);\r\n    delete ds.thumbnail;\r\n    ds.thumbnail = nullptr;\r\n}\r\n"
  },
  {
    "path": "src/FileThumbnails.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// thumbnails are 150px high and have a ratio of sqrt(2) : 1\r\n#define THUMBNAIL_DX        212\r\n#define THUMBNAIL_DY        150\r\n\r\nvoid    CleanUpThumbnailCache(FileHistory& fileHistory);\r\n\r\nbool    LoadThumbnail(DisplayState& ds);\r\nbool    HasThumbnail(DisplayState& ds);\r\n// takes ownership of bmp\r\nvoid    SetThumbnail(DisplayState *ds, RenderedBitmap *bmp);\r\nvoid    SaveThumbnail(DisplayState& ds);\r\nvoid    RemoveThumbnail(DisplayState& ds);\r\n"
  },
  {
    "path": "src/GlobalPrefs.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"DebugLog.h\"\r\n#include \"FileUtil.h\"\r\n#include \"SettingsUtil.h\"\r\n// layout controllers\r\n#include \"BaseEngine.h\"\r\n#define INCLUDE_SETTINGSSTRUCTS_METADATA\r\n#include \"SettingsStructs.h\"\r\n#include \"GlobalPrefs.h\"\r\n\r\nGlobalPrefs *gGlobalPrefs = nullptr;\r\n\r\nDisplayState *NewDisplayState(const WCHAR *filePath)\r\n{\r\n    DisplayState *ds = (DisplayState *)DeserializeStruct(&gFileStateInfo, nullptr);\r\n    str::ReplacePtr(&ds->filePath, filePath);\r\n    return ds;\r\n}\r\n\r\nvoid DeleteDisplayState(DisplayState *ds)\r\n{\r\n    delete ds->thumbnail;\r\n    FreeStruct(&gFileStateInfo, ds);\r\n}\r\n\r\nFavorite *NewFavorite(int pageNo, const WCHAR *name, const WCHAR *pageLabel)\r\n{\r\n    Favorite *fav = (Favorite *)DeserializeStruct(&gFavoriteInfo, nullptr);\r\n    fav->pageNo = pageNo;\r\n    fav->name = str::Dup(name);\r\n    fav->pageLabel = str::Dup(pageLabel);\r\n    return fav;\r\n}\r\n\r\nvoid DeleteFavorite(Favorite *fav)\r\n{\r\n    FreeStruct(&gFavoriteInfo, fav);\r\n}\r\n\r\nGlobalPrefs *NewGlobalPrefs(const char *data)\r\n{\r\n    return (GlobalPrefs *)DeserializeStruct(&gGlobalPrefsInfo, data);\r\n}\r\n\r\nchar *SerializeGlobalPrefs(GlobalPrefs *gp, const char *prevData, size_t *sizeOut)\r\n{\r\n    if (!gp->rememberStatePerDocument || !gp->rememberOpenedFiles) {\r\n        for (DisplayState *ds : *gp->fileStates) {\r\n            ds->useDefaultState = true;\r\n        }\r\n        // prevent unnecessary settings from being written out\r\n        uint16_t fieldCount = 0;\r\n        while (++fieldCount <= dimof(gFileStateFields)) {\r\n            // count the number of fields up to and including useDefaultState\r\n            if (gFileStateFields[fieldCount - 1].offset == offsetof(FileState, useDefaultState))\r\n                break;\r\n        }\r\n        // restore the correct fieldCount ASAP after serialization\r\n        gFileStateInfo.fieldCount = fieldCount;\r\n    }\r\n\r\n    char *serialized = SerializeStruct(&gGlobalPrefsInfo, gp, prevData, sizeOut);\r\n\r\n    if (!gp->rememberStatePerDocument || !gp->rememberOpenedFiles)\r\n        gFileStateInfo.fieldCount = dimof(gFileStateFields);\r\n\r\n    return serialized;\r\n}\r\n\r\nvoid DeleteGlobalPrefs(GlobalPrefs *gp)\r\n{\r\n    if (!gp)\r\n      return;\r\n\r\n    for (DisplayState *ds : *gp->fileStates) {\r\n        delete ds->thumbnail;\r\n    }\r\n    FreeStruct(&gGlobalPrefsInfo, gp);\r\n}\r\n\r\nSessionData *NewSessionData()\r\n{\r\n    return (SessionData *)DeserializeStruct(&gSessionDataInfo, nullptr);\r\n}\r\n\r\nTabState *NewTabState(DisplayState *ds)\r\n{\r\n    TabState *state = (TabState *)DeserializeStruct(&gTabStateInfo, nullptr);\r\n    str::ReplacePtr(&state->filePath, ds->filePath);\r\n    str::ReplacePtr(&state->displayMode, ds->displayMode);\r\n    state->pageNo = ds->pageNo;\r\n    str::ReplacePtr(&state->zoom, ds->zoom);\r\n    state->rotation = ds->rotation;\r\n    state->scrollPos = ds->scrollPos;\r\n    state->showToc = ds->showToc;\r\n    *state->tocState = *ds->tocState;\r\n    return state;\r\n}\r\n\r\nvoid ResetSessionState(Vec<SessionData *> *sessionData)\r\n{\r\n    CrashIf(!sessionData);\r\n    for (SessionData *data : *sessionData) {\r\n        FreeStruct(&gSessionDataInfo, data);\r\n    }\r\n    sessionData->Reset();\r\n}\r\n"
  },
  {
    "path": "src/GlobalPrefs.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// TODO: move to SettingsStructs.h\r\n#define ZOOM_FIT_PAGE       -1.f\r\n#define ZOOM_FIT_WIDTH      -2.f\r\n#define ZOOM_FIT_CONTENT    -3.f\r\n#define ZOOM_ACTUAL_SIZE    100.0f\r\n#define ZOOM_MAX            6400.f /* max zoom in % */\r\n#define ZOOM_MIN            8.33f  /* min zoom in % */\r\n#define INVALID_ZOOM        -99.0f\r\n\r\nextern GlobalPrefs *gGlobalPrefs;\r\n\r\nDisplayState *NewDisplayState(const WCHAR *filePath);\r\nvoid DeleteDisplayState(DisplayState *ds);\r\n\r\nFavorite *NewFavorite(int pageNo, const WCHAR *name, const WCHAR *pageLabel);\r\nvoid DeleteFavorite(Favorite *fav);\r\n\r\nGlobalPrefs *NewGlobalPrefs(const char *data);\r\nchar *SerializeGlobalPrefs(GlobalPrefs *gp, const char *prevData, size_t *sizeOut);\r\nvoid DeleteGlobalPrefs(GlobalPrefs *gp);\r\n\r\nSessionData *NewSessionData();\r\nTabState *NewTabState(DisplayState *ds);\r\nvoid ResetSessionState(Vec<SessionData *> *sessionData);\r\n\r\n// TODO: those are actually defined in SettingsStructs.cpp\r\nnamespace prefs {\r\nnamespace conv {\r\n\r\nconst WCHAR *   FromDisplayMode(DisplayMode mode);\r\nDisplayMode     ToDisplayMode(const WCHAR *s, DisplayMode defVal);\r\nvoid            FromZoom(char **dst, float zoom, DisplayState *stateForIssue2140=nullptr);\r\nfloat           ToZoom(const char *s, float defVal);\r\n\r\n};\r\n};\r\n\r\n// convenience helpers\r\ninline bool IsSingle(DisplayMode mode) {\r\n    return DM_SINGLE_PAGE == mode || DM_CONTINUOUS == mode;\r\n}\r\ninline bool IsContinuous(DisplayMode mode) {\r\n    return DM_CONTINUOUS == mode || DM_CONTINUOUS_FACING == mode || DM_CONTINUOUS_BOOK_VIEW == mode;\r\n}\r\ninline bool IsFacing(DisplayMode mode) {\r\n    return DM_FACING == mode || DM_CONTINUOUS_FACING == mode;\r\n}\r\ninline bool IsBookView(DisplayMode mode) {\r\n    return DM_BOOK_VIEW == mode || DM_CONTINUOUS_BOOK_VIEW == mode;\r\n}\r\n\r\ninline bool IsValidZoom(float zoomLevel) {\r\n    return (ZOOM_MIN - 0.01f <= zoomLevel && zoomLevel <= ZOOM_MAX + 0.01f) ||\r\n           ZOOM_FIT_PAGE == zoomLevel || ZOOM_FIT_WIDTH == zoomLevel || ZOOM_FIT_CONTENT == zoomLevel;\r\n}\r\n"
  },
  {
    "path": "src/HtmlFormatter.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"GdiPlusUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"CssParser.h\"\r\n#include \"HtmlPullParser.h\"\r\n#include \"Mui.h\"\r\n#include \"Timer.h\"\r\n// rendering engines\r\n#include \"EbookBase.h\"\r\n#include \"HtmlFormatter.h\"\r\n#define NOLOG 1\r\n#include \"DebugLog.h\"\r\n\r\n/*\r\nGiven size of a page, we format html into a set of pages. We handle only a small\r\nsubset of html commonly present in ebooks.\r\n\r\nFormatting is a delayed affair, divided into 2 stages.\r\n\r\n1. We gather elements and their sizes for the current line. When we detect that\r\nadding another element would overflow current line, we position elements in\r\ncurrent line (stage 2) and start a new line. When we detect that adding a new\r\nline would overflow current page, we start a new page.\r\n\r\n2. When we position elements in current line, we calculate their x/y positions.\r\n\r\nDelaying this calculation until we have all elements of the line is necessary\r\nto implement e.g. justification. It's also simpler to have formatting logic in\r\n2 simpler phases than a single, more complicated step. We still need to make sure\r\nthat both stages use the same logic for determining line/page overflow, otherwise\r\nelements will be drawn outside page bounds. This shouldn't be hard because only\r\nstage 1 calculates the sizes of elements.\r\n*/\r\n\r\n/*\r\nTODO: Instead of inserting explicit SetFont, StartLink, etc. instructions\r\nat the beginning of every page, DrawHtmlPage could always start with\r\nthat page's nextPageStyle.font, etc.\r\nThe information that we need to remember:\r\n* font name (if different from default font name, nullptr otherwise)\r\n* font size scale i.e. 1.f means \"default font size\". This is to allow the user to change\r\n  default font size and allow us to relayout from arbitrary page\r\n* font style (bold/italic etc.)\r\n* a link url if we're carrying over a text for a link (nullptr if no link)\r\n* text color (when/if we support changing text color)\r\n* more ?\r\n\r\nTODO: fix http://code.google.com/p/sumatrapdf/issues/detail?id=2183\r\n\r\nTODO: HtmlFormatter could be split into DrawInstrBuilder which knows pageDx, pageDy\r\nand generates DrawInstr and splits them into pages and a better named class that\r\ndoes the parsing of the document builds pages by invoking methods on DrawInstrBuilders.\r\n\r\nTODO: support <figure> and <figcaption> as e.g in http://ebookarchitects.com/files/BookOfTexas.mobi\r\n\r\nTODO: instead of generating list of DrawInstr objects, we could add neccessary\r\nsupport to mui and use list of Control objects instead (especially if we slim down\r\nControl objects further to make allocating hundreds of them cheaper or introduce some\r\nother base element(s) with less functionality and less overhead).\r\n*/\r\n\r\nbool ValidReparseIdx(ptrdiff_t idx, HtmlPullParser *parser)\r\n{\r\n    if ((idx < 0) || (idx > (int)parser->Len()))\r\n        return false;\r\n    return true;\r\n}\r\n\r\nDrawInstr DrawInstr::Str(const char *s, size_t len, RectF bbox, bool rtl)\r\n{\r\n    DrawInstr di(rtl ? InstrRtlString : InstrString, bbox);\r\n    di.str.s = s;\r\n    di.str.len = len;\r\n    return di;\r\n}\r\n\r\nDrawInstr DrawInstr::SetFont(mui::CachedFont *font)\r\n{\r\n    DrawInstr di(InstrSetFont);\r\n    di.font = font;\r\n    return di;\r\n}\r\n\r\nDrawInstr DrawInstr::FixedSpace(float dx)\r\n{\r\n    DrawInstr di(InstrFixedSpace);\r\n    di.bbox.Width = dx;\r\n    return di;\r\n}\r\n\r\nDrawInstr DrawInstr::Image(char *data, size_t len, RectF bbox)\r\n{\r\n    DrawInstr di(InstrImage);\r\n    di.img.data = data;\r\n    di.img.len = len;\r\n    di.bbox = bbox;\r\n    return di;\r\n}\r\n\r\nDrawInstr DrawInstr::LinkStart(const char *s, size_t len)\r\n{\r\n    DrawInstr di(InstrLinkStart);\r\n    di.str.s = s;\r\n    di.str.len = len;\r\n    return di;\r\n}\r\n\r\nDrawInstr DrawInstr::Anchor(const char *s, size_t len, RectF bbox)\r\n{\r\n    DrawInstr di(InstrAnchor);\r\n    di.str.s = s;\r\n    di.str.len = len;\r\n    di.bbox = bbox;\r\n    return di;\r\n}\r\n\r\nStyleRule::StyleRule() : tag(Tag_NotFound), textIndentUnit(inherit), textAlign(Align_NotFound) { }\r\n\r\n// parses size in the form \"1em\", \"3pt\" or \"15px\"\r\nstatic void ParseSizeWithUnit(const char *s, size_t len, float *size, StyleRule::Unit *unit)\r\n{\r\n    if (str::Parse(s, len, \"%fem\", size)) {\r\n        *unit = StyleRule::em;\r\n    } else if (str::Parse(s, len, \"%fin\", size)) {\r\n        *unit = StyleRule::pt;\r\n        *size *= 72; // 1 inch is 72 points\r\n    } else if (str::Parse(s, len, \"%fpt\", size)) {\r\n        *unit = StyleRule::pt;\r\n    } else if (str::Parse(s, len, \"%fpx\", size)) {\r\n        *unit = StyleRule::px;\r\n    } else {\r\n        *unit = StyleRule::inherit;\r\n    }\r\n}\r\n\r\nStyleRule StyleRule::Parse(CssPullParser *parser)\r\n{\r\n    StyleRule rule;\r\n    const CssProperty *prop;\r\n    while ((prop = parser->NextProperty()) != nullptr) {\r\n        switch (prop->type) {\r\n        case Css_Text_Align:\r\n            rule.textAlign = FindAlignAttr(prop->s, prop->sLen);\r\n            break;\r\n        // TODO: some documents use Css_Padding_Left for indentation\r\n        case Css_Text_Indent:\r\n            ParseSizeWithUnit(prop->s, prop->sLen, &rule.textIndent, &rule.textIndentUnit);\r\n            break;\r\n        }\r\n    }\r\n    return rule;\r\n}\r\n\r\nStyleRule StyleRule::Parse(const char *s, size_t len)\r\n{\r\n    CssPullParser parser(s, len);\r\n    return Parse(&parser);\r\n}\r\n\r\nvoid StyleRule::Merge(StyleRule& source)\r\n{\r\n    if (source.textAlign != Align_NotFound)\r\n        textAlign = source.textAlign;\r\n    if (source.textIndentUnit != StyleRule::inherit) {\r\n        textIndent = source.textIndent;\r\n        textIndentUnit = source.textIndentUnit;\r\n    }\r\n}\r\n\r\nHtmlFormatterArgs::HtmlFormatterArgs() :\r\n    pageDx(0), pageDy(0), fontSize(0),\r\n    textAllocator(nullptr), htmlStr(0), htmlStrLen(0),\r\n    reparseIdx(0), textRenderMethod(mui::TextRenderMethodGdiplus)\r\n{\r\n}\r\n\r\nHtmlFormatter::HtmlFormatter(HtmlFormatterArgs *args) :\r\n    pageDx(args->pageDx), pageDy(args->pageDy),\r\n    textAllocator(args->textAllocator), currLineReparseIdx(0),\r\n    currX(0), currY(0), currLineTopPadding(0), currLinkIdx(0),\r\n    listDepth(0), preFormatted(false), dirRtl(false), currPage(nullptr),\r\n    finishedParsing(false), pageCount(0),\r\n    keepTagNesting(false)\r\n{\r\n    currReparseIdx = args->reparseIdx;\r\n    htmlParser = new HtmlPullParser(args->htmlStr, args->htmlStrLen);\r\n    htmlParser->SetCurrPosOff(currReparseIdx);\r\n    CrashIf(!ValidReparseIdx(currReparseIdx, htmlParser));\r\n\r\n    gfx = mui::AllocGraphicsForMeasureText();\r\n    textMeasure = CreateTextRender(args->textRenderMethod, gfx, 10, 10);\r\n    defaultFontName.Set(str::Dup(args->GetFontName()));\r\n    defaultFontSize = args->fontSize;\r\n\r\n    DrawStyle style;\r\n    style.font = mui::GetCachedFont(defaultFontName, defaultFontSize, FontStyleRegular);\r\n    style.align = Align_Justify;\r\n    style.dirRtl = false;\r\n    styleStack.Append(style);\r\n    nextPageStyle = styleStack.Last();\r\n\r\n    textMeasure->SetFont(CurrFont());\r\n\r\n    lineSpacing = textMeasure->GetCurrFontLineSpacing();\r\n    spaceDx = CurrFont()->GetSize() / 2.5f; // note: a heuristic\r\n    float spaceDx2 = GetSpaceDx(textMeasure);\r\n    if (spaceDx2 < spaceDx)\r\n        spaceDx = spaceDx2;\r\n\r\n    EmitNewPage();\r\n}\r\n\r\nHtmlFormatter::~HtmlFormatter()\r\n{\r\n    // delete all pages that were not consumed by the caller\r\n    DeleteVecMembers(pagesToSend);\r\n    delete currPage;\r\n    delete textMeasure;\r\n    mui::FreeGraphicsForMeasureText(gfx);\r\n    delete htmlParser;\r\n}\r\n\r\nvoid HtmlFormatter::AppendInstr(DrawInstr di)\r\n{\r\n    currLineInstr.Append(di);\r\n    if (-1 == currLineReparseIdx) {\r\n        currLineReparseIdx = currReparseIdx;\r\n        CrashIf(!ValidReparseIdx(currReparseIdx, htmlParser));\r\n    }\r\n}\r\n\r\nvoid HtmlFormatter::SetFont(const WCHAR *fontName, FontStyle fs, float fontSize)\r\n{\r\n    if (fontSize < 0) {\r\n        fontSize = CurrFont()->GetSize();\r\n    }\r\n    mui::CachedFont *newFont = mui::GetCachedFont(fontName, fontSize, fs);\r\n    if (CurrFont() != newFont) {\r\n        AppendInstr(DrawInstr::SetFont(newFont));\r\n    }\r\n\r\n    DrawStyle style = styleStack.Last();\r\n    style.font = newFont;\r\n    styleStack.Append(style);\r\n}\r\n\r\nvoid HtmlFormatter::SetFontBasedOn(mui::CachedFont *font, FontStyle fs, float fontSize)\r\n{\r\n    const WCHAR *fontName = font->GetName();\r\n    if (nullptr == fontName)\r\n        fontName = defaultFontName;\r\n    SetFont(fontName, fs, fontSize);\r\n}\r\n\r\nbool ValidStyleForChangeFontStyle(FontStyle fs)\r\n{\r\n    if ((FontStyleBold == fs) ||\r\n        (FontStyleItalic == fs) ||\r\n        (FontStyleUnderline == fs) ||\r\n        (FontStyleStrikeout == fs)) {\r\n            return true;\r\n    }\r\n    return false;\r\n}\r\n\r\n// change the current font by adding (if addStyle is true) or removing\r\n// a given font style from current font style\r\n// TODO: it doesn't corrctly support the case where a style is wrongly nested\r\n// like \"<b>fo<i>oo</b>bar</i>\" - \"bar\" should be italic but will be bold\r\nvoid HtmlFormatter::ChangeFontStyle(FontStyle fs, bool addStyle)\r\n{\r\n    CrashIf(!ValidStyleForChangeFontStyle(fs));\r\n    if (addStyle)\r\n        SetFontBasedOn(CurrFont(), (FontStyle)(fs | CurrFont()->GetStyle()));\r\n    else\r\n        RevertStyleChange();\r\n}\r\n\r\nvoid HtmlFormatter::SetAlignment(AlignAttr align)\r\n{\r\n    DrawStyle style = styleStack.Last();\r\n    style.align = align;\r\n    styleStack.Append(style);\r\n}\r\n\r\nvoid HtmlFormatter::RevertStyleChange()\r\n{\r\n    if (styleStack.Count() > 1) {\r\n        DrawStyle style = styleStack.Pop();\r\n        if (style.font != CurrFont())\r\n            AppendInstr(DrawInstr::SetFont(CurrFont()));\r\n        dirRtl = style.dirRtl;\r\n    }\r\n}\r\n\r\nstatic bool IsVisibleDrawInstr(DrawInstr& i)\r\n{\r\n    switch (i.type) {\r\n        case InstrString: case InstrRtlString:\r\n        case InstrLine:\r\n        case InstrImage:\r\n            return true;\r\n    }\r\n    return false;\r\n}\r\n\r\n// sum of widths of all elements with a fixed size and flexible\r\n// spaces (using minimum value for its width)\r\nREAL HtmlFormatter::CurrLineDx()\r\n{\r\n    REAL dx = NewLineX();\r\n    for (DrawInstr& i : currLineInstr) {\r\n        if (InstrString == i.type || InstrRtlString == i.type) {\r\n            dx += i.bbox.Width;\r\n        } else if (InstrImage == i.type) {\r\n            dx += i.bbox.Width;\r\n        } else if (InstrElasticSpace == i.type) {\r\n            dx += spaceDx;\r\n        } else if (InstrFixedSpace == i.type) {\r\n            dx += i.bbox.Width;\r\n        }\r\n    }\r\n    return dx;\r\n}\r\n\r\n// return the height of the tallest element on the line\r\nfloat HtmlFormatter::CurrLineDy()\r\n{\r\n    float dy = lineSpacing;\r\n    for (DrawInstr& i : currLineInstr) {\r\n        if (IsVisibleDrawInstr(i)) {\r\n            if (i.bbox.Height > dy)\r\n                dy = i.bbox.Height;\r\n        }\r\n    }\r\n    return dy;\r\n}\r\n\r\n// return the width of the left margin (used for paragraph\r\n// indentation inside lists)\r\nfloat HtmlFormatter::NewLineX()\r\n{\r\n    // TODO: indent based on font size instead?\r\n    float x = 15.f * listDepth;\r\n    if (x < pageDx - 20.f)\r\n        return x;\r\n    if (pageDx < 20.f)\r\n        return 0.f;\r\n    return pageDx - 20.f;\r\n}\r\n\r\n// When this is called, Width and Height of each element is already set\r\n// We set position x of each visible element\r\nvoid HtmlFormatter::LayoutLeftStartingAt(REAL offX)\r\n{\r\n    DrawInstr *lastInstr = nullptr;\r\n    int instrCount = 0;\r\n\r\n    REAL x = offX + NewLineX();\r\n    for (DrawInstr& i : currLineInstr) {\r\n        if (InstrString == i.type || InstrRtlString == i.type || InstrImage == i.type) {\r\n            i.bbox.X = x;\r\n            x += i.bbox.Width;\r\n            lastInstr = &i;\r\n            instrCount++;\r\n        } else if (InstrElasticSpace == i.type) {\r\n            x += spaceDx;\r\n        } else if (InstrFixedSpace == i.type) {\r\n            x += i.bbox.Width;\r\n        }\r\n    }\r\n\r\n    // center a single image\r\n    if (instrCount == 1 && InstrImage == lastInstr->type)\r\n        lastInstr->bbox.X = (pageDx - lastInstr->bbox.Width) / 2.f;\r\n}\r\n\r\n// TODO: if elements are of different sizes (e.g. texts using different fonts)\r\n// we should align them according to the baseline (which we would first need to\r\n// record for each element)\r\nstatic void SetYPos(Vec<DrawInstr>& instr, float y)\r\n{\r\n    for (DrawInstr& i : instr) {\r\n        if (IsVisibleDrawInstr(i))\r\n            i.bbox.Y = y;\r\n    }\r\n}\r\n\r\nvoid HtmlFormatter::DumpLineDebugInfo()\r\n{\r\n    // TODO: write me\r\n    // like CurrLineDx() but dumps info about draw instructions to dbg out\r\n}\r\n\r\n// Redistribute extra space in the line equally among the spaces\r\nvoid HtmlFormatter::JustifyLineBoth()\r\n{\r\n    REAL extraSpaceDxTotal = pageDx - currX;\r\n#ifdef DEBUG\r\n    if (extraSpaceDxTotal < 0.f)\r\n        DumpLineDebugInfo();\r\n#endif\r\n    CrashIf(extraSpaceDxTotal < 0.f);\r\n\r\n    LayoutLeftStartingAt(0.f);\r\n    size_t spaces = 0;\r\n    bool endsWithSpace = false;\r\n    for (DrawInstr& i : currLineInstr) {\r\n        if (InstrElasticSpace == i.type) {\r\n            ++spaces;\r\n            endsWithSpace = true;\r\n        }\r\n        else if (InstrString == i.type || InstrRtlString == i.type)\r\n            endsWithSpace = false;\r\n        else if (InstrImage == i.type)\r\n            endsWithSpace = false;\r\n    }\r\n    // don't take a space at the end of the line into account\r\n    // (the last word is explicitly right-aligned below)\r\n    if (endsWithSpace)\r\n        spaces--;\r\n    if (0 == spaces)\r\n        return;\r\n    // redistribute extra dx space among elastic spaces\r\n    REAL extraSpaceDx = extraSpaceDxTotal / (float)spaces;\r\n    float offX = 0.f;\r\n    DrawInstr *lastStr = nullptr;\r\n    for (DrawInstr& i : currLineInstr) {\r\n        if (InstrElasticSpace == i.type)\r\n            offX += extraSpaceDx;\r\n        else if (InstrString == i.type || InstrRtlString == i.type || InstrImage == i.type) {\r\n            i.bbox.X += offX;\r\n            lastStr = &i;\r\n        }\r\n    }\r\n    // align the last element perfectly against the right edge in case\r\n    // we've accumulated rounding errors\r\n    if (lastStr)\r\n        lastStr->bbox.X = pageDx - lastStr->bbox.Width;\r\n}\r\n\r\nbool HtmlFormatter::IsCurrLineEmpty()\r\n{\r\n    for (DrawInstr& i : currLineInstr) {\r\n        if (IsVisibleDrawInstr(i))\r\n            return false;\r\n    }\r\n    return true;\r\n}\r\n\r\nvoid HtmlFormatter::JustifyCurrLine(AlignAttr align)\r\n{\r\n    // TODO: is CurrLineDx needed at all?\r\n    CrashIf(currX != CurrLineDx());\r\n\r\n    switch (align) {\r\n        case Align_Left:\r\n            LayoutLeftStartingAt(0.f);\r\n            break;\r\n        case Align_Right:\r\n            LayoutLeftStartingAt(pageDx - currX);\r\n            break;\r\n        case Align_Center:\r\n            LayoutLeftStartingAt((pageDx - currX) / 2.f);\r\n            break;\r\n        case Align_Justify:\r\n            JustifyLineBoth();\r\n            break;\r\n        default:\r\n            CrashIf(true);\r\n            break;\r\n    }\r\n\r\n    // when the reading direction is right-to-left, mirror the entire page\r\n    // so that the first element on a line is the right-most, etc.\r\n    if (dirRtl) {\r\n        for (DrawInstr& i : currLineInstr) {\r\n            if (IsVisibleDrawInstr(i))\r\n                i.bbox.X = pageDx - i.bbox.X - i.bbox.Width;\r\n        }\r\n    }\r\n}\r\n\r\nstatic RectF RectFUnion(RectF& r1, RectF& r2)\r\n{\r\n    if (r2.IsEmptyArea())\r\n        return r1;\r\n    if (r1.IsEmptyArea())\r\n        return r2;\r\n    RectF ru;\r\n    ru.Union(ru, r1, r2);\r\n    return ru;\r\n}\r\n\r\nvoid HtmlFormatter::UpdateLinkBboxes(HtmlPage *page)\r\n{\r\n    for (DrawInstr& i : page->instructions) {\r\n        if (InstrLinkStart != i.type)\r\n            continue;\r\n        for (DrawInstr *i2 = &i + 1; i2->type != InstrLinkEnd; i2++) {\r\n            if (IsVisibleDrawInstr(*i2))\r\n                i.bbox = RectFUnion(i.bbox, i2->bbox);\r\n        }\r\n    }\r\n}\r\n\r\nvoid HtmlFormatter::ForceNewPage()\r\n{\r\n    bool createdNewPage = FlushCurrLine(true);\r\n    if (createdNewPage)\r\n        return;\r\n    UpdateLinkBboxes(currPage);\r\n    pagesToSend.Append(currPage);\r\n\r\n    EmitNewPage();\r\n    currX = NewLineX();\r\n    currLineTopPadding = 0.f;\r\n}\r\n\r\n// returns true if created a new page\r\nbool HtmlFormatter::FlushCurrLine(bool isParagraphBreak)\r\n{\r\n    if (IsCurrLineEmpty()) {\r\n        currX = NewLineX();\r\n        currLineTopPadding = 0;\r\n        // remove all spaces (only keep SetFont, LinkStart and Anchor instructions)\r\n        for (size_t k = currLineInstr.Count(); k > 0; k--) {\r\n            DrawInstr& i = currLineInstr.At(k - 1);\r\n            if (InstrFixedSpace == i.type || InstrElasticSpace == i.type)\r\n                currLineInstr.RemoveAt(k - 1);\r\n        }\r\n        return false;\r\n    }\r\n    AlignAttr align = CurrStyle()->align;\r\n    if (isParagraphBreak && (Align_Justify == align))\r\n        align = Align_Left;\r\n    JustifyCurrLine(align);\r\n\r\n    // create a new page if necessary\r\n    float totalLineDy = CurrLineDy() + currLineTopPadding;\r\n    bool createdPage = false;\r\n    if (currY + totalLineDy > pageDy) {\r\n        // current line too big to fit in current page,\r\n        // so need to start another page\r\n        UpdateLinkBboxes(currPage);\r\n        pagesToSend.Append(currPage);\r\n        // instructions for each page need to be self-contained\r\n        // so we have to carry over some state (like current font)\r\n        CrashIf(!CurrFont());\r\n        EmitNewPage();\r\n        CrashIf(currLineReparseIdx > INT_MAX);\r\n        currPage->reparseIdx = (int)currLineReparseIdx;\r\n        createdPage = true;\r\n    }\r\n    SetYPos(currLineInstr, currY + currLineTopPadding);\r\n\tcurrY += totalLineDy;\r\n\t//{{add by jjg\r\n\tconst float LINE_HEIGHT = 0.618f; //把行间距调大一些\r\n\tcurrY += LINE_HEIGHT * CurrLineDy();\r\n\t//}}\r\n\r\n    DrawInstr link;\r\n    if (currLinkIdx) {\r\n        link = currLineInstr.At(currLinkIdx - 1);\r\n        // TODO: this occasionally leads to empty links\r\n        AppendInstr(DrawInstr(InstrLinkEnd));\r\n    }\r\n    currPage->instructions.Append(currLineInstr.LendData(), currLineInstr.Count());\r\n    currLineInstr.Reset();\r\n    currLineReparseIdx = -1; // mark as not set\r\n    currLineTopPadding = 0;\r\n    currX = NewLineX();\r\n    if (currLinkIdx) {\r\n        AppendInstr(DrawInstr::LinkStart(link.str.s, link.str.len));\r\n        currLinkIdx = currLineInstr.Count();\r\n    }\r\n    nextPageStyle = styleStack.Last();\r\n    return createdPage;\r\n}\r\n\r\nvoid HtmlFormatter::EmitNewPage()\r\n{\r\n    CrashIf(currReparseIdx > INT_MAX);\r\n    currPage = new HtmlPage((int)currReparseIdx);\r\n    currPage->instructions.Append(DrawInstr::SetFont(nextPageStyle.font));\r\n    currY = 0.f;\r\n}\r\n\r\nvoid HtmlFormatter::EmitEmptyLine(float lineDy)\r\n{\r\n    CrashIf(!IsCurrLineEmpty());\r\n    currY += lineDy;\r\n    if (currY <= pageDy) {\r\n        currX = NewLineX();\r\n        // remove all spaces (only keep SetFont, LinkStart and Anchor instructions)\r\n        for (size_t k = currLineInstr.Count(); k > 0; k--) {\r\n            DrawInstr& i = currLineInstr.At(k - 1);\r\n            if (InstrFixedSpace == i.type || InstrElasticSpace == i.type)\r\n                currLineInstr.RemoveAt(k - 1);\r\n\r\n        }\r\n        return;\r\n    }\r\n    ForceNewPage();\r\n}\r\n\r\nstatic bool HasPreviousLineSingleImage(Vec<DrawInstr>& instrs)\r\n{\r\n    REAL imageY = -1;\r\n    for (size_t idx = instrs.Count(); idx > 0; idx--) {\r\n        DrawInstr& i = instrs.At(idx - 1);\r\n        if (!IsVisibleDrawInstr(i))\r\n            continue;\r\n        if (-1 != imageY) {\r\n            // if another visible item precedes the image,\r\n            // it must be completely above it (previous line)\r\n            return i.bbox.Y + i.bbox.Height <= imageY;\r\n        }\r\n        if (InstrImage != i.type)\r\n            return false;\r\n        imageY = i.bbox.Y;\r\n    }\r\n    return imageY != -1;\r\n}\r\n\r\nbool HtmlFormatter::EmitImage(ImageData *img)\r\n{\r\n    CrashIf(!img->data);\r\n    Size imgSize = BitmapSizeFromData(img->data, img->len);\r\n    if (imgSize.Empty())\r\n        return false;\r\n\r\n    SizeF newSize((REAL)imgSize.Width, (REAL)imgSize.Height);\r\n    // move overly large images to a new line (if they don't fit entirely)\r\n    if (!IsCurrLineEmpty() && (currX + newSize.Width > pageDx || currY + newSize.Height > pageDy))\r\n        FlushCurrLine(false);\r\n    // move overly large images to a new page\r\n    // (if they don't fit even when scaled down to 75%)\r\n    REAL scalePage = std::min((pageDx - currX) / newSize.Width, pageDy / newSize.Height);\r\n    if (currY > 0 && currY + newSize.Height * std::min(scalePage, 0.75f) > pageDy)\r\n        ForceNewPage();\r\n    // if image is bigger than the available space, scale it down\r\n    if (newSize.Width > pageDx - currX || newSize.Height > pageDy - currY) {\r\n        REAL scale = std::min(scalePage, (pageDy - currY) / newSize.Height);\r\n        // scale down images that follow right after a line\r\n        // containing a single image as little as possible,\r\n        // as they might be intended to be of the same size\r\n        if (scale < scalePage && HasPreviousLineSingleImage(currPage->instructions)) {\r\n            ForceNewPage();\r\n            scale = scalePage;\r\n        }\r\n        if (scale < 1) {\r\n            newSize.Width = std::min(newSize.Width * scale, pageDx - currX);\r\n            newSize.Height = std::min(newSize.Height * scale, pageDy - currY);\r\n        }\r\n    }\r\n\r\n    RectF bbox(PointF(currX, 0), newSize);\r\n    AppendInstr(DrawInstr::Image(img->data, img->len, bbox));\r\n    currX += bbox.Width;\r\n\r\n    return true;\r\n}\r\n\r\n// add horizontal line (<hr> in html terms)\r\nvoid HtmlFormatter::EmitHr()\r\n{\r\n    // hr creates an implicit paragraph break\r\n    FlushCurrLine(true);\r\n    CrashIf(NewLineX() != currX);\r\n    RectF bbox(0.f, 0.f, pageDx, lineSpacing);\r\n    AppendInstr(DrawInstr(InstrLine, bbox));\r\n    FlushCurrLine(true);\r\n}\r\n\r\nvoid HtmlFormatter::EmitParagraph(float indent)\r\n{\r\n    FlushCurrLine(true);\r\n    CrashIf(NewLineX() != currX);\r\n    bool needsIndent = Align_Left == CurrStyle()->align ||\r\n                       Align_Justify == CurrStyle()->align;\r\n    if (indent > 0 && needsIndent && EnsureDx(indent)) {\r\n        AppendInstr(DrawInstr::FixedSpace(indent));\r\n        currX += indent;\r\n    }\r\n}\r\n\r\n// ensure there is enough dx space left in the current line\r\n// if there isn't, we start a new line\r\n// returns false if dx is bigger than pageDx\r\nbool HtmlFormatter::EnsureDx(float dx)\r\n{\r\n    if (currX + dx <= pageDx)\r\n        return true;\r\n    FlushCurrLine(false);\r\n    return dx <= pageDx;\r\n}\r\n\r\n// don't emit multiple spaces and don't emit spaces\r\n// at the beginning of the line\r\nstatic bool CanEmitElasticSpace(float currX, float NewLineX, float maxCurrX, Vec<DrawInstr>& currLineInstr)\r\n{\r\n    if (NewLineX == currX || 0 == currLineInstr.Count())\r\n        return false;\r\n    // prevent elastic spaces from being flushed to the\r\n    // beginning of the next line\r\n    if (currX > maxCurrX)\r\n        return false;\r\n    DrawInstr& di = currLineInstr.Last();\r\n    // don't add a space if only an anchor would be in between them\r\n    if (InstrAnchor == di.type && currLineInstr.Count() > 1)\r\n        di = currLineInstr.At(currLineInstr.Count() - 2);\r\n    return (InstrElasticSpace != di.type) && (InstrFixedSpace != di.type);\r\n}\r\n\r\nvoid HtmlFormatter::EmitElasticSpace()\r\n{\r\n    if (!CanEmitElasticSpace(currX, NewLineX(), pageDx - spaceDx, currLineInstr))\r\n        return;\r\n    EnsureDx(spaceDx);\r\n    currX += spaceDx;\r\n    AppendInstr(DrawInstr(InstrElasticSpace));\r\n}\r\n\r\n// a text run is a string of consecutive text with uniform style\r\nvoid HtmlFormatter::EmitTextRun(const char *s, const char *end)\r\n{\r\n    currReparseIdx = s - htmlParser->Start();\r\n    CrashIf(!ValidReparseIdx(currReparseIdx, htmlParser));\r\n    CrashIf(IsSpaceOnly(s, end) && !preFormatted);\r\n    const char *tmp = ResolveHtmlEntities(s, end, textAllocator);\r\n    bool resolved = tmp != s;\r\n    if (resolved) {\r\n        s = tmp;\r\n        end = s + str::Len(s);\r\n    }\r\n\r\n    while (s < end) {\r\n        // don't update the reparseIdx if s doesn't point into the original source\r\n        if (!resolved)\r\n            currReparseIdx = s - htmlParser->Start();\r\n\r\n        size_t strLen = str::Utf8ToWcharBuf(s, end - s, buf, dimof(buf));\r\n        // soft hyphens should not be displayed\r\n        strLen -= str::RemoveChars(buf, L\"\\xad\");\r\n        if (0 == strLen)\r\n            break;\r\n        textMeasure->SetFont(CurrFont());\r\n        RectF bbox = textMeasure->Measure(buf, strLen);\r\n        EnsureDx(bbox.Width);\r\n        if (bbox.Width <= pageDx - currX) {\r\n            AppendInstr(DrawInstr::Str(s, end - s, bbox, dirRtl));\r\n            currX += bbox.Width;\r\n            break;\r\n        }\r\n\r\n        size_t lenThatFits = StringLenForWidth(textMeasure, buf, strLen, pageDx - NewLineX());\r\n\r\n        //jjg 注释掉这块,解决中文标点导致的不正常换行问题\r\n        // try to prevent a break in the middle of a word\r\n        //if (iswalnum(buf[lenThatFits])) {\r\n        //    for (size_t len = lenThatFits; len > 0; len--) {\r\n        //        if (!iswalnum(buf[len-1])) {\r\n        //            lenThatFits = len;\r\n        //            break;\r\n        //        }\r\n        //    }\r\n        //}\r\n\r\n        textMeasure->SetFont(CurrFont());\r\n        bbox = textMeasure->Measure(buf, lenThatFits);\r\n        CrashIf(bbox.Width > pageDx);\r\n        // s is UTF-8 and buf is UTF-16, so one\r\n        // WCHAR doesn't always equal one char\r\n        // TODO: this usually fails for non-BMP characters (i.e. hardly ever)\r\n        for (size_t i = lenThatFits; i > 0; i--) {\r\n            lenThatFits += buf[i-1] < 0x80 ? 0 : buf[i-1] < 0x800 ? 1 : 2;\r\n        }\r\n        AppendInstr(DrawInstr::Str(s, lenThatFits, bbox, dirRtl));\r\n        currX += bbox.Width;\r\n        s += lenThatFits;\r\n    }\r\n}\r\n\r\nvoid HtmlFormatter::HandleAnchorAttr(HtmlToken *t, bool idsOnly)\r\n{\r\n    if (t->IsEndTag())\r\n        return;\r\n\r\n    AttrInfo *attr = t->GetAttrByName(\"id\");\r\n    if (!attr && !idsOnly && Tag_A == t->tag)\r\n        attr = t->GetAttrByName(\"name\");\r\n    if (!attr)\r\n        return;\r\n\r\n    // TODO: make anchors more specific than the top of the current line?\r\n    RectF bbox(0, currY, pageDx, 0);\r\n    // append at the start of the line to prevent the anchor\r\n    // from being flushed to the next page (with wrong currY value)\r\n    currPage->instructions.Append(DrawInstr::Anchor(attr->val, attr->valLen, bbox));\r\n}\r\n\r\nvoid HtmlFormatter::HandleDirAttr(HtmlToken *t)\r\n{\r\n    // only apply reading direction changes to block elements (for now)\r\n    if (t->IsStartTag() && !IsInlineTag(t->tag)) {\r\n        AttrInfo *attr = t->GetAttrByName(\"dir\");\r\n        if (attr)\r\n            dirRtl = CurrStyle()->dirRtl = attr->ValIs(\"RTL\");\r\n    }\r\n}\r\n\r\nvoid HtmlFormatter::HandleTagBr()\r\n{\r\n    // make sure to always emit a line\r\n    if (IsCurrLineEmpty())\r\n        EmitEmptyLine(lineSpacing);\r\n    else\r\n        FlushCurrLine(true);\r\n}\r\n\r\nstatic AlignAttr GetAlignAttr(HtmlToken *t, AlignAttr defVal)\r\n{\r\n    AttrInfo *attr = t->GetAttrByName(\"align\");\r\n    if (!attr)\r\n        return defVal;\r\n    AlignAttr align = FindAlignAttr(attr->val, attr->valLen);\r\n    if (Align_NotFound == align)\r\n        return defVal;\r\n    return align;\r\n}\r\n\r\nvoid HtmlFormatter::HandleTagP(HtmlToken *t, bool isDiv)\r\n{\r\n    if (!t->IsEndTag()) {\r\n        AlignAttr align = CurrStyle()->align;\r\n        float indent = 0;\r\n\r\n        StyleRule rule = ComputeStyleRule(t);\r\n        if (rule.textAlign != Align_NotFound)\r\n            align = rule.textAlign;\r\n        else if (!isDiv) {\r\n            // prefer CSS styling to align attribute\r\n            align = GetAlignAttr(t, align);\r\n        }\r\n        if (rule.textIndentUnit != StyleRule::inherit && rule.textIndent > 0) {\r\n            float factor = rule.textIndentUnit == StyleRule::em ? CurrFont()->GetSize() :\r\n                           rule.textIndentUnit == StyleRule::pt ? 1 /* TODO: take DPI into account */ : 1;\r\n            indent = rule.textIndent * factor;\r\n        }\r\n\r\n        SetAlignment(align);\r\n        EmitParagraph(indent);\r\n    } else {\r\n        FlushCurrLine(true);\r\n        RevertStyleChange();\r\n    }\r\n    EmitEmptyLine(0.4f * CurrFont()->GetSize());\r\n}\r\n\r\nvoid HtmlFormatter::HandleTagFont(HtmlToken *t)\r\n{\r\n    if (t->IsEndTag()) {\r\n        RevertStyleChange();\r\n        return;\r\n    }\r\n\r\n    AttrInfo *attr = t->GetAttrByName(\"face\");\r\n    const WCHAR *faceName = CurrFont()->GetName();\r\n    if (attr) {\r\n        size_t strLen = str::Utf8ToWcharBuf(attr->val, attr->valLen, buf, dimof(buf));\r\n        // multiple font names can be comma separated\r\n        if (strLen > 0 && *buf != ',') {\r\n            str::TransChars(buf, L\",\", L\"\\0\");\r\n            faceName = buf;\r\n        }\r\n    }\r\n\r\n    float fontSize = CurrFont()->GetSize();\r\n    attr = t->GetAttrByName(\"size\");\r\n    if (attr) {\r\n        // the sizes are in the range from 1 (tiny) to 7 (huge)\r\n        int size = 3; // normal size\r\n        str::Parse(attr->val, attr->valLen, \"%d\", &size);\r\n        // sizes can also be relative to the current size\r\n        if (attr->valLen > 0 && ('-' == *attr->val || '+' == *attr->val))\r\n            size += 3;\r\n        size = limitValue(size, 1, 7);\r\n        float scale = pow(1.2f, size - 3);\r\n        fontSize = defaultFontSize * scale;\r\n    }\r\n\r\n    SetFont(faceName, (FontStyle)CurrFont()->GetStyle(), fontSize);\r\n}\r\n\r\nbool HtmlFormatter::HandleTagA(HtmlToken *t, const char *linkAttr, const char *attrNS)\r\n{\r\n    if (t->IsStartTag() && !currLinkIdx) {\r\n        AttrInfo *attr = attrNS ? t->GetAttrByNameNS(linkAttr, attrNS) : t->GetAttrByName(linkAttr);\r\n        if (attr) {\r\n            AppendInstr(DrawInstr::LinkStart(attr->val, attr->valLen));\r\n            currLinkIdx = currLineInstr.Count();\r\n            return true;\r\n        }\r\n    }\r\n    else if (t->IsEndTag() && currLinkIdx) {\r\n        AppendInstr(DrawInstr(InstrLinkEnd));\r\n        currLinkIdx = 0;\r\n        return true;\r\n    }\r\n    return false;\r\n}\r\n\r\ninline bool IsTagH(HtmlTag tag)\r\n{\r\n    switch (tag) {\r\n        case Tag_H1:\r\n        case Tag_H2:\r\n        case Tag_H3:\r\n        case Tag_H4:\r\n        case Tag_H5:\r\n        case Tag_H6:\r\n            return true;\r\n    }\r\n   return false;\r\n }\r\n\r\nvoid HtmlFormatter::HandleTagHx(HtmlToken *t)\r\n{\r\n    if (t->IsEndTag()) {\r\n        FlushCurrLine(true);\r\n        currY += CurrFont()->GetSize() / 2;\r\n        RevertStyleChange();\r\n    }\r\n    else {\r\n        EmitParagraph(0);\r\n        float fontSize = defaultFontSize * pow(1.1f, '5' - t->s[1]);\r\n        if (currY > 0)\r\n            currY += fontSize / 2;\r\n        SetFontBasedOn(CurrFont(), FontStyleBold, fontSize);\r\n\r\n        StyleRule rule = ComputeStyleRule(t);\r\n        if (Align_NotFound == rule.textAlign)\r\n            rule.textAlign = GetAlignAttr(t, Align_Left);\r\n        CurrStyle()->align = rule.textAlign;\r\n    }\r\n}\r\n\r\nvoid HtmlFormatter::HandleTagList(HtmlToken *t)\r\n{\r\n    FlushCurrLine(true);\r\n    if (t->IsStartTag())\r\n        listDepth++;\r\n    else if (t->IsEndTag() && listDepth > 0)\r\n        listDepth--;\r\n    currX = NewLineX();\r\n}\r\n\r\nvoid HtmlFormatter::HandleTagPre(HtmlToken *t)\r\n{\r\n    FlushCurrLine(true);\r\n    if (t->IsStartTag()) {\r\n        SetFont(L\"Courier New\", (FontStyle)CurrFont()->GetStyle());\r\n        CurrStyle()->align = Align_Left;\r\n        preFormatted = true;\r\n    }\r\n    else if (t->IsEndTag()) {\r\n        RevertStyleChange();\r\n        preFormatted = false;\r\n    }\r\n}\r\n\r\nStyleRule *HtmlFormatter::FindStyleRule(HtmlTag tag, const char *clazz, size_t clazzLen)\r\n{\r\n    uint32_t classHash = clazz ? MurmurHash2(clazz, clazzLen) : 0;\r\n    for (size_t i = 0; i < styleRules.Count(); i++) {\r\n        StyleRule& rule = styleRules.At(i);\r\n        if (tag == rule.tag && classHash == rule.classHash)\r\n            return &rule;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nStyleRule HtmlFormatter::ComputeStyleRule(HtmlToken *t)\r\n{\r\n    StyleRule rule;\r\n    // get style rules ordered by specificity\r\n    StyleRule *prevRule = FindStyleRule(Tag_Body, nullptr, 0);\r\n    if (prevRule) rule.Merge(*prevRule);\r\n    prevRule = FindStyleRule(Tag_Any, nullptr, 0);\r\n    if (prevRule) rule.Merge(*prevRule);\r\n    prevRule = FindStyleRule(t->tag, nullptr, 0);\r\n    if (prevRule) rule.Merge(*prevRule);\r\n    // TODO: support multiple class names\r\n    AttrInfo *attr = t->GetAttrByName(\"class\");\r\n    if (attr) {\r\n        prevRule = FindStyleRule(Tag_Any, attr->val, attr->valLen);\r\n        if (prevRule) rule.Merge(*prevRule);\r\n        prevRule = FindStyleRule(t->tag, attr->val, attr->valLen);\r\n        if (prevRule) rule.Merge(*prevRule);\r\n    }\r\n    attr = t->GetAttrByName(\"style\");\r\n    if (attr) {\r\n        StyleRule newRule = StyleRule::Parse(attr->val, attr->valLen);\r\n        rule.Merge(newRule);\r\n    }\r\n    return rule;\r\n}\r\n\r\nvoid HtmlFormatter::ParseStyleSheet(const char *data, size_t len)\r\n{\r\n    CssPullParser parser(data, len);\r\n    while (parser.NextRule()) {\r\n        StyleRule rule = StyleRule::Parse(&parser);\r\n        const CssSelector *sel;\r\n        while ((sel = parser.NextSelector()) != nullptr) {\r\n            if (Tag_NotFound == sel->tag)\r\n                continue;\r\n            StyleRule *prevRule = FindStyleRule(sel->tag, sel->clazz, sel->clazzLen);\r\n            if (prevRule) {\r\n                prevRule->Merge(rule);\r\n            }\r\n            else {\r\n                rule.tag = sel->tag;\r\n                rule.classHash = sel->clazz ? MurmurHash2(sel->clazz, sel->clazzLen) : 0;\r\n                styleRules.Append(rule);\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\nvoid HtmlFormatter::HandleTagStyle(HtmlToken *t)\r\n{\r\n    if (!t->IsStartTag())\r\n        return;\r\n    AttrInfo *attr = t->GetAttrByName(\"type\");\r\n    if (attr && !attr->ValIs(\"text/css\"))\r\n        return;\r\n\r\n    const char *start = t->s + t->sLen + 1;\r\n    while (t && !t->IsError() && (!t->IsEndTag() || t->tag != Tag_Style)) {\r\n        t = htmlParser->Next();\r\n    }\r\n    if (!t || !t->IsEndTag() || Tag_Style != t->tag)\r\n        return;\r\n    const char *end = t->s - 2;\r\n    CrashIf(start > end);\r\n    ParseStyleSheet(start, end - start);\r\n    UpdateTagNesting(t);\r\n}\r\n\r\n// returns true if prev can't contain curr and should thus be closed\r\nstatic bool AutoCloseOnOpen(HtmlTag curr, HtmlTag prev)\r\n{\r\n    CrashIf(IsInlineTag(curr));\r\n    // always start afresh for a new <body>\r\n    if (Tag_Body == curr)\r\n        return true;\r\n    // allow <div>s to be contained within inline tags\r\n    // (e.g. <i><div>...</div></i> from pg12.mobi)\r\n    if (Tag_Div == curr)\r\n        return false;\r\n\r\n    switch (prev) {\r\n    case Tag_Dd: case Tag_Dt:\r\n        return Tag_Dd == curr || Tag_Dt == curr;\r\n    case Tag_H1: case Tag_H2: case Tag_H3:\r\n    case Tag_H4: case Tag_H5: case Tag_H6:\r\n        return IsTagH(curr);\r\n    case Tag_Lh: case Tag_Li:\r\n        return Tag_Lh == curr || Tag_Li == curr;\r\n    case Tag_P:\r\n        return true; // <p> can't contain any block-level elements\r\n    case Tag_Td: case Tag_Tr:\r\n        return Tag_Tr == curr;\r\n    default:\r\n        return IsInlineTag(prev);\r\n    }\r\n}\r\n\r\nvoid HtmlFormatter::AutoCloseTags(size_t count)\r\n{\r\n    keepTagNesting = true; // prevent recursion\r\n    HtmlToken tok;\r\n    tok.type = HtmlToken::EndTag;\r\n    tok.sLen = 0;\r\n    // let HandleHtmlTag clean up (in reverse order)\r\n    for (size_t i = 0; i < count; i++) {\r\n        tok.tag = tagNesting.Pop();\r\n        HandleHtmlTag(&tok);\r\n    }\r\n    keepTagNesting = false;\r\n}\r\n\r\nvoid HtmlFormatter::UpdateTagNesting(HtmlToken *t)\r\n{\r\n    CrashIf(!t->IsTag());\r\n    if (keepTagNesting || Tag_NotFound == t->tag ||\r\n        t->IsEmptyElementEndTag() || IsTagSelfClosing(t->tag)) {\r\n        return;\r\n    }\r\n\r\n    size_t idx = tagNesting.Count();\r\n    bool isInline = IsInlineTag(t->tag);\r\n    if (t->IsStartTag()) {\r\n        if (IsInlineTag(t->tag)) {\r\n            tagNesting.Push(t->tag);\r\n            return;\r\n        }\r\n        // close all tags that can't contain this new block-level tag\r\n        for (; idx > 0 && AutoCloseOnOpen(t->tag, tagNesting.At(idx - 1)); idx--);\r\n    }\r\n    else {\r\n        // close all tags that were contained within the current tag\r\n        // (for inline tags just up to the next block-level tag)\r\n        for (; idx > 0 && (!isInline || IsInlineTag(tagNesting.At(idx - 1))) &&\r\n                                        t->tag != tagNesting.At(idx - 1); idx--);\r\n        if (0 == idx || tagNesting.At(idx - 1) != t->tag)\r\n            return;\r\n    }\r\n\r\n    AutoCloseTags(tagNesting.Count() - idx);\r\n\r\n    if (t->IsStartTag())\r\n        tagNesting.Push(t->tag);\r\n    else {\r\n        CrashIf(!t->IsEndTag() || t->tag != tagNesting.Last());\r\n        tagNesting.Pop();\r\n    }\r\n}\r\n\r\nvoid HtmlFormatter::HandleHtmlTag(HtmlToken *t)\r\n{\r\n    CrashIf(!t->IsTag());\r\n\r\n    UpdateTagNesting(t);\r\n\r\n    HtmlTag tag = t->tag;\r\n    if (Tag_P == tag) {\r\n        HandleTagP(t);\r\n    } else if (Tag_Hr == tag) {\r\n        EmitHr();\r\n    } else if ((Tag_B == tag) || (Tag_Strong == tag)) {\r\n        ChangeFontStyle(FontStyleBold, t->IsStartTag());\r\n    } else if ((Tag_I == tag) || (Tag_Em == tag)) {\r\n        ChangeFontStyle(FontStyleItalic, t->IsStartTag());\r\n    } else if (Tag_U == tag) {\r\n        if (!currLinkIdx)\r\n            ChangeFontStyle(FontStyleUnderline, t->IsStartTag());\r\n    } else if (Tag_Strike == tag) {\r\n        ChangeFontStyle(FontStyleStrikeout, t->IsStartTag());\r\n    } else if (Tag_Br == tag) {\r\n        HandleTagBr();\r\n    } else if (Tag_Font == tag) {\r\n        HandleTagFont(t);\r\n    } else if (Tag_A == tag) {\r\n        HandleTagA(t);\r\n    } else if (Tag_Blockquote == tag) {\r\n        // TODO: implement me\r\n        HandleTagList(t);\r\n    } else if (Tag_Div == tag) {\r\n        // TODO: implement me\r\n        HandleTagP(t, true);\r\n    } else if (IsTagH(tag)) {\r\n        HandleTagHx(t);\r\n    } else if (Tag_Sup == tag) {\r\n        // TODO: implement me\r\n    } else if (Tag_Sub == tag) {\r\n        // TODO: implement me\r\n    } else if (Tag_Span == tag) {\r\n        // TODO: implement me\r\n    } else if (Tag_Center == tag) {\r\n        HandleTagP(t, true);\r\n        if (!t->IsEndTag())\r\n            CurrStyle()->align = Align_Center;\r\n    } else if ((Tag_Ul == tag) || (Tag_Ol == tag)) {\r\n        HandleTagList(t);\r\n    } else if (Tag_Li == tag) {\r\n        // TODO: display bullet/number\r\n        FlushCurrLine(true);\r\n    } else if (Tag_Dt == tag) {\r\n        FlushCurrLine(true);\r\n        ChangeFontStyle(FontStyleBold, t->IsStartTag());\r\n        if (t->IsStartTag())\r\n            CurrStyle()->align = Align_Left;\r\n    } else if (Tag_Dd == tag) {\r\n        // TODO: separate indentation from list depth\r\n        HandleTagList(t);\r\n    } else if (Tag_Table == tag) {\r\n        // TODO: implement me\r\n        HandleTagList(t);\r\n    } else if (Tag_Tr == tag) {\r\n        // display tables row-by-row for now\r\n        FlushCurrLine(true);\r\n        if (t->IsStartTag())\r\n            SetAlignment(Align_Left);\r\n        else if (t->IsEndTag())\r\n            RevertStyleChange();\r\n    } else if (Tag_Code == tag || Tag_Tt == tag) {\r\n        if (t->IsStartTag())\r\n            SetFont(L\"Courier New\", (FontStyle)CurrFont()->GetStyle());\r\n        else if (t->IsEndTag())\r\n            RevertStyleChange();\r\n    } else if (Tag_Pre == tag) {\r\n        HandleTagPre(t);\r\n    } else if (Tag_Img == tag) {\r\n        HandleTagImg(t);\r\n    } else if (Tag_Pagebreak == tag) {\r\n        // not really a HTML tag, but many ebook\r\n        // formats use it\r\n        HandleTagPagebreak(t);\r\n    } else if (Tag_Link == tag) {\r\n        HandleTagLink(t);\r\n    } else if (Tag_Style == tag) {\r\n        HandleTagStyle(t);\r\n    } else {\r\n        // TODO: temporary debugging\r\n        //lf(\"unhandled tag: %d\", tag);\r\n    }\r\n\r\n    // any tag could contain anchor information\r\n    HandleAnchorAttr(t);\r\n    // any tag could contain a reading direction change\r\n    HandleDirAttr(t);\r\n}\r\n\r\nvoid HtmlFormatter::HandleText(HtmlToken *t)\r\n{\r\n    CrashIf(!t->IsText());\r\n    HandleText(t->s, t->sLen);\r\n}\r\n\r\nvoid HtmlFormatter::HandleText(const char *s, size_t sLen)\r\n{\r\n    const char *curr = s;\r\n    const char *end = s + sLen;\r\n\r\n    if (preFormatted) {\r\n        // don't collapse whitespace and respect text newlines\r\n        while (curr < end) {\r\n            const char *text = curr;\r\n            currReparseIdx = curr - htmlParser->Start();\r\n            // skip to the next newline\r\n            for (; curr < end && *curr != '\\n'; curr++);\r\n            if (curr < end && curr > text && *(curr - 1) == '\\r')\r\n                curr--;\r\n            EmitTextRun(text, curr);\r\n            if ('\\n' == *curr || '\\r' == *curr) {\r\n                curr += '\\r' == *curr ? 2 : 1;\r\n                HandleTagBr();\r\n            }\r\n        }\r\n        return;\r\n    }\r\n\r\n    // break text into runs i.e. chunks that are either all\r\n    // whitespace or all non-whitespace\r\n    while (curr < end) {\r\n        // collapse multiple, consecutive white-spaces into a single space\r\n        currReparseIdx = curr - htmlParser->Start();\r\n        bool skipped = SkipWs(curr, end);\r\n        if (skipped)\r\n            EmitElasticSpace();\r\n\r\n        const char *text = curr;\r\n        currReparseIdx = curr - htmlParser->Start();\r\n        skipped = SkipNonWs(curr, end);\r\n        if (skipped)\r\n            EmitTextRun(text, curr);\r\n    }\r\n}\r\n\r\n// we ignore the content of <head>, <script>, <style> and <title> tags\r\nbool HtmlFormatter::IgnoreText()\r\n{\r\n    for (HtmlTag& tag : tagNesting) {\r\n        if ((Tag_Head == tag) ||\r\n            (Tag_Script == tag) ||\r\n            (Tag_Style == tag) ||\r\n            (Tag_Title == tag)) {\r\n                return true;\r\n        }\r\n    }\r\n    return false;\r\n}\r\n\r\n// empty page is one that consists of only invisible instructions\r\nstatic bool IsEmptyPage(HtmlPage *p)\r\n{\r\n    if (!p)\r\n        return false;\r\n    for (DrawInstr& i : p->instructions) {\r\n        // if a page only consits of lines we consider it empty. It's different\r\n        // than what Kindle does but I don't see the purpose of showing such\r\n        // pages to the user\r\n        if (InstrLine == i.type)\r\n            continue;\r\n        if (IsVisibleDrawInstr(i))\r\n            return false;\r\n    }\r\n    // all instructions were invisible\r\n    return true;\r\n}\r\n\r\n// Return the next parsed page. Returns nullptr if finished parsing.\r\n// For simplicity of implementation, we parse xml text node or\r\n// xml element at a time. This might cause a creation of one\r\n// or more pages, which we remeber and send to the caller\r\n// if we detect accumulated pages.\r\nHtmlPage *HtmlFormatter::Next(bool skipEmptyPages)\r\n{\r\n    for (;;)\r\n    {\r\n        // send out all pages accumulated so far\r\n        while (pagesToSend.Count() > 0) {\r\n            HtmlPage *ret = pagesToSend.PopAt(0);\r\n            pageCount++;\r\n            if (skipEmptyPages && IsEmptyPage(ret))\r\n                delete ret;\r\n            else\r\n                return ret;\r\n        }\r\n        // we can call ourselves recursively to send outstanding\r\n        // pages after parsing has finished so this is to detect\r\n        // that case and really end parsing\r\n        if (finishedParsing)\r\n            return nullptr;\r\n        HtmlToken *t = htmlParser->Next();\r\n        if (!t || t->IsError())\r\n            break;\r\n\r\n        currReparseIdx = t->GetReparsePoint() - htmlParser->Start();\r\n        CrashIf(!ValidReparseIdx(currReparseIdx, htmlParser));\r\n        if (t->IsTag())\r\n            HandleHtmlTag(t);\r\n        else if (!IgnoreText())\r\n            HandleText(t);\r\n    }\r\n    // force layout of the last line\r\n    AutoCloseTags(tagNesting.Count());\r\n    FlushCurrLine(true);\r\n\r\n    UpdateLinkBboxes(currPage);\r\n    pagesToSend.Append(currPage);\r\n    currPage = nullptr;\r\n    // call ourselves recursively to return accumulated pages\r\n    finishedParsing = true;\r\n    return Next();\r\n}\r\n\r\n// convenience method to format the whole html\r\nVec<HtmlPage*> *HtmlFormatter::FormatAllPages(bool skipEmptyPages)\r\n{\r\n    Vec<HtmlPage *> *pages = new Vec<HtmlPage *>();\r\n    for (HtmlPage *pd = Next(skipEmptyPages); pd; pd = Next(skipEmptyPages)) {\r\n        pages->Append(pd);\r\n    }\r\n    return pages;\r\n}\r\n\r\n// TODO: draw link in the appropriate format (blue text, underlined, should show hand cursor when\r\n// mouse is over a link. There's a slight complication here: we only get explicit information about\r\n// strings, not about the whitespace and we should underline the whitespace as well. Also the text\r\n// should be underlined at a baseline\r\nvoid DrawHtmlPage(Graphics *g, mui::ITextRender *textDraw, Vec<DrawInstr> *drawInstructions, REAL offX, REAL offY, bool showBbox, Color textColor, bool *abortCookie)\r\n{\r\n    Pen debugPen(Color(255, 0, 0), 1);\r\n    //Pen linePen(Color(0, 0, 0), 2.f);\r\n    Pen linePen(Color(0x5F, 0x4B, 0x32), 2.f);\r\n\r\n    WCHAR buf[512];\r\n\r\n    // GDI text rendering suffers terribly if we call GetHDC()/ReleaseHDC() around every\r\n    // draw, so first draw text and then paint everything else\r\n    textDraw->SetTextColor(textColor);\r\n    Status status = Ok;\r\n    Timer t;\r\n    textDraw->Lock();\r\n    for (DrawInstr& i : *drawInstructions) {\r\n        RectF bbox = i.bbox;\r\n        bbox.X += offX;\r\n        bbox.Y += offY;\r\n        if (InstrString == i.type || InstrRtlString == i.type) {\r\n            size_t strLen = str::Utf8ToWcharBuf(i.str.s, i.str.len, buf, dimof(buf));\r\n            // soft hyphens should not be displayed\r\n            strLen -= str::RemoveChars(buf, L\"\\xad\");\r\n            textDraw->Draw(buf, strLen, bbox, InstrRtlString == i.type);\r\n        } else if (InstrSetFont == i.type) {\r\n            textDraw->SetFont(i.font);\r\n        }\r\n        if (abortCookie && *abortCookie)\r\n            break;\r\n    }\r\n    textDraw->Unlock();\r\n    double dur = t.Stop();\r\n    lf(\"DrawHtmlPage: textDraw %.2f ms\", dur);\r\n\r\n    for (DrawInstr& i : *drawInstructions) {\r\n        RectF bbox = i.bbox;\r\n        bbox.X += offX;\r\n        bbox.Y += offY;\r\n        if (InstrLine == i.type) {\r\n            // hr is a line drawn in the middle of bounding box\r\n            REAL y = floorf(bbox.Y + bbox.Height / 2.f + 0.5f);\r\n            PointF p1(bbox.X, y);\r\n            PointF p2(bbox.X + bbox.Width, y);\r\n            if (showBbox) {\r\n                status = g->DrawRectangle(&debugPen, bbox);\r\n                CrashIf(status != Ok);\r\n            }\r\n            status = g->DrawLine(&linePen, p1, p2);\r\n            CrashIf(status != Ok);\r\n        } else if (InstrImage == i.type) {\r\n            // TODO: cache the bitmap somewhere (?)\r\n            Bitmap *bmp = BitmapFromData(i.img.data, i.img.len);\r\n            if (bmp) {\r\n                status = g->DrawImage(bmp, bbox, 0, 0, (REAL)bmp->GetWidth(), (REAL)bmp->GetHeight(), UnitPixel);\r\n                // GDI+ sometimes seems to succeed in loading an image because it lazily decodes it\r\n                CrashIf(status != Ok && status != Win32Error);\r\n            }\r\n            delete bmp;\r\n        } else if (InstrLinkStart == i.type) {\r\n            // TODO: set text color to blue\r\n            REAL y = floorf(bbox.Y + bbox.Height + 0.5f);\r\n            PointF p1(bbox.X, y);\r\n            PointF p2(bbox.X + bbox.Width, y);\r\n            Pen linkPen(textColor);\r\n            status = g->DrawLine(&linkPen, p1, p2);\r\n            CrashIf(status != Ok);\r\n        } else if (InstrString == i.type || InstrRtlString == i.type) {\r\n            if (showBbox) {\r\n                status = g->DrawRectangle(&debugPen, bbox);\r\n                CrashIf(status != Ok);\r\n            }\r\n        } else if (InstrLinkEnd == i.type) {\r\n            // TODO: set text color back again\r\n        } else if ((InstrElasticSpace == i.type) ||\r\n                   (InstrFixedSpace == i.type) ||\r\n                   (InstrString == i.type) ||\r\n                   (InstrRtlString == i.type) ||\r\n                   (InstrSetFont == i.type) ||\r\n                   (InstrAnchor == i.type)) {\r\n            // ignore\r\n        } else {\r\n            CrashIf(true);\r\n        }\r\n        if (abortCookie && *abortCookie)\r\n            break;\r\n    }\r\n}\r\n\r\nstatic mui::TextRenderMethod gTextRenderMethod = mui::TextRenderMethodGdi;\r\n// static mui::TextRenderMethod gTextRenderMethod = mui::TextRenderMethodGdiplus;\r\n\r\nmui::TextRenderMethod GetTextRenderMethod()\r\n{\r\n    return gTextRenderMethod;\r\n}\r\n\r\nvoid SetTextRenderMethod(mui::TextRenderMethod method)\r\n{\r\n    gTextRenderMethod = method;\r\n}\r\n\r\nHtmlFormatterArgs *CreateFormatterDefaultArgs(int dx, int dy, Allocator *textAllocator)\r\n{\r\n    HtmlFormatterArgs *args = new HtmlFormatterArgs();\r\n    args->SetFontName(L\"Georgia\");\r\n    args->fontSize = 12.5f;\r\n    args->pageDx = (REAL)dx;\r\n    args->pageDy = (REAL)dy;\r\n    args->textAllocator = textAllocator;\r\n    args->textRenderMethod = GetTextRenderMethod();\r\n    return args;\r\n}\r\n"
  },
  {
    "path": "src/HtmlFormatter.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nusing namespace Gdiplus;\r\n\r\n// Layout information for a given page is a list of\r\n// draw instructions that define what to draw and where.\r\nenum DrawInstrType {\r\n    // a piece of text\r\n    InstrString = 0,\r\n    // elastic space takes at least spaceDx pixels but can take more\r\n    // if a line is justified\r\n    InstrElasticSpace,\r\n    // a fixed space takes a fixed amount of pixels. It's used e.g.\r\n    // to implement paragraph indentation\r\n    InstrFixedSpace,\r\n    // a horizontal line\r\n    InstrLine,\r\n    // change current font\r\n    InstrSetFont,\r\n    // an image (raw data for e.g. BitmapFromData)\r\n    InstrImage,\r\n    // marks the beginning of a link (<a> tag)\r\n    InstrLinkStart,\r\n    // marks end of the link (must have matching InstrLinkStart)\r\n    InstrLinkEnd,\r\n    // marks an anchor an internal link might refer to\r\n    InstrAnchor,\r\n    // same as InstrString but for RTL text\r\n    InstrRtlString,\r\n};\r\n\r\nstruct DrawInstr {\r\n    DrawInstrType       type;\r\n    union {\r\n        // info specific to a given instruction\r\n        struct {\r\n            const char *s;\r\n            size_t      len;\r\n        } str;          // InstrString, InstrLinkStart, InstrAnchor, InstrRtlString\r\n        mui::CachedFont *font;        // InstrSetFont\r\n        ImageData       img;          // InstrImage\r\n    };\r\n    RectF bbox; // common to most instructions\r\n\r\n    DrawInstr() { }\r\n\r\n    explicit DrawInstr(DrawInstrType t, RectF bbox = RectF()) : type(t), bbox(bbox) { }\r\n\r\n    // helper constructors for instructions that need additional arguments\r\n    static DrawInstr Str(const char *s, size_t len, RectF bbox, bool rtl=false);\r\n    static DrawInstr Image(char *data, size_t len, RectF bbox);\r\n    static DrawInstr SetFont(mui::CachedFont *font);\r\n    static DrawInstr FixedSpace(float dx);\r\n    static DrawInstr LinkStart(const char *s, size_t len);\r\n    static DrawInstr Anchor(const char *s, size_t len, RectF bbox);\r\n};\r\n\r\nclass CssPullParser;\r\n\r\nstruct StyleRule {\r\n    HtmlTag     tag;\r\n    uint32_t    classHash;\r\n\r\n    enum Unit { px, pt, em, inherit };\r\n\r\n    float       textIndent;\r\n    Unit        textIndentUnit;\r\n    AlignAttr   textAlign;\r\n\r\n    StyleRule();\r\n\r\n    void Merge(StyleRule& source);\r\n\r\n    static StyleRule Parse(CssPullParser *parser);\r\n    static StyleRule Parse(const char *s, size_t len);\r\n};\r\n\r\nstruct DrawStyle {\r\n    mui::CachedFont *font;\r\n    AlignAttr align;\r\n    bool dirRtl;\r\n};\r\n\r\nclass HtmlPage {\r\npublic:\r\n    explicit HtmlPage(int reparseIdx=0) : reparseIdx(reparseIdx) { }\r\n\r\n    Vec<DrawInstr>  instructions;\r\n    // if we start parsing html again from reparseIdx, we should\r\n    // get the same instructions. reparseIdx is an offset within\r\n    // html data\r\n    // TODO: reparsing from reparseIdx can lead to different styling\r\n    // due to internal state of HtmlFormatter not being properly set\r\n    int             reparseIdx;\r\n};\r\n\r\n// just to pack args to HtmlFormatter\r\nclass HtmlFormatterArgs {\r\npublic:\r\n    HtmlFormatterArgs();\r\n\r\n    REAL            pageDx;\r\n    REAL            pageDy;\r\n\r\n    void SetFontName(const WCHAR *s) {\r\n        fontName.Set(str::Dup(s));\r\n    }\r\n\r\n    const WCHAR *GetFontName() { return fontName; }\r\n\r\n    float           fontSize;\r\n\r\n    /* Most of the time string DrawInstr point to original html text\r\n       that is read-only and outlives us. Sometimes (e.g. when resolving\r\n       html entities) we need a modified text. This allocator is\r\n       used to allocate this text. */\r\n    Allocator *     textAllocator;\r\n\r\n    mui::TextRenderMethod textRenderMethod;\r\n\r\n    const char *    htmlStr;\r\n    size_t          htmlStrLen;\r\n\r\n    // we start parsing from htmlStr + reparseIdx\r\n    int             reparseIdx;\r\n\r\nprivate:\r\n    ScopedMem<WCHAR> fontName;\r\n};\r\n\r\nclass HtmlPullParser;\r\nstruct HtmlToken;\r\nstruct CssSelector;\r\n\r\nclass HtmlFormatter\r\n{\r\nprotected:\r\n    void HandleTagBr();\r\n    void HandleTagP(HtmlToken *t, bool isDiv=false);\r\n    void HandleTagFont(HtmlToken *t);\r\n    bool HandleTagA(HtmlToken *t, const char *linkAttr=\"href\", const char *attrNS=nullptr);\r\n    void HandleTagHx(HtmlToken *t);\r\n    void HandleTagList(HtmlToken *t);\r\n    void HandleTagPre(HtmlToken *t);\r\n    void HandleTagStyle(HtmlToken *t);\r\n\r\n    void HandleAnchorAttr(HtmlToken *t, bool idsOnly=false);\r\n    void HandleDirAttr(HtmlToken *t);\r\n\r\n    void AutoCloseTags(size_t count);\r\n    void UpdateTagNesting(HtmlToken *t);\r\n    virtual void HandleHtmlTag(HtmlToken *t);\r\n    void HandleText(HtmlToken *t);\r\n    void HandleText(const char *s, size_t sLen);\r\n    // blank convenience methods to override\r\n    virtual void HandleTagImg(HtmlToken *t) { UNUSED(t); }\r\n    virtual void HandleTagPagebreak(HtmlToken *t) { UNUSED(t); }\r\n    virtual void HandleTagLink(HtmlToken *t) { UNUSED(t);  }\r\n\r\n    float CurrLineDx();\r\n    float CurrLineDy();\r\n    float NewLineX();\r\n    void  LayoutLeftStartingAt(REAL offX);\r\n    void  JustifyLineBoth();\r\n    void  JustifyCurrLine(AlignAttr align);\r\n    bool  FlushCurrLine(bool isParagraphBreak);\r\n    void  UpdateLinkBboxes(HtmlPage *page);\r\n\r\n    bool  EmitImage(ImageData *img);\r\n    void  EmitHr();\r\n    void  EmitTextRun(const char *s, const char *end);\r\n    void  EmitElasticSpace();\r\n    void  EmitParagraph(float indent);\r\n    void  EmitEmptyLine(float lineDy);\r\n    void  EmitNewPage();\r\n    void  ForceNewPage();\r\n    bool  EnsureDx(float dx);\r\n\r\n    DrawStyle *CurrStyle() { return &styleStack.Last(); }\r\n    mui::CachedFont *CurrFont() { return CurrStyle()->font; }\r\n    void  SetFont(const WCHAR *fontName, FontStyle fs, float fontSize=-1);\r\n    void  SetFontBasedOn(mui::CachedFont *origFont, FontStyle fs, float fontSize=-1);\r\n    void  ChangeFontStyle(FontStyle fs, bool isStart);\r\n    void  SetAlignment(AlignAttr align);\r\n    void  RevertStyleChange();\r\n\r\n    void  ParseStyleSheet(const char *data, size_t len);\r\n    StyleRule *FindStyleRule(HtmlTag tag, const char *clazz, size_t clazzLen);\r\n    StyleRule ComputeStyleRule(HtmlToken *t);\r\n\r\n    void  AppendInstr(DrawInstr di);\r\n    bool  IsCurrLineEmpty();\r\n    virtual bool IgnoreText();\r\n\r\n    void DumpLineDebugInfo();\r\n\r\n    // constant during layout process\r\n    float               pageDx;\r\n    float               pageDy;\r\n    float               lineSpacing;\r\n    float               spaceDx;\r\n    Graphics *          gfx; // for measuring text\r\n    ScopedMem<WCHAR>    defaultFontName;\r\n    float               defaultFontSize;\r\n    Allocator *         textAllocator;\r\n    mui::ITextRender *  textMeasure;\r\n\r\n    // style stack of the current line\r\n    Vec<DrawStyle>      styleStack;\r\n    // style for the start of the next page\r\n    DrawStyle           nextPageStyle;\r\n    // current position in a page\r\n    float               currX, currY;\r\n    // remembered when we start a new line, used when we actually\r\n    // layout a line\r\n    float               currLineTopPadding;\r\n    // number of nested lists for indenting whole paragraphs\r\n    int                 listDepth;\r\n    // set if newlines are not to be ignored\r\n    bool                preFormatted;\r\n    // set if the reading direction is RTL\r\n    bool                dirRtl;\r\n    // list of currently opened tags for auto-closing when needed\r\n    Vec<HtmlTag>        tagNesting;\r\n    bool                keepTagNesting;\r\n    // set from CSS and to be checked by the individual tag handlers\r\n    Vec<StyleRule>      styleRules;\r\n\r\n    // isntructions for the current line\r\n    Vec<DrawInstr>      currLineInstr;\r\n    // reparse point of the first instructions in a current line\r\n    ptrdiff_t           currLineReparseIdx;\r\n    HtmlPage *          currPage;\r\n\r\n    // for tracking whether we're currently inside <a> tag\r\n    size_t              currLinkIdx;\r\n\r\n    // reparse point for the current HtmlToken\r\n    ptrdiff_t           currReparseIdx;\r\n\r\n    HtmlPullParser *    htmlParser;\r\n\r\n    // list of pages that we've created but haven't yet sent to client\r\n    Vec<HtmlPage*>      pagesToSend;\r\n\r\n    bool                finishedParsing;\r\n    // number of pages generated so far, approximate. Only used\r\n    // for detection of cover image duplicates in mobi formatting\r\n    int                 pageCount;\r\n\r\n    WCHAR               buf[512];\r\n\r\npublic:\r\n    explicit HtmlFormatter(HtmlFormatterArgs *args);\r\n    virtual ~HtmlFormatter();\r\n\r\n    HtmlPage *Next(bool skipEmptyPages=true);\r\n    Vec<HtmlPage*> *FormatAllPages(bool skipEmptyPages=true);\r\n};\r\n\r\nvoid DrawHtmlPage(Graphics *g, mui::ITextRender *textRender, Vec<DrawInstr> *drawInstructions, REAL offX, REAL offY, bool showBbox, Color textColor, bool *abortCookie=nullptr);\r\n\r\nmui::TextRenderMethod GetTextRenderMethod();\r\nvoid SetTextRenderMethod(mui::TextRenderMethod method);\r\nHtmlFormatterArgs *CreateFormatterDefaultArgs(int dx, int dy, Allocator *textAllocator=nullptr);\r\n"
  },
  {
    "path": "src/ImagesEngine.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"ArchUtil.h\"\r\n#include \"FileUtil.h\"\r\n#include \"GdiPlusUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"HtmlPullParser.h\"\r\n#include \"JsonParser.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"ImagesEngine.h\"\r\n#include \"PdfCreator.h\"\r\n\r\n// number of decoded bitmaps to cache for quicker rendering\r\n#define MAX_IMAGE_PAGE_CACHE    10\r\n\r\n///// ImagesEngine methods apply to all types of engines handling full-page images /////\r\n\r\nstruct ImagePage {\r\n    int pageNo;\r\n    Bitmap *bmp;\r\n    bool ownBmp;\r\n    int refs;\r\n\r\n    ImagePage(int pageNo, Bitmap *bmp) :\r\n        pageNo(pageNo), bmp(bmp), ownBmp(true), refs(1) { }\r\n};\r\n\r\nclass ImageElement;\r\n\r\nclass ImagesEngine : public BaseEngine {\r\n    friend ImageElement;\r\n\r\npublic:\r\n    ImagesEngine();\r\n    virtual ~ImagesEngine();\r\n\r\n    const WCHAR *FileName() const override { return fileName; };\r\n    int PageCount() const override { return (int)mediaboxes.Count(); }\r\n\r\n    RectD PageMediabox(int pageNo) override;\r\n\r\n    RenderedBitmap *RenderBitmap(int pageNo, float zoom, int rotation,\r\n                         RectD *pageRect=nullptr, /* if nullptr: defaults to the page's mediabox */\r\n                         RenderTarget target=Target_View, AbortCookie **cookie_out=nullptr) override;\r\n\r\n    PointD Transform(PointD pt, int pageNo, float zoom, int rotation, bool inverse=false) override;\r\n    RectD Transform(RectD rect, int pageNo, float zoom, int rotation, bool inverse=false) override;\r\n\r\n    unsigned char *GetFileData(size_t *cbCount) override;\r\n    bool SaveFileAs(const WCHAR *copyFileName, bool includeUserAnnots=false) override;\r\n    WCHAR * ExtractPageText(int pageNo, const WCHAR *lineSep, RectI **coordsOut=nullptr,\r\n                                    RenderTarget target=Target_View) override {\r\n        UNUSED(pageNo); UNUSED(lineSep);\r\n        UNUSED(coordsOut); UNUSED(target);\r\n        return nullptr;\r\n    }\r\n    bool HasClipOptimizations(int pageNo) override { UNUSED(pageNo);  return false; }\r\n    PageLayoutType PreferredLayout() override { return Layout_NonContinuous; }\r\n    bool IsImageCollection() const override { return true; }\r\n\r\n    bool SupportsAnnotation(bool forSaving = false) const override { UNUSED(forSaving);  return false; }\r\n    void UpdateUserAnnotations(Vec<PageAnnotation> *list) override { UNUSED(list); }\r\n\r\n    Vec<PageElement *> *GetElements(int pageNo) override;\r\n    PageElement *GetElementAtPos(int pageNo, PointD pt) override;\r\n\r\n    bool BenchLoadPage(int pageNo) override {\r\n        ImagePage *page = GetPage(pageNo);\r\n        if (page)\r\n            DropPage(page);\r\n        return page != nullptr;\r\n    }\r\n\r\nprotected:\r\n    WCHAR *fileName;\r\n    ScopedComPtr<IStream> fileStream;\r\n\r\n    CRITICAL_SECTION cacheAccess;\r\n    Vec<ImagePage *> pageCache;\r\n    Vec<RectD> mediaboxes;\r\n\r\n    void GetTransform(Matrix& m, int pageNo, float zoom, int rotation);\r\n\r\n    virtual Bitmap *LoadBitmap(int pageNo, bool& deleteAfterUse) = 0;\r\n    virtual RectD LoadMediabox(int pageNo) = 0;\r\n\r\n    ImagePage *GetPage(int pageNo, bool tryOnly=false);\r\n    void DropPage(ImagePage *page, bool forceRemove=false);\r\n};\r\n\r\nImagesEngine::ImagesEngine() : fileName(nullptr)\r\n{\r\n    InitializeCriticalSection(&cacheAccess);\r\n}\r\n\r\nImagesEngine::~ImagesEngine()\r\n{\r\n    EnterCriticalSection(&cacheAccess);\r\n    while (pageCache.Count() > 0) {\r\n        CrashIf(pageCache.Last()->refs != 1);\r\n        DropPage(pageCache.Last(), true);\r\n    }\r\n    LeaveCriticalSection(&cacheAccess);\r\n\r\n    free(fileName);\r\n\r\n    DeleteCriticalSection(&cacheAccess);\r\n}\r\n\r\nRectD ImagesEngine::PageMediabox(int pageNo)\r\n{\r\n    AssertCrash(1 <= pageNo && pageNo <= PageCount());\r\n    if (mediaboxes.At(pageNo - 1).IsEmpty())\r\n        mediaboxes.At(pageNo - 1) = LoadMediabox(pageNo);\r\n    return mediaboxes.At(pageNo - 1);\r\n}\r\n\r\nRenderedBitmap *ImagesEngine::RenderBitmap(int pageNo, float zoom, int rotation, RectD *pageRect, RenderTarget target, AbortCookie **cookieOut)\r\n{\r\n    UNUSED(target); UNUSED(cookieOut);\r\n    ImagePage *page = GetPage(pageNo);\r\n    if (!page)\r\n        return nullptr;\r\n\r\n    RectD pageRc = pageRect ? *pageRect : PageMediabox(pageNo);\r\n    RectI screen = Transform(pageRc, pageNo, zoom, rotation).Round();\r\n    PointI screenTL = screen.TL();\r\n    screen.Offset(-screen.x, -screen.y);\r\n\r\n    HANDLE hMap = nullptr;\r\n    HBITMAP hbmp = CreateMemoryBitmap(screen.Size(), &hMap);\r\n    HDC hDC = CreateCompatibleDC(nullptr);\r\n    DeleteObject(SelectObject(hDC, hbmp));\r\n\r\n    Graphics g(hDC);\r\n    g.SetCompositingQuality(CompositingQualityHighQuality);\r\n    g.SetSmoothingMode(SmoothingModeAntiAlias);\r\n    g.SetPageUnit(UnitPixel);\r\n\r\n    Color white(0xFF, 0xFF, 0xFF);\r\n    SolidBrush tmpBrush(white);\r\n    Rect screenR(screen.ToGdipRect());\r\n    screenR.Inflate(1, 1);\r\n    g.FillRectangle(&tmpBrush, screenR);\r\n\r\n    Matrix m;\r\n    GetTransform(m, pageNo, zoom, rotation);\r\n    m.Translate((REAL)-screenTL.x, (REAL)-screenTL.y, MatrixOrderAppend);\r\n    g.SetTransform(&m);\r\n\r\n    RectI pageRcI = PageMediabox(pageNo).Round();\r\n    ImageAttributes imgAttrs;\r\n    imgAttrs.SetWrapMode(WrapModeTileFlipXY);\r\n    Status ok = g.DrawImage(page->bmp, pageRcI.ToGdipRect(), 0, 0, pageRcI.dx, pageRcI.dy, UnitPixel, &imgAttrs);\r\n\r\n    DropPage(page);\r\n    DeleteDC(hDC);\r\n\r\n    if (ok != Ok) {\r\n        DeleteObject(hbmp);\r\n        CloseHandle(hMap);\r\n        return nullptr;\r\n    }\r\n\r\n    return new RenderedBitmap(hbmp, screen.Size(), hMap);\r\n}\r\n\r\nvoid ImagesEngine::GetTransform(Matrix& m, int pageNo, float zoom, int rotation)\r\n{\r\n    GetBaseTransform(m, PageMediabox(pageNo).ToGdipRectF(), zoom, rotation);\r\n}\r\n\r\nPointD ImagesEngine::Transform(PointD pt, int pageNo, float zoom, int rotation, bool inverse)\r\n{\r\n    RectD rect = Transform(RectD(pt, SizeD()), pageNo, zoom, rotation, inverse);\r\n    return PointD(rect.x, rect.y);\r\n}\r\n\r\nRectD ImagesEngine::Transform(RectD rect, int pageNo, float zoom, int rotation, bool inverse)\r\n{\r\n    PointF pts[2] = {\r\n        PointF((REAL)rect.x, (REAL)rect.y),\r\n        PointF((REAL)(rect.x + rect.dx), (REAL)(rect.y + rect.dy))\r\n    };\r\n    Matrix m;\r\n    GetTransform(m, pageNo, zoom, rotation);\r\n    if (inverse)\r\n        m.Invert();\r\n    m.TransformPoints(pts, 2);\r\n    rect = RectD::FromXY(pts[0].X, pts[0].Y, pts[1].X, pts[1].Y);\r\n    // try to undo rounding errors caused by a rotation\r\n    // (necessary correction determined by experimentation)\r\n    if (rotation != 0)\r\n        rect.Inflate(-0.01, -0.01);\r\n    return rect;\r\n}\r\n\r\nclass ImageElement : public PageElement {\r\n    ImagesEngine *engine;\r\n    ImagePage *page;\r\n\r\npublic:\r\n    explicit ImageElement(ImagesEngine *engine, ImagePage *page) : engine(engine), page(page) { }\r\n    virtual ~ImageElement() { engine->DropPage(page); }\r\n\r\n    virtual PageElementType GetType() const { return Element_Image; }\r\n    virtual int GetPageNo() const { return page->pageNo; }\r\n    virtual RectD GetRect() const { return RectD(0, 0, page->bmp->GetWidth(), page->bmp->GetHeight()); }\r\n    virtual WCHAR *GetValue() const { return nullptr; }\r\n\r\n    virtual RenderedBitmap *GetImage() {\r\n        HBITMAP hbmp;\r\n        if (page->bmp->GetHBITMAP((ARGB)Color::White, &hbmp) != Ok)\r\n            return nullptr;\r\n        return new RenderedBitmap(hbmp, SizeI(page->bmp->GetWidth(), page->bmp->GetHeight()));\r\n    }\r\n};\r\n\r\nVec<PageElement *> *ImagesEngine::GetElements(int pageNo)\r\n{\r\n    ImagePage *page = GetPage(pageNo);\r\n    if (!page)\r\n        return nullptr;\r\n\r\n    Vec<PageElement *> *els = new Vec<PageElement *>();\r\n    els->Append(new ImageElement(this, page));\r\n    return els;\r\n}\r\n\r\nPageElement *ImagesEngine::GetElementAtPos(int pageNo, PointD pt)\r\n{\r\n    if (!PageMediabox(pageNo).Contains(pt))\r\n        return nullptr;\r\n    ImagePage *page = GetPage(pageNo);\r\n    if (!page)\r\n        return nullptr;\r\n    return new ImageElement(this, page);\r\n}\r\n\r\nunsigned char *ImagesEngine::GetFileData(size_t *cbCount)\r\n{\r\n    if (fileStream) {\r\n        void *data = GetDataFromStream(fileStream, cbCount);\r\n        if (data)\r\n            return (unsigned char *)data;\r\n    }\r\n    if (fileName)\r\n        return (unsigned char *)file::ReadAll(fileName, cbCount);\r\n    return nullptr;\r\n}\r\n\r\nbool ImagesEngine::SaveFileAs(const WCHAR *copyFileName, bool includeUserAnnots)\r\n{\r\n    UNUSED(includeUserAnnots);\r\n    if (fileName) {\r\n        BOOL ok = CopyFile(fileName, copyFileName, FALSE);\r\n        if (ok)\r\n            return true;\r\n    }\r\n    size_t dataLen;\r\n    ScopedMem<unsigned char> data(GetFileData(&dataLen));\r\n    if (data)\r\n        return file::WriteAll(copyFileName, data.Get(), dataLen);\r\n    return false;\r\n}\r\n\r\nImagePage *ImagesEngine::GetPage(int pageNo, bool tryOnly)\r\n{\r\n    ScopedCritSec scope(&cacheAccess);\r\n\r\n    ImagePage *result = nullptr;\r\n\r\n    for (size_t i = 0; i < pageCache.Count(); i++) {\r\n        if (pageCache.At(i)->pageNo == pageNo) {\r\n            result = pageCache.At(i);\r\n            break;\r\n        }\r\n    }\r\n    if (!result && tryOnly)\r\n        return nullptr;\r\n    if (!result) {\r\n        // TODO: drop most memory intensive pages first\r\n        // (i.e. formats which aren't IsGdiPlusNativeFormat)?\r\n        if (pageCache.Count() >= MAX_IMAGE_PAGE_CACHE) {\r\n            CrashIf(pageCache.Count() != MAX_IMAGE_PAGE_CACHE);\r\n            DropPage(pageCache.Last(), true);\r\n        }\r\n        result = new ImagePage(pageNo, nullptr);\r\n        result->bmp = LoadBitmap(pageNo, result->ownBmp);\r\n        pageCache.InsertAt(0, result);\r\n    }\r\n    else if (result != pageCache.At(0)) {\r\n        // keep the list Most Recently Used first\r\n        pageCache.Remove(result);\r\n        pageCache.InsertAt(0, result);\r\n    }\r\n    // return nullptr if a page failed to load\r\n    if (result && !result->bmp)\r\n        result = nullptr;\r\n\r\n    if (result)\r\n        result->refs++;\r\n    return result;\r\n}\r\n\r\nvoid ImagesEngine::DropPage(ImagePage *page, bool forceRemove)\r\n{\r\n    ScopedCritSec scope(&cacheAccess);\r\n    page->refs--;\r\n\r\n    if (0 == page->refs || forceRemove)\r\n        pageCache.Remove(page);\r\n\r\n    if (0 == page->refs) {\r\n        if (page->ownBmp)\r\n            delete page->bmp;\r\n        delete page;\r\n    }\r\n}\r\n\r\n///// ImageEngine handles a single image file /////\r\n\r\nclass ImageEngineImpl : public ImagesEngine {\r\npublic:\r\n    ImageEngineImpl() : fileExt(nullptr), image(nullptr) { }\r\n    virtual ~ImageEngineImpl() { delete image; }\r\n\r\n    BaseEngine *Clone() override;\r\n\r\n    WCHAR *GetProperty(DocumentProperty prop) override;\r\n\r\n    float GetFileDPI() const override { return image->GetHorizontalResolution(); }\r\n    const WCHAR *GetDefaultFileExt() const override { return fileExt; }\r\n\r\n    bool SaveFileAsPDF(const WCHAR *pdfFileName, bool includeUserAnnots=false) override;\r\n\r\n    static BaseEngine *CreateFromFile(const WCHAR *fileName);\r\n    static BaseEngine *CreateFromStream(IStream *stream);\r\n\r\nprotected:\r\n    const WCHAR *fileExt;\r\n    Bitmap *image;\r\n\r\n    bool LoadSingleFile(const WCHAR *fileName);\r\n    bool LoadFromStream(IStream *stream);\r\n    bool FinishLoading();\r\n\r\n    virtual Bitmap *LoadBitmap(int pageNo, bool& deleteAfterUse);\r\n    virtual RectD LoadMediabox(int pageNo);\r\n};\r\n\r\nBaseEngine *ImageEngineImpl::Clone()\r\n{\r\n    Bitmap *bmp = image->Clone(0, 0, image->GetWidth(), image->GetHeight(), PixelFormat32bppARGB);\r\n    if (!bmp)\r\n        return nullptr;\r\n\r\n    ImageEngineImpl *clone = new ImageEngineImpl();\r\n    clone->fileName = str::Dup(fileName);\r\n    clone->fileExt = fileExt;\r\n    if (fileStream)\r\n        fileStream->Clone(&clone->fileStream);\r\n    clone->image = bmp;\r\n    clone->FinishLoading();\r\n\r\n    return clone;\r\n}\r\n\r\nbool ImageEngineImpl::LoadSingleFile(const WCHAR *file)\r\n{\r\n    if (!file)\r\n        return false;\r\n    fileName = str::Dup(file);\r\n\r\n    size_t len;\r\n    ScopedMem<char> data(file::ReadAll(file, &len));\r\n    fileExt = GfxFileExtFromData(data, len);\r\n\r\n    image = BitmapFromData(data, len);\r\n    return FinishLoading();\r\n}\r\n\r\nbool ImageEngineImpl::LoadFromStream(IStream *stream)\r\n{\r\n    if (!stream)\r\n        return false;\r\n    fileStream = stream;\r\n    fileStream->AddRef();\r\n\r\n    char header[18];\r\n    if (ReadDataFromStream(stream, header, sizeof(header)))\r\n        fileExt = GfxFileExtFromData(header, sizeof(header));\r\n    if (!fileExt)\r\n        return false;\r\n\r\n    size_t len;\r\n    ScopedMem<char> data((char *)GetDataFromStream(stream, &len));\r\n    if (IsGdiPlusNativeFormat(data, len))\r\n        image = Bitmap::FromStream(stream);\r\n    else\r\n        image = BitmapFromData(data, len);\r\n\r\n    return FinishLoading();\r\n}\r\n\r\nbool ImageEngineImpl::FinishLoading()\r\n{\r\n    if (!image || image->GetLastStatus() != Ok)\r\n        return false;\r\n\r\n    mediaboxes.Append(RectD(0, 0, image->GetWidth(), image->GetHeight()));\r\n    AssertCrash(mediaboxes.Count() == 1);\r\n\r\n    // extract all frames from multi-page TIFFs and animated GIFs\r\n    if (str::Eq(fileExt, L\".tif\") || str::Eq(fileExt, L\".gif\")) {\r\n        const GUID *frameDimension = str::Eq(fileExt, L\".tif\") ? &FrameDimensionPage : &FrameDimensionTime;\r\n        mediaboxes.AppendBlanks(image->GetFrameCount(frameDimension) - 1);\r\n    }\r\n\r\n    CrashIf(!fileExt);\r\n    return fileExt != nullptr;\r\n}\r\n\r\n// cf. http://www.universalthread.com/ViewPageArticle.aspx?ID=831\r\n#ifndef PropertyTagXPTitle\r\n#define PropertyTagXPTitle      0x9c9b\r\n#define PropertyTagXPComment    0x9c9c\r\n#define PropertyTagXPAuthor     0x9c9d\r\n#define PropertyTagXPKeywords   0x9c9e\r\n#define PropertyTagXPSubject    0x9c9f\r\n#endif\r\n\r\nstatic WCHAR *GetImageProperty(Bitmap *bmp, PROPID id, PROPID altId=0)\r\n{\r\n    WCHAR *value = nullptr;\r\n    UINT size = bmp->GetPropertyItemSize(id);\r\n    PropertyItem *item = (PropertyItem *)malloc(size);\r\n    Status ok = item ? bmp->GetPropertyItem(id, size, item) : OutOfMemory;\r\n    if (Ok != ok)\r\n        /* property didn't exist */;\r\n    else if (PropertyTagTypeASCII == item->type)\r\n        value = str::conv::FromAnsi((char *)item->value);\r\n    else if (PropertyTagTypeByte == item->type && item->length > 0 &&\r\n        0 == (item->length % 2) && !((WCHAR *)item->value)[item->length / 2 - 1]) {\r\n        value = str::Dup((WCHAR *)item->value);\r\n    }\r\n    free(item);\r\n    if (!value && altId)\r\n        return GetImageProperty(bmp, altId);\r\n    return value;\r\n}\r\n\r\nWCHAR *ImageEngineImpl::GetProperty(DocumentProperty prop)\r\n{\r\n    switch (prop) {\r\n    case Prop_Title:\r\n        return GetImageProperty(image, PropertyTagImageDescription, PropertyTagXPTitle);\r\n    case Prop_Subject:\r\n        return GetImageProperty(image, PropertyTagXPSubject);\r\n    case Prop_Author:\r\n        return GetImageProperty(image, PropertyTagArtist, PropertyTagXPAuthor);\r\n    case Prop_Copyright:\r\n        return GetImageProperty(image, PropertyTagCopyright);\r\n    case Prop_CreationDate:\r\n        return GetImageProperty(image, PropertyTagDateTime, PropertyTagExifDTDigitized);\r\n    case Prop_CreatorApp:\r\n        return GetImageProperty(image, PropertyTagSoftwareUsed);\r\n    default:\r\n        return nullptr;\r\n    }\r\n}\r\n\r\nBitmap *ImageEngineImpl::LoadBitmap(int pageNo, bool& deleteAfterUse)\r\n{\r\n    if (1 == pageNo) {\r\n        deleteAfterUse = false;\r\n        return image;\r\n    }\r\n\r\n    // extract other frames from multi-page TIFFs and animated GIFs\r\n    CrashIf(!str::Eq(fileExt, L\".tif\") && !str::Eq(fileExt, L\".gif\"));\r\n    const GUID *frameDimension = str::Eq(fileExt, L\".tif\") ? &FrameDimensionPage : &FrameDimensionTime;\r\n    UINT frameCount = image->GetFrameCount(frameDimension);\r\n    CrashIf((unsigned int)pageNo > frameCount);\r\n    Bitmap *frame = image->Clone(0, 0, image->GetWidth(), image->GetHeight(), PixelFormat32bppARGB);\r\n    if (!frame)\r\n        return nullptr;\r\n    Status ok = frame->SelectActiveFrame(frameDimension, pageNo - 1);\r\n    if (ok != Ok) {\r\n        delete frame;\r\n        return nullptr;\r\n    }\r\n    deleteAfterUse = true;\r\n    return frame;\r\n}\r\n\r\nRectD ImageEngineImpl::LoadMediabox(int pageNo)\r\n{\r\n    if (1 == pageNo)\r\n        return RectD(0, 0, image->GetWidth(), image->GetHeight());\r\n\r\n    // fill the cache to prevent the first few frames from being unpacked twice\r\n    ImagePage *page = GetPage(pageNo, MAX_IMAGE_PAGE_CACHE == pageCache.Count());\r\n    if (page) {\r\n        RectD mbox(0, 0, page->bmp->GetWidth(), page->bmp->GetHeight());\r\n        DropPage(page);\r\n        return mbox;\r\n    }\r\n\r\n    CrashIf(!str::Eq(fileExt, L\".tif\") && !str::Eq(fileExt, L\".gif\"));\r\n    RectD mbox = RectD(0, 0, image->GetWidth(), image->GetHeight());\r\n    Bitmap *frame = image->Clone(0, 0, image->GetWidth(), image->GetHeight(), PixelFormat32bppARGB);\r\n    if (!frame)\r\n        return mbox;\r\n    const GUID *frameDimension = str::Eq(fileExt, L\".tif\") ? &FrameDimensionPage : &FrameDimensionTime;\r\n    Status ok = frame->SelectActiveFrame(frameDimension, pageNo - 1);\r\n    if (Ok == ok)\r\n        mbox = RectD(0, 0, frame->GetWidth(), frame->GetHeight());\r\n    delete frame;\r\n    return mbox;\r\n}\r\n\r\nbool ImageEngineImpl::SaveFileAsPDF(const WCHAR *pdfFileName, bool includeUserAnnots)\r\n{\r\n    UNUSED(includeUserAnnots);\r\n    bool ok = true;\r\n    PdfCreator *c = new PdfCreator();\r\n    if (fileName) {\r\n        size_t len;\r\n        ScopedMem<char> data(file::ReadAll(fileName, &len));\r\n        ok = data && c->AddImagePage(data, len, GetFileDPI());\r\n    }\r\n    else {\r\n        size_t len;\r\n        ScopedMem<char> data((char *)GetDataFromStream(fileStream, &len));\r\n        ok = data && c->AddImagePage(data, len, GetFileDPI());\r\n    }\r\n    for (int i = 2; i <= PageCount() && ok; i++) {\r\n        ImagePage *page = GetPage(i);\r\n        ok = page && c->AddImagePage(page->bmp, GetFileDPI());\r\n        DropPage(page);\r\n    }\r\n    if (ok) {\r\n        c->CopyProperties(this);\r\n        ok = c->SaveToFile(pdfFileName);\r\n    }\r\n    delete c;\r\n    return ok;\r\n}\r\n\r\nBaseEngine *ImageEngineImpl::CreateFromFile(const WCHAR *fileName)\r\n{\r\n    ImageEngineImpl *engine = new ImageEngineImpl();\r\n    if (!engine->LoadSingleFile(fileName)) {\r\n        delete engine;\r\n        return nullptr;\r\n    }\r\n    return engine;\r\n}\r\n\r\nBaseEngine *ImageEngineImpl::CreateFromStream(IStream *stream)\r\n{\r\n    ImageEngineImpl *engine = new ImageEngineImpl();\r\n    if (!engine->LoadFromStream(stream)) {\r\n        delete engine;\r\n        return nullptr;\r\n    }\r\n    return engine;\r\n}\r\n\r\nnamespace ImageEngine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff)\r\n{\r\n    if (sniff) {\r\n        char header[32] = { 0 };\r\n        file::ReadN(fileName, header, sizeof(header));\r\n        fileName = GfxFileExtFromData(header, sizeof(header));\r\n    }\r\n\r\n    return str::EndsWithI(fileName, L\".png\") ||\r\n           str::EndsWithI(fileName, L\".jpg\") || str::EndsWithI(fileName, L\".jpeg\") ||\r\n           str::EndsWithI(fileName, L\".gif\") ||\r\n           str::EndsWithI(fileName, L\".tif\") || str::EndsWithI(fileName, L\".tiff\") ||\r\n           str::EndsWithI(fileName, L\".bmp\") ||\r\n           str::EndsWithI(fileName, L\".tga\") ||\r\n           str::EndsWithI(fileName, L\".jxr\") || str::EndsWithI(fileName, L\".hdp\") ||\r\n                                                str::EndsWithI(fileName, L\".wdp\") ||\r\n           str::EndsWithI(fileName, L\".webp\")||\r\n           str::EndsWithI(fileName, L\".jp2\");\r\n}\r\n\r\nBaseEngine *CreateFromFile(const WCHAR *fileName)\r\n{\r\n    AssertCrash(ImageEngine::IsSupportedFile(fileName) || ImageEngine::IsSupportedFile(fileName, true));\r\n    return ImageEngineImpl::CreateFromFile(fileName);\r\n}\r\n\r\nBaseEngine *CreateFromStream(IStream *stream)\r\n{\r\n    return ImageEngineImpl::CreateFromStream(stream);\r\n}\r\n\r\n}\r\n\r\n///// ImageDirEngine handles a directory full of image files /////\r\n\r\nclass ImageDirEngineImpl : public ImagesEngine {\r\npublic:\r\n    ImageDirEngineImpl() : fileDPI(96.0f) { }\r\n\r\n    BaseEngine *Clone() override {\r\n        return fileName ? CreateFromFile(fileName) : nullptr;\r\n    }\r\n\r\n    unsigned char *GetFileData(size_t *cbCountOut) override { UNUSED(cbCountOut);  return nullptr; }\r\n    bool SaveFileAs(const WCHAR *copyFileName, bool includeUserAnnots=false) override;\r\n\r\n    WCHAR *GetProperty(DocumentProperty prop) override { UNUSED(prop); return nullptr; }\r\n\r\n    // TODO: is there a better place to expose pageFileNames than through page labels?\r\n    bool HasPageLabels() const override { return true; }\r\n    WCHAR *GetPageLabel(int pageNo) const override;\r\n    int GetPageByLabel(const WCHAR *label) const override;\r\n\r\n    bool HasTocTree() const override { return true; }\r\n    DocTocItem *GetTocTree() override;\r\n\r\n    // TODO: better handle the case where images have different resolutions\r\n    float GetFileDPI() const override { return fileDPI; }\r\n    const WCHAR *GetDefaultFileExt() const override { return L\"\"; }\r\n\r\n    bool SaveFileAsPDF(const WCHAR *pdfFileName, bool includeUserAnnots=false) override;\r\n\r\n    static BaseEngine *CreateFromFile(const WCHAR *fileName);\r\n\r\nprotected:\r\n    bool LoadImageDir(const WCHAR *dirName);\r\n\r\n    virtual Bitmap *LoadBitmap(int pageNo, bool& deleteAfterUse);\r\n    virtual RectD LoadMediabox(int pageNo);\r\n\r\n    WStrVec pageFileNames;\r\n    float fileDPI;\r\n};\r\n\r\nbool ImageDirEngineImpl::LoadImageDir(const WCHAR *dirName)\r\n{\r\n    fileName = str::Dup(dirName);\r\n\r\n    ScopedMem<WCHAR> pattern(path::Join(dirName, L\"*\"));\r\n\r\n    WIN32_FIND_DATA fdata;\r\n    HANDLE hfind = FindFirstFile(pattern, &fdata);\r\n    if (INVALID_HANDLE_VALUE == hfind)\r\n        return false;\r\n\r\n    do {\r\n        if (!(fdata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {\r\n            if (ImageEngine::IsSupportedFile(fdata.cFileName))\r\n                pageFileNames.Append(path::Join(dirName, fdata.cFileName));\r\n        }\r\n    } while (FindNextFile(hfind, &fdata));\r\n    FindClose(hfind);\r\n\r\n    if (pageFileNames.Count() == 0)\r\n        return false;\r\n    pageFileNames.SortNatural();\r\n\r\n    mediaboxes.AppendBlanks(pageFileNames.Count());\r\n\r\n    ImagePage *page = GetPage(1);\r\n    if (page) {\r\n        fileDPI = page->bmp->GetHorizontalResolution();\r\n        DropPage(page);\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nWCHAR *ImageDirEngineImpl::GetPageLabel(int pageNo) const\r\n{\r\n    if (pageNo < 1 || PageCount() < pageNo)\r\n        return BaseEngine::GetPageLabel(pageNo);\r\n\r\n    const WCHAR *fileName = path::GetBaseName(pageFileNames.At(pageNo - 1));\r\n    return str::DupN(fileName, path::GetExt(fileName) - fileName);\r\n}\r\n\r\nint ImageDirEngineImpl::GetPageByLabel(const WCHAR *label) const\r\n{\r\n    for (size_t i = 0; i < pageFileNames.Count(); i++) {\r\n        const WCHAR *fileName = path::GetBaseName(pageFileNames.At(i));\r\n        const WCHAR *fileExt = path::GetExt(fileName);\r\n        if (str::StartsWithI(fileName, label) &&\r\n            (fileName + str::Len(label) == fileExt || fileName[str::Len(label)] == '\\0'))\r\n            return (int)i + 1;\r\n    }\r\n\r\n    return BaseEngine::GetPageByLabel(label);\r\n}\r\n\r\nclass ImageDirTocItem : public DocTocItem {\r\npublic:\r\n    ImageDirTocItem(WCHAR *title, int pageNo) : DocTocItem(title, pageNo) { }\r\n\r\n    virtual PageDestination *GetLink() { return nullptr; }\r\n};\r\n\r\nDocTocItem *ImageDirEngineImpl::GetTocTree()\r\n{\r\n    DocTocItem *root = new ImageDirTocItem(GetPageLabel(1), 1);\r\n    root->id = 1;\r\n    for (int i = 2; i <= PageCount(); i++) {\r\n        DocTocItem *item = new ImageDirTocItem(GetPageLabel(i), i);\r\n        item->id = i;\r\n        root->AddSibling(item);\r\n    }\r\n    return root;\r\n}\r\n\r\nbool ImageDirEngineImpl::SaveFileAs(const WCHAR *copyFileName, bool includeUserAnnots)\r\n{\r\n    UNUSED(includeUserAnnots);\r\n    // only copy the files if the target directory doesn't exist yet\r\n    if (!CreateDirectory(copyFileName, nullptr))\r\n        return false;\r\n    bool ok = true;\r\n    for (size_t i = 0; i < pageFileNames.Count(); i++) {\r\n        const WCHAR *filePathOld = pageFileNames.At(i);\r\n        ScopedMem<WCHAR> filePathNew(path::Join(copyFileName, path::GetBaseName(filePathOld)));\r\n        ok = ok && CopyFile(filePathOld, filePathNew, TRUE);\r\n    }\r\n    return ok;\r\n}\r\n\r\nBitmap *ImageDirEngineImpl::LoadBitmap(int pageNo, bool& deleteAfterUse)\r\n{\r\n    size_t len;\r\n    ScopedMem<char> bmpData(file::ReadAll(pageFileNames.At(pageNo - 1), &len));\r\n    if (bmpData) {\r\n        deleteAfterUse = true;\r\n        return BitmapFromData(bmpData, len);\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nRectD ImageDirEngineImpl::LoadMediabox(int pageNo)\r\n{\r\n    size_t len;\r\n    ScopedMem<char> bmpData(file::ReadAll(pageFileNames.At(pageNo - 1), &len));\r\n    if (bmpData) {\r\n        Size size = BitmapSizeFromData(bmpData, len);\r\n        return RectD(0, 0, size.Width, size.Height);\r\n    }\r\n    return RectD();\r\n}\r\n\r\nbool ImageDirEngineImpl::SaveFileAsPDF(const WCHAR *pdfFileName, bool includeUserAnnots)\r\n{\r\n    UNUSED(includeUserAnnots);\r\n    bool ok = true;\r\n    PdfCreator *c = new PdfCreator();\r\n    for (int i = 1; i <= PageCount() && ok; i++) {\r\n        size_t len;\r\n        ScopedMem<char> data(file::ReadAll(pageFileNames.At(i - 1), &len));\r\n        ok = data && c->AddImagePage(data, len, GetFileDPI());\r\n    }\r\n    ok = ok && c->SaveToFile(pdfFileName);\r\n    delete c;\r\n    return ok;\r\n}\r\n\r\nBaseEngine *ImageDirEngineImpl::CreateFromFile(const WCHAR *fileName)\r\n{\r\n    AssertCrash(dir::Exists(fileName));\r\n    ImageDirEngineImpl *engine = new ImageDirEngineImpl();\r\n    if (!engine->LoadImageDir(fileName)) {\r\n        delete engine;\r\n        return nullptr;\r\n    }\r\n    return engine;\r\n}\r\n\r\nnamespace ImageDirEngine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff)\r\n{\r\n    UNUSED(sniff);\r\n    // whether it actually contains images will be checked in LoadImageDir\r\n    return dir::Exists(fileName);\r\n}\r\n\r\nBaseEngine *CreateFromFile(const WCHAR *fileName)\r\n{\r\n    return ImageDirEngineImpl::CreateFromFile(fileName);\r\n}\r\n\r\n}\r\n\r\n///// CbxEngine handles comic book files (either .cbz, .cbr, .cb7 or .cbt) /////\r\n\r\nenum CbxFormat { Arch_Zip, Arch_Rar, Arch_7z, Arch_Tar };\r\n\r\nclass CbxEngineImpl : public ImagesEngine, public json::ValueVisitor {\r\npublic:\r\n    CbxEngineImpl(ArchFile *arch, CbxFormat cbxFormat) : cbxFile(arch), cbxFormat(cbxFormat) { }\r\n    virtual ~CbxEngineImpl() { delete cbxFile; }\r\n\r\n    virtual BaseEngine *Clone()  override {\r\n        if (fileStream) {\r\n            ScopedComPtr<IStream> stm;\r\n            HRESULT res = fileStream->Clone(&stm);\r\n            if (SUCCEEDED(res))\r\n                return CreateFromStream(stm);\r\n        }\r\n        if (fileName)\r\n            return CreateFromFile(fileName);\r\n        return nullptr;\r\n    }\r\n\r\n    bool SaveFileAsPDF(const WCHAR *pdfFileName, bool includeUserAnnots=false) override;\r\n\r\n    WCHAR *GetProperty(DocumentProperty prop) override;\r\n\r\n    // not using the resolution of the contained images seems to be\r\n    // expected, cf. http://forums.fofou.org/sumatrapdf/topic?id=3183827\r\n    // TODO: return win::GetHwndDpi(HWND_DESKTOP) instead?\r\n    float GetFileDPI() const override { return 96.0f; }\r\n    const WCHAR *GetDefaultFileExt() const override;\r\n\r\n    // json::ValueVisitor\r\n    bool Visit(const char *path, const char *value, json::DataType type) override;\r\n\r\n    static BaseEngine *CreateFromFile(const WCHAR *fileName);\r\n    static BaseEngine *CreateFromStream(IStream *stream);\r\n\r\nprotected:\r\n    virtual Bitmap *LoadBitmap(int pageNo, bool& deleteAfterUse);\r\n    virtual RectD LoadMediabox(int pageNo);\r\n\r\n    bool LoadFromFile(const WCHAR *fileName);\r\n    bool LoadFromStream(IStream *stream);\r\n    bool FinishLoading();\r\n\r\n    char *GetImageData(int pageNo, size_t& len);\r\n    void ParseComicInfoXml(const char *xmlData);\r\n\r\n    // access to cbxFile must be protected after initialization (with cacheAccess)\r\n    ArchFile *cbxFile;\r\n    CbxFormat cbxFormat;\r\n    Vec<size_t> fileIdxs;\r\n\r\n    // extracted metadata\r\n    ScopedMem<WCHAR> propTitle;\r\n    WStrVec propAuthors;\r\n    ScopedMem<WCHAR> propDate;\r\n    ScopedMem<WCHAR> propModDate;\r\n    ScopedMem<WCHAR> propCreator;\r\n    ScopedMem<WCHAR> propSummary;\r\n    // temporary state needed for extracting metadata\r\n    ScopedMem<WCHAR> propAuthorTmp;\r\n};\r\n\r\nbool CbxEngineImpl::LoadFromFile(const WCHAR *file)\r\n{\r\n    if (!file)\r\n        return false;\r\n    fileName = str::Dup(file);\r\n\r\n    return FinishLoading();\r\n}\r\n\r\nbool CbxEngineImpl::LoadFromStream(IStream *stream)\r\n{\r\n    if (!stream)\r\n        return false;\r\n    fileStream = stream;\r\n    fileStream->AddRef();\r\n\r\n    return FinishLoading();\r\n}\r\n\r\nstatic int cmpAscii(const void *a, const void *b)\r\n{\r\n    return wcscmp(*(const WCHAR **)a, *(const WCHAR **)b);\r\n}\r\n\r\nbool CbxEngineImpl::FinishLoading()\r\n{\r\n    CrashIf(!cbxFile);\r\n    if (!cbxFile)\r\n        return false;\r\n\r\n    Vec<const WCHAR *> allFileNames;\r\n    Vec<const WCHAR *> pageFileNames;\r\n\r\n    for (size_t idx = 0; idx < cbxFile->GetFileCount(); idx++) {\r\n        const WCHAR *fileName = cbxFile->GetFileName(idx);\r\n        if (fileName && ImageEngine::IsSupportedFile(fileName) &&\r\n            // OS X occasionally leaves metadata with image extensions\r\n            !str::StartsWith(path::GetBaseName(fileName), L\".\")) {\r\n            allFileNames.Append(fileName);\r\n            pageFileNames.Append(fileName);\r\n        }\r\n        else if (Arch_Zip == cbxFormat && str::StartsWith(fileName, L\"_rels/.rels\")) {\r\n            // bail, if we accidentally try to load an XPS file\r\n            return false;\r\n        }\r\n        else {\r\n            allFileNames.Append(nullptr);\r\n        }\r\n    }\r\n    AssertCrash(allFileNames.Count() == cbxFile->GetFileCount());\r\n\r\n    ScopedMem<char> metadata(cbxFile->GetFileDataByName(L\"ComicInfo.xml\"));\r\n    if (metadata)\r\n        ParseComicInfoXml(metadata);\r\n    metadata.Set(cbxFile->GetComment());\r\n    if (metadata)\r\n        json::Parse(metadata, this);\r\n\r\n    pageFileNames.Sort(cmpAscii);\r\n    for (const WCHAR *fn : pageFileNames) {\r\n        fileIdxs.Append(allFileNames.Find(fn));\r\n    }\r\n    AssertCrash(pageFileNames.Count() == fileIdxs.Count());\r\n    if (fileIdxs.Count() == 0)\r\n        return false;\r\n\r\n    mediaboxes.AppendBlanks(fileIdxs.Count());\r\n\r\n    return true;\r\n}\r\n\r\nchar *CbxEngineImpl::GetImageData(int pageNo, size_t& len)\r\n{\r\n    AssertCrash(1 <= pageNo && pageNo <= PageCount());\r\n    ScopedCritSec scope(&cacheAccess);\r\n    return cbxFile->GetFileDataByIdx(fileIdxs.At(pageNo - 1), &len);\r\n}\r\n\r\nstatic char *GetTextContent(HtmlPullParser& parser)\r\n{\r\n    HtmlToken *tok = parser.Next();\r\n    if (!tok || !tok->IsText())\r\n        return nullptr;\r\n    return ResolveHtmlEntities(tok->s, tok->sLen);\r\n}\r\n\r\n// extract ComicInfo.xml metadata\r\n// cf. http://comicrack.cyolito.com/downloads/comicrack/ComicRack/Support-Files/ComicInfoSchema.zip/\r\nvoid CbxEngineImpl::ParseComicInfoXml(const char *xmlData)\r\n{\r\n    // TODO: convert UTF-16 data and skip UTF-8 BOM\r\n    HtmlPullParser parser(xmlData, str::Len(xmlData));\r\n    HtmlToken *tok;\r\n    while ((tok = parser.Next()) != nullptr && !tok->IsError()) {\r\n        if (!tok->IsStartTag())\r\n            continue;\r\n        if (tok->NameIs(\"Title\")) {\r\n            ScopedMem<char> value(GetTextContent(parser));\r\n            if (value)\r\n                Visit(\"/ComicBookInfo/1.0/title\", value, json::Type_String);\r\n        }\r\n        else if (tok->NameIs(\"Year\")) {\r\n            ScopedMem<char> value(GetTextContent(parser));\r\n            if (value)\r\n                Visit(\"/ComicBookInfo/1.0/publicationYear\", value, json::Type_Number);\r\n        }\r\n        else if (tok->NameIs(\"Month\")) {\r\n            ScopedMem<char> value(GetTextContent(parser));\r\n            if (value)\r\n                Visit(\"/ComicBookInfo/1.0/publicationMonth\", value, json::Type_Number);\r\n        }\r\n        else if (tok->NameIs(\"Summary\")) {\r\n            ScopedMem<char> value(GetTextContent(parser));\r\n            if (value)\r\n                Visit(\"/X-summary\", value, json::Type_String);\r\n        }\r\n        else if (tok->NameIs(\"Writer\")) {\r\n            ScopedMem<char> value(GetTextContent(parser));\r\n            if (value) {\r\n                Visit(\"/ComicBookInfo/1.0/credits[0]/person\", value, json::Type_String);\r\n                Visit(\"/ComicBookInfo/1.0/credits[0]/primary\", \"true\", json::Type_Bool);\r\n            }\r\n        }\r\n        else if (tok->NameIs(\"Penciller\")) {\r\n            ScopedMem<char> value(GetTextContent(parser));\r\n            if (value) {\r\n                Visit(\"/ComicBookInfo/1.0/credits[1]/person\", value, json::Type_String);\r\n                Visit(\"/ComicBookInfo/1.0/credits[1]/primary\", \"true\", json::Type_Bool);\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\n// extract ComicBookInfo metadata\r\n// cf. http://code.google.com/p/comicbookinfo/\r\nbool CbxEngineImpl::Visit(const char *path, const char *value, json::DataType type)\r\n{\r\n    if (json::Type_String == type && str::Eq(path, \"/ComicBookInfo/1.0/title\"))\r\n        propTitle.Set(str::conv::FromUtf8(value));\r\n    else if (json::Type_Number == type && str::Eq(path, \"/ComicBookInfo/1.0/publicationYear\"))\r\n        propDate.Set(str::Format(L\"%s/%d\", propDate ? propDate : L\"\", atoi(value)));\r\n    else if (json::Type_Number == type && str::Eq(path, \"/ComicBookInfo/1.0/publicationMonth\"))\r\n        propDate.Set(str::Format(L\"%d%s\", atoi(value), propDate ? propDate : L\"\"));\r\n    else if (json::Type_String == type && str::Eq(path, \"/appID\"))\r\n        propCreator.Set(str::conv::FromUtf8(value));\r\n    else if (json::Type_String == type && str::Eq(path, \"/lastModified\"))\r\n        propModDate.Set(str::conv::FromUtf8(value));\r\n    else if (json::Type_String == type && str::Eq(path, \"/X-summary\"))\r\n        propSummary.Set(str::conv::FromUtf8(value));\r\n    else if (str::StartsWith(path, \"/ComicBookInfo/1.0/credits[\")) {\r\n        int idx = -1;\r\n        const char *prop = str::Parse(path, \"/ComicBookInfo/1.0/credits[%d]/\", &idx);\r\n        if (prop) {\r\n            if (json::Type_String == type && str::Eq(prop, \"person\"))\r\n                propAuthorTmp.Set(str::conv::FromUtf8(value));\r\n            else if (json::Type_Bool == type && str::Eq(prop, \"primary\") &&\r\n                propAuthorTmp && !propAuthors.Contains(propAuthorTmp)) {\r\n                propAuthors.Append(propAuthorTmp.StealData());\r\n            }\r\n        }\r\n        return true;\r\n    }\r\n    // stop parsing once we have all desired information\r\n    return !propTitle || propAuthors.Count() == 0 || !propCreator ||\r\n           !propDate || str::FindChar(propDate, '/') <= propDate;\r\n}\r\n\r\nbool CbxEngineImpl::SaveFileAsPDF(const WCHAR *pdfFileName, bool includeUserAnnots)\r\n{\r\n    UNUSED(includeUserAnnots);\r\n    bool ok = true;\r\n    PdfCreator *c = new PdfCreator();\r\n    for (int i = 1; i <= PageCount() && ok; i++) {\r\n        size_t len;\r\n        ScopedMem<char> data(GetImageData(i, len));\r\n        ok = data && c->AddImagePage(data, len, GetFileDPI());\r\n    }\r\n    if (ok) {\r\n        c->CopyProperties(this);\r\n        ok = c->SaveToFile(pdfFileName);\r\n    }\r\n    delete c;\r\n    return ok;\r\n}\r\n\r\nWCHAR *CbxEngineImpl::GetProperty(DocumentProperty prop)\r\n{\r\n    switch (prop) {\r\n    case Prop_Title:\r\n        return str::Dup(propTitle);\r\n    case Prop_Author:\r\n        return propAuthors.Count() ? propAuthors.Join(L\", \") : nullptr;\r\n    case Prop_CreationDate:\r\n        return str::Dup(propDate);\r\n    case Prop_ModificationDate:\r\n        return str::Dup(propModDate);\r\n    case Prop_CreatorApp:\r\n        return str::Dup(propCreator);\r\n    // TODO: replace with Prop_Summary\r\n    case Prop_Subject:\r\n        return str::Dup(propSummary);\r\n    default:\r\n        return nullptr;\r\n    }\r\n}\r\n\r\nconst WCHAR *CbxEngineImpl::GetDefaultFileExt() const\r\n{\r\n    switch (cbxFormat) {\r\n    case Arch_Zip: return L\".cbz\";\r\n    case Arch_Rar: return L\".cbr\";\r\n    case Arch_7z:  return L\".cb7\";\r\n    case Arch_Tar: return L\".cbt\";\r\n    default: CrashIf(true); return nullptr;\r\n    }\r\n}\r\n\r\nBitmap *CbxEngineImpl::LoadBitmap(int pageNo, bool& deleteAfterUse)\r\n{\r\n    size_t len;\r\n    ScopedMem<char> bmpData(GetImageData(pageNo, len));\r\n    if (bmpData) {\r\n        deleteAfterUse = true;\r\n        return BitmapFromData(bmpData, len);\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nRectD CbxEngineImpl::LoadMediabox(int pageNo)\r\n{\r\n    // fill the cache to prevent the first few images from being unpacked twice\r\n    ImagePage *page = GetPage(pageNo, MAX_IMAGE_PAGE_CACHE == pageCache.Count());\r\n    if (page) {\r\n        RectD mbox(0, 0, page->bmp->GetWidth(), page->bmp->GetHeight());\r\n        DropPage(page);\r\n        return mbox;\r\n    }\r\n\r\n    size_t len;\r\n    ScopedMem<char> bmpData(GetImageData(pageNo, len));\r\n    if (bmpData) {\r\n        Size size = BitmapSizeFromData(bmpData, len);\r\n        return RectD(0, 0, size.Width, size.Height);\r\n    }\r\n    return RectD();\r\n}\r\n\r\n#define RAR_SIGNATURE       \"Rar!\\x1A\\x07\\x00\"\r\n#define RAR_SIGNATURE_LEN   7\r\n#define RAR5_SIGNATURE      \"Rar!\\x1A\\x07\\x01\\x00\"\r\n#define RAR5_SIGNATURE_LEN  8\r\n\r\nBaseEngine *CbxEngineImpl::CreateFromFile(const WCHAR *fileName)\r\n{\r\n    if (str::EndsWithI(fileName, L\".cbz\") || str::EndsWithI(fileName, L\".zip\") ||\r\n        file::StartsWithN(fileName, \"PK\\x03\\x04\", 4)) {\r\n        CbxEngineImpl *engine = new CbxEngineImpl(new ZipFile(fileName), Arch_Zip);\r\n        if (engine->LoadFromFile(fileName))\r\n            return engine;\r\n        delete engine;\r\n    }\r\n    // also try again if a .cbz or .zip file failed to load, it might\r\n    // just have been misnamed (which apparently happens occasionally)\r\n    if (str::EndsWithI(fileName, L\".cbr\") || str::EndsWithI(fileName, L\".rar\") ||\r\n        file::StartsWithN(fileName, RAR_SIGNATURE, RAR_SIGNATURE_LEN) ||\r\n        file::StartsWithN(fileName, RAR5_SIGNATURE, RAR5_SIGNATURE_LEN)) {\r\n        CbxEngineImpl *engine = new CbxEngineImpl(new RarFile(fileName), Arch_Rar);\r\n        if (engine->LoadFromFile(fileName))\r\n            return engine;\r\n        delete engine;\r\n    }\r\n    if (str::EndsWithI(fileName, L\".cb7\") || str::EndsWithI(fileName, L\".7z\") ||\r\n        file::StartsWith(fileName, \"7z\\xBC\\xAF\\x27\\x1C\")) {\r\n        CbxEngineImpl *engine = new CbxEngineImpl(new _7zFile(fileName), Arch_7z);\r\n        if (engine->LoadFromFile(fileName))\r\n            return engine;\r\n        delete engine;\r\n    }\r\n    if (str::EndsWithI(fileName, L\".cbt\") || str::EndsWithI(fileName, L\".tar\")) {\r\n        CbxEngineImpl *engine = new CbxEngineImpl(new TarFile(fileName), Arch_Tar);\r\n        if (engine->LoadFromFile(fileName))\r\n            return engine;\r\n        delete engine;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nBaseEngine *CbxEngineImpl::CreateFromStream(IStream *stream)\r\n{\r\n    CbxEngineImpl *engine = new CbxEngineImpl(new ZipFile(stream), Arch_Zip);\r\n    if (engine->LoadFromStream(stream))\r\n        return engine;\r\n    delete engine;\r\n\r\n    engine = new CbxEngineImpl(new RarFile(stream), Arch_Rar);\r\n    if (engine->LoadFromStream(stream))\r\n        return engine;\r\n    delete engine;\r\n\r\n    engine = new CbxEngineImpl(new _7zFile(stream), Arch_7z);\r\n    if (engine->LoadFromStream(stream))\r\n        return engine;\r\n    delete engine;\r\n\r\n    engine = new CbxEngineImpl(new TarFile(stream), Arch_Tar);\r\n    if (engine->LoadFromStream(stream))\r\n        return engine;\r\n    delete engine;\r\n\r\n    return nullptr;\r\n}\r\n\r\nnamespace CbxEngine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff)\r\n{\r\n    if (sniff) {\r\n        // we don't also sniff for ZIP files, as these could also\r\n        // be broken XPS files for which failure is expected\r\n        // TODO: add TAR format sniffing\r\n        return file::StartsWithN(fileName, RAR_SIGNATURE, RAR_SIGNATURE_LEN) ||\r\n               file::StartsWithN(fileName, RAR5_SIGNATURE, RAR5_SIGNATURE_LEN) ||\r\n               file::StartsWith(fileName, \"7z\\xBC\\xAF\\x27\\x1C\");\r\n    }\r\n\r\n    return str::EndsWithI(fileName, L\".cbz\") ||\r\n           str::EndsWithI(fileName, L\".cbr\") ||\r\n           str::EndsWithI(fileName, L\".cb7\") ||\r\n           str::EndsWithI(fileName, L\".cbt\") ||\r\n           str::EndsWithI(fileName, L\".zip\") && !str::EndsWithI(fileName, L\".fb2.zip\") ||\r\n           str::EndsWithI(fileName, L\".rar\") ||\r\n           str::EndsWithI(fileName, L\".7z\")  ||\r\n           str::EndsWithI(fileName, L\".tar\");\r\n}\r\n\r\nBaseEngine *CreateFromFile(const WCHAR *fileName)\r\n{\r\n    AssertCrash(CbxEngine::IsSupportedFile(fileName) || CbxEngine::IsSupportedFile(fileName, true));\r\n    return CbxEngineImpl::CreateFromFile(fileName);\r\n}\r\n\r\nBaseEngine *CreateFromStream(IStream *stream)\r\n{\r\n    return CbxEngineImpl::CreateFromStream(stream);\r\n}\r\n\r\n}\r\n"
  },
  {
    "path": "src/ImagesEngine.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nnamespace ImageEngine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff=false);\r\nBaseEngine *CreateFromFile(const WCHAR *fileName);\r\nBaseEngine *CreateFromStream(IStream *stream);\r\n\r\n}\r\n\r\nnamespace ImageDirEngine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff=false);\r\nBaseEngine *CreateFromFile(const WCHAR *fileName);\r\n\r\n}\r\n\r\nnamespace CbxEngine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff=false);\r\nBaseEngine *CreateFromFile(const WCHAR *fileName);\r\nBaseEngine *CreateFromStream(IStream *stream);\r\n\r\n}\r\n"
  },
  {
    "path": "src/Menu.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"CmdLineParser.h\"\r\n#include \"FileUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"Mui.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EngineManager.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"DisplayModel.h\"\r\n#include \"FileHistory.h\"\r\n#include \"GlobalPrefs.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"WindowInfo.h\"\r\n#include \"TabInfo.h\"\r\n#include \"resource.h\"\r\n#include \"ExternalViewers.h\"\r\n#include \"Favorites.h\"\r\n#include \"FileThumbnails.h\"\r\n#include \"Menu.h\"\r\n#include \"Selection.h\"\r\n#include \"SumatraAbout.h\"\r\n#include \"SumatraDialogs.h\"\r\n#include \"Translations.h\"\r\n\r\nvoid MenuUpdateDisplayMode(WindowInfo* win)\r\n{\r\n    bool enabled = win->IsDocLoaded();\r\n    DisplayMode displayMode = enabled ? win->ctrl->GetDisplayMode() : gGlobalPrefs->defaultDisplayModeEnum;\r\n\r\n    for (int id = IDM_VIEW_LAYOUT_FIRST; id <= IDM_VIEW_LAYOUT_LAST; id++) {\r\n        win::menu::SetEnabled(win->menu, id, enabled);\r\n    }\r\n\r\n    UINT id = 0;\r\n    if (IsSingle(displayMode))\r\n        id = IDM_VIEW_SINGLE_PAGE;\r\n    else if (IsFacing(displayMode))\r\n        id = IDM_VIEW_FACING;\r\n    else if (IsBookView(displayMode))\r\n        id = IDM_VIEW_BOOK;\r\n    else\r\n        AssertCrash(!win->ctrl && DM_AUTOMATIC == displayMode);\r\n\r\n    CheckMenuRadioItem(win->menu, IDM_VIEW_LAYOUT_FIRST, IDM_VIEW_LAYOUT_LAST, id, MF_BYCOMMAND);\r\n    win::menu::SetChecked(win->menu, IDM_VIEW_CONTINUOUS, IsContinuous(displayMode));\r\n\r\n    if (win->currentTab && win->currentTab->GetEngineType() == Engine_ComicBook) {\r\n        bool mangaMode = win->AsFixed()->GetDisplayR2L();\r\n        win::menu::SetChecked(win->menu, IDM_VIEW_MANGA_MODE, mangaMode);\r\n    }\r\n}\r\n\r\n//[ ACCESSKEY_GROUP File Menu\r\nstatic MenuDef menuDefFile[] = {\r\n    { _TRN(\"&Open...\\tCtrl+O\"),             IDM_OPEN ,                  MF_REQ_DISK_ACCESS },\r\n    { _TRN(\"&Close\\tCtrl+W\"),               IDM_CLOSE,                  MF_REQ_DISK_ACCESS },\r\n    { _TRN(\"&Save As...\\tCtrl+S\"),          IDM_SAVEAS,                 MF_REQ_DISK_ACCESS },\r\n//[ ACCESSKEY_ALTERNATIVE // only one of these two will be shown\r\n#ifdef ENABLE_SAVE_SHORTCUT\r\n    { _TRN(\"Save S&hortcut...\\tCtrl+Shift+S\"), IDM_SAVEAS_BOOKMARK,     MF_REQ_DISK_ACCESS | MF_NOT_FOR_CHM | MF_NOT_FOR_EBOOK_UI },\r\n//| ACCESSKEY_ALTERNATIVE\r\n#else\r\n    { _TRN(\"Re&name...\\tF2\"),               IDM_RENAME_FILE,            MF_REQ_DISK_ACCESS },\r\n#endif\r\n//] ACCESSKEY_ALTERNATIVE\r\n    { _TRN(\"&Print...\\tCtrl+P\"),            IDM_PRINT,                  MF_REQ_PRINTER_ACCESS | MF_NOT_FOR_EBOOK_UI },\r\n    { SEP_ITEM,                             0,                          MF_REQ_DISK_ACCESS },\r\n//[ ACCESSKEY_ALTERNATIVE // PDF/XPS/CHM specific items are dynamically removed in RebuildFileMenu\r\n    { _TRN(\"Open in &Adobe Reader\"),        IDM_VIEW_WITH_ACROBAT,      MF_REQ_DISK_ACCESS | MF_NOT_FOR_EBOOK_UI },\r\n    { _TRN(\"Open in &Foxit Reader\"),        IDM_VIEW_WITH_FOXIT,        MF_REQ_DISK_ACCESS | MF_NOT_FOR_EBOOK_UI },\r\n    { _TRN(\"Open &in PDF-XChange\"),         IDM_VIEW_WITH_PDF_XCHANGE,  MF_REQ_DISK_ACCESS | MF_NOT_FOR_EBOOK_UI },\r\n//| ACCESSKEY_ALTERNATIVE\r\n    { _TRN(\"Open in &Microsoft XPS-Viewer\"),IDM_VIEW_WITH_XPS_VIEWER,   MF_REQ_DISK_ACCESS | MF_NOT_FOR_EBOOK_UI },\r\n//| ACCESSKEY_ALTERNATIVE\r\n    { _TRN(\"Open in &Microsoft HTML Help\"), IDM_VIEW_WITH_HTML_HELP,    MF_REQ_DISK_ACCESS | MF_NOT_FOR_EBOOK_UI },\r\n//] ACCESSKEY_ALTERNATIVE\r\n    // further entries are added if specified in gGlobalPrefs.vecCommandLine\r\n    { _TRN(\"Send by &E-mail...\"),           IDM_SEND_BY_EMAIL,          MF_REQ_DISK_ACCESS },\r\n    { SEP_ITEM,                             0,                          MF_REQ_DISK_ACCESS },\r\n    { _TRN(\"P&roperties\\tCtrl+D\"),          IDM_PROPERTIES,             0 },\r\n    { SEP_ITEM,                             0,                          0 },\r\n    { _TRN(\"E&xit\\tCtrl+Q\"),                IDM_EXIT,                   0 }\r\n};\r\n//] ACCESSKEY_GROUP File Menu\r\n\r\n//[ ACCESSKEY_GROUP View Menu\r\nstatic MenuDef menuDefView[] = {\r\n    { _TRN(\"&Single Page\\tCtrl+6\"),         IDM_VIEW_SINGLE_PAGE,       MF_NOT_FOR_CHM },\r\n    { _TRN(\"&Facing\\tCtrl+7\"),              IDM_VIEW_FACING,            MF_NOT_FOR_CHM },\r\n    { _TRN(\"&Book View\\tCtrl+8\"),           IDM_VIEW_BOOK,              MF_NOT_FOR_CHM | MF_NOT_FOR_EBOOK_UI },\r\n    { _TRN(\"Show &Pages Continuously\"),     IDM_VIEW_CONTINUOUS,        MF_NOT_FOR_CHM | MF_NOT_FOR_EBOOK_UI },\r\n    // TODO: \"&Inverse Reading Direction\" (since some Mangas might be read left-to-right)?\r\n    { _TRN(\"Man&ga Mode\"),                  IDM_VIEW_MANGA_MODE,        MF_CBX_ONLY },\r\n    { SEP_ITEM,                             0,                          MF_NOT_FOR_CHM },\r\n    { _TRN(\"Rotate &Left\\tCtrl+Shift+-\"),   IDM_VIEW_ROTATE_LEFT,       MF_NOT_FOR_CHM | MF_NOT_FOR_EBOOK_UI },\r\n    { _TRN(\"Rotate &Right\\tCtrl+Shift++\"),  IDM_VIEW_ROTATE_RIGHT,      MF_NOT_FOR_CHM | MF_NOT_FOR_EBOOK_UI },\r\n    { SEP_ITEM,                             0,                          MF_NOT_FOR_CHM | MF_NOT_FOR_EBOOK_UI },\r\n    { _TRN(\"Pr&esentation\\tF5\"),            IDM_VIEW_PRESENTATION_MODE, MF_REQ_FULLSCREEN | MF_NOT_FOR_CHM | MF_NOT_FOR_EBOOK_UI },\r\n    { _TRN(\"F&ullscreen\\tF11\"),             IDM_VIEW_FULLSCREEN,        MF_REQ_FULLSCREEN },\r\n    { SEP_ITEM,                             0,                          MF_REQ_FULLSCREEN },\r\n    { _TRN(\"Book&marks\\tF12\"),              IDM_VIEW_BOOKMARKS,         0 },\r\n    { _TRN(\"Show &Toolbar\"),                IDM_VIEW_SHOW_HIDE_TOOLBAR, MF_NOT_FOR_EBOOK_UI },\r\n    { SEP_ITEM,                             0,                          MF_REQ_ALLOW_COPY | MF_NOT_FOR_EBOOK_UI },\r\n    { _TRN(\"Select &All\\tCtrl+A\"),          IDM_SELECT_ALL,             MF_REQ_ALLOW_COPY | MF_NOT_FOR_EBOOK_UI },\r\n    { _TRN(\"&Copy Selection\\tCtrl+C\"),      IDM_COPY_SELECTION,         MF_REQ_ALLOW_COPY | MF_NOT_FOR_EBOOK_UI },\r\n};\r\n//] ACCESSKEY_GROUP View Menu\r\n\r\n//[ ACCESSKEY_GROUP GoTo Menu\r\nstatic MenuDef menuDefGoTo[] = {\r\n    { _TRN(\"&Next Page\\tRight Arrow\"),      IDM_GOTO_NEXT_PAGE,         0 },\r\n    { _TRN(\"&Previous Page\\tLeft Arrow\"),   IDM_GOTO_PREV_PAGE,         0 },\r\n    { _TRN(\"&First Page\\tHome\"),            IDM_GOTO_FIRST_PAGE,        0 },\r\n    { _TRN(\"&Last Page\\tEnd\"),              IDM_GOTO_LAST_PAGE,         0 },\r\n    { _TRN(\"Pa&ge...\\tCtrl+G\"),             IDM_GOTO_PAGE,              0 },\r\n    { SEP_ITEM,                             0,                          0 },\r\n    { _TRN(\"&Back\\tAlt+Left Arrow\"),        IDM_GOTO_NAV_BACK,          0 },\r\n    { _TRN(\"F&orward\\tAlt+Right Arrow\"),    IDM_GOTO_NAV_FORWARD,       0 },\r\n    { SEP_ITEM,                             0,                          MF_NOT_FOR_EBOOK_UI },\r\n    { _TRN(\"Fin&d...\\tCtrl+F\"),             IDM_FIND_FIRST,             MF_NOT_FOR_EBOOK_UI },\r\n};\r\n//] ACCESSKEY_GROUP GoTo Menu\r\n\r\n//[ ACCESSKEY_GROUP Zoom Menu\r\n// the entire menu is MF_NOT_FOR_EBOOK_UI\r\nstatic MenuDef menuDefZoom[] = {\r\n    { _TRN(\"Fit &Page\\tCtrl+0\"),            IDM_ZOOM_FIT_PAGE,          MF_NOT_FOR_CHM },\r\n    { _TRN(\"&Actual Size\\tCtrl+1\"),         IDM_ZOOM_ACTUAL_SIZE,       MF_NOT_FOR_CHM },\r\n    { _TRN(\"Fit &Width\\tCtrl+2\"),           IDM_ZOOM_FIT_WIDTH,         MF_NOT_FOR_CHM },\r\n    { _TRN(\"Fit &Content\\tCtrl+3\"),         IDM_ZOOM_FIT_CONTENT,       MF_NOT_FOR_CHM },\r\n    { _TRN(\"Custom &Zoom...\\tCtrl+Y\"),      IDM_ZOOM_CUSTOM,            0 },\r\n    { SEP_ITEM,                             0,                          0 },\r\n    { \"6400%\",                              IDM_ZOOM_6400,              MF_NO_TRANSLATE | MF_NOT_FOR_CHM },\r\n    { \"3200%\",                              IDM_ZOOM_3200,              MF_NO_TRANSLATE | MF_NOT_FOR_CHM },\r\n    { \"1600%\",                              IDM_ZOOM_1600,              MF_NO_TRANSLATE | MF_NOT_FOR_CHM },\r\n    { \"800%\",                               IDM_ZOOM_800,               MF_NO_TRANSLATE | MF_NOT_FOR_CHM },\r\n    { \"400%\",                               IDM_ZOOM_400,               MF_NO_TRANSLATE },\r\n    { \"200%\",                               IDM_ZOOM_200,               MF_NO_TRANSLATE },\r\n    { \"150%\",                               IDM_ZOOM_150,               MF_NO_TRANSLATE },\r\n    { \"125%\",                               IDM_ZOOM_125,               MF_NO_TRANSLATE },\r\n    { \"100%\",                               IDM_ZOOM_100,               MF_NO_TRANSLATE },\r\n    { \"50%\",                                IDM_ZOOM_50,                MF_NO_TRANSLATE },\r\n    { \"25%\",                                IDM_ZOOM_25,                MF_NO_TRANSLATE },\r\n    { \"12.5%\",                              IDM_ZOOM_12_5,              MF_NO_TRANSLATE | MF_NOT_FOR_CHM },\r\n    { \"8.33%\",                              IDM_ZOOM_8_33,              MF_NO_TRANSLATE | MF_NOT_FOR_CHM },\r\n};\r\n//] ACCESSKEY_GROUP Zoom Menu\r\n\r\n//[ ACCESSKEY_GROUP Settings Menu\r\nstatic MenuDef menuDefSettings[] = {\r\n    { _TRN(\"Change Language\"),              IDM_CHANGE_LANGUAGE,        0  },\r\n#if 0\r\n    { _TRN(\"Contribute Translation\"),       IDM_CONTRIBUTE_TRANSLATION, MF_REQ_DISK_ACCESS },\r\n    { SEP_ITEM,                             0,                          MF_REQ_DISK_ACCESS },\r\n#endif\r\n    { _TRN(\"&Options...\"),                  IDM_OPTIONS,                MF_REQ_PREF_ACCESS },\r\n    { _TRN(\"&Advanced Options...\"),         IDM_ADVANCED_OPTIONS,       MF_REQ_PREF_ACCESS | MF_REQ_DISK_ACCESS },\r\n};\r\n//] ACCESSKEY_GROUP Settings Menu\r\n\r\n//[ ACCESSKEY_GROUP Favorites Menu\r\n// the entire menu is MF_NOT_FOR_EBOOK_UI\r\nMenuDef menuDefFavorites[] = {\r\n    { _TRN(\"Add to favorites\"),             IDM_FAV_ADD,                0 },\r\n    { _TRN(\"Remove from favorites\"),        IDM_FAV_DEL,                0 },\r\n    { _TRN(\"Show Favorites\"),               IDM_FAV_TOGGLE,             MF_REQ_DISK_ACCESS },\r\n};\r\n//] ACCESSKEY_GROUP Favorites Menu\r\n\r\n//[ ACCESSKEY_GROUP Help Menu\r\nstatic MenuDef menuDefHelp[] = {\r\n    { _TRN(\"Visit &Website\"),               IDM_VISIT_WEBSITE,          MF_REQ_DISK_ACCESS },\r\n    { _TRN(\"&Manual\"),                      IDM_MANUAL,                 MF_REQ_DISK_ACCESS },\r\n    { _TRN(\"Check for &Updates\"),           IDM_CHECK_UPDATE,           MF_REQ_INET_ACCESS },\r\n    { SEP_ITEM,                             0,                          MF_REQ_DISK_ACCESS },\r\n    { _TRN(\"&About\"),                       IDM_ABOUT,                  0 },\r\n};\r\n//] ACCESSKEY_GROUP Help Menu\r\n\r\n#ifdef SHOW_DEBUG_MENU_ITEMS\r\n//[ ACCESSKEY_GROUP Debug Menu\r\nstatic MenuDef menuDefDebug[] = {\r\n    { \"Highlight links\",                    IDM_DEBUG_SHOW_LINKS,       MF_NO_TRANSLATE },\r\n    { \"Toggle ebook UI\",                    IDM_DEBUG_EBOOK_UI,         MF_NO_TRANSLATE },\r\n    { \"Mui debug paint\",                    IDM_DEBUG_MUI,              MF_NO_TRANSLATE },\r\n    { \"Annotation from Selection\",          IDM_DEBUG_ANNOTATION,       MF_NO_TRANSLATE },\r\n    { SEP_ITEM,                             0,                          0 },\r\n    { \"Crash me\",                           IDM_DEBUG_CRASH_ME,         MF_NO_TRANSLATE },\r\n};\r\n//] ACCESSKEY_GROUP Debug Menu\r\n#endif\r\n\r\n//[ ACCESSKEY_GROUP Context Menu (Content)\r\n// the entire menu is MF_NOT_FOR_CHM | MF_NOT_FOR_EBOOK_UI\r\nstatic MenuDef menuDefContext[] = {\r\n    { _TRN(\"&Copy Selection\"),              IDM_COPY_SELECTION,         MF_REQ_ALLOW_COPY },\r\n    { _TRN(\"Copy &Link Address\"),           IDM_COPY_LINK_TARGET,       MF_REQ_ALLOW_COPY },\r\n    { _TRN(\"Copy Co&mment\"),                IDM_COPY_COMMENT,           MF_REQ_ALLOW_COPY },\r\n    { _TRN(\"Copy &Image\"),                  IDM_COPY_IMAGE,             MF_REQ_ALLOW_COPY },\r\n    { SEP_ITEM,                             0,                          MF_REQ_ALLOW_COPY },\r\n    { _TRN(\"Select &All\"),                  IDM_SELECT_ALL,             MF_REQ_ALLOW_COPY },\r\n    { SEP_ITEM,                             0,                          MF_PLUGIN_MODE_ONLY | MF_REQ_ALLOW_COPY },\r\n    { _TRN(\"&Save As...\"),                  IDM_SAVEAS,                 MF_PLUGIN_MODE_ONLY | MF_REQ_DISK_ACCESS },\r\n    { _TRN(\"&Print...\"),                    IDM_PRINT,                  MF_PLUGIN_MODE_ONLY | MF_REQ_PRINTER_ACCESS },\r\n    { _TRN(\"Show &Bookmarks\"),              IDM_VIEW_BOOKMARKS,         MF_PLUGIN_MODE_ONLY },\r\n    { _TRN(\"P&roperties\"),                  IDM_PROPERTIES,             MF_PLUGIN_MODE_ONLY },\r\n};\r\n//] ACCESSKEY_GROUP Context Menu (Content)\r\n\r\n//[ ACCESSKEY_GROUP Context Menu (Start)\r\nstatic MenuDef menuDefContextStart[] = {\r\n    { _TRN(\"&Open Document\"),               IDM_OPEN_SELECTED_DOCUMENT, MF_REQ_DISK_ACCESS },\r\n    { _TRN(\"&Pin Document\"),                IDM_PIN_SELECTED_DOCUMENT,  MF_REQ_DISK_ACCESS | MF_REQ_PREF_ACCESS },\r\n    { SEP_ITEM,                             0,                          MF_REQ_DISK_ACCESS | MF_REQ_PREF_ACCESS },\r\n    { _TRN(\"&Remove Document\"),             IDM_FORGET_SELECTED_DOCUMENT, MF_REQ_DISK_ACCESS | MF_REQ_PREF_ACCESS },\r\n};\r\n//] ACCESSKEY_GROUP Context Menu (Start)\r\n\r\nHMENU BuildMenuFromMenuDef(MenuDef menuDefs[], int menuLen, HMENU menu, int flagFilter)\r\n{\r\n    CrashIf(!menu);\r\n    bool wasSeparator = true;\r\n    if (!gPluginMode)\r\n        flagFilter |= MF_PLUGIN_MODE_ONLY;\r\n\r\n    for (int i = 0; i < menuLen; i++) {\r\n        MenuDef md = menuDefs[i];\r\n        if ((md.flags & flagFilter))\r\n            continue;\r\n        if (!HasPermission(md.flags >> PERM_FLAG_OFFSET))\r\n            continue;\r\n\r\n        if (str::Eq(md.title, SEP_ITEM)) {\r\n            // prevent two consecutive separators\r\n            if (!wasSeparator)\r\n                AppendMenu(menu, MF_SEPARATOR, 0, nullptr);\r\n            wasSeparator = true;\r\n        } else if (MF_NO_TRANSLATE == (md.flags & MF_NO_TRANSLATE)) {\r\n            ScopedMem<WCHAR> tmp(str::conv::FromUtf8(md.title));\r\n            AppendMenu(menu, MF_STRING, (UINT_PTR)md.id, tmp);\r\n            wasSeparator = false;\r\n        } else {\r\n            const WCHAR *tmp = trans::GetTranslation(md.title);\r\n            AppendMenu(menu, MF_STRING, (UINT_PTR)md.id, tmp);\r\n            wasSeparator = false;\r\n        }\r\n    }\r\n\r\n    // TODO: remove trailing separator if there ever is one\r\n    CrashIf(wasSeparator);\r\n    return menu;\r\n}\r\n\r\nstatic void AddFileMenuItem(HMENU menuFile, const WCHAR *filePath, UINT index)\r\n{\r\n    CrashIf(!filePath || !menuFile);\r\n    if (!filePath || !menuFile) return;\r\n\r\n    ScopedMem<WCHAR> menuString;\r\n    const WCHAR *fileName = win::menu::ToSafeString(path::GetBaseName(filePath), menuString);\r\n    int menuIdx = (int) ((index + 1) % 10);\r\n    menuString = str::Format(L\"&%d) %s\", menuIdx, fileName);\r\n    UINT menuId = IDM_FILE_HISTORY_FIRST + index;\r\n    InsertMenu(menuFile, IDM_EXIT, MF_BYCOMMAND | MF_ENABLED | MF_STRING, menuId, menuString);\r\n}\r\n\r\nstatic void AppendRecentFilesToMenu(HMENU m)\r\n{\r\n    if (!HasPermission(Perm_DiskAccess)) return;\r\n\r\n    int i;\r\n    for (i = 0; i < FILE_HISTORY_MAX_RECENT; i++) {\r\n        DisplayState *state = gFileHistory.Get(i);\r\n        if (!state || state->isMissing)\r\n            break;\r\n        AddFileMenuItem(m, state->filePath, i);\r\n    }\r\n\r\n    if (i > 0)\r\n        InsertMenu(m, IDM_EXIT, MF_BYCOMMAND | MF_SEPARATOR, 0, nullptr);\r\n}\r\n\r\nstatic void AppendExternalViewersToMenu(HMENU menuFile, const WCHAR *filePath)\r\n{\r\n    if (0 == gGlobalPrefs->externalViewers->Count())\r\n        return;\r\n    if (!HasPermission(Perm_DiskAccess) || (filePath && !file::Exists(filePath)))\r\n        return;\r\n\r\n    const int maxEntries = IDM_OPEN_WITH_EXTERNAL_LAST - IDM_OPEN_WITH_EXTERNAL_FIRST + 1;\r\n    int count = 0;\r\n    for (size_t i = 0; i < gGlobalPrefs->externalViewers->Count() && count < maxEntries; i++) {\r\n        ExternalViewer *ev = gGlobalPrefs->externalViewers->At(i);\r\n        if (!ev->commandLine)\r\n            continue;\r\n        if (ev->filter && !str::Eq(ev->filter, L\"*\") && !(filePath && path::Match(filePath, ev->filter)))\r\n            continue;\r\n\r\n        ScopedMem<WCHAR> appName;\r\n        const WCHAR *name = ev->name;\r\n        if (str::IsEmpty(name)) {\r\n            WStrVec args;\r\n            ParseCmdLine(ev->commandLine, args, 2);\r\n            if (args.Count() == 0)\r\n                continue;\r\n            appName.Set(str::Dup(path::GetBaseName(args.At(0))));\r\n            *(WCHAR *)path::GetExt(appName) = '\\0';\r\n        }\r\n\r\n        ScopedMem<WCHAR> menuString(str::Format(_TR(\"Open in %s\"), appName ? appName : name));\r\n        UINT menuId = IDM_OPEN_WITH_EXTERNAL_FIRST + count;\r\n        InsertMenu(menuFile, IDM_SEND_BY_EMAIL, MF_BYCOMMAND | MF_ENABLED | MF_STRING, menuId, menuString);\r\n        if (!filePath)\r\n            win::menu::SetEnabled(menuFile, menuId, false);\r\n        count++;\r\n    }\r\n}\r\n\r\nstatic struct {\r\n    unsigned short itemId;\r\n    float zoom;\r\n} gZoomMenuIds[] = {\r\n    { IDM_ZOOM_6400,    6400.0 },\r\n    { IDM_ZOOM_3200,    3200.0 },\r\n    { IDM_ZOOM_1600,    1600.0 },\r\n    { IDM_ZOOM_800,     800.0  },\r\n    { IDM_ZOOM_400,     400.0  },\r\n    { IDM_ZOOM_200,     200.0  },\r\n    { IDM_ZOOM_150,     150.0  },\r\n    { IDM_ZOOM_125,     125.0  },\r\n    { IDM_ZOOM_100,     100.0  },\r\n    { IDM_ZOOM_50,      50.0   },\r\n    { IDM_ZOOM_25,      25.0   },\r\n    { IDM_ZOOM_12_5,    12.5   },\r\n    { IDM_ZOOM_8_33,    8.33f  },\r\n    { IDM_ZOOM_CUSTOM,  0      },\r\n    { IDM_ZOOM_FIT_PAGE,    ZOOM_FIT_PAGE    },\r\n    { IDM_ZOOM_FIT_WIDTH,   ZOOM_FIT_WIDTH   },\r\n    { IDM_ZOOM_FIT_CONTENT, ZOOM_FIT_CONTENT },\r\n    { IDM_ZOOM_ACTUAL_SIZE, ZOOM_ACTUAL_SIZE },\r\n};\r\n\r\nUINT MenuIdFromVirtualZoom(float virtualZoom)\r\n{\r\n    for (int i = 0; i < dimof(gZoomMenuIds); i++) {\r\n        if (virtualZoom == gZoomMenuIds[i].zoom)\r\n            return gZoomMenuIds[i].itemId;\r\n    }\r\n    return IDM_ZOOM_CUSTOM;\r\n}\r\n\r\nstatic float ZoomMenuItemToZoom(UINT menuItemId)\r\n{\r\n    for (int i = 0; i < dimof(gZoomMenuIds); i++) {\r\n        if (menuItemId == gZoomMenuIds[i].itemId)\r\n            return gZoomMenuIds[i].zoom;\r\n    }\r\n    CrashIf(true);\r\n    return 100.0;\r\n}\r\n\r\nstatic void ZoomMenuItemCheck(HMENU m, UINT menuItemId, bool canZoom)\r\n{\r\n    AssertCrash((IDM_ZOOM_FIRST <= menuItemId) && (menuItemId <= IDM_ZOOM_LAST));\r\n\r\n    for (int i = 0; i < dimof(gZoomMenuIds); i++)\r\n        win::menu::SetEnabled(m, gZoomMenuIds[i].itemId, canZoom);\r\n\r\n    if (IDM_ZOOM_100 == menuItemId)\r\n        menuItemId = IDM_ZOOM_ACTUAL_SIZE;\r\n    CheckMenuRadioItem(m, IDM_ZOOM_FIRST, IDM_ZOOM_LAST, menuItemId, MF_BYCOMMAND);\r\n    if (IDM_ZOOM_ACTUAL_SIZE == menuItemId)\r\n        CheckMenuRadioItem(m, IDM_ZOOM_100, IDM_ZOOM_100, IDM_ZOOM_100, MF_BYCOMMAND);\r\n}\r\n\r\nvoid MenuUpdateZoom(WindowInfo* win)\r\n{\r\n    float zoomVirtual = gGlobalPrefs->defaultZoomFloat;\r\n    if (win->IsDocLoaded())\r\n        zoomVirtual = win->ctrl->GetZoomVirtual();\r\n    UINT menuId = MenuIdFromVirtualZoom(zoomVirtual);\r\n    ZoomMenuItemCheck(win->menu, menuId, win->IsDocLoaded());\r\n}\r\n\r\nvoid MenuUpdatePrintItem(WindowInfo* win, HMENU menu, bool disableOnly=false) {\r\n    bool filePrintEnabled = win->IsDocLoaded();\r\n#ifndef DISABLE_DOCUMENT_RESTRICTIONS\r\n    bool filePrintAllowed = !filePrintEnabled || !win->AsFixed() || win->AsFixed()->GetEngine()->AllowsPrinting();\r\n#else\r\n    bool filePrintAllowed = true;\r\n#endif\r\n\r\n    int ix;\r\n    for (ix = 0; ix < dimof(menuDefFile) && menuDefFile[ix].id != IDM_PRINT; ix++);\r\n    if (ix < dimof(menuDefFile)) {\r\n        const WCHAR *printItem = trans::GetTranslation(menuDefFile[ix].title);\r\n        if (!filePrintAllowed)\r\n            printItem = _TR(\"&Print... (denied)\");\r\n        if (!filePrintAllowed || !disableOnly)\r\n            ModifyMenu(menu, IDM_PRINT, MF_BYCOMMAND | MF_STRING, IDM_PRINT, printItem);\r\n    }\r\n\r\n    win::menu::SetEnabled(menu, IDM_PRINT, filePrintEnabled && filePrintAllowed);\r\n}\r\n\r\nstatic bool IsFileCloseMenuEnabled()\r\n{\r\n    for (size_t i = 0; i < gWindows.Count(); i++) {\r\n        if (!gWindows.At(i)->IsAboutWindow())\r\n            return true;\r\n    }\r\n    return false;\r\n}\r\n\r\nvoid MenuUpdateStateForWindow(WindowInfo* win)\r\n{\r\n    // those menu items will be disabled if no document is opened, enabled otherwise\r\n    static UINT menusToDisableIfNoDocument[] = {\r\n        IDM_VIEW_ROTATE_LEFT, IDM_VIEW_ROTATE_RIGHT, IDM_GOTO_NEXT_PAGE, IDM_GOTO_PREV_PAGE,\r\n        IDM_GOTO_FIRST_PAGE, IDM_GOTO_LAST_PAGE, IDM_GOTO_NAV_BACK, IDM_GOTO_NAV_FORWARD,\r\n        IDM_GOTO_PAGE, IDM_FIND_FIRST, IDM_SAVEAS, IDM_SAVEAS_BOOKMARK, IDM_SEND_BY_EMAIL,\r\n        IDM_SELECT_ALL, IDM_COPY_SELECTION, IDM_PROPERTIES, IDM_VIEW_PRESENTATION_MODE,\r\n        IDM_VIEW_WITH_ACROBAT, IDM_VIEW_WITH_FOXIT, IDM_VIEW_WITH_PDF_XCHANGE,\r\n        IDM_RENAME_FILE, IDM_DEBUG_ANNOTATION,\r\n        // IDM_VIEW_WITH_XPS_VIEWER and IDM_VIEW_WITH_HTML_HELP\r\n        // are removed instead of disabled (and can remain enabled\r\n        // for broken XPS/CHM documents)\r\n    };\r\n    // this list coincides with menusToEnableIfBrokenPDF\r\n    static UINT menusToDisableIfDirectory[] = {\r\n        IDM_RENAME_FILE, IDM_SEND_BY_EMAIL,\r\n        IDM_VIEW_WITH_ACROBAT, IDM_VIEW_WITH_FOXIT, IDM_VIEW_WITH_PDF_XCHANGE,\r\n    };\r\n#define menusToEnableIfBrokenPDF menusToDisableIfDirectory\r\n\r\n    TabInfo *tab = win->currentTab;\r\n    // TODO: is this check too expensive?\r\n    bool fileExists = tab && file::Exists(tab->filePath);\r\n\r\n    for (int i = 0; i < dimof(menusToDisableIfNoDocument); i++) {\r\n        UINT id = menusToDisableIfNoDocument[i];\r\n        win::menu::SetEnabled(win->menu, id, win->IsDocLoaded());\r\n    }\r\n\r\n    CrashIf(IsFileCloseMenuEnabled() == win->IsAboutWindow());\r\n    win::menu::SetEnabled(win->menu, IDM_CLOSE, IsFileCloseMenuEnabled());\r\n\r\n    MenuUpdatePrintItem(win, win->menu);\r\n\r\n    bool enabled = win->IsDocLoaded() && tab && tab->ctrl->HasTocTree();\r\n    win::menu::SetEnabled(win->menu, IDM_VIEW_BOOKMARKS, enabled);\r\n\r\n    bool documentSpecific = win->IsDocLoaded();\r\n    bool checked = documentSpecific ? win->tocVisible : gGlobalPrefs->showToc;\r\n    win::menu::SetChecked(win->menu, IDM_VIEW_BOOKMARKS, checked);\r\n\r\n    win::menu::SetChecked(win->menu, IDM_FAV_TOGGLE, gGlobalPrefs->showFavorites);\r\n    win::menu::SetChecked(win->menu, IDM_VIEW_SHOW_HIDE_TOOLBAR, gGlobalPrefs->showToolbar);\r\n    MenuUpdateDisplayMode(win);\r\n    MenuUpdateZoom(win);\r\n\r\n    if (win->IsDocLoaded() && tab) {\r\n        win::menu::SetEnabled(win->menu, IDM_GOTO_NAV_BACK, tab->ctrl->CanNavigate(-1));\r\n        win::menu::SetEnabled(win->menu, IDM_GOTO_NAV_FORWARD, tab->ctrl->CanNavigate(1));\r\n    }\r\n\r\n    if (tab && tab->ctrl && !fileExists && dir::Exists(tab->filePath)) {\r\n        for (int i = 0; i < dimof(menusToDisableIfDirectory); i++) {\r\n            UINT id = menusToDisableIfDirectory[i];\r\n            win::menu::SetEnabled(win->menu, id, false);\r\n        }\r\n    }\r\n    else if (fileExists && CouldBePDFDoc(tab)) {\r\n        for (int i = 0; i < dimof(menusToEnableIfBrokenPDF); i++) {\r\n            UINT id = menusToEnableIfBrokenPDF[i];\r\n            win::menu::SetEnabled(win->menu, id, true);\r\n        }\r\n    }\r\n\r\n    if (tab && tab->AsFixed())\r\n        win::menu::SetEnabled(win->menu, IDM_FIND_FIRST, !tab->AsFixed()->GetEngine()->IsImageCollection());\r\n\r\n    if (win->IsDocLoaded() && !fileExists)\r\n        win::menu::SetEnabled(win->menu, IDM_RENAME_FILE, false);\r\n\r\n#ifdef SHOW_DEBUG_MENU_ITEMS\r\n    win::menu::SetChecked(win->menu, IDM_DEBUG_SHOW_LINKS, gDebugShowLinks);\r\n    win::menu::SetChecked(win->menu, IDM_DEBUG_EBOOK_UI, gGlobalPrefs->ebookUI.useFixedPageUI);\r\n    win::menu::SetChecked(win->menu, IDM_DEBUG_MUI, mui::IsDebugPaint());\r\n    win::menu::SetEnabled(win->menu, IDM_DEBUG_ANNOTATION, tab && tab->selectionOnPage && win->showSelection &&\r\n                                                           tab->AsFixed() && tab->AsFixed()->GetEngine()->SupportsAnnotation());\r\n#endif\r\n}\r\n\r\nvoid OnAboutContextMenu(WindowInfo* win, int x, int y)\r\n{\r\n    if (!HasPermission(Perm_SavePreferences | Perm_DiskAccess) || !gGlobalPrefs->rememberOpenedFiles || !gGlobalPrefs->showStartPage)\r\n        return;\r\n\r\n    const WCHAR *filePath = GetStaticLink(win->staticLinks, x, y);\r\n    if (!filePath || *filePath == '<')\r\n        return;\r\n\r\n    DisplayState *state = gFileHistory.Find(filePath);\r\n    CrashIf(!state);\r\n    if (!state)\r\n        return;\r\n\r\n    HMENU popup = BuildMenuFromMenuDef(menuDefContextStart, dimof(menuDefContextStart), CreatePopupMenu());\r\n    win::menu::SetChecked(popup, IDM_PIN_SELECTED_DOCUMENT, state->isPinned);\r\n    POINT pt = { x, y };\r\n    MapWindowPoints(win->hwndCanvas, HWND_DESKTOP, &pt, 1);\r\n    INT cmd = TrackPopupMenu(popup, TPM_RETURNCMD | TPM_RIGHTBUTTON,\r\n                             pt.x, pt.y, 0, win->hwndFrame, nullptr);\r\n    switch (cmd) {\r\n    case IDM_OPEN_SELECTED_DOCUMENT:\r\n        {\r\n            LoadArgs args(filePath, win);\r\n            LoadDocument(args);\r\n        }\r\n        break;\r\n\r\n    case IDM_PIN_SELECTED_DOCUMENT:\r\n        state->isPinned = !state->isPinned;\r\n        win->DeleteInfotip();\r\n        win->RedrawAll(true);\r\n        break;\r\n\r\n    case IDM_FORGET_SELECTED_DOCUMENT:\r\n        if (state->favorites->Count() > 0) {\r\n            // just hide documents with favorites\r\n            gFileHistory.MarkFileInexistent(state->filePath, true);\r\n        }\r\n        else {\r\n            gFileHistory.Remove(state);\r\n            DeleteDisplayState(state);\r\n        }\r\n        CleanUpThumbnailCache(gFileHistory);\r\n        win->DeleteInfotip();\r\n        win->RedrawAll(true);\r\n        break;\r\n    }\r\n    DestroyMenu(popup);\r\n}\r\n\r\nvoid OnContextMenu(WindowInfo* win, int x, int y)\r\n{\r\n    CrashIf(!win->AsFixed());\r\n    if (!win->AsFixed())\r\n        return;\r\n\r\n    PageElement *pageEl = win->AsFixed()->GetElementAtPos(PointI(x, y));\r\n    ScopedMem<WCHAR> value;\r\n    if (pageEl)\r\n        value.Set(pageEl->GetValue());\r\n\r\n    HMENU popup = BuildMenuFromMenuDef(menuDefContext, dimof(menuDefContext), CreatePopupMenu());\r\n    if (!pageEl || pageEl->GetType() != Element_Link || !value)\r\n        win::menu::Remove(popup, IDM_COPY_LINK_TARGET);\r\n    if (!pageEl || pageEl->GetType() != Element_Comment || !value)\r\n        win::menu::Remove(popup, IDM_COPY_COMMENT);\r\n    if (!pageEl || pageEl->GetType() != Element_Image)\r\n        win::menu::Remove(popup, IDM_COPY_IMAGE);\r\n\r\n    if (!win->currentTab->selectionOnPage)\r\n        win::menu::SetEnabled(popup, IDM_COPY_SELECTION, false);\r\n    MenuUpdatePrintItem(win, popup, true);\r\n    win::menu::SetEnabled(popup, IDM_VIEW_BOOKMARKS, win->ctrl->HasTocTree());\r\n    win::menu::SetChecked(popup, IDM_VIEW_BOOKMARKS, win->tocVisible);\r\n\r\n    POINT pt = { x, y };\r\n    MapWindowPoints(win->hwndCanvas, HWND_DESKTOP, &pt, 1);\r\n    INT cmd = TrackPopupMenu(popup, TPM_RETURNCMD | TPM_RIGHTBUTTON,\r\n                             pt.x, pt.y, 0, win->hwndFrame, nullptr);\r\n    switch (cmd) {\r\n    case IDM_COPY_SELECTION:\r\n    case IDM_SELECT_ALL:\r\n    case IDM_SAVEAS:\r\n    case IDM_PRINT:\r\n    case IDM_VIEW_BOOKMARKS:\r\n    case IDM_PROPERTIES:\r\n        SendMessage(win->hwndFrame, WM_COMMAND, cmd, 0);\r\n        break;\r\n\r\n    case IDM_COPY_LINK_TARGET:\r\n    case IDM_COPY_COMMENT:\r\n        CopyTextToClipboard(value);\r\n        break;\r\n\r\n    case IDM_COPY_IMAGE:\r\n        if (pageEl) {\r\n            RenderedBitmap *bmp = pageEl->GetImage();\r\n            if (bmp)\r\n                CopyImageToClipboard(bmp->GetBitmap(), false);\r\n            delete bmp;\r\n        }\r\n        break;\r\n    }\r\n\r\n    DestroyMenu(popup);\r\n    delete pageEl;\r\n}\r\n\r\n/* Zoom document in window 'hwnd' to zoom level 'zoom'.\r\n   'zoom' is given as a floating-point number, 1.0 is 100%, 2.0 is 200% etc.\r\n*/\r\nvoid OnMenuZoom(WindowInfo* win, UINT menuId)\r\n{\r\n    if (!win->IsDocLoaded())\r\n        return;\r\n\r\n    float zoom = ZoomMenuItemToZoom(menuId);\r\n    ZoomToSelection(win, zoom);\r\n}\r\n\r\nvoid OnMenuCustomZoom(WindowInfo* win)\r\n{\r\n    if (!win->IsDocLoaded() || win->AsEbook())\r\n        return;\r\n\r\n    float zoom = win->ctrl->GetZoomVirtual();\r\n    if (!Dialog_CustomZoom(win->hwndFrame, win->AsChm(), &zoom))\r\n        return;\r\n    ZoomToSelection(win, zoom);\r\n}\r\n\r\nstatic void RebuildFileMenu(TabInfo *tab, HMENU menu)\r\n{\r\n    int filter = 0;\r\n    if (tab && tab->AsChm())\r\n        filter |= MF_NOT_FOR_CHM;\r\n    if (tab && tab->AsEbook())\r\n        filter |= MF_NOT_FOR_EBOOK_UI;\r\n    if (!tab || tab->GetEngineType() != Engine_ComicBook)\r\n        filter |= MF_CBX_ONLY;\r\n\r\n    win::menu::Empty(menu);\r\n    BuildMenuFromMenuDef(menuDefFile, dimof(menuDefFile), menu, filter);\r\n    AppendRecentFilesToMenu(menu);\r\n    AppendExternalViewersToMenu(menu, tab ? tab->filePath.Get() : nullptr);\r\n\r\n    // Suppress menu items that depend on specific software being installed:\r\n    // e-mail client, Adobe Reader, Foxit, PDF-XChange\r\n    // Don't hide items here that won't always be hidden\r\n    // (MenuUpdateStateForWindow() is for that)\r\n    if (!CanSendAsEmailAttachment())\r\n        win::menu::Remove(menu, IDM_SEND_BY_EMAIL);\r\n\r\n    // Also suppress PDF specific items for non-PDF documents\r\n    if (!CouldBePDFDoc(tab) || !CanViewWithAcrobat())\r\n        win::menu::Remove(menu, IDM_VIEW_WITH_ACROBAT);\r\n    if (!CouldBePDFDoc(tab) || !CanViewWithFoxit())\r\n        win::menu::Remove(menu, IDM_VIEW_WITH_FOXIT);\r\n    if (!CouldBePDFDoc(tab) || !CanViewWithPDFXChange())\r\n        win::menu::Remove(menu, IDM_VIEW_WITH_PDF_XCHANGE);\r\n    if (!CanViewWithXPSViewer(tab))\r\n        win::menu::Remove(menu, IDM_VIEW_WITH_XPS_VIEWER);\r\n    if (!CanViewWithHtmlHelp(tab))\r\n        win::menu::Remove(menu, IDM_VIEW_WITH_HTML_HELP);\r\n}\r\n\r\n//[ ACCESSKEY_GROUP Main Menubar\r\nHMENU BuildMenu(WindowInfo *win)\r\n{\r\n    HMENU mainMenu = CreateMenu();\r\n\r\n    int filter = 0;\r\n    if (win->AsChm())\r\n        filter |= MF_NOT_FOR_CHM;\r\n    else if (win->AsEbook())\r\n        filter |= MF_NOT_FOR_EBOOK_UI;\r\n    if (!win->currentTab || win->currentTab->GetEngineType() != Engine_ComicBook)\r\n        filter |= MF_CBX_ONLY;\r\n\r\n    HMENU m = CreateMenu();\r\n    RebuildFileMenu(win->currentTab, m);\r\n    AppendMenu(mainMenu, MF_POPUP | MF_STRING, (UINT_PTR)m, _TR(\"&File\"));\r\n    m = BuildMenuFromMenuDef(menuDefView, dimof(menuDefView), CreateMenu(), filter);\r\n    AppendMenu(mainMenu, MF_POPUP | MF_STRING, (UINT_PTR)m, _TR(\"&View\"));\r\n    m = BuildMenuFromMenuDef(menuDefGoTo, dimof(menuDefGoTo), CreateMenu(), filter);\r\n    AppendMenu(mainMenu, MF_POPUP | MF_STRING, (UINT_PTR)m, _TR(\"&Go To\"));\r\n    if (!win->AsEbook()) {\r\n        m = BuildMenuFromMenuDef(menuDefZoom, dimof(menuDefZoom), CreateMenu(), filter);\r\n        AppendMenu(mainMenu, MF_POPUP | MF_STRING, (UINT_PTR)m, _TR(\"&Zoom\"));\r\n    }\r\n\r\n    // TODO: implement Favorites for ebooks\r\n    if (HasPermission(Perm_SavePreferences) && !win->AsEbook()) {\r\n        // I think it makes sense to disable favorites in restricted mode\r\n        // because they wouldn't be persisted, anyway\r\n        m = BuildMenuFromMenuDef(menuDefFavorites, dimof(menuDefFavorites), CreateMenu());\r\n        RebuildFavMenu(win, m);\r\n        AppendMenu(mainMenu, MF_POPUP | MF_STRING, (UINT_PTR)m, _TR(\"F&avorites\"));\r\n    }\r\n    m = BuildMenuFromMenuDef(menuDefSettings, dimof(menuDefSettings), CreateMenu(), filter);\r\n    AppendMenu(mainMenu, MF_POPUP | MF_STRING, (UINT_PTR)m, _TR(\"&Settings\"));\r\n    m = BuildMenuFromMenuDef(menuDefHelp, dimof(menuDefHelp), CreateMenu(), filter);\r\n    AppendMenu(mainMenu, MF_POPUP | MF_STRING, (UINT_PTR)m, _TR(\"&Help\"));\r\n#if 0\r\n    // cf. MenuBarAsPopupMenu in Caption.cpp\r\n    m = GetSystemMenu(win->hwndFrame, FALSE);\r\n    AppendMenu(mainMenu, MF_POPUP | MF_STRING, (UINT_PTR)m, _TR(\"&Window\"));\r\n#endif\r\n#ifdef SHOW_DEBUG_MENU_ITEMS\r\n    m = BuildMenuFromMenuDef(menuDefDebug, dimof(menuDefDebug), CreateMenu(), filter);\r\n    AppendMenu(mainMenu, MF_POPUP | MF_STRING, (UINT_PTR)m, L\"Debug\");\r\n#endif\r\n\r\n    return mainMenu;\r\n}\r\n//] ACCESSKEY_GROUP Main Menubar\r\n\r\nvoid UpdateMenu(WindowInfo *win, HMENU m)\r\n{\r\n    CrashIf(!win);\r\n    UINT id = GetMenuItemID(m, 0);\r\n    if (id == menuDefFile[0].id)\r\n        RebuildFileMenu(win->currentTab, m);\r\n    else if (id == menuDefFavorites[0].id) {\r\n        win::menu::Empty(m);\r\n        BuildMenuFromMenuDef(menuDefFavorites, dimof(menuDefFavorites), m);\r\n        RebuildFavMenu(win, m);\r\n    }\r\n    MenuUpdateStateForWindow(win);\r\n}\r\n\r\n// show/hide top-level menu bar. This doesn't persist across launches\r\n// so that accidental removal of the menu isn't catastrophic\r\nvoid ShowHideMenuBar(WindowInfo *win, bool showTemporarily)\r\n{\r\n    CrashIf(!win->menu);\r\n    if (win->presentation || win->isFullScreen)\r\n        return;\r\n\r\n    HWND hwnd = win->hwndFrame;\r\n\r\n    if (showTemporarily) {\r\n        SetMenu(hwnd, win->menu);\r\n        return;\r\n    }\r\n\r\n    bool hideMenu = !showTemporarily && GetMenu(hwnd) != nullptr;\r\n    SetMenu(hwnd, hideMenu ? nullptr : win->menu);\r\n    win->isMenuHidden = hideMenu;\r\n}\r\n"
  },
  {
    "path": "src/Menu.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: GPLv3 */\n\n#define SEP_ITEM \"-----\"\n\n// those are defined here instead of resource.h to avoid\n// having them overwritten by dialog editor\n#define IDM_VIEW_LAYOUT_FIRST           IDM_VIEW_SINGLE_PAGE\n#define IDM_VIEW_LAYOUT_LAST            IDM_VIEW_MANGA_MODE\n#define IDM_ZOOM_FIRST                  IDM_ZOOM_FIT_PAGE\n#define IDM_ZOOM_LAST                   IDM_ZOOM_CUSTOM\n// note: IDM_VIEW_SINGLE_PAGE - IDM_VIEW_CONTINUOUS and also\n//       IDM_ZOOM_FIT_PAGE - IDM_ZOOM_CUSTOM must be in a continuous range!\nstatic_assert(IDM_VIEW_LAYOUT_LAST - IDM_VIEW_LAYOUT_FIRST == 4, \"view layout ids are not in a continuous range\");\nstatic_assert(IDM_ZOOM_LAST - IDM_ZOOM_FIRST == 17, \"zoom ids are not in a continuous range\");\n\nstruct MenuDef {\n    const char *title;\n    UINT        id;\n    int         flags;\n};\n\nHMENU BuildMenuFromMenuDef(MenuDef menuDefs[], int menuLen, HMENU menu, int flagFilter=0);\nHMENU BuildMenu(WindowInfo *win);\nvoid  OnContextMenu(WindowInfo* win, int x, int y);\nvoid  OnAboutContextMenu(WindowInfo* win, int x, int y);\nvoid  OnMenuZoom(WindowInfo* win, UINT menuId);\nvoid  OnMenuCustomZoom(WindowInfo* win);\nUINT  MenuIdFromVirtualZoom(float virtualZoom);\nvoid  UpdateMenu(WindowInfo *win, HMENU m);\nvoid  ShowHideMenuBar(WindowInfo *win, bool showTemporarily=false);\n\n/* Define if you want to display an additional debug menu */\n#if defined(DEBUG) && !defined(SHOW_DEBUG_MENU_ITEMS)\n#define SHOW_DEBUG_MENU_ITEMS\n#endif\n"
  },
  {
    "path": "src/MobiDoc.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"BitReader.h\"\r\n#include \"ByteOrderDecoder.h\"\r\n#include \"FileUtil.h\"\r\n#include \"GdiPlusUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"HtmlPullParser.h\"\r\n#include \"PalmDbReader.h\"\r\n#include \"TrivialHtmlParser.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EbookBase.h\"\r\n#include \"MobiDoc.h\"\r\n#include \"DebugLog.h\"\r\n\r\n// Parse mobi format http://wiki.mobileread.com/wiki/MOBI\r\n\r\n#define MOBI_TYPE_CREATOR      \"BOOKMOBI\"\r\n#define PALMDOC_TYPE_CREATOR   \"TEXtREAd\"\r\n#define TEALDOC_TYPE_CREATOR   \"TEXtTlDc\"\r\n\r\n#define COMPRESSION_NONE 1\r\n#define COMPRESSION_PALM 2\r\n#define COMPRESSION_HUFF 17480\r\n#define COMPRESSION_UNSUPPORTED_DRM -1\r\n\r\n#define ENCRYPTION_NONE 0\r\n#define ENCRYPTION_OLD  1\r\n#define ENCRYPTION_NEW  2\r\n\r\nstruct PalmDocHeader\r\n{\r\n    uint16      compressionType;\r\n    uint16      reserved1;\r\n    uint32      uncompressedDocSize;\r\n    uint16      recordsCount;\r\n    uint16      maxRecSize;     // usually (always?) 4096\r\n    // if it's palmdoc, we have currPos, if mobi, encrType/reserved2\r\n    union {\r\n        uint32      currPos;\r\n        struct {\r\n          uint16    encrType;\r\n          uint16    reserved2;\r\n        } mobi;\r\n    };\r\n};\r\n#define kPalmDocHeaderLen 16\r\n\r\n// http://wiki.mobileread.com/wiki/MOBI#PalmDOC_Header\r\nstatic void DecodePalmDocHeader(const char *buf, PalmDocHeader* hdr)\r\n{\r\n    ByteOrderDecoder d(buf, kPalmDocHeaderLen, ByteOrderDecoder::BigEndian);\r\n    hdr->compressionType     = d.UInt16();\r\n    hdr->reserved1           = d.UInt16();\r\n    hdr->uncompressedDocSize = d.UInt32();\r\n    hdr->recordsCount        = d.UInt16();\r\n    hdr->maxRecSize          = d.UInt16();\r\n    hdr->currPos             = d.UInt32();\r\n\r\n    CrashIf(kPalmDocHeaderLen != d.Offset());\r\n}\r\n\r\n// http://wiki.mobileread.com/wiki/MOBI#MOBI_Header\r\n// Note: the real length of MobiHeader is in MobiHeader.hdrLen. This is just\r\n// the size of the struct\r\n#define kMobiHeaderLen 232\r\n// length up to MobiHeader.exthFlags\r\n#define kMobiHeaderMinLen 116\r\nstruct MobiHeader {\r\n    char         id[4];\r\n    uint32       hdrLen;   // including 4 id bytes\r\n    uint32       type;\r\n    uint32       textEncoding;\r\n    uint32       uniqueId;\r\n    uint32       mobiFormatVersion;\r\n    uint32       ortographicIdxRec; // -1 if no ortographics index\r\n    uint32       inflectionIdxRec;\r\n    uint32       namesIdxRec;\r\n    uint32       keysIdxRec;\r\n    uint32       extraIdx0Rec;\r\n    uint32       extraIdx1Rec;\r\n    uint32       extraIdx2Rec;\r\n    uint32       extraIdx3Rec;\r\n    uint32       extraIdx4Rec;\r\n    uint32       extraIdx5Rec;\r\n    uint32       firstNonBookRec;\r\n    uint32       fullNameOffset; // offset in record 0\r\n    uint32       fullNameLen;\r\n    // Low byte is main language e.g. 09 = English,\r\n    // next byte is dialect, 08 = British, 04 = US.\r\n    // Thus US English is 1033, UK English is 2057\r\n    uint32       locale;\r\n    uint32       inputDictLanguage;\r\n    uint32       outputDictLanguage;\r\n    uint32       minRequiredMobiFormatVersion;\r\n    uint32       imageFirstRec;\r\n    uint32       huffmanFirstRec;\r\n    uint32       huffmanRecCount;\r\n    uint32       huffmanTableOffset;\r\n    uint32       huffmanTableLen;\r\n    uint32       exthFlags;  // bitfield. if bit 6 (0x40) is set => there's an EXTH record\r\n    char         reserved1[32];\r\n    uint32       drmOffset; // -1 if no drm info\r\n    uint32       drmEntriesCount; // -1 if no drm\r\n    uint32       drmSize;\r\n    uint32       drmFlags;\r\n    char         reserved2[62];\r\n    // A set of binary flags, some of which indicate extra data at the end of each text block.\r\n    // This only seems to be valid for Mobipocket format version 5 and 6 (and higher?), when\r\n    // the header length is 228 (0xE4) or 232 (0xE8).\r\n    uint16       extraDataFlags;\r\n    int32        indxRec;\r\n};\r\n\r\nstatic_assert(kMobiHeaderLen == sizeof(MobiHeader), \"wrong size of MobiHeader structure\");\r\n\r\n// Uncompress source data compressed with PalmDoc compression into a buffer.\r\n// http://wiki.mobileread.com/wiki/PalmDOC#Format\r\n// Returns false on decoding errors\r\nstatic bool PalmdocUncompress(const char *src, size_t srcLen, str::Str<char>& dst)\r\n{\r\n    const char *srcEnd = src + srcLen;\r\n    while (src < srcEnd) {\r\n        uint8 c = (uint8)*src++;\r\n        if ((c >= 1) && (c <= 8)) {\r\n            if (src + c > srcEnd)\r\n                return false;\r\n            dst.Append(src, c);\r\n            src += c;\r\n        } else if (c < 128) {\r\n            dst.Append((char)c);\r\n        } else if ((c >= 128) && (c < 192)) {\r\n            if (src + 1 > srcEnd)\r\n                return false;\r\n            uint16 c2 = (c << 8) | (uint8)*src++;\r\n            uint16 back = (c2 >> 3) & 0x07ff;\r\n            if (back > dst.Size() || 0 == back)\r\n                return false;\r\n            for (uint8 n = (c2 & 7) + 3; n > 0; n--) {\r\n                dst.Append(dst.At(dst.Size() - back));\r\n            }\r\n        } else if (c >= 192) {\r\n            dst.Append(' ');\r\n            dst.Append((char)(c ^ 0x80));\r\n        }\r\n        else {\r\n            CrashIf(true);\r\n            return false;\r\n        }\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\n#define kHuffHeaderLen 24\r\nstruct HuffHeader\r\n{\r\n    char         id[4];             // \"HUFF\"\r\n    uint32       hdrLen;            // should be 24\r\n    // offset of 256 4-byte elements of cache data, in big endian\r\n    uint32       cacheOffset;       // should be 24 as well\r\n    // offset of 64 4-byte elements of base table data, in big endian\r\n    uint32       baseTableOffset;   // should be 24 + 1024\r\n    // like cacheOffset except data is in little endian\r\n    uint32       cacheLEOffset;     // should be 24 + 1024 + 256\r\n    // like baseTableOffset except data is in little endian\r\n    uint32       baseTableLEOffset; // should be 24 + 1024 + 256 + 1024\r\n};\r\nstatic_assert(kHuffHeaderLen == sizeof(HuffHeader), \"wrong size of HuffHeader structure\");\r\n\r\n#define kCdicHeaderLen 16\r\nstruct CdicHeader\r\n{\r\n    char        id[4];      // \"CIDC\"\r\n    uint32      hdrLen;     // should be 16\r\n    uint32      unknown;\r\n    uint32      codeLen;\r\n};\r\n\r\nstatic_assert(kCdicHeaderLen == sizeof(CdicHeader), \"wrong size of CdicHeader structure\");\r\n\r\n#define kCacheItemCount     256\r\n#define kCacheDataLen      (kCacheItemCount * sizeof(uint32))\r\n#define kBaseTableItemCount 64\r\n#define kBaseTableDataLen  (kBaseTableItemCount * sizeof(uint32))\r\n\r\n#define kHuffRecordMinLen (kHuffHeaderLen +     kCacheDataLen +     kBaseTableDataLen)\r\n#define kHuffRecordLen    (kHuffHeaderLen + 2 * kCacheDataLen + 2 * kBaseTableDataLen)\r\n\r\n#define kCdicsMax 32\r\n\r\nclass HuffDicDecompressor\r\n{\r\n    uint32      cacheTable[kCacheItemCount];\r\n    uint32      baseTable[kBaseTableItemCount];\r\n\r\n    size_t      dictsCount;\r\n    // owned by the creator (in our case: by the PdbReader)\r\n    uint8 *     dicts[kCdicsMax];\r\n    uint32      dictSize[kCdicsMax];\r\n\r\n    uint32      codeLength;\r\n\r\n    Vec<uint32> recursionGuard;\r\n\r\npublic:\r\n    HuffDicDecompressor();\r\n\r\n    bool SetHuffData(uint8 *huffData, size_t huffDataLen);\r\n    bool AddCdicData(uint8 *cdicData, uint32 cdicDataLen);\r\n    bool Decompress(uint8 *src, size_t octets, str::Str<char>& dst);\r\n    bool DecodeOne(uint32 code, str::Str<char>& dst);\r\n};\r\n\r\nHuffDicDecompressor::HuffDicDecompressor() : codeLength(0), dictsCount(0) { }\r\n\r\nbool HuffDicDecompressor::DecodeOne(uint32 code, str::Str<char>& dst)\r\n{\r\n    uint16 dict = (uint16)(code >> codeLength);\r\n    if (dict >= dictsCount) {\r\n        lf(\"invalid dict value\");\r\n        return false;\r\n    }\r\n    code &= ((1 << (codeLength)) - 1);\r\n    uint16 offset = UInt16BE(dicts[dict] + code * 2);\r\n\r\n    if ((uint32)offset + 2 > dictSize[dict]) {\r\n        lf(\"invalid offset\");\r\n        return false;\r\n    }\r\n    uint16 symLen = UInt16BE(dicts[dict] + offset);\r\n    uint8 *p = dicts[dict] + offset + 2;\r\n    if ((uint32)(symLen & 0x7fff) > dictSize[dict] - offset - 2) {\r\n        lf(\"invalid symLen\");\r\n        return false;\r\n    }\r\n\r\n    if (!(symLen & 0x8000)) {\r\n        if (recursionGuard.Contains(code)) {\r\n            lf(\"infinite recursion\");\r\n            return false;\r\n        }\r\n        recursionGuard.Push(code);\r\n        if (!Decompress(p, symLen, dst))\r\n            return false;\r\n        recursionGuard.Pop();\r\n    } else {\r\n        symLen &= 0x7fff;\r\n        if (symLen > 127) {\r\n            lf(\"symLen too big\");\r\n            return false;\r\n        }\r\n        dst.Append((char *)p, symLen);\r\n    }\r\n    return true;\r\n}\r\n\r\nbool HuffDicDecompressor::Decompress(uint8 *src, size_t srcSize, str::Str<char>& dst)\r\n{\r\n    uint32    bitsConsumed = 0;\r\n    uint32    bits = 0;\r\n\r\n    BitReader br(src, srcSize);\r\n\r\n    for (;;) {\r\n        if (bitsConsumed > br.BitsLeft()) {\r\n            lf(\"not enough data\");\r\n            return false;\r\n        }\r\n        br.Eat(bitsConsumed);\r\n        if (0 == br.BitsLeft())\r\n            break;\r\n\r\n        bits = br.Peek(32);\r\n        if (br.BitsLeft() < 8 && 0 == bits)\r\n            break;\r\n        uint32 v = cacheTable[bits >> 24];\r\n        uint32 codeLen = v & 0x1f;\r\n        if (!codeLen) {\r\n            lf(\"corrupted table, zero code len\");\r\n            return false;\r\n        }\r\n        bool isTerminal = (v & 0x80) != 0;\r\n\r\n        uint32 code;\r\n        if (isTerminal) {\r\n            code = (v >> 8) - (bits >> (32 - codeLen));\r\n        } else {\r\n            uint32 baseVal;\r\n            codeLen -= 1;\r\n            do {\r\n                codeLen++;\r\n                if (codeLen > 32) {\r\n                    lf(\"code len > 32 bits\");\r\n                    return false;\r\n                }\r\n                baseVal = baseTable[codeLen * 2 - 2];\r\n                code = (bits >> (32 - codeLen));\r\n            } while (baseVal > code);\r\n            code = baseTable[codeLen * 2 - 1] - (bits >> (32 - codeLen));\r\n        }\r\n\r\n        if (!DecodeOne(code, dst))\r\n            return false;\r\n        bitsConsumed = codeLen;\r\n    }\r\n\r\n    if (br.BitsLeft() > 0 && 0 != bits) {\r\n        lf(\"compressed data left\");\r\n    }\r\n    return true;\r\n}\r\n\r\nbool HuffDicDecompressor::SetHuffData(uint8 *huffData, size_t huffDataLen)\r\n{\r\n    // for now catch cases where we don't have both big endian and little endian\r\n    // versions of the data\r\n    assert(kHuffRecordLen == huffDataLen);\r\n    // but conservatively assume we only need big endian version\r\n    if (huffDataLen < kHuffRecordMinLen)\r\n        return false;\r\n\r\n    ByteOrderDecoder d(huffData, huffDataLen, ByteOrderDecoder::BigEndian);\r\n    HuffHeader huffHdr;\r\n    d.Bytes(huffHdr.id, 4);\r\n    huffHdr.hdrLen = d.UInt32();\r\n    huffHdr.cacheOffset = d.UInt32();\r\n    huffHdr.baseTableOffset = d.UInt32();\r\n    huffHdr.cacheLEOffset = d.UInt32();\r\n    huffHdr.baseTableLEOffset = d.UInt32();\r\n    CrashIf(d.Offset() != kHuffHeaderLen);\r\n\r\n    if (!str::EqN(huffHdr.id, \"HUFF\", 4))\r\n        return false;\r\n\r\n    assert(huffHdr.hdrLen == kHuffHeaderLen);\r\n    if (huffHdr.hdrLen != kHuffHeaderLen)\r\n        return false;\r\n    if (huffHdr.cacheOffset != kHuffHeaderLen)\r\n        return false;\r\n    if (huffHdr.baseTableOffset != huffHdr.cacheOffset + kCacheDataLen)\r\n        return false;\r\n    // we conservatively use the big-endian version of the data,\r\n    for (int i = 0; i < kCacheItemCount; i++) {\r\n        cacheTable[i] = d.UInt32();\r\n    }\r\n    for (int i = 0; i < kBaseTableItemCount; i++) {\r\n        baseTable[i] = d.UInt32();\r\n    }\r\n    CrashIf(d.Offset() != kHuffRecordMinLen);\r\n    return true;\r\n}\r\n\r\nbool HuffDicDecompressor::AddCdicData(uint8 *cdicData, uint32 cdicDataLen)\r\n{\r\n    if (dictsCount >= kCdicsMax)\r\n        return false;\r\n    if (cdicDataLen < kCdicHeaderLen)\r\n        return false;\r\n    if (!str::EqN(\"CDIC\", (char *)cdicData, 4))\r\n        return false;\r\n    uint32 hdrLen = UInt32BE(cdicData + 4);\r\n    uint32 codeLen = UInt32BE(cdicData + 12);\r\n    if (0 == codeLength)\r\n        codeLength = codeLen;\r\n    else {\r\n        assert(codeLen == codeLength);\r\n        codeLength = std::min(codeLength, codeLen);\r\n    }\r\n    assert(hdrLen == kCdicHeaderLen);\r\n    if (hdrLen != kCdicHeaderLen)\r\n        return false;\r\n    uint32 size = cdicDataLen - hdrLen;\r\n\r\n    uint32 maxSize = 1 << codeLength;\r\n    if (maxSize >= size)\r\n        return false;\r\n    dicts[dictsCount] = cdicData + hdrLen;\r\n    dictSize[dictsCount] = size;\r\n    ++dictsCount;\r\n    return true;\r\n}\r\n\r\nstatic void DecodeMobiDocHeader(const char *buf, MobiHeader* hdr)\r\n{\r\n    memset(hdr, 0, sizeof(MobiHeader));\r\n    hdr->drmEntriesCount = (uint32)-1;\r\n\r\n    ByteOrderDecoder d(buf, kMobiHeaderLen, ByteOrderDecoder::BigEndian);\r\n    d.Bytes(hdr->id, 4);\r\n    hdr->hdrLen =               d.UInt32();\r\n    hdr->type =                 d.UInt32();\r\n    hdr->textEncoding =         d.UInt32();\r\n    hdr->uniqueId =             d.UInt32();\r\n    hdr->mobiFormatVersion =    d.UInt32();\r\n    hdr->ortographicIdxRec =    d.UInt32();\r\n    hdr->inflectionIdxRec =     d.UInt32();\r\n    hdr->namesIdxRec =          d.UInt32();\r\n    hdr->keysIdxRec =           d.UInt32();\r\n    hdr->extraIdx0Rec =         d.UInt32();\r\n    hdr->extraIdx1Rec =         d.UInt32();\r\n    hdr->extraIdx2Rec =         d.UInt32();\r\n    hdr->extraIdx3Rec =         d.UInt32();\r\n    hdr->extraIdx4Rec =         d.UInt32();\r\n    hdr->extraIdx5Rec =         d.UInt32();\r\n    hdr->firstNonBookRec =      d.UInt32();\r\n    hdr->fullNameOffset =       d.UInt32();\r\n    hdr->fullNameLen =          d.UInt32();\r\n    hdr->locale =               d.UInt32();\r\n    hdr->inputDictLanguage =    d.UInt32();\r\n    hdr->outputDictLanguage =   d.UInt32();\r\n    hdr->minRequiredMobiFormatVersion = d.UInt32();\r\n    hdr->imageFirstRec =        d.UInt32();\r\n    hdr->huffmanFirstRec =      d.UInt32();\r\n    hdr->huffmanRecCount =      d.UInt32();\r\n    hdr->huffmanTableOffset =   d.UInt32();\r\n    hdr->huffmanTableLen =      d.UInt32();\r\n    hdr->exthFlags =            d.UInt32();\r\n    CrashIf(kMobiHeaderMinLen != d.Offset());\r\n\r\n    if (hdr->hdrLen < kMobiHeaderMinLen + 48)\r\n        return;\r\n\r\n    d.Bytes(hdr->reserved1, 32);\r\n    hdr->drmOffset =            d.UInt32();\r\n    hdr->drmEntriesCount =      d.UInt32();\r\n    hdr->drmSize =              d.UInt32();\r\n    hdr->drmFlags =             d.UInt32();\r\n\r\n    if (hdr->hdrLen < 228) // magic number at which extraDataFlags becomes valid\r\n        return;\r\n\r\n    d.Bytes(hdr->reserved2, 62);\r\n    hdr->extraDataFlags =       d.UInt16();\r\n    if (hdr->hdrLen >= 232) {\r\n        hdr->indxRec =          d.UInt32();\r\n        CrashIf(kMobiHeaderLen != d.Offset());\r\n    }\r\n    else\r\n        CrashIf(kMobiHeaderLen - 4 != d.Offset());\r\n}\r\n\r\nstatic PdbDocType GetPdbDocType(const char *typeCreator)\r\n{\r\n    if (str::Eq(typeCreator, MOBI_TYPE_CREATOR))\r\n        return Pdb_Mobipocket;\r\n    if (str::Eq(typeCreator, PALMDOC_TYPE_CREATOR))\r\n        return Pdb_PalmDoc;\r\n    if (str::Eq(typeCreator, TEALDOC_TYPE_CREATOR))\r\n        return Pdb_TealDoc;\r\n    return Pdb_Unknown;\r\n}\r\n\r\nstatic bool IsValidCompression(int comprType)\r\n{\r\n    return  (COMPRESSION_NONE == comprType) ||\r\n            (COMPRESSION_PALM == comprType) ||\r\n            (COMPRESSION_HUFF == comprType);\r\n}\r\n\r\nMobiDoc::MobiDoc(const WCHAR *filePath) :\r\n    fileName(str::Dup(filePath)), pdbReader(nullptr),\r\n    docType(Pdb_Unknown), docRecCount(0), compressionType(0), docUncompressedSize(0),\r\n    doc(nullptr), multibyte(false), trailersCount(0), imageFirstRec(0), coverImageRec(0),\r\n    imagesCount(0), images(nullptr), huffDic(nullptr), textEncoding(CP_UTF8), docTocIndex((size_t)-1)\r\n{\r\n}\r\n\r\nMobiDoc::~MobiDoc()\r\n{\r\n    free(fileName);\r\n    free(images);\r\n    delete huffDic;\r\n    delete doc;\r\n    delete pdbReader;\r\n    for (size_t i = 0; i < props.Count(); i++) {\r\n        free(props.At(i).value);\r\n    }\r\n}\r\n\r\nbool MobiDoc::ParseHeader()\r\n{\r\n    CrashIf(!pdbReader);\r\n    if (!pdbReader)\r\n        return false;\r\n    if (pdbReader->GetRecordCount() == 0)\r\n        return false;\r\n\r\n    docType = GetPdbDocType(pdbReader->GetDbType());\r\n    if (Pdb_Unknown == docType) {\r\n        lf(\"unknown pdb type/creator\");\r\n        return false;\r\n    }\r\n\r\n    size_t recSize;\r\n    const char *firstRecData = pdbReader->GetRecord(0, &recSize);\r\n    if (!firstRecData || recSize < kPalmDocHeaderLen) {\r\n        lf(\"failed to read record 0\");\r\n        return false;\r\n    }\r\n\r\n    PalmDocHeader palmDocHdr;\r\n    DecodePalmDocHeader(firstRecData, &palmDocHdr);\r\n    compressionType = palmDocHdr.compressionType;\r\n    if (!IsValidCompression(compressionType)) {\r\n        lf(\"unknown compression type\");\r\n        return false;\r\n    }\r\n    if (Pdb_Mobipocket == docType) {\r\n        // TODO: this needs to be surfaced to the client so\r\n        // that we can show the right error message\r\n        if (palmDocHdr.mobi.encrType != ENCRYPTION_NONE) {\r\n            lf(\"encryption is unsupported\");\r\n            return false;\r\n        }\r\n    }\r\n    docRecCount = palmDocHdr.recordsCount;\r\n    if (docRecCount == pdbReader->GetRecordCount()) {\r\n        // catch the case where a broken document has an off-by-one error\r\n        // cf. https://code.google.com/p/sumatrapdf/issues/detail?id=2529\r\n        docRecCount--;\r\n    }\r\n    docUncompressedSize = palmDocHdr.uncompressedDocSize;\r\n\r\n    if (kPalmDocHeaderLen == recSize) {\r\n        // TODO: calculate imageFirstRec / imagesCount\r\n        return Pdb_Mobipocket != docType;\r\n    }\r\n    if (kPalmDocHeaderLen + kMobiHeaderMinLen > recSize) {\r\n        lf(\"not enough data for decoding MobiHeader\");\r\n        // id and hdrLen\r\n        return false;\r\n    }\r\n\r\n    MobiHeader mobiHdr;\r\n    DecodeMobiDocHeader(firstRecData + kPalmDocHeaderLen, &mobiHdr);\r\n    if (!str::EqN(\"MOBI\", mobiHdr.id, 4)) {\r\n        lf(\"MobiHeader.id is not 'MOBI'\");\r\n        return false;\r\n    }\r\n    if (mobiHdr.drmEntriesCount != (uint32)-1) {\r\n        lf(\"DRM is unsupported\");\r\n        // load an empty document and display a warning\r\n        compressionType = COMPRESSION_UNSUPPORTED_DRM;\r\n        Metadata prop;\r\n        prop.prop = Prop_UnsupportedFeatures;\r\n        prop.value = str::conv::ToCodePage(L\"DRM\", mobiHdr.textEncoding);\r\n        props.Append(prop);\r\n    }\r\n    textEncoding = mobiHdr.textEncoding;\r\n\r\n    if (pdbReader->GetRecordCount() > mobiHdr.imageFirstRec) {\r\n        imageFirstRec = mobiHdr.imageFirstRec;\r\n        if (0 == imageFirstRec) {\r\n            // I don't think this should ever happen but I've seen it\r\n            imagesCount = 0;\r\n        } else\r\n            imagesCount = pdbReader->GetRecordCount() - imageFirstRec;\r\n    }\r\n    if (kPalmDocHeaderLen + mobiHdr.hdrLen > recSize) {\r\n        lf(\"MobiHeader too big\");\r\n        return false;\r\n    }\r\n\r\n    bool hasExtraFlags = (mobiHdr.hdrLen >= 228); // TODO: also only if mobiFormatVersion >= 5?\r\n    if (hasExtraFlags) {\r\n        uint16 flags = mobiHdr.extraDataFlags;\r\n        multibyte = ((flags & 1) != 0);\r\n        while (flags > 1) {\r\n            if (0 != (flags & 2))\r\n                trailersCount++;\r\n            flags = flags >> 1;\r\n        }\r\n    }\r\n\r\n    if (COMPRESSION_HUFF == compressionType) {\r\n        CrashIf(Pdb_Mobipocket != docType);\r\n        size_t huffRecSize;\r\n        const char *recData = pdbReader->GetRecord(mobiHdr.huffmanFirstRec, &huffRecSize);\r\n        if (!recData)\r\n            return false;\r\n        assert(nullptr == huffDic);\r\n        huffDic = new HuffDicDecompressor();\r\n        if (!huffDic->SetHuffData((uint8*)recData, huffRecSize))\r\n            return false;\r\n        size_t cdicsCount = mobiHdr.huffmanRecCount - 1;\r\n        assert(cdicsCount <= kCdicsMax);\r\n        if (cdicsCount > kCdicsMax)\r\n            return false;\r\n        for (size_t i = 0; i < cdicsCount; i++) {\r\n            recData = pdbReader->GetRecord(mobiHdr.huffmanFirstRec + 1 + i, &huffRecSize);\r\n            if (!recData)\r\n                return false;\r\n            if (huffRecSize > (uint32)-1)\r\n                return false;\r\n            if (!huffDic->AddCdicData((uint8*)recData, (uint32)huffRecSize))\r\n                return false;\r\n        }\r\n    }\r\n\r\n    if ((mobiHdr.exthFlags & 0x40)) {\r\n        uint32 offset = kPalmDocHeaderLen + mobiHdr.hdrLen;\r\n        DecodeExthHeader(firstRecData + offset, recSize - offset);\r\n    }\r\n\r\n    LoadImages();\r\n    return true;\r\n}\r\n\r\nbool MobiDoc::DecodeExthHeader(const char *data, size_t dataLen)\r\n{\r\n    if (dataLen < 12 || !str::EqN(data, \"EXTH\", 4))\r\n        return false;\r\n\r\n    ByteOrderDecoder d(data, dataLen, ByteOrderDecoder::BigEndian);\r\n    d.Skip(4);\r\n    uint32 hdrLen = d.UInt32();\r\n    uint32 count = d.UInt32();\r\n    if (hdrLen > dataLen)\r\n        return false;\r\n\r\n    for (uint32 i = 0; i < count; i++) {\r\n        if (d.Offset() > dataLen - 8)\r\n            return false;\r\n        uint32 type = d.UInt32();\r\n        uint32 length = d.UInt32();\r\n        if (length < 8 || length > dataLen - d.Offset() + 8)\r\n            return false;\r\n        d.Skip(length - 8);\r\n\r\n        Metadata prop;\r\n        switch (type) {\r\n        case 100: prop.prop = Prop_Author; break;\r\n        case 105: prop.prop = Prop_Subject; break;\r\n        case 106: prop.prop = Prop_CreationDate; break;\r\n        case 108: prop.prop = Prop_CreatorApp; break;\r\n        case 109: prop.prop = Prop_Copyright; break;\r\n        case 201:\r\n            if (length == 12 && imageFirstRec) {\r\n                d.Unskip(4);\r\n                coverImageRec = imageFirstRec + d.UInt32();\r\n            }\r\n            continue;\r\n        case 503: prop.prop = Prop_Title; break;\r\n        default:  continue;\r\n        }\r\n        prop.value = str::DupN(data + d.Offset() - length + 8, length - 8);\r\n        if (prop.value)\r\n            props.Append(prop);\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\n#define EOF_REC   0xe98e0d0a\r\n#define FLIS_REC  0x464c4953 // 'FLIS'\r\n#define FCIS_REC  0x46434953 // 'FCIS\r\n#define FDST_REC  0x46445354 // 'FDST'\r\n#define DATP_REC  0x44415450 // 'DATP'\r\n#define SRCS_REC  0x53524353 // 'SRCS'\r\n#define VIDE_REC  0x56494445 // 'VIDE'\r\n\r\nstatic bool IsEofRecord(uint8 *data, size_t dataLen)\r\n{\r\n    return (4 == dataLen) && (EOF_REC == UInt32BE(data));\r\n}\r\n\r\nstatic bool KnownNonImageRec(uint8 *data, size_t dataLen)\r\n{\r\n    if (dataLen < 4)\r\n        return false;\r\n    uint32 sig = UInt32BE(data);\r\n\r\n    if (FLIS_REC == sig) return true;\r\n    if (FCIS_REC == sig) return true;\r\n    if (FDST_REC == sig) return true;\r\n    if (DATP_REC == sig) return true;\r\n    if (SRCS_REC == sig) return true;\r\n    if (VIDE_REC == sig) return true;\r\n    return false;\r\n}\r\n\r\nstatic bool KnownImageFormat(const char *data, size_t dataLen)\r\n{\r\n    return nullptr != GfxFileExtFromData(data, dataLen);\r\n}\r\n\r\n// return false if we should stop loading images (because we\r\n// encountered eof record or ran out of memory)\r\nbool MobiDoc::LoadImage(size_t imageNo)\r\n{\r\n    size_t imageRec = imageFirstRec + imageNo;\r\n    size_t imgDataLen;\r\n\r\n    const char *imgData = pdbReader->GetRecord(imageRec, &imgDataLen);\r\n    if (!imgData || (0 == imgDataLen))\r\n        return true;\r\n    if (IsEofRecord((uint8 *)imgData, imgDataLen))\r\n        return false;\r\n    if (KnownNonImageRec((uint8 *)imgData, imgDataLen))\r\n        return true;\r\n    if (!KnownImageFormat(imgData, imgDataLen)) {\r\n        lf(\"Unknown image format\");\r\n        return true;\r\n    }\r\n    images[imageNo].data = (char *)imgData;\r\n    if (!images[imageNo].data)\r\n        return false;\r\n    images[imageNo].len = imgDataLen;\r\n    return true;\r\n}\r\n\r\nvoid MobiDoc::LoadImages()\r\n{\r\n    if (0 == imagesCount)\r\n        return;\r\n    images = AllocArray<ImageData>(imagesCount);\r\n    for (size_t i = 0; i < imagesCount; i++) {\r\n        if (!LoadImage(i))\r\n            return;\r\n    }\r\n}\r\n\r\n// imgRecIndex corresponds to recindex attribute of <img> tag\r\n// as far as I can tell, this means: it starts at 1\r\n// returns nullptr if there is no image (e.g. it's not a format we\r\n// recognize)\r\nImageData *MobiDoc::GetImage(size_t imgRecIndex) const\r\n{\r\n    if ((imgRecIndex > imagesCount) || (imgRecIndex < 1))\r\n        return nullptr;\r\n    --imgRecIndex;\r\n    if (!images[imgRecIndex].data || (0 == images[imgRecIndex].len))\r\n        return nullptr;\r\n    return &images[imgRecIndex];\r\n}\r\n\r\nImageData *MobiDoc::GetCoverImage()\r\n{\r\n    if (!coverImageRec || coverImageRec < imageFirstRec)\r\n        return nullptr;\r\n    size_t imageNo = coverImageRec - imageFirstRec;\r\n    if (imageNo >= imagesCount || !images[imageNo].data)\r\n        return nullptr;\r\n    return &images[imageNo];\r\n}\r\n\r\n// each record can have extra data at the end, which we must discard\r\n// returns (size_t)-1 on error\r\nstatic size_t GetRealRecordSize(uint8 *recData, size_t recLen, size_t trailersCount, bool multibyte)\r\n{\r\n    for (size_t i = 0; i < trailersCount; i++) {\r\n        if (recLen < 4)\r\n            return (size_t)-1;\r\n        uint32 n = 0;\r\n        for (size_t j = 0; j < 4; j++) {\r\n            uint8 v = recData[recLen - 4 + j];\r\n            if (0 != (v & 0x80))\r\n                n = 0;\r\n            n = (n << 7) | (v & 0x7f);\r\n        }\r\n        if (n > recLen)\r\n            return (size_t)-1;\r\n        recLen -= n;\r\n    }\r\n\r\n    if (multibyte) {\r\n        if (0 == recLen)\r\n            return (size_t)-1;\r\n        uint8 n = (recData[recLen-1] & 3) + 1;\r\n        if (n > recLen)\r\n            return (size_t)-1;\r\n        recLen -= n;\r\n    }\r\n\r\n    return recLen;\r\n}\r\n\r\n// Load a given record of a document into strOut, uncompressing if necessary.\r\n// Returns false if error.\r\nbool MobiDoc::LoadDocRecordIntoBuffer(size_t recNo, str::Str<char>& strOut)\r\n{\r\n    size_t recSize;\r\n    const char *recData = pdbReader->GetRecord(recNo, &recSize);\r\n    if (nullptr == recData)\r\n        return false;\r\n    recSize = GetRealRecordSize((uint8*)recData, recSize, trailersCount, multibyte);\r\n    if ((size_t)-1 == recSize)\r\n        return false;\r\n\r\n    if (COMPRESSION_NONE == compressionType) {\r\n        strOut.Append(recData, recSize);\r\n        return true;\r\n    }\r\n    if (COMPRESSION_PALM == compressionType) {\r\n        bool ok = PalmdocUncompress(recData, recSize, strOut);\r\n        if (!ok)\r\n            lf(\"PalmDoc decompression failed\");\r\n        return ok;\r\n    }\r\n    if (COMPRESSION_HUFF == compressionType && huffDic) {\r\n        bool ok = huffDic->Decompress((uint8*)recData, recSize, strOut);\r\n        if (!ok)\r\n            lf(\"HuffDic decompression failed\");\r\n        return ok;\r\n    }\r\n    if (COMPRESSION_UNSUPPORTED_DRM == compressionType) {\r\n        // ensure a single blank page\r\n        if (1 == recNo)\r\n            strOut.Append(\"&nbsp;\");\r\n        return true;\r\n    }\r\n\r\n    assert(0);\r\n    return false;\r\n}\r\n\r\nbool MobiDoc::LoadDocument(PdbReader *pdbReader)\r\n{\r\n    this->pdbReader = pdbReader;\r\n    if (!ParseHeader())\r\n        return false;\r\n\r\n    assert(!doc);\r\n    doc = new str::Str<char>(docUncompressedSize);\r\n    for (size_t i = 1; i <= docRecCount; i++) {\r\n        if (!LoadDocRecordIntoBuffer(i, *doc))\r\n            return false;\r\n    }\r\n    // replace unexpected \\0 with spaces\r\n    // cf. https://code.google.com/p/sumatrapdf/issues/detail?id=2529\r\n    char *s = doc->Get(), *end = s + doc->Size();\r\n    while ((s = (char *)memchr(s, '\\0', end - s)) != nullptr) {\r\n        *s = ' ';\r\n    }\r\n    if (textEncoding != CP_UTF8) {\r\n        char *docUtf8 = str::ToMultiByte(doc->Get(), textEncoding, CP_UTF8);\r\n        if (docUtf8) {\r\n            doc->Reset();\r\n            doc->AppendAndFree(docUtf8);\r\n        }\r\n    }\r\n    return true;\r\n}\r\n\r\nchar *MobiDoc::GetHtmlData(size_t& lenOut) const\r\n{\r\n    lenOut = doc->Size();\r\n    return doc->Get();\r\n}\r\n\r\nWCHAR *MobiDoc::GetProperty(DocumentProperty prop)\r\n{\r\n    for (size_t i = 0; i < props.Count(); i++) {\r\n        if (props.At(i).prop == prop)\r\n            return str::conv::FromCodePage(props.At(i).value, textEncoding);\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nbool MobiDoc::HasToc()\r\n{\r\n    if (docTocIndex != (size_t)-1)\r\n        return docTocIndex < doc->Size();\r\n    docTocIndex = doc->Size(); // no ToC\r\n\r\n    // search for <reference type=toc filepos=\\d+/>\r\n    HtmlPullParser parser(doc->Get(), doc->Size());\r\n    HtmlToken *tok;\r\n    while ((tok = parser.Next()) != nullptr && !tok->IsError()) {\r\n        if (!tok->IsStartTag() && !tok->IsEmptyElementEndTag() || !tok->NameIs(\"reference\"))\r\n            continue;\r\n        AttrInfo *attr = tok->GetAttrByName(\"type\");\r\n        if (!attr)\r\n            continue;\r\n        ScopedMem<WCHAR> val(str::conv::FromHtmlUtf8(attr->val, attr->valLen));\r\n        attr = tok->GetAttrByName(\"filepos\");\r\n        if (!str::EqI(val, L\"toc\") || !attr)\r\n            continue;\r\n        val.Set(str::conv::FromHtmlUtf8(attr->val, attr->valLen));\r\n        unsigned int pos;\r\n        if (str::Parse(val, L\"%u%$\", &pos)) {\r\n            docTocIndex = pos;\r\n            return docTocIndex < doc->Size();\r\n        }\r\n    }\r\n    return false;\r\n}\r\n\r\nbool MobiDoc::ParseToc(EbookTocVisitor *visitor)\r\n{\r\n    if (!HasToc())\r\n        return false;\r\n\r\n    ScopedMem<WCHAR> itemText;\r\n    ScopedMem<WCHAR> itemLink;\r\n    int itemLevel = 0;\r\n\r\n    // there doesn't seem to be a standard for Mobi ToCs, so we try to\r\n    // determine the author's intentions by looking at commonly used tags\r\n    HtmlPullParser parser(doc->Get() + docTocIndex, doc->Size() - docTocIndex);\r\n    HtmlToken *tok;\r\n    while ((tok = parser.Next()) != nullptr && !tok->IsError()) {\r\n        if (itemLink && tok->IsText()) {\r\n            ScopedMem<WCHAR> linkText(str::conv::FromHtmlUtf8(tok->s, tok->sLen));\r\n            if (itemText)\r\n                itemText.Set(str::Join(itemText, L\" \", linkText));\r\n            else\r\n                itemText.Set(linkText.StealData());\r\n        }\r\n        else if (!tok->IsTag())\r\n            continue;\r\n        else if (Tag_Mbp_Pagebreak == tok->tag)\r\n            break;\r\n        else if (!itemLink && tok->IsStartTag() && Tag_A == tok->tag) {\r\n            AttrInfo *attr = tok->GetAttrByName(\"filepos\");\r\n            if (!attr)\r\n                attr = tok->GetAttrByName(\"href\");\r\n            if (attr)\r\n                itemLink.Set(str::conv::FromHtmlUtf8(attr->val, attr->valLen));\r\n        }\r\n        else if (itemLink && tok->IsEndTag() && Tag_A == tok->tag) {\r\n            if (!itemText) {\r\n                itemLink.Set(nullptr);\r\n                continue;\r\n            }\r\n            visitor->Visit(itemText, itemLink, itemLevel);\r\n            itemText.Set(nullptr);\r\n            itemLink.Set(nullptr);\r\n        }\r\n        else if (Tag_Blockquote == tok->tag || Tag_Ul == tok->tag || Tag_Ol == tok->tag) {\r\n            if (tok->IsStartTag())\r\n                itemLevel++;\r\n            else if (tok->IsEndTag() && itemLevel > 0)\r\n                itemLevel--;\r\n        }\r\n    }\r\n    return true;\r\n}\r\n\r\nbool MobiDoc::IsSupportedFile(const WCHAR *fileName, bool sniff)\r\n{\r\n    if (sniff) {\r\n        PdbReader pdbReader(fileName);\r\n        // in most cases, we're only interested in Mobipocket files\r\n        // (PalmDoc uses MobiDoc for loading other formats based on MOBI,\r\n        // but implements sniffing itself in PalmDoc::IsSupportedFile)\r\n        return Pdb_Mobipocket == GetPdbDocType(pdbReader.GetDbType());\r\n    }\r\n\r\n    return str::EndsWithI(fileName, L\".mobi\") ||\r\n           str::EndsWithI(fileName, L\".prc\");\r\n}\r\n\r\nMobiDoc *MobiDoc::CreateFromFile(const WCHAR *fileName)\r\n{\r\n    MobiDoc *mb = new MobiDoc(fileName);\r\n    PdbReader *pdbReader = new PdbReader(fileName);\r\n    if (!mb->LoadDocument(pdbReader)) {\r\n        delete mb;\r\n        return nullptr;\r\n    }\r\n    return mb;\r\n}\r\n\r\nMobiDoc *MobiDoc::CreateFromStream(IStream *stream)\r\n{\r\n    MobiDoc *mb = new MobiDoc(nullptr);\r\n    PdbReader *pdbReader = new PdbReader(stream);\r\n    if (!mb->LoadDocument(pdbReader)) {\r\n        delete mb;\r\n        return nullptr;\r\n    }\r\n    return mb;\r\n}\r\n"
  },
  {
    "path": "src/MobiDoc.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nclass HuffDicDecompressor;\r\nclass PdbReader;\r\n\r\nenum PdbDocType { Pdb_Unknown, Pdb_Mobipocket, Pdb_PalmDoc, Pdb_TealDoc };\r\n\r\nclass MobiDoc\r\n{\r\n    WCHAR *             fileName;\r\n\r\n    PdbReader *         pdbReader;\r\n\r\n    PdbDocType          docType;\r\n    size_t              docRecCount;\r\n    int                 compressionType;\r\n    size_t              docUncompressedSize;\r\n    int                 textEncoding;\r\n    size_t              docTocIndex;\r\n\r\n    bool                multibyte;\r\n    size_t              trailersCount;\r\n    size_t              imageFirstRec; // 0 if no images\r\n    size_t              coverImageRec; // 0 if no cover image\r\n\r\n    ImageData *         images;\r\n\r\n    HuffDicDecompressor *huffDic;\r\n\r\n    struct Metadata {\r\n        DocumentProperty    prop;\r\n        char *              value;\r\n    };\r\n    Vec<Metadata>       props;\r\n\r\n    explicit MobiDoc(const WCHAR *filePath);\r\n\r\n    bool    ParseHeader();\r\n    bool    LoadDocRecordIntoBuffer(size_t recNo, str::Str<char>& strOut);\r\n    void    LoadImages();\r\n    bool    LoadImage(size_t imageNo);\r\n    bool    LoadDocument(PdbReader *pdbReader);\r\n    bool    DecodeExthHeader(const char *data, size_t dataLen);\r\n\r\npublic:\r\n    str::Str<char> *    doc;\r\n\r\n    size_t              imagesCount;\r\n\r\n    ~MobiDoc();\r\n\r\n    char *              GetHtmlData(size_t& lenOut) const;\r\n    size_t              GetHtmlDataSize() const { return doc->Size(); }\r\n    ImageData *         GetCoverImage();\r\n    ImageData *         GetImage(size_t imgRecIndex) const;\r\n    const WCHAR *       GetFileName() const { return fileName; }\r\n    WCHAR *             GetProperty(DocumentProperty prop);\r\n    PdbDocType          GetDocType() const { return docType; }\r\n\r\n    bool                HasToc();\r\n    bool                ParseToc(EbookTocVisitor *visitor);\r\n\r\n    static bool         IsSupportedFile(const WCHAR *fileName, bool sniff=false);\r\n    static MobiDoc *    CreateFromFile(const WCHAR *fileName);\r\n    static MobiDoc *    CreateFromStream(IStream *stream);\r\n};\r\n"
  },
  {
    "path": "src/MuPDF_Exports.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// Re-declare variables for when building libmupdf.dll,\r\n// as exporting/importing them prevents sharing of .obj\r\n// files for all files using them - instead we can just\r\n// link this file along libmupdf.lib and omit it when\r\n// building a static SumatraPDF.exe.\r\n\r\nextern \"C\" {\r\n#include <mupdf/fitz/math.h>\r\n}\r\n\r\n// copied from mupdf/source/fitz/geometry.c\r\n\r\nconst fz_matrix fz_identity = { 1, 0, 0, 1, 0, 0 };\r\n\r\nconst fz_rect fz_infinite_rect = { 1, 1, -1, -1 };\r\nconst fz_rect fz_empty_rect = { 0, 0, 0, 0 };\r\nconst fz_rect fz_unit_rect = { 0, 0, 1, 1 };\r\n\r\nconst fz_irect fz_infinite_irect = { 1, 1, -1, -1 };\r\nconst fz_irect fz_empty_irect = { 0, 0, 0, 0 };\r\nconst fz_irect fz_unit_bbox = { 0, 0, 1, 1 };\r\n\r\n// adapted for mupdf/source/fitz/time.c\r\n\r\nextern \"C\" void fz_redirect_dll_io_to_console() { fz_redirect_io_to_console(); }\r\n"
  },
  {
    "path": "src/MuiEbookPageDef.cpp",
    "content": "// DON'T EDIT MANUALLY !!!!\r\n// auto-generated by gen_txt.py !!!!\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"SerializeTxt.h\"\r\n#include \"MuiEbookPageDef.h\"\r\n\r\nusing namespace sertxt;\r\n\r\n#define of offsetof\r\nconst FieldMetadata gEbookPageDefFieldMetadata[] = {\r\n    { of(EbookPageDef, name),  TYPE_STR, 0 },\r\n    { of(EbookPageDef, style), TYPE_STR, 0 },\r\n};\r\n\r\nconst StructMetadata gEbookPageDefMetadata = {\r\n    sizeof(EbookPageDef),\r\n    2,\r\n    \"name\\0style\\0\\0\",\r\n    &gEbookPageDefFieldMetadata[0]\r\n};\r\n\r\n#undef of\r\n\r\n"
  },
  {
    "path": "src/MuiEbookPageDef.h",
    "content": "// DON'T EDIT MANUALLY !!!!\r\n// auto-generated by gen_txt.py !!!!\r\n\r\nusing namespace sertxt;\r\n\r\nstruct EbookPageDef {\r\n    const char *  name;\r\n    const char *  style;\r\n};\r\n\r\nextern const StructMetadata gEbookPageDefMetadata;\r\n\r\ninline EbookPageDef *DeserializeEbookPageDef(char *data, size_t dataLen)\r\n{\r\n    return (EbookPageDef*)Deserialize(data, dataLen, &gEbookPageDefMetadata);\r\n}\r\n\r\ninline EbookPageDef *DeserializeEbookPageDef(TxtNode* root)\r\n{\r\n    return (EbookPageDef*)Deserialize(root, &gEbookPageDefMetadata);\r\n}\r\n\r\ninline uint8_t *SerializeEbookPageDef(EbookPageDef *val, size_t *dataLenOut)\r\n{\r\n    return Serialize((const uint8_t*)val, &gEbookPageDefMetadata, dataLenOut);\r\n}\r\n\r\ninline void FreeEbookPageDef(EbookPageDef *val)\r\n{\r\n    FreeStruct((uint8_t*)val, &gEbookPageDefMetadata);\r\n}\r\n"
  },
  {
    "path": "src/Notifications.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"WinUtil.h\"\r\n// layout controllers\r\nclass BaseEngine;\r\n#include \"TextSelection.h\"\r\n#include \"TextSearch.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"Notifications.h\"\r\n\r\n#define NOTIFICATION_WND_CLASS_NAME L\"SUMATRA_PDF_NOTIFICATION_WINDOW\"\r\n\r\nstatic const int PROGRESS_WIDTH = 188;\r\nstatic const int PROGRESS_HEIGHT = 5;\r\nstatic const int PADDING = 6;\r\n\r\nstatic RectI GetCancelRect(HWND hwnd) {\r\n    return RectI(ClientRect(hwnd).dx - 16 - PADDING, PADDING, 16, 16);\r\n}\r\n\r\nvoid NotificationWnd::CreatePopup(HWND parent, const WCHAR *message)\r\n{\r\n    NONCLIENTMETRICS ncm = { 0 };\r\n    ncm.cbSize = sizeof(ncm);\r\n    SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);\r\n    font = CreateFontIndirect(&ncm.lfMessageFont);\r\n\r\n    HDC hdc = GetDC(parent);\r\n    progressWidth = MulDiv(PROGRESS_WIDTH, GetDeviceCaps(hdc, LOGPIXELSX), USER_DEFAULT_SCREEN_DPI);\r\n    ReleaseDC(parent, hdc);\r\n\r\n    self = CreateWindowEx(WS_EX_TOPMOST, NOTIFICATION_WND_CLASS_NAME, message, WS_CHILD | SS_CENTER,\r\n                          TL_MARGIN, TL_MARGIN, 0, 0,\r\n                          parent, (HMENU)0, GetModuleHandle(nullptr), nullptr);\r\n    SetWindowLongPtr(self, GWLP_USERDATA, (LONG_PTR)this);\r\n    ToggleWindowStyle(self, WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT, IsUIRightToLeft(), GWL_EXSTYLE);\r\n    UpdateWindowPosition(message, true);\r\n    ShowWindow(self, SW_SHOW);\r\n}\r\n\r\nvoid NotificationWnd::UpdateWindowPosition(const WCHAR *message, bool init)\r\n{\r\n    // compute the length of the message\r\n    RECT rc = ClientRect(self).ToRECT();\r\n\r\n    HDC hdc = GetDC(self);\r\n    HFONT oldfnt = SelectFont(hdc, font);\r\n    DrawText(hdc, message, -1, &rc, DT_CALCRECT | DT_SINGLELINE | DT_NOPREFIX);\r\n    SelectFont(hdc, oldfnt);\r\n    ReleaseDC(self, hdc);\r\n\r\n    RectI rectMsg = RectI::FromRECT(rc);\r\n    if (hasCancel) {\r\n        rectMsg.dy = std::max(rectMsg.dy, 16);\r\n        rectMsg.dx += 20;\r\n    }\r\n    rectMsg.Inflate(PADDING, PADDING);\r\n\r\n    if (shrinkLimit < 1.0f) {\r\n        ClientRect rcOrig(self);\r\n        if (rectMsg.dx < rcOrig.dx && rectMsg.dx > rcOrig.dx * shrinkLimit)\r\n            rectMsg.dx = rcOrig.dx;\r\n    }\r\n\r\n    // adjust the window to fit the message (only shrink the window when there's no progress bar)\r\n    if (!hasProgress) {\r\n        SetWindowPos(self, nullptr, 0, 0, rectMsg.dx, rectMsg.dy, SWP_NOMOVE | SWP_NOZORDER);\r\n    } else if (init) {\r\n        RectI rect = WindowRect(self);\r\n        rect.dx = std::max(progressWidth + 2 * PADDING, rectMsg.dx);\r\n        rect.dy = rectMsg.dy + PROGRESS_HEIGHT + PADDING / 2;\r\n        SetWindowPos(self, nullptr, 0, 0, rect.dx, rect.dy, SWP_NOMOVE | SWP_NOZORDER);\r\n    } else if (rectMsg.dx > progressWidth + 2 * PADDING) {\r\n        SetWindowPos(self, nullptr, 0, 0, rectMsg.dx, WindowRect(self).dy, SWP_NOMOVE | SWP_NOZORDER);\r\n    }\r\n\r\n    // move the window to the right for a right-to-left layout\r\n    if (IsUIRightToLeft()) {\r\n        HWND parent = GetParent(self);\r\n        RectI rect = MapRectToWindow(WindowRect(self), HWND_DESKTOP, parent);\r\n        rect.x = WindowRect(parent).dx - rect.dx - TL_MARGIN - GetSystemMetrics(SM_CXVSCROLL);\r\n        SetWindowPos(self, nullptr, rect.x, rect.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER);\r\n    }\r\n}\r\n\r\nvoid NotificationWnd::UpdateProgress(int current, int total)\r\n{\r\n    CrashIf(total <= 0);\r\n    if (total <= 0)\r\n        total = 1;\r\n    progress = limitValue(100 * current / total, 0, 100);\r\n    if (hasProgress && progressMsg) {\r\n        ScopedMem<WCHAR> message(str::Format(progressMsg, current, total));\r\n        UpdateMessage(message);\r\n    }\r\n}\r\n\r\nbool NotificationWnd::WasCanceled()\r\n{\r\n    return isCanceled;\r\n}\r\n\r\nvoid NotificationWnd::UpdateMessage(const WCHAR *message, int timeoutInMS, bool highlight)\r\n{\r\n    win::SetText(self, message);\r\n    this->highlight = highlight;\r\n    if (timeoutInMS)\r\n        hasCancel = false;\r\n    ToggleWindowStyle(self, WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT, IsUIRightToLeft(), GWL_EXSTYLE);\r\n    UpdateWindowPosition(message);\r\n    InvalidateRect(self, nullptr, TRUE);\r\n    if (timeoutInMS)\r\n        SetTimer(self, TIMEOUT_TIMER_ID, timeoutInMS, nullptr);\r\n}\r\n\r\nstatic void NotificationWndOnPaint(HWND hwnd, NotificationWnd *wnd)\r\n{\r\n    PAINTSTRUCT ps;\r\n    HDC hdcWnd = BeginPaint(hwnd, &ps);\r\n\r\n    ClientRect rect(hwnd);\r\n    DoubleBuffer buffer(hwnd, rect);\r\n    HDC hdc = buffer.GetDC();\r\n    HFONT oldfnt = SelectFont(hdc, wnd->font);\r\n\r\n    RECT rTmp = rect.ToRECT();\r\n    DrawFrameControl(hdc, &rTmp, DFC_BUTTON, DFCS_BUTTONPUSH);\r\n    if (wnd->highlight) {\r\n        SetBkMode(hdc, OPAQUE);\r\n        SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT));\r\n        SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT));\r\n    }\r\n    else {\r\n        SetBkMode(hdc, TRANSPARENT);\r\n        SetTextColor(hdc, GetSysColor(COLOR_WINDOWTEXT));\r\n    }\r\n\r\n    rect.Inflate(-PADDING, -PADDING);\r\n    RectI rectMsg = rect;\r\n    if (wnd->hasProgress)\r\n        rectMsg.dy -= PROGRESS_HEIGHT + PADDING / 2;\r\n    if (wnd->hasCancel)\r\n        rectMsg.dx -= 20;\r\n    ScopedMem<WCHAR> text(win::GetText(hwnd));\r\n    rTmp = rectMsg.ToRECT();\r\n    DrawText(hdc, text, -1, &rTmp, DT_SINGLELINE | DT_NOPREFIX);\r\n\r\n    if (wnd->hasCancel) {\r\n        rTmp = GetCancelRect(hwnd).ToRECT();\r\n        DrawFrameControl(hdc, &rTmp, DFC_CAPTION, DFCS_CAPTIONCLOSE | DFCS_FLAT);\r\n    }\r\n\r\n    if (wnd->hasProgress) {\r\n        rect.dx = wnd->progressWidth;\r\n        rect.y += rectMsg.dy + PADDING / 2;\r\n        rect.dy = PROGRESS_HEIGHT;\r\n        PaintRect(hdc, rect);\r\n\r\n        rect.x += 2;\r\n        rect.dx = (wnd->progressWidth - 3) * wnd->progress / 100;\r\n        rect.y += 2;\r\n        rect.dy -= 3;\r\n\r\n        HBRUSH brush = GetStockBrush(BLACK_BRUSH);\r\n        rTmp = rect.ToRECT();\r\n        FillRect(hdc, &rTmp, brush);\r\n        DeleteObject(brush);\r\n    }\r\n\r\n    SelectFont(hdc, oldfnt);\r\n\r\n    buffer.Flush(hdcWnd);\r\n    EndPaint(hwnd, &ps);\r\n}\r\n\r\nLRESULT CALLBACK NotificationWnd::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    NotificationWnd *wnd = (NotificationWnd *)GetWindowLongPtr(hwnd, GWLP_USERDATA);\r\n    if (WM_ERASEBKGND == msg) {\r\n        // do nothing, helps to avoid flicker\r\n        return TRUE;\r\n    }\r\n\r\n    if (WM_TIMER == msg && TIMEOUT_TIMER_ID == wParam) {\r\n        if (wnd->notificationCb)\r\n            wnd->notificationCb->RemoveNotification(wnd);\r\n        else\r\n            delete wnd;\r\n        return 0;\r\n    }\r\n\r\n    if (WM_PAINT == msg && wnd) {\r\n        NotificationWndOnPaint(hwnd, wnd);\r\n        return 0;\r\n    }\r\n\r\n    if (WM_SETCURSOR == msg && wnd->hasCancel) {\r\n        PointI pt;\r\n        if (GetCursorPosInHwnd(hwnd, pt) &&\r\n            GetCancelRect(hwnd).Contains(pt)) {\r\n            SetCursor(IDC_HAND);\r\n            return TRUE;\r\n        }\r\n    }\r\n\r\n    if (WM_LBUTTONUP == msg && wnd->hasCancel) {\r\n        if (GetCancelRect(hwnd).Contains(PointI(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)))) {\r\n            if (wnd->notificationCb)\r\n                wnd->notificationCb->RemoveNotification(wnd);\r\n            else\r\n                delete wnd;\r\n            return 0;\r\n        }\r\n    }\r\n\r\n    return DefWindowProc(hwnd, msg, wParam, lParam);\r\n}\r\n\r\nint Notifications::GetWndX(NotificationWnd *wnd)\r\n{\r\n    RectI rect = WindowRect(wnd->hwnd());\r\n    rect = MapRectToWindow(rect, HWND_DESKTOP, GetParent(wnd->hwnd()));\r\n    return rect.x;\r\n}\r\n\r\nvoid Notifications::MoveBelow(NotificationWnd *fix, NotificationWnd *move)\r\n{\r\n    RectI rect = WindowRect(fix->hwnd());\r\n    rect = MapRectToWindow(rect, HWND_DESKTOP, GetParent(fix->hwnd()));\r\n    SetWindowPos(move->hwnd(), nullptr,\r\n                 GetWndX(move), rect.y + rect.dy + NotificationWnd::TL_MARGIN,\r\n                 0, 0, SWP_NOSIZE | SWP_NOZORDER);\r\n}\r\n\r\nvoid Notifications::Remove(NotificationWnd *wnd)\r\n{\r\n    int ix = wnds.Find(wnd);\r\n    if (ix == -1)\r\n        return;\r\n    wnds.Remove(wnd);\r\n    if (ix == 0 && wnds.Count() > 0) {\r\n        SetWindowPos(wnds.At(0)->hwnd(), nullptr,\r\n                     GetWndX(wnds.At(0)), NotificationWnd::TL_MARGIN,\r\n                     0, 0, SWP_NOSIZE | SWP_NOZORDER);\r\n        ix = 1;\r\n    }\r\n    for (size_t i = ix; i < wnds.Count(); i++) {\r\n        MoveBelow(wnds.At(i - 1), wnds.At(i));\r\n    }\r\n}\r\n\r\nvoid Notifications::Add(NotificationWnd *wnd, int groupId)\r\n{\r\n    if (groupId != 0)\r\n        RemoveForGroup(groupId);\r\n    wnd->groupId = groupId;\r\n\r\n    if (wnds.Count() > 0)\r\n        MoveBelow(wnds.At(wnds.Count() - 1), wnd);\r\n    wnds.Append(wnd);\r\n}\r\n\r\nNotificationWnd *Notifications::GetForGroup(int groupId)\r\n{\r\n    CrashIf(!groupId);\r\n    for (size_t i = 0; i < wnds.Count(); i++) {\r\n        if (wnds.At(i)->groupId == groupId)\r\n            return wnds.At(i);\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nvoid Notifications::RemoveForGroup(int groupId)\r\n{\r\n    CrashIf(!groupId);\r\n    for (size_t i = wnds.Count(); i > 0; i--) {\r\n        if (wnds.At(i - 1)->groupId == groupId)\r\n            RemoveNotification(wnds.At(i - 1));\r\n    }\r\n}\r\n\r\nvoid Notifications::RemoveNotification(NotificationWnd *wnd)\r\n{\r\n    if (Contains(wnd)) {\r\n        Remove(wnd);\r\n        delete wnd;\r\n    }\r\n}\r\n\r\nvoid Notifications::Relayout()\r\n{\r\n    if (wnds.Count() == 0)\r\n        return;\r\n\r\n    HWND hwndCanvas = GetParent(wnds.At(0)->hwnd());\r\n    ClientRect frame(hwndCanvas);\r\n    for (size_t i = 0; i < wnds.Count(); i++) {\r\n        RectI rect = WindowRect(wnds.At(i)->hwnd());\r\n        rect = MapRectToWindow(rect, HWND_DESKTOP, hwndCanvas);\r\n        if (IsUIRightToLeft())\r\n            rect.x = frame.dx - rect.dx - NotificationWnd::TL_MARGIN - GetSystemMetrics(SM_CXVSCROLL);\r\n        else\r\n            rect.x = NotificationWnd::TL_MARGIN;\r\n        SetWindowPos(wnds.At(i)->hwnd(), nullptr, rect.x, rect.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER);\r\n    }\r\n}\r\n\r\nvoid RegisterNotificationsWndClass()\r\n{\r\n    WNDCLASSEX wcex;\r\n    FillWndClassEx(wcex, NOTIFICATION_WND_CLASS_NAME, NotificationWnd::WndProc);\r\n    wcex.hCursor = LoadCursor(nullptr, IDC_APPSTARTING);\r\n    RegisterClassEx(&wcex);\r\n}\r\n"
  },
  {
    "path": "src/Notifications.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: GPLv3 */\n\nclass NotificationWnd;\n\nclass NotificationWndCallback {\npublic:\n    // called after a message has timed out or has been canceled\n    virtual void RemoveNotification(NotificationWnd *wnd) = 0;\n    virtual ~NotificationWndCallback() { }\n};\n\nclass NotificationWnd : public ProgressUpdateUI {\npublic:\n    static const int TIMEOUT_TIMER_ID = 1;\n\n    HWND self;\n    bool hasProgress;\n    bool hasCancel;\n\n    HFONT font;\n    bool  highlight;\n    NotificationWndCallback *notificationCb;\n\n    // only used for progress notifications\n    bool isCanceled;\n    int  progress;\n    int  progressWidth;\n    WCHAR *progressMsg; // must contain two %d (for current and total)\n\n    void CreatePopup(HWND parent, const WCHAR *message);\n    void UpdateWindowPosition(const WCHAR *message, bool init=false);\n\n    static const int TL_MARGIN = 8;\n    int groupId; // for use by Notifications\n\n    // to reduce flicker, we might ask the window to shrink the size less often\n    // (notifcation windows are only shrunken if by less than factor shrinkLimit)\n    float shrinkLimit;\n\n    // Note: in most cases use WindowInfo::ShowNotification()\n    NotificationWnd(HWND parent, const WCHAR *message, int timeoutInMS=0, bool highlight=false, NotificationWndCallback *cb=nullptr) :\n        hasProgress(false), hasCancel(!timeoutInMS), notificationCb(cb), highlight(highlight), progressMsg(nullptr), shrinkLimit(1.0f) {\n        CreatePopup(parent, message);\n        if (timeoutInMS)\n            SetTimer(self, TIMEOUT_TIMER_ID, timeoutInMS, nullptr);\n    }\n\n    NotificationWnd(HWND parent, const WCHAR *message, const WCHAR *progressMsg, NotificationWndCallback *cb=nullptr) :\n        hasProgress(true), hasCancel(true), notificationCb(cb), highlight(false), isCanceled(false), progress(0), shrinkLimit(1.0f) {\n        this->progressMsg = str::Dup(progressMsg);\n        CreatePopup(parent, message);\n    }\n\n    ~NotificationWnd() {\n        DestroyWindow(self);\n        DeleteObject(font);\n        free(progressMsg);\n    }\n\n    HWND hwnd() { return self; }\n\n    void UpdateMessage(const WCHAR *message, int timeoutInMS=0, bool highlight=false);\n    static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);\n\n    // ProgressUpdateUI methods\n    virtual void UpdateProgress(int current, int total);\n    virtual bool WasCanceled();\n};\n\nclass Notifications : public NotificationWndCallback {\n    Vec<NotificationWnd *> wnds;\n\n    int  GetWndX(NotificationWnd *wnd);\n    void MoveBelow(NotificationWnd *fix, NotificationWnd *move);\n    void Remove(NotificationWnd *wnd);\n\npublic:\n    ~Notifications() { DeleteVecMembers(wnds); }\n\n    bool Contains(NotificationWnd *wnd) { return wnds.Contains(wnd); }\n\n    // groupId is used to classify notifications and causes a notification\n    // to replace any other notification of the same group\n    void         Add(NotificationWnd *wnd, int groupId=0);\n    NotificationWnd * GetForGroup(int groupId);\n    void         RemoveForGroup(int groupId);\n    void         Relayout();\n\n    // NotificationWndCallback methods\n    virtual void RemoveNotification(NotificationWnd *wnd);\n};\n\nvoid RegisterNotificationsWndClass();\n"
  },
  {
    "path": "src/PagesLayoutDef.cpp",
    "content": "// DON'T EDIT MANUALLY !!!!\r\n// auto-generated by gen_txt.py !!!!\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"SerializeTxt.h\"\r\n#include \"PagesLayoutDef.h\"\r\n\r\nusing namespace sertxt;\r\n\r\n#define of offsetof\r\nconst FieldMetadata gPagesLayoutDefFieldMetadata[] = {\r\n    { of(PagesLayoutDef, name),    TYPE_STR, 0         },\r\n    { of(PagesLayoutDef, page1),   TYPE_STR, 0         },\r\n    { of(PagesLayoutDef, page2),   TYPE_STR, 0         },\r\n    { of(PagesLayoutDef, spaceDx), TYPE_I32, (uintptr_t)4 },\r\n};\r\n\r\nconst StructMetadata gPagesLayoutDefMetadata = {\r\n    sizeof(PagesLayoutDef),\r\n    4,\r\n    \"name\\0page1\\0page2\\0space_dx\\0\\0\",\r\n    &gPagesLayoutDefFieldMetadata[0]\r\n};\r\n\r\n#undef of\r\n\r\n"
  },
  {
    "path": "src/PagesLayoutDef.h",
    "content": "// DON'T EDIT MANUALLY !!!!\r\n// auto-generated by gen_txt.py !!!!\r\n\r\nusing namespace sertxt;\r\n\r\nstruct PagesLayoutDef {\r\n    const char *  name;\r\n    const char *  page1;\r\n    const char *  page2;\r\n    int32_t       spaceDx;\r\n};\r\n\r\nextern const StructMetadata gPagesLayoutDefMetadata;\r\n\r\ninline PagesLayoutDef *DeserializePagesLayoutDef(char *data, size_t dataLen)\r\n{\r\n    return (PagesLayoutDef*)Deserialize(data, dataLen, &gPagesLayoutDefMetadata);\r\n}\r\n\r\ninline PagesLayoutDef *DeserializePagesLayoutDef(TxtNode* root)\r\n{\r\n    return (PagesLayoutDef*)Deserialize(root, &gPagesLayoutDefMetadata);\r\n}\r\n\r\ninline uint8_t *SerializePagesLayoutDef(PagesLayoutDef *val, size_t *dataLenOut)\r\n{\r\n    return Serialize((const uint8_t*)val, &gPagesLayoutDefMetadata, dataLenOut);\r\n}\r\n\r\ninline void FreePagesLayoutDef(PagesLayoutDef *val)\r\n{\r\n    FreeStruct((uint8_t*)val, &gPagesLayoutDefMetadata);\r\n}\r\n"
  },
  {
    "path": "src/ParseCommandLine.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"CmdLineParser.h\"\r\n#include \"WinUtil.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"GlobalPrefs.h\"\r\n// ui\r\n#include \"ParseCommandLine.h\"\r\n#include \"StressTesting.h\"\r\n\r\n#ifdef DEBUG\r\nstatic void EnumeratePrinters() {\r\n    str::Str<WCHAR> output;\r\n\r\n    PRINTER_INFO_5* info5Arr = nullptr;\r\n    DWORD bufSize = 0, printersCount;\r\n    bool fOk = EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, nullptr, 5, nullptr,\r\n                            bufSize, &bufSize, &printersCount);\r\n    if (fOk || GetLastError() == ERROR_INSUFFICIENT_BUFFER) {\r\n        info5Arr = (PRINTER_INFO_5*)malloc(bufSize);\r\n        fOk = EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, nullptr, 5,\r\n                           (LPBYTE)info5Arr, bufSize, &bufSize, &printersCount);\r\n    }\r\n    if (!fOk || !info5Arr) {\r\n        output.AppendFmt(L\"Call to EnumPrinters failed with error %#x\", GetLastError());\r\n        MessageBox(nullptr, output.Get(), L\"SumatraPDF - EnumeratePrinters\", MB_OK | MB_ICONERROR);\r\n        free(info5Arr);\r\n        return;\r\n    }\r\n    ScopedMem<WCHAR> defName(GetDefaultPrinterName());\r\n    for (DWORD i = 0; i < printersCount; i++) {\r\n        const WCHAR* printerName = info5Arr[i].pPrinterName;\r\n        const WCHAR* printerPort = info5Arr[i].pPortName;\r\n        bool fDefault = str::Eq(defName, printerName);\r\n        output.AppendFmt(L\"%s (Port: %s, attributes: %#x%s)\\n\", printerName, printerPort,\r\n                         info5Arr[i].Attributes, fDefault ? L\", default\" : L\"\");\r\n\r\n        DWORD bins = DeviceCapabilities(printerName, printerPort, DC_BINS, nullptr, nullptr);\r\n        DWORD binNames =\r\n            DeviceCapabilities(printerName, printerPort, DC_BINNAMES, nullptr, nullptr);\r\n        CrashIf(bins != binNames);\r\n        if (0 == bins) {\r\n            output.Append(L\" - no paper bins available\\n\");\r\n        } else if (bins == (DWORD)-1) {\r\n            output.AppendFmt(L\" - Call to DeviceCapabilities failed with error %#x\\n\",\r\n                             GetLastError());\r\n        } else {\r\n            ScopedMem<WORD> binValues(AllocArray<WORD>(bins));\r\n            DeviceCapabilities(printerName, printerPort, DC_BINS, (WCHAR*)binValues.Get(), nullptr);\r\n            ScopedMem<WCHAR> binNameValues(AllocArray<WCHAR>(24 * binNames));\r\n            DeviceCapabilities(printerName, printerPort, DC_BINNAMES, binNameValues.Get(), nullptr);\r\n            for (DWORD j = 0; j < bins; j++) {\r\n                output.AppendFmt(L\" - '%s' (%d)\\n\", binNameValues.Get() + 24 * j,\r\n                                 binValues.Get()[j]);\r\n            }\r\n        }\r\n    }\r\n    free(info5Arr);\r\n    MessageBox(nullptr, output.Get(), L\"SumatraPDF - EnumeratePrinters\",\r\n               MB_OK | MB_ICONINFORMATION);\r\n}\r\n#endif\r\n\r\n/* Parse 'txt' as hex color and return the result in 'destColor' */\r\nvoid ParseColor(COLORREF* destColor, const WCHAR* txt) {\r\n    if (!destColor)\r\n        return;\r\n    if (str::StartsWith(txt, L\"0x\"))\r\n        txt += 2;\r\n    else if (str::StartsWith(txt, L\"#\"))\r\n        txt += 1;\r\n\r\n    unsigned int r, g, b;\r\n    if (str::Parse(txt, L\"%2x%2x%2x%$\", &r, &g, &b))\r\n        *destColor = RGB(r, g, b);\r\n}\r\n\r\n// parses a list of page ranges such as 1,3-5,7- (i..e all but pages 2 and 6)\r\n// into an interable list (returns nullptr on parsing errors)\r\n// caller must delete the result\r\nbool ParsePageRanges(const WCHAR* ranges, Vec<PageRange>& result) {\r\n    if (!ranges)\r\n        return false;\r\n\r\n    WStrVec rangeList;\r\n    rangeList.Split(ranges, L\",\", true);\r\n    rangeList.SortNatural();\r\n\r\n    for (size_t i = 0; i < rangeList.Count(); i++) {\r\n        int start, end;\r\n        if (str::Parse(rangeList.At(i), L\"%d-%d%$\", &start, &end) && 0 < start && start <= end)\r\n            result.Append(PageRange(start, end));\r\n        else if (str::Parse(rangeList.At(i), L\"%d-%$\", &start) && 0 < start)\r\n            result.Append(PageRange(start, INT_MAX));\r\n        else if (str::Parse(rangeList.At(i), L\"%d%$\", &start) && 0 < start)\r\n            result.Append(PageRange(start, start));\r\n        else\r\n            return false;\r\n    }\r\n\r\n    return result.Count() > 0;\r\n}\r\n\r\n// a valid page range is a non-empty, comma separated list of either\r\n// single page (\"3\") numbers, closed intervals \"2-4\" or intervals\r\n// unlimited to the right (\"5-\")\r\nbool IsValidPageRange(const WCHAR* ranges) {\r\n    Vec<PageRange> rangeList;\r\n    return ParsePageRanges(ranges, rangeList);\r\n}\r\n\r\n// <s> can be:\r\n// * \"loadonly\"\r\n// * description of page ranges e.g. \"1\", \"1-5\", \"2-3,6,8-10\"\r\nbool IsBenchPagesInfo(const WCHAR* s) {\r\n    return str::EqI(s, L\"loadonly\") || IsValidPageRange(s);\r\n}\r\n\r\n// -view [continuous][singlepage|facing|bookview]\r\nstatic void ParseViewMode(DisplayMode* mode, const WCHAR* txt) {\r\n    *mode = prefs::conv::ToDisplayMode(txt, DM_AUTOMATIC);\r\n}\r\n\r\nstatic const char* zoomValues =\r\n    \"fit page\\0fitpage\\0fit-page\\0fit width\\0fitwidth\\0fit-width\\0fit \"\r\n    \"content\\0fitcontent\\0fit-content\\0\";\r\n\r\n// -zoom [fitwidth|fitpage|fitcontent|n]\r\n// if a number, it's in percent e.g. 12.5 means 12.5%\r\n// 100 means 100% i.e. actual size as e.g. given in PDF file\r\nstatic void ParseZoomValue(float* zoom, const WCHAR* txtOrig) {\r\n    ScopedMem<char> txtDup(str::conv::ToUtf8(txtOrig));\r\n    char* txt = str::ToLowerInPlace(txtDup.Get());\r\n    int zoomVal = seqstrings::StrToIdx(zoomValues, txt);\r\n    if (zoomVal != -1) {\r\n        // 0-2 : fit page\r\n        // 3-5 : fit width\r\n        // 6-8 : fit content\r\n        *zoom = ZOOM_FIT_CONTENT;\r\n        if (zoomVal <= 5) {\r\n            *zoom = ZOOM_FIT_WIDTH;\r\n        }\r\n        if (zoomVal <= 2) {\r\n            *zoom = ZOOM_FIT_PAGE;\r\n        }\r\n        return;\r\n    }\r\n    // remove trailing % in place, if exists\r\n    if (str::EndsWith(txt, \"%\")) {\r\n        txt[str::Len(txt) - 1] = 0;\r\n    }\r\n    str::Parse(txt, \"%f\", zoom);\r\n    // prevent really small zoom and zoom values that are not valid numbers\r\n    // (which would be parsed as 0)\r\n    if (*zoom < 1.f)\r\n        *zoom = ZOOM_ACTUAL_SIZE;\r\n}\r\n\r\n// -scroll x,y\r\nstatic void ParseScrollValue(PointI* scroll, const WCHAR* txt) {\r\n    int x, y;\r\n    if (str::Parse(txt, L\"%d,%d%$\", &x, &y))\r\n        *scroll = PointI(x, y);\r\n}\r\n\r\n// order must match enum\r\nstatic const char* argNames =\r\n    \"register-for-pdf\\0\"\r\n    \"print-to-default\\0\"\r\n    \"print-dialog\\0\"\r\n    \"exit-when-done\\0\"\r\n    \"exit-on-print\\0\"\r\n    \"restrict\\0\"\r\n    \"invertcolors\\0\"\r\n    \"invert-colors\\0\"\r\n    \"presentation\\0\"\r\n    \"fullscreen\\0\"\r\n    \"console\\0\"\r\n    \"rand\\0\"\r\n    \"crash-on-open\\0\"\r\n    \"reuse-instance\\0\"\r\n    \"esc-to-exit\\0\"\r\n    \"set-color-range\\0\"\r\n    \"enum-printers\\0\"\r\n    \"print-to\\0\"\r\n    \"print-settings\\0\"\r\n    \"inverse-search\\0\"\r\n    \"forward-search\\0\"\r\n    \"fwdsearch\\0\"\r\n    \"nameddest\\0\"\r\n    \"named-dest\\0\"\r\n    \"page\\0\"\r\n    \"view\\0\"\r\n    \"zoom\\0\"\r\n    \"scroll\\0\"\r\n    \"appdata\\0\"\r\n    \"plugin\\0\"\r\n    \"stress-test\\0\"\r\n    \"n\\0\"\r\n    \"render\\0\"\r\n    \"bench\\0\"\r\n    \"lang\\0\"\r\n    \"bgcolor\\0\"\r\n    \"bg-color\\0\"\r\n    \"fwdsearch-offset\\0\"\r\n    \"fwdsearch-width\\0\"\r\n    \"fwdsearch-color\\0\"\r\n    \"fwdsearch-permanent\\0\"\r\n    \"manga-mode\\0\"\r\n    \"autoupdate\\0\"\r\n    \"extract-text\\0\"\r\n    \"silent\\0\";\r\n\r\nenum {\r\n    RegisterForPdf,\r\n    PrintToDefault,\r\n    PrintDialog,\r\n    ExitWhenDone,\r\n    ExitOnPrint,\r\n    Restrict,\r\n    InvertColors1,\r\n    InvertColors2,\r\n    Presentation,\r\n    Fullscreen,\r\n    Console,\r\n    Rand,\r\n    CrashOnOpen,\r\n    ReuseInstance,\r\n    EscToExit,\r\n    SetColorRange,\r\n    ArgEnumPrinters, // EnumPrinters conflicts with win API EnumPrinters()\r\n    PrintTo,\r\n    PrintSettings,\r\n    InverseSearch,\r\n    ForwardSearch,\r\n    FwdSearch,\r\n    NamedDest,\r\n    NamedDest2,\r\n    Page,\r\n    View,\r\n    Zoom,\r\n    Scroll,\r\n    AppData,\r\n    Plugin,\r\n    StressTest,\r\n    ArgN,\r\n    Render,\r\n    Bench,\r\n    Lang,\r\n    BgColor,\r\n    BgColor2,\r\n    FwdSearchOffset,\r\n    FwdSearchWidth,\r\n    FwdSearchColor,\r\n    FwdSearchPermanent,\r\n    MangaMode,\r\n    AutoUpdate,\r\n    ExtractText,\r\n    Silent\r\n};\r\n\r\nstatic int GetArgNo(const WCHAR* argName) {\r\n    if (*argName == '-' || *argName == '/') {\r\n        argName++;\r\n    } else {\r\n        return -1;\r\n    }\r\n    return seqstrings::StrToIdx(argNames, argName);\r\n}\r\n\r\n/* parse argument list. we assume that all unrecognized arguments are file names. */\r\nvoid CommandLineInfo::ParseCommandLine(const WCHAR* cmdLine) {\r\n    WStrVec argList;\r\n    ParseCmdLine(cmdLine, argList);\r\n    size_t argCount = argList.Count();\r\n\r\n#define is_arg_with_param(_argNo) (param && _argNo == arg)\r\n#define additional_param() argList.At(n + 1)\r\n#define has_additional_param() ((argCount > n + 1) && ('-' != additional_param()[0]))\r\n#define handle_string_param(name) name.Set(str::Dup(argList.At(++n)))\r\n#define handle_int_param(name) name = _wtoi(argList.At(++n))\r\n\r\n    for (size_t n = 1; n < argCount; n++) {\r\n        WCHAR* argName = argList.At(n);\r\n        int arg = GetArgNo(argName);\r\n        WCHAR* param = nullptr;\r\n        if (argCount > n + 1) {\r\n            param = argList.At(n + 1);\r\n        }\r\n        if (RegisterForPdf == arg) {\r\n            makeDefault = true;\r\n            exitImmediately = true;\r\n            return;\r\n        } else if (Silent == arg) {\r\n            // silences errors happening during -print-to and -print-to-default\r\n            silent = true;\r\n        } else if (PrintToDefault == arg) {\r\n            printerName.Set(GetDefaultPrinterName());\r\n            if (!printerName)\r\n                printDialog = true;\r\n            exitWhenDone = true;\r\n        } else if (is_arg_with_param(PrintTo)) {\r\n            handle_string_param(printerName);\r\n            exitWhenDone = true;\r\n        } else if (PrintDialog == arg) {\r\n            printDialog = true;\r\n        } else if (is_arg_with_param(PrintSettings)) {\r\n            // argument is a comma separated list of page ranges and\r\n            // advanced options [even|odd] and [noscale|shrink|fit]\r\n            // e.g. -print-settings \"1-3,5,10-8,odd,fit\"\r\n            handle_string_param(printSettings);\r\n            str::RemoveChars(printSettings, L\" \");\r\n            str::TransChars(printSettings, L\";\", L\",\");\r\n        } else if (ExitWhenDone == arg || ExitOnPrint == arg) {\r\n            // only affects -print-dialog (-print-to and -print-to-default\r\n            // always exit on print) and -stress-test (useful for profiling)\r\n            exitWhenDone = true;\r\n        } else if (is_arg_with_param(InverseSearch)) {\r\n            inverseSearchCmdLine.Set(str::Dup(argList.At(++n)));\r\n        } else if ((is_arg_with_param(ForwardSearch) || is_arg_with_param(FwdSearch)) &&\r\n                   argCount > n + 2) {\r\n            // -forward-search is for consistency with -inverse-search\r\n            // -fwdsearch is for consistency with -fwdsearch-*\r\n            handle_string_param(forwardSearchOrigin);\r\n            handle_int_param(forwardSearchLine);\r\n        } else if (is_arg_with_param(NamedDest) || is_arg_with_param(NamedDest2)) {\r\n            // -nameddest is for backwards compat (was used pre-1.3)\r\n            // -named-dest is for consistency\r\n            handle_string_param(destName);\r\n        } else if (is_arg_with_param(Page)) {\r\n            handle_int_param(pageNumber);\r\n        } else if (Restrict == arg) {\r\n            restrictedUse = true;\r\n        } else if (InvertColors1 == arg || InvertColors2 == arg) {\r\n            // -invertcolors is for backwards compat (was used pre-1.3)\r\n            // -invert-colors is for consistency\r\n            // -invert-colors used to be a shortcut for -set-color-range 0xFFFFFF 0x000000\r\n            // now it non-permanently swaps textColor and backgroundColor\r\n            invertColors = true;\r\n        } else if (Presentation == arg) {\r\n            enterPresentation = true;\r\n        } else if (Fullscreen == arg) {\r\n            enterFullScreen = true;\r\n        } else if (is_arg_with_param(View)) {\r\n            ParseViewMode(&startView, param);\r\n            ++n;\r\n        } else if (is_arg_with_param(Zoom)) {\r\n            ParseZoomValue(&startZoom, param);\r\n            ++n;\r\n        } else if (is_arg_with_param(Scroll)) {\r\n            ParseScrollValue(&startScroll, param);\r\n            ++n;\r\n        } else if (Console == arg) {\r\n            showConsole = true;\r\n        } else if (is_arg_with_param(AppData)) {\r\n            appdataDir.Set(str::Dup(param));\r\n            ++n;\r\n        } else if (is_arg_with_param(Plugin)) {\r\n            // -plugin [<URL>] <parent HWND>\r\n            if (argCount > n + 2 && !str::IsDigit(*argList.At(n + 1)) && *argList.At(n + 2) != '-')\r\n                handle_string_param(pluginURL);\r\n            // the argument is a (numeric) window handle to\r\n            // become the parent of a frameless SumatraPDF\r\n            // (used e.g. for embedding it into a browser plugin)\r\n            hwndPluginParent = (HWND)(INT_PTR)_wtol(argList.At(++n));\r\n        } else if (is_arg_with_param(StressTest)) {\r\n            // -stress-test <file or dir path> [<file filter>] [<page/file range(s)>] [<cycle\r\n            // count>x]\r\n            // e.g. -stress-test file.pdf 25x  for rendering file.pdf 25 times\r\n            //      -stress-test file.pdf 1-3  render only pages 1, 2 and 3 of file.pdf\r\n            //      -stress-test dir 301- 2x   render all files in dir twice, skipping first 300\r\n            //      -stress-test dir *.pdf;*.xps  render all files in dir that are either PDF or XPS\r\n            handle_string_param(stressTestPath);\r\n            int num;\r\n            if (has_additional_param() && str::FindChar(additional_param(), '*'))\r\n                handle_string_param(stressTestFilter);\r\n            if (has_additional_param() && IsValidPageRange(additional_param()))\r\n                handle_string_param(stressTestRanges);\r\n            if (has_additional_param() && str::Parse(additional_param(), L\"%dx%$\", &num) &&\r\n                num > 0) {\r\n                stressTestCycles = num;\r\n                n++;\r\n            }\r\n        } else if (is_arg_with_param(ArgN)) {\r\n            handle_int_param(stressParallelCount);\r\n        } else if (is_arg_with_param(Render)) {\r\n            handle_int_param(pageNumber);\r\n            testRenderPage = true;\r\n        } else if (is_arg_with_param(ExtractText)) {\r\n            handle_int_param(pageNumber);\r\n            testExtractPage = true;\r\n        } else if (Rand == arg) {\r\n            stressRandomizeFiles = true;\r\n        } else if (is_arg_with_param(Bench)) {\r\n            WCHAR* s = str::Dup(param);\r\n            ++n;\r\n            pathsToBenchmark.Push(s);\r\n            s = nullptr;\r\n            if (has_additional_param() && IsBenchPagesInfo(additional_param())) {\r\n                s = str::Dup(argList.At(++n));\r\n            }\r\n            pathsToBenchmark.Push(s);\r\n            exitImmediately = true;\r\n        } else if (CrashOnOpen == arg) {\r\n            // to make testing of crash reporting system in pre-release/release\r\n            // builds possible\r\n            crashOnOpen = true;\r\n        } else if (ReuseInstance == arg) {\r\n            // for backwards compatibility, -reuse-instance reuses whatever\r\n            // instance has registered as DDE server\r\n            reuseDdeInstance = true;\r\n        }\r\n        // TODO: remove the following deprecated options within a release or two\r\n        else if (is_arg_with_param(Lang)) {\r\n            lang.Set(str::conv::ToAnsi(param));\r\n            ++n;\r\n        } else if (EscToExit == arg) {\r\n            globalPrefArgs.Append(str::Dup(argList.At(n)));\r\n        } else if (is_arg_with_param(BgColor) || is_arg_with_param(BgColor2) ||\r\n                   is_arg_with_param(FwdSearchOffset) || is_arg_with_param(FwdSearchWidth) ||\r\n                   is_arg_with_param(FwdSearchColor) || is_arg_with_param(FwdSearchPermanent) ||\r\n                   is_arg_with_param(MangaMode)) {\r\n            globalPrefArgs.Append(str::Dup(argList.At(n)));\r\n            globalPrefArgs.Append(str::Dup(argList.At(++n)));\r\n        } else if (SetColorRange == arg && argCount > n + 2) {\r\n            globalPrefArgs.Append(str::Dup(argList.At(n)));\r\n            globalPrefArgs.Append(str::Dup(argList.At(++n)));\r\n            globalPrefArgs.Append(str::Dup(argList.At(++n)));\r\n        }\r\n#ifdef DEBUG\r\n        else if (ArgEnumPrinters == arg) {\r\n            EnumeratePrinters();\r\n            /* this is for testing only, exit immediately */\r\n            exitImmediately = true;\r\n            return;\r\n        }\r\n#endif\r\n        // this should have been handled already by AutoUpdateMain\r\n        else if (is_arg_with_param(AutoUpdate)) {\r\n            n++;\r\n        } else {\r\n            // Remember this argument as a filename to open\r\n            WCHAR* filePath = nullptr;\r\n            if (str::EndsWithI(argName, L\".lnk\"))\r\n                filePath = ResolveLnk(argName);\r\n            if (!filePath)\r\n                filePath = str::Dup(argName);\r\n            fileNames.Push(filePath);\r\n        }\r\n    }\r\n#undef is_arg_with_param\r\n#undef additional_param\r\n#undef has_additional_param\r\n#undef handle_string_param\r\n#undef handle_int_param\r\n}\r\n"
  },
  {
    "path": "src/ParseCommandLine.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nstruct PageRange {\r\n    PageRange() : start(1), end(INT_MAX) {}\r\n    PageRange(int start, int end) : start(start), end(end) {}\r\n\r\n    int start, end; // end == INT_MAX means to the last page\r\n};\r\n\r\nclass CommandLineInfo {\r\n  public:\r\n    WStrVec fileNames;\r\n    // pathsToBenchmark contain 2 strings per each file to benchmark:\r\n    // - name of the file to benchmark\r\n    // - optional (nullptr if not available) string that represents which pages\r\n    //   to benchmark. It can also be a string \"loadonly\" which means we'll\r\n    //   only benchmark loading of the catalog\r\n    WStrVec pathsToBenchmark;\r\n    bool makeDefault;\r\n    bool exitWhenDone;\r\n    bool printDialog;\r\n    ScopedMem<WCHAR> printerName;\r\n    ScopedMem<WCHAR> printSettings;\r\n    ScopedMem<WCHAR> forwardSearchOrigin;\r\n    int forwardSearchLine;\r\n    bool reuseDdeInstance;\r\n    ScopedMem<WCHAR> destName;\r\n    int pageNumber;\r\n    bool restrictedUse;\r\n    bool enterPresentation;\r\n    bool enterFullScreen;\r\n    DisplayMode startView;\r\n    float startZoom;\r\n    PointI startScroll;\r\n    bool showConsole;\r\n    HWND hwndPluginParent;\r\n    ScopedMem<WCHAR> pluginURL;\r\n    bool exitImmediately;\r\n    bool silent;\r\n    ScopedMem<WCHAR> appdataDir;\r\n    ScopedMem<WCHAR> inverseSearchCmdLine;\r\n    bool invertColors;\r\n\r\n    // stress-testing related\r\n    ScopedMem<WCHAR> stressTestPath;\r\n    ScopedMem<WCHAR> stressTestFilter; // nullptr is equivalent to \"*\" (i.e. all files)\r\n    ScopedMem<WCHAR> stressTestRanges;\r\n    int stressTestCycles;\r\n    int stressParallelCount;\r\n    bool stressRandomizeFiles;\r\n\r\n    // related to testing\r\n    bool testRenderPage;\r\n    bool testExtractPage;\r\n    int testPageNo;\r\n\r\n    bool crashOnOpen;\r\n\r\n    // deprecated flags\r\n    ScopedMem<char> lang;\r\n    WStrVec globalPrefArgs;\r\n\r\n    CommandLineInfo()\r\n        : makeDefault(false),\r\n          exitWhenDone(false),\r\n          printDialog(false),\r\n          printerName(nullptr),\r\n          printSettings(nullptr),\r\n          reuseDdeInstance(false),\r\n          lang(nullptr),\r\n          destName(nullptr),\r\n          pageNumber(-1),\r\n          restrictedUse(false),\r\n          pluginURL(nullptr),\r\n          enterPresentation(false),\r\n          enterFullScreen(false),\r\n          hwndPluginParent(nullptr),\r\n          startView(DM_AUTOMATIC),\r\n          startZoom(INVALID_ZOOM),\r\n          startScroll(PointI(-1, -1)),\r\n          showConsole(false),\r\n          exitImmediately(false),\r\n          silent(false),\r\n          forwardSearchOrigin(nullptr),\r\n          forwardSearchLine(0),\r\n          stressTestPath(nullptr),\r\n          stressTestFilter(nullptr),\r\n          stressTestRanges(nullptr),\r\n          stressTestCycles(1),\r\n          stressParallelCount(1),\r\n          stressRandomizeFiles(false),\r\n          testRenderPage(false),\r\n          testExtractPage(false),\r\n          appdataDir(nullptr),\r\n          inverseSearchCmdLine(nullptr),\r\n          invertColors(false),\r\n          crashOnOpen(false) {}\r\n\r\n    ~CommandLineInfo() {}\r\n\r\n    void ParseCommandLine(const WCHAR* cmdLine);\r\n};\r\n\r\nvoid ParseColor(COLORREF* destColor, const WCHAR* txt);\r\nbool IsValidPageRange(const WCHAR* ranges);\r\nbool IsBenchPagesInfo(const WCHAR* s);\r\nbool ParsePageRanges(const WCHAR* ranges, Vec<PageRange>& result);\r\n"
  },
  {
    "path": "src/PdfCreator.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n#pragma warning(disable: 4611) // interaction between '_setjmp' and C++ object destruction is non-portable\r\n\r\nextern \"C\" {\r\n#include <mupdf/pdf.h>\r\n#include <zlib.h>\r\n}\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"GdiplusUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"PdfCreator.h\"\r\n\r\nstatic ScopedMem<WCHAR> gPdfProducer;\r\n\r\nvoid PdfCreator::SetProducerName(const WCHAR *name)\r\n{\r\n    if (!str::Eq(gPdfProducer, name))\r\n        gPdfProducer.Set(str::Dup(name));\r\n}\r\n\r\nstatic fz_image *render_to_pixmap(fz_context *ctx, HBITMAP hbmp, SizeI size)\r\n{\r\n    int w = size.dx, h = size.dy;\r\n    int stride = ((w * 3 + 3) / 4) * 4;\r\n\r\n    unsigned char *data = (unsigned char *)fz_malloc(ctx, stride * h);\r\n\r\n    BITMAPINFO bmi = { 0 };\r\n    bmi.bmiHeader.biSize = sizeof(bmi.bmiHeader);\r\n    bmi.bmiHeader.biWidth = w;\r\n    bmi.bmiHeader.biHeight = -h;\r\n    bmi.bmiHeader.biPlanes = 1;\r\n    bmi.bmiHeader.biBitCount = 24;\r\n    bmi.bmiHeader.biCompression = BI_RGB;\r\n\r\n    HDC hDC = GetDC(nullptr);\r\n    int res = GetDIBits(hDC, hbmp, 0, h, data, &bmi, DIB_RGB_COLORS);\r\n    ReleaseDC(nullptr, hDC);\r\n    if (!res) {\r\n        fz_free(ctx, data);\r\n        fz_throw(ctx, FZ_ERROR_GENERIC, \"GetDIBits failed\");\r\n    }\r\n\r\n    // convert BGR with padding to RGB without padding\r\n    unsigned char *out = data;\r\n    bool is_grayscale = true;\r\n    for (int y = 0; y < h; y++) {\r\n        const unsigned char *in = data + y * stride;\r\n        unsigned char green, blue;\r\n        for (int x = 0; x < w; x++) {\r\n            is_grayscale = is_grayscale && in[0] == in[1] && in[0] == in[2];\r\n            blue = *in++;\r\n            green = *in++;\r\n            *out++ = *in++;\r\n            *out++ = green;\r\n            *out++ = blue;\r\n        }\r\n    }\r\n    // convert grayscale RGB to proper grayscale\r\n    if (is_grayscale) {\r\n        const unsigned char *in = out = data;\r\n        for (int i = 0; i < w * h; i++) {\r\n            *out++ = *in++;\r\n            in += 2;\r\n        }\r\n    }\r\n\r\n    fz_compressed_buffer *buf = nullptr;\r\n    fz_var(buf);\r\n\r\n    fz_try(ctx) {\r\n        buf = fz_malloc_struct(ctx, fz_compressed_buffer);\r\n        buf->buffer = fz_new_buffer(ctx, w * h * 4 + 10);\r\n        buf->params.type = FZ_IMAGE_FLATE;\r\n        buf->params.u.flate.predictor = 1;\r\n\r\n        z_stream zstm = { 0 };\r\n        zstm.next_in = data;\r\n        zstm.avail_in = out - data;\r\n        zstm.next_out = buf->buffer->data;\r\n        zstm.avail_out = buf->buffer->cap;\r\n\r\n        res = deflateInit(&zstm, 9);\r\n        if (res != Z_OK)\r\n            fz_throw(ctx, FZ_ERROR_GENERIC, \"deflate failure %d\", res);\r\n        res = deflate(&zstm, Z_FINISH);\r\n        if (res != Z_STREAM_END)\r\n            fz_throw(ctx, FZ_ERROR_GENERIC, \"deflate failure %d\", res);\r\n        buf->buffer->len = zstm.total_out;\r\n        res = deflateEnd(&zstm);\r\n        if (res != Z_OK)\r\n            fz_throw(ctx, FZ_ERROR_GENERIC, \"deflate failure %d\", res);\r\n    }\r\n    fz_always(ctx) {\r\n        fz_free(ctx, data);\r\n    }\r\n    fz_catch(ctx) {\r\n        fz_free_compressed_buffer(ctx, buf);\r\n        fz_rethrow(ctx);\r\n    }\r\n\r\n    fz_colorspace *cs = is_grayscale ? fz_device_gray(ctx) : fz_device_rgb(ctx);\r\n    return fz_new_image(ctx, w, h, 8, cs, 96, 96, 0, 0, nullptr, nullptr, buf, nullptr);\r\n}\r\n\r\nstatic fz_image *pack_jpeg(fz_context *ctx, const char *data, size_t len, SizeI size)\r\n{\r\n    fz_compressed_buffer *buf = nullptr;\r\n    fz_var(buf);\r\n\r\n    fz_try(ctx) {\r\n        buf = fz_malloc_struct(ctx, fz_compressed_buffer);\r\n        buf->buffer = fz_new_buffer(ctx, (int)len);\r\n        memcpy(buf->buffer->data, data, (buf->buffer->len = (int)len));\r\n        buf->params.type = FZ_IMAGE_JPEG;\r\n        buf->params.u.jpeg.color_transform = -1;\r\n    }\r\n    fz_catch(ctx) {\r\n        fz_free_compressed_buffer(ctx, buf);\r\n        fz_rethrow(ctx);\r\n    }\r\n\r\n    return fz_new_image(ctx, size.dx, size.dy, 8, fz_device_rgb(ctx), 96, 96, 0, 0, nullptr, nullptr, buf, nullptr);\r\n}\r\n\r\nstatic fz_image *pack_jp2(fz_context *ctx, const char *data, size_t len, SizeI size)\r\n{\r\n    fz_compressed_buffer *buf = nullptr;\r\n    fz_var(buf);\r\n\r\n    fz_try(ctx) {\r\n        buf = fz_malloc_struct(ctx, fz_compressed_buffer);\r\n        buf->buffer = fz_new_buffer(ctx, (int)len);\r\n        memcpy(buf->buffer->data, data, (buf->buffer->len = (int)len));\r\n        buf->params.type = FZ_IMAGE_JPX;\r\n    }\r\n    fz_catch(ctx) {\r\n        fz_free_compressed_buffer(ctx, buf);\r\n        fz_rethrow(ctx);\r\n    }\r\n\r\n    return fz_new_image(ctx, size.dx, size.dy, 8, fz_device_rgb(ctx), 96, 96, 0, 0, nullptr, nullptr, buf, nullptr);\r\n}\r\n\r\nPdfCreator::PdfCreator()\r\n{\r\n    ctx = fz_new_context(nullptr, nullptr, FZ_STORE_DEFAULT);\r\n    if (!ctx)\r\n        return;\r\n    fz_try(ctx) {\r\n        doc = pdf_create_document(ctx);\r\n    }\r\n    fz_catch(ctx) {\r\n        doc = nullptr;\r\n    }\r\n}\r\n\r\nPdfCreator::~PdfCreator()\r\n{\r\n    pdf_close_document(doc);\r\n    fz_free_context(ctx);\r\n}\r\n\r\nbool PdfCreator::AddImagePage(fz_image *image, float imgDpi)\r\n{\r\n    CrashIf(!ctx || !doc);\r\n    if (!ctx || !doc) return false;\r\n\r\n    pdf_page *page = nullptr;\r\n    fz_device *dev = nullptr;\r\n    fz_var(page);\r\n    fz_var(dev);\r\n\r\n    fz_try(ctx) {\r\n        float zoom = imgDpi ? 72 / imgDpi : 1.0f;\r\n        fz_matrix ctm = { image->w * zoom, 0, 0, image->h * zoom, 0, 0 };\r\n        fz_rect bounds = fz_unit_rect;\r\n        fz_transform_rect(&bounds, &ctm);\r\n        page = pdf_create_page(doc, bounds, 72, 0);\r\n        dev = pdf_page_write(doc, page);\r\n        fz_fill_image(dev, image, &ctm, 1.0);\r\n        fz_free_device(dev);\r\n        dev = nullptr;\r\n        pdf_insert_page(doc, page, INT_MAX);\r\n    }\r\n    fz_always(ctx) {\r\n        fz_free_device(dev);\r\n        pdf_free_page(doc, page);\r\n    }\r\n    fz_catch(ctx) {\r\n        return false;\r\n    }\r\n    return true;\r\n}\r\n\r\nbool PdfCreator::AddImagePage(HBITMAP hbmp, SizeI size, float imgDpi)\r\n{\r\n    if (!ctx || !doc) return false;\r\n\r\n    fz_image *image = nullptr;\r\n    fz_try(ctx) {\r\n        image = render_to_pixmap(ctx, hbmp, size);\r\n    }\r\n    fz_catch(ctx) {\r\n        return false;\r\n    }\r\n    bool ok = AddImagePage(image, imgDpi);\r\n    fz_drop_image(ctx, image);\r\n    return ok;\r\n}\r\n\r\nbool PdfCreator::AddImagePage(Bitmap *bmp, float imgDpi)\r\n{\r\n    HBITMAP hbmp;\r\n    if (bmp->GetHBITMAP((ARGB)Color::White, &hbmp) != Ok)\r\n        return false;\r\n    if (!imgDpi)\r\n        imgDpi = bmp->GetHorizontalResolution();\r\n    bool ok = AddImagePage(hbmp, SizeI(bmp->GetWidth(), bmp->GetHeight()), imgDpi);\r\n    DeleteObject(hbmp);\r\n    return ok;\r\n}\r\n\r\nbool PdfCreator::AddImagePage(const char *data, size_t len, float imgDpi)\r\n{\r\n    CrashIf(!ctx || !doc);\r\n    if (!ctx || !doc) return false;\r\n\r\n    const WCHAR *ext = GfxFileExtFromData(data, len);\r\n    if (str::Eq(ext, L\".jpg\") || str::Eq(ext, L\".jp2\")) {\r\n        Size size = BitmapSizeFromData(data, len);\r\n        fz_image *image = nullptr;\r\n        fz_try(ctx) {\r\n            image = (str::Eq(ext, L\".jpg\") ? pack_jpeg : pack_jp2)(ctx, data, len, SizeI(size.Width, size.Height));\r\n        }\r\n        fz_catch(ctx) {\r\n            return false;\r\n        }\r\n        bool ok = AddImagePage(image, imgDpi);\r\n        fz_drop_image(ctx, image);\r\n        return ok;\r\n    }\r\n    Bitmap *bmp = BitmapFromData(data, len);\r\n    if (!bmp)\r\n        return false;\r\n    bool ok = AddImagePage(bmp, imgDpi);\r\n    delete bmp;\r\n    return ok;\r\n}\r\n\r\nstatic bool Is7BitAscii(const WCHAR *str)\r\n{\r\n    for (const WCHAR *c = str; *c; c++) {\r\n        if (*c < 32 || *c > 127)\r\n            return false;\r\n    }\r\n    return true;\r\n}\r\n\r\nbool PdfCreator::SetProperty(DocumentProperty prop, const WCHAR *value)\r\n{\r\n    if (!ctx || !doc) return false;\r\n\r\n    // adapted from PdfEngineImpl::GetProperty\r\n    static struct {\r\n        DocumentProperty prop;\r\n        char *name;\r\n    } pdfPropNames[] = {\r\n        { Prop_Title, \"Title\" }, { Prop_Author, \"Author\" },\r\n        { Prop_Subject, \"Subject\" }, { Prop_Copyright, \"Copyright\" },\r\n        { Prop_ModificationDate, \"ModDate\" },\r\n        { Prop_CreatorApp, \"Creator\" }, { Prop_PdfProducer, \"Producer\" },\r\n    };\r\n    const char *name = nullptr;\r\n    for (int i = 0; i < dimof(pdfPropNames) && !name; i++) {\r\n        if (pdfPropNames[i].prop == prop)\r\n            name = pdfPropNames[i].name;\r\n    }\r\n    if (!name)\r\n        return false;\r\n\r\n    ScopedMem<char> encValue;\r\n    int encValueLen;\r\n    if (Is7BitAscii(value)) {\r\n        encValue.Set(str::conv::ToUtf8(value));\r\n        encValueLen = (int)str::Len(encValue);\r\n    }\r\n    else {\r\n        encValue.Set((char *)str::Join(L\"\\uFEFF\", value));\r\n        encValueLen = (int)((str::Len(value) + 1) * sizeof(WCHAR));\r\n    }\r\n    pdf_obj *obj = nullptr;\r\n    fz_var(obj);\r\n    fz_try(ctx) {\r\n        pdf_obj *info = pdf_dict_getp(pdf_trailer(doc), \"Info\");\r\n        if (!pdf_is_indirect(info) || !pdf_is_dict(info)) {\r\n            info = obj = pdf_new_dict(doc, 4);\r\n            pdf_dict_puts_drop(pdf_trailer(doc), \"Info\", pdf_new_ref(doc, obj));\r\n            pdf_drop_obj(obj);\r\n        }\r\n        pdf_dict_puts_drop(info, name, pdf_new_string(doc, encValue, encValueLen));\r\n    }\r\n    fz_catch(ctx) {\r\n        pdf_drop_obj(obj);\r\n        return false;\r\n    }\r\n    return true;\r\n}\r\n\r\nbool PdfCreator::CopyProperties(BaseEngine *engine)\r\n{\r\n    static DocumentProperty props[] = {\r\n        Prop_Title, Prop_Author, Prop_Subject, Prop_Copyright,\r\n        Prop_ModificationDate, Prop_CreatorApp\r\n    };\r\n    bool ok = true;\r\n    for (int i = 0; i < dimof(props); i++) {\r\n        ScopedMem<WCHAR> value(engine->GetProperty(props[i]));\r\n        if (value) {\r\n            ok = ok && SetProperty(props[i], value);\r\n        }\r\n    }\r\n    return ok;\r\n}\r\n\r\nbool PdfCreator::SaveToFile(const WCHAR *filePath)\r\n{\r\n    if (!ctx || !doc) return false;\r\n\r\n    if (gPdfProducer)\r\n        SetProperty(Prop_PdfProducer, gPdfProducer);\r\n\r\n    ScopedMem<char> pathUtf8(str::conv::ToUtf8(filePath));\r\n    fz_try(ctx) {\r\n        pdf_write_document(doc, pathUtf8, nullptr);\r\n    }\r\n    fz_catch(ctx) {\r\n        return false;\r\n    }\r\n    return true;\r\n}\r\n\r\nbool PdfCreator::RenderToFile(const WCHAR *pdfFileName, BaseEngine *engine, int dpi)\r\n{\r\n    PdfCreator *c = new PdfCreator();\r\n    bool ok = true;\r\n    // render all pages to images\r\n    float zoom = dpi / engine->GetFileDPI();\r\n    for (int i = 1; ok && i <= engine->PageCount(); i++) {\r\n        RenderedBitmap *bmp = engine->RenderBitmap(i, zoom, 0, nullptr, Target_Export);\r\n        if (bmp)\r\n            ok = c->AddImagePage(bmp->GetBitmap(), bmp->Size(), dpi);\r\n        else\r\n            ok = false;\r\n        delete bmp;\r\n    }\r\n    if (!ok) {\r\n        delete c;\r\n        return false;\r\n    }\r\n    c->CopyProperties(engine);\r\n    ok = c->SaveToFile(pdfFileName);\r\n    delete c;\r\n    return ok;\r\n}\r\n"
  },
  {
    "path": "src/PdfCreator.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\ntypedef struct fz_context_s fz_context;\r\ntypedef struct fz_image_s fz_image;\r\ntypedef struct pdf_document_s pdf_document;\r\n\r\nclass PdfCreator {\r\n    fz_context *ctx;\r\n    pdf_document *doc;\r\n\r\npublic:\r\n    PdfCreator();\r\n    ~PdfCreator();\r\n\r\n    bool AddImagePage(fz_image *image, float imgDpi=0);\r\n    bool AddImagePage(HBITMAP hbmp, SizeI size, float imgDpi=0);\r\n    bool AddImagePage(Gdiplus::Bitmap *bmp, float imgDpi=0);\r\n    // recommended for JPEG and JP2 images (don't need to be recompressed)\r\n    bool AddImagePage(const char *data, size_t len, float imgDpi=0);\r\n\r\n    bool SetProperty(DocumentProperty prop, const WCHAR *value);\r\n    bool CopyProperties(BaseEngine *engine);\r\n\r\n    bool SaveToFile(const WCHAR *filePath);\r\n\r\n    // this name is included in all saved PDF files\r\n    static void SetProducerName(const WCHAR *name);\r\n\r\n    // creates a simple PDF with all pages rendered as a single image\r\n    static bool RenderToFile(const WCHAR *pdfFileName, BaseEngine *engine, int dpi=150);\r\n};\r\n"
  },
  {
    "path": "src/PdfEngine.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n#pragma warning(disable: 4611) // interaction between '_setjmp' and C++ object destruction is non-portable\r\n\r\nextern \"C\" {\r\n#include <mupdf/fitz.h>\r\n}\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"ArchUtil.h\"\r\n#include \"FileUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"HtmlPullParser.h\"\r\n#include \"TrivialHtmlParser.h\"\r\n#include \"WinUtil.h\"\r\n#include \"ZipUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"PdfEngine.h\"\r\n\r\n// maximum size of a file that's entirely loaded into memory before parsed\r\n// and displayed; larger files will be kept open while they're displayed\r\n// so that their content can be loaded on demand in order to preserve memory\r\n#define MAX_MEMORY_FILE_SIZE (10 * 1024 * 1024)\r\n\r\n// number of page content trees to cache for quicker rendering\r\n#define MAX_PAGE_RUN_CACHE  8\r\n// maximum estimated memory requirement allowed for the run cache of one document\r\n#define MAX_PAGE_RUN_MEMORY (40 * 1024 * 1024)\r\n\r\n// maximum amount of memory that MuPDF should use per fz_context store\r\n#define MAX_CONTEXT_MEMORY  (256 * 1024 * 1024)\r\n\r\n///// extensions to Fitz that are usable for both PDF and XPS /////\r\n\r\ninline RectD fz_rect_to_RectD(fz_rect rect)\r\n{\r\n    return RectD::FromXY(rect.x0, rect.y0, rect.x1, rect.y1);\r\n}\r\n\r\ninline fz_rect fz_RectD_to_rect(RectD rect)\r\n{\r\n    fz_rect result = { (float)rect.x, (float)rect.y, (float)(rect.x + rect.dx), (float)(rect.y + rect.dy) };\r\n    return result;\r\n}\r\n\r\ninline bool fz_is_pt_in_rect(fz_rect rect, fz_point pt)\r\n{\r\n    return fz_rect_to_RectD(rect).Contains(PointD(pt.x, pt.y));\r\n}\r\n\r\ninline float fz_calc_overlap(fz_rect r1, fz_rect r2)\r\n{\r\n    if (fz_is_empty_rect(&r1))\r\n        return 0.0f;\r\n    fz_rect isect = r1;\r\n    fz_intersect_rect(&isect, &r2);\r\n    return (isect.x1 - isect.x0) * (isect.y1 - isect.y0) / ((r1.x1 - r1.x0) * (r1.y1 - r1.y0));\r\n}\r\n\r\nstatic RenderedBitmap *new_rendered_fz_pixmap(fz_context *ctx, fz_pixmap *pixmap)\r\n{\r\n    int paletteSize = 0;\r\n    bool hasPalette = false;\r\n\r\n    int w = pixmap->w;\r\n    int h = pixmap->h;\r\n    int rows8 = ((w + 3) / 4) * 4;\r\n\r\n    ScopedMem<BITMAPINFO> bmi((BITMAPINFO *)calloc(1, sizeof(BITMAPINFO) + 255 * sizeof(RGBQUAD)));\r\n\r\n    // always try to produce an 8-bit palette for saving some memory\r\n    unsigned char *bmpData = (unsigned char *)calloc(rows8, h);\r\n    if (!bmpData)\r\n        return nullptr;\r\n    fz_pixmap *bgrPixmap = nullptr;\r\n    if (bmpData && pixmap->n == 4 &&\r\n        pixmap->colorspace == fz_device_rgb(ctx)) {\r\n        unsigned char *dest = bmpData;\r\n        unsigned char *source = pixmap->samples;\r\n        uint32_t *palette = (uint32_t *)bmi.Get()->bmiColors;\r\n        BYTE grayIdxs[256] = { 0 };\r\n\r\n        for (int j = 0; j < h; j++) {\r\n            for (int i = 0; i < w; i++) {\r\n                RGBQUAD c;\r\n\r\n                c.rgbRed = *source++;\r\n                c.rgbGreen = *source++;\r\n                c.rgbBlue = *source++;\r\n                c.rgbReserved = 0;\r\n                source++;\r\n\r\n                /* find this color in the palette */\r\n                int k;\r\n                bool isGray = c.rgbRed == c.rgbGreen && c.rgbRed == c.rgbBlue;\r\n                if (isGray) {\r\n                    k = grayIdxs[c.rgbRed] || palette[0] == *(uint32_t *)&c ? grayIdxs[c.rgbRed] : paletteSize;\r\n                }\r\n                else {\r\n                    for (k = 0; k < paletteSize && palette[k] != *(uint32_t *)&c; k++);\r\n                }\r\n                /* add it to the palette if it isn't in there and if there's still space left */\r\n                if (k == paletteSize) {\r\n                    if (++paletteSize > 256)\r\n                        goto ProducingPaletteDone;\r\n                    if (isGray)\r\n                        grayIdxs[c.rgbRed] = (BYTE)k;\r\n                    palette[k] = *(uint32_t *)&c;\r\n                }\r\n                /* 8-bit data consists of indices into the color palette */\r\n                *dest++ = k;\r\n            }\r\n            dest += rows8 - w;\r\n        }\r\nProducingPaletteDone:\r\n        hasPalette = paletteSize <= 256;\r\n    }\r\n    if (!hasPalette) {\r\n        free(bmpData);\r\n        /* BGRA is a GDI compatible format */\r\n        fz_try(ctx) {\r\n            fz_irect bbox;\r\n            fz_colorspace *colorspace = fz_device_bgr(ctx);\r\n            bgrPixmap = fz_new_pixmap_with_bbox(ctx, colorspace, fz_pixmap_bbox(ctx, pixmap, &bbox));\r\n            fz_convert_pixmap(ctx, bgrPixmap, pixmap);\r\n        }\r\n        fz_catch(ctx) {\r\n            return nullptr;\r\n        }\r\n    }\r\n    AssertCrash(hasPalette || bgrPixmap);\r\n\r\n    BITMAPINFOHEADER *bmih = &bmi.Get()->bmiHeader;\r\n    bmih->biSize = sizeof(*bmih);\r\n    bmih->biWidth = w;\r\n    bmih->biHeight = -h;\r\n    bmih->biPlanes = 1;\r\n    bmih->biCompression = BI_RGB;\r\n    bmih->biBitCount = hasPalette ? 8 : 32;\r\n    bmih->biSizeImage = h * (hasPalette ? rows8 : w * 4);\r\n    bmih->biClrUsed = hasPalette ? paletteSize : 0;\r\n\r\n    void *data = nullptr;\r\n    HANDLE hMap = CreateFileMapping(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0, bmih->biSizeImage, nullptr);\r\n    HBITMAP hbmp = CreateDIBSection(nullptr, bmi, DIB_RGB_COLORS, &data, hMap, 0);\r\n    if (hbmp)\r\n        memcpy(data, hasPalette ? bmpData : bgrPixmap->samples, bmih->biSizeImage);\r\n\r\n    if (hasPalette)\r\n        free(bmpData);\r\n    else\r\n        fz_drop_pixmap(ctx, bgrPixmap);\r\n\r\n    // return a RenderedBitmap even if hbmp is nullptr so that callers can\r\n    // distinguish rendering errors from GDI resource exhaustion\r\n    // (and in the latter case retry using smaller target rectangles)\r\n    return new RenderedBitmap(hbmp, SizeI(w, h), hMap);\r\n}\r\n\r\nfz_stream *fz_open_file2(fz_context *ctx, const WCHAR *filePath)\r\n{\r\n    fz_stream *file = nullptr;\r\n    int64 fileSize = file::GetSize(filePath);\r\n    // load small files entirely into memory so that they can be\r\n    // overwritten even by programs that don't open files with FILE_SHARE_READ\r\n    if (fileSize > 0 && fileSize < MAX_MEMORY_FILE_SIZE) {\r\n        fz_buffer *data = nullptr;\r\n        fz_var(data);\r\n        fz_try(ctx) {\r\n            data = fz_new_buffer(ctx, (int)fileSize);\r\n            data->len = (int)fileSize;\r\n            if (file::ReadN(filePath, (char *)data->data, data->len))\r\n                file = fz_open_buffer(ctx, data);\r\n        }\r\n        fz_catch(ctx) {\r\n            file = nullptr;\r\n        }\r\n        fz_drop_buffer(ctx, data);\r\n        if (file)\r\n            return file;\r\n    }\r\n\r\n    fz_try(ctx) {\r\n        file = fz_open_file_w(ctx, filePath);\r\n    }\r\n    fz_catch(ctx) {\r\n        file = nullptr;\r\n    }\r\n    return file;\r\n}\r\n\r\nunsigned char *fz_extract_stream_data(fz_stream *stream, size_t *cbCount)\r\n{\r\n    fz_seek(stream, 0, 2);\r\n    int fileLen = fz_tell(stream);\r\n    fz_seek(stream, 0, 0);\r\n\r\n    fz_buffer *buffer = fz_read_all(stream, fileLen);\r\n    assert(fileLen == buffer->len);\r\n\r\n    unsigned char *data = (unsigned char *)memdup(buffer->data, buffer->len);\r\n    if (cbCount)\r\n        *cbCount = buffer->len;\r\n\r\n    fz_drop_buffer(stream->ctx, buffer);\r\n\r\n    if (!data)\r\n        fz_throw(stream->ctx, FZ_ERROR_GENERIC, \"OOM in fz_extract_stream_data\");\r\n    return data;\r\n}\r\n\r\nvoid fz_stream_fingerprint(fz_stream *file, unsigned char digest[16])\r\n{\r\n    int fileLen = -1;\r\n    fz_buffer *buffer = nullptr;\r\n\r\n    fz_try(file->ctx) {\r\n        fz_seek(file, 0, 2);\r\n        fileLen = fz_tell(file);\r\n        fz_seek(file, 0, 0);\r\n        buffer = fz_read_all(file, fileLen);\r\n    }\r\n    fz_catch(file->ctx) {\r\n        fz_warn(file->ctx, \"couldn't read stream data, using a nullptr fingerprint instead\");\r\n        ZeroMemory(digest, 16);\r\n        return;\r\n    }\r\n    CrashIf(nullptr == buffer);\r\n    CrashIf(fileLen != buffer->len);\r\n\r\n    fz_md5 md5;\r\n    fz_md5_init(&md5);\r\n    fz_md5_update(&md5, buffer->data, buffer->len);\r\n    fz_md5_final(&md5, digest);\r\n\r\n    fz_drop_buffer(file->ctx, buffer);\r\n}\r\n\r\nstatic inline int wchars_per_rune(int rune)\r\n{\r\n    if (rune & 0x1F0000)\r\n        return 2;\r\n    return 1;\r\n}\r\n\r\nstatic void AddChar(fz_text_span *span, fz_text_char *c, str::Str<WCHAR>& s, Vec<RectI>& rects) {\r\n    fz_rect bbox;\r\n    fz_text_char_bbox(&bbox, span, c - span->text);\r\n    RectI r = fz_rect_to_RectD(bbox).Round();\r\n\r\n    int n = wchars_per_rune(c->c);\r\n    if (n == 2) {\r\n        WCHAR tmp[2];\r\n        tmp[0] = 0xD800 | ((c->c - 0x10000) >> 10) & 0x3FF;\r\n        tmp[1] = 0xDC00 | (c->c - 0x10000) & 0x3FF;\r\n        s.Append(tmp, 2);\r\n        rects.Append(r);\r\n        rects.Append(r);\r\n        return;\r\n    }\r\n    WCHAR wc = c->c;\r\n    bool isNonPrintable = (wc <= 32) || str::IsNonCharacter(wc);\r\n    if (!isNonPrintable) {\r\n        s.Append(wc);\r\n        rects.Append(r);\r\n        return;\r\n    }\r\n\r\n    // non-printable or whitespace\r\n    if (!str::IsWs(wc)) {\r\n        s.Append(L'?');\r\n        rects.Append(r);\r\n        return;\r\n    }\r\n\r\n    // collapse multiple whitespace characters into one\r\n    WCHAR prev = s.LastChar();\r\n    if (!str::IsWs(prev)) {\r\n        s.Append(L' ');\r\n        rects.Append(r);\r\n    }\r\n}\r\n\r\n// if there's a span following this one, add space to separate them\r\nstatic void AddSpaceAtSpanEnd(fz_text_span *span, str::Str<WCHAR>& s, Vec<RectI>& rects) {\r\n    if (span->len == 0 || span->next == NULL) {\r\n        return;\r\n    }\r\n    CrashIf(s.Count() == 0);\r\n    CrashIf(rects.Count() == 0);\r\n    if (s.LastChar() == ' ') {\r\n        return;\r\n    }\r\n    // TODO: use a Tab instead? (this might be a table)\r\n    s.Append(L' ');\r\n    RectI prev = rects.Last();\r\n    prev.x += prev.dx;\r\n    prev.dx /= 2;\r\n    rects.Append(prev);\r\n}\r\n\r\nstatic void AddLineSep(str::Str<WCHAR>& s, Vec<RectI>& rects, const WCHAR *lineSep, size_t lineSepLen) {\r\n    if (lineSepLen == 0) {\r\n        return;\r\n    }\r\n    // remove trailing spaces\r\n    if (str::IsWs(s.LastChar())) {\r\n        s.Pop();\r\n        rects.Pop();\r\n    }\r\n\r\n    s.Append(lineSep);\r\n    for (size_t i = 0; i < lineSepLen; i++) {\r\n        rects.Append(RectI());\r\n    }\r\n}\r\n\r\n\r\nstatic WCHAR *fz_text_page_to_str(fz_text_page *text, const WCHAR *lineSep, RectI **coordsOut)\r\n{\r\n    size_t lineSepLen = str::Len(lineSep);\r\n    str::Str<WCHAR> content;\r\n    // coordsOut is optional but we ask for it by default so we simplify the code\r\n    // by always calculating it\r\n    Vec<RectI> rects;\r\n\r\n    for (fz_page_block *block = text->blocks; block < text->blocks + text->len; block++) {\r\n        if (block->type != FZ_PAGE_BLOCK_TEXT)\r\n            continue;\r\n        for (fz_text_line *line = block->u.text->lines; line < block->u.text->lines + block->u.text->len; line++) {\r\n            for (fz_text_span *span = line->first_span; span; span = span->next) {\r\n                for (fz_text_char *c = span->text; c < span->text + span->len; c++) {\r\n                    AddChar(span, c, content, rects);\r\n                }\r\n                AddSpaceAtSpanEnd(span, content, rects);\r\n            }\r\n            AddLineSep(content, rects, lineSep, lineSepLen);\r\n        }\r\n    }\r\n\r\n    CrashIf(content.Count() != rects.Count());\r\n\r\n    if (coordsOut) {\r\n        *coordsOut = rects.StealData();\r\n    }\r\n\r\n    return content.StealData();\r\n}\r\n\r\nstruct istream_filter {\r\n    IStream *stream;\r\n    unsigned char buf[4096];\r\n};\r\n\r\nextern \"C\" static int next_istream(fz_stream *stm, int max)\r\n{\r\n    UNUSED(max);\r\n    istream_filter *state = (istream_filter *)stm->state;\r\n    ULONG cbRead = sizeof(state->buf);\r\n    HRESULT res = state->stream->Read(state->buf, sizeof(state->buf), &cbRead);\r\n    if (FAILED(res))\r\n        fz_throw(stm->ctx, FZ_ERROR_GENERIC, \"IStream read error: %x\", res);\r\n    stm->rp = state->buf;\r\n    stm->wp = stm->rp + cbRead;\r\n    stm->pos += cbRead;\r\n\r\n    return cbRead > 0 ? *stm->rp++ : EOF;\r\n}\r\n\r\nextern \"C\" static void seek_istream(fz_stream *stm, int offset, int whence)\r\n{\r\n    istream_filter *state = (istream_filter *)stm->state;\r\n    LARGE_INTEGER off;\r\n    ULARGE_INTEGER n;\r\n    off.QuadPart = offset;\r\n    HRESULT res = state->stream->Seek(off, whence, &n);\r\n    if (FAILED(res))\r\n        fz_throw(stm->ctx, FZ_ERROR_GENERIC, \"IStream seek error: %x\", res);\r\n    if (n.HighPart != 0 || n.LowPart > INT_MAX)\r\n        fz_throw(stm->ctx, FZ_ERROR_GENERIC, \"documents beyond 2GB aren't supported\");\r\n    stm->pos = n.LowPart;\r\n    stm->rp = stm->wp = state->buf;\r\n}\r\n\r\nextern \"C\" static void close_istream(fz_context *ctx, void *state_)\r\n{\r\n    istream_filter *state = (istream_filter *)state_;\r\n    state->stream->Release();\r\n    fz_free(ctx, state);\r\n}\r\n\r\nfz_stream *fz_open_istream(fz_context *ctx, IStream *stream);\r\n\r\nextern \"C\" static fz_stream *reopen_istream(fz_context *ctx, fz_stream *stm)\r\n{\r\n    istream_filter *state = (istream_filter *)stm->state;\r\n    ScopedComPtr<IStream> stream2;\r\n    HRESULT res = state->stream->Clone(&stream2);\r\n    if (E_NOTIMPL == res)\r\n        fz_throw(ctx, FZ_ERROR_GENERIC, \"IStream doesn't support cloning\");\r\n    if (FAILED(res))\r\n        fz_throw(ctx, FZ_ERROR_GENERIC, \"IStream clone error: %x\", res);\r\n    return fz_open_istream(ctx, stream2);\r\n}\r\n\r\nfz_stream *fz_open_istream(fz_context *ctx, IStream *stream)\r\n{\r\n    if (!stream)\r\n        return nullptr;\r\n\r\n    LARGE_INTEGER zero = { 0 };\r\n    HRESULT res = stream->Seek(zero, STREAM_SEEK_SET, nullptr);\r\n    if (FAILED(res))\r\n        fz_throw(ctx, FZ_ERROR_GENERIC, \"IStream seek error: %x\", res);\r\n\r\n    istream_filter *state = fz_malloc_struct(ctx, istream_filter);\r\n    state->stream = stream;\r\n    stream->AddRef();\r\n\r\n    fz_stream *stm = fz_new_stream(ctx, state, next_istream, close_istream, nullptr);\r\n    stm->seek = seek_istream;\r\n    stm->reopen = reopen_istream;\r\n    return stm;\r\n}\r\n\r\nfz_matrix fz_create_view_ctm(const fz_rect *mediabox, float zoom, int rotation)\r\n{\r\n    fz_matrix ctm;\r\n    fz_pre_scale(fz_rotate(&ctm, (float)rotation), zoom, zoom);\r\n\r\n    assert(0 == mediabox->x0 && 0 == mediabox->y0);\r\n    rotation = (rotation + 360) % 360;\r\n    if (90 == rotation)\r\n        fz_pre_translate(&ctm, 0, -mediabox->y1);\r\n    else if (180 == rotation)\r\n        fz_pre_translate(&ctm, -mediabox->x1, -mediabox->y1);\r\n    else if (270 == rotation)\r\n        fz_pre_translate(&ctm, -mediabox->x1, 0);\r\n\r\n    assert(fz_matrix_expansion(&ctm) > 0);\r\n    if (fz_matrix_expansion(&ctm) == 0)\r\n        return fz_identity;\r\n\r\n    return ctm;\r\n}\r\n\r\nstruct LinkRectList {\r\n    WStrVec links;\r\n    Vec<fz_rect> coords;\r\n};\r\n\r\nstatic bool LinkifyCheckMultiline(const WCHAR *pageText, const WCHAR *pos, RectI *coords)\r\n{\r\n    // multiline links end in a non-alphanumeric character and continue on a line\r\n    // that starts left and only slightly below where the current line ended\r\n    // (and that doesn't start with http or a footnote numeral)\r\n    return\r\n        '\\n' == *pos && pos > pageText && *(pos + 1) &&\r\n        !iswalnum(pos[-1]) && !str::IsWs(pos[1]) &&\r\n        coords[pos - pageText + 1].BR().y > coords[pos - pageText - 1].y &&\r\n        coords[pos - pageText + 1].y <= coords[pos - pageText - 1].BR().y + coords[pos - pageText - 1].dy * 0.35 &&\r\n        coords[pos - pageText + 1].x < coords[pos - pageText - 1].BR().x &&\r\n        coords[pos - pageText + 1].dy >= coords[pos - pageText - 1].dy * 0.85 &&\r\n        coords[pos - pageText + 1].dy <= coords[pos - pageText - 1].dy * 1.2 &&\r\n        !str::StartsWith(pos + 1, L\"http\");\r\n}\r\n\r\nstatic const WCHAR *LinkifyFindEnd(const WCHAR *start, WCHAR prevChar)\r\n{\r\n    const WCHAR *end, *quote;\r\n\r\n    // look for the end of the URL (ends in a space preceded maybe by interpunctuation)\r\n    for (end = start; *end && !str::IsWs(*end); end++);\r\n    if (',' == end[-1] || '.' == end[-1] || '?' == end[-1] || '!' == end[-1])\r\n        end--;\r\n    // also ignore a closing parenthesis, if the URL doesn't contain any opening one\r\n    if (')' == end[-1] && (!str::FindChar(start, '(') || str::FindChar(start, '(') >= end))\r\n        end--;\r\n    // cut the link at the first quotation mark, if it's also preceded by one\r\n    if (('\"' == prevChar || '\\'' == prevChar) && (quote = str::FindChar(start, prevChar)) != nullptr && quote < end)\r\n        end = quote;\r\n\r\n    return end;\r\n}\r\n\r\nstatic const WCHAR *LinkifyMultilineText(LinkRectList *list, const WCHAR *pageText, const WCHAR *start, const WCHAR *next, RectI *coords)\r\n{\r\n    size_t lastIx = list->coords.Count() - 1;\r\n    ScopedMem<WCHAR> uri(list->links.At(lastIx));\r\n    const WCHAR *end = next;\r\n    bool multiline = false;\r\n\r\n    do {\r\n        end = LinkifyFindEnd(next, start > pageText ? start[-1] : ' ');\r\n        multiline = LinkifyCheckMultiline(pageText, end, coords);\r\n\r\n        ScopedMem<WCHAR> part(str::DupN(next, end - next));\r\n        uri.Set(str::Join(uri, part));\r\n        RectI bbox = coords[next - pageText].Union(coords[end - pageText - 1]);\r\n        list->coords.Append(fz_RectD_to_rect(bbox.Convert<double>()));\r\n\r\n        next = end + 1;\r\n    } while (multiline);\r\n\r\n    // update the link URL for all partial links\r\n    list->links.At(lastIx) = str::Dup(uri);\r\n    for (size_t i = lastIx + 1; i < list->coords.Count(); i++)\r\n        list->links.Append(str::Dup(uri));\r\n\r\n    return end;\r\n}\r\n\r\n// cf. http://weblogs.mozillazine.org/gerv/archives/2011/05/html5_email_address_regexp.html\r\ninline bool IsEmailUsernameChar(WCHAR c)\r\n{\r\n    // explicitly excluding the '/' from the list, as it is more\r\n    // often part of a URL or path than of an email address\r\n    return iswalnum(c) || c && str::FindChar(L\".!#$%&'*+=?^_`{|}~-\", c);\r\n}\r\ninline bool IsEmailDomainChar(WCHAR c)\r\n{\r\n    return iswalnum(c) || '-' == c;\r\n}\r\n\r\nstatic const WCHAR *LinkifyFindEmail(const WCHAR *pageText, const WCHAR *at)\r\n{\r\n    const WCHAR *start;\r\n    for (start = at; start > pageText && IsEmailUsernameChar(*(start - 1)); start--);\r\n    return start != at ? start : nullptr;\r\n}\r\n\r\nstatic const WCHAR *LinkifyEmailAddress(const WCHAR *start)\r\n{\r\n    const WCHAR *end;\r\n    for (end = start; IsEmailUsernameChar(*end); end++);\r\n    if (end == start || *end != '@' || !IsEmailDomainChar(*(end + 1)))\r\n        return nullptr;\r\n    for (end++; IsEmailDomainChar(*end); end++);\r\n    if ('.' != *end || !IsEmailDomainChar(*(end + 1)))\r\n        return nullptr;\r\n    do {\r\n        for (end++; IsEmailDomainChar(*end); end++);\r\n    } while ('.' == *end && IsEmailDomainChar(*(end + 1)));\r\n    return end;\r\n}\r\n\r\n// caller needs to delete the result\r\nstatic LinkRectList *LinkifyText(const WCHAR *pageText, RectI *coords)\r\n{\r\n    LinkRectList *list = new LinkRectList;\r\n\r\n    for (const WCHAR *start = pageText; *start; start++) {\r\n        const WCHAR *end = nullptr;\r\n        bool multiline = false;\r\n        const WCHAR *protocol = nullptr;\r\n\r\n        if ('@' == *start) {\r\n            // potential email address without mailto:\r\n            const WCHAR *email = LinkifyFindEmail(pageText, start);\r\n            end = email ? LinkifyEmailAddress(email) : nullptr;\r\n            protocol = L\"mailto:\";\r\n            if (end != nullptr)\r\n                start = email;\r\n        }\r\n        else if (start > pageText && ('/' == start[-1] || iswalnum(start[-1]))) {\r\n            // hyperlinks must not be preceded by a slash (indicates a different protocol)\r\n            // or an alphanumeric character (indicates part of a different protocol)\r\n        }\r\n        else if ('h' == *start && str::Parse(start, L\"http%?s://\")) {\r\n            end = LinkifyFindEnd(start, start > pageText ? start[-1] : ' ');\r\n            multiline = LinkifyCheckMultiline(pageText, end, coords);\r\n        }\r\n        else if ('w' == *start && str::StartsWith(start, L\"www.\")) {\r\n            end = LinkifyFindEnd(start, start > pageText ? start[-1] : ' ');\r\n            multiline = LinkifyCheckMultiline(pageText, end, coords);\r\n            protocol = L\"http://\";\r\n            // ignore www. links without a top-level domain\r\n            if (end - start <= 4 || !multiline && (!wcschr(start + 5, '.') || wcschr(start + 5, '.') >= end))\r\n                end = nullptr;\r\n        }\r\n        else if ('m' == *start && str::StartsWith(start, L\"mailto:\")) {\r\n            end = LinkifyEmailAddress(start + 7);\r\n        }\r\n        if (!end)\r\n            continue;\r\n\r\n        ScopedMem<WCHAR> part(str::DupN(start, end - start));\r\n        WCHAR *uri = protocol ? str::Join(protocol, part) : part.StealData();\r\n        list->links.Append(uri);\r\n        RectI bbox = coords[start - pageText].Union(coords[end - pageText - 1]);\r\n        list->coords.Append(fz_RectD_to_rect(bbox.Convert<double>()));\r\n        if (multiline)\r\n            end = LinkifyMultilineText(list, pageText, start, end + 1, coords);\r\n\r\n        start = end;\r\n    }\r\n\r\n    return list;\r\n}\r\n\r\nstatic fz_link *FixupPageLinks(fz_link *root)\r\n{\r\n    // Links in PDF documents are added from bottom-most to top-most,\r\n    // i.e. links that appear later in the list should be preferred\r\n    // to links appearing before. Since we search from the start of\r\n    // the (single-linked) list, we have to reverse the order of links\r\n    // (cf. http://code.google.com/p/sumatrapdf/issues/detail?id=1303 )\r\n    fz_link *new_root = nullptr;\r\n    while (root) {\r\n        fz_link *tmp = root->next;\r\n        root->next = new_root;\r\n        new_root = root;\r\n        root = tmp;\r\n\r\n        // there are PDFs that have x,y positions in reverse order, so fix them up\r\n        fz_link *link = new_root;\r\n        if (link->rect.x0 > link->rect.x1)\r\n            std::swap(link->rect.x0, link->rect.x1);\r\n        if (link->rect.y0 > link->rect.y1)\r\n            std::swap(link->rect.y0, link->rect.y1);\r\n        assert(link->rect.x1 >= link->rect.x0);\r\n        assert(link->rect.y1 >= link->rect.y0);\r\n    }\r\n    return new_root;\r\n}\r\n\r\nclass SimpleDest : public PageDestination {\r\n    int pageNo;\r\n    RectD rect;\r\n\r\npublic:\r\n    SimpleDest(int pageNo, RectD rect) : pageNo(pageNo), rect(rect) { }\r\n\r\n    PageDestType GetDestType() const override { return Dest_ScrollTo; }\r\n    int GetDestPageNo() const override { return pageNo; }\r\n    RectD GetDestRect() const override { return rect; }\r\n};\r\n\r\nstruct FitzImagePos {\r\n    fz_image *image;\r\n    fz_rect rect;\r\n\r\n    explicit FitzImagePos(fz_image *image=nullptr, fz_rect rect=fz_unit_rect) :\r\n        image(image), rect(rect) { }\r\n};\r\n\r\nstruct ListInspectionData {\r\n    Vec<FitzImagePos> *images;\r\n    size_t mem_estimate;\r\n\r\n    explicit ListInspectionData(Vec<FitzImagePos>& images) : images(&images), mem_estimate(0) { }\r\n};\r\n\r\nextern \"C\" static void\r\nfz_inspection_free(fz_device *dev)\r\n{\r\n    // images are extracted in bottom-to-top order, but for GetElements\r\n    // we want to access them in top-to-bottom order (since images at\r\n    // the bottom might not be visible at all)\r\n    ((ListInspectionData *)dev->user)->images->Reverse();\r\n}\r\n\r\nstatic void fz_inspection_handle_path(fz_device *dev, fz_path *path)\r\n{\r\n    ((ListInspectionData *)dev->user)->mem_estimate += sizeof(fz_path) + path->cmd_cap + path->coord_cap * sizeof(float);\r\n}\r\n\r\nstatic void fz_inspection_handle_image(fz_device *dev, fz_image *image)\r\n{\r\n    int n = image->colorspace ? image->colorspace->n + 1 : 1;\r\n    ((ListInspectionData *)dev->user)->mem_estimate += sizeof(fz_image) + image->w * image->h * n;\r\n}\r\n\r\nextern \"C\" static void\r\nfz_inspection_fill_path(fz_device *dev, fz_path *path, int even_odd, const fz_matrix *ctm, fz_colorspace *colorspace, float *color, float alpha)\r\n{\r\n    UNUSED(even_odd); UNUSED(ctm); UNUSED(colorspace); UNUSED(color); UNUSED(alpha);\r\n    fz_inspection_handle_path(dev, path);\r\n}\r\n\r\nextern \"C\" static void\r\nfz_inspection_stroke_path(fz_device *dev, fz_path *path, fz_stroke_state *stroke, const fz_matrix *ctm, fz_colorspace *colorspace, float *color, float alpha)\r\n{\r\n    UNUSED(stroke); UNUSED(ctm); UNUSED(colorspace); UNUSED(color); UNUSED(alpha);\r\n    fz_inspection_handle_path(dev, path);\r\n}\r\n\r\nextern \"C\" static void\r\nfz_inspection_clip_path(fz_device *dev, fz_path *path, const fz_rect *rect, int even_odd, const fz_matrix *ctm)\r\n{\r\n    UNUSED(rect); UNUSED(even_odd); UNUSED(ctm);\r\n    fz_inspection_handle_path(dev, path);\r\n}\r\n\r\nextern \"C\" static void\r\nfz_inspection_clip_stroke_path(fz_device *dev, fz_path *path, const fz_rect *rect, fz_stroke_state *stroke, const fz_matrix *ctm)\r\n{\r\n    UNUSED(rect); UNUSED(stroke); UNUSED(ctm);\r\n    fz_inspection_handle_path(dev, path);\r\n}\r\n\r\nextern \"C\" static void\r\nfz_inspection_fill_shade(fz_device *dev, fz_shade *shade, const fz_matrix *ctm, float alpha)\r\n{\r\n    UNUSED(shade); UNUSED(ctm); UNUSED(alpha);\r\n    ((ListInspectionData *)dev->user)->mem_estimate += sizeof(fz_shade);\r\n}\r\n\r\nextern \"C\" static void\r\nfz_inspection_fill_image(fz_device *dev, fz_image *image, const fz_matrix *ctm, float alpha)\r\n{\r\n    UNUSED(alpha);\r\n    fz_inspection_handle_image(dev, image);\r\n    // extract rectangles for images a user might want to extract\r\n    // TODO: try to better distinguish images a user might actually want to extract\r\n    if (image->w < 16 || image->h < 16)\r\n        return;\r\n    fz_rect rect = fz_unit_rect;\r\n    fz_transform_rect(&rect, ctm);\r\n    if (!fz_is_empty_rect(&rect))\r\n        ((ListInspectionData *)dev->user)->images->Append(FitzImagePos(image, rect));\r\n}\r\n\r\nextern \"C\" static void\r\nfz_inspection_fill_image_mask(fz_device *dev, fz_image *image, const fz_matrix *ctm, fz_colorspace *colorspace, float *color, float alpha)\r\n{\r\n    UNUSED(ctm); UNUSED(colorspace); UNUSED(color); UNUSED(alpha);\r\n    fz_inspection_handle_image(dev, image);\r\n}\r\n\r\nextern \"C\" static void\r\nfz_inspection_clip_image_mask(fz_device *dev, fz_image *image, const fz_rect *rect, const fz_matrix *ctm)\r\n{\r\n    UNUSED(rect); UNUSED(ctm);\r\n    fz_inspection_handle_image(dev, image);\r\n}\r\n\r\nstatic fz_device *fz_new_inspection_device(fz_context *ctx, ListInspectionData *data)\r\n{\r\n    fz_device *dev = fz_new_device(ctx, data);\r\n    dev->free_user = fz_inspection_free;\r\n\r\n    dev->fill_path = fz_inspection_fill_path;\r\n    dev->stroke_path = fz_inspection_stroke_path;\r\n    dev->clip_path = fz_inspection_clip_path;\r\n    dev->clip_stroke_path = fz_inspection_clip_stroke_path;\r\n\r\n    dev->fill_shade = fz_inspection_fill_shade;\r\n    dev->fill_image = fz_inspection_fill_image;\r\n    dev->fill_image_mask = fz_inspection_fill_image_mask;\r\n    dev->clip_image_mask = fz_inspection_clip_image_mask;\r\n\r\n    return dev;\r\n}\r\n\r\nclass FitzAbortCookie : public AbortCookie {\r\npublic:\r\n    fz_cookie cookie;\r\n    FitzAbortCookie() { memset(&cookie, 0, sizeof(cookie)); }\r\n    void Abort() override { cookie.abort = 1; }\r\n};\r\n\r\nextern \"C\" static void\r\nfz_lock_context_cs(void *user, int lock)\r\n{\r\n    UNUSED(lock);\r\n    // we use a single critical section for all locks,\r\n    // since that critical section (ctxAccess) should\r\n    // be guarding all fz_context access anyway and\r\n    // thus already be in place (in debug builds we\r\n    // crash if that assertion doesn't hold)\r\n    CRITICAL_SECTION *cs = (CRITICAL_SECTION *)user;\r\n    BOOL ok = TryEnterCriticalSection(cs);\r\n    if (!ok) {\r\n        CrashIf(true);\r\n        EnterCriticalSection(cs);\r\n    }\r\n}\r\n\r\nextern \"C\" static void\r\nfz_unlock_context_cs(void *user, int lock)\r\n{\r\n    UNUSED(lock);\r\n    CRITICAL_SECTION *cs = (CRITICAL_SECTION *)user;\r\n    LeaveCriticalSection(cs);\r\n}\r\n\r\nstatic Vec<PageAnnotation> fz_get_user_page_annots(Vec<PageAnnotation>& userAnnots, int pageNo)\r\n{\r\n    Vec<PageAnnotation> result;\r\n    for (size_t i = 0; i < userAnnots.Count(); i++) {\r\n        PageAnnotation& annot = userAnnots.At(i);\r\n        if (annot.pageNo != pageNo)\r\n            continue;\r\n        // include all annotations for pageNo that can be rendered by fz_run_user_annots\r\n        switch (annot.type) {\r\n        case Annot_Highlight: case Annot_Underline: case Annot_StrikeOut: case Annot_Squiggly:\r\n            result.Append(annot);\r\n            break;\r\n        }\r\n    }\r\n    return result;\r\n}\r\n\r\nstatic void fz_run_user_page_annots(Vec<PageAnnotation>& pageAnnots, fz_device *dev, const fz_matrix *ctm, const fz_rect *cliprect, fz_cookie *cookie)\r\n{\r\n    for (size_t i = 0; i < pageAnnots.Count() && (!cookie || !cookie->abort); i++) {\r\n        PageAnnotation& annot = pageAnnots.At(i);\r\n        // skip annotation if it isn't visible\r\n        fz_rect rect = fz_RectD_to_rect(annot.rect);\r\n        fz_transform_rect(&rect, ctm);\r\n        fz_rect isect = rect;\r\n        if (cliprect && fz_is_empty_rect(fz_intersect_rect(&isect, cliprect)))\r\n            continue;\r\n        // prepare text highlighting path (cf. pdf_create_highlight_annot\r\n        // and pdf_create_markup_annot in pdf_annot.c)\r\n        fz_path *path = fz_new_path(dev->ctx);\r\n        fz_stroke_state *stroke = nullptr;\r\n        switch (annot.type) {\r\n        case Annot_Highlight:\r\n            fz_moveto(dev->ctx, path, annot.rect.TL().x, annot.rect.TL().y);\r\n            fz_lineto(dev->ctx, path, annot.rect.BR().x, annot.rect.TL().y);\r\n            fz_lineto(dev->ctx, path, annot.rect.BR().x, annot.rect.BR().y);\r\n            fz_lineto(dev->ctx, path, annot.rect.TL().x, annot.rect.BR().y);\r\n            fz_closepath(dev->ctx, path);\r\n            break;\r\n        case Annot_Underline:\r\n            fz_moveto(dev->ctx, path, annot.rect.TL().x, annot.rect.BR().y - 0.25f);\r\n            fz_lineto(dev->ctx, path, annot.rect.BR().x, annot.rect.BR().y - 0.25f);\r\n            break;\r\n        case Annot_StrikeOut:\r\n            fz_moveto(dev->ctx, path, annot.rect.TL().x, annot.rect.TL().y + annot.rect.dy / 2);\r\n            fz_lineto(dev->ctx, path, annot.rect.BR().x, annot.rect.TL().y + annot.rect.dy / 2);\r\n            break;\r\n        case Annot_Squiggly:\r\n            fz_moveto(dev->ctx, path, annot.rect.TL().x + 1, annot.rect.BR().y);\r\n            fz_lineto(dev->ctx, path, annot.rect.BR().x, annot.rect.BR().y);\r\n            fz_moveto(dev->ctx, path, annot.rect.TL().x, annot.rect.BR().y - 0.5f);\r\n            fz_lineto(dev->ctx, path, annot.rect.BR().x, annot.rect.BR().y - 0.5f);\r\n            stroke = fz_new_stroke_state_with_dash_len(dev->ctx, 2);\r\n            CrashIf(!stroke);\r\n            stroke->linewidth = 0.5f;\r\n            stroke->dash_list[stroke->dash_len++] = 1;\r\n            stroke->dash_list[stroke->dash_len++] = 1;\r\n            break;\r\n        default:\r\n            CrashIf(true);\r\n        }\r\n        fz_colorspace *cs = fz_device_rgb(dev->ctx);\r\n        float color[3] = { annot.color.r / 255.f, annot.color.g / 255.f, annot.color.b / 255.f };\r\n        if (Annot_Highlight == annot.type) {\r\n            // render path with transparency effect\r\n            fz_begin_group(dev, &rect, 0, 0, FZ_BLEND_MULTIPLY, 1.f);\r\n            fz_fill_path(dev, path, 0, ctm, cs, color, annot.color.a / 255.f);\r\n            fz_end_group(dev);\r\n        }\r\n        else {\r\n            if (!stroke)\r\n                stroke = fz_new_stroke_state(dev->ctx);\r\n            fz_stroke_path(dev, path, stroke, ctm, cs, color, 1.0f);\r\n            fz_drop_stroke_state(dev->ctx, stroke);\r\n        }\r\n        fz_free_path(dev->ctx, path);\r\n    }\r\n}\r\n\r\nstatic void fz_run_page_transparency(Vec<PageAnnotation>& pageAnnots, fz_device *dev, const fz_rect *cliprect, bool endGroup, bool hasTransparency=false)\r\n{\r\n    if (hasTransparency || pageAnnots.Count() == 0)\r\n        return;\r\n    bool needsTransparency = false;\r\n    for (size_t i = 0; i < pageAnnots.Count(); i++) {\r\n        if (Annot_Highlight == pageAnnots.At(i).type) {\r\n            needsTransparency = true;\r\n            break;\r\n        }\r\n    }\r\n    if (!needsTransparency)\r\n        return;\r\n    if (!endGroup)\r\n        fz_begin_group(dev, cliprect ? cliprect : &fz_infinite_rect, 1, 0, 0, 1);\r\n    else\r\n        fz_end_group(dev);\r\n}\r\n\r\n///// PDF-specific extensions to Fitz/MuPDF /////\r\n\r\nextern \"C\" {\r\n#include <mupdf/pdf.h>\r\n}\r\n\r\nnamespace str {\r\n    namespace conv {\r\n\r\ninline WCHAR *FromPdf(pdf_obj *obj)\r\n{\r\n    ScopedMem<WCHAR> str(AllocArray<WCHAR>(pdf_to_str_len(obj) + 1));\r\n    pdf_to_ucs2_buf((unsigned short *)str.Get(), obj);\r\n    return str.StealData();\r\n}\r\n\r\n    }\r\n}\r\n\r\n// some PDF documents contain control characters in outline titles or /Info properties\r\nWCHAR *pdf_clean_string(WCHAR *string)\r\n{\r\n    for (WCHAR *c = string; *c; c++) {\r\n        if (*c < 0x20 && *c != '\\n' && *c != '\\r' && *c != '\\t')\r\n            *c = ' ';\r\n    }\r\n    return string;\r\n}\r\n\r\npdf_obj *pdf_copy_str_dict(pdf_document *doc, pdf_obj *dict)\r\n{\r\n    pdf_obj *copy = pdf_copy_dict(dict);\r\n    for (int i = 0; i < pdf_dict_len(copy); i++) {\r\n        pdf_obj *val = pdf_dict_get_val(copy, i);\r\n        // resolve all indirect references\r\n        if (pdf_is_indirect(val)) {\r\n            pdf_obj *val2 = pdf_new_string(doc, pdf_to_str_buf(val), pdf_to_str_len(val));\r\n            pdf_dict_put(copy, pdf_dict_get_key(copy, i), val2);\r\n            pdf_drop_obj(val2);\r\n        }\r\n    }\r\n    return copy;\r\n}\r\n\r\n// Note: make sure to only call with ctxAccess\r\nfz_outline *pdf_loadattachments(pdf_document *doc)\r\n{\r\n    pdf_obj *dict = pdf_load_name_tree(doc, \"EmbeddedFiles\");\r\n    if (!dict)\r\n        return nullptr;\r\n\r\n    fz_outline root = { 0 }, *node = &root;\r\n    for (int i = 0; i < pdf_dict_len(dict); i++) {\r\n        pdf_obj *name = pdf_dict_get_key(dict, i);\r\n        pdf_obj *dest = pdf_dict_get_val(dict, i);\r\n        pdf_obj *embedded = pdf_dict_getsa(pdf_dict_gets(dest, \"EF\"), \"DOS\", \"F\");\r\n        if (!embedded)\r\n            continue;\r\n\r\n        node = node->next = (fz_outline *)fz_malloc_struct(doc->ctx, fz_outline);\r\n        node->title = fz_strdup(doc->ctx, pdf_to_name(name));\r\n        node->dest.kind = FZ_LINK_LAUNCH;\r\n        node->dest.ld.launch.file_spec = pdf_file_spec_to_str(doc, dest);\r\n        node->dest.ld.launch.new_window = 1;\r\n        node->dest.ld.launch.embedded_num = pdf_to_num(embedded);\r\n        node->dest.ld.launch.embedded_gen = pdf_to_gen(embedded);\r\n        node->dest.ld.launch.is_uri = 0;\r\n    }\r\n    pdf_drop_obj(dict);\r\n\r\n    return root.next;\r\n}\r\n\r\nstruct PageLabelInfo {\r\n    int startAt, countFrom;\r\n    const char *type;\r\n    pdf_obj *prefix;\r\n};\r\n\r\nint CmpPageLabelInfo(const void *a, const void *b)\r\n{\r\n    return ((PageLabelInfo *)a)->startAt - ((PageLabelInfo *)b)->startAt;\r\n}\r\n\r\nWCHAR *FormatPageLabel(const char *type, int pageNo, const WCHAR *prefix)\r\n{\r\n    if (str::Eq(type, \"D\"))\r\n        return str::Format(L\"%s%d\", prefix, pageNo);\r\n    if (str::EqI(type, \"R\")) {\r\n        // roman numbering style\r\n        ScopedMem<WCHAR> number(str::FormatRomanNumeral(pageNo));\r\n        if (*type == 'r')\r\n            str::ToLowerInPlace(number.Get());\r\n        return str::Format(L\"%s%s\", prefix, number);\r\n    }\r\n    if (str::EqI(type, \"A\")) {\r\n        // alphabetic numbering style (A..Z, AA..ZZ, AAA..ZZZ, ...)\r\n        str::Str<WCHAR> number;\r\n        number.Append('A' + (pageNo - 1) % 26);\r\n        for (int i = 0; i < (pageNo - 1) / 26; i++)\r\n            number.Append(number.At(0));\r\n        if (*type == 'a')\r\n            str::ToLowerInPlace(number.Get());\r\n        return str::Format(L\"%s%s\", prefix, number.Get());\r\n    }\r\n    return str::Dup(prefix);\r\n}\r\n\r\nvoid BuildPageLabelRec(pdf_obj *node, int pageCount, Vec<PageLabelInfo>& data)\r\n{\r\n    pdf_obj *obj;\r\n    if ((obj = pdf_dict_gets(node, \"Kids\")) != nullptr && !pdf_mark_obj(node)) {\r\n        for (int i = 0; i < pdf_array_len(obj); i++)\r\n            BuildPageLabelRec(pdf_array_get(obj, i), pageCount, data);\r\n        pdf_unmark_obj(node);\r\n    }\r\n    else if ((obj = pdf_dict_gets(node, \"Nums\")) != nullptr) {\r\n        for (int i = 0; i < pdf_array_len(obj); i += 2) {\r\n            pdf_obj *info = pdf_array_get(obj, i + 1);\r\n            PageLabelInfo pli;\r\n            pli.startAt = pdf_to_int(pdf_array_get(obj, i)) + 1;\r\n            if (pli.startAt < 1)\r\n                continue;\r\n\r\n            pli.type = pdf_to_name(pdf_dict_gets(info, \"S\"));\r\n            pli.prefix = pdf_dict_gets(info, \"P\");\r\n            pli.countFrom = pdf_to_int(pdf_dict_gets(info, \"St\"));\r\n            if (pli.countFrom < 1)\r\n                pli.countFrom = 1;\r\n            data.Append(pli);\r\n        }\r\n    }\r\n}\r\n\r\nWStrVec *BuildPageLabelVec(pdf_obj *root, int pageCount)\r\n{\r\n    Vec<PageLabelInfo> data;\r\n    BuildPageLabelRec(root, pageCount, data);\r\n    data.Sort(CmpPageLabelInfo);\r\n\r\n    if (data.Count() == 0)\r\n        return nullptr;\r\n\r\n    if (data.Count() == 1 && data.At(0).startAt == 1 && data.At(0).countFrom == 1 &&\r\n        !data.At(0).prefix && str::Eq(data.At(0).type, \"D\")) {\r\n        // this is the default case, no need for special treatment\r\n        return nullptr;\r\n    }\r\n\r\n    WStrVec *labels = new WStrVec();\r\n    labels->AppendBlanks(pageCount);\r\n\r\n    for (size_t i = 0; i < data.Count() && data.At(i).startAt <= pageCount; i++) {\r\n        int secLen = pageCount + 1 - data.At(i).startAt;\r\n        if (i < data.Count() - 1 && data.At(i + 1).startAt <= pageCount)\r\n            secLen = data.At(i + 1).startAt - data.At(i).startAt;\r\n        ScopedMem<WCHAR> prefix(str::conv::FromPdf(data.At(i).prefix));\r\n        for (int j = 0; j < secLen; j++) {\r\n            free(labels->At(data.At(i).startAt + j - 1));\r\n            labels->At(data.At(i).startAt + j - 1) =\r\n                FormatPageLabel(data.At(i).type, data.At(i).countFrom + j, prefix);\r\n        }\r\n    }\r\n\r\n    for (int ix = 0; (ix = labels->Find(nullptr, ix)) != -1; ix++)\r\n        labels->At(ix) = str::Dup(L\"\");\r\n\r\n    // ensure that all page labels are unique (by appending a number to duplicates)\r\n    WStrVec dups(*labels);\r\n    dups.Sort();\r\n    for (size_t i = 1; i < dups.Count(); i++) {\r\n        if (!str::Eq(dups.At(i), dups.At(i - 1)))\r\n            continue;\r\n        int ix = labels->Find(dups.At(i)), counter = 0;\r\n        while ((ix = labels->Find(dups.At(i), ix + 1)) != -1) {\r\n            ScopedMem<WCHAR> unique;\r\n            do {\r\n                unique.Set(str::Format(L\"%s.%d\", dups.At(i), ++counter));\r\n            } while (labels->Contains(unique));\r\n            str::ReplacePtr(&labels->At(ix), unique);\r\n        }\r\n        for (; i + 1 < dups.Count() && str::Eq(dups.At(i), dups.At(i + 1)); i++);\r\n    }\r\n\r\n    return labels;\r\n}\r\n\r\nstruct PageTreeStackItem {\r\n    pdf_obj *kids;\r\n    int i, len;\r\n    int next_page_no;\r\n\r\n    PageTreeStackItem() : kids(nullptr), i(-1), len(0), next_page_no(0) { }\r\n    explicit PageTreeStackItem(pdf_obj *kids, int next_page_no=0) :\r\n        kids(kids), i(-1), len(pdf_array_len(kids)), next_page_no(next_page_no) { }\r\n};\r\n\r\nstatic void\r\npdf_load_page_objs(pdf_document *doc, pdf_obj **page_objs)\r\n{\r\n    fz_context *ctx = doc->ctx;\r\n    int page_no = 0;\r\n\r\n    Vec<PageTreeStackItem> stack;\r\n    PageTreeStackItem top(pdf_dict_getp(pdf_trailer(doc), \"Root/Pages/Kids\"));\r\n\r\n    if (pdf_mark_obj(top.kids))\r\n        fz_throw(ctx, FZ_ERROR_GENERIC, \"cycle in page tree\");\r\n\r\n    fz_try(ctx) {\r\n        for (;;) {\r\n            top.i++;\r\n            if (top.i == top.len) {\r\n                pdf_unmark_obj(top.kids);\r\n                if (page_no < top.next_page_no)\r\n                    page_no = top.next_page_no;\r\n                if (stack.Size() == 0)\r\n                    break;\r\n                top = stack.Pop();\r\n                continue;\r\n            }\r\n\r\n            pdf_obj *kid = pdf_array_get(top.kids, top.i);\r\n            char *type = pdf_to_name(pdf_dict_gets(kid, \"Type\"));\r\n            if (*type ? str::Eq(type, \"Pages\") : pdf_dict_gets(kid, \"Kids\") && !pdf_dict_gets(kid, \"MediaBox\")) {\r\n                int count = pdf_to_int(pdf_dict_gets(kid, \"Count\"));\r\n                if (count > 0) {\r\n                    stack.Push(top);\r\n                    top = PageTreeStackItem(pdf_dict_gets(kid, \"Kids\"), page_no + count);\r\n\r\n                    if (pdf_mark_obj(top.kids))\r\n                        fz_throw(ctx, FZ_ERROR_GENERIC, \"cycle in page tree\");\r\n                }\r\n            }\r\n            else {\r\n                if (*type ? !str::Eq(type, \"Page\") : !pdf_dict_gets(kid, \"MediaBox\"))\r\n                    fz_warn(ctx, \"non-page object in page tree (%s)\", type);\r\n                if (page_no >= pdf_count_pages(doc))\r\n                    fz_throw(ctx, FZ_ERROR_GENERIC, \"found more /Page objects than anticipated\");\r\n\r\n                page_objs[page_no] = pdf_keep_obj(kid);\r\n                page_no++;\r\n            }\r\n        }\r\n    }\r\n    fz_catch(ctx) {\r\n        for (size_t i = 0; i < stack.Size(); i++) {\r\n            pdf_unmark_obj(stack.At(i).kids);\r\n        }\r\n        pdf_unmark_obj(top.kids);\r\n        fz_rethrow(ctx);\r\n    }\r\n\r\n    doc->page_objs = page_objs;\r\n}\r\n\r\n///// Above are extensions to Fitz and MuPDF, now follows PdfEngine /////\r\n\r\nstruct PdfPageRun {\r\n    pdf_page *page;\r\n    fz_display_list *list;\r\n    size_t size_est;\r\n    int refs;\r\n\r\n    PdfPageRun(pdf_page *page, fz_display_list *list, ListInspectionData& data) :\r\n        page(page), list(list), size_est(data.mem_estimate), refs(1) { }\r\n};\r\n\r\nclass PdfTocItem;\r\nclass PdfLink;\r\nclass PdfImage;\r\n\r\nclass PdfEngineImpl : public BaseEngine {\r\n    friend PdfLink;\r\n    friend PdfImage;\r\n\r\npublic:\r\n    PdfEngineImpl();\r\n    virtual ~PdfEngineImpl();\r\n    BaseEngine *Clone() override;\r\n\r\n    const WCHAR *FileName() const  override { return _fileName; };\r\n    int PageCount() const override {\r\n        // make sure that _doc->page_count is initialized as soon as\r\n        // _doc is defined, so that pdf_count_pages can't throw\r\n        return _doc ? pdf_count_pages(_doc) : 0;\r\n    }\r\n\r\n    RectD PageMediabox(int pageNo) override;\r\n    RectD PageContentBox(int pageNo, RenderTarget target=Target_View) override;\r\n\r\n    RenderedBitmap *RenderBitmap(int pageNo, float zoom, int rotation,\r\n                         RectD *pageRect=nullptr, /* if nullptr: defaults to the page's mediabox */\r\n                         RenderTarget target=Target_View, AbortCookie **cookie_out=nullptr) override;\r\n\r\n    PointD Transform(PointD pt, int pageNo, float zoom, int rotation, bool inverse=false) override;\r\n    RectD Transform(RectD rect, int pageNo, float zoom, int rotation, bool inverse=false) override;\r\n\r\n    unsigned char *GetFileData(size_t *cbCount) override;\r\n    bool SaveFileAs(const WCHAR *copyFileName, bool includeUserAnnots=false) override;\r\n    virtual bool SaveFileAsPdf(const WCHAR *pdfFileName, bool includeUserAnnots=false) {\r\n        return SaveFileAs(pdfFileName, includeUserAnnots);\r\n    }\r\n    WCHAR * ExtractPageText(int pageNo, const WCHAR *lineSep, RectI **coordsOut=nullptr,\r\n                                    RenderTarget target=Target_View) override;\r\n    bool HasClipOptimizations(int pageNo) override;\r\n    PageLayoutType PreferredLayout() override;\r\n    WCHAR *GetProperty(DocumentProperty prop) override;\r\n\r\n    bool SupportsAnnotation(bool forSaving=false) const override;\r\n    void UpdateUserAnnotations(Vec<PageAnnotation> *list) override;\r\n\r\n    bool AllowsPrinting() const override {\r\n        return pdf_has_permission(_doc, PDF_PERM_PRINT);\r\n    }\r\n    bool AllowsCopyingText() const override {\r\n        return pdf_has_permission(_doc, PDF_PERM_COPY);\r\n    }\r\n\r\n    float GetFileDPI() const override { return 72.0f; }\r\n    const WCHAR *GetDefaultFileExt() const override { return L\".pdf\"; }\r\n\r\n    bool BenchLoadPage(int pageNo)  override { return GetPdfPage(pageNo) != nullptr; }\r\n\r\n    Vec<PageElement *> *GetElements(int pageNo) override;\r\n    PageElement *GetElementAtPos(int pageNo, PointD pt) override;\r\n\r\n    PageDestination *GetNamedDest(const WCHAR *name) override;\r\n    bool HasTocTree() const override {\r\n        return outline != nullptr || attachments != nullptr;\r\n    }\r\n    DocTocItem *GetTocTree() override;\r\n\r\n    bool HasPageLabels() const override { return _pagelabels != nullptr; }\r\n    WCHAR *GetPageLabel(int pageNo) const override;\r\n    int GetPageByLabel(const WCHAR *label) const override;\r\n\r\n    bool IsPasswordProtected() const override { return isProtected; }\r\n    char *GetDecryptionKey() const override;\r\n\r\n    static BaseEngine *CreateFromFile(const WCHAR *fileName, PasswordUI *pwdUI);\r\n    static BaseEngine *CreateFromStream(IStream *stream, PasswordUI *pwdUI);\r\n\r\nprotected:\r\n    WCHAR *_fileName;\r\n    char *_decryptionKey;\r\n    bool isProtected;\r\n\r\n    // make sure to never ask for pagesAccess in an ctxAccess\r\n    // protected critical section in order to avoid deadlocks\r\n    CRITICAL_SECTION ctxAccess;\r\n    fz_context *    ctx;\r\n    fz_locks_context fz_locks_ctx;\r\n    pdf_document *  _doc;\r\n\r\n    CRITICAL_SECTION pagesAccess;\r\n    pdf_page **     _pages;\r\n    pdf_obj **      _pageObjs;\r\n\r\n    bool            Load(const WCHAR *fileName, PasswordUI *pwdUI=nullptr);\r\n    bool            Load(IStream *stream, PasswordUI *pwdUI=nullptr);\r\n    bool            Load(fz_stream *stm, PasswordUI *pwdUI=nullptr);\r\n    bool            LoadFromStream(fz_stream *stm, PasswordUI *pwdUI=nullptr);\r\n    bool            FinishLoading();\r\n\r\n    pdf_page      * GetPdfPage(int pageNo, bool failIfBusy=false);\r\n    int             GetPageNo(pdf_page *page);\r\n    fz_matrix       viewctm(int pageNo, float zoom, int rotation) {\r\n        const fz_rect tmpRc = fz_RectD_to_rect(PageMediabox(pageNo));\r\n        return fz_create_view_ctm(&tmpRc, zoom, rotation);\r\n    }\r\n    fz_matrix       viewctm(pdf_page *page, float zoom, int rotation) {\r\n        fz_rect r;\r\n        return fz_create_view_ctm(pdf_bound_page(_doc, page, &r), zoom, rotation);\r\n    }\r\n    WCHAR         * ExtractPageText(pdf_page *page, const WCHAR *lineSep, RectI **coordsOut=nullptr,\r\n                                    RenderTarget target=Target_View, bool cacheRun=false);\r\n\r\n    Vec<PdfPageRun *> runCache; // ordered most recently used first\r\n    PdfPageRun    * CreatePageRun(pdf_page *page, fz_display_list *list);\r\n    PdfPageRun    * GetPageRun(pdf_page *page, bool tryOnly=false);\r\n    bool            RunPage(pdf_page *page, fz_device *dev, const fz_matrix *ctm,\r\n                            RenderTarget target=Target_View,\r\n                            const fz_rect *cliprect=nullptr, bool cacheRun=true,\r\n                            FitzAbortCookie *cookie=nullptr);\r\n    void            DropPageRun(PdfPageRun *run, bool forceRemove=false);\r\n\r\n    PdfTocItem    * BuildTocTree(fz_outline *entry, int& idCounter);\r\n    void            LinkifyPageText(pdf_page *page);\r\n    pdf_annot    ** ProcessPageAnnotations(pdf_page *page);\r\n    RenderedBitmap *GetPageImage(int pageNo, RectD rect, size_t imageIx);\r\n    WCHAR         * ExtractFontList();\r\n    bool            IsLinearizedFile();\r\n\r\n    bool            SaveEmbedded(LinkSaverUI& saveUI, int num, int gen);\r\n    bool            SaveUserAnnots(const WCHAR *fileName);\r\n\r\n    RectD         * _mediaboxes;\r\n    fz_outline    * outline;\r\n    fz_outline    * attachments;\r\n    pdf_obj       * _info;\r\n    WStrVec       * _pagelabels;\r\n    pdf_annot   *** pageAnnots;\r\n    fz_rect      ** imageRects;\r\n\r\n    Vec<PageAnnotation> userAnnots;\r\n};\r\n\r\nclass PdfLink : public PageElement, public PageDestination {\r\n    PdfEngineImpl *engine;\r\n    fz_link_dest *link; // owned by an fz_link or fz_outline\r\n    RectD rect;\r\n    int pageNo;\r\n    PointD pt;\r\n\r\npublic:\r\n    PdfLink(PdfEngineImpl *engine, fz_link_dest *link,\r\n        fz_rect rect=fz_empty_rect, int pageNo=-1, fz_point *pt=nullptr) :\r\n        engine(engine), link(link), rect(fz_rect_to_RectD(rect)), pageNo(pageNo) {\r\n        // cursor coordinates for IsMap URI links\r\n        if (pt)\r\n            this->pt = PointD(pt->x, pt->y);\r\n    }\r\n\r\n    // PageElement\r\n    PageElementType GetType() const override { return Element_Link; }\r\n    int GetPageNo() const override { return pageNo; }\r\n    RectD GetRect() const override { return rect; }\r\n    WCHAR *GetValue() const override;\r\n    virtual PageDestination *AsLink() { return this; }\r\n\r\n    // PageDestination\r\n    PageDestType GetDestType() const override;\r\n    int GetDestPageNo() const override;\r\n    RectD GetDestRect() const override;\r\n    WCHAR *GetDestValue() const override { return GetValue(); }\r\n    WCHAR *GetDestName() const override;\r\n\r\n    virtual bool SaveEmbedded(LinkSaverUI& saveUI);\r\n};\r\n\r\nclass PdfComment : public PageElement {\r\n    PageAnnotation annot;\r\n    ScopedMem<WCHAR> content;\r\n\r\npublic:\r\n    PdfComment(const WCHAR *content, RectD rect, int pageNo) :\r\n        annot(Annot_None, pageNo, rect, PageAnnotation::Color()),\r\n        content(str::Dup(content)) { }\r\n\r\n    virtual PageElementType GetType() const { return Element_Comment; }\r\n    virtual int GetPageNo() const { return annot.pageNo; }\r\n    virtual RectD GetRect() const { return annot.rect; }\r\n    virtual WCHAR *GetValue() const { return str::Dup(content); }\r\n};\r\n\r\nclass PdfTocItem : public DocTocItem {\r\n    PdfLink link;\r\n\r\npublic:\r\n    PdfTocItem(WCHAR *title, PdfLink link) : DocTocItem(title), link(link) { }\r\n\r\n    virtual PageDestination *GetLink() { return &link; }\r\n};\r\n\r\nclass PdfImage : public PageElement {\r\n    PdfEngineImpl *engine;\r\n    int pageNo;\r\n    RectD rect;\r\n    size_t imageIx;\r\n\r\npublic:\r\n    PdfImage(PdfEngineImpl *engine, int pageNo, fz_rect rect, size_t imageIx) :\r\n        engine(engine), pageNo(pageNo), rect(fz_rect_to_RectD(rect)), imageIx(imageIx) { }\r\n\r\n    virtual PageElementType GetType() const { return Element_Image; }\r\n    virtual int GetPageNo() const { return pageNo; }\r\n    virtual RectD GetRect() const { return rect; }\r\n    virtual WCHAR *GetValue() const { return nullptr; }\r\n\r\n    virtual RenderedBitmap *GetImage() {\r\n        return engine->GetPageImage(pageNo, rect, imageIx);\r\n    }\r\n};\r\n\r\nPdfEngineImpl::PdfEngineImpl() : _fileName(nullptr), _doc(nullptr),\r\n    _pages(nullptr), _pageObjs(nullptr), _mediaboxes(nullptr), _info(nullptr),\r\n    outline(nullptr), attachments(nullptr), _pagelabels(nullptr),\r\n    _decryptionKey(nullptr), isProtected(false),\r\n    pageAnnots(nullptr), imageRects(nullptr)\r\n{\r\n    InitializeCriticalSection(&pagesAccess);\r\n    InitializeCriticalSection(&ctxAccess);\r\n\r\n    fz_locks_ctx.user = &ctxAccess;\r\n    fz_locks_ctx.lock = fz_lock_context_cs;\r\n    fz_locks_ctx.unlock = fz_unlock_context_cs;\r\n    ctx = fz_new_context(nullptr, &fz_locks_ctx, MAX_CONTEXT_MEMORY);\r\n\r\n    if (ctx)\r\n        pdf_install_load_system_font_funcs(ctx);\r\n}\r\n\r\nPdfEngineImpl::~PdfEngineImpl()\r\n{\r\n    EnterCriticalSection(&pagesAccess);\r\n    EnterCriticalSection(&ctxAccess);\r\n\r\n    if (_pages) {\r\n        for (int i = 0; i < PageCount(); i++) {\r\n            pdf_free_page(_doc, _pages[i]);\r\n        }\r\n        free(_pages);\r\n    }\r\n    if (_pageObjs) {\r\n        for (int i = 0; i < PageCount(); i++) {\r\n            pdf_drop_obj(_pageObjs[i]);\r\n        }\r\n        free(_pageObjs);\r\n    }\r\n\r\n    fz_free_outline(ctx, outline);\r\n    fz_free_outline(ctx, attachments);\r\n    pdf_drop_obj(_info);\r\n\r\n    if (pageAnnots) {\r\n        for (int i = 0; i < PageCount(); i++) {\r\n            free(pageAnnots[i]);\r\n        }\r\n        free(pageAnnots);\r\n    }\r\n    if (imageRects) {\r\n        for (int i = 0; i < PageCount(); i++) {\r\n            free(imageRects[i]);\r\n        }\r\n        free(imageRects);\r\n    }\r\n\r\n    while (runCache.Count() > 0) {\r\n        assert(runCache.Last()->refs == 1);\r\n        DropPageRun(runCache.Last(), true);\r\n    }\r\n\r\n    pdf_close_document(_doc);\r\n    _doc = nullptr;\r\n    fz_free_context(ctx);\r\n    ctx = nullptr;\r\n\r\n    free(_mediaboxes);\r\n    delete _pagelabels;\r\n    free(_fileName);\r\n    free(_decryptionKey);\r\n\r\n    LeaveCriticalSection(&ctxAccess);\r\n    DeleteCriticalSection(&ctxAccess);\r\n    LeaveCriticalSection(&pagesAccess);\r\n    DeleteCriticalSection(&pagesAccess);\r\n}\r\n\r\nclass PasswordCloner : public PasswordUI {\r\n    unsigned char *cryptKey;\r\n\r\npublic:\r\n    explicit PasswordCloner(unsigned char *cryptKey) : cryptKey(cryptKey) { }\r\n\r\n    virtual WCHAR * GetPassword(const WCHAR *fileName, unsigned char *fileDigest,\r\n                                unsigned char decryptionKeyOut[32], bool *saveKey) {\r\n        UNUSED(fileName); UNUSED(fileDigest);\r\n        memcpy(decryptionKeyOut, cryptKey, 32);\r\n        *saveKey = true;\r\n        return nullptr;\r\n    }\r\n};\r\n\r\nBaseEngine *PdfEngineImpl::Clone()\r\n{\r\n    ScopedCritSec scope(&ctxAccess);\r\n\r\n    // use this document's encryption key (if any) to load the clone\r\n    PasswordCloner *pwdUI = nullptr;\r\n    if (pdf_crypt_key(_doc))\r\n        pwdUI = new PasswordCloner(pdf_crypt_key(_doc));\r\n\r\n    PdfEngineImpl *clone = new PdfEngineImpl();\r\n    if (!clone || !(_fileName ? clone->Load(_fileName, pwdUI) : clone->Load(_doc->file, pwdUI))) {\r\n        delete clone;\r\n        delete pwdUI;\r\n        return nullptr;\r\n    }\r\n    delete pwdUI;\r\n\r\n    if (!_decryptionKey && _doc->crypt) {\r\n        delete clone->_decryptionKey;\r\n        clone->_decryptionKey = nullptr;\r\n    }\r\n\r\n    clone->UpdateUserAnnotations(&userAnnots);\r\n\r\n    return clone;\r\n}\r\n\r\nstatic const WCHAR *findEmbedMarks(const WCHAR *fileName)\r\n{\r\n    const WCHAR *embedMarks = nullptr;\r\n\r\n    int colonCount = 0;\r\n    for (const WCHAR *c = fileName + str::Len(fileName) - 1; c > fileName; c--) {\r\n        if (*c == ':') {\r\n            if (!str::IsDigit(*(c + 1)))\r\n                break;\r\n            if (++colonCount % 2 == 0)\r\n                embedMarks = c;\r\n        }\r\n        else if (!str::IsDigit(*c))\r\n            break;\r\n    }\r\n\r\n    return embedMarks;\r\n}\r\n\r\nbool PdfEngineImpl::Load(const WCHAR *fileName, PasswordUI *pwdUI)\r\n{\r\n    assert(!_fileName && !_doc && ctx);\r\n    _fileName = str::Dup(fileName);\r\n    if (!_fileName || !ctx)\r\n        return false;\r\n\r\n    fz_stream *file = nullptr;\r\n    // File names ending in :<digits>:<digits> are interpreted as containing\r\n    // embedded PDF documents (the digits are :<num>:<gen> of the embedded file stream)\r\n    WCHAR *embedMarks = (WCHAR *)findEmbedMarks(_fileName);\r\n    if (embedMarks)\r\n        *embedMarks = '\\0';\r\n    fz_try(ctx) {\r\n        file = fz_open_file2(ctx, _fileName);\r\n    }\r\n    fz_catch(ctx) {\r\n        file = nullptr;\r\n    }\r\n    if (embedMarks)\r\n        *embedMarks = ':';\r\n\r\nOpenEmbeddedFile:\r\n    if (!LoadFromStream(file, pwdUI))\r\n        return false;\r\n\r\n    if (str::IsEmpty(embedMarks))\r\n        return FinishLoading();\r\n\r\n    int num, gen;\r\n    embedMarks = (WCHAR *)str::Parse(embedMarks, L\":%d:%d\", &num, &gen);\r\n    assert(embedMarks);\r\n    if (!embedMarks || !pdf_is_stream(_doc, num, gen))\r\n        return false;\r\n\r\n    fz_buffer *buffer = nullptr;\r\n    fz_var(buffer);\r\n    fz_try(ctx) {\r\n        buffer = pdf_load_stream(_doc, num, gen);\r\n        file = fz_open_buffer(ctx, buffer);\r\n    }\r\n    fz_always(ctx) {\r\n        fz_drop_buffer(ctx, buffer);\r\n    }\r\n    fz_catch(ctx) {\r\n        return false;\r\n    }\r\n\r\n    pdf_close_document(_doc);\r\n    _doc = nullptr;\r\n\r\n    goto OpenEmbeddedFile;\r\n}\r\n\r\nbool PdfEngineImpl::Load(IStream *stream, PasswordUI *pwdUI)\r\n{\r\n    assert(!_fileName && !_doc && ctx);\r\n    if (!ctx)\r\n        return false;\r\n\r\n    fz_stream *stm = nullptr;\r\n    fz_try(ctx) {\r\n        stm = fz_open_istream(ctx, stream);\r\n    }\r\n    fz_catch(ctx) {\r\n        return false;\r\n    }\r\n    if (!LoadFromStream(stm, pwdUI))\r\n        return false;\r\n    return FinishLoading();\r\n}\r\n\r\nbool PdfEngineImpl::Load(fz_stream *stm, PasswordUI *pwdUI)\r\n{\r\n    assert(!_fileName && !_doc && ctx);\r\n    if (!ctx)\r\n        return false;\r\n\r\n    fz_try(ctx) {\r\n        stm = fz_clone_stream(ctx, stm);\r\n    }\r\n    fz_catch(ctx) {\r\n        return false;\r\n    }\r\n    if (!LoadFromStream(stm, pwdUI))\r\n        return false;\r\n    return FinishLoading();\r\n}\r\n\r\nbool PdfEngineImpl::LoadFromStream(fz_stream *stm, PasswordUI *pwdUI)\r\n{\r\n    if (!stm)\r\n        return false;\r\n\r\n    fz_try(ctx) {\r\n        _doc = pdf_open_document_with_stream(ctx, stm);\r\n    }\r\n    fz_always(ctx) {\r\n        fz_close(stm);\r\n    }\r\n    fz_catch(ctx) {\r\n        return false;\r\n    }\r\n\r\n    isProtected = pdf_needs_password(_doc);\r\n    if (!isProtected)\r\n        return true;\r\n\r\n    if (!pwdUI)\r\n        return false;\r\n\r\n    unsigned char digest[16 + 32] = { 0 };\r\n    fz_stream_fingerprint(_doc->file, digest);\r\n\r\n    bool ok = false, saveKey = false;\r\n    while (!ok) {\r\n        ScopedMem<WCHAR> pwd(pwdUI->GetPassword(_fileName, digest, pdf_crypt_key(_doc), &saveKey));\r\n        if (!pwd) {\r\n            // password not given or encryption key has been remembered\r\n            ok = saveKey;\r\n            break;\r\n        }\r\n\r\n        // MuPDF expects passwords to be UTF-8 encoded\r\n        ScopedMem<char> pwd_utf8(str::conv::ToUtf8(pwd));\r\n        ok = pwd_utf8 && pdf_authenticate_password(_doc, pwd_utf8);\r\n        // according to the spec (1.7 ExtensionLevel 3), the password\r\n        // for crypt revisions 5 and above are in SASLprep normalization\r\n        if (!ok) {\r\n            // TODO: this is only part of SASLprep\r\n            pwd.Set(NormalizeString(pwd, 5 /* NormalizationKC */));\r\n            if (pwd) {\r\n                pwd_utf8.Set(str::conv::ToUtf8(pwd));\r\n                ok = pwd_utf8 && pdf_authenticate_password(_doc, pwd_utf8);\r\n            }\r\n        }\r\n        // older Acrobat versions seem to have considered passwords to be in codepage 1252\r\n        // note: such passwords aren't portable when stored as Unicode text\r\n        if (!ok && GetACP() != 1252) {\r\n            ScopedMem<char> pwd_ansi(str::conv::ToAnsi(pwd));\r\n            ScopedMem<WCHAR> pwd_cp1252(str::conv::FromCodePage(pwd_ansi, 1252));\r\n            pwd_utf8.Set(str::conv::ToUtf8(pwd_cp1252));\r\n            ok = pwd_utf8 && pdf_authenticate_password(_doc, pwd_utf8);\r\n        }\r\n    }\r\n\r\n    if (ok && saveKey) {\r\n        memcpy(digest + 16, pdf_crypt_key(_doc), 32);\r\n        _decryptionKey = _MemToHex(&digest);\r\n    }\r\n\r\n    return ok;\r\n}\r\n\r\nbool PdfEngineImpl::FinishLoading()\r\n{\r\n    fz_try(ctx) {\r\n        // this call might throw the first time\r\n        pdf_count_pages(_doc);\r\n    }\r\n    fz_catch(ctx) {\r\n        return false;\r\n    }\r\n    if (PageCount() == 0) {\r\n        fz_warn(ctx, \"document has no pages\");\r\n        return false;\r\n    }\r\n\r\n    _pages = AllocArray<pdf_page *>(PageCount());\r\n    _pageObjs = AllocArray<pdf_obj *>(PageCount());\r\n    _mediaboxes = AllocArray<RectD>(PageCount());\r\n    pageAnnots = AllocArray<pdf_annot **>(PageCount());\r\n    imageRects = AllocArray<fz_rect *>(PageCount());\r\n\r\n    if (!_pages || !_pageObjs || !_mediaboxes || !pageAnnots || !imageRects)\r\n        return false;\r\n\r\n    ScopedCritSec scope(&ctxAccess);\r\n\r\n    fz_try(ctx) {\r\n        pdf_load_page_objs(_doc, _pageObjs);\r\n    }\r\n    fz_catch(ctx) {\r\n        fz_warn(ctx, \"Couldn't load all page objects\");\r\n    }\r\n    fz_try(ctx) {\r\n        outline = pdf_load_outline(_doc);\r\n    }\r\n    fz_catch(ctx) {\r\n        // ignore errors from pdf_load_outline()\r\n        // this information is not critical and checking the\r\n        // error might prevent loading some pdfs that would\r\n        // otherwise get displayed\r\n        fz_warn(ctx, \"Couldn't load outline\");\r\n    }\r\n    fz_try(ctx) {\r\n        attachments = pdf_loadattachments(_doc);\r\n    }\r\n    fz_catch(ctx) {\r\n        fz_warn(ctx, \"Couldn't load attachments\");\r\n    }\r\n    fz_try(ctx) {\r\n        // keep a copy of the Info dictionary, as accessing the original\r\n        // isn't thread safe and we don't want to block for this when\r\n        // displaying document properties\r\n        _info = pdf_dict_gets(pdf_trailer(_doc), \"Info\");\r\n        if (_info)\r\n            _info = pdf_copy_str_dict(_doc, _info);\r\n        if (!_info)\r\n            _info = pdf_new_dict(_doc, 4);\r\n        // also remember linearization and tagged states at this point\r\n        if (IsLinearizedFile())\r\n            pdf_dict_puts_drop(_info, \"Linearized\", pdf_new_bool(_doc, 1));\r\n        if (pdf_to_bool(pdf_dict_getp(pdf_trailer(_doc), \"Root/MarkInfo/Marked\")))\r\n            pdf_dict_puts_drop(_info, \"Marked\", pdf_new_bool(_doc, 1));\r\n        // also remember known output intents (PDF/X, etc.)\r\n        pdf_obj *intents = pdf_dict_getp(pdf_trailer(_doc), \"Root/OutputIntents\");\r\n        if (pdf_is_array(intents)) {\r\n            pdf_obj *list = pdf_new_array(_doc, pdf_array_len(intents));\r\n            for (int i = 0; i < pdf_array_len(intents); i++) {\r\n                pdf_obj *intent = pdf_dict_gets(pdf_array_get(intents, i), \"S\");\r\n                if (pdf_is_name(intent) && !pdf_is_indirect(intent) && str::StartsWith(pdf_to_name(intent), \"GTS_PDF\"))\r\n                    pdf_array_push(list, intent);\r\n            }\r\n            pdf_dict_puts_drop(_info, \"OutputIntents\", list);\r\n        }\r\n        // also note common unsupported features (such as XFA forms)\r\n        pdf_obj *xfa = pdf_dict_getp(pdf_trailer(_doc), \"Root/AcroForm/XFA\");\r\n        if (pdf_is_array(xfa))\r\n            pdf_dict_puts_drop(_info, \"Unsupported_XFA\", pdf_new_bool(_doc, 1));\r\n    }\r\n    fz_catch(ctx) {\r\n        fz_warn(ctx, \"Couldn't load document properties\");\r\n        pdf_drop_obj(_info);\r\n        _info = nullptr;\r\n    }\r\n    fz_try(ctx) {\r\n        pdf_obj *pagelabels = pdf_dict_getp(pdf_trailer(_doc), \"Root/PageLabels\");\r\n        if (pagelabels)\r\n            _pagelabels = BuildPageLabelVec(pagelabels, PageCount());\r\n    }\r\n    fz_catch(ctx) {\r\n        fz_warn(ctx, \"Couldn't load page labels\");\r\n    }\r\n\r\n    AssertCrash(!pdf_js_supported(_doc));\r\n\r\n    return true;\r\n}\r\n\r\nPdfTocItem *PdfEngineImpl::BuildTocTree(fz_outline *entry, int& idCounter)\r\n{\r\n    PdfTocItem *node = nullptr;\r\n\r\n    for (; entry; entry = entry->next) {\r\n        WCHAR *name = entry->title ? pdf_clean_string(str::conv::FromUtf8(entry->title)) : str::Dup(L\"\");\r\n        PdfTocItem *item = new PdfTocItem(name, PdfLink(this, &entry->dest));\r\n        item->open = entry->is_open;\r\n        item->id = ++idCounter;\r\n\r\n        if (entry->dest.kind == FZ_LINK_GOTO)\r\n            item->pageNo = entry->dest.ld.gotor.page + 1;\r\n        if (entry->down)\r\n            item->child = BuildTocTree(entry->down, idCounter);\r\n\r\n        if (!node)\r\n            node = item;\r\n        else\r\n            node->AddSibling(item);\r\n    }\r\n\r\n    return node;\r\n}\r\n\r\nDocTocItem *PdfEngineImpl::GetTocTree()\r\n{\r\n    PdfTocItem *node = nullptr;\r\n    int idCounter = 0;\r\n\r\n    if (outline) {\r\n        node = BuildTocTree(outline, idCounter);\r\n        if (attachments)\r\n            node->AddSibling(BuildTocTree(attachments, idCounter));\r\n    } else if (attachments)\r\n        node = BuildTocTree(attachments, idCounter);\r\n\r\n    return node;\r\n}\r\n\r\nPageDestination *PdfEngineImpl::GetNamedDest(const WCHAR *name)\r\n{\r\n    ScopedCritSec scope1(&pagesAccess);\r\n    ScopedCritSec scope2(&ctxAccess);\r\n\r\n    ScopedMem<char> name_utf8(str::conv::ToUtf8(name));\r\n    pdf_obj *dest = nullptr;\r\n    fz_try(ctx) {\r\n        pdf_obj *nameobj = pdf_new_string(_doc, name_utf8, (int)str::Len(name_utf8));\r\n        dest = pdf_lookup_dest(_doc, nameobj);\r\n        pdf_drop_obj(nameobj);\r\n    }\r\n    fz_catch(ctx) {\r\n        return nullptr;\r\n    }\r\n\r\n    PageDestination *pageDest = nullptr;\r\n    fz_link_dest ld = { FZ_LINK_NONE, 0 };\r\n    fz_try(ctx) {\r\n        ld = pdf_parse_link_dest(_doc, FZ_LINK_GOTO, dest);\r\n    }\r\n    fz_catch(ctx) {\r\n        return nullptr;\r\n    }\r\n\r\n    if (FZ_LINK_GOTO == ld.kind && ld.ld.gotor.page != -1) {\r\n        // create a SimpleDest because we have to\r\n        // free the fz_link_dest before returning\r\n        PdfLink tmp(this, &ld);\r\n        pageDest = new SimpleDest(tmp.GetDestPageNo(), tmp.GetDestRect());\r\n    }\r\n    fz_free_link_dest(ctx, &ld);\r\n\r\n    return pageDest;\r\n}\r\n\r\npdf_page *PdfEngineImpl::GetPdfPage(int pageNo, bool failIfBusy)\r\n{\r\n    if (!_pages)\r\n        return nullptr;\r\n    if (failIfBusy)\r\n        return _pages[pageNo-1];\r\n\r\n    ScopedCritSec scope(&pagesAccess);\r\n\r\n    pdf_page *page = _pages[pageNo-1];\r\n    if (!page) {\r\n        ScopedCritSec ctxScope(&ctxAccess);\r\n        fz_var(page);\r\n        fz_try(ctx) {\r\n            page = pdf_load_page_by_obj(_doc, pageNo - 1, _pageObjs[pageNo-1]);\r\n            _pages[pageNo-1] = page;\r\n            LinkifyPageText(page);\r\n            pageAnnots[pageNo-1] = ProcessPageAnnotations(page);\r\n        }\r\n        fz_catch(ctx) { }\r\n    }\r\n\r\n    return page;\r\n}\r\n\r\nint PdfEngineImpl::GetPageNo(pdf_page *page)\r\n{\r\n    for (int i = 0; i < PageCount(); i++)\r\n        if (page == _pages[i])\r\n            return i + 1;\r\n    return 0;\r\n}\r\n\r\nPdfPageRun *PdfEngineImpl::CreatePageRun(pdf_page *page, fz_display_list *list)\r\n{\r\n    Vec<FitzImagePos> positions;\r\n    ListInspectionData data(positions);\r\n    fz_device *dev = nullptr;\r\n\r\n    fz_var(dev);\r\n    fz_try(ctx) {\r\n        dev = fz_new_inspection_device(ctx, &data);\r\n        fz_run_display_list(list, dev, &fz_identity, nullptr, nullptr);\r\n    }\r\n    fz_catch(ctx) { }\r\n    fz_free_device(dev);\r\n\r\n    // save the image rectangles for this page\r\n    int pageNo = GetPageNo(page);\r\n    if (!imageRects[pageNo-1] && positions.Count() > 0) {\r\n        // the list of page image rectangles is terminated with a null-rectangle\r\n        fz_rect *rects = AllocArray<fz_rect>(positions.Count() + 1);\r\n        if (rects) {\r\n            for (size_t i = 0; i < positions.Count(); i++) {\r\n                rects[i] = positions.At(i).rect;\r\n            }\r\n            imageRects[pageNo-1] = rects;\r\n        }\r\n    }\r\n\r\n    return new PdfPageRun(page, list, data);\r\n}\r\n\r\nPdfPageRun *PdfEngineImpl::GetPageRun(pdf_page *page, bool tryOnly)\r\n{\r\n    PdfPageRun *result = nullptr;\r\n\r\n    ScopedCritSec scope(&pagesAccess);\r\n\r\n    for (size_t i = 0; i < runCache.Count(); i++) {\r\n        if (runCache.At(i)->page == page) {\r\n            result = runCache.At(i);\r\n            break;\r\n        }\r\n    }\r\n    if (!result && !tryOnly) {\r\n        size_t mem = 0;\r\n        for (size_t i = 0; i < runCache.Count(); i++) {\r\n            // drop page runs that take up too much memory due to huge images\r\n            // (except for the very recently used ones)\r\n            if (i >= 2 && mem + runCache.At(i)->size_est >= MAX_PAGE_RUN_MEMORY)\r\n                DropPageRun(runCache.At(i--), true);\r\n            else\r\n                mem += runCache.At(i)->size_est;\r\n        }\r\n        if (runCache.Count() >= MAX_PAGE_RUN_CACHE) {\r\n            assert(runCache.Count() == MAX_PAGE_RUN_CACHE);\r\n            DropPageRun(runCache.Last(), true);\r\n        }\r\n\r\n        ScopedCritSec scope2(&ctxAccess);\r\n\r\n        fz_display_list *list = nullptr;\r\n        fz_device *dev = nullptr;\r\n        fz_var(list);\r\n        fz_var(dev);\r\n        fz_try(ctx) {\r\n            list = fz_new_display_list(ctx);\r\n            dev = fz_new_list_device(ctx, list);\r\n            pdf_run_page(_doc, page, dev, &fz_identity, nullptr);\r\n        }\r\n        fz_catch(ctx) {\r\n            fz_drop_display_list(ctx, list);\r\n            list = nullptr;\r\n        }\r\n        fz_free_device(dev);\r\n\r\n        if (list) {\r\n            result = CreatePageRun(page, list);\r\n            runCache.InsertAt(0, result);\r\n        }\r\n    }\r\n    else if (result && result != runCache.At(0)) {\r\n        // keep the list Most Recently Used first\r\n        runCache.Remove(result);\r\n        runCache.InsertAt(0, result);\r\n    }\r\n\r\n    if (result)\r\n        result->refs++;\r\n    return result;\r\n}\r\n\r\nbool PdfEngineImpl::RunPage(pdf_page *page, fz_device *dev, const fz_matrix *ctm, RenderTarget target, const fz_rect *cliprect, bool cacheRun, FitzAbortCookie *cookie)\r\n{\r\n    bool ok = true;\r\n\r\n    PdfPageRun *run;\r\n    if (Target_View == target && (run = GetPageRun(page, !cacheRun)) != nullptr) {\r\n        EnterCriticalSection(&ctxAccess);\r\n        Vec<PageAnnotation> pageAnnots = fz_get_user_page_annots(userAnnots, GetPageNo(page));\r\n        fz_try(ctx) {\r\n            fz_rect pagerect;\r\n            fz_begin_page(dev, pdf_bound_page(_doc, page, &pagerect), ctm);\r\n            fz_run_page_transparency(pageAnnots, dev, cliprect, false, page->transparency);\r\n            fz_run_display_list(run->list, dev, ctm, cliprect, cookie ? &cookie->cookie : nullptr);\r\n            fz_run_page_transparency(pageAnnots, dev, cliprect, true, page->transparency);\r\n            fz_run_user_page_annots(pageAnnots, dev, ctm, cliprect, cookie ? &cookie->cookie : nullptr);\r\n            fz_end_page(dev);\r\n        }\r\n        fz_catch(ctx) {\r\n            ok = false;\r\n        }\r\n        LeaveCriticalSection(&ctxAccess);\r\n        DropPageRun(run);\r\n    }\r\n    else {\r\n        ScopedCritSec scope(&ctxAccess);\r\n        char *targetName = target == Target_Print ? \"Print\" :\r\n                           target == Target_Export ? \"Export\" : \"View\";\r\n        Vec<PageAnnotation> pageAnnots = fz_get_user_page_annots(userAnnots, GetPageNo(page));\r\n        fz_try(ctx) {\r\n            fz_rect pagerect;\r\n            fz_begin_page(dev, pdf_bound_page(_doc, page, &pagerect), ctm);\r\n            fz_run_page_transparency(pageAnnots, dev, cliprect, false, page->transparency);\r\n            pdf_run_page_with_usage(_doc, page, dev, ctm, targetName, cookie ? &cookie->cookie : nullptr);\r\n            fz_run_page_transparency(pageAnnots, dev, cliprect, true, page->transparency);\r\n            fz_run_user_page_annots(pageAnnots, dev, ctm, cliprect, cookie ? &cookie->cookie : nullptr);\r\n            fz_end_page(dev);\r\n        }\r\n        fz_catch(ctx) {\r\n            ok = false;\r\n        }\r\n    }\r\n\r\n    EnterCriticalSection(&ctxAccess);\r\n    fz_free_device(dev);\r\n    LeaveCriticalSection(&ctxAccess);\r\n\r\n    return ok && !(cookie && cookie->cookie.abort);\r\n}\r\n\r\nvoid PdfEngineImpl::DropPageRun(PdfPageRun *run, bool forceRemove)\r\n{\r\n    ScopedCritSec scope(&pagesAccess);\r\n    run->refs--;\r\n\r\n    if (0 == run->refs || forceRemove)\r\n        runCache.Remove(run);\r\n\r\n    if (0 == run->refs) {\r\n        ScopedCritSec ctxScope(&ctxAccess);\r\n        fz_drop_display_list(ctx, run->list);\r\n        delete run;\r\n    }\r\n}\r\n\r\nRectD PdfEngineImpl::PageMediabox(int pageNo)\r\n{\r\n    assert(1 <= pageNo && pageNo <= PageCount());\r\n    if (!_mediaboxes[pageNo-1].IsEmpty())\r\n        return _mediaboxes[pageNo-1];\r\n\r\n    pdf_obj *page = _pageObjs[pageNo - 1];\r\n    if (!page)\r\n        return RectD();\r\n\r\n    ScopedCritSec scope(&ctxAccess);\r\n\r\n    // cf. pdf-page.c's pdf_load_page\r\n    fz_rect mbox = fz_empty_rect, cbox = fz_empty_rect;\r\n    int rotate = 0;\r\n    float userunit = 1.0;\r\n    fz_try(ctx) {\r\n        pdf_to_rect(ctx, pdf_lookup_inherited_page_item(_doc, page, \"MediaBox\"), &mbox);\r\n        pdf_to_rect(ctx, pdf_lookup_inherited_page_item(_doc, page, \"CropBox\"), &cbox);\r\n        rotate = pdf_to_int(pdf_lookup_inherited_page_item(_doc, page, \"Rotate\"));\r\n        pdf_obj *obj = pdf_dict_gets(page, \"UserUnit\");\r\n        if (pdf_is_real(obj))\r\n            userunit = pdf_to_real(obj);\r\n    }\r\n    fz_catch(ctx) { }\r\n    if (fz_is_empty_rect(&mbox)) {\r\n        fz_warn(ctx, \"cannot find page size for page %d\", pageNo);\r\n        mbox.x0 = 0; mbox.y0 = 0;\r\n        mbox.x1 = 612; mbox.y1 = 792;\r\n    }\r\n    if (!fz_is_empty_rect(&cbox)) {\r\n        fz_intersect_rect(&mbox, &cbox);\r\n        if (fz_is_empty_rect(&mbox))\r\n            return RectD();\r\n    }\r\n    if ((rotate % 90) != 0)\r\n        rotate = 0;\r\n\r\n    // cf. pdf-page.c's pdf_bound_page\r\n    fz_matrix ctm;\r\n    fz_transform_rect(&mbox, fz_rotate(&ctm, (float)rotate));\r\n\r\n    _mediaboxes[pageNo-1] = RectD(0, 0, (mbox.x1 - mbox.x0) * userunit, (mbox.y1 - mbox.y0) * userunit);\r\n    return _mediaboxes[pageNo-1];\r\n}\r\n\r\nRectD PdfEngineImpl::PageContentBox(int pageNo, RenderTarget target)\r\n{\r\n    assert(1 <= pageNo && pageNo <= PageCount());\r\n    pdf_page *page = GetPdfPage(pageNo);\r\n    if (!page)\r\n        return RectD();\r\n\r\n    fz_rect rect = fz_empty_rect;\r\n    fz_device *dev = nullptr;\r\n    EnterCriticalSection(&ctxAccess);\r\n    fz_try(ctx) {\r\n        dev = fz_new_bbox_device(ctx, &rect);\r\n    }\r\n    fz_catch(ctx) {\r\n        LeaveCriticalSection(&ctxAccess);\r\n        return RectD();\r\n    }\r\n    LeaveCriticalSection(&ctxAccess);\r\n\r\n    fz_rect pagerect;\r\n    pdf_bound_page(_doc, page, &pagerect);\r\n    bool ok = RunPage(page, dev, &fz_identity, target, &pagerect, false);\r\n    if (!ok)\r\n        return PageMediabox(pageNo);\r\n    if (fz_is_infinite_rect(&rect))\r\n        return PageMediabox(pageNo);\r\n\r\n    RectD rect2 = fz_rect_to_RectD(rect);\r\n    return rect2.Intersect(PageMediabox(pageNo));\r\n}\r\n\r\nPointD PdfEngineImpl::Transform(PointD pt, int pageNo, float zoom, int rotation, bool inverse)\r\n{\r\n    fz_matrix ctm = viewctm(pageNo, zoom, rotation);\r\n    if (inverse)\r\n        fz_invert_matrix(&ctm, &ctm);\r\n    fz_point pt2 = { (float)pt.x, (float)pt.y };\r\n    fz_transform_point(&pt2, &ctm);\r\n    return PointD(pt2.x, pt2.y);\r\n}\r\n\r\nRectD PdfEngineImpl::Transform(RectD rect, int pageNo, float zoom, int rotation, bool inverse)\r\n{\r\n    fz_matrix ctm = viewctm(pageNo, zoom, rotation);\r\n    if (inverse)\r\n        fz_invert_matrix(&ctm, &ctm);\r\n    fz_rect rect2 = fz_RectD_to_rect(rect);\r\n    fz_transform_rect(&rect2, &ctm);\r\n    return fz_rect_to_RectD(rect2);\r\n}\r\n\r\nRenderedBitmap *PdfEngineImpl::RenderBitmap(int pageNo, float zoom, int rotation, RectD *pageRect, RenderTarget target, AbortCookie **cookie_out)\r\n{\r\n    pdf_page* page = GetPdfPage(pageNo);\r\n    if (!page || !pdf_is_dict(page->me))\r\n        return nullptr;\r\n\r\n    fz_rect pRect;\r\n    if (pageRect)\r\n        pRect = fz_RectD_to_rect(*pageRect);\r\n    else\r\n        pdf_bound_page(_doc, page, &pRect);\r\n    fz_matrix ctm = viewctm(page, zoom, rotation);\r\n    fz_rect r = pRect;\r\n    fz_irect bbox;\r\n    fz_round_rect(&bbox, fz_transform_rect(&r, &ctm));\r\n\r\n    fz_pixmap *image = nullptr;\r\n    EnterCriticalSection(&ctxAccess);\r\n    fz_try(ctx) {\r\n        fz_colorspace *colorspace = fz_device_rgb(ctx);\r\n        image = fz_new_pixmap_with_bbox(ctx, colorspace, &bbox);\r\n        fz_clear_pixmap_with_value(ctx, image, 0xFF); // initialize white background\r\n    }\r\n    fz_catch(ctx) {\r\n        LeaveCriticalSection(&ctxAccess);\r\n        return nullptr;\r\n    }\r\n\r\n    fz_device *dev = nullptr;\r\n    fz_try(ctx) {\r\n        dev = fz_new_draw_device(ctx, image);\r\n    }\r\n    fz_catch(ctx) {\r\n        fz_drop_pixmap(ctx, image);\r\n        LeaveCriticalSection(&ctxAccess);\r\n        return nullptr;\r\n    }\r\n    LeaveCriticalSection(&ctxAccess);\r\n\r\n    FitzAbortCookie *cookie = nullptr;\r\n    if (cookie_out)\r\n        *cookie_out = cookie = new FitzAbortCookie();\r\n    fz_rect cliprect;\r\n    bool ok = RunPage(page, dev, &ctm, target, fz_rect_from_irect(&cliprect, &bbox), true, cookie);\r\n\r\n    ScopedCritSec scope(&ctxAccess);\r\n\r\n    RenderedBitmap *bitmap = nullptr;\r\n    if (ok)\r\n        bitmap = new_rendered_fz_pixmap(ctx, image);\r\n    fz_drop_pixmap(ctx, image);\r\n    return bitmap;\r\n}\r\n\r\nPageElement *PdfEngineImpl::GetElementAtPos(int pageNo, PointD pt)\r\n{\r\n    pdf_page *page = GetPdfPage(pageNo, true);\r\n    if (!page)\r\n        return nullptr;\r\n\r\n    fz_point p = { (float)pt.x, (float)pt.y };\r\n    for (fz_link *link = page->links; link; link = link->next) {\r\n        if (link->dest.kind != FZ_LINK_NONE && fz_is_pt_in_rect(link->rect, p))\r\n            return new PdfLink(this, &link->dest, link->rect, pageNo, &p);\r\n    }\r\n\r\n    if (pageAnnots[pageNo-1]) {\r\n        for (size_t i = 0; pageAnnots[pageNo-1][i]; i++) {\r\n            pdf_annot *annot = pageAnnots[pageNo-1][i];\r\n            fz_rect rect = annot->rect;\r\n            fz_transform_rect(&rect, &page->ctm);\r\n            if (fz_is_pt_in_rect(rect, p)) {\r\n                ScopedCritSec scope(&ctxAccess);\r\n\r\n                ScopedMem<WCHAR> contents(str::conv::FromPdf(pdf_dict_gets(annot->obj, \"Contents\")));\r\n                // TODO: use separate classes for comments and tooltips?\r\n                if (str::IsEmpty(contents.Get()) && FZ_ANNOT_WIDGET == annot->annot_type)\r\n                    contents.Set(str::conv::FromPdf(pdf_dict_gets(annot->obj, \"TU\")));\r\n                return new PdfComment(contents, fz_rect_to_RectD(rect), pageNo);\r\n            }\r\n        }\r\n    }\r\n\r\n    if (imageRects[pageNo-1]) {\r\n        for (size_t i = 0; !fz_is_empty_rect(&imageRects[pageNo-1][i]); i++)\r\n            if (fz_is_pt_in_rect(imageRects[pageNo-1][i], p))\r\n                return new PdfImage(this, pageNo, imageRects[pageNo-1][i], i);\r\n    }\r\n\r\n    return nullptr;\r\n}\r\n\r\nVec<PageElement *> *PdfEngineImpl::GetElements(int pageNo)\r\n{\r\n    pdf_page *page = GetPdfPage(pageNo, true);\r\n    if (!page)\r\n        return nullptr;\r\n\r\n    // since all elements lists are in last-to-first order, append\r\n    // item types in inverse order and reverse the whole list at the end\r\n    Vec<PageElement *> *els = new Vec<PageElement *>();\r\n    if (!els)\r\n        return nullptr;\r\n\r\n    if (imageRects[pageNo-1]) {\r\n        for (size_t i = 0; !fz_is_empty_rect(&imageRects[pageNo-1][i]); i++)\r\n            els->Append(new PdfImage(this, pageNo, imageRects[pageNo-1][i], i));\r\n    }\r\n\r\n    if (pageAnnots[pageNo-1]) {\r\n        ScopedCritSec scope(&ctxAccess);\r\n\r\n        for (size_t i = 0; pageAnnots[pageNo-1][i]; i++) {\r\n            pdf_annot *annot = pageAnnots[pageNo-1][i];\r\n            fz_rect rect = annot->rect;\r\n            fz_transform_rect(&rect, &page->ctm);\r\n            ScopedMem<WCHAR> contents(str::conv::FromPdf(pdf_dict_gets(annot->obj, \"Contents\")));\r\n            if (str::IsEmpty(contents.Get()) && FZ_ANNOT_WIDGET == annot->annot_type)\r\n                contents.Set(str::conv::FromPdf(pdf_dict_gets(annot->obj, \"TU\")));\r\n            els->Append(new PdfComment(contents, fz_rect_to_RectD(rect), pageNo));\r\n        }\r\n    }\r\n\r\n    for (fz_link *link = page->links; link; link = link->next) {\r\n        if (link->dest.kind != FZ_LINK_NONE) {\r\n            els->Append(new PdfLink(this, &link->dest, link->rect, pageNo));\r\n        }\r\n    }\r\n\r\n    els->Reverse();\r\n    return els;\r\n}\r\n\r\nvoid PdfEngineImpl::LinkifyPageText(pdf_page *page)\r\n{\r\n    page->links = FixupPageLinks(page->links);\r\n    assert(!page->links || page->links->refs == 1);\r\n\r\n    RectI *coords;\r\n    ScopedMem<WCHAR> pageText(ExtractPageText(page, L\"\\n\", &coords, Target_View, true));\r\n    if (!pageText)\r\n        return;\r\n\r\n    LinkRectList *list = LinkifyText(pageText, coords);\r\n    for (size_t i = 0; i < list->links.Count(); i++) {\r\n        bool overlaps = false;\r\n        for (fz_link *next = page->links; next && !overlaps; next = next->next)\r\n            overlaps = fz_calc_overlap(list->coords.At(i), next->rect) >= 0.25f;\r\n        if (!overlaps) {\r\n            ScopedMem<char> uri(str::conv::ToUtf8(list->links.At(i)));\r\n            if (!uri) continue;\r\n            fz_link_dest ld = { FZ_LINK_URI, 0 };\r\n            ld.ld.uri.uri = fz_strdup(ctx, uri);\r\n            // add links in top-to-bottom order (i.e. last-to-first)\r\n            fz_link *link = fz_new_link(ctx, &list->coords.At(i), ld);\r\n            CrashIf(!link); // TODO: if fz_new_link throws, there are memory leaks\r\n            link->next = page->links;\r\n            page->links = link;\r\n        }\r\n    }\r\n\r\n    delete list;\r\n    free(coords);\r\n}\r\n\r\npdf_annot **PdfEngineImpl::ProcessPageAnnotations(pdf_page *page)\r\n{\r\n    Vec<pdf_annot *> annots;\r\n\r\n    for (pdf_annot *annot = page->annots; annot; annot = annot->next) {\r\n        if (FZ_ANNOT_FILEATTACHMENT == annot->annot_type) {\r\n            pdf_obj *file = pdf_dict_gets(annot->obj, \"FS\");\r\n            pdf_obj *embedded = pdf_dict_getsa(pdf_dict_gets(file, \"EF\"), \"DOS\", \"F\");\r\n            fz_rect rect;\r\n            pdf_to_rect(ctx, pdf_dict_gets(annot->obj, \"Rect\"), &rect);\r\n            if (file && embedded && !fz_is_empty_rect(&rect)) {\r\n                fz_link_dest ld;\r\n                ld.kind = FZ_LINK_LAUNCH;\r\n                ld.ld.launch.file_spec = pdf_file_spec_to_str(_doc, file);\r\n                ld.ld.launch.new_window = 1;\r\n                ld.ld.launch.embedded_num = pdf_to_num(embedded);\r\n                ld.ld.launch.embedded_gen = pdf_to_gen(embedded);\r\n                ld.ld.launch.is_uri = 0;\r\n                fz_transform_rect(&rect, &page->ctm);\r\n                // add links in top-to-bottom order (i.e. last-to-first)\r\n                fz_link *link = fz_new_link(ctx, &rect, ld);\r\n                link->next = page->links;\r\n                page->links = link;\r\n                // TODO: expose /Contents in addition to the file path\r\n            }\r\n            else if (!str::IsEmpty(pdf_to_str_buf(pdf_dict_gets(annot->obj, \"Contents\")))) {\r\n                annots.Append(annot);\r\n            }\r\n        }\r\n        else if (!str::IsEmpty(pdf_to_str_buf(pdf_dict_gets(annot->obj, \"Contents\"))) && annot->annot_type != FZ_ANNOT_FREETEXT) {\r\n            annots.Append(annot);\r\n        }\r\n        else if (FZ_ANNOT_WIDGET == annot->annot_type && !str::IsEmpty(pdf_to_str_buf(pdf_dict_gets(annot->obj, \"TU\")))) {\r\n            if (!(pdf_to_int(pdf_dict_gets(annot->obj, \"Ff\")) & Ff_ReadOnly))\r\n                annots.Append(annot);\r\n        }\r\n    }\r\n\r\n    if (annots.Count() == 0)\r\n        return nullptr;\r\n\r\n    // re-order list into top-to-bottom order (i.e. last-to-first)\r\n    annots.Reverse();\r\n    // add sentinel value\r\n    annots.Append(nullptr);\r\n    return annots.StealData();\r\n}\r\n\r\nRenderedBitmap *PdfEngineImpl::GetPageImage(int pageNo, RectD rect, size_t imageIx)\r\n{\r\n    pdf_page *page = GetPdfPage(pageNo);\r\n    if (!page)\r\n        return nullptr;\r\n\r\n    Vec<FitzImagePos> positions;\r\n    ListInspectionData data(positions);\r\n    fz_device *dev = nullptr;\r\n\r\n    EnterCriticalSection(&ctxAccess);\r\n    fz_try(ctx) {\r\n        dev = fz_new_inspection_device(ctx, &data);\r\n    }\r\n    fz_catch(ctx) {\r\n        LeaveCriticalSection(&ctxAccess);\r\n        return nullptr;\r\n    }\r\n    LeaveCriticalSection(&ctxAccess);\r\n\r\n    RunPage(page, dev, &fz_identity);\r\n\r\n    if (imageIx >= positions.Count() || fz_rect_to_RectD(positions.At(imageIx).rect) != rect) {\r\n        assert(0);\r\n        return nullptr;\r\n    }\r\n\r\n    ScopedCritSec scope(&ctxAccess);\r\n\r\n    fz_pixmap *pixmap = nullptr;\r\n    fz_try(ctx) {\r\n        fz_image *image = positions.At(imageIx).image;\r\n        pixmap = fz_new_pixmap_from_image(ctx, image, image->w, image->h);\r\n    }\r\n    fz_catch(ctx) {\r\n        return nullptr;\r\n    }\r\n    RenderedBitmap *bmp = new_rendered_fz_pixmap(ctx, pixmap);\r\n    fz_drop_pixmap(ctx, pixmap);\r\n\r\n    return bmp;\r\n}\r\n\r\nWCHAR *PdfEngineImpl::ExtractPageText(pdf_page *page, const WCHAR *lineSep, RectI **coordsOut, RenderTarget target, bool cacheRun)\r\n{\r\n    if (!page)\r\n        return nullptr;\r\n\r\n    fz_text_sheet *sheet = nullptr;\r\n    fz_text_page *text = nullptr;\r\n    fz_device *dev = nullptr;\r\n    fz_var(sheet);\r\n    fz_var(text);\r\n\r\n    EnterCriticalSection(&ctxAccess);\r\n    fz_try(ctx) {\r\n        sheet = fz_new_text_sheet(ctx);\r\n        text = fz_new_text_page(ctx);\r\n        dev = fz_new_text_device(ctx, sheet, text);\r\n    }\r\n    fz_catch(ctx) {\r\n        fz_free_text_page(ctx, text);\r\n        fz_free_text_sheet(ctx, sheet);\r\n        LeaveCriticalSection(&ctxAccess);\r\n        return nullptr;\r\n    }\r\n    LeaveCriticalSection(&ctxAccess);\r\n\r\n    if (!cacheRun)\r\n        fz_enable_device_hints(dev, FZ_NO_CACHE);\r\n\r\n    // use an infinite rectangle as bounds (instead of pdf_bound_page) to ensure that\r\n    // the extracted text is consistent between cached runs using a list device and\r\n    // fresh runs (otherwise the list device omits text outside the mediabox bounds)\r\n    bool ok = RunPage(page, dev, &fz_identity, target, nullptr, cacheRun);\r\n\r\n    ScopedCritSec scope(&ctxAccess);\r\n\r\n    WCHAR *content = nullptr;\r\n    if (ok)\r\n        content = fz_text_page_to_str(text, lineSep, coordsOut);\r\n    fz_free_text_page(ctx, text);\r\n    fz_free_text_sheet(ctx, sheet);\r\n\r\n    return content;\r\n}\r\n\r\nWCHAR *PdfEngineImpl::ExtractPageText(int pageNo, const WCHAR *lineSep, RectI **coordsOut, RenderTarget target)\r\n{\r\n    pdf_page *page = GetPdfPage(pageNo, true);\r\n    if (page)\r\n        return ExtractPageText(page, lineSep, coordsOut, target);\r\n\r\n    EnterCriticalSection(&ctxAccess);\r\n    fz_try(ctx) {\r\n        page = pdf_load_page_by_obj(_doc, pageNo - 1, _pageObjs[pageNo-1]);\r\n    }\r\n    fz_catch(ctx) {\r\n        LeaveCriticalSection(&ctxAccess);\r\n        return nullptr;\r\n    }\r\n    LeaveCriticalSection(&ctxAccess);\r\n\r\n    WCHAR *result = ExtractPageText(page, lineSep, coordsOut, target);\r\n\r\n    EnterCriticalSection(&ctxAccess);\r\n    pdf_free_page(_doc, page);\r\n    LeaveCriticalSection(&ctxAccess);\r\n\r\n    return result;\r\n}\r\n\r\nbool PdfEngineImpl::IsLinearizedFile()\r\n{\r\n    ScopedCritSec scope(&ctxAccess);\r\n    // determine the object number of the very first object in the file\r\n    fz_seek(_doc->file, 0, 0);\r\n    int tok = pdf_lex(_doc->file, &_doc->lexbuf.base);\r\n    if (tok != PDF_TOK_INT)\r\n        return false;\r\n    int num = _doc->lexbuf.base.i;\r\n    if (num < 0 || num >= pdf_xref_len(_doc))\r\n        return false;\r\n    // check whether it's a linearization dictionary\r\n    fz_try(_doc->ctx) {\r\n        pdf_cache_object(_doc, num, 0);\r\n    }\r\n    fz_catch(_doc->ctx) {\r\n        return false;\r\n    }\r\n    pdf_obj *obj = pdf_get_xref_entry(_doc, num)->obj;\r\n    if (!pdf_is_dict(obj))\r\n        return false;\r\n    // /Linearized format must be version 1.0\r\n    if (pdf_to_real(pdf_dict_gets(obj, \"Linearized\")) != 1.0f)\r\n        return false;\r\n    // /L must be the exact file size\r\n    if (pdf_to_int(pdf_dict_gets(obj, \"L\")) != _doc->file_size)\r\n        return false;\r\n    // /O must be the object number of the first page\r\n    if (pdf_to_int(pdf_dict_gets(obj, \"O\")) != pdf_to_num(_pageObjs[0]))\r\n        return false;\r\n    // /N must be the total number of pages\r\n    if (pdf_to_int(pdf_dict_gets(obj, \"N\")) != PageCount())\r\n        return false;\r\n    // /H must be an array and /E and /T must be integers\r\n    return pdf_is_array(pdf_dict_gets(obj, \"H\")) &&\r\n           pdf_is_int(pdf_dict_gets(obj, \"E\")) &&\r\n           pdf_is_int(pdf_dict_gets(obj, \"T\"));\r\n}\r\n\r\nstatic void pdf_extract_fonts(pdf_obj *res, Vec<pdf_obj *>& fontList, Vec<pdf_obj *>& resList)\r\n{\r\n    if (!res || pdf_mark_obj(res))\r\n        return;\r\n    resList.Append(res);\r\n\r\n    pdf_obj *fonts = pdf_dict_gets(res, \"Font\");\r\n    for (int k = 0; k < pdf_dict_len(fonts); k++) {\r\n        pdf_obj *font = pdf_resolve_indirect(pdf_dict_get_val(fonts, k));\r\n        if (font && !fontList.Contains(font))\r\n            fontList.Append(font);\r\n    }\r\n    // also extract fonts for all XObjects (recursively)\r\n    pdf_obj *xobjs = pdf_dict_gets(res, \"XObject\");\r\n    for (int k = 0; k < pdf_dict_len(xobjs); k++) {\r\n        pdf_obj *xobj = pdf_dict_get_val(xobjs, k);\r\n        pdf_obj *xres = pdf_dict_gets(xobj, \"Resources\");\r\n        pdf_extract_fonts(xres, fontList, resList);\r\n    }\r\n}\r\n\r\nWCHAR *PdfEngineImpl::ExtractFontList()\r\n{\r\n    Vec<pdf_obj *> fontList;\r\n    Vec<pdf_obj *> resList;\r\n\r\n    // collect all fonts from all page objects\r\n    for (int i = 1; i <= PageCount(); i++) {\r\n        pdf_page *page = GetPdfPage(i);\r\n        if (page) {\r\n            ScopedCritSec scope(&ctxAccess);\r\n            fz_try(ctx) {\r\n                pdf_extract_fonts(page->resources, fontList, resList);\r\n                for (pdf_annot *annot = page->annots; annot; annot = annot->next) {\r\n                    if (annot->ap)\r\n                        pdf_extract_fonts(annot->ap->resources, fontList, resList);\r\n                }\r\n            }\r\n            fz_catch(ctx) { }\r\n        }\r\n    }\r\n\r\n    // start ctxAccess scope here so that we don't also have to\r\n    // ask for pagesAccess (as is required for GetPdfPage)\r\n    ScopedCritSec scope(&ctxAccess);\r\n\r\n    for (pdf_obj *res : resList) {\r\n        pdf_unmark_obj(res);\r\n    }\r\n\r\n    WStrVec fonts;\r\n    for (size_t i = 0; i < fontList.Count(); i++) {\r\n        const char *name = nullptr, *type = nullptr, *encoding = nullptr;\r\n        ScopedMem<char> anonFontName;\r\n        bool embedded = false;\r\n        fz_try(ctx) {\r\n            pdf_obj *font = fontList.At(i);\r\n            pdf_obj *font2 = pdf_array_get(pdf_dict_gets(font, \"DescendantFonts\"), 0);\r\n            if (!font2)\r\n                font2 = font;\r\n\r\n            name = pdf_to_name(pdf_dict_getsa(font2, \"BaseFont\", \"Name\"));\r\n            bool needAnonName = str::IsEmpty(name);\r\n            if (needAnonName && font2 != font) {\r\n                name = pdf_to_name(pdf_dict_getsa(font, \"BaseFont\", \"Name\"));\r\n                needAnonName = str::IsEmpty(name);\r\n            }\r\n            if (needAnonName) {\r\n                anonFontName.Set(str::Format(\"<#%d>\", pdf_obj_parent_num(font2)));\r\n                name = anonFontName;\r\n            }\r\n            embedded = false;\r\n            pdf_obj *desc = pdf_dict_gets(font2, \"FontDescriptor\");\r\n            if (desc && (pdf_dict_gets(desc, \"FontFile\") || pdf_dict_getsa(desc, \"FontFile2\", \"FontFile3\")))\r\n                embedded = true;\r\n            if (embedded && str::Len(name) > 7 && name[6] == '+')\r\n                name += 7;\r\n\r\n            type = pdf_to_name(pdf_dict_gets(font, \"Subtype\"));\r\n            if (font2 != font) {\r\n                const char *type2 = pdf_to_name(pdf_dict_gets(font2, \"Subtype\"));\r\n                if (str::Eq(type2, \"CIDFontType0\"))\r\n                    type = \"Type1 (CID)\";\r\n                else if (str::Eq(type2, \"CIDFontType2\"))\r\n                    type = \"TrueType (CID)\";\r\n            }\r\n            if (str::Eq(type, \"Type3\"))\r\n                embedded = pdf_dict_gets(font2, \"CharProcs\") != nullptr;\r\n\r\n            encoding = pdf_to_name(pdf_dict_gets(font, \"Encoding\"));\r\n            if (str::Eq(encoding, \"WinAnsiEncoding\"))\r\n                encoding = \"Ansi\";\r\n            else if (str::Eq(encoding, \"MacRomanEncoding\"))\r\n                encoding = \"Roman\";\r\n            else if (str::Eq(encoding, \"MacExpertEncoding\"))\r\n                encoding = \"Expert\";\r\n        }\r\n        fz_catch(ctx) {\r\n            continue;\r\n        }\r\n        CrashIf(!name || !type || !encoding);\r\n\r\n        str::Str<char> info;\r\n        if (name[0] < 0 && MultiByteToWideChar(936, MB_ERR_INVALID_CHARS, name, -1, nullptr, 0))\r\n            info.Append(ScopedMem<char>(str::ToMultiByte(name, 936, CP_UTF8)));\r\n        else\r\n            info.Append(name);\r\n        if (!str::IsEmpty(encoding) || !str::IsEmpty(type) || embedded) {\r\n            info.Append(\" (\");\r\n            if (!str::IsEmpty(type))\r\n                info.AppendFmt(\"%s; \", type);\r\n            if (!str::IsEmpty(encoding))\r\n                info.AppendFmt(\"%s; \", encoding);\r\n            if (embedded)\r\n                info.Append(\"embedded; \");\r\n            info.RemoveAt(info.Count() - 2, 2);\r\n            info.Append(\")\");\r\n        }\r\n\r\n        ScopedMem<WCHAR> fontInfo(str::conv::FromUtf8(info.LendData()));\r\n        if (fontInfo && !fonts.Contains(fontInfo))\r\n            fonts.Append(fontInfo.StealData());\r\n    }\r\n    if (fonts.Count() == 0)\r\n        return nullptr;\r\n\r\n    fonts.SortNatural();\r\n    return fonts.Join(L\"\\n\");\r\n}\r\n\r\nWCHAR *PdfEngineImpl::GetProperty(DocumentProperty prop)\r\n{\r\n    if (!_doc)\r\n        return nullptr;\r\n\r\n    if (Prop_PdfVersion == prop) {\r\n        int major = _doc->version / 10, minor = _doc->version % 10;\r\n        if (1 == major && 7 == minor && pdf_crypt_version(_doc) == 5) {\r\n            if (pdf_crypt_revision(_doc) == 5)\r\n                return str::Format(L\"%d.%d Adobe Extension Level %d\", major, minor, 3);\r\n            if (pdf_crypt_revision(_doc) == 6)\r\n                return str::Format(L\"%d.%d Adobe Extension Level %d\", major, minor, 8);\r\n        }\r\n        return str::Format(L\"%d.%d\", major, minor);\r\n    }\r\n\r\n    if (Prop_PdfFileStructure == prop) {\r\n        WStrVec fstruct;\r\n        if (pdf_to_bool(pdf_dict_gets(_info, \"Linearized\")))\r\n            fstruct.Append(str::Dup(L\"linearized\"));\r\n        if (pdf_to_bool(pdf_dict_gets(_info, \"Marked\")))\r\n            fstruct.Append(str::Dup(L\"tagged\"));\r\n        if (pdf_dict_gets(_info, \"OutputIntents\")) {\r\n            for (int i = 0; i < pdf_array_len(pdf_dict_gets(_info, \"OutputIntents\")); i++) {\r\n                pdf_obj *intent = pdf_array_get(pdf_dict_gets(_info, \"OutputIntents\"), i);\r\n                CrashIf(!str::StartsWith(pdf_to_name(intent), \"GTS_\"));\r\n                fstruct.Append(str::conv::FromUtf8(pdf_to_name(intent) + 4));\r\n            }\r\n        }\r\n        return fstruct.Count() > 0 ? fstruct.Join(L\",\") : nullptr;\r\n    }\r\n\r\n    if (Prop_UnsupportedFeatures == prop) {\r\n        if (pdf_to_bool(pdf_dict_gets(_info, \"Unsupported_XFA\")))\r\n            return str::Dup(L\"XFA\");\r\n        return nullptr;\r\n    }\r\n\r\n    if (Prop_FontList == prop)\r\n        return ExtractFontList();\r\n\r\n    static struct {\r\n        DocumentProperty prop;\r\n        const char *name;\r\n    } pdfPropNames[] = {\r\n        { Prop_Title, \"Title\" }, { Prop_Author, \"Author\" },\r\n        { Prop_Subject, \"Subject\" }, { Prop_Copyright, \"Copyright\" },\r\n        { Prop_CreationDate, \"CreationDate\" }, { Prop_ModificationDate, \"ModDate\" },\r\n        { Prop_CreatorApp, \"Creator\" }, { Prop_PdfProducer, \"Producer\" },\r\n    };\r\n    for (int i = 0; i < dimof(pdfPropNames); i++) {\r\n        if (pdfPropNames[i].prop == prop) {\r\n            // _info is guaranteed not to contain any indirect references,\r\n            // so no need for ctxAccess\r\n            pdf_obj *obj = pdf_dict_gets(_info, pdfPropNames[i].name);\r\n            return obj ? pdf_clean_string(str::conv::FromPdf(obj)) : nullptr;\r\n        }\r\n    }\r\n    return nullptr;\r\n};\r\n\r\nbool PdfEngineImpl::SupportsAnnotation(bool forSaving) const\r\n{\r\n    if (forSaving) {\r\n        // TODO: support updating of documents where pages aren't all numbered objects?\r\n        for (int i = 0; i < PageCount(); i++) {\r\n            if (pdf_to_num(_pageObjs[i]) == 0)\r\n                return false;\r\n        }\r\n    }\r\n    return true;\r\n}\r\n\r\nvoid PdfEngineImpl::UpdateUserAnnotations(Vec<PageAnnotation> *list)\r\n{\r\n    // TODO: use a new critical section to avoid blocking the UI thread\r\n    ScopedCritSec scope(&ctxAccess);\r\n    if (list)\r\n        userAnnots = *list;\r\n    else\r\n        userAnnots.Reset();\r\n}\r\n\r\nchar *PdfEngineImpl::GetDecryptionKey() const\r\n{\r\n    if (!_decryptionKey)\r\n        return nullptr;\r\n    return str::Dup(_decryptionKey);\r\n}\r\n\r\nPageLayoutType PdfEngineImpl::PreferredLayout()\r\n{\r\n    PageLayoutType layout = Layout_Single;\r\n\r\n    ScopedCritSec scope(&ctxAccess);\r\n    pdf_obj *root = nullptr;\r\n    fz_try(ctx) {\r\n        root = pdf_dict_gets(pdf_trailer(_doc), \"Root\");\r\n    }\r\n    fz_catch(ctx) {\r\n        return layout;\r\n    }\r\n\r\n    fz_try(ctx) {\r\n        char *name = pdf_to_name(pdf_dict_gets(root, \"PageLayout\"));\r\n        if (str::EndsWith(name, \"Right\"))\r\n            layout = Layout_Book;\r\n        else if (str::StartsWith(name, \"Two\"))\r\n            layout = Layout_Facing;\r\n    }\r\n    fz_catch(ctx) { }\r\n\r\n    fz_try(ctx) {\r\n        pdf_obj *prefs = pdf_dict_gets(root, \"ViewerPreferences\");\r\n        char *direction = pdf_to_name(pdf_dict_gets(prefs, \"Direction\"));\r\n        if (str::Eq(direction, \"R2L\"))\r\n            layout = (PageLayoutType)(layout | Layout_R2L);\r\n    }\r\n    fz_catch(ctx) { }\r\n\r\n    return layout;\r\n}\r\n\r\nunsigned char *PdfEngineImpl::GetFileData(size_t *cbCount)\r\n{\r\n    unsigned char *data = nullptr;\r\n    ScopedCritSec scope(&ctxAccess);\r\n    fz_try(ctx) {\r\n        data = fz_extract_stream_data(_doc->file, cbCount);\r\n    }\r\n    fz_catch(ctx) {\r\n        return _fileName ? (unsigned char *)file::ReadAll(_fileName, cbCount) : nullptr;\r\n    }\r\n    return data;\r\n}\r\n\r\nbool PdfEngineImpl::SaveFileAs(const WCHAR *copyFileName, bool includeUserAnnots)\r\n{\r\n    size_t dataLen;\r\n    ScopedMem<unsigned char> data(GetFileData(&dataLen));\r\n    if (data) {\r\n        bool ok = file::WriteAll(copyFileName, data.Get(), dataLen);\r\n        if (ok)\r\n            return !includeUserAnnots || SaveUserAnnots(copyFileName);\r\n    }\r\n    if (!_fileName)\r\n        return false;\r\n    bool ok = CopyFile(_fileName, copyFileName, FALSE);\r\n    if (!ok)\r\n        return false;\r\n    // TODO: try to recover when SaveUserAnnots fails?\r\n    return !includeUserAnnots || SaveUserAnnots(copyFileName);\r\n}\r\n\r\nstatic bool pdf_file_update_add_annotation(pdf_document *doc, pdf_page *page, pdf_obj *page_obj, PageAnnotation& annot, pdf_obj *annots)\r\n{\r\n    static const char *obj_dict = \"<<\\\r\n    /Type /Annot /Subtype /%s\\\r\n    /Rect [%f %f %f %f]\\\r\n    /C [%f %f %f]\\\r\n    /F %d\\\r\n    /P %d %d R\\\r\n    /QuadPoints %s\\\r\n    /AP << >>\\\r\n>>\";\r\n    static const char *obj_quad_tpl = \"[%f %f %f %f %f %f %f %f]\";\r\n    static const char *ap_dict = \"<< /Type /XObject /Subtype /Form /BBox [0 0 %f %f] /Resources << /ExtGState << /GS << /Type /ExtGState /ca %.f /AIS false /BM /Multiply >> >> /ProcSet [/PDF] >> >>\";\r\n    static const char *ap_highlight = \"q /DeviceRGB cs /GS gs %f %f %f rg 0 0 %f %f re f Q\\n\";\r\n    static const char *ap_underline = \"q /DeviceRGB CS %f %f %f RG 1 w [] 0 d 0 0.5 m %f 0.5 l S Q\\n\";\r\n    static const char *ap_strikeout = \"q /DeviceRGB CS %f %f %f RG 1 w [] 0 d 0 %f m %f %f l S Q\\n\";\r\n    static const char *ap_squiggly = \"q /DeviceRGB CS %f %f %f RG 0.5 w [1] 1.5 d 0 0.25 m %f 0.25 l S [1] 0.5 d 0 0.75 m %f 0.75 l S Q\\n\";\r\n\r\n    fz_context *ctx = doc->ctx;\r\n    pdf_obj *annot_obj = nullptr, *ap_obj = nullptr;\r\n    fz_buffer *ap_buf = nullptr;\r\n\r\n    fz_var(annot_obj);\r\n    fz_var(ap_obj);\r\n    fz_var(ap_buf);\r\n\r\n    const char *subtype = Annot_Highlight == annot.type ? \"Highlight\" :\r\n                          Annot_Underline == annot.type ? \"Underline\" :\r\n                          Annot_StrikeOut == annot.type ? \"StrikeOut\" :\r\n                          Annot_Squiggly  == annot.type ? \"Squiggly\"  : nullptr;\r\n    CrashIf(!subtype);\r\n    int rotation = (page->rotate + 360) % 360;\r\n    CrashIf((rotation % 90) != 0);\r\n    // convert the annotation's rectangle back to raw user space\r\n    fz_rect r = fz_RectD_to_rect(annot.rect);\r\n    fz_matrix invctm;\r\n    fz_transform_rect(&r, fz_invert_matrix(&invctm, &page->ctm));\r\n    double dx = r.x1 - r.x0, dy = r.y1 - r.y0;\r\n    if ((rotation % 180) == 90)\r\n        std::swap(dx, dy);\r\n    float rgb[3] = { annot.color.r / 255.f, annot.color.g / 255.f, annot.color.b / 255.f };\r\n    // rotate the QuadPoints to match the page\r\n    ScopedMem<char> quad_tpl;\r\n    if (0 == rotation)\r\n        quad_tpl.Set(str::Format(obj_quad_tpl, r.x0, r.y1, r.x1, r.y1, r.x0, r.y0, r.x1, r.y0));\r\n    else if (90 == rotation)\r\n        quad_tpl.Set(str::Format(obj_quad_tpl, r.x0, r.y0, r.x0, r.y1, r.x1, r.y0, r.x1, r.y1));\r\n    else if (180 == rotation)\r\n        quad_tpl.Set(str::Format(obj_quad_tpl, r.x1, r.y0, r.x0, r.y0, r.x1, r.y1, r.x0, r.y1));\r\n    else // if (270 == rotation)\r\n        quad_tpl.Set(str::Format(obj_quad_tpl, r.x1, r.y1, r.x1, r.y0, r.x0, r.y1, r.x0, r.y0));\r\n    ScopedMem<char> annot_tpl(str::Format(obj_dict, subtype,\r\n        r.x0, r.y0, r.x1, r.y1, rgb[0], rgb[1], rgb[2], //Rect and Color\r\n        F_Print, pdf_to_num(page_obj), pdf_to_gen(page_obj), //F and P\r\n        quad_tpl.Get()));\r\n    ScopedMem<char> annot_ap_dict(str::Format(ap_dict, dx, dy, annot.color.a / 255.f));\r\n    ScopedMem<char> annot_ap_stream;\r\n\r\n    fz_try(ctx) {\r\n        annot_obj = pdf_new_obj_from_str(doc, annot_tpl);\r\n        // append the annotation to the file\r\n        pdf_array_push_drop(annots, pdf_new_ref(doc, annot_obj));\r\n    }\r\n    fz_catch(ctx) {\r\n        pdf_drop_obj(annot_obj);\r\n        return false;\r\n    }\r\n\r\n    if (doc->crypt) {\r\n        // since we don't encrypt the appearance stream, for encrypted documents\r\n        // the readers will have to synthesize an appearance stream themselves\r\n        pdf_drop_obj(annot_obj);\r\n        return true;\r\n    }\r\n\r\n    fz_try(ctx) {\r\n        // create the appearance stream (unencrypted) and append it to the file\r\n        ap_obj = pdf_new_obj_from_str(doc, annot_ap_dict);\r\n        switch (annot.type) {\r\n        case Annot_Highlight:\r\n            annot_ap_stream.Set(str::Format(ap_highlight, rgb[0], rgb[1], rgb[2], dx, dy));\r\n            break;\r\n        case Annot_Underline:\r\n            annot_ap_stream.Set(str::Format(ap_underline, rgb[0], rgb[1], rgb[2], dx));\r\n            break;\r\n        case Annot_StrikeOut:\r\n            annot_ap_stream.Set(str::Format(ap_strikeout, rgb[0], rgb[1], rgb[2], dy / 2, dx, dy / 2));\r\n            break;\r\n        case Annot_Squiggly:\r\n            annot_ap_stream.Set(str::Format(ap_squiggly, rgb[0], rgb[1], rgb[2], dx, dx));\r\n            break;\r\n        }\r\n        if (annot.type != Annot_Highlight)\r\n            pdf_dict_dels(pdf_dict_gets(ap_obj, \"Resources\"), \"ExtGState\");\r\n        if (rotation) {\r\n            fz_matrix rot;\r\n            pdf_dict_puts_drop(ap_obj, \"Matrix\", pdf_new_matrix(doc, fz_rotate(&rot, rotation)));\r\n        }\r\n        ap_buf = fz_new_buffer(ctx, (int)str::Len(annot_ap_stream));\r\n        memcpy(ap_buf->data, annot_ap_stream, (ap_buf->len = (int)str::Len(annot_ap_stream)));\r\n        pdf_dict_puts_drop(ap_obj, \"Length\", pdf_new_int(doc, ap_buf->len));\r\n        // append the appearance stream to the file\r\n        int num = pdf_create_object(doc);\r\n        pdf_update_object(doc, num, ap_obj);\r\n        pdf_update_stream(doc, num, ap_buf);\r\n        pdf_dict_puts_drop(pdf_dict_gets(annot_obj, \"AP\"), \"N\", pdf_new_indirect(doc, num, 0));\r\n    }\r\n    fz_always(ctx) {\r\n        pdf_drop_obj(ap_obj);\r\n        fz_drop_buffer(ctx, ap_buf);\r\n        pdf_drop_obj(annot_obj);\r\n    }\r\n    fz_catch(ctx) {\r\n        return false;\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nbool PdfEngineImpl::SaveUserAnnots(const WCHAR *fileName)\r\n{\r\n    if (!userAnnots.Count())\r\n        return true;\r\n\r\n    ScopedCritSec scope1(&pagesAccess);\r\n    ScopedCritSec scope2(&ctxAccess);\r\n\r\n    bool ok = true;\r\n    ScopedMem<char> pathUtf8(str::conv::ToUtf8(fileName));\r\n    Vec<PageAnnotation> pageAnnots;\r\n\r\n    fz_try(ctx) {\r\n        for (int pageNo = 1; pageNo <= PageCount(); pageNo++) {\r\n            pdf_page *page = GetPdfPage(pageNo);\r\n            // TODO: this will skip annotations for broken documents\r\n            if (!page || !pdf_to_num(_pageObjs[pageNo - 1])) {\r\n                ok = false;\r\n                break;\r\n            }\r\n            pageAnnots = fz_get_user_page_annots(userAnnots, pageNo);\r\n            if (pageAnnots.Count() == 0)\r\n                continue;\r\n            // get the page's /Annots array for appending\r\n            pdf_obj *annots = pdf_dict_gets(_pageObjs[pageNo - 1], \"Annots\");\r\n            if (!pdf_is_array(annots)) {\r\n                pdf_dict_puts_drop(_pageObjs[pageNo - 1], \"Annots\", pdf_new_array(_doc, (int)pageAnnots.Count()));\r\n                annots = pdf_dict_gets(_pageObjs[pageNo - 1], \"Annots\");\r\n            }\r\n            if (!pdf_is_indirect(annots)) {\r\n                // make /Annots indirect for the current /Page\r\n                pdf_dict_puts_drop(_pageObjs[pageNo - 1], \"Annots\", pdf_new_ref(_doc, annots));\r\n            }\r\n            // append all annotations for the current page\r\n            for (size_t i = 0; i < pageAnnots.Count(); i++) {\r\n                ok &= pdf_file_update_add_annotation(_doc, page, _pageObjs[pageNo - 1], pageAnnots.At(i), annots);\r\n            }\r\n        }\r\n        if (ok) {\r\n            fz_write_options opts = { 0 };\r\n            opts.do_incremental = 1;\r\n            pdf_write_document(_doc, pathUtf8, &opts);\r\n        }\r\n    }\r\n    fz_catch(ctx) {\r\n        ok = false;\r\n    }\r\n    return ok;\r\n}\r\n\r\nbool PdfEngineImpl::SaveEmbedded(LinkSaverUI& saveUI, int num, int gen)\r\n{\r\n    ScopedCritSec scope(&ctxAccess);\r\n\r\n    fz_buffer *data = nullptr;\r\n    fz_try(ctx) {\r\n        data = pdf_load_stream(_doc, num, gen);\r\n    }\r\n    fz_catch(ctx) {\r\n        return false;\r\n    }\r\n    CrashIf(nullptr == data);\r\n    bool result = saveUI.SaveEmbedded(data->data, data->len);\r\n    fz_drop_buffer(ctx, data);\r\n    return result;\r\n}\r\n\r\nbool PdfEngineImpl::HasClipOptimizations(int pageNo)\r\n{\r\n    pdf_page *page = GetPdfPage(pageNo, true);\r\n    // GetPdfPage extracts imageRects for us\r\n    if (!page || !imageRects[pageNo-1])\r\n        return true;\r\n\r\n    fz_rect mbox = fz_RectD_to_rect(PageMediabox(pageNo));\r\n    // check if any image covers at least 90% of the page\r\n    for (int i = 0; !fz_is_empty_rect(&imageRects[pageNo-1][i]); i++)\r\n        if (fz_calc_overlap(mbox, imageRects[pageNo-1][i]) >= 0.9f)\r\n            return false;\r\n    return true;\r\n}\r\n\r\nWCHAR *PdfEngineImpl::GetPageLabel(int pageNo) const\r\n{\r\n    if (!_pagelabels || pageNo < 1 || PageCount() < pageNo)\r\n        return BaseEngine::GetPageLabel(pageNo);\r\n\r\n    return str::Dup(_pagelabels->At(pageNo - 1));\r\n}\r\n\r\nint PdfEngineImpl::GetPageByLabel(const WCHAR *label) const\r\n{\r\n    int pageNo = _pagelabels ? _pagelabels->Find(label) + 1 : 0;\r\n    if (!pageNo)\r\n        return BaseEngine::GetPageByLabel(label);\r\n\r\n    return pageNo;\r\n}\r\n\r\nstatic bool IsRelativeURI(const WCHAR *uri)\r\n{\r\n    const WCHAR *c = uri;\r\n    while (*c && *c != ':' && *c != '/' && *c != '?' && *c != '#') {\r\n        c++;\r\n    }\r\n    return *c != ':';\r\n}\r\n\r\nWCHAR *PdfLink::GetValue() const\r\n{\r\n    if (!link || !engine)\r\n        return nullptr;\r\n    if (link->kind != FZ_LINK_URI && link->kind != FZ_LINK_LAUNCH &&\r\n        link->kind != FZ_LINK_GOTOR)\r\n        return nullptr;\r\n\r\n    ScopedCritSec scope(&engine->ctxAccess);\r\n\r\n    WCHAR *path = nullptr;\r\n\r\n    switch (link->kind) {\r\n    case FZ_LINK_URI:\r\n        path = str::conv::FromUtf8(link->ld.uri.uri);\r\n        if (IsRelativeURI(path)) {\r\n            ScopedMem<WCHAR> base;\r\n            fz_try(engine->ctx) {\r\n                pdf_obj *obj = pdf_dict_gets(pdf_trailer(engine->_doc), \"Root\");\r\n                obj = pdf_dict_gets(pdf_dict_gets(obj, \"URI\"), \"Base\");\r\n                if (obj)\r\n                    base.Set(str::conv::FromPdf(obj));\r\n            }\r\n            fz_catch(engine->ctx) { }\r\n            if (!str::IsEmpty(base.Get())) {\r\n                ScopedMem<WCHAR> uri(str::Join(base, path));\r\n                free(path);\r\n                path = uri.StealData();\r\n            }\r\n        }\r\n        if (link->ld.uri.is_map) {\r\n            int x = 0, y = 0;\r\n            if (rect.Contains(pt)) {\r\n                x = (int)(pt.x - rect.x + 0.5);\r\n                y = (int)(pt.y - rect.y + 0.5);\r\n            }\r\n            ScopedMem<WCHAR> uri(str::Format(L\"%s?%d,%d\", path, x, y));\r\n            free(path);\r\n            path = uri.StealData();\r\n        }\r\n        break;\r\n    case FZ_LINK_LAUNCH:\r\n        // note: we (intentionally) don't support the /Win specific Launch parameters\r\n        if (link->ld.launch.file_spec)\r\n            path = str::conv::FromUtf8(link->ld.launch.file_spec);\r\n        if (path && link->ld.launch.embedded_num && str::EndsWithI(path, L\".pdf\")) {\r\n            free(path);\r\n            path = str::Format(L\"%s:%d:%d\", engine->FileName(),\r\n                link->ld.launch.embedded_num, link->ld.launch.embedded_gen);\r\n        }\r\n        break;\r\n    case FZ_LINK_GOTOR:\r\n        if (link->ld.gotor.file_spec)\r\n            path = str::conv::FromUtf8(link->ld.gotor.file_spec);\r\n        break;\r\n    }\r\n\r\n    return path;\r\n}\r\n\r\nstatic PageDestType DestTypeFromName(const char *name)\r\n{\r\n    // named actions are converted either to Dest_Name or Dest_NameDialog\r\n#define HandleType(type) if (str::Eq(name, #type)) return Dest_ ## type\r\n#define HandleTypeDialog(type) if (str::Eq(name, #type)) return Dest_ ## type ## Dialog\r\n    // predefined named actions\r\n    HandleType(NextPage);\r\n    HandleType(PrevPage);\r\n    HandleType(FirstPage);\r\n    HandleType(LastPage);\r\n    // Adobe Reader extensions to the spec\r\n    // cf. http://www.tug.org/applications/hyperref/manual.html\r\n    HandleTypeDialog(Find);\r\n    HandleType(FullScreen);\r\n    HandleType(GoBack);\r\n    HandleType(GoForward);\r\n    HandleTypeDialog(GoToPage);\r\n    HandleTypeDialog(Print);\r\n    HandleTypeDialog(SaveAs);\r\n    HandleTypeDialog(ZoomTo);\r\n#undef HandleType\r\n#undef HandleTypeDialog\r\n    // named action that we don't support (or invalid action name)\r\n    return Dest_None;\r\n}\r\n\r\nPageDestType PdfLink::GetDestType() const\r\n{\r\n    if (!link)\r\n        return Dest_None;\r\n\r\n    switch (link->kind) {\r\n    case FZ_LINK_GOTO:\r\n        return Dest_ScrollTo;\r\n    case FZ_LINK_URI:\r\n        return Dest_LaunchURL;\r\n    case FZ_LINK_NAMED:\r\n        return DestTypeFromName(link->ld.named.named);\r\n    case FZ_LINK_LAUNCH:\r\n        if (link->ld.launch.embedded_num)\r\n            return Dest_LaunchEmbedded;\r\n        if (link->ld.launch.is_uri)\r\n            return Dest_LaunchURL;\r\n        return Dest_LaunchFile;\r\n    case FZ_LINK_GOTOR:\r\n        return Dest_LaunchFile;\r\n    default:\r\n        return Dest_None; // unsupported action\r\n    }\r\n}\r\n\r\nint PdfLink::GetDestPageNo() const\r\n{\r\n    if (link && FZ_LINK_GOTO == link->kind)\r\n        return link->ld.gotor.page + 1;\r\n    if (link && FZ_LINK_GOTOR == link->kind && !link->ld.gotor.dest)\r\n        return link->ld.gotor.page + 1;\r\n    return 0;\r\n}\r\n\r\nRectD PdfLink::GetDestRect() const\r\n{\r\n    RectD result(DEST_USE_DEFAULT, DEST_USE_DEFAULT, DEST_USE_DEFAULT, DEST_USE_DEFAULT);\r\n    if (!link || FZ_LINK_GOTO != link->kind && FZ_LINK_GOTOR != link->kind)\r\n        return result;\r\n    if (link->ld.gotor.page < 0 || link->ld.gotor.page >= engine->PageCount())\r\n        return result;\r\n\r\n    pdf_page *page = engine->GetPdfPage(link->ld.gotor.page + 1);\r\n    if (!page)\r\n        return result;\r\n    fz_point lt = link->ld.gotor.lt, rb = link->ld.gotor.rb;\r\n    fz_transform_point(&lt, &page->ctm);\r\n    fz_transform_point(&rb, &page->ctm);\r\n\r\n    if ((link->ld.gotor.flags & fz_link_flag_r_is_zoom)) {\r\n        // /XYZ link, undefined values for the coordinates mean: keep the current position\r\n        if ((link->ld.gotor.flags & fz_link_flag_l_valid))\r\n            result.x = lt.x;\r\n        if ((link->ld.gotor.flags & fz_link_flag_t_valid))\r\n            result.y = lt.y;\r\n        result.dx = result.dy = 0;\r\n    }\r\n    else if ((link->ld.gotor.flags & (fz_link_flag_fit_h | fz_link_flag_fit_v)) == (fz_link_flag_fit_h | fz_link_flag_fit_v) &&\r\n        (link->ld.gotor.flags & (fz_link_flag_l_valid | fz_link_flag_t_valid | fz_link_flag_r_valid | fz_link_flag_b_valid))) {\r\n        // /FitR link\r\n        result = RectD::FromXY(lt.x, lt.y, rb.x, rb.y);\r\n        // an empty destination rectangle would imply an /XYZ-type link to callers\r\n        if (result.IsEmpty())\r\n            result.dx = result.dy = 0.1;\r\n    }\r\n    else if ((link->ld.gotor.flags & (fz_link_flag_fit_h | fz_link_flag_fit_v)) == fz_link_flag_fit_h &&\r\n        (link->ld.gotor.flags & fz_link_flag_t_valid)) {\r\n        // /FitH or /FitBH link\r\n        result.y = lt.y;\r\n    }\r\n    // all other link types only affect the zoom level, which we intentionally leave alone\r\n    return result;\r\n}\r\n\r\nWCHAR *PdfLink::GetDestName() const\r\n{\r\n    if (!link || FZ_LINK_GOTOR != link->kind || !link->ld.gotor.dest)\r\n        return nullptr;\r\n    return str::conv::FromUtf8(link->ld.gotor.dest);\r\n}\r\n\r\nbool PdfLink::SaveEmbedded(LinkSaverUI& saveUI)\r\n{\r\n    ScopedCritSec scope(&engine->ctxAccess);\r\n    return engine->SaveEmbedded(saveUI, link->ld.launch.embedded_num, link->ld.launch.embedded_gen);\r\n}\r\n\r\nBaseEngine *PdfEngineImpl::CreateFromFile(const WCHAR *fileName, PasswordUI *pwdUI)\r\n{\r\n    PdfEngineImpl *engine = new PdfEngineImpl();\r\n    if (!engine || !fileName || !engine->Load(fileName, pwdUI)) {\r\n        delete engine;\r\n        return nullptr;\r\n    }\r\n    return engine;\r\n}\r\n\r\nBaseEngine *PdfEngineImpl::CreateFromStream(IStream *stream, PasswordUI *pwdUI)\r\n{\r\n    PdfEngineImpl *engine = new PdfEngineImpl();\r\n    if (!engine->Load(stream, pwdUI)) {\r\n        delete engine;\r\n        return nullptr;\r\n    }\r\n    return engine;\r\n}\r\n\r\nnamespace PdfEngine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff)\r\n{\r\n    if (sniff) {\r\n        char header[1024] = { 0 };\r\n        file::ReadN(fileName, header, sizeof(header));\r\n\r\n        for (int i = 0; i < sizeof(header) - 4; i++) {\r\n            if (str::EqN(header + i, \"%PDF\", 4))\r\n                return true;\r\n        }\r\n        return false;\r\n    }\r\n\r\n    return str::EndsWithI(fileName, L\".pdf\") || findEmbedMarks(fileName);\r\n}\r\n\r\nBaseEngine *CreateFromFile(const WCHAR *fileName, PasswordUI *pwdUI)\r\n{\r\n    return PdfEngineImpl::CreateFromFile(fileName, pwdUI);\r\n}\r\n\r\nBaseEngine *CreateFromStream(IStream *stream, PasswordUI *pwdUI)\r\n{\r\n    return PdfEngineImpl::CreateFromStream(stream, pwdUI);\r\n}\r\n\r\n}\r\n\r\n///// XPS-specific extensions to Fitz/MuXPS /////\r\n\r\nextern \"C\" {\r\n#include <mupdf/xps.h>\r\n}\r\n\r\n// TODO: use http://schemas.openxps.org/oxps/v1.0 as well once NS actually matters\r\n#define NS_XPS_MICROSOFT \"http://schemas.microsoft.com/xps/2005/06\"\r\n\r\nfz_rect\r\nxps_bound_page_quick(xps_document *doc, int number)\r\n{\r\n    xps_page *page = doc->first_page;\r\n    for (int n = 0; n < number && page; n++)\r\n        page = page->next;\r\n\r\n    xps_part *part = page ? xps_read_part(doc, page->name) : nullptr;\r\n    if (!part)\r\n        return fz_empty_rect;\r\n\r\n    const char *data = (const char *)part->data;\r\n    size_t data_size = part->size;\r\n\r\n    ScopedMem<char> dataUtf8;\r\n    if (str::StartsWith(data, UTF16BE_BOM)) {\r\n        for (int i = 0; i + 1 < part->size; i += 2) {\r\n            std::swap(part->data[i], part->data[i+1]);\r\n        }\r\n    }\r\n    if (str::StartsWith(data, UTF16_BOM)) {\r\n        dataUtf8.Set(str::conv::ToUtf8((const WCHAR *)(part->data + 2), (part->size - 2) / 2));\r\n        data = dataUtf8;\r\n        data_size = str::Len(dataUtf8);\r\n    }\r\n    else if (str::StartsWith(data, UTF8_BOM)) {\r\n        data += 3;\r\n        data_size -= 3;\r\n    }\r\n\r\n    HtmlPullParser p(data, data_size);\r\n    HtmlToken *tok = p.Next();\r\n    fz_rect bounds = fz_empty_rect;\r\n    if (tok && tok->IsStartTag() && tok->NameIsNS(\"FixedPage\", NS_XPS_MICROSOFT)) {\r\n        AttrInfo *attr = tok->GetAttrByNameNS(\"Width\", NS_XPS_MICROSOFT);\r\n        if (attr)\r\n            bounds.x1 = fz_atof(attr->val) * 72.0f / 96.0f;\r\n        attr = tok->GetAttrByNameNS(\"Height\", NS_XPS_MICROSOFT);\r\n        if (attr)\r\n            bounds.y1 = fz_atof(attr->val) * 72.0f / 96.0f;\r\n    }\r\n\r\n    xps_free_part(doc, part);\r\n\r\n    return bounds;\r\n}\r\n\r\nclass xps_doc_props {\r\npublic:\r\n    ScopedMem<WCHAR> title;\r\n    ScopedMem<WCHAR> author;\r\n    ScopedMem<WCHAR> subject;\r\n    ScopedMem<WCHAR> creation_date;\r\n    ScopedMem<WCHAR> modification_date;\r\n};\r\n\r\nstatic fz_xml *\r\nxps_open_and_parse(xps_document *doc, char *path)\r\n{\r\n    fz_xml *root = nullptr;\r\n    xps_part *part = xps_read_part(doc, path);\r\n\r\n    fz_try(doc->ctx) {\r\n        root = fz_parse_xml(doc->ctx, part->data, part->size, 0);\r\n    }\r\n    fz_always(doc->ctx) {\r\n        xps_free_part(doc, part);\r\n    }\r\n    fz_catch(doc->ctx) {\r\n        fz_rethrow(doc->ctx);\r\n    }\r\n\r\n    return root;\r\n}\r\n\r\nstatic WCHAR *\r\nxps_get_core_prop(fz_context *ctx, fz_xml *item)\r\n{\r\n    fz_xml *text = fz_xml_down(item);\r\n\r\n    if (!text)\r\n        return nullptr;\r\n    if (!fz_xml_text(text) || fz_xml_next(text)) {\r\n        fz_warn(ctx, \"non-text content for property %s\", fz_xml_tag(item));\r\n        return nullptr;\r\n    }\r\n\r\n    char *start, *end;\r\n    for (start = fz_xml_text(text); str::IsWs(*start); start++);\r\n    for (end = start + strlen(start); end > start && str::IsWs(*(end - 1)); end--);\r\n\r\n    return str::conv::FromHtmlUtf8(start, end - start);\r\n}\r\n\r\n#define REL_CORE_PROPERTIES \\\r\n    \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\"\r\n\r\nxps_doc_props *\r\nxps_extract_doc_props(xps_document *doc)\r\n{\r\n    fz_xml *root = xps_open_and_parse(doc, \"/_rels/.rels\");\r\n\r\n    if (!fz_xml_is_tag(root, \"Relationships\")) {\r\n        fz_free_xml(doc->ctx, root);\r\n        fz_throw(doc->ctx, FZ_ERROR_GENERIC, \"couldn't parse part '/_rels/.rels'\");\r\n    }\r\n\r\n    bool has_correct_root = false;\r\n    for (fz_xml *item = fz_xml_down(root); item; item = fz_xml_next(item)) {\r\n        if (fz_xml_is_tag(item, \"Relationship\") &&\r\n            str::Eq(fz_xml_att(item, \"Type\"), REL_CORE_PROPERTIES) && fz_xml_att(item, \"Target\")) {\r\n            char path[1024];\r\n            xps_resolve_url(path, \"\", fz_xml_att(item, \"Target\"), nelem(path));\r\n            fz_free_xml(doc->ctx, root);\r\n            root = xps_open_and_parse(doc, path);\r\n            has_correct_root = true;\r\n            break;\r\n        }\r\n    }\r\n\r\n    if (!has_correct_root) {\r\n        fz_free_xml(doc->ctx, root);\r\n        return nullptr;\r\n    }\r\n\r\n    xps_doc_props *props = new xps_doc_props();\r\n\r\n    for (fz_xml *item = fz_xml_down(root); item; item = fz_xml_next(item)) {\r\n        if (fz_xml_is_tag(item, /*\"dc:\"*/\"title\") && !props->title)\r\n            props->title.Set(xps_get_core_prop(doc->ctx, item));\r\n        else if (fz_xml_is_tag(item, /*\"dc:\"*/\"creator\") && !props->author)\r\n            props->author.Set(xps_get_core_prop(doc->ctx, item));\r\n        else if (fz_xml_is_tag(item, /*\"dc:\"*/\"subject\") && !props->subject)\r\n            props->subject.Set(xps_get_core_prop(doc->ctx, item));\r\n        else if (fz_xml_is_tag(item, /*\"dcterms:\"*/\"created\") && !props->creation_date)\r\n            props->creation_date.Set(xps_get_core_prop(doc->ctx, item));\r\n        else if (fz_xml_is_tag(item, /*\"dcterms:\"*/\"modified\") && !props->modification_date)\r\n            props->modification_date.Set(xps_get_core_prop(doc->ctx, item));\r\n    }\r\n    fz_free_xml(doc->ctx, root);\r\n\r\n    return props;\r\n}\r\n\r\n///// XpsEngine is also based on Fitz and shares quite some code with PdfEngine /////\r\n\r\nstruct XpsPageRun {\r\n    xps_page *page;\r\n    fz_display_list *list;\r\n    size_t size_est;\r\n    int refs;\r\n\r\n    XpsPageRun(xps_page *page, fz_display_list *list, ListInspectionData& data) :\r\n        page(page), list(list), size_est(data.mem_estimate), refs(1) { }\r\n};\r\n\r\nclass XpsTocItem;\r\nclass XpsImage;\r\n\r\nclass XpsEngineImpl : public BaseEngine {\r\n    friend XpsImage;\r\n\r\npublic:\r\n    XpsEngineImpl();\r\n    virtual ~XpsEngineImpl();\r\n    BaseEngine *Clone() override;\r\n\r\n    const WCHAR *FileName() const override { return _fileName; };\r\n    int PageCount() const override {\r\n        return _doc ? xps_count_pages(_doc) : 0;\r\n    }\r\n\r\n    RectD PageMediabox(int pageNo) override;\r\n    RectD PageContentBox(int pageNo, RenderTarget target=Target_View) override;\r\n\r\n    RenderedBitmap *RenderBitmap(int pageNo, float zoom, int rotation,\r\n                         RectD *pageRect=nullptr, /* if nullptr: defaults to the page's mediabox */\r\n                         RenderTarget target=Target_View, AbortCookie **cookie_out=nullptr) override;\r\n\r\n    PointD Transform(PointD pt, int pageNo, float zoom, int rotation, bool inverse=false) override;\r\n    RectD Transform(RectD rect, int pageNo, float zoom, int rotation, bool inverse=false) override;\r\n\r\n    unsigned char *GetFileData(size_t *cbCount) override;\r\n    bool SaveFileAs(const WCHAR *copyFileName, bool includeUserAnnots=false) override;\r\n    WCHAR * ExtractPageText(int pageNo, const WCHAR *lineSep, RectI **coordsOut=nullptr,\r\n                                    RenderTarget target=Target_View) override {\r\n        UNUSED(target);\r\n        return ExtractPageText(GetXpsPage(pageNo), lineSep, coordsOut);\r\n    }\r\n    bool HasClipOptimizations(int pageNo) override;\r\n    WCHAR *GetProperty(DocumentProperty prop) override;\r\n\r\n    bool SupportsAnnotation(bool forSaving=false) const override;\r\n    void UpdateUserAnnotations(Vec<PageAnnotation> *list) override;\r\n\r\n    float GetFileDPI() const override { return 72.0f; }\r\n    const WCHAR *GetDefaultFileExt() const override { return L\".xps\"; }\r\n\r\n    bool BenchLoadPage(int pageNo) override { return GetXpsPage(pageNo) != nullptr; }\r\n\r\n    Vec<PageElement *> *GetElements(int pageNo) override;\r\n    PageElement *GetElementAtPos(int pageNo, PointD pt) override;\r\n\r\n    PageDestination *GetNamedDest(const WCHAR *name) override;\r\n    bool HasTocTree() const override { return _outline != nullptr; }\r\n    DocTocItem *GetTocTree() override;\r\n\r\n    fz_rect FindDestRect(const char *target);\r\n\r\n    static BaseEngine *CreateFromFile(const WCHAR *fileName);\r\n    static BaseEngine *CreateFromStream(IStream *stream);\r\n\r\nprotected:\r\n    WCHAR *_fileName;\r\n\r\n    // make sure to never ask for _pagesAccess in an ctxAccess\r\n    // protected critical section in order to avoid deadlocks\r\n    CRITICAL_SECTION ctxAccess;\r\n    fz_context *    ctx;\r\n    fz_locks_context fz_locks_ctx;\r\n    xps_document *  _doc;\r\n    fz_stream *     _docStream;\r\n\r\n    CRITICAL_SECTION _pagesAccess;\r\n    xps_page **     _pages;\r\n\r\n    bool            Load(const WCHAR *fileName);\r\n    bool            Load(IStream *stream);\r\n    bool            Load(fz_stream *stm);\r\n    bool            LoadFromStream(fz_stream *stm);\r\n\r\n    xps_page      * GetXpsPage(int pageNo, bool failIfBusy=false);\r\n    int             GetPageNo(xps_page *page);\r\n    fz_matrix       viewctm(int pageNo, float zoom, int rotation) {\r\n        const fz_rect tmpRect = fz_RectD_to_rect(PageMediabox(pageNo));\r\n        return fz_create_view_ctm(&tmpRect, zoom, rotation);\r\n    }\r\n    fz_matrix       viewctm(xps_page *page, float zoom, int rotation) {\r\n        fz_rect r;\r\n        return fz_create_view_ctm(xps_bound_page(_doc, page, &r), zoom, rotation);\r\n    }\r\n    WCHAR         * ExtractPageText(xps_page *page, const WCHAR *lineSep,\r\n                                    RectI **coordsOut=nullptr, bool cacheRun=false);\r\n\r\n    Vec<XpsPageRun *> runCache; // ordered most recently used first\r\n    XpsPageRun    * CreatePageRun(xps_page *page, fz_display_list *list);\r\n    XpsPageRun    * GetPageRun(xps_page *page, bool tryOnly=false);\r\n    bool            RunPage(xps_page *page, fz_device *dev, const fz_matrix *ctm,\r\n                            const fz_rect *cliprect=nullptr, bool cacheRun=true,\r\n                            FitzAbortCookie *cookie=nullptr);\r\n    void            DropPageRun(XpsPageRun *run, bool forceRemove=false);\r\n\r\n    XpsTocItem    * BuildTocTree(fz_outline *entry, int& idCounter);\r\n    void            LinkifyPageText(xps_page *page, int pageNo);\r\n    RenderedBitmap *GetPageImage(int pageNo, RectD rect, size_t imageIx);\r\n    WCHAR         * ExtractFontList();\r\n\r\n    RectD         * _mediaboxes;\r\n    fz_outline    * _outline;\r\n    xps_doc_props * _info;\r\n    fz_rect      ** imageRects;\r\n\r\n    Vec<PageAnnotation> userAnnots;\r\n};\r\n\r\nclass XpsLink : public PageElement, public PageDestination {\r\n    XpsEngineImpl *engine;\r\n    fz_link_dest *link; // owned by a fz_link or fz_outline\r\n    RectD rect;\r\n    int pageNo;\r\n\r\npublic:\r\n    XpsLink() : engine(nullptr), link(nullptr), pageNo(-1) { }\r\n    XpsLink(XpsEngineImpl *engine, fz_link_dest *link, fz_rect rect=fz_empty_rect, int pageNo=-1) :\r\n        engine(engine), link(link), rect(fz_rect_to_RectD(rect)), pageNo(pageNo) { }\r\n\r\n    PageElementType GetType() const  override { return Element_Link; }\r\n    int GetPageNo() const  override { return pageNo; }\r\n    RectD GetRect() const  override { return rect; }\r\n    WCHAR *GetValue() const  override {\r\n        if (link && FZ_LINK_URI == link->kind)\r\n            return str::conv::FromUtf8(link->ld.uri.uri);\r\n        return nullptr;\r\n    }\r\n    virtual PageDestination *AsLink() { return this; }\r\n\r\n    PageDestType GetDestType() const override {\r\n        if (!link)\r\n            return Dest_None;\r\n        if (FZ_LINK_GOTO == link->kind)\r\n            return Dest_ScrollTo;\r\n        if (FZ_LINK_URI == link->kind)\r\n            return Dest_LaunchURL;\r\n        return Dest_None;\r\n    }\r\n    int GetDestPageNo() const override {\r\n        if (!link || link->kind != FZ_LINK_GOTO)\r\n            return 0;\r\n        return link->ld.gotor.page + 1;\r\n    }\r\n    RectD GetDestRect() const override {\r\n        if (!engine || !link || link->kind != FZ_LINK_GOTO || !link->ld.gotor.dest)\r\n            return RectD(DEST_USE_DEFAULT, DEST_USE_DEFAULT, DEST_USE_DEFAULT, DEST_USE_DEFAULT);\r\n        return fz_rect_to_RectD(engine->FindDestRect(link->ld.gotor.dest));\r\n    }\r\n    WCHAR *GetDestValue() const override { return GetValue(); }\r\n};\r\n\r\nclass XpsTocItem : public DocTocItem {\r\n    XpsLink link;\r\n\r\npublic:\r\n    XpsTocItem(WCHAR *title, XpsLink link) : DocTocItem(title), link(link) { }\r\n\r\n    virtual PageDestination *GetLink() { return &link; }\r\n};\r\n\r\nclass XpsImage : public PageElement {\r\n    XpsEngineImpl *engine;\r\n    int pageNo;\r\n    RectD rect;\r\n    size_t imageIx;\r\n\r\npublic:\r\n    XpsImage(XpsEngineImpl *engine, int pageNo, fz_rect rect, size_t imageIx) :\r\n        engine(engine), pageNo(pageNo), rect(fz_rect_to_RectD(rect)), imageIx(imageIx) { }\r\n\r\n    virtual PageElementType GetType() const { return Element_Image; }\r\n    virtual int GetPageNo() const { return pageNo; }\r\n    virtual RectD GetRect() const { return rect; }\r\n    virtual WCHAR *GetValue() const { return nullptr; }\r\n\r\n    virtual RenderedBitmap *GetImage() {\r\n        return engine->GetPageImage(pageNo, rect, imageIx);\r\n    }\r\n};\r\n\r\nXpsEngineImpl::XpsEngineImpl() : _fileName(nullptr), _doc(nullptr), _docStream(nullptr), _pages(nullptr),\r\n    _mediaboxes(nullptr), _outline(nullptr), _info(nullptr), imageRects(nullptr)\r\n{\r\n    InitializeCriticalSection(&_pagesAccess);\r\n    InitializeCriticalSection(&ctxAccess);\r\n\r\n    fz_locks_ctx.user = &ctxAccess;\r\n    fz_locks_ctx.lock = fz_lock_context_cs;\r\n    fz_locks_ctx.unlock = fz_unlock_context_cs;\r\n    ctx = fz_new_context(nullptr, &fz_locks_ctx, MAX_CONTEXT_MEMORY);\r\n}\r\n\r\nXpsEngineImpl::~XpsEngineImpl()\r\n{\r\n    EnterCriticalSection(&_pagesAccess);\r\n    EnterCriticalSection(&ctxAccess);\r\n\r\n    if (_pages) {\r\n        // xps_pages are freed by xps_close_document -> xps_free_page_list\r\n        assert(_doc);\r\n        free(_pages);\r\n    }\r\n\r\n    fz_free_outline(ctx, _outline);\r\n    delete _info;\r\n\r\n    if (imageRects) {\r\n        for (int i = 0; i < PageCount(); i++)\r\n            free(imageRects[i]);\r\n        free(imageRects);\r\n    }\r\n\r\n    while (runCache.Count() > 0) {\r\n        assert(runCache.Last()->refs == 1);\r\n        DropPageRun(runCache.Last(), true);\r\n    }\r\n\r\n    xps_close_document(_doc);\r\n    _doc = nullptr;\r\n    fz_close(_docStream);\r\n    _docStream = nullptr;\r\n    fz_free_context(ctx);\r\n    ctx = nullptr;\r\n\r\n    free(_mediaboxes);\r\n    free(_fileName);\r\n\r\n    LeaveCriticalSection(&ctxAccess);\r\n    DeleteCriticalSection(&ctxAccess);\r\n    LeaveCriticalSection(&_pagesAccess);\r\n    DeleteCriticalSection(&_pagesAccess);\r\n}\r\n\r\nBaseEngine *XpsEngineImpl::Clone()\r\n{\r\n    ScopedCritSec scope(&ctxAccess);\r\n\r\n    XpsEngineImpl *clone = new XpsEngineImpl();\r\n    if (!clone || !(_fileName ? clone->Load(_fileName) : clone->Load(_docStream))) {\r\n        delete clone;\r\n        return nullptr;\r\n    }\r\n\r\n    clone->UpdateUserAnnotations(&userAnnots);\r\n\r\n    return clone;\r\n}\r\n\r\nbool XpsEngineImpl::Load(const WCHAR *fileName)\r\n{\r\n    AssertCrash(!_fileName && !_doc && !_docStream && ctx);\r\n    _fileName = str::Dup(fileName);\r\n    if (!_fileName || !ctx)\r\n        return false;\r\n\r\n    if (dir::Exists(_fileName)) {\r\n        // load uncompressed documents as a recompressed ZIP stream\r\n        ScopedComPtr<IStream> zipStream(OpenDirAsZipStream(_fileName, true));\r\n        if (!zipStream)\r\n            return false;\r\n        return Load(zipStream);\r\n    }\r\n\r\n    fz_stream *stm = nullptr;\r\n    fz_try(ctx) {\r\n        stm = fz_open_file2(ctx, _fileName);\r\n    }\r\n    fz_catch(ctx) {\r\n        return false;\r\n    }\r\n    return LoadFromStream(stm);\r\n}\r\n\r\nbool XpsEngineImpl::Load(IStream *stream)\r\n{\r\n    assert(!_doc && !_docStream && ctx);\r\n    if (!ctx)\r\n        return false;\r\n\r\n    fz_stream *stm = nullptr;\r\n    fz_try(ctx) {\r\n        stm = fz_open_istream(ctx, stream);\r\n    }\r\n    fz_catch(ctx) {\r\n        return false;\r\n    }\r\n    return LoadFromStream(stm);\r\n}\r\n\r\nbool XpsEngineImpl::Load(fz_stream *stm)\r\n{\r\n    assert(!_fileName && !_doc && !_docStream && ctx);\r\n    if (!ctx)\r\n        return false;\r\n\r\n    fz_try(ctx) {\r\n        stm = fz_clone_stream(ctx, stm);\r\n    }\r\n    fz_catch(ctx) {\r\n        return false;\r\n    }\r\n    return LoadFromStream(stm);\r\n}\r\n\r\nbool XpsEngineImpl::LoadFromStream(fz_stream *stm)\r\n{\r\n    if (!stm)\r\n        return false;\r\n\r\n    _docStream = stm;\r\n    fz_try(ctx) {\r\n        _doc = xps_open_document_with_stream(ctx, stm);\r\n    }\r\n    fz_catch(ctx) {\r\n        return false;\r\n    }\r\n\r\n    if (PageCount() == 0) {\r\n        fz_warn(ctx, \"document has no pages\");\r\n        return false;\r\n    }\r\n\r\n    _pages = AllocArray<xps_page *>(PageCount());\r\n    _mediaboxes = AllocArray<RectD>(PageCount());\r\n    imageRects = AllocArray<fz_rect *>(PageCount());\r\n\r\n    if (!_pages || !_mediaboxes || !imageRects)\r\n        return false;\r\n\r\n    fz_try(ctx) {\r\n        _outline = xps_load_outline(_doc);\r\n    }\r\n    fz_catch(ctx) {\r\n        fz_warn(ctx, \"Couldn't load outline\");\r\n    }\r\n    fz_try(ctx) {\r\n        _info = xps_extract_doc_props(_doc);\r\n    }\r\n    fz_catch(ctx) {\r\n        fz_warn(ctx, \"Couldn't load document properties\");\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nxps_page *XpsEngineImpl::GetXpsPage(int pageNo, bool failIfBusy)\r\n{\r\n    if (!_pages)\r\n        return nullptr;\r\n    if (failIfBusy)\r\n        return _pages[pageNo-1];\r\n\r\n    ScopedCritSec scope(&_pagesAccess);\r\n\r\n    xps_page *page = _pages[pageNo-1];\r\n    if (!page) {\r\n        ScopedCritSec ctxScope(&ctxAccess);\r\n        fz_var(page);\r\n        fz_try(ctx) {\r\n            // caution: two calls to xps_load_page return the\r\n            // same xps_page object (without reference counting)\r\n            page = xps_load_page(_doc, pageNo - 1);\r\n            _pages[pageNo-1] = page;\r\n            LinkifyPageText(page, pageNo);\r\n            assert(page->links_resolved);\r\n        }\r\n        fz_catch(ctx) { }\r\n    }\r\n\r\n    return page;\r\n}\r\n\r\nint XpsEngineImpl::GetPageNo(xps_page *page)\r\n{\r\n    for (int i = 0; i < PageCount(); i++)\r\n        if (page == _pages[i])\r\n            return i + 1;\r\n    return 0;\r\n}\r\n\r\nXpsPageRun *XpsEngineImpl::CreatePageRun(xps_page *page, fz_display_list *list)\r\n{\r\n    Vec<FitzImagePos> positions;\r\n    ListInspectionData data(positions);\r\n    fz_device *dev = nullptr;\r\n\r\n    fz_var(dev);\r\n    fz_try(ctx) {\r\n        dev = fz_new_inspection_device(ctx, &data);\r\n        fz_run_display_list(list, dev, &fz_identity, nullptr, nullptr);\r\n    }\r\n    fz_catch(ctx) { }\r\n    fz_free_device(dev);\r\n\r\n    // save the image rectangles for this page\r\n    int pageNo = GetPageNo(page);\r\n    if (!imageRects[pageNo-1] && positions.Count() > 0) {\r\n        // the list of page image rectangles is terminated with a null-rectangle\r\n        fz_rect *rects = AllocArray<fz_rect>(positions.Count() + 1);\r\n        if (rects) {\r\n            for (size_t i = 0; i < positions.Count(); i++) {\r\n                rects[i] = positions.At(i).rect;\r\n            }\r\n            imageRects[pageNo-1] = rects;\r\n        }\r\n    }\r\n\r\n    return new XpsPageRun(page, list, data);\r\n}\r\n\r\nXpsPageRun *XpsEngineImpl::GetPageRun(xps_page *page, bool tryOnly)\r\n{\r\n    ScopedCritSec scope(&_pagesAccess);\r\n\r\n    XpsPageRun *result = nullptr;\r\n\r\n    for (size_t i = 0; i < runCache.Count(); i++) {\r\n        if (runCache.At(i)->page == page) {\r\n            result = runCache.At(i);\r\n            break;\r\n        }\r\n    }\r\n    if (!result && !tryOnly) {\r\n        size_t mem = 0;\r\n        for (size_t i = 0; i < runCache.Count(); i++) {\r\n            // drop page runs that take up too much memory due to huge images\r\n            // (except for the very recently used ones)\r\n            if (i >= 2 && mem + runCache.At(i)->size_est >= MAX_PAGE_RUN_MEMORY)\r\n                DropPageRun(runCache.At(i--), true);\r\n            else\r\n                mem += runCache.At(i)->size_est;\r\n        }\r\n        if (runCache.Count() >= MAX_PAGE_RUN_CACHE) {\r\n            assert(runCache.Count() == MAX_PAGE_RUN_CACHE);\r\n            DropPageRun(runCache.Last(), true);\r\n        }\r\n\r\n        ScopedCritSec ctxScope(&ctxAccess);\r\n\r\n        fz_display_list *list = nullptr;\r\n        fz_device *dev = nullptr;\r\n        fz_var(list);\r\n        fz_var(dev);\r\n        fz_try(ctx) {\r\n            list = fz_new_display_list(ctx);\r\n            dev = fz_new_list_device(ctx, list);\r\n            xps_run_page(_doc, page, dev, &fz_identity, nullptr);\r\n        }\r\n        fz_catch(ctx) {\r\n            fz_drop_display_list(ctx, list);\r\n            list = nullptr;\r\n        }\r\n        fz_free_device(dev);\r\n\r\n        if (list) {\r\n            result = CreatePageRun(page, list);\r\n            runCache.InsertAt(0, result);\r\n        }\r\n    }\r\n    else if (result && result != runCache.At(0)) {\r\n        // keep the list Most Recently Used first\r\n        runCache.Remove(result);\r\n        runCache.InsertAt(0, result);\r\n    }\r\n\r\n    if (result)\r\n        result->refs++;\r\n    return result;\r\n}\r\n\r\nbool XpsEngineImpl::RunPage(xps_page *page, fz_device *dev, const fz_matrix *ctm, const fz_rect *cliprect, bool cacheRun, FitzAbortCookie *cookie)\r\n{\r\n    bool ok = true;\r\n\r\n    XpsPageRun *run = GetPageRun(page, !cacheRun);\r\n    if (run) {\r\n        EnterCriticalSection(&ctxAccess);\r\n        Vec<PageAnnotation> pageAnnots = fz_get_user_page_annots(userAnnots, GetPageNo(page));\r\n        fz_try(ctx) {\r\n            fz_rect pagerect;\r\n            fz_begin_page(dev, xps_bound_page(_doc, page, &pagerect), ctm);\r\n            fz_run_page_transparency(pageAnnots, dev, cliprect, false);\r\n            fz_run_display_list(run->list, dev, ctm, cliprect, cookie ? &cookie->cookie : nullptr);\r\n            fz_run_page_transparency(pageAnnots, dev, cliprect, true);\r\n            fz_run_user_page_annots(pageAnnots, dev, ctm, cliprect, cookie ? &cookie->cookie : nullptr);\r\n            fz_end_page(dev);\r\n        }\r\n        fz_catch(ctx) {\r\n            ok = false;\r\n        }\r\n        LeaveCriticalSection(&ctxAccess);\r\n        DropPageRun(run);\r\n    }\r\n    else {\r\n        ScopedCritSec scope(&ctxAccess);\r\n        Vec<PageAnnotation> pageAnnots = fz_get_user_page_annots(userAnnots, GetPageNo(page));\r\n        fz_try(ctx) {\r\n            fz_rect pagerect;\r\n            fz_begin_page(dev, xps_bound_page(_doc, page, &pagerect), ctm);\r\n            fz_run_page_transparency(pageAnnots, dev, cliprect, false);\r\n            xps_run_page(_doc, page, dev, ctm, cookie ? &cookie->cookie : nullptr);\r\n            fz_run_page_transparency(pageAnnots, dev, cliprect, true);\r\n            fz_run_user_page_annots(pageAnnots, dev, ctm, cliprect, cookie ? &cookie->cookie : nullptr);\r\n            fz_end_page(dev);\r\n        }\r\n        fz_catch(ctx) {\r\n            ok = false;\r\n        }\r\n    }\r\n\r\n    EnterCriticalSection(&ctxAccess);\r\n    fz_free_device(dev);\r\n    LeaveCriticalSection(&ctxAccess);\r\n\r\n    return ok && !(cookie && cookie->cookie.abort);\r\n}\r\n\r\nvoid XpsEngineImpl::DropPageRun(XpsPageRun *run, bool forceRemove)\r\n{\r\n    ScopedCritSec scope(&_pagesAccess);\r\n    run->refs--;\r\n\r\n    if (0 == run->refs || forceRemove)\r\n        runCache.Remove(run);\r\n\r\n    if (0 == run->refs) {\r\n        ScopedCritSec ctxScope(&ctxAccess);\r\n        fz_drop_display_list(ctx, run->list);\r\n        delete run;\r\n    }\r\n}\r\n\r\nRectD XpsEngineImpl::PageMediabox(int pageNo)\r\n{\r\n    assert(1 <= pageNo && pageNo <= PageCount());\r\n    if (!_mediaboxes)\r\n        return RectD();\r\n\r\n    RectD mbox = _mediaboxes[pageNo-1];\r\n    if (!mbox.IsEmpty())\r\n        return mbox;\r\n\r\n    xps_page *page = GetXpsPage(pageNo, true);\r\n    if (!page) {\r\n        ScopedCritSec scope(&ctxAccess);\r\n        fz_try(ctx) {\r\n            mbox = fz_rect_to_RectD(xps_bound_page_quick(_doc, pageNo-1));\r\n        }\r\n        fz_catch(ctx) { }\r\n        if (!mbox.IsEmpty()) {\r\n            _mediaboxes[pageNo-1] = mbox;\r\n            return _mediaboxes[pageNo-1];\r\n        }\r\n    }\r\n    if (!page && (page = GetXpsPage(pageNo)) == nullptr)\r\n        return RectD();\r\n\r\n    fz_rect pagerect;\r\n    _mediaboxes[pageNo-1] = fz_rect_to_RectD(*xps_bound_page(_doc, page, &pagerect));\r\n    return _mediaboxes[pageNo-1];\r\n}\r\n\r\nRectD XpsEngineImpl::PageContentBox(int pageNo, RenderTarget target)\r\n{\r\n    UNUSED(target);\r\n    AssertCrash(1 <= pageNo && pageNo <= PageCount());\r\n    xps_page *page = GetXpsPage(pageNo);\r\n    if (!page)\r\n        return RectD();\r\n\r\n    fz_rect rect = fz_empty_rect;\r\n    fz_device *dev = nullptr;\r\n    EnterCriticalSection(&ctxAccess);\r\n    fz_try(ctx) {\r\n        dev = fz_new_bbox_device(ctx, &rect);\r\n    }\r\n    fz_catch(ctx) {\r\n        LeaveCriticalSection(&ctxAccess);\r\n        return RectD();\r\n    }\r\n    LeaveCriticalSection(&ctxAccess);\r\n\r\n    fz_rect pagerect;\r\n    xps_bound_page(_doc, page, &pagerect);\r\n    bool ok = RunPage(page, dev, &fz_identity, &pagerect, false);\r\n    if (!ok)\r\n        return PageMediabox(pageNo);\r\n    if (fz_is_infinite_rect(&rect))\r\n        return PageMediabox(pageNo);\r\n\r\n    RectD rect2 = fz_rect_to_RectD(rect);\r\n    return rect2.Intersect(PageMediabox(pageNo));\r\n}\r\n\r\nPointD XpsEngineImpl::Transform(PointD pt, int pageNo, float zoom, int rotation, bool inverse)\r\n{\r\n    fz_matrix ctm = viewctm(pageNo, zoom, rotation);\r\n    if (inverse)\r\n        fz_invert_matrix(&ctm, &ctm);\r\n    fz_point pt2 = { (float)pt.x, (float)pt.y };\r\n    fz_transform_point(&pt2, &ctm);\r\n    return PointD(pt2.x, pt2.y);\r\n}\r\n\r\nRectD XpsEngineImpl::Transform(RectD rect, int pageNo, float zoom, int rotation, bool inverse)\r\n{\r\n    fz_matrix ctm = viewctm(pageNo, zoom, rotation);\r\n    if (inverse)\r\n        fz_invert_matrix(&ctm, &ctm);\r\n    fz_rect rect2 = fz_RectD_to_rect(rect);\r\n    fz_transform_rect(&rect2, &ctm);\r\n    return fz_rect_to_RectD(rect2);\r\n}\r\n\r\nRenderedBitmap *XpsEngineImpl::RenderBitmap(int pageNo, float zoom, int rotation, RectD *pageRect, RenderTarget target, AbortCookie **cookie_out)\r\n{\r\n    UNUSED(target);\r\n    xps_page* page = GetXpsPage(pageNo);\r\n    if (!page)\r\n        return nullptr;\r\n\r\n    fz_rect pRect;\r\n    if (pageRect)\r\n        pRect = fz_RectD_to_rect(*pageRect);\r\n    else\r\n        xps_bound_page(_doc, page, &pRect);\r\n    fz_matrix ctm = viewctm(page, zoom, rotation);\r\n    fz_rect r = pRect;\r\n    fz_irect bbox;\r\n    fz_round_rect(&bbox, fz_transform_rect(&r, &ctm));\r\n\r\n    fz_pixmap *image = nullptr;\r\n    EnterCriticalSection(&ctxAccess);\r\n    fz_try(ctx) {\r\n        fz_colorspace *colorspace = fz_device_rgb(ctx);\r\n        image = fz_new_pixmap_with_bbox(ctx, colorspace, &bbox);\r\n        fz_clear_pixmap_with_value(ctx, image, 0xFF); // initialize white background\r\n    }\r\n    fz_catch(ctx) {\r\n        LeaveCriticalSection(&ctxAccess);\r\n        return nullptr;\r\n    }\r\n\r\n    fz_device *dev = nullptr;\r\n    fz_try(ctx) {\r\n        dev = fz_new_draw_device(ctx, image);\r\n    }\r\n    fz_catch(ctx) {\r\n        fz_drop_pixmap(ctx, image);\r\n        LeaveCriticalSection(&ctxAccess);\r\n        return nullptr;\r\n    }\r\n    LeaveCriticalSection(&ctxAccess);\r\n\r\n    FitzAbortCookie *cookie = nullptr;\r\n    if (cookie_out)\r\n        *cookie_out = cookie = new FitzAbortCookie();\r\n    fz_rect cliprect;\r\n    bool ok = RunPage(page, dev, &ctm, fz_rect_from_irect(&cliprect, &bbox), true, cookie);\r\n\r\n    ScopedCritSec scope(&ctxAccess);\r\n\r\n    RenderedBitmap *bitmap = nullptr;\r\n    if (ok)\r\n        bitmap = new_rendered_fz_pixmap(ctx, image);\r\n    fz_drop_pixmap(ctx, image);\r\n    return bitmap;\r\n}\r\n\r\nWCHAR *XpsEngineImpl::ExtractPageText(xps_page *page, const WCHAR *lineSep, RectI **coordsOut, bool cacheRun)\r\n{\r\n    if (!page)\r\n        return nullptr;\r\n\r\n    fz_text_sheet *sheet = nullptr;\r\n    fz_text_page *text = nullptr;\r\n    fz_device *dev = nullptr;\r\n    fz_var(sheet);\r\n    fz_var(text);\r\n\r\n    EnterCriticalSection(&ctxAccess);\r\n    fz_try(ctx) {\r\n        sheet = fz_new_text_sheet(ctx);\r\n        text = fz_new_text_page(ctx);\r\n        dev = fz_new_text_device(ctx, sheet, text);\r\n    }\r\n    fz_catch(ctx) {\r\n        fz_free_text_page(ctx, text);\r\n        fz_free_text_sheet(ctx, sheet);\r\n        LeaveCriticalSection(&ctxAccess);\r\n        return nullptr;\r\n    }\r\n    LeaveCriticalSection(&ctxAccess);\r\n\r\n    if (!cacheRun)\r\n        fz_enable_device_hints(dev, FZ_NO_CACHE);\r\n\r\n    // use an infinite rectangle as bounds (instead of a mediabox) to ensure that\r\n    // the extracted text is consistent between cached runs using a list device and\r\n    // fresh runs (otherwise the list device omits text outside the mediabox bounds)\r\n    RunPage(page, dev, &fz_identity, nullptr, cacheRun);\r\n\r\n    ScopedCritSec scope(&ctxAccess);\r\n\r\n    WCHAR *content = fz_text_page_to_str(text, lineSep, coordsOut);\r\n    fz_free_text_page(ctx, text);\r\n    fz_free_text_sheet(ctx, sheet);\r\n\r\n    return content;\r\n}\r\n\r\nunsigned char *XpsEngineImpl::GetFileData(size_t *cbCount)\r\n{\r\n    unsigned char *data = nullptr;\r\n    ScopedCritSec scope(&ctxAccess);\r\n    fz_try(ctx) {\r\n        data = fz_extract_stream_data(_docStream, cbCount);\r\n    }\r\n    fz_catch(ctx) {\r\n        return _fileName ? (unsigned char *)file::ReadAll(_fileName, cbCount) : nullptr;\r\n    }\r\n    return data;\r\n}\r\n\r\nbool XpsEngineImpl::SaveFileAs(const WCHAR *copyFileName, bool includeUserAnnots)\r\n{\r\n    UNUSED(includeUserAnnots);\r\n    size_t dataLen;\r\n    ScopedMem<unsigned char> data(GetFileData(&dataLen));\r\n    if (data) {\r\n        bool ok = file::WriteAll(copyFileName, data.Get(), dataLen);\r\n        if (ok)\r\n            return true;\r\n    }\r\n    if (!_fileName)\r\n        return false;\r\n    return CopyFile(_fileName, copyFileName, FALSE);\r\n}\r\n\r\nWCHAR *XpsEngineImpl::ExtractFontList()\r\n{\r\n    // load and parse all pages\r\n    for (int i = 1; i <= PageCount(); i++)\r\n        GetXpsPage(i);\r\n\r\n    ScopedCritSec scope(&ctxAccess);\r\n\r\n    // collect a list of all included fonts\r\n    WStrVec fonts;\r\n    for (xps_font_cache *font = _doc->font_table; font; font = font->next) {\r\n        ScopedMem<WCHAR> path(str::conv::FromUtf8(font->name));\r\n        ScopedMem<WCHAR> name(str::conv::FromUtf8(font->font->name));\r\n        fonts.Append(str::Format(L\"%s (%s)\", name.Get(), path::GetBaseName(path)));\r\n    }\r\n    if (fonts.Count() == 0)\r\n        return nullptr;\r\n\r\n    fonts.SortNatural();\r\n    return fonts.Join(L\"\\n\");\r\n}\r\n\r\nWCHAR *XpsEngineImpl::GetProperty(DocumentProperty prop)\r\n{\r\n    if (Prop_FontList == prop)\r\n        return ExtractFontList();\r\n    if (!_info)\r\n        return nullptr;\r\n\r\n    switch (prop) {\r\n    case Prop_Title: return str::Dup(_info->title);\r\n    case Prop_Author: return str::Dup(_info->author);\r\n    case Prop_Subject: return str::Dup(_info->subject);\r\n    case Prop_CreationDate: return str::Dup(_info->creation_date);\r\n    case Prop_ModificationDate: return str::Dup(_info->modification_date);\r\n    default: return nullptr;\r\n    }\r\n};\r\n\r\nbool XpsEngineImpl::SupportsAnnotation(bool forSaving) const\r\n{\r\n    return !forSaving; // for now\r\n}\r\n\r\nvoid XpsEngineImpl::UpdateUserAnnotations(Vec<PageAnnotation> *list)\r\n{\r\n    // TODO: use a new critical section to avoid blocking the UI thread\r\n    ScopedCritSec scope(&ctxAccess);\r\n    if (list)\r\n        userAnnots = *list;\r\n    else\r\n        userAnnots.Reset();\r\n}\r\n\r\nPageElement *XpsEngineImpl::GetElementAtPos(int pageNo, PointD pt)\r\n{\r\n    xps_page *page = GetXpsPage(pageNo, true);\r\n    if (!page)\r\n        return nullptr;\r\n\r\n    fz_point p = { (float)pt.x, (float)pt.y };\r\n    for (fz_link *link = page->links; link; link = link->next)\r\n        if (fz_is_pt_in_rect(link->rect, p))\r\n            return new XpsLink(this, &link->dest, link->rect, pageNo);\r\n\r\n    if (imageRects[pageNo-1]) {\r\n        for (int i = 0; !fz_is_empty_rect(&imageRects[pageNo-1][i]); i++)\r\n            if (fz_is_pt_in_rect(imageRects[pageNo-1][i], p))\r\n                return new XpsImage(this, pageNo, imageRects[pageNo-1][i], i);\r\n    }\r\n\r\n    return nullptr;\r\n}\r\n\r\nVec<PageElement *> *XpsEngineImpl::GetElements(int pageNo)\r\n{\r\n    xps_page *page = GetXpsPage(pageNo, true);\r\n    if (!page)\r\n        return nullptr;\r\n\r\n    // since all elements lists are in last-to-first order, append\r\n    // item types in inverse order and reverse the whole list at the end\r\n    Vec<PageElement *> *els = new Vec<PageElement *>();\r\n    if (!els)\r\n        return nullptr;\r\n\r\n    if (imageRects[pageNo-1]) {\r\n        for (int i = 0; !fz_is_empty_rect(&imageRects[pageNo-1][i]); i++) {\r\n            els->Append(new XpsImage(this, pageNo, imageRects[pageNo-1][i], i));\r\n        }\r\n    }\r\n\r\n    for (fz_link *link = page->links; link; link = link->next) {\r\n        els->Append(new XpsLink(this, &link->dest, link->rect, pageNo));\r\n    }\r\n\r\n    els->Reverse();\r\n    return els;\r\n}\r\n\r\nvoid XpsEngineImpl::LinkifyPageText(xps_page *page, int pageNo)\r\n{\r\n    UNUSED(pageNo);\r\n    // make MuXPS extract all links and named destinations from the page\r\n    assert(!GetPageRun(page, true));\r\n    XpsPageRun *run = GetPageRun(page);\r\n    assert(!run == !page->links_resolved);\r\n    if (run)\r\n        DropPageRun(run);\r\n    else\r\n        page->links_resolved = 1;\r\n    assert(!page->links || page->links->refs == 1);\r\n\r\n    RectI *coords;\r\n    ScopedMem<WCHAR> pageText(ExtractPageText(page, L\"\\n\", &coords, true));\r\n    if (!pageText)\r\n        return;\r\n\r\n    LinkRectList *list = LinkifyText(pageText, coords);\r\n    for (size_t i = 0; i < list->links.Count(); i++) {\r\n        bool overlaps = false;\r\n        for (fz_link *next = page->links; next && !overlaps; next = next->next)\r\n            overlaps = fz_calc_overlap(list->coords.At(i), next->rect) >= 0.25f;\r\n        if (!overlaps) {\r\n            ScopedMem<char> uri(str::conv::ToUtf8(list->links.At(i)));\r\n            if (!uri) continue;\r\n            fz_link_dest ld = { FZ_LINK_URI, 0 };\r\n            ld.ld.uri.uri = fz_strdup(ctx, uri);\r\n            // add links in top-to-bottom order (i.e. last-to-first)\r\n            fz_link *link = fz_new_link(ctx, &list->coords.At(i), ld);\r\n            CrashIf(!link); // TODO: if fz_new_link throws, there are memory leaks\r\n            link->next = page->links;\r\n            page->links = link;\r\n        }\r\n    }\r\n\r\n    delete list;\r\n    free(coords);\r\n}\r\n\r\nRenderedBitmap *XpsEngineImpl::GetPageImage(int pageNo, RectD rect, size_t imageIx)\r\n{\r\n    xps_page *page = GetXpsPage(pageNo);\r\n    if (!page)\r\n        return nullptr;\r\n\r\n    Vec<FitzImagePos> positions;\r\n    ListInspectionData data(positions);\r\n    fz_device *dev = nullptr;\r\n\r\n    EnterCriticalSection(&ctxAccess);\r\n    fz_try(ctx) {\r\n        dev = fz_new_inspection_device(ctx, &data);\r\n    }\r\n    fz_catch(ctx) {\r\n        LeaveCriticalSection(&ctxAccess);\r\n        return nullptr;\r\n    }\r\n    LeaveCriticalSection(&ctxAccess);\r\n\r\n    RunPage(page, dev, &fz_identity);\r\n\r\n    if (imageIx >= positions.Count() || fz_rect_to_RectD(positions.At(imageIx).rect) != rect) {\r\n        assert(0);\r\n        return nullptr;\r\n    }\r\n\r\n    ScopedCritSec scope(&ctxAccess);\r\n\r\n    fz_pixmap *pixmap = nullptr;\r\n    fz_try(ctx) {\r\n        fz_image *image = positions.At(imageIx).image;\r\n        pixmap = fz_new_pixmap_from_image(ctx, image, image->w, image->h);\r\n    }\r\n    fz_catch(ctx) {\r\n        return nullptr;\r\n    }\r\n    RenderedBitmap *bmp = new_rendered_fz_pixmap(ctx, pixmap);\r\n    fz_drop_pixmap(ctx, pixmap);\r\n\r\n    return bmp;\r\n}\r\n\r\nfz_rect XpsEngineImpl::FindDestRect(const char *target)\r\n{\r\n    if (str::IsEmpty(target))\r\n        return fz_empty_rect;\r\n\r\n    xps_target *found = xps_lookup_link_target_obj(_doc, (char *)target);\r\n    if (!found)\r\n        return fz_empty_rect;\r\n    if (fz_is_empty_rect(&found->rect)) {\r\n        // ensure that the target rectangle could have been\r\n        // updated through LinkifyPageText -> xps_extract_anchor_info\r\n        GetXpsPage(found->page + 1);\r\n    }\r\n    return found->rect;\r\n}\r\n\r\nPageDestination *XpsEngineImpl::GetNamedDest(const WCHAR *name)\r\n{\r\n    ScopedMem<char> name_utf8(str::conv::ToUtf8(name));\r\n    if (!str::StartsWith(name_utf8.Get(), \"#\"))\r\n        name_utf8.Set(str::Join(\"#\", name_utf8));\r\n\r\n    for (xps_target *dest = _doc->target; dest; dest = dest->next)\r\n        if (str::EndsWithI(dest->name, name_utf8))\r\n            return new SimpleDest(dest->page + 1, fz_rect_to_RectD(dest->rect));\r\n\r\n    return nullptr;\r\n}\r\n\r\nXpsTocItem *XpsEngineImpl::BuildTocTree(fz_outline *entry, int& idCounter)\r\n{\r\n    XpsTocItem *node = nullptr;\r\n\r\n    for (; entry; entry = entry->next) {\r\n        WCHAR *name = entry->title ? str::conv::FromUtf8(entry->title) : str::Dup(L\"\");\r\n        XpsTocItem *item = new XpsTocItem(name, XpsLink(this, &entry->dest));\r\n        item->id = ++idCounter;\r\n        item->open = entry->is_open;\r\n\r\n        if (FZ_LINK_GOTO == entry->dest.kind)\r\n            item->pageNo = entry->dest.ld.gotor.page + 1;\r\n        if (entry->down)\r\n            item->child = BuildTocTree(entry->down, idCounter);\r\n\r\n        if (!node)\r\n            node = item;\r\n        else\r\n            node->AddSibling(item);\r\n    }\r\n\r\n    return node;\r\n}\r\n\r\nDocTocItem *XpsEngineImpl::GetTocTree()\r\n{\r\n    if (!HasTocTree())\r\n        return nullptr;\r\n\r\n    int idCounter = 0;\r\n    return BuildTocTree(_outline, idCounter);\r\n}\r\n\r\nbool XpsEngineImpl::HasClipOptimizations(int pageNo)\r\n{\r\n    xps_page *page = GetXpsPage(pageNo, true);\r\n    // GetXpsPage extracts imageRects for us\r\n    if (!page || !imageRects[pageNo-1])\r\n        return true;\r\n\r\n    fz_rect mbox = fz_RectD_to_rect(PageMediabox(pageNo));\r\n    // check if any image covers at least 90% of the page\r\n    for (int i = 0; !fz_is_empty_rect(&imageRects[pageNo-1][i]); i++)\r\n        if (fz_calc_overlap(mbox, imageRects[pageNo-1][i]) >= 0.9f)\r\n            return false;\r\n    return true;\r\n}\r\n\r\nBaseEngine *XpsEngineImpl::CreateFromFile(const WCHAR *fileName)\r\n{\r\n    XpsEngineImpl *engine = new XpsEngineImpl();\r\n    if (!engine || !fileName || !engine->Load(fileName)) {\r\n        delete engine;\r\n        return nullptr;\r\n    }\r\n    return engine;\r\n}\r\n\r\nBaseEngine *XpsEngineImpl::CreateFromStream(IStream *stream)\r\n{\r\n    XpsEngineImpl *engine = new XpsEngineImpl();\r\n    if (!engine->Load(stream)) {\r\n        delete engine;\r\n        return nullptr;\r\n    }\r\n    return engine;\r\n}\r\n\r\nnamespace XpsEngine {\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff)\r\n{\r\n    if (sniff) {\r\n        if (dir::Exists(fileName)) {\r\n            // allow opening uncompressed XPS files as well\r\n            ScopedMem<WCHAR> relsPath(path::Join(fileName, L\"_rels\\\\.rels\"));\r\n            return file::Exists(relsPath) || dir::Exists(relsPath);\r\n        }\r\n        ZipFile zip(fileName, true);\r\n        return zip.GetFileIndex(L\"_rels/.rels\") != (size_t)-1 ||\r\n               zip.GetFileIndex(L\"_rels/.rels/[0].piece\") != (size_t)-1 ||\r\n               zip.GetFileIndex(L\"_rels/.rels/[0].last.piece\") != (size_t)-1;\r\n    }\r\n\r\n    return str::EndsWithI(fileName, L\".xps\") || str::EndsWithI(fileName, L\".oxps\");\r\n}\r\n\r\nBaseEngine *CreateFromFile(const WCHAR *fileName)\r\n{\r\n    return XpsEngineImpl::CreateFromFile(fileName);\r\n}\r\n\r\nBaseEngine *CreateFromStream(IStream *stream)\r\n{\r\n    return XpsEngineImpl::CreateFromStream(stream);\r\n}\r\n\r\n}\r\n"
  },
  {
    "path": "src/PdfEngine.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: GPLv3 */\n\nnamespace PdfEngine {\n\nbool IsSupportedFile(const WCHAR *fileName, bool sniff=false);\nBaseEngine *CreateFromFile(const WCHAR *fileName, PasswordUI *pwdUI=nullptr);\nBaseEngine *CreateFromStream(IStream *stream, PasswordUI *pwdUI=nullptr);\n\n}\n\nnamespace XpsEngine {\n\nbool IsSupportedFile(const WCHAR *fileName, bool sniff=false);\nBaseEngine *CreateFromFile(const WCHAR *fileName);\nBaseEngine *CreateFromStream(IStream *stream);\n\n}\n"
  },
  {
    "path": "src/PdfSync.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: GPLv3 */\n\n// utils\n#include \"BaseUtil.h\"\n#include <synctex_parser.h>\n#include \"FileUtil.h\"\n// layout controllers\n#include \"BaseEngine.h\"\n#include \"PdfSync.h\"\n\n// size of the mark highlighting the location calculated by forward-search\n#define MARK_SIZE               10\n// maximum error in the source file line number when doing forward-search\n#define EPSILON_LINE            5\n// Minimal error distance^2 between a point clicked by the user and a PDF mark\n#define PDFSYNC_EPSILON_SQUARE  800\n// Minimal vertical distance\n#define PDFSYNC_EPSILON_Y       20\n\n#define PDFSYNC_EXTENSION       L\".pdfsync\"\n\n#define SYNCTEX_EXTENSION       L\".synctex\"\n#define SYNCTEXGZ_EXTENSION     L\".synctex.gz\"\n\nstruct PdfsyncFileIndex {\n    size_t start, end; // first and one-after-last index of lines associated with a file\n};\n\nstruct PdfsyncLine {\n    UINT record; // index for mapping line(s) to point(s)\n    size_t file; // index into srcfiles\n    UINT line, column;\n};\n\nstruct PdfsyncPoint {\n    UINT record; // index for mapping point(s) to line(s)\n    UINT page, x, y;\n};\n\n// Synchronizer based on .pdfsync file generated with the pdfsync tex package\nclass Pdfsync : public Synchronizer\n{\npublic:\n    Pdfsync(const WCHAR* syncfilename, BaseEngine *engine) :\n        Synchronizer(syncfilename), engine(engine)\n    {\n        assert(str::EndsWithI(syncfilename, PDFSYNC_EXTENSION));\n    }\n\n    virtual int DocToSource(UINT pageNo, PointI pt, ScopedMem<WCHAR>& filename, UINT *line, UINT *col);\n    virtual int SourceToDoc(const WCHAR* srcfilename, UINT line, UINT col, UINT *page, Vec<RectI>& rects);\n\nprivate:\n    int RebuildIndex();\n    UINT SourceToRecord(const WCHAR* srcfilename, UINT line, UINT col, Vec<size_t>& records);\n\n    BaseEngine *engine;         // needed for converting between coordinate systems\n    WStrVec srcfiles;           // source file names\n    Vec<PdfsyncLine> lines;     // record-to-line mapping\n    Vec<PdfsyncPoint> points;   // record-to-point mapping\n    Vec<PdfsyncFileIndex> fileIndex; // start and end of entries for a file in <lines>\n    Vec<size_t> sheetIndex;     // start of entries for a sheet in <points>\n};\n\n// Synchronizer based on .synctex file generated with SyncTex\nclass SyncTex : public Synchronizer\n{\npublic:\n    SyncTex(const WCHAR* syncfilename, BaseEngine *engine) :\n        Synchronizer(syncfilename), engine(engine), scanner(nullptr)\n    {\n        assert(str::EndsWithI(syncfilename, SYNCTEX_EXTENSION));\n    }\n    virtual ~SyncTex()\n    {\n        synctex_scanner_free(scanner);\n    }\n\n    virtual int DocToSource(UINT pageNo, PointI pt, ScopedMem<WCHAR>& filename, UINT *line, UINT *col);\n    virtual int SourceToDoc(const WCHAR* srcfilename, UINT line, UINT col, UINT *page, Vec<RectI> &rects);\n\nprivate:\n    int RebuildIndex();\n\n    BaseEngine *engine; // needed for converting between coordinate systems\n    synctex_scanner_t scanner;\n};\n\nSynchronizer::Synchronizer(const WCHAR* syncfilepath) :\n    indexDiscarded(true), syncfilepath(str::Dup(syncfilepath))\n{\n    _wstat(syncfilepath, &syncfileTimestamp);\n}\n\nbool Synchronizer::IsIndexDiscarded() const\n{\n    // was the index manually discarded?\n    if (indexDiscarded)\n        return true;\n\n    // has the synchronization file been changed on disk?\n    struct _stat newstamp;\n    if (_wstat(syncfilepath, &newstamp) == 0 &&\n        difftime(newstamp.st_mtime, syncfileTimestamp.st_mtime) > 0) {\n        // update time stamp\n        memcpy((void *)&syncfileTimestamp, &newstamp, sizeof(syncfileTimestamp));\n        return true; // the file has changed!\n    }\n\n    return false;\n}\n\nint Synchronizer::RebuildIndex()\n{\n    indexDiscarded = false;\n    // save sync file timestamp\n    _wstat(syncfilepath, &syncfileTimestamp);\n    return PDFSYNCERR_SUCCESS;\n}\n\nWCHAR * Synchronizer::PrependDir(const WCHAR* filename) const\n{\n    ScopedMem<WCHAR> dir(path::GetDir(syncfilepath));\n    return path::Join(dir, filename);\n}\n\n// Create a Synchronizer object for a PDF file.\n// It creates either a SyncTex or PdfSync object\n// based on the synchronization file found in the folder containing the PDF file.\nint Synchronizer::Create(const WCHAR *pdffilename, BaseEngine *engine, Synchronizer **sync)\n{\n    if (!sync || !engine)\n        return PDFSYNCERR_INVALID_ARGUMENT;\n\n    const WCHAR *fileExt = path::GetExt(pdffilename);\n    if (!str::EqI(fileExt, L\".pdf\"))\n        return PDFSYNCERR_INVALID_ARGUMENT;\n\n    ScopedMem<WCHAR> baseName(str::DupN(pdffilename, fileExt - pdffilename));\n\n    // Check if a PDFSYNC file is present\n    ScopedMem<WCHAR> syncFile(str::Join(baseName, PDFSYNC_EXTENSION));\n    if (file::Exists(syncFile)) {\n        *sync = new Pdfsync(syncFile, engine);\n        return *sync ? PDFSYNCERR_SUCCESS : PDFSYNCERR_OUTOFMEMORY;\n    }\n\n    // check if SYNCTEX or compressed SYNCTEX file is present\n    ScopedMem<WCHAR> texGzFile(str::Join(baseName, SYNCTEXGZ_EXTENSION));\n    ScopedMem<WCHAR> texFile(str::Join(baseName, SYNCTEX_EXTENSION));\n\n    if (file::Exists(texGzFile) || file::Exists(texFile)) {\n        // due to a bug with synctex_parser.c, this must always be\n        // the path to the .synctex file (even if a .synctex.gz file is used instead)\n        *sync = new SyncTex(texFile, engine);\n        return *sync ? PDFSYNCERR_SUCCESS : PDFSYNCERR_OUTOFMEMORY;\n    }\n\n    return PDFSYNCERR_SYNCFILE_NOTFOUND;\n}\n\n// Replace in 'pattern' the macros %f %l %c by 'filename', 'line' and 'col'\n// the caller must free() the result\nWCHAR * Synchronizer::PrepareCommandline(const WCHAR* pattern, const WCHAR* filename, UINT line, UINT col)\n{\n    const WCHAR* perc;\n    str::Str<WCHAR> cmdline(256);\n\n    while ((perc = str::FindChar(pattern, '%')) != nullptr) {\n        cmdline.Append(pattern, perc - pattern);\n        pattern = perc + 2;\n        perc++;\n\n        if (*perc == 'f')\n            cmdline.AppendAndFree(path::Normalize(filename));\n        else if (*perc == 'l')\n            cmdline.AppendFmt(L\"%u\", line);\n        else if (*perc == 'c')\n            cmdline.AppendFmt(L\"%u\", col);\n        else if (*perc == '%')\n            cmdline.Append('%');\n        else\n            cmdline.Append(perc - 1, 2);\n    }\n    cmdline.Append(pattern);\n\n    return cmdline.StealData();\n}\n\n// PDFSYNC synchronizer\n\n// move to the next line in a list of zero-terminated lines\nstatic char *Advance0Line(char *line, char *end)\n{\n    line += str::Len(line);\n    // skip all zeroes until the next non-empty line\n    for (; line < end && !*line; line++);\n    return line < end ? line : nullptr;\n}\n\n// see http://itexmac.sourceforge.net/pdfsync.html for the specification\nint Pdfsync::RebuildIndex()\n{\n    size_t len;\n    ScopedMem<char> data(file::ReadAll(syncfilepath, &len));\n    if (!data)\n        return PDFSYNCERR_SYNCFILE_CANNOT_BE_OPENED;\n    // convert the file data into a list of zero-terminated strings\n    str::TransChars(data, \"\\r\\n\", \"\\0\\0\");\n\n    // parse preamble (jobname and version marker)\n    char *line = data;\n    char *dataEnd = data + len;\n\n    // replace star by spaces (TeX uses stars instead of spaces in filenames)\n    str::TransChars(line, \"*/\", \" \\\\\");\n    ScopedMem<WCHAR> jobName(str::conv::FromAnsi(line));\n    jobName.Set(str::Join(jobName, L\".tex\"));\n    jobName.Set(PrependDir(jobName));\n\n    line = Advance0Line(line, dataEnd);\n    UINT versionNumber = 0;\n    if (!line || !str::Parse(line, \"version %u\", &versionNumber) || versionNumber != 1)\n        return PDFSYNCERR_SYNCFILE_CANNOT_BE_OPENED;\n\n    // reset synchronizer database\n    srcfiles.Reset();\n    lines.Reset();\n    points.Reset();\n    fileIndex.Reset();\n    sheetIndex.Reset();\n\n    Vec<size_t> filestack;\n    UINT page = 1;\n    sheetIndex.Append(0);\n\n    // add the initial tex file to the source file stack\n    filestack.Push(srcfiles.Count());\n    srcfiles.Append(jobName.StealData());\n    PdfsyncFileIndex findex = { 0 };\n    fileIndex.Append(findex);\n\n    PdfsyncLine psline;\n    PdfsyncPoint pspoint;\n\n    // parse data\n    UINT maxPageNo = engine->PageCount();\n    while ((line = Advance0Line(line, dataEnd)) != nullptr) {\n        if (!line)\n            break;\n        switch (*line) {\n        case 'l':\n            psline.file = filestack.Last();\n            if (str::Parse(line, \"l %u %u %u\", &psline.record, &psline.line, &psline.column))\n                lines.Append(psline);\n            else if (str::Parse(line, \"l %u %u\", &psline.record, &psline.line)) {\n                psline.column = 0;\n                lines.Append(psline);\n            }\n            // else dbg(\"Bad 'l' line in the pdfsync file\");\n            break;\n\n        case 's':\n            if (str::Parse(line, \"s %u\", &page))\n                sheetIndex.Append(points.Count());\n            // else dbg(\"Bad 's' line in the pdfsync file\");\n            // if (0 == page || page > maxPageNo)\n            //     dbg(\"'s' line with invalid page number in the pdfsync file\");\n            break;\n\n        case 'p':\n            pspoint.page = page;\n            if (0 == page || page > maxPageNo)\n                /* ignore point for invalid page number */;\n            else if (str::Parse(line, \"p %u %u %u\", &pspoint.record, &pspoint.x, &pspoint.y))\n                points.Append(pspoint);\n            else if (str::Parse(line, \"p* %u %u %u\", &pspoint.record, &pspoint.x, &pspoint.y))\n                points.Append(pspoint);\n            // else dbg(\"Bad 'p' line in the pdfsync file\");\n            break;\n\n        case '(':\n            {\n                ScopedMem<WCHAR> filename(str::conv::FromAnsi(line + 1));\n                // if the filename contains quotes then remove them\n                // TODO: this should never happen!?\n                if (filename[0] == '\"' && filename[str::Len(filename) - 1] == '\"')\n                    filename.Set(str::DupN(filename + 1, str::Len(filename) - 2));\n                // undecorate the filepath: replace * by space and / by \\ (backslash)\n                str::TransChars(filename, L\"*/\", L\" \\\\\");\n                // if the file name extension is not specified then add the suffix '.tex'\n                if (str::IsEmpty(path::GetExt(filename)))\n                    filename.Set(str::Join(filename, L\".tex\"));\n                // ensure that the path is absolute\n                if (PathIsRelative(filename))\n                    filename.Set(PrependDir(filename));\n\n                filestack.Push(srcfiles.Count());\n                srcfiles.Append(filename.StealData());\n                findex.start = findex.end = lines.Count();\n                fileIndex.Append(findex);\n            }\n            break;\n\n        case ')':\n            if (filestack.Count() > 1)\n                fileIndex.At(filestack.Pop()).end = lines.Count();\n            // else dbg(\"Unbalanced ')' line in the pdfsync file\");\n            break;\n\n        default:\n            // dbg(\"Ignoring invalid pdfsync line starting with '%c'\", *line);\n            break;\n        }\n    }\n\n    fileIndex.At(0).end = lines.Count();\n    assert(filestack.Count() == 1);\n\n    return Synchronizer::RebuildIndex();\n}\n\n// convert a coordinate from the sync file into a PDF coordinate\n#define SYNC_TO_PDF_COORDINATE(c)  (c/65781.76)\n\nstatic int cmpLineRecords(const void *a, const void *b)\n{\n    return ((PdfsyncLine *)a)->record - ((PdfsyncLine *)b)->record;\n}\n\nint Pdfsync::DocToSource(UINT pageNo, PointI pt, ScopedMem<WCHAR>& filename, UINT *line, UINT *col)\n{\n    if (IsIndexDiscarded())\n        if (RebuildIndex() != PDFSYNCERR_SUCCESS)\n            return PDFSYNCERR_SYNCFILE_CANNOT_BE_OPENED;\n\n    // find the entry in the index corresponding to this page\n    if (pageNo <= 0 || pageNo >= sheetIndex.Count() || pageNo > (UINT)engine->PageCount())\n        return PDFSYNCERR_INVALID_PAGE_NUMBER;\n\n    // PdfSync coordinates are y-inversed\n    RectI mbox = engine->PageMediabox(pageNo).Round();\n    pt.y = mbox.dy - pt.y;\n\n    // distance to the closest pdf location (in the range <PDFSYNC_EPSILON_SQUARE)\n    UINT closest_xydist = UINT_MAX;\n    UINT selected_record = UINT_MAX;\n    // If no record is found within a distance^2 of PDFSYNC_EPSILON_SQUARE\n    // (selected_record == -1) then we pick up the record that is closest\n    // vertically to the hit-point.\n    UINT closest_ydist = UINT_MAX; // vertical distance between the hit point and the vertically-closest record\n    UINT closest_xdist = UINT_MAX; // horizontal distance between the hit point and the vertically-closest record\n    UINT closest_ydist_record = UINT_MAX; // vertically-closest record\n\n    // read all the sections of 'p' declarations for this pdf sheet\n    for (size_t i = sheetIndex.At(pageNo); i < points.Count() && points.At(i).page == pageNo; i++) {\n        // check whether it is closer than the closest point found so far\n        UINT dx = abs(pt.x - (int)SYNC_TO_PDF_COORDINATE(points.At(i).x));\n        UINT dy = abs(pt.y - (int)SYNC_TO_PDF_COORDINATE(points.At(i).y));\n        UINT dist = dx * dx + dy * dy;\n        if (dist < PDFSYNC_EPSILON_SQUARE && dist < closest_xydist) {\n            selected_record = points.At(i).record;\n            closest_xydist = dist;\n        }\n        else if ((closest_xydist == UINT_MAX) && dy < PDFSYNC_EPSILON_Y &&\n                 (dy < closest_ydist || (dy == closest_ydist && dx < closest_xdist))) {\n            closest_ydist_record = points.At(i).record;\n            closest_ydist = dy;\n            closest_xdist = dx;\n        }\n    }\n\n    if (selected_record == UINT_MAX)\n        selected_record = closest_ydist_record;\n    if (selected_record == UINT_MAX)\n        return PDFSYNCERR_NO_SYNC_AT_LOCATION; // no record was found close enough to the hit point\n\n    // We have a record number, we need to find its declaration ('l ...') in the syncfile\n    PdfsyncLine cmp; cmp.record = selected_record;\n    PdfsyncLine *found = (PdfsyncLine *)bsearch(&cmp, lines.LendData(), lines.Count(), sizeof(PdfsyncLine), cmpLineRecords);\n    assert(found);\n    if (!found)\n        return PDFSYNCERR_NO_SYNC_AT_LOCATION;\n\n    filename.Set(str::Dup(srcfiles.At(found->file)));\n    *line = found->line;\n    *col = found->column;\n\n    return PDFSYNCERR_SUCCESS;\n}\n\n// Find a record corresponding to the given source file, line number and optionally column number.\n// (at the moment the column parameter is ignored)\n//\n// If there are several *consecutively declared* records for the same line then they are all returned.\n// The list of records is added to the vector 'records'\n//\n// If there is no record for that line, the record corresponding to the nearest line is selected\n// (within a range of EPSILON_LINE)\n//\n// The function returns PDFSYNCERR_SUCCESS if a matching record was found.\nUINT Pdfsync::SourceToRecord(const WCHAR* srcfilename, UINT line, UINT col, Vec<size_t> &records)\n{\n    UNUSED(col);\n    if (!srcfilename)\n        return PDFSYNCERR_INVALID_ARGUMENT;\n\n    ScopedMem<WCHAR> srcfilepath;\n    // convert the source file to an absolute path\n    if (PathIsRelative(srcfilename))\n        srcfilepath.Set(PrependDir(srcfilename));\n    else\n        srcfilepath.Set(str::Dup(srcfilename));\n    if (!srcfilepath)\n        return PDFSYNCERR_OUTOFMEMORY;\n\n    // find the source file entry\n    size_t isrc;\n    for (isrc = 0; isrc < srcfiles.Count(); isrc++)\n        if (path::IsSame(srcfilepath, srcfiles.At(isrc)))\n            break;\n    if (isrc == srcfiles.Count())\n        return PDFSYNCERR_UNKNOWN_SOURCEFILE;\n\n    if (fileIndex.At(isrc).start == fileIndex.At(isrc).end)\n        return PDFSYNCERR_NORECORD_IN_SOURCEFILE; // there is not any record declaration for that particular source file\n\n    // look for sections belonging to the specified file\n    // starting with the first section that is declared within the scope of the file.\n    UINT min_distance = EPSILON_LINE; // distance to the closest record\n    size_t lineIx = (size_t)-1; // closest record-line index\n\n    for (size_t isec = fileIndex.At(isrc).start; isec < fileIndex.At(isrc).end; isec++) {\n        // does this section belong to the desired file?\n        if (lines.At(isec).file != isrc)\n            continue;\n\n        UINT d = abs((int)lines.At(isec).line - (int)line);\n        if (d < min_distance) {\n            min_distance = d;\n            lineIx = isec;\n            if (0 == d)\n                break; // We have found a record for the requested line!\n        }\n    }\n    if (lineIx == (size_t)-1)\n        return PDFSYNCERR_NORECORD_FOR_THATLINE;\n\n    // we read all the consecutive records until we reach a record belonging to another line\n    for (size_t i = lineIx; i < lines.Count() && lines.At(i).line == lines.At(lineIx).line; i++)\n        records.Push(lines.At(i).record);\n\n    return PDFSYNCERR_SUCCESS;\n}\n\nint Pdfsync::SourceToDoc(const WCHAR* srcfilename, UINT line, UINT col, UINT *page, Vec<RectI> &rects)\n{\n    if (IsIndexDiscarded())\n        if (RebuildIndex() != PDFSYNCERR_SUCCESS)\n            return PDFSYNCERR_SYNCFILE_CANNOT_BE_OPENED;\n\n    Vec<size_t> found_records;\n    UINT ret = SourceToRecord(srcfilename, line, col, found_records);\n    if (ret != PDFSYNCERR_SUCCESS || found_records.Count() == 0)\n        return ret;\n\n    rects.Reset();\n\n    // records have been found for the desired source position:\n    // we now find the page and positions in the PDF corresponding to these found records\n    UINT firstPage = UINT_MAX;\n    for (size_t i = 0; i < points.Count(); i++) {\n        if (!found_records.Contains(points.At(i).record))\n            continue;\n        if (firstPage != UINT_MAX && firstPage != points.At(i).page)\n            continue;\n        firstPage = *page = points.At(i).page;\n        RectD rc(SYNC_TO_PDF_COORDINATE(points.At(i).x),\n                 SYNC_TO_PDF_COORDINATE(points.At(i).y),\n                 MARK_SIZE, MARK_SIZE);\n        // PdfSync coordinates are y-inversed\n        RectD mbox = engine->PageMediabox(firstPage);\n        rc.y = mbox.dy - (rc.y + rc.dy);\n        rects.Push(rc.Round());\n    }\n\n    if (rects.Count() > 0)\n        return PDFSYNCERR_SUCCESS;\n    // the record does not correspond to any point in the PDF: this is possible...\n    return PDFSYNCERR_NOSYNCPOINT_FOR_LINERECORD;\n}\n\n// SYNCTEX synchronizer\n\nint SyncTex::RebuildIndex() {\n    synctex_scanner_free(scanner);\n    scanner = nullptr;\n\n    ScopedMem<char> syncfname(str::conv::ToAnsi(syncfilepath));\n    if (!syncfname)\n        return PDFSYNCERR_OUTOFMEMORY;\n\n    scanner = synctex_scanner_new_with_output_file(syncfname, nullptr, 1);\n    if (!scanner)\n        return PDFSYNCERR_SYNCFILE_NOTFOUND; // cannot rebuild the index\n\n    return Synchronizer::RebuildIndex();\n}\n\nint SyncTex::DocToSource(UINT pageNo, PointI pt, ScopedMem<WCHAR>& filename, UINT *line, UINT *col)\n{\n    if (IsIndexDiscarded()) {\n        if (RebuildIndex() != PDFSYNCERR_SUCCESS)\n            return PDFSYNCERR_SYNCFILE_CANNOT_BE_OPENED;\n    }\n    CrashIf(!this->scanner);\n\n    // Coverity: at this point, this->scanner->flags.has_parsed == 1 and thus\n    // synctex_scanner_parse never gets the chance to freeing the scanner\n    if (synctex_edit_query(this->scanner, pageNo, (float)pt.x, (float)pt.y) <= 0)\n        return PDFSYNCERR_NO_SYNC_AT_LOCATION;\n\n    synctex_node_t node = synctex_next_result(this->scanner);\n    if (!node)\n        return PDFSYNCERR_NO_SYNC_AT_LOCATION;\n\n    const char *name = synctex_scanner_get_name(this->scanner, synctex_node_tag(node));\n    if (!name)\n        return PDFSYNCERR_UNKNOWN_SOURCEFILE;\n\n    bool isUtf8 = true;\n    filename.Set(str::conv::FromUtf8(name));\nTryAgainAnsi:\n    if (!filename)\n        return PDFSYNCERR_OUTOFMEMORY;\n\n    // undecorate the filepath: replace * by space and / by \\ (backslash)\n    str::TransChars(filename, L\"*/\", L\" \\\\\");\n    // Convert the source filepath to an absolute path\n    if (PathIsRelative(filename))\n        filename.Set(PrependDir(filename));\n\n    // recent SyncTeX versions encode in UTF-8 instead of ANSI\n    if (isUtf8 && !file::Exists(filename)) {\n        isUtf8 = false;\n        filename.Set(str::conv::FromAnsi(name));\n        goto TryAgainAnsi;\n    }\n\n    *line = synctex_node_line(node);\n    *col = synctex_node_column(node);\n\n    return PDFSYNCERR_SUCCESS;\n}\n\nint SyncTex::SourceToDoc(const WCHAR* srcfilename, UINT line, UINT col, UINT *page, Vec<RectI> &rects)\n{\n    if (IsIndexDiscarded())\n        if (RebuildIndex() != PDFSYNCERR_SUCCESS)\n            return PDFSYNCERR_SYNCFILE_CANNOT_BE_OPENED;\n    assert(this->scanner);\n\n    ScopedMem<WCHAR> srcfilepath;\n    // convert the source file to an absolute path\n    if (PathIsRelative(srcfilename))\n        srcfilepath.Set(PrependDir(srcfilename));\n    else\n        srcfilepath.Set(str::Dup(srcfilename));\n    if (!srcfilepath)\n        return PDFSYNCERR_OUTOFMEMORY;\n\n    bool isUtf8 = true;\n    char *mb_srcfilepath = str::conv::ToUtf8(srcfilepath);\nTryAgainAnsi:\n    if (!mb_srcfilepath)\n        return PDFSYNCERR_OUTOFMEMORY;\n    int ret = synctex_display_query(this->scanner, mb_srcfilepath, line, col);\n    free(mb_srcfilepath);\n    // recent SyncTeX versions encode in UTF-8 instead of ANSI\n    if (isUtf8 && -1 == ret) {\n        isUtf8 = false;\n        mb_srcfilepath = str::conv::ToAnsi(srcfilepath);\n        goto TryAgainAnsi;\n    }\n\n    if (-1 == ret)\n        return PDFSYNCERR_UNKNOWN_SOURCEFILE;\n    if (0 == ret)\n        return PDFSYNCERR_NOSYNCPOINT_FOR_LINERECORD;\n\n    synctex_node_t node;\n    int firstpage = -1;\n    rects.Reset();\n\n    while ((node = synctex_next_result(this->scanner)) != nullptr) {\n        if (firstpage == -1) {\n            firstpage = synctex_node_page(node);\n            if (firstpage <= 0 || firstpage > engine->PageCount())\n                continue;\n            *page = (UINT)firstpage;\n        }\n        if (synctex_node_page(node) != firstpage)\n            continue;\n\n        RectD rc;\n        rc.x  = synctex_node_box_visible_h(node);\n        rc.y  = synctex_node_box_visible_v(node) - synctex_node_box_visible_height(node);\n        rc.dx = synctex_node_box_visible_width(node),\n        rc.dy = synctex_node_box_visible_height(node) + synctex_node_box_visible_depth(node);\n        rects.Push(rc.Round());\n    }\n\n    if (firstpage <= 0)\n        return PDFSYNCERR_NOSYNCPOINT_FOR_LINERECORD;\n    return PDFSYNCERR_SUCCESS;\n}\n"
  },
  {
    "path": "src/PdfSync.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: GPLv3 */\n// PDF-source synchronizer based on .pdfsync file\n\n// Error codes returned by the synchronization functions\nenum {\n    PDFSYNCERR_SUCCESS,                   // the synchronization succeeded\n    PDFSYNCERR_SYNCFILE_NOTFOUND,         // no sync file found\n    PDFSYNCERR_SYNCFILE_CANNOT_BE_OPENED, // sync file cannot be opened\n    PDFSYNCERR_INVALID_PAGE_NUMBER,       // the given page number does not exist in the sync file\n    PDFSYNCERR_NO_SYNC_AT_LOCATION,       // no synchronization found at this location\n    PDFSYNCERR_UNKNOWN_SOURCEFILE,        // the source file is not present in the sync file\n    PDFSYNCERR_NORECORD_IN_SOURCEFILE,    // there is not any record declaration for that particular source file\n    PDFSYNCERR_NORECORD_FOR_THATLINE,     // no record found for the requested line\n    PDFSYNCERR_NOSYNCPOINT_FOR_LINERECORD,// a record is found for the given source line but there is not point in the PDF that corresponds to it\n    PDFSYNCERR_OUTOFMEMORY,\n    PDFSYNCERR_INVALID_ARGUMENT\n};\n\nclass BaseEngine;\n\nclass Synchronizer\n{\npublic:\n    explicit Synchronizer(const WCHAR* syncfilepath);\n    virtual ~Synchronizer() { }\n\n    // Inverse-search:\n    //  - pageNo: page number in the PDF (starting from 1)\n    //  - pt: user-specified PDF-coordinates.\n    // The result is returned in filename, line, col\n    //  - filename: receives the name of the source file\n    //  - line: receives the line number\n    //  - col: receives the column number\n    virtual int DocToSource(UINT pageNo, PointI pt, ScopedMem<WCHAR>& filename, UINT *line, UINT *col) = 0;\n\n    // Forward-search:\n    // The result is returned in page and rects (list of rectangles to highlight).\n    virtual int SourceToDoc(const WCHAR* srcfilename, UINT line, UINT col, UINT *page, Vec<RectI>& rects) = 0;\n\n    // the caller must free() the command line\n    WCHAR * PrepareCommandline(const WCHAR* pattern, const WCHAR* filename, UINT line, UINT col);\n\nprivate:\n    bool indexDiscarded; // true if the index needs to be recomputed (needs to be set to true when a change to the pdfsync file is detected)\n    struct _stat syncfileTimestamp; // time stamp of sync file when index was last built\n\nprotected:\n    bool IsIndexDiscarded() const;\n    int RebuildIndex();\n    WCHAR * PrependDir(const WCHAR* filename) const;\n\n    ScopedMem<WCHAR> syncfilepath;  // path to the synchronization file\n\npublic:\n    static int Create(const WCHAR *pdffilename, BaseEngine *engine, Synchronizer **sync);\n};\n"
  },
  {
    "path": "src/Print.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"FileUtil.h\"\r\n#include \"UITask.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EngineManager.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"ChmModel.h\"\r\n#include \"DisplayModel.h\"\r\n#include \"GlobalPrefs.h\"\r\n#include \"TextSelection.h\"\r\n#include \"TextSearch.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"WindowInfo.h\"\r\n#include \"TabInfo.h\"\r\n#include \"AppUtil.h\"\r\n#include \"Notifications.h\"\r\n#include \"Print.h\"\r\n#include \"Selection.h\"\r\n#include \"SumatraDialogs.h\"\r\n#include \"SumatraProperties.h\"\r\n#include \"Translations.h\"\r\n\r\nstruct PrintData {\r\n    ScopedMem<WCHAR> printerName;\r\n    ScopedMem<DEVMODE> devMode;\r\n    BaseEngine *engine;\r\n    Vec<PRINTPAGERANGE> ranges; // empty when printing a selection\r\n    Vec<SelectionOnPage> sel;   // empty when printing a page range\r\n    Print_Advanced_Data advData;\r\n    int rotation;\r\n\r\n    PrintData(BaseEngine *engine, PRINTER_INFO_2 *printerInfo, DEVMODE *devMode,\r\n              Vec<PRINTPAGERANGE> &ranges, Print_Advanced_Data &advData, int rotation = 0,\r\n              Vec<SelectionOnPage> *sel = nullptr)\r\n        : engine(nullptr), advData(advData), rotation(rotation) {\r\n        if (engine)\r\n            this->engine = engine->Clone();\r\n\r\n        if (printerInfo) {\r\n            printerName.Set(str::Dup(printerInfo->pPrinterName));\r\n        }\r\n        if (devMode)\r\n            this->devMode.Set((LPDEVMODE)memdup(devMode, devMode->dmSize + devMode->dmDriverExtra));\r\n\r\n        if (!sel)\r\n            this->ranges = ranges;\r\n        else\r\n            this->sel = *sel;\r\n    }\r\n\r\n    ~PrintData() { delete engine; }\r\n};\r\n\r\nclass AbortCookieManager {\r\n    CRITICAL_SECTION cookieAccess;\r\n\r\n  public:\r\n    AbortCookie *cookie;\r\n\r\n    AbortCookieManager() : cookie(nullptr) { InitializeCriticalSection(&cookieAccess); }\r\n    ~AbortCookieManager() {\r\n        Clear();\r\n        DeleteCriticalSection(&cookieAccess);\r\n    }\r\n\r\n    void Abort() {\r\n        ScopedCritSec scope(&cookieAccess);\r\n        if (cookie)\r\n            cookie->Abort();\r\n        Clear();\r\n    }\r\n\r\n    void Clear() {\r\n        ScopedCritSec scope(&cookieAccess);\r\n        if (cookie) {\r\n            delete cookie;\r\n            cookie = nullptr;\r\n        }\r\n    }\r\n};\r\n\r\nclass ScopeHDC {\r\n    HDC hdc;\r\n\r\n  public:\r\n    explicit ScopeHDC(HDC hdc) : hdc(hdc) {}\r\n    ~ScopeHDC() { DeleteDC(hdc); }\r\n    operator HDC() const { return hdc; }\r\n};\r\n\r\nstatic RectD BoundSelectionOnPage(const Vec<SelectionOnPage> &sel, int pageNo) {\r\n    RectD bounds;\r\n    for (size_t i = 0; i < sel.Count(); i++) {\r\n        if (sel.At(i).pageNo == pageNo)\r\n            bounds = bounds.Union(sel.At(i).rect);\r\n    }\r\n    return bounds;\r\n}\r\n\r\nstatic bool PrintToDevice(const PrintData &pd, ProgressUpdateUI *progressUI = nullptr,\r\n                          AbortCookieManager *abortCookie = nullptr) {\r\n    AssertCrash(pd.engine);\r\n    if (!pd.engine)\r\n        return false;\r\n    AssertCrash(pd.printerName);\r\n    if (!pd.printerName)\r\n        return false;\r\n\r\n    BaseEngine &engine = *pd.engine;\r\n    ScopedMem<WCHAR> fileName;\r\n\r\n    DOCINFO di = { 0 };\r\n    di.cbSize = sizeof(DOCINFO);\r\n    if (gPluginMode) {\r\n        fileName.Set(url::GetFileName(gPluginURL));\r\n        // fall back to a generic \"filename\" instead of the more confusing temporary filename\r\n        di.lpszDocName = fileName ? fileName : L\"filename\";\r\n    } else\r\n        di.lpszDocName = engine.FileName();\r\n\r\n    int current = 1, total = 0;\r\n    if (pd.sel.Count() == 0) {\r\n        for (size_t i = 0; i < pd.ranges.Count(); i++) {\r\n            if (pd.ranges.At(i).nToPage < pd.ranges.At(i).nFromPage)\r\n                total += pd.ranges.At(i).nFromPage - pd.ranges.At(i).nToPage + 1;\r\n            else\r\n                total += pd.ranges.At(i).nToPage - pd.ranges.At(i).nFromPage + 1;\r\n        }\r\n    } else {\r\n        for (int pageNo = 1; pageNo <= engine.PageCount(); pageNo++) {\r\n            if (!BoundSelectionOnPage(pd.sel, pageNo).IsEmpty())\r\n                total++;\r\n        }\r\n    }\r\n    AssertCrash(total > 0);\r\n    if (0 == total)\r\n        return false;\r\n    if (progressUI)\r\n        progressUI->UpdateProgress(current, total);\r\n\r\n    // cf. http://blogs.msdn.com/b/oldnewthing/archive/2012/11/09/10367057.aspx\r\n    ScopeHDC hdc(CreateDC(nullptr, pd.printerName, nullptr, pd.devMode));\r\n    if (!hdc)\r\n        return false;\r\n\r\n    if (StartDoc(hdc, &di) <= 0)\r\n        return false;\r\n\r\n    // MM_TEXT: Each logical unit is mapped to one device pixel.\r\n    // Positive x is to the right; positive y is down.\r\n    SetMapMode(hdc, MM_TEXT);\r\n\r\n    const SizeI paperSize(GetDeviceCaps(hdc, PHYSICALWIDTH), GetDeviceCaps(hdc, PHYSICALHEIGHT));\r\n    const RectI printable(GetDeviceCaps(hdc, PHYSICALOFFSETX), GetDeviceCaps(hdc, PHYSICALOFFSETY),\r\n                          GetDeviceCaps(hdc, HORZRES), GetDeviceCaps(hdc, VERTRES));\r\n    const float dpiFactor = std::min(GetDeviceCaps(hdc, LOGPIXELSX) / engine.GetFileDPI(),\r\n                                     GetDeviceCaps(hdc, LOGPIXELSY) / engine.GetFileDPI());\r\n    bool bPrintPortrait = paperSize.dx < paperSize.dy;\r\n    if (pd.devMode && (pd.devMode.Get()->dmFields & DM_ORIENTATION))\r\n        bPrintPortrait = DMORIENT_PORTRAIT == pd.devMode.Get()->dmOrientation;\r\n\r\n    if (pd.sel.Count() > 0) {\r\n        for (int pageNo = 1; pageNo <= engine.PageCount(); pageNo++) {\r\n            RectD bounds = BoundSelectionOnPage(pd.sel, pageNo);\r\n            if (bounds.IsEmpty())\r\n                continue;\r\n\r\n            if (progressUI)\r\n                progressUI->UpdateProgress(current, total);\r\n\r\n            StartPage(hdc);\r\n\r\n            geomutil::SizeT<float> bSize = bounds.Size().Convert<float>();\r\n            float zoom = std::min((float)printable.dx / bSize.dx, (float)printable.dy / bSize.dy);\r\n            // use the correct zoom values, if the page fits otherwise\r\n            // and the user didn't ask for anything else (default setting)\r\n            if (PrintScaleShrink == pd.advData.scale)\r\n                zoom = std::min(dpiFactor, zoom);\r\n            else if (PrintScaleNone == pd.advData.scale)\r\n                zoom = dpiFactor;\r\n\r\n            for (size_t i = 0; i < pd.sel.Count(); i++) {\r\n                if (pd.sel.At(i).pageNo != pageNo)\r\n                    continue;\r\n\r\n                RectD *clipRegion = &pd.sel.At(i).rect;\r\n                PointI offset((int)((clipRegion->x - bounds.x) * zoom),\r\n                              (int)((clipRegion->y - bounds.y) * zoom));\r\n                if (pd.advData.scale != PrintScaleNone) {\r\n                    // center the selection on the physical paper\r\n                    offset.x += (int)(printable.dx - bSize.dx * zoom) / 2;\r\n                    offset.y += (int)(printable.dy - bSize.dy * zoom) / 2;\r\n                }\r\n\r\n                bool ok = false;\r\n                short shrink = 1;\r\n                do {\r\n                    RenderedBitmap *bmp = engine.RenderBitmap(\r\n                        pd.sel.At(i).pageNo, zoom / shrink, pd.rotation, clipRegion, Target_Print,\r\n                        abortCookie ? &abortCookie->cookie : nullptr);\r\n                    if (abortCookie)\r\n                        abortCookie->Clear();\r\n                    if (bmp && bmp->GetBitmap()) {\r\n                        RectI rc(offset.x, offset.y, bmp->Size().dx * shrink,\r\n                                 bmp->Size().dy * shrink);\r\n                        ok = bmp->StretchDIBits(hdc, rc);\r\n                    }\r\n                    delete bmp;\r\n                    shrink *= 2;\r\n                } while (!ok && shrink < 32 && !(progressUI && progressUI->WasCanceled()));\r\n            }\r\n            // TODO: abort if !ok?\r\n\r\n            if (EndPage(hdc) <= 0 || progressUI && progressUI->WasCanceled()) {\r\n                AbortDoc(hdc);\r\n                return false;\r\n            }\r\n            current++;\r\n        }\r\n\r\n        EndDoc(hdc);\r\n        return false;\r\n    }\r\n\r\n    // print all the pages the user requested\r\n    for (size_t i = 0; i < pd.ranges.Count(); i++) {\r\n        int dir = pd.ranges.At(i).nFromPage > pd.ranges.At(i).nToPage ? -1 : 1;\r\n        for (DWORD pageNo = pd.ranges.At(i).nFromPage; pageNo != pd.ranges.At(i).nToPage + dir;\r\n             pageNo += dir) {\r\n            if ((PrintRangeEven == pd.advData.range && pageNo % 2 != 0) ||\r\n                (PrintRangeOdd == pd.advData.range && pageNo % 2 == 0))\r\n                continue;\r\n            if (progressUI)\r\n                progressUI->UpdateProgress(current, total);\r\n\r\n            StartPage(hdc);\r\n\r\n            geomutil::SizeT<float> pSize = engine.PageMediabox(pageNo).Size().Convert<float>();\r\n            int rotation = 0;\r\n            // Turn the document by 90 deg if it isn't in portrait mode\r\n            if (pSize.dx > pSize.dy) {\r\n                rotation += 90;\r\n                std::swap(pSize.dx, pSize.dy);\r\n            }\r\n            // make sure not to print upside-down\r\n            rotation = (rotation % 180) == 0 ? 0 : 270;\r\n            // finally turn the page by (another) 90 deg in landscape mode\r\n            if (!bPrintPortrait) {\r\n                rotation = (rotation + 90) % 360;\r\n                std::swap(pSize.dx, pSize.dy);\r\n            }\r\n\r\n            // dpiFactor means no physical zoom\r\n            float zoom = dpiFactor;\r\n            // offset of the top-left corner of the page from the printable area\r\n            // (negative values move the page into the left/top margins, etc.);\r\n            // offset adjustments are needed because the GDI coordinate system\r\n            // starts at the corner of the printable area and we rather want to\r\n            // center the page on the physical paper (except for PrintScaleNone\r\n            // where the page starts at the very top left of the physical paper so\r\n            // that printing forms/labels of varying size remains reliably possible)\r\n            PointI offset(-printable.x, -printable.y);\r\n\r\n            if (pd.advData.scale != PrintScaleNone) {\r\n                // make sure to fit all content into the printable area when scaling\r\n                // and the whole document page on the physical paper\r\n                RectD rect = engine.PageContentBox(pageNo, Target_Print);\r\n                geomutil::RectT<float> cbox =\r\n                    engine.Transform(rect, pageNo, 1.0, rotation).Convert<float>();\r\n                zoom = std::min((float)printable.dx / cbox.dx,\r\n                                std::min((float)printable.dy / cbox.dy,\r\n                                         std::min((float)paperSize.dx / pSize.dx,\r\n                                                  (float)paperSize.dy / pSize.dy)));\r\n                // use the correct zoom values, if the page fits otherwise\r\n                // and the user didn't ask for anything else (default setting)\r\n                if (PrintScaleShrink == pd.advData.scale && dpiFactor < zoom)\r\n                    zoom = dpiFactor;\r\n                // center the page on the physical paper\r\n                offset.x += (int)(paperSize.dx - pSize.dx * zoom) / 2;\r\n                offset.y += (int)(paperSize.dy - pSize.dy * zoom) / 2;\r\n                // make sure that no content lies in the non-printable paper margins\r\n                geomutil::RectT<float> onPaper(printable.x + offset.x + cbox.x * zoom,\r\n                                               printable.y + offset.y + cbox.y * zoom,\r\n                                               cbox.dx * zoom, cbox.dy * zoom);\r\n                if (onPaper.x < printable.x)\r\n                    offset.x += (int)(printable.x - onPaper.x);\r\n                else if (onPaper.BR().x > printable.BR().x)\r\n                    offset.x -= (int)(onPaper.BR().x - printable.BR().x);\r\n                if (onPaper.y < printable.y)\r\n                    offset.y += (int)(printable.y - onPaper.y);\r\n                else if (onPaper.BR().y > printable.BR().y)\r\n                    offset.y -= (int)(onPaper.BR().y - printable.BR().y);\r\n            }\r\n\r\n            bool ok = false;\r\n            short shrink = 1;\r\n            do {\r\n                RenderedBitmap *bmp =\r\n                    engine.RenderBitmap(pageNo, zoom / shrink, rotation, nullptr, Target_Print,\r\n                                        abortCookie ? &abortCookie->cookie : nullptr);\r\n                if (abortCookie)\r\n                    abortCookie->Clear();\r\n                if (bmp && bmp->GetBitmap()) {\r\n                    RectI rc(offset.x, offset.y, bmp->Size().dx * shrink, bmp->Size().dy * shrink);\r\n                    ok = bmp->StretchDIBits(hdc, rc);\r\n                }\r\n                delete bmp;\r\n                shrink *= 2;\r\n            } while (!ok && shrink < 32 && !(progressUI && progressUI->WasCanceled()));\r\n            // TODO: abort if !ok?\r\n\r\n            if (EndPage(hdc) <= 0 || progressUI && progressUI->WasCanceled()) {\r\n                AbortDoc(hdc);\r\n                return false;\r\n            }\r\n            current++;\r\n        }\r\n    }\r\n\r\n    EndDoc(hdc);\r\n    return true;\r\n}\r\n\r\nclass PrintThreadData : public ProgressUpdateUI, public NotificationWndCallback {\r\n    NotificationWnd *wnd;\r\n    AbortCookieManager cookie;\r\n    bool isCanceled;\r\n    WindowInfo *win;\r\n\r\n  public:\r\n    PrintData *data;\r\n    HANDLE thread; // close the print thread handle after execution\r\n\r\n    PrintThreadData(WindowInfo *win, PrintData *data)\r\n        : win(win), data(data), isCanceled(false), thread(nullptr) {\r\n        wnd = new NotificationWnd(win->hwndCanvas, L\"\", _TR(\"Printing page %d of %d...\"), this);\r\n        // don't use a groupId for this notification so that\r\n        // multiple printing notifications could coexist between tabs\r\n        win->notifications->Add(wnd);\r\n    }\r\n\r\n    ~PrintThreadData() {\r\n        CloseHandle(thread);\r\n        delete data;\r\n        RemoveNotification(wnd);\r\n    }\r\n\r\n    virtual void UpdateProgress(int current, int total) {\r\n        uitask::Post([=] {\r\n            if (WindowInfoStillValid(win) && win->notifications->Contains(wnd)) {\r\n                wnd->UpdateProgress(current, total);\r\n            }\r\n        });\r\n    }\r\n\r\n    virtual bool WasCanceled() {\r\n        return isCanceled || !WindowInfoStillValid(win) || win->printCanceled;\r\n    }\r\n\r\n    // called when printing has been canceled\r\n    virtual void RemoveNotification(NotificationWnd *wnd) {\r\n        isCanceled = true;\r\n        cookie.Abort();\r\n        this->wnd = nullptr;\r\n        if (WindowInfoStillValid(win))\r\n            win->notifications->RemoveNotification(wnd);\r\n    }\r\n\r\n    static DWORD WINAPI PrintThread(LPVOID data) {\r\n        PrintThreadData *threadData = (PrintThreadData *)data;\r\n        WindowInfo *win = threadData->win;\r\n        // wait for PrintToDeviceOnThread to return so that we\r\n        // close the correct handle to the current printing thread\r\n        while (!win->printThread)\r\n            Sleep(1);\r\n\r\n        HANDLE thread = threadData->thread = win->printThread;\r\n        PrintToDevice(*threadData->data, threadData, &threadData->cookie);\r\n\r\n        uitask::Post([=] {\r\n            if (WindowInfoStillValid(win) && thread == win->printThread) {\r\n                win->printThread = nullptr;\r\n            }\r\n            delete threadData;\r\n        });\r\n        return 0;\r\n    }\r\n};\r\n\r\nstatic void PrintToDeviceOnThread(WindowInfo *win, PrintData *data) {\r\n    assert(!win->printThread);\r\n    PrintThreadData *threadData = new PrintThreadData(win, data);\r\n    win->printThread = nullptr;\r\n    win->printThread =\r\n        CreateThread(nullptr, 0, PrintThreadData::PrintThread, threadData, 0, nullptr);\r\n}\r\n\r\nvoid AbortPrinting(WindowInfo *win) {\r\n    if (win->printThread) {\r\n        win->printCanceled = true;\r\n        WaitForSingleObject(win->printThread, INFINITE);\r\n    }\r\n    win->printCanceled = false;\r\n}\r\n\r\nstatic HGLOBAL GlobalMemDup(const void *data, size_t len) {\r\n    HGLOBAL hGlobal = GlobalAlloc(GMEM_MOVEABLE, len);\r\n    if (!hGlobal)\r\n        return nullptr;\r\n\r\n    void *globalData = GlobalLock(hGlobal);\r\n    if (!globalData) {\r\n        GlobalFree(hGlobal);\r\n        return nullptr;\r\n    }\r\n\r\n    memcpy(globalData, data, len);\r\n    GlobalUnlock(hGlobal);\r\n    return hGlobal;\r\n}\r\n\r\n/* Show Print Dialog box to allow user to select the printer\r\nand the pages to print.\r\n\r\nFor reference: In order to print with Adobe Reader instead: ViewWithAcrobat(win, L\"/P\");\r\n\r\nNote: The following only applies for printing as image\r\n\r\nCreates a new dummy page for each page with a large zoom factor,\r\nand then uses StretchDIBits to copy this to the printer's dc.\r\n\r\nSo far have tested printing from XP to\r\n - Acrobat Professional 6 (note that acrobat is usually set to\r\n   downgrade the resolution of its bitmaps to 150dpi)\r\n - HP Laserjet 2300d\r\n - HP Deskjet D4160\r\n - Lexmark Z515 inkjet, which should cover most bases.\r\n*/\r\nenum { MAXPAGERANGES = 10 };\r\nvoid OnMenuPrint(WindowInfo *win, bool waitForCompletion) {\r\n    // we remember some printer settings per process\r\n    static ScopedMem<DEVMODE> defaultDevMode;\r\n    static PrintScaleAdv defaultScaleAdv = PrintScaleShrink;\r\n\r\n    static bool hasDefaults = false;\r\n    if (!hasDefaults) {\r\n        hasDefaults = true;\r\n        if (str::EqI(gGlobalPrefs->printerDefaults.printScale, \"fit\"))\r\n            defaultScaleAdv = PrintScaleFit;\r\n        else if (str::EqI(gGlobalPrefs->printerDefaults.printScale, \"none\"))\r\n            defaultScaleAdv = PrintScaleNone;\r\n    }\r\n\r\n    bool printSelection = false;\r\n    Vec<PRINTPAGERANGE> ranges;\r\n    PRINTER_INFO_2 printerInfo = { 0 };\r\n\r\n    if (!HasPermission(Perm_PrinterAccess))\r\n        return;\r\n    if (!win->IsDocLoaded())\r\n        return;\r\n\r\n    if (win->AsChm()) {\r\n        // the Print dialog allows access to the file system, so fall back\r\n        // to printing the entire document without dialog if that isn't desired\r\n        bool showUI = HasPermission(Perm_DiskAccess);\r\n        win->AsChm()->PrintCurrentPage(showUI);\r\n        return;\r\n    }\r\n    if (win->AsEbook()) {\r\n        // TODO: use EbookEngine for printing?\r\n        return;\r\n    }\r\n\r\n    CrashIf(!win->AsFixed());\r\n    if (!win->AsFixed())\r\n        return;\r\n    DisplayModel *dm = win->AsFixed();\r\n\r\n#ifndef DISABLE_DOCUMENT_RESTRICTIONS\r\n    if (!dm->GetEngine()->AllowsPrinting())\r\n        return;\r\n#endif\r\n\r\n    if (win->printThread) {\r\n        int res = MessageBox(\r\n            win->hwndFrame, _TR(\"Printing is still in progress. Abort and start over?\"),\r\n            _TR(\"Printing in progress.\"), MB_ICONEXCLAMATION | MB_YESNO | MbRtlReadingMaybe());\r\n        if (res == IDNO)\r\n            return;\r\n    }\r\n    AbortPrinting(win);\r\n\r\n    // the Print dialog allows access to the file system, so fall back\r\n    // to printing the entire document without dialog if that isn't desired\r\n    if (!HasPermission(Perm_DiskAccess)) {\r\n        PrintFile(dm->GetEngine());\r\n        return;\r\n    }\r\n\r\n    PRINTDLGEX pd;\r\n    ZeroMemory(&pd, sizeof(PRINTDLGEX));\r\n    pd.lStructSize = sizeof(PRINTDLGEX);\r\n    pd.hwndOwner = win->hwndFrame;\r\n    pd.Flags = PD_USEDEVMODECOPIESANDCOLLATE | PD_COLLATE;\r\n    if (!win->currentTab->selectionOnPage)\r\n        pd.Flags |= PD_NOSELECTION;\r\n    pd.nCopies = 1;\r\n    /* by default print all pages */\r\n    pd.nPageRanges = 1;\r\n    pd.nMaxPageRanges = MAXPAGERANGES;\r\n    PRINTPAGERANGE *ppr = AllocArray<PRINTPAGERANGE>(MAXPAGERANGES);\r\n    pd.lpPageRanges = ppr;\r\n    ppr->nFromPage = 1;\r\n    ppr->nToPage = dm->PageCount();\r\n    pd.nMinPage = 1;\r\n    pd.nMaxPage = dm->PageCount();\r\n    pd.nStartPage = START_PAGE_GENERAL;\r\n\r\n    Print_Advanced_Data advanced(PrintRangeAll, defaultScaleAdv);\r\n    ScopedMem<DLGTEMPLATE> dlgTemplate; // needed for RTL languages\r\n    HPROPSHEETPAGE hPsp = CreatePrintAdvancedPropSheet(&advanced, dlgTemplate);\r\n    pd.lphPropertyPages = &hPsp;\r\n    pd.nPropertyPages = 1;\r\n\r\n    LPDEVNAMES devNames;\r\n    LPDEVMODE devMode;\r\n    bool failedEngineClone;\r\n    PrintData *data = nullptr;\r\n\r\n    // restore remembered settings\r\n    if (defaultDevMode) {\r\n        DEVMODE *p = defaultDevMode.Get();\r\n        pd.hDevMode = GlobalMemDup(p, p->dmSize + p->dmDriverExtra);\r\n    }\r\n\r\n    if (PrintDlgEx(&pd) != S_OK) {\r\n        if (CommDlgExtendedError() != 0) {\r\n            /* if PrintDlg was cancelled then\r\n               CommDlgExtendedError is zero, otherwise it returns the\r\n               error code, which we could look at here if we wanted.\r\n               for now just warn the user that printing has stopped\r\n               becasue of an error */\r\n            MessageBoxWarning(win->hwndFrame, _TR(\"Couldn't initialize printer\"),\r\n                              _TR(\"Printing problem.\"));\r\n        }\r\n        goto Exit;\r\n    }\r\n\r\n    if (pd.dwResultAction == PD_RESULT_PRINT || pd.dwResultAction == PD_RESULT_APPLY) {\r\n        // remember settings for this process\r\n        devMode = (LPDEVMODE)GlobalLock(pd.hDevMode);\r\n        if (devMode) {\r\n            defaultDevMode.Set(\r\n                (LPDEVMODE)memdup(devMode, devMode->dmSize + devMode->dmDriverExtra));\r\n            GlobalUnlock(pd.hDevMode);\r\n        }\r\n        defaultScaleAdv = advanced.scale;\r\n    }\r\n\r\n    if (pd.dwResultAction != PD_RESULT_PRINT)\r\n        goto Exit;\r\n\r\n    if (pd.Flags & PD_CURRENTPAGE) {\r\n        PRINTPAGERANGE pr = { (DWORD)dm->CurrentPageNo(), (DWORD)dm->CurrentPageNo() };\r\n        ranges.Append(pr);\r\n    } else if (win->currentTab->selectionOnPage && (pd.Flags & PD_SELECTION)) {\r\n        printSelection = true;\r\n    } else if (!(pd.Flags & PD_PAGENUMS)) {\r\n        PRINTPAGERANGE pr = { 1, (DWORD)dm->PageCount() };\r\n        ranges.Append(pr);\r\n    } else {\r\n        assert(pd.nPageRanges > 0);\r\n        for (DWORD i = 0; i < pd.nPageRanges; i++)\r\n            ranges.Append(pd.lpPageRanges[i]);\r\n    }\r\n\r\n    devNames = (LPDEVNAMES)GlobalLock(pd.hDevNames);\r\n    devMode = (LPDEVMODE)GlobalLock(pd.hDevMode);\r\n    if (devNames) {\r\n        printerInfo.pDriverName = (LPWSTR)devNames + devNames->wDriverOffset;\r\n        printerInfo.pPrinterName = (LPWSTR)devNames + devNames->wDeviceOffset;\r\n        printerInfo.pPortName = (LPWSTR)devNames + devNames->wOutputOffset;\r\n    }\r\n    data =\r\n        new PrintData(dm->GetEngine(), &printerInfo, devMode, ranges, advanced, dm->GetRotation(),\r\n                      printSelection ? win->currentTab->selectionOnPage : nullptr);\r\n    if (devNames)\r\n        GlobalUnlock(pd.hDevNames);\r\n    if (devMode)\r\n        GlobalUnlock(pd.hDevMode);\r\n\r\n    // if a file is missing and the engine can't thus be cloned,\r\n    // we print using the original engine on the main thread\r\n    // so that the document can't be closed and the original engine\r\n    // unexpectedly deleted\r\n    // TODO: instead prevent closing the document so that printing\r\n    // can still happen on a separate thread and be interruptible\r\n    failedEngineClone = dm->GetEngine() && !data->engine;\r\n    if (failedEngineClone)\r\n        data->engine = dm->GetEngine();\r\n\r\n    if (!waitForCompletion && !failedEngineClone)\r\n        PrintToDeviceOnThread(win, data);\r\n    else {\r\n        PrintToDevice(*data);\r\n        if (failedEngineClone)\r\n            data->engine = nullptr;\r\n        delete data;\r\n    }\r\n\r\nExit:\r\n    free(ppr);\r\n    GlobalFree(pd.hDevNames);\r\n    GlobalFree(pd.hDevMode);\r\n}\r\n\r\nstatic short GetPaperSize(BaseEngine *engine) {\r\n    RectD mediabox = engine->PageMediabox(1);\r\n    SizeD size = engine->Transform(mediabox, 1, 1.0f / engine->GetFileDPI(), 0).Size();\r\n\r\n    switch (GetPaperFormat(size)) {\r\n        case Paper_A4:\r\n            return DMPAPER_A4;\r\n        case Paper_A3:\r\n            return DMPAPER_A3;\r\n        case Paper_A5:\r\n            return DMPAPER_A5;\r\n        case Paper_Letter:\r\n            return DMPAPER_LETTER;\r\n        case Paper_Legal:\r\n            return DMPAPER_LEGAL;\r\n        case Paper_Tabloid:\r\n            return DMPAPER_TABLOID;\r\n        case Paper_Statement:\r\n            return DMPAPER_STATEMENT;\r\n        default:\r\n            return 0;\r\n    }\r\n}\r\n\r\nstatic short GetPaperByName(const WCHAR *papername) {\r\n    if (str::EqI(papername, L\"letter\"))\r\n        return DMPAPER_LETTER;\r\n    if (str::EqI(papername, L\"legal\"))\r\n        return DMPAPER_LEGAL;\r\n    if (str::EqI(papername, L\"tabloid\"))\r\n        return DMPAPER_TABLOID;\r\n    if (str::EqI(papername, L\"statement\"))\r\n        return DMPAPER_STATEMENT;\r\n    if (str::EqI(papername, L\"A3\"))\r\n        return DMPAPER_A3;\r\n    if (str::EqI(papername, L\"A4\"))\r\n        return DMPAPER_A4;\r\n    if (str::EqI(papername, L\"A5\"))\r\n        return DMPAPER_A5;\r\n    return 0;\r\n}\r\n\r\nstatic short GetPaperSourceByName(const WCHAR *name, LPDEVMODE devMode) {\r\n    CrashIf(!(devMode->dmFields & DM_DEFAULTSOURCE));\r\n    if (!(devMode->dmFields & DM_DEFAULTSOURCE))\r\n        return devMode->dmDefaultSource;\r\n    DWORD count = DeviceCapabilities(devMode->dmDeviceName, nullptr, DC_BINS, nullptr, nullptr);\r\n    DWORD count2 =\r\n        DeviceCapabilities(devMode->dmDeviceName, nullptr, DC_BINNAMES, nullptr, nullptr);\r\n    if (count != count2 || 0 == count)\r\n        return devMode->dmDefaultSource;\r\n    // try to determine the paper bin number by name\r\n    ScopedMem<WORD> bins(AllocArray<WORD>(count));\r\n    ScopedMem<WCHAR> binNames(AllocArray<WCHAR>(24 * count + 1));\r\n    DeviceCapabilities(devMode->dmDeviceName, nullptr, DC_BINS, (WCHAR *)bins.Get(), nullptr);\r\n    DeviceCapabilities(devMode->dmDeviceName, nullptr, DC_BINNAMES, binNames.Get(), nullptr);\r\n    for (DWORD i = 0; i < count; i++) {\r\n        if (str::EqIS(binNames.Get() + 24 * i, name))\r\n            return bins.Get()[i];\r\n    }\r\n    // alternatively allow indicating the paper bin directly by number\r\n    if (str::Parse(L\"%u%$\", name, &count))\r\n        return (short)count;\r\n    return devMode->dmDefaultSource;\r\n}\r\n\r\nstatic void ApplyPrintSettings(const WCHAR *settings, int pageCount, Vec<PRINTPAGERANGE> &ranges,\r\n                               Print_Advanced_Data &advanced, LPDEVMODE devMode) {\r\n    WStrVec rangeList;\r\n    if (settings)\r\n        rangeList.Split(settings, L\",\", true);\r\n\r\n    for (size_t i = 0; i < rangeList.Count(); i++) {\r\n        int val;\r\n        PRINTPAGERANGE pr;\r\n        if (str::Parse(rangeList.At(i), L\"%d-%d%$\", &pr.nFromPage, &pr.nToPage)) {\r\n            pr.nFromPage = limitValue(pr.nFromPage, (DWORD)1, (DWORD)pageCount);\r\n            pr.nToPage = limitValue(pr.nToPage, (DWORD)1, (DWORD)pageCount);\r\n            ranges.Append(pr);\r\n        } else if (str::Parse(rangeList.At(i), L\"%d%$\", &pr.nFromPage)) {\r\n            pr.nFromPage = pr.nToPage = limitValue(pr.nFromPage, (DWORD)1, (DWORD)pageCount);\r\n            ranges.Append(pr);\r\n        } else if (str::EqI(rangeList.At(i), L\"even\"))\r\n            advanced.range = PrintRangeEven;\r\n        else if (str::EqI(rangeList.At(i), L\"odd\"))\r\n            advanced.range = PrintRangeOdd;\r\n        else if (str::EqI(rangeList.At(i), L\"noscale\"))\r\n            advanced.scale = PrintScaleNone;\r\n        else if (str::EqI(rangeList.At(i), L\"shrink\"))\r\n            advanced.scale = PrintScaleShrink;\r\n        else if (str::EqI(rangeList.At(i), L\"fit\"))\r\n            advanced.scale = PrintScaleFit;\r\n        else if (str::Parse(rangeList.At(i), L\"%dx%$\", &val) && 0 < val && val < 1000)\r\n            devMode->dmCopies = (short)val;\r\n        else if (str::EqI(rangeList.At(i), L\"simplex\"))\r\n            devMode->dmDuplex = DMDUP_SIMPLEX;\r\n        else if (str::EqI(rangeList.At(i), L\"duplex\") || str::EqI(rangeList.At(i), L\"duplexlong\"))\r\n            devMode->dmDuplex = DMDUP_VERTICAL;\r\n        else if (str::EqI(rangeList.At(i), L\"duplexshort\"))\r\n            devMode->dmDuplex = DMDUP_HORIZONTAL;\r\n        else if (str::EqI(rangeList.At(i), L\"color\"))\r\n            devMode->dmColor = DMCOLOR_COLOR;\r\n        else if (str::EqI(rangeList.At(i), L\"monochrome\"))\r\n            devMode->dmColor = DMCOLOR_MONOCHROME;\r\n        else if (str::StartsWithI(rangeList.At(i), L\"bin=\"))\r\n            devMode->dmDefaultSource = GetPaperSourceByName(rangeList.At(i) + 4, devMode);\r\n        else if (str::StartsWithI(rangeList.At(i), L\"paper=\"))\r\n            devMode->dmPaperSize = GetPaperByName(rangeList.At(i) + 6);\r\n    }\r\n\r\n    if (ranges.Count() == 0) {\r\n        PRINTPAGERANGE pr = { 1, (DWORD)pageCount };\r\n        ranges.Append(pr);\r\n    }\r\n}\r\n\r\nbool PrintFile(BaseEngine *engine, WCHAR *printerName, bool displayErrors, const WCHAR *settings) {\r\n    bool ok = false;\r\n    if (!HasPermission(Perm_PrinterAccess))\r\n        return false;\r\n\r\n#ifndef DISABLE_DOCUMENT_RESTRICTIONS\r\n    if (engine && !engine->AllowsPrinting())\r\n        engine = nullptr;\r\n#endif\r\n    if (!engine) {\r\n        if (displayErrors)\r\n            MessageBoxWarning(nullptr, _TR(\"Cannot print this file\"), _TR(\"Printing problem.\"));\r\n        return false;\r\n    }\r\n\r\n    ScopedMem<WCHAR> defaultPrinter;\r\n    if (!printerName) {\r\n        defaultPrinter.Set(GetDefaultPrinterName());\r\n        printerName = defaultPrinter;\r\n    }\r\n\r\n    HANDLE printer;\r\n    BOOL res = OpenPrinter(printerName, &printer, nullptr);\r\n    if (!res) {\r\n        if (displayErrors)\r\n            MessageBoxWarning(nullptr, _TR(\"Printer with given name doesn't exist\"),\r\n                              _TR(\"Printing problem.\"));\r\n        return false;\r\n    }\r\n\r\n    LONG returnCode = 0;\r\n    LONG structSize = 0;\r\n    LPDEVMODE devMode = nullptr;\r\n    // get printer driver information\r\n    DWORD needed = 0;\r\n    GetPrinter(printer, 2, nullptr, 0, &needed);\r\n    ScopedMem<PRINTER_INFO_2> infoData((PRINTER_INFO_2 *)AllocArray<BYTE>(needed));\r\n    if (infoData)\r\n        res = GetPrinter(printer, 2, (LPBYTE)infoData.Get(), needed, &needed);\r\n    if (!res || !infoData || needed <= sizeof(PRINTER_INFO_2))\r\n        goto Exit;\r\n\r\n    structSize =\r\n        DocumentProperties(nullptr, printer, printerName, nullptr, /* Asking for size, so */\r\n                           nullptr,                                /* not used. */\r\n                           0);                                     /* Zero returns buffer size. */\r\n    if (structSize < sizeof(DEVMODE)) {\r\n        // If failure, inform the user, cleanup and return failure.\r\n        if (displayErrors)\r\n            MessageBoxWarning(nullptr, _TR(\"Could not obtain Printer properties\"),\r\n                              _TR(\"Printing problem.\"));\r\n        goto Exit;\r\n    }\r\n    devMode = (LPDEVMODE)malloc(structSize);\r\n    if (!devMode)\r\n        goto Exit;\r\n\r\n    // Get the default DevMode for the printer and modify it for your needs.\r\n    returnCode = DocumentProperties(nullptr, printer, printerName,\r\n                                    devMode,        /* The address of the buffer to fill. */\r\n                                    nullptr,        /* Not using the input buffer. */\r\n                                    DM_OUT_BUFFER); /* Have the output buffer filled. */\r\n    if (IDOK != returnCode) {\r\n        // If failure, inform the user, cleanup and return failure.\r\n        if (displayErrors)\r\n            MessageBoxWarning(nullptr, _TR(\"Could not obtain Printer properties\"),\r\n                              _TR(\"Printing problem.\"));\r\n        goto Exit;\r\n    }\r\n\r\n    ClosePrinter(printer);\r\n    printer = nullptr;\r\n\r\n    // set paper size to match the size of the document's first page\r\n    // (will be overridden by any paper= value in -print-settings)\r\n    devMode->dmPaperSize = GetPaperSize(engine);\r\n\r\n    {\r\n        Print_Advanced_Data advanced;\r\n        Vec<PRINTPAGERANGE> ranges;\r\n\r\n        ApplyPrintSettings(settings, engine->PageCount(), ranges, advanced, devMode);\r\n\r\n        PrintData pd(engine, infoData, devMode, ranges, advanced);\r\n        ok = PrintToDevice(pd);\r\n        if (!ok && displayErrors)\r\n            MessageBoxWarning(nullptr, _TR(\"Couldn't initialize printer\"),\r\n                              _TR(\"Printing problem.\"));\r\n    }\r\n\r\nExit:\r\n    free(devMode);\r\n    if (printer)\r\n        ClosePrinter(printer);\r\n    return ok;\r\n}\r\n\r\nbool PrintFile(const WCHAR *fileName, WCHAR *printerName, bool displayErrors,\r\n               const WCHAR *settings) {\r\n    ScopedMem<WCHAR> fileName2(path::Normalize(fileName));\r\n    BaseEngine *engine = EngineManager::CreateEngine(fileName2);\r\n    bool ok = PrintFile(engine, printerName, displayErrors, settings);\r\n    delete engine;\r\n    return ok;\r\n}\r\n"
  },
  {
    "path": "src/Print.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nbool PrintFile(const WCHAR *fileName, WCHAR *printerName = nullptr, bool displayErrors = true,\r\n               const WCHAR *settings = nullptr);\r\nbool PrintFile(BaseEngine *engine, WCHAR *printerName = nullptr, bool displayErrors = true,\r\n               const WCHAR *settings = nullptr);\r\nvoid OnMenuPrint(WindowInfo *win, bool waitForCompletion = false);\r\nvoid AbortPrinting(WindowInfo *win);\r\n"
  },
  {
    "path": "src/PsEngine.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include <zlib.h>\r\n#include \"ByteReader.h\"\r\n#include \"FileUtil.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"PdfEngine.h\"\r\n#include \"PsEngine.h\"\r\n\r\nstatic WCHAR *GetGhostscriptPath()\r\n{\r\n   const WCHAR *gsProducts[] = {\r\n        L\"AFPL Ghostscript\",\r\n        L\"Aladdin Ghostscript\",\r\n        L\"GPL Ghostscript\",\r\n        L\"GNU Ghostscript\",\r\n    };\r\n\r\n    // find all installed Ghostscript versions\r\n    WStrVec versions;\r\n    REGSAM access = KEY_READ | KEY_WOW64_32KEY;\r\nTryAgain64Bit:\r\n    for (int i = 0; i < dimof(gsProducts); i++) {\r\n        HKEY hkey;\r\n        ScopedMem<WCHAR> keyName(str::Join(L\"Software\\\\\", gsProducts[i]));\r\n        if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, keyName, 0, access, &hkey) != ERROR_SUCCESS)\r\n            continue;\r\n        WCHAR subkey[32];\r\n        for (DWORD ix = 0; RegEnumKey(hkey, ix, subkey, dimof(subkey)) == ERROR_SUCCESS; ix++)\r\n            versions.Append(str::Dup(subkey));\r\n        RegCloseKey(hkey);\r\n    }\r\n    if ((access & KEY_WOW64_32KEY)) {\r\n        // also look for 64-bit Ghostscript versions under 64-bit Windows\r\n        access = KEY_READ | KEY_WOW64_64KEY;\r\n#ifndef _WIN64\r\n        // (unless this is 32-bit Windows)\r\n        if (IsRunningInWow64())\r\n#endif\r\n        goto TryAgain64Bit;\r\n    }\r\n    versions.SortNatural();\r\n\r\n    // return the path to the newest installation\r\n    for (size_t ix = versions.Count(); ix > 0; ix--) {\r\n        for (int i = 0; i < dimof(gsProducts); i++) {\r\n            ScopedMem<WCHAR> keyName(str::Format(L\"Software\\\\%s\\\\%s\",\r\n                                                 gsProducts[i], versions.At(ix - 1)));\r\n            ScopedMem<WCHAR> GS_DLL(ReadRegStr(HKEY_LOCAL_MACHINE, keyName, L\"GS_DLL\"));\r\n            if (!GS_DLL)\r\n                continue;\r\n            ScopedMem<WCHAR> dir(path::GetDir(GS_DLL));\r\n            ScopedMem<WCHAR> exe(path::Join(dir, L\"gswin32c.exe\"));\r\n            if (file::Exists(exe))\r\n                return exe.StealData();\r\n            exe.Set(path::Join(dir, L\"gswin64c.exe\"));\r\n            if (file::Exists(exe))\r\n                return exe.StealData();\r\n        }\r\n    }\r\n\r\n    // if Ghostscript isn't found in the Registry, try finding it in the %PATH%\r\n    DWORD size = GetEnvironmentVariable(L\"PATH\", nullptr, 0);\r\n    ScopedMem<WCHAR> envpath(AllocArray<WCHAR>(size));\r\n    if (size > 0 && envpath) {\r\n        GetEnvironmentVariable(L\"PATH\", envpath, size);\r\n        WStrVec paths;\r\n        paths.Split(envpath, L\";\", true);\r\n        for (size_t ix = 0; ix < paths.Count(); ix++) {\r\n            ScopedMem<WCHAR> exe(path::Join(paths.At(ix), L\"gswin32c.exe\"));\r\n            if (file::Exists(exe))\r\n                return exe.StealData();\r\n            exe.Set(path::Join(paths.At(ix), L\"gswin64c.exe\"));\r\n            if (file::Exists(exe))\r\n                return exe.StealData();\r\n        }\r\n    }\r\n\r\n    return nullptr;\r\n}\r\n\r\nclass ScopedFile {\r\n    ScopedMem<WCHAR> path;\r\n\r\npublic:\r\n    explicit ScopedFile(const WCHAR *path) : path(str::Dup(path)) { }\r\n    ~ScopedFile() {\r\n        if (path)\r\n            file::Delete(path);\r\n    }\r\n};\r\n\r\nstatic RectI ExtractDSCPageSize(const WCHAR *fileName)\r\n{\r\n    char header[1024] = { 0 };\r\n    file::ReadN(fileName, header, sizeof(header) - 1);\r\n    if (!str::StartsWith(header, \"%!PS-Adobe-\"))\r\n        return RectI();\r\n\r\n    // PostScript creators are supposed to set the page size\r\n    // e.g. through a setpagedevice call in PostScript code,\r\n    // some creators however fail to do so and only indicate\r\n    // the page size in a DSC BoundingBox comment.\r\n    char *nl = header;\r\n    geomutil::RectT<float> bbox;\r\n    while ((nl = strchr(nl + 1, '\\n')) != nullptr && '%' == nl[1]) {\r\n        if (str::StartsWith(nl + 1, \"%%BoundingBox:\") &&\r\n            str::Parse(nl + 1, \"%%%%BoundingBox: 0 0 %f %f% \", &bbox.dx, &bbox.dy)) {\r\n            return bbox.ToInt();\r\n        }\r\n    }\r\n\r\n    return RectI();\r\n}\r\n\r\nstatic BaseEngine *ps2pdf(const WCHAR *fileName)\r\n{\r\n    // TODO: read from gswin32c's stdout instead of using a TEMP file\r\n    ScopedMem<WCHAR> shortPath(path::ShortPath(fileName));\r\n    ScopedMem<WCHAR> tmpFile(path::GetTempPath(L\"PsE\"));\r\n    ScopedFile tmpFileScope(tmpFile);\r\n    ScopedMem<WCHAR> gswin32c(GetGhostscriptPath());\r\n    if (!shortPath || !tmpFile || !gswin32c)\r\n        return nullptr;\r\n\r\n    // try to help Ghostscript determine the intended page size\r\n    ScopedMem<WCHAR> psSetup;\r\n    RectI page = ExtractDSCPageSize(fileName);\r\n    if (!page.IsEmpty())\r\n        psSetup.Set(str::Format(L\" << /PageSize [%i %i] >> setpagedevice\", page.dx, page.dy));\r\n\r\n    ScopedMem<WCHAR> cmdLine(str::Format(\r\n        L\"\\\"%s\\\" -q -dSAFER -dNOPAUSE -dBATCH -dEPSCrop -sOutputFile=\\\"%s\\\" -sDEVICE=pdfwrite -c \\\".setpdfwrite%s\\\" -f \\\"%s\\\"\",\r\n        gswin32c.Get(), tmpFile.Get(), psSetup ? psSetup.Get() : L\"\", shortPath.Get()));\r\n    fprintf(stderr, \"- %s:%d: using '%ls' for creating '%%TEMP%%\\\\%ls'\\n\", path::GetBaseName(__FILE__), __LINE__, gswin32c.Get(), path::GetBaseName(tmpFile));\r\n\r\n    // TODO: the PS-to-PDF conversion can hang the UI for several seconds\r\n    HANDLE process = LaunchProcess(cmdLine, nullptr, CREATE_NO_WINDOW);\r\n    if (!process)\r\n        return nullptr;\r\n\r\n    DWORD timeout = 10000;\r\n#ifdef DEBUG\r\n    // allow to disable the timeout for debugging purposes\r\n    if (GetEnvironmentVariable(L\"SUMATRAPDF_NO_GHOSTSCRIPT_TIMEOUT\", nullptr, 0))\r\n        timeout = INFINITE;\r\n#endif\r\n    DWORD exitCode = EXIT_FAILURE;\r\n    WaitForSingleObject(process, timeout);\r\n    GetExitCodeProcess(process, &exitCode);\r\n    TerminateProcess(process, 1);\r\n    CloseHandle(process);\r\n    if (exitCode != EXIT_SUCCESS)\r\n        return nullptr;\r\n\r\n    size_t len;\r\n    ScopedMem<char> pdfData(file::ReadAll(tmpFile, &len));\r\n    if (!pdfData)\r\n        return nullptr;\r\n\r\n    ScopedComPtr<IStream> stream(CreateStreamFromData(pdfData, len));\r\n    if (!stream)\r\n        return nullptr;\r\n\r\n    return PdfEngine::CreateFromStream(stream);\r\n}\r\n\r\nstatic BaseEngine *psgz2pdf(const WCHAR *fileName)\r\n{\r\n    ScopedMem<WCHAR> tmpFile(path::GetTempPath(L\"PsE\"));\r\n    ScopedFile tmpFileScope(tmpFile);\r\n    if (!tmpFile)\r\n        return nullptr;\r\n\r\n    gzFile inFile = gzopen_w(fileName, \"rb\");\r\n    if (!inFile)\r\n        return nullptr;\r\n    FILE *outFile = nullptr;\r\n    errno_t err = _wfopen_s(&outFile, tmpFile, L\"wb\");\r\n    if (err != 0 || !outFile) {\r\n        gzclose(inFile);\r\n        return nullptr;\r\n    }\r\n\r\n    char buffer[12*1024];\r\n    for (;;) {\r\n        int len = gzread(inFile, buffer, sizeof(buffer));\r\n        if (len <= 0)\r\n            break;\r\n        fwrite(buffer, 1, len, outFile);\r\n    }\r\n    fclose(outFile);\r\n    gzclose(inFile);\r\n\r\n    return ps2pdf(tmpFile);\r\n}\r\n\r\n// PsEngineImpl is mostly a proxy for a PdfEngine that's fed whatever\r\n// the ps2pdf conversion from Ghostscript returns\r\nclass PsEngineImpl : public BaseEngine {\r\npublic:\r\n    PsEngineImpl() : fileName(nullptr), pdfEngine(nullptr) { }\r\n    virtual ~PsEngineImpl() {\r\n        delete pdfEngine;\r\n    }\r\n    BaseEngine *Clone() override {\r\n        BaseEngine *newEngine = pdfEngine->Clone();\r\n        if (!newEngine)\r\n            return nullptr;\r\n        PsEngineImpl *clone = new PsEngineImpl();\r\n        if (fileName)\r\n            clone->fileName.Set(str::Dup(fileName));\r\n        clone->pdfEngine = newEngine;\r\n        return clone;\r\n    }\r\n\r\n    const WCHAR *FileName() const override { return fileName; };\r\n    int PageCount() const override {\r\n        return pdfEngine->PageCount();\r\n    }\r\n\r\n    RectD PageMediabox(int pageNo) override {\r\n        return pdfEngine->PageMediabox(pageNo);\r\n    }\r\n    RectD PageContentBox(int pageNo, RenderTarget target=Target_View) override {\r\n        return pdfEngine->PageContentBox(pageNo, target);\r\n    }\r\n\r\n    RenderedBitmap *RenderBitmap(int pageNo, float zoom, int rotation,\r\n                         RectD *pageRect=nullptr, /* if nullptr: defaults to the page's mediabox */\r\n                         RenderTarget target=Target_View, AbortCookie **cookie_out=nullptr) override {\r\n        return pdfEngine->RenderBitmap(pageNo, zoom, rotation, pageRect, target, cookie_out);\r\n    }\r\n\r\n    PointD Transform(PointD pt, int pageNo, float zoom, int rotation, bool inverse=false) override {\r\n        return pdfEngine->Transform(pt, pageNo, zoom, rotation, inverse);\r\n    }\r\n    RectD Transform(RectD rect, int pageNo, float zoom, int rotation, bool inverse=false) override {\r\n        return pdfEngine->Transform(rect, pageNo, zoom, rotation, inverse);\r\n    }\r\n\r\n    unsigned char *GetFileData(size_t *cbCount) override {\r\n        return (unsigned char *)file::ReadAll(fileName, cbCount);\r\n    }\r\n    bool SaveFileAs(const WCHAR *copyFileName, bool includeUserAnnots=false) override {\r\n        UNUSED(includeUserAnnots);\r\n        return fileName ? CopyFile(fileName, copyFileName, FALSE) : false;\r\n    }\r\n    bool SaveFileAsPDF(const WCHAR *pdfFileName, bool includeUserAnnots=false) override {\r\n        return pdfEngine->SaveFileAs(pdfFileName, includeUserAnnots);\r\n    }\r\n    WCHAR * ExtractPageText(int pageNo, const WCHAR *lineSep, RectI **coordsOut=nullptr,\r\n                                    RenderTarget target=Target_View) override {\r\n        return pdfEngine->ExtractPageText(pageNo, lineSep, coordsOut, target);\r\n    }\r\n    bool HasClipOptimizations(int pageNo) override {\r\n        return pdfEngine->HasClipOptimizations(pageNo);\r\n    }\r\n    PageLayoutType PreferredLayout() override {\r\n        return pdfEngine->PreferredLayout();\r\n    }\r\n    WCHAR *GetProperty(DocumentProperty prop) override {\r\n        // omit properties created by Ghostscript\r\n        if (!pdfEngine || Prop_CreationDate == prop || Prop_ModificationDate == prop ||\r\n            Prop_PdfVersion == prop || Prop_PdfProducer == prop || Prop_PdfFileStructure == prop) {\r\n            return nullptr;\r\n        }\r\n        return pdfEngine->GetProperty(prop);\r\n    }\r\n\r\n    bool SupportsAnnotation(bool forSaving=false) const override {\r\n        return !forSaving && pdfEngine->SupportsAnnotation();\r\n    }\r\n    void UpdateUserAnnotations(Vec<PageAnnotation> *list) override {\r\n        pdfEngine->UpdateUserAnnotations(list);\r\n    }\r\n\r\n    bool AllowsPrinting() const override {\r\n        return pdfEngine->AllowsPrinting();\r\n    }\r\n    bool AllowsCopyingText() const override {\r\n        return pdfEngine->AllowsCopyingText();\r\n    }\r\n\r\n    float GetFileDPI() const override {\r\n        return pdfEngine->GetFileDPI();\r\n    }\r\n    const WCHAR *GetDefaultFileExt() const override {\r\n        return !str::EndsWithI(fileName, L\".eps\") ? L\".ps\" : L\".eps\";\r\n    }\r\n\r\n    bool BenchLoadPage(int pageNo) override {\r\n        return pdfEngine->BenchLoadPage(pageNo);\r\n    }\r\n\r\n    Vec<PageElement *> *GetElements(int pageNo) override {\r\n        return pdfEngine->GetElements(pageNo);\r\n    }\r\n    PageElement *GetElementAtPos(int pageNo, PointD pt) override {\r\n        return pdfEngine->GetElementAtPos(pageNo, pt);\r\n    }\r\n\r\n    PageDestination *GetNamedDest(const WCHAR *name) override {\r\n        return pdfEngine->GetNamedDest(name);\r\n    }\r\n    bool HasTocTree() const override {\r\n        return pdfEngine->HasTocTree();\r\n    }\r\n    DocTocItem *GetTocTree() override {\r\n        return pdfEngine->GetTocTree();\r\n    }\r\n\r\n    char *GetDecryptionKey() const override {\r\n        return pdfEngine->GetDecryptionKey();\r\n    }\r\n\r\n    static BaseEngine *CreateFromFile(const WCHAR *fileName);\r\n\r\nprotected:\r\n    ScopedMem<WCHAR> fileName;\r\n    BaseEngine *pdfEngine;\r\n\r\n    bool Load(const WCHAR *fileName) {\r\n        AssertCrash(!this->fileName && !pdfEngine);\r\n        if (!fileName)\r\n            return false;\r\n        this->fileName.Set(str::Dup(fileName));\r\n        if (file::StartsWith(fileName, \"\\x1F\\x8B\"))\r\n            pdfEngine = psgz2pdf(fileName);\r\n        else\r\n            pdfEngine = ps2pdf(fileName);\r\n        return pdfEngine != nullptr;\r\n    }\r\n};\r\n\r\nBaseEngine *PsEngineImpl::CreateFromFile(const WCHAR *fileName)\r\n{\r\n    PsEngineImpl *engine = new PsEngineImpl();\r\n    if (!engine->Load(fileName)) {\r\n        delete engine;\r\n        return nullptr;\r\n    }\r\n    return engine;\r\n}\r\n\r\nnamespace PsEngine {\r\n\r\nbool IsAvailable()\r\n{\r\n    ScopedMem<WCHAR> gswin32c(GetGhostscriptPath());\r\n    return gswin32c.Get() != nullptr;\r\n}\r\n\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff)\r\n{\r\n    if (!IsAvailable())\r\n        return false;\r\n\r\n    if (sniff) {\r\n        char header[2048] = { 0 };\r\n        file::ReadN(fileName, header, sizeof(header) - 1);\r\n        if (str::StartsWith(header, \"\\xC5\\xD0\\xD3\\xC6\")) {\r\n            // Windows-format EPS file - cf. http://partners.adobe.com/public/developer/en/ps/5002.EPSF_Spec.pdf\r\n            DWORD psStart = ByteReader(header, sizeof(header)).DWordLE(4);\r\n            return psStart >= sizeof(header) - 12 || str::StartsWith(header + psStart, \"%!PS-Adobe-\");\r\n        }\r\n        return str::StartsWith(header, \"%!\") ||\r\n               // also sniff PJL (Printer Job Language) files containing Postscript data\r\n               str::StartsWith(header, \"\\x1B%-12345X@PJL\") && str::Find(header, \"\\n%!PS-Adobe-\");\r\n    }\r\n\r\n    return str::EndsWithI(fileName, L\".ps\") ||\r\n           str::EndsWithI(fileName, L\".ps.gz\") ||\r\n           str::EndsWithI(fileName, L\".eps\");\r\n}\r\n\r\nBaseEngine *CreateFromFile(const WCHAR *fileName)\r\n{\r\n    return PsEngineImpl::CreateFromFile(fileName);\r\n}\r\n\r\n}\r\n"
  },
  {
    "path": "src/PsEngine.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nnamespace PsEngine {\r\n\r\nbool IsAvailable();\r\nbool IsSupportedFile(const WCHAR *fileName, bool sniff=false);\r\nBaseEngine *CreateFromFile(const WCHAR *fileName);\r\n\r\n}\r\n"
  },
  {
    "path": "src/RenderCache.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EngineManager.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"DisplayModel.h\"\r\n#include \"GlobalPrefs.h\"\r\n#include \"RenderCache.h\"\r\n#include \"TextSelection.h\"\r\n\r\n#pragma warning(disable: 28159) // silence /analyze: Consider using 'GetTickCount64' instead of 'GetTickCount'\r\n\r\n// TODO: remove this and always conserve memory?\r\n/* Define if you want to conserve memory by always freeing cached bitmaps\r\n   for pages not visible. Disabling this might lead to pages not rendering\r\n   due to insufficient (GDI) memory. */\r\n#define CONSERVE_MEMORY\r\n\r\n// define to view the tile boundaries\r\n#undef SHOW_TILE_LAYOUT\r\n\r\nRenderCache::RenderCache()\r\n    : cacheCount(0), requestCount(0),\r\n      maxTileSize(GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN)),\r\n      isRemoteSession(GetSystemMetrics(SM_REMOTESESSION))\r\n{\r\n    textColor = WIN_COL_BLACK;\r\n    backgroundColor = WIN_COL_WHITE;\r\n\r\n    InitializeCriticalSection(&cacheAccess);\r\n    InitializeCriticalSection(&requestAccess);\r\n\r\n    startRendering = CreateEvent(nullptr, FALSE, FALSE, nullptr);\r\n    renderThread = CreateThread(nullptr, 0, RenderCacheThread, this, 0, 0);\r\n    assert(nullptr != renderThread);\r\n}\r\n\r\nRenderCache::~RenderCache()\r\n{\r\n    EnterCriticalSection(&requestAccess);\r\n    EnterCriticalSection(&cacheAccess);\r\n\r\n    CloseHandle(renderThread);\r\n    CloseHandle(startRendering);\r\n    assert(!curReq && 0 == requestCount && 0 == cacheCount);\r\n\r\n    LeaveCriticalSection(&cacheAccess);\r\n    DeleteCriticalSection(&cacheAccess);\r\n    LeaveCriticalSection(&requestAccess);\r\n    DeleteCriticalSection(&requestAccess);\r\n}\r\n\r\n/* Find a bitmap for a page defined by <dm> and <pageNo> and optionally also\r\n   <rotation> and <zoom> in the cache - call DropCacheEntry when you\r\n   no longer need a found entry. */\r\nBitmapCacheEntry *RenderCache::Find(DisplayModel *dm, int pageNo, int rotation, float zoom, TilePosition *tile)\r\n{\r\n    ScopedCritSec scope(&cacheAccess);\r\n    rotation = NormalizeRotation(rotation);\r\n    for (int i = 0; i < cacheCount; i++) {\r\n        BitmapCacheEntry *entry = cache[i];\r\n        if ((dm == entry->dm) && (pageNo == entry->pageNo) && (rotation == entry->rotation) &&\r\n            (INVALID_ZOOM == zoom || zoom == entry->zoom) && (!tile || entry->tile == *tile)) {\r\n            entry->refs++;\r\n            return entry;\r\n        }\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nbool RenderCache::Exists(DisplayModel *dm, int pageNo, int rotation, float zoom, TilePosition *tile)\r\n{\r\n    BitmapCacheEntry *entry = Find(dm, pageNo, rotation, zoom, tile);\r\n    if (entry)\r\n        DropCacheEntry(entry);\r\n    return entry != nullptr;\r\n}\r\n\r\nvoid RenderCache::DropCacheEntry(BitmapCacheEntry *entry)\r\n{\r\n    ScopedCritSec scope(&cacheAccess);\r\n    assert(entry);\r\n    if (!entry) return;\r\n    if (0 == --entry->refs) {\r\n        delete entry;\r\n    }\r\n}\r\n\r\nvoid RenderCache::Add(PageRenderRequest &req, RenderedBitmap *bitmap)\r\n{\r\n    ScopedCritSec scope(&cacheAccess);\r\n    assert(req.dm);\r\n\r\n    req.rotation = NormalizeRotation(req.rotation);\r\n    assert(cacheCount <= MAX_BITMAPS_CACHED);\r\n\r\n    /* It's possible there still is a cached bitmap with different zoom/rotation */\r\n    FreePage(req.dm, req.pageNo, &req.tile);\r\n\r\n    if (cacheCount >= MAX_BITMAPS_CACHED) {\r\n        // free an invisible page of the same DisplayModel ...\r\n        for (int i = 0; i < cacheCount; i++) {\r\n            if (cache[i]->dm == req.dm && !req.dm->PageVisibleNearby(cache[i]->pageNo)) {\r\n                DropCacheEntry(cache[i]);\r\n                cacheCount--;\r\n                memmove(&cache[i], &cache[i + 1], (cacheCount - i) * sizeof(cache[0]));\r\n                break;\r\n            }\r\n        }\r\n        // ... or just the oldest cached page\r\n        if (cacheCount >= MAX_BITMAPS_CACHED) {\r\n            DropCacheEntry(cache[0]);\r\n            cacheCount--;\r\n            memmove(&cache[0], &cache[1], cacheCount * sizeof(cache[0]));\r\n        }\r\n    }\r\n\r\n    // Copy the PageRenderRequest as it will be reused\r\n    cache[cacheCount] = new BitmapCacheEntry(req.dm, req.pageNo, req.rotation, req.zoom, req.tile, bitmap);\r\n    CrashIf(!cache[cacheCount]);\r\n    if (!cache[cacheCount])\r\n        delete bitmap;\r\n    else\r\n        cacheCount++;\r\n}\r\n\r\nstatic RectD GetTileRect(RectD pagerect, TilePosition tile)\r\n{\r\n    CrashIf(tile.res > 30);\r\n    RectD rect;\r\n    rect.dx = pagerect.dx / (1ULL << tile.res);\r\n    rect.dy = pagerect.dy / (1ULL << tile.res);\r\n    rect.x = pagerect.x + tile.col * rect.dx;\r\n    rect.y = pagerect.y + ((1ULL << tile.res) - tile.row - 1) * rect.dy;\r\n    return rect;\r\n}\r\n\r\n// get the coordinates of a specific tile\r\nstatic RectI GetTileRectDevice(BaseEngine *engine, int pageNo, int rotation, float zoom, TilePosition tile)\r\n{\r\n    RectD mediabox = engine->PageMediabox(pageNo);\r\n    if (tile.res > 0 && tile.res != INVALID_TILE_RES)\r\n        mediabox = GetTileRect(mediabox, tile);\r\n    RectD pixelbox = engine->Transform(mediabox, pageNo, zoom, rotation);\r\n    return pixelbox.Round();\r\n}\r\n\r\nstatic RectD GetTileRectUser(BaseEngine *engine, int pageNo, int rotation, float zoom, TilePosition tile)\r\n{\r\n    RectI pixelbox = GetTileRectDevice(engine, pageNo, rotation, zoom, tile);\r\n    return engine->Transform(pixelbox.Convert<double>(), pageNo, zoom, rotation, true);\r\n}\r\n\r\nstatic RectI GetTileOnScreen(BaseEngine *engine, int pageNo, int rotation, float zoom, TilePosition tile, RectI pageOnScreen)\r\n{\r\n    RectI bbox = GetTileRectDevice(engine, pageNo, rotation, zoom, tile);\r\n    bbox.Offset(pageOnScreen.x, pageOnScreen.y);\r\n    return bbox;\r\n}\r\n\r\nstatic bool IsTileVisible(DisplayModel *dm, int pageNo, TilePosition tile, float fuzz=0)\r\n{\r\n    if (!dm) return false;\r\n    PageInfo *pageInfo = dm->GetPageInfo(pageNo);\r\n    if (!dm->GetEngine() || !pageInfo) return false;\r\n    RectI tileOnScreen = GetTileOnScreen(dm->GetEngine(), pageNo, dm->GetRotation(), dm->GetZoomReal(), tile, pageInfo->pageOnScreen);\r\n    // consider nearby tiles visible depending on the fuzz factor\r\n    tileOnScreen.x -= (int)(tileOnScreen.dx * fuzz * 0.5);\r\n    tileOnScreen.dx = (int)(tileOnScreen.dx * (fuzz + 1));\r\n    tileOnScreen.y -= (int)(tileOnScreen.dy * fuzz * 0.5);\r\n    tileOnScreen.dy = (int)(tileOnScreen.dy * (fuzz + 1));\r\n    RectI screen(PointI(), dm->GetViewPort().Size());\r\n    return !tileOnScreen.Intersect(screen).IsEmpty();\r\n}\r\n\r\n/* Free all bitmaps in the cache that are of a specific page (or all pages\r\n   of the given DisplayModel, or even all invisible pages). */\r\nvoid RenderCache::FreePage(DisplayModel *dm, int pageNo, TilePosition *tile)\r\n{\r\n    ScopedCritSec scope(&cacheAccess);\r\n    int cacheCountTmp = cacheCount;\r\n    int curPos = 0;\r\n\r\n    for (int i = 0; i < cacheCountTmp; i++) {\r\n        BitmapCacheEntry* entry = cache[i];\r\n        bool shouldFree;\r\n        if (dm && pageNo != INVALID_PAGE_NO) {\r\n            // a specific page\r\n            shouldFree = (entry->dm == dm) && (entry->pageNo == pageNo);\r\n            if (tile) {\r\n                // a given tile of the page or all tiles not rendered at a given resolution\r\n                // (and at resolution 0 for quick zoom previews)\r\n                shouldFree = shouldFree && (entry->tile == *tile ||\r\n                    tile->row == (USHORT)-1 && entry->tile.res > 0 && entry->tile.res != tile->res ||\r\n                    tile->row == (USHORT)-1 && entry->tile.res == 0 && entry->outOfDate);\r\n            }\r\n        } else if (dm) {\r\n            // all pages of this DisplayModel\r\n            shouldFree = (cache[i]->dm == dm);\r\n        } else {\r\n            // all invisible pages resp. page tiles\r\n            shouldFree = !entry->dm->PageVisibleNearby(entry->pageNo);\r\n            if (!shouldFree && entry->tile.res > 1)\r\n                shouldFree = !IsTileVisible(entry->dm, entry->pageNo, entry->tile, 2.0);\r\n        }\r\n\r\n        if (shouldFree) {\r\n            DropCacheEntry(entry);\r\n            cache[i] = nullptr;\r\n            cacheCount--;\r\n        }\r\n\r\n        if (curPos != i)\r\n            cache[curPos] = cache[i];\r\n        if (!shouldFree)\r\n            curPos++;\r\n    }\r\n}\r\n\r\n// keep the cached bitmaps for visible pages to avoid flickering during a reload.\r\n// mark invisible pages as out-of-date to prevent inconsistencies\r\nvoid RenderCache::KeepForDisplayModel(DisplayModel *oldDm, DisplayModel *newDm)\r\n{\r\n    ScopedCritSec scope(&cacheAccess);\r\n    for (int i = 0; i < cacheCount; i++) {\r\n        if (cache[i]->dm == oldDm) {\r\n            if (oldDm->PageVisible(cache[i]->pageNo))\r\n                cache[i]->dm = newDm;\r\n            // make sure that the page is rerendered eventually\r\n            cache[i]->zoom = INVALID_ZOOM;\r\n            cache[i]->outOfDate = true;\r\n        }\r\n    }\r\n}\r\n\r\n// marks all tiles containing rect of pageNo as out of date\r\nvoid RenderCache::Invalidate(DisplayModel *dm, int pageNo, RectD rect)\r\n{\r\n    ScopedCritSec scopeReq(&requestAccess);\r\n\r\n    ClearQueueForDisplayModel(dm, pageNo);\r\n    if (curReq && curReq->dm == dm && curReq->pageNo == pageNo)\r\n        AbortCurrentRequest();\r\n\r\n    ScopedCritSec scopeCache(&cacheAccess);\r\n\r\n    RectD mediabox = dm->GetEngine()->PageMediabox(pageNo);\r\n    for (int i = 0; i < cacheCount; i++) {\r\n        if (cache[i]->dm == dm && cache[i]->pageNo == pageNo &&\r\n            !GetTileRect(mediabox, cache[i]->tile).Intersect(rect).IsEmpty()) {\r\n            cache[i]->zoom = INVALID_ZOOM;\r\n            cache[i]->outOfDate = true;\r\n        }\r\n    }\r\n}\r\n\r\n// determine the count of tiles required for a page at a given zoom level\r\nUSHORT RenderCache::GetTileRes(DisplayModel *dm, int pageNo)\r\n{\r\n    RectD mediabox = dm->GetEngine()->PageMediabox(pageNo);\r\n    RectD pixelbox = dm->GetEngine()->Transform(mediabox, pageNo, dm->GetZoomReal(), dm->GetRotation());\r\n\r\n    float factorW = (float)pixelbox.dx / (maxTileSize.dx + 1);\r\n    float factorH = (float)pixelbox.dy / (maxTileSize.dy + 1);\r\n    // using the geometric mean instead of the maximum factor\r\n    // so that the tile area doesn't get too small in comparison\r\n    // to maxTileSize (but remains smaller)\r\n    float factorAvg = sqrtf(factorW * factorH);\r\n\r\n    // use larger tiles when fitting page or width or when a page is smaller\r\n    // than the visible canvas width/height or when rendering pages\r\n    // without clipping optimizations\r\n    if (dm->GetZoomVirtual() == ZOOM_FIT_PAGE || dm->GetZoomVirtual() == ZOOM_FIT_WIDTH ||\r\n        pixelbox.dx <= dm->GetViewPort().dx || pixelbox.dy < dm->GetViewPort().dy ||\r\n        !dm->GetEngine()->HasClipOptimizations(pageNo)) {\r\n        factorAvg /= 2.0;\r\n    }\r\n\r\n    USHORT res = 0;\r\n    if (factorAvg > 1.5)\r\n        res = (USHORT)ceilf(log(factorAvg) / log(2.0f));\r\n    // limit res to 30, so that (1 << res) doesn't overflow for 32-bit signed int\r\n    return std::min(res, (USHORT)30);\r\n}\r\n\r\n// get the maximum resolution available for the given page\r\nUSHORT RenderCache::GetMaxTileRes(DisplayModel *dm, int pageNo, int rotation)\r\n{\r\n    ScopedCritSec scope(&cacheAccess);\r\n    USHORT maxRes = 0;\r\n    for (int i = 0; i < cacheCount; i++) {\r\n        if (cache[i]->dm == dm && cache[i]->pageNo == pageNo &&\r\n            cache[i]->rotation == rotation) {\r\n            maxRes = std::max(cache[i]->tile.res, maxRes);\r\n        }\r\n    }\r\n    return maxRes;\r\n}\r\n\r\n// reduce the size of tiles in order to hopefully use less memory overall\r\nbool RenderCache::ReduceTileSize()\r\n{\r\n    fprintf(stderr, \"RenderCache: reducing tile size (current: %d x %d)\\n\", maxTileSize.dx, maxTileSize.dy);\r\n    if (maxTileSize.dx < 200 || maxTileSize.dy < 200)\r\n        return false;\r\n\r\n    ScopedCritSec scope1(&requestAccess);\r\n    ScopedCritSec scope2(&cacheAccess);\r\n\r\n    if (maxTileSize.dx > maxTileSize.dy)\r\n        maxTileSize.dx /= 2;\r\n    else\r\n        maxTileSize.dy /= 2;\r\n\r\n    // invalidate all rendered bitmaps and all requests\r\n    while (cacheCount > 0)\r\n        FreeForDisplayModel(cache[0]->dm);\r\n    while (requestCount > 0)\r\n        ClearQueueForDisplayModel(requests[0].dm);\r\n    AbortCurrentRequest();\r\n\r\n    return true;\r\n}\r\n\r\nvoid RenderCache::RequestRendering(DisplayModel *dm, int pageNo)\r\n{\r\n    TilePosition tile(GetTileRes(dm, pageNo), 0, 0);\r\n    // only honor the request if there's a good chance that the\r\n    // rendered tile will actually be used\r\n    if (tile.res > 1)\r\n        return;\r\n\r\n    RequestRendering(dm, pageNo, tile);\r\n    // render both tiles of the first row when splitting a page in four\r\n    // (which always happens on larger displays for Fit Width)\r\n    if (tile.res == 1 && !IsRenderQueueFull()) {\r\n        tile.col = 1;\r\n        RequestRendering(dm, pageNo, tile, false);\r\n    }\r\n}\r\n\r\n/* Render a bitmap for page <pageNo> in <dm>. */\r\nvoid RenderCache::RequestRendering(DisplayModel *dm, int pageNo, TilePosition tile, bool clearQueueForPage)\r\n{\r\n    ScopedCritSec scope(&requestAccess);\r\n    assert(dm);\r\n    if (!dm || dm->dontRenderFlag)\r\n        return;\r\n\r\n    int rotation = NormalizeRotation(dm->GetRotation());\r\n    float zoom = dm->GetZoomReal(pageNo);\r\n\r\n    if (curReq && (curReq->pageNo == pageNo) && (curReq->dm == dm) && (curReq->tile == tile)) {\r\n        if ((curReq->zoom == zoom) && (curReq->rotation == rotation)) {\r\n            /* we're already rendering exactly the same page */\r\n            return;\r\n        }\r\n        /* Currently rendered page is for the same page but with different zoom\r\n        or rotation, so abort it */\r\n        AbortCurrentRequest();\r\n    }\r\n\r\n    // clear requests for tiles of different resolution and invisible tiles\r\n    if (clearQueueForPage)\r\n        ClearQueueForDisplayModel(dm, pageNo, &tile);\r\n\r\n    for (int i = 0; i < requestCount; i++) {\r\n        PageRenderRequest* req = &(requests[i]);\r\n        if ((req->pageNo == pageNo) && (req->dm == dm) && (req->tile == tile)) {\r\n            if ((req->zoom == zoom) && (req->rotation == rotation)) {\r\n                /* Request with exactly the same parameters already queued for\r\n                   rendering. Move it to the top of the queue so that it'll\r\n                   be rendered faster. */\r\n                PageRenderRequest tmp;\r\n                tmp = requests[requestCount-1];\r\n                requests[requestCount-1] = *req;\r\n                *req = tmp;\r\n            } else {\r\n                /* There was a request queued for the same page but with different\r\n                   zoom or rotation, so only replace this request */\r\n                req->zoom = zoom;\r\n                req->rotation = rotation;\r\n            }\r\n            return;\r\n        }\r\n    }\r\n\r\n    if (Exists(dm, pageNo, rotation, zoom, &tile)) {\r\n        /* This page has already been rendered in the correct dimensions\r\n           and isn't about to be rerendered in different dimensions */\r\n        return;\r\n    }\r\n\r\n    Render(dm, pageNo, rotation, zoom, &tile);\r\n}\r\n\r\nvoid RenderCache::Render(DisplayModel *dm, int pageNo, int rotation, float zoom, RectD pageRect, RenderingCallback& callback)\r\n{\r\n    bool ok = Render(dm, pageNo, rotation, zoom, nullptr, &pageRect, &callback);\r\n    if (!ok)\r\n        callback.Callback();\r\n}\r\n\r\nbool RenderCache::Render(DisplayModel *dm, int pageNo, int rotation, float zoom,\r\n                         TilePosition *tile, RectD *pageRect, RenderingCallback *renderCb)\r\n{\r\n    assert(dm);\r\n    if (!dm || dm->dontRenderFlag)\r\n        return false;\r\n\r\n    assert(tile || pageRect && renderCb);\r\n    if (!tile && !(pageRect && renderCb))\r\n        return false;\r\n\r\n    ScopedCritSec scope(&requestAccess);\r\n    PageRenderRequest* newRequest;\r\n\r\n    /* add request to the queue */\r\n    if (requestCount == MAX_PAGE_REQUESTS) {\r\n        /* queue is full -> remove the oldest items on the queue */\r\n        if (requests[0].renderCb)\r\n            requests[0].renderCb->Callback();\r\n        memmove(&(requests[0]), &(requests[1]), sizeof(PageRenderRequest) * (MAX_PAGE_REQUESTS - 1));\r\n        newRequest = &(requests[MAX_PAGE_REQUESTS-1]);\r\n    } else {\r\n        newRequest = &(requests[requestCount]);\r\n        requestCount++;\r\n    }\r\n    assert(requestCount <= MAX_PAGE_REQUESTS);\r\n\r\n    newRequest->dm = dm;\r\n    newRequest->pageNo = pageNo;\r\n    newRequest->rotation = rotation;\r\n    newRequest->zoom = zoom;\r\n    if (tile) {\r\n        newRequest->pageRect = GetTileRectUser(dm->GetEngine(), pageNo, rotation, zoom, *tile);\r\n        newRequest->tile = *tile;\r\n    }\r\n    else if (pageRect) {\r\n        newRequest->pageRect = *pageRect;\r\n        // can't cache bitmaps that aren't for a given tile\r\n        assert(renderCb);\r\n    }\r\n    else\r\n        assert(0);\r\n    newRequest->abort = false;\r\n    newRequest->abortCookie = nullptr;\r\n    newRequest->timestamp = GetTickCount();\r\n    newRequest->renderCb = renderCb;\r\n\r\n    SetEvent(startRendering);\r\n\r\n    return true;\r\n}\r\n\r\nUINT RenderCache::GetRenderDelay(DisplayModel *dm, int pageNo, TilePosition tile)\r\n{\r\n    ScopedCritSec scope(&requestAccess);\r\n\r\n    if (curReq && curReq->pageNo == pageNo && curReq->dm == dm && curReq->tile == tile)\r\n        return GetTickCount() - curReq->timestamp;\r\n\r\n    for (int i = 0; i < requestCount; i++)\r\n        if (requests[i].pageNo == pageNo && requests[i].dm == dm && requests[i].tile == tile)\r\n            return GetTickCount() - requests[i].timestamp;\r\n\r\n    return RENDER_DELAY_UNDEFINED;\r\n}\r\n\r\nbool RenderCache::GetNextRequest(PageRenderRequest *req)\r\n{\r\n    ScopedCritSec scope(&requestAccess);\r\n\r\n    if (requestCount == 0)\r\n        return false;\r\n\r\n    assert(requestCount > 0);\r\n    assert(requestCount <= MAX_PAGE_REQUESTS);\r\n    requestCount--;\r\n    *req = requests[requestCount];\r\n    curReq = req;\r\n    assert(requestCount >= 0);\r\n    assert(!req->abort);\r\n\r\n    return true;\r\n}\r\n\r\nbool RenderCache::ClearCurrentRequest()\r\n{\r\n    ScopedCritSec scope(&requestAccess);\r\n    if (curReq)\r\n        delete curReq->abortCookie;\r\n    curReq = nullptr;\r\n\r\n    bool isQueueEmpty = requestCount == 0;\r\n    return isQueueEmpty;\r\n}\r\n\r\n/* Wait until rendering of a page beloging to <dm> has finished. */\r\n/* TODO: this might take some time, would be good to show a dialog to let the\r\n   user know he has to wait until we finish */\r\nvoid RenderCache::CancelRendering(DisplayModel *dm)\r\n{\r\n    ClearQueueForDisplayModel(dm);\r\n\r\n    for (;;) {\r\n        EnterCriticalSection(&requestAccess);\r\n        if (!curReq || (curReq->dm != dm)) {\r\n            // to be on the safe side\r\n            ClearQueueForDisplayModel(dm);\r\n            LeaveCriticalSection(&requestAccess);\r\n            return;\r\n        }\r\n\r\n        AbortCurrentRequest();\r\n        LeaveCriticalSection(&requestAccess);\r\n\r\n        /* TODO: busy loop is not good, but I don't have a better idea */\r\n        Sleep(50);\r\n    }\r\n}\r\n\r\nvoid RenderCache::ClearQueueForDisplayModel(DisplayModel *dm, int pageNo, TilePosition *tile)\r\n{\r\n    ScopedCritSec scope(&requestAccess);\r\n    int reqCount = requestCount;\r\n    int curPos = 0;\r\n    for (int i = 0; i < reqCount; i++) {\r\n        PageRenderRequest *req = &(requests[i]);\r\n        bool shouldRemove = req->dm == dm && (pageNo == INVALID_PAGE_NO || req->pageNo == pageNo) &&\r\n            (!tile || req->tile.res != tile->res || !IsTileVisible(dm, req->pageNo, *tile, 0.5));\r\n        if (i != curPos)\r\n            requests[curPos] = requests[i];\r\n        if (shouldRemove) {\r\n            if (req->renderCb)\r\n                req->renderCb->Callback();\r\n            requestCount--;\r\n        } else\r\n            curPos++;\r\n    }\r\n}\r\n\r\nvoid RenderCache::AbortCurrentRequest()\r\n{\r\n    ScopedCritSec scope(&requestAccess);\r\n    if (!curReq)\r\n        return;\r\n    if (curReq->abortCookie)\r\n        curReq->abortCookie->Abort();\r\n    curReq->abort = true;\r\n}\r\n\r\nDWORD WINAPI RenderCache::RenderCacheThread(LPVOID data)\r\n{\r\n    RenderCache *cache = (RenderCache *)data;\r\n    PageRenderRequest   req;\r\n    RenderedBitmap *    bmp;\r\n\r\n    for (;;) {\r\n        if (cache->ClearCurrentRequest()) {\r\n            DWORD waitResult = WaitForSingleObject(cache->startRendering, INFINITE);\r\n            // Is it not a page render request?\r\n            if (WAIT_OBJECT_0 != waitResult)\r\n                continue;\r\n        }\r\n\r\n        if (!cache->GetNextRequest(&req))\r\n            continue;\r\n        if (!req.dm->PageVisibleNearby(req.pageNo) && !req.renderCb)\r\n            continue;\r\n        if (req.dm->dontRenderFlag) {\r\n            if (req.renderCb)\r\n                req.renderCb->Callback();\r\n            continue;\r\n        }\r\n\r\n        // make sure that we have extracted page text for\r\n        // all rendered pages to allow text selection and\r\n        // searching without any further delays\r\n        if (!req.dm->textCache->HasData(req.pageNo))\r\n            req.dm->textCache->GetData(req.pageNo);\r\n\r\n        CrashIf(req.abortCookie != nullptr);\r\n        bmp = req.dm->GetEngine()->RenderBitmap(req.pageNo, req.zoom, req.rotation, &req.pageRect, Target_View, &req.abortCookie);\r\n        if (req.abort) {\r\n            delete bmp;\r\n            if (req.renderCb)\r\n                req.renderCb->Callback();\r\n            continue;\r\n        }\r\n\r\n        if (req.renderCb) {\r\n            // the callback must free the RenderedBitmap\r\n            req.renderCb->Callback(bmp);\r\n            req.renderCb = (RenderingCallback *)1; // will crash if accessed again, which should not happen\r\n        }\r\n        else {\r\n            // don't replace colors for individual images\r\n            if (bmp && !req.dm->GetEngine()->IsImageCollection())\r\n                UpdateBitmapColors(bmp->GetBitmap(), cache->textColor, cache->backgroundColor);\r\n            cache->Add(req, bmp);\r\n            req.dm->RepaintDisplay();\r\n        }\r\n    }\r\n}\r\n\r\n// TODO: conceptually, RenderCache is not the right place for code that paints\r\n//       (this is the only place that knows about Tiles, though)\r\nUINT RenderCache::PaintTile(HDC hdc, RectI bounds, DisplayModel *dm, int pageNo,\r\n                            TilePosition tile, RectI tileOnScreen, bool renderMissing,\r\n                            bool *renderOutOfDateCue, bool *renderedReplacement)\r\n{\r\n    BitmapCacheEntry *entry = Find(dm, pageNo, dm->GetRotation(), dm->GetZoomReal(), &tile);\r\n    UINT renderDelay = 0;\r\n\r\n    if (!entry) {\r\n        if (!isRemoteSession) {\r\n            if (renderedReplacement)\r\n                *renderedReplacement = true;\r\n            entry = Find(dm, pageNo, dm->GetRotation(), INVALID_ZOOM, &tile);\r\n        }\r\n        renderDelay = GetRenderDelay(dm, pageNo, tile);\r\n        if (renderMissing && RENDER_DELAY_UNDEFINED == renderDelay && !IsRenderQueueFull())\r\n            RequestRendering(dm, pageNo, tile);\r\n    }\r\n    RenderedBitmap *renderedBmp = entry ? entry->bitmap : nullptr;\r\n    HBITMAP hbmp = renderedBmp ? renderedBmp->GetBitmap() : nullptr;\r\n\r\n    if (!hbmp) {\r\n        if (entry && !(renderedBmp && ReduceTileSize()))\r\n            renderDelay = RENDER_DELAY_FAILED;\r\n        else if (0 == renderDelay)\r\n            renderDelay = 1;\r\n        if (entry)\r\n            DropCacheEntry(entry);\r\n        return renderDelay;\r\n    }\r\n\r\n    HDC bmpDC = CreateCompatibleDC(hdc);\r\n    if (bmpDC) {\r\n        SizeI bmpSize = renderedBmp->Size();\r\n        int xSrc = -std::min(tileOnScreen.x, 0);\r\n        int ySrc = -std::min(tileOnScreen.y, 0);\r\n        float factor = std::min(1.0f * bmpSize.dx / tileOnScreen.dx, 1.0f * bmpSize.dy / tileOnScreen.dy);\r\n\r\n        HGDIOBJ prevBmp = SelectObject(bmpDC, hbmp);\r\n        if (factor != 1.0f)\r\n            StretchBlt(hdc, bounds.x, bounds.y, bounds.dx, bounds.dy,\r\n                bmpDC, (int)(xSrc * factor), (int)(ySrc * factor),\r\n                (int)(bounds.dx * factor), (int)(bounds.dy * factor), SRCCOPY);\r\n        else\r\n            BitBlt(hdc, bounds.x, bounds.y, bounds.dx, bounds.dy,\r\n                bmpDC, xSrc, ySrc, SRCCOPY);\r\n\r\n        SelectObject(bmpDC, prevBmp);\r\n        DeleteDC(bmpDC);\r\n\r\n#ifdef SHOW_TILE_LAYOUT\r\n        HPEN pen = CreatePen(PS_SOLID, 1, RGB(0xff, 0xff, 0x00));\r\n        HGDIOBJ oldPen = SelectObject(hdc, pen);\r\n        PaintRect(hdc, bounds);\r\n        DeletePen(SelectObject(hdc, oldPen));\r\n#endif\r\n    }\r\n\r\n    if (entry->outOfDate) {\r\n        if (renderOutOfDateCue)\r\n            *renderOutOfDateCue = true;\r\n        CrashIf(renderedReplacement && !*renderedReplacement);\r\n    }\r\n\r\n    DropCacheEntry(entry);\r\n    return 0;\r\n}\r\n\r\nstatic int cmpTilePosition(const void *a, const void *b)\r\n{\r\n    const TilePosition *ta = (const TilePosition *)a, *tb = (const TilePosition *)b;\r\n    return ta->res != tb->res ? ta->res - tb->res :\r\n           ta->row != tb->row ? ta->row - tb->row :\r\n                                ta->col - tb->col;\r\n}\r\n\r\nUINT RenderCache::Paint(HDC hdc, RectI bounds, DisplayModel *dm, int pageNo,\r\n                        PageInfo *pageInfo, bool *renderOutOfDateCue)\r\n{\r\n    assert(pageInfo->shown && 0.0 != pageInfo->visibleRatio);\r\n\r\n    if (!dm->ShouldCacheRendering(pageNo)) {\r\n        int rotation = dm->GetRotation();\r\n        float zoom = dm->GetZoomReal(pageNo);\r\n        bounds = pageInfo->pageOnScreen.Intersect(bounds);\r\n\r\n        RectD area = bounds.Convert<double>();\r\n        area.Offset(-pageInfo->pageOnScreen.x, -pageInfo->pageOnScreen.y);\r\n        area = dm->GetEngine()->Transform(area, pageNo, zoom, rotation, true);\r\n\r\n        RenderedBitmap *bmp = dm->GetEngine()->RenderBitmap(pageNo, zoom, rotation, &area);\r\n        bool success = bmp && bmp->GetBitmap() && bmp->StretchDIBits(hdc, bounds);\r\n        delete bmp;\r\n\r\n        return success ? 0 : RENDER_DELAY_FAILED;\r\n    }\r\n\r\n    int rotation = dm->GetRotation();\r\n    float zoom = dm->GetZoomReal();\r\n    USHORT targetRes = GetTileRes(dm, pageNo);\r\n    USHORT maxRes = GetMaxTileRes(dm, pageNo, rotation);\r\n    if (maxRes < targetRes)\r\n        maxRes = targetRes;\r\n\r\n    Vec<TilePosition> queue;\r\n    queue.Append(TilePosition(0, 0, 0));\r\n    UINT renderDelayMin = RENDER_DELAY_UNDEFINED;\r\n    bool neededScaling = false;\r\n\r\n    while (queue.Count() > 0) {\r\n        TilePosition tile = queue.PopAt(0);\r\n        RectI tileOnScreen = GetTileOnScreen(dm->GetEngine(), pageNo, rotation, zoom, tile, pageInfo->pageOnScreen);\r\n        if (tileOnScreen.IsEmpty()) {\r\n            // display an error message when only empty tiles should be drawn (i.e. on page loading errors)\r\n            renderDelayMin = std::min(RENDER_DELAY_FAILED, renderDelayMin);\r\n            continue;\r\n        }\r\n        tileOnScreen = pageInfo->pageOnScreen.Intersect(tileOnScreen);\r\n        RectI isect = bounds.Intersect(tileOnScreen);\r\n        if (isect.IsEmpty())\r\n            continue;\r\n\r\n        bool isTargetRes = tile.res == targetRes;\r\n        UINT renderDelay = PaintTile(hdc, isect, dm, pageNo, tile, tileOnScreen, isTargetRes,\r\n                                     renderOutOfDateCue, isTargetRes ? &neededScaling : nullptr);\r\n        if (!(isTargetRes && 0 == renderDelay) && tile.res < maxRes) {\r\n            queue.Append(TilePosition(tile.res + 1, tile.row * 2, tile.col * 2));\r\n            queue.Append(TilePosition(tile.res + 1, tile.row * 2, tile.col * 2 + 1));\r\n            queue.Append(TilePosition(tile.res + 1, tile.row * 2 + 1, tile.col * 2));\r\n            queue.Append(TilePosition(tile.res + 1, tile.row * 2 + 1, tile.col * 2 + 1));\r\n        }\r\n        if (isTargetRes && renderDelay > 0)\r\n            neededScaling = true;\r\n        renderDelayMin = std::min(renderDelay, renderDelayMin);\r\n        // paint tiles from left to right from top to bottom\r\n        if (tile.res > 0 && queue.Count() > 0 && tile.res < queue.At(0).res)\r\n            queue.Sort(cmpTilePosition);\r\n    }\r\n\r\n#ifdef CONSERVE_MEMORY\r\n    if (!neededScaling) {\r\n        if (renderOutOfDateCue)\r\n            *renderOutOfDateCue = false;\r\n        // free tiles with different resolution\r\n        TilePosition tile(targetRes, (USHORT)-1, 0);\r\n        FreePage(dm, pageNo, &tile);\r\n    }\r\n    FreeNotVisible();\r\n#endif\r\n\r\n    return renderDelayMin;\r\n}\r\n"
  },
  {
    "path": "src/RenderCache.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n#define RENDER_DELAY_UNDEFINED ((UINT)-1)\r\n#define RENDER_DELAY_FAILED    ((UINT)-2)\r\n#define INVALID_TILE_RES       ((USHORT)-1)\r\n\r\n#define MAX_PAGE_REQUESTS 8\r\n// keep this value reasonably low, else we'll run out of\r\n// GDI resources/memory when caching many larger bitmaps\r\n#define MAX_BITMAPS_CACHED 64\r\n\r\nclass RenderingCallback {\r\npublic:\r\n    virtual void Callback(RenderedBitmap *bmp=nullptr) = 0;\r\n    virtual ~RenderingCallback() { }\r\n};\r\n\r\n/* A page is split into tiles of at most TILE_MAX_W x TILE_MAX_H pixels.\r\n   A given tile starts at (col / 2^res * page_width, row / 2^res * page_height). */\r\nstruct TilePosition {\r\n    USHORT res, row, col;\r\n\r\n    explicit TilePosition(USHORT res=INVALID_TILE_RES, USHORT row=-1, USHORT col=-1) :\r\n        res(res), row(row), col(col) { }\r\n    bool operator==(const TilePosition& other) const {\r\n        return res == other.res && row == other.row && col == other.col;\r\n    }\r\n};\r\n\r\n/* We keep a cache of rendered bitmaps. BitmapCacheEntry keeps data\r\n   that uniquely identifies rendered page (dm, pageNo, rotation, zoom)\r\n   and the corresponding rendered bitmap. */\r\nstruct BitmapCacheEntry {\r\n    DisplayModel *   dm;\r\n    int              pageNo;\r\n    int              rotation;\r\n    float            zoom;\r\n    TilePosition     tile;\r\n\r\n    // owned by the BitmapCacheEntry\r\n    RenderedBitmap * bitmap;\r\n    bool             outOfDate;\r\n    int              refs;\r\n\r\n    BitmapCacheEntry(DisplayModel *dm, int pageNo, int rotation, float zoom, TilePosition tile, RenderedBitmap *bitmap) :\r\n        dm(dm), pageNo(pageNo), rotation(rotation), zoom(zoom), tile(tile), bitmap(bitmap), outOfDate(false), refs(1) { }\r\n    ~BitmapCacheEntry() { delete bitmap; }\r\n};\r\n\r\n/* Even though this looks a lot like a BitmapCacheEntry, we keep it\r\n   separate for clarity in the code (PageRenderRequests are reused,\r\n   while BitmapCacheEntries are ref-counted) */\r\nstruct PageRenderRequest {\r\n    DisplayModel *      dm;\r\n    int                 pageNo;\r\n    int                 rotation;\r\n    float               zoom;\r\n    TilePosition        tile;\r\n\r\n    RectD               pageRect; // calculated from TilePosition\r\n    bool                abort;\r\n    AbortCookie *       abortCookie;\r\n    DWORD               timestamp;\r\n    // owned by the PageRenderRequest (use it before reusing the request)\r\n    // on rendering success, the callback gets handed the RenderedBitmap\r\n    RenderingCallback * renderCb;\r\n};\r\n\r\nclass RenderCache\r\n{\r\nprivate:\r\n    BitmapCacheEntry *  cache[MAX_BITMAPS_CACHED];\r\n    int                 cacheCount;\r\n    // make sure to never ask for requestAccess in a cacheAccess\r\n    // protected critical section in order to avoid deadlocks\r\n    CRITICAL_SECTION    cacheAccess;\r\n\r\n    PageRenderRequest   requests[MAX_PAGE_REQUESTS];\r\n    int                 requestCount;\r\n    PageRenderRequest * curReq;\r\n    CRITICAL_SECTION    requestAccess;\r\n    HANDLE              renderThread;\r\n\r\n    SizeI               maxTileSize;\r\n    bool                isRemoteSession;\r\n\r\npublic:\r\n    COLORREF            textColor;\r\n    COLORREF            backgroundColor;\r\n\r\n    RenderCache();\r\n    ~RenderCache();\r\n\r\n    void    RequestRendering(DisplayModel *dm, int pageNo);\r\n    void    Render(DisplayModel *dm, int pageNo, int rotation, float zoom,\r\n                   RectD pageRect, RenderingCallback& callback);\r\n    void    CancelRendering(DisplayModel *dm);\r\n    bool    Exists(DisplayModel *dm, int pageNo, int rotation,\r\n                   float zoom=INVALID_ZOOM, TilePosition *tile=nullptr);\r\n    void    FreeForDisplayModel(DisplayModel *dm) { FreePage(dm); }\r\n    void    KeepForDisplayModel(DisplayModel *oldDm, DisplayModel *newDm);\r\n    void    Invalidate(DisplayModel *dm, int pageNo, RectD rect);\r\n    // returns how much time in ms has past since the most recent rendering\r\n    // request for the visible part of the page if nothing at all could be\r\n    // painted, 0 if something has been painted and RENDER_DELAY_FAILED on failure\r\n    UINT    Paint(HDC hdc, RectI bounds, DisplayModel *dm, int pageNo,\r\n                  PageInfo *pageInfo, bool *renderOutOfDateCue);\r\n\r\nprotected:\r\n    /* Interface for page rendering thread */\r\n    HANDLE  startRendering;\r\n\r\n    bool    ClearCurrentRequest();\r\n    bool    GetNextRequest(PageRenderRequest *req);\r\n    void    Add(PageRenderRequest &req, RenderedBitmap *bitmap);\r\n\r\nprivate:\r\n    USHORT  GetTileRes(DisplayModel *dm, int pageNo);\r\n    USHORT  GetMaxTileRes(DisplayModel *dm, int pageNo, int rotation);\r\n    bool    ReduceTileSize();\r\n\r\n    bool    IsRenderQueueFull() const { return requestCount == MAX_PAGE_REQUESTS; }\r\n    UINT    GetRenderDelay(DisplayModel *dm, int pageNo, TilePosition tile);\r\n    void    RequestRendering(DisplayModel *dm, int pageNo, TilePosition tile, bool clearQueueForPage=true);\r\n    bool    Render(DisplayModel *dm, int pageNo, int rotation, float zoom,\r\n                   TilePosition *tile=nullptr, RectD *pageRect=nullptr,\r\n                   RenderingCallback *callback=nullptr);\r\n    void    ClearQueueForDisplayModel(DisplayModel *dm, int pageNo=INVALID_PAGE_NO,\r\n                                      TilePosition *tile=nullptr);\r\n    void    AbortCurrentRequest();\r\n\r\n    static DWORD WINAPI RenderCacheThread(LPVOID data);\r\n\r\n    BitmapCacheEntry *  Find(DisplayModel *dm, int pageNo, int rotation,\r\n                             float zoom=INVALID_ZOOM, TilePosition *tile=nullptr);\r\n    void    DropCacheEntry(BitmapCacheEntry *entry);\r\n    void    FreePage(DisplayModel *dm=nullptr, int pageNo=-1, TilePosition *tile=nullptr);\r\n    void    FreeNotVisible() { FreePage(); }\r\n\r\n    UINT    PaintTile(HDC hdc, RectI bounds, DisplayModel *dm, int pageNo,\r\n                      TilePosition tile, RectI tileOnScreen, bool renderMissing,\r\n                      bool *renderOutOfDateCue, bool *renderedReplacement);\r\n};\r\n"
  },
  {
    "path": "src/Search.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n/* Code related to:\r\n* user-initiated search\r\n* DDE commands, including search\r\n*/\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"FileUtil.h\"\r\n#include \"UITask.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EngineManager.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"ChmModel.h\"\r\n#include \"DisplayModel.h\"\r\n#include \"GlobalPrefs.h\"\r\n#include \"PdfSync.h\"\r\n#include \"TextSelection.h\"\r\n#include \"TextSearch.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"WindowInfo.h\"\r\n#include \"TabInfo.h\"\r\n#include \"resource.h\"\r\n#include \"AppTools.h\"\r\n#include \"Notifications.h\"\r\n#include \"Search.h\"\r\n#include \"Selection.h\"\r\n#include \"SumatraDialogs.h\"\r\n#include \"Translations.h\"\r\n\r\n// don't show the Search UI for document types that don't\r\n// support extracting text and/or navigating to a specific\r\n// text selection; default to showing it, since most users\r\n// will never use a format that does not support search\r\nbool NeedsFindUI(WindowInfo *win)\r\n{\r\n    if (!win->IsDocLoaded())\r\n        return true;\r\n    if (!win->AsFixed())\r\n        return false;\r\n    if (win->AsFixed()->GetEngine()->IsImageCollection())\r\n        return false;\r\n    return true;\r\n}\r\n\r\nvoid OnMenuFind(WindowInfo *win)\r\n{\r\n    if (win->AsChm()) {\r\n        win->AsChm()->FindInCurrentPage();\r\n        return;\r\n    }\r\n\r\n    if (!win->AsFixed() || !NeedsFindUI(win))\r\n        return;\r\n\r\n    // copy any selected text to the find bar, if it's still empty\r\n    DisplayModel *dm = win->AsFixed();\r\n    if (dm->textSelection->result.len > 0 &&\r\n        Edit_GetTextLength(win->hwndFindBox) == 0) {\r\n        ScopedMem<WCHAR> selection(dm->textSelection->ExtractText(L\" \"));\r\n        str::NormalizeWS(selection);\r\n        if (!str::IsEmpty(selection.Get())) {\r\n            win::SetText(win->hwndFindBox, selection);\r\n            Edit_SetModify(win->hwndFindBox, TRUE);\r\n        }\r\n    }\r\n\r\n    // Don't show a dialog if we don't have to - use the Toolbar instead\r\n    if (gGlobalPrefs->showToolbar && !win->isFullScreen && !win->presentation) {\r\n        if (GetFocus() == win->hwndFindBox)\r\n            SendMessage(win->hwndFindBox, WM_SETFOCUS, 0, 0);\r\n        else\r\n            SetFocus(win->hwndFindBox);\r\n        return;\r\n    }\r\n\r\n    ScopedMem<WCHAR> previousFind(win::GetText(win->hwndFindBox));\r\n    WORD state = (WORD)SendMessage(win->hwndToolbar, TB_GETSTATE, IDM_FIND_MATCH, 0);\r\n    bool matchCase = (state & TBSTATE_CHECKED) != 0;\r\n\r\n    ScopedMem<WCHAR> findString(Dialog_Find(win->hwndFrame, previousFind, &matchCase));\r\n    if (!findString)\r\n        return;\r\n\r\n    win::SetText(win->hwndFindBox, findString);\r\n    Edit_SetModify(win->hwndFindBox, TRUE);\r\n\r\n    bool matchCaseChanged = matchCase != (0 != (state & TBSTATE_CHECKED));\r\n    if (matchCaseChanged) {\r\n        if (matchCase)\r\n            state |= TBSTATE_CHECKED;\r\n        else\r\n            state &= ~TBSTATE_CHECKED;\r\n        SendMessage(win->hwndToolbar, TB_SETSTATE, IDM_FIND_MATCH, state);\r\n        dm->textSearch->SetSensitive(matchCase);\r\n    }\r\n\r\n    FindTextOnThread(win, FIND_FORWARD, true);\r\n}\r\n\r\nvoid OnMenuFindNext(WindowInfo *win)\r\n{\r\n    if (!win->IsDocLoaded() || !NeedsFindUI(win))\r\n        return;\r\n    if (SendMessage(win->hwndToolbar, TB_ISBUTTONENABLED, IDM_FIND_NEXT, 0))\r\n        FindTextOnThread(win, FIND_FORWARD, true);\r\n}\r\n\r\nvoid OnMenuFindPrev(WindowInfo *win)\r\n{\r\n    if (!win->IsDocLoaded() || !NeedsFindUI(win))\r\n        return;\r\n    if (SendMessage(win->hwndToolbar, TB_ISBUTTONENABLED, IDM_FIND_PREV, 0))\r\n        FindTextOnThread(win, FIND_BACKWARD, true);\r\n}\r\n\r\nvoid OnMenuFindMatchCase(WindowInfo *win)\r\n{\r\n    if (!win->IsDocLoaded() || !NeedsFindUI(win))\r\n        return;\r\n    WORD state = (WORD)SendMessage(win->hwndToolbar, TB_GETSTATE, IDM_FIND_MATCH, 0);\r\n    win->AsFixed()->textSearch->SetSensitive((state & TBSTATE_CHECKED) != 0);\r\n    Edit_SetModify(win->hwndFindBox, TRUE);\r\n}\r\n\r\nvoid OnMenuFindSel(WindowInfo *win, TextSearchDirection direction)\r\n{\r\n    if (!win->IsDocLoaded() || !NeedsFindUI(win))\r\n        return;\r\n    DisplayModel *dm = win->AsFixed();\r\n    if (!win->currentTab->selectionOnPage || 0 == dm->textSelection->result.len)\r\n        return;\r\n\r\n    ScopedMem<WCHAR> selection(dm->textSelection->ExtractText(L\" \"));\r\n    str::NormalizeWS(selection);\r\n    if (str::IsEmpty(selection.Get()))\r\n        return;\r\n\r\n    win::SetText(win->hwndFindBox, selection);\r\n    AbortFinding(win, false); // cancel \"find as you type\"\r\n    Edit_SetModify(win->hwndFindBox, FALSE);\r\n    dm->textSearch->SetLastResult(dm->textSelection);\r\n\r\n    FindTextOnThread(win, direction, true);\r\n}\r\n\r\nstatic void ShowSearchResult(WindowInfo& win, TextSel *result, bool addNavPt)\r\n{\r\n    CrashIf(0 == result->len || !result->pages || !result->rects);\r\n    if (0 == result->len || !result->pages || !result->rects)\r\n        return;\r\n\r\n    DisplayModel *dm = win.AsFixed();\r\n    if (addNavPt || !dm->PageShown(result->pages[0]) ||\r\n        (dm->GetZoomVirtual() == ZOOM_FIT_PAGE || dm->GetZoomVirtual() == ZOOM_FIT_CONTENT))\r\n    {\r\n        win.ctrl->GoToPage(result->pages[0], addNavPt);\r\n    }\r\n\r\n    dm->textSelection->CopySelection(dm->textSearch);\r\n    UpdateTextSelection(&win, false);\r\n    dm->ShowResultRectToScreen(result);\r\n    win.RepaintAsync();\r\n}\r\n\r\nvoid ClearSearchResult(WindowInfo *win)\r\n{\r\n    DeleteOldSelectionInfo(win, true);\r\n    win->RepaintAsync();\r\n}\r\n\r\nstatic void UpdateFindStatusTask(WindowInfo *win, NotificationWnd *wnd, int current, int total) {\r\n    if (!WindowInfoStillValid(win) || win->findCanceled) {\r\n        return;\r\n    }\r\n    if (win->notifications->Contains(wnd)) {\r\n        wnd->UpdateProgress(current, total);\r\n    } else {\r\n        // the search has been canceled by closing the notification\r\n        win->findCanceled = true;\r\n    }\r\n}\r\n\r\nstruct FindThreadData : public ProgressUpdateUI {\r\n    WindowInfo *win;\r\n    TextSearchDirection direction;\r\n    bool wasModified;\r\n    ScopedMem<WCHAR> text;\r\n    // owned by win->notifications, as FindThreadData\r\n    // can be deleted before the notification times out\r\n    NotificationWnd *wnd;\r\n    HANDLE thread;\r\n\r\n    FindThreadData(WindowInfo *win, TextSearchDirection direction, HWND findBox) :\r\n        win(win), direction(direction), text(win::GetText(findBox)),\r\n        wasModified(Edit_GetModify(findBox)), wnd(nullptr), thread(nullptr) { }\r\n    ~FindThreadData() { CloseHandle(thread); }\r\n\r\n    void ShowUI(bool showProgress) {\r\n        const LPARAM disable = (LPARAM)MAKELONG(0, 0);\r\n\r\n        if (showProgress) {\r\n            wnd = new NotificationWnd(win->hwndCanvas, L\"\",\r\n                                      _TR(\"Searching %d of %d...\"), win->notifications);\r\n            win->notifications->Add(wnd, NG_FIND_PROGRESS);\r\n        }\r\n\r\n        SendMessage(win->hwndToolbar, TB_ENABLEBUTTON, IDM_FIND_PREV, disable);\r\n        SendMessage(win->hwndToolbar, TB_ENABLEBUTTON, IDM_FIND_NEXT, disable);\r\n        SendMessage(win->hwndToolbar, TB_ENABLEBUTTON, IDM_FIND_MATCH, disable);\r\n    }\r\n\r\n    void HideUI(bool success, bool loopedAround) {\r\n        LPARAM enable = (LPARAM)MAKELONG(1, 0);\r\n\r\n        SendMessage(win->hwndToolbar, TB_ENABLEBUTTON, IDM_FIND_PREV, enable);\r\n        SendMessage(win->hwndToolbar, TB_ENABLEBUTTON, IDM_FIND_NEXT, enable);\r\n        SendMessage(win->hwndToolbar, TB_ENABLEBUTTON, IDM_FIND_MATCH, enable);\r\n\r\n        if (!win->notifications->Contains(wnd))\r\n            /* our notification has been replaced or closed (or never created) */;\r\n        else if (!success && !loopedAround) // i.e. canceled\r\n            win->notifications->RemoveNotification(wnd);\r\n        else if (!success && loopedAround)\r\n            wnd->UpdateMessage(_TR(\"No matches were found\"), 3000);\r\n        else {\r\n            ScopedMem<WCHAR> label(win->ctrl->GetPageLabel(win->AsFixed()->textSearch->GetCurrentPageNo()));\r\n            ScopedMem<WCHAR> buf(str::Format(_TR(\"Found text at page %s\"), label.Get()));\r\n            if (loopedAround) {\r\n                buf.Set(str::Format(_TR(\"Found text at page %s (again)\"), label.Get()));\r\n                MessageBeep(MB_ICONINFORMATION);\r\n            }\r\n            wnd->UpdateMessage(buf, 3000, loopedAround);\r\n        }\r\n    }\r\n\r\n    virtual void UpdateProgress(int current, int total) {\r\n        if (!wnd || WasCanceled()) {\r\n            return;\r\n        }\r\n        uitask::Post([=] {\r\n            UpdateFindStatusTask(win, wnd, current, total);\r\n        });\r\n    }\r\n\r\n    virtual bool WasCanceled() {\r\n        return !WindowInfoStillValid(win) || win->findCanceled;\r\n    }\r\n};\r\n\r\nstatic void FindEndTask(WindowInfo *win, FindThreadData *ftd, TextSel *textSel,\r\n    bool wasModifiedCanceled, bool loopedAround) {\r\n    if (!WindowInfoStillValid(win)) {\r\n        delete ftd;\r\n        return;\r\n    }\r\n    if (win->findThread != ftd->thread) {\r\n        // Race condition: FindTextOnThread/AbortFinding was\r\n        // called after the previous find thread ended but\r\n        // before this FindEndTask could be executed\r\n        delete ftd;\r\n        return;\r\n    }\r\n    if (!win->IsDocLoaded()) {\r\n        // the UI has already been disabled and hidden\r\n    } else if (textSel) {\r\n        ShowSearchResult(*win, textSel, wasModifiedCanceled);\r\n        ftd->HideUI(true, loopedAround);\r\n    } else {\r\n        // nothing found or search canceled\r\n        ClearSearchResult(win);\r\n        ftd->HideUI(false, !wasModifiedCanceled);\r\n    }\r\n    win->findThread = nullptr;\r\n    delete ftd;\r\n}\r\n\r\nstatic DWORD WINAPI FindThread(LPVOID data)\r\n{\r\n    FindThreadData *ftd = (FindThreadData *)data;\r\n    AssertCrash(ftd && ftd->win && ftd->win->ctrl && ftd->win->ctrl->AsFixed());\r\n    WindowInfo *win = ftd->win;\r\n    DisplayModel *dm = win->AsFixed();\r\n\r\n    TextSel *rect;\r\n    dm->textSearch->SetDirection(ftd->direction);\r\n    if (ftd->wasModified || !win->ctrl->ValidPageNo(dm->textSearch->GetCurrentPageNo()) ||\r\n        !dm->GetPageInfo(dm->textSearch->GetCurrentPageNo())->visibleRatio)\r\n        rect = dm->textSearch->FindFirst(win->ctrl->CurrentPageNo(), ftd->text, ftd);\r\n    else\r\n        rect = dm->textSearch->FindNext(ftd);\r\n\r\n    bool loopedAround = false;\r\n    if (!win->findCanceled && !rect) {\r\n        // With no further findings, start over (unless this was a new search from the beginning)\r\n        int startPage = (FIND_FORWARD == ftd->direction) ? 1 : win->ctrl->PageCount();\r\n        if (!ftd->wasModified || win->ctrl->CurrentPageNo() != startPage) {\r\n            loopedAround = true;\r\n            rect = dm->textSearch->FindFirst(startPage, ftd->text, ftd);\r\n        }\r\n    }\r\n\r\n    // wait for FindTextOnThread to return so that\r\n    // FindEndTask closes the correct handle to\r\n    // the current find thread\r\n    while (!win->findThread) {\r\n        Sleep(1);\r\n    }\r\n\r\n    if (!win->findCanceled && rect) {\r\n        uitask::Post([=] {\r\n            FindEndTask(win, ftd, rect, ftd->wasModified, loopedAround);\r\n        });\r\n    } else {\r\n        uitask::Post([=] {\r\n            FindEndTask(win, ftd, nullptr, win->findCanceled, false);\r\n        });\r\n    }\r\n\r\n    return 0;\r\n}\r\n\r\nvoid AbortFinding(WindowInfo *win, bool hideMessage)\r\n{\r\n    if (win->findThread) {\r\n        win->findCanceled = true;\r\n        WaitForSingleObject(win->findThread, INFINITE);\r\n    }\r\n    win->findCanceled = false;\r\n\r\n    if (hideMessage)\r\n        win->notifications->RemoveForGroup(NG_FIND_PROGRESS);\r\n}\r\n\r\nvoid FindTextOnThread(WindowInfo* win, TextSearchDirection direction, bool showProgress)\r\n{\r\n    AbortFinding(win, true);\r\n\r\n    FindThreadData *ftd = new FindThreadData(win, direction, win->hwndFindBox);\r\n    Edit_SetModify(win->hwndFindBox, FALSE);\r\n\r\n    if (str::IsEmpty(ftd->text.Get())) {\r\n        delete ftd;\r\n        return;\r\n    }\r\n\r\n    ftd->ShowUI(showProgress);\r\n    win->findThread = nullptr;\r\n    win->findThread = CreateThread(nullptr, 0, FindThread, ftd, 0, 0);\r\n    ftd->thread = win->findThread; // safe because only accesssed on ui thread\r\n}\r\n\r\nvoid PaintForwardSearchMark(WindowInfo *win, HDC hdc)\r\n{\r\n    CrashIf(!win->AsFixed());\r\n    DisplayModel *dm = win->AsFixed();\r\n    PageInfo *pageInfo = dm->GetPageInfo(win->fwdSearchMark.page);\r\n    if (!pageInfo || 0.0 == pageInfo->visibleRatio)\r\n        return;\r\n\r\n    // Draw the rectangles highlighting the forward search results\r\n    Vec<RectI> rects;\r\n    for (size_t i = 0; i < win->fwdSearchMark.rects.Count(); i++) {\r\n        RectI rect = win->fwdSearchMark.rects.At(i);\r\n        rect = dm->CvtToScreen(win->fwdSearchMark.page, rect.Convert<double>());\r\n        if (gGlobalPrefs->forwardSearch.highlightOffset > 0) {\r\n            rect.x = std::max(pageInfo->pageOnScreen.x, 0) + (int)(gGlobalPrefs->forwardSearch.highlightOffset * dm->GetZoomReal());\r\n            rect.dx = (int)((gGlobalPrefs->forwardSearch.highlightWidth > 0 ? gGlobalPrefs->forwardSearch.highlightWidth : 15.0) * dm->GetZoomReal());\r\n            rect.y -= 4;\r\n            rect.dy += 8;\r\n        }\r\n        rects.Append(rect);\r\n    }\r\n\r\n    BYTE alpha = (BYTE)(0x5f * 1.0f * (HIDE_FWDSRCHMARK_STEPS - win->fwdSearchMark.hideStep) / HIDE_FWDSRCHMARK_STEPS);\r\n    PaintTransparentRectangles(hdc, win->canvasRc, rects, gGlobalPrefs->forwardSearch.highlightColor, alpha, 0);\r\n}\r\n\r\n// returns true if the double-click was handled and false if it wasn't\r\nbool OnInverseSearch(WindowInfo *win, int x, int y)\r\n{\r\n    if (!HasPermission(Perm_DiskAccess) || gPluginMode) return false;\r\n    TabInfo *tab = win->currentTab;\r\n    if (!tab || tab->GetEngineType() != Engine_PDF) return false;\r\n    DisplayModel *dm = tab->AsFixed();\r\n\r\n    // Clear the last forward-search result\r\n    win->fwdSearchMark.rects.Reset();\r\n    InvalidateRect(win->hwndCanvas, nullptr, FALSE);\r\n\r\n    // On double-clicking error message will be shown to the user\r\n    // if the PDF does not have a synchronization file\r\n    if (!dm->pdfSync) {\r\n        int err = Synchronizer::Create(tab->filePath, dm->GetEngine(), &dm->pdfSync);\r\n        if (err == PDFSYNCERR_SYNCFILE_NOTFOUND) {\r\n            // We used to warn that \"No synchronization file found\" at this\r\n            // point if gGlobalPrefs->enableTeXEnhancements is set; we no longer\r\n            // so do because a double-click has several other meanings\r\n            // (selecting a word or an image, navigating quickly using links)\r\n            // and showing an unrelated warning in all those cases seems wrong\r\n            return false;\r\n        }\r\n        if (err != PDFSYNCERR_SUCCESS) {\r\n            win->ShowNotification(_TR(\"Synchronization file cannot be opened\"));\r\n            return true;\r\n        }\r\n        gGlobalPrefs->enableTeXEnhancements = true;\r\n    }\r\n\r\n    int pageNo = dm->GetPageNoByPoint(PointI(x, y));\r\n    if (!tab->ctrl->ValidPageNo(pageNo))\r\n        return false;\r\n\r\n    PointI pt = dm->CvtFromScreen(PointI(x, y), pageNo).ToInt();\r\n    ScopedMem<WCHAR> srcfilepath;\r\n    UINT line, col;\r\n    int err = dm->pdfSync->DocToSource(pageNo, pt, srcfilepath, &line, &col);\r\n    if (err != PDFSYNCERR_SUCCESS) {\r\n        win->ShowNotification(_TR(\"No synchronization info at this position\"));\r\n        return true;\r\n    }\r\n\r\n    if (!file::Exists(srcfilepath)) {\r\n        // if the source file is missing, check if it's been moved to the same place as\r\n        // the PDF document (which happens if all files are moved together)\r\n        ScopedMem<WCHAR> altsrcpath(path::GetDir(tab->filePath));\r\n        altsrcpath.Set(path::Join(altsrcpath, path::GetBaseName(srcfilepath)));\r\n        if (!str::Eq(altsrcpath, srcfilepath) && file::Exists(altsrcpath))\r\n            srcfilepath.Set(altsrcpath.StealData());\r\n    }\r\n\r\n    WCHAR *inverseSearch = gGlobalPrefs->inverseSearchCmdLine;\r\n    if (!inverseSearch)\r\n        // Detect a text editor and use it as the default inverse search handler for now\r\n        inverseSearch = AutoDetectInverseSearchCommands();\r\n\r\n    ScopedMem<WCHAR> cmdline;\r\n    if (inverseSearch)\r\n        cmdline.Set(dm->pdfSync->PrepareCommandline(inverseSearch, srcfilepath, line, col));\r\n    if (!str::IsEmpty(cmdline.Get())) {\r\n        // resolve relative paths with relation to SumatraPDF.exe's directory\r\n        ScopedMem<WCHAR> appDir(GetExePath());\r\n        if (appDir)\r\n            appDir.Set(path::GetDir(appDir));\r\n        ScopedHandle process(LaunchProcess(cmdline, appDir));\r\n        if (!process)\r\n            win->ShowNotification(_TR(\"Cannot start inverse search command. Please check the command line in the settings.\"));\r\n    }\r\n    else if (gGlobalPrefs->enableTeXEnhancements)\r\n        win->ShowNotification(_TR(\"Cannot start inverse search command. Please check the command line in the settings.\"));\r\n\r\n    if (inverseSearch != gGlobalPrefs->inverseSearchCmdLine)\r\n        free(inverseSearch);\r\n\r\n    return true;\r\n}\r\n\r\n// Show the result of a PDF forward-search synchronization (initiated by a DDE command)\r\nvoid ShowForwardSearchResult(WindowInfo *win, const WCHAR *fileName, UINT line, UINT col, UINT ret, UINT page, Vec<RectI> &rects)\r\n{\r\n    UNUSED(col);\r\n    CrashIf(!win->AsFixed());\r\n    DisplayModel *dm = win->AsFixed();\r\n    win->fwdSearchMark.rects.Reset();\r\n    const PageInfo *pi = dm->GetPageInfo(page);\r\n    if ((ret == PDFSYNCERR_SUCCESS) && (rects.Count() > 0) && (nullptr != pi)) {\r\n        // remember the position of the search result for drawing the rect later on\r\n        win->fwdSearchMark.rects = rects;\r\n        win->fwdSearchMark.page = page;\r\n        win->fwdSearchMark.show = true;\r\n        win->fwdSearchMark.hideStep = 0;\r\n        if (!gGlobalPrefs->forwardSearch.highlightPermanent)\r\n            SetTimer(win->hwndCanvas, HIDE_FWDSRCHMARK_TIMER_ID, HIDE_FWDSRCHMARK_DELAY_IN_MS, nullptr);\r\n\r\n        // Scroll to show the overall highlighted zone\r\n        int pageNo = page;\r\n        RectI overallrc = rects.At(0);\r\n        for (size_t i = 1; i < rects.Count(); i++)\r\n            overallrc = overallrc.Union(rects.At(i));\r\n        TextSel res = { 1, &pageNo, &overallrc };\r\n        if (!dm->PageVisible(page))\r\n            win->ctrl->GoToPage(page, true);\r\n        if (!dm->ShowResultRectToScreen(&res))\r\n            win->RepaintAsync();\r\n        if (IsIconic(win->hwndFrame))\r\n            ShowWindowAsync(win->hwndFrame, SW_RESTORE);\r\n        return;\r\n    }\r\n\r\n    ScopedMem<WCHAR> buf;\r\n    if (ret == PDFSYNCERR_SYNCFILE_NOTFOUND)\r\n        win->ShowNotification(_TR(\"No synchronization file found\"));\r\n    else if (ret == PDFSYNCERR_SYNCFILE_CANNOT_BE_OPENED)\r\n        win->ShowNotification(_TR(\"Synchronization file cannot be opened\"));\r\n    else if (ret == PDFSYNCERR_INVALID_PAGE_NUMBER)\r\n        buf.Set(str::Format(_TR(\"Page number %u inexistant\"), page));\r\n    else if (ret == PDFSYNCERR_NO_SYNC_AT_LOCATION)\r\n        win->ShowNotification(_TR(\"No synchronization info at this position\"));\r\n    else if (ret == PDFSYNCERR_UNKNOWN_SOURCEFILE)\r\n        buf.Set(str::Format(_TR(\"Unknown source file (%s)\"), fileName));\r\n    else if (ret == PDFSYNCERR_NORECORD_IN_SOURCEFILE)\r\n        buf.Set(str::Format(_TR(\"Source file %s has no synchronization point\"), fileName));\r\n    else if (ret == PDFSYNCERR_NORECORD_FOR_THATLINE)\r\n        buf.Set(str::Format(_TR(\"No result found around line %u in file %s\"), line, fileName));\r\n    else if (ret == PDFSYNCERR_NOSYNCPOINT_FOR_LINERECORD)\r\n        buf.Set(str::Format(_TR(\"No result found around line %u in file %s\"), line, fileName));\r\n    if (buf)\r\n        win->ShowNotification(buf);\r\n}\r\n\r\n// DDE commands handling\r\n\r\nLRESULT OnDDEInitiate(HWND hwnd, WPARAM wparam, LPARAM lparam)\r\n{\r\n    ATOM aServer = GlobalAddAtom(PDFSYNC_DDE_SERVICE);\r\n    ATOM aTopic = GlobalAddAtom(PDFSYNC_DDE_TOPIC);\r\n\r\n    if (LOWORD(lparam) == aServer && HIWORD(lparam) == aTopic) {\r\n        SendMessage((HWND)wparam, WM_DDE_ACK, (WPARAM)hwnd, MAKELPARAM(aServer, 0));\r\n    }\r\n    else {\r\n        GlobalDeleteAtom(aServer);\r\n        GlobalDeleteAtom(aTopic);\r\n    }\r\n    return 0;\r\n}\r\n\r\n// DDE commands\r\n\r\n// Synchronization command format:\r\n// [<DDECOMMAND_SYNC>([\"<pdffile>\",]\"<srcfile>\",<line>,<col>[,<newwindow>,<setfocus>])]\r\nstatic const WCHAR *HandleSyncCmd(const WCHAR *cmd, DDEACK& ack)\r\n{\r\n    ScopedMem<WCHAR> pdfFile, srcFile;\r\n    BOOL line = 0, col = 0, newWindow = 0, setFocus = 0;\r\n    const WCHAR *next = str::Parse(cmd, L\"[\" DDECOMMAND_SYNC L\"(\\\"%S\\\",%? \\\"%S\\\",%u,%u)]\",\r\n                                   &pdfFile, &srcFile, &line, &col);\r\n    if (!next)\r\n        next = str::Parse(cmd, L\"[\" DDECOMMAND_SYNC L\"(\\\"%S\\\",%? \\\"%S\\\",%u,%u,%u,%u)]\",\r\n                          &pdfFile, &srcFile, &line, &col, &newWindow, &setFocus);\r\n    // allow to omit the pdffile path, so that editors don't have to know about\r\n    // multi-file projects (requires that the PDF has already been opened)\r\n    if (!next) {\r\n        pdfFile.Set(nullptr);\r\n        next = str::Parse(cmd, L\"[\" DDECOMMAND_SYNC L\"(\\\"%S\\\",%u,%u)]\",\r\n                          &srcFile, &line, &col);\r\n        if (!next)\r\n            next = str::Parse(cmd, L\"[\" DDECOMMAND_SYNC L\"(\\\"%S\\\",%u,%u,%u,%u)]\",\r\n                              &srcFile, &line, &col, &newWindow, &setFocus);\r\n    }\r\n\r\n    if (!next)\r\n        return nullptr;\r\n\r\n    WindowInfo *win = nullptr;\r\n    if (pdfFile) {\r\n        // check if the PDF is already opened\r\n        win = FindWindowInfoByFile(pdfFile, !newWindow);\r\n        // if not then open it\r\n        if (newWindow || !win) {\r\n            LoadArgs args(pdfFile, !newWindow ? win : nullptr);\r\n            win = LoadDocument(args);\r\n        } else if (win && !win->IsDocLoaded()) {\r\n            ReloadDocument(win);\r\n        }\r\n    }\r\n    else {\r\n        // check if any opened PDF has sync information for the source file\r\n        win = FindWindowInfoBySyncFile(srcFile, true);\r\n        if (win && newWindow) {\r\n            LoadArgs args(win->currentTab->filePath);\r\n            win = LoadDocument(args);\r\n        }\r\n    }\r\n\r\n    if (!win || !win->currentTab || win->currentTab->GetEngineType() != Engine_PDF)\r\n        return next;\r\n    if (!win->AsFixed()->pdfSync)\r\n        return next;\r\n\r\n    ack.fAck = 1;\r\n    CrashIf(!win->AsFixed());\r\n    UINT page;\r\n    Vec<RectI> rects;\r\n    int ret = win->AsFixed()->pdfSync->SourceToDoc(srcFile, line, col, &page, rects);\r\n    ShowForwardSearchResult(win, srcFile, line, col, ret, page, rects);\r\n    if (setFocus)\r\n        win->Focus();\r\n\r\n    return next;\r\n}\r\n\r\n// Open file DDE command, format:\r\n// [<DDECOMMAND_OPEN>(\"<pdffilepath>\"[,<newwindow>,<setfocus>,<forcerefresh>])]\r\nstatic const WCHAR *HandleOpenCmd(const WCHAR *cmd, DDEACK& ack)\r\n{\r\n    ScopedMem<WCHAR> pdfFile;\r\n    BOOL newWindow = 0, setFocus = 0, forceRefresh = 0;\r\n    const WCHAR *next = str::Parse(cmd, L\"[\" DDECOMMAND_OPEN L\"(\\\"%S\\\")]\", &pdfFile);\r\n    if (!next)\r\n        next = str::Parse(cmd, L\"[\" DDECOMMAND_OPEN L\"(\\\"%S\\\",%u,%u,%u)]\",\r\n                          &pdfFile, &newWindow, &setFocus, &forceRefresh);\r\n    if (!next)\r\n        return nullptr;\r\n\r\n    WindowInfo *win = FindWindowInfoByFile(pdfFile, !newWindow);\r\n    if (newWindow || !win) {\r\n        LoadArgs args(pdfFile, !newWindow ? win : nullptr);\r\n        win = LoadDocument(args);\r\n    } else if (win && !win->IsDocLoaded()) {\r\n        ReloadDocument(win);\r\n        forceRefresh = 0;\r\n    }\r\n\r\n    assert(!win || !win->IsAboutWindow());\r\n    if (!win)\r\n        return next;\r\n\r\n    ack.fAck = 1;\r\n    if (forceRefresh)\r\n        ReloadDocument(win, true);\r\n    if (setFocus)\r\n        win->Focus();\r\n\r\n    return next;\r\n}\r\n\r\n// Jump to named destination DDE command. Command format:\r\n// [<DDECOMMAND_GOTO>(\"<pdffilepath>\", \"<destination name>\")]\r\nstatic const WCHAR *HandleGotoCmd(const WCHAR *cmd, DDEACK& ack)\r\n{\r\n    ScopedMem<WCHAR> pdfFile, destName;\r\n    const WCHAR *next = str::Parse(cmd, L\"[\" DDECOMMAND_GOTO L\"(\\\"%S\\\",%? \\\"%S\\\")]\",\r\n                                   &pdfFile, &destName);\r\n    if (!next)\r\n        return nullptr;\r\n\r\n    WindowInfo *win = FindWindowInfoByFile(pdfFile, true);\r\n    if (!win)\r\n        return next;\r\n    if (!win->IsDocLoaded()) {\r\n        ReloadDocument(win);\r\n        if (!win->IsDocLoaded())\r\n            return next;\r\n    }\r\n\r\n    win->linkHandler->GotoNamedDest(destName);\r\n    ack.fAck = 1;\r\n    win->Focus();\r\n    return next;\r\n}\r\n\r\n// Jump to page DDE command. Format:\r\n// [<DDECOMMAND_PAGE>(\"<pdffilepath>\", <page number>)]\r\nstatic const WCHAR *HandlePageCmd(const WCHAR *cmd, DDEACK& ack)\r\n{\r\n    ScopedMem<WCHAR> pdfFile;\r\n    UINT page;\r\n    const WCHAR *next = str::Parse(cmd, L\"[\" DDECOMMAND_PAGE L\"(\\\"%S\\\",%u)]\",\r\n                                   &pdfFile, &page);\r\n    if (!next)\r\n        return nullptr;\r\n\r\n    // check if the PDF is already opened\r\n    WindowInfo *win = FindWindowInfoByFile(pdfFile, true);\r\n    if (!win)\r\n        return next;\r\n    if (!win->IsDocLoaded()) {\r\n        ReloadDocument(win);\r\n        if (!win->IsDocLoaded())\r\n            return next;\r\n    }\r\n\r\n    if (!win->ctrl->ValidPageNo(page))\r\n        return next;\r\n\r\n    win->ctrl->GoToPage(page, true);\r\n    ack.fAck = 1;\r\n    win->Focus();\r\n    return next;\r\n}\r\n\r\n// Set view mode and zoom level. Format:\r\n// [<DDECOMMAND_SETVIEW>(\"<pdffilepath>\", \"<view mode>\", <zoom level>[, <scrollX>, <scrollY>])]\r\nstatic const WCHAR *HandleSetViewCmd(const WCHAR *cmd, DDEACK& ack)\r\n{\r\n    ScopedMem<WCHAR> pdfFile, viewMode;\r\n    float zoom = INVALID_ZOOM;\r\n    PointI scroll(-1, -1);\r\n    const WCHAR *next = str::Parse(cmd, L\"[\" DDECOMMAND_SETVIEW L\"(\\\"%S\\\",%? \\\"%S\\\",%f)]\",\r\n                                   &pdfFile, &viewMode, &zoom);\r\n    if (!next)\r\n        next = str::Parse(cmd, L\"[\" DDECOMMAND_SETVIEW L\"(\\\"%S\\\",%? \\\"%S\\\",%f,%d,%d)]\",\r\n                          &pdfFile, &viewMode, &zoom, &scroll.x, &scroll.y);\r\n    if (!next)\r\n        return nullptr;\r\n\r\n    WindowInfo *win = FindWindowInfoByFile(pdfFile, true);\r\n    if (!win)\r\n        return next;\r\n    if (!win->IsDocLoaded()) {\r\n        ReloadDocument(win);\r\n        if (!win->IsDocLoaded())\r\n            return next;\r\n    }\r\n\r\n    DisplayMode mode = prefs::conv::ToDisplayMode(viewMode, DM_AUTOMATIC);\r\n    if (mode != DM_AUTOMATIC)\r\n        SwitchToDisplayMode(win, mode);\r\n\r\n    if (zoom != INVALID_ZOOM)\r\n        ZoomToSelection(win, zoom);\r\n\r\n    if ((scroll.x != -1 || scroll.y != -1) && win->AsFixed()) {\r\n        DisplayModel *dm = win->AsFixed();\r\n        ScrollState ss = dm->GetScrollState();\r\n        ss.x = scroll.x;\r\n        ss.y = scroll.y;\r\n        dm->SetScrollState(ss);\r\n    }\r\n\r\n    ack.fAck = 1;\r\n    return next;\r\n}\r\n\r\nstatic void HandleDdeCmds(const WCHAR *cmd, DDEACK& ack)\r\n{\r\n    while (!str::IsEmpty(cmd)) {\r\n        const WCHAR *nextCmd = nullptr;\r\n        if (!nextCmd) nextCmd = HandleSyncCmd(cmd, ack);\r\n        if (!nextCmd) nextCmd = HandleOpenCmd(cmd, ack);\r\n        if (!nextCmd) nextCmd = HandleGotoCmd(cmd, ack);\r\n        if (!nextCmd) nextCmd = HandlePageCmd(cmd, ack);\r\n        if (!nextCmd) nextCmd = HandleSetViewCmd(cmd, ack);\r\n        if (!nextCmd) {\r\n            ScopedMem<WCHAR> tmp;\r\n            nextCmd = str::Parse(cmd, L\"%S]\", &tmp);\r\n        }\r\n        cmd = nextCmd;\r\n    }\r\n}\r\n\r\nLRESULT OnDDExecute(HWND hwnd, WPARAM wparam, LPARAM lparam)\r\n{\r\n    UINT_PTR lo, hi;\r\n    UnpackDDElParam(WM_DDE_EXECUTE, lparam, &lo, &hi);\r\n\r\n    DDEACK ack = { 0 };\r\n    LPVOID command = GlobalLock((HGLOBAL)hi);\r\n    if (command) {\r\n        ScopedMem<WCHAR> cmd;\r\n        if (IsWindowUnicode((HWND)wparam))\r\n            cmd.Set(str::Dup((const WCHAR *)command));\r\n        else\r\n            cmd.Set(str::conv::FromAnsi((const char *)command));\r\n        HandleDdeCmds(cmd, ack);\r\n    }\r\n    GlobalUnlock((HGLOBAL)hi);\r\n\r\n    lparam = ReuseDDElParam(lparam, WM_DDE_EXECUTE, WM_DDE_ACK, *(WORD *)&ack, hi);\r\n    PostMessage((HWND)wparam, WM_DDE_ACK, (WPARAM)hwnd, lparam);\r\n    return 0;\r\n}\r\n\r\nLRESULT OnDDETerminate(HWND hwnd, WPARAM wparam, LPARAM lparam)\r\n{\r\n    UNUSED(lparam);\r\n    // Respond with another WM_DDE_TERMINATE message\r\n    PostMessage((HWND)wparam, WM_DDE_TERMINATE, (WPARAM)hwnd, 0L);\r\n    return 0;\r\n}\r\n\r\nLRESULT OnCopyData(HWND hwnd, WPARAM wparam, LPARAM lparam)\r\n{\r\n    UNUSED(hwnd);\r\n    COPYDATASTRUCT *cds = (COPYDATASTRUCT *)lparam;\r\n    if (!cds || cds->dwData != 0x44646557 /* DdeW */ || wparam)\r\n        return FALSE;\r\n\r\n    const WCHAR *cmd = (const WCHAR *)cds->lpData;\r\n    if (cmd[cds->cbData / sizeof(WCHAR) - 1])\r\n        return FALSE;\r\n\r\n    DDEACK ack = { 0 };\r\n    HandleDdeCmds(cmd, ack);\r\n    return ack.fAck ? TRUE : FALSE;\r\n}\r\n"
  },
  {
    "path": "src/Search.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n#define PDFSYNC_DDE_SERVICE   L\"SUMATRA\"\r\n#define PDFSYNC_DDE_TOPIC     L\"control\"\r\n\r\n// forward-search command\r\n//  format: [ForwardSearch([\"<pdffilepath>\",]\"<sourcefilepath>\",<line>,<column>[,<newwindow>, <setfocus>])]\r\n//    if pdffilepath is provided, the file will be opened if no open window can be found for it\r\n//    if newwindow = 1 then a new window is created even if the file is already open\r\n//    if focus = 1 then the focus is set to the window\r\n//  eg: [ForwardSearch(\"c:\\file.pdf\",\"c:\\folder\\source.tex\",298,0)]\r\n#define DDECOMMAND_SYNC       L\"ForwardSearch\"\r\n\r\n// open file command\r\n//  format: [Open(\"<pdffilepath>\"[,<newwindow>,<setfocus>,<forcerefresh>])]\r\n//    if newwindow = 1 then a new window is created even if the file is already open\r\n//    if focus = 1 then the focus is set to the window\r\n//  eg: [Open(\"c:\\file.pdf\", 1, 1, 0)]\r\n#define DDECOMMAND_OPEN       L\"Open\"\r\n\r\n// jump to named destination command\r\n//  format: [GoToNamedDest(\"<pdffilepath>\",\"<destination name>\")]\r\n//  eg: [GoToNamedDest(\"c:\\file.pdf\", \"chapter.1\")]. pdf file must be already opened\r\n#define DDECOMMAND_GOTO       L\"GotoNamedDest\"\r\n\r\n// jump to page command\r\n//  format: [GoToPage(\"<pdffilepath>\",<page number>)]\r\n//  eg: [GoToPage(\"c:\\file.pdf\", 37)]. pdf file must be already opened\r\n#define DDECOMMAND_PAGE       L\"GotoPage\"\r\n\r\n// set view mode and zoom level\r\n//  format: [SetView(\"<pdffilepath>\", \"<view mode>\", <zoom level>[, <scrollX>, <scrollY>])]\r\n//  eg: [SetView(\"c:\\file.pdf\", \"book view\", -2)]\r\n//  note: use -1 for ZOOM_FIT_PAGE, -2 for ZOOM_FIT_WIDTH and -3 for ZOOM_FIT_CONTENT\r\n#define DDECOMMAND_SETVIEW    L\"SetView\"\r\n\r\nLRESULT OnDDEInitiate(HWND hwnd, WPARAM wparam, LPARAM lparam);\r\nLRESULT OnDDExecute(HWND hwnd, WPARAM wparam, LPARAM lparam);\r\nLRESULT OnDDETerminate(HWND hwnd, WPARAM wparam, LPARAM lparam);\r\nLRESULT OnCopyData(HWND hwnd, WPARAM wparam, LPARAM lparam);\r\n\r\n#define HIDE_FWDSRCHMARK_TIMER_ID                4\r\n#define HIDE_FWDSRCHMARK_DELAY_IN_MS             400\r\n#define HIDE_FWDSRCHMARK_DECAYINTERVAL_IN_MS     100\r\n#define HIDE_FWDSRCHMARK_STEPS                   5\r\n\r\nbool NeedsFindUI(WindowInfo *win);\r\nvoid ClearSearchResult(WindowInfo *win);\r\nbool OnInverseSearch(WindowInfo *win, int x, int y);\r\nvoid ShowForwardSearchResult(WindowInfo *win, const WCHAR *fileName, UINT line, UINT col, UINT ret, UINT page, Vec<RectI> &rects);\r\nvoid PaintForwardSearchMark(WindowInfo *win, HDC hdc);\r\nvoid OnMenuFindPrev(WindowInfo *win);\r\nvoid OnMenuFindNext(WindowInfo *win);\r\nvoid OnMenuFind(WindowInfo *win);\r\nvoid OnMenuFindMatchCase(WindowInfo *win);\r\nvoid OnMenuFindSel(WindowInfo *win, TextSearchDirection direction);\r\nvoid AbortFinding(WindowInfo *win, bool hideMessage);\r\nvoid FindTextOnThread(WindowInfo* win, TextSearchDirection direction, bool showProgress);\r\n"
  },
  {
    "path": "src/Selection.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include <UIAutomationCore.h>\r\n#include <UIAutomationCoreApi.h>\r\n#include \"Dpi.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EngineManager.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"ChmModel.h\"\r\n#include \"DisplayModel.h\"\r\n#include \"GlobalPrefs.h\"\r\n#include \"TextSelection.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"WindowInfo.h\"\r\n#include \"TabInfo.h\"\r\n#include \"Selection.h\"\r\n#include \"Toolbar.h\"\r\n#include \"Translations.h\"\r\n#include \"uia/Provider.h\"\r\n\r\nRectI SelectionOnPage::GetRect(DisplayModel *dm)\r\n{\r\n    // if the page is not visible, we return an empty rectangle\r\n    PageInfo *pageInfo = dm->GetPageInfo(pageNo);\r\n    if (!pageInfo || pageInfo->visibleRatio <= 0.0)\r\n        return RectI();\r\n\r\n    return dm->CvtToScreen(pageNo, rect);\r\n}\r\n\r\nVec<SelectionOnPage> *SelectionOnPage::FromRectangle(DisplayModel *dm, RectI rect)\r\n{\r\n    Vec<SelectionOnPage> *sel = new Vec<SelectionOnPage>();\r\n\r\n    for (int pageNo = dm->GetEngine()->PageCount(); pageNo >= 1; --pageNo) {\r\n        PageInfo *pageInfo = dm->GetPageInfo(pageNo);\r\n        assert(!pageInfo || 0.0 == pageInfo->visibleRatio || pageInfo->shown);\r\n        if (!pageInfo || !pageInfo->shown)\r\n            continue;\r\n\r\n        RectI intersect = rect.Intersect(pageInfo->pageOnScreen);\r\n        if (intersect.IsEmpty())\r\n            continue;\r\n\r\n        /* selection intersects with a page <pageNo> on the screen */\r\n        RectD isectD = dm->CvtFromScreen(intersect, pageNo);\r\n        sel->Append(SelectionOnPage(pageNo, &isectD));\r\n    }\r\n    sel->Reverse();\r\n\r\n    if (sel->Count() == 0) {\r\n        delete sel;\r\n        return nullptr;\r\n    }\r\n    return sel;\r\n}\r\n\r\nVec<SelectionOnPage> *SelectionOnPage::FromTextSelect(TextSel *textSel)\r\n{\r\n    Vec<SelectionOnPage> *sel = new Vec<SelectionOnPage>(textSel->len);\r\n\r\n    for (int i = textSel->len - 1; i >= 0; i--) {\r\n        RectD rect = textSel->rects[i].Convert<double>();\r\n        sel->Append(SelectionOnPage(textSel->pages[i], &rect));\r\n    }\r\n    sel->Reverse();\r\n\r\n    if (sel->Count() == 0) {\r\n        delete sel;\r\n        return nullptr;\r\n    }\r\n    return sel;\r\n}\r\n\r\nvoid DeleteOldSelectionInfo(WindowInfo *win, bool alsoTextSel)\r\n{\r\n    if (win->currentTab) {\r\n        delete win->currentTab->selectionOnPage;\r\n        win->currentTab->selectionOnPage = nullptr;\r\n    }\r\n    win->showSelection = false;\r\n    win->selectionMeasure = SizeD();\r\n\r\n    if (alsoTextSel && win->AsFixed())\r\n        win->AsFixed()->textSelection->Reset();\r\n}\r\n\r\nvoid PaintTransparentRectangles(HDC hdc, RectI screenRc, Vec<RectI>& rects, COLORREF selectionColor, BYTE alpha, int margin)\r\n{\r\n    using namespace Gdiplus;\r\n\r\n    // create path from rectangles\r\n    GraphicsPath path(FillModeWinding);\r\n    screenRc.Inflate(margin, margin);\r\n    for (size_t i = 0; i < rects.Count(); i++) {\r\n        RectI rc = rects.At(i).Intersect(screenRc);\r\n        if (!rc.IsEmpty())\r\n            path.AddRectangle(rc.ToGdipRect());\r\n    }\r\n\r\n    // fill path (and draw optional outline margin)\r\n    Graphics gs(hdc);\r\n    Color c(alpha, GetRValueSafe(selectionColor), GetGValueSafe(selectionColor), GetBValueSafe(selectionColor));\r\n    SolidBrush tmpBrush(c);\r\n    gs.FillPath(&tmpBrush, &path);\r\n    if (margin) {\r\n        path.Outline(nullptr, 0.2f);\r\n        Pen tmpPen(Color(alpha, 0, 0, 0), (REAL)margin);\r\n        gs.DrawPath(&tmpPen, &path);\r\n    }\r\n}\r\n\r\nvoid PaintSelection(WindowInfo *win, HDC hdc)\r\n{\r\n    CrashIf(!win->AsFixed());\r\n\r\n    Vec<RectI> rects;\r\n\r\n    if (win->mouseAction == MA_SELECTING) {\r\n        // during rectangle selection\r\n        RectI selRect = win->selectionRect;\r\n        if (selRect.dx < 0) {\r\n            selRect.x += selRect.dx;\r\n            selRect.dx *= -1;\r\n        }\r\n        if (selRect.dy < 0) {\r\n            selRect.y += selRect.dy;\r\n            selRect.dy *= -1;\r\n        }\r\n\r\n        rects.Append(selRect);\r\n    } else {\r\n        // during text selection or after selection is done\r\n        if (MA_SELECTING_TEXT == win->mouseAction) {\r\n            UpdateTextSelection(win);\r\n            if (!win->currentTab->selectionOnPage) {\r\n                // prevent the selection from disappearing while the\r\n                // user is still at it (OnSelectionStop removes it\r\n                // if it is still empty at the end)\r\n                win->currentTab->selectionOnPage = new Vec<SelectionOnPage>();\r\n                win->showSelection = true;\r\n            }\r\n        }\r\n\r\n        CrashIf(!win->currentTab->selectionOnPage);\r\n        if (!win->currentTab->selectionOnPage)\r\n            return;\r\n\r\n        for (SelectionOnPage& sel : *win->currentTab->selectionOnPage) {\r\n            rects.Append(sel.GetRect(win->AsFixed()));\r\n        }\r\n    }\r\n\r\n    PaintTransparentRectangles(hdc, win->canvasRc, rects, gGlobalPrefs->fixedPageUI.selectionColor);\r\n}\r\n\r\nvoid UpdateTextSelection(WindowInfo *win, bool select)\r\n{\r\n    if (!win->AsFixed())\r\n        return;\r\n\r\n    DisplayModel *dm = win->AsFixed();\r\n    if (select) {\r\n        int pageNo = dm->GetPageNoByPoint(win->selectionRect.BR());\r\n        if (win->ctrl->ValidPageNo(pageNo)) {\r\n            PointD pt = dm->CvtFromScreen(win->selectionRect.BR(), pageNo);\r\n            dm->textSelection->SelectUpTo(pageNo, pt.x, pt.y);\r\n        }\r\n    }\r\n\r\n    DeleteOldSelectionInfo(win);\r\n    win->currentTab->selectionOnPage = SelectionOnPage::FromTextSelect(&dm->textSelection->result);\r\n    win->showSelection = win->currentTab->selectionOnPage != nullptr;\r\n\r\n    if (win->uia_provider)\r\n        win->uia_provider->OnSelectionChanged();\r\n}\r\n\r\nvoid ZoomToSelection(WindowInfo *win, float factor, bool scrollToFit, bool relative)\r\n{\r\n    PointI pt;\r\n    bool zoomToPt = false;\r\n\r\n    if (win->AsFixed()) {\r\n        DisplayModel *dm = win->AsFixed();\r\n        // when not zooming to fit (which contradicts zooming to a specific point), ...\r\n        if (!relative && (ZOOM_FIT_PAGE == factor || ZOOM_FIT_CONTENT == factor) && scrollToFit) {\r\n            zoomToPt = false;\r\n        }\r\n        // either scroll towards the center of the current selection (if there is any) ...\r\n        else if (win->showSelection && win->currentTab->selectionOnPage) {\r\n            RectI selRect;\r\n            for (SelectionOnPage& sel : *win->currentTab->selectionOnPage) {\r\n                selRect = selRect.Union(sel.GetRect(dm));\r\n            }\r\n\r\n            ClientRect rc(win->hwndCanvas);\r\n            pt.x = 2 * selRect.x + selRect.dx - rc.dx / 2;\r\n            pt.y = 2 * selRect.y + selRect.dy - rc.dy / 2;\r\n            pt.x = limitValue(pt.x, selRect.x, selRect.x + selRect.dx);\r\n            pt.y = limitValue(pt.y, selRect.y, selRect.y + selRect.dy);\r\n\r\n            int pageNo = dm->GetPageNoByPoint(pt);\r\n            zoomToPt = dm->ValidPageNo(pageNo) && dm->PageVisible(pageNo);\r\n        }\r\n        // or towards the top-left-most part of the first visible page\r\n        else {\r\n            int page = dm->FirstVisiblePageNo();\r\n            PageInfo *pageInfo = dm->GetPageInfo(page);\r\n            if (pageInfo) {\r\n                RectI visible = pageInfo->pageOnScreen.Intersect(win->canvasRc);\r\n                pt = visible.TL();\r\n\r\n                int pageNo = dm->GetPageNoByPoint(pt);\r\n                zoomToPt = !visible.IsEmpty() && dm->ValidPageNo(pageNo) && dm->PageVisible(pageNo);\r\n            }\r\n        }\r\n    }\r\n\r\n    win->ctrl->SetZoomVirtual(factor * (relative ? win->ctrl->GetZoomVirtual(true) : 1), zoomToPt ? &pt : nullptr);\r\n    UpdateToolbarState(win);\r\n}\r\n\r\nvoid CopySelectionToClipboard(WindowInfo *win)\r\n{\r\n    if (!win->currentTab || !win->currentTab->selectionOnPage) return;\r\n    CrashIf(win->currentTab->selectionOnPage->Count() == 0 && win->mouseAction != MA_SELECTING_TEXT);\r\n    if (win->currentTab->selectionOnPage->Count() == 0) return;\r\n    CrashIf(!win->AsFixed());\r\n    if (!win->AsFixed()) return;\r\n\r\n    if (!OpenClipboard(nullptr)) return;\r\n    EmptyClipboard();\r\n\r\n    DisplayModel *dm = win->AsFixed();\r\n#ifndef DISABLE_DOCUMENT_RESTRICTIONS\r\n    if (!dm->GetEngine()->AllowsCopyingText())\r\n        win->ShowNotification(_TR(\"Copying text was denied (copying as image only)\"));\r\n    else\r\n#endif\r\n    if (!dm->GetEngine()->IsImageCollection()) {\r\n        ScopedMem<WCHAR> selText;\r\n        bool isTextSelection = dm->textSelection->result.len > 0;\r\n        if (isTextSelection) {\r\n            selText.Set(dm->textSelection->ExtractText(L\"\\r\\n\"));\r\n        }\r\n        else {\r\n            WStrVec selections;\r\n            for (SelectionOnPage& sel : *win->currentTab->selectionOnPage) {\r\n                WCHAR *text = dm->GetTextInRegion(sel.pageNo, sel.rect);\r\n                if (text)\r\n                    selections.Push(text);\r\n            }\r\n            selText.Set(selections.Join());\r\n        }\r\n\r\n        // don't copy empty text\r\n        if (!str::IsEmpty(selText.Get()))\r\n            CopyTextToClipboard(selText, true);\r\n\r\n        if (isTextSelection) {\r\n            // don't also copy the first line of a text selection as an image\r\n            CloseClipboard();\r\n            return;\r\n        }\r\n    }\r\n\r\n    /* also copy a screenshot of the current selection to the clipboard */\r\n    SelectionOnPage *selOnPage = &win->currentTab->selectionOnPage->At(0);\r\n    RenderedBitmap * bmp = dm->GetEngine()->RenderBitmap(selOnPage->pageNo,\r\n        dm->GetZoomReal(), dm->GetRotation(), &selOnPage->rect, Target_Export);\r\n    if (bmp)\r\n        CopyImageToClipboard(bmp->GetBitmap(), true);\r\n    delete bmp;\r\n\r\n    CloseClipboard();\r\n}\r\n\r\nvoid OnSelectAll(WindowInfo *win, bool textOnly)\r\n{\r\n    if (!HasPermission(Perm_CopySelection))\r\n        return;\r\n\r\n    if (win->hwndFindBox == GetFocus() || win->hwndPageBox == GetFocus()) {\r\n        Edit_SelectAll(GetFocus());\r\n        return;\r\n    }\r\n\r\n    if (win->AsChm()) {\r\n        win->AsChm()->SelectAll();\r\n        return;\r\n    }\r\n    if (!win->AsFixed())\r\n        return;\r\n\r\n    DisplayModel *dm = win->AsFixed();\r\n    if (textOnly) {\r\n        int pageNo;\r\n        for (pageNo = 1; !dm->GetPageInfo(pageNo)->shown; pageNo++);\r\n        dm->textSelection->StartAt(pageNo, 0);\r\n        for (pageNo = win->ctrl->PageCount(); !dm->GetPageInfo(pageNo)->shown; pageNo--);\r\n        dm->textSelection->SelectUpTo(pageNo, -1);\r\n        win->selectionRect = RectI::FromXY(INT_MIN / 2, INT_MIN / 2, INT_MAX, INT_MAX);\r\n        UpdateTextSelection(win);\r\n    }\r\n    else {\r\n        DeleteOldSelectionInfo(win, true);\r\n        win->selectionRect = RectI::FromXY(INT_MIN / 2, INT_MIN / 2, INT_MAX, INT_MAX);\r\n        win->currentTab->selectionOnPage = SelectionOnPage::FromRectangle(dm, win->selectionRect);\r\n    }\r\n\r\n    win->showSelection = win->currentTab->selectionOnPage != nullptr;\r\n    win->RepaintAsync();\r\n}\r\n\r\n#define SELECT_AUTOSCROLL_AREA_WIDTH DpiScaleX(win->hwndFrame, 15)\r\n#define SELECT_AUTOSCROLL_STEP_LENGTH DpiScaleY(win->hwndFrame, 10)\r\n\r\nbool NeedsSelectionEdgeAutoscroll(WindowInfo *win, int x, int y)\r\n{\r\n    return x < SELECT_AUTOSCROLL_AREA_WIDTH || x > win->canvasRc.dx - SELECT_AUTOSCROLL_AREA_WIDTH ||\r\n           y < SELECT_AUTOSCROLL_AREA_WIDTH || y > win->canvasRc.dy - SELECT_AUTOSCROLL_AREA_WIDTH;\r\n}\r\n\r\nvoid OnSelectionEdgeAutoscroll(WindowInfo *win, int x, int y)\r\n{\r\n    int dx = 0, dy = 0;\r\n\r\n    if (x < SELECT_AUTOSCROLL_AREA_WIDTH)\r\n        dx = -SELECT_AUTOSCROLL_STEP_LENGTH;\r\n    else if (x > win->canvasRc.dx - SELECT_AUTOSCROLL_AREA_WIDTH)\r\n        dx = SELECT_AUTOSCROLL_STEP_LENGTH;\r\n    if (y < SELECT_AUTOSCROLL_AREA_WIDTH)\r\n        dy = -SELECT_AUTOSCROLL_STEP_LENGTH;\r\n    else if (y > win->canvasRc.dy - SELECT_AUTOSCROLL_AREA_WIDTH)\r\n        dy = SELECT_AUTOSCROLL_STEP_LENGTH;\r\n\r\n    CrashIf(NeedsSelectionEdgeAutoscroll(win, x, y) != (dx != 0 || dy != 0));\r\n    if (dx != 0 || dy != 0) {\r\n        CrashIf(!win->AsFixed());\r\n        DisplayModel *dm = win->AsFixed();\r\n        PointI oldOffset = dm->GetViewPort().TL();\r\n        win->MoveDocBy(dx, dy);\r\n\r\n        dx = dm->GetViewPort().x - oldOffset.x;\r\n        dy = dm->GetViewPort().y - oldOffset.y;\r\n        win->selectionRect.x -= dx;\r\n        win->selectionRect.y -= dy;\r\n        win->selectionRect.dx += dx;\r\n        win->selectionRect.dy += dy;\r\n    }\r\n}\r\n\r\nvoid OnSelectionStart(WindowInfo *win, int x, int y, WPARAM key)\r\n{\r\n    UNUSED(key);\r\n    CrashIf(!win->AsFixed());\r\n    DeleteOldSelectionInfo(win, true);\r\n\r\n    win->selectionRect = RectI(x, y, 0, 0);\r\n    win->showSelection = true;\r\n    win->mouseAction = MA_SELECTING;\r\n\r\n    bool isShift = IsShiftPressed();\r\n    bool isCtrl = IsCtrlPressed();\r\n\r\n    // Ctrl+drag forces a rectangular selection\r\n    if (!isCtrl || isShift) {\r\n        DisplayModel *dm = win->AsFixed();\r\n        int pageNo = dm->GetPageNoByPoint(PointI(x, y));\r\n        if (dm->ValidPageNo(pageNo)) {\r\n            PointD pt = dm->CvtFromScreen(PointI(x, y), pageNo);\r\n            dm->textSelection->StartAt(pageNo, pt.x, pt.y);\r\n            win->mouseAction = MA_SELECTING_TEXT;\r\n        }\r\n    }\r\n\r\n    SetCapture(win->hwndCanvas);\r\n    SetTimer(win->hwndCanvas, SMOOTHSCROLL_TIMER_ID, SMOOTHSCROLL_DELAY_IN_MS, nullptr);\r\n    win->RepaintAsync();\r\n}\r\n\r\nvoid OnSelectionStop(WindowInfo *win, int x, int y, bool aborted)\r\n{\r\n    if (GetCapture() == win->hwndCanvas)\r\n        ReleaseCapture();\r\n    KillTimer(win->hwndCanvas, SMOOTHSCROLL_TIMER_ID);\r\n\r\n    // update the text selection before changing the selectionRect\r\n    if (MA_SELECTING_TEXT == win->mouseAction)\r\n        UpdateTextSelection(win);\r\n\r\n    win->selectionRect = RectI::FromXY(win->selectionRect.x, win->selectionRect.y, x, y);\r\n    if (aborted || (MA_SELECTING == win->mouseAction ? win->selectionRect.IsEmpty() : !win->currentTab->selectionOnPage))\r\n        DeleteOldSelectionInfo(win, true);\r\n    else if (win->mouseAction == MA_SELECTING) {\r\n        win->currentTab->selectionOnPage = SelectionOnPage::FromRectangle(win->AsFixed(), win->selectionRect);\r\n        win->showSelection = win->currentTab->selectionOnPage != nullptr;\r\n    }\r\n    win->RepaintAsync();\r\n}\r\n"
  },
  {
    "path": "src/Selection.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n#define SMOOTHSCROLL_TIMER_ID       2\r\n#define SMOOTHSCROLL_DELAY_IN_MS    20\r\n#define SMOOTHSCROLL_SLOW_DOWN_FACTOR 10\r\n\r\n/* Represents selected area on given page */\r\nstruct SelectionOnPage {\r\n    explicit SelectionOnPage(int pageNo=0, RectD *rect=nullptr) :\r\n        pageNo(pageNo), rect(rect ? *rect : RectD()) { }\r\n\r\n    int     pageNo; // page this selection is on\r\n    RectD   rect;   // position of selection rectangle on page (in page coordinates)\r\n\r\n    // position of selection rectangle in the view port\r\n    RectI   GetRect(DisplayModel *dm);\r\n\r\n    static Vec<SelectionOnPage> *FromRectangle(DisplayModel *dm, RectI rect);\r\n    static Vec<SelectionOnPage> *FromTextSelect(TextSel *textSel);\r\n};\r\n\r\nvoid DeleteOldSelectionInfo(WindowInfo *win, bool alsoTextSel=false);\r\nvoid PaintTransparentRectangles(HDC hdc, RectI screenRc, Vec<RectI>& rects, COLORREF selectionColor, BYTE alpha=0x5f, int margin=1);\r\nvoid PaintSelection(WindowInfo *win, HDC hdc);\r\nvoid UpdateTextSelection(WindowInfo *win, bool select=true);\r\nvoid ZoomToSelection(WindowInfo *win, float factor, bool scrollToFit=true, bool relative=false);\r\nvoid CopySelectionToClipboard(WindowInfo *win);\r\nvoid OnSelectAll(WindowInfo *win, bool textOnly=false);\r\nbool NeedsSelectionEdgeAutoscroll(WindowInfo *win, int x, int y);\r\nvoid OnSelectionEdgeAutoscroll(WindowInfo *win, int x, int y);\r\nvoid OnSelectionStart(WindowInfo *win, int x, int y, WPARAM key);\r\nvoid OnSelectionStop(WindowInfo *win, int x, int y, bool aborted);\r\n"
  },
  {
    "path": "src/SettingsStructs.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"SettingsStructs.h\"\r\n#include \"GlobalPrefs.h\"\r\n#include \"DebugLog.h\"\r\n#include \"FileUtil.h\"\r\n\r\n namespace prefs {\r\n namespace conv {\r\n\r\n #define DM_AUTOMATIC_STR            \"automatic\"\r\n #define DM_SINGLE_PAGE_STR          \"single page\"\r\n #define DM_FACING_STR               \"facing\"\r\n #define DM_BOOK_VIEW_STR            \"book view\"\r\n #define DM_CONTINUOUS_STR           \"continuous\"\r\n #define DM_CONTINUOUS_FACING_STR    \"continuous facing\"\r\n #define DM_CONTINUOUS_BOOK_VIEW_STR \"continuous book view\"\r\n\r\n #define STR_FROM_ENUM(val) \\\r\n     if (val == mode) \\\r\n         return TEXT(val##_STR); \\\r\n     else NoOp()\r\n\r\n const WCHAR *FromDisplayMode(DisplayMode mode)\r\n {\r\n     STR_FROM_ENUM(DM_AUTOMATIC);\r\n     STR_FROM_ENUM(DM_SINGLE_PAGE);\r\n     STR_FROM_ENUM(DM_FACING);\r\n     STR_FROM_ENUM(DM_BOOK_VIEW);\r\n     STR_FROM_ENUM(DM_CONTINUOUS);\r\n     STR_FROM_ENUM(DM_CONTINUOUS_FACING);\r\n     STR_FROM_ENUM(DM_CONTINUOUS_BOOK_VIEW);\r\n     CrashIf(true);\r\n     return L\"unknown display mode!?\";\r\n }\r\n\r\n #undef STR_FROM_ENUM\r\n\r\n #define IS_STR_ENUM(enumName) \\\r\n     if (str::EqIS(s, TEXT(enumName##_STR))) \\\r\n         return enumName; \\\r\n     else NoOp()\r\n\r\n DisplayMode ToDisplayMode(const WCHAR *s, DisplayMode defVal)\r\n {\r\n     IS_STR_ENUM(DM_AUTOMATIC);\r\n     IS_STR_ENUM(DM_SINGLE_PAGE);\r\n     IS_STR_ENUM(DM_FACING);\r\n     IS_STR_ENUM(DM_BOOK_VIEW);\r\n     IS_STR_ENUM(DM_CONTINUOUS);\r\n     IS_STR_ENUM(DM_CONTINUOUS_FACING);\r\n     IS_STR_ENUM(DM_CONTINUOUS_BOOK_VIEW);\r\n     // for consistency (\"continuous\" is used instead in the settings instead for brevity)\r\n     if (str::EqIS(s, L\"continuous single page\"))\r\n         return DM_CONTINUOUS;\r\n     return defVal;\r\n }\r\n\r\n #undef IS_STR_ENUM\r\n\r\n void FromZoom(char **dst, float zoom, DisplayState *stateForIssue2140)\r\n {\r\n     float prevZoom = *dst ? ToZoom(*dst, INVALID_ZOOM) : INVALID_ZOOM;\r\n     if (prevZoom == zoom)\r\n         return;\r\n     if (!IsValidZoom(zoom) && stateForIssue2140) {\r\n         // TODO: does issue 2140 still occur?\r\n         dbglog::CrashLogF(\"Invalid ds->zoom: %g\", zoom);\r\n         const WCHAR *ext = path::GetExt(stateForIssue2140->filePath);\r\n         if (!str::IsEmpty(ext)) {\r\n             ScopedMem<char> extA(str::conv::ToUtf8(ext));\r\n             dbglog::CrashLogF(\"File type: %s\", extA.Get());\r\n         }\r\n         dbglog::CrashLogF(\"DisplayMode: %S\", stateForIssue2140->displayMode);\r\n         dbglog::CrashLogF(\"PageNo: %d\", stateForIssue2140->pageNo);\r\n     }\r\n     CrashIf(!IsValidZoom(zoom));\r\n     free(*dst);\r\n     if (ZOOM_FIT_PAGE == zoom)\r\n         *dst = str::Dup(\"fit page\");\r\n     else if (ZOOM_FIT_WIDTH == zoom)\r\n         *dst = str::Dup(\"fit width\");\r\n     else if (ZOOM_FIT_CONTENT == zoom)\r\n         *dst = str::Dup(\"fit content\");\r\n     else\r\n         *dst = str::Format(\"%g\", zoom);\r\n }\r\n\r\n float ToZoom(const char *s, float defVal)\r\n {\r\n     if (str::EqIS(s, \"fit page\"))\r\n         return ZOOM_FIT_PAGE;\r\n     if (str::EqIS(s, \"fit width\"))\r\n         return ZOOM_FIT_WIDTH;\r\n     if (str::EqIS(s, \"fit content\"))\r\n         return ZOOM_FIT_CONTENT;\r\n     float zoom;\r\n     if (str::Parse(s, \"%f\", &zoom) && IsValidZoom(zoom))\r\n         return zoom;\r\n     return defVal;\r\n }\r\n\r\n }; // namespace conv\r\n }; // namespace prefs\r\n"
  },
  {
    "path": "src/SettingsStructs.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 (see COPYING) */\r\n\r\n// This file is auto-generated by gen_settingsstructs.py\r\n\r\nenum DisplayMode {\r\n    // automatic means: the continuous form of single page, facing or\r\n    // book view - depending on the document's desired PageLayout\r\n    DM_AUTOMATIC,\r\n    DM_SINGLE_PAGE,\r\n    DM_FACING,\r\n    DM_BOOK_VIEW,\r\n    DM_CONTINUOUS,\r\n    DM_CONTINUOUS_FACING,\r\n    DM_CONTINUOUS_BOOK_VIEW,\r\n};\r\n\r\nclass RenderedBitmap;\r\n\r\ntypedef struct FileState DisplayState;\r\n\r\n// top, right, bottom and left margin (in that order) between window and\r\n// document\r\nstruct WindowMargin {\r\n    // size of the top margin between window and document\r\n    int top;\r\n    // size of the right margin between window and document\r\n    int right;\r\n    // size of the bottom margin between window and document\r\n    int bottom;\r\n    // size of the left margin between window and document\r\n    int left;\r\n};\r\n\r\n// customization options for PDF, XPS, DjVu and PostScript UI\r\nstruct FixedPageUI {\r\n    // color value with which black (text) will be substituted\r\n    COLORREF textColor;\r\n    // color value with which white (background) will be substituted\r\n    COLORREF backgroundColor;\r\n    // color value for the text selection rectangle (also used to highlight\r\n    // found text)\r\n    COLORREF selectionColor;\r\n    // top, right, bottom and left margin (in that order) between window\r\n    // and document\r\n    WindowMargin windowMargin;\r\n    // horizontal and vertical distance between two pages in facing and\r\n    // book view modes\r\n    SizeI pageSpacing;\r\n    // colors to use for the gradient from top to bottom (stops will be\r\n    // inserted at regular intervals throughout the document); currently\r\n    // only up to three colors are supported; the idea behind this\r\n    // experimental feature is that the background might allow to\r\n    // subconsciously determine reading progress; suggested values: #2828aa\r\n    // #28aa28 #aa2828\r\n    Vec<COLORREF> * gradientColors;\r\n    // if true, TextColor and BackgroundColor will be temporarily swapped\r\n    bool invertColors;\r\n};\r\n\r\n// customization options for eBooks (EPUB, Mobi, FictionBook) UI. If\r\n// UseFixedPageUI is true, FixedPageUI settings apply instead\r\nstruct EbookUI {\r\n    // name of the font. takes effect after re-opening the document\r\n    WCHAR * fontName;\r\n    // size of the font. takes effect after re-opening the document\r\n    float fontSize;\r\n    // color for text\r\n    COLORREF textColor;\r\n    // color of the background (page)\r\n    COLORREF backgroundColor;\r\n    // if true, the UI used for PDF documents will be used for ebooks as\r\n    // well (enables printing and searching, disables automatic reflow)\r\n    bool useFixedPageUI;\r\n};\r\n\r\n// customization options for Comic Book and images UI\r\nstruct ComicBookUI {\r\n    // top, right, bottom and left margin (in that order) between window\r\n    // and document\r\n    WindowMargin windowMargin;\r\n    // horizontal and vertical distance between two pages in facing and\r\n    // book view modes\r\n    SizeI pageSpacing;\r\n    // if true, default to displaying Comic Book files in manga mode (from\r\n    // right to left if showing 2 pages at a time)\r\n    bool cbxMangaMode;\r\n};\r\n\r\n// customization options for CHM UI. If UseFixedPageUI is true,\r\n// FixedPageUI settings apply instead\r\nstruct ChmUI {\r\n    // if true, the UI used for PDF documents will be used for CHM\r\n    // documents as well\r\n    bool useFixedPageUI;\r\n};\r\n\r\n// list of additional external viewers for various file types (can have\r\n// multiple entries for the same format)\r\nstruct ExternalViewer {\r\n    // command line with which to call the external viewer, may contain %p\r\n    // for page numer and \"%1\" for the file name (add quotation marks\r\n    // around paths containing spaces)\r\n    WCHAR * commandLine;\r\n    // name of the external viewer to be shown in the menu (implied by\r\n    // CommandLine if missing)\r\n    WCHAR * name;\r\n    // optional filter for which file types the menu item is to be shown;\r\n    // separate multiple entries using ';' and don't include any spaces\r\n    // (e.g. *.pdf;*.xps for all PDF and XPS documents)\r\n    WCHAR * filter;\r\n};\r\n\r\n// unsupported settings for experimentation in prerelease builds\r\nstruct PrereleaseSettings {\r\n    // maximum width of a single tab\r\n    int tabWidth;\r\n};\r\n\r\n// these override the default settings in the Print dialog\r\nstruct PrinterDefaults {\r\n    // default value for scaling (shrink, fit, none)\r\n    char * printScale;\r\n};\r\n\r\n// customization options for how we show forward search results (used\r\n// from LaTeX editors)\r\nstruct ForwardSearch {\r\n    // when set to a positive value, the forward search highlight style\r\n    // will be changed to a rectangle at the left of the page (with the\r\n    // indicated amount of margin from the page margin)\r\n    int highlightOffset;\r\n    // width of the highlight rectangle (if HighlightOffset is > 0)\r\n    int highlightWidth;\r\n    // color used for the forward search highlight\r\n    COLORREF highlightColor;\r\n    // if true, highlight remains visible until the next mouse click\r\n    // (instead of fading away immediately)\r\n    bool highlightPermanent;\r\n};\r\n\r\n// default values for user added annotations in FixedPageUI documents\r\n// (preliminary and still subject to change)\r\nstruct AnnotationDefaults {\r\n    // color used for the highlight tool (in prerelease builds, the current\r\n    // selection can be converted into a highlight annotation by pressing\r\n    // the 'h' key)\r\n    COLORREF highlightColor;\r\n    // if true, annotations are appended to PDF documents, else they're\r\n    // always saved to an external .smx file\r\n    bool saveIntoDocument;\r\n};\r\n\r\n// Values which are persisted for bookmarks/favorites\r\nstruct Favorite {\r\n    // name of this favorite as shown in the menu\r\n    WCHAR * name;\r\n    // number of the bookmarked page\r\n    int pageNo;\r\n    // label for this page (only present if logical and physical page\r\n    // numbers are not the same)\r\n    WCHAR * pageLabel;\r\n    // id of this favorite in the menu (assigned by AppendFavMenuItems)\r\n    int menuId;\r\n};\r\n\r\n// information about opened files (in most recently used order)\r\nstruct FileState {\r\n    // path of the document\r\n    WCHAR * filePath;\r\n    // Values which are persisted for bookmarks/favorites\r\n    Vec<Favorite *> * favorites;\r\n    // a document can be \"pinned\" to the Frequently Read list so that it\r\n    // isn't displaced by recently opened documents\r\n    bool isPinned;\r\n    // if a document can no longer be found but we still remember valuable\r\n    // state, it's classified as missing so that it can be hidden instead\r\n    // of removed\r\n    bool isMissing;\r\n    // in order to prevent documents that haven't been opened for a while\r\n    // but used to be opened very frequently constantly remain in top\r\n    // positions, the openCount will be cut in half after every week, so\r\n    // that the Frequently Read list hopefully better reflects the\r\n    // currently relevant documents\r\n    int openCount;\r\n    // Hex encoded MD5 fingerprint of file content (32 chars) followed by\r\n    // crypt key (64 chars) - only applies for PDF documents\r\n    char * decryptionKey;\r\n    // if true, we use global defaults when opening this file (instead of\r\n    // the values below)\r\n    bool useDefaultState;\r\n    // how pages should be laid out for this document, needs to be\r\n    // synchronized with DefaultDisplayMode after deserialization and\r\n    // before serialization\r\n    WCHAR * displayMode;\r\n    // how far this document has been scrolled (in x and y direction)\r\n    PointI scrollPos;\r\n    // number of the last read page\r\n    int pageNo;\r\n    // zoom (in %) or one of those values: fit page, fit width, fit content\r\n    char * zoom;\r\n    // how far pages have been rotated as a multiple of 90 degrees\r\n    int rotation;\r\n    // state of the window. 1 is normal, 2 is maximized, 3 is fullscreen, 4\r\n    // is minimized\r\n    int windowState;\r\n    // default position (can be on any monitor)\r\n    RectI windowPos;\r\n    // if true, we show table of contents (Bookmarks) sidebar if it's\r\n    // present in the document\r\n    bool showToc;\r\n    // width of the left sidebar panel containing the table of contents\r\n    int sidebarDx;\r\n    // if true, the document is displayed right-to-left in facing and book\r\n    // view modes (only used for comic book documents)\r\n    bool displayR2L;\r\n    // index into an ebook's HTML data from which reparsing has to happen\r\n    // in order to restore the last viewed page (i.e. the equivalent of\r\n    // PageNo for the ebook UI)\r\n    int reparseIdx;\r\n    // tocState is an array of ids for ToC items that have been toggled by\r\n    // the user (i.e. aren't in their default expansion state). - Note: We\r\n    // intentionally track toggle state as opposed to expansion state so\r\n    // that we only have to save a diff instead of all states for the whole\r\n    // tree (which can be quite large) (internal)\r\n    Vec<int> * tocState;\r\n    // thumbnails are saved as PNG files in sumatrapdfcache directory\r\n    RenderedBitmap * thumbnail;\r\n    // temporary value needed for FileHistory::cmpOpenCount\r\n    size_t index;\r\n};\r\n\r\n// a subset of FileState required for restoring the state of a single\r\n// tab (required for handling documents being opened twice)\r\nstruct TabState {\r\n    // path of the document\r\n    WCHAR * filePath;\r\n    // same as FileStates -> DisplayMode\r\n    WCHAR * displayMode;\r\n    // number of the last read page\r\n    int pageNo;\r\n    // same as FileStates -> Zoom\r\n    char * zoom;\r\n    // same as FileStates -> Rotation\r\n    int rotation;\r\n    // how far this document has been scrolled (in x and y direction)\r\n    PointI scrollPos;\r\n    // if true, the table of contents was shown when the document was\r\n    // closed\r\n    bool showToc;\r\n    // same as FileStates -> TocState\r\n    Vec<int> * tocState;\r\n};\r\n\r\n// state of the last session, usage depends on RestoreSession\r\nstruct SessionData {\r\n    // a subset of FileState required for restoring the state of a single\r\n    // tab (required for handling documents being opened twice)\r\n    Vec<TabState *> * tabStates;\r\n    // index of the currently selected tab (1-based)\r\n    int tabIndex;\r\n    // same as FileState -> WindowState\r\n    int windowState;\r\n    // default position (can be on any monitor)\r\n    RectI windowPos;\r\n    // width of favorites/bookmarks sidebar (if shown)\r\n    int sidebarDx;\r\n};\r\n\r\n// Most values on this structure can be updated through the UI and are\r\n// persisted in SumatraPDF-settings.txt (previously in\r\n// sumatrapdfprefs.dat)\r\nstruct GlobalPrefs {\r\n    // background color of the non-document windows, traditionally yellow\r\n    COLORREF mainWindowBackground;\r\n    // if true, Esc key closes SumatraPDF\r\n    bool escToExit;\r\n    // if true, we'll always open files using existing SumatraPDF process\r\n    bool reuseInstance;\r\n    // if true, we use Windows system colors for background/text color.\r\n    // Over-rides other settings\r\n    bool useSysColors;\r\n    // if true and SessionData isn't empty, that session will be restored\r\n    // at startup\r\n    bool restoreSession;\r\n    // customization options for PDF, XPS, DjVu and PostScript UI\r\n    FixedPageUI fixedPageUI;\r\n    // customization options for eBooks (EPUB, Mobi, FictionBook) UI. If\r\n    // UseFixedPageUI is true, FixedPageUI settings apply instead\r\n    EbookUI ebookUI;\r\n    // customization options for Comic Book and images UI\r\n    ComicBookUI comicBookUI;\r\n    // customization options for CHM UI. If UseFixedPageUI is true,\r\n    // FixedPageUI settings apply instead\r\n    ChmUI chmUI;\r\n    // list of additional external viewers for various file types (can have\r\n    // multiple entries for the same format)\r\n    Vec<ExternalViewer *> * externalViewers;\r\n    // unsupported settings for experimentation in prerelease builds\r\n    PrereleaseSettings prereleaseSettings;\r\n    // if false, the menu bar will be hidden for all newly opened windows\r\n    // (use F9 to show it until the window closes or Alt to show it just\r\n    // briefly), only applies if UseTabs is false\r\n    bool showMenubar;\r\n    // if true, a document will be reloaded automatically whenever it's\r\n    // changed (currently doesn't work for documents shown in the ebook UI)\r\n    bool reloadModifiedDocuments;\r\n    // if true, we show the full path to a file in the title bar\r\n    bool fullPathInTitle;\r\n    // zoom levels which zooming steps through in addition to Fit Page, Fit\r\n    // Width and the minimum and maximum allowed values (8.33 and 6400)\r\n    Vec<float> * zoomLevels;\r\n    // zoom step size in percents relative to the current zoom level. if\r\n    // zero or negative, the values from ZoomLevels are used instead\r\n    float zoomIncrement;\r\n    // these override the default settings in the Print dialog\r\n    PrinterDefaults printerDefaults;\r\n    // customization options for how we show forward search results (used\r\n    // from LaTeX editors)\r\n    ForwardSearch forwardSearch;\r\n    // default values for user added annotations in FixedPageUI documents\r\n    // (preliminary and still subject to change)\r\n    AnnotationDefaults annotationDefaults;\r\n    // passwords to try when opening a password protected document\r\n    Vec<WCHAR *> * defaultPasswords;\r\n    // actual resolution of the main screen in DPI (if this value isn't\r\n    // positive, the system's UI setting is used)\r\n    int customScreenDPI;\r\n    // if true, we store display settings for each document separately\r\n    // (i.e. everything after UseDefaultState in FileStates)\r\n    bool rememberStatePerDocument;\r\n    // ISO code of the current UI language\r\n    char * uiLanguage;\r\n    // if true, we show the toolbar at the top of the window\r\n    bool showToolbar;\r\n    // if true, we show the Favorites sidebar\r\n    bool showFavorites;\r\n    // a list of extensions that SumatraPDF has associated itself with and\r\n    // will reassociate if a different application takes over (e.g. \".pdf\r\n    // .xps .epub\")\r\n    WCHAR * associatedExtensions;\r\n    // whether file associations should be fixed silently or only after\r\n    // user feedback\r\n    bool associateSilently;\r\n    // if true, we check once a day if an update is available\r\n    bool checkForUpdates;\r\n    // we won't ask again to update to this version\r\n    WCHAR * versionToSkip;\r\n    // if true, we remember which files we opened and their display\r\n    // settings\r\n    bool rememberOpenedFiles;\r\n    // pattern used to launch the LaTeX editor when doing inverse search\r\n    WCHAR * inverseSearchCmdLine;\r\n    // if true, we expose the SyncTeX inverse search command line in\r\n    // Settings -> Options\r\n    bool enableTeXEnhancements;\r\n    // how pages should be laid out by default, needs to be synchronized\r\n    // with DefaultDisplayMode after deserialization and before\r\n    // serialization\r\n    WCHAR * defaultDisplayMode;\r\n    // default zoom (in %) or one of those values: fit page, fit width, fit\r\n    // content\r\n    char * defaultZoom;\r\n    // default state of new windows (same as the last closed)\r\n    int windowState;\r\n    // default position (can be on any monitor)\r\n    RectI windowPos;\r\n    // if true, we show table of contents (Bookmarks) sidebar if it's\r\n    // present in the document\r\n    bool showToc;\r\n    // width of favorites/bookmarks sidebar (if shown)\r\n    int sidebarDx;\r\n    // if both favorites and bookmarks parts of sidebar are visible, this\r\n    // is the height of bookmarks (table of contents) part\r\n    int tocDy;\r\n    // if true, we show a list of frequently read documents when no\r\n    // document is loaded\r\n    bool showStartPage;\r\n    // if true, documents are opened in tabs instead of new windows\r\n    bool useTabs;\r\n    // information about opened files (in most recently used order)\r\n    Vec<FileState *> * fileStates;\r\n    // state of the last session, usage depends on RestoreSession\r\n    Vec<SessionData *> * sessionData;\r\n    // a list of paths for files to be reopened at the next start or the\r\n    // string \"SessionData\" if this data is saved in SessionData (needed\r\n    // for auto-updating)\r\n    Vec<WCHAR *> * reopenOnce;\r\n    // timestamp of the last update check\r\n    FILETIME timeOfLastUpdateCheck;\r\n    // week count since 2011-01-01 needed to \"age\" openCount values in file\r\n    // history\r\n    int openCountWeek;\r\n    // modification time of the preferences file when it was last read\r\n    FILETIME lastPrefUpdate;\r\n    // value of DefaultDisplayMode for internal usage\r\n    DisplayMode defaultDisplayModeEnum;\r\n    // value of DefaultZoom for internal usage\r\n    float defaultZoomFloat;\r\n};\r\n\r\n#ifdef INCLUDE_SETTINGSSTRUCTS_METADATA\r\n\r\nstatic const FieldInfo gWindowMarginFields[] = {\r\n    { offsetof(WindowMargin, top),    Type_Int, 2 },\r\n    { offsetof(WindowMargin, right),  Type_Int, 4 },\r\n    { offsetof(WindowMargin, bottom), Type_Int, 2 },\r\n    { offsetof(WindowMargin, left),   Type_Int, 4 },\r\n};\r\nstatic const StructInfo gWindowMarginInfo = { sizeof(WindowMargin), 4, gWindowMarginFields, \"Top\\0Right\\0Bottom\\0Left\" };\r\n\r\nstatic const FieldInfo gSizeIFields[] = {\r\n    { offsetof(SizeI, dx), Type_Int, 4 },\r\n    { offsetof(SizeI, dy), Type_Int, 4 },\r\n};\r\nstatic const StructInfo gSizeIInfo = { sizeof(SizeI), 2, gSizeIFields, \"Dx\\0Dy\" };\r\n\r\nstatic const FieldInfo gFixedPageUIFields[] = {\r\n    { offsetof(FixedPageUI, textColor),       Type_Color,      0x000000                     },\r\n    { offsetof(FixedPageUI, backgroundColor), Type_Color,      0xffffff                     },\r\n    { offsetof(FixedPageUI, selectionColor),  Type_Color,      0x0cfcf5                     },\r\n    { offsetof(FixedPageUI, windowMargin),    Type_Compact,    (intptr_t)&gWindowMarginInfo },\r\n    { offsetof(FixedPageUI, pageSpacing),     Type_Compact,    (intptr_t)&gSizeIInfo        },\r\n    { offsetof(FixedPageUI, gradientColors),  Type_ColorArray, 0                            },\r\n};\r\nstatic const StructInfo gFixedPageUIInfo = { sizeof(FixedPageUI), 6, gFixedPageUIFields, \"TextColor\\0BackgroundColor\\0SelectionColor\\0WindowMargin\\0PageSpacing\\0GradientColors\" };\r\n\r\nstatic const FieldInfo gEbookUIFields[] = {\r\n    { offsetof(EbookUI, fontName),        Type_String, (intptr_t)L\"Georgia\" },\r\n    { offsetof(EbookUI, fontSize),        Type_Float,  (intptr_t)\"12.5\"     },\r\n    { offsetof(EbookUI, textColor),       Type_Color,  0x324b5f             },\r\n    { offsetof(EbookUI, backgroundColor), Type_Color,  0xd9f0fb             },\r\n    { offsetof(EbookUI, useFixedPageUI),  Type_Bool,   false                },\r\n};\r\nstatic const StructInfo gEbookUIInfo = { sizeof(EbookUI), 5, gEbookUIFields, \"FontName\\0FontSize\\0TextColor\\0BackgroundColor\\0UseFixedPageUI\" };\r\n\r\nstatic const FieldInfo gWindowMargin_1_Fields[] = {\r\n    { offsetof(WindowMargin, top),    Type_Int, 0 },\r\n    { offsetof(WindowMargin, right),  Type_Int, 0 },\r\n    { offsetof(WindowMargin, bottom), Type_Int, 0 },\r\n    { offsetof(WindowMargin, left),   Type_Int, 0 },\r\n};\r\nstatic const StructInfo gWindowMargin_1_Info = { sizeof(WindowMargin), 4, gWindowMargin_1_Fields, \"Top\\0Right\\0Bottom\\0Left\" };\r\n\r\nstatic const FieldInfo gSizeI_1_Fields[] = {\r\n    { offsetof(SizeI, dx), Type_Int, 4 },\r\n    { offsetof(SizeI, dy), Type_Int, 4 },\r\n};\r\nstatic const StructInfo gSizeI_1_Info = { sizeof(SizeI), 2, gSizeI_1_Fields, \"Dx\\0Dy\" };\r\n\r\nstatic const FieldInfo gComicBookUIFields[] = {\r\n    { offsetof(ComicBookUI, windowMargin), Type_Compact, (intptr_t)&gWindowMargin_1_Info },\r\n    { offsetof(ComicBookUI, pageSpacing),  Type_Compact, (intptr_t)&gSizeI_1_Info        },\r\n    { offsetof(ComicBookUI, cbxMangaMode), Type_Bool,    false                           },\r\n};\r\nstatic const StructInfo gComicBookUIInfo = { sizeof(ComicBookUI), 3, gComicBookUIFields, \"WindowMargin\\0PageSpacing\\0CbxMangaMode\" };\r\n\r\nstatic const FieldInfo gChmUIFields[] = {\r\n    { offsetof(ChmUI, useFixedPageUI), Type_Bool, false },\r\n};\r\nstatic const StructInfo gChmUIInfo = { sizeof(ChmUI), 1, gChmUIFields, \"UseFixedPageUI\" };\r\n\r\nstatic const FieldInfo gExternalViewerFields[] = {\r\n    { offsetof(ExternalViewer, commandLine), Type_String, 0 },\r\n    { offsetof(ExternalViewer, name),        Type_String, 0 },\r\n    { offsetof(ExternalViewer, filter),      Type_String, 0 },\r\n};\r\nstatic const StructInfo gExternalViewerInfo = { sizeof(ExternalViewer), 3, gExternalViewerFields, \"CommandLine\\0Name\\0Filter\" };\r\n\r\nstatic const FieldInfo gPrereleaseSettingsFields[] = {\r\n    { offsetof(PrereleaseSettings, tabWidth), Type_Int, 300 },\r\n};\r\nstatic const StructInfo gPrereleaseSettingsInfo = { sizeof(PrereleaseSettings), 1, gPrereleaseSettingsFields, \"TabWidth\" };\r\n\r\nstatic const FieldInfo gPrinterDefaultsFields[] = {\r\n    { offsetof(PrinterDefaults, printScale), Type_Utf8String, (intptr_t)\"shrink\" },\r\n};\r\nstatic const StructInfo gPrinterDefaultsInfo = { sizeof(PrinterDefaults), 1, gPrinterDefaultsFields, \"PrintScale\" };\r\n\r\nstatic const FieldInfo gForwardSearchFields[] = {\r\n    { offsetof(ForwardSearch, highlightOffset),    Type_Int,   0        },\r\n    { offsetof(ForwardSearch, highlightWidth),     Type_Int,   15       },\r\n    { offsetof(ForwardSearch, highlightColor),     Type_Color, 0xff8165 },\r\n    { offsetof(ForwardSearch, highlightPermanent), Type_Bool,  false    },\r\n};\r\nstatic const StructInfo gForwardSearchInfo = { sizeof(ForwardSearch), 4, gForwardSearchFields, \"HighlightOffset\\0HighlightWidth\\0HighlightColor\\0HighlightPermanent\" };\r\n\r\nstatic const FieldInfo gAnnotationDefaultsFields[] = {\r\n    { offsetof(AnnotationDefaults, highlightColor),   Type_Color, 0x60ffff },\r\n    { offsetof(AnnotationDefaults, saveIntoDocument), Type_Bool,  true     },\r\n};\r\nstatic const StructInfo gAnnotationDefaultsInfo = { sizeof(AnnotationDefaults), 2, gAnnotationDefaultsFields, \"HighlightColor\\0SaveIntoDocument\" };\r\n\r\nstatic const FieldInfo gRectIFields[] = {\r\n    { offsetof(RectI, x),  Type_Int, 0 },\r\n    { offsetof(RectI, y),  Type_Int, 0 },\r\n    { offsetof(RectI, dx), Type_Int, 0 },\r\n    { offsetof(RectI, dy), Type_Int, 0 },\r\n};\r\nstatic const StructInfo gRectIInfo = { sizeof(RectI), 4, gRectIFields, \"X\\0Y\\0Dx\\0Dy\" };\r\n\r\nstatic const FieldInfo gFavoriteFields[] = {\r\n    { offsetof(Favorite, name),      Type_String, 0 },\r\n    { offsetof(Favorite, pageNo),    Type_Int,    0 },\r\n    { offsetof(Favorite, pageLabel), Type_String, 0 },\r\n};\r\nstatic const StructInfo gFavoriteInfo = { sizeof(Favorite), 3, gFavoriteFields, \"Name\\0PageNo\\0PageLabel\" };\r\n\r\nstatic const FieldInfo gPointIFields[] = {\r\n    { offsetof(PointI, x), Type_Int, 0 },\r\n    { offsetof(PointI, y), Type_Int, 0 },\r\n};\r\nstatic const StructInfo gPointIInfo = { sizeof(PointI), 2, gPointIFields, \"X\\0Y\" };\r\n\r\nstatic const FieldInfo gRectI_1_Fields[] = {\r\n    { offsetof(RectI, x),  Type_Int, 0 },\r\n    { offsetof(RectI, y),  Type_Int, 0 },\r\n    { offsetof(RectI, dx), Type_Int, 0 },\r\n    { offsetof(RectI, dy), Type_Int, 0 },\r\n};\r\nstatic const StructInfo gRectI_1_Info = { sizeof(RectI), 4, gRectI_1_Fields, \"X\\0Y\\0Dx\\0Dy\" };\r\n\r\nstatic const FieldInfo gFileStateFields[] = {\r\n    { offsetof(FileState, filePath),        Type_String,     0                        },\r\n    { offsetof(FileState, favorites),       Type_Array,      (intptr_t)&gFavoriteInfo },\r\n    { offsetof(FileState, isPinned),        Type_Bool,       false                    },\r\n    { offsetof(FileState, isMissing),       Type_Bool,       false                    },\r\n    { offsetof(FileState, openCount),       Type_Int,        0                        },\r\n    { offsetof(FileState, decryptionKey),   Type_Utf8String, 0                        },\r\n    { offsetof(FileState, useDefaultState), Type_Bool,       false                    },\r\n    { offsetof(FileState, displayMode),     Type_String,     (intptr_t)L\"automatic\"   },\r\n    { offsetof(FileState, scrollPos),       Type_Compact,    (intptr_t)&gPointIInfo   },\r\n    { offsetof(FileState, pageNo),          Type_Int,        1                        },\r\n    { offsetof(FileState, zoom),            Type_Utf8String, (intptr_t)\"fit page\"     },\r\n    { offsetof(FileState, rotation),        Type_Int,        0                        },\r\n    { offsetof(FileState, windowState),     Type_Int,        0                        },\r\n    { offsetof(FileState, windowPos),       Type_Compact,    (intptr_t)&gRectI_1_Info },\r\n    { offsetof(FileState, showToc),         Type_Bool,       true                     },\r\n    { offsetof(FileState, sidebarDx),       Type_Int,        0                        },\r\n    { offsetof(FileState, displayR2L),      Type_Bool,       false                    },\r\n    { offsetof(FileState, reparseIdx),      Type_Int,        0                        },\r\n    { offsetof(FileState, tocState),        Type_IntArray,   0                        },\r\n};\r\nstatic StructInfo gFileStateInfo = { sizeof(FileState), 19, gFileStateFields, \"FilePath\\0Favorites\\0IsPinned\\0IsMissing\\0OpenCount\\0DecryptionKey\\0UseDefaultState\\0DisplayMode\\0ScrollPos\\0PageNo\\0Zoom\\0Rotation\\0WindowState\\0WindowPos\\0ShowToc\\0SidebarDx\\0DisplayR2L\\0ReparseIdx\\0TocState\" };\r\n\r\nstatic const FieldInfo gPointI_1_Fields[] = {\r\n    { offsetof(PointI, x), Type_Int, 0 },\r\n    { offsetof(PointI, y), Type_Int, 0 },\r\n};\r\nstatic const StructInfo gPointI_1_Info = { sizeof(PointI), 2, gPointI_1_Fields, \"X\\0Y\" };\r\n\r\nstatic const FieldInfo gTabStateFields[] = {\r\n    { offsetof(TabState, filePath),    Type_String,     0                         },\r\n    { offsetof(TabState, displayMode), Type_String,     (intptr_t)L\"automatic\"    },\r\n    { offsetof(TabState, pageNo),      Type_Int,        1                         },\r\n    { offsetof(TabState, zoom),        Type_Utf8String, (intptr_t)\"fit page\"      },\r\n    { offsetof(TabState, rotation),    Type_Int,        0                         },\r\n    { offsetof(TabState, scrollPos),   Type_Compact,    (intptr_t)&gPointI_1_Info },\r\n    { offsetof(TabState, showToc),     Type_Bool,       true                      },\r\n    { offsetof(TabState, tocState),    Type_IntArray,   0                         },\r\n};\r\nstatic const StructInfo gTabStateInfo = { sizeof(TabState), 8, gTabStateFields, \"FilePath\\0DisplayMode\\0PageNo\\0Zoom\\0Rotation\\0ScrollPos\\0ShowToc\\0TocState\" };\r\n\r\nstatic const FieldInfo gRectI_2_Fields[] = {\r\n    { offsetof(RectI, x),  Type_Int, 0 },\r\n    { offsetof(RectI, y),  Type_Int, 0 },\r\n    { offsetof(RectI, dx), Type_Int, 0 },\r\n    { offsetof(RectI, dy), Type_Int, 0 },\r\n};\r\nstatic const StructInfo gRectI_2_Info = { sizeof(RectI), 4, gRectI_2_Fields, \"X\\0Y\\0Dx\\0Dy\" };\r\n\r\nstatic const FieldInfo gSessionDataFields[] = {\r\n    { offsetof(SessionData, tabStates),   Type_Array,   (intptr_t)&gTabStateInfo },\r\n    { offsetof(SessionData, tabIndex),    Type_Int,     1                        },\r\n    { offsetof(SessionData, windowState), Type_Int,     0                        },\r\n    { offsetof(SessionData, windowPos),   Type_Compact, (intptr_t)&gRectI_2_Info },\r\n    { offsetof(SessionData, sidebarDx),   Type_Int,     0                        },\r\n};\r\nstatic const StructInfo gSessionDataInfo = { sizeof(SessionData), 5, gSessionDataFields, \"TabStates\\0TabIndex\\0WindowState\\0WindowPos\\0SidebarDx\" };\r\n\r\nstatic const FieldInfo gFILETIMEFields[] = {\r\n    { offsetof(FILETIME, dwHighDateTime), Type_Int, 0 },\r\n    { offsetof(FILETIME, dwLowDateTime),  Type_Int, 0 },\r\n};\r\nstatic const StructInfo gFILETIMEInfo = { sizeof(FILETIME), 2, gFILETIMEFields, \"DwHighDateTime\\0DwLowDateTime\" };\r\n\r\nstatic const FieldInfo gGlobalPrefsFields[] = {\r\n    { (size_t)-1,                                      Type_Comment,     (intptr_t)\"For documentation, see http://www.sumatrapdfreader.org/settings3.2.html\"                                   },\r\n    { (size_t)-1,                                      Type_Comment,     0                                                                                                                     },\r\n    { offsetof(GlobalPrefs, mainWindowBackground),     Type_Color,       0x8000f2ff                                                                                                            },\r\n    { offsetof(GlobalPrefs, escToExit),                Type_Bool,        false                                                                                                                 },\r\n    { offsetof(GlobalPrefs, reuseInstance),            Type_Bool,        false                                                                                                                 },\r\n    { offsetof(GlobalPrefs, useSysColors),             Type_Bool,        false                                                                                                                 },\r\n    { offsetof(GlobalPrefs, restoreSession),           Type_Bool,        true                                                                                                                  },\r\n    { (size_t)-1,                                      Type_Comment,     0                                                                                                                     },\r\n    { offsetof(GlobalPrefs, fixedPageUI),              Type_Struct,      (intptr_t)&gFixedPageUIInfo                                                                                           },\r\n    { offsetof(GlobalPrefs, ebookUI),                  Type_Struct,      (intptr_t)&gEbookUIInfo                                                                                               },\r\n    { offsetof(GlobalPrefs, comicBookUI),              Type_Struct,      (intptr_t)&gComicBookUIInfo                                                                                           },\r\n    { offsetof(GlobalPrefs, chmUI),                    Type_Struct,      (intptr_t)&gChmUIInfo                                                                                                 },\r\n    { offsetof(GlobalPrefs, externalViewers),          Type_Array,       (intptr_t)&gExternalViewerInfo                                                                                        },\r\n    { offsetof(GlobalPrefs, prereleaseSettings),       Type_Prerelease,  (intptr_t)&gPrereleaseSettingsInfo                                                                                    },\r\n    { offsetof(GlobalPrefs, showMenubar),              Type_Bool,        true                                                                                                                  },\r\n    { offsetof(GlobalPrefs, reloadModifiedDocuments),  Type_Bool,        true                                                                                                                  },\r\n    { offsetof(GlobalPrefs, fullPathInTitle),          Type_Bool,        false                                                                                                                 },\r\n    { offsetof(GlobalPrefs, zoomLevels),               Type_FloatArray,  (intptr_t)\"8.33 12.5 18 25 33.33 50 66.67 75 100 125 150 200 300 400 600 800 1000 1200 1600 2000 2400 3200 4800 6400\" },\r\n    { offsetof(GlobalPrefs, zoomIncrement),            Type_Float,       (intptr_t)\"0\"                                                                                                         },\r\n    { (size_t)-1,                                      Type_Comment,     0                                                                                                                     },\r\n    { offsetof(GlobalPrefs, printerDefaults),          Type_Struct,      (intptr_t)&gPrinterDefaultsInfo                                                                                       },\r\n    { offsetof(GlobalPrefs, forwardSearch),            Type_Struct,      (intptr_t)&gForwardSearchInfo                                                                                         },\r\n    { offsetof(GlobalPrefs, annotationDefaults),       Type_Prerelease,  (intptr_t)&gAnnotationDefaultsInfo                                                                                    },\r\n    { offsetof(GlobalPrefs, defaultPasswords),         Type_StringArray, 0                                                                                                                     },\r\n    { offsetof(GlobalPrefs, customScreenDPI),          Type_Int,         0                                                                                                                     },\r\n    { (size_t)-1,                                      Type_Comment,     0                                                                                                                     },\r\n    { offsetof(GlobalPrefs, rememberStatePerDocument), Type_Bool,        true                                                                                                                  },\r\n    { offsetof(GlobalPrefs, uiLanguage),               Type_Utf8String,  0                                                                                                                     },\r\n    { offsetof(GlobalPrefs, showToolbar),              Type_Bool,        true                                                                                                                  },\r\n    { offsetof(GlobalPrefs, showFavorites),            Type_Bool,        false                                                                                                                 },\r\n    { offsetof(GlobalPrefs, associatedExtensions),     Type_String,      0                                                                                                                     },\r\n    { offsetof(GlobalPrefs, associateSilently),        Type_Bool,        false                                                                                                                 },\r\n    { offsetof(GlobalPrefs, checkForUpdates),          Type_Bool,        true                                                                                                                  },\r\n    { offsetof(GlobalPrefs, versionToSkip),            Type_String,      0                                                                                                                     },\r\n    { offsetof(GlobalPrefs, rememberOpenedFiles),      Type_Bool,        true                                                                                                                  },\r\n    { offsetof(GlobalPrefs, inverseSearchCmdLine),     Type_String,      0                                                                                                                     },\r\n    { offsetof(GlobalPrefs, enableTeXEnhancements),    Type_Bool,        false                                                                                                                 },\r\n    { offsetof(GlobalPrefs, defaultDisplayMode),       Type_String,      (intptr_t)L\"automatic\"                                                                                                },\r\n    { offsetof(GlobalPrefs, defaultZoom),              Type_Utf8String,  (intptr_t)\"fit page\"                                                                                                  },\r\n    { offsetof(GlobalPrefs, windowState),              Type_Int,         1                                                                                                                     },\r\n    { offsetof(GlobalPrefs, windowPos),                Type_Compact,     (intptr_t)&gRectIInfo                                                                                                 },\r\n    { offsetof(GlobalPrefs, showToc),                  Type_Bool,        true                                                                                                                  },\r\n    { offsetof(GlobalPrefs, sidebarDx),                Type_Int,         0                                                                                                                     },\r\n    { offsetof(GlobalPrefs, tocDy),                    Type_Int,         0                                                                                                                     },\r\n    { offsetof(GlobalPrefs, showStartPage),            Type_Bool,        true                                                                                                                  },\r\n    { offsetof(GlobalPrefs, useTabs),                  Type_Bool,        true                                                                                                                  },\r\n    { (size_t)-1,                                      Type_Comment,     0                                                                                                                     },\r\n    { offsetof(GlobalPrefs, fileStates),               Type_Array,       (intptr_t)&gFileStateInfo                                                                                             },\r\n    { offsetof(GlobalPrefs, sessionData),              Type_Array,       (intptr_t)&gSessionDataInfo                                                                                           },\r\n    { offsetof(GlobalPrefs, reopenOnce),               Type_StringArray, 0                                                                                                                     },\r\n    { offsetof(GlobalPrefs, timeOfLastUpdateCheck),    Type_Compact,     (intptr_t)&gFILETIMEInfo                                                                                              },\r\n    { offsetof(GlobalPrefs, openCountWeek),            Type_Int,         0                                                                                                                     },\r\n    { (size_t)-1,                                      Type_Comment,     0                                                                                                                     },\r\n    { (size_t)-1,                                      Type_Comment,     (intptr_t)\"Settings after this line have not been recognized by the current version\"                                  },\r\n};\r\nstatic const StructInfo gGlobalPrefsInfo = { sizeof(GlobalPrefs), 54, gGlobalPrefsFields, \"\\0\\0MainWindowBackground\\0EscToExit\\0ReuseInstance\\0UseSysColors\\0RestoreSession\\0\\0FixedPageUI\\0EbookUI\\0ComicBookUI\\0ChmUI\\0ExternalViewers\\0PrereleaseSettings\\0ShowMenubar\\0ReloadModifiedDocuments\\0FullPathInTitle\\0ZoomLevels\\0ZoomIncrement\\0\\0PrinterDefaults\\0ForwardSearch\\0AnnotationDefaults\\0DefaultPasswords\\0CustomScreenDPI\\0\\0RememberStatePerDocument\\0UiLanguage\\0ShowToolbar\\0ShowFavorites\\0AssociatedExtensions\\0AssociateSilently\\0CheckForUpdates\\0VersionToSkip\\0RememberOpenedFiles\\0InverseSearchCmdLine\\0EnableTeXEnhancements\\0DefaultDisplayMode\\0DefaultZoom\\0WindowState\\0WindowPos\\0ShowToc\\0SidebarDx\\0TocDy\\0ShowStartPage\\0UseTabs\\0\\0FileStates\\0SessionData\\0ReopenOnce\\0TimeOfLastUpdateCheck\\0OpenCountWeek\\0\\0\" };\r\n\r\n#endif\r\n"
  },
  {
    "path": "src/StressTesting.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"DirIter.h\"\r\n#include \"FileUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"HtmlWindow.h\"\r\n#include \"Mui.h\"\r\n#include \"SimpleLog.h\"\r\n#include \"Timer.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EngineManager.h\"\r\n#include \"EbookBase.h\"\r\n#include \"HtmlFormatter.h\"\r\n#include \"EbookFormatter.h\"\r\n#include \"Doc.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"ChmModel.h\"\r\n#include \"DisplayModel.h\"\r\n#include \"EbookController.h\"\r\n#include \"GlobalPrefs.h\"\r\n#include \"RenderCache.h\"\r\n#include \"TextSelection.h\"\r\n#include \"TextSearch.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"WindowInfo.h\"\r\n#include \"TabInfo.h\"\r\n#include \"AppTools.h\"\r\n#include \"ParseCommandLine.h\"\r\n#include \"Search.h\"\r\n#include \"StressTesting.h\"\r\n\r\n#define FIRST_STRESS_TIMER_ID 101\r\n\r\nstatic slog::Logger *gLog;\r\n#define logbench(msg, ...) gLog->LogFmt(msg, __VA_ARGS__)\r\n\r\nstatic bool gIsStressTesting = false;\r\nstatic int gCurrStressTimerId = FIRST_STRESS_TIMER_ID;\r\n\r\nbool IsStressTesting()\r\n{\r\n    return gIsStressTesting;\r\n}\r\n\r\nstatic bool IsInRange(Vec<PageRange>& ranges, int pageNo)\r\n{\r\n    for (size_t i = 0; i < ranges.Count(); i++) {\r\n        if (ranges.At(i).start <= pageNo && pageNo <= ranges.At(i).end)\r\n            return true;\r\n    }\r\n    return false;\r\n}\r\n\r\nstatic void BenchLoadRender(BaseEngine *engine, int pagenum)\r\n{\r\n    Timer t;\r\n    bool ok = engine->BenchLoadPage(pagenum);\r\n    t.Stop();\r\n\r\n    if (!ok) {\r\n        logbench(L\"Error: failed to load page %d\", pagenum);\r\n        return;\r\n    }\r\n    double timeMs = t.GetTimeInMs();\r\n    logbench(L\"pageload   %3d: %.2f ms\", pagenum, timeMs);\r\n\r\n    t.Start();\r\n    RenderedBitmap *rendered = engine->RenderBitmap(pagenum, 1.0, 0);\r\n    t.Stop();\r\n\r\n    if (!rendered) {\r\n        logbench(L\"Error: failed to render page %d\", pagenum);\r\n        return;\r\n    }\r\n    delete rendered;\r\n    timeMs = t.GetTimeInMs();\r\n    logbench(L\"pagerender %3d: %.2f ms\", pagenum, timeMs);\r\n}\r\n\r\nstatic int FormatWholeDoc(Doc& doc) {\r\n    int PAGE_DX = 640;\r\n    int PAGE_DY = 520;\r\n\r\n    PoolAllocator textAllocator;\r\n    HtmlFormatterArgs *formatterArgs = CreateFormatterArgsDoc(doc, PAGE_DX, PAGE_DY, &textAllocator);\r\n\r\n    HtmlFormatter *formatter = doc.CreateFormatter(formatterArgs);\r\n    int nPages = 0;\r\n    for (HtmlPage *pd = formatter->Next(); pd; pd = formatter->Next()) {\r\n        delete pd;\r\n        ++nPages;\r\n    }\r\n    delete formatterArgs;\r\n    delete formatter;\r\n    return nPages;\r\n}\r\n\r\nstatic int TimeOneMethod(Doc&doc, TextRenderMethod method, const WCHAR *methodName) {\r\n    SetTextRenderMethod(method);\r\n    Timer t;\r\n    int nPages = FormatWholeDoc(doc);\r\n    double timesms = t.Stop();\r\n    logbench(L\"%s: %.2f ms\", methodName, timesms);\r\n    return nPages;\r\n}\r\n\r\n// this is to compare the time it takes to layout a whole ebook file\r\n// using different text measurement method (since the time is mostly\r\n// dominated by text measure)\r\nvoid BenchEbookLayout(const WCHAR *filePath) {\r\n    bool deleteLog = false;\r\n    if (!gLog) {\r\n        gLog = new slog::StderrLogger();\r\n        deleteLog = true;\r\n    }\r\n    logbench(L\"Starting: %s\", filePath);\r\n    if (!file::Exists(filePath)) {\r\n        logbench(L\"Error: file doesn't exist\");\r\n        return;\r\n    }\r\n    if (!Doc::IsSupportedFile(filePath)) {\r\n        logbench(L\"Error: not an ebook file\");\r\n        return;\r\n    }\r\n    Timer t;\r\n    Doc doc = Doc::CreateFromFile(filePath);\r\n    if (doc.LoadingFailed()) {\r\n        logbench(L\"Error: failed to load the file as doc\");\r\n        doc.Delete();\r\n        return;\r\n    }\r\n    double timeMs = t.Stop();\r\n    logbench(L\"load: %.2f ms\", timeMs);\r\n\r\n    int nPages = TimeOneMethod(doc, TextRenderMethodGdi,          L\"gdi       \");\r\n    TimeOneMethod(doc, TextRenderMethodGdiplus,      L\"gdi+      \");\r\n    TimeOneMethod(doc, TextRenderMethodGdiplusQuick, L\"gdi+ quick\");\r\n\r\n    // do it twice because the first run is very unfair to the first version that runs\r\n    // (probably because of font caching)\r\n    TimeOneMethod(doc, TextRenderMethodGdi,          L\"gdi       \");\r\n    TimeOneMethod(doc, TextRenderMethodGdiplus,      L\"gdi+      \");\r\n    TimeOneMethod(doc, TextRenderMethodGdiplusQuick, L\"gdi+ quick\");\r\n\r\n    doc.Delete();\r\n\r\n    logbench(L\"pages: %d\", nPages);\r\n    if (deleteLog) {\r\n        delete gLog;\r\n    }\r\n}\r\n\r\nstatic void BenchChmLoadOnly(const WCHAR *filePath)\r\n{\r\n    Timer total;\r\n    logbench(L\"Starting: %s\", filePath);\r\n\r\n    Timer t;\r\n    ChmModel *chmModel = ChmModel::Create(filePath, nullptr);\r\n    if (!chmModel) {\r\n        logbench(L\"Error: failed to load %s\", filePath);\r\n        return;\r\n    }\r\n\r\n    double timeMs = t.Stop();\r\n    logbench(L\"load: %.2f ms\", timeMs);\r\n\r\n    delete chmModel;\r\n    total.Stop();\r\n\r\n    logbench(L\"Finished (in %.2f ms): %s\", total.GetTimeInMs(), filePath);\r\n}\r\n\r\nstatic void BenchFile(const WCHAR *filePath, const WCHAR *pagesSpec)\r\n{\r\n    if (!file::Exists(filePath)) {\r\n        return;\r\n    }\r\n\r\n    // ad-hoc: if enabled times layout instead of rendering and does layout\r\n    // using all text rendering methods, so that we can compare and find\r\n    // docs that take a long time to load\r\n\r\n    if (Doc::IsSupportedFile(filePath) && !gGlobalPrefs->ebookUI.useFixedPageUI) {\r\n        BenchEbookLayout(filePath);\r\n        return;\r\n    }\r\n\r\n    if (ChmModel::IsSupportedFile(filePath) && !gGlobalPrefs->chmUI.useFixedPageUI) {\r\n        BenchChmLoadOnly(filePath);\r\n        return;\r\n    }\r\n\r\n    Timer total;\r\n    logbench(L\"Starting: %s\", filePath);\r\n\r\n    Timer t;\r\n    BaseEngine *engine = EngineManager::CreateEngine(filePath);\r\n    if (!engine) {\r\n        logbench(L\"Error: failed to load %s\", filePath);\r\n        return;\r\n    }\r\n\r\n    double timeMs = t.Stop();\r\n    logbench(L\"load: %.2f ms\", timeMs);\r\n    int pages = engine->PageCount();\r\n    logbench(L\"page count: %d\", pages);\r\n\r\n    if (nullptr == pagesSpec) {\r\n        for (int i = 1; i <= pages; i++) {\r\n            BenchLoadRender(engine, i);\r\n        }\r\n    }\r\n\r\n    assert(!pagesSpec || IsBenchPagesInfo(pagesSpec));\r\n    Vec<PageRange> ranges;\r\n    if (ParsePageRanges(pagesSpec, ranges)) {\r\n        for (size_t i = 0; i < ranges.Count(); i++) {\r\n            for (int j = ranges.At(i).start; j <= ranges.At(i).end; j++) {\r\n                if (1 <= j && j <= pages)\r\n                    BenchLoadRender(engine, j);\r\n            }\r\n        }\r\n    }\r\n\r\n    delete engine;\r\n    total.Stop();\r\n\r\n    logbench(L\"Finished (in %.2f ms): %s\", total.GetTimeInMs(), filePath);\r\n}\r\n\r\nstatic bool IsFileToBench(const WCHAR *fileName)\r\n{\r\n    if (EngineManager::IsSupportedFile(fileName))\r\n        return true;\r\n    if (Doc::IsSupportedFile(fileName))\r\n        return true;\r\n    return false;\r\n}\r\n\r\nstatic void CollectFilesToBench(WCHAR *dir, WStrVec& files)\r\n{\r\n    DirIter di(dir, true /* recursive */);\r\n    for (const WCHAR *filePath = di.First(); filePath; filePath = di.Next()) {\r\n        if (IsFileToBench(filePath)) {\r\n            files.Append(str::Dup(filePath));\r\n        }\r\n    }\r\n}\r\n\r\nstatic void BenchDir(WCHAR *dir)\r\n{\r\n    WStrVec files;\r\n    CollectFilesToBench(dir, files);\r\n    for (size_t i = 0; i < files.Count(); i++) {\r\n        BenchFile(files.At(i), nullptr);\r\n    }\r\n}\r\n\r\nvoid BenchFileOrDir(WStrVec& pathsToBench)\r\n{\r\n    gLog = new slog::StderrLogger();\r\n\r\n    size_t n = pathsToBench.Count() / 2;\r\n    for (size_t i = 0; i < n; i++) {\r\n        WCHAR *path = pathsToBench.At(2 * i);\r\n        if (file::Exists(path))\r\n            BenchFile(path, pathsToBench.At(2 * i + 1));\r\n        else if (dir::Exists(path))\r\n            BenchDir(path);\r\n        else\r\n            logbench(L\"Error: file or dir %s doesn't exist\", path);\r\n    }\r\n\r\n    delete gLog;\r\n}\r\n\r\ninline bool IsSpecialDir(const WCHAR *s)\r\n{\r\n    return str::Eq(s, L\".\") || str::Eq(s, L\"..\");\r\n}\r\n\r\nstatic bool IsStressTestSupportedFile(const WCHAR *filePath, const WCHAR *filter)\r\n{\r\n    if (filter && !path::Match(path::GetBaseName(filePath), filter))\r\n        return false;\r\n    if (EngineManager::IsSupportedFile(filePath) || Doc::IsSupportedFile(filePath))\r\n        return true;\r\n    if (!filter)\r\n        return false;\r\n    // sniff the file's content if it matches the filter but\r\n    // doesn't have a known extension\r\n    return EngineManager::IsSupportedFile(filePath, true) || Doc::IsSupportedFile(filePath, true);\r\n}\r\n\r\nstatic bool CollectStressTestSupportedFilesFromDirectory(const WCHAR *dirPath, const WCHAR *filter, WStrVec& paths)\r\n{\r\n    bool hasFiles = false;\r\n    DirIter di(dirPath);\r\n    for (const WCHAR *filePath = di.First(); filePath; filePath = di.Next()) {\r\n        if (IsStressTestSupportedFile(filePath, filter)) {\r\n            paths.Append(str::Dup(filePath));\r\n            hasFiles = true;\r\n        }\r\n    }\r\n    return hasFiles;\r\n}\r\n\r\n// return t1 - t2 in seconds\r\nstatic int SystemTimeDiffInSecs(SYSTEMTIME& t1, SYSTEMTIME& t2)\r\n{\r\n    FILETIME ft1, ft2;\r\n    SystemTimeToFileTime(&t1, &ft1);\r\n    SystemTimeToFileTime(&t2, &ft2);\r\n    return FileTimeDiffInSecs(ft1, ft2);\r\n}\r\n\r\nstatic int SecsSinceSystemTime(SYSTEMTIME& time)\r\n{\r\n    SYSTEMTIME currTime;\r\n    GetSystemTime(&currTime);\r\n    return SystemTimeDiffInSecs(currTime, time);\r\n}\r\n\r\nstatic WCHAR *FormatTime(int totalSecs)\r\n{\r\n    int secs = totalSecs % 60;\r\n    int totalMins = totalSecs / 60;\r\n    int mins = totalMins % 60;\r\n    int hrs = totalMins / 60;\r\n    if (hrs > 0)\r\n        return str::Format(L\"%d hrs %d mins %d secs\", hrs, mins, secs);\r\n    if (mins > 0)\r\n        return str::Format(L\"%d mins %d secs\", mins, secs);\r\n    return str::Format(L\"%d secs\", secs);\r\n}\r\n\r\nstatic void FormatTime(int totalSecs, str::Str<char> *s)\r\n{\r\n    int secs = totalSecs % 60;\r\n    int totalMins = totalSecs / 60;\r\n    int mins = totalMins % 60;\r\n    int hrs = totalMins / 60;\r\n    if (hrs > 0)\r\n        s->AppendFmt(\"%d hrs %d mins %d secs\", hrs, mins, secs);\r\n    if (mins > 0)\r\n        s->AppendFmt(\"%d mins %d secs\", mins, secs);\r\n    s->AppendFmt(\"%d secs\", secs);\r\n}\r\n\r\nstatic void MakeRandomSelection(WindowInfo *win, int pageNo)\r\n{\r\n    DisplayModel *dm = win->AsFixed();\r\n    if (!dm->ValidPageNo(pageNo))\r\n        pageNo = 1;\r\n    if (!dm->ValidPageNo(pageNo))\r\n        return;\r\n\r\n    // try a random position in the page\r\n    int x = rand() % 640;\r\n    int y = rand() % 480;\r\n    if (dm->textSelection->IsOverGlyph(pageNo, x, y)) {\r\n        dm->textSelection->StartAt(pageNo, x, y);\r\n        dm->textSelection->SelectUpTo(pageNo, rand() % 640, rand() % 480);\r\n    }\r\n}\r\n\r\n// encapsulates the logic of getting the next file to test, so\r\n// that we can implement different strategies\r\nclass TestFileProvider {\r\npublic:\r\n    virtual ~TestFileProvider() {}\r\n    // returns path of the next file to test or nullptr if done (caller needs to free() the result)\r\n    virtual WCHAR *NextFile() = 0;\r\n    // start the iteration from the beginning\r\n    virtual void Restart() = 0;\r\n};\r\n\r\nclass FilesProvider : public TestFileProvider {\r\n    WStrVec files;\r\n    size_t provided;\r\npublic:\r\n    explicit FilesProvider(const WCHAR *path) {\r\n        files.Append(str::Dup(path));\r\n        provided = 0;\r\n    }\r\n    FilesProvider(WStrVec& newFiles, int n, int offset) {\r\n        // get every n-th file starting at offset\r\n        for (size_t i = offset; i < newFiles.Count(); i += n) {\r\n            const WCHAR *f = newFiles.At(i);\r\n            files.Append(str::Dup(f));\r\n        }\r\n        provided = 0;\r\n    }\r\n\r\n    virtual ~FilesProvider() {}\r\n\r\n    virtual WCHAR *NextFile() {\r\n        if (provided >= files.Count())\r\n            return nullptr;\r\n        return str::Dup(files.At(provided++));\r\n    }\r\n\r\n    virtual void Restart() {\r\n        provided = 0;\r\n    }\r\n};\r\n\r\nclass DirFileProvider : public TestFileProvider {\r\n\r\n    ScopedMem<WCHAR>  startDir;\r\n    ScopedMem<WCHAR>  fileFilter;\r\n\r\n    // current state of directory traversal\r\n    WStrVec           filesToOpen;\r\n    WStrVec           dirsToVisit;\r\n\r\n    bool OpenDir(const WCHAR *dirPath);\r\npublic:\r\n    DirFileProvider(const WCHAR *path, const WCHAR *filter);\r\n    virtual ~DirFileProvider();\r\n    virtual WCHAR *NextFile();\r\n    virtual void Restart();\r\n};\r\n\r\nDirFileProvider::DirFileProvider(const WCHAR *path, const WCHAR *filter)\r\n{\r\n    startDir.Set(str::Dup(path));\r\n    if (filter && !str::Eq(filter, L\"*\"))\r\n        fileFilter.Set(str::Dup(filter));\r\n    OpenDir(path);\r\n}\r\n\r\nDirFileProvider::~DirFileProvider()\r\n{\r\n}\r\n\r\nbool DirFileProvider::OpenDir(const WCHAR *dirPath)\r\n{\r\n    assert(filesToOpen.Count() == 0);\r\n\r\n    bool hasFiles = CollectStressTestSupportedFilesFromDirectory(dirPath, fileFilter, filesToOpen);\r\n    filesToOpen.SortNatural();\r\n\r\n    ScopedMem<WCHAR> pattern(str::Format(L\"%s\\\\*\", dirPath));\r\n    bool hasSubDirs = CollectPathsFromDirectory(pattern, dirsToVisit, true);\r\n\r\n    return hasFiles || hasSubDirs;\r\n}\r\n\r\nWCHAR *DirFileProvider::NextFile()\r\n{\r\n    if (filesToOpen.Count() > 0) {\r\n        return filesToOpen.PopAt(0);\r\n    }\r\n\r\n    if (dirsToVisit.Count() > 0) {\r\n        // test next directory\r\n        ScopedMem<WCHAR> path(dirsToVisit.PopAt(0));\r\n        OpenDir(path);\r\n        return NextFile();\r\n    }\r\n\r\n    return nullptr;\r\n}\r\n\r\nvoid DirFileProvider::Restart()\r\n{\r\n    OpenDir(startDir);\r\n}\r\n\r\nstatic size_t GetAllMatchingFiles(const WCHAR *dir, const WCHAR *filter, WStrVec& files, bool showProgress)\r\n{\r\n    WStrVec dirsToVisit;\r\n    dirsToVisit.Append(str::Dup(dir));\r\n\r\n    while (dirsToVisit.Count() > 0) {\r\n        if (showProgress) {\r\n            wprintf(L\".\");\r\n            fflush(stdout);\r\n        }\r\n\r\n        ScopedMem<WCHAR> path(dirsToVisit.PopAt(0));\r\n        CollectStressTestSupportedFilesFromDirectory(path, filter, files);\r\n        ScopedMem<WCHAR> pattern(str::Format(L\"%s\\\\*\", path));\r\n        CollectPathsFromDirectory(pattern, dirsToVisit, true);\r\n    }\r\n    return files.Count();\r\n}\r\n\r\n/* The idea of StressTest is to render a lot of PDFs sequentially, simulating\r\na human advancing one page at a time. This is mostly to run through a large number\r\nof PDFs before a release to make sure we're crash proof. */\r\n\r\nclass StressTest {\r\n    WindowInfo *      win;\r\n    Timer             currPageRenderTime;\r\n    int               currPage;\r\n    int               pageForSearchStart;\r\n    int               filesCount; // number of files processed so far\r\n    int               timerId;\r\n    bool              exitWhenDone;\r\n\r\n    SYSTEMTIME        stressStartTime;\r\n    int               cycles;\r\n    Vec<PageRange>    pageRanges;\r\n    // range of files to render (files get a new index when going through several cycles)\r\n    Vec<PageRange>    fileRanges;\r\n    int               fileIndex;\r\n\r\n    // owned by StressTest\r\n    TestFileProvider *fileProvider;\r\n\r\n    bool OpenFile(const WCHAR *fileName);\r\n\r\n    bool GoToNextPage();\r\n    bool GoToNextFile();\r\n\r\n    void TickTimer();\r\n    void Finished(bool success);\r\n\r\npublic:\r\n    StressTest(WindowInfo *win, bool exitWhenDone) :\r\n        win(win), currPage(0), pageForSearchStart(0),\r\n        filesCount(0), cycles(1), fileIndex(0), fileProvider(nullptr),\r\n        exitWhenDone(exitWhenDone)\r\n    {\r\n        timerId = gCurrStressTimerId++;\r\n    }\r\n    ~StressTest() {\r\n        delete fileProvider;\r\n    }\r\n\r\n    void Start(const WCHAR *path, const WCHAR *filter, const WCHAR *ranges, int cycles);\r\n    void Start(TestFileProvider *fileProvider, int cycles);\r\n\r\n    void OnTimer(int timerIdGot);\r\n    void GetLogInfo(str::Str<char> *s);\r\n};\r\n\r\nvoid StressTest::Start(TestFileProvider *fileProvider, int cycles)\r\n{\r\n    GetSystemTime(&stressStartTime);\r\n\r\n    this->fileProvider = fileProvider;\r\n    this->cycles = cycles;\r\n\r\n    if (pageRanges.Count() == 0)\r\n        pageRanges.Append(PageRange());\r\n    if (fileRanges.Count() == 0)\r\n        fileRanges.Append(PageRange());\r\n\r\n    TickTimer();\r\n}\r\n\r\nvoid StressTest::Start(const WCHAR *path, const WCHAR *filter, const WCHAR *ranges, int cycles)\r\n{\r\n    if (file::Exists(path)) {\r\n        FilesProvider *filesProvider = new FilesProvider(path);\r\n        ParsePageRanges(ranges, pageRanges);\r\n        Start(filesProvider, cycles);\r\n    }\r\n    else if (dir::Exists(path)) {\r\n        DirFileProvider *dirFileProvider = new DirFileProvider(path, filter);\r\n        ParsePageRanges(ranges, fileRanges);\r\n        Start(dirFileProvider, cycles);\r\n    }\r\n    else {\r\n        // Note: string dev only, don't translate\r\n        ScopedMem<WCHAR> s(str::Format(L\"Path '%s' doesn't exist\", path));\r\n        win->ShowNotification(s, NOS_WARNING, NG_STRESS_TEST_SUMMARY);\r\n        Finished(false);\r\n    }\r\n}\r\n\r\nvoid StressTest::Finished(bool success)\r\n{\r\n    win->stressTest = nullptr; // make sure we're not double-deleted\r\n\r\n    if (success) {\r\n        int secs = SecsSinceSystemTime(stressStartTime);\r\n        ScopedMem<WCHAR> tm(FormatTime(secs));\r\n        ScopedMem<WCHAR> s(str::Format(L\"Stress test complete, rendered %d files in %s\", filesCount, tm));\r\n        win->ShowNotification(s, NOS_PERSIST, NG_STRESS_TEST_SUMMARY);\r\n    }\r\n\r\n    CloseWindow(win, exitWhenDone && MayCloseWindow(win));\r\n    delete this;\r\n}\r\n\r\nbool StressTest::GoToNextFile()\r\n{\r\n    for (;;) {\r\n        ScopedMem<WCHAR> nextFile(fileProvider->NextFile());\r\n        if (nextFile) {\r\n            if (!IsInRange(fileRanges, ++fileIndex))\r\n                continue;\r\n            if (OpenFile(nextFile))\r\n                return true;\r\n            continue;\r\n        }\r\n        if (--cycles <= 0)\r\n            return false;\r\n        fileProvider->Restart();\r\n    }\r\n}\r\n\r\nbool StressTest::OpenFile(const WCHAR *fileName)\r\n{\r\n    wprintf(L\"%s\\n\", fileName);\r\n    fflush(stdout);\r\n\r\n    LoadArgs args(fileName);\r\n    args.forceReuse = rand() % 3 != 1;\r\n    WindowInfo *w = LoadDocument(args);\r\n    if (!w)\r\n        return false;\r\n\r\n    if (w == win) { // WindowInfo reused\r\n        if (!win->IsDocLoaded())\r\n            return false;\r\n    } else if (!w->IsDocLoaded()) { // new WindowInfo\r\n        CloseWindow(w, false);\r\n        return false;\r\n    }\r\n\r\n    // transfer ownership of stressTest object to a new window and close the\r\n    // current one\r\n    assert(this == win->stressTest);\r\n    if (w != win) {\r\n        if (win->IsDocLoaded()) {\r\n            // try to provoke a crash in RenderCache cleanup code\r\n            ClientRect rect(win->hwndFrame);\r\n            rect.Inflate(rand() % 10, rand() % 10);\r\n            SendMessage(win->hwndFrame, WM_SIZE, 0, MAKELONG(rect.dx, rect.dy));\r\n            if (win->AsFixed())\r\n                win->cbHandler->RequestRendering(1);\r\n            win->RepaintAsync();\r\n        }\r\n\r\n        WindowInfo *toClose = win;\r\n        w->stressTest = win->stressTest;\r\n        win->stressTest = nullptr;\r\n        win = w;\r\n        CloseWindow(toClose, false);\r\n    }\r\n    if (!win->IsDocLoaded())\r\n        return false;\r\n\r\n    win->ctrl->SetDisplayMode(DM_CONTINUOUS);\r\n    win->ctrl->SetZoomVirtual(ZOOM_FIT_PAGE);\r\n    win->ctrl->GoToFirstPage();\r\n    if (win->tocVisible || gGlobalPrefs->showFavorites)\r\n        SetSidebarVisibility(win, win->tocVisible, gGlobalPrefs->showFavorites);\r\n\r\n    currPage = pageRanges.At(0).start;\r\n    win->ctrl->GoToPage(currPage, false);\r\n    currPageRenderTime.Start();\r\n    ++filesCount;\r\n\r\n    pageForSearchStart = (rand() % win->ctrl->PageCount()) + 1;\r\n    // search immediately in single page documents\r\n    if (1 == pageForSearchStart) {\r\n        // use text that is unlikely to be found, so that we search all pages\r\n        win::SetText(win->hwndFindBox, L\"!z_yt\");\r\n        FindTextOnThread(win, FIND_FORWARD, true);\r\n    }\r\n\r\n    int secs = SecsSinceSystemTime(stressStartTime);\r\n    ScopedMem<WCHAR> tm(FormatTime(secs));\r\n    ScopedMem<WCHAR> s(str::Format(L\"File %d: %s, time: %s\", filesCount, fileName, tm));\r\n    win->ShowNotification(s, NOS_PERSIST, NG_STRESS_TEST_SUMMARY);\r\n\r\n    return true;\r\n}\r\n\r\nbool StressTest::GoToNextPage()\r\n{\r\n    double pageRenderTime = currPageRenderTime.GetTimeInMs();\r\n    ScopedMem<WCHAR> s(str::Format(L\"Page %d rendered in %d milliseconds\", currPage, (int)pageRenderTime));\r\n    win->ShowNotification(s, NOS_DEFAULT, NG_STRESS_TEST_BENCHMARK);\r\n\r\n    ++currPage;\r\n    while (!IsInRange(pageRanges, currPage) && currPage <= win->ctrl->PageCount()) {\r\n        currPage++;\r\n    }\r\n\r\n    if (currPage > win->ctrl->PageCount()) {\r\n        if (GoToNextFile())\r\n            return true;\r\n        Finished(true);\r\n        return false;\r\n    }\r\n\r\n    win->ctrl->GoToPage(currPage, false);\r\n    currPageRenderTime.Start();\r\n\r\n    // start text search when we're in the middle of the document, so that\r\n    // search thread touches both pages that were already rendered and not yet\r\n    // rendered\r\n    // TODO: it would be nice to also randomize search starting page but the\r\n    // current API doesn't make it easy\r\n    if (currPage == pageForSearchStart) {\r\n        // use text that is unlikely to be found, so that we search all pages\r\n        win::SetText(win->hwndFindBox, L\"!z_yt\");\r\n        FindTextOnThread(win, FIND_FORWARD, true);\r\n    }\r\n\r\n    if (1 == rand() % 3) {\r\n        ClientRect rect(win->hwndFrame);\r\n        int deltaX = (rand() % 40) - 23;\r\n        rect.dx += deltaX;\r\n        if (rect.dx < 300)\r\n            rect.dx += (abs(deltaX) * 3);\r\n        int deltaY = (rand() % 40) - 23;\r\n        rect.dy += deltaY;\r\n        if (rect.dy < 300)\r\n            rect.dy += (abs(deltaY) * 3);\r\n        SendMessage(win->hwndFrame, WM_SIZE, 0, MAKELONG(rect.dx, rect.dy));\r\n    }\r\n    return true;\r\n}\r\n\r\nvoid StressTest::TickTimer()\r\n{\r\n    SetTimer(win->hwndFrame, timerId, USER_TIMER_MINIMUM, nullptr);\r\n}\r\n\r\nvoid StressTest::OnTimer(int timerIdGot)\r\n{\r\n    CrashIf(timerId != timerIdGot);\r\n    KillTimer(win->hwndFrame, timerId);\r\n    if (!win->IsDocLoaded()) {\r\n        if (!GoToNextFile()) {\r\n            Finished(true);\r\n            return;\r\n        }\r\n        TickTimer();\r\n        return;\r\n    }\r\n\r\n    // chm documents aren't rendered and we block until we show them\r\n    // so we can assume previous page has been shown and go to next page\r\n    if (!win->AsFixed()) {\r\n        if (!GoToNextPage())\r\n            return;\r\n        goto Next;\r\n    }\r\n\r\n    // For non-image files, we detect if a page was rendered by checking the cache\r\n    // (but we don't wait more than 3 seconds).\r\n    // Image files are always fully rendered in WM_PAINT, so we know the page\r\n    // has already been rendered.\r\n    DisplayModel *dm = win->AsFixed();\r\n    bool didRender = gRenderCache.Exists(dm, currPage, dm->GetRotation());\r\n    if (!didRender && dm->ShouldCacheRendering(currPage)) {\r\n        double timeInMs = currPageRenderTime.GetTimeInMs();\r\n        if (timeInMs > 3.0 * 1000) {\r\n            if (!GoToNextPage())\r\n                return;\r\n        }\r\n    }\r\n    else if (!GoToNextPage()) {\r\n        return;\r\n    }\r\n    MakeRandomSelection(win, currPage);\r\n\r\nNext:\r\n    TickTimer();\r\n}\r\n\r\n// note: used from CrashHandler, shouldn't allocate memory\r\nvoid StressTest::GetLogInfo(str::Str<char> *s)\r\n{\r\n    s->AppendFmt(\", stress test rendered %d files in \", filesCount);\r\n    FormatTime(SecsSinceSystemTime(stressStartTime), s);\r\n    s->AppendFmt(\", currPage: %d\", currPage);\r\n}\r\n\r\n// note: used from CrashHandler.cpp, should not allocate memory\r\nvoid GetStressTestInfo(str::Str<char>* s)\r\n{\r\n    // only add paths to files encountered during an explicit stress test\r\n    // (for privacy reasons, users should be able to decide themselves\r\n    // whether they want to share what files they had opened during a crash)\r\n    if (!IsStressTesting())\r\n        return;\r\n\r\n    for (size_t i = 0; i < gWindows.Count(); i++) {\r\n        WindowInfo *w = gWindows.At(i);\r\n        if (!w || !w->currentTab || !w->currentTab->filePath)\r\n            continue;\r\n\r\n        s->Append(\"File: \");\r\n        char buf[256];\r\n        str::conv::ToCodePageBuf(buf, dimof(buf), w->currentTab->filePath, CP_UTF8);\r\n        s->Append(buf);\r\n        w->stressTest->GetLogInfo(s);\r\n        s->Append(\"\\r\\n\");\r\n    }\r\n}\r\n\r\n// Select random files to test. We want to test each file type equally, so\r\n// we first group them by file extension and then select up to maxPerType\r\n// for each extension, randomly, and inter-leave the files with different\r\n// extensions, so their testing is evenly distributed.\r\n// Returns result in <files>.\r\nstatic void RandomizeFiles(WStrVec& files, int maxPerType)\r\n{\r\n    WStrVec fileExts;\r\n    Vec<WStrVec *> filesPerType;\r\n\r\n    for (size_t i = 0; i < files.Count(); i++) {\r\n        const WCHAR *file = files.At(i);\r\n        const WCHAR *ext = path::GetExt(file);\r\n        CrashAlwaysIf(!ext);\r\n        int typeNo = fileExts.FindI(ext);\r\n        if (-1 == typeNo) {\r\n            fileExts.Append(str::Dup(ext));\r\n            filesPerType.Append(new WStrVec());\r\n            typeNo = (int)filesPerType.Count() - 1;\r\n        }\r\n        filesPerType.At(typeNo)->Append(str::Dup(file));\r\n    }\r\n\r\n    for (size_t j = 0; j < filesPerType.Count(); j++) {\r\n        WStrVec *all = filesPerType.At(j);\r\n        WStrVec *random = new WStrVec();\r\n\r\n        for (int n = 0; n < maxPerType && all->Count() > 0; n++) {\r\n            int idx = rand() % all->Count();\r\n            WCHAR *file = all->At(idx);\r\n            random->Append(file);\r\n            all->RemoveAtFast(idx);\r\n        }\r\n\r\n        filesPerType.At(j) = random;\r\n        delete all;\r\n    }\r\n\r\n    files.Reset();\r\n\r\n    bool gotAll = false;\r\n    while (!gotAll) {\r\n        gotAll = true;\r\n        for (size_t j = 0; j < filesPerType.Count(); j++) {\r\n            WStrVec *random = filesPerType.At(j);\r\n            if (random->Count() > 0) {\r\n                gotAll = false;\r\n                WCHAR *file = random->At(0);\r\n                files.Append(file);\r\n                random->RemoveAtFast(0);\r\n            }\r\n        }\r\n    }\r\n\r\n    for (size_t j = 0; j < filesPerType.Count(); j++) {\r\n        delete filesPerType.At(j);\r\n    }\r\n}\r\n\r\nvoid StartStressTest(CommandLineInfo *i, WindowInfo *win)\r\n{\r\n    gIsStressTesting = true;\r\n    // TODO: for now stress testing only supports the non-ebook ui\r\n    gGlobalPrefs->ebookUI.useFixedPageUI = true;\r\n    gGlobalPrefs->chmUI.useFixedPageUI = true;\r\n    // TODO: make stress test work with tabs?\r\n    gGlobalPrefs->useTabs = false;\r\n    // forbid entering sleep mode during tests\r\n    SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED);\r\n    srand((unsigned int)time(nullptr));\r\n    // redirect stderr to NUL to disable (MuPDF) logging\r\n    FILE *nul; freopen_s(&nul, \"NUL\", \"w\", stderr);\r\n\r\n    int n = i->stressParallelCount;\r\n    if (n > 1 || i->stressRandomizeFiles) {\r\n        WindowInfo **windows = AllocArray<WindowInfo*>(n);\r\n        windows[0] = win;\r\n        for (int j=1; j<n; j++) {\r\n            windows[j] = CreateAndShowWindowInfo();\r\n            if (!windows[j])\r\n                return;\r\n        }\r\n        WStrVec filesToTest;\r\n\r\n        wprintf(L\"Scanning for files in directory %s\\n\", i->stressTestPath.Get());\r\n        fflush(stdout);\r\n        size_t filesCount = GetAllMatchingFiles(i->stressTestPath, i->stressTestFilter, filesToTest, true);\r\n        if (0 == filesCount) {\r\n            wprintf(L\"Didn't find any files matching filter '%s'\\n\", i->stressTestFilter.Get());\r\n            return;\r\n        }\r\n        wprintf(L\"Found %d files\", (int)filesCount);\r\n        fflush(stdout);\r\n        if (i->stressRandomizeFiles) {\r\n            // TODO: should probably allow over-writing the 100 limit\r\n            RandomizeFiles(filesToTest, 100);\r\n            filesCount = filesToTest.Count();\r\n            wprintf(L\"\\nAfter randomization: %d files\", (int)filesCount);\r\n        }\r\n        wprintf(L\"\\n\");\r\n        fflush(stdout);\r\n\r\n        for (int j = 0; j < n; j++) {\r\n            // dst will be deleted when the stress ends\r\n            win = windows[j];\r\n            StressTest *dst = new StressTest(win, i->exitWhenDone);\r\n            win->stressTest = dst;\r\n            // divide filesToTest among each window\r\n            FilesProvider *filesProvider = new FilesProvider(filesToTest, n, j);\r\n            dst->Start(filesProvider, i->stressTestCycles);\r\n        }\r\n\r\n        free(windows);\r\n    } else {\r\n        // dst will be deleted when the stress ends\r\n        StressTest *dst = new StressTest(win, i->exitWhenDone);\r\n        win->stressTest = dst;\r\n        dst->Start(i->stressTestPath, i->stressTestFilter, i->stressTestRanges, i->stressTestCycles);\r\n    }\r\n}\r\n\r\nvoid OnStressTestTimer(WindowInfo *win, int timerId)\r\n{\r\n    win->stressTest->OnTimer(timerId);\r\n}\r\n\r\nvoid FinishStressTest(WindowInfo *win)\r\n{\r\n    delete win->stressTest;\r\n}\r\n"
  },
  {
    "path": "src/StressTesting.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nbool IsValidPageRange(const WCHAR *ranges);\r\nbool IsBenchPagesInfo(const WCHAR *s);\r\nvoid BenchFileOrDir(WStrVec& pathsToBench);\r\nbool IsStressTesting();\r\nvoid BenchEbookLayout(WCHAR *filePath);\r\n\r\nclass CommandLineInfo;\r\nclass WindowInfo;\r\n\r\nvoid StartStressTest(CommandLineInfo *i, WindowInfo *win);\r\n\r\nvoid OnStressTestTimer(WindowInfo *win, int timerId);\r\nvoid FinishStressTest(WindowInfo *win);\r\n"
  },
  {
    "path": "src/SumatraAbout.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"Dpi.h\"\r\n#include \"FileUtil.h\"\r\n#include \"WinUtil.h\"\r\n// layout controllers\r\n#include \"BaseEngine.h\"\r\n#include \"SettingsStructs.h\"\r\n#include \"FileHistory.h\"\r\n#include \"GlobalPrefs.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"WindowInfo.h\"\r\n#include \"resource.h\"\r\n#include \"FileThumbnails.h\"\r\n#include \"SumatraAbout.h\"\r\n#include \"Translations.h\"\r\n#include \"Version.h\"\r\n\r\n#ifndef ABOUT_USE_LESS_COLORS\r\n#define ABOUT_LINE_OUTER_SIZE       2\r\n#else\r\n#define ABOUT_LINE_OUTER_SIZE       1\r\n#endif\r\n#define ABOUT_LINE_SEP_SIZE         1\r\n#define ABOUT_LEFT_RIGHT_SPACE_DX   8\r\n#define ABOUT_MARGIN_DX            10\r\n#define ABOUT_BOX_MARGIN_DY         6\r\n#define ABOUT_BORDER_COL            RGB(0, 0, 0)\r\n#define ABOUT_TXT_DY                6\r\n#define ABOUT_RECT_PADDING          8\r\n#define ABOUT_INNER_PADDING         6\r\n\r\n#define ABOUT_CLASS_NAME        L\"SUMATRA_PDF_ABOUT\"\r\n\r\n#define ABOUT_WIN_TITLE         _TR(\"About SumatraPDF\")\r\n\r\n#define COL_BLUE_LINK           RGB(0x00, 0x20, 0xa0)\r\n\r\n#define SUMATRA_TXT_FONT        L\"Arial Black\"\r\n#define SUMATRA_TXT_FONT_SIZE   24\r\n\r\n#define VERSION_TXT_FONT        L\"Arial Black\"\r\n#define VERSION_TXT_FONT_SIZE   12\r\n\r\n#define VERSION_TXT             L\"v\" CURR_VERSION_STR\r\n#ifdef SVN_PRE_RELEASE_VER\r\n #define VERSION_SUB_TXT        L\"Pre-release\"\r\n#else\r\n #define VERSION_SUB_TXT        L\"\"\r\n#endif\r\n\r\n#ifdef GIT_COMMIT_ID\r\n#define GIT_COMMIT_ID_STR       TEXT(QM(GIT_COMMIT_ID))\r\n#endif\r\n\r\n// TODO: replace this link with a better one where license information is nicely collected/linked\r\n#if defined(SVN_PRE_RELEASE_VER) || defined(DEBUG)\r\n#define URL_LICENSE L\"https://github.com/sumatrapdfreader/sumatrapdf/blob/master/AUTHORS\"\r\n#define URL_AUTHORS L\"https://github.com/sumatrapdfreader/sumatrapdf/blob/master/AUTHORS\"\r\n#define URL_TRANSLATORS L\"https://github.com/sumatrapdfreader/sumatrapdf/blob/master/TRANSLATORS\"\r\n#else\r\n#define URL_LICENSE L\"https://github.com/sumatrapdfreader/sumatrapdf/blob/\" UPDATE_CHECK_VER L\"rel/AUTHORS\"\r\n#define URL_AUTHORS L\"https://github.com/sumatrapdfreader/sumatrapdf/blob/\" UPDATE_CHECK_VER L\"rel/AUTHORS\"\r\n#define URL_TRANSLATORS L\"https://github.com/sumatrapdfreader/sumatrapdf/blob/\" UPDATE_CHECK_VER L\"rel/TRANSLATORS\"\r\n#endif\r\n\r\n#define LAYOUT_LTR              0\r\n\r\nstatic ATOM gAtomAbout;\r\nstatic HWND gHwndAbout;\r\nstatic HWND gHwndAboutTooltip = nullptr;\r\nstatic const WCHAR *gClickedURL = nullptr;\r\n\r\nstruct AboutLayoutInfoEl {\r\n    /* static data, must be provided */\r\n    const WCHAR *   leftTxt;\r\n    const WCHAR *   rightTxt;\r\n    const WCHAR *   url;\r\n\r\n    /* data calculated by the layout */\r\n    RectI           leftPos;\r\n    RectI           rightPos;\r\n};\r\n\r\nstatic AboutLayoutInfoEl gAboutLayoutInfo[] = {\r\n    { L\"website\",        L\"SumatraPDF website\",   WEBSITE_MAIN_URL},\r\n    { L\"manual\",         L\"SumatraPDF manual\",    WEBSITE_MANUAL_URL },\r\n    { L\"forums\",         L\"SumatraPDF forums\",    L\"http://blog.kowalczyk.info/forum_sumatra\" },\r\n    { L\"programming\",    L\"The Programmers\",      URL_AUTHORS },\r\n    { L\"translations\",   L\"The Translators\",      URL_TRANSLATORS },\r\n    { L\"licenses\",       L\"Various Open Source\",  URL_LICENSE },\r\n#ifdef GIT_COMMIT_ID\r\n    // TODO: use short ID for rightTxt (only first 7 digits) with less hackery\r\n    { L\"last change\",    L\"git commit \" GIT_COMMIT_ID_STR, L\"https://github.com/sumatrapdfreader/sumatrapdf/commit/\" GIT_COMMIT_ID_STR },\r\n#endif\r\n#ifdef SVN_PRE_RELEASE_VER\r\n    { L\"a note\",         L\"Pre-release version, for testing only!\", nullptr },\r\n#endif\r\n#ifdef DEBUG\r\n    { L\"a note\",         L\"Debug version, for testing only!\", nullptr },\r\n#endif\r\n    { nullptr, nullptr, nullptr }\r\n};\r\n\r\nstatic Vec<StaticLinkInfo> gLinkInfo;\r\n\r\n#define COL1 RGB(196, 64, 50)\r\n#define COL2 RGB(227, 107, 35)\r\n#define COL3 RGB(93,  160, 40)\r\n#define COL4 RGB(69, 132, 190)\r\n#define COL5 RGB(112, 115, 207)\r\n\r\nstatic void DrawSumatraPDF(HDC hdc, PointI pt)\r\n{\r\n    const WCHAR *txt = APP_NAME_STR;\r\n#ifdef ABOUT_USE_LESS_COLORS\r\n    // simple black version\r\n    SetTextColor(hdc, ABOUT_BORDER_COL);\r\n    TextOut(hdc, pt.x, pt.y, txt, (int)str::Len(txt));\r\n#else\r\n    // colorful version\r\n    COLORREF cols[] = { COL1, COL2, COL3, COL4, COL5, COL5, COL4, COL3, COL2, COL1 };\r\n    for (size_t i = 0; i < str::Len(txt); i++) {\r\n        SetTextColor(hdc, cols[i % dimof(cols)]);\r\n        TextOut(hdc, pt.x, pt.y, txt + i, 1);\r\n\r\n        SIZE txtSize;\r\n        GetTextExtentPoint32(hdc, txt + i, 1, &txtSize);\r\n        pt.x += txtSize.cx;\r\n    }\r\n#endif\r\n}\r\n\r\nstatic WCHAR *GetSumatraVersion() {\r\n    str::Str<WCHAR> s;\r\n    s.Set(VERSION_TXT);\r\n    if (IsProcess64()) {\r\n        s.Append(L\" 64-bit\");\r\n    }\r\n#ifdef DEBUG\r\n    s.Append(L\" (dbg)\");\r\n#endif\r\n    return s.StealData();\r\n}\r\n\r\nstatic SizeI CalcSumatraVersionSize(HWND hwnd, HDC hdc)\r\n{\r\n    SizeI result;\r\n\r\n    ScopedFont fontSumatraTxt(CreateSimpleFont(hdc, SUMATRA_TXT_FONT, SUMATRA_TXT_FONT_SIZE));\r\n    ScopedFont fontVersionTxt(CreateSimpleFont(hdc, VERSION_TXT_FONT, VERSION_TXT_FONT_SIZE));\r\n    ScopedHdcSelect selFont(hdc, fontSumatraTxt);\r\n\r\n    SIZE txtSize;\r\n    /* calculate minimal top box size */\r\n    const WCHAR *txt = APP_NAME_STR;\r\n    GetTextExtentPoint32(hdc, txt, (int)str::Len(txt), &txtSize);\r\n    result.dy = txtSize.cy + ABOUT_BOX_MARGIN_DY * 2;\r\n    result.dx = txtSize.cx;\r\n\r\n    /* consider version and version-sub strings */\r\n    SelectObject(hdc, fontVersionTxt);\r\n    ScopedMem<WCHAR> ver(GetSumatraVersion());\r\n    GetTextExtentPoint32(hdc, ver.Get(), (int)str::Len(ver.Get()), &txtSize);\r\n    LONG minWidth = txtSize.cx + DpiScaleX(hwnd, 8);\r\n    txt = VERSION_SUB_TXT;\r\n    GetTextExtentPoint32(hdc, txt, (int)str::Len(txt), &txtSize);\r\n    txtSize.cx = std::max(txtSize.cx, minWidth);\r\n    result.dx += 2 * (txtSize.cx + ABOUT_INNER_PADDING);\r\n\r\n    return result;\r\n}\r\n\r\nstatic void DrawSumatraVersion(HDC hdc, RectI rect)\r\n{\r\n    ScopedFont fontSumatraTxt(CreateSimpleFont(hdc, SUMATRA_TXT_FONT, SUMATRA_TXT_FONT_SIZE));\r\n    ScopedFont fontVersionTxt(CreateSimpleFont(hdc, VERSION_TXT_FONT, VERSION_TXT_FONT_SIZE));\r\n    HGDIOBJ oldFont = SelectObject(hdc, fontSumatraTxt);\r\n\r\n    SetBkMode(hdc, TRANSPARENT);\r\n\r\n    SIZE txtSize;\r\n    const WCHAR *txt = APP_NAME_STR;\r\n    GetTextExtentPoint32(hdc, txt, (int)str::Len(txt), &txtSize);\r\n    RectI mainRect(rect.x + (rect.dx - txtSize.cx) / 2,\r\n                   rect.y + (rect.dy - txtSize.cy) / 2, txtSize.cx, txtSize.cy);\r\n    DrawSumatraPDF(hdc, mainRect.TL());\r\n\r\n    SetTextColor(hdc, WIN_COL_BLACK);\r\n    SelectObject(hdc, fontVersionTxt);\r\n    PointI pt(mainRect.x + mainRect.dx + ABOUT_INNER_PADDING, mainRect.y);\r\n\r\n    ScopedMem<WCHAR> ver(GetSumatraVersion());\r\n    TextOut(hdc, pt.x, pt.y, ver.Get(), (int)str::Len(ver.Get()));\r\n    txt = VERSION_SUB_TXT;\r\n    TextOut(hdc, pt.x, pt.y + 16, txt, (int)str::Len(txt));\r\n\r\n    SelectObject(hdc, oldFont);\r\n}\r\n\r\nstatic RectI DrawBottomRightLink(HWND hwnd, HDC hdc, const WCHAR *txt)\r\n{\r\n    ScopedFont fontLeftTxt(CreateSimpleFont(hdc, L\"MS Shell Dlg\", 14));\r\n    ScopedPen penLinkLine(CreatePen(PS_SOLID, 1, COL_BLUE_LINK));\r\n    ScopedHdcSelect font(hdc, fontLeftTxt);\r\n\r\n    SetTextColor(hdc, COL_BLUE_LINK);\r\n    SetBkMode(hdc, TRANSPARENT);\r\n    ClientRect rc(hwnd);\r\n\r\n    SIZE txtSize;\r\n    GetTextExtentPoint32(hdc, txt, (int)str::Len(txt), &txtSize);\r\n    RectI rect(rc.dx - txtSize.cx - ABOUT_INNER_PADDING,\r\n               rc.y + rc.dy - txtSize.cy - ABOUT_INNER_PADDING, txtSize.cx, txtSize.cy);\r\n    if (IsUIRightToLeft())\r\n        rect.x = ABOUT_INNER_PADDING;\r\n    RECT rTmp = rect.ToRECT();\r\n    DrawText(hdc, txt, -1, &rTmp, IsUIRightToLeft() ? DT_RTLREADING : DT_LEFT);\r\n    {\r\n        ScopedHdcSelect pen(hdc, penLinkLine);\r\n        PaintLine(hdc, RectI(rect.x, rect.y + rect.dy, rect.dx, 0));\r\n    }\r\n\r\n    // make the click target larger\r\n    rect.Inflate(ABOUT_INNER_PADDING, ABOUT_INNER_PADDING);\r\n    return rect;\r\n}\r\n\r\n/* Draws the about screen and remembers some state for hyperlinking.\r\n   It transcribes the design I did in graphics software - hopeless\r\n   to understand without seeing the design. */\r\nstatic void DrawAbout(HWND hwnd, HDC hdc, RectI rect, Vec<StaticLinkInfo>& linkInfo)\r\n{\r\n    ScopedPen penBorder(CreatePen(PS_SOLID, ABOUT_LINE_OUTER_SIZE, WIN_COL_BLACK));\r\n    ScopedPen penDivideLine(CreatePen(PS_SOLID, ABOUT_LINE_SEP_SIZE, WIN_COL_BLACK));\r\n    ScopedPen penLinkLine(CreatePen(PS_SOLID, ABOUT_LINE_SEP_SIZE, COL_BLUE_LINK));\r\n\r\n    ScopedFont fontLeftTxt(CreateSimpleFont(hdc, LEFT_TXT_FONT, LEFT_TXT_FONT_SIZE));\r\n    ScopedFont fontRightTxt(CreateSimpleFont(hdc, RIGHT_TXT_FONT, RIGHT_TXT_FONT_SIZE));\r\n\r\n    ScopedHdcSelect font(hdc, fontLeftTxt); /* Just to remember the orig font */\r\n\r\n    ClientRect rc(hwnd);\r\n    RECT rTmp = rc.ToRECT();\r\n    ScopedGdiObj<HBRUSH> brushAboutBg(CreateSolidBrush(GetAboutBgColor()));\r\n    FillRect(hdc, &rTmp, brushAboutBg);\r\n\r\n    /* render title */\r\n    RectI titleRect(rect.TL(), CalcSumatraVersionSize(hwnd, hdc));\r\n\r\n    ScopedBrush bgBrush(CreateSolidBrush(GetLogoBgColor()));\r\n    ScopedHdcSelect brush(hdc, bgBrush);\r\n    ScopedHdcSelect pen(hdc, penBorder);\r\n#ifndef ABOUT_USE_LESS_COLORS\r\n    Rectangle(hdc, rect.x, rect.y + ABOUT_LINE_OUTER_SIZE, rect.x + rect.dx, rect.y + titleRect.dy + ABOUT_LINE_OUTER_SIZE);\r\n#else\r\n    RectI titleBgBand(0, rect.y, rc.dx, titleRect.dy);\r\n    RECT rcLogoBg = titleBgBand.ToRECT();\r\n    FillRect(hdc, &rcLogoBg, bgBrush);\r\n    PaintLine(hdc, RectI(0, rect.y, rc.dx, 0));\r\n    PaintLine(hdc, RectI(0, rect.y + titleRect.dy, rc.dx, 0));\r\n#endif\r\n\r\n    titleRect.Offset((rect.dx - titleRect.dx) / 2, 0);\r\n    DrawSumatraVersion(hdc, titleRect);\r\n\r\n    /* render attribution box */\r\n    SetTextColor(hdc, ABOUT_BORDER_COL);\r\n    SetBkMode(hdc, TRANSPARENT);\r\n\r\n#ifndef ABOUT_USE_LESS_COLORS\r\n    Rectangle(hdc, rect.x, rect.y + titleRect.dy, rect.x + rect.dx, rect.y + rect.dy);\r\n#endif\r\n\r\n    /* render text on the left*/\r\n    SelectObject(hdc, fontLeftTxt);\r\n    for (AboutLayoutInfoEl *el = gAboutLayoutInfo; el->leftTxt; el++) {\r\n        TextOut(hdc, el->leftPos.x, el->leftPos.y, el->leftTxt, (int)str::Len(el->leftTxt));\r\n    }\r\n\r\n    /* render text on the right */\r\n    SelectObject(hdc, fontRightTxt);\r\n    SelectObject(hdc, penLinkLine);\r\n    linkInfo.Reset();\r\n    for (AboutLayoutInfoEl *el = gAboutLayoutInfo; el->leftTxt; el++) {\r\n        bool hasUrl = HasPermission(Perm_DiskAccess) && el->url;\r\n        SetTextColor(hdc, hasUrl ? COL_BLUE_LINK : ABOUT_BORDER_COL);\r\n        size_t txtLen = str::Len(el->rightTxt);\r\n#ifdef GIT_COMMIT_ID\r\n        if (str::EndsWith(el->rightTxt, GIT_COMMIT_ID_STR))\r\n            txtLen -= str::Len(GIT_COMMIT_ID_STR) - 7;\r\n#endif\r\n        TextOutW(hdc, el->rightPos.x, el->rightPos.y, el->rightTxt, (int)txtLen);\r\n\r\n        if (hasUrl) {\r\n            int underlineY = el->rightPos.y + el->rightPos.dy - 3;\r\n            PaintLine(hdc, RectI(el->rightPos.x, underlineY, el->rightPos.dx, 0));\r\n            linkInfo.Append(StaticLinkInfo(el->rightPos, el->url, el->url));\r\n        }\r\n    }\r\n\r\n    SelectObject(hdc, penDivideLine);\r\n    RectI divideLine(gAboutLayoutInfo[0].rightPos.x - ABOUT_LEFT_RIGHT_SPACE_DX,\r\n                     rect.y + titleRect.dy + 4, 0, rect.y + rect.dy - 4 - gAboutLayoutInfo[0].rightPos.y);\r\n    PaintLine(hdc, divideLine);\r\n}\r\n\r\nstatic void UpdateAboutLayoutInfo(HWND hwnd, HDC hdc, RectI *rect)\r\n{\r\n    ScopedFont fontLeftTxt(CreateSimpleFont(hdc, LEFT_TXT_FONT, LEFT_TXT_FONT_SIZE));\r\n    ScopedFont fontRightTxt(CreateSimpleFont(hdc, RIGHT_TXT_FONT, RIGHT_TXT_FONT_SIZE));\r\n\r\n    HGDIOBJ origFont = SelectObject(hdc, fontLeftTxt);\r\n\r\n    /* calculate minimal top box size */\r\n    SizeI headerSize = CalcSumatraVersionSize(hwnd, hdc);\r\n\r\n    /* calculate left text dimensions */\r\n    SelectObject(hdc, fontLeftTxt);\r\n    int leftLargestDx = 0;\r\n    int leftDy = 0;\r\n    for (AboutLayoutInfoEl *el = gAboutLayoutInfo; el->leftTxt; el++) {\r\n        SIZE txtSize;\r\n        GetTextExtentPoint32(hdc, el->leftTxt, (int)str::Len(el->leftTxt), &txtSize);\r\n        el->leftPos.dx = txtSize.cx;\r\n        el->leftPos.dy = txtSize.cy;\r\n\r\n        if (el == &gAboutLayoutInfo[0])\r\n            leftDy = el->leftPos.dy;\r\n        else\r\n            assert(leftDy == el->leftPos.dy);\r\n        if (leftLargestDx < el->leftPos.dx)\r\n            leftLargestDx = el->leftPos.dx;\r\n    }\r\n\r\n    /* calculate right text dimensions */\r\n    SelectObject(hdc, fontRightTxt);\r\n    int rightLargestDx = 0;\r\n    int rightDy = 0;\r\n    for (AboutLayoutInfoEl *el = gAboutLayoutInfo; el->leftTxt; el++) {\r\n        SIZE txtSize;\r\n        size_t txtLen = str::Len(el->rightTxt);\r\n#ifdef GIT_COMMIT_ID\r\n        if (str::EndsWith(el->rightTxt, GIT_COMMIT_ID_STR))\r\n            txtLen -= str::Len(GIT_COMMIT_ID_STR) - 7;\r\n#endif\r\n        GetTextExtentPoint32W(hdc, el->rightTxt, (int)txtLen, &txtSize);\r\n        el->rightPos.dx = txtSize.cx;\r\n        el->rightPos.dy = txtSize.cy;\r\n\r\n        if (el == &gAboutLayoutInfo[0])\r\n            rightDy = el->rightPos.dy;\r\n        else\r\n            assert(rightDy == el->rightPos.dy);\r\n        if (rightLargestDx < el->rightPos.dx)\r\n            rightLargestDx = el->rightPos.dx;\r\n    }\r\n\r\n    /* calculate total dimension and position */\r\n    RectI minRect;\r\n    minRect.dx = ABOUT_LEFT_RIGHT_SPACE_DX + leftLargestDx + ABOUT_LINE_SEP_SIZE + rightLargestDx + ABOUT_LEFT_RIGHT_SPACE_DX;\r\n    if (minRect.dx < headerSize.dx)\r\n        minRect.dx = headerSize.dx;\r\n    minRect.dx += 2 * ABOUT_LINE_OUTER_SIZE + 2 * ABOUT_MARGIN_DX;\r\n\r\n    minRect.dy = headerSize.dy;\r\n    for (AboutLayoutInfoEl *el = gAboutLayoutInfo; el->leftTxt; el++)\r\n        minRect.dy += rightDy + ABOUT_TXT_DY;\r\n    minRect.dy += 2 * ABOUT_LINE_OUTER_SIZE + 4;\r\n\r\n    ClientRect rc(hwnd);\r\n    minRect.x = (rc.dx - minRect.dx) / 2;\r\n    minRect.y = (rc.dy - minRect.dy) / 2;\r\n\r\n    if (rect)\r\n        *rect = minRect;\r\n\r\n    /* calculate text positions */\r\n    int linePosX = ABOUT_LINE_OUTER_SIZE + ABOUT_MARGIN_DX + leftLargestDx + ABOUT_LEFT_RIGHT_SPACE_DX;\r\n    int currY = minRect.y + headerSize.dy + 4;\r\n    for (AboutLayoutInfoEl *el = gAboutLayoutInfo; el->leftTxt; el++) {\r\n        el->leftPos.x = minRect.x + linePosX - ABOUT_LEFT_RIGHT_SPACE_DX - el->leftPos.dx;\r\n        el->leftPos.y = currY + (rightDy - leftDy) / 2;\r\n        el->rightPos.x = minRect.x + linePosX + ABOUT_LEFT_RIGHT_SPACE_DX;\r\n        el->rightPos.y = currY;\r\n        currY += rightDy + ABOUT_TXT_DY;\r\n    }\r\n\r\n    SelectObject(hdc, origFont);\r\n}\r\n\r\nstatic void OnPaintAbout(HWND hwnd)\r\n{\r\n    PAINTSTRUCT ps;\r\n    RectI rc;\r\n    HDC hdc = BeginPaint(hwnd, &ps);\r\n    SetLayout(hdc, LAYOUT_LTR);\r\n    UpdateAboutLayoutInfo(hwnd, hdc, &rc);\r\n    DrawAbout(hwnd, hdc, rc, gLinkInfo);\r\n    EndPaint(hwnd, &ps);\r\n}\r\n\r\nstatic void CopyAboutInfoToClipboard(HWND hwnd)\r\n{\r\n    UNUSED(hwnd);\r\n    str::Str<WCHAR> info(512);\r\n    ScopedMem<WCHAR> ver(GetSumatraVersion());\r\n    info.AppendFmt(L\"%s %s\\r\\n\", APP_NAME_STR, ver.Get());\r\n    for (size_t i = info.Size() - 2; i > 0; i--) {\r\n        info.Append('-');\r\n    }\r\n    info.Append(L\"\\r\\n\");\r\n    // concatenate all the information into a single string\r\n    // (cf. CopyPropertiesToClipboard in SumatraProperties.cpp)\r\n    size_t maxLen = 0;\r\n    for (AboutLayoutInfoEl *el = gAboutLayoutInfo; el->leftTxt; el++) {\r\n        maxLen = std::max(maxLen, str::Len(el->leftTxt));\r\n    }\r\n    for (AboutLayoutInfoEl *el = gAboutLayoutInfo; el->leftTxt; el++) {\r\n        for (size_t i = maxLen - str::Len(el->leftTxt); i > 0; i--)\r\n            info.Append(' ');\r\n        info.AppendFmt(L\"%s: %s\\r\\n\", el->leftTxt, el->url ? el->url : el->rightTxt);\r\n    }\r\n    CopyTextToClipboard(info.LendData());\r\n}\r\n\r\nconst WCHAR *GetStaticLink(Vec<StaticLinkInfo>& linkInfo, int x, int y, StaticLinkInfo *info)\r\n{\r\n    if (!HasPermission(Perm_DiskAccess))\r\n        return nullptr;\r\n\r\n    PointI pt(x, y);\r\n    for (size_t i = 0; i < linkInfo.Count(); i++) {\r\n        if (linkInfo.At(i).rect.Contains(pt)) {\r\n            if (info)\r\n                *info = linkInfo.At(i);\r\n            return linkInfo.At(i).target;\r\n        }\r\n    }\r\n\r\n    return nullptr;\r\n}\r\n\r\nstatic void CreateInfotipForLink(StaticLinkInfo& linkInfo)\r\n{\r\n    if (gHwndAboutTooltip)\r\n        return;\r\n\r\n    gHwndAboutTooltip = CreateWindowEx(WS_EX_TOPMOST,\r\n        TOOLTIPS_CLASS, nullptr, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,\r\n        CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,\r\n        gHwndAbout, nullptr, GetModuleHandle(nullptr), nullptr);\r\n\r\n    TOOLINFO ti = { 0 };\r\n    ti.cbSize = sizeof(ti);\r\n    ti.hwnd = gHwndAbout;\r\n    ti.uFlags = TTF_SUBCLASS;\r\n    ti.lpszText = (WCHAR *)linkInfo.infotip;\r\n    ti.rect = linkInfo.rect.ToRECT();\r\n\r\n    SendMessage(gHwndAboutTooltip, TTM_ADDTOOL, 0, (LPARAM)&ti);\r\n}\r\n\r\nstatic void ClearInfotip()\r\n{\r\n    if (!gHwndAboutTooltip)\r\n        return;\r\n\r\n    TOOLINFO ti = { 0 };\r\n    ti.cbSize = sizeof(ti);\r\n    ti.hwnd = gHwndAbout;\r\n\r\n    SendMessage(gHwndAboutTooltip, TTM_DELTOOL, 0, (LPARAM)&ti);\r\n    DestroyWindow(gHwndAboutTooltip);\r\n    gHwndAboutTooltip = nullptr;\r\n}\r\n\r\nLRESULT CALLBACK WndProcAbout(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)\r\n{\r\n    const WCHAR * url;\r\n    PointI pt;\r\n\r\n    switch (message)\r\n    {\r\n        case WM_CREATE:\r\n            assert(!gHwndAbout);\r\n            break;\r\n\r\n        case WM_ERASEBKGND:\r\n            // do nothing, helps to avoid flicker\r\n            return TRUE;\r\n\r\n        case WM_PAINT:\r\n            OnPaintAbout(hwnd);\r\n            break;\r\n\r\n        case WM_SETCURSOR:\r\n            if (GetCursorPosInHwnd(hwnd, pt)) {\r\n                StaticLinkInfo linkInfo;\r\n                if (GetStaticLink(gLinkInfo, pt.x, pt.y, &linkInfo)) {\r\n                    CreateInfotipForLink(linkInfo);\r\n                    SetCursor(IDC_HAND);\r\n                    return TRUE;\r\n                }\r\n            }\r\n            ClearInfotip();\r\n            return DefWindowProc(hwnd, message, wParam, lParam);\r\n\r\n        case WM_LBUTTONDOWN:\r\n            gClickedURL = GetStaticLink(gLinkInfo, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));\r\n            break;\r\n\r\n        case WM_LBUTTONUP:\r\n            url = GetStaticLink(gLinkInfo, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));\r\n            if (url && url == gClickedURL)\r\n                LaunchBrowser(url);\r\n            break;\r\n\r\n        case WM_CHAR:\r\n            if (VK_ESCAPE == wParam)\r\n                DestroyWindow(hwnd);\r\n            break;\r\n\r\n        case WM_COMMAND:\r\n            if (IDM_COPY_SELECTION == LOWORD(wParam))\r\n                CopyAboutInfoToClipboard(hwnd);\r\n            break;\r\n\r\n        case WM_DESTROY:\r\n            ClearInfotip();\r\n            assert(gHwndAbout);\r\n            gHwndAbout = nullptr;\r\n            break;\r\n\r\n        default:\r\n            return DefWindowProc(hwnd, message, wParam, lParam);\r\n    }\r\n    return 0;\r\n}\r\n\r\nvoid OnMenuAbout()\r\n{\r\n    if (gHwndAbout) {\r\n        SetActiveWindow(gHwndAbout);\r\n        return;\r\n    }\r\n\r\n    if (!gAtomAbout) {\r\n        WNDCLASSEX  wcex;\r\n        FillWndClassEx(wcex, ABOUT_CLASS_NAME, WndProcAbout);\r\n        wcex.hIcon = LoadIcon(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDI_SUMATRAPDF));\r\n        gAtomAbout = RegisterClassEx(&wcex);\r\n        CrashIf(!gAtomAbout);\r\n    }\r\n\r\n    gHwndAbout = CreateWindow(\r\n            ABOUT_CLASS_NAME, ABOUT_WIN_TITLE,\r\n            WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU,\r\n            CW_USEDEFAULT, CW_USEDEFAULT,\r\n            CW_USEDEFAULT, CW_USEDEFAULT,\r\n            nullptr, nullptr,\r\n            GetModuleHandle(nullptr), nullptr);\r\n    if (!gHwndAbout)\r\n        return;\r\n\r\n    ToggleWindowStyle(gHwndAbout, WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT, IsUIRightToLeft(), GWL_EXSTYLE);\r\n\r\n    // get the dimensions required for the about box's content\r\n    RectI rc;\r\n    PAINTSTRUCT ps;\r\n    HDC hdc = BeginPaint(gHwndAbout, &ps);\r\n    SetLayout(hdc, LAYOUT_LTR);\r\n    UpdateAboutLayoutInfo(gHwndAbout, hdc, &rc);\r\n    EndPaint(gHwndAbout, &ps);\r\n    rc.Inflate(ABOUT_RECT_PADDING, ABOUT_RECT_PADDING);\r\n\r\n    // resize the new window to just match these dimensions\r\n    WindowRect wRc(gHwndAbout);\r\n    ClientRect cRc(gHwndAbout);\r\n    wRc.dx += rc.dx - cRc.dx;\r\n    wRc.dy += rc.dy - cRc.dy;\r\n    MoveWindow(gHwndAbout, wRc.x, wRc.y, wRc.dx, wRc.dy, FALSE);\r\n\r\n    ShowWindow(gHwndAbout, SW_SHOW);\r\n}\r\n\r\nvoid DrawAboutPage(WindowInfo& win, HDC hdc)\r\n{\r\n    ClientRect rc(win.hwndCanvas);\r\n    UpdateAboutLayoutInfo(win.hwndCanvas, hdc, &rc);\r\n    DrawAbout(win.hwndCanvas, hdc, rc, win.staticLinks);\r\n    if (HasPermission(Perm_SavePreferences | Perm_DiskAccess) && gGlobalPrefs->rememberOpenedFiles) {\r\n        RectI rect = DrawBottomRightLink(win.hwndCanvas, hdc, _TR(\"Show frequently read\"));\r\n        win.staticLinks.Append(StaticLinkInfo(rect, SLINK_LIST_SHOW));\r\n    }\r\n}\r\n\r\n/* alternate static page to display when no document is loaded */\r\n\r\n#define DOCLIST_SEPARATOR_DY        2\r\n#define DOCLIST_THUMBNAIL_BORDER_W  1\r\n#define DOCLIST_MARGIN_LEFT         DpiScaleX(win.hwndFrame, 40)\r\n#define DOCLIST_MARGIN_BETWEEN_X    DpiScaleX(win.hwndFrame, 30)\r\n#define DOCLIST_MARGIN_RIGHT        DpiScaleX(win.hwndFrame, 40)\r\n#define DOCLIST_MARGIN_TOP          DpiScaleY(win.hwndFrame, 60)\r\n#define DOCLIST_MARGIN_BETWEEN_Y    DpiScaleY(win.hwndFrame, 50)\r\n#define DOCLIST_MARGIN_BOTTOM       DpiScaleY(win.hwndFrame, 40)\r\n#define DOCLIST_MAX_THUMBNAILS_X    5\r\n#define DOCLIST_BOTTOM_BOX_DY       DpiScaleY(win.hwndFrame, 50)\r\n\r\nvoid DrawStartPage(WindowInfo& win, HDC hdc, FileHistory& fileHistory, COLORREF textColor, COLORREF backgroundColor)\r\n{\r\n    ScopedPen penBorder(CreatePen(PS_SOLID, DOCLIST_SEPARATOR_DY, WIN_COL_BLACK));\r\n    ScopedPen penThumbBorder(CreatePen(PS_SOLID, DOCLIST_THUMBNAIL_BORDER_W, WIN_COL_BLACK));\r\n    ScopedPen penLinkLine(CreatePen(PS_SOLID, 1, COL_BLUE_LINK));\r\n\r\n    ScopedFont fontSumatraTxt(CreateSimpleFont(hdc, L\"MS Shell Dlg\", 24));\r\n    ScopedFont fontLeftTxt(CreateSimpleFont(hdc, L\"MS Shell Dlg\", 14));\r\n\r\n    ScopedHdcSelect font(hdc, fontSumatraTxt);\r\n\r\n    ClientRect rc(win.hwndCanvas);\r\n    RECT rTmp = rc.ToRECT();\r\n    ScopedBrush brushLogoBg(CreateSolidBrush(GetLogoBgColor()));\r\n    FillRect(hdc, &rTmp, brushLogoBg);\r\n\r\n    ScopedHdcSelect brush(hdc, brushLogoBg);\r\n    ScopedHdcSelect pen(hdc, penBorder);\r\n\r\n    bool isRtl = IsUIRightToLeft();\r\n\r\n    /* render title */\r\n    RectI titleBox = RectI(PointI(0, 0), CalcSumatraVersionSize(win.hwndCanvas, hdc));\r\n    titleBox.x = rc.dx - titleBox.dx - 3;\r\n    DrawSumatraVersion(hdc, titleBox);\r\n    PaintLine(hdc, RectI(0, titleBox.dy, rc.dx, 0));\r\n\r\n    /* render recent files list */\r\n    SelectObject(hdc, penThumbBorder);\r\n    SetBkMode(hdc, TRANSPARENT);\r\n    SetTextColor(hdc, WIN_COL_BLACK);\r\n\r\n    rc.y += titleBox.dy;\r\n    rc.dy -= titleBox.dy;\r\n    rTmp = rc.ToRECT();\r\n    ScopedGdiObj<HBRUSH> brushAboutBg(CreateSolidBrush(GetAboutBgColor()));\r\n    FillRect(hdc, &rTmp, brushAboutBg);\r\n    rc.dy -= DOCLIST_BOTTOM_BOX_DY;\r\n\r\n    Vec<DisplayState *> list;\r\n    fileHistory.GetFrequencyOrder(list);\r\n\r\n    int width = limitValue((rc.dx - DOCLIST_MARGIN_LEFT - DOCLIST_MARGIN_RIGHT + DOCLIST_MARGIN_BETWEEN_X) / (THUMBNAIL_DX + DOCLIST_MARGIN_BETWEEN_X), 1, DOCLIST_MAX_THUMBNAILS_X);\r\n    int height = std::min((rc.dy - DOCLIST_MARGIN_TOP - DOCLIST_MARGIN_BOTTOM + DOCLIST_MARGIN_BETWEEN_Y) / (THUMBNAIL_DY + DOCLIST_MARGIN_BETWEEN_Y), FILE_HISTORY_MAX_FREQUENT / width);\r\n    PointI offset(rc.x + DOCLIST_MARGIN_LEFT + (rc.dx - width * THUMBNAIL_DX - (width - 1) * DOCLIST_MARGIN_BETWEEN_X - DOCLIST_MARGIN_LEFT - DOCLIST_MARGIN_RIGHT) / 2, rc.y + DOCLIST_MARGIN_TOP);\r\n    if (offset.x < ABOUT_INNER_PADDING)\r\n        offset.x = ABOUT_INNER_PADDING;\r\n    else if (list.Count() == 0)\r\n        offset.x = DOCLIST_MARGIN_LEFT;\r\n\r\n    SelectObject(hdc, fontSumatraTxt);\r\n    SIZE txtSize;\r\n    const WCHAR *txt = _TR(\"Frequently Read\");\r\n    GetTextExtentPoint32(hdc, txt, (int)str::Len(txt), &txtSize);\r\n    RectI headerRect(offset.x, rc.y + (DOCLIST_MARGIN_TOP - txtSize.cy) / 2, txtSize.cx, txtSize.cy);\r\n    if (isRtl)\r\n        headerRect.x = rc.dx - offset.x - headerRect.dx;\r\n    rTmp = headerRect.ToRECT();\r\n    DrawText(hdc, txt, -1, &rTmp, (isRtl ? DT_RTLREADING : DT_LEFT) | DT_NOPREFIX);\r\n\r\n    SelectObject(hdc, fontLeftTxt);\r\n    SelectObject(hdc, GetStockBrush(NULL_BRUSH));\r\n\r\n    win.staticLinks.Reset();\r\n    for (int h = 0; h < height; h++) {\r\n        for (int w = 0; w < width; w++) {\r\n            if (h * width + w >= (int)list.Count()) {\r\n                // display the \"Open a document\" link right below the last row\r\n                height = w > 0 ? h + 1 : h;\r\n                break;\r\n            }\r\n            DisplayState *state = list.At(h * width + w);\r\n\r\n            RectI page(offset.x + w * (THUMBNAIL_DX + DOCLIST_MARGIN_BETWEEN_X),\r\n                       offset.y + h * (THUMBNAIL_DY + DOCLIST_MARGIN_BETWEEN_Y),\r\n                       THUMBNAIL_DX, THUMBNAIL_DY);\r\n            if (isRtl)\r\n                page.x = rc.dx - page.x - page.dx;\r\n            bool loadOk = true;\r\n            if (!state->thumbnail)\r\n                loadOk = LoadThumbnail(*state);\r\n            if (loadOk && state->thumbnail) {\r\n                SizeI thumbSize = state->thumbnail->Size();\r\n                if (thumbSize.dx != THUMBNAIL_DX || thumbSize.dy != THUMBNAIL_DY) {\r\n                    page.dy = thumbSize.dy * THUMBNAIL_DX / thumbSize.dx;\r\n                    page.y += THUMBNAIL_DY - page.dy;\r\n                }\r\n                HRGN clip = CreateRoundRectRgn(page.x, page.y, page.x + page.dx, page.y + page.dy, 10, 10);\r\n                SelectClipRgn(hdc, clip);\r\n                RenderedBitmap *clone = state->thumbnail->Clone();\r\n                if (clone) {\r\n                    UpdateBitmapColors(clone->GetBitmap(), textColor, backgroundColor);\r\n                    clone->StretchDIBits(hdc, page);\r\n                    delete clone;\r\n                }\r\n                else {\r\n                    state->thumbnail->StretchDIBits(hdc, page);\r\n                }\r\n                SelectClipRgn(hdc, nullptr);\r\n                DeleteObject(clip);\r\n            }\r\n            RoundRect(hdc, page.x, page.y, page.x + page.dx, page.y + page.dy, 10, 10);\r\n\r\n            int iconSpace = DpiScaleX(win.hwndFrame, 20);\r\n            RectI rect(page.x + iconSpace, page.y + page.dy + 3, page.dx - iconSpace, iconSpace);\r\n            if (isRtl)\r\n                rect.x -= iconSpace;\r\n            rTmp = rect.ToRECT();\r\n            DrawText(hdc, path::GetBaseName(state->filePath), -1, &rTmp, DT_SINGLELINE | DT_END_ELLIPSIS | DT_NOPREFIX | (isRtl ? DT_RIGHT : DT_LEFT));\r\n\r\n            SHFILEINFO sfi = { 0 };\r\n            HIMAGELIST himl = (HIMAGELIST)SHGetFileInfo(state->filePath, 0, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_USEFILEATTRIBUTES);\r\n            ImageList_Draw(himl, sfi.iIcon, hdc,\r\n                           isRtl ? page.x + page.dx - DpiScaleX(win.hwndFrame, 16) : page.x,\r\n                           rect.y, ILD_TRANSPARENT);\r\n\r\n            win.staticLinks.Append(StaticLinkInfo(rect.Union(page), state->filePath, state->filePath));\r\n        }\r\n    }\r\n\r\n    /* render bottom links */\r\n    rc.y += DOCLIST_MARGIN_TOP + height * THUMBNAIL_DY + (height - 1) * DOCLIST_MARGIN_BETWEEN_Y + DOCLIST_MARGIN_BOTTOM;\r\n    rc.dy = DOCLIST_BOTTOM_BOX_DY;\r\n\r\n    SetTextColor(hdc, COL_BLUE_LINK);\r\n    SelectObject(hdc, penLinkLine);\r\n\r\n    HIMAGELIST himl = (HIMAGELIST)SendMessage(win.hwndToolbar, TB_GETIMAGELIST, 0, 0);\r\n    RectI rectIcon(offset.x, rc.y, 0, 0);\r\n    ImageList_GetIconSize(himl, &rectIcon.dx, &rectIcon.dy);\r\n    rectIcon.y += (rc.dy - rectIcon.dy) / 2;\r\n    if (isRtl)\r\n        rectIcon.x = rc.dx - offset.x - rectIcon.dx;\r\n    ImageList_Draw(himl, 0 /* index of Open icon */, hdc, rectIcon.x, rectIcon.y, ILD_NORMAL);\r\n\r\n    txt = _TR(\"Open a document...\");\r\n    GetTextExtentPoint32(hdc, txt, (int)str::Len(txt), &txtSize);\r\n    RectI rect(offset.x + rectIcon.dx + 3, rc.y + (rc.dy - txtSize.cy) / 2, txtSize.cx, txtSize.cy);\r\n    if (isRtl)\r\n        rect.x = rectIcon.x - rect.dx - 3;\r\n    rTmp = rect.ToRECT();\r\n    DrawText(hdc, txt, -1, &rTmp, isRtl ? DT_RTLREADING : DT_LEFT);\r\n    PaintLine(hdc, RectI(rect.x, rect.y + rect.dy, rect.dx, 0));\r\n    // make the click target larger\r\n    rect = rect.Union(rectIcon);\r\n    rect.Inflate(10, 10);\r\n    win.staticLinks.Append(StaticLinkInfo(rect, SLINK_OPEN_FILE));\r\n\r\n    rect = DrawBottomRightLink(win.hwndCanvas, hdc, _TR(\"Hide frequently read\"));\r\n    win.staticLinks.Append(StaticLinkInfo(rect, SLINK_LIST_HIDE));\r\n}\r\n"
  },
  {
    "path": "src/SumatraAbout.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nvoid OnMenuAbout();\r\n\r\nvoid  DrawAboutPage(WindowInfo& win, HDC hdc);\r\n\r\nconst WCHAR *GetStaticLink(Vec<StaticLinkInfo>& linkInfo, int x, int y, StaticLinkInfo *info=nullptr);\r\n\r\n#define SLINK_OPEN_FILE L\"<File,Open>\"\r\n#define SLINK_LIST_SHOW L\"<View,ShowList>\"\r\n#define SLINK_LIST_HIDE L\"<View,HideList>\"\r\n\r\nvoid    DrawStartPage(WindowInfo& win, HDC hdc, FileHistory& fileHistory, COLORREF textColor, COLORREF backgroundColor);\r\n"
  },
  {
    "path": "src/SumatraAbout2.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"GdiPlusUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"Mui.h\"\r\n#include \"WinUtil.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"resource.h\"\r\n#include \"SumatraAbout2.h\"\r\n#include \"Translations.h\"\r\n#include \"Version.h\"\r\n\r\nusing namespace mui;\r\n\r\n/* This is an experiment to re-implement About window using a generic\r\nlayout logic */\r\n\r\n#define WND_CLASS_ABOUT2        L\"WND_CLASS_SUMATRA_ABOUT2\"\r\n#define ABOUT_WIN_TITLE         _TR(\"About SumatraPDF\")\r\n#define TABLE_BORDER_WIDTH      2.f\r\n\r\n#define VERSION_TXT             L\"v\" CURR_VERSION_STR\r\n#ifdef SVN_PRE_RELEASE_VER\r\n #define VERSION_SUB_TXT        L\"Pre-release\"\r\n#else\r\n #define VERSION_SUB_TXT        L\"\"\r\n#endif\r\n\r\n#define SUMATRA_TXT_FONT        L\"Arial Black\"\r\n#define SUMATRA_TXT_FONT_SIZE   18.f\r\n\r\nstatic ATOM gAboutWndAtom = 0;\r\nstatic HWND gHwndAbout2 = nullptr;\r\nstatic HwndWrapper *mainWnd = nullptr;\r\n\r\nstatic Style *   styleMainWnd = nullptr;\r\nstatic Style *   styleGrid = nullptr;\r\nstatic Style *   styleCellLeft = nullptr;\r\nstatic Style *   styleCellVer = nullptr;\r\nstatic Style *   styleLogo = nullptr;\r\nstatic Style *   styleBtnVer = nullptr;\r\nstatic Style *   styleBtnLeft = nullptr;\r\nstatic Style *   styleBtnRight = nullptr;\r\n\r\nstatic void CreateAboutStyles()\r\n{\r\n    // only create styles once\r\n    if (styleMainWnd)\r\n        return;\r\n\r\n    styleMainWnd = new Style();\r\n    styleMainWnd->Set(Prop::AllocColorSolid(PropBgColor, \"0xfff200\"));\r\n\r\n    styleGrid = new Style();\r\n    styleGrid->Set(Prop::AllocColorSolid(PropBgColor, \"transparent\"));\r\n    styleGrid->SetBorderWidth(TABLE_BORDER_WIDTH);\r\n    styleGrid->SetBorderColor(ParseCssColor(\"#000\"));\r\n\r\n    styleCellLeft = new Style();\r\n    // TODO: should change gStyleDefault to something more reasonable so no\r\n    // need to re-define border style so much\r\n    styleCellLeft->SetBorderWidth(0);\r\n    styleCellLeft->Set(Prop::AllocWidth(PropBorderRightWidth, 1.f));\r\n    styleCellLeft->SetBorderColor(ParseCssColor(\"black\"));\r\n    styleCellLeft->Set(Prop::AllocPadding(2, 4, 2, 0));\r\n\r\n    styleCellVer = new Style();\r\n    styleCellVer->SetBorderWidth(0);\r\n    styleCellVer->Set(Prop::AllocWidth(PropBorderBottomWidth, TABLE_BORDER_WIDTH));\r\n    styleCellVer->SetBorderColor(ParseCssColor(\"black\"));\r\n    styleCellVer->Set(Prop::AllocPadding(2, 0, 2, 0));\r\n\r\n    styleLogo = new Style();\r\n    styleLogo->Set(Prop::AllocFontName(SUMATRA_TXT_FONT));\r\n    styleLogo->Set(Prop::AllocFontSize(SUMATRA_TXT_FONT_SIZE));\r\n\r\n    styleBtnVer = new Style();\r\n    styleBtnVer->Set(Prop::AllocFontName(SUMATRA_TXT_FONT));\r\n    styleBtnVer->Set(Prop::AllocFontSize(10.f));\r\n    styleBtnVer->SetBorderWidth(0);\r\n    styleBtnVer->Set(Prop::AllocColorSolid(PropBgColor, \"transparent\"));\r\n    styleBtnVer->SetPadding(0, 0, 6, 0);\r\n\r\n    styleBtnLeft = new Style();\r\n    styleBtnLeft->Set(Prop::AllocFontName(L\"Arial\"));\r\n    styleBtnLeft->Set(Prop::AllocFontWeight(FontStyleRegular));\r\n    styleBtnLeft->Set(Prop::AllocFontSize(9.f));\r\n    styleBtnLeft->Set(Prop::AllocColorSolid(PropColor, \"black\"));\r\n    styleBtnLeft->Set(Prop::AllocPadding(2, 8, 2, 16));\r\n    styleBtnLeft->Set(Prop::AllocColorSolid(PropBgColor, \"transparent\"));\r\n    styleBtnLeft->SetBorderWidth(0);\r\n\r\n    styleBtnRight = new Style(styleBtnLeft);\r\n    styleBtnRight->Set(Prop::AllocFontName(L\"Arial Black\"));\r\n    styleBtnRight->Set(Prop::AllocFontWeight(FontStyleUnderline));\r\n    styleBtnRight->Set(Prop::AllocColorSolid(PropColor, \"0020a0\"));\r\n}\r\n\r\nstruct AboutLayoutInfoEl {\r\n    /* static data, must be provided */\r\n    const WCHAR *   leftTxt;\r\n    const WCHAR *   rightTxt;\r\n    const WCHAR *   url;\r\n};\r\n\r\n// TODO: replace this link with a better one where license information is nicely collected/linked\r\n#if defined(SVN_PRE_RELEASE_VER) || defined(DEBUG)\r\n#define URL_LICENSE L\"https://github.com/sumatrapdfreader/sumatrapdf/blob/master/AUTHORS\"\r\n#define URL_AUTHORS L\"https://github.com/sumatrapdfreader/sumatrapdf/blob/master/AUTHORS\"\r\n#define URL_TRANSLATORS L\"https://github.com/sumatrapdfreader/sumatrapdf/blob/master/TRANSLATORS\"\r\n#else\r\n#define URL_LICENSE L\"https://github.com/sumatrapdfreader/sumatrapdf/blob/\" UPDATE_CHECK_VER L\"rel/AUTHORS\"\r\n#define URL_AUTHORS L\"https://github.com/sumatrapdfreader/sumatrapdf/blob/\" UPDATE_CHECK_VER L\"rel/AUTHORS\"\r\n#define URL_TRANSLATORS L\"https://github.com/sumatrapdfreader/sumatrapdf/blob/\" UPDATE_CHECK_VER L\"rel/TRANSLATORS\"\r\n#endif\r\n\r\nstatic AboutLayoutInfoEl gAboutLayoutInfo[] = {\r\n    { L\"website\",        L\"SumatraPDF website\",   WEBSITE_MAIN_URL},\r\n    { L\"manual\",         L\"SumatraPDF manual\",    WEBSITE_MANUAL_URL },\r\n    { L\"forums\",         L\"SumatraPDF forums\",    L\"http://blog.kowalczyk.info/forum_sumatra\" },\r\n    { L\"programming\",    L\"The Programmers\",      URL_AUTHORS },\r\n    { L\"translations\",   L\"The Translators\",      URL_TRANSLATORS },\r\n    { L\"licenses\",       L\"Various Open Source\",  URL_LICENSE },\r\n#ifdef SVN_PRE_RELEASE_VER\r\n    { L\"a note\",         L\"Pre-release version, for testing only!\", nullptr },\r\n#endif\r\n#ifdef DEBUG\r\n    { L\"a note\",         L\"Debug version, for testing only!\", nullptr },\r\n#endif\r\n};\r\n\r\n#define COL1 RGB(196, 64, 50)\r\n#define COL2 RGB(227, 107, 35)\r\n#define COL3 RGB(93,  160, 40)\r\n#define COL4 RGB(69, 132, 190)\r\n#define COL5 RGB(112, 115, 207)\r\n\r\n#define LOGO_TEXT L\"SumatraPDF\"\r\n\r\nstatic COLORREF gSumatraLogoCols[] = { COL1, COL2, COL3, COL4, COL5, COL5, COL4, COL3, COL2, COL1 };\r\n\r\nclass SumatraLogo : public Control\r\n{\r\npublic:\r\n    SumatraLogo() {}\r\n    virtual ~SumatraLogo() {}\r\n    virtual Size Measure(const Size availableSize);\r\n    virtual void Paint(Graphics *gfx, int offX, int offY);\r\n};\r\n\r\nSize SumatraLogo::Measure(const Size availableSize)\r\n{\r\n    UNUSED(availableSize);\r\n    Graphics *gfx = AllocGraphicsForMeasureText();\r\n    CachedStyle *s = cachedStyle;\r\n    CachedFont *cachedFont = GetCachedFont(s->fontName, s->fontSize, s->fontWeight);\r\n    Font *font = cachedFont->font;\r\n    CrashIf(!font);\r\n    const WCHAR *txt = LOGO_TEXT;\r\n    RectF bbox;\r\n    int textDx = 0;\r\n    while (*txt) {\r\n        bbox = MeasureText(gfx, font, txt, 1);\r\n        textDx += CeilI(bbox.Width);\r\n        txt++;\r\n    }\r\n    desiredSize.Width = textDx;\r\n    desiredSize.Height = CeilI(font->GetHeight(gfx));\r\n    FreeGraphicsForMeasureText(gfx);\r\n    return desiredSize;\r\n}\r\n\r\nvoid SumatraLogo::Paint(Graphics *gfx, int offX, int offY)\r\n{\r\n    CrashIf(!IsVisible());\r\n\r\n    CachedStyle *s = cachedStyle;\r\n    CachedFont *cachedFont = GetCachedFont(s->fontName, s->fontSize, s->fontWeight);\r\n    Font *font = cachedFont->font;\r\n    CrashIf(!font);\r\n\r\n    int x = offX; int y = offY;\r\n    int n = 0;\r\n    const WCHAR *txt = LOGO_TEXT;\r\n    RectF bbox;\r\n    while (*txt) {\r\n        Color c;\r\n        c.SetFromCOLORREF(gSumatraLogoCols[n++]);\r\n        SolidBrush col(c);\r\n        if (n >= dimof(gSumatraLogoCols))\r\n            n = 0;\r\n        gfx->DrawString(txt, 1, font, PointF((REAL)x, (REAL)y), nullptr, &col);\r\n        bbox = MeasureText(gfx, font, txt, 1);\r\n        x += CeilI(bbox.Width);\r\n        txt++;\r\n    }\r\n}\r\n\r\nclass ButtonUrlHandler\r\n{\r\npublic:\r\n    void Clicked(Control *c, int x, int y);\r\n};\r\n\r\nvoid ButtonUrlHandler::Clicked(Control *c, int x, int y)\r\n{\r\n    UNUSED(x); UNUSED(y);\r\n    WCHAR *url = c->toolTip;\r\n    LaunchBrowser(url);\r\n}\r\n\r\n// we only need one instance\r\nstatic ButtonUrlHandler *gButtonUrlHandler = nullptr;\r\n\r\nstatic void CreateAboutMuiWindow(HWND hwnd)\r\n{\r\n    if (!gButtonUrlHandler)\r\n        gButtonUrlHandler = new ButtonUrlHandler();\r\n\r\n    CreateAboutStyles();\r\n    mainWnd = new HwndWrapper(hwnd);\r\n    mainWnd->centerContent = true;\r\n    mainWnd->SetStyle(styleMainWnd);\r\n    EventMgr *em = mainWnd->evtMgr;\r\n    CrashIf(!em);\r\n\r\n    Grid *grid = new Grid(styleGrid);\r\n    Grid::CellData ld;\r\n\r\n    SumatraLogo *logo = new SumatraLogo();\r\n    logo->SetStyle(styleLogo);\r\n    ld.Set(logo, 0, 0, ElAlign::Center);\r\n    ld.colSpan = 2;\r\n    grid->Add(ld);\r\n\r\n    Button *b = new Button(VERSION_TXT, styleBtnVer, styleBtnVer);\r\n    ld.Set(b, 1, 0, ElAlign::Center);\r\n    ld.colSpan = 2;\r\n    ld.SetStyle(styleCellVer);\r\n    grid->Add(ld);\r\n\r\n    int rows = dimof(gAboutLayoutInfo);\r\n    for (int n = 0; n < rows; n++) {\r\n        const WCHAR *left = gAboutLayoutInfo[n].leftTxt;\r\n        const WCHAR *right = gAboutLayoutInfo[n].rightTxt;\r\n        const WCHAR *url = gAboutLayoutInfo[n].url;\r\n\r\n        int row = n + 2;\r\n        b = new Button(left, styleBtnLeft, styleBtnLeft);\r\n        ld.Set(b, row, 0, ElAlign::Right);\r\n        ld.SetStyle(styleCellLeft);\r\n        grid->Add(ld);\r\n\r\n        if (url) {\r\n            b = new Button(right, styleBtnRight, styleBtnRight);\r\n            b->SetToolTip(url);\r\n            b->hCursor = GetCursor(IDC_HAND);\r\n        } else {\r\n            b = new Button(right, styleBtnLeft, styleBtnLeft);\r\n        }\r\n        em->EventsForControl(b)->Clicked = [&](Control*c, int x, int y) {\r\n            gButtonUrlHandler->Clicked(c, x, y);\r\n        };\r\n        ld.Set(b, row, 1);\r\n        grid->Add(ld);\r\n    }\r\n    mainWnd->AddChild(grid);\r\n}\r\n\r\nstatic void DestroyAboutMuiWindow()\r\n{\r\n    gHwndAbout2 = nullptr;\r\n    delete mainWnd;\r\n    mainWnd = nullptr;\r\n    delete gButtonUrlHandler;\r\n    gButtonUrlHandler = nullptr;\r\n}\r\n\r\nstatic void CopyAboutInfoToClipboard(HWND hwnd)\r\n{\r\n    UNUSED(hwnd);\r\n    str::Str<WCHAR> info(512);\r\n    info.AppendFmt(L\"%s %s\\r\\n\", APP_NAME_STR, VERSION_TXT);\r\n    for (size_t i = info.Size() - 2; i > 0; i--) {\r\n        info.Append('-');\r\n    }\r\n    info.Append(L\"\\r\\n\");\r\n    // concatenate all the information into a single string\r\n    // (cf. CopyPropertiesToClipboard in SumatraProperties.cpp)\r\n    size_t maxLen = 0;\r\n    for (size_t i = 0; i < dimof(gAboutLayoutInfo); i++) {\r\n        AboutLayoutInfoEl& el = gAboutLayoutInfo[i];\r\n        maxLen = std::max(maxLen, str::Len(el.leftTxt));\r\n    }\r\n    for (size_t i = 0; i < dimof(gAboutLayoutInfo); i++) {\r\n        AboutLayoutInfoEl& el = gAboutLayoutInfo[i];\r\n        for (size_t j = maxLen - str::Len(el.leftTxt); j > 0; j--)\r\n            info.Append(' ');\r\n        info.AppendFmt(L\"%s: %s\\r\\n\", el.leftTxt, el.url ? el.url : el.rightTxt);\r\n    }\r\n    CopyTextToClipboard(info.LendData());\r\n}\r\n\r\nstatic LRESULT CALLBACK WndProcAbout2(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    if (mainWnd) {\r\n        bool wasHandled;\r\n        LRESULT res = mainWnd->evtMgr->OnMessage(msg, wParam, lParam, wasHandled);\r\n        if (wasHandled)\r\n            return res;\r\n    }\r\n\r\n    switch (msg) {\r\n        case WM_CHAR:\r\n            if (VK_ESCAPE == wParam)\r\n                DestroyWindow(hwnd);\r\n            break;\r\n\r\n        case WM_CREATE:\r\n            CreateAboutMuiWindow(hwnd);\r\n            break;\r\n\r\n        case WM_COMMAND:\r\n            if (IDM_COPY_SELECTION == LOWORD(wParam))\r\n                CopyAboutInfoToClipboard(hwnd);\r\n            break;\r\n\r\n        case WM_DESTROY:\r\n            DestroyAboutMuiWindow();\r\n            break;\r\n\r\n        default:\r\n            return DefWindowProc(hwnd, msg, wParam, lParam);\r\n    }\r\n    return 0;\r\n}\r\n\r\nvoid OnMenuAbout2()\r\n{\r\n    WNDCLASSEX  wcex;\r\n\r\n    if (gHwndAbout2) {\r\n        SetActiveWindow(gHwndAbout2);\r\n        return;\r\n    }\r\n\r\n    if (!gAboutWndAtom) {\r\n        FillWndClassEx(wcex, WND_CLASS_ABOUT2, WndProcAbout2);\r\n        wcex.hIcon = LoadIcon(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDI_SUMATRAPDF));\r\n        gAboutWndAtom = RegisterClassEx(&wcex);\r\n        CrashIf(!gAboutWndAtom);\r\n    }\r\n    gHwndAbout2 = CreateWindow(\r\n            WND_CLASS_ABOUT2, ABOUT_WIN_TITLE,\r\n            WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU,\r\n            CW_USEDEFAULT, CW_USEDEFAULT,\r\n            520, 400,\r\n            nullptr, nullptr,\r\n            GetModuleHandle(nullptr), nullptr);\r\n    if (!gHwndAbout2)\r\n        return;\r\n\r\n    ToggleWindowStyle(gHwndAbout2, WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT, IsUIRightToLeft(), GWL_EXSTYLE);\r\n\r\n    ShowWindow(gHwndAbout2, SW_SHOW);\r\n}\r\n"
  },
  {
    "path": "src/SumatraAbout2.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nvoid OnMenuAbout2();\r\n"
  },
  {
    "path": "src/SumatraDialogs.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"DialogSizer.h\"\r\n#include \"WinUtil.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"GlobalPrefs.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"resource.h\"\r\n#include \"AppTools.h\"\r\n#include \"SumatraDialogs.h\"\r\n#include \"Translations.h\"\r\n\r\n// cf. http://msdn.microsoft.com/en-us/library/ms645398(v=VS.85).aspx\r\nstruct DLGTEMPLATEEX {\r\n    WORD      dlgVer;   // 0x0001\r\n    WORD      signature;// 0xFFFF\r\n    DWORD     helpID;\r\n    DWORD     exStyle;\r\n    DWORD     style;\r\n    WORD      cDlgItems;\r\n    short     x, y, cx, cy;\r\n    /* ... */\r\n};\r\n\r\n// gets a dialog template from the resources and sets the RTL flag\r\n// cf. http://www.ureader.com/msg/1484387.aspx\r\nstatic DLGTEMPLATE *GetRtLDlgTemplate(int dlgId)\r\n{\r\n    HRSRC dialogRC = FindResource(nullptr, MAKEINTRESOURCE(dlgId), RT_DIALOG);\r\n    if (!dialogRC)\r\n        return nullptr;\r\n    HGLOBAL dlgTemplate = LoadResource(nullptr, dialogRC);\r\n    if (!dlgTemplate)\r\n        return nullptr;\r\n    void *origDlgTemplate = LockResource(dlgTemplate);\r\n    size_t size = SizeofResource(nullptr, dialogRC);\r\n\r\n    DLGTEMPLATE *rtlDlgTemplate = (DLGTEMPLATE *)memdup(origDlgTemplate, size);\r\n    if (rtlDlgTemplate->style == MAKELONG(0x0001, 0xFFFF))\r\n        ((DLGTEMPLATEEX *)rtlDlgTemplate)->exStyle |= WS_EX_LAYOUTRTL;\r\n    else\r\n        rtlDlgTemplate->dwExtendedStyle |= WS_EX_LAYOUTRTL;\r\n    UnlockResource(dlgTemplate);\r\n\r\n    return rtlDlgTemplate;\r\n}\r\n\r\n// creates a dialog box that dynamically gets a right-to-left layout if needed\r\nstatic INT_PTR CreateDialogBox(int dlgId, HWND parent, DLGPROC DlgProc, LPARAM data)\r\n{\r\n    if (!IsUIRightToLeft())\r\n        return DialogBoxParam(nullptr, MAKEINTRESOURCE(dlgId), parent, DlgProc, data);\r\n\r\n    ScopedMem<DLGTEMPLATE> rtlDlgTemplate(GetRtLDlgTemplate(dlgId));\r\n    return DialogBoxIndirectParam(nullptr, rtlDlgTemplate, parent, DlgProc, data);\r\n}\r\n\r\n/* For passing data to/from GetPassword dialog */\r\nstruct Dialog_GetPassword_Data {\r\n    const WCHAR *  fileName;   /* name of the file for which we need the password */\r\n    WCHAR *        pwdOut;     /* password entered by the user */\r\n    bool *         remember;   /* remember the password (encrypted) or ask again? */\r\n};\r\n\r\nstatic INT_PTR CALLBACK Dialog_GetPassword_Proc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    Dialog_GetPassword_Data *data;\r\n\r\n//[ ACCESSKEY_GROUP Password Dialog\r\n    if (WM_INITDIALOG == msg)\r\n    {\r\n        data = (Dialog_GetPassword_Data*)lParam;\r\n        win::SetText(hDlg, _TR(\"Enter password\"));\r\n        SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)data);\r\n        EnableWindow(GetDlgItem(hDlg, IDC_REMEMBER_PASSWORD), data->remember != nullptr);\r\n\r\n        ScopedMem<WCHAR> txt(str::Format(_TR(\"Enter password for %s\"), data->fileName));\r\n        SetDlgItemText(hDlg, IDC_GET_PASSWORD_LABEL, txt);\r\n        SetDlgItemText(hDlg, IDC_GET_PASSWORD_EDIT, L\"\");\r\n        SetDlgItemText(hDlg, IDC_STATIC, _TR(\"&Password:\"));\r\n        SetDlgItemText(hDlg, IDC_REMEMBER_PASSWORD, _TR(\"&Remember the password for this document\"));\r\n        SetDlgItemText(hDlg, IDOK, _TR(\"OK\"));\r\n        SetDlgItemText(hDlg, IDCANCEL, _TR(\"Cancel\"));\r\n\r\n        CenterDialog(hDlg);\r\n        SetFocus(GetDlgItem(hDlg, IDC_GET_PASSWORD_EDIT));\r\n        return FALSE;\r\n    }\r\n//] ACCESSKEY_GROUP Password Dialog\r\n\r\n    switch (msg)\r\n    {\r\n        case WM_COMMAND:\r\n            switch (LOWORD(wParam))\r\n            {\r\n                case IDOK:\r\n                    data = (Dialog_GetPassword_Data*)GetWindowLongPtr(hDlg, GWLP_USERDATA);\r\n                    assert(data);\r\n                    data->pwdOut = win::GetText(GetDlgItem(hDlg, IDC_GET_PASSWORD_EDIT));\r\n                    if (data->remember)\r\n                        *data->remember = BST_CHECKED == IsDlgButtonChecked(hDlg, IDC_REMEMBER_PASSWORD);\r\n                    EndDialog(hDlg, IDOK);\r\n                    return TRUE;\r\n\r\n                case IDCANCEL:\r\n                    EndDialog(hDlg, IDCANCEL);\r\n                    return TRUE;\r\n            }\r\n            break;\r\n    }\r\n    return FALSE;\r\n}\r\n\r\n/* Shows a 'get password' dialog for a given file.\r\n   Returns a password entered by user as a newly allocated string or\r\n   nullptr if user cancelled the dialog or there was an error.\r\n   Caller needs to free() the result.\r\n*/\r\nWCHAR *Dialog_GetPassword(HWND hwndParent, const WCHAR *fileName, bool *rememberPassword)\r\n{\r\n    Dialog_GetPassword_Data data = { 0 };\r\n    data.fileName = fileName;\r\n    data.remember = rememberPassword;\r\n\r\n    INT_PTR res = CreateDialogBox(IDD_DIALOG_GET_PASSWORD, hwndParent,\r\n                                  Dialog_GetPassword_Proc, (LPARAM)&data);\r\n    if (IDOK != res) {\r\n        free(data.pwdOut);\r\n        return nullptr;\r\n    }\r\n    return data.pwdOut;\r\n}\r\n\r\n/* For passing data to/from GoToPage dialog */\r\nstruct Dialog_GoToPage_Data {\r\n    const WCHAR *   currPageLabel;  // currently shown page label\r\n    int             pageCount;      // total number of pages\r\n    bool            onlyNumeric;    // whether the page label must be numeric\r\n    WCHAR *         newPageLabel;   // page number entered by user\r\n};\r\n\r\nstatic INT_PTR CALLBACK Dialog_GoToPage_Proc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    HWND                    editPageNo;\r\n    Dialog_GoToPage_Data *  data;\r\n\r\n//[ ACCESSKEY_GROUP GoTo Page Dialog\r\n    if (WM_INITDIALOG == msg)\r\n    {\r\n        data = (Dialog_GoToPage_Data*)lParam;\r\n        assert(data);\r\n        SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)data);\r\n        win::SetText(hDlg, _TR(\"Go to page\"));\r\n\r\n        editPageNo = GetDlgItem(hDlg, IDC_GOTO_PAGE_EDIT);\r\n        if (!data->onlyNumeric)\r\n            SetWindowLong(editPageNo, GWL_STYLE, GetWindowLong(editPageNo, GWL_STYLE) & ~ES_NUMBER);\r\n        assert(data->currPageLabel);\r\n        SetDlgItemText(hDlg, IDC_GOTO_PAGE_EDIT, data->currPageLabel);\r\n        ScopedMem<WCHAR> totalCount(str::Format(_TR(\"(of %d)\"), data->pageCount));\r\n        SetDlgItemText(hDlg, IDC_GOTO_PAGE_LABEL_OF, totalCount);\r\n\r\n        Edit_SelectAll(editPageNo);\r\n        SetDlgItemText(hDlg, IDC_STATIC, _TR(\"&Go to page:\"));\r\n        SetDlgItemText(hDlg, IDOK, _TR(\"Go to page\"));\r\n        SetDlgItemText(hDlg, IDCANCEL, _TR(\"Cancel\"));\r\n\r\n        CenterDialog(hDlg);\r\n        SetFocus(editPageNo);\r\n        return FALSE;\r\n    }\r\n//] ACCESSKEY_GROUP GoTo Page Dialog\r\n\r\n    switch (msg)\r\n    {\r\n        case WM_COMMAND:\r\n            switch (LOWORD(wParam))\r\n            {\r\n                case IDOK:\r\n                    data = (Dialog_GoToPage_Data*)GetWindowLongPtr(hDlg, GWLP_USERDATA);\r\n                    assert(data);\r\n                    editPageNo = GetDlgItem(hDlg, IDC_GOTO_PAGE_EDIT);\r\n                    data->newPageLabel = win::GetText(editPageNo);\r\n                    EndDialog(hDlg, IDOK);\r\n                    return TRUE;\r\n\r\n                case IDCANCEL:\r\n                    EndDialog(hDlg, IDCANCEL);\r\n                    return TRUE;\r\n            }\r\n            break;\r\n    }\r\n    return FALSE;\r\n}\r\n\r\n/* Shows a 'go to page' dialog and returns the page label entered by the user\r\n   or nullptr if user clicked the \"cancel\" button or there was an error.\r\n   The caller must free() the result. */\r\nWCHAR *Dialog_GoToPage(HWND hwnd, const WCHAR *currentPageLabel, int pageCount, bool onlyNumeric)\r\n{\r\n    Dialog_GoToPage_Data data;\r\n    data.currPageLabel = currentPageLabel;\r\n    data.pageCount = pageCount;\r\n    data.onlyNumeric = onlyNumeric;\r\n    data.newPageLabel = nullptr;\r\n\r\n    CreateDialogBox(IDD_DIALOG_GOTO_PAGE, hwnd,\r\n                    Dialog_GoToPage_Proc, (LPARAM)&data);\r\n    return data.newPageLabel;\r\n}\r\n\r\n/* For passing data to/from Find dialog */\r\nstruct Dialog_Find_Data {\r\n    WCHAR * searchTerm;\r\n    bool    matchCase;\r\n    WNDPROC editWndProc;\r\n};\r\n\r\nstatic LRESULT CALLBACK Dialog_Find_Edit_Proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)\r\n{\r\n    ExtendedEditWndProc(hwnd, message, wParam, lParam);\r\n\r\n    Dialog_Find_Data *data = (Dialog_Find_Data *)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);\r\n    return CallWindowProc(data->editWndProc, hwnd, message, wParam, lParam);\r\n}\r\n\r\nstatic INT_PTR CALLBACK Dialog_Find_Proc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    Dialog_Find_Data * data;\r\n\r\n    switch (msg)\r\n    {\r\n    case WM_INITDIALOG:\r\n//[ ACCESSKEY_GROUP Find Dialog\r\n        data = (Dialog_Find_Data*)lParam;\r\n        assert(data);\r\n        SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)data);\r\n\r\n        win::SetText(hDlg, _TR(\"Find\"));\r\n        SetDlgItemText(hDlg, IDC_STATIC, _TR(\"&Find what:\"));\r\n        SetDlgItemText(hDlg, IDC_MATCH_CASE, _TR(\"&Match case\"));\r\n        SetDlgItemText(hDlg, IDC_FIND_NEXT_HINT, _TR(\"Hint: Use the F3 key for finding again\"));\r\n        SetDlgItemText(hDlg, IDOK, _TR(\"Find\"));\r\n        SetDlgItemText(hDlg, IDCANCEL, _TR(\"Cancel\"));\r\n        if (data->searchTerm)\r\n            SetDlgItemText(hDlg, IDC_FIND_EDIT, data->searchTerm);\r\n        data->searchTerm = nullptr;\r\n        CheckDlgButton(hDlg, IDC_MATCH_CASE, data->matchCase ? BST_CHECKED : BST_UNCHECKED);\r\n        data->editWndProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hDlg, IDC_FIND_EDIT), GWLP_WNDPROC, (LONG_PTR)Dialog_Find_Edit_Proc);\r\n        Edit_SelectAll(GetDlgItem(hDlg, IDC_FIND_EDIT));\r\n\r\n        CenterDialog(hDlg);\r\n        SetFocus(GetDlgItem(hDlg, IDC_FIND_EDIT));\r\n        return FALSE;\r\n//] ACCESSKEY_GROUP Find Dialog\r\n    case WM_COMMAND:\r\n        switch (LOWORD(wParam))\r\n        {\r\n        case IDOK:\r\n            data = (Dialog_Find_Data*)GetWindowLongPtr(hDlg, GWLP_USERDATA);\r\n            assert(data);\r\n            data->searchTerm = win::GetText(GetDlgItem(hDlg, IDC_FIND_EDIT));\r\n            data->matchCase = BST_CHECKED == IsDlgButtonChecked(hDlg, IDC_MATCH_CASE);\r\n            EndDialog(hDlg, IDOK);\r\n            return TRUE;\r\n\r\n        case IDCANCEL:\r\n            EndDialog(hDlg, IDCANCEL);\r\n            return TRUE;\r\n        }\r\n        break;\r\n    }\r\n    return FALSE;\r\n}\r\n\r\n/* Shows a 'Find' dialog and returns the new search term entered by the user\r\n   or nullptr if the search was canceled. previousSearch is the search term to\r\n   be displayed as default. */\r\nWCHAR *Dialog_Find(HWND hwnd, const WCHAR *previousSearch, bool *matchCase)\r\n{\r\n    Dialog_Find_Data data;\r\n    data.searchTerm = (WCHAR *)previousSearch;\r\n    data.matchCase = matchCase ? *matchCase : false;\r\n\r\n    INT_PTR res = CreateDialogBox(IDD_DIALOG_FIND, hwnd,\r\n                                  Dialog_Find_Proc, (LPARAM)&data);\r\n    if (res != IDOK)\r\n        return nullptr;\r\n\r\n    if (matchCase)\r\n        *matchCase = data.matchCase;\r\n    return data.searchTerm;\r\n}\r\n\r\n/* For passing data to/from AssociateWithPdf dialog */\r\nstruct Dialog_PdfAssociate_Data {\r\n    bool dontAskAgain;\r\n};\r\n\r\nstatic INT_PTR CALLBACK Dialog_PdfAssociate_Proc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    Dialog_PdfAssociate_Data *  data;\r\n\r\n//[ ACCESSKEY_GROUP Associate Dialog\r\n    if (WM_INITDIALOG == msg)\r\n    {\r\n        data = (Dialog_PdfAssociate_Data*)lParam;\r\n        assert(data);\r\n        SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)data);\r\n        win::SetText(hDlg, _TR(\"Associate with PDF files?\"));\r\n        SetDlgItemText(hDlg, IDC_STATIC, _TR(\"Make SumatraPDF default application for PDF files?\"));\r\n        SetDlgItemText(hDlg, IDC_DONT_ASK_ME_AGAIN, _TR(\"&Don't ask me again\"));\r\n        CheckDlgButton(hDlg, IDC_DONT_ASK_ME_AGAIN, BST_UNCHECKED);\r\n        SetDlgItemText(hDlg, IDOK, _TR(\"&Yes\"));\r\n        SetDlgItemText(hDlg, IDCANCEL, _TR(\"&No\"));\r\n\r\n        CenterDialog(hDlg);\r\n        SetFocus(GetDlgItem(hDlg, IDOK));\r\n        return FALSE;\r\n    }\r\n//] ACCESSKEY_GROUP Associate Dialog\r\n\r\n    switch (msg)\r\n    {\r\n        case WM_COMMAND:\r\n            data = (Dialog_PdfAssociate_Data*)GetWindowLongPtr(hDlg, GWLP_USERDATA);\r\n            assert(data);\r\n            data->dontAskAgain = (BST_CHECKED == IsDlgButtonChecked(hDlg, IDC_DONT_ASK_ME_AGAIN));\r\n            switch (LOWORD(wParam))\r\n            {\r\n                case IDOK:\r\n                    EndDialog(hDlg, IDYES);\r\n                    return TRUE;\r\n\r\n                case IDCANCEL:\r\n                    EndDialog(hDlg, IDNO);\r\n                    return TRUE;\r\n\r\n                case IDC_DONT_ASK_ME_AGAIN:\r\n                    return TRUE;\r\n            }\r\n            break;\r\n    }\r\n    return FALSE;\r\n}\r\n\r\n/* Show \"associate this application with PDF files\" dialog.\r\n   Returns IDYES if \"Yes\" button was pressed or\r\n   IDNO if \"No\" button was pressed.\r\n   Returns the state of \"don't ask me again\" checkbox\" in <dontAskAgain> */\r\nINT_PTR Dialog_PdfAssociate(HWND hwnd, bool *dontAskAgainOut)\r\n{\r\n    assert(dontAskAgainOut);\r\n\r\n    Dialog_PdfAssociate_Data data;\r\n    INT_PTR res = CreateDialogBox(IDD_DIALOG_PDF_ASSOCIATE, hwnd,\r\n                                  Dialog_PdfAssociate_Proc, (LPARAM)&data);\r\n    if (dontAskAgainOut)\r\n        *dontAskAgainOut = data.dontAskAgain;\r\n    return res;\r\n}\r\n\r\n/* For passing data to/from ChangeLanguage dialog */\r\nstruct Dialog_ChangeLanguage_Data {\r\n    const char *langCode;\r\n};\r\n\r\nstatic INT_PTR CALLBACK Dialog_ChangeLanguage_Proc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    Dialog_ChangeLanguage_Data *  data;\r\n    HWND                          langList;\r\n\r\n    if (WM_INITDIALOG == msg)\r\n    {\r\n        DIALOG_SIZER_START(sz)\r\n            DIALOG_SIZER_ENTRY(IDOK, DS_MoveX | DS_MoveY)\r\n            DIALOG_SIZER_ENTRY(IDCANCEL, DS_MoveX | DS_MoveY)\r\n            DIALOG_SIZER_ENTRY(IDC_CHANGE_LANG_LANG_LIST, DS_SizeY | DS_SizeX)\r\n        DIALOG_SIZER_END()\r\n        DialogSizer_Set(hDlg, sz, TRUE);\r\n\r\n        data = (Dialog_ChangeLanguage_Data*)lParam;\r\n        assert(data);\r\n        SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)data);\r\n        // for non-latin languages this depends on the correct fonts being installed,\r\n        // otherwise all the user will see are squares\r\n        win::SetText(hDlg, _TR(\"Change Language\"));\r\n        langList = GetDlgItem(hDlg, IDC_CHANGE_LANG_LANG_LIST);\r\n        int itemToSelect = 0;\r\n        for (int i = 0; i < trans::GetLangsCount(); i++) {\r\n            const char *name = trans::GetLangNameByIdx(i);\r\n            const char *langCode = trans::GetLangCodeByIdx(i);\r\n            ScopedMem<WCHAR> langName(str::conv::FromUtf8(name));\r\n            ListBox_AppendString_NoSort(langList, langName);\r\n            if (str::Eq(langCode, data->langCode))\r\n                itemToSelect = i;\r\n        }\r\n        ListBox_SetCurSel(langList, itemToSelect);\r\n        // the language list is meant to be laid out left-to-right\r\n        ToggleWindowStyle(langList, WS_EX_LAYOUTRTL, false, GWL_EXSTYLE);\r\n        SetDlgItemText(hDlg, IDOK, _TR(\"OK\"));\r\n        SetDlgItemText(hDlg, IDCANCEL, _TR(\"Cancel\"));\r\n\r\n        CenterDialog(hDlg);\r\n        SetFocus(langList);\r\n        return FALSE;\r\n    }\r\n\r\n    switch (msg)\r\n    {\r\n        case WM_COMMAND:\r\n            data = (Dialog_ChangeLanguage_Data*)GetWindowLongPtr(hDlg, GWLP_USERDATA);\r\n            assert(data);\r\n            if (HIWORD(wParam) == LBN_DBLCLK) {\r\n                assert(IDC_CHANGE_LANG_LANG_LIST == LOWORD(wParam));\r\n                langList = GetDlgItem(hDlg, IDC_CHANGE_LANG_LANG_LIST);\r\n                assert(langList == (HWND)lParam);\r\n                int langIdx = (int)ListBox_GetCurSel(langList);\r\n                data->langCode = trans::GetLangCodeByIdx(langIdx);\r\n                EndDialog(hDlg, IDOK);\r\n                return FALSE;\r\n            }\r\n            switch (LOWORD(wParam))\r\n            {\r\n                case IDOK:\r\n                    {\r\n                    langList = GetDlgItem(hDlg, IDC_CHANGE_LANG_LANG_LIST);\r\n                    int langIdx = ListBox_GetCurSel(langList);\r\n                    data->langCode = trans::GetLangCodeByIdx(langIdx);\r\n                    EndDialog(hDlg, IDOK);\r\n                    }\r\n                    return TRUE;\r\n\r\n                case IDCANCEL:\r\n                    EndDialog(hDlg, IDCANCEL);\r\n                    return TRUE;\r\n            }\r\n            break;\r\n    }\r\n\r\n    return FALSE;\r\n}\r\n\r\n/* Returns nullptr  -1 if user choses 'cancel' */\r\nconst char *Dialog_ChangeLanguge(HWND hwnd, const char *currLangCode)\r\n{\r\n    Dialog_ChangeLanguage_Data data;\r\n    data.langCode = currLangCode;\r\n\r\n    INT_PTR res = CreateDialogBox(IDD_DIALOG_CHANGE_LANGUAGE, hwnd,\r\n                                  Dialog_ChangeLanguage_Proc, (LPARAM)&data);\r\n    if (IDCANCEL == res)\r\n        return nullptr;\r\n    return data.langCode;\r\n}\r\n\r\n/* For passing data to/from 'new version available' dialog */\r\nstruct Dialog_NewVersion_Data {\r\n    const WCHAR *currVersion;\r\n    const WCHAR *newVersion;\r\n    bool skipThisVersion;\r\n};\r\n\r\nstatic INT_PTR CALLBACK Dialog_NewVersion_Proc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    Dialog_NewVersion_Data *  data;\r\n    WCHAR *txt;\r\n\r\n//[ ACCESSKEY_GROUP New Version Dialog\r\n    if (WM_INITDIALOG == msg)\r\n    {\r\n        data = (Dialog_NewVersion_Data*)lParam;\r\n        assert(nullptr != data);\r\n        SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)data);\r\n        win::SetText(hDlg, _TR(\"SumatraPDF Update\"));\r\n\r\n        txt = str::Format(_TR(\"You have version %s\"), data->currVersion);\r\n        SetDlgItemText(hDlg, IDC_YOU_HAVE, txt);\r\n        free(txt);\r\n\r\n        txt = str::Format(_TR(\"New version %s is available. Download new version?\"), data->newVersion);\r\n        SetDlgItemText(hDlg, IDC_NEW_AVAILABLE, txt);\r\n        free(txt);\r\n\r\n        SetDlgItemText(hDlg, IDC_SKIP_THIS_VERSION, _TR(\"&Skip this version\"));\r\n        CheckDlgButton(hDlg, IDC_SKIP_THIS_VERSION, BST_UNCHECKED);\r\n        SetDlgItemText(hDlg, IDOK, _TR(\"Download\"));\r\n        SetDlgItemText(hDlg, IDCANCEL, _TR(\"&No, thanks\"));\r\n\r\n        CenterDialog(hDlg);\r\n        SetFocus(GetDlgItem(hDlg, IDOK));\r\n        return FALSE;\r\n    }\r\n//] ACCESSKEY_GROUP New Version Dialog\r\n\r\n    switch (msg)\r\n    {\r\n        case WM_COMMAND:\r\n            data = (Dialog_NewVersion_Data*)GetWindowLongPtr(hDlg, GWLP_USERDATA);\r\n            assert(data);\r\n            data->skipThisVersion = false;\r\n            switch (LOWORD(wParam))\r\n            {\r\n                case IDOK:\r\n                    if (BST_CHECKED == IsDlgButtonChecked(hDlg, IDC_SKIP_THIS_VERSION))\r\n                        data->skipThisVersion = true;\r\n                    EndDialog(hDlg, IDYES);\r\n                    return TRUE;\r\n\r\n                case IDCANCEL:\r\n                    if (BST_CHECKED == IsDlgButtonChecked(hDlg, IDC_SKIP_THIS_VERSION))\r\n                        data->skipThisVersion = true;\r\n                    EndDialog(hDlg, IDNO);\r\n                    return TRUE;\r\n\r\n                case IDC_SKIP_THIS_VERSION:\r\n                    return TRUE;\r\n            }\r\n            break;\r\n    }\r\n    return FALSE;\r\n}\r\n\r\nINT_PTR Dialog_NewVersionAvailable(HWND hwnd, const WCHAR *currentVersion, const WCHAR *newVersion, bool *skipThisVersion)\r\n{\r\n    Dialog_NewVersion_Data data;\r\n    data.currVersion = currentVersion;\r\n    data.newVersion = newVersion;\r\n    data.skipThisVersion = false;\r\n\r\n    INT_PTR res = CreateDialogBox(IDD_DIALOG_NEW_VERSION, hwnd,\r\n                                  Dialog_NewVersion_Proc, (LPARAM)&data);\r\n    if (skipThisVersion)\r\n        *skipThisVersion = data.skipThisVersion;\r\n\r\n    return res;\r\n}\r\n\r\nstatic float gItemZoom[] = { ZOOM_FIT_PAGE, ZOOM_FIT_WIDTH, ZOOM_FIT_CONTENT, 0,\r\n    6400.0, 3200.0, 1600.0, 800.0, 400.0, 200.0, 150.0, 125.0, 100.0, 50.0, 25.0, 12.5, 8.33f };\r\n\r\nstatic void SetupZoomComboBox(HWND hDlg, UINT idComboBox, bool forChm, float currZoom)\r\n{\r\n    if (!forChm) {\r\n        SendDlgItemMessage(hDlg, idComboBox, CB_ADDSTRING, 0, (LPARAM)_TR(\"Fit Page\"));\r\n        SendDlgItemMessage(hDlg, idComboBox, CB_ADDSTRING, 0, (LPARAM)_TR(\"Fit Width\"));\r\n        SendDlgItemMessage(hDlg, idComboBox, CB_ADDSTRING, 0, (LPARAM)_TR(\"Fit Content\"));\r\n        SendDlgItemMessage(hDlg, idComboBox, CB_ADDSTRING, 0, (LPARAM)L\"-\");\r\n        SendDlgItemMessage(hDlg, idComboBox, CB_ADDSTRING, 0, (LPARAM)L\"6400%\");\r\n        SendDlgItemMessage(hDlg, idComboBox, CB_ADDSTRING, 0, (LPARAM)L\"3200%\");\r\n        SendDlgItemMessage(hDlg, idComboBox, CB_ADDSTRING, 0, (LPARAM)L\"1600%\");\r\n    }\r\n    SendDlgItemMessage(hDlg, idComboBox, CB_ADDSTRING, 0, (LPARAM)L\"800%\");\r\n    SendDlgItemMessage(hDlg, idComboBox, CB_ADDSTRING, 0, (LPARAM)L\"400%\");\r\n    SendDlgItemMessage(hDlg, idComboBox, CB_ADDSTRING, 0, (LPARAM)L\"200%\");\r\n    SendDlgItemMessage(hDlg, idComboBox, CB_ADDSTRING, 0, (LPARAM)L\"150%\");\r\n    SendDlgItemMessage(hDlg, idComboBox, CB_ADDSTRING, 0, (LPARAM)L\"125%\");\r\n    SendDlgItemMessage(hDlg, idComboBox, CB_ADDSTRING, 0, (LPARAM)L\"100%\");\r\n    SendDlgItemMessage(hDlg, idComboBox, CB_ADDSTRING, 0, (LPARAM)L\"50%\");\r\n    SendDlgItemMessage(hDlg, idComboBox, CB_ADDSTRING, 0, (LPARAM)L\"25%\");\r\n    if (!forChm) {\r\n        SendDlgItemMessage(hDlg, idComboBox, CB_ADDSTRING, 0, (LPARAM)L\"12.5%\");\r\n        SendDlgItemMessage(hDlg, idComboBox, CB_ADDSTRING, 0, (LPARAM)L\"8.33%\");\r\n    }\r\n    int first = forChm ? 7 : 0;\r\n    int last = forChm ? dimof(gItemZoom) - 2 : dimof(gItemZoom);\r\n    for (int i = first; i < last; i++) {\r\n        if (gItemZoom[i] == currZoom)\r\n            SendDlgItemMessage(hDlg, idComboBox, CB_SETCURSEL, i - first, 0);\r\n    }\r\n\r\n    if (SendDlgItemMessage(hDlg, idComboBox, CB_GETCURSEL, 0, 0) == -1) {\r\n        WCHAR *customZoom = str::Format(L\"%.0f%%\", currZoom);\r\n        SetDlgItemText(hDlg, idComboBox, customZoom);\r\n        free(customZoom);\r\n    }\r\n}\r\n\r\nstatic float GetZoomComboBoxValue(HWND hDlg, UINT idComboBox, bool forChm, float defaultZoom)\r\n{\r\n    float newZoom = defaultZoom;\r\n\r\n    int idx = ComboBox_GetCurSel(GetDlgItem(hDlg, idComboBox));\r\n    if (idx == -1) {\r\n        ScopedMem<WCHAR> customZoom(win::GetText(GetDlgItem(hDlg, idComboBox)));\r\n        float zoom = (float)_wtof(customZoom);\r\n        if (zoom > 0)\r\n            newZoom = limitValue(zoom, ZOOM_MIN, ZOOM_MAX);\r\n    } else {\r\n        if (forChm)\r\n            idx += 7;\r\n\r\n        if (0 != gItemZoom[idx])\r\n            newZoom = gItemZoom[idx];\r\n    }\r\n\r\n    return newZoom;\r\n}\r\n\r\nstruct Dialog_CustomZoom_Data {\r\n    float zoomArg;\r\n    float zoomResult;\r\n    bool  forChm;\r\n};\r\n\r\nstatic INT_PTR CALLBACK Dialog_CustomZoom_Proc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    Dialog_CustomZoom_Data *data;\r\n\r\n    switch (msg)\r\n    {\r\n    case WM_INITDIALOG:\r\n//[ ACCESSKEY_GROUP Zoom Dialog\r\n        data = (Dialog_CustomZoom_Data *)lParam;\r\n        assert(data);\r\n        SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)data);\r\n\r\n        SetupZoomComboBox(hDlg, IDC_DEFAULT_ZOOM, data->forChm, data->zoomArg);\r\n\r\n        win::SetText(hDlg, _TR(\"Zoom factor\"));\r\n        SetDlgItemText(hDlg, IDC_STATIC, _TR(\"&Magnification:\"));\r\n        SetDlgItemText(hDlg, IDOK, _TR(\"Zoom\"));\r\n        SetDlgItemText(hDlg, IDCANCEL, _TR(\"Cancel\"));\r\n\r\n        CenterDialog(hDlg);\r\n        SetFocus(GetDlgItem(hDlg, IDC_DEFAULT_ZOOM));\r\n        return FALSE;\r\n//] ACCESSKEY_GROUP Zoom Dialog\r\n\r\n    case WM_COMMAND:\r\n        switch (LOWORD(wParam))\r\n        {\r\n        case IDOK:\r\n            data = (Dialog_CustomZoom_Data *)GetWindowLongPtr(hDlg, GWLP_USERDATA);\r\n            assert(data);\r\n            data->zoomResult = GetZoomComboBoxValue(hDlg, IDC_DEFAULT_ZOOM, data->forChm, data->zoomArg);\r\n            EndDialog(hDlg, IDOK);\r\n            return TRUE;\r\n\r\n        case IDCANCEL:\r\n            EndDialog(hDlg, IDCANCEL);\r\n            return TRUE;\r\n        }\r\n        break;\r\n    }\r\n    return FALSE;\r\n}\r\n\r\nbool Dialog_CustomZoom(HWND hwnd, bool forChm, float *currZoomInOut)\r\n{\r\n    Dialog_CustomZoom_Data data;\r\n    data.forChm = forChm;\r\n    data.zoomArg = *currZoomInOut;\r\n    INT_PTR res = CreateDialogBox(IDD_DIALOG_CUSTOM_ZOOM, hwnd,\r\n                           Dialog_CustomZoom_Proc, (LPARAM)&data);\r\n    if (res == IDCANCEL)\r\n        return false;\r\n\r\n    *currZoomInOut = data.zoomResult;\r\n    return true;\r\n}\r\n\r\nstatic void RemoveDialogItem(HWND hDlg, int itemId, int prevId=0)\r\n{\r\n    HWND hItem = GetDlgItem(hDlg, itemId);\r\n    RectI itemRc = MapRectToWindow(WindowRect(hItem), HWND_DESKTOP, hDlg);\r\n    // shrink by the distance to the previous item\r\n    HWND hPrev = prevId ? GetDlgItem(hDlg, prevId) : GetWindow(hItem, GW_HWNDPREV);\r\n    RectI prevRc = MapRectToWindow(WindowRect(hPrev), HWND_DESKTOP, hDlg);\r\n    int shrink = itemRc.y - prevRc.y + itemRc.dy - prevRc.dy;\r\n    // move items below up, shrink container items and hide contained items\r\n    for (HWND item = GetWindow(hDlg, GW_CHILD); item; item = GetWindow(item, GW_HWNDNEXT)) {\r\n        RectI rc = MapRectToWindow(WindowRect(item), HWND_DESKTOP, hDlg);\r\n        if (rc.y >= itemRc.y + itemRc.dy) // below\r\n            MoveWindow(item, rc.x, rc.y - shrink, rc.dx, rc.dy, TRUE);\r\n        else if (rc.Intersect(itemRc) == rc) // contained (or self)\r\n            ShowWindow(item, SW_HIDE);\r\n        else if (itemRc.Intersect(rc) == itemRc) // container\r\n            MoveWindow(item, rc.x, rc.y, rc.dx, rc.dy - shrink, TRUE);\r\n    }\r\n    // shrink the dialog\r\n    WindowRect dlgRc(hDlg);\r\n    MoveWindow(hDlg, dlgRc.x, dlgRc.y, dlgRc.dx, dlgRc.dy - shrink, TRUE);\r\n}\r\n\r\nstatic INT_PTR CALLBACK Dialog_Settings_Proc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    GlobalPrefs *prefs;\r\n\r\n    switch (msg)\r\n    {\r\n//[ ACCESSKEY_GROUP Settings Dialog\r\n    case WM_INITDIALOG:\r\n        prefs = (GlobalPrefs *)lParam;\r\n        assert(prefs);\r\n        SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)prefs);\r\n\r\n        // Fill the page layouts into the select box\r\n        SendDlgItemMessage(hDlg, IDC_DEFAULT_LAYOUT, CB_ADDSTRING, 0, (LPARAM)_TR(\"Automatic\"));\r\n        SendDlgItemMessage(hDlg, IDC_DEFAULT_LAYOUT, CB_ADDSTRING, 0, (LPARAM)_TR(\"Single Page\"));\r\n        SendDlgItemMessage(hDlg, IDC_DEFAULT_LAYOUT, CB_ADDSTRING, 0, (LPARAM)_TR(\"Facing\"));\r\n        SendDlgItemMessage(hDlg, IDC_DEFAULT_LAYOUT, CB_ADDSTRING, 0, (LPARAM)_TR(\"Book View\"));\r\n        SendDlgItemMessage(hDlg, IDC_DEFAULT_LAYOUT, CB_ADDSTRING, 0, (LPARAM)_TR(\"Continuous\"));\r\n        SendDlgItemMessage(hDlg, IDC_DEFAULT_LAYOUT, CB_ADDSTRING, 0, (LPARAM)_TR(\"Continuous Facing\"));\r\n        SendDlgItemMessage(hDlg, IDC_DEFAULT_LAYOUT, CB_ADDSTRING, 0, (LPARAM)_TR(\"Continuous Book View\"));\r\n        SendDlgItemMessage(hDlg, IDC_DEFAULT_LAYOUT, CB_SETCURSEL, prefs->defaultDisplayModeEnum - DM_AUTOMATIC, 0);\r\n\r\n        SetupZoomComboBox(hDlg, IDC_DEFAULT_ZOOM, false, prefs->defaultZoomFloat);\r\n\r\n        CheckDlgButton(hDlg, IDC_DEFAULT_SHOW_TOC, prefs->showToc ? BST_CHECKED : BST_UNCHECKED);\r\n        CheckDlgButton(hDlg, IDC_REMEMBER_STATE_PER_DOCUMENT, prefs->rememberStatePerDocument ? BST_CHECKED : BST_UNCHECKED);\r\n        EnableWindow(GetDlgItem(hDlg, IDC_REMEMBER_STATE_PER_DOCUMENT), prefs->rememberOpenedFiles);\r\n        CheckDlgButton(hDlg, IDC_USE_TABS, prefs->useTabs? BST_CHECKED : BST_UNCHECKED);\r\n        CheckDlgButton(hDlg, IDC_CHECK_FOR_UPDATES, prefs->checkForUpdates ? BST_CHECKED : BST_UNCHECKED);\r\n        EnableWindow(GetDlgItem(hDlg, IDC_CHECK_FOR_UPDATES), HasPermission(Perm_InternetAccess));\r\n        CheckDlgButton(hDlg, IDC_REMEMBER_OPENED_FILES, prefs->rememberOpenedFiles ? BST_CHECKED : BST_UNCHECKED);\r\n        if (IsExeAssociatedWithPdfExtension()) {\r\n            SetDlgItemText(hDlg, IDC_SET_DEFAULT_READER, _TR(\"SumatraPDF is your default PDF reader\"));\r\n            EnableWindow(GetDlgItem(hDlg, IDC_SET_DEFAULT_READER), FALSE);\r\n        } else if (IsRunningInPortableMode()) {\r\n            SetDlgItemText(hDlg, IDC_SET_DEFAULT_READER, _TR(\"Default PDF reader can't be changed in portable mode\"));\r\n            EnableWindow(GetDlgItem(hDlg, IDC_SET_DEFAULT_READER), FALSE);\r\n        } else {\r\n            SetDlgItemText(hDlg, IDC_SET_DEFAULT_READER, _TR(\"Make SumatraPDF my default PDF reader\"));\r\n            EnableWindow(GetDlgItem(hDlg, IDC_SET_DEFAULT_READER), HasPermission(Perm_RegistryAccess));\r\n        }\r\n\r\n        win::SetText(hDlg, _TR(\"SumatraPDF Options\"));\r\n        SetDlgItemText(hDlg, IDC_SECTION_VIEW, _TR(\"View\"));\r\n        SetDlgItemText(hDlg, IDC_DEFAULT_LAYOUT_LABEL, _TR(\"Default &Layout:\"));\r\n        SetDlgItemText(hDlg, IDC_DEFAULT_ZOOM_LABEL, _TR(\"Default &Zoom:\"));\r\n        SetDlgItemText(hDlg, IDC_DEFAULT_SHOW_TOC, _TR(\"Show the &bookmarks sidebar when available\"));\r\n        SetDlgItemText(hDlg, IDC_REMEMBER_STATE_PER_DOCUMENT, _TR(\"&Remember these settings for each document\"));\r\n        SetDlgItemText(hDlg, IDC_SECTION_ADVANCED, _TR(\"Advanced\"));\r\n        SetDlgItemText(hDlg, IDC_USE_TABS, _TR(\"Use &tabs\"));\r\n        SetDlgItemText(hDlg, IDC_CHECK_FOR_UPDATES, _TR(\"Automatically check for &updates\"));\r\n        SetDlgItemText(hDlg, IDC_REMEMBER_OPENED_FILES, _TR(\"Remember &opened files\"));\r\n        SetDlgItemText(hDlg, IDC_SECTION_INVERSESEARCH, _TR(\"Set inverse search command-line\"));\r\n        SetDlgItemText(hDlg, IDC_CMDLINE_LABEL, _TR(\"Enter the command-line to invoke when you double-click on the PDF document:\"));\r\n        SetDlgItemText(hDlg, IDOK, _TR(\"OK\"));\r\n        SetDlgItemText(hDlg, IDCANCEL, _TR(\"Cancel\"));\r\n\r\n        if (prefs->enableTeXEnhancements && HasPermission(Perm_DiskAccess)) {\r\n            // Fill the combo with the list of possible inverse search commands\r\n            // Try to select a correct default when first showing this dialog\r\n            const WCHAR *cmdLine = prefs->inverseSearchCmdLine;\r\n            ScopedMem<WCHAR> inverseSearch;\r\n            if (!cmdLine) {\r\n                inverseSearch.Set(AutoDetectInverseSearchCommands(GetDlgItem(hDlg, IDC_CMDLINE)));\r\n                cmdLine = inverseSearch;\r\n            }\r\n            // Find the index of the active command line\r\n            LRESULT ind = SendMessage(GetDlgItem(hDlg, IDC_CMDLINE), CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM) cmdLine);\r\n            if (CB_ERR == ind) {\r\n                // if no existing command was selected then set the user custom command in the combo\r\n                ComboBox_AddItemData(GetDlgItem(hDlg, IDC_CMDLINE), cmdLine);\r\n                SetDlgItemText(hDlg, IDC_CMDLINE, cmdLine);\r\n            }\r\n            else {\r\n                // select the active command\r\n                SendMessage(GetDlgItem(hDlg, IDC_CMDLINE), CB_SETCURSEL, (WPARAM) ind , 0);\r\n            }\r\n        }\r\n        else {\r\n            RemoveDialogItem(hDlg, IDC_SECTION_INVERSESEARCH, IDC_SECTION_ADVANCED);\r\n        }\r\n\r\n        CenterDialog(hDlg);\r\n        SetFocus(GetDlgItem(hDlg, IDC_DEFAULT_LAYOUT));\r\n        return FALSE;\r\n//] ACCESSKEY_GROUP Settings Dialog\r\n\r\n    case WM_COMMAND:\r\n        switch (LOWORD(wParam))\r\n        {\r\n        case IDOK:\r\n            prefs = (GlobalPrefs *)GetWindowLongPtr(hDlg, GWLP_USERDATA);\r\n            assert(prefs);\r\n            prefs->defaultDisplayModeEnum = (DisplayMode)(SendDlgItemMessage(hDlg, IDC_DEFAULT_LAYOUT, CB_GETCURSEL, 0, 0) + DM_AUTOMATIC);\r\n            prefs->defaultZoomFloat = GetZoomComboBoxValue(hDlg, IDC_DEFAULT_ZOOM, false, prefs->defaultZoomFloat);\r\n\r\n            prefs->showToc = (BST_CHECKED == IsDlgButtonChecked(hDlg, IDC_DEFAULT_SHOW_TOC));\r\n            prefs->rememberStatePerDocument = (BST_CHECKED == IsDlgButtonChecked(hDlg, IDC_REMEMBER_STATE_PER_DOCUMENT));\r\n            prefs->useTabs = (BST_CHECKED == IsDlgButtonChecked(hDlg, IDC_USE_TABS));\r\n            prefs->checkForUpdates = (BST_CHECKED == IsDlgButtonChecked(hDlg, IDC_CHECK_FOR_UPDATES));\r\n            prefs->rememberOpenedFiles = (BST_CHECKED == IsDlgButtonChecked(hDlg, IDC_REMEMBER_OPENED_FILES));\r\n            if (prefs->enableTeXEnhancements && HasPermission(Perm_DiskAccess)) {\r\n                free(prefs->inverseSearchCmdLine);\r\n                prefs->inverseSearchCmdLine = win::GetText(GetDlgItem(hDlg, IDC_CMDLINE));\r\n            }\r\n            EndDialog(hDlg, IDOK);\r\n            return TRUE;\r\n\r\n        case IDCANCEL:\r\n            EndDialog(hDlg, IDCANCEL);\r\n            return TRUE;\r\n\r\n        case IDC_REMEMBER_OPENED_FILES:\r\n            {\r\n                bool rememberOpenedFiles = (BST_CHECKED == IsDlgButtonChecked(hDlg, IDC_REMEMBER_OPENED_FILES));\r\n                EnableWindow(GetDlgItem(hDlg, IDC_REMEMBER_STATE_PER_DOCUMENT), rememberOpenedFiles);\r\n            }\r\n            return TRUE;\r\n\r\n        case IDC_DEFAULT_SHOW_TOC:\r\n        case IDC_REMEMBER_STATE_PER_DOCUMENT:\r\n        case IDC_CHECK_FOR_UPDATES:\r\n            return TRUE;\r\n\r\n        case IDC_SET_DEFAULT_READER:\r\n            if (!HasPermission(Perm_RegistryAccess))\r\n                return TRUE;\r\n            AssociateExeWithPdfExtension();\r\n            if (IsExeAssociatedWithPdfExtension()) {\r\n                SetDlgItemText(hDlg, IDC_SET_DEFAULT_READER, _TR(\"SumatraPDF is your default PDF reader\"));\r\n                EnableWindow(GetDlgItem(hDlg, IDC_SET_DEFAULT_READER), FALSE);\r\n                SendMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hDlg, IDOK), TRUE);\r\n            }\r\n            else {\r\n                SetDlgItemText(hDlg, IDC_SET_DEFAULT_READER, _TR(\"SumatraPDF should now be your default PDF reader\"));\r\n            }\r\n            return TRUE;\r\n        }\r\n        break;\r\n    }\r\n    return FALSE;\r\n}\r\n\r\nINT_PTR Dialog_Settings(HWND hwnd, GlobalPrefs *prefs)\r\n{\r\n    return CreateDialogBox(IDD_DIALOG_SETTINGS, hwnd,\r\n                           Dialog_Settings_Proc, (LPARAM)prefs);\r\n}\r\n\r\n#ifndef ID_APPLY_NOW\r\n#define ID_APPLY_NOW 0x3021\r\n#endif\r\n\r\nstatic INT_PTR CALLBACK Sheet_Print_Advanced_Proc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    Print_Advanced_Data *data;\r\n\r\n    switch (msg)\r\n    {\r\n//[ ACCESSKEY_GROUP Advanced Print Tab\r\n    case WM_INITDIALOG:\r\n        data = (Print_Advanced_Data *)((PROPSHEETPAGE *)lParam)->lParam;\r\n        assert(data);\r\n        SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)data);\r\n\r\n        SetDlgItemText(hDlg, IDC_SECTION_PRINT_RANGE, _TR(\"Print range\"));\r\n        SetDlgItemText(hDlg, IDC_PRINT_RANGE_ALL, _TR(\"&All selected pages\"));\r\n        SetDlgItemText(hDlg, IDC_PRINT_RANGE_EVEN, _TR(\"&Even pages only\"));\r\n        SetDlgItemText(hDlg, IDC_PRINT_RANGE_ODD, _TR(\"&Odd pages only\"));\r\n        SetDlgItemText(hDlg, IDC_SECTION_PRINT_SCALE, _TR(\"Page scaling\"));\r\n        SetDlgItemText(hDlg, IDC_PRINT_SCALE_SHRINK, _TR(\"&Shrink pages to printable area (if necessary)\"));\r\n        SetDlgItemText(hDlg, IDC_PRINT_SCALE_FIT, _TR(\"&Fit pages to printable area\"));\r\n        SetDlgItemText(hDlg, IDC_PRINT_SCALE_NONE, _TR(\"&Use original page sizes\"));\r\n        SetDlgItemText(hDlg, IDC_SECTION_PRINT_COMPATIBILITY, _TR(\"Compatibility\"));\r\n\r\n        CheckRadioButton(hDlg, IDC_PRINT_RANGE_ALL, IDC_PRINT_RANGE_ODD,\r\n            data->range == PrintRangeEven ? IDC_PRINT_RANGE_EVEN :\r\n            data->range == PrintRangeOdd ? IDC_PRINT_RANGE_ODD : IDC_PRINT_RANGE_ALL);\r\n        CheckRadioButton(hDlg, IDC_PRINT_SCALE_SHRINK, IDC_PRINT_SCALE_NONE,\r\n            data->scale == PrintScaleFit ? IDC_PRINT_SCALE_FIT :\r\n            data->scale == PrintScaleShrink ? IDC_PRINT_SCALE_SHRINK : IDC_PRINT_SCALE_NONE);\r\n\r\n        return FALSE;\r\n//] ACCESSKEY_GROUP Advanced Print Tab\r\n\r\n    case WM_NOTIFY:\r\n        if (((LPNMHDR)lParam)->code == PSN_APPLY) {\r\n            data = (Print_Advanced_Data *)GetWindowLongPtr(hDlg, GWLP_USERDATA);\r\n            assert(data);\r\n            if (IsDlgButtonChecked(hDlg, IDC_PRINT_RANGE_EVEN))\r\n                data->range = PrintRangeEven;\r\n            else if (IsDlgButtonChecked(hDlg, IDC_PRINT_RANGE_ODD))\r\n                data->range = PrintRangeOdd;\r\n            else\r\n                data->range = PrintRangeAll;\r\n            if (IsDlgButtonChecked(hDlg, IDC_PRINT_SCALE_FIT))\r\n                data->scale = PrintScaleFit;\r\n            else if (IsDlgButtonChecked(hDlg, IDC_PRINT_SCALE_SHRINK))\r\n                data->scale = PrintScaleShrink;\r\n            else\r\n                data->scale = PrintScaleNone;\r\n            return TRUE;\r\n        }\r\n        break;\r\n\r\n    case WM_COMMAND:\r\n        switch (LOWORD(wParam)) {\r\n        case IDC_PRINT_RANGE_ALL: case IDC_PRINT_RANGE_EVEN:\r\n        case IDC_PRINT_RANGE_ODD: case IDC_PRINT_SCALE_SHRINK:\r\n        case IDC_PRINT_SCALE_FIT: case IDC_PRINT_SCALE_NONE:\r\n            {\r\n                HWND hApplyButton = GetDlgItem(GetParent(hDlg), ID_APPLY_NOW);\r\n                EnableWindow(hApplyButton, TRUE);\r\n            }\r\n            break;\r\n        }\r\n    }\r\n    return FALSE;\r\n}\r\n\r\nHPROPSHEETPAGE CreatePrintAdvancedPropSheet(Print_Advanced_Data *data, ScopedMem<DLGTEMPLATE>& dlgTemplate)\r\n{\r\n    PROPSHEETPAGE psp;\r\n    ZeroMemory(&psp, sizeof(PROPSHEETPAGE));\r\n\r\n    psp.dwSize = sizeof(PROPSHEETPAGE);\r\n    psp.dwFlags = PSP_USETITLE | PSP_PREMATURE;\r\n    psp.pszTemplate = MAKEINTRESOURCE(IDD_PROPSHEET_PRINT_ADVANCED);\r\n    psp.pfnDlgProc = Sheet_Print_Advanced_Proc;\r\n    psp.lParam = (LPARAM)data;\r\n    psp.pszTitle = _TR(\"Advanced\");\r\n\r\n    if (IsUIRightToLeft()) {\r\n        dlgTemplate.Set(GetRtLDlgTemplate(IDD_PROPSHEET_PRINT_ADVANCED));\r\n        psp.pResource = dlgTemplate.Get();\r\n        psp.dwFlags |= PSP_DLGINDIRECT;\r\n    }\r\n\r\n    return CreatePropertySheetPage(&psp);\r\n}\r\n\r\nstruct Dialog_AddFav_Data {\r\n    const WCHAR *pageNo;\r\n    WCHAR *favName;\r\n};\r\n\r\nstatic INT_PTR CALLBACK Dialog_AddFav_Proc(HWND hDlg, UINT msg, WPARAM wParam,\r\n    LPARAM lParam)\r\n{\r\n    if (WM_INITDIALOG == msg) {\r\n        Dialog_AddFav_Data *data = (Dialog_AddFav_Data *)lParam;\r\n        assert(data);\r\n        SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)data);\r\n        win::SetText(hDlg, _TR(\"Add Favorite\"));\r\n        ScopedMem<WCHAR> s(str::Format(_TR(\"Add page %s to favorites with (optional) name:\"), data->pageNo));\r\n        SetDlgItemText(hDlg, IDC_ADD_PAGE_STATIC, s);\r\n        SetDlgItemText(hDlg, IDOK, _TR(\"OK\"));\r\n        SetDlgItemText(hDlg, IDCANCEL, _TR(\"Cancel\"));\r\n        if (data->favName) {\r\n            SetDlgItemText(hDlg, IDC_FAV_NAME_EDIT, data->favName);\r\n            Edit_SelectAll(GetDlgItem(hDlg, IDC_FAV_NAME_EDIT));\r\n        }\r\n        CenterDialog(hDlg);\r\n        SetFocus(GetDlgItem(hDlg, IDC_FAV_NAME_EDIT));\r\n        return FALSE;\r\n    }\r\n\r\n    if (WM_COMMAND == msg) {\r\n        Dialog_AddFav_Data *data = (Dialog_AddFav_Data *)GetWindowLongPtr(hDlg, GWLP_USERDATA);\r\n        assert(data);\r\n        WORD cmd = LOWORD(wParam);\r\n        if (IDOK == cmd) {\r\n            ScopedMem<WCHAR> name(win::GetText(GetDlgItem(hDlg, IDC_FAV_NAME_EDIT)));\r\n            str::TrimWS(name);\r\n            if (!str::IsEmpty(name.Get()))\r\n                data->favName = name.StealData();\r\n            else\r\n                data->favName = nullptr;\r\n            EndDialog(hDlg, IDOK);\r\n            return TRUE;\r\n        } else if (IDCANCEL == cmd) {\r\n            EndDialog(hDlg, IDCANCEL);\r\n            return TRUE;\r\n        }\r\n    }\r\n\r\n    return FALSE;\r\n}\r\n\r\n// pageNo is the page we're adding to favorites\r\n// returns true if the user wants to add a favorite.\r\n// favName is the name the user wants the favorite to have\r\n// (passing in a non-nullptr favName will use it as default name)\r\nbool Dialog_AddFavorite(HWND hwnd, const WCHAR *pageNo, ScopedMem<WCHAR>& favName)\r\n{\r\n    Dialog_AddFav_Data data;\r\n    data.pageNo = pageNo;\r\n    data.favName = favName;\r\n\r\n    INT_PTR res = CreateDialogBox(IDD_DIALOG_FAV_ADD, hwnd,\r\n                                  Dialog_AddFav_Proc, (LPARAM)&data);\r\n    if (IDCANCEL == res) {\r\n        assert(data.favName == favName);\r\n        return false;\r\n    }\r\n\r\n    assert(data.favName != favName || !data.favName);\r\n    favName.Set(data.favName);\r\n    return true;\r\n}\r\n"
  },
  {
    "path": "src/SumatraDialogs.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: GPLv3 */\n\nstruct GlobalPrefs;\n\nWCHAR *   Dialog_GoToPage(HWND hwnd, const WCHAR *currentPageLabel, int pageCount, bool onlyNumeric=true);\nWCHAR *   Dialog_Find(HWND hwnd, const WCHAR *previousSearch, bool *matchCase);\nWCHAR *   Dialog_GetPassword(HWND hwnd, const WCHAR *fileName, bool *rememberPassword);\nINT_PTR   Dialog_PdfAssociate(HWND hwnd, bool *dontAskAgainOut);\nconst char * Dialog_ChangeLanguge(HWND hwnd, const char *currLangCode);\nINT_PTR   Dialog_NewVersionAvailable(HWND hwnd, const WCHAR *currentVersion, const WCHAR *newVersion, bool *skipThisVersion);\nbool      Dialog_CustomZoom(HWND hwnd, bool forChm, float *currZoomInOut);\nINT_PTR   Dialog_Settings(HWND hwnd, GlobalPrefs *prefs);\nbool      Dialog_AddFavorite(HWND hwnd, const WCHAR *pageNo, ScopedMem<WCHAR>& favName);\n\nenum PrintRangeAdv { PrintRangeAll = 0, PrintRangeEven, PrintRangeOdd };\nenum PrintScaleAdv { PrintScaleNone = 0, PrintScaleShrink, PrintScaleFit };\n\nstruct Print_Advanced_Data {\n    PrintRangeAdv range;\n    PrintScaleAdv scale;\n\n    explicit Print_Advanced_Data(PrintRangeAdv range=PrintRangeAll,\n                        PrintScaleAdv scale=PrintScaleShrink) :\n        range(range), scale(scale) { }\n};\n\nHPROPSHEETPAGE CreatePrintAdvancedPropSheet(Print_Advanced_Data *data, ScopedMem<DLGTEMPLATE>& dlgTemplate);\n"
  },
  {
    "path": "src/SumatraPDF.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include <wininet.h>\r\n#include \"WinDynCalls.h\"\r\n#include \"CryptoUtil.h\"\r\n#include \"DirIter.h\"\r\n#include \"Dpi.h\"\r\n#include \"FileUtil.h\"\r\n#include \"FileWatcher.h\"\r\n#include \"FrameRateWnd.h\"\r\n#include \"GdiPlusUtil.h\"\r\n#include \"LabelWithCloseWnd.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"HttpUtil.h\"\r\n#include \"Mui.h\"\r\n#include \"SplitterWnd.h\"\r\n#include \"SquareTreeParser.h\"\r\n#include \"ThreadUtil.h\"\r\n#include \"UITask.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"PsEngine.h\"\r\n#include \"EngineManager.h\"\r\n#include \"Doc.h\"\r\n#include \"FileModifications.h\"\r\n#include \"PdfCreator.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"ChmModel.h\"\r\n#include \"DisplayModel.h\"\r\n#include \"EbookController.h\"\r\n#include \"FileHistory.h\"\r\n#include \"GlobalPrefs.h\"\r\n#include \"PdfSync.h\"\r\n#include \"RenderCache.h\"\r\n#include \"TextSelection.h\"\r\n#include \"TextSearch.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"WindowInfo.h\"\r\n#include \"TabInfo.h\"\r\n#include \"resource.h\"\r\n#include \"ParseCommandLine.h\"\r\n#include \"AppPrefs.h\"\r\n#include \"AppTools.h\"\r\n#include \"AppUtil.h\"\r\n#include \"Canvas.h\"\r\n#include \"Caption.h\"\r\n#include \"CrashHandler.h\"\r\n#include \"ExternalViewers.h\"\r\n#include \"Favorites.h\"\r\n#include \"FileThumbnails.h\"\r\n#include \"Menu.h\"\r\n#include \"Notifications.h\"\r\n#include \"Print.h\"\r\n#include \"Search.h\"\r\n#include \"Selection.h\"\r\n#include \"StressTesting.h\"\r\n#ifdef ENABLE_ALTERNATIVE_ABOUT_DIALOG\r\n#include \"SumatraAbout2.h\"\r\n#else\r\n#include \"SumatraAbout.h\"\r\n#endif\r\n#include \"SumatraDialogs.h\"\r\n#include \"SumatraProperties.h\"\r\n#include \"TableOfContents.h\"\r\n#include \"Tabs.h\"\r\n#include \"Toolbar.h\"\r\n#include \"Translations.h\"\r\n#include \"uia/Provider.h\"\r\n#include \"Version.h\"\r\n#define NOLOG 0\r\n#include \"DebugLog.h\"\r\n\r\n/* if true, we're in debug mode where we show links as blue rectangle on\r\n   the screen. Makes debugging code related to links easier. */\r\n#ifdef DEBUG\r\nbool             gDebugShowLinks = true;\r\n#else\r\nbool             gDebugShowLinks = false;\r\n#endif\r\n\r\n#ifdef DEBUG\r\nbool             gShowFrameRate = true;\r\n#else\r\nbool             gShowFrameRate = false;\r\n#endif\r\n\r\n// in plugin mode, the window's frame isn't drawn and closing and\r\n// fullscreen are disabled, so that SumatraPDF can be displayed\r\n// embedded (e.g. in a web browser)\r\nconst WCHAR *    gPluginURL = nullptr; // owned by CommandLineInfo in WinMain\r\n\r\n#define SPLITTER_DX         5\r\n#define SIDEBAR_MIN_WIDTH   150\r\n\r\n#define SPLITTER_DY         4\r\n#define TOC_MIN_DY          100\r\n\r\n// minimum size of the window\r\n#define MIN_WIN_DX 480\r\n#define MIN_WIN_DY 320\r\n\r\nVec<WindowInfo*>             gWindows;\r\nFileHistory                  gFileHistory;\r\nFavorites                    gFavorites;\r\n\r\nHBITMAP                      gBitmapReloadingCue;\r\nRenderCache                  gRenderCache;\r\nHCURSOR                      gCursorDrag;\r\n\r\n// set after mouse shortcuts involving the Alt key (so that the menu bar isn't activated)\r\nbool                         gSuppressAltKey = false;\r\n\r\nbool                         gCrashOnOpen = false;\r\n\r\n// in restricted mode, some features can be disabled (such as\r\n// opening files, printing, following URLs), so that SumatraPDF\r\n// can be used as a PDF reader on locked down systems\r\nstatic int                   gPolicyRestrictions = Perm_RestrictedUse;\r\n// only the listed protocols will be passed to the OS for\r\n// opening in e.g. a browser or an email client (ignored,\r\n// if gPolicyRestrictions doesn't contain Perm_DiskAccess)\r\nstatic WStrVec               gAllowedLinkProtocols;\r\n// only files of the listed perceived types will be opened\r\n// externally by LinkHandler::LaunchFile (i.e. when clicking\r\n// on an in-document link); examples: \"audio\", \"video\", ...\r\nstatic WStrVec               gAllowedFileTypes;\r\n\r\nstatic void CloseDocumentInTab(WindowInfo *win, bool keepUIEnabled=false, bool deleteModel=false);\r\nstatic void UpdatePageInfoHelper(WindowInfo *win, NotificationWnd *wnd=nullptr, int pageNo=-1);\r\nstatic bool SidebarSplitterCb(void *ctx, bool done);\r\nstatic bool FavSplitterCb(void *ctx, bool done);\r\n\r\nvoid SetCurrentLang(const char *langCode)\r\n{\r\n    if (langCode) {\r\n        if (langCode != gGlobalPrefs->uiLanguage)\r\n            str::ReplacePtr(&gGlobalPrefs->uiLanguage, langCode);\r\n        trans::SetCurrentLangByCode(langCode);\r\n    }\r\n}\r\n\r\n#ifndef SUMATRA_UPDATE_INFO_URL\r\n#ifdef SVN_PRE_RELEASE_VER\r\n#define SUMATRA_UPDATE_INFO_URL L\"https://kjkpub.s3.amazonaws.com/sumatrapdf/sumpdf-prerelease-update.txt\"\r\n#else\r\n#define SUMATRA_UPDATE_INFO_URL L\"https://kjkpub.s3.amazonaws.com/sumatrapdf/sumpdf-update.txt\"\r\n#endif\r\n#endif\r\n\r\n#ifndef SVN_UPDATE_LINK\r\n#ifdef SVN_PRE_RELEASE_VER\r\n#define SVN_UPDATE_LINK         L\"http://www.sumatrapdfreader.org/prerelease.html\"\r\n#else\r\n#define SVN_UPDATE_LINK         L\"http://www.sumatrapdfreader.org/download-free-pdf-viewer.html\"\r\n#endif\r\n#endif\r\n\r\n#define SECS_IN_DAY 60*60*24\r\n\r\n#define RESTRICTIONS_FILE_NAME       L\"sumatrapdfrestrict.ini\"\r\n\r\n#define DEFAULT_LINK_PROTOCOLS       L\"http,https,mailto\"\r\n#define DEFAULT_FILE_PERCEIVED_TYPES L\"audio,video,webpage\"\r\n\r\nvoid InitializePolicies(bool restrict)\r\n{\r\n    // default configuration should be to restrict everything\r\n    CrashIf(gPolicyRestrictions != Perm_RestrictedUse);\r\n    CrashIf(gAllowedLinkProtocols.Count() != 0 || gAllowedFileTypes.Count() != 0);\r\n\r\n    // the -restrict command line flag overrides any sumatrapdfrestrict.ini configuration\r\n    if (restrict)\r\n        return;\r\n\r\n    // allow to restrict SumatraPDF's functionality from an INI file in the\r\n    // same directory as SumatraPDF.exe (cf. ../docs/sumatrapdfrestrict.ini)\r\n    // (if the file isn't there, everything is allowed)\r\n    ScopedMem<WCHAR> restrictPath(path::GetAppPath(RESTRICTIONS_FILE_NAME));\r\n    if (!file::Exists(restrictPath)) {\r\n        gPolicyRestrictions = Perm_All;\r\n        gAllowedLinkProtocols.Split(DEFAULT_LINK_PROTOCOLS, L\",\");\r\n        gAllowedFileTypes.Split(DEFAULT_FILE_PERCEIVED_TYPES, L\",\");\r\n        return;\r\n    }\r\n\r\n    ScopedMem<char> restrictData(file::ReadAll(restrictPath, nullptr));\r\n    SquareTree sqt(restrictData);\r\n    SquareTreeNode *polsec = sqt.root ? sqt.root->GetChild(\"Policies\") : nullptr;\r\n    // if the restriction file is broken, err on the side of full restriction\r\n    if (!polsec)\r\n        return;\r\n\r\n    static struct {\r\n        const char *name;\r\n        int perm;\r\n    } policies[] = {\r\n        { \"InternetAccess\",     Perm_InternetAccess     },\r\n        { \"DiskAccess\",         Perm_DiskAccess         },\r\n        { \"SavePreferences\",    Perm_SavePreferences    },\r\n        { \"RegistryAccess\",     Perm_RegistryAccess     },\r\n        { \"PrinterAccess\",      Perm_PrinterAccess      },\r\n        { \"CopySelection\",      Perm_CopySelection      },\r\n        { \"FullscreenAccess\",   Perm_FullscreenAccess   },\r\n    };\r\n\r\n    // enable policies as indicated in sumatrapdfrestrict.ini\r\n    for (size_t i = 0; i < dimof(policies); i++) {\r\n        const char *value = polsec->GetValue(policies[i].name);\r\n        if (value && atoi(value) != 0)\r\n            gPolicyRestrictions = gPolicyRestrictions | policies[i].perm;\r\n    }\r\n\r\n    // determine the list of allowed link protocols and perceived file types\r\n    if ((gPolicyRestrictions & Perm_DiskAccess)) {\r\n        const char *value;\r\n        if ((value = polsec->GetValue(\"LinkProtocols\")) != nullptr) {\r\n            ScopedMem<WCHAR> protocols(str::conv::FromUtf8(value));\r\n            str::ToLowerInPlace(protocols);\r\n            str::TransChars(protocols, L\":; \", L\",,,\");\r\n            gAllowedLinkProtocols.Split(protocols, L\",\", true);\r\n        }\r\n        if ((value = polsec->GetValue(\"SafeFileTypes\")) != nullptr) {\r\n            ScopedMem<WCHAR> protocols(str::conv::FromUtf8(value));\r\n            str::ToLowerInPlace(protocols);\r\n            str::TransChars(protocols, L\":; \", L\",,,\");\r\n            gAllowedFileTypes.Split(protocols, L\",\", true);\r\n        }\r\n    }\r\n}\r\n\r\nvoid RestrictPolicies(int revokePermission)\r\n{\r\n    gPolicyRestrictions = (gPolicyRestrictions | Perm_RestrictedUse) & ~revokePermission;\r\n}\r\n\r\nbool HasPermission(int permission)\r\n{\r\n    return (permission & gPolicyRestrictions) == permission;\r\n}\r\n\r\n// lets the shell open a URI for any supported scheme in\r\n// the appropriate application (web browser, mail client, etc.)\r\nbool LaunchBrowser(const WCHAR *url)\r\n{\r\n    if (gPluginMode) {\r\n        // pass the URI back to the browser\r\n        CrashIf(gWindows.Count() == 0);\r\n        if (gWindows.Count() == 0)\r\n            return false;\r\n        HWND plugin = gWindows.At(0)->hwndFrame;\r\n        HWND parent = GetAncestor(plugin, GA_PARENT);\r\n        ScopedMem<char> urlUtf8(str::conv::ToUtf8(url));\r\n        if (!parent || !urlUtf8 || str::Len(urlUtf8) > 4096)\r\n            return false;\r\n        COPYDATASTRUCT cds = { 0x4C5255 /* URL */, (DWORD)str::Len(urlUtf8) + 1, urlUtf8.Get() };\r\n        return SendMessage(parent, WM_COPYDATA, (WPARAM)plugin, (LPARAM)&cds);\r\n    }\r\n\r\n    if (!HasPermission(Perm_DiskAccess))\r\n        return false;\r\n\r\n    // check if this URL's protocol is allowed\r\n    ScopedMem<WCHAR> protocol;\r\n    if (!str::Parse(url, L\"%S:\", &protocol))\r\n        return false;\r\n    str::ToLowerInPlace(protocol);\r\n    if (!gAllowedLinkProtocols.Contains(protocol))\r\n        return false;\r\n\r\n    return LaunchFile(url, nullptr, L\"open\");\r\n}\r\n\r\n// lets the shell open a file of any supported perceived type\r\n// in the default application for opening such files\r\nbool OpenFileExternally(const WCHAR *path)\r\n{\r\n    if (!HasPermission(Perm_DiskAccess) || gPluginMode)\r\n        return false;\r\n\r\n    // check if this file's perceived type is allowed\r\n    const WCHAR *ext = path::GetExt(path);\r\n    ScopedMem<WCHAR> perceivedType(ReadRegStr(HKEY_CLASSES_ROOT, ext, L\"PerceivedType\"));\r\n    // since we allow following hyperlinks, also allow opening local webpages\r\n    if (str::EndsWithI(path, L\".htm\") || str::EndsWithI(path, L\".html\") || str::EndsWithI(path, L\".xhtml\"))\r\n        perceivedType.Set(str::Dup(L\"webpage\"));\r\n    str::ToLowerInPlace(perceivedType);\r\n    if (gAllowedFileTypes.Contains(L\"*\"))\r\n        /* allow all file types (not recommended) */;\r\n    else if (!perceivedType || !gAllowedFileTypes.Contains(perceivedType))\r\n        return false;\r\n\r\n    // TODO: only do this for trusted files (cf. IsUntrustedFile)?\r\n    return LaunchFile(path);\r\n}\r\n\r\nvoid SwitchToDisplayMode(WindowInfo *win, DisplayMode displayMode, bool keepContinuous)\r\n{\r\n    CrashIf(!win->IsDocLoaded());\r\n    if (!win->IsDocLoaded()) return;\r\n\r\n    win->ctrl->SetDisplayMode(displayMode, keepContinuous);\r\n    UpdateToolbarState(win);\r\n}\r\n\r\nWindowInfo *FindWindowInfoByHwnd(HWND hwnd)\r\n{\r\n    HWND parent = GetParent(hwnd);\r\n    for (size_t i = 0; i < gWindows.Count(); i++) {\r\n        WindowInfo *win = gWindows.At(i);\r\n        if (hwnd == win->hwndFrame)\r\n            return win;\r\n        if (!parent)\r\n            continue;\r\n        if (// canvas, toolbar, rebar, tocbox, splitters\r\n            parent == win->hwndFrame    ||\r\n            // infotips, message windows\r\n            parent == win->hwndCanvas   ||\r\n            // page and find labels and boxes\r\n            parent == win->hwndToolbar  ||\r\n            // ToC tree, sidebar title and close button\r\n            parent == win->hwndTocBox   ||\r\n            // Favorites tree, title, and close button\r\n            parent == win->hwndFavBox   ||\r\n            // tab bar\r\n            parent == win->hwndTabBar   ||\r\n            // caption buttons, tab bar\r\n            parent == win->hwndCaption) {\r\n            return win;\r\n        }\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nbool WindowInfoStillValid(WindowInfo *win)\r\n{\r\n    return gWindows.Contains(win);\r\n}\r\n\r\n// Find the first window showing a given PDF file\r\nWindowInfo* FindWindowInfoByFile(const WCHAR *file, bool focusTab)\r\n{\r\n    ScopedMem<WCHAR> normFile(path::Normalize(file));\r\n\r\n    for (WindowInfo *win : gWindows) {\r\n        if (!win->IsAboutWindow() && path::IsSame(win->currentTab->filePath, normFile))\r\n            return win;\r\n        if (focusTab && win->tabs.Count() > 1) {\r\n            // bring a background tab to the foreground\r\n            for (TabInfo *tab : win->tabs) {\r\n                if (tab != win->currentTab && path::IsSame(tab->filePath, normFile)) {\r\n                    TabsSelect(win, win->tabs.Find(tab));\r\n                    return win;\r\n                }\r\n            }\r\n        }\r\n    }\r\n    return nullptr;\r\n}\r\n\r\n// Find the first window that has been produced from <file>\r\nWindowInfo* FindWindowInfoBySyncFile(const WCHAR *file, bool focusTab)\r\n{\r\n    for (WindowInfo *win : gWindows) {\r\n        Vec<RectI> rects;\r\n        UINT page;\r\n        if (win->AsFixed() && win->AsFixed()->pdfSync &&\r\n            win->AsFixed()->pdfSync->SourceToDoc(file, 0, 0, &page, rects) != PDFSYNCERR_UNKNOWN_SOURCEFILE) {\r\n            return win;\r\n        }\r\n        if (focusTab && win->tabs.Count() > 1) {\r\n            // bring a background tab to the foreground\r\n            for (TabInfo *tab : win->tabs) {\r\n                if (tab != win->currentTab && tab->AsFixed() && tab->AsFixed()->pdfSync &&\r\n                    tab->AsFixed()->pdfSync->SourceToDoc(file, 0, 0, &page, rects) != PDFSYNCERR_UNKNOWN_SOURCEFILE) {\r\n                    TabsSelect(win, win->tabs.Find(tab));\r\n                    return win;\r\n                }\r\n            }\r\n        }\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nWindowInfo *FindWindowInfoByTab(TabInfo *tab)\r\n{\r\n    return gWindows.FindEl([&](WindowInfo *win) { return win->tabs.Contains(tab); });\r\n}\r\n\r\nWindowInfo *FindWindowInfoByController(Controller *ctrl)\r\n{\r\n    return gWindows.FindEl([&](WindowInfo *win) {\r\n        return win->tabs.FindEl([&](TabInfo *tab) { return tab->ctrl == ctrl; }) != NULL;\r\n    });\r\n}\r\n\r\nclass HwndPasswordUI : public PasswordUI\r\n{\r\n    HWND hwnd;\r\n    size_t pwdIdx;\r\n\r\npublic:\r\n    explicit HwndPasswordUI(HWND hwnd) : hwnd(hwnd), pwdIdx(0) { }\r\n\r\n    virtual WCHAR * GetPassword(const WCHAR *fileName, unsigned char *fileDigest,\r\n                                unsigned char decryptionKeyOut[32], bool *saveKey);\r\n};\r\n\r\n/* Get password for a given 'fileName', can be nullptr if user cancelled the\r\n   dialog box or if the encryption key has been filled in instead.\r\n   Caller needs to free() the result. */\r\nWCHAR *HwndPasswordUI::GetPassword(const WCHAR *fileName, unsigned char *fileDigest,\r\n                                   unsigned char decryptionKeyOut[32], bool *saveKey)\r\n{\r\n    DisplayState *fileFromHistory = gFileHistory.Find(fileName);\r\n    if (fileFromHistory && fileFromHistory->decryptionKey) {\r\n        ScopedMem<char> fingerprint(str::MemToHex(fileDigest, 16));\r\n        *saveKey = str::StartsWith(fileFromHistory->decryptionKey, fingerprint.Get());\r\n        if (*saveKey && str::HexToMem(fileFromHistory->decryptionKey + 32, decryptionKeyOut, 32))\r\n            return nullptr;\r\n    }\r\n\r\n    *saveKey = false;\r\n\r\n    // try the list of default passwords before asking the user\r\n    if (pwdIdx < gGlobalPrefs->defaultPasswords->Count())\r\n        return str::Dup(gGlobalPrefs->defaultPasswords->At(pwdIdx++));\r\n\r\n    if (IsStressTesting())\r\n        return nullptr;\r\n\r\n    // extract the filename from the URL in plugin mode instead\r\n    // of using the more confusing temporary filename\r\n    ScopedMem<WCHAR> urlName;\r\n    if (gPluginMode) {\r\n        urlName.Set(url::GetFileName(gPluginURL));\r\n        if (urlName)\r\n            fileName = urlName;\r\n    }\r\n    fileName = path::GetBaseName(fileName);\r\n\r\n    // check if the window is still valid as it might have been closed by now\r\n    if (!IsWindow(hwnd)) {\r\n        CrashIf(true);\r\n        hwnd = GetForegroundWindow();\r\n    }\r\n    // make sure that the password dialog is visible\r\n    win::ToForeground(hwnd);\r\n\r\n    bool *rememberPwd = gGlobalPrefs->rememberOpenedFiles ? saveKey : nullptr;\r\n    return Dialog_GetPassword(hwnd, fileName, rememberPwd);\r\n}\r\n\r\n// update global windowState for next default launch when either\r\n// no pdf is opened or a document without window dimension information\r\nstatic void RememberDefaultWindowPosition(WindowInfo& win)\r\n{\r\n    // ignore spurious WM_SIZE and WM_MOVE messages happening during initialization\r\n    if (!IsWindowVisible(win.hwndFrame))\r\n        return;\r\n\r\n    if (win.presentation)\r\n        gGlobalPrefs->windowState = win.windowStateBeforePresentation;\r\n    else if (win.isFullScreen)\r\n        gGlobalPrefs->windowState = WIN_STATE_FULLSCREEN;\r\n    else if (IsZoomed(win.hwndFrame))\r\n        gGlobalPrefs->windowState = WIN_STATE_MAXIMIZED;\r\n    else if (!IsIconic(win.hwndFrame))\r\n        gGlobalPrefs->windowState = WIN_STATE_NORMAL;\r\n\r\n    gGlobalPrefs->sidebarDx = WindowRect(win.hwndTocBox).dx;\r\n\r\n    /* don't update the window's dimensions if it is maximized, mimimized or fullscreened */\r\n    if (WIN_STATE_NORMAL == gGlobalPrefs->windowState &&\r\n        !IsIconic(win.hwndFrame) && !win.presentation) {\r\n        // TODO: Use Get/SetWindowPlacement (otherwise we'd have to separately track\r\n        //       the non-maximized dimensions for proper restoration)\r\n        gGlobalPrefs->windowPos = WindowRect(win.hwndFrame);\r\n    }\r\n}\r\n\r\nstatic void UpdateDisplayStateWindowRect(WindowInfo& win, DisplayState& ds, bool updateGlobal=true)\r\n{\r\n    if (updateGlobal)\r\n        RememberDefaultWindowPosition(win);\r\n\r\n    ds.windowState = gGlobalPrefs->windowState;\r\n    ds.windowPos   = gGlobalPrefs->windowPos;\r\n    ds.sidebarDx   = gGlobalPrefs->sidebarDx;\r\n}\r\n\r\nstatic void UpdateSidebarDisplayState(WindowInfo *win, TabInfo *tab, DisplayState *ds)\r\n{\r\n    CrashIf(!tab);\r\n\r\n    ds->showToc = tab->showToc;\r\n    if (win->tocLoaded && tab == win->currentTab) {\r\n        tab->tocState.Reset();\r\n        HTREEITEM hRoot = TreeView_GetRoot(win->hwndTocTree);\r\n        if (hRoot)\r\n            UpdateTocExpansionState(tab, win->hwndTocTree, hRoot);\r\n    }\r\n    *ds->tocState = tab->tocState;\r\n}\r\n\r\nvoid UpdateTabFileDisplayStateForWin(WindowInfo *win, TabInfo *tab)\r\n{\r\n    RememberDefaultWindowPosition(*win);\r\n    if (!tab || !tab->ctrl)\r\n        return;\r\n    DisplayState *ds = gFileHistory.Find(tab->filePath);\r\n    if (!ds)\r\n        return;\r\n    tab->ctrl->UpdateDisplayState(ds);\r\n    UpdateDisplayStateWindowRect(*win, *ds, false);\r\n    UpdateSidebarDisplayState(win, tab, ds);\r\n}\r\n\r\nbool IsUIRightToLeft()\r\n{\r\n    return trans::IsCurrLangRtl();\r\n}\r\n\r\nUINT MbRtlReadingMaybe()\r\n{\r\n    if (IsUIRightToLeft())\r\n        return MB_RTLREADING;\r\n    return 0;\r\n}\r\n\r\nvoid MessageBoxWarning(HWND hwnd, const WCHAR *msg, const WCHAR *title)\r\n{\r\n    UINT type =  MB_OK | MB_ICONEXCLAMATION | MbRtlReadingMaybe();\r\n    if (!title)\r\n        title = _TR(\"Warning\");\r\n    MessageBox(hwnd, msg, title, type);\r\n}\r\n\r\n// updates the layout for a window to either left-to-right or right-to-left\r\n// depending on the currently used language (cf. IsUIRightToLeft)\r\nstatic void UpdateWindowRtlLayout(WindowInfo *win)\r\n{\r\n    bool isRTL = IsUIRightToLeft();\r\n    bool wasRTL = (GetWindowLong(win->hwndFrame, GWL_EXSTYLE) & WS_EX_LAYOUTRTL) != 0;\r\n    if (wasRTL == isRTL)\r\n        return;\r\n\r\n    bool tocVisible = win->tocVisible;\r\n    bool favVisible = gGlobalPrefs->showFavorites;\r\n    if (tocVisible || favVisible)\r\n        SetSidebarVisibility(win, false, false);\r\n\r\n    // cf. https://www.microsoft.com/middleeast/msdn/mirror.aspx\r\n    ToggleWindowStyle(win->hwndFrame, WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT, isRTL, GWL_EXSTYLE);\r\n\r\n    ToggleWindowStyle(win->hwndTocBox, WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT, isRTL, GWL_EXSTYLE);\r\n    HWND tocBoxTitle = GetHwnd(win->tocLabelWithClose);\r\n    ToggleWindowStyle(tocBoxTitle, WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT, isRTL, GWL_EXSTYLE);\r\n\r\n    ToggleWindowStyle(win->hwndFavBox, WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT, isRTL, GWL_EXSTYLE);\r\n    HWND favBoxTitle = GetHwnd(win->favLabelWithClose);\r\n    ToggleWindowStyle(favBoxTitle, WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT, isRTL, GWL_EXSTYLE);\r\n    ToggleWindowStyle(win->hwndFavTree, WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT, isRTL, GWL_EXSTYLE);\r\n\r\n    ToggleWindowStyle(win->hwndReBar, WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT, isRTL, GWL_EXSTYLE);\r\n    ToggleWindowStyle(win->hwndToolbar, WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT, isRTL, GWL_EXSTYLE);\r\n    ToggleWindowStyle(win->hwndFindBox, WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT, isRTL, GWL_EXSTYLE);\r\n    ToggleWindowStyle(win->hwndFindText, WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT, isRTL, GWL_EXSTYLE);\r\n    ToggleWindowStyle(win->hwndPageText, WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT, isRTL, GWL_EXSTYLE);\r\n\r\n    ToggleWindowStyle(win->hwndCaption, WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT, isRTL, GWL_EXSTYLE);\r\n    for (int i = CB_BTN_FIRST; i < CB_BTN_COUNT; i++)\r\n        ToggleWindowStyle(win->caption->btn[i].hwnd, WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT, isRTL, GWL_EXSTYLE);\r\n    // TODO: why isn't SetWindowPos(..., SWP_FRAMECHANGED) enough?\r\n    SendMessage(win->hwndFrame, WM_DWMCOMPOSITIONCHANGED, 0, 0);\r\n    RelayoutCaption(win);\r\n    // TODO: make tab bar RTL aware\r\n    // ToggleWindowStyle(win->hwndTabBar, WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT, isRTL, GWL_EXSTYLE);\r\n\r\n    win->notifications->Relayout();\r\n\r\n    // TODO: also update the canvas scrollbars (?)\r\n\r\n    // ensure that the ToC sidebar is on the correct side and that its\r\n    // title and close button are also correctly laid out\r\n    if (tocVisible || favVisible) {\r\n        SetSidebarVisibility(win, tocVisible, favVisible);\r\n        if (tocVisible)\r\n            SendMessage(win->hwndTocBox, WM_SIZE, 0, 0);\r\n        if (favVisible)\r\n            SendMessage(win->hwndFavBox, WM_SIZE, 0, 0);\r\n    }\r\n}\r\n\r\nvoid RebuildMenuBarForWindow(WindowInfo *win)\r\n{\r\n    HMENU oldMenu = win->menu;\r\n    win->menu = BuildMenu(win);\r\n    if (!win->presentation && !win->isFullScreen && !win->isMenuHidden)\r\n        SetMenu(win->hwndFrame, win->menu);\r\n    DestroyMenu(oldMenu);\r\n}\r\n\r\nstatic bool ShouldSaveThumbnail(DisplayState& ds)\r\n{\r\n    // don't create thumbnails if we won't be needing them at all\r\n    if (!HasPermission(Perm_SavePreferences))\r\n        return false;\r\n\r\n    // don't create thumbnails for files that won't need them anytime soon\r\n    Vec<DisplayState *> list;\r\n    gFileHistory.GetFrequencyOrder(list);\r\n    int idx = list.Find(&ds);\r\n    if (idx < 0 || FILE_HISTORY_MAX_FREQUENT * 2 <= idx)\r\n        return false;\r\n\r\n    if (HasThumbnail(ds))\r\n        return false;\r\n    return true;\r\n}\r\n\r\n// TODO: replace with std::function\r\nclass ThumbnailRenderingTask : public RenderingCallback\r\n{\r\n    std::function<void(RenderedBitmap*)> saveThumbnail;\r\n\r\npublic:\r\n    explicit ThumbnailRenderingTask(const std::function<void(RenderedBitmap*)> &saveThumbnail)\r\n        : saveThumbnail(saveThumbnail) { }\r\n    ~ThumbnailRenderingTask() { }\r\n\r\n    virtual void Callback(RenderedBitmap *bmp) {\r\n        saveThumbnail(bmp);\r\n        delete this;\r\n    }\r\n};\r\n\r\nclass ControllerCallbackHandler : public ControllerCallback {\r\n    WindowInfo *win;\r\n\r\npublic:\r\n    ControllerCallbackHandler(WindowInfo *win) : win(win) { }\r\n    virtual ~ControllerCallbackHandler() { }\r\n\r\n    virtual void Repaint() { win->RepaintAsync(); }\r\n    virtual void PageNoChanged(Controller *ctrl, int pageNo);\r\n    virtual void UpdateScrollbars(SizeI canvas);\r\n    virtual void RequestRendering(int pageNo);\r\n    virtual void CleanUp(DisplayModel *dm);\r\n    virtual void RenderThumbnail(DisplayModel *dm, SizeI size, const std::function<void(RenderedBitmap*)>&);\r\n    virtual void GotoLink(PageDestination *dest) { win->linkHandler->GotoLink(dest); }\r\n    virtual void FocusFrame(bool always);\r\n    virtual void SaveDownload(const WCHAR *url, const unsigned char *data, size_t len);\r\n    virtual void HandleLayoutedPages(EbookController *ctrl, EbookFormattingData *data);\r\n    virtual void RequestDelayedLayout(int delay);\r\n};\r\n\r\nvoid ControllerCallbackHandler::RenderThumbnail(DisplayModel *dm, SizeI size, const std::function<void(RenderedBitmap*)>& saveThumbnail)\r\n{\r\n    RectD pageRect = dm->GetEngine()->PageMediabox(1);\r\n    if (pageRect.IsEmpty()) {\r\n        // saveThumbnail must always be called for clean-up code\r\n        saveThumbnail(nullptr);\r\n        return;\r\n    }\r\n\r\n    pageRect = dm->GetEngine()->Transform(pageRect, 1, 1.0f, 0);\r\n    float zoom = size.dx / (float)pageRect.dx;\r\n    if (pageRect.dy > (float)size.dy / zoom)\r\n        pageRect.dy = (float)size.dy / zoom;\r\n    pageRect = dm->GetEngine()->Transform(pageRect, 1, 1.0f, 0, true);\r\n\r\n    RenderingCallback *callback = new ThumbnailRenderingTask(saveThumbnail);\r\n    gRenderCache.Render(dm, 1, 0, zoom, pageRect, *callback);\r\n}\r\n\r\nstatic void CreateThumbnailForFile(WindowInfo& win, DisplayState& ds)\r\n{\r\n    if (!ShouldSaveThumbnail(ds))\r\n        return;\r\n\r\n    CrashIf(!win.IsDocLoaded());\r\n    if (!win.IsDocLoaded()) return;\r\n\r\n    // don't create thumbnails for password protected documents\r\n    // (unless we're also remembering the decryption key anyway)\r\n    if (win.AsFixed() && win.AsFixed()->GetEngine()->IsPasswordProtected() &&\r\n        !ScopedMem<char>(win.AsFixed()->GetEngine()->GetDecryptionKey())) {\r\n        RemoveThumbnail(ds);\r\n        return;\r\n    }\r\n\r\n    WCHAR *filePath = str::Dup(win.ctrl->FilePath());\r\n    win.ctrl->CreateThumbnail(SizeI(THUMBNAIL_DX, THUMBNAIL_DY),[=] (RenderedBitmap*bmp) {\r\n        uitask::Post([=] {\r\n            if (bmp)\r\n                SetThumbnail(gFileHistory.Find(filePath), bmp);\r\n            free(filePath);\r\n        });\r\n    });\r\n}\r\n\r\n/* Send the request to render a given page to a rendering thread */\r\nvoid ControllerCallbackHandler::RequestRendering(int pageNo)\r\n{\r\n    CrashIf(!win->AsFixed());\r\n    if (!win->AsFixed()) return;\r\n\r\n    DisplayModel *dm = win->AsFixed();\r\n    // don't render any plain images on the rendering thread,\r\n    // they'll be rendered directly in DrawDocument during\r\n    // WM_PAINT on the UI thread\r\n    if (dm->ShouldCacheRendering(pageNo))\r\n        gRenderCache.RequestRendering(dm, pageNo);\r\n}\r\n\r\nvoid ControllerCallbackHandler::CleanUp(DisplayModel *dm)\r\n{\r\n    gRenderCache.CancelRendering(dm);\r\n    gRenderCache.FreeForDisplayModel(dm);\r\n}\r\n\r\nvoid ControllerCallbackHandler::FocusFrame(bool always)\r\n{\r\n    if (always || !FindWindowInfoByHwnd(GetFocus()))\r\n        SetFocus(win->hwndFrame);\r\n}\r\n\r\nvoid ControllerCallbackHandler::SaveDownload(const WCHAR *url, const unsigned char *data, size_t len)\r\n{\r\n    ScopedMem<WCHAR> fileName(url::GetFileName(url));\r\n    LinkSaver linkSaver(win->currentTab, win->hwndFrame, fileName);\r\n    linkSaver.SaveEmbedded(data, len);\r\n}\r\n\r\nvoid ControllerCallbackHandler::HandleLayoutedPages(EbookController *ctrl, EbookFormattingData *data)\r\n{\r\n    uitask::Post([=]{\r\n        if (FindWindowInfoByController(ctrl)) {\r\n            ctrl->HandlePagesFromEbookLayout(data);\r\n        }\r\n        else {\r\n            // don't leak data if ctrl has already been deleted\r\n            EbookController::DeleteEbookFormattingData(data);\r\n        }\r\n    });\r\n}\r\n\r\nvoid ControllerCallbackHandler::RequestDelayedLayout(int delay)\r\n{\r\n    SetTimer(win->hwndCanvas, EBOOK_LAYOUT_TIMER_ID, delay, nullptr);\r\n}\r\n\r\nvoid ControllerCallbackHandler::UpdateScrollbars(SizeI canvas)\r\n{\r\n    CrashIf(!win->AsFixed());\r\n    DisplayModel *dm = win->AsFixed();\r\n\r\n    SCROLLINFO si = { 0 };\r\n    si.cbSize = sizeof(si);\r\n    si.fMask = SIF_ALL;\r\n\r\n    SizeI viewPort = dm->GetViewPort().Size();\r\n\r\n    if (viewPort.dx >= canvas.dx) {\r\n        si.nPos = 0;\r\n        si.nMin = 0;\r\n        si.nMax = 99;\r\n        si.nPage = 100;\r\n    } else {\r\n        si.nPos = dm->GetViewPort().x;\r\n        si.nMin = 0;\r\n        si.nMax = canvas.dx - 1;\r\n        si.nPage = viewPort.dx;\r\n    }\r\n    ShowScrollBar(win->hwndCanvas, SB_HORZ, viewPort.dx < canvas.dx);\r\n    SetScrollInfo(win->hwndCanvas, SB_HORZ, &si, TRUE);\r\n\r\n    if (viewPort.dy >= canvas.dy) {\r\n        si.nPos = 0;\r\n        si.nMin = 0;\r\n        si.nMax = 99;\r\n        si.nPage = 100;\r\n    } else {\r\n        si.nPos = dm->GetViewPort().y;\r\n        si.nMin = 0;\r\n        si.nMax = canvas.dy - 1;\r\n        si.nPage = viewPort.dy;\r\n\r\n        if (ZOOM_FIT_PAGE != dm->GetZoomVirtual()) {\r\n            // keep the top/bottom 5% of the previous page visible after paging down/up\r\n            si.nPage = (UINT)(si.nPage * 0.95);\r\n            si.nMax -= viewPort.dy - si.nPage;\r\n        }\r\n    }\r\n    ShowScrollBar(win->hwndCanvas, SB_VERT, viewPort.dy < canvas.dy);\r\n    SetScrollInfo(win->hwndCanvas, SB_VERT, &si, TRUE);\r\n}\r\n\r\n// The current page edit box is updated with the current page number\r\nvoid ControllerCallbackHandler::PageNoChanged(Controller *ctrl, int pageNo)\r\n{\r\n    // discard page number change requests from documents\r\n    // loaded asynchronously in a background tab\r\n    if (win->ctrl != ctrl)\r\n        return;\r\n\r\n    AssertCrash(win->ctrl && win->ctrl->PageCount() > 0);\r\n    if (!win->ctrl || win->ctrl->PageCount() == 0)\r\n        return;\r\n\r\n    if (win->AsEbook())\r\n        pageNo = win->AsEbook()->CurrentTocPageNo();\r\n    else if (INVALID_PAGE_NO != pageNo) {\r\n        ScopedMem<WCHAR> buf(win->ctrl->GetPageLabel(pageNo));\r\n        win::SetText(win->hwndPageBox, buf);\r\n        ToolbarUpdateStateForWindow(win, false);\r\n        if (win->ctrl->HasPageLabels())\r\n            UpdateToolbarPageText(win, win->ctrl->PageCount(), true);\r\n    }\r\n    if (pageNo == win->currPageNo)\r\n        return;\r\n\r\n    UpdateTocSelection(win, pageNo);\r\n    win->currPageNo = pageNo;\r\n\r\n    NotificationWnd *wnd = win->notifications->GetForGroup(NG_PAGE_INFO_HELPER);\r\n    if (wnd) {\r\n        CrashIf(!win->AsFixed());\r\n        UpdatePageInfoHelper(win, wnd, pageNo);\r\n    }\r\n}\r\n\r\nstatic Controller *CreateControllerForFile(const WCHAR *filePath, PasswordUI *pwdUI, WindowInfo *win)\r\n{\r\n    if (!win->cbHandler)\r\n        win->cbHandler = new ControllerCallbackHandler(win);\r\n\r\n    Controller *ctrl = nullptr;\r\n\r\n    EngineType engineType;\r\n    BaseEngine *engine = EngineManager::CreateEngine(filePath, pwdUI, &engineType,\r\n                                                     gGlobalPrefs->chmUI.useFixedPageUI,\r\n                                                     gGlobalPrefs->ebookUI.useFixedPageUI);\r\n\r\n    if (engine) {\r\nLoadEngineInFixedPageUI:\r\n        ctrl = new DisplayModel(engine, engineType, win->cbHandler);\r\n        CrashIf(!ctrl || !ctrl->AsFixed() || ctrl->AsChm() || ctrl->AsEbook());\r\n    }\r\n    else if (ChmModel::IsSupportedFile(filePath) && !gGlobalPrefs->chmUI.useFixedPageUI) {\r\n        ChmModel *chmModel = ChmModel::Create(filePath, win->cbHandler);\r\n        if (chmModel) {\r\n            // make sure that MSHTML can't be used as a potential exploit\r\n            // vector through another browser and our plugin (which doesn't\r\n            // advertise itself for Chm documents but could be tricked into\r\n            // loading one nonetheless); note: this crash should never happen,\r\n            // since gGlobalPrefs->chmUI.useFixedPageUI is set in SetupPluginMode\r\n            CrashAlwaysIf(gPluginMode);\r\n            // if CLSID_WebBrowser isn't available, fall back on ChmEngine\r\n            if (!chmModel->SetParentHwnd(win->hwndCanvas)) {\r\n                delete chmModel;\r\n                engine = EngineManager::CreateEngine(filePath, pwdUI, &engineType, true);\r\n                CrashIf(engineType != Engine_Chm);\r\n                if (!engine)\r\n                    return nullptr;\r\n                goto LoadEngineInFixedPageUI;\r\n            }\r\n            // another ChmModel might still be active\r\n            chmModel->RemoveParentHwnd();\r\n            ctrl = chmModel;\r\n        }\r\n        CrashIf(ctrl && (!ctrl->AsChm() || ctrl->AsFixed() || ctrl->AsEbook()));\r\n    }\r\n    else if (Doc::IsSupportedFile(filePath) && !gGlobalPrefs->ebookUI.useFixedPageUI) {\r\n        Doc doc = Doc::CreateFromFile(filePath);\r\n        if (doc.IsDocLoaded()) {\r\n            ctrl = EbookController::Create(doc, win->hwndCanvas, win->cbHandler, win->frameRateWnd);\r\n        }\r\n        CrashIf(ctrl && (!ctrl->AsEbook() || ctrl->AsFixed() || ctrl->AsChm()));\r\n    }\r\n    CrashIf(ctrl && !str::Eq(ctrl->FilePath(), filePath));\r\n\r\n    return ctrl;\r\n}\r\n\r\nstatic void SetFrameTitleForTab(TabInfo *tab, bool needRefresh)\r\n{\r\n    const WCHAR *titlePath = tab->filePath;\r\n    if (!gGlobalPrefs->fullPathInTitle)\r\n        titlePath = path::GetBaseName(titlePath);\r\n    ScopedMem<WCHAR> docTitle;\r\n    if (tab->ctrl && (docTitle = tab->ctrl->GetProperty(Prop_Title)) != nullptr) {\r\n        str::NormalizeWS(docTitle.Get());\r\n        if (!str::IsEmpty(docTitle.Get()))\r\n            docTitle = str::Format(L\"- [%s] \", docTitle);\r\n    }\r\n\r\n    if (!IsUIRightToLeft()) {\r\n        tab->frameTitle.Set(str::Format(L\"%s %s- %s\", titlePath, docTitle ? docTitle : L\"\", SUMATRA_WINDOW_TITLE));\r\n    }\r\n    else {\r\n        // explicitly revert the title, so that filenames aren't garbled\r\n        tab->frameTitle.Set(str::Format(L\"%s %s- %s\", SUMATRA_WINDOW_TITLE, docTitle ? docTitle : L\"\", titlePath));\r\n    }\r\n    if (needRefresh && tab->ctrl) {\r\n        // TODO: this isn't visible when tabs are used\r\n        tab->frameTitle.Set(str::Format(_TR(\"[Changes detected; refreshing] %s\"), tab->frameTitle));\r\n    }\r\n}\r\n\r\nstatic void UpdateUiForCurrentTab(WindowInfo *win)\r\n{\r\n    // hide the scrollbars before any other relayouting (for assertion in WindowInfo::GetViewPortSize)\r\n    if (!win->AsFixed())\r\n        ShowScrollBar(win->hwndCanvas, SB_BOTH, FALSE);\r\n\r\n    // menu for chm and ebook docs is different, so we have to re-create it\r\n    RebuildMenuBarForWindow(win);\r\n    // the toolbar isn't supported for ebook docs (yet)\r\n    ShowOrHideToolbar(win);\r\n    // TODO: unify?\r\n    ToolbarUpdateStateForWindow(win, true);\r\n    UpdateToolbarState(win);\r\n\r\n    int pageCount = win->ctrl ? win->ctrl->PageCount() : 0;\r\n    UpdateToolbarPageText(win, pageCount);\r\n    UpdateToolbarFindText(win);\r\n\r\n    OnMenuFindMatchCase(win);\r\n    UpdateFindbox(win);\r\n\r\n    win::SetText(win->hwndFrame, win->currentTab->frameTitle);\r\n    UpdateCurrentTabBgColor(win);\r\n\r\n    bool onlyNumbers = !win->ctrl || !win->ctrl->HasPageLabels();\r\n    ToggleWindowStyle(win->hwndPageBox, ES_NUMBER, onlyNumbers);\r\n}\r\n\r\n// meaning of the internal values of LoadArgs:\r\n// isNewWindow : if true then 'win' refers to a newly created window that needs\r\n//   to be resized and placed\r\n// placeWindow : if true then the Window will be moved/sized according\r\n//   to the 'state' information even if the window was already placed\r\n//   before (isNewWindow=false)\r\nstatic void LoadDocIntoCurrentTab(LoadArgs& args, Controller *ctrl, DisplayState *state=nullptr)\r\n{\r\n    WindowInfo *win = args.win;\r\n    TabInfo *tab = win->currentTab;\r\n    CrashIf(!tab);\r\n\r\n    // Never load settings from a preexisting state if the user doesn't wish to\r\n    // (unless we're just refreshing the document, i.e. only if state && !state->useDefaultState)\r\n    if (!state && gGlobalPrefs->rememberStatePerDocument) {\r\n        state = gFileHistory.Find(args.fileName);\r\n        if (state) {\r\n            if (state->windowPos.IsEmpty())\r\n                state->windowPos = gGlobalPrefs->windowPos;\r\n            EnsureAreaVisibility(state->windowPos);\r\n        }\r\n    }\r\n    if (state && state->useDefaultState) {\r\n        state = nullptr;\r\n    }\r\n\r\n    DisplayMode displayMode = gGlobalPrefs->defaultDisplayModeEnum;\r\n    float zoomVirtual = gGlobalPrefs->defaultZoomFloat;\r\n    ScrollState ss(1, -1, -1);\r\n    int rotation = 0;\r\n    bool showToc = gGlobalPrefs->showToc;\r\n    bool showAsFullScreen = WIN_STATE_FULLSCREEN == gGlobalPrefs->windowState;\r\n    int showType = SW_NORMAL;\r\n    if (gGlobalPrefs->windowState == WIN_STATE_MAXIMIZED || showAsFullScreen)\r\n        showType = SW_MAXIMIZE;\r\n\r\n    if (state) {\r\n        ss.page = state->pageNo;\r\n        displayMode = prefs::conv::ToDisplayMode(state->displayMode, DM_AUTOMATIC);\r\n        showAsFullScreen = WIN_STATE_FULLSCREEN == state->windowState;\r\n        if (state->windowState == WIN_STATE_NORMAL)\r\n            showType = SW_NORMAL;\r\n        else if (state->windowState == WIN_STATE_MAXIMIZED || showAsFullScreen)\r\n            showType = SW_MAXIMIZE;\r\n        else if (state->windowState == WIN_STATE_MINIMIZED)\r\n            showType = SW_MINIMIZE;\r\n        showToc = state->showToc;\r\n        if (win->ctrl && win->presentation)\r\n            showToc = tab->showTocPresentation;\r\n    }\r\n\r\n    AbortFinding(args.win, false);\r\n\r\n    Controller *prevCtrl = win->ctrl;\r\n    tab->ctrl = ctrl;\r\n    win->ctrl = tab->ctrl;\r\n\r\n    // ToC items might hold a reference to an Engine, so make sure to\r\n    // delete them before destroying the whole DisplayModel\r\n    // (same for linkOnLastButtonDown)\r\n    ClearTocBox(win);\r\n    delete tab->tocRoot;\r\n    tab->tocRoot = nullptr;\r\n    delete win->linkOnLastButtonDown;\r\n    win->linkOnLastButtonDown = nullptr;\r\n\r\n    AssertCrash(!win->IsAboutWindow() && win->IsDocLoaded() == (win->ctrl != nullptr));\r\n    // TODO: https://code.google.com/p/sumatrapdf/issues/detail?id=1570\r\n    if (win->ctrl) {\r\n        if (win->AsFixed()) {\r\n            DisplayModel *dm = win->AsFixed();\r\n            int dpi = gGlobalPrefs->customScreenDPI > 0 ? dpi = gGlobalPrefs->customScreenDPI : DpiGetPreciseX(win->hwndFrame);\r\n            dm->SetInitialViewSettings(displayMode, ss.page, win->GetViewPortSize(), dpi);\r\n            // TODO: also expose Manga Mode for image folders?\r\n            if (tab->GetEngineType() == Engine_ComicBook || tab->GetEngineType() == Engine_ImageDir)\r\n                dm->SetDisplayR2L(state ? state->displayR2L : gGlobalPrefs->comicBookUI.cbxMangaMode);\r\n            if (prevCtrl && prevCtrl->AsFixed() && str::Eq(win->ctrl->FilePath(), prevCtrl->FilePath())) {\r\n                gRenderCache.KeepForDisplayModel(prevCtrl->AsFixed(), dm);\r\n                dm->CopyNavHistory(*prevCtrl->AsFixed());\r\n            }\r\n            // reload user annotations\r\n            dm->userAnnots = LoadFileModifications(args.fileName);\r\n            dm->userAnnotsModified = false;\r\n            dm->GetEngine()->UpdateUserAnnotations(dm->userAnnots);\r\n            // tell UI Automation about content change\r\n            if (win->uia_provider)\r\n                win->uia_provider->OnDocumentLoad(dm);\r\n        }\r\n        else if (win->AsChm()) {\r\n            win->AsChm()->SetParentHwnd(win->hwndCanvas);\r\n            win->ctrl->SetDisplayMode(displayMode);\r\n            ss.page = limitValue(ss.page, 1, win->ctrl->PageCount());\r\n            win->ctrl->GoToPage(ss.page, false);\r\n        }\r\n        else if (win->AsEbook()) {\r\n            if (prevCtrl && prevCtrl->AsEbook() && str::Eq(win->ctrl->FilePath(), prevCtrl->FilePath()))\r\n                win->ctrl->AsEbook()->CopyNavHistory(*prevCtrl->AsEbook());\r\n        }\r\n        else\r\n            CrashIf(true);\r\n    } else {\r\n        state = nullptr;\r\n    }\r\n    delete prevCtrl;\r\n\r\n    if (state) {\r\n        CrashIf(!win->IsDocLoaded());\r\n        zoomVirtual = prefs::conv::ToZoom(state->zoom, ZOOM_FIT_PAGE);\r\n        if (win->ctrl->ValidPageNo(ss.page)) {\r\n            if (ZOOM_FIT_CONTENT != zoomVirtual) {\r\n                ss.x = state->scrollPos.x;\r\n                ss.y = state->scrollPos.y;\r\n            }\r\n            // else let win->AsFixed()->Relayout() scroll to fit the page (again)\r\n        }\r\n        else if (win->ctrl->PageCount() > 0) {\r\n            ss.page = limitValue(ss.page, 1, win->ctrl->PageCount());\r\n        }\r\n        // else let win->ctrl->GoToPage(ss.page, false) verify the page number\r\n        rotation = state->rotation;\r\n        tab->tocState = *state->tocState;\r\n    }\r\n\r\n    // DisplayModel needs a valid zoom value before any relayout\r\n    // caused by showing/hiding UI elements happends\r\n    if (win->AsFixed())\r\n        win->AsFixed()->Relayout(zoomVirtual, rotation);\r\n    else if (win->IsDocLoaded())\r\n        win->ctrl->SetZoomVirtual(zoomVirtual);\r\n\r\n    // TODO: why is this needed?\r\n    if (!args.isNewWindow && win->IsDocLoaded())\r\n        win->RedrawAll();\r\n\r\n    SetFrameTitleForTab(tab, false);\r\n    UpdateUiForCurrentTab(win);\r\n\r\n    if (win->AsEbook()) {\r\n        // start ebook UI layout after UpdateUiForCurrentTab\r\n        // (prevents the need for an instant re-layout)\r\n        win->AsEbook()->StartLayouting(state ? state->reparseIdx : 0, displayMode);\r\n    }\r\n\r\n    if (HasPermission(Perm_DiskAccess) && tab->GetEngineType() == Engine_PDF) {\r\n        CrashIf(!win->AsFixed() || win->AsFixed()->pdfSync);\r\n        int res = Synchronizer::Create(args.fileName, win->AsFixed()->GetEngine(), &win->AsFixed()->pdfSync);\r\n        // expose SyncTeX in the UI\r\n        if (PDFSYNCERR_SUCCESS == res)\r\n            gGlobalPrefs->enableTeXEnhancements = true;\r\n    }\r\n\r\n    if (args.isNewWindow || args.placeWindow && state) {\r\n        if (args.isNewWindow && state && !state->windowPos.IsEmpty()) {\r\n            // Make sure it doesn't have a position like outside of the screen etc.\r\n            RectI rect = ShiftRectToWorkArea(state->windowPos);\r\n            // This shouldn't happen until !win.IsAboutWindow(), so that we don't\r\n            // accidentally update gGlobalState with this window's dimensions\r\n            MoveWindow(win->hwndFrame, rect);\r\n        }\r\n        if (args.showWin)\r\n            ShowWindow(win->hwndFrame, showType);\r\n        UpdateWindow(win->hwndFrame);\r\n    }\r\n\r\n    // if the window isn't shown and win.canvasRc is still empty, zoom\r\n    // has not been determined yet\r\n    // cf. https://code.google.com/p/sumatrapdf/issues/detail?id=2541\r\n    // AssertCrash(!win->IsDocLoaded() || !args.showWin || !win->canvasRc.IsEmpty() || win->AsChm());\r\n\r\n    SetSidebarVisibility(win, showToc, gGlobalPrefs->showFavorites);\r\n    // restore scroll state after the canvas size has been restored\r\n    if ((args.showWin || ss.page != 1) && win->AsFixed())\r\n        win->AsFixed()->SetScrollState(ss);\r\n\r\n    win->RedrawAll(true);\r\n    TabsOnChangedDoc(win);\r\n\r\n    if (!win->IsDocLoaded())\r\n        return;\r\n\r\n    ScopedMem<WCHAR> unsupported(win->ctrl->GetProperty(Prop_UnsupportedFeatures));\r\n    if (unsupported) {\r\n        unsupported.Set(str::Format(_TR(\"This document uses unsupported features (%s) and might not render properly\"), unsupported));\r\n        win->ShowNotification(unsupported, NOS_WARNING, NG_PERSISTENT_WARNING);\r\n    }\r\n\r\n    // This should only happen after everything else is ready\r\n    if ((args.isNewWindow || args.placeWindow) && args.showWin && showAsFullScreen)\r\n        EnterFullScreen(win);\r\n    if (!args.isNewWindow && win->presentation && win->ctrl)\r\n        win->ctrl->SetPresentationMode(true);\r\n}\r\n\r\nvoid ReloadDocument(WindowInfo *win, bool autorefresh)\r\n{\r\n    TabInfo *tab = win->currentTab;\r\n    if (!win->IsDocLoaded()) {\r\n        if (!autorefresh && tab) {\r\n            LoadArgs args(tab->filePath, win);\r\n            args.forceReuse = true;\r\n            LoadDocument(args);\r\n        }\r\n        return;\r\n    }\r\n\r\n    HwndPasswordUI pwdUI(win->hwndFrame);\r\n    Controller *ctrl = CreateControllerForFile(tab->filePath, &pwdUI, win);\r\n    // We don't allow PDF-repair if it is an autorefresh because\r\n    // a refresh event can occur before the file is finished being written,\r\n    // in which case the repair could fail. Instead, if the file is broken,\r\n    // we postpone the reload until the next autorefresh event\r\n    if (!ctrl && autorefresh) {\r\n        SetFrameTitleForTab(tab, true);\r\n        win::SetText(win->hwndFrame, tab->frameTitle);\r\n        return;\r\n    }\r\n\r\n    DisplayState *ds = NewDisplayState(tab->filePath);\r\n    tab->ctrl->UpdateDisplayState(ds);\r\n    UpdateDisplayStateWindowRect(*win, *ds);\r\n    UpdateSidebarDisplayState(win, tab, ds);\r\n    // Set the windows state based on the actual window's placement\r\n    ds->windowState = win->isFullScreen ? WIN_STATE_FULLSCREEN\r\n                    : IsZoomed(win->hwndFrame) ? WIN_STATE_MAXIMIZED\r\n                    : IsIconic(win->hwndFrame) ? WIN_STATE_MINIMIZED\r\n                    : WIN_STATE_NORMAL ;\r\n    ds->useDefaultState = false;\r\n\r\n    LoadArgs args(tab->filePath, win);\r\n    args.showWin = true;\r\n    args.placeWindow = false;\r\n    LoadDocIntoCurrentTab(args, ctrl, ds);\r\n\r\n    if (!ctrl) {\r\n        DeleteDisplayState(ds);\r\n        return;\r\n    }\r\n\r\n    tab->reloadOnFocus = false;\r\n\r\n    if (gGlobalPrefs->showStartPage) {\r\n        // refresh the thumbnail for this file\r\n        DisplayState *state = gFileHistory.Find(ds->filePath);\r\n        if (state)\r\n            CreateThumbnailForFile(*win, *state);\r\n    }\r\n\r\n    if (tab->AsFixed()) {\r\n        // save a newly remembered password into file history so that\r\n        // we don't ask again at the next refresh\r\n        ScopedMem<char> decryptionKey(tab->AsFixed()->GetEngine()->GetDecryptionKey());\r\n        if (decryptionKey) {\r\n            DisplayState *state = gFileHistory.Find(ds->filePath);\r\n            if (state && !str::Eq(state->decryptionKey, decryptionKey)) {\r\n                free(state->decryptionKey);\r\n                state->decryptionKey = decryptionKey.StealData();\r\n            }\r\n        }\r\n    }\r\n\r\n    DeleteDisplayState(ds);\r\n}\r\n\r\nstatic void CreateSidebar(WindowInfo* win)\r\n{\r\n    win->sidebarSplitter = CreateSplitter(win->hwndFrame, SplitterVert, win, SidebarSplitterCb);\r\n    CrashIf(!win->sidebarSplitter);\r\n    CreateToc(win);\r\n\r\n    win->favSplitter = CreateSplitter(win->hwndFrame, SplitterHoriz, win, FavSplitterCb);\r\n    CrashIf(!win->favSplitter);\r\n    CreateFavorites(win);\r\n\r\n    if (win->tocVisible) {\r\n        RepaintNow(win->hwndTocBox);\r\n    }\r\n\r\n    if (gGlobalPrefs->showFavorites) {\r\n        RepaintNow(win->hwndFavBox);\r\n   }\r\n}\r\n\r\nstatic void UpdateToolbarSidebarText(WindowInfo *win)\r\n{\r\n    UpdateToolbarPageText(win, -1);\r\n    UpdateToolbarFindText(win);\r\n    UpdateToolbarButtonsToolTipsForWindow(win);\r\n\r\n    SetLabel(win->tocLabelWithClose, _TR(\"Bookmarks\"));\r\n    SetLabel(win->favLabelWithClose, _TR(\"Favorites\"));\r\n}\r\n\r\nstatic WindowInfo* CreateWindowInfo()\r\n{\r\n    RectI windowPos = gGlobalPrefs->windowPos;\r\n    if (!windowPos.IsEmpty())\r\n        EnsureAreaVisibility(windowPos);\r\n    else\r\n        windowPos = GetDefaultWindowPos();\r\n\r\n    HWND hwndFrame = CreateWindow(\r\n            FRAME_CLASS_NAME, SUMATRA_WINDOW_TITLE,\r\n            WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,\r\n            windowPos.x, windowPos.y, windowPos.dx, windowPos.dy,\r\n            nullptr, nullptr,\r\n            GetModuleHandle(nullptr), nullptr);\r\n    if (!hwndFrame)\r\n        return nullptr;\r\n\r\n    AssertCrash(nullptr == FindWindowInfoByHwnd(hwndFrame));\r\n    WindowInfo *win = new WindowInfo(hwndFrame);\r\n\r\n    // don't add a WS_EX_STATICEDGE so that the scrollbars touch the\r\n    // screen's edge when maximized (cf. Fitts' law) and there are\r\n    // no additional adjustments needed when (un)maximizing\r\n    win->hwndCanvas = CreateWindow(\r\n            CANVAS_CLASS_NAME, nullptr,\r\n            WS_CHILD | WS_HSCROLL | WS_VSCROLL,\r\n            0, 0, 0, 0, /* position and size determined in OnSize */\r\n            hwndFrame, nullptr,\r\n            GetModuleHandle(nullptr), nullptr);\r\n    if (!win->hwndCanvas) {\r\n        delete win;\r\n        return nullptr;\r\n    }\r\n\r\n    if (gShowFrameRate) {\r\n        win->frameRateWnd = AllocFrameRateWnd(win->hwndCanvas);\r\n        CreateFrameRateWnd(win->frameRateWnd);\r\n    }\r\n\r\n    // hide scrollbars to avoid showing/hiding on empty window\r\n    ShowScrollBar(win->hwndCanvas, SB_BOTH, FALSE);\r\n\r\n    AssertCrash(!win->menu);\r\n    win->menu = BuildMenu(win);\r\n    win->isMenuHidden = !gGlobalPrefs->showMenubar;\r\n    if (!win->isMenuHidden)\r\n        SetMenu(win->hwndFrame, win->menu);\r\n\r\n    ShowWindow(win->hwndCanvas, SW_SHOW);\r\n    UpdateWindow(win->hwndCanvas);\r\n\r\n    win->hwndInfotip = CreateWindowEx(WS_EX_TOPMOST,\r\n        TOOLTIPS_CLASS, nullptr, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,\r\n        CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,\r\n        win->hwndCanvas, nullptr, GetModuleHandle(nullptr), nullptr);\r\n\r\n    CreateCaption(win);\r\n    CreateTabbar(win);\r\n    CreateToolbar(win);\r\n    CreateSidebar(win);\r\n    UpdateFindbox(win);\r\n    if (HasPermission(Perm_DiskAccess) && !gPluginMode)\r\n        DragAcceptFiles(win->hwndCanvas, TRUE);\r\n\r\n    gWindows.Append(win);\r\n    // needed for RTL languages\r\n    UpdateWindowRtlLayout(win);\r\n    UpdateToolbarSidebarText(win);\r\n\r\n    if (touch::SupportsGestures()) {\r\n        GESTURECONFIG gc = { 0, GC_ALLGESTURES, 0 };\r\n        touch::SetGestureConfig(win->hwndCanvas, 0, 1, &gc, sizeof(GESTURECONFIG));\r\n    }\r\n\r\n    SetTabsInTitlebar(win, gGlobalPrefs->useTabs);\r\n\r\n    return win;\r\n}\r\n\r\nWindowInfo *CreateAndShowWindowInfo(SessionData *data)\r\n{\r\n    // CreateWindowInfo shouldn't change the windowState value\r\n    int windowState = gGlobalPrefs->windowState;\r\n    WindowInfo *win = CreateWindowInfo();\r\n    if (!win)\r\n        return nullptr;\r\n    CrashIf(windowState != gGlobalPrefs->windowState);\r\n\r\n    if (data) {\r\n        windowState = data->windowState;\r\n        RectI rect = ShiftRectToWorkArea(data->windowPos);\r\n        MoveWindow(win->hwndFrame, rect);\r\n        // TODO: also restore data->sidebarDx\r\n    }\r\n\r\n    if (WIN_STATE_FULLSCREEN == windowState || WIN_STATE_MAXIMIZED == windowState)\r\n        ShowWindow(win->hwndFrame, SW_MAXIMIZE);\r\n    else\r\n        ShowWindow(win->hwndFrame, SW_SHOW);\r\n    UpdateWindow(win->hwndFrame);\r\n\r\n    SetSidebarVisibility(win, false, gGlobalPrefs->showFavorites);\r\n    ToolbarUpdateStateForWindow(win, true);\r\n\r\n    if (WIN_STATE_FULLSCREEN == windowState)\r\n        EnterFullScreen(win);\r\n    return win;\r\n}\r\n\r\nvoid DeleteWindowInfo(WindowInfo *win)\r\n{\r\n    DeletePropertiesWindow(win->hwndFrame);\r\n    gWindows.Remove(win);\r\n\r\n    ImageList_Destroy((HIMAGELIST)SendMessage(win->hwndToolbar, TB_GETIMAGELIST, 0, 0));\r\n    DragAcceptFiles(win->hwndCanvas, FALSE);\r\n\r\n    CrashIf(win->findThread && WaitForSingleObject(win->findThread, 0) == WAIT_TIMEOUT);\r\n    CrashIf(win->printThread && WaitForSingleObject(win->printThread, 0) == WAIT_TIMEOUT);\r\n\r\n    if (win->uia_provider) {\r\n        // tell UIA to release all objects cached in its store\r\n        uia::ReturnRawElementProvider(win->hwndCanvas, 0, 0, nullptr);\r\n    }\r\n\r\n    delete win;\r\n}\r\n\r\nstatic void RenameFileInHistory(const WCHAR *oldPath, const WCHAR *newPath)\r\n{\r\n    DisplayState *ds = gFileHistory.Find(newPath);\r\n    bool oldIsPinned = false;\r\n    int oldOpenCount = 0;\r\n    if (ds) {\r\n        oldIsPinned = ds->isPinned;\r\n        oldOpenCount = ds->openCount;\r\n        gFileHistory.Remove(ds);\r\n        // TODO: merge favorites as well?\r\n        if (ds->favorites->Count() > 0)\r\n            UpdateFavoritesTreeForAllWindows();\r\n        DeleteDisplayState(ds);\r\n    }\r\n    ds = gFileHistory.Find(oldPath);\r\n    if (ds) {\r\n        str::ReplacePtr(&ds->filePath, newPath);\r\n        // merge Frequently Read data, so that a file\r\n        // doesn't accidentally vanish from there\r\n        ds->isPinned = ds->isPinned || oldIsPinned;\r\n        ds->openCount += oldOpenCount;\r\n        // the thumbnail is recreated by LoadDocument\r\n        delete ds->thumbnail;\r\n        ds->thumbnail = nullptr;\r\n    }\r\n}\r\n\r\n// document path is either a file or a directory\r\n// (when browsing images inside directory).\r\nbool DocumentPathExists(const WCHAR *path)\r\n{\r\n    if (file::Exists(path) || dir::Exists(path))\r\n        return true;\r\n    if (str::FindChar(path + 2, ':')) {\r\n        // remove information needed for pointing at embedded documents\r\n        // (e.g. \"C:\\path\\file.pdf:3:0\") to check at least whether the\r\n        // container document exists\r\n        ScopedMem<WCHAR> realPath(str::DupN(path, str::FindChar(path + 2, ':') - path));\r\n        return file::Exists(realPath);\r\n    }\r\n    return false;\r\n}\r\n\r\n#if 0\r\n// Load a file into a new or existing window, show error message\r\n// if loading failed, set the right window position (based on history\r\n// settings for this file or default position), update file history,\r\n// update frequently read information, generate a thumbnail if necessary\r\n// TODO: write me\r\nstatic WindowInfo* LoadDocumentNew(LoadArgs& args)\r\n{\r\n    ScopedMem<WCHAR> fullPath(path::Normalize(args.fileName));\r\n    // TODO: try to find file on other drives if doesn't exist\r\n\r\n    CrashIf(true);\r\n    return nullptr;\r\n}\r\n#endif\r\n\r\nclass TabReloadHandler : public FileChangeObserver {\r\n    TabInfo *tab;\r\n\r\npublic:\r\n    explicit TabReloadHandler(TabInfo *tab) : tab(tab) { }\r\n\r\n    virtual void OnFileChanged() override {\r\n        // to prevent race conditions between file changes and closing tabs,\r\n        // use the tab only on the main UI thread\r\n        uitask::Post([=] {\r\n            WindowInfo *win = FindWindowInfoByTab(tab);\r\n            if (!win)\r\n                return;\r\n            tab->reloadOnFocus = true;\r\n            if (tab == win->currentTab) {\r\n                // delay the reload slightly, in case we get another request immediately after this one\r\n                SetTimer(win->hwndCanvas, AUTO_RELOAD_TIMER_ID, AUTO_RELOAD_DELAY_IN_MS, nullptr);\r\n            }\r\n        });\r\n    }\r\n};\r\n\r\n// TODO: eventually I would like to move all loading to be async. To achieve that\r\n// we need clear separatation of loading process into 2 phases: loading the\r\n// file (and showing progress/load failures in topmost window) and placing\r\n// the loaded document in the window (either by replacing document in existing\r\n// window or creating a new window for the document)\r\nWindowInfo* LoadDocument(LoadArgs& args)\r\n{\r\n    if (gCrashOnOpen)\r\n        CrashMe();\r\n\r\n    ScopedMem<WCHAR> fullPath(path::Normalize(args.fileName));\r\n    WindowInfo *win = args.win;\r\n\r\n    bool failEarly = win && !args.forceReuse && !DocumentPathExists(fullPath);\r\n    // try to find inexistent files with history data\r\n    // on a different removable drive before failing\r\n    if (failEarly && gFileHistory.Find(fullPath)) {\r\n        ScopedMem<WCHAR> adjPath(str::Dup(fullPath));\r\n        if (AdjustVariableDriveLetter(adjPath)) {\r\n            RenameFileInHistory(fullPath, adjPath);\r\n            fullPath.Set(adjPath.StealData());\r\n            failEarly = false;\r\n        }\r\n    }\r\n\r\n    // fail with a notification if the file doesn't exist and\r\n    // there is a window the user has just been interacting with\r\n    if (failEarly) {\r\n        ScopedMem<WCHAR> msg(str::Format(_TR(\"File %s not found\"), fullPath));\r\n        win->ShowNotification(msg, NOS_HIGHLIGHT);\r\n        // display the notification ASAP (prefs::Save() can introduce a notable delay)\r\n        win->RedrawAll(true);\r\n\r\n        if (gFileHistory.MarkFileInexistent(fullPath)) {\r\n            prefs::Save();\r\n            // update the Frequently Read list\r\n            if (1 == gWindows.Count() && gWindows.At(0)->IsAboutWindow())\r\n                gWindows.At(0)->RedrawAll(true);\r\n        }\r\n        return nullptr;\r\n    }\r\n\r\n    bool openNewTab = gGlobalPrefs->useTabs && !args.forceReuse;\r\n    if (openNewTab && !args.win) {\r\n        // modify the args so that we always reuse the same window\r\n        // TODO: enable the tab bar if tabs haven't been initialized\r\n        if (gWindows.Count() > 0) {\r\n            win = args.win = gWindows.Last();\r\n            args.isNewWindow = false;\r\n        }\r\n    }\r\n\r\n    if (!win && 1 == gWindows.Count() && gWindows.At(0)->IsAboutWindow()) {\r\n        win = gWindows.At(0);\r\n        args.win = win;\r\n        args.isNewWindow = false;\r\n    } else if (!win || !openNewTab && !args.forceReuse && win->IsDocLoaded()) {\r\n        WindowInfo *currWin = win;\r\n        win = CreateWindowInfo();\r\n        if (!win)\r\n            return nullptr;\r\n        args.win = win;\r\n        args.isNewWindow = true;\r\n        if (currWin) {\r\n            RememberFavTreeExpansionState(currWin);\r\n            win->expandedFavorites = currWin->expandedFavorites;\r\n        }\r\n    }\r\n\r\n    HwndPasswordUI pwdUI(win->hwndFrame);\r\n    Controller *ctrl = CreateControllerForFile(fullPath, &pwdUI, win);\r\n    // don't fail if a user tries to load an SMX file instead\r\n    if (!ctrl && IsModificationsFile(fullPath)) {\r\n        *(WCHAR *)path::GetExt(fullPath) = '\\0';\r\n        ctrl = CreateControllerForFile(fullPath, &pwdUI, win);\r\n    }\r\n\r\n    CrashIf(openNewTab && args.forceReuse);\r\n    if (win->IsAboutWindow()) {\r\n        // invalidate the links on the Frequently Read page\r\n        win->staticLinks.Reset();\r\n        // there's no tab to reuse at this point\r\n        args.forceReuse = false;\r\n    }\r\n    else {\r\n        CrashIf(!args.forceReuse && !openNewTab);\r\n        if (openNewTab) {\r\n            SaveCurrentTabInfo(args.win);\r\n        }\r\n        CloseDocumentInTab(win, true, args.forceReuse);\r\n    }\r\n    if (!args.forceReuse) {\r\n        // insert a new tab for the loaded document\r\n        win->currentTab = CreateNewTab(win, fullPath);\r\n    }\r\n    else {\r\n        win->currentTab->filePath.Set(str::Dup(fullPath));\r\n    }\r\n\r\n    args.fileName = fullPath;\r\n    // TODO: stop remembering/restoring window positions when using tabs?\r\n    args.placeWindow = !gGlobalPrefs->useTabs;\r\n    LoadDocIntoCurrentTab(args, ctrl);\r\n\r\n    if (gPluginMode) {\r\n        // hide the menu for embedded documents opened from the plugin\r\n        SetMenu(win->hwndFrame, nullptr);\r\n        return win;\r\n    }\r\n\r\n    if (!ctrl) {\r\n        if (gFileHistory.MarkFileInexistent(fullPath))\r\n            prefs::Save();\r\n        return win;\r\n    }\r\n\r\n    CrashIf(win->currentTab->watcher);\r\n    if (gGlobalPrefs->reloadModifiedDocuments) {\r\n        TabReloadHandler *observer = new TabReloadHandler(win->currentTab);\r\n        win->currentTab->watcher = FileWatcherSubscribe(win->currentTab->filePath, observer);\r\n    }\r\n\r\n    if (gGlobalPrefs->rememberOpenedFiles) {\r\n        CrashIf(!str::Eq(fullPath, win->currentTab->filePath));\r\n        DisplayState *ds = gFileHistory.MarkFileLoaded(fullPath);\r\n        if (gGlobalPrefs->showStartPage)\r\n            CreateThumbnailForFile(*win, *ds);\r\n        prefs::Save();\r\n    }\r\n\r\n    // Add the file also to Windows' recently used documents (this doesn't\r\n    // happen automatically on drag&drop, reopening from history, etc.)\r\n    if (HasPermission(Perm_DiskAccess) && !gPluginMode && !IsStressTesting())\r\n        SHAddToRecentDocs(SHARD_PATH, fullPath);\r\n\r\n    return win;\r\n}\r\n\r\n// Loads document data into the WindowInfo.\r\nvoid LoadModelIntoTab(WindowInfo *win, TabInfo *tdata)\r\n{\r\n    if (!win || !tdata) return;\r\n\r\n    CloseDocumentInTab(win, true);\r\n\r\n    win->currentTab = tdata;\r\n    win->ctrl = tdata->ctrl;\r\n\r\n    if (win->AsChm())\r\n        win->AsChm()->SetParentHwnd(win->hwndCanvas);\r\n    // prevent the ebook UI from redrawing before win->RedrawAll at the bottom\r\n    else if (win->AsEbook())\r\n        win->AsEbook()->EnableMessageHandling(false);\r\n    // tell UI Automation about content change\r\n    else if (win->AsFixed() && win->uia_provider)\r\n        win->uia_provider->OnDocumentLoad(win->AsFixed());\r\n\r\n    UpdateUiForCurrentTab(win);\r\n\r\n    if (win->presentation != PM_DISABLED)\r\n        SetSidebarVisibility(win, tdata->showTocPresentation, gGlobalPrefs->showFavorites);\r\n    else\r\n        SetSidebarVisibility(win, tdata->showToc, gGlobalPrefs->showFavorites);\r\n\r\n    if (win->AsFixed()) {\r\n        if (tdata->canvasRc != win->canvasRc)\r\n            win->ctrl->SetViewPortSize(win->GetViewPortSize());\r\n        DisplayModel *dm = win->AsFixed();\r\n        dm->SetScrollState(dm->GetScrollState());\r\n        if (dm->GetPresentationMode() != (win->presentation != PM_DISABLED))\r\n            dm->SetPresentationMode(!dm->GetPresentationMode());\r\n    }\r\n    else if (win->AsChm()) {\r\n        win->ctrl->GoToPage(win->ctrl->CurrentPageNo(), false);\r\n    }\r\n    else if (win->AsEbook()) {\r\n        win->AsEbook()->EnableMessageHandling(true);\r\n        if (tdata->canvasRc != win->canvasRc)\r\n            win->ctrl->SetViewPortSize(win->GetViewPortSize());\r\n    }\r\n    tdata->canvasRc = win->canvasRc;\r\n\r\n    win->showSelection = tdata->selectionOnPage != nullptr;\r\n    if (win->uia_provider)\r\n        win->uia_provider->OnSelectionChanged();\r\n\r\n    SetFocus(win->hwndFrame);\r\n    win->RedrawAll(true);\r\n\r\n    if (tdata->reloadOnFocus) {\r\n        tdata->reloadOnFocus = false;\r\n        ReloadDocument(win, true);\r\n    }\r\n}\r\n\r\nstatic void UpdatePageInfoHelper(WindowInfo *win, NotificationWnd *wnd, int pageNo)\r\n{\r\n    if (!win->ctrl->ValidPageNo(pageNo))\r\n        pageNo = win->ctrl->CurrentPageNo();\r\n    ScopedMem<WCHAR> pageInfo(str::Format(L\"%s %d / %d\", _TR(\"Page:\"), pageNo, win->ctrl->PageCount()));\r\n    if (win->ctrl->HasPageLabels()) {\r\n        ScopedMem<WCHAR> label(win->ctrl->GetPageLabel(pageNo));\r\n        pageInfo.Set(str::Format(L\"%s %s (%d / %d)\", _TR(\"Page:\"), label, pageNo, win->ctrl->PageCount()));\r\n    }\r\n    if (!wnd) {\r\n        int options = IsShiftPressed() ? NOS_PERSIST : NOS_DEFAULT;\r\n        win->ShowNotification(pageInfo, options, NG_PAGE_INFO_HELPER);\r\n    }\r\n    else {\r\n        wnd->UpdateMessage(pageInfo);\r\n    }\r\n}\r\n\r\nenum MeasurementUnit { Unit_pt, Unit_mm, Unit_in };\r\n\r\nstatic WCHAR *FormatCursorPosition(BaseEngine *engine, PointD pt, MeasurementUnit unit)\r\n{\r\n    if (pt.x < 0)\r\n        pt.x = 0;\r\n    if (pt.y < 0)\r\n        pt.y = 0;\r\n    pt.x /= engine->GetFileDPI();\r\n    pt.y /= engine->GetFileDPI();\r\n\r\n    float factor = Unit_pt == unit ? 72 : Unit_mm == unit ? 25.4f : 1;\r\n    const WCHAR *unitName = Unit_pt == unit ? L\"pt\" : Unit_mm == unit ? L\"mm\" : L\"in\";\r\n    ScopedMem<WCHAR> xPos(str::FormatFloatWithThousandSep(pt.x * factor));\r\n    ScopedMem<WCHAR> yPos(str::FormatFloatWithThousandSep(pt.y * factor));\r\n    if (unit != Unit_in) {\r\n        // use similar precision for all units\r\n        if (str::IsDigit(xPos[str::Len(xPos) - 2]))\r\n            xPos[str::Len(xPos) - 1] = '\\0';\r\n        if (str::IsDigit(yPos[str::Len(yPos) - 2]))\r\n            yPos[str::Len(yPos) - 1] = '\\0';\r\n    }\r\n    return str::Format(L\"%s x %s %s\", xPos, yPos, unitName);\r\n}\r\n\r\nvoid UpdateCursorPositionHelper(WindowInfo *win, PointI pos, NotificationWnd *wnd)\r\n{\r\n    static MeasurementUnit unit = Unit_pt;\r\n    // toggle measurement unit by repeatedly invoking the helper\r\n    if (!wnd && win->notifications->GetForGroup(NG_CURSOR_POS_HELPER)) {\r\n        unit = Unit_pt == unit ? Unit_mm : Unit_mm == unit ? Unit_in : Unit_pt;\r\n        wnd = win->notifications->GetForGroup(NG_CURSOR_POS_HELPER);\r\n    }\r\n\r\n    CrashIf(!win->AsFixed());\r\n    BaseEngine *engine = win->AsFixed()->GetEngine();\r\n    PointD pt = win->AsFixed()->CvtFromScreen(pos);\r\n    ScopedMem<WCHAR> posStr(FormatCursorPosition(engine, pt, unit)), selStr;\r\n    if (!win->selectionMeasure.IsEmpty()) {\r\n        pt = PointD(win->selectionMeasure.dx, win->selectionMeasure.dy);\r\n        selStr.Set(FormatCursorPosition(engine, pt, unit));\r\n    }\r\n\r\n    ScopedMem<WCHAR> posInfo(str::Format(L\"%s %s\", _TR(\"Cursor position:\"), posStr));\r\n    if (selStr)\r\n        posInfo.Set(str::Format(L\"%s - %s %s\", posInfo, _TR(\"Selection:\"), selStr));\r\n    if (!wnd)\r\n        win->ShowNotification(posInfo, NOS_PERSIST, NG_CURSOR_POS_HELPER);\r\n    else\r\n        wnd->UpdateMessage(posInfo);\r\n}\r\n\r\nvoid AssociateExeWithPdfExtension()\r\n{\r\n    if (!HasPermission(Perm_RegistryAccess)) return;\r\n\r\n    DoAssociateExeWithPdfExtension(HKEY_CURRENT_USER);\r\n    DoAssociateExeWithPdfExtension(HKEY_LOCAL_MACHINE);\r\n\r\n    SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST | SHCNF_FLUSHNOWAIT, 0, 0);\r\n\r\n    // Remind the user, when a different application takes over\r\n    str::ReplacePtr(&gGlobalPrefs->associatedExtensions, L\".pdf\");\r\n    gGlobalPrefs->associateSilently = false;\r\n}\r\n\r\n// TODO: actually restore the session on startup depending on\r\n//       gGlobalPrefs->restoreSession\r\nstatic void RememberSessionState()\r\n{\r\n    if (!gGlobalPrefs->rememberOpenedFiles)\r\n        return;\r\n\r\n    ResetSessionState(gGlobalPrefs->sessionData);\r\n    for (WindowInfo *win : gWindows) {\r\n        if (win->tabs.Count() == 0)\r\n            continue;\r\n        SessionData *data = NewSessionData();\r\n        for (TabInfo *tab : win->tabs) {\r\n            DisplayState *ds = NewDisplayState(tab->filePath);\r\n            if (tab->ctrl)\r\n                tab->ctrl->UpdateDisplayState(ds);\r\n            // TODO: pageNo should be good enough, as canvas size is restored as well\r\n            if (tab->AsEbook() && tab->ctrl)\r\n                ds->pageNo = tab->ctrl->CurrentPageNo();\r\n            ds->showToc = tab->showToc;\r\n            *ds->tocState = tab->tocState;\r\n            data->tabStates->Append(NewTabState(ds));\r\n            DeleteDisplayState(ds);\r\n        }\r\n        data->tabIndex = win->tabs.Find(win->currentTab) + 1;\r\n        // TODO: allow recording this state without changing gGlobalPrefs\r\n        RememberDefaultWindowPosition(*win);\r\n        data->windowState = gGlobalPrefs->windowState;\r\n        data->windowPos = gGlobalPrefs->windowPos;\r\n        data->sidebarDx = gGlobalPrefs->sidebarDx;\r\n        gGlobalPrefs->sessionData->Append(data);\r\n    }\r\n}\r\n\r\n#if defined(SUPPORTS_AUTO_UPDATE) && !defined(HAS_PUBLIC_APP_KEY)\r\n#error Auto-update without authentication of the downloaded data is not recommended\r\n#endif\r\n\r\n#if defined(SUPPORTS_AUTO_UPDATE) || defined(DEBUG)\r\nstatic void OnMenuExit();\r\n\r\nbool AutoUpdateInitiate(const char *updateData)\r\n{\r\n    SquareTree tree(updateData);\r\n    SquareTreeNode *node = tree.root ? tree.root->GetChild(\"SumatraPDF\") : nullptr;\r\n    CrashIf(!node);\r\n\r\n    bool installer = HasBeenInstalled();\r\n    SquareTreeNode *data = node->GetChild(installer ? \"Installer\" : \"Portable\");\r\n    if (!data)\r\n        return false;\r\n    const char *url = data->GetValue(\"URL\");\r\n    const char *hash = data->GetValue(\"Hash\");\r\n    if (!url || !hash || !str::EndsWithI(url, \".exe\"))\r\n        return false;\r\n\r\n    ScopedMem<WCHAR> exeUrl(str::conv::FromUtf8(url));\r\n    HttpRsp rsp;\r\n    if (!HttpGet(exeUrl, &rsp))\r\n        return false;\r\n\r\n    unsigned char digest[32];\r\n    CalcSHA2Digest((const unsigned char *)rsp.data.Get(), rsp.data.Size(), digest);\r\n    ScopedMem<char> fingerPrint(_MemToHex(&digest));\r\n    if (!str::EqI(fingerPrint, hash))\r\n        return false;\r\n\r\n    ScopedMem<WCHAR> updateExe, updateArgs;\r\n    if (installer) {\r\n        ScopedMem<WCHAR> tmpDir(path::GetTempPath());\r\n        updateExe.Set(path::Join(tmpDir, L\"SumatraPDF-install-update.exe\"));\r\n        // TODO: make the installer delete itself after the update?\r\n        updateArgs.Set(str::Dup(L\"-autoupdate\"));\r\n    }\r\n    else {\r\n        ScopedMem<WCHAR> thisExe(GetExePath());\r\n        updateExe.Set(str::Join(thisExe, L\"-update.exe\"));\r\n        updateArgs.Set(str::Format(L\"-autoupdate replace:\\\"%s\\\"\", thisExe));\r\n    }\r\n\r\n    bool ok = file::WriteAll(updateExe, rsp.data.Get(), rsp.data.Size());\r\n    if (!ok)\r\n        return false;\r\n\r\n    // remember currently opened files for reloading after the update\r\n    CrashIf(gGlobalPrefs->reopenOnce->Count() > 0);\r\n#if 0\r\n    RememberSessionState();\r\n    gGlobalPrefs->reopenOnce->Append(str::Dup(L\"SessionData\"));\r\n#else\r\n    for (WindowInfo *win : gWindows) {\r\n        for (TabInfo *tab : win->tabs) {\r\n            gGlobalPrefs->reopenOnce->Append(str::Dup(tab->filePath));\r\n        }\r\n    }\r\n#endif\r\n    // save session before launching the installer (which force-quits SumatraPDF)\r\n    if (installer)\r\n        prefs::Save();\r\n\r\n    ok = LaunchFile(updateExe, updateArgs);\r\n    if (ok)\r\n        OnMenuExit();\r\n    else {\r\n        gGlobalPrefs->reopenOnce->FreeMembers();\r\n#if 0\r\n        ResetSessionState(gGlobalPrefs->sessionData);\r\n#endif\r\n    }\r\n    return ok;\r\n}\r\n#endif\r\n\r\n/* The format used for SUMATRA_UPDATE_INFO_URL looks as follows:\r\n\r\n[SumatraPDF]\r\n# the first line must start with SumatraPDF (optionally as INI header)\r\nLatest 2.6\r\n# Latest must be the version number of the version currently offered for download\r\nStable 2.5.3\r\n# Stable is optional and indicates the oldest version for which automated update\r\n# checks don't yet report the available update\r\n\r\n# further information can be added, e.g. the following experimental subkey for\r\n# auto-updating (requires SUPPORTS_AUTO_UPDATE)\r\nPortable [\r\n    URL: <download URL for the uncompressed portable .exe>\r\n    Hash <SHA-256 hash of that file>\r\n]\r\n\r\n# to allow safe transmission over http, the file may also be signed:\r\n# Signature sha1:<SHA-1 signature to be verified using IDD_PUBLIC_APP_KEY>\r\n*/\r\n\r\nstatic DWORD ShowAutoUpdateDialog(HWND hParent, HttpRsp *rsp, bool silent)\r\n{\r\n    if (rsp->error != 0)\r\n        return rsp->error;\r\n    if (rsp->httpStatusCode != 200)\r\n        return ERROR_INTERNET_INVALID_URL;\r\n    if (!str::StartsWith(rsp->url.Get(), SUMATRA_UPDATE_INFO_URL))\r\n        return ERROR_INTERNET_INVALID_URL;\r\n    str::Str<char> *data = &rsp->data;\r\n    if (0 == data->Size())\r\n        return ERROR_INTERNET_CONNECTION_ABORTED;\r\n\r\n    // See https://code.google.com/p/sumatrapdf/issues/detail?id=725\r\n    // If a user configures os-wide proxy that is not regular ie proxy\r\n    // (which we pick up) we might get complete garbage in response to\r\n    // our query. Make sure to check whether the returned data is sane.\r\n    if (!str::StartsWith(data->Get(), '[' == data->At(0) ? \"[SumatraPDF]\" : \"SumatraPDF\"))\r\n        return ERROR_INTERNET_LOGIN_FAILURE;\r\n\r\n#ifdef HAS_PUBLIC_APP_KEY\r\n    size_t pubkeyLen;\r\n    const char *pubkey = LoadTextResource(IDD_PUBLIC_APP_KEY, &pubkeyLen);\r\n    CrashIf(!pubkey);\r\n    bool ok = VerifySHA1Signature(data->Get(), data->Size(), nullptr, pubkey, pubkeyLen);\r\n    if (!ok)\r\n        return ERROR_INTERNET_SEC_CERT_ERRORS;\r\n#endif\r\n\r\n    SquareTree tree(data->Get());\r\n    SquareTreeNode *node = tree.root ? tree.root->GetChild(\"SumatraPDF\") : nullptr;\r\n    const char *latest = node ? node->GetValue(\"Latest\") : nullptr;\r\n    if (!latest || !IsValidProgramVersion(latest))\r\n        return ERROR_INTERNET_INCORRECT_FORMAT;\r\n\r\n    ScopedMem<WCHAR> verTxt(str::conv::FromUtf8(latest));\r\n    if (CompareVersion(verTxt, UPDATE_CHECK_VER) <= 0) {\r\n        /* if automated => don't notify that there is no new version */\r\n        if (!silent)\r\n            MessageBoxWarning(hParent, _TR(\"You have the latest version.\"), _TR(\"SumatraPDF Update\"));\r\n        return 0;\r\n    }\r\n\r\n    if (silent) {\r\n        const char *stable = node->GetValue(\"Stable\");\r\n        if (stable && IsValidProgramVersion(stable) &&\r\n            CompareVersion(ScopedMem<WCHAR>(str::conv::FromUtf8(stable)), UPDATE_CHECK_VER) <= 0) {\r\n            // don't update just yet if the older version is still marked as stable\r\n            return 0;\r\n        }\r\n    }\r\n\r\n    // if automated, respect gGlobalPrefs->versionToSkip\r\n    if (silent && str::EqI(gGlobalPrefs->versionToSkip, verTxt))\r\n        return 0;\r\n\r\n    // ask whether to download the new version and allow the user to\r\n    // either open the browser, do nothing or don't be reminded of\r\n    // this update ever again\r\n    bool skipThisVersion = false;\r\n    INT_PTR res = Dialog_NewVersionAvailable(hParent, UPDATE_CHECK_VER, verTxt, &skipThisVersion);\r\n    if (skipThisVersion) {\r\n        free(gGlobalPrefs->versionToSkip);\r\n        gGlobalPrefs->versionToSkip = verTxt.StealData();\r\n    }\r\n    if (IDYES == res) {\r\n#ifdef SUPPORTS_AUTO_UPDATE\r\n        if (AutoUpdateInitiate(data->Get()))\r\n            return 0;\r\n#endif\r\n        LaunchBrowser(SVN_UPDATE_LINK);\r\n    }\r\n    prefs::Save();\r\n\r\n    return 0;\r\n}\r\n\r\n\r\n// prevent multiple update tasks from happening simultaneously\r\n// (this might e.g. happen if a user checks manually very quickly after startup)\r\nbool gUpdateTaskInProgress = false;\r\n\r\nstatic void ProcessAutoUpdateCheckResult(HWND hwnd, HttpRsp *rsp, bool autoCheck)\r\n{\r\n    DWORD error = ShowAutoUpdateDialog(hwnd, rsp, autoCheck);\r\n    if (error != 0 && !autoCheck) {\r\n        // notify the user about network error during a manual update check\r\n        ScopedMem<WCHAR> msg(str::Format(_TR(\"Can't connect to the Internet (error %#x).\"), error));\r\n        MessageBoxWarning(hwnd, msg, _TR(\"SumatraPDF Update\"));\r\n    }\r\n}\r\n\r\n// start auto-update check by downloading auto-update information from url\r\n// on a background thread and processing the retrieved data on ui thread\r\n// if autoCheck is true, this is a check *not* triggered by explicit action\r\n// of the user and therefore will show less UI\r\nvoid UpdateCheckAsync(WindowInfo *win, bool autoCheck)\r\n{\r\n    if (!HasPermission(Perm_InternetAccess))\r\n        return;\r\n\r\n    // For auto-check, only check if at least a day passed since last check\r\n    if (autoCheck) {\r\n        // don't check if the timestamp or version to skip can't be updated\r\n        // (mainly in plugin mode, stress testing and restricted settings)\r\n        if (!HasPermission(Perm_SavePreferences))\r\n            return;\r\n\r\n        // don't check for updates at the first start, so that privacy\r\n        // sensitive users can disable the update check in time\r\n        FILETIME never = { 0 };\r\n        if (FileTimeEq(gGlobalPrefs->timeOfLastUpdateCheck, never))\r\n            return;\r\n\r\n        FILETIME currentTimeFt;\r\n        GetSystemTimeAsFileTime(&currentTimeFt);\r\n        int secs = FileTimeDiffInSecs(currentTimeFt, gGlobalPrefs->timeOfLastUpdateCheck);\r\n        // if secs < 0 => somethings wrong, so ignore that case\r\n        if ((secs >= 0) && (secs < SECS_IN_DAY))\r\n            return;\r\n    }\r\n\r\n    GetSystemTimeAsFileTime(&gGlobalPrefs->timeOfLastUpdateCheck);\r\n    if (gUpdateTaskInProgress) {\r\n        return;\r\n    }\r\n    gUpdateTaskInProgress = true;\r\n    HWND hwnd = win->hwndFrame;\r\n    const WCHAR *url = SUMATRA_UPDATE_INFO_URL L\"?v=\" UPDATE_CHECK_VER;\r\n    HttpGetAsync(url, [=](HttpRsp* rsp) {\r\n        gUpdateTaskInProgress = false;\r\n        uitask::Post([=] {\r\n            ProcessAutoUpdateCheckResult(hwnd, rsp, autoCheck);\r\n            delete rsp;\r\n        });\r\n    });\r\n}\r\n\r\nstatic void RerenderEverything()\r\n{\r\n    for (size_t i = 0; i < gWindows.Count(); i++) {\r\n        if (!gWindows.At(i)->AsFixed())\r\n            continue;\r\n        DisplayModel *dm = gWindows.At(i)->AsFixed();\r\n        gRenderCache.CancelRendering(dm);\r\n        gRenderCache.KeepForDisplayModel(dm, dm);\r\n        gWindows.At(i)->RedrawAll(true);\r\n    }\r\n}\r\n\r\nvoid GetFixedPageUiColors(COLORREF& text, COLORREF& bg)\r\n{\r\n    if (gGlobalPrefs->useSysColors) {\r\n        text = GetSysColor(COLOR_WINDOWTEXT);\r\n        bg = GetSysColor(COLOR_WINDOW);\r\n    }\r\n    else {\r\n        text = gGlobalPrefs->fixedPageUI.textColor;\r\n        bg = gGlobalPrefs->fixedPageUI.backgroundColor;\r\n    }\r\n    if (gGlobalPrefs->fixedPageUI.invertColors) {\r\n        std::swap(text, bg);\r\n    }\r\n}\r\n\r\nvoid GetEbookUiColors(COLORREF& text, COLORREF& bg)\r\n{\r\n    if (gGlobalPrefs->useSysColors) {\r\n        text = GetSysColor(COLOR_WINDOWTEXT);\r\n        bg = GetSysColor(COLOR_WINDOW);\r\n    }\r\n    else {\r\n        text = gGlobalPrefs->ebookUI.textColor;\r\n        bg = gGlobalPrefs->ebookUI.backgroundColor;\r\n    }\r\n    // TODO: respect gGlobalPrefs->fixedPageUI.invertColors?\r\n}\r\n\r\nvoid UpdateDocumentColors()\r\n{\r\n    // TODO: only do this if colors have actually changed?\r\n    for (WindowInfo *win : gWindows) {\r\n        if (win->AsEbook()) {\r\n            win->AsEbook()->UpdateDocumentColors();\r\n            UpdateTocColors(win);\r\n        }\r\n    }\r\n\r\n    COLORREF text, bg;\r\n    GetFixedPageUiColors(text, bg);\r\n\r\n    if ((text == gRenderCache.textColor) &&\r\n        (bg == gRenderCache.backgroundColor)) {\r\n            return; // colors didn't change\r\n    }\r\n\r\n    gRenderCache.textColor = text;\r\n    gRenderCache.backgroundColor = bg;\r\n    RerenderEverything();\r\n}\r\n\r\nstatic void OnMenuExit()\r\n{\r\n    if (gPluginMode)\r\n        return;\r\n\r\n    for (WindowInfo *win : gWindows) {\r\n        if (!MayCloseWindow(win))\r\n            return;\r\n    }\r\n\r\n    RememberSessionState();\r\n\r\n    // CloseWindow removes the WindowInfo from gWindows,\r\n    // so use a stable copy for iteration\r\n    Vec<WindowInfo *> toClose = gWindows;\r\n    for (WindowInfo *win : toClose) {\r\n        CloseWindow(win, true);\r\n    }\r\n}\r\n\r\n// closes a document inside a WindowInfo and optionally turns it into\r\n// about window (set keepUIEnabled if a new document will be loaded\r\n// into the tab right afterwards and LoadDocIntoCurrentTab would revert\r\n// the UI disabling afterwards anyway)\r\nstatic void CloseDocumentInTab(WindowInfo *win, bool keepUIEnabled, bool deleteModel)\r\n{\r\n    bool wasntFixed = !win->AsFixed();\r\n    if (win->AsChm())\r\n        win->AsChm()->RemoveParentHwnd();\r\n    ClearTocBox(win);\r\n    AbortFinding(win, true);\r\n    delete win->linkOnLastButtonDown;\r\n    win->linkOnLastButtonDown = nullptr;\r\n    win->fwdSearchMark.show = false;\r\n    if (win->uia_provider)\r\n        win->uia_provider->OnDocumentUnload();\r\n    win->ctrl = nullptr;\r\n    if (deleteModel) {\r\n        delete win->currentTab->tocRoot;\r\n        win->currentTab->tocRoot = nullptr;\r\n        delete win->currentTab->ctrl;\r\n        win->currentTab->ctrl = nullptr;\r\n        FileWatcherUnsubscribe(win->currentTab->watcher);\r\n        win->currentTab->watcher = nullptr;\r\n    }\r\n    else {\r\n        win->currentTab = nullptr;\r\n    }\r\n    win->notifications->RemoveForGroup(NG_RESPONSE_TO_ACTION);\r\n    win->notifications->RemoveForGroup(NG_PAGE_INFO_HELPER);\r\n    win->notifications->RemoveForGroup(NG_CURSOR_POS_HELPER);\r\n    // TODO: this can cause a mouse capture to stick around when called from LoadModelIntoTab (cf. OnSelectionStop)\r\n    win->mouseAction = MA_IDLE;\r\n\r\n    DeletePropertiesWindow(win->hwndFrame);\r\n    DeleteOldSelectionInfo(win, true);\r\n\r\n    if (!keepUIEnabled) {\r\n        SetSidebarVisibility(win, false, gGlobalPrefs->showFavorites);\r\n        ToolbarUpdateStateForWindow(win, true);\r\n        UpdateToolbarPageText(win, 0);\r\n        UpdateToolbarFindText(win);\r\n        UpdateFindbox(win);\r\n        UpdateTabWidth(win);\r\n        if (wasntFixed) {\r\n            // restore the full menu and toolbar\r\n            RebuildMenuBarForWindow(win);\r\n            ShowOrHideToolbar(win);\r\n        }\r\n        ShowScrollBar(win->hwndCanvas, SB_BOTH, FALSE);\r\n        win->RedrawAll();\r\n        win::SetText(win->hwndFrame, SUMATRA_WINDOW_TITLE);\r\n        CrashIf(win->tabs.Count() != 0 || win->currentTab);\r\n    }\r\n\r\n    // Note: this causes https://code.google.com/p/sumatrapdf/issues/detail?id=2702. For whatever reason\r\n    // edit ctrl doesn't receive WM_KILLFOCUS if we do SetFocus() here, even if we call SetFocus() later\r\n    // on.\r\n    //SetFocus(win->hwndFrame);\r\n#ifdef DEBUG\r\n    // cf. https://code.google.com/p/sumatrapdf/issues/detail?id=2039\r\n    // HeapValidate() is left here to help us catch the possibility that the fix\r\n    // in FileWatcher::SynchronousAbort() isn't correct\r\n    HeapValidate((HANDLE)_get_heap_handle(), 0, nullptr);\r\n#endif\r\n}\r\n\r\n// closes the current tab, selecting the next one\r\n// if there's only a single tab left, the window is closed if there\r\n// are other windows, else the Frequently Read page is displayed\r\nvoid CloseTab(WindowInfo *win, bool quitIfLast)\r\n{\r\n    CrashIf(!win);\r\n    if (!win) return;\r\n\r\n    size_t tabCount = win->tabs.Count();\r\n    if (tabCount == 1 || (tabCount == 0 && quitIfLast)) {\r\n        if (MayCloseWindow(win))\r\n            CloseWindow(win, quitIfLast);\r\n    }\r\n    else {\r\n        CrashIf(gPluginMode && gWindows.Find(win) == 0);\r\n        AbortFinding(win, true);\r\n        TabsOnCloseDoc(win);\r\n    }\r\n}\r\n\r\nbool MayCloseWindow(WindowInfo *win)\r\n{\r\n    CrashIf(!win);\r\n    if (!win)\r\n        return false;\r\n    // a plugin window should only be closed when its parent is destroyed\r\n    if (gPluginMode && gWindows.Find(win) == 0)\r\n        return false;\r\n\r\n    if (win->printThread && !win->printCanceled && WaitForSingleObject(win->printThread, 0) == WAIT_TIMEOUT) {\r\n        int res = MessageBox(win->hwndFrame, _TR(\"Printing is still in progress. Abort and quit?\"), _TR(\"Printing in progress.\"), MB_ICONEXCLAMATION | MB_YESNO | MbRtlReadingMaybe());\r\n        if (IDNO == res)\r\n            return false;\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\n/* Close the document associated with window 'hwnd'.\r\n   Closes the window unless this is the last window in which\r\n   case it switches to empty window and disables the \"File\\Close\"\r\n   menu item. */\r\nvoid CloseWindow(WindowInfo *win, bool quitIfLast, bool forceClose)\r\n{\r\n    CrashIf(!win);\r\n    if (!win) return;\r\n\r\n    CrashIf(forceClose && !quitIfLast);\r\n    if (forceClose) quitIfLast = true;\r\n\r\n    // when used as an embedded plugin, closing should happen automatically\r\n    // when the parent window is destroyed (cf. WM_DESTROY)\r\n    if (gPluginMode && gWindows.Find(win) == 0 && !forceClose)\r\n        return;\r\n\r\n    AbortFinding(win, true);\r\n    AbortPrinting(win);\r\n\r\n    if (win->AsFixed())\r\n        win->AsFixed()->dontRenderFlag = true;\r\n    else if (win->AsEbook())\r\n        win->AsEbook()->EnableMessageHandling(false);\r\n    if (win->presentation)\r\n        ExitFullScreen(win);\r\n\r\n    bool lastWindow = (1 == gWindows.Count());\r\n    // RememberDefaultWindowPosition becomes a no-op once the window is hidden\r\n    RememberDefaultWindowPosition(*win);\r\n    // hide the window before saving prefs (closing seems slightly faster that way)\r\n    if (!lastWindow || quitIfLast)\r\n        ShowWindow(win->hwndFrame, SW_HIDE);\r\n    if (lastWindow) {\r\n        // don't call RememberSessionState if OnMenuExit already has\r\n        // also don't remember a single document (unless quitting through Menu -> Exit)\r\n        if (quitIfLast && gGlobalPrefs->sessionData->Count() == 0 && win->tabs.Count() > 1)\r\n            RememberSessionState();\r\n        prefs::Save();\r\n    }\r\n    else {\r\n        // this happens otherwise in prefs::Save\r\n        for (TabInfo *tab : win->tabs) {\r\n            UpdateTabFileDisplayStateForWin(win, tab);\r\n        }\r\n    }\r\n    TabsOnCloseWindow(win);\r\n\r\n    if (forceClose) {\r\n        // WM_DESTROY has already been sent, so don't destroy win->hwndFrame again\r\n        DeleteWindowInfo(win);\r\n    } else if (lastWindow && !quitIfLast) {\r\n        /* last window - don't delete it */\r\n        CloseDocumentInTab(win);\r\n        SetFocus(win->hwndFrame);\r\n        CrashIf(!gWindows.Contains(win));\r\n    } else {\r\n        HWND hwndToDestroy = win->hwndFrame;\r\n        DeleteWindowInfo(win);\r\n        DestroyWindow(hwndToDestroy);\r\n    }\r\n\r\n    if (lastWindow && quitIfLast) {\r\n        AssertCrash(0 == gWindows.Count());\r\n        PostQuitMessage(0);\r\n    }\r\n}\r\n\r\n// returns false if no filter has been appended\r\nstatic bool AppendFileFilterForDoc(Controller *ctrl, str::Str<WCHAR>& fileFilter)\r\n{\r\n    EngineType type = Engine_None;\r\n    if (ctrl->AsFixed())\r\n        type = ctrl->AsFixed()->engineType;\r\n    else if (ctrl->AsChm())\r\n        type = Engine_Chm;\r\n    else if (ctrl->AsEbook()) {\r\n        switch (ctrl->AsEbook()->GetDocType()) {\r\n        case Doc_Epub: type = Engine_Epub; break;\r\n        case Doc_Fb2:  type = Engine_Fb2;  break;\r\n        case Doc_Mobi: type = Engine_Mobi; break;\r\n        case Doc_Pdb:  type = Engine_Pdb;  break;\r\n        default: type = Engine_None; break;\r\n        }\r\n    }\r\n    switch (type) {\r\n        case Engine_XPS:    fileFilter.Append(_TR(\"XPS documents\")); break;\r\n        case Engine_DjVu:   fileFilter.Append(_TR(\"DjVu documents\")); break;\r\n        case Engine_ComicBook: fileFilter.Append(_TR(\"Comic books\")); break;\r\n        case Engine_Image:  fileFilter.AppendFmt(_TR(\"Image files (*.%s)\"), ctrl->DefaultFileExt() + 1); break;\r\n        case Engine_ImageDir: return false; // only show \"All files\"\r\n        case Engine_PS:     fileFilter.Append(_TR(\"Postscript documents\")); break;\r\n        case Engine_Chm:    fileFilter.Append(_TR(\"CHM documents\")); break;\r\n        case Engine_Epub:   fileFilter.Append(_TR(\"EPUB ebooks\")); break;\r\n        case Engine_Mobi:   fileFilter.Append(_TR(\"Mobi documents\")); break;\r\n        case Engine_Fb2:    fileFilter.Append(_TR(\"FictionBook documents\")); break;\r\n        case Engine_Pdb:    fileFilter.Append(_TR(\"PalmDoc documents\")); break;\r\n        case Engine_Txt:    fileFilter.Append(_TR(\"Text documents\")); break;\r\n        default:            fileFilter.Append(_TR(\"PDF documents\")); break;\r\n    }\r\n    return true;\r\n}\r\n\r\nstatic void OnMenuSaveAs(WindowInfo& win)\r\n{\r\n    if (!HasPermission(Perm_DiskAccess)) return;\r\n    if (!win.IsDocLoaded()) return;\r\n\r\n    const WCHAR *srcFileName = win.ctrl->FilePath();\r\n    ScopedMem<WCHAR> urlName;\r\n    if (gPluginMode) {\r\n        urlName.Set(url::GetFileName(gPluginURL));\r\n        // fall back to a generic \"filename\" instead of the more confusing temporary filename\r\n        srcFileName = urlName ? urlName : L\"filename\";\r\n    }\r\n\r\n    AssertCrash(srcFileName);\r\n    if (!srcFileName) return;\r\n\r\n    BaseEngine *engine = win.AsFixed() ? win.AsFixed()->GetEngine() : nullptr;\r\n    bool canConvertToTXT = engine && !engine->IsImageCollection() && win.currentTab->GetEngineType() != Engine_Txt;\r\n    bool canConvertToPDF = engine && win.currentTab->GetEngineType() != Engine_PDF;\r\n#ifndef DEBUG\r\n    // not ready for document types other than PS and image collections\r\n    if (canConvertToPDF && win.currentTab->GetEngineType() != Engine_PS && !engine->IsImageCollection())\r\n        canConvertToPDF = false;\r\n#endif\r\n#ifndef DISABLE_DOCUMENT_RESTRICTIONS\r\n    // Can't save a document's content as plain text if text copying isn't allowed\r\n    if (engine && !engine->AllowsCopyingText())\r\n        canConvertToTXT = false;\r\n    // don't allow converting to PDF when printing isn't allowed\r\n    if (engine && !engine->AllowsPrinting())\r\n        canConvertToPDF = false;\r\n#endif\r\n    CrashIf(canConvertToTXT && (!engine || engine->IsImageCollection() || Engine_Txt == win.currentTab->GetEngineType()));\r\n    CrashIf(canConvertToPDF && (!engine || Engine_PDF == win.currentTab->GetEngineType()));\r\n\r\n    const WCHAR *defExt = win.ctrl->DefaultFileExt();\r\n    // Prepare the file filters (use \\1 instead of \\0 so that the\r\n    // double-zero terminated string isn't cut by the string handling\r\n    // methods too early on)\r\n    str::Str<WCHAR> fileFilter(256);\r\n    if (AppendFileFilterForDoc(win.ctrl, fileFilter))\r\n        fileFilter.AppendFmt(L\"\\1*%s\\1\", defExt);\r\n    if (canConvertToTXT) {\r\n        fileFilter.Append(_TR(\"Text documents\"));\r\n        fileFilter.Append(L\"\\1*.txt\\1\");\r\n    }\r\n    if (canConvertToPDF) {\r\n        fileFilter.Append(_TR(\"PDF documents\"));\r\n        fileFilter.Append(L\"\\1*.pdf\\1\");\r\n    }\r\n    fileFilter.Append(_TR(\"All files\"));\r\n    fileFilter.Append(L\"\\1*.*\\1\");\r\n    str::TransChars(fileFilter.Get(), L\"\\1\", L\"\\0\");\r\n\r\n    WCHAR dstFileName[MAX_PATH];\r\n    str::BufSet(dstFileName, dimof(dstFileName), path::GetBaseName(srcFileName));\r\n    if (str::FindChar(dstFileName, ':')) {\r\n        // handle embed-marks (for embedded PDF documents):\r\n        // remove the container document's extension and include\r\n        // the embedding reference in the suggested filename\r\n        WCHAR *colon = (WCHAR *)str::FindChar(dstFileName, ':');\r\n        str::TransChars(colon, L\":\", L\"_\");\r\n        WCHAR *ext;\r\n        for (ext = colon; ext > dstFileName && *ext != '.'; ext--);\r\n        if (ext == dstFileName)\r\n            ext = colon;\r\n        memmove(ext, colon, (str::Len(colon) + 1) * sizeof(WCHAR));\r\n    }\r\n    // Remove the extension so that it can be re-added depending on the chosen filter\r\n    else if (str::EndsWithI(dstFileName, defExt))\r\n        dstFileName[str::Len(dstFileName) - str::Len(defExt)] = '\\0';\r\n\r\n    OPENFILENAME ofn = { 0 };\r\n    ofn.lStructSize = sizeof(ofn);\r\n    ofn.hwndOwner = win.hwndFrame;\r\n    ofn.lpstrFile = dstFileName;\r\n    ofn.nMaxFile = dimof(dstFileName);\r\n    ofn.lpstrFilter = fileFilter.Get();\r\n    ofn.nFilterIndex = 1;\r\n    ofn.lpstrDefExt = defExt + 1;\r\n    ofn.Flags = OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY;\r\n    // note: explicitly not setting lpstrInitialDir so that the OS\r\n    // picks a reasonable default (in particular, we don't want this\r\n    // in plugin mode, which is likely the main reason for saving as...)\r\n\r\n    bool ok = GetSaveFileName(&ofn);\r\n    if (!ok)\r\n        return;\r\n\r\n    WCHAR * realDstFileName = dstFileName;\r\n    bool convertToTXT = canConvertToTXT && str::EndsWithI(dstFileName, L\".txt\");\r\n    bool convertToPDF = canConvertToPDF && str::EndsWithI(dstFileName, L\".pdf\");\r\n\r\n    // Make sure that the file has a valid ending\r\n    if (!str::EndsWithI(dstFileName, defExt) && !convertToTXT && !convertToPDF) {\r\n        if (canConvertToTXT && 2 == ofn.nFilterIndex) {\r\n            defExt = L\".txt\";\r\n            convertToTXT = true;\r\n        }\r\n        else if (canConvertToPDF && (canConvertToTXT ? 3 : 2) == (int)ofn.nFilterIndex) {\r\n            defExt = L\".pdf\";\r\n            convertToPDF = true;\r\n        }\r\n        realDstFileName = str::Format(L\"%s%s\", dstFileName, defExt);\r\n    }\r\n\r\n    ScopedMem<WCHAR> errorMsg;\r\n    // Extract all text when saving as a plain text file\r\n    if (convertToTXT) {\r\n        str::Str<WCHAR> text(1024);\r\n        for (int pageNo = 1; pageNo <= win.ctrl->PageCount(); pageNo++) {\r\n            WCHAR *tmp = engine->ExtractPageText(pageNo, L\"\\r\\n\", nullptr, Target_Export);\r\n            text.AppendAndFree(tmp);\r\n        }\r\n\r\n        ScopedMem<char> textUTF8(str::conv::ToUtf8(text.LendData()));\r\n        ScopedMem<char> textUTF8BOM(str::Join(UTF8_BOM, textUTF8));\r\n        ok = file::WriteAll(realDstFileName, textUTF8BOM, str::Len(textUTF8BOM));\r\n    }\r\n    // Convert the file into a PDF one\r\n    else if (convertToPDF) {\r\n        PdfCreator::SetProducerName(APP_NAME_STR L\" \" CURR_VERSION_STR);\r\n        ok = engine->SaveFileAsPDF(realDstFileName, gGlobalPrefs->annotationDefaults.saveIntoDocument);\r\n        if (!ok) {\r\n#ifdef DEBUG\r\n            // rendering includes all page annotations\r\n            ok = PdfCreator::RenderToFile(realDstFileName, engine);\r\n#endif\r\n        }\r\n        else if (!gGlobalPrefs->annotationDefaults.saveIntoDocument)\r\n            SaveFileModifictions(realDstFileName, win.AsFixed()->userAnnots);\r\n    }\r\n    // Recreate inexistant files from memory...\r\n    else if (!file::Exists(srcFileName) && engine) {\r\n        ok = engine->SaveFileAs(realDstFileName, gGlobalPrefs->annotationDefaults.saveIntoDocument);\r\n    }\r\n    // ... as well as files containing annotations ...\r\n    else if (gGlobalPrefs->annotationDefaults.saveIntoDocument &&\r\n             engine && engine->SupportsAnnotation(true)) {\r\n        ok = engine->SaveFileAs(realDstFileName, true);\r\n    }\r\n    // ... else just copy the file\r\n    else if (!path::IsSame(srcFileName, realDstFileName)) {\r\n        WCHAR *msgBuf;\r\n        ok = CopyFile(srcFileName, realDstFileName, FALSE);\r\n        if (ok) {\r\n            // Make sure that the copy isn't write-locked or hidden\r\n            const DWORD attributesToDrop = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;\r\n            DWORD attributes = GetFileAttributes(realDstFileName);\r\n            if (attributes != INVALID_FILE_ATTRIBUTES && (attributes & attributesToDrop))\r\n                SetFileAttributes(realDstFileName, attributes & ~attributesToDrop);\r\n        } else if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, GetLastError(), 0, (LPWSTR)&msgBuf, 0, nullptr)) {\r\n            errorMsg.Set(str::Format(L\"%s\\n\\n%s\", _TR(\"Failed to save a file\"), msgBuf));\r\n            LocalFree(msgBuf);\r\n        }\r\n    }\r\n    if (ok && win.AsFixed() && win.AsFixed()->userAnnots && win.AsFixed()->userAnnotsModified &&\r\n        !convertToTXT && !convertToPDF) {\r\n        if (!gGlobalPrefs->annotationDefaults.saveIntoDocument ||\r\n            !engine || !engine->SupportsAnnotation(true)) {\r\n            ok = SaveFileModifictions(realDstFileName, win.AsFixed()->userAnnots);\r\n        }\r\n        if (ok && path::IsSame(srcFileName, realDstFileName))\r\n            win.AsFixed()->userAnnotsModified = false;\r\n    }\r\n    if (!ok)\r\n        MessageBoxWarning(win.hwndFrame, errorMsg ? errorMsg : _TR(\"Failed to save a file\"));\r\n\r\n    if (ok && IsUntrustedFile(win.ctrl->FilePath(), gPluginURL) && !convertToTXT)\r\n        file::SetZoneIdentifier(realDstFileName);\r\n\r\n    if (realDstFileName != dstFileName)\r\n        free(realDstFileName);\r\n}\r\n\r\nstatic void OnMenuRenameFile(WindowInfo &win)\r\n{\r\n    if (!HasPermission(Perm_DiskAccess)) return;\r\n    if (!win.IsDocLoaded()) return;\r\n    if (gPluginMode) return;\r\n\r\n    ScopedMem<WCHAR> srcFileName(str::Dup(win.ctrl->FilePath()));\r\n    // this happens e.g. for embedded documents and directories\r\n    if (!file::Exists(srcFileName))\r\n        return;\r\n\r\n    // Prepare the file filters (use \\1 instead of \\0 so that the\r\n    // double-zero terminated string isn't cut by the string handling\r\n    // methods too early on)\r\n    const WCHAR *defExt = win.ctrl->DefaultFileExt();\r\n    str::Str<WCHAR> fileFilter(256);\r\n    bool ok = AppendFileFilterForDoc(win.ctrl, fileFilter);\r\n    CrashIf(!ok);\r\n    fileFilter.AppendFmt(L\"\\1*%s\\1\", defExt);\r\n    str::TransChars(fileFilter.Get(), L\"\\1\", L\"\\0\");\r\n\r\n    WCHAR dstFileName[MAX_PATH];\r\n    str::BufSet(dstFileName, dimof(dstFileName), path::GetBaseName(srcFileName));\r\n    // Remove the extension so that it can be re-added depending on the chosen filter\r\n    if (str::EndsWithI(dstFileName, defExt))\r\n        dstFileName[str::Len(dstFileName) - str::Len(defExt)] = '\\0';\r\n\r\n    ScopedMem<WCHAR> initDir(path::GetDir(srcFileName));\r\n\r\n    OPENFILENAME ofn = { 0 };\r\n    ofn.lStructSize = sizeof(ofn);\r\n    ofn.hwndOwner = win.hwndFrame;\r\n    ofn.lpstrFile = dstFileName;\r\n    ofn.nMaxFile = dimof(dstFileName);\r\n    ofn.lpstrFilter = fileFilter.Get();\r\n    ofn.nFilterIndex = 1;\r\n    // note: the other two dialogs are named \"Open\" and \"Save As\"\r\n    ofn.lpstrTitle = _TR(\"Rename To\");\r\n    ofn.lpstrInitialDir = initDir;\r\n    ofn.lpstrDefExt = defExt + 1;\r\n    ofn.Flags = OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY;\r\n\r\n    ok = GetSaveFileName(&ofn);\r\n    if (!ok)\r\n        return;\r\n\r\n    UpdateTabFileDisplayStateForWin(&win, win.currentTab);\r\n    CloseDocumentInTab(&win, true, true);\r\n    SetFocus(win.hwndFrame);\r\n\r\n    DWORD flags = MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING;\r\n    BOOL moveOk = MoveFileEx(srcFileName.Get(), dstFileName, flags);\r\n    if (!moveOk) {\r\n        LogLastError();\r\n        LoadArgs args(srcFileName, &win);\r\n        args.forceReuse = true;\r\n        LoadDocument(args);\r\n        win.ShowNotification(_TR(\"Failed to rename the file!\"), NOS_WARNING);\r\n        return;\r\n    }\r\n\r\n    ScopedMem<WCHAR> newPath(path::Normalize(dstFileName));\r\n    RenameFileInHistory(srcFileName, newPath);\r\n\r\n    LoadArgs args(dstFileName, &win);\r\n    args.forceReuse = true;\r\n    LoadDocument(args);\r\n}\r\n\r\nstatic void OnMenuSaveBookmark(WindowInfo& win)\r\n{\r\n    if (!HasPermission(Perm_DiskAccess) || gPluginMode) return;\r\n    if (!win.IsDocLoaded()) return;\r\n\r\n    const WCHAR *defExt = win.ctrl->DefaultFileExt();\r\n\r\n    WCHAR dstFileName[MAX_PATH];\r\n    // Remove the extension so that it can be replaced with .lnk\r\n    str::BufSet(dstFileName, dimof(dstFileName), path::GetBaseName(win.ctrl->FilePath()));\r\n    str::TransChars(dstFileName, L\":\", L\"_\");\r\n    if (str::EndsWithI(dstFileName, defExt))\r\n        dstFileName[str::Len(dstFileName) - str::Len(defExt)] = '\\0';\r\n\r\n    // Prepare the file filters (use \\1 instead of \\0 so that the\r\n    // double-zero terminated string isn't cut by the string handling\r\n    // methods too early on)\r\n    ScopedMem<WCHAR> fileFilter(str::Format(L\"%s\\1*.lnk\\1\", _TR(\"Bookmark Shortcuts\")));\r\n    str::TransChars(fileFilter, L\"\\1\", L\"\\0\");\r\n\r\n    OPENFILENAME ofn = { 0 };\r\n    ofn.lStructSize = sizeof(ofn);\r\n    ofn.hwndOwner = win.hwndFrame;\r\n    ofn.lpstrFile = dstFileName;\r\n    ofn.nMaxFile = dimof(dstFileName);\r\n    ofn.lpstrFilter = fileFilter;\r\n    ofn.nFilterIndex = 1;\r\n    ofn.lpstrDefExt = L\"lnk\";\r\n    ofn.Flags = OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY;\r\n\r\n    if (!GetSaveFileName(&ofn))\r\n        return;\r\n\r\n    ScopedMem<WCHAR> fileName(str::Dup(dstFileName));\r\n    if (!str::EndsWithI(dstFileName, L\".lnk\"))\r\n        fileName.Set(str::Join(dstFileName, L\".lnk\"));\r\n\r\n    ScrollState ss(win.ctrl->CurrentPageNo());\r\n    if (win.AsFixed())\r\n        ss = win.AsFixed()->GetScrollState();\r\n    const WCHAR *viewMode = prefs::conv::FromDisplayMode(win.ctrl->GetDisplayMode());\r\n    ScopedMem<WCHAR> ZoomVirtual(str::Format(L\"%.2f\", win.ctrl->GetZoomVirtual()));\r\n    if (ZOOM_FIT_PAGE == win.ctrl->GetZoomVirtual())\r\n        ZoomVirtual.Set(str::Dup(L\"fitpage\"));\r\n    else if (ZOOM_FIT_WIDTH == win.ctrl->GetZoomVirtual())\r\n        ZoomVirtual.Set(str::Dup(L\"fitwidth\"));\r\n    else if (ZOOM_FIT_CONTENT == win.ctrl->GetZoomVirtual())\r\n        ZoomVirtual.Set(str::Dup(L\"fitcontent\"));\r\n\r\n    ScopedMem<WCHAR> exePath(GetExePath());\r\n    ScopedMem<WCHAR> args(str::Format(L\"\\\"%s\\\" -page %d -view \\\"%s\\\" -zoom %s -scroll %d,%d\",\r\n                          win.ctrl->FilePath(), ss.page, viewMode, ZoomVirtual, (int)ss.x, (int)ss.y));\r\n    ScopedMem<WCHAR> label(win.ctrl->GetPageLabel(ss.page));\r\n    ScopedMem<WCHAR> desc(str::Format(_TR(\"Bookmark shortcut to page %s of %s\"),\r\n                          label, path::GetBaseName(win.ctrl->FilePath())));\r\n\r\n    CreateShortcut(fileName, exePath, args, desc, 1);\r\n}\r\n\r\n#if 0\r\n// code adapted from https://support.microsoft.com/kb/131462/en-us\r\nstatic UINT_PTR CALLBACK FileOpenHook(HWND hDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    switch (uiMsg) {\r\n    case WM_INITDIALOG:\r\n        SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR)lParam);\r\n        break;\r\n    case WM_NOTIFY:\r\n        if (((LPOFNOTIFY)lParam)->hdr.code == CDN_SELCHANGE) {\r\n            LPOPENFILENAME lpofn = (LPOPENFILENAME)GetWindowLongPtr(hDlg, GWLP_USERDATA);\r\n            // make sure that the filename buffer is large enough to hold\r\n            // all the selected filenames\r\n            int cbLength = CommDlg_OpenSave_GetSpec(GetParent(hDlg), nullptr, 0) + MAX_PATH;\r\n            if (cbLength >= 0 && lpofn->nMaxFile < (DWORD)cbLength) {\r\n                WCHAR *oldBuffer = lpofn->lpstrFile;\r\n                lpofn->lpstrFile = (LPWSTR)realloc(lpofn->lpstrFile, cbLength * sizeof(WCHAR));\r\n                if (lpofn->lpstrFile)\r\n                    lpofn->nMaxFile = cbLength;\r\n                else\r\n                    lpofn->lpstrFile = oldBuffer;\r\n            }\r\n        }\r\n        break;\r\n    }\r\n\r\n    return 0;\r\n}\r\n#endif\r\n\r\nvoid OnMenuOpen(WindowInfo& win)\r\n{\r\n    if (!HasPermission(Perm_DiskAccess)) return;\r\n    // don't allow opening different files in plugin mode\r\n    if (gPluginMode)\r\n        return;\r\n\r\n    const struct {\r\n        const WCHAR *name; /* nullptr if only to include in \"All supported documents\" */\r\n        const WCHAR *filter;\r\n        bool available;\r\n    } fileFormats[] = {\r\n        { _TR(\"PDF documents\"),         L\"*.pdf\",       true },\r\n        { _TR(\"XPS documents\"),         L\"*.xps;*.oxps\",true },\r\n        { _TR(\"DjVu documents\"),        L\"*.djvu\",      true },\r\n        { _TR(\"Postscript documents\"),  L\"*.ps;*.eps\",  PsEngine::IsAvailable() },\r\n        { _TR(\"Comic books\"),           L\"*.cbz;*.cbr;*.cb7;*.cbt\", true },\r\n        { _TR(\"CHM documents\"),         L\"*.chm\",       true },\r\n        { _TR(\"EPUB ebooks\"),           L\"*.epub\",      true },\r\n        { _TR(\"Mobi documents\"),        L\"*.mobi\",      true },\r\n        { _TR(\"FictionBook documents\"), L\"*.fb2;*.fb2z;*.zfb2;*.fb2.zip\", true },\r\n        { _TR(\"PalmDoc documents\"),     L\"*.pdb;*.prc\", true },\r\n        { nullptr, /* multi-page images */ L\"*.tif;*.tiff\",true },\r\n        { _TR(\"Text documents\"),        L\"*.txt;*.log;*.nfo;rfc*.txt;file_id.diz;read.me;*.tcr\", gGlobalPrefs->ebookUI.useFixedPageUI },\r\n    };\r\n    // Prepare the file filters (use \\1 instead of \\0 so that the\r\n    // double-zero terminated string isn't cut by the string handling\r\n    // methods too early on)\r\n    str::Str<WCHAR> fileFilter;\r\n    fileFilter.Append(_TR(\"All supported documents\"));\r\n    fileFilter.Append(L'\\1');\r\n    for (int i = 0; i < dimof(fileFormats); i++) {\r\n        if (fileFormats[i].available) {\r\n            fileFilter.Append(fileFormats[i].filter);\r\n            fileFilter.Append(';');\r\n        }\r\n    }\r\n    CrashIf(fileFilter.Last() != L';');\r\n    fileFilter.Last() = L'\\1';\r\n    for (int i = 0; i < dimof(fileFormats); i++) {\r\n        if (fileFormats[i].available && fileFormats[i].name) {\r\n            fileFilter.Append(fileFormats[i].name);\r\n            fileFilter.Append(L'\\1');\r\n            fileFilter.Append(fileFormats[i].filter);\r\n            fileFilter.Append(L'\\1');\r\n        }\r\n    }\r\n    fileFilter.Append(_TR(\"All files\"));\r\n    fileFilter.Append(L\"\\1*.*\\1\");\r\n    str::TransChars(fileFilter.Get(), L\"\\1\", L\"\\0\");\r\n\r\n    OPENFILENAME ofn = { 0 };\r\n    ofn.lStructSize = sizeof(ofn);\r\n    ofn.hwndOwner = win.hwndFrame;\r\n\r\n    ofn.lpstrFilter = fileFilter.Get();\r\n    ofn.nFilterIndex = 1;\r\n    ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY |\r\n                OFN_ALLOWMULTISELECT | OFN_EXPLORER;\r\n\r\n    // OFN_ENABLEHOOK disables the new Open File dialog under Windows Vista\r\n    // and later, so don't use it and just allocate enough memory to contain\r\n    // several dozen file paths and hope that this is enough\r\n    // TODO: Use IFileOpenDialog instead (requires a Vista SDK, though)\r\n    ofn.nMaxFile = MAX_PATH * 100;\r\n#if 0\r\n    if (!IsVistaOrGreater())\r\n    {\r\n        ofn.lpfnHook = FileOpenHook;\r\n        ofn.Flags |= OFN_ENABLEHOOK;\r\n        ofn.nMaxFile = MAX_PATH / 2;\r\n    }\r\n    // note: ofn.lpstrFile can be reallocated by GetOpenFileName -> FileOpenHook\r\n#endif\r\n    ScopedMem<WCHAR> file(AllocArray<WCHAR>(ofn.nMaxFile));\r\n    ofn.lpstrFile = file;\r\n\r\n    if (!GetOpenFileName(&ofn))\r\n        return;\r\n\r\n    WCHAR *fileName = ofn.lpstrFile + ofn.nFileOffset;\r\n    if (*(fileName - 1)) {\r\n        // special case: single filename without nullptr separator\r\n        LoadArgs args(ofn.lpstrFile, &win);\r\n        LoadDocument(args);\r\n        return;\r\n    }\r\n\r\n    while (*fileName) {\r\n        ScopedMem<WCHAR> filePath(path::Join(ofn.lpstrFile, fileName));\r\n        if (filePath) {\r\n            LoadArgs args(filePath, &win);\r\n            LoadDocument(args);\r\n        }\r\n        fileName += str::Len(fileName) + 1;\r\n    }\r\n}\r\n\r\nstatic void BrowseFolder(WindowInfo& win, bool forward)\r\n{\r\n    AssertCrash(!win.IsAboutWindow());\r\n    if (win.IsAboutWindow()) return;\r\n    if (!HasPermission(Perm_DiskAccess) || gPluginMode) return;\r\n\r\n    TabInfo *tab = win.currentTab;\r\n    WStrVec files;\r\n    ScopedMem<WCHAR> pattern(path::GetDir(tab->filePath));\r\n    // TODO: make pattern configurable (for users who e.g. want to skip single images)?\r\n    pattern.Set(path::Join(pattern, L\"*\"));\r\n    if (!CollectPathsFromDirectory(pattern, files))\r\n        return;\r\n\r\n    // remove unsupported files that have never been successfully loaded\r\n    for (size_t i = files.Count(); i > 0; i--) {\r\n        if (!EngineManager::IsSupportedFile(files.At(i - 1), false, gGlobalPrefs->ebookUI.useFixedPageUI) &&\r\n            !Doc::IsSupportedFile(files.At(i - 1)) && !gFileHistory.Find(files.At(i - 1))) {\r\n            free(files.PopAt(i - 1));\r\n        }\r\n    }\r\n\r\n    if (!files.Contains(tab->filePath))\r\n        files.Append(str::Dup(tab->filePath));\r\n    files.SortNatural();\r\n\r\n    int index = files.Find(tab->filePath);\r\n    if (forward)\r\n        index = (index + 1) % files.Count();\r\n    else\r\n        index = (int)(index + files.Count() - 1) % files.Count();\r\n\r\n    // TODO: check for unsaved modifications\r\n    UpdateTabFileDisplayStateForWin(&win, tab);\r\n    LoadArgs args(files.At(index), &win);\r\n    args.forceReuse = true;\r\n    LoadDocument(args);\r\n}\r\n\r\nstatic void RelayoutFrame(WindowInfo *win, bool updateToolbars=true, int sidebarDx=-1)\r\n{\r\n    ClientRect rc(win->hwndFrame);\r\n    // don't relayout while the window is minimized\r\n    if (rc.IsEmpty())\r\n        return;\r\n\r\n    if (PM_BLACK_SCREEN == win->presentation || PM_WHITE_SCREEN == win->presentation) {\r\n        // make the black/white canvas cover the entire window\r\n        MoveWindow(win->hwndCanvas, rc);\r\n        return;\r\n    }\r\n\r\n    DeferWinPosHelper dh;\r\n\r\n    // Tabbar and toolbar at the top\r\n    if (!win->presentation && !win->isFullScreen) {\r\n        if (win->tabsInTitlebar) {\r\n            if (dwm::IsCompositionEnabled()) {\r\n                int frameThickness = GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CXPADDEDBORDER);\r\n                rc.y += frameThickness;\r\n                rc.dy -= frameThickness;\r\n            }\r\n            float scale = IsZoomed(win->hwndFrame) ? 1.f : CAPTION_TABBAR_HEIGHT_FACTOR;\r\n            int captionHeight = GetTabbarHeight(win->hwndFrame, scale);\r\n            if (updateToolbars) {\r\n                int captionWidth;\r\n                RECT capButtons;\r\n                if (dwm::IsCompositionEnabled() &&\r\n                    SUCCEEDED(dwm::GetWindowAttribute(win->hwndFrame, DWMWA_CAPTION_BUTTON_BOUNDS, &capButtons, sizeof(RECT)))) {\r\n                        WindowRect wr(win->hwndFrame);\r\n                        POINT pt = { wr.x + capButtons.left, wr.y + capButtons.top };\r\n                        ScreenToClient(win->hwndFrame, &pt);\r\n                        if (IsUIRightToLeft())\r\n                            captionWidth = rc.x + rc.dx - pt.x;\r\n                        else\r\n                            captionWidth = pt.x - rc.x;\r\n                }\r\n                else\r\n                    captionWidth = rc.dx;\r\n                dh.SetWindowPos(win->hwndCaption, nullptr, rc.x, rc.y, captionWidth, captionHeight, SWP_NOZORDER);\r\n            }\r\n            rc.y += captionHeight;\r\n            rc.dy -= captionHeight;\r\n        }\r\n        else if (win->tabsVisible) {\r\n            int tabHeight = GetTabbarHeight(win->hwndFrame);\r\n            if (updateToolbars)\r\n                dh.SetWindowPos(win->hwndTabBar, nullptr, rc.x, rc.y, rc.dx, tabHeight, SWP_NOZORDER);\r\n            // TODO: show tab bar also for About window (or hide the toolbar so that it doesn't jump around)\r\n            if (!win->IsAboutWindow()) {\r\n                rc.y += tabHeight;\r\n                rc.dy -= tabHeight;\r\n            }\r\n        }\r\n    }\r\n    if (gGlobalPrefs->showToolbar && !win->presentation && !win->isFullScreen && !win->AsEbook()) {\r\n        if (updateToolbars) {\r\n            WindowRect rcRebar(win->hwndReBar);\r\n            dh.SetWindowPos(win->hwndReBar, nullptr, rc.x, rc.y, rc.dx, rcRebar.dy, SWP_NOZORDER);\r\n        }\r\n        WindowRect rcRebar(win->hwndReBar);\r\n        rc.y += rcRebar.dy;\r\n        rc.dy -= rcRebar.dy;\r\n    }\r\n\r\n    // ToC and Favorites sidebars at the left\r\n    bool showFavorites = gGlobalPrefs->showFavorites && !gPluginMode && HasPermission(Perm_DiskAccess);\r\n    bool tocVisible = win->tocVisible;\r\n    if (tocVisible || showFavorites) {\r\n        SizeI toc = sidebarDx < 0 ? ClientRect(win->hwndTocBox).Size() : SizeI(sidebarDx, rc.y);\r\n        if (0 == toc.dx) {\r\n            // TODO: use saved sidebarDx from saved preferences?\r\n            toc.dx = rc.dx / 4;\r\n        }\r\n        // make sure that the sidebar is never too wide or too narrow\r\n        // note: requires that the main frame is at least 2 * SIDEBAR_MIN_WIDTH\r\n        //       wide (cf. OnFrameGetMinMaxInfo)\r\n        toc.dx = limitValue(toc.dx, SIDEBAR_MIN_WIDTH, rc.dx / 2);\r\n\r\n        toc.dy = !tocVisible ? 0 :\r\n                 !showFavorites ? rc.dy :\r\n                 gGlobalPrefs->tocDy ? limitValue(gGlobalPrefs->tocDy, 0, rc.dy) :\r\n                 rc.dy / 2; // default value\r\n        if (tocVisible && showFavorites)\r\n            toc.dy = limitValue(toc.dy, TOC_MIN_DY, rc.dy - TOC_MIN_DY);\r\n\r\n        if (tocVisible) {\r\n            RectI rToc(rc.TL(), toc);\r\n            dh.MoveWindow(win->hwndTocBox, rToc);\r\n            if (showFavorites) {\r\n                RectI rSplitV(rc.x, rc.y + toc.dy, toc.dx, SPLITTER_DY);\r\n                dh.MoveWindow(GetHwnd(win->favSplitter), rSplitV);\r\n                toc.dy += SPLITTER_DY;\r\n            }\r\n        }\r\n        if (showFavorites) {\r\n            RectI rFav(rc.x, rc.y + toc.dy, toc.dx, rc.dy - toc.dy);\r\n            dh.MoveWindow(win->hwndFavBox, rFav);\r\n        }\r\n        RectI rSplitH(rc.x + toc.dx, rc.y, SPLITTER_DX, rc.dy);\r\n        dh.MoveWindow(GetHwnd(win->sidebarSplitter), rSplitH);\r\n\r\n        rc.x += toc.dx + SPLITTER_DX;\r\n        rc.dx -= toc.dx + SPLITTER_DX;\r\n    }\r\n\r\n    dh.MoveWindow(win->hwndCanvas, rc);\r\n\r\n    dh.End();\r\n\r\n    // TODO: if a document with ToC and a broken document are loaded\r\n    //       and the first document is closed with the ToC still visible,\r\n    //       we have tocVisible but !win->ctrl\r\n    if (tocVisible && win->ctrl) {\r\n        // the ToC selection may change due to resizing\r\n        // (and SetSidebarVisibility relies on this for initialization)\r\n        if (win->ctrl->AsEbook())\r\n            UpdateTocSelection(win, win->ctrl->AsEbook()->CurrentTocPageNo());\r\n        else\r\n            UpdateTocSelection(win, win->ctrl->CurrentPageNo());\r\n    }\r\n}\r\n\r\nstatic void FrameOnSize(WindowInfo* win, int dx, int dy)\r\n{\r\n    UNUSED(dx); UNUSED(dy);\r\n    RelayoutFrame(win);\r\n\r\n    if (win->presentation || win->isFullScreen) {\r\n        RectI fullscreen = GetFullscreenRect(win->hwndFrame);\r\n        WindowRect rect(win->hwndFrame);\r\n        // Windows XP sometimes seems to change the window size on it's own\r\n        if (rect != fullscreen && rect != GetVirtualScreenRect()) {\r\n            MoveWindow(win->hwndFrame, fullscreen);\r\n        }\r\n    }\r\n}\r\n\r\nvoid RelayoutWindow(WindowInfo *win)\r\n{\r\n    RelayoutFrame(win);\r\n}\r\n\r\nvoid SetCurrentLanguageAndRefreshUI(const char *langCode)\r\n{\r\n    if (!langCode || str::Eq(langCode, trans::GetCurrentLangCode()))\r\n        return;\r\n    SetCurrentLang(langCode);\r\n\r\n    for (WindowInfo *win : gWindows) {\r\n        UpdateWindowRtlLayout(win);\r\n        RebuildMenuBarForWindow(win);\r\n        UpdateToolbarSidebarText(win);\r\n        // About page text is translated during (re)drawing\r\n        if (win->IsAboutWindow())\r\n            win->RedrawAll(true);\r\n    }\r\n\r\n    prefs::Save();\r\n}\r\n\r\nstatic void OnMenuChangeLanguage(HWND hwnd)\r\n{\r\n    const char *newLangCode = Dialog_ChangeLanguge(hwnd, trans::GetCurrentLangCode());\r\n    SetCurrentLanguageAndRefreshUI(newLangCode);\r\n}\r\n\r\nstatic void OnMenuViewShowHideToolbar()\r\n{\r\n    gGlobalPrefs->showToolbar = !gGlobalPrefs->showToolbar;\r\n    for (WindowInfo *win : gWindows) {\r\n        ShowOrHideToolbar(win);\r\n    }\r\n}\r\n\r\nstatic void OnMenuAdvancedOptions()\r\n{\r\n    if (!HasPermission(Perm_DiskAccess) || !HasPermission(Perm_SavePreferences))\r\n        return;\r\n\r\n    ScopedMem<WCHAR> path(prefs::GetSettingsPath());\r\n    // TODO: disable/hide the menu item when there's no prefs file\r\n    //       (happens e.g. when run in portable mode from a CD)?\r\n    LaunchFile(path, nullptr, L\"open\");\r\n}\r\n\r\nstatic void OnMenuOptions(HWND hwnd)\r\n{\r\n    if (!HasPermission(Perm_SavePreferences)) return;\r\n\r\n    if (IDOK != Dialog_Settings(hwnd, gGlobalPrefs))\r\n        return;\r\n\r\n    if (!gGlobalPrefs->rememberOpenedFiles) {\r\n        gFileHistory.Clear(true);\r\n        CleanUpThumbnailCache(gFileHistory);\r\n    }\r\n    UpdateDocumentColors();\r\n\r\n    // note: ideally we would also update state for useTabs changes but that's complicated since\r\n    // to do it right we would have to convert tabs to windows. When moving no tabs -> tabs,\r\n    // there's no problem. When moving tabs -> no tabs, a half solution would be to only\r\n    // call SetTabsInTitlebar() for windows that have only one tab, but that's somewhat inconsistent\r\n    prefs::Save();\r\n}\r\n\r\nstatic void OnMenuOptions(WindowInfo& win)\r\n{\r\n    OnMenuOptions(win.hwndFrame);\r\n    if (gWindows.Count() > 0 && gWindows.At(0)->IsAboutWindow())\r\n        gWindows.At(0)->RedrawAll(true);\r\n}\r\n\r\n// toggles 'show pages continuously' state\r\nstatic void OnMenuViewContinuous(WindowInfo& win)\r\n{\r\n    if (!win.IsDocLoaded())\r\n        return;\r\n\r\n    DisplayMode newMode = win.ctrl->GetDisplayMode();\r\n    switch (newMode) {\r\n        case DM_SINGLE_PAGE:\r\n        case DM_CONTINUOUS:\r\n            newMode = IsContinuous(newMode) ? DM_SINGLE_PAGE : DM_CONTINUOUS;\r\n            break;\r\n        case DM_FACING:\r\n        case DM_CONTINUOUS_FACING:\r\n            newMode = IsContinuous(newMode) ? DM_FACING : DM_CONTINUOUS_FACING;\r\n            break;\r\n        case DM_BOOK_VIEW:\r\n        case DM_CONTINUOUS_BOOK_VIEW:\r\n            newMode = IsContinuous(newMode) ? DM_BOOK_VIEW : DM_CONTINUOUS_BOOK_VIEW;\r\n            break;\r\n    }\r\n    SwitchToDisplayMode(&win, newMode);\r\n}\r\n\r\nstatic void OnMenuViewMangaMode(WindowInfo *win)\r\n{\r\n    CrashIf(!win->currentTab || win->currentTab->GetEngineType() != Engine_ComicBook);\r\n    if (!win->currentTab || win->currentTab->GetEngineType() != Engine_ComicBook) return;\r\n    DisplayModel *dm = win->AsFixed();\r\n    dm->SetDisplayR2L(!dm->GetDisplayR2L());\r\n    ScrollState state = dm->GetScrollState();\r\n    dm->Relayout(dm->GetZoomVirtual(), dm->GetRotation());\r\n    dm->SetScrollState(state);\r\n}\r\n\r\nstatic void ChangeZoomLevel(WindowInfo *win, float newZoom, bool pagesContinuously)\r\n{\r\n    if (!win->IsDocLoaded())\r\n        return;\r\n\r\n    float zoom = win->ctrl->GetZoomVirtual();\r\n    DisplayMode mode = win->ctrl->GetDisplayMode();\r\n    DisplayMode newMode = pagesContinuously ? DM_CONTINUOUS : DM_SINGLE_PAGE;\r\n\r\n    if (mode != newMode || zoom != newZoom) {\r\n        float prevZoom = win->currentTab->prevZoomVirtual;\r\n        DisplayMode prevMode = win->currentTab->prevDisplayMode;\r\n\r\n        if (mode != newMode)\r\n            SwitchToDisplayMode(win, newMode);\r\n        OnMenuZoom(win, MenuIdFromVirtualZoom(newZoom));\r\n\r\n        // remember the previous values for when the toolbar button is unchecked\r\n        if (INVALID_ZOOM == prevZoom) {\r\n            win->currentTab->prevZoomVirtual = zoom;\r\n            win->currentTab->prevDisplayMode = mode;\r\n        }\r\n        // keep the rememberd values when toggling between the two toolbar buttons\r\n        else {\r\n            win->currentTab->prevZoomVirtual = prevZoom;\r\n            win->currentTab->prevDisplayMode = prevMode;\r\n        }\r\n    }\r\n    else if (win->currentTab->prevZoomVirtual != INVALID_ZOOM) {\r\n        float prevZoom = win->currentTab->prevZoomVirtual;\r\n        SwitchToDisplayMode(win, win->currentTab->prevDisplayMode);\r\n        ZoomToSelection(win, prevZoom);\r\n    }\r\n}\r\n\r\nstatic void FocusPageNoEdit(HWND hwndPageBox)\r\n{\r\n    if (GetFocus() == hwndPageBox)\r\n        SendMessage(hwndPageBox, WM_SETFOCUS, 0, 0);\r\n    else\r\n        SetFocus(hwndPageBox);\r\n}\r\n\r\nstatic void OnMenuGoToPage(WindowInfo& win)\r\n{\r\n    if (!win.IsDocLoaded())\r\n        return;\r\n\r\n    // Don't show a dialog if we don't have to - use the Toolbar instead\r\n    if (gGlobalPrefs->showToolbar && !win.isFullScreen && !win.presentation && !win.AsEbook()) {\r\n        FocusPageNoEdit(win.hwndPageBox);\r\n        return;\r\n    }\r\n\r\n    ScopedMem<WCHAR> label(win.ctrl->GetPageLabel(win.ctrl->CurrentPageNo()));\r\n    ScopedMem<WCHAR> newPageLabel(Dialog_GoToPage(win.hwndFrame, label, win.ctrl->PageCount(),\r\n                                                  !win.ctrl->HasPageLabels()));\r\n    if (!newPageLabel)\r\n        return;\r\n\r\n    int newPageNo = win.ctrl->GetPageByLabel(newPageLabel);\r\n    if (win.ctrl->ValidPageNo(newPageNo))\r\n        win.ctrl->GoToPage(newPageNo, true);\r\n}\r\n\r\nvoid EnterFullScreen(WindowInfo* win, bool presentation)\r\n{\r\n    if (!HasPermission(Perm_FullscreenAccess) || gPluginMode)\r\n        return;\r\n\r\n    if ((presentation ? win->presentation : win->isFullScreen) || !IsWindowVisible(win->hwndFrame))\r\n        return;\r\n\r\n    AssertCrash(presentation ? !win->isFullScreen : !win->presentation);\r\n    if (presentation) {\r\n        AssertCrash(win->ctrl);\r\n        if (!win->IsDocLoaded())\r\n            return;\r\n\r\n        if (IsZoomed(win->hwndFrame))\r\n            win->windowStateBeforePresentation = WIN_STATE_MAXIMIZED;\r\n        else\r\n            win->windowStateBeforePresentation = WIN_STATE_NORMAL;\r\n        win->presentation = PM_ENABLED;\r\n\r\n        SetTimer(win->hwndCanvas, HIDE_CURSOR_TIMER_ID, HIDE_CURSOR_DELAY_IN_MS, nullptr);\r\n    }\r\n    else {\r\n        win->isFullScreen = true;\r\n    }\r\n\r\n    // ToC and Favorites sidebars are hidden when entering presentation mode\r\n    // TODO: make showFavorites a per-window pref\r\n    bool showFavoritesTmp = gGlobalPrefs->showFavorites;\r\n    if (presentation && (win->tocVisible || gGlobalPrefs->showFavorites)) {\r\n        SetSidebarVisibility(win, false, false);\r\n    }\r\n\r\n    long ws = GetWindowLong(win->hwndFrame, GWL_STYLE);\r\n    if (!presentation || !win->isFullScreen)\r\n        win->nonFullScreenWindowStyle = ws;\r\n    // remove window styles that add to non-client area\r\n    ws &= ~(WS_CAPTION|WS_THICKFRAME);\r\n    ws |= WS_MAXIMIZE;\r\n\r\n    win->nonFullScreenFrameRect = WindowRect(win->hwndFrame);\r\n    RectI rect = GetFullscreenRect(win->hwndFrame);\r\n\r\n    SetMenu(win->hwndFrame, nullptr);\r\n    ShowWindow(win->hwndReBar, SW_HIDE);\r\n    ShowWindow(win->hwndTabBar, SW_HIDE);\r\n    ShowWindow(win->hwndCaption, SW_HIDE);\r\n\r\n    SetWindowLong(win->hwndFrame, GWL_STYLE, ws);\r\n    SetWindowPos(win->hwndFrame, nullptr, rect.x, rect.y, rect.dx, rect.dy, SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOZORDER);\r\n\r\n    if (presentation)\r\n        win->ctrl->SetPresentationMode(true);\r\n\r\n    // Make sure that no toolbar/sidebar keeps the focus\r\n    SetFocus(win->hwndFrame);\r\n    // restore gGlobalPrefs->showFavorites changed by SetSidebarVisibility()\r\n    gGlobalPrefs->showFavorites = showFavoritesTmp;\r\n}\r\n\r\nvoid ExitFullScreen(WindowInfo *win)\r\n{\r\n    if (!win->isFullScreen && !win->presentation)\r\n        return;\r\n\r\n    bool wasPresentation = PM_DISABLED != win->presentation;\r\n    if (wasPresentation) {\r\n        win->presentation = PM_DISABLED;\r\n        if (win->IsDocLoaded())\r\n            win->ctrl->SetPresentationMode(false);\r\n        // re-enable the auto-hidden cursor\r\n        KillTimer(win->hwndCanvas, HIDE_CURSOR_TIMER_ID);\r\n        SetCursor(IDC_ARROW);\r\n        // ensure that no ToC is shown when entering presentation mode the next time\r\n        for (TabInfo *tab : win->tabs) {\r\n            tab->showTocPresentation = false;\r\n        }\r\n    }\r\n    else {\r\n        win->isFullScreen = false;\r\n    }\r\n\r\n    bool tocVisible = win->currentTab && win->currentTab->showToc;\r\n    SetSidebarVisibility(win, tocVisible, gGlobalPrefs->showFavorites);\r\n\r\n    if (win->tabsInTitlebar)\r\n        ShowWindow(win->hwndCaption, SW_SHOW);\r\n    if (win->tabsVisible)\r\n        ShowWindow(win->hwndTabBar, SW_SHOW);\r\n    if (gGlobalPrefs->showToolbar && !win->AsEbook())\r\n        ShowWindow(win->hwndReBar, SW_SHOW);\r\n    if (!win->isMenuHidden)\r\n        SetMenu(win->hwndFrame, win->menu);\r\n\r\n    ClientRect cr(win->hwndFrame);\r\n    SetWindowLong(win->hwndFrame, GWL_STYLE, win->nonFullScreenWindowStyle);\r\n    UINT flags = SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE;\r\n    SetWindowPos(win->hwndFrame, nullptr, 0, 0, 0, 0, flags);\r\n    MoveWindow(win->hwndFrame, win->nonFullScreenFrameRect);\r\n    // TODO: this CrashIf() fires in pre-release e.g. 64011\r\n    //CrashIf(WindowRect(win.hwndFrame) != win.nonFullScreenFrameRect);\r\n    // We have to relayout here, because it isn't done in the SetWindowPos nor MoveWindow,\r\n    // if the client rectangle hasn't changed.\r\n    if (ClientRect(win->hwndFrame) == cr)\r\n        RelayoutFrame(win);\r\n}\r\n\r\nvoid OnMenuViewFullscreen(WindowInfo* win, bool presentation)\r\n{\r\n    bool enterFullScreen = presentation ? !win->presentation : !win->isFullScreen;\r\n\r\n    if (!win->presentation && !win->isFullScreen)\r\n        RememberDefaultWindowPosition(*win);\r\n    else\r\n        ExitFullScreen(win);\r\n\r\n    if (enterFullScreen && (!presentation || win->IsDocLoaded()))\r\n        EnterFullScreen(win, presentation);\r\n}\r\n\r\nstatic void OnMenuViewPresentation(WindowInfo& win)\r\n{\r\n    // only DisplayModel currently supports an actual presentation mode\r\n    OnMenuViewFullscreen(&win, win.AsFixed() != nullptr);\r\n}\r\n\r\nvoid AdvanceFocus(WindowInfo* win)\r\n{\r\n    // Tab order: Frame -> Page -> Find -> ToC -> Favorites -> Frame -> ...\r\n\r\n    bool hasToolbar = !win->isFullScreen && !win->presentation && !win->AsEbook() &&\r\n                      gGlobalPrefs->showToolbar && win->IsDocLoaded();\r\n    int direction = IsShiftPressed() ? -1 : 1;\r\n\r\n    struct {\r\n        HWND hwnd;\r\n        bool isAvailable;\r\n    } tabOrder[] = {\r\n        { win->hwndFrame,   true                                },\r\n        { win->hwndPageBox, hasToolbar                          },\r\n        { win->hwndFindBox, hasToolbar && NeedsFindUI(win)      },\r\n        { win->hwndTocTree, win->tocLoaded && win->tocVisible   },\r\n        { win->hwndFavTree, gGlobalPrefs->showFavorites         },\r\n    };\r\n\r\n    /* // make sure that at least one element is available\r\n    bool hasAvailable = false;\r\n    for (int i = 0; i < dimof(tabOrder) && !hasAvailable; i++)\r\n        hasAvailable = tabOrder[i].isAvailable;\r\n    if (!hasAvailable)\r\n        return;\r\n    // */\r\n\r\n    // find the currently focused element\r\n    HWND current = GetFocus();\r\n    int ix;\r\n    for (ix = 0; ix < dimof(tabOrder); ix++)\r\n        if (tabOrder[ix].hwnd == current)\r\n            break;\r\n    // if it's not in the tab order, start at the beginning\r\n    if (ix == dimof(tabOrder))\r\n        ix = -direction;\r\n\r\n    // focus the next available element\r\n    do {\r\n        ix = (ix + direction + dimof(tabOrder)) % dimof(tabOrder);\r\n    } while (!tabOrder[ix].isAvailable);\r\n    SetFocus(tabOrder[ix].hwnd);\r\n}\r\n\r\n// allow to distinguish a '/' caused by VK_DIVIDE (rotates a document)\r\n// from one typed on the main keyboard (focuses the find textbox)\r\nstatic bool gIsDivideKeyDown = false;\r\n\r\nstatic bool ChmForwardKey(WPARAM key)\r\n{\r\n    if ((VK_LEFT == key) || (VK_RIGHT == key))\r\n        return true;\r\n    if ((VK_UP == key) || (VK_DOWN == key))\r\n        return true;\r\n    if ((VK_HOME == key) || (VK_END == key))\r\n        return true;\r\n    if ((VK_PRIOR == key) || (VK_NEXT == key))\r\n        return true;\r\n    if ((VK_MULTIPLY == key) || (VK_DIVIDE == key))\r\n        return true;\r\n    return false;\r\n}\r\n\r\nbool FrameOnKeydown(WindowInfo *win, WPARAM key, LPARAM lparam, bool inTextfield)\r\n{\r\n    if (PM_BLACK_SCREEN == win->presentation || PM_WHITE_SCREEN == win->presentation) {\r\n        // black/white screen is disabled on any unmodified key press in FrameOnChar\r\n        return true;\r\n    }\r\n\r\n    bool isCtrl = IsCtrlPressed();\r\n    bool isShift = IsShiftPressed();\r\n\r\n    if (win->tabsVisible && isCtrl && VK_TAB == key) {\r\n        TabsOnCtrlTab(win, isShift);\r\n        return true;\r\n    }\r\n\r\n    if ((VK_LEFT == key || VK_RIGHT == key) && isShift && isCtrl &&\r\n        !win->IsAboutWindow() && !inTextfield) {\r\n        // folder browsing should also work when an error page is displayed,\r\n        // so special-case it before the win->IsDocLoaded() check\r\n        BrowseFolder(*win, VK_RIGHT == key);\r\n        return true;\r\n    }\r\n\r\n    if (!win->IsDocLoaded())\r\n        return false;\r\n\r\n    DisplayModel *dm = win->AsFixed();\r\n    // some of the chm key bindings are different than the rest and we\r\n    // need to make sure we don't break them\r\n    bool isChm = win->AsChm();\r\n\r\n    bool isPageUp = (isCtrl && (VK_UP == key));\r\n    if (!isChm)\r\n        isPageUp |= (VK_PRIOR == key) && !isCtrl;\r\n    if (isPageUp) {\r\n        int currentPos = GetScrollPos(win->hwndCanvas, SB_VERT);\r\n        if (win->ctrl->GetZoomVirtual() != ZOOM_FIT_CONTENT)\r\n            SendMessage(win->hwndCanvas, WM_VSCROLL, SB_PAGEUP, 0);\r\n        if (GetScrollPos(win->hwndCanvas, SB_VERT) == currentPos)\r\n            win->ctrl->GoToPrevPage(true);\r\n        return true;\r\n    }\r\n\r\n    bool isPageDown = (isCtrl && (VK_DOWN == key));\r\n    if (!isChm)\r\n        isPageDown |= (VK_NEXT == key) && !isCtrl;\r\n    if (isPageDown) {\r\n        int currentPos = GetScrollPos(win->hwndCanvas, SB_VERT);\r\n        if (win->ctrl->GetZoomVirtual() != ZOOM_FIT_CONTENT)\r\n            SendMessage(win->hwndCanvas, WM_VSCROLL, SB_PAGEDOWN, 0);\r\n        if (GetScrollPos(win->hwndCanvas, SB_VERT) == currentPos)\r\n            win->ctrl->GoToNextPage();\r\n        return true;\r\n    }\r\n\r\n    if (isChm) {\r\n        if (ChmForwardKey(key)) {\r\n            win->AsChm()->PassUIMsg(WM_KEYDOWN, key, lparam);\r\n            return true;\r\n        }\r\n    }\r\n    //lf(\"key=%d,%c,shift=%d\\n\", key, (char)key, (int)WasKeyDown(VK_SHIFT));\r\n\r\n    if (VK_UP == key) {\r\n        if (dm && dm->NeedVScroll())\r\n            SendMessage(win->hwndCanvas, WM_VSCROLL, isShift ? SB_HPAGEUP : SB_LINEUP, 0);\r\n        else\r\n            win->ctrl->GoToPrevPage(true);\r\n    } else if (VK_DOWN == key) {\r\n        if (dm && dm->NeedVScroll())\r\n            SendMessage(win->hwndCanvas, WM_VSCROLL, isShift ? SB_HPAGEDOWN : SB_LINEDOWN, 0);\r\n        else\r\n            win->ctrl->GoToNextPage();\r\n    } else if (VK_PRIOR == key && isCtrl) {\r\n        win->ctrl->GoToPrevPage();\r\n    } else if (VK_NEXT == key && isCtrl) {\r\n        win->ctrl->GoToNextPage();\r\n    } else if (VK_HOME == key && isCtrl) {\r\n        win->ctrl->GoToFirstPage();\r\n    } else if (VK_END == key && isCtrl) {\r\n        if (!win->ctrl->GoToLastPage())\r\n            SendMessage(win->hwndCanvas, WM_VSCROLL, SB_BOTTOM, 0);\r\n    } else if (inTextfield) {\r\n        // The remaining keys have a different meaning\r\n        return false;\r\n    } else if (VK_LEFT == key) {\r\n        if (dm && dm->NeedHScroll() && !isCtrl)\r\n            SendMessage(win->hwndCanvas, WM_HSCROLL, isShift ? SB_PAGELEFT : SB_LINELEFT, 0);\r\n        else\r\n            win->ctrl->GoToPrevPage();\r\n    } else if (VK_RIGHT == key) {\r\n        if (dm && dm->NeedHScroll() && !isCtrl)\r\n            SendMessage(win->hwndCanvas, WM_HSCROLL, isShift ? SB_PAGERIGHT : SB_LINERIGHT, 0);\r\n        else\r\n            win->ctrl->GoToNextPage();\r\n    } else if (VK_HOME == key) {\r\n        win->ctrl->GoToFirstPage();\r\n    } else if (VK_END == key) {\r\n        if (!win->ctrl->GoToLastPage())\r\n            SendMessage(win->hwndCanvas, WM_VSCROLL, SB_BOTTOM, 0);\r\n    } else if (VK_MULTIPLY == key && dm) {\r\n        dm->RotateBy(90);\r\n    } else if (VK_DIVIDE == key && dm) {\r\n        dm->RotateBy(-90);\r\n        gIsDivideKeyDown = true;\r\n#ifdef DEBUG\r\n    } else if (VK_F1 == key && win->AsEbook()) {\r\n        // TODO: this was in EbookWindow - is it still needed?\r\n        SendMessage(win->hwndFrame, WM_COMMAND, IDM_DEBUG_MUI, 0);\r\n#endif\r\n    } else {\r\n        return false;\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nstatic WCHAR SingleCharLowerW(WCHAR c)\r\n{\r\n    WCHAR buf[2] = { c, 0 };\r\n    CharLowerBuffW(buf, 1);\r\n    return buf[0];\r\n}\r\n\r\nstatic void FrameOnChar(WindowInfo& win, WPARAM key, LPARAM info=0)\r\n{\r\n    if (PM_BLACK_SCREEN == win.presentation || PM_WHITE_SCREEN == win.presentation) {\r\n        win.ChangePresentationMode(PM_ENABLED);\r\n        return;\r\n    }\r\n\r\n    if (key >= 0x100 && info && !IsCtrlPressed() && !IsAltPressed()) {\r\n        // determine the intended keypress by scan code for non-Latin keyboard layouts\r\n        UINT vk = MapVirtualKeyW((info >> 16) & 0xFF, MAPVK_VSC_TO_VK);\r\n        if ('A' <= vk && vk <= 'Z')\r\n            key = vk;\r\n    }\r\n\r\n    if (IsCharUpperW((WCHAR)key))\r\n        key = (WPARAM)SingleCharLowerW((WCHAR)key);\r\n\r\n    switch (key) {\r\n    case VK_ESCAPE:\r\n        if (win.findThread)\r\n            AbortFinding(&win, false);\r\n        else if (win.notifications->GetForGroup(NG_PERSISTENT_WARNING))\r\n            win.notifications->RemoveForGroup(NG_PERSISTENT_WARNING);\r\n        else if (win.notifications->GetForGroup(NG_PAGE_INFO_HELPER))\r\n            win.notifications->RemoveForGroup(NG_PAGE_INFO_HELPER);\r\n        else if (win.notifications->GetForGroup(NG_CURSOR_POS_HELPER))\r\n            win.notifications->RemoveForGroup(NG_CURSOR_POS_HELPER);\r\n        else if (win.showSelection)\r\n            ClearSearchResult(&win);\r\n        else if (gGlobalPrefs->escToExit && MayCloseWindow(&win))\r\n            CloseWindow(&win, true);\r\n        else if (win.presentation || win.isFullScreen)\r\n            OnMenuViewFullscreen(&win, win.presentation != PM_DISABLED);\r\n        return;\r\n    case 'q':\r\n        // close the current document (it's too easy to press for discarding multiple tabs)\r\n        // quit if this is the last window\r\n        CloseTab(&win, true);\r\n        return;\r\n    case 'r':\r\n        ReloadDocument(&win);\r\n        return;\r\n    case VK_TAB:\r\n        AdvanceFocus(&win);\r\n        break;\r\n    }\r\n\r\n    if (!win.IsDocLoaded())\r\n        return;\r\n\r\n    switch (key) {\r\n    case VK_SPACE:\r\n    case VK_RETURN:\r\n        FrameOnKeydown(&win, IsShiftPressed() ? VK_PRIOR : VK_NEXT, 0);\r\n        break;\r\n    case VK_BACK:\r\n        {\r\n            bool forward = IsShiftPressed();\r\n            win.ctrl->Navigate(forward ? 1 : -1);\r\n        }\r\n        break;\r\n    case 'g':\r\n        OnMenuGoToPage(win);\r\n        break;\r\n    case 'j':\r\n        FrameOnKeydown(&win, VK_DOWN, 0);\r\n        break;\r\n    case 'k':\r\n        FrameOnKeydown(&win, VK_UP, 0);\r\n        break;\r\n    case 'n':\r\n        win.ctrl->GoToNextPage();\r\n        break;\r\n    case 'p':\r\n        win.ctrl->GoToPrevPage();\r\n        break;\r\n    case 'z':\r\n        win.ToggleZoom();\r\n        break;\r\n    // per https://en.wikipedia.org/wiki/Keyboard_layout\r\n    // almost all keyboard layouts allow to press either\r\n    // '+' or '=' unshifted (and one of them is also often\r\n    // close to '-'); the other two alternatives are for\r\n    // the major exception: the two Swiss layouts\r\n    case '+': case '=': case 0xE0: case 0xE4:\r\n        ZoomToSelection(&win, win.ctrl->GetNextZoomStep(ZOOM_MAX), false);\r\n        break;\r\n    case '-':\r\n        ZoomToSelection(&win, win.ctrl->GetNextZoomStep(ZOOM_MIN), false);\r\n        break;\r\n    case '/':\r\n        if (!gIsDivideKeyDown)\r\n            OnMenuFind(&win);\r\n        gIsDivideKeyDown = false;\r\n        break;\r\n    case 'c':\r\n        OnMenuViewContinuous(win);\r\n        break;\r\n    case 'b':\r\n        if (win.AsFixed() && !IsSingle(win.ctrl->GetDisplayMode())) {\r\n            // \"e-book view\": flip a single page\r\n            bool forward = !IsShiftPressed();\r\n            int currPage = win.ctrl->CurrentPageNo();\r\n            if (forward ? win.AsFixed()->LastBookPageVisible() : win.AsFixed()->FirstBookPageVisible())\r\n                break;\r\n\r\n            DisplayMode newMode = DM_BOOK_VIEW;\r\n            if (IsBookView(win.ctrl->GetDisplayMode()))\r\n                newMode = DM_FACING;\r\n            SwitchToDisplayMode(&win, newMode, true);\r\n\r\n            if (forward && currPage >= win.ctrl->CurrentPageNo() && (currPage > 1 || newMode == DM_BOOK_VIEW))\r\n                win.ctrl->GoToNextPage();\r\n            else if (!forward && currPage <= win.ctrl->CurrentPageNo())\r\n                win.ctrl->GoToPrevPage();\r\n        }\r\n        else if (win.AsEbook() && !IsSingle(win.ctrl->GetDisplayMode())) {\r\n            // \"e-book view\": flip a single page\r\n            bool forward = !IsShiftPressed();\r\n            int nextPage = win.ctrl->CurrentPageNo() + (forward ? 1 : -1);\r\n            if (win.ctrl->ValidPageNo(nextPage))\r\n                win.ctrl->GoToPage(nextPage, false);\r\n        }\r\n        else if (win.presentation)\r\n            win.ChangePresentationMode(PM_BLACK_SCREEN);\r\n        break;\r\n    case '.':\r\n        // for Logitech's wireless presenters which target PowerPoint's shortcuts\r\n        if (win.presentation)\r\n            win.ChangePresentationMode(PM_BLACK_SCREEN);\r\n        break;\r\n    case 'w':\r\n        if (win.presentation)\r\n            win.ChangePresentationMode(PM_WHITE_SCREEN);\r\n        break;\r\n    case 'i':\r\n        // experimental \"page info\" tip: make figuring out current page and\r\n        // total pages count a one-key action (unless they're already visible)\r\n        if (win.AsFixed() && (!gGlobalPrefs->showToolbar || win.isFullScreen || PM_ENABLED == win.presentation))\r\n            UpdatePageInfoHelper(&win);\r\n        break;\r\n    case 'm':\r\n        // \"cursor position\" tip: make figuring out the current\r\n        // cursor position in cm/in/pt possible (for exact layouting)\r\n        if (win.AsFixed()) {\r\n            PointI pt;\r\n            if (GetCursorPosInHwnd(win.hwndCanvas, pt)) {\r\n                UpdateCursorPositionHelper(&win, pt, nullptr);\r\n            }\r\n        }\r\n        break;\r\n#if defined(DEBUG) || defined(SVN_PRE_RELEASE_VER)\r\n    case 'h': // convert selection to highlight annotation\r\n        if (win.AsFixed() && win.AsFixed()->GetEngine()->SupportsAnnotation() && win.showSelection && win.currentTab->selectionOnPage) {\r\n            if (!win.AsFixed()->userAnnots)\r\n                win.AsFixed()->userAnnots = new Vec<PageAnnotation>();\r\n            for (SelectionOnPage& sel : *win.currentTab->selectionOnPage) {\r\n                win.AsFixed()->userAnnots->Append(PageAnnotation(Annot_Highlight, sel.pageNo, sel.rect, PageAnnotation::Color(gGlobalPrefs->annotationDefaults.highlightColor, 0xCC)));\r\n                gRenderCache.Invalidate(win.AsFixed(), sel.pageNo, sel.rect);\r\n            }\r\n            win.AsFixed()->userAnnotsModified = true;\r\n            win.AsFixed()->GetEngine()->UpdateUserAnnotations(win.AsFixed()->userAnnots);\r\n            ClearSearchResult(&win); // causes invalidated tiles to be rerendered\r\n        }\r\n#endif\r\n    }\r\n}\r\n\r\nstatic bool FrameOnSysChar(WindowInfo& win, WPARAM key)\r\n{\r\n    // use Alt+1 to Alt+8 for selecting the first 8 tabs and Alt+9 for the last tab\r\n    if (win.tabsVisible && ('1' <= key && key <= '9')) {\r\n        TabsSelect(&win, key < '9' ? (int)(key - '1') : (int)win.tabs.Count() - 1);\r\n        return true;\r\n    }\r\n\r\n    return false;\r\n}\r\n\r\nstatic bool SidebarSplitterCb(void *ctx, bool done)\r\n{\r\n    WindowInfo *win = reinterpret_cast<WindowInfo*>(ctx);\r\n\r\n    PointI pcur;\r\n    GetCursorPosInHwnd(win->hwndFrame, pcur);\r\n    int sidebarDx = pcur.x; // without splitter\r\n\r\n    // make sure to keep this in sync with the calculations in RelayoutFrame\r\n    // note: without the min/max(..., rToc.dx), the sidebar will be\r\n    //       stuck at its width if it accidentally got too wide or too narrow\r\n    ClientRect rFrame(win->hwndFrame);\r\n    ClientRect rToc(win->hwndTocBox);\r\n    if (sidebarDx < std::min(SIDEBAR_MIN_WIDTH, rToc.dx) ||\r\n        sidebarDx > std::max(rFrame.dx / 2, rToc.dx)) {\r\n        return false;\r\n    }\r\n\r\n    if (done || !win->AsEbook()) {\r\n        RelayoutFrame(win, false, sidebarDx);\r\n    }\r\n    return true;\r\n}\r\n\r\nstatic bool FavSplitterCb(void *ctx, bool done)\r\n{\r\n    WindowInfo *win = reinterpret_cast<WindowInfo*>(ctx);\r\n    PointI pcur;\r\n    GetCursorPosInHwnd(win->hwndTocBox, pcur);\r\n    int tocDy = pcur.y; // without splitter\r\n\r\n    // make sure to keep this in sync with the calculations in RelayoutFrame\r\n    ClientRect rFrame(win->hwndFrame);\r\n    ClientRect rToc(win->hwndTocBox);\r\n    AssertCrash(rToc.dx == ClientRect(win->hwndFavBox).dx);\r\n    if (tocDy < std::min(TOC_MIN_DY, rToc.dy) ||\r\n        tocDy > std::max(rFrame.dy - TOC_MIN_DY, rToc.dy)) {\r\n        return false;\r\n    }\r\n    gGlobalPrefs->tocDy = tocDy;\r\n    if (done || !win->AsEbook()) {\r\n        RelayoutFrame(win, false, rToc.dx);\r\n    }\r\n    return true;\r\n}\r\n\r\n// Position label with close button and tree window within their parent.\r\n// Used for toc and favorites.\r\nvoid LayoutTreeContainer(LabelWithCloseWnd *l, HWND hwndTree)\r\n{\r\n    HWND hwndContainer = GetParent(hwndTree);\r\n    SizeI labelSize = GetIdealSize(l);\r\n    WindowRect rc(hwndContainer);\r\n    MoveWindow(GetHwnd(l), 0, 0, rc.dx, labelSize.dy, TRUE);\r\n    MoveWindow(hwndTree, 0, labelSize.dy, rc.dx, rc.dy - labelSize.dy, TRUE);\r\n}\r\n\r\nvoid SetSidebarVisibility(WindowInfo *win, bool tocVisible, bool showFavorites)\r\n{\r\n    if (gPluginMode || !HasPermission(Perm_DiskAccess))\r\n        showFavorites = false;\r\n\r\n    if (!win->IsDocLoaded() || !win->ctrl->HasTocTree())\r\n        tocVisible = false;\r\n\r\n    if (PM_BLACK_SCREEN == win->presentation || PM_WHITE_SCREEN == win->presentation) {\r\n        tocVisible = false;\r\n        showFavorites = false;\r\n    }\r\n\r\n    if (tocVisible) {\r\n        LoadTocTree(win);\r\n        CrashIf(!win->tocLoaded);\r\n    }\r\n    if (showFavorites)\r\n        PopulateFavTreeIfNeeded(win);\r\n\r\n    if (!win->currentTab) {\r\n        CrashIf(tocVisible);\r\n    } else if (!win->presentation) {\r\n        win->currentTab->showToc = tocVisible;\r\n    } else if (PM_ENABLED == win->presentation) {\r\n        win->currentTab->showTocPresentation = tocVisible;\r\n    }\r\n    win->tocVisible = tocVisible;\r\n\r\n    // TODO: make this a per-window setting as well?\r\n    gGlobalPrefs->showFavorites = showFavorites;\r\n\r\n    if ((!tocVisible && GetFocus() == win->hwndTocTree) ||\r\n        (!showFavorites && GetFocus() == win->hwndFavTree)) {\r\n        SetFocus(win->hwndFrame);\r\n    }\r\n\r\n    win::SetVisibility(GetHwnd(win->sidebarSplitter), tocVisible || showFavorites);\r\n    win::SetVisibility(win->hwndTocBox, tocVisible);\r\n    SetSplitterLive(win->sidebarSplitter, !win->AsEbook());\r\n\r\n    win::SetVisibility(GetHwnd(win->favSplitter), tocVisible && showFavorites);\r\n    win::SetVisibility(win->hwndFavBox, showFavorites);\r\n    SetSplitterLive(win->favSplitter, !win->AsEbook());\r\n\r\n    RelayoutFrame(win, false);\r\n}\r\n\r\n// Tests that various ways to crash will generate crash report.\r\n// Commented-out because they are ad-hoc. Left in code because\r\n// I don't want to write them again if I ever need to test crash reporting\r\n#if 0\r\n#include <signal.h>\r\nstatic void TestCrashAbort()\r\n{\r\n    raise(SIGABRT);\r\n}\r\n\r\nstruct Base;\r\nvoid foo(Base* b);\r\n\r\nstruct Base {\r\n    Base() {\r\n        foo(this);\r\n    }\r\n    virtual ~Base() = 0;\r\n    virtual void pure() = 0;\r\n};\r\nstruct Derived : public Base {\r\n    void pure() { }\r\n};\r\n\r\nvoid foo(Base* b) {\r\n    b->pure();\r\n}\r\n\r\nstatic void TestCrashPureCall()\r\n{\r\n    Derived d; // should crash\r\n}\r\n\r\n// tests that making a big allocation with new raises an exception\r\nstatic int TestBigNew()\r\n{\r\n    size_t size = 1024*1024*1024*1;  // 1 GB should be out of reach\r\n    char *mem = (char*)1;\r\n    while (mem) {\r\n        mem = new char[size];\r\n    }\r\n    // just some code so that compiler doesn't optimize this code to null\r\n    for (size_t i = 0; i < 1024; i++) {\r\n        mem[i] = i & 0xff;\r\n    }\r\n    int res = 0;\r\n    for (size_t i = 0; i < 1024; i++) {\r\n        res += mem[i];\r\n    }\r\n    return res;\r\n}\r\n#endif\r\n\r\nstatic LRESULT FrameOnCommand(WindowInfo *win, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    int wmId = LOWORD(wParam);\r\n\r\n    if (wmId >= 0xF000) {\r\n        // handle system menu messages for the Window menu (needed for Tabs in Titlebar)\r\n        return SendMessage(hwnd, WM_SYSCOMMAND, wParam, lParam);\r\n    }\r\n\r\n    // check if the menuId belongs to an entry in the list of\r\n    // recently opened files and load the referenced file if it does\r\n    if ((wmId >= IDM_FILE_HISTORY_FIRST) && (wmId <= IDM_FILE_HISTORY_LAST))\r\n    {\r\n        DisplayState *state = gFileHistory.Get(wmId - IDM_FILE_HISTORY_FIRST);\r\n        if (state && HasPermission(Perm_DiskAccess)) {\r\n            LoadArgs args(state->filePath, win);\r\n            LoadDocument(args);\r\n        }\r\n        return 0;\r\n    }\r\n\r\n    // 10 submenus max with 10 items each max (=100) plus generous buffer => 200\r\n    static_assert(IDM_FAV_LAST - IDM_FAV_FIRST == 200, \"wrong numer of favorite menu ids\");\r\n    if ((wmId >= IDM_FAV_FIRST) && (wmId <= IDM_FAV_LAST))\r\n    {\r\n        GoToFavoriteByMenuId(win, wmId);\r\n    }\r\n\r\n    if (!win)\r\n        return DefWindowProc(hwnd, msg, wParam, lParam);\r\n\r\n    if (!win->IsAboutWindow() && IDM_OPEN_WITH_EXTERNAL_FIRST <= wmId && wmId <= IDM_OPEN_WITH_EXTERNAL_LAST) {\r\n        ViewWithExternalViewer(win->currentTab, wmId - IDM_OPEN_WITH_EXTERNAL_FIRST);\r\n        return 0;\r\n    }\r\n\r\n    // most of them require a win, the few exceptions are no-ops\r\n    switch (wmId)\r\n    {\r\n        case IDM_OPEN:\r\n        case IDT_FILE_OPEN:\r\n            OnMenuOpen(*win);\r\n            break;\r\n\r\n        case IDM_SAVEAS:\r\n            OnMenuSaveAs(*win);\r\n            break;\r\n\r\n        case IDM_RENAME_FILE:\r\n            OnMenuRenameFile(*win);\r\n            break;\r\n\r\n        case IDT_FILE_PRINT:\r\n        case IDM_PRINT:\r\n            OnMenuPrint(win);\r\n            break;\r\n\r\n        case IDM_CLOSE:\r\n        case IDT_FILE_EXIT:\r\n            CloseTab(win);\r\n            break;\r\n\r\n        case IDM_EXIT:\r\n            OnMenuExit();\r\n            break;\r\n\r\n        case IDM_REFRESH:\r\n            ReloadDocument(win);\r\n            break;\r\n\r\n        case IDM_SAVEAS_BOOKMARK:\r\n            OnMenuSaveBookmark(*win);\r\n            break;\r\n\r\n        case IDT_VIEW_FIT_WIDTH:\r\n            ChangeZoomLevel(win, ZOOM_FIT_WIDTH, true);\r\n            break;\r\n\r\n        case IDT_VIEW_FIT_PAGE:\r\n            ChangeZoomLevel(win, ZOOM_FIT_PAGE, false);\r\n            break;\r\n\r\n        case IDT_VIEW_ZOOMIN:\r\n            if (win->IsDocLoaded())\r\n                ZoomToSelection(win, win->ctrl->GetNextZoomStep(ZOOM_MAX), false);\r\n            break;\r\n\r\n        case IDT_VIEW_ZOOMOUT:\r\n            if (win->IsDocLoaded())\r\n                ZoomToSelection(win, win->ctrl->GetNextZoomStep(ZOOM_MIN), false);\r\n            break;\r\n\r\n        case IDM_ZOOM_6400:\r\n        case IDM_ZOOM_3200:\r\n        case IDM_ZOOM_1600:\r\n        case IDM_ZOOM_800:\r\n        case IDM_ZOOM_400:\r\n        case IDM_ZOOM_200:\r\n        case IDM_ZOOM_150:\r\n        case IDM_ZOOM_125:\r\n        case IDM_ZOOM_100:\r\n        case IDM_ZOOM_50:\r\n        case IDM_ZOOM_25:\r\n        case IDM_ZOOM_12_5:\r\n        case IDM_ZOOM_8_33:\r\n        case IDM_ZOOM_FIT_PAGE:\r\n        case IDM_ZOOM_FIT_WIDTH:\r\n        case IDM_ZOOM_FIT_CONTENT:\r\n        case IDM_ZOOM_ACTUAL_SIZE:\r\n            OnMenuZoom(win, wmId);\r\n            break;\r\n\r\n        case IDM_ZOOM_CUSTOM:\r\n            OnMenuCustomZoom(win);\r\n            break;\r\n\r\n        case IDM_VIEW_SINGLE_PAGE:\r\n            if (win->IsDocLoaded())\r\n                SwitchToDisplayMode(win, DM_SINGLE_PAGE, true);\r\n            break;\r\n\r\n        case IDM_VIEW_FACING:\r\n            if (win->IsDocLoaded())\r\n                SwitchToDisplayMode(win, DM_FACING, true);\r\n            break;\r\n\r\n        case IDM_VIEW_BOOK:\r\n            if (win->IsDocLoaded())\r\n                SwitchToDisplayMode(win, DM_BOOK_VIEW, true);\r\n            break;\r\n\r\n        case IDM_VIEW_CONTINUOUS:\r\n            OnMenuViewContinuous(*win);\r\n            break;\r\n\r\n        case IDM_VIEW_MANGA_MODE:\r\n            OnMenuViewMangaMode(win);\r\n            break;\r\n\r\n        case IDM_VIEW_SHOW_HIDE_TOOLBAR:\r\n            OnMenuViewShowHideToolbar();\r\n            break;\r\n\r\n        case IDM_VIEW_SHOW_HIDE_MENUBAR:\r\n            if (!win->tabsInTitlebar)\r\n                ShowHideMenuBar(win);\r\n            break;\r\n\r\n        case IDM_CHANGE_LANGUAGE:\r\n            OnMenuChangeLanguage(win->hwndFrame);\r\n            break;\r\n\r\n        case IDM_VIEW_BOOKMARKS:\r\n            ToggleTocBox(win);\r\n            break;\r\n\r\n        case IDM_GOTO_NEXT_PAGE:\r\n            if (win->IsDocLoaded())\r\n                win->ctrl->GoToNextPage();\r\n            break;\r\n\r\n        case IDM_GOTO_PREV_PAGE:\r\n            if (win->IsDocLoaded())\r\n                win->ctrl->GoToPrevPage();\r\n            break;\r\n\r\n        case IDM_GOTO_FIRST_PAGE:\r\n            if (win->IsDocLoaded())\r\n                win->ctrl->GoToFirstPage();\r\n            break;\r\n\r\n        case IDM_GOTO_LAST_PAGE:\r\n            if (win->IsDocLoaded())\r\n                win->ctrl->GoToLastPage();\r\n            break;\r\n\r\n        case IDM_GOTO_PAGE:\r\n            OnMenuGoToPage(*win);\r\n            break;\r\n\r\n        case IDM_VIEW_PRESENTATION_MODE:\r\n            OnMenuViewPresentation(*win);\r\n            break;\r\n\r\n        case IDM_VIEW_FULLSCREEN:\r\n            OnMenuViewFullscreen(win);\r\n            break;\r\n\r\n        case IDM_VIEW_ROTATE_LEFT:\r\n            if (win->AsFixed())\r\n                win->AsFixed()->RotateBy(-90);\r\n            break;\r\n\r\n        case IDM_VIEW_ROTATE_RIGHT:\r\n            if (win->AsFixed())\r\n                win->AsFixed()->RotateBy(90);\r\n            break;\r\n\r\n        case IDM_FIND_FIRST:\r\n            OnMenuFind(win);\r\n            break;\r\n\r\n        case IDM_FIND_NEXT:\r\n            OnMenuFindNext(win);\r\n            break;\r\n\r\n        case IDM_FIND_PREV:\r\n            OnMenuFindPrev(win);\r\n            break;\r\n\r\n        case IDM_FIND_MATCH:\r\n            OnMenuFindMatchCase(win);\r\n            break;\r\n\r\n        case IDM_FIND_NEXT_SEL:\r\n            OnMenuFindSel(win, FIND_FORWARD);\r\n            break;\r\n\r\n        case IDM_FIND_PREV_SEL:\r\n            OnMenuFindSel(win, FIND_BACKWARD);\r\n            break;\r\n\r\n        case IDM_VISIT_WEBSITE:\r\n            LaunchBrowser(WEBSITE_MAIN_URL);\r\n            break;\r\n\r\n        case IDM_MANUAL:\r\n            LaunchBrowser(WEBSITE_MANUAL_URL);\r\n            break;\r\n\r\n        case IDM_CONTRIBUTE_TRANSLATION:\r\n            LaunchBrowser(WEBSITE_TRANSLATIONS_URL);\r\n            break;\r\n\r\n        case IDM_ABOUT:\r\n#ifdef ENABLE_ALTERNATIVE_ABOUT_DIALOG\r\n            OnMenuAbout2();\r\n#else\r\n            OnMenuAbout();\r\n#endif\r\n            break;\r\n\r\n        case IDM_CHECK_UPDATE:\r\n            UpdateCheckAsync(win, false);\r\n            break;\r\n\r\n        case IDM_OPTIONS:\r\n            OnMenuOptions(*win);\r\n            break;\r\n\r\n        case IDM_ADVANCED_OPTIONS:\r\n            OnMenuAdvancedOptions();\r\n            break;\r\n\r\n        case IDM_VIEW_WITH_ACROBAT:\r\n            ViewWithAcrobat(win->currentTab);\r\n            break;\r\n\r\n        case IDM_VIEW_WITH_FOXIT:\r\n            ViewWithFoxit(win->currentTab);\r\n            break;\r\n\r\n        case IDM_VIEW_WITH_PDF_XCHANGE:\r\n            ViewWithPDFXChange(win->currentTab);\r\n            break;\r\n\r\n        case IDM_VIEW_WITH_XPS_VIEWER:\r\n            ViewWithXPSViewer(win->currentTab);\r\n            break;\r\n\r\n        case IDM_VIEW_WITH_HTML_HELP:\r\n            ViewWithHtmlHelp(win->currentTab);\r\n            break;\r\n\r\n        case IDM_SEND_BY_EMAIL:\r\n            SendAsEmailAttachment(win->currentTab, win->hwndFrame);\r\n            break;\r\n\r\n        case IDM_PROPERTIES:\r\n            OnMenuProperties(win);\r\n            break;\r\n\r\n        case IDM_MOVE_FRAME_FOCUS:\r\n            if (win->hwndFrame != GetFocus())\r\n                SetFocus(win->hwndFrame);\r\n            else if (win->tocVisible)\r\n                SetFocus(win->hwndTocTree);\r\n            break;\r\n\r\n        case IDM_GOTO_NAV_BACK:\r\n            if (win->IsDocLoaded())\r\n                win->ctrl->Navigate(-1);\r\n            break;\r\n\r\n        case IDM_GOTO_NAV_FORWARD:\r\n            if (win->IsDocLoaded())\r\n                win->ctrl->Navigate(1);\r\n            break;\r\n\r\n        case IDM_COPY_SELECTION:\r\n            // Don't break the shortcut for text boxes\r\n            if (win->hwndFindBox == GetFocus() || win->hwndPageBox == GetFocus())\r\n                SendMessage(GetFocus(), WM_COPY, 0, 0);\r\n            else if (!HasPermission(Perm_CopySelection))\r\n                break;\r\n            else if (win->AsChm())\r\n                win->AsChm()->CopySelection();\r\n            else if (win->currentTab && win->currentTab->selectionOnPage)\r\n                CopySelectionToClipboard(win);\r\n            else if (win->AsFixed())\r\n                win->ShowNotification(_TR(\"Select content with Ctrl+left mouse button\"));\r\n            break;\r\n\r\n        case IDM_SELECT_ALL:\r\n            OnSelectAll(win);\r\n            break;\r\n\r\n#ifdef SHOW_DEBUG_MENU_ITEMS\r\n        case IDM_DEBUG_SHOW_LINKS:\r\n            gDebugShowLinks = !gDebugShowLinks;\r\n            for (size_t i = 0; i < gWindows.Count(); i++)\r\n                gWindows.At(i)->RedrawAll(true);\r\n            break;\r\n\r\n        case IDM_DEBUG_EBOOK_UI:\r\n            gGlobalPrefs->ebookUI.useFixedPageUI = !gGlobalPrefs->ebookUI.useFixedPageUI;\r\n            // use the same setting to also toggle the CHM UI\r\n            gGlobalPrefs->chmUI.useFixedPageUI = !gGlobalPrefs->chmUI.useFixedPageUI;\r\n            break;\r\n\r\n        case IDM_DEBUG_MUI:\r\n            SetDebugPaint(!IsDebugPaint());\r\n            win::menu::SetChecked(GetMenu(win->hwndFrame), IDM_DEBUG_MUI, !IsDebugPaint());\r\n            for (size_t i = 0; i < gWindows.Count(); i++)\r\n                gWindows.At(i)->RedrawAll(true);\r\n            break;\r\n\r\n        case IDM_DEBUG_ANNOTATION:\r\n            FrameOnChar(*win, 'h');\r\n            break;\r\n\r\n        case IDM_DEBUG_CRASH_ME:\r\n            CrashMe();\r\n            break;\r\n#endif\r\n\r\n        case IDM_FAV_ADD:\r\n            if (win->IsDocLoaded())\r\n                AddFavorite(win);\r\n            break;\r\n\r\n        case IDM_FAV_DEL:\r\n            if (win->IsDocLoaded())\r\n                DelFavorite(win);\r\n            break;\r\n\r\n        case IDM_FAV_TOGGLE:\r\n            ToggleFavorites(win);\r\n            break;\r\n\r\n        default:\r\n            return DefWindowProc(hwnd, msg, wParam, lParam);\r\n    }\r\n\r\n    return 0;\r\n}\r\n\r\nstatic LRESULT OnFrameGetMinMaxInfo(MINMAXINFO *info)\r\n{\r\n    info->ptMinTrackSize.x = MIN_WIN_DX;\r\n    info->ptMinTrackSize.y = MIN_WIN_DY;\r\n    return 0;\r\n}\r\n\r\nLRESULT CALLBACK WndProcFrame(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    WindowInfo *win = FindWindowInfoByHwnd(hwnd);\r\n\r\n    if (win && win->tabsInTitlebar) {\r\n        bool callDefault = true;\r\n        LRESULT res = CustomCaptionFrameProc(hwnd, msg, wParam, lParam, &callDefault, win);\r\n        if (!callDefault)\r\n            return res;\r\n    }\r\n\r\n    switch (msg)\r\n    {\r\n        case WM_CREATE:\r\n            // do nothing\r\n            goto InitMouseWheelInfo;\r\n\r\n        case WM_SIZE:\r\n            if (win && SIZE_MINIMIZED != wParam) {\r\n                RememberDefaultWindowPosition(*win);\r\n                int dx = LOWORD(lParam);\r\n                int dy = HIWORD(lParam);\r\n                //dbglog::LogF(\"dx: %d, dy: %d\", dx, dy);\r\n                FrameOnSize(win, dx, dy);\r\n            }\r\n            break;\r\n\r\n        case WM_GETMINMAXINFO:\r\n            return OnFrameGetMinMaxInfo((MINMAXINFO*)lParam);\r\n\r\n        case WM_MOVE:\r\n            if (win)\r\n                RememberDefaultWindowPosition(*win);\r\n            break;\r\n\r\n        case WM_INITMENUPOPUP:\r\n            UpdateMenu(win, (HMENU)wParam);\r\n            break;\r\n\r\n        case WM_COMMAND:\r\n            return FrameOnCommand(win, hwnd, msg, wParam, lParam);\r\n\r\n        case WM_APPCOMMAND:\r\n            // both keyboard and mouse drivers should produce WM_APPCOMMAND\r\n            // messages for their special keys, so handle these here and return\r\n            // TRUE so as to not make them bubble up further\r\n            switch (GET_APPCOMMAND_LPARAM(lParam)) {\r\n            case APPCOMMAND_BROWSER_BACKWARD:\r\n                SendMessage(hwnd, WM_COMMAND, IDM_GOTO_NAV_BACK, 0);\r\n                return TRUE;\r\n            case APPCOMMAND_BROWSER_FORWARD:\r\n                SendMessage(hwnd, WM_COMMAND, IDM_GOTO_NAV_FORWARD, 0);\r\n                return TRUE;\r\n            case APPCOMMAND_BROWSER_REFRESH:\r\n                SendMessage(hwnd, WM_COMMAND, IDM_REFRESH, 0);\r\n                return TRUE;\r\n            case APPCOMMAND_BROWSER_SEARCH:\r\n                SendMessage(hwnd, WM_COMMAND, IDM_FIND_FIRST, 0);\r\n                return TRUE;\r\n            case APPCOMMAND_BROWSER_FAVORITES:\r\n                SendMessage(hwnd, WM_COMMAND, IDM_VIEW_BOOKMARKS, 0);\r\n                return TRUE;\r\n            }\r\n            return DefWindowProc(hwnd, msg, wParam, lParam);\r\n\r\n        case WM_CHAR:\r\n            if (win)\r\n                FrameOnChar(*win, wParam, lParam);\r\n            break;\r\n\r\n        case WM_KEYDOWN:\r\n            if (win)\r\n                FrameOnKeydown(win, wParam, lParam);\r\n            break;\r\n\r\n        case WM_SYSKEYUP:\r\n            // pressing and releasing the Alt key focuses the menu even if\r\n            // the wheel has been used for scrolling horizontally, so we\r\n            // have to suppress that effect explicitly in this situation\r\n            if (VK_MENU == wParam && gSuppressAltKey) {\r\n                gSuppressAltKey = false;\r\n                return 0;\r\n            }\r\n            return DefWindowProc(hwnd, msg, wParam, lParam);\r\n\r\n        case WM_SYSCHAR:\r\n            if (win && FrameOnSysChar(*win, wParam))\r\n                return 0;\r\n            return DefWindowProc(hwnd, msg, wParam, lParam);\r\n\r\n        case WM_SYSCOMMAND:\r\n            // temporarily show the menu bar if it has been hidden\r\n            if (wParam == SC_KEYMENU && win && win->isMenuHidden)\r\n                ShowHideMenuBar(win, true);\r\n            return DefWindowProc(hwnd, msg, wParam, lParam);\r\n\r\n        case WM_EXITMENULOOP:\r\n            // hide the menu bar again if it was shown only temporarily\r\n            if (!wParam && win && win->isMenuHidden)\r\n                SetMenu(hwnd, nullptr);\r\n            return DefWindowProc(hwnd, msg, wParam, lParam);\r\n\r\n        case WM_CONTEXTMENU:\r\n            // opening the context menu with a keyboard doesn't call the canvas'\r\n            // WM_CONTEXTMENU, as it never has the focus (mouse right-clicks are\r\n            // handled as expected)\r\n            if (win && GET_X_LPARAM(lParam) == -1 && GET_Y_LPARAM(lParam) == -1 && GetFocus() != win->hwndTocTree)\r\n                return SendMessage(win->hwndCanvas, WM_CONTEXTMENU, wParam, lParam);\r\n            return DefWindowProc(hwnd, msg, wParam, lParam);\r\n\r\n        case WM_SETTINGCHANGE:\r\nInitMouseWheelInfo:\r\n            UpdateDeltaPerLine();\r\n\r\n            if (win) {\r\n                // in tablets it's possible to rotate the screen. if we're\r\n                // in full screen, resize our window to match new screen size\r\n                if (win->presentation)\r\n                    EnterFullScreen(win, true);\r\n                else if (win->isFullScreen)\r\n                    EnterFullScreen(win, false);\r\n            }\r\n\r\n            return 0;\r\n\r\n        case WM_SYSCOLORCHANGE:\r\n            if (gGlobalPrefs->useSysColors)\r\n                UpdateDocumentColors();\r\n            break;\r\n\r\n        case WM_MOUSEWHEEL:\r\n        case WM_MOUSEHWHEEL:\r\n            if (!win || !win->IsDocLoaded())\r\n                break;\r\n            if (win->AsChm()) {\r\n                return win->AsChm()->PassUIMsg(msg, wParam, lParam);\r\n            }\r\n            CrashIf(!win->AsFixed() && !win->AsEbook());\r\n            // Pass the message to the canvas' window procedure\r\n            // (required since the canvas itself never has the focus and thus\r\n            // never receives WM_MOUSEWHEEL messages)\r\n            return SendMessage(win->hwndCanvas, msg, wParam, lParam);\r\n\r\n        case WM_CLOSE:\r\n            if (MayCloseWindow(win))\r\n                CloseWindow(win, true);\r\n            break;\r\n\r\n        case WM_DESTROY:\r\n            /* WM_DESTROY is generated by windows when close button is pressed\r\n               or if we explicitly call DestroyWindow()\r\n               It might be sent as a result of File\\Close, in which\r\n               case CloseWindow() has already been called. */\r\n            if (win)\r\n                CloseWindow(win, true, true);\r\n            break;\r\n\r\n        case WM_ENDSESSION:\r\n            // TODO: check for unfinished print jobs in WM_QUERYENDSESSION?\r\n            prefs::Save();\r\n            break;\r\n\r\n        case WM_DDE_INITIATE:\r\n            if (gPluginMode)\r\n                break;\r\n            return OnDDEInitiate(hwnd, wParam, lParam);\r\n        case WM_DDE_EXECUTE:\r\n            return OnDDExecute(hwnd, wParam, lParam);\r\n        case WM_DDE_TERMINATE:\r\n            return OnDDETerminate(hwnd, wParam, lParam);\r\n\r\n        case WM_COPYDATA:\r\n            return OnCopyData(hwnd, wParam, lParam);\r\n\r\n        case WM_TIMER:\r\n            if (win && win->stressTest) {\r\n                OnStressTestTimer(win, (int)wParam);\r\n            }\r\n            break;\r\n\r\n        case WM_MOUSEACTIVATE:\r\n            if (win && win->presentation && hwnd != GetForegroundWindow())\r\n                return MA_ACTIVATEANDEAT;\r\n            return MA_ACTIVATE;\r\n\r\n        case WM_NOTIFY:\r\n            if (wParam == IDC_TABBAR) {\r\n                if (win)\r\n                    return TabsOnNotify(win, lParam);\r\n            }\r\n            return DefWindowProc(hwnd, msg, wParam, lParam);\r\n\r\n        case WM_ERASEBKGND:\r\n            return TRUE;\r\n\r\n        default:\r\n            return DefWindowProc(hwnd, msg, wParam, lParam);\r\n    }\r\n    return 0;\r\n}\r\n\r\nvoid GetProgramInfo(str::Str<char>& s)\r\n{\r\n    s.AppendFmt(\"Ver: %s\", CURR_VERSION_STRA);\r\n#if defined(SVN_PRE_RELEASE_VER)\r\n    s.AppendFmt(\" pre-release\");\r\n#endif\r\n    if (IsProcess64()) {\r\n        s.Append(\" 64-bit\");\r\n    }\r\n#ifdef DEBUG\r\n    if (!str::Find(s.Get(), \" (dbg)\"))\r\n        s.Append(\" (dbg)\");\r\n#endif\r\n    if (gPluginMode)\r\n        s.Append(\" [plugin]\");\r\n    s.Append(\"\\r\\n\");\r\n\r\n#if defined(GIT_COMMIT_ID)\r\n    const char *gitSha1 = QM(GIT_COMMIT_ID);\r\n    s.AppendFmt(\"Git: %s (https://github.com/sumatrapdfreader/sumatrapdf/tree/%s)\\r\\n\", gitSha1, gitSha1);\r\n#endif\r\n}\r\n\r\nbool CrashHandlerCanUseNet()\r\n{\r\n    return HasPermission(Perm_InternetAccess);\r\n}\r\n\r\nvoid ShowCrashHandlerMessage()\r\n{\r\n    // don't show a message box in restricted use, as the user most likely won't be\r\n    // able to do anything about it anyway and it's up to the application provider\r\n    // to fix the unexpected behavior (of which for a restricted set of documents\r\n    // there should be much less, anyway)\r\n    if (!HasPermission(Perm_DiskAccess)) {\r\n        return;\r\n    }\r\n\r\n#if 0\r\n    int res = MessageBox(nullptr, _TR(\"Sorry, that shouldn't have happened!\\n\\nPlease press 'Cancel', if you want to help us fix the cause of this crash.\"), _TR(\"SumatraPDF crashed\"), MB_ICONERROR | MB_OKCANCEL | MbRtlReadingMaybe());\r\n    if (IDCANCEL == res)\r\n        LaunchBrowser(CRASH_REPORT_URL);\r\n#endif\r\n\r\n    // TODO: maybe launch notepad with crash report?\r\n    MessageBoxA(nullptr, \"We're sorry, SumatraPDF crashed.\", \"SumatraPDF crashed\", MB_ICONERROR | MB_OK | MbRtlReadingMaybe());\r\n}\r\n"
  },
  {
    "path": "src/SumatraPDF.exe.manifest",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">\n\t<dependency>\n\t\t<dependentAssembly>\n\t\t\t<assemblyIdentity\n\t\t\t\tname=\"Microsoft.Windows.Common-Controls\"\n\t\t\t\tversion=\"6.0.0.0\"\n\t\t\t\ttype=\"win32\"\n\t\t\t\tprocessorArchitecture=\"*\"\n\t\t\t\tpublicKeyToken=\"6595b64144ccf1df\"\n\t\t\t\tlanguage=\"*\"\n\t\t\t/>\n\t\t</dependentAssembly>\n\t</dependency>\n\t<trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n\t\t<security>\n\t\t\t<requestedPrivileges>\n\t\t\t\t<requestedExecutionLevel level=\"asInvoker\" uiAccess=\"false\"/>\n\t\t\t</requestedPrivileges>\n\t\t</security>\n\t</trustInfo>\n\t<application xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n\t\t<windowsSettings>\n\t\t\t<dpiAware xmlns=\"http://schemas.microsoft.com/SMI/2005/WindowsSettings\">True</dpiAware>\n\t\t</windowsSettings>\n\t</application>\n\t<compatibility xmlns=\"urn:schemas-microsoft-com:compatibility.v1\">\n\t\t<application>\n\t\t\t<!-- Windows Vista -->\n\t\t\t<supportedOS Id=\"{e2011457-1546-43c5-a5fe-008deee3d3f0}\"/>\n\t\t\t<!-- Windows 7 -->\n\t\t\t<supportedOS Id=\"{35138b9a-5d96-4fbd-8e2d-a2440225f93a}\"/>\n\t\t\t<!-- Windows 8 -->\n\t\t\t<supportedOS Id=\"{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}\"/>\n\t\t\t<!-- Windows 8.1 -->\n\t\t\t<supportedOS Id=\"{1f676c76-80e1-4239-95bb-83d0f6d0da78}\"/>\n\t\t\t<!-- Windows 10 -->\n\t\t\t<supportedOS Id=\"{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}\"/>\n\t\t</application>\n\t</compatibility>\n</assembly>\n"
  },
  {
    "path": "src/SumatraPDF.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: GPLv3 */\n\n#define CANVAS_CLASS_NAME       L\"SUMATRA_PDF_CANVAS\"\n#define FRAME_CLASS_NAME        L\"SUMATRA_PDF_FRAME\"\n#define SUMATRA_WINDOW_TITLE    L\"SumatraPDF\"\n\n#define WEBSITE_MAIN_URL         L\"http://www.sumatrapdfreader.org/\"\n#define WEBSITE_MANUAL_URL       L\"http://www.sumatrapdfreader.org/manual.html\"\n#define WEBSITE_TRANSLATIONS_URL L\"https://github.com/sumatrapdfreader/sumatrapdf/wiki/Contribute-translation\"\n\n#ifndef CRASH_REPORT_URL\n#define CRASH_REPORT_URL         L\"http://www.sumatrapdfreader.org/develop.html\"\n#endif\n\n// Background color comparison:\n// Adobe Reader X   0x565656 without any frame border\n// Foxit Reader 5   0x9C9C9C with a pronounced frame shadow\n// PDF-XChange      0xACA899 with a 1px frame and a gradient shadow\n// Google Chrome    0xCCCCCC with a symmetric gradient shadow\n// Evince           0xD7D1CB with a pronounced frame shadow\n#ifdef DRAW_PAGE_SHADOWS\n// SumatraPDF (old) 0xCCCCCC with a pronounced frame shadow\n#define COL_WINDOW_BG           RGB(0xCC, 0xCC, 0xCC)\n#define COL_PAGE_FRAME          RGB(0x88, 0x88, 0x88)\n#define COL_PAGE_SHADOW         RGB(0x40, 0x40, 0x40)\n#else\n// SumatraPDF       0x999999 without any frame border\n#define COL_WINDOW_BG           RGB(0x99, 0x99, 0x99)\n#endif\n\n// scrolls half a page down/up (needed for Shift+Up/Down)\n#define SB_HPAGEUP   (WM_USER + 1)\n#define SB_HPAGEDOWN (WM_USER + 2)\n\n#define HIDE_CURSOR_TIMER_ID        3\n#define HIDE_CURSOR_DELAY_IN_MS     3000\n\n#define REPAINT_TIMER_ID            1\n#define REPAINT_MESSAGE_DELAY_IN_MS 1000\n\n#define AUTO_RELOAD_TIMER_ID        5\n#define AUTO_RELOAD_DELAY_IN_MS     100\n\n#define EBOOK_LAYOUT_TIMER_ID       7\n\n// permissions that can be revoked through sumatrapdfrestrict.ini or the -restrict command line flag\nenum {\n    // enables Update checks, crash report submitting and hyperlinks\n    Perm_InternetAccess     = 1 << 0,\n    // enables opening and saving documents and launching external viewers\n    Perm_DiskAccess         = 1 << 1,\n    // enables persistence of preferences to disk (includes the Frequently Read page and Favorites)\n    Perm_SavePreferences    = 1 << 2,\n    // enables setting as default viewer\n    Perm_RegistryAccess     = 1 << 3,\n    // enables printing\n    Perm_PrinterAccess      = 1 << 4,\n    // enables image/text selections and selection copying (if permitted by the document)\n    Perm_CopySelection      = 1 << 5,\n    // enables fullscreen and presentation view modes\n    Perm_FullscreenAccess   = 1 << 6,\n    // enables all of the above\n    Perm_All                = 0x0FFFFFF,\n    // set if either sumatrapdfrestrict.ini or the -restrict command line flag is present\n    Perm_RestrictedUse      = 0x1000000,\n};\n\nenum MenuToolbarFlags {\n    MF_NO_TRANSLATE      = 1 << 0,\n    MF_PLUGIN_MODE_ONLY  = 1 << 1,\n    MF_NOT_FOR_CHM       = 1 << 2,\n    MF_NOT_FOR_EBOOK_UI  = 1 << 3,\n    MF_CBX_ONLY          = 1 << 4,\n#define PERM_FLAG_OFFSET 5\n    MF_REQ_INET_ACCESS   = Perm_InternetAccess << PERM_FLAG_OFFSET,\n    MF_REQ_DISK_ACCESS   = Perm_DiskAccess << PERM_FLAG_OFFSET,\n    MF_REQ_PREF_ACCESS   = Perm_SavePreferences << PERM_FLAG_OFFSET,\n    MF_REQ_PRINTER_ACCESS= Perm_PrinterAccess << PERM_FLAG_OFFSET,\n    MF_REQ_ALLOW_COPY    = Perm_CopySelection << PERM_FLAG_OFFSET,\n    MF_REQ_FULLSCREEN    = Perm_FullscreenAccess << PERM_FLAG_OFFSET,\n};\n\n/* styling for About/Properties windows */\n\n#define LEFT_TXT_FONT           L\"Arial\"\n#define LEFT_TXT_FONT_SIZE      12\n#define RIGHT_TXT_FONT          L\"Arial Black\"\n#define RIGHT_TXT_FONT_SIZE     12\n// for backward compatibility use a value that older versions will render as yellow\n#define ABOUT_BG_COLOR_DEFAULT  (RGB(0xff, 0xf2, 0) - 0x80000000)\n\nclass Controller;\nclass Favorites;\nclass FileHistory;\nclass WindowInfo;\nclass NotificationWnd;\nclass RenderCache;\nclass TabInfo;\nstruct LabelWithCloseWnd;\nstruct SessionData;\n\n// all defined in SumatraPDF.cpp\nextern bool                     gDebugShowLinks;\nextern bool                     gShowFrameRate;\n\nextern const WCHAR *            gPluginURL;\nextern Vec<WindowInfo*>         gWindows;\nextern Favorites                gFavorites;\nextern FileHistory              gFileHistory;\nextern WNDPROC                  DefWndProcCloseButton;\nextern RenderCache              gRenderCache;\nextern bool                     gShowFrameRate;\nextern bool                     gSuppressAltKey;\nextern HBITMAP                  gBitmapReloadingCue;\nextern HCURSOR                  gCursorDrag;\nextern bool                     gCrashOnOpen;\n\n#define gPluginMode             (gPluginURL != nullptr)\n\nvoid  InitializePolicies(bool restrict);\nvoid  RestrictPolicies(int revokePermission);\nbool  HasPermission(int permission);\nbool  IsUIRightToLeft();\nbool  LaunchBrowser(const WCHAR *url);\nbool  OpenFileExternally(const WCHAR *path);\nvoid  AssociateExeWithPdfExtension();\nvoid  CloseTab(WindowInfo *win, bool quitIfLast=false);\nbool  MayCloseWindow(WindowInfo *win);\nvoid  CloseWindow(WindowInfo *win, bool quitIfLast, bool forceClose=false);\nvoid  SetSidebarVisibility(WindowInfo *win, bool tocVisible, bool favVisible);\nvoid  RememberFavTreeExpansionState(WindowInfo *win);\nvoid  LayoutTreeContainer(LabelWithCloseWnd *l, HWND hwndTree);\nvoid  AdvanceFocus(WindowInfo* win);\nbool  WindowInfoStillValid(WindowInfo *win);\nvoid  SetCurrentLanguageAndRefreshUI(const char *langCode);\nvoid  UpdateDocumentColors();\nvoid  UpdateTabFileDisplayStateForWin(WindowInfo *win, TabInfo *td);\nbool  FrameOnKeydown(WindowInfo* win, WPARAM key, LPARAM lparam, bool inTextfield=false);\nvoid  ReloadDocument(WindowInfo *win, bool autorefresh=false);\nvoid  OnMenuViewFullscreen(WindowInfo* win, bool presentation=false);\nvoid  RelayoutWindow(WindowInfo *win);\n\nCOLORREF GetLogoBgColor();\nCOLORREF GetAboutBgColor();\nCOLORREF GetNoDocBgColor();\n\nWindowInfo* FindWindowInfoByHwnd(HWND hwnd);\n// note: background tabs are only searched if focusTab is true\nWindowInfo* FindWindowInfoByFile(const WCHAR *file, bool focusTab);\nWindowInfo* FindWindowInfoBySyncFile(const WCHAR *file, bool focusTab);\nWindowInfo* FindWindowInfoByTab(TabInfo *tab);\nWindowInfo* FindWindowInfoByController(Controller *ctrl);\n\n// LoadDocument carries a lot of state, this holds them in\n// one place\nstruct LoadArgs\n{\n    explicit LoadArgs(const WCHAR *fileName, WindowInfo *win=nullptr) :\n        fileName(fileName), win(win), showWin(true), forceReuse(false),\n        isNewWindow(false), placeWindow(true) { }\n\n    const WCHAR *fileName;\n    WindowInfo *win;\n    bool showWin;\n    bool forceReuse;\n    // for internal use\n    bool isNewWindow;\n    bool placeWindow;\n};\n\nWindowInfo* LoadDocument(LoadArgs& args);\nWindowInfo *CreateAndShowWindowInfo(SessionData *data=nullptr);\n\nUINT MbRtlReadingMaybe();\nvoid MessageBoxWarning(HWND hwnd, const WCHAR *msg, const WCHAR *title = nullptr);\nvoid UpdateCursorPositionHelper(WindowInfo *win, PointI pos, NotificationWnd *wnd);\nbool DocumentPathExists(const WCHAR *path);\nvoid EnterFullScreen(WindowInfo* win, bool presentation=false);\nvoid ExitFullScreen(WindowInfo* win);\nvoid SetCurrentLang(const char *langCode);\nvoid GetFixedPageUiColors(COLORREF& text, COLORREF& bg);\nvoid GetEbookUiColors(COLORREF& text, COLORREF& bg);\nvoid RebuildMenuBarForWindow(WindowInfo *win);\nvoid UpdateCheckAsync(WindowInfo *win, bool autoCheck);\nvoid DeleteWindowInfo(WindowInfo *win);\n\nLRESULT CALLBACK WndProcFrame(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);\n"
  },
  {
    "path": "src/SumatraPDF.rc",
    "content": "// Microsoft Visual C++ generated resource script.\r\n//\r\n#include \"resource.h\"\r\n#include \"Version.h\"\r\n\r\n#define APSTUDIO_READONLY_SYMBOLS\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Generated from the TEXTINCLUDE 2 resource.\r\n//\r\n#define APSTUDIO_HIDDEN_SYMBOLS\r\n#include \"windows.h\"\r\n#undef APSTUDIO_HIDDEN_SYMBOLS\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n#undef APSTUDIO_READONLY_SYMBOLS\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n// English (United States) resources\r\n\r\n#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\nLANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US\r\n#pragma code_page(1252)\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Version\r\n//\r\n\r\nVS_VERSION_INFO VERSIONINFO\r\n FILEVERSION VER_RESOURCE\r\n PRODUCTVERSION VER_RESOURCE\r\n FILEFLAGSMASK 0x0L\r\n#ifdef _DEBUG\r\n FILEFLAGS 0x1L\r\n#else\r\n FILEFLAGS 0x0L\r\n#endif\r\n FILEOS 0x40004L\r\n FILETYPE 0x1L\r\n FILESUBTYPE 0x0L\r\nBEGIN\r\n    BLOCK \"StringFileInfo\"\r\n    BEGIN\r\n        BLOCK \"040904E4\"\r\n        BEGIN\r\n            VALUE \"FileDescription\", \"SumatraPDF\"\r\n            VALUE \"FileVersion\", VER_RESOURCE_STR\r\n            VALUE \"LegalCopyright\", COPYRIGHT_STR\r\n            VALUE \"OriginalFilename\", \"SumatraPDF.exe\"\r\n            VALUE \"ProductName\", \"SumatraPDF\"\r\n            VALUE \"ProductVersion\", VER_RESOURCE_STR\r\n            VALUE \"CompanyName\", PUBLISHER_STR\r\n        END\r\n    END\r\n    BLOCK \"VarFileInfo\"\r\n    BEGIN\r\n        VALUE \"Translation\", 0x409, 1252\r\n    END\r\nEND\r\n\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Icon\r\n//\r\n\r\n// Icon with lowest ID value placed first to ensure application icon\r\n// remains consistent on all systems.\r\nIDI_SUMATRAPDF          ICON                    \"SumatraPDF-smaller.ico\"\r\nIDI_PDFDOC              ICON                    \"PdfDoc.ico\"\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Accelerator\r\n//\r\n\r\nIDC_SUMATRAPDF ACCELERATORS\r\nBEGIN\r\n    \"A\",            IDM_SELECT_ALL,         VIRTKEY, CONTROL\r\n    \"C\",            IDM_COPY_SELECTION,     VIRTKEY, CONTROL\r\n    \"D\",            IDM_PROPERTIES,         VIRTKEY, CONTROL\r\n    \"F\",            IDM_FIND_FIRST,         VIRTKEY, CONTROL\r\n    \"G\",            IDM_GOTO_PAGE,          VIRTKEY, CONTROL\r\n    \"L\",            IDM_VIEW_PRESENTATION_MODE, VIRTKEY, CONTROL\r\n    \"L\",            IDM_VIEW_FULLSCREEN,    VIRTKEY, SHIFT, CONTROL\r\n    \"O\",            IDM_OPEN,               VIRTKEY, CONTROL\r\n    \"S\",            IDM_SAVEAS,             VIRTKEY, CONTROL\r\n    \"S\",            IDM_SAVEAS_BOOKMARK,    VIRTKEY, SHIFT, CONTROL\r\n    \"P\",            IDM_PRINT,              VIRTKEY, CONTROL\r\n    \"Q\",            IDM_EXIT,               VIRTKEY, CONTROL\r\n    \"W\",            IDM_CLOSE,              VIRTKEY, CONTROL\r\n    \"Y\",            IDM_ZOOM_CUSTOM,        VIRTKEY, CONTROL\r\n    \"0\",            IDM_ZOOM_FIT_PAGE,      VIRTKEY, CONTROL\r\n    VK_NUMPAD0,     IDM_ZOOM_FIT_PAGE,      VIRTKEY, CONTROL\r\n    \"1\",            IDM_ZOOM_ACTUAL_SIZE,   VIRTKEY, CONTROL\r\n    VK_NUMPAD1,     IDM_ZOOM_ACTUAL_SIZE,   VIRTKEY, CONTROL\r\n    \"2\",            IDM_ZOOM_FIT_WIDTH,     VIRTKEY, CONTROL\r\n    VK_NUMPAD2,     IDM_ZOOM_FIT_WIDTH,     VIRTKEY, CONTROL\r\n    \"3\",            IDM_ZOOM_FIT_CONTENT,   VIRTKEY, CONTROL\r\n    VK_NUMPAD3,     IDM_ZOOM_FIT_CONTENT,   VIRTKEY, CONTROL\r\n    \"6\",            IDM_VIEW_SINGLE_PAGE,   VIRTKEY, CONTROL\r\n    VK_NUMPAD6,     IDM_VIEW_SINGLE_PAGE,   VIRTKEY, CONTROL\r\n    \"7\",            IDM_VIEW_FACING,        VIRTKEY, CONTROL\r\n    VK_NUMPAD7,     IDM_VIEW_FACING,        VIRTKEY, CONTROL\r\n    \"8\",            IDM_VIEW_BOOK,          VIRTKEY, CONTROL\r\n    VK_NUMPAD8,     IDM_VIEW_BOOK,          VIRTKEY, CONTROL\r\n    VK_ADD,         IDT_VIEW_ZOOMIN,        VIRTKEY, CONTROL\r\n    VK_ADD,         IDM_VIEW_ROTATE_RIGHT,  VIRTKEY, SHIFT, CONTROL\r\n    VK_OEM_PLUS,    IDT_VIEW_ZOOMIN,        VIRTKEY, CONTROL\r\n    VK_OEM_PLUS,    IDM_VIEW_ROTATE_RIGHT,  VIRTKEY, SHIFT, CONTROL\r\n    VK_INSERT,      IDM_COPY_SELECTION,     VIRTKEY, CONTROL\r\n    VK_F2,          IDM_RENAME_FILE,        VIRTKEY\r\n    VK_F3,          IDM_FIND_NEXT,          VIRTKEY\r\n    VK_F3,          IDM_FIND_PREV,          VIRTKEY, SHIFT\r\n    VK_F3,          IDM_FIND_NEXT_SEL,      VIRTKEY, CONTROL\r\n    VK_F3,          IDM_FIND_PREV_SEL,      VIRTKEY, SHIFT, CONTROL\r\n    VK_F4,          IDM_CLOSE,              VIRTKEY, CONTROL\r\n    VK_F5,          IDM_VIEW_PRESENTATION_MODE, VIRTKEY\r\n    VK_F6,          IDM_MOVE_FRAME_FOCUS,   VIRTKEY\r\n    VK_F8,          IDM_VIEW_SHOW_HIDE_TOOLBAR, VIRTKEY\r\n    VK_F9,          IDM_VIEW_SHOW_HIDE_MENUBAR, VIRTKEY\r\n    VK_F11,         IDM_VIEW_FULLSCREEN,    VIRTKEY\r\n    VK_F11,         IDM_VIEW_PRESENTATION_MODE, VIRTKEY, SHIFT\r\n    VK_F12,         IDM_VIEW_BOOKMARKS,     VIRTKEY\r\n    VK_SUBTRACT,    IDT_VIEW_ZOOMOUT,       VIRTKEY, CONTROL\r\n    VK_SUBTRACT,    IDM_VIEW_ROTATE_LEFT,   VIRTKEY, SHIFT, CONTROL\r\n    VK_OEM_MINUS,   IDT_VIEW_ZOOMOUT,       VIRTKEY, CONTROL\r\n    VK_OEM_MINUS,   IDM_VIEW_ROTATE_LEFT,   VIRTKEY, SHIFT, CONTROL\r\n    VK_LEFT,        IDM_GOTO_NAV_BACK,      VIRTKEY, ALT\r\n    VK_RIGHT,       IDM_GOTO_NAV_FORWARD,   VIRTKEY, ALT\r\nEND\r\n\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Bitmap\r\n//\r\n\r\nIDB_TOOLBAR             BITMAP                  \"toolbar_11.bmp\"\r\nIDB_RELOADING_CUE       BITMAP                  \"reloading.bmp\"\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Dialog\r\n//\r\n\r\nIDD_DIALOG_GOTO_PAGE DIALOGEX 0, 0, 158, 45\r\nSTYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU\r\nCAPTION \"Go to page\"\r\nFONT 8, \"MS Shell Dlg\", 400, 0, 0x1\r\nBEGIN\r\n    LTEXT           \"&Go to page:\",IDC_STATIC,6,8,60,9\r\n    EDITTEXT        IDC_GOTO_PAGE_EDIT,66,6,30,13,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER\r\n    LTEXT           \"(of 99999)\",IDC_GOTO_PAGE_LABEL_OF,102,8,50,9\r\n    DEFPUSHBUTTON   \"Go to page\",IDOK,27,25,70,14\r\n    PUSHBUTTON      \"Cancel\",IDCANCEL,102,25,50,14\r\nEND\r\n\r\nIDD_DIALOG_FIND DIALOGEX 0, 0, 247, 52\r\nSTYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU\r\nCAPTION \"Find\"\r\nFONT 8, \"MS Shell Dlg\", 400, 0, 0x1\r\nBEGIN\r\n    LTEXT           \"&Find what:\",IDC_STATIC,6,8,60,9\r\n    EDITTEXT        IDC_FIND_EDIT,66,6,120,13,ES_AUTOHSCROLL\r\n    CONTROL         \"&Match case\",IDC_MATCH_CASE,\"Button\",BS_AUTOCHECKBOX | WS_TABSTOP,6,24,180,9\r\n    LTEXT           \"Hint: Use the F3 key for finding again\",IDC_FIND_NEXT_HINT,6,37,180,9,WS_DISABLED\r\n    DEFPUSHBUTTON   \"Find\",IDOK,191,6,50,14\r\n    PUSHBUTTON      \"Cancel\",IDCANCEL,191,24,50,14\r\nEND\r\n\r\nIDD_DIALOG_PDF_ASSOCIATE DIALOGEX 0, 0, 250, 55\r\nSTYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU\r\nCAPTION \"Associate with PDF files?\"\r\nFONT 8, \"MS Shell Dlg\", 400, 0, 0x1\r\nBEGIN\r\n    LTEXT           \"\",IDC_STATIC,6,6,238,9\r\n    CONTROL         \"\",IDC_DONT_ASK_ME_AGAIN,\"Button\",BS_AUTOCHECKBOX | WS_TABSTOP,6,20,238,9\r\n    DEFPUSHBUTTON   \"&Yes\",IDOK,138,35,50,14\r\n    PUSHBUTTON      \"&No\",IDCANCEL,194,35,50,14\r\nEND\r\n\r\nIDD_DIALOG_GET_PASSWORD DIALOGEX 0, 0, 182, 71\r\nSTYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU\r\nCAPTION \"Enter password\"\r\nFONT 8, \"MS Shell Dlg\", 400, 0, 0x1\r\nBEGIN\r\n    LTEXT           \"Enter password for test.pdf\",IDC_GET_PASSWORD_LABEL,6,6,170,9\r\n    LTEXT           \"&Password:\",IDC_STATIC,6,22,64,9\r\n    EDITTEXT        IDC_GET_PASSWORD_EDIT,70,20,106,13,ES_PASSWORD | ES_AUTOHSCROLL\r\n    CONTROL         \"&Remember the password for this file\",IDC_REMEMBER_PASSWORD,\r\n                    \"Button\",BS_AUTOCHECKBOX | WS_TABSTOP,6,37,170,9\r\n    DEFPUSHBUTTON   \"OK\",IDOK,70,51,50,14\r\n    PUSHBUTTON      \"Cancel\",IDCANCEL,126,51,50,14\r\nEND\r\n\r\nIDD_DIALOG_CHANGE_LANGUAGE DIALOGEX 0, 0, 200, 259\r\nSTYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME\r\nCAPTION \"Change Language\"\r\nFONT 8, \"MS Shell Dlg\", 400, 0, 0x1\r\nBEGIN\r\n    LISTBOX         IDC_CHANGE_LANG_LANG_LIST,6,6,188,227,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP\r\n    DEFPUSHBUTTON   \"OK\",IDOK,88,239,50,14\r\n    PUSHBUTTON      \"Cancel\",IDCANCEL,144,239,50,14\r\nEND\r\n\r\nIDD_DIALOG_NEW_VERSION DIALOGEX 0, 0, 260, 69\r\nSTYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU\r\nCAPTION \"New version available\"\r\nFONT 8, \"MS Shell Dlg\", 400, 0, 0x1\r\nBEGIN\r\n    LTEXT           \"\",IDC_YOU_HAVE,6,6,248,9\r\n    LTEXT           \"\",IDC_NEW_AVAILABLE,6,20,248,9\r\n    CONTROL         \"\",IDC_SKIP_THIS_VERSION,\"Button\",BS_AUTOCHECKBOX | WS_TABSTOP,6,34,248,9\r\n    DEFPUSHBUTTON   \"Download\",IDOK,108,49,70,14\r\n    PUSHBUTTON      \"&No, thanks\",IDCANCEL,184,49,70,14\r\nEND\r\n\r\nIDD_DIALOG_SETTINGS DIALOGEX 0, 0, 240, 241\r\nSTYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU\r\nCAPTION \"Settings\"\r\nFONT 8, \"MS Shell Dlg\", 400, 0, 0x1\r\nBEGIN\r\n    GROUPBOX        \"View\",IDC_SECTION_VIEW,6,6,228,75\r\n    LTEXT           \"Default &Layout:\",IDC_DEFAULT_LAYOUT_LABEL,12,19,108,9\r\n    COMBOBOX        IDC_DEFAULT_LAYOUT,120,17,108,64,CBS_DROPDOWNLIST | WS_TABSTOP\r\n    LTEXT           \"Default &Zoom:\",IDC_DEFAULT_ZOOM_LABEL,12,36,108,9\r\n    COMBOBOX        IDC_DEFAULT_ZOOM,120,34,108,149,CBS_DROPDOWN | WS_TABSTOP\r\n    CONTROL         \"Show the &bookmarks sidebar when available\",IDC_DEFAULT_SHOW_TOC,\r\n                    \"Button\",BS_AUTOCHECKBOX | WS_TABSTOP,12,53,216,9\r\n    CONTROL         \"&Remember these settings for each document\",IDC_REMEMBER_STATE_PER_DOCUMENT,\r\n                    \"Button\",BS_AUTOCHECKBOX | WS_TABSTOP,12,66,216,9\r\n    GROUPBOX        \"Advanced\",IDC_SECTION_ADVANCED,6,87,228,70\r\n    CONTROL         \"Use &tabs\",IDC_USE_TABS,\r\n                    \"Button\",BS_AUTOCHECKBOX | WS_TABSTOP,12,97,216,9\r\n    CONTROL         \"Automatically check for &updates\",IDC_CHECK_FOR_UPDATES,\r\n                    \"Button\",BS_AUTOCHECKBOX | WS_TABSTOP,12,110,216,9\r\n    CONTROL         \"Remember &opened files\",IDC_REMEMBER_OPENED_FILES,\"Button\",BS_AUTOCHECKBOX | WS_TABSTOP,12,123,216,9\r\n    PUSHBUTTON      \"Make SumatraPDF a default PDF reader\",IDC_SET_DEFAULT_READER,12,137,216,14\r\n    GROUPBOX        \"Set inverse search command-line\",IDC_SECTION_INVERSESEARCH,6,163,228,52\r\n    LTEXT           \"Enter the command-line to invoke when you double-click on the PDF document:\",IDC_CMDLINE_LABEL,12,175,216,18\r\n    COMBOBOX        IDC_CMDLINE,12,195,216,13,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | WS_TABSTOP\r\n    DEFPUSHBUTTON   \"OK\",IDOK,128,221,50,14\r\n    PUSHBUTTON      \"Cancel\",IDCANCEL,184,221,50,14\r\nEND\r\n\r\nIDD_DIALOG_CUSTOM_ZOOM DIALOGEX 0, 0, 116, 60\r\nSTYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU\r\nCAPTION \"Zoom factor\"\r\nFONT 8, \"MS Shell Dlg\", 400, 0, 0x1\r\nBEGIN\r\n    LTEXT           \"&Magnification:\",IDC_STATIC,6,6,104,9\r\n    COMBOBOX        IDC_DEFAULT_ZOOM,6,20,104,149,CBS_DROPDOWN | WS_TABSTOP\r\n    DEFPUSHBUTTON   \"Zoom\",IDOK,6,40,50,14\r\n    PUSHBUTTON      \"Cancel\",IDCANCEL,60,40,50,14\r\nEND\r\n\r\nIDD_PROPSHEET_PRINT_ADVANCED DIALOGEX 0, 0, 292, 125\r\nSTYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU\r\nCAPTION \"Advanced\"\r\nFONT 8, \"MS Shell Dlg\", 400, 0, 0x1\r\nBEGIN\r\n    GROUPBOX        \"Print range\",IDC_SECTION_PRINT_RANGE,7,7,278,52\r\n    CONTROL         \"&All selected pages\",IDC_PRINT_RANGE_ALL,\"Button\",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,14,18,264,9\r\n    CONTROL         \"&Odd pages only\",IDC_PRINT_RANGE_ODD,\"Button\",BS_AUTORADIOBUTTON | WS_TABSTOP,14,31,264,9\r\n    CONTROL         \"&Even pages only\",IDC_PRINT_RANGE_EVEN,\"Button\",BS_AUTORADIOBUTTON | WS_TABSTOP,14,44,264,9\r\n    GROUPBOX        \"Page scaling\",IDC_SECTION_PRINT_SCALE,7,62,278,52\r\n    CONTROL         \"&Shrink pages to printable area (if necessary)\",IDC_PRINT_SCALE_SHRINK,\r\n                    \"Button\",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,14,74,264,9\r\n    CONTROL         \"&Fit pages to printable area\",IDC_PRINT_SCALE_FIT,\r\n                    \"Button\",BS_AUTORADIOBUTTON | WS_TABSTOP,14,87,264,9\r\n    CONTROL         \"&Use original page sizes\",IDC_PRINT_SCALE_NONE,\"Button\",BS_AUTORADIOBUTTON | WS_TABSTOP,14,100,264,9\r\nEND\r\n\r\nIDD_DIALOG_FAV_ADD DIALOGEX 0, 0, 236, 71\r\nSTYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU\r\nCAPTION \"Add a favorite\"\r\nFONT 8, \"MS Shell Dlg\", 400, 0, 0x1\r\nBEGIN\r\n    DEFPUSHBUTTON   \"OK\",IDOK,123,50,50,14\r\n    PUSHBUTTON      \"Cancel\",IDCANCEL,179,50,50,14\r\n    LTEXT           \"Add page %s to favorites with (optional) name:\",IDC_ADD_PAGE_STATIC,7,8,222,8\r\n    EDITTEXT        IDC_FAV_NAME_EDIT,7,20,222,14,ES_AUTOHSCROLL\r\nEND\r\n\r\nIDD_EBOOK_WIN_DESC  RCDATA                      \"EbookWinDesc.txt\"\r\n#ifdef HAS_PUBLIC_APP_KEY\r\nIDD_PUBLIC_APP_KEY  RCDATA                      \"SumatraPDF.key\"\r\n#endif\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// RT_MANIFEST\r\n//\r\n\r\n1                       RT_MANIFEST             \"SumatraPDF.exe.manifest\"\r\n\r\n#ifdef APSTUDIO_INVOKED\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// TEXTINCLUDE\r\n//\r\n\r\n1 TEXTINCLUDE\r\nBEGIN\r\n    \"resource.h\\0\"\r\nEND\r\n\r\n2 TEXTINCLUDE\r\nBEGIN\r\n    \"#define APSTUDIO_HIDDEN_SYMBOLS\\r\\n\"\r\n    \"#include \"\"windows.h\"\"\\r\\n\"\r\n    \"#undef APSTUDIO_HIDDEN_SYMBOLS\\r\\n\"\r\n    \"\\0\"\r\nEND\r\n\r\n3 TEXTINCLUDE\r\nBEGIN\r\n    \"\\r\\n\"\r\n    \"\\0\"\r\nEND\r\n\r\n#endif    // APSTUDIO_INVOKED\r\n\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// DESIGNINFO\r\n//\r\n\r\n#ifdef APSTUDIO_INVOKED\r\nGUIDELINES DESIGNINFO\r\nBEGIN\r\n    IDD_DIALOG_GOTO_PAGE, DIALOG\r\n    BEGIN\r\n        LEFTMARGIN, 7\r\n        RIGHTMARGIN, 143\r\n        TOPMARGIN, 6\r\n    END\r\n\r\n    IDD_DIALOG_GET_PASSWORD, DIALOG\r\n    BEGIN\r\n        LEFTMARGIN, 7\r\n        RIGHTMARGIN, 169\r\n        TOPMARGIN, 7\r\n    END\r\n\r\n    IDD_DIALOG_CHANGE_LANGUAGE, DIALOG\r\n    BEGIN\r\n    END\r\n\r\n    IDD_DIALOG_SETTINGS, DIALOG\r\n    BEGIN\r\n        BOTTOMMARGIN, 157\r\n    END\r\n\r\n    IDD_DIALOG_FAV_ADD, DIALOG\r\n    BEGIN\r\n        LEFTMARGIN, 7\r\n        RIGHTMARGIN, 229\r\n        TOPMARGIN, 7\r\n        BOTTOMMARGIN, 64\r\n    END\r\nEND\r\n#endif    // APSTUDIO_INVOKED\r\n\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Cursor\r\n//\r\n\r\nIDC_CURSORDRAG          CURSOR                  \"dragcursor.cur\"\r\n#endif    // English (United States) resources\r\n/////////////////////////////////////////////////////////////////////////////\r\n\r\n\r\n\r\n#ifndef APSTUDIO_INVOKED\r\n/////////////////////////////////////////////////////////////////////////////\r\n//\r\n// Generated from the TEXTINCLUDE 3 resource.\r\n//\r\n\r\n\r\n/////////////////////////////////////////////////////////////////////////////\r\n#endif    // not APSTUDIO_INVOKED\r\n"
  },
  {
    "path": "src/SumatraProperties.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"FileUtil.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EngineManager.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"DisplayModel.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"WindowInfo.h\"\r\n#include \"resource.h\"\r\n#include \"SumatraProperties.h\"\r\n#include \"Translations.h\"\r\n\r\n#define PROPERTIES_LEFT_RIGHT_SPACE_DX  8\r\n#define PROPERTIES_RECT_PADDING         8\r\n#define PROPERTIES_TXT_DY_PADDING       2\r\n#define PROPERTIES_WIN_TITLE    _TR(\"Document Properties\")\r\n\r\nenum Magnitudes { KB = 1024, MB = 1024 * KB, GB = 1024 * MB };\r\n\r\nclass PropertyEl {\r\npublic:\r\n    PropertyEl(const WCHAR *leftTxt, WCHAR *rightTxt, bool isPath=false)\r\n        : leftTxt(leftTxt), rightTxt(rightTxt), isPath(isPath) { }\r\n\r\n    // A property is always in format: Name (left): Value (right)\r\n    // (leftTxt is static, rightTxt will be freed)\r\n    const WCHAR *   leftTxt;\r\n    ScopedMem<WCHAR>rightTxt;\r\n\r\n    // data calculated by the layout\r\n    RectI           leftPos;\r\n    RectI           rightPos;\r\n\r\n    // overlong paths get the ellipsis in the middle instead of at the end\r\n    bool            isPath;\r\n};\r\n\r\nclass PropertiesLayout : public Vec<PropertyEl *> {\r\npublic:\r\n    PropertiesLayout() : hwnd(nullptr), hwndParent(nullptr) { }\r\n    ~PropertiesLayout() { DeleteVecMembers(*this); }\r\n\r\n    void AddProperty(const WCHAR *key, WCHAR *value, bool isPath=false) {\r\n        // don't display value-less properties\r\n        if (!str::IsEmpty(value))\r\n            Append(new PropertyEl(key, value, isPath));\r\n        else\r\n            free(value);\r\n    }\r\n    bool HasProperty(const WCHAR *key) {\r\n        for (size_t i = 0; i < Count(); i++) {\r\n            if (str::Eq(key, At(i)->leftTxt))\r\n                return true;\r\n        }\r\n        return false;\r\n    }\r\n\r\n    HWND    hwnd;\r\n    HWND    hwndParent;\r\n};\r\n\r\nstatic Vec<PropertiesLayout*> gPropertiesWindows;\r\n\r\nstatic PropertiesLayout* FindPropertyWindowByParent(HWND hwndParent)\r\n{\r\n    for (size_t i = 0; i < gPropertiesWindows.Count(); i++) {\r\n        PropertiesLayout *pl = gPropertiesWindows.At(i);\r\n        if (pl->hwndParent == hwndParent)\r\n            return pl;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nstatic PropertiesLayout* FindPropertyWindowByHwnd(HWND hwnd)\r\n{\r\n    for (size_t i = 0; i < gPropertiesWindows.Count(); i++) {\r\n        PropertiesLayout *pl = gPropertiesWindows.At(i);\r\n        if (pl->hwnd == hwnd)\r\n            return pl;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nvoid DeletePropertiesWindow(HWND hwndParent)\r\n{\r\n    PropertiesLayout *pl = FindPropertyWindowByParent(hwndParent);\r\n    if (pl)\r\n        DestroyWindow(pl->hwnd);\r\n}\r\n\r\n// See: http://www.verypdf.com/pdfinfoeditor/pdf-date-format.htm\r\n// Format:  \"D:YYYYMMDDHHMMSSxxxxxxx\"\r\n// Example: \"D:20091222171933-05'00'\"\r\nstatic bool PdfDateParse(const WCHAR *pdfDate, SYSTEMTIME *timeOut)\r\n{\r\n    ZeroMemory(timeOut, sizeof(SYSTEMTIME));\r\n    // \"D:\" at the beginning is optional\r\n    if (str::StartsWith(pdfDate, L\"D:\"))\r\n        pdfDate += 2;\r\n    return str::Parse(pdfDate, L\"%4d%2d%2d\" L\"%2d%2d%2d\",\r\n        &timeOut->wYear, &timeOut->wMonth, &timeOut->wDay,\r\n        &timeOut->wHour, &timeOut->wMinute, &timeOut->wSecond) != nullptr;\r\n    // don't bother about the day of week, we won't display it anyway\r\n}\r\n\r\n// See: ISO 8601 specification\r\n// Format:  \"YYYY-MM-DDTHH:MM:SSZ\"\r\n// Example: \"2011-04-19T22:10:48Z\"\r\nstatic bool IsoDateParse(const WCHAR *isoDate, SYSTEMTIME *timeOut)\r\n{\r\n    ZeroMemory(timeOut, sizeof(SYSTEMTIME));\r\n    const WCHAR *end = str::Parse(isoDate, L\"%4d-%2d-%2d\", &timeOut->wYear, &timeOut->wMonth, &timeOut->wDay);\r\n    if (end) // time is optional\r\n        str::Parse(end, L\"T%2d:%2d:%2dZ\", &timeOut->wHour, &timeOut->wMinute, &timeOut->wSecond);\r\n    return end != nullptr;\r\n    // don't bother about the day of week, we won't display it anyway\r\n}\r\n\r\nstatic WCHAR *FormatSystemTime(SYSTEMTIME& date)\r\n{\r\n    WCHAR buf[512] = { 0 };\r\n    int cchBufLen = dimof(buf);\r\n    int ret = GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &date, nullptr, buf, cchBufLen);\r\n    if (ret < 2) // GetDateFormat() failed or returned an empty result\r\n        return nullptr;\r\n\r\n    // don't add 00:00:00 for dates without time\r\n    if (0 == date.wHour && 0 == date.wMinute && 0 == date.wSecond)\r\n        return str::Dup(buf);\r\n\r\n    WCHAR *tmp = buf + ret;\r\n    tmp[-1] = ' ';\r\n    ret = GetTimeFormat(LOCALE_USER_DEFAULT, 0, &date, nullptr, tmp, cchBufLen - ret);\r\n    if (ret < 2) // GetTimeFormat() failed or returned an empty result\r\n        tmp[-1] = '\\0';\r\n\r\n    return str::Dup(buf);\r\n}\r\n\r\n// Convert a date in PDF or XPS format, e.g. \"D:20091222171933-05'00'\" to a display\r\n// format e.g. \"12/22/2009 5:19:33 PM\"\r\n// See: http://www.verypdf.com/pdfinfoeditor/pdf-date-format.htm\r\n// The conversion happens in place\r\nstatic void ConvDateToDisplay(WCHAR **s, bool (* DateParse)(const WCHAR *date, SYSTEMTIME *timeOut))\r\n{\r\n    if (!s || !*s || !DateParse)\r\n        return;\r\n\r\n    SYSTEMTIME date = { 0 };\r\n    bool ok = DateParse(*s, &date);\r\n    if (!ok)\r\n        return;\r\n\r\n    WCHAR *formatted = FormatSystemTime(date);\r\n    if (formatted) {\r\n        free(*s);\r\n        *s = formatted;\r\n    }\r\n}\r\n\r\n// Format the file size in a short form that rounds to the largest size unit\r\n// e.g. \"3.48 GB\", \"12.38 MB\", \"23 KB\"\r\n// Caller needs to free the result.\r\nstatic WCHAR *FormatSizeSuccint(size_t size)\r\n{\r\n    const WCHAR *unit = nullptr;\r\n    double s = (double)size;\r\n\r\n    if (size > GB) {\r\n        s /= GB;\r\n        unit = _TR(\"GB\");\r\n    } else if (size > MB) {\r\n        s /= MB;\r\n        unit = _TR(\"MB\");\r\n    } else {\r\n        s /= KB;\r\n        unit = _TR(\"KB\");\r\n    }\r\n\r\n    ScopedMem<WCHAR> sizestr(str::FormatFloatWithThousandSep(s));\r\n    if (!unit)\r\n        return sizestr.StealData();\r\n    return str::Format(L\"%s %s\", sizestr.Get(), unit);\r\n}\r\n\r\n// format file size in a readable way e.g. 1348258 is shown\r\n// as \"1.29 MB (1,348,258 Bytes)\"\r\n// Caller needs to free the result\r\nstatic WCHAR *FormatFileSize(size_t size)\r\n{\r\n    ScopedMem<WCHAR> n1(FormatSizeSuccint(size));\r\n    ScopedMem<WCHAR> n2(str::FormatNumWithThousandSep(size));\r\n\r\n    return str::Format(L\"%s (%s %s)\", n1.Get(), n2.Get(), _TR(\"Bytes\"));\r\n}\r\n\r\nPaperFormat GetPaperFormat(SizeD size)\r\n{\r\n    SizeD sizeP = size.dx < size.dy ? size : SizeD(size.dy, size.dx);\r\n    // common ISO 216 formats (metric)\r\n    if (limitValue(sizeP.dx, 8.26, 8.28) == sizeP.dx && limitValue(sizeP.dy, 11.68, 11.70) == sizeP.dy)\r\n        return Paper_A4;\r\n    if (limitValue(sizeP.dx, 11.68, 11.70) == sizeP.dx && limitValue(sizeP.dy, 16.53, 16.55) == sizeP.dy)\r\n        return Paper_A3;\r\n    if (limitValue(sizeP.dx, 5.82, 5.85) == sizeP.dx && limitValue(sizeP.dy, 8.26, 8.28) == sizeP.dy)\r\n        return Paper_A5;\r\n    // common US/ANSI formats (imperial)\r\n    if (limitValue(sizeP.dx, 8.49, 8.51) == sizeP.dx && limitValue(sizeP.dy, 10.99, 11.01) == sizeP.dy)\r\n        return Paper_Letter;\r\n    if (limitValue(sizeP.dx, 8.49, 8.51) == sizeP.dx && limitValue(sizeP.dy, 13.99, 14.01) == sizeP.dy)\r\n        return Paper_Legal;\r\n    if (limitValue(sizeP.dx, 10.99, 11.01) == sizeP.dx && limitValue(sizeP.dy, 16.99, 17.01) == sizeP.dy)\r\n        return Paper_Tabloid;\r\n    if (limitValue(sizeP.dx, 5.49, 5.51) == sizeP.dx && limitValue(sizeP.dy, 8.49, 8.51) == sizeP.dy)\r\n        return Paper_Statement;\r\n    return Paper_Other;\r\n}\r\n\r\n// format page size according to locale (e.g. \"29.7 x 21.0 cm\" or \"11.69 x 8.27 in\")\r\n// Caller needs to free the result\r\nstatic WCHAR *FormatPageSize(BaseEngine *engine, int pageNo, int rotation)\r\n{\r\n    RectD mediabox = engine->PageMediabox(pageNo);\r\n    SizeD size = engine->Transform(mediabox, pageNo, 1.0f / engine->GetFileDPI(), rotation).Size();\r\n\r\n    const WCHAR *formatName = L\"\";\r\n    switch (GetPaperFormat(size)) {\r\n    case Paper_A4: formatName = L\" (A4)\"; break;\r\n    case Paper_A3: formatName = L\" (A3)\"; break;\r\n    case Paper_A5: formatName = L\" (A5)\"; break;\r\n    case Paper_Letter: formatName = L\" (Letter)\"; break;\r\n    case Paper_Legal: formatName = L\" (Legal)\"; break;\r\n    case Paper_Tabloid: formatName = L\" (Tabloid)\"; break;\r\n    case Paper_Statement: formatName = L\" (Statement)\"; break;\r\n    }\r\n\r\n    bool isMetric = GetMeasurementSystem() == 0;\r\n    double unitsPerInch = isMetric ? 2.54 : 1.0;\r\n    const WCHAR *unit = isMetric ? L\"cm\" : L\"in\";\r\n\r\n    double width = size.dx * unitsPerInch;\r\n    double height = size.dy * unitsPerInch;\r\n    if (((int)(width * 100)) % 100 == 99)\r\n        width += 0.01;\r\n    if (((int)(height * 100)) % 100 == 99)\r\n        height += 0.01;\r\n\r\n    ScopedMem<WCHAR> strWidth(str::FormatFloatWithThousandSep(width));\r\n    ScopedMem<WCHAR> strHeight(str::FormatFloatWithThousandSep(height));\r\n\r\n    return str::Format(L\"%s x %s %s%s\", strWidth.Get(), strHeight.Get(), unit, formatName);\r\n}\r\n\r\nstatic WCHAR *FormatPdfFileStructure(Controller *ctrl)\r\n{\r\n    ScopedMem<WCHAR> fstruct(ctrl->GetProperty(Prop_PdfFileStructure));\r\n    if (str::IsEmpty(fstruct.Get()))\r\n        return nullptr;\r\n    WStrVec parts;\r\n    parts.Split(fstruct, L\",\", true);\r\n\r\n    WStrVec props;\r\n\r\n    if (parts.Contains(L\"linearized\"))\r\n        props.Push(str::Dup(_TR(\"Fast Web View\")));\r\n    if (parts.Contains(L\"tagged\"))\r\n        props.Push(str::Dup(_TR(\"Tagged PDF\")));\r\n    if (parts.Contains(L\"PDFX\"))\r\n        props.Push(str::Dup(L\"PDF/X (ISO 15930)\"));\r\n    if (parts.Contains(L\"PDFA1\"))\r\n        props.Push(str::Dup(L\"PDF/A (ISO 19005)\"));\r\n    if (parts.Contains(L\"PDFE1\"))\r\n        props.Push(str::Dup(L\"PDF/E (ISO 24517)\"));\r\n\r\n    return props.Join(L\", \");\r\n}\r\n\r\n// returns a list of permissions denied by this document\r\n// Caller needs to free the result\r\nstatic WCHAR *FormatPermissions(Controller *ctrl)\r\n{\r\n    if (!ctrl->AsFixed())\r\n        return nullptr;\r\n\r\n    WStrVec denials;\r\n\r\n    BaseEngine *engine = ctrl->AsFixed()->GetEngine();\r\n    if (!engine->AllowsPrinting())\r\n        denials.Push(str::Dup(_TR(\"printing document\")));\r\n    if (!engine->AllowsCopyingText())\r\n        denials.Push(str::Dup(_TR(\"copying text\")));\r\n\r\n    return denials.Join(L\", \");\r\n}\r\n\r\nstatic void UpdatePropertiesLayout(PropertiesLayout *layoutData, HDC hdc, RectI *rect)\r\n{\r\n    ScopedFont fontLeftTxt(CreateSimpleFont(hdc, LEFT_TXT_FONT, LEFT_TXT_FONT_SIZE));\r\n    ScopedFont fontRightTxt(CreateSimpleFont(hdc, RIGHT_TXT_FONT, RIGHT_TXT_FONT_SIZE));\r\n    HGDIOBJ origFont = SelectObject(hdc, fontLeftTxt);\r\n\r\n    /* calculate text dimensions for the left side */\r\n    SelectObject(hdc, fontLeftTxt);\r\n    int leftMaxDx = 0;\r\n    for (size_t i = 0; i < layoutData->Count(); i++) {\r\n        PropertyEl *el = layoutData->At(i);\r\n        const WCHAR *txt = el->leftTxt;\r\n        RECT rc = { 0 };\r\n        DrawText(hdc, txt, -1, &rc, DT_NOPREFIX | DT_CALCRECT);\r\n        el->leftPos.dx = rc.right - rc.left;\r\n        // el->leftPos.dy is set below to be equal to el->rightPos.dy\r\n\r\n        if (el->leftPos.dx > leftMaxDx)\r\n            leftMaxDx = el->leftPos.dx;\r\n    }\r\n\r\n    /* calculate text dimensions for the right side */\r\n    SelectObject(hdc, fontRightTxt);\r\n    int rightMaxDx = 0;\r\n    int lineCount = 0;\r\n    int textDy = 0;\r\n    for (size_t i = 0; i < layoutData->Count(); i++) {\r\n        PropertyEl *el = layoutData->At(i);\r\n        const WCHAR *txt = el->rightTxt;\r\n        RECT rc = { 0 };\r\n        DrawText(hdc, txt, -1, &rc, DT_NOPREFIX | DT_CALCRECT);\r\n        el->rightPos.dx = rc.right - rc.left;\r\n        el->leftPos.dy = el->rightPos.dy = rc.bottom - rc.top;\r\n        textDy += el->rightPos.dy;\r\n\r\n        if (el->rightPos.dx > rightMaxDx)\r\n            rightMaxDx = el->rightPos.dx;\r\n        lineCount++;\r\n    }\r\n\r\n    assert(lineCount > 0 && textDy > 0);\r\n    int totalDx = leftMaxDx + PROPERTIES_LEFT_RIGHT_SPACE_DX + rightMaxDx;\r\n\r\n    int totalDy = 4;\r\n    totalDy += textDy + (lineCount - 1) * PROPERTIES_TXT_DY_PADDING;\r\n    totalDy += 4;\r\n\r\n    int offset = PROPERTIES_RECT_PADDING;\r\n    if (rect)\r\n        *rect = RectI(0, 0, totalDx + 2 * offset, totalDy + offset);\r\n\r\n    int currY = 0;\r\n    for (size_t i = 0; i < layoutData->Count(); i++) {\r\n        PropertyEl *el = layoutData->At(i);\r\n        el->leftPos = RectI(offset, offset + currY, leftMaxDx, el->leftPos.dy);\r\n        el->rightPos.x = offset + leftMaxDx + PROPERTIES_LEFT_RIGHT_SPACE_DX;\r\n        el->rightPos.y = offset + currY;\r\n        currY += el->rightPos.dy + PROPERTIES_TXT_DY_PADDING;\r\n    }\r\n\r\n    SelectObject(hdc, origFont);\r\n}\r\n\r\nstatic bool CreatePropertiesWindow(HWND hParent, PropertiesLayout* layoutData)\r\n{\r\n    CrashIf(layoutData->hwnd);\r\n    HWND hwnd = CreateWindow(\r\n           PROPERTIES_CLASS_NAME, PROPERTIES_WIN_TITLE,\r\n           WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU,\r\n           CW_USEDEFAULT, CW_USEDEFAULT,\r\n           CW_USEDEFAULT, CW_USEDEFAULT,\r\n           nullptr, nullptr,\r\n           GetModuleHandle(nullptr), nullptr);\r\n    if (!hwnd)\r\n        return false;\r\n\r\n    layoutData->hwnd = hwnd;\r\n    layoutData->hwndParent = hParent;\r\n    ToggleWindowStyle(hwnd, WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT, IsUIRightToLeft(), GWL_EXSTYLE);\r\n\r\n    // get the dimensions required for the about box's content\r\n    RectI rc;\r\n    PAINTSTRUCT ps;\r\n    HDC hdc = BeginPaint(hwnd, &ps);\r\n    UpdatePropertiesLayout(layoutData, hdc, &rc);\r\n    EndPaint(hwnd, &ps);\r\n\r\n    // resize the new window to just match these dimensions\r\n    // (as long as they fit into the current monitor's work area)\r\n    WindowRect wRc(hwnd);\r\n    ClientRect cRc(hwnd);\r\n    RectI work = GetWorkAreaRect(WindowRect(hParent));\r\n    wRc.dx = std::min(rc.dx + wRc.dx - cRc.dx, work.dx);\r\n    wRc.dy = std::min(rc.dy + wRc.dy - cRc.dy, work.dy);\r\n    MoveWindow(hwnd, wRc.x, wRc.y, wRc.dx, wRc.dy, FALSE);\r\n    CenterDialog(hwnd, hParent);\r\n\r\n    ShowWindow(hwnd, SW_SHOW);\r\n    return true;\r\n}\r\n\r\nstatic void GetProps(Controller *ctrl, PropertiesLayout *layoutData, bool extended)\r\n{\r\n    CrashIf(!ctrl);\r\n\r\n    WCHAR *str = str::Dup(gPluginMode ? gPluginURL : ctrl->FilePath());\r\n    layoutData->AddProperty(_TR(\"File:\"), str, true);\r\n\r\n    str = ctrl->GetProperty(Prop_Title);\r\n    layoutData->AddProperty(_TR(\"Title:\"), str);\r\n\r\n    str = ctrl->GetProperty(Prop_Subject);\r\n    layoutData->AddProperty(_TR(\"Subject:\"), str);\r\n\r\n    str = ctrl->GetProperty(Prop_Author);\r\n    layoutData->AddProperty(_TR(\"Author:\"), str);\r\n\r\n    str = ctrl->GetProperty(Prop_Copyright);\r\n    layoutData->AddProperty(_TR(\"Copyright:\"), str);\r\n\r\n    str = ctrl->GetProperty(Prop_CreationDate);\r\n    if (str && ctrl->AsFixed() && Engine_PDF == ctrl->AsFixed()->engineType)\r\n        ConvDateToDisplay(&str, PdfDateParse);\r\n    else\r\n        ConvDateToDisplay(&str, IsoDateParse);\r\n    layoutData->AddProperty(_TR(\"Created:\"), str);\r\n\r\n    str = ctrl->GetProperty(Prop_ModificationDate);\r\n    if (str && ctrl->AsFixed() && Engine_PDF == ctrl->AsFixed()->engineType)\r\n        ConvDateToDisplay(&str, PdfDateParse);\r\n    else\r\n        ConvDateToDisplay(&str, IsoDateParse);\r\n    layoutData->AddProperty(_TR(\"Modified:\"), str);\r\n\r\n    str = ctrl->GetProperty(Prop_CreatorApp);\r\n    layoutData->AddProperty(_TR(\"Application:\"), str);\r\n\r\n    str = ctrl->GetProperty(Prop_PdfProducer);\r\n    layoutData->AddProperty(_TR(\"PDF Producer:\"), str);\r\n\r\n    str = ctrl->GetProperty(Prop_PdfVersion);\r\n    layoutData->AddProperty(_TR(\"PDF Version:\"), str);\r\n\r\n    str = FormatPdfFileStructure(ctrl);\r\n    layoutData->AddProperty(_TR(\"PDF Optimizations:\"), str);\r\n\r\n    int64 fileSize = file::GetSize(ctrl->FilePath());\r\n    if (-1 == fileSize && ctrl->AsFixed()) {\r\n        size_t fileSizeT;\r\n        if (ScopedMem<unsigned char>(ctrl->AsFixed()->GetEngine()->GetFileData(&fileSizeT)))\r\n            fileSize = fileSizeT;\r\n    }\r\n    if (-1 != fileSize) {\r\n        str = FormatFileSize((size_t)fileSize);\r\n        layoutData->AddProperty(_TR(\"File Size:\"), str);\r\n    }\r\n\r\n    // TODO: display page count per current layout for ebooks?\r\n    if (!ctrl->AsEbook()) {\r\n        str = str::Format(L\"%d\", ctrl->PageCount());\r\n        layoutData->AddProperty(_TR(\"Number of Pages:\"), str);\r\n    }\r\n\r\n    if (ctrl->AsFixed()) {\r\n        str = FormatPageSize(ctrl->AsFixed()->GetEngine(), ctrl->CurrentPageNo(), ctrl->AsFixed()->GetRotation());\r\n        if (IsUIRightToLeft() && IsVistaOrGreater()) {\r\n            // ensure that the size remains ungarbled left-to-right\r\n            // (note: XP doesn't know about \\u202A...\\u202C)\r\n            WCHAR *tmp = str;\r\n            str = str::Format(L\"\\u202A%s\\u202C\", tmp);\r\n            free(tmp);\r\n        }\r\n        layoutData->AddProperty(_TR(\"Page Size:\"), str);\r\n    }\r\n\r\n    str = FormatPermissions(ctrl);\r\n    layoutData->AddProperty(_TR(\"Denied Permissions:\"), str);\r\n\r\n#if defined(DEBUG) || defined(ENABLE_EXTENDED_PROPERTIES)\r\n    if (extended) {\r\n        // TODO: FontList extraction can take a while\r\n        str = ctrl->GetProperty(Prop_FontList);\r\n        if (str) {\r\n            // add a space between basic and extended file properties\r\n            layoutData->AddProperty(L\" \", str::Dup(L\" \"));\r\n        }\r\n        layoutData->AddProperty(_TR(\"Fonts:\"), str);\r\n    }\r\n#else\r\n    UNUSED(extended);\r\n#endif\r\n}\r\n\r\nstatic void ShowProperties(HWND parent, Controller *ctrl, bool extended=false)\r\n{\r\n    PropertiesLayout *layoutData = FindPropertyWindowByParent(parent);\r\n    if (layoutData) {\r\n        SetActiveWindow(layoutData->hwnd);\r\n        return;\r\n    }\r\n\r\n    if (!ctrl)\r\n        return;\r\n    layoutData = new PropertiesLayout();\r\n    gPropertiesWindows.Append(layoutData);\r\n    GetProps(ctrl, layoutData, extended);\r\n\r\n    if (!CreatePropertiesWindow(parent, layoutData))\r\n        delete layoutData;\r\n}\r\n\r\nvoid OnMenuProperties(WindowInfo *win)\r\n{\r\n    ShowProperties(win->hwndFrame, win->ctrl);\r\n}\r\n\r\nstatic void DrawProperties(HWND hwnd, HDC hdc)\r\n{\r\n    PropertiesLayout *layoutData = FindPropertyWindowByHwnd(hwnd);\r\n\r\n    ScopedFont fontLeftTxt(CreateSimpleFont(hdc, LEFT_TXT_FONT, LEFT_TXT_FONT_SIZE));\r\n    ScopedFont fontRightTxt(CreateSimpleFont(hdc, RIGHT_TXT_FONT, RIGHT_TXT_FONT_SIZE));\r\n\r\n    HGDIOBJ origFont = SelectObject(hdc, fontLeftTxt); /* Just to remember the orig font */\r\n\r\n    SetBkMode(hdc, TRANSPARENT);\r\n\r\n    ClientRect rcClient(hwnd);\r\n    RECT rTmp = rcClient.ToRECT();\r\n    ScopedGdiObj<HBRUSH> brushAboutBg(CreateSolidBrush(GetAboutBgColor()));\r\n    FillRect(hdc, &rTmp, brushAboutBg);\r\n\r\n    SetTextColor(hdc, WIN_COL_BLACK);\r\n\r\n    /* render text on the left*/\r\n    SelectObject(hdc, fontLeftTxt);\r\n    for (size_t i = 0; i < layoutData->Count(); i++) {\r\n        PropertyEl *el = layoutData->At(i);\r\n        const WCHAR *txt = el->leftTxt;\r\n        rTmp = el->leftPos.ToRECT();\r\n        DrawText(hdc, txt, -1, &rTmp, DT_RIGHT | DT_NOPREFIX);\r\n    }\r\n\r\n    /* render text on the right */\r\n    SelectObject(hdc, fontRightTxt);\r\n    for (size_t i = 0; i < layoutData->Count(); i++) {\r\n        PropertyEl *el = layoutData->At(i);\r\n        const WCHAR *txt = el->rightTxt;\r\n        RectI rc = el->rightPos;\r\n        if (rc.x + rc.dx > rcClient.x + rcClient.dx - PROPERTIES_RECT_PADDING)\r\n            rc.dx = rcClient.x + rcClient.dx - PROPERTIES_RECT_PADDING - rc.x;\r\n        rTmp = rc.ToRECT();\r\n        UINT format = DT_LEFT | DT_NOPREFIX | (el->isPath ? DT_PATH_ELLIPSIS : DT_WORD_ELLIPSIS);\r\n        DrawText(hdc, txt, -1, &rTmp, format);\r\n    }\r\n\r\n    SelectObject(hdc, origFont);\r\n}\r\n\r\nstatic void OnPaintProperties(HWND hwnd)\r\n{\r\n    PAINTSTRUCT ps;\r\n    RectI rc;\r\n    HDC hdc = BeginPaint(hwnd, &ps);\r\n    UpdatePropertiesLayout(FindPropertyWindowByHwnd(hwnd), hdc, &rc);\r\n    DrawProperties(hwnd, hdc);\r\n    EndPaint(hwnd, &ps);\r\n}\r\n\r\nstatic void CopyPropertiesToClipboard(HWND hwnd)\r\n{\r\n    PropertiesLayout *layoutData = FindPropertyWindowByHwnd(hwnd);\r\n    if (!layoutData)\r\n        return;\r\n\r\n    // concatenate all the properties into a multi-line string\r\n    str::Str<WCHAR> lines(256);\r\n    for (size_t i = 0; i < layoutData->Count(); i++) {\r\n        PropertyEl *el = layoutData->At(i);\r\n        lines.AppendFmt(L\"%s %s\\r\\n\", el->leftTxt, el->rightTxt);\r\n    }\r\n\r\n    CopyTextToClipboard(lines.LendData());\r\n}\r\n\r\nstatic void PropertiesOnCommand(HWND hwnd, WPARAM wParam)\r\n{\r\n    switch (LOWORD(wParam)) {\r\n    case IDM_COPY_SELECTION:\r\n        CopyPropertiesToClipboard(hwnd);\r\n        break;\r\n\r\n    case IDM_PROPERTIES:\r\n#if defined(DEBUG) || defined(ENABLE_EXTENDED_PROPERTIES)\r\n        // make a repeated Ctrl+D display some extended properties\r\n        // TODO: expose this through a UI button or similar\r\n        PropertiesLayout *pl = FindPropertyWindowByHwnd(hwnd);\r\n        if (pl) {\r\n            WindowInfo *win = FindWindowInfoByHwnd(pl->hwndParent);\r\n            if (win && !pl->HasProperty(_TR(\"Fonts:\"))) {\r\n                DestroyWindow(hwnd);\r\n                ShowProperties(win->hwndFrame, win->ctrl, true);\r\n            }\r\n        }\r\n#endif\r\n        break;\r\n    }\r\n}\r\n\r\nLRESULT CALLBACK WndProcProperties(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)\r\n{\r\n    PropertiesLayout *pl;\r\n\r\n    switch (message)\r\n    {\r\n        case WM_CREATE:\r\n            break;\r\n\r\n        case WM_ERASEBKGND:\r\n            // do nothing, helps to avoid flicker\r\n            return TRUE;\r\n\r\n        case WM_PAINT:\r\n            OnPaintProperties(hwnd);\r\n            break;\r\n\r\n        case WM_CHAR:\r\n            if (VK_ESCAPE == wParam)\r\n                DestroyWindow(hwnd);\r\n            break;\r\n\r\n        case WM_DESTROY:\r\n            pl = FindPropertyWindowByHwnd(hwnd);\r\n            CrashIf(!pl);\r\n            gPropertiesWindows.Remove(pl);\r\n            delete pl;\r\n            break;\r\n\r\n        case WM_COMMAND:\r\n            PropertiesOnCommand(hwnd, wParam);\r\n            break;\r\n\r\n        /* TODO: handle mouse move/down/up so that links work (?) */\r\n        default:\r\n            return DefWindowProc(hwnd, message, wParam, lParam);\r\n    }\r\n    return 0;\r\n}\r\n"
  },
  {
    "path": "src/SumatraProperties.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n#define PROPERTIES_CLASS_NAME   L\"SUMATRA_PDF_PROPERTIES\"\r\n\r\nenum PaperFormat { Paper_Other, Paper_A4, Paper_A3, Paper_A5, Paper_Letter, Paper_Legal, Paper_Tabloid, Paper_Statement };\r\nPaperFormat GetPaperFormat(SizeD size);\r\n\r\nvoid OnMenuProperties(WindowInfo *win);\r\nvoid DeletePropertiesWindow(HWND hwndParent);\r\nLRESULT CALLBACK WndProcProperties(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);\r\n"
  },
  {
    "path": "src/SumatraStartup.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"WinDynCalls.h\"\r\n#include \"CmdLineParser.h\"\r\n#include \"DbgHelpDyn.h\"\r\n#include \"Dpi.h\"\r\n#include \"FileUtil.h\"\r\n#include \"FileWatcher.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"LabelWithCloseWnd.h\"\r\n#include \"Mui.h\"\r\n#include \"SplitterWnd.h\"\r\n#include \"SquareTreeParser.h\"\r\n#include \"ThreadUtil.h\"\r\n#include \"UITask.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EngineManager.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"DisplayModel.h\"\r\n#include \"FileHistory.h\"\r\n#include \"GlobalPrefs.h\"\r\n#include \"PdfSync.h\"\r\n#include \"RenderCache.h\"\r\n#include \"TextSelection.h\"\r\n#include \"TextSearch.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"WindowInfo.h\"\r\n#include \"TabInfo.h\"\r\n#include \"resource.h\"\r\n#include \"ParseCommandLine.h\"\r\n#include \"AppPrefs.h\"\r\n#include \"AppTools.h\"\r\n#include \"Canvas.h\"\r\n#include \"Caption.h\"\r\n#include \"CrashHandler.h\"\r\n#include \"FileThumbnails.h\"\r\n#include \"Notifications.h\"\r\n#include \"Print.h\"\r\n#include \"Search.h\"\r\n#include \"Selection.h\"\r\n#include \"SumatraDialogs.h\"\r\n#include \"SumatraProperties.h\"\r\n#include \"Tabs.h\"\r\n#include \"Translations.h\"\r\n#include \"uia/Provider.h\"\r\n#include \"StressTesting.h\"\r\n#include \"Version.h\"\r\n#include \"Tests.h\"\r\n\r\n// \"SumatraPDF yellow\" similar to the one use for icon and installer\r\n#define ABOUT_BG_LOGO_COLOR     RGB(0xFF, 0xF2, 0x00)\r\n\r\n// it's very light gray but not white so that there's contrast between\r\n// background and thumbnail, which often have white background because\r\n// most PDFs have white background\r\n#define ABOUT_BG_GRAY_COLOR     RGB(0xF2, 0xF2, 0xF2)\r\n\r\n#define CRASH_DUMP_FILE_NAME         L\"sumatrapdfcrash.dmp\"\r\n\r\n#ifdef DEBUG\r\nstatic bool TryLoadMemTrace()\r\n{\r\n    ScopedMem<WCHAR> dllPath(path::GetAppPath(L\"memtrace.dll\"));\r\n    if (!LoadLibrary(dllPath))\r\n        return false;\r\n    return true;\r\n}\r\n#endif\r\n\r\n// gFileExistenceChecker is initialized at startup and should\r\n// terminate and delete itself asynchronously while the UI is\r\n// being set up\r\nclass FileExistenceChecker : public ThreadBase\r\n{\r\n    WStrVec paths;\r\n\r\n    void GetFilePathsToCheck();\r\n    void HideMissingFiles();\r\n    void Terminate();\r\n\r\npublic:\r\n    FileExistenceChecker() { GetFilePathsToCheck(); }\r\n    virtual void Run() override;\r\n};\r\n\r\nstatic FileExistenceChecker *gFileExistenceChecker = nullptr;\r\n\r\nvoid FileExistenceChecker::GetFilePathsToCheck()\r\n{\r\n    DisplayState *state;\r\n    for (size_t i = 0; i < 2 * FILE_HISTORY_MAX_RECENT && (state = gFileHistory.Get(i)) != nullptr; i++) {\r\n        if (!state->isMissing)\r\n            paths.Append(str::Dup(state->filePath));\r\n    }\r\n    // add missing paths from the list of most frequently opened documents\r\n    Vec<DisplayState *> frequencyList;\r\n    gFileHistory.GetFrequencyOrder(frequencyList);\r\n    for (size_t i = 0; i < 2 * FILE_HISTORY_MAX_FREQUENT && i < frequencyList.Count(); i++) {\r\n        state = frequencyList.At(i);\r\n        if (!paths.Contains(state->filePath))\r\n            paths.Append(str::Dup(state->filePath));\r\n    }\r\n}\r\n\r\nvoid FileExistenceChecker::HideMissingFiles()\r\n{\r\n    for (const WCHAR *path : paths) {\r\n        gFileHistory.MarkFileInexistent(path, true);\r\n    }\r\n    // update the Frequently Read page in case it's been displayed already\r\n    if (paths.Count() > 0 && gWindows.Count() > 0 && gWindows.At(0)->IsAboutWindow()) {\r\n        gWindows.At(0)->RedrawAll(true);\r\n    }\r\n}\r\n\r\nvoid FileExistenceChecker::Terminate()\r\n{\r\n    gFileExistenceChecker = nullptr;\r\n    Join(); // just to be safe\r\n    delete this;\r\n}\r\n\r\nvoid FileExistenceChecker::Run()\r\n{\r\n    // filters all file paths on network drives, removable drives and\r\n    // all paths which still exist from the list (remaining paths will\r\n    // be marked as inexistent in gFileHistory)\r\n    for (size_t i = 0; i < paths.Count(); i++) {\r\n        const WCHAR *path = paths.At(i);\r\n        if (!path || !path::IsOnFixedDrive(path) || DocumentPathExists(path)) {\r\n            free(paths.PopAt(i--));\r\n        }\r\n    }\r\n\r\n    uitask::Post([=] {\r\n        CrashIf(WasCancelRequested());\r\n        HideMissingFiles();\r\n        Terminate();\r\n    });\r\n}\r\n\r\nstatic void MakePluginWindow(WindowInfo& win, HWND hwndParent)\r\n{\r\n    assert(IsWindow(hwndParent));\r\n    assert(gPluginMode);\r\n\r\n    long ws = GetWindowLong(win.hwndFrame, GWL_STYLE);\r\n    ws &= ~(WS_POPUP | WS_BORDER | WS_CAPTION | WS_THICKFRAME);\r\n    ws |= WS_CHILD;\r\n    SetWindowLong(win.hwndFrame, GWL_STYLE, ws);\r\n\r\n    SetParent(win.hwndFrame, hwndParent);\r\n    MoveWindow(win.hwndFrame, ClientRect(hwndParent));\r\n    ShowWindow(win.hwndFrame, SW_SHOW);\r\n    UpdateWindow(win.hwndFrame);\r\n\r\n    // from here on, we depend on the plugin's host to resize us\r\n    SetFocus(win.hwndFrame);\r\n}\r\n\r\nstatic bool RegisterWinClass()\r\n{\r\n    WNDCLASSEX  wcex;\r\n    ATOM        atom;\r\n\r\n    FillWndClassEx(wcex, FRAME_CLASS_NAME, WndProcFrame);\r\n    wcex.hIcon  = LoadIcon(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDI_SUMATRAPDF));\r\n    CrashIf(!wcex.hIcon);\r\n    // For the extended translucent frame to be visible, we need black background.\r\n    wcex.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);\r\n    atom = RegisterClassEx(&wcex);\r\n    CrashIf(!atom);\r\n\r\n    FillWndClassEx(wcex, CANVAS_CLASS_NAME, WndProcCanvas);\r\n    wcex.style |= CS_DBLCLKS;\r\n    atom = RegisterClassEx(&wcex);\r\n    CrashIf(!atom);\r\n\r\n    FillWndClassEx(wcex, PROPERTIES_CLASS_NAME, WndProcProperties);\r\n    wcex.hIcon = LoadIcon(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDI_SUMATRAPDF));\r\n    CrashIf(!wcex.hIcon);\r\n    atom = RegisterClassEx(&wcex);\r\n    CrashIf(!atom);\r\n\r\n    RegisterNotificationsWndClass();\r\n    RegisterSplitterWndClass();\r\n    RegisterLabelWithCloseWnd();\r\n    RegisterCaptionWndClass();\r\n    return true;\r\n}\r\n\r\n// returns the background color for the \"SumatraPDF\" logo in start page and About window\r\nCOLORREF GetLogoBgColor()\r\n{\r\n#ifdef ABOUT_USE_LESS_COLORS\r\n    return ABOUT_BG_LOGO_COLOR;\r\n#else\r\n    return GetAboutBgColor();\r\n#endif\r\n}\r\n\r\n// returns the background color for start page, About window and Properties dialog\r\nCOLORREF GetAboutBgColor()\r\n{\r\n    COLORREF bgColor = ABOUT_BG_GRAY_COLOR;\r\n    if (ABOUT_BG_COLOR_DEFAULT != gGlobalPrefs->mainWindowBackground)\r\n        bgColor = gGlobalPrefs->mainWindowBackground;\r\n    return bgColor;\r\n}\r\n\r\nCOLORREF GetNoDocBgColor()\r\n{\r\n    // use the system background color if the user has non-default\r\n    // colors for text (not black-on-white) and also wants to use them\r\n    bool useSysColor = gGlobalPrefs->useSysColors &&\r\n                       (GetSysColor(COLOR_WINDOWTEXT) != WIN_COL_BLACK ||\r\n                        GetSysColor(COLOR_WINDOW) != WIN_COL_WHITE);\r\n    if (useSysColor)\r\n        return GetSysColor(COLOR_BTNFACE);\r\n\r\n    return COL_WINDOW_BG;\r\n}\r\n\r\nstatic bool InstanceInit()\r\n{\r\n    gCursorDrag     = LoadCursor(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDC_CURSORDRAG));\r\n    CrashIf(!gCursorDrag);\r\n\r\n    gBitmapReloadingCue = LoadBitmap(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDB_RELOADING_CUE));\r\n    CrashIf(!gBitmapReloadingCue);\r\n    return true;\r\n}\r\n\r\nstatic void OpenUsingDde(HWND targetWnd, const WCHAR *filePath, CommandLineInfo& i, bool isFirstWin)\r\n{\r\n    // delegate file opening to a previously running instance by sending a DDE message\r\n    WCHAR fullpath[MAX_PATH];\r\n    GetFullPathName(filePath, dimof(fullpath), fullpath, nullptr);\r\n\r\n    str::Str<WCHAR> cmd;\r\n    cmd.AppendFmt(L\"[\" DDECOMMAND_OPEN L\"(\\\"%s\\\", 0, 1, 0)]\", fullpath);\r\n    if (i.destName && isFirstWin) {\r\n        cmd.AppendFmt(L\"[\" DDECOMMAND_GOTO L\"(\\\"%s\\\", \\\"%s\\\")]\", fullpath, i.destName);\r\n    }\r\n    else if (i.pageNumber > 0 && isFirstWin) {\r\n        cmd.AppendFmt(L\"[\" DDECOMMAND_PAGE L\"(\\\"%s\\\", %d)]\", fullpath, i.pageNumber);\r\n    }\r\n    if ((i.startView != DM_AUTOMATIC || i.startZoom != INVALID_ZOOM ||\r\n            i.startScroll.x != -1 && i.startScroll.y != -1) && isFirstWin) {\r\n        const WCHAR *viewMode = prefs::conv::FromDisplayMode(i.startView);\r\n        cmd.AppendFmt(L\"[\" DDECOMMAND_SETVIEW L\"(\\\"%s\\\", \\\"%s\\\", %.2f, %d, %d)]\",\r\n                      fullpath, viewMode, i.startZoom, i.startScroll.x, i.startScroll.y);\r\n    }\r\n    if (i.forwardSearchOrigin && i.forwardSearchLine) {\r\n        ScopedMem<WCHAR> sourcePath(path::Normalize(i.forwardSearchOrigin));\r\n        cmd.AppendFmt(L\"[\" DDECOMMAND_SYNC L\"(\\\"%s\\\", \\\"%s\\\", %d, 0, 0, 1)]\",\r\n                      fullpath, sourcePath, i.forwardSearchLine);\r\n    }\r\n\r\n    if (!i.reuseDdeInstance) {\r\n        // try WM_COPYDATA first, as that allows targetting a specific window\r\n        COPYDATASTRUCT cds = { 0x44646557 /* DdeW */, (DWORD)(cmd.Size() + 1) * sizeof(WCHAR), cmd.Get() };\r\n        LRESULT res = SendMessage(targetWnd, WM_COPYDATA, 0, (LPARAM)&cds);\r\n        if (res)\r\n            return;\r\n    }\r\n    DDEExecute(PDFSYNC_DDE_SERVICE, PDFSYNC_DDE_TOPIC, cmd.Get());\r\n}\r\n\r\nstatic WindowInfo *LoadOnStartup(const WCHAR *filePath, CommandLineInfo& i, bool isFirstWin)\r\n{\r\n    LoadArgs args(filePath);\r\n    args.showWin = !(i.printDialog && i.exitWhenDone) && !gPluginMode;\r\n    WindowInfo *win = LoadDocument(args);\r\n    if (!win)\r\n        return win;\r\n\r\n    if (win->IsDocLoaded() && i.destName && isFirstWin) {\r\n        win->linkHandler->GotoNamedDest(i.destName);\r\n    } else if (win->IsDocLoaded() && i.pageNumber > 0 && isFirstWin) {\r\n        if (win->ctrl->ValidPageNo(i.pageNumber))\r\n            win->ctrl->GoToPage(i.pageNumber, false);\r\n    }\r\n    if (i.hwndPluginParent)\r\n        MakePluginWindow(*win, i.hwndPluginParent);\r\n    if (!win->IsDocLoaded() || !isFirstWin)\r\n        return win;\r\n\r\n    if (i.enterPresentation || i.enterFullScreen) {\r\n        if (i.enterPresentation && win->isFullScreen || i.enterFullScreen && win->presentation)\r\n            ExitFullScreen(win);\r\n        EnterFullScreen(win, i.enterPresentation);\r\n    }\r\n    if (i.startView != DM_AUTOMATIC)\r\n        SwitchToDisplayMode(win, i.startView);\r\n    if (i.startZoom != INVALID_ZOOM)\r\n        ZoomToSelection(win, i.startZoom);\r\n    if ((i.startScroll.x != -1 || i.startScroll.y != -1) && win->AsFixed()) {\r\n        DisplayModel *dm = win->AsFixed();\r\n        ScrollState ss = dm->GetScrollState();\r\n        ss.x = i.startScroll.x;\r\n        ss.y = i.startScroll.y;\r\n        dm->SetScrollState(ss);\r\n    }\r\n    if (i.forwardSearchOrigin && i.forwardSearchLine && win->AsFixed() && win->AsFixed()->pdfSync) {\r\n        UINT page;\r\n        Vec<RectI> rects;\r\n        ScopedMem<WCHAR> sourcePath(path::Normalize(i.forwardSearchOrigin));\r\n        int ret = win->AsFixed()->pdfSync->SourceToDoc(sourcePath, i.forwardSearchLine, 0, &page, rects);\r\n        ShowForwardSearchResult(win, sourcePath, i.forwardSearchLine, 0, ret, page, rects);\r\n    }\r\n    return win;\r\n}\r\n\r\nstatic void RestoreTabOnStartup(WindowInfo *win, TabState *state)\r\n{\r\n    LoadArgs args(state->filePath, win);\r\n    if (!LoadDocument(args))\r\n        return;\r\n    TabInfo *tab = win->currentTab;\r\n    if (!tab || !tab->ctrl)\r\n        return;\r\n\r\n    tab->tocState = *state->tocState;\r\n    SetSidebarVisibility(win, state->showToc, gGlobalPrefs->showFavorites);\r\n\r\n    DisplayMode displayMode = prefs::conv::ToDisplayMode(state->displayMode, DM_AUTOMATIC);\r\n    if (displayMode != DM_AUTOMATIC)\r\n        SwitchToDisplayMode(win, displayMode);\r\n    // TODO: make EbookController::GoToPage not crash\r\n    if (!tab->AsEbook())\r\n        tab->ctrl->GoToPage(state->pageNo, true);\r\n    float zoom = prefs::conv::ToZoom(state->zoom, INVALID_ZOOM);\r\n    if (zoom != INVALID_ZOOM) {\r\n        if (tab->AsFixed())\r\n            tab->AsFixed()->Relayout(zoom, state->rotation);\r\n        else\r\n            tab->ctrl->SetZoomVirtual(zoom);\r\n    }\r\n    if (tab->AsFixed())\r\n        tab->AsFixed()->SetScrollState(ScrollState(state->pageNo, state->scrollPos.x, state->scrollPos.y));\r\n\r\n}\r\n\r\nstatic bool SetupPluginMode(CommandLineInfo& i)\r\n{\r\n    if (!IsWindow(i.hwndPluginParent) || i.fileNames.Count() == 0)\r\n        return false;\r\n\r\n    gPluginURL = i.pluginURL;\r\n    if (!gPluginURL)\r\n        gPluginURL = i.fileNames.At(0);\r\n\r\n    assert(i.fileNames.Count() == 1);\r\n    while (i.fileNames.Count() > 1) {\r\n        free(i.fileNames.Pop());\r\n    }\r\n\r\n    // don't save preferences for plugin windows (and don't allow fullscreen mode)\r\n    // TODO: Perm_DiskAccess is required for saving viewed files and printing and\r\n    //       Perm_InternetAccess is required for crash reports\r\n    // (they can still be disabled through sumatrapdfrestrict.ini or -restrict)\r\n    RestrictPolicies(Perm_SavePreferences | Perm_FullscreenAccess);\r\n\r\n    i.reuseDdeInstance = i.exitWhenDone = false;\r\n    gGlobalPrefs->reuseInstance = false;\r\n    // don't allow tabbed navigation\r\n    gGlobalPrefs->useTabs = false;\r\n    // always display the toolbar when embedded (as there's no menubar in that case)\r\n    gGlobalPrefs->showToolbar = true;\r\n    // never allow esc as a shortcut to quit\r\n    gGlobalPrefs->escToExit = false;\r\n    // never show the sidebar by default\r\n    gGlobalPrefs->showToc = false;\r\n    if (DM_AUTOMATIC == gGlobalPrefs->defaultDisplayModeEnum) {\r\n        // if the user hasn't changed the default display mode,\r\n        // display documents as single page/continuous/fit width\r\n        // (similar to Adobe Reader, Google Chrome and how browsers display HTML)\r\n        gGlobalPrefs->defaultDisplayModeEnum = DM_CONTINUOUS;\r\n        gGlobalPrefs->defaultZoomFloat = ZOOM_FIT_WIDTH;\r\n    }\r\n    // use fixed page UI for all document types (so that the context menu always\r\n    // contains all plugin specific entries and the main window is never closed)\r\n    gGlobalPrefs->ebookUI.useFixedPageUI = gGlobalPrefs->chmUI.useFixedPageUI = true;\r\n\r\n    // extract some command line arguments from the URL's hash fragment where available\r\n    // see http://www.adobe.com/devnet/acrobat/pdfs/pdf_open_parameters.pdf#nameddest=G4.1501531\r\n    if (i.pluginURL && str::FindChar(i.pluginURL, '#')) {\r\n        ScopedMem<WCHAR> args(str::Dup(str::FindChar(i.pluginURL, '#') + 1));\r\n        str::TransChars(args, L\"#\", L\"&\");\r\n        WStrVec parts;\r\n        parts.Split(args, L\"&\", true);\r\n        for (size_t k = 0; k < parts.Count(); k++) {\r\n            WCHAR *part = parts.At(k);\r\n            int pageNo;\r\n            if (str::StartsWithI(part, L\"page=\") && str::Parse(part + 4, L\"=%d%$\", &pageNo))\r\n                i.pageNumber = pageNo;\r\n            else if (str::StartsWithI(part, L\"nameddest=\") && part[10])\r\n                i.destName.Set(str::Dup(part + 10));\r\n            else if (!str::FindChar(part, '=') && part[0])\r\n                i.destName.Set(str::Dup(part));\r\n        }\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nstatic void SetupCrashHandler()\r\n{\r\n    ScopedMem<WCHAR> symDir;\r\n    ScopedMem<WCHAR> tmpDir(path::GetTempPath());\r\n    if (tmpDir)\r\n        symDir.Set(path::Join(tmpDir, L\"SumatraPDF-symbols\"));\r\n    else\r\n        symDir.Set(AppGenDataFilename(L\"SumatraPDF-symbols\"));\r\n    ScopedMem<WCHAR> crashDumpPath(AppGenDataFilename(CRASH_DUMP_FILE_NAME));\r\n    InstallCrashHandler(crashDumpPath, symDir);\r\n}\r\n\r\nstatic HWND FindPrevInstWindow(HANDLE *hMutex)\r\n{\r\n    // create a unique identifier for this executable\r\n    // (allows independent side-by-side installations)\r\n    ScopedMem<WCHAR> exePath(GetExePath());\r\n    str::ToLowerInPlace(exePath);\r\n    uint32_t hash = MurmurHash2(exePath.Get(), str::Len(exePath) * sizeof(WCHAR));\r\n    ScopedMem<WCHAR> mapId(str::Format(L\"SumatraPDF-%08x\", hash));\r\n\r\n    int retriesLeft = 3;\r\nRetry:\r\n    // use a memory mapping containing a process id as mutex\r\n    HANDLE hMap = CreateFileMapping(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0, sizeof(DWORD), mapId);\r\n    if (!hMap)\r\n        goto Error;\r\n    bool hasPrevInst = GetLastError() == ERROR_ALREADY_EXISTS;\r\n    DWORD *procId = (DWORD *)MapViewOfFile(hMap, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(DWORD));\r\n    if (!procId) {\r\n        CloseHandle(hMap);\r\n        goto Error;\r\n    }\r\n    if (!hasPrevInst) {\r\n        *procId = GetCurrentProcessId();\r\n        UnmapViewOfFile(procId);\r\n        *hMutex = hMap;\r\n        return nullptr;\r\n    }\r\n\r\n    // if the mapping already exists, find one window belonging to the original process\r\n    DWORD prevProcId = *procId;\r\n    UnmapViewOfFile(procId);\r\n    CloseHandle(hMap);\r\n    HWND hwnd = nullptr;\r\n    while ((hwnd = FindWindowEx(HWND_DESKTOP, hwnd, FRAME_CLASS_NAME, nullptr)) != nullptr) {\r\n        DWORD wndProcId;\r\n        GetWindowThreadProcessId(hwnd, &wndProcId);\r\n        if (wndProcId == prevProcId) {\r\n            AllowSetForegroundWindow(prevProcId);\r\n            return hwnd;\r\n        }\r\n    }\r\n\r\n    // fall through\r\nError:\r\n    if (--retriesLeft < 0)\r\n        return nullptr;\r\n    Sleep(100);\r\n    goto Retry;\r\n}\r\n\r\nextern \"C\" void fz_redirect_dll_io_to_console();\r\n\r\n// Registering happens either through the Installer or the Options dialog;\r\n// here we just make sure that we're still registered\r\nstatic bool RegisterForPdfExtentions(HWND hwnd)\r\n{\r\n    if (IsRunningInPortableMode() || !HasPermission(Perm_RegistryAccess) || gPluginMode)\r\n        return false;\r\n\r\n    if (IsExeAssociatedWithPdfExtension())\r\n        return true;\r\n\r\n    /* Ask user for permission, unless he previously said he doesn't want to\r\n       see this dialog */\r\n    if (!gGlobalPrefs->associateSilently) {\r\n        INT_PTR result = Dialog_PdfAssociate(hwnd, &gGlobalPrefs->associateSilently);\r\n        str::ReplacePtr(&gGlobalPrefs->associatedExtensions, IDYES == result ? L\".pdf\" : nullptr);\r\n    }\r\n    // for now, .pdf is the only choice\r\n    if (!str::EqI(gGlobalPrefs->associatedExtensions, L\".pdf\"))\r\n        return false;\r\n\r\n    AssociateExeWithPdfExtension();\r\n    return true;\r\n}\r\n\r\nstatic int RunMessageLoop()\r\n{\r\n    HACCEL accTable = LoadAccelerators(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDC_SUMATRAPDF));\r\n    MSG msg = { 0 };\r\n\r\n    while (GetMessage(&msg, nullptr, 0, 0)) {\r\n        // dispatch the accelerator to the correct window\r\n        WindowInfo *win = FindWindowInfoByHwnd(msg.hwnd);\r\n        HWND accHwnd = win ? win->hwndFrame : msg.hwnd;\r\n        if (TranslateAccelerator(accHwnd, accTable, &msg))\r\n            continue;\r\n\r\n        TranslateMessage(&msg);\r\n        DispatchMessage(&msg);\r\n    }\r\n\r\n    return (int)msg.wParam;\r\n}\r\n\r\n#if defined(SUPPORTS_AUTO_UPDATE) || defined(DEBUG)\r\nstatic bool RetryIO(const std::function<bool ()>& func, int tries=10)\r\n{\r\n    while (tries-- > 0) {\r\n        if (func())\r\n            return true;\r\n        Sleep(200);\r\n    }\r\n    return false;\r\n}\r\n\r\nstatic bool AutoUpdateMain()\r\n{\r\n    WStrVec argList;\r\n    ParseCmdLine(GetCommandLine(), argList, 4);\r\n    if (argList.Count() != 3 || !str::Eq(argList.At(1), L\"-autoupdate\")) {\r\n        // the argument was misinterpreted, let SumatraPDF start as usual\r\n        return false;\r\n    }\r\n    if (str::Eq(argList.At(2), L\"replace\")) {\r\n        // older 2.6 prerelease versions used implicit paths\r\n        ScopedMem<WCHAR> exePath(GetExePath());\r\n        CrashIf(!str::EndsWith(exePath, L\".exe-updater.exe\"));\r\n        exePath[str::Len(exePath) - 12] = '\\0';\r\n        free(argList.At(2));\r\n        argList.At(2) = str::Format(L\"replace:%s\", exePath);\r\n    }\r\n    const WCHAR *otherExe = nullptr;\r\n    if (str::StartsWith(argList.At(2), L\"replace:\"))\r\n        otherExe = argList.At(2) + 8;\r\n    else if (str::StartsWith(argList.At(2), L\"cleanup:\"))\r\n        otherExe = argList.At(2) + 8;\r\n    if (!str::EndsWithI(otherExe, L\".exe\") || !file::Exists(otherExe)) {\r\n        // continue startup\r\n        return false;\r\n    }\r\n    RetryIO([&] { return file::Delete(otherExe); });\r\n    if (str::StartsWith(argList.At(2), L\"cleanup:\")) {\r\n        // continue startup, restoring the previous session\r\n        return false;\r\n    }\r\n    ScopedMem<WCHAR> thisExe(GetExePath());\r\n    RetryIO([&] { return CopyFile(thisExe, otherExe, FALSE) != 0; });\r\n    // TODO: somehow indicate success or failure\r\n    ScopedMem<WCHAR> cleanupArgs(str::Format(L\"-autoupdate cleanup:\\\"%s\\\"\", thisExe));\r\n    RetryIO([&] { return LaunchFile(otherExe, cleanupArgs); });\r\n    return true;\r\n}\r\n#endif\r\n\r\nstatic void ShutdownCommon() {\r\n    mui::Destroy();\r\n    uitask::Destroy();\r\n    UninstallCrashHandler();\r\n    dbghelp::FreeCallstackLogs();\r\n    // output leaks after all destructors of static objects have run\r\n    _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);\r\n}\r\n\r\nint APIENTRY WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR cmdLine, _In_ int nCmdShow)\r\n{\r\n    UNUSED(hPrevInstance); UNUSED(cmdLine); UNUSED(nCmdShow);\r\n    int retCode = 1;    // by default it's error\r\n\r\n    CrashIf(hInstance != GetInstance());\r\n\r\n#ifdef DEBUG\r\n    // Memory leak detection (only enable _CRTDBG_LEAK_CHECK_DF for\r\n    // regular termination so that leaks aren't checked on exceptions,\r\n    // aborts, etc. where some clean-up might not take place)\r\n    _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF);\r\n    //_CrtSetBreakAlloc(421);\r\n    TryLoadMemTrace();\r\n#endif\r\n\r\n    InitDynCalls();\r\n\r\n    DisableDataExecution();\r\n    // ensure that C functions behave consistently under all OS locales\r\n    // (use Win32 functions where localized input or output is desired)\r\n    setlocale(LC_ALL, \"C\");\r\n    // don't show system-provided dialog boxes when accessing files on drives\r\n    // that are not mounted (e.g. a: drive without floppy or cd rom drive\r\n    // without a cd).\r\n    SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);\r\n\r\n#if defined(DEBUG) || defined(SVN_PRE_RELEASE_VER)\r\n    if (str::StartsWith(cmdLine, \"/tester\")) {\r\n        extern int TesterMain(); // in Tester.cpp\r\n        return TesterMain();\r\n    }\r\n\r\n    if (str::StartsWith(cmdLine, \"/regress\")) {\r\n        extern int RegressMain(); // in Regress.cpp\r\n        return RegressMain();\r\n    }\r\n#endif\r\n#if defined(SUPPORTS_AUTO_UPDATE) || defined(DEBUG)\r\n    if (str::StartsWith(cmdLine, \"-autoupdate\")) {\r\n        bool quit = AutoUpdateMain();\r\n        if (quit)\r\n            return 0;\r\n    }\r\n#endif\r\n\r\n    srand((unsigned int)time(nullptr));\r\n\r\n#ifdef DEBUG\r\n    dbghelp::RememberCallstackLogs();\r\n#endif\r\n\r\n    SetupCrashHandler();\r\n\r\n    ScopedOle ole;\r\n    InitAllCommonControls();\r\n    ScopedGdiPlus gdiPlus(true);\r\n    mui::Initialize();\r\n    uitask::Initialize();\r\n\r\n    CommandLineInfo i;\r\n    i.ParseCommandLine(GetCommandLine());\r\n\r\n    if (i.testRenderPage) {\r\n        TestRenderPage(i);\r\n        ShutdownCommon();\r\n        return 0;\r\n    }\r\n\r\n    if (i.testExtractPage) {\r\n        TestExtractPage(i);\r\n        ShutdownCommon();\r\n        return 0;\r\n    }\r\n\r\n    InitializePolicies(i.restrictedUse);\r\n    if (i.appdataDir)\r\n        SetAppDataPath(i.appdataDir);\r\n\r\n    prefs::Load();\r\n    prefs::UpdateGlobalPrefs(i);\r\n    SetCurrentLang(i.lang ? i.lang : gGlobalPrefs->uiLanguage);\r\n\r\n    // This allows ad-hoc comparison of gdi, gdi+ and gdi+ quick when used\r\n    // in layout\r\n#if 0\r\n    RedirectIOToConsole();\r\n    BenchEbookLayout(L\"C:\\\\kjk\\\\downloads\\\\pg12.mobi\");\r\n    system(\"pause\");\r\n    goto Exit;\r\n#endif\r\n\r\n    if (i.showConsole) {\r\n        RedirectIOToConsole();\r\n        fz_redirect_dll_io_to_console();\r\n    }\r\n    if (i.makeDefault)\r\n        AssociateExeWithPdfExtension();\r\n    if (i.pathsToBenchmark.Count() > 0) {\r\n        BenchFileOrDir(i.pathsToBenchmark);\r\n        if (i.showConsole)\r\n            system(\"pause\");\r\n    }\r\n    if (i.exitImmediately)\r\n        goto Exit;\r\n    gCrashOnOpen = i.crashOnOpen;\r\n\r\n    GetFixedPageUiColors(gRenderCache.textColor, gRenderCache.backgroundColor);\r\n\r\n    if (!RegisterWinClass())\r\n        goto Exit;\r\n\r\n    CrashIf(hInstance != GetModuleHandle(nullptr));\r\n    if (!InstanceInit())\r\n        goto Exit;\r\n\r\n    if (i.hwndPluginParent) {\r\n        if (!SetupPluginMode(i))\r\n            goto Exit;\r\n    }\r\n\r\n    if (i.printerName) {\r\n        // note: this prints all PDF files. Another option would be to\r\n        // print only the first one\r\n        for (size_t n = 0; n < i.fileNames.Count(); n++) {\r\n            bool ok = PrintFile(i.fileNames.At(n), i.printerName, !i.silent, i.printSettings);\r\n            if (!ok)\r\n                retCode++;\r\n        }\r\n        --retCode; // was 1 if no print failures, turn 1 into 0\r\n        goto Exit;\r\n    }\r\n\r\n    HANDLE hMutex = nullptr;\r\n    HWND hPrevWnd = nullptr;\r\n    if (i.printDialog || i.stressTestPath || gPluginMode) {\r\n        // TODO: pass print request through to previous instance?\r\n    }\r\n    else if (i.reuseDdeInstance) {\r\n        hPrevWnd = FindWindow(FRAME_CLASS_NAME, nullptr);\r\n    }\r\n    else if (gGlobalPrefs->reuseInstance || gGlobalPrefs->useTabs) {\r\n        hPrevWnd = FindPrevInstWindow(&hMutex);\r\n    }\r\n    if (hPrevWnd) {\r\n        for (size_t n = 0; n < i.fileNames.Count(); n++) {\r\n            OpenUsingDde(hPrevWnd, i.fileNames.At(n), i, 0 == n);\r\n        }\r\n        if (0 == i.fileNames.Count()) {\r\n            win::ToForeground(hPrevWnd);\r\n        }\r\n        goto Exit;\r\n    }\r\n\r\n    bool restoreSession = false;\r\n    if (gGlobalPrefs->sessionData->Count() > 0 && !gPluginURL) {\r\n        restoreSession = gGlobalPrefs->restoreSession;\r\n    }\r\n    if (gGlobalPrefs->reopenOnce->Count() > 0 && !gPluginURL) {\r\n        if (gGlobalPrefs->reopenOnce->Count() == 1 && str::EqI(gGlobalPrefs->reopenOnce->At(0), L\"SessionData\")) {\r\n            gGlobalPrefs->reopenOnce->FreeMembers();\r\n            restoreSession = true;\r\n        }\r\n        while (gGlobalPrefs->reopenOnce->Count() > 0) {\r\n            i.fileNames.Append(gGlobalPrefs->reopenOnce->Pop());\r\n        }\r\n    }\r\n\r\n    bool showStartPage = !restoreSession && i.fileNames.Count() == 0 &&\r\n                         gGlobalPrefs->rememberOpenedFiles && gGlobalPrefs->showStartPage;\r\n    if (showStartPage) {\r\n        // make the shell prepare the image list, so that it's ready when the first window's loaded\r\n        SHFILEINFO sfi;\r\n        SHGetFileInfo(L\".pdf\", 0, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_USEFILEATTRIBUTES);\r\n    }\r\n\r\n    WindowInfo *win = nullptr;\r\n    if (restoreSession) {\r\n        for (SessionData *data : *gGlobalPrefs->sessionData) {\r\n            win = CreateAndShowWindowInfo(data);\r\n            for (TabState *state : *data->tabStates) {\r\n                RestoreTabOnStartup(win, state);\r\n            }\r\n            TabsSelect(win, data->tabIndex - 1);\r\n        }\r\n    }\r\n    ResetSessionState(gGlobalPrefs->sessionData);\r\n    // prevent the same session from being restored twice\r\n    if (restoreSession && !(gGlobalPrefs->reuseInstance || gGlobalPrefs->useTabs))\r\n        prefs::Save();\r\n\r\n    for (const WCHAR *filePath : i.fileNames) {\r\n        if (restoreSession && FindWindowInfoByFile(filePath, true))\r\n            continue;\r\n        win = LoadOnStartup(filePath, i, !win);\r\n        if (!win) {\r\n            retCode++;\r\n            continue;\r\n        }\r\n        if (i.printDialog)\r\n            OnMenuPrint(win, i.exitWhenDone);\r\n    }\r\n    if (i.fileNames.Count() > 0 && !win) {\r\n        // failed to create any window, even though there\r\n        // were files to load (or show a failure message for)\r\n        goto Exit;\r\n    }\r\n    if (i.printDialog && i.exitWhenDone)\r\n        goto Exit;\r\n\r\n    if (!win) {\r\n        win = CreateAndShowWindowInfo();\r\n        if (!win)\r\n            goto Exit;\r\n    }\r\n\r\n    // Make sure that we're still registered as default,\r\n    // if the user has explicitly told us to be\r\n    if (gGlobalPrefs->associatedExtensions)\r\n        RegisterForPdfExtentions(win->hwndFrame);\r\n\r\n    if (i.stressTestPath) {\r\n        // don't save file history and preference changes\r\n        RestrictPolicies(Perm_SavePreferences);\r\n        RebuildMenuBarForWindow(win);\r\n        StartStressTest(&i, win);\r\n    }\r\n\r\n    if (gGlobalPrefs->checkForUpdates)\r\n        UpdateCheckAsync(win, true);\r\n\r\n    // only hide newly missing files when showing the start page on startup\r\n    if (showStartPage && gFileHistory.Get(0)) {\r\n        gFileExistenceChecker = new FileExistenceChecker();\r\n        gFileExistenceChecker->Start();\r\n    }\r\n    // call this once it's clear whether Perm_SavePreferences has been granted\r\n    prefs::RegisterForFileChanges();\r\n\r\n    retCode = RunMessageLoop();\r\n\r\n    SafeCloseHandle(&hMutex);\r\n    CleanUpThumbnailCache(gFileHistory);\r\n\r\nExit:\r\n    prefs::UnregisterForFileChanges();\r\n\r\n    while (gWindows.Count() > 0) {\r\n        DeleteWindowInfo(gWindows.At(0));\r\n    }\r\n\r\n#ifndef DEBUG\r\n\r\n    // leave all the remaining clean-up to the OS\r\n    // (as recommended for a quick exit)\r\n    ExitProcess(retCode);\r\n\r\n#else\r\n\r\n    DeleteCachedCursors();\r\n    DeleteObject(GetDefaultGuiFont());\r\n    DeleteBitmap(gBitmapReloadingCue);\r\n    DeleteSplitterBrush();\r\n\r\n    // wait for FileExistenceChecker to terminate\r\n    // (which should be necessary only very rarely)\r\n    while (gFileExistenceChecker) {\r\n        Sleep(10);\r\n        uitask::DrainQueue();\r\n    }\r\n\r\n    mui::Destroy();\r\n    uitask::Destroy();\r\n    trans::Destroy();\r\n    DpiRemoveAll();\r\n\r\n    FileWatcherWaitForShutdown();\r\n\r\n    SaveCallstackLogs();\r\n    dbghelp::FreeCallstackLogs();\r\n\r\n    // must be after uitask::Destroy() because we might have queued prefs::Reload()\r\n    // which crashes if gGlobalPrefs is freed\r\n    gFileHistory.UpdateStatesSource(nullptr);\r\n    prefs::CleanUp();\r\n\r\n    // it's still possible to crash after this (destructors of static classes,\r\n    // atexit() code etc.) point, but it's very unlikely\r\n    UninstallCrashHandler();\r\n\r\n    // output leaks after all destructors of static objects have run\r\n    _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);\r\n\r\n    return retCode;\r\n#endif\r\n}\r\n"
  },
  {
    "path": "src/TabInfo.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"FileUtil.h\"\r\n#include \"FileWatcher.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EngineManager.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"ChmModel.h\"\r\n#include \"DisplayModel.h\"\r\n#include \"GlobalPrefs.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"WindowInfo.h\"\r\n#include \"TabInfo.h\"\r\n#include \"AppUtil.h\"\r\n#include \"Selection.h\"\r\n#include \"Translations.h\"\r\n\r\nTabInfo::TabInfo(const WCHAR *filePath) :\r\n    filePath(str::Dup(filePath)), ctrl(nullptr),\r\n    showToc(false), showTocPresentation(false), tocRoot(nullptr),\r\n    reloadOnFocus(false), watcher(nullptr), selectionOnPage(nullptr),\r\n    prevZoomVirtual(INVALID_ZOOM), prevDisplayMode(DM_AUTOMATIC)\r\n{\r\n}\r\n\r\nTabInfo::~TabInfo()\r\n{\r\n    FileWatcherUnsubscribe(watcher);\r\n    if (AsChm())\r\n        AsChm()->RemoveParentHwnd();\r\n    delete tocRoot;\r\n    delete selectionOnPage;\r\n    delete ctrl;\r\n}\r\n\r\nEngineType TabInfo::GetEngineType() const\r\n{\r\n    if (ctrl && ctrl->AsFixed())\r\n        return ctrl->AsFixed()->engineType;\r\n    return Engine_None;\r\n}\r\n\r\nconst WCHAR *TabInfo::GetTabTitle() const\r\n{\r\n    if (gGlobalPrefs->fullPathInTitle)\r\n        return filePath;\r\n    return path::GetBaseName(filePath);\r\n}\r\n\r\nbool LinkSaver::SaveEmbedded(const unsigned char *data, size_t len)\r\n{\r\n    if (!HasPermission(Perm_DiskAccess))\r\n        return false;\r\n\r\n    WCHAR dstFileName[MAX_PATH];\r\n    str::BufSet(dstFileName, dimof(dstFileName), fileName ? fileName : L\"\");\r\n    CrashIf(fileName && str::FindChar(fileName, '/'));\r\n\r\n    // Prepare the file filters (use \\1 instead of \\0 so that the\r\n    // double-zero terminated string isn't cut by the string handling\r\n    // methods too early on)\r\n    ScopedMem<WCHAR> fileFilter(str::Format(L\"%s\\1*.*\\1\", _TR(\"All files\")));\r\n    str::TransChars(fileFilter, L\"\\1\", L\"\\0\");\r\n\r\n    OPENFILENAME ofn = { 0 };\r\n    ofn.lStructSize = sizeof(ofn);\r\n    ofn.hwndOwner = this->parentHwnd;\r\n    ofn.lpstrFile = dstFileName;\r\n    ofn.nMaxFile = dimof(dstFileName);\r\n    ofn.lpstrFilter = fileFilter;\r\n    ofn.nFilterIndex = 1;\r\n    ofn.Flags = OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY;\r\n\r\n    bool ok = GetSaveFileName(&ofn);\r\n    if (!ok)\r\n        return false;\r\n    ok = file::WriteAll(dstFileName, data, len);\r\n    if (ok && tab && IsUntrustedFile(tab->filePath, gPluginURL))\r\n        file::SetZoneIdentifier(dstFileName);\r\n    return ok;\r\n}\r\n"
  },
  {
    "path": "src/TabInfo.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nstruct SelectionOnPage;\r\nstruct WatchedFile;\r\n\r\n/* Data related to a single document loaded into a tab/window */\r\n/* (none of these depend on WindowInfo, so that a TabInfo could\r\n   be moved between windows once this is supported) */\r\nclass TabInfo\r\n{\r\npublic:\r\n    ScopedMem<WCHAR> filePath;\r\n    Controller *ctrl;\r\n    // text of win->hwndFrame when the tab is selected\r\n    ScopedMem<WCHAR> frameTitle;\r\n    // state of the table of contents\r\n    bool showToc, showTocPresentation;\r\n    DocTocItem *tocRoot;\r\n    // an array of ids for ToC items that have been expanded/collapsed by user\r\n    Vec<int> tocState;\r\n    // canvas dimensions when the document was last visible\r\n    RectI canvasRc;\r\n    // whether to auto-reload the document when the tab is selected\r\n    bool reloadOnFocus;\r\n    // FileWatcher token for unsubscribing\r\n    WatchedFile *watcher;\r\n    // list of rectangles of the last rectangular, text or image selection\r\n    // (split by page, in user coordinates)\r\n    Vec<SelectionOnPage> *selectionOnPage;\r\n    // previous View settings, needed when unchecking the Fit Width/Page toolbar buttons\r\n    float prevZoomVirtual;\r\n    DisplayMode prevDisplayMode;\r\n\r\n    TabInfo(const WCHAR *filePath=nullptr);\r\n    ~TabInfo();\r\n\r\n    DisplayModel *AsFixed() const { return ctrl ? ctrl->AsFixed() : nullptr; }\r\n    ChmModel *AsChm() const { return ctrl ? ctrl->AsChm() : nullptr; }\r\n    EbookController *AsEbook() const { return ctrl ? ctrl->AsEbook() : nullptr; }\r\n    // returns Engine_None if !AsFixed()\r\n    EngineType GetEngineType() const;\r\n\r\n    const WCHAR *GetTabTitle() const;\r\n};\r\n\r\nclass LinkSaver : public LinkSaverUI {\r\n    TabInfo *tab;\r\n    HWND parentHwnd;\r\n    const WCHAR *fileName;\r\n\r\npublic:\r\n    LinkSaver(TabInfo *tab, HWND parentHwnd, const WCHAR *fileName) :\r\n        tab(tab), parentHwnd(parentHwnd), fileName(fileName) { }\r\n\r\n    virtual bool SaveEmbedded(const unsigned char *data, size_t cbCount);\r\n};\r\n"
  },
  {
    "path": "src/TableOfContents.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"Dpi.h\"\r\n#include \"GdiPlusUtil.h\"\r\n#include \"LabelWithCloseWnd.h\"\r\n#include \"SplitterWnd.h\"\r\n#include \"UITask.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EngineManager.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"GlobalPrefs.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"WindowInfo.h\"\r\n#include \"TabInfo.h\"\r\n#include \"resource.h\"\r\n#include \"AppTools.h\"\r\n#include \"TableOfContents.h\"\r\n#include \"Tabs.h\"\r\n#include \"Translations.h\"\r\n\r\n/* Define if you want page numbers to be displayed in the ToC sidebar */\r\n// #define DISPLAY_TOC_PAGE_NUMBERS\r\n\r\n#ifdef DISPLAY_TOC_PAGE_NUMBERS\r\n#define WM_APP_REPAINT_TOC     (WM_APP + 1)\r\n#endif\r\n\r\nstatic void TreeView_ExpandRecursively(HWND hTree, HTREEITEM hItem, UINT flag, bool subtree=false)\r\n{\r\n    while (hItem) {\r\n        TreeView_Expand(hTree, hItem, flag);\r\n        HTREEITEM child = TreeView_GetChild(hTree, hItem);\r\n        if (child)\r\n            TreeView_ExpandRecursively(hTree, child, flag);\r\n        if (subtree)\r\n            break;\r\n        hItem = TreeView_GetNextSibling(hTree, hItem);\r\n    }\r\n}\r\n\r\nstatic void CustomizeTocInfoTip(LPNMTVGETINFOTIP nmit)\r\n{\r\n    PageDestination *link = ((DocTocItem *)nmit->lParam)->GetLink();\r\n    ScopedMem<WCHAR> path(link ? link->GetDestValue() : nullptr);\r\n    if (!path)\r\n        return;\r\n    CrashIf(!link); // /analyze claims that this could happen - it really can't\r\n    CrashIf(link->GetDestType() != Dest_LaunchURL && link->GetDestType() != Dest_LaunchFile && link->GetDestType() != Dest_LaunchEmbedded);\r\n\r\n    str::Str<WCHAR> infotip;\r\n\r\n    RECT rcLine, rcLabel;\r\n    HWND hTV = nmit->hdr.hwndFrom;\r\n    // Display the item's full label, if it's overlong\r\n    TreeView_GetItemRect(hTV, nmit->hItem, &rcLine, FALSE);\r\n    TreeView_GetItemRect(hTV, nmit->hItem, &rcLabel, TRUE);\r\n    if (rcLine.right + 2 < rcLabel.right) {\r\n        WCHAR buf[INFOTIPSIZE+1] = { 0 };  // +1 just in case\r\n        TVITEM item;\r\n        item.hItem = nmit->hItem;\r\n        item.mask = TVIF_TEXT;\r\n        item.pszText = buf;\r\n        item.cchTextMax = INFOTIPSIZE;\r\n        TreeView_GetItem(hTV, &item);\r\n        infotip.Append(item.pszText);\r\n        infotip.Append(L\"\\r\\n\");\r\n    }\r\n\r\n    if (Dest_LaunchEmbedded == link->GetDestType())\r\n        path.Set(str::Format(_TR(\"Attachment: %s\"), path.Get()));\r\n\r\n    infotip.Append(path);\r\n    str::BufSet(nmit->pszText, nmit->cchTextMax, infotip.Get());\r\n}\r\n\r\n#ifdef DISPLAY_TOC_PAGE_NUMBERS\r\nstatic void RelayoutTocItem(LPNMTVCUSTOMDRAW ntvcd)\r\n{\r\n    // code inspired by http://www.codeguru.com/cpp/controls/treeview/multiview/article.php/c3985/\r\n    LPNMCUSTOMDRAW ncd = &ntvcd->nmcd;\r\n    HWND hTV = ncd->hdr.hwndFrom;\r\n    HTREEITEM hItem = (HTREEITEM)ncd->dwItemSpec;\r\n    RECT rcItem;\r\n    if (0 == ncd->rc.right - ncd->rc.left || 0 == ncd->rc.bottom - ncd->rc.top)\r\n        return;\r\n    if (!TreeView_GetItemRect(hTV, hItem, &rcItem, TRUE))\r\n        return;\r\n    if (rcItem.right > ncd->rc.right)\r\n        rcItem.right = ncd->rc.right;\r\n\r\n    // Clear the label\r\n    RECT rcFullWidth = rcItem;\r\n    rcFullWidth.right = ncd->rc.right;\r\n    FillRect(ncd->hdc, &rcFullWidth, GetSysColorBrush(COLOR_WINDOW));\r\n\r\n    // Get the label's text\r\n    WCHAR szText[MAX_PATH];\r\n    TVITEM item;\r\n    item.hItem = hItem;\r\n    item.mask = TVIF_TEXT | TVIF_PARAM;\r\n    item.pszText = szText;\r\n    item.cchTextMax = MAX_PATH;\r\n    TreeView_GetItem(hTV, &item);\r\n\r\n    // Draw the page number right-aligned (if there is one)\r\n    WindowInfo *win = FindWindowInfoByHwnd(hTV);\r\n    DocTocItem *tocItem = (DocTocItem *)item.lParam;\r\n    ScopedMem<WCHAR> label;\r\n    if (tocItem->pageNo && win && win->IsDocLoaded()) {\r\n        label.Set(win->ctrl->GetPageLabel(tocItem->pageNo));\r\n        label.Set(str::Join(L\"  \", label));\r\n    }\r\n    if (label && str::EndsWith(item.pszText, label)) {\r\n        RECT rcPageNo = rcFullWidth;\r\n        InflateRect(&rcPageNo, -2, -1);\r\n\r\n        SIZE txtSize;\r\n        GetTextExtentPoint32(ncd->hdc, label, str::Len(label), &txtSize);\r\n        rcPageNo.left = rcPageNo.right - txtSize.cx;\r\n\r\n        SetTextColor(ncd->hdc, GetSysColor(COLOR_WINDOWTEXT));\r\n        SetBkColor(ncd->hdc, GetSysColor(COLOR_WINDOW));\r\n        DrawText(ncd->hdc, label, -1, &rcPageNo, DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX);\r\n\r\n        // Reduce the size of the label and cut off the page number\r\n        rcItem.right = std::max(rcItem.right - txtSize.cx, 0);\r\n        szText[str::Len(szText) - str::Len(label)] = '\\0';\r\n    }\r\n\r\n    SetTextColor(ncd->hdc, ntvcd->clrText);\r\n    SetBkColor(ncd->hdc, ntvcd->clrTextBk);\r\n\r\n    // Draw the focus rectangle (including proper background color)\r\n    HBRUSH brushBg = CreateSolidBrush(ntvcd->clrTextBk);\r\n    FillRect(ncd->hdc, &rcItem, brushBg);\r\n    DeleteObject(brushBg);\r\n    if ((ncd->uItemState & CDIS_FOCUS))\r\n        DrawFocusRect(ncd->hdc, &rcItem);\r\n\r\n    InflateRect(&rcItem, -2, -1);\r\n    DrawText(ncd->hdc, szText, -1, &rcItem, DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_WORD_ELLIPSIS);\r\n}\r\n#endif\r\n\r\n\r\nstatic void GoToTocLinkTask(WindowInfo *win, DocTocItem *tocItem, TabInfo *tab, Controller *ctrl) {\r\n    // tocItem is invalid if the Controller has been replaced\r\n    if (!WindowInfoStillValid(win) || win->currentTab != tab || tab->ctrl != ctrl)\r\n        return;\r\n\r\n    // make sure that the tree item that the user selected\r\n    // isn't unselected in UpdateTocSelection right again\r\n    win->tocKeepSelection = true;\r\n    if (tocItem->GetLink())\r\n        win->linkHandler->GotoLink(tocItem->GetLink());\r\n    else if (tocItem->pageNo)\r\n        ctrl->GoToPage(tocItem->pageNo, true);\r\n    win->tocKeepSelection = false;\r\n}\r\n\r\nstatic void GoToTocLinkForTVItem(WindowInfo* win, HWND hTV, HTREEITEM hItem=nullptr, bool allowExternal=true)\r\n{\r\n    if (!hItem)\r\n        hItem = TreeView_GetSelection(hTV);\r\n\r\n    TVITEM item;\r\n    item.hItem = hItem;\r\n    item.mask = TVIF_PARAM;\r\n    TreeView_GetItem(hTV, &item);\r\n    DocTocItem *tocItem = (DocTocItem *)item.lParam;\r\n    if (!tocItem || !win->IsDocLoaded())\r\n        return;\r\n    if ((allowExternal || tocItem->GetLink() && Dest_ScrollTo == tocItem->GetLink()->GetDestType()) || tocItem->pageNo) {\r\n        // delay changing the page until the tree messages have been handled\r\n        TabInfo *tab = win->currentTab;\r\n        Controller *ctrl = win->ctrl;\r\n        uitask::Post([=] {\r\n            GoToTocLinkTask(win, tocItem, tab, ctrl);\r\n        });\r\n    }\r\n}\r\n\r\nvoid ClearTocBox(WindowInfo *win)\r\n{\r\n    if (!win->tocLoaded)\r\n        return;\r\n\r\n    SendMessage(win->hwndTocTree, WM_SETREDRAW, FALSE, 0);\r\n    TreeView_DeleteAllItems(win->hwndTocTree);\r\n    SendMessage(win->hwndTocTree, WM_SETREDRAW, TRUE, 0);\r\n    RedrawWindow(win->hwndTocTree, nullptr, nullptr, RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);\r\n\r\n    win->currPageNo = 0;\r\n    win->tocLoaded = false;\r\n}\r\n\r\nvoid ToggleTocBox(WindowInfo *win)\r\n{\r\n    if (!win->IsDocLoaded())\r\n        return;\r\n    if (win->tocVisible) {\r\n        SetSidebarVisibility(win, false, gGlobalPrefs->showFavorites);\r\n    } else {\r\n        SetSidebarVisibility(win, true,  gGlobalPrefs->showFavorites);\r\n        if (win->tocVisible)\r\n            SetFocus(win->hwndTocTree);\r\n    }\r\n}\r\n\r\nstatic HTREEITEM AddTocItemToView(HWND hwnd, DocTocItem *entry, HTREEITEM parent, bool toggleItem)\r\n{\r\n    TV_INSERTSTRUCT tvinsert;\r\n    tvinsert.hParent = parent;\r\n    tvinsert.hInsertAfter = TVI_LAST;\r\n    tvinsert.itemex.mask = TVIF_TEXT | TVIF_PARAM | TVIF_STATE;\r\n    tvinsert.itemex.state = entry->child && entry->open != toggleItem ? TVIS_EXPANDED : 0;\r\n    tvinsert.itemex.stateMask = TVIS_EXPANDED;\r\n    tvinsert.itemex.lParam = (LPARAM)entry;\r\n    // Replace unprintable whitespace with regular spaces\r\n    str::NormalizeWS(entry->title);\r\n    tvinsert.itemex.pszText = entry->title;\r\n\r\n#ifdef DISPLAY_TOC_PAGE_NUMBERS\r\n    WindowInfo *win = FindWindowInfoByHwnd(hwnd);\r\n    if (entry->pageNo && win && win->IsDocLoaded() && !win->AsEbook()) {\r\n        ScopedMem<WCHAR> label(win->ctrl->GetPageLabel(entry->pageNo));\r\n        ScopedMem<WCHAR> text(str::Format(L\"%s  %s\", entry->title, label));\r\n        tvinsert.itemex.pszText = text;\r\n        return TreeView_InsertItem(hwnd, &tvinsert);\r\n    }\r\n#endif\r\n\r\n    return TreeView_InsertItem(hwnd, &tvinsert);\r\n}\r\n\r\nstatic void PopulateTocTreeView(HWND hwnd, DocTocItem *entry, Vec<int>& tocState, HTREEITEM parent = nullptr)\r\n{\r\n    for (; entry; entry = entry->next) {\r\n        bool toggle = tocState.Contains(entry->id);\r\n        HTREEITEM node = AddTocItemToView(hwnd, entry, parent, toggle);\r\n        PopulateTocTreeView(hwnd, entry->child, tocState, node);\r\n    }\r\n}\r\n\r\nstatic void TreeItemForPageNoRec(WindowInfo *win, HTREEITEM hItem, int pageNo, HTREEITEM& bestMatchItem, int& bestMatchPageNo)\r\n{\r\n    while (hItem && bestMatchPageNo < pageNo) {\r\n        TVITEM item;\r\n        item.hItem = hItem;\r\n        item.mask = TVIF_PARAM | TVIF_STATE;\r\n        item.stateMask = TVIS_EXPANDED;\r\n        TreeView_GetItem(win->hwndTocTree, &item);\r\n\r\n        // remember this item if it is on the specified page (or on a previous page and closer than all other items)\r\n        if (item.lParam) {\r\n            int page = ((DocTocItem *)item.lParam)->pageNo;\r\n            if (page <= pageNo && page >= bestMatchPageNo && page >= 1) {\r\n                bestMatchItem = hItem;\r\n                bestMatchPageNo = page;\r\n            }\r\n        }\r\n\r\n        // find any child item closer to the specified page\r\n        if ((item.state & TVIS_EXPANDED))\r\n            TreeItemForPageNoRec(win, TreeView_GetChild(win->hwndTocTree, hItem), pageNo, bestMatchItem, bestMatchPageNo);\r\n\r\n        hItem = TreeView_GetNextSibling(win->hwndTocTree, hItem);\r\n    }\r\n}\r\n\r\nstatic HTREEITEM TreeItemForPageNo(WindowInfo *win, HTREEITEM hRoot, int pageNo)\r\n{\r\n    HTREEITEM bestMatchItem = hRoot;\r\n    int bestMatchPageNo = 0;\r\n\r\n    TreeItemForPageNoRec(win, hRoot, pageNo, bestMatchItem, bestMatchPageNo);\r\n\r\n    return bestMatchItem;\r\n}\r\n\r\nvoid UpdateTocSelection(WindowInfo *win, int currPageNo)\r\n{\r\n    if (!win->tocLoaded || !win->tocVisible || win->tocKeepSelection)\r\n        return;\r\n\r\n    HTREEITEM hRoot = TreeView_GetRoot(win->hwndTocTree);\r\n    if (!hRoot)\r\n        return;\r\n    // select the item closest to but not after the current page\r\n    // (or the root item, if there's no such item)\r\n    HTREEITEM hItem = TreeItemForPageNo(win, hRoot, currPageNo);\r\n    TreeView_SelectItem(win->hwndTocTree, hItem);\r\n}\r\n\r\nvoid UpdateTocExpansionState(TabInfo *tab, HWND hwndTocTree, HTREEITEM hItem)\r\n{\r\n    while (hItem) {\r\n        TVITEM item;\r\n        item.hItem = hItem;\r\n        item.mask = TVIF_PARAM | TVIF_STATE;\r\n        item.stateMask = TVIS_EXPANDED;\r\n        TreeView_GetItem(hwndTocTree, &item);\r\n\r\n        DocTocItem *tocItem = item.lParam ? (DocTocItem *)item.lParam : nullptr;\r\n        if (tocItem && tocItem->child) {\r\n            // add the ids of toggled items to tocState\r\n            bool wasToggled = !(item.state & TVIS_EXPANDED) == tocItem->open;\r\n            if (wasToggled)\r\n                tab->tocState.Append(tocItem->id);\r\n            UpdateTocExpansionState(tab, hwndTocTree, TreeView_GetChild(hwndTocTree, hItem));\r\n        }\r\n\r\n        hItem = TreeView_GetNextSibling(hwndTocTree, hItem);\r\n    }\r\n}\r\n\r\nvoid UpdateTocColors(WindowInfo *win)\r\n{\r\n    COLORREF labelBgCol = GetSysColor(COLOR_BTNFACE);\r\n    COLORREF labelTxtCol = GetSysColor(COLOR_BTNTEXT);\r\n    COLORREF treeBgCol = (DWORD)-1;\r\n    COLORREF splitterCol = GetSysColor(COLOR_BTNFACE);\r\n    bool flatTreeWnd = false;\r\n\r\n    if (win->AsEbook() && !gGlobalPrefs->useSysColors) {\r\n        labelBgCol = gGlobalPrefs->ebookUI.backgroundColor;\r\n        labelTxtCol = gGlobalPrefs->ebookUI.textColor;\r\n        treeBgCol = labelBgCol;\r\n        float factor = 14.f;\r\n        int sign = GetLightness(labelBgCol) + factor > 255 ? 1 : -1;\r\n        splitterCol = AdjustLightness2(labelBgCol, sign * factor);\r\n        flatTreeWnd = true;\r\n    }\r\n\r\n    TreeView_SetBkColor(win->hwndTocTree, treeBgCol);\r\n    SetBgCol(win->tocLabelWithClose, labelBgCol);\r\n    SetTextCol(win->tocLabelWithClose, labelTxtCol);\r\n    SetBgCol(win->sidebarSplitter, splitterCol);\r\n    ToggleWindowStyle(win->hwndTocTree, WS_EX_STATICEDGE, !flatTreeWnd, GWL_EXSTYLE);\r\n    SetWindowPos(win->hwndTocTree, nullptr, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_FRAMECHANGED);\r\n\r\n    // TODO: if we have favorites in ebook view, we'll need this\r\n    //SetBgCol(win->favLabelWithClose, labelBgCol);\r\n    //SetTextCol(win->favLabelWithClose, labelTxtCol);\r\n    //SetBgCol(win->favSplitter, labelTxtCol);\r\n\r\n    // TODO: more work needed to to ensure consistent look of the ebook window:\r\n    // - tab bar should match the color\r\n    // - change the tree item text color\r\n    // - change the tree item background color when selected (for both focused and non-focused cases)\r\n    // - ultimately implement owner-drawn scrollbars in a simpler style (like Chrome or VS 2013)\r\n    //   and match their colors as well\r\n}\r\n\r\n// copied from mupdf/fitz/dev_text.c\r\n#define ISLEFTTORIGHTCHAR(c) ((0x0041 <= (c) && (c) <= 0x005A) || (0x0061 <= (c) && (c) <= 0x007A) || (0xFB00 <= (c) && (c) <= 0xFB06))\r\n#define ISRIGHTTOLEFTCHAR(c) ((0x0590 <= (c) && (c) <= 0x05FF) || (0x0600 <= (c) && (c) <= 0x06FF) || (0x0750 <= (c) && (c) <= 0x077F) || (0xFB50 <= (c) && (c) <= 0xFDFF) || (0xFE70 <= (c) && (c) <= 0xFEFF))\r\n\r\nstatic void GetLeftRightCounts(DocTocItem *node, int& l2r, int& r2l)\r\n{\r\n    if (!node)\r\n        return;\r\n    if (node->title) {\r\n        for (const WCHAR *c = node->title; *c; c++) {\r\n            if (ISLEFTTORIGHTCHAR(*c))\r\n                l2r++;\r\n            else if (ISRIGHTTOLEFTCHAR(*c))\r\n                r2l++;\r\n        }\r\n    }\r\n    GetLeftRightCounts(node->child, l2r, r2l);\r\n    GetLeftRightCounts(node->next, l2r, r2l);\r\n}\r\n\r\nvoid LoadTocTree(WindowInfo *win)\r\n{\r\n    TabInfo *tab = win->currentTab;\r\n    CrashIf(!tab);\r\n\r\n    if (win->tocLoaded)\r\n        return;\r\n    win->tocLoaded = true;\r\n\r\n    if (!tab->tocRoot) {\r\n        tab->tocRoot = tab->ctrl->GetTocTree();\r\n        if (!tab->tocRoot)\r\n            return;\r\n    }\r\n\r\n    // consider a ToC tree right-to-left if a more than half of the\r\n    // alphabetic characters are in a right-to-left script\r\n    int l2r = 0, r2l = 0;\r\n    GetLeftRightCounts(tab->tocRoot, l2r, r2l);\r\n    bool isRTL = r2l > l2r;\r\n\r\n    SendMessage(win->hwndTocTree, WM_SETREDRAW, FALSE, 0);\r\n    ToggleWindowStyle(win->hwndTocTree, WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT, isRTL, GWL_EXSTYLE);\r\n    PopulateTocTreeView(win->hwndTocTree, tab->tocRoot, tab->tocState);\r\n    UpdateTocColors(win);\r\n    SendMessage(win->hwndTocTree, WM_SETREDRAW, TRUE, 0);\r\n    UINT fl = RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN;\r\n    RedrawWindow(win->hwndTocTree, nullptr, nullptr, fl);\r\n}\r\n\r\nstatic LRESULT OnTocTreeNotify(WindowInfo *win, LPNMTREEVIEW pnmtv)\r\n{\r\n    switch (pnmtv->hdr.code)\r\n    {\r\n        case TVN_SELCHANGED:\r\n            // When the focus is set to the toc window the first item in the treeview is automatically\r\n            // selected and a TVN_SELCHANGEDW notification message is sent with the special code pnmtv->action == 0x00001000.\r\n            // We have to ignore this message to prevent the current page to be changed.\r\n            if (TVC_BYKEYBOARD == pnmtv->action || TVC_BYMOUSE == pnmtv->action)\r\n                GoToTocLinkForTVItem(win, pnmtv->hdr.hwndFrom, pnmtv->itemNew.hItem, TVC_BYMOUSE == pnmtv->action);\r\n            // The case pnmtv->action==TVC_UNKNOWN is ignored because\r\n            // it corresponds to a notification sent by\r\n            // the function TreeView_DeleteAllItems after deletion of the item.\r\n            break;\r\n\r\n        case TVN_KEYDOWN: {\r\n            TV_KEYDOWN *ptvkd = (TV_KEYDOWN *)pnmtv;\r\n            if (VK_TAB == ptvkd->wVKey) {\r\n                if (win->tabsVisible && IsCtrlPressed())\r\n                    TabsOnCtrlTab(win, IsShiftPressed());\r\n                else\r\n                    AdvanceFocus(win);\r\n                return 1;\r\n            }\r\n            break;\r\n        }\r\n        case NM_CLICK: {\r\n            // Determine which item has been clicked (if any)\r\n            TVHITTESTINFO ht = { 0 };\r\n            DWORD pos = GetMessagePos();\r\n            ht.pt.x = GET_X_LPARAM(pos);\r\n            ht.pt.y = GET_Y_LPARAM(pos);\r\n            MapWindowPoints(HWND_DESKTOP, pnmtv->hdr.hwndFrom, &ht.pt, 1);\r\n            TreeView_HitTest(pnmtv->hdr.hwndFrom, &ht);\r\n\r\n            // let TVN_SELCHANGED handle the click, if it isn't on the already selected item\r\n            if ((ht.flags & TVHT_ONITEM) && TreeView_GetSelection(pnmtv->hdr.hwndFrom) == ht.hItem)\r\n                GoToTocLinkForTVItem(win, pnmtv->hdr.hwndFrom, ht.hItem);\r\n            break;\r\n        }\r\n        case NM_RETURN:\r\n            GoToTocLinkForTVItem(win, pnmtv->hdr.hwndFrom);\r\n            break;\r\n\r\n        case NM_CUSTOMDRAW:\r\n#ifdef DISPLAY_TOC_PAGE_NUMBERS\r\n            if (win->AsEbook())\r\n                return CDRF_DODEFAULT;\r\n            switch (((LPNMCUSTOMDRAW)pnmtv)->dwDrawStage) {\r\n            case CDDS_PREPAINT:\r\n                return CDRF_NOTIFYITEMDRAW;\r\n            case CDDS_ITEMPREPAINT:\r\n                return CDRF_DODEFAULT | CDRF_NOTIFYPOSTPAINT;\r\n            case CDDS_ITEMPOSTPAINT:\r\n                RelayoutTocItem((LPNMTVCUSTOMDRAW)pnmtv);\r\n                // fall through\r\n            default:\r\n                return CDRF_DODEFAULT;\r\n            }\r\n            break;\r\n#else\r\n            return CDRF_DODEFAULT;\r\n#endif\r\n\r\n        case TVN_GETINFOTIP:\r\n            CustomizeTocInfoTip((LPNMTVGETINFOTIP)pnmtv);\r\n            break;\r\n    }\r\n    return -1;\r\n}\r\n\r\nstatic WNDPROC DefWndProcTocTree = nullptr;\r\nstatic LRESULT CALLBACK WndProcTocTree(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)\r\n{\r\n    WindowInfo *win = FindWindowInfoByHwnd(hwnd);\r\n    if (!win)\r\n        return CallWindowProc(DefWndProcTocTree, hwnd, message, wParam, lParam);\r\n\r\n    switch (message) {\r\n        case WM_ERASEBKGND:\r\n            return FALSE;\r\n        case WM_CHAR:\r\n            if (VK_ESCAPE == wParam && gGlobalPrefs->escToExit && MayCloseWindow(win))\r\n                CloseWindow(win, true);\r\n            break;\r\n        case WM_KEYDOWN:\r\n            // consistently expand/collapse whole (sub)trees\r\n            if (VK_MULTIPLY == wParam && IsShiftPressed())\r\n                TreeView_ExpandRecursively(hwnd, TreeView_GetRoot(hwnd), TVE_EXPAND);\r\n            else if (VK_MULTIPLY == wParam)\r\n                TreeView_ExpandRecursively(hwnd, TreeView_GetSelection(hwnd), TVE_EXPAND, true);\r\n            else if (VK_DIVIDE == wParam && IsShiftPressed()) {\r\n                HTREEITEM root = TreeView_GetRoot(hwnd);\r\n                if (!TreeView_GetNextSibling(hwnd, root))\r\n                    root = TreeView_GetChild(hwnd, root);\r\n                TreeView_ExpandRecursively(hwnd, root, TVE_COLLAPSE);\r\n            }\r\n            else if (VK_DIVIDE == wParam)\r\n                TreeView_ExpandRecursively(hwnd, TreeView_GetSelection(hwnd), TVE_COLLAPSE, true);\r\n            else\r\n                break;\r\n            TreeView_EnsureVisible(hwnd, TreeView_GetSelection(hwnd));\r\n            return 0;\r\n        case WM_MOUSEWHEEL:\r\n        case WM_MOUSEHWHEEL:\r\n            // scroll the canvas if the cursor isn't over the ToC tree\r\n            if (!IsCursorOverWindow(win->hwndTocTree))\r\n                return SendMessage(win->hwndCanvas, message, wParam, lParam);\r\n            break;\r\n#ifdef DISPLAY_TOC_PAGE_NUMBERS\r\n        case WM_SIZE:\r\n        case WM_HSCROLL:\r\n            // Repaint the ToC so that RelayoutTocItem is called for all items\r\n            PostMessage(hwnd, WM_APP_REPAINT_TOC, 0, 0);\r\n            break;\r\n        case WM_APP_REPAINT_TOC:\r\n            InvalidateRect(hwnd, nullptr, TRUE);\r\n            UpdateWindow(hwnd);\r\n            break;\r\n#endif\r\n    }\r\n    return CallWindowProc(DefWndProcTocTree, hwnd, message, wParam, lParam);\r\n}\r\n\r\nstatic WNDPROC DefWndProcTocBox = nullptr;\r\nstatic LRESULT CALLBACK WndProcTocBox(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    WindowInfo *win = FindWindowInfoByHwnd(hwnd);\r\n    if (!win)\r\n        return CallWindowProc(DefWndProcTocBox, hwnd, msg, wParam, lParam);\r\n\r\n    switch (msg) {\r\n        case WM_SIZE:\r\n            LayoutTreeContainer(win->tocLabelWithClose, win->hwndTocTree);\r\n            break;\r\n\r\n        case WM_COMMAND:\r\n            if (LOWORD(wParam) == IDC_TOC_LABEL_WITH_CLOSE)\r\n                ToggleTocBox(win);\r\n            break;\r\n\r\n        case WM_NOTIFY:\r\n            if (LOWORD(wParam) == IDC_TOC_TREE) {\r\n                LRESULT res = OnTocTreeNotify(win, (LPNMTREEVIEW)lParam);\r\n                if (res != -1)\r\n                    return res;\r\n            }\r\n            break;\r\n    }\r\n    return CallWindowProc(DefWndProcTocBox, hwnd, msg, wParam, lParam);\r\n}\r\n\r\nvoid CreateToc(WindowInfo *win)\r\n{\r\n    win->hwndTocBox = CreateWindow(WC_STATIC, L\"\", WS_CHILD|WS_CLIPCHILDREN,\r\n                                   0, 0, gGlobalPrefs->sidebarDx, 0,\r\n                                   win->hwndFrame, (HMENU)0, GetModuleHandle(nullptr), nullptr);\r\n\r\n    LabelWithCloseWnd *l = CreateLabelWithCloseWnd(win->hwndTocBox, IDC_TOC_LABEL_WITH_CLOSE);\r\n    win->tocLabelWithClose = l;\r\n    SetPaddingXY(l, 2, 2);\r\n    SetFont(l, GetDefaultGuiFont());\r\n    // label is set in UpdateToolbarSidebarText()\r\n\r\n    win->hwndTocTree = CreateWindowEx(WS_EX_STATICEDGE, WC_TREEVIEW, L\"TOC\",\r\n                                      TVS_HASBUTTONS|TVS_HASLINES|TVS_LINESATROOT|TVS_SHOWSELALWAYS|\r\n                                      TVS_TRACKSELECT|TVS_DISABLEDRAGDROP|TVS_NOHSCROLL|TVS_INFOTIP|\r\n                                      WS_TABSTOP|WS_VISIBLE|WS_CHILD,\r\n                                      0, 0, 0, 0, win->hwndTocBox, (HMENU)IDC_TOC_TREE, GetModuleHandle(nullptr), nullptr);\r\n\r\n    TreeView_SetUnicodeFormat(win->hwndTocTree, true);\r\n\r\n    if (nullptr == DefWndProcTocTree)\r\n        DefWndProcTocTree = (WNDPROC)GetWindowLongPtr(win->hwndTocTree, GWLP_WNDPROC);\r\n    SetWindowLongPtr(win->hwndTocTree, GWLP_WNDPROC, (LONG_PTR)WndProcTocTree);\r\n\r\n    if (nullptr == DefWndProcTocBox)\r\n        DefWndProcTocBox = (WNDPROC)GetWindowLongPtr(win->hwndTocBox, GWLP_WNDPROC);\r\n    SetWindowLongPtr(win->hwndTocBox, GWLP_WNDPROC, (LONG_PTR)WndProcTocBox);\r\n}\r\n"
  },
  {
    "path": "src/TableOfContents.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nvoid CreateToc(WindowInfo *win);\r\nvoid ClearTocBox(WindowInfo *win);\r\nvoid ToggleTocBox(WindowInfo *win);\r\nvoid LoadTocTree(WindowInfo *win);\r\nvoid UpdateTocColors(WindowInfo *win);\r\nvoid UpdateTocSelection(WindowInfo *win, int currPageNo);\r\nvoid UpdateTocExpansionState(TabInfo *tab, HWND hwndTocTree, HTREEITEM hItem);\r\n"
  },
  {
    "path": "src/Tabs.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"WinDynCalls.h\"\r\n#include \"Dpi.h\"\r\n#include \"FileUtil.h\"\r\n#include \"GdiPlusUtil.h\"\r\n#include \"UITask.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EngineManager.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"GlobalPrefs.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"WindowInfo.h\"\r\n#include \"TabInfo.h\"\r\n#include \"resource.h\"\r\n#include \"Caption.h\"\r\n#include \"Menu.h\"\r\n#include \"TableOfContents.h\"\r\n#include \"Tabs.h\"\r\n\r\nstatic void SwapTabs(WindowInfo *win, int tab1, int tab2);\r\n\r\n#define DEFAULT_CURRENT_BG_COL (COLORREF)-1\r\n\r\n#define TAB_COLOR_BG      COLOR_BTNFACE\r\n#define TAB_COLOR_TEXT    COLOR_BTNTEXT\r\n\r\n#define T_CLOSING   (TCN_LAST + 1)\r\n#define T_CLOSE     (TCN_LAST + 2)\r\n#define T_DRAG      (TCN_LAST + 3)\r\n\r\n#define TABBAR_HEIGHT    24\r\n#define MIN_TAB_WIDTH   100\r\n\r\nstatic bool g_FirefoxStyle = false;\r\n\r\nint GetTabbarHeight(HWND hwnd, float factor)\r\n{\r\n    int dy = DpiScaleY(hwnd, TABBAR_HEIGHT);\r\n    return (int)(dy * factor);\r\n}\r\n\r\nstatic inline SizeI GetTabSize(HWND hwnd)\r\n{\r\n    int dx = DpiScaleX(hwnd, std::max(gGlobalPrefs->prereleaseSettings.tabWidth, MIN_TAB_WIDTH));\r\n    int dy = DpiScaleY(hwnd, TABBAR_HEIGHT);\r\n    return SizeI(dx, dy);\r\n}\r\n\r\nstatic inline Color ToColor(COLORREF c)\r\n{\r\n    return Color(GetRValueSafe(c), GetGValueSafe(c), GetBValueSafe(c));\r\n}\r\n\r\nclass TabPainter\r\n{\r\n    WStrVec text;\r\n    PathData *data;\r\n    int width, height;\r\n    HWND hwnd;\r\npublic:\r\n    int current, highlighted, xClicked, xHighlighted;\r\n    bool isMouseInClientArea, isDragging;\r\n    LPARAM mouseCoordinates;\r\n    int nextTab;\r\n    bool inTitlebar;\r\n    COLORREF currBgCol;\r\n    struct {\r\n        COLORREF background, highlight, current, outline, bar, text, x_highlight, x_click, x_line;\r\n    } color;\r\n\r\n    TabPainter(HWND wnd, SizeI tabSize) :\r\n        hwnd(wnd), data(nullptr), width(0), height(0),\r\n        current(-1), highlighted(-1), xClicked(-1), xHighlighted(-1), nextTab(-1),\r\n        isMouseInClientArea(false), isDragging(false), inTitlebar(false), currBgCol(DEFAULT_CURRENT_BG_COL) {\r\n        memset(&color, 0, sizeof(color));\r\n        Reshape(tabSize.dx, tabSize.dy);\r\n        EvaluateColors(false);\r\n    }\r\n\r\n    ~TabPainter() {\r\n        delete data;\r\n        DeleteAll();\r\n    }\r\n\r\n    // Calculates tab's elements, based on its width and height.\r\n    // Generates a GraphicsPath, which is used for painting the tab, etc.\r\n    bool Reshape(int dx, int dy) {\r\n        dx--;\r\n        if (width == dx && height == dy)\r\n            return false;\r\n        width = dx; height = dy;\r\n\r\n        GraphicsPath shape;\r\n        // define tab's body\r\n        int c = int((float)height * 0.6f + 0.5f); // size of bounding square for the arc\r\n        shape.AddArc(0, 0, c, c, 180.0f, 90.0f);\r\n        shape.AddArc(width - c, 0, c, c, 270.0f, 90.0f);\r\n        shape.AddLine(width, height, 0, height);\r\n        shape.CloseFigure();\r\n        shape.SetMarker();\r\n\r\n        // define \"x\"'s circle\r\n        c = int((float)height * 0.78f + 0.5f); // size of bounding square for the circle\r\n        int maxC = DpiScaleX(hwnd, 17);\r\n        if (height > maxC) {\r\n            c = DpiScaleX(hwnd, 17);\r\n        }\r\n        Point p(width - c - DpiScaleX(hwnd, 3), (height - c) / 2); // circle's position\r\n        shape.AddEllipse(p.X, p.Y, c, c);\r\n        shape.SetMarker();\r\n        // define \"x\"\r\n        int o = int((float)c * 0.286f + 0.5f); // \"x\"'s offset\r\n        shape.AddLine(p.X+o, p.Y+o, p.X+c-o, p.Y+c-o);\r\n        shape.StartFigure();\r\n        shape.AddLine(p.X+c-o, p.Y+o, p.X+o, p.Y+c-o);\r\n        shape.SetMarker();\r\n\r\n        delete data;\r\n        data = new PathData();\r\n        shape.GetPathData(data);\r\n        return true;\r\n    }\r\n\r\n    // Finds the index of the tab, which contains the given point.\r\n    int IndexFromPoint(int x, int y, bool *inXbutton=nullptr) {\r\n        Point point(x, y);\r\n        Graphics graphics(hwnd);\r\n        GraphicsPath shapes(data->Points, data->Types, data->Count);\r\n        GraphicsPath shape;\r\n        GraphicsPathIterator iterator(&shapes);\r\n        iterator.NextMarker(&shape);\r\n\r\n        ClientRect rClient(hwnd);\r\n        REAL yPosTab = inTitlebar ? 0.0f : REAL(rClient.dy - height - 1);\r\n        graphics.TranslateTransform(1.0f, yPosTab);\r\n        for (int i = 0; i < Count(); i++) {\r\n            Point pt(point);\r\n            graphics.TransformPoints( CoordinateSpaceWorld, CoordinateSpaceDevice, &pt, 1);\r\n            if (shape.IsVisible(pt, &graphics)) {\r\n                iterator.NextMarker(&shape);\r\n                if (inXbutton)\r\n                    *inXbutton = shape.IsVisible(pt, &graphics) ? true : false;\r\n                return i;\r\n            }\r\n            graphics.TranslateTransform(REAL(width + 1), 0.0f);\r\n        }\r\n        if (inXbutton)\r\n            *inXbutton = false;\r\n        return -1;\r\n    }\r\n\r\n    // Invalidates the tab's region in the client area.\r\n    void Invalidate(int index) {\r\n        if (index < 0) return;\r\n\r\n        Graphics graphics(hwnd);\r\n        GraphicsPath shapes(data->Points, data->Types, data->Count);\r\n        GraphicsPath shape;\r\n        GraphicsPathIterator iterator(&shapes);\r\n        iterator.NextMarker(&shape);\r\n        Region region(&shape);\r\n\r\n        ClientRect rClient(hwnd);\r\n        REAL yPosTab = inTitlebar ? 0.0f : REAL(rClient.dy - height - 1);\r\n        graphics.TranslateTransform(REAL((width + 1) * index) + 1.0f, yPosTab);\r\n        HRGN hRgn = region.GetHRGN(&graphics);\r\n        InvalidateRgn(hwnd, hRgn, FALSE);\r\n        DeleteObject(hRgn);\r\n    }\r\n\r\n    // Paints the tabs that intersect the window's update rectangle.\r\n    void Paint(HDC hdc, RECT &rc) {\r\n        IntersectClipRect(hdc, rc.left, rc.top, rc.right, rc.bottom);\r\n\r\n        // paint the background\r\n        bool isTranslucentMode = inTitlebar && dwm::IsCompositionEnabled();\r\n        if (isTranslucentMode)\r\n            PaintParentBackground(hwnd, hdc);\r\n        else {\r\n            HBRUSH brush = CreateSolidBrush(color.bar);\r\n            FillRect(hdc, &rc, brush);\r\n            DeleteObject(brush);\r\n        }\r\n\r\n        // TODO: GDI+ doesn't seem to cope well with SetWorldTransform\r\n        XFORM ctm = { 1.0, 0, 0, 1.0, 0, 0 };\r\n        SetWorldTransform(hdc, &ctm);\r\n\r\n        Graphics graphics(hdc);\r\n        graphics.SetCompositingMode(CompositingModeSourceCopy);\r\n        graphics.SetCompositingQuality(CompositingQualityHighQuality);\r\n        graphics.SetSmoothingMode(SmoothingModeHighQuality);\r\n        graphics.SetTextRenderingHint(TextRenderingHintClearTypeGridFit);\r\n        graphics.SetPageUnit(UnitPixel);\r\n        GraphicsPath shapes(data->Points, data->Types, data->Count);\r\n        GraphicsPath shape;\r\n        GraphicsPathIterator iterator(&shapes);\r\n\r\n        SolidBrush br(Color(0, 0, 0));\r\n        Pen pen(&br, 2.0f);\r\n\r\n        Font f(hdc, GetDefaultGuiFont());\r\n        // TODO: adjust these constant values for DPI?\r\n        RectF layout((REAL)DpiScaleX(hwnd,3), 1.0f, REAL(width - DpiScaleX(hwnd,20)), (REAL)height);\r\n        StringFormat sf(StringFormat::GenericDefault());\r\n        sf.SetFormatFlags(StringFormatFlagsNoWrap);\r\n        sf.SetLineAlignment(StringAlignmentCenter);\r\n        sf.SetTrimming(StringTrimmingEllipsisCharacter);\r\n\r\n        REAL yPosTab = inTitlebar ? 0.0f : REAL(ClientRect(hwnd).dy - height - 1);\r\n        for (int i = 0; i < Count(); i++) {\r\n            graphics.ResetTransform();\r\n            graphics.TranslateTransform(1.f + (REAL)(width + 1) * i - (REAL)rc.left, yPosTab - (REAL)rc.top);\r\n\r\n            if (!graphics.IsVisible(0, 0, width + 1, height + 1))\r\n                continue;\r\n\r\n            // in firefox style we only paint current and highlighed tabs\r\n            // all other tabs only show\r\n            bool onlyText = g_FirefoxStyle && !((current == i) || (highlighted == i));\r\n            if (onlyText) {\r\n#if 0\r\n                // we need to first paint the background with the same color as caption,\r\n                // otherwise the text looks funny (because is transparent?)\r\n                // TODO: what is the damn bg color of caption? bar is too light, outline is too dark\r\n                Color bgColTmp;\r\n                bgColTmp.SetFromCOLORREF(color.bar);\r\n                {\r\n                    SolidBrush bgBr(bgColTmp);\r\n                    graphics.FillRectangle(&bgBr, layout);\r\n                }\r\n                bgColTmp.SetFromCOLORREF(color.outline);\r\n                {\r\n                    SolidBrush bgBr(bgColTmp);\r\n                    graphics.FillRectangle(&bgBr, layout);\r\n                }\r\n#endif\r\n                // TODO: this is a hack. If I use no background and cleartype, the\r\n                // text looks funny (is bold).\r\n                // CompositingModeSourceCopy doesn't work with clear type\r\n                // another option is to draw background before drawing text, but\r\n                // I can't figure out what is the actual color of caption\r\n                graphics.SetTextRenderingHint(TextRenderingHintAntiAliasGridFit);\r\n                graphics.SetCompositingMode(CompositingModeSourceCopy);\r\n                //graphics.SetCompositingMode(CompositingModeSourceOver);\r\n                br.SetColor(ToColor(color.text));\r\n                graphics.DrawString(text.At(i), -1, &f, layout, &sf, &br);\r\n                graphics.SetTextRenderingHint(TextRenderingHintClearTypeGridFit);\r\n                continue;\r\n            }\r\n\r\n            COLORREF bgCol = color.background;;\r\n            if (current == i) {\r\n                bgCol = color.current;\r\n            } else if (highlighted == i) {\r\n                bgCol = color.highlight;\r\n            }\r\n\r\n            // ensure contrast between text and background color\r\n            // TODO: adjust threshold (and try adjusting both current/background tabs)\r\n            COLORREF textCol = color.text;\r\n            float bgLight = GetLightness(bgCol), textLight = GetLightness(textCol);\r\n            if (textLight < bgLight ? bgLight < 0x70 : bgLight > 0x90)\r\n                textCol = textLight ? AdjustLightness(textCol, 255.0f / textLight - 1.0f) : RGB(255, 255, 255);\r\n            if (fabs(textLight - bgLight) < 0x40)\r\n                textCol = bgLight < 0x80 ? RGB(255, 255, 255) : RGB(0, 0, 0);\r\n\r\n            // paint tab's body\r\n            graphics.SetCompositingMode(CompositingModeSourceCopy);\r\n            iterator.NextMarker(&shape);\r\n            br.SetColor(ToColor(bgCol));\r\n            graphics.FillPath(&br, &shape);\r\n\r\n            // draw tab's text\r\n            graphics.SetCompositingMode(CompositingModeSourceOver);\r\n            br.SetColor(ToColor(textCol));\r\n            graphics.DrawString(text.At(i), -1, &f, layout, &sf, &br);\r\n\r\n            // paint \"x\"'s circle\r\n            iterator.NextMarker(&shape);\r\n            if (xClicked == i || xHighlighted == i) {\r\n                br.SetColor(ToColor(i == xClicked ? color.x_click : color.x_highlight));\r\n                graphics.FillPath(&br, &shape);\r\n            }\r\n\r\n            // paint \"x\"\r\n            iterator.NextMarker(&shape);\r\n            if (xClicked == i || xHighlighted == i)\r\n                pen.SetColor(ToColor(color.x_line));\r\n            else\r\n                pen.SetColor(ToColor(color.outline));\r\n            graphics.DrawPath(&pen, &shape);\r\n            iterator.Rewind();\r\n        }\r\n    }\r\n\r\n    // Evaluates the colors for the tab's elements.\r\n    void EvaluateColors(bool force) {\r\n        COLORREF bg, txt;\r\n        if (inTitlebar) {\r\n            WindowInfo *win = FindWindowInfoByHwnd(hwnd);\r\n            bg = win->caption->bgColor;\r\n            txt = win->caption->textColor;\r\n        }\r\n        else {\r\n            bg = GetSysColor(TAB_COLOR_BG);\r\n            txt = GetSysColor(TAB_COLOR_TEXT);\r\n        }\r\n        if (!force && bg == color.bar && txt == color.text)\r\n            return;\r\n\r\n        color.bar  = bg;\r\n        color.text = txt;\r\n\r\n        int sign = GetLightness(color.text) > GetLightness(color.bar) ? -1 : 1;\r\n\r\n        color.current      = AdjustLightness2(color.bar, sign * 25.0f);\r\n        color.highlight   = AdjustLightness2(color.bar, sign * 15.0f);\r\n        color.background  = AdjustLightness2(color.bar, -sign * 15.0f);\r\n        color.outline     = AdjustLightness2(color.bar, -sign * 60.0f);\r\n        color.x_line      = COL_CLOSE_X_HOVER;\r\n        color.x_highlight = COL_CLOSE_HOVER_BG;\r\n        color.x_click     = AdjustLightness2(color.x_highlight, -10.0f);\r\n        if (currBgCol != DEFAULT_CURRENT_BG_COL) {\r\n            color.current = currBgCol;\r\n        }\r\n    }\r\n\r\n    int Count() {\r\n        return (int)text.Count();\r\n    }\r\n\r\n    void Insert(int index, const WCHAR *t) {\r\n        text.InsertAt(index, str::Dup(t));\r\n    }\r\n\r\n    bool Set(int index, const WCHAR *t) {\r\n        if (index < Count()) {\r\n            str::ReplacePtr(&text.At(index), t);\r\n            return true;\r\n        }\r\n        return false;\r\n    }\r\n\r\n    bool Delete(int index) {\r\n        if (index < Count()) {\r\n            free(text.PopAt(index));\r\n            return true;\r\n        }\r\n        return false;\r\n    }\r\n\r\n    void DeleteAll() {\r\n        text.Reset();\r\n    }\r\n};\r\n\r\nstatic void TabNotification(WindowInfo *win, UINT code, int idx1, int idx2) {\r\n    if (!WindowInfoStillValid(win)) {\r\n        return;\r\n    }\r\n    NMHDR nmhdr = { nullptr, 0, code };\r\n    if (TabsOnNotify(win, (LPARAM)&nmhdr, idx1, idx2)) {\r\n        return;\r\n    }\r\n    TabPainter *tab = (TabPainter *)GetWindowLongPtr(win->hwndTabBar, GWLP_USERDATA);\r\n    if (T_CLOSING == code) {\r\n        // if we have permission to close the tab\r\n        tab->Invalidate(tab->nextTab);\r\n        tab->xClicked = tab->nextTab;\r\n        return;\r\n    }\r\n    if (TCN_SELCHANGING == code) {\r\n        // if we have permission to select the tab\r\n        tab->Invalidate(tab->current);\r\n        tab->Invalidate(tab->nextTab);\r\n        tab->current = tab->nextTab;\r\n        // send notification that the tab is selected\r\n        nmhdr.code = TCN_SELCHANGE;\r\n        TabsOnNotify(win, (LPARAM)&nmhdr);\r\n    }\r\n}\r\n\r\nstatic WNDPROC DefWndProcTabBar = nullptr;\r\nstatic LRESULT CALLBACK WndProcTabBar(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    PAINTSTRUCT ps;\r\n    HDC hdc;\r\n    int index;\r\n    LPTCITEM tcs;\r\n\r\n    TabPainter *tab = (TabPainter *)GetWindowLongPtr(hwnd, GWLP_USERDATA);\r\n\r\n    switch (msg) {\r\n    case WM_DESTROY:\r\n        delete tab;\r\n        SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)0);\r\n        break;\r\n\r\n    case TCM_INSERTITEM:\r\n        index = (int)wParam;\r\n        tcs = (LPTCITEM)lParam;\r\n        CrashIf(!(TCIF_TEXT & tcs->mask));\r\n        tab->Insert(index, tcs->pszText);\r\n        if ((int)index <= tab->current)\r\n            tab->current++;\r\n        tab->xClicked = -1;\r\n        if (tab->isMouseInClientArea)\r\n            PostMessage(hwnd, WM_MOUSEMOVE, 0, tab->mouseCoordinates);\r\n        InvalidateRgn(hwnd, nullptr, FALSE);\r\n        UpdateWindow(hwnd);\r\n        break;\r\n\r\n    case TCM_SETITEM:\r\n        index = (int)wParam;\r\n        tcs = (LPTCITEM)lParam;\r\n        if (TCIF_TEXT & tcs->mask) {\r\n            if (tab->Set(index, tcs->pszText))\r\n                tab->Invalidate(index);\r\n        }\r\n        break;\r\n\r\n    case TCM_DELETEITEM:\r\n        index = (int)wParam;\r\n        if (tab->Delete(index)) {\r\n            if ((int)index < tab->current)\r\n                tab->current--;\r\n            else if ((int)index == tab->current)\r\n                tab->current = -1;\r\n            tab->xClicked = -1;\r\n            if (tab->isMouseInClientArea)\r\n                PostMessage(hwnd, WM_MOUSEMOVE, 0, tab->mouseCoordinates);\r\n            if (tab->Count()) {\r\n                InvalidateRgn(hwnd, nullptr, FALSE);\r\n                UpdateWindow(hwnd);\r\n            }\r\n        }\r\n        break;\r\n\r\n    case TCM_DELETEALLITEMS:\r\n        tab->DeleteAll();\r\n        tab->current = tab->highlighted = tab->xClicked = tab->xHighlighted = -1;\r\n        break;\r\n\r\n    case TCM_SETITEMSIZE:\r\n        if (tab->Reshape(LOWORD(lParam), HIWORD(lParam))) {\r\n            tab->xClicked = -1;\r\n            if (tab->isMouseInClientArea)\r\n                PostMessage(hwnd, WM_MOUSEMOVE, 0, tab->mouseCoordinates);\r\n            if (tab->Count()) {\r\n                InvalidateRgn(hwnd, nullptr, FALSE);\r\n                UpdateWindow(hwnd);\r\n            }\r\n        }\r\n        break;\r\n\r\n    case TCM_GETCURSEL:\r\n        return tab->current;\r\n\r\n    case TCM_SETCURSEL:\r\n        {\r\n            index = (int)wParam;\r\n            if (index >= tab->Count()) return -1;\r\n            int previous = tab->current;\r\n            if ((int)index != tab->current) {\r\n                tab->Invalidate(tab->current);\r\n                tab->Invalidate(index);\r\n                tab->current = index;\r\n                UpdateWindow(hwnd);\r\n            }\r\n            return previous;\r\n        }\r\n\r\n    case WM_NCHITTEST:\r\n        {\r\n            if (!tab->inTitlebar || hwnd == GetCapture())\r\n                return HTCLIENT;\r\n            POINT pt = {GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)};\r\n            ScreenToClient(hwnd, &pt);\r\n            if (-1 != tab->IndexFromPoint(pt.x, pt.y))\r\n                return HTCLIENT;\r\n        }\r\n        return HTTRANSPARENT;\r\n\r\n    case WM_MOUSELEAVE:\r\n        PostMessage(hwnd, WM_MOUSEMOVE, 0xFF, 0);\r\n        return 0;\r\n\r\n    case WM_MOUSEMOVE:\r\n        {\r\n            tab->mouseCoordinates = lParam;\r\n\r\n            if (!tab->isMouseInClientArea) {\r\n                // Track the mouse for leaving the client area.\r\n                TRACKMOUSEEVENT tme = { 0 };\r\n                tme.cbSize = sizeof(TRACKMOUSEEVENT);\r\n                tme.dwFlags = TME_LEAVE;\r\n                tme.hwndTrack = hwnd;\r\n                if (TrackMouseEvent(&tme))\r\n                    tab->isMouseInClientArea = true;\r\n            }\r\n            if (wParam == 0xFF)     // The mouse left the client area.\r\n                tab->isMouseInClientArea = false;\r\n\r\n            bool inX = false;\r\n            int hl = wParam == 0xFF ? -1 : tab->IndexFromPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), &inX);\r\n            if (tab->isDragging && hl == -1) {\r\n                // preserve the highlighted tab if it's dragged outside the tabs' area\r\n                hl = tab->highlighted;\r\n            }\r\n            if (tab->highlighted != hl) {\r\n                if (tab->isDragging) {\r\n                    // send notification if the highlighted tab is dragged over another\r\n                    WindowInfo *win = FindWindowInfoByHwnd(hwnd);\r\n                    int tabNo = tab->highlighted;\r\n                    uitask::Post([=] { TabNotification(win, T_DRAG, tabNo, hl); });\r\n                }\r\n\r\n                tab->Invalidate(hl);\r\n                tab->Invalidate(tab->highlighted);\r\n                tab->highlighted = hl;\r\n            }\r\n            int xHl = inX && !tab->isDragging ? hl : -1;\r\n            if (tab->xHighlighted != xHl) {\r\n                tab->Invalidate(xHl);\r\n                tab->Invalidate(tab->xHighlighted);\r\n                tab->xHighlighted = xHl;\r\n            }\r\n            if (!inX)\r\n                tab->xClicked = -1;\r\n        }\r\n        return 0;\r\n\r\n    case WM_LBUTTONDOWN:\r\n        bool inX;\r\n        tab->nextTab = tab->IndexFromPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), &inX);\r\n        if (inX) {\r\n            // send request to close the tab\r\n            WindowInfo *win = FindWindowInfoByHwnd(hwnd);\r\n            int next = tab->nextTab;\r\n            uitask::Post([=] { TabNotification(win, T_CLOSING, next, -1); });\r\n        }\r\n        else if (tab->nextTab != -1) {\r\n            if (tab->nextTab != tab->current) {\r\n                // send request to select tab\r\n                WindowInfo *win = FindWindowInfoByHwnd(hwnd);\r\n                uitask::Post([=] { TabNotification(win, TCN_SELCHANGING, -1, -1); });\r\n            }\r\n            tab->isDragging = true;\r\n            SetCapture(hwnd);\r\n        }\r\n        return 0;\r\n\r\n    case WM_LBUTTONUP:\r\n        if (tab->xClicked != -1) {\r\n            // send notification that the tab is closed\r\n            WindowInfo *win = FindWindowInfoByHwnd(hwnd);\r\n            int clicked = tab->xClicked;\r\n            uitask::Post([=] { TabNotification(win, T_CLOSE, clicked, -1); });\r\n            tab->Invalidate(clicked);\r\n            tab->xClicked = -1;\r\n        }\r\n        if (tab->isDragging) {\r\n            tab->isDragging = false;\r\n            ReleaseCapture();\r\n        }\r\n        return 0;\r\n\r\n    case WM_MBUTTONDOWN:\r\n        // middle-clicking unconditionally closes the tab\r\n        {\r\n            tab->nextTab = tab->IndexFromPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));\r\n            // send request to close the tab\r\n            WindowInfo *win = FindWindowInfoByHwnd(hwnd);\r\n            int next = tab->nextTab;\r\n            uitask::Post([=] { TabNotification(win, T_CLOSING, next, -1); });\r\n        }\r\n        return 0;\r\n\r\n    case WM_MBUTTONUP:\r\n        if (tab->xClicked != -1) {\r\n            // send notification that the tab is closed\r\n            WindowInfo *win = FindWindowInfoByHwnd(hwnd);\r\n            int clicked = tab->xClicked;\r\n            uitask::Post([=] { TabNotification(win, T_CLOSE, clicked, -1); });\r\n            tab->Invalidate(clicked);\r\n            tab->xClicked = -1;\r\n        }\r\n        return 0;\r\n\r\n    case WM_ERASEBKGND:\r\n        return TRUE;\r\n\r\n    case WM_PAINT:\r\n        {\r\n            RECT rc;\r\n            GetUpdateRect(hwnd, &rc, FALSE);\r\n            // TODO: when is wParam != nullptr?\r\n            hdc = wParam ? (HDC)wParam : BeginPaint(hwnd, &ps);\r\n\r\n            DoubleBuffer buffer(hwnd, RectI::FromRECT(rc));\r\n            tab->EvaluateColors(false);\r\n            tab->Paint(buffer.GetDC(), rc);\r\n            buffer.Flush(hdc);\r\n\r\n            ValidateRect(hwnd, nullptr);\r\n            if (!wParam)\r\n                EndPaint(hwnd, &ps);\r\n            return 0;\r\n        }\r\n\r\n    case WM_SIZE:\r\n        {\r\n            WindowInfo *win = FindWindowInfoByHwnd(hwnd);\r\n            if (win)\r\n                UpdateTabWidth(win);\r\n        }\r\n        break;\r\n    }\r\n\r\n    return CallWindowProc(DefWndProcTabBar, hwnd, msg, wParam, lParam);\r\n}\r\n\r\nvoid CreateTabbar(WindowInfo *win)\r\n{\r\n    HWND hwndTabBar = CreateWindow(WC_TABCONTROL, L\"\",\r\n        WS_CHILD | WS_CLIPSIBLINGS /*| WS_VISIBLE*/ |\r\n        TCS_FOCUSNEVER | TCS_FIXEDWIDTH | TCS_FORCELABELLEFT,\r\n        0, 0, 0, 0,\r\n        win->hwndFrame, (HMENU)IDC_TABBAR, GetModuleHandle(nullptr), nullptr);\r\n\r\n    if (!DefWndProcTabBar)\r\n        DefWndProcTabBar = (WNDPROC)GetWindowLongPtr(hwndTabBar, GWLP_WNDPROC);\r\n    SetWindowLongPtr(hwndTabBar, GWLP_WNDPROC, (LONG_PTR)WndProcTabBar);\r\n\r\n    SizeI tabSize = GetTabSize(win->hwndFrame);\r\n    TabPainter *tp = new TabPainter(hwndTabBar, tabSize);\r\n    SetWindowLongPtr(hwndTabBar, GWLP_USERDATA, (LONG_PTR)tp);\r\n\r\n    SetWindowFont(hwndTabBar, GetDefaultGuiFont(), FALSE);\r\n    TabCtrl_SetItemSize(hwndTabBar, tabSize.dx, tabSize.dy);\r\n\r\n    win->hwndTabBar = hwndTabBar;\r\n\r\n    win->tabSelectionHistory = new Vec<TabInfo *>();\r\n}\r\n\r\n// verifies that TabInfo state is consistent with WindowInfo state\r\nstatic NO_INLINE void VerifyTabInfo(WindowInfo *win, TabInfo *tdata)\r\n{\r\n    CrashIf(tdata->ctrl != win->ctrl);\r\n    ScopedMem<WCHAR> winTitle(win::GetText(win->hwndFrame));\r\n    CrashIf(!str::Eq(winTitle.Get(), tdata->frameTitle));\r\n    bool expectedTocVisibility = tdata->showToc; // if not in presentation mode\r\n    if (PM_DISABLED != win->presentation) {\r\n        expectedTocVisibility = false; // PM_BLACK_SCREEN, PM_WHITE_SCREEN\r\n        if (PM_ENABLED == win->presentation) {\r\n            expectedTocVisibility = tdata->showTocPresentation;\r\n        }\r\n    }\r\n    CrashIf(win->tocVisible != expectedTocVisibility);\r\n    CrashIf(tdata->canvasRc != win->canvasRc);\r\n}\r\n\r\n// Must be called when the active tab is losing selection.\r\n// This happens when a new document is loaded or when another tab is selected.\r\nvoid SaveCurrentTabInfo(WindowInfo *win)\r\n{\r\n    if (!win)\r\n        return;\r\n\r\n    int current = TabCtrl_GetCurSel(win->hwndTabBar);\r\n    if (-1 == current)\r\n        return;\r\n    CrashIf(win->currentTab != win->tabs.At(current));\r\n\r\n    TabInfo *tdata = win->currentTab;\r\n    CrashIf(!tdata);\r\n    if (win->tocLoaded) {\r\n        tdata->tocState.Reset();\r\n        HTREEITEM hRoot = TreeView_GetRoot(win->hwndTocTree);\r\n        if (hRoot)\r\n            UpdateTocExpansionState(tdata, win->hwndTocTree, hRoot);\r\n    }\r\n    VerifyTabInfo(win, tdata);\r\n\r\n    // update the selection history\r\n    win->tabSelectionHistory->Remove(tdata);\r\n    win->tabSelectionHistory->Push(tdata);\r\n}\r\n\r\nvoid UpdateCurrentTabBgColor(WindowInfo *win)\r\n{\r\n    TabPainter *tab = (TabPainter *)GetWindowLongPtr(win->hwndTabBar, GWLP_USERDATA);\r\n    if (win->AsEbook()) {\r\n        COLORREF txtCol;\r\n        GetEbookUiColors(txtCol, tab->currBgCol);\r\n    } else {\r\n        // TODO: match either the toolbar (if shown) or background\r\n        tab->currBgCol = DEFAULT_CURRENT_BG_COL;\r\n    }\r\n    tab->EvaluateColors(true);\r\n    RepaintNow(win->hwndTabBar);\r\n}\r\n\r\nstatic void SetTabTitle(WindowInfo *win, TabInfo *tab)\r\n{\r\n    TCITEM tcs;\r\n    tcs.mask = TCIF_TEXT;\r\n    tcs.pszText = (WCHAR *)tab->GetTabTitle();\r\n    TabCtrl_SetItem(win->hwndTabBar, win->tabs.Find(tab), &tcs);\r\n}\r\n\r\n// On load of a new document we insert a new tab item in the tab bar.\r\nTabInfo *CreateNewTab(WindowInfo *win, const WCHAR *filePath)\r\n{\r\n    CrashIf(!win);\r\n    if (!win)\r\n        return nullptr;\r\n\r\n    TabInfo *tab = new TabInfo(filePath);\r\n    win->tabs.Append(tab);\r\n    tab->canvasRc = win->canvasRc;\r\n\r\n    TCITEM tcs;\r\n    tcs.mask = TCIF_TEXT;\r\n    tcs.pszText = (WCHAR *)tab->GetTabTitle();\r\n\r\n    int index = (int)win->tabs.Count() - 1;\r\n    if (-1 != TabCtrl_InsertItem(win->hwndTabBar, index, &tcs)) {\r\n        TabCtrl_SetCurSel(win->hwndTabBar, index);\r\n        UpdateTabWidth(win);\r\n    }\r\n    else {\r\n        // TODO: what now?\r\n        CrashIf(true);\r\n    }\r\n\r\n    return tab;\r\n}\r\n\r\n// Refresh the tab's title\r\nvoid TabsOnChangedDoc(WindowInfo *win)\r\n{\r\n    TabInfo *tab = win->currentTab;\r\n    CrashIf(!tab != !win->tabs.Count());\r\n    if (!tab)\r\n        return;\r\n\r\n    CrashIf(win->tabs.Find(tab) != TabCtrl_GetCurSel(win->hwndTabBar));\r\n    VerifyTabInfo(win, tab);\r\n    SetTabTitle(win, tab);\r\n}\r\n\r\nstatic void RemoveTab(WindowInfo *win, int idx)\r\n{\r\n    TabInfo *tab = win->tabs.At(idx);\r\n    UpdateTabFileDisplayStateForWin(win, tab);\r\n    win->tabSelectionHistory->Remove(tab);\r\n    win->tabs.Remove(tab);\r\n    if (tab == win->currentTab) {\r\n        win->ctrl = nullptr;\r\n        win->currentTab = nullptr;\r\n    }\r\n    delete tab;\r\n    TabCtrl_DeleteItem(win->hwndTabBar, idx);\r\n    UpdateTabWidth(win);\r\n}\r\n\r\n// Called when we're closing a document\r\nvoid TabsOnCloseDoc(WindowInfo *win)\r\n{\r\n    if (win->tabs.Count() == 0)\r\n        return;\r\n\r\n    /* if (win->AsFixed() && win->AsFixed()->userAnnots && win->AsFixed()->userAnnotsModified) {\r\n        // TODO: warn about unsaved changes\r\n    } */\r\n\r\n    int current = TabCtrl_GetCurSel(win->hwndTabBar);\r\n    RemoveTab(win, current);\r\n\r\n    if (win->tabs.Count() > 0) {\r\n        TabInfo *tab = win->tabSelectionHistory->Pop();\r\n        TabCtrl_SetCurSel(win->hwndTabBar, win->tabs.Find(tab));\r\n        LoadModelIntoTab(win, tab);\r\n    }\r\n}\r\n\r\n// Called when we're closing an entire window (quitting)\r\nvoid TabsOnCloseWindow(WindowInfo *win)\r\n{\r\n    TabCtrl_DeleteAllItems(win->hwndTabBar);\r\n    win->tabSelectionHistory->Reset();\r\n    win->currentTab = nullptr;\r\n    win->ctrl = nullptr;\r\n    DeleteVecMembers(win->tabs);\r\n}\r\n\r\n// On tab selection, we save the data for the tab which is losing selection and\r\n// load the data of the selected tab into the WindowInfo.\r\nLRESULT TabsOnNotify(WindowInfo *win, LPARAM lparam, int tab1, int tab2)\r\n{\r\n    LPNMHDR data = (LPNMHDR)lparam;\r\n    int current;\r\n\r\n    switch(data->code) {\r\n    case TCN_SELCHANGING:\r\n        // TODO: Should we allow the switch of the tab if we are in process of printing?\r\n        SaveCurrentTabInfo(win);\r\n        return FALSE;\r\n\r\n    case TCN_SELCHANGE:\r\n        current = TabCtrl_GetCurSel(win->hwndTabBar);\r\n        LoadModelIntoTab(win, win->tabs.At(current));\r\n        break;\r\n\r\n    case T_CLOSING:\r\n        // allow the closure\r\n        return FALSE;\r\n\r\n    case T_CLOSE:\r\n        current = TabCtrl_GetCurSel(win->hwndTabBar);\r\n        if (tab1 == current)\r\n            CloseTab(win);\r\n        else\r\n            RemoveTab(win, tab1);\r\n        break;\r\n\r\n    case T_DRAG:\r\n        SwapTabs(win, tab1, tab2);\r\n        break;\r\n    }\r\n    return TRUE;\r\n}\r\n\r\nstatic void ShowTabBar(WindowInfo *win, bool show)\r\n{\r\n    if (show == win->tabsVisible)\r\n        return;\r\n    win->tabsVisible = show;\r\n    win::SetVisibility(win->hwndTabBar, show);\r\n    RelayoutWindow(win);\r\n}\r\n\r\nvoid UpdateTabWidth(WindowInfo *win)\r\n{\r\n    int count = (int)win->tabs.Count();\r\n    bool showSingleTab = gGlobalPrefs->useTabs || win->tabsInTitlebar;\r\n    if (count > (showSingleTab ? 0 : 1)) {\r\n        ShowTabBar(win, true);\r\n        ClientRect rect(win->hwndTabBar);\r\n        SizeI tabSize = GetTabSize(win->hwndFrame);\r\n        if (tabSize.dx > (rect.dx - 3) / count)\r\n            tabSize.dx = (rect.dx - 3) / count;\r\n        TabCtrl_SetItemSize(win->hwndTabBar, tabSize.dx, tabSize.dy);\r\n    }\r\n    else {\r\n        ShowTabBar(win, false);\r\n    }\r\n}\r\n\r\nvoid SetTabsInTitlebar(WindowInfo *win, bool set)\r\n{\r\n    if (set == win->tabsInTitlebar)\r\n        return;\r\n    win->tabsInTitlebar = set;\r\n    TabPainter *tab = (TabPainter *)GetWindowLongPtr(win->hwndTabBar, GWLP_USERDATA);\r\n    tab->inTitlebar = set;\r\n    SetParent(win->hwndTabBar, set ? win->hwndCaption : win->hwndFrame);\r\n    ShowWindow(win->hwndCaption, set ? SW_SHOW : SW_HIDE);\r\n    if (set != win->isMenuHidden)\r\n        ShowHideMenuBar(win);\r\n    if (set) {\r\n        win->caption->UpdateTheme();\r\n        win->caption->UpdateColors(win->hwndFrame == GetForegroundWindow());\r\n        win->caption->UpdateBackgroundAlpha();\r\n        RelayoutCaption(win);\r\n    }\r\n    else if (dwm::IsCompositionEnabled()) {\r\n        // remove the extended frame\r\n        MARGINS margins = { 0 };\r\n        dwm::ExtendFrameIntoClientArea(win->hwndFrame, &margins);\r\n        win->extendedFrameHeight = 0;\r\n    }\r\n    SetWindowPos(win->hwndFrame, nullptr, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE);\r\n}\r\n\r\n// Selects the given tab (0-based index).\r\nvoid TabsSelect(WindowInfo *win, int tabIndex)\r\n{\r\n    int count = (int)win->tabs.Count();\r\n    if (count < 2 || tabIndex < 0 || tabIndex >= count)\r\n        return;\r\n    NMHDR ntd = { nullptr, 0, TCN_SELCHANGING };\r\n    if (TabsOnNotify(win, (LPARAM)&ntd))\r\n        return;\r\n    win->currentTab = win->tabs.At(tabIndex);\r\n    int prevIndex = TabCtrl_SetCurSel(win->hwndTabBar, tabIndex);\r\n    if (prevIndex != -1) {\r\n        ntd.code = TCN_SELCHANGE;\r\n        TabsOnNotify(win, (LPARAM)&ntd);\r\n    }\r\n}\r\n\r\n// Selects the next (or previous) tab.\r\nvoid TabsOnCtrlTab(WindowInfo *win, bool reverse)\r\n{\r\n    int count = (int)win->tabs.Count();\r\n    if (count < 2)\r\n        return;\r\n\r\n    int next = (TabCtrl_GetCurSel(win->hwndTabBar) + (reverse ? -1 : 1) + count) % count;\r\n    TabsSelect(win, next);\r\n}\r\n\r\nstatic void SwapTabs(WindowInfo *win, int tab1, int tab2)\r\n{\r\n    if (tab1 == tab2 || tab1 < 0 || tab2 < 0)\r\n        return;\r\n\r\n    std::swap(win->tabs.At(tab1), win->tabs.At(tab2));\r\n    SetTabTitle(win, win->tabs.At(tab1));\r\n    SetTabTitle(win, win->tabs.At(tab2));\r\n\r\n    int current = TabCtrl_GetCurSel(win->hwndTabBar);\r\n    if (tab1 == current)\r\n        TabCtrl_SetCurSel(win->hwndTabBar, tab2);\r\n    else if (tab2 == current)\r\n        TabCtrl_SetCurSel(win->hwndTabBar, tab1);\r\n}\r\n\r\n// Adjusts lightness by 1/255 units.\r\nCOLORREF AdjustLightness2(COLORREF c, float units)\r\n{\r\n    float lightness = GetLightness(c);\r\n    units = limitValue(units, -lightness, 255.0f - lightness);\r\n    if (0.0f == lightness)\r\n        return RGB(BYTE(units + 0.5f), BYTE(units + 0.5f), BYTE(units + 0.5f));\r\n    return AdjustLightness(c, 1.0f + units / lightness);\r\n}\r\n"
  },
  {
    "path": "src/Tabs.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nint GetTabbarHeight(HWND, float factor=1.f);\r\n\r\nvoid SaveCurrentTabInfo(WindowInfo *win);\r\nvoid LoadModelIntoTab(WindowInfo *win, TabInfo *tdata);\r\n\r\nvoid CreateTabbar(WindowInfo *win);\r\nTabInfo *CreateNewTab(WindowInfo *win, const WCHAR *filePath);\r\nvoid TabsOnCloseDoc(WindowInfo *win);\r\nvoid TabsOnCloseWindow(WindowInfo *win);\r\nvoid TabsOnChangedDoc(WindowInfo *win);\r\nLRESULT TabsOnNotify(WindowInfo *win, LPARAM lparam, int tab1=-1, int tab2=-1);\r\nvoid TabsSelect(WindowInfo *win, int tabIndex);\r\nvoid TabsOnCtrlTab(WindowInfo *win, bool reverse);\r\n// also shows/hides the tabbar when necessary\r\nvoid UpdateTabWidth(WindowInfo *win);\r\nvoid SetTabsInTitlebar(WindowInfo *win, bool set);\r\nvoid UpdateCurrentTabBgColor(WindowInfo *win);\r\n\r\nCOLORREF AdjustLightness2(COLORREF c, float units);\r\n"
  },
  {
    "path": "src/Tester.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n/* A driver for various tests. The idea is that instead of having a separate\r\n   executable and related makefile additions for each test, we have one test\r\n   driver which dispatches desired test based on cmd-line arguments. */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"CmdLineParser.h\"\r\n#include \"CryptoUtil.h\"\r\n#include \"DirIter.h\"\r\n#include \"FileUtil.h\"\r\n#include \"GdiPlusUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"HtmlPrettyPrint.h\"\r\n#include \"Mui.h\"\r\n#include \"Timer.h\"\r\n#include \"WinUtil.h\"\r\n#include \"ZipUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EbookBase.h\"\r\n#include \"MobiDoc.h\"\r\n#include \"HtmlFormatter.h\"\r\n#include \"EbookFormatter.h\"\r\n\r\n// if true, we'll save html content of a mobi ebook as well\r\n// as pretty-printed html to MOBI_SAVE_DIR. The name will be\r\n// ${file}.html and ${file}_pp.html\r\nstatic bool gSaveHtml = false;\r\n// if true, we'll also save images in mobi files. The name\r\n// will be ${file}_img_${imgNo}.[jpg|png]\r\n// gMobiSaveHtml must be true as well\r\nstatic bool gSaveImages = false;\r\n// if true, we'll do a layout of mobi files\r\nstatic bool gLayout = false;\r\n// directory to which we'll save mobi html and images\r\n#define MOBI_SAVE_DIR L\"..\\\\ebooks-converted\"\r\n\r\nstatic int Usage()\r\n{\r\n    printf(\"Tester.exe\\n\");\r\n    printf(\"  -mobi dirOrFile : run mobi tests in a given directory or for a given file\\n\");\r\n    printf(\"  -layout - will also layout mobi files\\n\");\r\n    printf(\"  -save-html] - will save html content of mobi file\\n\");\r\n    printf(\"  -save-images - will save images extracted from mobi files\\n\");\r\n    printf(\"  -zip-create - creates a sample zip file that needs to be manually checked that it worked\\n\");\r\n    printf(\"  -bench-md5 - compare Window's md5 vs. our code\\n\");\r\n    system(\"pause\");\r\n    return 1;\r\n}\r\n\r\n/* This benchmarks md5 checksum using fitz code (CalcMD5Digest()) and\r\nWindows' CryptoAPI (CalcMD5DigestWin(). The results are usually in CryptoApi\r\nfavor (the first run is on cold cache, the second on warm cache):\r\n10MB\r\nCalcMD5Digest   : 76.913000 ms\r\nCalcMD5DigestWin: 92.389000 ms\r\ndiff: -15.476000\r\n5MB\r\nCalcMD5Digest   : 17.556000 ms\r\nCalcMD5DigestWin: 13.125000 ms\r\ndiff: 4.431000\r\n1MB\r\nCalcMD5Digest   : 3.329000 ms\r\nCalcMD5DigestWin: 2.834000 ms\r\ndiff: 0.495000\r\n10MB\r\nCalcMD5Digest   : 33.682000 ms\r\nCalcMD5DigestWin: 25.918000 ms\r\ndiff: 7.764000\r\n5MB\r\nCalcMD5Digest   : 16.174000 ms\r\nCalcMD5DigestWin: 12.853000 ms\r\ndiff: 3.321000\r\n1MB\r\nCalcMD5Digest   : 3.534000 ms\r\nCalcMD5DigestWin: 2.605000 ms\r\ndiff: 0.929000\r\n*/\r\n\r\nstatic void BenchMD5Size(void *data, size_t dataSize, char *desc)\r\n{\r\n    unsigned char d1[16], d2[16];\r\n    Timer t1;\r\n    CalcMD5Digest((unsigned char*)data, dataSize, d1);\r\n    double dur1 = t1.GetTimeInMs();\r\n\r\n    Timer t2;\r\n    CalcMD5DigestWin(data, dataSize, d2);\r\n    bool same = memeq(d1, d2, 16);\r\n    CrashAlwaysIf(!same);\r\n    double dur2 = t2.GetTimeInMs();\r\n    double diff = dur1 - dur2;\r\n    printf(\"%s\\nCalcMD5Digest   : %f ms\\nCalcMD5DigestWin: %f ms\\ndiff: %f\\n\", desc, dur1, dur2, diff);\r\n}\r\n\r\nstatic void BenchMD5()\r\n{\r\n    size_t dataSize = 10*1024*1024;\r\n    void *data = malloc(dataSize);\r\n    BenchMD5Size(data, dataSize, \"10MB\");\r\n    BenchMD5Size(data, dataSize / 2, \"5MB\");\r\n    BenchMD5Size(data, dataSize / 10, \"1MB\");\r\n    // repeat to see if timings change drastically\r\n    BenchMD5Size(data, dataSize, \"10MB\");\r\n    BenchMD5Size(data, dataSize / 2, \"5MB\");\r\n    BenchMD5Size(data, dataSize / 10, \"1MB\");\r\n    free(data);\r\n}\r\n\r\nstatic void MobiSaveHtml(const WCHAR *filePathBase, MobiDoc *mb)\r\n{\r\n    CrashAlwaysIf(!gSaveHtml);\r\n\r\n    ScopedMem<WCHAR> outFile(str::Join(filePathBase, L\"_pp.html\"));\r\n\r\n    size_t htmlLen;\r\n    const char *html = mb->GetHtmlData(htmlLen);\r\n    size_t ppHtmlLen;\r\n    char *ppHtml = PrettyPrintHtml(html, htmlLen, ppHtmlLen);\r\n    file::WriteAll(outFile.Get(), ppHtml, ppHtmlLen);\r\n\r\n    outFile.Set(str::Join(filePathBase, L\".html\"));\r\n    file::WriteAll(outFile.Get(), html, htmlLen);\r\n}\r\n\r\nstatic void MobiSaveImage(const WCHAR *filePathBase, size_t imgNo, ImageData *img)\r\n{\r\n    // it's valid to not have image data at a given index\r\n    if (!img || !img->data)\r\n        return;\r\n    const WCHAR *ext = GfxFileExtFromData(img->data, img->len);\r\n    CrashAlwaysIf(!ext);\r\n    ScopedMem<WCHAR> fileName(str::Format(L\"%s_img_%d%s\", filePathBase, imgNo, ext));\r\n    file::WriteAll(fileName.Get(), img->data, img->len);\r\n}\r\n\r\nstatic void MobiSaveImages(const WCHAR *filePathBase, MobiDoc *mb)\r\n{\r\n    for (size_t i = 0; i < mb->imagesCount; i++) {\r\n        MobiSaveImage(filePathBase, i, mb->GetImage(i+1));\r\n    }\r\n}\r\n\r\n// This loads and layouts a given mobi file. Used for profiling layout process.\r\nstatic void MobiLayout(MobiDoc *mobiDoc)\r\n{\r\n    PoolAllocator textAllocator;\r\n\r\n    HtmlFormatterArgs args;\r\n    args.pageDx = 640;\r\n    args.pageDy = 480;\r\n    args.SetFontName(L\"Tahoma\");\r\n    args.fontSize = 12;\r\n    args.htmlStr = mobiDoc->GetHtmlData(args.htmlStrLen);\r\n    args.textAllocator = &textAllocator;\r\n\r\n    MobiFormatter mf(&args, mobiDoc);\r\n    Vec<HtmlPage*> *pages = mf.FormatAllPages();\r\n    DeleteVecMembers<HtmlPage*>(*pages);\r\n    delete pages;\r\n}\r\n\r\nstatic void MobiTestFile(const WCHAR *filePath)\r\n{\r\n    wprintf(L\"Testing file '%s'\\n\", filePath);\r\n    MobiDoc *mobiDoc = MobiDoc::CreateFromFile(filePath);\r\n    if (!mobiDoc) {\r\n        printf(\" error: failed to parse the file\\n\");\r\n        return;\r\n    }\r\n\r\n    if (gLayout) {\r\n        Timer t;\r\n        MobiLayout(mobiDoc);\r\n        wprintf(L\"Spent %.2f ms laying out %s\\n\", t.GetTimeInMs(), filePath);\r\n    }\r\n\r\n    if (gSaveHtml || gSaveImages) {\r\n        // Given the name of the name of source mobi file \"${srcdir}/${file}.mobi\"\r\n        // construct a base name for extracted html/image files in the form\r\n        // \"${MOBI_SAVE_DIR}/${file}\" i.e. change dir to MOBI_SAVE_DIR and\r\n        // remove the file extension\r\n        WCHAR *dir = MOBI_SAVE_DIR;\r\n        dir::CreateAll(dir);\r\n        ScopedMem<WCHAR> fileName(str::Dup(path::GetBaseName(filePath)));\r\n        ScopedMem<WCHAR> filePathBase(path::Join(dir, fileName));\r\n        WCHAR *ext = (WCHAR*)str::FindCharLast(filePathBase.Get(), '.');\r\n        *ext = 0;\r\n\r\n        if (gSaveHtml)\r\n            MobiSaveHtml(filePathBase, mobiDoc);\r\n        if (gSaveImages)\r\n            MobiSaveImages(filePathBase, mobiDoc);\r\n    }\r\n\r\n    delete mobiDoc;\r\n}\r\n\r\nstatic bool IsMobiFile(const WCHAR *f)\r\n{\r\n    return str::EndsWithI(f, L\".mobi\") ||\r\n           str::EndsWithI(f, L\".azw\") ||\r\n           str::EndsWithI(f, L\".azw1\") ||\r\n           str::EndsWithI(f, L\".prc\");\r\n}\r\n\r\nstatic void MobiTestDir(WCHAR *dir)\r\n{\r\n    wprintf(L\"Testing mobi files in '%s'\\n\", dir);\r\n    DirIter di(dir, true);\r\n    for (const WCHAR *p = di.First(); p; p = di.Next()) {\r\n        if (IsMobiFile(p))\r\n            MobiTestFile(p);\r\n    }\r\n}\r\n\r\nstatic void MobiTest(WCHAR *dirOrFile)\r\n{\r\n    if (file::Exists(dirOrFile) && IsMobiFile(dirOrFile))\r\n        MobiTestFile(dirOrFile);\r\n    else\r\n        MobiTestDir(dirOrFile);\r\n}\r\n\r\n// we assume this is called from main sumatradirectory, e.g. as:\r\n// ./obj-dbg/tester.exe, so we use the known files\r\nvoid ZipCreateTest()\r\n{\r\n    WCHAR *zipFileName = L\"tester-tmp.zip\";\r\n    file::Delete(zipFileName);\r\n    ZipCreator zc(zipFileName);\r\n    bool ok = zc.AddFile(L\"makefile.deps\");\r\n    if (!ok) {\r\n        printf(\"ZipCreateTest(): failed to add makefile.deps\");\r\n        return;\r\n    }\r\n    ok = zc.AddFile(L\"makefile.msvc\");\r\n    if (!ok) {\r\n        printf(\"ZipCreateTest(): failed to add makefile.msvc\");\r\n        return;\r\n    }\r\n    ok = zc.Finish();\r\n    if (!ok) {\r\n        printf(\"ZipCreateTest(): Finish() failed\");\r\n    }\r\n}\r\n\r\nint TesterMain()\r\n{\r\n    RedirectIOToConsole();\r\n\r\n    WCHAR *cmdLine = GetCommandLine();\r\n\r\n    WStrVec argv;\r\n    ParseCmdLine(cmdLine, argv);\r\n\r\n    InitAllCommonControls();\r\n    ScopedGdiPlus gdi;\r\n    mui::Initialize();\r\n\r\n    WCHAR *dirOrFile = nullptr;\r\n\r\n    bool mobiTest = false;\r\n    size_t i = 2; // skip program name and \"/tester\"\r\n    while (i < argv.Count()) {\r\n        if (str::Eq(argv[i], L\"-mobi\")) {\r\n            ++i;\r\n            if (i == argv.Count())\r\n                return Usage();\r\n            mobiTest = true;\r\n            dirOrFile = argv[i];\r\n            ++i;\r\n        } else if (str::Eq(argv[i], L\"-layout\")) {\r\n            gLayout = true;\r\n            ++i;\r\n        } else if (str::Eq(argv[i], L\"-save-html\")) {\r\n            gSaveHtml = true;\r\n            ++i;\r\n        } else if (str::Eq(argv[i], L\"-save-images\")) {\r\n            gSaveImages = true;\r\n            ++i;\r\n        } else if (str::Eq(argv[i], L\"-zip-create\")) {\r\n            ZipCreateTest();\r\n            ++i;\r\n        } else if (str::Eq(argv[i], L\"-bench-md5\")) {\r\n            BenchMD5();\r\n            ++i;\r\n        } else {\r\n            // unknown argument\r\n            return Usage();\r\n        }\r\n    }\r\n    if (2 == i) {\r\n        // no arguments\r\n        return Usage();\r\n    }\r\n\r\n    if (mobiTest) {\r\n        MobiTest(dirOrFile);\r\n    }\r\n\r\n    mui::Destroy();\r\n    system(\"pause\");\r\n    return 0;\r\n}\r\n"
  },
  {
    "path": "src/Tests.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"WinUtil.h\"\r\n\r\n#include \"SettingsStructs.h\"\r\n#include \"GlobalPrefs.h\"\r\n#include \"ParseCommandLine.h\"\r\n#include \"BaseEngine.h\"\r\n#include \"EngineManager.h\"\r\n\r\nextern \"C\" void fz_redirect_dll_io_to_console();\r\n\r\nvoid TestRenderPage(const CommandLineInfo& i) {\r\n    if (i.showConsole) {\r\n        RedirectIOToConsole();\r\n        fz_redirect_dll_io_to_console();\r\n    }\r\n\r\n    if (i.pageNumber == -1) {\r\n        printf(\"pageNumber is -1\\n\");\r\n        return;\r\n    }\r\n    auto files = i.fileNames;\r\n    if (files.Count() == 0) {\r\n        printf(\"no file provided\\n\");\r\n        return;\r\n    }\r\n    float zoom = ZOOM_ACTUAL_SIZE;\r\n    if (i.startZoom != INVALID_ZOOM) {\r\n        zoom = i.startZoom;\r\n    }\r\n    for (auto fileName : files) {\r\n        ScopedMem<char> fileNameUtf(str::conv::ToUtf8(fileName));\r\n        printf(\"rendering page %d for '%s', zoom: %.2f\\n\", i.pageNumber, fileNameUtf.Get(), zoom);\r\n        auto engine = EngineManager::CreateEngine(fileName);\r\n        if (engine == nullptr) {\r\n            printf(\"failed to create engine\\n\");\r\n            continue;\r\n        }\r\n        auto bmp = engine->RenderBitmap(i.pageNumber, zoom, 0);\r\n        if (bmp == nullptr) {\r\n            printf(\"failed to render page\\n\");\r\n        }\r\n        delete bmp;\r\n        delete engine;\r\n    }\r\n}\r\n\r\nvoid TestExtractPage(const CommandLineInfo& i) {\r\n    if (i.showConsole) {\r\n        RedirectIOToConsole();\r\n        fz_redirect_dll_io_to_console();\r\n    }\r\n\r\n    if (i.pageNumber == -1) {\r\n        printf(\"pageNumber is -1\\n\");\r\n        return;\r\n    }\r\n    auto files = i.fileNames;\r\n    if (files.Count() == 0) {\r\n        printf(\"no file provided\\n\");\r\n        return;\r\n    }\r\n    for (auto fileName : files) {\r\n        ScopedMem<char> fileNameUtf(str::conv::ToUtf8(fileName));\r\n        auto engine = EngineManager::CreateEngine(fileName);\r\n        if (engine == nullptr) {\r\n            printf(\"failed to create engine for file '%s'\\n\", fileNameUtf.Get());\r\n            continue;\r\n        }\r\n        RectI* coordsOut; // not using the result, only to trigger the code path\r\n        WCHAR* uni = engine->ExtractPageText(i.pageNumber, L\"_\", &coordsOut);\r\n        char* utf = str::conv::ToUtf8(uni);\r\n        printf(\"text on page %d: '\", i.pageNumber);\r\n        // print characters as hex because I don't know what kind of locale-specific mangling\r\n        // printf() might do\r\n        int idx = 0;\r\n        while (utf[idx] != 0) {\r\n            char c = utf[idx++];\r\n            printf(\"%02x \", (unsigned char)c);\r\n        }\r\n        printf(\"'\\n\");\r\n        free(uni);\r\n        free(utf);\r\n        free(coordsOut);\r\n        delete engine;\r\n    }\r\n}\r\n"
  },
  {
    "path": "src/Tests.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nvoid TestRenderPage(const CommandLineInfo& i);\r\nvoid TestExtractPage(const CommandLineInfo& i);\r\n"
  },
  {
    "path": "src/TextSearch.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n// layout controllers\r\n#include \"BaseEngine.h\"\r\n#include \"TextSelection.h\"\r\n#include \"TextSearch.h\"\r\n\r\nenum { SEARCH_PAGE, SKIP_PAGE };\r\n\r\n#define SkipWhitespace(c) for (; str::IsWs(*(c)); (c)++)\r\n// ignore spaces between CJK glyphs but not between Latin, Greek, Cyrillic, etc. letters\r\n// cf. http://code.google.com/p/sumatrapdf/issues/detail?id=959\r\n#define isnoncjkwordchar(c) (isWordChar(c) && (unsigned short)(c) < 0x2E80)\r\n\r\nTextSearch::TextSearch(BaseEngine *engine, PageTextCache *textCache) :\r\n    TextSelection(engine, textCache),\r\n    findText(nullptr), anchor(nullptr), pageText(nullptr),\r\n    caseSensitive(false), forward(true),\r\n    matchWordStart(false), matchWordEnd(false),\r\n    findPage(0), findIndex(0), lastText(nullptr)\r\n{\r\n    findCache = AllocArray<BYTE>(this->engine->PageCount());\r\n}\r\n\r\nTextSearch::~TextSearch()\r\n{\r\n    Clear();\r\n    free(findCache);\r\n}\r\n\r\nvoid TextSearch::Reset()\r\n{\r\n    pageText = nullptr;\r\n    TextSelection::Reset();\r\n}\r\n\r\nvoid TextSearch::SetText(const WCHAR *text)\r\n{\r\n    // search text starting with a single space enables the 'Match word start'\r\n    // and search text ending in a single space enables the 'Match word end' option\r\n    // (that behavior already \"kind of\" exists without special treatment, but\r\n    // usually is not quite what a user expects, so let's try to be cleverer)\r\n    this->matchWordStart = text[0] == ' ' && text[1] != ' ';\r\n    this->matchWordEnd = str::EndsWith(text, L\" \") && !str::EndsWith(text, L\"  \");\r\n\r\n    if (text[0] == ' ')\r\n        text++;\r\n\r\n    // don't reset anything if the search text hasn't changed at all\r\n    if (str::Eq(this->lastText, text))\r\n        return;\r\n\r\n    this->Clear();\r\n    this->lastText = str::Dup(text);\r\n    this->findText = str::Dup(text);\r\n\r\n    // extract anchor string (the first word or the first symbol) for faster searching\r\n    if (isnoncjkwordchar(*text)) {\r\n        const WCHAR *end;\r\n        for (end = text; isnoncjkwordchar(*end); end++)\r\n            ;\r\n        anchor = str::DupN(text, end - text);\r\n    }\r\n    // Adobe Reader also matches certain hard-to-type Unicode\r\n    // characters when searching for easy-to-type homoglyphs\r\n    // cf. http://forums.fofou.org/sumatrapdf/topic?id=2432337\r\n    else if (*text == '-' || *text == '\\'' || *text == '\"')\r\n        anchor = nullptr;\r\n    else\r\n        anchor = str::DupN(text, 1);\r\n\r\n    if (str::Len(this->findText) >= INT_MAX)\r\n        this->findText[(unsigned)INT_MAX - 1] = '\\0';\r\n    if (str::EndsWith(this->findText, L\" \"))\r\n        this->findText[str::Len(this->findText) - 1] = '\\0';\r\n\r\n    memset(this->findCache, SEARCH_PAGE, this->engine->PageCount());\r\n}\r\n\r\nvoid TextSearch::SetSensitive(bool sensitive)\r\n{\r\n    if (caseSensitive == sensitive)\r\n        return;\r\n    this->caseSensitive = sensitive;\r\n\r\n    memset(this->findCache, SEARCH_PAGE, this->engine->PageCount());\r\n}\r\n\r\nvoid TextSearch::SetDirection(TextSearchDirection direction)\r\n{\r\n    bool forward = FIND_FORWARD == direction;\r\n    if (forward == this->forward)\r\n        return;\r\n    this->forward = forward;\r\n    if (findText)\r\n        findIndex += (int)str::Len(findText) * (forward ? 1 : -1);\r\n}\r\n\r\nvoid TextSearch::SetLastResult(TextSelection *sel)\r\n{\r\n    CopySelection(sel);\r\n\r\n    ScopedMem<WCHAR> selection(ExtractText(L\" \"));\r\n    str::NormalizeWS(selection);\r\n    SetText(selection);\r\n\r\n    findPage = std::min(startPage, endPage);\r\n    findIndex = (findPage == startPage ? startGlyph : endGlyph) + (int)str::Len(findText);\r\n    pageText = textCache->GetData(findPage);\r\n    forward = true;\r\n}\r\n\r\n// try to match \"findText\" from \"start\" with whitespace tolerance\r\n// (ignore all whitespace except after alphanumeric characters)\r\nint TextSearch::MatchLen(const WCHAR *start) const\r\n{\r\n    const WCHAR *match = findText, *end = start;\r\n\r\n    if (matchWordStart && start > pageText && isWordChar(start[-1]) && isWordChar(start[0]))\r\n        return -1;\r\n\r\n    if (!match)\r\n        return -1;\r\n\r\n    while (*match) {\r\n        if (!*end)\r\n            return -1;\r\n        if (caseSensitive ? *match == *end : CharLower((LPWSTR)LOWORD(*match)) == CharLower((LPWSTR)LOWORD(*end)))\r\n            /* characters are identical */;\r\n        else if (str::IsWs(*match) && str::IsWs(*end))\r\n            /* treat all whitespace as identical */;\r\n        // TODO: Adobe Reader seems to have a more extensive list of\r\n        //       normalizations - is there an easier way?\r\n        else if (*match == '-' && (0x2010 <= *end && *end <= 0x2014))\r\n            /* make HYPHEN-MINUS also match HYPHEN, NON-BREAKING HYPHEN,\r\n               FIGURE DASH, EN DASH and EM DASH (but not the other way around) */;\r\n        else if (*match == '\\'' && (0x2018 <= *end && *end <= 0x201b))\r\n            /* make APOSTROPHE also match LEFT/RIGHT SINGLE QUOTATION MARK */;\r\n        else if (*match == '\"' && (0x201c <= *end && *end <= 0x201f))\r\n            /* make QUOTATION MARK also match LEFT/RIGHT DOUBLE QUOTATION MARK */;\r\n        else\r\n            return -1;\r\n        match++;\r\n        end++;\r\n        // treat \"??\" and \"? ?\" differently, since '?' could have been a word\r\n        // character that's just missing an encoding (and '?' is the replacement\r\n        // character); cf. http://code.google.com/p/sumatrapdf/issues/detail?id=1574\r\n        if (*match && !isnoncjkwordchar(*(match - 1)) && (*(match - 1) != '?' || *match != '?') ||\r\n            str::IsWs(*(match - 1)) && str::IsWs(*(end - 1))) {\r\n            SkipWhitespace(match);\r\n            SkipWhitespace(end);\r\n        }\r\n    }\r\n\r\n    if (matchWordEnd && end > pageText && isWordChar(end[-1]) && isWordChar(end[0]))\r\n        return -1;\r\n\r\n    return (int)(end - start);\r\n}\r\n\r\nstatic const WCHAR *GetNextIndex(const WCHAR *base, int offset, bool forward)\r\n{\r\n    const WCHAR *c = base + offset + (forward ? 0 : -1);\r\n    if (c < base || !*c)\r\n        return nullptr;\r\n    return c;\r\n}\r\n\r\nbool TextSearch::FindTextInPage(int pageNo)\r\n{\r\n    if (str::IsEmpty(findText))\r\n        return false;\r\n    if (!pageNo)\r\n        pageNo = findPage;\r\n    findPage = pageNo;\r\n\r\n    const WCHAR *found;\r\n    int length;\r\n    do {\r\n        if (!anchor)\r\n            found = GetNextIndex(pageText, findIndex, forward);\r\n        else if (forward)\r\n            found = (caseSensitive ? StrStr : StrStrI)(pageText + findIndex, anchor);\r\n        else\r\n            found = StrRStrI(pageText, pageText + findIndex, anchor);\r\n        if (!found)\r\n            return false;\r\n        findIndex = (int)(found - pageText) + (forward ? 1 : 0);\r\n        length = MatchLen(found);\r\n    } while (length <= 0);\r\n\r\n    int offset = (int)(found - pageText);\r\n    StartAt(pageNo, offset);\r\n    SelectUpTo(pageNo, offset + length);\r\n    findIndex = offset + (forward ? length : 0);\r\n\r\n    // try again if the found text is completely outside the page's mediabox\r\n    if (result.len == 0)\r\n        return FindTextInPage(pageNo);\r\n\r\n    return true;\r\n}\r\n\r\nbool TextSearch::FindStartingAtPage(int pageNo, ProgressUpdateUI *tracker)\r\n{\r\n    if (str::IsEmpty(findText))\r\n        return false;\r\n\r\n    int total = engine->PageCount();\r\n    while (1 <= pageNo && pageNo <= total && (!tracker || !tracker->WasCanceled())) {\r\n        if (tracker)\r\n            tracker->UpdateProgress(pageNo, total);\r\n\r\n        if (SKIP_PAGE == findCache[pageNo - 1]) {\r\n            pageNo += forward ? 1 : -1;\r\n            continue;\r\n        }\r\n\r\n        Reset();\r\n\r\n        pageText = textCache->GetData(pageNo, &findIndex);\r\n        if (pageText) {\r\n            if (forward)\r\n                findIndex = 0;\r\n            if (FindTextInPage(pageNo))\r\n                return true;\r\n            findCache[pageNo - 1] = SKIP_PAGE;\r\n        }\r\n\r\n        pageNo += forward ? 1 : -1;\r\n    }\r\n\r\n    // allow for the first/last page to be included in the next search\r\n    findPage = forward ? total + 1 : 0;\r\n\r\n    return false;\r\n}\r\n\r\nTextSel *TextSearch::FindFirst(int page, const WCHAR *text, ProgressUpdateUI *tracker)\r\n{\r\n    SetText(text);\r\n\r\n    if (FindStartingAtPage(page, tracker))\r\n        return &result;\r\n    return nullptr;\r\n}\r\n\r\nTextSel *TextSearch::FindNext(ProgressUpdateUI *tracker)\r\n{\r\n    CrashIf(!findText);\r\n    if (!findText)\r\n        return nullptr;\r\n\r\n    if (tracker) {\r\n        if (tracker->WasCanceled())\r\n            return nullptr;\r\n        tracker->UpdateProgress(findPage, engine->PageCount());\r\n    }\r\n\r\n    if (FindTextInPage())\r\n        return &result;\r\n    if (FindStartingAtPage(findPage + (forward ? 1 : -1), tracker))\r\n        return &result;\r\n    return nullptr;\r\n}\r\n"
  },
  {
    "path": "src/TextSearch.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: GPLv3 */\n\nenum TextSearchDirection {\n    FIND_BACKWARD = false,\n    FIND_FORWARD  = true\n};\n\nclass ProgressUpdateUI\n{\npublic:\n    virtual void UpdateProgress(int current, int total) = 0;\n    virtual bool WasCanceled() = 0;\n    virtual ~ProgressUpdateUI() { }\n};\n\nclass TextSearch : public TextSelection\n{\npublic:\n    TextSearch(BaseEngine *engine, PageTextCache *textCache);\n    ~TextSearch();\n\n    void SetSensitive(bool sensitive);\n    void SetDirection(TextSearchDirection direction);\n    void SetLastResult(TextSelection *sel);\n    TextSel *FindFirst(int page, const WCHAR *text, ProgressUpdateUI *tracker=nullptr);\n    TextSel *FindNext(ProgressUpdateUI *tracker=nullptr);\n\n    // note: the result might not be a valid page number!\n    int GetCurrentPageNo() const { return findPage; }\n\nprotected:\n    WCHAR *findText;\n    WCHAR *anchor;\n    int findPage;\n    bool forward;\n    bool caseSensitive;\n    // these two options are implicitly set when the search text begins\n    // resp. ends in a single space (many users already search that way),\n    // combining them yields a 'Whole words' search\n    bool matchWordStart;\n    bool matchWordEnd;\n\n    void SetText(const WCHAR *text);\n    bool FindTextInPage(int pageNo = 0);\n    bool FindStartingAtPage(int pageNo, ProgressUpdateUI *tracker);\n    int MatchLen(const WCHAR *start) const;\n\n    void Clear()\n    {\n        str::ReplacePtr(&findText, nullptr);\n        str::ReplacePtr(&anchor, nullptr);\n        str::ReplacePtr(&lastText, nullptr);\n        Reset();\n    }\n    void Reset();\n\nprivate:\n    const WCHAR *pageText;\n    int findIndex;\n\n    WCHAR *lastText;\n    BYTE *findCache;\n};\n"
  },
  {
    "path": "src/TextSelection.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n// layout controllers\r\n#include \"BaseEngine.h\"\r\n#include \"TextSelection.h\"\r\n\r\nPageTextCache::PageTextCache(BaseEngine *engine) : engine(engine)\r\n{\r\n    int count = engine->PageCount();\r\n    coords = AllocArray<RectI *>(count);\r\n    text = AllocArray<WCHAR *>(count);\r\n    lens = AllocArray<int>(count);\r\n#ifdef DEBUG\r\n    debug_size = count * (sizeof(RectI *) + sizeof(WCHAR *) + sizeof(int));\r\n#endif\r\n\r\n    InitializeCriticalSection(&access);\r\n}\r\n\r\nPageTextCache::~PageTextCache()\r\n{\r\n    EnterCriticalSection(&access);\r\n\r\n    for (int i = 0; i < engine->PageCount(); i++) {\r\n        free(coords[i]);\r\n        free(text[i]);\r\n    }\r\n\r\n    free(coords);\r\n    free(text);\r\n    free(lens);\r\n\r\n    LeaveCriticalSection(&access);\r\n    DeleteCriticalSection(&access);\r\n}\r\n\r\nbool PageTextCache::HasData(int pageNo)\r\n{\r\n    CrashIf(pageNo < 1 || pageNo > engine->PageCount());\r\n    return text[pageNo - 1] != nullptr;\r\n}\r\n\r\nconst WCHAR *PageTextCache::GetData(int pageNo, int *lenOut, RectI **coordsOut)\r\n{\r\n    ScopedCritSec scope(&access);\r\n\r\n    if (!text[pageNo - 1]) {\r\n        text[pageNo - 1] = engine->ExtractPageText(pageNo, L\"\\n\", &coords[pageNo - 1]);\r\n        if (!text[pageNo - 1]) {\r\n            text[pageNo - 1] = str::Dup(L\"\");\r\n            lens[pageNo - 1] = 0;\r\n        }\r\n        else {\r\n            lens[pageNo - 1] = (int)str::Len(text[pageNo - 1]);\r\n        }\r\n#ifdef DEBUG\r\n        debug_size += (lens[pageNo - 1] + 1) * (sizeof(WCHAR) + sizeof(RectI));\r\n#endif\r\n    }\r\n\r\n    if (lenOut)\r\n        *lenOut = lens[pageNo - 1];\r\n    if (coordsOut)\r\n        *coordsOut = coords[pageNo - 1];\r\n    return text[pageNo - 1];\r\n}\r\n\r\nTextSelection::TextSelection(BaseEngine *engine, PageTextCache *textCache) :\r\n    engine(engine), textCache(textCache), startPage(-1),\r\n    endPage(-1), startGlyph(-1), endGlyph(-1)\r\n{\r\n    result.len = 0;\r\n    result.pages = nullptr;\r\n    result.rects = nullptr;\r\n}\r\n\r\nTextSelection::~TextSelection()\r\n{\r\n    Reset();\r\n}\r\n\r\nvoid TextSelection::Reset()\r\n{\r\n    result.len = 0;\r\n    free(result.pages);\r\n    result.pages = nullptr;\r\n    free(result.rects);\r\n    result.rects = nullptr;\r\n}\r\n\r\n// returns the index of the glyph closest to the right of the given coordinates\r\n// (i.e. when over the right half of a glyph, the returned index will be for the\r\n// glyph following it, which will be the first glyph (not) to be selected)\r\nint TextSelection::FindClosestGlyph(int pageNo, double x, double y)\r\n{\r\n    int textLen;\r\n    RectI *coords;\r\n    textCache->GetData(pageNo, &textLen, &coords);\r\n    PointD pt = PointD(x, y);\r\n\r\n    unsigned int maxDist = UINT_MAX;\r\n    PointI pti = pt.ToInt();\r\n    bool overGlyph = false;\r\n    int result = -1;\r\n\r\n    for (int i = 0; i < textLen; i++) {\r\n        if (!coords[i].x && !coords[i].dx)\r\n            continue;\r\n        if (overGlyph && !coords[i].Contains(pti))\r\n            continue;\r\n\r\n        unsigned int dist = distSq((int)x - coords[i].x - coords[i].dx / 2,\r\n                                   (int)y - coords[i].y - coords[i].dy / 2);\r\n        if (dist < maxDist) {\r\n            result = i;\r\n            maxDist = dist;\r\n        }\r\n        // prefer glyphs the cursor is actually over\r\n        if (!overGlyph && coords[i].Contains(pti)) {\r\n            overGlyph = true;\r\n            result = i;\r\n            maxDist = dist;\r\n        }\r\n    }\r\n\r\n    if (-1 == result)\r\n        return 0;\r\n    CrashIf(result < 0 || result >= textLen);\r\n\r\n    // the result indexes the first glyph to be selected in a forward selection\r\n    RectD bbox = engine->Transform(coords[result].Convert<double>(), pageNo, 1.0, 0);\r\n    pt = engine->Transform(pt, pageNo, 1.0, 0);\r\n    if (pt.x > bbox.x + 0.5 * bbox.dx) {\r\n        result++;\r\n        // for some (DjVu) documents, all glyphs of a word share the same bbox\r\n        while (result < textLen && coords[result - 1] == coords[result])\r\n            result++;\r\n    }\r\n    CrashIf(result > 0 && result < textLen && coords[result] == coords[result - 1]);\r\n\r\n    return result;\r\n}\r\n\r\nvoid TextSelection::FillResultRects(int pageNo, int glyph, int length, WStrVec *lines)\r\n{\r\n    int len;\r\n    RectI *coords;\r\n    const WCHAR *text = textCache->GetData(pageNo, &len, &coords);\r\n    CrashIf(len < glyph + length);\r\n    RectI mediabox = engine->PageMediabox(pageNo).Round();\r\n    RectI *c = &coords[glyph], *end = c + length;\r\n    while (c < end) {\r\n        // skip line breaks\r\n        for (; c < end && !c->x && !c->dx; c++);\r\n\r\n        RectI bbox, *c0 = c;\r\n        for (; c < end && (c->x || c->dx); c++) {\r\n            bbox = bbox.Union(*c);\r\n        }\r\n        bbox = bbox.Intersect(mediabox);\r\n        // skip text that's completely outside a page's mediabox\r\n        if (bbox.IsEmpty())\r\n            continue;\r\n\r\n        if (lines) {\r\n            lines->Push(str::DupN(text + (c0 - coords), c - c0));\r\n            continue;\r\n        }\r\n\r\n        // cut the right edge, if it overlaps the next character\r\n        if (c < coords + len && (c->x || c->dx) && bbox.x < c->x && bbox.x + bbox.dx > c->x)\r\n            bbox.dx = c->x - bbox.x;\r\n\r\n        result.len++;\r\n        int *newPages = (int *)realloc(result.pages, sizeof(int) * result.len);\r\n        CrashIf(!newPages); // TODO: use infallible realloc\r\n        result.pages = newPages;\r\n        result.pages[result.len - 1] = pageNo;\r\n        RectI *newRects = (RectI *)realloc(result.rects, sizeof(RectI) * result.len);\r\n        CrashIf(!newRects); // TODO: use infallible realloc\r\n        result.rects = newRects;\r\n        result.rects[result.len - 1] = bbox;\r\n    }\r\n}\r\n\r\nbool TextSelection::IsOverGlyph(int pageNo, double x, double y)\r\n{\r\n    int textLen;\r\n    RectI *coords;\r\n    textCache->GetData(pageNo, &textLen, &coords);\r\n\r\n    int glyphIx = FindClosestGlyph(pageNo, x, y);\r\n    PointI pt = PointD(x, y).ToInt();\r\n    // when over the right half of a glyph, FindClosestGlyph returns the\r\n    // index of the next glyph, in which case glyphIx must be decremented\r\n    if (glyphIx == textLen || !coords[glyphIx].Contains(pt))\r\n        glyphIx--;\r\n    if (-1 == glyphIx)\r\n        return false;\r\n    return coords[glyphIx].Contains(pt);\r\n}\r\n\r\nvoid TextSelection::StartAt(int pageNo, int glyphIx)\r\n{\r\n    startPage = pageNo;\r\n    startGlyph = glyphIx;\r\n    if (glyphIx < 0) {\r\n        int textLen;\r\n        textCache->GetData(pageNo, &textLen);\r\n        startGlyph += textLen + 1;\r\n    }\r\n}\r\n\r\nvoid TextSelection::SelectUpTo(int pageNo, int glyphIx)\r\n{\r\n    if (startPage == -1 || startGlyph == -1)\r\n        return;\r\n\r\n    endPage = pageNo;\r\n    endGlyph = glyphIx;\r\n    if (glyphIx < 0) {\r\n        int textLen;\r\n        textCache->GetData(pageNo, &textLen);\r\n        endGlyph = textLen + glyphIx + 1;\r\n    }\r\n\r\n    result.len = 0;\r\n    int fromPage = std::min(startPage, endPage), toPage = std::max(startPage, endPage);\r\n    int fromGlyph = (fromPage == endPage ? endGlyph : startGlyph);\r\n    int toGlyph = (fromPage == endPage ? startGlyph : endGlyph);\r\n    if (fromPage == toPage && fromGlyph > toGlyph)\r\n        std::swap(fromGlyph, toGlyph);\r\n\r\n    for (int page = fromPage; page <= toPage; page++) {\r\n        int textLen;\r\n        textCache->GetData(page, &textLen);\r\n\r\n        int glyph = page == fromPage ? fromGlyph : 0;\r\n        int length = (page == toPage ? toGlyph : textLen) - glyph;\r\n        if (length > 0)\r\n            FillResultRects(page, glyph, length);\r\n    }\r\n}\r\n\r\nvoid TextSelection::SelectWordAt(int pageNo, double x, double y)\r\n{\r\n    int ix = FindClosestGlyph(pageNo, x, y);\r\n    int textLen;\r\n    const WCHAR *text = textCache->GetData(pageNo, &textLen);\r\n\r\n    for (; ix > 0; ix--) {\r\n        if (!isWordChar(text[ix - 1]))\r\n            break;\r\n    }\r\n    StartAt(pageNo, ix);\r\n\r\n    for (; ix < textLen; ix++) {\r\n        if (!isWordChar(text[ix]))\r\n            break;\r\n    }\r\n    SelectUpTo(pageNo, ix);\r\n}\r\n\r\nvoid TextSelection::CopySelection(TextSelection *orig)\r\n{\r\n    Reset();\r\n    StartAt(orig->startPage, orig->startGlyph);\r\n    SelectUpTo(orig->endPage, orig->endGlyph);\r\n}\r\n\r\nWCHAR *TextSelection::ExtractText(const WCHAR *lineSep)\r\n{\r\n    WStrVec lines;\r\n\r\n    int fromPage, fromGlyph, toPage, toGlyph;\r\n    GetGlyphRange(&fromPage, &fromGlyph, &toPage, &toGlyph);\r\n\r\n    for (int page = fromPage; page <= toPage; page++) {\r\n        int textLen;\r\n        textCache->GetData(page, &textLen);\r\n        int glyph = page == fromPage ? fromGlyph : 0;\r\n        int length = (page == toPage ? toGlyph : textLen) - glyph;\r\n        if (length > 0)\r\n            FillResultRects(page, glyph, length, &lines);\r\n    }\r\n\r\n    return lines.Join(lineSep);\r\n}\r\n\r\nvoid TextSelection::GetGlyphRange(int *fromPage, int *fromGlyph, int *toPage, int *toGlyph) const\r\n{\r\n    *fromPage = std::min(startPage, endPage);\r\n    *toPage = std::max(startPage, endPage);\r\n    *fromGlyph = (*fromPage == endPage ? endGlyph : startGlyph);\r\n    *toGlyph = (*fromPage == endPage ? startGlyph : endGlyph);\r\n    if (*fromPage == *toPage && *fromGlyph > *toGlyph)\r\n        std::swap(*fromGlyph, *toGlyph);\r\n}\r\n"
  },
  {
    "path": "src/TextSelection.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\ninline unsigned int distSq(int x, int y) { return x * x + y * y; }\r\n// underscore is mainly used for programming and is thus considered a word character\r\ninline bool isWordChar(WCHAR c) { return IsCharAlphaNumeric(c) || c == '_'; }\r\n\r\nclass PageTextCache {\r\n    BaseEngine* engine;\r\n    RectI    ** coords;\r\n    WCHAR    ** text;\r\n    int       * lens;\r\n#ifdef DEBUG\r\n    size_t      debug_size;\r\n#endif\r\n\r\n    CRITICAL_SECTION access;\r\n\r\npublic:\r\n    explicit PageTextCache(BaseEngine *engine);\r\n    ~PageTextCache();\r\n\r\n    bool HasData(int pageNo);\r\n    const WCHAR *GetData(int pageNo, int *lenOut=nullptr, RectI **coordsOut=nullptr);\r\n};\r\n\r\nstruct TextSel {\r\n    int len;\r\n    int *pages;\r\n    RectI *rects;\r\n};\r\n\r\nclass TextSelection\r\n{\r\npublic:\r\n    TextSelection(BaseEngine *engine, PageTextCache *textCache);\r\n    ~TextSelection();\r\n\r\n    bool IsOverGlyph(int pageNo, double x, double y);\r\n    void StartAt(int pageNo, int glyphIx);\r\n    void StartAt(int pageNo, double x, double y) {\r\n        StartAt(pageNo, FindClosestGlyph(pageNo, x, y));\r\n    }\r\n    void SelectUpTo(int pageNo, int glyphIx);\r\n    void SelectUpTo(int pageNo, double x, double y) {\r\n        SelectUpTo(pageNo, FindClosestGlyph(pageNo, x, y));\r\n    }\r\n    void SelectWordAt(int pageNo, double x, double y);\r\n    void CopySelection(TextSelection *orig);\r\n    WCHAR *ExtractText(const WCHAR *lineSep);\r\n    void Reset();\r\n\r\n    TextSel result;\r\n\r\n    void GetGlyphRange(int *fromPage, int *fromGlyph, int *toPage, int *toGlyph) const;\r\n\r\nprotected:\r\n    int startPage, endPage;\r\n    int startGlyph, endGlyph;\r\n\r\n    BaseEngine *    engine;\r\n    PageTextCache * textCache;\r\n\r\n    int FindClosestGlyph(int pageNo, double x, double y);\r\n    void FillResultRects(int pageNo, int glyph, int length, WStrVec *lines=nullptr);\r\n};\r\n"
  },
  {
    "path": "src/Toolbar.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"WinDynCalls.h\"\r\n#include \"Dpi.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EngineManager.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"DisplayModel.h\"\r\n#include \"GlobalPrefs.h\"\r\n#include \"TextSelection.h\"\r\n#include \"TextSearch.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"WindowInfo.h\"\r\n#include \"TabInfo.h\"\r\n#include \"resource.h\"\r\n#include \"AppTools.h\"\r\n#include \"Menu.h\"\r\n#include \"Search.h\"\r\n#include \"Toolbar.h\"\r\n#include \"Translations.h\"\r\n\r\nstruct ToolbarButtonInfo {\r\n    /* index in the toolbar bitmap (-1 for separators) */\r\n    int           bmpIndex;\r\n    int           cmdId;\r\n    const char *  toolTip;\r\n    int           flags;\r\n};\r\n\r\nstatic ToolbarButtonInfo gToolbarButtons[] = {\r\n    { 0,   IDM_OPEN,              _TRN(\"Open\"),           MF_REQ_DISK_ACCESS },\r\n// the Open button is replaced with a Save As button in Plugin mode:\r\n//  { 12,  IDM_SAVEAS,            _TRN(\"Save As\"),        MF_REQ_DISK_ACCESS },\r\n    { 1,   IDM_PRINT,             _TRN(\"Print\"),          MF_REQ_PRINTER_ACCESS },\r\n    { -1,  IDM_GOTO_PAGE,         nullptr,                   0 },\r\n    { 2,   IDM_GOTO_PREV_PAGE,    _TRN(\"Previous Page\"),  0 },\r\n    { 3,   IDM_GOTO_NEXT_PAGE,    _TRN(\"Next Page\"),      0 },\r\n    { -1,  0,                     nullptr,                   0 },\r\n    { 4,   IDT_VIEW_FIT_WIDTH,    _TRN(\"Fit Width and Show Pages Continuously\"), 0 },\r\n    { 5,   IDT_VIEW_FIT_PAGE,     _TRN(\"Fit a Single Page\"), 0 },\r\n    { 6,   IDT_VIEW_ZOOMOUT,      _TRN(\"Zoom Out\"),       0 },\r\n    { 7,   IDT_VIEW_ZOOMIN,       _TRN(\"Zoom In\"),        0 },\r\n    { -1,  IDM_FIND_FIRST,        nullptr,                   0 },\r\n    { 8,   IDM_FIND_PREV,         _TRN(\"Find Previous\"),  0 },\r\n    { 9,   IDM_FIND_NEXT,         _TRN(\"Find Next\"),      0 },\r\n    { 10,  IDM_FIND_MATCH,        _TRN(\"Match Case\"),     0 },\r\n};\r\n\r\n#define TOOLBAR_BUTTONS_COUNT dimof(gToolbarButtons)\r\n\r\ninline bool TbIsSeparator(ToolbarButtonInfo& tbi)\r\n{\r\n    return tbi.bmpIndex < 0;\r\n}\r\n\r\nstatic bool IsVisibleToolbarButton(WindowInfo *win, int buttonNo)\r\n{\r\n    switch (gToolbarButtons[buttonNo].cmdId) {\r\n\r\n    case IDT_VIEW_FIT_WIDTH:\r\n    case IDT_VIEW_FIT_PAGE:\r\n        return !win->AsChm();\r\n\r\n    case IDM_FIND_FIRST:\r\n    case IDM_FIND_NEXT:\r\n    case IDM_FIND_PREV:\r\n    case IDM_FIND_MATCH:\r\n        return NeedsFindUI(win);\r\n\r\n    default:\r\n        return true;\r\n    }\r\n}\r\n\r\nstatic bool IsToolbarButtonEnabled(WindowInfo *win, int buttonNo)\r\n{\r\n    int cmdId = gToolbarButtons[buttonNo].cmdId;\r\n\r\n    // If restricted, disable\r\n    if (!HasPermission(gToolbarButtons[buttonNo].flags >> PERM_FLAG_OFFSET))\r\n        return false;\r\n\r\n    // If no file open, only enable open button\r\n    if (!win->IsDocLoaded())\r\n        return IDM_OPEN == cmdId;\r\n\r\n    switch (cmdId)\r\n    {\r\n    case IDM_OPEN:\r\n        // opening different files isn't allowed in plugin mode\r\n        return !gPluginMode;\r\n\r\n#ifndef DISABLE_DOCUMENT_RESTRICTIONS\r\n    case IDM_PRINT:\r\n        return !win->AsFixed() || win->AsFixed()->GetEngine()->AllowsPrinting();\r\n#endif\r\n\r\n    case IDM_FIND_NEXT:\r\n    case IDM_FIND_PREV:\r\n        // TODO: Update on whether there's more to find, not just on whether there is text.\r\n        return win::GetTextLen(win->hwndFindBox) > 0;\r\n\r\n    case IDM_GOTO_NEXT_PAGE:\r\n        return win->ctrl->CurrentPageNo() < win->ctrl->PageCount();\r\n    case IDM_GOTO_PREV_PAGE:\r\n        return win->ctrl->CurrentPageNo() > 1;\r\n\r\n    default:\r\n        return true;\r\n    }\r\n}\r\n\r\nstatic TBBUTTON TbButtonFromButtonInfo(int i) {\r\n    TBBUTTON tbButton = { 0 };\r\n    tbButton.idCommand = gToolbarButtons[i].cmdId;\r\n    if (TbIsSeparator(gToolbarButtons[i])) {\r\n        tbButton.fsStyle = TBSTYLE_SEP;\r\n    } else {\r\n        tbButton.iBitmap = gToolbarButtons[i].bmpIndex;\r\n        tbButton.fsState = TBSTATE_ENABLED;\r\n        tbButton.fsStyle = TBSTYLE_BUTTON;\r\n        tbButton.iString = (INT_PTR)trans::GetTranslation(gToolbarButtons[i].toolTip);\r\n    }\r\n    return tbButton;\r\n}\r\n\r\n#define WS_TOOLBAR (WS_CHILD | WS_CLIPSIBLINGS | \\\r\n                    TBSTYLE_TOOLTIPS | TBSTYLE_FLAT | \\\r\n                    TBSTYLE_LIST | CCS_NODIVIDER | CCS_NOPARENTALIGN)\r\n\r\nstatic void BuildTBBUTTONINFO(TBBUTTONINFO& info, const WCHAR *txt)\r\n{\r\n    info.cbSize = sizeof(TBBUTTONINFO);\r\n    info.dwMask = TBIF_TEXT | TBIF_BYINDEX;\r\n    info.pszText = (WCHAR *)txt;\r\n}\r\n\r\n// Set toolbar button tooltips taking current language into account.\r\nvoid UpdateToolbarButtonsToolTipsForWindow(WindowInfo *win)\r\n{\r\n    TBBUTTONINFO buttonInfo;\r\n    HWND hwnd = win->hwndToolbar;\r\n    LRESULT res;\r\n    for (int i = 0; i < TOOLBAR_BUTTONS_COUNT; i++) {\r\n        WPARAM buttonId = (WPARAM)i;\r\n        const char *txt = gToolbarButtons[i].toolTip;\r\n        if (nullptr == txt)\r\n            continue;\r\n        const WCHAR *translation = trans::GetTranslation(txt);\r\n        BuildTBBUTTONINFO(buttonInfo, translation);\r\n        res = SendMessage(hwnd, TB_SETBUTTONINFO, buttonId, (LPARAM)&buttonInfo);\r\n        assert(0 != res);\r\n    }\r\n}\r\n\r\nvoid ToolbarUpdateStateForWindow(WindowInfo *win, bool showHide)\r\n{\r\n    const LPARAM enabled = (LPARAM)MAKELONG(1, 0);\r\n    const LPARAM disabled = (LPARAM)MAKELONG(0, 0);\r\n\r\n    for (int i = 0; i < TOOLBAR_BUTTONS_COUNT; i++) {\r\n        if (showHide) {\r\n            BOOL hide = !IsVisibleToolbarButton(win, i);\r\n            SendMessage(win->hwndToolbar, TB_HIDEBUTTON, gToolbarButtons[i].cmdId, hide);\r\n        }\r\n        if (TbIsSeparator(gToolbarButtons[i]))\r\n            continue;\r\n\r\n        LPARAM buttonState = IsToolbarButtonEnabled(win, i) ? enabled : disabled;\r\n        SendMessage(win->hwndToolbar, TB_ENABLEBUTTON, gToolbarButtons[i].cmdId, buttonState);\r\n    }\r\n\r\n    // Find labels may have to be repositioned if some\r\n    // toolbar buttons were shown/hidden\r\n    if (showHide && NeedsFindUI(win))\r\n        UpdateToolbarFindText(win);\r\n}\r\n\r\nvoid ShowOrHideToolbar(WindowInfo *win)\r\n{\r\n    if (win->presentation || win->isFullScreen)\r\n        return;\r\n    if (gGlobalPrefs->showToolbar && !win->AsEbook()) {\r\n        ShowWindow(win->hwndReBar, SW_SHOW);\r\n    } else {\r\n        // Move the focus out of the toolbar\r\n        if (win->hwndFindBox == GetFocus() || win->hwndPageBox == GetFocus())\r\n            SetFocus(win->hwndFrame);\r\n        ShowWindow(win->hwndReBar, SW_HIDE);\r\n    }\r\n    RelayoutWindow(win);\r\n}\r\n\r\nvoid UpdateFindbox(WindowInfo* win)\r\n{\r\n    ToggleWindowStyle(win->hwndFindBg, SS_WHITERECT, win->IsDocLoaded());\r\n    ToggleWindowStyle(win->hwndPageBg, SS_WHITERECT, win->IsDocLoaded());\r\n\r\n    InvalidateRect(win->hwndToolbar, nullptr, TRUE);\r\n    UpdateWindow(win->hwndToolbar);\r\n\r\n    if (!win->IsDocLoaded()) {  // Avoid focus on Find box\r\n        SetClassLongPtr(win->hwndFindBox, GCLP_HCURSOR, (LONG_PTR)GetCursor(IDC_ARROW));\r\n        HideCaret(nullptr);\r\n    } else {\r\n        SetClassLongPtr(win->hwndFindBox, GCLP_HCURSOR, (LONG_PTR)GetCursor(IDC_IBEAM));\r\n        ShowCaret(nullptr);\r\n    }\r\n}\r\n\r\nstatic HBITMAP LoadExternalBitmap(HINSTANCE hInst, WCHAR * fileName, INT resourceId, bool useDibSection)\r\n{\r\n    ScopedMem<WCHAR> path(AppGenDataFilename(fileName));\r\n\r\n    UINT flags = useDibSection ? LR_CREATEDIBSECTION : 0;\r\n    if (path) {\r\n        HBITMAP hBmp = (HBITMAP)LoadImage(nullptr, path, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | flags);\r\n        if (hBmp)\r\n            return hBmp;\r\n    }\r\n    return (HBITMAP)LoadImage(hInst, MAKEINTRESOURCE(resourceId), IMAGE_BITMAP, 0, 0, flags);\r\n}\r\n\r\nstatic WNDPROC DefWndProcToolbar = nullptr;\r\nstatic LRESULT CALLBACK WndProcToolbar(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)\r\n{\r\n    if (WM_CTLCOLORSTATIC == message) {\r\n        HWND hStatic = (HWND)lParam;\r\n        WindowInfo *win = FindWindowInfoByHwnd(hStatic);\r\n        if ((win && win->hwndFindBg != hStatic && win->hwndPageBg != hStatic) || theme::IsAppThemed())\r\n        {\r\n            HDC hdc = (HDC)wParam;\r\n            SetTextColor(hdc, GetSysColor(COLOR_WINDOWTEXT));\r\n            SetBkMode(hdc, TRANSPARENT);\r\n            return (LRESULT)GetStockBrush(NULL_BRUSH);\r\n        }\r\n    }\r\n    if (WM_COMMAND == message) {\r\n        HWND hEdit = (HWND)lParam;\r\n        WindowInfo *win = FindWindowInfoByHwnd(hEdit);\r\n        // \"find as you type\"\r\n        if (EN_UPDATE == HIWORD(wParam) && hEdit == win->hwndFindBox && gGlobalPrefs->showToolbar) {\r\n            FindTextOnThread(win, FIND_FORWARD, false);\r\n        }\r\n    }\r\n    return CallWindowProc(DefWndProcToolbar, hwnd, message, wParam, lParam);\r\n}\r\n\r\nstatic WNDPROC DefWndProcFindBox = nullptr;\r\nstatic LRESULT CALLBACK WndProcFindBox(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)\r\n{\r\n    WindowInfo *win = FindWindowInfoByHwnd(hwnd);\r\n    if (!win || !win->IsDocLoaded())\r\n        return DefWindowProc(hwnd, message, wParam, lParam);\r\n\r\n    if (ExtendedEditWndProc(hwnd, message, wParam, lParam)) {\r\n        // select the whole find box on a non-selecting click\r\n    } else if (WM_CHAR == message) {\r\n        switch (wParam) {\r\n        case VK_ESCAPE:\r\n            if (win->findThread)\r\n                AbortFinding(win, false);\r\n            else\r\n                SetFocus(win->hwndFrame);\r\n            return 1;\r\n\r\n        case VK_RETURN:\r\n            FindTextOnThread(win, IsShiftPressed() ? FIND_BACKWARD : FIND_FORWARD, true);\r\n            return 1;\r\n\r\n        case VK_TAB:\r\n            AdvanceFocus(win);\r\n            return 1;\r\n        }\r\n    }\r\n    else if (WM_ERASEBKGND == message) {\r\n        RECT r;\r\n        Edit_GetRect(hwnd, &r);\r\n        if (r.left == 0 && r.top == 0) { // virgin box\r\n            r.left += 4;\r\n            r.top += 3;\r\n            r.bottom += 3;\r\n            r.right -= 2;\r\n            Edit_SetRectNoPaint(hwnd, &r);\r\n        }\r\n    }\r\n    else if (WM_KEYDOWN == message) {\r\n        if (FrameOnKeydown(win, wParam, lParam, true))\r\n            return 0;\r\n    }\r\n\r\n    LRESULT ret = CallWindowProc(DefWndProcFindBox, hwnd, message, wParam, lParam);\r\n\r\n    if (WM_CHAR  == message ||\r\n        WM_PASTE == message ||\r\n        WM_CUT   == message ||\r\n        WM_CLEAR == message ||\r\n        WM_UNDO  == message ||\r\n        WM_KEYUP == message) {\r\n        ToolbarUpdateStateForWindow(win, false);\r\n    }\r\n\r\n    return ret;\r\n}\r\n\r\n#define TB_TEXT_PADDING_RIGHT 6\r\n\r\nvoid UpdateToolbarFindText(WindowInfo *win)\r\n{\r\n    bool showUI = NeedsFindUI(win);\r\n    win::SetVisibility(win->hwndFindText, showUI);\r\n    win::SetVisibility(win->hwndFindBg, showUI);\r\n    win::SetVisibility(win->hwndFindBox, showUI);\r\n    if (!showUI)\r\n        return;\r\n\r\n    const WCHAR *text = _TR(\"Find:\");\r\n    win::SetText(win->hwndFindText, text);\r\n\r\n    WindowRect findWndRect(win->hwndFindBg);\r\n\r\n    RECT r;\r\n    SendMessage(win->hwndToolbar, TB_GETRECT, IDT_VIEW_ZOOMIN, (LPARAM)&r);\r\n    int pos_x = r.right + 10;\r\n    int pos_y = (r.bottom - findWndRect.dy) / 2;\r\n\r\n    SizeI size = TextSizeInHwnd(win->hwndFindText, text);\r\n    size.dx += TB_TEXT_PADDING_RIGHT;\r\n\r\n    int padding = GetSystemMetrics(SM_CXEDGE);\r\n    MoveWindow(win->hwndFindText, pos_x, (findWndRect.dy - size.dy + 1) / 2 + pos_y, size.dx, size.dy, TRUE);\r\n    MoveWindow(win->hwndFindBg, pos_x + size.dx, pos_y, findWndRect.dx, findWndRect.dy, FALSE);\r\n    MoveWindow(win->hwndFindBox, pos_x + size.dx + padding, (findWndRect.dy - size.dy + 1) / 2 + pos_y,\r\n        findWndRect.dx - 2 * padding, size.dy, FALSE);\r\n\r\n    TBBUTTONINFO bi;\r\n    bi.cbSize = sizeof(bi);\r\n    bi.dwMask = TBIF_SIZE;\r\n    bi.cx = (WORD)(size.dx + findWndRect.dx + 12);\r\n    SendMessage(win->hwndToolbar, TB_SETBUTTONINFO, IDM_FIND_FIRST, (LPARAM)&bi);\r\n}\r\n\r\nvoid UpdateToolbarState(WindowInfo *win)\r\n{\r\n    if (!win->IsDocLoaded())\r\n        return;\r\n\r\n    WORD state = (WORD)SendMessage(win->hwndToolbar, TB_GETSTATE, IDT_VIEW_FIT_WIDTH, 0);\r\n    if (win->ctrl->GetDisplayMode() == DM_CONTINUOUS && win->ctrl->GetZoomVirtual() == ZOOM_FIT_WIDTH)\r\n        state |= TBSTATE_CHECKED;\r\n    else\r\n        state &= ~TBSTATE_CHECKED;\r\n    SendMessage(win->hwndToolbar, TB_SETSTATE, IDT_VIEW_FIT_WIDTH, state);\r\n\r\n    bool isChecked = (state & TBSTATE_CHECKED);\r\n\r\n    state = (WORD)SendMessage(win->hwndToolbar, TB_GETSTATE, IDT_VIEW_FIT_PAGE, 0);\r\n    if (win->ctrl->GetDisplayMode() == DM_SINGLE_PAGE && win->ctrl->GetZoomVirtual() == ZOOM_FIT_PAGE)\r\n        state |= TBSTATE_CHECKED;\r\n    else\r\n        state &= ~TBSTATE_CHECKED;\r\n    SendMessage(win->hwndToolbar, TB_SETSTATE, IDT_VIEW_FIT_PAGE, state);\r\n\r\n    isChecked |= (state & TBSTATE_CHECKED);\r\n    if (!isChecked)\r\n        win->currentTab->prevZoomVirtual = INVALID_ZOOM;\r\n}\r\n\r\n#define TOOLBAR_MIN_ICON_SIZE 16\r\n#define FIND_BOX_WIDTH 160\r\n\r\nstatic void CreateFindBox(WindowInfo& win)\r\n{\r\n    int boxWidth = DpiScaleX(win.hwndFrame, FIND_BOX_WIDTH);\r\n    int minIconSize = DpiScaleX(win.hwndFrame, TOOLBAR_MIN_ICON_SIZE);\r\n    HWND findBg = CreateWindowEx(WS_EX_STATICEDGE, WC_STATIC, L\"\", WS_VISIBLE | WS_CHILD,\r\n                            0, 1, boxWidth, minIconSize + 4,\r\n                            win.hwndToolbar, (HMENU)0, GetModuleHandle(nullptr), nullptr);\r\n\r\n    HWND find = CreateWindowEx(0, WC_EDIT, L\"\", WS_VISIBLE | WS_CHILD | ES_AUTOHSCROLL,\r\n                            0, 1, boxWidth - 2 * GetSystemMetrics(SM_CXEDGE), minIconSize + 2,\r\n                            win.hwndToolbar, (HMENU)0, GetModuleHandle(nullptr), nullptr);\r\n\r\n    HWND label = CreateWindowEx(0, WC_STATIC, L\"\", WS_VISIBLE | WS_CHILD,\r\n                            0, 1, 0, 0, win.hwndToolbar, (HMENU)0, GetModuleHandle(nullptr), nullptr);\r\n\r\n    SetWindowFont(label, GetDefaultGuiFont(), FALSE);\r\n    SetWindowFont(find, GetDefaultGuiFont(), FALSE);\r\n\r\n    if (!DefWndProcToolbar)\r\n        DefWndProcToolbar = (WNDPROC)GetWindowLongPtr(win.hwndToolbar, GWLP_WNDPROC);\r\n    SetWindowLongPtr(win.hwndToolbar, GWLP_WNDPROC, (LONG_PTR)WndProcToolbar);\r\n\r\n    if (!DefWndProcFindBox)\r\n        DefWndProcFindBox = (WNDPROC)GetWindowLongPtr(find, GWLP_WNDPROC);\r\n    SetWindowLongPtr(find, GWLP_WNDPROC, (LONG_PTR)WndProcFindBox);\r\n\r\n    win.hwndFindText = label;\r\n    win.hwndFindBox = find;\r\n    win.hwndFindBg = findBg;\r\n\r\n    UpdateToolbarFindText(&win);\r\n}\r\n\r\nstatic WNDPROC DefWndProcPageBox = nullptr;\r\nstatic LRESULT CALLBACK WndProcPageBox(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)\r\n{\r\n    WindowInfo *win = FindWindowInfoByHwnd(hwnd);\r\n    if (!win || !win->IsDocLoaded())\r\n        return DefWindowProc(hwnd, message, wParam, lParam);\r\n\r\n    if (ExtendedEditWndProc(hwnd, message, wParam, lParam)) {\r\n        // select the whole page box on a non-selecting click\r\n    } else if (WM_CHAR == message) {\r\n        switch (wParam) {\r\n        case VK_RETURN: {\r\n            ScopedMem<WCHAR> buf(win::GetText(win->hwndPageBox));\r\n            int newPageNo = win->ctrl->GetPageByLabel(buf);\r\n            if (win->ctrl->ValidPageNo(newPageNo)) {\r\n                win->ctrl->GoToPage(newPageNo, true);\r\n                SetFocus(win->hwndFrame);\r\n            }\r\n            return 1;\r\n        }\r\n        case VK_ESCAPE:\r\n            SetFocus(win->hwndFrame);\r\n            return 1;\r\n\r\n        case VK_TAB:\r\n            AdvanceFocus(win);\r\n            return 1;\r\n        }\r\n    } else if (WM_ERASEBKGND == message) {\r\n        RECT r;\r\n        Edit_GetRect(hwnd, &r);\r\n        if (r.left == 0 && r.top == 0) { // virgin box\r\n            r.left += 4;\r\n            r.top += 3;\r\n            r.bottom += 3;\r\n            r.right -= 2;\r\n            Edit_SetRectNoPaint(hwnd, &r);\r\n        }\r\n    } else if (WM_KEYDOWN == message) {\r\n        if (FrameOnKeydown(win, wParam, lParam, true))\r\n            return 0;\r\n    }\r\n\r\n    return CallWindowProc(DefWndProcPageBox, hwnd, message, wParam, lParam);\r\n}\r\n\r\n#define PAGE_BOX_WIDTH 40\r\n\r\nvoid UpdateToolbarPageText(WindowInfo *win, int pageCount, bool updateOnly)\r\n{\r\n    const WCHAR *text = _TR(\"Page:\");\r\n    if (!updateOnly)\r\n        win::SetText(win->hwndPageText, text);\r\n    SizeI size = TextSizeInHwnd(win->hwndPageText, text);\r\n    size.dx += TB_TEXT_PADDING_RIGHT;\r\n\r\n    WindowRect pageWndRect(win->hwndPageBg);\r\n\r\n    RECT r;\r\n    SendMessage(win->hwndToolbar, TB_GETRECT, IDM_PRINT, (LPARAM)&r);\r\n    int pos_x = r.right + 10;\r\n    int pos_y = (r.bottom - pageWndRect.dy) / 2;\r\n\r\n    WCHAR *buf;\r\n    SizeI size2;\r\n    if (-1 == pageCount) {\r\n        // preserve hwndPageTotal's text and size\r\n        buf = win::GetText(win->hwndPageTotal);\r\n        size2 = ClientRect(win->hwndPageTotal).Size();\r\n        size2.dx -= TB_TEXT_PADDING_RIGHT;\r\n    } else if (!pageCount)\r\n        buf = str::Dup(L\"\");\r\n    else if (!win->ctrl || !win->ctrl->HasPageLabels())\r\n        buf = str::Format(L\" / %d\", pageCount);\r\n    else {\r\n        buf = str::Format(L\" (%d / %d)\", win->ctrl->CurrentPageNo(), pageCount);\r\n        ScopedMem<WCHAR> buf2(str::Format(L\" (%d / %d)\", pageCount, pageCount));\r\n        size2 = TextSizeInHwnd(win->hwndPageTotal, buf2);\r\n    }\r\n\r\n    win::SetText(win->hwndPageTotal, buf);\r\n    if (0 == size2.dx)\r\n        size2 = TextSizeInHwnd(win->hwndPageTotal, buf);\r\n    size2.dx += TB_TEXT_PADDING_RIGHT;\r\n    free(buf);\r\n\r\n    int padding = GetSystemMetrics(SM_CXEDGE);\r\n    MoveWindow(win->hwndPageText, pos_x, (pageWndRect.dy - size.dy + 1) / 2 + pos_y, size.dx, size.dy, FALSE);\r\n    if (IsUIRightToLeft())\r\n        pos_x += size2.dx - TB_TEXT_PADDING_RIGHT;\r\n    MoveWindow(win->hwndPageBg, pos_x + size.dx, pos_y, pageWndRect.dx, pageWndRect.dy, FALSE);\r\n    MoveWindow(win->hwndPageBox, pos_x + size.dx + padding, (pageWndRect.dy - size.dy + 1) / 2 + pos_y,\r\n               pageWndRect.dx - 2 * padding, size.dy, FALSE);\r\n    // in right-to-left layout, the total comes \"before\" the current page number\r\n    if (IsUIRightToLeft()) {\r\n        pos_x -= size2.dx;\r\n        MoveWindow(win->hwndPageTotal, pos_x + size.dx, (pageWndRect.dy - size.dy + 1) / 2 + pos_y, size2.dx, size.dy, FALSE);\r\n    }\r\n    else\r\n        MoveWindow(win->hwndPageTotal, pos_x + size.dx + pageWndRect.dx, (pageWndRect.dy - size.dy + 1) / 2 + pos_y, size2.dx, size.dy, FALSE);\r\n\r\n    TBBUTTONINFO bi;\r\n    bi.cbSize = sizeof(bi);\r\n    bi.dwMask = TBIF_SIZE;\r\n    SendMessage(win->hwndToolbar, TB_GETBUTTONINFO, IDM_GOTO_PAGE, (LPARAM)&bi);\r\n    size2.dx += size.dx + pageWndRect.dx + 12;\r\n    if (bi.cx != size2.dx || !updateOnly) {\r\n        bi.cx = (WORD)size2.dx;\r\n        SendMessage(win->hwndToolbar, TB_SETBUTTONINFO, IDM_GOTO_PAGE, (LPARAM)&bi);\r\n    } else {\r\n        RectI rc = ClientRect(win->hwndPageTotal);\r\n        rc = MapRectToWindow(rc, win->hwndPageTotal, win->hwndToolbar);\r\n        RECT rTmp = rc.ToRECT();\r\n        InvalidateRect(win->hwndToolbar, &rTmp, TRUE);\r\n    }\r\n}\r\n\r\nstatic void CreatePageBox(WindowInfo& win)\r\n{\r\n    int boxWidth = DpiScaleX(win.hwndFrame, PAGE_BOX_WIDTH);\r\n    int minIconSize = DpiScaleX(win.hwndFrame, TOOLBAR_MIN_ICON_SIZE);\r\n    DWORD style = WS_VISIBLE | WS_CHILD;\r\n    HWND pageBg = CreateWindowEx(WS_EX_STATICEDGE, WC_STATIC, L\"\", style,\r\n                            0, 1, boxWidth, minIconSize + 4,\r\n                            win.hwndToolbar, (HMENU)0, GetModuleHandle(nullptr), nullptr);\r\n\r\n    HWND label = CreateWindowEx(0, WC_STATIC, L\"\", style,\r\n                            0, 1, 0, 0, win.hwndToolbar, (HMENU)0,\r\n                            GetModuleHandle(nullptr), nullptr);\r\n\r\n    HWND total = CreateWindowEx(0, WC_STATIC, L\"\", style,\r\n                            0, 1, 0, 0, win.hwndToolbar, (HMENU)0,\r\n                            GetModuleHandle(nullptr), nullptr);\r\n\r\n    style = WS_VISIBLE | WS_CHILD | ES_AUTOHSCROLL | ES_NUMBER | ES_RIGHT;\r\n    HWND page = CreateWindowExW(0, WC_EDIT, L\"0\", style,\r\n                        0, 1, boxWidth - 2 * GetSystemMetrics(SM_CXEDGE),  minIconSize + 2,\r\n                        win.hwndToolbar, (HMENU)0, GetModuleHandle(nullptr), nullptr);\r\n\r\n    SetWindowFont(label, GetDefaultGuiFont(), FALSE);\r\n    SetWindowFont(page, GetDefaultGuiFont(), FALSE);\r\n    SetWindowFont(total, GetDefaultGuiFont(), FALSE);\r\n\r\n    if (!DefWndProcPageBox)\r\n        DefWndProcPageBox = (WNDPROC)GetWindowLongPtr(page, GWLP_WNDPROC);\r\n    SetWindowLongPtr(page, GWLP_WNDPROC, (LONG_PTR)WndProcPageBox);\r\n\r\n    win.hwndPageText = label;\r\n    win.hwndPageBox = page;\r\n    win.hwndPageBg = pageBg;\r\n    win.hwndPageTotal = total;\r\n\r\n    UpdateToolbarPageText(&win, -1);\r\n}\r\n\r\n#define WS_REBAR (WS_CHILD | WS_CLIPCHILDREN | WS_BORDER | RBS_VARHEIGHT | \\\r\n                  RBS_BANDBORDERS | CCS_NODIVIDER | CCS_NOPARENTALIGN)\r\n\r\n\r\n// Sometimes scaled icons show up with purple background. Here's what I was able to piece together.\r\n// When icons not scaled, we don't ask for DIB section (the original behavior of the code)\r\n// Win 7 : purple if DIB section (tested by me)\r\n// Win 10 :\r\n//  build 14383 : purple if no DIB section (tested by me)\r\n//  build 10586 : purple if DIB section (reported in https://github.com/sumatrapdfreader/sumatrapdf/issues/569#issuecomment-231508990)\r\n// Other builds not tested, will default to no DIB section. Might need to update it if more reports come in.\r\nstatic bool UseDibSection(bool needsScaling) {\r\n    if (!needsScaling) {\r\n        return false;\r\n    }\r\n    OSVERSIONINFOEX ver;\r\n    GetOsVersion(ver);\r\n    // everything other than win 10: no DIB section\r\n    if (ver.dwMajorVersion != 10) {\r\n        return false;\r\n    }\r\n    // win 10 seems to behave differently depending on the build\r\n    // I assume that up to 10586 we don't want dib\r\n    if (ver.dwBuildNumber <= 10586) {\r\n        return false;\r\n    }\r\n    // builds > 10586, including 14383\r\n    return true;\r\n}\r\n\r\nvoid CreateToolbar(WindowInfo *win)\r\n{\r\n    HWND hwndToolbar = CreateWindowEx(0, TOOLBARCLASSNAME, nullptr, WS_TOOLBAR,\r\n                                      0, 0, 0, 0, win->hwndFrame,(HMENU)IDC_TOOLBAR,\r\n                                      GetModuleHandle(nullptr), nullptr);\r\n    win->hwndToolbar = hwndToolbar;\r\n    SendMessage(hwndToolbar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);\r\n\r\n    ShowWindow(hwndToolbar, SW_SHOW);\r\n    TBBUTTON tbButtons[TOOLBAR_BUTTONS_COUNT];\r\n\r\n    // stretch the toolbar bitmaps for higher DPI settings\r\n    // TODO: get nicely interpolated versions of the toolbar icons for higher resolutions\r\n\r\n    Dpi *dpi = DpiGet(win->hwndFrame);\r\n    // scale toolbar images only by integral sizes (2, 3 etc.)\r\n    int scaleX = (int)ceilf((float)dpi->dpiX / 96.f);\r\n    int scaleY = (int)ceilf((float)dpi->dpiY / 96.f);\r\n    bool needsScaling = (scaleX > 1) || (scaleY > 1);\r\n\r\n    bool useDibSection = UseDibSection(needsScaling);\r\n\r\n    // the name of the bitmap contains the number of icons so that after adding/removing\r\n    // icons a complete default toolbar is used rather than an incomplete customized one\r\n    HBITMAP hbmp = LoadExternalBitmap(GetModuleHandle(nullptr), L\"toolbar_11.bmp\", IDB_TOOLBAR, useDibSection);\r\n    SizeI size = GetBitmapSize(hbmp);\r\n\r\n    if (needsScaling) {\r\n        size.dx *= scaleX;\r\n        size.dy *= scaleY;\r\n\r\n        UINT flags = LR_COPYDELETEORG;\r\n        if (useDibSection) {\r\n            flags |= LR_CREATEDIBSECTION;\r\n        }\r\n        hbmp = (HBITMAP)CopyImage(hbmp, IMAGE_BITMAP, size.dx, size.dy, flags);\r\n    }\r\n\r\n    // assume square icons\r\n    HIMAGELIST himl = ImageList_Create(size.dy, size.dy, ILC_COLORDDB | ILC_MASK, 0, 0);\r\n    ImageList_AddMasked(himl, hbmp, RGB(0xFF, 0, 0xFF));\r\n    DeleteObject(hbmp);\r\n\r\n    // in Plugin mode, replace the Open with a Save As button\r\n    if (gPluginMode && size.dx / size.dy == 13) {\r\n        gToolbarButtons[0].bmpIndex = 12;\r\n        gToolbarButtons[0].cmdId = IDM_SAVEAS;\r\n        gToolbarButtons[0].toolTip = _TRN(\"Save As\");\r\n        gToolbarButtons[0].flags = MF_REQ_DISK_ACCESS;\r\n    }\r\n    for (int i = 0; i < TOOLBAR_BUTTONS_COUNT; i++) {\r\n        tbButtons[i] = TbButtonFromButtonInfo(i);\r\n        if (gToolbarButtons[i].cmdId == IDM_FIND_MATCH)\r\n            tbButtons[i].fsStyle = BTNS_CHECK;\r\n    }\r\n    SendMessage(hwndToolbar, TB_SETIMAGELIST, 0, (LPARAM)himl);\r\n\r\n    LRESULT exstyle = SendMessage(hwndToolbar, TB_GETEXTENDEDSTYLE, 0, 0);\r\n    exstyle |= TBSTYLE_EX_MIXEDBUTTONS;\r\n    SendMessage(hwndToolbar, TB_SETEXTENDEDSTYLE, 0, exstyle);\r\n\r\n    SendMessage(hwndToolbar, TB_ADDBUTTONS, TOOLBAR_BUTTONS_COUNT, (LPARAM)tbButtons);\r\n\r\n    RECT rc;\r\n    LRESULT res = SendMessage(hwndToolbar, TB_GETITEMRECT, 0, (LPARAM)&rc);\r\n    if (!res)\r\n        rc.left = rc.right = rc.top = rc.bottom = 0;\r\n\r\n    DWORD  reBarStyle = WS_REBAR | WS_VISIBLE;\r\n    win->hwndReBar = CreateWindowEx(WS_EX_TOOLWINDOW, REBARCLASSNAME, nullptr, reBarStyle,\r\n                                    0, 0, 0, 0, win->hwndFrame, (HMENU)IDC_REBAR, GetModuleHandle(nullptr), nullptr);\r\n\r\n    REBARINFO rbi;\r\n    rbi.cbSize = sizeof(REBARINFO);\r\n    rbi.fMask  = 0;\r\n    rbi.himl   = (HIMAGELIST)nullptr;\r\n    SendMessage(win->hwndReBar, RB_SETBARINFO, 0, (LPARAM)&rbi);\r\n\r\n    REBARBANDINFO rbBand;\r\n    rbBand.cbSize  = sizeof(REBARBANDINFO);\r\n    rbBand.fMask   = /*RBBIM_COLORS | RBBIM_TEXT | RBBIM_BACKGROUND | */\r\n                   RBBIM_STYLE | RBBIM_CHILD | RBBIM_CHILDSIZE /*| RBBIM_SIZE*/;\r\n    rbBand.fStyle  = /*RBBS_CHILDEDGE |*//* RBBS_BREAK |*/ RBBS_FIXEDSIZE /*| RBBS_GRIPPERALWAYS*/;\r\n    if (theme::IsAppThemed())\r\n        rbBand.fStyle |= RBBS_CHILDEDGE;\r\n    rbBand.hbmBack = nullptr;\r\n    rbBand.lpText     = L\"Toolbar\";\r\n    rbBand.hwndChild  = hwndToolbar;\r\n    rbBand.cxMinChild = (rc.right - rc.left) * TOOLBAR_BUTTONS_COUNT;\r\n    rbBand.cyMinChild = (rc.bottom - rc.top) + 2 * rc.top;\r\n    rbBand.cx         = 0;\r\n    SendMessage(win->hwndReBar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand);\r\n\r\n    SetWindowPos(win->hwndReBar, nullptr, 0, 0, 0, 0, SWP_NOZORDER);\r\n\r\n    CreatePageBox(*win);\r\n    CreateFindBox(*win);\r\n}\r\n"
  },
  {
    "path": "src/Toolbar.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nvoid CreateToolbar(WindowInfo *win);\r\nvoid ToolbarUpdateStateForWindow(WindowInfo *win, bool showHide);\r\nvoid UpdateToolbarButtonsToolTipsForWindow(WindowInfo *win);\r\nvoid UpdateToolbarFindText(WindowInfo *win);\r\nvoid UpdateToolbarPageText(WindowInfo *win, int pageCount, bool updateOnly=false);\r\nvoid UpdateFindbox(WindowInfo* win);\r\nvoid ShowOrHideToolbar(WindowInfo *win);\r\nvoid UpdateToolbarState(WindowInfo *win);\r\n"
  },
  {
    "path": "src/Trans_sumatra_txt.cpp",
    "content": "/*\n DO NOT EDIT MANUALLY !!!\n Generated by scripts\\trans_gen.py\n*/\n\n#include \"BaseUtil.h\"\n\nnamespace trans {\n\n#define LANGS_COUNT   57\n#define STRINGS_COUNT 246\n\nconst char *gOriginalStrings[STRINGS_COUNT] = {\n  \"&About\",\n  \"&Actual Size\\tCtrl+1\",\n  \"&Advanced Options...\",\n  \"&All selected pages\",\n  \"&Back\\tAlt+Left Arrow\",\n  \"&Book View\\tCtrl+8\",\n  \"&Close\\tCtrl+W\",\n  \"&Copy Selection\",\n  \"&Copy Selection\\tCtrl+C\",\n  \"&Don't ask me again\",\n  \"&Even pages only\",\n  \"&Facing\\tCtrl+7\",\n  \"&File\",\n  \"&Find what:\",\n  \"&First Page\\tHome\",\n  \"&Fit pages to printable area\",\n  \"&Go To\",\n  \"&Go to page:\",\n  \"&Help\",\n  \"&Last Page\\tEnd\",\n  \"&Magnification:\",\n  \"&Manual\",\n  \"&Match case\",\n  \"&Next Page\\tRight Arrow\",\n  \"&No\",\n  \"&No, thanks\",\n  \"&Odd pages only\",\n  \"&Open Document\",\n  \"&Open...\\tCtrl+O\",\n  \"&Options...\",\n  \"&Password:\",\n  \"&Pin Document\",\n  \"&Previous Page\\tLeft Arrow\",\n  \"&Print...\",\n  \"&Print...\\tCtrl+P\",\n  \"&Print... (denied)\",\n  \"&Remember the password for this document\",\n  \"&Remember these settings for each document\",\n  \"&Remove Document\",\n  \"&Save As...\",\n  \"&Save As...\\tCtrl+S\",\n  \"&Settings\",\n  \"&Shrink pages to printable area (if necessary)\",\n  \"&Single Page\\tCtrl+6\",\n  \"&Skip this version\",\n  \"&Use original page sizes\",\n  \"&View\",\n  \"&Window\",\n  \"&Yes\",\n  \"&Zoom\",\n  \"(of %d)\",\n  \"(page %s)\",\n  \"About SumatraPDF\",\n  \"Add Favorite\",\n  \"Add page %s to favorites\",\n  \"Add page %s to favorites with (optional) name:\",\n  \"Add to favorites\",\n  \"Advanced\",\n  \"All files\",\n  \"All supported documents\",\n  \"Application:\",\n  \"Associate with PDF files?\",\n  \"Attachment: %s\",\n  \"Author:\",\n  \"Automatic\",\n  \"Automatically check for &updates\",\n  \"Book View\",\n  \"Book&marks\\tF12\",\n  \"Bookmark Shortcuts\",\n  \"Bookmark shortcut to page %s of %s\",\n  \"Bookmarks\",\n  \"Bytes\",\n  \"CHM documents\",\n  \"Can't connect to the Internet (error %#x).\",\n  \"Cancel\",\n  \"Cannot print this file\",\n  \"Cannot start inverse search command. Please check the command line in the settings.\",\n  \"Change Language\",\n  \"Check for &Updates\",\n  \"Comic books\",\n  \"Compatibility\",\n  \"Continuous\",\n  \"Continuous Book View\",\n  \"Continuous Facing\",\n  \"Contribute Translation\",\n  \"Copy &Image\",\n  \"Copy &Link Address\",\n  \"Copy Co&mment\",\n  \"Copying text was denied (copying as image only)\",\n  \"Copyright:\",\n  \"Could not obtain Printer properties\",\n  \"Couldn't initialize printer\",\n  \"Couldn't render the page\",\n  \"Created:\",\n  \"Current file\",\n  \"Cursor position:\",\n  \"Custom &Zoom...\\tCtrl+Y\",\n  \"Default &Layout:\",\n  \"Default &Zoom:\",\n  \"Default PDF reader can't be changed in portable mode\",\n  \"Denied Permissions:\",\n  \"DjVu documents\",\n  \"Document Properties\",\n  \"Download\",\n  \"E&xit\\tCtrl+Q\",\n  \"EPUB ebooks\",\n  \"Enter password\",\n  \"Enter password for %s\",\n  \"Enter the command-line to invoke when you double-click on the PDF document:\",\n  \"Error loading %s\",\n  \"F&avorites\",\n  \"F&orward\\tAlt+Right Arrow\",\n  \"F&ullscreen\\tF11\",\n  \"Facing\",\n  \"Failed to rename the file!\",\n  \"Failed to save a file\",\n  \"Fast Web View\",\n  \"Favorites\",\n  \"FictionBook documents\",\n  \"File %s not found\",\n  \"File Size:\",\n  \"File:\",\n  \"Fin&d...\\tCtrl+F\",\n  \"Find\",\n  \"Find Next\",\n  \"Find Previous\",\n  \"Find:\",\n  \"Fit &Content\\tCtrl+3\",\n  \"Fit &Page\\tCtrl+0\",\n  \"Fit &Width\\tCtrl+2\",\n  \"Fit Content\",\n  \"Fit Page\",\n  \"Fit Width\",\n  \"Fit Width and Show Pages Continuously\",\n  \"Fit a Single Page\",\n  \"Fonts:\",\n  \"Formatting the book... %d pages\",\n  \"Found text at page %s\",\n  \"Found text at page %s (again)\",\n  \"Frequently Read\",\n  \"GB\",\n  \"Go to page\",\n  \"Hide frequently read\",\n  \"Hint: Use the F3 key for finding again\",\n  \"Image files (*.%s)\",\n  \"KB\",\n  \"MB\",\n  \"Make SumatraPDF default application for PDF files?\",\n  \"Make SumatraPDF my default PDF reader\",\n  \"Man&ga Mode\",\n  \"Match Case\",\n  \"Mobi documents\",\n  \"Modified:\",\n  \"New version %s is available. Download new version?\",\n  \"Next Page\",\n  \"No matches were found\",\n  \"No result found around line %u in file %s\",\n  \"No synchronization file found\",\n  \"No synchronization info at this position\",\n  \"Number of Pages:\",\n  \"OK\",\n  \"Open\",\n  \"Open &in PDF-XChange\",\n  \"Open a document...\",\n  \"Open in %s\",\n  \"Open in &Adobe Reader\",\n  \"Open in &Foxit Reader\",\n  \"Open in &Microsoft HTML Help\",\n  \"Open in &Microsoft XPS-Viewer\",\n  \"P&roperties\",\n  \"P&roperties\\tCtrl+D\",\n  \"PDF Document\",\n  \"PDF Optimizations:\",\n  \"PDF Producer:\",\n  \"PDF Version:\",\n  \"PDF documents\",\n  \"Pa&ge...\\tCtrl+G\",\n  \"Page %s\",\n  \"Page Size:\",\n  \"Page number %u inexistant\",\n  \"Page scaling\",\n  \"Page:\",\n  \"PalmDoc documents\",\n  \"Please wait - rendering...\",\n  \"Postscript documents\",\n  \"Pr&esentation\\tF5\",\n  \"Previous Page\",\n  \"Print\",\n  \"Print range\",\n  \"Printer with given name doesn't exist\",\n  \"Printing in progress.\",\n  \"Printing is still in progress. Abort and quit?\",\n  \"Printing is still in progress. Abort and start over?\",\n  \"Printing page %d of %d...\",\n  \"Printing problem.\",\n  \"Re&name...\\tF2\",\n  \"Remember &opened files\",\n  \"Remove from favorites\",\n  \"Remove page %s from favorites\",\n  \"Rename To\",\n  \"Rotate &Left\\tCtrl+Shift+-\",\n  \"Rotate &Right\\tCtrl+Shift++\",\n  \"Save As\",\n  \"Save S&hortcut...\\tCtrl+Shift+S\",\n  \"Searching %d of %d...\",\n  \"Select &All\",\n  \"Select &All\\tCtrl+A\",\n  \"Select content with Ctrl+left mouse button\",\n  \"Selection:\",\n  \"Send by &E-mail...\",\n  \"Set inverse search command-line\",\n  \"Show &Bookmarks\",\n  \"Show &Pages Continuously\",\n  \"Show &Toolbar\",\n  \"Show Favorites\",\n  \"Show frequently read\",\n  \"Show the &bookmarks sidebar when available\",\n  \"Single Page\",\n  \"Sorry, that shouldn't have happened!\\n\\nPlease press 'Cancel', if you want to help us fix the cause of this crash.\",\n  \"Source file %s has no synchronization point\",\n  \"Subject:\",\n  \"SumatraPDF Options\",\n  \"SumatraPDF Update\",\n  \"SumatraPDF crashed\",\n  \"SumatraPDF is your default PDF reader\",\n  \"SumatraPDF should now be your default PDF reader\",\n  \"Synchronization file cannot be opened\",\n  \"Tagged PDF\",\n  \"Text documents\",\n  \"This document uses unsupported features (%s) and might not render properly\",\n  \"Title:\",\n  \"Unknown source file (%s)\",\n  \"Use &tabs\",\n  \"View\",\n  \"Visit &Website\",\n  \"Warning\",\n  \"XPS documents\",\n  \"You have the latest version.\",\n  \"You have version %s\",\n  \"Zoom\",\n  \"Zoom In\",\n  \"Zoom Out\",\n  \"Zoom factor\",\n  \"[Changes detected; refreshing] %s\",\n  \"copying text\",\n  \"printing document\"\n};\n\nconst char **GetOriginalStrings() { return &gOriginalStrings[0]; }\n\n\nconst char * gTranslations_sq = \n  \"&P\\303\\253r\\0\"\\\n  \"P\\303\\253rmasa &reale\\tCtrl+1\\0\"\\\n  \"Opsionet e &avancuara...\\0\"\\\n  \"&Gjith\\303\\253 faqet e p\\303\\253rzgjedhura\\0\"\\\n  \"&Prapa\\tAlt+Left Arrow\\0\"\\\n  \"&Lib\\303\\253r\\tCtrl+8\\0\"\\\n  \"&Mbyll\\tCtrl+W\\0\"\\\n  \"&Kopjoj materialin\\0\"\\\n  \"&Kopjoj materialin\\tCtrl+C\\0\"\\\n  \"&Mos pyet m\\303\\253\\0\"\\\n  \"Vet\\303\\253m faqet &\\303\\247ift\\0\"\\\n  \"&P\\303\\253rbri\\tCtrl+7\\0\"\\\n  \"&Skedar\\0\"\\\n  \"&Gjej \\303\\247far\\303\\253:\\0\"\\\n  \"&Faqja e par\\303\\253\\tHome\\0\"\\\n  \"&P\\303\\253rshtat faqet n\\303\\253 hap\\303\\253sir\\303\\253n e printuar\\0\"\\\n  \"&Shkoj te\\0\"\\\n  \"&Shkoj te faqja:\\0\"\\\n  \"&Ndihm\\303\\253\\0\"\\\n  \"&Faqja e fundit\\tEnd\\0\"\\\n  \"&Zmadhimi:\\0\"\\\n  \"&Manuali\\0\"\\\n  \"&Krahasoj shkronjat\\0\"\\\n  \"&Faqja tjet\\303\\253r\\tRight Arrow\\0\"\\\n  \"&Jo\\0\"\\\n  \"&Jo, faleminderit\\0\"\\\n  \"Vet\\303\\253m faqet &teke\\0\"\\\n  \"&Hap dokumentin\\0\"\\\n  \"&Hap...\\tCtrl+O\\0\"\\\n  \"&Opsionet...\\0\"\\\n  \"&Fjal\\303\\253kalimi:\\0\"\\\n  \"&Ngul dokumentin\\0\"\\\n  \"&Faqja e m\\303\\253parshme\\tLeft Arrow\\0\"\\\n  \"&Printoj...\\0\"\\\n  \"&Printoj...\\tCtrl+P\\0\"\\\n  \"&Printoj... (ndalohet)\\0\"\\\n  \"&Mbaj mend fjal\\303\\253kalimin p\\303\\253r k\\303\\253t\\303\\253 dokument\\0\"\\\n  \"&Mbaj mend parametrat p\\303\\253r \\303\\247do dokument\\0\"\\\n  \"&Heq dokumentin\\0\"\\\n  \"&Ruaj si...\\0\"\\\n  \"&Ruaj si...\\tCtrl+S\\0\"\\\n  \"&Parametrat\\0\"\\\n  \"&Ngjesh faqet n\\303\\253 hap\\303\\253sir\\303\\253n e printuar (sipas nevoj\\303\\253s)\\0\"\\\n  \"&Nj\\303\\253flet\\303\\253sh\\tCtrl+6\\0\"\\\n  \"&Shmang k\\303\\253t\\303\\253 versionin\\0\"\\\n  \"&P\\303\\253rdor p\\303\\253rmasat origjinale t\\303\\253 flet\\303\\253s\\0\"\\\n  \"&Pamje\\0\"\\\n  \"\\0\"\\\n  \"&Po\\0\"\\\n  \"&Shkalla\\0\"\\\n  \"(nga %d)\\0\"\\\n  \"(faqja %s)\\0\"\\\n  \"P\\303\\253r SumatraPDF\\0\"\\\n  \"Sh\\303\\253noj te p\\303\\253lqimet\\0\"\\\n  \"Sh\\303\\253noj faqen %s te p\\303\\253lqimet\\0\"\\\n  \"Mbani sh\\303\\253nim faqen %s n\\303\\253n emrin (fakultativ):\\0\"\\\n  \"Sh\\303\\253noj te p\\303\\253lqimet\\0\"\\\n  \"Avancuar\\0\"\\\n  \"T\\303\\253 gjitha skedat\\0\"\\\n  \"Dokumente t\\303\\253 garantuara\\0\"\\\n  \"Aplikacioni:\\0\"\\\n  \"Do e shoq\\303\\253roni me skedat PDF?\\0\"\\\n  \"Shtojca: %s\\0\"\\\n  \"Autori:\\0\"\\\n  \"Automatik\\0\"\\\n  \"Verifikoj automatikisht &azhurnimet\\0\"\\\n  \"Lib\\303\\253r\\0\"\\\n  \"Faqet e &shenjuara\\tF12\\0\"\\\n  \"Shkurtoret e shenjimit\\0\"\\\n  \"Shkurtorja e shenjimit p\\303\\253r faqet %s nga %s\\0\"\\\n  \"Faqet e shenjuara\\0\"\\\n  \"bajt\\0\"\\\n  \"Dokumente CHM\\0\"\\\n  \"Nuk mund t\\303\\253 lidhet n\\303\\253 internet (gabim %#x).\\0\"\\\n  \"Anuloj\\0\"\\\n  \"Nuk mund t\\303\\253 printoj\\303\\253 sked\\303\\253n\\0\"\\\n  \"Nuk mund t\\303\\253 k\\303\\253rkoj\\303\\253 mbrapsht. Ju lutemi, verifikoni komand\\303\\253n te parametrat.\\0\"\\\n  \"Ndryshoj gjuh\\303\\253n\\0\"\\\n  \"&Azhurnoj\\0\"\\\n  \"\\0\"\\\n  \"P\\303\\253rputhja\\0\"\\\n  \"Vazhdim\\303\\253si\\0\"\\\n  \"Lib\\303\\253r n\\303\\253 vazhdim\\303\\253si\\0\"\\\n  \"P\\303\\253rbri n\\303\\253 vazhdim\\303\\253si\\0\"\\\n  \"Kontribuoj n\\303\\253 p\\303\\253rkthim\\0\"\\\n  \"Kopjoj &figur\\303\\253n\\0\"\\\n  \"Kopjoj adres\\303\\253n e &lidh\\303\\253sit\\0\"\\\n  \"Kopjoj ko&mentin\\0\"\\\n  \"Ndalohet kopjimi i tekstit (kopjohet vet\\303\\253m si figur\\303\\253)\\0\"\\\n  \"Kopirajti:\\0\"\\\n  \"Nuk mund t\\303\\253 marr\\303\\253 vetit\\303\\253 e printerit\\0\"\\\n  \"Nuk mund t\\303\\253 v\\303\\253 n\\303\\253 pun\\303\\253 printerin\\0\"\\\n  \"Nuk mund t\\303\\253 radhit\\303\\253 faqen\\0\"\\\n  \"Krijuar m\\303\\253:\\0\"\\\n  \"Skeda aktuale\\0\"\\\n  \"\\0\"\\\n  \"&Shkalla e caktuar...\\tCtrl+Y\\0\"\\\n  \"&Faqosja standarde:\\0\"\\\n  \"&Shkalla standarde:\\0\"\\\n  \"Lexuesi standard i PDF-ve nuk mund t\\303\\253 ndryshoj\\303\\253 n\\303\\253 m\\303\\253nyr\\303\\253n portab\\303\\253l\\0\"\\\n  \"Nuk lejohet:\\0\"\\\n  \"Dokumente DjVu\\0\"\\\n  \"Vetit\\303\\253 e dokumentit\\0\"\\\n  \"Shkarkoj\\0\"\\\n  \"D&al\\tCtrl+Q\\0\"\\\n  \"Libra elektronik\\303\\253 EPUB\\0\"\\\n  \"Shkruani fjal\\303\\253kalimin\\0\"\\\n  \"Shkruani fjal\\303\\253kalimin p\\303\\253r %s\\0\"\\\n  \"Komanda q\\303\\253 jepet kur klikoni dy her\\303\\253 dokumentin PDF:\\0\"\\\n  \"Gabim n\\303\\253 hapjen e %s\\0\"\\\n  \"P&\\303\\253lqej\\0\"\\\n  \"P&\\303\\253rpara\\tAlt+Right Arrow\\0\"\\\n  \"Ekran i p&lot\\303\\253\\tCtrl+Shift+L\\0\"\\\n  \"P\\303\\253rbri\\0\"\\\n  \"D\\303\\253shtoi riem\\303\\253rtimi i sked\\303\\253s!\\0\"\\\n  \"D\\303\\253shtoi ruajtja e sked\\303\\253s\\0\"\\\n  \"Hapet shpejt n\\303\\253 internet\\0\"\\\n  \"P\\303\\253lqej\\0\"\\\n  \"Dokumente FictionBook\\0\"\\\n  \"Nuk gjen sked\\303\\253n %s\\0\"\\\n  \"Masa e sked\\303\\253s:\\0\"\\\n  \"Skeda:\\0\"\\\n  \"G&jej...\\tCtrl+F\\0\"\\\n  \"Gjej\\0\"\\\n  \"Gjej p\\303\\253rpara\\0\"\\\n  \"Gjej prapa\\0\"\\\n  \"Gjej:\\0\"\\\n  \"P\\303\\253rshtat &materialin\\tCtrl+3\\0\"\\\n  \"P\\303\\253rshtat &faqen\\tCtrl+0\\0\"\\\n  \"P\\303\\253rshtat &gjer\\303\\253sin\\303\\253\\tCtrl+2\\0\"\\\n  \"P\\303\\253rshtat materialin\\0\"\\\n  \"P\\303\\253rshtat faqen\\0\"\\\n  \"P\\303\\253rshtat gjer\\303\\253sin\\303\\253\\0\"\\\n  \"P\\303\\253rshtat gjer\\303\\253sin\\303\\253 dhe tregoj faqet n\\303\\253 vazhdim\\303\\253si\\0\"\\\n  \"P\\303\\253rshtat n\\303\\253 nj\\303\\253flet\\303\\253sh\\0\"\\\n  \"Fonte:\\0\"\\\n  \"Formaton librin... %d faqe\\0\"\\\n  \"Gjen tekstin n\\303\\253 faqen %s\\0\"\\\n  \"Gjen tekstin n\\303\\253 faqen %s (p\\303\\253rs\\303\\253ri)\\0\"\\\n  \"Lexime t\\303\\253 shpeshta\\0\"\\\n  \"\\0\"\\\n  \"Shkoj te faqja\\0\"\\\n  \"Fsheh leximet e shpeshta\\0\"\\\n  \"K\\303\\253shill\\303\\253: P\\303\\253rdorni tastin F3 p\\303\\253r gjetjen e radh\\303\\253s\\0\"\\\n  \"Figura (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"SumatraPDF t\\303\\253 jet\\303\\253 aplikacioni standard p\\303\\253r skedat PDF?\\0\"\\\n  \"SumatraPDF t\\303\\253 jet\\303\\253 lexuesi standard i PDF-ve\\0\"\\\n  \"M\\303\\253nyra Man&ga\\0\"\\\n  \"Krahasoj madh\\303\\253sin\\303\\253 e shkrimit\\0\"\\\n  \"Dokumente Mobi\\0\"\\\n  \"Modifikuar m\\303\\253:\\0\"\\\n  \"Ka dal\\303\\253 versioni i ri %s. Do e shkarkoni?\\0\"\\\n  \"Faqja tjet\\303\\253r\\0\"\\\n  \"Nuk ka ngjashm\\303\\253ri\\0\"\\\n  \"Pa rezultat n\\303\\253 radh\\303\\253n %u te skeda %s\\0\"\\\n  \"Nuk gjen sked\\303\\253n e sinkronizimit\\0\"\\\n  \"Nuk ka info p\\303\\253r sinkronizimin n\\303\\253 k\\303\\253t\\303\\253 pozicion\\0\"\\\n  \"Numri i faqeve:\\0\"\\\n  \"\\0\"\\\n  \"Hap\\0\"\\\n  \"Hap &n\\303\\253 PDF-XChange\\0\"\\\n  \"Hap nj\\303\\253 dokument...\\0\"\\\n  \"Hap n\\303\\253 %s\\0\"\\\n  \"Hap n\\303\\253 &Adobe Reader\\0\"\\\n  \"Hap n\\303\\253 &Foxit Reader\\0\"\\\n  \"Hap n\\303\\253 &Microsoft HTML Help\\0\"\\\n  \"Hap n\\303\\253 &Microsoft XPS-Viewer\\0\"\\\n  \"V&eti\\0\"\\\n  \"V&eti\\tCtrl+D\\0\"\\\n  \"Dokument PDF\\0\"\\\n  \"PDF optimizimet:\\0\"\\\n  \"PDF prodhuesi:\\0\"\\\n  \"PDF versioni:\\0\"\\\n  \"Dokumente PDF\\0\"\\\n  \"Fa&qja...\\tCtrl+G\\0\"\\\n  \"Faqja %s\\0\"\\\n  \"P\\303\\253rmasat:\\0\"\\\n  \"Nuk ekziston numri i faqes %u\\0\"\\\n  \"Shkalla e flet\\303\\253s\\0\"\\\n  \"Faqja:\\0\"\\\n  \"\\0\"\\\n  \"Ju lutemi, prisni - radhitet...\\0\"\\\n  \"Dokumente Postscript\\0\"\\\n  \"Pr&ezantim\\tCtrl+L\\0\"\\\n  \"Faqja e m\\303\\253parshme\\0\"\\\n  \"Printoj\\0\"\\\n  \"Kufiri i printimit\\0\"\\\n  \"Nuk ekziston printeri me k\\303\\253t\\303\\253 em\\303\\253r\\0\"\\\n  \"Printimi vijon.\\0\"\\\n  \"Printimi vijon. Do e nd\\303\\253rprisni dhe e pezulloni?\\0\"\\\n  \"Printimi vijon. Do e nd\\303\\253rprisni dhe e filloni nga e para?\\0\"\\\n  \"Printon faqen %d nga %d...\\0\"\\\n  \"Problem n\\303\\253 printim.\\0\"\\\n  \"Rie&m\\303\\253rtoj...\\tF2\\0\"\\\n  \"Mbaj mend skedat e &hapura\\0\"\\\n  \"Heq nga p\\303\\253lqimet\\0\"\\\n  \"Heq faqen %s nga p\\303\\253lqimet\\0\"\\\n  \"Riem\\303\\253rtoj si\\0\"\\\n  \"Kthej &majtas\\tCtrl+Shift+-\\0\"\\\n  \"Kthej &djathtas\\tCtrl+Shift++\\0\"\\\n  \"Ruaj si\\0\"\\\n  \"&Ruaj s&hkurtoren...\\tCtrl+Shift+S\\0\"\\\n  \"K\\303\\253rkon %d nga %d...\\0\"\\\n  \"Seleksionoj t\\303\\253 &gjith\\303\\253\\0\"\\\n  \"Seleksionoj t\\303\\253 &gjith\\303\\253\\tCtrl+A\\0\"\\\n  \"Seleksiononi materialin me Ctrl+butonin e majt\\303\\253 t\\303\\253 mausit\\0\"\\\n  \"\\0\"\\\n  \"D\\303\\253rgoj me &e-mail...\\0\"\\\n  \"Jepni komand\\303\\253n e k\\303\\253rkimit mbrapsht\\0\"\\\n  \"Tregoj &faqet e shenjuara\\0\"\\\n  \"Tregoj &faqet n\\303\\253 vazhdim\\303\\253si\\0\"\\\n  \"Tregoj &brezin e mjeteve\\0\"\\\n  \"Tregoj p\\303\\253lqimet\\0\"\\\n  \"Tregoj leximet e shpeshta\\0\"\\\n  \"Tregoj &faqet e shenjuara kur jan\\303\\253 t\\303\\253 gatshme\\0\"\\\n  \"Nj\\303\\253flet\\303\\253sh\\0\"\\\n  \"Na falni, kjo nuk duhej t\\303\\253 ndodhte!\\n\\nJu lutemi, shtypni 'Anuloj' po desh\\303\\253t t\\303\\253 na ndihmoni q\\303\\253 ta ndreqim gabimin.\\0\"\\\n  \"Skeda burimore %s nuk ka pik\\303\\253 sinkronizimi\\0\"\\\n  \"Tema:\\0\"\\\n  \"SumatraPDF opsionet\\0\"\\\n  \"SumatraPDF azhurnimi\\0\"\\\n  \"SumatraPDF ngeci\\0\"\\\n  \"SumatraPDF \\303\\253sht\\303\\253 lexuesi standard i PDF-ve\\0\"\\\n  \"SumatraPDF tani do t\\303\\253 jet\\303\\253 lexuesi standard i PDF-ve\\0\"\\\n  \"Nuk hapet skeda e sinkronizimit\\0\"\\\n  \"PDF me etiketa\\0\"\\\n  \"Dokumente tekst\\0\"\\\n  \"\\0\"\\\n  \"Titulli:\\0\"\\\n  \"Sked\\303\\253 burimore e panjohur (%s)\\0\"\\\n  \"\\0\"\\\n  \"Pamje\\0\"\\\n  \"SumatraPDF n\\303\\253 &internet\\0\"\\\n  \"Kujdes\\0\"\\\n  \"Dokumente XPS\\0\"\\\n  \"Keni versionin e fundit.\\0\"\\\n  \"Keni versionin %s\\0\"\\\n  \"P\\303\\253rshtat\\0\"\\\n  \"Zmadhoj\\0\"\\\n  \"Zvog\\303\\253loj\\0\"\\\n  \"Koeficienti i zmadhimit\\0\"\\\n  \"[Dikton ndryshimet; freskon] %s\\0\"\\\n  \"kopjimi i tekstit\\0\"\\\n  \"printimi i dokumentit\\0\";\n\nconst char * gTranslations_ar = \n  \"\\330\\255\\331\\210\\331\\204& \\0\"\\\n  \"\\330\\247\\331\\204\\330\\255\\330\\254\\331\\205 &\\330\\247\\331\\204\\330\\255\\331\\202\\331\\212\\331\\202\\331\\212\\tCtrl+1\\0\"\\\n  \"\\330\\256\\331\\212\\330\\247\\330\\261\\330\\247\\330\\252 &\\331\\205\\330\\252\\331\\202\\330\\257\\331\\205\\330\\251\\0\"\\\n  \"\\331\\203\\331\\204 \\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\255\\330\\257\\330\\257\\330\\251&\\0\"\\\n  \"\\331\\204\\331\\204\\330\\256\\331\\204\\331\\201&\\tAlt+Left Arrow\\0\"\\\n  \"\\330\\271\\330\\261\\330\\266 &\\330\\247\\331\\204\\331\\203\\330\\252\\330\\247\\330\\250\\0\"\\\n  \"&\\330\\247\\330\\272\\331\\204\\330\\247\\331\\202\\tCtrl+W\\0\"\\\n  \"\\331\\206\\330\\263\\330\\256 \\330\\247\\331\\204\\331\\205\\330\\255\\330\\257\\330\\257&\\0\"\\\n  \"\\331\\206\\330\\263\\330\\256 \\330\\247\\331\\204\\331\\205\\330\\255\\330\\257\\330\\257&\\tCtrl+C\\0\"\\\n  \"\\331\\204\\330\\247 \\330\\252\\330\\263\\330\\243\\331\\204\\331\\206\\331\\212 \\331\\205\\330\\261\\330\\251\\331\\213 \\330\\243\\330\\256\\330\\261\\331\\211&\\0\"\\\n  \"\\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\247\\330\\252 &\\330\\247\\331\\204\\330\\262\\331\\210\\330\\254\\331\\212\\330\\251 \\331\\201\\331\\202\\330\\267\\0\"\\\n  \"\\331\\205\\330\\252\\331\\202\\330\\247\\330\\250\\331\\204\\330\\252\\330\\247\\331\\206&\\tCtrl+7\\0\"\\\n  \"\\331\\205\\331\\204\\331\\201&\\0\"\\\n  \"\\330\\247\\330\\250\\330\\255\\330\\253 \\330\\271\\331\\206&:\\0\"\\\n  \"\\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\251 &\\330\\247\\331\\204\\330\\243\\331\\210\\331\\204\\331\\211\\tHome\\0\"\\\n  \"&\\331\\205\\331\\204\\330\\247\\330\\246\\331\\205\\330\\251 \\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\247\\330\\252 \\331\\204\\331\\205\\331\\206\\330\\267\\331\\202\\330\\251 \\330\\247\\331\\204\\330\\267\\330\\250\\330\\247\\330\\271\\330\\251\\0\"\\\n  \"\\330\\247\\331\\206\\330\\252\\331\\202\\331\\204 \\330\\247\\331\\204\\331\\211&\\0\"\\\n  \"\\330\\247\\331\\206\\330\\252\\331\\202\\331\\204 \\330\\245\\331\\204\\331\\211 \\330\\265\\331\\201\\330\\255\\330\\251&\\0\"\\\n  \"\\330\\247\\331\\204\\330\\252\\330\\271\\331\\204\\331\\212\\331\\205\\330\\247\\330\\252&\\0\"\\\n  \"\\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\251 &\\330\\247\\331\\204\\330\\243\\330\\256\\331\\212\\330\\261\\330\\251\\tEnd\\0\"\\\n  \"&\\330\\247\\331\\204\\330\\252\\331\\203\\330\\250\\331\\212\\330\\261\\0\"\\\n  \"&\\330\\247\\331\\204\\330\\252\\330\\271\\331\\204\\331\\212\\331\\205\\330\\247\\330\\252\\0\"\\\n  \"\\331\\205\\330\\267\\330\\247\\330\\250\\331\\202\\330\\251 \\330\\255\\330\\247\\331\\204\\330\\251 \\330\\247\\331\\204\\330\\243\\330\\255\\330\\261\\331\\201& \\0\"\\\n  \"\\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\251 &\\330\\247\\331\\204\\330\\252\\330\\247\\331\\204\\331\\212\\330\\251\\t->\\0\"\\\n  \"\\331\\204\\330\\247&\\0\"\\\n  \"\\331\\204\\330\\247 \\330\\214 \\330\\264\\331\\203\\330\\261&\\0\"\\\n  \"&\\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\201\\330\\261\\330\\257\\331\\212\\330\\251 \\331\\201\\331\\202\\330\\267\\0\"\\\n  \"\\331\\201\\330\\252\\330\\255 \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257&\\0\"\\\n  \"&\\331\\201\\330\\252\\330\\255...\\tCtrl+O\\0\"\\\n  \"&\\330\\256\\331\\212\\330\\247\\330\\261\\330\\247\\330\\252...\\0\"\\\n  \"\\331\\203\\331\\204\\331\\205\\330\\251 \\330\\247\\331\\204\\330\\263\\330\\261&:\\0\"\\\n  \"&\\330\\253\\330\\250\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\0\"\\\n  \"\\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\251 &\\330\\247\\331\\204\\330\\263\\330\\247\\330\\250\\331\\202\\330\\251\\tLeft Arrow\\0\"\\\n  \"&\\330\\267\\330\\250\\330\\247\\330\\271\\330\\251...\\0\"\\\n  \"&\\330\\267\\330\\250\\330\\247\\330\\271\\330\\251...\\tCtrl+P\\0\"\\\n  \"&\\330\\252\\331\\205 \\330\\261\\331\\201\\330\\266 \\330\\247\\331\\204\\330\\267\\330\\250\\330\\247\\330\\271\\330\\251\\0\"\\\n  \"&\\330\\255\\331\\201\\330\\270 \\331\\203\\331\\204\\331\\205\\330\\251 \\330\\247\\331\\204\\330\\263\\330\\261 \\331\\204\\331\\207\\330\\260\\330\\247 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\0\"\\\n  \"&\\330\\252\\330\\260\\331\\203\\330\\261 \\331\\207\\330\\260\\331\\207 \\330\\247\\331\\204\\330\\245\\330\\271\\330\\257\\330\\247\\330\\257\\330\\247\\330\\252 \\331\\204\\331\\203\\331\\204 \\331\\210\\330\\253\\331\\212\\331\\202\\330\\251\\0\"\\\n  \"&\\330\\245\\330\\262\\330\\247\\331\\204\\330\\251 \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\0\"\\\n  \"&\\330\\255\\331\\201\\330\\270 \\330\\250\\330\\247\\330\\263\\331\\205...\\0\"\\\n  \"&\\330\\255\\331\\201\\330\\270 \\330\\250\\330\\247\\330\\263\\331\\205...\\tCtrl+S\\0\"\\\n  \"&\\330\\247\\331\\204\\330\\245\\330\\271\\330\\257\\330\\247\\330\\257\\330\\247\\330\\252\\0\"\\\n  \"(\\330\\252\\331\\202\\331\\204\\331\\212\\330\\265 \\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\247\\330\\252 \\330\\245\\331\\204\\331\\211 \\331\\205\\331\\206\\330\\267\\331\\202\\330\\251 \\331\\202\\330\\247\\330\\250\\331\\204\\330\\251 \\331\\204\\331\\204\\330\\267\\330\\250\\330\\247\\330\\271\\330\\251 (\\330\\245\\330\\260\\330\\247 \\331\\204\\330\\262\\331\\205 \\330\\247\\331\\204\\330\\243\\331\\205\\330\\261& \\0\"\\\n  \"&\\330\\265\\331\\201\\330\\255\\330\\251 \\331\\210\\330\\247\\330\\255\\330\\257\\330\\251\\tCtrl+6\\0\"\\\n  \"&\\330\\252\\330\\256\\330\\267\\331\\212 \\331\\207\\330\\260\\330\\247 \\330\\247\\331\\204\\330\\245\\330\\265\\330\\257\\330\\247\\330\\261\\0\"\\\n  \"&\\330\\247\\330\\263\\330\\252\\330\\256\\330\\257\\330\\247\\331\\205 \\330\\247\\331\\204\\330\\255\\330\\254\\331\\205 \\330\\247\\331\\204\\330\\243\\330\\265\\331\\204\\331\\212 \\331\\204\\331\\204\\330\\265\\331\\201\\330\\255\\330\\251\\0\"\\\n  \"&\\330\\247\\331\\204\\330\\271\\330\\261\\330\\266\\0\"\\\n  \"\\330\\247\\331\\204\\331\\206\\330\\247\\331\\201\\330\\260\\330\\251&\\0\"\\\n  \"&\\331\\206\\330\\271\\331\\205\\0\"\\\n  \" \\330\\252\\331\\203\\330\\250\\331\\212\\330\\261/\\330\\252\\330\\265\\330\\272\\331\\212\\330\\261&\\0\"\\\n  \"(\\331\\205\\331\\206 %d)\\0\"\\\n  \"(\\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\251 %s)\\0\"\\\n  \"\\330\\255\\331\\210\\331\\204 SumatraPDF\\0\"\\\n  \"\\330\\247\\330\\266\\330\\247\\331\\201\\330\\251 \\331\\204\\331\\204\\331\\205\\331\\201\\330\\266\\331\\204\\330\\251\\0\"\\\n  \"\\330\\247\\331\\204\\331\\211 \\330\\247\\331\\204\\331\\205\\331\\201\\330\\266\\331\\204\\330\\251 %s \\330\\247\\330\\266\\330\\247\\331\\201\\330\\251 \\330\\265\\331\\201\\330\\255\\330\\251\\0\"\\\n  \"(\\330\\247\\331\\204\\331\\211 \\330\\247\\331\\204\\331\\205\\331\\201\\330\\266\\331\\204\\330\\251 \\331\\205\\330\\271  \\330\\247\\330\\263\\331\\205 (\\330\\245\\330\\256\\330\\252\\331\\212\\330\\247\\330\\261\\331\\212 %s \\330\\247\\330\\266\\330\\247\\331\\201\\330\\251 \\330\\265\\331\\201\\330\\255\\330\\251:\\0\"\\\n  \"\\330\\247\\330\\266\\330\\247\\331\\201\\330\\251 \\331\\204\\331\\204\\331\\205\\331\\201\\330\\266\\331\\204\\330\\251\\0\"\\\n  \"\\331\\205\\330\\252\\331\\202\\330\\257\\331\\205\\0\"\\\n  \"\\331\\203\\331\\204 \\330\\247\\331\\204\\331\\205\\331\\204\\331\\201\\330\\247\\330\\252\\0\"\\\n  \"\\331\\203\\331\\204 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\257\\330\\271\\331\\210\\331\\205\\330\\251\\0\"\\\n  \"\\330\\247\\331\\204\\330\\252\\330\\267\\330\\250\\331\\212\\331\\202\\0\"\\\n  \"\\330\\247\\330\\261\\330\\252\\330\\250\\330\\267 \\330\\250\\331\\205\\331\\204\\331\\201\\330\\247\\330\\252 \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251 \\330\\237\\0\"\\\n  \"%s:\\331\\205\\330\\261\\331\\201\\331\\202\\0\"\\\n  \"\\330\\247\\331\\204\\331\\205\\330\\244\\331\\204\\331\\201\\0\"\\\n  \"\\330\\242\\331\\204\\331\\212\\0\"\\\n  \"\\330\\247\\331\\204\\330\\252\\330\\255\\331\\202\\331\\202 \\330\\252\\331\\204\\331\\202\\330\\247\\330\\246\\331\\212\\330\\247\\331\\213  \\331\\205\\331\\206 \\331\\210\\330\\254\\331\\210\\330\\257 &\\330\\252\\330\\255\\330\\257\\331\\212\\330\\253\\330\\247\\330\\252\\0\"\\\n  \"\\330\\271\\330\\261\\330\\266 \\330\\247\\331\\204\\331\\203\\330\\252\\330\\247\\330\\250\\0\"\\\n  \"\\330\\247\\331\\204\\330\\271\\331\\204\\330\\247\\331\\205\\330\\247\\330\\252\\tF12\\0\"\\\n  \"\\330\\247\\330\\256\\330\\252\\330\\265\\330\\247\\330\\261\\330\\247\\330\\252 \\331\\202\\330\\247\\330\\246\\331\\205\\330\\251 \\330\\247\\331\\204\\330\\271\\331\\206\\330\\247\\331\\210\\331\\212\\331\\206\\0\"\\\n  \"%s \\331\\205\\331\\206 %s \\330\\247\\330\\256\\330\\252\\330\\265\\330\\247\\330\\261 \\331\\202\\330\\247\\330\\246\\331\\205\\330\\251 \\330\\247\\331\\204\\330\\271\\331\\206\\330\\247\\331\\210\\331\\212\\331\\206 \\330\\247\\331\\204\\331\\211 \\330\\265\\331\\201\\330\\255\\330\\251\\0\"\\\n  \"\\331\\202\\330\\247\\330\\246\\331\\205\\330\\251 \\330\\247\\331\\204\\330\\271\\331\\206\\330\\247\\331\\210\\331\\212\\331\\206\\0\"\\\n  \"\\330\\250\\330\\247\\331\\212\\330\\252\\0\"\\\n  \"CHM \\331\\205\\331\\204\\331\\201\\330\\247\\330\\252 \\0\"\\\n  \"\\331\\204\\331\\205 \\331\\212\\330\\252\\331\\205 \\330\\247\\331\\204\\330\\252\\331\\205\\331\\203\\331\\206 \\331\\205\\331\\206 \\330\\247\\331\\204\\330\\245\\330\\252\\330\\265\\330\\247\\331\\204 \\330\\250\\330\\247\\331\\204\\330\\245\\331\\206\\330\\252\\330\\261\\331\\206\\330\\252 (%#x \\330\\256\\330\\267\\330\\243).\\0\"\\\n  \"\\330\\247\\331\\204\\330\\272\\330\\247\\330\\241 \\330\\247\\331\\204\\330\\247\\331\\205\\330\\261\\0\"\\\n  \"\\331\\204\\330\\247\\331\\212\\331\\205\\331\\203\\331\\206 \\330\\267\\330\\250\\330\\247\\330\\271\\330\\251 \\331\\207\\330\\260\\330\\247 \\330\\247\\331\\204\\331\\205\\331\\204\\331\\201\\0\"\\\n  \"\\331\\204\\330\\247 \\331\\212\\331\\205\\331\\203\\331\\206 \\330\\250\\330\\257\\330\\241 \\330\\252\\330\\264\\330\\272\\331\\212\\331\\204 \\330\\247\\331\\204\\330\\243\\331\\205\\330\\261 \\330\\250\\330\\255\\330\\253 \\330\\271\\331\\203\\330\\263\\331\\212. \\330\\247\\331\\204\\330\\261\\330\\254\\330\\247\\330\\241 \\330\\247\\331\\204\\330\\252\\330\\255\\331\\202\\331\\202 \\331\\205\\331\\206 \\330\\263\\330\\267\\330\\261 \\330\\247\\331\\204\\330\\243\\331\\210\\330\\247\\331\\205\\330\\261 \\331\\201\\331\\212 \\330\\247\\331\\204\\330\\245\\330\\271\\330\\257\\330\\247\\330\\257\\330\\247\\330\\252\\0\"\\\n  \"\\330\\252\\330\\272\\331\\212\\331\\212\\330\\261 \\330\\247\\331\\204\\331\\204\\330\\272\\330\\251 \\0\"\\\n  \"\\330\\252\\330\\255\\331\\202\\331\\202 \\331\\205\\331\\206 \\331\\210\\330\\254\\331\\210\\330\\257 &\\330\\252\\330\\255\\330\\257\\331\\212\\330\\253\\330\\247\\330\\252\\0\"\\\n  \"\\330\\247\\331\\204\\331\\203\\330\\252\\330\\250 \\330\\247\\331\\204\\331\\207\\330\\262\\331\\204\\331\\212\\330\\251\\0\"\\\n  \"\\330\\247\\331\\204\\330\\252\\331\\210\\330\\247\\331\\201\\331\\202\\0\"\\\n  \"\\331\\205\\330\\263\\330\\252\\331\\205\\330\\261\\0\"\\\n  \"\\330\\271\\330\\261\\330\\266 \\331\\205\\330\\263\\330\\252\\331\\205\\330\\261 \\331\\204\\331\\204\\331\\203\\330\\252\\330\\247\\330\\250\\0\"\\\n  \"\\330\\247\\331\\204\\331\\205\\331\\210\\330\\247\\330\\254\\331\\207\\330\\251 \\331\\205\\330\\263\\330\\252\\331\\205\\330\\261\\330\\251\\0\"\\\n  \"\\330\\263\\330\\247\\331\\207\\331\\205 \\330\\250\\330\\247\\331\\204\\330\\252\\330\\261\\330\\254\\331\\205\\330\\251\\0\"\\\n  \"\\331\\206\\330\\263\\330\\256 &\\330\\247\\331\\204\\330\\265\\331\\210\\330\\261\\330\\251\\0\"\\\n  \"\\331\\206\\330\\263\\330\\256 &\\330\\261\\330\\247\\330\\250\\330\\267 \\330\\247\\331\\204\\330\\271\\331\\206\\331\\210\\330\\247\\331\\206\\0\"\\\n  \"\\331\\206\\330\\263\\330\\256 \\330\\247\\331\\204&\\330\\252\\330\\271\\331\\204\\331\\212\\331\\202  \\0\"\\\n  \"(\\331\\206\\330\\247\\330\\263\\330\\256 \\330\\247\\331\\204\\331\\206\\330\\265 \\330\\261\\331\\201\\330\\266 (\\331\\206\\330\\247\\330\\263\\330\\256 \\330\\250\\330\\247\\330\\263\\331\\205 \\330\\265\\331\\210\\330\\261\\330\\251 \\331\\201\\331\\202\\330\\267 \\0\"\\\n  \"\\330\\255\\331\\202\\331\\210\\331\\202 \\330\\247\\331\\204\\330\\267\\330\\250\\330\\271 \\331\\205\\330\\255\\331\\201\\331\\210\\330\\270\\330\\251:\\0\"\\\n  \"\\330\\252\\330\\271\\330\\260\\330\\261 \\330\\247\\331\\204\\330\\255\\330\\265\\331\\210\\331\\204 \\330\\271\\331\\204\\331\\211 \\330\\256\\330\\265\\330\\247\\330\\246\\330\\265 \\330\\247\\331\\204\\330\\267\\330\\247\\330\\250\\330\\271\\330\\251\\0\"\\\n  \"\\331\\204\\330\\247 \\331\\212\\331\\205\\331\\203\\331\\206 \\330\\252\\330\\264\\330\\272\\331\\212\\331\\204 \\330\\247\\331\\204\\330\\267\\330\\247\\330\\250\\330\\271\\330\\251\\0\"\\\n  \"\\331\\204\\330\\247 \\331\\212\\330\\263\\330\\252\\330\\267\\331\\212\\330\\271 \\330\\243\\331\\206 \\331\\212\\330\\271\\331\\212\\330\\257 \\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\251\\0\"\\\n  \"\\331\\205\\331\\206\\330\\264\\330\\247\\330\\241\\0\"\\\n  \"\\330\\247\\331\\204\\331\\205\\331\\204\\331\\201 \\330\\247\\331\\204\\330\\255\\330\\247\\331\\204\\331\\212\\0\"\\\n  \"\\331\\205\\331\\210\\331\\202\\330\\271 \\330\\247\\331\\204\\331\\205\\330\\244\\330\\264\\330\\261\\330\\251:\\0\"\\\n  \"\\330\\252\\331\\203\\330\\250\\331\\212\\330\\261 \\331\\205\\330\\256\\330\\265\\330\\265&\\tCtrl+Y\\0\"\\\n  \"\\330\\247\\331\\204\\330\\252\\330\\256\\330\\267\\331\\212\\330\\267 \\330\\247\\331\\204\\330\\247\\331\\201\\330\\252\\330\\261\\330\\247\\330\\266\\331\\212&\\0\"\\\n  \"\\330\\247\\331\\204\\330\\252\\331\\203\\330\\250\\331\\212\\330\\261 \\330\\247\\331\\204\\330\\247\\331\\201\\330\\252\\330\\261\\330\\247\\330\\266\\331\\212&:\\0\"\\\n  \"\\331\\204\\330\\247 \\331\\212\\331\\205\\331\\203\\331\\206 \\330\\252\\330\\272\\331\\212\\331\\212\\330\\261 \\331\\202\\330\\247\\330\\261\\330\\246 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251 \\330\\247\\331\\204\\330\\247\\331\\201\\330\\252\\330\\261\\330\\247\\330\\266\\331\\212\\330\\251 \\331\\201\\331\\212 \\331\\210\\330\\266\\330\\271 \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204 \\0\"\\\n  \"\\330\\261\\331\\201\\330\\266 \\330\\247\\331\\204\\330\\243\\330\\260\\331\\210\\331\\206\\330\\247\\330\\252:\\0\"\\\n  \"DjVu  \\331\\210\\330\\253\\330\\247\\330\\246\\331\\202\\0\"\\\n  \"\\330\\256\\330\\265\\330\\247\\330\\246\\330\\265 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\0\"\\\n  \"\\330\\252\\330\\255\\331\\205\\331\\212\\331\\204\\0\"\\\n  \"\\330\\256\\330\\261\\331\\210\\330\\254\\tCtrl+Q\\0\"\\\n  \"EPUB \\331\\203\\330\\252\\330\\250 \\330\\247\\331\\204\\331\\203\\330\\252\\330\\261\\331\\210\\331\\206\\331\\212\\330\\251\\0\"\\\n  \"\\330\\247\\330\\257\\330\\256\\331\\204 \\331\\203\\331\\204\\331\\205\\330\\251 \\330\\247\\331\\204\\330\\263\\330\\261\\0\"\\\n  \"%s \\330\\247\\330\\257\\330\\256\\331\\204 \\331\\203\\331\\204\\331\\205\\330\\251 \\330\\263\\330\\261 \\331\\204\\0\"\\\n  \"\\330\\247\\330\\257\\330\\256\\331\\204 \\330\\263\\330\\267\\330\\261 \\330\\247\\331\\204\\330\\247\\331\\210\\330\\247\\331\\205\\330\\261 \\331\\204\\331\\204\\330\\247\\330\\263\\330\\252\\330\\257\\330\\271\\330\\247\\330\\241 \\330\\271\\331\\206\\330\\257 \\330\\247\\331\\204\\331\\206\\331\\202\\330\\261 \\330\\247\\331\\204\\331\\205\\330\\262\\330\\257\\331\\210\\330\\254 \\331\\201\\331\\210\\331\\202 \\331\\210\\330\\253\\331\\212\\331\\202\\330\\251 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251\\0\"\\\n  \"%s \\330\\256\\330\\267\\330\\243 \\331\\201\\331\\212 \\330\\247\\331\\204\\330\\252\\330\\255\\331\\205\\331\\212\\331\\204  \\0\"\\\n  \"\\330\\247\\331\\204\\331\\205\\331\\201\\330\\266\\331\\204\\330\\251\\0\"\\\n  \"\\331\\204&\\331\\204\\330\\247\\331\\205\\330\\247\\331\\205\\tAlt+Right Arrow\\0\"\\\n  \"\\331\\205\\331\\204\\330\\241 \\330\\247\\331\\204\\330\\264\\330\\247\\330\\264\\330\\251 \\tF11 \\0\"\\\n  \"\\331\\205\\330\\252\\331\\202\\330\\247\\330\\250\\331\\204\\330\\252\\330\\247\\331\\206\\0\"\\\n  \"\\331\\201\\330\\264\\331\\204 \\331\\201\\331\\212 \\330\\245\\330\\271\\330\\247\\330\\257\\330\\251 \\330\\252\\330\\263\\331\\205\\331\\212\\330\\251 \\330\\247\\331\\204\\331\\205\\331\\204\\331\\201!\\0\"\\\n  \"\\331\\201\\330\\264\\331\\204 \\331\\201\\331\\212 \\330\\255\\331\\201\\330\\270 \\330\\247\\331\\204\\331\\205\\331\\204\\331\\201\\0\"\\\n  \"\\330\\271\\330\\261\\330\\266 \\330\\263\\330\\261\\331\\212\\330\\271 \\330\\271\\331\\204\\331\\211 \\330\\247\\331\\204\\331\\210\\331\\212\\330\\250\\0\"\\\n  \"\\330\\247\\331\\204\\331\\205\\331\\201\\330\\266\\331\\204\\330\\251\\0\"\\\n  \"\\331\\210\\330\\253\\330\\247\\330\\246\\331\\202 \\331\\203\\330\\252\\330\\247\\330\\250 \\330\\247\\331\\204\\330\\256\\331\\212\\330\\247\\331\\204\\0\"\\\n  \"\\330\\247\\331\\204\\331\\205\\331\\204\\331\\201 %s \\330\\272\\331\\212\\330\\261 \\331\\205\\331\\210\\330\\254\\331\\210\\330\\257\\0\"\\\n  \"\\330\\255\\330\\254\\331\\205 \\330\\247\\331\\204\\331\\205\\331\\204\\331\\201\\0\"\\\n  \"\\331\\205\\331\\204\\331\\201\\0\"\\\n  \"\\330\\250\\330\\255&\\330\\253...\\tCtrl+F\\0\"\\\n  \"\\330\\250\\330\\255\\330\\253\\0\"\\\n  \"\\330\\250\\330\\255\\330\\253 \\330\\271\\331\\206 \\330\\247\\331\\204\\330\\252\\330\\247\\331\\204\\331\\212\\0\"\\\n  \"\\330\\247\\331\\204\\330\\250\\330\\255\\330\\253 \\330\\271\\331\\206 \\330\\247\\331\\204\\330\\263\\330\\247\\330\\250\\331\\202\\0\"\\\n  \"\\330\\250\\330\\255\\330\\253\\0\"\\\n  \"\\331\\205\\331\\204\\330\\247\\330\\246\\331\\205\\330\\251 \\330\\247\\331\\204\\331\\205\\330\\255\\330\\252\\331\\210\\331\\211  \\tCtrl+3\\0\"\\\n  \"\\331\\205\\331\\204\\330\\247\\330\\246\\331\\205\\330\\251 &\\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\251 \\tCtrl+0\\0\"\\\n  \"\\331\\205\\331\\204\\330\\247\\330\\246\\331\\205\\330\\251 &\\330\\247\\331\\204\\330\\271\\330\\261\\330\\266 \\tCtrl+2\\0\"\\\n  \"\\331\\205\\331\\204\\330\\247\\330\\246\\331\\205\\330\\251 \\330\\247\\331\\204\\331\\205\\330\\255\\330\\252\\331\\210\\331\\211\\0\"\\\n  \"\\331\\205\\331\\204\\330\\247\\330\\246\\331\\205\\330\\251 \\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\251\\0\"\\\n  \"\\331\\205\\331\\204\\330\\247\\330\\246\\331\\205\\330\\251 \\330\\247\\331\\204\\330\\271\\330\\261\\330\\266 \\0\"\\\n  \"\\331\\205\\331\\204\\330\\247\\330\\246\\331\\205\\330\\251 \\330\\247\\331\\204\\330\\271\\330\\261\\330\\266 \\331\\210\\330\\247\\330\\270\\331\\207\\330\\247\\330\\261 \\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\247\\330\\252 \\330\\250\\330\\247\\330\\263\\330\\252\\331\\205\\330\\261\\330\\247\\330\\261\\0\"\\\n  \"\\331\\205\\331\\204\\330\\247\\330\\246\\331\\205\\330\\251 \\330\\265\\331\\201\\330\\255\\330\\251 \\331\\205\\331\\201\\330\\261\\330\\257\\330\\251\\0\"\\\n  \"\\330\\247\\331\\204\\330\\256\\330\\267\\331\\210\\330\\267:\\0\"\\\n  \"\\330\\252\\331\\207\\331\\212\\330\\246\\330\\251 \\330\\247\\331\\204\\331\\203\\330\\252\\330\\247\\330\\250... %d \\330\\265\\331\\201\\330\\255\\330\\251\\0\"\\\n  \"\\330\\252\\331\\205 \\330\\247\\331\\204\\330\\271\\330\\253\\331\\210\\330\\261 \\330\\271\\331\\204\\331\\211 \\330\\247\\331\\204\\331\\206\\330\\265 \\331\\201\\331\\212 \\330\\265\\331\\201\\330\\255\\330\\251 %s\\0\"\\\n  \"\\331\\210\\331\\217\\330\\254\\330\\257 \\330\\247\\331\\204\\331\\206\\330\\265 \\331\\201\\331\\212 \\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\251 %s (\\331\\205\\330\\261\\330\\251 \\330\\243\\330\\256\\330\\261\\331\\211)\\0\"\\\n  \"\\330\\247\\331\\204\\330\\243\\331\\203\\330\\253\\330\\261 \\331\\202\\330\\261\\330\\247\\330\\241\\330\\251\\0\"\\\n  \"\\330\\254.\\330\\250\\0\"\\\n  \"\\330\\247\\331\\206\\330\\252\\331\\202\\331\\204 \\331\\204\\330\\265\\331\\201\\330\\255\\330\\251\\0\"\\\n  \"\\330\\245\\330\\256\\331\\201\\330\\247\\330\\241 \\330\\247\\331\\204\\330\\243\\331\\203\\330\\253\\330\\261 \\331\\202\\330\\261\\330\\247\\330\\241\\330\\251\\0\"\\\n  \" \\331\\204\\331\\204\\330\\250\\330\\255\\330\\253 \\331\\205\\330\\261\\330\\251 \\330\\243\\330\\256\\330\\261\\331\\211 F3 \\330\\252\\331\\204\\331\\205\\331\\212\\330\\255: \\330\\247\\330\\263\\330\\252\\330\\256\\330\\257\\330\\247\\331\\205 \\331\\205\\331\\201\\330\\252\\330\\247\\330\\255\\0\"\\\n  \"\\331\\205\\331\\204\\331\\201\\330\\247\\330\\252 \\330\\247\\331\\204\\330\\265\\331\\210\\330\\261 (*.%s)\\0\"\\\n  \"\\331\\203.\\330\\250\\0\"\\\n  \"\\331\\205.\\330\\250\\0\"\\\n  \" \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251 \\330\\247\\331\\204\\330\\247\\331\\201\\330\\252\\330\\261\\330\\247\\330\\266\\331\\212  \\331\\204\\331\\205\\331\\204\\331\\201\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251\\330\\237 Sumatra  \\330\\254\\330\\271\\331\\204 \\330\\252\\330\\267\\330\\250\\331\\212\\331\\202 \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252\\0\"\\\n  \"\\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251  \\331\\202\\330\\247\\330\\261\\330\\246 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251 \\330\\247\\331\\204\\330\\247\\331\\201\\330\\252\\330\\261\\330\\247\\330\\266\\331\\212 Sumatra \\330\\254\\330\\271\\331\\204  \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\0\"\\\n  \"\\331\\206\\331\\205\\330\\267 Man&ga \\0\"\\\n  \"\\331\\205\\330\\267\\330\\247\\330\\250\\331\\202\\330\\251 \\330\\255\\330\\247\\331\\204\\330\\251 \\330\\247\\331\\204\\330\\243\\330\\255\\330\\261\\331\\201\\0\"\\\n  \"\\331\\210\\330\\253\\330\\247\\330\\246\\331\\202 Mobi\\0\"\\\n  \"\\330\\247\\331\\204\\330\\252\\330\\271\\330\\257\\331\\212\\331\\204\\0\"\\\n  \"\\331\\212\\331\\210\\330\\254\\330\\257 \\331\\206\\330\\263\\330\\256\\330\\251 \\330\\254\\330\\257\\331\\212\\330\\257\\330\\251    %s . \\331\\207\\331\\204 \\330\\252\\330\\261\\331\\212\\330\\257 \\330\\252\\330\\255\\331\\205\\331\\212\\331\\204\\331\\207\\330\\247\\330\\237\\0\"\\\n  \"\\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\251 \\330\\247\\331\\204\\330\\252\\330\\247\\331\\204\\331\\212\\330\\251\\0\"\\\n  \"\\331\\204\\330\\247 \\330\\252\\331\\210\\330\\254\\330\\257 \\331\\205\\330\\252\\330\\267\\330\\247\\330\\250\\331\\202\\330\\247\\330\\252\\0\"\\\n  \"\\331\\204\\331\\205 \\331\\212\\330\\252\\331\\205 \\330\\247\\331\\204\\330\\271\\330\\253\\331\\210\\330\\261 \\330\\271\\331\\204\\331\\211 \\331\\206\\330\\252\\330\\247\\330\\246\\330\\254 \\330\\255\\331\\210\\331\\204 \\330\\247\\331\\204\\330\\263\\330\\267\\330\\261 %u \\331\\201\\331\\212 \\330\\247\\331\\204\\331\\205\\331\\204\\331\\201 %s\\0\"\\\n  \"\\331\\204\\330\\247\\330\\252\\331\\210\\330\\254\\330\\257 \\331\\205\\330\\262\\330\\247\\331\\205\\331\\206\\330\\251 \\331\\204\\331\\204\\331\\205\\331\\204\\331\\201\\0\"\\\n  \"\\331\\204\\330\\247 \\331\\205\\330\\271\\331\\204\\331\\210\\331\\205\\330\\247\\330\\252 \\330\\252\\330\\262\\330\\247\\331\\205\\331\\206 \\331\\201\\331\\212 \\331\\207\\330\\260\\330\\247 \\330\\247\\331\\204\\331\\205\\331\\210\\331\\202\\330\\271\\0\"\\\n  \"\\330\\271\\330\\257\\330\\257 \\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\247\\330\\252\\0\"\\\n  \"\\331\\205\\331\\210\\330\\247\\331\\201\\331\\202\\0\"\\\n  \"\\331\\201\\330\\252\\330\\255\\0\"\\\n  \"\\331\\201\\330\\252\\330\\255 \\331\\201\\331\\212 PDF-XChange\\0\"\\\n  \"\\331\\201\\330\\252\\330\\255 \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257...\\0\"\\\n  \"\\331\\201\\330\\252\\330\\255 \\331\\201\\331\\212  %s\\0\"\\\n  \"\\331\\201\\330\\252\\330\\255 \\331\\201\\331\\212 &\\331\\202\\330\\247\\330\\261\\330\\246 \\330\\247\\330\\257\\331\\210\\330\\250\\331\\212\\0\"\\\n  \"\\331\\201\\330\\252\\330\\255 \\331\\201\\331\\212 Foxit Reader\\0\"\\\n  \"\\331\\201\\330\\252\\330\\255 \\331\\201\\331\\212 Microsoft HTML Help\\0\"\\\n  \"\\331\\201\\330\\252\\330\\255 \\331\\201\\331\\212 Microsoft XPS-Viewer\\0\"\\\n  \"\\330\\247\\331\\204\\330\\256\\330\\265\\330\\247\\330\\246\\330\\265\\0\"\\\n  \"\\330\\247\\331\\204\\330\\256\\330\\265\\330\\247\\330\\246\\330\\265...\\tCtrl+D\\0\"\\\n  \"\\331\\210\\330\\253\\331\\212\\331\\202\\330\\251 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251\\0\"\\\n  \"\\330\\252\\330\\255\\330\\263\\331\\212\\331\\206\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251\\0\"\\\n  \"\\331\\205\\331\\206\\330\\252\\330\\254 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251:\\0\"\\\n  \"\\330\\247\\330\\265\\330\\257\\330\\247\\330\\261\\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251\\0\"\\\n  \"\\331\\210\\330\\253\\330\\247\\330\\246\\331\\202 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251\\0\"\\\n  \"\\330\\265\\331\\201&\\330\\255\\330\\251 \\tCtrl+G\\0\"\\\n  \"\\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\251 %s\\0\"\\\n  \"\\330\\255\\330\\254\\331\\205 \\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\251\\0\"\\\n  \"\\330\\272\\331\\212\\330\\261 \\331\\205\\331\\210\\330\\254\\331\\210\\330\\257 %u \\330\\261\\331\\202\\331\\205 \\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\251 \\0\"\\\n  \"\\331\\202\\331\\212\\330\\247\\330\\263 \\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\251\\0\"\\\n  \"\\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\251\\0\"\\\n  \"\\331\\210\\330\\253\\330\\247\\330\\246\\331\\202 PalmDoc \\0\"\\\n  \"\\330\\247\\331\\204\\330\\261\\330\\254\\330\\247\\330\\241 \\330\\247\\331\\204\\330\\245\\331\\206\\330\\252\\330\\270\\330\\247\\330\\261 - \\330\\247\\330\\271\\330\\247\\330\\257\\330\\251...\\0\"\\\n  \"\\331\\210\\330\\253\\330\\247\\330\\246\\331\\202 \\330\\247\\331\\204\\330\\252\\330\\260\\331\\212\\331\\212\\331\\204\\0\"\\\n  \"\\330\\247\\331\\204\\330\\271\\330\\261\\330\\266 \\330\\247\\331\\204\\330\\252\\331\\202\\330\\257\\331\\212\\331\\205 \\tF5\\0\"\\\n  \"\\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\251 \\330\\247\\331\\204\\330\\263\\330\\247\\330\\250\\331\\202\\330\\251\\0\"\\\n  \"\\330\\267\\330\\250\\330\\247\\330\\271\\330\\251\\0\"\\\n  \"\\331\\206\\330\\267\\330\\247\\331\\202 \\330\\247\\331\\204\\330\\267\\330\\250\\330\\247\\330\\271\\330\\251\\0\"\\\n  \"\\330\\267\\330\\247\\330\\250\\330\\271\\330\\251 \\330\\250\\331\\207\\330\\260\\330\\247 \\330\\247\\331\\204\\330\\247\\330\\263\\331\\205 \\330\\272\\331\\212\\330\\261 \\331\\205\\331\\210\\330\\254\\331\\210\\330\\257\\330\\251\\0\"\\\n  \"\\330\\247\\331\\204\\330\\267\\330\\250\\330\\247\\330\\271\\330\\251 \\331\\201\\331\\212 \\330\\247\\331\\204\\330\\252\\331\\202\\330\\257\\331\\205.\\0\"\\\n  \"\\330\\247\\331\\204\\330\\267\\330\\250\\330\\247\\330\\271\\330\\251 \\331\\202\\331\\212\\330\\257 \\330\\247\\331\\204\\330\\252\\331\\202\\330\\257\\331\\205. \\330\\245\\330\\255\\330\\250\\330\\247\\330\\267 \\331\\210\\330\\245\\331\\206\\331\\207\\330\\247\\330\\241\\330\\237\\0\"\\\n  \"\\330\\247\\331\\204\\330\\267\\330\\250\\330\\247\\330\\271\\330\\251 \\331\\202\\331\\212\\330\\257 \\330\\247\\331\\204\\330\\252\\331\\202\\330\\257\\331\\205. \\330\\245\\330\\255\\330\\250\\330\\247\\330\\267 \\331\\210\\330\\247\\331\\204\\330\\250\\330\\257\\330\\241 \\331\\205\\331\\206 \\330\\254\\330\\257\\331\\212\\330\\257\\330\\237\\0\"\\\n  \"\\330\\267\\330\\250\\330\\247\\330\\271\\330\\251 \\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\251 %d \\331\\205\\331\\206 %d...\\0\"\\\n  \"\\331\\212\\331\\210\\330\\254\\330\\257 \\331\\205\\330\\264\\331\\203\\331\\204\\330\\251 \\331\\201\\331\\212 \\330\\247\\331\\204\\330\\267\\330\\250\\330\\247\\330\\271\\330\\251\\0\"\\\n  \"\\330\\245\\330\\271\\330\\247\\330\\257\\330\\251 \\330\\252\\330\\263\\331\\205\\331\\212\\330\\251...\\tF2\\0\"\\\n  \"\\330\\252\\330\\260\\331\\203\\330\\261 \\330\\247\\331\\204\\331\\205\\331\\204\\331\\201\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\331\\201\\330\\252\\331\\210\\330\\255\\330\\251\\0\"\\\n  \"\\330\\247\\330\\262\\330\\247\\331\\204\\330\\251 \\331\\205\\331\\206 \\330\\247\\331\\204\\331\\205\\331\\201\\330\\266\\331\\204\\330\\251\\0\"\\\n  \"\\330\\255\\330\\260\\331\\201 \\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\251 %s \\331\\205\\331\\206 \\330\\247\\331\\204\\331\\205\\331\\201\\330\\266\\331\\204\\330\\251\\0\"\\\n  \"\\330\\245\\330\\271\\330\\247\\330\\257\\330\\251 \\330\\252\\330\\263\\331\\205\\331\\212\\330\\251 \\330\\245\\331\\204\\331\\211\\0\"\\\n  \"\\330\\257\\331\\210\\330\\261\\330\\247\\331\\206 \\331\\204\\331\\204\\331\\212\\330\\263\\330\\247\\330\\261\\tCtrl+Shift+-\\0\"\\\n  \"\\330\\257\\331\\210\\330\\261\\330\\247\\331\\206 \\331\\204\\331\\204\\331\\212\\331\\205\\331\\212\\331\\206\\tCtrl+Shift++\\0\"\\\n  \"\\330\\255\\331\\201\\330\\270 \\330\\250\\330\\247\\330\\263\\331\\205\\0\"\\\n  \"\\330\\255\\331\\201\\330\\270 \\330\\247\\331\\204\\330\\247\\330\\256\\330\\252\\330\\265\\330\\247\\330\\261...\\tCtrl+Shift+S\\0\"\\\n  \"\\331\\212\\330\\252\\331\\205 \\330\\247\\331\\204\\330\\250\\330\\255\\330\\253 %d \\331\\205\\331\\206 %d...\\0\"\\\n  \"\\330\\255\\330\\257\\330\\257 &\\330\\247\\331\\204\\331\\203\\331\\204\\0\"\\\n  \"\\330\\255\\330\\257\\330\\257&\\330\\247\\331\\204\\331\\203\\331\\204\\tCtrl+A\\0\"\\\n  \"\\330\\255\\330\\257\\330\\257 \\330\\247\\331\\204\\331\\205\\330\\255\\330\\252\\331\\210\\331\\211 \\330\\250\\330\\247\\331\\204\\330\\266\\330\\272\\330\\267 \\330\\271\\331\\204\\331\\211 \\330\\262\\330\\261 \\330\\247\\331\\204\\331\\201\\330\\243\\330\\261\\330\\251 \\330\\247\\331\\204\\330\\243\\331\\212\\330\\263\\330\\261 \\331\\210 Ctrl\\0\"\\\n  \"\\330\\247\\331\\204\\330\\252\\330\\255\\330\\257\\331\\212\\330\\257\\0\"\\\n  \"\\330\\245\\330\\261\\330\\263\\330\\247\\331\\204 \\330\\250&\\330\\247\\331\\204\\330\\250\\330\\261\\331\\212\\330\\257 \\330\\247\\331\\204\\330\\245\\331\\204\\331\\203\\330\\252\\330\\261\\331\\210\\331\\206\\331\\212\\0\"\\\n  \"\\330\\243\\331\\205\\330\\261 \\330\\247\\331\\204\\330\\250\\330\\255\\330\\253 \\330\\271\\331\\206 \\331\\206\\330\\265 \\330\\250\\330\\247\\330\\252\\330\\254\\330\\247\\331\\207 \\331\\205\\330\\271\\330\\247\\331\\203\\330\\263\\0\"\\\n  \"\\330\\247\\330\\270\\331\\207\\330\\247\\330\\261 &\\331\\202\\331\\210\\330\\247\\330\\246\\331\\205 \\330\\247\\331\\204\\330\\271\\331\\206\\330\\247\\331\\210\\331\\212\\331\\206\\0\"\\\n  \"\\330\\247\\330\\270\\331\\207\\330\\247\\330\\261 \\330\\247\\331\\204\\330\\265\\331\\201\\330\\255\\330\\247\\330\\252 \\330\\250\\330\\247\\330\\263\\330\\252\\331\\205\\330\\261\\330\\247\\330\\261\\0\"\\\n  \"\\330\\247\\330\\270\\331\\207\\330\\247\\330\\261 \\330\\264\\330\\261\\331\\212\\330\\267 \\330\\247\\331\\204\\330\\243\\330\\257\\331\\210\\330\\247\\330\\252\\0\"\\\n  \"\\330\\245\\330\\270\\331\\207\\330\\247\\330\\261 \\330\\247\\331\\204\\331\\205\\331\\201\\330\\266\\331\\204\\330\\251\\0\"\\\n  \"\\330\\245\\330\\270\\331\\207\\330\\247\\330\\261 \\330\\247\\331\\204\\330\\243\\331\\203\\330\\253\\330\\261 \\331\\202\\330\\261\\330\\247\\330\\241\\330\\251\\0\"\\\n  \"\\330\\247\\330\\270\\331\\207\\330\\247\\330\\261 &\\331\\202\\330\\247\\330\\246\\331\\205\\330\\251 \\330\\247\\331\\204\\330\\271\\331\\206\\330\\247\\331\\210\\331\\212\\331\\206 \\331\\201\\331\\212 \\330\\247\\331\\204\\330\\264\\330\\261\\331\\212\\330\\267 \\330\\247\\331\\204\\330\\254\\330\\247\\331\\206\\330\\250\\331\\212 \\330\\271\\331\\206\\330\\257 \\330\\252\\331\\210\\331\\201\\330\\261\\331\\207\\330\\247\\0\"\\\n  \"\\330\\265\\331\\201\\330\\255\\330\\251 \\331\\210\\330\\247\\330\\255\\330\\257\\330\\251\\0\"\\\n  \"\\330\\247\\331\\204\\330\\261\\330\\254\\330\\247\\330\\241 \\330\\247\\330\\266\\330\\272\\330\\267 '\\330\\245\\331\\204\\330\\272\\330\\247\\330\\241 \\330\\247\\331\\204\\330\\243\\331\\205\\330\\261'\\330\\214 \\330\\245\\330\\260\\330\\247 \\331\\203\\331\\206\\330\\252 \\330\\252\\330\\261\\330\\272\\330\\250 \\331\\201\\331\\212 \\331\\205\\330\\263\\330\\247\\330\\271\\330\\257\\330\\252\\331\\206\\330\\247 \\330\\271\\331\\204\\331\\211 \\330\\245\\330\\265\\331\\204\\330\\247\\330\\255 \\331\\207\\330\\260\\330\\247 \\330\\247\\331\\204\\330\\255\\330\\247\\330\\257\\330\\253 \\n\\n !\\330\\242\\330\\263\\331\\201\\330\\214 \\330\\243\\331\\206\\331\\207 \\331\\204\\330\\247 \\331\\212\\331\\206\\330\\250\\330\\272\\331\\212 \\330\\243\\331\\206 \\331\\212\\331\\203\\331\\210\\331\\206 \\331\\202\\330\\257 \\330\\255\\330\\257\\330\\253\\0\"\\\n  \"\\330\\247\\331\\204\\331\\205\\331\\204\\331\\201 \\330\\247\\331\\204\\331\\205\\330\\265\\330\\257\\330\\261 %s \\331\\204\\331\\205 \\330\\252\\330\\252\\331\\205 \\331\\205\\330\\262\\330\\247\\331\\205\\331\\206\\330\\252\\331\\207 \\330\\271\\331\\206\\330\\257 \\331\\207\\330\\260\\331\\207 \\330\\247\\331\\204\\331\\206\\331\\202\\330\\267\\330\\251\\0\"\\\n  \"\\330\\247\\331\\204\\331\\205\\331\\210\\330\\266\\331\\210\\330\\271\\0\"\\\n  \"\\330\\256\\331\\212\\330\\247\\330\\261\\330\\247\\330\\252 \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 Sumatra \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251\\0\"\\\n  \"\\330\\252\\330\\255\\330\\257\\331\\212\\330\\253  \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 Sumatra \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251\\0\"\\\n  \"\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 Sumatra \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251 \\330\\252\\330\\255\\330\\267\\331\\205\\330\\252\\0\"\\\n  \"\\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251 \\331\\207\\331\\210 \\331\\202\\330\\247\\330\\261\\330\\246 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251 \\330\\247\\331\\204\\330\\247\\331\\201\\330\\252\\330\\261\\330\\247\\330\\266\\331\\212 Sumatra \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252\\0\"\\\n  \"  \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 Sumatra \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251 \\330\\247\\331\\204\\330\\247\\331\\206 \\331\\212\\330\\254\\330\\250 \\330\\247\\331\\206 \\330\\252\\331\\203\\331\\210\\331\\206 \\331\\204\\330\\257\\331\\212\\331\\203 \\331\\202\\330\\247\\330\\261\\330\\246 \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251 \\330\\247\\331\\201\\330\\252\\330\\261\\330\\247\\330\\266\\331\\212\\0\"\\\n  \"\\331\\204\\330\\247\\331\\212\\331\\205\\331\\203\\331\\206 \\331\\201\\330\\252\\330\\255 \\331\\205\\330\\262\\330\\247\\331\\205\\331\\206\\330\\251 \\330\\247\\331\\204\\331\\205\\331\\204\\331\\201\\0\"\\\n  \"\\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251 \\331\\205\\331\\210\\330\\263\\331\\210\\331\\205\\330\\251\\0\"\\\n  \"\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\331\\206\\330\\265\\331\\212\\330\\251\\0\"\\\n  \"\\331\\210\\331\\202\\330\\257 \\331\\204\\330\\247 \\330\\252\\330\\271\\330\\261\\330\\266 \\330\\250\\330\\264\\331\\203\\331\\204 \\330\\265\\330\\255\\331\\212\\330\\255 (%s) \\331\\207\\330\\260\\330\\247 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257 \\331\\212\\330\\263\\330\\252\\330\\256\\330\\257\\331\\205 \\331\\205\\331\\212\\330\\262\\330\\247\\330\\252 \\330\\272\\331\\212\\330\\261 \\331\\205\\330\\271\\330\\252\\331\\205\\330\\257\\330\\251\\0\"\\\n  \"\\330\\247\\331\\204\\330\\271\\331\\206\\331\\210\\330\\247\\331\\206\\0\"\\\n  \"\\331\\205\\331\\204\\331\\201 \\331\\205\\330\\265\\330\\257\\330\\261\\331\\212 \\330\\272\\331\\212\\330\\261 \\331\\205\\330\\271\\330\\261\\331\\210\\331\\201 (%s)\\0\"\\\n  \"\\330\\247\\331\\204\\330\\245\\330\\263\\330\\252\\330\\271\\331\\205\\330\\247\\331\\204 & \\330\\247\\331\\204\\330\\252\\330\\250\\331\\210\\331\\212\\330\\250\\330\\247\\330\\252\\0\"\\\n  \"\\330\\247\\331\\204\\330\\271\\330\\261\\330\\266\\0\"\\\n  \"&\\330\\262\\331\\212\\330\\247\\330\\261\\330\\251 \\331\\205\\331\\210\\331\\202\\330\\271 \\330\\247\\331\\204\\330\\250\\330\\261\\331\\206\\330\\247\\331\\205\\330\\254\\0\"\\\n  \"\\330\\252\\330\\255\\330\\260\\331\\212\\330\\261\\0\"\\\n  \"\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 XPS\\0\"\\\n  \"\\331\\204\\330\\257\\331\\212\\331\\203 \\330\\242\\330\\256\\330\\261 \\331\\206\\330\\263\\330\\256\\330\\251\\0\"\\\n  \"\\331\\204\\330\\257\\331\\212\\331\\203 \\330\\247\\331\\204\\331\\206\\330\\263\\330\\256\\330\\251 %s\\0\"\\\n  \"\\330\\252\\331\\203\\330\\250\\331\\212\\330\\261/\\330\\252\\330\\265\\330\\272\\331\\212\\330\\261\\0\"\\\n  \"\\330\\252\\331\\203\\330\\250\\331\\212\\330\\261\\0\"\\\n  \"\\330\\252\\330\\265\\330\\272\\331\\212\\330\\261\\0\"\\\n  \"\\330\\271\\330\\247\\331\\205\\331\\204 \\330\\247\\331\\204\\330\\252\\331\\203\\330\\250\\331\\212\\330\\261/\\330\\247\\331\\204\\330\\252\\330\\265\\330\\272\\331\\212\\330\\261\\0\"\\\n  \"%s [\\330\\252\\330\\272\\331\\212\\331\\212\\330\\261\\330\\247\\330\\252 \\330\\245\\331\\203\\330\\252\\330\\264\\331\\201\\330\\252\\330\\233 \\330\\247\\331\\204\\331\\205\\331\\206\\330\\271\\330\\264] \\0\"\\\n  \"\\331\\206\\330\\247\\330\\263\\330\\256 \\330\\247\\331\\204\\331\\206\\330\\265\\0\"\\\n  \"\\330\\267\\330\\250\\330\\247\\330\\271\\330\\251 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\0\";\n\nconst char * gTranslations_am = \n  \"&\\324\\276\\326\\200\\325\\241\\325\\243\\326\\200\\325\\253 \\325\\264\\325\\241\\325\\275\\325\\253\\325\\266\\0\"\\\n  \"\\324\\273\\326\\200\\325\\241\\325\\257\\325\\241\\325\\266 &\\325\\271\\325\\241\\326\\203\\325\\250\\tCtrl+1\\0\"\\\n  \"&\\324\\270\\325\\266\\325\\244\\325\\254\\325\\241\\325\\265\\325\\266\\325\\276\\325\\241\\325\\256 \\325\\257\\325\\241\\326\\200\\325\\243\\325\\241\\325\\276\\325\\270\\326\\200\\325\\270\\326\\202\\325\\264\\325\\266\\325\\245\\326\\200..\\0\"\\\n  \"&\\324\\270\\325\\266\\325\\277\\326\\200\\325\\276\\325\\241\\325\\256 \\325\\242\\325\\270\\325\\254\\325\\270\\326\\200 \\325\\247\\325\\273\\325\\245\\326\\200\\325\\250\\0\"\\\n  \"&\\325\\206\\325\\241\\325\\255\\325\\270\\326\\200\\325\\244\\325\\250\\tAlt+Left Arrow\\0\"\\\n  \"&\\324\\263\\326\\200\\326\\204\\325\\253 \\325\\277\\325\\245\\325\\275\\326\\204\\325\\270\\325\\276\\tCtrl+8\\0\"\\\n  \"&\\325\\223\\325\\241\\325\\257\\325\\245\\325\\254\\tCtrl+W\\0\"\\\n  \"&\\325\\212\\325\\241\\325\\277\\325\\263\\325\\245\\325\\266\\325\\245\\325\\254 \\325\\266\\325\\267\\325\\276\\325\\241\\325\\256\\325\\250\\0\"\\\n  \"\\325\\212\\325\\241\\325\\277\\325\\263\\325\\245\\325\\266\\325\\245\\325\\254 \\325\\266\\325\\267\\325\\276\\325\\241\\325\\256\\325\\250\\tCtrl+C\\0\"\\\n  \"&\\324\\261\\325\\265\\325\\254\\326\\207\\325\\275 \\325\\271\\325\\260\\325\\241\\326\\200\\326\\201\\325\\266\\325\\245\\325\\254\\0\"\\\n  \"&\\325\\204\\325\\253\\325\\241\\325\\265\\325\\266 \\325\\246\\325\\270\\326\\202\\325\\265\\325\\243 \\325\\247\\325\\273\\325\\245\\326\\200\\325\\250\\0\"\\\n  \"&\\324\\265\\326\\200\\325\\257\\325\\270\\326\\202 \\325\\247\\325\\273\\325\\270\\325\\276\\tCtrl+7\\0\"\\\n  \"&\\325\\226\\325\\241\\325\\265\\325\\254\\0\"\\\n  \"&\\324\\273\\325\\266\\325\\271 \\325\\243\\325\\277\\325\\266\\325\\245\\325\\254.\\0\"\\\n  \"\\324\\261\\325\\274\\325\\241\\325\\273\\325\\253\\325\\266 \\325\\247\\325\\273\\325\\250\\tHome\\0\"\\\n  \"&\\325\\200\\325\\241\\326\\200\\325\\264\\325\\241\\326\\200\\325\\245\\326\\201\\325\\266\\325\\245\\325\\254 \\325\\247\\325\\273\\325\\245\\326\\200\\325\\250 \\325\\277\\325\\272\\325\\245\\325\\254\\325\\270\\326\\202 \\325\\260\\325\\241\\325\\264\\325\\241\\326\\200\\0\"\\\n  \"&\\324\\261\\325\\266\\326\\201\\325\\270\\326\\202\\325\\264\\0\"\\\n  \"&\\324\\261\\325\\266\\326\\201\\325\\266\\325\\245\\325\\254 \\325\\247\\325\\273\\325\\253.\\0\"\\\n  \"&\\325\\225\\325\\243\\325\\266\\325\\270\\326\\202\\325\\251\\325\\265\\325\\270\\326\\202\\325\\266\\0\"\\\n  \"\\325\\216\\325\\245\\326\\200\\325\\273\\325\\253\\325\\266 \\325\\247\\325\\273\\325\\250\\tEnd\\0\"\\\n  \"&\\325\\204\\325\\245\\325\\256\\325\\241\\326\\201\\325\\266\\325\\245\\325\\254\\0\"\\\n  \"&\\325\\225\\325\\243\\325\\266\\325\\270\\326\\202\\325\\251\\325\\265\\325\\270\\326\\202\\325\\266\\0\"\\\n  \"&\\325\\200\\325\\241\\325\\267\\325\\276\\325\\253 \\325\\241\\325\\274\\325\\266\\325\\245\\325\\254 \\325\\264\\325\\245\\325\\256\\325\\241\\325\\277\\325\\241\\325\\274/\\326\\203\\325\\270\\326\\204\\326\\200\\325\\241\\325\\277\\325\\241\\325\\274\\325\\250\\0\"\\\n  \"\\325\\200\\325\\241\\325\\273\\325\\270\\326\\200\\325\\244 \\325\\247\\325\\273\\325\\250\\t->\\0\"\\\n  \"&\\325\\210\\325\\271\\0\"\\\n  \"&\\325\\210\\325\\271\\0\"\\\n  \"&\\325\\204\\325\\253\\325\\241\\325\\265\\325\\266 \\325\\257\\325\\245\\325\\266\\325\\277 \\325\\247\\325\\273\\325\\245\\326\\200\\325\\250\\0\"\\\n  \"&\\324\\262\\325\\241\\326\\201\\325\\245\\325\\254 \\326\\203\\325\\241\\325\\275\\325\\277\\325\\241\\325\\251\\325\\270\\326\\202\\325\\262\\325\\251\\0\"\\\n  \"\\324\\262\\325\\241\\326\\201\\325\\245\\325\\254...\\tCtrl+O\\0\"\\\n  \"&\\324\\270\\325\\266\\325\\277\\326\\200\\325\\241\\325\\266\\326\\204\\325\\266\\325\\245\\326\\200...\\0\"\\\n  \"&\\324\\263\\325\\241\\325\\262\\325\\277\\325\\266\\325\\241\\325\\242\\325\\241\\325\\274\\325\\250\\0\"\\\n  \"&\\324\\263\\325\\241\\325\\264\\325\\245\\325\\254 \\326\\203\\325\\241\\325\\275\\325\\277\\325\\241\\325\\251\\325\\270\\326\\202\\325\\262\\325\\251\\325\\250\\0\"\\\n  \"\\325\\206\\325\\241\\325\\255\\325\\270\\326\\200\\325\\244 \\325\\247\\325\\273\\325\\250\\t<-\\0\"\\\n  \"&\\325\\217\\325\\272\\325\\245\\325\\254...\\0\"\\\n  \"&\\325\\217\\325\\272\\325\\245\\325\\254\\tCtrl+P\\0\"\\\n  \"&\\325\\217\\325\\272\\325\\245\\325\\254... (\\325\\264\\325\\245\\326\\200\\325\\252\\325\\276\\325\\241\\325\\256)\\0\"\\\n  \"&\\325\\200\\325\\253\\325\\267\\325\\245\\325\\254 \\326\\206\\325\\241\\325\\265\\325\\254\\325\\253 \\325\\243\\325\\241\\325\\262\\325\\277\\325\\266\\325\\241\\325\\242\\325\\241\\325\\274\\325\\250\\0\"\\\n  \"\\325\\200\\325\\253\\325\\267\\325\\245\\325\\254 \\325\\241\\325\\265\\325\\275 \\325\\257\\325\\241\\326\\200\\325\\243\\325\\241\\325\\276\\325\\270\\326\\200\\325\\270\\326\\202\\325\\264\\325\\266\\325\\245\\326\\200\\325\\250 &\\325\\242\\325\\270\\325\\254\\325\\270\\326\\200 \\326\\206\\325\\241\\325\\265\\325\\254\\325\\245\\326\\200\\325\\253 \\325\\260\\325\\241\\325\\264\\325\\241\\326\\200\\0\"\\\n  \"&\\325\\200\\325\\245\\325\\274\\325\\241\\326\\201\\325\\266\\325\\245\\325\\254 \\326\\203\\325\\241\\325\\275\\325\\277\\325\\241\\325\\251\\325\\270\\326\\202\\325\\262\\325\\251\\325\\250\\0\"\\\n  \"&\\325\\212\\325\\241\\325\\260\\325\\272\\325\\241\\325\\266\\325\\245\\325\\254 \\325\\270\\326\\200\\325\\272\\325\\245\\325\\275\\0\"\\\n  \"&\\325\\212\\325\\241\\325\\260\\325\\272\\325\\241\\325\\266\\325\\245\\325\\254 \\325\\270\\326\\200\\325\\272\\325\\245\\325\\275\\tCtrl+S\\0\"\\\n  \"&\\324\\277\\325\\241\\326\\200\\325\\243\\325\\241\\325\\276\\325\\270\\326\\200\\325\\270\\326\\202\\325\\264\\325\\266\\325\\245\\326\\200\\0\"\\\n  \"&\\325\\200\\325\\241\\326\\200\\325\\264\\325\\241\\326\\200\\325\\245\\326\\201\\325\\266\\325\\245\\325\\254 \\325\\247\\325\\273\\325\\250 \\325\\277\\325\\272\\325\\245\\325\\254\\325\\270\\326\\202 \\325\\260\\325\\241\\325\\264\\325\\241\\326\\200 (\\325\\245\\325\\251\\325\\245 \\325\\272\\325\\241\\325\\260\\325\\241\\325\\266\\325\\273\\325\\276\\325\\270\\326\\202\\325\\264 \\325\\247)\\0\"\\\n  \"&\\325\\204\\325\\245\\325\\257 \\325\\247\\325\\273\\325\\270\\325\\276\\tCtrl+6\\0\"\\\n  \"&\\324\\262\\325\\241\\326\\201 \\325\\251\\325\\270\\325\\262\\325\\266\\325\\245\\325\\254 \\325\\241\\325\\265\\325\\275 \\325\\277\\325\\241\\326\\200\\325\\242\\325\\245\\326\\200\\325\\241\\325\\257\\325\\250\\0\"\\\n  \"&\\325\\225\\325\\243\\325\\277\\325\\241\\325\\243\\325\\270\\326\\200\\325\\256\\325\\245\\325\\254 \\325\\247\\325\\273\\325\\245\\326\\200\\325\\253 \\325\\253\\326\\200\\325\\241\\325\\257\\325\\241\\325\\266 \\325\\271\\325\\241\\326\\203\\325\\250\\0\"\\\n  \"&\\325\\217\\325\\245\\325\\275\\326\\204\\0\"\\\n  \"&\\325\\212\\325\\241\\325\\277\\325\\270\\326\\202\\325\\260\\325\\241\\325\\266\\0\"\\\n  \"&\\324\\261\\325\\265\\325\\270\\0\"\\\n  \"&\\324\\264\\325\\253\\325\\277\\325\\241\\326\\203\\325\\270\\325\\255\\325\\245\\325\\254\\0\"\\\n  \"(%d-\\325\\253\\326\\201)\\0\"\\\n  \"(\\325\\247\\325\\273 %s)\\0\"\\\n  \"SumatraPDF-\\325\\253 \\325\\264\\325\\241\\325\\275\\325\\253\\325\\266\\0\"\\\n  \"\\324\\261\\325\\276\\325\\245\\325\\254\\325\\241\\326\\201\\325\\266\\325\\245\\325\\254 \\325\\250\\325\\266\\325\\277\\326\\200\\325\\265\\325\\241\\325\\254\\325\\266\\325\\245\\326\\200\\325\\253\\325\\266\\0\"\\\n  \"\\324\\261\\325\\276\\325\\245\\325\\254\\325\\241\\326\\201\\325\\266\\325\\245\\325\\254 %s \\325\\247\\325\\273\\325\\250 \\325\\250\\325\\266\\325\\277\\326\\200\\325\\265\\325\\241\\325\\254\\325\\266\\325\\245\\326\\200\\325\\253\\325\\266\\0\"\\\n  \"\\324\\261\\325\\276\\325\\245\\325\\254\\325\\241\\326\\201\\325\\266\\325\\245\\325\\254 %s \\325\\247\\325\\273\\325\\250 \\325\\250\\325\\266\\325\\277\\326\\200\\325\\265\\325\\241\\325\\254\\325\\266\\325\\245\\326\\200\\325\\253\\325\\266 \\325\\260\\325\\245\\325\\277\\326\\207\\325\\265\\325\\241\\325\\254 \\325\\241\\325\\266\\325\\276\\325\\241\\325\\264\\325\\242`\\0\"\\\n  \"\\324\\261\\325\\276\\325\\245\\325\\254\\325\\241\\326\\201\\325\\266\\325\\245\\325\\254 \\325\\250\\325\\266\\325\\277\\326\\200\\325\\265\\325\\241\\325\\254\\325\\266\\325\\245\\326\\200\\325\\253\\325\\266\\0\"\\\n  \"\\324\\270\\325\\266\\325\\244\\325\\254\\325\\241\\325\\265\\325\\266\\325\\276\\325\\241\\325\\256\\0\"\\\n  \"\\324\\262\\325\\270\\325\\254\\325\\270\\326\\200 \\326\\206\\325\\241\\325\\265\\325\\254\\325\\245\\326\\200\\325\\250\\0\"\\\n  \"\\324\\261\\325\\273\\325\\241\\325\\257\\326\\201\\325\\276\\325\\270\\325\\262 \\325\\242\\325\\270\\325\\254\\325\\270\\326\\200 \\326\\203\\325\\241\\325\\275\\325\\251\\325\\241\\325\\251\\325\\262\\325\\251\\325\\245\\326\\200\\325\\250\\0\"\\\n  \"\\324\\276\\326\\200\\325\\241\\325\\243\\325\\253\\326\\200\\325\\235\\0\"\\\n  \"\\324\\261\\325\\275\\325\\270\\326\\201\\325\\253\\325\\241\\326\\201\\325\\266\\325\\245\\325\\236\\325\\254 PDF \\326\\206\\325\\241\\325\\265\\325\\254\\325\\245\\326\\200\\325\\253 \\325\\260\\325\\245\\325\\277\\326\\211\\0\"\\\n  \"\\324\\277\\326\\201\\325\\270\\326\\200\\325\\244. %s\\0\"\\\n  \"\\325\\200\\325\\245\\325\\262\\325\\253\\325\\266\\325\\241\\325\\257\\325\\235\\0\"\\\n  \"\\324\\273\\325\\266\\326\\204\\325\\266\\325\\241\\325\\267\\325\\255\\325\\241\\325\\277\\0\"\\\n  \"\\324\\273\\325\\266\\326\\204\\325\\266\\325\\241\\325\\267\\325\\255\\325\\241\\325\\277 \\325\\275\\325\\277\\325\\270\\326\\202\\325\\243\\325\\245\\325\\254 &\\325\\251\\325\\241\\326\\200\\325\\264\\325\\241\\326\\201\\325\\270\\326\\202\\325\\264\\325\\266\\325\\245\\326\\200\\325\\250\\0\"\\\n  \"\\324\\263\\326\\200\\326\\204\\325\\253 \\325\\277\\325\\245\\325\\275\\326\\204\\325\\270\\325\\276\\0\"\\\n  \"\\324\\267\\325\\273\\325\\241\\325\\266&\\325\\253\\325\\267\\325\\245\\326\\200\\tF12\\0\"\\\n  \"\\324\\267\\325\\273\\325\\241\\325\\266\\325\\267\\325\\245\\325\\254 \\325\\272\\325\\253\\325\\277\\325\\241\\325\\257\\325\\266\\325\\245\\326\\200\\325\\250\\0\"\\\n  \"\\324\\267\\325\\273\\325\\241\\325\\266\\325\\267\\325\\245\\325\\254 %s \\325\\247\\325\\273\\325\\253\\326\\201 %s-\\325\\250\\0\"\\\n  \"\\324\\267\\325\\273\\325\\241\\325\\266\\325\\253\\325\\267\\325\\245\\326\\200\\0\"\\\n  \"\\324\\262\\325\\241\\325\\265\\325\\251\\0\"\\\n  \"CHM \\326\\206\\325\\241\\325\\265\\325\\254\\325\\245\\326\\200\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\247 \\325\\257\\325\\241\\325\\272\\325\\266\\325\\276\\325\\245\\325\\254 (\\325\\275\\325\\255\\325\\241\\325\\254 %#x)\\326\\211\\0\"\\\n  \"\\325\\211\\325\\245\\325\\262\\325\\241\\326\\200\\325\\257\\325\\245\\325\\254\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\247 \\325\\277\\325\\272\\325\\245\\325\\254 \\325\\241\\325\\265\\325\\275 \\326\\206\\325\\241\\325\\265\\325\\254\\325\\250\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\247 \\325\\270\\326\\200\\325\\270\\325\\266\\325\\245\\325\\254\\326\\211 \\325\\215\\325\\277\\325\\270\\326\\202\\325\\243\\325\\245\\326\\204 \\325\\260\\326\\200\\325\\241\\325\\264\\325\\241\\325\\266\\325\\266\\325\\245\\326\\200\\325\\253 \\325\\277\\325\\270\\325\\262\\325\\253 \\325\\257\\325\\241\\326\\200\\325\\243\\325\\241\\325\\276\\325\\270\\326\\200\\325\\270\\326\\202\\325\\264\\325\\266\\325\\245\\326\\200\\325\\250\\326\\211\\0\"\\\n  \"\\325\\223\\325\\270\\325\\255\\325\\245\\325\\254 \\325\\254\\325\\245\\325\\246\\325\\270\\326\\202\\325\\266 (Change Language)\\0\"\\\n  \"&\\325\\215\\325\\277\\325\\270\\326\\202\\325\\243\\325\\245\\325\\254 \\325\\266\\325\\270\\326\\200 \\325\\277\\325\\241\\326\\200\\325\\242\\325\\245\\326\\200\\325\\241\\325\\257\\325\\250\\0\"\\\n  \"\\325\\200\\325\\270\\326\\202\\325\\264\\325\\270\\326\\200\\325\\241\\325\\265\\325\\253\\325\\266 \\325\\243\\326\\200\\326\\204\\325\\245\\326\\200\\0\"\\\n  \"\\325\\200\\325\\241\\325\\264\\325\\241\\325\\277\\325\\245\\325\\262\\325\\245\\325\\254\\325\\253\\325\\270\\326\\202\\325\\251\\325\\265\\325\\270\\326\\202\\325\\266\\325\\250\\0\"\\\n  \"\\324\\261\\325\\266\\325\\244\\325\\241\\325\\244\\325\\241\\326\\200\\0\"\\\n  \"\\325\\207\\325\\241\\326\\200\\325\\270\\326\\202\\325\\266\\325\\241\\325\\257\\325\\245\\325\\254 \\325\\243\\326\\200\\326\\204\\325\\253 \\325\\277\\325\\245\\325\\275\\326\\204\\325\\270\\325\\276\\0\"\\\n  \"\\324\\261\\325\\266\\325\\244\\325\\241\\325\\244\\325\\241\\326\\200 \\325\\245\\326\\200\\325\\257\\325\\270\\326\\202 \\325\\247\\325\\273\\325\\270\\325\\276\\0\"\\\n  \"\\325\\225\\325\\243\\325\\266\\325\\245\\325\\254 \\325\\251\\325\\241\\326\\200\\325\\243\\325\\264\\325\\241\\325\\266\\325\\245\\325\\254\\0\"\\\n  \"\\325\\212\\325\\241\\325\\277\\325\\263\\325\\245\\325\\266\\325\\245\\325\\254 &\\325\\206\\325\\257\\325\\241\\326\\200\\325\\250\\0\"\\\n  \"\\325\\212\\325\\241\\325\\277\\325\\263\\325\\245\\325\\266\\325\\245\\325\\254 &\\325\\260\\325\\262\\325\\270\\326\\202\\325\\264\\325\\250\\0\"\\\n  \"\\325\\212\\325\\241\\325\\277\\325\\263\\325\\245\\325\\266\\325\\245\\325\\254 \\325\\264\\325\\245\\325\\257&\\325\\266\\325\\241\\325\\242\\325\\241\\325\\266\\325\\270\\326\\202\\325\\251\\325\\265\\325\\270\\326\\202\\325\\266\\325\\250\\0\"\\\n  \"\\325\\217\\325\\245\\326\\204\\325\\275\\325\\277\\325\\253 \\325\\272\\325\\241\\325\\277\\325\\263\\325\\245\\325\\266\\325\\270\\326\\202\\325\\264\\325\\250 \\325\\251\\325\\270\\326\\202\\325\\265\\325\\254\\325\\241\\325\\277\\326\\200\\325\\276\\325\\241\\325\\256 \\325\\271\\325\\247 (\\325\\272\\325\\241\\325\\277\\325\\263\\325\\245\\325\\266\\325\\270\\326\\202\\325\\264 \\325\\247 \\325\\270\\326\\200\\325\\272\\325\\245\\325\\275 \\325\\272\\325\\241\\325\\277\\325\\257\\325\\245\\326\\200)\\0\"\\\n  \"\\325\\200\\325\\245\\325\\262. \\325\\253\\326\\200\\325\\241\\325\\276\\325\\270\\326\\202\\325\\266\\326\\204\\325\\250.\\0\"\\\n  \"\\325\\217\\325\\272\\325\\253\\325\\271\\325\\253 \\325\\260\\325\\241\\325\\277\\325\\257\\325\\270\\326\\202\\325\\251\\325\\265\\325\\270\\326\\202\\325\\266\\325\\266\\325\\245\\326\\200\\325\\250 \\325\\260\\325\\241\\325\\275\\325\\241\\325\\266\\325\\245\\325\\254\\325\\253 \\325\\271\\325\\245\\325\\266\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\247 \\325\\243\\325\\277\\325\\266\\325\\245\\325\\254 \\325\\277\\325\\272\\325\\253\\325\\271\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\245\\325\\262\\325\\241\\325\\276 \\325\\275\\325\\277\\325\\245\\325\\262\\325\\256\\325\\245\\325\\254 \\325\\247\\325\\273\\325\\253 \\325\\272\\325\\241\\325\\277\\325\\257\\325\\245\\326\\200\\325\\250\\0\"\\\n  \"\\325\\215\\325\\277\\325\\245\\325\\262\\325\\256\\325\\276\\325\\241\\325\\256`\\0\"\\\n  \"\\324\\270\\325\\266\\325\\251\\325\\241\\326\\201\\325\\253\\325\\257 \\326\\206\\325\\241\\325\\265\\325\\254\\325\\250\\0\"\\\n  \"\\325\\206\\325\\267\\325\\270\\326\\200\\325\\244\\325\\253 \\325\\244\\325\\253\\326\\200\\326\\204\\325\\250.\\0\"\\\n  \"&\\324\\270\\325\\266\\325\\277\\326\\200\\325\\276\\325\\241\\325\\256 \\325\\271\\325\\241\\326\\203\\325\\270\\325\\276\\tCtrl+Y\\0\"\\\n  \"\\324\\276\\326\\200\\325\\241\\325\\243\\326\\200\\325\\241\\325\\265\\325\\253\\325\\266 &\\325\\244\\325\\241\\325\\275\\325\\241\\325\\276\\325\\270\\326\\200\\325\\270\\326\\202\\325\\251\\325\\265\\325\\270\\326\\202\\325\\266.\\0\"\\\n  \"\\324\\276\\326\\200\\325\\241\\325\\243\\326\\200\\325\\241\\325\\265\\325\\253\\325\\266 &\\325\\271\\325\\241\\326\\203\\325\\250.\\0\"\\\n  \"\\325\\207\\325\\241\\326\\200\\325\\252\\325\\241\\325\\257\\325\\241\\325\\266 \\325\\276\\325\\253\\325\\263\\325\\241\\325\\257\\325\\270\\326\\202\\325\\264 \\325\\260\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\247 \\326\\203\\325\\270\\325\\255\\325\\245\\325\\254 PDF \\325\\257\\325\\241\\326\\200\\325\\244\\325\\241\\325\\254\\325\\270\\326\\202 \\325\\260\\325\\253\\325\\264\\325\\266\\325\\241\\325\\257\\325\\241\\325\\266 \\325\\256\\326\\200\\325\\241\\325\\243\\325\\253\\326\\200\\325\\250\\0\"\\\n  \"\\324\\274\\325\\253\\325\\241\\325\\246\\325\\270\\326\\200\\325\\270\\326\\202\\325\\251\\325\\265\\325\\270\\326\\202\\325\\266\\325\\266\\325\\245\\326\\200\\325\\250 \\325\\264\\325\\245\\326\\200\\325\\252\\325\\276\\325\\241\\325\\256 \\325\\245\\325\\266.\\0\"\\\n  \"DjVu \\326\\206\\325\\241\\325\\265\\325\\254\\325\\245\\326\\200\\0\"\\\n  \"\\325\\226\\325\\241\\325\\265\\325\\254\\325\\253 \\325\\260\\325\\241\\325\\277\\325\\257\\325\\270\\326\\202\\325\\251\\325\\265\\325\\270\\326\\202\\325\\266\\325\\266\\325\\245\\326\\200\\325\\250\\0\"\\\n  \"\\325\\206\\325\\245\\326\\200\\325\\242\\325\\245\\325\\274\\325\\266\\325\\245\\325\\254\\0\"\\\n  \"\\325\\223\\325\\241&\\325\\257\\325\\245\\325\\254\\tCtrl+Q\\0\"\\\n  \"\\0\"\\\n  \"\\324\\263\\326\\200\\325\\245\\326\\204 \\325\\243\\325\\241\\325\\262\\325\\277\\325\\266\\325\\241\\325\\242\\325\\241\\325\\274\\325\\250\\0\"\\\n  \"\\324\\263\\326\\200\\325\\245\\326\\204 \\325\\243\\325\\241\\325\\262\\325\\277\\325\\266\\325\\241\\325\\242\\325\\241\\325\\274\\325\\250\\325\\235 %s-\\325\\253 \\325\\260\\325\\241\\325\\264\\325\\241\\326\\200\\0\"\\\n  \"\\325\\204\\325\\270\\326\\202\\325\\277\\326\\204\\325\\241\\325\\243\\326\\200\\325\\245\\326\\204 \\325\\260\\326\\200\\325\\241\\325\\264\\325\\241\\325\\266, \\325\\270\\326\\200\\325\\250 \\325\\257\\325\\257\\325\\241\\325\\277\\325\\241\\326\\200\\325\\276\\325\\253 PDF \\326\\206\\325\\241\\325\\265\\325\\254\\325\\270\\326\\202\\325\\264 \\325\\264\\325\\257\\325\\266\\325\\253\\325\\257\\325\\253 \\325\\257\\326\\200\\325\\257\\325\\266\\325\\241\\325\\257\\325\\253 \\325\\275\\325\\245\\325\\262\\325\\264\\325\\241\\325\\266 \\325\\252\\325\\241\\325\\264\\325\\241\\325\\266\\325\\241\\325\\257.\\0\"\\\n  \"\\324\\262\\325\\241\\326\\201\\325\\264\\325\\241\\325\\266 \\325\\275\\325\\255\\325\\241\\325\\254 %s\\0\"\\\n  \"\\324\\270&\\325\\266\\325\\277\\326\\200\\325\\265\\325\\241\\325\\254\\325\\266\\325\\245\\326\\200\\0\"\\\n  \"\\324\\261\\325\\274\\325\\241\\325\\273\\tAlt+->\\0\"\\\n  \"\\324\\261\\325\\264&\\325\\242\\325\\270\\325\\262\\325\\273 \\325\\247\\325\\257\\326\\200\\325\\241\\325\\266\\325\\270\\325\\276\\tCtrl+Shift+L\\0\"\\\n  \"\\324\\265\\326\\200\\325\\257\\325\\270\\326\\202 \\325\\247\\325\\273\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\245\\325\\262\\325\\241\\325\\276 \\325\\276\\325\\245\\326\\200\\325\\241\\325\\266\\325\\276\\325\\241\\325\\266\\325\\245\\325\\254 \\326\\206\\325\\241\\325\\265\\325\\254\\325\\250\\326\\211\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\247 \\325\\272\\325\\241\\325\\260\\325\\272\\325\\241\\325\\266\\325\\245\\325\\254 \\326\\206\\325\\241\\325\\265\\325\\254\\325\\270\\326\\202\\325\\264\\0\"\\\n  \"\\324\\261\\326\\200\\325\\241\\325\\243 \\325\\276\\325\\245\\325\\242 \\325\\244\\325\\253\\325\\277\\325\\270\\326\\202\\325\\264\\0\"\\\n  \"\\324\\270\\325\\266\\325\\277\\326\\200\\325\\265\\325\\241\\325\\254\\325\\266\\325\\245\\326\\200\\0\"\\\n  \"FictionBook \\326\\203\\325\\241\\325\\275\\325\\277\\325\\241\\325\\251\\325\\262\\325\\251\\325\\245\\326\\200\\0\"\\\n  \"%s \\326\\206\\325\\241\\325\\265\\325\\254\\325\\250 \\325\\271\\325\\253 \\325\\243\\325\\277\\325\\266\\325\\276\\325\\245\\325\\254\\0\"\\\n  \"\\325\\226\\325\\241\\325\\265\\325\\254\\325\\253 \\325\\271\\325\\241\\326\\203\\325\\250\\325\\235\\0\"\\\n  \"\\325\\226\\325\\241\\325\\265\\325\\254\\325\\235\\0\"\\\n  \"\\325\\223\\325\\266\\325\\277&\\326\\200\\325\\245\\325\\254...\\tCtrl+F\\0\"\\\n  \"\\324\\263\\325\\277\\325\\266\\325\\245\\325\\254\\0\"\\\n  \"\\324\\263\\325\\277\\325\\266\\325\\245\\325\\254 \\325\\260\\325\\241\\325\\273\\325\\270\\326\\200\\325\\244\\325\\250\\0\"\\\n  \"\\324\\263\\325\\277\\325\\266\\325\\245\\325\\254 \\325\\266\\325\\241\\325\\255\\325\\270\\326\\200\\325\\244\\325\\250\\0\"\\\n  \"\\324\\263\\325\\277\\325\\266\\325\\245\\325\\254.\\0\"\\\n  \"\\325\\200\\325\\241\\326\\200\\325\\264\\325\\241\\326\\200\\325\\245\\326\\201\\325\\266\\325\\245\\325\\254 &\\325\\242\\325\\270\\325\\276\\325\\241\\325\\266\\325\\244\\325\\241\\325\\257\\325\\270\\326\\202\\325\\251\\325\\265\\325\\270\\326\\202\\325\\266\\325\\250\\tCtrl+3\\0\"\\\n  \"\\324\\267\\325\\273\\325\\253 &\\325\\271\\325\\241\\326\\203\\325\\270\\325\\276\\tCtrl+0\\0\"\\\n  \"\\325\\200\\325\\241\\325\\276\\325\\241\\325\\275\\325\\241\\326\\200\\325\\245\\326\\201\\325\\266\\325\\245\\325\\254 &\\325\\254\\325\\241\\325\\265\\325\\266\\325\\270\\326\\202\\325\\251\\325\\265\\325\\241\\325\\264\\325\\242\\tCtrl+2\\0\"\\\n  \"\\325\\200\\325\\241\\326\\200\\325\\264\\325\\241\\326\\200\\325\\245\\326\\201\\325\\266\\325\\245\\325\\254 \\325\\242\\325\\270\\325\\276\\325\\241\\325\\266\\325\\244\\325\\241\\325\\257\\325\\270\\326\\202\\325\\251\\325\\265\\325\\270\\326\\202\\325\\266\\325\\250\\0\"\\\n  \"\\325\\201\\325\\243\\325\\245\\325\\254 \\325\\247\\325\\273\\325\\250\\0\"\\\n  \"\\325\\201\\325\\243\\325\\245\\325\\254 \\325\\254\\325\\241\\325\\265\\325\\266\\325\\270\\326\\202\\325\\251\\325\\265\\325\\241\\325\\264\\325\\242\\0\"\\\n  \"\\325\\201\\325\\243\\325\\245\\325\\254 \\325\\254\\325\\241\\325\\265\\325\\266\\325\\270\\326\\202\\325\\251\\325\\265\\325\\241\\325\\264\\325\\242 \\326\\207 \\326\\201\\325\\270\\326\\202\\326\\201\\325\\241\\325\\244\\326\\200\\325\\245\\325\\254 \\325\\247\\325\\273\\325\\245\\326\\200\\325\\250 \\325\\241\\325\\266\\325\\244\\325\\241\\325\\244\\325\\241\\326\\200\\0\"\\\n  \"\\325\\201\\325\\243\\325\\245\\325\\254 \\325\\264\\325\\245\\325\\257 \\325\\247\\325\\273\\325\\253 \\325\\271\\325\\241\\326\\203\\325\\270\\325\\276\\0\"\\\n  \"\\325\\217\\325\\241\\325\\274\\325\\241\\325\\277\\325\\245\\325\\275\\325\\241\\325\\266\\325\\245\\326\\200.\\0\"\\\n  \"\\324\\263\\326\\200\\326\\204\\325\\253 \\325\\257\\325\\241\\325\\246\\325\\264\\325\\270\\326\\200\\325\\270\\325\\267\\325\\270\\326\\202\\325\\264... %d \\325\\247\\325\\273\\0\"\\\n  \"\\325\\217\\325\\245\\326\\204\\325\\275\\325\\277\\325\\250 \\325\\243\\325\\277\\325\\266\\325\\276\\325\\245\\325\\254 \\325\\247 %s \\325\\247\\325\\273\\325\\270\\326\\202\\325\\264\\0\"\\\n  \"\\324\\263\\325\\277\\325\\266\\325\\245\\325\\254 \\325\\277\\325\\245\\326\\204\\325\\275\\325\\277 %s \\325\\247\\325\\273\\325\\270\\326\\202\\325\\264 (\\325\\257\\326\\200\\325\\257\\325\\253\\325\\266)\\0\"\\\n  \"\\325\\200\\325\\241\\325\\263\\325\\241\\325\\255 \\325\\250\\325\\266\\325\\251\\325\\245\\326\\200\\326\\201\\325\\276\\325\\241\\325\\256\\325\\266\\325\\245\\326\\200\\0\"\\\n  \"\\324\\263\\324\\262\\0\"\\\n  \"\\324\\261\\325\\266\\326\\201\\325\\266\\325\\245\\325\\254 \\325\\247\\325\\273\\325\\253\\0\"\\\n  \"\\324\\271\\325\\241\\326\\204\\326\\201\\325\\266\\325\\245\\325\\254 \\325\\260\\325\\241\\325\\263\\325\\241\\325\\255\\325\\241\\325\\257\\325\\253 \\325\\242\\325\\241\\326\\201\\325\\276\\325\\241\\325\\256\\325\\266\\325\\245\\326\\200\\325\\250\\0\"\\\n  \"\\325\\210\\326\\200\\325\\270\\325\\266\\325\\270\\326\\202\\325\\264\\325\\250 \\325\\257\\326\\200\\325\\257\\325\\266\\325\\245\\325\\254\\325\\270\\326\\202 \\325\\260\\325\\241\\325\\264\\325\\241\\326\\200 \\326\\205\\325\\243\\325\\277\\325\\241\\325\\243\\325\\270\\326\\200\\325\\256\\325\\245\\326\\204 F3 \\325\\257\\325\\270\\325\\263\\325\\241\\325\\257\\325\\250\\0\"\\\n  \"\\325\\212\\325\\241\\325\\277\\325\\257\\325\\245\\326\\200\\325\\253 \\326\\206\\325\\241\\325\\265\\325\\254\\325\\245\\326\\200 (*.%s)\\0\"\\\n  \"\\324\\277\\324\\262\\0\"\\\n  \"\\325\\204\\324\\262\\0\"\\\n  \"\\325\\200\\325\\241\\325\\275\\325\\277\\325\\241\\325\\277\\325\\245\\325\\236\\325\\254 SumatraPDF-\\325\\266 PDF \\326\\206\\325\\241\\325\\265\\325\\254\\325\\245\\326\\200\\325\\250 \\325\\242\\325\\241\\326\\201\\325\\270\\325\\262 \\325\\260\\325\\253\\325\\264\\325\\266\\325\\241\\325\\257\\325\\241\\325\\266 \\325\\256\\326\\200\\325\\241\\325\\243\\325\\253\\326\\200\\326\\211\\0\"\\\n  \"\\324\\261\\325\\275\\325\\270\\326\\201\\325\\253\\325\\241\\326\\201\\325\\266\\325\\245\\325\\254 PDF \\326\\206\\325\\241\\325\\265\\325\\254\\325\\245\\326\\200\\325\\250 SumatraPDF-\\325\\253 \\325\\260\\325\\245\\325\\277\\0\"\\\n  \"Man&ga \\325\\245\\325\\262\\325\\241\\325\\266\\325\\241\\325\\257\\0\"\\\n  \"\\325\\200\\325\\241\\325\\267\\325\\276\\325\\253 \\325\\241\\325\\274\\325\\266\\325\\245\\325\\254 \\325\\264\\325\\245\\325\\256\\325\\241\\325\\277\\325\\241\\325\\274/\\326\\203\\325\\270\\326\\204\\326\\200\\325\\241\\325\\277\\325\\241\\325\\274\\325\\250\\0\"\\\n  \"XPS \\326\\206\\325\\241\\325\\265\\325\\254\\325\\245\\326\\200\\0\"\\\n  \"\\325\\223\\325\\270\\326\\203\\325\\270\\325\\255\\325\\276\\325\\241\\325\\256\\325\\235\\0\"\\\n  \"\\325\\200\\325\\241\\325\\275\\325\\241\\325\\266\\325\\245\\325\\254\\325\\253 \\325\\247 \\325\\266\\325\\270\\326\\200\\325\\235 %s \\325\\277\\325\\241\\326\\200\\325\\242\\325\\245\\326\\200\\325\\241\\325\\257\\325\\250\\326\\211 \\325\\206\\325\\245\\326\\200\\325\\242\\325\\245\\325\\274\\325\\266\\325\\245\\325\\236\\325\\254 \\325\\266\\325\\270\\326\\200 \\325\\277\\325\\241\\326\\200\\325\\242\\325\\245\\326\\200\\325\\241\\325\\257\\325\\250\\326\\211\\0\"\\\n  \"\\325\\200\\325\\241\\325\\273\\325\\270\\326\\200\\325\\244 \\325\\247\\325\\273\\325\\250\\0\"\\\n  \"\\325\\210\\325\\271\\325\\253\\325\\266\\325\\271 \\325\\271\\325\\253 \\325\\243\\325\\277\\325\\266\\325\\276\\325\\245\\325\\254\\0\"\\\n  \"\\325\\210\\325\\271\\325\\253\\325\\266\\325\\271 \\325\\271\\325\\253 \\325\\243\\325\\277\\325\\266\\325\\276\\325\\245\\325\\254 %u \\325\\277\\325\\270\\325\\262\\325\\270\\326\\202\\325\\264 %s \\326\\206\\325\\241\\325\\265\\325\\254\\325\\253\\0\"\\\n  \"\\325\\211\\325\\245\\325\\266 \\325\\243\\325\\277\\325\\266\\325\\276\\325\\245\\325\\254 \\325\\260\\325\\241\\325\\264\\325\\241\\325\\266\\325\\264\\325\\241\\325\\266 \\326\\206\\325\\241\\325\\265\\325\\254\\325\\245\\326\\200\\0\"\\\n  \"\\324\\261\\325\\265\\325\\275\\325\\277\\325\\245\\325\\262 \\325\\271\\325\\257\\325\\241 \\325\\260\\325\\241\\325\\264\\325\\241\\325\\252\\325\\241\\325\\264\\325\\245\\326\\201\\325\\266\\325\\245\\325\\254\\325\\270\\326\\202 \\325\\260\\325\\241\\325\\264\\325\\241\\326\\200 \\325\\277\\325\\245\\325\\262\\325\\245\\325\\257\\325\\270\\326\\202\\325\\251\\325\\265\\325\\270\\326\\202\\325\\266\\0\"\\\n  \"\\324\\267\\325\\273\\325\\245\\326\\200\\325\\253 \\326\\204\\325\\241\\325\\266\\325\\241\\325\\257\\325\\250.\\0\"\\\n  \"\\324\\274\\324\\261\\325\\216\\0\"\\\n  \"\\324\\262\\325\\241\\326\\201\\325\\245\\325\\254\\0\"\\\n  \"\\324\\262\\325\\241\\326\\201\\325\\245\\325\\254 PDF-XChange-\\325\\270\\326\\202\\325\\264\\0\"\\\n  \"\\324\\262\\325\\241\\326\\201\\325\\245\\325\\254 \\326\\203\\325\\241\\325\\275\\325\\277\\325\\241\\325\\251\\325\\270\\326\\202\\325\\262\\325\\251...\\0\"\\\n  \"\\324\\262\\325\\241\\326\\201\\325\\245\\325\\254 %s-\\325\\270\\326\\202\\325\\264\\0\"\\\n  \"\\324\\262\\325\\241\\326\\201\\325\\245\\325\\254 &Adobe Reader-\\325\\270\\326\\202\\325\\264\\0\"\\\n  \"\\324\\262\\325\\241\\326\\201\\325\\245\\325\\254 &Foxit Reader-\\325\\270\\326\\202\\325\\264\\0\"\\\n  \"\\324\\262\\325\\241\\326\\201\\325\\245\\325\\254 Microsoft HTML Help-\\325\\270\\326\\202\\325\\264\\0\"\\\n  \"\\324\\262\\325\\241\\326\\201\\325\\245\\325\\254 Microsoft XPS-Viewer-\\325\\270\\326\\202\\325\\264\\0\"\\\n  \"\\325\\200&\\325\\241\\325\\277\\325\\257\\325\\270\\326\\202\\325\\251\\325\\265\\325\\270\\326\\202\\325\\266\\325\\266\\325\\245\\326\\200\\0\"\\\n  \"\\325\\200&\\325\\241\\325\\277\\325\\257\\325\\270\\326\\202\\325\\251\\325\\265\\325\\270\\326\\202\\325\\266\\325\\266\\325\\245\\326\\200...\\tCtrl+D\\0\"\\\n  \"PDF \\326\\206\\325\\241\\325\\265\\325\\254\\0\"\\\n  \"PDF-\\325\\253 \\325\\254\\325\\241\\325\\276\\325\\241\\326\\200\\325\\257\\325\\270\\326\\202\\325\\264\\325\\235\\0\"\\\n  \"PDF-\\325\\253 \\325\\241\\326\\200\\325\\277\\325\\241\\325\\244\\326\\200\\325\\270\\325\\262\\325\\235\\0\"\\\n  \"PDF-\\325\\253 \\325\\277\\325\\241\\326\\200\\325\\242\\325\\245\\326\\200\\325\\241\\325\\257\\325\\235\\0\"\\\n  \"PDF \\326\\206\\325\\241\\325\\265\\325\\254\\325\\245\\326\\200\\0\"\\\n  \"\\324\\267\\325\\273&\\325\\250...\\tCtrl+G\\0\"\\\n  \"\\324\\267\\325\\273 %s\\0\"\\\n  \"\\324\\267\\325\\273\\325\\253 \\325\\271\\325\\241\\326\\203\\325\\250.\\0\"\\\n  \"%u \\325\\247\\325\\273\\325\\250 \\325\\243\\325\\270\\325\\265\\325\\270\\326\\202\\325\\251\\325\\265\\325\\270\\326\\202\\325\\266 \\325\\271\\325\\270\\326\\202\\325\\266\\325\\253\\0\"\\\n  \"\\324\\267\\325\\273\\325\\253 \\325\\267\\325\\241\\326\\200\\325\\252\\325\\250\\0\"\\\n  \"\\324\\267\\325\\273\\325\\250.\\0\"\\\n  \"PalmDoc \\326\\203\\325\\241\\325\\275\\325\\277\\325\\241\\325\\251\\325\\262\\325\\251\\325\\245\\326\\200\\0\"\\\n  \"\\324\\275\\325\\266\\325\\244\\326\\200\\325\\270\\326\\202\\325\\264 \\325\\245\\325\\266\\326\\204 \\325\\275\\325\\272\\325\\241\\325\\275\\325\\245\\325\\254...\\0\"\\\n  \"\\325\\200\\325\\245\\325\\277\\325\\243\\326\\200\\325\\276\\325\\241\\325\\256\\326\\204\\325\\241\\325\\265\\325\\253\\325\\266 \\326\\206\\325\\241\\325\\265\\325\\254\\325\\245\\326\\200\\0\"\\\n  \"\\325\\206\\325\\245\\326\\200&\\325\\257\\325\\241\\325\\265\\325\\241\\326\\201\\325\\270\\326\\202\\325\\264\\tF5\\0\"\\\n  \"\\325\\206\\325\\241\\325\\255\\325\\270\\326\\200\\325\\244 \\325\\247\\325\\273\\325\\250\\0\"\\\n  \"\\325\\217\\325\\272\\325\\245\\325\\254\\0\"\\\n  \"\\325\\217\\325\\272\\325\\245\\325\\254\\325\\270\\326\\202 \\325\\257\\325\\241\\326\\200\\325\\243\\325\\250\\0\"\\\n  \"\\324\\261\\325\\265\\325\\275 \\325\\241\\325\\266\\325\\276\\325\\241\\325\\264\\325\\242 \\325\\277\\325\\272\\325\\253\\325\\271 \\325\\243\\325\\270\\325\\265\\325\\270\\326\\202\\325\\251\\325\\265\\325\\270\\326\\202\\325\\266 \\325\\271\\325\\270\\326\\202\\325\\266\\325\\253\\0\"\\\n  \"\\325\\217\\325\\272\\325\\270\\326\\202\\325\\264 \\325\\247:\\0\"\\\n  \"\\325\\217\\325\\272\\325\\270\\326\\202\\325\\264 \\325\\247: \\324\\270\\325\\266\\325\\244\\325\\260\\325\\241\\325\\277\\325\\245\\325\\236\\325\\254 \\326\\207 \\326\\203\\325\\241\\325\\257\\325\\245\\325\\254:\\0\"\\\n  \"\\325\\217\\325\\272\\325\\270\\326\\202\\325\\264 \\325\\247\\326\\211 \\324\\277\\325\\241\\325\\266\\325\\243\\325\\266\\325\\245\\326\\201\\325\\266\\325\\245\\325\\236\\325\\254\\326\\211\\0\"\\\n  \"\\325\\217\\325\\272\\325\\270\\326\\202\\325\\264 \\325\\247 %d \\325\\247\\325\\273\\325\\250 %d-\\325\\253\\326\\201...\\0\"\\\n  \"\\325\\215\\325\\255\\325\\241\\325\\254 \\325\\277\\325\\272\\325\\245\\325\\254\\325\\253\\325\\275\\0\"\\\n  \"\\325\\216\\325\\245&\\326\\200\\325\\241\\325\\266\\325\\276\\325\\241\\325\\266\\325\\245\\325\\254...\\tF2\\0\"\\\n  \"\\325\\200\\325\\253\\325\\267\\325\\245\\325\\254 &\\325\\242\\325\\241\\326\\201\\325\\276\\325\\241\\325\\256 \\326\\206\\325\\241\\325\\265\\325\\254\\325\\245\\326\\200\\325\\250\\0\"\\\n  \"\\325\\200\\325\\245\\325\\274\\325\\241\\326\\201\\325\\266\\325\\245\\325\\254 \\325\\250\\325\\266\\325\\277\\326\\200\\325\\265\\325\\241\\325\\254\\325\\266\\325\\245\\326\\200\\325\\253\\326\\201\\0\"\\\n  \"\\325\\200\\325\\245\\325\\274\\325\\241\\326\\201\\325\\266\\325\\245\\325\\254 %s  \\325\\247\\325\\273\\325\\250 \\325\\250\\325\\266\\325\\277\\326\\200\\325\\265\\325\\241\\325\\254\\325\\266\\325\\245\\326\\200\\325\\253\\326\\201\\0\"\\\n  \"\\325\\216\\325\\245\\326\\200\\325\\241\\325\\266\\325\\276\\325\\241\\325\\266\\325\\245\\325\\254\\325\\235\\0\"\\\n  \"\\325\\212\\325\\277\\325\\277\\325\\245\\325\\254 \\325\\261\\325\\241\\325\\255\\tCtrl+Shift+-\\0\"\\\n  \"\\325\\212\\325\\277\\325\\277\\325\\245\\325\\254 \\325\\241\\325\\273\\tCtrl+Shift++\\0\"\\\n  \"\\325\\212\\325\\241\\325\\260\\325\\272\\325\\241\\325\\266\\325\\245\\325\\254 \\325\\270\\326\\200\\325\\272\\325\\245\\325\\275\\0\"\\\n  \"\\325\\212\\325\\241\\325\\260\\325\\272\\325\\241\\325\\266\\325\\245\\325\\254 \\325\\272&\\325\\253\\325\\277\\325\\241\\325\\257\\325\\250...\\tCtrl+Shift+S\\0\"\\\n  \"\\325\\223\\325\\266\\325\\277\\326\\200\\325\\276\\325\\270\\326\\202\\325\\264 \\325\\247 %d-\\325\\253\\326\\201 %d\\0\"\\\n  \"\\325\\206\\325\\267\\325\\245\\325\\254 &\\325\\242\\325\\270\\325\\254\\325\\270\\326\\200\\325\\250\\0\"\\\n  \"\\325\\206\\325\\267\\325\\245\\325\\254 &\\325\\242\\325\\270\\325\\254\\325\\270\\326\\200\\325\\250\\tCtrl+A\\0\"\\\n  \"\\325\\206\\325\\267\\325\\245\\325\\254 \\325\\250\\325\\266\\325\\277\\326\\200\\325\\276\\325\\241\\325\\256\\325\\250 Ctrl+\\325\\264\\325\\257\\325\\266\\325\\253\\325\\257\\325\\253 \\325\\261\\325\\241\\325\\255 \\325\\257\\325\\270\\325\\263\\325\\241\\325\\257\\325\\270\\325\\276\\0\"\\\n  \"\\325\\206\\325\\267\\325\\276\\325\\241\\325\\256\\325\\250.\\0\"\\\n  \"\\325\\210\\326\\202\\325\\262\\325\\241\\326\\200\\325\\257\\325\\245\\325\\254 &\\325\\247\\325\\254. \\326\\203\\325\\270\\325\\275\\325\\277\\325\\270\\325\\276\\0\"\\\n  \"\\325\\206\\325\\267\\325\\245\\325\\254 \\326\\203\\325\\266\\325\\277\\326\\200\\325\\264\\325\\241\\325\\266 \\325\\260\\326\\200\\325\\241\\325\\264\\325\\241\\325\\266\\325\\266\\325\\245\\326\\200\\325\\253 \\325\\277\\325\\270\\325\\262\\325\\250\\0\"\\\n  \"\\325\\221\\325\\270\\326\\202\\326\\201\\325\\241\\325\\244\\326\\200\\325\\245\\325\\254 &\\324\\267\\325\\273\\325\\241\\325\\266\\325\\253\\325\\267\\325\\245\\326\\200\\325\\250\\0\"\\\n  \"\\324\\267\\325\\273\\325\\245\\326\\200\\325\\250 &\\326\\201\\325\\270\\326\\202\\326\\201\\325\\241\\325\\244\\326\\200\\325\\245\\325\\254 \\325\\267\\325\\241\\326\\200\\325\\270\\326\\202\\325\\266\\325\\241\\325\\257\\325\\241\\325\\257\\325\\241\\325\\266\\0\"\\\n  \"\\325\\221\\325\\270\\326\\202\\326\\201\\325\\241\\325\\244\\326\\200\\325\\245\\325\\254 &\\325\\243\\325\\270\\326\\200\\325\\256\\325\\253\\326\\204\\325\\266\\325\\245\\326\\200\\325\\250\\0\"\\\n  \"\\325\\221\\325\\270\\326\\202\\326\\201\\325\\241\\325\\244\\326\\200\\325\\245\\325\\254 \\325\\250\\325\\266\\325\\277\\326\\200\\325\\265\\325\\241\\325\\254\\325\\266\\325\\245\\326\\200\\325\\250\\0\"\\\n  \"\\325\\221\\325\\270\\326\\202\\326\\201\\325\\241\\325\\244\\326\\200\\325\\245\\325\\254 \\325\\260\\325\\241\\325\\263\\325\\241\\325\\255\\325\\241\\325\\257\\325\\253 \\325\\242\\325\\241\\326\\201\\325\\276\\325\\241\\325\\256\\325\\266\\325\\245\\326\\200\\325\\250\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200\\325\\270\\326\\202\\325\\251\\325\\265\\325\\241\\325\\266 \\325\\244\\325\\245\\325\\272\\326\\204\\325\\270\\326\\202\\325\\264 \\326\\201\\325\\270\\326\\202\\326\\201\\325\\241\\325\\244\\326\\200\\325\\245\\325\\254 &\\324\\267\\325\\273\\325\\245\\326\\200\\325\\250\\0\"\\\n  \"\\325\\204\\325\\245\\325\\257 \\325\\247\\325\\273\\0\"\\\n  \"\\324\\277\\325\\266\\325\\245\\326\\200\\325\\245\\326\\204, \\325\\275\\325\\241 \\325\\271\\325\\272\\325\\245\\325\\277\\326\\204 \\325\\247 \\325\\277\\325\\245\\325\\262\\325\\253 \\325\\270\\326\\202\\325\\266\\325\\245\\325\\266\\325\\241\\326\\200\\326\\211\\n\\n\\325\\215\\325\\245\\325\\262\\325\\264\\325\\245\\326\\204 '\\325\\211\\325\\245\\325\\262\\325\\241\\326\\200\\325\\257\\325\\245\\325\\254'\\325\\235\\325\\245\\325\\251\\325\\245 \\326\\201\\325\\241\\325\\266\\325\\257\\325\\241\\325\\266\\325\\270\\326\\202\\325\\264 \\325\\245\\326\\204 \\326\\205\\325\\243\\325\\266\\325\\245\\325\\254 \\325\\264\\325\\245\\325\\246 \\325\\276\\325\\245\\326\\200\\325\\241\\326\\201\\325\\266\\325\\245\\325\\254\\325\\270\\326\\202 \\325\\241\\325\\265\\325\\275 \\325\\275\\325\\255\\325\\241\\325\\254\\325\\250\\326\\211\\0\"\\\n  \"%s \\326\\206\\325\\241\\325\\265\\325\\254\\325\\250 \\325\\271\\325\\270\\326\\202\\325\\266\\325\\253 \\325\\260\\325\\241\\325\\264\\325\\241\\325\\252\\325\\241\\325\\264\\325\\245\\326\\201\\325\\264\\325\\241\\325\\266 \\325\\257\\325\\245\\325\\277\\0\"\\\n  \"\\325\\226\\325\\241\\325\\265\\325\\254\\325\\250.\\0\"\\\n  \"\\324\\270\\325\\266\\325\\277\\326\\200\\325\\241\\325\\266\\326\\204\\325\\266\\325\\245\\326\\200\\0\"\\\n  \"SumatraPDF-\\325\\253 \\325\\251\\325\\241\\326\\200\\325\\264\\325\\241\\326\\201\\325\\270\\326\\202\\325\\264\\325\\266\\325\\245\\326\\200\\0\"\\\n  \"SumatraPDF-\\325\\253 \\325\\261\\325\\241\\325\\255\\325\\270\\325\\262\\325\\270\\326\\202\\325\\264\\0\"\\\n  \"PDF \\326\\206\\325\\241\\325\\265\\325\\254\\325\\245\\326\\200\\325\\250 \\325\\241\\325\\275\\325\\270\\326\\201\\325\\253\\325\\241\\326\\201\\325\\276\\325\\245\\325\\254 \\325\\245\\325\\266 SumatraPDF-\\325\\253 \\325\\260\\325\\245\\325\\277\\0\"\\\n  \"PDF \\326\\206\\325\\241\\325\\265\\325\\254\\325\\245\\326\\200\\325\\250 \\325\\241\\325\\275\\325\\270\\326\\201\\325\\253\\325\\241\\326\\201\\325\\276\\325\\245\\326\\201\\325\\253\\325\\266 SumatraPDF-\\325\\253 \\325\\260\\325\\245\\325\\277\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\247 \\325\\242\\325\\241\\326\\201\\325\\245\\325\\254 \\325\\260\\325\\241\\325\\264\\325\\241\\325\\252\\325\\241\\325\\264\\325\\245\\326\\201\\325\\264\\325\\241\\325\\266 \\326\\206\\325\\241\\325\\265\\325\\254\\325\\250\\0\"\\\n  \"\\324\\277\\326\\201\\325\\276\\325\\241\\325\\256 PDF\\0\"\\\n  \"\\325\\217\\325\\245\\326\\204\\325\\275\\325\\277\\325\\241\\325\\265\\325\\253\\325\\266 \\326\\206\\325\\241\\325\\265\\325\\254\\325\\245\\326\\200\\0\"\\\n  \"\\325\\223\\325\\241\\325\\275\\325\\277\\325\\241\\325\\251\\325\\270\\326\\202\\325\\262\\325\\251\\325\\250 \\326\\205\\325\\243\\325\\277\\325\\241\\325\\243\\325\\270\\326\\200\\325\\256\\325\\270\\326\\202\\325\\264 \\325\\247 \\325\\271\\325\\241\\325\\273\\325\\241\\325\\257\\326\\201\\325\\276\\325\\270\\325\\262 \\325\\265\\325\\270\\326\\202\\326\\200\\325\\241\\325\\260\\325\\241\\325\\277\\325\\257\\325\\270\\326\\202\\325\\251\\325\\265\\325\\270\\326\\202\\325\\266\\325\\266\\325\\245\\326\\200 (%s) \\326\\207 \\325\\260\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\247 \\325\\266\\325\\270\\326\\200\\325\\264\\325\\241\\325\\254 \\325\\271\\325\\241\\325\\267\\325\\255\\325\\241\\325\\277\\325\\253:\\0\"\\\n  \"\\324\\261\\325\\266\\325\\270\\326\\202\\325\\266\\325\\250.\\0\"\\\n  \"\\324\\261\\325\\266\\325\\260\\325\\241\\325\\265\\325\\277 \\326\\206\\325\\241\\325\\265\\325\\254 (%s)\\0\"\\\n  \"\\324\\261\\325\\276\\325\\245\\325\\254\\325\\241\\326\\201\\325\\266\\325\\245\\325\\254 &\\325\\266\\325\\245\\326\\200\\325\\244\\325\\253\\326\\200\\325\\266\\325\\245\\326\\200\\0\"\\\n  \"\\325\\217\\325\\245\\325\\275\\326\\204\\0\"\\\n  \"\\324\\276\\326\\200\\325\\241\\325\\243\\326\\200\\325\\253 &\\325\\257\\325\\241\\325\\265\\326\\204\\325\\250\\0\"\\\n  \"\\324\\266\\325\\243\\325\\270\\326\\202\\325\\267\\325\\241\\326\\201\\325\\270\\326\\202\\325\\264\\0\"\\\n  \"XPS \\326\\206\\325\\241\\325\\265\\325\\254\\325\\245\\326\\200\\0\"\\\n  \"\\325\\215\\325\\241 \\325\\266\\325\\270\\326\\200\\325\\241\\325\\243\\325\\270\\326\\202\\325\\265\\325\\266 \\325\\277\\325\\241\\326\\200\\325\\242\\325\\245\\326\\200\\325\\241\\325\\257\\325\\266 \\325\\247\\326\\211\\0\"\\\n  \"\\324\\264\\325\\270\\326\\202\\326\\204 \\326\\205\\325\\243\\325\\277\\325\\241\\325\\243\\325\\270\\326\\200\\325\\256\\325\\270\\326\\202\\325\\264 \\325\\245\\326\\204 %s \\325\\277\\325\\241\\326\\200\\325\\242\\325\\245\\326\\200\\325\\241\\325\\257\\325\\250\\0\"\\\n  \"\\324\\264\\325\\253\\325\\277\\325\\241\\326\\203\\325\\270\\325\\255\\325\\245\\325\\254\\0\"\\\n  \"\\325\\204\\325\\245\\325\\256\\325\\241\\326\\201\\325\\266\\325\\245\\325\\254\\0\"\\\n  \"\\325\\223\\325\\270\\326\\204\\326\\200\\325\\241\\326\\201\\325\\266\\325\\245\\325\\254\\0\"\\\n  \"\\325\\211\\325\\241\\326\\203\\325\\253 \\325\\243\\325\\270\\326\\200\\325\\256\\325\\241\\325\\257\\325\\253\\326\\201\\325\\250\\0\"\\\n  \"[\\325\\200\\325\\241\\325\\265\\325\\277\\325\\266\\325\\241\\325\\242\\325\\245\\326\\200\\325\\276\\325\\245\\325\\254 \\325\\245\\325\\266 \\326\\203\\325\\270\\326\\203\\325\\270\\325\\255\\325\\270\\326\\202\\325\\251\\325\\265\\325\\270\\326\\202\\325\\266\\325\\266\\325\\245\\326\\200, \\325\\250\\325\\266\\325\\251\\325\\241\\325\\266\\325\\270\\326\\202\\325\\264 \\325\\247 \\325\\251\\325\\241\\326\\200\\325\\264\\325\\241\\326\\201\\325\\270\\326\\202\\325\\264] %s\\0\"\\\n  \"\\325\\217\\325\\245\\326\\204\\325\\275\\325\\277\\325\\250 \\325\\272\\325\\241\\325\\277\\325\\263\\325\\245\\325\\266\\325\\276\\325\\270\\326\\202\\325\\264 \\325\\247\\0\"\\\n  \"\\325\\226\\325\\241\\325\\265\\325\\254\\325\\250 \\325\\277\\325\\272\\325\\276\\325\\270\\326\\202\\325\\264 \\325\\247\\0\";\n\nconst char * gTranslations_az = \n  \"Proqram &haqq\\304\\261nda\\0\"\\\n  \"&H\\311\\231qiqi \\303\\266l\\303\\247\\303\\274\\tCtrl+1\\0\"\\\n  \"&\\306\\217lav\\311\\231 se\\303\\247iml\\311\\231r...\\0\"\\\n  \"&B\\303\\274t\\303\\274n se\\303\\247ilmi\\305\\237 s\\311\\231hif\\311\\231l\\311\\231r\\0\"\\\n  \"&Geri\\tAlt+Left Arrow\\0\"\\\n  \"&Kitab format\\304\\261\\tCtrl+8\\0\"\\\n  \"&Ba\\304\\237la\\tCtrl+W\\0\"\\\n  \"Se\\303\\247ilmi\\305\\237 sah\\311\\231ni &kopyala\\0\"\\\n  \"Se\\303\\247ilmi\\305\\237 &sah\\311\\231ni kopyala\\tCtrl+C\\0\"\\\n  \"Bir daha &soru\\305\\237ma\\0\"\\\n  \"Yaln\\304\\261z &c\\303\\274t s\\311\\231hif\\311\\231l\\311\\231r\\0\"\\\n  \"&C\\303\\274t s\\311\\231hif\\311\\231l\\311\\231r\\tCtrl+7\\0\"\\\n  \"&Fayl\\0\"\\\n  \"&Axtar\\304\\261lan s\\311\\231tir:\\0\"\\\n  \"&Birinci s\\311\\231hif\\311\\231\\tHome\\0\"\\\n  \"S\\311\\231hif\\311\\231l\\311\\231ri \\303\\247ap sa&h\\311\\231sin\\311\\231 s\\304\\261\\304\\237\\304\\261\\305\\237d\\304\\261r\\0\"\\\n  \"K&e\\303\\247id\\0\"\\\n  \"&S\\311\\231hif\\311\\231:\\0\"\\\n  \"&K\\303\\266m\\311\\231k\\0\"\\\n  \"&Ax\\304\\261r\\304\\261nc\\304\\261 s\\311\\231hif\\311\\231\\tEnd\\0\"\\\n  \"&B\\303\\266y\\303\\274tm\\311\\231:\\0\"\\\n  \"&T\\311\\231limat\\0\"\\\n  \"Re&gistri n\\311\\231z\\311\\231r\\311\\231 al\\0\"\\\n  \"&Sonrak\\304\\261 s\\311\\231hif\\311\\231\\tRight Arrow\\0\"\\\n  \"&Xeyr\\0\"\\\n  \"&Xeyr, t\\311\\231\\305\\237\\311\\231kk\\303\\274r!\\0\"\\\n  \"Yaln\\304\\261z t\\311\\231&k s\\311\\231hif\\311\\231l\\311\\231r\\0\"\\\n  \"S\\311\\231n\\311\\231di &a\\303\\247\\0\"\\\n  \"&A\\303\\247...\\tCtrl+O\\0\"\\\n  \"&Se\\303\\247iml\\311\\231r...\\0\"\\\n  \"&Parol:\\0\"\\\n  \"S\\311\\231n\\311\\231di &yadda saxla\\0\"\\\n  \"&\\306\\217vv\\311\\231lki s\\311\\231hif\\311\\231\\tLeft Arrow\\0\"\\\n  \"&\\303\\207ap et...\\0\"\\\n  \"&\\303\\207ap et...\\tCtrl+P\\0\"\\\n  \"&\\303\\207ap et... (imtina)\\0\"\\\n  \"Bu s\\311\\231n\\311\\231d \\303\\274\\303\\247\\303\\274n parolu &yadda saxla\\0\"\\\n  \"Bu &parametrl\\311\\231ri b\\303\\274t\\303\\274n s\\311\\231n\\311\\231dl\\311\\231r \\303\\274\\303\\247\\303\\274n yadda saxla\\0\"\\\n  \"S\\311\\231n\\311\\231di &sil\\0\"\\\n  \"&F\\311\\231rqli adla yadda saxla...\\0\"\\\n  \"F\\311\\231rqli adla &yadda saxla...\\tCtrl+S\\0\"\\\n  \"&Parametrl\\311\\231r\\0\"\\\n  \"Ehtiyac varsa, s\\311\\231hif\\311\\231l\\311\\231ri \\303\\247ap sah\\311\\231sinin \\303\\266l\\303\\247\\303\\274s\\303\\274n\\311\\231 g\\303\\266r\\311\\231 ki\\303\\247ilt\\0\"\\\n  \"&T\\311\\231k s\\311\\231hif\\311\\231\\tCtrl+6\\0\"\\\n  \"Bu &versiyan\\304\\261 burax\\0\"\\\n  \"S\\311\\231hif\\311\\231l\\311\\231rin &h\\311\\231qiqi \\303\\266l\\303\\247\\303\\274s\\303\\274\\0\"\\\n  \"&G\\303\\266r\\303\\274nt\\303\\274\\0\"\\\n  \"&P\\311\\231nc\\311\\231r\\311\\231\\0\"\\\n  \"&B\\311\\231li\\0\"\\\n  \"&Miqyas\\0\"\\\n  \"/ %d\\0\"\\\n  \"(s\\311\\231h. %s)\\0\"\\\n  \"SumatraPDF haqq\\304\\261nda\\0\"\\\n  \"Se\\303\\247ilmi\\305\\237l\\311\\231r\\311\\231 \\311\\231lav\\311\\231 et\\0\"\\\n  \"%s. s\\311\\231hif\\311\\231ni se\\303\\247ilmi\\305\\237l\\311\\231r\\311\\231 \\311\\231lav\\311\\231 et\\0\"\\\n  \"%s. s\\311\\231hif\\311\\231ni bu (ist\\311\\231nil\\311\\231n) adla se\\303\\247ilmi\\305\\237l\\311\\231r\\311\\231 \\311\\231lav\\311\\231 et:\\0\"\\\n  \"Se\\303\\247ilmi\\305\\237l\\311\\231r\\311\\231 \\311\\231lav\\311\\231 et\\0\"\\\n  \"\\306\\217lav\\311\\231\\0\"\\\n  \"B\\303\\274t\\303\\274n fayllar\\0\"\\\n  \"B\\303\\274t\\303\\274n d\\311\\231st\\311\\231kl\\311\\231n\\311\\231n s\\311\\231n\\311\\231dl\\311\\231r\\0\"\\\n  \"Proqram:\\0\"\\\n  \"PDF fayllarla \\311\\231laq\\311\\231 yarad\\304\\261ls\\304\\261n?\\0\"\\\n  \"Qo\\305\\237ma: %s\\0\"\\\n  \"M\\303\\274\\311\\231llif:\\0\"\\\n  \"Avtomatik\\0\"\\\n  \"Yenil\\311\\231m\\311\\231l\\311\\231ri avto&matik yoxla\\0\"\\\n  \"Kitab format\\304\\261\\0\"\\\n  \"&\\306\\217lf\\311\\231cinl\\311\\231r\\tF12\\0\"\\\n  \"\\306\\217lf\\311\\231cin yarl\\304\\261klar\\304\\261\\0\"\\\n  \"%s. (%s) s\\311\\231hif\\311\\231 yarl\\304\\261k\\304\\261n\\304\\261n \\311\\231lf\\311\\231cini\\0\"\\\n  \"\\306\\217lf\\311\\231cinl\\311\\231r\\0\"\\\n  \"bayt\\0\"\\\n  \"CHM s\\311\\231n\\311\\231dl\\311\\231ri\\0\"\\\n  \"\\304\\260nternet\\311\\231 qo\\305\\237ulmaq m\\303\\274mk\\303\\274n deyil (x\\311\\231ta %#x).\\0\"\\\n  \"\\304\\260mtina\\0\"\\\n  \"Bu fayl\\304\\261 \\303\\247ap etm\\311\\231k m\\303\\274mk\\303\\274n deyil\\0\"\\\n  \"T\\311\\231rs axtar\\304\\261\\305\\237 komandas\\304\\261n\\304\\261 icra etm\\311\\231k m\\303\\274mk\\303\\274n deyil. Komanda s\\311\\231trinin parametrl\\311\\231rini yoxlay\\304\\261n.\\0\"\\\n  \"Dili d\\311\\231yi\\305\\237dir (Change Language)\\0\"\\\n  \"&Yenilikl\\311\\231ri yoxla\\0\"\\\n  \"CBR, CBZ s\\311\\231n\\311\\231dl\\311\\231ri\\0\"\\\n  \"Uy\\304\\237unluq\\0\"\\\n  \"Ard\\304\\261c\\304\\261l s\\311\\231hif\\311\\231l\\311\\231r\\0\"\\\n  \"Ard\\304\\261c\\304\\261l kitab format\\304\\261\\0\"\\\n  \"Ard\\304\\261c\\304\\261l c\\303\\274t s\\311\\231hif\\311\\231l\\311\\231r\\0\"\\\n  \"T\\311\\231rc\\303\\274m\\311\\231y\\311\\231 k\\303\\266m\\311\\231k et\\0\"\\\n  \"&\\305\\236\\311\\231kli kopyala\\0\"\\\n  \"Ke\\303\\247idin &\\303\\274nvan\\304\\261n\\304\\261 kopyala\\0\"\\\n  \"&\\305\\236\\311\\231rhi kopyala\\0\"\\\n  \"M\\311\\231tni kopyalamaq m\\303\\274mk\\303\\274n olmad\\304\\261 (\\305\\237\\311\\231kil kimi kopyalan\\304\\261r)\\0\"\\\n  \"M\\303\\274\\311\\231lliflik h\\303\\274ququ:\\0\"\\\n  \"Printer x\\303\\274susiyy\\311\\231tl\\311\\231rini m\\303\\274\\311\\231yy\\311\\231n etm\\311\\231k m\\303\\274mk\\303\\274n olmad\\304\\261\\0\"\\\n  \"Printeri i\\305\\237\\311\\231 salmaq m\\303\\274mk\\303\\274n olmad\\304\\261\\0\"\\\n  \"S\\311\\231hif\\311\\231ni \\311\\231ks etdirm\\311\\231k m\\303\\274mk\\303\\274n olmad\\304\\261\\0\"\\\n  \"Haz\\304\\261rlanma tarixi:\\0\"\\\n  \"Haz\\304\\261rk\\304\\261 fayl\\0\"\\\n  \"Kursorun m\\303\\266vqeyi:\\0\"\\\n  \"Miq&yas\\304\\261 qeyd et...\\tCtrl+Y\\0\"\\\n  \"Standart &d\\303\\274z\\303\\274m:\\0\"\\\n  \"Standart miq&yas:\\0\"\\\n  \"Mobil rejimd\\311\\231 PDF fayllarla \\311\\231laq\\311\\231 yaratmaq m\\303\\274mk\\303\\274n deyil\\0\"\\\n  \"Qada\\304\\237an olunmu\\305\\237 h\\303\\274quqlar:\\0\"\\\n  \"DjVu s\\311\\231n\\311\\231dl\\311\\231ri\\0\"\\\n  \"S\\311\\231n\\311\\231din x\\303\\274susiyy\\311\\231tl\\311\\231ri\\0\"\\\n  \"B\\311\\231li\\0\"\\\n  \"\\303\\207\\304\\261x\\304\\261&\\305\\237\\tCtrl+Q\\0\"\\\n  \"EPUB e-kitablar\\304\\261\\0\"\\\n  \"Parolu daxil edin\\0\"\\\n  \"%s \\303\\274\\303\\247\\303\\274n parolu daxil edin\\0\"\\\n  \"PDF s\\311\\231n\\311\\231dinin \\303\\274st\\303\\274n\\311\\231 iki d\\311\\231f\\311\\231 basd\\304\\261qda \\303\\247a\\304\\237\\304\\261r\\304\\261lan komanda s\\311\\231trini daxil edin:\\0\"\\\n  \"%s fayl\\304\\261n\\304\\261n y\\303\\274kl\\311\\231nm\\311\\231sind\\311\\231 x\\311\\231ta ba\\305\\237 verdi\\0\"\\\n  \"&Se\\303\\247ilmi\\305\\237l\\311\\231r\\0\"\\\n  \"&\\304\\260r\\311\\231li\\tAlt+Right Arrow\\0\"\\\n  \"Tam ek&ran\\tCtrl+Shift+L\\0\"\\\n  \"C\\303\\274t s\\311\\231hif\\311\\231l\\311\\231r\\0\"\\\n  \"Fayl\\304\\261n ad\\304\\261n\\304\\261 d\\311\\231yi\\305\\237m\\311\\231k m\\303\\274mk\\303\\274n olmad\\304\\261!\\0\"\\\n  \"Fayl\\304\\261 yadda saxlamaq m\\303\\274mk\\303\\274n olmad\\304\\261\\0\"\\\n  \"S\\303\\274r\\311\\231tli veb-g\\303\\266r\\303\\274nt\\303\\274\\0\"\\\n  \"Se\\303\\247ilmi\\305\\237l\\311\\231r\\0\"\\\n  \"FictionBook s\\311\\231n\\311\\231dl\\311\\231ri\\0\"\\\n  \"Fayl %s tap\\304\\261lmad\\304\\261\\0\"\\\n  \"Fayl\\304\\261n h\\311\\231cmi:\\0\"\\\n  \"Fayl:\\0\"\\\n  \"A&xtar...\\tCtrl+F\\0\"\\\n  \"Axtar\\0\"\\\n  \"Sonrak\\304\\261n\\304\\261 tap\\0\"\\\n  \"\\306\\217vv\\311\\231lkini tap\\0\"\\\n  \"Axtar:\\0\"\\\n  \"&M\\311\\231zmuna g\\303\\266r\\311\\231 s\\304\\261\\304\\237\\304\\261\\305\\237d\\304\\261r\\tCtrl+3\\0\"\\\n  \"&S\\311\\231hif\\311\\231y\\311\\231 g\\303\\266r\\311\\231 s\\304\\261\\304\\237\\304\\261\\305\\237d\\304\\261r\\tCtrl+0\\0\"\\\n  \"&Geni\\305\\237liy\\311\\231 g\\303\\266r\\311\\231 s\\304\\261\\304\\237\\304\\261\\305\\237d\\304\\261r\\tCtrl+2\\0\"\\\n  \"M\\311\\231zmuna g\\303\\266r\\311\\231 s\\304\\261\\304\\237\\304\\261\\305\\237d\\304\\261r\\0\"\\\n  \"S\\311\\231hif\\311\\231y\\311\\231 g\\303\\266r\\311\\231 s\\304\\261\\304\\237\\304\\261\\305\\237d\\304\\261r\\0\"\\\n  \"Geni\\305\\237liy\\311\\231 g\\303\\266r\\311\\231 s\\304\\261\\304\\237\\304\\261\\305\\237d\\304\\261r\\0\"\\\n  \"S\\311\\231hif\\311\\231nin geni\\305\\237liyin\\311\\231 g\\303\\266r\\311\\231 s\\304\\261\\304\\237\\304\\261\\305\\237d\\304\\261r v\\311\\231 s\\311\\231hif\\311\\231l\\311\\231ri ard\\304\\261c\\304\\261l g\\303\\266st\\311\\231r\\0\"\\\n  \"T\\311\\231k s\\311\\231hif\\311\\231y\\311\\231 s\\304\\261\\304\\237\\304\\261\\305\\237d\\304\\261r\\0\"\\\n  \"Fontlar:\\0\"\\\n  \"Kitab formatlan\\304\\261r... %d s\\311\\231h.\\0\"\\\n  \"M\\311\\231tn %s. s\\311\\231hif\\311\\231d\\311\\231 tap\\304\\261ld\\304\\261\\0\"\\\n  \"M\\311\\231tn %s. s\\311\\231hif\\311\\231d\\311\\231 (t\\311\\231krar) tap\\304\\261ld\\304\\261\\0\"\\\n  \"\\306\\217n \\303\\247ox oxunanlar\\0\"\\\n  \"\\0\"\\\n  \"S\\311\\231hif\\311\\231y\\311\\231 ke\\303\\247\\0\"\\\n  \"\\306\\217n \\303\\247ox oxunanlar\\304\\261 gizl\\311\\231t\\0\"\\\n  \"T\\311\\231krar axtar\\304\\261\\305\\237 \\303\\274\\303\\247\\303\\274n F3 d\\303\\274ym\\311\\231sin\\311\\231 bas\\304\\261n\\0\"\\\n  \"\\305\\236\\311\\231kil fayllar\\304\\261 (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"SumatraPDF PDF fayllar\\304\\261n g\\303\\266r\\303\\274nt\\303\\274l\\311\\231nm\\311\\231si \\303\\274\\303\\247\\303\\274n standart proqram edilsin?\\0\"\\\n  \"SumatraPDF-i PDF fayllarla \\311\\231laq\\311\\231l\\311\\231ndir\\0\"\\\n  \"Man&qa rejimi\\0\"\\\n  \"Registri n\\311\\231z\\311\\231r\\311\\231 al\\0\"\\\n  \"Mobi s\\311\\231n\\311\\231dl\\311\\231ri\\0\"\\\n  \"D\\311\\231yi\\305\\237iklik tarixi:\\0\"\\\n  \"Yeni versiya %s m\\303\\266vcuddur. Endirilsin?\\0\"\\\n  \"Sonrak\\304\\261 s\\311\\231hif\\311\\231\\0\"\\\n  \"Uy\\304\\237un m\\311\\231tn tap\\304\\261lmad\\304\\261\\0\"\\\n  \"%u s\\311\\231trin\\311\\231 uy\\304\\237un olan n\\311\\231tic\\311\\231 %s fayl\\304\\261nda tap\\304\\261lmad\\304\\261\\0\"\\\n  \"Sinxronla\\305\\237d\\304\\261rma fayl\\304\\261 tap\\304\\261lmad\\304\\261\\0\"\\\n  \"Bu m\\303\\266vqed\\311\\231 sinxronla\\305\\237d\\304\\261rma m\\311\\231lumat\\304\\261 yoxdur\\0\"\\\n  \"S\\311\\231hif\\311\\231 say\\304\\261:\\0\"\\\n  \"\\0\"\\\n  \"A\\303\\247\\0\"\\\n  \"PD&F-XChange-d\\311\\231 a\\303\\247\\0\"\\\n  \"S\\311\\231n\\311\\231di a\\303\\247...\\0\"\\\n  \"%s il\\311\\231 a\\303\\247\\0\"\\\n  \"&Adobe Reader-d\\311\\231 a\\303\\247\\0\"\\\n  \"&Foxit Reader-d\\311\\231 a\\303\\247\\0\"\\\n  \"Microsoft &HTML Help-d\\311\\231 a\\303\\247\\0\"\\\n  \"Microsoft &XPS-Viewer-d\\311\\231 a\\303\\247\\0\"\\\n  \"&X\\303\\274susiyy\\311\\231tl\\311\\231r\\0\"\\\n  \"&X\\303\\274susiyy\\311\\231tl\\311\\231r\\tCtrl+D\\0\"\\\n  \"PDF s\\311\\231n\\311\\231di\\0\"\\\n  \"PDF optimalla\\305\\237d\\304\\261rmas\\304\\261:\\0\"\\\n  \"PDF kompilyatoru:\\0\"\\\n  \"PDF versiyas\\304\\261:\\0\"\\\n  \"PDF s\\311\\231n\\311\\231dl\\311\\231ri\\0\"\\\n  \"S\\311\\231&hif\\311\\231...\\tCtrl+G\\0\"\\\n  \"S\\311\\231hif\\311\\231 %s\\0\"\\\n  \"S\\311\\231hif\\311\\231 \\303\\266l\\303\\247\\303\\274s\\303\\274:\\0\"\\\n  \"S\\311\\231hif\\311\\231 %u m\\303\\266vcud deyil\\0\"\\\n  \"S\\311\\231hif\\311\\231l\\311\\231rin miqyaslanmas\\304\\261\\0\"\\\n  \"S\\311\\231hif\\311\\231:\\0\"\\\n  \"PalmDoc s\\311\\231n\\311\\231dl\\311\\231ri\\0\"\\\n  \"G\\303\\266r\\303\\274nt\\303\\274 haz\\304\\261rlan\\304\\261r, l\\303\\274tf\\311\\231n g\\303\\266zl\\311\\231yin...\\0\"\\\n  \"Postscript s\\311\\231n\\311\\231dl\\311\\231ri\\0\"\\\n  \"T\\311\\231&qdimat\\tCtrl+L\\0\"\\\n  \"\\306\\217vv\\311\\231lki s\\311\\231hif\\311\\231\\0\"\\\n  \"\\303\\207ap et\\0\"\\\n  \"\\303\\207ap diapazonu\\0\"\\\n  \"Bu adda printer m\\303\\266vcud deyil\\0\"\\\n  \"\\303\\207ap davam edir.\\0\"\\\n  \"\\303\\207ap davam edir. Dayand\\304\\261rmaq v\\311\\231 proqramdan \\303\\247\\304\\261xmaq?\\0\"\\\n  \"\\303\\207ap davam edir. Dayand\\304\\261rmaq v\\311\\231 yenid\\311\\231n ba\\305\\237lamaq?\\0\"\\\n  \"%d/%d s\\311\\231hif\\311\\231 \\303\\247ap olunur...\\0\"\\\n  \"\\303\\207ap x\\311\\231tas\\304\\261.\\0\"\\\n  \"A&d\\304\\261n\\304\\261 d\\311\\231yi\\305\\237dir...\\tF2\\0\"\\\n  \"&A\\303\\247\\304\\261lm\\304\\261\\305\\237 fayllar\\304\\261 yadda saxla\\0\"\\\n  \"Se\\303\\247ilmi\\305\\237l\\311\\231rd\\311\\231n sil\\0\"\\\n  \"%s. s\\311\\231hif\\311\\231ni se\\303\\247ilmi\\305\\237l\\311\\231rd\\311\\231n sil\\0\"\\\n  \"Ad\\304\\261n\\304\\261 d\\311\\231yi\\305\\237dir\\0\"\\\n  \"So&la d\\303\\266nd\\311\\231r\\tCtrl+Shift+-\\0\"\\\n  \"Sa&\\304\\237a d\\303\\266nd\\311\\231r\\tCtrl+Shift++\\0\"\\\n  \"F\\311\\231rqli adla yadda saxla\\0\"\\\n  \"Yarl\\304\\261&\\304\\237\\304\\261 yadda saxla...\\tCtrl+Shift+S\\0\"\\\n  \"%d/%d axtar\\304\\261l\\304\\261r...\\0\"\\\n  \"&Ham\\304\\261s\\304\\261n\\304\\261 se\\303\\247\\0\"\\\n  \"&Ham\\304\\261s\\304\\261n\\304\\261 se\\303\\247\\tCtrl+A\\0\"\\\n  \"M\\311\\231zmunu Ctrl+sol si\\303\\247an d\\303\\274ym\\311\\231si il\\311\\231 se\\303\\247\\0\"\\\n  \"Se\\303\\247m\\311\\231:\\0\"\\\n  \"&E-po\\303\\247tla g\\303\\266nd\\311\\231r...\\0\"\\\n  \"T\\311\\231rs axtar\\304\\261\\305\\237 komandas\\304\\261n\\304\\261 t\\311\\231yin etm\\311\\231k\\0\"\\\n  \"\\306\\217&lf\\311\\231cinl\\311\\231ri g\\303\\266st\\311\\231r\\0\"\\\n  \"S\\311\\231hif\\311\\231l\\311\\231ri &ard\\304\\261c\\304\\261l g\\303\\266st\\311\\231r\\0\"\\\n  \"Al\\311\\231tl\\311\\231r &panelini g\\303\\266st\\311\\231r\\0\"\\\n  \"Se\\303\\247ilmi\\305\\237l\\311\\231ri g\\303\\266st\\311\\231r\\0\"\\\n  \"\\306\\217n \\303\\247ox oxunanlar\\304\\261 g\\303\\266st\\311\\231r\\0\"\\\n  \"M\\303\\274mk\\303\\274nd\\303\\274rs\\311\\231, \\311\\231&lf\\311\\231cinl\\311\\231r panelini g\\303\\266st\\311\\231r\\0\"\\\n  \"T\\311\\231k s\\311\\231hif\\311\\231\\0\"\\\n  \"Ba\\304\\237\\304\\261\\305\\237lay\\304\\261n, g\\303\\266zl\\311\\231nilm\\311\\231z x\\311\\231ta ba\\305\\237 verdi!\\n\\nProblemin h\\311\\231llind\\311\\231 biz\\311\\231 k\\303\\266m\\311\\231k etm\\311\\231k \\303\\274\\303\\247\\303\\274n \\\"\\304\\260mtina\\\" d\\303\\274ym\\311\\231sin\\311\\231 bas\\304\\261n.\\0\"\\\n  \"%s m\\311\\231nb\\311\\231 fayl\\304\\261n\\304\\261n sinxronla\\305\\237d\\304\\261rma m\\303\\266vqeyi yoxdur\\0\"\\\n  \"M\\303\\266vzu:\\0\"\\\n  \"SumatraPDF se\\303\\247iml\\311\\231ri\\0\"\\\n  \"SumatraPDF yenil\\311\\231m\\311\\231si\\0\"\\\n  \"SumatraPDF \\311\\231m\\311\\231liyyat\\304\\261 q\\311\\231za il\\311\\231 n\\311\\231tic\\311\\231l\\311\\231ndi\\0\"\\\n  \"SumatraPDF PDF fayllar\\304\\261 il\\311\\231 \\311\\231laq\\311\\231l\\311\\231ndirilmi\\305\\237dir\\0\"\\\n  \"SumatraPDF art\\304\\261q PDF fayllar\\304\\261 il\\311\\231 \\311\\231laq\\311\\231l\\311\\231ndirilmi\\305\\237dir\\0\"\\\n  \"Sinxronla\\305\\237d\\304\\261rma fayl\\304\\261n\\304\\261 a\\303\\247maq m\\303\\274mk\\303\\274n deyil\\0\"\\\n  \"Teql\\311\\231nmi\\305\\237 PDF\\0\"\\\n  \"M\\311\\231tn s\\311\\231n\\311\\231dl\\311\\231ri\\0\"\\\n  \"Bu s\\311\\231n\\311\\231d d\\311\\231st\\311\\231kl\\311\\231nm\\311\\231y\\311\\231n funksiyalardan (%s) istifad\\311\\231 edir v\\311\\231 d\\303\\274zg\\303\\274n \\311\\231ks olunmaya bil\\311\\231r\\0\"\\\n  \"Ba\\305\\237l\\304\\261q:\\0\"\\\n  \"Nam\\311\\231lum m\\311\\231nb\\311\\231 fayl\\304\\261 (%s)\\0\"\\\n  \"&Tab-v\\311\\231r\\311\\231q\\311\\231l\\311\\231rd\\311\\231n istifad\\311\\231 et\\0\"\\\n  \"G\\303\\266r\\303\\274nt\\303\\274\\0\"\\\n  \"Proqram\\304\\261n &vebsayt\\304\\261na ke\\303\\247\\0\"\\\n  \"X\\311\\231b\\311\\231rdarl\\304\\261q\\0\"\\\n  \"XPS s\\311\\231n\\311\\231dl\\311\\231ri\\0\"\\\n  \"\\306\\217n son versiyan\\304\\261 istifad\\311\\231 edirsiniz.\\0\"\\\n  \"Siz proqram\\304\\261n %s versiyas\\304\\261n\\304\\261 istifad\\311\\231 edirsiniz.\\0\"\\\n  \"Miqyas\\0\"\\\n  \"B\\303\\266y\\303\\274t\\0\"\\\n  \"Ki\\303\\247ilt\\0\"\\\n  \"Miqyas\\0\"\\\n  \"[D\\311\\231yi\\305\\237iklikl\\311\\231r m\\303\\274\\311\\231yy\\311\\231n edildi; yenil\\311\\231nm\\311\\231] %s\\0\"\\\n  \"m\\311\\231tnin kopyalanmas\\304\\261\\0\"\\\n  \"s\\311\\231n\\311\\231din \\303\\247ap olunmas\\304\\261\\0\";\n\nconst char * gTranslations_eu = \n  \"&Honi buruz...\\0\"\\\n  \"&Oraingo Neurria\\tKtrl+1\\0\"\\\n  \"Au&kera aurreratuak...\\0\"\\\n  \"&Hautatutako orrialde guztiak\\0\"\\\n  \"A&tzera\\tAlt+Ezker Gezia\\0\"\\\n  \"&Liburu Ikuspegia\\tKtrl+8\\0\"\\\n  \"It&xi\\tKtrl+W\\0\"\\\n  \"&Kopiatu Hautapena\\0\"\\\n  \"&Kopiatu Hautapena\\tKtrl+C\\0\"\\\n  \"&Ez galdetu berriro\\0\"\\\n  \"&Orrialde bakoitiak bakarrik\\0\"\\\n  \"&Bi Aldeetatik\\tKtrl+7\\0\"\\\n  \"&Agiria\\0\"\\\n  \"&Bilatu hau:\\0\"\\\n  \"&Lehen Orrialdea\\tHasiera\\0\"\\\n  \"&Zuzendu orrialdeak eremu irarkigarrira\\0\"\\\n  \"&Joan Hona\\0\"\\\n  \"J&oan orrialdera:\\0\"\\\n  \"&Laguntza\\0\"\\\n  \"A&zken Orrialdea\\tAmaiera\\0\"\\\n  \"&Handipena:\\0\"\\\n  \"E&skuliburua\\0\"\\\n  \"&Hizki larri-xeheak bereizi\\0\"\\\n  \"&Hurrengo Orrialdea\\tEskuin Gezia\\0\"\\\n  \"&Ez\\0\"\\\n  \"&Ez, eskerrik asko\\0\"\\\n  \"&Orrialde bikoitiak bakarrik\\0\"\\\n  \"&Ireki Agiria\\0\"\\\n  \"&Ireki...\\tKtrl+O\\0\"\\\n  \"A&ukerak...\\0\"\\\n  \"Sarhitza\\0\"\\\n  \"&Pin Agiria\\0\"\\\n  \"&Aurreko Orrialdea\\tEzker Gezia\\0\"\\\n  \"&Irarkitu...\\0\"\\\n  \"Irarkit&u...\\tKtrl+P\\0\"\\\n  \"&Irarkitu... (ukatuta)\\0\"\\\n  \"&Gogoratu agiri honetarako sarhitza\\0\"\\\n  \"G&ogoratu ezarpen hauek agiri bakoitzerako\\0\"\\\n  \"&Kendu Agira\\0\"\\\n  \"&Gorde Honela...\\0\"\\\n  \"&Gorde Honela...\\tKtrl+S\\0\"\\\n  \"&Ezarpenak\\0\"\\\n  \"&Txikitu orrialdeak eremu irarkigarrira (beharrezkoa bada)\\0\"\\\n  \"&Orrialde Bakarra\\tKtrl+6\\0\"\\\n  \"&Ahaztu bertsio hau\\0\"\\\n  \"E&rabili jatorrizko orrilde neurria\\0\"\\\n  \"I&kusi\\0\"\\\n  \"Lei&hoa\\0\"\\\n  \"&Bai\\0\"\\\n  \"&Zooma\\0\"\\\n  \"(%d-tik)\\0\"\\\n  \"(%s orrialdea)\\0\"\\\n  \"SumatraPDF-ri buruz\\0\"\\\n  \"Gehitu Gogokoena\\0\"\\\n  \"Gehitu %s Orrialdea Gogokoenetara\\0\"\\\n  \"Gehitu %s Gogokoenetara (aukerazkoa) Izenarekin:\\0\"\\\n  \"Gehitu Gogokoenetara\\0\"\\\n  \"Aurreratua\\0\"\\\n  \"Agiri guztiak\\0\"\\\n  \"Sostengatutako agiri guztiak\\0\"\\\n  \"Aplikazioa:\\0\"\\\n  \"Elkartu PDF agiriekin?\\0\"\\\n  \"Eranspena: %s\\0\"\\\n  \"Egilea:\\0\"\\\n  \"Berezgaitasunez\\0\"\\\n  \"&Berezgaitasunez egiaztatu eguneraketak\\0\"\\\n  \"Liburu Ikuspena\\0\"\\\n  \"&Gogokoenak\\tF12\\0\"\\\n  \"Gogoekoenen Lasterbideak\\0\"\\\n  \"Lastermarka lasterbidea %s orrialdeari %s-tik\\0\"\\\n  \"Gogokoenak\\0\"\\\n  \"Byte\\0\"\\\n  \"CHM agiriak\\0\"\\\n  \"Ezinezkoa Internetera elkarketatzea (%#x akatsa).\\0\"\\\n  \"Ezeztatu\\0\"\\\n  \"Ezinezkoa agiri hau irarkitzea\\0\"\\\n  \"Ezinezkoa alderantzizko bilaketa komandoa hastea. Mesedez, egiaztatu komando lerroa ezarpenetan.\\0\"\\\n  \"&Aldatu Hizkuntza\\0\"\\\n  \"&Egiaztatu Eguneraketak\\0\"\\\n  \"Komiki liburuak\\0\"\\\n  \"Bateragarritasuna\\0\"\\\n  \"Jarraian\\0\"\\\n  \"Liburu Ikuspegi Jarraia\\0\"\\\n  \"Bi aldeetatik jarraian\\0\"\\\n  \"Lagundu Itzultzen\\0\"\\\n  \"Kopiatu &Irudia\\0\"\\\n  \"Kopiatu &Lotura Helbidea\\0\"\\\n  \"Kopiatu Ira&dokizuna\\0\"\\\n  \"Idazkia kopiatzea eragotzita (kopiatzea irudi bezala bakarrik)\\0\"\\\n  \"Copyrighta:\\0\"\\\n  \"Ezinezkoa Irarkailu ezaugarriak lortzea\\0\"\\\n  \"Ezinezkoa irarkailua abiaraztea\\0\"\\\n  \"Ezinezkoa orrialdea aurkeztea\\0\"\\\n  \"Sortua:\\0\"\\\n  \"Oraingo agiria\\0\"\\\n  \"Kurtsorearen kokapena:\\0\"\\\n  \"Egile Zoo&ma...\\tKtrl+Y\\0\"\\\n  \"Berezko &Egitura:\\0\"\\\n  \"Berezko &Zooma:\\0\"\\\n  \"Berezko PDF irakurtzailea ezin da eramangarri moduan aldatu\\0\"\\\n  \"Baimen Ukatuak:\\0\"\\\n  \"DjVu agiriak\\0\"\\\n  \"Agiriaren Ezaugarriak\\0\"\\\n  \"Jeitsi\\0\"\\\n  \"I&rten\\tKtrl+Q\\0\"\\\n  \"EPUB agiriak\\0\"\\\n  \"Idatzi sarhitza\\0\"\\\n  \"Idatzi %s-rentzako sarhitza\\0\"\\\n  \"Idatzi deitzeko agindu-lerroa PDF agirian klik-bikoitza egiten duzunean:\\0\"\\\n  \"Akatsa %s gertatzerakoan\\0\"\\\n  \"&Gogokoenak\\0\"\\\n  \"A&urrera\\tAlt+Eskuin Gezia\\0\"\\\n  \"&Ikusleiho-osoan\\tKtrl+Shift+L\\0\"\\\n  \"Bi Aldeetatik\\0\"\\\n  \"Hutsegitea agiria berrizendatzerakoan!\\0\"\\\n  \"Hutsegitea agiria gordetzerakoan\\0\"\\\n  \"Web Ikuspen Azkarra\\0\"\\\n  \"Gogokoenak\\0\"\\\n  \"FikzioLiburu agiriak\\0\"\\\n  \"%s agiria ez da aurkitu\\0\"\\\n  \"Agiriaren neurria:\\0\"\\\n  \"Agiria:\\0\"\\\n  \"&Bilatu...\\tKtrl+F\\0\"\\\n  \"Bilatu\\0\"\\\n  \"Bilatu Hurrengoa\\0\"\\\n  \"Bilatu Aurrekoa\\0\"\\\n  \"Bilatu:\\0\"\\\n  \"Finkatu &Edukia\\tKtrl+3\\0\"\\\n  \"&Finkatu Orrialdea\\tKtrl+O\\0\"\\\n  \"Finkatu &Zabalera\\tKtrl+2\\0\"\\\n  \"Finkatu Edukia\\0\"\\\n  \"Finkatu Orrialdea\\0\"\\\n  \"Finkatu Zabalera\\0\"\\\n  \"Finkatu Zabalera eta Erakutsi Orrialdeak Jarraian\\0\"\\\n  \"Finkatu Orrialde Bakar bat\\0\"\\\n  \"Hizi-motak:\\0\"\\\n  \"Liburua formateatzen... %d orrialde\\0\"\\\n  \"Bilatu idazkia %s orrialdean\\0\"\\\n  \"Bilatu idazkia %s orrialdean (berriro)\\0\"\\\n  \"Sarri Irakurriak\\0\"\\\n  \"\\0\"\\\n  \"Joan orrialdera\\0\"\\\n  \"Ezkutatu sarri irakurriak\\0\"\\\n  \"Oharra: Erabili F3 tekla berriro bilatzeko\\0\"\\\n  \"Irudi agiriak (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Egin SumatraPFD berezko aplikazioa PDF agirientzat?\\0\"\\\n  \"Egin SumatraPDF nire berezko PDF irakurlea\\0\"\\\n  \"Ma&nga Modua\\0\"\\\n  \"Hizki Larriak-xeheak Bereizi\\0\"\\\n  \"Mobi agiriak\\0\"\\\n  \"Aldatuta:\\0\"\\\n  \"%s bertsio berria eskuragarri dago. Jeitsi bertsio berria?\\0\"\\\n  \"Hurrengo Orrialdea\\0\"\\\n  \"Ez da emaitzik aurkitu\\0\"\\\n  \"Ez da emaitzik aurkitu %u lerro inguran %s agirian\\0\"\\\n  \"Aldiberetze agiria ez da aurkitu\\0\"\\\n  \"Ez dago aldiberetze argibiderik toki honetan\\0\"\\\n  \"Orrialde Zenbatekoa:\\0\"\\\n  \"Ongi\\0\"\\\n  \"Ireki\\0\"\\\n  \"Ireki PDF-XChangen\\0\"\\\n  \"Ireki agiri bat...\\0\"\\\n  \"Irekitzea %s\\0\"\\\n  \"Ireki &Adobe Readerren\\0\"\\\n  \"Ireki &Foxit Readerren\\0\"\\\n  \"Ireki Microsoft HTML Laguntzan\\0\"\\\n  \"Ireki Microsoft XPS-Ikusgailuan\\0\"\\\n  \"Eza&ugarriak\\0\"\\\n  \"&Ezaugarriak\\tKtrl+D\\0\"\\\n  \"PDF Agiria\\0\"\\\n  \"PDF Hobekuntzak:\\0\"\\\n  \"PDF Egilea:\\0\"\\\n  \"PDF Bertsioa:\\0\"\\\n  \"PDF agiriak\\0\"\\\n  \"&Orrialdea...\\tKtrl+G\\0\"\\\n  \"%s Orrialdea\\0\"\\\n  \"Orrialde Neurria:\\0\"\\\n  \"%u orrialde zenbakia ez dago\\0\"\\\n  \"Orrialdea neurriratzen\\0\"\\\n  \"Orrialdea:\\0\"\\\n  \"PalmDoc agiriak\\0\"\\\n  \"Mesedez itxaron - aurkezten...\\0\"\\\n  \"Postscript agirak\\0\"\\\n  \"&Aurkezpena\\tKtrl+L\\0\"\\\n  \"Aurreko Orrialdea\\0\"\\\n  \"Irarkitu\\0\"\\\n  \"Irarketa eremua\\0\"\\\n  \"Ez dagi emandako izenik duen irarkailurik\\0\"\\\n  \"Irarketa garatzen.\\0\"\\\n  \"Irarketa oraindik garatzen ari da. Eten eta utzi?\\0\"\\\n  \"Irarketa oraindik garatzen ari da. Utzi eta berriro hasi?\\0\"\\\n  \"%d orria %d-tik irarkitzen...\\0\"\\\n  \"Arazoak irarkitzerakoan.\\0\"\\\n  \"&Berrizendatu...\\tF2\\0\"\\\n  \"&Gogoratu irekitako agiriak\\0\"\\\n  \"Kendu Gogokoenetatik\\0\"\\\n  \"Kendu %s orrialdea gogokoenetatik\\0\"\\\n  \"Berrizendatu Honela\\0\"\\\n  \"Itzulikatu E&zkerrerantz\\tKtrl+Shift+-\\0\"\\\n  \"Itzulikatu E&skuinera\\tKtrl+Shift++\\0\"\\\n  \"Gorde Honela\\0\"\\\n  \"Gorde &Lasterbidea...\\tKtrl+Shift+S\\0\"\\\n  \"%d-tik %d bilatzen...\\0\"\\\n  \"Hautatu G&uztiak\\0\"\\\n  \"&Hautatu Guztiak\\tKtrl+A\\0\"\\\n  \"Hautatu edukia Ktrl+ezker sagu botoiarekin\\0\"\\\n  \"Hautatpena:\\0\"\\\n  \"&Post@z bidali...\\0\"\\\n  \"Ezarri alderantzizko bilaketa agindu-lerroa\\0\"\\\n  \"Erakutsi Laster&markak\\0\"\\\n  \"&Erakutsi Orrialdeak Jarraian\\0\"\\\n  \"Erakutsi &Tresnabarra\\0\"\\\n  \"Erakutsi Gogokoenak\\0\"\\\n  \"Erakutsi Sarri irakurriak\\0\"\\\n  \"E&rakutsi lastermarka albobarra eskuragarri dagoenean\\0\"\\\n  \"Orrialde Bakarra\\0\"\\\n  \"Barkatu, hau ez litzake gertatu behar!\\n\\nMesedez sakatu 'ezeztatu', matxura hau eragin duena zuzentzen laguntzea nahi badiguzu.\\0\"\\\n  \"%s iturburu agiriak ez du aldiberetze punturik\\0\"\\\n  \"Gaia:\\0\"\\\n  \"SumatraPDF Aukerak\\0\"\\\n  \"SumatraPDF Eguneratu\\0\"\\\n  \"SumatraPDF matxuratu egin da\\0\"\\\n  \"SumatraPDF zure berezko PDF irakurlea da\\0\"\\\n  \"SumatraPDF orain zure berezko PDF irakurlea izan beharko litzake\\0\"\\\n  \"Aldiberetze agiria ezin da ireki\\0\"\\\n  \"PDF etiketatua\\0\"\\\n  \"Idazki agiriak\\0\"\\\n  \"Agiri honek sostengatu gabeko (%s) ezaugarriak erabiltzen ditu eta badaiteke egoki ez aurkeztea\\0\"\\\n  \"Izenburua:\\0\"\\\n  \"Iturburu agiri ezezaguna: (%s)\\0\"\\\n  \"Erabili &hegatsak\\0\"\\\n  \"Ikusi\\0\"\\\n  \"Ikusi &Webgunea\\0\"\\\n  \"Oharra\\0\"\\\n  \"XPS agiriak\\0\"\\\n  \"Azken bertsioa duzu.\\0\"\\\n  \"%s bertsioa duzu\\0\"\\\n  \"Zooma\\0\"\\\n  \"Zooma Handitu\\0\"\\\n  \"Zooma Gutxitu\\0\"\\\n  \"Zomm ezaugarria\\0\"\\\n  \"[Aldaketak atzeman dira, berritzen] %s\\0\"\\\n  \"idazkia kopiatzen\\0\"\\\n  \"agiria irarkitzen\\0\";\n\nconst char * gTranslations_bs = \n  \"&O programu...\\0\"\\\n  \"Stvarna veli\\304\\215ina\\tCtrl+1\\0\"\\\n  \"N&apredne opcije...\\0\"\\\n  \"Sve ozna\\304\\215ene str&anice\\0\"\\\n  \"Nazad\\tAlt+<-\\0\"\\\n  \"&Knji\\305\\241ki pregled\\tCtrl+8\\0\"\\\n  \"&Zatvori\\tCtrl+W\\0\"\\\n  \"&Kopiraj ozna\\304\\215eno\\0\"\\\n  \"Kopiraj ozna\\304\\215eno\\tCtrl+C\\0\"\\\n  \"Nemoj me ponovo pitati\\0\"\\\n  \"Samo &parne stranice\\0\"\\\n  \"&Dvije stranice\\tCtrl+7\\0\"\\\n  \"&Fajl\\0\"\\\n  \"&Tra\\305\\276i:\\0\"\\\n  \"Prva stranica\\tHome\\0\"\\\n  \"Uklopi stranice na podru\\304\\215je za \\305\\241tampu\\0\"\\\n  \"Idi na\\0\"\\\n  \"&Idi na stranicu:\\0\"\\\n  \"&Pomo\\304\\207\\0\"\\\n  \"Posljednja stranica\\tEnd\\0\"\\\n  \"&Uve\\304\\207anje:\\0\"\\\n  \"Korisni\\304\\215ki priru\\304\\215nik\\0\"\\\n  \"Razlikuj velika i mala slova\\0\"\\\n  \"Sljede\\304\\207a stranica\\t->\\0\"\\\n  \"&Ne\\0\"\\\n  \"&Ne, hvala\\0\"\\\n  \"Samo &neparne stranice\\0\"\\\n  \"&Otvori dokument\\0\"\\\n  \"&Otvori...\\tCtrl+O\\0\"\\\n  \"Opcije...\\0\"\\\n  \"&Lozinka:\\0\"\\\n  \"&Pri\\304\\215vrsti dokument\\0\"\\\n  \"Prethodna stranica\\t<-\\0\"\\\n  \"\\305\\240&tampaj...\\0\"\\\n  \"&\\305\\240tampaj...\\tCtrl+P\\0\"\\\n  \"&\\305\\240tampa... (nije dopu\\305\\241teno)\\0\"\\\n  \"&Zapamti lozinku za ovaj dokument\\0\"\\\n  \"&Upamti ove postavke za svaki pojedini dokument\\0\"\\\n  \"&Ukloni dokument\\0\"\\\n  \"&Spasi kao...\\0\"\\\n  \"&Spasi kao...\\tCtrl+S\\0\"\\\n  \"&Postavke\\0\"\\\n  \"Umanji stranice na podru\\304\\215je za \\305\\241tampu (ako je potrebno)\\0\"\\\n  \"&Jedna stranica\\tCtrl+6\\0\"\\\n  \"&Propusti ovu verziju.\\0\"\\\n  \"Koristi &originalne veli\\304\\215ine stranica\\0\"\\\n  \"&Prikaz\\0\"\\\n  \"&Prozor\\0\"\\\n  \"&Da\\0\"\\\n  \"&Uve\\304\\207aj\\0\"\\\n  \"(od %d)\\0\"\\\n  \"(strana %s)\\0\"\\\n  \"O SumatraPDF\\0\"\\\n  \"Dodaj favorit\\0\"\\\n  \"Dodaj stranicu %s u favorite\\0\"\\\n  \"Dodaj stranicu %s u favorite sa (opcionalnim) nazivom:\\0\"\\\n  \"Dodaj u favorite\\0\"\\\n  \"Napredno\\0\"\\\n  \"Svi fajlovi\\0\"\\\n  \"Svi podr\\305\\276ani dokumenti\\0\"\\\n  \"Aplikacija:\\0\"\\\n  \"Asocirati sa PDF datotekama?\\0\"\\\n  \"Prilog: %s\\0\"\\\n  \"Autor:\\0\"\\\n  \"Automatsko\\0\"\\\n  \"Automatski provjeravaj za &nadogradnju\\0\"\\\n  \"Knji\\305\\241ki pregled\\0\"\\\n  \"Zabilje\\305\\241ke\\tF12\\0\"\\\n  \"Kratice zabilje\\305\\241ki\\0\"\\\n  \"Kratica zabilje\\305\\241ke na stranicu %s od %s\\0\"\\\n  \"Zabilje\\305\\241ke\\0\"\\\n  \"Bajta\\0\"\\\n  \"CHM dokumenti\\0\"\\\n  \"Ne mogu se povezati na Internet (gre\\305\\241ka %#x)\\0\"\\\n  \"Otka\\305\\276i\\0\"\\\n  \"Ne mogu od\\305\\241tampati ovaj fajl\\0\"\\\n  \"Ne mogu pokrenuti komandu pretra\\305\\276ivanja unazad. Molimo da provjerite komandnu liniju u postavkama.\\0\"\\\n  \"Promijeni jezik (Change Language)\\0\"\\\n  \"Provjeri za &nadogradnju\\0\"\\\n  \"Stripovi\\0\"\\\n  \"Kompatibilnost\\0\"\\\n  \"Slijedno\\0\"\\\n  \"Slijedni knji\\305\\241ki pogled\\0\"\\\n  \"Dvije stranice slijedno\\0\"\\\n  \"Pomozi prijevodom\\0\"\\\n  \"Kopiraj &sliku\\0\"\\\n  \"Kopiraj adresu &linka\\0\"\\\n  \"Kopiraj ko&mentar\\0\"\\\n  \"Kopiranje teksta je nemogu\\304\\207e (kopirano kao slika)\\0\"\\\n  \"Prava pridr\\305\\276ana:\\0\"\\\n  \"Ne mogu dobaviti postavke \\305\\241tampa\\304\\215a\\0\"\\\n  \"Ne mogu inicijalizirati \\305\\241tampa\\304\\215\\0\"\\\n  \"Nije mogu\\304\\207e iscrtati stranicu\\0\"\\\n  \"Kreirano:\\0\"\\\n  \"Trenutni fajl\\0\"\\\n  \"Pozicija kursora:\\0\"\\\n  \"&Prilago\\304\\221eno uve\\304\\207anje...\\tCtrl+Y\\0\"\\\n  \"Izvorni &izgled:\\0\"\\\n  \"Izvorno &uve\\304\\207anje:\\0\"\\\n  \"Glavni preglednik PDF fajlova se ne mo\\305\\276e promijeniti u portable re\\305\\276imu\\0\"\\\n  \"Odbijene dozvole:\\0\"\\\n  \"DjVu dokumenti\\0\"\\\n  \"Svojstva dokumenta\\0\"\\\n  \"Preuzmi\\0\"\\\n  \"&Izlaz\\tCtrl+Q\\0\"\\\n  \"EPUB dokumenti\\0\"\\\n  \"Unesite lozinku\\0\"\\\n  \"Unesite lozinku za %s\\0\"\\\n  \"Unesite komandnu liniju za izvr\\305\\241avanje prilikom dvostrukog klika na PDF dokument:\\0\"\\\n  \"Gre\\305\\241ka pri u\\304\\215itavanju %s\\0\"\\\n  \"F&avoriti\\0\"\\\n  \"Naprijed\\tAlt+->\\0\"\\\n  \"Cijeli ekran\\tCtrl+Shift+L\\0\"\\\n  \"Dvije stranice\\0\"\\\n  \"Neuspje\\305\\241na promjena naziva faja!\\0\"\\\n  \"Neuspje\\305\\241no spa\\305\\241avanje fajla\\0\"\\\n  \"Brzi web pregled\\0\"\\\n  \"Favoriti\\0\"\\\n  \"FictionBook dokumenti\\0\"\\\n  \"Fajl %s nije prona\\304\\221en\\0\"\\\n  \"Veli\\304\\215ina fajla:\\0\"\\\n  \"Fajl:\\0\"\\\n  \"Tra\\305\\276i...\\tCtrl+F\\0\"\\\n  \"Tra\\305\\276i\\0\"\\\n  \"Na\\304\\221i sljede\\304\\207e\\0\"\\\n  \"Na\\304\\221i prethodno\\0\"\\\n  \"Tra\\305\\276i:\\0\"\\\n  \"Uklopi s&adr\\305\\276aj\\tCtrl+3\\0\"\\\n  \"Uklopi &stranicu\\tCtrl+0\\0\"\\\n  \"&Uklopi po \\305\\241irini\\tCtrl+2\\0\"\\\n  \"Uklopi sadr\\305\\276aj\\0\"\\\n  \"Uklopi stranicu\\0\"\\\n  \"Uklopi po \\305\\241irini\\0\"\\\n  \"Uklopi po \\305\\241irini i prika\\305\\276i stranice slijedno\\0\"\\\n  \"Uklopi jednu stranicu\\0\"\\\n  \"Fontovi:\\0\"\\\n  \"Formatiranje knjige... %d stranica\\0\"\\\n  \"Tekst je prona\\304\\221en na stranici %s\\0\"\\\n  \"Tekst prona\\304\\221en na stranici %s (opet)\\0\"\\\n  \"Naj\\304\\215e\\305\\241\\304\\207e \\304\\215itano\\0\"\\\n  \"\\0\"\\\n  \"Idi na stranicu\\0\"\\\n  \"Sakrij naj\\304\\215e\\305\\241\\304\\207e \\304\\215itano\\0\"\\\n  \"Pomo\\304\\207: upotrijebite tipku F3 za ponovnu pretragu\\0\"\\\n  \"Slike (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Postavi SumatraPDF za glavnu aplikaciju za PDF fajlove?\\0\"\\\n  \"U\\304\\215ini SumatraPDF mojim glavnim \\304\\215ita\\304\\215em PDF fajlova\\0\"\\\n  \"Man&ga re\\305\\276im\\0\"\\\n  \"Razlikuj velika i mala slova\\0\"\\\n  \"Mobi dokumenti\\0\"\\\n  \"Izmijenjeno:\\0\"\\\n  \"Dostupna je nova verzija (%s). Preuzeti novu verziju?\\0\"\\\n  \"Sljede\\304\\207a stranica\\0\"\\\n  \"Pojam nije prona\\304\\221en\\0\"\\\n  \"Nema rezultata oko %u. linije u fajlu %s\\0\"\\\n  \"Sinhronizacijski fajl nije prona\\304\\221en\\0\"\\\n  \"Nema sinhronizacijskih podataka na ovoj poziciji\\0\"\\\n  \"Broj stranica:\\0\"\\\n  \"\\0\"\\\n  \"Otvori\\0\"\\\n  \"Otvori u PDF-XChange\\0\"\\\n  \"Otvori dokument...\\0\"\\\n  \"Otvori u %s\\0\"\\\n  \"Otvori u &Adobe Readeru\\0\"\\\n  \"Otvori u &Foxit Readeru\\0\"\\\n  \"Otvori u Microsoft HTML Help\\0\"\\\n  \"Otvori u Microsoft XPS-Viewer\\0\"\\\n  \"&Postavke\\0\"\\\n  \"P&ostavke...\\tCtrl+D\\0\"\\\n  \"PDF dokument\\0\"\\\n  \"PDF optimizacije:\\0\"\\\n  \"Proizvo\\304\\221a\\304\\215 PDF-a:\\0\"\\\n  \"Verzija PDF-a:\\0\"\\\n  \"PDF dokumenti\\0\"\\\n  \"Stranicu...\\tCtrl+G\\0\"\\\n  \"Stranica %s\\0\"\\\n  \"Veli\\304\\215ina stranice:\\0\"\\\n  \"Stranica %u ne postoji\\0\"\\\n  \"Skaliranje stranice\\0\"\\\n  \"Stranica:\\0\"\\\n  \"PalmDoc dokumenti\\0\"\\\n  \"Molim pri\\304\\215ekajte, iscrtavam...\\0\"\\\n  \"Postscript dokumenti\\0\"\\\n  \"Pr&ezentacija\\tCtrl+L\\0\"\\\n  \"Prethodna stranica\\0\"\\\n  \"\\305\\240tampaj\\0\"\\\n  \"\\305\\240tampaj raspon\\0\"\\\n  \"\\305\\240tampa\\304\\215 sa datim nazivom ne postoji\\0\"\\\n  \"\\305\\240tampanje u napretku.\\0\"\\\n  \"\\305\\240tampanje je jo\\305\\241 uvijek u toku. Prekini i iza\\304\\221i?\\0\"\\\n  \"\\305\\240tampa je jo\\305\\241 u toku. Prekini i zapo\\304\\215ni ispo\\304\\215etka?\\0\"\\\n  \"\\305\\240tampam stranicu %d od %d...\\0\"\\\n  \"Problem prilikom \\305\\241tampe.\\0\"\\\n  \"Promije&ni naziv...\\tF2\\0\"\\\n  \"Zapamti &otvorene fajlove\\0\"\\\n  \"Ukloni iz favorita\\0\"\\\n  \"Ukloni stranicu %s iz favorita\\0\"\\\n  \"Promije&ni naziv u\\0\"\\\n  \"Rotiraj nalijevo\\tCtrl+Shift+-\\0\"\\\n  \"Rotiraj nadesno\\tCtrl+Shift++\\0\"\\\n  \"Spasi kao\\0\"\\\n  \"Spasi k&raticu...\\tCtrl+Shift+S\\0\"\\\n  \"Pretra\\305\\276ujem %d od %d...\\0\"\\\n  \"Ozna\\304\\215i &sve\\0\"\\\n  \"Ozna\\304\\215i &sve\\tCtrl+A\\0\"\\\n  \"Izaberi sadr\\305\\276aj pomo\\304\\207u Ctrl+lijeva tipka mi\\305\\241a\\0\"\\\n  \"Selekcija:\\0\"\\\n  \"Po\\305\\241alji &e-mailom...\\0\"\\\n  \"Postavi komandnu liniju za pretragu unazad\\0\"\\\n  \"Poka\\305\\276i &oznake\\0\"\\\n  \"Prika\\305\\276i stranice slijedno\\0\"\\\n  \"Prika\\305\\276i alatnu traku\\0\"\\\n  \"Prika\\305\\276i favorite\\0\"\\\n  \"Prika\\305\\276i naj\\304\\215e\\305\\241\\304\\207e \\304\\215itano\\0\"\\\n  \"Prika\\305\\276i traku sa &zabilje\\305\\241kama kad je dostupna\\0\"\\\n  \"Jedna stranica\\0\"\\\n  \"Oprostite, ovo se nije trebalo dogoditi!\\n\\nMolimo kliknite 'Otka\\305\\276i' ako nam \\305\\276elite pomo\\304\\207i ispraviti uzrok ovog ru\\305\\241enja.\\0\"\\\n  \"Izvorni fajl %s nema sinhronizacijske ta\\304\\215ke\\0\"\\\n  \"Tema:\\0\"\\\n  \"SumatraPDF opcije\\0\"\\\n  \"SumatraPDF nadogradnja\\0\"\\\n  \"SumatraPDF se sru\\305\\241io\\0\"\\\n  \"SumatraPDF je va\\305\\241 glavni \\304\\215ita\\304\\215 PDF fajlova\\0\"\\\n  \"SumatraPDF bi sad trebao biti va\\305\\241 glavni \\304\\215ita\\304\\215 PDF fajlova\\0\"\\\n  \"Ne mogu otvoriti sinhronizacijski fajl\\0\"\\\n  \"Ozna\\304\\215eni PDF\\0\"\\\n  \"Tekstualni dokumenti\\0\"\\\n  \"Ovaj dokument koristi nepodr\\305\\276ane funkcionalnosti (%s) i zbog toga mo\\305\\276da ne\\304\\207e biti ispravno prikazan\\0\"\\\n  \"Naslov:\\0\"\\\n  \"Nepoznat izvorni fajl (%s)\\0\"\\\n  \"Koristi &tabove\\0\"\\\n  \"Prikaz\\0\"\\\n  \"&Posjeti web stranicu\\0\"\\\n  \"Upozorenje\\0\"\\\n  \"XPS dokumenti\\0\"\\\n  \"Koristite najnoviju verziju.\\0\"\\\n  \"Imate verziju %s\\0\"\\\n  \"Uve\\304\\207anje\\0\"\\\n  \"Uve\\304\\207aj\\0\"\\\n  \"Umanji\\0\"\\\n  \"Faktor uve\\304\\207anja\\0\"\\\n  \"[Uo\\304\\215ena promjena; osvje\\305\\276avam] %s\\0\"\\\n  \"kopiram tekst\\0\"\\\n  \"\\305\\241tampam dokument\\0\";\n\nconst char * gTranslations_bg = \n  \"\\320\\227\\320\\260 &\\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\320\\260\\321\\202\\320\\260\\0\"\\\n  \"&\\320\\236\\321\\200\\320\\270\\320\\263\\320\\270\\320\\275\\320\\260\\320\\273\\320\\265\\320\\275 (\\321\\200\\320\\265\\320\\260\\320\\273\\320\\265\\320\\275) \\321\\200\\320\\260\\320\\267\\320\\274\\320\\265\\321\\200\\tCtrl+1\\0\"\\\n  \"\\320\\240\\320\\260\\320\\267\\321\\210\\320\\270\\321\\200\\320\\265\\320\\275\\320\\270 \\320\\276\\320\\277\\321\\206\\320\\270\\320\\270\\0\"\\\n  \"&\\320\\222\\321\\201\\320\\270\\321\\207\\320\\272\\320\\270 \\320\\270\\320\\267\\320\\261\\321\\200\\320\\260\\320\\275\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\0\"\\\n  \"\\320\\235\\320\\260&\\320\\267\\320\\260\\320\\264\\tAlt+\\320\\233\\321\\217\\320\\262\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\265\\320\\273\\320\\272\\320\\260\\0\"\\\n  \"&\\320\\230\\320\\267\\320\\263\\320\\273\\320\\265\\320\\264 \\320\\272\\320\\260\\321\\202\\320\\276 \\320\\272\\320\\275\\320\\270\\320\\263\\320\\260\\tCtrl+8\\0\"\\\n  \"&\\320\\227\\320\\260\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270\\tCtrl+W\\0\"\\\n  \"&\\320\\232\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 \\320\\270\\320\\267\\320\\261\\321\\200\\320\\260\\320\\275\\320\\276\\321\\202\\320\\276\\0\"\\\n  \"&\\320\\232\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 \\320\\270\\320\\267\\320\\261\\321\\200\\320\\260\\320\\275\\320\\276\\321\\202\\320\\276\\tCtrl+C\\0\"\\\n  \"\\320\\221\\320\\265\\320\\267 \\320\\277\\320\\276\\320\\262\\321\\202\\320\\276\\321\\200&\\320\\275\\320\\276 \\320\\277\\320\\270\\321\\202\\320\\260\\320\\275\\320\\265\\0\"\\\n  \"\\320\\241\\320\\260\\320\\274\\320\\276 &\\321\\207\\320\\265\\321\\202\\320\\275\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\0\"\\\n  \"&\\320\\241\\321\\200\\320\\265\\321\\211\\321\\203\\320\\277\\320\\276\\320\\273\\320\\276\\320\\266\\320\\275\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\tCtrl+7\\0\"\\\n  \"&\\320\\244\\320\\260\\320\\271\\320\\273\\0\"\\\n  \"&\\320\\242\\321\\212\\321\\200\\321\\201\\320\\265\\320\\275\\320\\265 \\320\\275\\320\\260:\\0\"\\\n  \"&\\320\\235\\320\\260\\321\\207\\320\\260\\320\\273\\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\tHome\\0\"\\\n  \"&\\320\\236\\321\\200\\320\\260\\320\\267\\320\\274\\320\\265\\321\\200\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\321\\202\\320\\265 \\320\\262 \\320\\277\\320\\276\\320\\273\\320\\265\\321\\202\\320\\276 \\320\\267\\320\\260 \\320\\276\\321\\202\\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\262\\320\\260\\320\\275\\320\\265\\0\"\\\n  \"&\\320\\236\\321\\202\\320\\270\\320\\262\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260\\0\"\\\n  \"\\320\\236\\321\\202\\320\\270\\320\\264\\320\\270 \\320\\275\\320\\260 &\\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260:\\0\"\\\n  \"&\\320\\237\\320\\276\\320\\274\\320\\276\\321\\211\\0\"\\\n  \"&\\320\\237\\320\\276\\321\\201\\320\\273\\320\\265\\320\\264\\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\tEnd\\0\"\\\n  \"&\\320\\243\\320\\262\\320\\265\\320\\273\\320\\270\\321\\207\\320\\265\\320\\275\\320\\270\\320\\265:\\0\"\\\n  \"&\\320\\240\\321\\212\\320\\272\\320\\276\\320\\262\\320\\276\\320\\264\\321\\201\\321\\202\\320\\262\\320\\276\\0\"\\\n  \"&\\320\\241\\321\\212\\321\\211\\320\\270\\321\\217 \\321\\202\\320\\265\\320\\272\\321\\201\\321\\202\\0\"\\\n  \"\\320\\241\\320\\273\\320\\265\\320\\264\\320\\262\\320\\260&\\321\\211\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\t\\320\\224\\321\\217\\321\\201\\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\265\\320\\273\\320\\272\\320\\260\\0\"\\\n  \"&\\320\\235\\320\\265\\0\"\\\n  \"&\\320\\235\\320\\265, \\320\\261\\320\\273\\320\\260\\320\\263\\320\\276\\320\\264\\320\\260\\321\\200\\321\\217\\0\"\\\n  \"\\320\\241\\320\\260\\320\\274\\320\\276 &\\320\\275\\320\\265\\321\\207\\320\\265\\321\\202\\320\\275\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\0\"\\\n  \"&\\320\\236\\321\\202\\320\\262\\320\\260\\321\\200\\321\\217\\320\\275\\320\\265 \\320\\275\\320\\260 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"&\\320\\236\\321\\202\\320\\262\\320\\260\\321\\200\\321\\217\\320\\275\\320\\265...\\tCtrl+O\\0\"\\\n  \"&\\320\\235\\320\\260\\321\\201\\321\\202\\321\\200\\320\\276\\320\\271\\320\\272\\320\\270\\0\"\\\n  \"&\\320\\237\\320\\260\\321\\200\\320\\276\\320\\273\\320\\260\\0\"\\\n  \"&\\320\\227\\320\\260\\320\\272\\320\\260\\321\\207\\320\\270 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\320\\264\\320\\270&\\321\\210\\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\t\\320\\233\\321\\217\\320\\262\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\265\\320\\273\\320\\272\\320\\260\\0\"\\\n  \"&\\320\\236\\321\\202\\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\262\\320\\260\\320\\275\\320\\265...\\0\"\\\n  \"\\320\\236\\321\\202&\\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\260\\320\\271\\tCtrl+P\\0\"\\\n  \"\\320\\236\\321\\202&\\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\262\\320\\260\\320\\275\\320\\265... (\\320\\276\\321\\202\\320\\272\\320\\260\\320\\267\\320\\260\\320\\275\\320\\276)\\0\"\\\n  \"\\320\\227\\320\\260\\320\\277\\320\\276\\320\\274\\320\\275\\320\\270 &\\320\\277\\320\\260\\321\\200\\320\\276\\320\\273\\320\\260\\321\\202\\320\\260 \\320\\267\\320\\260 \\321\\202\\320\\276\\320\\267\\320\\270 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"\\320\\227\\320\\260\\320\\277\\320\\260\\320\\267\\320\\270 &\\320\\275\\320\\260\\321\\201\\321\\202\\321\\200\\320\\276\\320\\271\\320\\272\\320\\270\\321\\202\\320\\265 \\320\\267\\320\\260 \\320\\262\\321\\201\\320\\265\\320\\272\\320\\270 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"&\\320\\237\\321\\200\\320\\265\\320\\274\\320\\260\\321\\205\\320\\275\\320\\270 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"\\320\\227\\320\\260&\\320\\277\\320\\270\\321\\201 \\320\\272\\320\\260\\321\\202\\320\\276...\\0\"\\\n  \"\\320\\227\\320\\260&\\320\\277\\320\\270\\321\\201 \\320\\272\\320\\260\\321\\202\\320\\276...\\tCtrl+S\\0\"\\\n  \"&\\320\\235\\320\\260\\321\\201\\321\\202\\321\\200\\320\\276\\320\\271\\320\\272\\320\\270\\0\"\\\n  \"&\\320\\235\\320\\260\\320\\274\\320\\260\\320\\273\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\321\\202\\320\\265 \\320\\262 \\320\\274\\321\\217\\321\\201\\321\\202\\320\\276\\321\\202\\320\\276 \\320\\267\\320\\260 \\320\\276\\321\\202\\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\262\\320\\260\\320\\275\\320\\265 (\\320\\277\\321\\200\\320\\270 \\320\\275\\320\\265\\320\\276\\320\\261\\321\\205\\320\\276\\320\\264\\320\\270\\320\\274\\320\\276\\321\\201\\321\\202)\\0\"\\\n  \"&\\320\\225\\320\\264\\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\tCtrl+6\\0\"\\\n  \"&\\320\\237\\321\\200\\320\\276\\320\\277\\321\\203\\321\\201\\320\\275\\320\\270 \\321\\202\\320\\260\\320\\267\\320\\270 \\320\\262\\320\\265\\321\\200\\321\\201\\320\\270\\321\\217\\0\"\\\n  \"\\320\\230\\320\\267\\320\\277\\320\\276\\320\\273\\320\\267\\320\\262\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 &\\320\\276\\321\\200\\320\\270\\320\\263\\320\\270\\320\\275\\320\\260\\320\\273\\320\\275\\320\\270\\321\\202\\320\\265 \\321\\200\\320\\260\\320\\267\\320\\274\\320\\265\\321\\200\\320\\270 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\321\\202\\320\\265\\0\"\\\n  \"&\\320\\230\\320\\267\\320\\263\\320\\273\\320\\265\\320\\264\\0\"\\\n  \"\\0\"\\\n  \"&\\320\\224\\320\\260\\0\"\\\n  \"&\\320\\243\\320\\262\\320\\265\\320\\273\\320\\270\\321\\207\\320\\265\\320\\275\\320\\270\\320\\265\\0\"\\\n  \"(\\320\\276\\321\\202 %d)\\0\"\\\n  \"(\\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 %s)\\0\"\\\n  \"\\320\\227\\320\\260 SumatraPDF\\0\"\\\n  \"\\320\\224\\320\\276\\320\\261\\320\\260\\320\\262\\321\\217\\320\\275\\320\\265 \\320\\272\\321\\212\\320\\274 \\320\\273\\321\\216\\320\\261\\320\\270\\320\\274\\320\\270\\321\\202\\320\\265\\0\"\\\n  \"\\320\\224\\320\\276\\320\\261\\320\\260\\320\\262\\321\\217\\320\\275\\320\\265 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 %s \\320\\272\\321\\212\\320\\274 \\320\\273\\321\\216\\320\\261\\320\\270\\320\\274\\320\\270\\321\\202\\320\\265\\0\"\\\n  \"\\320\\224\\320\\276\\320\\261\\320\\260\\320\\262\\321\\217\\320\\275\\320\\265 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 %s \\320\\272\\321\\212\\320\\274 \\320\\273\\321\\216\\320\\261\\320\\270\\320\\274\\320\\270\\321\\202\\320\\265 \\321\\201 \\320\\270\\320\\274\\320\\265 (\\320\\277\\320\\276 \\320\\270\\320\\267\\320\\261\\320\\276\\321\\200):\\0\"\\\n  \"\\320\\224\\320\\276\\320\\261\\320\\260\\320\\262\\321\\217\\320\\275\\320\\265 \\320\\272\\321\\212\\320\\274 \\320\\273\\321\\216\\320\\261\\320\\270\\320\\274\\320\\270\\321\\202\\320\\265\\0\"\\\n  \"\\320\\240\\320\\260\\320\\267\\321\\210\\320\\270\\321\\200\\320\\265\\320\\275\\320\\270 (\\320\\224\\320\\276\\320\\277\\321\\212\\320\\273\\320\\275\\320\\270\\321\\202\\320\\265\\320\\273\\320\\275\\320\\270)\\0\"\\\n  \"\\320\\222\\321\\201\\320\\270\\321\\207\\320\\272\\320\\270 \\321\\204\\320\\260\\320\\271\\320\\273\\320\\276\\320\\262\\320\\265\\0\"\\\n  \"\\320\\222\\321\\201\\320\\270\\321\\207\\320\\272\\320\\270 \\320\\277\\320\\276\\320\\264\\320\\264\\321\\212\\321\\200\\320\\266\\320\\260\\320\\275\\320\\270 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\273\\320\\276\\320\\266\\320\\265\\320\\275\\320\\270\\320\\265:\\0\"\\\n  \"\\320\\243\\320\\272\\320\\260\\320\\267\\320\\262\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\320\\260\\321\\202\\320\\260 \\320\\272\\320\\260\\321\\202\\320\\276 \\321\\202\\320\\260\\320\\272\\320\\260\\320\\262\\320\\260 \\320\\277\\320\\276 \\320\\277\\320\\276\\320\\264\\321\\200\\320\\260\\320\\267\\320\\261\\320\\270\\321\\200\\320\\260\\320\\275\\320\\265 \\320\\267\\320\\260 \\320\\276\\321\\202\\320\\262\\320\\260\\321\\200\\321\\217\\320\\275\\320\\265 \\320\\275\\320\\260 PDF \\321\\204\\320\\260\\320\\271\\320\\273\\320\\276\\320\\262\\320\\265?\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\272\\321\\200\\320\\265\\320\\277\\320\\265\\320\\275: %s\\0\"\\\n  \"\\320\\220\\320\\262\\321\\202\\320\\276\\321\\200:\\0\"\\\n  \"\\320\\220\\320\\262\\321\\202\\320\\276\\320\\274\\320\\260\\321\\202\\320\\270\\321\\207\\320\\275\\320\\276\\0\"\\\n  \"\\320\\220\\320\\262\\321\\202\\320\\276\\320\\274\\320\\260\\321\\202\\320\\270\\321\\207\\320\\275\\320\\260 \\320\\277\\321\\200\\320\\276\\320\\262\\320\\265\\321\\200\\320\\272\\320\\260 \\320\\267\\320\\260 &\\320\\276\\320\\261\\320\\275\\320\\276\\320\\262\\320\\273\\320\\265\\320\\275\\320\\270\\321\\217\\0\"\\\n  \"\\320\\230\\320\\267\\320\\263\\320\\273\\320\\265\\320\\264 \\320\\272\\320\\260\\321\\202\\320\\276 \\320\\272\\320\\275\\320\\270\\320\\263\\320\\260\\0\"\\\n  \"&\\320\\236\\321\\202\\320\\274\\320\\265\\321\\202\\320\\272\\320\\270\\tF12\\0\"\\\n  \"\\320\\232\\321\\200\\320\\260\\321\\202\\321\\212\\320\\272 \\320\\277\\321\\212\\321\\202 \\320\\272\\321\\212\\320\\274 \\320\\276\\321\\202\\320\\274\\320\\265\\321\\202\\320\\272\\320\\270\\0\"\\\n  \"\\320\\232\\321\\200\\320\\260\\321\\202\\321\\212\\320\\272 \\320\\277\\321\\212\\321\\202 \\320\\272\\321\\212\\320\\274 \\320\\276\\321\\202\\320\\274\\320\\265\\321\\202\\320\\272\\320\\260 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 %s \\320\\276\\321\\202 %s\\0\"\\\n  \"\\320\\236\\321\\202\\320\\274\\320\\265\\321\\202\\320\\272\\320\\270\\0\"\\\n  \"\\320\\261\\320\\260\\320\\271\\321\\202\\320\\260\\0\"\\\n  \"CHM \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\235\\321\\217\\320\\274\\320\\260 \\320\\262\\321\\200\\321\\212\\320\\267\\320\\272\\320\\260 \\321\\201 \\320\\230\\320\\275\\321\\202\\320\\265\\321\\200\\320\\275\\320\\265\\321\\202 (\\320\\263\\321\\200\\320\\265\\321\\210\\320\\272\\320\\260 %#x).\\0\"\\\n  \"\\320\\236\\321\\202\\320\\272\\320\\260\\320\\267\\0\"\\\n  \"\\320\\244\\320\\260\\320\\271\\320\\273\\321\\212\\321\\202 \\320\\275\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\265 \\320\\264\\320\\260 \\320\\261\\321\\212\\320\\264\\320\\265 \\320\\276\\321\\202\\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\260\\320\\275\\0\"\\\n  \"\\320\\236\\320\\261\\321\\200\\320\\260\\321\\202\\320\\275\\320\\276\\321\\202\\320\\276 \\321\\202\\321\\212\\321\\200\\321\\201\\320\\265\\320\\275\\320\\265 \\320\\275\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\265 \\320\\264\\320\\260 \\320\\267\\320\\260\\320\\277\\320\\276\\321\\207\\320\\275\\320\\265. \\320\\234\\320\\276\\320\\273\\321\\217 \\320\\277\\321\\200\\320\\276\\320\\262\\320\\265\\321\\200\\320\\265\\321\\202\\320\\265 \\320\\277\\320\\260\\321\\200\\320\\260\\320\\274\\320\\265\\321\\202\\321\\200\\320\\270\\321\\202\\320\\265 \\320\\262 \\320\\275\\320\\260\\321\\201\\321\\202\\321\\200\\320\\276\\320\\271\\320\\272\\320\\270\\321\\202\\320\\265.\\0\"\\\n  \"\\320\\241\\320\\274\\321\\217\\320\\275\\320\\260 \\320\\275\\320\\260 \\320\\265\\320\\267\\320\\270\\320\\272\\320\\260 \\320\\275\\320\\260 \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\320\\260\\321\\202\\320\\260 (Change Language)\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\262\\320\\265\\321\\200\\320\\272\\320\\260 \\320\\267\\320\\260 \\320\\275\\320\\276\\320\\262\\320\\260 &\\320\\262\\320\\265\\321\\200\\321\\201\\320\\270\\321\\217\\0\"\\\n  \"CBR, CBZ \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270 (\\320\\272\\320\\276\\320\\274\\320\\270\\320\\272\\321\\201\\320\\270)\\0\"\\\n  \"\\320\\241\\321\\212\\320\\262\\320\\274\\320\\265\\321\\201\\321\\202\\320\\270\\320\\274\\320\\276\\321\\201\\321\\202\\0\"\\\n  \"\\320\\235\\320\\265\\320\\277\\321\\200\\320\\265\\320\\272\\321\\212\\321\\201\\320\\275\\320\\260\\321\\202\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\0\"\\\n  \"\\320\\235\\320\\265\\320\\277\\321\\200\\320\\265\\320\\272\\321\\212\\321\\201\\320\\275\\320\\260\\321\\202 \\320\\270\\320\\267\\320\\263\\320\\273\\320\\265\\320\\264 \\320\\272\\320\\260\\321\\202\\320\\276 \\320\\272\\320\\275\\320\\270\\320\\263\\320\\260\\0\"\\\n  \"\\320\\235\\320\\265\\320\\277\\321\\200\\320\\265\\320\\272\\321\\212\\321\\201\\320\\275\\320\\260\\321\\202\\320\\270 \\321\\201\\321\\200\\320\\265\\321\\211\\321\\203\\320\\277\\320\\276\\320\\273\\320\\276\\320\\266\\320\\275\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\0\"\\\n  \"\\320\\224\\320\\276\\320\\277\\321\\200\\320\\270\\320\\275\\320\\265\\321\\201\\320\\270 \\320\\267\\320\\260 \\320\\277\\321\\200\\320\\265\\320\\262\\320\\276\\320\\264\\320\\260\\0\"\\\n  \"\\320\\232\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 &\\320\\270\\320\\267\\320\\276\\320\\261\\321\\200\\320\\260\\320\\266\\320\\265\\320\\275\\320\\270\\320\\265\\321\\202\\320\\276\\0\"\\\n  \"\\320\\232\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 \\320\\270\\320\\275\\321\\202\\320\\265\\321\\200\\320\\275\\320\\265\\321\\202 &\\320\\260\\320\\264\\321\\200\\320\\265\\321\\201\\320\\260\\0\"\\\n  \"\\320\\232\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 &\\320\\272\\320\\276\\320\\274\\320\\265\\320\\275\\321\\202\\320\\260\\321\\200\\320\\260\\0\"\\\n  \"\\320\\242\\320\\265\\320\\272\\321\\201\\321\\202\\321\\212\\321\\202 \\320\\275\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\265 \\320\\264\\320\\260 \\320\\261\\321\\212\\320\\264\\320\\265 \\320\\272\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\320\\275 (\\320\\267\\320\\260\\321\\202\\320\\276\\320\\262\\320\\260 \\320\\261\\320\\265\\321\\210\\320\\265 \\320\\272\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\320\\275 \\321\\201\\320\\260\\320\\274\\320\\276 \\320\\272\\320\\260\\321\\202\\320\\276 \\320\\272\\320\\260\\321\\200\\321\\202\\320\\270\\320\\275\\320\\272\\320\\260)\\0\"\\\n  \"\\320\\220\\320\\262\\321\\202\\320\\276\\321\\200\\321\\201\\320\\272\\320\\276 \\320\\277\\321\\200\\320\\260\\320\\262\\320\\276:\\0\"\\\n  \"\\320\\235\\320\\260\\321\\201\\321\\202\\321\\200\\320\\276\\320\\271\\320\\272\\320\\270\\321\\202\\320\\265 \\320\\275\\320\\260 \\320\\277\\321\\200\\320\\270\\320\\275\\321\\202\\320\\265\\321\\200\\320\\260 \\320\\275\\320\\265 \\321\\201\\320\\260 \\320\\275\\320\\260\\320\\274\\320\\265\\321\\200\\320\\265\\320\\275\\320\\270\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\275\\321\\202\\320\\265\\321\\200\\321\\212\\321\\202 \\320\\275\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\265 \\320\\264\\320\\260 \\320\\261\\321\\212\\320\\264\\320\\265 \\320\\270\\320\\275\\320\\270\\321\\206\\320\\270\\320\\260\\320\\273\\320\\270\\320\\267\\320\\270\\321\\200\\320\\260\\320\\275\\0\"\\\n  \"\\320\\241\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\321\\202\\320\\260 \\320\\275\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\265 \\320\\264\\320\\260 \\321\\201\\320\\265 \\320\\270\\320\\267\\320\\276\\320\\261\\321\\200\\320\\260\\320\\267\\320\\270\\0\"\\\n  \"\\320\\241\\321\\212\\320\\267\\320\\264\\320\\260\\320\\264\\320\\265\\320\\275:\\0\"\\\n  \"\\320\\241\\320\\265\\320\\263\\320\\260\\321\\210\\320\\265\\320\\275 \\321\\204\\320\\260\\320\\271\\320\\273\\0\"\\\n  \"\\320\\237\\320\\276\\320\\267\\320\\270\\321\\206\\320\\270\\321\\217 \\320\\275\\320\\260 \\320\\272\\321\\203\\321\\200\\321\\201\\320\\276\\321\\200\\320\\260\\0\"\\\n  \"\\320\\243\\320\\262\\320\\265\\320\\273\\320\\270\\321\\207\\320\\265\\320\\275\\320\\270\\320\\265 \\320\\277\\320\\276 &\\320\\270\\320\\267\\320\\261\\320\\276\\321\\200...\\tCtrl+Y\\0\"\\\n  \"&\\320\\240\\320\\260\\320\\267\\320\\277\\320\\276\\320\\273\\320\\276\\320\\266\\320\\265\\320\\275\\320\\270\\320\\265 \\320\\277\\320\\276 \\320\\277\\320\\276\\320\\264\\321\\200\\320\\260\\320\\267\\320\\261\\320\\270\\321\\200\\320\\260\\320\\275\\320\\265:\\0\"\\\n  \"&\\320\\243\\320\\262\\320\\265\\320\\273\\320\\270\\321\\207\\320\\265\\320\\275\\320\\270\\320\\265 \\320\\277\\320\\276 \\320\\277\\320\\276\\320\\264\\321\\200\\320\\260\\320\\267\\320\\261\\320\\270\\321\\200\\320\\260\\320\\275\\320\\265:\\0\"\\\n  \"PDF \\321\\207\\320\\265\\321\\202\\320\\265\\321\\206\\320\\260 \\320\\275\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\265 \\320\\264\\320\\260 \\320\\261\\321\\212\\320\\264\\320\\265 \\321\\201\\320\\274\\320\\265\\320\\275\\320\\265\\320\\275 \\320\\262 \\320\\277\\321\\200\\320\\265\\320\\275\\320\\276\\321\\201\\320\\270\\320\\274 \\321\\200\\320\\265\\320\\266\\320\\270\\320\\274\\0\"\\\n  \"\\320\\224\\320\\276\\321\\201\\321\\202\\321\\212\\320\\277\\321\\212\\321\\202 \\320\\276\\321\\202\\320\\272\\320\\260\\320\\267\\320\\260\\320\\275:\\0\"\\\n  \"DjVu \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\241\\320\\262\\320\\276\\320\\271\\321\\201\\321\\202\\320\\262\\320\\260 \\320\\275\\320\\260 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\260\\0\"\\\n  \"\\320\\241\\320\\262\\320\\260\\320\\273\\320\\270\\0\"\\\n  \"\\320\\230\\320\\267&\\321\\205\\320\\276\\320\\264\\tCtrl+Q\\0\"\\\n  \"EPUB \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\222\\321\\212\\320\\262\\320\\265\\320\\264\\320\\265\\321\\202\\320\\265 \\320\\277\\320\\260\\321\\200\\320\\276\\320\\273\\320\\260\\0\"\\\n  \"\\320\\222\\321\\212\\320\\262\\320\\265\\320\\264\\320\\265\\321\\202\\320\\265 \\320\\277\\320\\260\\321\\200\\320\\276\\320\\273\\320\\260 \\320\\267\\320\\260 %s\\0\"\\\n  \"\\320\\222\\321\\212\\320\\262\\320\\265\\320\\264\\320\\265\\321\\202\\320\\265 \\320\\272\\320\\276\\320\\274\\320\\260\\320\\275\\320\\264\\320\\260\\321\\202\\320\\260, \\320\\272\\320\\276\\321\\217\\321\\202\\320\\276 \\321\\211\\320\\265 \\320\\261\\321\\212\\320\\264\\320\\265 \\320\\270\\320\\267\\320\\277\\321\\212\\320\\273\\320\\275\\320\\265\\320\\275\\320\\260 \\320\\277\\321\\200\\320\\270 \\320\\264\\320\\262\\320\\276\\320\\265\\320\\275 \\320\\272\\320\\273\\320\\270\\320\\272 \\320\\262\\321\\212\\321\\200\\321\\205\\321\\203 PDF \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\260:\\0\"\\\n  \"\\320\\223\\321\\200\\320\\265\\321\\210\\320\\272\\320\\260 \\320\\277\\321\\200\\320\\270 \\320\\267\\320\\260\\321\\200\\320\\265\\320\\266\\320\\264\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 %s\\0\"\\\n  \"&\\320\\233\\321\\216\\320\\261\\320\\270\\320\\274\\320\\270\\0\"\\\n  \"\\320\\235\\320\\260\\320\\277&\\321\\200\\320\\265\\320\\264\\tAlt+\\320\\224\\321\\217\\321\\201\\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\265\\320\\273\\320\\272\\320\\260\\0\"\\\n  \"\\320\\235\\320\\260 &\\321\\206\\321\\217\\320\\273 \\320\\265\\320\\272\\321\\200\\320\\260\\320\\275\\tCtrl+Shift+L / F11\\0\"\\\n  \"\\320\\241\\321\\200\\320\\265\\321\\211\\321\\203\\320\\277\\320\\276\\320\\273\\320\\276\\320\\266\\320\\275\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\320\\270\\320\\274\\320\\265\\320\\275\\321\\203\\320\\262\\320\\260\\320\\275\\320\\265\\321\\202\\320\\276 \\320\\275\\320\\265 \\320\\261\\320\\265\\321\\210\\320\\265 \\321\\203\\321\\201\\320\\277\\320\\265\\321\\210\\320\\275\\320\\276!\\0\"\\\n  \"\\320\\223\\321\\200\\320\\265\\321\\210\\320\\272\\320\\260 \\320\\277\\321\\200\\320\\270 \\320\\267\\320\\260\\320\\277\\320\\260\\320\\274\\320\\265\\321\\202\\321\\217\\320\\262\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 \\321\\204\\320\\260\\320\\271\\320\\273\\320\\260\\0\"\\\n  \"\\320\\221\\321\\212\\321\\200\\320\\267 Web \\320\\270\\320\\267\\320\\263\\320\\273\\320\\265\\320\\264\\0\"\\\n  \"\\320\\233\\321\\216\\320\\261\\320\\270\\320\\274\\320\\270\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270 FictionBook\\0\"\\\n  \"\\320\\244\\320\\260\\320\\271\\320\\273\\321\\212\\321\\202 %s \\320\\275\\320\\265 \\320\\265 \\320\\275\\320\\260\\320\\274\\320\\265\\321\\200\\320\\265\\320\\275\\0\"\\\n  \"\\320\\223\\320\\276\\320\\273\\320\\265\\320\\274\\320\\270\\320\\275\\320\\260 \\320\\275\\320\\260 \\321\\204\\320\\260\\320\\271\\320\\273\\320\\260:\\0\"\\\n  \"\\320\\244\\320\\260\\320\\271\\320\\273:\\0\"\\\n  \"&\\320\\242\\321\\212\\321\\200\\321\\201\\320\\270...\\tCtrl+F\\0\"\\\n  \"\\320\\242\\321\\212\\321\\200\\321\\201\\320\\265\\320\\275\\320\\265\\0\"\\\n  \"\\320\\235\\320\\260\\320\\274\\320\\270\\321\\200\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 \\321\\201\\320\\273\\320\\265\\320\\264\\320\\262\\320\\260\\321\\211\\320\\276\\321\\202\\320\\276 \\321\\201\\321\\212\\320\\262\\320\\277\\320\\260\\320\\264\\320\\265\\320\\275\\320\\270\\320\\265\\0\"\\\n  \"\\320\\235\\320\\260\\320\\274\\320\\270\\321\\200\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 \\320\\277\\321\\200\\320\\265\\320\\264\\320\\270\\321\\210\\320\\275\\320\\276\\321\\202\\320\\276 \\321\\201\\321\\212\\320\\262\\320\\277\\320\\260\\320\\264\\320\\265\\320\\275\\320\\270\\320\\265\\0\"\\\n  \"\\320\\242\\321\\212\\321\\200\\321\\201\\320\\265\\320\\275\\320\\265:\\0\"\\\n  \"\\320\\236\\321\\200\\320\\260\\320\\267\\320\\274\\320\\265\\321\\200\\321\\217\\320\\262\\320\\260\\320\\275\\320\\265 \\320\\277\\320\\276 &\\321\\201\\321\\212\\320\\264\\321\\212\\321\\200\\320\\266\\320\\260\\320\\275\\320\\270\\320\\265\\tCtrl+3\\0\"\\\n  \"\\320\\236\\321\\200\\320\\260\\320\\267\\320\\274\\320\\265\\321\\200\\321\\217\\320\\262\\320\\260\\320\\275\\320\\265 \\320\\277\\320\\276 &\\320\\262\\320\\270\\321\\201\\320\\276\\321\\207\\320\\270\\320\\275\\320\\260\\tCtrl+0\\0\"\\\n  \"\\320\\236\\321\\200\\320\\260\\320\\267\\320\\274\\320\\265\\321\\200\\321\\217\\320\\262\\320\\260\\320\\275\\320\\265 \\320\\277\\320\\276 &\\321\\210\\320\\270\\321\\200\\320\\270\\320\\275\\320\\260\\tCtrl+2\\0\"\\\n  \"\\320\\236\\321\\200\\320\\260\\320\\267\\320\\274\\320\\265\\321\\200\\321\\217\\320\\262\\320\\260\\320\\275\\320\\265 \\320\\277\\320\\276 \\321\\201\\321\\212\\320\\264\\321\\212\\321\\200\\320\\266\\320\\260\\320\\275\\320\\270\\320\\265\\0\"\\\n  \"\\320\\236\\321\\200\\320\\260\\320\\267\\320\\274\\320\\265\\321\\200\\321\\217\\320\\262\\320\\260\\320\\275\\320\\265 \\320\\277\\320\\276 \\320\\262\\320\\270\\321\\201\\320\\276\\321\\207\\320\\270\\320\\275\\320\\260\\0\"\\\n  \"\\320\\236\\321\\200\\320\\260\\320\\267\\320\\274\\320\\265\\321\\200\\320\\270 \\320\\277\\320\\276 \\321\\210\\320\\270\\321\\200\\320\\270\\320\\275\\320\\260\\0\"\\\n  \"\\320\\236\\321\\200\\320\\260\\320\\267\\320\\274\\320\\265\\321\\200\\320\\270 \\320\\277\\320\\276 \\321\\210\\320\\270\\321\\200\\320\\276\\321\\207\\320\\270\\320\\275\\320\\260 \\320\\270 \\320\\277\\320\\276\\320\\272\\320\\260\\320\\266\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\321\\202\\320\\265 \\320\\275\\320\\265\\320\\277\\321\\200\\320\\265\\320\\272\\321\\212\\321\\201\\320\\275\\320\\260\\321\\202\\320\\276\\0\"\\\n  \"\\320\\236\\321\\200\\320\\260\\320\\267\\320\\274\\320\\265\\321\\200\\320\\270 \\320\\265\\320\\264\\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\0\"\\\n  \"\\320\\250\\321\\200\\320\\270\\321\\204\\321\\202\\320\\276\\320\\262\\320\\265:\\0\"\\\n  \"\\320\\244\\320\\276\\321\\200\\320\\274\\320\\260\\321\\202\\320\\270\\321\\200\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 \\320\\272\\320\\275\\320\\270\\320\\263\\320\\260\\321\\202\\320\\260... %d \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\0\"\\\n  \"\\320\\242\\320\\265\\320\\272\\321\\201\\321\\202\\321\\212\\321\\202 \\320\\265 \\320\\275\\320\\260\\320\\274\\320\\265\\321\\200\\320\\265\\320\\275 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 %s\\0\"\\\n  \"\\320\\242\\320\\265\\320\\272\\321\\201\\321\\202\\321\\212\\321\\202 \\320\\265 \\320\\275\\320\\260\\320\\274\\320\\265\\321\\200\\320\\265\\320\\275 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 %s (\\320\\276\\321\\202\\320\\275\\320\\276\\320\\262\\320\\276)\\0\"\\\n  \"\\320\\247\\320\\265\\321\\201\\321\\202\\320\\276 \\321\\207\\320\\265\\321\\202\\320\\265\\320\\275\\320\\270\\0\"\\\n  \"\\0\"\\\n  \"\\320\\236\\321\\202\\320\\270\\320\\262\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\0\"\\\n  \"\\320\\241\\320\\272\\321\\200\\320\\270\\320\\262\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 \\321\\207\\320\\265\\321\\201\\321\\202\\320\\276 \\321\\207\\320\\265\\321\\202\\320\\265\\320\\275\\320\\270\\321\\202\\320\\265\\0\"\\\n  \"\\320\\241\\321\\212\\320\\262\\320\\265\\321\\202: \\320\\230\\320\\267\\320\\277\\320\\276\\320\\273\\320\\267\\320\\262\\320\\260\\320\\271\\321\\202\\320\\265 F3 \\320\\267\\320\\260 \\320\\277\\320\\276\\320\\262\\321\\202\\320\\276\\321\\200\\320\\275\\320\\276 \\321\\202\\321\\212\\321\\200\\321\\201\\320\\265\\320\\275\\320\\265\\0\"\\\n  \"\\320\\230\\320\\267\\320\\276\\320\\261\\321\\200\\320\\260\\320\\266\\320\\265\\320\\275\\320\\270\\321\\217 (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"\\320\\230\\321\\201\\320\\272\\320\\260\\321\\202\\320\\265 \\320\\273\\320\\270 \\320\\264\\320\\260 \\320\\267\\320\\260\\320\\264\\320\\260\\320\\264\\320\\265\\321\\202\\320\\265 SumatraPDF \\320\\272\\320\\260\\321\\202\\320\\276 \\320\\276\\321\\201\\320\\275\\320\\276\\320\\262\\320\\275\\320\\276\\321\\202\\320\\276 \\321\\201\\320\\270 \\320\\277\\321\\200\\320\\270\\320\\273\\320\\276\\320\\266\\320\\265\\320\\275\\320\\270\\320\\265 \\320\\267\\320\\260 \\320\\276\\321\\202\\320\\262\\320\\260\\321\\200\\321\\217\\320\\275\\320\\265 \\320\\275\\320\\260 PDF \\321\\204\\320\\260\\320\\271\\320\\273\\320\\276\\320\\262\\320\\265?\\0\"\\\n  \"\\320\\235\\320\\260\\320\\277\\321\\200\\320\\260\\320\\262\\320\\270 SumatraPDF \\321\\207\\320\\265\\321\\202\\320\\265\\321\\206 \\320\\275\\320\\260 PDF \\320\\277\\320\\276 \\320\\277\\320\\276\\320\\264\\321\\200\\320\\260\\320\\267\\320\\261\\320\\270\\321\\200\\320\\260\\320\\275\\320\\265\\0\"\\\n  \"\\320\\240\\320\\265\\320\\266\\320\\270\\320\\274 \\320\\267\\320\\260 \\320\\274\\320\\260\\320\\275&\\320\\263\\320\\260\\0\"\\\n  \"\\320\\241\\321\\212\\321\\211\\320\\270\\321\\217 \\321\\202\\320\\265\\320\\272\\321\\201\\321\\202\\0\"\\\n  \"Mobi \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\274\\320\\265\\320\\275\\320\\265\\320\\275:\\0\"\\\n  \"\\320\\224\\320\\276\\321\\201\\321\\202\\321\\212\\320\\277\\320\\275\\320\\260 \\320\\265 \\320\\275\\320\\276\\320\\262\\320\\260 \\320\\262\\320\\265\\321\\200\\321\\201\\320\\270\\321\\217 %s. \\320\\230\\321\\201\\320\\272\\320\\260\\321\\202\\320\\265 \\320\\273\\320\\270 \\320\\264\\320\\260 \\321\\217 \\321\\201\\320\\262\\320\\260\\320\\273\\320\\270\\321\\202\\320\\265?\\0\"\\\n  \"\\320\\241\\320\\273\\320\\265\\320\\264\\320\\262\\320\\260\\321\\211\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\0\"\\\n  \"\\320\\235\\321\\217\\320\\274\\320\\260 \\321\\201\\321\\212\\320\\262\\320\\277\\320\\260\\320\\264\\320\\265\\320\\275\\320\\270\\321\\217\\0\"\\\n  \"\\320\\235\\321\\217\\320\\274\\320\\260 \\321\\200\\320\\265\\320\\267\\321\\203\\320\\273\\321\\202\\320\\260\\321\\202\\320\\270 \\320\\276\\320\\272\\320\\276\\320\\273\\320\\276 \\321\\200\\320\\265\\320\\264 %u \\320\\262\\321\\212\\320\\262 \\321\\204\\320\\260\\320\\271\\320\\273\\320\\260 %s\\0\"\\\n  \"\\320\\244\\320\\260\\320\\271\\320\\273\\321\\212\\321\\202 \\320\\267\\320\\260 \\321\\201\\320\\270\\320\\275\\321\\205\\321\\200\\320\\276\\320\\275\\320\\270\\320\\267\\320\\260\\321\\206\\320\\270\\321\\217 \\320\\275\\320\\265 \\320\\265 \\320\\275\\320\\260\\320\\274\\320\\265\\321\\200\\320\\265\\320\\275\\0\"\\\n  \"\\320\\222 \\321\\202\\320\\260\\320\\267\\320\\270 \\320\\277\\320\\276\\320\\267\\320\\270\\321\\206\\320\\270\\321\\217 \\320\\275\\321\\217\\320\\274\\320\\260 \\320\\270\\320\\275\\321\\204\\320\\276\\321\\200\\320\\274\\320\\260\\321\\206\\320\\270\\321\\217 \\320\\267\\320\\260 \\321\\201\\320\\270\\320\\275\\321\\205\\321\\200\\320\\276\\320\\275\\320\\270\\320\\267\\320\\260\\321\\206\\320\\270\\321\\217\\0\"\\\n  \"\\320\\221\\321\\200\\320\\276\\320\\271 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270:\\0\"\\\n  \"\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\260\\321\\200\\321\\217\\320\\275\\320\\265\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\276\\321\\200\\321\\217\\320\\275\\320\\265 \\321\\201 PDF-XChange\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\276\\321\\200\\321\\217\\320\\275\\320\\265 \\320\\275\\320\\260 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202...\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\260\\321\\200\\321\\217\\320\\275\\320\\265 \\321\\201 %s\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\260\\321\\200\\321\\217\\320\\275\\320\\265 \\321\\201 &Adobe Reader\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\260\\321\\200\\321\\217\\320\\275\\320\\265 \\321\\201 &Foxit Reader\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\260\\321\\200\\321\\217\\320\\275\\320\\265 \\321\\201 Microsoft HTML Help\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\260\\321\\200\\321\\217\\320\\275\\320\\265 \\321\\201 Microsoft XPS-Viewer\\0\"\\\n  \"&\\320\\241\\320\\262\\320\\276\\320\\271\\321\\201\\321\\202\\320\\262\\320\\260\\0\"\\\n  \"&\\320\\241\\320\\262\\320\\276\\320\\271\\321\\201\\321\\202\\320\\262\\320\\260\\0\"\\\n  \"PDF \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"PDF \\320\\276\\320\\277\\321\\202\\320\\270\\320\\274\\320\\270\\320\\267\\320\\260\\321\\206\\320\\270\\320\\270:\\0\"\\\n  \"PDF \\321\\201\\321\\212\\320\\267\\320\\264\\320\\260\\321\\202\\320\\265\\320\\273:\\0\"\\\n  \"PDF \\320\\262\\320\\265\\321\\200\\321\\201\\320\\270\\321\\217:\\0\"\\\n  \"PDF \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"&\\320\\241\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260...\\tCtrl+G\\0\"\\\n  \"\\320\\241\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 %s\\0\"\\\n  \"\\320\\240\\320\\260\\320\\267\\320\\274\\320\\265\\321\\200\\320\\270 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\321\\202\\320\\260:\\0\"\\\n  \"\\320\\241\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 \\321\\201 \\320\\275\\320\\276\\320\\274\\320\\265\\321\\200 %u \\320\\275\\320\\265 \\321\\201\\321\\212\\321\\211\\320\\265\\321\\201\\321\\202\\320\\262\\321\\203\\320\\262\\320\\260\\0\"\\\n  \"\\320\\236\\321\\200\\320\\260\\320\\267\\320\\274\\320\\265\\321\\200\\321\\217\\320\\262\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\321\\202\\320\\260\\0\"\\\n  \"\\320\\241\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260:\\0\"\\\n  \"PalmDoc \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\234\\320\\276\\320\\273\\321\\217 \\320\\270\\320\\267\\321\\207\\320\\260\\320\\272\\320\\260\\320\\271\\321\\202\\320\\265 - \\320\\270\\320\\267\\320\\276\\320\\261\\321\\200\\320\\260\\320\\266\\320\\265\\320\\275\\320\\270\\320\\265\\321\\202\\320\\276 \\321\\201\\320\\265 \\321\\201\\321\\212\\320\\267\\320\\264\\320\\260\\320\\262\\320\\260\\0\"\\\n  \"Postscript \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"&\\320\\237\\321\\200\\320\\265\\320\\267\\320\\265\\320\\275\\321\\202\\320\\260\\321\\206\\320\\270\\321\\217\\tCtrl+L\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\320\\264\\320\\270\\321\\210\\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\0\"\\\n  \"\\320\\236\\321\\202\\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\262\\320\\260\\320\\275\\320\\265\\0\"\\\n  \"\\320\\236\\321\\202\\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\262\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 \\320\\275\\321\\217\\320\\272\\320\\276\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\275\\321\\202\\320\\265\\321\\200 \\321\\201 \\321\\202\\320\\276\\320\\262\\320\\260 \\320\\270\\320\\274\\320\\265 \\320\\275\\320\\265 \\321\\201\\321\\212\\321\\211\\320\\265\\321\\201\\321\\202\\320\\262\\321\\203\\320\\262\\320\\260\\0\"\\\n  \"\\320\\237\\320\\265\\321\\207\\320\\260\\321\\202\\320\\260\\320\\275\\320\\265...\\0\"\\\n  \"\\320\\237\\320\\265\\321\\207\\320\\260\\321\\202\\320\\260\\320\\275\\320\\265\\321\\202\\320\\276 \\320\\262\\321\\201\\320\\265 \\320\\276\\321\\211\\320\\265 \\320\\265 \\320\\275\\320\\260 \\321\\205\\320\\276\\320\\264. \\320\\241\\320\\270\\320\\263\\321\\203\\321\\200\\320\\275\\320\\270 \\320\\273\\320\\270 \\321\\201\\321\\202\\320\\265, \\321\\207\\320\\265 \\320\\270\\321\\201\\320\\272\\320\\260\\321\\202\\320\\265 \\320\\277\\321\\200\\320\\270\\320\\275\\321\\203\\320\\264\\320\\270\\321\\202\\320\\265\\320\\273\\320\\275\\320\\276 \\320\\264\\320\\260 \\320\\263\\320\\276 \\320\\276\\321\\202\\320\\272\\320\\260\\320\\266\\320\\265\\321\\202\\320\\265 \\320\\270 \\320\\264\\320\\260 \\320\\270\\320\\267\\320\\273\\320\\265\\320\\267\\320\\265\\321\\202\\320\\265?\\0\"\\\n  \"\\320\\236\\321\\202\\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\262\\320\\260\\320\\275\\320\\265\\321\\202\\320\\276 \\321\\201\\320\\265 \\320\\270\\320\\267\\320\\262\\321\\212\\321\\200\\321\\210\\320\\262\\320\\260. \\320\\237\\321\\200\\320\\265\\320\\272\\321\\212\\321\\201\\320\\275\\320\\270 \\320\\270 \\320\\267\\320\\260\\320\\277\\320\\276\\321\\207\\320\\275\\320\\270 \\320\\276\\321\\202\\320\\275\\320\\260\\321\\207\\320\\260\\320\\273\\320\\276?\\0\"\\\n  \"\\320\\236\\321\\202\\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\262\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 %d \\320\\276\\321\\202 %d...\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\261\\320\\273\\320\\265\\320\\274 \\320\\277\\321\\200\\320\\270 \\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\260\\320\\275\\320\\265.\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\320\\270\\320\\274\\320\\265\\320\\275\\321\\203\\320\\262\\320\\260\\320\\271...\\tF2\\0\"\\\n  \"&\\320\\227\\320\\260\\320\\277\\320\\276\\320\\274\\320\\275\\320\\270 \\320\\276\\321\\202\\320\\262\\320\\276\\321\\200\\320\\265\\320\\275\\320\\270\\321\\202\\320\\265 \\321\\204\\320\\260\\320\\271\\320\\273\\320\\276\\320\\262\\320\\265\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\320\\274\\320\\260\\321\\205\\320\\275\\320\\270 \\320\\276\\321\\202 \\320\\273\\321\\216\\320\\261\\320\\270\\320\\274\\320\\270\\321\\202\\320\\265\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\320\\274\\320\\260\\321\\205\\320\\275\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 %s \\320\\276\\321\\202 \\320\\273\\321\\216\\320\\261\\320\\270\\320\\274\\320\\270\\321\\202\\320\\265\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\320\\270\\320\\274\\320\\265\\320\\275\\321\\203\\320\\262\\320\\260\\320\\271 \\320\\275\\320\\260\\0\"\\\n  \"\\320\\227\\320\\260\\320\\262\\321\\212\\321\\200\\321\\202\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260&\\320\\273\\321\\217\\320\\262\\320\\276\\tCtrl+Shift+-\\0\"\\\n  \"\\320\\227\\320\\260\\320\\262\\321\\212\\321\\200\\321\\202\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260&\\320\\264\\321\\217\\321\\201\\320\\275\\320\\276\\tCtrl+Shift++\\0\"\\\n  \"\\320\\227\\320\\260\\320\\277\\320\\270\\321\\201 \\320\\272\\320\\260\\321\\202\\320\\276\\0\"\\\n  \"\\320\\227\\320\\260\\320\\277\\320\\260\\320\\274\\320\\265\\321\\202\\320\\270 &\\320\\272\\321\\200\\320\\260\\321\\202\\321\\212\\320\\272 \\320\\277\\321\\212\\321\\202 \\320\\272\\321\\212\\320\\274 \\321\\204\\320\\260\\320\\271\\320\\273\\320\\260...\\tCtrl+Shift+S\\0\"\\\n  \"\\320\\242\\321\\212\\321\\200\\321\\201\\320\\265\\320\\275\\320\\265 \\320\\262 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 %d \\320\\276\\321\\202 %d...\\0\"\\\n  \"\\320\\230\\320\\267\\320\\261\\320\\265\\321\\200\\320\\270 \\320\\262\\321\\201\\320\\270\\321\\207\\320\\272\\320\\276\\0\"\\\n  \"\\320\\230\\320\\267\\320\\261\\320\\265\\321\\200\\320\\270 &\\320\\262\\321\\201\\320\\270\\321\\207\\320\\272\\320\\276\\tCtrl+A\\0\"\\\n  \"\\320\\230\\320\\267\\320\\261\\320\\265\\321\\200\\320\\265\\321\\202\\320\\265 \\321\\201\\321\\212\\320\\264\\321\\212\\321\\200\\320\\266\\320\\260\\320\\275\\320\\270\\320\\265 \\321\\201 Ctrl \\320\\270 \\320\\273\\320\\265\\320\\262\\320\\270\\321\\217 \\320\\261\\321\\203\\321\\202\\320\\276\\320\\275 \\320\\275\\320\\260 \\320\\274\\320\\270\\321\\210\\320\\272\\320\\260\\321\\202\\320\\260\\0\"\\\n  \"\\320\\230\\320\\267\\320\\261\\320\\276\\321\\200:\\0\"\\\n  \"\\320\\230\\320\\267\\320\\277\\321\\200\\320\\260\\321\\202\\320\\270 \\320\\277\\320\\276 &\\320\\265\\320\\273\\320\\265\\320\\272\\321\\202\\321\\200\\320\\276\\320\\275\\320\\275\\320\\260\\321\\202\\320\\260 \\320\\277\\320\\276\\321\\211\\320\\260\\0\"\\\n  \"\\320\\222\\321\\212\\320\\262\\320\\265\\320\\264\\320\\270 \\320\\277\\320\\260\\321\\200\\320\\260\\320\\274\\320\\265\\321\\202\\321\\200\\320\\270 \\320\\267\\320\\260 \\320\\276\\320\\261\\321\\200\\320\\260\\321\\202\\320\\275\\320\\276 \\321\\202\\321\\212\\321\\200\\321\\201\\320\\265\\320\\275\\320\\265\\0\"\\\n  \"\\320\\237\\320\\276\\320\\272\\320\\260\\320\\266\\320\\270 \\320\\276\\321\\202\\320\\274\\320\\265\\321\\202\\320\\272\\320\\270\\321\\202\\320\\265\\0\"\\\n  \"&\\320\\235\\320\\265\\320\\277\\321\\200\\320\\265\\320\\272\\321\\212\\321\\201\\320\\275\\320\\260\\321\\202\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\0\"\\\n  \"\\320\\233\\320\\265\\320\\275&\\321\\202\\320\\260 \\321\\201 \\320\\270\\320\\275\\321\\201\\321\\202\\321\\200\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\237\\320\\276\\320\\272\\320\\260\\320\\266\\320\\270 \\320\\233\\321\\216\\320\\261\\320\\270\\320\\274\\320\\270\\0\"\\\n  \"\\320\\237\\320\\276\\320\\272\\320\\260\\320\\266\\320\\270 \\321\\207\\320\\265\\321\\201\\321\\202\\320\\276 \\321\\207\\320\\265\\321\\202\\320\\265\\320\\275\\320\\270\\321\\202\\320\\265\\0\"\\\n  \"\\320\\237\\320\\276\\320\\272\\320\\260\\320\\266\\320\\270 &\\320\\277\\320\\276\\320\\272\\320\\260\\320\\267\\320\\260\\320\\273\\320\\265\\321\\206\\320\\260 \\320\\262 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\207\\320\\275\\320\\260\\321\\202\\320\\260 \\320\\272\\320\\276\\320\\273\\320\\276\\320\\275\\320\\260 \\320\\272\\320\\276\\320\\263\\320\\260\\321\\202\\320\\276 \\320\\265 \\320\\262\\321\\212\\320\\267\\320\\274\\320\\276\\320\\266\\320\\275\\320\\276\\0\"\\\n  \"\\320\\225\\320\\264\\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\0\"\\\n  \"\\320\\230\\320\\267\\320\\262\\320\\270\\320\\275\\320\\265\\321\\202\\320\\265, \\321\\202\\320\\276\\320\\262\\320\\260 \\320\\275\\320\\265 \\320\\261\\320\\270 \\321\\202\\321\\200\\321\\217\\320\\261\\320\\262\\320\\260\\320\\273\\320\\276 \\320\\264\\320\\260 \\321\\201\\320\\265 \\321\\201\\320\\273\\321\\203\\321\\207\\320\\262\\320\\260!\\n\\n\\320\\234\\320\\276\\320\\273\\321\\217, \\320\\275\\320\\260\\321\\202\\320\\270\\321\\201\\320\\275\\320\\265\\321\\202\\320\\265 \\342\\200\\236\\320\\236\\321\\202\\320\\272\\320\\260\\320\\267\\342\\200\\234, \\320\\260\\320\\272\\320\\276 \\320\\270\\321\\201\\320\\272\\320\\260\\321\\202\\320\\265 \\320\\264\\320\\260 \\320\\275\\320\\270 \\320\\277\\320\\276\\320\\274\\320\\276\\320\\263\\320\\275\\320\\265\\321\\202\\320\\265 \\320\\264\\320\\260 \\320\\277\\320\\276\\320\\277\\321\\200\\320\\260\\320\\262\\320\\270\\320\\274 \\320\\277\\321\\200\\320\\270\\321\\207\\320\\270\\320\\275\\320\\260\\321\\202\\320\\260 \\320\\267\\320\\260 \\321\\202\\320\\276\\320\\267\\320\\270 \\321\\201\\321\\200\\320\\270\\320\\262 (\\321\\201\\320\\277\\320\\270\\321\\200\\320\\260\\320\\275\\320\\265).\\0\"\\\n  \"\\320\\244\\320\\260\\320\\271\\320\\273\\321\\212\\321\\202-\\320\\270\\320\\267\\321\\202\\320\\276\\321\\207\\320\\275\\320\\270\\320\\272 %s \\320\\275\\321\\217\\320\\274\\320\\260 \\321\\202\\320\\276\\321\\207\\320\\272\\320\\260 \\320\\275\\320\\260 \\321\\201\\320\\270\\320\\275\\321\\205\\321\\200\\320\\276\\320\\275\\320\\270\\320\\267\\320\\260\\321\\206\\320\\270\\321\\217\\0\"\\\n  \"\\320\\236\\321\\202\\320\\275\\320\\276\\321\\201\\320\\275\\320\\276 (\\321\\202\\320\\265\\320\\274\\320\\260):\\0\"\\\n  \"\\320\\235\\320\\260\\321\\201\\321\\202\\321\\200\\320\\276\\320\\271\\320\\272\\320\\270 \\320\\275\\320\\260 SumatraPDF\\0\"\\\n  \"\\320\\236\\320\\261\\320\\275\\320\\276\\320\\262\\321\\217\\320\\262\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 SumatraPDF\\0\"\\\n  \"SumatraPDF \\321\\201\\320\\265 \\321\\201\\321\\200\\320\\270\\320\\275\\320\\260 (\\321\\201\\320\\277\\321\\200\\321\\217 \\320\\262\\320\\275\\320\\265\\320\\267\\320\\260\\320\\277\\320\\275\\320\\276)\\0\"\\\n  \"SumatraPDF \\320\\265 \\320\\262\\320\\260\\321\\210\\320\\270\\321\\217\\321\\202 PDF \\321\\207\\320\\265\\321\\202\\320\\265\\321\\206 \\320\\277\\320\\276 \\320\\277\\320\\276\\320\\264\\321\\200\\320\\260\\320\\267\\320\\261\\320\\270\\321\\200\\320\\260\\320\\275\\320\\265\\0\"\\\n  \"SumatraPDF \\320\\262\\320\\265\\321\\207\\320\\265 \\321\\202\\321\\200\\321\\217\\320\\261\\320\\262\\320\\260 \\320\\264\\320\\260 \\320\\265 \\321\\203\\320\\272\\320\\260\\320\\267\\320\\260\\320\\275\\320\\260 \\320\\272\\320\\260\\321\\202\\320\\276 \\320\\277\\320\\276\\320\\264\\321\\200\\320\\260\\320\\267\\320\\261\\320\\270\\321\\200\\320\\260\\321\\211 \\321\\201\\320\\265 \\321\\207\\320\\265\\321\\202\\320\\265\\321\\206 \\320\\275\\320\\260/\\320\\267\\320\\260 PDF \\321\\204\\320\\260\\320\\271\\320\\273\\320\\276\\320\\262\\320\\265\\0\"\\\n  \"\\320\\244\\320\\260\\320\\271\\320\\273\\321\\212\\321\\202 \\320\\267\\320\\260 \\321\\201\\320\\270\\320\\275\\321\\205\\321\\200\\320\\276\\320\\275\\320\\270\\320\\267\\320\\260\\321\\206\\320\\270\\321\\217 \\320\\275\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\265 \\320\\264\\320\\260 \\320\\261\\321\\212\\320\\264\\320\\265 \\320\\276\\321\\202\\320\\262\\320\\276\\321\\200\\320\\265\\320\\275\\0\"\\\n  \"\\320\\225\\321\\202\\320\\270\\320\\272\\320\\265\\321\\202\\320\\270\\321\\200\\320\\265\\320\\275 .PDF \\321\\204\\320\\260\\320\\271\\320\\273 (Tagged PDF)\\0\"\\\n  \"\\320\\242\\320\\265\\320\\272\\321\\201\\321\\202\\320\\276\\320\\262\\320\\270 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\0\"\\\n  \"\\320\\227\\320\\260\\320\\263\\320\\273\\320\\260\\320\\262\\320\\270\\320\\265:\\0\"\\\n  \"\\320\\244\\320\\260\\320\\271\\320\\273\\321\\212\\321\\202, \\320\\270\\320\\267\\320\\261\\321\\200\\320\\260\\320\\275 \\320\\267\\320\\260 \\320\\270\\320\\267\\321\\202\\320\\276\\321\\207\\320\\275\\320\\270\\320\\272, \\320\\265 \\320\\275\\320\\265\\320\\277\\320\\276\\320\\267\\320\\275\\320\\260\\321\\202 (%s)\\0\"\\\n  \"\\0\"\\\n  \"\\320\\230\\320\\267\\320\\263\\320\\273\\320\\265\\320\\264\\0\"\\\n  \"\\320\\237\\320\\276\\321\\201\\320\\265\\321\\202\\320\\265\\321\\202\\320\\265 &\\321\\203\\320\\265\\320\\261\\321\\201\\320\\260\\320\\271\\321\\202\\320\\260\\0\"\\\n  \"\\320\\222\\320\\275\\320\\270\\320\\274\\320\\260\\320\\275\\320\\270\\320\\265\\0\"\\\n  \"XPS \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\230\\320\\274\\320\\260\\321\\202\\320\\265 \\320\\277\\320\\276\\321\\201\\320\\273\\320\\265\\320\\264\\320\\275\\320\\260\\321\\202\\320\\260 \\320\\262\\320\\265\\321\\200\\321\\201\\320\\270\\321\\217.\\0\"\\\n  \"\\320\\222\\320\\260\\321\\210\\320\\260\\321\\202\\320\\260 \\320\\262\\320\\265\\321\\200\\321\\201\\320\\270\\321\\217 \\320\\265 %s\\0\"\\\n  \"\\320\\243\\320\\262\\320\\265\\320\\273\\320\\270\\321\\207\\320\\265\\320\\275\\320\\270\\320\\265\\0\"\\\n  \"\\320\\243\\320\\262\\320\\265\\320\\273\\320\\270\\321\\207\\320\\260\\320\\262\\320\\260\\320\\275\\320\\265\\0\"\\\n  \"\\320\\235\\320\\260\\320\\274\\320\\260\\320\\273\\321\\217\\320\\275\\320\\265\\0\"\\\n  \"\\320\\232\\320\\276\\320\\265\\321\\204\\320\\270\\321\\206\\320\\270\\320\\265\\320\\275\\321\\202 \\320\\275\\320\\260 \\321\\203\\320\\262\\320\\265\\320\\273\\320\\270\\321\\207\\320\\265\\320\\275\\320\\270\\320\\265\\0\"\\\n  \"[\\320\\235\\320\\260\\320\\274\\320\\265\\321\\200\\320\\265\\320\\275\\320\\270 \\321\\201\\320\\260 \\320\\277\\321\\200\\320\\276\\320\\274\\320\\265\\320\\275\\320\\270; \\320\\276\\320\\261\\320\\275\\320\\276\\320\\262\\321\\217\\320\\262\\320\\260\\320\\274] %s\\0\"\\\n  \"\\320\\272\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 \\321\\202\\320\\265\\320\\272\\321\\201\\321\\202\\0\"\\\n  \"\\320\\276\\321\\202\\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\262\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\";\n\nconst char * gTranslations_ca = \n  \"&Quant a...\\0\"\\\n  \"Mida &real\\tCtrl+1\\0\"\\\n  \"Opcions &avan\\303\\247ades...\\0\"\\\n  \"&Totes les p\\303\\240gines seleccionades\\0\"\\\n  \"Enrere\\tAlt+Left Arrow\\0\"\\\n  \"Visualitzaci\\303\\263 de &llibre\\tCtrl+8\\0\"\\\n  \"&Tanca\\tCtrl+W\\0\"\\\n  \"&Copia la selecci\\303\\263\\0\"\\\n  \"&Copia la selecci\\303\\263\\tCtrl+C\\0\"\\\n  \"&No ho tornis a preguntar\\0\"\\\n  \"Nom\\303\\251s les p\\303\\240gines parelles\\0\"\\\n  \"P\\303\\240gina &doble\\tCtrl+7\\0\"\\\n  \"&Fitxer\\0\"\\\n  \"&Cerca el text:\\0\"\\\n  \"&Primera p\\303\\240gina\\tInici\\0\"\\\n  \"Ajusta les p\\303\\240gines a l'\\303\\240rea imprimible\\0\"\\\n  \"&V\\303\\251s a\\0\"\\\n  \"&V\\303\\251s a la p\\303\\240gina:\\0\"\\\n  \"&Ajuda\\0\"\\\n  \"\\303\\232&ltima p\\303\\240gina\\tFinal\\0\"\\\n  \"&Nivell d'augment:\\0\"\\\n  \"\\0\"\\\n  \"Respecta les &maj\\303\\272scules i minuscules\\0\"\\\n  \"P\\303\\240gina &seg\\303\\274ent\\t->\\0\"\\\n  \"\\0\"\\\n  \"&No, gr\\303\\240cies\\0\"\\\n  \"Nom\\303\\251s les p\\303\\240gines senars\\0\"\\\n  \"&Obre el document\\0\"\\\n  \"&Obre...\\tCtrl+O\\0\"\\\n  \"&Opcions...\\0\"\\\n  \"&Contrasenya:\\0\"\\\n  \"&Marca el document\\0\"\\\n  \"P\\303\\240gina &anterior\\t<-\\0\"\\\n  \"Im&primeix...\\0\"\\\n  \"&Imprimeix...\\tCtrl+P\\0\"\\\n  \"&Imprimeix... (denegat)\\0\"\\\n  \"&Recorda la contrasenya per a aquest document\\0\"\\\n  \"Conserva aquestes &prefer\\303\\250ncies per a cada document\\0\"\\\n  \"&Suprimeix el document\\0\"\\\n  \"Anomena i de&sa...\\0\"\\\n  \"Anomena i de&sa...\\tCtrl+S\\0\"\\\n  \"&Prefer\\303\\250ncies\\0\"\\\n  \"&Redu\\303\\257u les p\\303\\240gines a l'\\303\\240rea imprimible (si \\303\\251s necessari)\\0\"\\\n  \"P\\303\\240gina \\303\\272&nica\\tCtrl+6\\0\"\\\n  \"&Omet aquesta versi\\303\\263\\0\"\\\n  \"&Usa la mida de p\\303\\240gina original\\0\"\\\n  \"&Visualitza\\0\"\\\n  \"&Finestra\\0\"\\\n  \"&S\\303\\255\\0\"\\\n  \"&Escalat\\0\"\\\n  \"(de %d)\\0\"\\\n  \"(p\\303\\240gina %s)\\0\"\\\n  \"Quant al SumatraPDF\\0\"\\\n  \"Afegeix un preferit\\0\"\\\n  \"Afegeix la p\\303\\240gina %s als preferits\\0\"\\\n  \"Afegeix la p\\303\\240gina %s als preferits amb el nom (opcional):\\0\"\\\n  \"Afegeix als preferits\\0\"\\\n  \"Avan\\303\\247ats\\0\"\\\n  \"Tots els fitxers\\0\"\\\n  \"Tots els documents suportats\\0\"\\\n  \"Programa:\\0\"\\\n  \"Voleu associar-lo amb els fitxers PDF?\\0\"\\\n  \"Adjunt: %s\\0\"\\\n  \"Autor:\\0\"\\\n  \"Autom\\303\\240tic\\0\"\\\n  \"&Comprova les actualitzacions autom\\303\\240ticament\\0\"\\\n  \"Visualitzaci\\303\\263 de llibre\\0\"\\\n  \"&Marcadors\\tF12\\0\"\\\n  \"Dreceres de marcadors\\0\"\\\n  \"Drecera del marcador a la p\\303\\240gina %s de %s\\0\"\\\n  \"Marcadors\\0\"\\\n  \"\\0\"\\\n  \"Documents CHM\\0\"\\\n  \"No es pot connectar a internet (error %#x).\\0\"\\\n  \"Cancel\\302\\267la\\0\"\\\n  \"No es pot imprimir el fitxer\\0\"\\\n  \"No es pot iniciar l'ordre de cerca inversa. Comproveu la l\\303\\255nia d'ordres a les prefer\\303\\250ncies.\\0\"\\\n  \"Canvia la llengua (Change Language)\\0\"\\\n  \"&Comprova si hi ha una versi\\303\\263 nova\\0\"\\\n  \"Llibres de c\\303\\262mic\\0\"\\\n  \"Compatibilitat\\0\"\\\n  \"Cont\\303\\255nua\\0\"\\\n  \"Visualitzaci\\303\\263 cont\\303\\255nua de llibre\\0\"\\\n  \"P\\303\\240gina doble cont\\303\\255nua\\0\"\\\n  \"Contribu\\303\\257u en la traducci\\303\\263\\0\"\\\n  \"Copia la &imatge\\0\"\\\n  \"Copia l'adre\\303\\247a de l'enlla\\303\\247\\0\"\\\n  \"Copia el co&mentari\\0\"\\\n  \"No es pot copiar el text (nom\\303\\251s es copia com a imatge)\\0\"\\\n  \"\\0\"\\\n  \"No es poden obtenir les propietats de la impressora\\0\"\\\n  \"No es pot inicialitzar la impressora\\0\"\\\n  \"No es pot representar la p\\303\\240gina\\0\"\\\n  \"Creat:\\0\"\\\n  \"Fitxer actual\\0\"\\\n  \"Posici\\303\\263 del cursor\\0\"\\\n  \"Escala &predeterminada\\342\\200\\246\\tCtrl+Y\\0\"\\\n  \"&Visualitzaci\\303\\263 predeterminada:\\0\"\\\n  \"&Zoom predeterminat\\0\"\\\n  \"No es pot canviar el lector de PDF predeterminat en mode portable.\\0\"\\\n  \"Permisos denegats:\\0\"\\\n  \"Documents DjVu\\0\"\\\n  \"Propietats del document\\0\"\\\n  \"Baixa\\0\"\\\n  \"S&urt\\tCtrl+Q\\0\"\\\n  \"Documents EPUB\\0\"\\\n  \"Introdu\\303\\257u la contrasenya\\0\"\\\n  \"Introdu\\303\\257u la constrasenya per a %s\\0\"\\\n  \"Introdu\\303\\257u la l\\303\\255nia d'ordres que voleu executar en fer doble clic al document PDF:\\0\"\\\n  \"S'ha produ\\303\\257t un error en carregar %s\\0\"\\\n  \"Pr&eferits\\0\"\\\n  \"En&davant\\tAlt+Right Arrow\\0\"\\\n  \"Pantalla &completa\\tCtrl+Shift+L\\0\"\\\n  \"P\\303\\240gina doble\\0\"\\\n  \"S'ha produ\\303\\257t un error en canviar el nom del fitxer!\\0\"\\\n  \"S'ha produ\\303\\257t un error en desar el fitxer.\\0\"\\\n  \"Visualitzaci\\303\\263 r\\303\\240pida de web\\0\"\\\n  \"Preferits\\0\"\\\n  \"Documents FictionBook\\0\"\\\n  \"No es troba el fitxer %s\\0\"\\\n  \"Mida del fitxer:\\0\"\\\n  \"Fitxer:\\0\"\\\n  \"&Cerca...\\tCtrl+F\\0\"\\\n  \"Cerca\\0\"\\\n  \"Cerca seg\\303\\274ent\\0\"\\\n  \"Cerca anterior\\0\"\\\n  \"Cerca:\\0\"\\\n  \"Ajusta el &contingut\\tCtrl+3\\0\"\\\n  \"Ajusta a la &p\\303\\240gina\\tCtrl+0\\0\"\\\n  \"Ajusta a l'am&plada\\tCtrl+2\\0\"\\\n  \"Ajusta el contingut\\0\"\\\n  \"Ajusta a la p\\303\\240gina\\0\"\\\n  \"Ajusta a l'amplada\\0\"\\\n  \"Ajusta l'amplada i mostra les p\\303\\240gines de forma cont\\303\\255nua\\0\"\\\n  \"Ajusta a una \\303\\272nica p\\303\\240gina\\0\"\\\n  \"Tipus de lletra:\\0\"\\\n  \"S'est\\303\\240 formatant el llibre... %d p\\303\\240gines\\0\"\\\n  \"S'ha trobat el text a la pagina %s\\0\"\\\n  \"S'ha trobat el text a la p\\303\\240gina %s (altra vegada)\\0\"\\\n  \"Llegits m\\303\\251s freq\\303\\274ents\\0\"\\\n  \"\\0\"\\\n  \"V\\303\\251s a la p\\303\\240gina\\0\"\\\n  \"Amaga els m\\303\\251s llegits\\0\"\\\n  \"Suggeriment: feu servir la tecla F3 per tornar a cercar\\0\"\\\n  \"Fitxers d'imatge (*.%s))\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Voleu que el SumatraPDF sigui el visor predeterminat dels fitxers PDF?\\0\"\\\n  \"Fes el SumatraPDF el lector de PDF predeterminat\\0\"\\\n  \"Mode man&ga\\0\"\\\n  \"Distigeix entre maj\\303\\272scules i min\\303\\272scules\\0\"\\\n  \"Documents Mobi\\0\"\\\n  \"Modificat:\\0\"\\\n  \"Es troba disponible una versi\\303\\263 nova %s. Voleu baixar-la?\\0\"\\\n  \"P\\303\\240gina seg\\303\\274ent\\0\"\\\n  \"No s'han trobat coincid\\303\\250ncies\\0\"\\\n  \"No s'ha trobat cap resultat de cerca v\\303\\240lid a la l\\303\\255nia %u al fitxer %s\\0\"\\\n  \"No s'ha trobat el fitxer de sincronitzaci\\303\\263\\0\"\\\n  \"No hi ha informaci\\303\\263 de sincronitzaci\\303\\263 en aquesta posici\\303\\263\\0\"\\\n  \"Nombre de p\\303\\240gines:\\0\"\\\n  \"D'acord\\0\"\\\n  \"Obre\\0\"\\\n  \"Obre amb el PDF-XChange\\0\"\\\n  \"Obre un document...\\0\"\\\n  \"Obre amb %s\\0\"\\\n  \"Obre amb l'&Adobe Reader\\0\"\\\n  \"Obre amb el &Foxit Reader\\0\"\\\n  \"Obre amb el Microsoft HTML Help\\0\"\\\n  \"Obre amb el Microsoft XPS-Viewer\\0\"\\\n  \"P&ropietats\\0\"\\\n  \"P&ropietats...\\tCtrl+D\\0\"\\\n  \"Document PDF\\0\"\\\n  \"Optimitzacions del PDF:\\0\"\\\n  \"Productor PDF:\\0\"\\\n  \"Versi\\303\\263 de PDF:\\0\"\\\n  \"Documents PDF\\0\"\\\n  \"P\\303\\240&gina...\\tCtrl+G\\0\"\\\n  \"P\\303\\240gina %s\\0\"\\\n  \"Mida de p\\303\\240gina:\\0\"\\\n  \"La p\\303\\240gina %u no existeix\\0\"\\\n  \"Escalat de la p\\303\\240gina\\0\"\\\n  \"P\\303\\240gina:\\0\"\\\n  \"Documents PalmDoc\\0\"\\\n  \"S'est\\303\\240 renderitzant...\\0\"\\\n  \"Documents Postscript\\0\"\\\n  \"Pr&esentaci\\303\\263\\tCtrl+L\\0\"\\\n  \"P\\303\\240gina anterior\\0\"\\\n  \"Imprimeix\\0\"\\\n  \"Interval d'impressi\\303\\263\\0\"\\\n  \"No existeix cap impressora amb el nom prove\\303\\257t\\0\"\\\n  \"La impressio \\303\\251s en proc\\303\\251s.\\0\"\\\n  \"La impressi\\303\\263 encara est\\303\\240 en proc\\303\\251s. Voleu aturar i sortir?\\0\"\\\n  \"La impressi\\303\\263 encara es troba en progr\\303\\251s. Voleu cancel\\302\\267lar-la i tornar a comen\\303\\247ar??\\0\"\\\n  \"S'est\\303\\240 imprimient la p\\303\\240gina %d de %d...\\0\"\\\n  \"S'ha produ\\303\\257t un problema en la impressi\\303\\263.\\0\"\\\n  \"Canvia el &nom...\\tF2\\0\"\\\n  \"Recorda els fitxers &oberts\\0\"\\\n  \"Suprimeix dels preferits\\0\"\\\n  \"Suprimeix la p\\303\\240gina %s dels preferits\\0\"\\\n  \"Canvia el nom a\\0\"\\\n  \"Gira a l'esquerra\\tCtrl+Shift+-\\0\"\\\n  \"Gira a la dreta\\tCtrl+Shift++\\0\"\\\n  \"Anomena i desa\\0\"\\\n  \"Desa una &drecera...\\tCtrl+Maj+5\\0\"\\\n  \"S'est\\303\\240 cercant %d de %d...\\0\"\\\n  \"Selecciona-ho &tot\\0\"\\\n  \"Seleccciona-ho &tot\\tCtrl+A\\0\"\\\n  \"Seleccioneu contigut amb la combinaci\\303\\263 Ctrl+bot\\303\\263 secundari del ratol\\303\\255\\0\"\\\n  \"Selecci\\303\\263:\\0\"\\\n  \"Envia per correu-&e...\\0\"\\\n  \"Cerca cap enrere\\0\"\\\n  \"Mostra els &marcadors\\0\"\\\n  \"Mostra les &p\\303\\240gines de forma cont\\303\\255nua\\0\"\\\n  \"Mostra la &barra d'eines\\0\"\\\n  \"Mostra els preferits\\0\"\\\n  \"Mostra els m\\303\\251s llegits\\0\"\\\n  \"Mostra la &barra lateral de marcadors quan estigui disponible\\0\"\\\n  \"P\\303\\240gina \\303\\272nica\\0\"\\\n  \"Aix\\303\\262 no hauria d'haver passat!\\n\\nFeu clic a 'Cancel\\302\\267la', si voleu ajudar-nos a corregir la causa d'aquest error.\\0\"\\\n  \"El fitxer d'origen %s no t\\303\\251 un punt de sincronitzaci\\303\\263 v\\303\\240lid\\0\"\\\n  \"Subjecte:\\0\"\\\n  \"Opcions del SumatraPDF\\0\"\\\n  \"Actualitzaci\\303\\263 del SumatraPDF\\0\"\\\n  \"El SumatraPDF ha fallat\\0\"\\\n  \"El SumatraPDF \\303\\251s el seu lector PDF predeterminat\\0\"\\\n  \"El SumatraPDF ha d'\\303\\251sser ara mateix el vostre lector PDF predeterminat\\0\"\\\n  \"El fitxer de sincronitzaci\\303\\263 no es pot obrir\\0\"\\\n  \"PDF etiquetat\\0\"\\\n  \"Documents de text\\0\"\\\n  \"Aquest document utilitza caracter\\303\\255stiques no suportades (%s) i podria no ser mostrat correctament\\0\"\\\n  \"T\\303\\255tol:\\0\"\\\n  \"Fitxer origen desconegut (%s)\\0\"\\\n  \"Utilitza les pes&tanyes\\0\"\\\n  \"Visualitza\\0\"\\\n  \"Visiteu el lloc &web\\0\"\\\n  \"Av\\303\\255s\\0\"\\\n  \"Documents XPS\\0\"\\\n  \"Teniu la darrera versi\\303\\263.\\0\"\\\n  \"Teniu la versi\\303\\263 %s\\0\"\\\n  \"\\0\"\\\n  \"Acosta't\\0\"\\\n  \"Allunya't\\0\"\\\n  \"Factor d'escala\\0\"\\\n  \"[S'han detectat canvis; s'est\\303\\240 actualitzant] %s\\0\"\\\n  \"s'est\\303\\240 copiant text\\0\"\\\n  \"s'est\\303\\240 imprimint el document\\0\";\n\nconst char * gTranslations_ca_xv = \n  \"&Quant a...\\0\"\\\n  \"Mida &real\\tCtrl+1\\0\"\\\n  \"Opcions &avan\\303\\247ades...\\0\"\\\n  \"&Totes les p\\303\\240gines seleccionades\\0\"\\\n  \"Arrere\\tAlt+Left Arrow\\0\"\\\n  \"Visualitzaci\\303\\263 de &llibre\\tCtrl+8\\0\"\\\n  \"&Tanca\\tCtrl+W\\0\"\\\n  \"&Copia la selecci\\303\\263\\0\"\\\n  \"&Copia la selecci\\303\\263\\tCtrl+C\\0\"\\\n  \"&No ho tornes a preguntar\\0\"\\\n  \"Nom\\303\\251s les p\\303\\240gines parelles\\0\"\\\n  \"P\\303\\240gina &doble\\tCtrl+7\\0\"\\\n  \"&Fitxer\\0\"\\\n  \"&Cerca el texta:\\0\"\\\n  \"&Primera p\\303\\240gina\\tInici\\0\"\\\n  \"Ajusta les p\\303\\240gines a l'\\303\\240rea imprimible\\0\"\\\n  \"&V\\303\\251s a\\0\"\\\n  \"&V\\303\\251s a la p\\303\\240gina:\\0\"\\\n  \"&Ajuda\\0\"\\\n  \"\\303\\232&ltima p\\303\\240gina\\tFinal\\0\"\\\n  \"&Nivell d'augment:\\0\"\\\n  \"\\0\"\\\n  \"Respecta les &maj\\303\\272scules i minuscules\\0\"\\\n  \"P\\303\\240gina &seg\\303\\274ent\\t->\\0\"\\\n  \"\\0\"\\\n  \"&No, gr\\303\\240cies\\0\"\\\n  \"Nom\\303\\251s les p\\303\\240gines senars\\0\"\\\n  \"&Obri el document\\0\"\\\n  \"&Obri...\\tCtrl+O\\0\"\\\n  \"&Opcions...\\0\"\\\n  \"&Contrasenya:\\0\"\\\n  \"&Marca el document\\0\"\\\n  \"P\\303\\240gina &anterior\\t<-\\0\"\\\n  \"Im&primeix...\\0\"\\\n  \"&Imprimeix...\\tCtrl+P\\0\"\\\n  \"&Imprimeix... (denegat)\\0\"\\\n  \"&Recorda la contrasenya per a este document\\0\"\\\n  \"Conserva estes &prefer\\303\\250ncies per a cada document\\0\"\\\n  \"&Suprimeix el document\\0\"\\\n  \"Anomena i al&\\303\\247a...\\0\"\\\n  \"Anomena i al&\\303\\247a...\\tCtrl+S\\0\"\\\n  \"&Prefer\\303\\250ncies\\0\"\\\n  \"&Redu\\303\\257u les p\\303\\240gines a l'\\303\\240rea imprimible (si \\303\\251s necessari)\\0\"\\\n  \"P\\303\\240gina \\303\\272&nica\\tCtrl+6\\0\"\\\n  \"&Omet esta versi\\303\\263\\0\"\\\n  \"&Usa la mida de p\\303\\240gina original\\0\"\\\n  \"&Visualitza\\0\"\\\n  \"&Finestra\\0\"\\\n  \"&S\\303\\255\\0\"\\\n  \"&Escalat\\0\"\\\n  \"(de %d)\\0\"\\\n  \"(p\\303\\240gina %s)\\0\"\\\n  \"Quant al SumatraPDF\\0\"\\\n  \"Afegix un preferit\\0\"\\\n  \"Afegix la p\\303\\240gina %s als preferits\\0\"\\\n  \"Afegix la p\\303\\240gina %s als preferits amb el nom (opcional):\\0\"\\\n  \"Afegix als preferits\\0\"\\\n  \"Avan\\303\\247ats\\0\"\\\n  \"Tots els fitxers\\0\"\\\n  \"Tots els documents suportats\\0\"\\\n  \"Programa:\\0\"\\\n  \"Voleu associar-lo amb els fitxers PDF?\\0\"\\\n  \"Adjunt: %s\\0\"\\\n  \"Autor:\\0\"\\\n  \"Autom\\303\\240tic\\0\"\\\n  \"&Comprova les actualitzacions autom\\303\\240ticament\\0\"\\\n  \"Visualitzaci\\303\\263 de llibre\\0\"\\\n  \"&Marcadors\\tF12\\0\"\\\n  \"Dreceres de marcadors\\0\"\\\n  \"Drecera del marcador a la p\\303\\240gina %s de %s\\0\"\\\n  \"Marcadors\\0\"\\\n  \"\\0\"\\\n  \"Documents CHM\\0\"\\\n  \"No es pot connectar a internet (error %#x).\\0\"\\\n  \"Cancel\\302\\267la\\0\"\\\n  \"No es pot imprimir el fitxer\\0\"\\\n  \"No es pot iniciar l'ordre de cerca inversa. Comproveu la l\\303\\255nia de comandes a les preferencies.\\0\"\\\n  \"Canvia la llengua (Change Language)\\0\"\\\n  \"&Comprova si hi ha una versi\\303\\263 nova\\0\"\\\n  \"Llibres de c\\303\\262mic\\0\"\\\n  \"Compatibilitat\\0\"\\\n  \"Cont\\303\\255nua\\0\"\\\n  \"Visualitzaci\\303\\263 cont\\303\\255nua de llibre\\0\"\\\n  \"P\\303\\240gina doble cont\\303\\255nua\\0\"\\\n  \"Contribu\\303\\257u en la traducci\\303\\263\\0\"\\\n  \"Copia la &imatge\\0\"\\\n  \"Copia l'adre\\303\\247a de l'enlla\\303\\247\\0\"\\\n  \"Copia el co&mentari\\0\"\\\n  \"No es pot copiar el text (nom\\303\\251s es copia com a imatge)\\0\"\\\n  \"\\0\"\\\n  \"No es poden obtindre les propietats de la impressora\\0\"\\\n  \"No es pot inicialitzar la impressora\\0\"\\\n  \"No es pot representar la p\\303\\240gina\\0\"\\\n  \"Creat:\\0\"\\\n  \"Fitxer actual\\0\"\\\n  \"Posici\\303\\263 del cursor:\\0\"\\\n  \"Zoom &predeterminat..\\tCtrl+Y\\0\"\\\n  \"&Visualitzaci\\303\\263 predeterminada:\\0\"\\\n  \"&Zoom predeterminat\\0\"\\\n  \"No es pot canviar el lector de PDF predeterminat en mode portable.\\0\"\\\n  \"Permisos denegats:\\0\"\\\n  \"Documents djvu\\0\"\\\n  \"Propietats del document\\0\"\\\n  \"Baixa\\0\"\\\n  \"I&x\\tCtrl+Q\\0\"\\\n  \"Documents EPUB\\0\"\\\n  \"Introdu\\303\\257u la contrasenya\\0\"\\\n  \"Introdu\\303\\257u la constrasenya per a %s\\0\"\\\n  \"Introdu\\303\\257u la l\\303\\255nia d'ordes que voleu executar en fer doble clic al document PDF:\\0\"\\\n  \"S'ha produ\\303\\257t un error en carregar %s\\0\"\\\n  \"F&avorits\\0\"\\\n  \"Avan&t\\tAlt+Right Arrow\\0\"\\\n  \"Pantalla &completa\\tCtrl+Shift+L\\0\"\\\n  \"P\\303\\240gina doble\\0\"\\\n  \"S'ha produ\\303\\217t un error en canviar el nom del fitxer!\\0\"\\\n  \"S'ha produ\\303\\257t un error en guardar el fitxer.\\0\"\\\n  \"Visualitzaci\\303\\263 r\\303\\240pida de web\\0\"\\\n  \"Preferits\\0\"\\\n  \"Documents FictionBook\\0\"\\\n  \"No s'ha trobat el fitxer %s\\0\"\\\n  \"Mida del fitxer:\\0\"\\\n  \"Fitxer:\\0\"\\\n  \"&Cerca...\\tCtrl+F\\0\"\\\n  \"Cerca\\0\"\\\n  \"Cerca seg\\303\\274ent\\0\"\\\n  \"Cerca anterior\\0\"\\\n  \"Cerca:\\0\"\\\n  \"Ajusta el &contingut\\tCtrl+3\\0\"\\\n  \"Ajusta a la &p\\303\\240gina\\tCtrl+0\\0\"\\\n  \"Ajusta a l'am&plada\\tCtrl+2\\0\"\\\n  \"Ajusta el contingut\\0\"\\\n  \"Ajusta a la p\\303\\240gina\\0\"\\\n  \"Ajusta a l'amplada\\0\"\\\n  \"Ajusta l'amplada i mostra les p\\303\\240gines de forma cont\\303\\255nua\\0\"\\\n  \"Ajusta a una \\303\\272nica p\\303\\240gina\\0\"\\\n  \"Tipus de lletra:\\0\"\\\n  \"S'est\\303\\240 formatant el llibre... %d p\\303\\240gines\\0\"\\\n  \"S'ha trobat el text a la pagina %s\\0\"\\\n  \"S'ha trobat el text a la p\\303\\240gina %s (altra vegada)\\0\"\\\n  \"Llegits m\\303\\251s freq\\303\\274ents\\0\"\\\n  \"\\0\"\\\n  \"V\\303\\251s a la p\\303\\240gina\\0\"\\\n  \"Amaga els m\\303\\251s llegits\\0\"\\\n  \"Suggeriment: feu servir la tecla F3 per tornar a cercar\\0\"\\\n  \"Fitxers d'imatge (*.%s))\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Voleu que el SumatraPDF siga el visor predeterminat dels fitxers PDF?\\0\"\\\n  \"Fes el SumatraPDF el lector de PDF predeterminat\\0\"\\\n  \"Mode man&ga\\0\"\\\n  \"Distigeix entre maj\\303\\272scules i min\\303\\272scules\\0\"\\\n  \"Documents Mobi\\0\"\\\n  \"Modificat:\\0\"\\\n  \"Es troba disponible una versi\\303\\263 nova %s. Voleu baixar-la?\\0\"\\\n  \"P\\303\\240gina seg\\303\\274ent\\0\"\\\n  \"No s'han trobat coincid\\303\\250ncies\\0\"\\\n  \"No s'ha trobat cap resultat de la cerca v\\303\\240lid a la l\\303\\255nia %u al fitxer %s\\0\"\\\n  \"No s'ha trobat el fitxer de sincronitzaci\\303\\263\\0\"\\\n  \"No hi ha informaci\\303\\263 de sincronitzaci\\303\\263 en esta posici\\303\\263\\0\"\\\n  \"Nombre de p\\303\\240gines:\\0\"\\\n  \"D'acord\\0\"\\\n  \"Obri\\0\"\\\n  \"Obri amb el PDF-XChange\\0\"\\\n  \"Obri un document...\\0\"\\\n  \"Obri amb %s\\0\"\\\n  \"Obri amb l'&Adobe Reader\\0\"\\\n  \"Obri amb el &Foxit Reader\\0\"\\\n  \"Obri amb el Microsoft HTML Help\\0\"\\\n  \"Obri amb el Microsoft XPS-Viewer\\0\"\\\n  \"P&ropietats\\0\"\\\n  \"P&ropietats...\\tCtrl+D\\0\"\\\n  \"Document PDF\\0\"\\\n  \"Optimitzacions del PDF:\\0\"\\\n  \"Productor PDF:\\0\"\\\n  \"Versi\\303\\263 de PDF:\\0\"\\\n  \"Documents PDF\\0\"\\\n  \"P\\303\\240&gina...\\tCtrl+G\\0\"\\\n  \"P\\303\\240gina %s\\0\"\\\n  \"Mida de p\\303\\240gina:\\0\"\\\n  \"La p\\303\\240gina %u no existeix\\0\"\\\n  \"Escalat de la p\\303\\240gina\\0\"\\\n  \"P\\303\\240gina:\\0\"\\\n  \"Documents PalmDoc\\0\"\\\n  \"S'est\\303\\240 renderitzant...\\0\"\\\n  \"Documents Postscript\\0\"\\\n  \"Pr&esentaci\\303\\263\\tCtrl+L\\0\"\\\n  \"P\\303\\240gina anterior\\0\"\\\n  \"Impressora\\0\"\\\n  \"Interval d'impressi\\303\\263\\0\"\\\n  \"No existeix cap impressora amb el nom prove\\303\\257t\\0\"\\\n  \"La impresi\\303\\263 \\303\\251s en proc\\303\\251s.\\0\"\\\n  \"La impressi\\303\\263 encara \\303\\251s en proc\\303\\251s. Voleu aturar i sortir?\\0\"\\\n  \"La impressi\\303\\263 encara es troba en progr\\303\\251s. Voleu cancel\\302\\267lar-la i tornar a comen\\303\\247ar??\\0\"\\\n  \"S'est\\303\\240 imprimient la p\\303\\240gina %d de %d...\\0\"\\\n  \"S'ha produ\\303\\257t un problema en la impressi\\303\\263.\\0\"\\\n  \"Canvia el &nom...\\tF2\\0\"\\\n  \"Recorda els fitxers &oberts\\0\"\\\n  \"Suprimeix dels preferits\\0\"\\\n  \"Suprimeix la p\\303\\240gina %s dels preferits\\0\"\\\n  \"Canvia el nom a\\0\"\\\n  \"Gira a l'esquerra\\tCtrl+Shift+-\\0\"\\\n  \"Gira a la dreta\\tCtrl+Shift++\\0\"\\\n  \"Anomena i guarda\\0\"\\\n  \"Guarda una &drecera...\\tCtrl+Maj+5\\0\"\\\n  \"S'est\\303\\240 cercant %d de %d...\\0\"\\\n  \"Selecciona-ho &tot\\0\"\\\n  \"Seleccciona-ho &tot\\tCtrl+A\\0\"\\\n  \"Seleccioneu contigut amb la combinaci\\303\\263 Ctrl+bot\\303\\263 secundari del ratol\\303\\255\\0\"\\\n  \"Selecci\\303\\263:\\0\"\\\n  \"Envia per correu-&e...\\0\"\\\n  \"Cerca cap arrere\\0\"\\\n  \"Mostra els &marcadors\\0\"\\\n  \"Mostra les &p\\303\\240gines de forma cont\\303\\255nua\\0\"\\\n  \"Mostra la &barra d'eines\\0\"\\\n  \"Mostra els preferits\\0\"\\\n  \"Mostra els m\\303\\251s llegits\\0\"\\\n  \"Mostra la &barra lateral de marcadors quan estiga disponible\\0\"\\\n  \"P\\303\\240gina \\303\\272nica\\0\"\\\n  \"Aix\\303\\262 no hauria d'haver passat!\\n\\nFeu clic a 'Cancel\\302\\267la', si voleu ajudar-nos a corregir la causa d'este error\\0\"\\\n  \"El fitxer d'origen %s no t\\303\\251 un punt de sincronitzaci\\303\\263 v\\303\\240lid\\0\"\\\n  \"Assumpte:\\0\"\\\n  \"Opcions del SumatraPDF\\0\"\\\n  \"Actualitzaci\\303\\263 del SumatraPDF\\0\"\\\n  \"El SumatraPDF ha fallat\\0\"\\\n  \"El SumatraPDF \\303\\251s el seu lector PDF predeterminat\\0\"\\\n  \"El SumatraPDF ha d'esser ara mateix el vostre lector PDF predeterminat\\0\"\\\n  \"El fitxer de sincronitzaci\\303\\263 no es pot obrir\\0\"\\\n  \"PDF etiquetat\\0\"\\\n  \"Documents de text\\0\"\\\n  \"Aquest document utilitza caracter\\303\\255stiques no suportades (%s) i pot no mostrar-se correctament\\0\"\\\n  \"T\\303\\255tol:\\0\"\\\n  \"Fitxer origen desconegut (%s)\\0\"\\\n  \"Utilitza &pestanyes\\0\"\\\n  \"Visualitza\\0\"\\\n  \"Visiteu el lloc &web\\0\"\\\n  \"Av\\303\\255s\\0\"\\\n  \"Documents XPS\\0\"\\\n  \"Teniu la darrera versi\\303\\263.\\0\"\\\n  \"Teniu la versi\\303\\263 %s\\0\"\\\n  \"\\0\"\\\n  \"Apropa't\\0\"\\\n  \"Allunya't\\0\"\\\n  \"Factor d'escala\\0\"\\\n  \"[S'han detectat canvis; s'est\\303\\240 actualitzant] %s\\0\"\\\n  \"s'est\\303\\240 copiant text\\0\"\\\n  \"s'est\\303\\240 imprimint el document\\0\";\n\nconst char * gTranslations_cn = \n  \"\\345\\205\\263\\344\\272\\216(&A)...\\0\"\\\n  \"\\345\\256\\236\\351\\231\\205\\345\\244\\247\\345\\260\\217(&A)\\tCtrl+1\\0\"\\\n  \"\\351\\253\\230\\347\\272\\247\\351\\200\\211\\351\\241\\271(&A)...\\0\"\\\n  \"\\346\\211\\200\\346\\234\\211\\345\\267\\262\\351\\200\\211\\345\\256\\232\\351\\241\\265\\351\\235\\242(&A)\\0\"\\\n  \"\\344\\270\\212\\344\\270\\200\\351\\241\\265(&B)\\tAlt+\\345\\267\\246\\347\\256\\255\\345\\244\\264\\0\"\\\n  \"\\344\\271\\246\\347\\261\\215\\350\\247\\206\\345\\233\\276(&B)\\tCtrl+8\\0\"\\\n  \"\\345\\205\\263\\351\\227\\255(&C)\\tCtrl+W\\0\"\\\n  \"\\345\\244\\215\\345\\210\\266\\351\\200\\211\\345\\256\\232\\350\\214\\203\\345\\233\\264(&C)\\0\"\\\n  \"\\345\\244\\215\\345\\210\\266\\351\\200\\211\\345\\256\\232\\350\\214\\203\\345\\233\\264(&C)\\tCtrl+C\\0\"\\\n  \"\\344\\270\\215\\350\\246\\201\\345\\206\\215\\351\\227\\256\\346\\210\\221(&D)\\0\"\\\n  \"\\344\\273\\205\\345\\201\\266\\346\\225\\260\\351\\241\\265(&E)\\0\"\\\n  \"\\345\\217\\214\\351\\241\\265\\346\\250\\241\\345\\274\\217(&F)\\tCtrl+7\\0\"\\\n  \"\\346\\226\\207\\344\\273\\266(&F)\\0\"\\\n  \"\\346\\237\\245\\346\\211\\276(&F):\\0\"\\\n  \"\\347\\254\\254\\344\\270\\200\\351\\241\\265(&F)\\tHome\\0\"\\\n  \"\\347\\274\\251\\346\\224\\276\\351\\241\\265\\351\\235\\242\\344\\273\\245\\345\\214\\271\\351\\205\\215\\345\\217\\257\\346\\211\\223\\345\\215\\260\\345\\214\\272\\345\\237\\237(&F)\\0\"\\\n  \"\\345\\211\\215\\345\\276\\200(&G)\\0\"\\\n  \"\\345\\211\\215\\345\\276\\200\\351\\241\\265(&G):\\0\"\\\n  \"\\345\\270\\256\\345\\212\\251(&H)\\0\"\\\n  \"\\346\\234\\200\\345\\220\\216\\344\\270\\200\\351\\241\\265(&L)\\tEnd\\0\"\\\n  \"\\346\\224\\276\\345\\244\\247\\347\\216\\207(&M):\\0\"\\\n  \"\\346\\211\\213\\345\\206\\214(&M)\\0\"\\\n  \"\\345\\214\\271\\351\\205\\215\\345\\244\\247\\345\\260\\217\\345\\206\\231(&M)\\0\"\\\n  \"\\344\\270\\213\\344\\270\\200\\351\\241\\265(&N)\\t\\345\\217\\263\\347\\256\\255\\345\\244\\264\\0\"\\\n  \"\\345\\220\\246(&N)\\0\"\\\n  \"\\344\\270\\215\\357\\274\\214\\350\\260\\242\\350\\260\\242(&N)\\0\"\\\n  \"\\344\\273\\205\\345\\245\\207\\346\\225\\260\\351\\241\\265(&O)\\0\"\\\n  \"\\346\\211\\223\\345\\274\\200\\346\\226\\207\\344\\273\\266(&O)\\0\"\\\n  \"\\346\\211\\223\\345\\274\\200(&O)...\\tCtrl+O\\0\"\\\n  \"\\351\\200\\211\\351\\241\\271(&O)...\\0\"\\\n  \"\\345\\257\\206\\347\\240\\201(&P)\\0\"\\\n  \"\\351\\222\\211\\351\\200\\211(&P)\\0\"\\\n  \"\\344\\270\\212\\344\\270\\200\\351\\241\\265(&P)\\t\\345\\267\\246\\347\\256\\255\\345\\244\\264\\0\"\\\n  \"\\346\\211\\223\\345\\215\\260(&P)...\\0\"\\\n  \"\\346\\211\\223\\345\\215\\260(&P)...\\tCtrl+P\\0\"\\\n  \"\\346\\211\\223\\345\\215\\260(&P)... (\\345\\267\\262\\344\\270\\255\\346\\226\\255)\\0\"\\\n  \"\\350\\256\\260\\344\\275\\217\\346\\234\\254\\346\\226\\207\\346\\241\\243\\347\\232\\204\\345\\257\\206\\347\\240\\201(&R)\\0\"\\\n  \"\\344\\270\\272\\346\\257\\217\\344\\270\\200\\344\\270\\252\\346\\226\\207\\346\\241\\243\\350\\256\\260\\344\\275\\217\\350\\277\\231\\344\\272\\233\\350\\256\\276\\347\\275\\256(&R)\\0\"\\\n  \"\\345\\210\\240\\351\\231\\244\\346\\226\\207\\344\\273\\266(&R)\\0\"\\\n  \"\\345\\217\\246\\345\\255\\230\\344\\270\\272(&A)...\\0\"\\\n  \"\\345\\217\\246\\345\\255\\230\\344\\270\\272(&A)...\\tCtrl+A\\0\"\\\n  \"\\350\\256\\276\\347\\275\\256(&S)\\0\"\\\n  \"\\347\\274\\251\\345\\260\\217\\351\\241\\265\\351\\235\\242\\345\\210\\260\\345\\217\\257\\346\\211\\223\\345\\215\\260\\345\\214\\272\\345\\237\\237 (\\345\\246\\202\\346\\236\\234\\351\\234\\200\\350\\246\\201) (&S)\\0\"\\\n  \"\\345\\215\\225\\351\\241\\265\\346\\250\\241\\345\\274\\217(&S)\\tCtrl+6\\0\"\\\n  \"\\350\\267\\263\\350\\277\\207\\346\\255\\244\\347\\211\\210\\346\\234\\254(&S)\\0\"\\\n  \"\\344\\275\\277\\347\\224\\250\\345\\216\\237\\345\\247\\213\\351\\241\\265\\351\\235\\242\\345\\244\\247\\345\\260\\217(&U)\\0\"\\\n  \"\\350\\247\\206\\345\\233\\276(&V)\\0\"\\\n  \"\\347\\252\\227\\345\\217\\243(&W)\\0\"\\\n  \"\\346\\230\\257(&Y)\\0\"\\\n  \"\\347\\274\\251\\346\\224\\276(&Z)\\0\"\\\n  \"(%d \\351\\241\\265\\344\\270\\255\\347\\232\\204)\\0\"\\\n  \"(\\347\\254\\254 %s \\351\\241\\265)\\0\"\\\n  \"\\345\\205\\263\\344\\272\\216 SumatraPDF\\0\"\\\n  \"\\346\\267\\273\\345\\212\\240\\346\\224\\266\\350\\227\\217\\345\\244\\271(&A)\\0\"\\\n  \"\\346\\267\\273\\345\\212\\240\\347\\254\\254 %s \\351\\241\\265\\345\\210\\260\\346\\224\\266\\350\\227\\217\\345\\244\\271\\0\"\\\n  \"\\344\\273\\245 (\\345\\217\\257\\351\\200\\211) \\345\\220\\215\\347\\247\\260\\346\\267\\273\\345\\212\\240\\347\\254\\254 %s \\351\\241\\265\\345\\210\\260\\346\\224\\266\\350\\227\\217\\345\\244\\271:\\0\"\\\n  \"\\346\\267\\273\\345\\212\\240\\345\\210\\260\\346\\224\\266\\350\\227\\217\\345\\244\\271\\0\"\\\n  \"\\351\\253\\230\\347\\272\\247\\0\"\\\n  \"\\346\\211\\200\\346\\234\\211\\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\346\\211\\200\\346\\234\\211\\346\\224\\257\\346\\214\\201\\347\\232\\204\\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\345\\272\\224\\347\\224\\250\\347\\250\\213\\345\\272\\217:\\0\"\\\n  \"\\350\\256\\276\\347\\275\\256 PDF \\346\\226\\207\\344\\273\\266\\345\\205\\263\\350\\201\\224\\345\\220\\227?\\0\"\\\n  \"\\351\\231\\204\\344\\273\\266: %s\\0\"\\\n  \"\\344\\275\\234\\350\\200\\205:\\0\"\\\n  \"\\350\\207\\252\\345\\212\\250\\0\"\\\n  \"\\350\\207\\252\\345\\212\\250\\346\\243\\200\\346\\237\\245\\346\\233\\264\\346\\226\\260(&U)\\0\"\\\n  \"\\344\\271\\246\\347\\261\\215\\350\\247\\206\\345\\233\\276\\0\"\\\n  \"\\344\\271\\246\\347\\255\\276(&M)...\\tF12\\0\"\\\n  \"\\344\\271\\246\\347\\255\\276\\345\\277\\253\\346\\215\\267\\346\\226\\271\\345\\274\\217\\0\"\\\n  \"\\344\\271\\246\\347\\255\\276\\345\\277\\253\\346\\215\\267\\346\\226\\271\\345\\274\\217\\346\\214\\207\\345\\220\\221\\347\\254\\254 %s \\351\\241\\265 (\\346\\226\\207\\344\\273\\266 %s)\\0\"\\\n  \"\\344\\271\\246\\347\\255\\276\\0\"\\\n  \"\\345\\255\\227\\350\\212\\202\\0\"\\\n  \"CHM \\346\\226\\207\\346\\241\\243\\0\"\\\n  \"\\346\\227\\240\\346\\263\\225\\350\\277\\236\\346\\216\\245\\345\\210\\260\\344\\272\\222\\350\\201\\224\\347\\275\\221 (\\351\\224\\231\\350\\257\\257\\357\\274\\232%#x)\\343\\200\\202\\0\"\\\n  \"\\345\\217\\226\\346\\266\\210(&C)\\0\"\\\n  \"\\346\\227\\240\\346\\263\\225\\346\\211\\223\\345\\215\\260\\346\\255\\244\\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\346\\227\\240\\346\\263\\225\\350\\277\\233\\350\\241\\214\\351\\200\\206\\345\\220\\221\\346\\220\\234\\347\\264\\242\\343\\200\\202\\350\\257\\267\\346\\243\\200\\346\\237\\245\\350\\256\\276\\347\\275\\256\\346\\225\\260\\345\\200\\274\\351\\207\\214\\347\\232\\204\\345\\221\\275\\344\\273\\244\\346\\240\\217\\343\\200\\202\\0\"\\\n  \"\\346\\233\\264\\346\\224\\271\\350\\257\\255\\350\\250\\200 (Language)\\0\"\\\n  \"\\346\\243\\200\\346\\237\\245\\346\\230\\257\\345\\220\\246\\346\\234\\211\\346\\226\\260\\347\\211\\210\\346\\234\\254(&U)\\0\"\\\n  \"\\346\\274\\253\\347\\224\\273\\344\\271\\246\\0\"\\\n  \"\\345\\205\\274\\345\\256\\271\\346\\200\\247\\0\"\\\n  \"\\350\\277\\236\\347\\273\\255\\351\\241\\265\\351\\235\\242\\0\"\\\n  \"\\350\\277\\236\\347\\273\\255\\344\\271\\246\\347\\261\\215\\350\\247\\206\\345\\233\\276\\0\"\\\n  \"\\350\\277\\236\\347\\273\\255\\345\\257\\271\\351\\241\\265\\346\\250\\241\\345\\274\\217\\0\"\\\n  \"\\346\\217\\220\\344\\276\\233\\347\\277\\273\\350\\257\\221\\0\"\\\n  \"\\345\\244\\215\\345\\210\\266\\345\\233\\276\\347\\211\\207(&I)\\0\"\\\n  \"\\345\\244\\215\\345\\210\\266\\351\\223\\276\\346\\216\\245\\345\\234\\260\\345\\235\\200(&L)\\0\"\\\n  \"\\345\\244\\215\\345\\210\\266\\346\\263\\250\\351\\207\\212(&M)\\0\"\\\n  \"\\345\\244\\215\\345\\210\\266\\346\\226\\207\\346\\234\\254\\345\\244\\261\\350\\264\\245 (\\345\\217\\252\\350\\203\\275\\345\\244\\215\\345\\210\\266\\344\\270\\272\\345\\233\\276\\347\\211\\207)\\0\"\\\n  \"\\347\\211\\210\\346\\235\\203:\\0\"\\\n  \"\\346\\227\\240\\346\\263\\225\\350\\216\\267\\345\\217\\226\\346\\211\\223\\345\\215\\260\\346\\234\\272\\345\\261\\236\\346\\200\\247\\0\"\\\n  \"\\344\\270\\215\\350\\203\\275\\345\\210\\235\\345\\247\\213\\345\\214\\226\\346\\211\\223\\345\\215\\260\\346\\234\\272\\0\"\\\n  \"\\346\\227\\240\\346\\263\\225\\346\\270\\262\\346\\237\\223\\350\\257\\245\\351\\241\\265\\351\\235\\242\\0\"\\\n  \"\\345\\210\\233\\345\\273\\272\\346\\227\\266\\351\\227\\264:\\0\"\\\n  \"\\345\\275\\223\\345\\211\\215\\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\345\\205\\211\\346\\240\\207\\344\\275\\215\\347\\275\\256:\\0\"\\\n  \"\\350\\207\\252\\345\\256\\232\\344\\271\\211\\347\\274\\251\\346\\224\\276(&Z)...\\tCtrl+Y\\0\"\\\n  \"\\351\\273\\230\\350\\256\\244\\345\\270\\203\\345\\261\\200(&L):\\0\"\\\n  \"\\351\\273\\230\\350\\256\\244\\347\\274\\251\\346\\224\\276(&Z):\\0\"\\\n  \"\\344\\276\\277\\346\\220\\272\\346\\250\\241\\345\\274\\217\\344\\270\\215\\350\\203\\275\\346\\224\\271\\345\\217\\230\\351\\273\\230\\350\\256\\244 PDF \\351\\230\\205\\350\\257\\273\\345\\231\\250\\0\"\\\n  \"\\346\\235\\203\\351\\231\\220\\344\\270\\215\\350\\266\\263:\\0\"\\\n  \"DjVu \\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\346\\226\\207\\346\\241\\243\\345\\261\\236\\346\\200\\247\\0\"\\\n  \"\\344\\270\\213\\350\\275\\275\\0\"\\\n  \"\\351\\200\\200\\345\\207\\272(&X)\\tCtrl+Q\\0\"\\\n  \"EPUB \\346\\226\\207\\346\\241\\243\\0\"\\\n  \"\\351\\224\\256\\345\\205\\245\\345\\257\\206\\347\\240\\201\\0\"\\\n  \"\\351\\224\\256\\345\\205\\245 %s \\347\\232\\204\\345\\257\\206\\347\\240\\201\\0\"\\\n  \"\\350\\257\\267\\351\\224\\256\\345\\205\\245\\345\\217\\214\\345\\207\\273 PDF \\346\\226\\207\\344\\273\\266\\346\\227\\266\\357\\274\\214\\345\\272\\224\\350\\277\\220\\350\\241\\214\\347\\232\\204\\345\\221\\275\\344\\273\\244(&E):\\0\"\\\n  \"\\350\\275\\275\\345\\205\\245\\351\\224\\231\\350\\257\\257 %s\\0\"\\\n  \"\\346\\224\\266\\350\\227\\217(&A)\\0\"\\\n  \"\\344\\270\\213\\344\\270\\200\\351\\241\\265\\351\\235\\242(&O)\\tAlt+\\345\\217\\263\\347\\256\\255\\345\\244\\264\\0\"\\\n  \"\\345\\205\\250\\345\\261\\217\\346\\230\\276\\347\\244\\272(&U)\\tCtrl+Shift+L\\0\"\\\n  \"\\345\\217\\214\\351\\241\\265\\346\\250\\241\\345\\274\\217\\0\"\\\n  \"\\346\\227\\240\\346\\263\\225\\351\\207\\215\\345\\221\\275\\345\\220\\215!\\0\"\\\n  \"\\344\\277\\235\\345\\255\\230\\346\\226\\207\\344\\273\\266\\345\\244\\261\\350\\264\\245\\0\"\\\n  \"\\345\\277\\253\\351\\200\\237\\347\\275\\221\\351\\241\\265\\346\\237\\245\\347\\234\\213\\0\"\\\n  \"\\346\\224\\266\\350\\227\\217\\345\\244\\271\\0\"\\\n  \"\\345\\260\\217\\350\\257\\264\\346\\226\\207\\346\\241\\243\\0\"\\\n  \"\\346\\227\\240\\346\\263\\225\\346\\211\\276\\345\\210\\260\\346\\226\\207\\344\\273\\266 %s\\0\"\\\n  \"\\346\\226\\207\\344\\273\\266\\345\\244\\247\\345\\260\\217:\\0\"\\\n  \"\\346\\226\\207\\344\\273\\266:\\0\"\\\n  \"\\346\\237\\245\\346\\211\\276(&D)...\\tCtrl+F\\0\"\\\n  \"\\346\\237\\245\\346\\211\\276\\0\"\\\n  \"\\345\\220\\221\\344\\270\\213\\346\\237\\245\\346\\211\\276\\0\"\\\n  \"\\345\\220\\221\\344\\270\\212\\346\\237\\245\\346\\211\\276\\0\"\\\n  \"\\346\\237\\245\\346\\211\\276:\\0\"\\\n  \"\\351\\200\\202\\345\\220\\210\\345\\206\\205\\345\\256\\271(&C)\\tCtrl+3\\0\"\\\n  \"\\351\\200\\202\\345\\220\\210\\351\\241\\265\\351\\235\\242(&P)\\tCtrl+0\\0\"\\\n  \"\\351\\200\\202\\345\\220\\210\\345\\256\\275\\345\\272\\246(&W)\\tCtrl+2\\0\"\\\n  \"\\351\\200\\202\\345\\220\\210\\345\\206\\205\\345\\256\\271\\0\"\\\n  \"\\351\\200\\202\\345\\220\\210\\351\\241\\265\\351\\235\\242\\0\"\\\n  \"\\351\\200\\202\\345\\220\\210\\345\\256\\275\\345\\272\\246\\0\"\\\n  \"\\350\\207\\252\\351\\200\\202\\345\\272\\224\\345\\256\\275\\345\\272\\246\\350\\277\\236\\347\\273\\255\\346\\250\\241\\345\\274\\217\\0\"\\\n  \"\\350\\207\\252\\351\\200\\202\\345\\272\\224\\345\\215\\225\\351\\241\\265\\346\\250\\241\\345\\274\\217\\0\"\\\n  \"\\345\\255\\227\\344\\275\\223(&F):\\0\"\\\n  \"\\346\\255\\243\\345\\234\\250\\344\\270\\272\\344\\271\\246\\347\\261\\215\\346\\216\\222\\347\\211\\210\\346\\240\\274\\345\\274\\217... %d \\351\\241\\265\\0\"\\\n  \"\\344\\272\\216\\347\\254\\254 %s \\351\\241\\265\\346\\211\\276\\345\\210\\260\\347\\233\\256\\346\\240\\207\\0\"\\\n  \"\\344\\272\\216\\347\\254\\254 %s \\351\\241\\265\\346\\211\\276\\345\\210\\260\\347\\233\\256\\346\\240\\207 (\\345\\267\\262\\344\\273\\216\\345\\244\\264\\346\\237\\245\\346\\211\\276)\\0\"\\\n  \"\\347\\273\\217\\345\\270\\270\\346\\211\\223\\345\\274\\200\\347\\232\\204\\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\0\"\\\n  \"\\345\\211\\215\\345\\276\\200\\351\\241\\265\\0\"\\\n  \"\\351\\232\\220\\350\\227\\217\\347\\273\\217\\345\\270\\270\\346\\211\\223\\345\\274\\200\\347\\232\\204\\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\346\\217\\220\\347\\244\\272: \\346\\214\\211 F3 \\351\\207\\215\\346\\226\\260\\346\\237\\245\\346\\211\\276\\343\\200\\202\\0\"\\\n  \"\\345\\233\\276\\347\\211\\207\\346\\226\\207\\344\\273\\266 (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"\\346\\212\\212 SumatraPDF \\344\\275\\234\\344\\270\\272\\351\\273\\230\\350\\256\\244\\347\\232\\204 PDF \\351\\230\\205\\350\\257\\273\\345\\231\\250?\\0\"\\\n  \"\\345\\260\\206 SumatraPDF \\350\\256\\276\\347\\275\\256\\344\\270\\272\\351\\273\\230\\350\\256\\244\\347\\232\\204 PDF \\351\\230\\205\\350\\257\\273\\345\\231\\250\\0\"\\\n  \"\\346\\274\\253\\347\\224\\273\\346\\250\\241\\345\\274\\217(&G)\\0\"\\\n  \"\\345\\244\\247\\345\\260\\217\\345\\206\\231\\345\\214\\271\\351\\205\\215\\0\"\\\n  \"Mobi \\346\\226\\207\\346\\241\\243\\0\"\\\n  \"\\344\\277\\256\\346\\224\\271\\346\\227\\266\\351\\227\\264:\\0\"\\\n  \"\\346\\234\\200\\346\\226\\260\\347\\211\\210\\346\\234\\254 %s\\343\\200\\202 \\346\\230\\257\\345\\220\\246\\344\\270\\213\\350\\275\\275\\346\\226\\260\\347\\211\\210\\346\\234\\254?\\0\"\\\n  \"\\344\\270\\213\\344\\270\\200\\351\\241\\265\\0\"\\\n  \"\\346\\262\\241\\346\\234\\211\\346\\211\\276\\345\\210\\260\\345\\214\\271\\351\\205\\215\\351\\241\\271\\0\"\\\n  \"\\345\\234\\250\\347\\254\\254 %u \\350\\241\\214\\351\\231\\204\\350\\277\\221 (\\346\\226\\207\\344\\273\\266 %s) \\346\\234\\252\\346\\211\\276\\345\\210\\260\\347\\233\\256\\346\\240\\207\\0\"\\\n  \"\\346\\234\\252\\345\\217\\221\\347\\216\\260\\345\\220\\214\\346\\255\\245\\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\346\\255\\244\\344\\275\\215\\347\\275\\256\\346\\262\\241\\346\\234\\211\\345\\220\\214\\346\\255\\245\\344\\277\\241\\346\\201\\257\\0\"\\\n  \"\\351\\241\\265\\346\\225\\260:\\0\"\\\n  \"\\347\\241\\256\\345\\256\\232(&O)\\0\"\\\n  \"\\346\\211\\223\\345\\274\\200\\0\"\\\n  \"\\345\\234\\250 PDF-XChange \\344\\270\\255\\346\\211\\223\\345\\274\\200(&I)\\0\"\\\n  \"\\346\\211\\223\\345\\274\\200\\344\\270\\200\\344\\270\\252\\346\\226\\207\\344\\273\\266...\\0\"\\\n  \"\\347\\224\\250 %s \\346\\211\\223\\345\\274\\200\\0\"\\\n  \"\\345\\234\\250 &Adobe Reader \\344\\270\\255\\346\\211\\223\\345\\274\\200\\0\"\\\n  \"\\345\\234\\250 &Foxit Reader \\344\\270\\255\\346\\211\\223\\345\\274\\200\\0\"\\\n  \"\\345\\234\\250 &Microsoft HTML Help \\344\\270\\255\\346\\211\\223\\345\\274\\200(&M)\\0\"\\\n  \"\\345\\234\\250 &Microsoft XPS-Viewer \\344\\270\\255\\346\\211\\223\\345\\274\\200\\0\"\\\n  \"\\345\\261\\236\\346\\200\\247(&R)\\0\"\\\n  \"\\345\\261\\236\\346\\200\\247(&R)...\\tCtrl+D\\0\"\\\n  \"PDF \\346\\226\\207\\346\\241\\243\\0\"\\\n  \"PDF \\344\\274\\230\\345\\214\\226:\\0\"\\\n  \"PDF \\345\\210\\266\\344\\275\\234\\347\\250\\213\\345\\272\\217:\\0\"\\\n  \"PDF \\347\\211\\210\\346\\234\\254:\\0\"\\\n  \"PDF \\346\\226\\207\\346\\241\\243\\0\"\\\n  \"\\345\\211\\215\\345\\276\\200\\351\\241\\265(&G)...\\tCtrl+G\\0\"\\\n  \"\\347\\254\\254 %s \\351\\241\\265\\0\"\\\n  \"\\351\\241\\265\\351\\235\\242\\345\\244\\247\\345\\260\\217:\\0\"\\\n  \"\\346\\211\\276\\344\\270\\215\\345\\210\\260\\351\\241\\265\\347\\240\\201 %u\\0\"\\\n  \"\\351\\241\\265\\351\\235\\242\\347\\274\\251\\346\\224\\276\\346\\257\\224\\344\\276\\213\\0\"\\\n  \"\\351\\241\\265\\347\\240\\201:\\0\"\\\n  \"PalmDoc \\346\\226\\207\\346\\241\\243\\0\"\\\n  \"\\350\\257\\267\\347\\250\\215\\347\\255\\211\\342\\224\\200\\346\\255\\243\\345\\234\\250\\346\\270\\262\\346\\237\\223...\\0\"\\\n  \"Postscript \\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\345\\271\\273\\347\\201\\257\\347\\211\\207(&E)\\tCtrl+L\\0\"\\\n  \"\\344\\270\\212\\344\\270\\200\\351\\241\\265\\0\"\\\n  \"\\346\\211\\223\\345\\215\\260\\0\"\\\n  \"\\346\\211\\223\\345\\215\\260\\350\\214\\203\\345\\233\\264\\0\"\\\n  \"\\350\\257\\245\\346\\211\\223\\345\\215\\260\\346\\234\\272\\344\\270\\215\\345\\255\\230\\345\\234\\250\\0\"\\\n  \"\\346\\255\\243\\345\\234\\250\\346\\211\\223\\345\\215\\260\\0\"\\\n  \"\\346\\211\\223\\345\\215\\260\\344\\273\\215\\345\\234\\250\\346\\214\\201\\347\\273\\255\\345\\275\\223\\344\\270\\255\\343\\200\\202\\350\\246\\201\\344\\270\\255\\346\\255\\242\\345\\271\\266\\346\\224\\276\\345\\274\\203\\345\\220\\227\\357\\274\\237\\0\"\\\n  \"\\346\\211\\223\\345\\215\\260\\344\\273\\215\\345\\234\\250\\346\\214\\201\\347\\273\\255\\345\\275\\223\\344\\270\\255\\343\\200\\202\\350\\246\\201\\344\\270\\255\\346\\255\\242\\345\\271\\266\\351\\207\\215\\346\\226\\260\\350\\256\\276\\347\\275\\256\\345\\220\\227\\357\\274\\237\\0\"\\\n  \"\\346\\255\\243\\345\\234\\250\\346\\211\\223\\345\\215\\260\\347\\254\\254 %d \\351\\241\\265/\\345\\205\\261 %d \\351\\241\\265\\0\"\\\n  \"\\346\\211\\223\\345\\215\\260\\351\\227\\256\\351\\242\\230\\343\\200\\202\\0\"\\\n  \"\\351\\207\\215\\345\\221\\275\\345\\220\\215(&N)...\\tF2\\0\"\\\n  \"\\350\\256\\260\\344\\275\\217\\345\\267\\262\\346\\211\\223\\345\\274\\200\\347\\232\\204\\346\\226\\207\\344\\273\\266(&O)\\0\"\\\n  \"\\350\\207\\252\\346\\224\\266\\350\\227\\217\\345\\210\\240\\351\\231\\244\\0\"\\\n  \"\\344\\273\\216\\346\\224\\266\\350\\227\\217\\344\\270\\255\\345\\210\\240\\351\\231\\244\\347\\254\\254 %s \\351\\241\\265\\0\"\\\n  \"\\351\\207\\215\\345\\221\\275\\345\\220\\215\\345\\210\\260\\0\"\\\n  \"\\345\\220\\221\\345\\267\\246\\346\\227\\213\\350\\275\\254(&L)\\tCtrl+Shift+-\\0\"\\\n  \"\\345\\220\\221\\345\\217\\263\\346\\227\\213\\350\\275\\254(&R)\\tCtrl+Shift++\\0\"\\\n  \"\\345\\217\\246\\345\\255\\230\\344\\270\\272\\0\"\\\n  \"\\344\\277\\235\\345\\255\\230\\345\\277\\253\\346\\215\\267\\346\\226\\271\\345\\274\\217(&H)...\\tCtrl+Shift+S\\0\"\\\n  \"\\346\\255\\243\\345\\234\\250\\346\\220\\234\\347\\264\\242\\347\\254\\254 %d \\351\\241\\265/\\345\\205\\261 %d \\351\\241\\265\\0\"\\\n  \"\\345\\205\\250\\351\\200\\211(&A)\\0\"\\\n  \"\\345\\205\\250\\351\\200\\211(&A)\\tCtrl+A\\0\"\\\n  \"\\346\\214\\211 Ctrl+\\351\\274\\240\\346\\240\\207\\345\\267\\246\\351\\224\\256 \\351\\200\\211\\345\\256\\232\\345\\206\\205\\345\\256\\271\\0\"\\\n  \"\\351\\200\\211\\346\\213\\251:\\0\"\\\n  \"\\351\\200\\232\\350\\277\\207\\347\\224\\265\\345\\255\\220\\351\\202\\256\\344\\273\\266\\345\\217\\221\\351\\200\\201(&E)...\\0\"\\\n  \"\\350\\256\\276\\347\\275\\256\\345\\217\\215\\345\\220\\221\\346\\220\\234\\347\\264\\242\\345\\221\\275\\344\\273\\244\\350\\241\\214\\0\"\\\n  \"\\346\\230\\276\\347\\244\\272\\344\\271\\246\\347\\255\\276(&B)\\0\"\\\n  \"\\350\\277\\236\\347\\273\\255\\346\\230\\276\\347\\244\\272\\351\\241\\265\\351\\235\\242(&P)\\0\"\\\n  \"\\346\\230\\276\\347\\244\\272\\345\\267\\245\\345\\205\\267\\346\\240\\217(&T)\\0\"\\\n  \"\\346\\230\\276\\347\\244\\272\\346\\224\\266\\350\\227\\217\\0\"\\\n  \"\\346\\230\\276\\347\\244\\272\\346\\234\\200\\345\\270\\270\\351\\230\\205\\350\\257\\273\\0\"\\\n  \"\\345\\217\\257\\347\\224\\250\\346\\227\\266\\346\\230\\276\\347\\244\\272\\344\\271\\246\\347\\255\\276\\350\\276\\271\\346\\240\\217(&B)\\0\"\\\n  \"\\345\\215\\225\\344\\270\\252\\351\\241\\265\\351\\235\\242\\0\"\\\n  \"\\346\\212\\261\\346\\255\\211\\357\\274\\214\\346\\234\\254\\344\\270\\215\\345\\272\\224\\350\\257\\245\\345\\217\\221\\347\\224\\237\\347\\232\\204\\357\\274\\201\\n\\n\\345\\246\\202\\346\\236\\234\\344\\275\\240\\345\\270\\214\\346\\234\\233\\345\\270\\256\\345\\212\\251\\346\\210\\221\\344\\273\\254\\344\\277\\256\\345\\244\\215\\350\\277\\231\\344\\270\\252\\345\\264\\251\\346\\272\\203\\351\\227\\256\\351\\242\\230\\357\\274\\214\\350\\257\\267\\347\\202\\271\\345\\207\\273'\\345\\217\\226\\346\\266\\210'\\343\\200\\202\\0\"\\\n  \"\\346\\272\\220\\346\\226\\207\\344\\273\\266 %s \\346\\262\\241\\346\\234\\211\\345\\220\\214\\346\\255\\245\\347\\202\\271\\0\"\\\n  \"\\344\\270\\273\\351\\242\\230:\\0\"\\\n  \"SumatraPDF \\351\\200\\211\\351\\241\\271\\0\"\\\n  \"\\345\\215\\207\\347\\272\\247 SumatraPDF\\0\"\\\n  \"SumatraPDF \\345\\217\\221\\347\\224\\237\\351\\224\\231\\350\\257\\257\\0\"\\\n  \"SumatraPDF \\346\\230\\257\\351\\273\\230\\350\\256\\244 PDF \\351\\230\\205\\350\\257\\273\\345\\231\\250\\0\"\\\n  \"\\347\\216\\260\\345\\234\\250 SumatraPDF \\345\\272\\224\\350\\257\\245\\346\\230\\257\\344\\275\\240\\347\\232\\204\\351\\273\\230\\350\\256\\244 PDF \\351\\230\\205\\350\\257\\273\\345\\231\\250\\344\\272\\206\\0\"\\\n  \"\\346\\227\\240\\346\\263\\225\\346\\211\\223\\345\\274\\200\\345\\220\\214\\346\\255\\245\\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\345\\267\\262\\346\\240\\207\\350\\256\\260PDF\\0\"\\\n  \"\\346\\226\\207\\346\\234\\254\\346\\226\\207\\346\\241\\243\\0\"\\\n  \"\\350\\257\\245\\346\\226\\207\\346\\241\\243\\344\\275\\277\\347\\224\\250\\344\\272\\206\\344\\270\\215\\346\\224\\257\\346\\214\\201\\347\\232\\204\\347\\211\\271\\346\\200\\247 (%s)\\357\\274\\214\\345\\217\\257\\350\\203\\275\\346\\227\\240\\346\\263\\225\\346\\255\\243\\347\\241\\256\\346\\270\\262\\346\\237\\223\\343\\200\\202\\0\"\\\n  \"\\346\\240\\207\\351\\242\\230:\\0\"\\\n  \"\\346\\234\\252\\347\\237\\245\\347\\232\\204\\346\\272\\220\\346\\226\\207\\344\\273\\266 (%s)\\0\"\\\n  \"\\344\\275\\277\\347\\224\\250\\351\\241\\265\\347\\255\\276(&T)\\0\"\\\n  \"\\350\\247\\206\\345\\233\\276\\0\"\\\n  \"\\350\\256\\277\\351\\227\\256\\347\\275\\221\\347\\253\\231(&W)\\0\"\\\n  \"\\350\\255\\246\\345\\221\\212\\0\"\\\n  \"XPS \\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\346\\202\\250\\347\\232\\204\\347\\211\\210\\346\\234\\254\\344\\270\\272\\346\\234\\200\\346\\226\\260\\347\\211\\210\\343\\200\\202\\0\"\\\n  \"\\347\\233\\256\\345\\211\\215\\347\\211\\210\\346\\234\\254\\344\\270\\272 %s\\0\"\\\n  \"\\347\\274\\251\\346\\224\\276\\0\"\\\n  \"\\346\\224\\276\\345\\244\\247\\0\"\\\n  \"\\347\\274\\251\\345\\260\\217\\0\"\\\n  \"\\347\\274\\251\\346\\224\\276\\346\\257\\224\\344\\276\\213\\0\"\\\n  \"[\\345\\267\\262\\346\\243\\200\\346\\265\\213\\346\\233\\264\\346\\224\\271\\357\\274\\214\\346\\255\\243\\345\\234\\250\\346\\233\\264\\346\\226\\260] %s\\0\"\\\n  \"\\346\\255\\243\\345\\234\\250\\345\\244\\215\\345\\210\\266\\346\\226\\207\\346\\234\\254\\0\"\\\n  \"\\346\\255\\243\\345\\234\\250\\346\\211\\223\\345\\215\\260\\346\\226\\207\\346\\241\\243\\0\";\n\nconst char * gTranslations_tw = \n  \"\\351\\227\\234\\346\\226\\274(&A)...\\0\"\\\n  \"\\345\\257\\246\\351\\232\\233\\345\\244\\247\\345\\260\\217(&A)\\tCtrl+1\\0\"\\\n  \"\\351\\200\\262\\351\\232\\216\\351\\201\\270\\351\\240\\205(&A)...\\0\"\\\n  \"\\346\\211\\200\\346\\234\\211\\345\\267\\262\\351\\201\\270\\345\\217\\226\\351\\240\\201\\351\\235\\242(&A)\\0\"\\\n  \"\\344\\270\\212\\344\\270\\200\\351\\240\\201(&B)\\tAlt+\\345\\267\\246\\347\\256\\255\\351\\240\\255\\0\"\\\n  \"\\346\\233\\270\\346\\234\\254\\346\\252\\242\\350\\246\\226(&B)\\tCtrl+8\\0\"\\\n  \"\\351\\227\\234\\351\\226\\211(&C)\\tCtrl+W\\0\"\\\n  \"\\350\\244\\207\\350\\243\\275\\351\\201\\270\\345\\217\\226\\347\\257\\204\\345\\234\\215(&C)\\0\"\\\n  \"\\350\\244\\207\\350\\243\\275\\351\\201\\270\\345\\217\\226\\347\\257\\204\\345\\234\\215(&C)\\tCtrl+C\\0\"\\\n  \"\\344\\270\\215\\350\\246\\201\\345\\206\\215\\345\\225\\217\\346\\210\\221(&D)\\0\"\\\n  \"\\347\\245\\207\\346\\234\\211\\345\\201\\266\\346\\225\\270\\351\\240\\201(&E)\\0\"\\\n  \"\\351\\233\\231\\351\\240\\201\\346\\250\\241\\345\\274\\217(&F)\\0\"\\\n  \"\\346\\252\\224\\346\\241\\210(&F)\\0\"\\\n  \"\\345\\260\\213\\346\\211\\276(&F):\\0\"\\\n  \"\\347\\254\\254\\344\\270\\200\\351\\240\\201(&F)\\tHome\\0\"\\\n  \"\\347\\270\\256\\346\\224\\276\\351\\240\\201\\351\\235\\242\\344\\273\\245\\347\\254\\246\\345\\220\\210\\345\\217\\257\\345\\210\\227\\345\\215\\260\\345\\215\\200\\345\\237\\237(&F)\\0\"\\\n  \"\\345\\211\\215\\345\\276\\200(&G)\\0\"\\\n  \"\\345\\211\\215\\345\\276\\200\\351\\240\\201(&G):\\0\"\\\n  \"\\345\\271\\253\\345\\212\\251(&H)\\0\"\\\n  \"\\346\\234\\200\\345\\276\\214\\351\\240\\201(&L)\\tEnd\\0\"\\\n  \"\\345\\200\\215\\347\\216\\207(&M)\\0\"\\\n  \"\\346\\211\\213\\345\\206\\212(&M)\\0\"\\\n  \"\\347\\254\\246\\345\\220\\210\\345\\244\\247\\345\\260\\217\\345\\257\\253(&M)\\0\"\\\n  \"\\344\\270\\213\\344\\270\\200\\351\\240\\201(&N)\\t\\345\\217\\263\\347\\256\\255\\351\\240\\255\\0\"\\\n  \"\\345\\220\\246(&N)\\0\"\\\n  \"\\344\\270\\215\\347\\224\\250\\344\\272\\206\\357\\274\\214\\350\\254\\235\\350\\254\\235(&N)\\0\"\\\n  \"\\345\\203\\205\\346\\234\\211\\345\\245\\207\\346\\225\\270\\351\\240\\201(&O)\\0\"\\\n  \"\\351\\226\\213\\345\\225\\237\\346\\255\\244\\346\\226\\207\\344\\273\\266(&O)\\0\"\\\n  \"\\351\\226\\213\\345\\225\\237(&O)...\\tCtrl+O\\0\"\\\n  \"\\351\\201\\270\\351\\240\\205(&O)...\\0\"\\\n  \"\\345\\257\\206\\347\\242\\274(&P):\\0\"\\\n  \"\\351\\207\\230\\351\\201\\270(&P)\\0\"\\\n  \"\\344\\270\\212\\344\\270\\200\\351\\240\\201(&P)\\t\\345\\267\\246\\347\\256\\255\\351\\240\\255\\0\"\\\n  \"\\345\\210\\227\\345\\215\\260(&P)...\\0\"\\\n  \"\\345\\210\\227\\345\\215\\260(&P)...\\tCtrl+P\\0\"\\\n  \"\\345\\210\\227\\345\\215\\260(&P)... (\\345\\267\\262\\344\\270\\255\\346\\226\\267)\\0\"\\\n  \"\\350\\250\\230\\346\\206\\266\\346\\255\\244\\346\\226\\207\\344\\273\\266\\347\\232\\204\\345\\257\\206\\347\\242\\274(&R)\\0\"\\\n  \"\\350\\250\\230\\346\\206\\266\\346\\257\\217\\345\\200\\213\\346\\226\\207\\344\\273\\266\\347\\232\\204\\350\\250\\255\\345\\256\\232\\345\\200\\274(&R)\\0\"\\\n  \"\\347\\247\\273\\351\\231\\244\\346\\255\\244\\347\\270\\256\\345\\234\\226(&R)\\0\"\\\n  \"\\345\\217\\246\\345\\255\\230\\347\\202\\272(&A)...\\0\"\\\n  \"\\345\\217\\246\\345\\255\\230\\347\\202\\272(&A)...\\tCtrl+A\\0\"\\\n  \"\\350\\250\\255\\345\\256\\232\\345\\200\\274(&S)...\\0\"\\\n  \"\\345\\246\\202\\346\\234\\211\\351\\234\\200\\350\\246\\201\\357\\274\\214\\347\\270\\256\\345\\260\\217\\351\\240\\201\\351\\235\\242\\347\\254\\246\\345\\220\\210\\345\\217\\257\\345\\210\\227\\345\\215\\260\\345\\215\\200\\345\\237\\237(&S)\\0\"\\\n  \"\\345\\226\\256\\351\\240\\201\\346\\250\\241\\345\\274\\217(&S)\\tCtrl+6\\0\"\\\n  \"\\347\\225\\245\\351\\201\\216\\346\\255\\244\\347\\211\\210\\346\\234\\254(&S)\\0\"\\\n  \"\\344\\275\\277\\347\\224\\250\\351\\240\\201\\351\\235\\242\\345\\216\\237\\345\\247\\213\\345\\244\\247\\345\\260\\217(&S)\\0\"\\\n  \"\\346\\252\\242\\350\\246\\226(&V)\\0\"\\\n  \"\\350\\246\\226\\347\\252\\227(&W)\\0\"\\\n  \"\\346\\230\\257(&Y)\\0\"\\\n  \"\\347\\270\\256\\346\\224\\276(&Z)\\0\"\\\n  \"\\357\\274\\210\\345\\205\\261 %d \\351\\240\\201\\357\\274\\211\\0\"\\\n  \"(\\347\\254\\254 %s \\351\\240\\201)\\0\"\\\n  \"\\351\\227\\234\\346\\226\\274 SumatraPDF\\0\"\\\n  \"\\345\\212\\240\\345\\205\\245\\346\\234\\200\\346\\204\\233(&A)\\0\"\\\n  \"\\345\\212\\240\\345\\205\\245\\347\\254\\254 %s \\351\\240\\201\\345\\210\\260\\346\\234\\200\\346\\204\\233\\0\"\\\n  \"\\344\\273\\245 (\\345\\217\\257\\351\\201\\270) \\345\\220\\215\\347\\250\\261\\345\\212\\240\\345\\205\\245\\347\\254\\254 %s \\351\\240\\201\\345\\210\\260\\346\\234\\200\\346\\204\\233:\\0\"\\\n  \"\\345\\212\\240\\345\\205\\245\\345\\210\\260\\346\\234\\200\\346\\204\\233\\0\"\\\n  \"\\351\\200\\262\\351\\232\\216\\0\"\\\n  \"\\346\\211\\200\\346\\234\\211\\346\\252\\224\\346\\241\\210\\0\"\\\n  \"\\346\\211\\200\\346\\234\\211\\346\\224\\257\\346\\217\\264\\347\\232\\204\\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\346\\207\\211\\347\\224\\250\\347\\250\\213\\345\\274\\217:\\0\"\\\n  \"\\350\\250\\255\\345\\256\\232 PDF \\346\\252\\224\\346\\241\\210\\351\\227\\234\\350\\201\\257\\345\\227\\216?\\0\"\\\n  \"\\351\\231\\204\\344\\273\\266: %s\\0\"\\\n  \"\\344\\275\\234\\350\\200\\205:\\0\"\\\n  \"\\350\\207\\252\\345\\213\\225\\0\"\\\n  \"\\350\\207\\252\\345\\213\\225\\346\\252\\242\\346\\237\\245\\346\\233\\264\\346\\226\\260(&U)\\0\"\\\n  \"\\346\\233\\270\\346\\234\\254\\346\\252\\242\\350\\246\\226\\0\"\\\n  \"\\346\\233\\270\\347\\261\\244(&M)...\\tF12\\0\"\\\n  \"\\346\\233\\270\\347\\261\\244\\346\\215\\267\\345\\276\\221\\0\"\\\n  \"\\346\\233\\270\\347\\261\\244\\346\\215\\267\\345\\276\\221\\346\\214\\207\\345\\220\\221\\347\\254\\254 %s \\351\\240\\201 (\\346\\252\\224\\346\\241\\210 %s)\\0\"\\\n  \"\\346\\233\\270\\347\\261\\244\\0\"\\\n  \"\\344\\275\\215\\345\\205\\203\\347\\265\\204\\0\"\\\n  \"CHM \\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\347\\204\\241\\346\\263\\225\\351\\200\\243\\347\\267\\232\\345\\210\\260\\347\\266\\262\\351\\232\\233\\347\\266\\262\\350\\267\\257 (\\351\\214\\257\\350\\252\\244\\357\\274\\232%#x)\\343\\200\\202\\0\"\\\n  \"\\345\\217\\226\\346\\266\\210(&C)\\0\"\\\n  \"\\347\\204\\241\\346\\263\\225\\345\\210\\227\\345\\215\\260\\346\\255\\244\\346\\252\\224\\346\\241\\210\\0\"\\\n  \"\\347\\204\\241\\346\\263\\225\\351\\200\\262\\350\\241\\214\\351\\200\\206\\345\\220\\221\\346\\220\\234\\345\\260\\213\\343\\200\\202\\350\\253\\213\\346\\252\\242\\346\\237\\245\\350\\250\\255\\345\\256\\232\\345\\200\\274\\350\\243\\241\\347\\232\\204\\345\\221\\275\\344\\273\\244\\345\\210\\227\\343\\200\\202\\0\"\\\n  \"\\350\\256\\212\\346\\233\\264\\350\\252\\236\\350\\250\\200 (Language)\\0\"\\\n  \"\\346\\252\\242\\346\\237\\245\\346\\230\\257\\345\\220\\246\\346\\234\\211\\346\\226\\260\\347\\211\\210\\346\\234\\254(&C)\\0\"\\\n  \"\\346\\274\\253\\347\\225\\253\\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\347\\233\\270\\345\\256\\271\\346\\200\\247\\0\"\\\n  \"\\351\\200\\243\\347\\272\\214\\351\\240\\201\\351\\235\\242\\0\"\\\n  \"\\351\\200\\243\\347\\272\\214\\346\\233\\270\\346\\234\\254\\346\\252\\242\\350\\246\\226\\0\"\\\n  \"\\351\\200\\243\\347\\272\\214\\345\\260\\215\\351\\240\\201\\346\\250\\241\\345\\274\\217\\0\"\\\n  \"\\346\\217\\220\\344\\276\\233\\347\\277\\273\\350\\255\\257\\0\"\\\n  \"\\350\\244\\207\\350\\243\\275\\345\\234\\226\\347\\211\\207(&I)\\0\"\\\n  \"\\350\\244\\207\\350\\243\\275\\351\\200\\243\\347\\265\\220\\344\\275\\215\\345\\235\\200(&L)\\0\"\\\n  \"\\350\\244\\207\\350\\243\\275\\350\\250\\273\\350\\247\\243(&M)\\0\"\\\n  \"\\350\\244\\207\\350\\243\\275\\346\\226\\207\\345\\255\\227\\345\\244\\261\\346\\225\\227 (\\345\\217\\252\\350\\203\\275\\350\\244\\207\\350\\243\\275\\347\\202\\272\\345\\234\\226\\347\\211\\207)\\0\"\\\n  \"\\347\\211\\210\\346\\254\\212:\\0\"\\\n  \"\\347\\204\\241\\346\\263\\225\\345\\217\\226\\345\\276\\227\\345\\215\\260\\350\\241\\250\\346\\251\\237\\347\\211\\271\\346\\200\\247\\0\"\\\n  \"\\347\\204\\241\\346\\263\\225\\345\\210\\235\\345\\247\\213\\345\\214\\226\\345\\215\\260\\350\\241\\250\\346\\251\\237\\0\"\\\n  \"\\347\\204\\241\\346\\263\\225\\347\\224\\242\\347\\224\\237\\351\\240\\201\\351\\235\\242\\0\"\\\n  \"\\346\\252\\224\\346\\241\\210\\345\\273\\272\\347\\253\\213\\346\\227\\245\\346\\234\\237:\\0\"\\\n  \"\\347\\225\\266\\345\\211\\215\\347\\232\\204\\346\\252\\224\\346\\241\\210\\0\"\\\n  \"\\346\\270\\270\\346\\250\\231\\344\\275\\215\\347\\275\\256\\0\"\\\n  \"\\350\\207\\252\\350\\250\\202\\347\\270\\256\\346\\224\\276(&Z)...\\tCtrl+Y\\0\"\\\n  \"\\351\\240\\220\\350\\250\\255\\345\\270\\203\\345\\261\\200(&L):\\0\"\\\n  \"\\351\\240\\220\\350\\250\\255\\347\\270\\256\\346\\224\\276(&Z):\\0\"\\\n  \"\\347\\204\\241\\346\\263\\225\\345\\234\\250\\345\\217\\257\\346\\224\\234\\346\\250\\241\\345\\274\\217\\350\\256\\212\\346\\233\\264\\351\\240\\220\\350\\250\\255 PDF \\351\\226\\261\\350\\256\\200\\345\\231\\250\\0\"\\\n  \"\\346\\254\\212\\351\\231\\220\\344\\270\\215\\350\\266\\263\\357\\274\\232\\0\"\\\n  \"DjVu \\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\346\\226\\207\\344\\273\\266\\347\\211\\271\\346\\200\\247\\0\"\\\n  \"\\344\\270\\213\\350\\274\\211\\0\"\\\n  \"\\351\\233\\242\\351\\226\\213(&X)\\tCtrl+Q\\0\"\\\n  \"EPUB \\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\351\\215\\265\\345\\205\\245\\345\\257\\206\\347\\242\\274\\0\"\\\n  \"\\351\\215\\265\\345\\205\\245 %s \\347\\232\\204\\345\\257\\206\\347\\242\\274\\0\"\\\n  \"\\350\\253\\213\\350\\274\\270\\345\\205\\245\\346\\273\\221\\351\\274\\240\\346\\214\\211\\345\\205\\251\\344\\270\\213 PDF \\346\\226\\207\\344\\273\\266\\346\\231\\202\\357\\274\\214\\346\\207\\211\\345\\237\\267\\350\\241\\214\\347\\232\\204\\346\\214\\207\\344\\273\\244(&E):\\0\"\\\n  \"\\346\\255\\243\\345\\234\\250\\350\\274\\211\\345\\205\\245 %s \\346\\231\\202\\347\\231\\274\\347\\224\\237\\351\\214\\257\\350\\252\\244\\0\"\\\n  \"\\346\\210\\221\\347\\232\\204\\346\\234\\200\\346\\204\\233(&A)\\0\"\\\n  \"\\344\\270\\213\\344\\270\\200\\345\\201\\234\\351\\240\\223\\351\\240\\201\\351\\235\\242(&O)\\tAlt+->\\0\"\\\n  \"\\345\\205\\250\\350\\236\\242\\345\\271\\225\\351\\241\\257\\347\\244\\272(&U)\\tCtrl+Shift+L\\0\"\\\n  \"\\351\\233\\231\\351\\240\\201\\346\\250\\241\\345\\274\\217\\0\"\\\n  \"\\351\\207\\215\\346\\226\\260\\345\\221\\275\\345\\220\\215\\350\\251\\262\\346\\252\\224\\346\\241\\210\\345\\244\\261\\346\\225\\227!\\0\"\\\n  \"\\346\\252\\224\\346\\241\\210\\345\\204\\262\\345\\255\\230\\345\\244\\261\\346\\225\\227\\0\"\\\n  \"\\345\\277\\253\\351\\200\\237\\347\\266\\262\\351\\240\\201\\346\\250\\241\\345\\274\\217\\0\"\\\n  \"\\346\\234\\200\\346\\204\\233\\0\"\\\n  \"FictionBook(fb2) \\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\346\\211\\276\\344\\270\\215\\345\\210\\260\\346\\252\\224\\346\\241\\210 %s\\0\"\\\n  \"\\346\\252\\224\\346\\241\\210\\345\\244\\247\\345\\260\\217:\\0\"\\\n  \"\\346\\252\\224\\346\\241\\210(&F):\\0\"\\\n  \"\\345\\260\\213\\346\\211\\276(&F)...\\tCtrl+F\\0\"\\\n  \"\\345\\260\\213\\346\\211\\276\\0\"\\\n  \"\\345\\220\\221\\344\\270\\213\\345\\260\\213\\346\\211\\276\\0\"\\\n  \"\\345\\220\\221\\344\\270\\212\\345\\260\\213\\346\\211\\276\\0\"\\\n  \"\\345\\260\\213\\346\\211\\276(&F):\\0\"\\\n  \"\\347\\254\\246\\345\\220\\210\\345\\205\\247\\345\\256\\271(&C)\\tCtrl+3\\0\"\\\n  \"\\347\\254\\246\\345\\220\\210\\351\\240\\201\\351\\235\\242(&P)\\tCtrl+0\\0\"\\\n  \"\\347\\254\\246\\345\\220\\210\\345\\257\\254\\345\\272\\246(&H)\\tCtrl+2\\0\"\\\n  \"\\345\\220\\210\\351\\201\\251\\345\\205\\247\\345\\256\\271(&T)\\0\"\\\n  \"\\347\\254\\246\\345\\220\\210\\351\\240\\201\\351\\235\\242(&P)\\0\"\\\n  \"\\345\\220\\210\\351\\201\\251\\345\\257\\254\\345\\272\\246\\0\"\\\n  \"\\347\\254\\246\\345\\220\\210\\345\\257\\254\\345\\272\\246\\344\\270\\224\\351\\200\\243\\347\\272\\214\\351\\241\\257\\347\\244\\272\\351\\240\\201\\351\\235\\242\\0\"\\\n  \"\\347\\254\\246\\345\\220\\210\\345\\226\\256\\351\\240\\201\\0\"\\\n  \"\\345\\255\\227\\345\\236\\213(&F):\\0\"\\\n  \"\\346\\255\\243\\345\\234\\250\\346\\240\\274\\345\\274\\217\\345\\214\\226\\346\\233\\270\\346\\234\\254... %d \\351\\240\\201\\0\"\\\n  \"\\346\\226\\274\\347\\254\\254 %s \\351\\240\\201\\346\\211\\276\\345\\210\\260\\347\\233\\256\\346\\250\\231\\0\"\\\n  \"\\346\\226\\274\\347\\254\\254 %s \\351\\240\\201\\346\\211\\276\\345\\210\\260\\347\\233\\256\\346\\250\\231\\357\\274\\210\\345\\267\\262\\345\\276\\236\\351\\240\\255\\345\\260\\213\\346\\211\\276\\357\\274\\211\\0\"\\\n  \"\\347\\266\\223\\345\\270\\270\\351\\226\\213\\345\\225\\237\\347\\232\\204\\346\\252\\224\\346\\241\\210\\0\"\\\n  \"\\0\"\\\n  \"\\345\\211\\215\\345\\276\\200\\351\\240\\201\\0\"\\\n  \"\\351\\232\\261\\350\\227\\217\\347\\266\\223\\345\\270\\270\\351\\226\\213\\345\\225\\237\\347\\232\\204\\346\\252\\224\\346\\241\\210\\0\"\\\n  \"\\346\\217\\220\\347\\244\\272: \\346\\214\\211 F3 \\351\\207\\215\\346\\226\\260\\345\\260\\213\\346\\211\\276\\343\\200\\202\\0\"\\\n  \"\\345\\234\\226\\347\\211\\207\\346\\252\\224\\346\\241\\210 (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"\\346\\212\\212 SumatraPDF \\344\\275\\234\\347\\202\\272\\351\\240\\220\\350\\250\\255\\347\\232\\204 PDF \\351\\226\\261\\350\\256\\200\\345\\231\\250?\\0\"\\\n  \"\\346\\212\\212 SumatraPDF \\344\\275\\234\\347\\202\\272\\351\\240\\220\\350\\250\\255\\347\\232\\204 PDF \\351\\226\\261\\350\\256\\200\\345\\267\\245\\345\\205\\267\\0\"\\\n  \"\\346\\274\\253\\347\\225\\253\\346\\250\\241\\345\\274\\217(&G)\\0\"\\\n  \"\\347\\254\\246\\345\\220\\210\\345\\244\\247\\345\\260\\217\\345\\257\\253\\0\"\\\n  \"Mobi \\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\346\\252\\224\\346\\241\\210\\346\\233\\264\\346\\226\\260\\346\\227\\245\\346\\234\\237:\\0\"\\\n  \"\\346\\234\\200\\346\\226\\260\\347\\211\\210\\346\\234\\254 %s\\343\\200\\202 \\346\\230\\257\\345\\220\\246\\344\\270\\213\\350\\274\\211\\346\\226\\260\\347\\211\\210\\346\\234\\254?\\0\"\\\n  \"\\344\\270\\213\\344\\270\\200\\351\\240\\201\\0\"\\\n  \"\\346\\211\\276\\344\\270\\215\\345\\210\\260\\347\\265\\220\\346\\236\\234\\0\"\\\n  \"\\345\\234\\250\\347\\254\\254 %u \\350\\241\\214\\351\\231\\204\\350\\277\\221\\357\\274\\210\\346\\252\\224\\346\\241\\210 %s\\357\\274\\211\\346\\211\\276\\344\\270\\215\\345\\210\\260\\347\\233\\256\\346\\250\\231\\0\"\\\n  \"\\346\\211\\276\\344\\270\\215\\345\\210\\260\\345\\220\\214\\346\\255\\245\\346\\252\\224\\346\\241\\210\\0\"\\\n  \"\\346\\262\\222\\346\\234\\211\\345\\220\\214\\346\\255\\245\\350\\263\\207\\346\\226\\231\\0\"\\\n  \"\\351\\240\\201\\346\\225\\270\\357\\274\\232\\0\"\\\n  \"\\347\\242\\272\\345\\256\\232(&O)\\0\"\\\n  \"\\351\\226\\213\\345\\225\\237\\0\"\\\n  \"\\351\\226\\213\\345\\225\\237\\346\\226\\274 PDF-XChange(&X)\\0\"\\\n  \"\\351\\226\\213\\345\\225\\237\\346\\252\\224\\346\\241\\210...\\0\"\\\n  \"\\344\\273\\245 %s \\351\\226\\213\\345\\225\\237\\0\"\\\n  \"\\351\\226\\213\\345\\225\\237\\346\\226\\274 Adobe Reader(&A)\\0\"\\\n  \"\\351\\226\\213\\345\\225\\237\\346\\226\\274 Foxit Reader(&F)\\0\"\\\n  \"\\351\\226\\213\\345\\225\\237\\346\\226\\274 Microsoft HTML Help(&M)\\0\"\\\n  \"\\351\\226\\213\\345\\225\\237\\346\\226\\274 Microsoft XPS-Viewer(&W)\\0\"\\\n  \"\\347\\211\\271\\346\\200\\247(&R)...\\0\"\\\n  \"\\347\\211\\271\\346\\200\\247(&R)...\\tCtrl+D\\0\"\\\n  \"PDF \\346\\226\\207\\344\\273\\266\\0\"\\\n  \"PDF \\346\\234\\200\\344\\275\\263\\345\\214\\226:\\0\"\\\n  \"PDF \\347\\224\\242\\347\\224\\237\\345\\231\\250:\\0\"\\\n  \"PDF \\347\\211\\210\\346\\234\\254\\357\\274\\232\\0\"\\\n  \"PDF \\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\345\\211\\215\\345\\276\\200\\351\\240\\201(&G)...\\tCtrl+G\\0\"\\\n  \"\\347\\254\\254 %s \\351\\240\\201\\0\"\\\n  \"\\351\\240\\201\\351\\235\\242\\345\\244\\247\\345\\260\\217(&Z):\\0\"\\\n  \"\\347\\254\\254 %u \\351\\240\\201\\344\\270\\215\\345\\255\\230\\345\\234\\250\\0\"\\\n  \"\\351\\240\\201\\351\\235\\242\\347\\270\\256\\346\\224\\276\\0\"\\\n  \"\\351\\240\\201:\\0\"\\\n  \"PalmDoc \\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\350\\253\\213\\347\\250\\215\\347\\255\\211\\342\\200\\224\\346\\255\\243\\345\\234\\250\\346\\270\\262\\346\\237\\223...\\0\"\\\n  \"Postscript \\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\346\\212\\225\\345\\275\\261\\347\\211\\207\\351\\241\\257\\347\\244\\272(&E)\\tCtrl+L\\0\"\\\n  \"\\344\\270\\212\\344\\270\\200\\351\\240\\201\\0\"\\\n  \"\\345\\210\\227\\345\\215\\260\\0\"\\\n  \"\\345\\210\\227\\345\\215\\260\\347\\257\\204\\345\\234\\215\\0\"\\\n  \"\\346\\214\\207\\345\\256\\232\\344\\271\\213\\345\\215\\260\\350\\241\\250\\346\\251\\237\\344\\270\\215\\345\\255\\230\\345\\234\\250\\0\"\\\n  \"\\346\\255\\243\\345\\234\\250\\345\\210\\227\\345\\215\\260\\0\"\\\n  \"\\346\\255\\243\\345\\234\\250\\345\\210\\227\\345\\215\\260\\357\\274\\214\\350\\246\\201\\344\\270\\255\\346\\255\\242\\344\\270\\246\\346\\224\\276\\346\\243\\204\\345\\227\\216\\357\\274\\237\\0\"\\\n  \"\\346\\255\\243\\345\\234\\250\\345\\210\\227\\345\\215\\260\\357\\274\\214\\346\\230\\257\\345\\220\\246\\350\\246\\201\\346\\224\\276\\346\\243\\204\\344\\270\\246\\351\\207\\215\\346\\226\\260\\350\\250\\255\\345\\256\\232\\357\\274\\237\\0\"\\\n  \"\\346\\255\\243\\345\\234\\250\\345\\210\\227\\345\\215\\260\\347\\254\\254 %d \\351\\240\\201\\357\\274\\210\\345\\205\\261 %d \\351\\240\\201\\357\\274\\211\\0\"\\\n  \"\\345\\210\\227\\345\\215\\260\\345\\225\\217\\351\\241\\214\\0\"\\\n  \"\\351\\207\\215\\346\\226\\260\\345\\221\\275\\345\\220\\215(&N)...\\tF2\\0\"\\\n  \"\\350\\250\\230\\346\\206\\266\\346\\234\\200\\350\\277\\221\\351\\226\\213\\345\\225\\237\\347\\232\\204\\346\\252\\224\\346\\241\\210(&O)\\0\"\\\n  \"\\350\\207\\252\\346\\234\\200\\346\\204\\233\\347\\247\\273\\351\\231\\244\\0\"\\\n  \"\\345\\276\\236\\346\\210\\221\\347\\232\\204\\346\\234\\200\\346\\204\\233\\344\\270\\255\\347\\247\\273\\351\\231\\244\\347\\254\\254 %s \\351\\240\\201\\0\"\\\n  \"\\351\\207\\215\\346\\226\\260\\345\\221\\275\\345\\220\\215\\347\\202\\272\\0\"\\\n  \"\\351\\240\\201\\351\\235\\242\\345\\267\\246\\346\\227\\213(&L)\\tCtrl+Shift+-\\0\"\\\n  \"\\351\\240\\201\\351\\235\\242\\345\\217\\263\\346\\227\\213(&R)\\tCtrl+Shift++\\0\"\\\n  \"\\345\\217\\246\\345\\255\\230\\347\\202\\272\\0\"\\\n  \"\\345\\204\\262\\345\\255\\230\\347\\202\\272\\346\\215\\267\\345\\276\\221(&H)...\\tCtrl+Shift+S\\0\"\\\n  \"\\346\\255\\243\\345\\234\\250\\346\\220\\234\\345\\260\\213\\347\\254\\254 %d \\351\\240\\201 (\\345\\205\\261 %d \\351\\240\\201)\\0\"\\\n  \"\\345\\205\\250\\351\\201\\270(&A)\\0\"\\\n  \"\\345\\205\\250\\351\\201\\270(&A)\\tCtrl+A\\0\"\\\n  \"\\346\\214\\211 Ctrl+\\346\\273\\221\\351\\274\\240\\345\\267\\246\\351\\215\\265\\351\\201\\270\\345\\217\\226\\345\\205\\247\\345\\256\\271\\0\"\\\n  \"\\351\\201\\270\\345\\217\\226:\\0\"\\\n  \"\\347\\231\\274\\351\\200\\201\\351\\233\\273\\351\\203\\265(&E)...\\0\"\\\n  \"\\350\\250\\255\\345\\256\\232\\345\\217\\215\\345\\220\\221\\346\\220\\234\\345\\260\\213\\345\\221\\275\\344\\273\\244\\350\\241\\214\\0\"\\\n  \"\\351\\241\\257\\347\\244\\272\\346\\233\\270\\347\\261\\244 (&B)\\0\"\\\n  \"\\351\\200\\243\\347\\272\\214\\351\\241\\257\\347\\244\\272\\351\\240\\201\\351\\235\\242(&P)\\0\"\\\n  \"\\351\\241\\257\\347\\244\\272\\345\\267\\245\\345\\205\\267\\345\\210\\227(&T)\\0\"\\\n  \"\\351\\241\\257\\347\\244\\272\\346\\234\\200\\346\\204\\233\\0\"\\\n  \"\\351\\241\\257\\347\\244\\272\\347\\266\\223\\345\\270\\270\\351\\226\\213\\345\\225\\237\\347\\232\\204\\346\\252\\224\\346\\241\\210\\0\"\\\n  \"\\345\\217\\257\\347\\224\\250\\346\\231\\202\\351\\241\\257\\347\\244\\272\\346\\233\\270\\347\\261\\244\\351\\202\\212\\346\\254\\204(&B)\\0\"\\\n  \"\\345\\226\\256\\351\\240\\201\\346\\250\\241\\345\\274\\217\\0\"\\\n  \"\\346\\212\\261\\346\\255\\211\\357\\274\\214\\351\\200\\231\\344\\270\\215\\350\\251\\262\\347\\231\\274\\347\\224\\237\\347\\232\\204\\357\\274\\201\\n\\n\\345\\246\\202\\346\\236\\234\\344\\275\\240\\345\\270\\214\\346\\234\\233\\345\\215\\224\\345\\212\\251\\346\\210\\221\\345\\200\\221\\344\\277\\256\\346\\255\\243\\351\\200\\231\\345\\200\\213\\351\\214\\257\\350\\252\\244\\357\\274\\214\\350\\253\\213\\346\\214\\211\\344\\270\\213 [\\345\\217\\226\\346\\266\\210] \\343\\200\\202\\0\"\\\n  \"\\344\\276\\206\\346\\272\\220\\346\\252\\224\\346\\241\\210 %s \\346\\262\\222\\346\\234\\211\\345\\220\\214\\346\\255\\245\\351\\273\\236\\0\"\\\n  \"\\344\\270\\273\\351\\241\\214:\\0\"\\\n  \"SumatraPDF \\351\\201\\270\\351\\240\\205\\0\"\\\n  \"SumatraPDF \\346\\233\\264\\346\\226\\260\\0\"\\\n  \"SumatraPDF \\347\\231\\274\\347\\224\\237\\351\\214\\257\\350\\252\\244\\0\"\\\n  \"SumatraPDF \\345\\267\\262\\346\\230\\257\\344\\275\\240\\347\\232\\204\\351\\240\\220\\350\\250\\255 PDF \\351\\226\\261\\350\\256\\200\\345\\231\\250\\0\"\\\n  \"SumatraPDF \\345\\267\\262\\346\\210\\220\\347\\202\\272\\344\\275\\240\\347\\232\\204\\351\\240\\220\\350\\250\\255 PDF \\351\\226\\261\\350\\256\\200\\345\\231\\250\\0\"\\\n  \"\\347\\204\\241\\346\\263\\225\\351\\226\\213\\345\\225\\237\\345\\220\\214\\346\\255\\245\\346\\252\\224\\346\\241\\210\\0\"\\\n  \"\\345\\267\\262\\346\\250\\231\\347\\244\\272\\347\\232\\204 PDF\\0\"\\\n  \"\\346\\226\\207\\345\\255\\227\\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\346\\255\\244\\346\\226\\207\\344\\273\\266\\344\\275\\277\\347\\224\\250\\346\\234\\252\\346\\224\\257\\346\\217\\264\\347\\232\\204\\345\\212\\237\\350\\203\\275 (%s) \\357\\274\\214\\344\\270\\246\\345\\217\\257\\350\\203\\275\\347\\204\\241\\346\\263\\225\\346\\255\\243\\347\\242\\272\\347\\232\\204\\347\\271\\252\\350\\243\\275\\343\\200\\202\\0\"\\\n  \"\\346\\250\\231\\351\\241\\214:\\0\"\\\n  \"\\346\\234\\252\\347\\237\\245\\344\\276\\206\\346\\272\\220\\346\\252\\224\\346\\241\\210 (%s)\\0\"\\\n  \"\\344\\275\\277\\347\\224\\250\\351\\240\\201\\347\\261\\244(&T):\\0\"\\\n  \"\\346\\252\\242\\350\\246\\226\\0\"\\\n  \"\\347\\200\\217\\350\\246\\275\\347\\266\\262\\347\\253\\231(&W)\\0\"\\\n  \"\\350\\255\\246\\345\\221\\212\\0\"\\\n  \"XPS \\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\344\\275\\240\\347\\232\\204\\347\\211\\210\\346\\234\\254\\345\\267\\262\\346\\230\\257\\346\\234\\200\\346\\226\\260\\347\\211\\210\\343\\200\\202\\0\"\\\n  \"\\344\\275\\240\\347\\232\\204\\347\\211\\210\\346\\234\\254\\347\\202\\272 %s\\0\"\\\n  \"\\347\\270\\256\\346\\224\\276\\0\"\\\n  \"\\346\\224\\276\\345\\244\\247\\0\"\\\n  \"\\347\\270\\256\\345\\260\\217\\0\"\\\n  \"\\347\\270\\256\\346\\224\\276\\346\\257\\224\\344\\276\\213\\0\"\\\n  \"[\\345\\267\\262\\345\\201\\265\\346\\270\\254\\350\\256\\212\\346\\233\\264\\357\\274\\214\\346\\255\\243\\345\\234\\250\\346\\233\\264\\346\\226\\260] %s\\0\"\\\n  \"\\346\\255\\243\\345\\234\\250\\350\\244\\207\\350\\243\\275\\346\\226\\207\\345\\255\\227\\0\"\\\n  \"\\346\\255\\243\\345\\234\\250\\345\\210\\227\\345\\215\\260\\346\\226\\207\\344\\273\\266\\0\";\n\nconst char * gTranslations_hr = \n  \"&O programu...\\0\"\\\n  \"Stvarna veli\\304\\215ina\\tCtrl+1\\0\"\\\n  \"N&apredne mogu\\304\\207nosti\\0\"\\\n  \"Sve obilje\\305\\276ene str&anice\\0\"\\\n  \"Natrag\\tAlt+<-\\0\"\\\n  \"&Knji\\305\\241ki pregled\\tCtrl+8\\0\"\\\n  \"&Zatvori\\tCtrl+W\\0\"\\\n  \"&Kopiraj obilje\\305\\276eno\\0\"\\\n  \"Kopiraj odabir\\tCtrl+C\\0\"\\\n  \"Ubudu\\304\\207e nemoj pitati\\0\"\\\n  \"Samo &parne stranice\\0\"\\\n  \"&Dvije stranice\\tCtrl+7\\0\"\\\n  \"&Datoteka\\0\"\\\n  \"&\\305\\240to tra\\305\\276iti:\\0\"\\\n  \"Prva stranica\\tHome\\0\"\\\n  \"Namjesti stranice do podru\\304\\215ja za ispis\\0\"\\\n  \"Idi na\\0\"\\\n  \"&Idi na stranicu:\\0\"\\\n  \"&Pomo\\304\\207\\0\"\\\n  \"Posljednja stranica\\tEnd\\0\"\\\n  \"&Uve\\304\\207anje:\\0\"\\\n  \"Korisni\\304\\215ki priru\\304\\215nik\\0\"\\\n  \"Razlikuj velika i mala slova\\0\"\\\n  \"Sljede\\304\\207a stranica\\t->\\0\"\\\n  \"&Ne\\0\"\\\n  \"&Ne, hvala\\0\"\\\n  \"Samo &neparne stranice\\0\"\\\n  \"&Otvori dokument\\0\"\\\n  \"&Otvori...\\tCtrl+O\\0\"\\\n  \"Mogu\\304\\207nosti...\\0\"\\\n  \"&Lozinka:\\0\"\\\n  \"&Pri\\304\\215vrsti dokument\\0\"\\\n  \"Prethodna stranica\\t<-\\0\"\\\n  \"Is&pis...\\0\"\\\n  \"&Ispi\\305\\241i...\\tCtrl+P\\0\"\\\n  \"&Ispis... (nije dopu\\305\\241teno)\\0\"\\\n  \"&Zapamti lozinku za ovaj dokument\\0\"\\\n  \"&Upamti ove postavke za svaki pojedini dokument\\0\"\\\n  \"&Ukloni dokument\\0\"\\\n  \"&Spremi kao...\\0\"\\\n  \"&Spremi kao...\\tCtrl+S\\0\"\\\n  \"&Postavke\\0\"\\\n  \"Smanji stranice do podru\\304\\215ja za ispis (ako je potrebno)\\0\"\\\n  \"&Jedna stranica\\tCtrl+6\\0\"\\\n  \"&Propusti ovu ina\\304\\215icu.\\0\"\\\n  \"Koristi &originalne veli\\304\\215ine stranica\\0\"\\\n  \"&Pogled\\0\"\\\n  \"P&rozor\\0\"\\\n  \"&Da\\0\"\\\n  \"&Uve\\304\\207aj\\0\"\\\n  \"(od %d)\\0\"\\\n  \"(stranica %s)\\0\"\\\n  \"O SumatriPDF\\0\"\\\n  \"Dodaj favorita\\0\"\\\n  \"Dodaj stranicu %s u favorite\\0\"\\\n  \"Dodaj stranicu %s u favorite sa (opcijnalno) imenom:\\0\"\\\n  \"Dodaj u favorite\\0\"\\\n  \"Napredno\\0\"\\\n  \"Sve datoteke\\0\"\\\n  \"Svi podr\\305\\276ani dokumenti\\0\"\\\n  \"Aplikacija:\\0\"\\\n  \"Asocirati sa PDF datotekama?\\0\"\\\n  \"Prilog: %s\\0\"\\\n  \"Autor:\\0\"\\\n  \"Automatsko\\0\"\\\n  \"Provjeravaj &nadogradnje automatski\\0\"\\\n  \"Knji\\305\\241ki pregled\\0\"\\\n  \"Strani\\304\\215nik\\tF12\\0\"\\\n  \"Pre\\304\\215aci oznaka\\0\"\\\n  \"Pre\\304\\215ac oznake do stranice %s of %s\\0\"\\\n  \"Oznake\\0\"\\\n  \"Bajtova\\0\"\\\n  \"CHM dokumenti\\0\"\\\n  \"Internet nedostupan (gre\\305\\241ka %#x)\\0\"\\\n  \"Odustani\\0\"\\\n  \"Ne mogu ispisati ovu datoteku\\0\"\\\n  \"Ne mogu pokrenuti naredbu unazadnog pretra\\305\\276ivanja. Molim provjerite naredbeni redak u postavkama.\\0\"\\\n  \"Promijeni jezik (Change Language)\\0\"\\\n  \"Provjeri a\\305\\276uriranje\\0\"\\\n  \"Stripovi\\0\"\\\n  \"Kompatibilnost\\0\"\\\n  \"Slijedno\\0\"\\\n  \"Slijedni knji\\305\\241ki pogled\\0\"\\\n  \"Dvije stranice slijedno\\0\"\\\n  \"Pomozi prijevodom\\0\"\\\n  \"Kopiraj Sl&iku\\0\"\\\n  \"Kopiraj adresu &linka\\0\"\\\n  \"Kopiraj ko&mentar\\0\"\\\n  \"Kopiranje teksta je nemogu\\304\\207e (kopirano kao slika)\\0\"\\\n  \"Autorsko pravo\\0\"\\\n  \"Nemogu\\304\\207e pribaviti svojstva printera\\0\"\\\n  \"Ne mogu inicijalizirati pisa\\304\\215\\0\"\\\n  \"Nije mogu\\304\\207e iscrtati stranicu\\0\"\\\n  \"Stvoreno:\\0\"\\\n  \"Trenutna datoteka\\0\"\\\n  \"Pozicija pokaziva\\304\\215a:\\0\"\\\n  \"&Prilago\\304\\221eno uve\\304\\207anje...\\tCtrl+Y\\0\"\\\n  \"Pretpostavljeni &izgled:\\0\"\\\n  \"Pretpostavljeno &uve\\304\\207anje:\\0\"\\\n  \"Glavni preglednik PDF datoteka se ne mo\\305\\276e mijenjati u prenosivom na\\304\\215inu\\0\"\\\n  \"Dozvole ograni\\304\\215enja:\\0\"\\\n  \"DjVu dokumenti\\0\"\\\n  \"Svojstva dokumenta\\0\"\\\n  \"Preuzmi\\0\"\\\n  \"&Iza\\304\\221i\\tCtrl+Q\\0\"\\\n  \"EPUB dokumenti\\0\"\\\n  \"Unesi lozinku\\0\"\\\n  \"Unesi lozinku za %s\\0\"\\\n  \"Unesite naredbenu liniju za pokretanje kod dvostrukog klika na PDF dokumentu:\\0\"\\\n  \"Gre\\305\\241ka kod pokretanja %s\\0\"\\\n  \"F&avoriti\\0\"\\\n  \"Naprijed\\tAlt+->\\0\"\\\n  \"Cijeli zaslon\\tCtrl+Shift+L\\0\"\\\n  \"Dvije stranice\\0\"\\\n  \"Neuspjeh u preimenovanju datoteke!\\0\"\\\n  \"Spremanje datoteke nije uspjelo\\0\"\\\n  \"Brzi Web prikaz\\0\"\\\n  \"Favoriti\\0\"\\\n  \"FictionBook dokumenti\\0\"\\\n  \"Datoteka %s nije prona\\304\\221ena\\0\"\\\n  \"Veli\\304\\215ina datoteke:\\0\"\\\n  \"Datoteka:\\0\"\\\n  \"Prona\\304\\221i...\\tCtrl+F\\0\"\\\n  \"Prona\\304\\221i\\0\"\\\n  \"Prona\\304\\221i slijede\\304\\207e\\0\"\\\n  \"Prona\\304\\221i prethodno\\0\"\\\n  \"Prona\\304\\221i:\\0\"\\\n  \"Namjesti po &sadr\\305\\276aju\\tCtrl+3\\0\"\\\n  \"Prilagodi &stranici\\tCtrl+0\\0\"\\\n  \"&Namjesti po \\305\\241irini\\tCtrl+2\\0\"\\\n  \"Namjesti po sadr\\305\\276aju\\0\"\\\n  \"Prilagodi stranici\\0\"\\\n  \"Namjesti po \\305\\241irini\\0\"\\\n  \"Namjesti po \\305\\241irini i prika\\305\\276i stranice slijedno\\0\"\\\n  \"Namjesti po jednoj stranici\\0\"\\\n  \"Fontovi:\\0\"\\\n  \"Oblikovanje knjige... %d stranica\\0\"\\\n  \"Tekst je prona\\304\\221en na %s. stranici\\0\"\\\n  \"Tekst prona\\304\\221en na stranici %s (opet)\\0\"\\\n  \"Naj\\304\\215e\\305\\241\\304\\207e \\304\\215itano\\0\"\\\n  \"GiB\\0\"\\\n  \"Idi na stranicu\\0\"\\\n  \"Sakrij naj\\304\\215e\\305\\241\\304\\207e \\304\\215itano\\0\"\\\n  \"Pomo\\304\\207: upotrijebite tipku F3 za ponovnu pretragu\\0\"\\\n  \"Slikovne datoteke (*.%s)\\0\"\\\n  \"KiB\\0\"\\\n  \"MiB\\0\"\\\n  \"Postaviti SumatruPDF pretpostavljenim preglednikom PDF datoteka?\\0\"\\\n  \"Neka SumatraPDF bude pretpostavljeni preglednik PDF datoteka\\0\"\\\n  \"Man&ga na\\304\\215in\\0\"\\\n  \"Razlikuj velika i mala slova\\0\"\\\n  \"Mobi dokumenti\\0\"\\\n  \"Promijenjeno:\\0\"\\\n  \"Dostupna je nova ina\\304\\215ica (%s). Preuzeti novu ina\\304\\215icu?\\0\"\\\n  \"Sljede\\304\\207a stranica\\0\"\\\n  \"Pojam nije prona\\304\\221en\\0\"\\\n  \"Nema rezultata oko %u. retka u datoteci %s\\0\"\\\n  \"Datoteka uskla\\304\\221ivanja nije prona\\304\\221ena\\0\"\\\n  \"Nema podatka o uskla\\304\\221enosti na ovom mjestu\\0\"\\\n  \"Broj stranica:\\0\"\\\n  \"U redu\\0\"\\\n  \"Otvori\\0\"\\\n  \"Otvori u programu PDF-XChange\\0\"\\\n  \"Otvori dokument...\\0\"\\\n  \"Otvori u %s\\0\"\\\n  \"Otvori u programu &Adobe Reader\\0\"\\\n  \"Otvori u programu &Foxit Reader\\0\"\\\n  \"Otvori u programu Microsoft HTML Help\\0\"\\\n  \"Otvori u programu Microsoft XPS-Viewer\\0\"\\\n  \"&Svojstva\\0\"\\\n  \"S&vojstva...\\tCtrl+D\\0\"\\\n  \"PDF dokument\\0\"\\\n  \"PDF optimizacija:\\0\"\\\n  \"Proizvo\\304\\221a\\304\\215 PDF-a:\\0\"\\\n  \"Ina\\304\\215ica PDF-a:\\0\"\\\n  \"PDF dokumenti\\0\"\\\n  \"Stranica...\\tCtrl+G\\0\"\\\n  \"Stranica %s\\0\"\\\n  \"Veli\\304\\215ina stranice:\\0\"\\\n  \"Stranica %u ne postoji\\0\"\\\n  \"Skaliranje stranice\\0\"\\\n  \"Stranica:\\0\"\\\n  \"PalmDoc dokumenti\\0\"\\\n  \"Molim pri\\304\\215ekajte, iscrtavam...\\0\"\\\n  \"Postscript dokumenti\\0\"\\\n  \"Pr&ezentacija\\tCtrl+L\\0\"\\\n  \"Prethodna stranica\\0\"\\\n  \"Ispis\\0\"\\\n  \"Ispi\\305\\241i raspon\\0\"\\\n  \"Ne postoji printer sa zadanim imenom\\0\"\\\n  \"Ispis u tijeku.\\0\"\\\n  \"Ispis u tijeku. Prekinite i iza\\304\\221ite?\\0\"\\\n  \"Ispis je jo\\305\\241 u tijeku. Prekini i zapo\\304\\215ni ponovno?\\0\"\\\n  \"Ispis stranice %d od %d...\\0\"\\\n  \"Problem prilikom ispisivanja.\\0\"\\\n  \"Preime&novati...\\tF2\\0\"\\\n  \"Upamti &otvorene datoteke\\0\"\\\n  \"Ukloni iz favorita\\0\"\\\n  \"Ukloni stranicu %s iz favorita\\0\"\\\n  \"Preimenuj u\\0\"\\\n  \"Zaokreni nalijevo\\tCtrl+Shift+-\\0\"\\\n  \"Zaokreni nadesno\\tCtrl+Shift++\\0\"\\\n  \"Spremi kao\\0\"\\\n  \"Spremi p&re\\304\\215ac...\\tCtrl+Shift+S\\0\"\\\n  \"Pretra\\305\\276ujem %d. stranicu (od %d)...\\0\"\\\n  \"Obilje\\305\\276i &sve\\0\"\\\n  \"Obilje\\305\\276i &sve\\tCtrl+A\\0\"\\\n  \"Odaberi sadr\\305\\276aj pomo\\304\\207u Ctrl+lijeva tipka mi\\305\\241a\\0\"\\\n  \"Odabir:\\0\"\\\n  \"Po\\305\\241alji &e-po\\305\\241tom...\\0\"\\\n  \"Omogu\\304\\207i unazadnu pretragu\\0\"\\\n  \"Prika\\305\\276i &oznake\\0\"\\\n  \"Prika\\305\\276i stranice slijedno\\0\"\\\n  \"Prika\\305\\276i alatnu traku\\0\"\\\n  \"Prika\\305\\276i favorite\\0\"\\\n  \"Prika\\305\\276i naj\\304\\215e\\305\\241\\304\\207e \\304\\215itano\\0\"\\\n  \"Prika\\305\\276i traku &oznaka kad je dostupna\\0\"\\\n  \"Jedna stranica\\0\"\\\n  \"Isprika, ovo se nije trebalo dogoditi!\\n\\nMolimo kliknite 'Otka\\305\\276i' ako nam \\305\\276elite pomo\\304\\207i ispraviti uzrok ovog ru\\305\\241enja.\\0\"\\\n  \"Izvorna datoteka %s nema to\\304\\215ke uskla\\304\\221ivanja\\0\"\\\n  \"Tema:\\0\"\\\n  \"Mogu\\304\\207nosti programa\\0\"\\\n  \"SumatraPDF a\\305\\276uriranje\\0\"\\\n  \"SumatraPDF se sru\\305\\241io\\0\"\\\n  \"SumatraPDF je va\\305\\241 glavni glavni preglednik PDF datoteka\\0\"\\\n  \"SumatraPDF bi sad trebao biti va\\305\\241 glavni preglednik PDF datoteka\\0\"\\\n  \"Datoteka uskla\\304\\221enja se ne mo\\305\\276e otvoriti\\0\"\\\n  \"Strukturirani PDF\\0\"\\\n  \"Tekstualni dokumenti\\0\"\\\n  \"Ovaj dokument koristi nepodr\\305\\276ane zna\\304\\215ajke (%s) i mo\\305\\276da se ne\\304\\207e ispravno prikazati\\0\"\\\n  \"Naslov:\\0\"\\\n  \"Nepoznata izvorna datoteka (%s)\\0\"\\\n  \"Koristi &kartice\\0\"\\\n  \"Pogled\\0\"\\\n  \"&Posjeti internetsku stranicu\\0\"\\\n  \"Upozorenje\\0\"\\\n  \"XPS dokumenti\\0\"\\\n  \"Imate najnoviju ina\\304\\215icu.\\0\"\\\n  \"Imate ina\\304\\215icu %s\\0\"\\\n  \"Uve\\304\\207anje\\0\"\\\n  \"Uve\\304\\207aj\\0\"\\\n  \"Umanji\\0\"\\\n  \"Faktor uve\\304\\207anja\\0\"\\\n  \"[Dogodila se promjena - osvje\\305\\276avam] %s\\0\"\\\n  \"kopiram tekst\\0\"\\\n  \"ispisujem dokument\\0\";\n\nconst char * gTranslations_cz = \n  \"&O programu\\0\"\\\n  \"Skute\\304\\215n\\303\\241 &velikost\\tCtrl+1\\0\"\\\n  \"&Pokro\\304\\215il\\303\\251 mo\\305\\276nosti...\\0\"\\\n  \"V\\305\\241e&chny vybran\\303\\251 str\\303\\241nky\\0\"\\\n  \"Z&p\\304\\233t\\tAlt+\\305\\240ipka vlevo\\0\"\\\n  \"K&niha\\tCtrl+8\\0\"\\\n  \"&Zav\\305\\231\\303\\255t\\tCtrl+W\\0\"\\\n  \"&Kop\\303\\255rovat v\\303\\275b\\304\\233r\\0\"\\\n  \"&Kop\\303\\255rovat v\\303\\275b\\304\\233r\\tCtrl+C\\0\"\\\n  \"&P\\305\\231\\303\\255\\305\\241t\\304\\233 se ji\\305\\276 neptat\\0\"\\\n  \"Pouz&e sud\\303\\251 str\\303\\241nky\\0\"\\\n  \"&Dvojstr\\303\\241nky\\tCtrl+7\\0\"\\\n  \"&Soubor\\0\"\\\n  \"&Naj\\303\\255t:\\0\"\\\n  \"Prvn\\303\\255 &str\\303\\241nka\\tHome\\0\"\\\n  \"P\\305\\231izp\\305\\257sobit &str\\303\\241nky na tisknutelnou plochu\\0\"\\\n  \"&P\\305\\231ej\\303\\255t\\0\"\\\n  \"&P\\305\\231ej\\303\\255t na str\\303\\241nku:\\0\"\\\n  \"N\\303\\241p&ov\\304\\233da\\0\"\\\n  \"Pos&ledn\\303\\255 str\\303\\241nka\\tEnd\\0\"\\\n  \"&Zv\\304\\233t\\305\\241en\\303\\255:\\0\"\\\n  \"&Manu\\303\\241l\\0\"\\\n  \"&Rozli\\305\\241ovat velikost p\\303\\255smen\\0\"\\\n  \"Dal\\305\\241\\303\\255 str\\303\\241&nka\\t\\305\\240ipka vpravo\\0\"\\\n  \"&Ne\\0\"\\\n  \"&Ne, d\\304\\233kuji\\0\"\\\n  \"&Pouze lich\\303\\251 str\\303\\241nky\\0\"\\\n  \"&Otev\\305\\231\\303\\255t dokument\\0\"\\\n  \"&Otev\\305\\231\\303\\255t...\\tCtrl+O\\0\"\\\n  \"&Mo\\305\\276nosti...\\0\"\\\n  \"&Heslo:\\0\"\\\n  \"&P\\305\\231ipnout dokument\\0\"\\\n  \"&P\\305\\231edchoz\\303\\255 str\\303\\241nka\\t\\305\\240ipka vlevo\\0\"\\\n  \"&Tisk...\\0\"\\\n  \"&Tisk...\\tCtrl+P\\0\"\\\n  \"&Tisk... (odep\\305\\231en)\\0\"\\\n  \"P&amatovat si heslo tohoto dokumentu\\0\"\\\n  \"&Pamatovat si tato nastaven\\303\\255 pro ka\\305\\276d\\303\\275 dokument\\0\"\\\n  \"Odeb&rat dokument\\0\"\\\n  \"&Ulo\\305\\276it jako...\\0\"\\\n  \"&Ulo\\305\\276it jako...\\tCtrl+S\\0\"\\\n  \"&Nastaven\\303\\255\\0\"\\\n  \"&Zmen\\305\\241it str\\303\\241nky na tisknutelnou plochu (v p\\305\\231\\303\\255pad\\304\\233 pot\\305\\231eby)\\0\"\\\n  \"&Jedna str\\303\\241nka\\tCtrl+6\\0\"\\\n  \"&P\\305\\231esko\\304\\215it tuto verzi\\0\"\\\n  \"Po&u\\305\\276\\303\\255t p\\305\\257vodn\\303\\255 velikost str\\303\\241nky\\0\"\\\n  \"&Zobrazit\\0\"\\\n  \"&Okno\\0\"\\\n  \"&Ano\\0\"\\\n  \"Z&v\\304\\233t\\305\\241en\\303\\255\\0\"\\\n  \"(z %d)\\0\"\\\n  \"(str\\303\\241nka %s)\\0\"\\\n  \"O programu SumatraPDF\\0\"\\\n  \"P\\305\\231idat obl\\303\\255benou polo\\305\\276ku\\0\"\\\n  \"P\\305\\231idat str\\303\\241nku %s k obl\\303\\255ben\\303\\275m...\\0\"\\\n  \"P\\305\\231idat str\\303\\241nku %s k obl\\303\\255ben\\303\\275m s (voliteln\\303\\275m) n\\303\\241zvem:\\0\"\\\n  \"P\\305\\231idat k obl\\303\\255ben\\303\\275m\\0\"\\\n  \"Up\\305\\231esnit\\0\"\\\n  \"V\\305\\241echny soubory\\0\"\\\n  \"V\\305\\241echny podporovan\\303\\251 dokumenty\\0\"\\\n  \"Aplikace:\\0\"\\\n  \"P\\305\\231idru\\305\\276it k PDF soubor\\305\\257m?\\0\"\\\n  \"P\\305\\231\\303\\255loha: %s\\0\"\\\n  \"Autor:\\0\"\\\n  \"Automaticky\\0\"\\\n  \"&Automaticky kontrolovat aktualizace\\0\"\\\n  \"Kniha\\0\"\\\n  \"Z\\303\\241l&o\\305\\276ky\\tF12\\0\"\\\n  \"Z\\303\\241stupce z\\303\\241lo\\305\\276ky\\0\"\\\n  \"Z\\303\\241stupce z\\303\\241lo\\305\\276ky na stran\\304\\233 %s souboru %s\\0\"\\\n  \"Z\\303\\241lo\\305\\276ky\\0\"\\\n  \"Bajt\\305\\257\\0\"\\\n  \"Dokumenty CHM\\0\"\\\n  \"Nelze se p\\305\\231ipojit k Internetu (chyba %#x).\\0\"\\\n  \"Storno\\0\"\\\n  \"Tento soubor nelze vytisknout\\0\"\\\n  \"P\\305\\231\\303\\255kaz inverzn\\303\\255 hled\\303\\241n\\303\\255 nelze spustit. Zkontrolujte nastaven\\303\\255 p\\305\\231\\303\\255kazov\\303\\251ho \\305\\231\\303\\241dku.\\0\"\\\n  \"Zm\\304\\233nit jazyk... (Language)\\0\"\\\n  \"&Zkontrolovat aktualizace\\0\"\\\n  \"Komiksy\\0\"\\\n  \"Kompatibilita\\0\"\\\n  \"Jedna str\\303\\241nka pr\\305\\257b\\304\\233\\305\\276n\\304\\233\\0\"\\\n  \"Kniha pr\\305\\257b\\304\\233\\305\\276n\\304\\233\\0\"\\\n  \"Dvojstr\\303\\241nky pr\\305\\257b\\304\\233\\305\\276n\\304\\233\\0\"\\\n  \"Zaslat p\\305\\231eklad\\0\"\\\n  \"Kop\\303\\255rovat &obr\\303\\241zek\\0\"\\\n  \"Kop\\303\\255rovat &adresu odkazu\\0\"\\\n  \"Kop\\303\\255rovat ko&ment\\303\\241\\305\\231\\0\"\\\n  \"Kop\\303\\255rov\\303\\241n\\303\\255 textu bylo odep\\305\\231eno (zkop\\303\\255rov\\303\\241no jako obraz)\\0\"\\\n  \"Autorsk\\303\\241 pr\\303\\241va:\\0\"\\\n  \"Nelze z\\303\\255skat vlastnosti tisk\\303\\241rny\\0\"\\\n  \"Tisk\\303\\241rnu nelze inicializovat\\0\"\\\n  \"Str\\303\\241nku nelze vykreslit\\0\"\\\n  \"Vytvo\\305\\231eno:\\0\"\\\n  \"Aktu\\303\\241ln\\303\\255 soubor\\0\"\\\n  \"Pozice kurzoru:\\0\"\\\n  \"Vlastn\\303\\255 &m\\304\\233\\305\\231\\303\\255tko...\\tCtrl+Y\\0\"\\\n  \"V\\303\\275choz\\303\\255 &uspo\\305\\231\\303\\241d\\303\\241n\\303\\255:\\0\"\\\n  \"V\\303\\275choz\\303\\255 &zv\\304\\233t\\305\\241en\\303\\255:\\0\"\\\n  \"V p\\305\\231enosn\\303\\251m re\\305\\276imu nelze m\\304\\233nit v\\303\\275choz\\303\\255 PDF prohl\\303\\255\\305\\276e\\304\\215\\0\"\\\n  \"Odep\\305\\231en\\303\\241 opr\\303\\241vn\\304\\233n\\303\\255:\\0\"\\\n  \"Dokumenty DjVu\\0\"\\\n  \"Vlastnosti dokumentu\\0\"\\\n  \"St\\303\\241hnout\\0\"\\\n  \"&Konec\\tCtrl+Q\\0\"\\\n  \"Dokumenty EPUB\\0\"\\\n  \"Zadejte heslo\\0\"\\\n  \"Zadejte heslo pro %s\\0\"\\\n  \"Dvojit\\303\\251 kliknut\\303\\255 na PDF dokument vykon\\303\\241 zadan\\303\\275 p\\305\\231\\303\\255kazov\\303\\275 \\305\\231\\303\\241dek:\\0\"\\\n  \"Chyba p\\305\\231i na\\304\\215\\303\\255t\\303\\241n\\303\\255 %s\\0\"\\\n  \"&Obl\\303\\255ben\\303\\251 polo\\305\\276ky\\0\"\\\n  \"V&p\\305\\231ed\\tAlt+\\305\\240ipka vpravo\\0\"\\\n  \"&Cel\\303\\241 obrazovka\\tF11\\0\"\\\n  \"Dvojstr\\303\\241nky\\0\"\\\n  \"P\\305\\231ejmenov\\303\\241n\\303\\255 souboru se nezda\\305\\231ilo!\\0\"\\\n  \"Soubor se nepoda\\305\\231ilo ulo\\305\\276it\\0\"\\\n  \"Rychl\\303\\251 zobrazov\\303\\241n\\303\\255 z webu\\0\"\\\n  \"Obl\\303\\255ben\\303\\251 polo\\305\\276ky\\0\"\\\n  \"Dokumenty FictionBook\\0\"\\\n  \"Soubor %s nebyl nalezen\\0\"\\\n  \"Velikost souboru:\\0\"\\\n  \"Soubor:\\0\"\\\n  \"Naj\\303\\255&t...\\tCtrl+F\\0\"\\\n  \"Naj\\303\\255t\\0\"\\\n  \"Naj\\303\\255t dal\\305\\241\\303\\255\\0\"\\\n  \"Naj\\303\\255t p\\305\\231edchoz\\303\\255\\0\"\\\n  \"Naj\\303\\255t:\\0\"\\\n  \"P\\305\\231izp\\305\\257sobit &obsah\\tCtrl+3\\0\"\\\n  \"Podle &str\\303\\241nky\\tCtrl+0\\0\"\\\n  \"&Podle \\305\\241\\303\\255\\305\\231ky\\tCtrl+2\\0\"\\\n  \"P\\305\\231izp\\305\\257sobit obsah\\0\"\\\n  \"Podle str\\303\\241nky\\0\"\\\n  \"Podle \\305\\241\\303\\255\\305\\231ky\\0\"\\\n  \"P\\305\\231izp\\305\\257sobit \\305\\241\\303\\255\\305\\231ce okna a zobrazit str\\303\\241nky pr\\305\\257b\\304\\233\\305\\276n\\304\\233\\0\"\\\n  \"P\\305\\231izp\\305\\257sobit pro jednu celou str\\303\\241nku v okn\\304\\233\\0\"\\\n  \"P\\303\\255sma:\\0\"\\\n  \"Form\\303\\241tov\\303\\241n\\303\\255 knihy... %d str\\303\\241nek\\0\"\\\n  \"Polo\\305\\276ka nalezena na str\\303\\241nce %s\\0\"\\\n  \"Polo\\305\\276ka nalezena na str\\303\\241nce %s (znovu)\\0\"\\\n  \"\\304\\214asto \\304\\215ten\\303\\251 dokumenty\\0\"\\\n  \"\\0\"\\\n  \"P\\305\\231ej\\303\\255t na str\\303\\241nku\\0\"\\\n  \"Skr\\303\\275t \\304\\215asto \\304\\215ten\\303\\251 dokumenty\\0\"\\\n  \"N\\303\\241pov\\304\\233da: Kl\\303\\241vesou F3 vyhled\\303\\241te dal\\305\\241\\303\\255 v\\303\\275skyt\\0\"\\\n  \"Soubory obr\\303\\241zk\\305\\257 (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Nastavit SumatraPDF jako v\\303\\275choz\\303\\255 prohl\\303\\255\\305\\276e\\304\\215 PDF soubor\\305\\257?\\0\"\\\n  \"Nastavit SumatraPDF jako v\\303\\275choz\\303\\255 PDF prohl\\303\\255\\305\\276e\\304\\215\\0\"\\\n  \"Man&ga re\\305\\276im\\0\"\\\n  \"Rozli\\305\\241ovat velikost p\\303\\255smen\\0\"\\\n  \"Dokumenty Mobi\\0\"\\\n  \"Zm\\304\\233n\\304\\233no:\\0\"\\\n  \"Nov\\303\\241 verze %s je k dispozici. St\\303\\241hnout novou verzi?\\0\"\\\n  \"Dal\\305\\241\\303\\255 str\\303\\241nka\\0\"\\\n  \"\\305\\275\\303\\241dn\\303\\241 polo\\305\\276ka nebyla nalezena\\0\"\\\n  \"Kolem \\305\\231\\303\\241dku %u v souboru %s nebyl nalezen \\305\\276\\303\\241dn\\303\\275 v\\303\\275sledek\\0\"\\\n  \"Soubor synchronizace nebyl nalezen\\0\"\\\n  \"Na t\\303\\251to pozici nen\\303\\255 informace o synchronizaci\\0\"\\\n  \"Po\\304\\215et str\\303\\241nek:\\0\"\\\n  \"\\0\"\\\n  \"Otev\\305\\231\\303\\255t...\\0\"\\\n  \"Otev\\305\\231\\303\\255t v programu PDF-XChange\\0\"\\\n  \"Otev\\305\\231\\303\\255t dokument...\\0\"\\\n  \"Otev\\305\\231\\303\\255t v %s\\0\"\\\n  \"Otev\\305\\231\\303\\255t v programu &Adobe Reader\\0\"\\\n  \"Otev\\305\\231\\303\\255t v programu &Foxit Reader\\0\"\\\n  \"Otev\\305\\231\\303\\255t v programu Microsoft HTML Help\\0\"\\\n  \"Otev\\305\\231\\303\\255t v programu Microsoft XPS-Viewer\\0\"\\\n  \"&Vlastnosti\\0\"\\\n  \"&Vlastnosti...\\tCtrl+D\\0\"\\\n  \"Dokument PDF\\0\"\\\n  \"Optimalizace PDF:\\0\"\\\n  \"Producent PDF:\\0\"\\\n  \"Verze PDF:\\0\"\\\n  \"Dokumenty PDF\\0\"\\\n  \"Str\\303\\241n&ka...\\tCtrl+G\\0\"\\\n  \"Str\\303\\241nka %s\\0\"\\\n  \"Velikost str\\303\\241nky:\\0\"\\\n  \"Str\\303\\241nka \\304\\215\\303\\255slo %u neexistuje\\0\"\\\n  \"M\\304\\233\\305\\231\\303\\255tko str\\303\\241nky\\0\"\\\n  \"Str\\303\\241nka:\\0\"\\\n  \"Dokumenty PalmDoc\\0\"\\\n  \"Pros\\303\\255m \\304\\215ekejte, prob\\303\\255h\\303\\241 vykreslov\\303\\241n\\303\\255...\\0\"\\\n  \"Dokumenty PostScript\\0\"\\\n  \"Pr&ezentace\\tF5\\0\"\\\n  \"P\\305\\231edchoz\\303\\255 str\\303\\241nka\\0\"\\\n  \"Tisk...\\0\"\\\n  \"Rozsah tisku\\0\"\\\n  \"Tisk\\303\\241rna se zadan\\303\\275m n\\303\\241zvem neexistuje\\0\"\\\n  \"Prob\\303\\255h\\303\\241 tisk\\0\"\\\n  \"Tisk st\\303\\241le prob\\303\\255h\\303\\241. P\\305\\231eru\\305\\241it a odej\\303\\255t?\\0\"\\\n  \"Tisk je st\\303\\241le prob\\303\\255h\\303\\241. P\\305\\231eru\\305\\241it a za\\304\\215\\303\\255t znovu?\\0\"\\\n  \"Tisk str\\303\\241nky %d z %d...\\0\"\\\n  \"Pot\\303\\255\\305\\276e s tiskem\\0\"\\\n  \"P\\305\\231ejme&novat...\\tF2\\0\"\\\n  \"Pamatovat si &otev\\305\\231en\\303\\251 soubory\\0\"\\\n  \"Odebrat z obl\\303\\255ben\\303\\275ch\\0\"\\\n  \"Odebrat str\\303\\241nku %s z obl\\303\\255ben\\303\\275ch\\0\"\\\n  \"P\\305\\231ejmenovat na\\0\"\\\n  \"Oto\\304\\215it do&leva\\tCtrl+Shift+Num-\\0\"\\\n  \"Oto\\304\\215it dop&rava\\tCtrl+Shift+Num+\\0\"\\\n  \"Ulo\\305\\276it jako...\\0\"\\\n  \"U&lo\\305\\276it z\\303\\241stupce...\\tCtrl+Shift+S\\0\"\\\n  \"Prohled\\303\\241v\\303\\241 se %d z %d...\\0\"\\\n  \"Vybrat &v\\305\\241e\\0\"\\\n  \"Vybrat &v\\305\\241e\\tCtrl+A\\0\"\\\n  \"Vybrat obsah kl\\303\\241vesou Ctrl a lev\\303\\275m tla\\304\\215\\303\\255tkem my\\305\\241i\\0\"\\\n  \"V\\303\\275b\\304\\233r:\\0\"\\\n  \"Odeslat &e-mailem...\\0\"\\\n  \"Nastavit inverzn\\303\\255 vyhled\\303\\241v\\303\\241n\\303\\255 z p\\305\\231\\303\\255kazov\\303\\251ho \\305\\231\\303\\241dku\\0\"\\\n  \"Zobrazit &z\\303\\241lo\\305\\276ky\\0\"\\\n  \"Zobrazit str\\303\\241nky &pr\\305\\257b\\304\\233\\305\\276n\\304\\233\\0\"\\\n  \"Zobrazit panel n\\303\\241s&troj\\305\\257\\0\"\\\n  \"Zobrazit obl\\303\\255ben\\303\\251 polo\\305\\276ky\\0\"\\\n  \"Zobrazit \\304\\215asto \\304\\215ten\\303\\251 dokumenty\\0\"\\\n  \"Zo&brazit z\\303\\241lo\\305\\276ky v postrann\\303\\255m panelu, jsou-li dostupn\\303\\251\\0\"\\\n  \"Jedna str\\303\\241nka\\0\"\\\n  \"To se nem\\304\\233lo st\\303\\241t, omlouv\\303\\241me se.\\n\\nPokud n\\303\\241m chcete pomoci vy\\305\\231e\\305\\241it p\\305\\231\\303\\255\\304\\215inu tohoto p\\303\\241du, klikn\\304\\233te na tla\\304\\215\\303\\255tko Storno.\\0\"\\\n  \"Zdrojov\\303\\275 soubor %s nem\\303\\241 bod synchronizace\\0\"\\\n  \"P\\305\\231edm\\304\\233t:\\0\"\\\n  \"Mo\\305\\276nosti programu SumatraPDF\\0\"\\\n  \"SumatraPDF - Aktualizace\\0\"\\\n  \"SumatraPDF - Selh\\303\\241n\\303\\255\\0\"\\\n  \"SumatraPDF je v\\303\\275choz\\303\\255m PDF prohl\\303\\255\\305\\276e\\304\\215em\\0\"\\\n  \"SumatraPDF by m\\304\\233l b\\303\\275t v\\303\\275choz\\303\\255m PDF prohl\\303\\255\\305\\276e\\304\\215em\\0\"\\\n  \"Soubor synchronizace nelze otev\\305\\231\\303\\255t\\0\"\\\n  \"Tagovan\\303\\251 PDF\\0\"\\\n  \"Textov\\303\\251 dokumenty\\0\"\\\n  \"Tento dokument pou\\305\\276\\303\\255v\\303\\241 nepodporovan\\303\\251 funkce (%s) a t\\303\\255mto se nemus\\303\\255 vykreslit spr\\303\\241vn\\304\\233\\0\"\\\n  \"N\\303\\241zev:\\0\"\\\n  \"Nezn\\303\\241m\\303\\275 zdrojov\\303\\275 soubor (%s)\\0\"\\\n  \"Pou\\305\\276\\303\\255t &karty\\0\"\\\n  \"Zobrazen\\303\\255\\0\"\\\n  \"Nav\\305\\241t\\303\\255vit &webovou str\\303\\241nku\\0\"\\\n  \"Upozorn\\304\\233n\\303\\255\\0\"\\\n  \"Dokumenty XPS\\0\"\\\n  \"Pou\\305\\276\\303\\255v\\303\\241te nejnov\\304\\233j\\305\\241\\303\\255 verzi.\\0\"\\\n  \"Pou\\305\\276\\303\\255v\\303\\241te verzi %s\\0\"\\\n  \"Zv\\304\\233t\\305\\241en\\303\\255\\0\"\\\n  \"Zv\\304\\233t\\305\\241it\\0\"\\\n  \"Zmen\\305\\241it\\0\"\\\n  \"M\\304\\233\\305\\231\\303\\255tko p\\305\\231ibl\\303\\255\\305\\276en\\303\\255\\0\"\\\n  \"[Zji\\305\\241t\\304\\233na zm\\304\\233na; prob\\303\\255h\\303\\241 aktualizace] %s\\0\"\\\n  \"kop\\303\\255rov\\303\\241n\\303\\255 textu\\0\"\\\n  \"tisk dokumentu\\0\";\n\nconst char * gTranslations_dk = \n  \"&Om\\0\"\\\n  \"&Faktisk st\\303\\270rrelse\\tCtrl+1\\0\"\\\n  \"&Avancerede valgmuligheder\\0\"\\\n  \"&Alle valgte sider\\0\"\\\n  \"&Tilbage\\tAlt+venstre pil\\0\"\\\n  \"&Bogvisning\\tCtrl+8\\0\"\\\n  \"&Luk\\tCtrl+W\\0\"\\\n  \"&Kopier markering\\0\"\\\n  \"&Kopier markering\\tCtrl+C\\0\"\\\n  \"&Sp\\303\\270rg mig ikke igen\\0\"\\\n  \"&Kun lige sider\\0\"\\\n  \"&Modst\\303\\245ende\\tCtrl+7\\0\"\\\n  \"&Fil\\0\"\\\n  \"&Find hvad:\\0\"\\\n  \"&F\\303\\270rste side\\tHome\\0\"\\\n  \"&Tilpas sider til udskrivningsomr\\303\\245det\\0\"\\\n  \"&G\\303\\245 til\\0\"\\\n  \"&G\\303\\245 til side:\\0\"\\\n  \"&Hj\\303\\246lp\\0\"\\\n  \"&Sidste side\\tEnd\\0\"\\\n  \"&Forst\\303\\270rrelse:\\0\"\\\n  \"\\0\"\\\n  \"&Versalf\\303\\270lsom s\\303\\270gning\\0\"\\\n  \"&N\\303\\246ste side\\t->\\0\"\\\n  \"&Nej\\0\"\\\n  \"&Nej, tak\\0\"\\\n  \"&Kun ulige sider\\0\"\\\n  \"&\\303\\205bn dokument\\0\"\\\n  \"&\\303\\205bn...\\tCtrl+O\\0\"\\\n  \"&Valgmuligheder ...\\0\"\\\n  \"&Kodeord:\\0\"\\\n  \"&Fastg\\303\\270r dokument\\0\"\\\n  \"&Forrige side\\t<-\\0\"\\\n  \"&Udskriv ...\\0\"\\\n  \"&Udskriv ...\\tCtrl+P\\0\"\\\n  \"&Udskriv ... (n\\303\\246gtet)\\0\"\\\n  \"&Husk kodeordet for dette dokument\\0\"\\\n  \"&Husk disse indstillinger for hvert dokument\\0\"\\\n  \"&Fjern dokument\\0\"\\\n  \"&Gem som ...\\0\"\\\n  \"&Gem som ...\\tCtrl+S\\0\"\\\n  \"&Indstillinger\\0\"\\\n  \"&Formindsk sider til udskriftsomr\\303\\245det (hvis n\\303\\270dvendigt)\\0\"\\\n  \"&Enkelt side\\tCtrl+6\\0\"\\\n  \"&Spring over denne version\\0\"\\\n  \"&Brug originale sidest\\303\\270rrelser\\0\"\\\n  \"&Vis\\0\"\\\n  \"&Vindue\\0\"\\\n  \"&Ja\\0\"\\\n  \"\\0\"\\\n  \"(af %d)\\0\"\\\n  \"(side %s)\\0\"\\\n  \"Om SumatraPDF\\0\"\\\n  \"Tilf\\303\\270j bogm\\303\\246rke\\0\"\\\n  \"Tilf\\303\\270j side %s til bogm\\303\\246rker\\0\"\\\n  \"Tilf\\303\\270j side %s til bogm\\303\\246rker med (valgfrit) navn:\\0\"\\\n  \"Tilf\\303\\270j til bogm\\303\\246rker\\0\"\\\n  \"Avanceret\\0\"\\\n  \"Alle filer\\0\"\\\n  \"Alle underst\\303\\270ttede dokumenter\\0\"\\\n  \"Program:\\0\"\\\n  \"Tilknyt til  PDF-filer?\\0\"\\\n  \"Bilag: %s\\0\"\\\n  \"Forfatter:\\0\"\\\n  \"Automatisk\\0\"\\\n  \"Kontroller automatisk for &opdateringer\\0\"\\\n  \"Bogvisning\\0\"\\\n  \"Bog&m\\303\\246rker\\tF12\\0\"\\\n  \"Gem genveje\\0\"\\\n  \"Gem genvej til side %s af %s\\0\"\\\n  \"Bogm\\303\\246rker\\0\"\\\n  \"Byte\\0\"\\\n  \"CHM-dokumenter\\0\"\\\n  \"Kan ikke forbinde til internettet (fejl %#x).\\0\"\\\n  \"Annuller\\0\"\\\n  \"Kan ikke udskrive denne fil\\0\"\\\n  \"Kan ikke starte s\\303\\270gekommandoen invers. Kontroller venligst kommandolinjen i indstillingerne.\\0\"\\\n  \"Skift sprog (Change Language)\\0\"\\\n  \"Kontroller for ny &version\\0\"\\\n  \"Tegneserier\\0\"\\\n  \"Kompatibilitet\\0\"\\\n  \"Fortl\\303\\270bende\\0\"\\\n  \"Fortl\\303\\270bende bogvisning\\0\"\\\n  \"Fortl\\303\\270bende modst\\303\\245ende\\0\"\\\n  \"Bidrag med overs\\303\\246ttelse\\0\"\\\n  \"Kopier &billede\\0\"\\\n  \"Kopier &henvisningsadresse\\0\"\\\n  \"Kopier ko&mmentar\\0\"\\\n  \"Kopiering af tekst blev n\\303\\246gtet (kopierer kun som billede)\\0\"\\\n  \"Ophavsret:\\0\"\\\n  \"Kan ikke hente printeregenskaber\\0\"\\\n  \"Kunne ikke starte printer\\0\"\\\n  \"Kunne ikke vise siden\\0\"\\\n  \"Oprettet:\\0\"\\\n  \"Aktuel fil\\0\"\\\n  \"Mark\\303\\270rposition:\\0\"\\\n  \"Brugerdefineret &zoom...\\tCtrl+Y\\0\"\\\n  \"Standard&layout:\\0\"\\\n  \"Standard&zoom\\0\"\\\n  \"Standardl\\303\\246seren for PDF kan ikke \\303\\246ndres i mobil tilstand\\0\"\\\n  \"N\\303\\246gtede tilladelser:\\0\"\\\n  \"DjVu-dokumenter\\0\"\\\n  \"Dokumentegenskaber\\0\"\\\n  \"Hent\\0\"\\\n  \"&Afslut\\tCtrl+Q\\0\"\\\n  \"EPUB-dokumenter\\0\"\\\n  \"Indtast kodeord\\0\"\\\n  \"Indtast kodeord for %s\\0\"\\\n  \"Indtast den kommandolinje du vil bruge, n\\303\\245r du dobbeltklikker p\\303\\245 PDF-dokumentet:\\0\"\\\n  \"Side %s kan ikke indl\\303\\246ses\\0\"\\\n  \"Bogm&\\303\\246rker\\0\"\\\n  \"F&remad\\tAlt+->\\0\"\\\n  \"F&uldsk\\303\\246rmsvisning\\tCtrl+skift+L\\0\"\\\n  \"Modst\\303\\245ende\\0\"\\\n  \"Fejl ved omd\\303\\270bning af fil!\\0\"\\\n  \"Kunne ikke gemme filen\\0\"\\\n  \"Hurtig Internetvisning\\0\"\\\n  \"Bogm\\303\\246rker\\0\"\\\n  \"FictionBook-dokumenter\\0\"\\\n  \"Filen %s blev ikke fundet\\0\"\\\n  \"Filst\\303\\270rrelse:\\0\"\\\n  \"Fil:\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Find n\\303\\246ste\\0\"\\\n  \"Find forrige\\0\"\\\n  \"\\0\"\\\n  \"Tilpas &indhold\\tCrtl-3\\0\"\\\n  \"Tilpas &side\\tCtrl+0\\0\"\\\n  \"Tilpas &bredde\\tCtrl+2\\0\"\\\n  \"Tilpas indhold\\0\"\\\n  \"Tilpas side\\0\"\\\n  \"Tilpas bredde\\0\"\\\n  \"Tilpas bredde og vis sider l\\303\\270bende\\0\"\\\n  \"Vis en side ad gangen\\0\"\\\n  \"Skrifttyper:\\0\"\\\n  \"Formaterer bogen ... %d sider\\0\"\\\n  \"Fandt tekst p\\303\\245 side %s\\0\"\\\n  \"Tekst er (ogs\\303\\245) fundet p\\303\\245 side %s\\0\"\\\n  \"Hyppigt l\\303\\246ste\\0\"\\\n  \"Gb\\0\"\\\n  \"G\\303\\245 til side\\0\"\\\n  \"Skjul hyppigt l\\303\\246ste\\0\"\\\n  \"Vink: Brug F3-knappen for at finde igen\\0\"\\\n  \"Billedfiler (*.%s)\\0\"\\\n  \"Kb\\0\"\\\n  \"Mb\\0\"\\\n  \"G\\303\\270r SumatraPDF til standardprogrammet for PDF-filer\\0\"\\\n  \"G\\303\\270r SumatraPDF til min standardl\\303\\246ser for PDF-filer\\0\"\\\n  \"Man&ga-tilstand\\0\"\\\n  \"Versalf\\303\\270lsom s\\303\\270gning\\0\"\\\n  \"Mobi-dokumenter\\0\"\\\n  \"\\303\\206ndret:\\0\"\\\n  \"Ny version %s er tilg\\303\\246ngelig. Hent ny version?\\0\"\\\n  \"N\\303\\246ste side\\0\"\\\n  \"Ingen resultater blev fundet\\0\"\\\n  \"Intet resultat fundet omkring linje %u i filen %s\\0\"\\\n  \"Ingen synkroniseringsfil fundet\\0\"\\\n  \"Ingen synkroniseringsinformation p\\303\\245 denne position\\0\"\\\n  \"Antal sider:\\0\"\\\n  \"O.k.\\0\"\\\n  \"\\303\\205bn\\0\"\\\n  \"\\303\\205bn med PDF-XChange\\0\"\\\n  \"\\303\\205bn et dokument ...\\0\"\\\n  \"\\303\\205bn i %s\\0\"\\\n  \"\\303\\205bn med &Adobe Reader\\0\"\\\n  \"\\303\\205bn med &Foxit Reader\\0\"\\\n  \"\\303\\205bn med Microsoft HTML Help\\0\"\\\n  \"\\303\\205bn med Microsoft XPS-Viewer\\0\"\\\n  \"Egenskabe&r\\0\"\\\n  \"E&genskaber\\tCtrl+D\\0\"\\\n  \"PDF-dokument\\0\"\\\n  \"PDF-optimeringer:\\0\"\\\n  \"PDF-producent:\\0\"\\\n  \"PDF-version:\\0\"\\\n  \"PDF dokumenter\\0\"\\\n  \"&Side ...\\tCtrl+G\\0\"\\\n  \"Side %s\\0\"\\\n  \"Sidest\\303\\270rrelse:\\0\"\\\n  \"Sidenummer %u findes ikke\\0\"\\\n  \"Sideskalering\\0\"\\\n  \"Side:\\0\"\\\n  \"PalmDoc-dokumenter\\0\"\\\n  \"Vent venligst - optegner ...\\0\"\\\n  \"Postscript-dokumenter\\0\"\\\n  \"H&ele sk\\303\\246rmen\\tCtrl+L\\0\"\\\n  \"Forrige side\\0\"\\\n  \"Udskriv\\0\"\\\n  \"Udskriftsomr\\303\\245de\\0\"\\\n  \"Printer med dette navn findes ikke\\0\"\\\n  \"Udskrift i gang\\0\"\\\n  \"Udskrift er stadig i gang. Afbryd og afslut?\\0\"\\\n  \"Udskrift p\\303\\245g\\303\\245r stadig. Afbryd og start forfra?\\0\"\\\n  \"Udskriver side %d af %d ...\\0\"\\\n  \"Udskriftsproblem.\\0\"\\\n  \"Om&d\\303\\270b ... \\tF2\\0\"\\\n  \"Husk &\\303\\245bnede filer\\0\"\\\n  \"Fjern fra bogm\\303\\246rker\\0\"\\\n  \"Fjern side %s fra bogm\\303\\246rker\\0\"\\\n  \"Omd\\303\\270b til\\0\"\\\n  \"Roter mod &venstre\\tCtrl+skift+-\\0\"\\\n  \"Roter mod &h\\303\\270jre\\tCtrl+skift++\\0\"\\\n  \"Gem som\\0\"\\\n  \"Gem ge&nvej ...\\tCtrl+skift+S\\0\"\\\n  \"S\\303\\270ger i %d af %d ...\\0\"\\\n  \"Marker &alt\\0\"\\\n  \"V\\303\\246lg &alt\\tCtrl+A\\0\"\\\n  \"V\\303\\246lg indhold med Ctrl+venstre museknap\\0\"\\\n  \"Markering:\\0\"\\\n  \"Send med &e-post ...\\0\"\\\n  \"Angiv omvendt s\\303\\270gekommandolinje\\0\"\\\n  \"Vis &bogm\\303\\246rker\\0\"\\\n  \"Vis &sider fortl\\303\\270bende\\0\"\\\n  \"Vis &v\\303\\246rkt\\303\\270jslinje\\0\"\\\n  \"Vis bogm\\303\\246rker\\0\"\\\n  \"Vis hyppigt l\\303\\246ste\\0\"\\\n  \"Vis sidepanelet for &bogm\\303\\246rker n\\303\\245r tilg\\303\\246ngeligt\\0\"\\\n  \"Enkelt side\\0\"\\\n  \"Desv\\303\\246rre, det var ikke meningen\\n\\nKlik p\\303\\245 \\302\\273Afbryd\\302\\253, hvis du kan og vil hj\\303\\246lpe med at finde \\303\\245rsagen til nedbruddet.\\0\"\\\n  \"Kildefilen %s har ingen synkroniseringspunkter\\0\"\\\n  \"Emne:\\0\"\\\n  \"SumatraPDF-valgmuligheder\\0\"\\\n  \"SumatraPDF-opdatering\\0\"\\\n  \"Kritisk fejl, SumatraPDF lukkes\\0\"\\\n  \"SumatraPDF er din standardl\\303\\246ser til PDF-filer\\0\"\\\n  \"SumatraPDF skulle nu v\\303\\246re din standardl\\303\\246ser til PDF-filer\\0\"\\\n  \"Synkroniseringsfil kan ikke \\303\\245bnes\\0\"\\\n  \"M\\303\\246rket PDF\\0\"\\\n  \"Tekstdokumenter\\0\"\\\n  \"Dette dokument bruger funktioner, der ikke er underst\\303\\270ttet (%s) og optegner m\\303\\245ske ikke korrekt\\0\"\\\n  \"Titel:\\0\"\\\n  \"Ukendt kildefil (%s)\\0\"\\\n  \"Brug &faneblade\\0\"\\\n  \"Vis\\0\"\\\n  \"Bes\\303\\270g &internetside\\0\"\\\n  \"Advarsel\\0\"\\\n  \"XPS-dokumenter\\0\"\\\n  \"Du har den seneste version.\\0\"\\\n  \"Du har version %s\\0\"\\\n  \"\\0\"\\\n  \"Zoom ind\\0\"\\\n  \"Zoom ud\\0\"\\\n  \"Zoomfaktor\\0\"\\\n  \"[\\303\\206ndringer konstateret; opdaterer] %s\\0\"\\\n  \"kopierer tekst\\0\"\\\n  \"udskriver dokument\\0\";\n\nconst char * gTranslations_nl = \n  \"&Over\\0\"\\\n  \"&Ware grootte\\tCtrl+1\\0\"\\\n  \"&Geavanceerde Opties...\\0\"\\\n  \"&Alle geselecteerde pagina's\\0\"\\\n  \"Terug\\tAlt+<-\\0\"\\\n  \"&Boekweergave\\tCtrl+8\\0\"\\\n  \"&Sluiten\\tCtrl+W\\0\"\\\n  \"Selectie kopi\\303\\253ren\\0\"\\\n  \"Kopieer selectie\\tCtrl+C\\0\"\\\n  \"Niet opnieuw vragen\\0\"\\\n  \"Alleen &Even pagina's\\0\"\\\n  \"&Dubbele pagina\\tCtrl+7\\0\"\\\n  \"&Bestand\\0\"\\\n  \"&Zoek naar:\\0\"\\\n  \"Eerste pagina\\tHome\\0\"\\\n  \"Pagina's in afdrukgebied passen\\0\"\\\n  \"&Ga naar\\0\"\\\n  \"&Ga naar pagina:\\0\"\\\n  \"\\0\"\\\n  \"&Laatste pagina\\tEnd\\0\"\\\n  \"&Vergroting:\\0\"\\\n  \"Handleiding\\0\"\\\n  \"Hoofd-/kleine letters toepassen\\0\"\\\n  \"Volgende pagina\\t->\\0\"\\\n  \"&Nee\\0\"\\\n  \"&Nee, bedankt\\0\"\\\n  \"Alleen &Oneven pagina's\\0\"\\\n  \"Document &Openen\\0\"\\\n  \"&Openen...\\tCtrl+O\\0\"\\\n  \"&Opties...\\0\"\\\n  \"&Wachtwoord:\\0\"\\\n  \"Document &Vastpinnen\\0\"\\\n  \"Vorige pagina\\t<-\\0\"\\\n  \"Afdrukken...\\0\"\\\n  \"Afdrukken...\\tCtrl+P\\0\"\\\n  \"Afdrukken... (niet toegestaan)\\0\"\\\n  \"Wachtwoord onthouden voor dit document\\0\"\\\n  \"&Bewaar deze instellingen voor elk document\\0\"\\\n  \"Document ve&rwijderen\\0\"\\\n  \"Op&slaan als...\\0\"\\\n  \"&Opslaan als...\\tCtrl+S\\0\"\\\n  \"&Instellingen\\0\"\\\n  \"Pagina's verkleinen tot afdrukgebied (indien nodig)\\0\"\\\n  \"&Enkele pagina\\tCtrl+6\\0\"\\\n  \"Deze versie overslaan\\0\"\\\n  \"Originele paginagrootte gebruiken\\0\"\\\n  \"&Beeld\\0\"\\\n  \"&Venster\\0\"\\\n  \"&Ja\\0\"\\\n  \"\\0\"\\\n  \"(van %d)\\0\"\\\n  \"(pagina %s)\\0\"\\\n  \"Over SumatraPDF\\0\"\\\n  \"Voeg Favoriet toe\\0\"\\\n  \"Voeg pagina %s toe aan favorieten\\0\"\\\n  \"Voeg pagina %s toe aan favorieten met (optionele) naam:\\0\"\\\n  \"Voeg toe aan favorieten\\0\"\\\n  \"Geavanceerd\\0\"\\\n  \"Alle bestanden\\0\"\\\n  \"Alle ondersteunde documenten\\0\"\\\n  \"Programma:\\0\"\\\n  \"Associ\\303\\253ren met PDF-bestanden?\\0\"\\\n  \"Bijlage: %s\\0\"\\\n  \"Auteur:\\0\"\\\n  \"Automatisch\\0\"\\\n  \"Automatisch controleren op &updates\\0\"\\\n  \"Boekweergave\\0\"\\\n  \"Bladwijzers\\tF12\\0\"\\\n  \"Bladwijzer maken\\0\"\\\n  \"Bladwijzer maken naar pagina %s van %s\\0\"\\\n  \"Bladwijzers\\0\"\\\n  \"\\0\"\\\n  \"CHM-documenten\\0\"\\\n  \"Kan geen verbinding maken met internet (fout %#x).\\0\"\\\n  \"Annuleren\\0\"\\\n  \"Kan dit bestand niet afdrukken\\0\"\\\n  \"Kan de omgekeerde zoekopdracht niet starten. Controleer de opdrachtregel in de instellingen.\\0\"\\\n  \"Taal wijzigen (Change Language)\\0\"\\\n  \"Controleren op &updates\\0\"\\\n  \"Stripboeken\\0\"\\\n  \"Compatibiliteit\\0\"\\\n  \"Doorlopend\\0\"\\\n  \"Doorlopende boekweergave\\0\"\\\n  \"Dubbele pagina doorlopend\\0\"\\\n  \"Help met vertalen\\0\"\\\n  \"Afbeelding kopi\\303\\253ren\\0\"\\\n  \"&Verwijzing kopi\\303\\253ren\\0\"\\\n  \"Notitie kopi\\303\\253ren\\0\"\\\n  \"Tekst kopi\\303\\253ren niet toegestaan (kopieer als afbeelding)\\0\"\\\n  \"Auteursrecht\\0\"\\\n  \"Kan geen printereigenschappen verkrijgen\\0\"\\\n  \"Kan de printer niet initialiseren\\0\"\\\n  \"Kan deze pagina niet weergegeven\\0\"\\\n  \"Gemaakt:\\0\"\\\n  \"Huidig bestand\\0\"\\\n  \"Cursor positie\\0\"\\\n  \"Aangepaste &Zoom...\\tCtrl+Y\\0\"\\\n  \"Standaard opmaak:\\0\"\\\n  \"Standaard &zoom:\\0\"\\\n  \"Standaard PDF-lezer kan niet worden aangepast in portable modus\\0\"\\\n  \"Niet toegestaan:\\0\"\\\n  \"DjVu-documenten\\0\"\\\n  \"Documenteigenschappen\\0\"\\\n  \"Downloaden\\0\"\\\n  \"&Afsluiten\\tCtrl+Q\\0\"\\\n  \"EPUB-bestanden\\0\"\\\n  \"Wachtwoord invoeren\\0\"\\\n  \"Wachtwoord invoeren voor %s\\0\"\\\n  \"Opdracht-regel die gestart moet worden bij het dubbelklikken van een PDF-document:\\0\"\\\n  \"Fout bij het laden van %s\\0\"\\\n  \"F&avorieten\\0\"\\\n  \"Verder\\tAlt+->\\0\"\\\n  \"Volledig scherm\\tCtrl+Shift+L\\0\"\\\n  \"Dubbele pagina\\0\"\\\n  \"Naam niet kunnen wijzigen!\\0\"\\\n  \"Fout bij opslaan bestand\\0\"\\\n  \"Snelle browserweergave\\0\"\\\n  \"Favorieten\\0\"\\\n  \"FictionBookdocumenten\\0\"\\\n  \"Bestand %s niet gevonden\\0\"\\\n  \"Bestandsgrootte\\0\"\\\n  \"Bestand:\\0\"\\\n  \"Zoeken...\\tCtrl+F\\0\"\\\n  \"Zoeken\\0\"\\\n  \"Volgende\\0\"\\\n  \"Vorige\\0\"\\\n  \"Zoeken:\\0\"\\\n  \"Passend maken\\tCtrl+3\\0\"\\\n  \"Hele &pagina\\tCtrl+0\\0\"\\\n  \"Passend in &breedte\\tCtrl+2\\0\"\\\n  \"Passend maken\\0\"\\\n  \"Hele pagina\\0\"\\\n  \"Passend in breedte\\0\"\\\n  \"Passend in breedte en pagina's doorlopend\\0\"\\\n  \"Hele pagina passend maken\\0\"\\\n  \"Lettertypen:\\0\"\\\n  \"Boek samenstellen... %d paginas\\0\"\\\n  \"Tekst gevonden op pagina %s\\0\"\\\n  \"Tekst gevonden op pagina %s (opnieuw)\\0\"\\\n  \"Eerder Weergegeven\\0\"\\\n  \"\\0\"\\\n  \"Ga naar pagina\\0\"\\\n  \"'Eerder Weergegeven' verbergen\\0\"\\\n  \"Tip: Gebruik de functietoets F3 om verder te zoeken\\0\"\\\n  \"Afbeeldingen (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"SumatraPDF als standaardlezer van PDF-bestanden instellen?\\0\"\\\n  \"SumatraPDF als standaard PDF-lezer instellen\\0\"\\\n  \"Man&gamodus\\0\"\\\n  \"Hoofdlettergevoelig\\0\"\\\n  \"Mobi-documenten\\0\"\\\n  \"Aangepast:\\0\"\\\n  \"Nieuwe versie %s is beschikbaar. Wilt u deze downloaden?\\0\"\\\n  \"Volgende pagina\\0\"\\\n  \"Geen zoekresultaat gevonden\\0\"\\\n  \"Geen resultaat gevonden bij regel %u in bestand %s\\0\"\\\n  \"Geen synchronisatiebestand gevonden\\0\"\\\n  \"Geen synchronisatieinformatie beschikbaar\\0\"\\\n  \"Aantal pagina's:\\0\"\\\n  \"\\0\"\\\n  \"Openen\\0\"\\\n  \"Openen met PDF-XChange\\0\"\\\n  \"Open een document...\\0\"\\\n  \"\\0\"\\\n  \"Openen met &Adobe Reader\\0\"\\\n  \"Openen met &Foxit Reader\\0\"\\\n  \"Openen met Microsoft HTML Help\\0\"\\\n  \"Openen met Microsoft XPS-Viewer\\0\"\\\n  \"E&igenschappen\\0\"\\\n  \"E&igenschappen...\\tCtrl+D\\0\"\\\n  \"PDF-document\\0\"\\\n  \"PDF Optimalisaties\\0\"\\\n  \"PDF-maker:\\0\"\\\n  \"PDF-versie:\\0\"\\\n  \"PDF-documenten\\0\"\\\n  \"Pa&gina...\\tCtrl+G\\0\"\\\n  \"Pagina %s\\0\"\\\n  \"Paginagrootte:\\0\"\\\n  \"Paginanummer %u bestaat niet\\0\"\\\n  \"Pagina schalen\\0\"\\\n  \"Pagina:\\0\"\\\n  \"PalmDoc documenten\\0\"\\\n  \"Een ogenblik - weergeven...\\0\"\\\n  \"Postscript documenten\\0\"\\\n  \"Pr&esentatie\\tCtrl+L\\0\"\\\n  \"Vorige pagina\\0\"\\\n  \"Afdrukken\\0\"\\\n  \"Bereik afdrukken\\0\"\\\n  \"Printer met de opgegeven naam bestaat niet\\0\"\\\n  \"Aan het printen.\\0\"\\\n  \"Nog steeds aan het printen. Annuleren en stoppen?\\0\"\\\n  \"Afdrukken is nog niet voltooid. Afbreken en opnieuw beginnen?\\0\"\\\n  \"Pagina %d van %d afdrukken...\\0\"\\\n  \"Probleem bij het afdrukken\\0\"\\\n  \"&Naam wijzigen...\\tF2\\0\"\\\n  \"Onthoud ge&opende bestanden\\0\"\\\n  \"Verwijder uit favorieten\\0\"\\\n  \"Verwijder pagina %s uit favorieten\\0\"\\\n  \"Naam wijzigen in\\0\"\\\n  \"Linksom draaien\\tCtrl+Shift+-\\0\"\\\n  \"Rechtsom draaien\\tCtrl+Shift++\\0\"\\\n  \"Opslaan als\\0\"\\\n  \"Snelkoppeling opslaan...\\tCtrl+Shift+S\\0\"\\\n  \"Zoek %d van %d...\\0\"\\\n  \"&Alles selecteren\\0\"\\\n  \"&Alles selecteren\\tCtrl+A\\0\"\\\n  \"Selecteer inhoud met Ctrl+linker muisknop\\0\"\\\n  \"Selectie\\0\"\\\n  \"Verzend per &e-mail...\\0\"\\\n  \"Omgekeerde zoekrichting instellen\\0\"\\\n  \"Bladwijzers tonen\\0\"\\\n  \"Toon pagina's doorlopend\\0\"\\\n  \"Werkbalk tonen\\0\"\\\n  \"Toon Favorieten\\0\"\\\n  \"'Eerder Weergegeven' tonen\\0\"\\\n  \"Toon de &bladwijzerwerkbalk indien beschikbaar\\0\"\\\n  \"Enkele pagina\\0\"\\\n  \"Sorry, dit had niet mogen gebeuren!\\n\\nDruk 'Annuleren', als je wilt helpen de oorzaak van deze fout te vinden.\\0\"\\\n  \"Bestand %s heeft geen synchronisatiepunt\\0\"\\\n  \"Onderwerp:\\0\"\\\n  \"SumatraPDF Opties\\0\"\\\n  \"\\0\"\\\n  \"SumatraPDF is vastgelopen\\0\"\\\n  \"SumatraPDF is de standaard PDF-lezer\\0\"\\\n  \"SumatraPDF zou nu de standaard PDF-lezer moeten zijn\\0\"\\\n  \"Het synchronisatiebestand kan niet worden geopend\\0\"\\\n  \"\\0\"\\\n  \"Tekstdocumenten\\0\"\\\n  \"Dit document maakt gebruik van niet-ondersteunde functies (%s) en wordt mogelijk niet goed weergegeven\\0\"\\\n  \"Titel:\\0\"\\\n  \"Onbekend bronbestand (%s)\\0\"\\\n  \"Gebruik &tabs\\0\"\\\n  \"Beeld\\0\"\\\n  \"Bezoek de &website\\0\"\\\n  \"Waarschuwing\\0\"\\\n  \"XPS-documenten\\0\"\\\n  \"U gebruikt de meest recente versie.\\0\"\\\n  \"U heeft versie %s\\0\"\\\n  \"\\0\"\\\n  \"Inzoomen\\0\"\\\n  \"Uitzoomen\\0\"\\\n  \"Zoomniveau\\0\"\\\n  \"[Bestand gewijzigd; verversen] %s\\0\"\\\n  \"tekst kopi\\303\\253ren\\0\"\\\n  \"document afdrukken\\0\";\n\nconst char * gTranslations_et = \n  \"&Programmi teave\\0\"\\\n  \"&Tegelik suurus\\tCtrl+1\\0\"\\\n  \"&Rohkem s\\303\\244tteid...\\0\"\\\n  \"K\\303\\265ik v&alitud lehed\\0\"\\\n  \"&Tagasi\\tAlt+Vasaknool\\0\"\\\n  \"&Raamatuvaade\\tCtrl+8\\0\"\\\n  \"&Sulge\\tCtrl+W\\0\"\\\n  \"K&opeeri valik\\0\"\\\n  \"K&opeeri valik\\tCtrl+C\\0\"\\\n  \"\\303\\204&ra k\\303\\274si uuesti\\0\"\\\n  \"Vaid paa&rislehek\\303\\274ljed\\0\"\\\n  \"&Kahelehek\\303\\274ljeline\\tCtrl+7\\0\"\\\n  \"&Fail\\0\"\\\n  \"&Otsitav:\\0\"\\\n  \"E&simene lehek\\303\\274lg\\tHome\\0\"\\\n  \"&Sobita lehek\\303\\274ljed prinditavale alale\\0\"\\\n  \"&Liigu\\0\"\\\n  \"&Lehek\\303\\274ljele:\\0\"\\\n  \"&Abi\\0\"\\\n  \"&Viimane lehek\\303\\274lg\\tEnd\\0\"\\\n  \"&Suurendus:\\0\"\\\n  \"K&asutusjuhend\\0\"\\\n  \"&T\\303\\265stutundlik\\0\"\\\n  \"&J\\303\\244rgmine lehek\\303\\274lg\\tParemnool\\0\"\\\n  \"&Ei\\0\"\\\n  \"&T\\303\\244nan, ei\\0\"\\\n  \"Vaid &paaritud lehek\\303\\274ljed\\0\"\\\n  \"&Ava dokument\\0\"\\\n  \"&Ava...\\tCtrl+O\\0\"\\\n  \"&S\\303\\244tted...\\0\"\\\n  \"&Salas\\303\\265na:\\0\"\\\n  \"&Kinnita dokument\\0\"\\\n  \"&Eelmine lehek\\303\\274lg\\tVasaknool\\0\"\\\n  \"&Prindi...\\0\"\\\n  \"&Prindi...\\tCtrl+P\\0\"\\\n  \"&Prindi... (keelatud)\\0\"\\\n  \"&J\\303\\244ta meelde selle dokumendi salas\\303\\265na\\0\"\\\n  \"Dokumendi sulgemisel j\\303\\244etakse &meelde k\\303\\274ljendi s\\303\\244tted\\0\"\\\n  \"&Kustuta dokument\\0\"\\\n  \"Salvesta &kui...\\0\"\\\n  \"Salvesta &kui...\\tCtrl+S\\0\"\\\n  \"Sea&distused\\0\"\\\n  \"Mahuta lehek\\303\\274ljed pr&inditavale alale (kui vaja)\\0\"\\\n  \"\\303\\234&helehek\\303\\274ljeline\\tCtrl+6\\0\"\\\n  \"&J\\303\\244ta see versioon vahele\\0\"\\\n  \"&Kasuta algseid lehek\\303\\274lje suuruseid\\0\"\\\n  \"&Vaade\\0\"\\\n  \"A&ken\\0\"\\\n  \"&Jah\\0\"\\\n  \"&Suurendus\\0\"\\\n  \"(%d:st)\\0\"\\\n  \"(lehek\\303\\274lg %s)\\0\"\\\n  \"Info SumatraPDF kohta\\0\"\\\n  \"Lisa lemmik\\0\"\\\n  \"Lisa lehek\\303\\274lg %s lemmikutesse\\0\"\\\n  \"Lisa lehek\\303\\274lg %s lemmikutesse (valikulise) nimega:\\0\"\\\n  \"Lisa lemmikutesse\\0\"\\\n  \"Muud\\0\"\\\n  \"K\\303\\265ik failid\\0\"\\\n  \"K\\303\\265ik toetatud vormingud\\0\"\\\n  \"Rakendus:\\0\"\\\n  \"Seosta PDF-failidega?\\0\"\\\n  \"Manus: %s\\0\"\\\n  \"Autor:\\0\"\\\n  \"Automaatne\\0\"\\\n  \"Uuendusi k&ontrollitakse automaatselt\\0\"\\\n  \"Raamatuvaade\\0\"\\\n  \"J\\303\\244r&jehoidjad\\tF12\\0\"\\\n  \"J\\303\\244rjehoidjate otseteed\\0\"\\\n  \"Tee j\\303\\244rjehoidja otsetee lehek\\303\\274ljele %s/%s\\0\"\\\n  \"J\\303\\244rjehoidjad\\0\"\\\n  \"Baiti\\0\"\\\n  \"CHM-dokumendid\\0\"\\\n  \"Interneti\\303\\274henduse loomine eba\\303\\265nnestus (viga %#x).\\0\"\\\n  \"Loobu\\0\"\\\n  \"Faili printimine eba\\303\\265nnestus\\0\"\\\n  \"P\\303\\266\\303\\266ratud otsingu alustamine eba\\303\\265nnestus. Kontrolli seadistustest k\\303\\244surida.\\0\"\\\n  \"Vali keel (Change Language)\\0\"\\\n  \"Vaata, kas on &uuendusi\\0\"\\\n  \"Koomiksiraamatud\\0\"\\\n  \"\\303\\234hilduvus\\0\"\\\n  \"J\\303\\244tkuv\\0\"\\\n  \"J\\303\\244tkuv raamatuvaade\\0\"\\\n  \"J\\303\\244tkuv kahelehek\\303\\274ljeline\\0\"\\\n  \"Osale t\\303\\265lkimises\\0\"\\\n  \"Kopeeri &pilt\\0\"\\\n  \"Kopeeri &lingi aadress\\0\"\\\n  \"Kopeeri ko&mmentaar\\0\"\\\n  \"Teksti kopeerimine on keelatud (kopeerida saab vaid pildina)\\0\"\\\n  \"Autori\\303\\265igus:\\0\"\\\n  \"Printeri s\\303\\244tteid ei \\303\\265nnestunud lugeda\\0\"\\\n  \"Printerit ei saa l\\303\\244htestada\\0\"\\\n  \"Lehek\\303\\274lje visualiseerimine ei \\303\\265nnestunud\\0\"\\\n  \"Loodud:\\0\"\\\n  \"Praegune fail\\0\"\\\n  \"Kursori asukoht\\0\"\\\n  \"&Muu suurendus...\\tCtrl+Y\\0\"\\\n  \"Vaike&k\\303\\274ljend:\\0\"\\\n  \"Vaike&suurendus:\\0\"\\\n  \"PDF-failide vaikeprogrammi ei saa muuta portatiivses re\\305\\276iimis\\0\"\\\n  \"Keelatud \\303\\265igused:\\0\"\\\n  \"DjVu-dokumendid\\0\"\\\n  \"Dokumendi omadused\\0\"\\\n  \"Laadi alla\\0\"\\\n  \"V\\303\\244l&ju\\tCtrl+Q\\0\"\\\n  \"EPUB-dokumendid\\0\"\\\n  \"Sisesta salas\\303\\265na\\0\"\\\n  \"Sisesta faili %s salas\\303\\265na\\0\"\\\n  \"Sisesta k\\303\\244surida, mis k\\303\\244ivitatakse, kui teed topeltkl\\303\\265psu PDF dokumendil:\\0\"\\\n  \"Viga laadimisel: %s\\0\"\\\n  \"L&emmikud\\0\"\\\n  \"E&dasi\\tAlt+Paremnool\\0\"\\\n  \"&T\\303\\244isekraanvaade\\tCtrl+Shift+L\\0\"\\\n  \"Kahelehek\\303\\274ljeline\\0\"\\\n  \"Faili \\303\\274mbernimetamine eba\\303\\265nnestus.\\0\"\\\n  \"Faili salvestamine eba\\303\\265nnestus\\0\"\\\n  \"Kiire veebivaade\\0\"\\\n  \"Lemmikud\\0\"\\\n  \"FictionBook-dokumendid\\0\"\\\n  \"Faili %s ei leitud\\0\"\\\n  \"Faili suurus:\\0\"\\\n  \"Fail:\\0\"\\\n  \"&Otsi...\\tCtrl+F\\0\"\\\n  \"Otsi\\0\"\\\n  \"Otsi j\\303\\244rgmine\\0\"\\\n  \"Otsi eelmine\\0\"\\\n  \"Otsing:\\0\"\\\n  \"&Sisu sobitamine\\tCtrl+3\\0\"\\\n  \"Lehek\\303\\274lje &k\\303\\265rguse sobitamine\\tCtrl+0\\0\"\\\n  \"Lehek\\303\\274lje &laiuse sobitamine\\tCtrl+2\\0\"\\\n  \"Sisu sobitamine\\0\"\\\n  \"Lehek\\303\\274lje k\\303\\265rguse sobitamine\\0\"\\\n  \"Lehek\\303\\274lje laiuse sobitamine\\0\"\\\n  \"Sobita lehek\\303\\274lje laius ja n\\303\\244ita j\\303\\244tkuvana\\0\"\\\n  \"Sobita \\303\\274ksik lehek\\303\\274lg\\0\"\\\n  \"Fondid:\\0\"\\\n  \"Raamatu vormindamine... %d lehek\\303\\274lge\\0\"\\\n  \"Leiti tekst lehek\\303\\274ljel %s\\0\"\\\n  \"Leiti tekst lehek\\303\\274ljel %s (uuesti)\\0\"\\\n  \"Sageli loetud dokumendid\\0\"\\\n  \"\\0\"\\\n  \"Liigu lehek\\303\\274ljele\\0\"\\\n  \"Peida sageli loetud dokumendid\\0\"\\\n  \"Soovitus: Uuesti otsimiseks vajuta F3-klahvi\\0\"\\\n  \"Pildifailid (*.%s)\\0\"\\\n  \"kB\\0\"\\\n  \"\\0\"\\\n  \"Tee SumatraPDF PDF-failide vaikerakenduseks?\\0\"\\\n  \"Tee SumatraPDF PDF-failide vaikerakenduseks\\0\"\\\n  \"Man&gare\\305\\276iim\\0\"\\\n  \"T\\303\\265stutundlik\\0\"\\\n  \"Mobi-dokumendid\\0\"\\\n  \"Muudetud:\\0\"\\\n  \"Uus %s versioon on saadaval. Kas laadin alla uue versiooni?\\0\"\\\n  \"J\\303\\244rgmine lehek\\303\\274lg\\0\"\\\n  \"Otsitavat teksti ei leitud\\0\"\\\n  \"Tulemusi ei leitud rea %u l\\303\\244hedalt failis %s\\0\"\\\n  \"S\\303\\274nkroniserimisfaili ei leitud\\0\"\\\n  \"Sellel kohal ei ole s\\303\\274nkroniseerimisinfot\\0\"\\\n  \"Lehek\\303\\274lgede arv:\\0\"\\\n  \"Sobib\\0\"\\\n  \"Ava\\0\"\\\n  \"Ava PDF-XChangega\\0\"\\\n  \"Ava dokument...\\0\"\\\n  \"Ava rakenduses %s\\0\"\\\n  \"Ava &Adobe Readeris\\0\"\\\n  \"Ava &Foxit Readeris\\0\"\\\n  \"Ava Microsoft HTML Helpga\\0\"\\\n  \"Ava Microsoft XPS-Viewerga\\0\"\\\n  \"O&madused\\0\"\\\n  \"O&madused\\tCtrl+D\\0\"\\\n  \"PDF-dokument\\0\"\\\n  \"PDF-i optimeerimised:\\0\"\\\n  \"PDF-i looja:\\0\"\\\n  \"PDF-i versioon:\\0\"\\\n  \"PDF-dokumendid\\0\"\\\n  \"&Lehek\\303\\274lg...\\tCtrl+G\\0\"\\\n  \"Lehek\\303\\274lg %s\\0\"\\\n  \"Lehek\\303\\274lje suurus:\\0\"\\\n  \"Lehek\\303\\274lge number %u ei ole olemas\\0\"\\\n  \"Lehek\\303\\274lje mastaapimine\\0\"\\\n  \"Lehek\\303\\274lg:\\0\"\\\n  \"PalmDoc-dokumendid\\0\"\\\n  \"Palun oota - toimub visualiseerimine...\\0\"\\\n  \"Postscript-dokumendid\\0\"\\\n  \"&Esitlus\\tCtrl+L\\0\"\\\n  \"Eelmine lehek\\303\\274lg\\0\"\\\n  \"Prindi\\0\"\\\n  \"Printimisvahemik\\0\"\\\n  \"Antud nimega printerit ei leidu\\0\"\\\n  \"Printimine on pooleli.\\0\"\\\n  \"Printimine on pooleli. Kas katkestada ja alustada uuesti?\\0\"\\\n  \"Printimine on pooleli. Kas katkestada ja alustada uuesti?\\0\"\\\n  \"Lehek\\303\\274lje %d/%d printimine...\\0\"\\\n  \"Probleem printimisel\\0\"\\\n  \"&Nimeta \\303\\274mber...\\tF2\\0\"\\\n  \"J\\303\\244ta &avatud failid meelde\\0\"\\\n  \"Kustuta lemmikutest\\0\"\\\n  \"Kustuta lehek\\303\\274lg %s lemmikutest\\0\"\\\n  \"Nimeta \\303\\274mber\\0\"\\\n  \"P\\303\\266\\303\\266ra &vasemale\\tCtrl+Shift+-\\0\"\\\n  \"P\\303\\266\\303\\266ra &paremale\\tCtrl+Shift++\\0\"\\\n  \"Salvesta kui...\\0\"\\\n  \"Salvesta &otsetee...\\tCtrl+Shift+S\\0\"\\\n  \"Otsitakse %d/%d...\\0\"\\\n  \"V&ali k\\303\\265ik\\0\"\\\n  \"V&ali k\\303\\265ik\\tCtrl+A\\0\"\\\n  \"Sisu valimiseks Ctrl+vasak hiirenupp\\0\"\\\n  \"Valik:\\0\"\\\n  \"Saada &e-postiga\\0\"\\\n  \"Loo p\\303\\266\\303\\266ratud otsingu k\\303\\244surida\\0\"\\\n  \"N\\303\\244ita &j\\303\\244rjehoidjaid\\0\"\\\n  \"N\\303\\244ita &lehek\\303\\274lgi pidevana\\0\"\\\n  \"&N\\303\\244ita t\\303\\266\\303\\266riistariba\\0\"\\\n  \"N\\303\\244ita lemmikuid\\0\"\\\n  \"N\\303\\244ita sageli loetud dokumente\\0\"\\\n  \"N\\303\\244ita &j\\303\\244rjehoidjate k\\303\\274lgriba kui v\\303\\265imalik\\0\"\\\n  \"\\303\\234helehek\\303\\274ljeline\\0\"\\\n  \"Vabandust, seda ei oleks tohtinud juhtuda!\\n\\nPalun vajuta 'Loobu' kui soovid aidata meil parandada selle kokkujooksmise p\\303\\265hjust.\\0\"\\\n  \"L\\303\\244htefailil %s puudub s\\303\\274nkroniseerimispunkt\\0\"\\\n  \"Teema:\\0\"\\\n  \"SumatraPDF-i s\\303\\244tted\\0\"\\\n  \"SumatraPDF-i uuendamine\\0\"\\\n  \"SumatraPDF jooksis kokku\\0\"\\\n  \"SumatraPDF on vaikimisi PDF-lehitseja\\0\"\\\n  \"SumatraPDF peaks n\\303\\274\\303\\274d olema vaikimisi PDF-lehitseja\\0\"\\\n  \"S\\303\\274nkroniseerimisfaili ei suudeta avada\\0\"\\\n  \"Siltidega PDF\\0\"\\\n  \"Tekstidokumendid\\0\"\\\n  \"See dokument sisaldab omadusi (%s), mida program ei toeta ja seet\\303\\265ttu ei pruugi see olla \\303\\265igesti esitatud.\\0\"\\\n  \"P\\303\\244is:\\0\"\\\n  \"Tundmatu l\\303\\244htefail (%s)\\0\"\\\n  \"Kasuta &kaarte\\0\"\\\n  \"Vaade\\0\"\\\n  \"&K\\303\\274lasta kodulehte\\0\"\\\n  \"Hoiatus\\0\"\\\n  \"XPS-dokumendid\\0\"\\\n  \"Kasutusel on uusim versioon.\\0\"\\\n  \"Kasutusel on versioon %s\\0\"\\\n  \"Suurenda\\0\"\\\n  \"Suurenda\\0\"\\\n  \"V\\303\\244henda\\0\"\\\n  \"Suurendusaste\\0\"\\\n  \"[Leiti muutuseid; v\\303\\244rskendamine] %s\\0\"\\\n  \"teksti kopeerimine\\0\"\\\n  \"dokumendi printimine\\0\";\n\nconst char * gTranslations_fi = \n  \"&Tietoja\\0\"\\\n  \"&Todellinen koko\\tCtrl+1\\0\"\\\n  \"&Lis\\303\\244asetukset...\\0\"\\\n  \"K&aikki valitut sivut\\0\"\\\n  \"&Takaisin\\tAlt+Vasen nuoli\\0\"\\\n  \"&Kirjan\\303\\244kym\\303\\244\\tCtrl+8\\0\"\\\n  \"&Sulje\\tCtrl+W\\0\"\\\n  \"Kopioi &valinta\\0\"\\\n  \"Ko&pioi valinta\\tCtrl+C\\0\"\\\n  \"\\303\\204&l\\303\\244 kysy uudestaan\\0\"\\\n  \"Vain pa&rilliset sivut\\0\"\\\n  \"&Rinnakkain\\tCtrl+7\\0\"\\\n  \"&Tiedosto\\0\"\\\n  \"&Etsitt\\303\\244v\\303\\244:\\0\"\\\n  \"E&nsimm\\303\\244inen sivu\\tHome\\0\"\\\n  \"&Sovita sivut tulostettavalle alueelle\\0\"\\\n  \"&Siirry\\0\"\\\n  \"&Siirry sivulle:\\0\"\\\n  \"&Ohje\\0\"\\\n  \"&Viimeinen sivu\\tEnd\\0\"\\\n  \"&Suurennus:\\0\"\\\n  \"&K\\303\\244ytt\\303\\266ohje\\0\"\\\n  \"Sama kirjainkoko\\0\"\\\n  \"&Seuraava sivu\\tOikea nuoli\\0\"\\\n  \"&Ei\\0\"\\\n  \"&Ei kiitos\\0\"\\\n  \"Vain &parittomat sivut\\0\"\\\n  \"&Avaa asiakirja\\0\"\\\n  \"&Avaa...\\tCtrl+O\\0\"\\\n  \"&Asetukset...\\0\"\\\n  \"&Salasana\\0\"\\\n  \"&Kiinnit\\303\\244 asiakirja\\0\"\\\n  \"&Edellinen sivu\\tVasen nuoli\\0\"\\\n  \"&Tulosta...\\0\"\\\n  \"&Tulosta...\\tCtrl+P\\0\"\\\n  \"&Tulosta... (kielletty)\\0\"\\\n  \"&Muista t\\303\\244m\\303\\244n asiakirjan salasana\\0\"\\\n  \"&Muista n\\303\\244m\\303\\244 asetukset jokaiselle asiakirjalle\\0\"\\\n  \"&Poista asiakirja\\0\"\\\n  \"Tallenna &nimell\\303\\244...\\0\"\\\n  \"Tallenna &nimell\\303\\244...\\tCtrl+S\\0\"\\\n  \"&Asetukset\\0\"\\\n  \"P&ienenn\\303\\244 sivut tulostettavalle alueelle (jos tarpeellista)\\0\"\\\n  \"&Yksitt\\303\\244inen sivu\\tCtrl+6\\0\"\\\n  \"&Ohita t\\303\\244m\\303\\244 versio\\0\"\\\n  \"&K\\303\\244yt\\303\\244 alkuper\\303\\244isi\\303\\244 sivukokoja\\0\"\\\n  \"&N\\303\\244yt\\303\\244\\0\"\\\n  \"Ikkuna\\0\"\\\n  \"&Kyll\\303\\244\\0\"\\\n  \"&Zoomaus\\0\"\\\n  \"(%d:st\\303\\244)\\0\"\\\n  \"(sivu %s)\\0\"\\\n  \"Tietoja SumatraPDF:st\\303\\244\\0\"\\\n  \"Lis\\303\\244\\303\\244 suosikki\\0\"\\\n  \"&Lis\\303\\244\\303\\244 sivu %s suosikkeihin\\0\"\\\n  \"Lis\\303\\244\\303\\244 sivu %s suosikkeihin (valinnaisella) nimell\\303\\244:\\0\"\\\n  \"Lis\\303\\244\\303\\244 suosikkeihin\\0\"\\\n  \"Lis\\303\\244asetukset\\0\"\\\n  \"Kaikki tiedostot\\0\"\\\n  \"Kaikki tuetut asiakirjat\\0\"\\\n  \"Ohjelma:\\0\"\\\n  \"Tiedostosidos PDF-tiedostoihin?\\0\"\\\n  \"Liite: %s\\0\"\\\n  \"Tekij\\303\\244:\\0\"\\\n  \"Automaattinen\\0\"\\\n  \"Tarkista p\\303\\244&ivitykset automaattisesti\\0\"\\\n  \"Kirjan\\303\\244kym\\303\\244\\0\"\\\n  \"K&irjanmerkit\\tF12\\0\"\\\n  \"Pikakuvakkeet\\0\"\\\n  \"Tee pikakuvake sivulle %s/%s\\0\"\\\n  \"Kirjanmerkit\\0\"\\\n  \"tavua\\0\"\\\n  \"CHM-asiakirjat\\0\"\\\n  \"Internetiin yhdist\\303\\244minen ep\\303\\244onnistui (virhe %#x).\\0\"\\\n  \"Peruuta\\0\"\\\n  \"T\\303\\244m\\303\\244n tiedoston tulostaminen ep\\303\\244onnistui\\0\"\\\n  \"K\\303\\244\\303\\244nteisen hakukomennon aloittaminen ep\\303\\244onnistui. Tarkista komentorivi asetuksista.\\0\"\\\n  \"Valitse kieli (Change Language)\\0\"\\\n  \"Tarkista &p\\303\\244ivitysten saatavuus\\0\"\\\n  \"Sarjakuvat\\0\"\\\n  \"Yhteensopivuus\\0\"\\\n  \"Per\\303\\244kk\\303\\244in\\0\"\\\n  \"Kirjan\\303\\244kym\\303\\244, per\\303\\244kk\\303\\244in\\0\"\\\n  \"Per\\303\\244kk\\303\\244in ja rinnakkain\\0\"\\\n  \"Osallistu suomennosprojektiin\\0\"\\\n  \"Kopioi &kuva\\0\"\\\n  \"Kopioi &linkin osoite\\0\"\\\n  \"Kopioi kommentti\\0\"\\\n  \"Tekstin kopioiminen kiellettiin (kopioidaan vain kuvana)\\0\"\\\n  \"\\0\"\\\n  \"Tulostimen ominaisuuksia ei voinut lukea\\0\"\\\n  \"Tulostimen valmistelu ep\\303\\244onnistui\\0\"\\\n  \"Sivun tulkinta ep\\303\\244onnistui\\0\"\\\n  \"Luotu:\\0\"\\\n  \"Nykyinen tiedosto\\0\"\\\n  \"Kohdistimen sijainti:\\0\"\\\n  \"&Mukautettu zoomaustaso...\\tCtrl+Y\\0\"\\\n  \"Oletus&tyyli:\\0\"\\\n  \"Oletus&zoomaus:\\0\"\\\n  \"PDF-oletuslukijaa ei voi vaihtaa kannettavassa tilassa\\0\"\\\n  \"Kielletyt oikeudet:\\0\"\\\n  \"DjVu-asiakirjat\\0\"\\\n  \"Asiakirjan ominaisuudet\\0\"\\\n  \"Lataa\\0\"\\\n  \"&Lopeta\\tCtrl+Q\\0\"\\\n  \"EPUB-asiakirjat\\0\"\\\n  \"Kirjoita salasana\\0\"\\\n  \"Kirjoita tiedoston %s salasana\\0\"\\\n  \"Anna komentorivin komento, joka ajetaan kun PDF-asiakirjaa kaksoisnapsautetaan:\\0\"\\\n  \"Virhe ladattaessa: %s\\0\"\\\n  \"S&uosikit\\0\"\\\n  \"Se&uraava\\tAlt+Oikea nuoli\\0\"\\\n  \"Koko &n\\303\\244ytt\\303\\266\\tCtrl+Shift+L\\0\"\\\n  \"Rinnakkain\\0\"\\\n  \"Tiedoston uudelleennime\\303\\244minen ep\\303\\244onnistui!\\0\"\\\n  \"Tiedoston tallennus ep\\303\\244onnistui\\0\"\\\n  \"Nopea web-n\\303\\244kym\\303\\244\\0\"\\\n  \"suosikit\\0\"\\\n  \"FictionBook-asiakirjat\\0\"\\\n  \"Tiedosto %s ei l\\303\\266ydy\\0\"\\\n  \"Tiedoston koko:\\0\"\\\n  \"Tiedosto:\\0\"\\\n  \"Ets&i...\\tCtrl+F\\0\"\\\n  \"Etsi\\0\"\\\n  \"Etsi seuraava\\0\"\\\n  \"Etsi edellinen\\0\"\\\n  \"Etsi:\\0\"\\\n  \"&Sovita sis\\303\\244lt\\303\\266\\tCtrl+3\\0\"\\\n  \"Sovita sivu &pystysuunnassa\\tCtrl+0\\0\"\\\n  \"Sovita sivu &vaakasuunnassa\\tCtrl+2\\0\"\\\n  \"Sovita sis\\303\\244lt\\303\\266\\0\"\\\n  \"Sovita sivu pystysuunnassa\\0\"\\\n  \"Sovita sivu vaakasuunnassa\\0\"\\\n  \"Sovita leveys ja n\\303\\244yt\\303\\244 sivut per\\303\\244kk\\303\\244in\\0\"\\\n  \"Sovita yksitt\\303\\244inen sivu\\0\"\\\n  \"Fontit:\\0\"\\\n  \"Muotoillaan kirjaa... %d sivua\\0\"\\\n  \"Teksti\\303\\244 l\\303\\266ytyi sivulta %s\\0\"\\\n  \"Teksti l\\303\\266ytyi sivulta %s (uudelleen)\\0\"\\\n  \"Usein luetut\\0\"\\\n  \"Gt\\0\"\\\n  \"Siirry sivulle\\0\"\\\n  \"Piilota usein luetut\\0\"\\\n  \"Vihje: K\\303\\244yt\\303\\244 F3-n\\303\\244pp\\303\\244int\\303\\244 etsi\\303\\244ksesi uudestaan\\0\"\\\n  \"Kuvatiedostot (*.%s)\\0\"\\\n  \"Kt\\0\"\\\n  \"Mt\\0\"\\\n  \"Tee SumatraPDF:st\\303\\244 PDF-asiakirjojen oletuslukuohjelma?\\0\"\\\n  \"Tee SumatraPDF:st\\303\\244 PDF-asiakirjojen oletuslukuohjelma\\0\"\\\n  \"Man&ga-moodi\\0\"\\\n  \"Sama kirjainkoko\\0\"\\\n  \"Mobi-asiakirjat\\0\"\\\n  \"Muuttanut:\\0\"\\\n  \"Uudempi versio %s saatavilla. Ladataanko uudempi versio?\\0\"\\\n  \"Seuraava sivu\\0\"\\\n  \"Osumia ei l\\303\\266ytynyt\\0\"\\\n  \"Tulosta ei l\\303\\266ytynyt rivin %u ymp\\303\\244rilt\\303\\244 tiedostossa %s\\0\"\\\n  \"Synkronointitiedostoa ei l\\303\\266ytynyt\\0\"\\\n  \"T\\303\\244ll\\303\\244 sijainnilla ei ole synkronisointitietoja\\0\"\\\n  \"Sivujen m\\303\\244\\303\\244r\\303\\244:\\0\"\\\n  \"\\0\"\\\n  \"Avaa\\0\"\\\n  \"Avaa PDF-XChange\\0\"\\\n  \"Avaa asiakirja...\\0\"\\\n  \"Avaa ohjelmassa %s\\0\"\\\n  \"Avaa &Adobe Readerissa\\0\"\\\n  \"Avaa &Foxit Readerissa\\0\"\\\n  \"Avaa Microsoft HTML Help\\0\"\\\n  \"Avaa Microsoft XPS-Viewer\\0\"\\\n  \"Ominaisuudet\\0\"\\\n  \"O&minaisuudet\\tCtrl+D\\0\"\\\n  \"PDF-asiakirja\\0\"\\\n  \"PDF-optimoinnit:\\0\"\\\n  \"PDF-tuottaja:\\0\"\\\n  \"PDF-versio:\\0\"\\\n  \"PDF-asiakirjat\\0\"\\\n  \"Si&vulle...\\tCtrl+G\\0\"\\\n  \"Sivu %s\\0\"\\\n  \"Sivun koko:\\0\"\\\n  \"Sivunumeroa %u ei ole olemassa\\0\"\\\n  \"Sivun skaalaus\\0\"\\\n  \"Sivu:\\0\"\\\n  \"PalmDoc-asiakirjat\\0\"\\\n  \"Odota - tulkitaan...\\0\"\\\n  \"Postscript-asiakirjat\\0\"\\\n  \"&Esitys\\tCtrl+L\\0\"\\\n  \"Edellinen sivu\\0\"\\\n  \"Tulosta\\0\"\\\n  \"Tulostusalue\\0\"\\\n  \"Annetun nimist\\303\\244 tulostinta ei ole\\0\"\\\n  \"Tulostaminen k\\303\\244ynniss\\303\\244.\\0\"\\\n  \"Tulostaminen on edelleen k\\303\\244ynniss\\303\\244. Keskeyt\\303\\244 ja lopeta?\\0\"\\\n  \"Tulostaminen on viel\\303\\244 k\\303\\244ynniss\\303\\244. Keskeytet\\303\\244\\303\\244nk\\303\\266 ja aloitetaan uudelleen?\\0\"\\\n  \"Tulostetaan sivua %d/%d...\\0\"\\\n  \"Tulostusongelma\\0\"\\\n  \"&Uudelleennime\\303\\244...\\tF2\\0\"\\\n  \"Muista &avatut tiedostot\\0\"\\\n  \"&Poista suosikeista\\0\"\\\n  \"Poista sivu %s suosikeista\\0\"\\\n  \"Uudelleennime\\303\\244\\0\"\\\n  \"K\\303\\244\\303\\244nn\\303\\244 &vasemmalle\\tCtrl+Shift+-\\0\"\\\n  \"K\\303\\244\\303\\244nn\\303\\244 &oikealle\\tCtrl+Shift++\\0\"\\\n  \"Tallenna nimell\\303\\244\\0\"\\\n  \"Tallenna p&ikakuvake...\\tCtrl+Shift+S\\0\"\\\n  \"Etsit\\303\\244\\303\\244n %d/%d...\\0\"\\\n  \"V&alitse kaikki\\0\"\\\n  \"V&alitse kaikki\\tCtrl+A\\0\"\\\n  \"Valitse sis\\303\\244lt\\303\\266\\303\\244 Ctrl+vasemmanpuoleinen hiiren painike\\0\"\\\n  \"Valinta:\\0\"\\\n  \"L\\303\\244&het\\303\\244 s\\303\\244hk\\303\\266postilla\\0\"\\\n  \"Aseta k\\303\\244\\303\\244nteinen haku komentorivill\\303\\244\\0\"\\\n  \"N\\303\\244yt\\303\\244 &Kirjanmerkit\\0\"\\\n  \"N\\303\\244yt\\303\\244 &sivut per\\303\\244kk\\303\\244in\\0\"\\\n  \"N\\303\\244yt\\303\\244 &ty\\303\\266kalupalkki\\0\"\\\n  \"&N\\303\\244yt\\303\\244 suosikit\\0\"\\\n  \"N\\303\\244yt\\303\\244 usein luetut\\0\"\\\n  \"N\\303\\244yt\\303\\244 &kirjanmerkit sivupalkissa, kun saatavilla\\0\"\\\n  \"Yksitt\\303\\244inen sivu\\0\"\\\n  \"Pahoittelut, jotain odottamatonta tapahtui!\\n\\nPaina 'Peruuta' jos haluat auttaa tekij\\303\\266it\\303\\244 korjaamaan t\\303\\244m\\303\\244n virheen.\\0\"\\\n  \"L\\303\\244hdetiedostolla %s ei ole synkronointikohtaa\\0\"\\\n  \"Otsikko:\\0\"\\\n  \"SumatraPDF:n asetukset\\0\"\\\n  \"SumatraPDF:n p\\303\\244ivitys\\0\"\\\n  \"SumatraPDF kaatui\\0\"\\\n  \"SumatraPDF on oletuslukijasi PDF-asiakirjoille\\0\"\\\n  \"SumatraPDF:n pit\\303\\244isi nyt olla oletuslukijasi PDF-asiakirjoille\\0\"\\\n  \"Synkronisointitiedostoa ei voitu avata\\0\"\\\n  \"Merkitty PDF\\0\"\\\n  \"Tekstiasiakirjat\\0\"\\\n  \"Asiakirja k\\303\\244ytt\\303\\244\\303\\244 ei-tuettuja ominaisuuksia (%s) ja ei ehk\\303\\244 n\\303\\244y oikein.\\0\"\\\n  \"Otsikko:\\0\"\\\n  \"Tuntematon l\\303\\244hdetiedosto (%s)\\0\"\\\n  \"K\\303\\244yt\\303\\244 v\\303\\244lilehti\\303\\244\\0\"\\\n  \"N\\303\\244yt\\303\\244\\0\"\\\n  \"&Vieraile ohjelman kotisivuilla\\0\"\\\n  \"Varoitus\\0\"\\\n  \"XPS-asiakirjat\\0\"\\\n  \"Sinulla on uusin versio.\\0\"\\\n  \"Sinulla on versio %s\\0\"\\\n  \"Zoomaus\\0\"\\\n  \"L\\303\\244henn\\303\\244\\0\"\\\n  \"Loitonna\\0\"\\\n  \"Zoomaustaso\\0\"\\\n  \"[Muutoksia tunnistettiin; p\\303\\244ivitet\\303\\244\\303\\244n] %s\\0\"\\\n  \"Tekstin kopiointi\\0\"\\\n  \"tulostetaan asiakirjaa\\0\";\n\nconst char * gTranslations_fr = \n  \"&\\303\\200 propos\\0\"\\\n  \"&Taille r\\303\\251elle\\tCtrl+1\\0\"\\\n  \"Options &avanc\\303\\251es\\342\\200\\246\\0\"\\\n  \"&Toutes les pages s\\303\\251lectionn\\303\\251es\\0\"\\\n  \"&Retour\\tAlt+<-\\0\"\\\n  \"Comme un livre\\tCtrl+8\\0\"\\\n  \"&Fermer\\tCtrl+W\\0\"\\\n  \"&Copier la s\\303\\251lection\\0\"\\\n  \"&Copier la s\\303\\251lection\\0\"\\\n  \"&Ne plus me demander\\0\"\\\n  \"Seulement les pages &paires\\0\"\\\n  \"Double page\\tCtrl+7\\0\"\\\n  \"&Fichier\\0\"\\\n  \"&Rechercher quoi\\302\\240:\\0\"\\\n  \"P&remi\\303\\250re page\\tHome\\0\"\\\n  \"&Ajuster les pages \\303\\240 la zone d'impression\\0\"\\\n  \"A&ller \\342\\200\\246\\0\"\\\n  \"&Aller \\303\\240 la page\\302\\240:\\0\"\\\n  \"Ai&de\\0\"\\\n  \"&Derni\\303\\250re page\\tEnd\\0\"\\\n  \"&Grossissement\\302\\240:\\0\"\\\n  \"&Manuel\\0\"\\\n  \"&Respecter la casse\\0\"\\\n  \"Page &suivante\\t->\\0\"\\\n  \"&Non\\0\"\\\n  \"&Non, merci\\0\"\\\n  \"Seulement les pages &impaires\\0\"\\\n  \"&Ouvrir le document\\0\"\\\n  \"&Ouvrir...\\tCtrl+O\\0\"\\\n  \"\\0\"\\\n  \"&Mot de passe\\302\\240:\\0\"\\\n  \"Ajouter le document \\303\\240 la liste\\0\"\\\n  \"Page &pr\\303\\251c\\303\\251dente\\t<-\\0\"\\\n  \"Im&primer...\\0\"\\\n  \"&Imprimer...\\tCtrl+P\\0\"\\\n  \"&Imprimer... (Interdit)\\0\"\\\n  \"&Se rappeler le mot de passe pour ce document\\0\"\\\n  \"&Se rappeler ces param\\303\\250tres pour chaque document\\0\"\\\n  \"&Retirer le document de la liste\\0\"\\\n  \"&Enregistrer sous...\\0\"\\\n  \"&Enregistrer sous...\\tCtrl+S\\0\"\\\n  \"&Pr\\303\\251f\\303\\251rences\\0\"\\\n  \"&R\\303\\251duire les pages \\303\\240 la zone d'impression (si n\\303\\251cessaire)\\0\"\\\n  \"Une &seule page\\tCtrl+6\\0\"\\\n  \"&Ignorer cette version\\0\"\\\n  \"&Utiliser les dimensions d'origine\\0\"\\\n  \"&Affichage\\0\"\\\n  \"F&en\\303\\252tre\\0\"\\\n  \"&Oui\\0\"\\\n  \"\\0\"\\\n  \"(de %d)\\0\"\\\n  \"\\0\"\\\n  \"\\303\\200 propos de SumatraPDF\\0\"\\\n  \"Ajouter aux favoris\\0\"\\\n  \"Ajouter la page %s aux favoris\\0\"\\\n  \"Ajouter la page %s aux favoris avec un nom (optionnel):\\0\"\\\n  \"Ajouter aux favoris\\0\"\\\n  \"Avanc\\303\\251\\0\"\\\n  \"Tous les fichiers\\0\"\\\n  \"Tous les documents pris en charge\\0\"\\\n  \"Application\\302\\240:\\0\"\\\n  \"Associer aux fichiers PDF\\302\\240?\\0\"\\\n  \"Fichier joint\\302\\240: %s\\0\"\\\n  \"Auteur\\302\\240:\\0\"\\\n  \"Automatique\\0\"\\\n  \"V\\303\\251rifier &automatiquement les mises \\303\\240 jour\\0\"\\\n  \"Comme un livre\\0\"\\\n  \"Signets\\tF12\\0\"\\\n  \"Raccourcis des signets\\0\"\\\n  \"Raccourci du signet de la page %s de %s\\0\"\\\n  \"Signets\\0\"\\\n  \"Octets\\0\"\\\n  \"Fichiers d'aide CHM\\0\"\\\n  \"Impossible de se connecter \\303\\240 Internet (erreur %#x)\\0\"\\\n  \"Annuler\\0\"\\\n  \"Impossible d'imprimer ce fichier\\0\"\\\n  \"Impossible de lancer le programme configur\\303\\251 pour la recherche inverse. Veuillez v\\303\\251rifier la ligne de commande sp\\303\\251cifi\\303\\251e dans les options.\\0\"\\\n  \"Changer de langue (Change Language)\\0\"\\\n  \"&V\\303\\251rifier les mises \\303\\240 jour\\0\"\\\n  \"Bandes dessin\\303\\251es\\0\"\\\n  \"Compatibilit\\303\\251\\0\"\\\n  \"Vue continue\\0\"\\\n  \"Vue continue, comme un livre\\0\"\\\n  \"Vue continue, page double\\0\"\\\n  \"Contribuer \\303\\240 la traduction\\0\"\\\n  \"Copier l'&image\\0\"\\\n  \"Copier l'adresse du &lien\\0\"\\\n  \"Copier le co&mmentaire\\0\"\\\n  \"La copie de texte est refus\\303\\251e (seule une capture d\\342\\200\\231\\303\\251cran est faite)\\0\"\\\n  \"Copyright :\\0\"\\\n  \"Impossible d'obtenir les propri\\303\\251t\\303\\251s de l'imprimante\\0\"\\\n  \"Impossible d'initialiser l'imprimante\\0\"\\\n  \"Impossible de g\\303\\251n\\303\\251rer la page\\0\"\\\n  \"Cr\\303\\251\\303\\251 le\\302\\240:\\0\"\\\n  \"Fichier actuel\\0\"\\\n  \"Position du curseur :\\0\"\\\n  \"&Zoom personnalis\\303\\251...\\tCtrl+Y\\0\"\\\n  \"Mise en &page par d\\303\\251faut\\302\\240:\\0\"\\\n  \"&Zoom par d\\303\\251faut\\302\\240:\\0\"\\\n  \"Le lecteur de PDF ne peut \\303\\252tre chang\\303\\251 en mode portable\\0\"\\\n  \"Interdictions\\302\\240:\\0\"\\\n  \"Documents DjVu\\0\"\\\n  \"Propri\\303\\251t\\303\\251s du document\\0\"\\\n  \"T\\303\\251l\\303\\251charger\\0\"\\\n  \"&Quitter\\tCtrl+Q\\0\"\\\n  \"Fichiers EPUB\\0\"\\\n  \"Entrer le mot de passe\\0\"\\\n  \"Entrer le mot de passe pour %s\\0\"\\\n  \"Entrer la ligne de commande \\303\\240 ex\\303\\251cuter lorsque vous double-cliquez sur le document PDF\\302\\240:\\0\"\\\n  \"Erreur de chargement de %s\\0\"\\\n  \"Fa&voris\\0\"\\\n  \"&Avancer\\tAlt+->\\0\"\\\n  \"&Plein \\303\\251cran\\tCtrl+Maj+L\\0\"\\\n  \"Page double\\0\"\\\n  \"Impossible de renommer le fichier!\\0\"\\\n  \"\\303\\211chec \\303\\240 l'enregistrement du fichier\\0\"\\\n  \"Affichage Web rapide\\0\"\\\n  \"Favoris\\0\"\\\n  \"Documents FictionBook\\0\"\\\n  \"Fichier %s non trouv\\303\\251\\0\"\\\n  \"Taille du fichier\\302\\240:\\0\"\\\n  \"Fichier\\302\\240:\\0\"\\\n  \"&Rechercher...\\tCtrl+F\\0\"\\\n  \"Rechercher\\0\"\\\n  \"Occurrence suivante\\0\"\\\n  \"Occurrence pr\\303\\251c\\303\\251dente\\0\"\\\n  \"Rechercher\\302\\240:\\0\"\\\n  \"&Ajuster au contenu\\tCtrl+3\\0\"\\\n  \"&Page enti\\303\\250re\\tCtrl+0\\0\"\\\n  \"Pleine &largeur\\tCtrl+2\\0\"\\\n  \"Ajuster au contenu\\0\"\\\n  \"Page enti\\303\\250re\\0\"\\\n  \"Pleine largeur\\0\"\\\n  \"Pleine largeur, vue continue\\0\"\\\n  \"Page unique\\0\"\\\n  \"Polices :\\0\"\\\n  \"Mise en forme du livre... %d pages\\0\"\\\n  \"Texte trouv\\303\\251 \\303\\240 la page %s\\0\"\\\n  \"Texte trouv\\303\\251 page %s (suivant)\\0\"\\\n  \"Documents lus fr\\303\\251quemment\\0\"\\\n  \"Go\\0\"\\\n  \"Aller \\303\\240 la page\\0\"\\\n  \"Masquer les documents lus fr\\303\\251quemment\\0\"\\\n  \"Remarque\\302\\240: utilisez la touche F3 pour trouver de nouveau\\0\"\\\n  \"Fichiers-images (*.%s)\\0\"\\\n  \"Ko\\0\"\\\n  \"Mo\\0\"\\\n  \"Faire de SumatraPDF l\\342\\200\\231application par d\\303\\251faut pour les fichiers PDF\\302\\240?\\0\"\\\n  \"D\\303\\251finir SumatraPDF comme lecteur PDF par d\\303\\251faut\\0\"\\\n  \"Mode man&ga\\0\"\\\n  \"Respecter la casse\\0\"\\\n  \"Fichiers Mobi\\0\"\\\n  \"Modifi\\303\\251 le\\302\\240:\\0\"\\\n  \"La version %s est disponible. T\\303\\251l\\303\\251charger la nouvelle version\\302\\240?\\0\"\\\n  \"Page suivante\\0\"\\\n  \"Aucun r\\303\\251sultat n'a \\303\\251t\\303\\251 trouv\\303\\251\\0\"\\\n  \"Aucun r\\303\\251sultat trouv\\303\\251 autour de la ligne %u dans le fichier %s\\0\"\\\n  \"Aucun fichier de synchronisation trouv\\303\\251\\0\"\\\n  \"Aucune information de synchronisation \\303\\240 cette position\\0\"\\\n  \"Nombre de pages\\302\\240:\\0\"\\\n  \"\\0\"\\\n  \"Ouvrir\\0\"\\\n  \"Ouvrir dans PDF-XChange\\0\"\\\n  \"Ouvrir un document...\\0\"\\\n  \"Ouvrir dans %s\\0\"\\\n  \"Ouvrir dans &Adobe Reader\\0\"\\\n  \"Ouvrir dans Fo&xit Reader\\0\"\\\n  \"Ouvrir dans Microsoft HTML Help\\0\"\\\n  \"Ouvrir dans Microsoft XPS-Viewer\\0\"\\\n  \"P&ropri\\303\\251t\\303\\251s\\0\"\\\n  \"&Propri\\303\\251t\\303\\251s\\tCtrl+D\\0\"\\\n  \"Document PDF\\0\"\\\n  \"Optimisations PDF\\0\"\\\n  \"PDF produit par\\302\\240:\\0\"\\\n  \"Version du PDF\\302\\240:\\0\"\\\n  \"Documents PDF\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Dimensions de la page\\302\\240:\\0\"\\\n  \"La page %u n'existe pas\\0\"\\\n  \"Mise \\303\\240 l'\\303\\251chelle\\0\"\\\n  \"Page\\302\\240:\\0\"\\\n  \"Fichiers PalmDoc\\0\"\\\n  \"Patientez s'il vous pla\\303\\256t (g\\303\\251n\\303\\251ration...)\\0\"\\\n  \"Documents Postscript\\0\"\\\n  \"P&r\\303\\251sentation\\tCtrl+L\\0\"\\\n  \"Page pr\\303\\251c\\303\\251dente\\0\"\\\n  \"Imprimer\\0\"\\\n  \"Plage d'impression\\0\"\\\n  \"Il n'y a pas d'imprimante de ce nom\\0\"\\\n  \"Impression en cours\\0\"\\\n  \"Impression toujours en cours. Annuler et quitter ?\\0\"\\\n  \"Impression toujours en cours. Annuler et recommencer ?\\0\"\\\n  \"Impression de la page %d sur %d...\\0\"\\\n  \"Probl\\303\\250me d'impression.\\0\"\\\n  \"Re&nommer...\\tF2\\0\"\\\n  \"Se rappeler les fichiers &ouverts\\0\"\\\n  \"Enlever des favoris\\0\"\\\n  \"Enlever page %s des favoris\\0\"\\\n  \"Renommer En\\0\"\\\n  \"Rotation &antihoraire\\tCtrl+Maj+-\\0\"\\\n  \"Rotation &horaire\\tCtrl+Maj++\\0\"\\\n  \"Enregistrer sous\\0\"\\\n  \"Enregistrer un raccourci... \\tCtrl+Maj-S\\0\"\\\n  \"Recherche de %d \\303\\240 %d...\\0\"\\\n  \"&Tout s\\303\\251lectionner\\0\"\\\n  \"&Tout s\\303\\251lectionner\\tCtrl+A\\0\"\\\n  \"S\\303\\251lectionner avec Ctrl+bouton gauche de la souris\\0\"\\\n  \"S\\303\\251lection :\\0\"\\\n  \"Envoyer par &courriel...\\0\"\\\n  \"Configurer la recherche inverse\\0\"\\\n  \"Voir les &Marque-pages\\0\"\\\n  \"&Vue continue\\0\"\\\n  \"Afficher la &barre d'outils\\0\"\\\n  \"Voir Favoris\\0\"\\\n  \"Montrer les documents fr\\303\\251quemment lus\\0\"\\\n  \"Voir la barre lat\\303\\251rale des &signets lorsqu'elle est disponible\\0\"\\\n  \"Une seule page\\0\"\\\n  \"D\\303\\251sol\\303\\251, cela n'aurait pas d\\303\\273 se produire !\\n\\n Cliquez sur \\\"Annuler\\\" si vous voulez nous aider \\303\\240 rem\\303\\251dier \\303\\240 ce crash\\0\"\\\n  \"Le fichier source %s n'a pas de point de synchronisation\\0\"\\\n  \"Objet\\302\\240:\\0\"\\\n  \"\\0\"\\\n  \"Mise \\303\\240 jour de SumatraPDF\\0\"\\\n  \"SumatraPDF a plant\\303\\251\\0\"\\\n  \"SumatraPDF est votre lecteur de PDF\\0\"\\\n  \"SumatraPDF doit maintenant \\303\\252tre votre lecteur de PDF par d\\303\\251faut\\0\"\\\n  \"Le fichier de synchronisation ne peut pas \\303\\252tre ouvert\\0\"\\\n  \"PDF balis\\303\\251\\0\"\\\n  \"Documents texte\\0\"\\\n  \"Ce document utilise des fonctionnalit\\303\\251s non support\\303\\251es (%s) et pourrait ne pas s'afficher correctement\\0\"\\\n  \"Titre\\302\\240:\\0\"\\\n  \"Fichier source inconnue (%s)\\0\"\\\n  \"Utiliser les ongle&ts\\0\"\\\n  \"Affichage\\0\"\\\n  \"Visiter le site &web\\0\"\\\n  \"Avertissement\\0\"\\\n  \"Documents XPS\\0\"\\\n  \"Vous avez la derni\\303\\250re version.\\0\"\\\n  \"Votre version est la %s\\0\"\\\n  \"\\0\"\\\n  \"Zoom avant\\0\"\\\n  \"Zoom arri\\303\\250re\\0\"\\\n  \"Facteur de zoom\\0\"\\\n  \"[Modifications d\\303\\251tect\\303\\251es\\302\\240; actualisation] %s\\0\"\\\n  \"copie de texte\\0\"\\\n  \"impression du document\\0\";\n\nconst char * gTranslations_gl = \n  \"&Acerca de\\0\"\\\n  \"&Tama\\303\\261o actual\\tCtrl+1\\0\"\\\n  \"Opci\\303\\263ns &avanzadas...\\0\"\\\n  \"&Todas as p\\303\\241xinas seleccionadas\\0\"\\\n  \"&Atr\\303\\241s\\tAlt+Frecha esquerda\\0\"\\\n  \"Vista de &libro\\tCtrl+8\\0\"\\\n  \"&Pechar\\tCtrl+W\\0\"\\\n  \"&Copiar a selecci\\303\\263n\\0\"\\\n  \"&Copiar selecci\\303\\263n\\tCtrl+C\\0\"\\\n  \"Non preguntar de novo\\0\"\\\n  \"&P\\303\\241xinas pares s\\303\\263\\0\"\\\n  \"&D\\303\\272as p\\303\\241xinas\\tCtrl+7\\0\"\\\n  \"&Ficheiro\\0\"\\\n  \"&Atopar que:\\0\"\\\n  \"Primeira p\\303\\241xina\\tHome\\0\"\\\n  \"&Axustar p\\303\\241xinas \\303\\241 \\303\\241rea imprimible\\0\"\\\n  \"Ir &a\\0\"\\\n  \"&Ir \\303\\241 p\\303\\241xina:\\0\"\\\n  \"A&xuda\\0\"\\\n  \"\\303\\232ltima p\\303\\241xina\\tEnd\\0\"\\\n  \"&Ampliaci\\303\\263n:\\0\"\\\n  \"Manual de Instrucci\\303\\263ns\\0\"\\\n  \"&Coincidencia mai\\303\\272sculas/min\\303\\272sculas\\0\"\\\n  \"P\\303\\241xina seguinte\\t->\\0\"\\\n  \"&Non\\0\"\\\n  \"&Non, grazas\\0\"\\\n  \"&S\\303\\263 p\\303\\241xinas impares\\0\"\\\n  \"Abrir documento\\0\"\\\n  \"A&brir...\\tCtrl+O\\0\"\\\n  \"&Opci\\303\\263ns...\\0\"\\\n  \"&Contrasinal:\\0\"\\\n  \"&Marcar Documento\\0\"\\\n  \"P\\303\\241xina anterior\\t<-\\0\"\\\n  \"&Imprimir...\\0\"\\\n  \"&Imprimir...\\tCtrl+P\\0\"\\\n  \"&Imprimir... (denegado)\\0\"\\\n  \"&Lembrar o contrasinal para este documento\\0\"\\\n  \"&Lembrar estes axustes para cada documento\\0\"\\\n  \"&Borrar documento\\0\"\\\n  \"&Gardar como...\\0\"\\\n  \"&Gardar como...\\tCtrl+S\\0\"\\\n  \"&Axustes\\0\"\\\n  \"&Reducir p\\303\\241xinas \\303\\241 \\303\\241rea imprimible (se for necesario)\\0\"\\\n  \"Unha &soa p\\303\\241xina\\tCtrl+6\\0\"\\\n  \"Ignorar esta versi\\303\\263n\\0\"\\\n  \"&Usar tama\\303\\261os de p\\303\\241xina orixinais\\0\"\\\n  \"&Ver\\0\"\\\n  \"&Xanela\\0\"\\\n  \"&Si\\0\"\\\n  \"&Aumento\\0\"\\\n  \"(de %d)\\0\"\\\n  \"(p\\303\\241xina %s)\\0\"\\\n  \"Acerca do SumatraPDF\\0\"\\\n  \"Engadir favorito\\0\"\\\n  \"Engadir a p\\303\\241xina %s aos favoritos\\0\"\\\n  \"Engadir p\\303\\241xina %s aos favoritos  cun nome (opcional):\\0\"\\\n  \"Engadir a favoritos\\0\"\\\n  \"Avanzado\\0\"\\\n  \"Todos os ficheiros\\0\"\\\n  \"Todos os documentos compatibles\\0\"\\\n  \"Aplicaci\\303\\263n:\\0\"\\\n  \"Asociar con ficheiros PDF?\\0\"\\\n  \"Adxunto: %s\\0\"\\\n  \"Autor:\\0\"\\\n  \"Autom\\303\\241tico\\0\"\\\n  \"Comprobar se hai &actualizaci\\303\\263ns autom\\303\\241ticamente\\0\"\\\n  \"Vista de libro\\0\"\\\n  \"&Marcadores\\tF12\\0\"\\\n  \"Atallos de marcadores\\0\"\\\n  \"Atallo de marcador \\303\\241 p\\303\\241xina %s de %s\\0\"\\\n  \"Marcadores\\0\"\\\n  \"\\0\"\\\n  \"Documentos CHM\\0\"\\\n  \"Non se pode conectar a Internet (error %#x).\\0\"\\\n  \"Cancelar\\0\"\\\n  \"Non se pode imprimir este ficheiro\\0\"\\\n  \"Non se pode iniciar o comando de busca inversa. Revisa a li\\303\\261a de comandos na configuraci\\303\\263n.\\0\"\\\n  \"Cambiar a lingua\\0\"\\\n  \"Buscar a&ctualizaci\\303\\263ns\\0\"\\\n  \"Albumes de c\\303\\263mic\\0\"\\\n  \"Compatibilidade\\0\"\\\n  \"Cont\\303\\255nuo\\0\"\\\n  \"Vista de libro continua\\0\"\\\n  \"P\\303\\241xina dobre continua\\0\"\\\n  \"Axudar coa traducci\\303\\263n\\0\"\\\n  \"Copiar a &imaxe\\0\"\\\n  \"Copiar o enderezo da &ligaz\\303\\263n\\0\"\\\n  \"Copiar o co&mentario\\0\"\\\n  \"Impediuse copiar texto (estase a copiar s\\303\\263 como imaxe)\\0\"\\\n  \"\\0\"\\\n  \"Non se puideron obter as propiedades da impresora\\0\"\\\n  \"Non se pode inicializar a impresora\\0\"\\\n  \"Non se puido presentar a p\\303\\241xina\\0\"\\\n  \"Creado:\\0\"\\\n  \"Ficheiro actual\\0\"\\\n  \"Posici\\303\\263n do punteiro\\0\"\\\n  \"&Aumento a medida...\\tCtrl+Y\\0\"\\\n  \"Disposici\\303\\263n por defecto:\\0\"\\\n  \"&Aumento por defecto:\\0\"\\\n  \"O lector de PDF por defecto non pode trocarse en modo portable\\0\"\\\n  \"Permisos denegados:\\0\"\\\n  \"Documentos DjVu\\0\"\\\n  \"Propiedades do documento\\0\"\\\n  \"Descargar\\0\"\\\n  \"&Sa\\303\\255r\\tCtrl+Q\\0\"\\\n  \"Documentos EPUB\\0\"\\\n  \"Insira o contrasinal\\0\"\\\n  \"Insira contrasinal para %s\\0\"\\\n  \"Insira a li\\303\\261a de comandos a invocar cando prema d\\303\\272as veces no documento PDF:\\0\"\\\n  \"Erro cargando %s\\0\"\\\n  \"F&avoritos\\0\"\\\n  \"Adiante\\tAlt+Right Arrow\\0\"\\\n  \"A toda pantalla\\tCtrl+Shift+L\\0\"\\\n  \"P\\303\\241xina dobre\\0\"\\\n  \"Fallouse ao renomear o ficheiro\\0\"\\\n  \"Erro ao salvar o arquivo.\\0\"\\\n  \"Vista web r\\303\\241pida\\0\"\\\n  \"Favoritos\\0\"\\\n  \"Documentos FictionBook\\0\"\\\n  \"Ficheiro %s non atopado\\0\"\\\n  \"Tama\\303\\261o do ficheiro:\\0\"\\\n  \"Ficheiro:\\0\"\\\n  \"Procura...\\tCtrl+F\\0\"\\\n  \"Procurar\\0\"\\\n  \"Atopar seguinte\\0\"\\\n  \"Atopar anterior\\0\"\\\n  \"Procura:\\0\"\\\n  \"Axustar &contido\\tCtrl+3\\0\"\\\n  \"&P\\303\\241xina enteira\\tCtrl+0\\0\"\\\n  \"Axustar ao ancho\\tCtrl+2\\0\"\\\n  \"Axustar contido\\0\"\\\n  \"P\\303\\241xina enteira\\0\"\\\n  \"Axustar ao ancho\\0\"\\\n  \"Axustar ancho e amosar p\\303\\241xinas seguidas\\0\"\\\n  \"Axustar a p\\303\\241xina \\303\\272nica\\0\"\\\n  \"Tipos de letra:\\0\"\\\n  \"D\\303\\241ndolle formato ao libro... %d p\\303\\241xinas\\0\"\\\n  \"Atopado texto na p\\303\\241xina %s\\0\"\\\n  \"Atopado texto na p\\303\\241xina %s (de novo)\\0\"\\\n  \"Lido decote\\0\"\\\n  \"\\0\"\\\n  \"Ir a p\\303\\241xina\\0\"\\\n  \"Agachar o lido decote\\0\"\\\n  \"Usar \\\"F3\\\" para amosar seguinte resultado\\0\"\\\n  \"Ficheiros de imaxe (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Facer o SumatraPDF a aplicaci\\303\\263n por defecto para arquivos PDF?\\0\"\\\n  \"Facer do SumatraPDF o lector PDF predefinido\\0\"\\\n  \"Modo Man&ga\\0\"\\\n  \"Coincidir mai\\303\\272sculas e min\\303\\272sculas\\0\"\\\n  \"Documentos Mobi\\0\"\\\n  \"Modificado:\\0\"\\\n  \"A nova versi\\303\\263n %s est\\303\\241 dispo\\303\\261ible. \\302\\277Desexa obtela?\\0\"\\\n  \"P\\303\\241xina seguinte\\0\"\\\n  \"Non se atoparon coincidencias\\0\"\\\n  \"Non se atopou resultado arredor da li\\303\\261a %u no ficheiro %s\\0\"\\\n  \"Non se atopou ficheiro de sincronizaci\\303\\263n\\0\"\\\n  \"Non hai datos de sincronizaci\\303\\263n nesta posici\\303\\263n\\0\"\\\n  \"N\\303\\272mero de P\\303\\241xinas:\\0\"\\\n  \"\\0\"\\\n  \"Abrir\\0\"\\\n  \"Abrir no PDF-XChange\\0\"\\\n  \"Abrir un documento...\\0\"\\\n  \"Abrir en %s\\0\"\\\n  \"Abrir no &Adobe Reader\\0\"\\\n  \"Abrir no &Foxit Reader\\0\"\\\n  \"Abrir no Microsoft HTML Help\\0\"\\\n  \"Abrir no Microsoft XPS-Viewer\\0\"\\\n  \"P&ropiedades\\0\"\\\n  \"P&ropiedades\\tCtrl+D\\0\"\\\n  \"Documento PDF\\0\"\\\n  \"Optimizaci\\303\\263n de PDF:\\0\"\\\n  \"Productor do PDF:\\0\"\\\n  \"Versi\\303\\263n PDF:\\0\"\\\n  \"Documentos PDF\\0\"\\\n  \"P\\303\\241xina...\\tCtrl+G\\0\"\\\n  \"P\\303\\241xina %s\\0\"\\\n  \"Tama\\303\\261o de p\\303\\241xina:\\0\"\\\n  \"Non existe a p\\303\\241xina %u\\0\"\\\n  \"Escalado de p\\303\\241xina\\0\"\\\n  \"P\\303\\241xina:\\0\"\\\n  \"Documentos PalmDoc\\0\"\\\n  \"Agarde por favor - compo\\303\\261endo...\\0\"\\\n  \"Documentos Postscript\\0\"\\\n  \"Pr&esentaci\\303\\263n\\tCtrl+L\\0\"\\\n  \"P\\303\\241xina anterior\\0\"\\\n  \"Imprimir\\0\"\\\n  \"Imprimir un rango\\0\"\\\n  \"A impresora co nome indicado non existe\\0\"\\\n  \"Impresi\\303\\263n en curso.\\0\"\\\n  \"A\\303\\255nda se est\\303\\241 imprimindo. Abortar e sa\\303\\255r?\\0\"\\\n  \"A\\303\\255nda se est\\303\\241 imprimino. Abortar e comezar de novo?\\0\"\\\n  \"Imprimir p\\303\\241xina %d de %d...\\0\"\\\n  \"Problema de impresi\\303\\263n.\\0\"\\\n  \"Re&nomear...\\tF2\\0\"\\\n  \"Lembrar ficheiros abertos\\0\"\\\n  \"Eliminar de favoritos\\0\"\\\n  \"Eliminar p\\303\\241xina %s de favoritos\\0\"\\\n  \"Renomear como\\0\"\\\n  \"Xirar \\303\\241 esquerda\\tCtrl+Shift+-\\0\"\\\n  \"Xirar \\303\\241 dereita\\tCtrl+Shift++\\0\"\\\n  \"Gardar como\\0\"\\\n  \"Gardar atallo...\\tCtrl+Shift+S\\0\"\\\n  \"Procurando %d de %d...\\0\"\\\n  \"Seleccion&ar todo\\0\"\\\n  \"Seleccion&ar todo\\tCtrl+A\\0\"\\\n  \"Seleccionar contido con Ctrl+bot\\303\\263n esquerdo do rato\\0\"\\\n  \"Selecci\\303\\263n:\\0\"\\\n  \"Enviar por email...\\0\"\\\n  \"Establecer li\\303\\261a de comandos da procura inversa\\0\"\\\n  \"Amosar &marcadores\\0\"\\\n  \"Amosar p\\303\\241xinas seguidas\\0\"\\\n  \"Amosar barra de ferramentas\\0\"\\\n  \"Amosar favoritos\\0\"\\\n  \"Amosar lidos decote\\0\"\\\n  \"Amosar a &barra de marcadores cando estea dispo\\303\\261ible\\0\"\\\n  \"Unha soa p\\303\\241xina\\0\"\\\n  \"Desculpe, isto non deber\\303\\255a ocorrer\\n\\nPor favor, prema 'Cancelar', se quere axudarnos a reparar o motivo deste erro.\\0\"\\\n  \"O ficheiro de orixe %s non ten punto de sincronizaci\\303\\263n\\0\"\\\n  \"Asunto:\\0\"\\\n  \"Opci\\303\\263ns de SumatraPDF\\0\"\\\n  \"Actualizaci\\303\\263n de SumatraPDF\\0\"\\\n  \"SumatraPDF fallou\\0\"\\\n  \"SumatraPDF \\303\\251 o seu lector de PDF por defecto\\0\"\\\n  \"SumatraPDF ser\\303\\241 agora o seu lector de PDF por defecto\\0\"\\\n  \"O ficheiro de sincronizaci\\303\\263n non pode abrirse\\0\"\\\n  \"Etiquetado PDF\\0\"\\\n  \"Documentos de texto\\0\"\\\n  \"Este documento usa caracter\\303\\255sticas non compatibles (%s) e pode non presentarse correctamente.\\0\"\\\n  \"T\\303\\255tulo:\\0\"\\\n  \"Ficheiro de orixe desco\\303\\261ecido (%s)\\0\"\\\n  \"Usar &lapelas\\0\"\\\n  \"Ver\\0\"\\\n  \"Visitar a p\\303\\241xina &web\\0\"\\\n  \"Aviso\\0\"\\\n  \"Documentos XPS\\0\"\\\n  \"Tes a \\303\\272ltima versi\\303\\263n\\0\"\\\n  \"A versi\\303\\263n actual \\303\\251 %s\\0\"\\\n  \"Aumento\\0\"\\\n  \"Ampliar\\0\"\\\n  \"Reducir\\0\"\\\n  \"Factor de aumento\\0\"\\\n  \"[Cambios detectados; actualizando] %s\\0\"\\\n  \"copiando texto\\0\"\\\n  \"imprimindo documento\\0\";\n\nconst char * gTranslations_ka = \n  \"&\\341\\203\\236\\341\\203\\240\\341\\203\\235\\341\\203\\222\\341\\203\\240\\341\\203\\220\\341\\203\\233\\341\\203\\230\\341\\203\\241 \\341\\203\\250\\341\\203\\224\\341\\203\\241\\341\\203\\220\\341\\203\\256\\341\\203\\224\\341\\203\\221...\\0\"\\\n  \"&\\341\\203\\227\\341\\203\\220\\341\\203\\225\\341\\203\\223\\341\\203\\220\\341\\203\\236\\341\\203\\230\\341\\203\\240\\341\\203\\225\\341\\203\\224\\341\\203\\232\\341\\203\\230 \\341\\203\\226\\341\\203\\235\\341\\203\\233\\341\\203\\220\\tCtrl+1\\0\"\\\n  \"\\0\"\\\n  \"&\\341\\203\\247\\341\\203\\225\\341\\203\\224\\341\\203\\232\\341\\203\\220 \\341\\203\\233\\341\\203\\235\\341\\203\\234\\341\\203\\230\\341\\203\\250\\341\\203\\234\\341\\203\\243\\341\\203\\232\\341\\203\\230 \\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230\\0\"\\\n  \"&\\341\\203\\243\\341\\203\\231\\341\\203\\220\\341\\203\\234\\tAlt+\\341\\203\\233\\341\\203\\220\\341\\203\\240\\341\\203\\252\\341\\203\\256\\341\\203\\224\\341\\203\\234\\341\\203\\220 \\341\\203\\230\\341\\203\\241\\341\\203\\220\\341\\203\\240\\341\\203\\230\\0\"\\\n  \"&\\341\\203\\254\\341\\203\\230\\341\\203\\222\\341\\203\\234\\341\\203\\230\\341\\203\\241 \\341\\203\\240\\341\\203\\224\\341\\203\\237\\341\\203\\230\\341\\203\\233\\341\\203\\230\\tCtrl+8\\0\"\\\n  \"&\\341\\203\\223\\341\\203\\220\\341\\203\\256\\341\\203\\243\\341\\203\\240\\341\\203\\225\\341\\203\\220\\tCtrl+W\\0\"\\\n  \"\\341\\203\\233\\341\\203\\235\\341\\203\\234\\341\\203\\230\\341\\203\\250\\341\\203\\234\\341\\203\\243\\341\\203\\232\\341\\203\\230\\341\\203\\241 &\\341\\203\\231\\341\\203\\235\\341\\203\\236\\341\\203\\230\\341\\203\\240\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\233\\341\\203\\235\\341\\203\\234\\341\\203\\230\\341\\203\\250\\341\\203\\234\\341\\203\\243\\341\\203\\232\\341\\203\\230\\341\\203\\241 &\\341\\203\\231\\341\\203\\235\\341\\203\\236\\341\\203\\230\\341\\203\\240\\341\\203\\224\\341\\203\\221\\341\\203\\220\\tCtrl+C\\0\"\\\n  \"&\\341\\203\\220\\341\\203\\246\\341\\203\\220\\341\\203\\240 \\341\\203\\250\\341\\203\\224\\341\\203\\233\\341\\203\\224\\341\\203\\231\\341\\203\\230\\341\\203\\227\\341\\203\\256\\341\\203\\235\\0\"\\\n  \"\\341\\203\\233\\341\\203\\256\\341\\203\\235\\341\\203\\232\\341\\203\\235\\341\\203\\223 &\\341\\203\\232\\341\\203\\243\\341\\203\\254\\341\\203\\230 \\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\224\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"&\\341\\203\\243\\341\\203\\240\\341\\203\\227\\341\\203\\230\\341\\203\\224\\341\\203\\240\\341\\203\\227-\\341\\203\\241\\341\\203\\220\\341\\203\\236\\341\\203\\230\\341\\203\\240\\341\\203\\230\\341\\203\\241\\341\\203\\236\\341\\203\\230\\341\\203\\240\\341\\203\\235\\341\\203\\223\\tCtrl+7\\0\"\\\n  \"&\\341\\203\\244\\341\\203\\220\\341\\203\\230\\341\\203\\232\\341\\203\\230\\0\"\\\n  \"\\341\\203\\236\\341\\203\\235&\\341\\203\\225\\341\\203\\234\\341\\203\\220:\\0\"\\\n  \"&\\341\\203\\236\\341\\203\\230\\341\\203\\240\\341\\203\\225\\341\\203\\224\\341\\203\\232\\341\\203\\230 \\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230\\tHome\\0\"\\\n  \"\\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\241 \\341\\203\\221\\341\\203\\224\\341\\203\\255\\341\\203\\223\\341\\203\\225\\341\\203\\220\\341\\203\\223 \\341\\203\\220\\341\\203\\240\\341\\203\\224\\341\\203\\250\\341\\203\\230 &\\341\\203\\222\\341\\203\\220\\341\\203\\234\\341\\203\\227\\341\\203\\220\\341\\203\\225\\341\\203\\241\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\222\\341\\203\\220\\341\\203\\223\\341\\203\\220&\\341\\203\\241\\341\\203\\225\\341\\203\\232\\341\\203\\220\\0\"\\\n  \"\\341\\203\\222\\341\\203\\220\\341\\203\\223\\341\\203\\220\\341\\203\\241\\341\\203\\225\\341\\203\\232\\341\\203\\220 &\\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\226\\341\\203\\224\\0\"\\\n  \"&\\341\\203\\223\\341\\203\\220\\341\\203\\256\\341\\203\\233\\341\\203\\220\\341\\203\\240\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"&\\341\\203\\221\\341\\203\\235\\341\\203\\232\\341\\203\\235 \\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230\\tEnd\\0\"\\\n  \"\\341\\203\\233\\341\\203\\220\\341\\203\\241&\\341\\203\\250\\341\\203\\242\\341\\203\\220\\341\\203\\221\\341\\203\\230\\341\\203\\240\\341\\203\\224\\341\\203\\221\\341\\203\\220:\\0\"\\\n  \"&\\341\\203\\241\\341\\203\\220\\341\\203\\256\\341\\203\\224\\341\\203\\232\\341\\203\\233\\341\\203\\253\\341\\203\\246\\341\\203\\225\\341\\203\\220\\341\\203\\234\\341\\203\\224\\341\\203\\232\\341\\203\\235\\0\"\\\n  \"&\\320\\243\\321\\207\\320\\270\\321\\202\\321\\213\\320\\262\\320\\260\\321\\202\\321\\214 \\321\\200\\320\\265\\320\\263\\320\\270\\321\\201\\321\\202\\321\\200\\0\"\\\n  \"\\341\\203\\250&\\341\\203\\224\\341\\203\\233\\341\\203\\223\\341\\203\\224\\341\\203\\222\\341\\203\\230 \\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230\\t\\341\\203\\233\\341\\203\\220\\341\\203\\240\\341\\203\\257\\341\\203\\225\\341\\203\\224\\341\\203\\234\\341\\203\\220 \\341\\203\\230\\341\\203\\241\\341\\203\\220\\341\\203\\240\\341\\203\\230\\0\"\\\n  \"&\\341\\203\\220\\341\\203\\240\\341\\203\\220\\0\"\\\n  \"&\\341\\203\\220\\341\\203\\240\\341\\203\\220, \\341\\203\\222\\341\\203\\233\\341\\203\\220\\341\\203\\223\\341\\203\\232\\341\\203\\235\\341\\203\\221\\341\\203\\227\\0\"\\\n  \"\\341\\203\\233\\341\\203\\256\\341\\203\\235\\341\\203\\232\\341\\203\\235\\341\\203\\223 &\\341\\203\\231\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\230 \\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\224\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"&\\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\230\\341\\203\\241 \\341\\203\\222\\341\\203\\220\\341\\203\\256\\341\\203\\241\\341\\203\\234\\341\\203\\220\\0\"\\\n  \"&\\341\\203\\222\\341\\203\\220\\341\\203\\256\\341\\203\\241\\341\\203\\234\\341\\203\\220...\\tCtrl+O\\0\"\\\n  \"&\\341\\203\\236\\341\\203\\220\\341\\203\\240\\341\\203\\220\\341\\203\\233\\341\\203\\224\\341\\203\\242\\341\\203\\240\\341\\203\\224\\341\\203\\221\\341\\203\\230...\\0\"\\\n  \"&\\341\\203\\236\\341\\203\\220\\341\\203\\240\\341\\203\\235\\341\\203\\232\\341\\203\\230:\\0\"\\\n  \"\\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\230\\341\\203\\242\\341\\203\\241 &\\341\\203\\233\\341\\203\\230\\341\\203\\233\\341\\203\\220\\341\\203\\222\\341\\203\\240\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\254\\341\\203\\230&\\341\\203\\234\\341\\203\\220 \\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230\\t\\341\\203\\233\\341\\203\\220\\341\\203\\240\\341\\203\\252\\341\\203\\256\\341\\203\\224\\341\\203\\234\\341\\203\\220 \\341\\203\\230\\341\\203\\241\\341\\203\\220\\341\\203\\240\\341\\203\\230\\0\"\\\n  \"&\\341\\203\\220\\341\\203\\233\\341\\203\\235\\341\\203\\221\\341\\203\\224\\341\\203\\255\\341\\203\\223\\341\\203\\225\\341\\203\\220...\\0\"\\\n  \"&\\341\\203\\220\\341\\203\\233\\341\\203\\235\\341\\203\\221\\341\\203\\224\\341\\203\\255\\341\\203\\223\\341\\203\\225\\341\\203\\220...\\tCtrl+P\\0\"\\\n  \"&\\341\\203\\220\\341\\203\\233\\341\\203\\235\\341\\203\\221\\341\\203\\224\\341\\203\\255\\341\\203\\223\\341\\203\\225\\341\\203\\220... (\\341\\203\\222\\341\\203\\220\\341\\203\\243\\341\\203\\245\\341\\203\\233\\341\\203\\223\\341\\203\\220)\\0\"\\\n  \"\\341\\203\\220\\341\\203\\233 \\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\230\\341\\203\\241\\341\\203\\227\\341\\203\\225\\341\\203\\230\\341\\203\\241 \\341\\203\\236\\341\\203\\220\\341\\203\\240\\341\\203\\235\\341\\203\\232\\341\\203\\230\\341\\203\\241 \\341\\203\\223\\341\\203\\220&\\341\\203\\233\\341\\203\\220\\341\\203\\256\\341\\203\\241\\341\\203\\235\\341\\203\\225\\341\\203\\240\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\220\\341\\203\\233 \\341\\203\\236\\341\\203\\220\\341\\203\\240\\341\\203\\220\\341\\203\\233\\341\\203\\224\\341\\203\\242\\341\\203\\240\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\241 \\341\\203\\247\\341\\203\\225\\341\\203\\224\\341\\203\\232\\341\\203\\220 \\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\226\\341\\203\\224 &\\341\\203\\233\\341\\203\\235\\341\\203\\240\\341\\203\\222\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\230\\341\\203\\241 &\\341\\203\\254\\341\\203\\220\\341\\203\\250\\341\\203\\232\\341\\203\\220\\0\"\\\n  \"\\341\\203\\250\\341\\203\\224\\341\\203\\234\\341\\203\\220\\341\\203\\256\\341\\203\\225\\341\\203\\220 &\\341\\203\\240\\341\\203\\235\\341\\203\\222\\341\\203\\235\\341\\203\\240\\341\\203\\252...\\0\"\\\n  \"\\341\\203\\250\\341\\203\\224\\341\\203\\234\\341\\203\\220\\341\\203\\256\\341\\203\\225\\341\\203\\220 &\\341\\203\\240\\341\\203\\235\\341\\203\\222\\341\\203\\235\\341\\203\\240\\341\\203\\252...\\tCtrl+S\\0\"\\\n  \"&\\341\\203\\222\\341\\203\\220\\341\\203\\233\\341\\203\\220\\341\\203\\240\\341\\203\\227\\341\\203\\225\\341\\203\\220\\0\"\\\n  \"\\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\241 \\341\\203\\250\\341\\203\\224\\341\\203\\233\\341\\203\\252\\341\\203\\230\\341\\203\\240\\341\\203\\224\\341\\203\\221\\341\\203\\220 \\341\\203\\221\\341\\203\\224\\341\\203\\255\\341\\203\\223\\341\\203\\225\\341\\203\\220\\341\\203\\223 \\341\\203\\220\\341\\203\\240\\341\\203\\224\\341\\203\\250\\341\\203\\230 \\341\\203\\251\\341\\203\\220\\341\\203\\241\\341\\203\\220\\341\\203\\242\\341\\203\\224\\341\\203\\225\\341\\203\\220\\341\\203\\223 (\\341\\203\\227\\341\\203\\243 \\341\\203\\241\\341\\203\\220\\341\\203\\255\\341\\203\\230\\341\\203\\240\\341\\203\\235\\341\\203\\220)\\0\"\\\n  \"&\\341\\203\\227\\341\\203\\230\\341\\203\\227\\341\\203\\235 \\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\220\\341\\203\\223\\tCtrl+6\\0\"\\\n  \"\\341\\203\\220\\341\\203\\233 \\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\241\\341\\203\\230\\341\\203\\230\\341\\203\\241 \\341\\203\\222\\341\\203\\220\\341\\203\\233\\341\\203\\235\\341\\203\\242\\341\\203\\235\\341\\203\\225\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"&\\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\241 \\341\\203\\235\\341\\203\\240\\341\\203\\230\\341\\203\\222\\341\\203\\230\\341\\203\\234\\341\\203\\220\\341\\203\\232\\341\\203\\230 \\341\\203\\226\\341\\203\\235\\341\\203\\233\\341\\203\\230\\341\\203\\241 \\341\\203\\222\\341\\203\\220\\341\\203\\233\\341\\203\\235\\341\\203\\247\\341\\203\\224\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"&\\341\\203\\256\\341\\203\\224\\341\\203\\223\\341\\203\\230\\0\"\\\n  \"\\0\"\\\n  \"&\\341\\203\\223\\341\\203\\230\\341\\203\\220\\341\\203\\256\\0\"\\\n  \"\\341\\203\\233\\341\\203\\220\\341\\203\\241&\\341\\203\\250\\341\\203\\242\\341\\203\\220\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"(\\341\\203\\223\\341\\203\\220\\341\\203\\234 %d)\\0\"\\\n  \"(\\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230 %s)\\0\"\\\n  \"SumatraPDF-\\341\\203\\230\\341\\203\\241 \\341\\203\\250\\341\\203\\224\\341\\203\\241\\341\\203\\220\\341\\203\\256\\341\\203\\224\\341\\203\\221\\0\"\\\n  \"\\341\\203\\240\\341\\203\\251\\341\\203\\224\\341\\203\\243\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\250\\341\\203\\230 \\341\\203\\223\\341\\203\\220\\341\\203\\233\\341\\203\\220\\341\\203\\242\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"%s \\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230\\341\\203\\241 \\341\\203\\240\\341\\203\\251\\341\\203\\224\\341\\203\\243\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\250\\341\\203\\230 \\341\\203\\223\\341\\203\\220\\341\\203\\233\\341\\203\\220\\341\\203\\242\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"%s \\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230\\341\\203\\241 \\341\\203\\223\\341\\203\\220\\341\\203\\233\\341\\203\\220\\341\\203\\242\\341\\203\\224\\341\\203\\221\\341\\203\\220 \\341\\203\\240\\341\\203\\251\\341\\203\\224\\341\\203\\243\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\250\\341\\203\\230 (\\341\\203\\220\\341\\203\\240\\341\\203\\220\\341\\203\\241\\341\\203\\220\\341\\203\\225\\341\\203\\220\\341\\203\\232\\341\\203\\223\\341\\203\\224\\341\\203\\221\\341\\203\\243\\341\\203\\232\\341\\203\\235) \\341\\203\\241\\341\\203\\220\\341\\203\\256\\341\\203\\224\\341\\203\\232\\341\\203\\254\\341\\203\\235\\341\\203\\223\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\227:\\0\"\\\n  \"\\341\\203\\240\\341\\203\\251\\341\\203\\224\\341\\203\\243\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\250\\341\\203\\230 \\341\\203\\223\\341\\203\\220\\341\\203\\233\\341\\203\\220\\341\\203\\242\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\223\\341\\203\\220\\341\\203\\233\\341\\203\\220\\341\\203\\242\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\227\\341\\203\\230\\0\"\\\n  \"\\341\\203\\247\\341\\203\\225\\341\\203\\224\\341\\203\\232\\341\\203\\220 \\341\\203\\244\\341\\203\\220\\341\\203\\230\\341\\203\\232\\341\\203\\230\\0\"\\\n  \"\\341\\203\\247\\341\\203\\225\\341\\203\\224\\341\\203\\232\\341\\203\\220 \\341\\203\\233\\341\\203\\256\\341\\203\\220\\341\\203\\240\\341\\203\\223\\341\\203\\220\\341\\203\\255\\341\\203\\224\\341\\203\\240\\341\\203\\230\\341\\203\\232\\341\\203\\230 \\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\230\\0\"\\\n  \"\\341\\203\\220\\341\\203\\236\\341\\203\\232\\341\\203\\230\\341\\203\\231\\341\\203\\220\\341\\203\\252\\341\\203\\230\\341\\203\\220:\\0\"\\\n  \"\\341\\203\\222\\341\\203\\241\\341\\203\\243\\341\\203\\240\\341\\203\\227 PDF \\341\\203\\244\\341\\203\\220\\341\\203\\230\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\227\\341\\203\\220\\341\\203\\234 \\341\\203\\220\\341\\203\\241\\341\\203\\235\\341\\203\\252\\341\\203\\230\\341\\203\\240\\341\\203\\224\\341\\203\\221\\341\\203\\220?\\0\"\\\n  \"\\341\\203\\223\\341\\203\\220\\341\\203\\234\\341\\203\\220\\341\\203\\240\\341\\203\\227\\341\\203\\230: %s\\0\"\\\n  \"\\341\\203\\220\\341\\203\\225\\341\\203\\242\\341\\203\\235\\341\\203\\240\\341\\203\\230:\\0\"\\\n  \"\\341\\203\\220\\341\\203\\225\\341\\203\\242\\341\\203\\235\\341\\203\\233\\341\\203\\220\\341\\203\\242\\341\\203\\243\\341\\203\\240\\341\\203\\230\\0\"\\\n  \"\\341\\203\\222\\341\\203\\220\\341\\203\\234\\341\\203\\220\\341\\203\\256\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\241 &\\341\\203\\220\\341\\203\\225\\341\\203\\242\\341\\203\\235\\341\\203\\233\\341\\203\\220\\341\\203\\242\\341\\203\\243\\341\\203\\240\\341\\203\\220\\341\\203\\223 \\341\\203\\250\\341\\203\\224\\341\\203\\233\\341\\203\\235\\341\\203\\254\\341\\203\\233\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\254\\341\\203\\230\\341\\203\\222\\341\\203\\234\\341\\203\\230\\341\\203\\241 \\341\\203\\240\\341\\203\\224\\341\\203\\237\\341\\203\\230\\341\\203\\233\\341\\203\\230\\0\"\\\n  \"&\\341\\203\\241\\341\\203\\220\\341\\203\\234\\341\\203\\230\\341\\203\\250\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\230\\tF12\\0\"\\\n  \"\\341\\203\\233\\341\\203\\220\\341\\203\\232\\341\\203\\241\\341\\203\\220\\341\\203\\256\\341\\203\\233\\341\\203\\235\\341\\203\\221\\341\\203\\224\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"%s-\\341\\203\\230\\341\\203\\223\\341\\203\\220\\341\\203\\234 %s \\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230\\341\\203\\241 \\341\\203\\233\\341\\203\\220\\341\\203\\232\\341\\203\\241\\341\\203\\220\\341\\203\\256\\341\\203\\233\\341\\203\\235\\341\\203\\221\\341\\203\\230\\341\\203\\241 \\341\\203\\251\\341\\203\\220\\341\\203\\234\\341\\203\\230\\341\\203\\250\\341\\203\\225\\341\\203\\234\\341\\203\\220\\0\"\\\n  \"\\341\\203\\241\\341\\203\\220\\341\\203\\234\\341\\203\\230\\341\\203\\250\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"\\341\\203\\221\\341\\203\\220\\341\\203\\230\\341\\203\\242\\341\\203\\230\\0\"\\\n  \"CHM \\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\224\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"\\341\\203\\230\\341\\203\\234\\341\\203\\242\\341\\203\\224\\341\\203\\240\\341\\203\\234\\341\\203\\224\\341\\203\\242\\341\\203\\227\\341\\203\\220\\341\\203\\234 \\341\\203\\223\\341\\203\\220\\341\\203\\231\\341\\203\\220\\341\\203\\225\\341\\203\\250\\341\\203\\230\\341\\203\\240\\341\\203\\224\\341\\203\\221\\341\\203\\220 \\341\\203\\225\\341\\203\\224\\341\\203\\240 \\341\\203\\233\\341\\203\\235\\341\\203\\256\\341\\203\\224\\341\\203\\240\\341\\203\\256\\341\\203\\223\\341\\203\\220 (\\341\\203\\250\\341\\203\\224\\341\\203\\252\\341\\203\\223\\341\\203\\235\\341\\203\\233\\341\\203\\220 %#x).\\0\"\\\n  \"\\341\\203\\222\\341\\203\\220\\341\\203\\243\\341\\203\\245\\341\\203\\233\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\220\\341\\203\\233 \\341\\203\\244\\341\\203\\220\\341\\203\\230\\341\\203\\232\\341\\203\\230\\341\\203\\241 \\341\\203\\220\\341\\203\\233\\341\\203\\235\\341\\203\\221\\341\\203\\224\\341\\203\\255\\341\\203\\223\\341\\203\\225\\341\\203\\220 \\341\\203\\225\\341\\203\\224\\341\\203\\240 \\341\\203\\233\\341\\203\\235\\341\\203\\256\\341\\203\\224\\341\\203\\240\\341\\203\\256\\341\\203\\223\\341\\203\\220\\0\"\\\n  \"\\341\\203\\250\\341\\203\\224\\341\\203\\221\\341\\203\\240\\341\\203\\243\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\243\\341\\203\\232\\341\\203\\230 \\341\\203\\253\\341\\203\\224\\341\\203\\221\\341\\203\\234\\341\\203\\230\\341\\203\\241 \\341\\203\\221\\341\\203\\240\\341\\203\\253\\341\\203\\220\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\241 \\341\\203\\222\\341\\203\\220\\341\\203\\250\\341\\203\\225\\341\\203\\224\\341\\203\\221\\341\\203\\220 \\341\\203\\225\\341\\203\\224\\341\\203\\240 \\341\\203\\233\\341\\203\\235\\341\\203\\256\\341\\203\\224\\341\\203\\240\\341\\203\\256\\341\\203\\223\\341\\203\\220. \\341\\203\\222\\341\\203\\227\\341\\203\\256\\341\\203\\235\\341\\203\\225\\341\\203\\227 \\341\\203\\250\\341\\203\\224\\341\\203\\220\\341\\203\\233\\341\\203\\235\\341\\203\\254\\341\\203\\233\\341\\203\\224\\341\\203\\227 \\341\\203\\221\\341\\203\\240\\341\\203\\253\\341\\203\\220\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\241 \\341\\203\\241\\341\\203\\242\\341\\203\\240\\341\\203\\230\\341\\203\\245\\341\\203\\235\\341\\203\\234\\341\\203\\230\\341\\203\\241 \\341\\203\\236\\341\\203\\220\\341\\203\\240\\341\\203\\220\\341\\203\\233\\341\\203\\224\\341\\203\\242\\341\\203\\240\\341\\203\\224\\341\\203\\221\\341\\203\\230.\\0\"\\\n  \"\\341\\203\\224\\341\\203\\234\\341\\203\\230\\341\\203\\241 \\341\\203\\250\\341\\203\\224\\341\\203\\252\\341\\203\\225\\341\\203\\232\\341\\203\\220 (Change Language)\\0\"\\\n  \"&\\341\\203\\222\\341\\203\\220\\341\\203\\234\\341\\203\\220\\341\\203\\256\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\241 \\341\\203\\250\\341\\203\\224\\341\\203\\233\\341\\203\\235\\341\\203\\254\\341\\203\\233\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\231\\341\\203\\235\\341\\203\\233\\341\\203\\230\\341\\203\\245\\341\\203\\241\\341\\203\\224\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"\\341\\203\\227\\341\\203\\220\\341\\203\\225\\341\\203\\241\\341\\203\\224\\341\\203\\221\\341\\203\\220\\341\\203\\223\\341\\203\\235\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\243\\341\\203\\254\\341\\203\\247\\341\\203\\225\\341\\203\\224\\341\\203\\242\\341\\203\\230\\0\"\\\n  \"\\341\\203\\254\\341\\203\\230\\341\\203\\222\\341\\203\\234\\341\\203\\230\\341\\203\\241 \\341\\203\\240\\341\\203\\224\\341\\203\\237\\341\\203\\230\\341\\203\\233\\341\\203\\230 (\\341\\203\\243\\341\\203\\254\\341\\203\\247\\341\\203\\225\\341\\203\\224\\341\\203\\242\\341\\203\\230)\\0\"\\\n  \"\\341\\203\\243\\341\\203\\240\\341\\203\\227\\341\\203\\230\\341\\203\\224\\341\\203\\240\\341\\203\\227-\\341\\203\\241\\341\\203\\220\\341\\203\\236\\341\\203\\230\\341\\203\\240\\341\\203\\230\\341\\203\\241\\341\\203\\236\\341\\203\\230\\341\\203\\240\\341\\203\\235\\341\\203\\223 (\\341\\203\\243\\341\\203\\254\\341\\203\\247\\341\\203\\225\\341\\203\\224\\341\\203\\242\\341\\203\\230)\\0\"\\\n  \"\\341\\203\\227\\341\\203\\220\\341\\203\\240\\341\\203\\222\\341\\203\\233\\341\\203\\234\\341\\203\\220\\341\\203\\250\\341\\203\\230 \\341\\203\\233\\341\\203\\235\\341\\203\\234\\341\\203\\220\\341\\203\\254\\341\\203\\230\\341\\203\\232\\341\\203\\224\\341\\203\\235\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\241\\341\\203\\243\\341\\203\\240\\341\\203\\220\\341\\203\\227\\341\\203\\230\\341\\203\\241 &\\341\\203\\231\\341\\203\\235\\341\\203\\236\\341\\203\\230\\341\\203\\240\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"&\\341\\203\\221\\341\\203\\233\\341\\203\\243\\341\\203\\232\\341\\203\\230\\341\\203\\241 \\341\\203\\231\\341\\203\\235\\341\\203\\236\\341\\203\\230\\341\\203\\240\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\231\\341\\203\\235&\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\220\\341\\203\\240\\341\\203\\230\\341\\203\\241 \\341\\203\\231\\341\\203\\235\\341\\203\\236\\341\\203\\230\\341\\203\\240\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\242\\341\\203\\224\\341\\203\\245\\341\\203\\241\\341\\203\\242\\341\\203\\230\\341\\203\\241 \\341\\203\\231\\341\\203\\235\\341\\203\\236\\341\\203\\230\\341\\203\\240\\341\\203\\224\\341\\203\\221\\341\\203\\220 \\341\\203\\220\\341\\203\\231\\341\\203\\240\\341\\203\\253\\341\\203\\220\\341\\203\\232\\341\\203\\243\\341\\203\\232\\341\\203\\230\\341\\203\\220 (\\341\\203\\231\\341\\203\\235\\341\\203\\236\\341\\203\\230\\341\\203\\240\\341\\203\\223\\341\\203\\224\\341\\203\\221\\341\\203\\220 \\341\\203\\240\\341\\203\\235\\341\\203\\222\\341\\203\\235\\341\\203\\240\\341\\203\\252 \\341\\203\\241\\341\\203\\243\\341\\203\\240\\341\\203\\220\\341\\203\\227\\341\\203\\230)\\0\"\\\n  \"\\0\"\\\n  \"\\341\\203\\236\\341\\203\\240\\341\\203\\230\\341\\203\\234\\341\\203\\242\\341\\203\\224\\341\\203\\240\\341\\203\\230\\341\\203\\241 \\341\\203\\227\\341\\203\\225\\341\\203\\230\\341\\203\\241\\341\\203\\224\\341\\203\\221\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\241 \\341\\203\\233\\341\\203\\230\\341\\203\\246\\341\\203\\224\\341\\203\\221\\341\\203\\220 \\341\\203\\225\\341\\203\\224\\341\\203\\240 \\341\\203\\233\\341\\203\\235\\341\\203\\256\\341\\203\\224\\341\\203\\240\\341\\203\\256\\341\\203\\223\\341\\203\\220\\0\"\\\n  \"\\341\\203\\236\\341\\203\\240\\341\\203\\230\\341\\203\\234\\341\\203\\242\\341\\203\\224\\341\\203\\240\\341\\203\\230\\341\\203\\241 \\341\\203\\230\\341\\203\\234\\341\\203\\230\\341\\203\\252\\341\\203\\230\\341\\203\\220\\341\\203\\232\\341\\203\\230\\341\\203\\226\\341\\203\\220\\341\\203\\252\\341\\203\\230\\341\\203\\220 \\341\\203\\225\\341\\203\\224\\341\\203\\240 \\341\\203\\233\\341\\203\\235\\341\\203\\256\\341\\203\\224\\341\\203\\240\\341\\203\\256\\341\\203\\223\\341\\203\\220\\0\"\\\n  \"\\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230\\341\\203\\241 \\341\\203\\240\\341\\203\\224\\341\\203\\234\\341\\203\\223\\341\\203\\224\\341\\203\\240\\341\\203\\230 \\341\\203\\225\\341\\203\\224\\341\\203\\240 \\341\\203\\233\\341\\203\\235\\341\\203\\256\\341\\203\\224\\341\\203\\240\\341\\203\\256\\341\\203\\223\\341\\203\\220\\0\"\\\n  \"\\341\\203\\250\\341\\203\\224\\341\\203\\245\\341\\203\\233\\341\\203\\234\\341\\203\\230\\341\\203\\232\\341\\203\\230\\341\\203\\220:\\0\"\\\n  \"\\341\\203\\233\\341\\203\\230\\341\\203\\233\\341\\203\\223\\341\\203\\230\\341\\203\\234\\341\\203\\220\\341\\203\\240\\341\\203\\224 \\341\\203\\244\\341\\203\\220\\341\\203\\230\\341\\203\\232\\341\\203\\230\\0\"\\\n  \"\\341\\203\\231\\341\\203\\243\\341\\203\\240\\341\\203\\241\\341\\203\\235\\341\\203\\240\\341\\203\\230\\341\\203\\241 \\341\\203\\236\\341\\203\\235\\341\\203\\226\\341\\203\\230\\341\\203\\252\\341\\203\\230\\341\\203\\220:\\0\"\\\n  \"&\\341\\203\\233\\341\\203\\220\\341\\203\\241\\341\\203\\250\\341\\203\\242\\341\\203\\220\\341\\203\\221\\341\\203\\230\\341\\203\\241 \\341\\203\\233\\341\\203\\230\\341\\203\\227\\341\\203\\230\\341\\203\\227\\341\\203\\224\\341\\203\\221\\341\\203\\220...\\tCtrl+Y\\0\"\\\n  \"&\\341\\203\\234\\341\\203\\220\\341\\203\\222\\341\\203\\243\\341\\203\\232\\341\\203\\230\\341\\203\\241\\341\\203\\256\\341\\203\\233\\341\\203\\224\\341\\203\\225\\341\\203\\230 \\341\\203\\222\\341\\203\\220\\341\\203\\234\\341\\203\\232\\341\\203\\220\\341\\203\\222\\341\\203\\224\\341\\203\\221\\341\\203\\220:\\0\"\\\n  \"\\341\\203\\234\\341\\203\\220\\341\\203\\222\\341\\203\\243\\341\\203\\232\\341\\203\\230\\341\\203\\241\\341\\203\\256\\341\\203\\233\\341\\203\\224\\341\\203\\225\\341\\203\\230 &\\341\\203\\233\\341\\203\\220\\341\\203\\241\\341\\203\\250\\341\\203\\242\\341\\203\\220\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"\\341\\203\\236\\341\\203\\235\\341\\203\\240\\341\\203\\242\\341\\203\\220\\341\\203\\242\\341\\203\\243\\341\\203\\232 \\341\\203\\240\\341\\203\\224\\341\\203\\237\\341\\203\\230\\341\\203\\233\\341\\203\\250\\341\\203\\230, PDF-\\341\\203\\230\\341\\203\\241 \\341\\203\\254\\341\\203\\220\\341\\203\\233\\341\\203\\231\\341\\203\\230\\341\\203\\227\\341\\203\\256\\341\\203\\225\\341\\203\\224\\341\\203\\232\\341\\203\\220\\341\\203\\223 \\341\\203\\223\\341\\203\\220\\341\\203\\247\\341\\203\\224\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\220 \\341\\203\\250\\341\\203\\224\\341\\203\\243\\341\\203\\253\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\224\\341\\203\\232\\341\\203\\230\\341\\203\\220\\0\"\\\n  \"\\341\\203\\227\\341\\203\\245\\341\\203\\225\\341\\203\\224\\341\\203\\234 \\341\\203\\220\\341\\203\\240 \\341\\203\\222\\341\\203\\220\\341\\203\\245\\341\\203\\225\\341\\203\\227 \\341\\203\\241\\341\\203\\220\\341\\203\\255\\341\\203\\230\\341\\203\\240\\341\\203\\235 \\341\\203\\243\\341\\203\\244\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\224\\341\\203\\221\\341\\203\\230:\\0\"\\\n  \"DjVu \\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\224\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"\\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\230\\341\\203\\241 \\341\\203\\227\\341\\203\\225\\341\\203\\230\\341\\203\\241\\341\\203\\224\\341\\203\\221\\341\\203\\224\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"\\341\\203\\251\\341\\203\\220\\341\\203\\233\\341\\203\\235\\341\\203\\242\\341\\203\\225\\341\\203\\230\\341\\203\\240\\341\\203\\227\\341\\203\\225\\341\\203\\220\\0\"\\\n  \"&\\341\\203\\222\\341\\203\\220\\341\\203\\233\\341\\203\\235\\341\\203\\241\\341\\203\\225\\341\\203\\232\\341\\203\\220\\tCtrl+Q\\0\"\\\n  \"EPUB \\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\224\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"\\341\\203\\250\\341\\203\\224\\341\\203\\230\\341\\203\\247\\341\\203\\225\\341\\203\\220\\341\\203\\234\\341\\203\\224\\341\\203\\227 \\341\\203\\236\\341\\203\\220\\341\\203\\240\\341\\203\\235\\341\\203\\232\\341\\203\\230\\0\"\\\n  \"\\341\\203\\250\\341\\203\\224\\341\\203\\230\\341\\203\\247\\341\\203\\225\\341\\203\\220\\341\\203\\234\\341\\203\\224\\341\\203\\227 \\341\\203\\236\\341\\203\\220\\341\\203\\240\\341\\203\\235\\341\\203\\232\\341\\203\\230 %s-\\341\\203\\230\\341\\203\\241\\341\\203\\227\\341\\203\\225\\341\\203\\230\\341\\203\\241\\0\"\\\n  \"\\341\\203\\250\\341\\203\\224\\341\\203\\230\\341\\203\\247\\341\\203\\225\\341\\203\\220\\341\\203\\234\\341\\203\\224\\341\\203\\227 \\341\\203\\221\\341\\203\\240\\341\\203\\253\\341\\203\\220\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\241 \\341\\203\\241\\341\\203\\242\\341\\203\\240\\341\\203\\230\\341\\203\\245\\341\\203\\235\\341\\203\\234\\341\\203\\230 \\341\\203\\240\\341\\203\\235\\341\\203\\233\\341\\203\\232\\341\\203\\230\\341\\203\\241 \\341\\203\\222\\341\\203\\220\\341\\203\\233\\341\\203\\235\\341\\203\\253\\341\\203\\220\\341\\203\\256\\341\\203\\224\\341\\203\\221\\341\\203\\220\\341\\203\\252 PDF \\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\226\\341\\203\\224 \\341\\203\\235\\341\\203\\240\\341\\203\\257\\341\\203\\224\\341\\203\\240 \\341\\203\\223\\341\\203\\220\\341\\203\\254\\341\\203\\236\\341\\203\\220\\341\\203\\231\\341\\203\\243\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\241 \\341\\203\\250\\341\\203\\224\\341\\203\\233\\341\\203\\223\\341\\203\\224\\341\\203\\222 \\341\\203\\222\\341\\203\\241\\341\\203\\243\\341\\203\\240\\341\\203\\227:\\0\"\\\n  \"\\341\\203\\251\\341\\203\\220\\341\\203\\242\\341\\203\\225\\341\\203\\230\\341\\203\\240\\341\\203\\227\\341\\203\\225\\341\\203\\230\\341\\203\\241 \\341\\203\\250\\341\\203\\224\\341\\203\\252\\341\\203\\223\\341\\203\\235\\341\\203\\233\\341\\203\\220 %s\\0\"\\\n  \"&\\341\\203\\240\\341\\203\\251\\341\\203\\224\\341\\203\\243\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"&\\341\\203\\254\\341\\203\\230\\341\\203\\234\\tAlt+\\341\\203\\230\\341\\203\\241\\341\\203\\220\\341\\203\\240\\341\\203\\230 \\341\\203\\233\\341\\203\\220\\341\\203\\240\\341\\203\\257\\341\\203\\225\\341\\203\\234\\341\\203\\230\\341\\203\\225\\0\"\\\n  \"\\341\\203\\233\\341\\203\\227\\341\\203\\224\\341\\203\\232 &\\341\\203\\224\\341\\203\\231\\341\\203\\240\\341\\203\\220\\341\\203\\234\\341\\203\\226\\341\\203\\224\\tCtrl+Shift+L\\0\"\\\n  \"\\341\\203\\243\\341\\203\\240\\341\\203\\227\\341\\203\\230\\341\\203\\224\\341\\203\\240\\341\\203\\227-\\341\\203\\241\\341\\203\\220\\341\\203\\236\\341\\203\\230\\341\\203\\240\\341\\203\\230\\341\\203\\241\\341\\203\\236\\341\\203\\230\\341\\203\\240\\341\\203\\235\\341\\203\\223\\0\"\\\n  \"\\341\\203\\244\\341\\203\\220\\341\\203\\230\\341\\203\\232\\341\\203\\230\\341\\203\\241 \\341\\203\\222\\341\\203\\220\\341\\203\\223\\341\\203\\220\\341\\203\\240\\341\\203\\245\\341\\203\\233\\341\\203\\224\\341\\203\\225\\341\\203\\220 \\341\\203\\225\\341\\203\\224\\341\\203\\240 \\341\\203\\233\\341\\203\\235\\341\\203\\256\\341\\203\\224\\341\\203\\240\\341\\203\\256\\341\\203\\223\\341\\203\\220!\\0\"\\\n  \"\\341\\203\\244\\341\\203\\220\\341\\203\\230\\341\\203\\232\\341\\203\\230\\341\\203\\241 \\341\\203\\250\\341\\203\\224\\341\\203\\234\\341\\203\\220\\341\\203\\256\\341\\203\\225\\341\\203\\220 \\341\\203\\225\\341\\203\\224\\341\\203\\240 \\341\\203\\233\\341\\203\\235\\341\\203\\256\\341\\203\\224\\341\\203\\240\\341\\203\\256\\341\\203\\223\\341\\203\\220\\0\"\\\n  \"\\0\"\\\n  \"\\341\\203\\240\\341\\203\\251\\341\\203\\224\\341\\203\\243\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"FictionBook \\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\224\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"%s \\341\\203\\244\\341\\203\\220\\341\\203\\230\\341\\203\\232\\341\\203\\230 \\341\\203\\225\\341\\203\\224\\341\\203\\240 \\341\\203\\233\\341\\203\\235\\341\\203\\230\\341\\203\\253\\341\\203\\224\\341\\203\\221\\341\\203\\234\\341\\203\\220\\0\"\\\n  \"\\341\\203\\244\\341\\203\\220\\341\\203\\230\\341\\203\\232\\341\\203\\230\\341\\203\\241 \\341\\203\\226\\341\\203\\235\\341\\203\\233\\341\\203\\220:\\0\"\\\n  \"\\341\\203\\244\\341\\203\\220\\341\\203\\230\\341\\203\\232\\341\\203\\230:\\0\"\\\n  \"&\\341\\203\\253\\341\\203\\230\\341\\203\\224\\341\\203\\221\\341\\203\\220...\\tCtrl+F\\0\"\\\n  \"\\341\\203\\253\\341\\203\\230\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\250\\341\\203\\224\\341\\203\\233\\341\\203\\223\\341\\203\\224\\341\\203\\222\\341\\203\\230\\341\\203\\241 \\341\\203\\236\\341\\203\\235\\341\\203\\225\\341\\203\\234\\341\\203\\220\\0\"\\\n  \"\\341\\203\\254\\341\\203\\230\\341\\203\\234\\341\\203\\220\\341\\203\\241 \\341\\203\\236\\341\\203\\235\\341\\203\\225\\341\\203\\234\\341\\203\\220\\0\"\\\n  \"\\341\\203\\253\\341\\203\\230\\341\\203\\224\\341\\203\\221\\341\\203\\220:\\0\"\\\n  \"&\\341\\203\\250\\341\\203\\230\\341\\203\\222\\341\\203\\227\\341\\203\\220\\341\\203\\225\\341\\203\\241\\341\\203\\230\\341\\203\\241 \\341\\203\\233\\341\\203\\230\\341\\203\\256\\341\\203\\224\\341\\203\\223\\341\\203\\225\\341\\203\\230\\341\\203\\227\\tCtrl+3\\0\"\\\n  \"&\\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230\\341\\203\\241 \\341\\203\\226\\341\\203\\235\\341\\203\\233\\341\\203\\220\\341\\203\\226\\341\\203\\224 \\341\\203\\233\\341\\203\\235\\341\\203\\240\\341\\203\\222\\341\\203\\224\\341\\203\\221\\341\\203\\220\\tCtrl+0\\0\"\\\n  \"&\\341\\203\\241\\341\\203\\230\\341\\203\\222\\341\\203\\220\\341\\203\\234\\341\\203\\224\\341\\203\\226\\341\\203\\224 \\341\\203\\233\\341\\203\\235\\341\\203\\240\\341\\203\\222\\341\\203\\224\\341\\203\\221\\341\\203\\220\\tCtrl+2\\0\"\\\n  \"\\341\\203\\250\\341\\203\\230\\341\\203\\222\\341\\203\\227\\341\\203\\220\\341\\203\\225\\341\\203\\241\\341\\203\\230\\341\\203\\241 \\341\\203\\233\\341\\203\\230\\341\\203\\256\\341\\203\\224\\341\\203\\223\\341\\203\\225\\341\\203\\230\\341\\203\\227\\0\"\\\n  \"\\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230\\341\\203\\241 \\341\\203\\226\\341\\203\\235\\341\\203\\233\\341\\203\\220\\341\\203\\226\\341\\203\\224 \\341\\203\\233\\341\\203\\235\\341\\203\\240\\341\\203\\222\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\241\\341\\203\\230\\341\\203\\222\\341\\203\\220\\341\\203\\234\\341\\203\\224\\341\\203\\226\\341\\203\\224 \\341\\203\\233\\341\\203\\235\\341\\203\\240\\341\\203\\222\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\244\\341\\203\\220\\341\\203\\234\\341\\203\\257\\341\\203\\240\\341\\203\\230\\341\\203\\241 \\341\\203\\241\\341\\203\\230\\341\\203\\222\\341\\203\\220\\341\\203\\234\\341\\203\\224\\341\\203\\226\\341\\203\\224 \\341\\203\\233\\341\\203\\235\\341\\203\\240\\341\\203\\222\\341\\203\\224\\341\\203\\221\\341\\203\\220 \\341\\203\\223\\341\\203\\220 \\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\241 \\341\\203\\250\\341\\203\\224\\341\\203\\243\\341\\203\\254\\341\\203\\247\\341\\203\\225\\341\\203\\224\\341\\203\\242\\341\\203\\232\\341\\203\\230\\341\\203\\225 \\341\\203\\251\\341\\203\\225\\341\\203\\224\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230\\341\\203\\241 \\341\\203\\233\\341\\203\\235\\341\\203\\240\\341\\203\\222\\341\\203\\224\\341\\203\\221\\341\\203\\220 \\341\\203\\244\\341\\203\\220\\341\\203\\234\\341\\203\\257\\341\\203\\240\\341\\203\\230\\341\\203\\241 \\341\\203\\226\\341\\203\\235\\341\\203\\233\\341\\203\\220\\341\\203\\226\\341\\203\\224\\0\"\\\n  \"\\341\\203\\250\\341\\203\\240\\341\\203\\230\\341\\203\\244\\341\\203\\242\\341\\203\\224\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"\\0\"\\\n  \"\\341\\203\\242\\341\\203\\224\\341\\203\\245\\341\\203\\241\\341\\203\\242\\341\\203\\230 \\341\\203\\234\\341\\203\\220\\341\\203\\236\\341\\203\\235\\341\\203\\225\\341\\203\\234\\341\\203\\230\\341\\203\\220 %s \\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\226\\341\\203\\224\\0\"\\\n  \"\\341\\203\\242\\341\\203\\224\\341\\203\\245\\341\\203\\241\\341\\203\\242\\341\\203\\230 \\341\\203\\234\\341\\203\\220\\341\\203\\236\\341\\203\\235\\341\\203\\225\\341\\203\\234\\341\\203\\230\\341\\203\\220 %s \\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\226\\341\\203\\224 (\\341\\203\\256\\341\\203\\224\\341\\203\\232\\341\\203\\220\\341\\203\\256\\341\\203\\232\\341\\203\\220)\\0\"\\\n  \"\\341\\203\\221\\341\\203\\235\\341\\203\\232\\341\\203\\235\\341\\203\\241 \\341\\203\\254\\341\\203\\220\\341\\203\\231\\341\\203\\230\\341\\203\\227\\341\\203\\256\\341\\203\\243\\341\\203\\232\\341\\203\\230 \\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\224\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"\\341\\203\\222\\341\\203\\221\\0\"\\\n  \"\\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230\\341\\203\\241 \\341\\203\\233\\341\\203\\230\\341\\203\\227\\341\\203\\230\\341\\203\\227\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\221\\341\\203\\235\\341\\203\\232\\341\\203\\235\\341\\203\\241 \\341\\203\\254\\341\\203\\220\\341\\203\\231\\341\\203\\230\\341\\203\\227\\341\\203\\256\\341\\203\\243\\341\\203\\232\\341\\203\\230 \\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\241 \\341\\203\\223\\341\\203\\220\\341\\203\\233\\341\\203\\220\\341\\203\\232\\341\\203\\225\\341\\203\\220\\0\"\\\n  \"\\341\\203\\245\\341\\203\\220\\341\\203\\240\\341\\203\\220\\341\\203\\222\\341\\203\\233\\341\\203\\220: \\341\\203\\253\\341\\203\\224\\341\\203\\221\\341\\203\\234\\341\\203\\230\\341\\203\\241 \\341\\203\\222\\341\\203\\220\\341\\203\\234\\341\\203\\233\\341\\203\\224\\341\\203\\235\\341\\203\\240\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\241\\341\\203\\227\\341\\203\\225\\341\\203\\230\\341\\203\\241 \\341\\203\\222\\341\\203\\220\\341\\203\\233\\341\\203\\235\\341\\203\\230\\341\\203\\247\\341\\203\\224\\341\\203\\234\\341\\203\\224\\341\\203\\227 \\341\\203\\246\\341\\203\\230\\341\\203\\220\\341\\203\\232\\341\\203\\231\\341\\203\\230 \\\"F3\\\"\\0\"\\\n  \"\\341\\203\\234\\341\\203\\220\\341\\203\\256\\341\\203\\220\\341\\203\\242\\341\\203\\230 \\341\\203\\244\\341\\203\\220\\341\\203\\230\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\230 (*.%s)\\0\"\\\n  \"\\341\\203\\231\\341\\203\\221\\0\"\\\n  \"\\341\\203\\233\\341\\203\\221\\0\"\\\n  \"\\341\\203\\234\\341\\203\\220\\341\\203\\233\\341\\203\\223\\341\\203\\225\\341\\203\\230\\341\\203\\232\\341\\203\\220\\341\\203\\223 \\341\\203\\222\\341\\203\\241\\341\\203\\243\\341\\203\\240\\341\\203\\227 SumatraPDF \\341\\203\\227\\341\\203\\245\\341\\203\\225\\341\\203\\224\\341\\203\\234\\341\\203\\241 \\341\\203\\234\\341\\203\\220\\341\\203\\222\\341\\203\\243\\341\\203\\232\\341\\203\\230\\341\\203\\241\\341\\203\\256\\341\\203\\233\\341\\203\\224\\341\\203\\225\\341\\203\\230 PDF \\341\\203\\254\\341\\203\\220\\341\\203\\233\\341\\203\\231\\341\\203\\230\\341\\203\\227\\341\\203\\256\\341\\203\\225\\341\\203\\224\\341\\203\\232\\341\\203\\220\\341\\203\\223 \\341\\203\\223\\341\\203\\220\\341\\203\\247\\341\\203\\224\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\220?\\0\"\\\n  \"\\341\\203\\233\\341\\203\\235\\341\\203\\256\\341\\203\\223\\341\\203\\224\\341\\203\\241 SumatraPDF-\\341\\203\\230\\341\\203\\241 \\341\\203\\220\\341\\203\\241\\341\\203\\235\\341\\203\\252\\341\\203\\230\\341\\203\\240\\341\\203\\224\\341\\203\\221\\341\\203\\220 PDF \\341\\203\\244\\341\\203\\220\\341\\203\\230\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\227\\341\\203\\220\\341\\203\\234\\0\"\\\n  \"\\341\\203\\233\\341\\203\\220\\341\\203\\234&\\341\\203\\222\\341\\203\\220\\341\\203\\241 \\341\\203\\240\\341\\203\\224\\341\\203\\237\\341\\203\\230\\341\\203\\233\\341\\203\\230\\0\"\\\n  \"\\341\\203\\233\\341\\203\\227\\341\\203\\220\\341\\203\\225\\341\\203\\240\\341\\203\\243\\341\\203\\232\\341\\203\\230\\341\\203\\241 \\341\\203\\222\\341\\203\\220\\341\\203\\227\\341\\203\\225\\341\\203\\220\\341\\203\\232\\341\\203\\230\\341\\203\\241\\341\\203\\254\\341\\203\\230\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\227\\0\"\\\n  \"Mobi \\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\224\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"\\341\\203\\250\\341\\203\\224\\341\\203\\252\\341\\203\\225\\341\\203\\232\\341\\203\\230\\341\\203\\232\\341\\203\\230\\341\\203\\220:\\0\"\\\n  \"\\341\\203\\256\\341\\203\\224\\341\\203\\232\\341\\203\\233\\341\\203\\230\\341\\203\\254\\341\\203\\225\\341\\203\\223\\341\\203\\235\\341\\203\\233\\341\\203\\230\\341\\203\\220 \\341\\203\\220\\341\\203\\256\\341\\203\\220\\341\\203\\232\\341\\203\\230 \\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\241\\341\\203\\230\\341\\203\\220 %s. \\341\\203\\222\\341\\203\\241\\341\\203\\243\\341\\203\\240\\341\\203\\227 \\341\\203\\233\\341\\203\\230\\341\\203\\241\\341\\203\\230 \\341\\203\\251\\341\\203\\220\\341\\203\\233\\341\\203\\235\\341\\203\\242\\341\\203\\225\\341\\203\\230\\341\\203\\240\\341\\203\\227\\341\\203\\225\\341\\203\\220?\\0\"\\\n  \"\\341\\203\\250\\341\\203\\224\\341\\203\\233\\341\\203\\223\\341\\203\\224\\341\\203\\222\\341\\203\\230 \\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230\\0\"\\\n  \"\\341\\203\\241\\341\\203\\230\\341\\203\\242\\341\\203\\247\\341\\203\\225\\341\\203\\220 \\341\\203\\220\\341\\203\\240 \\341\\203\\233\\341\\203\\235\\341\\203\\230\\341\\203\\253\\341\\203\\224\\341\\203\\221\\341\\203\\234\\341\\203\\220\\0\"\\\n  \"\\0\"\\\n  \"\\341\\203\\241\\341\\203\\230\\341\\203\\234\\341\\203\\245\\341\\203\\240\\341\\203\\235\\341\\203\\234\\341\\203\\230\\341\\203\\226\\341\\203\\220\\341\\203\\252\\341\\203\\230\\341\\203\\230\\341\\203\\241 \\341\\203\\244\\341\\203\\220\\341\\203\\230\\341\\203\\232\\341\\203\\230 \\341\\203\\225\\341\\203\\224\\341\\203\\240 \\341\\203\\233\\341\\203\\235\\341\\203\\230\\341\\203\\253\\341\\203\\224\\341\\203\\221\\341\\203\\234\\341\\203\\220\\0\"\\\n  \"\\341\\203\\220\\341\\203\\233 \\341\\203\\236\\341\\203\\235\\341\\203\\226\\341\\203\\230\\341\\203\\252\\341\\203\\230\\341\\203\\220\\341\\203\\226\\341\\203\\224 \\341\\203\\241\\341\\203\\230\\341\\203\\234\\341\\203\\245\\341\\203\\240\\341\\203\\235\\341\\203\\234\\341\\203\\230\\341\\203\\226\\341\\203\\220\\341\\203\\252\\341\\203\\230\\341\\203\\230\\341\\203\\241 \\341\\203\\230\\341\\203\\234\\341\\203\\244\\341\\203\\235\\341\\203\\240\\341\\203\\233\\341\\203\\220\\341\\203\\252\\341\\203\\230\\341\\203\\220 \\341\\203\\220\\341\\203\\240 \\341\\203\\220\\341\\203\\240\\341\\203\\230\\341\\203\\241\\0\"\\\n  \"\\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\241 \\341\\203\\240\\341\\203\\220\\341\\203\\235\\341\\203\\223\\341\\203\\224\\341\\203\\234\\341\\203\\235\\341\\203\\221\\341\\203\\220:\\0\"\\\n  \"\\341\\203\\231\\341\\203\\220\\341\\203\\240\\341\\203\\222\\341\\203\\230\\0\"\\\n  \"\\341\\203\\222\\341\\203\\220\\341\\203\\256\\341\\203\\241\\341\\203\\234\\341\\203\\220\\0\"\\\n  \"\\341\\203\\222\\341\\203\\220\\341\\203\\256\\341\\203\\241\\341\\203\\234\\341\\203\\220 PDF-XChange-\\341\\203\\250\\341\\203\\230\\0\"\\\n  \"\\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\230\\341\\203\\241 \\341\\203\\222\\341\\203\\220\\341\\203\\256\\341\\203\\241\\341\\203\\234\\341\\203\\220...\\0\"\\\n  \"%s-\\341\\203\\250\\341\\203\\230 \\341\\203\\222\\341\\203\\220\\341\\203\\256\\341\\203\\241\\341\\203\\234\\341\\203\\220\\0\"\\\n  \"\\341\\203\\222\\341\\203\\220\\341\\203\\256\\341\\203\\241\\341\\203\\234\\341\\203\\220 &Adobe Reader-\\341\\203\\250\\341\\203\\230\\0\"\\\n  \"\\341\\203\\222\\341\\203\\220\\341\\203\\256\\341\\203\\241\\341\\203\\234\\341\\203\\220 &Foxit Reader-\\341\\203\\250\\341\\203\\230\\0\"\\\n  \"\\341\\203\\222\\341\\203\\220\\341\\203\\256\\341\\203\\241\\341\\203\\234\\341\\203\\220 Microsoft HTML Help-\\341\\203\\250\\341\\203\\230\\0\"\\\n  \"\\341\\203\\222\\341\\203\\220\\341\\203\\256\\341\\203\\241\\341\\203\\234\\341\\203\\220 Microsoft XPS-Viewer-\\341\\203\\250\\341\\203\\230\\0\"\\\n  \"&\\341\\203\\227\\341\\203\\225\\341\\203\\230\\341\\203\\241\\341\\203\\224\\341\\203\\221\\341\\203\\224\\341\\203\\221\\341\\203\\230...\\0\"\\\n  \"&\\341\\203\\227\\341\\203\\225\\341\\203\\230\\341\\203\\241\\341\\203\\224\\341\\203\\221\\341\\203\\224\\341\\203\\221\\341\\203\\230...\\tCtrl+D\\0\"\\\n  \"PDF \\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\230\\0\"\\\n  \"PDF-\\341\\203\\230\\341\\203\\241 \\341\\203\\235\\341\\203\\236\\341\\203\\242\\341\\203\\230\\341\\203\\233\\341\\203\\230\\341\\203\\226\\341\\203\\220\\341\\203\\252\\341\\203\\230\\341\\203\\230\\341\\203\\241 \\341\\203\\256\\341\\203\\224\\341\\203\\240\\341\\203\\256\\341\\203\\224\\341\\203\\221\\341\\203\\230:\\0\"\\\n  \"PDF-\\341\\203\\230\\341\\203\\241 \\341\\203\\233\\341\\203\\254\\341\\203\\220\\341\\203\\240\\341\\203\\233\\341\\203\\235\\341\\203\\224\\341\\203\\221\\341\\203\\224\\341\\203\\232\\341\\203\\230:\\0\"\\\n  \"PDF-\\341\\203\\230\\341\\203\\241 \\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\241\\341\\203\\230\\341\\203\\220:\\0\"\\\n  \"PDF \\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\224\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"&\\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230\\341\\203\\241 \\341\\203\\233\\341\\203\\230\\341\\203\\227\\341\\203\\230\\341\\203\\227\\341\\203\\224\\341\\203\\221\\341\\203\\220...\\tCtrl+G\\0\"\\\n  \"%s \\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230\\0\"\\\n  \"\\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230\\341\\203\\241 \\341\\203\\244\\341\\203\\235\\341\\203\\240\\341\\203\\233\\341\\203\\220\\341\\203\\242\\341\\203\\230:\\0\"\\\n  \"%u \\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230 \\341\\203\\220\\341\\203\\240 \\341\\203\\220\\341\\203\\240\\341\\203\\241\\341\\203\\224\\341\\203\\221\\341\\203\\235\\341\\203\\221\\341\\203\\241\\0\"\\\n  \"\\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230\\341\\203\\241 \\341\\203\\233\\341\\203\\220\\341\\203\\241\\341\\203\\250\\341\\203\\242\\341\\203\\220\\341\\203\\221\\341\\203\\230\\341\\203\\240\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230:\\0\"\\\n  \"PalmDoc \\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\224\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"\\341\\203\\233\\341\\203\\230\\341\\203\\233\\341\\203\\223\\341\\203\\230\\341\\203\\234\\341\\203\\220\\341\\203\\240\\341\\203\\224\\341\\203\\235\\341\\203\\221\\341\\203\\241 \\341\\203\\240\\341\\203\\224\\341\\203\\234\\341\\203\\223\\341\\203\\224\\341\\203\\240\\341\\203\\230, \\341\\203\\222\\341\\203\\227\\341\\203\\256\\341\\203\\235\\341\\203\\225\\341\\203\\227 \\341\\203\\233\\341\\203\\235\\341\\203\\230\\341\\203\\252\\341\\203\\220\\341\\203\\223\\341\\203\\224\\341\\203\\227...\\0\"\\\n  \"Postscript \\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\224\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"\\341\\203\\254\\341\\203\\220\\341\\203\\240\\341\\203\\233\\341\\203\\235\\341\\203\\223\\341\\203\\222&\\341\\203\\224\\341\\203\\234\\341\\203\\220\\tCtrl+L\\0\"\\\n  \"\\341\\203\\254\\341\\203\\230\\341\\203\\234\\341\\203\\220 \\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230\\0\"\\\n  \"\\341\\203\\220\\341\\203\\233\\341\\203\\235\\341\\203\\221\\341\\203\\224\\341\\203\\255\\341\\203\\223\\341\\203\\225\\341\\203\\220\\0\"\\\n  \"\\341\\203\\221\\341\\203\\224\\341\\203\\255\\341\\203\\223\\341\\203\\225\\341\\203\\230\\341\\203\\241 \\341\\203\\223\\341\\203\\230\\341\\203\\220\\341\\203\\236\\341\\203\\220\\341\\203\\226\\341\\203\\235\\341\\203\\234\\341\\203\\230\\0\"\\\n  \"\\341\\203\\233\\341\\203\\235\\341\\203\\252\\341\\203\\224\\341\\203\\233\\341\\203\\243\\341\\203\\232\\341\\203\\230 \\341\\203\\241\\341\\203\\220\\341\\203\\256\\341\\203\\224\\341\\203\\232\\341\\203\\230\\341\\203\\241 \\341\\203\\233\\341\\203\\245\\341\\203\\235\\341\\203\\234\\341\\203\\224 \\341\\203\\236\\341\\203\\240\\341\\203\\230\\341\\203\\234\\341\\203\\224\\341\\203\\242\\341\\203\\240\\341\\203\\230 \\341\\203\\220\\341\\203\\240 \\341\\203\\220\\341\\203\\240\\341\\203\\241\\341\\203\\224\\341\\203\\221\\341\\203\\235\\341\\203\\221\\341\\203\\241\\0\"\\\n  \"\\341\\203\\233\\341\\203\\230\\341\\203\\233\\341\\203\\223\\341\\203\\230\\341\\203\\234\\341\\203\\220\\341\\203\\240\\341\\203\\224\\341\\203\\235\\341\\203\\221\\341\\203\\241 \\341\\203\\221\\341\\203\\224\\341\\203\\255\\341\\203\\223\\341\\203\\225\\341\\203\\220.\\0\"\\\n  \"\\0\"\\\n  \"\\341\\203\\233\\341\\203\\230\\341\\203\\233\\341\\203\\223\\341\\203\\230\\341\\203\\234\\341\\203\\220\\341\\203\\240\\341\\203\\224\\341\\203\\235\\341\\203\\221\\341\\203\\241 \\341\\203\\220\\341\\203\\233\\341\\203\\235\\341\\203\\221\\341\\203\\224\\341\\203\\255\\341\\203\\223\\341\\203\\225\\341\\203\\220. \\341\\203\\222\\341\\203\\241\\341\\203\\243\\341\\203\\240\\341\\203\\227 \\341\\203\\222\\341\\203\\220\\341\\203\\243\\341\\203\\245\\341\\203\\233\\341\\203\\224\\341\\203\\221\\341\\203\\220 \\341\\203\\223\\341\\203\\220 \\341\\203\\256\\341\\203\\224\\341\\203\\232\\341\\203\\220\\341\\203\\256\\341\\203\\232\\341\\203\\220 \\341\\203\\223\\341\\203\\220\\341\\203\\254\\341\\203\\247\\341\\203\\224\\341\\203\\221\\341\\203\\220?\\0\"\\\n  \"\\341\\203\\233\\341\\203\\230\\341\\203\\233\\341\\203\\223\\341\\203\\230\\341\\203\\234\\341\\203\\220\\341\\203\\240\\341\\203\\224\\341\\203\\235\\341\\203\\221\\341\\203\\241 %d (%d-\\341\\203\\230\\341\\203\\223\\341\\203\\220\\341\\203\\234) \\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230\\341\\203\\241 \\341\\203\\220\\341\\203\\233\\341\\203\\235\\341\\203\\221\\341\\203\\224\\341\\203\\255\\341\\203\\223\\341\\203\\225\\341\\203\\220...\\0\"\\\n  \"\\341\\203\\220\\341\\203\\233\\341\\203\\235\\341\\203\\221\\341\\203\\224\\341\\203\\255\\341\\203\\223\\341\\203\\225\\341\\203\\230\\341\\203\\241 \\341\\203\\236\\341\\203\\240\\341\\203\\235\\341\\203\\221\\341\\203\\232\\341\\203\\224\\341\\203\\233\\341\\203\\220.\\0\"\\\n  \"\\0\"\\\n  \"&\\341\\203\\244\\341\\203\\220\\341\\203\\230\\341\\203\\232\\341\\203\\230\\341\\203\\241 \\341\\203\\236\\341\\203\\235\\341\\203\\226\\341\\203\\230\\341\\203\\252\\341\\203\\230\\341\\203\\230\\341\\203\\241 \\341\\203\\223\\341\\203\\220\\341\\203\\233\\341\\203\\220\\341\\203\\256\\341\\203\\241\\341\\203\\235\\341\\203\\225\\341\\203\\240\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\240\\341\\203\\251\\341\\203\\224\\341\\203\\243\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\223\\341\\203\\220\\341\\203\\234 \\341\\203\\254\\341\\203\\220\\341\\203\\250\\341\\203\\232\\341\\203\\220\\0\"\\\n  \"%s \\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230\\341\\203\\241 \\341\\203\\254\\341\\203\\220\\341\\203\\250\\341\\203\\232\\341\\203\\220 \\341\\203\\240\\341\\203\\251\\341\\203\\224\\341\\203\\243\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\223\\341\\203\\220\\341\\203\\234\\0\"\\\n  \"\\0\"\\\n  \"\\341\\203\\233\\341\\203\\220\\341\\203\\240&\\341\\203\\252\\341\\203\\256\\341\\203\\234\\341\\203\\230\\341\\203\\225 \\341\\203\\222\\341\\203\\220\\341\\203\\223\\341\\203\\220\\341\\203\\221\\341\\203\\240\\341\\203\\243\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\220\\tCtrl+Shift+-\\0\"\\\n  \"\\341\\203\\233\\341\\203\\220\\341\\203\\240&\\341\\203\\257\\341\\203\\225\\341\\203\\234\\341\\203\\230\\341\\203\\225 \\341\\203\\222\\341\\203\\220\\341\\203\\223\\341\\203\\220\\341\\203\\221\\341\\203\\240\\341\\203\\243\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\220\\tCtrl+Shift++\\0\"\\\n  \"\\341\\203\\250\\341\\203\\224\\341\\203\\234\\341\\203\\220\\341\\203\\256\\341\\203\\225\\341\\203\\220 \\341\\203\\240\\341\\203\\235\\341\\203\\222\\341\\203\\235\\341\\203\\240\\341\\203\\252\\0\"\\\n  \"&\\341\\203\\251\\341\\203\\220\\341\\203\\234\\341\\203\\230\\341\\203\\250\\341\\203\\225\\341\\203\\234\\341\\203\\220\\342\\200\\246\\tCtrl+Shift+S\\0\"\\\n  \"\\341\\203\\233\\341\\203\\230\\341\\203\\233\\341\\203\\223\\341\\203\\230\\341\\203\\234\\341\\203\\220\\341\\203\\240\\341\\203\\224\\341\\203\\235\\341\\203\\221\\341\\203\\241 \\341\\203\\253\\341\\203\\224\\341\\203\\221\\341\\203\\234\\341\\203\\220 %d %d-\\341\\203\\230\\341\\203\\223\\341\\203\\220\\341\\203\\234...\\0\"\\\n  \"\\341\\203\\247&\\341\\203\\225\\341\\203\\224\\341\\203\\232\\341\\203\\220\\341\\203\\241 \\341\\203\\233\\341\\203\\235\\341\\203\\234\\341\\203\\230\\341\\203\\250\\341\\203\\225\\341\\203\\234\\341\\203\\220\\0\"\\\n  \"\\341\\203\\247&\\341\\203\\225\\341\\203\\224\\341\\203\\232\\341\\203\\220\\341\\203\\241 \\341\\203\\233\\341\\203\\235\\341\\203\\234\\341\\203\\230\\341\\203\\250\\341\\203\\225\\341\\203\\234\\341\\203\\220\\tCtrl+A\\0\"\\\n  \"\\341\\203\\220\\341\\203\\230\\341\\203\\240\\341\\203\\251\\341\\203\\230\\341\\203\\224\\341\\203\\227 \\341\\203\\250\\341\\203\\230\\341\\203\\222\\341\\203\\227\\341\\203\\220\\341\\203\\225\\341\\203\\241\\341\\203\\230, Ctrl \\341\\203\\223\\341\\203\\220 \\341\\203\\233\\341\\203\\220\\341\\203\\243\\341\\203\\241\\341\\203\\230\\341\\203\\241 \\341\\203\\233\\341\\203\\220\\341\\203\\240\\341\\203\\252\\341\\203\\256\\341\\203\\224\\341\\203\\234\\341\\203\\220 \\341\\203\\246\\341\\203\\230\\341\\203\\232\\341\\203\\220\\341\\203\\231\\341\\203\\226\\341\\203\\224 \\341\\203\\223\\341\\203\\220\\341\\203\\255\\341\\203\\224\\341\\203\\240\\341\\203\\230\\341\\203\\227\\0\"\\\n  \"\\0\"\\\n  \"&\\341\\203\\224\\341\\203\\232.\\341\\203\\244\\341\\203\\235\\341\\203\\241\\341\\203\\242\\341\\203\\230\\341\\203\\227 \\341\\203\\222\\341\\203\\220\\341\\203\\222\\341\\203\\226\\341\\203\\220\\341\\203\\225\\341\\203\\234\\341\\203\\220...\\0\"\\\n  \"\\341\\203\\250\\341\\203\\224\\341\\203\\221\\341\\203\\240\\341\\203\\243\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\243\\341\\203\\232\\341\\203\\230 \\341\\203\\253\\341\\203\\224\\341\\203\\221\\341\\203\\234\\341\\203\\230\\341\\203\\241 \\341\\203\\221\\341\\203\\240\\341\\203\\253\\341\\203\\220\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\241 \\341\\203\\241\\341\\203\\242\\341\\203\\240\\341\\203\\230\\341\\203\\245\\341\\203\\235\\341\\203\\234\\341\\203\\230\\341\\203\\241 \\341\\203\\223\\341\\203\\220\\341\\203\\247\\341\\203\\224\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"&\\341\\203\\241\\341\\203\\220\\341\\203\\234\\341\\203\\230\\341\\203\\250\\341\\203\\234\\341\\203\\224\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\241 \\341\\203\\251\\341\\203\\225\\341\\203\\224\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"&\\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\241 \\341\\203\\250\\341\\203\\224\\341\\203\\243\\341\\203\\254\\341\\203\\247\\341\\203\\225\\341\\203\\224\\341\\203\\242\\341\\203\\232\\341\\203\\230\\341\\203\\225 \\341\\203\\251\\341\\203\\225\\341\\203\\224\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"&\\341\\203\\256\\341\\203\\224\\341\\203\\232\\341\\203\\241\\341\\203\\220\\341\\203\\254\\341\\203\\247\\341\\203\\235\\341\\203\\227\\341\\203\\220 \\341\\203\\226\\341\\203\\235\\341\\203\\232\\341\\203\\230\\341\\203\\241 \\341\\203\\251\\341\\203\\225\\341\\203\\224\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\240\\341\\203\\251\\341\\203\\224\\341\\203\\243\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\241 \\341\\203\\251\\341\\203\\225\\341\\203\\224\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\256\\341\\203\\250\\341\\203\\230\\341\\203\\240\\341\\203\\220\\341\\203\\223 \\341\\203\\254\\341\\203\\220\\341\\203\\231\\341\\203\\230\\341\\203\\227\\341\\203\\256\\341\\203\\243\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\241 \\341\\203\\251\\341\\203\\225\\341\\203\\224\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"&\\341\\203\\241\\341\\203\\220\\341\\203\\234\\341\\203\\230\\341\\203\\250\\341\\203\\234\\341\\203\\224\\341\\203\\227\\341\\203\\220 \\341\\203\\226\\341\\203\\235\\341\\203\\232\\341\\203\\230\\341\\203\\241 \\341\\203\\251\\341\\203\\225\\341\\203\\224\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\220 (\\341\\203\\227\\341\\203\\243 \\341\\203\\250\\341\\203\\224\\341\\203\\241\\341\\203\\220\\341\\203\\253\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\224\\341\\203\\232\\341\\203\\230\\341\\203\\220)\\0\"\\\n  \"\\341\\203\\224\\341\\203\\240\\341\\203\\227-\\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\230\\341\\203\\220\\341\\203\\234\\341\\203\\230\\0\"\\\n  \"\\341\\203\\221\\341\\203\\235\\341\\203\\223\\341\\203\\230\\341\\203\\250\\341\\203\\241 \\341\\203\\222\\341\\203\\230\\341\\203\\256\\341\\203\\223\\341\\203\\230\\341\\203\\227, \\341\\203\\224\\341\\203\\241 \\341\\203\\220\\341\\203\\240 \\341\\203\\243\\341\\203\\234\\341\\203\\223\\341\\203\\220 \\341\\203\\233\\341\\203\\235\\341\\203\\233\\341\\203\\256\\341\\203\\223\\341\\203\\220\\341\\203\\240\\341\\203\\230\\341\\203\\247\\341\\203\\235!\\n\\n\\341\\203\\227\\341\\203\\243 \\341\\203\\222\\341\\203\\241\\341\\203\\243\\341\\203\\240\\341\\203\\227 \\341\\203\\240\\341\\203\\235\\341\\203\\233 \\341\\203\\223\\341\\203\\220\\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\256\\341\\203\\233\\341\\203\\220\\341\\203\\240\\341\\203\\235\\341\\203\\227 \\341\\203\\220\\341\\203\\233 \\341\\203\\236\\341\\203\\240\\341\\203\\235\\341\\203\\221\\341\\203\\232\\341\\203\\224\\341\\203\\233\\341\\203\\230\\341\\203\\241 \\341\\203\\233\\341\\203\\235\\341\\203\\222\\341\\203\\225\\341\\203\\220\\341\\203\\240\\341\\203\\224\\341\\203\\221\\341\\203\\220\\341\\203\\250\\341\\203\\230, \\341\\203\\222\\341\\203\\227\\341\\203\\256\\341\\203\\235\\341\\203\\225\\341\\203\\227 \\341\\203\\223\\341\\203\\220\\341\\203\\220\\341\\203\\254\\341\\203\\231\\341\\203\\220\\341\\203\\236\\341\\203\\243\\341\\203\\234\\341\\203\\224\\341\\203\\227 \\341\\203\\246\\341\\203\\230\\341\\203\\232\\341\\203\\220\\341\\203\\231\\341\\203\\241 '\\341\\203\\222\\341\\203\\220\\341\\203\\243\\341\\203\\245\\341\\203\\233\\341\\203\\224\\341\\203\\221\\341\\203\\220'.\\0\"\\\n  \"\\341\\203\\254\\341\\203\\247\\341\\203\\220\\341\\203\\240\\341\\203\\235\\341\\203\\241 \\341\\203\\244\\341\\203\\220\\341\\203\\230\\341\\203\\232\\341\\203\\241 %s \\341\\203\\220\\341\\203\\240 \\341\\203\\220\\341\\203\\245\\341\\203\\225\\341\\203\\241 \\341\\203\\241\\341\\203\\230\\341\\203\\234\\341\\203\\245\\341\\203\\240\\341\\203\\235\\341\\203\\234\\341\\203\\230\\341\\203\\226\\341\\203\\220\\341\\203\\252\\341\\203\\230\\341\\203\\230\\341\\203\\241 \\341\\203\\254\\341\\203\\224\\341\\203\\240\\341\\203\\242\\341\\203\\230\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"\\341\\203\\227\\341\\203\\224\\341\\203\\233\\341\\203\\220:\\0\"\\\n  \"SumatraPDF-\\341\\203\\230\\341\\203\\241 \\341\\203\\236\\341\\203\\220\\341\\203\\240\\341\\203\\220\\341\\203\\233\\341\\203\\224\\341\\203\\242\\341\\203\\240\\341\\203\\224\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"SumatraPDF-\\341\\203\\230\\341\\203\\241 \\341\\203\\222\\341\\203\\220\\341\\203\\234\\341\\203\\220\\341\\203\\256\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"SumatraPDF-\\341\\203\\230\\341\\203\\241 \\341\\203\\233\\341\\203\\243\\341\\203\\250\\341\\203\\220\\341\\203\\235\\341\\203\\221\\341\\203\\220 \\341\\203\\220\\341\\203\\225\\341\\203\\220\\341\\203\\240\\341\\203\\230\\341\\203\\243\\341\\203\\232\\341\\203\\220\\341\\203\\223 \\341\\203\\223\\341\\203\\220\\341\\203\\241\\341\\203\\240\\341\\203\\243\\341\\203\\232\\341\\203\\223\\341\\203\\220\\0\"\\\n  \"SumatraPDF \\341\\203\\227\\341\\203\\245\\341\\203\\225\\341\\203\\224\\341\\203\\234\\341\\203\\230 \\341\\203\\253\\341\\203\\230\\341\\203\\240\\341\\203\\230\\341\\203\\227\\341\\203\\220\\341\\203\\223\\341\\203\\230 PDF \\341\\203\\254\\341\\203\\220\\341\\203\\233\\341\\203\\231\\341\\203\\230\\341\\203\\227\\341\\203\\256\\341\\203\\225\\341\\203\\224\\341\\203\\232\\341\\203\\230\\341\\203\\220\\0\"\\\n  \"\\341\\203\\220\\341\\203\\233\\341\\203\\230\\341\\203\\224\\341\\203\\240\\341\\203\\230\\341\\203\\223\\341\\203\\220\\341\\203\\234 SumatraPDF \\341\\203\\227\\341\\203\\245\\341\\203\\225\\341\\203\\224\\341\\203\\234\\341\\203\\230 \\341\\203\\253\\341\\203\\230\\341\\203\\240\\341\\203\\230\\341\\203\\227\\341\\203\\220\\341\\203\\223\\341\\203\\230 PDF \\341\\203\\254\\341\\203\\220\\341\\203\\233\\341\\203\\231\\341\\203\\230\\341\\203\\227\\341\\203\\256\\341\\203\\225\\341\\203\\224\\341\\203\\232\\341\\203\\230\\341\\203\\220\\0\"\\\n  \"\\341\\203\\241\\341\\203\\230\\341\\203\\234\\341\\203\\245\\341\\203\\240\\341\\203\\235\\341\\203\\234\\341\\203\\230\\341\\203\\226\\341\\203\\220\\341\\203\\252\\341\\203\\230\\341\\203\\230\\341\\203\\241 \\341\\203\\244\\341\\203\\220\\341\\203\\230\\341\\203\\232\\341\\203\\230\\341\\203\\241 \\341\\203\\222\\341\\203\\220\\341\\203\\256\\341\\203\\241\\341\\203\\234\\341\\203\\220 \\341\\203\\225\\341\\203\\224\\341\\203\\240 \\341\\203\\233\\341\\203\\235\\341\\203\\256\\341\\203\\224\\341\\203\\240\\341\\203\\256\\341\\203\\223\\341\\203\\220\\0\"\\\n  \"\\0\"\\\n  \"\\341\\203\\242\\341\\203\\224\\341\\203\\245\\341\\203\\241\\341\\203\\242\\341\\203\\243\\341\\203\\240\\341\\203\\230 \\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\224\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"\\0\"\\\n  \"\\341\\203\\241\\341\\203\\220\\341\\203\\227\\341\\203\\220\\341\\203\\243\\341\\203\\240\\341\\203\\230:\\0\"\\\n  \"\\341\\203\\254\\341\\203\\247\\341\\203\\220\\341\\203\\240\\341\\203\\235\\341\\203\\241 \\341\\203\\244\\341\\203\\220\\341\\203\\230\\341\\203\\232\\341\\203\\230 \\341\\203\\243\\341\\203\\252\\341\\203\\234\\341\\203\\235\\341\\203\\221\\341\\203\\230\\341\\203\\220 (%s)\\0\"\\\n  \"\\341\\203\\251\\341\\203\\220&\\341\\203\\234\\341\\203\\220\\341\\203\\240\\341\\203\\227\\341\\203\\224\\341\\203\\221\\341\\203\\230\\341\\203\\241 \\341\\203\\222\\341\\203\\220\\341\\203\\233\\341\\203\\235\\341\\203\\247\\341\\203\\224\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\256\\341\\203\\224\\341\\203\\223\\341\\203\\230\\0\"\\\n  \"&\\341\\203\\225\\341\\203\\224\\341\\203\\221-\\341\\203\\222\\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\223\\341\\203\\226\\341\\203\\224 \\341\\203\\222\\341\\203\\220\\341\\203\\223\\341\\203\\220\\341\\203\\241\\341\\203\\225\\341\\203\\232\\341\\203\\220\\0\"\\\n  \"\\341\\203\\222\\341\\203\\220\\341\\203\\244\\341\\203\\240\\341\\203\\227\\341\\203\\256\\341\\203\\230\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"XPS \\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\224\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"\\341\\203\\227\\341\\203\\245\\341\\203\\225\\341\\203\\224\\341\\203\\234 \\341\\203\\230\\341\\203\\247\\341\\203\\224\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\227 \\341\\203\\243\\341\\203\\220\\341\\203\\256\\341\\203\\232\\341\\203\\224\\341\\203\\241 \\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\241\\341\\203\\230\\341\\203\\220\\341\\203\\241.\\0\"\\\n  \"\\341\\203\\227\\341\\203\\245\\341\\203\\225\\341\\203\\224\\341\\203\\234 \\341\\203\\230\\341\\203\\247\\341\\203\\224\\341\\203\\234\\341\\203\\224\\341\\203\\221\\341\\203\\227 %s \\341\\203\\225\\341\\203\\224\\341\\203\\240\\341\\203\\241\\341\\203\\230\\341\\203\\220\\341\\203\\241\\0\"\\\n  \"\\341\\203\\233\\341\\203\\220\\341\\203\\241\\341\\203\\250\\341\\203\\242\\341\\203\\220\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"\\341\\203\\222\\341\\203\\220\\341\\203\\223\\341\\203\\230\\341\\203\\223\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\223\\341\\203\\220\\341\\203\\236\\341\\203\\220\\341\\203\\242\\341\\203\\220\\341\\203\\240\\341\\203\\220\\341\\203\\225\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\233\\341\\203\\220\\341\\203\\241\\341\\203\\250\\341\\203\\242\\341\\203\\220\\341\\203\\221\\341\\203\\230\\0\"\\\n  \"[\\341\\203\\220\\341\\203\\246\\341\\203\\233\\341\\203\\235\\341\\203\\251\\341\\203\\224\\341\\203\\234\\341\\203\\230\\341\\203\\232\\341\\203\\230\\341\\203\\220 \\341\\203\\252\\341\\203\\225\\341\\203\\232\\341\\203\\230\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\224\\341\\203\\221\\341\\203\\230; \\341\\203\\233\\341\\203\\230\\341\\203\\233\\341\\203\\223\\341\\203\\230\\341\\203\\234\\341\\203\\220\\341\\203\\240\\341\\203\\224\\341\\203\\235\\341\\203\\221\\341\\203\\241 \\341\\203\\222\\341\\203\\220\\341\\203\\234\\341\\203\\220\\341\\203\\256\\341\\203\\232\\341\\203\\224\\341\\203\\221\\341\\203\\220...] %s\\0\"\\\n  \"\\341\\203\\242\\341\\203\\224\\341\\203\\245\\341\\203\\241\\341\\203\\242\\341\\203\\230 \\341\\203\\231\\341\\203\\235\\341\\203\\236\\341\\203\\230\\341\\203\\240\\341\\203\\223\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\"\\\n  \"\\341\\203\\223\\341\\203\\235\\341\\203\\231\\341\\203\\243\\341\\203\\233\\341\\203\\224\\341\\203\\234\\341\\203\\242\\341\\203\\230 \\341\\203\\230\\341\\203\\221\\341\\203\\224\\341\\203\\255\\341\\203\\223\\341\\203\\224\\341\\203\\221\\341\\203\\220\\0\";\n\nconst char * gTranslations_de = \n  \"\\303\\234ber &SumatraPDF\\0\"\\\n  \"&Tats\\303\\244chliche Gr\\303\\266\\303\\237e\\tStrg+1\\0\"\\\n  \"&Mehr Optionen\\342\\200\\246\\0\"\\\n  \"&Alle angegebenen Seiten\\0\"\\\n  \"&Zur\\303\\274ck\\tAlt+<-\\0\"\\\n  \"&Buchansicht\\tStrg+8\\0\"\\\n  \"&Schlie\\303\\237en\\tStrg+W\\0\"\\\n  \"Auswahl &kopieren\\0\"\\\n  \"Auswahl &kopieren\\tStrg+C\\0\"\\\n  \"Nicht &wieder fragen.\\0\"\\\n  \"Nur &gerade Seiten\\0\"\\\n  \"&Doppelseite\\tStrg+7\\0\"\\\n  \"&Datei\\0\"\\\n  \"&Suchen nach:\\0\"\\\n  \"&Erste Seite\\tPos1\\0\"\\\n  \"Seiten in Druckbereich &einpassen\\0\"\\\n  \"&Gehe zu\\0\"\\\n  \"&Gehe zu Seite:\\0\"\\\n  \"&Hilfe\\0\"\\\n  \"&Letzte Seite\\tEnde\\0\"\\\n  \"&Vergr\\303\\266\\303\\237erung:\\0\"\\\n  \"&Handbuch\\0\"\\\n  \"&Gro\\303\\237-/Kleinschreibung beachten\\0\"\\\n  \"&N\\303\\244chste Seite\\t->\\0\"\\\n  \"&Nein\\0\"\\\n  \"&Nein danke\\0\"\\\n  \"Nur &ungerade Seiten\\0\"\\\n  \"\\303\\226&ffnen\\0\"\\\n  \"\\303\\226&ffnen\\342\\200\\246\\tStrg+O\\0\"\\\n  \"&Optionen\\342\\200\\246\\0\"\\\n  \"&Passwort:\\0\"\\\n  \"Auf dieser Seite &behalten\\0\"\\\n  \"&Vorherige Seite\\t<-\\0\"\\\n  \"&Drucken\\342\\200\\246\\0\"\\\n  \"&Drucken\\342\\200\\246\\tStrg+P\\0\"\\\n  \"&Drucken\\342\\200\\246 (verweigert)\\0\"\\\n  \"Passwort f\\303\\274r dieses Dokument &merken\\0\"\\\n  \"Ansicht-&Einstellungen f\\303\\274r jedes Dokument einzeln merken\\0\"\\\n  \"Von dieser Seite &entfernen\\0\"\\\n  \"&Speichern unter\\342\\200\\246\\0\"\\\n  \"Speichern &unter\\342\\200\\246\\tStrg+S\\0\"\\\n  \"&Einstellungen\\0\"\\\n  \"Seiten auf Druckbereich &verkleinern (falls n\\303\\266tig)\\0\"\\\n  \"&Einzelne Seite\\tStrg+6\\0\"\\\n  \"&Diese Version \\303\\274berspringen.\\0\"\\\n  \"Seitengr\\303\\266\\303\\237e &nicht anpassen\\0\"\\\n  \"&Ansicht\\0\"\\\n  \"Fe&nster\\0\"\\\n  \"&Ja\\0\"\\\n  \"\\0\"\\\n  \"(von %d)\\0\"\\\n  \"(Seite %s)\\0\"\\\n  \"\\303\\234ber SumatraPDF\\0\"\\\n  \"Favoriten hinzuf\\303\\274gen\\0\"\\\n  \"Seite %s hinzuf\\303\\274gen\\342\\200\\246\\0\"\\\n  \"Bezeichnung des Favoriten f\\303\\274r Seite %s (optional):\\0\"\\\n  \"Zu Favoriten hinzuf\\303\\274gen\\342\\200\\246\\0\"\\\n  \"Weiteres\\0\"\\\n  \"Alle Dateien\\0\"\\\n  \"Alle unterst\\303\\274tzten Dokumente\\0\"\\\n  \"Anwendung:\\0\"\\\n  \"Mit PDF-Dateien verkn\\303\\274pfen?\\0\"\\\n  \"Anhang: %s\\0\"\\\n  \"Autor:\\0\"\\\n  \"Automatisch\\0\"\\\n  \"&Automatisch nach Updates suchen\\0\"\\\n  \"Buchansicht\\0\"\\\n  \"Lese&zeichen\\tF12\\0\"\\\n  \"Lesezeichen-Verkn\\303\\274pfungen\\0\"\\\n  \"Lesezeichen-Verkn\\303\\274pfung zu Seite %s von %s\\0\"\\\n  \"Lesezeichen\\0\"\\\n  \"Byte\\0\"\\\n  \"CHM Hilfe-Dateien\\0\"\\\n  \"Keine Verbindung zum Internet m\\303\\266glich (Fehler %#x).\\0\"\\\n  \"Abbrechen\\0\"\\\n  \"Datei kann nicht gedruckt werden\\0\"\\\n  \"Fehler beim Ausf\\303\\274hren des Befehls f\\303\\274r die Inverssuche. Bitte \\303\\274berpr\\303\\274fen Sie die Einstellung.\\0\"\\\n  \"Sprache \\303\\244ndern\\342\\200\\246 (Change Language)\\0\"\\\n  \"Nach &neuer Version suchen\\0\"\\\n  \"Comicb\\303\\274cher\\0\"\\\n  \"Kompatibilit\\303\\244t\\0\"\\\n  \"Fortlaufend\\0\"\\\n  \"Fortlaufende Buchansicht\\0\"\\\n  \"Fortlaufende Doppelseiten\\0\"\\\n  \"\\303\\234bersetzung beisteuern\\0\"\\\n  \"&Bild kopieren\\0\"\\\n  \"Adresse des &Links kopieren\\0\"\\\n  \"K&ommentar kopieren\\0\"\\\n  \"Text kopieren verweigert (nur als Bild kopiert)\\0\"\\\n  \"\\0\"\\\n  \"Konnte Druckereigenschaften nicht bestimmen\\0\"\\\n  \"Der Drucker konnte nicht initialisiert werden\\0\"\\\n  \"Diese Seite kann leider nicht angezeigt werden\\0\"\\\n  \"Erstellt am:\\0\"\\\n  \"Aktuelle Datei\\0\"\\\n  \"Zeigerposition:\\0\"\\\n  \"&Zoomfaktor\\342\\200\\246\\tStrg+Y\\0\"\\\n  \"&Standardlayout:\\0\"\\\n  \"Standard&vergr\\303\\266\\303\\237erung:\\0\"\\\n  \"Standardanwendung im portablen Modus nicht ver\\303\\244nderbar\\0\"\\\n  \"Einschr\\303\\244nkungen:\\0\"\\\n  \"DjVu-Dokumente\\0\"\\\n  \"Dokumenteigenschaften\\0\"\\\n  \"Herunterladen\\0\"\\\n  \"&Beenden\\tStrg+Q\\0\"\\\n  \"EPUB E-B\\303\\274cher\\0\"\\\n  \"Bitte Passwort eingeben\\0\"\\\n  \"Bitte Passwort f\\303\\274r %s eingeben\\0\"\\\n  \"Beim Doppelklicken im PDF Dokument wird der folgende Befehl ausgef\\303\\274hrt:\\0\"\\\n  \"Fehler beim \\303\\226ffnen von %s\\0\"\\\n  \"&Favoriten\\0\"\\\n  \"Vor&w\\303\\244rts\\tAlt+->\\0\"\\\n  \"&Vollbild\\tF11\\0\"\\\n  \"Doppelseite\\0\"\\\n  \"Die Datei konnte nicht umbenannt werden!\\0\"\\\n  \"Die Datei konnte nicht neu gespeichert werden!\\0\"\\\n  \"Schnelle Webanzeige\\0\"\\\n  \"Favoriten\\0\"\\\n  \"FictionBook E-B\\303\\274cher\\0\"\\\n  \"Datei %s nicht gefunden\\0\"\\\n  \"Dateigr\\303\\266\\303\\237e:\\0\"\\\n  \"Datei:\\0\"\\\n  \"S&uchen\\342\\200\\246\\tStrg+F\\0\"\\\n  \"Suchen\\0\"\\\n  \"Weitersuchen\\0\"\\\n  \"R\\303\\274ckw\\303\\244rts suchen\\0\"\\\n  \"Suchen:\\0\"\\\n  \"An &Inhalt anpassen\\tStrg+3\\0\"\\\n  \"An &Seite anpassen\\tStrg+0\\0\"\\\n  \"An &Breite anpassen\\tStrg+2\\0\"\\\n  \"An Inhalt anpassen\\0\"\\\n  \"An Seite anpassen\\0\"\\\n  \"An Breite anpassen\\0\"\\\n  \"An Breite anpassen und Seiten fortlaufend anzeigen\\0\"\\\n  \"An eine einzelne Seite anpassen\\0\"\\\n  \"Schriftarten:\\0\"\\\n  \"Buch wird formatiert\\342\\200\\246 Seite %d\\0\"\\\n  \"Text auf Seite %s gefunden\\0\"\\\n  \"Text auf Seite %s gefunden (erneut)\\0\"\\\n  \"Oft gelesene Dokumente\\0\"\\\n  \"\\0\"\\\n  \"Gehe zu Seite\\0\"\\\n  \"Oft gelesene Dokumente ausblenden\\0\"\\\n  \"Tipp: F3-Taste verwenden, um weiterzusuchen\\0\"\\\n  \"Bilder (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"SumatraPDF als Standardanwendung f\\303\\274r PDF-Dateien registrieren?\\0\"\\\n  \"Standardm\\303\\244\\303\\237ig PDF-Dateien mit SumatraPDF \\303\\266ffnen\\0\"\\\n  \"Lese&richtung umkehren\\0\"\\\n  \"Gro\\303\\237-/Kleinschreibung beachten\\0\"\\\n  \"Kindle E-B\\303\\274cher\\0\"\\\n  \"Ge\\303\\244ndert am:\\0\"\\\n  \"Es ist die neue Version %s vorhanden. M\\303\\266chten Sie diese herunterladen?\\0\"\\\n  \"&N\\303\\244chste Seite\\0\"\\\n  \"Suchbegriff nicht gefunden\\0\"\\\n  \"In der N\\303\\244he von Zeile %u in der Datei %s wurde kein Resultat gefunden\\0\"\\\n  \"Synchronisationsdatei nicht gefunden\\0\"\\\n  \"Keine Synchronisationsinformationen verf\\303\\274gbar\\0\"\\\n  \"Anzahl der Seiten:\\0\"\\\n  \"\\0\"\\\n  \"\\303\\226ffnen\\342\\200\\246\\0\"\\\n  \"Mit PDF-&XChange \\303\\266ffnen\\0\"\\\n  \"Dokument \\303\\266ffnen\\342\\200\\246\\0\"\\\n  \"Mit %s \\303\\266ffnen\\0\"\\\n  \"Mit &Adobe Reader \\303\\266ffnen\\0\"\\\n  \"Mit F&oxit Reader \\303\\266ffnen\\0\"\\\n  \"Mit &Microsoft HTML Hilfe \\303\\266ffnen\\0\"\\\n  \"Mit &Microsoft XPS-Viewer \\303\\266ffnen\\0\"\\\n  \"Ei&genschaften\\0\"\\\n  \"Ei&genschaften\\tStrg+D\\0\"\\\n  \"PDF-Dokument\\0\"\\\n  \"PDF Optimierungen:\\0\"\\\n  \"PDF Urheber:\\0\"\\\n  \"\\0\"\\\n  \"PDF-Dokumente\\0\"\\\n  \"&Seite\\342\\200\\246\\tStrg+G\\0\"\\\n  \"Seite %s\\0\"\\\n  \"Seitengr\\303\\266\\303\\237e:\\0\"\\\n  \"Seite %u nicht vorhanden\\0\"\\\n  \"Anpassen der Seitengr\\303\\266\\303\\237e\\0\"\\\n  \"Seite:\\0\"\\\n  \"PalmDoc E-B\\303\\274cher\\0\"\\\n  \"Bitte einen Moment Geduld\\342\\200\\246\\0\"\\\n  \"Postscript-Dokumente\\0\"\\\n  \"&Pr\\303\\244sentation\\tF5\\0\"\\\n  \"&Vorherige Seite\\0\"\\\n  \"Drucken\\342\\200\\246\\0\"\\\n  \"Seitenbereich\\0\"\\\n  \"Drucker mit dem angegebenen Namen nicht gefunden\\0\"\\\n  \"Drucken - SumatraPDF\\0\"\\\n  \"Bestehenden Druckvorgang abbrechen und Fenster schlie\\303\\237en?\\0\"\\\n  \"Bestehenden Druckvorgang abbrechen und neu beginnen?\\0\"\\\n  \"Drucke Seite %d von %d\\342\\200\\246\\0\"\\\n  \"Druckerproblem\\0\"\\\n  \"Umbe&nennen\\342\\200\\246\\tF2\\0\"\\\n  \"Liste der &zuletzt ge\\303\\266ffneten Dokumente anlegen\\0\"\\\n  \"Aus Favoriten entfernen\\0\"\\\n  \"Seite %s aus Favoriten entfernen\\0\"\\\n  \"Umbenennen zu\\0\"\\\n  \"&Gegen UZS drehen\\tStrg+Umschalt+-\\0\"\\\n  \"Im &UZS drehen\\tStrg+Umschalt++\\0\"\\\n  \"Speichern unter\\342\\200\\246\\0\"\\\n  \"&Verkn\\303\\274pfung speichern\\342\\200\\246\\tStrg+Umschalt+S\\0\"\\\n  \"Durchsuche Seite %d von %d\\342\\200\\246\\0\"\\\n  \"Alles &markieren\\0\"\\\n  \"Alles &markieren\\tStrg+A\\0\"\\\n  \"Inhalte mit Strg+linker Maustaste ausw\\303\\244hlen\\0\"\\\n  \"Auswahl:\\0\"\\\n  \"Per &E-Mail versenden\\342\\200\\246\\0\"\\\n  \"Befehlszeile f\\303\\274r die Inverssuche setzen\\0\"\\\n  \"Lese&zeichen anzeigen\\0\"\\\n  \"Seiten &fortlaufend anzeigen\\0\"\\\n  \"&Werkzeugleiste anzeigen\\0\"\\\n  \"Favoriten anzeigen\\0\"\\\n  \"Oft gelesene Dokumente einblenden\\0\"\\\n  \"&Lesezeichen standardm\\303\\244ssig anzeigen\\0\"\\\n  \"Einzelne Seite\\0\"\\\n  \"Entschuldigen Sie bitte dieses unerwartete Missgeschick!\\n\\nBitte dr\\303\\274cken Sie 'Abbrechen', wenn Sie uns beim Beheben dieses Fehlers behilflich sein m\\303\\266chten.\\0\"\\\n  \"%s hat keinen Synchronisations-Punkt\\0\"\\\n  \"Thema:\\0\"\\\n  \"SumatraPDF Optionen\\0\"\\\n  \"\\0\"\\\n  \"SumatraPDF ist abgest\\303\\274rzt\\0\"\\\n  \"PDF-Dateien werden standardm\\303\\244\\303\\237ig mit SumatraPDF ge\\303\\266ffnet\\0\"\\\n  \"PDF-Dateien sollten nun mit SumatraPDF ge\\303\\266ffnet werden\\0\"\\\n  \"Die Synchronisationsdatei kann nicht ge\\303\\266ffnet werden\\0\"\\\n  \"PDF mit Tags\\0\"\\\n  \"Text-Dokumente\\0\"\\\n  \"Dieses Dokument kann vermutlich nicht korrekt angezeigt werden wegen fehlender Unterst\\303\\274tzung f\\303\\274r %s\\0\"\\\n  \"Titel:\\0\"\\\n  \"Unbekannte Datei (%s)\\0\"\\\n  \"Dokumente in &Tabs \\303\\266ffnen\\0\"\\\n  \"Ansicht\\0\"\\\n  \"SumatraPDF im &Internet\\0\"\\\n  \"Warnung\\0\"\\\n  \"XPS-Dokumente\\0\"\\\n  \"Sie haben die neuste Version installiert.\\0\"\\\n  \"Sie haben Version %s.\\0\"\\\n  \"\\0\"\\\n  \"Vergr\\303\\266\\303\\237ern\\0\"\\\n  \"Verkleinern\\0\"\\\n  \"Zoomfaktor\\0\"\\\n  \"[Datei wurde ge\\303\\244ndert; aktualisiere\\342\\200\\246] %s\\0\"\\\n  \"Text kopieren verweigert\\0\"\\\n  \"Dokument drucken verweigert\\0\";\n\nconst char * gTranslations_el = \n  \"&\\316\\243\\317\\207\\316\\265\\317\\204\\316\\271\\316\\272\\316\\254\\0\"\\\n  \"\\316\\240\\317\\201\\316\\261\\316\\263\\316\\274\\316\\261\\317\\204\\316\\271\\316\\272\\317\\214 &\\316\\274\\316\\255\\316\\263\\316\\265\\316\\270\\316\\277\\317\\202\\tCtrl+1\\0\"\\\n  \"&\\316\\225\\317\\200\\316\\271\\316\\273\\316\\277\\316\\263\\316\\255\\317\\202 \\316\\263\\316\\271\\316\\261 \\317\\200\\317\\201\\316\\277\\317\\207\\317\\211\\317\\201\\316\\267\\316\\274\\316\\255\\316\\275\\316\\277\\317\\205\\317\\202\\0\"\\\n  \"\\316\\214&\\316\\273\\316\\265\\317\\202 \\316\\277\\316\\271 \\316\\265\\317\\200\\316\\271\\316\\273\\316\\265\\316\\263\\316\\274\\316\\255\\316\\275\\316\\265\\317\\202\\0\"\\\n  \"&\\316\\240\\316\\257\\317\\203\\317\\211\\tAlt+<-\\0\"\\\n  \"&\\316\\240\\317\\201\\316\\277\\316\\262\\316\\277\\316\\273\\316\\256 \\316\\262\\316\\271\\316\\262\\316\\273\\316\\257\\316\\277\\317\\205\\tCtrl+8\\0\"\\\n  \"&\\316\\232\\316\\273\\316\\265\\316\\257\\317\\203\\316\\271\\316\\274\\316\\277\\tCtrl+W\\0\"\\\n  \"&\\316\\221\\316\\275\\317\\204\\316\\271\\316\\263\\317\\201\\316\\261\\317\\206\\316\\256 \\316\\265\\317\\200\\316\\271\\316\\273\\316\\277\\316\\263\\316\\256\\317\\202\\0\"\\\n  \"\\316\\221\\316\\275\\317\\204\\316\\271\\316\\263\\317\\201\\316\\261\\317\\206\\316\\256 \\316\\265\\317\\200\\316\\271&\\316\\273\\316\\265\\316\\263\\316\\274\\316\\255\\316\\275\\317\\211\\316\\275\\tCtrl+C\\0\"\\\n  \"&\\316\\235\\316\\261 \\316\\274\\316\\267\\316\\275 \\316\\265\\317\\201\\317\\211\\317\\204\\316\\267\\316\\270\\317\\216 \\316\\276\\316\\261\\316\\275\\316\\254\\0\"\\\n  \"&\\316\\234\\317\\214\\316\\275\\316\\277 \\316\\277\\316\\271 \\316\\266\\317\\205\\316\\263\\316\\255\\317\\202 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\265\\317\\202\\0\"\\\n  \"&\\316\\221\\316\\275\\317\\204\\316\\271\\316\\272\\317\\201\\316\\271\\317\\203\\317\\204\\316\\255\\317\\202 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\265\\317\\202\\tCtrl+7\\0\"\\\n  \"&\\316\\221\\317\\201\\317\\207\\316\\265\\316\\257\\316\\277\\0\"\\\n  \"&\\316\\225\\317\\215\\317\\201\\316\\265\\317\\203\\316\\267 \\317\\204\\316\\277\\317\\205:\\0\"\\\n  \"\\316\\240\\317\\201\\317\\216\\317\\204&\\316\\267 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261\\tHome\\0\"\\\n  \"\\316\\240\\317\\201\\316\\277\\317\\203\\316\\261\\317\\201\\316\\274\\316\\277\\316\\263\\316\\256 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\317\\211\\316\\275 \\317\\203\\316\\265 &\\316\\265\\316\\272\\317\\204\\317\\205\\317\\200\\317\\216\\317\\203\\316\\271\\316\\274\\316\\267 \\317\\200\\316\\265\\317\\201\\316\\271\\316\\277\\317\\207\\316\\256\\0\"\\\n  \"&\\316\\234\\316\\265\\317\\204\\316\\254\\316\\262\\316\\261\\317\\203\\316\\267\\0\"\\\n  \"&\\316\\234\\316\\265\\317\\204\\316\\254\\316\\262\\316\\261\\317\\203\\316\\267 \\317\\203\\317\\204\\316\\267 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261:\\0\"\\\n  \"&\\316\\222\\316\\277\\316\\256\\316\\270\\316\\265\\316\\271\\316\\261\\0\"\\\n  \"&\\316\\244\\316\\265\\316\\273\\316\\265\\317\\205\\317\\204\\316\\261\\316\\257\\316\\261 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261\\tEnd\\0\"\\\n  \"&\\316\\234\\316\\265\\316\\263\\316\\255\\316\\270\\317\\205\\316\\275\\317\\203\\316\\267:\\0\"\\\n  \"&\\316\\237\\316\\264\\316\\267\\316\\263\\316\\257\\316\\265\\317\\202 \\316\\247\\317\\201\\316\\256\\317\\203\\316\\267\\317\\202\\0\"\\\n  \"\\316\\244\\316\\261\\316\\257\\317\\201\\316\\271\\316\\261\\317\\203\\316\\274\\316\\261 \\317\\200\\316\\265\\316\\266\\317\\216\\316\\275/\\316\\272\\316\\265\\317\\206\\316\\261\\316\\273\\316\\261\\316\\257\\317\\211\\316\\275\\0\"\\\n  \"&\\316\\225\\317\\200\\317\\214\\316\\274\\316\\265\\316\\275\\316\\267 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261\\t->\\0\"\\\n  \"\\316\\214&\\317\\207\\316\\271\\0\"\\\n  \"&\\316\\214\\317\\207\\316\\271, \\316\\265\\317\\205\\317\\207\\316\\261\\317\\201\\316\\271\\317\\203\\317\\204\\317\\216\\0\"\\\n  \"&\\316\\234\\317\\214\\316\\275\\316\\277 \\316\\277\\316\\271 \\316\\274\\316\\277\\316\\275\\316\\255\\317\\202 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\265\\317\\202\\0\"\\\n  \"\\316\\206&\\316\\275\\316\\277\\316\\271\\316\\263\\316\\274\\316\\261 \\316\\265\\316\\263\\316\\263\\317\\201\\316\\254\\317\\206\\316\\277\\317\\205\\0\"\\\n  \"\\316\\206&\\316\\275\\316\\277\\316\\271\\316\\263\\316\\274\\316\\261...\\tCtrl+O\\0\"\\\n  \"&\\316\\225\\317\\200\\316\\271\\316\\273\\316\\277\\316\\263\\316\\255\\317\\202...\\0\"\\\n  \"&\\316\\232\\317\\211\\316\\264\\316\\271\\316\\272\\317\\214\\317\\202:\\0\"\\\n  \"&\\316\\232\\316\\261\\317\\201\\317\\206\\316\\257\\317\\204\\317\\203\\317\\211\\316\\274\\316\\261 \\316\\265\\316\\263\\316\\263\\317\\201\\316\\254\\317\\206\\316\\277\\317\\205\\0\"\\\n  \"&\\316\\240\\317\\201\\316\\277\\316\\267\\316\\263\\316\\277\\317\\215\\316\\274\\316\\265\\316\\275\\316\\267 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261\\t<-\\0\"\\\n  \"&\\316\\225\\316\\272\\317\\204\\317\\215\\317\\200\\317\\211\\317\\203\\316\\267\\0\"\\\n  \"&\\316\\225\\316\\272\\317\\204\\317\\215\\317\\200\\317\\211\\317\\203\\316\\267...\\tCtrl+P\\0\"\\\n  \"&\\316\\225\\316\\272\\317\\204\\317\\215\\317\\200\\317\\211\\317\\203\\316\\267... (\\316\\261\\317\\200\\316\\261\\316\\263\\316\\277\\317\\201\\316\\265\\317\\215\\316\\265\\317\\204\\316\\261\\316\\271)\\0\"\\\n  \"&\\316\\221\\317\\200\\316\\277\\316\\274\\316\\275\\316\\267\\316\\274\\317\\214\\316\\275\\316\\265\\317\\205\\317\\203\\316\\267 \\316\\272\\317\\211\\316\\264\\316\\271\\316\\272\\316\\277\\317\\215 \\316\\263\\316\\271\\316\\261 \\316\\261\\317\\205\\317\\204\\317\\214 \\317\\204\\316\\277 \\316\\255\\316\\263\\316\\263\\317\\201\\316\\261\\317\\206\\316\\277\\0\"\\\n  \"&\\316\\221\\317\\200\\316\\277\\316\\274\\316\\275\\316\\267\\316\\274\\317\\214\\316\\275\\316\\265\\317\\205\\317\\203\\316\\267 \\317\\201\\317\\205\\316\\270\\316\\274\\316\\257\\317\\203\\316\\265\\317\\211\\316\\275 \\316\\263\\316\\271\\316\\261 \\316\\272\\316\\254\\316\\270\\316\\265 \\316\\255\\316\\263\\316\\263\\317\\201\\316\\261\\317\\206\\316\\277\\0\"\\\n  \"&\\316\\221\\317\\200\\317\\214\\316\\272\\317\\201\\317\\205\\317\\210\\316\\267 \\316\\265\\316\\263\\316\\263\\317\\201\\316\\254\\317\\206\\316\\277\\317\\205\\0\"\\\n  \"&\\316\\221\\317\\200\\316\\277\\316\\270\\316\\256\\316\\272\\316\\265\\317\\205\\317\\203\\316\\267 \\317\\211\\317\\202...\\0\"\\\n  \"&\\316\\221\\317\\200\\316\\277\\316\\270\\316\\256\\316\\272\\316\\265\\317\\205\\317\\203\\316\\267 \\317\\211\\317\\202...\\tCtrl+S\\0\"\\\n  \"&\\316\\241\\317\\205\\316\\270\\316\\274\\316\\257\\317\\203\\316\\265\\316\\271\\317\\202\\0\"\\\n  \"\\316\\243\\316\\274\\316\\257\\316\\272\\317\\201\\317\\205\\316\\275\\317\\203\\316\\267 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\317\\211\\316\\275 \\317\\203\\316\\265 &\\316\\265\\316\\272\\317\\204\\317\\205\\317\\200\\317\\216\\317\\203\\316\\271\\316\\274\\316\\267 \\317\\200\\316\\265\\317\\201\\316\\271\\316\\277\\317\\207\\316\\256 (\\316\\261\\316\\275 \\317\\207\\317\\201\\316\\265\\316\\271\\316\\254\\316\\266\\316\\265\\317\\204\\316\\261\\316\\271)\\0\"\\\n  \"&\\316\\234\\316\\277\\316\\275\\316\\256 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261\\tCtrl+6\\0\"\\\n  \"&\\316\\240\\316\\261\\317\\201\\316\\254\\316\\262\\316\\273\\316\\265\\317\\210\\316\\267 \\316\\261\\317\\205\\317\\204\\316\\256\\317\\202 \\317\\204\\316\\267\\317\\202 \\316\\255\\316\\272\\316\\264\\316\\277\\317\\203\\316\\267\\317\\202\\0\"\\\n  \"&\\316\\247\\317\\201\\316\\267\\317\\203\\316\\271\\316\\274\\316\\277\\317\\200\\316\\277\\316\\257\\316\\267\\317\\203\\316\\267 \\316\\274\\316\\265\\316\\263\\316\\255\\316\\270\\316\\277\\317\\205\\317\\202 \\316\\261\\317\\201\\317\\207\\316\\271\\316\\272\\317\\216\\316\\275 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\317\\211\\316\\275\\0\"\\\n  \"&\\316\\240\\317\\201\\316\\277\\316\\262\\316\\277\\316\\273\\316\\256\\0\"\\\n  \"\\316\\240\\316\\261\\317\\201\\316\\254&\\316\\270\\317\\205\\317\\201\\316\\277\\0\"\\\n  \"&\\316\\235\\316\\261\\316\\271\\0\"\\\n  \"&\\316\\226\\316\\277\\317\\205\\316\\274\\0\"\\\n  \"(\\316\\261\\317\\200\\317\\214 %d)\\0\"\\\n  \"(\\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261 %s)\\0\"\\\n  \"\\316\\243\\317\\207\\316\\265\\317\\204\\316\\271\\316\\272\\316\\254 \\316\\274\\316\\265 \\317\\204\\316\\277 SumatraPDF\\0\"\\\n  \"\\316\\240\\317\\201\\316\\277\\317\\203\\316\\270\\316\\256\\316\\272\\316\\267 \\316\\261\\316\\263\\316\\261\\317\\200\\316\\267\\316\\274\\316\\255\\316\\275\\316\\277\\317\\205\\0\"\\\n  \"\\316\\240\\317\\201\\316\\277\\317\\203\\316\\270\\316\\256\\316\\272\\316\\267 \\317\\204\\316\\267\\317\\202 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261\\317\\202 %s \\317\\203\\317\\204\\316\\261 \\316\\261\\316\\263\\316\\261\\317\\200\\316\\267\\316\\274\\316\\255\\316\\275\\316\\261\\0\"\\\n  \"\\316\\240\\317\\201\\316\\277\\317\\203\\316\\270\\316\\256\\316\\272\\316\\267 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261\\317\\202 %s \\317\\203\\317\\204\\316\\261 \\316\\261\\316\\263\\316\\261\\317\\200\\316\\267\\316\\274\\316\\255\\316\\275\\316\\261 \\316\\274\\316\\265 (\\317\\200\\317\\201\\316\\277\\316\\261\\316\\271\\317\\201\\316\\265\\317\\204\\316\\271\\316\\272\\317\\214) \\317\\214\\316\\275\\316\\277\\316\\274\\316\\261:\\0\"\\\n  \"\\316\\240\\317\\201\\316\\277\\317\\203\\316\\270\\316\\256\\316\\272\\316\\267 \\317\\203\\317\\204\\316\\261 \\316\\261\\316\\263\\316\\261\\317\\200\\316\\267\\316\\274\\316\\255\\316\\275\\316\\261\\0\"\\\n  \"\\316\\240\\317\\201\\316\\277\\317\\207\\317\\211\\317\\201\\316\\267\\316\\274\\316\\255\\316\\275\\316\\261\\0\"\\\n  \"\\316\\214\\316\\273\\316\\261 \\317\\204\\316\\261 \\316\\261\\317\\201\\317\\207\\316\\265\\316\\257\\316\\261\\0\"\\\n  \"\\316\\214\\316\\273\\316\\261 \\317\\204\\316\\261 \\317\\205\\317\\200\\316\\277\\317\\203\\317\\204\\316\\267\\317\\201\\316\\271\\316\\266\\317\\214\\316\\274\\316\\265\\316\\275\\316\\261 \\316\\255\\316\\263\\316\\263\\317\\201\\316\\261\\317\\206\\316\\261\\0\"\\\n  \"\\316\\225\\317\\206\\316\\261\\317\\201\\316\\274\\316\\277\\316\\263\\316\\256:\\0\"\\\n  \"\\316\\235\\316\\261 \\316\\263\\316\\257\\316\\275\\316\\265\\316\\271 \\317\\203\\317\\205\\317\\203\\317\\207\\316\\265\\317\\204\\316\\271\\317\\203\\316\\274\\317\\214\\317\\202 \\316\\274\\316\\265 \\317\\204\\316\\261 \\316\\261\\317\\201\\317\\207\\316\\265\\316\\257\\316\\261 PDF;\\0\"\\\n  \"\\316\\225\\317\\200\\316\\271\\317\\203\\317\\215\\316\\275\\316\\261\\317\\210\\316\\267: %s\\0\"\\\n  \"\\316\\224\\316\\267\\316\\274\\316\\271\\316\\277\\317\\205\\317\\201\\316\\263\\317\\214\\317\\202:\\0\"\\\n  \"\\316\\221\\317\\205\\317\\204\\317\\214\\316\\274\\316\\261\\317\\204\\316\\261\\0\"\\\n  \"\\316\\221\\317\\205\\317\\204\\317\\214\\316\\274\\316\\261\\317\\204\\316\\277\\317\\202 \\316\\255\\316\\273\\316\\265\\316\\263\\317\\207\\316\\277\\317\\202 \\316\\263\\316\\271\\316\\261 &\\316\\265\\316\\275\\316\\267\\316\\274\\316\\265\\317\\201\\317\\216\\317\\203\\316\\265\\316\\271\\317\\202\\0\"\\\n  \"\\316\\240\\317\\201\\316\\277\\316\\262\\316\\277\\316\\273\\316\\256 \\316\\262\\316\\271\\316\\262\\316\\273\\316\\257\\316\\277\\317\\205\\0\"\\\n  \"&\\316\\243\\316\\265\\316\\273\\316\\271\\316\\264\\316\\277\\316\\264\\316\\265\\316\\257\\316\\272\\317\\204\\316\\265\\317\\202\\tF12\\0\"\\\n  \"\\316\\243\\317\\205\\316\\275\\317\\204\\316\\277\\316\\274\\316\\265\\317\\215\\317\\203\\316\\265\\316\\271\\317\\202 \\317\\203\\316\\265\\316\\273\\316\\271\\316\\264\\316\\277\\316\\264\\316\\265\\316\\271\\316\\272\\317\\204\\317\\216\\316\\275\\0\"\\\n  \"\\316\\243\\317\\205\\316\\275\\317\\204\\317\\214\\316\\274\\316\\265\\317\\205\\317\\203\\316\\267 \\317\\203\\316\\265\\316\\273\\316\\271\\316\\264\\316\\277\\316\\264\\316\\265\\316\\257\\316\\272\\317\\204\\316\\267 \\317\\203\\317\\204\\316\\267 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261 %s \\317\\204\\316\\277\\317\\205 %s\\0\"\\\n  \"\\316\\243\\316\\265\\316\\273\\316\\271\\316\\264\\316\\277\\316\\264\\316\\265\\316\\257\\316\\272\\317\\204\\316\\265\\317\\202\\0\"\\\n  \"\\0\"\\\n  \"\\316\\210\\316\\263\\316\\263\\317\\201\\316\\261\\317\\206\\316\\261 CHM\\0\"\\\n  \"\\316\\224\\316\\265\\316\\275 \\316\\265\\316\\257\\316\\275\\316\\261\\316\\271 \\316\\264\\317\\205\\316\\275\\316\\261\\317\\204\\316\\256 \\316\\267 \\317\\203\\317\\215\\316\\275\\316\\264\\316\\265\\317\\203\\316\\267 \\316\\274\\316\\265 \\317\\204\\316\\277 Internet (\\317\\203\\317\\206\\316\\254\\316\\273\\316\\274\\316\\261 %#x).\\0\"\\\n  \"\\316\\206\\316\\272\\317\\205\\317\\201\\316\\277\\0\"\\\n  \"\\316\\224\\316\\265\\316\\275 \\316\\265\\316\\257\\316\\275\\316\\261\\316\\271 \\316\\264\\317\\205\\316\\275\\316\\261\\317\\204\\316\\256 \\316\\267 \\316\\265\\316\\272\\317\\204\\317\\215\\317\\200\\317\\211\\317\\203\\316\\267 \\316\\261\\317\\205\\317\\204\\316\\277\\317\\215 \\317\\204\\316\\277\\317\\205 \\316\\261\\317\\201\\317\\207\\316\\265\\316\\257\\316\\277\\317\\205\\0\"\\\n  \"\\316\\224\\316\\265\\316\\275 \\316\\265\\316\\257\\316\\275\\316\\261\\316\\271 \\316\\264\\317\\205\\316\\275\\316\\261\\317\\204\\316\\256 \\316\\267 \\316\\265\\316\\272\\316\\272\\316\\257\\316\\275\\316\\267\\317\\203\\316\\267 \\316\\261\\316\\275\\317\\204\\316\\257\\317\\203\\317\\204\\317\\201\\316\\277\\317\\206\\316\\267\\317\\202 \\316\\261\\316\\275\\316\\261\\316\\266\\316\\256\\317\\204\\316\\267\\317\\203\\316\\267\\317\\202. \\316\\240\\316\\261\\317\\201\\316\\261\\316\\272\\316\\261\\316\\273\\317\\216 \\316\\265\\316\\273\\316\\255\\316\\263\\316\\276\\317\\204\\316\\265 \\317\\204\\316\\267 \\316\\263\\317\\201\\316\\261\\316\\274\\316\\274\\316\\256 \\316\\265\\316\\275\\317\\204\\316\\277\\316\\273\\317\\216\\316\\275 \\317\\203\\317\\204\\316\\271\\317\\202 \\317\\201\\317\\205\\316\\270\\316\\274\\316\\257\\317\\203\\316\\265\\316\\271\\317\\202.\\0\"\\\n  \"\\316\\221\\316\\273\\316\\273\\316\\261\\316\\263\\316\\256 \\316\\263\\316\\273\\317\\216\\317\\203\\317\\203\\316\\261\\317\\202 (Change Language)\\0\"\\\n  \"\\316\\210&\\316\\273\\316\\265\\316\\263\\317\\207\\316\\277\\317\\202 \\316\\263\\316\\271\\316\\261 \\316\\275\\316\\255\\316\\261 \\316\\255\\316\\272\\316\\264\\316\\277\\317\\203\\316\\267\\0\"\\\n  \"\\316\\222\\316\\271\\316\\262\\316\\273\\316\\257\\316\\261 \\316\\272\\317\\214\\316\\274\\316\\271\\316\\272\\0\"\\\n  \"\\316\\243\\317\\205\\316\\274\\316\\262\\316\\261\\317\\204\\317\\214\\317\\204\\316\\267\\317\\204\\316\\261\\0\"\\\n  \"\\316\\234\\316\\271\\316\\261 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261, \\317\\203\\317\\205\\316\\275\\316\\265\\317\\207\\317\\214\\316\\274\\316\\265\\316\\275\\316\\261\\0\"\\\n  \"\\316\\243\\317\\205\\316\\275\\316\\265\\317\\207\\317\\214\\316\\274\\316\\265\\316\\275\\316\\267 \\317\\200\\317\\201\\316\\277\\316\\262\\316\\277\\316\\273\\316\\256 \\316\\262\\316\\271\\316\\262\\316\\273\\316\\257\\316\\277\\317\\205\\0\"\\\n  \"\\316\\224\\317\\215\\316\\277 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\265\\317\\202, \\317\\203\\317\\205\\316\\275\\316\\265\\317\\207\\317\\214\\316\\274\\316\\265\\316\\275\\316\\261\\0\"\\\n  \"\\316\\222\\316\\277\\316\\267\\316\\270\\316\\256\\317\\203\\317\\204\\316\\265 \\317\\203\\317\\204\\316\\267 \\316\\274\\316\\265\\317\\204\\316\\254\\317\\206\\317\\201\\316\\261\\317\\203\\316\\267\\0\"\\\n  \"\\316\\221\\316\\275\\317\\204\\316\\271\\316\\263\\317\\201\\316\\261\\317\\206\\316\\256 &\\316\\265\\316\\271\\316\\272\\317\\214\\316\\275\\316\\261\\317\\202\\0\"\\\n  \"\\316\\221\\316\\275\\317\\204\\316\\271\\316\\263\\317\\201\\316\\261\\317\\206\\316\\256 &\\316\\264\\316\\271\\316\\265\\317\\215\\316\\270\\317\\205\\316\\275\\317\\203\\316\\267\\317\\202\\0\"\\\n  \"\\316\\221\\316\\275\\317\\204\\316\\271\\316\\263\\317\\201\\316\\261\\317\\206\\316\\256 \\317\\203&\\317\\207\\316\\277\\316\\273\\316\\257\\316\\277\\317\\205\\0\"\\\n  \"\\316\\227 \\316\\261\\316\\275\\317\\204\\316\\271\\316\\263\\317\\201\\316\\261\\317\\206\\316\\256 \\316\\272\\316\\265\\316\\271\\316\\274\\316\\255\\316\\275\\316\\277\\317\\205 \\316\\264\\316\\265\\316\\275 \\316\\265\\317\\200\\316\\265\\317\\204\\317\\201\\316\\254\\317\\200\\316\\267 (\\316\\274\\317\\214\\316\\275\\316\\277 \\317\\211\\317\\202 \\316\\265\\316\\271\\316\\272\\317\\214\\316\\275\\316\\261)\\0\"\\\n  \"\\316\\240\\316\\275\\316\\265\\317\\205\\316\\274\\316\\261\\317\\204\\316\\271\\316\\272\\316\\256 \\316\\271\\316\\264\\316\\271\\316\\277\\316\\272\\317\\204\\316\\267\\317\\203\\316\\257\\316\\261:\\0\"\\\n  \"\\316\\224\\316\\265\\316\\275 \\316\\256\\317\\204\\316\\261\\316\\275 \\316\\264\\317\\205\\316\\275\\316\\261\\317\\204\\316\\256 \\316\\267 \\316\\261\\316\\275\\316\\254\\316\\272\\317\\204\\316\\267\\317\\203\\316\\267 \\317\\204\\317\\211\\316\\275 \\316\\271\\316\\264\\316\\271\\316\\277\\317\\204\\316\\256\\317\\204\\317\\211\\316\\275 \\317\\204\\316\\277\\317\\205 \\316\\265\\316\\272\\317\\204\\317\\205\\317\\200\\317\\211\\317\\204\\316\\256\\0\"\\\n  \"\\316\\221\\317\\200\\316\\255\\317\\204\\317\\205\\317\\207\\316\\265 \\316\\267 \\316\\255\\316\\275\\316\\261\\317\\201\\316\\276\\316\\267 \\317\\204\\316\\277\\317\\205 \\316\\265\\316\\272\\317\\204\\317\\205\\317\\200\\317\\211\\317\\204\\316\\256\\0\"\\\n  \"\\316\\224\\316\\265 \\316\\274\\317\\200\\316\\277\\317\\201\\316\\265\\316\\257 \\316\\275\\316\\261 \\317\\206\\316\\277\\317\\201\\317\\204\\317\\211\\316\\270\\316\\265\\316\\257 \\316\\267 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261\\0\"\\\n  \"\\316\\224\\316\\267\\316\\274\\316\\271\\316\\277\\317\\205\\317\\201\\316\\263\\316\\256\\316\\270\\316\\267\\316\\272\\316\\265:\\0\"\\\n  \"\\316\\244\\317\\201\\316\\255\\317\\207\\316\\277\\316\\275 \\316\\261\\317\\201\\317\\207\\316\\265\\316\\257\\316\\277\\0\"\\\n  \"\\316\\230\\316\\255\\317\\203\\316\\267 \\316\\272\\316\\255\\317\\201\\317\\203\\316\\277\\317\\201\\316\\261:\\0\"\\\n  \"&\\316\\240\\317\\201\\316\\277\\317\\203\\316\\261\\317\\201\\316\\274\\316\\277\\317\\203\\316\\274\\316\\255\\316\\275\\316\\277 \\316\\266\\316\\277\\317\\205\\316\\274...\\tCtrl+Y\\0\"\\\n  \"\\316\\240\\317\\201\\316\\277\\316\\272\\316\\261\\316\\270\\316\\277\\317\\201\\316\\271\\317\\203\\316\\274\\316\\255\\316\\275\\316\\267 &\\316\\264\\316\\271\\316\\261\\316\\274\\317\\214\\317\\201\\317\\206\\317\\211\\317\\203\\316\\267:\\0\"\\\n  \"\\316\\240\\317\\201\\316\\277\\316\\272\\316\\261\\316\\270\\316\\277\\317\\201\\316\\271\\317\\203\\316\\274\\316\\255\\316\\275\\316\\277 &\\316\\266\\316\\277\\317\\205\\316\\274:\\0\"\\\n  \"\\316\\224\\316\\265 \\316\\274\\317\\200\\316\\277\\317\\201\\316\\265\\316\\257 \\316\\275\\316\\261 \\316\\263\\316\\257\\316\\275\\316\\265\\316\\271 \\317\\203\\317\\205\\317\\203\\317\\207\\316\\265\\317\\204\\316\\271\\317\\203\\316\\274\\317\\214\\317\\202 \\317\\203\\316\\265 portable mode\\0\"\\\n  \"\\316\\221\\317\\200\\316\\261\\316\\263\\317\\214\\317\\201\\316\\265\\317\\205\\317\\203\\316\\267 \\316\\264\\316\\271\\316\\272\\316\\261\\316\\271\\317\\211\\316\\274\\316\\254\\317\\204\\317\\211\\316\\275:\\0\"\\\n  \"\\316\\210\\316\\263\\316\\263\\317\\201\\316\\261\\317\\206\\316\\261 DjVu\\0\"\\\n  \"\\316\\231\\316\\264\\316\\271\\317\\214\\317\\204\\316\\267\\317\\204\\316\\265\\317\\202 \\316\\265\\316\\263\\316\\263\\317\\201\\316\\254\\317\\206\\316\\277\\317\\205\\0\"\\\n  \"\\316\\233\\316\\256\\317\\210\\316\\267\\0\"\\\n  \"\\316\\210&\\316\\276\\316\\277\\316\\264\\316\\277\\317\\202\\tCtrl+Q\\0\"\\\n  \"\\316\\210\\316\\263\\316\\263\\317\\201\\316\\261\\317\\206\\316\\261 EPUB\\0\"\\\n  \"\\316\\225\\316\\271\\317\\203\\316\\254\\316\\263\\316\\265\\317\\204\\316\\265 \\316\\272\\317\\211\\316\\264\\316\\271\\316\\272\\317\\214\\0\"\\\n  \"\\316\\225\\316\\271\\317\\203\\316\\254\\316\\263\\316\\265\\317\\204\\316\\265 \\316\\272\\317\\211\\316\\264\\316\\271\\316\\272\\317\\214 \\316\\263\\316\\271\\316\\261 \\317\\204\\316\\277 %s\\0\"\\\n  \"\\316\\225\\316\\271\\317\\203\\316\\254\\316\\263\\316\\265\\317\\204\\316\\265 \\317\\204\\316\\267\\316\\275 \\316\\265\\316\\275\\317\\204\\316\\277\\316\\273\\316\\256 \\317\\200\\317\\201\\316\\277\\317\\202 \\316\\265\\316\\272\\317\\204\\316\\255\\316\\273\\316\\265\\317\\203\\316\\267 \\316\\274\\316\\265 \\316\\264\\316\\271\\317\\200\\316\\273\\317\\214 \\316\\272\\316\\273\\316\\271\\316\\272 \\317\\203\\316\\265 \\316\\255\\316\\263\\316\\263\\317\\201\\316\\261\\317\\206\\316\\277 PDF:\\0\"\\\n  \"\\316\\243\\317\\206\\316\\254\\316\\273\\316\\274\\316\\261 \\317\\206\\317\\214\\317\\201\\317\\204\\317\\211\\317\\203\\316\\267\\317\\202 \\317\\204\\316\\277\\317\\205 %s\\0\"\\\n  \"\\316\\221&\\316\\263\\316\\261\\317\\200\\316\\267\\316\\274\\316\\255\\316\\275\\316\\261\\0\"\\\n  \"\\316\\225\\316\\274\\317\\200&\\317\\201\\317\\214\\317\\202\\tAlt+->\\0\"\\\n  \"&\\316\\240\\316\\273\\316\\256\\317\\201\\316\\267\\317\\202 \\316\\277\\316\\270\\317\\214\\316\\275\\316\\267\\tCtrl+Shift+L\\0\"\\\n  \"\\316\\224\\317\\215\\316\\277 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\265\\317\\202\\0\"\\\n  \"\\316\\227 \\316\\274\\316\\265\\317\\204\\316\\277\\316\\275\\316\\277\\316\\274\\316\\261\\317\\203\\316\\257\\316\\261 \\317\\204\\316\\277\\317\\205 \\316\\261\\317\\201\\317\\207\\316\\265\\316\\257\\316\\277\\317\\205 \\316\\261\\317\\200\\316\\255\\317\\204\\317\\205\\317\\207\\316\\265!\\0\"\\\n  \"\\316\\221\\317\\200\\316\\277\\317\\204\\317\\205\\317\\207\\316\\257\\316\\261 \\316\\261\\317\\200\\316\\277\\316\\270\\316\\256\\316\\272\\316\\265\\317\\205\\317\\203\\316\\267\\317\\202 \\316\\261\\317\\201\\317\\207\\316\\265\\316\\257\\316\\277\\317\\205\\0\"\\\n  \"\\316\\223\\317\\201\\316\\256\\316\\263\\316\\277\\317\\201\\316\\267 \\316\\264\\316\\271\\316\\261\\316\\264\\316\\271\\316\\272\\317\\204\\317\\205\\316\\261\\316\\272\\316\\256 \\317\\200\\317\\201\\316\\277\\316\\262\\316\\277\\316\\273\\316\\256\\0\"\\\n  \"\\316\\221\\316\\263\\316\\261\\317\\200\\316\\267\\316\\274\\316\\255\\316\\275\\316\\261\\0\"\\\n  \"\\316\\210\\316\\263\\316\\263\\317\\201\\316\\261\\317\\206\\316\\261 FictionBook\\0\"\\\n  \"\\316\\244\\316\\277 \\316\\261\\317\\201\\317\\207\\316\\265\\316\\257\\316\\277 %s \\316\\264\\316\\265 \\316\\262\\317\\201\\316\\255\\316\\270\\316\\267\\316\\272\\316\\265\\0\"\\\n  \"\\316\\234\\316\\255\\316\\263\\316\\265\\316\\270\\316\\277\\317\\202 \\316\\261\\317\\201\\317\\207\\316\\265\\316\\257\\316\\277\\317\\205:\\0\"\\\n  \"\\316\\221\\317\\201\\317\\207\\316\\265\\316\\257\\316\\277:\\0\"\\\n  \"\\316\\225\\317\\215&\\317\\201\\316\\265\\317\\203\\316\\267...\\tCtrl+F\\0\"\\\n  \"\\316\\225\\317\\215\\317\\201\\316\\265\\317\\203\\316\\267\\0\"\\\n  \"\\316\\225\\317\\215\\317\\201\\316\\265\\317\\203\\316\\267 \\316\\265\\317\\200\\317\\214\\316\\274\\316\\265\\316\\275\\316\\277\\317\\205\\0\"\\\n  \"\\316\\225\\317\\215\\317\\201\\316\\265\\317\\203\\316\\267 \\317\\200\\317\\201\\316\\277\\316\\267\\316\\263\\316\\277\\317\\215\\316\\274\\316\\265\\316\\275\\316\\277\\317\\205\\0\"\\\n  \"\\316\\225\\317\\215\\317\\201\\316\\265\\317\\203\\316\\267:\\0\"\\\n  \"&\\316\\240\\317\\201\\316\\277\\317\\203\\316\\261\\317\\201\\316\\274\\316\\277\\316\\263\\316\\256 \\317\\203\\317\\204\\316\\261 \\317\\200\\316\\265\\317\\201\\316\\271\\316\\265\\317\\207\\317\\214\\316\\274\\316\\265\\316\\275\\316\\261\\tCtrl+3\\0\"\\\n  \"&\\316\\240\\317\\201\\316\\277\\317\\203\\316\\261\\317\\201\\316\\274\\316\\277\\316\\263\\316\\256 \\317\\203\\317\\204\\316\\267 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261\\tCtrl+0\\0\"\\\n  \"&\\316\\240\\317\\201\\316\\277\\317\\203\\316\\261\\317\\201\\316\\274\\316\\277\\316\\263\\316\\256 \\317\\203\\317\\204\\316\\277 \\317\\200\\316\\273\\316\\254\\317\\204\\316\\277\\317\\202 \\317\\200\\316\\261\\317\\201\\316\\261\\316\\270\\317\\215\\317\\201\\316\\277\\317\\205\\tCtrl+2\\0\"\\\n  \"\\316\\240\\317\\201\\316\\277\\317\\203\\316\\261\\317\\201\\316\\274\\316\\277\\316\\263\\316\\256 \\317\\203\\317\\204\\316\\261 \\317\\200\\316\\265\\317\\201\\316\\271\\316\\265\\317\\207\\317\\214\\316\\274\\316\\265\\316\\275\\316\\261\\0\"\\\n  \"\\316\\237\\316\\273\\317\\214\\316\\272\\316\\273\\316\\267\\317\\201\\316\\267 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261\\0\"\\\n  \"\\316\\240\\316\\273\\316\\254\\317\\204\\316\\277\\317\\202 \\317\\200\\316\\261\\317\\201\\316\\261\\316\\270\\317\\215\\317\\201\\316\\277\\317\\205\\0\"\\\n  \"\\316\\240\\317\\201\\316\\277\\317\\203\\316\\261\\317\\201\\316\\274\\316\\277\\316\\263\\316\\256 \\317\\200\\316\\273\\316\\254\\317\\204\\316\\277\\317\\205\\317\\202 \\316\\272\\316\\261\\316\\271 \\316\\265\\316\\274\\317\\206\\316\\254\\316\\275\\316\\271\\317\\203\\316\\267 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\317\\211\\316\\275 \\317\\203\\317\\205\\316\\275\\316\\265\\317\\207\\317\\214\\316\\274\\316\\265\\316\\275\\316\\261\\0\"\\\n  \"\\316\\240\\317\\201\\316\\277\\317\\203\\316\\261\\317\\201\\316\\274\\316\\277\\316\\263\\316\\256 \\316\\274\\316\\271\\316\\261\\317\\202 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261\\317\\202\\0\"\\\n  \"\\316\\223\\317\\201\\316\\261\\316\\274\\316\\274\\316\\261\\317\\204\\316\\277\\317\\203\\316\\265\\316\\271\\317\\201\\316\\255\\317\\202:\\0\"\\\n  \"\\316\\224\\316\\271\\316\\261\\316\\274\\317\\214\\317\\201\\317\\206\\317\\211\\317\\203\\316\\267 \\317\\204\\316\\277\\317\\205 \\316\\262\\316\\271\\316\\262\\316\\273\\316\\257\\316\\277\\317\\205... %d \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\265\\317\\202\\0\"\\\n  \"\\316\\244\\316\\277 \\316\\272\\316\\265\\316\\257\\316\\274\\316\\265\\316\\275\\316\\277 \\316\\262\\317\\201\\316\\255\\316\\270\\316\\267\\316\\272\\316\\265 \\317\\203\\317\\204\\316\\267 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261 %s\\0\"\\\n  \"\\316\\244\\316\\277 \\316\\272\\316\\265\\316\\257\\316\\274\\316\\265\\316\\275\\316\\277 \\316\\262\\317\\201\\316\\255\\316\\270\\316\\267\\316\\272\\316\\265 \\317\\203\\317\\204\\316\\267 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261 %s (\\317\\200\\316\\254\\316\\273\\316\\271)\\0\"\\\n  \"\\316\\243\\317\\205\\317\\207\\316\\275\\316\\254 \\316\\261\\316\\275\\316\\261\\316\\263\\316\\275\\317\\211\\317\\203\\316\\274\\316\\255\\316\\275\\316\\261\\0\"\\\n  \"\\0\"\\\n  \"\\316\\234\\316\\265\\317\\204\\316\\254\\316\\262\\316\\261\\317\\203\\316\\267 \\317\\203\\317\\204\\316\\267 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261\\0\"\\\n  \"\\316\\221\\317\\200\\317\\214\\316\\272\\317\\201\\317\\205\\317\\210\\316\\267 \\317\\203\\317\\205\\317\\207\\316\\275\\317\\216\\316\\275 \\316\\261\\316\\275\\316\\261\\316\\263\\316\\275\\317\\211\\317\\203\\316\\274\\316\\255\\316\\275\\317\\211\\316\\275 \\316\\261\\317\\201\\317\\207\\316\\265\\316\\257\\317\\211\\316\\275\\0\"\\\n  \"\\316\\243\\317\\205\\316\\274\\316\\262\\316\\277\\317\\205\\316\\273\\316\\256: \\316\\247\\317\\201\\316\\267\\317\\203\\316\\271\\316\\274\\316\\277\\317\\200\\316\\277\\316\\271\\316\\256\\317\\203\\317\\204\\316\\265 \\317\\204\\316\\277 F3 \\316\\263\\316\\271\\316\\261 \\316\\265\\317\\215\\317\\201\\316\\265\\317\\203\\316\\267 \\317\\204\\316\\277\\317\\205 \\316\\265\\317\\200\\317\\214\\316\\274\\316\\265\\316\\275\\316\\277\\317\\205\\0\"\\\n  \"\\316\\221\\317\\201\\317\\207\\316\\265\\316\\257\\316\\261 \\316\\265\\316\\271\\316\\272\\317\\214\\316\\275\\317\\211\\316\\275 (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"\\316\\235\\316\\261 \\316\\263\\316\\257\\316\\275\\316\\265\\316\\271 \\317\\204\\316\\277 SumatraPDF \\317\\204\\316\\277 \\317\\200\\317\\201\\316\\277\\316\\265\\317\\200\\316\\271\\316\\273\\316\\265\\316\\263\\316\\274\\316\\255\\316\\275\\316\\277 \\317\\200\\317\\201\\317\\214\\316\\263\\317\\201\\316\\261\\316\\274\\316\\274\\316\\261 \\316\\261\\317\\201\\317\\207\\316\\265\\316\\257\\317\\211\\316\\275 PDF;\\0\"\\\n  \"\\316\\243\\317\\205\\317\\203\\317\\207\\316\\265\\317\\204\\316\\271\\317\\203\\316\\274\\317\\214\\317\\202 \\317\\204\\316\\277\\317\\205 SumatraPDF \\316\\274\\316\\265 \\317\\204\\316\\261 \\316\\261\\317\\201\\317\\207\\316\\265\\316\\257\\316\\261 PDF\\0\"\\\n  \"\\316\\233\\316\\265\\316\\271\\317\\204\\316\\277\\317\\205\\317\\201\\316\\263\\316\\257\\316\\261 Manga\\0\"\\\n  \"\\316\\221\\316\\275\\317\\204\\316\\271\\317\\203\\317\\204\\316\\277\\316\\257\\317\\207\\316\\271\\317\\203\\316\\267 \\317\\200\\316\\265\\316\\266\\317\\216\\316\\275-\\316\\272\\316\\265\\317\\206\\316\\261\\316\\273\\316\\261\\316\\257\\317\\211\\316\\275\\0\"\\\n  \"\\316\\210\\316\\263\\316\\263\\317\\201\\316\\261\\317\\206\\316\\261 Mobi\\0\"\\\n  \"\\316\\244\\317\\201\\316\\277\\317\\200\\316\\277\\317\\200\\316\\277\\316\\271\\316\\256\\316\\270\\316\\267\\316\\272\\316\\265:\\0\"\\\n  \"\\316\\227 \\316\\275\\316\\255\\316\\261 \\316\\255\\316\\272\\316\\264\\316\\277\\317\\203\\316\\267 %s \\316\\265\\316\\257\\316\\275\\316\\261\\316\\271 \\316\\264\\316\\271\\316\\261\\316\\270\\316\\255\\317\\203\\316\\271\\316\\274\\316\\267. \\316\\235\\316\\261 \\316\\263\\316\\257\\316\\275\\316\\265\\316\\271 \\316\\273\\316\\256\\317\\210\\316\\267;\\0\"\\\n  \"\\316\\225\\317\\200\\317\\214\\316\\274\\316\\265\\316\\275\\316\\267 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261\\0\"\\\n  \"\\316\\224\\316\\265 \\316\\262\\317\\201\\316\\255\\316\\270\\316\\267\\316\\272\\316\\265 \\317\\204\\316\\277 \\316\\272\\316\\265\\316\\257\\316\\274\\316\\265\\316\\275\\316\\277\\0\"\\\n  \"\\316\\224\\316\\265 \\316\\262\\317\\201\\316\\255\\316\\270\\316\\267\\316\\272\\316\\265 \\316\\261\\317\\200\\316\\277\\317\\204\\316\\255\\316\\273\\316\\265\\317\\203\\316\\274\\316\\261 \\317\\203\\317\\204\\316\\267 \\316\\263\\317\\201\\316\\261\\316\\274\\316\\274\\316\\256 %u \\317\\204\\316\\277\\317\\205 \\316\\261\\317\\201\\317\\207\\316\\265\\316\\257\\316\\277\\317\\205 %s\\0\"\\\n  \"\\316\\224\\316\\265 \\316\\262\\317\\201\\316\\255\\316\\270\\316\\267\\316\\272\\316\\265 \\316\\261\\317\\201\\317\\207\\316\\265\\316\\257\\316\\277 \\317\\203\\317\\205\\316\\263\\317\\207\\317\\201\\316\\277\\316\\275\\316\\271\\317\\203\\316\\274\\316\\277\\317\\215\\0\"\\\n  \"\\316\\224\\316\\265 \\316\\262\\317\\201\\316\\255\\316\\270\\316\\267\\316\\272\\316\\261\\316\\275 \\317\\200\\316\\273\\316\\267\\317\\201\\316\\277\\317\\206\\316\\277\\317\\201\\316\\257\\316\\265\\317\\202 \\317\\203\\317\\205\\316\\263\\317\\207\\317\\201\\316\\277\\316\\275\\316\\271\\317\\203\\316\\274\\316\\277\\317\\215 \\317\\203\\317\\204\\316\\267 \\316\\270\\316\\255\\317\\203\\316\\267 \\316\\261\\317\\205\\317\\204\\316\\256\\0\"\\\n  \"\\316\\221\\317\\201\\316\\271\\316\\270\\316\\274\\317\\214\\317\\202 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\317\\211\\316\\275:\\0\"\\\n  \"\\316\\237\\316\\232\\0\"\\\n  \"\\316\\206\\316\\275\\316\\277\\316\\271\\316\\263\\316\\274\\316\\261\\0\"\\\n  \"\\316\\206\\316\\275\\316\\277\\316\\271\\316\\263\\316\\274\\316\\261 \\316\\274\\316\\265 PDF-XChange\\0\"\\\n  \"\\316\\206\\316\\275\\316\\277\\316\\271\\316\\263\\316\\274\\316\\261 \\316\\265\\316\\263\\316\\263\\317\\201\\316\\254\\317\\206\\316\\277\\317\\205...\\0\"\\\n  \"\\316\\206\\316\\275\\316\\277\\316\\271\\316\\263\\316\\274\\316\\261 \\317\\203\\316\\265 %s\\0\"\\\n  \"\\316\\206\\316\\275\\316\\277\\316\\271\\316\\263\\316\\274\\316\\261 \\316\\274\\316\\265 &Adobe Reader\\0\"\\\n  \"\\316\\206\\316\\275\\316\\277\\316\\271\\316\\263\\316\\274\\316\\261 \\316\\274\\316\\265 &Foxit Reader\\0\"\\\n  \"\\316\\206\\316\\275\\316\\277\\316\\271\\316\\263\\316\\274\\316\\261 \\316\\274\\316\\265 Microsoft HTML Help\\0\"\\\n  \"\\316\\206\\316\\275\\316\\277\\316\\271\\316\\263\\316\\274\\316\\261 \\316\\274\\316\\265 Microsoft XPS-Viewer\\0\"\\\n  \"&\\316\\231\\316\\264\\316\\271\\317\\214\\317\\204\\316\\267\\317\\204\\316\\265\\317\\202\\0\"\\\n  \"&\\316\\231\\316\\264\\316\\271\\317\\214\\317\\204\\316\\267\\317\\204\\316\\265\\317\\202\\tCtrl+D\\0\"\\\n  \"\\316\\221\\317\\201\\317\\207\\316\\265\\316\\257\\316\\277 PDF\\0\"\\\n  \"\\316\\222\\316\\265\\316\\273\\317\\204\\316\\271\\317\\203\\317\\204\\316\\277\\317\\200\\316\\277\\316\\257\\316\\267\\317\\203\\316\\267 PDF\\0\"\\\n  \"\\316\\224\\316\\267\\316\\274\\316\\271\\316\\277\\317\\205\\317\\201\\316\\263\\317\\214\\317\\202 PDF:\\0\"\\\n  \"\\316\\210\\316\\272\\316\\264\\316\\277\\317\\203\\316\\267 PDF:\\0\"\\\n  \"\\316\\221\\317\\201\\317\\207\\316\\265\\316\\257\\316\\261 PDF\\0\"\\\n  \"&\\316\\243\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261...\\tCtrl+G\\0\"\\\n  \"\\316\\243\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261 %s\\0\"\\\n  \"\\316\\234\\316\\255\\316\\263\\316\\265\\316\\270\\316\\277\\317\\202 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261\\317\\202:\\0\"\\\n  \"\\316\\224\\316\\265\\316\\275 \\317\\205\\317\\200\\316\\254\\317\\201\\317\\207\\316\\265\\316\\271 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261 \\316\\274\\316\\265 \\316\\261\\317\\201\\316\\271\\316\\270\\316\\274\\317\\214 %u\\0\"\\\n  \"\\316\\232\\316\\273\\316\\257\\316\\274\\316\\261\\316\\272\\316\\261 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261\\317\\202\\0\"\\\n  \"\\316\\243\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261:\\0\"\\\n  \"\\316\\210\\316\\263\\316\\263\\317\\201\\316\\261\\317\\206\\316\\261 PalmDoc \\0\"\\\n  \"\\316\\240\\316\\261\\317\\201\\316\\261\\316\\272\\316\\261\\316\\273\\317\\216 \\317\\200\\316\\265\\317\\201\\316\\271\\316\\274\\316\\255\\316\\275\\316\\265\\317\\204\\316\\265 - \\317\\206\\317\\214\\317\\201\\317\\204\\317\\211\\317\\203\\316\\267...\\0\"\\\n  \"\\316\\210\\316\\263\\316\\263\\317\\201\\316\\261\\317\\206\\316\\261 Postscript\\0\"\\\n  \"&\\316\\240\\316\\261\\317\\201\\316\\277\\317\\205\\317\\203\\316\\257\\316\\261\\317\\203\\316\\267\\tCtrl+L\\0\"\\\n  \"\\316\\240\\317\\201\\316\\277\\316\\267\\316\\263\\316\\277\\317\\215\\316\\274\\316\\265\\316\\275\\316\\267 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261\\0\"\\\n  \"\\316\\225\\316\\272\\317\\204\\317\\215\\317\\200\\317\\211\\317\\203\\316\\267\\0\"\\\n  \"\\316\\225\\317\\215\\317\\201\\316\\277\\317\\202 \\316\\265\\316\\272\\317\\204\\317\\215\\317\\200\\317\\211\\317\\203\\316\\267\\317\\202\\0\"\\\n  \"\\316\\237 \\316\\265\\316\\272\\317\\204\\317\\205\\317\\200\\317\\211\\317\\204\\316\\256\\317\\202 \\316\\274\\316\\265 \\316\\261\\317\\205\\317\\204\\317\\214 \\317\\204\\316\\277 \\317\\214\\316\\275\\316\\277\\316\\274\\316\\261 \\316\\264\\316\\265\\316\\275 \\317\\205\\317\\200\\316\\254\\317\\201\\317\\207\\316\\265\\316\\271\\0\"\\\n  \"\\316\\225\\316\\272\\317\\204\\317\\215\\317\\200\\317\\211\\317\\203\\316\\267 \\317\\203\\316\\265 \\316\\265\\316\\276\\316\\255\\316\\273\\316\\271\\316\\276\\316\\267\\0\"\\\n  \"\\316\\227 \\316\\265\\316\\272\\317\\204\\317\\215\\317\\200\\317\\211\\317\\203\\316\\267 \\316\\265\\316\\257\\316\\275\\316\\261\\316\\271 \\316\\261\\316\\272\\317\\214\\316\\274\\316\\261 \\317\\203\\316\\265 \\316\\265\\316\\276\\316\\255\\316\\273\\316\\271\\316\\276\\316\\267. \\316\\221\\316\\272\\317\\215\\317\\201\\317\\211\\317\\203\\316\\267 \\316\\272\\316\\261\\316\\271 \\316\\210\\316\\276\\316\\277\\316\\264\\316\\277\\317\\202;\\0\"\\\n  \"\\316\\227 \\316\\265\\316\\272\\317\\204\\317\\215\\317\\200\\317\\211\\317\\203\\316\\267 \\316\\262\\317\\201\\316\\257\\317\\203\\316\\272\\316\\265\\317\\204\\316\\261\\316\\271 \\317\\203\\316\\265 \\316\\265\\316\\276\\316\\255\\316\\273\\316\\271\\316\\276\\316\\267. \\316\\235\\316\\261 \\316\\261\\316\\272\\317\\205\\317\\201\\317\\211\\316\\270\\316\\265\\316\\257 \\316\\272\\316\\261\\316\\271 \\316\\275\\316\\261 \\316\\276\\316\\265\\316\\272\\316\\271\\316\\275\\316\\256\\317\\203\\316\\265\\316\\271 \\317\\200\\316\\254\\316\\273\\316\\271;\\0\"\\\n  \"\\316\\225\\316\\272\\317\\204\\317\\215\\317\\200\\317\\211\\317\\203\\316\\267 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261\\317\\202 %d \\316\\261\\317\\200\\317\\214 %d...\\0\"\\\n  \"\\316\\240\\317\\201\\317\\214\\316\\262\\316\\273\\316\\267\\316\\274\\316\\261 \\316\\265\\316\\272\\317\\204\\317\\215\\317\\200\\317\\211\\317\\203\\316\\267\\317\\202.\\0\"\\\n  \"&\\316\\234\\316\\265\\317\\204\\316\\277\\316\\275\\316\\277\\316\\274\\316\\261\\317\\203\\316\\257\\316\\261...\\tF2\\0\"\\\n  \"\\316\\221\\317\\200\\316\\277&\\316\\274\\316\\275\\316\\267\\316\\274\\317\\214\\316\\275\\316\\265\\317\\205\\317\\203\\316\\267 \\317\\200\\317\\201\\316\\277\\317\\203\\317\\206\\316\\254\\317\\204\\317\\211\\316\\275 \\316\\261\\317\\201\\317\\207\\316\\265\\316\\257\\317\\211\\316\\275\\0\"\\\n  \"\\316\\221\\317\\206\\316\\261\\316\\257\\317\\201\\316\\265\\317\\203\\316\\267 \\316\\261\\317\\200\\317\\214 \\317\\204\\316\\261 \\316\\261\\316\\263\\316\\261\\317\\200\\316\\267\\316\\274\\316\\255\\316\\275\\316\\261\\0\"\\\n  \"\\316\\221\\317\\206\\316\\261\\316\\257\\317\\201\\316\\265\\317\\203\\316\\267 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261\\317\\202 %s \\316\\261\\317\\200\\317\\214 \\317\\204\\316\\261 \\316\\261\\316\\263\\316\\261\\317\\200\\316\\267\\316\\274\\316\\255\\316\\275\\316\\261\\0\"\\\n  \"\\316\\234\\316\\265\\317\\204\\316\\277\\316\\275\\316\\277\\316\\274\\316\\261\\317\\203\\316\\257\\316\\261\\0\"\\\n  \"\\316\\240\\316\\265\\317\\201\\316\\271\\317\\203\\317\\204\\317\\201\\316\\277\\317\\206\\316\\256 \\316\\261\\317\\201\\316\\271\\317\\203\\317\\204\\316\\265\\317\\201\\316\\254\\tCtrl+Shift+-\\0\"\\\n  \"\\316\\240\\316\\265\\317\\201\\316\\271\\317\\203\\317\\204\\317\\201\\316\\277\\317\\206\\316\\256 \\316\\264\\316\\265\\316\\276\\316\\271\\316\\254\\tCtrl+Shift++\\0\"\\\n  \"\\316\\221\\317\\200\\316\\277\\316\\270\\316\\256\\316\\272\\316\\265\\317\\205\\317\\203\\316\\267 \\317\\211\\317\\202\\0\"\\\n  \"\\316\\221\\317\\200\\316\\277\\316\\270\\316\\256\\316\\272\\316\\265\\317\\205\\317\\203\\316\\267 &\\317\\203\\317\\205\\316\\275\\317\\204\\317\\214\\316\\274\\316\\265\\317\\205\\317\\203\\316\\267\\317\\202...\\tCtrl+Shift+S\\0\"\\\n  \"\\316\\221\\316\\275\\316\\261\\316\\266\\316\\256\\317\\204\\316\\267\\317\\203\\316\\267 %d \\316\\261\\317\\200\\317\\214 %d...\\0\"\\\n  \"\\316\\225\\317\\200\\316\\271\\316\\273\\316\\277\\316\\263\\316\\256 \\317\\214&\\316\\273\\317\\211\\316\\275\\0\"\\\n  \"\\316\\225\\317\\200\\316\\271\\316\\273\\316\\277\\316\\263\\316\\256 \\317\\214\\316\\273\\317\\211\\316\\275\\tCtrl+A\\0\"\\\n  \"\\316\\225\\317\\200\\316\\271\\316\\273\\316\\255\\316\\276\\317\\204\\316\\265 \\317\\200\\316\\265\\317\\201\\316\\271\\316\\265\\317\\207\\317\\214\\316\\274\\316\\265\\316\\275\\316\\277 \\316\\274\\316\\265 Ctrl+\\316\\261\\317\\201\\316\\271\\317\\203\\317\\204\\316\\265\\317\\201\\317\\214 \\317\\200\\316\\273\\316\\256\\316\\272\\317\\204\\317\\201\\316\\277 \\317\\200\\316\\277\\316\\275\\317\\204\\316\\271\\316\\272\\316\\271\\316\\277\\317\\215\\0\"\\\n  \"\\316\\225\\317\\200\\316\\271\\316\\273\\316\\277\\316\\263\\316\\256:\\0\"\\\n  \"\\316\\221&\\317\\200\\316\\277\\317\\203\\317\\204\\316\\277\\316\\273\\316\\256 \\316\\274\\316\\265 E-mail...\\0\"\\\n  \"\\316\\225\\316\\274\\317\\206\\316\\254\\316\\275\\316\\271\\317\\203\\316\\267 \\316\\263\\317\\201\\316\\261\\316\\274\\316\\274\\316\\256\\317\\202 \\316\\261\\316\\275\\317\\204\\316\\257\\317\\203\\317\\204\\317\\201\\316\\277\\317\\206\\316\\267\\317\\202 \\316\\261\\316\\275\\316\\261\\316\\266\\316\\256\\317\\204\\316\\267\\317\\203\\316\\267\\317\\202\\0\"\\\n  \"\\316\\225\\316\\274\\317\\206\\316\\254\\316\\275\\316\\271\\317\\203\\316\\267 &\\317\\203\\316\\265\\316\\273\\316\\271\\316\\264\\316\\277\\316\\264\\316\\265\\316\\271\\316\\272\\317\\204\\317\\216\\316\\275\\0\"\\\n  \"&\\316\\243\\317\\205\\316\\275\\316\\265\\317\\207\\316\\256\\317\\202 \\316\\265\\316\\274\\317\\206\\316\\254\\316\\275\\316\\271\\317\\203\\316\\267 \\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\317\\211\\316\\275\\0\"\\\n  \"&\\316\\225\\316\\274\\317\\206\\316\\254\\316\\275\\316\\271\\317\\203\\316\\267 \\316\\263\\317\\201\\316\\261\\316\\274\\316\\274\\316\\256\\317\\202 \\316\\265\\317\\201\\316\\263\\316\\261\\316\\273\\316\\265\\316\\257\\317\\211\\316\\275\\0\"\\\n  \"\\316\\225\\316\\274\\317\\206\\316\\254\\316\\275\\316\\271\\317\\203\\316\\267 \\316\\261\\316\\263\\316\\261\\317\\200\\316\\267\\316\\274\\316\\255\\316\\275\\317\\211\\316\\275\\0\"\\\n  \"\\316\\225\\316\\274\\317\\206\\316\\254\\316\\275\\316\\271\\317\\203\\316\\267 \\317\\203\\317\\205\\317\\207\\316\\275\\316\\254 \\316\\261\\316\\275\\316\\261\\316\\263\\316\\275\\317\\211\\317\\203\\316\\274\\316\\255\\316\\275\\317\\211\\316\\275 \\316\\261\\317\\201\\317\\207\\316\\265\\316\\257\\317\\211\\316\\275\\0\"\\\n  \"\\316\\225\\316\\274\\317\\206\\316\\254\\316\\275\\316\\271\\317\\203\\316\\267 &\\317\\200\\316\\273\\316\\265\\317\\205\\317\\201\\316\\271\\316\\272\\316\\256\\317\\202 \\317\\203\\317\\204\\316\\256\\316\\273\\316\\267\\317\\202 \\317\\203\\316\\265\\316\\273\\316\\271\\316\\264\\316\\277\\316\\264\\316\\265\\316\\271\\316\\272\\317\\204\\317\\216\\316\\275 \\317\\214\\317\\200\\316\\277\\317\\205 \\316\\265\\316\\257\\316\\275\\316\\261\\316\\271 \\316\\264\\317\\205\\316\\275\\316\\261\\317\\204\\317\\214\\316\\275\\0\"\\\n  \"\\316\\234\\316\\277\\316\\275\\316\\256 \\316\\243\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261\\0\"\\\n  \"\\316\\234\\316\\261\\317\\202 \\317\\203\\317\\205\\316\\263\\317\\207\\317\\211\\317\\201\\316\\265\\316\\257\\317\\204\\316\\265 \\316\\263\\316\\271\\316\\261 \\317\\204\\316\\277 \\316\\261\\316\\275\\316\\261\\317\\200\\316\\254\\316\\275\\317\\204\\316\\265\\317\\207\\316\\277 \\317\\203\\317\\206\\316\\254\\316\\273\\316\\274\\316\\261 \\317\\200\\316\\277\\317\\205 \\317\\203\\317\\205\\316\\275\\316\\255\\316\\262\\316\\267!\\n\\n\\316\\221\\316\\275 \\316\\270\\316\\255\\316\\273\\316\\265\\317\\204\\316\\265 \\316\\275\\316\\261 \\316\\274\\316\\261\\317\\202 \\316\\262\\316\\277\\316\\267\\316\\270\\316\\256\\317\\203\\316\\265\\317\\204\\316\\265 \\316\\275\\316\\261 \\316\\261\\316\\275\\317\\204\\316\\271\\316\\274\\316\\265\\317\\204\\317\\211\\317\\200\\316\\257\\317\\203\\316\\277\\317\\205\\316\\274\\316\\265 \\317\\204\\316\\277 \\317\\200\\317\\201\\316\\277\\316\\262\\316\\273\\316\\256\\316\\274\\316\\261, \\317\\200\\316\\261\\317\\201\\316\\261\\316\\272\\316\\261\\316\\273\\316\\277\\317\\215\\316\\274\\316\\265 \\317\\200\\316\\261\\317\\204\\316\\256\\317\\203\\317\\204\\316\\265 '\\316\\206\\316\\272\\317\\205\\317\\201\\316\\277'.\\0\"\\\n  \"\\316\\244\\316\\277 \\316\\261\\317\\201\\317\\207\\316\\265\\316\\257\\316\\277 \\317\\200\\317\\201\\316\\277\\316\\255\\316\\273\\316\\265\\317\\205\\317\\203\\316\\267\\317\\202 %s \\316\\264\\316\\265\\316\\275 \\316\\255\\317\\207\\316\\265\\316\\271 \\317\\203\\316\\267\\316\\274\\316\\265\\316\\257\\316\\277 \\317\\203\\317\\205\\316\\263\\317\\207\\317\\201\\316\\277\\316\\275\\316\\271\\317\\203\\316\\274\\316\\277\\317\\215\\0\"\\\n  \"\\316\\230\\316\\255\\316\\274\\316\\261:\\0\"\\\n  \"\\316\\225\\317\\200\\316\\271\\316\\273\\316\\277\\316\\263\\316\\255\\317\\202 SumatraPDF\\0\"\\\n  \"\\316\\225\\316\\275\\316\\267\\316\\274\\316\\255\\317\\201\\317\\211\\317\\203\\316\\267 SumatraPDF\\0\"\\\n  \"\\316\\244\\316\\277 SumatraPDF \\317\\203\\317\\204\\316\\261\\316\\274\\316\\254\\317\\204\\316\\267\\317\\203\\316\\265 \\316\\275\\316\\261 \\316\\273\\316\\265\\316\\271\\317\\204\\316\\277\\317\\205\\317\\201\\316\\263\\316\\265\\316\\257\\0\"\\\n  \"\\316\\244\\316\\277 SumatraPDF \\316\\265\\316\\257\\316\\275\\316\\261\\316\\271 \\317\\204\\316\\277 \\317\\200\\317\\201\\316\\277\\316\\265\\317\\200\\316\\271\\316\\273\\316\\265\\316\\263\\316\\274\\316\\255\\316\\275\\316\\277 \\317\\200\\317\\201\\317\\214\\316\\263\\317\\201\\316\\261\\316\\274\\316\\274\\316\\261 PDF\\0\"\\\n  \"\\316\\244\\316\\277 SumatraPDF \\317\\200\\317\\201\\316\\255\\317\\200\\316\\265\\316\\271 \\316\\275\\316\\261 \\316\\265\\316\\257\\316\\275\\316\\261\\316\\271 \\317\\204\\317\\216\\317\\201\\316\\261 \\317\\203\\317\\205\\317\\203\\317\\207\\316\\265\\317\\204\\316\\271\\317\\203\\316\\274\\316\\255\\316\\275\\316\\277 \\316\\274\\316\\265 \\317\\204\\316\\261 \\316\\261\\317\\201\\317\\207\\316\\265\\316\\257\\316\\261 PDF\\0\"\\\n  \"\\316\\244\\316\\277 \\316\\261\\317\\201\\317\\207\\316\\265\\316\\257\\316\\277 \\317\\203\\317\\205\\316\\263\\317\\207\\317\\201\\316\\277\\316\\275\\316\\271\\317\\203\\316\\274\\316\\277\\317\\215 \\316\\264\\316\\265 \\316\\274\\317\\200\\316\\277\\317\\201\\316\\265\\316\\257 \\316\\275\\316\\261 \\316\\261\\316\\275\\316\\277\\316\\271\\317\\207\\316\\270\\316\\265\\316\\257\\0\"\\\n  \"PDF \\316\\274\\316\\265 \\316\\265\\317\\204\\316\\271\\316\\272\\316\\255\\317\\204\\317\\204\\316\\261\\0\"\\\n  \"\\316\\221\\317\\201\\317\\207\\316\\265\\316\\257\\316\\261 \\316\\272\\316\\265\\316\\271\\316\\274\\316\\255\\316\\275\\316\\277\\317\\205\\0\"\\\n  \"\\316\\221\\317\\205\\317\\204\\317\\214 \\317\\204\\316\\277 \\316\\255\\316\\263\\316\\263\\317\\201\\316\\261\\317\\206\\316\\277 \\317\\207\\317\\201\\316\\267\\317\\203\\316\\271\\316\\274\\316\\277\\317\\200\\316\\277\\316\\271\\316\\265\\316\\257 \\316\\274\\316\\267 \\317\\205\\317\\200\\316\\277\\317\\203\\317\\204\\316\\267\\317\\201\\316\\271\\316\\266\\317\\214\\316\\274\\316\\265\\316\\275\\316\\265\\317\\202 \\316\\264\\317\\205\\316\\275\\316\\261\\317\\204\\317\\214\\317\\204\\316\\267\\317\\204\\316\\265\\317\\202 (%s) \\316\\272\\316\\261\\316\\271 \\316\\264\\316\\265\\316\\275 \\316\\270\\316\\261 \\316\\274\\317\\200\\316\\277\\317\\201\\316\\255\\317\\203\\316\\265\\316\\271 \\316\\275\\316\\261 \\316\\265\\316\\274\\317\\206\\316\\261\\316\\275\\316\\271\\317\\203\\317\\204\\316\\265\\316\\257 \\317\\203\\317\\211\\317\\203\\317\\204\\316\\254\\0\"\\\n  \"\\316\\244\\316\\257\\317\\204\\316\\273\\316\\277\\317\\202:\\0\"\\\n  \"\\316\\206\\316\\263\\316\\275\\317\\211\\317\\203\\317\\204\\316\\277 \\316\\261\\317\\201\\317\\207\\316\\265\\316\\257\\316\\277 \\317\\200\\317\\201\\316\\277\\316\\255\\316\\273\\316\\265\\317\\205\\317\\203\\316\\267\\317\\202 (%s)\\0\"\\\n  \"\\316\\247\\317\\201\\316\\256\\317\\203\\316\\267 &\\316\\272\\316\\261\\317\\201\\317\\204\\316\\265\\316\\273\\317\\216\\316\\275\\0\"\\\n  \"\\316\\240\\317\\201\\316\\277\\316\\262\\316\\277\\316\\273\\316\\256\\0\"\\\n  \"&\\316\\231\\317\\203\\317\\204\\316\\277\\317\\203\\316\\265\\316\\273\\316\\257\\316\\264\\316\\261 \\317\\200\\317\\201\\316\\277\\316\\263\\317\\201\\316\\254\\316\\274\\316\\274\\316\\261\\317\\204\\316\\277\\317\\202\\0\"\\\n  \"\\316\\240\\317\\201\\316\\277\\316\\265\\316\\271\\316\\264\\316\\277\\317\\200\\316\\277\\316\\257\\316\\267\\317\\203\\316\\267\\0\"\\\n  \"\\316\\210\\316\\263\\316\\263\\317\\201\\316\\261\\317\\206\\316\\261 XPS\\0\"\\\n  \"\\316\\210\\317\\207\\316\\265\\317\\204\\316\\265 \\317\\204\\316\\267\\316\\275 \\317\\200\\316\\271\\316\\277 \\317\\200\\317\\201\\317\\214\\317\\203\\317\\206\\316\\261\\317\\204\\316\\267 \\316\\255\\316\\272\\316\\264\\316\\277\\317\\203\\316\\267.\\0\"\\\n  \"\\316\\210\\317\\207\\316\\265\\317\\204\\316\\265 \\317\\204\\316\\267\\316\\275 \\316\\255\\316\\272\\316\\264\\316\\277\\317\\203\\316\\267 %s\\0\"\\\n  \"\\316\\226\\316\\277\\317\\205\\316\\274\\0\"\\\n  \"\\316\\234\\316\\265\\316\\263\\316\\255\\316\\270\\317\\205\\316\\275\\317\\203\\316\\267\\0\"\\\n  \"\\316\\243\\316\\274\\316\\257\\316\\272\\317\\201\\317\\205\\316\\275\\317\\203\\316\\267\\0\"\\\n  \"\\316\\240\\316\\277\\317\\203\\316\\277\\317\\203\\317\\204\\317\\214 \\316\\274\\316\\265\\316\\263\\316\\255\\316\\270\\317\\205\\316\\275\\317\\203\\316\\267\\317\\202\\0\"\\\n  \"[\\316\\221\\316\\275\\316\\271\\317\\207\\316\\275\\316\\265\\317\\215\\317\\204\\316\\267\\316\\272\\316\\261\\316\\275 \\316\\261\\316\\273\\316\\273\\316\\261\\316\\263\\316\\255\\317\\202, \\316\\261\\316\\275\\316\\261\\316\\275\\316\\255\\317\\211\\317\\203\\316\\267] %s\\0\"\\\n  \"\\316\\261\\316\\275\\317\\204\\316\\271\\316\\263\\317\\201\\316\\261\\317\\206\\316\\256 \\316\\272\\316\\265\\316\\271\\316\\274\\316\\255\\316\\275\\316\\277\\317\\205\\0\"\\\n  \"\\316\\265\\316\\272\\317\\204\\317\\215\\317\\200\\317\\211\\317\\203\\316\\267 \\316\\265\\316\\263\\316\\263\\317\\201\\316\\254\\317\\206\\316\\277\\317\\205\\0\";\n\nconst char * gTranslations_he = \n  \"\\327\\220\\327\\225\\327\\223\\327\\225\\327\\252...\\0\"\\\n  \"\\327\\222\\327\\225\\327\\223\\327\\234 \\327\\236\\327\\247\\327\\225\\327\\250\\327\\231\\tCtrl+1\\0\"\\\n  \"\\327\\224\\327\\222\\327\\223\\327\\250\\327\\225\\327\\252 \\327\\236\\327\\252\\327\\247\\327\\223\\327\\236\\327\\225\\327\\252...\\0\"\\\n  \"\\327\\233\\327\\234 \\327\\224\\327\\242\\327\\236\\327\\225\\327\\223\\327\\231\\327\\235 \\327\\224\\327\\240\\327\\221\\327\\227\\327\\250\\327\\231\\327\\235\\0\"\\\n  \"\\327\\236\\327\\247\\327\\230\\327\\242 \\327\\247\\327\\225\\327\\223\\327\\235\\t\\327\\227\\327\\245 \\327\\251\\327\\236\\327\\220\\327\\234\\327\\231 + Alt\\0\"\\\n  \"\\327\\252\\327\\246\\327\\225\\327\\222\\327\\252 \\327\\241\\327\\244\\327\\250\\tCtrl+8\\0\"\\\n  \"\\327\\241\\327\\222\\327\\225\\327\\250\\tCtrl+W\\0\"\\\n  \"\\327\\224\\327\\242\\327\\252\\327\\247 \\327\\221\\327\\227\\327\\231\\327\\250\\327\\224\\0\"\\\n  \"\\327\\224\\327\\242\\327\\252\\327\\247 \\327\\221\\327\\227\\327\\231\\327\\250\\327\\224\\tCtrl+C\\0\"\\\n  \"\\327\\220\\327\\234 \\327\\252\\327\\246\\327\\231\\327\\222 \\327\\224\\327\\225\\327\\223\\327\\242\\327\\224 \\327\\226\\327\\225 \\327\\251\\327\\225\\327\\221\\0\"\\\n  \"\\327\\242\\327\\236\\327\\225\\327\\223\\327\\231\\327\\235 \\327\\226\\327\\225\\327\\222\\327\\231\\327\\231\\327\\235 \\327\\221\\327\\234\\327\\221\\327\\223\\0\"\\\n  \"\\327\\242\\327\\236\\327\\225\\327\\223 \\327\\234\\327\\246\\327\\223 \\327\\242\\327\\236\\327\\225\\327\\223\\tCtrl+7\\0\"\\\n  \"&\\327\\247\\327\\225\\327\\221\\327\\245\\0\"\\\n  \"\\327\\227\\327\\244\\327\\251:\\0\"\\\n  \"\\327\\242\\327\\236\\327\\225\\327\\223 \\327\\250\\327\\220\\327\\251\\327\\225\\327\\237\\tHome\\0\"\\\n  \"\\327\\224\\327\\252\\327\\220\\327\\235 \\327\\242\\327\\236\\327\\225\\327\\223\\327\\231\\327\\235 \\327\\234\\327\\222\\327\\225\\327\\223\\327\\234 \\327\\220\\327\\226\\327\\225\\327\\250 \\327\\224\\327\\223\\327\\244\\327\\241\\327\\224\\0\"\\\n  \"&\\327\\236\\327\\242\\327\\221\\327\\250\\0\"\\\n  \"\\327\\242\\327\\221\\327\\225\\327\\250 \\327\\234\\327\\242\\327\\236\\327\\225\\327\\223:\\0\"\\\n  \"&\\327\\242\\327\\226\\327\\250\\327\\224\\0\"\\\n  \"\\327\\242\\327\\236\\327\\225\\327\\223 \\327\\220\\327\\227\\327\\250\\327\\225\\327\\237\\tEnd\\0\"\\\n  \"\\327\\224\\327\\222\\327\\223\\327\\234\\327\\224:\\0\"\\\n  \"\\327\\236\\327\\223\\327\\250\\327\\231\\327\\232 \\327\\234\\327\\252\\327\\225\\327\\233\\327\\240\\327\\224...\\0\"\\\n  \"\\327\\224\\327\\221\\327\\227\\327\\237 \\327\\221\\327\\231\\327\\237 \\327\\220\\327\\225\\327\\252\\327\\231\\327\\225\\327\\252 \\327\\222\\327\\223\\327\\225\\327\\234\\327\\225\\327\\252 \\327\\234\\327\\247\\327\\230\\327\\240\\327\\225\\327\\252\\0\"\\\n  \"\\327\\242\\327\\236\\327\\225\\327\\223 \\327\\224\\327\\221\\327\\220\\t\\327\\227\\327\\245 \\327\\231\\327\\236\\327\\240\\327\\231\\0\"\\\n  \"\\327\\234\\327\\220\\0\"\\\n  \"\\327\\234\\327\\220, \\327\\252\\327\\225\\327\\223\\327\\224\\0\"\\\n  \"\\327\\242\\327\\236\\327\\225\\327\\223\\327\\231\\327\\235 \\327\\220\\327\\231-\\327\\226\\327\\225\\327\\222\\327\\231\\327\\231\\327\\235 \\327\\221\\327\\234\\327\\221\\327\\223\\0\"\\\n  \"\\327\\244\\327\\252\\327\\227 \\327\\247\\327\\225\\327\\221\\327\\245\\0\"\\\n  \"\\327\\244\\327\\252\\327\\227...\\tCtrl+O\\0\"\\\n  \"\\327\\224\\327\\222\\327\\223\\327\\250\\327\\225\\327\\252...\\0\"\\\n  \"\\327\\241\\327\\241\\327\\236\\327\\224:\\0\"\\\n  \"\\327\\224\\327\\246\\327\\236\\327\\223 \\327\\247\\327\\225\\327\\221\\327\\245\\0\"\\\n  \"\\327\\242\\327\\236\\327\\225\\327\\223 \\327\\247\\327\\225\\327\\223\\327\\235\\t\\327\\227\\327\\245 \\327\\251\\327\\236\\327\\220\\327\\234\\327\\231\\0\"\\\n  \"\\327\\224\\327\\223\\327\\244\\327\\241...\\0\"\\\n  \"\\327\\224\\327\\223\\327\\244\\327\\241...\\tCtrl+P\\0\"\\\n  \"\\327\\224\\327\\223\\327\\244\\327\\241... (\\327\\234\\327\\220 \\327\\224\\327\\252\\327\\220\\327\\244\\327\\251\\327\\250)\\0\"\\\n  \"\\327\\251\\327\\236\\327\\225\\327\\250 \\327\\241\\327\\241\\327\\236\\327\\224 \\327\\234\\327\\247\\327\\225\\327\\221\\327\\245 \\327\\226\\327\\224\\0\"\\\n  \"\\327\\247\\327\\221\\327\\242 \\327\\224\\327\\222\\327\\223\\327\\250\\327\\225\\327\\252 \\327\\220\\327\\234\\327\\225 \\327\\234\\327\\233\\327\\234 \\327\\224\\327\\247\\327\\221\\327\\246\\327\\231\\327\\235\\0\"\\\n  \"\\327\\224\\327\\241\\327\\250 \\327\\247\\327\\225\\327\\221\\327\\245\\0\"\\\n  \"\\327\\251\\327\\236\\327\\225\\327\\250 \\327\\221\\327\\251\\327\\235...\\0\"\\\n  \"\\327\\251\\327\\236\\327\\225\\327\\250 \\327\\221\\327\\251\\327\\235...\\tCtrl+S\\0\"\\\n  \"&\\327\\220\\327\\244\\327\\251\\327\\250\\327\\225\\327\\231\\327\\225\\327\\252\\0\"\\\n  \"\\327\\233\\327\\225\\327\\225\\327\\245 \\327\\242\\327\\236\\327\\225\\327\\223\\327\\231\\327\\235 \\327\\234\\327\\222\\327\\225\\327\\223\\327\\234 \\327\\220\\327\\226\\327\\225\\327\\250 \\327\\224\\327\\224\\327\\223\\327\\244\\327\\241\\327\\224 (\\327\\220\\327\\235 \\327\\240\\327\\223\\327\\250\\327\\251)\\0\"\\\n  \"\\327\\242\\327\\236\\327\\225\\327\\223 \\327\\231\\327\\227\\327\\231\\327\\223\\tCtrl+6\\0\"\\\n  \"\\327\\223\\327\\234\\327\\222 \\327\\242\\327\\234 \\327\\222\\327\\250\\327\\241\\327\\224 \\327\\226\\327\\225\\0\"\\\n  \"\\327\\224\\327\\251\\327\\252\\327\\236\\327\\251 \\327\\221\\327\\236\\327\\231\\327\\223\\327\\225\\327\\252 \\327\\242\\327\\236\\327\\225\\327\\223 \\327\\236\\327\\247\\327\\225\\327\\250\\327\\231\\327\\225\\327\\252\\0\"\\\n  \"&\\327\\252\\327\\246\\327\\225\\327\\222\\327\\224\\0\"\\\n  \"&\\327\\227\\327\\234\\327\\225\\327\\237\\0\"\\\n  \"\\327\\233\\327\\237\\0\"\\\n  \"&\\327\\226\\327\\225\\327\\235\\0\"\\\n  \"(\\327\\236\\327\\252\\327\\225\\327\\232 %d)\\0\"\\\n  \"(\\327\\242\\327\\236\\327\\225\\327\\223 %s)\\0\"\\\n  \"\\327\\220\\327\\225\\327\\223\\327\\225\\327\\252 SumatraPDF\\0\"\\\n  \"\\327\\224\\327\\225\\327\\241\\327\\244\\327\\252 \\327\\236\\327\\225\\327\\242\\327\\223\\327\\243\\0\"\\\n  \"\\327\\224\\327\\225\\327\\241\\327\\243 \\327\\220\\327\\252 \\327\\242\\327\\236\\327\\225\\327\\223 \\327\\236\\327\\241' %s \\327\\234\\327\\236\\327\\225\\327\\242\\327\\223\\327\\244\\327\\231\\327\\235...\\0\"\\\n  \"\\327\\224\\327\\225\\327\\241\\327\\243 \\327\\220\\327\\252 \\327\\242\\327\\236\\327\\225\\327\\223 \\327\\236\\327\\241' %s \\327\\234\\327\\236\\327\\225\\327\\242\\327\\223\\327\\244\\327\\231\\327\\235 \\327\\221\\327\\251\\327\\235:\\0\"\\\n  \"\\327\\224\\327\\225\\327\\241\\327\\243 \\327\\234\\327\\236\\327\\225\\327\\242\\327\\223\\327\\244\\327\\231\\327\\235\\0\"\\\n  \"\\327\\236\\327\\252\\327\\247\\327\\223\\327\\235\\0\"\\\n  \"\\327\\233\\327\\234 \\327\\224\\327\\247\\327\\221\\327\\246\\327\\231\\327\\235\\0\"\\\n  \"\\327\\233\\327\\234 \\327\\224\\327\\247\\327\\221\\327\\246\\327\\231\\327\\235 \\327\\224\\327\\240\\327\\252\\327\\236\\327\\233\\327\\231\\327\\235\\0\"\\\n  \"\\327\\231\\327\\231\\327\\251\\327\\225\\327\\235:\\0\"\\\n  \"\\327\\234\\327\\251\\327\\231\\327\\231\\327\\232 \\327\\234\\327\\247\\327\\225\\327\\221\\327\\246\\327\\231 PDF?\\0\"\\\n  \"\\327\\240\\327\\241\\327\\244\\327\\227: %s\\0\"\\\n  \"\\327\\236\\327\\227\\327\\221\\327\\250:\\0\"\\\n  \"\\327\\220\\327\\225\\327\\230\\327\\225\\327\\236\\327\\230\\327\\231\\327\\252\\0\"\\\n  \"\\327\\221\\327\\223\\327\\225\\327\\247 \\327\\242\\327\\223\\327\\233\\327\\225\\327\\240\\327\\231\\327\\235 \\327\\220\\327\\225\\327\\230\\327\\225\\327\\236\\327\\230\\327\\231\\327\\252\\0\"\\\n  \"\\327\\252\\327\\246\\327\\225\\327\\222\\327\\252 \\327\\241\\327\\244\\327\\250\\0\"\\\n  \"\\327\\241\\327\\231\\327\\236\\327\\240\\327\\231\\327\\225\\327\\252\\tF12\\0\"\\\n  \"\\327\\247\\327\\231\\327\\246\\327\\225\\327\\250\\327\\231 \\327\\223\\327\\250\\327\\232 \\327\\234\\327\\241\\327\\231\\327\\236\\327\\240\\327\\231\\327\\231\\327\\224\\0\"\\\n  \"\\327\\247\\327\\231\\327\\246\\327\\225\\327\\250 \\327\\223\\327\\250\\327\\232 \\327\\234\\327\\241\\327\\231\\327\\236\\327\\240\\327\\231\\327\\231\\327\\252 \\327\\242\\327\\236\\327\\225\\327\\223 %s \\327\\236\\327\\252\\327\\225\\327\\232 %s\\0\"\\\n  \"\\327\\241\\327\\231\\327\\236\\327\\240\\327\\231\\327\\225\\327\\252\\0\"\\\n  \"\\0\"\\\n  \"CHM \\327\\247\\327\\225\\327\\221\\327\\246\\327\\231\\0\"\\\n  \"\\327\\233\\327\\231\\327\\251\\327\\234\\327\\225\\327\\237 \\327\\221\\327\\227\\327\\231\\327\\221\\327\\225\\327\\250 \\327\\234\\327\\220\\327\\231\\327\\240\\327\\230\\327\\250\\327\\240\\327\\230 (\\327\\251\\327\\222\\327\\231\\327\\220\\327\\224 %#x).\\0\"\\\n  \"\\327\\221\\327\\231\\327\\230\\327\\225\\327\\234\\0\"\\\n  \"\\327\\224\\327\\223\\327\\244\\327\\241\\327\\252 \\327\\224\\327\\247\\327\\225\\327\\221\\327\\245 \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\244\\327\\247\\327\\225\\327\\223\\327\\252 \\327\\227\\327\\231\\327\\244\\327\\225\\327\\251 \\327\\224\\327\\244\\327\\225\\327\\232 \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224. \\327\\220\\327\\240\\327\\220 \\327\\221\\327\\223\\327\\225\\327\\247 \\327\\220\\327\\252 \\327\\251\\327\\225\\327\\250\\327\\252 \\327\\224\\327\\244\\327\\247\\327\\225\\327\\223\\327\\224 \\327\\221\\327\\224\\327\\222\\327\\223\\327\\250\\327\\225\\327\\252.\\0\"\\\n  \"\\327\\251\\327\\240\\327\\224 \\327\\251\\327\\244\\327\\252 \\327\\236\\327\\236\\327\\251\\327\\247 (Change language)\\0\"\\\n  \"\\327\\221\\327\\223\\327\\225\\327\\247 \\327\\242\\327\\223\\327\\233\\327\\225\\327\\240\\327\\231\\327\\235...\\0\"\\\n  \"\\327\\241\\327\\244\\327\\250\\327\\231 \\327\\247\\327\\225\\327\\236\\327\\231\\327\\247\\327\\241\\0\"\\\n  \"\\327\\252\\327\\220\\327\\231\\327\\236\\327\\225\\327\\252\\0\"\\\n  \"\\327\\250\\327\\246\\327\\231\\327\\244\\327\\224\\0\"\\\n  \"\\327\\252\\327\\246\\327\\225\\327\\222\\327\\252 \\327\\241\\327\\244\\327\\250 \\327\\250\\327\\246\\327\\231\\327\\244\\327\\224\\0\"\\\n  \"\\327\\252\\327\\246\\327\\225\\327\\222\\327\\252 '\\327\\242\\327\\236\\327\\225\\327\\223 \\327\\234\\327\\246\\327\\223 \\327\\242\\327\\236\\327\\225\\327\\223' \\327\\250\\327\\246\\327\\231\\327\\244\\327\\224\\0\"\\\n  \"\\327\\241\\327\\231\\327\\231\\327\\242 \\327\\221\\327\\252\\327\\250\\327\\222\\327\\225\\327\\235\\0\"\\\n  \"\\327\\224\\327\\242\\327\\252\\327\\247 \\327\\252\\327\\236\\327\\225\\327\\240\\327\\224\\0\"\\\n  \"\\327\\224\\327\\242\\327\\252\\327\\247 \\327\\233\\327\\252\\327\\225\\327\\221\\327\\252 \\327\\247\\327\\231\\327\\251\\327\\225\\327\\250\\0\"\\\n  \"\\327\\224\\327\\242\\327\\252\\327\\247 \\327\\224\\327\\242\\327\\250\\327\\224\\0\"\\\n  \"\\327\\224\\327\\242\\327\\252\\327\\247\\327\\252 \\327\\224\\327\\230\\327\\247\\327\\241\\327\\230 \\327\\234\\327\\220 \\327\\224\\327\\252\\327\\220\\327\\244\\327\\251\\327\\250\\327\\224 (\\327\\236\\327\\242\\327\\252\\327\\231\\327\\247 \\327\\233\\327\\252\\327\\236\\327\\225\\327\\240\\327\\224 \\327\\221\\327\\234\\327\\221\\327\\223)\\0\"\\\n  \"\\327\\226\\327\\233\\327\\225\\327\\231\\327\\225\\327\\252 \\327\\231\\327\\225\\327\\246\\327\\250\\327\\231\\327\\235:\\0\"\\\n  \"\\327\\224\\327\\222\\327\\231\\327\\251\\327\\224 \\327\\220\\327\\234 \\327\\236\\327\\220\\327\\244\\327\\231\\327\\231\\327\\240\\327\\231 \\327\\224\\327\\236\\327\\223\\327\\244\\327\\241\\327\\252 \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\220\\327\\252\\327\\227\\327\\225\\327\\234 \\327\\224\\327\\236\\327\\223\\327\\244\\327\\241\\327\\252 \\327\\240\\327\\233\\327\\251\\327\\234.\\0\"\\\n  \"\\327\\247\\327\\250\\327\\231\\327\\220\\327\\252 \\327\\224\\327\\242\\327\\236\\327\\225\\327\\223 \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\240\\327\\225\\327\\246\\327\\250:\\0\"\\\n  \"\\327\\247\\327\\225\\327\\221\\327\\245 \\327\\240\\327\\225\\327\\233\\327\\227\\327\\231\\0\"\\\n  \"\\327\\236\\327\\231\\327\\247\\327\\225\\327\\235 \\327\\241\\327\\236\\327\\237:\\0\"\\\n  \"\\327\\226\\327\\225\\327\\235 \\327\\236\\327\\251\\327\\252\\327\\236\\327\\251...\\tCtrl+Y\\0\"\\\n  \"\\327\\244\\327\\250\\327\\231\\327\\241\\327\\252 \\327\\221\\327\\250\\327\\231\\327\\250\\327\\252 \\327\\236\\327\\227\\327\\223\\327\\234:\\0\"\\\n  \"\\327\\226\\327\\225\\327\\235 \\327\\221\\327\\250\\327\\231\\327\\250\\327\\252 \\327\\236\\327\\227\\327\\223\\327\\234:\\0\"\\\n  \"\\327\\224\\327\\222\\327\\223\\327\\250\\327\\252 \\327\\252\\327\\225\\327\\233\\327\\240\\327\\252 \\327\\221\\327\\250\\327\\231\\327\\250\\327\\252 \\327\\236\\327\\227\\327\\223\\327\\234 \\327\\234- PDF \\327\\220\\327\\231\\327\\240\\327\\224 \\327\\220\\327\\244\\327\\251\\327\\250\\327\\231\\327\\252 \\327\\221\\327\\236\\327\\246\\327\\221 \\327\\240\\327\\231\\327\\231\\327\\223.\\0\"\\\n  \"\\327\\224\\327\\250\\327\\251\\327\\220\\327\\225\\327\\252 \\327\\227\\327\\241\\327\\250\\327\\225\\327\\252:\\0\"\\\n  \"\\327\\247\\327\\225\\327\\221\\327\\246\\327\\231 DjVu\\0\"\\\n  \"\\327\\236\\327\\220\\327\\244\\327\\231\\327\\231\\327\\240\\327\\231 \\327\\247\\327\\225\\327\\221\\327\\245\\0\"\\\n  \"\\327\\224\\327\\225\\327\\250\\327\\223\\0\"\\\n  \"\\327\\231\\327\\246\\327\\231\\327\\220\\327\\224\\tCtrl+Q\\0\"\\\n  \"\\327\\247\\327\\225\\327\\221\\327\\246\\327\\231 EPUB\\0\"\\\n  \"\\327\\224\\327\\233\\327\\240\\327\\241 \\327\\241\\327\\241\\327\\236\\327\\224\\0\"\\\n  \"\\327\\224\\327\\233\\327\\240\\327\\241 \\327\\241\\327\\241\\327\\236\\327\\224 \\327\\234- %s\\0\"\\\n  \"\\327\\224\\327\\226\\327\\237 \\327\\251\\327\\225\\327\\250\\327\\252 \\327\\244\\327\\247\\327\\225\\327\\223\\327\\224 \\327\\234\\327\\224\\327\\244\\327\\242\\327\\234\\327\\224 \\327\\221\\327\\234\\327\\227\\327\\231\\327\\246\\327\\224 \\327\\233\\327\\244\\327\\225\\327\\234\\327\\224 \\327\\242\\327\\234 \\327\\247\\327\\225\\327\\221\\327\\245 \\327\\224- PDF:\\0\"\\\n  \"\\327\\230\\327\\242\\327\\231\\327\\240\\327\\252 %s \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\236\\327\\225\\327\\242&\\327\\223\\327\\244\\327\\231\\327\\235\\0\"\\\n  \"\\327\\236\\327\\247\\327\\230\\327\\242 \\327\\224\\327\\221\\327\\220\\t\\327\\227\\327\\245 \\327\\231\\327\\236\\327\\240\\327\\231 + Alt\\0\"\\\n  \"\\327\\236\\327\\241\\327\\232 \\327\\236\\327\\234\\327\\220\\tCtrl+Shift+L\\0\"\\\n  \"\\327\\242\\327\\236\\327\\225\\327\\223 \\327\\234\\327\\246\\327\\223 \\327\\242\\327\\236\\327\\225\\327\\223\\0\"\\\n  \"\\327\\244\\327\\242\\327\\225\\327\\234\\327\\252 \\327\\251\\327\\231\\327\\240\\327\\225\\327\\231 \\327\\251\\327\\235 \\327\\224\\327\\247\\327\\225\\327\\221\\327\\245 \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\251\\327\\236\\327\\231\\327\\250\\327\\252 \\327\\224\\327\\247\\327\\225\\327\\221\\327\\245 \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\252\\327\\246\\327\\225\\327\\222\\327\\252 \\327\\250\\327\\251\\327\\252 \\327\\236\\327\\224\\327\\231\\327\\250\\327\\224\\0\"\\\n  \"\\327\\236\\327\\225\\327\\242\\327\\223\\327\\244\\327\\231\\327\\235\\0\"\\\n  \"\\327\\247\\327\\225\\327\\221\\327\\246\\327\\231 FictionBook\\0\"\\\n  \"\\327\\224\\327\\247\\327\\225\\327\\221\\327\\245 %s \\327\\234\\327\\220 \\327\\240\\327\\236\\327\\246\\327\\220.\\0\"\\\n  \"\\327\\222\\327\\225\\327\\223\\327\\234 \\327\\224\\327\\247\\327\\225\\327\\221\\327\\245:\\0\"\\\n  \"\\327\\247\\327\\225\\327\\221\\327\\245:\\0\"\\\n  \"\\327\\227\\327\\244\\327\\251...\\tCtrl+F\\0\"\\\n  \"\\327\\227\\327\\244\\327\\251\\0\"\\\n  \"\\327\\227\\327\\244\\327\\251 \\327\\224\\327\\221\\327\\220\\0\"\\\n  \"\\327\\227\\327\\244\\327\\251 \\327\\224\\327\\247\\327\\225\\327\\223\\327\\235\\0\"\\\n  \"\\327\\227\\327\\244\\327\\251:\\0\"\\\n  \"\\327\\224\\327\\252\\327\\220\\327\\235 \\327\\234\\327\\252\\327\\225\\327\\233\\327\\237\\tCtrl+3\\0\"\\\n  \"\\327\\224\\327\\252\\327\\220\\327\\235 \\327\\234\\327\\242\\327\\236\\327\\225\\327\\223\\tCtrl+0\\0\"\\\n  \"\\327\\224\\327\\252\\327\\220\\327\\235 \\327\\234\\327\\250\\327\\225\\327\\227\\327\\221\\tCtrl+2\\0\"\\\n  \"\\327\\224\\327\\252\\327\\220\\327\\235 \\327\\234\\327\\252\\327\\225\\327\\233\\327\\237\\0\"\\\n  \"\\327\\224\\327\\252\\327\\220\\327\\235 \\327\\234\\327\\242\\327\\236\\327\\225\\327\\223\\0\"\\\n  \"\\327\\224\\327\\252\\327\\220\\327\\235 \\327\\234\\327\\250\\327\\225\\327\\227\\327\\221\\0\"\\\n  \"\\327\\224\\327\\252\\327\\220\\327\\235 \\327\\234\\327\\250\\327\\225\\327\\227\\327\\221 \\327\\225\\327\\224\\327\\246\\327\\222 \\327\\242\\327\\236\\327\\225\\327\\223\\327\\231\\327\\235 \\327\\221\\327\\250\\327\\246\\327\\231\\327\\244\\327\\225\\327\\252\\0\"\\\n  \"\\327\\224\\327\\252\\327\\220\\327\\235 \\327\\234\\327\\242\\327\\236\\327\\225\\327\\223 \\327\\231\\327\\227\\327\\231\\327\\223\\0\"\\\n  \"\\327\\222\\327\\225\\327\\244\\327\\240\\327\\231\\327\\235:\\0\"\\\n  \"\\327\\236\\327\\242\\327\\246\\327\\221 \\327\\220\\327\\252 \\327\\224\\327\\241\\327\\244\\327\\250... %d \\327\\242\\327\\236\\327\\225\\327\\223\\327\\231\\327\\235\\0\"\\\n  \"\\327\\224\\327\\230\\327\\247\\327\\241\\327\\230 \\327\\240\\327\\236\\327\\246\\327\\220 \\327\\221\\327\\242\\327\\236\\327\\225\\327\\223 %s\\0\"\\\n  \"\\327\\224\\327\\230\\327\\247\\327\\241\\327\\230 \\327\\240\\327\\236\\327\\246\\327\\220 \\327\\221\\327\\242\\327\\236\\327\\225\\327\\223 %s (\\327\\251\\327\\225\\327\\221)\\0\"\\\n  \"\\327\\240\\327\\247\\327\\250\\327\\220 \\327\\252\\327\\233\\327\\225\\327\\244\\327\\225\\327\\252\\0\"\\\n  \"\\0\"\\\n  \"\\327\\242\\327\\221\\327\\225\\327\\250 \\327\\234\\327\\242\\327\\236\\327\\225\\327\\223\\0\"\\\n  \"\\327\\224\\327\\241\\327\\252\\327\\250 '\\327\\240\\327\\247\\327\\250\\327\\220 \\327\\252\\327\\233\\327\\225\\327\\244\\327\\225\\327\\252'\\0\"\\\n  \"\\327\\234\\327\\227\\327\\231\\327\\244\\327\\225\\327\\251 \\327\\224\\327\\236\\327\\225\\327\\244\\327\\242 \\327\\224\\327\\221\\327\\220, \\327\\234\\327\\227\\327\\245 \\327\\242\\327\\234 F3\\0\"\\\n  \"\\327\\247\\327\\225\\327\\221\\327\\246\\327\\231 \\327\\252\\327\\236\\327\\225\\327\\240\\327\\224 (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"\\327\\224\\327\\220\\327\\235 \\327\\221\\327\\250\\327\\246\\327\\225\\327\\240\\327\\232 \\327\\234\\327\\224\\327\\222\\327\\223\\327\\231\\327\\250 \\327\\220\\327\\252 SumatraPDF\\n \\327\\233\\327\\252\\327\\225\\327\\233\\327\\240\\327\\252 \\327\\221\\327\\250\\327\\231\\327\\250\\327\\252 \\327\\236\\327\\227\\327\\223\\327\\234 \\327\\234\\327\\247\\327\\225\\327\\221\\327\\246\\327\\231 PDF?\\0\"\\\n  \"\\327\\224\\327\\222\\327\\223\\327\\250 \\327\\220\\327\\252 SumatraPDF \\327\\233\\327\\252\\327\\225\\327\\233\\327\\240\\327\\252 \\327\\221\\327\\250\\327\\231\\327\\250\\327\\252 \\327\\236\\327\\227\\327\\223\\327\\234 \\327\\234\\327\\247\\327\\225\\327\\221\\327\\246\\327\\231 PDF\\0\"\\\n  \"\\327\\236\\327\\246\\327\\221 Manga\\0\"\\\n  \"\\327\\224\\327\\221\\327\\227\\327\\237 \\327\\221\\327\\231\\327\\237 \\327\\220\\327\\225\\327\\252\\327\\231\\327\\225\\327\\252 \\327\\222\\327\\223\\327\\225\\327\\234\\327\\225\\327\\252 \\327\\234\\327\\247\\327\\230\\327\\240\\327\\225\\327\\252\\0\"\\\n  \"\\327\\247\\327\\225\\327\\221\\327\\246\\327\\231 Mobi\\0\"\\\n  \"\\327\\251\\327\\225\\327\\240\\327\\224:\\0\"\\\n  \"\\327\\222\\327\\250\\327\\241\\327\\224 \\327\\227\\327\\223\\327\\251\\327\\224 (%s) \\327\\226\\327\\236\\327\\231\\327\\240\\327\\224. \\327\\221\\327\\250\\327\\246\\327\\225\\327\\240\\327\\232 \\327\\234\\327\\224\\327\\225\\327\\250\\327\\231\\327\\223\\327\\224?\\0\"\\\n  \"\\327\\242\\327\\236\\327\\225\\327\\223 \\327\\224\\327\\221\\327\\220\\0\"\\\n  \"\\327\\234\\327\\220 \\327\\240\\327\\236\\327\\246\\327\\220\\327\\225 \\327\\224\\327\\252\\327\\220\\327\\236\\327\\225\\327\\252\\0\"\\\n  \"\\327\\234\\327\\220 \\327\\240\\327\\236\\327\\246\\327\\220\\327\\224 \\327\\252\\327\\225\\327\\246\\327\\220\\327\\224 \\327\\221\\327\\236\\327\\252\\327\\227\\327\\235 \\327\\251\\327\\225\\327\\250\\327\\224 %u \\327\\221\\327\\247\\327\\225\\327\\221\\327\\245 %s\\0\"\\\n  \"\\327\\234\\327\\220 \\327\\240\\327\\236\\327\\246\\327\\220 \\327\\247\\327\\225\\327\\221\\327\\245 \\327\\241\\327\\240\\327\\233\\327\\250\\327\\225\\327\\237.\\0\"\\\n  \"\\327\\234\\327\\220 \\327\\240\\327\\236\\327\\246\\327\\220 \\327\\236\\327\\231\\327\\223\\327\\242 \\327\\241\\327\\240\\327\\233\\327\\250\\327\\225\\327\\237 \\327\\221\\327\\236\\327\\231\\327\\247\\327\\225\\327\\235 \\327\\226\\327\\224.\\0\"\\\n  \"\\327\\236\\327\\241\\327\\244\\327\\250 \\327\\242\\327\\236\\327\\225\\327\\223\\327\\231\\327\\235:\\0\"\\\n  \"\\327\\220\\327\\231\\327\\251\\327\\225\\327\\250\\0\"\\\n  \"\\327\\244\\327\\252\\327\\227\\0\"\\\n  \"\\327\\244\\327\\252\\327\\227 \\327\\221- PDF-XChange\\0\"\\\n  \"\\327\\244\\327\\252\\327\\227 \\327\\247\\327\\225\\327\\221\\327\\245...\\0\"\\\n  \"\\327\\244\\327\\252\\327\\227 \\327\\221- %s\\0\"\\\n  \"\\327\\244\\327\\252\\327\\227 \\327\\221- Adobe Reader\\0\"\\\n  \"\\327\\244\\327\\252\\327\\227 \\327\\221- Foxit Reader\\0\"\\\n  \"\\327\\244\\327\\252\\327\\227 \\327\\221- Microsoft HTML Help\\0\"\\\n  \"\\327\\244\\327\\252\\327\\227 \\327\\221- Microsoft XPS-Viewer\\0\"\\\n  \"\\327\\236\\327\\220\\327\\244\\327\\231\\327\\231\\327\\240\\327\\231\\327\\235\\0\"\\\n  \"\\327\\236\\327\\220\\327\\244\\327\\231\\327\\231\\327\\240\\327\\231\\327\\235...\\tCtrl+D\\0\"\\\n  \"\\327\\247\\327\\225\\327\\221\\327\\245 PDF\\0\"\\\n  \"\\327\\220\\327\\225\\327\\244\\327\\230\\327\\231\\327\\236\\327\\231\\327\\226\\327\\246\\327\\231\\327\\225\\327\\252 PDF:\\0\"\\\n  \"\\327\\236\\327\\244\\327\\231\\327\\247 PDF:\\0\"\\\n  \"\\327\\222\\327\\250\\327\\241\\327\\252 PDF:\\0\"\\\n  \"\\327\\247\\327\\225\\327\\221\\327\\246\\327\\231 PDF\\0\"\\\n  \"\\327\\242\\327\\236\\327\\225\\327\\223...\\tCtrl+G\\0\"\\\n  \"\\327\\242\\327\\236\\327\\225\\327\\223 %s\\0\"\\\n  \"\\327\\222\\327\\225\\327\\223\\327\\234 \\327\\242\\327\\236\\327\\225\\327\\223:\\0\"\\\n  \"\\327\\242\\327\\236\\327\\225\\327\\223 \\327\\236\\327\\241' %u \\327\\234\\327\\220 \\327\\247\\327\\231\\327\\231\\327\\235\\0\"\\\n  \"\\327\\236\\327\\252\\327\\231\\327\\227\\327\\252 \\327\\242\\327\\236\\327\\225\\327\\223\\327\\231\\327\\235\\0\"\\\n  \"\\327\\242\\327\\236\\327\\225\\327\\223:\\0\"\\\n  \"\\327\\247\\327\\225\\327\\221\\327\\246\\327\\231 PalmDoc\\0\"\\\n  \"\\327\\220\\327\\240\\327\\220 \\327\\224\\327\\236\\327\\252\\327\\237 \\342\\200\\223 \\327\\236\\327\\221\\327\\246\\327\\242...\\0\"\\\n  \"\\327\\247\\327\\225\\327\\221\\327\\246\\327\\231 Postscript\\0\"\\\n  \"\\327\\236\\327\\246\\327\\222\\327\\252\\tCtrl+L\\0\"\\\n  \"\\327\\242\\327\\236\\327\\225\\327\\223 \\327\\247\\327\\225\\327\\223\\327\\235\\0\"\\\n  \"\\327\\224\\327\\223\\327\\244\\327\\241\\0\"\\\n  \"\\327\\230\\327\\225\\327\\225\\327\\227 \\327\\224\\327\\223\\327\\244\\327\\241\\327\\224\\0\"\\\n  \"\\327\\234\\327\\220 \\327\\226\\327\\225\\327\\224\\327\\252\\327\\224 \\327\\236\\327\\223\\327\\244\\327\\241\\327\\252 \\327\\221\\327\\251\\327\\235 \\327\\251\\327\\246\\327\\225\\327\\231\\327\\237.\\0\"\\\n  \"\\327\\224\\327\\223\\327\\244\\327\\241\\327\\224 \\327\\236\\327\\252\\327\\221\\327\\246\\327\\242\\327\\252.\\0\"\\\n  \"\\327\\252\\327\\224\\327\\234\\327\\231\\327\\232 \\327\\224\\327\\224\\327\\223\\327\\244\\327\\241\\327\\224 \\327\\242\\327\\223\\327\\231\\327\\231\\327\\237 \\327\\234\\327\\220 \\327\\224\\327\\241\\327\\252\\327\\231\\327\\231\\327\\235. \\327\\234\\327\\221\\327\\230\\327\\234 \\327\\225\\327\\234\\327\\246\\327\\220\\327\\252?\\0\"\\\n  \"\\327\\252\\327\\224\\327\\234\\327\\231\\327\\232 \\327\\224\\327\\224\\327\\223\\327\\244\\327\\241\\327\\224 \\327\\242\\327\\223\\327\\231\\327\\231\\327\\237 \\327\\234\\327\\220 \\327\\224\\327\\241\\327\\252\\327\\231\\327\\231\\327\\235. \\327\\234\\327\\221\\327\\230\\327\\234 \\327\\225\\327\\234\\327\\224\\327\\252\\327\\227\\327\\231\\327\\234 \\327\\236\\327\\227\\327\\223\\327\\251?\\0\"\\\n  \"\\327\\236\\327\\223\\327\\244\\327\\231\\327\\241 \\327\\242\\327\\236\\327\\225\\327\\223 %d \\327\\236\\327\\252\\327\\225\\327\\232 %d...\\0\"\\\n  \"\\327\\251\\327\\222\\327\\231\\327\\220\\327\\252 \\327\\224\\327\\223\\327\\244\\327\\241\\327\\224.\\0\"\\\n  \"\\327\\251\\327\\240\\327\\224 \\327\\251\\327\\235...\\tF2\\0\"\\\n  \"\\327\\251\\327\\236\\327\\225\\327\\250 \\327\\250\\327\\251\\327\\231\\327\\236\\327\\252 \\327\\225\\327\\224\\327\\222\\327\\223\\327\\250\\327\\252 \\327\\247\\327\\221\\327\\246\\327\\231\\327\\235 \\327\\251\\327\\240\\327\\244\\327\\252\\327\\227\\327\\225\\0\"\\\n  \"\\327\\224\\327\\241\\327\\250 \\327\\236\\327\\236\\327\\225\\327\\242\\327\\223\\327\\244\\327\\231\\327\\235\\0\"\\\n  \"\\327\\224\\327\\241\\327\\250 \\327\\220\\327\\252 \\327\\242\\327\\236\\327\\225\\327\\223 \\327\\236\\327\\241' %s \\327\\236\\327\\236\\327\\225\\327\\242\\327\\223\\327\\244\\327\\231\\327\\235\\0\"\\\n  \"\\327\\251\\327\\231\\327\\240\\327\\225\\327\\231 \\327\\251\\327\\235\\0\"\\\n  \"\\327\\241\\327\\225\\327\\221\\327\\221 \\327\\251\\327\\236\\327\\220\\327\\234\\327\\224\\0\"\\\n  \"\\327\\241\\327\\225\\327\\221\\327\\221 \\327\\231\\327\\236\\327\\231\\327\\240\\327\\224\\0\"\\\n  \"\\327\\251\\327\\236\\327\\231\\327\\250\\327\\224 \\327\\221\\327\\251\\327\\235\\0\"\\\n  \"\\327\\251\\327\\236\\327\\225\\327\\250 \\327\\247\\327\\231\\327\\246\\327\\225\\327\\250 \\327\\223\\327\\250\\327\\232...\\tCtrl+Shift+S\\0\"\\\n  \"\\327\\236\\327\\227\\327\\244\\327\\251 %d \\327\\236\\327\\252\\327\\225\\327\\232 %d...\\0\"\\\n  \"\\327\\221\\327\\227\\327\\250 \\327\\224\\327\\233\\327\\234\\0\"\\\n  \"\\327\\221\\327\\227\\327\\250 \\327\\224\\327\\233\\327\\234\\tCtrl+A\\0\"\\\n  \"\\327\\221\\327\\227\\327\\250 \\327\\252\\327\\225\\327\\233\\327\\237 \\327\\221\\327\\220\\327\\236\\327\\246\\327\\242\\327\\225\\327\\252 Ctrl + \\327\\234\\327\\227\\327\\246\\327\\237 \\327\\242\\327\\233\\327\\221\\327\\250 \\327\\251\\327\\236\\327\\220\\327\\234\\327\\231\\0\"\\\n  \"\\327\\221\\327\\227\\327\\231\\327\\250\\327\\224:\\0\"\\\n  \"\\327\\251\\327\\234\\327\\227 \\327\\221\\327\\223\\327\\225\\327\\220\\\"\\327\\234...\\0\"\\\n  \"\\327\\224\\327\\222\\327\\223\\327\\250 \\327\\244\\327\\247\\327\\225\\327\\223\\327\\252 \\327\\251\\327\\225\\327\\250\\327\\224 \\327\\234\\327\\227\\327\\231\\327\\244\\327\\225\\327\\251 \\327\\224\\327\\244\\327\\225\\327\\232\\0\"\\\n  \"\\327\\224\\327\\246\\327\\222 \\327\\241\\327\\231\\327\\236\\327\\240\\327\\231\\327\\225\\327\\252\\0\"\\\n  \"\\327\\224\\327\\246\\327\\222 \\327\\242\\327\\236\\327\\225\\327\\223\\327\\231\\327\\235 \\327\\221\\327\\250\\327\\246\\327\\231\\327\\244\\327\\225\\327\\252\\0\"\\\n  \"\\327\\224\\327\\246\\327\\222 \\327\\241\\327\\250\\327\\222\\327\\234 \\327\\233\\327\\234\\327\\231\\327\\235\\0\"\\\n  \"\\327\\224\\327\\246\\327\\222 \\327\\236\\327\\225\\327\\242\\327\\223\\327\\244\\327\\231\\327\\235\\0\"\\\n  \"\\327\\224\\327\\246\\327\\222 '\\327\\240\\327\\247\\327\\250\\327\\220 \\327\\252\\327\\233\\327\\225\\327\\244\\327\\225\\327\\252'\\0\"\\\n  \"\\327\\224\\327\\246\\327\\222 \\327\\241\\327\\250\\327\\222\\327\\234-\\327\\246\\327\\223 \\327\\241\\327\\231\\327\\236\\327\\240\\327\\231\\327\\225\\327\\252 (\\327\\233\\327\\220\\327\\251\\327\\250 \\327\\226\\327\\236\\327\\231\\327\\237)\\0\"\\\n  \"\\327\\242\\327\\236\\327\\225\\327\\223 \\327\\231\\327\\227\\327\\231\\327\\223\\0\"\\\n  \"\\327\\236\\327\\246\\327\\230\\327\\242\\327\\250\\327\\231\\327\\235 \\327\\242\\327\\234 \\327\\224\\327\\252\\327\\247\\327\\234\\327\\224!\\n\\n\\327\\220\\327\\240\\327\\220 \\327\\234\\327\\227\\327\\245 \\327\\242\\327\\234 '\\327\\221\\327\\231\\327\\230\\327\\225\\327\\234' \\327\\220\\327\\235 \\327\\221\\327\\250\\327\\246\\327\\225\\327\\240\\327\\232 \\327\\234\\327\\241\\327\\231\\327\\231\\327\\242 \\327\\234\\327\\240\\327\\225 \\327\\221\\327\\244\\327\\252\\327\\250\\327\\225\\327\\237 \\327\\224\\327\\221\\327\\242\\327\\231\\327\\224.\\0\"\\\n  \"\\327\\240\\327\\247\\327\\225\\327\\223\\327\\252 \\327\\241\\327\\240\\327\\233\\327\\250\\327\\225\\327\\237 \\327\\234\\327\\247\\327\\225\\327\\221\\327\\245 \\327\\224\\327\\236\\327\\247\\327\\225\\327\\250 %s \\327\\234\\327\\220 \\327\\240\\327\\236\\327\\246\\327\\220\\327\\224.\\0\"\\\n  \"\\327\\240\\327\\225\\327\\251\\327\\220:\\0\"\\\n  \"\\327\\224\\327\\222\\327\\223\\327\\250\\327\\225\\327\\252 SumatraPDF\\0\"\\\n  \"\\327\\242\\327\\223\\327\\233\\327\\225\\327\\237 SumatraPDF\\0\"\\\n  \"\\327\\224\\327\\252\\327\\225\\327\\233\\327\\240\\327\\224 SumatraPDF \\327\\247\\327\\250\\327\\241\\327\\224.\\0\"\\\n  \"SumatraPDF \\327\\236\\327\\225\\327\\222\\327\\223\\327\\250\\327\\252 \\327\\233\\327\\252\\327\\225\\327\\233\\327\\240\\327\\252 \\327\\221\\327\\250\\327\\231\\327\\250\\327\\252 \\327\\236\\327\\227\\327\\223\\327\\234 \\327\\234- PDF\\0\"\\\n  \"SumatraPDF \\327\\220\\327\\236\\327\\225\\327\\250\\327\\224 \\327\\234\\327\\224\\327\\231\\327\\225\\327\\252 \\327\\242\\327\\233\\327\\251\\327\\231\\327\\225 \\327\\252\\327\\225\\327\\233\\327\\240\\327\\252 \\327\\221\\327\\250\\327\\231\\327\\250\\327\\252 \\327\\236\\327\\227\\327\\223\\327\\234 \\327\\234- PDF.\\0\"\\\n  \"\\327\\244\\327\\252\\327\\231\\327\\227\\327\\252 \\327\\247\\327\\225\\327\\221\\327\\245 \\327\\241\\327\\240\\327\\233\\327\\250\\327\\225\\327\\237 \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\236\\327\\252\\327\\225\\327\\231\\327\\231\\327\\222 \\327\\233- PDF\\0\"\\\n  \"\\327\\247\\327\\225\\327\\221\\327\\246\\327\\231 \\327\\230\\327\\247\\327\\241\\327\\230\\0\"\\\n  \"\\327\\247\\327\\225\\327\\221\\327\\245 \\327\\226\\327\\224 \\327\\233\\327\\225\\327\\234\\327\\234 \\327\\236\\327\\220\\327\\244\\327\\231\\327\\231\\327\\240\\327\\231\\327\\235 \\327\\251\\327\\220\\327\\231\\327\\240\\327\\235 \\327\\240\\327\\252\\327\\236\\327\\233\\327\\231\\327\\235 (%s), \\327\\225\\327\\231\\327\\231\\327\\252\\327\\233\\327\\237 \\327\\251\\327\\234\\327\\220 \\327\\231\\327\\225\\327\\246\\327\\222 \\327\\233\\327\\250\\327\\220\\327\\225\\327\\231.\\0\"\\\n  \"\\327\\233\\327\\225\\327\\252\\327\\250\\327\\252:\\0\"\\\n  \"\\327\\247\\327\\225\\327\\221\\327\\245 \\327\\236\\327\\247\\327\\225\\327\\250 \\327\\234\\327\\220 \\327\\231\\327\\223\\327\\225\\327\\242 (%s)\\0\"\\\n  \"\\327\\224\\327\\251\\327\\252\\327\\236\\327\\251 \\327\\221\\327\\234\\327\\251\\327\\225\\327\\240\\327\\231\\327\\225\\327\\252\\0\"\\\n  \"\\327\\252\\327\\246\\327\\225\\327\\222\\327\\224\\0\"\\\n  \"\\327\\221\\327\\247\\327\\250 \\327\\221\\327\\220\\327\\252\\327\\250...\\0\"\\\n  \"\\327\\220\\327\\226\\327\\224\\327\\250\\327\\224\\0\"\\\n  \"\\327\\247\\327\\225\\327\\221\\327\\246\\327\\231 XPS\\0\"\\\n  \"\\327\\221\\327\\250\\327\\251\\327\\225\\327\\252\\327\\232 \\327\\224\\327\\222\\327\\250\\327\\241\\327\\224 \\327\\224\\327\\220\\327\\227\\327\\250\\327\\225\\327\\240\\327\\224.\\0\"\\\n  \"\\327\\224\\327\\222\\327\\250\\327\\241\\327\\224 \\327\\251\\327\\221\\327\\250\\327\\251\\327\\225\\327\\252\\327\\232: %s.\\0\"\\\n  \"\\327\\226\\327\\225\\327\\235\\0\"\\\n  \"\\327\\224\\327\\222\\327\\223\\327\\234 \\327\\252\\327\\246\\327\\225\\327\\222\\327\\224\\0\"\\\n  \"\\327\\224\\327\\247\\327\\230\\327\\237 \\327\\252\\327\\246\\327\\225\\327\\222\\327\\224\\0\"\\\n  \"\\327\\236\\327\\247\\327\\223\\327\\235 \\327\\226\\327\\225\\327\\235\\0\"\\\n  \"[\\327\\226\\327\\225\\327\\224\\327\\225 \\327\\251\\327\\231\\327\\240\\327\\225\\327\\231\\327\\231\\327\\235; \\327\\236\\327\\250\\327\\242\\327\\240\\327\\237] %s\\0\"\\\n  \"\\327\\236\\327\\242\\327\\252\\327\\231\\327\\247 \\327\\230\\327\\247\\327\\241\\327\\230\\0\"\\\n  \"\\327\\236\\327\\223\\327\\244\\327\\231\\327\\241 \\327\\247\\327\\225\\327\\221\\327\\245.\\0\";\n\nconst char * gTranslations_hi = \n  \"\\340\\244\\254\\340\\244\\276\\340\\244\\260\\340\\245\\207 \\340\\244\\256\\340\\245\\207\\340\\244\\202(&A)\\0\"\\\n  \"\\340\\244\\265\\340\\244\\276\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\265\\340\\244\\277\\340\\244\\225 \\340\\244\\206\\340\\244\\225\\340\\244\\276\\340\\244\\260(&A)\\tCtrl+1\\0\"\\\n  \"\\0\"\\\n  \"&\\340\\244\\270\\340\\244\\255\\340\\245\\200 \\340\\244\\232\\340\\244\\257\\340\\244\\250\\340\\244\\277\\340\\244\\244 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\340\\245\\213\\340\\244\\202\\0\"\\\n  \"&\\340\\244\\265\\340\\244\\276\\340\\244\\252\\340\\244\\270\\t Alt+\\340\\244\\254\\340\\244\\276\\340\\244\\257\\340\\244\\276\\340\\244\\201 \\340\\244\\244\\340\\245\\200\\340\\244\\260\\0\"\\\n  \"&\\340\\244\\252\\340\\245\\201\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\225 \\340\\244\\225\\340\\245\\207 \\340\\244\\260\\340\\245\\201\\340\\244\\252 \\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\246\\340\\245\\207\\340\\244\\226\\340\\245\\207\\340\\244\\202\\tCtrl+8\\0\"\\\n  \"\\340\\244\\254\\340\\244\\202\\340\\244\\246 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202(&C)\\tCtrl+W\\0\"\\\n  \"\\340\\244\\232&\\340\\244\\257\\340\\244\\250\\340\\244\\277\\340\\244\\244 \\340\\244\\225\\340\\244\\276 \\340\\244\\250\\340\\244\\225\\340\\244\\274\\340\\244\\262 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\232&\\340\\244\\257\\340\\244\\250\\340\\244\\277\\340\\244\\244 \\340\\244\\225\\340\\244\\276 \\340\\244\\250\\340\\244\\225\\340\\244\\274\\340\\244\\262 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202\\tCtrl+C\\0\"\\\n  \"\\340\\244\\253\\340\\244\\277\\340\\244\\260 \\340\\244\\256\\340\\244\\244 \\340\\244\\252\\340\\245\\202\\340\\244\\233\\340\\244\\277\\340\\244\\217\\0\"\\\n  \"&\\340\\244\\270\\340\\244\\256 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\225\\340\\245\\207\\340\\244\\265\\340\\244\\262\\342\\200\\213\\0\"\\\n  \"&\\340\\244\\270\\340\\244\\256\\340\\244\\244\\340\\244\\262 \\340\\244\\225\\340\\244\\260\\340\\244\\250\\340\\244\\276\\tCtrl+7\\0\"\\\n  \"\\340\\244\\253\\340\\244\\276\\340\\244\\210\\340\\244\\262(&F)\\0\"\\\n  \"\\340\\244\\225\\340\\245\\215\\340\\244\\257\\340\\244\\276 \\340\\244\\242\\340\\245\\202\\340\\244\\201\\340\\244\\242\\340\\244\\274\\340\\245\\207\\340\\244\\202:(&F)\\0\"\\\n  \"\\340\\244\\252\\340\\244\\271\\340\\244\\262\\340\\245\\207 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\252\\340\\244\\260\\tHome\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\340\\245\\213\\340\\244\\202 \\340\\244\\225\\340\\245\\213 &\\340\\244\\233\\340\\244\\276\\340\\244\\252\\340\\244\\250\\340\\245\\207 \\340\\244\\257\\340\\245\\213\\340\\244\\227\\340\\245\\215\\340\\244\\257 \\340\\244\\225\\340\\245\\215\\340\\244\\267\\340\\245\\207\\340\\244\\244\\340\\245\\215\\340\\244\\260 \\340\\244\\225\\340\\245\\207 \\340\\244\\262\\340\\244\\277\\340\\244\\217 \\340\\244\\211\\340\\244\\252\\340\\244\\257\\340\\245\\201\\340\\244\\225\\340\\245\\215\\340\\244\\244 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\234\\340\\244\\276\\340\\244\\217(&G)\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\252\\340\\244\\260 \\340\\244\\234\\340\\244\\276\\340\\244\\257\\340\\245\\207\\340\\244\\202 (&G)\\0\"\\\n  \"\\340\\244\\270\\340\\244\\271\\340\\244\\276\\340\\244\\257\\340\\244\\244\\340\\244\\276(&H)\\0\"\\\n  \"\\340\\244\\205\\340\\244\\250\\340\\245\\215\\340\\244\\244\\340\\244\\277\\340\\244\\256 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\252\\340\\244\\260\\tHome\\0\"\\\n  \"&\\340\\244\\254\\340\\244\\231\\340\\244\\276 \\340\\244\\225\\340\\244\\260\\340\\244\\250\\340\\244\\276:\\0\"\\\n  \"\\340\\244\\250\\340\\244\\277\\340\\244\\257\\340\\244\\256-\\340\\244\\252\\340\\245\\201\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\225(&M)\\0\"\\\n  \"\\340\\244\\225\\340\\245\\207\\340\\244\\270 \\340\\244\\256\\340\\244\\277\\340\\244\\262\\340\\244\\276\\340\\244\\217\\340\\244\\201(&M)\\0\"\\\n  \"\\340\\244\\205\\340\\244\\227\\340\\244\\262\\340\\245\\207 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\252\\340\\244\\260\\t->\\0\"\\\n  \"\\340\\244\\250\\340\\244\\271\\340\\245\\200\\340\\244\\202(&N)\\0\"\\\n  \"\\340\\244\\250\\340\\244\\271\\340\\245\\200\\340\\244\\202, \\340\\244\\247\\340\\244\\250\\340\\245\\215\\340\\244\\257\\340\\244\\265\\340\\244\\276\\340\\244\\246(&N)\\0\"\\\n  \"\\340\\244\\225\\340\\245\\207\\340\\244\\265\\340\\244\\262 &\\340\\244\\265\\340\\244\\277\\340\\244\\267\\340\\244\\256 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\340\\245\\213\\340\\244\\202\\0\"\\\n  \"\\340\\244\\246\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\276\\340\\244\\265\\340\\245\\207\\340\\244\\234\\340\\244\\274 &\\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\253\\340\\244\\276\\340\\244\\210\\340\\244\\262 \\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\207\\340\\244\\202(&O)\\tCtrl+O\\0\"\\\n  \"&\\340\\244\\265\\340\\244\\277\\340\\244\\225\\340\\244\\262\\340\\245\\215\\340\\244\\252\\340\\245\\213\\340\\244\\202...\\0\"\\\n  \"&\\340\\244\\252\\340\\244\\276\\340\\244\\270\\340\\244\\265\\340\\244\\260\\340\\245\\215\\340\\244\\241:\\0\"\\\n  \"\\340\\244\\246\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\276\\340\\244\\265\\340\\245\\207\\340\\244\\234\\340\\244\\274 &\\340\\244\\234\\340\\244\\241\\340\\244\\274\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\252\\340\\244\\277\\340\\244\\233\\340\\244\\262\\340\\245\\207 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\252\\340\\244\\260\\t<-\\0\"\\\n  \"&\\340\\244\\233\\340\\244\\276\\340\\244\\252\\340\\245\\207\\340\\244\\202...\\0\"\\\n  \"\\340\\244\\252\\340\\244\\260\\340\\244\\277\\340\\244\\202\\340\\244\\237 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202(&P)\\tCtrl+P\\0\"\\\n  \"&\\340\\244\\233\\340\\244\\252\\340\\244\\276\\340\\244\\210...(\\340\\244\\205\\340\\244\\270\\340\\245\\215\\340\\244\\265\\340\\245\\200\\340\\244\\225\\340\\245\\203\\340\\244\\244)\\0\"\\\n  \"\\340\\244\\207\\340\\244\\270 \\340\\244\\246\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\276\\340\\244\\265\\340\\245\\207\\340\\244\\234\\340\\244\\274 \\340\\244\\225\\340\\245\\207 \\340\\244\\262\\340\\244\\277\\340\\244\\217 \\340\\244\\252\\340\\244\\276\\340\\244\\270\\340\\244\\265\\340\\244\\260\\340\\245\\215\\340\\244\\241 &\\340\\244\\257\\340\\244\\276\\340\\244\\246 \\340\\244\\260\\340\\244\\226\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\244\\340\\245\\215\\340\\244\\257\\340\\245\\207\\340\\244\\225 \\340\\244\\246\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\276\\340\\244\\265\\340\\245\\207\\340\\244\\234\\340\\244\\274 \\340\\244\\225\\340\\245\\207 \\340\\244\\262\\340\\244\\277\\340\\244\\217 \\340\\244\\207\\340\\244\\250 \\340\\244\\270\\340\\245\\207\\340\\244\\237\\340\\244\\277\\340\\244\\202\\340\\244\\227\\340\\245\\215\\340\\244\\270 \\340\\244\\225\\340\\245\\213 &\\340\\244\\257\\340\\244\\276\\340\\244\\246 \\340\\244\\260\\340\\244\\226\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\246\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\276\\340\\244\\265\\340\\245\\207\\340\\244\\234\\340\\244\\274 \\340\\244\\225\\340\\245\\213 &\\340\\244\\250\\340\\244\\277\\340\\244\\225\\340\\244\\276\\340\\244\\262\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\270\\340\\244\\271\\340\\245\\207\\340\\244\\234\\340\\245\\207\\340\\244\\202 &\\340\\244\\234\\340\\245\\210\\340\\244\\270\\340\\245\\207...\\0\"\\\n  \"\\340\\244\\207\\340\\244\\270 \\340\\244\\244\\340\\244\\260\\340\\244\\271 \\340\\244\\270\\340\\244\\202\\340\\244\\255\\340\\244\\276\\340\\244\\262\\340\\245\\207\\340\\244\\202(&S)\\tCtrl+S\\0\"\\\n  \"&\\340\\244\\270\\340\\245\\207\\340\\244\\237\\340\\244\\277\\340\\244\\202\\340\\244\\227\\340\\245\\215\\340\\244\\270\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\340\\245\\213\\340\\244\\202 \\340\\244\\225\\340\\245\\213 \\340\\244\\233\\340\\244\\252\\340\\244\\276\\340\\244\\210 \\340\\244\\257\\340\\245\\213\\340\\244\\227\\340\\245\\215\\340\\244\\257 \\340\\244\\225\\340\\245\\215\\340\\244\\267\\340\\245\\207\\340\\244\\244\\340\\245\\215\\340\\244\\260 &\\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\270\\340\\244\\277\\340\\244\\225\\340\\245\\213\\340\\244\\241\\340\\244\\274\\340\\245\\207\\340\\244\\202 (\\340\\244\\257\\340\\244\\246\\340\\244\\277 \\340\\244\\206\\340\\244\\265\\340\\244\\266\\340\\245\\215\\340\\244\\257\\340\\244\\225 \\340\\244\\271\\340\\245\\213)\\0\"\\\n  \"&\\340\\244\\217\\340\\244\\225\\340\\244\\262 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\tCtrl+6\\0\"\\\n  \"\\340\\244\\207\\340\\244\\270 \\340\\244\\270\\340\\244\\202\\340\\244\\270\\340\\244\\225\\340\\244\\260\\340\\244\\243 \\340\\244\\225\\340\\245\\213 \\340\\244\\233\\340\\245\\213\\340\\244\\241\\340\\245\\213\\0\"\\\n  \"\\340\\244\\265\\340\\244\\276\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\265\\340\\244\\277\\340\\244\\225 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\206\\340\\244\\225\\340\\244\\276\\340\\244\\260 \\340\\244\\225\\340\\244\\276 \\340\\244\\211\\340\\244\\252\\340\\244\\257\\340\\245\\213\\340\\244\\227(&U) \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\246\\340\\245\\207\\340\\244\\226\\340\\245\\207\\340\\244\\202(&V)\\0\"\\\n  \"\\0\"\\\n  \"\\340\\244\\271\\340\\244\\276\\340\\244\\202(&Y)\\0\"\\\n  \"&\\340\\244\\254\\340\\244\\241\\340\\244\\276 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"(\\340\\244\\225\\340\\244\\276 %d)\\0\"\\\n  \"(\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 %s)\\0\"\\\n  \"Sumatra PDF \\340\\244\\225\\340\\245\\207 \\340\\244\\254\\340\\244\\276\\340\\244\\260\\340\\245\\207 \\340\\244\\256\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\252\\340\\244\\270\\340\\244\\202\\340\\244\\246\\340\\245\\200\\340\\244\\246\\340\\244\\276 \\340\\244\\270\\340\\245\\202\\340\\244\\232\\340\\244\\277 \\340\\244\\234\\340\\245\\213\\340\\244\\241\\340\\244\\274\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 %s \\340\\244\\225\\340\\245\\213 \\340\\244\\252\\340\\244\\270\\340\\244\\202\\340\\244\\246\\340\\245\\200\\340\\244\\246\\340\\244\\276 \\340\\244\\270\\340\\245\\202\\340\\244\\232\\340\\244\\277 \\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\234\\340\\245\\213\\340\\244\\241\\340\\244\\274\\340\\245\\207\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 %s \\340\\244\\225\\340\\245\\213 \\340\\244\\252\\340\\244\\270\\340\\244\\202\\340\\244\\246\\340\\245\\200\\340\\244\\246\\340\\244\\276 \\340\\244\\270\\340\\245\\202\\340\\244\\232\\340\\244\\277 \\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\250\\340\\244\\276\\340\\244\\256 (\\340\\244\\265\\340\\245\\210\\340\\244\\225\\340\\244\\262\\340\\245\\215\\340\\244\\252\\340\\244\\277\\340\\244\\225) \\340\\244\\225\\340\\245\\207 \\340\\244\\270\\340\\244\\276\\340\\244\\245: \\340\\244\\234\\340\\245\\213\\340\\244\\241\\340\\244\\274\\340\\245\\207\\340\\244\\202:\\0\"\\\n  \"\\340\\244\\252\\340\\244\\270\\340\\244\\202\\340\\244\\246\\340\\245\\200\\340\\244\\246\\340\\244\\276 \\340\\244\\270\\340\\245\\202\\340\\244\\232\\340\\244\\277 \\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\234\\340\\245\\213\\340\\244\\241\\340\\244\\274\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\211\\340\\244\\250\\340\\245\\215\\340\\244\\250\\340\\244\\244\\0\"\\\n  \"\\340\\244\\270\\340\\244\\255\\340\\245\\200 \\340\\244\\253\\340\\244\\276\\340\\244\\207\\340\\244\\262\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\270\\340\\244\\255\\340\\245\\200 \\340\\244\\270\\340\\244\\256\\340\\244\\260\\340\\245\\215\\340\\244\\245\\340\\244\\277\\340\\244\\244 \\340\\244\\246\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\276\\340\\244\\265\\340\\245\\207\\340\\244\\234\\340\\244\\274\\0\"\\\n  \"\\340\\244\\206\\340\\244\\265\\340\\245\\207\\340\\244\\246\\340\\244\\250:\\0\"\\\n  \"PDF \\340\\244\\253\\340\\244\\276\\340\\244\\210\\340\\244\\262\\340\\245\\213\\340\\244\\202 \\340\\244\\270\\340\\245\\207 \\340\\244\\270\\340\\244\\202\\340\\244\\254\\340\\244\\202\\340\\244\\247 \\340\\244\\254\\340\\244\\250\\340\\244\\276\\340\\244\\207\\340\\244\\217?\\0\"\\\n  \"\\340\\244\\270\\340\\244\\202\\340\\244\\262\\340\\244\\276\\340\\244\\250\\340\\245\\215\\340\\244\\227\\340\\244\\277\\340\\244\\244 : %s\\0\"\\\n  \"\\340\\244\\262\\340\\245\\207\\340\\244\\226\\340\\244\\225:\\0\"\\\n  \"\\340\\244\\270\\340\\245\\215\\340\\244\\265\\340\\244\\232\\340\\244\\276\\340\\244\\262\\340\\244\\277\\340\\244\\244\\0\"\\\n  \"\\340\\244\\270\\340\\245\\215\\340\\244\\265\\340\\244\\232\\340\\244\\276\\340\\244\\262\\340\\244\\277\\340\\244\\244 \\340\\244\\260\\340\\245\\202\\340\\244\\252 \\340\\244\\270\\340\\245\\207 &\\340\\244\\250\\340\\244\\265\\340\\245\\200\\340\\244\\250\\340\\244\\244\\340\\244\\256 \\340\\244\\225\\340\\245\\207 \\340\\244\\262\\340\\244\\277\\340\\244\\217 \\340\\244\\234\\340\\244\\276\\340\\244\\201\\340\\244\\232\\0\"\\\n  \"\\340\\244\\252\\340\\245\\201\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\225 \\340\\244\\246\\340\\245\\203\\340\\244\\266\\340\\245\\215\\340\\244\\257\\0\"\\\n  \"\\340\\244\\270\\340\\244\\202\\340\\244\\255\\340\\244\\276\\340\\244\\262\\340\\245\\207 \\340\\244\\271\\340\\245\\201\\340\\244\\217 \\340\\244\\232\\340\\244\\277\\340\\244\\271\\340\\245\\215\\340\\244\\250\\tF12\\0\"\\\n  \"\\340\\244\\232\\340\\244\\277\\340\\244\\250\\340\\245\\215\\340\\244\\271\\340\\244\\277\\340\\244\\244 \\340\\244\\205\\340\\244\\262\\340\\245\\215\\340\\244\\252 \\340\\244\\244\\340\\244\\260\\340\\245\\200\\340\\244\\225\\340\\244\\276\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 %s \\340\\244\\252\\340\\244\\260 \\340\\244\\254\\340\\245\\201\\340\\244\\225\\340\\244\\256\\340\\244\\276\\340\\244\\260\\340\\245\\215\\340\\244\\225 \\340\\244\\266\\340\\245\\211\\340\\244\\260\\340\\245\\215\\340\\244\\237\\340\\244\\225\\340\\244\\237 %s \\340\\244\\225\\340\\244\\276 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\232\\340\\244\\277\\340\\244\\250\\340\\245\\215\\340\\244\\271\\340\\244\\277\\340\\244\\244\\0\"\\\n  \"\\340\\244\\254\\340\\244\\276\\340\\244\\207\\340\\244\\237\\340\\245\\215\\340\\244\\270\\0\"\\\n  \"CHM \\340\\244\\246\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\276\\340\\244\\265\\340\\245\\207\\340\\244\\234\\340\\245\\213\\340\\244\\202\\0\"\\\n  \"\\340\\244\\207\\340\\244\\202\\340\\244\\237\\340\\244\\260\\340\\244\\250\\340\\245\\207\\340\\244\\237 \\340\\244\\270\\340\\245\\207 \\340\\244\\234\\340\\245\\201\\340\\244\\241\\340\\244\\274\\342\\200\\213 \\340\\244\\250\\340\\244\\271\\340\\245\\200\\340\\244\\202 \\340\\244\\252\\340\\244\\276 \\340\\244\\260\\340\\244\\271\\340\\244\\276 \\340\\244\\271\\340\\245\\210 ( \\340\\244\\227\\340\\244\\274\\340\\244\\262\\340\\244\\244\\340\\245\\200 %#x )\\0\"\\\n  \"\\340\\244\\260\\340\\244\\246\\340\\245\\215\\340\\244\\246 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\207\\340\\244\\270 \\340\\244\\253\\340\\244\\274\\340\\244\\276\\340\\244\\207\\340\\244\\262 \\340\\244\\225\\340\\244\\276 \\340\\244\\233\\340\\244\\252\\340\\244\\276\\340\\244\\210 \\340\\244\\250\\340\\244\\271\\340\\245\\200\\340\\244\\202 \\340\\244\\225\\340\\244\\277\\340\\244\\257\\340\\244\\276 \\340\\244\\234\\340\\244\\276 \\340\\244\\270\\340\\244\\225\\340\\244\\244\\340\\244\\276\\0\"\\\n  \"\\340\\244\\211\\340\\244\\262\\340\\244\\237\\340\\244\\276 \\340\\244\\226\\340\\245\\213\\340\\244\\234 \\340\\244\\225\\340\\244\\256\\340\\244\\276\\340\\244\\202\\340\\244\\241 \\340\\244\\266\\340\\245\\201\\340\\244\\260\\340\\245\\202 \\340\\244\\271\\340\\245\\213 \\340\\244\\252\\340\\244\\276 \\340\\244\\260\\340\\244\\271\\340\\244\\276 \\340\\245\\244 \\340\\244\\225\\340\\245\\203\\340\\244\\252\\340\\244\\257\\340\\244\\276 \\340\\244\\270\\340\\245\\207\\340\\244\\237\\340\\244\\277\\340\\244\\202\\340\\244\\227\\340\\245\\215\\340\\244\\270 \\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\225\\340\\244\\256\\340\\244\\276\\340\\244\\202\\340\\244\\241 \\340\\244\\262\\340\\244\\276\\340\\244\\207\\340\\244\\250 \\340\\244\\225\\340\\245\\200 \\340\\244\\234\\340\\244\\276\\340\\244\\201\\340\\244\\232 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202 \\340\\245\\244\\0\"\\\n  \"\\340\\244\\255\\340\\244\\276\\340\\244\\267\\340\\244\\276 \\340\\244\\254\\340\\244\\246\\340\\244\\262\\340\\245\\207\\340\\244\\202 (Change Language)\\0\"\\\n  \"\\340\\244\\250\\340\\244\\217 \\340\\244\\270\\340\\244\\202\\340\\244\\270\\340\\244\\225\\340\\244\\260\\340\\244\\243 \\340\\244\\225\\340\\245\\207 \\340\\244\\262\\340\\244\\277\\340\\244\\217 \\340\\244\\234\\340\\244\\276\\340\\244\\202\\340\\244\\232 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202(&C)\\0\"\\\n  \"\\340\\244\\271\\340\\244\\276\\340\\244\\270\\340\\245\\215\\340\\244\\257 \\340\\244\\225\\340\\244\\277\\340\\244\\244\\340\\244\\276\\340\\244\\254\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\205\\340\\244\\250\\340\\245\\201\\340\\244\\225\\340\\245\\202\\340\\244\\262\\0\"\\\n  \"\\340\\244\\250\\340\\244\\277\\340\\244\\260\\340\\244\\250\\340\\245\\215\\340\\244\\244\\340\\244\\260\\0\"\\\n  \"\\340\\244\\250\\340\\244\\277\\340\\244\\260\\340\\244\\202\\340\\244\\244\\340\\244\\260\\340\\244\\277\\340\\244\\244 \\340\\244\\252\\340\\245\\201\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\225 \\340\\244\\246\\340\\245\\203\\340\\244\\266\\340\\245\\215\\340\\244\\257\\0\"\\\n  \"\\340\\244\\250\\340\\244\\277\\340\\244\\260\\340\\244\\250\\340\\245\\215\\340\\244\\244\\340\\244\\260 \\340\\244\\252\\340\\245\\201\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\225\\0\"\\\n  \"\\340\\244\\205\\340\\244\\250\\340\\245\\201\\340\\244\\265\\340\\244\\276\\340\\244\\246 \\340\\244\\225\\340\\244\\260\\340\\244\\250\\340\\245\\207 \\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\256\\340\\244\\246\\340\\244\\246 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"&\\340\\244\\233\\340\\244\\265\\340\\244\\277 \\340\\244\\250\\340\\244\\225\\340\\244\\274\\340\\244\\262 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"&\\340\\244\\262\\340\\244\\277\\340\\244\\202\\340\\244\\225 \\340\\244\\252\\340\\244\\244\\340\\244\\276 \\340\\244\\250\\340\\244\\225\\340\\244\\274\\340\\244\\262 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"&\\340\\244\\237\\340\\244\\277\\340\\244\\252\\340\\245\\215\\340\\244\\252\\340\\244\\243\\340\\245\\200 \\340\\244\\250\\340\\244\\225\\340\\244\\274\\340\\244\\262 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\237\\340\\245\\207\\340\\244\\225\\340\\245\\215\\340\\244\\270\\340\\245\\215\\340\\244\\237 \\340\\244\\225\\340\\244\\277 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\244\\340\\244\\277\\340\\244\\257\\340\\244\\276\\340\\244\\202 \\340\\244\\254\\340\\244\\250\\340\\244\\276\\340\\244\\250\\340\\245\\207 \\340\\244\\270\\340\\245\\207 \\340\\244\\205\\340\\244\\270\\340\\245\\215\\340\\244\\265\\340\\245\\200\\340\\244\\225\\340\\245\\203\\340\\244\\244 ( \\340\\244\\225\\340\\245\\207\\340\\244\\265\\340\\244\\262 \\340\\244\\233\\340\\244\\265\\340\\244\\277 \\340\\244\\225\\340\\245\\207 \\340\\244\\260\\340\\245\\202\\340\\244\\252 \\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\244\\340\\244\\277\\340\\244\\262\\340\\244\\277\\340\\244\\252\\340\\244\\277\\340\\244\\225\\340\\244\\260\\340\\244\\243 )\\0\"\\\n  \"\\340\\244\\252\\340\\244\\276\\340\\244\\240\\340\\244\\276\\340\\244\\247\\340\\244\\277\\340\\244\\225\\340\\244\\276\\340\\244\\260\\0\"\\\n  \"\\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\277\\340\\244\\202\\340\\244\\237\\340\\244\\260 \\340\\244\\225\\340\\245\\207 \\340\\244\\227\\340\\245\\201\\340\\244\\243\\340\\245\\213\\340\\244\\202 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\276\\340\\244\\252\\340\\245\\215\\340\\244\\244 \\340\\244\\250\\340\\244\\271\\340\\245\\200\\340\\244\\202 \\340\\244\\225\\340\\244\\260 \\340\\244\\252\\340\\244\\276 \\340\\244\\260\\340\\244\\271\\340\\244\\276\\0\"\\\n  \"\\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\277\\340\\244\\202\\340\\244\\237\\340\\244\\260 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\276\\340\\244\\260\\340\\244\\202\\340\\244\\255 \\340\\244\\250\\340\\244\\271\\340\\245\\200\\340\\244\\202 \\340\\244\\271\\340\\245\\213 \\340\\244\\252\\340\\244\\276 \\340\\244\\260\\340\\244\\271\\340\\244\\276\\0\"\\\n  \"\\340\\244\\252\\340\\245\\207\\340\\244\\234 \\340\\244\\260\\340\\245\\207\\340\\244\\202\\340\\244\\241\\340\\244\\260 \\340\\244\\250\\340\\244\\271\\340\\245\\200\\340\\244\\202 \\340\\244\\225\\340\\244\\260 \\340\\244\\270\\340\\244\\225\\340\\244\\276\\0\"\\\n  \"\\340\\244\\260\\340\\244\\232\\340\\244\\277\\340\\244\\244\\0\"\\\n  \"\\340\\244\\265\\340\\244\\260\\340\\245\\215\\340\\244\\244\\340\\244\\256\\340\\244\\276\\340\\244\\250 \\340\\244\\253\\340\\244\\274\\340\\244\\276\\340\\244\\207\\340\\244\\262\\0\"\\\n  \"\\0\"\\\n  \"\\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\232\\340\\244\\262\\340\\244\\250 \\340\\244\\234\\340\\244\\274\\340\\245\\202\\340\\244\\256 (&Z)...\\tCtrl+Y\\0\"\\\n  \"\\340\\244\\256\\340\\245\\202\\340\\244\\262\\340\\244\\255\\340\\245\\202\\340\\244\\244 \\340\\244\\262\\340\\245\\207\\340\\244\\206\\340\\244\\211\\340\\244\\237 :(&L)\\0\"\\\n  \"\\340\\244\\241\\340\\244\\277\\340\\244\\253\\340\\244\\274\\340\\245\\211\\340\\244\\262\\340\\245\\215\\340\\244\\237 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 &\\340\\244\\206\\340\\244\\225\\340\\244\\276\\340\\244\\260:\\0\"\\\n  \"\\340\\244\\241\\340\\244\\277\\340\\244\\253\\340\\244\\274\\340\\245\\211\\340\\244\\262\\340\\245\\215\\340\\244\\237 \\340\\244\\252\\340\\245\\200\\340\\244\\241\\340\\245\\200\\340\\244\\217\\340\\244\\253 \\340\\244\\260\\340\\245\\200\\340\\244\\241\\340\\244\\260 \\340\\244\\252\\340\\245\\213\\340\\244\\260\\340\\245\\215\\340\\244\\237\\340\\245\\207\\340\\244\\254\\340\\244\\262 \\340\\244\\256\\340\\245\\213\\340\\244\\241 \\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\254\\340\\244\\246\\340\\244\\262\\340\\244\\276 \\340\\244\\250\\340\\244\\271\\340\\245\\200\\340\\244\\202 \\340\\244\\234\\340\\244\\276 \\340\\244\\270\\340\\244\\225\\340\\244\\244\\340\\244\\276\\0\"\\\n  \"\\340\\244\\205\\340\\244\\270\\340\\245\\215\\340\\244\\265\\340\\245\\200\\340\\244\\225\\340\\245\\203\\340\\244\\244 \\340\\244\\205\\340\\244\\250\\340\\245\\201\\340\\244\\256\\340\\244\\244\\340\\244\\277\\340\\244\\257\\340\\244\\276\\340\\244\\201\\0\"\\\n  \"DjVu \\340\\244\\246\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\276\\340\\244\\265\\340\\245\\207\\340\\244\\234\\340\\245\\213\\340\\244\\202\\0\"\\\n  \"\\340\\244\\246\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\276\\340\\244\\265\\340\\245\\207\\340\\244\\234\\340\\244\\274 \\340\\244\\227\\340\\245\\201\\340\\244\\243\\0\"\\\n  \"\\340\\244\\241\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\244\\262\\340\\245\\213\\340\\244\\241\\0\"\\\n  \"\\340\\244\\254\\340\\244\\276\\340\\244\\271\\340\\244\\260 \\340\\244\\250\\340\\244\\277\\340\\244\\225\\340\\244\\262\\340\\245\\207\\340\\244\\202(&x)\\tCtrl+Q\\0\"\\\n  \"EPUB \\340\\244\\210 - \\340\\244\\225\\340\\244\\277\\340\\244\\244\\340\\244\\276\\340\\244\\254\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\252\\340\\244\\271\\340\\244\\232\\340\\244\\276\\340\\244\\250 \\340\\244\\266\\340\\244\\254\\340\\245\\215\\340\\244\\246 \\340\\244\\255\\340\\244\\260\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"%s \\340\\244\\225\\340\\245\\207 \\340\\244\\262\\340\\244\\277\\340\\244\\217 \\340\\244\\252\\340\\244\\271\\340\\244\\232\\340\\244\\276\\340\\244\\250 \\340\\244\\266\\340\\244\\254\\340\\245\\215\\340\\244\\246 \\340\\244\\255\\340\\244\\260\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\252\\340\\245\\200\\340\\244\\241\\340\\245\\200\\340\\244\\217\\340\\244\\253 \\340\\244\\246\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\276\\340\\244\\265\\340\\245\\207\\340\\244\\234\\340\\244\\274 \\340\\244\\252\\340\\244\\260 \\340\\244\\241\\340\\244\\254\\340\\244\\262 \\340\\244\\225\\340\\245\\215\\340\\244\\262\\340\\244\\277\\340\\244\\225 \\340\\244\\270\\340\\245\\207 \\340\\244\\206\\340\\244\\271\\340\\245\\215\\340\\244\\265\\340\\244\\276\\340\\244\\250 \\340\\244\\225\\340\\244\\260\\340\\244\\250\\340\\245\\207 \\340\\244\\225\\340\\245\\207 \\340\\244\\262\\340\\244\\277\\340\\244\\257\\340\\245\\207 \\340\\244\\225\\340\\244\\256\\340\\244\\276\\340\\244\\202\\340\\244\\241 \\340\\244\\262\\340\\244\\276\\340\\244\\207\\340\\244\\250 \\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\265\\340\\245\\207\\340\\244\\266 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202:\\0\"\\\n  \"\\340\\244\\244\\340\\245\\215\\340\\244\\260\\340\\245\\201\\340\\244\\237\\340\\244\\277 \\340\\244\\262\\340\\245\\213\\340\\244\\241 \\340\\244\\271\\340\\245\\213 \\340\\244\\260\\340\\244\\271\\340\\245\\200 \\340\\244\\271\\340\\245\\210 %s\\0\"\\\n  \"&\\340\\244\\252\\340\\244\\270\\340\\244\\202\\340\\244\\246\\340\\245\\200\\340\\244\\246\\340\\244\\276\\0\"\\\n  \"\\340\\244\\205\\340\\244\\227&\\340\\244\\262\\340\\244\\276\\tAlt+\\340\\244\\246\\340\\244\\276\\340\\244\\257\\340\\244\\276\\340\\244\\201 \\340\\244\\244\\340\\245\\200\\340\\244\\260\\0\"\\\n  \"\\340\\244\\252\\340\\245\\202\\340\\244\\260\\340\\244\\276 \\340\\244\\252\\340\\244\\260\\340\\244\\246\\340\\244\\276\\tCtrl+Shift+L\\0\"\\\n  \"\\340\\244\\252\\340\\245\\201\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\225\\0\"\\\n  \"\\340\\244\\253\\340\\244\\274\\340\\244\\276\\340\\244\\207\\340\\244\\262 \\340\\244\\225\\340\\244\\276 \\340\\244\\250\\340\\244\\276\\340\\244\\256 \\340\\244\\254\\340\\244\\246\\340\\244\\262\\340\\244\\250\\340\\245\\207 \\340\\244\\256\\340\\245\\207 \\340\\244\\205\\340\\244\\270\\340\\244\\253\\340\\244\\274\\340\\244\\262\\342\\200\\213 !\\0\"\\\n  \"\\340\\244\\253\\340\\244\\276\\340\\244\\210\\340\\244\\262 \\340\\244\\270\\340\\244\\202\\340\\244\\255\\340\\244\\276\\340\\244\\262\\340\\245\\200 \\340\\244\\250\\340\\244\\271\\340\\245\\200\\340\\244\\202 \\340\\244\\234\\340\\244\\276 \\340\\244\\270\\340\\244\\225\\340\\245\\200\\0\"\\\n  \"\\340\\244\\244\\340\\245\\200\\340\\244\\265\\340\\245\\215\\340\\244\\260 \\340\\244\\265\\340\\245\\207\\340\\244\\254 \\340\\244\\246\\340\\244\\260\\340\\245\\215\\340\\244\\266\\340\\244\\250\\0\"\\\n  \"\\340\\244\\252\\340\\244\\270\\340\\244\\202\\340\\244\\246\\340\\245\\200\\340\\244\\246\\340\\244\\276\\0\"\\\n  \"\\340\\244\\227\\340\\244\\262\\340\\245\\215\\340\\244\\252 \\340\\244\\254\\340\\245\\201\\340\\244\\225 \\340\\244\\246\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\276\\340\\244\\265\\340\\245\\207\\340\\244\\234\\340\\245\\213\\340\\244\\202\\0\"\\\n  \"\\340\\244\\253\\340\\244\\274\\340\\244\\276\\340\\244\\207\\340\\244\\262 %s \\340\\244\\250\\340\\244\\271\\340\\245\\200\\340\\244\\202 \\340\\244\\256\\340\\244\\277\\340\\244\\262\\340\\245\\200\\0\"\\\n  \"\\340\\244\\253\\340\\244\\274\\340\\244\\276\\340\\244\\207\\340\\244\\262 \\340\\244\\225\\340\\244\\276 \\340\\244\\206\\340\\244\\225\\340\\244\\276\\340\\244\\260:\\0\"\\\n  \"\\340\\244\\253\\340\\244\\274\\340\\244\\276\\340\\244\\207\\340\\244\\262:\\0\"\\\n  \"\\340\\244\\226\\340\\245\\213\\340\\244\\234...\\tCtrl+F\\0\"\\\n  \"\\340\\244\\226\\340\\245\\213\\340\\244\\234\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\205\\340\\244\\227\\340\\244\\262\\340\\244\\276 \\340\\244\\226\\340\\245\\213\\340\\244\\234\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\252\\340\\245\\201\\340\\244\\260\\340\\244\\276\\340\\244\\250\\340\\244\\276 \\340\\244\\226\\340\\245\\213\\340\\244\\234\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\226\\340\\245\\213\\340\\244\\234:\\0\"\\\n  \"\\340\\244\\270\\340\\244\\276\\340\\244\\256\\340\\244\\227\\340\\245\\215\\340\\244\\260\\340\\245\\200 \\340\\244\\225\\340\\245\\213 \\340\\244\\253\\340\\244\\274\\340\\244\\277\\340\\244\\237 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202 \\tCtrl+3\\0\"\\\n  \"\\340\\244\\205\\340\\244\\250\\340\\245\\201\\340\\244\\260\\340\\245\\202\\340\\244\\252 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202(&P)\\tCtrl+0\\0\"\\\n  \"\\340\\244\\232\\340\\245\\214\\340\\245\\234\\340\\244\\276\\340\\244\\210 \\340\\244\\225\\340\\245\\207 \\340\\244\\205\\340\\244\\250\\340\\245\\201\\340\\244\\270\\340\\244\\276\\340\\244\\260(&h)\\tCtrl+2\\0\"\\\n  \"\\340\\244\\270\\340\\244\\276\\340\\244\\256\\340\\244\\227\\340\\245\\215\\340\\244\\260\\340\\245\\200 \\340\\244\\225\\340\\245\\213 \\340\\244\\205\\340\\244\\237\\340\\244\\276\\340\\244\\250\\340\\244\\276\\0\"\\\n  \"\\340\\244\\205\\340\\244\\250\\340\\245\\201\\340\\244\\260\\340\\245\\202\\340\\244\\252 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\232\\340\\245\\214\\340\\245\\234\\340\\244\\276\\340\\244\\210 \\340\\244\\225\\340\\245\\207 \\340\\244\\205\\340\\244\\250\\340\\245\\201\\340\\244\\270\\340\\244\\276\\340\\244\\260\\0\"\\\n  \"\\340\\244\\211\\340\\244\\252\\340\\244\\257\\340\\245\\201\\340\\244\\225\\340\\245\\215\\340\\244\\244 \\340\\244\\232\\340\\245\\214\\340\\244\\241\\340\\244\\274\\340\\244\\276\\340\\244\\210 \\340\\244\\225\\340\\245\\207 \\340\\244\\270\\340\\244\\276\\340\\244\\245 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\262\\340\\244\\227\\340\\244\\276\\340\\244\\244\\340\\244\\276\\340\\244\\260 \\340\\244\\246\\340\\244\\277\\340\\244\\226\\340\\244\\276\\340\\244\\217\\340\\244\\201\\0\"\\\n  \"\\340\\244\\217\\340\\244\\225\\340\\244\\262 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\225\\340\\245\\213 \\340\\244\\253\\340\\244\\274\\340\\244\\277\\340\\244\\237 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\205\\340\\244\\225\\340\\245\\215\\340\\244\\267\\340\\244\\260 \\340\\244\\225\\340\\244\\276 \\340\\244\\206\\340\\244\\225\\340\\244\\260\\0\"\\\n  \"\\340\\244\\225\\340\\244\\277\\340\\244\\244\\340\\244\\276\\340\\244\\254 \\340\\244\\270\\340\\245\\215\\340\\244\\265\\340\\244\\260\\340\\245\\202\\340\\244\\252\\340\\244\\277\\340\\244\\244 \\340\\244\\271\\340\\245\\213 \\340\\244\\260\\340\\244\\271\\340\\244\\276... %d \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\0\"\\\n  \"\\340\\244\\237\\340\\245\\207\\340\\244\\225\\340\\245\\215\\340\\244\\270\\340\\245\\215\\340\\244\\237 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 %s \\340\\244\\252\\340\\244\\260 \\340\\244\\252\\340\\244\\276\\340\\244\\257\\340\\244\\276 \\340\\244\\227\\340\\244\\257\\340\\244\\276\\0\"\\\n  \"\\340\\244\\252\\340\\244\\276\\340\\244\\240 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 %s \\340\\244\\252\\340\\244\\260 \\340\\244\\252\\340\\244\\276\\340\\244\\257\\340\\244\\276 \\340\\244\\227\\340\\244\\257\\340\\244\\276 ( \\340\\244\\253\\340\\244\\277\\340\\244\\260 \\340\\244\\270\\340\\245\\207 )\\0\"\\\n  \"\\340\\244\\205\\340\\244\\225\\340\\245\\215\\340\\244\\270\\340\\244\\260 \\340\\244\\252\\340\\244\\242\\340\\244\\274\\340\\245\\207\\340\\244\\202 \\340\\244\\234\\340\\244\\276\\340\\244\\250\\340\\245\\207 \\340\\244\\265\\340\\244\\276\\340\\244\\262\\340\\245\\207\\0\"\\\n  \"\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\270\\340\\244\\202\\340\\244\\226\\340\\245\\215\\340\\244\\257\\340\\244\\276 \\340\\244\\252\\340\\244\\260 \\340\\244\\234\\340\\244\\276\\340\\244\\217(&G)\\0\"\\\n  \"\\340\\244\\205\\340\\244\\225\\340\\245\\215\\340\\244\\270\\340\\244\\260 \\340\\244\\252\\340\\244\\242\\340\\244\\274\\340\\245\\207 \\340\\244\\234\\340\\244\\276\\340\\244\\250\\340\\245\\207 \\340\\244\\265\\340\\244\\276\\340\\244\\262\\340\\245\\213\\340\\244\\202 \\340\\244\\225\\340\\245\\213 \\340\\244\\233\\340\\245\\201\\340\\244\\252\\340\\244\\276\\340\\244\\217\\340\\244\\201\\0\"\\\n  \"\\340\\244\\270\\340\\245\\201\\340\\244\\235\\340\\244\\276\\340\\244\\265: \\340\\244\\253\\340\\244\\277\\340\\244\\260 \\340\\244\\270\\340\\245\\207 \\340\\244\\226\\340\\245\\213\\340\\244\\234\\340\\244\\250\\340\\245\\207 \\340\\244\\225\\340\\245\\207 \\340\\244\\262\\340\\244\\277\\340\\244\\217 F3 \\340\\244\\225\\340\\245\\201\\340\\244\\202\\340\\244\\234\\340\\245\\200 \\340\\244\\225\\340\\244\\276 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\257\\340\\245\\213\\340\\244\\227 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\233\\340\\244\\265\\340\\244\\277 \\340\\244\\253\\340\\244\\274\\340\\244\\276\\340\\244\\207\\340\\244\\262\\340\\245\\207\\340\\244\\202 (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"\\340\\244\\270\\340\\244\\255\\340\\245\\200 PDF \\340\\244\\253\\340\\244\\276\\340\\244\\210\\340\\244\\262\\340\\245\\207\\340\\244\\202 SumatraPDF \\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\207\\340\\244\\202 ?\\0\"\\\n  \"\\340\\244\\270\\340\\244\\255\\340\\245\\200 PDF \\340\\244\\253\\340\\244\\276\\340\\244\\210\\340\\244\\262\\340\\245\\207\\340\\244\\202 SumatraPDF \\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\0\"\\\n  \"\\340\\244\\205\\340\\244\\225\\340\\245\\215\\340\\244\\267\\340\\244\\260 \\340\\244\\206\\340\\244\\225\\340\\244\\276\\340\\244\\260 \\340\\244\\256\\340\\244\\277\\340\\244\\262\\340\\244\\276\\340\\244\\217\\340\\244\\202\\0\"\\\n  \"Mobi \\340\\244\\246\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\276\\340\\244\\265\\340\\245\\207\\340\\244\\234\\340\\244\\274\\0\"\\\n  \"\\340\\244\\270\\340\\244\\202\\340\\244\\266\\340\\245\\213\\340\\244\\247\\340\\244\\277\\340\\244\\244\\0\"\\\n  \"\\340\\244\\270\\340\\244\\202\\340\\244\\270\\340\\244\\225\\340\\244\\260\\340\\244\\243 %s \\340\\244\\211\\340\\244\\252\\340\\244\\262\\340\\244\\254\\340\\245\\215\\340\\244\\247 \\340\\244\\271\\340\\245\\210 \\340\\245\\244 \\340\\244\\241\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\244\\262\\340\\245\\213\\340\\244\\241 \\340\\244\\225\\340\\244\\260\\340\\245\\202\\340\\244\\201 ?\\0\"\\\n  \"\\340\\244\\205\\340\\244\\227\\340\\244\\262\\340\\245\\207 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\252\\340\\244\\260\\0\"\\\n  \"\\340\\244\\225\\340\\245\\213\\340\\244\\210 \\340\\244\\256\\340\\244\\277\\340\\244\\262\\340\\244\\276\\340\\244\\250 \\340\\244\\250\\340\\244\\271\\340\\245\\200\\340\\244\\202 \\340\\244\\256\\340\\244\\277\\340\\244\\262\\340\\244\\276\\0\"\\\n  \"\\340\\244\\260\\340\\245\\207\\340\\244\\226\\340\\244\\276 %u \\340\\244\\225\\340\\245\\207 \\340\\244\\206\\340\\244\\270\\340\\244\\252\\340\\244\\276\\340\\244\\270 \\340\\244\\253\\340\\244\\274\\340\\244\\276\\340\\244\\207\\340\\244\\262 %s \\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\225\\340\\245\\213\\340\\244\\210 \\340\\244\\252\\340\\244\\260\\340\\244\\277\\340\\244\\243\\340\\244\\276\\340\\244\\256 \\340\\244\\250\\340\\244\\271\\340\\245\\200\\340\\244\\202 \\340\\244\\256\\340\\244\\277\\340\\244\\262\\340\\244\\276\\0\"\\\n  \"\\340\\244\\225\\340\\245\\213\\340\\244\\210 \\340\\244\\244\\340\\245\\201\\340\\244\\262\\340\\245\\215\\340\\244\\257\\340\\244\\225\\340\\244\\276\\340\\244\\262\\340\\244\\250 \\340\\244\\253\\340\\244\\276\\340\\244\\207\\340\\244\\262 \\340\\244\\250\\340\\244\\271\\340\\245\\200\\340\\244\\202 \\340\\244\\256\\340\\244\\277\\340\\244\\262\\340\\244\\276\\0\"\\\n  \"\\340\\244\\207\\340\\244\\270 \\340\\244\\270\\340\\245\\215\\340\\244\\245\\340\\244\\277\\340\\244\\244\\340\\244\\277 \\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\225\\340\\245\\213\\340\\244\\210 \\340\\244\\244\\340\\245\\201\\340\\244\\262\\340\\245\\215\\340\\244\\257\\340\\244\\225\\340\\244\\276\\340\\244\\262\\340\\244\\250 \\340\\244\\234\\340\\244\\276\\340\\244\\250\\340\\244\\225\\340\\244\\276\\340\\244\\260\\340\\245\\200 \\340\\244\\250\\340\\244\\271\\340\\245\\200\\340\\244\\202 \\340\\244\\271\\340\\245\\210\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\244\\240 \\340\\244\\270\\340\\244\\202\\340\\244\\226\\340\\245\\215\\340\\244\\257\\340\\244\\276\\0\"\\\n  \"\\340\\244\\240\\340\\245\\200\\340\\244\\225\\0\"\\\n  \"\\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\252\\340\\245\\200\\340\\244\\241\\340\\245\\200\\340\\244\\217\\340\\244\\253 &Xchange \\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\217\\340\\244\\225 \\340\\244\\246\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\276\\340\\244\\265\\340\\245\\207\\340\\245\\233 \\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\0\"\\\n  \"&\\340\\244\\217\\340\\244\\241\\340\\245\\213\\340\\244\\254 \\340\\244\\260\\340\\245\\200\\340\\244\\241\\340\\244\\260 \\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"&Foxit \\340\\244\\260\\340\\245\\200\\340\\244\\241\\340\\244\\260 \\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"Microsoft HTML \\340\\244\\256\\340\\244\\246\\340\\244\\246 \\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"Microsoft XPS \\340\\244\\246\\340\\244\\260\\340\\245\\215\\340\\244\\266\\340\\244\\225 \\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"&\\340\\244\\227\\340\\245\\201\\340\\244\\243\\0\"\\\n  \"&\\340\\244\\227\\340\\245\\201\\340\\244\\243\\tCtrl+D\\0\"\\\n  \"\\340\\244\\252\\340\\245\\200\\340\\244\\241\\340\\245\\200\\340\\244\\217\\340\\244\\253 \\340\\244\\246\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\276\\340\\244\\265\\340\\245\\207\\340\\244\\234\\340\\244\\274\\0\"\\\n  \"\\340\\244\\252\\340\\245\\200\\340\\244\\241\\340\\245\\200\\340\\244\\217\\340\\244\\253 \\340\\244\\205\\340\\244\\250\\340\\245\\201\\340\\244\\225\\340\\245\\202\\340\\244\\262\\340\\244\\250:\\0\"\\\n  \"\\340\\244\\252\\340\\245\\200\\340\\244\\241\\340\\245\\200\\340\\244\\217\\340\\244\\253 \\340\\244\\250\\340\\244\\277\\340\\244\\260\\340\\245\\215\\340\\244\\256\\340\\244\\276\\340\\244\\244\\340\\244\\276:\\0\"\\\n  \"\\340\\244\\252\\340\\245\\200\\340\\244\\241\\340\\245\\200\\340\\244\\217\\340\\244\\253 \\340\\244\\270\\340\\244\\202\\340\\244\\270\\340\\245\\215\\340\\244\\225\\340\\244\\260\\340\\244\\243:\\0\"\\\n  \"\\340\\244\\252\\340\\245\\200\\340\\244\\241\\340\\245\\200\\340\\244\\217\\340\\244\\253 \\340\\244\\246\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\276\\340\\244\\265\\340\\245\\207\\340\\244\\234\\340\\245\\213\\340\\244\\202\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\270\\340\\244\\202\\340\\244\\226\\340\\245\\215\\340\\244\\257\\340\\244\\276 \\340\\244\\252\\340\\244\\260\\tCtrl+G\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 %s\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\206\\340\\244\\225\\340\\244\\260\\0\"\\\n  \"%u \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\270\\340\\244\\202\\340\\244\\226\\340\\245\\215\\340\\244\\257\\340\\244\\276 \\340\\244\\265\\340\\244\\277\\340\\244\\246\\340\\245\\215\\340\\244\\257\\340\\244\\256\\340\\244\\276\\340\\244\\250 \\340\\244\\250\\340\\244\\271\\340\\245\\200\\340\\244\\202 \\340\\244\\271\\340\\245\\210\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\206\\340\\244\\225\\340\\244\\260 \\340\\244\\256\\340\\244\\252\\340\\245\\215\\340\\244\\257\\340\\244\\276\\340\\244\\202\\340\\244\\225\\340\\244\\250\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\270\\340\\244\\202\\340\\244\\226\\340\\245\\215\\340\\244\\257\\340\\244\\276:\\0\"\\\n  \"\\0\"\\\n  \"\\340\\244\\225\\340\\245\\203\\340\\244\\252\\340\\244\\257\\340\\244\\276 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\244\\340\\245\\200\\340\\244\\225\\340\\245\\215\\340\\244\\267\\340\\244\\276 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202 - \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\244\\340\\244\\277\\340\\244\\252\\340\\244\\276\\340\\244\\246\\340\\244\\250...\\0\"\\\n  \"\\340\\244\\205\\340\\244\\250\\340\\245\\201\\340\\244\\262\\340\\245\\207\\340\\244\\226 \\340\\244\\246\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\276\\340\\244\\265\\340\\245\\207\\340\\244\\234\\340\\245\\213\\340\\244\\202\\0\"\\\n  \"&\\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\245\\201\\340\\244\\244\\340\\244\\277\\tCtrl+L\\0\"\\\n  \"\\340\\244\\252\\340\\244\\277\\340\\244\\233\\340\\244\\262\\340\\245\\207 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\252\\340\\244\\260\\0\"\\\n  \"\\340\\244\\233\\340\\244\\276\\340\\244\\252\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\233\\340\\244\\252\\340\\244\\276\\340\\244\\210 \\340\\244\\270\\340\\245\\200\\340\\244\\256\\340\\244\\276\\0\"\\\n  \"\\340\\244\\246\\340\\244\\277\\340\\244\\217 \\340\\244\\227\\340\\244\\217 \\340\\244\\250\\340\\244\\276\\340\\244\\256 \\340\\244\\225\\340\\244\\276 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\277\\340\\244\\202\\340\\244\\237\\340\\244\\260 \\340\\244\\256\\340\\245\\214\\340\\244\\234\\340\\245\\202\\340\\244\\246 \\340\\244\\250\\340\\244\\271\\340\\245\\200\\340\\244\\202 \\340\\244\\271\\340\\245\\210\\0\"\\\n  \"\\340\\244\\233\\340\\244\\252\\340\\244\\276\\340\\244\\210 \\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\227\\340\\244\\244\\340\\244\\277.\\0\"\\\n  \"\\340\\244\\233\\340\\244\\252\\340\\244\\276\\340\\244\\210 \\340\\244\\205\\340\\244\\255\\340\\245\\200 \\340\\244\\255\\340\\245\\200 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\227\\340\\244\\244\\340\\244\\277 \\340\\244\\252\\340\\244\\260 \\340\\244\\271\\340\\245\\210 | \\340\\244\\260\\340\\244\\246\\340\\245\\215\\340\\244\\246 \\340\\244\\225\\340\\244\\277\\340\\244\\234\\340\\244\\277\\340\\244\\257\\340\\245\\207 \\340\\244\\224\\340\\244\\260 \\340\\244\\246\\340\\245\\207\\340\\244\\202 \\340\\244\\233\\340\\245\\213\\340\\244\\241\\340\\244\\274 \\340\\244\\246\\340\\245\\207\\340\\244\\202 ?\\0\"\\\n  \"\\340\\244\\233\\340\\244\\252\\340\\244\\276\\340\\244\\210 \\340\\244\\205\\340\\244\\255\\340\\245\\200 \\340\\244\\255\\340\\245\\200 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\227\\340\\244\\244\\340\\244\\277 \\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\271\\340\\245\\210 | \\340\\244\\254\\340\\244\\250\\340\\245\\215\\340\\244\\246 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202 \\340\\244\\224\\340\\244\\260 \\340\\244\\253\\340\\244\\277\\340\\244\\260 \\340\\244\\270\\340\\245\\207 \\340\\244\\266\\340\\245\\201\\340\\244\\260\\340\\245\\202 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202?\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 %d %d \\340\\244\\225\\340\\244\\276 \\340\\244\\233\\340\\244\\252 \\340\\244\\260\\340\\244\\271\\340\\245\\200 \\340\\244\\271\\340\\245\\210...\\0\"\\\n  \"\\340\\244\\252\\340\\244\\260\\340\\244\\277\\340\\244\\202\\340\\244\\237 \\340\\244\\225\\340\\244\\260\\340\\244\\250\\340\\245\\207 \\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\227\\340\\244\\262\\340\\244\\244\\340\\245\\200\\0\"\\\n  \"&\\340\\244\\250\\340\\244\\276\\340\\244\\256 \\340\\244\\254\\340\\244\\246\\340\\244\\262\\340\\245\\207\\340\\244\\202...\\tF2\\0\"\\\n  \"\\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\207 \\340\\244\\227\\340\\244\\257\\340\\245\\207 \\340\\244\\253\\340\\244\\276\\340\\244\\207\\340\\244\\262 &\\340\\244\\257\\340\\244\\276\\340\\244\\246 \\340\\244\\260\\340\\244\\226\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\252\\340\\244\\270\\340\\244\\202\\340\\244\\246\\340\\245\\200\\340\\244\\246\\340\\244\\276 \\340\\244\\270\\340\\245\\207 \\340\\244\\250\\340\\244\\277\\340\\244\\225\\340\\244\\276\\340\\244\\262\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\252\\340\\244\\270\\340\\244\\202\\340\\244\\246\\340\\245\\200\\340\\244\\246\\340\\244\\276 \\340\\244\\270\\340\\245\\207 %s \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\225\\340\\245\\213 \\340\\244\\250\\340\\244\\277\\340\\244\\225\\340\\244\\276\\340\\244\\262\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\250\\340\\244\\276\\340\\244\\256 \\340\\244\\254\\340\\244\\246\\340\\244\\262 \\340\\244\\225\\340\\244\\260\\342\\200\\213\\0\"\\\n  \"\\340\\244\\254\\340\\244\\276\\340\\244\\202\\340\\244\\257\\340\\245\\200 \\340\\244\\223\\340\\244\\260 \\340\\244\\230\\340\\245\\202\\340\\244\\256\\340\\244\\276\\340\\244\\223\\tCtrl+Shift+-\\0\"\\\n  \"\\340\\244\\246\\340\\244\\276\\340\\244\\202\\340\\244\\257\\340\\245\\200 \\340\\244\\223\\340\\244\\260 \\340\\244\\230\\340\\245\\202\\340\\244\\256\\340\\244\\276\\340\\244\\223\\tCtrl+Shift++\\0\"\\\n  \"\\340\\244\\207\\340\\244\\270 \\340\\244\\244\\340\\244\\260\\340\\244\\271 \\340\\244\\270\\340\\244\\202\\340\\244\\255\\340\\244\\276\\340\\244\\262\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\266\\340\\245\\211&\\340\\244\\260\\340\\245\\215\\340\\244\\237\\340\\244\\225\\340\\244\\237 \\340\\244\\270\\340\\244\\271\\340\\245\\207\\340\\244\\234\\340\\245\\207\\340\\244\\202... \\tCtrl+Shift+S\\0\"\\\n  \"\\340\\244\\226\\340\\245\\213\\340\\244\\234 \\340\\244\\260\\340\\244\\271\\340\\244\\276 %d %d \\340\\244\\225\\340\\244\\276...\\0\"\\\n  \"\\340\\244\\270\\340\\244\\254 &\\340\\244\\232\\340\\245\\201\\340\\244\\250\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\270\\340\\244\\254 &\\340\\244\\232\\340\\245\\201\\340\\244\\250\\340\\245\\207\\340\\244\\202\\tCtrl+A\\0\"\\\n  \"\\340\\244\\270\\340\\244\\276\\340\\244\\256\\340\\244\\227\\340\\245\\215\\340\\244\\260\\340\\245\\200 \\340\\244\\225\\340\\244\\276 \\340\\244\\232\\340\\244\\257\\340\\244\\250 \\340\\244\\225\\340\\244\\260\\340\\244\\250\\340\\245\\207 \\340\\244\\225\\340\\245\\207 \\340\\244\\262\\340\\244\\277\\340\\244\\257\\340\\245\\207  Ctrl +  \\340\\244\\256\\340\\244\\276\\340\\244\\211\\340\\244\\270 \\340\\244\\225\\340\\244\\276 \\340\\244\\254\\340\\244\\276\\340\\244\\257\\340\\244\\276\\340\\244\\201 \\340\\244\\254\\340\\244\\237\\340\\244\\250 \\340\\244\\246\\340\\244\\254\\340\\244\\276\\340\\244\\217\\340\\244\\201\\0\"\\\n  \"\\340\\244\\232\\340\\245\\201\\340\\244\\250\\340\\244\\276\\340\\244\\265\\0\"\\\n  \"&\\340\\244\\210 - \\340\\244\\256\\340\\245\\207\\340\\244\\262 \\340\\244\\246\\340\\245\\215\\340\\244\\265\\340\\244\\276\\340\\244\\260\\340\\244\\276 \\340\\244\\255\\340\\245\\207\\340\\244\\234\\340\\245\\207\\340\\244\\202...\\0\"\\\n  \"\\340\\244\\211\\340\\244\\262\\340\\244\\237\\340\\245\\200 command-line \\340\\244\\226\\340\\245\\213\\340\\244\\234 \\340\\244\\270\\340\\245\\210\\340\\244\\237 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\254\\340\\245\\201\\340\\244\\225\\340\\244\\256\\340\\244\\276\\340\\244\\260\\340\\245\\215\\340\\244\\225 \\340\\244\\246\\340\\244\\277\\340\\244\\226\\340\\244\\276\\340\\244\\217\\340\\244\\201 (&B)\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\340\\245\\213\\340\\244\\202 \\340\\244\\225\\340\\245\\213 \\340\\244\\262\\340\\244\\227\\340\\244\\276\\340\\244\\244\\340\\244\\276\\340\\244\\260 \\340\\244\\246\\340\\244\\277\\340\\244\\226\\340\\244\\276\\340\\244\\217\\340\\244\\201\\0\"\\\n  \"\\340\\244\\224\\340\\244\\234\\340\\244\\276\\340\\244\\260 \\340\\244\\265\\340\\244\\276\\340\\244\\262\\340\\245\\200 \\340\\244\\252\\340\\244\\237\\340\\245\\215\\340\\244\\237\\340\\245\\200 \\340\\244\\246\\340\\244\\277\\340\\244\\226\\340\\244\\276\\340\\244\\223\\0\"\\\n  \"\\340\\244\\252\\340\\244\\270\\340\\244\\202\\340\\244\\246\\340\\245\\200\\340\\244\\246\\340\\244\\276 \\340\\244\\246\\340\\244\\277\\340\\244\\226\\340\\244\\276\\340\\244\\217\\340\\244\\201\\0\"\\\n  \"\\340\\244\\205\\340\\244\\225\\340\\245\\215\\340\\244\\270\\340\\244\\260 \\340\\244\\252\\340\\244\\242\\340\\244\\274\\340\\245\\207 \\340\\244\\234\\340\\244\\276\\340\\244\\250\\340\\245\\207 \\340\\244\\265\\340\\244\\276\\340\\244\\262\\340\\245\\207 \\340\\244\\246\\340\\244\\277\\340\\244\\226\\340\\244\\276\\340\\244\\217\\340\\244\\201\\0\"\\\n  \"\\340\\244\\234\\340\\244\\254 \\340\\244\\254\\340\\245\\201\\340\\244\\225\\340\\244\\256\\340\\244\\276\\340\\244\\260\\340\\245\\215\\340\\244\\225 \\340\\244\\270\\340\\244\\276\\340\\244\\207\\340\\244\\241\\340\\244\\254\\340\\244\\276\\340\\244\\260 \\340\\244\\211\\340\\244\\252\\340\\244\\262\\340\\244\\254\\340\\245\\215\\340\\244\\247 \\340\\244\\271\\340\\245\\213 \\340\\244\\211\\340\\244\\270\\340\\245\\207 \\340\\244\\246\\340\\244\\277\\340\\244\\226\\340\\244\\276\\340\\244\\217\\340\\244\\201\\0\"\\\n  \"\\340\\244\\217\\340\\244\\225 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\0\"\\\n  \"\\340\\244\\225\\340\\245\\215\\340\\244\\267\\340\\244\\256\\340\\244\\276 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202, \\340\\244\\220\\340\\244\\270\\340\\244\\276 \\340\\244\\250\\340\\244\\271\\340\\245\\200\\340\\244\\202 \\340\\244\\271\\340\\245\\213\\340\\244\\250\\340\\244\\276 \\340\\244\\232\\340\\244\\276\\340\\244\\271\\340\\244\\277\\340\\244\\217; \\340\\244\\205\\340\\244\\227\\340\\244\\260 \\340\\244\\206\\340\\244\\252 \\340\\244\\207\\340\\244\\270 \\340\\244\\246\\340\\245\\201\\340\\244\\260\\340\\245\\215\\340\\244\\230\\340\\244\\237\\340\\244\\250\\340\\244\\276 \\340\\244\\225\\340\\245\\213 \\340\\244\\240\\340\\245\\200\\340\\244\\225 \\340\\244\\225\\340\\244\\260\\340\\244\\250\\340\\245\\207 \\340\\244\\256\\340\\245\\207\\340\\244\\202 \\340\\244\\256\\340\\244\\246\\340\\244\\246 \\340\\244\\225\\340\\244\\260\\340\\244\\250\\340\\244\\276 \\340\\244\\232\\340\\244\\276\\340\\244\\271\\340\\244\\244\\340\\245\\207 \\340\\244\\271\\340\\245\\210 : \\n\\n \\340\\244\\225\\340\\245\\203\\340\\244\\252\\340\\244\\257\\340\\244\\276  '\\340\\244\\260\\340\\244\\246\\340\\245\\215\\340\\244\\246 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202' \\340\\244\\246\\340\\244\\254\\340\\244\\276\\340\\244\\217\\340\\244\\201 |\\0\"\\\n  \"\\340\\244\\270\\340\\245\\215\\340\\244\\260\\340\\245\\213\\340\\244\\244 \\340\\244\\253\\340\\244\\274\\340\\244\\276\\340\\244\\207\\340\\244\\262 %s \\340\\244\\225\\340\\244\\276 \\340\\244\\244\\340\\245\\201\\340\\244\\262\\340\\245\\215\\340\\244\\257\\340\\244\\225\\340\\244\\276\\340\\244\\262\\340\\244\\250 \\340\\244\\254\\340\\244\\277\\340\\244\\202\\340\\244\\246\\340\\245\\201 \\340\\244\\250\\340\\244\\271\\340\\245\\200\\340\\244\\202 \\340\\244\\271\\340\\245\\210\\0\"\\\n  \"\\340\\244\\265\\340\\244\\277\\340\\244\\267\\340\\244\\257:\\0\"\\\n  \"Sumatra \\340\\244\\252\\340\\245\\200\\340\\244\\241\\340\\245\\200\\340\\244\\217\\340\\244\\253 \\340\\244\\265\\340\\244\\277\\340\\244\\225\\340\\244\\262\\340\\245\\215\\340\\244\\252\\0\"\\\n  \"Sumatra \\340\\244\\252\\340\\245\\200\\340\\244\\241\\340\\245\\200\\340\\244\\217\\340\\244\\253 \\340\\244\\205\\340\\244\\252\\340\\244\\241\\340\\245\\207\\340\\244\\237\\0\"\\\n  \"Sumatra \\340\\244\\252\\340\\245\\200\\340\\244\\241\\340\\245\\200\\340\\244\\217\\340\\244\\253 \\340\\244\\246\\340\\245\\201\\340\\244\\260\\340\\245\\215\\340\\244\\230\\340\\244\\237\\340\\244\\250\\340\\244\\276\\340\\244\\227\\340\\245\\215\\340\\244\\260\\340\\244\\270\\340\\245\\215\\340\\244\\244 \\340\\244\\271\\340\\245\\213 \\340\\244\\227\\340\\244\\257\\340\\244\\276\\0\"\\\n  \"Sumatra \\340\\244\\252\\340\\245\\200\\340\\244\\241\\340\\245\\200\\340\\244\\217\\340\\244\\253 \\340\\244\\206\\340\\244\\252\\340\\244\\225\\340\\244\\276 \\340\\244\\241\\340\\244\\277\\340\\244\\253\\340\\244\\274\\340\\245\\211\\340\\244\\262\\340\\245\\215\\340\\244\\237 \\340\\244\\252\\340\\245\\200\\340\\244\\241\\340\\245\\200\\340\\244\\217\\340\\244\\253 \\340\\244\\260\\340\\245\\200\\340\\244\\241\\340\\244\\260 \\340\\244\\271\\340\\245\\210\\0\"\\\n  \"SumatraPDF \\340\\244\\205\\340\\244\\254 \\340\\244\\206\\340\\244\\252\\340\\244\\225\\340\\244\\276 \\340\\244\\241\\340\\244\\277\\340\\244\\253\\340\\244\\274\\340\\245\\211\\340\\244\\262\\340\\245\\215\\340\\244\\237 \\340\\244\\252\\340\\245\\200\\340\\244\\241\\340\\245\\200\\340\\244\\217\\340\\244\\253 \\340\\244\\260\\340\\245\\200\\340\\244\\241\\340\\244\\260 \\340\\244\\271\\340\\245\\213\\340\\244\\250\\340\\244\\276 \\340\\244\\232\\340\\244\\276\\340\\244\\271\\340\\244\\277\\340\\244\\217\\0\"\\\n  \"\\340\\244\\244\\340\\245\\201\\340\\244\\262\\340\\245\\215\\340\\244\\257\\340\\244\\225\\340\\244\\276\\340\\244\\262\\340\\244\\250 \\340\\244\\253\\340\\244\\274\\340\\244\\276\\340\\244\\207\\340\\244\\262 \\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\244\\276 \\340\\244\\250\\340\\244\\271\\340\\245\\200\\340\\244\\202 \\340\\244\\234\\340\\244\\276 \\340\\244\\270\\340\\244\\225\\340\\244\\244\\340\\244\\276\\0\"\\\n  \"\\340\\244\\237\\340\\245\\210\\340\\244\\227 \\340\\244\\225\\340\\245\\200 \\340\\244\\227\\340\\244\\210\\340\\244\\202 \\340\\244\\252\\340\\245\\200\\340\\244\\241\\340\\245\\200\\340\\244\\217\\340\\244\\253\\0\"\\\n  \"\\340\\244\\237\\340\\245\\207\\340\\244\\225\\340\\245\\215\\340\\244\\270\\340\\245\\215\\340\\244\\237 \\340\\244\\246\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\276\\340\\244\\265\\340\\245\\207\\340\\244\\234\\340\\244\\274\\0\"\\\n  \"\\0\"\\\n  \"\\340\\244\\266\\340\\245\\200\\340\\244\\260\\340\\245\\215\\340\\244\\267\\340\\244\\225:\\0\"\\\n  \"\\340\\244\\205\\340\\244\\234\\340\\245\\215\\340\\244\\236\\340\\244\\276\\340\\244\\244 \\340\\244\\270\\340\\245\\215\\340\\244\\260\\340\\245\\213\\340\\244\\244 \\340\\244\\253\\340\\244\\274\\340\\244\\276\\340\\244\\207\\340\\244\\262 (%s)\\0\"\\\n  \"\\0\"\\\n  \"\\340\\244\\246\\340\\245\\207\\340\\244\\226\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\265\\340\\245\\207\\340\\244\\254\\340\\244\\270\\340\\244\\276\\340\\244\\207\\340\\244\\237 \\340\\244\\246\\340\\245\\207\\340\\244\\226\\340\\245\\207\\340\\244\\202(&W)\\0\"\\\n  \"\\340\\244\\232\\340\\245\\207\\340\\244\\244\\340\\244\\276\\340\\244\\265\\340\\244\\250\\340\\245\\200\\0\"\\\n  \"XPS \\340\\244\\246\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\276\\340\\244\\265\\340\\245\\207\\340\\244\\234\\340\\244\\274\\0\"\\\n  \"\\340\\244\\206\\340\\244\\252\\340\\244\\225\\340\\245\\207 \\340\\244\\252\\340\\244\\276\\340\\244\\270 \\340\\244\\252\\340\\244\\271\\340\\244\\262\\340\\245\\207 \\340\\244\\270\\340\\245\\207 \\340\\244\\271\\340\\245\\200 \\340\\244\\250\\340\\244\\265\\340\\245\\200\\340\\244\\250\\340\\244\\244\\340\\244\\256 \\340\\244\\270\\340\\244\\202\\340\\244\\270\\340\\244\\225\\340\\244\\260\\340\\244\\243 \\340\\244\\271\\340\\245\\210\\0\"\\\n  \"\\340\\244\\206\\340\\244\\252\\340\\244\\225\\340\\245\\207 \\340\\244\\252\\340\\244\\276\\340\\244\\270  %s \\340\\244\\270\\340\\244\\202\\340\\244\\270\\340\\244\\225\\340\\244\\260\\340\\244\\243 \\340\\244\\271\\340\\245\\210\\0\"\\\n  \"\\340\\244\\234\\340\\244\\274\\340\\245\\202\\340\\244\\256\\0\"\\\n  \"\\340\\244\\254\\342\\200\\213\\340\\244\\231\\340\\244\\276 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\233\\340\\245\\213\\340\\244\\237\\340\\244\\276 \\340\\244\\225\\340\\244\\260\\340\\245\\207\\340\\244\\202\\0\"\\\n  \"\\340\\244\\234\\340\\244\\274\\340\\245\\202\\340\\244\\256 \\340\\244\\227\\340\\245\\201\\340\\244\\243\\340\\244\\225\\0\"\\\n  \"[\\340\\244\\252\\340\\244\\260\\340\\244\\277\\340\\244\\265\\340\\244\\260\\340\\245\\215\\340\\244\\244\\340\\244\\250 \\340\\244\\225\\340\\244\\276 \\340\\244\\252\\340\\244\\244\\340\\244\\276 \\340\\244\\232\\340\\244\\262\\340\\244\\276; \\340\\244\\244\\340\\244\\260\\340\\245\\213\\340\\244\\244\\340\\244\\276\\340\\244\\234\\340\\244\\274\\340\\244\\276 \\340\\244\\271\\340\\245\\213 \\340\\244\\260\\340\\244\\271\\340\\244\\276 \\340\\244\\271\\340\\245\\210 ]%s\\0\"\\\n  \"\\340\\244\\252\\340\\244\\276\\340\\244\\240 \\340\\244\\233\\340\\244\\276\\340\\244\\252\\340\\244\\250\\340\\244\\276\\0\"\\\n  \"\\340\\244\\233\\340\\244\\252\\340\\244\\276\\340\\244\\210 \\340\\244\\246\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\276\\340\\244\\265\\340\\245\\207\\340\\244\\234\\340\\244\\274\\0\";\n\nconst char * gTranslations_hu = \n  \"N\\303\\251v&jegy\\0\"\\\n  \"&T\\303\\251nyleges m\\303\\251ret\\tCtrl+1\\0\"\\\n  \"Speci\\303\\241lis be\\303\\241ll\\303\\255t\\303\\241sok...\\0\"\\\n  \"Az \\303\\266sszes kiv\\303\\241lasztott oldal\\0\"\\\n  \"Ugr\\303\\241s vissza\\tAlt+<-\\0\"\\\n  \"&K\\303\\266nyv-m\\303\\263d (oldalp\\303\\241r c\\303\\255mlappal)\\tCtrl+8\\0\"\\\n  \"Be&z\\303\\241r\\303\\241s\\tCtrl+W\\0\"\\\n  \"Kijel\\303\\266l\\303\\251s &m\\303\\241sol\\303\\241sa\\0\"\\\n  \"Kijel\\303\\266l\\303\\251s m\\303\\241sol\\303\\241sa\\tCtrl+C\\0\"\\\n  \"Ne k\\303\\251rdezze meg t\\303\\266bb\\303\\251\\0\"\\\n  \"Csak a p\\303\\241ros oldalak\\0\"\\\n  \"&Oldalp\\303\\241r\\tCtrl+7\\0\"\\\n  \"&F\\303\\241jl\\0\"\\\n  \"Mit keres:\\0\"\\\n  \"Els\\305\\221 oldal\\tHome\\0\"\\\n  \"Oldalm\\303\\251ret illeszt\\303\\251se a nyomtathat\\303\\263 ter\\303\\274lethez\\0\"\\\n  \"U&gr\\303\\241s\\0\"\\\n  \"&Ugr\\303\\241s oldal:\\0\"\\\n  \"&S\\303\\272g\\303\\263\\0\"\\\n  \"Utols\\303\\263 oldal\\tEnd\\0\"\\\n  \"Nagy\\303\\255t\\303\\241s:\\0\"\\\n  \"\\303\\232tmutat\\303\\263 (web)\\0\"\\\n  \"Kis- \\303\\251s nagybet\\305\\261k megk\\303\\274l\\303\\266nb\\303\\266ztet\\303\\251se\\0\"\\\n  \"K\\303\\266vetkez\\305\\221 oldal\\t->\\0\"\\\n  \"&Nem\\0\"\\\n  \"K\\303\\266sz\\303\\266n\\303\\266m,&nem\\0\"\\\n  \"Csak a p\\303\\241ratlan oldalak\\0\"\\\n  \"&F\\303\\241jl megnyit\\303\\241sa\\0\"\\\n  \"Megny&it\\303\\241s...\\tCtrl+O\\0\"\\\n  \"&Be\\303\\241ll\\303\\255t\\303\\241sok...\\0\"\\\n  \"&Jelsz\\303\\263:\\0\"\\\n  \"Lista elej\\303\\251re\\0\"\\\n  \"El\\305\\221z\\305\\221 oldal\\t<-\\0\"\\\n  \"&Nyomtat\\303\\241s\\0\"\\\n  \"Nyomt&at\\303\\241s...\\tCtrl+P\\0\"\\\n  \"Nyomtat\\303\\241s... (tiltott)\\0\"\\\n  \"Jelsz\\303\\263 megjegyz\\303\\251se a dokumentumhoz\\0\"\\\n  \"Elt\\303\\251r\\305\\221 n\\303\\251zetbe\\303\\241ll\\303\\255t\\303\\241sok megjegyz\\303\\251se dokumentumonk\\303\\251nt\\0\"\\\n  \"&Elt\\303\\241vol\\303\\255t\\303\\241s a list\\303\\241b\\303\\263l\\0\"\\\n  \"&Ment\\303\\251s m\\303\\241sk\\303\\251nt...\\0\"\\\n  \"Ment&\\303\\251s m\\303\\241sk\\303\\251nt...\\tCtrl+S\\0\"\\\n  \"&Be\\303\\241ll\\303\\255t\\303\\241sok\\0\"\\\n  \"Oldalak sz\\303\\251leinek lev\\303\\241g\\303\\241sa a nyomtathat\\303\\263 m\\303\\251retre\\0\"\\\n  \"&Egyoldalas\\tCtrl+6\\0\"\\\n  \"Verzi\\303\\263 kihagy\\303\\241sa\\0\"\\\n  \"Eredeti oldalm\\303\\251ret haszn\\303\\241lata\\0\"\\\n  \"&N\\303\\251zet\\0\"\\\n  \"&Ablak\\0\"\\\n  \"&Igen\\0\"\\\n  \"&Nagy\\303\\255t\\303\\241s\\0\"\\\n  \"(a %d-b\\303\\263l)\\0\"\\\n  \"(%s. oldal)\\0\"\\\n  \"A SumatraPDF n\\303\\251vjegye\\0\"\\\n  \"Hozz\\303\\241ad\\303\\241s a kedvencekhez\\0\"\\\n  \"%s. oldal hozz\\303\\241ad\\303\\241sa a kedvencekhez\\0\"\\\n  \"%s. oldal hozz\\303\\241ad\\303\\241sa a kedvencekhez, megnevez\\303\\251ssel (nem k\\303\\266telez\\305\\221):\\0\"\\\n  \"Hozz\\303\\241ad\\303\\241s a kedvencekhez\\0\"\\\n  \"Speci\\303\\241lis\\0\"\\\n  \"Minden f\\303\\241jl\\0\"\\\n  \"Minden t\\303\\241mogatott f\\303\\241jlt\\303\\255pus\\0\"\\\n  \"Alkalmaz\\303\\241s:\\0\"\\\n  \"T\\303\\241rs\\303\\255t\\303\\241s a PDF f\\303\\241jlokkal?\\0\"\\\n  \"Mell\\303\\251klet: %s\\0\"\\\n  \"K\\303\\251sz\\303\\255t\\305\\221:\\0\"\\\n  \"Automatikus\\0\"\\\n  \"&Friss\\303\\255t\\303\\251sek automatikus keres\\303\\251se\\0\"\\\n  \"K\\303\\266nyv (oldalp\\303\\241r c\\303\\255mlappal)\\0\"\\\n  \"K\\303\\266nyvjelz\\305\\221k\\tF12\\0\"\\\n  \"K\\303\\266nyvjelz\\305\\221 parancsikonok\\0\"\\\n  \"K\\303\\266nyvjelz\\305\\221 parancsikon a(z) %s/%s oldalhoz\\0\"\\\n  \"K\\303\\266nyvjelz\\305\\221k\\0\"\\\n  \"b\\303\\241jt\\0\"\\\n  \"CHM f\\303\\241jlok\\0\"\\\n  \"Nem siker\\303\\274lt kapcsol\\303\\263dni az Internetre (hiba %#x).\\0\"\\\n  \"M\\303\\251gse\\0\"\\\n  \"Ez a f\\303\\241jl nem nyomtathat\\303\\263\\0\"\\\n  \"Nem ind\\303\\255that\\303\\263 a ford\\303\\255tott keres\\303\\251si parancs. Ellen\\305\\221rizze a parancssorban a be\\303\\241ll\\303\\255t\\303\\241sokat.\\0\"\\\n  \"Nyelv kiv\\303\\241laszt\\303\\241sa (Change Language)\\0\"\\\n  \"&Friss\\303\\255t\\303\\251sek keres\\303\\251se\\0\"\\\n  \"K\\303\\251preg\\303\\251ny f\\303\\241jlok\\0\"\\\n  \"Kompatibilit\\303\\241s\\0\"\\\n  \"Folyamatos\\0\"\\\n  \"Folyamatos k\\303\\266nyv\\0\"\\\n  \"Folyamatos oldalp\\303\\241r\\0\"\\\n  \"&Hozz\\303\\241j\\303\\241rul\\303\\241s a ford\\303\\255t\\303\\241shoz\\0\"\\\n  \"&K\\303\\251p m\\303\\241sol\\303\\241sa\\0\"\\\n  \"&Hivatkoz\\303\\241s c\\303\\255m\\303\\251nek m\\303\\241sol\\303\\241sa\\0\"\\\n  \"Me&gjegyz\\303\\251s m\\303\\241sol\\303\\241sa\\0\"\\\n  \"Sz\\303\\266veg m\\303\\241sol\\303\\241sa tiltott (csak k\\303\\251pk\\303\\251nt m\\303\\241solva)\\0\"\\\n  \"Szerz\\305\\221i jog:\\0\"\\\n  \"A nyomtat\\303\\263 tulajdons\\303\\241gai nem \\303\\251rhet\\305\\221ek el\\0\"\\\n  \"A nyomtat\\303\\263 inicializ\\303\\241l\\303\\241sa nem siker\\303\\274lt\\0\"\\\n  \"Oldalfeldolgoz\\303\\241si hiba\\0\"\\\n  \"K\\303\\251sz\\303\\274lt:\\0\"\\\n  \"Jelenlegi f\\303\\241jl\\0\"\\\n  \"Kurzor poz\\303\\255ci\\303\\263:\\0\"\\\n  \"... Egy\\303\\251ni m\\303\\251ret\\tCtrl+Y\\0\"\\\n  \"Oldalmegjelen\\303\\255t\\303\\251si m\\303\\263d:\\0\"\\\n  \"Alapnagy\\303\\255t\\303\\241s:\\0\"\\\n  \"Nem tehet\\305\\221 alap\\303\\251rtelmezett PDF-olvas\\303\\263v\\303\\241 hordozhat\\303\\263 m\\303\\263dban\\0\"\\\n  \"Tiltott m\\305\\261veletek:\\0\"\\\n  \"DjVu f\\303\\241jlok\\0\"\\\n  \"A dokumentum tulajdons\\303\\241gai\\0\"\\\n  \"Let\\303\\266lt\\303\\251s\\0\"\\\n  \"&Kil\\303\\251p\\303\\251s\\tCtrl+Q\\0\"\\\n  \"EPUB f\\303\\241jlok\\0\"\\\n  \"\\303\\215rja be a jelsz\\303\\263t\\0\"\\\n  \"\\303\\215rja be a(z) %s jelszav\\303\\241t\\0\"\\\n  \"\\303\\215rja be a parancsot, ami a PDF dokumentumra val\\303\\263 dupla kattint\\303\\241skor fut le:\\0\"\\\n  \"Hiba %s dokumentum bet\\303\\266lt\\303\\251sekor\\0\"\\\n  \"&Kedvencek\\0\"\\\n  \"Ugr\\303\\241s el\\305\\221re\\tAlt+->\\0\"\\\n  \"Teljes k\\303\\251perny\\305\\221\\tCtrl+Shift+L\\0\"\\\n  \"Oldalp\\303\\241r\\0\"\\\n  \"A f\\303\\241jl \\303\\241tnevez\\303\\251se sikertelen\\0\"\\\n  \"A f\\303\\241jl ment\\303\\251se sikertelen\\0\"\\\n  \"Gyors web-n\\303\\251zet\\0\"\\\n  \"Kedvencek\\0\"\\\n  \"FictionBook f\\303\\241jlok\\0\"\\\n  \"F\\303\\241jl %s nem tal\\303\\241lhat\\303\\263\\0\"\\\n  \"M\\303\\251ret:\\0\"\\\n  \"F\\303\\241jl:\\0\"\\\n  \"Keres\\303\\251s...\\tCtrl+F\\0\"\\\n  \"Keres\\303\\251s\\0\"\\\n  \"K\\303\\266vetkez\\305\\221 keres\\303\\251se\\0\"\\\n  \"El\\305\\221z\\305\\221 keres\\303\\251se\\0\"\\\n  \"Keres\\303\\251s:\\0\"\\\n  \"&Tartalom\\tCtrl+3\\0\"\\\n  \"&Teljes oldal\\tCtrl+0\\0\"\\\n  \"Oldal&sz\\303\\251less\\303\\251g\\tCtrl+2\\0\"\\\n  \"Tartalom\\0\"\\\n  \"Teljes oldal\\0\"\\\n  \"Oldalsz\\303\\251less\\303\\251g\\0\"\\\n  \"Oldalsz\\303\\251less\\303\\251ghez igaz\\303\\255t\\303\\241s + folyamatos n\\303\\251zet\\0\"\\\n  \"Teljes oldalank\\303\\251nti n\\303\\251zet\\0\"\\\n  \"Bet\\305\\261k:\\0\"\\\n  \"K\\303\\266nyv form\\303\\241z\\303\\241sa... %d oldal\\0\"\\\n  \"Tal\\303\\241lat a(z) %s. oldalon\\0\"\\\n  \"Tal\\303\\241lat a(z) %s. oldalon (ism\\303\\251t)\\0\"\\\n  \"Leggyakrabban olvasott f\\303\\241jlok\\0\"\\\n  \"Gb\\0\"\\\n  \"Ugr\\303\\241s adott oldalra\\0\"\\\n  \"Leggyakrabban olvasottak elrejt\\303\\251se\\0\"\\\n  \"Tipp: Nyomja meg az F3 gombot a k\\303\\266vetkez\\305\\221 tal\\303\\241lathoz\\0\"\\\n  \"K\\303\\251pf\\303\\241jlok (*.%s)\\0\"\\\n  \"Kb\\0\"\\\n  \"Mb\\0\"\\\n  \"Legyen a SumatraPDF az alap\\303\\251rtelmezett PDF-megnyit\\303\\263 program?\\0\"\\\n  \"SumatraPDF mint alap\\303\\251rtelmezett PDF olvas\\303\\263\\0\"\\\n  \"Manga m\\303\\263d\\0\"\\\n  \"Kis- \\303\\251s nagybet\\305\\261k megk\\303\\274l\\303\\266nb\\303\\266ztet\\303\\251se\\0\"\\\n  \"Mobi f\\303\\241jlok\\0\"\\\n  \"M\\303\\263dos\\303\\255tva:\\0\"\\\n  \"\\303\\232j verzi\\303\\263 \\303\\251rhet\\305\\221 el: (%s). K\\303\\255v\\303\\241nja let\\303\\266lteni?\\0\"\\\n  \"K\\303\\266vetkez\\305\\221 oldal\\0\"\\\n  \"Nem tal\\303\\241lhat\\303\\263 a dokumentumban\\0\"\\\n  \"Nincs tal\\303\\241lat a %u. sor k\\303\\266r\\303\\274l ebben a f\\303\\241jlban: %s\\0\"\\\n  \"Nem tal\\303\\241lhat\\303\\263 szinkroniz\\303\\241ci\\303\\263s f\\303\\241jl\\0\"\\\n  \"Nem tal\\303\\241lhat\\303\\263 szinkroniz\\303\\241l\\303\\241si inform\\303\\241ci\\303\\263 az adott poz\\303\\255ci\\303\\263hoz\\0\"\\\n  \"Oldalak sz\\303\\241ma:\\0\"\\\n  \"\\0\"\\\n  \"Megny&it\\303\\241s\\0\"\\\n  \"Megnyit\\303\\241s PDF-XChange-ben\\0\"\\\n  \"F\\303\\241jl megnyit\\303\\241sa...\\0\"\\\n  \"Megnyit\\303\\241s %s\\0\"\\\n  \"Megnyit\\303\\241s &Adobe Acrobat-ban\\0\"\\\n  \"Megnyit\\303\\241s &Foxit Readerben\\0\"\\\n  \"Megnyit\\303\\241s Microsoft HTML Helpben\\0\"\\\n  \"Megnyit\\303\\241s Microsoft XPS-Viewerben\\0\"\\\n  \"&Tulajdons\\303\\241gok\\0\"\\\n  \"&Tulajdons\\303\\241gok\\tCtrl+D\\0\"\\\n  \"PDF dokumentum\\0\"\\\n  \"PDF optimaliz\\303\\241l\\303\\241s:\\0\"\\\n  \"PDF-et l\\303\\251trehozta:\\0\"\\\n  \"PDF verzi\\303\\263:\\0\"\\\n  \"PDF f\\303\\241jlok\\0\"\\\n  \"Megadott oldal...\\tCtrl+G\\0\"\\\n  \"%s. oldal\\0\"\\\n  \"Oldalm\\303\\251ret\\0\"\\\n  \"A(z) %u oldalsz\\303\\241m nem l\\303\\251tezik\\0\"\\\n  \"Lapm\\303\\251rethez igaz\\303\\255t\\303\\241s\\0\"\\\n  \"Oldal:\\0\"\\\n  \"PalmDoc dokumentumok\\0\"\\\n  \"Feldolgoz\\303\\241s, k\\303\\251rem v\\303\\241rjon\\0\"\\\n  \"Postscript f\\303\\241jlok\\0\"\\\n  \"Bemutat\\303\\263\\tCtrl+L\\0\"\\\n  \"El\\305\\221z\\305\\221 oldal\\0\"\\\n  \"Nyomtat\\303\\241s\\0\"\\\n  \"Nyomtat\\303\\241si tartom\\303\\241ny\\0\"\\\n  \"Nem tal\\303\\241lhat\\303\\263 nyomtat\\303\\263 a megadott n\\303\\251ven\\0\"\\\n  \"Nyomtat\\303\\241s folyamatban.\\0\"\\\n  \"A nyomtat\\303\\241s m\\303\\251g folyamatban van. Megszak\\303\\255t\\303\\241s \\303\\251s kil\\303\\251p\\303\\251s?\\0\"\\\n  \"A nyomtat\\303\\241s m\\303\\251g folyamatban van. Megszak\\303\\255t\\303\\241s \\303\\251s \\303\\272jrakezd\\303\\251s?\\0\"\\\n  \"%d. oldal nyomtat\\303\\241sa a(z) %d-b\\305\\221l...\\0\"\\\n  \"Nyomtat\\303\\241si probl\\303\\251ma.\\0\"\\\n  \"\\303\\201tnevez\\303\\251s...\\tF2\\0\"\\\n  \"Kor\\303\\241bban megnyitott f\\303\\241jlok list\\303\\241j\\303\\241nak t\\303\\241rol\\303\\241sa\\0\"\\\n  \"Elt\\303\\241vol\\303\\255t\\303\\241s a kedvencek k\\303\\266z\\303\\274l\\0\"\\\n  \"%s. oldal elt\\303\\241vol\\303\\255t\\303\\241sa a kedvencek k\\303\\266z\\303\\274l\\0\"\\\n  \"\\303\\201tnevez\\303\\251s\\0\"\\\n  \"Forgat\\303\\241s balra\\tCtrl+Shift+-\\0\"\\\n  \"Forgat\\303\\241s jobbra\\tCtrl+Shift++\\0\"\\\n  \"Ment\\303\\251s m\\303\\241sk\\303\\251nt\\0\"\\\n  \"Parancsikon k\\303\\251sz\\303\\255t\\303\\251se...\\tCtrl+Shift+S\\0\"\\\n  \"Keres\\303\\251s a(z) %d./%d oldalon\\0\"\\\n  \"&\\303\\226sszes kijel\\303\\266l\\303\\251se\\0\"\\\n  \"\\303\\226sszes &kijel\\303\\266l\\303\\251se\\tCtrl+A\\0\"\\\n  \"Jel\\303\\266lje ki a m\\303\\241soland\\303\\263 r\\303\\251szt Ctrl+Bal eg\\303\\251rgombbal\\0\"\\\n  \"Kijel\\303\\266l\\303\\251s:\\0\"\\\n  \"F\\303\\241jl k\\303\\274ld\\303\\251se &e-mail-ben\\0\"\\\n  \"Ford\\303\\255tott keres\\303\\251s parancs\\303\\241nak be\\303\\241ll\\303\\255t\\303\\241sa\\0\"\\\n  \"K\\303\\266nyvjelz\\305\\221k mutat\\303\\241sa\\0\"\\\n  \"Folyamatos n\\303\\251zet\\0\"\\\n  \"Eszk\\303\\266zt\\303\\241r\\0\"\\\n  \"Kedvencek megjelen\\303\\255t\\303\\251se\\0\"\\\n  \"Leggyakrabban olvasott f\\303\\241jlok mutat\\303\\241sa\\0\"\\\n  \"Dokumentumba \\303\\241gyazott k\\303\\266nyvjelz\\305\\221k mutat\\303\\241sa\\0\"\\\n  \"Egy oldalas\\0\"\\\n  \"Sajn\\303\\241ljuk, v\\303\\241ratlan hiba t\\303\\266rt\\303\\251nt!\\n\\nK\\303\\251rj\\303\\274k nyomja meg a M\\303\\251gse gombot, ha seg\\303\\255teni szeretne nek\\303\\274nk a hiba kijav\\303\\255t\\303\\241s\\303\\241ban.\\0\"\\\n  \"A '%s' forr\\303\\241sf\\303\\241jlban nincs szinkroniz\\303\\241ci\\303\\263s hely\\0\"\\\n  \"T\\303\\241rgy:\\0\"\\\n  \"A SumatraPDF be\\303\\241ll\\303\\255t\\303\\241sai\\0\"\\\n  \"SumatraPDF friss\\303\\255t\\303\\251s\\0\"\\\n  \"SumatraPDF m\\305\\261k\\303\\266d\\303\\251se le\\303\\241llt\\0\"\\\n  \"A SumatraPDF az alap\\303\\251rtelmezett PDF-olvas\\303\\263\\0\"\\\n  \"Mostant\\303\\263l a SumatraPDF az alap\\303\\251rtelmezett PDF-olvas\\303\\263ja\\0\"\\\n  \"Nem siker\\303\\274lt megnyitni a szinkroniz\\303\\241ci\\303\\263s f\\303\\241jlt\\0\"\\\n  \"C\\303\\255mk\\303\\251zett PDF\\0\"\\\n  \"Sz\\303\\266veges f\\303\\241jlok\\0\"\\\n  \"Ez a f\\303\\241jl nem t\\303\\241mogatott funkci\\303\\263kat (%s) tartalmaz \\303\\251s lehet, hogy nem pontosan ker\\303\\274l megjelen\\303\\255t\\303\\251sre\\0\"\\\n  \"C\\303\\255m:\\0\"\\\n  \"Ismeretlen forr\\303\\241sf\\303\\241jl (%s)\\0\"\\\n  \"F\\303\\274lek haszn\\303\\241lata\\0\"\\\n  \"Alap\\303\\251rtelmezett n\\303\\251zet\\0\"\\\n  \"&Weboldal\\0\"\\\n  \"Figyelmeztet\\303\\251s\\0\"\\\n  \"XPS f\\303\\241jlok\\0\"\\\n  \"\\303\\226nn\\303\\251l a legfrissebb verzi\\303\\263 van telep\\303\\255tve.\\0\"\\\n  \"Jelenlegi verzi\\303\\263: %s\\0\"\\\n  \"Be\\303\\241ll\\303\\255t\\0\"\\\n  \"Nagy\\303\\255t\\303\\241s\\0\"\\\n  \"Kicsiny\\303\\255t\\303\\251s\\0\"\\\n  \"Nagy\\303\\255t\\303\\241s m\\303\\251rt\\303\\251ke\\0\"\\\n  \"[a file megv\\303\\241ltozott; friss\\303\\255t\\303\\251s] %s\\0\"\\\n  \"Sz\\303\\266veg v\\303\\241g\\303\\263lapra\\0\"\\\n  \"Nyomtat\\303\\241s\\0\";\n\nconst char * gTranslations_id = \n  \"&Tentang\\0\"\\\n  \"&Ukuran Sebenarnya\\tCtrl+1\\0\"\\\n  \"&Pengaturan Lanjutan...\\0\"\\\n  \"&Semua halaman yang dipilih\\0\"\\\n  \"Kembali\\tAlt+<-\\0\"\\\n  \"Tampilan &Buku\\tCtrl+8\\0\"\\\n  \"&Tutup\\tCtrl+W\\0\"\\\n  \"&Salin Seleksi\\0\"\\\n  \"Salin Hasil Seleksi\\tCtrl+C\\0\"\\\n  \"&Jangan ulangi pertanyaan ini\\0\"\\\n  \"&Hanya halaman genap\\0\"\\\n  \"Meng&hadap\\tCtrl+7\\0\"\\\n  \"&Berkas\\0\"\\\n  \"&Cari:\\0\"\\\n  \"Halaman Pertama\\tHome\\0\"\\\n  \"&Sesuaikan halaman ke area cetakan\\0\"\\\n  \"&Pergi ke\\0\"\\\n  \"&Pergi ke halaman:\\0\"\\\n  \"Bantua&n\\0\"\\\n  \"Halaman Terakhir\\tEnd\\0\"\\\n  \"&Pembesaran\\0\"\\\n  \"\\0\"\\\n  \"&Samakan ukuran\\0\"\\\n  \"Halaman Berikutnya\\t->\\0\"\\\n  \"&Tidak\\0\"\\\n  \"&Tidak, terima kasih\\0\"\\\n  \"Hanya halaman ganji&l\\0\"\\\n  \"Buka D&okumen\\0\"\\\n  \"&Buka...\\tCtrl+O\\0\"\\\n  \"&Pilihan...\\0\"\\\n  \"&Kata sandi:\\0\"\\\n  \"&Pin Dokumen\\0\"\\\n  \"Halaman Sebelumnya\\t<-\\0\"\\\n  \"&Cetak...\\0\"\\\n  \"&Cetak...\\tCtrl+P\\0\"\\\n  \"&Cetak... (ditolak)\\0\"\\\n  \"&Ingat kata sandi untuk dokumen ini\\0\"\\\n  \"&Ingat pengaturan ini untuk setiap dokumen\\0\"\\\n  \"&Hapus Dokumen\\0\"\\\n  \"Si&mpan Sebagai...\\0\"\\\n  \"&Simpan Sebagai...\\tCtrl+S\\0\"\\\n  \"&Pengaturan\\0\"\\\n  \"&Perkecil halaman ke area cetakan (jika dibutuhkan)\\0\"\\\n  \"Halaman &Tunggal\\tCtrl+6\\0\"\\\n  \"&Lewatkan versi ini\\0\"\\\n  \"&Gunakan ukuran halaman sebenarnya\\0\"\\\n  \"&Tampilan\\0\"\\\n  \"&Jendela\\0\"\\\n  \"&Ya\\0\"\\\n  \"&Ukuran\\0\"\\\n  \"(dari %d)\\0\"\\\n  \"(halaman %s)\\0\"\\\n  \"Tentang SumatraPDF\\0\"\\\n  \"Tambah Favorit\\0\"\\\n  \"Tambah Halaman %s Ke Favorit\\0\"\\\n  \"Tambah Halaman %s Ke Favorit Dengan Nama:\\0\"\\\n  \"Tambah Ke Favorit\\0\"\\\n  \"Lanjutan\\0\"\\\n  \"Semua Berkas\\0\"\\\n  \"Semua dokumen yang didukung\\0\"\\\n  \"Aplikasi:\\0\"\\\n  \"Asosiasikan dengan berkas PDF?\\0\"\\\n  \"Lampiran: %s\\0\"\\\n  \"Pencipta:\\0\"\\\n  \"Otomatis\\0\"\\\n  \"Periksa &pembaruan secara otomatis\\0\"\\\n  \"Tampilan Buku\\0\"\\\n  \"&Markah\\tF12\\0\"\\\n  \"Jalan Pintas Markah\\0\"\\\n  \"Jalan pintas markah ke halaman %s dari %s\\0\"\\\n  \"Markah\\0\"\\\n  \"Byte\\0\"\\\n  \"Dokumen CHM\\0\"\\\n  \"Tidak bisa terhubung ke Internet (kesalahan %#x).\\0\"\\\n  \"Batalkan\\0\"\\\n  \"Tidak dapat mencetak berkas ini\\0\"\\\n  \"Tidak dapat memulai perintah pencarian terbalik. Harap periksa baris perintah di bagian pengaturan.\\0\"\\\n  \"Ubah Bahasa (Change Language)\\0\"\\\n  \"&Periksa Versi Terbaru\\0\"\\\n  \"Buku Komik\\0\"\\\n  \"Kompabilitas\\0\"\\\n  \"Bersambung\\0\"\\\n  \"Tampilan Buku Bersambung\\0\"\\\n  \"Halaman Berhadapan Tersambung\\0\"\\\n  \"Bantu Alihbahasa\\0\"\\\n  \"Salin &Gambar\\0\"\\\n  \"Salin Alamat &Tautan\\0\"\\\n  \"Salin &Komentar\\0\"\\\n  \"Menyalin teks ditolak (menyalin sebagai gambar saja)\\0\"\\\n  \"Hak Cipta\\0\"\\\n  \"Gagal mendapatkan properti Pencetak\\0\"\\\n  \"Gagal memulai pencetak\\0\"\\\n  \"Gagal menampilkan halaman\\0\"\\\n  \"Dibuat:\\0\"\\\n  \"Berkas ini\\0\"\\\n  \"Posisi kursor:\\0\"\\\n  \"&Pembesaran Buatan\\tCtrl+Y\\0\"\\\n  \"Tampilan &Standar\\0\"\\\n  \"Pembesaran &Standar\\0\"\\\n  \"Pembaca PDF utama tidak dapat diubah dalam mode portabel\\0\"\\\n  \"Izin Ditolak:\\0\"\\\n  \"Dokumen DjVu\\0\"\\\n  \"Properti Dokumen\\0\"\\\n  \"Unduh\\0\"\\\n  \"&Keluar\\tCtrl+Q\\0\"\\\n  \"Dokumen EPUB\\0\"\\\n  \"Masukkan kata sandi\\0\"\\\n  \"Masukkan kata sandi untuk %s\\0\"\\\n  \"Masukkan baris perintah untuk dijalankan ketika Anda mengklik dua kali pada dokumen PDF:\\0\"\\\n  \"Kesalahan memuat %s\\0\"\\\n  \"F&avorit\\0\"\\\n  \"Berikutnya\\tAlt+->\\0\"\\\n  \"Selayar Penuh\\tCtrl+Shift+L\\0\"\\\n  \"Dua Halaman\\0\"\\\n  \"Gagal mengganti nama berkas!\\0\"\\\n  \"Gagal menyimpan berkas\\0\"\\\n  \"Tampilan Web Cepat\\0\"\\\n  \"Favorit\\0\"\\\n  \"Dokumen FictionBook\\0\"\\\n  \"File %s tak ditemukan\\0\"\\\n  \"Ukuran Berkas:\\0\"\\\n  \"Berkas:\\0\"\\\n  \"Temukan...\\tCtrl+F\\0\"\\\n  \"Cari\\0\"\\\n  \"Temukan Selanjutnya\\0\"\\\n  \"Temukan Sebelumnya\\0\"\\\n  \"Temukan:\\0\"\\\n  \"Sesuaikan Dengan &Konten\\tCtrl+3\\0\"\\\n  \"Sesuaikan Dengan &Halaman\\tCtrl+0\\0\"\\\n  \"Sesuaikan Dengan &Lebar\\tCtrl+2\\0\"\\\n  \"Sesuaikan Dengan Konten\\0\"\\\n  \"Sesuaikan Dengan Halaman\\0\"\\\n  \"Sesuaikan Dengan Lebar\\0\"\\\n  \"Sesuaikan Lebar Dan Tampilkan Halaman Secara Kontinu\\0\"\\\n  \"Sesuaikan Halaman Tunggal\\0\"\\\n  \"Huruf:\\0\"\\\n  \"Memformat buku... %d halaman\\0\"\\\n  \"Teks ditemukan pada halaman %s\\0\"\\\n  \"Teks ditemukan pada halaman %s (lagi)\\0\"\\\n  \"Yang Sering Dibaca\\0\"\\\n  \"\\0\"\\\n  \"Pergi ke halaman\\0\"\\\n  \"Sembunyikan Yang Sering Dibaca\\0\"\\\n  \"Tips : Gunakan tombol F3 untuk mengulangi pencarian\\0\"\\\n  \"Berkas Gambar (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Jadikan SumatraPDF sebagai aplikasi standar untuk membuka berkas PDF?\\0\"\\\n  \"Jadikan SumatraPDF sebagai pembaca PDF utama\\0\"\\\n  \"Mode komik\\0\"\\\n  \"Cocokkan Ukuran Huruf\\0\"\\\n  \"Dokumen Mobi\\0\"\\\n  \"Termodifikasi:\\0\"\\\n  \"Versi baru %s telah tersedia. Unduh versi baru ini?\\0\"\\\n  \"Halaman Berikutnya\\0\"\\\n  \"Tidak ditemukan kesamaan\\0\"\\\n  \"Tidak ditemukan hasil pada baris %u di dalam berkas %s\\0\"\\\n  \"Tidak ada berkas sinkronisasi ditemukan\\0\"\\\n  \"Tidak ada informasi sinkronisasi pada lokasi ini\\0\"\\\n  \"Banyak Halaman:\\0\"\\\n  \"\\0\"\\\n  \"Buka\\0\"\\\n  \"Buka di PDF-&XChange\\0\"\\\n  \"Buka Dokumen...\\0\"\\\n  \"Buka di %s\\0\"\\\n  \"Buka di &Adobe Reader\\0\"\\\n  \"Buka di &Foxit Reader\\0\"\\\n  \"Buka dengan Microsoft HTML Help\\0\"\\\n  \"Buka dengan Microsoft XPS-Viewer\\0\"\\\n  \"P&roperti\\0\"\\\n  \"P&roperti\\tCtrl+D\\0\"\\\n  \"Dokumen PDF\\0\"\\\n  \"Optimisasi PDF\\0\"\\\n  \"Pembuat PDF:\\0\"\\\n  \"Versi PDF:\\0\"\\\n  \"Dokumen PDF\\0\"\\\n  \"Halaman...\\tCtrl+G\\0\"\\\n  \"Halaman %s\\0\"\\\n  \"Ukuran Halaman:\\0\"\\\n  \"Halaman %u tidak tersedia\\0\"\\\n  \"Mengukur halaman\\0\"\\\n  \"Halaman:\\0\"\\\n  \"Dokumen PalmDoc\\0\"\\\n  \"Harap tunggu - sedang proses rendering...\\0\"\\\n  \"Dokumen Postscript\\0\"\\\n  \"Pr&esentasi\\tF5\\0\"\\\n  \"Halaman Sebelumnya\\0\"\\\n  \"Cetak\\0\"\\\n  \"Rentang cetakan\\0\"\\\n  \"Printer dengan nama tersebut tidak ada\\0\"\\\n  \"Dalam proses mencetak\\0\"\\\n  \"Sedang dalam proses mencetak. Batalkan dan keluar?\\0\"\\\n  \"Sedang dalam proses mencetak. Batalkan dan ulangi lagi?\\0\"\\\n  \"Mencetak halaman %d dari %d...\\0\"\\\n  \"Masalah pencetakan.\\0\"\\\n  \"&Ganti Nama...\\tF2\\0\"\\\n  \"Ingat &berkas yang pernah dibuka\\0\"\\\n  \"Hapus Dari Favorit\\0\"\\\n  \"Hapus Halaman %s Dari Favorit\\0\"\\\n  \"Ganti Nama Menjadi\\0\"\\\n  \"Putar Ke Kiri\\tCtrl+Shift+-\\0\"\\\n  \"Putar Ke Kanan\\tCtrl+Shift++\\0\"\\\n  \"Simpan Sebagai\\0\"\\\n  \"Simpan &Jalan Pintas...\\tCtrl+Shift+S\\0\"\\\n  \"Sedang mencari %d dari %d\\0\"\\\n  \"Pilih Semu&a\\0\"\\\n  \"Pilih Semu&a\\tCtrl+A\\0\"\\\n  \"Pilih konten dengan tombol Ctrl+tombol kiri mouse\\0\"\\\n  \"Seleksi:\\0\"\\\n  \"Kirim Via &Email...\\0\"\\\n  \"Tetapkan baris perintah pencarian terbalik\\0\"\\\n  \"Tampilkan &Markah\\0\"\\\n  \"Tampilkan Halaman Secara &Kontinu\\0\"\\\n  \"Tampilkan &Toolbar\\0\"\\\n  \"Tampilkan Favorit\\0\"\\\n  \"Tampilkan Yang Sering Dibaca\\0\"\\\n  \"Tampilkan kolom &markah jika tersedia\\0\"\\\n  \"Halaman Tunggal\\0\"\\\n  \"Maaf, ini seharusnya tidak terjadi!\\n\\nHarap tekan 'Batalkan', jika Anda ingin membantu kami membetulkan penyebab kegagalan ini.\\0\"\\\n  \"Berkas asal %s tidak mempunyai titik sinkronisasi\\0\"\\\n  \"Perihal:\\0\"\\\n  \"Pengaturan SumatraPDF\\0\"\\\n  \"Pembaruan SumatraPDF\\0\"\\\n  \"SumatraPDF berhenti berfungsi\\0\"\\\n  \"SumatraPDF adalah pembaca berkas PDF utama Anda\\0\"\\\n  \"SumatraPDF sekarang telah menjadi pembaca berkas PDF utama Anda\\0\"\\\n  \"Berkas sinkronisasi tidak dapat dibuka\\0\"\\\n  \"PDF Terlabeli\\0\"\\\n  \"Dokumen Teks\\0\"\\\n  \"Dokumen ini menggunakan fitur yang tidak didukung (%s) dan memungkinkan untuk tidak dimuat secara benar.\\0\"\\\n  \"Judul:\\0\"\\\n  \"Berkas asal (%s) tidak diketahui\\0\"\\\n  \"Gunakan &tab\\0\"\\\n  \"Tampilan\\0\"\\\n  \"&Kunjungi Situs\\0\"\\\n  \"Peringatan\\0\"\\\n  \"Dokumen XPS\\0\"\\\n  \"Anda telah memiliki versi terbaru\\0\"\\\n  \"Anda memiliki versi %s\\0\"\\\n  \"Sesuaikan\\0\"\\\n  \"Perbesar\\0\"\\\n  \"Perkecil\\0\"\\\n  \"Faktor pembesaran\\0\"\\\n  \"[Perubahan terdeteksi; muat ulang] %s\\0\"\\\n  \"menyalin teks\\0\"\\\n  \"mencetak dokumen\\0\";\n\nconst char * gTranslations_ga = \n  \"Maidir le\\0\"\\\n  \"&F\\303\\255ormh\\303\\251id\\tCtrl+1\\0\"\\\n  \"&Ardroghanna...\\0\"\\\n  \"&Gach leathanach roghnaithe\\0\"\\\n  \"&Siar\\tAlt+Saighead Ar Cl\\303\\251\\0\"\\\n  \"&Leabhar-amharc\\tCtrl+8\\0\"\\\n  \"&D\\303\\272n\\tCtrl+W\\0\"\\\n  \"&Macasamhlaigh an Roghn\\303\\272ch\\303\\241n\\0\"\\\n  \"&Macasamhlaigh an Roghn\\303\\272ch\\303\\241n\\tCtrl+C\\0\"\\\n  \"&N\\303\\241 fiafraigh dom ar\\303\\255s\\0\"\\\n  \"&Leathanaigh cothromacha amh\\303\\241in\\0\"\\\n  \"&Dh\\303\\241 Leathanach\\tCtrl+7\\0\"\\\n  \"&Comhad\\0\"\\\n  \"&Aimsigh c\\303\\251ard:\\0\"\\\n  \"An Ch\\303\\251ad Leathanach\\tHome\\0\"\\\n  \"&Oiri\\303\\272naigh leathanaigh go limist\\303\\251ar inchl\\303\\263bhuailte\\0\"\\\n  \"&T\\303\\251igh Chuig\\0\"\\\n  \"&T\\303\\251igh chuig lch:\\0\"\\\n  \"&Cabhair\\0\"\\\n  \"&An Leathanach Deiridh\\tEnd\\0\"\\\n  \"For&mh\\303\\251ad\\303\\272:\\0\"\\\n  \"L\\303\\241&mhleabhar\\0\"\\\n  \"&Comhoiri\\303\\272naigh an c\\303\\241s\\0\"\\\n  \"&Leathanach Ar Aghaidh\\tSaighead ar deis\\0\"\\\n  \"&N\\303\\241 d\\303\\251an\\0\"\\\n  \"&N\\303\\255l, go raibh maith agat\\0\"\\\n  \"&Corr-leathanaigh amh\\303\\241in\\0\"\\\n  \"&Oscail C\\303\\241ip\\303\\251is\\0\"\\\n  \"&Oscail...\\tCtrl+O\\0\"\\\n  \"&Roghanna...\\0\"\\\n  \"&Focal faire:\\0\"\\\n  \"&Greamaigh an ch\\303\\241ip\\303\\251is le biorr\\303\\241n\\0\"\\\n  \"Leathanach Roimhe\\tSaighead ar cl\\303\\251\\0\"\\\n  \"&Cl\\303\\263bhuail...\\0\"\\\n  \"&Cl\\303\\263bhuail\\tCtrl+P\\0\"\\\n  \"&Cl\\303\\263bhualadh... (di\\303\\272ltaithe)\\0\"\\\n  \"&Cuimhnigh ar an bhfocal faire don ch\\303\\241ip\\303\\251is seo\\0\"\\\n  \"Cuimhnigh ar na socruithe seo do gach c\\303\\241ip\\303\\251is\\0\"\\\n  \"&Bain c\\303\\241ip\\303\\251is\\0\"\\\n  \"&Cuir i dtaisce mar...\\0\"\\\n  \"Cuir i dtaisce mar...\\tCtrl+S\\0\"\\\n  \"&Socruithe\\0\"\\\n  \"&Crap na leathanaigh go limist\\303\\251ar inchl\\303\\263bhuailte (m\\303\\241s g\\303\\241)\\0\"\\\n  \"&Leathanach amh\\303\\241in\\tCtrl+6\\0\"\\\n  \"&N\\303\\241 bac leis an leagan seo\\0\"\\\n  \"&Bain feidhm as m\\303\\251ideanna bunaidh an leathanaigh\\0\"\\\n  \"&Amharc\\0\"\\\n  \"&Fuinneog\\0\"\\\n  \"&D\\303\\251an sin\\0\"\\\n  \"&Formh\\303\\251ad\\303\\272\\0\"\\\n  \"(as %d)\\0\"\\\n  \"(leathanach a %s)\\0\"\\\n  \"Maidir le SumatraPDF\\0\"\\\n  \"Cuir cean\\303\\241n leis\\0\"\\\n  \"Cuir leathanach a %s le na cean\\303\\241in\\0\"\\\n  \"Cuir leathanach a %s le na cean\\303\\241in le ainm (roghnach):\\0\"\\\n  \"Cuir leis na cean\\303\\241in\\0\"\\\n  \"Ardroghanna\\0\"\\\n  \"Gach comhad\\0\"\\\n  \"Gach c\\303\\241ip\\303\\251is inl\\303\\251ite\\0\"\\\n  \"Feidhmchl\\303\\241r:\\0\"\\\n  \"Comhthiomsaigh le comhaid PDF?\\0\"\\\n  \"Ceangalt\\303\\241n: %s\\0\"\\\n  \"\\303\\232dar:\\0\"\\\n  \"Uathoibr\\303\\255och\\0\"\\\n  \"Lorg nuashonruithe go huathoibr\\303\\255och\\0\"\\\n  \"Leabhar-amharc\\0\"\\\n  \"Cean\\303\\241in\\tF12\\0\"\\\n  \"D\\303\\251an cean\\303\\241in d'aicearra\\303\\255\\0\"\\\n  \"Cruthaigh aicearra chuig lch %s as %s\\0\"\\\n  \"Cean\\303\\241in\\0\"\\\n  \"Bearta\\0\"\\\n  \"C\\303\\241ip\\303\\251is\\303\\255 CHM\\0\"\\\n  \"N\\303\\255 f\\303\\251idir ceangailt leis an idirl\\303\\255on (bot\\303\\272n %#x).\\0\"\\\n  \"Cealaigh\\0\"\\\n  \"N\\303\\255 f\\303\\251idir an comhad seo a chl\\303\\263bhualadh\\0\"\\\n  \"N\\303\\255 f\\303\\251idir ord\\303\\272 cuardaigh aisiompaithe a thos\\303\\272. Dearbh\\303\\241il l\\303\\255ne na n-orduithe sna socruithe.\\0\"\\\n  \"Athraigh an Teanga (Change Language)\\0\"\\\n  \"Lorg Nuashonruithe\\0\"\\\n  \"Greann\\303\\241in\\0\"\\\n  \"Comhoiri\\303\\272nacht\\0\"\\\n  \"Amharc lean\\303\\272nach\\0\"\\\n  \"Leabhar-amharc lean\\303\\272nach\\0\"\\\n  \"Dh\\303\\241 leathanach ar lean\\303\\272int\\0\"\\\n  \"Aistrigh \\303\\251 seo\\0\"\\\n  \"Macasamhlaigh an &\\303\\215omh\\303\\241\\0\"\\\n  \"Macasamhlaigh seoladh an naisc\\0\"\\\n  \"Macasamhlaigh an n\\303\\263ta tr\\303\\241chta\\0\"\\\n  \"N\\303\\255orbh fh\\303\\251idir t\\303\\251acs a mhacasamhl\\303\\272 (macasamhl\\303\\272 mar \\303\\255omh\\303\\241 amh\\303\\241in)\\0\"\\\n  \"C\\303\\263ipcheart:\\0\"\\\n  \"N\\303\\255orbh fh\\303\\251idir air\\303\\255onna an chl\\303\\263ire a fh\\303\\241il\\0\"\\\n  \"N\\303\\255orbh fh\\303\\251idir an cl\\303\\263ire a th\\303\\272s\\303\\272\\0\"\\\n  \"N\\303\\255orbh fh\\303\\251idir an leathanach a ch\\303\\263iri\\303\\272\\0\"\\\n  \"Cruthaithe:\\0\"\\\n  \"Comhad reatha\\0\"\\\n  \"Su\\303\\255omh an ch\\303\\272rs\\303\\263ra:\\0\"\\\n  \"Formh\\303\\251ad\\303\\272 saincheaptha...\\tCtrl+Y\\0\"\\\n  \"&Leagan amach r\\303\\251amhshocraithe:\\0\"\\\n  \"Formh\\303\\251ad\\303\\272 r\\303\\251amhshocraithe:\\0\"\\\n  \"N\\303\\255 f\\303\\251idir an l\\303\\251itheoir PDF r\\303\\251amhshocraithe a athr\\303\\272 sa mhodh soghluaiste\\0\"\\\n  \"Ceadanna di\\303\\272ltaithe:\\0\"\\\n  \"C\\303\\241ip\\303\\251is\\303\\255 DjVu\\0\"\\\n  \"Air\\303\\255onna na c\\303\\241ip\\303\\251ise\\0\"\\\n  \"\\303\\215osluchtaigh\\0\"\\\n  \"Scoir\\tCtrl+Q\\0\"\\\n  \"C\\303\\241ip\\303\\251is\\303\\255 EPUB\\0\"\\\n  \"Cuir isteach focal faire\\0\"\\\n  \"Cuir isteach focal faire le haghaidh %s\\0\"\\\n  \"Cuir isteach l\\303\\255ne na n-orduithe at\\303\\241 le gairm nuair a bhr\\303\\272ann t\\303\\272 faoi dh\\303\\263 ar ch\\303\\241ip\\303\\251is PDF:\\0\"\\\n  \"Tharla bot\\303\\272n ag lucht\\303\\272 %s\\0\"\\\n  \"Ce&an\\303\\241in\\0\"\\\n  \"Ar aghaidh\\tAlt+Saighead Ar Deis\\0\"\\\n  \"L\\303\\241nsc\\303\\241ile\\303\\241n\\tCtrl+Shift+L\\0\"\\\n  \"Dh\\303\\241 Leathanach\\0\"\\\n  \"Theip ar athainmni\\303\\272 an chomhaid!\\0\"\\\n  \"Theip air comhad a chuir i dtaisce\\0\"\\\n  \"Gr\\303\\251as\\303\\241in dearcadh go tapa\\0\"\\\n  \"Cean\\303\\241in\\0\"\\\n  \"C\\303\\241ip\\303\\251is\\303\\255 FictionBook\\0\"\\\n  \"N\\303\\203or aims\\303\\203odh an comhad %s\\0\"\\\n  \"M\\303\\251id an chomhaid:\\0\"\\\n  \"Comhad:\\0\"\\\n  \"Aimsigh...\\tCtrl+F\\0\"\\\n  \"Aimsigh\\0\"\\\n  \"Aimsigh Ar Aghaidh\\0\"\\\n  \"Aimsigh Roimhe\\0\"\\\n  \"Aimsigh:\\0\"\\\n  \"Oiri\\303\\272naigh an t-inneachar\\tCtrl+3\\0\"\\\n  \"Oiri\\303\\272naigh don Lch\\tCtrl+0\\0\"\\\n  \"Oiri\\303\\272naigh don Leithead\\tCtrl+2\\0\"\\\n  \"Oiri\\303\\272naigh an t-inneachar\\0\"\\\n  \"Oiri\\303\\272naigh don Lch\\0\"\\\n  \"Oiri\\303\\272naigh don Leithead\\0\"\\\n  \"Oiri\\303\\272naigh don leithead & taispe\\303\\241in leathanaigh go lean\\303\\272nach\\0\"\\\n  \"Oiri\\303\\272naigh leathanach amh\\303\\241in\\0\"\\\n  \"Cl\\303\\263fhoirne:\\0\"\\\n  \"Ag form\\303\\241idi\\303\\272 an leabhair... %d leathanach\\0\"\\\n  \"Aims\\303\\255odh t\\303\\251acs ag lch a %s\\0\"\\\n  \"Aims\\303\\255odh t\\303\\251acs ag lch a %s (ar\\303\\255s)\\0\"\\\n  \"L\\303\\251ite Go Minic\\0\"\\\n  \"\\0\"\\\n  \"T\\303\\251igh chuig lch\\0\"\\\n  \"Folaigh cinn l\\303\\251ite go minic\\0\"\\\n  \"Leid: Bain feidhm as an gcnaipe F3 chun nithe a aimsi\\303\\272 ar\\303\\255s\\0\"\\\n  \"Comhaid \\303\\255omh\\303\\241nna (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"B\\303\\255odh SumatraPDF mar an l\\303\\251itheoir PDF r\\303\\251amhshocruithe?\\0\"\\\n  \"B\\303\\255odh SumatraPDF mar an l\\303\\251itheoir PDF r\\303\\251amhshocruithe\\0\"\\\n  \"M\\303\\263d Man&ga\\0\"\\\n  \"Comhoiri\\303\\272naigh an c\\303\\241s\\0\"\\\n  \"C\\303\\241ip\\303\\251is\\303\\255 Mobi\\0\"\\\n  \"Mionathraithe:\\0\"\\\n  \"T\\303\\241 an leagan nua %s ar f\\303\\241il. \\303\\215osluchtaigh an leagan nua?\\0\"\\\n  \"Leathanach Ar Aghaidh\\0\"\\\n  \"N\\303\\255or aims\\303\\255odh comhionanna\\0\"\\\n  \"N\\303\\255or aims\\303\\255odh toradh idir l\\303\\255ne %u sa chomhad %s\\0\"\\\n  \"N\\303\\255or aims\\303\\255odh comhad comhaimseartha\\0\"\\\n  \"N\\303\\255l faisn\\303\\251is chomhaimseartha ag an su\\303\\255omh seo\\0\"\\\n  \"L\\303\\255on na leathanaigh:\\0\"\\\n  \"T\\303\\241 go maith\\0\"\\\n  \"Oscail\\0\"\\\n  \"Oscail &i PDF-XChange\\0\"\\\n  \"Oscail c\\303\\241ip\\303\\251is...\\0\"\\\n  \"Oscail i %s\\0\"\\\n  \"Oscail in &Adobe Reader\\0\"\\\n  \"Oscail i &Foxit Reader\\0\"\\\n  \"Oscail i &Microsoft HTML Help\\0\"\\\n  \"Oscail i &Microsoft XPS-Viewer\\0\"\\\n  \"Ai&r\\303\\255onna\\0\"\\\n  \"Ai&r\\303\\255onna\\tCtrl+D\\0\"\\\n  \"C\\303\\241ip\\303\\251is PDF\\0\"\\\n  \"Optimisations PDF\\0\"\\\n  \"D\\303\\251antas\\303\\263ir PDF:\\0\"\\\n  \"Leagan PDF:\\0\"\\\n  \"C\\303\\241ip\\303\\251is\\303\\255 PDF\\0\"\\\n  \"Leathanach...\\tCtrl+G\\0\"\\\n  \"Leathanach %s\\0\"\\\n  \"M\\303\\251id an leathanaigh:\\0\"\\\n  \"N\\303\\255l an uimhir leathanaigh %u ann\\0\"\\\n  \"Sc\\303\\241l\\303\\272 leathanaigh\\0\"\\\n  \"Leathanach:\\0\"\\\n  \"C\\303\\241ip\\303\\251is\\303\\255 PalmDoc\\0\"\\\n  \"Fan le do thoil - t\\303\\241 s\\303\\251 \\303\\241 ch\\303\\263iri\\303\\272...\\0\"\\\n  \"C\\303\\241ip\\303\\251is\\303\\255 Postscript\\0\"\\\n  \"Cur i l\\303\\241thair\\tCtrl+L\\0\"\\\n  \"Leathanach Roimhe\\0\"\\\n  \"Cl\\303\\263bhuail\\0\"\\\n  \"Raon cl\\303\\263bhuailte\\0\"\\\n  \"N\\303\\255l cl\\303\\263ire leis an ainm sin ann\\0\"\\\n  \"Cl\\303\\263bhualadh ar si\\303\\272l.\\0\"\\\n  \"T\\303\\241 cl\\303\\263bhuladh f\\303\\263s ar si\\303\\272l. Tobscoir agus d\\303\\272n?\\0\"\\\n  \"T\\303\\241 s\\303\\251 f\\303\\263s ag cl\\303\\263bhualadh. Tobscoir agus tosaigh ar\\303\\255s?\\0\"\\\n  \"Ag cl\\303\\263bhualadh leathanach a %d as %d...\\0\"\\\n  \"Fadhb chl\\303\\263bhuailte.\\0\"\\\n  \"Athainmnigh...\\tF2\\0\"\\\n  \"Cuimhnigh ar chomhaid &oscailte\\0\"\\\n  \"Bain \\303\\263 na cean\\303\\241in\\0\"\\\n  \"Bain leathanach a %s \\303\\263 na cean\\303\\241in\\0\"\\\n  \"Athainmnigh chuig\\0\"\\\n  \"Rothlaigh tuathalach\\tCtrl+Shift+-\\0\"\\\n  \"Rothlaigh deiseal\\tCtrl+Shift++\\0\"\\\n  \"Cuir i dtaisce mar\\0\"\\\n  \"Cuir an t-aicearra i dtaisce...\\tCtrl+Shift+S\\0\"\\\n  \"Ag cuardach %d as %d...\\0\"\\\n  \"Roghnaigh Uile\\0\"\\\n  \"Roghnaigh Uile\\tCtrl+A\\0\"\\\n  \"Roghnaigh inneachar le Ctrl+an cnaipe luch\\303\\263ige ar chl\\303\\251\\0\"\\\n  \"Roghn\\303\\272ch\\303\\241n\\0\"\\\n  \"Seol i r\\303\\255omhphost...\\0\"\\\n  \"Socruigh l\\303\\255ne na n-orduithe cuardaigh aisiompaithe\\0\"\\\n  \"Lea&bharmharcanna a taispe\\303\\241int\\0\"\\\n  \"Teasp\\303\\241in na leathanaigh go lean\\303\\272nach\\0\"\\\n  \"Taispe\\303\\241in an Barra Uirlis\\303\\255\\0\"\\\n  \"Taispe\\303\\241in Cean\\303\\241in\\0\"\\\n  \"Taispe\\303\\241in cinn l\\303\\251ite go minic\\0\"\\\n  \"Taispe\\303\\241in taobh-bharra na gcean\\303\\241n nuair at\\303\\241 s\\303\\251 ar f\\303\\241il\\0\"\\\n  \"Leathanach Amh\\303\\241in\\0\"\\\n  \"Faraor, n\\303\\255or ch\\303\\263ir go dtarl\\303\\263dh sin!\\n\\nBr\\303\\272igh 'Cealaigh' le do thoil, m\\303\\241s mian leat cuidi\\303\\272 linn \\303\\272dar an chliste seo a dheisi\\303\\272.\\0\"\\\n  \"N\\303\\255l l\\303\\241thair comhaimsearatha ag an gcomhad foinse %s\\0\"\\\n  \"\\303\\201bhar:\\0\"\\\n  \"Roghanna SumatraPDF\\0\"\\\n  \"Nuashonr\\303\\272 do ShumatraPDF\\0\"\\\n  \"Chlis SumatraPDF\\0\"\\\n  \"Is \\303\\251 SumatraPDF do l\\303\\251itheoir PDF r\\303\\251amhshocraithe\\0\"\\\n  \"Ba ch\\303\\263ir go mbeadh SumatraPDF mar an l\\303\\251itheoir PDF r\\303\\251amhshocraithe agat\\0\"\\\n  \"N\\303\\255 f\\303\\251idir an comhad comhaimseartha a oscailt\\0\"\\\n  \"PDF form\\303\\241id chlibe\\303\\241ilte\\0\"\\\n  \"C\\303\\241ip\\303\\251is\\303\\255 t\\303\\251acs\\0\"\\\n  \"Baineann an ch\\303\\241ip\\303\\251is seo feidhm as gn\\303\\251ithe (%s) nach dtugtar taca\\303\\255ocht d\\303\\263ibh agus b'fh\\303\\251idir nach nd\\303\\251anfar iad a thaispe\\303\\241int i gceart\\0\"\\\n  \"Teideal:\\0\"\\\n  \"Comhad foinse anaithnid (%s)\\0\"\\\n  \"Bain feidhm as &cluais\\303\\255n\\303\\255\\0\"\\\n  \"Amharc\\0\"\\\n  \"Tabhair cuairt ar an su\\303\\255omh idirl\\303\\255on\\0\"\\\n  \"Rabhadh\\0\"\\\n  \"C\\303\\241ip\\303\\251is\\303\\255 XPS\\0\"\\\n  \"T\\303\\241 an leagan is \\303\\272ire agat.\\0\"\\\n  \"T\\303\\241 leagan %s agat\\0\"\\\n  \"Formh\\303\\251ad\\303\\272\\0\"\\\n  \"Gluais isteach\\0\"\\\n  \"Gluais amach\\0\"\\\n  \"Facht\\303\\263ir formh\\303\\251adaithe\\0\"\\\n  \"[Athruithe braite; ag athnuachan] %s\\0\"\\\n  \"ag macasamhl\\303\\272 an t\\303\\251acs\\0\"\\\n  \"ag cl\\303\\263bhualadh an ch\\303\\241ip\\303\\251is\\0\";\n\nconst char * gTranslations_it = \n  \"&Informazioni su...\\0\"\\\n  \"&Dimensioni reali\\t<Ctrl>+1\\0\"\\\n  \"Opzioni &avanzate...\\0\"\\\n  \"&Tutte le pagine selezionate\\0\"\\\n  \"&Indietro\\t<Alt>+<Freccia sinistra>\\0\"\\\n  \"Vista &libro\\t<Ctrl>+8\\0\"\\\n  \"&Chiudi\\tCtrl+W\\0\"\\\n  \"&Copia selezione\\0\"\\\n  \"&Copia selezione\\t<Ctrl>+C\\0\"\\\n  \"Non chie&dermelo pi\\303\\271\\0\"\\\n  \"Solo pagin&e pari\\0\"\\\n  \"Pagine &affiancate\\t<Ctrl>+7\\0\"\\\n  \"\\0\"\\\n  \"&Ricerca:\\0\"\\\n  \"&Prima pagina\\t<Home>\\0\"\\\n  \"&Adatta pagine alla zona stampabile\\0\"\\\n  \"&Vai a\\0\"\\\n  \"&Vai a pagina:\\0\"\\\n  \"&Guida in linea\\0\"\\\n  \"&Ultima pagina\\t<Fine>\\0\"\\\n  \"&Ingrandimento:\\0\"\\\n  \"&Manuale in linea (in inglese)\\0\"\\\n  \"&Maiuscole/minuscole\\0\"\\\n  \"Pagi&na successiva\\t<Freccia destra>\\0\"\\\n  \"\\0\"\\\n  \"&No, grazie\\0\"\\\n  \"S&olo pagine dispari\\0\"\\\n  \"&Apri documento\\0\"\\\n  \"&Apri...\\tCtrl+O\\0\"\\\n  \"&Opzioni...\\0\"\\\n  \"\\0\"\\\n  \"&Attacca il documento (Pin)\\0\"\\\n  \"&Pagina precedente\\t<Freccia sinistra>\\0\"\\\n  \"&Stampa\\0\"\\\n  \"Stam&pa...\\tCtrl+P\\0\"\\\n  \"Stam&pa... (rifiutato)\\0\"\\\n  \"&Ricorda la password per questo documento\\0\"\\\n  \"&Ricorda queste impostazioni per ogni documento\\0\"\\\n  \"&Non ricordare documento\\0\"\\\n  \"&Salva come...\\0\"\\\n  \"&Salva con nome...\\t<Ctrl>+S\\0\"\\\n  \"Impo&stazioni\\0\"\\\n  \"Riduci pagine alla zona &stampabile (se necessario)\\0\"\\\n  \"Pagina &singola\\t<Ctrl>+6\\0\"\\\n  \"&Ignora questa versione\\0\"\\\n  \"&Usa larghezza pagina originale\\0\"\\\n  \"&Visualizza\\0\"\\\n  \"&Finestra\\0\"\\\n  \"&S\\303\\254\\0\"\\\n  \"&Ingrandimento\\0\"\\\n  \"(di %d)\\0\"\\\n  \"(pagina %s)\\0\"\\\n  \"Informazioni su SumatraPDF\\0\"\\\n  \"Aggiungi ai Preferiti\\0\"\\\n  \"Aggiungi pagina %s ai Preferiti\\0\"\\\n  \"Aggiungi la pagina %s ai Preferiti con nome (opzionale):\\0\"\\\n  \"Aggiungi ai Preferiti\\0\"\\\n  \"Avanzate\\0\"\\\n  \"Tutti i file\\0\"\\\n  \"Tutti i documenti supportati\\0\"\\\n  \"Creato con:\\0\"\\\n  \"Associare ai file PDF?\\0\"\\\n  \"Allegato: %s\\0\"\\\n  \"Autore:\\0\"\\\n  \"Automatica\\0\"\\\n  \"Controlla a&utomaticamente aggiornamenti\\0\"\\\n  \"Vista libro\\0\"\\\n  \"Segna&libri\\t<F12>\\0\"\\\n  \"Scorciatoie segnalibro\\0\"\\\n  \"Segnalibro alla pagina %s di %s\\0\"\\\n  \"Segnalibri\\0\"\\\n  \"Byte\\0\"\\\n  \"Documenti CHM\\0\"\\\n  \"Impossibile connettersi a internet (errore %#x).\\0\"\\\n  \"Annulla\\0\"\\\n  \"Impossibile stampare questo file\\0\"\\\n  \"Impossibile eseguire il comando di ricerca inversa. Controllare la riga di comando usata nelle impostazioni.\\0\"\\\n  \"Lingua dell'interfaccia\\0\"\\\n  \"Controlla &aggiornamenti\\0\"\\\n  \"Fumetti\\0\"\\\n  \"Compatibilit\\303\\240\\0\"\\\n  \"Pagina continua\\0\"\\\n  \"Vista libro continua\\0\"\\\n  \"Pagine affiancate continue\\0\"\\\n  \"Contribuisci alla traduzione\\0\"\\\n  \"Copia &immagine\\0\"\\\n  \"Copia indirizzo co&llegamento\\0\"\\\n  \"Copia co&mmento\\0\"\\\n  \"Impossibile copiare il testo (copiare solo come immagine)\\0\"\\\n  \"\\0\"\\\n  \"Impossibile ottenere info propriet\\303\\240 stampante\\0\"\\\n  \"Impossibile inizializzare la stampante\\0\"\\\n  \"Impossibile presentare la pagina\\0\"\\\n  \"Data creazione:\\0\"\\\n  \"File attuale\\0\"\\\n  \"Posizione cursore\\0\"\\\n  \"Ingrandimento personali&zzato\\t<Ctrl>+Y\\0\"\\\n  \"&Vista predefinita:\\0\"\\\n  \"&Ingrandimento predefinito:\\0\"\\\n  \"Il lettore PDF predefinito non \\303\\250 modificabile in modalit\\303\\240 portatile\\0\"\\\n  \"Permessi rifiutati:\\0\"\\\n  \"Documenti DjVu\\0\"\\\n  \"Propriet\\303\\240 del documento\\0\"\\\n  \"Scarica\\0\"\\\n  \"Es&ci\\t<Ctrl>+Q\\0\"\\\n  \"Documenti EPUB\\0\"\\\n  \"Inserisci password\\0\"\\\n  \"Inserisci password per %s\\0\"\\\n  \"Inserire la linea di comando da eseguire quando si fa doppio clic su un documento PDF:\\0\"\\\n  \"Errore nel caricamento di %s\\0\"\\\n  \"&Preferiti\\0\"\\\n  \"A&vanti\\t<Alt>+<Freccia destra>\\0\"\\\n  \"S&chermo intero\\t<Ctrl>+<Maiusc>+L\\0\"\\\n  \"Pagine affiancate\\0\"\\\n  \"Impossibile rinominare il file\\0\"\\\n  \"Salvataggio file non riuscito\\0\"\\\n  \"Vista web veloce\\0\"\\\n  \"Preferiti\\0\"\\\n  \"Documenti FictionBook\\0\"\\\n  \"File %s non trovato\\0\"\\\n  \"Dimensione file:\\0\"\\\n  \"\\0\"\\\n  \"Tro&va...\\t<Ctrl>+F\\0\"\\\n  \"Trova\\0\"\\\n  \"Trova successivo\\0\"\\\n  \"Trova precedente\\0\"\\\n  \"Trova:\\0\"\\\n  \"Adatta al &contenuto\\t<Ctrl>+3\\0\"\\\n  \"&Pagina intera\\t<Ctrl>+0\\0\"\\\n  \"Adatta alla &larghezza della pagina\\t<Ctrl>+2\\0\"\\\n  \"Adatta al contenuto\\0\"\\\n  \"Adatta alla pagina\\0\"\\\n  \"Adatta alla larghezza della pagina\\0\"\\\n  \"Adatta alla larghezza e visualizza le pagine in modo continuo\\0\"\\\n  \"Visualizza una pagina singola\\0\"\\\n  \"Font:\\0\"\\\n  \"Formattazione del libro ... %d pagine\\0\"\\\n  \"Testo trovato a pagina %s\\0\"\\\n  \"Trovato testo alla pagina %s (ancora)\\0\"\\\n  \"Letti frequentemente\\0\"\\\n  \"\\0\"\\\n  \"Vai a pagina\\0\"\\\n  \"Nascondi letto frequentemente\\0\"\\\n  \"Consiglio: usare <F3> per trovare il successivo\\0\"\\\n  \"File immagine (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Impostare SumatraPDF come programma predefinito per i file PDF?\\0\"\\\n  \"Imposta SumatraPDF come lettore PDF predefinito\\0\"\\\n  \"Modo Man&ga\\0\"\\\n  \"Maiuscole/minuscole\\0\"\\\n  \"Documenti Mobi\\0\"\\\n  \"Data ultima modifica:\\0\"\\\n  \"\\303\\210 disponibile la versione %s. Scaricare la nuova versione?\\0\"\\\n  \"Pagina successiva\\0\"\\\n  \"Nessuna corrispondenza trovata\\0\"\\\n  \"Nessun risultato trovato intorno alla riga %u nel file %s\\0\"\\\n  \"Non \\303\\250 stato trovato il file di sincronizzazione\\0\"\\\n  \"Nessuna informazione di sincronizzazione in questa posizione\\0\"\\\n  \"Numero pagine:\\0\"\\\n  \"\\0\"\\\n  \"Apri\\0\"\\\n  \"Apri con PDF-XChange\\0\"\\\n  \"Apri documento...\\0\"\\\n  \"Apri in %s\\0\"\\\n  \"Apri con &Adobe Reader\\0\"\\\n  \"Apri con &Foxit Reader\\0\"\\\n  \"Apri con Microsoft HTML Help\\0\"\\\n  \"Apri con Microsoft XPS-Viewer\\0\"\\\n  \"Propriet\\303\\240\\0\"\\\n  \"P&ropriet\\303\\240\\t<Ctrl>+D\\0\"\\\n  \"Documento PDF\\0\"\\\n  \"Ottimizzazioni PDF:\\0\"\\\n  \"Produttore PDF:\\0\"\\\n  \"Versione PDF:\\0\"\\\n  \"Documenti PDF\\0\"\\\n  \"Pa&gina...\\t<Ctrl>+G\\0\"\\\n  \"Pagina %s\\0\"\\\n  \"Formato pagina:\\0\"\\\n  \"Pagina numero %u inesistente\\0\"\\\n  \"Adattamento pagina\\0\"\\\n  \"Pagina:\\0\"\\\n  \"Documenti PalmDoc\\0\"\\\n  \"Rendering in corso - attendere...\\0\"\\\n  \"Documenti PostScript\\0\"\\\n  \"Pr&esentazione\\t<Ctrl>+L\\0\"\\\n  \"Pagina precedente\\0\"\\\n  \"Stampa\\0\"\\\n  \"Stampa intervallo\\0\"\\\n  \"La stampante con quel nome non esiste\\0\"\\\n  \"Stampa in corso...\\0\"\\\n  \"La stampa \\303\\250 ancora in corso. Interrompere e uscire?\\0\"\\\n  \"La stampa \\303\\250 in corso. Interrompere e ricominciare?\\0\"\\\n  \"Stampa pagina %d di %d...\\0\"\\\n  \"Problemi di stampa.\\0\"\\\n  \"Ri&nomina...\\tF2\\0\"\\\n  \"Ric&orda file aperti\\0\"\\\n  \"Rimuovi dai Preferiti\\0\"\\\n  \"Rimuovi la pagina %s dai Preferiti\\0\"\\\n  \"Rinomina in\\0\"\\\n  \"Ruota a &sinistra\\t<Ctrl> <Maiusc> -\\0\"\\\n  \"Ruota a &destra\\t<Ctrl> <Maiusc> +\\0\"\\\n  \"Salva come\\0\"\\\n  \"Salva &collegamento\\t<Ctrl>+<Maiusc>+S\\0\"\\\n  \"Ricerca: %d di %d...\\0\"\\\n  \"Seleziona &tutto\\0\"\\\n  \"Selezion&a tutto\\t<Ctrl>+A\\0\"\\\n  \"Seleziona contenuti con <Ctrl>+pulsante sinistro del mouse\\0\"\\\n  \"Selezione\\0\"\\\n  \"Invia via &email...\\0\"\\\n  \"Imposta la ricerca inversa via riga di comando\\0\"\\\n  \"Visualizza segnali&bri\\0\"\\\n  \"&Pagine in modo continuo\\0\"\\\n  \"&Barra strumenti\\0\"\\\n  \"Visualizza Preferiti\\0\"\\\n  \"Visualizza letto frequentemente\\0\"\\\n  \"Visualizza la &barra laterale dei segnalibri quando disponibile\\0\"\\\n  \"Pagina singola\\0\"\\\n  \"Questo non doveva succedere!\\n\\nSe vuoi aiutarci a capire la causa del blocco del programma seleziona <Annulla>.\\0\"\\\n  \"Il file sorgente %s non ha nessun punto di sincronizzazione\\0\"\\\n  \"Oggetto:\\0\"\\\n  \"Opzioni di SumatraPDF\\0\"\\\n  \"Controllo aggiornamenti SumatraPDF\\0\"\\\n  \"SumatraPDF ha incontrato un errore irreparabile\\0\"\\\n  \"SumatraPDF \\303\\250 il lettore PDF predefinito\\0\"\\\n  \"Ora SumatraPDF dovrebbe essere il lettore PDF predefinito\\0\"\\\n  \"Il file di sincronizzazione non pu\\303\\262 essere aperto\\0\"\\\n  \"PDF marcati\\0\"\\\n  \"Documenti di testo\\0\"\\\n  \"Questo documento usa funzioni non supportate (%s) e potrebbe non essere visualizzato bene\\0\"\\\n  \"Titolo:\\0\"\\\n  \"File sorgente sconosciuto (%s)\\0\"\\\n  \"Usa &schede\\0\"\\\n  \"Visualizza\\0\"\\\n  \"Visita il sito &web\\0\"\\\n  \"Attenzione\\0\"\\\n  \"Documenti XPS\\0\"\\\n  \"Il programma \\303\\250 aggiornato.\\0\"\\\n  \"Versione attuale: %s\\0\"\\\n  \"\\0\"\\\n  \"Ingrandimento\\0\"\\\n  \"Riduzione\\0\"\\\n  \"Fattore di ingrandimento\\0\"\\\n  \"[Individuati cambiamenti; aggiornmento] %s\\0\"\\\n  \"Copia del testo...\\0\"\\\n  \"Stampa documento...\\0\";\n\nconst char * gTranslations_ja = \n  \"\\343\\203\\220\\343\\203\\274\\343\\202\\270\\343\\203\\247\\343\\203\\263\\346\\203\\205\\345\\240\\261(&A)\\0\"\\\n  \"\\345\\256\\237\\351\\232\\233\\343\\201\\256\\343\\202\\265\\343\\202\\244\\343\\202\\272(&A)\\tCtrl+1\\0\"\\\n  \"\\350\\251\\263\\347\\264\\260\\350\\250\\255\\345\\256\\232(&A)\\0\"\\\n  \"\\343\\201\\231\\343\\201\\271\\343\\201\\246\\343\\201\\256\\351\\201\\270\\346\\212\\236\\343\\201\\225\\343\\202\\214\\343\\201\\237\\343\\203\\232\\343\\203\\274\\343\\202\\270(&A)\\0\"\\\n  \"\\345\\211\\215\\343\\201\\253\\346\\210\\273\\343\\202\\213(&B)\\tAlt+\\342\\206\\220\\0\"\\\n  \"\\343\\203\\226\\343\\203\\203\\343\\202\\257 \\343\\203\\223\\343\\203\\245\\343\\203\\274&(B)\\tCtrl+B\\0\"\\\n  \"\\351\\226\\211\\343\\201\\230\\343\\202\\213(&C)\\tCtrl+W\\0\"\\\n  \"\\351\\201\\270\\346\\212\\236\\347\\257\\204\\345\\233\\262\\343\\202\\222\\343\\202\\263\\343\\203\\224\\343\\203\\274(&C)\\0\"\\\n  \"\\351\\201\\270\\346\\212\\236\\347\\257\\204\\345\\233\\262\\343\\201\\256\\343\\202\\263\\343\\203\\224\\343\\203\\274(&C)\\tCtrl+C\\0\"\\\n  \"\\345\\206\\215\\343\\201\\263\\350\\263\\252\\345\\225\\217\\343\\201\\227\\343\\201\\252\\343\\201\\204(&D)\\0\"\\\n  \"\\345\\201\\266\\346\\225\\260\\343\\203\\232\\343\\203\\274\\343\\202\\270\\343\\201\\256\\343\\201\\277(&E)\\0\"\\\n  \"\\350\\246\\213\\350\\277\\224\\343\\201\\227\\350\\241\\250\\347\\244\\272(&F)\\tCtrl+7\\0\"\\\n  \"\\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253(&F)\\0\"\\\n  \"\\346\\244\\234\\347\\264\\242\\343\\201\\231\\343\\202\\213\\346\\226\\207\\345\\255\\227\\345\\210\\227(&F):\\0\"\\\n  \"\\346\\234\\200\\345\\210\\235\\343\\201\\256\\343\\203\\232\\343\\203\\274\\343\\202\\270(&F)\\tHome\\0\"\\\n  \"\\343\\203\\232\\343\\203\\274\\343\\202\\270\\343\\202\\222\\345\\215\\260\\345\\210\\267\\345\\217\\257\\350\\203\\275\\351\\240\\230\\345\\237\\237\\343\\201\\253\\345\\220\\210\\343\\202\\217\\343\\201\\233\\343\\202\\213(&F)\\0\"\\\n  \"\\347\\247\\273\\345\\213\\225(&G)\\0\"\\\n  \"\\343\\203\\232\\343\\203\\274\\343\\202\\270\\343\\201\\270\\347\\247\\273\\345\\213\\225(&G):\\0\"\\\n  \"\\343\\203\\230\\343\\203\\253\\343\\203\\227(&H)\\0\"\\\n  \"\\346\\234\\200\\345\\276\\214\\343\\201\\256\\343\\203\\232\\343\\203\\274\\343\\202\\270(&L)\\tEnd\\0\"\\\n  \"\\346\\213\\241\\345\\244\\247\\347\\216\\207(&M):\\0\"\\\n  \"\\343\\203\\236\\343\\203\\213\\343\\203\\245\\343\\202\\242\\343\\203\\253(&M)\\0\"\\\n  \"\\345\\244\\247\\346\\226\\207\\345\\255\\227\\343\\201\\250\\345\\260\\217\\346\\226\\207\\345\\255\\227\\343\\202\\222\\345\\214\\272\\345\\210\\245\\343\\201\\231\\343\\202\\213(&M)\\0\"\\\n  \"\\346\\254\\241\\343\\201\\256\\343\\203\\232\\343\\203\\274\\343\\202\\270(&N)\\t\\342\\206\\222\\0\"\\\n  \"\\343\\201\\204\\343\\201\\204\\343\\201\\210(&N)\\0\"\\\n  \"\\343\\201\\204\\343\\201\\204\\343\\201\\210(&N)\\0\"\\\n  \"\\345\\245\\207\\346\\225\\260\\343\\203\\232\\343\\203\\274\\343\\202\\270\\343\\201\\256\\343\\201\\277(&O)\\0\"\\\n  \"\\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\343\\202\\222\\351\\226\\213\\343\\201\\217(&O)\\0\"\\\n  \"\\351\\226\\213\\343\\201\\217(&O)...\\tCtrl+O\\0\"\\\n  \"\\343\\202\\252\\343\\203\\227\\343\\202\\267\\343\\203\\247\\343\\203\\263(&O)...\\0\"\\\n  \"\\343\\203\\221\\343\\202\\271\\343\\203\\257\\343\\203\\274\\343\\203\\211(&P):\\0\"\\\n  \"\\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\343\\202\\222\\343\\203\\224\\343\\203\\263\\343\\201\\231\\343\\202\\213&(P)\\0\"\\\n  \"\\345\\211\\215\\343\\201\\256\\343\\203\\232\\343\\203\\274\\343\\202\\270(&P)\\t\\342\\206\\220\\0\"\\\n  \"\\345\\215\\260\\345\\210\\267(&P)...\\0\"\\\n  \"\\345\\215\\260\\345\\210\\267(&P)...\\tCtrl+P\\0\"\\\n  \"\\345\\215\\260\\345\\210\\267... (\\346\\213\\222\\345\\220\\246\\343\\201\\225\\343\\202\\214\\343\\201\\276\\343\\201\\227\\343\\201\\237)(&P)\\0\"\\\n  \"\\343\\201\\223\\343\\201\\256\\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\343\\201\\256\\343\\203\\221\\343\\202\\271\\343\\203\\257\\343\\203\\274\\343\\203\\211\\343\\202\\222\\350\\250\\230\\346\\206\\266\\343\\201\\231\\343\\202\\213(&R)\\0\"\\\n  \"\\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\343\\201\\224\\343\\201\\250\\343\\201\\253\\343\\201\\223\\343\\202\\214\\343\\202\\211\\343\\201\\256\\350\\250\\255\\345\\256\\232\\343\\202\\222\\350\\250\\230\\346\\206\\266\\343\\201\\231\\343\\202\\213(&R)\\0\"\\\n  \"\\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\343\\201\\256\\345\\211\\212\\351\\231\\244(&R)\\0\"\\\n  \"\\345\\220\\215\\345\\211\\215\\343\\202\\222\\344\\273\\230\\343\\201\\221\\343\\201\\246\\344\\277\\235\\345\\255\\230(&S)...\\0\"\\\n  \"\\345\\220\\215\\345\\211\\215\\343\\202\\222\\344\\273\\230\\343\\201\\221\\343\\201\\246\\344\\277\\235\\345\\255\\230(&S)...\\tCtrl+S\\0\"\\\n  \"\\350\\250\\255\\345\\256\\232(&S)\\0\"\\\n  \"\\345\\277\\205\\350\\246\\201\\343\\201\\252\\345\\240\\264\\345\\220\\210\\343\\201\\257\\343\\203\\232\\343\\203\\274\\343\\202\\270\\343\\202\\222\\345\\215\\260\\345\\210\\267\\345\\217\\257\\350\\203\\275\\351\\240\\230\\345\\237\\237\\343\\201\\253\\347\\270\\256\\345\\260\\217\\343\\201\\231\\343\\202\\213(&S)\\0\"\\\n  \"\\345\\215\\230\\344\\270\\200\\343\\203\\232\\343\\203\\274\\343\\202\\270(&S)\\tCtrl+6\\0\"\\\n  \"\\343\\201\\223\\343\\201\\256\\343\\203\\220\\343\\203\\274\\343\\202\\270\\343\\203\\247\\343\\203\\263\\343\\202\\222\\343\\202\\271\\343\\202\\255\\343\\203\\203\\343\\203\\227\\343\\201\\231\\343\\202\\213(&S)\\0\"\\\n  \"\\345\\205\\203\\343\\201\\256\\343\\203\\232\\343\\203\\274\\343\\202\\270 \\343\\202\\265\\343\\202\\244\\343\\202\\272\\343\\202\\222\\344\\275\\277\\347\\224\\250\\343\\201\\231\\343\\202\\213(&U)\\0\"\\\n  \"\\350\\241\\250\\347\\244\\272(&V)\\0\"\\\n  \"\\343\\202\\246\\343\\202\\243\\343\\203\\263\\343\\203\\211\\343\\202\\246(&W)\\0\"\\\n  \"\\343\\201\\257\\343\\201\\204(&Y)\\0\"\\\n  \"\\343\\202\\272\\343\\203\\274\\343\\203\\240(&Z)\\0\"\\\n  \"(%d \\344\\270\\255)\\0\"\\\n  \"(\\343\\203\\232\\343\\203\\274\\343\\202\\270 %s)\\0\"\\\n  \"SumatraPDF \\343\\201\\256\\343\\203\\220\\343\\203\\274\\343\\202\\270\\343\\203\\247\\343\\203\\263\\346\\203\\205\\345\\240\\261\\0\"\\\n  \"\\343\\201\\212\\346\\260\\227\\343\\201\\253\\345\\205\\245\\343\\202\\212\\343\\201\\253\\350\\277\\275\\345\\212\\240\\0\"\\\n  \"\\343\\203\\232\\343\\203\\274\\343\\202\\270 %s \\343\\202\\222\\350\\277\\275\\345\\212\\240\\0\"\\\n  \"\\343\\203\\232\\343\\203\\274\\343\\202\\270 %s \\343\\201\\253\\345\\220\\215\\345\\211\\215\\343\\202\\222\\344\\273\\230\\343\\201\\221\\343\\201\\246\\350\\277\\275\\345\\212\\240\\0\"\\\n  \"\\343\\201\\212\\346\\260\\227\\343\\201\\253\\345\\205\\245\\343\\202\\212\\343\\201\\253\\350\\277\\275\\345\\212\\240\\0\"\\\n  \"\\350\\251\\263\\347\\264\\260\\350\\250\\255\\345\\256\\232\\0\"\\\n  \"\\343\\201\\231\\343\\201\\271\\343\\201\\246\\343\\201\\256\\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253\\0\"\\\n  \"\\343\\201\\231\\343\\201\\271\\343\\201\\246\\343\\201\\256\\345\\257\\276\\345\\277\\234\\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\0\"\\\n  \"\\343\\202\\242\\343\\203\\227\\343\\203\\252\\343\\202\\261\\343\\203\\274\\343\\202\\267\\343\\203\\247\\343\\203\\263:\\0\"\\\n  \"PDF \\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253\\343\\201\\250\\351\\226\\242\\351\\200\\243\\344\\273\\230\\343\\201\\221\\343\\201\\276\\343\\201\\231\\343\\201\\213\\357\\274\\237\\0\"\\\n  \"\\346\\267\\273\\344\\273\\230: %s\\0\"\\\n  \"\\344\\275\\234\\350\\200\\205:\\0\"\\\n  \"\\350\\207\\252\\345\\213\\225\\0\"\\\n  \"\\350\\207\\252\\345\\213\\225\\347\\232\\204\\343\\201\\253\\346\\233\\264\\346\\226\\260\\343\\202\\222\\343\\203\\201\\343\\202\\247\\343\\203\\203\\343\\202\\257\\343\\201\\231\\343\\202\\213(&U)\\0\"\\\n  \"\\343\\203\\226\\343\\203\\203\\343\\202\\257 \\343\\203\\223\\343\\203\\245\\343\\203\\274\\0\"\\\n  \"\\343\\203\\226\\343\\203\\203\\343\\202\\257\\343\\203\\236\\343\\203\\274\\343\\202\\257(&M)\\tF12\\0\"\\\n  \"\\343\\202\\267\\343\\203\\247\\343\\203\\274\\343\\203\\210\\343\\202\\253\\343\\203\\203\\343\\203\\210\\343\\202\\222\\343\\203\\226\\343\\203\\203\\343\\202\\257\\343\\203\\236\\343\\203\\274\\343\\202\\257\\0\"\\\n  \"\\343\\203\\232\\343\\203\\274\\343\\202\\270 %s\\343\\200\\201\\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253 %s \\343\\201\\253\\345\\257\\276\\343\\201\\231\\343\\202\\213\\343\\202\\267\\343\\203\\247\\343\\203\\274\\343\\203\\210\\343\\202\\253\\343\\203\\203\\343\\203\\210\\343\\202\\222\\343\\203\\226\\343\\203\\203\\343\\202\\257\\343\\203\\236\\343\\203\\274\\343\\202\\257\\0\"\\\n  \"\\343\\203\\226\\343\\203\\203\\343\\202\\257\\343\\203\\236\\343\\203\\274\\343\\202\\257\\0\"\\\n  \"\\343\\203\\220\\343\\202\\244\\343\\203\\210\\0\"\\\n  \"CHM \\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\0\"\\\n  \"\\343\\202\\244\\343\\203\\263\\343\\202\\277\\343\\203\\274\\343\\203\\215\\343\\203\\203\\343\\203\\210\\343\\201\\270\\346\\216\\245\\347\\266\\232\\343\\201\\247\\343\\201\\215\\343\\201\\276\\343\\201\\233\\343\\202\\223 (\\343\\202\\250\\343\\203\\251\\343\\203\\274 %#x)\\343\\200\\202\\0\"\\\n  \"\\343\\202\\255\\343\\203\\243\\343\\203\\263\\343\\202\\273\\343\\203\\253\\0\"\\\n  \"\\343\\201\\223\\343\\201\\256\\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253\\343\\202\\222\\345\\215\\260\\345\\210\\267\\343\\201\\247\\343\\201\\215\\343\\201\\276\\343\\201\\233\\343\\202\\223\\0\"\\\n  \"\\351\\200\\206\\351\\240\\206\\346\\244\\234\\347\\264\\242\\343\\202\\263\\343\\203\\236\\343\\203\\263\\343\\203\\211\\343\\202\\222\\351\\226\\213\\345\\247\\213\\343\\201\\247\\343\\201\\215\\343\\201\\276\\343\\201\\233\\343\\202\\223\\343\\200\\202\\350\\250\\255\\345\\256\\232\\343\\201\\247\\343\\202\\263\\343\\203\\236\\343\\203\\263\\343\\203\\211 \\343\\203\\251\\343\\202\\244\\343\\203\\263\\343\\202\\222\\343\\203\\201\\343\\202\\247\\343\\203\\203\\343\\202\\257\\343\\201\\227\\343\\201\\246\\343\\201\\217\\343\\201\\240\\343\\201\\225\\343\\201\\204\\343\\200\\202\\0\"\\\n  \"\\350\\250\\200\\350\\252\\236\\343\\201\\256\\345\\244\\211\\346\\233\\264 (Change Language)\\0\"\\\n  \"\\346\\233\\264\\346\\226\\260\\343\\201\\256\\343\\203\\201\\343\\202\\247\\343\\203\\203\\343\\202\\257(&U)\\0\"\\\n  \"\\343\\203\\236\\343\\203\\263\\343\\202\\254\\346\\234\\254\\0\"\\\n  \"\\344\\272\\222\\346\\217\\233\\346\\200\\247\\0\"\\\n  \"\\351\\200\\243\\347\\266\\232\\0\"\\\n  \"\\351\\200\\243\\347\\266\\232\\343\\203\\226\\343\\203\\203\\343\\202\\257 \\343\\203\\223\\343\\203\\245\\343\\203\\274\\0\"\\\n  \"\\351\\200\\243\\347\\266\\232\\350\\246\\213\\350\\277\\224\\343\\201\\227\\0\"\\\n  \"\\347\\277\\273\\350\\250\\263\\343\\201\\256\\346\\217\\220\\344\\276\\233\\0\"\\\n  \"\\347\\224\\273\\345\\203\\217\\343\\202\\222\\343\\202\\263\\343\\203\\224\\343\\203\\274(&I)\\0\"\\\n  \"\\343\\203\\252\\343\\203\\263\\343\\202\\257\\345\\205\\210\\343\\201\\256\\343\\202\\242\\343\\203\\211\\343\\203\\254\\343\\202\\271\\343\\202\\222\\343\\202\\263\\343\\203\\224\\343\\203\\274(&L)\\0\"\\\n  \"\\343\\202\\263\\343\\203\\241\\343\\203\\263\\343\\203\\210\\343\\202\\222\\343\\202\\263\\343\\203\\224\\343\\203\\274(&M)\\0\"\\\n  \"\\343\\203\\206\\343\\202\\255\\343\\202\\271\\343\\203\\210\\343\\201\\256\\343\\202\\263\\343\\203\\224\\343\\203\\274\\343\\201\\257\\346\\213\\222\\345\\220\\246\\343\\201\\225\\343\\202\\214\\343\\201\\276\\343\\201\\227\\343\\201\\237 (\\343\\202\\244\\343\\203\\241\\343\\203\\274\\343\\202\\270\\343\\201\\250\\343\\201\\227\\343\\201\\246\\343\\201\\256\\343\\202\\263\\343\\203\\224\\343\\203\\274\\343\\201\\256\\343\\201\\277)\\0\"\\\n  \"\\343\\202\\263\\343\\203\\224\\343\\203\\274\\343\\203\\251\\343\\202\\244\\343\\203\\210:\\0\"\\\n  \"\\343\\203\\227\\343\\203\\252\\343\\203\\263\\343\\202\\277\\343\\203\\274\\343\\201\\256\\343\\203\\227\\343\\203\\255\\343\\203\\221\\343\\203\\206\\343\\202\\243\\343\\202\\222\\351\\226\\213\\343\\201\\221\\343\\201\\276\\343\\201\\233\\343\\202\\223\\343\\201\\247\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"\\343\\203\\227\\343\\203\\252\\343\\203\\263\\343\\202\\277\\343\\203\\274\\343\\202\\222\\345\\210\\235\\346\\234\\237\\345\\214\\226\\343\\201\\247\\343\\201\\215\\343\\201\\276\\343\\201\\233\\343\\202\\223\\343\\201\\247\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"\\343\\203\\232\\343\\203\\274\\343\\202\\270\\343\\202\\222\\346\\217\\217\\347\\224\\273\\343\\201\\247\\343\\201\\215\\343\\201\\276\\343\\201\\233\\343\\202\\223\\343\\201\\247\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"\\344\\275\\234\\346\\210\\220\\346\\227\\245\\346\\231\\202:\\0\"\\\n  \"\\347\\217\\276\\345\\234\\250\\343\\201\\256\\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253\\0\"\\\n  \"\\343\\202\\253\\343\\203\\274\\343\\202\\275\\343\\203\\253\\344\\275\\215\\347\\275\\256\\357\\274\\232\\0\"\\\n  \"\\346\\213\\241\\345\\244\\247\\347\\216\\207\\343\\201\\256\\346\\214\\207\\345\\256\\232(&Z)...\\tCtrl+Y\\0\"\\\n  \"\\346\\227\\242\\345\\256\\232\\343\\201\\256\\343\\203\\254\\343\\202\\244\\343\\202\\242\\343\\202\\246\\343\\203\\210(&L):\\0\"\\\n  \"\\346\\227\\242\\345\\256\\232\\343\\201\\256\\346\\213\\241\\345\\244\\247\\347\\216\\207(&Z):\\0\"\\\n  \"\\343\\203\\235\\343\\203\\274\\343\\202\\277\\343\\203\\226\\343\\203\\253 \\343\\203\\242\\343\\203\\274\\343\\203\\211\\343\\201\\247\\343\\201\\257\\345\\244\\211\\346\\233\\264\\343\\201\\247\\343\\201\\215\\343\\201\\276\\343\\201\\233\\343\\202\\223\\0\"\\\n  \"\\346\\213\\222\\345\\220\\246\\343\\201\\225\\343\\202\\214\\343\\201\\237\\346\\250\\251\\351\\231\\220:\\0\"\\\n  \"DjVu \\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\0\"\\\n  \"\\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\343\\201\\256\\343\\203\\227\\343\\203\\255\\343\\203\\221\\343\\203\\206\\343\\202\\243\\0\"\\\n  \"\\343\\203\\200\\343\\202\\246\\343\\203\\263\\343\\203\\255\\343\\203\\274\\343\\203\\211\\0\"\\\n  \"\\347\\265\\202\\344\\272\\206(&X)\\tCtrl+Q\\0\"\\\n  \"EPUB \\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\0\"\\\n  \"\\343\\203\\221\\343\\202\\271\\343\\203\\257\\343\\203\\274\\343\\203\\211\\343\\201\\256\\345\\205\\245\\345\\212\\233\\0\"\\\n  \"%s \\343\\201\\256\\343\\203\\221\\343\\202\\271\\343\\203\\257\\343\\203\\274\\343\\203\\211\\343\\202\\222\\345\\205\\245\\345\\212\\233\\343\\201\\227\\343\\201\\276\\343\\201\\231\\0\"\\\n  \"PDF \\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\344\\270\\212\\343\\201\\247\\343\\203\\200\\343\\203\\226\\343\\203\\253\\343\\202\\257\\343\\203\\252\\343\\203\\203\\343\\202\\257\\343\\201\\227\\343\\201\\237\\343\\201\\250\\343\\201\\215\\343\\201\\253\\345\\221\\274\\343\\201\\263\\345\\207\\272\\343\\201\\231\\343\\202\\263\\343\\203\\236\\343\\203\\263\\343\\203\\211\\343\\203\\251\\343\\202\\244\\343\\203\\263\\343\\202\\222\\345\\205\\245\\345\\212\\233:\\0\"\\\n  \"%s \\343\\201\\256\\350\\252\\255\\343\\201\\277\\350\\276\\274\\343\\201\\277\\343\\201\\253\\345\\244\\261\\346\\225\\227\\0\"\\\n  \"\\343\\201\\212\\346\\260\\227\\343\\201\\253\\345\\205\\245\\343\\202\\212(&A)\\0\"\\\n  \"\\346\\254\\241\\343\\201\\253\\351\\200\\262\\343\\202\\200(&O)\\tAlt+\\342\\206\\222\\0\"\\\n  \"\\345\\205\\250\\347\\224\\273\\351\\235\\242\\350\\241\\250\\347\\244\\272(&U)\\tCtrl+Shift+L\\0\"\\\n  \"\\350\\246\\213\\350\\277\\224\\343\\201\\227\\0\"\\\n  \"\\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253\\345\\220\\215\\343\\201\\256\\345\\244\\211\\346\\233\\264\\343\\201\\253\\345\\244\\261\\346\\225\\227\\343\\201\\227\\343\\201\\276\\343\\201\\227\\343\\201\\237\\357\\274\\201\\0\"\\\n  \"\\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253\\343\\201\\256\\344\\277\\235\\345\\255\\230\\343\\201\\253\\345\\244\\261\\346\\225\\227\\343\\201\\227\\343\\201\\276\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"\\351\\253\\230\\351\\200\\237\\343\\202\\246\\343\\202\\247\\343\\203\\226\\350\\241\\250\\347\\244\\272\\0\"\\\n  \"\\343\\201\\212\\346\\260\\227\\343\\201\\253\\345\\205\\245\\343\\202\\212\\0\"\\\n  \"\\343\\203\\225\\343\\202\\243\\343\\202\\257\\343\\202\\267\\343\\203\\247\\343\\203\\263\\346\\226\\207\\347\\253\\240\\0\"\\\n  \"\\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253 %s \\343\\201\\214\\350\\246\\213\\343\\201\\244\\343\\201\\213\\343\\202\\212\\343\\201\\276\\343\\201\\233\\343\\202\\223\\0\"\\\n  \"\\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253\\343\\202\\265\\343\\202\\244\\343\\202\\272:\\0\"\\\n  \"\\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253:\\0\"\\\n  \"\\346\\244\\234\\347\\264\\242(&D)...\\tCtrl+F\\0\"\\\n  \"\\346\\244\\234\\347\\264\\242\\0\"\\\n  \"\\346\\254\\241\\343\\202\\222\\346\\244\\234\\347\\264\\242\\0\"\\\n  \"\\345\\211\\215\\343\\202\\222\\346\\244\\234\\347\\264\\242\\0\"\\\n  \"\\346\\244\\234\\347\\264\\242:\\0\"\\\n  \"\\345\\206\\205\\345\\256\\271\\343\\201\\253\\345\\220\\210\\343\\202\\217\\343\\201\\233\\343\\202\\213(&C)\\tCtrl+3\\0\"\\\n  \"\\343\\203\\232\\343\\203\\274\\343\\202\\270\\343\\201\\253\\345\\220\\210\\343\\202\\217\\343\\201\\233\\343\\202\\213(&P)\\tCtrl+0\\0\"\\\n  \"\\345\\271\\205\\343\\201\\253\\345\\220\\210\\343\\202\\217\\343\\201\\233\\343\\202\\213(&W)\\tCtrl+2\\0\"\\\n  \"\\345\\206\\205\\345\\256\\271\\343\\201\\253\\345\\220\\210\\343\\202\\217\\343\\201\\233\\343\\202\\213\\0\"\\\n  \"\\343\\203\\232\\343\\203\\274\\343\\202\\270\\343\\201\\253\\345\\220\\210\\343\\202\\217\\343\\201\\233\\343\\202\\213\\0\"\\\n  \"\\345\\271\\205\\343\\201\\253\\345\\220\\210\\343\\202\\217\\343\\201\\233\\343\\202\\213\\0\"\\\n  \"\\345\\271\\205\\343\\201\\253\\345\\220\\210\\343\\202\\217\\343\\201\\233\\343\\201\\246\\351\\200\\243\\347\\266\\232\\343\\201\\227\\343\\201\\246\\343\\203\\232\\343\\203\\274\\343\\202\\270\\343\\202\\222\\350\\241\\250\\347\\244\\272\\343\\201\\231\\343\\202\\213\\0\"\\\n  \"\\345\\215\\230\\344\\270\\200\\343\\201\\256\\343\\203\\232\\343\\203\\274\\343\\202\\270\\343\\201\\253\\345\\220\\210\\343\\202\\217\\343\\201\\233\\343\\202\\213\\0\"\\\n  \"\\343\\203\\225\\343\\202\\251\\343\\203\\263\\343\\203\\210:\\0\"\\\n  \"\\350\\243\\275\\346\\234\\254\\344\\270\\255\\342\\200\\246 %d \\343\\203\\232\\343\\203\\274\\343\\202\\270\\0\"\\\n  \"\\343\\203\\232\\343\\203\\274\\343\\202\\270 %s \\343\\201\\247\\343\\203\\206\\343\\202\\255\\343\\202\\271\\343\\203\\210\\343\\201\\214\\350\\246\\213\\343\\201\\244\\343\\201\\213\\343\\202\\212\\343\\201\\276\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"%s \\343\\203\\232\\343\\203\\274\\343\\202\\270\\343\\201\\253\\346\\214\\207\\345\\256\\232\\343\\201\\225\\343\\202\\214\\343\\201\\237\\346\\226\\207\\345\\255\\227\\345\\210\\227\\343\\201\\214\\350\\246\\213\\343\\201\\244\\343\\201\\213\\343\\202\\212\\343\\201\\276\\343\\201\\227\\343\\201\\237\\357\\274\\210\\344\\270\\200\\345\\221\\250\\357\\274\\211\\0\"\\\n  \"\\343\\202\\210\\343\\201\\217\\350\\252\\255\\343\\202\\200\\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253\\0\"\\\n  \"\\0\"\\\n  \"\\343\\203\\232\\343\\203\\274\\343\\202\\270\\343\\201\\270\\347\\247\\273\\345\\213\\225\\0\"\\\n  \"\\343\\202\\210\\343\\201\\217\\350\\252\\255\\343\\202\\200\\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253\\343\\202\\222\\350\\241\\250\\347\\244\\272\\343\\201\\227\\343\\201\\252\\343\\201\\204\\0\"\\\n  \"\\343\\203\\222\\343\\203\\263\\343\\203\\210: \\345\\206\\215\\343\\201\\263\\346\\244\\234\\347\\264\\242\\343\\201\\231\\343\\202\\213\\343\\201\\253\\343\\201\\257 F3 \\343\\202\\255\\343\\203\\274\\343\\202\\222\\344\\275\\277\\347\\224\\250\\343\\201\\227\\343\\201\\276\\343\\201\\231\\0\"\\\n  \"\\347\\224\\273\\345\\203\\217\\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253 (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"SumatraPDF \\343\\202\\222 PDF \\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253\\343\\201\\256\\346\\227\\242\\345\\256\\232\\343\\201\\256\\343\\202\\242\\343\\203\\227\\343\\203\\252\\343\\202\\261\\343\\203\\274\\343\\202\\267\\343\\203\\247\\343\\203\\263\\343\\201\\253\\343\\201\\227\\343\\201\\276\\343\\201\\231\\343\\201\\213?\\0\"\\\n  \"SumatraPDF \\343\\202\\222\\350\\246\\217\\345\\256\\232\\343\\201\\256 PDF \\343\\203\\252\\343\\203\\274\\343\\203\\200\\343\\203\\274\\343\\201\\253\\343\\201\\231\\343\\202\\213\\0\"\\\n  \"\\346\\274\\253\\347\\224\\273\\343\\203\\242\\343\\203\\274\\343\\203\\211(&G)\\0\"\\\n  \"\\345\\244\\247\\346\\226\\207\\345\\255\\227\\343\\201\\250\\345\\260\\217\\346\\226\\207\\345\\255\\227\\343\\202\\222\\345\\214\\272\\345\\210\\245\\343\\201\\231\\343\\202\\213\\0\"\\\n  \"Mobi \\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\0\"\\\n  \"\\345\\244\\211\\346\\233\\264\\346\\227\\245\\346\\231\\202:\\0\"\\\n  \"\\346\\226\\260\\343\\201\\227\\343\\201\\204\\343\\203\\220\\343\\203\\274\\343\\202\\270\\343\\203\\247\\343\\203\\263 %s \\343\\201\\214\\345\\210\\251\\347\\224\\250\\345\\217\\257\\350\\203\\275\\343\\201\\247\\343\\201\\231\\343\\200\\202\\346\\226\\260\\343\\201\\227\\343\\201\\204\\343\\203\\220\\343\\203\\274\\343\\202\\270\\343\\203\\247\\343\\203\\263\\343\\202\\222\\343\\203\\200\\343\\202\\246\\343\\203\\263\\343\\203\\255\\343\\203\\274\\343\\203\\211\\343\\201\\227\\343\\201\\276\\343\\201\\231\\343\\201\\213\\357\\274\\237\\0\"\\\n  \"\\346\\254\\241\\343\\201\\256\\343\\203\\232\\343\\203\\274\\343\\202\\270\\0\"\\\n  \"\\344\\270\\200\\350\\207\\264\\343\\201\\214\\350\\246\\213\\343\\201\\244\\343\\201\\213\\343\\202\\212\\343\\201\\276\\343\\201\\233\\343\\202\\223\\343\\201\\247\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"\\350\\241\\214 %u \\343\\201\\257\\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253 %s \\343\\201\\253\\350\\246\\213\\343\\201\\244\\343\\201\\213\\343\\202\\212\\343\\201\\276\\343\\201\\233\\343\\202\\223\\0\"\\\n  \"\\345\\220\\214\\346\\234\\237\\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253\\343\\201\\214\\350\\246\\213\\343\\201\\244\\343\\201\\213\\343\\202\\212\\343\\201\\276\\343\\201\\233\\343\\202\\223\\0\"\\\n  \"\\343\\201\\223\\343\\201\\256\\344\\275\\215\\347\\275\\256\\343\\201\\253\\345\\220\\214\\346\\234\\237\\346\\203\\205\\345\\240\\261\\343\\201\\214\\343\\201\\202\\343\\202\\212\\343\\201\\276\\343\\201\\233\\343\\202\\223\\0\"\\\n  \"\\343\\203\\232\\343\\203\\274\\343\\202\\270\\346\\225\\260:\\0\"\\\n  \"\\0\"\\\n  \"\\351\\226\\213\\343\\201\\217\\0\"\\\n  \"PDF-XChange \\343\\201\\247\\351\\226\\213\\343\\201\\217(&I)\\0\"\\\n  \"\\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\343\\202\\222\\351\\226\\213\\343\\201\\217...\\0\"\\\n  \"%s \\343\\201\\247\\351\\226\\213\\343\\201\\217\\0\"\\\n  \"Adobe Reader \\343\\201\\247\\351\\226\\213\\343\\201\\217(&A)\\0\"\\\n  \"Foxit Reader \\343\\201\\247\\351\\226\\213\\343\\201\\217(&F)\\0\"\\\n  \"Microsoft HTML \\343\\203\\230\\343\\203\\253\\343\\203\\227\\343\\201\\247\\351\\226\\213\\343\\201\\217(&M)\\0\"\\\n  \"Microsoft XPS-Viewer\\343\\201\\247\\351\\226\\213\\343\\201\\217(&M)\\0\"\\\n  \"\\343\\203\\227\\343\\203\\255\\343\\203\\221\\343\\203\\206\\343\\202\\243(&R)\\0\"\\\n  \"\\343\\203\\227\\343\\203\\255\\343\\203\\221\\343\\203\\206\\343\\202\\243(&R)\\tCtrl+D\\0\"\\\n  \"PDF \\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\0\"\\\n  \"PDF \\346\\234\\200\\351\\201\\251\\345\\214\\226:\\0\"\\\n  \"PDF \\345\\207\\272\\345\\212\\233:\\0\"\\\n  \"PDF \\343\\203\\220\\343\\203\\274\\343\\202\\270\\343\\203\\247\\343\\203\\263:\\0\"\\\n  \"PDF \\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\0\"\\\n  \"\\343\\203\\232\\343\\203\\274\\343\\202\\270\\346\\214\\207\\345\\256\\232(&G)...\\tCtrl+G\\0\"\\\n  \"\\343\\203\\232\\343\\203\\274\\343\\202\\270 %s\\0\"\\\n  \"\\343\\203\\232\\343\\203\\274\\343\\202\\270 \\343\\202\\265\\343\\202\\244\\343\\202\\272:\\0\"\\\n  \"\\343\\203\\232\\343\\203\\274\\343\\202\\270\\347\\225\\252\\345\\217\\267 %u \\343\\201\\214\\345\\255\\230\\345\\234\\250\\343\\201\\227\\343\\201\\276\\343\\201\\233\\343\\202\\223\\0\"\\\n  \"\\343\\203\\232\\343\\203\\274\\343\\202\\270\\343\\201\\256\\346\\213\\241\\345\\244\\247\\347\\270\\256\\345\\260\\217\\0\"\\\n  \"\\343\\203\\232\\343\\203\\274\\343\\202\\270:\\0\"\\\n  \"PalmDoc \\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\0\"\\\n  \"\\346\\217\\217\\347\\224\\273\\344\\270\\255...\\0\"\\\n  \"PostScript \\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\0\"\\\n  \"\\343\\203\\227\\343\\203\\254\\343\\202\\274\\343\\203\\263\\343\\203\\206\\343\\203\\274\\343\\202\\267\\343\\203\\247\\343\\203\\263(&E)\\tCtrl+L\\0\"\\\n  \"\\345\\211\\215\\343\\201\\256\\343\\203\\232\\343\\203\\274\\343\\202\\270\\0\"\\\n  \"\\345\\215\\260\\345\\210\\267\\0\"\\\n  \"\\345\\215\\260\\345\\210\\267\\347\\257\\204\\345\\233\\262\\0\"\\\n  \"\\346\\214\\207\\345\\256\\232\\343\\201\\225\\343\\202\\214\\343\\201\\237\\343\\203\\227\\343\\203\\252\\343\\203\\263\\343\\202\\277\\343\\201\\214\\350\\246\\213\\343\\201\\244\\343\\201\\213\\343\\202\\212\\343\\201\\276\\343\\201\\233\\343\\202\\223\\0\"\\\n  \"\\345\\215\\260\\345\\210\\267\\343\\202\\222\\345\\256\\237\\350\\241\\214\\344\\270\\255\\343\\201\\247\\343\\201\\231\\343\\200\\202\\0\"\\\n  \"\\345\\215\\260\\345\\210\\267\\343\\202\\222\\345\\256\\237\\350\\241\\214\\344\\270\\255\\343\\201\\247\\343\\201\\231\\343\\200\\202\\344\\270\\255\\346\\255\\242\\343\\201\\227\\343\\201\\246\\347\\265\\202\\344\\272\\206\\343\\201\\227\\343\\201\\276\\343\\201\\231\\343\\201\\213\\357\\274\\237\\0\"\\\n  \"\\345\\215\\260\\345\\210\\267\\343\\201\\257\\346\\227\\242\\343\\201\\253\\345\\256\\237\\350\\241\\214\\343\\201\\225\\343\\202\\214\\343\\201\\246\\343\\201\\204\\343\\201\\276\\343\\201\\231\\343\\200\\202\\344\\270\\255\\346\\255\\242\\343\\201\\276\\343\\201\\237\\343\\201\\257\\345\\206\\215\\345\\256\\237\\350\\241\\214\\343\\201\\227\\343\\201\\276\\343\\201\\231\\343\\201\\213\\357\\274\\237\\0\"\\\n  \"%d / %d \\343\\203\\232\\343\\203\\274\\343\\202\\270\\347\\233\\256\\343\\202\\222\\345\\215\\260\\345\\210\\267\\344\\270\\255...\\0\"\\\n  \"\\345\\215\\260\\345\\210\\267\\343\\201\\256\\345\\225\\217\\351\\241\\214\\343\\201\\247\\343\\201\\231\\343\\200\\202\\0\"\\\n  \"\\345\\220\\215\\345\\211\\215\\343\\202\\222\\345\\244\\211\\346\\233\\264(&N)...\\tF2\\0\"\\\n  \"\\351\\226\\213\\343\\201\\213\\343\\202\\214\\343\\201\\237\\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253\\343\\202\\222\\350\\250\\230\\346\\206\\266\\343\\201\\231\\343\\202\\213(&O)\\0\"\\\n  \"\\343\\201\\212\\346\\260\\227\\343\\201\\253\\345\\205\\245\\343\\202\\212\\343\\201\\213\\343\\202\\211\\345\\211\\212\\351\\231\\244\\0\"\\\n  \"\\343\\203\\232\\343\\203\\274\\343\\202\\270 %s \\343\\202\\222\\343\\201\\212\\346\\260\\227\\343\\201\\253\\345\\205\\245\\343\\202\\212\\343\\201\\213\\343\\202\\211\\345\\211\\212\\351\\231\\244\\0\"\\\n  \"\\345\\220\\215\\345\\211\\215\\343\\201\\256\\345\\244\\211\\346\\233\\264\\345\\220\\215\\0\"\\\n  \"\\345\\267\\246\\343\\201\\253\\345\\233\\236\\350\\273\\242(&L)\\tCtrl+Shift+-\\0\"\\\n  \"\\345\\217\\263\\343\\201\\253\\345\\233\\236\\350\\273\\242(&R)\\tCtrl+Shift++\\0\"\\\n  \"\\345\\220\\215\\345\\211\\215\\343\\202\\222\\344\\273\\230\\343\\201\\221\\343\\201\\246\\344\\277\\235\\345\\255\\230\\0\"\\\n  \"\\343\\202\\267\\343\\203\\247\\343\\203\\274\\343\\203\\210\\343\\202\\253\\343\\203\\203\\343\\203\\210\\343\\202\\222\\344\\275\\234\\346\\210\\220(&H)...\\tCtrl+Shift+S\\0\"\\\n  \"%d (%d \\344\\270\\255) \\343\\202\\222\\346\\244\\234\\347\\264\\242\\343\\201\\227\\343\\201\\246\\343\\201\\204\\343\\201\\276\\343\\201\\231...\\0\"\\\n  \"\\343\\201\\231\\343\\201\\271\\343\\201\\246\\351\\201\\270\\346\\212\\236(&A)\\0\"\\\n  \"\\343\\201\\231\\343\\201\\271\\343\\201\\246\\351\\201\\270\\346\\212\\236(&A)\\tCtrl+A\\0\"\\\n  \"Ctrl+\\345\\267\\246\\343\\203\\236\\343\\202\\246\\343\\202\\271 \\343\\203\\234\\343\\202\\277\\343\\203\\263\\343\\201\\247\\345\\206\\205\\345\\256\\271\\343\\202\\222\\351\\201\\270\\346\\212\\236\\343\\201\\227\\343\\201\\276\\343\\201\\231\\0\"\\\n  \"\\0\"\\\n  \"\\351\\233\\273\\345\\255\\220\\343\\203\\241\\343\\203\\274\\343\\203\\253\\343\\201\\247\\351\\200\\201\\344\\277\\241(&E)...\\0\"\\\n  \"\\351\\200\\206\\351\\240\\206\\346\\244\\234\\347\\264\\242\\343\\202\\263\\343\\203\\236\\343\\203\\263\\343\\203\\211\\343\\203\\251\\343\\202\\244\\343\\203\\263\\343\\201\\256\\350\\250\\255\\345\\256\\232\\0\"\\\n  \"\\343\\203\\226\\343\\203\\203\\343\\202\\257\\343\\203\\236\\343\\203\\274\\343\\202\\257\\343\\202\\222\\350\\241\\250\\347\\244\\272(&B)\\0\"\\\n  \"\\351\\200\\243\\347\\266\\232\\343\\201\\227\\343\\201\\246\\343\\203\\232\\343\\203\\274\\343\\202\\270\\343\\202\\222\\350\\241\\250\\347\\244\\272(&P)\\0\"\\\n  \"\\343\\203\\204\\343\\203\\274\\343\\203\\253 \\343\\203\\220\\343\\203\\274\\343\\201\\256\\350\\241\\250\\347\\244\\272(&T)\\0\"\\\n  \"\\343\\201\\212\\346\\260\\227\\343\\201\\253\\345\\205\\245\\343\\202\\212\\343\\201\\256\\350\\241\\250\\347\\244\\272\\0\"\\\n  \"\\343\\202\\210\\343\\201\\217\\350\\252\\255\\343\\202\\200\\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253\\344\\270\\200\\350\\246\\247\\343\\202\\222\\350\\241\\250\\347\\244\\272\\0\"\\\n  \"\\345\\210\\251\\347\\224\\250\\345\\217\\257\\350\\203\\275\\343\\201\\252\\343\\202\\211\\343\\203\\226\\343\\203\\203\\343\\202\\257\\343\\203\\236\\343\\203\\274\\343\\202\\257 \\343\\202\\265\\343\\202\\244\\343\\203\\211 \\343\\203\\220\\343\\203\\274\\343\\202\\222\\350\\241\\250\\347\\244\\272(&B)\\0\"\\\n  \"\\345\\215\\230\\344\\270\\200\\343\\201\\256\\343\\203\\232\\343\\203\\274\\343\\202\\270\\0\"\\\n  \"\\350\\254\\216\\343\\201\\256\\343\\202\\250\\343\\203\\251\\343\\203\\274\\343\\201\\214\\347\\231\\272\\347\\224\\237\\343\\201\\227\\343\\201\\276\\343\\201\\227\\343\\201\\237\\357\\274\\201\\n\\n\\343\\200\\214\\343\\202\\255\\343\\203\\243\\343\\203\\263\\343\\202\\273\\343\\203\\253\\343\\200\\215\\343\\202\\222\\343\\202\\257\\343\\203\\252\\343\\203\\203\\343\\202\\257\\343\\201\\227\\343\\201\\246\\343\\200\\201\\343\\201\\223\\343\\201\\256\\343\\202\\250\\343\\203\\251\\343\\203\\274\\343\\201\\214\\350\\265\\267\\343\\201\\223\\343\\201\\243\\343\\201\\237\\347\\212\\266\\346\\263\\201\\343\\202\\222\\345\\240\\261\\345\\221\\212\\343\\201\\227\\343\\201\\246\\344\\270\\213\\343\\201\\225\\343\\202\\213\\343\\201\\250\\345\\212\\251\\343\\201\\213\\343\\202\\212\\343\\201\\276\\343\\201\\231\\343\\200\\202\\0\"\\\n  \"\\343\\202\\275\\343\\203\\274\\343\\202\\271 \\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253 %s \\343\\201\\253\\343\\201\\257\\345\\220\\214\\346\\234\\237\\343\\203\\235\\343\\202\\244\\343\\203\\263\\343\\203\\210\\343\\201\\214\\343\\201\\202\\343\\202\\212\\343\\201\\276\\343\\201\\233\\343\\202\\223\\0\"\\\n  \"\\351\\241\\214\\345\\220\\215:\\0\"\\\n  \"SumatraPDF \\343\\201\\256\\343\\202\\252\\343\\203\\227\\343\\202\\267\\343\\203\\247\\343\\203\\263\\0\"\\\n  \"SumatraPDF \\343\\201\\256\\346\\233\\264\\346\\226\\260\\0\"\\\n  \"SumatraPDF \\343\\201\\214\\343\\202\\257\\343\\203\\251\\343\\203\\203\\343\\202\\267\\343\\203\\245\\343\\201\\227\\343\\201\\276\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"SumatraPDF \\343\\201\\257\\350\\246\\217\\345\\256\\232\\343\\201\\256 PDF \\343\\203\\252\\343\\203\\274\\343\\203\\200\\343\\203\\274\\343\\201\\247\\343\\201\\231\\0\"\\\n  \"SumatraPDF \\343\\201\\257\\350\\246\\217\\345\\256\\232\\343\\201\\256 PDF \\343\\203\\252\\343\\203\\274\\343\\203\\200\\343\\203\\274\\343\\201\\253\\343\\201\\252\\343\\202\\212\\343\\201\\276\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"\\345\\220\\214\\346\\234\\237\\345\\214\\226\\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253\\343\\201\\214\\351\\226\\213\\343\\201\\221\\343\\201\\276\\343\\201\\233\\343\\202\\223\\0\"\\\n  \"\\343\\202\\277\\343\\202\\260\\344\\273\\230\\343\\201\\215 PDF\\0\"\\\n  \"\\343\\203\\206\\343\\202\\255\\343\\202\\271\\343\\203\\210 \\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\0\"\\\n  \"\\343\\201\\223\\343\\201\\256\\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\343\\201\\257\\343\\202\\265\\343\\203\\235\\343\\203\\274\\343\\203\\210\\343\\201\\227\\343\\201\\246\\343\\201\\204\\343\\201\\252\\343\\201\\204\\346\\251\\237\\350\\203\\275(%s)\\343\\202\\222\\344\\275\\277\\347\\224\\250\\343\\201\\227\\343\\201\\246\\343\\201\\204\\343\\202\\213\\343\\201\\237\\343\\202\\201\\343\\200\\201\\346\\255\\243\\343\\201\\227\\343\\201\\217\\346\\217\\217\\347\\224\\273\\343\\201\\247\\343\\201\\215\\343\\201\\252\\343\\201\\204\\345\\217\\257\\350\\203\\275\\346\\200\\247\\343\\201\\214\\343\\201\\202\\343\\202\\212\\343\\201\\276\\343\\201\\231\\0\"\\\n  \"\\343\\202\\277\\343\\202\\244\\343\\203\\210\\343\\203\\253:\\0\"\\\n  \"\\344\\270\\215\\346\\230\\216\\343\\201\\252\\343\\202\\275\\343\\203\\274\\343\\202\\271 \\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253 (%s)\\0\"\\\n  \"\\343\\202\\277\\343\\203\\226\\343\\202\\222\\344\\275\\277\\343\\201\\206(&t)\\0\"\\\n  \"\\350\\241\\250\\347\\244\\272\\0\"\\\n  \"Web \\343\\202\\265\\343\\202\\244\\343\\203\\210\\343\\201\\256\\350\\250\\252\\345\\225\\217(&W)\\0\"\\\n  \"\\350\\255\\246\\345\\221\\212\\0\"\\\n  \"XPS \\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\0\"\\\n  \"\\346\\234\\200\\346\\226\\260\\343\\201\\256\\343\\203\\220\\343\\203\\274\\343\\202\\270\\343\\203\\247\\343\\203\\263\\343\\201\\247\\343\\201\\231\\343\\200\\202\\0\"\\\n  \"\\343\\203\\220\\343\\203\\274\\343\\202\\270\\343\\203\\247\\343\\203\\263 %s \\343\\201\\247\\343\\201\\231\\0\"\\\n  \"OK\\0\"\\\n  \"\\346\\213\\241\\345\\244\\247\\0\"\\\n  \"\\347\\270\\256\\345\\260\\217\\0\"\\\n  \"\\346\\213\\241\\345\\244\\247\\347\\216\\207\\0\"\\\n  \"[\\345\\244\\211\\346\\233\\264\\343\\202\\222\\346\\244\\234\\345\\207\\272: \\346\\233\\264\\346\\226\\260\\344\\270\\255] %s\\0\"\\\n  \"\\343\\202\\263\\343\\203\\224\\343\\203\\274\\343\\201\\231\\343\\202\\213\\343\\203\\206\\343\\202\\255\\343\\202\\271\\343\\203\\210\\0\"\\\n  \"\\345\\215\\260\\345\\210\\267\\343\\201\\231\\343\\202\\213\\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\0\";\n\nconst char * gTranslations_kr = \n  \"\\354\\240\\225\\353\\263\\264(&A)\\0\"\\\n  \"\\354\\213\\244\\354\\240\\234 \\355\\201\\254\\352\\270\\260(&A)\\tCtrl+1\\0\"\\\n  \"\\352\\263\\240\\352\\270\\211 \\354\\230\\265\\354\\205\\230(&A)...\\0\"\\\n  \"\\354\\204\\240\\355\\203\\235\\355\\225\\234 \\353\\252\\250\\353\\223\\240 \\355\\216\\230\\354\\235\\264\\354\\247\\200(&A)\\0\"\\\n  \"\\354\\235\\264\\354\\240\\204\\354\\227\\220 \\353\\263\\270 \\355\\216\\230\\354\\235\\264\\354\\247\\200(&B)\\tAlt+\\354\\231\\274\\354\\252\\275 \\353\\260\\251\\355\\226\\245\\355\\202\\244\\0\"\\\n  \"\\354\\261\\205\\354\\262\\230\\353\\237\\274 \\353\\263\\264\\352\\270\\260(&B)\\tCtrl+8\\0\"\\\n  \"\\353\\213\\253\\352\\270\\260(&C)\\tCtrl+W\\0\"\\\n  \"\\354\\204\\240\\355\\203\\235\\355\\225\\234 \\353\\266\\200\\353\\266\\204 \\353\\263\\265\\354\\202\\254(&C)\\0\"\\\n  \"\\354\\204\\240\\355\\203\\235\\355\\225\\234 \\353\\266\\200\\353\\266\\204 \\353\\263\\265\\354\\202\\254(&C)\\tCtrl+C\\0\"\\\n  \"\\353\\213\\244\\354\\213\\234\\353\\212\\224 \\353\\254\\273\\354\\247\\200 \\354\\225\\212\\352\\270\\260(&D)\\0\"\\\n  \"\\354\\247\\235\\354\\210\\230 \\355\\216\\230\\354\\235\\264\\354\\247\\200\\353\\247\\214(&E)\\0\"\\\n  \"\\353\\221\\220 \\355\\216\\230\\354\\235\\264\\354\\247\\200\\354\\224\\251(&F)\\tCtrl+7\\0\"\\\n  \"\\355\\214\\214\\354\\235\\274(&F)\\0\"\\\n  \"\\354\\260\\276\\352\\270\\260(&F):\\0\"\\\n  \"\\354\\262\\253 \\355\\216\\230\\354\\235\\264\\354\\247\\200(&F)\\tHome\\0\"\\\n  \"\\354\\235\\270\\354\\207\\204 \\354\\230\\201\\354\\227\\255\\354\\227\\220 \\355\\216\\230\\354\\235\\264\\354\\247\\200 \\353\\247\\236\\354\\266\\224\\352\\270\\260(&F)\\0\"\\\n  \"\\352\\260\\200\\352\\270\\260(&G)\\0\"\\\n  \"\\354\\235\\264\\353\\217\\231\\355\\225\\240 \\355\\216\\230\\354\\235\\264\\354\\247\\200(&G):\\0\"\\\n  \"\\353\\217\\204\\354\\233\\200\\353\\247\\220(&H)\\0\"\\\n  \"\\353\\247\\210\\354\\247\\200\\353\\247\\211 \\355\\216\\230\\354\\235\\264\\354\\247\\200(&L)\\tEnd\\0\"\\\n  \"\\355\\231\\225\\353\\214\\200(&M):\\0\"\\\n  \"\\354\\230\\250\\353\\235\\274\\354\\235\\270 \\354\\204\\244\\353\\252\\205\\354\\204\\234(&M)\\0\"\\\n  \"\\353\\214\\200/\\354\\206\\214\\353\\254\\270\\354\\236\\220 \\352\\265\\254\\353\\266\\204(&M)\\0\"\\\n  \"\\353\\213\\244\\354\\235\\214 \\355\\216\\230\\354\\235\\264\\354\\247\\200(&N)\\t\\354\\230\\244\\353\\245\\270\\354\\252\\275 \\353\\260\\251\\355\\226\\245\\355\\202\\244\\0\"\\\n  \"\\354\\225\\204\\353\\213\\210\\354\\230\\244(&N)\\0\"\\\n  \"\\354\\225\\204\\353\\213\\210\\354\\230\\244(&N)\\0\"\\\n  \"\\355\\231\\200\\354\\210\\230 \\355\\216\\230\\354\\235\\264\\354\\247\\200\\353\\247\\214(&O)\\0\"\\\n  \"\\353\\254\\270\\354\\204\\234 \\354\\227\\264\\352\\270\\260(&O)\\0\"\\\n  \"\\354\\227\\264\\352\\270\\260(&O)...\\tCtrl+O\\0\"\\\n  \"\\354\\230\\265\\354\\205\\230(&O)...\\0\"\\\n  \"\\353\\271\\204\\353\\260\\200\\353\\262\\210\\355\\230\\270(&P):\\0\"\\\n  \"\\353\\254\\270\\354\\204\\234 \\352\\263\\240\\354\\240\\225(&P)\\0\"\\\n  \"\\354\\235\\264\\354\\240\\204 \\355\\216\\230\\354\\235\\264\\354\\247\\200(&P)\\t\\354\\231\\274\\354\\252\\275 \\353\\260\\251\\355\\226\\245\\355\\202\\244\\0\"\\\n  \"\\354\\235\\270\\354\\207\\204(&P)...\\0\"\\\n  \"\\354\\235\\270\\354\\207\\204(&P)...\\tCtrl+P\\0\"\\\n  \"\\354\\235\\270\\354\\207\\204(&P)... (\\352\\261\\260\\353\\266\\200\\353\\220\\250)\\0\"\\\n  \"\\354\\235\\264 \\353\\254\\270\\354\\204\\234\\354\\235\\230 \\353\\271\\204\\353\\260\\200\\353\\262\\210\\355\\230\\270 \\352\\270\\260\\354\\226\\265(&R)\\0\"\\\n  \"\\352\\260\\201 \\353\\254\\270\\354\\204\\234\\354\\235\\230 \\354\\204\\244\\354\\240\\225 \\352\\270\\260\\354\\226\\265(&R)\\0\"\\\n  \"\\352\\263\\240\\354\\240\\225 \\353\\254\\270\\354\\204\\234 \\354\\240\\234\\352\\261\\260(&R)\\0\"\\\n  \"\\353\\213\\244\\353\\245\\270 \\354\\235\\264\\353\\246\\204\\354\\234\\274\\353\\241\\234 \\354\\240\\200\\354\\236\\245(&S)...\\0\"\\\n  \"\\353\\213\\244\\353\\245\\270 \\354\\235\\264\\353\\246\\204\\354\\234\\274\\353\\241\\234 \\354\\240\\200\\354\\236\\245(&S)...\\tCtrl+S\\0\"\\\n  \"\\354\\204\\244\\354\\240\\225(&S)\\0\"\\\n  \"(\\355\\225\\204\\354\\232\\224\\355\\225\\234 \\352\\262\\275\\354\\232\\260,) \\354\\235\\270\\354\\207\\204 \\354\\230\\201\\354\\227\\255\\354\\227\\220 \\353\\247\\236\\354\\266\\260 \\355\\216\\230\\354\\235\\264\\354\\247\\200 \\354\\266\\225\\354\\206\\214(&S)\\0\"\\\n  \"\\355\\225\\234 \\355\\216\\230\\354\\235\\264\\354\\247\\200\\354\\224\\251(&S)\\tCtrl+6\\0\"\\\n  \"\\354\\235\\264 \\353\\262\\204\\354\\240\\204 \\352\\261\\264\\353\\204\\210\\353\\233\\260\\352\\270\\260(&S)\\0\"\\\n  \"\\354\\233\\220\\353\\236\\230 \\355\\216\\230\\354\\235\\264\\354\\247\\200 \\355\\201\\254\\352\\270\\260 \\354\\202\\254\\354\\232\\251(&U)\\0\"\\\n  \"\\353\\263\\264\\352\\270\\260(&V)\\0\"\\\n  \"\\354\\260\\275(&W)\\0\"\\\n  \"\\354\\230\\210(&Y)\\0\"\\\n  \"\\353\\260\\260\\354\\234\\250(&Z)\\0\"\\\n  \"(/ %d)\\0\"\\\n  \"(%s \\355\\216\\230\\354\\235\\264\\354\\247\\200)\\0\"\\\n  \"SumatraPDF \\354\\240\\225\\353\\263\\264\\0\"\\\n  \"\\354\\246\\220\\352\\262\\250\\354\\260\\276\\352\\270\\260 \\354\\266\\224\\352\\260\\200.\\0\"\\\n  \"%s \\355\\216\\230\\354\\235\\264\\354\\247\\200\\353\\245\\274 \\354\\246\\220\\352\\262\\250\\354\\260\\276\\352\\270\\260\\354\\227\\220 \\354\\266\\224\\352\\260\\200\\0\"\\\n  \"%s \\355\\216\\230\\354\\235\\264\\354\\247\\200\\354\\235\\230 \\354\\246\\220\\352\\262\\250\\354\\260\\276\\352\\270\\260 \\354\\235\\264\\353\\246\\204\\354\\235\\204 \\354\\236\\205\\353\\240\\245\\355\\225\\230\\354\\204\\270\\354\\232\\224. (\\354\\204\\240\\355\\203\\235 \\354\\202\\254\\355\\225\\255) :\\0\"\\\n  \"\\354\\246\\220\\352\\262\\250\\354\\260\\276\\352\\270\\260\\354\\227\\220 \\354\\266\\224\\352\\260\\200\\0\"\\\n  \"\\352\\263\\240\\352\\270\\211\\0\"\\\n  \"\\353\\252\\250\\353\\223\\240 \\355\\214\\214\\354\\235\\274\\0\"\\\n  \"\\354\\247\\200\\354\\233\\220\\355\\225\\230\\353\\212\\224 \\353\\252\\250\\353\\223\\240 \\353\\254\\270\\354\\204\\234\\0\"\\\n  \"\\355\\224\\204\\353\\241\\234\\352\\267\\270\\353\\236\\250:\\0\"\\\n  \"PDF \\355\\214\\214\\354\\235\\274 \\355\\231\\225\\354\\236\\245\\354\\236\\220\\353\\245\\274 \\354\\227\\260\\352\\262\\260\\355\\225\\240\\352\\271\\214\\354\\232\\224?\\0\"\\\n  \"\\354\\262\\250\\353\\266\\200: %s\\0\"\\\n  \"\\354\\240\\200\\354\\236\\220:\\0\"\\\n  \"\\354\\236\\220\\353\\217\\231\\0\"\\\n  \"\\354\\236\\220\\353\\217\\231\\354\\234\\274\\353\\241\\234 \\354\\227\\205\\353\\215\\260\\354\\235\\264\\355\\212\\270 \\355\\231\\225\\354\\235\\270(&U)\\0\"\\\n  \"\\354\\261\\205\\354\\262\\230\\353\\237\\274 \\353\\263\\264\\352\\270\\260\\0\"\\\n  \"\\354\\261\\205\\352\\260\\210\\355\\224\\274(&M)\\tF12\\0\"\\\n  \"\\354\\261\\205\\352\\260\\210\\355\\224\\274 \\353\\260\\224\\353\\241\\234\\352\\260\\200\\352\\270\\260\\0\"\\\n  \"%s / %s \\355\\216\\230\\354\\235\\264\\354\\247\\200\\354\\227\\220 \\354\\261\\205\\352\\260\\210\\355\\224\\274 \\353\\260\\224\\353\\241\\234\\352\\260\\200\\352\\270\\260\\0\"\\\n  \"\\354\\261\\205\\352\\260\\210\\355\\224\\274\\0\"\\\n  \"\\353\\260\\224\\354\\235\\264\\355\\212\\270\\0\"\\\n  \"CHM \\353\\254\\270\\354\\204\\234\\0\"\\\n  \"\\354\\235\\270\\355\\204\\260\\353\\204\\267\\354\\227\\220 \\354\\240\\221\\354\\206\\215\\355\\225\\240 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244. (%#x \\354\\230\\244\\353\\245\\230)\\0\"\\\n  \"\\354\\267\\250\\354\\206\\214\\0\"\\\n  \"\\354\\235\\264 \\355\\214\\214\\354\\235\\274\\354\\235\\204 \\354\\235\\270\\354\\207\\204\\355\\225\\240 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\354\\227\\255\\353\\260\\251\\355\\226\\245 \\352\\262\\200\\354\\203\\211 \\353\\252\\205\\353\\240\\271\\354\\235\\204 \\354\\213\\234\\354\\236\\221\\355\\225\\240 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.  \\354\\204\\244\\354\\240\\225\\354\\227\\220\\354\\204\\234 \\353\\252\\205\\353\\240\\271\\354\\244\\204\\354\\235\\204 \\355\\231\\225\\354\\235\\270\\355\\225\\230\\354\\204\\270\\354\\232\\224.\\0\"\\\n  \"\\354\\226\\270\\354\\226\\264 \\353\\260\\224\\352\\276\\270\\352\\270\\260(Change Language)\\0\"\\\n  \"\\354\\227\\205\\353\\215\\260\\354\\235\\264\\355\\212\\270 \\355\\231\\225\\354\\235\\270(&U)\\0\"\\\n  \"\\353\\247\\214\\355\\231\\224 \\354\\261\\205\\0\"\\\n  \"\\355\\230\\270\\355\\231\\230\\354\\204\\261\\0\"\\\n  \"\\355\\225\\234 \\355\\216\\230\\354\\235\\264\\354\\247\\200\\354\\224\\251 \\352\\263\\204\\354\\206\\215\\0\"\\\n  \"\\354\\235\\264\\354\\226\\264\\354\\204\\234 \\354\\261\\205\\354\\262\\230\\353\\237\\274 \\353\\263\\264\\352\\270\\260\\0\"\\\n  \"\\353\\221\\220 \\355\\216\\230\\354\\235\\264\\354\\247\\200\\354\\224\\251 \\352\\263\\204\\354\\206\\215\\0\"\\\n  \"\\353\\262\\210\\354\\227\\255 \\352\\270\\260\\354\\227\\254\\0\"\\\n  \"\\354\\235\\264\\353\\257\\270\\354\\247\\200 \\353\\263\\265\\354\\202\\254(&I)\\0\"\\\n  \"\\353\\247\\201\\355\\201\\254 \\354\\243\\274\\354\\206\\214 \\353\\263\\265\\354\\202\\254(&L)\\0\"\\\n  \"\\354\\243\\274\\354\\204\\235(\\354\\204\\244\\353\\252\\205) \\353\\263\\265\\354\\202\\254(&M)\\0\"\\\n  \"\\353\\254\\270\\352\\265\\254 \\353\\263\\265\\354\\202\\254\\352\\260\\200 \\352\\261\\260\\353\\266\\200\\353\\220\\220\\354\\212\\265\\353\\213\\210\\353\\213\\244. (\\354\\235\\264\\353\\257\\270\\354\\247\\200\\353\\247\\214 \\353\\263\\265\\354\\202\\254\\355\\225\\251\\353\\213\\210\\353\\213\\244.)\\0\"\\\n  \"\\354\\240\\200\\354\\236\\221\\352\\266\\214:\\0\"\\\n  \"\\355\\224\\204\\353\\246\\260\\355\\204\\260 \\354\\206\\215\\354\\204\\261\\354\\235\\204 \\352\\260\\200\\354\\240\\270\\354\\230\\254 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\355\\224\\204\\353\\246\\260\\355\\204\\260\\353\\245\\274 \\354\\264\\210\\352\\270\\260\\355\\231\\224\\355\\225\\240 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\355\\216\\230\\354\\235\\264\\354\\247\\200\\353\\245\\274 \\353\\240\\214\\353\\215\\224\\353\\247\\201\\355\\225\\240 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\353\\247\\214\\353\\223\\240 \\353\\202\\240\\354\\247\\234:\\0\"\\\n  \"\\355\\230\\204\\354\\236\\254 \\355\\214\\214\\354\\235\\274\\0\"\\\n  \"\\354\\273\\244\\354\\204\\234 \\354\\234\\204\\354\\271\\230:\\0\"\\\n  \"\\354\\202\\254\\354\\232\\251\\354\\236\\220 \\354\\247\\200\\354\\240\\225 \\353\\260\\260\\354\\234\\250(&Z)...\\tCtrl+Y\\0\"\\\n  \"\\352\\270\\260\\353\\263\\270 \\352\\265\\254\\354\\204\\261(&L):\\0\"\\\n  \"\\352\\270\\260\\353\\263\\270 \\353\\260\\260\\354\\234\\250(&Z):\\0\"\\\n  \"\\355\\217\\254\\355\\204\\260\\353\\270\\224 \\353\\260\\251\\354\\213\\235\\354\\227\\220\\354\\204\\234\\353\\212\\224 \\352\\270\\260\\353\\263\\270 PDF \\353\\246\\254\\353\\215\\224\\353\\241\\234 \\353\\260\\224\\352\\277\\200 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\352\\261\\260\\353\\266\\200\\353\\220\\234 \\354\\202\\254\\354\\232\\251 \\352\\266\\214\\355\\225\\234:\\0\"\\\n  \"DjVu \\353\\254\\270\\354\\204\\234\\0\"\\\n  \"\\353\\254\\270\\354\\204\\234 \\354\\206\\215\\354\\204\\261\\0\"\\\n  \"\\354\\230\\210\\0\"\\\n  \"\\353\\201\\235\\353\\202\\264\\352\\270\\260(&X)\\tCtrl+Q\\0\"\\\n  \"ePub \\353\\254\\270\\354\\204\\234\\0\"\\\n  \"\\353\\271\\204\\353\\260\\200\\353\\262\\210\\355\\230\\270 \\354\\236\\205\\353\\240\\245\\0\"\\\n  \"%s\\354\\235\\230 \\353\\271\\204\\353\\260\\200\\353\\262\\210\\355\\230\\270\\353\\245\\274 \\354\\236\\205\\353\\240\\245\\355\\225\\230\\354\\204\\270\\354\\232\\224.\\0\"\\\n  \"PDF \\353\\254\\270\\354\\204\\234\\353\\245\\274 \\353\\215\\224\\353\\270\\224 \\355\\201\\264\\353\\246\\255\\355\\225\\240 \\353\\225\\214 \\355\\230\\270\\354\\266\\234\\355\\225\\240 \\353\\252\\205\\353\\240\\271\\354\\244\\204 \\354\\236\\205\\353\\240\\245:\\0\"\\\n  \"%s (\\354\\235\\204)\\353\\245\\274 \\353\\266\\210\\353\\237\\254\\354\\230\\244\\353\\212\\224 \\354\\244\\221\\354\\227\\220 \\354\\230\\244\\353\\245\\230\\352\\260\\200 \\353\\260\\234\\354\\203\\235\\355\\226\\210\\354\\212\\265\\353\\213\\210\\353\\213\\244!\\0\"\\\n  \"\\354\\246\\220\\352\\262\\250\\354\\260\\276\\352\\270\\260(&A)\\0\"\\\n  \"\\354\\235\\264\\355\\233\\204\\354\\227\\220 \\353\\263\\270 \\355\\216\\230\\354\\235\\264\\354\\247\\200(&O)\\tAlt+\\354\\230\\244\\353\\245\\270\\354\\252\\275 \\353\\260\\251\\355\\226\\245\\355\\202\\244\\0\"\\\n  \"\\354\\240\\204\\354\\262\\264 \\355\\231\\224\\353\\251\\264(&U)\\tCtrl+Shift+L\\0\"\\\n  \"\\353\\221\\220 \\355\\216\\230\\354\\235\\264\\354\\247\\200\\354\\224\\251\\0\"\\\n  \"\\355\\214\\214\\354\\235\\274 \\354\\235\\264\\353\\246\\204\\354\\235\\204 \\353\\260\\224\\352\\276\\270\\354\\247\\200 \\353\\252\\273\\355\\226\\210\\354\\212\\265\\353\\213\\210\\353\\213\\244!\\0\"\\\n  \"\\355\\214\\214\\354\\235\\274\\354\\235\\204 \\354\\240\\200\\354\\236\\245\\355\\225\\230\\354\\247\\200 \\353\\252\\273\\355\\226\\210\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\353\\271\\240\\353\\245\\270 \\354\\233\\271 \\353\\263\\264\\352\\270\\260\\0\"\\\n  \"\\354\\246\\220\\352\\262\\250\\354\\260\\276\\352\\270\\260\\0\"\\\n  \"FictionBook \\353\\254\\270\\354\\204\\234\\0\"\\\n  \"%s \\355\\214\\214\\354\\235\\274\\354\\235\\204 \\354\\260\\276\\354\\235\\204 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\355\\214\\214\\354\\235\\274 \\355\\201\\254\\352\\270\\260:\\0\"\\\n  \"\\355\\214\\214\\354\\235\\274:\\0\"\\\n  \"\\354\\260\\276\\352\\270\\260(&D)...\\tCtrl+F\\0\"\\\n  \"\\354\\260\\276\\352\\270\\260\\0\"\\\n  \"\\353\\213\\244\\354\\235\\214 \\354\\260\\276\\352\\270\\260\\0\"\\\n  \"\\354\\235\\264\\354\\240\\204 \\354\\260\\276\\352\\270\\260\\0\"\\\n  \"\\354\\260\\276\\352\\270\\260:\\0\"\\\n  \"\\353\\202\\264\\354\\232\\251\\354\\227\\220 \\353\\247\\236\\354\\266\\244(&C)\\tCtrl+3\\0\"\\\n  \"\\355\\216\\230\\354\\235\\264\\354\\247\\200(\\354\\204\\270\\353\\241\\234) \\353\\247\\236\\354\\266\\244(&P)\\tCtrl+0\\0\"\\\n  \"\\353\\204\\210\\353\\271\\204(\\352\\260\\200\\353\\241\\234) \\353\\247\\236\\354\\266\\244(&H)\\tCtrl+2\\0\"\\\n  \"\\353\\202\\264\\354\\232\\251\\354\\227\\220 \\353\\247\\236\\354\\266\\244\\0\"\\\n  \"\\355\\216\\230\\354\\235\\264\\354\\247\\200(\\354\\204\\270\\353\\241\\234) \\353\\247\\236\\354\\266\\244\\0\"\\\n  \"\\353\\204\\210\\353\\271\\204(\\352\\260\\200\\353\\241\\234) \\353\\247\\236\\354\\266\\244\\0\"\\\n  \"\\354\\247\\200\\354\\206\\215\\354\\240\\201\\354\\235\\270 \\353\\204\\210\\353\\271\\204 \\353\\247\\236\\354\\266\\244\\352\\263\\274 \\355\\216\\230\\354\\235\\264\\354\\247\\200 \\353\\263\\264\\352\\270\\260\\0\"\\\n  \"\\355\\225\\234 \\355\\216\\230\\354\\235\\264\\354\\247\\200 \\353\\247\\236\\354\\266\\244\\0\"\\\n  \"\\352\\270\\200\\352\\274\\264:\\0\"\\\n  \"%d \\355\\216\\230\\354\\235\\264\\354\\247\\200 \\354\\235\\275\\354\\226\\264\\353\\223\\244\\354\\235\\264\\353\\212\\224 \\354\\244\\221...\\0\"\\\n  \"%s \\355\\216\\230\\354\\235\\264\\354\\247\\200\\354\\227\\220\\354\\204\\234 \\353\\254\\270\\354\\236\\220\\354\\227\\264 \\354\\260\\276\\354\\235\\214\\0\"\\\n  \"%s \\355\\216\\230\\354\\235\\264\\354\\247\\200\\354\\227\\220\\354\\204\\234 (\\353\\213\\244\\354\\213\\234) \\353\\254\\270\\354\\236\\220\\354\\227\\264 \\354\\260\\276\\354\\235\\214\\0\"\\\n  \"\\354\\265\\234\\352\\267\\274\\354\\227\\220 \\354\\235\\275\\354\\235\\200 \\355\\214\\214\\354\\235\\274\\0\"\\\n  \"\\0\"\\\n  \"\\355\\216\\230\\354\\235\\264\\354\\247\\200\\353\\241\\234 \\352\\260\\200\\352\\270\\260\\0\"\\\n  \"\\354\\265\\234\\352\\267\\274\\354\\227\\220 \\354\\235\\275\\354\\235\\200 \\355\\214\\214\\354\\235\\274 \\352\\260\\220\\354\\266\\224\\352\\270\\260\\0\"\\\n  \"\\355\\236\\214\\355\\212\\270: \\353\\213\\244\\354\\213\\234 \\354\\260\\276\\354\\234\\274\\353\\240\\244\\353\\251\\264, F3 \\355\\202\\244\\353\\245\\274 \\353\\210\\204\\353\\245\\264\\354\\204\\270\\354\\232\\224.\\0\"\\\n  \"\\354\\235\\264\\353\\257\\270\\354\\247\\200 \\355\\214\\214\\354\\235\\274 (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"SumatraPDF\\353\\245\\274 PDF \\355\\214\\214\\354\\235\\274\\354\\235\\230 \\352\\270\\260\\353\\263\\270 \\355\\224\\204\\353\\241\\234\\352\\267\\270\\353\\236\\250\\354\\234\\274\\353\\241\\234 \\353\\247\\214\\353\\223\\244\\352\\271\\214\\354\\232\\224?\\0\"\\\n  \"SumatraPDF\\353\\245\\274 \\352\\270\\260\\353\\263\\270 PDF \\353\\246\\254\\353\\215\\224\\353\\241\\234 \\353\\247\\214\\353\\223\\244\\352\\270\\260\\0\"\\\n  \"\\353\\247\\214\\355\\231\\224 \\353\\260\\251\\354\\213\\235(&G)\\0\"\\\n  \"\\353\\214\\200/\\354\\206\\214\\353\\254\\270\\354\\236\\220 \\352\\265\\254\\353\\266\\204\\0\"\\\n  \"Mobi \\353\\254\\270\\354\\204\\234\\0\"\\\n  \"\\352\\263\\240\\354\\271\\234 \\353\\202\\240\\354\\247\\234:\\0\"\\\n  \"\\354\\203\\210 \\353\\262\\204\\354\\240\\204 %s (\\354\\235\\264)\\352\\260\\200 \\354\\202\\254\\354\\232\\251 \\352\\260\\200\\353\\212\\245\\355\\225\\251\\353\\213\\210\\353\\213\\244.  \\353\\213\\244\\354\\232\\264\\353\\241\\234\\353\\223\\234\\355\\225\\240\\352\\271\\214\\354\\232\\224?\\0\"\\\n  \"\\353\\213\\244\\354\\235\\214 \\355\\216\\230\\354\\235\\264\\354\\247\\200\\0\"\\\n  \"\\354\\235\\274\\354\\271\\230\\355\\225\\230\\353\\212\\224 \\355\\225\\255\\353\\252\\251\\354\\235\\204 \\354\\260\\276\\354\\235\\204 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"%u \\355\\226\\211 (%s \\355\\214\\214\\354\\235\\274) \\354\\243\\274\\353\\263\\200\\354\\227\\220\\354\\204\\234 \\353\\260\\234\\352\\262\\254\\353\\220\\234 \\352\\262\\260\\352\\263\\274\\352\\260\\200 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\353\\217\\231\\352\\270\\260\\355\\231\\224 \\355\\214\\214\\354\\235\\274\\354\\235\\204 \\354\\260\\276\\354\\235\\204 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\354\\235\\264 \\354\\234\\204\\354\\271\\230\\354\\235\\230 \\353\\217\\231\\352\\270\\260\\355\\231\\224 \\354\\240\\225\\353\\263\\264\\352\\260\\200 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\355\\216\\230\\354\\235\\264\\354\\247\\200 \\354\\210\\230:\\0\"\\\n  \"\\355\\231\\225\\354\\235\\270\\0\"\\\n  \"\\354\\227\\264\\352\\270\\260\\0\"\\\n  \"PDF-XChange\\353\\241\\234 \\354\\227\\264\\352\\270\\260(&I)\\0\"\\\n  \"\\353\\254\\270\\354\\204\\234 \\354\\227\\264\\352\\270\\260...\\0\"\\\n  \"%s(\\354\\234\\274)\\353\\241\\234 \\354\\227\\264\\352\\270\\260\\0\"\\\n  \"Adobe Reader\\353\\241\\234 \\354\\227\\264\\352\\270\\260(&A)\\0\"\\\n  \"Foxit Reader\\353\\241\\234 \\354\\227\\264\\352\\270\\260(&F)\\0\"\\\n  \"Microsoft HTML Help\\353\\241\\234 \\354\\227\\264\\352\\270\\260(&M)\\0\"\\\n  \"Microsoft XPS-Viewer\\353\\241\\234 \\354\\227\\264\\352\\270\\260(&M)\\0\"\\\n  \"\\354\\206\\215\\354\\204\\261(&R)\\0\"\\\n  \"\\354\\206\\215\\354\\204\\261(&R)\\tCtrl+D\\0\"\\\n  \"PDF \\353\\254\\270\\354\\204\\234\\0\"\\\n  \"PDF \\354\\265\\234\\354\\240\\201\\355\\231\\224:\\0\"\\\n  \"PDF \\354\\240\\234\\354\\236\\221\\354\\236\\220:\\0\"\\\n  \"PDF \\353\\262\\204\\354\\240\\204:\\0\"\\\n  \"PDF \\353\\254\\270\\354\\204\\234\\0\"\\\n  \"\\355\\216\\230\\354\\235\\264\\354\\247\\200 \\354\\235\\264\\353\\217\\231(&G)...\\tCtrl+G\\0\"\\\n  \"%s \\355\\216\\230\\354\\235\\264\\354\\247\\200\\0\"\\\n  \"\\355\\216\\230\\354\\235\\264\\354\\247\\200 \\355\\201\\254\\352\\270\\260:\\0\"\\\n  \"%u \\355\\216\\230\\354\\235\\264\\354\\247\\200\\352\\260\\200 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\355\\216\\230\\354\\235\\264\\354\\247\\200 \\353\\260\\260\\354\\234\\250 \\354\\241\\260\\354\\240\\225\\0\"\\\n  \"\\355\\216\\230\\354\\235\\264\\354\\247\\200:\\0\"\\\n  \"PalmDoc \\353\\254\\270\\354\\204\\234\\0\"\\\n  \"\\353\\240\\214\\353\\215\\224\\353\\247\\201 \\354\\244\\221\\354\\236\\205\\353\\213\\210\\353\\213\\244, \\352\\270\\260\\353\\213\\244\\353\\246\\254\\354\\204\\270\\354\\232\\224...\\0\"\\\n  \"Postscript \\353\\254\\270\\354\\204\\234\\0\"\\\n  \"\\355\\224\\204\\353\\246\\254\\354\\240\\240\\355\\205\\214\\354\\235\\264\\354\\205\\230(&E)\\tCtrl+L\\0\"\\\n  \"\\354\\235\\264\\354\\240\\204 \\355\\216\\230\\354\\235\\264\\354\\247\\200\\0\"\\\n  \"\\354\\235\\270\\354\\207\\204\\0\"\\\n  \"\\354\\235\\270\\354\\207\\204 \\353\\262\\224\\354\\234\\204\\0\"\\\n  \"\\354\\247\\200\\354\\240\\225\\353\\220\\234 \\354\\235\\264\\353\\246\\204\\354\\235\\230 \\355\\224\\204\\353\\246\\260\\355\\204\\260\\352\\260\\200 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\354\\235\\270\\354\\207\\204 \\354\\236\\221\\354\\227\\205 \\354\\244\\221\\354\\236\\205\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\354\\225\\204\\354\\247\\201 \\354\\235\\270\\354\\207\\204\\352\\260\\200 \\354\\247\\204\\355\\226\\211 \\354\\244\\221\\354\\236\\205\\353\\213\\210\\353\\213\\244.  \\354\\244\\221\\353\\213\\250\\355\\225\\230\\352\\263\\240 \\353\\201\\235\\353\\202\\274\\352\\271\\214\\354\\232\\224?\\0\"\\\n  \"\\354\\225\\204\\354\\247\\201 \\354\\235\\270\\354\\207\\204\\352\\260\\200 \\354\\247\\204\\355\\226\\211 \\354\\244\\221\\354\\236\\205\\353\\213\\210\\353\\213\\244.  \\354\\244\\221\\353\\213\\250\\355\\225\\230\\352\\263\\240 \\353\\213\\244\\354\\213\\234 \\354\\213\\234\\354\\236\\221\\355\\225\\240\\352\\271\\214\\354\\232\\224?\\0\"\\\n  \"%d / %d \\355\\216\\230\\354\\235\\264\\354\\247\\200 \\354\\235\\270\\354\\207\\204\\355\\225\\230\\353\\212\\224 \\354\\244\\221...\\0\"\\\n  \"\\354\\235\\270\\354\\207\\204\\355\\225\\230\\353\\212\\224 \\354\\244\\221\\354\\227\\220 \\353\\254\\270\\354\\240\\234\\352\\260\\200 \\353\\260\\234\\354\\203\\235\\355\\226\\210\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\354\\235\\264\\353\\246\\204 \\353\\260\\224\\352\\276\\270\\352\\270\\260(&N)...\\tF2\\0\"\\\n  \"\\354\\227\\264\\354\\227\\210\\353\\215\\230 \\355\\214\\214\\354\\235\\274(\\353\\223\\244) \\352\\270\\260\\354\\226\\265(&O)\\0\"\\\n  \"\\354\\246\\220\\352\\262\\250\\354\\260\\276\\352\\270\\260\\354\\227\\220\\354\\204\\234 \\354\\240\\234\\352\\261\\260\\0\"\\\n  \"\\354\\246\\220\\352\\262\\250\\354\\260\\276\\352\\270\\260\\354\\227\\220\\354\\204\\234 %s \\355\\216\\230\\354\\235\\264\\354\\247\\200 \\354\\240\\234\\352\\261\\260\\0\"\\\n  \"\\353\\260\\224\\352\\277\\200 \\354\\235\\264\\353\\246\\204\\0\"\\\n  \"\\353\\260\\230\\354\\213\\234\\352\\263\\204 \\353\\260\\251\\355\\226\\245\\354\\234\\274\\353\\241\\234 \\355\\232\\214\\354\\240\\204(&L)\\tCtrl+Shift+-\\0\"\\\n  \"\\354\\213\\234\\352\\263\\204 \\353\\260\\251\\355\\226\\245\\354\\234\\274\\353\\241\\234 \\355\\232\\214\\354\\240\\204(&R)\\tCtrl+Shift++\\0\"\\\n  \"\\353\\213\\244\\353\\245\\270 \\354\\235\\264\\353\\246\\204\\354\\234\\274\\353\\241\\234 \\354\\240\\200\\354\\236\\245\\0\"\\\n  \"\\353\\260\\224\\353\\241\\234\\352\\260\\200\\352\\270\\260 \\354\\240\\200\\354\\236\\245(&H)...\\tCtrl+Shift+S\\0\"\\\n  \"%d / %d \\355\\216\\230\\354\\235\\264\\354\\247\\200 \\352\\262\\200\\354\\203\\211\\355\\225\\230\\353\\212\\224 \\354\\244\\221...\\0\"\\\n  \"\\353\\252\\250\\353\\221\\220 \\354\\204\\240\\355\\203\\235(&A)\\0\"\\\n  \"\\353\\252\\250\\353\\221\\220 \\354\\204\\240\\355\\203\\235(&A)\\tCtrl+A\\0\"\\\n  \"Ctrl+\\353\\247\\210\\354\\232\\260\\354\\212\\244 \\354\\231\\274\\354\\252\\275 \\353\\262\\204\\355\\212\\274\\354\\234\\274\\353\\241\\234 \\353\\202\\264\\354\\232\\251\\354\\235\\204 \\354\\204\\240\\355\\203\\235\\355\\225\\230\\354\\204\\270\\354\\232\\224.\\0\"\\\n  \"\\354\\204\\240\\355\\203\\235:\\0\"\\\n  \"\\354\\235\\264\\353\\251\\224\\354\\235\\274\\353\\241\\234 \\353\\263\\264\\353\\202\\264\\352\\270\\260(&E)...\\0\"\\\n  \"\\353\\252\\205\\353\\240\\271\\354\\244\\204 \\354\\227\\255\\353\\260\\251\\355\\226\\245 \\355\\203\\220\\354\\203\\211 \\354\\204\\244\\354\\240\\225\\0\"\\\n  \"\\354\\261\\205\\352\\260\\210\\355\\224\\274 \\353\\263\\264\\354\\235\\264\\352\\270\\260(&B)\\0\"\\\n  \"\\354\\227\\260\\354\\206\\215\\354\\240\\201\\354\\234\\274\\353\\241\\234 \\355\\216\\230\\354\\235\\264\\354\\247\\200 \\353\\263\\264\\354\\235\\264\\352\\270\\260(&P)\\0\"\\\n  \"\\353\\217\\204\\352\\265\\254\\353\\252\\250\\354\\235\\214 \\353\\263\\264\\354\\235\\264\\352\\270\\260(&T)\\0\"\\\n  \"\\354\\246\\220\\352\\262\\250\\354\\260\\276\\352\\270\\260 \\353\\263\\264\\354\\235\\264\\352\\270\\260\\0\"\\\n  \"\\354\\265\\234\\352\\267\\274\\354\\227\\220 \\354\\235\\275\\354\\235\\200 \\355\\214\\214\\354\\235\\274 \\353\\263\\264\\354\\235\\264\\352\\270\\260\\0\"\\\n  \"\\354\\202\\254\\354\\232\\251 \\352\\260\\200\\353\\212\\245\\355\\225\\230\\353\\251\\264, \\354\\261\\205\\352\\260\\210\\355\\224\\274 \\354\\230\\206\\352\\265\\254\\353\\246\\254 \\355\\221\\234\\354\\213\\234\\354\\244\\204 \\353\\263\\264\\354\\235\\264\\352\\270\\260(&B)\\0\"\\\n  \"\\355\\225\\234 \\355\\216\\230\\354\\235\\264\\354\\247\\200\\354\\224\\251\\0\"\\\n  \"\\353\\257\\270\\354\\225\\210\\355\\225\\251\\353\\213\\210\\353\\213\\244, \\352\\267\\270\\353\\237\\260 \\354\\235\\274\\354\\235\\264 \\354\\235\\274\\354\\226\\264\\353\\202\\240 \\353\\246\\254\\352\\260\\200 \\354\\227\\206\\353\\212\\224\\353\\215\\260!\\n\\n\\354\\235\\264 \\354\\266\\251\\353\\217\\214\\354\\235\\230 \\354\\233\\220\\354\\235\\270\\354\\235\\204 \\355\\225\\264\\352\\262\\260\\355\\225\\230\\353\\212\\224\\353\\215\\260 \\353\\217\\204\\354\\233\\200\\354\\235\\204 \\354\\243\\274\\353\\240\\244\\353\\251\\264, '\\354\\267\\250\\354\\206\\214'\\353\\245\\274 \\353\\210\\204\\353\\245\\264\\354\\204\\270\\354\\232\\224.\\0\"\\\n  \"\\354\\233\\220\\353\\263\\270 \\355\\214\\214\\354\\235\\274 %s (\\354\\235\\200)\\353\\212\\224 \\353\\217\\231\\352\\270\\260\\355\\231\\224 \\354\\247\\200\\354\\240\\220\\354\\235\\264 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\354\\243\\274\\354\\240\\234:\\0\"\\\n  \"SumatraPDF \\354\\230\\265\\354\\205\\230\\0\"\\\n  \"SumatraPDF \\354\\227\\205\\353\\215\\260\\354\\235\\264\\355\\212\\270\\0\"\\\n  \"SumatraPDF \\354\\266\\251\\353\\217\\214\\353\\202\\250\\0\"\\\n  \"SumatraPDF\\353\\212\\224 \\352\\270\\260\\353\\263\\270 PDF \\353\\246\\254\\353\\215\\224\\354\\236\\205\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"SumatraPDF\\353\\212\\224 \\354\\235\\264\\354\\240\\234 \\352\\270\\260\\353\\263\\270 PDF \\353\\246\\254\\353\\215\\224\\354\\227\\254\\354\\225\\274 \\355\\225\\251\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\353\\217\\231\\352\\270\\260\\355\\231\\224 \\355\\214\\214\\354\\235\\274\\354\\235\\204 \\354\\227\\264 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\355\\203\\234\\352\\267\\270\\354\\236\\210\\353\\212\\224 PDF\\0\"\\\n  \"\\355\\205\\215\\354\\212\\244\\355\\212\\270 \\353\\254\\270\\354\\204\\234\\0\"\\\n  \"\\354\\235\\264 \\353\\254\\270\\354\\204\\234\\353\\212\\224 \\354\\247\\200\\354\\233\\220\\353\\220\\230\\354\\247\\200 \\354\\225\\212\\353\\212\\224 \\352\\270\\260\\353\\212\\245 (%s)\\354\\235\\204 \\354\\202\\254\\354\\232\\251\\355\\226\\210\\352\\263\\240, \\354\\240\\234\\353\\214\\200\\353\\241\\234 \\353\\240\\214\\353\\215\\224\\353\\247\\201\\353\\220\\230\\354\\247\\200 \\354\\225\\212\\354\\235\\204 \\354\\210\\230 \\354\\236\\210\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\354\\240\\234\\353\\252\\251:\\0\"\\\n  \"\\354\\225\\214 \\354\\210\\230 \\354\\227\\206\\353\\212\\224 \\354\\233\\220\\353\\263\\270 \\355\\214\\214\\354\\235\\274 (%s)\\0\"\\\n  \"\\355\\203\\255 \\354\\202\\254\\354\\232\\251(&T)\\0\"\\\n  \"\\353\\263\\264\\352\\270\\260\\0\"\\\n  \"\\354\\233\\271 \\354\\202\\254\\354\\235\\264\\355\\212\\270 \\353\\260\\251\\353\\254\\270(&V)\\0\"\\\n  \"\\352\\262\\275\\352\\263\\240\\0\"\\\n  \"XPS \\353\\254\\270\\354\\204\\234\\0\"\\\n  \"\\354\\265\\234\\354\\213\\240 \\353\\262\\204\\354\\240\\204\\354\\235\\204 \\354\\202\\254\\354\\232\\251\\355\\225\\230\\352\\263\\240 \\354\\236\\210\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\355\\230\\204\\354\\236\\254 \\353\\262\\204\\354\\240\\204\\354\\235\\200 %s \\354\\236\\205\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\353\\260\\260\\354\\234\\250\\0\"\\\n  \"\\355\\231\\225\\353\\214\\200\\0\"\\\n  \"\\354\\266\\225\\354\\206\\214\\0\"\\\n  \"\\353\\260\\260\\354\\234\\250 \\352\\263\\204\\354\\210\\230\\0\"\\\n  \"[\\353\\263\\200\\352\\262\\275 \\352\\260\\220\\354\\247\\200\\353\\220\\250.  \\354\\203\\210\\353\\241\\234 \\352\\263\\240\\354\\271\\230\\353\\212\\224 \\354\\244\\221...] %s\\0\"\\\n  \"\\353\\254\\270\\352\\265\\254 \\353\\263\\265\\354\\202\\254\\355\\225\\230\\353\\212\\224 \\354\\244\\221...\\0\"\\\n  \"\\353\\254\\270\\354\\204\\234 \\354\\235\\270\\354\\207\\204\\0\";\n\nconst char * gTranslations_ku = \n  \"\\330\\257\\333\\225\\330\\261\\330\\250\\330\\247\\330\\261\\333\\225\\333\\214&\\0\"\\\n  \"\\331\\202\\333\\225\\330\\250\\330\\247\\330\\261\\333\\225\\333\\214 \\332\\225\\330\\247\\330\\263\\330\\252\\333\\225\\331\\202\\333\\214\\331\\206\\333\\225 &\\tCtrl+1\\0\"\\\n  \"\\331\\207\\333\\225\\332\\265\\330\\250\\332\\230\\330\\247\\330\\261\\330\\257\\331\\206\\333\\214 \\331\\276\\333\\225\\330\\261\\333\\225\\330\\263\\333\\225\\331\\206\\330\\257\\331\\210\\331\\210 ...&\\0\"\\\n  \"\\331\\207\\333\\225\\331\\205\\331\\210\\331\\210 \\331\\276\\333\\225\\332\\225\\333\\225 \\330\\257\\333\\214\\330\\247\\330\\261\\333\\214\\332\\251\\330\\261\\330\\247\\331\\210\\333\\225\\332\\251\\330\\247\\331\\206&\\0\"\\\n  \"&\\332\\257\\333\\225\\332\\225\\330\\247\\331\\206\\333\\225\\331\\210\\333\\225\\tAlt+Left Arrow\\0\"\\\n  \"\\330\\264\\333\\216\\331\\210\\330\\247\\330\\262\\333\\214 \\331\\276\\333\\225\\330\\261\\330\\252\\331\\210\\331\\210\\332\\251&\\tCtrl+8\\0\"\\\n  \"\\330\\257\\330\\247\\330\\256\\330\\263\\330\\252\\331\\206&\\tCtrl+W\\0\"\\\n  \"\\331\\204\\333\\225\\330\\250\\333\\225\\330\\261\\332\\257\\330\\261\\330\\252\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 \\330\\257\\333\\214\\330\\247\\330\\261\\333\\214\\332\\251\\330\\261\\330\\247\\331\\210&\\0\"\\\n  \"\\331\\204\\333\\225\\330\\250\\333\\225\\330\\261\\332\\257\\330\\261\\330\\252\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 \\330\\257\\333\\214\\330\\247\\330\\261\\333\\214\\332\\251\\330\\261\\330\\247\\331\\210&\\tCtrl+C\\0\"\\\n  \"\\330\\257\\331\\210\\331\\210\\330\\250\\330\\247\\330\\261\\333\\225 \\331\\276\\330\\261\\330\\263\\333\\214\\330\\247\\330\\261 \\331\\205\\333\\225\\332\\251\\333\\225\\330\\261\\333\\225\\331\\210\\333\\225&\\0\"\\\n  \"\\330\\252\\333\\225\\331\\206\\331\\207\\330\\247 \\331\\276\\333\\225\\332\\225\\333\\225 \\330\\254\\331\\210\\331\\210\\330\\252\\333\\225\\332\\251\\330\\247\\331\\206&\\0\"\\\n  \"&\\332\\225\\331\\210\\331\\210\\332\\251\\330\\247\\330\\261\\tCtrl+7\\0\"\\\n  \"\\331\\201\\330\\247\\333\\214\\331\\204&\\0\"\\\n  \"\\330\\257\\333\\206\\330\\262\\333\\214\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214&:\\0\"\\\n  \"\\331\\276\\333\\225\\332\\225\\333\\225\\333\\214 \\333\\214\\333\\225\\332\\251\\333\\225\\331\\205&\\tHome\\0\"\\\n  \"\\332\\257\\331\\210\\331\\206\\330\\254\\330\\247\\331\\206\\330\\257\\331\\206\\333\\214 \\331\\276\\333\\225\\332\\225\\333\\225\\332\\251\\330\\247\\331\\206 \\330\\250\\333\\206 \\330\\264\\331\\210\\333\\216\\331\\206\\333\\214 \\332\\206\\330\\247\\331\\276\\332\\251\\330\\261\\330\\257\\331\\206&\\0\"\\\n  \"\\332\\206\\331\\210\\331\\210\\331\\206 \\330\\250\\333\\206&\\0\"\\\n  \"\\332\\206\\331\\210\\331\\210\\331\\206 \\330\\250\\333\\206 \\331\\276\\333\\225\\332\\225\\333\\225&:\\0\"\\\n  \"\\333\\214\\330\\247\\330\\261\\331\\205\\333\\225\\330\\252\\333\\214&\\0\"\\\n  \"\\330\\257\\331\\210\\330\\247\\333\\214\\331\\206 \\331\\276\\333\\225\\332\\225\\333\\225&\\tEnd\\0\"\\\n  \"\\332\\257\\333\\225\\331\\210\\330\\261\\333\\225\\332\\251\\330\\261\\330\\257\\331\\206&:\\0\"\\\n  \"\\331\\201\\333\\216\\330\\261\\332\\251\\330\\247\\330\\261\\333\\214&\\0\"\\\n  \"\\330\\246\\333\\225\\331\\206\\330\\254\\330\\247\\331\\205\\333\\214 \\331\\207\\330\\247\\331\\210\\330\\264\\333\\216\\331\\210\\333\\225&\\0\"\\\n  \"\\331\\276\\333\\225\\332\\225\\333\\225\\333\\214 \\330\\257\\331\\210\\330\\247\\330\\252\\330\\261&\\tRight Arrow\\0\"\\\n  \"\\331\\206\\333\\225\\330\\256\\333\\216\\330\\261&\\0\"\\\n  \"\\331\\206\\333\\225\\330\\256\\333\\216\\330\\261\\330\\214 \\330\\263\\331\\210\\331\\276\\330\\247\\330\\263&\\0\"\\\n  \"\\330\\252\\333\\225\\331\\206\\331\\207\\330\\247 \\331\\276\\333\\225\\332\\225\\333\\225 \\330\\252\\330\\247\\332\\251\\333\\225\\332\\251\\330\\247\\331\\206&\\0\"\\\n  \"\\332\\251\\330\\261\\330\\257\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 \\330\\250\\333\\225\\332\\265\\332\\257\\333\\225\\331\\206\\330\\247\\331\\205\\333\\225&\\0\"\\\n  \"\\332\\251\\330\\261\\330\\257\\331\\206\\333\\225\\331\\210\\333\\225...&\\tCtrl+O\\0\"\\\n  \"\\331\\207\\333\\225\\332\\265\\330\\250\\332\\230\\330\\247\\330\\261\\330\\257\\331\\206\\333\\225\\332\\251\\330\\247\\331\\206...&\\0\"\\\n  \"\\330\\252\\333\\216\\331\\276\\333\\225\\332\\225\\333\\225 \\331\\210\\331\\210\\330\\264\\333\\225&:\\0\"\\\n  \"\\330\\257\\333\\214\\330\\247\\330\\261\\333\\214\\332\\251\\330\\261\\330\\257\\331\\206\\333\\214 \\330\\250\\333\\225\\332\\265\\332\\257\\333\\225\\331\\206\\330\\247\\331\\205\\333\\225&\\0\"\\\n  \"\\331\\276\\333\\225\\332\\225\\333\\225\\333\\214 \\331\\276\\333\\216\\330\\264\\331\\210\\331\\210&\\tLeft Arrow\\0\"\\\n  \"\\332\\206\\330\\247\\331\\276\\332\\251\\330\\261\\330\\257\\331\\206...&\\0\"\\\n  \"\\332\\206\\330\\247\\331\\276\\332\\251\\330\\261\\330\\257\\331\\206...&\\tCtrl+P\\0\"\\\n  \"(\\332\\206\\330\\247\\331\\276\\332\\251\\330\\261\\330\\257\\331\\206... (\\332\\225\\333\\225\\330\\252\\332\\251\\330\\261\\330\\247\\333\\214\\333\\225\\331\\210\\333\\225&\\0\"\\\n  \"\\330\\250\\333\\214\\330\\261\\330\\256\\330\\263\\330\\252\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 \\330\\252\\333\\216\\331\\276\\333\\225\\332\\225\\333\\225 \\331\\210\\331\\210\\330\\264\\333\\225 \\330\\250\\333\\206 \\330\\246\\333\\225\\331\\205 \\330\\250\\333\\225\\332\\265\\332\\257\\333\\225\\331\\206\\330\\247\\331\\205\\333\\225\\333\\214\\333\\225&\\0\"\\\n  \"\\330\\250\\333\\214\\330\\261\\330\\256\\330\\263\\330\\252\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 \\330\\246\\333\\225\\331\\205 \\331\\207\\333\\225\\332\\265\\330\\250\\332\\230\\330\\247\\330\\261\\330\\257\\331\\206\\333\\225 \\330\\250\\333\\206 \\331\\207\\333\\225\\331\\205\\331\\210\\331\\210 \\330\\250\\333\\225\\332\\265\\332\\257\\333\\225\\331\\206\\330\\247\\331\\205\\333\\225\\332\\251\\330\\247\\331\\206&\\0\"\\\n  \"\\331\\204\\330\\247\\330\\250\\330\\261\\330\\257\\331\\206\\333\\214 \\330\\250\\333\\225\\332\\265\\332\\257\\333\\225\\331\\206\\330\\247\\331\\205\\333\\225&\\0\"\\\n  \"\\331\\276\\330\\247\\330\\261\\330\\247\\330\\263\\330\\252\\331\\206 \\331\\210\\333\\225\\332\\251\\331\\210...&\\0\"\\\n  \"&\\331\\276\\330\\247\\330\\261\\330\\247\\330\\263\\330\\252\\331\\206 \\331\\210\\333\\225\\332\\251\\331\\210...\\tCtrl+S\\0\"\\\n  \"\\332\\225\\333\\216\\332\\251\\330\\256\\330\\263\\330\\252\\331\\206\\333\\225\\332\\251\\330\\247\\331\\206&\\0\"\\\n  \"(\\332\\251\\331\\210\\330\\261\\330\\252\\332\\251\\330\\261\\330\\257\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 \\331\\276\\333\\225\\332\\225\\333\\225\\332\\251\\330\\247\\331\\206 \\330\\250\\333\\206 \\330\\264\\331\\210\\333\\216\\331\\206\\333\\214 \\332\\206\\330\\247\\331\\276\\332\\251\\330\\261\\330\\257\\331\\206 (\\330\\246\\333\\225\\332\\257\\333\\225\\330\\261 \\331\\276\\333\\216\\331\\210\\333\\214\\330\\263\\330\\252 \\330\\250\\331\\210\\331\\210&\\0\"\\\n  \"\\331\\276\\333\\225\\332\\225\\333\\225\\333\\214 \\330\\252\\330\\247\\332\\251&\\tCtrl+6\\0\"\\\n  \"\\331\\201\\333\\225\\330\\261\\330\\247\\331\\205\\333\\206\\330\\264\\332\\251\\330\\261\\330\\257\\331\\206\\333\\214 \\330\\246\\333\\225\\331\\205 \\331\\210\\333\\225\\330\\264\\330\\247\\331\\206\\333\\225&\\0\"\\\n  \"\\330\\250\\333\\225\\332\\251\\330\\247\\330\\261\\331\\207\\333\\216\\331\\206\\330\\247\\331\\206\\333\\214 \\331\\202\\333\\225\\330\\250\\330\\247\\330\\261\\333\\225\\333\\214 \\332\\225\\330\\247\\330\\263\\330\\252\\333\\225\\331\\202\\333\\214\\331\\206\\333\\225\\333\\214 \\331\\276\\333\\225\\332\\225\\333\\225\\332\\251\\330\\247\\331\\206&\\0\"\\\n  \"\\331\\276\\333\\214\\330\\264\\330\\247\\331\\206\\330\\257\\330\\247\\331\\206&\\0\"\\\n  \"&\\331\\276\\333\\225\\331\\206\\330\\254\\333\\225\\330\\261\\333\\225\\0\"\\\n  \"\\330\\250\\333\\225\\332\\265\\333\\216&\\0\"\\\n  \"\\331\\206\\330\\262\\333\\214\\332\\251 \\330\\256\\330\\263\\330\\252\\331\\206\\333\\225\\331\\210\\333\\225&\\0\"\\\n  \"(\\331\\204\\333\\225 %d)\\0\"\\\n  \"(\\331\\276\\333\\225\\332\\225\\333\\225 %s)\\0\"\\\n  \"SumatraPDF \\330\\257\\333\\225\\330\\261\\330\\250\\330\\247\\330\\261\\333\\225\\333\\214\\0\"\\\n  \"\\330\\262\\333\\214\\330\\247\\330\\257\\332\\251\\330\\261\\330\\257\\331\\206\\333\\214 \\330\\250\\333\\206 \\331\\204\\333\\214\\330\\263\\330\\252\\333\\214 \\331\\276\\333\\225\\330\\263\\333\\225\\331\\206\\330\\257\\333\\225\\332\\251\\330\\247\\331\\206\\0\"\\\n  \"\\330\\250\\333\\206 \\331\\276\\333\\225\\330\\263\\333\\225\\331\\206\\330\\257\\333\\225\\332\\251\\330\\247\\331\\206 %s \\330\\262\\333\\214\\330\\247\\330\\257\\332\\251\\330\\261\\330\\257\\331\\206\\333\\214 \\331\\276\\333\\225\\332\\225\\333\\225\\333\\214\\0\"\\\n  \"(\\330\\250\\333\\206 \\331\\276\\333\\225\\330\\263\\333\\225\\331\\206\\330\\257\\333\\225\\332\\251\\330\\247\\331\\206 \\330\\250\\333\\225\\331\\206\\330\\247\\331\\210\\333\\214 (\\330\\246\\330\\247\\330\\261\\333\\225\\330\\262\\331\\210\\331\\210\\331\\205\\333\\225\\331\\206\\330\\257\\330\\247\\331\\206\\333\\225 %s \\330\\262\\333\\214\\330\\247\\330\\257\\332\\251\\330\\261\\330\\257\\331\\206\\333\\214 \\331\\276\\333\\225\\332\\225\\333\\225\\333\\214 :\\0\"\\\n  \"\\330\\262\\333\\214\\330\\247\\330\\257\\332\\251\\330\\261\\330\\257\\331\\206 \\330\\250\\333\\206 \\331\\276\\333\\225\\330\\263\\333\\225\\331\\206\\330\\257\\333\\225\\332\\251\\330\\247\\331\\206\\0\"\\\n  \"\\331\\276\\333\\225\\330\\261\\333\\225\\330\\263\\333\\225\\331\\206\\330\\257\\331\\210\\331\\210\\0\"\\\n  \"\\331\\207\\333\\225\\331\\205\\331\\210\\331\\210 \\331\\201\\330\\247\\333\\214\\331\\204\\333\\225\\332\\251\\330\\247\\331\\206\\0\"\\\n  \"\\331\\207\\333\\225\\331\\205\\331\\210\\331\\210 \\330\\250\\333\\225\\332\\265\\332\\257\\333\\225\\331\\206\\330\\247\\331\\205\\333\\225 \\332\\257\\331\\210\\331\\206\\330\\254\\330\\247\\331\\210\\333\\225\\332\\251\\330\\247\\331\\206\\0\"\\\n  \"\\330\\250\\333\\225\\330\\261\\331\\206\\330\\247\\331\\205\\333\\225:\\0\"\\\n  \"\\330\\237PDF \\331\\276\\333\\225\\333\\214\\331\\210\\333\\225\\330\\263\\330\\252\\332\\251\\330\\261\\330\\257\\331\\206 \\330\\250\\333\\225 \\331\\201\\330\\247\\333\\214\\331\\204\\333\\225\\332\\251\\330\\247\\331\\206\\333\\214\\0\"\\\n  \"%s :\\331\\276\\330\\247\\330\\264\\332\\251\\333\\206\\0\"\\\n  \"\\330\\257\\330\\247\\331\\206\\333\\225\\330\\261:\\0\"\\\n  \"\\330\\256\\333\\206\\332\\251\\330\\247\\330\\261\\0\"\\\n  \"\\331\\276\\330\\264\\332\\251\\331\\206\\333\\214\\331\\206 \\330\\250\\333\\206 \\331\\206\\331\\210\\333\\216\\332\\251\\330\\261\\330\\257\\331\\206\\333\\225\\331\\210\\333\\225 \\330\\250\\333\\225 &\\330\\256\\333\\206\\332\\251\\330\\247\\330\\261\\333\\214\\0\"\\\n  \"\\330\\264\\333\\216\\331\\210\\330\\247\\330\\262\\333\\214 \\331\\276\\333\\225\\330\\261\\330\\252\\331\\210\\331\\210\\332\\251\\0\"\\\n  \"\\331\\206\\333\\214\\330\\264\\330\\247\\331\\206\\333\\225&\\332\\251\\330\\261\\330\\247\\331\\210\\333\\225\\332\\251\\330\\247\\331\\206\\tF12\\0\"\\\n  \"\\331\\206\\333\\214\\330\\264\\330\\247\\331\\206\\333\\225\\332\\251\\330\\261\\330\\257\\331\\206\\333\\214 \\332\\251\\331\\210\\330\\261\\330\\252\\333\\225 \\330\\246\\330\\247\\333\\214\\332\\251\\333\\206\\331\\206\\333\\225\\332\\251\\330\\247\\331\\206\\0\"\\\n  \"%s \\331\\204\\333\\225 %s \\331\\206\\333\\214\\330\\264\\330\\247\\331\\206\\333\\225\\332\\251\\330\\261\\330\\257\\331\\206\\333\\214 \\332\\251\\331\\210\\330\\261\\330\\252\\333\\225\\330\\246\\330\\247\\333\\214\\332\\251\\333\\206\\331\\206 \\330\\250\\333\\206 \\331\\276\\333\\225\\332\\225\\333\\225\\0\"\\\n  \"\\331\\206\\333\\214\\330\\264\\330\\247\\331\\206\\333\\225\\332\\251\\330\\261\\330\\247\\331\\210\\333\\225\\332\\251\\330\\247\\331\\206\\0\"\\\n  \"\\330\\250\\330\\247\\333\\214\\330\\252\\0\"\\\n  \"CHM \\330\\250\\333\\225\\332\\265\\332\\257\\333\\225\\331\\206\\330\\247\\331\\205\\333\\225\\332\\251\\330\\247\\331\\206\\333\\214 \\330\\254\\333\\206\\330\\261\\333\\214\\0\"\\\n  \".(%#x \\331\\206\\330\\247\\330\\252\\331\\210\\330\\247\\331\\206\\330\\261\\333\\216\\330\\252 \\331\\276\\333\\225\\333\\214\\331\\210\\333\\225\\331\\206\\330\\257\\333\\214 \\330\\250\\332\\251\\330\\261\\333\\216\\330\\252 \\330\\250\\333\\225 \\330\\246\\333\\214\\331\\206\\330\\252\\333\\225\\330\\261\\331\\206\\333\\216\\330\\252\\333\\225\\331\\210\\333\\225 (\\331\\207\\333\\225\\332\\265\\333\\225\\333\\214\\0\"\\\n  \"\\331\\276\\330\\247\\330\\264\\332\\257\\333\\225\\330\\262\\330\\250\\331\\210\\331\\206\\333\\225\\331\\210\\333\\225\\0\"\\\n  \"\\331\\206\\330\\247\\330\\252\\331\\210\\330\\247\\331\\206\\330\\261\\333\\216\\330\\252 \\330\\246\\333\\225\\331\\205 \\331\\201\\330\\247\\333\\214\\331\\204\\333\\225 \\332\\206\\330\\247\\331\\276 \\330\\250\\332\\251\\330\\261\\333\\216\\330\\252\\0\"\\\n  \"\\331\\206\\330\\247\\330\\252\\331\\210\\330\\247\\331\\206\\330\\261\\333\\216\\330\\252 \\331\\201\\330\\261\\331\\205\\330\\247\\331\\206\\333\\214 \\332\\257\\333\\225\\332\\225\\330\\247\\331\\206\\333\\214 \\331\\276\\333\\216\\332\\206\\333\\225\\331\\210\\330\\247\\331\\206\\333\\225 \\330\\246\\333\\225\\331\\206\\330\\254\\330\\247\\331\\205 \\330\\250\\330\\257\\330\\261\\333\\216\\330\\252. \\330\\252\\332\\251\\330\\247\\333\\214\\333\\225 \\331\\201\\330\\261\\331\\205\\330\\247\\331\\206\\333\\214 \\331\\207\\333\\216\\332\\265 \\330\\250\\331\\276\\330\\264\\332\\251\\331\\206\\333\\225 \\331\\204\\333\\225 \\332\\225\\333\\216\\332\\251\\330\\256\\330\\263\\330\\252\\331\\206\\333\\225\\332\\251\\330\\247\\331\\206\\330\\257\\330\\247\\0\"\\\n  \"\\332\\257\\333\\206\\332\\225\\333\\214\\331\\206\\333\\214 \\330\\262\\331\\205\\330\\247\\331\\206 (Change Language)\\0\"\\\n  \"\\331\\276\\330\\264\\332\\251\\331\\206\\333\\214\\331\\206 \\330\\250\\333\\206 &\\331\\206\\331\\210\\333\\216\\332\\251\\330\\261\\330\\257\\331\\206\\333\\225\\331\\210\\333\\225\\0\"\\\n  \"\\331\\276\\333\\225\\330\\261\\330\\252\\331\\210\\331\\210\\332\\251\\333\\214 \\332\\251\\333\\206\\331\\205\\333\\214\\330\\257\\333\\214\\0\"\\\n  \"\\332\\257\\331\\210\\331\\206\\330\\254\\330\\247\\331\\210\\0\"\\\n  \"\\330\\250\\333\\225\\330\\261\\330\\257\\333\\225\\331\\210\\330\\247\\331\\205\\0\"\\\n  \"\\331\\276\\333\\214\\330\\264\\330\\247\\331\\206\\330\\257\\330\\247\\331\\206\\333\\214 \\331\\276\\333\\225\\330\\261\\330\\252\\331\\210\\331\\210\\332\\251 \\330\\250\\333\\225 \\330\\250\\333\\225\\330\\261\\330\\257\\333\\225\\331\\210\\330\\247\\331\\205\\333\\214\\0\"\\\n  \"\\331\\276\\333\\214\\330\\264\\330\\247\\331\\206\\330\\257\\330\\247\\331\\206\\333\\214 \\332\\225\\331\\210\\331\\210\\332\\251\\330\\247\\330\\261 \\330\\250\\333\\225 \\330\\250\\333\\225\\330\\261\\330\\257\\333\\225\\331\\210\\330\\247\\331\\205\\333\\214\\0\"\\\n  \"\\331\\276\\333\\216\\330\\264\\331\\206\\333\\214\\330\\247\\330\\261\\332\\251\\330\\261\\330\\257\\331\\206\\333\\214 \\331\\210\\333\\225\\330\\261\\332\\257\\333\\216\\332\\225\\330\\247\\331\\206\\0\"\\\n  \"\\331\\204\\333\\225\\330\\250\\333\\225\\330\\261\\332\\257\\330\\261\\330\\252\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 &\\331\\210\\333\\216\\331\\206\\333\\225\\0\"\\\n  \"\\331\\204\\333\\225\\330\\250\\333\\225\\330\\261\\332\\257\\330\\261\\330\\252\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 &\\331\\206\\330\\247\\331\\210\\331\\206\\333\\214\\330\\264\\330\\247\\331\\206\\333\\214 \\330\\250\\333\\225\\330\\263\\330\\252\\333\\225\\330\\261\\0\"\\\n  \"\\331\\204\\333\\225\\330\\250\\333\\225\\330\\261\\332\\257\\330\\261\\330\\252\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 \\331\\204\\333\\216\\330\\257&\\331\\210\\330\\247\\331\\206\\333\\225\\332\\251\\330\\247\\331\\206\\0\"\\\n  \"(\\331\\204\\333\\225\\330\\250\\333\\225\\330\\261\\332\\257\\330\\261\\330\\252\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 \\330\\257\\333\\225\\331\\202 \\332\\225\\333\\225\\330\\252\\332\\251\\330\\261\\330\\247\\333\\214\\333\\225\\331\\210\\333\\225 (\\330\\252\\333\\225\\331\\206\\331\\207\\330\\247 \\331\\204\\333\\225\\330\\250\\333\\225\\330\\261\\332\\257\\330\\261\\330\\252\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 \\331\\210\\333\\216\\331\\206\\333\\225\\0\"\\\n  \"\\331\\205\\330\\247\\331\\201\\333\\214 \\331\\204\\333\\225\\330\\250\\333\\225\\330\\261\\332\\257\\330\\261\\330\\252\\331\\206\\333\\225\\331\\210\\333\\225:\\0\"\\\n  \"\\331\\206\\330\\247\\330\\252\\331\\210\\330\\247\\331\\206\\330\\261\\333\\216\\330\\252 \\330\\252\\330\\247\\333\\214\\330\\250\\333\\225\\330\\252\\331\\205\\333\\225\\331\\206\\330\\257\\333\\214\\333\\214\\333\\225\\332\\251\\330\\247\\331\\206\\333\\214 \\332\\206\\330\\247\\331\\276\\332\\251\\333\\225\\330\\261(\\331\\276\\330\\261\\333\\216\\331\\206\\330\\252\\333\\225\\330\\261) \\331\\210\\333\\225\\330\\261\\330\\250\\332\\257\\333\\214\\330\\261\\333\\216\\330\\252\\0\"\\\n  \"\\331\\206\\330\\247\\330\\252\\331\\210\\330\\247\\331\\206\\330\\261\\333\\216\\330\\252 \\330\\254\\330\\247\\331\\276\\332\\251\\333\\225\\330\\261 \\332\\225\\333\\216\\332\\251\\330\\250\\330\\256\\330\\261\\333\\216\\330\\252\\0\"\\\n  \"\\331\\206\\330\\247\\330\\252\\331\\210\\330\\247\\331\\206\\330\\261\\333\\216\\330\\252 \\331\\276\\333\\225\\332\\225\\333\\225 \\331\\276\\331\\210\\330\\256\\330\\252\\333\\225 \\330\\250\\332\\251\\330\\261\\333\\216\\330\\252\\0\"\\\n  \"\\330\\257\\330\\261\\331\\210\\330\\263\\330\\252\\332\\251\\330\\261\\330\\247\\331\\210:\\0\"\\\n  \"\\331\\201\\330\\247\\333\\214\\331\\204\\333\\214 \\330\\246\\333\\216\\330\\263\\330\\252\\330\\247\\0\"\\\n  \"\\330\\264\\331\\210\\333\\216\\331\\206\\333\\214 \\331\\206\\333\\214\\330\\264\\330\\247\\331\\206\\333\\225\\333\\214 \\331\\205\\330\\247\\331\\210\\330\\263:\\0\"\\\n  \"\\331\\207\\333\\216\\331\\206\\330\\247\\331\\206\\333\\225\\331\\276\\333\\216\\330\\264\\333\\225\\331\\210\\333\\225\\333\\214 &\\330\\252\\330\\247\\333\\214\\330\\250\\333\\225\\330\\252...\\tCtrl+Y\\0\"\\\n  \"\\330\\264\\333\\216\\331\\210\\330\\247\\330\\262\\333\\214 &\\330\\263\\333\\225\\330\\261\\333\\225\\332\\251\\333\\214:\\0\"\\\n  \"\\331\\207\\333\\216\\331\\206\\330\\247\\331\\206\\333\\225\\331\\276\\333\\216\\330\\264\\333\\225\\331\\210\\333\\225\\333\\214  &\\330\\263\\333\\225\\330\\261\\333\\225\\332\\251\\333\\214:\\0\"\\\n  \"(\\331\\206\\330\\247\\330\\252\\331\\210\\330\\247\\331\\206\\330\\261\\333\\216\\330\\252 \\330\\250\\332\\257\\333\\206\\332\\225\\330\\257\\330\\261\\333\\216\\330\\252 \\331\\204\\333\\225 \\330\\264\\333\\216\\331\\210\\330\\247\\330\\262\\333\\214 \\331\\207\\333\\225\\332\\265\\332\\257\\330\\261\\330\\252\\331\\206\\330\\257\\330\\247 (\\331\\276\\333\\206\\330\\261\\330\\252\\333\\225\\333\\214\\330\\250\\332\\265  PDF \\331\\276\\333\\214\\330\\264\\330\\247\\331\\206\\330\\257\\333\\225\\330\\261\\333\\214 \\330\\263\\333\\225\\330\\261\\333\\225\\332\\251\\333\\214\\0\"\\\n  \"\\331\\205\\333\\206\\332\\265\\333\\225\\330\\252\\331\\276\\333\\216\\330\\257\\330\\247\\331\\206\\333\\225 \\332\\225\\333\\225\\330\\252\\332\\251\\330\\261\\330\\247\\331\\210\\333\\225\\332\\251\\330\\247\\331\\206:\\0\"\\\n  \"DjVu \\330\\250\\333\\225\\332\\265\\332\\257\\333\\225\\331\\206\\330\\247\\331\\205\\333\\225\\332\\251\\330\\247\\331\\206\\333\\214\\0\"\\\n  \"\\330\\252\\330\\247\\333\\214\\330\\250\\333\\225\\330\\252\\331\\205\\333\\225\\331\\206\\330\\257\\333\\214\\333\\214\\333\\225\\332\\251\\330\\247\\331\\206\\333\\214 \\330\\250\\333\\225\\332\\265\\332\\257\\333\\225\\331\\206\\330\\247\\331\\205\\333\\225\\0\"\\\n  \"\\330\\257\\330\\247\\332\\257\\330\\261\\330\\252\\331\\206\\0\"\\\n  \"\\330\\257\\333\\225&\\330\\261\\332\\206\\331\\210\\331\\210\\331\\206\\tCtrl+Q\\0\"\\\n  \"EPUB \\331\\276\\333\\225\\330\\261\\330\\252\\331\\210\\331\\210\\332\\251\\333\\225 \\330\\246\\333\\225\\331\\204\\332\\251\\330\\252\\330\\261\\333\\206\\331\\206\\333\\214\\333\\225\\332\\251\\330\\247\\331\\206\\333\\214\\0\"\\\n  \"\\330\\252\\333\\216\\331\\276\\333\\225\\332\\225\\333\\225 \\331\\210\\331\\210\\330\\264\\333\\225 \\330\\250\\331\\206\\331\\210\\330\\263\\333\\225\\0\"\\\n  \"%s \\330\\252\\333\\216\\331\\276\\333\\225\\332\\225\\333\\225 \\331\\210\\331\\210\\330\\264\\333\\225 \\330\\250\\331\\206\\331\\210\\330\\263\\333\\225 \\330\\250\\333\\206\\0\"\\\n  \"\\332\\251\\330\\261\\330\\247 PDF \\331\\201\\330\\261\\331\\205\\330\\247\\331\\206\\333\\214 \\331\\207\\333\\216\\332\\265 \\330\\250\\331\\206\\331\\210\\330\\263\\333\\225 \\330\\250\\333\\206 \\333\\214\\330\\247\\330\\261\\331\\205\\333\\225\\330\\252\\333\\214\\330\\257\\330\\247\\331\\206 \\332\\251\\330\\247\\330\\252\\333\\216\\332\\251 \\330\\257\\331\\210\\331\\210 \\332\\251\\331\\204\\333\\214\\332\\251 \\331\\204\\333\\225\\330\\263\\333\\225\\330\\261 \\330\\250\\333\\225\\332\\265\\332\\257\\333\\225\\331\\206\\330\\247\\331\\205\\333\\225\\333\\214:\\0\"\\\n  \"%s \\331\\207\\333\\225\\332\\265\\333\\225 \\332\\225\\331\\210\\331\\210\\333\\214\\330\\257\\330\\247 \\331\\204\\333\\225 \\332\\251\\330\\261\\330\\257\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214\\0\"\\\n  \"\\331\\276\\333\\225&\\330\\263\\333\\225\\331\\206\\330\\257\\333\\225\\332\\251\\330\\247\\331\\206\\0\"\\\n  \"\\331\\276\\333\\216&\\330\\264\\330\\252\\330\\261\\tAlt+Right Arrow\\0\"\\\n  \"\\331\\276\\332\\225&\\330\\250\\333\\225\\330\\264\\330\\247\\330\\264\\333\\225\\tCtrl+Shift+L\\0\"\\\n  \"\\332\\225\\331\\210\\331\\210\\332\\251\\330\\247\\330\\261\\0\"\\\n  \"\\332\\257\\333\\206\\332\\225\\333\\214\\331\\206\\333\\214 \\331\\206\\330\\247\\331\\210\\333\\214 \\331\\201\\330\\247\\333\\214\\331\\204 \\330\\263\\333\\225\\330\\261\\332\\251\\333\\225\\331\\210\\330\\252\\331\\210\\331\\206\\333\\225\\330\\250\\331\\210\\331\\210!\\0\"\\\n  \"\\331\\276\\330\\247\\330\\261\\330\\247\\330\\263\\330\\252\\331\\206\\333\\214 \\331\\201\\330\\247\\333\\214\\331\\204 \\330\\263\\333\\225\\330\\261\\332\\251\\333\\225\\330\\252\\331\\210\\331\\206\\333\\225\\330\\250\\331\\210\\331\\210\\0\"\\\n  \"\\330\\264\\333\\216\\331\\210\\330\\247\\330\\262\\333\\214 \\331\\276\\333\\214\\330\\264\\330\\247\\331\\206\\330\\257\\330\\247\\331\\206\\333\\214 \\330\\256\\333\\216\\330\\261\\330\\247\\333\\214 \\331\\205\\330\\247\\332\\265\\331\\276\\333\\225\\330\\261\\0\"\\\n  \"\\331\\276\\333\\225\\330\\263\\333\\225\\331\\206\\330\\257\\333\\225\\332\\251\\330\\247\\331\\206\\0\"\\\n  \"FictionBook \\330\\250\\333\\225\\332\\265\\332\\257\\333\\225\\331\\206\\330\\247\\331\\205\\333\\225\\332\\251\\330\\247\\331\\206\\333\\214\\0\"\\\n  \"\\331\\206\\333\\225\\330\\257\\333\\206\\330\\262\\330\\261\\330\\247\\333\\214\\333\\225\\331\\210\\333\\225 %s \\331\\201\\330\\247\\333\\214\\331\\204\\333\\214\\0\"\\\n  \"\\331\\202\\333\\225\\330\\250\\330\\247\\330\\261\\333\\225\\333\\214 \\331\\201\\330\\247\\333\\214\\331\\204:\\0\"\\\n  \"\\331\\201\\330\\247\\333\\214\\331\\204:\\0\"\\\n  \"\\330\\257\\333\\206&\\330\\262\\333\\214\\331\\206\\333\\225\\331\\210\\333\\225...\\tCtrl+F\\0\"\\\n  \"\\330\\257\\333\\206\\330\\262\\333\\214\\331\\206\\333\\225\\331\\210\\333\\225\\0\"\\\n  \"\\330\\257\\333\\206\\330\\262\\333\\214\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 \\331\\276\\333\\216\\330\\264\\330\\252\\330\\261\\0\"\\\n  \"\\330\\257\\333\\206\\330\\262\\333\\214\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 \\331\\276\\333\\216\\330\\264\\331\\210\\331\\210\\0\"\\\n  \"\\330\\257\\333\\206\\330\\262\\333\\214\\331\\206\\333\\225\\331\\210\\333\\225:\\0\"\\\n  \"\\332\\257\\331\\210\\331\\206\\330\\254\\330\\247\\331\\206\\330\\257\\331\\206\\333\\214 &\\331\\276\\333\\216\\332\\251\\331\\207\\330\\247\\330\\252\\333\\225\\tCtrl+3\\0\"\\\n  \"\\332\\257\\331\\210\\331\\206\\330\\254\\330\\247\\331\\206\\330\\257\\331\\206\\333\\214 &\\331\\276\\333\\225\\332\\225\\333\\225\\tCtrl+0\\0\"\\\n  \"\\332\\257\\331\\210\\331\\206\\330\\254\\330\\247\\331\\206\\330\\257\\331\\206\\333\\214 &\\331\\201\\330\\261\\330\\247\\331\\210\\330\\247\\331\\206\\333\\214\\tCtrl+2\\0\"\\\n  \"\\332\\257\\331\\210\\331\\206\\330\\254\\330\\247\\331\\206\\330\\257\\331\\206\\333\\214 \\331\\276\\333\\216\\332\\251\\331\\207\\330\\247\\330\\252\\333\\225\\0\"\\\n  \"\\332\\257\\331\\210\\331\\206\\330\\254\\330\\247\\331\\206\\330\\257\\331\\206\\333\\214 \\331\\276\\333\\225\\332\\225\\333\\225\\0\"\\\n  \"\\332\\257\\331\\210\\331\\206\\330\\254\\330\\247\\331\\206\\330\\257\\331\\206\\333\\214 \\331\\201\\330\\261\\330\\247\\331\\210\\330\\247\\331\\206\\333\\214\\0\"\\\n  \"\\332\\257\\331\\210\\331\\206\\330\\254\\330\\247\\331\\206\\330\\257\\331\\206\\333\\214 \\331\\201\\330\\261\\330\\247\\331\\210\\330\\247\\331\\206\\333\\214 \\331\\210 \\331\\276\\333\\214\\330\\264\\330\\247\\331\\206\\330\\257\\330\\247\\331\\206\\333\\214 \\331\\276\\333\\225\\332\\225\\333\\225\\332\\251\\330\\247\\331\\206 \\330\\250\\333\\225 \\330\\250\\333\\225\\330\\261\\330\\257\\333\\225\\331\\210\\330\\247\\331\\205\\333\\214\\0\"\\\n  \"\\332\\257\\331\\210\\331\\206\\330\\254\\330\\247\\331\\206\\330\\257\\331\\206\\333\\214 \\333\\214\\333\\225\\332\\251 \\331\\276\\333\\225\\332\\225\\333\\225\\0\"\\\n  \"\\331\\201\\333\\206\\331\\206\\330\\252:\\0\"\\\n  \"\\331\\276\\333\\225\\332\\225\\333\\225 %d  \\331\\201\\333\\206\\332\\225\\331\\205\\330\\247\\330\\252\\332\\251\\330\\261\\330\\257\\331\\206\\333\\214 \\331\\276\\333\\225\\332\\225\\333\\225\\332\\251\\330\\247\\331\\206\\333\\214 \\331\\276\\333\\225\\330\\261\\330\\252\\331\\210\\331\\210\\332\\251 ...\\0\"\\\n  \"\\330\\257\\333\\225\\331\\202 \\330\\257\\333\\206\\330\\262\\330\\261\\330\\247\\333\\214\\333\\225\\331\\210\\333\\225 \\331\\204\\333\\225 \\331\\276\\333\\225\\332\\225\\333\\225\\332\\251\\333\\225\\330\\257\\330\\247 %s\\0\"\\\n  \"(\\330\\257\\333\\225\\331\\202 \\330\\257\\333\\206\\330\\262\\330\\261\\330\\247\\333\\214\\333\\225\\331\\210\\333\\225 \\331\\204\\333\\225 \\331\\276\\333\\225\\332\\225\\333\\225\\332\\251\\333\\225\\330\\257\\330\\247 (\\330\\257\\331\\210\\331\\210\\330\\250\\330\\247\\330\\261\\333\\225 %s\\0\"\\\n  \"\\330\\262\\333\\206\\330\\261\\330\\252\\330\\261\\333\\214\\331\\206 \\330\\256\\331\\210\\333\\216\\331\\206\\330\\257\\330\\261\\330\\247\\331\\210\\333\\225\\0\"\\\n  \"\\332\\257\\333\\216\\332\\257\\330\\247\\330\\250\\330\\247\\333\\214\\330\\252\\0\"\\\n  \"\\332\\206\\331\\210\\331\\210\\331\\206 \\330\\250\\333\\206 \\331\\276\\333\\225\\332\\225\\333\\225\\0\"\\\n  \"\\330\\264\\330\\247\\330\\261\\330\\257\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 \\330\\262\\333\\206\\330\\261 \\330\\256\\331\\210\\333\\216\\331\\206\\330\\257\\330\\261\\330\\247\\331\\210\\333\\225\\332\\251\\330\\247\\331\\206\\0\"\\\n  \"\\330\\250\\333\\225\\332\\251\\330\\247\\330\\261\\330\\250\\331\\207\\333\\216\\331\\206\\333\\225 \\330\\250\\333\\206 \\330\\257\\331\\210\\331\\210\\330\\250\\330\\247\\330\\261\\333\\225 \\330\\257\\333\\206\\330\\262\\333\\214\\331\\206\\333\\225\\331\\210\\333\\225 F3 \\331\\201\\333\\216\\330\\261\\332\\251\\330\\247\\330\\261\\333\\214: \\330\\257\\331\\210\\332\\257\\331\\205\\333\\225\\333\\214\\0\"\\\n  \"(*.%s) \\331\\201\\330\\247\\333\\214\\331\\204\\333\\225 \\331\\210\\333\\216\\331\\206\\333\\225\\333\\214\\333\\214\\333\\225\\332\\251\\330\\247\\331\\206\\0\"\\\n  \"\\332\\251\\333\\214\\331\\204\\333\\206\\330\\250\\330\\247\\333\\214\\330\\252\\0\"\\\n  \"\\331\\205\\333\\216\\332\\257\\330\\247\\330\\250\\330\\247\\333\\214\\330\\252\\0\"\\\n  \"\\330\\237PDF \\331\\210\\333\\225\\332\\251\\331\\210 \\330\\250\\333\\225\\330\\261\\331\\206\\330\\247\\331\\205\\333\\225\\333\\214 \\330\\263\\333\\225\\330\\261\\333\\225\\332\\251\\333\\214 \\330\\250\\333\\206 \\332\\251\\330\\261\\330\\257\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 \\331\\201\\330\\247\\333\\214\\331\\204\\333\\225\\332\\251\\330\\247\\331\\206\\333\\214 SumatraPDF \\332\\225\\333\\216\\332\\251\\330\\256\\330\\263\\330\\252\\331\\206\\333\\214\\0\"\\\n  \"\\332\\225\\333\\216\\332\\251\\330\\256\\330\\263\\330\\252\\331\\206\\333\\214 \\330\\246\\333\\225\\331\\205 \\330\\250\\333\\225\\330\\261\\331\\206\\330\\247\\331\\205\\333\\225\\333\\214\\333\\225 \\331\\210\\333\\225\\332\\251\\331\\210 \\330\\256\\331\\210\\333\\216\\331\\206\\333\\225\\330\\261\\333\\225\\331\\210\\333\\225\\333\\214 \\330\\263\\333\\225\\330\\261\\333\\225\\332\\251\\333\\214 \\331\\201\\330\\247\\333\\214\\331\\204\\333\\225\\332\\251\\330\\247\\331\\206\\333\\214 PDF\\0\"\\\n  \"Man&ga \\330\\264\\333\\216\\331\\210\\330\\247\\330\\262\\333\\214\\0\"\\\n  \"\\330\\246\\333\\225\\331\\206\\330\\254\\330\\247\\331\\205\\333\\214 \\331\\207\\330\\247\\331\\210\\330\\264\\333\\216\\331\\210\\333\\225\\0\"\\\n  \"Mobi \\330\\250\\333\\225\\332\\265\\332\\257\\333\\225\\331\\206\\330\\247\\331\\205\\333\\225\\332\\251\\330\\247\\331\\206\\333\\214\\0\"\\\n  \"\\330\\257\\333\\225\\330\\263\\330\\252\\332\\251\\330\\247\\330\\261\\333\\214\\332\\251\\330\\261\\330\\247\\331\\210:\\0\"\\\n  \"\\331\\210\\333\\225\\330\\264\\330\\247\\331\\206\\333\\214 \\331\\206\\331\\210\\333\\216\\333\\214 %s \\330\\246\\330\\247\\331\\205\\330\\247\\330\\257\\333\\225\\333\\214\\333\\225. \\330\\257\\330\\247\\332\\257\\330\\261\\330\\252\\331\\206\\333\\214 \\331\\210\\333\\225\\330\\264\\330\\247\\331\\206\\333\\214 \\331\\206\\331\\210\\333\\216\\330\\237\\0\"\\\n  \"\\331\\276\\333\\225\\332\\225\\333\\225\\333\\214 \\330\\257\\331\\210\\330\\247\\330\\252\\330\\261\\0\"\\\n  \"\\331\\207\\333\\214\\332\\206 \\330\\246\\333\\225\\331\\206\\330\\254\\330\\247\\331\\205\\333\\216\\332\\251 \\331\\206\\333\\225\\330\\257\\333\\206\\330\\262\\330\\261\\330\\247\\333\\214\\333\\225\\331\\210\\333\\225\\0\"\\\n  \"%u \\331\\207\\333\\214\\332\\206 \\330\\246\\333\\225\\331\\206\\330\\254\\330\\247\\331\\205\\333\\216\\332\\251 \\331\\206\\333\\225\\330\\257\\333\\206\\330\\262\\330\\261\\330\\247\\333\\214\\333\\225\\331\\210\\333\\225 \\331\\204\\333\\225 \\330\\257\\333\\216\\332\\225\\333\\214 %s \\331\\204\\333\\225 \\331\\201\\330\\247\\333\\214\\331\\204\\333\\214\\0\"\\\n  \"\\331\\207\\333\\214\\332\\206 \\331\\201\\330\\247\\333\\214\\331\\204\\333\\216\\332\\251\\333\\214 \\331\\207\\330\\247\\331\\210\\332\\251\\330\\247\\330\\252\\332\\251\\330\\261\\330\\257\\331\\206 \\331\\206\\333\\225\\330\\257\\333\\206\\330\\262\\330\\261\\330\\247\\333\\214\\333\\225\\331\\210\\333\\225\\0\"\\\n  \"\\331\\207\\333\\214\\332\\206 \\330\\262\\330\\247\\331\\206\\333\\214\\330\\247\\330\\261\\333\\214\\333\\214\\333\\225\\332\\251\\333\\214 \\331\\207\\330\\247\\331\\210\\332\\251\\330\\247\\330\\252\\332\\251\\330\\261\\330\\257\\331\\206 \\331\\206\\333\\214\\333\\225 \\331\\204\\333\\225\\331\\205 \\330\\264\\331\\210\\333\\216\\331\\206\\333\\225\\330\\257\\330\\247\\0\"\\\n  \"\\332\\230\\331\\205\\330\\247\\330\\261\\333\\225\\333\\214 \\331\\276\\333\\225\\332\\225\\333\\225\\332\\251\\330\\247\\331\\206:\\0\"\\\n  \"\\330\\250\\330\\247\\330\\264\\333\\225\\0\"\\\n  \"\\332\\251\\330\\261\\330\\257\\331\\206\\333\\225\\331\\210\\333\\225\\0\"\\\n  \"PDF-XChange \\332\\251\\330\\261\\330\\257\\331\\206\\333\\225\\331\\210\\333\\225 &\\330\\250\\333\\225\\331\\207\\333\\206\\333\\214\\0\"\\\n  \"\\332\\251\\330\\261\\330\\257\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 \\330\\250\\333\\225\\332\\265\\332\\257\\333\\225\\331\\206\\330\\247\\331\\205\\333\\225...\\0\"\\\n  \"\\332\\251\\330\\261\\330\\257\\331\\206\\333\\225\\331\\210\\333\\225 \\331\\204\\333\\225 %s\\0\"\\\n  \"Adobe Reader \\332\\251\\330\\261\\330\\257\\331\\206\\333\\225\\331\\210\\333\\225 &\\330\\250\\333\\225\\331\\207\\333\\206\\333\\214\\0\"\\\n  \"Foxit Reader \\332\\251\\330\\261\\330\\257\\331\\206\\333\\225\\331\\210\\333\\225 &\\330\\250\\333\\225\\331\\207\\333\\206\\333\\214\\0\"\\\n  \"Microsoft HTML \\332\\251\\330\\261\\330\\257\\331\\206\\333\\225\\331\\210\\333\\225  \\330\\250\\333\\225\\331\\207\\333\\206\\333\\214 &\\333\\214\\330\\247\\330\\261\\331\\205\\333\\225\\330\\252\\333\\214\\0\"\\\n  \"Microsoft XPS \\332\\251\\330\\261\\330\\257\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 \\330\\250\\333\\225\\331\\207\\333\\206\\333\\214 &\\331\\276\\333\\214\\330\\264\\330\\247\\331\\206\\330\\257\\333\\225\\330\\261\\333\\214\\0\"\\\n  \"\\330\\252\\330\\247\\333\\214\\330\\250\\333\\225&\\330\\252\\331\\205\\333\\225\\331\\206\\330\\257\\333\\214\\333\\214\\333\\225\\332\\251\\330\\247\\331\\206\\0\"\\\n  \"\\330\\252\\330\\247&\\333\\214\\330\\250\\333\\225\\330\\252\\331\\205\\333\\225\\331\\206\\330\\257\\333\\214\\333\\214\\333\\225\\332\\251\\330\\247\\331\\206\\tCtrl+D\\0\"\\\n  \"PDF \\330\\250\\333\\225\\332\\265\\332\\257\\333\\225\\331\\206\\330\\247\\331\\205\\333\\225\\333\\214\\0\"\\\n  \"PDF \\332\\225\\333\\216\\332\\251\\330\\256\\330\\263\\330\\252\\331\\206\\333\\214:\\0\"\\\n  \"PDF \\330\\250\\333\\225\\330\\261\\331\\207\\333\\225\\331\\205\\331\\207\\333\\216\\331\\206\\333\\225\\330\\261\\333\\214:\\0\"\\\n  \":PDF \\331\\210\\333\\225\\330\\264\\330\\247\\331\\206\\333\\214\\0\"\\\n  \"PDF \\330\\250\\333\\225\\332\\265\\332\\257\\333\\225\\331\\206\\330\\247\\331\\205\\333\\225\\332\\251\\330\\247\\331\\206\\333\\214\\0\"\\\n  \"\\331\\276\\333\\225&\\332\\225\\333\\225...\\tCtrl+G\\0\"\\\n  \"\\331\\276\\333\\225\\332\\225\\333\\225\\333\\214 %s\\0\"\\\n  \"\\331\\202\\333\\225\\330\\250\\330\\247\\330\\261\\333\\225\\333\\214 \\331\\276\\333\\225\\332\\225\\333\\225:\\0\"\\\n  \"\\330\\250\\331\\210\\331\\210\\331\\206\\333\\214 \\331\\206\\333\\214\\333\\225 %u \\331\\276\\333\\225\\332\\225\\333\\225\\333\\214 \\332\\230\\331\\205\\330\\247\\330\\261\\333\\225\\0\"\\\n  \"\\332\\225\\333\\214\\330\\262\\332\\251\\330\\261\\330\\257\\331\\206\\333\\214 \\331\\276\\333\\225\\332\\225\\333\\225\\332\\251\\330\\247\\331\\206\\0\"\\\n  \"\\331\\276\\333\\225\\332\\225\\333\\225:\\0\"\\\n  \"\\330\\250\\333\\225\\332\\265\\332\\257\\333\\225 \\331\\206\\330\\247\\331\\205\\333\\225\\332\\251\\330\\247\\331\\206\\333\\214 PalmDoc\\0\"\\\n  \"\\330\\252\\332\\251\\330\\247\\333\\214\\333\\225 \\332\\206\\330\\247\\331\\210\\333\\225\\332\\225\\331\\210\\330\\247\\331\\206\\330\\250\\333\\225 - \\331\\276\\331\\210\\330\\256\\330\\252\\333\\225 \\330\\246\\333\\225\\332\\251\\330\\261\\333\\216\\330\\252...\\0\"\\\n  \"Postscript \\330\\250\\333\\225\\332\\265\\332\\257\\333\\225\\331\\206\\330\\247\\331\\205\\333\\225\\331\\206\\332\\251\\330\\247\\331\\206\\333\\214\\0\"\\\n  \"\\331\\276\\332\\225& \\330\\250\\333\\225 \\330\\264\\330\\247\\330\\264\\333\\225 \\330\\250\\333\\225\\330\\250\\333\\216 \\330\\264\\330\\261\\333\\214\\330\\252\\333\\214 \\330\\246\\330\\247\\331\\205\\330\\261\\330\\247\\330\\262\\333\\225\\332\\251\\330\\247\\331\\206\\tCtrl+L\\0\"\\\n  \"\\331\\276\\333\\225\\332\\225\\333\\225\\333\\214 \\331\\276\\333\\216\\330\\264\\331\\210\\331\\210\\0\"\\\n  \"\\332\\206\\330\\247\\331\\276\\332\\251\\330\\261\\330\\257\\331\\206\\0\"\\\n  \"\\330\\262\\331\\206\\330\\254\\333\\214\\330\\261\\333\\225\\333\\214 \\332\\206\\330\\247\\331\\276\\332\\251\\330\\261\\330\\257\\331\\206\\0\"\\\n  \"\\331\\207\\333\\214\\332\\206 \\332\\206\\330\\247\\331\\276\\332\\251\\333\\225\\330\\261\\333\\216\\332\\251 \\330\\250\\333\\225\\331\\210 \\331\\206\\330\\247\\331\\210\\333\\225 \\330\\250\\331\\210\\331\\210\\331\\206\\333\\214 \\331\\206\\333\\214\\333\\225\\0\"\\\n  \"\\332\\206\\330\\247\\331\\276\\332\\251\\330\\261\\330\\257\\331\\206 \\331\\204\\333\\225 \\330\\246\\333\\225\\331\\206\\330\\254\\330\\247\\331\\205\\330\\257\\330\\247\\331\\206\\330\\257\\330\\247\\333\\214\\333\\225\\0\"\\\n  \"\\332\\206\\330\\247\\331\\276\\332\\251\\330\\261\\330\\257\\331\\206 \\331\\204\\333\\225 \\330\\246\\333\\225\\331\\206\\330\\254\\330\\247\\331\\205\\330\\257\\330\\247\\331\\206\\330\\257\\330\\247\\333\\214\\333\\225. \\332\\251\\333\\206\\330\\252\\330\\247\\333\\214\\333\\214 \\331\\276\\333\\216\\331\\207\\333\\216\\331\\206\\330\\247\\331\\206 \\331\\210 \\330\\257\\333\\225\\330\\261\\332\\206\\331\\210\\331\\210\\331\\206\\330\\237\\0\"\\\n  \"\\332\\206\\330\\247\\331\\276\\332\\251\\330\\261\\330\\257\\331\\206 \\331\\204\\333\\225 \\330\\246\\333\\225\\331\\206\\330\\254\\330\\247\\331\\205\\330\\257\\330\\247\\331\\206\\330\\257\\330\\247\\333\\214\\333\\225. \\332\\251\\333\\206\\330\\252\\330\\247\\333\\214\\333\\214 \\331\\276\\333\\216\\331\\207\\333\\216\\331\\206\\330\\247\\331\\206 \\331\\210 \\330\\257\\333\\225\\330\\263\\330\\252\\331\\276\\333\\216\\332\\251\\330\\261\\330\\257\\331\\206\\333\\225\\331\\210\\333\\225\\330\\237\\0\"\\\n  \"%d \\331\\276\\333\\225\\332\\225\\333\\225 \\331\\204\\333\\225 %d \\332\\206\\330\\247\\331\\276\\332\\251\\330\\261\\330\\257\\331\\206\\333\\214...\\0\"\\\n  \"\\332\\251\\333\\216\\330\\264\\333\\225 \\331\\207\\333\\225\\333\\214\\333\\225 \\331\\204\\333\\225  \\332\\206\\330\\247\\331\\276\\332\\251\\330\\261\\330\\257\\331\\206\\330\\257\\330\\247.\\0\"\\\n  \"\\332\\257\\333\\206\\332\\225\\333\\214\\331\\206\\333\\214 &\\331\\206\\330\\247\\331\\210...\\tF2\\0\"\\\n  \"\\330\\250\\333\\214\\330\\261\\330\\256\\330\\263\\330\\252\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 \\331\\201\\330\\247\\333\\214\\331\\204\\333\\225 &\\332\\251\\330\\261\\330\\247\\331\\210\\333\\225\\332\\251\\330\\247\\331\\206\\0\"\\\n  \"\\331\\204\\330\\247\\330\\250\\330\\261\\330\\257\\331\\206 \\331\\204\\333\\225 \\331\\276\\333\\225\\330\\263\\333\\225\\331\\206\\330\\257\\333\\225\\332\\251\\330\\247\\331\\206\\330\\257\\330\\247\\0\"\\\n  \"\\331\\204\\333\\225 \\331\\204\\333\\214\\330\\263\\330\\252\\333\\214 \\331\\276\\333\\225\\330\\263\\333\\225\\331\\206\\330\\257\\333\\225\\332\\251\\330\\247\\331\\206\\330\\257\\330\\247 %s \\331\\204\\330\\247\\330\\250\\330\\261\\330\\257\\331\\206\\333\\214 \\331\\276\\333\\225\\332\\225\\333\\225\\333\\214\\0\"\\\n  \"\\332\\257\\333\\206\\332\\225\\333\\214\\331\\206\\333\\214 \\331\\206\\330\\247\\331\\210 \\330\\250\\333\\206\\0\"\\\n  \"\\330\\263\\331\\210\\332\\225\\330\\247\\331\\206\\333\\225\\331\\210\\333\\225 \\330\\250\\333\\206\\331\\204\\330\\247\\333\\214 &\\332\\206\\333\\225\\331\\276\\tCtrl+Shift+-\\0\"\\\n  \"\\330\\263\\331\\210\\332\\225\\330\\247\\331\\206\\333\\225\\331\\210\\333\\225 \\330\\250\\333\\206\\331\\204\\330\\247\\333\\214 &\\332\\225\\330\\247\\330\\263\\330\\252\\tCtrl+Shift++\\0\"\\\n  \"\\331\\276\\330\\247\\330\\261\\330\\247\\330\\263\\330\\252\\331\\206 \\331\\210\\333\\225\\332\\251\\331\\210\\0\"\\\n  \"\\331\\276\\330\\247\\330\\261\\330\\247\\330\\263\\330\\252\\331\\206\\333\\214 \\332\\251\\331\\210\\330\\261\\330\\252\\333\\225&\\330\\246\\330\\247\\333\\214\\332\\251\\333\\206\\331\\206...\\tCtrl+Shift+S\\0\"\\\n  \"...%d \\331\\204\\333\\225 %d \\332\\257\\333\\225\\332\\225\\330\\247\\331\\206\\333\\214\\0\"\\\n  \"\\330\\257\\333\\214\\330\\247\\330\\261\\333\\214\\332\\251\\330\\261\\330\\257\\331\\206\\333\\214 &\\331\\207\\333\\225\\331\\205\\331\\210\\331\\210\\333\\214\\0\"\\\n  \"\\330\\257\\333\\214\\330\\247\\330\\261\\333\\214\\332\\251\\330\\261\\330\\257\\331\\206\\333\\214 &\\331\\207\\333\\225\\331\\205\\331\\210\\331\\210\\333\\214\\tCtrl+A\\0\"\\\n  \"Ctrl \\331\\276\\333\\216\\332\\251\\331\\207\\330\\247\\330\\252\\333\\225\\332\\251\\330\\247\\331\\206 \\330\\257\\333\\214\\330\\247\\330\\261\\333\\214\\330\\250\\332\\251\\333\\225 \\330\\250\\333\\225\\331\\207\\333\\206\\333\\214 \\332\\251\\331\\204\\333\\214\\332\\251\\333\\214 \\332\\206\\333\\225\\331\\276 \\331\\210\\0\"\\\n  \"\\330\\257\\333\\214\\330\\247\\330\\261\\333\\214\\332\\251\\330\\261\\330\\247\\331\\210:\\0\"\\\n  \"\\331\\206\\330\\247\\330\\261\\330\\257\\331\\206 \\330\\250\\333\\225\\331\\207\\333\\206\\333\\214 &\\331\\276\\333\\206\\330\\263\\330\\252\\333\\214 \\330\\246\\333\\225\\331\\204\\332\\251\\330\\252\\330\\261\\333\\206\\331\\206\\333\\214\\333\\225\\331\\210\\333\\225...\\0\"\\\n  \"\\332\\225\\333\\216\\332\\251\\330\\256\\330\\263\\330\\252\\331\\206\\333\\214 \\331\\207\\333\\216\\332\\265\\333\\214 \\331\\276\\333\\216\\332\\206\\333\\225\\331\\210\\330\\247\\331\\206\\333\\225\\333\\214 \\332\\257\\333\\225\\332\\225\\330\\247\\331\\206\\0\"\\\n  \"\\331\\276\\333\\214\\330\\264\\331\\206\\330\\247\\330\\257\\330\\247\\331\\206\\333\\214 &\\331\\206\\333\\214\\330\\264\\330\\247\\331\\206\\333\\225\\332\\251\\330\\261\\330\\247\\331\\210\\333\\225\\332\\251\\330\\247\\331\\206\\0\"\\\n  \"\\331\\276\\333\\214\\330\\264\\330\\247\\331\\206\\330\\257\\330\\247\\331\\206\\333\\214 \\331\\276\\333\\225\\332\\225\\333\\225\\332\\251\\330\\247\\331\\206 &\\330\\250\\333\\225 \\330\\250\\333\\225\\330\\261\\330\\257\\333\\225\\331\\210\\330\\247\\331\\205\\333\\214\\0\"\\\n  \"\\331\\276\\333\\214\\330\\264\\330\\247\\331\\206\\330\\257\\330\\247\\331\\206\\333\\214 &\\330\\264\\330\\261\\333\\214\\330\\252\\333\\214 \\330\\246\\330\\247\\331\\205\\330\\261\\330\\247\\330\\262\\0\"\\\n  \"\\331\\276\\333\\214\\330\\264\\330\\247\\331\\206\\330\\257\\330\\247\\331\\206\\333\\214 \\331\\276\\333\\225\\330\\263\\333\\225\\331\\206\\330\\257\\333\\225\\332\\251\\330\\247\\331\\206\\0\"\\\n  \"\\331\\276\\333\\214\\330\\264\\330\\247\\331\\206\\330\\257\\330\\247\\331\\206\\333\\214 \\330\\262\\333\\206\\330\\261\\330\\252\\330\\261\\333\\214\\331\\206 \\330\\256\\331\\210\\333\\216\\331\\206\\330\\261\\330\\247\\331\\210\\333\\225\\332\\251\\330\\247\\331\\206\\0\"\\\n  \"\\331\\276\\333\\214\\330\\264\\330\\247\\331\\206\\330\\257\\330\\247\\331\\206\\333\\214 &\\331\\206\\333\\214\\330\\264\\330\\247\\331\\206\\333\\225\\332\\251\\330\\261\\330\\247\\331\\210\\333\\225\\332\\251\\330\\247\\331\\206 \\331\\204\\333\\225 \\330\\252\\333\\225\\331\\206\\333\\214\\330\\264\\330\\252\\333\\225\\331\\210\\333\\225 \\330\\246\\333\\225\\332\\257\\333\\225\\330\\261 \\331\\207\\333\\225\\330\\250\\331\\210\\331\\210\\0\"\\\n  \"\\331\\276\\333\\225\\332\\225\\333\\225\\333\\214 \\330\\252\\330\\247\\332\\251\\0\"\\\n  \"\\330\\252\\332\\251\\330\\247\\333\\214\\333\\225 \\332\\251\\331\\204\\333\\214\\332\\251 \\331\\204\\333\\225\\330\\263\\333\\225\\330\\261 '\\331\\276\\330\\247\\330\\264\\332\\257\\333\\225\\330\\262\\330\\250\\331\\210\\331\\206\\333\\225\\331\\210\\333\\225' \\330\\214 \\330\\250\\332\\251\\333\\225 \\330\\246\\333\\225\\332\\257\\333\\225\\330\\261 \\330\\246\\333\\225\\330\\252\\333\\225\\331\\210\\333\\216 \\333\\214\\330\\247\\330\\261\\331\\205\\333\\225\\330\\252\\333\\214\\330\\257\\333\\225\\330\\261\\331\\205\\330\\247\\331\\206 \\330\\250\\333\\214\\330\\252 \\331\\204\\333\\225 \\330\\254\\330\\247\\330\\261\\333\\225\\330\\263\\333\\225\\330\\261\\332\\251\\330\\261\\330\\257\\331\\206\\333\\214 \\330\\246\\333\\225\\331\\205 \\332\\251\\333\\216\\330\\264\\333\\225\\333\\214\\333\\225\\n\\n !\\330\\250\\330\\250\\331\\210\\330\\261\\333\\225\\330\\214 \\331\\204\\333\\225 \\332\\225\\331\\210\\331\\210\\330\\257\\330\\247\\331\\206\\333\\214 \\330\\246\\333\\225\\331\\205 \\332\\251\\333\\216\\330\\264\\333\\225\\333\\214\\333\\225\\0\"\\\n  \"\\330\\256\\330\\247\\332\\265\\333\\214 \\331\\207\\330\\247\\331\\210\\332\\251\\330\\247\\330\\252\\332\\251\\330\\261\\330\\257\\331\\206\\333\\214 \\331\\206\\333\\214\\333\\225 %s \\330\\263\\333\\225\\330\\261\\332\\206\\330\\247\\331\\210\\333\\225\\333\\214 \\331\\201\\330\\247\\333\\214\\331\\204\\333\\214\\0\"\\\n  \"\\330\\263\\333\\225\\330\\261\\330\\257\\333\\216\\332\\225:\\0\"\\\n  \"\\331\\207\\333\\225\\332\\265\\330\\250\\332\\230\\330\\247\\330\\261\\330\\257\\331\\206\\333\\225\\332\\251\\330\\247\\331\\206\\333\\214 SumatraPDF\\0\"\\\n  \"\\331\\206\\331\\210\\333\\216\\332\\251\\330\\261\\330\\257\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 SumatraPDF\\0\"\\\n  \"\\330\\252\\333\\216\\332\\251\\332\\206\\331\\210\\331\\210 SumatraPDF\\0\"\\\n  \"\\333\\225 PDF \\330\\256\\331\\210\\333\\216\\331\\206\\333\\225\\330\\261\\333\\225\\331\\210\\333\\225\\333\\214 \\330\\263\\333\\225\\330\\261\\333\\225\\332\\251\\333\\214 \\331\\201\\330\\247\\333\\214\\331\\204\\333\\225\\332\\251\\330\\247\\331\\206\\333\\214 SumatraPDF\\0\"\\\n  \"PDF \\330\\246\\333\\216\\330\\263\\330\\252\\330\\247 \\330\\246\\333\\225\\330\\250\\333\\216\\330\\252 \\330\\250\\333\\225 \\330\\256\\331\\210\\333\\216\\331\\206\\333\\225\\330\\261\\333\\225\\331\\210\\333\\225\\333\\214 \\330\\263\\333\\225\\330\\261\\333\\225\\332\\251\\333\\214 \\331\\201\\330\\247\\333\\214\\331\\204\\333\\225\\332\\251\\330\\247\\331\\206\\333\\214 SumatraPDF\\0\"\\\n  \"\\331\\201\\330\\247\\333\\214\\331\\204\\333\\214 \\331\\207\\330\\247\\331\\210\\332\\251\\330\\247\\330\\252\\332\\251\\330\\261\\330\\247\\331\\210 \\331\\206\\330\\247\\330\\252\\331\\210\\330\\247\\331\\206\\330\\261\\333\\216\\330\\252 \\330\\250\\332\\251\\330\\261\\333\\216\\330\\252\\333\\225\\331\\210\\333\\225\\0\"\\\n  \"\\333\\225 \\330\\257\\333\\214\\330\\247\\330\\261\\333\\214\\332\\251\\330\\261\\330\\247\\331\\210\\333\\225\\332\\251\\330\\247\\331\\206 PDF\\0\"\\\n  \"\\330\\250\\333\\225\\332\\265\\332\\257\\333\\225\\331\\206\\330\\247\\331\\205\\333\\225 \\330\\257\\333\\225\\331\\202\\333\\214\\333\\214\\333\\225\\332\\251\\330\\247\\331\\206\\0\"\\\n  \"\\330\\246\\333\\225\\331\\205 \\330\\250\\333\\225\\332\\265\\332\\257\\333\\225\\331\\206\\330\\247\\331\\205\\333\\225\\333\\214\\333\\225 \\330\\256\\330\\262\\331\\205\\333\\225\\330\\252\\332\\257\\331\\210\\330\\262\\330\\247\\330\\261\\333\\214 \\331\\206\\333\\225\\332\\257\\331\\210\\331\\206\\330\\254\\330\\247\\331\\210\\333\\214 \\330\\252\\333\\216\\330\\257\\330\\247\\333\\214\\333\\225  (%s) \\331\\204\\333\\225\\331\\210\\330\\247\\331\\206\\333\\225\\333\\214\\333\\225 \\330\\250\\333\\225\\330\\250\\330\\247\\330\\264\\333\\214 \\330\\257\\333\\225\\330\\261\\331\\206\\333\\225\\332\\251\\333\\225\\333\\216\\330\\252\\0\"\\\n  \"\\331\\206\\330\\247\\331\\210\\331\\206\\333\\214\\330\\264\\330\\247\\331\\206:\\0\"\\\n  \"\\331\\201\\330\\247\\333\\214\\331\\204\\333\\225 \\330\\263\\333\\225\\330\\261\\332\\206\\330\\247\\331\\210\\333\\225 \\331\\206\\333\\225\\331\\206\\330\\247\\330\\263\\330\\261\\330\\247\\331\\210\\333\\225\\332\\251\\330\\247\\331\\206 (%s)\\0\"\\\n  \"\\330\\250\\333\\225\\332\\251\\330\\247\\330\\261\\331\\207\\333\\216\\331\\206\\330\\247\\331\\206 &\\330\\264\\330\\261\\333\\214\\330\\252\\333\\225\\332\\251\\330\\247\\331\\206\\0\"\\\n  \"\\331\\276\\333\\214\\330\\264\\330\\247\\331\\206\\330\\257\\330\\247\\331\\206\\0\"\\\n  \"\\330\\263\\333\\225\\330\\261\\330\\257\\330\\247\\331\\206\\332\\251\\330\\261\\330\\257\\331\\206\\333\\214 &\\331\\205\\330\\247\\332\\265\\331\\276\\333\\225\\332\\225\\0\"\\\n  \"\\330\\246\\330\\247\\332\\257\\330\\247\\330\\257\\330\\247\\330\\261\\332\\251\\330\\261\\330\\257\\331\\206\\333\\225\\331\\210\\333\\225\\0\"\\\n  \"XPS \\330\\250\\333\\225\\332\\265\\332\\257\\333\\225\\331\\206\\330\\247\\331\\205\\333\\225\\332\\251\\330\\247\\331\\206\\333\\214\\0\"\\\n  \"\\330\\252\\333\\206 \\330\\257\\331\\210\\330\\247\\333\\214\\331\\206 \\331\\210\\333\\225\\330\\264\\330\\247\\331\\206\\330\\252 \\331\\207\\333\\225\\333\\214\\333\\225.\\0\"\\\n  \"\\330\\252\\333\\206 \\331\\210\\333\\225\\330\\264\\330\\247\\331\\206\\333\\214 %s \\330\\252 \\331\\207\\333\\225\\333\\214\\333\\225\\0\"\\\n  \"\\331\\206\\330\\262\\333\\214\\332\\251 \\330\\256\\330\\263\\330\\252\\331\\206\\333\\225\\331\\210\\333\\225\\0\"\\\n  \"\\331\\206\\330\\262\\333\\214\\332\\251 \\330\\256\\330\\263\\330\\252\\331\\206\\333\\225\\331\\210\\333\\225\\0\"\\\n  \"\\330\\257\\331\\210\\331\\210\\330\\261 \\330\\256\\330\\263\\330\\252\\331\\206\\333\\225\\331\\210\\333\\225\\0\"\\\n  \"\\331\\206\\330\\262\\333\\214\\332\\251 \\330\\256\\330\\263\\330\\252\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 \\330\\252\\330\\247\\333\\214\\330\\250\\333\\225\\330\\252\\0\"\\\n  \"%s [\\332\\257\\333\\206\\332\\225\\330\\247\\331\\206\\332\\251\\330\\247\\330\\261\\333\\214 \\330\\252\\333\\216\\330\\257\\330\\247\\332\\251\\330\\261\\330\\247\\330\\233 \\331\\206\\331\\210\\333\\216\\332\\251\\330\\261\\330\\257\\331\\206\\333\\225\\331\\210\\333\\225 ]\\0\"\\\n  \"\\331\\204\\333\\225\\330\\250\\333\\225\\330\\261\\332\\257\\330\\261\\330\\252\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 \\330\\257\\333\\225\\331\\202\\0\"\\\n  \"\\332\\206\\330\\247\\331\\276\\332\\251\\330\\261\\330\\257\\331\\206\\333\\214 \\330\\250\\333\\225\\332\\265\\332\\257\\333\\225\\331\\206\\330\\247\\331\\205\\333\\225\\0\";\n\nconst char * gTranslations_lv = \n  \"&Par\\0\"\\\n  \"&Patiesais lielums\\tCtrl+1\\0\"\\\n  \"&Papildu opcijas...\\0\"\\\n  \"&Visas atlas\\304\\253t\\304\\201s lappuses\\0\"\\\n  \"&Atpaka\\304\\274\\tAlt+Kreis\\304\\201 bulti\\305\\206a\\0\"\\\n  \"&Gr\\304\\201matas skats\\tCtrl+8\\0\"\\\n  \"&Aizv\\304\\223rt\\tCtrl+W\\0\"\\\n  \"&Kop\\304\\223t atlasi\\0\"\\\n  \"&Kop\\304\\223t atlasi\\tCtrl+C\\0\"\\\n  \"&Vairs nejaut\\304\\201t\\0\"\\\n  \"Tikai &p\\304\\201ra lappuses\\0\"\\\n  \"&Divas lappuses\\tCtrl+7\\0\"\\\n  \"&Fails\\0\"\\\n  \"&Ko atrast:\\0\"\\\n  \"&Pirmo lappusi\\tS\\304\\201kums\\0\"\\\n  \"Ietilpin\\304\\201t lappuses &apdruk\\304\\201jam\\304\\201 zon\\304\\201\\0\"\\\n  \"&Doties uz\\0\"\\\n  \"&Doties uz lappusi:\\0\"\\\n  \"&Pal\\304\\253dz\\304\\253ba\\0\"\\\n  \"P\\304\\223&d\\304\\223jo lappusi\\tBeigas\\0\"\\\n  \"&Palielin\\304\\201jums:\\0\"\\\n  \"&Rokasgr\\304\\201mata\\0\"\\\n  \"&Saska\\305\\206ot re\\304\\243istru\\0\"\\\n  \"&N\\304\\201kamo lappusi\\tLab\\304\\201 bulti\\305\\206a\\0\"\\\n  \"&N\\304\\223\\0\"\\\n  \"&N\\304\\223, paldies\\0\"\\\n  \"Tikai &nep\\304\\201ra lappuses\\0\"\\\n  \"&Atv\\304\\223rt dokumentu\\0\"\\\n  \"&Atv\\304\\223rt...\\tCtrl+O\\0\"\\\n  \"&Opcijas...\\0\"\\\n  \"&Parole:\\0\"\\\n  \"&Piespraust dokumentu\\0\"\\\n  \"&Iepriek\\305\\241\\304\\223jo lappusi\\tKreis\\304\\201 bulti\\305\\206a\\0\"\\\n  \"&Druk\\304\\201t...\\0\"\\\n  \"&Druk\\304\\201t...\\tCtrl+P\\0\"\\\n  \"&Druk\\304\\201t... (liegts)\\0\"\\\n  \"&Atcer\\304\\223ties \\305\\241\\304\\253 dokumenta paroli\\0\"\\\n  \"&Atcer\\304\\223ties \\305\\241os iestat\\304\\253jumus katram dokumentam\\0\"\\\n  \"&No\\305\\206emt dokumentu\\0\"\\\n  \"&Saglab\\304\\201t k\\304\\201...\\0\"\\\n  \"&Saglab\\304\\201t k\\304\\201...\\tCtrl+S\\0\"\\\n  \"&Iestat\\304\\253jumi\\0\"\\\n  \"&Samazin\\304\\201t lappuses l\\304\\253dz apdruk\\304\\201jamai zonai (ja ir nepiecie\\305\\241ams)\\0\"\\\n  \"&Viena lappuse\\tCtrl+6\\0\"\\\n  \"&Izlaist \\305\\241o versiju\\0\"\\\n  \"&Lietot s\\304\\201kotn\\304\\223jos lappu\\305\\241u izm\\304\\223rus\\n\\0\"\\\n  \"&Skats\\0\"\\\n  \"&Logs\\0\"\\\n  \"&J\\304\\201\\0\"\\\n  \"&T\\304\\201lummai\\305\\206a\\0\"\\\n  \"(no %d)\\0\"\\\n  \"(lappuse %s)\\0\"\\\n  \"Par SumatraPDF\\0\"\\\n  \"Pievieno\\305\\241ana izlasei\\0\"\\\n  \"Pievienot %s lappusi izlasei\\0\"\\\n  \"Pievienot %s lappusi izlasei ar (neoblig\\304\\201tu) nosaukumu:\\0\"\\\n  \"Pievienot izlasei\\0\"\\\n  \"Papildu\\0\"\\\n  \"Visi faili\\0\"\\\n  \"Visi atbalst\\304\\253tie dokumenti\\0\"\\\n  \"Programma:\\0\"\\\n  \"Vai piesaist\\304\\253t PDF failiem?\\0\"\\\n  \"Pielikums: %s\\0\"\\\n  \"Autors:\\0\"\\\n  \"Autom\\304\\201tiski\\0\"\\\n  \"Autom\\304\\201tiski p\\304\\201rbaud\\304\\253t &atjaunin\\304\\201jumus\\0\"\\\n  \"Gr\\304\\201matas skats\\0\"\\\n  \"Gr\\304\\201mat&z\\304\\253mes\\tF12\\0\"\\\n  \"Gr\\304\\201matz\\304\\253mju sa\\304\\253snes\\0\"\\\n  \"Gr\\304\\201matz\\304\\253mju sa\\304\\253sne uz %s lappusi no %s\\0\"\\\n  \"Gr\\304\\201matz\\304\\253mes\\0\"\\\n  \"baiti\\0\"\\\n  \"CHM dokumenti\\0\"\\\n  \"Nevar izveidot savienojumu ar internetu (k\\304\\274\\305\\253da %#x).\\0\"\\\n  \"Atcelt\\0\"\\\n  \"Nevar izdruk\\304\\201t \\305\\241o failu\\0\"\\\n  \"Neizdev\\304\\201s palaist invers\\304\\201s mekl\\304\\223\\305\\241anas komandu. L\\305\\253dzu p\\304\\201rbaudiet komandrindu iestat\\304\\253jumus.\\0\"\\\n  \"Main\\304\\253t valodu (Change Language)\\0\"\\\n  \"P\\304\\201rbaud\\304\\253t, vai nav &atjaunin\\304\\201jumi\\0\"\\\n  \"Komiksu gr\\304\\201matas\\0\"\\\n  \"Sader\\304\\253ba\\0\"\\\n  \"Nep\\304\\201rtraukts\\n\\0\"\\\n  \"Nep\\304\\201rtraukts gr\\304\\201matas skats\\0\"\\\n  \"Nep\\304\\201rtraukti divas lappuses\\0\"\\\n  \"Piedal\\304\\253ties tulko\\305\\241an\\304\\201\\0\"\\\n  \"Kop\\304\\223t &att\\304\\223lu\\0\"\\\n  \"Kop\\304\\223t &saites adresi\\0\"\\\n  \"Kop\\304\\223t &koment\\304\\201ru\\0\"\\\n  \"Teksta kop\\304\\223\\305\\241ana ir liegta (kop\\304\\223 tikai k\\304\\201 att\\304\\223lu)\\0\"\\\n  \"Autorties\\304\\253bas:\\0\"\\\n  \"Nevar ieg\\305\\253t printera rekviz\\304\\253tus\\0\"\\\n  \"Neizdev\\304\\201s inicializ\\304\\223t printeri\\0\"\\\n  \"Nevar\\304\\223ja atveidot lappusi\\0\"\\\n  \"Izveidots:\\0\"\\\n  \"Pa\\305\\241reiz\\304\\223jais fails\\0\"\\\n  \"Kursora poz\\304\\253cija:\\0\"\\\n  \"Piel\\304\\201got &t\\304\\201lummai\\305\\206u...\\tCtrl+Y\\0\"\\\n  \"Noklus\\304\\223juma &izk\\304\\201rtojums\\0\"\\\n  \"Noklus\\304\\223juma &t\\304\\201lummai\\305\\206a\\0\"\\\n  \"Noklus\\304\\223juma PDF las\\304\\253t\\304\\201ju nevar izmain\\304\\253t p\\304\\201rnesamam re\\305\\276\\304\\253mam\\0\"\\\n  \"Atteiktas at\\304\\274aujas:\\0\"\\\n  \"DjVu dokumenti\\0\"\\\n  \"Dokumenta rekviz\\304\\253ti\\0\"\\\n  \"Lejupiel\\304\\201d\\304\\223t\\0\"\\\n  \"&Iziet\\tCtrl+Q\\0\"\\\n  \"EPUB elektronisk\\304\\201s gr\\304\\201matas\\0\"\\\n  \"Ievad\\304\\253t paroli\\0\"\\\n  \"Ievad\\304\\253t %s paroli\\0\"\\\n  \"Ievadiet komandrindu, izsaucamu ar dubultklik\\305\\241\\304\\267i uz PDF dokumenta:\\0\"\\\n  \"%s iel\\304\\201des k\\304\\274\\305\\253da\\0\"\\\n  \"Gr\\304\\201mat&z\\304\\253mes\\0\"\\\n  \"&T\\304\\201l\\304\\201k\\tAlt+Lab\\304\\201 bulti\\305\\206a\\0\"\\\n  \"Pilnekr\\304\\201na re\\305\\276\\304\\253ms\\tF11\\0\"\\\n  \"Divas lappuses\\0\"\\\n  \"Neizdev\\304\\201s p\\304\\201rd\\304\\223v\\304\\223t failu!\\0\"\\\n  \"Neizdev\\304\\201s saglab\\304\\201t failu\\0\"\\\n  \"\\304\\200trais t\\304\\253mek\\304\\274a skats\\0\"\\\n  \"Gr\\304\\201matz\\304\\253mes\\0\"\\\n  \"FictionBook dokumenti\\0\"\\\n  \"Fails %s nav atrasts\\0\"\\\n  \"Faila lielums:\\0\"\\\n  \"Fails:\\0\"\\\n  \"At&rast...\\tCtrl+F\\0\"\\\n  \"Atrast\\0\"\\\n  \"Atrast n\\304\\201kamo\\0\"\\\n  \"Atrast iepriek\\305\\241\\304\\223jo\\0\"\\\n  \"Atrast:\\0\"\\\n  \"Ietilpin\\304\\201t &saturu\\tCtrl+3\\0\"\\\n  \"Ietilpin\\304\\201t &lappusi\\tCtrl+0\\0\"\\\n  \"Ietilpin\\304\\201t &platumu\\tCtrl+2\\n\\0\"\\\n  \"Ietilpin\\304\\201t saturu\\0\"\\\n  \"Ietilpin\\304\\201t lappusi\\0\"\\\n  \"Ietilpin\\304\\201t platumu\\0\"\\\n  \"Ietilpin\\304\\201t platumu un r\\304\\201d\\304\\253t lappuses nep\\304\\201rtraukti\\0\"\\\n  \"Ietilpin\\304\\201t vien\\304\\201 lappus\\304\\223\\0\"\\\n  \"Fonti:\\0\"\\\n  \"Gr\\304\\201matas format\\304\\223\\305\\241ana... %d lappuses\\0\"\\\n  \"%s lappus\\304\\223 atrasts teksts\\0\"\\\n  \"%s lappus\\304\\223 atrasts teksts (v\\304\\223lreiz)\\0\"\\\n  \"Bie\\305\\276i las\\304\\253tie\\0\"\\\n  \"\\0\"\\\n  \"Doties uz lappusi\\0\"\\\n  \"Sl\\304\\223pt bie\\305\\276i las\\304\\253tos\\0\"\\\n  \"Ieteikums: izmantojiet tausti\\305\\206u F3, lai atrastu atkal\\0\"\\\n  \"Att\\304\\223lu faili (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Vai iestat\\304\\253t SumatraPDF k\\304\\201 noklus\\304\\223juma lietojumprogrammu PDF failiem?\\0\"\\\n  \"Padar\\304\\253t SumatraPDF par manu noklus\\304\\223juma PDF las\\304\\253t\\304\\201ju\\0\"\\\n  \"&Manga re\\305\\276\\304\\253ms\\0\"\\\n  \"Saska\\305\\206ot re\\304\\243istru\\0\"\\\n  \"Mobi dokumenti\\0\"\\\n  \"Modific\\304\\223ts:\\0\"\\\n  \"Ir pieejama jauna versija %s. Vai lejupiel\\304\\201d\\304\\223t jauno versiju?\\0\"\\\n  \"N\\304\\201kam\\304\\201 lappuse\\0\"\\\n  \"Netika atrasta neviena atbilst\\304\\253ba\\0\"\\\n  \"Rezult\\304\\201ts nav atrasts %u l\\304\\253nij\\304\\201 %s fail\\304\\201\\0\"\\\n  \"Sinhriz\\304\\201cijas fails nav atrasts\\0\"\\\n  \"Sinhroniz\\304\\201cijas fails nav atrasts \\305\\241aj\\304\\201 poz\\304\\253cij\\304\\201\\0\"\\\n  \"Lappu\\305\\241u skaits:\\0\"\\\n  \"Labi\\0\"\\\n  \"Atv\\304\\223rt\\0\"\\\n  \"Atv\\304\\223rt ar &PDF-XChange\\0\"\\\n  \"Atv\\304\\223rt dokumentu...\\0\"\\\n  \"Atv\\304\\223rt ar %s\\0\"\\\n  \"Atv\\304\\223rt ar &Adobe Reader\\0\"\\\n  \"Atv\\304\\223rt ar &Foxit Reader\\0\"\\\n  \"Atv\\304\\223rt ar &Microsoft HTML Help\\0\"\\\n  \"Atv\\304\\223rt ar &Microsoft XPS-Viewer\\0\"\\\n  \"&Rekviz\\304\\253ti\\0\"\\\n  \"&Rekviz\\304\\253ti\\tCtrl+D\\0\"\\\n  \"PDF dokuments\\0\"\\\n  \"PDF optimiz\\304\\201cija:\\0\"\\\n  \"PDF veidot\\304\\201js:\\0\"\\\n  \"PDF versija:\\0\"\\\n  \"PDF dokumenti\\0\"\\\n  \"Lap&pusi...\\tCtrl+G\\0\"\\\n  \"Lappuse %s\\0\"\\\n  \"Lappuses lielums:\\0\"\\\n  \"%u lappuse nepast\\304\\201v\\0\"\\\n  \"Lappuses m\\304\\223rogo\\305\\241ana\\0\"\\\n  \"Lappuse:\\0\"\\\n  \"PalmDoc dokumenti\\0\"\\\n  \"L\\305\\253dzu, uzgaidiet \\342\\200\\223 notiek atveido\\305\\241ana...\\0\"\\\n  \"PostScript dokumenti\\0\"\\\n  \"Prezent\\304\\201cija\\tF5\\0\"\\\n  \"Iepriek\\305\\241\\304\\223j\\304\\201 lappuse\\0\"\\\n  \"Druk\\304\\201t\\0\"\\\n  \"Drukas diapazons\\0\"\\\n  \"Printeris ar \\305\\241\\304\\201du nosaukumu nepast\\304\\201v\\0\"\\\n  \"Notiek druk\\304\\201\\305\\241ana.\\0\"\\\n  \"V\\304\\223l joproj\\304\\201m notiek druk\\304\\201\\305\\241ana. Priek\\305\\241laikus p\\304\\201rtraukt un beigt?\\0\"\\\n  \"V\\304\\223l joproj\\304\\201m notiek druk\\304\\201\\305\\241ana. Priek\\305\\241laikus p\\304\\201rtraukt un s\\304\\201kt no jauna?\\0\"\\\n  \"Druk\\304\\201 %d lappusi no %d...\\0\"\\\n  \"Drukas probl\\304\\223ma.\\0\"\\\n  \"P\\304\\201r&d\\304\\223v\\304\\223t...\\tF2\\0\"\\\n  \"&Atcer\\304\\223ties atv\\304\\223rtos failus\\0\"\\\n  \"No\\305\\206emt no izlases\\0\"\\\n  \"No\\305\\206emt %s lappusi no izlases\\0\"\\\n  \"P\\304\\201rd\\304\\223v\\304\\223t uz\\0\"\\\n  \"Pagriezt pa &kreisi\\tCtrl+Shift+-\\0\"\\\n  \"Pagriezt pa &labi\\tCtrl+Shift++\\0\"\\\n  \"Saglab\\304\\201t k\\304\\201\\0\"\\\n  \"Saglab\\304\\201t sa\\304\\253s&ni....\\tCtrl+Shift+S\\0\"\\\n  \"%d no %d mekl\\304\\223\\305\\241ana...\\0\"\\\n  \"Atlas\\304\\253t &visu\\0\"\\\n  \"Atlas\\304\\253t &visu\\tCtrl+A\\0\"\\\n  \"Atlas\\304\\253t saturu ar Ctrl+peles kreiso pogu\\0\"\\\n  \"Atlase:\\0\"\\\n  \"Nos\\305\\253t\\304\\253t pa &e-pastu\\0\"\\\n  \"Iestat\\304\\253t invers\\304\\201s mekl\\304\\223\\305\\241anas komandrindu\\0\"\\\n  \"R\\304\\201d\\304\\253t &gr\\304\\201matz\\304\\253mes\\0\"\\\n  \"R\\304\\201d\\304\\253t &lappuses nep\\304\\201rtraukti\\0\"\\\n  \"R\\304\\201d\\304\\253t &r\\304\\253kjoslu\\0\"\\\n  \"R\\304\\201d\\304\\253t &gr\\304\\201matz\\304\\253mes\\0\"\\\n  \"R\\304\\201d\\304\\253t bie\\305\\276i las\\304\\253tos\\0\"\\\n  \"R\\304\\201d\\304\\253t &gr\\304\\201matz\\304\\253mju s\\304\\201njoslu, ja t\\304\\201 ir pieejama\\0\"\\\n  \"Viena lappuse\\0\"\\\n  \"Piedodiet, \\305\\241im nevajadz\\304\\223ja notikt!\\n\\nL\\305\\253dzu, spiediet 'Atcelt', ja j\\305\\253s v\\304\\223laties mums pal\\304\\253dz\\304\\223t nov\\304\\223rst \\305\\241\\304\\253s k\\304\\274\\305\\253mes c\\304\\223loni.\\0\"\\\n  \"Avota failam %s nav sinhroniz\\304\\201cijas punkta\\0\"\\\n  \"T\\304\\223ma:\\0\"\\\n  \"SumatraPDF opcijas\\0\"\\\n  \"SumatraPDF atjaunin\\304\\201\\305\\241ana\\0\"\\\n  \"SumatraPDF avar\\304\\223ja\\0\"\\\n  \"SumatraPDF ir j\\305\\253su noklus\\304\\223juma PDF las\\304\\253t\\304\\201js\\0\"\\\n  \"SumatraPDF tagad b\\305\\253s j\\305\\253su noklus\\304\\223juma PDF las\\304\\253t\\304\\201js\\0\"\\\n  \"Sinhroniz\\304\\201cijas failu nevar atv\\304\\223rt\\0\"\\\n  \"Atz\\304\\253m\\304\\223ts PDF\\0\"\\\n  \"Teksta dokumenti\\0\"\\\n  \"\\305\\240aj\\304\\201 dokument\\304\\201 ir izmantotas neatbalst\\304\\253tas iesp\\304\\223jas (%s), un iesp\\304\\223jams, netiek atveidots pareizi\\0\"\\\n  \"Nosaukums:\\0\"\\\n  \"Nezin\\304\\201mas izcelsmes fails (%s)\\0\"\\\n  \"Lietot &cilnes\\0\"\\\n  \"Skats\\0\"\\\n  \"Apmekl\\304\\223t t\\304\\253mek\\304\\274a &vietni\\0\"\\\n  \"Br\\304\\253din\\304\\201jums\\0\"\\\n  \"XPS dokumenti\\0\"\\\n  \"Jums ir jaun\\304\\201k\\304\\201 versija.\\0\"\\\n  \"Jums ir versija %s\\0\"\\\n  \"T\\304\\201lummain\\304\\253t\\0\"\\\n  \"Pietuvin\\304\\201t\\0\"\\\n  \"Att\\304\\201lin\\304\\201t\\0\"\\\n  \"T\\304\\201lummai\\305\\206as koeficients\\0\"\\\n  \"[Ir atkl\\304\\201tas izmai\\305\\206as; notiek atsvaidzin\\304\\201\\305\\241ana] %s\\0\"\\\n  \"teksta kop\\304\\223\\305\\241ana\\0\"\\\n  \"dokumenta druk\\304\\201\\305\\241ana\\0\";\n\nconst char * gTranslations_lt = \n  \"Apie\\0\"\\\n  \"&Originalus\\tCtrl+1\\0\"\\\n  \"\\0\"\\\n  \"&Visi pa\\305\\276ym\\304\\227ti puslapiai\\0\"\\\n  \"At&gal\\tAlt+Kair\\304\\227n\\0\"\\\n  \"Knyga\\tCtrl+8\\0\"\\\n  \"&U\\305\\276verti\\tCtrl+W\\0\"\\\n  \"&Kopijuoti pa\\305\\276ym\\304\\227t\\304\\205 srit\\304\\257\\0\"\\\n  \"&Kopijuoti pa\\305\\276ym\\304\\227t\\304\\205 srit\\304\\257\\tCtrl+C\\0\"\\\n  \"&Daugiau nebeklausti\\0\"\\\n  \"Tik &lyginiai puslapiai\\0\"\\\n  \"&Du puslapiai\\tCtrl+7\\0\"\\\n  \"&Failas\\0\"\\\n  \"&Surasti\\0\"\\\n  \"Pi&rm\\304\\205j\\304\\257 puslap\\304\\257\\tHome\\0\"\\\n  \"Pritaikyti puslapi\\305\\263 dyd\\304\\257 prie spausdinamo ploto\\0\"\\\n  \"&Eiti \\304\\257\\0\"\\\n  \"&Eiti \\304\\257 puslap\\304\\257:\\0\"\\\n  \"&\\305\\275inynas\\0\"\\\n  \"Pa&skutin\\304\\257j\\304\\257 puslap\\304\\257\\tEnd\\0\"\\\n  \"&Mastelis\\0\"\\\n  \"Naudotojo &vadovas\\0\"\\\n  \"&Skirti did\\305\\276i\\304\\205sias ir ma\\305\\276\\304\\205sias raides\\0\"\\\n  \"&Kitas puslapis\\tDe\\305\\241in\\304\\227n\\0\"\\\n  \"&Ne\\0\"\\\n  \"A\\304\\215i\\305\\253, &ne\\0\"\\\n  \"&Tik nelyginiai puslapiai\\0\"\\\n  \"&Atverti dokument\\304\\205\\0\"\\\n  \"&Atverti...\\tCtrl+O\\0\"\\\n  \"&Nuostatos...\\0\"\\\n  \"&Slapta\\305\\276odis:\\0\"\\\n  \"Pasi&\\305\\276ym\\304\\227ti dokument\\304\\205\\0\"\\\n  \"&Ankstesnis puslapis\\tKair\\304\\227n\\0\"\\\n  \"&Spausdinti...\\0\"\\\n  \"&Spausdinti...\\tCtrl+P\\0\"\\\n  \"&Spausdinti... (neprieinama)\\0\"\\\n  \"\\304\\256siminti \\305\\241io dokumento &slapta\\305\\276od\\304\\257\\0\"\\\n  \"\\304\\256siminti \\305\\241ias &nuostatas kiekvienam dokumentui\\0\"\\\n  \"Pa&\\305\\241alinti dokument\\304\\205\\0\"\\\n  \"\\304\\256&ra\\305\\241yti kaip...\\0\"\\\n  \"\\304\\256&ra\\305\\241yti kaip...\\tCtrl+S\\0\"\\\n  \"&Nuostatos\\0\"\\\n  \"&Suma\\305\\276inti puslapi\\305\\263 dyd\\304\\257 iki spausdinamo ploto (jei reikia)\\0\"\\\n  \"&Vienas puslapis\\tCtrl+6\\0\"\\\n  \"Pralei&sti \\305\\241i\\304\\205 versij\\304\\205\\0\"\\\n  \"Na&udoti originalius puslapi\\305\\263 dyd\\305\\276ius\\0\"\\\n  \"&Rodymas\\0\"\\\n  \"\\0\"\\\n  \"&Taip\\0\"\\\n  \"&Mastelis\\0\"\\\n  \"(i\\305\\241 %d)\\0\"\\\n  \"(%s psl.)\\0\"\\\n  \"Apie \\342\\200\\236SumatraPDF\\342\\200\\234\\0\"\\\n  \"Sukurti \\305\\276ym\\304\\205\\0\"\\\n  \"Sukurti \\305\\276ym\\304\\205 \\304\\257 %s puslap\\304\\257\\0\"\\\n  \"Sukurti \\305\\276ym\\304\\205 \\304\\257 %s puslap\\304\\257, suteikiant jai \\305\\241\\304\\257 pavadinim\\304\\205 (neprivalomas):\\0\"\\\n  \"Sukurti \\305\\276ym\\304\\205\\0\"\\\n  \"Kitos\\0\"\\\n  \"Visi failai\\0\"\\\n  \"Vis\\305\\263 palaikom\\305\\263 tip\\305\\263 dokumentai\\0\"\\\n  \"Programa:\\0\"\\\n  \"Susieti su PDF failais?\\0\"\\\n  \"Priedas: %s\\0\"\\\n  \"Autorius:\\0\"\\\n  \"Automatinis\\0\"\\\n  \"Automati\\305\\241kai &tikrinti, ar yra naujinim\\305\\263\\0\"\\\n  \"Knyga\\0\"\\\n  \"\\305\\275ym\\304\\227s\\tF12\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"\\305\\275ym\\304\\227s\\0\"\\\n  \"bait\\305\\263\\0\"\\\n  \"CHM dokumentai\\0\"\\\n  \"Ry\\305\\241ys su internetu nutr\\305\\253ko (klaida %#x).\\0\"\\\n  \"Atsisakyti\\0\"\\\n  \"Nepavyko i\\305\\241spausdinti failo\\0\"\\\n  \"Nepavyko prad\\304\\227ti atvirk\\305\\241\\304\\215ios paie\\305\\241kos komandos. Patikrinkite kompandin\\304\\231 eilut\\304\\231 nuostatose.\\0\"\\\n  \"Keisti kalb\\304\\205 (Change Language)\\0\"\\\n  \"Tikrinti, ar yra &naujinim\\305\\263\\0\"\\\n  \"Komiks\\305\\263 knygel\\304\\227s\\0\"\\\n  \"\\0\"\\\n  \"Nenutr\\305\\253kstama\\0\"\\\n  \"Nenutr\\305\\253kstama knygos per\\305\\276i\\305\\253ra\\0\"\\\n  \"Nenutr\\305\\253kstama dviej\\305\\263 puslapi\\305\\263\\0\"\\\n  \"Prisid\\304\\227ti prie vertimo\\0\"\\\n  \"\\0\"\\\n  \"Kopijuoti &saito adres\\304\\205\\0\"\\\n  \"Kopijuoti ko&mentar\\304\\205\\0\"\\\n  \"Teksto kopijavimas u\\305\\276draustas (kopijuojamas tik ekrano vaizdas)\\0\"\\\n  \"\\0\"\\\n  \"Spausdintuvo savybi\\305\\263 su\\305\\276inoti nepavyko\\0\"\\\n  \"Nepavyko prisijungti prie spausdintuvo\\0\"\\\n  \"Nepavyko atvaizduoti puslapio\\0\"\\\n  \"Sukurtas:\\0\"\\\n  \"Esamasis failas\\0\"\\\n  \"\\0\"\\\n  \"Pasirinkti &mastel\\304\\257...\\tCtrl+Y\\0\"\\\n  \"Numatytasis i\\305\\241&d\\304\\227stymas:\\0\"\\\n  \"Numatytasis &mastelis\\0\"\\\n  \"Naudojant program\\304\\205 kaip portatyvi\\304\\205, numatytosios PDF \\305\\276i\\305\\253rykl\\304\\227s keisti negalima\\0\"\\\n  \"Nesuteikti leidimai:\\0\"\\\n  \"DjVu dokumentai\\0\"\\\n  \"Dokumento savyb\\304\\227s\\0\"\\\n  \"Atsisi\\305\\263sti\\0\"\\\n  \"&Baigti darb\\304\\205\\tCtrl+Q\\0\"\\\n  \"EPUB dokumentai\\0\"\\\n  \"\\304\\256veskite slapta\\305\\276od\\304\\257\\0\"\\\n  \"\\304\\256veskite %s slapta\\305\\276od\\304\\257\\0\"\\\n  \"\\304\\256veskite komandin\\304\\231 eilut\\304\\231, vykdom\\304\\205 atver\\304\\215iant PDF dokument\\304\\205:\\0\"\\\n  \"Nepavyko \\304\\257kelti %s\\0\"\\\n  \"&Parankiniai\\0\"\\\n  \"&Pirmyn\\tAlt+De\\305\\241in\\304\\227n\\0\"\\\n  \"&Visas ekranas\\tCtrl+Shift+L\\0\"\\\n  \"Du puslapiai\\0\"\\\n  \"\\0\"\\\n  \"Failo \\304\\257ra\\305\\241yti nepavyko\\0\"\\\n  \"\\0\"\\\n  \"Parankiniai\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Failo dydis:\\0\"\\\n  \"Failas:\\0\"\\\n  \"&Ie\\305\\241koti...\\tCtrl+F\\0\"\\\n  \"Ie\\305\\241koti\\0\"\\\n  \"Rasti kit\\304\\205\\0\"\\\n  \"Rasti ankstesn\\304\\257\\0\"\\\n  \"Ie\\305\\241koti:\\0\"\\\n  \"Visas puslapio &turinys\\tCtrl+3\\0\"\\\n  \"Visas &puslapis\\tCtrl+0\\0\"\\\n  \"Visas puslapio pl&otis\\tCtrl+2\\0\"\\\n  \"Visas puslapio turinys\\0\"\\\n  \"Visas puslapis\\0\"\\\n  \"Visas puslapio plotis\\0\"\\\n  \"Visas puslapio plotis, nenutr\\305\\253kstama per\\305\\276i\\305\\253ra\\0\"\\\n  \"Visas puslapis\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Ie\\305\\241koti teksto %s puslapyje\\0\"\\\n  \"Rastas tekstas %s puslapyje (v\\304\\227l)\\0\"\\\n  \"Da\\305\\276niausiai skaitomi\\0\"\\\n  \"\\0\"\\\n  \"Eiti \\304\\257 puslap\\304\\257\\0\"\\\n  \"Nerodyti da\\305\\276niausiai skaitom\\305\\263\\0\"\\\n  \"Patarimas: ie\\305\\241kodami kito atitikmens naudokite klavi\\305\\241\\304\\205 F3\\0\"\\\n  \"Grafiniai failai (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Ar nustatyti \\342\\200\\236SumatraPDF\\342\\200\\234 kaip numatyt\\304\\205j\\304\\205 PDF \\305\\276i\\305\\253rykl\\304\\231?\\0\"\\\n  \"\\342\\200\\236SumatraPDF\\342\\200\\234 nustatymas numatyt\\304\\205ja PDF \\305\\276i\\305\\253rykle\\0\"\\\n  \"\\0\"\\\n  \"Skirti did\\305\\276i\\304\\205sias ir ma\\305\\276\\304\\205sias raides\\0\"\\\n  \"Mobi dokumentai\\0\"\\\n  \"Keistas:\\0\"\\\n  \"Yra nauja %s versija. Atsi\\305\\263sti nauj\\304\\205 versij\\304\\205?\\0\"\\\n  \"Kitas puslapis\\0\"\\\n  \"Nerasta atitikmen\\305\\263\\0\"\\\n  \"Aplink eilut\\304\\231 %u faile %s nerasta joki\\305\\263 rezultat\\305\\263\\0\"\\\n  \"Sinchronizacijos failas nerastas\\0\"\\\n  \"N\\304\\227ra sinchronizacijos informacijos \\305\\241ioje pozicijoje\\0\"\\\n  \"Puslapi\\305\\263 skai\\304\\215ius:\\0\"\\\n  \"Gerai\\0\"\\\n  \"Atverti\\0\"\\\n  \"Atverti naudojant \\342\\200\\236PDF-&XChange\\342\\200\\234\\0\"\\\n  \"Atverti dokument\\304\\205...\\0\"\\\n  \"\\0\"\\\n  \"Atverti naudojant \\342\\200\\236&Adobe Reader\\342\\200\\234\\0\"\\\n  \"Atverti naudojant \\342\\200\\236&Foxit Reader\\342\\200\\234\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"&Savyb\\304\\227s\\0\"\\\n  \"&Savyb\\304\\227s\\tCtrl+D\\0\"\\\n  \"PDF dokumentas\\0\"\\\n  \"\\0\"\\\n  \"PDF leid\\304\\227jas:\\0\"\\\n  \"PDF versija:\\0\"\\\n  \"PDF dokumentai\\0\"\\\n  \"P&uslapis...\\tCtrl+G\\0\"\\\n  \"%s puslapis\\0\"\\\n  \"Puslapio dydis:\\0\"\\\n  \"Puslapio numerio %u n\\304\\227ra\\0\"\\\n  \"Puslapio mastelis\\0\"\\\n  \"Puslapis:\\0\"\\\n  \"\\0\"\\\n  \"Pra\\305\\241ome palaukti \\342\\200\\223 atvaizduojama...\\0\"\\\n  \"\\342\\200\\236PostScript\\342\\200\\234 dokumentai\\0\"\\\n  \"&Pateiktis\\tCtrl+L\\0\"\\\n  \"Ankstesnis puslapis\\0\"\\\n  \"Spausdinti\\0\"\\\n  \"Spausdinimo intervalas\\0\"\\\n  \"Spausdintuvo tokiu vardu n\\304\\227ra\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Spausdinimas dar nebaigtas. Ar norite j\\304\\257 nutraukti ir prad\\304\\227ti i\\305\\241 naujo?\\0\"\\\n  \"Spausdinamas %d puslapis i\\305\\241 %d...\\0\"\\\n  \"Spausdinimo problema.\\0\"\\\n  \"\\0\"\\\n  \"\\304\\256siminti &atvertus failus\\0\"\\\n  \"Pa\\305\\241alinti i\\305\\241 parankini\\305\\263\\0\"\\\n  \"Pa\\305\\241alinti %s puslap\\304\\257 i\\305\\241 parankini\\305\\263\\0\"\\\n  \"\\0\"\\\n  \"Pasukti \\304\\257 &kair\\304\\231\\tCtrl+Shift+-\\0\"\\\n  \"Pasukti \\304\\257 &de\\305\\241in\\304\\231\\tCtrl+Shift++\\0\"\\\n  \"\\304\\256ra\\305\\241yti kaip\\0\"\\\n  \"\\0\"\\\n  \"Ie\\305\\241koma %d i\\305\\241 %d...\\0\"\\\n  \"Pa\\305\\276ym\\304\\227ti &visk\\304\\205\\0\"\\\n  \"Pa\\305\\276ym\\304\\227ti &visk\\304\\205\\tCtrl+A\\0\"\\\n  \"Turin\\304\\257 \\305\\276ym\\304\\227kite su Ctrl+kairiuoju pel\\304\\227s klavi\\305\\241u\\0\"\\\n  \"\\0\"\\\n  \"Si\\305\\263sti el. &pa\\305\\241tu...\\0\"\\\n  \"Nustatyti atvirk\\305\\241\\304\\215ios paie\\305\\241kos komandin\\304\\231 eilut\\304\\231\\0\"\\\n  \"\\0\"\\\n  \"&Puslapius rodyti nenutr\\305\\253kstamai\\0\"\\\n  \"Rodyti &priemoni\\305\\263 juost\\304\\205\\0\"\\\n  \"Rodyti parankinius\\0\"\\\n  \"Rodyti da\\305\\276niausiai skaitomus\\0\"\\\n  \"Rodyti &\\305\\276ym\\305\\263 parankin\\304\\231, kai yra \\305\\276ym\\305\\263\\0\"\\\n  \"Atskirais puslapiais\\0\"\\\n  \"Apgailestaujame, taip netur\\304\\227jo nutikti!\\n\\nSpustel\\304\\227kite \\342\\200\\236Atsisakyti\\342\\200\\234, jeigu norite mums pad\\304\\227ti pa\\305\\241alinti \\305\\241ios strigties prie\\305\\276ast\\304\\257.\\0\"\\\n  \"Pradinis failas %s  neturi sinchronizacijos ta\\305\\241ko\\0\"\\\n  \"Tema:\\0\"\\\n  \"\\342\\200\\236SumatraPDF\\342\\200\\234 nuostatos\\0\"\\\n  \"\\342\\200\\236SumatraPDF\\342\\200\\234 naujinimas\\0\"\\\n  \"\\342\\200\\236SumatraPDF\\342\\200\\234 strigo\\0\"\\\n  \"\\342\\200\\236SumatraPDF\\342\\200\\234 yra numatytoji PDF \\305\\276i\\305\\253rykl\\304\\227\\0\"\\\n  \"Dabar \\342\\200\\236SumatraPDF\\342\\200\\234 bus numatytoji PDF \\305\\276i\\305\\253rykl\\304\\227\\0\"\\\n  \"Sinchronizacijos failas negali b\\305\\253ti atvertas\\0\"\\\n  \"\\0\"\\\n  \"Tekstiniai dokumentai\\0\"\\\n  \"\\0\"\\\n  \"Pavadinimas:\\0\"\\\n  \"Ne\\305\\276inomas pradinis failas (%s)\\0\"\\\n  \"\\0\"\\\n  \"Rodymas\\0\"\\\n  \"Interneto &svetain\\304\\227\\0\"\\\n  \"\\304\\256sp\\304\\227jimas\\0\"\\\n  \"XPS dokumentai\\0\"\\\n  \"J\\305\\253s naudojat\\304\\227s naujausia programos laida.\\0\"\\\n  \"J\\305\\253s\\305\\263 naudojama laida: %s\\0\"\\\n  \"Mastelis\\0\"\\\n  \"Padidinti\\0\"\\\n  \"Suma\\305\\276inti\\0\"\\\n  \"Mastelis\\0\"\\\n  \"[Aptikta pakitim\\305\\263; atnaujinama] %s\\0\"\\\n  \"kopijuojamas tekstas\\0\"\\\n  \"spausdinamas dokumentas\\0\";\n\nconst char * gTranslations_mk = \n  \"&\\320\\227\\320\\260 SumatraPDF...\\0\"\\\n  \"&\\320\\240\\320\\265\\320\\260\\320\\273\\320\\275\\320\\260 \\320\\263\\320\\276\\320\\273\\320\\265\\320\\274\\320\\270\\320\\275\\320\\260\\tCtrl+1\\0\"\\\n  \"&\\320\\235\\320\\260\\320\\277\\321\\200\\320\\265\\320\\264\\320\\275\\320\\270 o\\320\\277\\321\\206\\320\\270\\320\\270...\\0\"\\\n  \"&\\320\\241\\320\\270\\321\\202\\320\\265 \\320\\276\\320\\267\\320\\275\\320\\260\\321\\207\\320\\265\\320\\275\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\0\"\\\n  \"\\320\\235\\320\\260\\320\\267\\320\\260\\320\\264\\tAlt+Left Arrow\\0\"\\\n  \"\\320\\232\\320\\275\\320\\270\\320\\263\\320\\260\\tCtrl+8\\0\"\\\n  \"&\\320\\227\\320\\260\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270\\tCtrl+W\\0\"\\\n  \"&\\320\\232\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\321\\230 \\321\\201\\320\\265\\320\\273\\320\\265\\320\\272\\321\\206\\320\\270\\321\\230\\320\\260\\0\"\\\n  \"\\320\\232\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\321\\230 \\321\\201\\320\\265\\320\\273\\320\\265\\320\\272\\321\\206\\320\\270\\321\\230\\320\\260\\tCtrl+C\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\265 \\320\\277\\321\\200\\320\\260\\321\\210\\321\\203\\320\\262\\320\\260\\321\\230 \\320\\277\\320\\276\\320\\262\\321\\202\\320\\276\\321\\200\\320\\275\\320\\276\\0\"\\\n  \"\\320\\241\\320\\260\\320\\274\\320\\276 &\\320\\277\\320\\260\\321\\200\\320\\275\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\0\"\\\n  \"\\320\\224\\320\\262\\320\\265 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\tCtrl+7\\0\"\\\n  \"&\\320\\224\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\260\\0\"\\\n  \"&\\320\\235\\320\\260\\321\\230\\320\\264\\320\\270 \\321\\210\\321\\202\\320\\276:\\0\"\\\n  \"\\320\\237\\321\\200\\320\\262\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\tHome\\0\"\\\n  \"&\\320\\237\\321\\200\\320\\270\\320\\273\\320\\260\\320\\263\\320\\276\\320\\264\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270 \\320\\275\\320\\260 \\320\\267\\320\\276\\320\\275\\320\\260 \\320\\267\\320\\260 \\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\265\\321\\232\\320\\265\\0\"\\\n  \"\\320\\237&\\320\\276\\321\\230\\320\\264\\320\\270 \\320\\275\\320\\260\\0\"\\\n  \"&\\320\\237\\320\\276\\321\\230\\320\\264\\320\\270 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260:\\0\"\\\n  \"&\\320\\237\\320\\276\\320\\274\\320\\276\\321\\210\\0\"\\\n  \"\\320\\237\\320\\276\\321\\201\\320\\273\\320\\265\\320\\264\\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\tEnd\\0\"\\\n  \"&\\320\\227\\320\\263\\320\\276\\320\\273\\320\\265\\320\\274\\321\\203\\320\\262\\320\\260\\321\\232\\320\\265\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\321\\200\\320\\260\\321\\207\\320\\275\\320\\270\\320\\272 \\320\\267\\320\\260 \\321\\203\\320\\277\\320\\276\\321\\202\\321\\200\\320\\265\\320\\261\\320\\260\\0\"\\\n  \"&\\320\\240\\320\\260\\320\\267\\320\\273\\320\\270\\320\\272\\321\\203\\320\\262\\320\\260\\321\\230 \\320\\274\\320\\260\\320\\273\\320\\270 \\320\\270 \\320\\263\\320\\276\\320\\273\\320\\265\\320\\274\\320\\270 \\320\\261\\321\\203\\320\\272\\320\\262\\320\\270\\0\"\\\n  \"\\320\\241\\320\\273\\320\\265\\320\\264\\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\t->\\0\"\\\n  \"&\\320\\235\\320\\265\\0\"\\\n  \"&\\320\\235\\320\\265, \\320\\261\\320\\273\\320\\260\\320\\263\\320\\276\\320\\264\\320\\260\\321\\200\\320\\260\\320\\274\\0\"\\\n  \"\\320\\241\\320\\260\\320\\274\\320\\276 &\\320\\275\\320\\265\\320\\277\\320\\260\\321\\200\\320\\275\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"&\\320\\236\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270...\\tCtrl+O\\0\"\\\n  \"&\\320\\236\\320\\277\\321\\206\\320\\270\\320\\270...\\0\"\\\n  \"&\\320\\233\\320\\276\\320\\267\\320\\270\\320\\275\\320\\272\\320\\260:\\0\"\\\n  \"\\320\\227\\320\\260\\320\\272\\320\\260\\321\\207\\320\\270 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\321\\202\\321\\205\\320\\276\\320\\264\\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\t<-\\0\"\\\n  \"&\\320\\237\\320\\265\\321\\207\\320\\260\\321\\202\\320\\270...\\0\"\\\n  \"&\\320\\237\\320\\265\\321\\207\\320\\260\\321\\202\\320\\270...\\tCtrl+P\\0\"\\\n  \"&\\320\\237\\320\\265\\321\\207\\320\\260\\321\\202\\320\\270... (denied)\\0\"\\\n  \"&\\320\\227\\320\\260\\320\\277\\320\\276\\320\\274\\320\\275\\320\\270 \\321\\230\\320\\260 \\320\\273\\320\\276\\320\\267\\320\\270\\320\\275\\320\\272\\320\\260\\321\\202\\320\\260 \\320\\267\\320\\260 \\320\\276\\320\\262\\320\\276\\321\\230 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"&\\320\\227\\320\\260\\320\\277\\320\\276\\320\\274\\320\\275\\320\\270 \\320\\263\\320\\270 \\320\\276\\320\\262\\320\\270\\320\\265 \\320\\277\\320\\276\\321\\201\\321\\202\\320\\260\\320\\262\\321\\203\\320\\262\\320\\260\\321\\232\\320\\260 \\320\\267\\320\\260 \\321\\201\\320\\265\\320\\272\\320\\276\\321\\230 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"\\320\\236\\321\\202\\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"&\\320\\227\\320\\260\\321\\207\\321\\203\\320\\262\\320\\260\\321\\230 \\320\\272\\320\\260\\320\\272\\320\\276...\\0\"\\\n  \"&\\320\\227\\320\\260\\321\\207\\321\\203\\320\\262\\320\\260\\321\\230 \\320\\272\\320\\260\\320\\272\\320\\276...\\tCtrl+S\\0\"\\\n  \"&\\320\\237\\320\\276\\321\\201\\321\\202\\320\\260\\320\\262\\321\\203\\320\\262\\320\\260\\321\\232\\320\\260\\0\"\\\n  \"&\\320\\235\\320\\260\\320\\274\\320\\260\\320\\273\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270 \\321\\201\\320\\277\\320\\276\\321\\200\\320\\265\\320\\264 \\320\\267\\320\\276\\320\\275\\320\\260 \\320\\267\\320\\260 \\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\265\\321\\232\\320\\265 (\\320\\260\\320\\272\\320\\276 \\320\\265 \\320\\277\\320\\276\\321\\202\\321\\200\\320\\265\\320\\261\\320\\275\\320\\276)\\0\"\\\n  \"\\320\\225\\320\\264\\320\\270\\320\\275\\320\\265\\321\\207\\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\tCtrl+6\\0\"\\\n  \"&\\320\\237\\321\\200\\320\\265\\321\\201\\320\\272\\320\\276\\320\\272\\320\\275\\320\\270 \\321\\230\\320\\260 \\320\\276\\320\\262\\320\\260\\320\\260 \\320\\262\\320\\265\\321\\200\\320\\267\\320\\270\\321\\230\\320\\260\\0\"\\\n  \"&\\320\\232\\320\\276\\321\\200\\320\\270\\321\\201\\321\\202\\320\\270 \\320\\276\\321\\200\\320\\270\\320\\263\\320\\270\\320\\275\\320\\260\\320\\273\\320\\275\\320\\270 \\320\\264\\320\\270\\320\\274\\320\\265\\320\\275\\320\\267\\320\\270\\320\\270 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\0\"\\\n  \"&\\320\\237\\320\\276\\320\\263\\320\\273\\320\\265\\320\\264\\0\"\\\n  \"&\\320\\237\\321\\200\\320\\276\\320\\267\\320\\276\\321\\200\\320\\265\\321\\206\\0\"\\\n  \"&\\320\\224\\320\\260\\0\"\\\n  \"&\\320\\227\\321\\203\\320\\274\\320\\270\\321\\200\\320\\260\\321\\232\\320\\265\\0\"\\\n  \"(\\320\\276\\320\\264 %d)\\0\"\\\n  \"(\\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 %s)\\0\"\\\n  \"\\320\\227\\320\\260 SumatraPDF\\0\"\\\n  \"\\320\\224\\320\\276\\320\\264\\320\\260\\321\\230 \\320\\276\\320\\274\\320\\270\\320\\273\\320\\265\\320\\275\\0\"\\\n  \"\\320\\224\\320\\276\\320\\264\\320\\260\\321\\230 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 %s \\320\\262\\320\\276 \\320\\276\\320\\274\\320\\270\\320\\273\\320\\265\\320\\275\\320\\270\\0\"\\\n  \"\\320\\224\\320\\276\\320\\264\\320\\260\\321\\230 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 %s \\320\\262\\320\\276 \\320\\276\\320\\274\\320\\270\\320\\273\\320\\265\\320\\275\\320\\270 \\321\\201\\320\\276 \\320\\270\\320\\274\\320\\265 \\320\\277\\320\\276 \\320\\270\\320\\267\\320\\261\\320\\276\\321\\200:\\0\"\\\n  \"\\320\\224\\320\\276\\320\\264\\320\\260\\321\\230 \\320\\262\\320\\276 \\320\\276\\320\\274\\320\\270\\320\\273\\320\\265\\320\\275\\320\\270\\0\"\\\n  \"\\320\\235\\320\\260\\320\\277\\321\\200\\320\\265\\320\\264\\320\\275\\320\\270\\0\"\\\n  \"\\320\\241\\320\\270\\321\\202\\320\\265 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\270\\0\"\\\n  \"\\320\\241\\320\\270\\321\\202\\320\\265 \\320\\277\\320\\276\\320\\264\\320\\264\\321\\200\\320\\260\\320\\266\\320\\275\\320\\270 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\220\\320\\277\\320\\273\\320\\270\\320\\272\\320\\260\\321\\206\\320\\270\\321\\230\\320\\260:\\0\"\\\n  \"\\320\\224\\320\\260 \\321\\203\\320\\277\\321\\200\\320\\260\\320\\262\\321\\203\\320\\262\\320\\260\\320\\274 \\321\\201\\320\\276 PDF-\\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\270?\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\273\\320\\276\\320\\263: %s\\0\"\\\n  \"\\320\\220\\320\\262\\321\\202\\320\\276\\321\\200:\\0\"\\\n  \"\\320\\220\\320\\262\\321\\202\\320\\276\\320\\274\\320\\260\\321\\202\\321\\201\\320\\272\\320\\270\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\262\\320\\265\\321\\200\\321\\203\\320\\262\\320\\260\\321\\230 \\320\\267\\320\\260 &\\320\\275\\320\\260\\320\\264\\320\\263\\321\\200\\320\\260\\320\\264\\320\\261\\320\\270 \\320\\260\\320\\262\\321\\202\\320\\276\\320\\274\\320\\260\\321\\202\\321\\201\\320\\272\\320\\270\\0\"\\\n  \"\\320\\232\\320\\275\\320\\270\\320\\263\\320\\260\\0\"\\\n  \"\\320\\236\\320\\261\\320\\265\\320\\273\\320\\265\\320\\266\\321\\203\\320\\262\\320\\260\\321\\207\\320\\270\\tF12\\0\"\\\n  \"\\320\\232\\321\\200\\320\\260\\321\\202\\320\\265\\320\\275\\320\\272\\320\\270 \\320\\276\\320\\264 \\320\\276\\320\\261\\320\\265\\320\\273\\320\\265\\320\\266\\321\\203\\320\\262\\320\\260\\321\\207\\320\\270\\0\"\\\n  \"\\320\\232\\321\\200\\320\\260\\321\\202\\320\\265\\320\\275\\320\\272\\320\\270 \\320\\276\\320\\264 \\320\\276\\320\\261\\320\\265\\320\\273\\320\\265\\320\\266\\321\\203\\320\\262\\320\\260\\321\\207\\320\\270 \\320\\267\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 %s \\320\\276\\320\\264 %s\\0\"\\\n  \"\\320\\236\\320\\261\\320\\265\\320\\273\\320\\265\\320\\266\\321\\203\\320\\262\\320\\260\\321\\207\\320\\270\\0\"\\\n  \"\\320\\261\\320\\260\\321\\230\\321\\202\\320\\270\\0\"\\\n  \"CHM-\\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\260\\320\\274 \\320\\264\\320\\260 \\321\\201\\320\\265 \\320\\277\\320\\276\\320\\262\\321\\200\\320\\267\\320\\260\\320\\274 \\320\\275\\320\\260 \\320\\230\\320\\275\\321\\202\\320\\265\\321\\200\\320\\275\\320\\265\\321\\202 (\\320\\263\\321\\200\\320\\265\\321\\210\\320\\272\\320\\260 %#x).\\0\"\\\n  \"\\320\\236\\321\\202\\320\\272\\320\\260\\320\\266\\320\\270\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\260\\320\\274 \\320\\264\\320\\260 \\321\\230\\320\\260 \\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\260\\320\\274 \\320\\276\\320\\262\\320\\260\\320\\260 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\260\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\260\\320\\274 \\320\\264\\320\\260 \\320\\267\\320\\260\\320\\277\\320\\276\\321\\207\\320\\275\\320\\260\\320\\274 \\321\\201\\320\\276 \\320\\276\\320\\261\\321\\200\\320\\260\\321\\202\\320\\275\\320\\276\\321\\202\\320\\276 \\320\\277\\321\\200\\320\\265\\320\\261\\320\\260\\321\\200\\321\\203\\320\\262\\320\\260\\321\\232\\320\\265. \\320\\237\\321\\200\\320\\276\\320\\262\\320\\265\\321\\200\\320\\270 \\321\\230\\320\\260 \\320\\272\\320\\276\\320\\274\\320\\260\\320\\275\\320\\264\\320\\275\\320\\260\\321\\202\\320\\260 \\320\\273\\320\\270\\320\\275\\320\\270\\321\\230\\320\\260 \\320\\262\\320\\276 \\320\\277\\320\\276\\321\\201\\321\\202\\320\\260\\320\\262\\321\\203\\320\\262\\320\\260\\321\\232\\320\\260\\321\\202\\320\\260.\\0\"\\\n  \"\\320\\241\\320\\274\\320\\265\\320\\275\\320\\270 \\321\\230\\320\\260\\320\\267\\320\\270\\320\\272 (Change Language)\\0\"\\\n  \"&\\320\\237\\321\\200\\320\\276\\320\\262\\320\\265\\321\\200\\320\\270 \\320\\267\\320\\260 \\320\\275\\320\\260\\320\\264\\320\\263\\321\\200\\320\\260\\320\\264\\320\\261\\320\\270\\0\"\\\n  \"\\320\\241\\321\\202\\321\\200\\320\\270\\320\\277\\320\\276\\320\\262\\320\\270\\0\"\\\n  \"\\320\\232\\320\\276\\320\\274\\320\\277\\320\\260\\321\\202\\320\\270\\320\\261\\320\\270\\320\\273\\320\\275\\320\\276\\321\\201\\321\\202\\0\"\\\n  \"\\320\\235\\320\\265\\320\\277\\321\\200\\320\\265\\320\\272\\320\\270\\320\\275\\320\\260\\321\\202 \\320\\277\\320\\276\\320\\263\\320\\273\\320\\265\\320\\264\\0\"\\\n  \"\\320\\232\\320\\275\\320\\270\\320\\263\\320\\260 \\321\\201\\320\\276 \\320\\275\\320\\265\\320\\277\\321\\200\\320\\265\\320\\272\\320\\270\\320\\275\\320\\260\\321\\202 \\320\\277\\320\\276\\320\\263\\320\\273\\320\\265\\320\\264\\0\"\\\n  \"\\320\\235\\320\\265\\320\\277\\321\\200\\320\\265\\320\\272\\320\\270\\320\\275\\320\\260\\321\\202 \\320\\277\\320\\276\\320\\263\\320\\273\\320\\265\\320\\264 \\321\\201\\320\\276 \\320\\264\\320\\262\\320\\265 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\0\"\\\n  \"\\320\\243\\321\\207\\320\\265\\321\\201\\321\\202\\320\\262\\321\\203\\320\\262\\320\\260\\321\\230 \\320\\262\\320\\276 \\320\\277\\321\\200\\320\\265\\320\\262\\320\\265\\320\\264\\321\\203\\320\\262\\320\\260\\321\\232\\320\\265\\321\\202\\320\\276 \\320\\275\\320\\260 \\320\\276\\320\\262\\320\\260\\320\\260 \\320\\260\\320\\277\\320\\273\\320\\270\\320\\272\\320\\260\\321\\206\\320\\270\\321\\230\\320\\260\\0\"\\\n  \"\\320\\232\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\321\\230 &\\321\\201\\320\\273\\320\\270\\320\\272\\320\\260\\0\"\\\n  \"\\320\\232\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\321\\230 \\321\\230\\320\\260 \\320\\260\\320\\264\\321\\200\\320\\265\\321\\201\\320\\260\\321\\202\\320\\260 \\320\\275\\320\\260 &\\320\\262\\321\\200\\321\\201\\320\\272\\320\\260\\321\\202\\320\\260\\0\"\\\n  \"\\320\\232\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\321\\230 \\320\\272\\320\\276\\320\\274\\320\\265\\320\\275\\321\\202\\320\\260\\321\\200\\0\"\\\n  \"\\320\\232\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\321\\232\\320\\265\\321\\202\\320\\276 \\320\\275\\320\\260 \\321\\202\\320\\265\\320\\272\\321\\201\\321\\202\\320\\276\\321\\202 \\320\\261\\320\\265\\321\\210\\320\\265 \\320\\276\\320\\264\\320\\261\\320\\270\\320\\265\\320\\275\\320\\276 (\\320\\272\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\321\\232\\320\\265 \\321\\201\\320\\260\\320\\274\\320\\276 \\320\\262\\320\\276 \\320\\262\\320\\270\\320\\264 \\320\\275\\320\\260 \\321\\201\\320\\273\\320\\270\\320\\272\\320\\260)\\0\"\\\n  \"\\320\\220\\320\\262\\321\\202\\320\\276\\321\\200\\321\\201\\320\\272\\320\\276 \\320\\277\\321\\200\\320\\260\\320\\262\\320\\276:\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\260\\320\\274 \\320\\264\\320\\260 \\320\\264\\320\\276\\321\\230\\320\\264\\320\\260\\320\\274 \\320\\264\\320\\276 \\321\\201\\320\\262\\320\\276\\321\\230\\321\\201\\321\\202\\320\\262\\320\\260\\321\\202\\320\\260 \\320\\275\\320\\260 \\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\260\\321\\207\\320\\276\\321\\202\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\260\\320\\274 \\320\\264\\320\\260 \\320\\263\\320\\276 \\320\\277\\320\\276\\320\\264\\320\\263\\320\\276\\321\\202\\320\\262\\320\\260\\320\\274 \\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\260\\321\\207\\320\\276\\321\\202\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\260\\320\\274 \\320\\264\\320\\260 \\321\\230\\320\\260 \\320\\277\\321\\200\\320\\270\\320\\272\\320\\260\\320\\266\\320\\260\\320\\274 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\321\\202\\320\\260\\0\"\\\n  \"\\320\\241\\320\\276\\320\\267\\320\\264\\320\\260\\320\\264\\320\\265\\320\\275\\320\\276 \\320\\275\\320\\260:\\0\"\\\n  \"\\320\\220\\320\\272\\321\\202\\320\\270\\320\\262\\320\\275\\320\\260 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\260\\0\"\\\n  \"\\320\\234\\320\\265\\321\\201\\321\\202\\320\\276\\320\\277\\320\\276\\320\\273\\320\\276\\320\\266\\320\\261\\320\\260 \\320\\275\\320\\260 \\320\\277\\320\\276\\320\\272\\320\\260\\320\\266\\321\\203\\320\\262\\320\\260\\321\\207:\\0\"\\\n  \"&\\320\\227\\321\\203\\320\\274\\320\\270\\321\\200\\320\\260\\321\\232\\320\\265 \\320\\277\\320\\276 \\320\\270\\320\\267\\320\\261\\320\\276\\321\\200...\\tCtrl+Y\\0\"\\\n  \"&\\320\\236\\321\\201\\320\\275\\320\\276\\320\\262\\320\\265\\320\\275 \\320\\277\\320\\276\\320\\263\\320\\273\\320\\265\\320\\264:\\0\"\\\n  \"\\320\\236\\321\\201\\320\\275\\320\\276\\320\\262\\320\\275\\320\\276 &\\320\\267\\321\\203\\320\\274\\320\\270\\321\\200\\320\\260\\321\\232\\320\\265:\\0\"\\\n  \"\\320\\236\\321\\201\\320\\275\\320\\276\\320\\262\\320\\275\\320\\270\\320\\276\\321\\202 \\321\\207\\320\\270\\321\\202\\320\\260\\321\\207 \\320\\275\\320\\260 PDF \\320\\275\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\265 \\320\\264\\320\\260 \\321\\200\\320\\260\\320\\261\\320\\276\\321\\202\\320\\270 \\320\\262\\320\\276 \\320\\274\\320\\276\\320\\261\\320\\270\\320\\273\\320\\265\\320\\275 \\321\\200\\320\\265\\320\\266\\320\\270\\320\\274\\0\"\\\n  \"\\320\\236\\320\\264\\320\\261\\320\\270\\320\\265\\320\\275\\320\\270 \\320\\277\\321\\200\\320\\270\\320\\262\\320\\270\\320\\273\\320\\265\\320\\263\\320\\270\\320\\270:\\0\"\\\n  \"DjVu-\\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\241\\320\\262\\320\\276\\321\\230\\321\\201\\321\\202\\320\\262\\320\\260 \\320\\275\\320\\260 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\320\\267\\320\\265\\320\\274\\320\\270\\0\"\\\n  \"&\\320\\230\\320\\267\\320\\273\\320\\265\\320\\267\\320\\270\\tCtrl+Q\\0\"\\\n  \"EPUB-\\320\\265-\\320\\272\\320\\275\\320\\270\\320\\263\\320\\270\\0\"\\\n  \"\\320\\222\\320\\275\\320\\265\\321\\201\\320\\270 \\320\\273\\320\\276\\320\\267\\320\\270\\320\\275\\320\\272\\320\\260\\0\"\\\n  \"\\320\\222\\320\\275\\320\\265\\321\\201\\320\\270 \\320\\273\\320\\276\\320\\267\\320\\270\\320\\275\\320\\272\\320\\260 \\320\\267\\320\\260 %s\\0\"\\\n  \"\\320\\222\\320\\275\\320\\265\\321\\201\\320\\265\\321\\202\\320\\265 \\320\\272\\320\\276\\320\\274\\320\\260\\320\\275\\320\\264\\320\\260, \\320\\267\\320\\260 \\320\\264\\320\\260 \\321\\201\\320\\265 \\320\\270\\320\\267\\320\\262\\321\\200\\321\\210\\321\\203\\320\\262\\320\\260 \\320\\277\\321\\200\\320\\270 \\321\\201\\320\\265\\320\\272\\320\\276\\320\\265 \\320\\264\\320\\262\\320\\276\\321\\230\\320\\275\\320\\276 \\320\\272\\320\\273\\320\\270\\320\\272\\320\\275\\321\\203\\320\\275\\320\\262\\320\\260\\321\\232\\320\\265 \\320\\275\\320\\260 PDF-\\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\276\\321\\202:\\0\"\\\n  \"\\320\\223\\321\\200\\320\\265\\321\\210\\320\\272\\320\\260 \\320\\277\\321\\200\\320\\270 \\320\\262\\321\\207\\320\\270\\321\\202\\321\\203\\320\\262\\320\\260\\321\\232\\320\\265 %s\\0\"\\\n  \"\\320\\236\\320\\274\\320\\270\\320\\273\\320\\265\\320\\275\\320\\270\\0\"\\\n  \"\\320\\235\\320\\260\\320\\277\\321\\200\\320\\265\\320\\264\\tAlt+Right Arrow\\0\"\\\n  \"\\320\\235\\320\\260 \\321\\206\\320\\265\\320\\273 \\320\\265\\320\\272\\321\\200\\320\\260\\320\\275\\tCtrl+Shift+L\\0\"\\\n  \"\\320\\224\\320\\262\\320\\265 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\321\\201\\320\\277\\320\\265\\320\\260\\320\\262 \\320\\264\\320\\260 \\321\\230\\320\\260 \\320\\277\\321\\200\\320\\265\\320\\270\\320\\274\\320\\265\\320\\275\\321\\203\\320\\262\\320\\260\\320\\274 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\260\\321\\202\\320\\260!\\0\"\\\n  \"\\320\\227\\320\\260\\321\\207\\321\\203\\320\\262\\321\\203\\320\\262\\320\\260\\321\\232\\320\\265 \\320\\275\\320\\260 PDF-\\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\276\\321\\202 \\320\\275\\320\\265 \\321\\203\\321\\201\\320\\277\\320\\265\\320\\260\\0\"\\\n  \"\\320\\221\\321\\200\\320\\267 \\320\\262\\320\\265\\320\\261-\\320\\277\\321\\200\\320\\265\\320\\263\\320\\273\\320\\265\\320\\264\\0\"\\\n  \"\\320\\236\\320\\274\\320\\270\\320\\273\\320\\265\\320\\275\\320\\270\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270 \\320\\275\\320\\260 FictionBook\\0\"\\\n  \"\\320\\224\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\260\\321\\202\\320\\260 %s \\320\\275\\320\\265 \\320\\265 \\320\\275\\320\\260\\321\\230\\320\\264\\320\\265\\320\\275\\320\\260\\0\"\\\n  \"\\320\\223\\320\\276\\320\\273\\320\\265\\320\\274\\320\\270\\320\\275\\320\\260 \\320\\275\\320\\260 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\260:\\0\"\\\n  \"\\320\\224\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\260:\\0\"\\\n  \"\\320\\235\\320\\260\\321\\230\\320\\264\\320\\270...\\tCtrl+F\\0\"\\\n  \"\\320\\235\\320\\260\\321\\230\\320\\264\\320\\270\\0\"\\\n  \"\\320\\235\\320\\260\\321\\230\\320\\264\\320\\270 \\321\\201\\320\\273\\320\\265\\320\\264\\320\\275\\320\\276\\0\"\\\n  \"\\320\\235\\320\\260\\321\\230\\320\\264\\320\\270 \\320\\277\\321\\200\\320\\265\\321\\202\\321\\205\\320\\276\\320\\264\\320\\275\\320\\276\\0\"\\\n  \"\\320\\235\\320\\260\\321\\230\\320\\264\\320\\270:\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\273\\320\\260\\320\\263\\320\\276\\320\\264\\320\\270 \\320\\275\\320\\260 &\\321\\201\\320\\276\\320\\264\\321\\200\\320\\266\\320\\270\\320\\275\\320\\260\\tCtrl+3\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\273\\320\\260\\320\\263\\320\\276\\320\\264\\320\\270 \\320\\275\\320\\260 &\\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\tCtrl+0\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\273\\320\\260\\320\\263\\320\\276\\320\\264\\320\\270 \\320\\275\\320\\260 &\\321\\210\\320\\270\\321\\200\\320\\270\\320\\275\\320\\260\\tCtrl+2\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\273\\320\\260\\320\\263\\320\\276\\320\\264\\320\\270 \\320\\275\\320\\260 \\321\\201\\320\\276\\320\\264\\321\\200\\320\\266\\320\\270\\320\\275\\320\\260\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\273\\320\\260\\320\\263\\320\\276\\320\\264\\320\\270 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\273\\320\\260\\320\\263\\320\\276\\320\\264\\320\\270 \\320\\275\\320\\260 \\321\\210\\320\\270\\321\\200\\320\\270\\320\\275\\320\\260\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\273\\320\\260\\320\\263\\320\\276\\320\\264\\320\\270 \\320\\275\\320\\260 \\321\\210\\320\\270\\321\\200\\320\\276\\321\\207\\320\\270\\320\\275\\320\\260 \\320\\270 \\320\\277\\321\\200\\320\\270\\320\\272\\320\\260\\320\\266\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270 \\320\\275\\320\\265\\320\\277\\321\\200\\320\\265\\320\\272\\320\\270\\320\\275\\320\\260\\321\\202\\320\\276\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\273\\320\\260\\320\\263\\320\\276\\320\\264\\320\\270 \\320\\275\\320\\260 \\320\\277\\320\\276\\320\\265\\320\\264\\320\\270\\320\\275\\320\\265\\321\\207\\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\0\"\\\n  \"\\320\\221\\321\\203\\320\\272\\320\\262\\320\\270:\\0\"\\\n  \"\\320\\210\\320\\260 \\321\\204\\320\\276\\321\\200\\320\\274\\320\\260\\321\\202\\320\\270\\321\\200\\320\\260\\320\\274 \\320\\272\\320\\275\\320\\270\\320\\263\\320\\260\\321\\202\\320\\260... %d \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\275\\320\\260\\321\\230\\320\\264\\320\\276\\320\\262 \\321\\202\\320\\265\\320\\272\\321\\201\\321\\202 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 %s\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\275\\320\\260\\321\\230\\320\\264\\320\\276\\320\\262 \\321\\202\\320\\265\\320\\272\\321\\201\\321\\202 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 %s (\\320\\277\\320\\276\\320\\262\\321\\202\\320\\276\\321\\200\\320\\275\\320\\276)\\0\"\\\n  \"\\320\\247\\320\\265\\321\\201\\321\\202\\320\\276 \\321\\207\\320\\270\\321\\202\\320\\260\\320\\275\\320\\270\\0\"\\\n  \"\\0\"\\\n  \"\\320\\237\\320\\276\\321\\230\\320\\264\\320\\270 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\0\"\\\n  \"\\320\\241\\320\\276\\320\\272\\321\\200\\320\\270\\321\\230 \\321\\207\\320\\265\\321\\201\\321\\202\\320\\276 \\321\\207\\320\\270\\321\\202\\320\\260\\320\\275\\320\\270\\0\"\\\n  \"\\320\\241\\320\\276\\320\\262\\320\\265\\321\\202: \\320\\227\\320\\260 \\320\\277\\320\\276\\320\\262\\321\\202\\320\\276\\321\\200\\320\\275\\320\\276 \\320\\277\\321\\200\\320\\265\\320\\261\\320\\260\\321\\200\\321\\203\\320\\262\\320\\260\\321\\232\\320\\265 \\320\\272\\320\\276\\321\\200\\320\\270\\321\\201\\321\\202\\320\\265\\321\\202\\320\\265 F3 \\320\\276\\320\\264 \\321\\202\\320\\260\\321\\201\\321\\202\\320\\260\\321\\202\\321\\203\\321\\200\\320\\260\\321\\202\\320\\260\\0\"\\\n  \"\\320\\241\\320\\273\\320\\270\\320\\272\\320\\270 (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"\\320\\224\\320\\260\\320\\273\\320\\270 \\320\\264\\320\\260 \\321\\230\\320\\260 \\320\\275\\320\\260\\320\\277\\321\\200\\320\\260\\320\\262\\320\\260\\320\\274 SumatraPDF \\320\\276\\321\\201\\320\\275\\320\\276\\320\\262\\320\\275\\320\\260 \\320\\260\\320\\277\\320\\273\\320\\270\\320\\272\\320\\260\\321\\206\\320\\270\\321\\230\\320\\260 \\320\\267\\320\\260 PDF-\\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\270?\\0\"\\\n  \"\\320\\235\\320\\260\\320\\277\\321\\200\\320\\260\\320\\262\\320\\270 \\321\\230\\320\\260 SumatraPDF \\320\\276\\321\\201\\320\\275\\320\\276\\320\\262\\320\\265\\320\\275 \\321\\207\\320\\270\\321\\202\\320\\260\\321\\207 \\320\\275\\320\\260 PDF\\0\"\\\n  \"\\320\\240\\320\\265\\320\\266\\320\\270\\320\\274 \\320\\267\\320\\260 Man&ga\\0\"\\\n  \"\\320\\240\\320\\260\\320\\267\\320\\273\\320\\270\\320\\272\\321\\203\\320\\262\\320\\260\\321\\230 \\320\\274\\320\\260\\320\\273\\320\\270 \\320\\270 \\320\\263\\320\\276\\320\\273\\320\\265\\320\\274\\320\\270 \\320\\261\\321\\203\\320\\272\\320\\262\\320\\270\\0\"\\\n  \"Mobi-\\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\230\\320\\267\\320\\274\\320\\265\\320\\275\\320\\265\\321\\202\\320\\276 \\320\\275\\320\\260:\\0\"\\\n  \"\\320\\235\\320\\276\\320\\262\\320\\260 \\320\\262\\320\\265\\321\\200\\320\\267\\320\\270\\321\\230\\320\\260 %s \\320\\265 \\320\\264\\320\\276\\321\\201\\321\\202\\320\\260\\320\\277\\320\\275\\320\\260. \\320\\241\\320\\260\\320\\272\\320\\260\\321\\202\\320\\265 \\320\\264\\320\\260 \\321\\230\\320\\260 \\320\\277\\321\\200\\320\\265\\320\\267\\320\\265\\320\\274\\320\\260\\320\\274?\\0\"\\\n  \"\\320\\241\\320\\273\\320\\265\\320\\264\\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\201\\320\\265 \\320\\277\\321\\200\\320\\276\\320\\275\\320\\260\\321\\230\\320\\264\\320\\265\\320\\275\\320\\270 \\321\\201\\320\\276\\320\\262\\320\\277\\320\\260\\321\\223\\320\\260\\321\\232\\320\\260\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\275\\320\\260\\321\\230\\320\\264\\320\\276\\320\\262 \\321\\200\\320\\265\\320\\267\\321\\203\\320\\273\\321\\202\\320\\260\\321\\202\\320\\270 \\320\\276\\320\\272\\320\\276\\320\\273\\321\\203 \\320\\273\\320\\270\\320\\275\\320\\270\\321\\230\\320\\260\\321\\202\\320\\260 %u \\320\\262\\320\\276 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\260\\321\\202\\320\\260 %s\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\275\\320\\260\\321\\230\\320\\264\\320\\276\\320\\262 \\321\\201\\320\\270\\320\\275\\321\\205\\321\\200\\320\\276\\320\\275\\320\\270\\320\\267\\320\\260\\321\\206\\320\\270\\321\\201\\320\\272\\320\\260 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\260\\0\"\\\n  \"\\320\\235\\320\\265\\320\\274\\320\\260 \\320\\270\\320\\275\\321\\204\\320\\276\\321\\200\\320\\274\\320\\260\\321\\206\\320\\270\\320\\270 \\320\\267\\320\\260 \\321\\201\\320\\270\\320\\275\\321\\205\\321\\200\\320\\276\\320\\275\\320\\270\\320\\267\\320\\260\\321\\206\\320\\270\\321\\230\\320\\260 \\320\\275\\320\\260 \\320\\276\\320\\262\\320\\260\\320\\260 \\320\\277\\320\\276\\320\\267\\320\\270\\321\\206\\320\\270\\321\\230\\320\\260\\0\"\\\n  \"\\320\\221\\321\\200\\320\\276\\321\\230 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270:\\0\"\\\n  \"\\320\\222\\320\\276 \\321\\200\\320\\265\\320\\264\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270 \\321\\201\\320\\276 PDF-XChange\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202...\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270 \\320\\262\\320\\276 %s\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270 \\321\\201\\320\\276 &Adobe Reader\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270 \\321\\201\\320\\276 &Foxit Reader\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270 \\321\\201\\320\\276 Microsoft HTML Help\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270 \\321\\201\\320\\276 Microsoft XPS-Viewer\\0\"\\\n  \"&\\320\\241\\320\\262\\320\\276\\321\\230\\321\\201\\321\\202\\320\\262\\320\\260\\0\"\\\n  \"\\320\\241&\\320\\262\\320\\276\\321\\230\\321\\201\\321\\202\\320\\262\\320\\260...\\tCtrl+D\\0\"\\\n  \"PDF-\\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"\\320\\236\\320\\277\\321\\202\\320\\270\\320\\274\\320\\270\\320\\267\\320\\260\\321\\206\\320\\270\\320\\270 \\320\\267\\320\\260 PDF:\\0\"\\\n  \"PDF-\\320\\263\\320\\265\\320\\275\\320\\265\\321\\200\\320\\260\\321\\202\\320\\276\\321\\200:\\0\"\\\n  \"\\320\\222\\320\\265\\321\\200\\320\\267\\320\\270\\321\\230\\320\\260 \\320\\275\\320\\260 PDF:\\0\"\\\n  \"PDF-\\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\241\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260...\\tCtrl+G\\0\"\\\n  \"\\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 %s\\0\"\\\n  \"\\320\\223\\320\\276\\320\\273\\320\\265\\320\\274\\320\\270\\320\\275\\320\\260 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260:\\0\"\\\n  \"\\320\\241\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 \\321\\201\\320\\276 \\320\\261\\321\\200\\320\\276\\321\\230 %u \\320\\275\\320\\265 \\320\\277\\320\\276\\321\\201\\321\\202\\320\\276\\320\\270\\0\"\\\n  \"\\320\\240\\320\\260\\320\\267\\320\\274\\320\\265\\321\\200 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\0\"\\\n  \"\\320\\241\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260:\\0\"\\\n  \"\\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270 \\320\\275\\320\\260 PalmDoc\\0\"\\\n  \"\\320\\222\\320\\265 \\320\\274\\320\\276\\320\\273\\320\\260\\320\\274 \\320\\277\\320\\276\\321\\207\\320\\265\\320\\272\\320\\260\\321\\230\\321\\202\\320\\265 - \\321\\201\\320\\276\\320\\267\\320\\264\\320\\260\\320\\262\\320\\260\\320\\274 \\320\\277\\321\\200\\320\\270\\320\\272\\320\\260\\320\\267...\\0\"\\\n  \"Postscript-\\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\320\\267\\320\\265\\320\\275\\321\\202\\320\\260\\321\\206\\320\\270\\321\\230\\320\\260\\tCtrl+L\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\321\\202\\321\\205\\320\\276\\320\\264\\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\0\"\\\n  \"\\320\\237\\320\\265\\321\\207\\320\\260\\321\\202\\320\\270\\0\"\\\n  \"\\320\\236\\320\\277\\321\\201\\320\\265\\320\\263 \\320\\267\\320\\260 \\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\265\\321\\232\\320\\265\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\277\\320\\276\\321\\201\\321\\202\\320\\276\\320\\270 \\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\260\\321\\207 \\321\\201\\320\\276 \\320\\267\\320\\260\\320\\264\\320\\260\\320\\264\\320\\265\\320\\275\\320\\276\\321\\202\\320\\276 \\320\\270\\320\\274\\320\\265\\0\"\\\n  \"\\320\\237\\320\\265\\321\\207\\320\\260\\321\\202\\320\\265\\321\\232\\320\\265\\321\\202\\320\\276 \\320\\265 \\320\\262\\320\\276 \\321\\202\\320\\265\\320\\272.\\0\"\\\n  \"\\320\\237\\320\\265\\321\\207\\320\\260\\321\\202\\320\\265\\321\\232\\320\\265\\321\\202\\320\\276 \\320\\265 \\321\\201\\303\\250 \\321\\203\\321\\210\\321\\202\\320\\265 \\320\\262\\320\\276 \\321\\202\\320\\265\\320\\272. \\320\\224\\320\\260 \\320\\263\\320\\276 \\320\\277\\320\\276\\320\\275\\320\\270\\321\\210\\321\\202\\320\\260\\320\\274 \\320\\270 \\320\\277\\321\\200\\320\\265\\320\\272\\320\\270\\320\\275\\320\\260\\320\\274?\\0\"\\\n  \"\\320\\237\\320\\265\\321\\207\\320\\260\\321\\202\\320\\265\\321\\232\\320\\265\\321\\202\\320\\276 \\321\\202\\321\\200\\320\\260\\320\\265 \\321\\201\\303\\250 \\321\\203\\321\\210\\321\\202\\320\\265. \\320\\224\\320\\260 \\320\\263\\320\\276 \\320\\267\\320\\260\\320\\277\\321\\200\\320\\260\\320\\274 \\320\\270 \\320\\264\\320\\260 \\320\\277\\320\\276\\321\\207\\320\\275\\320\\260\\320\\274 \\320\\276\\320\\264\\320\\275\\320\\276\\320\\262\\320\\276?\\0\"\\\n  \"\\320\\237\\320\\265\\321\\207\\320\\260\\321\\202\\320\\265\\321\\232\\320\\265 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 %d \\320\\276\\320\\264 %d...\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\261\\320\\273\\320\\265\\320\\274 \\320\\277\\321\\200\\320\\270 \\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\265\\321\\232\\320\\265.\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\320\\270\\320\\274\\320\\265\\320\\275\\321\\203\\320\\262\\320\\260\\321\\230... \\tF2\\0\"\\\n  \"\\320\\227\\320\\260\\320\\277\\320\\276\\320\\274\\320\\275\\320\\270 \\320\\263\\320\\270 &\\320\\276\\321\\202\\320\\262\\320\\276\\321\\200\\320\\265\\320\\275\\320\\270\\321\\202\\320\\265 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\270\\0\"\\\n  \"\\320\\236\\321\\202\\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270 \\320\\276\\320\\264 \\320\\276\\320\\274\\320\\270\\320\\273\\320\\265\\320\\275\\320\\270\\0\"\\\n  \"\\320\\236\\321\\202\\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 %s \\320\\276\\320\\264 \\320\\276\\320\\274\\320\\270\\320\\273\\320\\265\\320\\275\\320\\270\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\320\\270\\320\\274\\320\\265\\320\\275\\321\\203\\320\\262\\320\\260\\321\\230 \\320\\262\\320\\276\\0\"\\\n  \"\\320\\240\\320\\276\\321\\202\\320\\270\\321\\200\\320\\260\\321\\230 \\320\\275\\320\\260 \\320\\273\\320\\265\\320\\262\\320\\276\\tCtrl+Shift+-\\0\"\\\n  \"\\320\\240\\320\\276\\321\\202\\320\\270\\321\\200\\320\\260\\321\\230 \\320\\275\\320\\260 \\320\\264\\320\\265\\321\\201\\320\\275\\320\\276\\tCtrl+Shift++\\0\"\\\n  \"\\320\\227\\320\\260\\321\\207\\321\\203\\320\\262\\320\\260\\321\\230 \\320\\272\\320\\260\\320\\272\\320\\276\\0\"\\\n  \"\\320\\227\\320\\260\\321\\207\\321\\203\\320\\262\\320\\260\\321\\230 &\\320\\272\\321\\200\\320\\260\\321\\202\\320\\265\\320\\275\\320\\272\\320\\260...\\tCtrl+Shift+S\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\320\\261\\320\\260\\321\\200\\321\\203\\320\\262\\320\\260\\320\\274 %d \\320\\276\\320\\264 %d \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270...\\0\"\\\n  \"\\320\\230\\320\\267\\320\\261\\320\\265\\321\\200\\320\\270 \\321\\201\\303\\250\\0\"\\\n  \"\\320\\230\\320\\267\\320\\261\\320\\265\\321\\200\\320\\270 \\321\\201\\303\\250\\tCtrl+A\\0\"\\\n  \"\\320\\241\\320\\265\\320\\273\\320\\265\\320\\272\\321\\202\\320\\270\\321\\200\\320\\260\\321\\230 \\321\\201\\320\\276 Ctrl \\320\\270 \\320\\273\\320\\265\\320\\262\\320\\276\\321\\202\\320\\276 \\320\\272\\320\\276\\320\\277\\321\\207\\320\\265 \\320\\275\\320\\260 \\320\\263\\320\\273\\321\\203\\320\\262\\321\\207\\320\\265\\321\\202\\320\\276\\0\"\\\n  \"\\320\\241\\320\\265\\320\\273\\320\\265\\320\\272\\321\\206\\320\\270\\321\\230\\320\\260:\\0\"\\\n  \"\\320\\230\\321\\201\\320\\277\\321\\200\\320\\260\\321\\202\\320\\270 \\320\\277\\320\\276 &\\320\\265-\\320\\277\\320\\276\\321\\210\\321\\202\\320\\260...\\0\"\\\n  \"\\320\\220\\320\\272\\321\\202\\320\\270\\320\\262\\320\\270\\321\\200\\320\\260\\321\\230 \\320\\270\\320\\275\\320\\262\\320\\265\\321\\200\\320\\267\\320\\275\\320\\276 \\320\\277\\321\\200\\320\\265\\320\\261\\320\\260\\321\\200\\321\\203\\320\\262\\320\\260\\321\\232\\320\\265\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\272\\320\\260\\320\\266\\320\\270 &\\320\\276\\320\\261\\320\\265\\320\\273\\320\\265\\320\\266\\321\\203\\320\\262\\320\\260\\321\\207\\320\\270\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\272\\320\\260\\320\\266\\321\\203\\320\\262\\320\\260\\321\\230 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270 \\320\\275\\320\\265\\320\\277\\321\\200\\320\\265\\320\\272\\320\\270\\320\\275\\320\\260\\321\\202\\320\\276\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\272\\320\\260\\320\\266\\320\\270 \\320\\260\\320\\273\\320\\260\\321\\202\\320\\275\\320\\270\\320\\272\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\272\\320\\260\\320\\266\\320\\270 \\320\\276\\320\\274\\320\\270\\320\\273\\320\\265\\320\\275\\320\\270\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\272\\320\\260\\320\\266\\320\\270 \\321\\207\\320\\265\\321\\201\\321\\202\\320\\276 \\321\\207\\320\\270\\321\\202\\320\\260\\320\\275\\320\\270\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\272\\320\\260\\320\\266\\320\\270 \\320\\263\\320\\276 \\320\\260\\320\\273\\320\\260\\321\\202\\320\\275\\320\\270\\320\\272\\320\\276\\321\\202 \\321\\201\\320\\276 &\\320\\276\\320\\261\\320\\265\\320\\273\\320\\265\\320\\266\\321\\203\\320\\262\\320\\260\\321\\207\\320\\270 \\320\\272\\320\\276\\320\\263\\320\\260 \\320\\265 \\320\\264\\320\\276\\321\\201\\321\\202\\320\\260\\320\\277\\320\\265\\320\\275\\0\"\\\n  \"\\320\\225\\320\\264\\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\0\"\\\n  \"\\320\\230\\320\\267\\320\\262\\320\\270\\320\\275\\320\\265\\321\\202\\320\\265, \\320\\276\\320\\262\\320\\260 \\320\\275\\320\\265 \\321\\202\\321\\200\\320\\265\\320\\261\\320\\260\\321\\210\\320\\265 \\320\\264\\320\\260 \\321\\201\\320\\265 \\321\\201\\320\\273\\321\\203\\321\\207\\320\\270!\\n\\n\\320\\224\\320\\276\\320\\272\\320\\276\\320\\273\\320\\272\\321\\203 \\321\\201\\320\\260\\320\\272\\320\\260\\321\\202\\320\\265 \\320\\264\\320\\260 \\320\\275\\320\\270 \\320\\277\\320\\276\\320\\274\\320\\276\\320\\263\\320\\275\\320\\265\\321\\202\\320\\265 \\320\\264\\320\\260 \\320\\263\\320\\276 \\320\\276\\321\\202\\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\320\\274\\320\\265 \\320\\276\\320\\262\\320\\276\\321\\230 \\320\\277\\321\\200\\320\\276\\320\\261\\320\\273\\320\\265\\320\\274, \\320\\222\\320\\265 \\320\\274\\320\\276\\320\\273\\320\\260\\320\\274 \\320\\270\\320\\267\\320\\261\\320\\265\\321\\200\\320\\265\\321\\202\\320\\265 '\\320\\236\\321\\202\\320\\272\\320\\260\\320\\266\\320\\270'.\\0\"\\\n  \"\\320\\230\\320\\267\\320\\262\\320\\276\\321\\200\\320\\275\\320\\260\\321\\202\\320\\260 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\260 %s \\320\\275\\320\\265\\320\\274\\320\\260 \\321\\201\\320\\270\\320\\275\\321\\205\\321\\200\\320\\276\\320\\275\\320\\270\\320\\267\\320\\260\\321\\206\\320\\270\\321\\201\\320\\272\\320\\260 \\321\\202\\320\\276\\321\\207\\320\\272\\320\\260\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\320\\264\\320\\274\\320\\265\\321\\202:\\0\"\\\n  \"\\320\\237\\320\\276\\321\\201\\321\\202\\320\\260\\320\\262\\321\\203\\320\\262\\320\\260\\321\\232\\320\\260 \\320\\275\\320\\260 SumatraPDF\\0\"\\\n  \"\\320\\235\\320\\260\\320\\264\\320\\263\\321\\200\\320\\260\\320\\264\\321\\203\\320\\262\\320\\260\\321\\232\\320\\265 \\320\\275\\320\\260 SumatraPDF\\0\"\\\n  \"SumatraPDF \\321\\201\\320\\265 \\321\\201\\321\\200\\321\\203\\321\\210\\320\\270\\0\"\\\n  \"SumatraPDF \\320\\265 \\320\\222\\320\\260\\321\\210\\320\\270\\320\\276\\321\\202 \\320\\276\\321\\201\\320\\275\\320\\276\\320\\262\\320\\265\\320\\275 \\321\\207\\320\\270\\321\\202\\320\\260\\321\\207 \\320\\275\\320\\260 PDF\\0\"\\\n  \"\\320\\241\\320\\265\\320\\263\\320\\260 SumatraPDF \\320\\261\\320\\270 \\321\\202\\321\\200\\320\\265\\320\\261\\320\\260\\320\\273\\320\\276 \\320\\264\\320\\260 \\320\\265 \\320\\222\\320\\260\\321\\210\\320\\270\\320\\276\\321\\202 \\320\\276\\321\\201\\320\\275\\320\\276\\320\\262\\320\\265\\320\\275 \\321\\207\\320\\270\\321\\202\\320\\260\\321\\207 \\320\\275\\320\\260 PDF\\0\"\\\n  \"\\320\\241\\320\\270\\320\\275\\321\\205\\321\\200\\320\\276\\320\\275\\320\\270\\320\\267\\320\\260\\321\\206\\320\\270\\321\\201\\320\\272\\320\\260\\321\\202\\320\\260 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\260 \\320\\275\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\265 \\320\\264\\320\\260 \\321\\201\\320\\265 \\320\\276\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270\\0\"\\\n  \"\\320\\236\\320\\267\\320\\275\\320\\260\\321\\207\\320\\265\\320\\275 PDF\\0\"\\\n  \"\\320\\242\\320\\265\\320\\272\\321\\201\\321\\202\\321\\203\\320\\260\\320\\273\\320\\275\\320\\270 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\0\"\\\n  \"\\320\\235\\320\\260\\321\\201\\320\\273\\320\\276\\320\\262:\\0\"\\\n  \"\\320\\235\\320\\265\\320\\277\\320\\276\\320\\267\\320\\275\\320\\260\\321\\202\\320\\260 \\320\\270\\320\\267\\320\\262\\320\\276\\321\\200\\320\\275\\320\\260 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\260 (%s)\\0\"\\\n  \"\\320\\232\\320\\276\\321\\200\\320\\270\\321\\201\\321\\202\\320\\270 &\\321\\202\\320\\260\\320\\261\\320\\276\\320\\262\\320\\270\\0\"\\\n  \"\\320\\237\\320\\276\\320\\263\\320\\273\\320\\265\\320\\264\\0\"\\\n  \"\\320\\237\\320\\276\\321\\201\\320\\265\\321\\202\\320\\270 \\320\\262\\320\\265\\320\\261-\\321\\201\\320\\260\\321\\230\\321\\202\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\320\\264\\321\\203\\320\\277\\321\\200\\320\\265\\320\\264\\321\\203\\320\\262\\320\\260\\321\\232\\320\\265\\0\"\\\n  \"XPS-\\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\210\\320\\260 \\320\\270\\320\\274\\320\\260\\321\\202\\320\\265 \\320\\275\\320\\260\\321\\230\\320\\275\\320\\276\\320\\262\\320\\260\\321\\202\\320\\260 \\320\\262\\320\\265\\321\\200\\320\\267\\320\\270\\321\\230\\320\\260.\\0\"\\\n  \"\\320\\210\\320\\260 \\320\\270\\320\\274\\320\\260\\321\\202\\320\\265 \\320\\262\\320\\265\\321\\200\\320\\267\\320\\270\\321\\230\\320\\260\\321\\202\\320\\260 %s\\0\"\\\n  \"\\320\\227\\321\\203\\320\\274\\320\\270\\321\\200\\320\\260\\321\\232\\320\\265\\0\"\\\n  \"\\320\\227\\320\\263\\320\\276\\320\\273\\320\\265\\320\\274\\320\\270\\0\"\\\n  \"\\320\\235\\320\\260\\320\\274\\320\\260\\320\\273\\320\\270\\0\"\\\n  \"\\320\\241\\321\\202\\320\\265\\320\\277\\320\\265\\320\\275 \\320\\275\\320\\260 \\320\\267\\321\\203\\320\\274\\320\\270\\321\\200\\320\\260\\321\\232\\320\\265\\0\"\\\n  \"[\\320\\227\\320\\260\\320\\261\\320\\265\\320\\273\\320\\265\\320\\266\\320\\260\\320\\262 \\320\\277\\321\\200\\320\\276\\320\\274\\320\\265\\320\\275\\320\\270; \\320\\276\\321\\201\\320\\262\\320\\265\\320\\266\\321\\203\\320\\262\\320\\260\\320\\274...] %s\\0\"\\\n  \"\\320\\272\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\320\\274 \\321\\202\\320\\265\\320\\272\\321\\201\\321\\202\\0\"\\\n  \"\\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\260\\320\\274 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\";\n\nconst char * gTranslations_my = \n  \"&Mengenai\\0\"\\\n  \"&Saiz sebenar\\tCtrl+1\\0\"\\\n  \"&Tetapan terperinci...\\0\"\\\n  \"&Semua mukasurat pilihan\\0\"\\\n  \"&Kembali\\tAlt+Left Arrow\\0\"\\\n  \"Lihat &buku\\tCtrl+8\\0\"\\\n  \"&Tutup\\tCtrl+W\\0\"\\\n  \"&Salin Pilihan\\0\"\\\n  \"&Salin pilihan\\tCtrl+C\\0\"\\\n  \"&Jangan tanya saya lagi\\0\"\\\n  \"&Mukasurat genap sahaja\\0\"\\\n  \"&Menghadap\\tCtrl+7\\0\"\\\n  \"&Fail\\0\"\\\n  \"&carian:\\0\"\\\n  \"&Halaman pertama\\tHome\\0\"\\\n  \"&Muatkan halaman pada kawasan boleh cetak\\0\"\\\n  \"&Pergi\\0\"\\\n  \"&Pergi ke halaman:\\0\"\\\n  \"&Bantuan\\0\"\\\n  \"&Halaman terakhir\\0\"\\\n  \"&Pembesaran:\\0\"\\\n  \"\\0\"\\\n  \"&Padan case\\0\"\\\n  \"&Halaman seterusnya\\t->\\0\"\\\n  \"&Tidak\\0\"\\\n  \"&Tidak, terima kasih\\0\"\\\n  \"&Mukasurat ganjil sahaja\\0\"\\\n  \"&Buka dokumen\\0\"\\\n  \"&Buka...\\tCtrl+O\\0\"\\\n  \"&Pilihan...\\0\"\\\n  \"&Kata laluan\\0\"\\\n  \"&Pin Dokumen\\0\"\\\n  \"&Halaman sebelumnya\\t<-\\0\"\\\n  \"&Cetak...\\0\"\\\n  \"&Cetak...\\tCtrl+P\\0\"\\\n  \"&Cetak... (dinafikan)\\0\"\\\n  \"&Ingat katalaluan untuk dokumen ini\\0\"\\\n  \"&Ingat tetapan-tetapan ini untuk setiap dokumen\\0\"\\\n  \"&Buang dokumen\\0\"\\\n  \"&Simpan Sebagai...\\0\"\\\n  \"&Simpan sebagai...\\tCtrl+S\\0\"\\\n  \"&Tetapan\\0\"\\\n  \"&Kecilkan muka surat ke kawasan cetak (jika perlu)\\0\"\\\n  \"&Halaman Tunggal\\tCtrl+6\\0\"\\\n  \"&Langkau versi ini\\0\"\\\n  \"&Gunakan saiz halaman asal\\0\"\\\n  \"&Lihat\\0\"\\\n  \"\\0\"\\\n  \"&Ya\\0\"\\\n  \"&Fokus\\0\"\\\n  \"(dari %d)\\0\"\\\n  \"(halaman %s)\\0\"\\\n  \"Mengenai SumatraPDF\\0\"\\\n  \"Tambah pada Kegemaran\\0\"\\\n  \"Tambahkan halaman %s pada kegemaran\\0\"\\\n  \"Tambah halaman %s pada kegemaran dengan nama (pilihan):\\0\"\\\n  \"Tambah pada kegemaran\\0\"\\\n  \"Lanjutan\\0\"\\\n  \"Semua fail\\0\"\\\n  \"Semua dokumen yang disokong\\0\"\\\n  \"Aplikasi\\0\"\\\n  \"Kaitkan dengan fail PDF?\\0\"\\\n  \"Lampiran: %s\\0\"\\\n  \"Pengarang\\0\"\\\n  \"Automatik\\0\"\\\n  \"Semak &kemas kini secara automatik\\0\"\\\n  \"Paparan buku\\0\"\\\n  \"Penanda\\tF12\\0\"\\\n  \"Pintasan Penanda\\0\"\\\n  \"Bookmark shortcut ke halaman %s daripada %s\\0\"\\\n  \"Penanda\\0\"\\\n  \"\\0\"\\\n  \"Dokumen CHM\\0\"\\\n  \"Gagal menyambung ke Internet (ralat %#x).\\0\"\\\n  \"Batal\\0\"\\\n  \"Tidak boleh cetak fail ini\\0\"\\\n  \"Tidak boleh memulakan arahan carian songsang. Sila periksa baris arahan dalam tetapan.\\0\"\\\n  \"Tukar bahasa (Change Language)\\0\"\\\n  \"Semak &Kemaskini\\0\"\\\n  \"Buku komik\\0\"\\\n  \"Kesesuaian\\0\"\\\n  \"Bersambung\\0\"\\\n  \"Paparan buku berterusan\\0\"\\\n  \"Dua belah mukasurat bersambung\\0\"\\\n  \"Menyumbangkan alihbahasa\\0\"\\\n  \"Salin &Imej\\0\"\\\n  \"Salin &Alamat Pautan\\0\"\\\n  \"Salin Ko&men\\0\"\\\n  \"Salinan teks telah ditolak (menyalin sebagai imej sahaja)\\0\"\\\n  \"Hakcipta\\0\"\\\n  \"Gagal mendapatkan maklumat Pencetak\\0\"\\\n  \"Tidak dapat memulakan pencetak\\0\"\\\n  \"Tidak dapat memuatkan halaman\\0\"\\\n  \"Dicipta:\\0\"\\\n  \"Fail semasa\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Default &Susunatur:\\0\"\\\n  \"Default &Zum:\\0\"\\\n  \"Pembaca utama PDF tidak boleh ditukar ketika mod mudah alih\\0\"\\\n  \"Kebenaran Dinafikan:\\0\"\\\n  \"Dokumen DjVu\\0\"\\\n  \"Maklumat Dokumen\\0\"\\\n  \"Muat turun\\0\"\\\n  \"&Keluar\\tCtrl+Q\\0\"\\\n  \"Ebook EPUB\\0\"\\\n  \"Masukkan kata laluan\\0\"\\\n  \"Masukkan kata laluan untuk %s\\0\"\\\n  \"Masukkan baris arahan untuk digunakan apabila anda klik dua kali pada dokumen PDF:\\0\"\\\n  \"Ralat memuatkan %s\\0\"\\\n  \"Kegem&aran\\0\"\\\n  \"F&orward \\t alt + Panah Kanan\\0\"\\\n  \"Mukasurat Penuh\\tCtrl+Shift+L\\0\"\\\n  \"Dua belah mukasurat\\0\"\\\n  \"Gagal menamakan semula fail!\\0\"\\\n  \"Gagal menyimpan fail\\0\"\\\n  \"Paparan Web Cepat\\0\"\\\n  \"Kegemaran\\0\"\\\n  \"Dokumen FictionBook\\0\"\\\n  \"Fail %s tidak dijumpai\\0\"\\\n  \"Saiz fail:\\0\"\\\n  \"Fail:\\0\"\\\n  \"Cari...\\tCtrl+F\\0\"\\\n  \"Cari\\0\"\\\n  \"Cari seterusnya\\0\"\\\n  \"Cari sebelumnya\\0\"\\\n  \"Cari:\\0\"\\\n  \"Fit &Kandungan\\tCtrl +3\\0\"\\\n  \"&Muatkan mukasurat\\tCtrl+0\\0\"\\\n  \"&Muatkan lebar\\tCtrl+2\\0\"\\\n  \"Muatkan Kandungan\\0\"\\\n  \"Muatkan mukasurat\\0\"\\\n  \"Muatkan lebar\\0\"\\\n  \"Muatkan Lebar dan Paparkan Halaman Berterusan\\0\"\\\n  \"Muatkan Halaman Tunggal\\0\"\\\n  \"Fon:\\0\"\\\n  \"Format buku ... %d halaman\\0\"\\\n  \"Menjumpai teks pada halaman %s\\0\"\\\n  \"Found teks pada halaman %s (lagi)\\0\"\\\n  \"Kerap Dibaca\\0\"\\\n  \"\\0\"\\\n  \"Pergi ke mukasurat\\0\"\\\n  \"Sembunyikan Bacaan Kerap\\0\"\\\n  \"Petunjuk: Gunakan kekunci F3 untuk mencari semula\\0\"\\\n  \"Imej Fail (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Jadikan aplikasi SumatraPDF pembaca utama bagi fail PDF?\\0\"\\\n  \"Jadikan SumatraPDF pembaca utama PDF\\0\"\\\n  \"Mode Man&ga\\0\"\\\n  \"Hampir sama\\0\"\\\n  \"Dokumen Mobi\\0\"\\\n  \"Diubah:\\0\"\\\n  \"Versi terbaru %s tersedia. Muat turun versi terbaru?\\0\"\\\n  \"Mukasurat seterusnya\\0\"\\\n  \"Tiada padanan dijumpai\\0\"\\\n  \"Tiada hasil ditemui di sekitar baris %u dalam fail %s\\0\"\\\n  \"Tiada fail penyegerakan ditemui\\0\"\\\n  \"Tiada maklumat penyelarasan pada kedudukan ini\\0\"\\\n  \"Jumlah mukasurat:\\0\"\\\n  \"\\0\"\\\n  \"Buka\\0\"\\\n  \"Buka &menggunakan PDF-XChange\\0\"\\\n  \"Buka dokumen...\\0\"\\\n  \"Buka dalam %s\\0\"\\\n  \"Buka menggunakan &Adobe Reader\\0\"\\\n  \"Buka dengan &Foxit Reader\\0\"\\\n  \"Buka menggunakan &Microsoft HTML Help\\0\"\\\n  \"Buka menggunakan &Microsoft XPS-Viewer\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Dokumen PDF\\0\"\\\n  \"Pengoptimuman PDF:\\0\"\\\n  \"\\0\"\\\n  \"Versi PDF:\\0\"\\\n  \"Dokumen-dokumen PDF\\0\"\\\n  \"Mukasurat...\\tCtrl+G\\0\"\\\n  \"Halaman %s\\0\"\\\n  \"Saiz mukasurat\\0\"\\\n  \"Halaman bilangan\\302\\240%u tidak wujud\\0\"\\\n  \"Skala halaman\\0\"\\\n  \"Mukasurat:\\0\"\\\n  \"\\0\"\\\n  \"Sila tunggu - memaparkan...\\0\"\\\n  \"Dokumen PostScript\\0\"\\\n  \"P&embentangan\\tCtrl + L\\0\"\\\n  \"Mukasurat sebelumnya\\0\"\\\n  \"Cetak\\0\"\\\n  \"Cetak julat\\0\"\\\n  \"Pencetak dengan nama yang diberikan tidak wujud\\0\"\\\n  \"Cetakan sedang dijalankan.\\0\"\\\n  \"Cetakan sedang dilakukan. Batal dan Henti?\\0\"\\\n  \"Cetakan masih lagi dijalankan. Batalkan dan mulakan semula?\\0\"\\\n  \"Mencetak halaman %d daripada %d...\\0\"\\\n  \"Masalah mencetak\\0\"\\\n  \"&Nama semula ...\\tF2\\0\"\\\n  \"Ingat &fail yang telah dibuka\\0\"\\\n  \"Keluarkan daripada kegemaran\\0\"\\\n  \"Padam halaman %s dari kegemaran\\0\"\\\n  \"Namakan sebagai\\0\"\\\n  \"Ubah ke kiri\\tCtrl+Shift+-\\0\"\\\n  \"Ubah ke kanan\\tCtrl+Shift++\\0\"\\\n  \"Simpan sebagai\\0\"\\\n  \"Simpan S&hortcut...\\tCtrl+Shift+S\\0\"\\\n  \"Mencari %d dari %d...\\0\"\\\n  \"Pilih &Semua\\0\"\\\n  \"Pilih Semu&a\\tCtrl+A\\0\"\\\n  \"Pilih kandungan dengan Ctrl + butang kiri tetikus\\0\"\\\n  \"Pilihan\\0\"\\\n  \"Hantar melalui &Emel...\\0\"\\\n  \"Tetapkan pencarian songsang baris arahan\\0\"\\\n  \"Papar &Bookmark\\0\"\\\n  \"Papar mukasurat secara berterusan\\0\"\\\n  \"Tunjukkan Bar Alat\\0\"\\\n  \"Papar kegemaran\\0\"\\\n  \"Paparkan dokuman yang kerap dibaca\\0\"\\\n  \"Tunjukkan &bookmark sidebar apabila ada\\0\"\\\n  \"Satu Mukasurat\\0\"\\\n  \"Maaf, itu tidak sepatutnya berlaku!\\nSila tekan 'Batal', jika anda ingin membantu kami menetapkan punca kemalangan ini.\\0\"\\\n  \"Sumber fail %s tidak mempunyai titik penyegerakan\\0\"\\\n  \"Subjek\\0\"\\\n  \"Tetapan-tetapan SumatraPDF\\0\"\\\n  \"Kemaskini SumatraPDF\\0\"\\\n  \"\\0\"\\\n  \"SumatraPDF ialah pembaca PDF utama anda\\0\"\\\n  \"SumatraPDF kini harus menjadi pembaca utama PDF anda\\0\"\\\n  \"File penyegerakan tidak boleh dibuka\\0\"\\\n  \"PDF ditanda\\0\"\\\n  \"Dokumen teks\\0\"\\\n  \"\\0\"\\\n  \"Tajuk:\\0\"\\\n  \"Fail sumber tidak diketahui (%s)\\0\"\\\n  \"\\0\"\\\n  \"Lihat\\0\"\\\n  \"&Lawat lamanweb\\0\"\\\n  \"Amaran\\0\"\\\n  \"Dokumen XPS\\0\"\\\n  \"Anda mempunyai versi terkini.\\0\"\\\n  \"Versi anda %s\\0\"\\\n  \"Zum\\0\"\\\n  \"Fokus ke dalam\\0\"\\\n  \"Fokus ke luar\\0\"\\\n  \"Faktor zoom\\0\"\\\n  \"[Perubahan dikesan; refresh semula] %s\\0\"\\\n  \"menyalin teks\\0\"\\\n  \"mencetak dokumen\\0\";\n\nconst char * gTranslations_ne = \n  \"SumatraPDF &\\340\\244\\254\\340\\244\\276\\340\\244\\260\\340\\245\\207\\340\\244\\256\\340\\244\\276\\0\"\\\n  \"&\\340\\244\\270\\340\\244\\271\\340\\245\\200 \\340\\244\\206\\340\\244\\225\\340\\244\\276\\340\\244\\260\\tCtrl+1\\0\"\\\n  \"\\0\"\\\n  \"\\340\\244\\232\\340\\244\\257\\340\\244\\250 \\340\\244\\227\\340\\244\\260\\340\\244\\277\\340\\244\\217\\340\\244\\225\\340\\244\\276 &\\340\\244\\270\\340\\244\\254\\340\\245\\210 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\340\\244\\271\\340\\244\\260\\340\\245\\201\\0\"\\\n  \"&\\340\\244\\252\\340\\244\\233\\340\\244\\276\\340\\244\\241\\340\\244\\277\\tAlt+\\340\\244\\254\\340\\244\\276\\340\\244\\257\\340\\244\\276\\340\\244\\201 \\340\\244\\254\\340\\244\\276\\340\\244\\243\\0\"\\\n  \"&\\340\\244\\252\\340\\245\\201\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\277\\340\\244\\225\\340\\244\\276 \\340\\244\\246\\340\\245\\203\\340\\244\\266\\340\\245\\215\\340\\244\\257\\tCtrl+8\\0\"\\\n  \"&\\340\\244\\254\\340\\244\\250\\340\\245\\215\\340\\244\\246 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\tCtrl+W\\0\"\\\n  \"\\340\\244\\232\\340\\244\\257\\340\\244\\250\\340\\244\\225\\340\\245\\213 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\244\\340\\244\\277&\\340\\244\\262\\340\\244\\277\\340\\244\\252\\340\\244\\277 \\340\\244\\254\\340\\244\\250\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\232\\340\\244\\257\\340\\244\\250\\340\\244\\225\\340\\245\\213 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\244\\340\\244\\277&\\340\\244\\262\\340\\244\\277\\340\\244\\252\\340\\244\\277 \\340\\244\\254\\340\\244\\250\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\tCtrl+C\\0\"\\\n  \"\\340\\244\\256\\340\\244\\262\\340\\244\\276\\340\\244\\210 \\340\\244\\252\\340\\245\\201\\340\\244\\250\\340\\244\\203 &\\340\\244\\250\\340\\244\\270\\340\\245\\213\\340\\244\\247\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"&\\340\\244\\234\\340\\245\\213\\340\\244\\260 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\256\\340\\244\\276\\340\\244\\244\\340\\245\\215\\340\\244\\260\\0\"\\\n  \"&\\340\\244\\270\\340\\244\\256\\340\\245\\215\\340\\244\\256\\340\\245\\201\\340\\244\\226\\tCtrl+7\\0\"\\\n  \"&\\340\\244\\253\\340\\244\\276\\340\\244\\207\\340\\244\\262\\0\"\\\n  \"\\340\\244\\225\\340\\245\\207 \\340\\244\\253\\340\\245\\207\\340\\244\\262\\340\\244\\276 \\340\\244\\252\\340\\244\\276\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\207:\\0\"\\\n  \"&\\340\\244\\252\\340\\244\\271\\340\\244\\277\\340\\244\\262\\340\\245\\213 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\tHome\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\340\\244\\271\\340\\244\\260\\340\\245\\201\\340\\244\\262\\340\\244\\276\\340\\244\\210 \\340\\244\\233\\340\\244\\276\\340\\244\\252\\340\\245\\215\\340\\244\\250\\340\\244\\257\\340\\245\\213\\340\\244\\227\\340\\245\\215\\340\\244\\257 \\340\\244\\225\\340\\245\\215\\340\\244\\267\\340\\245\\207\\340\\244\\244\\340\\245\\215\\340\\244\\260\\340\\244\\256\\340\\244\\276 &\\340\\244\\205\\340\\244\\237\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"&\\340\\244\\234\\340\\244\\276\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"&\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\340\\244\\256\\340\\244\\276 \\340\\244\\234\\340\\244\\276\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"&\\340\\244\\256\\340\\244\\246\\340\\244\\244\\0\"\\\n  \"\\340\\244\\205\\340\\244\\250\\340\\245\\215\\340\\244\\244\\340\\244\\277&\\340\\244\\256 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\tEnd\\0\"\\\n  \"&\\340\\244\\206\\340\\244\\265\\340\\244\\260\\340\\245\\215\\340\\244\\247\\340\\244\\250:\\0\"\\\n  \"&\\340\\244\\252\\340\\245\\201\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\277\\340\\244\\225\\340\\244\\276\\0\"\\\n  \"&\\340\\244\\225\\340\\245\\207\\340\\244\\270 \\340\\244\\256\\340\\244\\277\\340\\244\\262\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"&\\340\\244\\205\\340\\244\\260\\340\\245\\215\\340\\244\\225\\340\\245\\213 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\t\\340\\244\\246\\340\\244\\276\\340\\244\\257\\340\\244\\276\\340\\244\\201 \\340\\244\\254\\340\\244\\276\\340\\244\\243\\0\"\\\n  \"&\\340\\244\\254\\340\\245\\207\\340\\244\\240\\340\\244\\277\\340\\244\\225\\0\"\\\n  \"\\340\\244\\247\\340\\244\\250\\340\\245\\215\\340\\244\\257\\340\\244\\254\\340\\244\\276\\340\\244\\246, \\340\\244\\244\\340\\244\\260 &\\340\\244\\252\\340\\244\\260\\340\\245\\215\\340\\244\\246\\340\\245\\210\\340\\244\\250\\0\"\\\n  \"&\\340\\244\\254\\340\\244\\277\\340\\244\\234\\340\\245\\213\\340\\244\\260 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\256\\340\\244\\276\\340\\244\\244\\340\\245\\215\\340\\244\\260\\0\"\\\n  \"&\\340\\244\\225\\340\\244\\276\\340\\244\\227\\340\\244\\234\\340\\244\\276\\340\\244\\244 \\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\215\\340\\244\\250\\340\\245\\201&\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215...\\tCtrl+O\\0\"\\\n  \"&\\340\\244\\265\\340\\244\\277\\340\\244\\225\\340\\244\\262\\340\\245\\215\\340\\244\\252\\340\\244\\271\\340\\244\\260\\340\\245\\201\\0\"\\\n  \"&\\340\\244\\252\\340\\244\\276\\340\\244\\270\\340\\244\\265\\340\\244\\260\\340\\245\\215\\340\\244\\241\\0\"\\\n  \"\\340\\244\\225\\340\\244\\276\\340\\244\\227\\340\\244\\234\\340\\244\\276\\340\\244\\244\\340\\244\\262\\340\\244\\276\\340\\244\\210 &\\340\\244\\237\\340\\244\\276\\340\\244\\201\\340\\244\\270\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\205&\\340\\244\\230\\340\\244\\277\\340\\244\\262\\340\\245\\215\\340\\244\\262\\340\\245\\213 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\t\\340\\244\\254\\340\\244\\276\\340\\244\\257\\340\\244\\276\\340\\244\\201 \\340\\244\\254\\340\\244\\276\\340\\244\\243\\0\"\\\n  \"&\\340\\244\\233\\340\\244\\276\\340\\244\\252\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215 ...\\0\"\\\n  \"&\\340\\244\\233\\340\\244\\276\\340\\244\\252\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215...\\tCtrl+P\\0\"\\\n  \"&\\340\\244\\233\\340\\244\\252\\340\\244\\276\\340\\244\\210... (\\340\\244\\205\\340\\244\\270\\340\\245\\215\\340\\244\\265\\340\\245\\200\\340\\244\\225\\340\\244\\276\\340\\244\\260 \\340\\244\\255\\340\\244\\257\\340\\245\\213)\\0\"\\\n  \"\\340\\244\\257\\340\\245\\213 \\340\\244\\225\\340\\244\\276\\340\\244\\227\\340\\244\\234\\340\\244\\276\\340\\244\\244\\340\\244\\225\\340\\245\\213 \\340\\244\\252\\340\\244\\276\\340\\244\\270\\340\\244\\265\\340\\244\\260\\340\\245\\215\\340\\244\\241 &\\340\\244\\270\\340\\244\\256\\340\\245\\215\\340\\244\\235\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\257\\340\\245\\200 \\340\\244\\270\\340\\245\\207\\340\\244\\237\\340\\244\\277\\340\\244\\231\\340\\244\\271\\340\\244\\260\\340\\245\\201 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\244\\340\\245\\215\\340\\244\\257\\340\\245\\207\\340\\244\\225 \\340\\244\\225\\340\\244\\276\\340\\244\\227\\340\\244\\234\\340\\244\\276\\340\\244\\244\\340\\244\\225\\340\\245\\213 \\340\\244\\262\\340\\244\\276\\340\\244\\227\\340\\244\\277 &\\340\\244\\270\\340\\244\\256\\340\\245\\215\\340\\244\\235\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\225\\340\\244\\276\\340\\244\\227\\340\\244\\234\\340\\244\\276\\340\\244\\244 &\\340\\244\\271\\340\\244\\237\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\254&\\340\\244\\232\\340\\244\\244 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215...\\0\"\\\n  \"\\340\\244\\254&\\340\\244\\232\\340\\244\\244 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215...\\tCtrl+S\\0\"\\\n  \"&\\340\\244\\270\\340\\245\\207\\340\\244\\237\\340\\244\\277\\340\\244\\231\\340\\244\\271\\340\\244\\260\\340\\245\\202\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\340\\244\\271\\340\\244\\260\\340\\245\\201\\340\\244\\262\\340\\244\\276\\340\\244\\210 \\340\\244\\233\\340\\244\\276\\340\\244\\252\\340\\245\\215\\340\\244\\250\\340\\244\\257\\340\\245\\213\\340\\244\\227\\340\\245\\215\\340\\244\\257 \\340\\244\\225\\340\\245\\215\\340\\244\\267\\340\\245\\207\\340\\244\\244\\340\\245\\215\\340\\244\\260\\340\\244\\256\\340\\244\\276 &\\340\\244\\226\\340\\245\\201\\340\\244\\256\\340\\245\\215\\340\\244\\232\\340\\245\\215\\340\\244\\257\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215 (\\340\\244\\206\\340\\244\\265\\340\\244\\270\\340\\245\\215\\340\\244\\257\\340\\244\\225 \\340\\244\\252\\340\\244\\260\\340\\245\\207\\340\\244\\256\\340\\244\\276)\\0\"\\\n  \"&\\340\\244\\217\\340\\244\\225\\340\\244\\262 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\tCtrl+6\\0\"\\\n  \"\\340\\244\\257\\340\\245\\213 \\340\\244\\270\\340\\244\\202\\340\\244\\270\\340\\245\\215\\340\\244\\225\\340\\244\\260\\340\\244\\243\\340\\244\\262\\340\\244\\276\\340\\244\\210 & \\340\\244\\233\\340\\245\\213\\340\\244\\241\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"&\\340\\244\\256\\340\\245\\214\\340\\244\\262\\340\\244\\277\\340\\244\\225 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\270\\340\\244\\276\\340\\244\\210\\340\\244\\234 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\257\\340\\245\\213\\340\\244\\227 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"&\\340\\244\\271\\340\\245\\207\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\0\"\\\n  \"&\\340\\244\\240\\340\\244\\277\\340\\244\\225\\0\"\\\n  \"&\\340\\244\\206\\340\\244\\225\\340\\244\\276\\340\\244\\260 \\340\\244\\252\\340\\244\\260\\340\\244\\277\\340\\244\\265\\340\\244\\260\\340\\245\\215\\340\\244\\244\\340\\244\\250\\0\"\\\n  \"(\\340\\244\\225\\340\\245\\201\\340\\244\\262 %d \\340\\244\\256\\340\\244\\247\\340\\245\\215\\340\\244\\257\\340\\245\\207)\\0\"\\\n  \"(\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 %s)\\0\"\\\n  \"SumatraPDF \\340\\244\\254\\340\\244\\276\\340\\244\\260\\340\\245\\207\\340\\244\\256\\340\\244\\276\\0\"\\\n  \"\\340\\244\\256\\340\\244\\250\\340\\244\\252\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\207\\340\\244\\256\\340\\244\\276 \\340\\244\\245\\340\\244\\252\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 %s \\340\\244\\262\\340\\244\\276\\340\\244\\210 \\340\\244\\256\\340\\244\\250\\340\\244\\252\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\207\\340\\244\\256\\340\\244\\276 \\340\\244\\245\\340\\244\\252\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 %s \\340\\244\\262\\340\\244\\276\\340\\244\\210 \\340\\244\\256\\340\\244\\250\\340\\244\\252\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\207\\340\\244\\256\\340\\244\\276 (\\340\\244\\220\\340\\244\\232\\340\\245\\215\\340\\244\\233\\340\\244\\277\\340\\244\\225) \\340\\244\\250\\340\\244\\276\\340\\244\\256 \\340\\244\\270\\340\\244\\271\\340\\244\\277\\340\\244\\244 \\340\\244\\245\\340\\244\\252\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\256\\340\\244\\250\\340\\244\\252\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\207\\340\\244\\256\\340\\244\\276 \\340\\244\\245\\340\\244\\252\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\211\\340\\244\\250\\340\\245\\215\\340\\244\\250\\340\\244\\244\\0\"\\\n  \"\\340\\244\\270\\340\\244\\254\\340\\245\\210 \\340\\244\\253\\340\\244\\276\\340\\244\\207\\340\\244\\262\\340\\244\\271\\340\\244\\260\\340\\245\\201\\0\"\\\n  \"\\340\\244\\270\\340\\244\\254\\340\\245\\210 \\340\\244\\270\\340\\244\\256\\340\\244\\260\\340\\245\\215\\340\\244\\245\\340\\244\\250\\340\\244\\257\\340\\245\\213\\340\\244\\227\\340\\245\\215\\340\\244\\257 \\340\\244\\225\\340\\244\\276\\340\\244\\227\\340\\244\\234\\340\\244\\276\\340\\244\\244\\340\\244\\271\\340\\244\\260\\340\\245\\202\\0\"\\\n  \"\\340\\244\\205\\340\\244\\250\\340\\245\\201\\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\257\\340\\245\\213\\340\\244\\227:\\0\"\\\n  \"PDF \\340\\244\\253\\340\\244\\276\\340\\244\\207\\340\\244\\262\\340\\244\\271\\340\\244\\260\\340\\245\\201 \\340\\244\\270\\340\\244\\201\\340\\244\\227 \\340\\244\\270\\340\\244\\256\\340\\245\\215\\340\\244\\254\\340\\244\\250\\340\\245\\215\\340\\244\\247\\340\\244\\250 \\340\\244\\227\\340\\244\\260\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\207?\\0\"\\\n  \"\\340\\244\\270\\340\\244\\202\\340\\244\\262\\340\\244\\227\\340\\245\\215\\340\\244\\250\\340\\244\\271\\340\\244\\260\\340\\245\\202: %s\\0\"\\\n  \"\\340\\244\\262\\340\\245\\207\\340\\244\\226\\340\\244\\225\\0\"\\\n  \"\\340\\244\\270\\340\\245\\215\\340\\244\\265\\340\\244\\244:\\0\"\\\n  \"&\\340\\244\\205\\340\\244\\246\\340\\245\\215\\340\\244\\257\\340\\244\\276\\340\\244\\265\\340\\244\\247\\340\\244\\277\\340\\244\\225\\340\\244\\271\\340\\244\\260\\340\\245\\201 \\340\\244\\270\\340\\245\\215\\340\\244\\265\\340\\244\\244\\340\\244\\203 \\340\\244\\234\\340\\244\\276\\340\\244\\201\\340\\244\\232\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\252\\340\\245\\201\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\277\\340\\244\\225\\340\\244\\276 \\340\\244\\246\\340\\245\\203\\340\\244\\266\\340\\245\\215\\340\\244\\257\\0\"\\\n  \"\\340\\244\\252\\340\\245\\201\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\225&\\340\\244\\232\\340\\244\\277\\340\\244\\250\\340\\245\\213\\340\\244\\271\\340\\244\\260\\340\\245\\202\\tF12\\0\"\\\n  \"\\340\\244\\252\\340\\245\\201\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\225\\340\\244\\232\\340\\244\\277\\340\\244\\250\\340\\245\\213 \\340\\244\\270\\340\\244\\260\\340\\245\\215\\340\\244\\237\\340\\244\\225\\340\\244\\237\\340\\244\\271\\340\\244\\260\\340\\245\\201\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 %s (\\340\\244\\225\\340\\245\\201\\340\\244\\262 %s \\340\\244\\256\\340\\244\\247\\340\\245\\215\\340\\244\\257\\340\\245\\207) \\340\\244\\225\\340\\245\\213 \\340\\244\\270\\340\\244\\260\\340\\245\\215\\340\\244\\237\\340\\244\\225\\340\\244\\237\\340\\244\\262\\340\\244\\276\\340\\244\\210 \\340\\244\\252\\340\\245\\201\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\225\\340\\244\\232\\340\\244\\277\\340\\244\\250\\340\\245\\213 \\340\\244\\254\\340\\244\\250\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\252\\340\\245\\201\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\225\\340\\244\\232\\340\\244\\277\\340\\244\\250\\340\\245\\213\\0\"\\\n  \"\\340\\244\\254\\340\\244\\276\\340\\244\\210\\340\\244\\237\\0\"\\\n  \"CHM \\340\\244\\225\\340\\244\\276\\340\\244\\227\\340\\244\\234\\340\\244\\276\\340\\244\\244\\340\\244\\271\\340\\244\\260\\340\\245\\201\\0\"\\\n  \"\\340\\244\\207\\340\\244\\250\\340\\245\\215\\340\\244\\237\\340\\244\\260\\340\\244\\250\\340\\245\\207\\340\\244\\237 \\340\\244\\234\\340\\244\\241\\340\\244\\276\\340\\244\\250 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250 \\340\\244\\270\\340\\244\\225\\340\\244\\277\\340\\244\\217\\340\\244\\250 (\\340\\244\\244\\340\\245\\215\\340\\244\\260\\340\\245\\201\\340\\244\\237\\340\\244\\277 %#x).\\0\"\\\n  \"\\340\\244\\260\\340\\244\\246\\340\\245\\215\\340\\244\\246 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\257\\340\\245\\213 \\340\\244\\253\\340\\244\\276\\340\\244\\207\\340\\244\\262 \\340\\244\\233\\340\\244\\276\\340\\244\\252\\340\\245\\215\\340\\244\\250 \\340\\244\\270\\340\\244\\225\\340\\244\\277\\340\\244\\202\\340\\244\\246\\340\\245\\210\\340\\244\\250\\0\"\\\n  \"\\340\\244\\206\\340\\244\\246\\340\\245\\207\\340\\244\\266 \\340\\244\\252\\340\\244\\231\\340\\245\\215\\342\\200\\214\\340\\244\\225\\340\\245\\215\\340\\244\\244\\340\\244\\277 \\340\\244\\211\\340\\244\\262\\340\\245\\215\\340\\244\\237\\340\\245\\213 \\340\\244\\226\\340\\245\\213\\340\\244\\234\\340\\244\\276\\340\\244\\210 \\340\\244\\270\\340\\245\\201\\340\\244\\260\\340\\245\\201 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250 \\340\\244\\270\\340\\244\\225\\340\\244\\277\\340\\244\\217\\340\\244\\250 | \\340\\244\\225\\340\\245\\203\\340\\244\\252\\340\\244\\257\\340\\244\\276 \\340\\244\\270\\340\\245\\207\\340\\244\\237\\340\\244\\277\\340\\244\\231\\340\\244\\256\\340\\244\\276 \\340\\244\\206\\340\\244\\246\\340\\245\\207\\340\\244\\266 \\340\\244\\252\\340\\244\\231\\340\\245\\215\\342\\200\\214\\340\\244\\225\\340\\245\\215\\340\\244\\244\\340\\244\\277 \\340\\244\\271\\340\\245\\207\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270 |\\0\"\\\n  \"\\340\\244\\255\\340\\244\\276\\340\\244\\267\\340\\244\\276 \\340\\244\\252\\340\\244\\260\\340\\244\\277\\340\\244\\265\\340\\244\\260\\340\\245\\215\\340\\244\\244\\340\\244\\250 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215 (Change Language)\\0\"\\\n  \"&\\340\\244\\205\\340\\244\\246\\340\\245\\215\\340\\244\\257\\340\\244\\276\\340\\244\\265\\340\\244\\247\\340\\244\\277\\340\\244\\225\\340\\244\\271\\340\\244\\260\\340\\245\\201 \\340\\244\\234\\340\\244\\276\\340\\244\\201\\340\\244\\232\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\225\\340\\244\\256\\340\\244\\277\\340\\244\\225 \\340\\244\\252\\340\\245\\201\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\277\\340\\244\\225\\340\\244\\276\\0\"\\\n  \"\\340\\244\\256\\340\\244\\277\\340\\244\\262\\340\\245\\215\\340\\244\\246\\340\\245\\213\\340\\244\\234\\340\\245\\201\\340\\244\\262\\340\\245\\215\\340\\244\\246\\340\\245\\213\\0\"\\\n  \"\\340\\244\\250\\340\\244\\277\\340\\244\\260\\340\\244\\250\\340\\245\\215\\340\\244\\244\\340\\244\\260\\0\"\\\n  \"\\340\\244\\250\\340\\244\\277\\340\\244\\260\\340\\244\\250\\340\\245\\215\\340\\244\\244\\340\\244\\260 \\340\\244\\252\\340\\245\\201\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\277\\340\\244\\225\\340\\244\\276 \\340\\244\\246\\340\\245\\203\\340\\244\\266\\340\\245\\215\\340\\244\\257\\0\"\\\n  \"\\340\\244\\250\\340\\244\\277\\340\\244\\260\\340\\244\\250\\340\\245\\215\\340\\244\\244\\340\\244\\260 \\340\\244\\270\\340\\244\\256\\340\\245\\215\\340\\244\\256\\340\\245\\201\\340\\244\\226 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\0\"\\\n  \"\\340\\244\\205\\340\\244\\250\\340\\245\\201\\340\\244\\265\\340\\244\\276\\340\\244\\246\\340\\244\\256\\340\\244\\276 \\340\\244\\257\\340\\245\\213\\340\\244\\227\\340\\244\\246\\340\\244\\276\\340\\244\\250 \\340\\244\\246\\340\\244\\277\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"&\\340\\244\\233\\340\\244\\265\\340\\244\\277 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\244\\340\\244\\277\\340\\244\\262\\340\\244\\277\\340\\244\\252\\340\\244\\277 \\340\\244\\254\\340\\244\\250\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"&\\340\\244\\262\\340\\244\\277\\340\\244\\231\\340\\245\\215\\340\\244\\225 \\340\\244\\240\\340\\245\\207\\340\\244\\227\\340\\244\\276\\340\\244\\250\\340\\244\\276\\340\\244\\225\\340\\245\\213 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\244\\340\\244\\277\\340\\244\\262\\340\\244\\277\\340\\244\\252\\340\\244\\277 \\340\\244\\254\\340\\244\\250\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"&\\340\\244\\237\\340\\244\\277\\340\\244\\252\\340\\245\\215\\340\\244\\252\\340\\244\\243\\340\\245\\200\\340\\244\\225\\340\\245\\213 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\244\\340\\244\\277\\340\\244\\262\\340\\244\\277\\340\\244\\252\\340\\244\\277 \\340\\244\\254\\340\\244\\250\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\252\\340\\244\\276\\340\\244\\240 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\244\\340\\244\\277\\340\\244\\262\\340\\244\\277\\340\\244\\252\\340\\244\\277 \\340\\244\\205\\340\\244\\270\\340\\245\\215\\340\\244\\265\\340\\245\\200\\340\\244\\225\\340\\244\\276\\340\\244\\260 \\340\\244\\255\\340\\244\\257\\340\\245\\213 (\\340\\244\\233\\340\\244\\265\\340\\244\\277\\340\\244\\225\\340\\245\\213 \\340\\244\\260\\340\\245\\201\\340\\244\\252\\340\\244\\256\\340\\244\\276 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\244\\340\\244\\277\\340\\244\\262\\340\\244\\277\\340\\244\\252\\340\\244\\277 \\340\\244\\254\\340\\244\\250\\340\\244\\276\\340\\244\\210\\340\\244\\246\\340\\245\\210\\340\\244\\233)\\0\"\\\n  \"\\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\244\\340\\244\\277\\340\\244\\262\\340\\244\\277\\340\\244\\252\\340\\244\\277\\340\\244\\205\\340\\244\\247\\340\\244\\277\\340\\244\\225\\340\\244\\276\\340\\244\\260:\\0\"\\\n  \"\\340\\244\\256\\340\\245\\201\\340\\244\\246\\340\\245\\215\\340\\244\\260\\340\\244\\225 \\340\\244\\227\\340\\245\\201\\340\\244\\243\\340\\244\\271\\340\\244\\260\\340\\245\\201 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\276\\340\\244\\252\\340\\245\\215\\340\\244\\244 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250 \\340\\244\\270\\340\\244\\225\\340\\244\\277\\340\\244\\217\\340\\244\\250\\0\"\\\n  \"\\340\\244\\256\\340\\245\\201\\340\\244\\246\\340\\245\\215\\340\\244\\260\\340\\244\\225\\340\\244\\262\\340\\244\\276\\340\\244\\210 \\340\\244\\206\\340\\244\\260\\340\\244\\256\\340\\245\\215\\340\\244\\255 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250 \\340\\244\\270\\340\\244\\225\\340\\244\\277\\340\\244\\217\\340\\244\\250\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\260\\340\\245\\207\\340\\244\\250\\340\\245\\215\\340\\244\\241\\340\\244\\260 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250 \\340\\244\\270\\340\\244\\225\\340\\244\\277\\340\\244\\217\\340\\244\\250\\0\"\\\n  \"\\340\\244\\270\\340\\244\\277\\340\\244\\260\\340\\245\\215\\340\\244\\234\\340\\244\\250\\340\\244\\276 \\340\\244\\227\\340\\244\\260\\340\\244\\277\\340\\244\\217\\340\\244\\225\\340\\245\\213:\\0\"\\\n  \"\\340\\244\\271\\340\\244\\276\\340\\244\\262\\340\\244\\225\\340\\245\\213 \\340\\244\\253\\340\\244\\276\\340\\244\\207\\340\\244\\262\\0\"\\\n  \"\\0\"\\\n  \"\\340\\244\\205\\340\\244\\250\\340\\245\\201\\340\\244\\225\\340\\245\\201\\340\\244\\262 &\\340\\244\\206\\340\\244\\225\\340\\244\\276\\340\\244\\260 ...\\tCtrl+Y\\0\"\\\n  \"\\340\\244\\252\\340\\245\\202\\340\\244\\260\\340\\245\\215\\340\\244\\265\\340\\244\\250\\340\\244\\277\\340\\244\\260\\340\\245\\215\\340\\244\\247\\340\\244\\276\\340\\244\\260\\340\\244\\277\\340\\244\\244 \\340\\244\\270&\\340\\244\\234\\340\\244\\276\\340\\244\\265\\340\\244\\237:\\0\"\\\n  \"\\340\\244\\252\\340\\245\\202\\340\\244\\260\\340\\245\\215\\340\\244\\265\\340\\244\\250\\340\\244\\277\\340\\244\\260\\340\\245\\215\\340\\244\\247\\340\\244\\276\\340\\244\\260\\340\\244\\277\\340\\244\\244 &\\340\\244\\206\\340\\244\\225\\340\\244\\276\\340\\244\\260:\\0\"\\\n  \"\\340\\244\\232\\340\\244\\262\\340\\244\\276\\340\\244\\257\\340\\244\\256\\340\\244\\276\\340\\244\\250 \\340\\244\\256\\340\\245\\213\\340\\244\\241\\340\\244\\256\\340\\244\\276 \\340\\244\\252\\340\\245\\202\\340\\244\\260\\340\\245\\215\\340\\244\\265\\340\\244\\250\\340\\244\\277\\340\\244\\260\\340\\245\\215\\340\\244\\247\\340\\244\\276\\340\\244\\260\\340\\244\\277\\340\\244\\244 PDF \\340\\244\\252\\340\\244\\276\\340\\244\\240\\340\\244\\225 \\340\\244\\252\\340\\244\\260\\340\\244\\277\\340\\244\\265\\340\\244\\260\\340\\245\\215\\340\\244\\244\\340\\244\\250 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250 \\340\\244\\256\\340\\244\\277\\340\\244\\262\\340\\245\\215\\340\\244\\246\\340\\245\\210\\340\\244\\250\\0\"\\\n  \"\\340\\244\\205\\340\\244\\270\\340\\245\\215\\340\\244\\265\\340\\245\\200\\340\\244\\225\\340\\245\\203\\340\\244\\244 \\340\\244\\205\\340\\244\\250\\340\\245\\201\\340\\244\\256\\340\\244\\244\\340\\244\\277\\340\\244\\271\\340\\244\\260\\340\\245\\201:\\0\"\\\n  \"DjVu \\340\\244\\225\\340\\244\\276\\340\\244\\227\\340\\244\\234\\340\\244\\276\\340\\244\\244\\340\\244\\271\\340\\244\\260\\340\\245\\201\\0\"\\\n  \"\\340\\244\\225\\340\\244\\276\\340\\244\\227\\340\\244\\234\\340\\244\\276\\340\\244\\244 \\340\\244\\227\\340\\245\\201\\340\\244\\243\\340\\244\\271\\340\\244\\260\\340\\245\\202\\0\"\\\n  \"\\340\\244\\241\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\244\\262\\340\\245\\213\\340\\244\\241\\0\"\\\n  \"\\340\\244\\254\\340\\244\\276\\340\\244\\271\\340\\244\\277\\340\\244\\260 &\\340\\244\\234\\340\\244\\276\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\tCtrl+Q\\0\"\\\n  \"EPUB \\340\\244\\210-\\340\\244\\252\\340\\245\\201\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\225\\340\\244\\271\\340\\244\\260\\340\\245\\201\\0\"\\\n  \"\\340\\244\\252\\340\\244\\276\\340\\244\\270\\340\\244\\265\\340\\244\\260\\340\\245\\215\\340\\244\\241 \\340\\244\\255\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"%s \\340\\244\\225\\340\\245\\213 \\340\\244\\252\\340\\244\\276\\340\\244\\270\\340\\244\\265\\340\\244\\260\\340\\245\\215\\340\\244\\241 \\340\\244\\255\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"PDF \\340\\244\\225\\340\\244\\276\\340\\244\\227\\340\\244\\234\\340\\244\\276\\340\\244\\244\\340\\244\\256\\340\\244\\276 \\340\\244\\246\\340\\245\\213\\340\\244\\271\\340\\245\\213\\340\\244\\260\\340\\245\\213 \\340\\244\\225\\340\\245\\215\\340\\244\\262\\340\\244\\277\\340\\244\\225 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\246\\340\\244\\276 \\340\\244\\206\\340\\244\\271\\340\\245\\215\\340\\244\\265\\340\\244\\276\\340\\244\\250 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\207 \\340\\244\\206\\340\\244\\246\\340\\245\\207\\340\\244\\266 \\340\\244\\252\\340\\244\\231\\340\\245\\215\\342\\200\\214\\340\\244\\225\\340\\245\\215\\340\\244\\244\\340\\244\\277 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\265\\340\\244\\277\\340\\244\\267\\340\\245\\215\\340\\244\\237 \\340\\244\\227\\340\\244\\260\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215:\\0\"\\\n  \"%s \\340\\244\\262\\340\\245\\213\\340\\244\\241 \\340\\244\\244\\340\\245\\215\\340\\244\\260\\340\\245\\201\\340\\244\\237\\340\\244\\277\\0\"\\\n  \"&\\340\\244\\256\\340\\244\\250\\340\\244\\252\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\207\\0\"\\\n  \"\\340\\244\\205&\\340\\244\\227\\340\\244\\276\\340\\244\\241\\340\\244\\277\\tAlt+\\340\\244\\246\\340\\244\\276\\340\\244\\257\\340\\244\\276\\340\\244\\201 \\340\\244\\254\\340\\244\\276\\340\\244\\243\\0\"\\\n  \"\\340\\244\\252\\340\\245\\202&\\340\\244\\260\\340\\245\\215\\340\\244\\243\\340\\244\\270\\340\\245\\215\\340\\244\\225\\340\\245\\215\\340\\244\\260\\340\\244\\277\\340\\244\\250\\tCtrl+Shift+L\\0\"\\\n  \"\\340\\244\\270\\340\\244\\256\\340\\245\\215\\340\\244\\256\\340\\245\\201\\340\\244\\226\\0\"\\\n  \"\\340\\244\\250\\340\\244\\276\\340\\244\\256 \\340\\244\\253\\340\\245\\207\\340\\244\\260\\340\\244\\276\\340\\244\\210 \\340\\244\\205\\340\\244\\270\\340\\244\\253\\340\\244\\262\\0\"\\\n  \"\\340\\244\\253\\340\\244\\276\\340\\244\\207\\340\\244\\262 \\340\\244\\254\\340\\244\\232\\340\\244\\244 \\340\\244\\205\\340\\244\\270\\340\\244\\253\\340\\244\\262\\0\"\\\n  \"\\340\\244\\246\\340\\245\\215\\340\\244\\260\\340\\245\\201\\340\\244\\244 \\340\\244\\265\\340\\245\\207\\340\\244\\254 \\340\\244\\246\\340\\245\\203\\340\\244\\266\\340\\245\\215\\340\\244\\257\\0\"\\\n  \"\\340\\244\\256\\340\\244\\250\\340\\244\\252\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\207\\340\\244\\271\\340\\244\\260\\340\\245\\201\\0\"\\\n  \"\\0\"\\\n  \"\\340\\244\\253\\340\\244\\276\\340\\244\\207\\340\\244\\262 %s \\340\\244\\255\\340\\245\\207\\340\\244\\237\\340\\244\\277\\340\\244\\217\\340\\244\\250\\0\"\\\n  \"\\340\\244\\253\\340\\244\\276\\340\\244\\207\\340\\244\\262 \\340\\244\\270\\340\\244\\276\\340\\244\\207\\340\\244\\234\\0\"\\\n  \"\\340\\244\\253\\340\\244\\276\\340\\244\\207\\340\\244\\262:\\0\"\\\n  \"&\\340\\244\\253\\340\\245\\207\\340\\244\\262\\340\\244\\276 \\340\\244\\252\\340\\244\\276\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215 ...\\tCtrl+F\\0\"\\\n  \"\\340\\244\\226\\340\\245\\213\\340\\244\\234\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\205\\340\\244\\260\\340\\245\\215\\340\\244\\225\\340\\245\\213 \\340\\244\\226\\340\\245\\213\\340\\244\\234\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\205\\340\\244\\230\\340\\244\\277\\340\\244\\262\\340\\245\\215\\340\\244\\262\\340\\245\\213 \\340\\244\\226\\340\\245\\213\\340\\244\\234\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\226\\340\\245\\213\\340\\244\\234\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215:\\0\"\\\n  \"&\\340\\244\\270\\340\\244\\276\\340\\244\\256\\340\\244\\227\\340\\245\\215\\340\\244\\260\\340\\245\\200 \\340\\244\\205\\340\\244\\237\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\tCtrl+3\\0\"\\\n  \"&\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\205\\340\\244\\237\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\tCtrl+0\\0\"\\\n  \"&\\340\\244\\232\\340\\245\\214\\340\\244\\241\\340\\244\\276\\340\\244\\207 \\340\\244\\205\\340\\244\\237\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\tCtrl+2\\0\"\\\n  \"\\340\\244\\270\\340\\244\\276\\340\\244\\256\\340\\244\\227\\340\\245\\215\\340\\244\\260\\340\\245\\200 \\340\\244\\205\\340\\244\\237\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\205\\340\\244\\237\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\232\\340\\245\\214\\340\\244\\241\\340\\244\\276\\340\\244\\207 \\340\\244\\205\\340\\244\\237\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\232\\340\\245\\214\\340\\244\\241\\340\\244\\276\\340\\244\\210 \\340\\244\\205\\340\\244\\237\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215 \\340\\244\\260 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\340\\244\\271\\340\\244\\260\\340\\245\\201 \\340\\244\\250\\340\\244\\277\\340\\244\\260\\340\\244\\250\\340\\245\\215\\340\\244\\244\\340\\244\\260 \\340\\244\\246\\340\\245\\207\\340\\244\\226\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\217\\340\\244\\225\\340\\244\\262 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\205\\340\\244\\237\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\253\\340\\244\\250\\340\\245\\215\\340\\244\\237\\340\\244\\271\\340\\244\\260\\340\\245\\202:\\0\"\\\n  \"\\340\\244\\252\\340\\245\\201\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\225 \\340\\244\\270\\340\\245\\215\\340\\244\\265\\340\\244\\260\\340\\245\\202\\340\\244\\252\\340\\244\\243 ... %d \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\340\\244\\271\\340\\244\\260\\340\\245\\201\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 %s \\340\\244\\256\\340\\244\\276 \\340\\244\\252\\340\\244\\276\\340\\244\\240 \\340\\244\\255\\340\\245\\207\\340\\244\\237\\340\\244\\277\\340\\244\\257\\340\\245\\213\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 %s \\340\\244\\256\\340\\244\\276 \\340\\244\\252\\340\\244\\276\\340\\244\\240 \\340\\244\\255\\340\\245\\207\\340\\244\\237\\340\\244\\277\\340\\244\\257\\340\\245\\213 (\\340\\244\\252\\340\\245\\201\\340\\244\\250\\340\\244\\203)\\0\"\\\n  \"\\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\276\\340\\244\\257\\340\\244\\234\\340\\244\\270\\340\\245\\213 \\340\\244\\252\\340\\244\\242\\340\\244\\277\\340\\244\\217\\340\\244\\225\\340\\245\\213\\0\"\\\n  \"\\340\\244\\234\\340\\244\\277\\340\\244\\254\\340\\245\\200\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\340\\244\\256\\340\\244\\276 \\340\\244\\234\\340\\244\\276\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\276\\340\\244\\257\\340\\244\\234\\340\\244\\270\\340\\245\\213 \\340\\244\\252\\340\\244\\242\\340\\244\\277\\340\\244\\217\\340\\244\\225\\340\\245\\213 \\340\\244\\262\\340\\245\\201\\340\\244\\225\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\270\\340\\244\\231\\340\\245\\215\\340\\244\\225\\340\\245\\207\\340\\244\\244: \\340\\244\\252\\340\\245\\201\\340\\244\\250\\340\\244\\203 \\340\\244\\253\\340\\245\\207\\340\\244\\262\\340\\244\\276\\340\\244\\252\\340\\244\\276\\340\\244\\260\\340\\245\\215\\340\\244\\250 F3 \\340\\244\\225\\340\\245\\201\\340\\244\\236\\340\\245\\215\\340\\244\\234\\340\\245\\200 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\257\\340\\245\\213\\340\\244\\227 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\233\\340\\244\\265\\340\\244\\277 \\340\\244\\253\\340\\244\\276\\340\\244\\207\\340\\244\\262 (*.%s)\\0\"\\\n  \"\\340\\244\\225\\340\\245\\207\\340\\244\\254\\340\\245\\200\\0\"\\\n  \"\\340\\244\\217\\340\\244\\256\\340\\244\\254\\340\\245\\200\\0\"\\\n  \"SumatraPDF \\340\\244\\262\\340\\244\\276\\340\\244\\210 PDF \\340\\244\\253\\340\\244\\276\\340\\244\\207\\340\\244\\262\\340\\244\\225\\340\\245\\213 \\340\\244\\252\\340\\245\\202\\340\\244\\260\\340\\245\\215\\340\\244\\265\\340\\244\\250\\340\\244\\277\\340\\244\\260\\340\\245\\215\\340\\244\\247\\340\\244\\276\\340\\244\\260\\340\\244\\277\\340\\244\\244 \\340\\244\\205\\340\\244\\250\\340\\245\\201\\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\257\\340\\245\\213\\340\\244\\227 \\340\\244\\254\\340\\244\\250\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\207?\\0\"\\\n  \"SumatraPDF \\340\\244\\262\\340\\244\\276\\340\\244\\210 PDF \\340\\244\\253\\340\\244\\276\\340\\244\\207\\340\\244\\262\\340\\244\\225\\340\\245\\213 \\340\\244\\252\\340\\245\\202\\340\\244\\260\\340\\245\\215\\340\\244\\265\\340\\244\\250\\340\\244\\277\\340\\244\\260\\340\\245\\215\\340\\244\\247\\340\\244\\276\\340\\244\\260\\340\\244\\277\\340\\244\\244 \\340\\244\\205\\340\\244\\250\\340\\245\\201\\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\257\\340\\245\\213\\340\\244\\227 \\340\\244\\254\\340\\244\\250\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\0\"\\\n  \"\\340\\244\\225\\340\\245\\207\\340\\244\\270 \\340\\244\\256\\340\\244\\277\\340\\244\\262\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"Mobi \\340\\244\\225\\340\\244\\276\\340\\244\\227\\340\\244\\234\\340\\244\\276\\340\\244\\244\\340\\244\\271\\340\\244\\260\\340\\245\\201\\0\"\\\n  \"\\340\\244\\252\\340\\244\\260\\340\\244\\277\\340\\244\\256\\340\\244\\276\\340\\244\\260\\340\\245\\215\\340\\244\\234\\340\\244\\277\\340\\244\\244:\\0\"\\\n  \"\\340\\244\\250\\340\\244\\257\\340\\244\\276 \\340\\244\\270\\340\\244\\202\\340\\244\\270\\340\\245\\215\\340\\244\\225\\340\\244\\260\\340\\244\\243 %s \\340\\244\\211\\340\\244\\252\\340\\244\\262\\340\\244\\254\\340\\245\\215\\340\\244\\247 \\340\\244\\233 | \\340\\244\\241\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\244\\262\\340\\245\\213\\340\\244\\241 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\207?\\0\"\\\n  \"\\340\\244\\205\\340\\244\\260\\340\\245\\215\\340\\244\\225\\340\\245\\213 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\0\"\\\n  \"\\340\\244\\234\\340\\245\\213\\340\\244\\241\\340\\244\\276\\340\\244\\271\\340\\244\\260\\340\\245\\201 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\276\\340\\244\\252\\340\\245\\215\\340\\244\\244 \\340\\244\\255\\340\\244\\217\\340\\244\\250\\0\"\\\n  \"\\340\\244\\252\\340\\244\\231\\340\\245\\215\\340\\244\\225\\340\\245\\215\\340\\244\\244\\340\\244\\277 %u (\\340\\244\\253\\340\\244\\276\\340\\244\\207\\340\\244\\262 %s \\340\\244\\225\\340\\245\\213) \\340\\244\\265\\340\\244\\260\\340\\244\\252\\340\\244\\260 \\340\\244\\225\\340\\245\\201\\340\\244\\250\\340\\245\\210 \\340\\244\\250\\340\\244\\244\\340\\244\\277\\340\\244\\234\\340\\244\\276 \\340\\244\\253\\340\\245\\207\\340\\244\\262\\340\\244\\276 \\340\\244\\252\\340\\244\\260\\340\\245\\207\\340\\244\\250\\0\"\\\n  \"\\340\\244\\225\\340\\245\\201\\340\\244\\250\\340\\245\\210 \\340\\244\\270\\340\\244\\256\\340\\244\\225\\340\\245\\215\\340\\244\\260\\340\\244\\256\\340\\244\\243 \\340\\244\\253\\340\\244\\276\\340\\244\\207\\340\\244\\262 \\340\\244\\255\\340\\245\\207\\340\\244\\237\\340\\244\\277\\340\\244\\217\\340\\244\\250\\340\\245\\215\\0\"\\\n  \"\\340\\244\\257\\340\\245\\213 \\340\\244\\270\\340\\245\\215\\340\\244\\245\\340\\244\\276\\340\\244\\250\\340\\244\\256\\340\\244\\276 \\340\\244\\270\\340\\244\\256\\340\\244\\225\\340\\245\\215\\340\\244\\260\\340\\244\\256\\340\\244\\243 \\340\\244\\234\\340\\244\\276\\340\\244\\250\\340\\244\\225\\340\\244\\276\\340\\244\\260\\340\\245\\200 \\340\\244\\233\\340\\245\\210\\340\\244\\250\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\270\\340\\244\\202\\340\\244\\226\\340\\245\\215\\340\\244\\257\\340\\244\\276:\\0\"\\\n  \"\\340\\244\\271\\340\\245\\201\\340\\244\\250\\340\\245\\215\\340\\244\\233\\0\"\\\n  \"\\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"PDF-XChange \\340\\244\\256\\340\\244\\276 &\\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\225\\340\\244\\276\\340\\244\\227\\340\\244\\234\\340\\244\\276\\340\\244\\244 \\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"%s \\340\\244\\256\\340\\244\\276 \\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"Adobe Reader \\340\\244\\256\\340\\244\\276 &\\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"Foxit Reader \\340\\244\\256\\340\\244\\276 &\\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"Microsoft HTML Help \\340\\244\\256\\340\\244\\276 &\\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"Microsoft XPS-Viewer \\340\\244\\256\\340\\244\\276 &\\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"&\\340\\244\\227\\340\\245\\201\\340\\244\\243\\340\\244\\271\\340\\244\\260\\340\\245\\201\\0\"\\\n  \"&\\340\\244\\227\\340\\245\\201\\340\\244\\243\\340\\244\\271\\340\\244\\260\\340\\245\\201\\tCtrl+D\\0\"\\\n  \"PDF \\340\\244\\225\\340\\244\\276\\340\\244\\227\\340\\244\\234\\340\\244\\276\\340\\244\\244\\0\"\\\n  \"PDF \\340\\244\\205\\340\\244\\252\\340\\245\\215\\340\\244\\237\\340\\244\\277\\340\\244\\256\\340\\244\\276\\340\\244\\207\\340\\244\\234\\340\\245\\207\\340\\244\\270\\340\\244\\250\\0\"\\\n  \"PDF \\340\\244\\250\\340\\244\\277\\340\\244\\260\\340\\245\\215\\340\\244\\256\\340\\244\\276\\340\\244\\244\\340\\244\\276\\0\"\\\n  \"PDF \\340\\244\\270\\340\\244\\202\\340\\244\\270\\340\\245\\215\\340\\244\\225\\340\\244\\260\\340\\244\\243\\0\"\\\n  \"PDF \\340\\244\\225\\340\\244\\276\\340\\244\\227\\340\\244\\234\\340\\244\\276\\340\\244\\244\\0\"\\\n  \"&\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 ...\\tCtrl+G\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 %s\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\270\\340\\244\\276\\340\\244\\207\\340\\244\\234:\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\237 \\340\\244\\270\\340\\244\\202\\340\\244\\226\\340\\245\\215\\340\\244\\257\\340\\244\\276 %u \\340\\244\\205\\340\\244\\265\\340\\244\\270\\340\\245\\215\\340\\244\\245\\340\\244\\277\\340\\244\\244 \\340\\244\\233\\340\\245\\210\\340\\244\\250\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 \\340\\244\\256\\340\\244\\276\\340\\244\\252\\340\\244\\250\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240:\\0\"\\\n  \"\\0\"\\\n  \"\\340\\244\\225\\340\\245\\203\\340\\244\\252\\340\\244\\257\\340\\244\\276 \\340\\244\\252\\340\\244\\260\\340\\245\\215\\340\\244\\226\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270 - \\340\\244\\260\\340\\245\\207\\340\\244\\250\\340\\245\\215\\340\\244\\241\\340\\244\\260\\340\\244\\277\\340\\244\\231 \\340\\244\\271\\340\\245\\201\\340\\244\\246\\340\\245\\210\\340\\244\\233 ...\\0\"\\\n  \"\\340\\244\\252\\340\\245\\213\\340\\244\\270\\340\\245\\215\\340\\244\\237 \\340\\244\\270\\340\\245\\215\\340\\244\\225\\340\\245\\215\\340\\244\\260\\340\\244\\277\\340\\244\\252\\340\\245\\215\\340\\244\\237 \\340\\244\\225\\340\\244\\276\\340\\244\\227\\340\\244\\234\\340\\244\\276\\340\\244\\244\\340\\244\\271\\340\\244\\260\\340\\245\\201\\0\"\\\n  \"\\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\245\\201\\340\\244\\244\\340\\245\\200&\\340\\244\\225\\340\\244\\260\\340\\244\\243\\tCtrl+L\\0\"\\\n  \"\\340\\244\\205\\340\\244\\230\\340\\244\\277\\340\\244\\262\\340\\245\\215\\340\\244\\262\\340\\245\\213 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\0\"\\\n  \"\\340\\244\\233\\340\\244\\276\\340\\244\\252\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\233\\340\\244\\252\\340\\244\\276\\340\\244\\210 \\340\\244\\246\\340\\244\\276\\340\\244\\257\\340\\244\\260\\340\\244\\276\\0\"\\\n  \"\\340\\244\\246\\340\\244\\277\\340\\244\\210\\340\\244\\217\\340\\244\\225\\340\\245\\213 \\340\\244\\250\\340\\244\\276\\340\\244\\256 \\340\\244\\255\\340\\244\\217\\340\\244\\225\\340\\245\\213 \\340\\244\\256\\340\\245\\201\\340\\244\\246\\340\\245\\215\\340\\244\\260\\340\\244\\225 \\340\\244\\205\\340\\244\\265\\340\\244\\270\\340\\245\\215\\340\\244\\245\\340\\244\\277\\340\\244\\244 \\340\\244\\233\\340\\245\\210\\340\\244\\250\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"\\340\\244\\233\\340\\244\\252\\340\\244\\276\\340\\244\\210 \\340\\244\\225\\340\\244\\276\\340\\244\\260\\340\\245\\215\\340\\244\\257 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\227\\340\\244\\244\\340\\244\\277 \\340\\244\\271\\340\\245\\201\\340\\244\\246\\340\\245\\210\\340\\244\\233 | \\340\\244\\252\\340\\244\\260\\340\\244\\277\\340\\244\\244\\340\\245\\215\\340\\244\\257\\340\\244\\276\\340\\244\\227 \\340\\244\\227\\340\\244\\260\\340\\244\\277 \\340\\244\\252\\340\\245\\201\\340\\244\\250\\340\\244\\203 \\340\\244\\270\\340\\245\\201\\340\\244\\260\\340\\245\\201 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\207?\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 %d (\\340\\244\\225\\340\\245\\201\\340\\244\\262 %d \\340\\244\\256\\340\\244\\247\\340\\245\\215\\340\\244\\257\\340\\245\\207) \\340\\244\\225\\340\\245\\213 \\340\\244\\233\\340\\244\\252\\340\\244\\276\\340\\244\\210 \\340\\244\\271\\340\\245\\201\\340\\244\\246\\340\\245\\210\\340\\244\\233 ...\\0\"\\\n  \"\\340\\244\\233\\340\\244\\252\\340\\244\\276\\340\\244\\207 \\340\\244\\270\\340\\244\\256\\340\\244\\270\\340\\245\\215\\340\\244\\257\\340\\244\\276.\\0\"\\\n  \"\\340\\244\\250\\340\\244\\276\\340\\244\\256 &\\340\\244\\253\\340\\245\\207\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215...\\tF2\\0\"\\\n  \"&\\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\244\\277\\340\\244\\217\\340\\244\\225\\340\\244\\276 \\340\\244\\253\\340\\244\\276\\340\\244\\207\\340\\244\\262\\340\\244\\271\\340\\244\\260\\340\\245\\201 \\340\\244\\270\\340\\244\\256\\340\\245\\215\\340\\244\\235\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\256\\340\\244\\250\\340\\244\\252\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\207 \\340\\244\\254\\340\\244\\276\\340\\244\\237 \\340\\244\\271\\340\\244\\237\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\256\\340\\244\\250\\340\\244\\252\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\207 \\340\\244\\254\\340\\244\\276\\340\\244\\237 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240 %s \\340\\244\\262\\340\\244\\276\\340\\244\\210 \\340\\244\\271\\340\\244\\237\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\250\\340\\244\\276\\340\\244\\256 \\340\\244\\253\\340\\245\\207\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"&\\340\\244\\254\\340\\244\\276\\340\\244\\257\\340\\244\\276\\340\\244\\201 \\340\\244\\230\\340\\245\\201\\340\\244\\256\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\tCtrl+Shift+-\\0\"\\\n  \"&\\340\\244\\246\\340\\244\\276\\340\\244\\257\\340\\244\\276\\340\\244\\201 \\340\\244\\230\\340\\245\\201\\340\\244\\256\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\tCtrl+Shift++\\0\"\\\n  \"\\340\\244\\254\\340\\244\\232\\340\\244\\244 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"&\\340\\244\\270\\340\\244\\260\\340\\245\\215\\340\\244\\237\\340\\244\\225\\340\\244\\237 \\340\\244\\254\\340\\244\\232\\340\\244\\244 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215...\\tCtrl+Shift+S\\0\"\\\n  \"%d (\\340\\244\\225\\340\\245\\201\\340\\244\\262 %d \\340\\244\\256\\340\\244\\247\\340\\245\\215\\340\\244\\257\\340\\245\\207) \\340\\244\\256\\340\\244\\276 \\340\\244\\226\\340\\245\\213\\340\\244\\234\\340\\244\\277 \\340\\244\\271\\340\\245\\201\\340\\244\\246\\340\\245\\210\\340\\244\\233...\\0\"\\\n  \"\\340\\244\\270\\340\\244\\254\\340\\245\\210 &\\340\\244\\232\\340\\244\\257\\340\\244\\250 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\270\\340\\244\\254\\340\\245\\210 &\\340\\244\\232\\340\\244\\257\\340\\244\\250 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\tCtrl+A\\0\"\\\n  \"Ctrl+\\340\\244\\254\\340\\244\\276\\340\\244\\257\\340\\244\\276\\340\\244\\201 \\340\\244\\256\\340\\244\\276\\340\\244\\211\\340\\244\\270\\340\\244\\254\\340\\244\\237\\340\\244\\250\\340\\244\\262\\340\\245\\207 \\340\\244\\270\\340\\244\\276\\340\\244\\256\\340\\244\\276\\340\\244\\227\\340\\245\\215\\340\\244\\260\\340\\245\\200 \\340\\244\\232\\340\\244\\257\\340\\244\\250 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\0\"\\\n  \"&\\340\\244\\210-\\340\\244\\256\\340\\245\\207\\340\\244\\262 \\340\\244\\246\\340\\245\\215\\340\\244\\265\\340\\244\\276\\340\\244\\260\\340\\244\\276 \\340\\244\\252\\340\\244\\240\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215...\\0\"\\\n  \"\\340\\244\\206\\340\\244\\246\\340\\245\\207\\340\\244\\266 \\340\\244\\252\\340\\244\\231\\340\\245\\215\\342\\200\\214\\340\\244\\225\\340\\245\\215\\340\\244\\244\\340\\244\\277 \\340\\244\\211\\340\\244\\262\\340\\245\\215\\340\\244\\237\\340\\245\\213 \\340\\244\\226\\340\\245\\213\\340\\244\\234\\340\\244\\276\\340\\244\\210 \\340\\244\\270\\340\\245\\207\\340\\244\\237 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"&\\340\\244\\252\\340\\245\\201\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\225\\340\\244\\232\\340\\244\\277\\340\\244\\250\\340\\245\\213\\340\\244\\271\\340\\244\\260\\340\\245\\202 \\340\\244\\246\\340\\245\\207\\340\\244\\226\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\340\\244\\271\\340\\244\\260\\340\\245\\201 &\\340\\244\\250\\340\\244\\277\\340\\244\\260\\340\\244\\250\\340\\245\\215\\340\\244\\244\\340\\244\\260 \\340\\244\\246\\340\\245\\207\\340\\244\\226\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"&\\340\\244\\211\\340\\244\\252\\340\\244\\225\\340\\244\\260\\340\\244\\243\\340\\244\\252\\340\\244\\237\\340\\245\\215\\340\\244\\237\\340\\245\\200 \\340\\244\\246\\340\\245\\207\\340\\244\\226\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\256\\340\\244\\250\\340\\244\\252\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\207\\340\\244\\271\\340\\244\\260\\340\\245\\201 \\340\\244\\246\\340\\245\\207\\340\\244\\226\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\276\\340\\244\\257\\340\\244\\234\\340\\244\\270\\340\\245\\213 \\340\\244\\252\\340\\244\\242\\340\\244\\277\\340\\244\\217\\340\\244\\225\\340\\245\\213 \\340\\244\\246\\340\\245\\207\\340\\244\\226\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\211\\340\\244\\252\\340\\244\\262\\340\\244\\254\\340\\245\\215\\340\\244\\247 \\340\\244\\255\\340\\244\\217\\340\\244\\256\\340\\244\\276 &\\340\\244\\252\\340\\245\\201\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\244\\225\\340\\244\\232\\340\\244\\277\\340\\244\\250\\340\\245\\213 \\340\\244\\233\\340\\245\\207\\340\\244\\211\\340\\244\\252\\340\\244\\237\\340\\245\\215\\342\\200\\215\\340\\244\\237\\340\\244\\277 \\340\\244\\246\\340\\245\\207\\340\\244\\226\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\217\\340\\244\\225\\340\\244\\262 \\340\\244\\252\\340\\245\\203\\340\\244\\267\\340\\245\\215\\340\\244\\240\\0\"\\\n  \"\\340\\244\\256\\340\\244\\276\\340\\244\\253 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\262\\340\\244\\276, \\340\\244\\257\\340\\244\\270\\340\\245\\215\\340\\244\\244\\340\\245\\213 \\340\\244\\271\\340\\245\\201\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\201\\340\\244\\246\\340\\245\\210\\340\\244\\250\\340\\244\\245\\340\\245\\215\\340\\244\\257\\340\\245\\213\\n\\n\\340\\244\\257\\340\\244\\246\\340\\244\\277 \\340\\244\\244\\340\\244\\252\\340\\244\\276\\340\\244\\210 \\340\\244\\257\\340\\245\\213 \\340\\244\\225\\340\\245\\215\\340\\244\\260\\340\\245\\215\\340\\244\\257\\340\\244\\276\\340\\244\\270 \\340\\244\\240\\340\\244\\277\\340\\244\\225 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250 \\340\\244\\270\\340\\244\\271\\340\\244\\257\\340\\245\\213\\340\\244\\227 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250 \\340\\244\\232\\340\\244\\276\\340\\244\\271\\340\\244\\276\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\201\\340\\244\\250\\340\\245\\215\\340\\244\\233 \\340\\244\\255\\340\\244\\250\\340\\245\\207 \\340\\244\\225\\340\\245\\203\\340\\244\\252\\340\\244\\257\\340\\244\\276 '\\340\\244\\260\\340\\244\\246\\340\\245\\215\\340\\244\\246 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\270\\340\\245\\215' \\340\\244\\256\\340\\244\\276 \\340\\244\\245\\340\\244\\277\\340\\244\\232\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\270 |\\0\"\\\n  \"\\340\\244\\270\\340\\245\\215\\340\\244\\260\\340\\245\\213\\340\\244\\244 \\340\\244\\253\\340\\244\\276\\340\\244\\207\\340\\244\\262 %s \\340\\244\\256\\340\\244\\276 \\340\\244\\270\\340\\244\\256\\340\\244\\225\\340\\245\\215\\340\\244\\260\\340\\244\\256\\340\\244\\243 \\340\\244\\265\\340\\244\\277\\340\\244\\250\\340\\245\\215\\340\\244\\246\\340\\245\\201 \\340\\244\\233\\340\\245\\210\\340\\244\\250\\0\"\\\n  \"\\340\\244\\254\\340\\244\\277\\340\\244\\267\\340\\244\\257\\0\"\\\n  \"SumatraPDF \\340\\244\\265\\340\\244\\277\\340\\244\\225\\340\\244\\262\\340\\245\\215\\340\\244\\252\\340\\244\\271\\340\\244\\260\\340\\245\\201\\0\"\\\n  \"SumatraPDF \\340\\244\\205\\340\\244\\246\\340\\245\\215\\340\\244\\257\\340\\244\\276\\340\\244\\265\\340\\244\\247\\340\\244\\277\\340\\244\\225\\0\"\\\n  \"SumatraPDF \\340\\244\\254\\340\\244\\277\\340\\244\\227\\340\\245\\215\\340\\244\\260\\340\\244\\277\\340\\244\\257\\340\\245\\213\\0\"\\\n  \"SumatraPDF \\340\\244\\244\\340\\244\\252\\340\\244\\276\\340\\244\\210\\340\\244\\225\\340\\245\\213 \\340\\244\\252\\340\\245\\202\\340\\244\\260\\340\\245\\215\\340\\244\\265\\340\\244\\250\\340\\244\\277\\340\\244\\260\\340\\245\\215\\340\\244\\247\\340\\244\\276\\340\\244\\260\\340\\244\\277\\340\\244\\244 PDF \\340\\244\\252\\340\\244\\276\\340\\244\\240\\340\\244\\225 \\340\\244\\271\\340\\245\\213\\0\"\\\n  \"SumatraPDF \\340\\244\\205\\340\\244\\254 \\340\\244\\244\\340\\244\\252\\340\\244\\276\\340\\244\\210\\340\\244\\225\\340\\245\\213 \\340\\244\\252\\340\\245\\202\\340\\244\\260\\340\\245\\215\\340\\244\\265\\340\\244\\250\\340\\244\\277\\340\\244\\260\\340\\245\\215\\340\\244\\247\\340\\244\\276\\340\\244\\260\\340\\244\\277\\340\\244\\244 PDF \\340\\244\\252\\340\\244\\276\\340\\244\\240\\340\\244\\225 \\340\\244\\271\\340\\245\\201\\340\\244\\250\\340\\245\\201\\340\\244\\252\\340\\244\\260\\340\\245\\215\\340\\244\\233\\0\"\\\n  \"\\340\\244\\270\\340\\244\\256\\340\\244\\225\\340\\245\\215\\340\\244\\260\\340\\244\\256\\340\\244\\243 \\340\\244\\253\\340\\244\\276\\340\\244\\207\\340\\244\\262 \\340\\244\\226\\340\\245\\213\\340\\244\\262\\340\\245\\215\\340\\244\\250 \\340\\244\\270\\340\\244\\225\\340\\244\\277\\340\\244\\246\\340\\245\\210\\340\\244\\250\\340\\245\\215\\0\"\\\n  \"\\340\\244\\237\\340\\245\\215\\340\\244\\257\\340\\244\\276\\340\\244\\227 \\340\\244\\227\\340\\244\\260\\340\\244\\277\\340\\244\\217\\340\\244\\225\\340\\245\\213 PDF\\0\"\\\n  \"\\340\\244\\252\\340\\244\\276\\340\\244\\240 \\340\\244\\225\\340\\244\\276\\340\\244\\227\\340\\244\\234\\340\\244\\276\\340\\244\\244\\340\\244\\271\\340\\244\\260\\340\\245\\201\\0\"\\\n  \"\\0\"\\\n  \"\\340\\244\\266\\340\\245\\200\\340\\244\\260\\340\\245\\215\\340\\244\\267\\340\\244\\225:\\0\"\\\n  \"\\340\\244\\205\\340\\244\\234\\340\\245\\215\\340\\244\\236\\340\\244\\276\\340\\244\\244 \\340\\244\\270\\340\\245\\215\\340\\244\\260\\340\\245\\213\\340\\244\\244 \\340\\244\\253\\340\\244\\276\\340\\244\\207\\340\\244\\262 (%s)\\0\"\\\n  \"\\0\"\\\n  \"\\340\\244\\271\\340\\245\\207\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"&\\340\\244\\265\\340\\245\\207\\340\\244\\254\\340\\244\\270\\340\\244\\276\\340\\244\\207\\340\\244\\237 \\340\\244\\255\\340\\245\\215\\340\\244\\260\\340\\244\\256\\340\\244\\243 \\340\\244\\227\\340\\244\\260\\340\\245\\215\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\232\\340\\245\\207\\340\\244\\244\\340\\244\\276\\340\\244\\265\\340\\244\\250\\340\\245\\200\\0\"\\\n  \"XPS \\340\\244\\225\\340\\244\\276\\340\\244\\227\\340\\244\\234\\340\\244\\276\\340\\244\\244\\340\\244\\271\\340\\244\\260\\340\\245\\201\\0\"\\\n  \"\\340\\244\\244\\340\\244\\252\\340\\244\\276\\340\\244\\210 \\340\\244\\270\\340\\244\\202\\340\\244\\227 \\340\\244\\205\\340\\244\\246\\340\\245\\215\\340\\244\\257\\340\\244\\276\\340\\244\\265\\340\\244\\247\\340\\244\\277\\340\\244\\225 \\340\\244\\270\\340\\244\\202\\340\\244\\270\\340\\245\\215\\340\\244\\225\\340\\244\\260\\340\\244\\243 \\340\\244\\233 |\\0\"\\\n  \"\\340\\244\\244\\340\\244\\252\\340\\244\\276\\340\\244\\210 \\340\\244\\270\\340\\244\\202\\340\\244\\227 %s \\340\\244\\270\\340\\244\\202\\340\\244\\270\\340\\245\\215\\340\\244\\225\\340\\244\\260\\340\\244\\243 \\340\\244\\233\\0\"\\\n  \"\\340\\244\\206\\340\\244\\225\\340\\244\\276\\340\\244\\260 \\340\\244\\252\\340\\244\\260\\340\\244\\277\\340\\244\\265\\340\\244\\260\\340\\245\\215\\340\\244\\244\\340\\244\\250\\0\"\\\n  \"\\340\\244\\240\\340\\245\\201\\340\\244\\262\\340\\245\\213 \\340\\244\\254\\340\\244\\250\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\270\\340\\244\\276\\340\\244\\250\\340\\245\\213 \\340\\244\\254\\340\\244\\250\\340\\244\\276\\340\\244\\211\\340\\244\\250\\340\\245\\201\\340\\244\\271\\340\\245\\213\\340\\244\\270\\340\\245\\215\\0\"\\\n  \"\\340\\244\\206\\340\\244\\225\\340\\244\\276\\340\\244\\260 \\340\\244\\225\\340\\244\\276\\340\\244\\260\\340\\244\\225\\340\\244\\244\\340\\244\\244\\340\\245\\215\\340\\244\\265\\0\"\\\n  \"[\\340\\244\\252\\340\\244\\260\\340\\244\\277\\340\\244\\265\\340\\244\\260\\340\\245\\215\\340\\244\\244\\340\\244\\250 \\340\\244\\252\\340\\244\\244\\340\\245\\215\\340\\244\\244\\340\\244\\276 \\340\\244\\262\\340\\244\\276\\340\\244\\227\\340\\245\\215\\340\\244\\257\\340\\245\\213; \\340\\244\\244\\340\\244\\276\\340\\244\\234\\340\\244\\276 \\340\\244\\227\\340\\244\\260\\340\\244\\277\\340\\244\\201\\340\\244\\246\\340\\245\\210\\340\\244\\233] %s\\0\"\\\n  \"\\340\\244\\252\\340\\244\\276\\340\\244\\240 \\340\\244\\252\\340\\245\\215\\340\\244\\260\\340\\244\\244\\340\\244\\277\\340\\244\\262\\340\\244\\277\\340\\244\\252\\340\\244\\277 \\340\\244\\254\\340\\244\\250\\340\\244\\276\\340\\244\\210\\340\\244\\246\\340\\245\\210\\340\\244\\233\\0\"\\\n  \"\\340\\244\\225\\340\\244\\276\\340\\244\\227\\340\\244\\234\\340\\244\\276\\340\\244\\244 \\340\\244\\233\\340\\244\\252\\340\\244\\276\\340\\244\\207\\0\";\n\nconst char * gTranslations_no = \n  \"&Om\\0\"\\\n  \"Fak&tisk st\\303\\270rrelse\\tCtrl+1\\0\"\\\n  \"&Avanserte innstillinger\\0\"\\\n  \"&Alle valgte sider\\0\"\\\n  \"Tilbake\\tAlt+\\342\\206\\220\\0\"\\\n  \"&Bokvisning\\tCtrl+8\\0\"\\\n  \"&Lukk\\tCtrl+W\\0\"\\\n  \"&Kopier valgt omr\\303\\245de\\0\"\\\n  \"Kopier merket tekst\\tCtrl+C\\0\"\\\n  \"&Ikke sp\\303\\270r meg igjen\\0\"\\\n  \"Bare &partallssider\\0\"\\\n  \"&Flere sider\\tCtrl+7\\0\"\\\n  \"&Fil\\0\"\\\n  \"&S\\303\\270k etter:\\0\"\\\n  \"F\\303\\270rste side\\tHome\\0\"\\\n  \"&Tilpass sider til utskriftsomr\\303\\245de\\0\"\\\n  \"&G\\303\\245 til\\0\"\\\n  \"&G\\303\\245 til side:\\0\"\\\n  \"&Hjelp\\0\"\\\n  \"Siste side\\tEnd\\0\"\\\n  \"&Forst\\303\\270rrelse:\\0\"\\\n  \"&Bruksanvisning\\0\"\\\n  \"&Skill mellom store og sm\\303\\245 bokstaver\\0\"\\\n  \"Neste side\\t\\342\\206\\222\\0\"\\\n  \"&Nei\\0\"\\\n  \"&Nei, takk\\0\"\\\n  \"Bare &oddetallssider\\0\"\\\n  \"&\\303\\205pne dokument\\0\"\\\n  \"&\\303\\205pne...\\tCtrl+O\\0\"\\\n  \"&Innstillinger...\\0\"\\\n  \"&Passord:\\0\"\\\n  \"Fes&t dokument\\0\"\\\n  \"Forrige side\\t\\342\\206\\220\\0\"\\\n  \"&Skriv ut...\\0\"\\\n  \"&Skriv ut...\\tCtrl+P\\0\"\\\n  \"&Skriv ut... (ikke tillatt)\\0\"\\\n  \"&Husk passordet for dette dokumentet\\0\"\\\n  \"&Husk disse innstillingene for hvert dokument\\0\"\\\n  \"&Fjern dokument\\0\"\\\n  \"&Lagre som...\\0\"\\\n  \"Lagre &som...\\tCtrl+S\\0\"\\\n  \"&Alternativer\\0\"\\\n  \"&Krymp sider til utskriftsomr\\303\\245de (om n\\303\\270dvendig)\\0\"\\\n  \"&Enkeltside\\tCtrl+6\\0\"\\\n  \"&Ignorer denne versjonen\\0\"\\\n  \"&Benytt opprinnelige sidest\\303\\270rrelser\\0\"\\\n  \"&Visning\\0\"\\\n  \"&Vindu\\0\"\\\n  \"&Ja\\0\"\\\n  \"\\0\"\\\n  \"(av %d)\\0\"\\\n  \"(side %s)\\0\"\\\n  \"Om SumatraPDF\\0\"\\\n  \"Legg til i Favoritter\\0\"\\\n  \"Legg til side %s i favoritter\\0\"\\\n  \"Legg til side %s i favoritter med (valgfritt) navn:\\0\"\\\n  \"Legg til i favoritter\\0\"\\\n  \"Avansert\\0\"\\\n  \"Alle filer (*.*)\\0\"\\\n  \"Alle st\\303\\270ttede dokumenter\\0\"\\\n  \"Program:\\0\"\\\n  \"Tilknytt til PDF-filer?\\0\"\\\n  \"Vedlegg: %s\\0\"\\\n  \"Forfatter:\\0\"\\\n  \"Automatisk\\0\"\\\n  \"Automatisk sjekk for &oppdateringer\\0\"\\\n  \"Bokvisning\\0\"\\\n  \"Bokmerker\\tF12\\0\"\\\n  \"Bokmerk snarveier\\0\"\\\n  \"Bokmerk snarvei til side %s av %s\\0\"\\\n  \"Bokmerker\\0\"\\\n  \"bytes\\0\"\\\n  \"CHM-dokumenter\\0\"\\\n  \"Kan ikke koble til Internett (feilmelding %#x).\\0\"\\\n  \"Avbryt\\0\"\\\n  \"Kan ikke skrive ut filen\\0\"\\\n  \"Kan ikke starte invertert s\\303\\270kekommando. Vennligst sjekk kommandolinjen i innstillingene.\\0\"\\\n  \"Endre spr\\303\\245k (Change Language)\\0\"\\\n  \"&Se etter oppdateringer...\\0\"\\\n  \"Tegneserier\\0\"\\\n  \"Kompatibilitet\\0\"\\\n  \"Kontinuerlig\\0\"\\\n  \"Kontinuerlig bokvisning\\0\"\\\n  \"Kontinuerlig - motst\\303\\245ende\\0\"\\\n  \"Bidra med oversetting\\0\"\\\n  \"Kopier &Bilde\\0\"\\\n  \"Kopier &lenkeadresse\\0\"\\\n  \"Kopier ko&mmentar\\0\"\\\n  \"Mangler tillatelse til kopiering av tekst (kopierer kun som bilde)\\0\"\\\n  \"Opphavsrett:\\0\"\\\n  \"Kunne ikke innhente skriveregenskaper\\0\"\\\n  \"Kunne ikke klargj\\303\\270re skriveren\\0\"\\\n  \"Kunne ikke vise siden\\0\"\\\n  \"Opprettet:\\0\"\\\n  \"Gjeldende fil\\0\"\\\n  \"Skrivemerkeposisjon:\\0\"\\\n  \"&Egendefinert zoom...\\tCtrl+Y\\0\"\\\n  \"Standard sideoppsett:\\0\"\\\n  \"Standard&zoom:\\0\"\\\n  \"Standard PDF-leser kan ikke endres i flyttbar modus\\0\"\\\n  \"Manglende tillatelser:\\0\"\\\n  \"DjVu-dokumenter\\0\"\\\n  \"Dokumentegenskaper\\0\"\\\n  \"Nedlasting\\0\"\\\n  \"A&vslutt\\tCtrl+Q\\0\"\\\n  \"EPUB-dokumenter\\0\"\\\n  \"Skriv inn passord\\0\"\\\n  \"Skriv inn passord for %s\\0\"\\\n  \"Skriv inn kommandolinjen som skal kj\\303\\270res n\\303\\245r du dobbeltklikker p\\303\\245 PDF-dokumentet:\\0\"\\\n  \"Feil under innlasting av %s\\0\"\\\n  \"F&avoritter\\0\"\\\n  \"Fremover\\tAlt+\\342\\206\\222\\0\"\\\n  \"Fullskjerm\\tCtrl+Shift+L\\0\"\\\n  \"Flere sider\\0\"\\\n  \"Kunne ikke endre navn p\\303\\245 filen!\\0\"\\\n  \"Feil ved lagring av filen\\0\"\\\n  \"Rask Nettvisning\\0\"\\\n  \"Favoritter\\0\"\\\n  \"FictionBook-dokumenter\\0\"\\\n  \"Filen %s finnes ikke\\0\"\\\n  \"Filst\\303\\270rrelse:\\0\"\\\n  \"Fil:\\0\"\\\n  \"S\\303\\270k etter...\\tCtrl+F\\0\"\\\n  \"S\\303\\270k etter\\0\"\\\n  \"Neste\\0\"\\\n  \"Forrige\\0\"\\\n  \"S\\303\\270k etter:\\0\"\\\n  \"Tilpass &innhold\\tCtrl+3\\0\"\\\n  \"Tilpass &side\\tCtrl+0\\0\"\\\n  \"Tilpass til bredd&e\\tCtrl+2\\0\"\\\n  \"Tilpass innhold\\0\"\\\n  \"Tilpass side\\0\"\\\n  \"Tilpass til bredde\\0\"\\\n  \"Tilpass bredde og vis sider kontinuerlig\\0\"\\\n  \"Tilpass til enkeltside\\0\"\\\n  \"Skrifter:\\0\"\\\n  \"Formater bok... %d sidene\\0\"\\\n  \"Fant tekst p\\303\\245 side %s\\0\"\\\n  \"Fant tekst p\\303\\245 side %s (igjen)\\0\"\\\n  \"Ofte leste\\0\"\\\n  \"\\0\"\\\n  \"G\\303\\245 til side\\0\"\\\n  \"Skjult ofte leste\\0\"\\\n  \"Tips: Bruk F3-tasten for \\303\\245 s\\303\\270ke etter neste\\0\"\\\n  \"Bildefiler (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Gj\\303\\270re SumatraPDF til standard \\303\\245pningsprogram for PDF-filer?\\0\"\\\n  \"Bruk SumatraPDF som standard PDF-leser\\0\"\\\n  \"Man&ga-modus\\0\"\\\n  \"Skill mellom store og sm\\303\\245 bokstaver\\0\"\\\n  \"Mobi-dokumenter\\0\"\\\n  \"Endret:\\0\"\\\n  \"En ny versjon %s er tilgjenglig. Vil du laste den ned n\\303\\245?\\0\"\\\n  \"Neste side\\0\"\\\n  \"S\\303\\270keelementet ble ikke funnet\\0\"\\\n  \"Ingen resultater funnet rundt linje %u i filen %s\\0\"\\\n  \"Ingen synkroniseringsfil funnet\\0\"\\\n  \"Ingen synkroniseringsinfo her\\0\"\\\n  \"Antall sider:\\0\"\\\n  \"\\0\"\\\n  \"\\303\\205pne\\0\"\\\n  \"\\303\\205pne i PDF-XChange\\0\"\\\n  \"\\303\\205pne et dokument...\\0\"\\\n  \"\\303\\205pne i %s\\0\"\\\n  \"\\303\\205pne i &Adobe Reader\\0\"\\\n  \"\\303\\205pne i &Foxit Reader\\0\"\\\n  \"\\303\\205pne i &Microsoft HTML Help\\0\"\\\n  \"\\303\\205pne i &Microsoft XPS-visning\\0\"\\\n  \"E&genskaper\\0\"\\\n  \"E&genskaper...\\tCtrl+D\\0\"\\\n  \"PDF-dokument\\0\"\\\n  \"PDF Optimalisering:\\0\"\\\n  \"PDF-produsent:\\0\"\\\n  \"PDF-versjon:\\0\"\\\n  \"PDF-dokumenter (*.pdf)\\0\"\\\n  \"Side...\\tCtrl+G\\0\"\\\n  \"Side %s\\0\"\\\n  \"Sidest\\303\\270rrelse:\\0\"\\\n  \"Sidetallet '%u' finnes ikke i dokumentet\\0\"\\\n  \"Sideskalering\\0\"\\\n  \"Side:\\0\"\\\n  \"PalmDoc dokumenter\\0\"\\\n  \"Vennligst vent - arbeider...\\0\"\\\n  \"Postscript-dokumenter\\0\"\\\n  \"Pr&esentasjon\\tCtrl+L\\0\"\\\n  \"Forrige side\\0\"\\\n  \"Skriv ut\\0\"\\\n  \"Utskriftsomr\\303\\245de\\0\"\\\n  \"Skriver med gjeldende navn eksisterer ikke\\0\"\\\n  \"Utskrift p\\303\\245g\\303\\245r.\\0\"\\\n  \"Skriver ut fortsatt. Avbryte?\\0\"\\\n  \"Utskriften p\\303\\245g\\303\\245r fortsatt. Avbryte og starte p\\303\\245 nytt?\\0\"\\\n  \"Skriver ut side %d av %d...\\0\"\\\n  \"Problem med utskrift.\\0\"\\\n  \"Gi nytt &navn... \\tF2\\0\"\\\n  \"Husk &\\303\\245pnede filer\\0\"\\\n  \"Fjern fra favoritter\\0\"\\\n  \"Fjern side %s fra favoritter\\0\"\\\n  \"Endre Navn Til\\0\"\\\n  \"Roter mot klokken\\tCtrl+Shift+Strek\\0\"\\\n  \"Roter med klokken\\tCtrl+Shift+Pluss\\0\"\\\n  \"Lagre som\\0\"\\\n  \"Lagre s&narvei...\\tCtrl+Shift+S\\0\"\\\n  \"S\\303\\270ker %d av %d...\\0\"\\\n  \"Merk &alt\\0\"\\\n  \"Merk &alle\\tCtrl+A\\0\"\\\n  \"Velg innhold med Ctrl+Venstre museknapp\\0\"\\\n  \"Valg:\\0\"\\\n  \"Send med E-post...\\0\"\\\n  \"Velg invertert kommandolinje for s\\303\\270k\\0\"\\\n  \"Vis &bokmerker\\0\"\\\n  \"Vis sider kontinuerlig\\0\"\\\n  \"Vis verkt\\303\\270ylinje\\0\"\\\n  \"Vis favoritter\\0\"\\\n  \"Vis ofte leste\\0\"\\\n  \"Vis &bokmerkefanen om tilgjengelig\\0\"\\\n  \"Enkeltside\\0\"\\\n  \"Beklager, dette skulle ikke ha skjedd!\\n\\nVennligst trykk 'Avbryt' hvis du \\303\\270nsker \\303\\245 hjelpe oss med \\303\\245 fikse dette problemet.\\0\"\\\n  \"Kildefilen %s har ingen synkroniseringspunkt\\0\"\\\n  \"Emne:\\0\"\\\n  \"Innstillinger\\0\"\\\n  \"SumatraPDF-oppdatering\\0\"\\\n  \"SumatraPDF krasjet\\0\"\\\n  \"SumatraPDF er din standard PDF-leser\\0\"\\\n  \"SumatraPDF burde n\\303\\245 v\\303\\246re din standard PDF-leser\\0\"\\\n  \"Synkroniserende fil kan ikke \\303\\245pnes\\0\"\\\n  \"Merket PDF\\0\"\\\n  \"Tekstdokumenter\\0\"\\\n  \"Dette dokumentet bruker ust\\303\\270ttede funksjoner (%s) og kan muligens ikke bli vist riktig.\\0\"\\\n  \"Tittel:\\0\"\\\n  \"Ukjent kildefil (%s)\\0\"\\\n  \"Bruk &faner\\0\"\\\n  \"Vis\\0\"\\\n  \"\\303\\205pne &hjemmesiden\\0\"\\\n  \"Advarsel\\0\"\\\n  \"XPS-dokumenter\\0\"\\\n  \"Du har den siste versjonen.\\0\"\\\n  \"Du har versjon %s\\0\"\\\n  \"\\0\"\\\n  \"Zoom inn\\0\"\\\n  \"Zoom ut\\0\"\\\n  \"Zoom til\\0\"\\\n  \"[Endringer oppdaget; oppdaterer] %s\\0\"\\\n  \"kopierer tekst\\0\"\\\n  \"skriver ut dokument\\0\";\n\nconst char * gTranslations_nn = \n  \"&Om\\0\"\\\n  \"F&aktisk storleik\\tCtrl+1\\0\"\\\n  \"&Avanserte innstillingar\\0\"\\\n  \"&Alle valde sider\\0\"\\\n  \"&Tilbake\\tAlt+Venstretast\\0\"\\\n  \"&Bokvising\\tCtrl+8\\0\"\\\n  \"&Lukk\\tCtrl+W\\0\"\\\n  \"&Kopier utval\\0\"\\\n  \"&Kopier utval\\tCtrl+C\\0\"\\\n  \"Ikkje sp\\303\\270r meg igjen\\0\"\\\n  \"&Kun partalssider\\0\"\\\n  \"&Fleire sider\\tCtrl+7\\0\"\\\n  \"&Fil\\0\"\\\n  \"&Finn hvilke:\\0\"\\\n  \"Fyrste side\\tHome\\0\"\\\n  \"&Tilpass sider til utskrivbart omr\\303\\245de\\0\"\\\n  \"&G\\303\\245 til\\0\"\\\n  \"&Hopp til side:\\0\"\\\n  \"&Hjelp\\0\"\\\n  \"Siste side\\tEnd\\0\"\\\n  \"&Forst\\303\\270rring:\\0\"\\\n  \"&Anvisning\\0\"\\\n  \"&Skil mellom store/sm\\303\\245 bokstaver\\0\"\\\n  \"Neste side\\t->\\0\"\\\n  \"&Nei\\0\"\\\n  \"&Nei takk\\0\"\\\n  \"&Kun oddetalssider\\0\"\\\n  \"&Opne dokument\\0\"\\\n  \"&Opne...\\tCtrl+O\\0\"\\\n  \"&Innstillingar...\\0\"\\\n  \"&Passord:\\0\"\\\n  \"&Fest dokument\\0\"\\\n  \"F\\303\\270rre side\\t<-\\0\"\\\n  \"&Skriv ut\\0\"\\\n  \"Skriv &ut...\\tCtrl+P\\0\"\\\n  \"&Skriv ut... (Blei nekta)\\0\"\\\n  \"&Husk passordet for dette dokumentet\\0\"\\\n  \"&Husk innstillingane for kvart dokument\\0\"\\\n  \"&Fjern dokument\\0\"\\\n  \"&Lagre som...\\0\"\\\n  \"Lagre &som...\\tCtrl+S\\0\"\\\n  \"&Innstillingar\\0\"\\\n  \"&Krymp sider til utskrivbart omr\\303\\245de (hvis n\\303\\270dvendig)\\0\"\\\n  \"&Enkeltside\\tCtrl+6\\0\"\\\n  \"Hopp over denne versjonen\\0\"\\\n  \"&Bruk opprinnelige sidestorleikar\\0\"\\\n  \"&Vis\\0\"\\\n  \"&Vindu\\0\"\\\n  \"&Ja\\0\"\\\n  \"\\0\"\\\n  \"(av %d)\\0\"\\\n  \"(side %s)\\0\"\\\n  \"Om SumatraPDF\\0\"\\\n  \"Legg til ein favoritt\\0\"\\\n  \"Legg til side %s i favorittane\\0\"\\\n  \"Legg til side %s i favorittane med (valfritt) namn:\\0\"\\\n  \"Legg til i favorittar\\0\"\\\n  \"Avansert\\0\"\\\n  \"Alle filar\\0\"\\\n  \"Alle st\\303\\270ttede dokumentar\\0\"\\\n  \"Applikasjon:\\0\"\\\n  \"Tilknytte PDF-filer?\\0\"\\\n  \"Vedlegg: %s\\0\"\\\n  \"Skapar:\\0\"\\\n  \"Automatisk\\0\"\\\n  \"S\\303\\270k automatisk etter &oppdateringar\\0\"\\\n  \"Bokvising\\0\"\\\n  \"Bokmerker\\tF12\\0\"\\\n  \"Bokmerk snarveg\\0\"\\\n  \"Bokmerk snarveg til side %s av %s\\0\"\\\n  \"Bokmerkar\\0\"\\\n  \"\\0\"\\\n  \"CHM-dokumentar\\0\"\\\n  \"Kan ikkje kople til internettet (Feilkode %#x).\\0\"\\\n  \"Lukk\\0\"\\\n  \"Kan ikkje skrive ut denne fila\\0\"\\\n  \"Kan ikkje starte invertert s\\303\\270kjekommando. Venligst sjekk kommandolinja i innstillingane.\\0\"\\\n  \"Byt spr\\303\\245k (Change Language)\\0\"\\\n  \"&Sj\\303\\245 etter ny versjon\\0\"\\\n  \"Teikneserieb\\303\\270kjer\\0\"\\\n  \"Kompatibilitet\\0\"\\\n  \"Kontinuerleg\\0\"\\\n  \"Kontinuerleg bokvising\\0\"\\\n  \"Kontunuerleg motst\\303\\245ande\\0\"\\\n  \"Delta med omsetjing\\0\"\\\n  \"Kopier &bilete\\0\"\\\n  \"Kopier &lenkeadresse\\0\"\\\n  \"Kopier ko&mmentar\\0\"\\\n  \"Kopiering av tekst blei nektast (Kopierer kun som bilete)\\0\"\\\n  \"Opphavsret:\\0\"\\\n  \"Kunne ikkje hente utskrivaregenskapene\\0\"\\\n  \"Kunne ikkje starte utskrivaren\\0\"\\\n  \"Kunne ikkje rendre siden\\0\"\\\n  \"Skapt:\\0\"\\\n  \"N\\303\\245verande fil\\0\"\\\n  \"Mark\\303\\270rposisjon:\\0\"\\\n  \"Tilpassa &zooming...\\tCtrl+Y\\0\"\\\n  \"Standard &oppsett:\\0\"\\\n  \"Standard &zooming:\\0\"\\\n  \"Standard PDF-lesar kan ikkje bli endra i flyttbar modus\\0\"\\\n  \"Permisjonar som blei nekta:\\0\"\\\n  \"DjVu-dokumentar\\0\"\\\n  \"Dokumentegenskaper\\0\"\\\n  \"Last ned\\0\"\\\n  \"&Avslutt\\tCtrl+Q\\0\"\\\n  \"EPUB digitale b\\303\\270kjer\\0\"\\\n  \"Skriv inn passord\\0\"\\\n  \"Skriv inn passord for %s\\0\"\\\n  \"G\\303\\245 inn i kommandolinja for \\303\\245 hentast, n\\303\\245r du dobbeltklikkar p\\303\\245 PDF-dokumentet:\\0\"\\\n  \"Feil ved innlasting av %s\\0\"\\\n  \"F&avorittar\\0\"\\\n  \"F&ramover\\tAlt+H\\303\\270yretast\\0\"\\\n  \"Full skjerm\\tCtrl+Shift+L\\0\"\\\n  \"Fleire sider\\0\"\\\n  \"Klarte ikkje \\303\\245 omd\\303\\270pe fila!\\0\"\\\n  \"Feil under lagring av fil\\0\"\\\n  \"Rask nettvising\\0\"\\\n  \"Favorittar\\0\"\\\n  \"FictionBook-dokumentar\\0\"\\\n  \"Filen %s blei ikkje funnet\\0\"\\\n  \"Filst\\303\\270rrelse:\\0\"\\\n  \"Fil:\\0\"\\\n  \"Finn...\\tCtrl+F\\0\"\\\n  \"Finn\\0\"\\\n  \"Finn neste\\0\"\\\n  \"Finn f\\303\\270rre\\0\"\\\n  \"Finn\\0\"\\\n  \"Tilpass &innhald\\tCtrl+3\\0\"\\\n  \"Tilpass &side\\tCtrl+0\\0\"\\\n  \"Tilpass &breidde\\tCtrl+2\\0\"\\\n  \"Tilpass innhald\\0\"\\\n  \"Tilpass side\\0\"\\\n  \"Tilpass breidde\\0\"\\\n  \"Tilpass bredde og vis sider kontinuerleg\\0\"\\\n  \"Tilpass ein enkel side\\0\"\\\n  \"Fontar:\\0\"\\\n  \"Formatterer boka... %d sider\\0\"\\\n  \"Fann tekst p\\303\\245 side %s\\0\"\\\n  \"Fann tekst p\\303\\245 side %s (igjen)\\0\"\\\n  \"Ofte lesne\\0\"\\\n  \"\\0\"\\\n  \"G\\303\\245 til side\\0\"\\\n  \"Skjul ofte lesne\\0\"\\\n  \"Tips: Bruk F3-knappen for \\303\\245 finne igjen\\0\"\\\n  \"Biletfilar (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Gjere SumatraPDF til standardprogram for PDF-filer?\\0\"\\\n  \"Bruk SumatraPDF som standard PDF-lesar\\0\"\\\n  \"Man&ga-vising\\0\"\\\n  \"Skil mellom store/sm\\303\\245 bokstavar\\0\"\\\n  \"Mobi-dokumentar\\0\"\\\n  \"Endrast:\\0\"\\\n  \"Ny versjon (ver. %s) tilgjengeleg. Laste ned?\\0\"\\\n  \"Neste side\\0\"\\\n  \"Ingen treff blei funnet\\0\"\\\n  \"Ingen resultat funnet omkring linje %u i fila %s\\0\"\\\n  \"Ingen synkroniseringsfil blei funna\\0\"\\\n  \"Ingen synkroniseringsinfo p\\303\\245 denne posisjonen\\0\"\\\n  \"Antal sider:\\0\"\\\n  \"\\0\"\\\n  \"Opne\\0\"\\\n  \"Opne &i PDF-XChange\\0\"\\\n  \"Opne eit dokument\\0\"\\\n  \"Opne i %s\\0\"\\\n  \"Opne i &Adobe Reader\\0\"\\\n  \"Opne i &Foxit Reader\\0\"\\\n  \"Opne i &Microsoft HTML-hjelp\\0\"\\\n  \"Opne i &Microsoft XPS-visar\\0\"\\\n  \"E&genskaper\\0\"\\\n  \"E&genskaper\\tCtrl+D\\0\"\\\n  \"PDF-dokument\\0\"\\\n  \"PDF-optimaliseringer:\\0\"\\\n  \"PDF-lagar:\\0\"\\\n  \"PDF-versjon:\\0\"\\\n  \"PDF-dokumentar\\0\"\\\n  \"Side...\\tCtrl+G\\0\"\\\n  \"Side %s\\0\"\\\n  \"Sidestorleik:\\0\"\\\n  \"Side nummer %u eksisterer ikkje\\0\"\\\n  \"Sideskalering\\0\"\\\n  \"Side:\\0\"\\\n  \"PalmDoc-dokumentar\\0\"\\\n  \"Venligst vent - Visar...\\0\"\\\n  \"Etterskriv dokumentar\\0\"\\\n  \"Pr&esentasjon\\tF5\\0\"\\\n  \"F\\303\\270rre side\\0\"\\\n  \"Skriv ut\\0\"\\\n  \"Utskrivingsrekkevidde\\0\"\\\n  \"Ein skriver med det namnet finnes ikkje\\0\"\\\n  \"Utskriving under arbeid.\\0\"\\\n  \"Utskrivinga p\\303\\245g\\303\\245r framleis. Vil du stoppe og avslutte?\\0\"\\\n  \"Utskrivinga p\\303\\245g\\303\\245r framleis. Vil du stoppe og starte p\\303\\245 nytt?\\0\"\\\n  \"Skriver ut side %d av %d...\\0\"\\\n  \"Skrivarfeil\\0\"\\\n  \"Gjev n&ytt namn...\\tF2\\0\"\\\n  \"Husk &opna filar\\0\"\\\n  \"Fjern fr\\303\\245 favorittar\\0\"\\\n  \"Fjern side %s fr\\303\\245 favorittene\\0\"\\\n  \"Gjev nytt namn\\0\"\\\n  \"Roter til venstre\\tCtrl+Shift+-\\0\"\\\n  \"Roter til h\\303\\270gre\\tCtrl+Shift++\\0\"\\\n  \"Lagre som\\0\"\\\n  \"Large s&narveg...\\tCtrl+Shift+S\\0\"\\\n  \"S\\303\\270kjer gjennom %d av %d...\\0\"\\\n  \"Vel &alle\\0\"\\\n  \"Vel &alle\\tCtrl+A\\0\"\\\n  \"Vel innhald med Ctrl + venstre museknapp\\0\"\\\n  \"Utval:\\0\"\\\n  \"Send med &E-post...\\0\"\\\n  \"Velg motsatt s\\303\\270k-kommandolinje\\0\"\\\n  \"Vis &bokmerkar\\0\"\\\n  \"Vis &sider kontinuerleg\\0\"\\\n  \"Vis verktylinje\\0\"\\\n  \"Vis favorittar\\0\"\\\n  \"Vis ofte lesne\\0\"\\\n  \"Vis &bokmerkesidelinja hvis den er tilgjengeleg\\0\"\\\n  \"Enkel side\\0\"\\\n  \"Beklager, d\\303\\251t skulle ikkje ha skjedd!\\n\\nVenligst trykk 'Lukk' hvis du vil hjelpe oss \\303\\245 fikse orsaka til dette krasjet.\\0\"\\\n  \"Kildefila %s har ikkje nokre synkroniseringspunkt\\0\"\\\n  \"Tema:\\0\"\\\n  \"SumatraPDF-innstillingar\\0\"\\\n  \"SumatraPDF Oppdatering\\0\"\\\n  \"SumatraPDF har krasja\\0\"\\\n  \"SumatraPDF er din standard PDF-lesar\\0\"\\\n  \"SumatraPDF skulle no vere din standard PDF-lesar\\0\"\\\n  \"Synkroniseringsfila kan ikkje opnes\\0\"\\\n  \"Merka PDF\\0\"\\\n  \"Tekstdokumentar\\0\"\\\n  \"Dette dokumentet bruker ust\\303\\270tta funksjoner (%s) og kan kanskje ikkje visast riktig.\\0\"\\\n  \"Tittel:\\0\"\\\n  \"Ukjend kildefil (%s)\\0\"\\\n  \"Bruk &faner\\0\"\\\n  \"Vis\\0\"\\\n  \"Vitj &heimeside\\0\"\\\n  \"Fare\\0\"\\\n  \"XPS-dokumentar\\0\"\\\n  \"Du har den siste versjonen.\\0\"\\\n  \"Du har versjon %s\\0\"\\\n  \"\\0\"\\\n  \"Zoom inn\\0\"\\\n  \"Zoom ut\\0\"\\\n  \"Zoomfaktor\\0\"\\\n  \"[Endringar oppdaga; lastar inn p\\303\\245 nytt] %s\\0\"\\\n  \"Kopierer tekst\\0\"\\\n  \"Skrivar ut dokument\\0\";\n\nconst char * gTranslations_fa = \n  \"&\\330\\257\\330\\261\\330\\250\\330\\247\\330\\261\\331\\207\\0\"\\\n  \"&\\330\\247\\331\\206\\330\\257\\330\\247\\330\\262\\331\\207 \\331\\210\\330\\247\\331\\202\\330\\271\\333\\214\\tCtrl+1\\0\"\\\n  \"\\330\\252\\331\\206\\330\\270\\333\\214\\331\\205\\330\\247\\330\\252 \\331\\276\\333\\214\\330\\264\\330\\261\\331\\201\\330\\252\\331\\207\\0\"\\\n  \"&\\331\\207\\331\\205\\331\\207\\342\\200\\214\\333\\214 \\330\\265\\331\\201\\330\\255\\330\\247\\330\\252 \\330\\247\\331\\206\\330\\252\\330\\256\\330\\247\\330\\250 \\342\\200\\214\\330\\264\\330\\257\\331\\207\\0\"\\\n  \"\\330\\254\\330\\247\\333\\214 &\\331\\202\\330\\250\\331\\204\\333\\214\\tAlt+\\342\\206\\220\\342\\200\\216\\0\"\\\n  \"&\\332\\251\\330\\252\\330\\247\\330\\250\\333\\214\\tCtrl+8\\0\"\\\n  \"\\330\\250&\\330\\263\\330\\252\\331\\206\\tCtrl+W\\0\"\\\n  \"&\\330\\261\\331\\210\\331\\206\\331\\210\\330\\264\\330\\252 \\330\\247\\330\\262 \\331\\202\\330\\263\\331\\205\\330\\252 \\330\\247\\331\\206\\330\\252\\330\\256\\330\\247\\330\\250 \\330\\264\\330\\257\\331\\207\\0\"\\\n  \"&\\330\\261\\331\\210\\331\\206\\331\\210\\330\\264\\330\\252 \\330\\247\\330\\262 \\331\\202\\330\\263\\331\\205\\330\\252 \\330\\247\\331\\206\\330\\252\\330\\256\\330\\247\\330\\250 \\330\\264\\330\\257\\331\\207\\tCtrl+C\\0\"\\\n  \"&\\330\\257\\331\\210\\330\\250\\330\\247\\330\\261\\331\\207 \\330\\247\\330\\262 \\331\\205\\331\\206 \\331\\206\\331\\276\\330\\261\\330\\263\\0\"\\\n  \"\\331\\201\\331\\202\\330\\267 \\330\\265\\331\\201\\330\\255\\330\\247\\330\\252 &\\330\\262\\331\\210\\330\\254\\0\"\\\n  \"&\\330\\257\\331\\210\\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\330\\247\\333\\214\\tCtrl+7\\0\"\\\n  \"&\\331\\276\\330\\261\\331\\210\\331\\206\\330\\257\\331\\207\\0\"\\\n  \"&\\330\\254\\330\\263\\330\\252\\330\\254\\331\\210 \\330\\250\\330\\261\\330\\247\\333\\214:\\0\"\\\n  \"\\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\333\\214 &\\331\\206\\330\\256\\330\\263\\330\\252\\tHome\\0\"\\\n  \"\\330\\247\\331\\206\\330\\257\\330\\247\\330\\262\\331\\207\\342\\200\\214\\333\\214 \\330\\265\\331\\201\\330\\255\\330\\247\\330\\252 \\330\\261\\330\\247 \\331\\205\\330\\252\\331\\206\\330\\247\\330\\263\\330\\250 \\330\\250\\330\\247 \\331\\206\\330\\247\\330\\255\\333\\214\\331\\207\\342\\200\\214\\333\\214 \\331\\202\\330\\247\\330\\250\\331\\204 \\332\\206\\330\\247\\331\\276 \\332\\251\\330\\247\\330\\272\\330\\260 &\\330\\257\\330\\261\\330\\263\\330\\252 \\332\\251\\331\\206\\0\"\\\n  \"&\\330\\250\\330\\261\\331\\210 \\330\\250\\331\\207\\0\"\\\n  \"&\\330\\250\\330\\261\\331\\210 \\330\\250\\331\\207 \\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\333\\214:\\0\"\\\n  \"&\\330\\261\\330\\247\\331\\207\\331\\206\\331\\205\\330\\247\\0\"\\\n  \"\\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\333\\214 \\330\\242&\\330\\256\\330\\261\\tEnd\\0\"\\\n  \"&\\330\\257\\330\\261\\330\\264\\330\\252 \\331\\206\\331\\205\\330\\247\\333\\214\\333\\214\\0\"\\\n  \"&\\332\\251\\330\\252\\330\\247\\330\\250\\332\\206\\331\\207\\342\\200\\214\\333\\214 \\330\\261\\330\\247\\331\\207\\331\\206\\331\\205\\330\\247\\333\\214 \\330\\242\\331\\206\\331\\204\\330\\247\\333\\214\\331\\206\\0\"\\\n  \"\\330\\257\\331\\202\\333\\214\\331\\202\\330\\247 &\\331\\205\\330\\253\\331\\204 \\330\\271\\330\\250\\330\\247\\330\\261\\330\\252 \\331\\210\\330\\247\\330\\261\\330\\257 \\330\\264\\330\\257\\331\\207\\0\"\\\n  \"\\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\333\\214 &\\330\\250\\330\\271\\330\\257\\333\\214\\t\\342\\206\\222\\0\"\\\n  \"&\\330\\256\\333\\214\\330\\261\\0\"\\\n  \"&\\331\\206\\331\\207\\330\\214 \\331\\205\\330\\252\\330\\264\\332\\251\\330\\261\\331\\205\\0\"\\\n  \"\\331\\201\\331\\202\\330\\267 \\330\\265\\331\\201\\330\\255\\330\\247\\330\\252 &\\331\\201\\330\\261\\330\\257\\0\"\\\n  \"\\330\\250\\330\\247\\330\\262 \\332\\251\\330\\261\\330\\257\\331\\206 \\330\\263\\331\\206\\330\\257\\0\"\\\n  \"&\\330\\250\\330\\247\\330\\262 \\332\\251\\330\\261\\330\\257\\331\\206...\\tCtrl+O\\0\"\\\n  \"&\\330\\252\\331\\206\\330\\270\\333\\214\\331\\205\\330\\247\\330\\252 ...\\0\"\\\n  \"&\\332\\251\\331\\204\\331\\205\\331\\207\\342\\200\\214\\333\\214 \\330\\271\\330\\250\\331\\210\\330\\261\\0\"\\\n  \"&\\330\\263\\331\\206\\330\\254\\330\\247\\331\\202 \\332\\251\\330\\261\\330\\257\\331\\206 \\330\\263\\331\\206\\330\\257\\0\"\\\n  \"\\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\333\\214 &\\331\\202\\330\\250\\331\\204\\333\\214\\t\\342\\206\\220\\0\"\\\n  \"&\\332\\206\\330\\247\\331\\276...\\0\"\\\n  \"&\\332\\206\\330\\247\\331\\276...\\tCtrl+P\\0\"\\\n  \"&\\332\\206\\330\\247\\331\\276... (\\331\\205\\331\\205\\331\\206\\331\\210\\330\\271 \\330\\264\\330\\257\\331\\207)\\0\"\\\n  \"\\330\\261\\331\\205\\330\\262 \\330\\271\\330\\250\\331\\210\\330\\261 \\330\\247\\333\\214\\331\\206 \\330\\263\\331\\206\\330\\257 \\330\\261\\330\\247 \\330\\250\\331\\207 &\\330\\256\\330\\247\\330\\267\\330\\261 \\330\\257\\330\\247\\330\\264\\330\\252\\331\\207 \\330\\250\\330\\247\\330\\264\\0\"\\\n  \"\\330\\247\\333\\214\\331\\206 \\330\\252\\331\\206\\330\\270\\333\\214\\331\\205\\330\\247\\330\\252 \\330\\261\\330\\247 \\330\\250\\330\\261\\330\\247\\333\\214 \\331\\207\\331\\205\\331\\207\\342\\200\\214\\333\\214 \\330\\247\\330\\263\\331\\206\\330\\247\\330\\257 \\330\\250\\331\\207 &\\330\\256\\330\\247\\330\\267\\330\\261 \\330\\250\\330\\263\\331\\276\\330\\247\\330\\261\\0\"\\\n  \"\\330\\263\\331\\206\\330\\257 \\330\\261\\330\\247 &\\330\\255\\330\\260\\331\\201 \\332\\251\\331\\206\\0\"\\\n  \"&\\330\\260\\330\\256\\333\\214\\330\\261\\331\\207 \\332\\251\\330\\261\\330\\257\\331\\206 \\330\\250\\330\\247 \\331\\206\\330\\247\\331\\205...\\0\"\\\n  \"&\\330\\260\\330\\256\\333\\214\\330\\261\\331\\207 \\332\\251\\330\\261\\330\\257\\331\\206 \\330\\250\\330\\247 \\331\\206\\330\\247\\331\\205...\\tCtrl+S\\0\"\\\n  \"&\\330\\252\\331\\206\\330\\270\\333\\214\\331\\205\\330\\247\\330\\252\\0\"\\\n  \"\\330\\265\\331\\201\\330\\255\\330\\247\\330\\252 \\330\\261\\330\\247 \\331\\205\\330\\252\\331\\206\\330\\247\\330\\263\\330\\250 \\330\\250\\330\\247 \\331\\206\\330\\247\\330\\255\\333\\214\\331\\207\\342\\200\\214\\333\\214 \\331\\202\\330\\247\\330\\250\\331\\204 \\332\\206\\330\\247\\331\\276 \\330\\261\\331\\210\\333\\214 \\332\\251\\330\\247\\330\\272\\330\\260 &\\330\\254\\331\\205\\330\\271 \\331\\210 \\330\\254\\331\\210\\330\\261 \\332\\251\\331\\206 (\\330\\247\\332\\257\\330\\261 \\331\\204\\330\\247\\330\\262\\331\\205 \\330\\247\\330\\263\\330\\252)\\0\"\\\n  \"&\\330\\252\\332\\251 \\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\330\\247\\333\\214\\tCtrl+6\\0\"\\\n  \"\\330\\247\\330\\262 \\330\\247\\333\\214\\331\\206 \\331\\206\\330\\263\\330\\256\\331\\207 &\\332\\206\\330\\264\\331\\205\\342\\200\\214\\331\\276\\331\\210\\330\\264\\333\\214 \\332\\251\\331\\206\\0\"\\\n  \"\\330\\247\\331\\206\\330\\257\\330\\247\\330\\262\\331\\207\\342\\200\\214\\333\\214 &\\331\\210\\330\\247\\331\\202\\330\\271\\333\\214 \\330\\265\\331\\201\\330\\255\\330\\247\\330\\252 \\330\\261\\330\\247 \\330\\250\\331\\207 \\332\\251\\330\\247\\330\\261 \\330\\250\\332\\257\\333\\214\\330\\261\\0\"\\\n  \"&\\331\\206\\331\\205\\330\\247\\333\\214\\330\\264\\0\"\\\n  \"&\\331\\276\\331\\206\\330\\254\\330\\261\\331\\207\\0\"\\\n  \"&\\330\\250\\331\\204\\333\\214\\0\"\\\n  \"&\\330\\250\\330\\262\\330\\261\\332\\257\\331\\206\\331\\205\\330\\247\\333\\214\\333\\214\\0\"\\\n  \"(\\330\\247\\330\\262 %d)\\0\"\\\n  \"(\\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\333\\214 %s)\\0\"\\\n  \"\\330\\257\\330\\261\\330\\250\\330\\247\\330\\261\\331\\207\\342\\200\\214\\333\\214 \\330\\250\\330\\261\\331\\206\\330\\247\\331\\205\\331\\207\\342\\200\\214\\333\\214 SumatraPDF\\0\"\\\n  \"\\330\\247\\331\\201\\330\\262\\331\\210\\330\\257\\331\\206 \\330\\250\\331\\207 \\330\\271\\331\\204\\330\\247\\331\\202\\331\\207\\342\\200\\214\\331\\205\\331\\206\\330\\257\\333\\214\\342\\200\\214\\331\\207\\330\\247\\0\"\\\n  \"\\330\\247\\331\\201\\330\\262\\331\\210\\330\\257\\331\\206 \\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\333\\214 %s \\330\\250\\331\\207 \\330\\271\\331\\204\\330\\247\\331\\202\\331\\207\\342\\200\\214\\331\\205\\331\\206\\330\\257\\333\\214\\342\\200\\214\\331\\207\\330\\247\\0\"\\\n  \"\\330\\247\\331\\201\\330\\262\\331\\210\\330\\257\\331\\206 \\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\333\\214 %s \\330\\250\\331\\207 \\330\\271\\331\\204\\330\\247\\331\\202\\331\\207\\342\\200\\214\\331\\205\\331\\206\\330\\257\\333\\214\\342\\200\\214\\331\\207\\330\\247 \\330\\250\\330\\247 \\331\\206\\330\\247\\331\\205\\333\\214 \\330\\247\\330\\256\\330\\252\\333\\214\\330\\247\\330\\261\\333\\214:\\0\"\\\n  \"\\330\\247\\331\\201\\330\\262\\331\\210\\330\\257\\331\\206 \\330\\250\\331\\207 \\330\\271\\331\\204\\330\\247\\331\\202\\331\\207\\342\\200\\214\\331\\205\\331\\206\\330\\257\\333\\214\\342\\200\\214\\331\\207\\330\\247\\0\"\\\n  \"\\330\\247\\331\\205\\332\\251\\330\\247\\331\\206\\330\\247\\330\\252 \\331\\276\\333\\214\\330\\264\\330\\261\\331\\201\\330\\252\\331\\207\\0\"\\\n  \"\\330\\252\\331\\205\\330\\247\\331\\205 \\331\\276\\330\\261\\331\\210\\331\\206\\330\\257\\331\\207\\342\\200\\214\\331\\207\\330\\247\\0\"\\\n  \"\\331\\207\\331\\205\\331\\207\\342\\200\\214\\333\\214 \\330\\247\\330\\263\\331\\206\\330\\247\\330\\257 \\331\\276\\330\\264\\330\\252\\333\\214\\330\\250\\330\\247\\331\\206\\333\\214 \\330\\264\\330\\257\\331\\207\\0\"\\\n  \":\\331\\206\\330\\261\\331\\205\\342\\200\\214\\330\\247\\331\\201\\330\\262\\330\\247\\330\\261\\0\"\\\n  \"\\331\\276\\330\\261\\331\\210\\331\\206\\330\\257\\331\\207\\342\\200\\214\\331\\207\\330\\247\\333\\214 PDF \\331\\207\\331\\205\\333\\214\\330\\264\\331\\207 \\330\\250\\330\\247 \\330\\247\\333\\214\\331\\206 \\330\\250\\330\\261\\331\\206\\330\\247\\331\\205\\331\\207 \\330\\256\\331\\210\\330\\247\\331\\206\\330\\257\\331\\207 \\330\\264\\331\\210\\331\\206\\330\\257\\330\\237\\0\"\\\n  \"\\331\\276\\333\\214\\331\\210\\330\\263\\330\\252: %s\\0\"\\\n  \"\\331\\205\\330\\244\\331\\204\\331\\201:\\0\"\\\n  \"\\330\\256\\331\\210\\330\\257\\332\\251\\330\\247\\330\\261\\0\"\\\n  \"\\330\\250\\330\\261\\330\\261\\330\\263\\333\\214 \\330\\256\\331\\210\\330\\257\\332\\251\\330\\247\\330\\261 \\330\\250\\330\\261\\330\\247\\333\\214 \\330\\250\\331\\207\\342\\200\\214\\330\\261\\331\\210\\330\\262\\330\\261\\330\\263\\330\\247\\331\\206\\333\\214\\342\\200\\214\\331\\207\\330\\247\\0\"\\\n  \"\\332\\251\\330\\252\\330\\247\\330\\250\\333\\214\\0\"\\\n  \"\\331\\206&\\330\\264\\330\\247\\331\\206\\332\\251\\342\\200\\214\\331\\207\\330\\247\\tF12\\0\"\\\n  \"\\331\\205\\333\\214\\330\\247\\331\\206\\330\\250\\330\\261\\331\\207\\330\\247\\333\\214 \\331\\206\\330\\264\\330\\247\\331\\206\\332\\251\\0\"\\\n  \"\\331\\205\\333\\214\\330\\247\\331\\206\\330\\250\\330\\261 \\330\\250\\331\\207 \\331\\206\\330\\264\\330\\247\\331\\206\\332\\251 \\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\333\\214 %s \\330\\247\\330\\262 %s\\0\"\\\n  \"\\331\\206\\330\\264\\330\\247\\331\\206\\332\\251\\342\\200\\214\\331\\207\\330\\247\\0\"\\\n  \"\\330\\250\\330\\247\\333\\214\\330\\252\\0\"\\\n  \"CHM \\330\\247\\330\\263\\331\\206\\330\\247\\330\\257\\0\"\\\n  \"\\331\\206\\331\\205\\333\\214\\342\\200\\214\\330\\252\\331\\210\\330\\247\\331\\206 \\330\\250\\331\\207 \\330\\247\\333\\214\\331\\206\\330\\252\\330\\261\\331\\206\\330\\252 \\331\\210\\330\\265\\331\\204 \\330\\264\\330\\257 (\\330\\256\\330\\267\\330\\247\\333\\214 %#x)\\0\"\\\n  \"\\331\\204\\330\\272\\331\\210\\0\"\\\n  \"\\331\\206\\331\\205\\333\\214\\342\\200\\214\\330\\252\\331\\210\\330\\247\\331\\206 \\330\\247\\333\\214\\331\\206 \\331\\276\\330\\261\\331\\210\\331\\206\\330\\257\\331\\207 \\330\\261\\330\\247 \\332\\206\\330\\247\\331\\276 \\332\\251\\330\\261\\330\\257\\0\"\\\n  \"\\330\\254\\330\\263\\330\\252\\330\\254\\331\\210\\333\\214 \\331\\205\\330\\271\\332\\251\\331\\210\\330\\263 \\331\\202\\330\\247\\330\\250\\331\\204 \\330\\247\\330\\254\\330\\261\\330\\247 \\331\\206\\333\\214\\330\\263\\330\\252. \\331\\204\\330\\267\\331\\201\\330\\247\\331\\213 \\330\\252\\331\\206\\330\\270\\333\\214\\331\\205\\330\\247\\330\\252 \\330\\256\\330\\267 \\331\\201\\330\\261\\331\\205\\330\\247\\331\\206 \\330\\261\\330\\247 \\330\\250\\330\\247\\330\\262\\330\\250\\333\\214\\331\\206\\333\\214 \\332\\251\\331\\206\\333\\214\\330\\257.\\0\"\\\n  \"\\330\\252\\330\\272\\333\\214\\333\\214\\330\\261 \\330\\262\\330\\250\\330\\247\\331\\206 (Change Language)\\0\"\\\n  \"\\330\\250\\330\\261\\330\\261\\330\\263\\333\\214 \\330\\250\\330\\261\\330\\247\\333\\214 \\330\\250\\331\\207\\342\\200\\214\\330\\261\\331\\210\\330\\262\\330\\261\\330\\263\\330\\247\\331\\206\\333\\214\\342\\200\\214\\331\\207\\330\\247\\0\"\\\n  \"\\332\\251\\330\\252\\330\\247\\330\\250\\342\\200\\214\\331\\207\\330\\247\\333\\214 \\331\\201\\331\\217\\332\\251\\330\\247\\331\\207\\333\\214\\0\"\\\n  \"\\330\\263\\330\\247\\330\\262\\332\\257\\330\\247\\330\\261\\333\\214\\0\"\\\n  \"\\331\\276\\333\\214\\331\\210\\330\\263\\330\\252\\331\\207\\0\"\\\n  \"\\332\\251\\330\\252\\330\\247\\330\\250\\333\\214 \\331\\276\\333\\214\\331\\210\\330\\263\\330\\252\\331\\207\\0\"\\\n  \"\\330\\257\\331\\210 \\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\330\\247\\333\\214 \\331\\276\\333\\214\\331\\210\\330\\263\\330\\252\\331\\207\\0\"\\\n  \"\\330\\257\\330\\261 \\330\\252\\330\\261\\330\\254\\331\\205\\331\\207\\342\\200\\214\\333\\214 \\330\\247\\333\\214\\331\\206 \\330\\250\\330\\261\\331\\206\\330\\247\\331\\205\\331\\207 \\332\\251\\331\\205\\332\\251 \\332\\251\\331\\206\\333\\214\\330\\257\\0\"\\\n  \"\\330\\261\\331\\210\\331\\206\\331\\210\\330\\264\\330\\252 \\330\\247\\330\\262 &\\330\\271\\332\\251\\330\\263\\0\"\\\n  \"\\330\\261\\331\\210\\331\\206\\331\\210\\330\\264\\330\\252 \\330\\247\\330\\262 \\331\\206\\330\\264\\330\\247\\331\\206\\333\\214 &\\331\\276\\333\\214\\331\\210\\331\\206\\330\\257\\0\"\\\n  \"\\330\\261\\331\\210\\331\\206\\331\\210\\330\\264\\330\\252 \\330\\247\\330\\262 \\330\\252\\331\\210&\\330\\266\\333\\214\\330\\255\\0\"\\\n  \"\\330\\261\\331\\210\\331\\206\\331\\210\\330\\264\\330\\252\\342\\200\\214\\332\\257\\333\\214\\330\\261\\333\\214 \\330\\247\\330\\262 \\331\\205\\330\\252\\331\\206 \\331\\205\\331\\205\\331\\206\\331\\210\\330\\271 \\330\\247\\330\\263\\330\\252 (\\330\\261\\331\\210\\331\\206\\331\\210\\330\\264\\330\\252 \\331\\201\\331\\202\\330\\267 \\330\\250\\331\\207 \\330\\265\\331\\210\\330\\261\\330\\252 \\330\\271\\332\\251\\330\\263)\\0\"\\\n  \"\\330\\255\\331\\202\\331\\221 \\331\\206\\330\\264\\330\\261\\0\"\\\n  \"\\331\\206\\331\\205\\333\\214\\342\\200\\214\\330\\252\\331\\210\\330\\247\\331\\206 \\330\\256\\330\\265\\331\\210\\330\\265\\333\\214\\330\\247\\330\\252 \\332\\206\\330\\247\\331\\276\\332\\257\\330\\261 \\330\\261\\330\\247 \\330\\250\\331\\207 \\330\\257\\330\\263\\330\\252 \\330\\242\\331\\210\\330\\261\\330\\257\\0\"\\\n  \"\\331\\205\\330\\252\\330\\247\\331\\224\\330\\263\\331\\201\\330\\247\\331\\206\\331\\207 \\332\\206\\330\\247\\331\\276\\332\\257\\330\\261 \\331\\205\\331\\206\\330\\252\\330\\256\\330\\250 \\330\\257\\330\\261 \\330\\257\\330\\263\\330\\252\\330\\261\\330\\263 \\331\\206\\333\\214\\330\\263\\330\\252\\0\"\\\n  \"\\331\\205\\330\\252\\330\\247\\331\\224\\330\\263\\331\\201\\330\\247\\331\\206\\331\\207 \\330\\265\\331\\201\\330\\255\\331\\207 \\331\\202\\330\\247\\330\\250\\331\\204 \\331\\206\\331\\205\\330\\247\\333\\214\\330\\264 \\331\\206\\333\\214\\330\\263\\330\\252\\0\"\\\n  \"\\330\\262\\331\\205\\330\\247\\331\\206 \\330\\247\\333\\214\\330\\254\\330\\247\\330\\257:\\0\"\\\n  \"\\331\\207\\331\\205\\333\\214\\331\\206 \\331\\276\\330\\261\\331\\210\\331\\206\\330\\257\\331\\207\\0\"\\\n  \"\\331\\205\\331\\210\\331\\202\\330\\271\\333\\214\\330\\252 \\331\\205\\332\\251\\330\\247\\331\\206\\342\\200\\214\\331\\206\\331\\205\\330\\247\\0\"\\\n  \"\\330\\250\\330\\262\\330\\261\\332\\257\\331\\206\\331\\205\\330\\247\\333\\214\\333\\214 &\\330\\263\\331\\201\\330\\247\\330\\261\\330\\264\\333\\214...\\tCtrl+Y\\0\"\\\n  \"&\\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\330\\250\\331\\206\\330\\257\\333\\214 \\331\\276\\333\\214\\330\\264\\342\\200\\214\\331\\201\\330\\261\\330\\266:\\0\"\\\n  \"&\\330\\250\\330\\262\\330\\261\\332\\257\\331\\206\\331\\205\\330\\247\\333\\214\\333\\214 \\331\\276\\333\\214\\330\\264\\342\\200\\214\\331\\201\\330\\261\\330\\266:\\0\"\\\n  \"\\331\\206\\331\\205\\333\\214\\342\\200\\214\\330\\252\\331\\210\\330\\247\\331\\206 \\330\\256\\331\\210\\330\\247\\331\\206\\331\\206\\330\\257\\331\\207\\342\\200\\214\\333\\214 \\331\\276\\333\\214\\330\\264\\342\\200\\214\\331\\201\\330\\261\\330\\266 \\331\\276\\330\\261\\331\\210\\331\\206\\330\\257\\331\\207\\342\\200\\214\\331\\207\\330\\247\\333\\214 PDF \\330\\261\\330\\247 \\330\\257\\330\\261 \\331\\206\\330\\263\\330\\256\\331\\207\\342\\200\\214\\333\\214 \\331\\202\\330\\247\\330\\250\\331\\204 \\330\\255\\331\\205\\331\\204 \\330\\252\\330\\272\\333\\214\\333\\214\\330\\261 \\330\\257\\330\\247\\330\\257.\\0\"\\\n  \"\\330\\257\\330\\263\\330\\252\\330\\261\\330\\263\\333\\214\\342\\200\\214\\331\\207\\330\\247\\333\\214 \\331\\205\\331\\205\\331\\206\\331\\210\\330\\271:\\0\"\\\n  \"DjVu \\330\\247\\330\\263\\331\\206\\330\\247\\330\\257\\0\"\\\n  \"\\331\\205\\330\\264\\330\\256\\330\\265\\330\\247\\330\\252 \\330\\263\\331\\206\\330\\257\\0\"\\\n  \"\\330\\257\\330\\261\\333\\214\\330\\247\\331\\201\\330\\252\\0\"\\\n  \"&\\330\\256\\330\\261\\331\\210\\330\\254\\tCtrl+Q\\0\"\\\n  \"EPUB \\330\\247\\330\\263\\331\\206\\330\\247\\330\\257\\0\"\\\n  \"\\332\\251\\331\\204\\331\\205\\331\\207\\342\\200\\214\\333\\214 \\330\\271\\330\\250\\331\\210\\330\\261 \\330\\261\\330\\247 \\331\\210\\330\\247\\330\\261\\330\\257 \\332\\251\\331\\206\\333\\214\\330\\257\\0\"\\\n  \"\\332\\251\\331\\204\\331\\205\\331\\207\\342\\200\\214\\333\\214 \\330\\271\\330\\250\\331\\210\\330\\261 \\330\\261\\330\\247 \\330\\250\\330\\261\\330\\247\\333\\214 %s \\331\\210\\330\\247\\330\\261\\330\\257 \\332\\251\\331\\206\\333\\214\\330\\257\\0\"\\\n  \"\\330\\256\\330\\267 \\330\\257\\330\\263\\330\\252\\331\\210\\330\\261 \\330\\261\\330\\247 \\330\\250\\330\\261\\330\\247\\333\\214 \\331\\201\\330\\261\\330\\247\\330\\256\\331\\210\\330\\247\\331\\206\\333\\214 \\331\\207\\331\\206\\332\\257\\330\\247\\331\\205 \\330\\257\\331\\210\\330\\250\\330\\247\\330\\261 \\332\\251\\331\\204\\333\\214\\332\\251 \\330\\261\\331\\210\\333\\214 \\330\\263\\331\\206\\330\\257 PDF \\331\\210\\330\\247\\330\\261\\330\\257 \\332\\251\\331\\206\\333\\214\\330\\257:\\0\"\\\n  \"\\330\\256\\330\\267\\330\\247 \\331\\207\\331\\206\\332\\257\\330\\247\\331\\205 \\330\\250\\330\\247\\330\\261\\332\\257\\330\\260\\330\\247\\330\\261\\333\\214 %s\\0\"\\\n  \"&\\330\\271\\331\\204\\330\\247\\331\\202\\331\\207\\342\\200\\214\\331\\205\\331\\206\\330\\257\\333\\214\\342\\200\\214\\331\\207\\330\\247\\0\"\\\n  \"\\330\\254\\330\\247\\333\\214 &\\330\\250\\330\\271\\330\\257\\333\\214\\tAlt+\\342\\206\\222\\342\\200\\216\\0\"\\\n  \"&\\330\\252\\331\\205\\330\\247\\331\\205\\342\\200\\214\\330\\265\\331\\201\\330\\255\\331\\207\\tCtrl+Shift+L\\0\"\\\n  \"\\331\\206\\331\\205\\330\\247\\333\\214\\330\\264 \\330\\257\\331\\210\\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\330\\247\\333\\214\\0\"\\\n  \"\\330\\252\\330\\272\\333\\214\\333\\214\\330\\261 \\331\\206\\330\\247\\331\\205 \\331\\276\\330\\261\\331\\210\\331\\206\\330\\257\\331\\207 \\331\\206\\330\\247\\331\\205\\331\\210\\331\\201\\331\\202 \\330\\250\\331\\210\\330\\257!\\0\"\\\n  \"\\330\\260\\330\\256\\333\\214\\330\\261\\331\\207 \\332\\251\\330\\261\\330\\257\\331\\206 \\331\\276\\330\\261\\331\\210\\331\\206\\330\\257\\331\\207 \\330\\250\\330\\247 \\330\\264\\332\\251\\330\\263\\330\\252 \\331\\205\\331\\210\\330\\247\\330\\254\\331\\207 \\330\\264\\330\\257\\0\"\\\n  \"\\331\\206\\331\\205\\330\\247\\333\\214\\330\\264 \\330\\250\\333\\214\\342\\200\\214\\330\\257\\330\\261\\331\\206\\332\\257\\0\"\\\n  \"\\330\\271\\331\\204\\330\\247\\331\\202\\331\\207\\342\\200\\214\\331\\205\\331\\206\\330\\257\\333\\214\\342\\200\\214\\331\\207\\330\\247\\0\"\\\n  \"\\330\\247\\330\\263\\331\\206\\330\\247\\330\\257 FictionBook\\0\"\\\n  \"\\331\\276\\330\\261\\331\\210\\331\\206\\330\\257\\331\\207 %s \\331\\276\\333\\214\\330\\257\\330\\247 \\331\\206\\330\\264\\330\\257\\0\"\\\n  \"\\330\\255\\330\\254\\331\\205 \\331\\276\\330\\261\\331\\210\\331\\206\\330\\257\\331\\207:\\0\"\\\n  \"\\331\\276\\330\\261\\331\\210\\331\\206\\330\\257\\331\\207:\\0\"\\\n  \"&\\330\\254\\330\\263\\330\\252\\330\\254\\331\\210...\\tCtrl+F\\0\"\\\n  \"\\330\\254\\330\\263\\330\\252\\330\\254\\331\\210\\0\"\\\n  \"\\331\\205\\331\\210\\330\\261\\330\\257 \\330\\250\\330\\271\\330\\257\\333\\214 \\330\\261\\330\\247 \\331\\276\\333\\214\\330\\257\\330\\247 \\332\\251\\331\\206\\0\"\\\n  \"\\331\\205\\331\\210\\330\\261\\330\\257 \\331\\202\\330\\250\\331\\204\\333\\214 \\330\\261\\330\\247 \\331\\276\\333\\214\\330\\257\\330\\247 \\332\\251\\331\\206\\0\"\\\n  \"\\330\\254\\330\\263\\330\\252\\330\\254\\331\\210:\\0\"\\\n  \"\\331\\205\\330\\252\\331\\206\\330\\247\\330\\263\\330\\250 \\332\\251\\330\\261\\330\\257\\331\\206 \\330\\250\\330\\247 &\\331\\205\\330\\255\\330\\252\\331\\210\\333\\214\\330\\247\\330\\252\\tCtrl+3\\0\"\\\n  \"\\330\\250\\331\\207 &\\330\\250\\330\\262\\330\\261\\332\\257\\333\\214 \\331\\276\\331\\206\\330\\254\\330\\261\\331\\207\\tCtrl+0\\0\"\\\n  \"\\330\\250\\331\\207 \\330\\250\\330\\262\\330\\261\\332\\257\\333\\214 &\\331\\276\\331\\207\\331\\206\\330\\247\\333\\214 \\331\\276\\331\\206\\330\\254\\330\\261\\331\\207\\tCtrl+2\\0\"\\\n  \"\\331\\205\\330\\252\\331\\206\\330\\247\\330\\263\\330\\250 \\332\\251\\330\\261\\330\\257\\331\\206 \\330\\250\\330\\247 \\331\\205\\330\\255\\330\\252\\331\\210\\333\\214\\330\\247\\330\\252\\0\"\\\n  \"\\330\\250\\331\\207 \\330\\250\\330\\262\\330\\261\\332\\257\\333\\214 \\331\\276\\331\\206\\330\\254\\330\\261\\331\\207\\0\"\\\n  \"\\330\\250\\331\\207 \\330\\250\\330\\262\\330\\261\\332\\257\\333\\214 \\331\\276\\331\\207\\331\\206\\330\\247\\333\\214 \\331\\276\\331\\206\\330\\254\\330\\261\\331\\207\\0\"\\\n  \"\\330\\265\\331\\201\\330\\255\\330\\247\\330\\252 \\330\\261\\330\\247 \\330\\250\\331\\207 \\330\\250\\330\\262\\330\\261\\332\\257\\333\\214 \\331\\276\\331\\207\\331\\206\\330\\247\\333\\214 \\331\\276\\331\\206\\330\\254\\330\\261\\331\\207 \\331\\210 \\330\\250\\331\\207 \\330\\265\\331\\210\\330\\261\\330\\252 \\331\\276\\333\\214\\331\\210\\330\\263\\330\\252\\331\\207 \\331\\206\\331\\205\\330\\247\\333\\214\\330\\264 \\330\\250\\330\\257\\331\\207\\0\"\\\n  \"\\331\\205\\330\\252\\331\\206\\330\\247\\330\\263\\330\\250 \\332\\251\\330\\261\\330\\257\\331\\206 \\333\\214\\332\\251 \\330\\265\\331\\201\\330\\255\\331\\207\\0\"\\\n  \"\\331\\202\\331\\204\\331\\205\\342\\200\\214\\331\\207\\330\\247:\\0\"\\\n  \"\\331\\202\\330\\247\\331\\204\\330\\250\\342\\200\\214\\330\\250\\331\\206\\330\\257\\333\\214 \\332\\251\\330\\252\\330\\247\\330\\250... %d \\330\\265\\331\\201\\330\\255\\331\\207\\0\"\\\n  \"\\331\\205\\330\\252\\331\\206 \\330\\257\\330\\261 \\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\333\\214 \\342\\200\\214%s \\331\\276\\333\\214\\330\\257\\330\\247 \\330\\264\\330\\257\\0\"\\\n  \"\\331\\205\\330\\252\\331\\206 \\330\\257\\330\\261 \\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\333\\214 \\342\\200\\214%s \\331\\276\\333\\214\\330\\257\\330\\247 \\330\\264\\330\\257 (\\330\\257\\331\\210\\330\\250\\330\\247\\330\\261\\331\\207)\\0\"\\\n  \"\\330\\242\\330\\256\\330\\261\\333\\214\\331\\206 \\332\\206\\333\\214\\330\\262\\331\\207\\330\\247\\333\\214\\333\\214 \\332\\251\\331\\207 \\330\\256\\331\\210\\330\\247\\331\\206\\330\\257\\331\\207\\342\\200\\214\\330\\247\\333\\214\\330\\257\\0\"\\\n  \"\\332\\257\\333\\214\\332\\257\\330\\247\\330\\250\\330\\247\\333\\214\\330\\252\\0\"\\\n  \"\\330\\250\\330\\261\\331\\210 \\330\\250\\331\\207 \\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\333\\214\\0\"\\\n  \"\\331\\276\\331\\206\\331\\207\\330\\247\\331\\206 \\332\\251\\330\\261\\330\\257\\331\\206 \\330\\242\\330\\256\\330\\261\\333\\214\\331\\206 \\332\\206\\333\\214\\330\\262\\331\\207\\330\\247\\333\\214\\333\\214 \\332\\251\\331\\207 \\330\\256\\331\\210\\330\\247\\331\\206\\330\\257\\331\\207\\342\\200\\214\\330\\247\\333\\214\\330\\257\\0\"\\\n  \"\\331\\206\\332\\251\\330\\252\\331\\207: \\330\\250\\330\\261\\330\\247\\333\\214 \\330\\254\\330\\263\\330\\252\\330\\254\\331\\210\\333\\214 \\331\\205\\330\\254\\330\\257\\330\\257 \\330\\247\\330\\262 \\332\\251\\331\\204\\333\\214\\330\\257 F3 \\330\\247\\330\\263\\330\\252\\331\\201\\330\\247\\330\\257\\331\\207 \\332\\251\\331\\206\\333\\214\\330\\257\\0\"\\\n  \"\\331\\276\\330\\261\\331\\210\\331\\206\\330\\257\\331\\207\\342\\200\\214\\331\\207\\330\\247\\333\\214 \\330\\252\\330\\265\\331\\210\\333\\214\\330\\261\\333\\214 (*.%s)\\0\"\\\n  \"\\332\\251\\333\\214\\331\\204\\331\\210\\330\\250\\330\\247\\333\\214\\330\\252\\0\"\\\n  \"\\331\\205\\332\\257\\330\\247\\330\\250\\330\\247\\333\\214\\330\\252\\0\"\\\n  \"\\331\\276\\330\\261\\331\\210\\331\\206\\330\\257\\331\\207\\342\\200\\214\\331\\207\\330\\247\\333\\214 PDF \\331\\207\\331\\205\\333\\214\\330\\264\\331\\207 \\330\\250\\330\\247 \\330\\247\\333\\214\\331\\206 \\330\\250\\330\\261\\331\\206\\330\\247\\331\\205\\331\\207 \\330\\256\\331\\210\\330\\247\\331\\206\\330\\257\\331\\207 \\330\\264\\331\\210\\331\\206\\330\\257\\330\\237\\0\"\\\n  \"\\330\\247\\331\\206\\330\\252\\330\\256\\330\\247\\330\\250 SumatraPDF \\330\\250\\331\\207 \\330\\271\\331\\206\\331\\210\\330\\247\\331\\206 \\330\\250\\330\\261\\331\\206\\330\\247\\331\\205\\331\\207\\342\\200\\214\\333\\214 \\331\\276\\333\\214\\330\\264\\342\\200\\214\\331\\201\\330\\261\\330\\266 \\331\\205\\331\\206 \\330\\250\\330\\261\\330\\247\\333\\214 \\330\\256\\331\\210\\330\\247\\331\\206\\330\\257\\331\\206 \\330\\247\\330\\263\\331\\206\\330\\247\\330\\257 PDF\\0\"\\\n  \"\\330\\255\\330\\247\\331\\204\\330\\252 \\331\\205\\330\\247\\331\\206\\332\\257\\330\\247\\0\"\\\n  \"\\330\\257\\331\\202\\333\\214\\331\\202\\330\\247 \\331\\205\\330\\253\\331\\204 \\330\\271\\330\\250\\330\\247\\330\\261\\330\\252 \\331\\210\\330\\247\\330\\261\\330\\257 \\330\\264\\330\\257\\331\\207\\0\"\\\n  \"Mobi \\330\\247\\330\\263\\331\\206\\330\\247\\330\\257\\0\"\\\n  \"\\330\\247\\330\\265\\331\\204\\330\\247\\330\\255 \\330\\264\\330\\257\\331\\207:\\0\"\\\n  \"\\331\\206\\330\\263\\330\\256\\331\\207 \\330\\254\\330\\257\\333\\214\\330\\257 %s \\331\\205\\331\\210\\330\\254\\331\\210\\330\\257 \\330\\247\\330\\263\\330\\252. \\330\\242\\331\\206 \\330\\261\\330\\247 \\330\\257\\330\\261\\333\\214\\330\\247\\331\\201\\330\\252 \\331\\205\\333\\214\\342\\200\\214\\332\\251\\331\\206\\333\\214\\330\\257\\330\\237\\0\"\\\n  \"\\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\333\\214 \\330\\250\\330\\271\\330\\257\\333\\214\\0\"\\\n  \"\\331\\205\\331\\210\\330\\261\\330\\257\\333\\214 \\333\\214\\330\\247\\331\\201\\330\\252 \\331\\206\\330\\264\\330\\257\\0\"\\\n  \"\\331\\207\\333\\214\\332\\206 \\331\\206\\330\\252\\333\\214\\330\\254\\331\\207\\342\\200\\214\\330\\247\\333\\214 \\330\\257\\330\\261 \\330\\256\\330\\267 %u \\330\\257\\330\\261 \\331\\276\\330\\261\\331\\210\\331\\206\\330\\257\\331\\207\\342\\200\\214\\333\\214 %s \\333\\214\\330\\247\\331\\201\\330\\252 \\331\\206\\330\\264\\330\\257\\0\"\\\n  \"\\331\\276\\330\\261\\331\\210\\331\\206\\330\\257\\331\\207 \\331\\207\\331\\205\\332\\257\\330\\247\\331\\205\\342\\200\\214\\330\\263\\330\\247\\330\\262\\333\\214 \\331\\205\\331\\210\\330\\254\\331\\210\\330\\257 \\331\\206\\333\\214\\330\\263\\330\\252\\0\"\\\n  \"\\331\\207\\333\\214\\332\\206 \\330\\247\\330\\267\\331\\204\\330\\247\\330\\271\\330\\247\\330\\252\\333\\214 \\330\\257\\330\\261 \\330\\247\\333\\214\\331\\206 \\331\\205\\330\\255\\331\\204 \\331\\207\\331\\205\\332\\257\\330\\247\\331\\205 \\331\\206\\330\\264\\330\\257\\0\"\\\n  \"\\330\\252\\330\\271\\330\\257\\330\\247\\330\\257 \\330\\265\\331\\201\\330\\255\\330\\247\\330\\252:\\0\"\\\n  \"\\330\\252\\330\\243\\333\\214\\333\\214\\330\\257\\0\"\\\n  \"\\330\\250\\330\\247\\330\\262 \\332\\251\\330\\261\\330\\257\\331\\206\\0\"\\\n  \"\\330\\250\\330\\247\\330\\262 \\332\\251\\330\\261\\330\\257\\331\\206 \\330\\257\\330\\261 PDF-&XChange\\0\"\\\n  \"\\330\\250\\330\\247\\330\\262 \\332\\251\\330\\261\\330\\257\\331\\206 \\333\\214\\332\\251 \\330\\263\\331\\206\\330\\257...\\0\"\\\n  \"\\330\\250\\330\\247\\330\\262 \\332\\251\\330\\261\\330\\257\\331\\206 \\330\\257\\330\\261 %s\\0\"\\\n  \"\\330\\250\\330\\247\\330\\262 \\332\\251\\330\\261\\330\\257\\331\\206 \\330\\257\\330\\261 &Adobe Reader\\0\"\\\n  \"\\330\\250\\330\\247\\330\\262 \\332\\251\\330\\261\\330\\257\\331\\206 \\330\\257\\330\\261 &Foxit Reader\\0\"\\\n  \"\\330\\250\\330\\247\\330\\262 \\332\\251\\330\\261\\330\\257\\331\\206 \\330\\257\\330\\261 &Microsoft HTML Help\\0\"\\\n  \"\\330\\250\\330\\247\\330\\262 \\332\\251\\330\\261\\330\\257\\331\\206 \\330\\257\\330\\261 Microsoft X&PS-Viewer\\0\"\\\n  \"\\331\\205&\\330\\264\\330\\256\\330\\265\\330\\247\\330\\252\\0\"\\\n  \"\\331\\205&\\330\\264\\330\\256\\330\\265\\330\\247\\330\\252\\tCtrl+D\\0\"\\\n  \"PDF \\330\\263\\331\\206\\330\\257\\0\"\\\n  \"PDF \\330\\250\\331\\207\\333\\214\\331\\206\\331\\207\\342\\200\\214\\330\\263\\330\\247\\330\\262\\333\\214\\0\"\\\n  \"\\330\\250\\330\\261\\331\\206\\330\\247\\331\\205\\331\\207\\342\\200\\214\\333\\214 \\330\\263\\330\\247\\330\\256\\330\\252 PDF:\\0\"\\\n  \"\\331\\206\\330\\263\\330\\256\\331\\207\\342\\200\\214\\333\\214 PDF:\\0\"\\\n  \"PDF \\330\\247\\330\\263\\331\\206\\330\\247\\330\\257\\0\"\\\n  \"&\\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\333\\214...\\tCtrl+G\\0\"\\\n  \"\\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\333\\214 %s\\0\"\\\n  \"\\330\\247\\330\\250\\330\\271\\330\\247\\330\\257 \\330\\265\\331\\201\\330\\255\\331\\207:\\0\"\\\n  \"\\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\333\\214 %u \\331\\205\\331\\210\\330\\254\\331\\210\\330\\257 \\331\\206\\333\\214\\330\\263\\330\\252\\0\"\\\n  \"\\331\\205\\331\\202\\333\\214\\330\\247\\330\\263\\342\\200\\214\\332\\257\\330\\260\\330\\247\\330\\261\\333\\214 \\330\\265\\331\\201\\330\\255\\331\\207\\0\"\\\n  \"\\330\\265\\331\\201\\330\\255\\331\\207:\\0\"\\\n  \"PalmDoc \\330\\247\\330\\263\\331\\206\\330\\247\\330\\257\\0\"\\\n  \"\\331\\204\\330\\267\\331\\201\\330\\247\\331\\213 \\330\\265\\330\\250\\330\\261 \\332\\251\\331\\206\\333\\214\\330\\257...\\0\"\\\n  \"Postscript \\330\\247\\330\\263\\331\\206\\330\\247\\330\\257\\0\"\\\n  \"\\330\\247\\330\\261\\330\\247&\\330\\246\\331\\207\\tF5\\0\"\\\n  \"\\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\333\\214 \\331\\202\\330\\250\\331\\204\\333\\214\\0\"\\\n  \"\\332\\206\\330\\247\\331\\276\\0\"\\\n  \"\\331\\205\\330\\255\\330\\257\\331\\210\\330\\257\\331\\207\\342\\200\\214\\333\\214 \\332\\206\\330\\247\\331\\276\\0\"\\\n  \"\\332\\206\\330\\247\\331\\276\\332\\257\\330\\261\\333\\214 \\330\\250\\330\\247 \\331\\206\\330\\247\\331\\205 \\330\\257\\330\\247\\330\\257\\331\\207 \\330\\264\\330\\257\\331\\207 \\331\\210\\330\\254\\331\\210\\330\\257 \\331\\206\\330\\257\\330\\247\\330\\261\\330\\257\\0\"\\\n  \"\\331\\201\\330\\261\\330\\242\\333\\214\\331\\206\\330\\257 \\332\\206\\330\\247\\331\\276 \\330\\257\\330\\261 \\330\\254\\330\\261\\333\\214\\330\\247\\331\\206 \\330\\247\\330\\263\\330\\252.\\0\"\\\n  \"\\331\\201\\330\\261\\330\\242\\333\\214\\331\\206\\330\\257 \\332\\206\\330\\247\\331\\276 \\331\\207\\331\\206\\331\\210\\330\\262 \\330\\257\\330\\261 \\330\\254\\330\\261\\333\\214\\330\\247\\331\\206 \\330\\247\\330\\263\\330\\252. \\330\\247\\331\\206\\330\\265\\330\\261\\330\\247\\331\\201 \\331\\210 \\330\\256\\330\\261\\331\\210\\330\\254\\330\\237\\0\"\\\n  \"\\331\\201\\330\\261\\330\\242\\333\\214\\331\\206\\330\\257 \\332\\206\\330\\247\\331\\276 \\331\\207\\331\\206\\331\\210\\330\\262 \\330\\257\\330\\261 \\330\\254\\330\\261\\333\\214\\330\\247\\331\\206 \\330\\247\\330\\263\\330\\252. \\330\\247\\331\\206\\330\\265\\330\\261\\330\\247\\331\\201 \\331\\210 \\330\\264\\330\\261\\331\\210\\330\\271 \\331\\205\\330\\254\\330\\257\\330\\257\\330\\237\\0\"\\\n  \"\\330\\257\\330\\261 \\330\\255\\330\\247\\331\\204 \\332\\206\\330\\247\\331\\276 \\332\\251\\330\\261\\330\\257\\331\\206 \\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\333\\214 %d \\330\\247\\330\\262 %d...\\0\"\\\n  \"\\331\\205\\330\\264\\332\\251\\331\\204 \\330\\257\\330\\261 \\332\\206\\330\\247\\331\\276.\\0\"\\\n  \"\\330\\252\\330\\272\\333\\214\\333\\214\\330\\261  &\\331\\206\\330\\247\\331\\205...\\tF2\\0\"\\\n  \"\\331\\276\\330\\261\\331\\210\\331\\206\\330\\257\\331\\207\\342\\200\\214\\331\\207\\330\\247\\333\\214 &\\330\\250\\330\\247\\330\\262 \\330\\261\\330\\247 \\330\\250\\331\\207 \\330\\256\\330\\247\\330\\267\\330\\261 \\330\\250\\330\\263\\331\\276\\330\\247\\330\\261\\0\"\\\n  \"\\330\\255\\330\\260\\331\\201 \\330\\247\\330\\262 \\330\\271\\331\\204\\330\\247\\331\\202\\331\\207\\342\\200\\214\\331\\205\\331\\206\\330\\257\\333\\214\\342\\200\\214\\331\\207\\330\\247\\0\"\\\n  \"\\330\\255\\330\\260\\331\\201 \\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\333\\214 %s \\330\\247\\330\\262 \\330\\271\\331\\204\\330\\247\\331\\202\\331\\207\\342\\200\\214\\331\\205\\331\\206\\330\\257\\333\\214\\342\\200\\214\\331\\207\\330\\247\\0\"\\\n  \"\\330\\252\\330\\272\\333\\214\\333\\214\\330\\261 \\331\\206\\330\\247\\331\\205 \\330\\250\\331\\207\\0\"\\\n  \"\\332\\206\\330\\261\\330\\256\\330\\247\\331\\206\\330\\257\\331\\206 \\330\\250\\331\\207 &\\332\\206\\331\\276\\tCtrl+Shift+-\\342\\200\\216\\0\"\\\n  \"\\332\\206\\330\\261\\330\\256\\330\\247\\331\\206\\330\\257\\331\\206 \\330\\250\\331\\207 &\\330\\261\\330\\247\\330\\263\\330\\252\\tCtrl+Shift++\\342\\200\\216\\0\"\\\n  \"\\330\\260\\330\\256\\333\\214\\330\\261\\331\\207 \\332\\251\\330\\261\\330\\257\\331\\206 \\330\\250\\330\\247 \\331\\206\\330\\247\\331\\205\\0\"\\\n  \"\\330\\260\\330\\256\\333\\214\\330\\261\\331\\207\\342\\200\\214\\333\\214 &\\331\\205\\333\\214\\330\\247\\331\\206\\330\\250\\330\\261...\\tCtrl+Shift+S\\0\"\\\n  \"\\330\\257\\330\\261 \\330\\255\\330\\247\\331\\204 \\330\\254\\330\\263\\330\\252\\330\\254\\331\\210\\333\\214 %d \\330\\247\\330\\262 %d...\\0\"\\\n  \"\\330\\247\\331\\206\\330\\252\\330\\256\\330\\247\\330\\250 &\\331\\207\\331\\205\\331\\207\\0\"\\\n  \"\\330\\247\\331\\206\\330\\252\\330\\256\\330\\247\\330\\250 &\\331\\207\\331\\205\\331\\207\\tCtrl+A\\0\"\\\n  \"\\330\\247\\331\\206\\330\\252\\330\\256\\330\\247\\330\\250 \\331\\205\\330\\255\\330\\252\\331\\210\\330\\247 \\330\\250\\330\\247 \\331\\206\\332\\257\\331\\207 \\330\\257\\330\\247\\330\\264\\330\\252\\331\\206 \\332\\251\\331\\204\\333\\214\\330\\257 Ctrl \\331\\210 \\332\\251\\331\\204\\333\\214\\330\\257 \\330\\263\\331\\205\\330\\252 \\332\\206\\331\\276 \\331\\205\\331\\210\\330\\264\\333\\214\\0\"\\\n  \"\\330\\247\\331\\206\\330\\252\\330\\256\\330\\247\\330\\250\\0\"\\\n  \"\\330\\247\\330\\261\\330\\263\\330\\247\\331\\204 \\330\\250\\330\\247 \\331\\276\\330\\263\\330\\252 \\330\\247&\\331\\204\\332\\251\\330\\252\\330\\261\\331\\210\\331\\206\\333\\214\\332\\251\\333\\214...\\0\"\\\n  \"\\330\\252\\331\\206\\330\\270\\333\\214\\331\\205 \\330\\256\\330\\267 \\331\\201\\330\\261\\331\\205\\330\\247\\331\\206 \\330\\254\\330\\263\\330\\252\\330\\254\\331\\210\\333\\214 \\331\\210\\330\\247\\330\\261\\331\\210\\331\\206\\331\\207\\0\"\\\n  \"\\331\\206&\\330\\264\\330\\247\\331\\206\\332\\251\\342\\200\\214\\331\\207\\330\\247 \\330\\261\\330\\247 \\331\\206\\330\\264\\330\\247\\331\\206 \\330\\250\\330\\257\\331\\207\\0\"\\\n  \"\\330\\250\\331\\207 \\330\\265\\331\\210\\330\\261\\330\\252 &\\331\\276\\333\\214\\331\\210\\330\\263\\330\\252\\331\\207\\0\"\\\n  \"\\331\\206\\331\\205\\330\\247\\333\\214\\330\\264 \\331\\206\\331\\210\\330\\247\\330\\261 &\\330\\247\\330\\250\\330\\262\\330\\247\\330\\261\\0\"\\\n  \"\\330\\271\\331\\204\\330\\247\\331\\202\\331\\207\\342\\200\\214\\331\\205\\331\\206\\330\\257\\333\\214\\342\\200\\214\\331\\207\\330\\247 \\330\\261\\330\\247 \\331\\206\\330\\264\\330\\247\\331\\206 \\330\\250\\330\\257\\331\\207\\0\"\\\n  \"\\331\\206\\330\\264\\330\\247\\331\\206 \\330\\257\\330\\247\\330\\257\\331\\206 \\330\\242\\330\\256\\330\\261\\333\\214\\331\\206 \\332\\206\\333\\214\\330\\262\\331\\207\\330\\247\\333\\214\\333\\214 \\332\\251\\331\\207 \\330\\256\\331\\210\\330\\247\\331\\206\\330\\257\\331\\207\\342\\200\\214\\330\\247\\333\\214\\330\\257\\0\"\\\n  \"\\331\\206\\331\\210\\330\\247\\330\\261 \\331\\206&\\330\\264\\330\\247\\331\\206\\332\\251\\342\\200\\214\\331\\207\\330\\247 \\330\\261\\330\\247 \\330\\257\\330\\261 \\330\\265\\331\\210\\330\\261\\330\\252 \\331\\210\\330\\254\\331\\210\\330\\257 \\331\\206\\330\\264\\330\\247\\331\\206 \\330\\250\\330\\257\\331\\207\\0\"\\\n  \"\\330\\252\\332\\251 \\330\\265\\331\\201\\330\\255\\331\\207\\342\\200\\214\\330\\247\\333\\214\\0\"\\\n  \"\\331\\205\\330\\252\\330\\243\\330\\263\\331\\201\\333\\214\\331\\205\\330\\214 \\331\\206\\330\\250\\330\\247\\333\\214\\330\\257 \\330\\247\\333\\214\\331\\206\\330\\267\\331\\210\\330\\261\\333\\214 \\331\\205\\333\\214\\342\\200\\214\\330\\264\\330\\257!\\n\\n \\331\\204\\330\\267\\331\\201\\330\\247\\331\\213 \\330\\247\\332\\257\\330\\261 \\331\\205\\330\\247\\333\\214\\331\\204\\333\\214\\330\\257 \\330\\252\\330\\247 \\330\\247\\333\\214\\331\\206 \\331\\205\\330\\264\\332\\251\\331\\204 \\330\\261\\330\\247 \\330\\250\\330\\261\\330\\267\\330\\261\\331\\201 \\332\\251\\331\\206\\333\\214\\331\\205\\330\\214 \\332\\251\\331\\204\\333\\214\\330\\257 \\331\\204\\330\\272\\331\\210 \\330\\261\\330\\247 \\330\\250\\330\\262\\331\\206\\333\\214\\330\\257.\\0\"\\\n  \"\\331\\276\\330\\261\\331\\210\\331\\206\\330\\257\\331\\207\\342\\200\\214\\333\\214 %s \\331\\206\\331\\202\\330\\247\\330\\267 \\331\\207\\331\\205\\332\\257\\330\\247\\331\\205\\342\\200\\214\\330\\263\\330\\247\\330\\262\\333\\214 \\331\\206\\330\\257\\330\\247\\330\\261\\330\\257\\0\"\\\n  \"\\331\\205\\331\\210\\330\\266\\331\\210\\330\\271:\\0\"\\\n  \" \\332\\257\\330\\262\\333\\214\\331\\206\\331\\207\\342\\200\\214\\331\\207\\330\\247\\333\\214 SumatraPDF\\0\"\\\n  \"\\330\\250\\331\\207\\342\\200\\214\\330\\261\\331\\210\\330\\262 \\330\\261\\330\\263\\330\\247\\331\\206\\333\\214 SumatraPDF\\0\"\\\n  \"SumatraPDF \\330\\247\\330\\262 \\332\\251\\330\\247\\330\\261 \\330\\247\\331\\201\\330\\252\\330\\247\\330\\257\\0\"\\\n  \"SumatraPDF \\330\\250\\330\\261\\331\\206\\330\\247\\331\\205\\331\\207\\342\\200\\214\\333\\214 \\331\\276\\333\\214\\330\\264\\342\\200\\214\\331\\201\\330\\261\\330\\266 \\330\\250\\330\\261\\330\\247\\333\\214 \\330\\256\\331\\210\\330\\247\\331\\206\\330\\257\\331\\206 \\331\\276\\330\\261\\331\\210\\331\\206\\330\\257\\331\\207\\342\\200\\214\\331\\207\\330\\247\\333\\214 PDF \\330\\264\\331\\205\\330\\247\\330\\263\\330\\252\\0\"\\\n  \"SumatraPDF \\330\\250\\330\\247\\333\\214\\330\\257 \\330\\247\\332\\251\\331\\206\\331\\210\\331\\206 \\330\\250\\330\\261\\331\\206\\330\\247\\331\\205\\331\\207\\342\\200\\214\\333\\214 \\331\\276\\333\\214\\330\\264\\342\\200\\214\\331\\201\\330\\261\\330\\266 PDF \\330\\256\\331\\210\\330\\247\\331\\206 \\330\\264\\331\\205\\330\\247 \\330\\250\\330\\247\\330\\264\\330\\257\\0\"\\\n  \"\\331\\276\\330\\261\\331\\210\\331\\206\\330\\257\\331\\207\\342\\200\\214\\333\\214 \\331\\207\\331\\205\\332\\257\\330\\247\\331\\205\\342\\200\\214\\330\\263\\330\\247\\330\\262\\333\\214 \\330\\250\\330\\247\\330\\262 \\331\\206\\331\\205\\333\\214\\342\\200\\214\\330\\264\\331\\210\\330\\257\\0\"\\\n  \"PDF \\330\\250\\330\\261\\332\\206\\330\\263\\330\\250\\342\\200\\214\\332\\257\\330\\260\\330\\247\\330\\261\\333\\214 \\330\\264\\330\\257\\331\\207\\0\"\\\n  \"\\330\\263\\331\\206\\330\\257 \\331\\205\\330\\252\\331\\206\\333\\214\\0\"\\\n  \"\\330\\247\\333\\214\\331\\206 \\330\\263\\331\\206\\330\\257 \\330\\255\\330\\247\\331\\210\\333\\214 \\331\\210\\333\\214\\332\\230\\332\\257\\333\\214\\342\\200\\214\\331\\207\\330\\247\\333\\214\\333\\214 \\330\\247\\330\\263\\330\\252 \\332\\251\\331\\207 \\330\\252\\331\\210\\330\\263\\330\\267 \\330\\247\\333\\214\\331\\206 \\330\\250\\330\\261\\331\\206\\330\\247\\331\\205\\331\\207 \\331\\276\\330\\264\\330\\252\\333\\214\\330\\250\\330\\247\\331\\206\\333\\214 \\331\\206\\331\\205\\333\\214\\342\\200\\214\\330\\264\\331\\210\\330\\257 (%s) \\331\\210 \\331\\205\\331\\205\\332\\251\\331\\206 \\330\\247\\330\\263\\330\\252 \\330\\250\\331\\207 \\330\\257\\330\\261\\330\\263\\330\\252\\333\\214 \\331\\206\\331\\205\\330\\247\\333\\214\\330\\264 \\330\\257\\330\\247\\330\\257\\331\\207 \\331\\206\\330\\264\\331\\210\\330\\257\\0\"\\\n  \"\\330\\271\\331\\206\\331\\210\\330\\247\\331\\206:\\0\"\\\n  \"\\331\\276\\330\\261\\331\\210\\331\\206\\330\\257\\331\\207\\342\\200\\214\\333\\214 \\331\\205\\331\\206\\330\\250\\330\\271 \\331\\206\\330\\247\\330\\264\\331\\206\\330\\247\\330\\256\\330\\252\\331\\207 (%s)\\0\"\\\n  \"\\330\\247\\330\\263\\330\\252\\331\\201\\330\\247\\330\\257\\331\\207 \\330\\247\\330\\262 &\\330\\263\\330\\261\\330\\250\\330\\261\\332\\257\\0\"\\\n  \"\\331\\206\\331\\205\\330\\247\\333\\214\\330\\264\\0\"\\\n  \"\\330\\250\\330\\247\\330\\262\\330\\257\\333\\214\\330\\257 \\330\\247\\330\\262 &\\331\\210\\330\\250\\342\\200\\214\\330\\263\\330\\247\\333\\214\\330\\252\\0\"\\\n  \"\\331\\207\\330\\264\\330\\257\\330\\247\\330\\261\\0\"\\\n  \"XPS \\330\\247\\330\\263\\331\\206\\330\\247\\330\\257\\0\"\\\n  \"\\331\\206\\330\\263\\330\\256\\331\\207\\342\\200\\214\\333\\214 \\330\\264\\331\\205\\330\\247 \\330\\254\\330\\257\\333\\214\\330\\257\\330\\252\\330\\261\\333\\214\\331\\206 \\331\\206\\330\\263\\330\\256\\331\\207 \\330\\247\\330\\263\\330\\252.\\0\"\\\n  \"\\330\\264\\331\\205\\330\\247 \\331\\206\\330\\263\\330\\256\\331\\207\\342\\200\\214\\333\\214 %s \\330\\261\\330\\247 \\330\\257\\330\\247\\330\\261\\333\\214\\330\\257\\0\"\\\n  \"\\330\\250\\330\\262\\330\\261\\332\\257\\331\\206\\331\\205\\330\\247\\333\\214\\333\\214\\0\"\\\n  \"\\330\\250\\330\\262\\330\\261\\332\\257 \\331\\206\\331\\205\\330\\247\\333\\214\\333\\214\\0\"\\\n  \"\\332\\251\\331\\210\\332\\206\\332\\251 \\331\\206\\331\\205\\330\\247\\333\\214\\333\\214\\0\"\\\n  \"\\330\\266\\330\\261\\333\\214\\330\\250 \\330\\250\\330\\262\\330\\261\\332\\257\\331\\206\\331\\205\\330\\247\\333\\214\\333\\214\\0\"\\\n  \"%s [\\330\\252\\330\\272\\333\\214\\333\\214\\330\\261\\330\\247\\330\\252 \\330\\264\\331\\206\\330\\247\\330\\263\\330\\247\\333\\214\\333\\214 \\330\\264\\330\\257\\330\\233 \\330\\252\\330\\247\\330\\262\\331\\207\\342\\200\\214\\330\\263\\330\\247\\330\\262\\333\\214]\\0\"\\\n  \"\\330\\257\\330\\261 \\330\\255\\330\\247\\331\\204 \\330\\261\\331\\210\\331\\206\\331\\210\\330\\264\\330\\252 \\331\\205\\330\\252\\331\\206\\0\"\\\n  \"\\330\\257\\330\\261 \\330\\255\\330\\247\\331\\204 \\332\\206\\330\\247\\331\\276 \\330\\263\\331\\206\\330\\257\\0\";\n\nconst char * gTranslations_pl = \n  \"&O SumatraPDF\\0\"\\\n  \"&Rozmiar rzeczywisty\\tCtrl+1\\0\"\\\n  \"Opcje zaawansowane...\\0\"\\\n  \"&Zaznaczone strony\\0\"\\\n  \"&Wstecz\\tAlt+W lewo\\0\"\\\n  \"Widok o&dczytu\\tCtrl+8\\0\"\\\n  \"&Zamknij\\tCtrl+W\\0\"\\\n  \"Kopiuj &zaznaczenie\\0\"\\\n  \"Kopiuj &zaznaczenie\\tCtrl+C\\0\"\\\n  \"&Nie pytaj wi\\304\\231cej\\0\"\\\n  \"Strony &parzyste\\0\"\\\n  \"&Wiele stron\\tCtrl+7\\0\"\\\n  \"&Plik\\0\"\\\n  \"&Szukaj:\\0\"\\\n  \"&Pierwsza strona\\tHome\\0\"\\\n  \"Dopasuj strony do rozmiaru &wydruku\\0\"\\\n  \"&Id\\305\\272 do\\0\"\\\n  \"Id\\305\\272 &do strony:\\0\"\\\n  \"&Pomoc\\0\"\\\n  \"&Ostatnia strona\\tEnd\\0\"\\\n  \"&Powi\\304\\231kszenie:\\0\"\\\n  \"Instrukcja o&bs\\305\\202ugi\\0\"\\\n  \"&Uwzgl\\304\\231dnij wielko\\305\\233\\304\\207 liter\\0\"\\\n  \"&Nast\\304\\231pna strona\\tW prawo\\0\"\\\n  \"&Nie\\0\"\\\n  \"Nie, &dzi\\304\\231kuj\\304\\231\\0\"\\\n  \"Strony &nieparzyste\\0\"\\\n  \"&Otw\\303\\263rz dokument\\0\"\\\n  \"&Otw\\303\\263rz\\342\\200\\246\\tCtrl+O\\0\"\\\n  \"&Opcje...\\0\"\\\n  \"&Has\\305\\202o:\\0\"\\\n  \"&Przypnij dokument\\0\"\\\n  \"&Poprzednia strona\\tW lewo\\0\"\\\n  \"&Drukuj...\\0\"\\\n  \"&Drukuj...\\tCtrl+P\\0\"\\\n  \"&Drukuj... (odm\\303\\263wiono)\\0\"\\\n  \"Pami\\304\\231taj &has\\305\\202o dla tego dokumentu\\0\"\\\n  \"Pami\\304\\231taj ustawienia dla &ka\\305\\274dego dokumentu\\0\"\\\n  \"&Usu\\305\\204 dokument\\0\"\\\n  \"Zapisz jako...\\0\"\\\n  \"Zapisz &jako...\\tCtrl+S\\0\"\\\n  \"&Ustawienia\\0\"\\\n  \"&Zmniejsz strony do rozmiaru wydruku (w razie potrzeby)\\0\"\\\n  \"&Pojedyncza strona\\tCtrl+6\\0\"\\\n  \"&Pomi\\305\\204 t\\304\\231 wersj\\304\\231\\0\"\\\n  \"U\\305\\274yj &oryginalnego rozmiaru stron\\0\"\\\n  \"&Widok\\0\"\\\n  \"&Okno\\0\"\\\n  \"&Tak\\0\"\\\n  \"Po&wi\\304\\231kszenie\\0\"\\\n  \"(z %d)\\0\"\\\n  \"(strona %s)\\0\"\\\n  \"O SumatraPDF\\0\"\\\n  \"Dodaj do ulubionych\\0\"\\\n  \"Dodaj stron\\304\\231 %s do ulubionych\\0\"\\\n  \"Dodaj stron\\304\\231 %s do ulubionych pod (opcjonaln\\304\\205) nazw\\304\\205:\\0\"\\\n  \"Dodaj do ulubionych\\0\"\\\n  \"Zaawansowane\\0\"\\\n  \"Wszystkie pliki\\0\"\\\n  \"Wszystkie obs\\305\\202ugiwane pliki\\0\"\\\n  \"Program:\\0\"\\\n  \"Skojarzy\\304\\207 z plikami PDF?\\0\"\\\n  \"Za\\305\\202\\304\\205cznik: %s\\0\"\\\n  \"Autor:\\0\"\\\n  \"Automatycznie\\0\"\\\n  \"&Szukaj aktualizacji automatycznie\\0\"\\\n  \"Widok odczytu\\0\"\\\n  \"&Zak\\305\\202adki\\tF12\\0\"\\\n  \"Zak\\305\\202adki\\0\"\\\n  \"Wstaw zak\\305\\202adk\\304\\231 do strony %s z %s\\0\"\\\n  \"Zak\\305\\202adki\\0\"\\\n  \"bajt\\303\\263w\\0\"\\\n  \"Dokumenty CHM\\0\"\\\n  \"Nie mo\\305\\274na po\\305\\202\\304\\205czy\\304\\207 z Internetem (b\\305\\202\\304\\205d %#x).\\0\"\\\n  \"Anuluj\\0\"\\\n  \"Nie mo\\305\\274na drukowa\\304\\207 tego pliku\\0\"\\\n  \"Nie mo\\305\\274na rozpocz\\304\\205\\304\\207 odwrotnego wyszukiwania. Prosz\\304\\231 sprawdzi\\304\\207 ustawienia wiersza polece\\305\\204.\\0\"\\\n  \"Zmie\\305\\204 j\\304\\231zyk (Change Language)\\0\"\\\n  \"Szukaj &aktualizacji\\0\"\\\n  \"Komiksy\\0\"\\\n  \"Zgodno\\305\\233\\304\\207\\0\"\\\n  \"Pojedyncza strona - uk\\305\\202ad ci\\304\\205g\\305\\202y\\0\"\\\n  \"Widok odczytu - uk\\305\\202ad ci\\304\\205g\\305\\202y\\0\"\\\n  \"Wiele stron - uk\\305\\202ad ci\\304\\205g\\305\\202y\\0\"\\\n  \"Dodaj swoje t\\305\\202umaczenie\\0\"\\\n  \"Kopiuj obraz\\0\"\\\n  \"Kopiuj adres z &odno\\305\\233nika\\0\"\\\n  \"Kopiuj ko&mentarz\\0\"\\\n  \"Nie mo\\305\\274na kopiowa\\304\\207 tekstu (mo\\305\\274na kopiowa\\304\\207 jako obrazy)\\0\"\\\n  \"Prawo autorskie:\\0\"\\\n  \"Nie mo\\305\\274na uzyska\\304\\207 w\\305\\202a\\305\\233ciwo\\305\\233ci drukarki\\0\"\\\n  \"Nie mo\\305\\274na zainicjowa\\304\\207 drukarki\\0\"\\\n  \"Nie mo\\305\\274na wy\\305\\233wietli\\304\\207 strony\\0\"\\\n  \"Utworzono:\\0\"\\\n  \"Bie\\305\\274\\304\\205cy plik\\0\"\\\n  \"Pozycja kursora:\\0\"\\\n  \"&W\\305\\202asne powi\\304\\231kszenie...\\tCtrl+Y\\0\"\\\n  \"&Uk\\305\\202ad domy\\305\\233lny:\\0\"\\\n  \"Domy\\305\\233lne &powi\\304\\231kszenie:\\0\"\\\n  \"Domy\\305\\233lna przegl\\304\\205darka PDF nie mo\\305\\274e by\\304\\207 zmieniona w trybie przeno\\305\\233nym\\0\"\\\n  \"Brak zezwole\\305\\204:\\0\"\\\n  \"Dokumenty DjVu\\0\"\\\n  \"W\\305\\202a\\305\\233ciwo\\305\\233ci dokumentu\\0\"\\\n  \"Pobierz\\0\"\\\n  \"&Wyj\\305\\233cie\\tCtrl+Q\\0\"\\\n  \"Dokumenty EPUB\\0\"\\\n  \"Podaj has\\305\\202o\\0\"\\\n  \"Podaj has\\305\\202o dla %s\\0\"\\\n  \"Podaj polecenie wykonywane po dwukrotnym klikni\\304\\231ciu pliku PDF:\\0\"\\\n  \"B\\305\\202\\304\\205d \\305\\202adowania pliku %s\\0\"\\\n  \"&Ulubione\\0\"\\\n  \"&Dalej\\tAlt+W prawo\\0\"\\\n  \"Pe\\305\\202ny ekran\\tCtrl+Shift+L\\0\"\\\n  \"Wiele stron\\0\"\\\n  \"B\\305\\202\\304\\205d zmiany nazwy pliku!\\0\"\\\n  \"B\\305\\202\\304\\205d zapisywania pliku\\0\"\\\n  \"Szybkie wy\\305\\233wietlanie w Internecie\\0\"\\\n  \"Ulubione\\0\"\\\n  \"Dokumenty FictionBook\\0\"\\\n  \"Nie znaleziono pliku %s\\0\"\\\n  \"Rozmiar pliku:\\0\"\\\n  \"Plik:\\0\"\\\n  \"&Znajd\\305\\272...\\tCtrl+F\\0\"\\\n  \"Znajd\\305\\272\\0\"\\\n  \"Znajd\\305\\272 nast\\304\\231pny\\0\"\\\n  \"Znajd\\305\\272 poprzedni\\0\"\\\n  \"Znajd\\305\\272:\\0\"\\\n  \"Dopasuj do &zawarto\\305\\233ci\\tCtrl+3\\0\"\\\n  \"Dopasuj do s&trony\\tCtrl+0\\0\"\\\n  \"Dopasuj do sz&eroko\\305\\233ci\\tCtrl+2\\0\"\\\n  \"Dopasuj do zawarto\\305\\233ci strony\\0\"\\\n  \"Dopasuj do ca\\305\\202ej strony\\0\"\\\n  \"Dopasuj szeroko\\305\\233ci strony\\0\"\\\n  \"Dopasuj szeroko\\305\\233\\304\\207 i wy\\305\\233wietlaj strony w uk\\305\\202adzie ci\\304\\205g\\305\\202ym\\0\"\\\n  \"Dopasuj pojedyncz\\304\\205 stron\\304\\231\\0\"\\\n  \"Czcionki:\\0\"\\\n  \"Formatowanie ksi\\304\\205\\305\\274ki... %d stron\\0\"\\\n  \"Znaleziono tekst na stronie %s\\0\"\\\n  \"Znaleziono tekst na stronie %s (znowu)\\0\"\\\n  \"Ostatnio otwierane\\0\"\\\n  \"\\0\"\\\n  \"Przejd\\305\\272 do strony\\0\"\\\n  \"Ukryj ostatnio otwierane\\0\"\\\n  \"Wskaz\\303\\263wka: u\\305\\274yj klawisza F3, aby szuka\\304\\207 dalej\\0\"\\\n  \"Pliki graficzne (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Ustawi\\304\\207 program SumatraPDF jako domy\\305\\233ln\\304\\205 przegl\\304\\205dark\\304\\231 plik\\303\\263w PDF?\\0\"\\\n  \"Ustaw SumatraPDF jako domy\\305\\233ln\\304\\205 przegl\\304\\205dark\\304\\231 PDF\\0\"\\\n  \"Tryb mangi\\0\"\\\n  \"Uwzgl\\304\\231dnij wielko\\305\\233\\304\\207 liter\\0\"\\\n  \"Dokumenty Mobi\\0\"\\\n  \"Zmodyfikowano:\\0\"\\\n  \"Nowa wersja %s jest dost\\304\\231pna. Pobra\\304\\207 now\\304\\205 wersj\\304\\231?\\0\"\\\n  \"&Nast\\304\\231pna strona\\0\"\\\n  \"Nie znaleziono wynik\\303\\263w\\0\"\\\n  \"Nie znaleziono wynik\\303\\263w w okolicach wiersza %u w pliku %s\\0\"\\\n  \"Nie znaleziono pliku synchronizacji\\0\"\\\n  \"Brak informacji o synchronizacji w tej pozycji\\0\"\\\n  \"Liczba stron:\\0\"\\\n  \"\\0\"\\\n  \"Otw\\303\\263rz\\0\"\\\n  \"Otw\\303\\263rz w PDF-XChange\\0\"\\\n  \"Otw\\303\\263rz dokument...\\0\"\\\n  \"Otw\\303\\263rz w %s\\0\"\\\n  \"Otw\\303\\263rz w &Adobe Reader\\0\"\\\n  \"Otw\\303\\263rz w &Foxit Reader\\0\"\\\n  \"Otw\\303\\263rz w Microsoft HTML Help\\0\"\\\n  \"Otw\\303\\263rz w Microsoft XPS-Viewer\\0\"\\\n  \"W\\305\\202a\\305\\233ciwo\\305\\233ci\\0\"\\\n  \"&W\\305\\202a\\305\\233ciwo\\305\\233ci\\tCtrl+D\\0\"\\\n  \"Dokument PDF\\0\"\\\n  \"Optymalizacja PDF:\\0\"\\\n  \"Producent PDF:\\0\"\\\n  \"Wersja PDF:\\0\"\\\n  \"Dokumenty PDF\\0\"\\\n  \"&Strona...\\tCtrl+G\\0\"\\\n  \"Strona %s\\0\"\\\n  \"Rozmiar strony:\\0\"\\\n  \"Brak strony o numerze %u\\0\"\\\n  \"Skalowanie strony\\0\"\\\n  \"Strona:\\0\"\\\n  \"Dokumenty PalmDoc\\0\"\\\n  \"Prosz\\304\\231 czeka\\304\\207 - renderowanie...\\0\"\\\n  \"Dokumenty postscript\\0\"\\\n  \"&Prezentacja\\tCtrl+L\\0\"\\\n  \"Poprzednia strona\\0\"\\\n  \"Drukuj\\0\"\\\n  \"Zakres druku\\0\"\\\n  \"Drukarka o podanej nazwie nie istnieje\\0\"\\\n  \"Trwa drukowanie.\\0\"\\\n  \"Nadal trwa drukowanie. Przerwa\\304\\207 i wyj\\305\\233\\304\\207?\\0\"\\\n  \"Nadal trwa drukowanie. Przerwa\\304\\207 i zacz\\304\\205\\304\\207 od nowa?\\0\"\\\n  \"Drukowanie strony %d z %d...\\0\"\\\n  \"Problem z drukowaniem.\\0\"\\\n  \"Zmie\\305\\204 &nazw\\304\\231...\\tF2\\0\"\\\n  \"Pami\\304\\231taj &otwierane pliki\\0\"\\\n  \"Usu\\305\\204 z ulubionych\\0\"\\\n  \"Usu\\305\\204 stron\\304\\231 %s z ulubionych\\0\"\\\n  \"Zmie\\305\\204 nazw\\304\\231 na\\0\"\\\n  \"Obr\\303\\263\\304\\207 w &lewo\\tCtrl+Shift+Minus\\0\"\\\n  \"Obr\\303\\263\\304\\207 w &prawo\\tCtrl+Shift+Plus\\0\"\\\n  \"Zapisz jako\\0\"\\\n  \"Utw\\303\\263rz skr\\303\\263t do dokumentu\\tCtrl+Shift+S\\0\"\\\n  \"Szukanie %d z %d...\\0\"\\\n  \"Zaznacz wszystko\\0\"\\\n  \"Zaznacz &wszystko\\tCtrl+A\\0\"\\\n  \"Zaznacz zawarto\\305\\233\\304\\207 wciskaj\\304\\205c Ctrl i lewy przycisk myszy\\0\"\\\n  \"Selekcja:\\0\"\\\n  \"Do\\305\\202\\304\\205cz do wiadomo\\305\\233ci &e-mail...\\0\"\\\n  \"Ustaw wiersz polece\\305\\204 do odwrotnego wyszukiwania\\0\"\\\n  \"Poka\\305\\274 &Zak\\305\\202adki\\0\"\\\n  \"Wy\\305\\233wietlaj strony w uk\\305\\202adzie &ci\\304\\205g\\305\\202ym\\0\"\\\n  \"Poka\\305\\274 pasek &narz\\304\\231dzi\\0\"\\\n  \"Poka\\305\\274 ulubione\\0\"\\\n  \"Poka\\305\\274 cz\\304\\231sto otwierane\\0\"\\\n  \"Poka\\305\\274 panel za&k\\305\\202adek, gdy s\\304\\205 dost\\304\\231pne\\0\"\\\n  \"Pojedyncza strona\\0\"\\\n  \"Przepraszamy - to nie powinno si\\304\\231 zdarzy\\304\\207!\\n\\nProsz\\304\\231 nacisn\\304\\205\\304\\207 przycisk 'Anuluj', je\\305\\274eli chcesz pom\\303\\263c nam w usuni\\304\\231ciu tego problemu.\\0\"\\\n  \"Plik \\305\\272r\\303\\263d\\305\\202owy %s nie posiada punkt\\303\\263w synchronizacji\\0\"\\\n  \"Temat:\\0\"\\\n  \"Opcje SumatraPDF\\0\"\\\n  \"Aktualizacja SumatraPDF\\0\"\\\n  \"SumatraPDF uleg\\305\\202 awarii\\0\"\\\n  \"SumatraPDF jest domy\\305\\233ln\\304\\205 przegl\\304\\205dark\\304\\205 PDF\\0\"\\\n  \"SumatraPDF powinien by\\304\\207 teraz domy\\305\\233ln\\304\\205 przegl\\304\\205dark\\304\\205 PDF\\0\"\\\n  \"Nie mo\\305\\274na otworzy\\304\\207 pliku synchronizacji\\0\"\\\n  \"Tagowany plik PDF\\0\"\\\n  \"Pliki tekstowe\\0\"\\\n  \"Ten dokument u\\305\\274ywa niewspieranych funkcji (%s) i mo\\305\\274e wy\\305\\233wietla\\304\\207 si\\304\\231 niepoprawnie\\0\"\\\n  \"Tytu\\305\\202:\\0\"\\\n  \"Nieznany plik \\305\\272r\\303\\263d\\305\\202owy (%s)\\0\"\\\n  \"W\\305\\202\\304\\205cz wy\\305\\233wietlanie &kart\\0\"\\\n  \"Widok\\0\"\\\n  \"Odwied\\305\\272 &stron\\304\\231 internetow\\304\\205\\0\"\\\n  \"Uwaga\\0\"\\\n  \"Pliki XPS\\0\"\\\n  \"Masz najnowsz\\304\\205 wersj\\304\\231.\\0\"\\\n  \"Masz wersj\\304\\231 %s.\\0\"\\\n  \"Powi\\304\\231kszenie\\0\"\\\n  \"Powi\\304\\231ksz\\0\"\\\n  \"Zmniejsz\\0\"\\\n  \"Wsp\\303\\263\\305\\202czynnik powi\\304\\231kszenia\\0\"\\\n  \"[wykryto zmiany; od\\305\\233wie\\305\\274anie] %s\\0\"\\\n  \"kopiowanie tekstu\\0\"\\\n  \"drukowanie dokumentu\\0\";\n\nconst char * gTranslations_br = \n  \"S&obre\\0\"\\\n  \"&Tamanho real\\tCtrl+1\\0\"\\\n  \"Op\\303\\247\\303\\265es &Avan\\303\\247adas...\\0\"\\\n  \"Tod&as as p\\303\\241ginas selecionadas\\0\"\\\n  \"Voltar\\tAlt+<-\\0\"\\\n  \"Visualizar como livro\\tCtrl+8\\0\"\\\n  \"&Fechar\\tCtrl+W\\0\"\\\n  \"&Copiar Sele\\303\\247\\303\\243o\\0\"\\\n  \"Copiar sele\\303\\247\\303\\243o\\tCtrl+C\\0\"\\\n  \"N\\303\\243o perguntar novamente\\0\"\\\n  \"Apenas as p\\303\\241ginas par&es\\0\"\\\n  \"P\\303\\241gina dupla\\tCtrl+7\\0\"\\\n  \"&Arquivo\\0\"\\\n  \"&Localizar o qu\\303\\252:\\0\"\\\n  \"Primeira p\\303\\241gina\\tHome\\0\"\\\n  \"Ajustar p\\303\\241ginas \\303\\240 \\303\\241rea de impress\\303\\243o\\0\"\\\n  \"&Ir para\\0\"\\\n  \"&Ir para a p\\303\\241gina:\\0\"\\\n  \"Aj&uda\\0\"\\\n  \"\\303\\232ltima p\\303\\241gina\\tEnd\\0\"\\\n  \"Aumento:\\0\"\\\n  \"Manual\\0\"\\\n  \"Diferenciar min\\303\\272sculas e mai\\303\\272sculas\\0\"\\\n  \"P\\303\\241gina seguinte\\t->\\0\"\\\n  \"&N\\303\\243o\\0\"\\\n  \"&N\\303\\243o, obrigado\\0\"\\\n  \"Apenas as p\\303\\241ginas \\303\\255mpares\\0\"\\\n  \"Abrir d&ocumento\\0\"\\\n  \"A&brir...\\tCtrl+O\\0\"\\\n  \"&Op\\303\\247\\303\\265es...\\0\"\\\n  \"&Senha:\\0\"\\\n  \"Fixar documento\\0\"\\\n  \"P\\303\\241gina anterior\\t<-\\0\"\\\n  \"Im&primir...\\0\"\\\n  \"&Imprimir\\tCtrl+P\\0\"\\\n  \"&Imprimir... (negado)\\0\"\\\n  \"Lembra&r a senha deste documento\\0\"\\\n  \"Lembrar estas prefer\\303\\252ncias para cada documento\\0\"\\\n  \"&Remover documento\\0\"\\\n  \"&Salvar como...\\0\"\\\n  \"&Salvar como...\\tCtrl+S\\0\"\\\n  \"&Prefer\\303\\252ncias\\0\"\\\n  \"Reduzir p\\303\\241gina&s \\303\\240 \\303\\241rea de impress\\303\\243o (se necess\\303\\241rio)\\0\"\\\n  \"P\\303\\241gina \\303\\272nica\\tCtrl+6\\0\"\\\n  \"Ignorar esta vers\\303\\243o\\0\"\\\n  \"&Usar tamanhos de p\\303\\241gina originais\\0\"\\\n  \"&Ver\\0\"\\\n  \"&Janela\\0\"\\\n  \"&Sim\\0\"\\\n  \"\\0\"\\\n  \"(de %d)\\0\"\\\n  \"(p\\303\\241gina %s)\\0\"\\\n  \"Sobre o SumatraPDF\\0\"\\\n  \"Adicionar Favorito\\0\"\\\n  \"Adicionar p\\303\\241gina %s aos Favoritos\\0\"\\\n  \"Adicionar p\\303\\241gina %s aos Favoritos com outro nome (opcional):\\0\"\\\n  \"Adicionar aos Favoritos\\0\"\\\n  \"Avan\\303\\247ado\\0\"\\\n  \"Todos os arquivos\\0\"\\\n  \"Todos os documentos suportados\\0\"\\\n  \"Aplicativo:\\0\"\\\n  \"Associar com arquivos PDF?\\0\"\\\n  \"Anexo: %s\\0\"\\\n  \"Autor:\\0\"\\\n  \"Autom\\303\\241tico\\0\"\\\n  \"&Procurar atualiza\\303\\247\\303\\265es automaticamente\\0\"\\\n  \"Ver como livro\\0\"\\\n  \"Marcadores\\tF12\\0\"\\\n  \"Atalhos de Favoritos\\0\"\\\n  \"Atalho para a p\\303\\241gina %s de %s\\0\"\\\n  \"Marcadores\\0\"\\\n  \"\\0\"\\\n  \"Documentos CHM\\0\"\\\n  \"Falha na conex\\303\\243o \\303\\240 Internet (erro %#x).\\0\"\\\n  \"Cancelar\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel imprimir este arquivo\\0\"\\\n  \"N\\303\\243o \\303\\251 poss\\303\\255vel acionar a pesquisa inversa. Verifique a linha de comando nas prefer\\303\\252ncias.\\0\"\\\n  \"Mudar o idioma (Change Language)\\0\"\\\n  \"Procurar Atualiza\\303\\247\\303\\265es\\0\"\\\n  \"Quadrinhos\\0\"\\\n  \"Compatibilidade\\0\"\\\n  \"Cont\\303\\255nuo\\0\"\\\n  \"Ver como livro cont\\303\\255nuo\\0\"\\\n  \"P\\303\\241gina dupla cont\\303\\255nua\\0\"\\\n  \"\\0\"\\\n  \"Copiar &Imagem\\0\"\\\n  \"Copiar Ata&lho\\0\"\\\n  \"Copiar Co&ment\\303\\241rio\\0\"\\\n  \"C\\303\\263pia de texto negada (copiando somente como imagem)\\0\"\\\n  \"Direito autoral:\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel obter as propriedades da Impressora\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel acionar a impressora\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel renderizar a p\\303\\241gina\\0\"\\\n  \"Criado:\\0\"\\\n  \"Arquivo atual\\0\"\\\n  \"Posi\\303\\247\\303\\243o do cursor:\\0\"\\\n  \"&Zoom personalizado...\\tCtrl+Y\\0\"\\\n  \"&Visualiza\\303\\247\\303\\243o Padr\\303\\243o\\0\"\\\n  \"&Zoom Padr\\303\\243o\\0\"\\\n  \"N\\303\\243o \\303\\251 poss\\303\\255vel alterar o leitor PDF padr\\303\\243o no modo port\\303\\241til\\0\"\\\n  \"Permiss\\303\\265es negadas:\\0\"\\\n  \"Documentos DjVu\\0\"\\\n  \"Propriedades do Documento\\0\"\\\n  \"Baixar\\0\"\\\n  \"Sai&r\\tCtrl+Q\\0\"\\\n  \"Documentos EPUB\\0\"\\\n  \"Digite a senha\\0\"\\\n  \"Digite a senha de %s\\0\"\\\n  \"Digite a linha de comando a ser invocada com um duplo clique sobre o documento PDF:\\0\"\\\n  \"Erro ao carregar %s\\0\"\\\n  \"&Favoritos\\0\"\\\n  \"Avan\\303\\247ar\\tAlt+->\\0\"\\\n  \"Tela cheia\\tCtrl+Shift+L\\0\"\\\n  \"P\\303\\241gina dupla\\0\"\\\n  \"Falha ao renomear o arquivo!\\0\"\\\n  \"Erro ao salvar o arquivo.\\0\"\\\n  \"Visualiza\\303\\247\\303\\243o r\\303\\241pida na Web\\0\"\\\n  \"Favoritos\\0\"\\\n  \"Documentos FictionBook\\0\"\\\n  \"Arquivo %s n\\303\\243o encontrado\\0\"\\\n  \"Tamanho do arquivo:\\0\"\\\n  \"Arquivo:\\0\"\\\n  \"Localizar...\\tCtrl+F\\0\"\\\n  \"Localizar\\0\"\\\n  \"Localizar pr\\303\\263ximo\\0\"\\\n  \"Localizar anterior\\0\"\\\n  \"Localizar:\\0\"\\\n  \"Ajustar ao &conte\\303\\272do\\tCtrl+3\\0\"\\\n  \"&P\\303\\241gina inteira\\tCtrl+0\\0\"\\\n  \"Ajustar pela l&argura\\tCtrl+2\\0\"\\\n  \"Ajustar ao conte\\303\\272do\\0\"\\\n  \"P\\303\\241gina inteira\\0\"\\\n  \"Ajustar pela largura\\0\"\\\n  \"Ajustar pela largura e exibir p\\303\\241ginas de modo cont\\303\\255nuo\\0\"\\\n  \"Ajustar em uma \\303\\272nica p\\303\\241gina\\0\"\\\n  \"Fontes:\\0\"\\\n  \"Formatando o livro... %d p\\303\\241ginas\\0\"\\\n  \"Texto encontrado na p\\303\\241gina %s\\0\"\\\n  \"Texto encontrado (de novo) na p\\303\\241gina %s\\0\"\\\n  \"Lidos com frequ\\303\\252ncia\\0\"\\\n  \"\\0\"\\\n  \"Ir para a p\\303\\241gina\\0\"\\\n  \"Ocultar Lidos com frequ\\303\\252ncia\\0\"\\\n  \"Dica: tecle F3 para achar a pr\\303\\263xima ocorr\\303\\252ncia\\0\"\\\n  \"Arquivos de imagem (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Fazer do SumatraPDF o programa padr\\303\\243o para arquivos PDF?\\0\"\\\n  \"Tornar o SumatraPDF o leitor PDF padr\\303\\243o\\0\"\\\n  \"Modo Man&g\\303\\241\\0\"\\\n  \"Diferenciar min\\303\\272sculas e mai\\303\\272sculas\\0\"\\\n  \"Documentos Mobi\\0\"\\\n  \"Modificado:\\0\"\\\n  \"A vers\\303\\243o %s est\\303\\241 dispon\\303\\255vel. Baixar a nova vers\\303\\243o?\\0\"\\\n  \"P\\303\\241gina seguinte\\0\"\\\n  \"Nenhuma ocorr\\303\\252ncia encontrada\\0\"\\\n  \"Nenhum resultado pr\\303\\263ximo \\303\\240 linha %u no arquivo %s\\0\"\\\n  \"Nenhum arquivo de sincroniza\\303\\247\\303\\243o foi encontrado\\0\"\\\n  \"N\\303\\243o h\\303\\241 informa\\303\\247\\303\\243o de sincroniza\\303\\247\\303\\243o nesta posi\\303\\247\\303\\243o\\0\"\\\n  \"N\\303\\272mero de p\\303\\241ginas:\\0\"\\\n  \"\\0\"\\\n  \"Abrir\\0\"\\\n  \"Abrir no PDF-XChange\\0\"\\\n  \"Abrir um documento...\\0\"\\\n  \"Abrir em %s\\0\"\\\n  \"Abrir no &Adobe Reader\\0\"\\\n  \"Abrir no &Foxit Reader\\0\"\\\n  \"Abrir no Microsoft HTML Help\\0\"\\\n  \"Abrir no Microsoft XPS-Viewer\\0\"\\\n  \"P&ropriedades\\0\"\\\n  \"Propriedades...\\tCtrl+D\\0\"\\\n  \"Documento PDF\\0\"\\\n  \"Otimiza\\303\\247\\303\\265es PDF:\\0\"\\\n  \"Produtor do PDF:\\0\"\\\n  \"Vers\\303\\243o do PDF:\\0\"\\\n  \"Documentos PDF\\0\"\\\n  \"P\\303\\241gina...\\tCtrl+G\\0\"\\\n  \"P\\303\\241gina %s\\0\"\\\n  \"Tamanho da p\\303\\241gina:\\0\"\\\n  \"A p\\303\\241gina %u n\\303\\243o existe\\0\"\\\n  \"Ajuste da p\\303\\241gina\\0\"\\\n  \"P\\303\\241gina:\\0\"\\\n  \"Documentos PalmDoc\\0\"\\\n  \"Por favor aguarde, renderizando...\\0\"\\\n  \"Documentos Postscript\\0\"\\\n  \"Apr&esenta\\303\\247\\303\\243o\\tCtrl+L\\0\"\\\n  \"P\\303\\241gina anterior\\0\"\\\n  \"Imprimir\\0\"\\\n  \"Intervalo de impress\\303\\243o\\0\"\\\n  \"N\\303\\242o existe uma impressora com esse nome\\0\"\\\n  \"Imprimindo...\\0\"\\\n  \"Ainda imprimindo... Interromper e sair?\\0\"\\\n  \"A impress\\303\\243o est\\303\\241 em andamento. Interromper e come\\303\\247ar de novo?\\0\"\\\n  \"Imprimindo p\\303\\241gina %d de %d...\\0\"\\\n  \"Problema de impress\\303\\243o.\\0\"\\\n  \"Re&nomear...\\tF2\\0\"\\\n  \"&Lembrar arquivos abertos\\0\"\\\n  \"Remover dos Favoritos\\0\"\\\n  \"Remover p\\303\\241gina %s dos Favoritos\\0\"\\\n  \"Renomear para\\0\"\\\n  \"Girar \\303\\240 esquerda\\tCtrl+Shift+-\\0\"\\\n  \"Girar \\303\\240 direita\\tCtrl+Shift++\\0\"\\\n  \"Salvar como\\0\"\\\n  \"S&alvar atalho...\\tCtrl+Shift+S\\0\"\\\n  \"Localizando %d de %d...\\0\"\\\n  \"Selecion&ar tudo\\0\"\\\n  \"Selecion&ar Tudo\\tCtrl+A\\0\"\\\n  \"Selecionar com Ctrl+Bot\\303\\243o esquerdo do mouse\\0\"\\\n  \"Sele\\303\\247\\303\\243o:\\0\"\\\n  \"Enviar por email...\\0\"\\\n  \"Configurar pesquisa inversa\\0\"\\\n  \"Mostrar Fa&voritos\\0\"\\\n  \"Exibir p\\303\\241ginas de modo cont\\303\\255nuo\\0\"\\\n  \"Mostrar barra de ferramentas\\0\"\\\n  \"Mostrar Favoritos\\0\"\\\n  \"Mostrar Lidos com frequ\\303\\252ncia\\0\"\\\n  \"Mostrar barra lateral de marcadores quando dispon\\303\\255vel\\0\"\\\n  \"P\\303\\241gina \\303\\272nica\\0\"\\\n  \"Desculpe, isso n\\303\\243o deveria ter acontecido!\\n\\nAperte 'Cancelar' se quiser nos ajudar a corrigir a causa deste erro.\\0\"\\\n  \"O arquivo fonte %s n\\303\\243o tem ponto de sincroniza\\303\\247\\303\\243o\\0\"\\\n  \"Assunto:\\0\"\\\n  \"Op\\303\\247\\303\\265es do SumatraPDF\\0\"\\\n  \"Atualiza\\303\\247\\303\\243o do SumatraPDF\\0\"\\\n  \"O SumatraPDF travou\\0\"\\\n  \"O SumatraPDF \\303\\251 o seu leitor PDF padr\\303\\243o\\0\"\\\n  \"O SumatraPDF deve ser agora seu leitor PDF padr\\303\\243o\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel abrir o arquivo de sincroniza\\303\\247\\303\\243o\\0\"\\\n  \"PDF com marca\\303\\247\\303\\265es (tags)\\0\"\\\n  \"Documentos de texto\\0\"\\\n  \"Este documento utiliza recursos n\\303\\243o suportados (%s) e pode n\\303\\243o ser exibido corretamente.\\0\"\\\n  \"T\\303\\255tulo:\\0\"\\\n  \"Arquivo fonte desconhecido (%s)\\0\"\\\n  \"Usar &abas\\0\"\\\n  \"Exibir\\0\"\\\n  \"&Visitar a p\\303\\241gina do SumatraPDF\\0\"\\\n  \"Aviso\\0\"\\\n  \"Documentos XPS\\0\"\\\n  \"Esta \\303\\251 a vers\\303\\243o mais recente.\\0\"\\\n  \"Voc\\303\\252 tem a vers\\303\\243o %s\\0\"\\\n  \"\\0\"\\\n  \"Aumentar zoom\\0\"\\\n  \"Diminuir zoom\\0\"\\\n  \"Propor\\303\\247\\303\\243o de Zoom\\0\"\\\n  \"[Mudan\\303\\247as detectadas; atualizando] %s\\0\"\\\n  \"copiando texto\\0\"\\\n  \"imprimindo documento\\0\";\n\nconst char * gTranslations_pt = \n  \"&Sobre\\0\"\\\n  \"&Tamanho real\\tCtrl+1\\0\"\\\n  \"Op\\303\\247\\303\\265es &avan\\303\\247adas...\\0\"\\\n  \"&Todas as p\\303\\241ginas selecionadas\\0\"\\\n  \"V&oltar\\tAlt + <-\\0\"\\\n  \"Como li&vro\\tCtrl+8\\0\"\\\n  \"&Fechar\\tCtrl+W\\0\"\\\n  \"&Copiar sele\\303\\247\\303\\243o\\0\"\\\n  \"&Copiar sele\\303\\247\\303\\243o\\tCtrl+C\\0\"\\\n  \"&N\\303\\243o perguntar novamente\\0\"\\\n  \"S\\303\\263 p\\303\\241ginas &pares\\0\"\\\n  \"D&uas p\\303\\241ginas\\tCtrl+7\\0\"\\\n  \"&Ficheiro\\0\"\\\n  \"&Localizar:\\0\"\\\n  \"Primeira &p\\303\\241gina\\tHome\\0\"\\\n  \"A&justar p\\303\\241ginas \\303\\240 \\303\\241rea de impress\\303\\243o\\0\"\\\n  \"Ir &para\\0\"\\\n  \"Ir pa&ra a p\\303\\241gina:\\0\"\\\n  \"Aj&uda\\0\"\\\n  \"\\303\\232ltima p\\303\\241&gina\\tEnd\\0\"\\\n  \"&Amplia\\303\\247\\303\\243o:\\0\"\\\n  \"\\0\"\\\n  \"Sens\\303\\255vel a &mai\\303\\272sculas\\0\"\\\n  \"P\\303\\241gina &seguinte\\t->\\0\"\\\n  \"&N\\303\\243o\\0\"\\\n  \"&N\\303\\243o, obrigado(a)\\0\"\\\n  \"S\\303\\263 p\\303\\241ginas \\303\\255&mpares\\0\"\\\n  \"&Abrir documento\\0\"\\\n  \"&Abrir...\\tCtrl+O\\0\"\\\n  \"&Op\\303\\247\\303\\265es...\\0\"\\\n  \"&Palavra-passe:\\0\"\\\n  \"Fi&xar documento\\0\"\\\n  \"P\\303\\241gina &anterior\\t<-\\0\"\\\n  \"&Imprimir...\\0\"\\\n  \"&Imprimir\\tCtrl+P\\0\"\\\n  \"&Imprimir...(recusado)\\0\"\\\n  \"&Lembrar palavra-passe deste documento\\0\"\\\n  \"&Lembrar estas defini\\303\\247\\303\\265es para todos os documentos\\0\"\\\n  \"Remover doc&umento\\0\"\\\n  \"&Gravar como...\\0\"\\\n  \"&Gravar como...\\tCtrl+S\\0\"\\\n  \"&Defini\\303\\247\\303\\265es\\0\"\\\n  \"&Reduzir p\\303\\241ginas \\303\\240 \\303\\241rea de impress\\303\\243o (se necess\\303\\241rio)\\0\"\\\n  \"Uma &p\\303\\241gina\\tCtrl+6\\0\"\\\n  \"Ignorar &esta vers\\303\\243o\\0\"\\\n  \"&Utilizar tamanho original\\0\"\\\n  \"&Ver\\0\"\\\n  \"&Janela\\0\"\\\n  \"&Sim\\0\"\\\n  \"&Amplia\\303\\247\\303\\243o\\0\"\\\n  \"(de %d)\\0\"\\\n  \"(p\\303\\241gina %s)\\0\"\\\n  \"Sobre o SumatraPDF\\0\"\\\n  \"Adicionar favorito\\0\"\\\n  \"Adicionar p\\303\\241gina %s aos favoritos\\0\"\\\n  \"Adicionar p\\303\\241gina %s aos favoritos com nome (opcional):\\0\"\\\n  \"Adicionar aos favoritos\\0\"\\\n  \"Avan\\303\\247adas\\0\"\\\n  \"Todos os ficheiros\\0\"\\\n  \"Todos os documentos\\0\"\\\n  \"Aplica\\303\\247\\303\\243o:\\0\"\\\n  \"Associar a ficheiros PDF?\\0\"\\\n  \"Anexo: %s\\0\"\\\n  \"Autor:\\0\"\\\n  \"Autom\\303\\241tico\\0\"\\\n  \"&Procurar atualiza\\303\\247\\303\\265es automaticamente\\0\"\\\n  \"Como livro\\0\"\\\n  \"M&arcadores\\tF12\\0\"\\\n  \"Atalhos de marcadores\\0\"\\\n  \"Atalho para a p\\303\\241gina %s de %s\\0\"\\\n  \"Marcadores\\0\"\\\n  \"\\0\"\\\n  \"Documentos CHM\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel ligar \\303\\240 Internet (erro %#x)\\0\"\\\n  \"Cancelar\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel imprimir este ficheiro\\0\"\\\n  \"N\\303\\243o \\303\\251 poss\\303\\255vel iniciar o comando da pesquisa inversa. Verifique a linha de comandos nas defini\\303\\247\\303\\265es.\\0\"\\\n  \"Mudar idioma\\0\"\\\n  \"Procurar at&ualiza\\303\\247\\303\\265es\\0\"\\\n  \"Banda desenhada\\0\"\\\n  \"Compatibilidade\\0\"\\\n  \"Uma p\\303\\241gina cont\\303\\255nua\\0\"\\\n  \"Como livro cont\\303\\255nuo\\0\"\\\n  \"Duas p\\303\\241ginas cont\\303\\255nuas\\0\"\\\n  \"Ajudar na tradu\\303\\247\\303\\243o\\0\"\\\n  \"Copiar &imagem\\0\"\\\n  \"Copiar endere\\303\\247o da &liga\\303\\247\\303\\243o\\0\"\\\n  \"Copiar co&ment\\303\\241rio\\0\"\\\n  \"A c\\303\\263pia do texto foi recusada (copie como imagem)\\0\"\\\n  \"Direitos de autor:\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel obter as propriedades da impressora\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel iniciar a impressora\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel processar a p\\303\\241gina\\0\"\\\n  \"Criado:\\0\"\\\n  \"Ficheiro atual\\0\"\\\n  \"Posi\\303\\247\\303\\243o do cursor:\\0\"\\\n  \"&Personalizar...\\tCtrl+Y\\0\"\\\n  \"&Exibi\\303\\247\\303\\243o padr\\303\\243o:\\0\"\\\n  \"&Amplia\\303\\247\\303\\243o padr\\303\\243o:\\0\"\\\n  \"No modo port\\303\\241til, n\\303\\243o pode alterar o leitor pr\\303\\251-definido dos PDFs\\0\"\\\n  \"Permiss\\303\\265es recusadas:\\0\"\\\n  \"Documentos DjVu\\0\"\\\n  \"Propriedades do documento\\0\"\\\n  \"Transferir\\0\"\\\n  \"&Sair\\tCtrl+Q\\0\"\\\n  \"Documentos EPUB\\0\"\\\n  \"Introduza a palavra-passe\\0\"\\\n  \"Introduza a palavra-passe de %s\\0\"\\\n  \"Indique a linha de comandos a invocar ao clicar duas vezes no documento PDF:\\0\"\\\n  \"Erro ao carregar %s\\0\"\\\n  \"Fav&oritos\\0\"\\\n  \"A&van\\303\\247ar\\tAlt + ->\\0\"\\\n  \"Ecr\\303\\243 co&mpleto\\tCtrl+Shift+L\\0\"\\\n  \"Duas p\\303\\241ginas\\0\"\\\n  \"Falha ao mudar o nome do ficheiro!\\0\"\\\n  \"Erro ao gravar o ficheiro!\\0\"\\\n  \"Visualiza\\303\\247\\303\\243o r\\303\\241pida na web\\0\"\\\n  \"Favoritos\\0\"\\\n  \"Livros de fic\\303\\247\\303\\243o\\0\"\\\n  \"Ficheiro %s n\\303\\243o encontrado\\0\"\\\n  \"Tamanho do ficheiro:\\0\"\\\n  \"Ficheiro:\\0\"\\\n  \"&Localizar...\\tCtrl+F\\0\"\\\n  \"Localizar\\0\"\\\n  \"Localizar seguinte\\0\"\\\n  \"Localizar anterior\\0\"\\\n  \"Localizar:\\0\"\\\n  \"Ajustar ao &conte\\303\\272do\\tCtrl+3\\0\"\\\n  \"&Ajustar \\303\\240 p\\303\\241gina\\tCtrl+0\\0\"\\\n  \"Ajustar \\303\\240 &largura\\tCtrl+2\\0\"\\\n  \"Ajustar ao conte\\303\\272do\\0\"\\\n  \"Ajustar \\303\\240 p\\303\\241gina\\0\"\\\n  \"Ajustar \\303\\240 largura\\0\"\\\n  \"Ajustar largura e mostrar p\\303\\241ginas cont\\303\\255nuas\\0\"\\\n  \"Ajustar a uma p\\303\\241gina\\0\"\\\n  \"Tipo de letra:\\0\"\\\n  \"A formatar livro... %d p\\303\\241ginas\\0\"\\\n  \"Texto encontrado na p\\303\\241gina %s\\0\"\\\n  \"Texto encontrado na p\\303\\241gina %s\\0\"\\\n  \"Frequentes\\0\"\\\n  \"\\0\"\\\n  \"Ir para a p\\303\\241gina\\0\"\\\n  \"Ocultar frequentes\\0\"\\\n  \"Dica: utilize F3 para procurar a seguinte\\0\"\\\n  \"Imagens (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Tornar SumatraPDF a aplica\\303\\247\\303\\243o principal para PDFs?\\0\"\\\n  \"Tornar SumatraPDF o leitor principal dos PDF\\0\"\\\n  \"Modo man&ga\\0\"\\\n  \"Sens\\303\\255vel a mai\\303\\272sculas\\0\"\\\n  \"Documentos Mobi\\0\"\\\n  \"Modificado:\\0\"\\\n  \"Est\\303\\241 dispon\\303\\255vel a nova vers\\303\\243o %s. Transferir?\\0\"\\\n  \"P\\303\\241gina seguinte\\0\"\\\n  \"Nenhuma ocorr\\303\\252ncia encontrada\\0\"\\\n  \"Nenhum resultado perto da linha %u no ficheiro %s\\0\"\\\n  \"Nenhum ficheiro de sincroniza\\303\\247\\303\\243o encontrado\\0\"\\\n  \"N\\303\\243o h\\303\\241 informa\\303\\247\\303\\265es de sincroniza\\303\\247\\303\\243o nesta posi\\303\\247\\303\\243o\\0\"\\\n  \"N\\303\\272mero de p\\303\\241ginas:\\0\"\\\n  \"Aplicar\\0\"\\\n  \"Abrir\\0\"\\\n  \"Abrir no PDF-&XChange\\0\"\\\n  \"Abrir documento...\\0\"\\\n  \"Abrir em %s\\0\"\\\n  \"Abrir no Adobe &Reader\\0\"\\\n  \"Abrir &no &Foxit Reader\\0\"\\\n  \"Abrir no &Microsoft HTML Help\\0\"\\\n  \"Abrir no &Microsoft XPS-Viewer\\0\"\\\n  \"&Propriedades\\0\"\\\n  \"&Propriedades...\\tCtrl+D\\0\"\\\n  \"Documento PDF\\0\"\\\n  \"Otimiza\\303\\247\\303\\265es PDF:\\0\"\\\n  \"Criador do PDF:\\0\"\\\n  \"Vers\\303\\243o PDF:\\0\"\\\n  \"Documentos PDF\\0\"\\\n  \"P\\303\\241gi&na...\\tCtrl+G\\0\"\\\n  \"P\\303\\241gina %s\\0\"\\\n  \"Tamanho da p\\303\\241gina:\\0\"\\\n  \"A p\\303\\241gina %u n\\303\\243o existe\\0\"\\\n  \"Ajuste de p\\303\\241ginas\\0\"\\\n  \"P\\303\\241gina:\\0\"\\\n  \"Documentos PalmDoc\\0\"\\\n  \"Por favor aguarde - a processar...\\0\"\\\n  \"Documentos Postscript\\0\"\\\n  \"Aprese&nta\\303\\247\\303\\243o\\tCtrl+L\\0\"\\\n  \"P\\303\\241gina anterior\\0\"\\\n  \"Imprimir\\0\"\\\n  \"Intervalo de impress\\303\\243o\\0\"\\\n  \"A impressora indicada n\\303\\243o existe\\0\"\\\n  \"Impress\\303\\243o em curso\\0\"\\\n  \"Impress\\303\\243o ainda em curso. Abortar e sair?\\0\"\\\n  \"A impress\\303\\243o est\\303\\241 em curso. Cancelar e reiniciar?\\0\"\\\n  \"A imprimir p\\303\\241gina %d de %d...\\0\"\\\n  \"Erro de impress\\303\\243o\\0\"\\\n  \"Mudar &nome...\\tF2\\0\"\\\n  \"Lembrar ficheiros abert&os\\0\"\\\n  \"Remover dos favoritos\\0\"\\\n  \"Remover p\\303\\241gina %s dos favoritos\\0\"\\\n  \"Mudar nome para\\0\"\\\n  \"Rodar \\303\\240 &esquerda\\tCtrl+Shift+-\\0\"\\\n  \"Rodar \\303\\240 &direita\\tCtrl+Shift++\\0\"\\\n  \"Gravar como\\0\"\\\n  \"Criar atal&ho...\\tCtrl+Shift+S\\0\"\\\n  \"A procurar %d de %d...\\0\"\\\n  \"&Selecionar tudo\\0\"\\\n  \"&Selecionar tudo\\tCtrl+A\\0\"\\\n  \"Selecione o conte\\303\\272do com Ctrl+bot\\303\\243o esquerdo do rato\\0\"\\\n  \"Selec\\303\\247\\303\\243o:\\0\"\\\n  \"&Enviar por correio eletr\\303\\263nico...\\0\"\\\n  \"Definir linha de comandos para procura inversa\\0\"\\\n  \"&Mostrar marcadores\\0\"\\\n  \"M&ostrar p\\303\\241ginas cont\\303\\255nuas\\0\"\\\n  \"Mostrar &barra de ferramentas\\0\"\\\n  \"Mostrar favoritos\\0\"\\\n  \"Mostrar frequentes\\0\"\\\n  \"&Mostrar barra de marcadores quando dispon\\303\\255vel\\0\"\\\n  \"Uma p\\303\\241gina\\0\"\\\n  \"Isto n\\303\\243o devia ter ocorrido!\\n\\nPrima \\\"Cancelar\\\", se nos quiser ajudar a corrigir a origem deste erro.\\0\"\\\n  \"O ficheiro %s n\\303\\243o tem ponto de sincroniza\\303\\247\\303\\243o\\0\"\\\n  \"Assunto:\\0\"\\\n  \"Op\\303\\247\\303\\265es do SumatraPDF\\0\"\\\n  \"Atualiza\\303\\247\\303\\243o do SumatraPDF\\0\"\\\n  \"O SumatraPDF terminou\\0\"\\\n  \"O SumatraPDF \\303\\251 o leitor principal dos PDF\\0\"\\\n  \"O SumatraPDF deve agora ser o leitor principal dos PDF\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel abrir o ficheiro de sincroniza\\303\\247\\303\\243o\\0\"\\\n  \"PDF com tags\\0\"\\\n  \"Documentos de texto\\0\"\\\n  \"Este documento possui funcionalidades n\\303\\243o suportadas (%s) e pode n\\303\\243o ser mostrado corretamente\\0\"\\\n  \"T\\303\\255tulo:\\0\"\\\n  \"O ficheiro (%s) \\303\\251 desconhecido\\0\"\\\n  \"&Utilizar separadores\\0\"\\\n  \"Ver\\0\"\\\n  \"&Visitar s\\303\\255tio web\\0\"\\\n  \"Aviso\\0\"\\\n  \"Documentos XPS\\0\"\\\n  \"J\\303\\241 tem a vers\\303\\243o mais recente\\0\"\\\n  \"Tem a vers\\303\\243o %s\\0\"\\\n  \"Ajustar\\0\"\\\n  \"Ampliar\\0\"\\\n  \"Reduzir\\0\"\\\n  \"Amplia\\303\\247\\303\\243o\\0\"\\\n  \"[Mudan\\303\\247as detetadas; a atualizar] %s\\0\"\\\n  \"c\\303\\263pia de texto\\0\"\\\n  \"imprimir documento\\0\";\n\nconst char * gTranslations_ro = \n  \"&Despre\\0\"\\\n  \"M\\304\\203rime &efectiv\\304\\203\\tCtrl+1\\0\"\\\n  \"Op\\310\\233iuni &avansate...\\0\"\\\n  \"Toate paginile selectate\\0\"\\\n  \"\\303\\216napoi\\tAlt+<-\\0\"\\\n  \"Format carte\\tCtrl+8\\0\"\\\n  \"\\303\\216nc&hidere\\tCtrl+W\\0\"\\\n  \"&Copiaz\\304\\203 selec\\310\\233ia\\0\"\\\n  \"&Copiere selec\\310\\233ie\\tCtrl+C\\0\"\\\n  \"Nu m\\304\\203 \\303\\256ntreba din nou\\0\"\\\n  \"Doar paginile pare\\0\"\\\n  \"Dou\\304\\203 pagini\\tCtrl+7\\0\"\\\n  \"&Fi\\310\\231ier\\0\"\\\n  \"Caut\\304\\203 text:\\0\"\\\n  \"Prima pagin\\304\\203\\tHome\\0\"\\\n  \"Potrivire pagini cu aria de imprimare\\0\"\\\n  \"Sal&t la\\0\"\\\n  \"Salt la pagina:\\0\"\\\n  \"A&jutor\\0\"\\\n  \"Ultima pagin\\304\\203\\tEnd\\0\"\\\n  \"Factor m\\304\\203rire:\\0\"\\\n  \"Manual\\0\"\\\n  \"Potrivire literele mari \\310\\231i mici\\0\"\\\n  \"Pagina urm\\304\\203toare\\t->\\0\"\\\n  \"&Nu\\0\"\\\n  \"&Nu, mul\\310\\233umesc\\0\"\\\n  \"Doar paginile impare\\0\"\\\n  \"Deschide d&ocument\\0\"\\\n  \"&Deschidere...\\tCtrl+O\\0\"\\\n  \"&Op\\310\\233iuni...\\0\"\\\n  \"&Parola:\\0\"\\\n  \"&Fixeaz\\304\\203 document\\0\"\\\n  \"Pagina anterioar\\304\\203\\t<-\\0\"\\\n  \"&Tip\\304\\203re\\310\\231te...\\0\"\\\n  \"I&mprimare...\\tCtrl+P\\0\"\\\n  \"&Imprimare... (interzis\\304\\203)\\0\"\\\n  \"&Re\\310\\233ine parola acestui document\\0\"\\\n  \"&Re\\310\\233ine aceste op\\310\\233iuni pentru fiecare document\\0\"\\\n  \"\\303\\216nl\\304\\203tu&r\\304\\203 document\\0\"\\\n  \"&Salveaz\\304\\203 ca...\\0\"\\\n  \"Salvare c&a...\\tCtrl+S\\0\"\\\n  \"&Op\\310\\233iuni\\0\"\\\n  \"&Mic\\310\\231oreaz\\304\\203 paginile la aria de imprimare (dac\\304\\203 e necesar)\\0\"\\\n  \"O &singur\\304\\203 pagin\\304\\203\\tCtrl+6\\0\"\\\n  \"&Sari peste aceast\\304\\203 versiune\\0\"\\\n  \"&Utilizeaz\\304\\203 m\\304\\203rimile originale ale paginii\\0\"\\\n  \"&Vizualizare\\0\"\\\n  \"\\0\"\\\n  \"&Da\\0\"\\\n  \"&M\\304\\203rime\\0\"\\\n  \"(de %d)\\0\"\\\n  \"(pagina %s)\\0\"\\\n  \"Despre SumatraPDF\\0\"\\\n  \"Adaug\\304\\203 ca favorit\\0\"\\\n  \"Adaug\\304\\203 pagina %s la favorite\\0\"\\\n  \"Adaug\\304\\203 pagina %s la favorite cu (op\\310\\233ional) numele:\\0\"\\\n  \"Adaug\\304\\203 la favorite\\0\"\\\n  \"Avansat\\0\"\\\n  \"Toate fi\\310\\231ierele\\0\"\\\n  \"Toate formatele suportate\\0\"\\\n  \"Program:\\0\"\\\n  \"Asociaz\\304\\203 cu fi\\310\\231ierele PDF?\\0\"\\\n  \"Fi\\310\\231ier ata\\310\\231at: %s\\0\"\\\n  \"Autor:\\0\"\\\n  \"Automat\\0\"\\\n  \"Urm\\304\\203re\\310\\231te automat versiuni noi\\0\"\\\n  \"Vizualizare \\303\\256n format carte\\0\"\\\n  \"Marcaje\\tF12\\0\"\\\n  \"Leg\\304\\203turi rapide - semne de carte\\0\"\\\n  \"Leg\\304\\203tur\\304\\203 rapid\\304\\203 c\\304\\203tre pagina %s din %s\\0\"\\\n  \"Marcaje\\0\"\\\n  \"Octe\\310\\233i\\0\"\\\n  \"Documente CHM\\0\"\\\n  \"Conectare la Internet e\\310\\231uat\\304\\203 (eroare %#x).\\0\"\\\n  \"Anulare\\0\"\\\n  \"Nu pot imprima acest fi\\310\\231ier\\0\"\\\n  \"Nu pot lansa comanda de c\\304\\203utare invers\\304\\203. Verifica\\310\\233i, v\\304\\203 rog, op\\310\\233iunile din linia de comand\\304\\203.\\0\"\\\n  \"Schimbare limb\\304\\203 (Change Language)\\0\"\\\n  \"Verific\\304\\203 apari\\310\\233ia unei versiuni noi\\0\"\\\n  \"Benzi desenate\\0\"\\\n  \"Compatibilitate\\0\"\\\n  \"Continuu\\0\"\\\n  \"Vedere \\303\\256n format carte, continuu\\0\"\\\n  \"Pagin\\304\\203 dubl\\304\\203 continuu\\0\"\\\n  \"Contribuie la traducere\\0\"\\\n  \"Copiere &Imagine\\0\"\\\n  \"Copiaz\\304\\203 adresa &leg\\304\\203turii\\0\"\\\n  \"Copiaz\\304\\203 co&mentariul\\0\"\\\n  \"Copierea textului interzis\\304\\203 (s-a copiat ca imagine)\\0\"\\\n  \"Drept de autor\\0\"\\\n  \"Nu s-au putut ob\\310\\233ine propriet\\304\\203\\310\\233ile imprimantei\\0\"\\\n  \"Nu s-a putut ini\\310\\233ializa imprimanta\\0\"\\\n  \"Nu s-a putut afi\\310\\231a pagina\\0\"\\\n  \"Creat:\\0\"\\\n  \"Fi\\310\\231ier curent\\0\"\\\n  \"\\0\"\\\n  \"Factor de m\\304\\203rire... \\tCtrl+Y\\0\"\\\n  \"Design implicit:\\0\"\\\n  \"Factor de m\\304\\203rire implicit:\\0\"\\\n  \"Cititorul PDF principal nu poate fi schimbat \\303\\256n modul portabil\\0\"\\\n  \"Permisiuni interzise:\\0\"\\\n  \"Documente DjVu\\0\"\\\n  \"Propriet\\304\\203\\310\\233i document\\0\"\\\n  \"Descarc\\304\\203\\0\"\\\n  \"&Ie\\310\\231ire\\tCtrl+Q\\0\"\\\n  \"Documente EPUB\\0\"\\\n  \"Introduce\\310\\233i parola\\0\"\\\n  \"Introduce\\310\\233i parola pentru %s\\0\"\\\n  \"Introduce\\310\\233i comanda invocat\\304\\203 la dublu click pe documentul PDF:\\0\"\\\n  \"Eroare la \\303\\256nc\\304\\203rcarea %s\\0\"\\\n  \"F&avorite\\0\"\\\n  \"\\303\\216nainte\\tAlt+->\\0\"\\\n  \"Tot ecranul\\tCtrl+Shift+L\\0\"\\\n  \"Dou\\304\\203 pagini\\0\"\\\n  \"Eroare la redenumirea fisierului!\\0\"\\\n  \"Eroare la salvarea unui fi\\310\\231ier\\0\"\\\n  \"Vizualizare rapid\\304\\203 web\\0\"\\\n  \"Favorite\\0\"\\\n  \"Documente SF (Carti de fictiune)\\0\"\\\n  \"Fisierul %s nu a fost gasit\\0\"\\\n  \"M\\304\\203rime fi\\310\\231ier:\\0\"\\\n  \"Fi\\310\\231ier:\\0\"\\\n  \"Caut\\304\\203...\\tCtrl+F\\0\"\\\n  \"Caut\\304\\203\\0\"\\\n  \"Caut\\304\\203 \\303\\256nainte\\0\"\\\n  \"Caut\\304\\203 \\303\\256napoi\\0\"\\\n  \"Caut\\304\\203:\\0\"\\\n  \"Potrivire dup\\304\\203 con\\310\\233inut\\tCtrl+3\\0\"\\\n  \"&Pagin\\304\\203 \\303\\256ntreag\\304\\203\\tCtrl+0\\0\"\\\n  \"Potrivire dup\\304\\203 l\\304\\203\\310\\233ime pagin\\304\\203\\tCtrl+2\\0\"\\\n  \"Potrivire dup\\304\\203 con\\310\\233inut\\0\"\\\n  \"Pagin\\304\\203 \\303\\256ntreag\\304\\203\\0\"\\\n  \"Potrivire dup\\304\\203 l\\304\\203\\310\\233ime pagin\\304\\203\\0\"\\\n  \"Potrivire dup\\304\\203 l\\304\\203\\310\\233ime \\310\\231i afi\\310\\231are continu\\304\\203 a paginilor\\0\"\\\n  \"Potrivire pentru o singur\\304\\203 pagin\\304\\203\\0\"\\\n  \"Fonturi:\\0\"\\\n  \"Formateaz\\304\\203 cartea... %d pagini\\0\"\\\n  \"Am g\\304\\203sit textul la pagina %s\\0\"\\\n  \"G\\304\\203sit textul la pagina %s (din nou)\\0\"\\\n  \"Citite frecvent\\0\"\\\n  \"\\0\"\\\n  \"Salt la pagina\\0\"\\\n  \"Ascunde paginile citite frecvent\\0\"\\\n  \"Sugestie: Utiliza\\310\\233i tasta F3 pentru a c\\304\\203uta mai departe\\0\"\\\n  \"Fi\\310\\231iere-imagine (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Seta\\310\\233i SumatraPDF ca program implicit pentru fi\\310\\231ierele PDF?\\0\"\\\n  \"Seta\\310\\233i SumatraPDF ca cititor implicit de PDF\\0\"\\\n  \"Mod man&ga\\0\"\\\n  \"Potrivire literele mari \\310\\231i mici\\0\"\\\n  \"Documente Mobi\\0\"\\\n  \"Modificat:\\0\"\\\n  \"O nou\\304\\203 versiune %s este disponibil\\304\\203. Desc\\304\\203rca\\310\\233i versiunea nou\\304\\203?\\0\"\\\n  \"Pagina urm\\304\\203toare\\0\"\\\n  \"Nu s-au g\\304\\203sit rezultate\\0\"\\\n  \"Nici un rezultat \\303\\256n jurul liniei %u \\303\\256n fi\\310\\231ierul %s\\0\"\\\n  \"Nu s-a g\\304\\203sit fi\\310\\231ier de sincronizare\\0\"\\\n  \"Nu exist\\304\\203 informa\\310\\233ie de sincronizare la aceast\\304\\203 pozi\\310\\233ie\\0\"\\\n  \"Num\\304\\203r de pagini:\\0\"\\\n  \"\\303\\216n regul\\304\\203\\0\"\\\n  \"Deschide\\0\"\\\n  \"Deschide \\303\\256n PDF-XChange\\0\"\\\n  \"Deschide un document...\\0\"\\\n  \"deschide \\303\\256n %s\\0\"\\\n  \"Deschide \\303\\256n &Adobe Reader\\0\"\\\n  \"Deschide \\303\\256n &Foxit Reader\\0\"\\\n  \"Deschide \\303\\256n Microsoft HTML Help\\0\"\\\n  \"Deschide \\303\\256n Microsoft XPS-Viewer\\0\"\\\n  \"P&ropriet\\304\\203\\310\\233i\\0\"\\\n  \"P&ropriet\\304\\203\\310\\233i\\tCtrl+D\\0\"\\\n  \"Document PDF\\0\"\\\n  \"Optimizari PDF:\\0\"\\\n  \"Produc\\304\\203tor PDF:\\0\"\\\n  \"Versiune PDF:\\0\"\\\n  \"Documente PDF\\0\"\\\n  \"Pagina...\\tCtrl+G\\0\"\\\n  \"Pagina %s\\0\"\\\n  \"M\\304\\203rime pagin\\304\\203:\\0\"\\\n  \"Num\\304\\203r de pagin\\304\\203 %u inexistent\\0\"\\\n  \"Scalare pagin\\304\\203\\0\"\\\n  \"Pagina:\\0\"\\\n  \"\\0\"\\\n  \"V\\304\\203 rug\\304\\203m a\\310\\231tepta\\310\\233i - afi\\310\\231are...\\0\"\\\n  \"Documente Postscript\\0\"\\\n  \"Pr&ezentare\\tCtrl+L\\0\"\\\n  \"Pagina anterioar\\304\\203\\0\"\\\n  \"Imprimare\\0\"\\\n  \"Interval imprimare\\0\"\\\n  \"Imprimanta cu numele respectiv nu exist\\304\\203\\0\"\\\n  \"Tiparire in curs.\\0\"\\\n  \"In prezent se tipareste ceva. Anulati si renuntati?\\0\"\\\n  \"Tip\\304\\203rirea este \\303\\256nc\\304\\203 \\303\\256n curs. Opresc \\310\\231i reiau ?\\0\"\\\n  \"Tip\\304\\203re\\310\\231te pagina %d din %d...\\0\"\\\n  \"Problem\\304\\203 la imprimare.\\0\"\\\n  \"Rede&numire...\\tF2\\0\"\\\n  \"\\310\\232ine minte fi\\310\\231ierele deschise\\0\"\\\n  \"Scoate de la favorite\\0\"\\\n  \"Scoate pagina %s de la favorite\\0\"\\\n  \"Redenume\\310\\231te la\\0\"\\\n  \"Rote\\310\\231te spre st\\303\\242nga\\tCtrl+Shift+-\\0\"\\\n  \"Rote\\310\\231te spre dreapta\\tCtrl+Shift++\\0\"\\\n  \"Salveaz\\304\\203 ca\\0\"\\\n  \"Salveaz\\304\\203 leg\\304\\203tura...\\tCtrl+Shift+S\\0\"\\\n  \"Caut %d din %d...\\0\"\\\n  \"Selecte&az\\304\\203 Tot\\0\"\\\n  \"Selecteaz\\304\\203 &tot\\tCtrl+A\\0\"\\\n  \"Selecta\\310\\233i con\\310\\233inut cu Ctrl+buton st\\303\\242nga maus\\0\"\\\n  \"\\0\"\\\n  \"Trimite pe &E-mail...\\0\"\\\n  \"Seta\\310\\233i comand\\304\\203 pentru c\\304\\203utare invers\\304\\203\\0\"\\\n  \"Arata Se&bnele de Carte\\0\"\\\n  \"Arat\\304\\203 &paginile continuu\\0\"\\\n  \"Arat\\304\\203 bara de instrumente\\0\"\\\n  \"Arat\\304\\203 favoritele\\0\"\\\n  \"Arat\\304\\203 documentele citite frecvent\\0\"\\\n  \"Arat\\304\\203 bara lateral\\304\\203 pentru &marcaje, c\\303\\242nd exist\\304\\203\\0\"\\\n  \"O singur\\304\\203 pagin\\304\\203\\0\"\\\n  \"Scuze, acest eveniment nu ar fi trebuit s\\304\\203 aib\\304\\203 loc!\\n\\nV\\304\\203 rug\\304\\203m ap\\304\\203sa\\310\\233i \\342\\200\\236Renun\\310\\233\\304\\203\\342\\200\\235, dac\\304\\203 dori\\310\\233i s\\304\\203 ne ajuta\\310\\233i s\\304\\203 \\303\\256ndrept\\304\\203m cauza erorii.\\0\"\\\n  \"Fi\\310\\231ierul surs\\304\\203 %s nu are punct de sincronizare\\0\"\\\n  \"Subiect:\\0\"\\\n  \"Op\\310\\233iuni SumatraPDF\\0\"\\\n  \"Versiune nou\\304\\203 SumatraPDF\\0\"\\\n  \"SumatraPDF s-a terminat incorect\\0\"\\\n  \"SumatraPDF este cititorul PDF implicit\\0\"\\\n  \"SumatraPDF ar trebui s\\304\\203 fie acum cititorul PDF implicit\\0\"\\\n  \"Fi\\310\\231ierul de sincronizare nu poate fi deschis\\0\"\\\n  \"PDF etichetat\\0\"\\\n  \"Fi\\310\\231iere text\\0\"\\\n  \"\\0\"\\\n  \"Titlu:\\0\"\\\n  \"Fi\\310\\231ier surs\\304\\203 necunoscut (%s)\\0\"\\\n  \"\\0\"\\\n  \"Vizualizare\\0\"\\\n  \"&Viziteaz\\304\\203 website-ul\\0\"\\\n  \"Avertisment\\0\"\\\n  \"Documente XPS\\0\"\\\n  \"Ave\\310\\233i ultima versiune.\\0\"\\\n  \"Ave\\310\\233i versiunea %s\\0\"\\\n  \"M\\304\\203rire\\0\"\\\n  \"M\\304\\203re\\310\\231te\\0\"\\\n  \"Mic\\310\\231oreaz\\304\\203\\0\"\\\n  \"Factor de m\\304\\203rire\\0\"\\\n  \"[Schimb\\304\\203ri detectate; actualizare] %s\\0\"\\\n  \"se copiaz\\304\\203 textul\\0\"\\\n  \"se imprim\\304\\203 documentul\\0\";\n\nconst char * gTranslations_ru = \n  \"&\\320\\236 \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\320\\274\\320\\265...\\0\"\\\n  \"&\\320\\235\\320\\260\\321\\201\\321\\202\\320\\276\\321\\217\\321\\211\\320\\270\\320\\271 \\321\\200\\320\\260\\320\\267\\320\\274\\320\\265\\321\\200\\tCtrl+1\\0\"\\\n  \"&\\320\\240\\320\\260\\321\\201\\321\\210\\320\\270\\321\\200\\320\\265\\320\\275\\320\\275\\321\\213\\320\\265 \\320\\275\\320\\260\\321\\201\\321\\202\\321\\200\\320\\276\\320\\271\\320\\272\\320\\270...\\0\"\\\n  \"&\\320\\222\\321\\201\\320\\265 \\320\\262\\321\\213\\320\\261\\321\\200\\320\\260\\320\\275\\320\\275\\321\\213\\320\\265 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\321\\213\\0\"\\\n  \"&\\320\\235\\320\\260\\320\\267\\320\\260\\320\\264\\tAlt+\\320\\241\\321\\202\\321\\200\\320\\265\\320\\273\\320\\272\\320\\260 \\320\\262\\320\\273\\320\\265\\320\\262\\320\\276\\0\"\\\n  \"\\320\\222 &\\321\\200\\320\\260\\320\\267\\320\\262\\320\\276\\321\\200\\320\\276\\321\\202\\tCtrl+8\\0\"\\\n  \"&\\320\\227\\320\\260\\320\\272\\321\\200\\321\\213\\321\\202\\321\\214\\tCtrl+W\\0\"\\\n  \"\\320\\241&\\320\\272\\320\\276\\320\\277\\320\\270\\321\\200\\320\\276\\320\\262\\320\\260\\321\\202\\321\\214 \\320\\262\\321\\213\\320\\264\\320\\265\\320\\273\\320\\265\\320\\275\\320\\275\\320\\276\\320\\265\\0\"\\\n  \"\\320\\241&\\320\\272\\320\\276\\320\\277\\320\\270\\321\\200\\320\\276\\320\\262\\320\\260\\321\\202\\321\\214 \\320\\262\\321\\213\\320\\264\\320\\265\\320\\273\\320\\265\\320\\275\\320\\275\\320\\276\\320\\265\\tCtrl+C\\0\"\\\n  \"&\\320\\221\\320\\276\\320\\273\\321\\214\\321\\210\\320\\265 \\320\\275\\320\\265 \\321\\201\\320\\277\\321\\200\\320\\260\\321\\210\\320\\270\\320\\262\\320\\260\\321\\202\\321\\214\\0\"\\\n  \"\\320\\242\\320\\276\\320\\273\\321\\214\\320\\272\\320\\276 \\321\\207&\\321\\221\\321\\202\\320\\275\\321\\213\\320\\265 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\321\\213\\0\"\\\n  \"\\320\\237\\320\\276 &\\320\\264\\320\\262\\320\\265 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\321\\213\\tCtrl+7\\0\"\\\n  \"&\\320\\244\\320\\260\\320\\271\\320\\273\\0\"\\\n  \"\\320\\235\\320\\260&\\320\\271\\321\\202\\320\\270:\\0\"\\\n  \"\\320\\237\\320\\265\\321\\200\\320\\262\\320\\260&\\321\\217 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\tHome\\0\"\\\n  \"\\320\\237\\320\\276\\320\\264\\320\\276&\\320\\263\\320\\275\\320\\260\\321\\202\\321\\214 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\321\\213 \\320\\277\\320\\276\\320\\264 \\320\\276\\320\\261\\320\\273\\320\\260\\321\\201\\321\\202\\321\\214 \\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\270\\0\"\\\n  \"\\320\\237\\320\\265\\321\\200\\320\\265&\\321\\205\\320\\276\\320\\264\\0\"\\\n  \"\\320\\237\\320\\265\\321\\200\\320\\265\\320\\271\\321\\202\\320\\270 &\\320\\272 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\265\\0\"\\\n  \"&\\320\\241\\320\\277\\321\\200\\320\\260\\320\\262\\320\\272\\320\\260\\0\"\\\n  \"\\320\\237\\320\\276\\321\\201\\320\\273&\\320\\265\\320\\264\\320\\275\\321\\217\\321\\217 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\tEnd\\0\"\\\n  \"\\320\\234\\320\\260\\321\\201&\\321\\210\\321\\202\\320\\260\\320\\261\\320\\270\\321\\200\\320\\276\\320\\262\\320\\260\\320\\275\\320\\270\\320\\265:\\0\"\\\n  \"&\\320\\240\\321\\203\\320\\272\\320\\276\\320\\262\\320\\276\\320\\264\\321\\201\\321\\202\\320\\262\\320\\276 \\320\\277\\320\\276\\320\\273\\321\\214\\320\\267\\320\\276\\320\\262\\320\\260\\321\\202\\320\\265\\320\\273\\321\\217\\0\"\\\n  \"&\\320\\243\\321\\207\\320\\270\\321\\202\\321\\213\\320\\262\\320\\260\\321\\202\\321\\214 \\321\\200\\320\\265\\320\\263\\320\\270\\321\\201\\321\\202\\321\\200\\0\"\\\n  \"\\320\\241&\\320\\273\\320\\265\\320\\264\\321\\203\\321\\216\\321\\211\\320\\260\\321\\217 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\t\\320\\241\\321\\202\\321\\200\\320\\265\\320\\273\\320\\272\\320\\260 \\320\\262\\320\\277\\321\\200\\320\\260\\320\\262\\320\\276\\0\"\\\n  \"&\\320\\235\\320\\265\\321\\202\\0\"\\\n  \"&\\320\\235\\320\\265\\321\\202, \\321\\201\\320\\277\\320\\260\\321\\201\\320\\270\\320\\261\\320\\276\\0\"\\\n  \"\\320\\242\\320\\276\\320\\273\\321\\214\\320\\272\\320\\276 \\320\\275\\320\\265\\321\\207\\321\\221\\321\\202\\320\\275&\\321\\213\\320\\265 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\321\\213\\0\"\\\n  \"&\\320\\236\\321\\202\\320\\272\\321\\200\\321\\213\\321\\202\\321\\214 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"&\\320\\236\\321\\202\\320\\272\\321\\200\\321\\213\\321\\202\\321\\214...\\tCtrl+O\\0\"\\\n  \"&\\320\\237\\320\\260\\321\\200\\320\\260\\320\\274\\320\\265\\321\\202\\321\\200\\321\\213...\\0\"\\\n  \"&\\320\\237\\320\\260\\321\\200\\320\\276\\320\\273\\321\\214:\\0\"\\\n  \"&\\320\\227\\320\\260\\320\\277\\320\\276\\320\\274\\320\\275\\320\\270\\321\\202\\321\\214 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265&\\320\\264\\321\\213\\320\\264\\321\\203\\321\\211\\320\\260\\321\\217 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\t\\320\\241\\321\\202\\321\\200\\320\\265\\320\\273\\320\\272\\320\\260 \\320\\262\\320\\273\\320\\265\\320\\262\\320\\276\\0\"\\\n  \"\\320\\237\\320\\265&\\321\\207\\320\\260\\321\\202\\321\\214...\\0\"\\\n  \"\\320\\237\\320\\265&\\321\\207\\320\\260\\321\\202\\321\\214...\\tCtrl+P\\0\"\\\n  \"\\320\\237\\320\\265&\\321\\207\\320\\260\\321\\202\\321\\214... (\\320\\276\\321\\202\\320\\274\\320\\265\\320\\275\\320\\260)\\0\"\\\n  \"\\320\\227\\320\\260\\320\\277\\320\\276\\320\\274\\320\\275\\320\\270\\321\\202&\\321\\214 \\320\\277\\320\\260\\321\\200\\320\\276\\320\\273\\321\\214 \\320\\264\\320\\273\\321\\217 \\321\\215\\321\\202\\320\\276\\320\\263\\320\\276 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\260\\0\"\\\n  \"\\320\\227\\320\\260\\320\\277\\320\\276\\320\\274\\320\\275\\320\\270\\321\\202&\\321\\214 \\321\\215\\321\\202\\320\\270 \\320\\277\\320\\260\\321\\200\\320\\260\\320\\274\\320\\265\\321\\202\\321\\200\\321\\213 \\320\\264\\320\\273\\321\\217 \\320\\272\\320\\260\\320\\266\\320\\264\\320\\276\\320\\263\\320\\276 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\260\\0\"\\\n  \"&\\320\\243\\320\\264\\320\\260\\320\\273\\320\\270\\321\\202\\321\\214 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"\\320\\241\\320\\276\\321\\205\\321\\200\\320\\260\\320\\275\\320\\270\\321\\202\\321\\214 &\\320\\272\\320\\260\\320\\272...\\0\"\\\n  \"\\320\\241\\320\\276\\321\\205\\321\\200\\320\\260\\320\\275\\320\\270\\321\\202\\321\\214 &\\320\\272\\320\\260\\320\\272...\\tCtrl+S\\0\"\\\n  \"&\\320\\235\\320\\260\\321\\201\\321\\202\\321\\200\\320\\276\\320\\271\\320\\272\\320\\270\\0\"\\\n  \"\\320\\243\\320\\274\\320\\265\\320\\275\\321\\214\\321\\210\\320\\270\\321\\202\\321\\214 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\321\\213 \\320\\264\\320\\276 \\320\\276\\320\\261\\320\\273\\320\\260\\321\\201\\321\\202\\320\\270 \\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\270 (\\320\\265\\321\\201\\320\\273\\320\\270 \\320\\275\\321\\203\\320\\266\\320\\275\\320\\276)\\0\"\\\n  \"&\\320\\237\\320\\276\\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\207\\320\\275\\320\\276\\tCtrl+6\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\277\\321\\203\\321\\201\\321\\202\\320\\270\\321\\202\\321\\214 \\321\\215\\321\\202\\321\\203 \\320\\262\\320\\265\\321\\200\\321\\201\\320\\270\\321\\216\\0\"\\\n  \"&\\320\\230\\321\\201\\321\\205\\320\\276\\320\\264\\320\\275\\321\\213\\320\\271 \\321\\200\\320\\260\\320\\267\\320\\274\\320\\265\\321\\200 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\0\"\\\n  \"&\\320\\222\\320\\270\\320\\264\\0\"\\\n  \"&\\320\\236\\320\\272\\320\\275\\320\\276\\0\"\\\n  \"&\\320\\224\\320\\260\\0\"\\\n  \"\\320\\234\\320\\260\\321\\201&\\321\\210\\321\\202\\320\\260\\320\\261\\0\"\\\n  \"(\\320\\270\\320\\267 %d)\\0\"\\\n  \"(\\321\\201\\321\\202\\321\\200. %s)\\0\"\\\n  \"\\320\\236 \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\320\\274\\320\\265 SumatraPDF\\0\"\\\n  \"\\320\\224\\320\\276\\320\\261\\320\\260\\320\\262\\320\\270\\321\\202\\321\\214 \\\"\\320\\230\\320\\267\\320\\261\\321\\200\\320\\260\\320\\275\\320\\275\\320\\276\\320\\265\\\"\\0\"\\\n  \"\\320\\224\\320\\276\\320\\261\\320\\260\\320\\262\\320\\270\\321\\202\\321\\214 \\321\\201\\321\\202\\321\\200. %s \\320\\272 \\320\\270\\320\\267\\320\\261\\321\\200\\320\\260\\320\\275\\320\\275\\320\\276\\320\\274\\321\\203\\0\"\\\n  \"\\320\\224\\320\\276\\320\\261\\320\\260\\320\\262\\320\\270\\321\\202\\321\\214 \\321\\201\\321\\202\\321\\200. %s \\320\\272 \\320\\270\\320\\267\\320\\261\\321\\200\\320\\260\\320\\275\\320\\275\\320\\276\\320\\274\\321\\203 \\321\\201 (\\320\\275\\320\\265\\320\\276\\320\\261\\321\\217\\320\\267\\320\\260\\321\\202\\320\\265\\320\\273\\321\\214\\320\\275\\321\\213\\320\\274) \\320\\270\\320\\274\\320\\265\\320\\275\\320\\265\\320\\274:\\0\"\\\n  \"\\320\\224\\320\\276\\320\\261\\320\\260\\320\\262\\320\\270\\321\\202\\321\\214 \\320\\272 \\320\\270\\320\\267\\320\\261\\321\\200\\320\\260\\320\\275\\320\\275\\320\\276\\320\\274\\321\\203\\0\"\\\n  \"\\320\\224\\320\\276\\320\\277\\320\\276\\320\\273\\320\\275\\320\\270\\321\\202\\320\\265\\320\\273\\321\\214\\320\\275\\320\\276\\0\"\\\n  \"\\320\\222\\321\\201\\320\\265 \\321\\204\\320\\260\\320\\271\\320\\273\\321\\213\\0\"\\\n  \"\\320\\222\\321\\201\\320\\265 \\320\\277\\320\\276\\320\\264\\320\\264\\320\\265\\321\\200\\320\\266\\320\\270\\320\\262\\320\\260\\320\\265\\320\\274\\321\\213\\320\\265 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\321\\213\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\273\\320\\276\\320\\266\\320\\265\\320\\275\\320\\270\\320\\265:\\0\"\\\n  \"\\320\\220\\321\\201\\321\\201\\320\\276\\321\\206\\320\\270\\320\\270\\321\\200\\320\\276\\320\\262\\320\\260\\321\\202\\321\\214 \\321\\201 PDF-\\321\\204\\320\\260\\320\\271\\320\\273\\320\\260\\320\\274\\320\\270?\\0\"\\\n  \"\\320\\222\\320\\273\\320\\276\\320\\266\\320\\265\\320\\275\\320\\270\\320\\265: %s\\0\"\\\n  \"\\320\\220\\320\\262\\321\\202\\320\\276\\321\\200:\\0\"\\\n  \"\\320\\220\\320\\262\\321\\202\\320\\276\\320\\274\\320\\260\\321\\202\\320\\270\\321\\207\\320\\265\\321\\201\\320\\272\\320\\270\\0\"\\\n  \"&\\320\\220\\320\\262\\321\\202\\320\\276\\320\\274\\320\\260\\321\\202\\320\\270\\321\\207\\320\\265\\321\\201\\320\\272\\320\\270 \\320\\277\\321\\200\\320\\276\\320\\262\\320\\265\\321\\200\\321\\217\\321\\202\\321\\214 \\320\\276\\320\\261\\320\\275\\320\\276\\320\\262\\320\\273\\320\\265\\320\\275\\320\\270\\321\\217\\0\"\\\n  \"\\320\\222 \\321\\200\\320\\260\\320\\267\\320\\262\\320\\276\\321\\200\\320\\276\\321\\202\\0\"\\\n  \"&\\320\\227\\320\\260\\320\\272\\320\\273\\320\\260\\320\\264\\320\\272\\320\\270\\tF12\\0\"\\\n  \"\\320\\257\\321\\200\\320\\273\\321\\213\\320\\272\\320\\270 \\320\\267\\320\\260\\320\\272\\320\\273\\320\\260\\320\\264\\320\\276\\320\\272\\0\"\\\n  \"\\320\\257\\321\\200\\320\\273\\321\\213\\320\\272 \\320\\267\\320\\260\\320\\272\\320\\273\\320\\260\\320\\264\\320\\272\\320\\270 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200. %s \\320\\270\\320\\267 %s\\0\"\\\n  \"\\320\\227\\320\\260\\320\\272\\320\\273\\320\\260\\320\\264\\320\\272\\320\\270\\0\"\\\n  \"\\320\\221\\320\\260\\320\\271\\321\\202\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\321\\213 CHM\\0\"\\\n  \"\\320\\236\\321\\202\\321\\201\\321\\203\\321\\202\\321\\201\\321\\202\\320\\262\\321\\203\\320\\265\\321\\202 \\321\\201\\320\\276\\320\\265\\320\\264\\320\\270\\320\\275\\320\\265\\320\\275\\320\\270\\320\\265 \\321\\201 \\320\\230\\320\\275\\321\\202\\320\\265\\321\\200\\320\\275\\320\\265\\321\\202\\320\\276\\320\\274 (\\320\\276\\321\\210\\320\\270\\320\\261\\320\\272\\320\\260 %#x).\\0\"\\\n  \"\\320\\236\\321\\202\\320\\274\\320\\265\\320\\275\\320\\260\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\214 \\321\\200\\320\\260\\321\\201\\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\260\\321\\202\\321\\214 \\321\\215\\321\\202\\320\\276\\321\\202 \\321\\204\\320\\260\\320\\271\\320\\273\\0\"\\\n  \"\\320\\236\\321\\210\\320\\270\\320\\261\\320\\272\\320\\260 \\320\\272\\320\\276\\320\\274\\320\\260\\320\\275\\320\\264\\321\\213 \\320\\276\\320\\261\\321\\200\\320\\260\\321\\202\\320\\275\\320\\276\\320\\263\\320\\276 \\320\\277\\320\\276\\320\\270\\321\\201\\320\\272\\320\\260. \\320\\237\\321\\200\\320\\276\\320\\262\\320\\265\\321\\200\\321\\214\\321\\202\\320\\265 \\320\\277\\320\\260\\321\\200\\320\\260\\320\\274\\320\\265\\321\\202\\321\\200\\321\\213 \\320\\272\\320\\276\\320\\274\\320\\260\\320\\275\\320\\264\\320\\275\\320\\276\\320\\271 \\321\\201\\321\\202\\321\\200\\320\\276\\320\\272\\320\\270.\\0\"\\\n  \"\\320\\230\\320\\267\\320\\274\\320\\265\\320\\275\\320\\270\\321\\202\\321\\214 &\\321\\217\\320\\267\\321\\213\\320\\272 (Change Language)\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\262\\320\\265\\321\\200\\320\\270\\321\\202\\321\\214 \\320\\275\\320\\260\\320\\273\\320\\270\\321\\207\\320\\270\\320\\265 \\320\\275\\320\\276\\320\\262\\320\\276\\320\\271 &\\320\\262\\320\\265\\321\\200\\321\\201\\320\\270\\320\\270\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\321\\213 CBR, CBZ (\\320\\272\\320\\276\\320\\274\\320\\270\\320\\272\\321\\201\\321\\213)\\0\"\\\n  \"\\320\\241\\320\\276\\320\\262\\320\\274\\320\\265\\321\\201\\321\\202\\320\\270\\320\\274\\320\\276\\321\\201\\321\\202\\321\\214\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\272\\321\\200\\321\\203\\321\\202\\320\\272\\320\\260 \\320\\277\\320\\276\\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\207\\320\\275\\320\\276\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\272\\321\\200\\321\\203\\321\\202\\320\\272\\320\\260 \\320\\262 \\321\\200\\320\\260\\320\\267\\320\\262\\320\\276\\321\\200\\320\\276\\321\\202\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\272\\321\\200\\321\\203\\321\\202\\320\\272\\320\\260 \\320\\277\\320\\276 \\320\\264\\320\\262\\320\\265 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\321\\213\\0\"\\\n  \"\\320\\237\\320\\276\\320\\274\\320\\276\\321\\207\\321\\214 \\321\\201 \\320\\277\\320\\265\\321\\200\\320\\265\\320\\262\\320\\276\\320\\264\\320\\276\\320\\274\\0\"\\\n  \"\\320\\241\\320\\272\\320\\276\\320\\277\\320\\270\\321\\200\\320\\276\\320\\262\\320\\260\\321\\202\\321\\214 &\\320\\270\\320\\267\\320\\276\\320\\261\\321\\200\\320\\260\\320\\266\\320\\265\\320\\275\\320\\270\\320\\265\\0\"\\\n  \"\\320\\241\\320\\272\\320\\276\\320\\277\\320\\270\\321\\200\\320\\276\\320\\262\\320\\260\\321\\202\\321\\214 \\320\\260\\320\\264\\321\\200\\320\\265\\321\\201 &\\321\\201\\321\\201\\321\\213\\320\\273\\320\\272\\320\\270\\0\"\\\n  \"\\320\\241\\320\\272\\320\\276\\320\\277\\320\\270\\321\\200\\320\\276\\320\\262\\320\\260\\321\\202\\321\\214 \\320\\272\\320\\276&\\320\\274\\320\\274\\320\\265\\320\\275\\321\\202\\320\\260\\321\\200\\320\\270\\320\\271\\0\"\\\n  \"\\320\\241\\320\\272\\320\\276\\320\\277\\320\\270\\321\\200\\320\\276\\320\\262\\320\\260\\321\\202\\321\\214 \\321\\202\\320\\265\\320\\272\\321\\201\\321\\202 \\320\\275\\320\\265\\320\\262\\320\\276\\320\\267\\320\\274\\320\\276\\320\\266\\320\\275\\320\\276 (\\320\\272\\320\\276\\320\\277\\320\\270\\321\\200\\321\\203\\320\\265\\321\\202\\321\\201\\321\\217 \\320\\272\\320\\260\\320\\272 \\320\\270\\320\\267\\320\\276\\320\\261\\321\\200\\320\\260\\320\\266\\320\\265\\320\\275\\320\\270\\320\\265)\\0\"\\\n  \"\\320\\220\\320\\262\\321\\202\\320\\276\\321\\200\\321\\201\\320\\272\\320\\276\\320\\265 \\320\\277\\321\\200\\320\\260\\320\\262\\320\\276:\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\214 \\320\\276\\320\\277\\321\\200\\320\\265\\320\\264\\320\\265\\320\\273\\320\\270\\321\\202\\321\\214 \\321\\201\\320\\262\\320\\276\\320\\271\\321\\201\\321\\202\\320\\262\\320\\260 \\320\\277\\321\\200\\320\\270\\320\\275\\321\\202\\320\\265\\321\\200\\320\\260\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\214 \\320\\270\\320\\275\\320\\270\\321\\206\\320\\270\\320\\260\\320\\273\\320\\270\\320\\267\\320\\270\\321\\200\\320\\276\\320\\262\\320\\260\\321\\202\\321\\214 \\320\\277\\321\\200\\320\\270\\320\\275\\321\\202\\320\\265\\321\\200\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\214 \\321\\201\\321\\204\\320\\276\\321\\200\\320\\274\\320\\270\\321\\200\\320\\276\\320\\262\\320\\260\\321\\202\\321\\214 \\320\\270\\320\\267\\320\\276\\320\\261\\321\\200\\320\\260\\320\\266\\320\\265\\320\\275\\320\\270\\320\\265 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\321\\213\\0\"\\\n  \"\\320\\241\\320\\276\\320\\267\\320\\264\\320\\260\\320\\275:\\0\"\\\n  \"\\320\\242\\320\\265\\320\\272\\321\\203\\321\\211\\320\\270\\320\\271 \\321\\204\\320\\260\\320\\271\\320\\273\\0\"\\\n  \"\\320\\237\\320\\276\\320\\267\\320\\270\\321\\206\\320\\270\\321\\217 \\320\\272\\321\\203\\321\\200\\321\\201\\320\\276\\321\\200\\320\\260:\\0\"\\\n  \"&\\320\\243\\320\\272\\320\\260\\320\\267\\320\\260\\321\\202\\321\\214 \\320\\274\\320\\260\\321\\201\\321\\210\\321\\202\\320\\260\\320\\261...\\tCtrl+Y\\0\"\\\n  \"&\\320\\232\\320\\276\\320\\274\\320\\277\\320\\276\\320\\275\\320\\276\\320\\262\\320\\272\\320\\260 \\320\\277\\320\\276 \\321\\203\\320\\274\\320\\276\\320\\273\\321\\207\\320\\260\\320\\275\\320\\270\\321\\216\\0\"\\\n  \"\\320\\234\\320\\260\\321\\201\\321\\210\\321\\202\\320\\260&\\320\\261 \\320\\277\\320\\276 \\321\\203\\320\\274\\320\\276\\320\\273\\321\\207\\320\\260\\320\\275\\320\\270\\321\\216\\0\"\\\n  \"\\320\\222 \\320\\274\\320\\276\\320\\261\\320\\270\\320\\273\\321\\214\\320\\275\\320\\276\\320\\274 \\321\\200\\320\\265\\320\\266\\320\\270\\320\\274\\320\\265 \\320\\260\\321\\201\\321\\201\\320\\276\\321\\206\\320\\270\\320\\270\\321\\200\\320\\276\\320\\262\\320\\260\\320\\275\\320\\270\\320\\265 \\320\\275\\320\\265\\320\\262\\320\\276\\320\\267\\320\\274\\320\\276\\320\\266\\320\\275\\320\\276\\0\"\\\n  \"\\320\\227\\320\\260\\320\\277\\321\\200\\320\\265\\321\\211\\321\\221\\320\\275\\320\\275\\321\\213\\320\\265 \\320\\277\\321\\200\\320\\260\\320\\262\\320\\260:\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\321\\213 DjVu\\0\"\\\n  \"\\320\\241\\320\\262\\320\\276\\320\\271\\321\\201\\321\\202\\320\\262\\320\\260 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\260\\0\"\\\n  \"\\320\\227\\320\\260\\320\\263\\321\\200\\321\\203\\320\\267\\320\\272\\320\\260\\0\"\\\n  \"\\320\\222&\\321\\213\\321\\205\\320\\276\\320\\264\\tCtrl+Q\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\321\\213 EPUB\\0\"\\\n  \"\\320\\222\\320\\262\\320\\265\\320\\264\\320\\270\\321\\202\\320\\265 \\320\\277\\320\\260\\321\\200\\320\\276\\320\\273\\321\\214\\0\"\\\n  \"\\320\\222\\320\\262\\320\\265\\320\\264\\320\\270\\321\\202\\320\\265 \\320\\277\\320\\260\\321\\200\\320\\276\\320\\273\\321\\214 \\320\\264\\320\\273\\321\\217 %s\\0\"\\\n  \"\\320\\222\\320\\262\\320\\265\\320\\264\\320\\270\\321\\202\\320\\265 \\320\\272\\320\\276\\320\\274\\320\\260\\320\\275\\320\\264\\320\\275\\321\\203\\321\\216 \\321\\201\\321\\202\\321\\200\\320\\276\\320\\272\\321\\203, \\320\\262\\321\\213\\320\\267\\321\\213\\320\\262\\320\\260\\320\\265\\320\\274\\321\\203\\321\\216 \\320\\277\\321\\200\\320\\270 \\320\\264\\320\\262\\320\\276\\320\\271\\320\\275\\320\\276\\320\\274 \\321\\211\\320\\265\\320\\273\\321\\207\\320\\272\\320\\265 \\320\\275\\320\\260 PDF-\\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\265:\\0\"\\\n  \"\\320\\236\\321\\210\\320\\270\\320\\261\\320\\272\\320\\260 \\320\\267\\320\\260\\320\\263\\321\\200\\321\\203\\320\\267\\320\\272\\320\\270 %s\\0\"\\\n  \"&\\320\\230\\320\\267\\320\\261\\321\\200\\320\\260\\320\\275\\320\\275\\320\\276\\320\\265\\0\"\\\n  \"&\\320\\222\\320\\277\\320\\265\\321\\200\\321\\221\\320\\264\\tAlt+\\320\\241\\321\\202\\321\\200\\320\\265\\320\\273\\320\\272\\320\\260 \\320\\262\\320\\277\\321\\200\\320\\260\\320\\262\\320\\276\\0\"\\\n  \"\\320\\237\\320\\276\\320\\273\\320\\275\\321\\213\\320\\271 &\\321\\215\\320\\272\\321\\200\\320\\260\\320\\275\\tF11\\0\"\\\n  \"\\320\\237\\320\\276 \\320\\264\\320\\262\\320\\265 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\321\\213\\0\"\\\n  \"\\320\\236\\321\\210\\320\\270\\320\\261\\320\\272\\320\\260 \\320\\277\\320\\265\\321\\200\\320\\265\\320\\270\\320\\274\\320\\265\\320\\275\\320\\276\\320\\262\\320\\260\\320\\275\\320\\270\\321\\217 \\321\\204\\320\\260\\320\\271\\320\\273\\320\\260!\\0\"\\\n  \"\\320\\236\\321\\210\\320\\270\\320\\261\\320\\272\\320\\260 \\321\\201\\320\\276\\321\\205\\321\\200\\320\\260\\320\\275\\320\\265\\320\\275\\320\\270\\321\\217 \\321\\204\\320\\260\\320\\271\\320\\273\\320\\260\\0\"\\\n  \"\\320\\221\\321\\213\\321\\201\\321\\202\\321\\200\\321\\213\\320\\271 \\320\\277\\321\\200\\320\\276\\321\\201\\320\\274\\320\\276\\321\\202\\321\\200 \\320\\262 \\320\\230\\320\\275\\321\\202\\320\\265\\321\\200\\320\\275\\320\\265\\321\\202\\320\\265\\0\"\\\n  \"\\320\\230\\320\\267\\320\\261\\321\\200\\320\\260\\320\\275\\320\\275\\320\\276\\320\\265\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\321\\213 FictionBook\\0\"\\\n  \"\\320\\244\\320\\260\\320\\271\\320\\273 %s \\320\\275\\320\\265 \\320\\275\\320\\260\\320\\271\\320\\264\\320\\265\\320\\275\\0\"\\\n  \"\\320\\240\\320\\260\\320\\267\\320\\274\\320\\265\\321\\200 \\321\\204\\320\\260\\320\\271\\320\\273\\320\\260:\\0\"\\\n  \"\\320\\244\\320\\260\\320\\271\\320\\273:\\0\"\\\n  \"\\320\\235\\320\\260&\\320\\271\\321\\202\\320\\270...\\tCtrl+F\\0\"\\\n  \"\\320\\237\\320\\276\\320\\270\\321\\201\\320\\272\\0\"\\\n  \"\\320\\235\\320\\260\\320\\271\\321\\202\\320\\270 \\321\\201\\320\\273\\320\\265\\320\\264\\321\\203\\321\\216\\321\\211\\320\\265\\320\\265\\0\"\\\n  \"\\320\\235\\320\\260\\320\\271\\321\\202\\320\\270 \\320\\277\\321\\200\\320\\265\\320\\264\\321\\213\\320\\264\\321\\203\\321\\211\\320\\265\\320\\265\\0\"\\\n  \"\\320\\235\\320\\260\\320\\271\\321\\202\\320\\270:\\0\"\\\n  \"\\320\\237\\320\\276 \\321\\201\\320\\276\\320\\264\\320\\265\\321\\200&\\320\\266\\320\\270\\320\\274\\320\\276\\320\\274\\321\\203\\tCtrl+3\\0\"\\\n  \"\\320\\237\\320\\276 &\\321\\200\\320\\260\\320\\267\\320\\274\\320\\265\\321\\200\\321\\203 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\321\\213\\tCtrl+0\\0\"\\\n  \"\\320\\237\\320\\276 &\\321\\210\\320\\270\\321\\200\\320\\270\\320\\275\\320\\265\\tCtrl+2\\0\"\\\n  \"\\320\\237\\320\\276 \\321\\201\\320\\276\\320\\264\\320\\265\\321\\200\\320\\266\\320\\270\\320\\274\\320\\276\\320\\274\\321\\203\\0\"\\\n  \"\\320\\237\\320\\276 \\321\\200\\320\\260\\320\\267\\320\\274\\320\\265\\321\\200\\321\\203 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\321\\213\\0\"\\\n  \"\\320\\237\\320\\276 \\321\\210\\320\\270\\321\\200\\320\\270\\320\\275\\320\\265\\0\"\\\n  \"\\320\\237\\320\\276\\320\\264\\320\\276\\320\\263\\320\\275\\320\\260\\321\\202\\321\\214 \\320\\277\\320\\276 \\321\\210\\320\\270\\321\\200\\320\\270\\320\\275\\320\\265 \\320\\276\\320\\272\\320\\275\\320\\260 \\320\\270 \\321\\200\\320\\260\\320\\267\\321\\200\\320\\265\\321\\210\\320\\270\\321\\202\\321\\214 \\320\\277\\321\\200\\320\\276\\320\\272\\321\\200\\321\\203\\321\\202\\320\\272\\321\\203\\0\"\\\n  \"\\320\\237\\320\\276\\320\\264\\320\\276\\320\\263\\320\\275\\320\\260\\321\\202\\321\\214 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\321\\203 \\320\\277\\320\\276 \\321\\200\\320\\260\\320\\267\\320\\274\\320\\265\\321\\200\\321\\203 \\320\\276\\320\\272\\320\\275\\320\\260\\0\"\\\n  \"\\320\\250\\321\\200\\320\\270\\321\\204\\321\\202\\321\\213:\\0\"\\\n  \"\\320\\244\\320\\276\\321\\200\\320\\274\\320\\260\\321\\202\\320\\270\\321\\200\\320\\276\\320\\262\\320\\260\\320\\275\\320\\270\\320\\265 \\320\\272\\320\\275\\320\\270\\320\\263\\320\\270... %d \\321\\201\\321\\202\\321\\200.\\0\"\\\n  \"\\320\\242\\320\\265\\320\\272\\321\\201\\321\\202 \\320\\275\\320\\260\\320\\271\\320\\264\\320\\265\\320\\275 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200. %s\\0\"\\\n  \"\\320\\242\\320\\265\\320\\272\\321\\201\\321\\202 \\320\\275\\320\\260\\320\\271\\320\\264\\320\\265\\320\\275 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200. %s (\\320\\277\\320\\276\\320\\262\\321\\202\\320\\276\\321\\200\\320\\275\\320\\276)\\0\"\\\n  \"\\320\\247\\320\\260\\321\\201\\321\\202\\320\\276 \\320\\270\\321\\201\\320\\277\\320\\276\\320\\273\\321\\214\\320\\267\\321\\203\\320\\265\\320\\274\\321\\213\\320\\265 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\321\\213\\0\"\\\n  \"\\320\\223\\320\\261\\0\"\\\n  \"\\320\\237\\320\\265\\321\\200\\320\\265\\320\\271\\321\\202\\320\\270 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\321\\203\\0\"\\\n  \"\\320\\241\\320\\272\\321\\200\\321\\213\\321\\202\\321\\214 \\321\\207\\320\\260\\321\\201\\321\\202\\320\\276 \\320\\270\\321\\201\\320\\277\\320\\276\\320\\273\\321\\214\\320\\267\\321\\203\\320\\265\\320\\274\\321\\213\\320\\265 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\321\\213\\0\"\\\n  \"\\320\\224\\320\\273\\321\\217 \\320\\277\\320\\276\\320\\262\\321\\202\\320\\276\\321\\200\\320\\275\\320\\276\\320\\263\\320\\276 \\320\\277\\320\\276\\320\\270\\321\\201\\320\\272\\320\\260 \\320\\275\\320\\260\\320\\266\\320\\274\\320\\270\\321\\202\\320\\265 <F3>\\0\"\\\n  \"\\320\\244\\320\\260\\320\\271\\320\\273\\321\\213 \\320\\270\\320\\267\\320\\276\\320\\261\\321\\200\\320\\260\\320\\266\\320\\265\\320\\275\\320\\270\\320\\271 (*.%s)\\0\"\\\n  \"\\320\\232\\320\\261\\0\"\\\n  \"\\320\\234\\320\\261\\0\"\\\n  \"\\320\\241\\320\\264\\320\\265\\320\\273\\320\\260\\321\\202\\321\\214 SumatraPDF \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\320\\274\\320\\276\\320\\271 \\320\\277\\321\\200\\320\\276\\321\\201\\320\\274\\320\\276\\321\\202\\321\\200\\320\\260 PDF-\\321\\204\\320\\260\\320\\271\\320\\273\\320\\276\\320\\262 \\320\\277\\320\\276 \\321\\203\\320\\274\\320\\276\\320\\273\\321\\207\\320\\260\\320\\275\\320\\270\\321\\216?\\0\"\\\n  \"\\320\\220\\321\\201\\321\\201\\320\\276\\321\\206\\320\\270\\320\\270\\321\\200\\320\\276\\320\\262\\320\\260\\321\\202\\321\\214 SumatraPDF \\321\\201 \\321\\204\\320\\260\\320\\271\\320\\273\\320\\260\\320\\274\\320\\270 PDF\\0\"\\\n  \"\\320\\240\\320\\265\\320\\266\\320\\270\\320\\274 Man&ga\\0\"\\\n  \"\\320\\243\\321\\207\\320\\270\\321\\202\\321\\213\\320\\262\\320\\260\\321\\202\\321\\214 \\321\\200\\320\\265\\320\\263\\320\\270\\321\\201\\321\\202\\321\\200\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\321\\213 Mobi\\0\"\\\n  \"\\320\\230\\320\\267\\320\\274\\320\\265\\320\\275\\321\\221\\320\\275:\\0\"\\\n  \"\\320\\224\\320\\276\\321\\201\\321\\202\\321\\203\\320\\277\\320\\275\\320\\260 \\320\\275\\320\\276\\320\\262\\320\\260\\321\\217 \\320\\262\\320\\265\\321\\200\\321\\201\\320\\270\\321\\217: %s. \\320\\227\\320\\260\\320\\263\\321\\200\\321\\203\\320\\267\\320\\270\\321\\202\\321\\214 \\320\\265\\321\\221?\\0\"\\\n  \"\\320\\241\\320\\273\\320\\265\\320\\264\\321\\203\\321\\216\\321\\211\\320\\260\\321\\217 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\0\"\\\n  \"\\320\\241\\320\\276\\320\\262\\320\\277\\320\\260\\320\\264\\320\\265\\320\\275\\320\\270\\320\\271 \\320\\275\\320\\265 \\320\\275\\320\\260\\320\\271\\320\\264\\320\\265\\320\\275\\320\\276\\0\"\\\n  \"\\320\\240\\320\\265\\320\\267\\321\\203\\320\\273\\321\\214\\321\\202\\320\\260\\321\\202, \\321\\201\\320\\276\\320\\276\\321\\202\\320\\262\\320\\265\\321\\202\\321\\201\\321\\202\\320\\262\\321\\203\\321\\216\\321\\211\\320\\270\\320\\271 \\321\\201\\321\\202\\321\\200\\320\\276\\320\\272\\320\\265 %u \\320\\262 \\321\\204\\320\\260\\320\\271\\320\\273\\320\\265 %s, \\320\\275\\320\\265 \\320\\275\\320\\260\\320\\271\\320\\264\\320\\265\\320\\275\\0\"\\\n  \"\\320\\244\\320\\260\\320\\271\\320\\273 \\321\\201\\320\\270\\320\\275\\321\\205\\321\\200\\320\\276\\320\\275\\320\\270\\320\\267\\320\\260\\321\\206\\320\\270\\320\\270 \\320\\275\\320\\265 \\320\\275\\320\\260\\320\\271\\320\\264\\320\\265\\320\\275\\0\"\\\n  \"\\320\\222 \\321\\215\\321\\202\\320\\276\\320\\271 \\320\\277\\320\\276\\320\\267\\320\\270\\321\\206\\320\\270\\320\\270 \\320\\275\\320\\265\\321\\202 \\320\\270\\320\\275\\321\\204\\320\\276\\321\\200\\320\\274\\320\\260\\321\\206\\320\\270\\320\\270 \\320\\264\\320\\273\\321\\217 \\321\\201\\320\\270\\320\\275\\321\\205\\321\\200\\320\\276\\320\\275\\320\\270\\320\\267\\320\\260\\321\\206\\320\\270\\320\\270\\0\"\\\n  \"\\320\\247\\320\\270\\321\\201\\320\\273\\320\\276 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206:\\0\"\\\n  \"\\0\"\\\n  \"\\320\\236\\321\\202\\320\\272\\321\\200\\321\\213\\321\\202\\321\\214\\0\"\\\n  \"\\320\\236\\321\\202\\320\\272\\321\\200\\321\\213\\321\\202\\321\\214 \\320\\262 PDF-XChange\\0\"\\\n  \"\\320\\236\\321\\202\\320\\272\\321\\200\\321\\213\\321\\202\\321\\214 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202...\\0\"\\\n  \"\\320\\236\\321\\202\\320\\272\\321\\200\\321\\213\\321\\202\\321\\214 \\320\\262 %s\\0\"\\\n  \"\\320\\236&\\321\\202\\320\\272\\321\\200\\321\\213\\321\\202\\321\\214 \\320\\262 Adobe Reader\\0\"\\\n  \"\\320\\236\\321\\202\\320\\272&\\321\\200\\321\\213\\321\\202\\321\\214 \\320\\262 Foxit Reader\\0\"\\\n  \"\\320\\236\\321\\202\\320\\272\\321\\200\\321\\213\\321\\202\\321\\214 \\320\\262 Microsoft HTML Help\\0\"\\\n  \"\\320\\236\\321\\202\\320\\272\\321\\200\\321\\213\\321\\202\\321\\214 \\320\\262 Microsoft XPS-Viewer\\0\"\\\n  \"\\320\\241\\320\\262\\320\\276&\\320\\271\\321\\201\\321\\202\\320\\262\\320\\260...\\0\"\\\n  \"\\320\\241\\320\\262\\320\\276&\\320\\271\\321\\201\\321\\202\\320\\262\\320\\260...\\tCtrl+D\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202 PDF\\0\"\\\n  \"\\320\\236\\320\\277\\321\\202\\320\\270\\320\\274\\320\\270\\320\\267\\320\\260\\321\\206\\320\\270\\321\\217 PDF:\\0\"\\\n  \"\\320\\241\\320\\276\\320\\267\\320\\264\\320\\260\\321\\202\\320\\265\\320\\273\\321\\214 PDF:\\0\"\\\n  \"\\320\\222\\320\\265\\321\\200\\321\\201\\320\\270\\321\\217 PDF:\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\321\\213 PDF\\0\"\\\n  \"&\\320\\243\\320\\272\\320\\260\\320\\267\\320\\260\\320\\275\\320\\275\\320\\260\\321\\217 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260...\\tCtrl+G\\0\"\\\n  \"\\320\\241\\321\\202\\321\\200. %s\\0\"\\\n  \"\\320\\244\\320\\276\\321\\200\\320\\274\\320\\260\\321\\202 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\321\\213:\\0\"\\\n  \"\\320\\241\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 %u \\320\\275\\320\\265 \\321\\201\\321\\203\\321\\211\\320\\265\\321\\201\\321\\202\\320\\262\\321\\203\\320\\265\\321\\202\\0\"\\\n  \"\\320\\234\\320\\260\\321\\201\\321\\210\\321\\202\\320\\260\\320\\261\\320\\270\\321\\200\\320\\276\\320\\262\\320\\260\\320\\275\\320\\270\\320\\265 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\0\"\\\n  \"\\320\\241\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260:\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\321\\213 PalmDoc\\0\"\\\n  \"\\320\\244\\320\\276\\321\\200\\320\\274\\320\\270\\321\\200\\321\\203\\320\\265\\321\\202\\321\\201\\321\\217 \\320\\270\\320\\267\\320\\276\\320\\261\\321\\200\\320\\260\\320\\266\\320\\265\\320\\275\\320\\270\\320\\265, \\320\\277\\320\\276\\320\\264\\320\\276\\320\\266\\320\\264\\320\\270\\321\\202\\320\\265...\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\321\\213 Postscript\\0\"\\\n  \"\\320\\237\\321\\200&\\320\\265\\320\\267\\320\\265\\320\\275\\321\\202\\320\\260\\321\\206\\320\\270\\321\\217\\tF5\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\320\\264\\321\\213\\320\\264\\321\\203\\321\\211\\320\\260\\321\\217 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\0\"\\\n  \"\\320\\237\\320\\265\\321\\207\\320\\260\\321\\202\\321\\214\\0\"\\\n  \"\\320\\224\\320\\270\\320\\260\\320\\277\\320\\260\\320\\267\\320\\276\\320\\275 \\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\270\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\275\\321\\202\\320\\265\\321\\200 \\321\\201 \\320\\264\\320\\260\\320\\275\\320\\275\\321\\213\\320\\274 \\320\\270\\320\\274\\320\\265\\320\\275\\320\\265\\320\\274 \\320\\275\\320\\265 \\320\\275\\320\\260\\320\\271\\320\\264\\320\\265\\320\\275\\0\"\\\n  \"\\320\\230\\320\\264\\321\\221\\321\\202 \\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\321\\214.\\0\"\\\n  \"\\320\\237\\320\\265\\321\\207\\320\\260\\321\\202\\321\\214 \\320\\265\\321\\211\\321\\221 \\320\\275\\320\\265 \\320\\267\\320\\260\\320\\262\\320\\265\\321\\200\\321\\210\\320\\265\\320\\275\\320\\260. \\320\\236\\321\\202\\320\\274\\320\\265\\320\\275\\320\\270\\321\\202\\321\\214 \\320\\270 \\320\\262\\321\\213\\320\\271\\321\\202\\320\\270?\\0\"\\\n  \"\\320\\237\\320\\265\\321\\207\\320\\260\\321\\202\\321\\214 \\320\\265\\321\\211\\321\\221 \\320\\275\\320\\265 \\320\\267\\320\\260\\320\\262\\320\\265\\321\\200\\321\\210\\320\\265\\320\\275\\320\\260. \\320\\236\\321\\202\\320\\274\\320\\265\\320\\275\\320\\270\\321\\202\\321\\214 \\320\\270 \\320\\275\\320\\260\\321\\207\\320\\260\\321\\202\\321\\214 \\320\\267\\320\\260\\320\\275\\320\\276\\320\\262\\320\\276?\\0\"\\\n  \"\\320\\237\\320\\265\\321\\207\\320\\260\\321\\202\\321\\214 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\321\\213 %d \\320\\270\\320\\267 %d...\\0\"\\\n  \"\\320\\236\\321\\210\\320\\270\\320\\261\\320\\272\\320\\260 \\320\\277\\321\\200\\320\\270 \\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\320\\270.\\0\"\\\n  \"\\320\\237\\320\\265\\321\\200\\320\\265&\\320\\270\\320\\274\\320\\265\\320\\275\\320\\276\\320\\262\\320\\260\\321\\202\\321\\214...\\tF2\\0\"\\\n  \"\\320\\227\\320\\260\\320\\277\\320\\276\\320\\274\\320\\270\\320\\275\\320\\260\\321\\202\\321\\214 &\\320\\276\\321\\202\\320\\272\\321\\200\\321\\213\\321\\202\\321\\213\\320\\265 \\321\\204\\320\\260\\320\\271\\320\\273\\321\\213\\0\"\\\n  \"\\320\\243\\320\\264\\320\\260\\320\\273\\320\\270\\321\\202\\321\\214 \\320\\270\\320\\267 \\320\\270\\320\\267\\320\\261\\321\\200\\320\\260\\320\\275\\320\\275\\320\\276\\320\\263\\320\\276\\0\"\\\n  \"\\320\\243\\320\\264\\320\\260\\320\\273\\320\\270\\321\\202\\321\\214 \\321\\201\\321\\202\\321\\200. %s \\320\\270\\320\\267 \\320\\270\\320\\267\\320\\261\\321\\200\\320\\260\\320\\275\\320\\275\\320\\276\\320\\263\\320\\276\\0\"\\\n  \"\\320\\237\\320\\265\\321\\200\\320\\265\\320\\270\\320\\274\\320\\265\\320\\275\\320\\276\\320\\262\\320\\260\\321\\202\\321\\214 \\320\\262\\0\"\\\n  \"\\320\\237\\320\\276\\320\\262\\320\\265\\321\\200\\320\\275\\321\\203\\321\\202\\321\\214 \\320\\262&\\320\\273\\320\\265\\320\\262\\320\\276\\tCtrl+Shift+-\\0\"\\\n  \"\\320\\237\\320\\276\\320\\262\\320\\265\\321\\200\\320\\275\\321\\203\\321\\202\\321\\214 \\320\\262&\\320\\277\\321\\200\\320\\260\\320\\262\\320\\276\\tCtrl+Shift++\\0\"\\\n  \"\\320\\241\\320\\276\\321\\205\\321\\200\\320\\260\\320\\275\\320\\270\\321\\202\\321\\214 \\320\\272\\320\\260\\320\\272\\0\"\\\n  \"\\320\\241\\320\\276\\321\\205\\321\\200\\320\\260\\320\\275\\320\\270\\321\\202\\321\\214 &\\321\\217\\321\\200\\320\\273\\321\\213\\320\\272\\342\\200\\246\\tCtrl+Shift+S\\0\"\\\n  \"\\320\\236\\320\\261\\321\\200\\320\\260\\320\\261\\320\\276\\321\\202\\320\\272\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\321\\213 %d \\320\\270\\320\\267 %d...\\0\"\\\n  \"\\320\\222&\\321\\213\\320\\264\\320\\265\\320\\273\\320\\270\\321\\202\\321\\214 \\320\\262\\321\\201\\320\\265\\0\"\\\n  \"\\320\\222&\\321\\213\\320\\264\\320\\265\\320\\273\\320\\270\\321\\202\\321\\214 \\320\\262\\321\\201\\320\\265\\tCtrl+A\\0\"\\\n  \"\\320\\222\\321\\213\\320\\261\\320\\265\\321\\200\\320\\270\\321\\202\\320\\265 \\321\\201\\320\\276\\320\\264\\320\\265\\321\\200\\320\\266\\320\\270\\320\\274\\320\\276\\320\\265, \\320\\275\\320\\260\\320\\266\\320\\260\\320\\262 Ctrl \\320\\270 \\320\\273\\320\\265\\320\\262\\321\\203\\321\\216 \\320\\272\\320\\275\\320\\276\\320\\277\\320\\272\\321\\203 \\320\\274\\321\\213\\321\\210\\320\\270\\0\"\\\n  \"\\320\\222\\321\\213\\320\\264\\320\\265\\320\\273\\320\\265\\320\\275\\320\\270\\320\\265:\\0\"\\\n  \"\\320\\236\\321\\202\\320\\277\\321\\200\\320\\260\\320\\262\\320\\270\\321\\202\\321\\214 \\320\\277\\320\\276 &\\321\\215\\320\\273\\320\\265\\320\\272\\321\\202\\321\\200\\320\\276\\320\\275\\320\\275\\320\\276\\320\\271 \\320\\277\\320\\276\\321\\207\\321\\202\\320\\265...\\0\"\\\n  \"\\320\\227\\320\\260\\320\\264\\320\\260\\321\\202\\321\\214 \\320\\272\\320\\276\\320\\274\\320\\260\\320\\275\\320\\264\\321\\203 \\320\\276\\320\\261\\321\\200\\320\\260\\321\\202\\320\\275\\320\\276\\320\\263\\320\\276 \\320\\277\\320\\276\\320\\270\\321\\201\\320\\272\\320\\260\\0\"\\\n  \"\\320\\237\\320\\276\\320\\272\\320\\260\\320\\267\\320\\260\\321\\202\\321\\214 &\\320\\267\\320\\260\\320\\272\\320\\273\\320\\260\\320\\264\\320\\272\\320\\270\\0\"\\\n  \"\\320\\240\\320\\260\\320\\267\\321\\200\\320\\265\\321\\210\\320\\270\\321\\202\\321\\214 &\\320\\277\\321\\200\\320\\276\\320\\272\\321\\200\\321\\203\\321\\202\\320\\272\\321\\203\\0\"\\\n  \"\\320\\237\\320\\260\\320\\275\\320\\265\\320\\273\\321\\214 &\\320\\270\\320\\275\\321\\201\\321\\202\\321\\200\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\276\\320\\262\\0\"\\\n  \"\\320\\237\\320\\276\\320\\272\\320\\260\\320\\267\\320\\260\\321\\202\\321\\214 \\\"\\320\\230\\320\\267\\320\\261\\321\\200\\320\\260\\320\\275\\320\\275\\320\\276\\320\\265\\\"\\0\"\\\n  \"\\320\\237\\320\\276\\320\\272\\320\\260\\320\\267\\320\\260\\321\\202\\321\\214 \\321\\207\\320\\260\\321\\201\\321\\202\\320\\276 \\320\\270\\321\\201\\320\\277\\320\\276\\320\\273\\321\\214\\320\\267\\321\\203\\320\\265\\320\\274\\321\\213\\320\\265 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\321\\213\\0\"\\\n  \"\\320\\237\\320\\276\\320\\272\\320\\260\\320\\267\\321\\213\\320\\262\\320\\260\\321\\202\\321\\214 \\320\\277\\320\\260\\320\\275\\320\\265\\320\\273\\321\\214 &\\320\\267\\320\\260\\320\\272\\320\\273\\320\\260\\320\\264\\320\\276\\320\\272 (\\320\\277\\320\\276 \\320\\262\\320\\276\\320\\267\\320\\274\\320\\276\\320\\266\\320\\275\\320\\276\\321\\201\\321\\202\\320\\270)\\0\"\\\n  \"\\320\\237\\320\\276\\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\207\\320\\275\\320\\276\\0\"\\\n  \"\\320\\230\\320\\267\\320\\262\\320\\270\\320\\275\\320\\270\\321\\202\\320\\265, \\320\\277\\321\\200\\320\\276\\320\\270\\320\\267\\320\\276\\321\\210\\320\\273\\320\\276 \\321\\207\\321\\202\\320\\276-\\321\\202\\320\\276 \\320\\275\\320\\265\\320\\277\\321\\200\\320\\265\\320\\264\\320\\262\\320\\270\\320\\264\\320\\265\\320\\275\\320\\275\\320\\276\\320\\265.\\n\\n\\320\\235\\320\\260\\320\\266\\320\\274\\320\\270\\321\\202\\320\\265 '\\320\\236\\321\\202\\320\\274\\320\\265\\320\\275\\320\\260', \\320\\265\\321\\201\\320\\273\\320\\270 \\321\\205\\320\\276\\321\\202\\320\\270\\321\\202\\320\\265 \\320\\277\\320\\276\\320\\274\\320\\276\\321\\207\\321\\214 \\320\\275\\320\\260\\320\\274 \\321\\203\\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\202\\321\\214 \\320\\277\\321\\200\\320\\270\\321\\207\\320\\270\\320\\275\\321\\203 \\321\\215\\321\\202\\320\\276\\320\\263\\320\\276 \\321\\201\\320\\261\\320\\276\\321\\217.\\0\"\\\n  \"\\320\\235\\320\\265\\321\\202 \\321\\202\\320\\276\\321\\207\\320\\272\\320\\270 \\321\\201\\320\\270\\320\\275\\321\\205\\321\\200\\320\\276\\320\\275\\320\\270\\320\\267\\320\\260\\321\\206\\320\\270\\320\\270 \\320\\262 \\320\\270\\321\\201\\321\\205\\320\\276\\320\\264\\320\\275\\320\\276\\320\\274 \\321\\204\\320\\260\\320\\271\\320\\273\\320\\265 %s\\0\"\\\n  \"\\320\\242\\320\\265\\320\\274\\320\\260:\\0\"\\\n  \"\\320\\237\\320\\260\\321\\200\\320\\260\\320\\274\\320\\265\\321\\202\\321\\200\\321\\213 SumatraPDF\\0\"\\\n  \"\\320\\236\\320\\261\\320\\275\\320\\276\\320\\262\\320\\273\\320\\265\\320\\275\\320\\270\\320\\265 SumatraPDF\\0\"\\\n  \"\\320\\220\\320\\262\\320\\260\\321\\200\\320\\270\\320\\271\\320\\275\\320\\276\\320\\265 \\320\\267\\320\\260\\320\\262\\320\\265\\321\\200\\321\\210\\320\\265\\320\\275\\320\\270\\320\\265 \\321\\200\\320\\260\\320\\261\\320\\276\\321\\202\\321\\213 SumatraPDF\\0\"\\\n  \"SumatraPDF \\320\\260\\321\\201\\321\\201\\320\\276\\321\\206\\320\\270\\320\\270\\321\\200\\320\\276\\320\\262\\320\\260\\320\\275\\320\\260 \\321\\201 \\321\\204\\320\\260\\320\\271\\320\\273\\320\\260\\320\\274\\320\\270 PDF\\0\"\\\n  \"\\320\\242\\320\\265\\320\\277\\320\\265\\321\\200\\321\\214 SumatraPDF \\320\\260\\321\\201\\321\\201\\320\\276\\321\\206\\320\\270\\320\\270\\321\\200\\320\\276\\320\\262\\320\\260\\320\\275\\320\\260 \\321\\201 \\321\\204\\320\\260\\320\\271\\320\\273\\320\\260\\320\\274\\320\\270 PDF\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\214 \\320\\276\\321\\202\\320\\272\\321\\200\\321\\213\\321\\202\\321\\214 \\321\\204\\320\\260\\320\\271\\320\\273 \\321\\201 \\320\\270\\320\\275\\321\\204\\320\\276\\321\\200\\320\\274\\320\\260\\321\\206\\320\\270\\320\\265\\320\\271 \\320\\264\\320\\273\\321\\217 \\321\\201\\320\\270\\320\\275\\321\\205\\321\\200\\320\\276\\320\\275\\320\\270\\320\\267\\320\\260\\321\\206\\320\\270\\320\\270\\0\"\\\n  \"\\320\\240\\320\\260\\320\\267\\320\\274\\320\\265\\321\\207\\320\\265\\320\\275\\320\\275\\321\\213\\320\\271 PDF\\0\"\\\n  \"\\320\\242\\320\\265\\320\\272\\321\\201\\321\\202\\320\\276\\320\\262\\321\\213\\320\\265 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\321\\213\\0\"\\\n  \"\\320\\255\\321\\202\\320\\276\\321\\202 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202 \\320\\270\\321\\201\\320\\277\\320\\276\\320\\273\\321\\214\\320\\267\\321\\203\\320\\265\\321\\202 \\320\\275\\320\\265\\320\\277\\320\\276\\320\\264\\320\\264\\320\\265\\321\\200\\320\\266\\320\\270\\320\\262\\320\\260\\320\\265\\320\\274\\321\\213\\320\\265 \\321\\204\\321\\203\\320\\275\\320\\272\\321\\206\\320\\270\\320\\270 (%s) \\320\\270 \\320\\274\\320\\276\\320\\266\\320\\265\\321\\202 \\320\\276\\321\\202\\320\\276\\320\\261\\321\\200\\320\\260\\320\\266\\320\\260\\321\\202\\321\\214\\321\\201\\321\\217 \\321\\201 \\320\\276\\321\\210\\320\\270\\320\\261\\320\\272\\320\\260\\320\\274\\320\\270\\0\"\\\n  \"\\320\\235\\320\\260\\320\\267\\320\\262\\320\\260\\320\\275\\320\\270\\320\\265:\\0\"\\\n  \"\\320\\235\\320\\265\\320\\270\\320\\267\\320\\262\\320\\265\\321\\201\\321\\202\\320\\275\\321\\213\\320\\271 \\320\\270\\321\\201\\321\\205\\320\\276\\320\\264\\320\\275\\321\\213\\320\\271 \\321\\204\\320\\260\\320\\271\\320\\273 (%s)\\0\"\\\n  \"\\320\\230\\321\\201\\320\\277\\320\\276\\320\\273\\321\\214\\320\\267\\320\\276\\320\\262\\320\\260\\321\\202\\321\\214 &\\320\\262\\320\\272\\320\\273\\320\\260\\320\\264\\320\\272\\320\\270\\0\"\\\n  \"\\320\\222\\320\\270\\320\\264\\0\"\\\n  \"\\320\\237\\320\\276\\321\\201\\320\\265\\321\\202\\320\\270\\321\\202\\321\\214 &\\321\\201\\320\\260\\320\\271\\321\\202 \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\320\\274\\321\\213\\0\"\\\n  \"\\320\\222\\320\\275\\320\\270\\320\\274\\320\\260\\320\\275\\320\\270\\320\\265\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\321\\213 XPS\\0\"\\\n  \"\\320\\222\\321\\213 \\320\\270\\321\\201\\320\\277\\320\\276\\320\\273\\321\\214\\320\\267\\321\\203\\320\\265\\321\\202\\320\\265 \\321\\201\\320\\260\\320\\274\\321\\203\\321\\216 \\320\\275\\320\\276\\320\\262\\321\\203\\321\\216 \\320\\262\\320\\265\\321\\200\\321\\201\\320\\270\\321\\216 \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\320\\274\\321\\213.\\0\"\\\n  \"\\320\\222\\321\\213 \\320\\270\\321\\201\\320\\277\\320\\276\\320\\273\\321\\214\\320\\267\\321\\203\\320\\265\\321\\202\\320\\265 \\320\\262\\320\\265\\321\\200\\321\\201\\320\\270\\321\\216 %s\\0\"\\\n  \"\\320\\234\\320\\260\\321\\201\\321\\210\\321\\202\\320\\260\\320\\261\\0\"\\\n  \"\\320\\243\\320\\262\\320\\265\\320\\273\\320\\270\\321\\207\\320\\270\\321\\202\\321\\214\\0\"\\\n  \"\\320\\243\\320\\274\\320\\265\\320\\275\\321\\214\\321\\210\\320\\270\\321\\202\\321\\214\\0\"\\\n  \"\\320\\234\\320\\260\\321\\201\\321\\210\\321\\202\\320\\260\\320\\261\\0\"\\\n  \"[\\320\\236\\320\\261\\320\\275\\320\\260\\321\\200\\321\\203\\320\\266\\320\\265\\320\\275\\321\\213 \\320\\270\\320\\267\\320\\274\\320\\265\\320\\275\\320\\265\\320\\275\\320\\270\\321\\217; \\320\\276\\320\\261\\320\\275\\320\\276\\320\\262\\320\\273\\320\\265\\320\\275\\320\\270\\320\\265...] %s\\0\"\\\n  \"\\320\\272\\320\\276\\320\\277\\320\\270\\321\\200\\320\\276\\320\\262\\320\\260\\320\\275\\320\\270\\320\\265 \\321\\202\\320\\265\\320\\272\\321\\201\\321\\202\\320\\260\\0\"\\\n  \"\\320\\277\\320\\265\\321\\207\\320\\260\\321\\202\\321\\214 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\260\\0\";\n\nconst char * gTranslations_sr_rs = \n  \"\\320\\236 \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\321\\203\\0\"\\\n  \"\\320\\241\\321\\202\\320\\262\\320\\260\\321\\200\\320\\275\\320\\260 \\320\\262\\320\\265\\320\\273\\320\\270\\321\\207\\320\\270\\320\\275\\320\\260\\tCtrl+1\\0\"\\\n  \"\\320\\235\\320\\260\\320\\277\\321\\200\\320\\265\\320\\264\\320\\275\\320\\265 \\320\\276\\320\\277\\321\\206\\320\\270\\321\\230\\320\\265\\0\"\\\n  \"\\320\\241\\320\\262\\320\\265 \\320\\270\\320\\267\\320\\260\\320\\261\\321\\200\\320\\260\\320\\275\\320\\265 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\265\\0\"\\\n  \"\\320\\235\\320\\260\\320\\267\\320\\260\\320\\264\\tAlt+<-\\0\"\\\n  \"\\320\\230\\320\\267\\320\\263\\320\\273\\320\\265\\320\\264 \\320\\272\\321\\232\\320\\270\\320\\263\\320\\265\\tCtrl+8\\0\"\\\n  \"\\320\\227\\320\\260\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270\\tCtrl+W\\0\"\\\n  \"\\320\\232\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\321\\230 \\320\\270\\320\\267\\320\\260\\320\\261\\321\\200\\320\\260\\320\\275\\320\\276\\0\"\\\n  \"\\320\\232\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\321\\230 \\320\\270\\320\\267\\320\\260\\320\\261\\321\\200\\320\\260\\320\\275\\320\\276\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\277\\320\\270\\321\\202\\320\\260\\321\\230 \\320\\274\\320\\265 \\320\\277\\320\\276\\320\\275\\320\\276\\320\\262\\320\\276\\0\"\\\n  \"\\320\\241\\320\\260\\320\\274\\320\\276 \\320\\273\\320\\270\\321\\206\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\0\"\\\n  \"\\320\\235\\320\\260\\321\\201\\320\\277\\321\\200\\320\\260\\320\\274\\320\\275\\320\\276\\tCtrl+7\\0\"\\\n  \"\\320\\224\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\260\\0\"\\\n  \"\\320\\237\\320\\276\\321\\230\\320\\260\\320\\274:\\0\"\\\n  \"\\320\\237\\321\\200\\320\\262\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\tHome\\0\"\\\n  \"\\320\\237\\320\\276\\320\\264\\320\\265\\321\\201\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\265 \\320\\277\\321\\200\\320\\265\\320\\274\\320\\260 \\320\\276\\320\\261\\320\\273\\320\\260\\321\\201\\321\\202\\320\\270 \\321\\210\\321\\202\\320\\260\\320\\274\\320\\277\\320\\260\\321\\232\\320\\260\\0\"\\\n  \"\\320\\230\\320\\264\\320\\270\\0\"\\\n  \"\\320\\230\\320\\264\\320\\270 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\321\\203:\\0\"\\\n  \"\\320\\237\\320\\276\\320\\274\\320\\276\\321\\233\\0\"\\\n  \"\\320\\237\\320\\276\\321\\201\\320\\273\\320\\265\\320\\264\\321\\232\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\tEnd\\0\"\\\n  \"\\320\\243\\320\\262\\320\\265\\321\\233\\320\\260\\321\\232\\320\\265:\\0\"\\\n  \"\\320\\243\\320\\277\\321\\203\\321\\202\\321\\201\\321\\202\\320\\262\\320\\276\\0\"\\\n  \"\\320\\240\\320\\260\\320\\267\\320\\273\\320\\270\\320\\272\\321\\203\\321\\230 \\320\\274\\320\\260\\320\\273\\320\\260 \\320\\270 \\320\\262\\320\\265\\320\\273\\320\\270\\320\\272\\320\\260 \\321\\201\\320\\273\\320\\276\\320\\262\\320\\260\\0\"\\\n  \"\\320\\241\\320\\273\\320\\265\\320\\264\\320\\265\\321\\233\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\t->\\0\"\\\n  \"\\320\\235\\320\\265\\0\"\\\n  \"\\320\\235\\320\\265, \\321\\205\\320\\262\\320\\260\\320\\273\\320\\260\\0\"\\\n  \"\\320\\241\\320\\260\\320\\274\\320\\276 \\320\\277\\320\\276\\320\\273\\320\\265\\321\\222\\320\\270\\320\\275\\320\\265 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270...\\tCtrl+O\\0\"\\\n  \"\\320\\236\\320\\277\\321\\206\\320\\270\\321\\230\\320\\265...\\0\"\\\n  \"\\320\\233\\320\\276\\320\\267\\320\\270\\320\\275\\320\\272\\320\\260\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\272\\320\\260\\321\\207\\320\\270 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\321\\202\\321\\205\\320\\276\\320\\264\\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\t<-\\0\"\\\n  \"\\320\\250\\321\\202\\320\\260\\320\\274\\320\\277\\320\\260\\321\\230...\\0\"\\\n  \"\\320\\250\\321\\202\\320\\260\\320\\274\\320\\277\\320\\260\\321\\230...\\tCtrl+P\\0\"\\\n  \"\\320\\250\\321\\202\\320\\260\\320\\274\\320\\277\\320\\260\\321\\230... (\\320\\276\\320\\264\\320\\261\\320\\270\\321\\230\\320\\265\\320\\275\\320\\276)\\0\"\\\n  \"\\320\\227\\320\\260\\320\\277\\320\\260\\320\\274\\321\\202\\320\\270 \\320\\273\\320\\276\\320\\267\\320\\270\\320\\275\\320\\272\\321\\203 \\320\\267\\320\\260 \\320\\276\\320\\262\\320\\260\\321\\230 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"\\320\\227\\320\\260\\320\\277\\320\\260\\320\\274\\321\\202\\320\\270 \\320\\276\\320\\262\\320\\260 \\320\\277\\320\\276\\320\\264\\320\\265\\321\\210\\320\\260\\320\\262\\320\\260\\321\\232\\320\\260 \\320\\267\\320\\260 \\321\\201\\320\\262\\320\\260\\320\\272\\320\\270 \\320\\277\\320\\276\\321\\230\\320\\265\\320\\264\\320\\270\\320\\275\\320\\260\\321\\207\\320\\275\\320\\270 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"\\320\\243\\320\\272\\320\\273\\320\\276\\320\\275\\320\\270 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"\\320\\241\\320\\260\\321\\207\\321\\203\\320\\262\\320\\260\\321\\230 \\320\\272\\320\\260\\320\\276...\\0\"\\\n  \"\\320\\241\\320\\260\\321\\207\\321\\203\\320\\262\\320\\260\\321\\230 \\320\\272\\320\\260\\320\\276...\\tCtrl+S\\0\"\\\n  \"\\320\\237\\320\\276\\320\\264\\320\\265\\321\\210\\320\\260\\320\\262\\320\\260\\321\\232\\320\\260\\0\"\\\n  \"\\320\\241\\320\\272\\321\\203\\320\\277\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\265 \\320\\275\\320\\260 \\320\\276\\320\\261\\320\\273\\320\\260\\321\\201\\321\\202 \\321\\210\\321\\202\\320\\260\\320\\274\\320\\277\\320\\260\\321\\232\\320\\260 (\\321\\203\\320\\272\\320\\276\\320\\273\\320\\270\\320\\272\\320\\276 \\321\\230\\320\\265 \\320\\275\\320\\265\\320\\276\\320\\277\\321\\205\\320\\276\\320\\264\\320\\275\\320\\276)\\0\"\\\n  \"\\320\\237\\320\\276\\321\\230\\320\\265\\320\\264\\320\\270\\320\\275\\320\\260\\321\\207\\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\tCtrl+6\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\321\\201\\320\\272\\320\\276\\321\\207\\320\\270 \\320\\276\\320\\262\\321\\203 \\320\\262\\320\\265\\321\\200\\320\\267\\320\\270\\321\\230\\321\\203\\0\"\\\n  \"\\320\\243\\320\\277\\320\\276\\321\\202\\321\\200\\320\\265\\320\\261\\320\\270 \\320\\276\\321\\200\\320\\270\\320\\263\\320\\270\\320\\275\\320\\260\\320\\273\\320\\275\\320\\265 \\320\\262\\320\\265\\320\\273\\320\\270\\321\\207\\320\\270\\320\\275\\320\\265 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\272\\320\\260\\320\\267\\0\"\\\n  \"\\320\\237&\\321\\200\\320\\276\\320\\267\\320\\276\\321\\200\\0\"\\\n  \"\\320\\224\\320\\260\\0\"\\\n  \"\\320\\243\\320\\262\\320\\265\\321\\233\\320\\260\\321\\232\\320\\265\\0\"\\\n  \"(\\320\\276\\320\\264 %d)\\0\"\\\n  \"(%s. \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260)\\0\"\\\n  \"\\320\\236 \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\321\\203 SumatraPDF\\0\"\\\n  \"\\320\\224\\320\\276\\320\\264\\320\\260\\320\\262\\320\\260\\321\\232\\320\\265 \\321\\203 \\320\\276\\320\\264\\320\\260\\320\\261\\320\\270\\321\\200\\0\"\\\n  \"\\320\\224\\320\\276\\320\\264\\320\\260\\321\\230 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\321\\203 %s \\320\\274\\320\\265\\321\\222\\321\\203 \\320\\276\\320\\264\\320\\260\\320\\261\\321\\200\\320\\260\\320\\275\\320\\265\\0\"\\\n  \"\\320\\224\\320\\276\\320\\264\\320\\260\\321\\230 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\321\\203 %s \\320\\274\\320\\265\\321\\222\\321\\203 \\320\\276\\320\\264\\320\\260\\320\\261\\321\\200\\320\\260\\320\\275\\320\\265 \\320\\277\\320\\276\\320\\264 (\\320\\276\\320\\277\\321\\206\\320\\270\\320\\276\\320\\275\\320\\276) \\320\\270\\320\\274\\320\\265\\320\\275\\320\\276\\320\\274:\\0\"\\\n  \"\\320\\224\\320\\276\\320\\264\\320\\260\\321\\230 \\320\\274\\320\\265\\321\\222\\321\\203 \\320\\276\\320\\264\\320\\260\\320\\261\\321\\200\\320\\260\\320\\275\\320\\265\\0\"\\\n  \"\\320\\224\\320\\276\\320\\264\\320\\260\\321\\202\\320\\275\\320\\276\\0\"\\\n  \"\\320\\241\\320\\262\\320\\265 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\265\\0\"\\\n  \"\\320\\241\\320\\262\\320\\270 \\320\\277\\320\\276\\320\\264\\321\\200\\320\\266\\320\\260\\320\\275\\320\\270 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\220\\320\\277\\320\\273\\320\\270\\320\\272\\320\\260\\321\\206\\320\\270\\321\\230\\320\\260:\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\264\\321\\200\\321\\203\\320\\266\\320\\270\\321\\202\\320\\270 PDF \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\260\\320\\274\\320\\260?\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\273\\320\\276\\320\\263 : %s\\0\"\\\n  \"\\320\\220\\321\\203\\321\\202\\320\\276\\321\\200:\\0\"\\\n  \"\\320\\220\\321\\203\\321\\202\\320\\276\\320\\274\\320\\260\\321\\202\\321\\201\\320\\272\\320\\270\\0\"\\\n  \"\\320\\220\\321\\203\\321\\202\\320\\276\\320\\274\\320\\260\\321\\202\\321\\201\\320\\272\\320\\270 \\320\\277\\321\\200\\320\\276\\320\\262\\320\\265\\321\\200\\320\\260\\320\\262\\320\\260\\321\\230 \\320\\264\\320\\276\\321\\201\\321\\202\\321\\203\\320\\277\\320\\275\\320\\276\\321\\201\\321\\202 \\320\\275\\320\\276\\320\\262\\320\\265 \\320\\262\\320\\265\\321\\200\\320\\267\\320\\270\\321\\230\\320\\265\\0\"\\\n  \"\\320\\230\\320\\267\\320\\263\\320\\273\\320\\265\\320\\264 \\320\\272\\321\\232\\320\\270\\320\\263\\320\\265\\0\"\\\n  \"\\320\\236\\320\\261\\320\\265\\320\\273\\320\\265\\320\\266\\320\\270\\320\\262\\320\\260\\321\\207\\320\\270\\tF12\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\321\\207\\320\\270\\321\\206\\320\\260 \\320\\272\\320\\260 \\320\\276\\320\\261\\320\\265\\320\\273\\320\\265\\320\\266\\320\\270\\320\\262\\320\\260\\321\\207\\321\\203\\0\"\\\n  \"\\320\\236\\320\\261\\320\\265\\320\\273\\320\\265\\320\\266\\320\\270 \\320\\277\\321\\200\\320\\265\\321\\207\\320\\270\\321\\206\\321\\203 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270 %s \\320\\276\\320\\264 %s\\0\"\\\n  \"\\320\\236\\320\\261\\320\\265\\320\\273\\320\\265\\320\\266\\320\\270\\320\\262\\320\\260\\321\\207\\320\\270\\0\"\\\n  \"\\320\\261\\320\\260\\321\\230\\321\\202\\320\\276\\320\\262\\320\\260\\0\"\\\n  \"CHM \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\237\\320\\276\\320\\262\\320\\265\\320\\267\\320\\270\\320\\262\\320\\260\\321\\232\\320\\265 \\320\\275\\320\\260 \\320\\270\\320\\275\\321\\202\\320\\265\\321\\200\\320\\275\\320\\265\\321\\202 \\320\\275\\320\\270\\321\\230\\320\\265 \\320\\274\\320\\276\\320\\263\\321\\203\\321\\233\\320\\265 (\\320\\263\\321\\200\\320\\265\\321\\210\\320\\272\\320\\260 %#x).\\0\"\\\n  \"\\320\\236\\321\\202\\320\\272\\320\\260\\320\\266\\320\\270\\0\"\\\n  \"\\320\\250\\321\\202\\320\\260\\320\\274\\320\\277\\320\\260\\321\\232\\320\\265 \\320\\276\\320\\262\\320\\265 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\265 \\320\\275\\320\\270\\321\\230\\320\\265 \\320\\274\\320\\276\\320\\263\\321\\203\\321\\233\\320\\265\\0\"\\\n  \"\\320\\235\\320\\270\\321\\230\\320\\265 \\320\\274\\320\\276\\320\\263\\321\\203\\321\\233\\320\\265 \\320\\277\\320\\276\\320\\272\\321\\200\\320\\265\\320\\275\\321\\203\\321\\202\\320\\270 \\320\\270\\320\\275\\320\\262\\320\\265\\321\\200\\320\\267\\320\\275\\321\\203 \\320\\277\\321\\200\\320\\265\\321\\202\\321\\200\\320\\260\\320\\263\\321\\203. \\320\\237\\321\\200\\320\\276\\320\\262\\320\\265\\321\\200\\320\\270\\321\\202\\320\\265 \\320\\272\\320\\276\\320\\274\\320\\260\\320\\275\\320\\264\\320\\275\\321\\203 \\320\\273\\320\\270\\320\\275\\320\\270\\321\\230\\321\\203 \\321\\203 \\320\\277\\320\\276\\320\\264\\320\\265\\321\\210\\320\\260\\320\\262\\320\\260\\321\\232\\320\\270\\320\\274\\320\\260.\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\274\\320\\265\\320\\275\\320\\270 \\321\\230\\320\\265\\320\\267\\320\\270\\320\\272 (Change Language)\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\262\\320\\265\\321\\200\\320\\270 \\320\\277\\320\\276\\321\\201\\321\\202\\320\\276\\321\\230\\320\\260\\321\\232\\320\\265 \\320\\275\\320\\276\\320\\262\\320\\270\\321\\230\\320\\265 \\320\\262\\320\\265\\321\\200\\320\\267\\320\\270\\321\\230\\320\\265\\0\"\\\n  \"\\320\\241\\321\\202\\321\\200\\320\\270\\320\\277\\320\\276\\320\\262\\320\\270\\0\"\\\n  \"\\320\\232\\320\\276\\320\\274\\320\\277\\320\\260\\321\\202\\320\\270\\320\\261\\320\\270\\320\\273\\320\\275\\320\\276\\321\\201\\321\\202\\0\"\\\n  \"\\320\\235\\320\\265\\320\\277\\321\\200\\320\\265\\320\\272\\320\\270\\320\\264\\320\\275\\320\\276\\0\"\\\n  \"\\320\\235\\320\\265\\320\\277\\321\\200\\320\\265\\320\\272\\320\\270\\320\\264\\320\\275\\320\\276, \\320\\270\\320\\267\\320\\263\\320\\273\\320\\265\\320\\264 \\320\\272\\321\\232\\320\\270\\320\\263\\320\\265\\0\"\\\n  \"\\320\\235\\320\\265\\320\\277\\321\\200\\320\\265\\320\\272\\320\\270\\320\\264\\320\\275\\320\\276, \\320\\275\\320\\260\\321\\201\\320\\277\\321\\200\\320\\260\\320\\274\\320\\275\\320\\276\\0\"\\\n  \"\\320\\243\\321\\207\\320\\265\\321\\201\\321\\202\\320\\262\\321\\203\\321\\230 \\321\\203 \\320\\277\\321\\200\\320\\265\\320\\262\\320\\276\\321\\222\\320\\265\\321\\232\\321\\203\\0\"\\\n  \"\\320\\232\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\321\\230 \\321\\201\\320\\273\\320\\270\\320\\272\\321\\203\\0\"\\\n  \"\\320\\232\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\321\\230 \\320\\260\\320\\264\\321\\200\\320\\265\\321\\201\\321\\203 \\320\\262\\320\\265\\320\\267\\320\\265\\0\"\\\n  \"\\320\\232\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\321\\230 \\320\\272\\320\\276\\320\\274\\320\\265\\320\\275\\321\\202\\320\\260\\321\\200\\0\"\\\n  \"\\320\\232\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\321\\232\\320\\265 \\321\\202\\320\\265\\320\\272\\321\\201\\321\\202\\320\\260 \\321\\230\\320\\265 \\320\\276\\320\\264\\320\\261\\320\\270\\321\\230\\320\\265\\320\\275\\320\\276 (\\320\\274\\320\\276\\320\\266\\320\\265 \\321\\201\\320\\265 \\320\\272\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\321\\202\\320\\270 \\321\\201\\320\\260\\320\\274\\320\\276 \\320\\272\\320\\260\\320\\276 \\321\\201\\320\\273\\320\\270\\320\\272\\320\\260)\\0\"\\\n  \"\\320\\220\\321\\203\\321\\202\\320\\276\\321\\200\\321\\201\\320\\272\\320\\260 \\320\\277\\321\\200\\320\\260\\320\\262\\320\\260:\\0\"\\\n  \"\\320\\235\\320\\270\\321\\230\\320\\265 \\320\\274\\320\\276\\320\\263\\321\\203\\321\\233\\320\\265 \\320\\277\\321\\200\\320\\270\\320\\272\\320\\260\\320\\267\\320\\260\\321\\202\\320\\270 \\320\\276\\321\\201\\320\\276\\320\\261\\320\\270\\320\\275\\320\\265 \\321\\210\\321\\202\\320\\260\\320\\274\\320\\277\\320\\260\\321\\207\\320\\260\\0\"\\\n  \"\\320\\235\\320\\270\\321\\230\\320\\265 \\320\\274\\320\\276\\320\\263\\321\\203\\321\\233\\320\\265 \\320\\277\\320\\276\\320\\272\\321\\200\\320\\265\\320\\275\\321\\203\\321\\202\\320\\270 \\321\\210\\321\\202\\320\\260\\320\\274\\320\\277\\320\\260\\321\\207\\0\"\\\n  \"\\320\\235\\320\\270\\321\\230\\320\\265 \\320\\274\\320\\276\\320\\263\\321\\203\\321\\233\\320\\265 \\320\\277\\321\\200\\320\\270\\320\\272\\320\\260\\320\\267\\320\\260\\321\\202\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\321\\203\\0\"\\\n  \"\\320\\230\\320\\267\\321\\200\\320\\260\\321\\222\\320\\265\\320\\275\\320\\260:\\0\"\\\n  \"\\320\\242\\320\\265\\320\\272\\321\\203\\321\\233\\320\\260 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\260\\0\"\\\n  \"\\320\\237\\320\\276\\320\\267\\320\\270\\321\\206\\320\\270\\321\\230\\320\\260 \\320\\272\\321\\203\\321\\200\\321\\201\\320\\276\\321\\200\\320\\260\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\273\\320\\260\\320\\263\\320\\276\\321\\222\\320\\265\\320\\275\\320\\276 \\321\\203\\320\\262\\320\\265\\321\\233\\320\\260\\321\\232\\320\\265...\\tCtrl+Y\\0\"\\\n  \"\\320\\237\\320\\276\\320\\264\\321\\200\\320\\260\\320\\267\\321\\203\\320\\274\\320\\265\\320\\262\\320\\260\\320\\275\\320\\270 \\320\\277\\321\\200\\320\\270\\320\\272\\320\\260\\320\\267\\0\"\\\n  \"\\320\\237\\320\\276\\320\\264\\321\\200\\320\\260\\320\\267\\321\\203\\320\\274\\320\\265\\320\\262\\320\\260\\320\\275\\320\\276 \\321\\203\\320\\262\\320\\265\\321\\233\\320\\260\\321\\232\\320\\265\\0\"\\\n  \"\\320\\237\\320\\276\\320\\264\\321\\200\\320\\260\\320\\267\\321\\203\\320\\274\\320\\265\\320\\262\\320\\260\\320\\275\\320\\270 PDF \\321\\207\\320\\270\\321\\202\\320\\260\\321\\207 \\320\\275\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\265 \\320\\261\\320\\270\\321\\202\\320\\270 \\320\\277\\321\\200\\320\\276\\320\\274\\320\\265\\321\\232\\320\\265\\320\\275 \\321\\203 \\320\\277\\321\\200\\320\\265\\320\\275\\320\\276\\321\\201\\320\\270\\320\\262\\320\\275\\320\\276\\320\\274 \\321\\200\\320\\265\\320\\266\\320\\270\\320\\274\\321\\203\\0\"\\\n  \"\\320\\235\\320\\270\\321\\230\\320\\265 \\320\\264\\320\\276\\320\\277\\321\\203\\321\\210\\321\\202\\320\\265\\320\\275\\320\\276:\\0\"\\\n  \"DjVu \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\236\\321\\201\\320\\276\\320\\261\\320\\270\\320\\275\\320\\265 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\260\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\321\\203\\320\\267\\320\\274\\320\\270\\0\"\\\n  \"\\320\\230\\320\\267\\320\\260\\321\\222\\320\\270\\tCtrl+Q\\0\"\\\n  \"EPUB \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\243\\320\\275\\320\\265\\321\\201\\320\\270\\321\\202\\320\\265 \\320\\273\\320\\276\\320\\267\\320\\270\\320\\275\\320\\272\\321\\203\\0\"\\\n  \"\\320\\243\\320\\275\\320\\265\\321\\201\\320\\270\\321\\202\\320\\265 \\320\\273\\320\\276\\320\\267\\320\\270\\320\\275\\320\\272\\321\\203 \\320\\267\\320\\260 %s\\0\"\\\n  \"\\320\\243\\320\\275\\320\\265\\321\\201\\320\\270\\321\\202\\320\\265 \\320\\277\\320\\260\\321\\200\\320\\260\\320\\274\\320\\265\\321\\202\\321\\200\\320\\265 \\320\\272\\320\\276\\320\\274\\320\\260\\320\\275\\320\\264\\320\\275\\320\\265 \\320\\273\\320\\270\\320\\275\\320\\270\\321\\230\\320\\265 \\320\\272\\320\\276\\321\\230\\320\\270 \\321\\233\\320\\265 \\321\\201\\320\\265 \\320\\270\\320\\267\\320\\262\\321\\200\\321\\210\\320\\270\\321\\202\\320\\270 \\320\\277\\321\\200\\320\\270\\320\\273\\320\\270\\320\\272\\320\\276\\320\\274 \\320\\264\\320\\262\\320\\276\\320\\272\\320\\273\\320\\270\\320\\272\\320\\260 \\320\\275\\320\\260 PDF \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202:\\0\"\\\n  \"\\320\\224\\320\\276\\321\\210\\320\\273\\320\\276 \\321\\230\\320\\265 \\320\\264\\320\\276 \\320\\263\\321\\200\\320\\265\\321\\210\\320\\272\\320\\265 \\320\\277\\321\\200\\320\\270\\320\\273\\320\\270\\320\\272\\320\\276\\320\\274 \\321\\203\\321\\207\\320\\270\\321\\202\\320\\260\\320\\262\\320\\260\\321\\232\\320\\260 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\265 %s\\0\"\\\n  \"\\320\\236\\320\\264\\320\\260\\320\\261\\320\\270\\321\\200\\0\"\\\n  \"\\320\\235\\320\\260\\320\\277\\321\\200\\320\\265\\320\\264\\tAlt+->\\0\"\\\n  \"\\320\\246\\320\\265\\320\\276 \\320\\265\\320\\272\\321\\200\\320\\260\\320\\275\\tCtrl+Shift+L\\0\"\\\n  \"\\320\\235\\320\\260\\321\\201\\320\\277\\321\\200\\320\\260\\320\\274\\320\\275\\320\\276\\0\"\\\n  \"\\320\\235\\320\\265\\320\\274\\320\\276\\320\\263\\321\\203\\321\\233\\320\\265 \\321\\230\\320\\265 \\320\\277\\321\\200\\320\\265\\320\\270\\320\\274\\320\\265\\320\\275\\320\\276\\320\\262\\320\\260\\321\\202\\320\\270 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\321\\203!\\0\"\\\n  \"\\320\\247\\321\\203\\320\\262\\320\\260\\321\\232\\320\\265 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\265 \\320\\275\\320\\270\\321\\230\\320\\265 \\321\\203\\321\\201\\320\\277\\320\\265\\320\\273\\320\\276\\0\"\\\n  \"\\320\\221\\321\\200\\320\\267\\320\\270 \\320\\277\\321\\200\\320\\265\\320\\263\\320\\273\\320\\265\\320\\264 \\320\\275\\320\\260 \\320\\274\\321\\200\\320\\265\\320\\266\\320\\270\\0\"\\\n  \"\\320\\236\\320\\264\\320\\260\\320\\261\\320\\270\\321\\200\\0\"\\\n  \"FictionBook \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\320\\260\\321\\202\\0\"\\\n  \"\\320\\224\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\260 %s \\320\\275\\320\\270\\321\\230\\320\\265 \\320\\277\\321\\200\\320\\276\\320\\275\\320\\260\\321\\222\\320\\265\\320\\275\\320\\260\\0\"\\\n  \"\\320\\222\\320\\265\\320\\273\\320\\270\\321\\207\\320\\270\\320\\275\\320\\260:\\0\"\\\n  \"\\320\\224\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\260:\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\275\\320\\260\\321\\222\\320\\270...\\tCtrl+F\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\275\\320\\260\\321\\222\\320\\270\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\275\\320\\260\\321\\222\\320\\270 \\321\\201\\320\\273\\320\\265\\320\\264\\320\\265\\321\\233\\320\\265\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\275\\320\\260\\321\\222\\320\\270 \\320\\277\\321\\200\\320\\265\\321\\202\\321\\205\\320\\276\\320\\264\\320\\275\\320\\276\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\275\\320\\260\\321\\222\\320\\270:\\0\"\\\n  \"\\320\\237\\320\\276\\320\\264\\320\\265\\321\\201\\320\\270 \\320\\277\\321\\200\\320\\265\\320\\274\\320\\260 \\321\\201\\320\\260\\320\\264\\321\\200\\320\\266\\320\\260\\321\\230\\321\\203\\tCtrl+3\\0\"\\\n  \"\\320\\237\\320\\276\\320\\264\\320\\265\\321\\201\\320\\270 \\320\\277\\321\\200\\320\\265\\320\\274\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\tCtrl+0\\0\"\\\n  \"\\320\\237\\320\\276\\320\\264\\320\\265\\321\\201\\320\\270 \\320\\277\\321\\200\\320\\265\\320\\274\\320\\260 \\321\\210\\320\\270\\321\\200\\320\\270\\320\\275\\320\\270\\tCtrl+2\\0\"\\\n  \"\\320\\237\\320\\276\\320\\264\\320\\265\\321\\201\\320\\270 \\320\\277\\321\\200\\320\\265\\320\\274\\320\\260 \\321\\201\\320\\260\\320\\264\\321\\200\\320\\266\\320\\260\\321\\230\\321\\203\\0\"\\\n  \"\\320\\237\\320\\276\\320\\264\\320\\265\\321\\201\\320\\270 \\320\\277\\321\\200\\320\\265\\320\\274\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\0\"\\\n  \"\\320\\237\\320\\276\\320\\264\\320\\265\\321\\201\\320\\270 \\320\\277\\321\\200\\320\\265\\320\\274\\320\\260 \\321\\210\\320\\270\\321\\200\\320\\270\\320\\275\\320\\270\\0\"\\\n  \"\\320\\237\\320\\276\\320\\264\\320\\265\\321\\201\\320\\270 \\320\\277\\321\\200\\320\\265\\320\\274\\320\\260 \\321\\210\\320\\270\\321\\200\\320\\270\\320\\275\\320\\270 \\320\\270 \\320\\277\\321\\200\\320\\270\\320\\272\\320\\260\\320\\266\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\265 \\320\\261\\320\\265\\320\\267 \\320\\277\\321\\200\\320\\265\\320\\272\\320\\270\\320\\264\\320\\260\\0\"\\\n  \"\\320\\237\\320\\276\\320\\264\\320\\265\\321\\201\\320\\270 \\320\\277\\321\\200\\320\\265\\320\\274\\320\\260 \\320\\277\\320\\276\\321\\230\\320\\265\\320\\264\\320\\270\\320\\275\\320\\260\\321\\207\\320\\275\\320\\276\\321\\230 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\0\"\\\n  \"\\320\\244\\320\\276\\320\\275\\321\\202\\320\\276\\320\\262\\320\\270:\\0\"\\\n  \"\\320\\244\\320\\276\\321\\200\\320\\274\\320\\260\\321\\202\\320\\270\\321\\200\\320\\260\\321\\232\\320\\265 \\320\\272\\321\\232\\320\\270\\320\\263\\320\\265... %d \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\0\"\\\n  \"\\320\\242\\320\\265\\320\\272\\321\\201\\321\\202 \\321\\230\\320\\265 \\320\\277\\321\\200\\320\\276\\320\\275\\320\\260\\321\\222\\320\\265\\320\\275 \\320\\275\\320\\260 %s. \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\275\\320\\260\\321\\222\\320\\270 \\321\\202\\320\\265\\320\\272\\321\\201\\321\\202 \\320\\275\\320\\260 %s. \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\270 (\\320\\277\\320\\276\\320\\275\\320\\276\\320\\262\\320\\276)\\0\"\\\n  \"\\320\\235\\320\\265\\320\\264\\320\\260\\320\\262\\320\\275\\320\\276 \\321\\207\\320\\270\\321\\202\\320\\260\\320\\275\\320\\276\\0\"\\\n  \"\\0\"\\\n  \"\\320\\230\\320\\264\\320\\270 \\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\321\\203\\0\"\\\n  \"\\320\\241\\320\\260\\320\\272\\321\\200\\320\\270\\321\\230 \\342\\200\\236\\320\\275\\320\\265\\320\\264\\320\\260\\320\\262\\320\\275\\320\\276 \\321\\207\\320\\270\\321\\202\\320\\260\\320\\275\\320\\276\\342\\200\\235\\0\"\\\n  \"\\320\\241\\320\\260\\320\\262\\320\\265\\321\\202: \\320\\243\\320\\277\\320\\276\\321\\202\\321\\200\\320\\265\\320\\261\\320\\270\\321\\202\\320\\265 \\321\\202\\320\\260\\321\\201\\321\\202\\320\\265\\321\\200 F3 \\320\\267\\320\\260 \\320\\275\\320\\260\\321\\201\\321\\202\\320\\260\\320\\262\\320\\260\\320\\272 \\320\\277\\321\\200\\320\\265\\321\\202\\321\\200\\320\\260\\320\\263\\320\\265\\0\"\\\n  \"\\320\\224\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\265 \\321\\201\\320\\273\\320\\270\\320\\272\\320\\260 (*.%s)\\0\"\\\n  \"kB\\0\"\\\n  \"\\0\"\\\n  \"\\320\\237\\320\\276\\321\\201\\321\\202\\320\\260\\320\\262\\320\\270\\321\\202\\320\\270 SumatraPDF \\320\\272\\320\\260\\320\\276 \\320\\277\\320\\276\\320\\264\\321\\200\\320\\260\\320\\267\\321\\203\\320\\274\\320\\265\\320\\262\\320\\260\\320\\275\\321\\203 \\320\\260\\320\\277\\320\\273\\320\\270\\320\\272\\320\\260\\321\\206\\320\\270\\321\\230\\321\\203 \\320\\267\\320\\260 PDF \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\265?\\0\"\\\n  \"\\320\\235\\320\\265\\320\\272\\320\\260 SumatraPFD \\320\\261\\321\\203\\320\\264\\320\\265 \\320\\277\\320\\276\\320\\264\\321\\200\\320\\260\\320\\267\\321\\203\\320\\274\\320\\265\\320\\262\\320\\260\\320\\275\\320\\270 PDF \\321\\207\\320\\270\\321\\202\\320\\260\\321\\207\\0\"\\\n  \"\\320\\234\\320\\260\\320\\275&\\320\\263\\320\\260 \\320\\274\\320\\276\\320\\264\\0\"\\\n  \"\\320\\240\\320\\260\\320\\267\\320\\273\\320\\270\\320\\272\\321\\203\\321\\230 \\320\\274\\320\\260\\320\\273\\320\\260 \\320\\270 \\320\\262\\320\\265\\320\\273\\320\\270\\320\\272\\320\\260 \\321\\201\\320\\273\\320\\276\\320\\262\\320\\260\\0\"\\\n  \"Mobi \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\230\\320\\267\\320\\274\\320\\265\\321\\232\\320\\265\\320\\275\\320\\260:\\0\"\\\n  \"\\320\\224\\320\\276\\321\\201\\321\\202\\321\\203\\320\\277\\320\\275\\320\\260 \\321\\230\\320\\265 \\320\\262\\320\\265\\321\\200\\320\\267\\320\\270\\321\\230\\320\\260 %s. \\320\\226\\320\\265\\320\\273\\320\\270\\321\\202\\320\\265 \\320\\273\\320\\270 \\320\\264\\320\\260 \\320\\277\\321\\200\\320\\265\\321\\203\\320\\267\\320\\274\\320\\265\\321\\202\\320\\265 \\320\\275\\320\\276\\320\\262\\321\\203 \\320\\262\\320\\265\\321\\200\\320\\267\\320\\270\\321\\230\\321\\203?\\0\"\\\n  \"\\320\\241\\320\\273\\320\\265\\320\\264\\320\\265\\321\\233\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\0\"\\\n  \"\\320\\237\\320\\276\\321\\230\\320\\260\\320\\274 \\320\\275\\320\\270\\321\\230\\320\\265 \\320\\277\\321\\200\\320\\276\\320\\275\\320\\260\\321\\222\\320\\265\\320\\275\\0\"\\\n  \"\\320\\240\\320\\265\\320\\267\\321\\203\\320\\273\\321\\202\\320\\260\\321\\202\\320\\270 \\320\\276\\320\\272\\320\\276 \\320\\273\\320\\270\\320\\275\\320\\270\\321\\230\\320\\265 %u \\321\\203 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\321\\206\\320\\270 %s \\320\\275\\320\\270\\321\\201\\321\\203 \\320\\277\\321\\200\\320\\276\\320\\275\\320\\260\\321\\222\\320\\265\\320\\275\\320\\270\\0\"\\\n  \"\\320\\243\\321\\201\\320\\272\\320\\273\\320\\260\\321\\222\\320\\270\\320\\262\\320\\260\\321\\207\\320\\272\\320\\260 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\260 \\320\\275\\320\\270\\321\\230\\320\\265 \\320\\275\\320\\260\\321\\222\\320\\265\\320\\275\\320\\260\\0\"\\\n  \"\\320\\235\\320\\265\\320\\274\\320\\260 \\320\\277\\320\\276\\320\\264\\320\\260\\321\\202\\320\\260\\320\\272\\320\\260 \\320\\276 \\321\\203\\321\\201\\320\\272\\320\\273\\320\\260\\321\\222\\320\\265\\320\\275\\320\\276\\321\\201\\321\\202\\320\\270 \\320\\275\\320\\260 \\320\\276\\320\\262\\320\\276\\321\\230 \\320\\277\\320\\276\\320\\267\\320\\270\\321\\206\\320\\270\\321\\230\\320\\270\\0\"\\\n  \"\\320\\221\\321\\200\\320\\276\\321\\230 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260:\\0\"\\\n  \"\\320\\243 \\321\\200\\320\\265\\320\\264\\321\\203\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270 \\321\\203 \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\321\\203 PDF-XChange\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202...\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270\\321\\202\\320\\270 \\321\\203 %s\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270 \\321\\203 \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\321\\203 Adobe Reader\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270 \\321\\203 \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\321\\203 Foxit Reader\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270 \\321\\203 \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\321\\203 Microsoft HTML Help\\0\"\\\n  \"\\320\\236\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270 \\321\\203 \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\321\\203 Microsoft XPS-Viewer\\0\"\\\n  \"\\320\\236\\321\\201\\320\\276\\320\\261\\320\\270\\320\\275\\320\\265\\0\"\\\n  \"\\320\\236\\321\\201\\320\\276\\320\\261\\320\\270\\320\\275\\320\\265\\tCtrl+D\\0\"\\\n  \"PDF \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"PDF \\320\\276\\320\\277\\321\\202\\320\\270\\320\\274\\320\\270\\320\\267\\320\\260\\321\\206\\320\\270\\321\\230\\320\\260\\0\"\\\n  \"PDF \\320\\270\\320\\267\\321\\200\\320\\260\\320\\264\\320\\270\\320\\276\\0\"\\\n  \"PDF \\320\\262\\320\\265\\321\\200\\320\\267\\320\\270\\321\\230\\320\\260:\\0\"\\\n  \"PDF \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\241\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260...\\tCtrl+G\\0\"\\\n  \"\\320\\241\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 %s\\0\"\\\n  \"\\320\\224\\320\\270\\320\\274\\320\\265\\320\\275\\320\\267\\320\\270\\321\\230\\320\\265 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\265:\\0\"\\\n  \"\\320\\241\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260 \\320\\261\\321\\200\\320\\276\\321\\230 %u \\320\\275\\320\\265 \\320\\277\\320\\276\\321\\201\\321\\202\\320\\276\\321\\230\\320\\270\\0\"\\\n  \"\\320\\237\\320\\276\\320\\264\\320\\265\\321\\210\\320\\260\\320\\262\\320\\260\\321\\232\\320\\265 \\320\\262\\320\\265\\320\\273\\320\\270\\321\\207\\320\\270\\320\\275\\320\\265 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\265\\0\"\\\n  \"\\320\\241\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260:\\0\"\\\n  \"PalmDoc \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\241\\320\\277\\321\\200\\320\\265\\320\\274\\320\\260\\321\\232\\320\\265 \\320\\277\\321\\200\\320\\270\\320\\272\\320\\260\\320\\267\\320\\260...\\0\"\\\n  \"Postscript \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\320\\267\\320\\265\\320\\275\\321\\202\\320\\260\\321\\206\\320\\270\\321\\230\\320\\260\\tCtrl+L\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\321\\202\\321\\205\\320\\276\\320\\264\\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\0\"\\\n  \"\\320\\250\\321\\202\\320\\260\\320\\274\\320\\277\\320\\260\\321\\230\\0\"\\\n  \"\\320\\236\\320\\277\\321\\201\\320\\265\\320\\263 \\321\\210\\321\\202\\320\\260\\320\\274\\320\\277\\320\\260\\321\\232\\320\\260\\0\"\\\n  \"\\320\\250\\321\\202\\320\\260\\320\\274\\320\\277\\320\\260\\321\\207 \\321\\201\\320\\260 \\320\\275\\320\\260\\320\\262\\320\\265\\320\\264\\320\\265\\320\\275\\320\\270\\320\\274 \\320\\270\\320\\274\\320\\265\\320\\275\\320\\276\\320\\274 \\320\\275\\320\\265 \\320\\277\\320\\276\\321\\201\\321\\202\\320\\276\\321\\230\\320\\270\\0\"\\\n  \"\\320\\250\\321\\202\\320\\260\\320\\274\\320\\277\\320\\260\\321\\232\\320\\265 \\321\\203 \\321\\202\\320\\276\\320\\272\\321\\203!\\0\"\\\n  \"\\320\\250\\321\\202\\320\\260\\320\\274\\320\\277\\320\\260\\321\\232\\320\\265 \\321\\230\\320\\265 \\320\\270 \\320\\264\\320\\260\\321\\231\\320\\265 \\321\\203 \\321\\202\\320\\276\\320\\272\\321\\203. \\320\\227\\320\\260\\320\\262\\321\\200\\321\\210\\320\\270\\321\\202\\320\\270 \\320\\270 \\320\\277\\321\\200\\320\\265\\320\\272\\320\\270\\320\\275\\321\\203\\321\\202\\320\\270?\\0\"\\\n  \"\\320\\250\\321\\202\\320\\260\\320\\274\\320\\277\\320\\260\\321\\232\\320\\265 \\321\\230\\320\\265 \\321\\230\\320\\276\\321\\210 \\321\\203\\320\\262\\320\\265\\320\\272 \\321\\203 \\321\\202\\320\\276\\320\\272\\321\\203. \\320\\226\\320\\265\\320\\273\\320\\270\\321\\202\\320\\265 \\320\\273\\320\\270 \\320\\264\\320\\260 \\320\\277\\321\\200\\320\\265\\320\\272\\320\\270\\320\\275\\320\\265\\321\\202\\320\\265 \\321\\210\\321\\202\\320\\260\\320\\274\\320\\277\\320\\260\\321\\232\\320\\265 \\320\\270 \\320\\277\\320\\276\\321\\207\\320\\275\\320\\265\\321\\202\\320\\265 \\320\\277\\320\\276\\320\\275\\320\\276\\320\\262\\320\\276?\\0\"\\\n  \"\\320\\250\\321\\202\\320\\260\\320\\274\\320\\277\\320\\260\\321\\232\\320\\265 %d. \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\265 \\320\\276\\320\\264 \\321\\203\\320\\272\\321\\203\\320\\277\\320\\275\\320\\276 %d...\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\261\\320\\273\\320\\265\\320\\274 \\320\\277\\321\\200\\320\\270\\320\\273\\320\\270\\320\\272\\320\\276\\320\\274 \\321\\210\\321\\202\\320\\260\\320\\274\\320\\277\\320\\260\\321\\232\\320\\260.\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\320\\270\\320\\274\\320\\265\\320\\275\\321\\203\\321\\230...\\tF2\\0\"\\\n  \"\\320\\227\\320\\260\\320\\277\\320\\260\\320\\274\\321\\202\\320\\270 \\320\\276\\321\\202\\320\\262\\320\\260\\321\\200\\320\\260\\320\\275\\320\\265 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\265\\0\"\\\n  \"\\320\\243\\320\\272\\320\\273\\320\\276\\320\\275\\320\\270 \\320\\270\\320\\267 \\320\\276\\320\\264\\320\\260\\320\\261\\321\\200\\320\\260\\320\\275\\320\\270\\321\\205\\0\"\\\n  \"\\320\\243\\320\\272\\320\\273\\320\\276\\320\\275\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\321\\203 %s \\320\\270\\320\\267 \\320\\276\\320\\264\\320\\260\\320\\261\\321\\200\\320\\260\\320\\275\\320\\270\\321\\205\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\320\\270\\320\\274\\320\\265\\320\\275\\321\\203\\321\\230 \\321\\203\\0\"\\\n  \"\\320\\240\\320\\276\\321\\202\\320\\270\\321\\200\\320\\260\\321\\230 \\321\\203\\320\\273\\320\\265\\320\\262\\320\\276\\tCtrl+Shift+-\\0\"\\\n  \"\\320\\240\\320\\276\\321\\202\\320\\270\\321\\200\\320\\260\\321\\230 \\321\\203\\320\\264\\320\\265\\321\\201\\320\\275\\320\\276\\tCtrl+Shift++\\0\"\\\n  \"\\320\\241\\320\\260\\321\\207\\321\\203\\320\\262\\320\\260\\321\\230 \\320\\272\\320\\260\\320\\276\\0\"\\\n  \"\\320\\241\\320\\260\\321\\207\\321\\203\\320\\262\\320\\260\\321\\230 \\320\\277\\321\\200\\320\\265\\321\\207\\320\\270\\321\\206\\321\\203...\\tCtrl+Shift+S\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\321\\202\\321\\200\\320\\260\\320\\266\\320\\270\\320\\262\\320\\260\\321\\232\\320\\265 %d \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\265 \\320\\276\\320\\264 \\321\\203\\320\\272\\321\\203\\320\\277\\320\\275\\320\\276 %d...\\0\"\\\n  \"\\320\\230\\320\\267\\320\\260\\320\\261\\320\\265\\321\\200\\320\\270 \\321\\201\\320\\262\\320\\265\\0\"\\\n  \"\\320\\230\\320\\267\\320\\260\\320\\261\\320\\265\\321\\200\\320\\270 \\321\\201\\320\\262\\320\\265\\tCtrl+A\\0\"\\\n  \"\\320\\230\\320\\267\\320\\260\\320\\261\\320\\265\\321\\200\\320\\270\\321\\202\\320\\265 \\321\\201\\320\\260\\320\\264\\321\\200\\320\\266\\320\\260\\321\\230 \\320\\272\\320\\276\\321\\200\\320\\270\\321\\201\\321\\202\\320\\265\\321\\233\\320\\270 Ctrl + \\320\\273\\320\\265\\320\\262\\320\\276 \\320\\264\\321\\203\\320\\263\\320\\274\\320\\265 \\320\\274\\320\\270\\321\\210\\320\\260\\0\"\\\n  \"\\320\\230\\320\\267\\320\\261\\320\\276\\321\\200\\0\"\\\n  \"\\320\\237\\320\\276\\321\\210\\320\\260\\321\\231\\320\\270 \\320\\277\\321\\203\\321\\202\\320\\265\\320\\274 \\320\\265-\\320\\277\\320\\276\\321\\210\\321\\202\\320\\265...\\0\"\\\n  \"\\320\\236\\320\\274\\320\\276\\320\\263\\321\\203\\321\\233\\320\\270 \\320\\270\\320\\275\\320\\262\\320\\265\\321\\200\\320\\267\\320\\275\\321\\203 \\320\\277\\321\\200\\320\\265\\321\\202\\321\\200\\320\\260\\320\\263\\321\\203\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\272\\320\\260\\320\\266\\320\\270 \\320\\276\\320\\261\\320\\265\\320\\273\\320\\265\\320\\266\\320\\265\\320\\275\\320\\265\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\272\\320\\260\\320\\266\\320\\270 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\265 \\320\\261\\320\\265\\320\\267 \\320\\277\\321\\200\\320\\265\\320\\272\\320\\270\\320\\264\\320\\260\\0\"\\\n  \"\\320\\242\\321\\200\\320\\260\\320\\272\\320\\260 \\321\\201\\320\\260 \\320\\260\\320\\273\\320\\260\\321\\202\\320\\272\\320\\260\\320\\274\\320\\260\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\272\\320\\260\\320\\266\\320\\270 \\320\\276\\320\\264\\320\\260\\320\\261\\321\\200\\320\\260\\320\\275\\320\\265 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\265\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\272\\320\\260\\320\\266\\320\\270 \\320\\275\\320\\265\\320\\264\\320\\260\\320\\262\\320\\275\\320\\276 \\321\\207\\320\\270\\321\\202\\320\\260\\320\\275\\320\\265\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\272\\320\\260\\320\\266\\320\\270 \\320\\261\\320\\276\\321\\207\\320\\275\\321\\203 \\321\\202\\321\\200\\320\\260\\320\\272\\321\\203 \\321\\201\\320\\260 \\320\\276\\320\\261\\320\\265\\320\\273\\320\\265\\320\\266\\320\\270\\320\\262\\320\\260\\321\\207\\320\\270\\320\\274\\320\\260\\0\"\\\n  \"\\320\\237\\320\\276\\321\\230\\320\\265\\320\\264\\320\\270\\320\\275\\320\\260\\321\\207\\320\\275\\320\\260 \\321\\201\\321\\202\\321\\200\\320\\260\\320\\275\\320\\270\\321\\206\\320\\260\\0\"\\\n  \"\\320\\236\\320\\277\\321\\200\\320\\276\\321\\201\\321\\202\\320\\270\\321\\202\\320\\265, \\320\\276\\320\\262\\320\\276 \\320\\275\\320\\270\\321\\230\\320\\265 \\321\\202\\321\\200\\320\\265\\320\\261\\320\\260\\320\\273\\320\\276 \\320\\264\\320\\260 \\321\\201\\320\\265 \\320\\264\\320\\276\\320\\263\\320\\276\\320\\264\\320\\270!\\n\\n\\320\\237\\321\\200\\320\\270\\321\\202\\320\\270\\321\\201\\320\\275\\320\\270\\321\\202\\320\\265 \\320\\264\\321\\203\\320\\263\\320\\274\\320\\265 '\\320\\236\\321\\202\\320\\272\\320\\260\\320\\266\\320\\270' \\320\\260\\320\\272\\320\\276 \\320\\266\\320\\265\\320\\273\\320\\270\\321\\202\\320\\265 \\320\\264\\320\\260 \\320\\275\\320\\260\\320\\274 \\320\\277\\320\\276\\320\\274\\320\\276\\320\\263\\320\\275\\320\\265\\321\\202\\320\\265 \\321\\203 \\321\\200\\320\\265\\321\\210\\320\\260\\320\\262\\320\\260\\321\\232\\321\\203 \\320\\276\\320\\262\\320\\276\\320\\263 \\320\\277\\321\\200\\320\\276\\320\\261\\320\\273\\320\\265\\320\\274\\320\\260.\\0\"\\\n  \"\\320\\230\\320\\267\\320\\262\\320\\276\\321\\200\\320\\275\\320\\260 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\260 %s \\320\\275\\320\\265\\320\\274\\320\\260 \\321\\202\\320\\260\\321\\207\\320\\272\\321\\203 \\321\\203\\321\\201\\320\\272\\320\\273\\320\\260\\321\\222\\320\\270\\320\\262\\320\\260\\321\\232\\320\\260\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\320\\264\\320\\274\\320\\265\\321\\202:\\0\"\\\n  \"\\320\\237\\320\\276\\320\\264\\320\\265\\321\\210\\320\\260\\320\\262\\320\\260\\321\\232\\320\\260 \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\320\\260 SumatraPDF\\0\"\\\n  \"\\320\\220\\320\\266\\321\\203\\321\\200\\320\\270\\321\\200\\320\\260\\321\\232\\320\\265 SumatraPDF\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274 SumatraPDF \\321\\230\\320\\265 \\320\\272\\321\\200\\320\\260\\321\\205\\320\\270\\321\\200\\320\\260\\320\\276\\0\"\\\n  \"SumatraPDF \\321\\230\\320\\265 \\320\\262\\320\\260\\321\\210 \\320\\277\\320\\276\\320\\264\\321\\200\\320\\260\\320\\267\\321\\203\\320\\274\\320\\265\\320\\262\\320\\260\\320\\275\\320\\270 PDF \\321\\207\\320\\270\\321\\202\\320\\260\\321\\207\\0\"\\\n  \"SumatraPDF \\321\\230\\320\\265 \\320\\277\\320\\276\\321\\201\\321\\202\\320\\260\\320\\262\\321\\231\\320\\265\\320\\275 \\320\\272\\320\\260\\320\\276 \\320\\277\\320\\276\\320\\264\\321\\200\\320\\260\\320\\267\\321\\203\\320\\274\\320\\265\\320\\262\\320\\260\\320\\275\\320\\270 PDF \\321\\207\\320\\270\\321\\202\\320\\260\\321\\207\\0\"\\\n  \"\\320\\235\\320\\270\\321\\230\\320\\265 \\320\\274\\320\\276\\320\\263\\321\\203\\321\\233\\320\\265 \\320\\276\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270\\321\\202\\320\\270 \\321\\203\\321\\201\\320\\272\\320\\273\\320\\260\\321\\222\\320\\270\\320\\262\\320\\260\\321\\207\\320\\272\\321\\203 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\321\\203\\0\"\\\n  \"\\320\\236\\320\\267\\320\\275\\320\\260\\321\\207\\320\\265\\320\\275\\320\\270 PDF\\0\"\\\n  \"\\320\\242\\320\\265\\320\\272\\321\\201\\321\\202\\321\\203\\320\\260\\320\\273\\320\\275\\320\\270 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\236\\320\\262\\320\\260\\321\\230 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202 \\320\\272\\320\\276\\321\\200\\320\\270\\321\\201\\321\\202\\320\\270 \\320\\275\\320\\265\\320\\277\\320\\276\\320\\264\\321\\200\\320\\266\\320\\260\\320\\275\\320\\265 \\320\\276\\320\\277\\321\\206\\320\\270\\321\\230\\320\\265 (%s) \\320\\270 \\320\\274\\320\\276\\320\\266\\320\\265 \\320\\261\\320\\270\\321\\202\\320\\270 \\320\\277\\321\\200\\320\\270\\320\\272\\320\\260\\320\\267\\320\\260\\320\\275 \\320\\275\\320\\265\\320\\272\\320\\276\\321\\200\\320\\265\\320\\272\\321\\202\\320\\275\\320\\276\\0\"\\\n  \"\\320\\235\\320\\260\\321\\201\\320\\273\\320\\276\\320\\262:\\0\"\\\n  \"\\320\\235\\320\\265\\320\\277\\320\\276\\320\\267\\320\\275\\320\\260\\321\\202\\320\\260 \\320\\270\\320\\267\\320\\262\\320\\276\\321\\200\\320\\275\\320\\260 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\260 (%s)\\0\"\\\n  \"\\320\\232\\320\\276\\321\\200\\320\\270\\321\\201\\321\\202\\320\\270\\321\\202\\320\\270 \\321\\202\\320\\260\\320\\261\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\272\\320\\260\\320\\267\\0\"\\\n  \"\\320\\237\\320\\276\\321\\201\\320\\265\\321\\202\\320\\270 \\320\\262\\320\\265\\320\\261-\\321\\201\\320\\260\\321\\230\\321\\202\\0\"\\\n  \"\\320\\243\\320\\277\\320\\276\\320\\267\\320\\276\\321\\200\\320\\265\\321\\232\\320\\265\\0\"\\\n  \"XPS \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\222\\320\\260\\321\\210\\320\\260 \\320\\262\\320\\265\\321\\200\\320\\267\\320\\270\\321\\230\\320\\260 \\321\\230\\320\\265 \\320\\260\\320\\266\\321\\203\\321\\200\\320\\275\\320\\260.\\0\"\\\n  \"\\320\\230\\320\\274\\320\\260\\321\\202\\320\\265 \\320\\262\\320\\265\\321\\200\\320\\267\\320\\270\\321\\230\\321\\203 %s\\0\"\\\n  \"\\320\\243\\320\\262\\320\\265\\321\\233\\320\\260\\321\\230\\0\"\\\n  \"\\320\\243\\320\\262\\320\\265\\321\\233\\320\\260\\321\\230\\0\"\\\n  \"\\320\\243\\320\\274\\320\\260\\321\\232\\320\\270\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\321\\206\\320\\265\\320\\275\\320\\260\\321\\202 \\321\\203\\320\\262\\320\\265\\321\\233\\320\\260\\321\\232\\320\\260\\0\"\\\n  \"[\\320\\237\\321\\200\\320\\276\\320\\274\\320\\265\\320\\275\\320\\265 \\321\\201\\321\\203 \\320\\277\\321\\200\\320\\270\\320\\274\\320\\265\\321\\233\\320\\265\\320\\275\\320\\265; \\320\\276\\321\\201\\320\\262\\320\\265\\320\\266\\320\\260\\320\\262\\320\\260\\321\\232\\320\\265] %s\\0\"\\\n  \"\\320\\272\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\321\\232\\320\\265 \\321\\202\\320\\265\\320\\272\\321\\201\\321\\202\\320\\260\\0\"\\\n  \"\\321\\210\\321\\202\\320\\260\\320\\274\\320\\277\\320\\260\\321\\232\\320\\265 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\260\\0\";\n\nconst char * gTranslations_sp_rs = \n  \"O programu\\0\"\\\n  \"Stvarna veli\\304\\215ina\\tCtrl+1\\0\"\\\n  \"Napredna pode\\305\\241avanja...\\0\"\\\n  \"Sve izabrane stranice\\0\"\\\n  \"Nazad\\tAlt+<-\\0\"\\\n  \"Izgled knjige\\tCtrl+8\\0\"\\\n  \"Zatvori\\tCtrl+W\\0\"\\\n  \"Kopiraj izabrano\\0\"\\\n  \"Kopiraj izabrano\\0\"\\\n  \"Ne pitaj me ponovo\\0\"\\\n  \"Samo lica stranica\\0\"\\\n  \"Naspramno\\tCtrl+7\\0\"\\\n  \"Datoteka\\0\"\\\n  \"Pojam:\\0\"\\\n  \"Prva stranica\\tHome\\0\"\\\n  \"Podesi stranice prema oblasti \\305\\241tampanja\\0\"\\\n  \"Idi\\0\"\\\n  \"Idi na stranicu:\\0\"\\\n  \"Pomo\\304\\207\\0\"\\\n  \"Poslednja stranica\\tEnd\\0\"\\\n  \"Uve\\304\\207anje:\\0\"\\\n  \"Uputstvo\\0\"\\\n  \"Razlikuj mala i velika slova\\0\"\\\n  \"Slede\\304\\207a stranica\\t->\\0\"\\\n  \"Ne\\0\"\\\n  \"Ne, hvala\\0\"\\\n  \"Samo pole\\304\\221ine stranica\\0\"\\\n  \"Otvori dokument\\0\"\\\n  \"Otvori...\\tCtrl+O\\0\"\\\n  \"Opcije...\\0\"\\\n  \"Lozinka\\0\"\\\n  \"Prika\\304\\215i dokument\\0\"\\\n  \"Prethodna stranica\\t<-\\0\"\\\n  \"\\305\\240tampaj...\\0\"\\\n  \"\\305\\240tampaj...\\tCtrl+P\\0\"\\\n  \"\\305\\240tampaj... (odbijeno)\\0\"\\\n  \"Zapamti lozinku za ovaj dokument\\0\"\\\n  \"Zapamti ova pode\\305\\241avanja za svaki pojedina\\304\\215ni dokument\\0\"\\\n  \"Ukloni dokument\\0\"\\\n  \"Sa\\304\\215uvaj kao...\\0\"\\\n  \"Sa\\304\\215uvaj kao...\\tCtrl+S\\0\"\\\n  \"Pode\\305\\241avanja\\0\"\\\n  \"Skupi stranice na oblast \\305\\241tampanja (ukoliko je neophodno)\\0\"\\\n  \"Pojedina\\304\\215na stranica\\tCtrl+6\\0\"\\\n  \"Presko\\304\\215i ovu verziju\\0\"\\\n  \"Upotrebi originalne veli\\304\\215ine stranica\\0\"\\\n  \"Prikaz\\0\"\\\n  \"P&rozor\\0\"\\\n  \"Da\\0\"\\\n  \"Uve\\304\\207anje\\0\"\\\n  \"(od %d)\\0\"\\\n  \"(%s. stranica)\\0\"\\\n  \"O programu SumatraPDF\\0\"\\\n  \"Dodavanje u odabir\\0\"\\\n  \"Dodaj stranicu %s me\\304\\221u odabrane\\0\"\\\n  \"Dodaj stranicu %s me\\304\\221u odabrane pod (opciono) imenom:\\0\"\\\n  \"Dodaj me\\304\\221u odabrane\\0\"\\\n  \"Dodatno\\0\"\\\n  \"Sve datoteke\\0\"\\\n  \"Svi podr\\305\\276ani dokumenti\\0\"\\\n  \"Aplikacija:\\0\"\\\n  \"Pridru\\305\\276iti PDF datotekama?\\0\"\\\n  \"Prilog : %s\\0\"\\\n  \"Autor:\\0\"\\\n  \"Automatski\\0\"\\\n  \"Automatski proveravaj dostupnost nove verzije\\0\"\\\n  \"Izgled knjige\\0\"\\\n  \"Obele\\305\\276iva\\304\\215i\\tF12\\0\"\\\n  \"Pre\\304\\215ica ka obele\\305\\276iva\\304\\215u\\0\"\\\n  \"Obele\\305\\276i pre\\304\\215icu na strani %s od %s\\0\"\\\n  \"Obele\\305\\276iva\\304\\215i\\0\"\\\n  \"bajtova\\0\"\\\n  \"CHM dokumenti\\0\"\\\n  \"Povezivanje na internet nije mogu\\304\\207e (gre\\305\\241ka %#x).\\0\"\\\n  \"Otka\\305\\276i\\0\"\\\n  \"\\305\\240tampanje ove datoteke nije mogu\\304\\207e\\0\"\\\n  \"Nije mogu\\304\\207e pokrenuti inverznu pretragu. Proverite komandnu liniju u pode\\305\\241avanjima.\\0\"\\\n  \"Promeni jezik (Change Language)\\0\"\\\n  \"Proveri postojanje novije verzije\\0\"\\\n  \"Stripovi\\0\"\\\n  \"Kompatibilnost\\0\"\\\n  \"Neprekidno\\0\"\\\n  \"Neprekidno, izgled knjige\\0\"\\\n  \"Neprekidno, naspramno\\0\"\\\n  \"U\\304\\215estvuj u prevo\\304\\221enju\\0\"\\\n  \"Kopiraj sliku\\0\"\\\n  \"Kopiraj adresu veze\\0\"\\\n  \"Kopiraj komentar\\0\"\\\n  \"Kopiranje teksta je odbijeno (mo\\305\\276e se kopirati samo kao slika)\\0\"\\\n  \"Autorska prava:\\0\"\\\n  \"Nije mogu\\304\\207e prikazati osobine \\305\\241tampa\\304\\215a\\0\"\\\n  \"Nije mogu\\304\\207e pokrenuti \\305\\241tampa\\304\\215\\0\"\\\n  \"Nije mogu\\304\\207e prikazati stranicu\\0\"\\\n  \"Izra\\304\\221ena:\\0\"\\\n  \"Teku\\304\\207a datoteka\\0\"\\\n  \"Pozicija kursora\\0\"\\\n  \"Prilago\\304\\221eno uve\\304\\207anje...\\tCtrl+Y\\0\"\\\n  \"Podrazumevani prikaz\\0\"\\\n  \"Podrazumevano uve\\304\\207anje\\0\"\\\n  \"Podrazumevani PDF \\304\\215ita\\304\\215 ne mo\\305\\276e biti promenjen u prenosivnom re\\305\\276imu\\0\"\\\n  \"Nije dopu\\305\\241teno:\\0\"\\\n  \"DjVu dokumenti\\0\"\\\n  \"Osobine dokumenta\\0\"\\\n  \"Preuzmi\\0\"\\\n  \"Iza\\304\\221i\\tCtrl+Q\\0\"\\\n  \"EPUB dokumenti\\0\"\\\n  \"Unesite lozinku\\0\"\\\n  \"Unesite lozinku za %s\\0\"\\\n  \"Unesite parametre komandne linije koji \\304\\207e se izvr\\305\\241iti prilikom dvoklika na PDF dokument:\\0\"\\\n  \"Do\\305\\241lo je do gre\\305\\241ke prilikom u\\304\\215itavanja datoteke %s\\0\"\\\n  \"Odabir\\0\"\\\n  \"Napred\\tAlt+->\\0\"\\\n  \"Ceo ekran\\tCtrl+Shift+L\\0\"\\\n  \"Naspramno\\0\"\\\n  \"Nemogu\\304\\207e je preimenovati datoteku!\\0\"\\\n  \"\\304\\214uvanje datoteke nije uspelo\\0\"\\\n  \"Brzi pregled na mre\\305\\276i\\0\"\\\n  \"Odabir\\0\"\\\n  \"FictionBook dokumenti\\0\"\\\n  \"Datoteka %s nije prona\\304\\221ena\\0\"\\\n  \"Veli\\304\\215ina:\\0\"\\\n  \"Datoteka:\\0\"\\\n  \"Prona\\304\\221i...\\tCtrl+F\\0\"\\\n  \"Prona\\304\\221i\\0\"\\\n  \"Prona\\304\\221i slede\\304\\207e\\0\"\\\n  \"Prona\\304\\221i prethodno\\0\"\\\n  \"Prona\\304\\221i:\\0\"\\\n  \"Podesi prema sadr\\305\\276aju\\tCtrl+3\\0\"\\\n  \"Podesi prema stranici\\tCtrl+0\\0\"\\\n  \"Podesi prema \\305\\241irini\\tCtrl+2\\0\"\\\n  \"Podesi prema sadr\\305\\276aju\\0\"\\\n  \"Podesi prema stranici\\0\"\\\n  \"Podesi prema \\305\\241irini\\0\"\\\n  \"Podesi prema \\305\\241irini i prika\\305\\276i stranice bez prekida\\0\"\\\n  \"Podesi prema pojedina\\304\\215noj stranici\\0\"\\\n  \"Fontovi:\\0\"\\\n  \"Formatiranje knjige... %d stranica\\0\"\\\n  \"Tekst je prona\\304\\221en na %s. stranici\\0\"\\\n  \"Prona\\304\\221i tekst na %s. stranici (ponovo)\\0\"\\\n  \"Nedavno \\304\\215itano\\0\"\\\n  \"\\0\"\\\n  \"Idi na stranicu\\0\"\\\n  \"Sakrij \\342\\200\\236nedavno \\304\\215itano\\342\\200\\235\\0\"\\\n  \"Savet: Upotrebite taster F3 za nastavak pretrage\\0\"\\\n  \"Datoteke slika (*.%s)\\0\"\\\n  \"kB\\0\"\\\n  \"\\0\"\\\n  \"Postaviti SumatraPDF kao podrazumevanu aplikaciju za PDF datoteke?\\0\"\\\n  \"Neka SumatraPFD bude podrazumevani PDF \\304\\215ita\\304\\215\\0\"\\\n  \"Manga mod\\0\"\\\n  \"Razlikuj mala i velika slova\\0\"\\\n  \"Mobi dokumenti\\0\"\\\n  \"Izmenjena:\\0\"\\\n  \"Dostupna je verzija %s. \\305\\275elite li da preuzmete novu verziju?\\0\"\\\n  \"Slede\\304\\207a stranica\\0\"\\\n  \"Pojam nije prona\\304\\221en\\0\"\\\n  \"Rezultati oko linije %u u datoteci %s nisu prona\\304\\221eni\\0\"\\\n  \"Uskla\\304\\221iva\\304\\215ka datoteka nije na\\304\\221ena\\0\"\\\n  \"Nema podataka o uskla\\304\\221enosti na ovoj poziciji\\0\"\\\n  \"Broj stranica:\\0\"\\\n  \"U redu\\0\"\\\n  \"Otvori\\0\"\\\n  \"Otvori u programu PDF-XChange\\0\"\\\n  \"Otvori dokument...\\0\"\\\n  \"Otvoriti u %s\\0\"\\\n  \"Otvori u programu Adobe Reader\\0\"\\\n  \"Otvori u programu Foxit Reader\\0\"\\\n  \"Otvori u programu Microsoft HTML Help\\0\"\\\n  \"Otvori u programu Microsoft XPS-Viewer\\0\"\\\n  \"Osobine\\0\"\\\n  \"Osobine\\tCtrl+D\\0\"\\\n  \"PDF dokument\\0\"\\\n  \"PDF optimizacija:\\0\"\\\n  \"PDF izradio\\0\"\\\n  \"PDF verzija:\\0\"\\\n  \"PDF dokumenti\\0\"\\\n  \"Stranica...\\tCtrl+G\\0\"\\\n  \"Stranica %s\\0\"\\\n  \"Dimenzije stranice:\\0\"\\\n  \"Stranica broj %u ne postoji\\0\"\\\n  \"Pode\\305\\241avanje veli\\304\\215ine stranice\\0\"\\\n  \"Stranica:\\0\"\\\n  \"PalmDoc dokumenti\\0\"\\\n  \"Spremanje prikaza...\\0\"\\\n  \"Postscript dokumenti\\0\"\\\n  \"Prezentacija\\tCtrl+L\\0\"\\\n  \"Prethodna stranica\\0\"\\\n  \"\\305\\240tampaj\\0\"\\\n  \"Opseg \\305\\241tampanja\\0\"\\\n  \"\\305\\240tampa\\304\\215 sa navedenim imenom ne postoji\\0\"\\\n  \"\\305\\240tampanje u toku.\\0\"\\\n  \"\\305\\240tampanje je i dalje u toku. Obustaviti i iza\\304\\207i?\\0\"\\\n  \"\\305\\240tampanje je jo\\305\\241 uvek u toku. \\305\\275elite li da prekinete \\305\\241tampanje i po\\304\\215nete ponovo?\\0\"\\\n  \"\\305\\240tampanje %d. stranice od ukupno %d...\\0\"\\\n  \"Problem prilikom \\305\\241tampanja.\\0\"\\\n  \"Preimenuj...\\tF2\\0\"\\\n  \"Zapamti otvarane datoteke\\0\"\\\n  \"Ukloni iz odabranih\\0\"\\\n  \"Ukloni stranicu %s iz odabranih\\0\"\\\n  \"Preimenuj u\\0\"\\\n  \"Rotiraj ulevo\\tCtrl+Shift+-\\0\"\\\n  \"Rotiraj udesno\\tCtrl+Shift++\\0\"\\\n  \"Sa\\304\\215uvaj kao\\0\"\\\n  \"Sa\\304\\215uvaj pre\\304\\215icu...\\tCtrl+Shift+S\\0\"\\\n  \"Pretra\\305\\276ivanje %d. stranice od ukupno %d...\\0\"\\\n  \"Izaberi sve\\0\"\\\n  \"Izaberi sve\\tCtrl+A\\0\"\\\n  \"Izaberite sadr\\305\\276aj koriste\\304\\207i Ctrl + levo dugme mi\\305\\241a\\0\"\\\n  \"Izbor\\0\"\\\n  \"Po\\305\\241alji putem e-po\\305\\241te...\\0\"\\\n  \"Omogu\\304\\207i inverznu pretragu\\0\"\\\n  \"Prika\\305\\276i Obele\\305\\276iva\\304\\215e\\0\"\\\n  \"Prika\\305\\276i stranice bez prekida\\0\"\\\n  \"Traka sa alatkama\\0\"\\\n  \"Prika\\305\\276i odabrane stranice\\0\"\\\n  \"Prika\\305\\276i nedavno \\304\\215itane\\0\"\\\n  \"Prika\\305\\276i bo\\304\\215nu traku sa obele\\305\\276iva\\304\\215ima\\0\"\\\n  \"Pojedina\\304\\215na stranica\\0\"\\\n  \"Oprostite, ovo nije trebalo da se dogodi!\\n\\nPritisnite dugme 'Otka\\305\\276i' ako \\305\\276elite da nam pomognete u re\\305\\241avanju ovog problema.\\0\"\\\n  \"Izvorna datoteka %s nema ta\\304\\215ku uskla\\304\\221ivanja\\0\"\\\n  \"Predmet:\\0\"\\\n  \"Pode\\305\\241avanja programa SumatraPDF\\0\"\\\n  \"A\\305\\276uriranje SumatraPDF\\0\"\\\n  \"Program SumatraPDF je krahirao\\0\"\\\n  \"SumatraPDF je va\\305\\241 podrazumevani PDF \\304\\215ita\\304\\215\\0\"\\\n  \"SumatraPDF je postavljen kao podrazumevani PDF \\304\\215ita\\304\\215\\0\"\\\n  \"Nije mogu\\304\\207e otvoriti uskla\\304\\221iva\\304\\215ku datoteku\\0\"\\\n  \"Ozna\\304\\215eni PDF\\0\"\\\n  \"Tekstualni dokumenti\\0\"\\\n  \"Ovaj dokument koristi nepodr\\305\\276ane opcije (%s) i mo\\305\\276e biti prikazan nekorektno\\0\"\\\n  \"Naslov:\\0\"\\\n  \"Nepoznata izvorna datoteka (%s)\\0\"\\\n  \"Koristiti tab\\0\"\\\n  \"Prikaz\\0\"\\\n  \"Poseti veb-sajt\\0\"\\\n  \"Upozorenje\\0\"\\\n  \"XPS dokumenti\\0\"\\\n  \"Va\\305\\241a verzija je a\\305\\276urna.\\0\"\\\n  \"Imate verziju %s\\0\"\\\n  \"Uve\\304\\207aj\\0\"\\\n  \"Uve\\304\\207aj\\0\"\\\n  \"Umanji\\0\"\\\n  \"Procenat uve\\304\\207anja\\0\"\\\n  \"[Promene su prime\\304\\207ene; osve\\305\\276avanje] %s\\0\"\\\n  \"kopiranje teksta\\0\"\\\n  \"\\305\\241tampanje dokumenta\\0\";\n\nconst char * gTranslations_sk = \n  \"&O programe...\\0\"\\\n  \"&Skuto\\304\\215n\\303\\241 ve\\304\\276kos\\305\\245\\tCtrl+1\\0\"\\\n  \"&Roz\\305\\241\\303\\255ren\\303\\251 mo\\305\\276nosti...\\0\"\\\n  \"&Tla\\304\\215i\\305\\245 v\\305\\241etky strany\\0\"\\\n  \"&Nasp\\303\\244\\305\\245\\tAlt+Left Arrow\\0\"\\\n  \"&Kniha\\tCtrl+8\\0\"\\\n  \"&Zatvori\\305\\245\\tCtrl+W\\0\"\\\n  \"&Kop\\303\\255rova\\305\\245 vybran\\303\\251\\0\"\\\n  \"&Kop\\303\\255rova\\305\\245 vybran\\303\\251\\tCtrl+C\\0\"\\\n  \"&Nep\\303\\275ta\\305\\245 sa znova\\0\"\\\n  \"&Tla\\304\\215i\\305\\245 iba p\\303\\241rne strany\\0\"\\\n  \"&Dve strany\\tCtrl+7\\0\"\\\n  \"&S\\303\\272bor\\0\"\\\n  \"&Vyh\\304\\276ada\\305\\245:\\0\"\\\n  \"&Prv\\303\\241 strana\\tHome\\0\"\\\n  \"&Prisp\\303\\264sobi\\305\\245 strany na tla\\304\\215ite\\304\\276n\\303\\272 plochu\\0\"\\\n  \"&\\303\\215s\\305\\245 na\\0\"\\\n  \"&Prejs\\305\\245 na stranu:\\0\"\\\n  \"&Pomoc\\0\"\\\n  \"&Posledn\\303\\241 strana\\tEnd\\0\"\\\n  \"&Zobrazenie:\\0\"\\\n  \"&Pr\\303\\255ru\\304\\215ka\\0\"\\\n  \"&Pod\\304\\276a zadan\\303\\275ch krit\\303\\251ri\\303\\255\\0\"\\\n  \"&\\304\\216al\\305\\241ia strana\\t->\\0\"\\\n  \"&Nie\\0\"\\\n  \"&Nie, \\304\\217akujem\\0\"\\\n  \"&Tla\\304\\215i\\305\\245 iba nep\\303\\241rne strany\\0\"\\\n  \"&Otvori\\305\\245 dokument\\0\"\\\n  \"&Otvori\\305\\245...\\tCtrl+O\\0\"\\\n  \"&Mo\\305\\276nosti...\\0\"\\\n  \"&Heslo:\\0\"\\\n  \"&Pripn\\303\\272\\305\\245 dokument\\0\"\\\n  \"&Predch\\303\\241dzaj\\303\\272ca strana\\t<-\\0\"\\\n  \"&Tla\\304\\215...\\0\"\\\n  \"&Tla\\304\\215i\\305\\245...\\tCtrl+P\\0\"\\\n  \"&Tla\\304\\215... (odmietnut\\303\\241)\\0\"\\\n  \"&Zapam\\303\\244ta\\305\\245 si heslo pre tento dokument\\0\"\\\n  \"&Zapam\\303\\244ta\\305\\245 si tieto nastavenia pre ka\\305\\276d\\303\\275 dokument\\0\"\\\n  \"&Odobra\\305\\245 dokument\\0\"\\\n  \"&Ulo\\305\\276i\\305\\245 ako...\\0\"\\\n  \"Ulo\\305\\276i\\305\\245 ako...\\tCtrl+S\\0\"\\\n  \"&Nastavenia\\0\"\\\n  \"&Zmen\\305\\241i\\305\\245 strany na tla\\304\\215ite\\304\\276n\\303\\272 plochu (ak je to potrebn\\303\\251)\\0\"\\\n  \"&Jedna strana\\tCtrl+6\\0\"\\\n  \"&Presko\\304\\215i\\305\\245 t\\303\\272to verziu\\0\"\\\n  \"Pou\\305\\276i\\305\\245 origin\\303\\241lne ve\\304\\276kosti str\\303\\241n\\0\"\\\n  \"&Zobrazi\\305\\245\\0\"\\\n  \"&Okno\\0\"\\\n  \"&\\303\\201no\\0\"\\\n  \"&Zv\\303\\244\\304\\215\\305\\241enie\\0\"\\\n  \"(z %d)\\0\"\\\n  \"(strana %s)\\0\"\\\n  \"O programe SumatraPDF\\0\"\\\n  \"Prida\\305\\245 ob\\304\\276\\303\\272ben\\303\\272 polo\\305\\276ku\\0\"\\\n  \"Prida\\305\\245 stranu %s k ob\\304\\276\\303\\272ben\\303\\275m\\0\"\\\n  \"Prida\\305\\245 stranu %s k ob\\304\\276\\303\\272ben\\303\\275m s (volite\\304\\276n\\303\\275m) n\\303\\241zvom:\\0\"\\\n  \"Prida\\305\\245 k ob\\304\\276\\303\\272ben\\303\\275m\\0\"\\\n  \"Pokro\\304\\215il\\303\\251\\0\"\\\n  \"V\\305\\241etky s\\303\\272bory\\0\"\\\n  \"V\\305\\241etky podporovan\\303\\251 dokumenty\\0\"\\\n  \"Program:\\0\"\\\n  \"Asociova\\305\\245 s PDF s\\303\\272bormi?\\0\"\\\n  \"Pr\\303\\255loha: %s\\0\"\\\n  \"Tvorca:\\0\"\\\n  \"Automaticky\\0\"\\\n  \"Automaticky kontrolova\\305\\245 &aktualiz\\303\\241cie\\0\"\\\n  \"Zobrazi\\305\\245 ako knihu\\0\"\\\n  \"Z\\303\\241lo\\305\\276ky\\tF12\\0\"\\\n  \"Z\\303\\241stupca z\\303\\241lo\\305\\276iek\\0\"\\\n  \"Z\\303\\241stupca z\\303\\241lo\\305\\276ky na stranu %s z %s\\0\"\\\n  \"Z\\303\\241lo\\305\\276ky\\0\"\\\n  \"Bajtov\\0\"\\\n  \"CHM dokumenty\\0\"\\\n  \"Pripojenie k internetu zlyhalo (chyba %#x).\\0\"\\\n  \"Zru\\305\\241i\\305\\245\\0\"\\\n  \"Tla\\304\\215 s\\303\\272boru zlyhala\\0\"\\\n  \"Pr\\303\\255kaz inverzn\\303\\251 h\\304\\276adanie zlyhal. Skontrolujte pr\\303\\255kazov\\303\\275 riadok v nastaveniach.\\0\"\\\n  \"Zmeni\\305\\245 jazyk (Change Language)\\0\"\\\n  \"&Skontrolova\\305\\245 nov\\303\\272 verziu\\0\"\\\n  \"Komiksy\\0\"\\\n  \"Kompatibilita\\0\"\\\n  \"Priebe\\305\\276ne\\0\"\\\n  \"Priebe\\305\\276n\\303\\275 kni\\305\\276n\\303\\275 poh\\304\\276ad\\0\"\\\n  \"Dve strany priebe\\305\\276ne\\0\"\\\n  \"Prispie\\305\\245 k prekladu programu\\0\"\\\n  \"Kop\\303\\255rova\\305\\245 &obr\\303\\241zok\\0\"\\\n  \"Kop\\303\\255rova\\305\\245 odkaz\\0\"\\\n  \"Kop\\303\\255rova\\305\\245 ko&ment\\303\\241r\\0\"\\\n  \"Kop\\303\\255rovanie textu odmietnut\\303\\251 (iba ako obr\\303\\241zok)\\0\"\\\n  \"Autorsk\\303\\251 pr\\303\\241va:\\0\"\\\n  \"Z\\303\\255skanie vlastnost\\303\\255 tla\\304\\215iarne zlyhalo\\0\"\\\n  \"Inicializ\\303\\241cia tla\\304\\215iarne zlyhala\\0\"\\\n  \"Nepodarilo sa na\\304\\215\\303\\255ta\\305\\245 stranu\\0\"\\\n  \"Vytvoren\\303\\275:\\0\"\\\n  \"Aktu\\303\\241lny s\\303\\272bor\\0\"\\\n  \"Poz\\303\\255cia kurzora:\\0\"\\\n  \"Vlastn\\303\\241 &zmena ve\\304\\276kosti...\\tCtrl+Y\\0\"\\\n  \"Predvolen\\303\\251 &zobrazenie:\\0\"\\\n  \"Predvolen\\303\\241 &ve\\304\\276kos\\305\\245\\0\"\\\n  \"Predvolen\\303\\275 prehliada\\304\\215 PDF dokumentov nem\\303\\264\\305\\276e by\\305\\245 zmenen\\303\\275, pokia\\304\\276 nie je nain\\305\\241talovan\\303\\275\\0\"\\\n  \"Odmietnut\\303\\251 povolenia:\\0\"\\\n  \"DjVu dokumenty\\0\"\\\n  \"Vlastnosti dokumentu\\0\"\\\n  \"Stiahnu\\305\\245\\0\"\\\n  \"&Ukon\\304\\215i\\305\\245\\tCtrl+Q\\0\"\\\n  \"EPUB dokumenty\\0\"\\\n  \"Zada\\305\\245 heslo\\0\"\\\n  \"Zada\\305\\245 heslo pre %s\\0\"\\\n  \"Dvojit\\303\\251 kliknutie na PDF dokument vykon\\303\\241 zadan\\303\\275 pr\\303\\255kazov\\303\\275 riadok:\\0\"\\\n  \"Chyba pri na\\304\\215\\303\\255tan\\303\\255 %s\\0\"\\\n  \"&Ob\\304\\276\\303\\272ben\\303\\251 polo\\305\\276ky\\0\"\\\n  \"D&opredu\\tAlt+Right Arrow\\0\"\\\n  \"&Na cel\\303\\272 obrazovku\\tCtrl+Shift+L\\0\"\\\n  \"Dve strany\\0\"\\\n  \"Premenovanie s\\303\\272boru bolo ne\\303\\272spe\\305\\241n\\303\\251!\\0\"\\\n  \"Ulo\\305\\276enie s\\303\\272boru bolo ne\\303\\272spe\\305\\241n\\303\\251\\0\"\\\n  \"R\\303\\275chle zobrazovanie z internetu\\0\"\\\n  \"Ob\\304\\276\\303\\272ben\\303\\251 polo\\305\\276ky\\0\"\\\n  \"FictionBook dokumenty\\0\"\\\n  \"S\\303\\272bor %s nen\\303\\241jden\\303\\275\\0\"\\\n  \"Ve\\304\\276kos\\305\\245 s\\303\\272boru:\\0\"\\\n  \"S\\303\\272bor:\\0\"\\\n  \"H&\\304\\276ada\\305\\245...\\tCtrl+F\\0\"\\\n  \"H\\304\\276ada\\305\\245\\0\"\\\n  \"H\\304\\276ada\\305\\245 \\304\\217al\\305\\241ie\\0\"\\\n  \"H\\304\\276ada\\305\\245 predch\\303\\241dzaj\\303\\272ce\\0\"\\\n  \"H\\304\\276ada\\305\\245:\\0\"\\\n  \"Prisp\\303\\264sobi\\305\\245 &obsah\\tCtrl+3\\0\"\\\n  \"P&risp\\303\\264sobi\\305\\245 strane\\tCtrl+0\\0\"\\\n  \"N&a \\305\\241\\303\\255rku obrazovky\\tCtrl+2\\0\"\\\n  \"Prisp\\303\\264sobi\\305\\245 obsah\\0\"\\\n  \"Prisp\\303\\264sobi\\305\\245 strane\\0\"\\\n  \"Na \\305\\241\\303\\255rku obrazovky\\0\"\\\n  \"Prisp\\303\\264sobi\\305\\245 \\305\\241\\303\\255rke okna\\0\"\\\n  \"Prisp\\303\\264sobi\\305\\245 a zobrazi\\305\\245 cel\\303\\272 stranu v okne\\0\"\\\n  \"P\\303\\255sma:\\0\"\\\n  \"Form\\303\\241tovanie knihy... %d str\\303\\241nok\\0\"\\\n  \"Text bol n\\303\\241jden\\303\\275 na strane %s\\0\"\\\n  \"Text bol n\\303\\241jden\\303\\275 na strane %s (znova)\\0\"\\\n  \"\\304\\214asto \\304\\215\\303\\255tan\\303\\251 dokumenty\\0\"\\\n  \"\\0\"\\\n  \"\\303\\215s\\305\\245 na stranu\\0\"\\\n  \"Skry\\305\\245 \\304\\215asto \\304\\215\\303\\255tan\\303\\251 dokumenty\\0\"\\\n  \"Rada: Pou\\305\\276ite kl\\303\\241vesu F3 pre \\304\\217al\\305\\241ie h\\304\\276adanie\\0\"\\\n  \"S\\303\\272bory obr\\303\\241zkov (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Nastavi\\305\\245 SumatraPDF ako predvolen\\303\\275 prehliada\\304\\215 PDF s\\303\\272borov?\\0\"\\\n  \"Nastavi\\305\\245 SumatraPDF ako predvolen\\303\\275 PDF prehliada\\304\\215\\0\"\\\n  \"Man&ga m\\303\\263d\\0\"\\\n  \"Rozli\\305\\241ova\\305\\245 ve\\304\\276k\\303\\251/mal\\303\\251 p\\303\\255smen\\303\\241\\0\"\\\n  \"Mobi dokumenty\\0\"\\\n  \"Upraven\\303\\251:\\0\"\\\n  \"Nov\\303\\241 verzia %s je k dispoz\\303\\255cii. Stiahnu\\305\\245 nov\\303\\272 verziu?\\0\"\\\n  \"\\304\\216al\\305\\241ia strana\\0\"\\\n  \"Nen\\303\\241jden\\303\\251 pod\\304\\276a zodpovedaj\\303\\272cich krit\\303\\251ri\\303\\255\\0\"\\\n  \"Nen\\303\\241jden\\303\\251 \\305\\276iadne v\\303\\275sledky na riadku %u v s\\303\\272bore %s\\0\"\\\n  \"S\\303\\272bor synchroniz\\303\\241cie nen\\303\\241jden\\303\\275\\0\"\\\n  \"Ch\\303\\275ba inform\\303\\241cia o synchroniz\\303\\241cii\\0\"\\\n  \"Po\\304\\215et str\\303\\241n:\\0\"\\\n  \"V poriadku\\0\"\\\n  \"Otvori\\305\\245\\0\"\\\n  \"Otvori\\305\\245 v programe PDF-XChange\\0\"\\\n  \"Otvori\\305\\245 dokument...\\0\"\\\n  \"Otvori\\305\\245 v %s\\0\"\\\n  \"Otvori\\305\\245 v programe &Adobe Reader\\0\"\\\n  \"Otvori\\305\\245 v programe &Foxit Reader\\0\"\\\n  \"Otvori\\305\\245 v programe Microsoft HTML Help\\0\"\\\n  \"Otvori\\305\\245 v programe Microsoft XPS-Viewer\\0\"\\\n  \"&Vlastnosti\\0\"\\\n  \"V&lastnosti...\\tCtrl+D\\0\"\\\n  \"PDF Dokument\\0\"\\\n  \"PDF Optimaliz\\303\\241cia:\\0\"\\\n  \"Vytvoren\\303\\251 v:\\0\"\\\n  \"PDF Verzia:\\0\"\\\n  \"PDF dokumenty\\0\"\\\n  \"St&rana...\\tCtrl+G\\0\"\\\n  \"Strana %s\\0\"\\\n  \"Ve\\304\\276kos\\305\\245 strany:\\0\"\\\n  \"\\304\\214\\303\\255slo strany %u neexistuje\\0\"\\\n  \"Mierka strany\\0\"\\\n  \"Strana:\\0\"\\\n  \"PalmDoc dokumenty\\0\"\\\n  \"Pros\\303\\255m po\\304\\215kajte - zobrazovanie...\\0\"\\\n  \"Postscript dokumenty\\0\"\\\n  \"Pr&ezent\\303\\241cia\\tCtrl+L\\0\"\\\n  \"Predch\\303\\241dzaj\\303\\272ca strana\\0\"\\\n  \"Tla\\304\\215\\0\"\\\n  \"Rozsah tla\\304\\215e\\0\"\\\n  \"Tla\\304\\215iare\\305\\210 s uveden\\303\\275m n\\303\\241zvom neexistuje.\\0\"\\\n  \"Prebieha tla\\304\\215...\\0\"\\\n  \"Prebieha tla\\304\\215. Preru\\305\\241i\\305\\245 a ukon\\304\\215i\\305\\245 tla\\304\\215?\\0\"\\\n  \"Prebieha tla\\304\\215. Preru\\305\\241i\\305\\245 a za\\304\\215a\\305\\245 znova?\\0\"\\\n  \"Tla\\304\\215 strany %d z %d...\\0\"\\\n  \"Probl\\303\\251m pri tla\\304\\215i.\\0\"\\\n  \"Preme&nova\\305\\245...\\tF2\\0\"\\\n  \"Zapam\\303\\244ta\\305\\245 si &otvoren\\303\\251 s\\303\\272bory\\0\"\\\n  \"Odobra\\305\\245 z ob\\304\\276\\303\\272ben\\303\\275ch polo\\305\\276iek\\0\"\\\n  \"Odobra\\305\\245 stranu %s z ob\\304\\276\\303\\272ben\\303\\275ch polo\\305\\276iek\\0\"\\\n  \"Premenova\\305\\245 na\\0\"\\\n  \"Oto\\304\\215i\\305\\245 &v\\304\\276avo\\tCtrl+Shift+-\\0\"\\\n  \"Oto\\304\\215i\\305\\245 vpravo\\tCtrl+Shift++\\0\"\\\n  \"Ulo\\305\\276i\\305\\245 ako\\0\"\\\n  \"Ulo\\305\\276i\\305\\245 z&\\303\\241stupcu...\\tCtrl+Shift+S\\0\"\\\n  \"Vyh\\304\\276ad\\303\\241va sa %d z/zo %d...\\0\"\\\n  \"Vybra\\305\\245 &v\\305\\241etko\\0\"\\\n  \"Vybra\\305\\245 &v\\305\\241etko\\tCtrl+A\\0\"\\\n  \"Ozna\\304\\215i\\305\\245 obsah s \\\"Ctrl + \\304\\276av\\303\\251 tla\\304\\215idlo my\\305\\241i\\\"\\0\"\\\n  \"V\\303\\275ber:\\0\"\\\n  \"Odosla\\305\\245 &e-mailom...\\0\"\\\n  \"Nastavi\\305\\245 inverzn\\303\\251 vyh\\304\\276ad\\303\\241vanie\\0\"\\\n  \"Zobrazi\\305\\245 &Z\\303\\241lo\\305\\276ky\\0\"\\\n  \"Zobrazi\\305\\245 &strany priebe\\305\\276ne\\0\"\\\n  \"Zobrazi\\305\\245 &panel n\\303\\241strojov\\0\"\\\n  \"Zobrazi\\305\\245 ob\\304\\276\\303\\272ben\\303\\251 polo\\305\\276ky\\0\"\\\n  \"Zobrazi\\305\\245 \\304\\215asto \\304\\215\\303\\255tan\\303\\251 dokumenty\\0\"\\\n  \"Zobrazi\\305\\245 bo\\304\\215n\\303\\275 panel &z\\303\\241lo\\305\\276iek, pokia\\304\\276 je dostupn\\303\\275\\0\"\\\n  \"Jedna strana\\0\"\\\n  \"Ospravedl\\305\\210ujeme sa, nemalo sa to sta\\305\\245.\\n\\nAk n\\303\\241m chcete pom\\303\\264c\\305\\245 vyrie\\305\\241i\\305\\245 pr\\303\\255\\304\\215inu tohto zlyhania programu, stla\\304\\215te tla\\304\\215idlo 'Storno'.\\0\"\\\n  \"Zdrojov\\303\\275 s\\303\\272bor %s nem\\303\\241 synchroniza\\304\\215n\\303\\275 bod\\0\"\\\n  \"Predmet:\\0\"\\\n  \"Nastavenia SumatraPDF\\0\"\\\n  \"Aktualiz\\303\\241cia SumatraPDF\\0\"\\\n  \"SumatraPDF - zr\\303\\272tenie programu\\0\"\\\n  \"SumatraPDF je v\\303\\241\\305\\241 predvolen\\303\\275 prehliada\\304\\215 PDF s\\303\\272borov\\0\"\\\n  \"SumatraPDF by teraz mala by\\305\\245 va\\305\\241\\303\\255m predvolen\\303\\275m prehliada\\304\\215om PDF s\\303\\272borov\\0\"\\\n  \"Synchroniza\\304\\215n\\303\\275 s\\303\\272bor nie je mo\\305\\276n\\303\\251 otvori\\305\\245\\0\"\\\n  \"Ozna\\304\\215en\\303\\275 PDF\\0\"\\\n  \"Textov\\303\\251 dokumenty\\0\"\\\n  \"Tento dokument pou\\305\\276\\303\\255va nepodporovan\\303\\251 funkcie (%s) a t\\303\\275mto sa nemus\\303\\255 vykresli\\305\\245 spr\\303\\241vne\\0\"\\\n  \"N\\303\\241zov:\\0\"\\\n  \"Nezn\\303\\241my zdrojov\\303\\275 s\\303\\272bor (%s)\\0\"\\\n  \"Povoli\\305\\245 &z\\303\\241lo\\305\\276ky\\0\"\\\n  \"Zobrazi\\305\\245\\0\"\\\n  \"&Nav\\305\\241t\\303\\255vi\\305\\245 webov\\303\\272 str\\303\\241nku\\0\"\\\n  \"Upozornenie\\0\"\\\n  \"XPS dokumenty\\0\"\\\n  \"Pou\\305\\276\\303\\255vate najnov\\305\\241iu verziu.\\0\"\\\n  \"Pou\\305\\276\\303\\255vate verziu %s\\0\"\\\n  \"Zmeni\\305\\245 ve\\304\\276kos\\305\\245\\0\"\\\n  \"Zv\\303\\244\\304\\215\\305\\241i\\305\\245\\0\"\\\n  \"Zmen\\305\\241i\\305\\245\\0\"\\\n  \"Ve\\304\\276kos\\305\\245 zobrazenia\\0\"\\\n  \"[Boli zisten\\303\\251 zmeny, znovu sa na\\304\\215\\303\\255tava] %s\\0\"\\\n  \"prebieha kop\\303\\255rovanie textu\\0\"\\\n  \"prebieha tla\\304\\215 dokumentu\\0\";\n\nconst char * gTranslations_sl = \n  \"&O programu\\0\"\\\n  \"&Dejanska velikost\\tCtrl+1\\0\"\\\n  \"N&apredne mo\\305\\276nosti \\342\\200\\246\\0\"\\\n  \"&Vse izbrane strani\\0\"\\\n  \"&Nazaj\\tAlt+Leva pu\\305\\241\\304\\215ica\\0\"\\\n  \"Knji\\305\\276ni pogled\\tCtrl+8\\0\"\\\n  \"&Zapri\\tCtrl+W\\0\"\\\n  \"Kopiraj izbor\\0\"\\\n  \"Kopiraj izbor\\tCtrl+C\\0\"\\\n  \"&Ne spra\\305\\241uj me ve\\304\\215\\0\"\\\n  \"Samo &parne strani\\0\"\\\n  \"Dvostransko\\tCtrl+7\\0\"\\\n  \"&Datoteka\\0\"\\\n  \"&Najdi:\\0\"\\\n  \"Prva stran\\tHome\\0\"\\\n  \"Prilagodi strani na podro\\304\\215je tiskanja\\0\"\\\n  \"Po&jdi na\\0\"\\\n  \"Pojdi na &stran:\\0\"\\\n  \"Po&mo\\304\\215\\0\"\\\n  \"Zadnja stran\\tEnd\\0\"\\\n  \"&Pove\\304\\215ava:\\0\"\\\n  \"P&riro\\304\\215nik\\0\"\\\n  \"Razlikuj &med velikimi/malimi \\304\\215rkami\\0\"\\\n  \"Naslednja stran\\tPu\\305\\241\\304\\215ica desno\\0\"\\\n  \"&Ne\\0\"\\\n  \"&Ne, hvala\\0\"\\\n  \"Samo &lihe strani\\0\"\\\n  \"&Odpri dokument\\0\"\\\n  \"&Odpri \\342\\200\\246\\tCtrl+O\\0\"\\\n  \"&Mo\\305\\276nosti \\342\\200\\246\\0\"\\\n  \"&Geslo:\\0\"\\\n  \"&Pritrdi dokument\\0\"\\\n  \"Predhodna stran\\tPu\\305\\241\\304\\215ica levo\\0\"\\\n  \"&Natisni \\342\\200\\246\\0\"\\\n  \"&Natisni \\342\\200\\246\\tCtrl+P\\0\"\\\n  \"&Natisni \\342\\200\\246 (onemogo\\304\\215eno)\\0\"\\\n  \"&Zapomni si geslo za ta dokument\\0\"\\\n  \"Zapomni si te &nastavitve za vsak dokument\\0\"\\\n  \"Odstrani dokument\\0\"\\\n  \"Shrani &kot \\342\\200\\246\\0\"\\\n  \"Shrani &kot \\342\\200\\246\\tCtrl+S\\0\"\\\n  \"&Nastavitve\\0\"\\\n  \"&Skr\\304\\215i strani na podro\\304\\215je tiskanja (\\304\\215e potrebno)\\0\"\\\n  \"&Enostransko\\tCtrl+6\\0\"\\\n  \"&Presko\\304\\215i to razli\\304\\215ico\\0\"\\\n  \"&Uporabi izvirno velikost strani\\0\"\\\n  \"&Pogled\\0\"\\\n  \"&Okno\\0\"\\\n  \"&Da\\0\"\\\n  \"Po&ve\\304\\215ava\\0\"\\\n  \"(od %d)\\0\"\\\n  \"(stran %s)\\0\"\\\n  \"O programu SumatraPDF\\0\"\\\n  \"Dodaj Priljubljene\\0\"\\\n  \"Dodaj stran %s med priljubljene\\0\"\\\n  \"Dodaj stran %s med priljubljene z (neobveznim) imenom:\\0\"\\\n  \"Dodaj med priljubljene\\0\"\\\n  \"Napredno\\0\"\\\n  \"Vse datoteke\\0\"\\\n  \"Vse podprte dokumente\\0\"\\\n  \"Aplikacija:\\0\"\\\n  \"Pove\\305\\276em s PDF datotekami?\\0\"\\\n  \"Priponka: %s\\0\"\\\n  \"Avtor:\\0\"\\\n  \"Samodejno\\0\"\\\n  \"&Samodejno preveri za posodobitve\\0\"\\\n  \"Knji\\305\\276ni pogled\\0\"\\\n  \"Zazna&mki\\tF12\\0\"\\\n  \"Zaznamki bli\\305\\276njic\\0\"\\\n  \"Zaznamek bli\\305\\276njice na stran %s od %s\\0\"\\\n  \"Zaznamki\\0\"\\\n  \"Bajtov\\0\"\\\n  \"CHM dokumenti\\0\"\\\n  \"Ne morem se povezati na internet (napaka %#x).\\0\"\\\n  \"Prekli\\304\\215i\\0\"\\\n  \"Te datoteke ni mogo\\304\\215e natisniti\\0\"\\\n  \"Ukaza za obratno iskanje ni mogo\\304\\215e zagnati. Preverite ukazno vrstico v nastavitvah.\\0\"\\\n  \"Spremeni jezik (Change Language)\\0\"\\\n  \"&Preveri za posodobitve\\0\"\\\n  \"\\0\"\\\n  \"Zdru\\305\\276ljivost\\0\"\\\n  \"Nepretrgano\\0\"\\\n  \"Nepretrgan knji\\305\\276ni pogled\\0\"\\\n  \"Nepretrgano dvostransko\\0\"\\\n  \"Prispevajte prevod\\0\"\\\n  \"Kopiraj &sliko\\0\"\\\n  \"Kopiraj nas&lov povezave\\0\"\\\n  \"Kopiraj ko&mentar\\0\"\\\n  \"Kopiranje besedila je bilo zavrnjeno (kopiranje samo kot slika)\\0\"\\\n  \"Avtorske pravice:\\0\"\\\n  \"Ni bilo mogo\\304\\215e dobiti Lastnosti tiskalnika\\0\"\\\n  \"Ni bilo mogo\\304\\215e inicializirati tiskalnika\\0\"\\\n  \"Ni bilo mogo\\304\\215e upodobiti strani\\0\"\\\n  \"Ustvarjeno:\\0\"\\\n  \"Trenutna datoteka\\0\"\\\n  \"Polo\\305\\276aj kurzorja:\\0\"\\\n  \"Pove\\304\\215ava po &meri \\342\\200\\246\\tCtrl+Y\\0\"\\\n  \"&Privzeta postavitev:\\0\"\\\n  \"Pri&vzeta pove\\304\\215ava:\\0\"\\\n  \"Glavnega bralnika PDF ni mogo\\304\\215e spremeniti v prenosnem na\\304\\215inu\\0\"\\\n  \"Zavrnjena dovoljenja:\\0\"\\\n  \"DjVu dokumenti\\0\"\\\n  \"Lastnosti dokumenta\\0\"\\\n  \"Prenesi\\0\"\\\n  \"I&zhod\\tCtrl+Q\\0\"\\\n  \"EPUB dokumenti\\0\"\\\n  \"Vnesite geslo\\0\"\\\n  \"Vnesite geslo za %s\\0\"\\\n  \"Vnesite ukazno vrstico, ki se bo izvedla, ko boste dvokliknili na PDF dokument:\\0\"\\\n  \"Napaka pri nalaganju %s\\0\"\\\n  \"Priljubljeni\\0\"\\\n  \"Naprej\\tAlt+Desna pu\\305\\241\\304\\215ica\\0\"\\\n  \"Celozaslonsko\\tCtrl+Shift+L\\0\"\\\n  \"Dvostransko\\0\"\\\n  \"Preimenovanje datoteke ni uspelo!\\0\"\\\n  \"Shranjevanje datoteke ni uspelo\\0\"\\\n  \"Hiter spletni prikaz\\0\"\\\n  \"Priljubljeni\\0\"\\\n  \"FictionBook dokumenti\\0\"\\\n  \"Datoteka %s ni bila najdena\\0\"\\\n  \"Velikost datoteke:\\0\"\\\n  \"Datoteka:\\0\"\\\n  \"Naj&di \\342\\200\\246\\tCtrl+F\\0\"\\\n  \"Najdi\\0\"\\\n  \"Najdi naslednje\\0\"\\\n  \"Najdi prej\\305\\241nje\\0\"\\\n  \"Najdi:\\0\"\\\n  \"&Prilagodi vsebino\\tCtrl+3\\0\"\\\n  \"&Prilagodi stran\\tCtrl+0\\0\"\\\n  \"P&rilagodi po \\305\\241irini\\tCtrl+2\\0\"\\\n  \"Prilagodi vsebino\\0\"\\\n  \"Prilagodi stran\\0\"\\\n  \"Prilagodi po \\305\\241irini\\0\"\\\n  \"Prilagodi po \\305\\241irini in prika\\305\\276i strani nepretrgano\\0\"\\\n  \"Prilagodi enostransko\\0\"\\\n  \"Pisave:\\0\"\\\n  \"Oblikovanje knjige \\342\\200\\246 %d strani\\0\"\\\n  \"Besedilo najdeno na strani %s\\0\"\\\n  \"Besedilo najdeno na strani %s (ponovno)\\0\"\\\n  \"Pogosto brani\\0\"\\\n  \"\\0\"\\\n  \"Pojdi na stran\\0\"\\\n  \"Skrij pogosto brane\\0\"\\\n  \"Namig: uporabite tipko F3 za ponovno iskanje\\0\"\\\n  \"Slikovne datoteke (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Naj bo SumatraPDF privezti program za datoteke PDF?\\0\"\\\n  \"SumatraPDF naj bo privzeti bralnik PDF\\0\"\\\n  \"Na\\304\\215in Man&ga\\0\"\\\n  \"Razlikuj med velikimi/malimi \\304\\215rkami\\0\"\\\n  \"Mobi dokumenti\\0\"\\\n  \"Spremenjeno:\\0\"\\\n  \"Na voljo je nova razli\\304\\215ica %s. Jo \\305\\276elite prenesti?\\0\"\\\n  \"Naslednja stran\\0\"\\\n  \"Ni zadetkov\\0\"\\\n  \"Okoli vrstice %u v datoteki %s ni zadetkov\\0\"\\\n  \"Datoteka sinhronizacije ni bila najdena\\0\"\\\n  \"Na tem mestu ni sinhronizacijskih podatkov\\0\"\\\n  \"\\305\\240tevilo strani:\\0\"\\\n  \"V redu\\0\"\\\n  \"Odpri\\0\"\\\n  \"Odpri s programom PDF-XChange\\0\"\\\n  \"Odpri dokument \\342\\200\\246\\0\"\\\n  \"Odpri v %s\\0\"\\\n  \"Odpri s programom &Adobe Reader\\0\"\\\n  \"Odpri s programom &Foxit Reader\\0\"\\\n  \"Odpri s programom Microsoft HTML Help\\0\"\\\n  \"Odpri s programom Microsoft XPS-Viewer\\0\"\\\n  \"Lastnosti\\0\"\\\n  \"Lastnosti\\tCtrl+D\\0\"\\\n  \"Dokument PDF\\0\"\\\n  \"Optimizacije PDF:\\0\"\\\n  \"PDF izdelovalec:\\0\"\\\n  \"Verzija PDF:\\0\"\\\n  \"PDF dokumenti\\0\"\\\n  \"Stran \\342\\200\\246\\tCtrl+G\\0\"\\\n  \"Stran %s\\0\"\\\n  \"Velikost strani:\\0\"\\\n  \"Stran \\305\\241tevilka %u ne obstaja\\0\"\\\n  \"Merilo strani\\0\"\\\n  \"Stran:\\0\"\\\n  \"PalmDoc dokumenti\\0\"\\\n  \"Po\\304\\215akajte trenutek, upodobitev poteka \\342\\200\\246\\0\"\\\n  \"Postscript dokumenti\\0\"\\\n  \"Pr&edstavitev\\tCtrl+L\\0\"\\\n  \"Predhodna stran\\0\"\\\n  \"Natisni\\0\"\\\n  \"Natisni razpon\\0\"\\\n  \"Tiskalnik z navedenim imenom ne obstaja\\0\"\\\n  \"Tiskanje v teku.\\0\"\\\n  \"Tiskanje je \\305\\241e vedno v teku. Prekinem in kon\\304\\215am?\\0\"\\\n  \"Tiskanje je \\305\\241e vedno v teku. Prekinem in za\\304\\215nem znova?\\0\"\\\n  \"Tiskanje strani %d od %d \\342\\200\\246\\0\"\\\n  \"Te\\305\\276ave pri tiskanju.\\0\"\\\n  \"Preime&nuj \\342\\200\\246\\tF2\\0\"\\\n  \"&Zapomni si odprte datoteke\\0\"\\\n  \"Odstrani iz priljubljenih\\0\"\\\n  \"Odstrani stran %s iz priljubljenih\\0\"\\\n  \"Preimenuj v\\0\"\\\n  \"Zasukaj v levo\\tCtrl+Shift+-\\0\"\\\n  \"Zasukaj v desno\\tCtrl+Shift++\\0\"\\\n  \"Shrani kot \\342\\200\\246\\0\"\\\n  \"S&hrani bli\\305\\276njico \\342\\200\\246\\tCtrl+Shift+S\\0\"\\\n  \"Preiskovanje strani %d od %d \\342\\200\\246\\0\"\\\n  \"Izberi vse\\0\"\\\n  \"Izberi vse\\tCtrl+A\\0\"\\\n  \"Izberite vsebino s pritisnjeno tipko Ctrl in levim gumbom mi\\305\\241ke\\0\"\\\n  \"Izbor:\\0\"\\\n  \"Po\\305\\241lji po &E-po\\305\\241ti \\342\\200\\246\\0\"\\\n  \"Nastavi obratno iskanje ukazne vrstice\\0\"\\\n  \"Prika\\305\\276i &zaznamke\\0\"\\\n  \"&Prika\\305\\276i strani nepretrgano\\0\"\\\n  \"Poka\\305\\276i orodno vrstico\\0\"\\\n  \"Prika\\305\\276i Priljubljene\\0\"\\\n  \"Prika\\305\\276i pogosto brane\\0\"\\\n  \"Poka\\305\\276i podokno z &zaznamki, \\304\\215e so na voljo\\0\"\\\n  \"Enostransko\\0\"\\\n  \"Oprostite, to se ne bi smelo zgoditi!\\n\\nPritisnite 'Prekli\\304\\215i', \\304\\215e \\305\\276elite pomagati pri dolo\\304\\215itvi vzroka za sesutje.\\0\"\\\n  \"Izvorna datoteka %s nima to\\304\\215ke sinhronizacije\\0\"\\\n  \"Zadeva:\\0\"\\\n  \"Mo\\305\\276nosti SumatraPDF\\0\"\\\n  \"Posodobitev SumatraPDF\\0\"\\\n  \"SumatraPDF se je sesul\\0\"\\\n  \"SumatraPDF je va\\305\\241 privzeti bralnik PDF\\0\"\\\n  \"SumatraPDF bi zdaj moral biti va\\305\\241 privzeti bralnik PDF\\0\"\\\n  \"Datoteke sinhronizacije ni mogo\\304\\215e odpreti\\0\"\\\n  \"Ozna\\304\\215en PDF\\0\"\\\n  \"Tekstovni dokumenti\\0\"\\\n  \"Da dokument uporablja nepodprte zna\\304\\215ilnosti (%s) in se morda ne bo nalo\\305\\276il pravilno\\0\"\\\n  \"Naslov:\\0\"\\\n  \"Neznana izvorna datoteka (%s)\\0\"\\\n  \"Uporabljaj &zavihke\\0\"\\\n  \"Pogled\\0\"\\\n  \"Ob&i\\305\\241\\304\\215i doma\\304\\215o stran\\0\"\\\n  \"Opozorilo\\0\"\\\n  \"XPS dokumenti\\0\"\\\n  \"Imate najnovej\\305\\241o razli\\304\\215ico.\\0\"\\\n  \"Imate razli\\304\\215ico %s\\0\"\\\n  \"Pove\\304\\215ava\\0\"\\\n  \"Pove\\304\\215aj\\0\"\\\n  \"Pomanj\\305\\241aj\\0\"\\\n  \"Faktor pove\\304\\215ave\\0\"\\\n  \"[Spremembe zaznane; osve\\305\\276itev poteka] %s\\0\"\\\n  \"kopiranje besedila\\0\"\\\n  \"tiskanje dokumenta\\0\";\n\nconst char * gTranslations_es = \n  \"&Acerca de\\0\"\\\n  \"T&ama\\303\\261o real\\tCtrl+1\\0\"\\\n  \"Opciones &avanzadas...\\0\"\\\n  \"Tod&as las p\\303\\241ginas seleccionadas\\0\"\\\n  \"A&tr\\303\\241s\\tAlt+Izq\\0\"\\\n  \"&Vista de libro\\tCtrl+8\\0\"\\\n  \"&Cerrar\\tCtrl+W\\0\"\\\n  \"&Copiar selecci\\303\\263n\\0\"\\\n  \"&Copiar selecci\\303\\263n\\tCtrl+C\\0\"\\\n  \"&No volver a preguntar\\0\"\\\n  \"&S\\303\\263lo p\\303\\241ginas pares\\0\"\\\n  \"&Caras opuestas\\tCtrl+7\\0\"\\\n  \"&Archivo\\0\"\\\n  \"&Encontrar:\\0\"\\\n  \"Primera p\\303\\241gina\\tInicio\\0\"\\\n  \"&Ajustar p\\303\\241ginas al \\303\\241rea de impresi\\303\\263n\\0\"\\\n  \"&Ir a\\0\"\\\n  \"&Ir a la p\\303\\241gina:\\0\"\\\n  \"A&yuda\\0\"\\\n  \"\\303\\232ltima p\\303\\241gina\\tFin\\0\"\\\n  \"&Aumento:\\0\"\\\n  \"&Manual de instrucciones\\0\"\\\n  \"&Coincidir may\\303\\272sculas y min\\303\\272sculas\\0\"\\\n  \"&P\\303\\241gina siguiente\\t->\\0\"\\\n  \"\\0\"\\\n  \"&No, gracias\\0\"\\\n  \"&S\\303\\263lo p\\303\\241ginas impares\\0\"\\\n  \"&Abrir documento\\0\"\\\n  \"&Abrir...\\tCtrl+O\\0\"\\\n  \"&Opciones...\\0\"\\\n  \"&Contrase\\303\\261a:\\0\"\\\n  \"Fi&jar documento\\0\"\\\n  \"P\\303\\241gina anterior\\t<-\\0\"\\\n  \"&Imprimir...\\0\"\\\n  \"&Imprimir...\\tCtrl+P\\0\"\\\n  \"&Imprimir... (protegido)\\0\"\\\n  \"&Recordar la contrase\\303\\261a para este documento\\0\"\\\n  \"&Recordar esta configuraci\\303\\263n para todos los documentos\\0\"\\\n  \"Elimina&r documento\\0\"\\\n  \"&Guardar como...\\0\"\\\n  \"&Guardar como...\\tCtrl+S\\0\"\\\n  \"&Configuraci\\303\\263n\\0\"\\\n  \"&Reducir p\\303\\241ginas hasta llegar al \\303\\241rea imprimible (si es necesario)\\0\"\\\n  \"P\\303\\241gina \\303\\272nica\\tCtrl+6\\0\"\\\n  \"&Ignorar esta versi\\303\\263n\\0\"\\\n  \"&Usar el tama\\303\\261o original de la p\\303\\241gina\\0\"\\\n  \"&Ver\\0\"\\\n  \"V&entana\\0\"\\\n  \"&S\\303\\255\\0\"\\\n  \"\\0\"\\\n  \"(de %d)\\0\"\\\n  \"(p\\303\\241gina %s)\\0\"\\\n  \"Acerca de SumatraPDF\\0\"\\\n  \"A\\303\\261adir favorito\\0\"\\\n  \"A\\303\\261adir p\\303\\241gina %s a favoritos\\0\"\\\n  \"A\\303\\261adir p\\303\\241gina %s a favoritos con nombre (opcional):\\0\"\\\n  \"A\\303\\261adir a favoritos\\0\"\\\n  \"Avanzado\\0\"\\\n  \"Todos los archivos\\0\"\\\n  \"Todos los documentos compatibles\\0\"\\\n  \"Aplicaci\\303\\263n:\\0\"\\\n  \"\\302\\277Asociar con archivos PDF?\\0\"\\\n  \"Adjunto: %s\\0\"\\\n  \"Autor:\\0\"\\\n  \"Autom\\303\\241tico\\0\"\\\n  \"B&uscar actualizaciones autom\\303\\241ticamente\\0\"\\\n  \"Vista de libro\\0\"\\\n  \"&Marcadores\\tF12\\0\"\\\n  \"Marcar atajos\\0\"\\\n  \"Marcar atajo a la p\\303\\241gina %s de %s\\0\"\\\n  \"Marcadores\\0\"\\\n  \"\\0\"\\\n  \"Documentos CHM\\0\"\\\n  \"No se puede conectar a Internet (error %#x).\\0\"\\\n  \"Cancelar\\0\"\\\n  \"No se puede imprimir este archivo\\0\"\\\n  \"No se puede iniciar la orden de b\\303\\272squeda inversa. Compruebe la l\\303\\255nea de \\303\\263rdenes en la configuraci\\303\\263n.\\0\"\\\n  \"Cambiar idioma (Change Language)\\0\"\\\n  \"&Buscar actualizaciones\\0\"\\\n  \"C\\303\\263mics\\0\"\\\n  \"Compatibilidad\\0\"\\\n  \"Continua\\0\"\\\n  \"Vista continua de libro\\0\"\\\n  \"P\\303\\241gina doble continua\\0\"\\\n  \"Contribuir con una traducci\\303\\263n\\0\"\\\n  \"Copiar &imagen\\0\"\\\n  \"Copiar direcci\\303\\263n del en&lace\\0\"\\\n  \"Copiar co&mentario\\0\"\\\n  \"No se permite copiar como texto (copiando como imagen)\\0\"\\\n  \"Derechos de autor:\\0\"\\\n  \"No se pudieron obtener las propiedades de la impresora\\0\"\\\n  \"No se pudo inicializar la impresora\\0\"\\\n  \"No se pudo cargar la visualizaci\\303\\263n de la p\\303\\241gina\\0\"\\\n  \"Creado:\\0\"\\\n  \"Archivo actual\\0\"\\\n  \"Posici\\303\\263n del cursor:\\0\"\\\n  \"&Zoom personalizado...\\tCtrl+Y\\0\"\\\n  \"Apariencia pre&determinada:\\0\"\\\n  \"Am&pliaci\\303\\263n predeterminada:\\0\"\\\n  \"No se puede cambiar el lector PDF predeterminado en el modo port\\303\\241til\\0\"\\\n  \"Permisos denegados:\\0\"\\\n  \"Documentos DjVu\\0\"\\\n  \"Propiedades del documento\\0\"\\\n  \"Descargar\\0\"\\\n  \"&Salir\\tCtrl+Q\\0\"\\\n  \"Libros electr\\303\\263nicos en EPUB\\0\"\\\n  \"Escriba la contrase\\303\\261a\\0\"\\\n  \"Introduzca contrase\\303\\261a para %s\\0\"\\\n  \"Introduzca los par\\303\\241metros de l\\303\\255nea de comandos que se ejecutar\\303\\241n al hacer doble-clic en el documento PDF:\\0\"\\\n  \"Error al cargar %s\\0\"\\\n  \"&Favoritos\\0\"\\\n  \"Adelante\\tAlt+Der\\0\"\\\n  \"Pantalla completa\\tCtrl+May\\303\\272s+L\\0\"\\\n  \"P\\303\\241gina doble\\0\"\\\n  \"No se pudo renombrar el archivo.\\0\"\\\n  \"Error al guardar un archivo\\0\"\\\n  \"Visualizaci\\303\\263n r\\303\\241pida en Web\\0\"\\\n  \"Favoritos\\0\"\\\n  \"Documentos FictionBook\\0\"\\\n  \"No se encontr\\303\\263 el archivo %s\\0\"\\\n  \"Tama\\303\\261o de archivo:\\0\"\\\n  \"Archivo:\\0\"\\\n  \"Buscar...\\tCtrl+F\\0\"\\\n  \"Buscar\\0\"\\\n  \"Buscar siguiente\\0\"\\\n  \"Buscar anterior\\0\"\\\n  \"Buscar:\\0\"\\\n  \"Ajustar a &contenido\\tCtrl+3\\0\"\\\n  \"Ajustar a &p\\303\\241gina\\tCtrl+0\\0\"\\\n  \"Ajustar a a&nchura\\tCtrl+2\\0\"\\\n  \"Ajustar a contenido\\0\"\\\n  \"Ajustar a p\\303\\241gina\\0\"\\\n  \"Ajustar a ancho de p\\303\\241gina\\0\"\\\n  \"Ajustar al ancho de p\\303\\241gina y mostrar las p\\303\\241ginas de forma continua\\0\"\\\n  \"Ajustar a una sola p\\303\\241gina\\0\"\\\n  \"Fuentes:\\0\"\\\n  \"Dando formato al libro... %d p\\303\\241ginas\\0\"\\\n  \"Se encontr\\303\\263 el texto en la p\\303\\241gina %s\\0\"\\\n  \"Se encontr\\303\\263 el texto en la p\\303\\241gina %s (de nuevo)\\0\"\\\n  \"Lo m\\303\\241s le\\303\\255do\\0\"\\\n  \"\\0\"\\\n  \"Ir a la p\\303\\241gina\\0\"\\\n  \"Ocultar \\\"lo m\\303\\241s le\\303\\255do\\\"\\0\"\\\n  \"Consejo: Presione F3 para mostrar el siguiente resultado\\0\"\\\n  \"Archivos de imagen (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"\\302\\277Convertir SumatraPDF en la aplicaci\\303\\263n predeterminada para archivos PDF?\\0\"\\\n  \"Convertir SumatraPDF el lector PDF predeterminado\\0\"\\\n  \"Modo man&ga\\0\"\\\n  \"Coincidir may\\303\\272sculas y min\\303\\272sculas\\0\"\\\n  \"Documentos en formato Mobi\\0\"\\\n  \"Modificado:\\0\"\\\n  \"Est\\303\\241 disponible la nueva versi\\303\\263n %s. \\302\\277Desea descargarla?\\0\"\\\n  \"P\\303\\241gina siguiente\\0\"\\\n  \"No se encontraron coincidencias\\0\"\\\n  \"No se encontr\\303\\263 resultado cerca de la l\\303\\255nea %u en el archivo %s\\0\"\\\n  \"No se encontr\\303\\263 archivo de sincronizaci\\303\\263n\\0\"\\\n  \"No hay informaci\\303\\263n de sincronizaci\\303\\263n en esta posici\\303\\263n\\0\"\\\n  \"N\\303\\272mero de p\\303\\241ginas:\\0\"\\\n  \"Aceptar\\0\"\\\n  \"Abrir\\0\"\\\n  \"Abr&ir con PDF-XChange\\0\"\\\n  \"Abrir un documento...\\0\"\\\n  \"Abrir con %s\\0\"\\\n  \"Abrir con &Adobe Reader\\0\"\\\n  \"Abrir con &Foxit Reader\\0\"\\\n  \"Abrir con &Microsoft HTML Help\\0\"\\\n  \"Abrir con el Visor XPS de &Microsoft\\0\"\\\n  \"P&ropiedades\\0\"\\\n  \"P&ropiedades...\\tCtrl+D\\0\"\\\n  \"Documento PDF\\0\"\\\n  \"Optimizaciones de PDF:\\0\"\\\n  \"Generador de PDF:\\0\"\\\n  \"Versi\\303\\263n de PDF:\\0\"\\\n  \"Documentos PDF\\0\"\\\n  \"P\\303\\241&gina...\\tCtrl+G\\0\"\\\n  \"P\\303\\241gina %s\\0\"\\\n  \"Tama\\303\\261o de p\\303\\241gina:\\0\"\\\n  \"La p\\303\\241gina %u no existe\\0\"\\\n  \"Escalado de p\\303\\241gina\\0\"\\\n  \"P\\303\\241gina:\\0\"\\\n  \"Documentos PalmDoc\\0\"\\\n  \"Espere un momento mientras se carga la visualizaci\\303\\263n...\\0\"\\\n  \"Documentos Postscript\\0\"\\\n  \"Pr&esentaci\\303\\263n\\tCtrl+L\\0\"\\\n  \"P\\303\\241gina anterior\\0\"\\\n  \"Imprimir\\0\"\\\n  \"Rango de impresi\\303\\263n\\0\"\\\n  \"La impresora con el nombre especificado no existe\\0\"\\\n  \"Impresi\\303\\263n en progreso.\\0\"\\\n  \"Impresi\\303\\263n a\\303\\272n en progreso. \\302\\277Cancelar y salir?\\0\"\\\n  \"La impresi\\303\\263n est\\303\\241 en progreso. \\302\\277Quiere interrumpirla e iniciar de nuevo?\\0\"\\\n  \"Imprimiendo p\\303\\241gina %d de %d...\\0\"\\\n  \"Problema de impresi\\303\\263n.\\0\"\\\n  \"Re&nombrar...\\tF2\\0\"\\\n  \"Recordar archiv&os abiertos\\0\"\\\n  \"Eliminar de favoritos\\0\"\\\n  \"Eliminar p\\303\\241gina %s de favoritos\\0\"\\\n  \"Renombrando a...\\0\"\\\n  \"Girar a la izquierda\\tCtrl+May\\303\\272s+-\\0\"\\\n  \"Girar a la derecha\\tCtrl+May\\303\\272s++\\0\"\\\n  \"Guardar como\\0\"\\\n  \"Guardar A&cceso directo...\\tCtrl+May\\303\\272s+S\\0\"\\\n  \"Buscando %d de %d...\\0\"\\\n  \"Seleccionar &todo\\0\"\\\n  \"Seleccionar &todo\\tCtrl+A\\0\"\\\n  \"Seleccionar con Ctrl+Bot\\303\\263n. Izq. del rat\\303\\263n\\0\"\\\n  \"Selecci\\303\\263n:\\0\"\\\n  \"Enviar por correo &electr\\303\\263nico\\0\"\\\n  \"Establecer orden de consola para b\\303\\272squeda inversa\\0\"\\\n  \"Mostrar &marcadores\\0\"\\\n  \"Mostrar &p\\303\\241ginas de forma continua\\0\"\\\n  \"Mostrar barra de &herramientas\\0\"\\\n  \"Mostrar favoritos\\0\"\\\n  \"Mostrar \\302\\253lo m\\303\\241s le\\303\\255do\\302\\273\\0\"\\\n  \"Mostrar la barra de &marcadores cuando est\\303\\251 disponible\\0\"\\\n  \"P\\303\\241gina \\303\\272nica\\0\"\\\n  \"Lo sentimos, esto no deber\\303\\255a haber sucedido...\\n\\nPresione \\302\\253cancelar\\302\\273 si quiere ayudarnos a arreglar la causa del fallo.\\0\"\\\n  \"El archivo de origen %s no posee un punto de sincronizaci\\303\\263n\\0\"\\\n  \"Asunto:\\0\"\\\n  \"Opciones de SumatraPDF\\0\"\\\n  \"Actualizar SumatraPDF\\0\"\\\n  \"SumatraPDF se ha reiniciado debido a un fallo\\0\"\\\n  \"SumatraPDF es el lector PDF predeterminado\\0\"\\\n  \"A partir de ahora SumatraPDF ser\\303\\241 el lector PDF predeterminado\\0\"\\\n  \"No se pudo abrir el archivo de sincronizaci\\303\\263n\\0\"\\\n  \"PDF etiquetado\\0\"\\\n  \"Documentos de texto\\0\"\\\n  \"Este documento utiliza funcionalidades no admitidas (%s) y podr\\303\\255a no mostrarse adecuadamente\\0\"\\\n  \"T\\303\\255tulo:\\0\"\\\n  \"Archivo de origen desconocido (%s)\\0\"\\\n  \"Usar &pesta\\303\\261as\\0\"\\\n  \"Visualizaci\\303\\263n\\0\"\\\n  \"Visitar sitio &Web\\0\"\\\n  \"Advertencia\\0\"\\\n  \"Documentos XPS\\0\"\\\n  \"Esta es la \\303\\272ltima versi\\303\\263n disponible.\\0\"\\\n  \"La versi\\303\\263n actual es: %s\\0\"\\\n  \"Ampliar\\0\"\\\n  \"Acercar\\0\"\\\n  \"Alejar\\0\"\\\n  \"Proporci\\303\\263n de escala\\0\"\\\n  \"[Cambios detectados; actualizando] %s\\0\"\\\n  \"copiado de texto\\0\"\\\n  \"imprimiendo documento\\0\";\n\nconst char * gTranslations_sv = \n  \"&Om\\0\"\\\n  \"&Verklig storlek\\tCtrl+1\\0\"\\\n  \"&Avancerade Inst\\303\\244llningar\\0\"\\\n  \"&Alla valda sidor\\0\"\\\n  \"Tillbaka\\tAlt+Pil v\\303\\244nster\\0\"\\\n  \"&Bokvy\\tCtrl+8\\0\"\\\n  \"&St\\303\\244ng\\tCtrl+W\\0\"\\\n  \"&Kopiera markering\\0\"\\\n  \"Kopiera markering\\tCtrl+C\\0\"\\\n  \"Fr\\303\\245ga inte igen\\0\"\\\n  \"Endast &j\\303\\244mna sidor\\0\"\\\n  \"&Sida vid sida\\tCtrl+7\\0\"\\\n  \"&Arkiv\\0\"\\\n  \"&S\\303\\266k efter:\\0\"\\\n  \"F\\303\\266rsta sidan\\tHome\\0\"\\\n  \"Anpassa sidor till utskrivbart &omr\\303\\245de\\0\"\\\n  \"&G\\303\\245 till\\0\"\\\n  \"&G\\303\\245 till sida:\\0\"\\\n  \"&Hj\\303\\244lp\\0\"\\\n  \"Sista sidan\\tEnd\\0\"\\\n  \"&F\\303\\266rstoring:\\0\"\\\n  \"\\0\"\\\n  \"Matcha &versaler/gemener\\0\"\\\n  \"N\\303\\244sta sida\\t->\\0\"\\\n  \"&Nej\\0\"\\\n  \"&Nej, tack\\0\"\\\n  \"Endast &udda sidor\\0\"\\\n  \"&\\303\\226ppna dokument\\0\"\\\n  \"&\\303\\226ppna...\\tCtrl+O\\0\"\\\n  \"Alternativ...\\0\"\\\n  \"&L\\303\\266senord:\\0\"\\\n  \"&F\\303\\244st dokument\\0\"\\\n  \"F\\303\\266reg\\303\\245ende sida\\t<-\\0\"\\\n  \"&Skriv ut...\\0\"\\\n  \"Skriv &ut...\\tCtrl+P\\0\"\\\n  \"&Utskrift... (nekad)\\0\"\\\n  \"&Minns l\\303\\266senordet f\\303\\266r detta dokument\\0\"\\\n  \"Kom ih\\303\\245g dessa inst\\303\\244llningar f\\303\\266r &varje dokument\\0\"\\\n  \"&Ta bort dokument\\0\"\\\n  \"&Spara som...\\0\"\\\n  \"Spara so&m...\\tCtrl+S\\0\"\\\n  \"Alternati&v\\0\"\\\n  \"&Krymp sidor (om n\\303\\266dv\\303\\244ndigt) s\\303\\245 de ryms\\0\"\\\n  \"&Enkel sida\\tCtrl+6\\0\"\\\n  \"Hoppa \\303\\266ver denna version\\0\"\\\n  \"Anv\\303\\244nd u&rsprunglig sidstorlek\\0\"\\\n  \"Vi&sa\\0\"\\\n  \"F\\303\\266nster\\0\"\\\n  \"&Ja\\0\"\\\n  \"\\0\"\\\n  \"(av %d)\\0\"\\\n  \"(sida %s)\\0\"\\\n  \"Om SumatraPDF\\0\"\\\n  \"L\\303\\244gg till favorit\\0\"\\\n  \"L\\303\\244gg till sida %s i favoriter\\0\"\\\n  \"L\\303\\244gg till sida %s i favoriter med (valfritt) namn:\\0\"\\\n  \"L\\303\\244gg till i favoriter\\0\"\\\n  \"Avancerat\\0\"\\\n  \"Alla filer\\0\"\\\n  \"Alla dokument som st\\303\\266ds\\0\"\\\n  \"Programvara:\\0\"\\\n  \"Koppla ihop med PDF-filer?\\0\"\\\n  \"Bilagor: %s\\0\"\\\n  \"F\\303\\266rfattare:\\0\"\\\n  \"Automatiskt\\0\"\\\n  \"S\\303\\266k &automatisk efter uppdateringar\\0\"\\\n  \"Bokuppslag\\0\"\\\n  \"Bokm\\303\\244rken\\tF12\\0\"\\\n  \"Bokm\\303\\244rkesgenv\\303\\244gar\\0\"\\\n  \"Bokm\\303\\244rk genv\\303\\244g till sida %s av %s\\0\"\\\n  \"Bokm\\303\\244rken\\0\"\\\n  \"Byte\\0\"\\\n  \"CHM-dokument\\0\"\\\n  \"Kan ej ansluta till Internet (fel %#x).\\0\"\\\n  \"Avbryt\\0\"\\\n  \"Kan ej skriva ut denna fil\\0\"\\\n  \"Kan ej starta omv\\303\\244nd s\\303\\266kning. Kontrollera inst\\303\\244llningarna f\\303\\266r kommandoraden.\\0\"\\\n  \"Byt spr\\303\\245k (Change Language)\\0\"\\\n  \"&S\\303\\266k efter ny version\\0\"\\\n  \"Serier\\0\"\\\n  \"Kompatibilitet\\0\"\\\n  \"Fortl\\303\\266pande\\0\"\\\n  \"Fortl\\303\\266pande bokuppslag\\0\"\\\n  \"Fortl\\303\\266pande uppslag\\0\"\\\n  \"Bidra med \\303\\266vers\\303\\244ttning\\0\"\\\n  \"Kop&iera bild\\0\"\\\n  \"Kopiera l\\303\\244nkadress\\0\"\\\n  \"Kopiera kommentar\\0\"\\\n  \"Textkopiering till\\303\\244ts ej (kopierar som bild)\\0\"\\\n  \"\\0\"\\\n  \"Kunde inte h\\303\\244mta egenskaper f\\303\\266r skrivare\\0\"\\\n  \"Kunde ej anv\\303\\244nda skrivare\\0\"\\\n  \"Kunde ej visa sidan\\0\"\\\n  \"Skapad:\\0\"\\\n  \"Aktuell fil\\0\"\\\n  \"Muspekarens position:\\0\"\\\n  \"&Anpassad zoom...\\tCtrl+Y\\0\"\\\n  \"F\\303\\266rvalt &utseende\\0\"\\\n  \"F\\303\\266rvalt &zooml\\303\\244ge\\0\"\\\n  \"SumatraPDF kan ej g\\303\\266ras f\\303\\266rvald i portabelt l\\303\\244ge\\0\"\\\n  \"Saknade Tillst\\303\\245nd:\\0\"\\\n  \"DjVu-dokument\\0\"\\\n  \"Dokumentegenskaper\\0\"\\\n  \"Ladda &ned\\0\"\\\n  \"&Avsluta\\tCtrl+Q\\0\"\\\n  \"EPUB-dokument\\0\"\\\n  \"Ange l\\303\\266senord\\0\"\\\n  \"Ange l\\303\\266senord f\\303\\266r %s\\0\"\\\n  \"Ange kommandorad att aktivera n\\303\\244r du dubbelklickar p\\303\\245 PDF-dokumentet:\\0\"\\\n  \"Fel vid \\303\\266ppning av %s\\0\"\\\n  \"&Favoriter\\0\"\\\n  \"Fram\\303\\245t\\tAlt+Pil h\\303\\266ger\\0\"\\\n  \"Fullsk\\303\\244rm\\tCtrl+Shift+L\\0\"\\\n  \"Uppslag\\0\"\\\n  \"Kunde inte d\\303\\266pa om filen!\\0\"\\\n  \"Kan inte spara filen.\\0\"\\\n  \"Snabb Webb-Visning\\0\"\\\n  \"Favoriter\\0\"\\\n  \"FictionBook dokument\\0\"\\\n  \"Fil %s hittades inte\\0\"\\\n  \"Filstorlek:\\0\"\\\n  \"Fil:\\0\"\\\n  \"S\\303\\266k...\\tCtrl+F\\0\"\\\n  \"S\\303\\266k\\0\"\\\n  \"S\\303\\266k n\\303\\244sta\\0\"\\\n  \"S\\303\\266k f\\303\\266reg\\303\\245ende\\0\"\\\n  \"S\\303\\266k:\\0\"\\\n  \"Passa &inneh\\303\\245ll\\tCtrl+3\\0\"\\\n  \"Anpassa efter &helsida\\tCtrl+0\\0\"\\\n  \"Anpassa efter &bredd\\tCtrl+2\\0\"\\\n  \"Passa inneh\\303\\245ll\\0\"\\\n  \"Anpassa efter helsida\\0\"\\\n  \"Anpassa efter bredd\\0\"\\\n  \"Anpassa bredd och visa sidor fortl\\303\\266pande\\0\"\\\n  \"Anpassa till helsida\\0\"\\\n  \"Typsnitt:\\0\"\\\n  \"Formatterar bok... %d sidor\\0\"\\\n  \"Hittade text p\\303\\245 sidan %s\\0\"\\\n  \"Hittade text p\\303\\245 sida %s (igen)\\0\"\\\n  \"Mest l\\303\\244sta\\0\"\\\n  \"\\0\"\\\n  \"G\\303\\245 till sida\\0\"\\\n  \"D\\303\\266lj mest l\\303\\244sta\\0\"\\\n  \"Tips: Tryck F3 f\\303\\266r att s\\303\\266ka vidare\\0\"\\\n  \"Bildfiler (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"St\\303\\244lla in SumatraPDF som standardprogram f\\303\\266r PDF-filer?\\0\"\\\n  \"Anv\\303\\244nd SumatraPDF som standardl\\303\\244sare f\\303\\266r PDF\\0\"\\\n  \"Man&ga L\\303\\244ge\\0\"\\\n  \"Matcha versaler/gemener\\0\"\\\n  \"Mobi-dokument\\0\"\\\n  \"\\303\\204ndrad:\\0\"\\\n  \"Nyare version %s tillg\\303\\244nglig. Ladda ner den?\\0\"\\\n  \"N\\303\\244sta sida\\0\"\\\n  \"Inga tr\\303\\244ffar hittades\\0\"\\\n  \"Inget resultat hittades vid rad %u i filen %s\\0\"\\\n  \"Ingen synkroniseringsfil hittad\\0\"\\\n  \"Synkroniseringsinformation saknas h\\303\\244r\\0\"\\\n  \"Antal sidor:\\0\"\\\n  \"\\0\"\\\n  \"\\303\\226ppna\\0\"\\\n  \"\\303\\226ppna i PDF-XChange\\0\"\\\n  \"\\303\\226ppna ett dokument...\\0\"\\\n  \"\\303\\226ppna med %s\\0\"\\\n  \"\\303\\226ppna i Adobe &Reader\\0\"\\\n  \"\\303\\226ppna i Foxit Reader\\0\"\\\n  \"\\303\\226ppna i Microsoft HTML Help\\0\"\\\n  \"\\303\\226ppna i Microsoft XPS-Viewer\\0\"\\\n  \"E&genskaper\\0\"\\\n  \"&Egenskaper...\\tCtrl+D\\0\"\\\n  \"PDF-dokument\\0\"\\\n  \"PDF Optimeringar:\\0\"\\\n  \"PDF-programvara:\\0\"\\\n  \"PDF-version:\\0\"\\\n  \"PDF-dokument\\0\"\\\n  \"Sida...\\tCtrl+G\\0\"\\\n  \"Sida %s\\0\"\\\n  \"Sidstorlek:\\0\"\\\n  \"Sidnummer %u finns ej\\0\"\\\n  \"Skala om vid utskrift\\0\"\\\n  \"Sida:\\0\"\\\n  \"PalmDoc dokument\\0\"\\\n  \"Ett \\303\\266gonblick - f\\303\\266rbereder...\\0\"\\\n  \"Postscript-dokument\\0\"\\\n  \"Pr&esentation\\tCtrl+L\\0\"\\\n  \"F\\303\\266reg\\303\\245ende sida\\0\"\\\n  \"Skriv ut\\0\"\\\n  \"Skriv ut urval\\0\"\\\n  \"Det finns ingen skrivade med angivet namn\\0\"\\\n  \"Utskrift p\\303\\245g\\303\\245r.\\0\"\\\n  \"Utskrift p\\303\\245g\\303\\245r fortfarande. Avbryt och avsluta?\\0\"\\\n  \"Utskriften p\\303\\245g\\303\\245r fortfarande. Avbryt och b\\303\\266rja om?\\0\"\\\n  \"Skriver ut sida %d av %d...\\0\"\\\n  \"Utskriftsproblem.\\0\"\\\n  \"D\\303\\266p om\\0\"\\\n  \"Kom ih\\303\\245g \\303\\266ppnade &filer\\0\"\\\n  \"Ta bort fr\\303\\245n favoriter\\0\"\\\n  \"Ta bort sida %s fr\\303\\245n favoriter\\0\"\\\n  \"D\\303\\266p om till\\0\"\\\n  \"Rotera \\303\\245t v\\303\\244nster\\tCtrl+Shift+-\\0\"\\\n  \"Rotera \\303\\245t h\\303\\266ger\\tCtrl+Shift++\\0\"\\\n  \"Spara som\\0\"\\\n  \"Spara g&env\\303\\244g...\\tCtrl+Shift+S\\0\"\\\n  \"S\\303\\266ker %d av %d...\\0\"\\\n  \"Markera &alla\\0\"\\\n  \"V\\303\\244lj &Allt\\tCtrl+A\\0\"\\\n  \"Markera med Ctrl + v\\303\\244nster musknapp\\0\"\\\n  \"Markering:\\0\"\\\n  \"S&kicka som epost...\\0\"\\\n  \"S\\303\\244tt motsatt s\\303\\266k-kommandorad\\0\"\\\n  \"Visa &Bokm\\303\\244rken\\0\"\\\n  \"Visa sidor fortl\\303\\266pande\\0\"\\\n  \"Visa verktygsf\\303\\244lt\\0\"\\\n  \"Visa favoriter\\0\"\\\n  \"Visa mest l\\303\\244sta\\0\"\\\n  \"Visa &bokm\\303\\244rken n\\303\\244r de finns\\0\"\\\n  \"Enkel sida\\0\"\\\n  \"Ledsen, det d\\303\\244r borde inte ha h\\303\\244nt!\\n\\nVar god tryck 'Avbryt', om du vill hj\\303\\244lpa oss att korrigera orsaken till denna krash.\\0\"\\\n  \"K\\303\\244llfilen %s har ingen synkroniseringspunkt\\0\"\\\n  \"\\303\\204mne:\\0\"\\\n  \"SumatraPDF Inst\\303\\244llningar\\0\"\\\n  \"SumatraPDF Uppdatering\\0\"\\\n  \"SumatraPDF avslutades ov\\303\\244ntat\\0\"\\\n  \"SumatraPDF \\303\\244r din valda PDF-l\\303\\244sare\\0\"\\\n  \"SumatraPDF ska nu vara din valda PDF-l\\303\\244sare\\0\"\\\n  \"Synkroniseringsfil kan ej \\303\\266ppnas\\0\"\\\n  \"Taggad PDF\\0\"\\\n  \"Text-dokument\\0\"\\\n  \"Detta dokument anv\\303\\244nder funktioner som inte st\\303\\266ds (%s) och kan inte \\303\\245terges korrekt\\0\"\\\n  \"Titel:\\0\"\\\n  \"Ok\\303\\244nd k\\303\\244llfil (%s)\\0\"\\\n  \"Anv\\303\\244nd flikar\\0\"\\\n  \"Visa\\0\"\\\n  \"Bes\\303\\266k webbplats\\0\"\\\n  \"Varning\\0\"\\\n  \"XPS-dokument\\0\"\\\n  \"Du har den senaste versionen.\\0\"\\\n  \"Du har version %s\\0\"\\\n  \"\\0\"\\\n  \"Zooma in\\0\"\\\n  \"Zooma ut\\0\"\\\n  \"Zoomfaktor\\0\"\\\n  \"[\\303\\204ndringar detekterade; uppdaterar] %s\\0\"\\\n  \"kopierar text\\0\"\\\n  \"skriver ut dokument\\0\";\n\nconst char * gTranslations_ta = \n  \"\\340\\256\\252\\340\\256\\261\\340\\257\\215\\340\\256\\261\\340\\256\\277\\0\"\\\n  \"\\340\\256\\256\\340\\257\\206\\340\\256\\257\\340\\257\\215 \\340\\256\\205\\340\\256\\263\\340\\256\\265\\340\\257\\201\\tCtrl+1\\0\"\\\n  \"&\\340\\256\\256\\340\\257\\207\\340\\256\\256\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\215\\340\\256\\237 \\340\\256\\265\\340\\256\\277\\340\\256\\260\\340\\257\\201\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\257\\215\\0\"\\\n  \"\\340\\256\\216\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\256\\276 \\340\\256\\244\\340\\257\\207\\340\\256\\260\\340\\257\\215\\340\\256\\250\\340\\257\\215\\340\\256\\244\\340\\257\\206\\340\\256\\237\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244 \\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\257\\201\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"\\340\\256\\252\\340\\256\\277\\340\\256\\251\\340\\257\\215\\tAlt+Left Arrow\\0\"\\\n  \"&\\340\\256\\252\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\225 \\340\\256\\244\\340\\257\\213\\340\\256\\261\\340\\257\\215\\340\\256\\261\\340\\256\\256\\340\\257\\215\\tCtrl+8\\0\"\\\n  \"\\340\\256\\256\\340\\257\\202\\340\\256\\237\\340\\257\\201\\tCtrl+W\\0\"\\\n  \"\\340\\256\\244\\340\\257\\207\\340\\256\\260\\340\\257\\215\\340\\256\\250\\340\\257\\215\\340\\256\\244\\340\\257\\206\\340\\256\\237\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\265\\340\\256\\261\\340\\257\\215\\340\\256\\261\\340\\257\\210 \\340\\256\\250\\340\\256\\225\\340\\256\\262\\340\\257\\206\\340\\256\\237\\340\\257\\201\\0\"\\\n  \"\\340\\256\\244\\340\\257\\207\\340\\256\\260\\340\\257\\215\\340\\256\\265\\340\\257\\201\\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\257\\215\\340\\256\\244\\340\\256\\244\\340\\257\\210 \\340\\256\\250\\340\\256\\225\\340\\256\\262\\340\\257\\215 \\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\257\\215\\0\"\\\n  \"\\340\\256\\256\\340\\256\\260\\340\\257\\201 \\340\\256\\252\\340\\256\\237\\340\\256\\277\\340\\256\\257\\340\\257\\201\\340\\256\\256\\340\\257\\215 \\340\\256\\225\\340\\257\\207\\340\\256\\237\\340\\257\\215\\340\\256\\225\\340\\256\\276\\340\\256\\244\\340\\257\\207\\0\"\\\n  \"\\340\\256\\207\\340\\256\\260\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\210\\340\\256\\252\\340\\256\\237\\340\\257\\210 \\340\\256\\216\\340\\256\\243\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\257\\215  \\340\\256\\256\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"\\340\\256\\252\\340\\256\\276\\340\\256\\260\\340\\257\\215\\340\\256\\265\\340\\257\\210\\340\\256\\257\\340\\256\\277\\340\\256\\262\\340\\257\\215\\tCtrl+7\\0\"\\\n  \"\\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\0\"\\\n  \"\\340\\256\\216\\340\\256\\244\\340\\257\\210 \\340\\256\\244\\340\\257\\207\\340\\256\\237\\340\\256\\265\\340\\257\\201\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"\\340\\256\\256\\340\\257\\201\\340\\256\\244\\340\\256\\262\\340\\257\\215 \\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215\\tHome\\0\"\\\n  \"\\340\\256\\205\\340\\256\\232\\340\\257\\215\\340\\256\\232\\340\\256\\277\\340\\256\\237\\340\\257\\201\\340\\256\\256\\340\\257\\215 \\340\\256\\205\\340\\256\\263\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215 \\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\257\\210 \\340\\256\\225\\340\\256\\276\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201\\0\"\\\n  \"\\340\\256\\205\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\257\\201 \\340\\256\\232\\340\\257\\206\\340\\256\\262\\340\\257\\215\\0\"\\\n  \"\\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\244\\340\\256\\277\\340\\256\\260\\340\\257\\215\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201 \\340\\256\\232\\340\\257\\206\\340\\256\\262\\340\\257\\215:\\0\"\\\n  \"\\340\\256\\211\\340\\256\\244\\340\\256\\265\\340\\256\\277\\0\"\\\n  \"\\340\\256\\207\\340\\256\\261\\340\\257\\201\\340\\256\\244\\340\\256\\277 \\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215\\tEnd\\0\"\\\n  \"\\340\\256\\252\\340\\257\\206\\340\\256\\260\\340\\256\\277\\340\\256\\244\\340\\256\\276\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"\\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\257\\215\\340\\256\\256\\340\\257\\201\\340\\256\\261\\340\\257\\210 \\340\\256\\217\\340\\256\\237\\340\\257\\201\\0\"\\\n  \"\\340\\256\\244\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201\\340\\256\\252\\340\\257\\215 \\340\\256\\252\\340\\257\\212\\340\\256\\260\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"\\340\\256\\205\\340\\256\\237\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244 \\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215\\t->\\0\"\\\n  \"\\340\\256\\207\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\340\\256\\207\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210, \\340\\256\\250\\340\\256\\251\\340\\257\\215\\340\\256\\261\\340\\256\\277\\0\"\\\n  \"\\340\\256\\222\\340\\256\\261\\340\\257\\215\\340\\256\\261\\340\\257\\210\\340\\256\\252\\340\\256\\237\\340\\257\\210 \\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\257\\215 \\340\\256\\256\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"\\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\210 \\340\\256\\244\\340\\256\\277\\340\\256\\261\\0\"\\\n  \"\\340\\256\\244\\340\\256\\277\\340\\256\\261...\\tCtrl+O\\0\"\\\n  \"\\340\\256\\265\\340\\256\\277\\340\\256\\260\\340\\257\\201\\340\\256\\252\\340\\257\\215\\340\\256\\252 \\340\\256\\252\\340\\257\\207\\340\\256\\260\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"\\340\\256\\225\\340\\256\\237\\340\\256\\265\\340\\257\\201\\340\\256\\232\\340\\257\\215\\340\\256\\232\\340\\257\\212\\340\\256\\262\\340\\257\\215\\0\"\\\n  \"\\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\210 \\340\\256\\225\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\277\\340\\256\\265\\340\\257\\210\\0\"\\\n  \"\\340\\256\\256\\340\\257\\201\\340\\256\\250\\340\\257\\215\\340\\256\\244\\340\\257\\210\\340\\256\\257 \\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215\\tLeft Arrow\\0\"\\\n  \"\\340\\256\\205\\340\\256\\232\\340\\257\\215\\340\\256\\232\\340\\256\\277\\340\\256\\237\\340\\257\\201...\\0\"\\\n  \"\\340\\256\\205\\340\\256\\232\\340\\257\\215\\340\\256\\232\\340\\256\\277\\340\\256\\237\\340\\257\\201...\\tCtrl+P\\0\"\\\n  \"\\340\\256\\205\\340\\256\\225\\340\\256\\232\\340\\256\\277\\340\\256\\237\\340\\256\\262\\340\\257\\215... (\\340\\256\\250\\340\\256\\277\\340\\256\\260\\340\\256\\276\\340\\256\\225\\340\\256\\260\\340\\256\\277\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\256\\244\\340\\257\\201)\\0\"\\\n  \"\\340\\256\\225\\340\\256\\237\\340\\256\\265\\340\\257\\201\\340\\256\\232\\340\\257\\215\\340\\256\\232\\340\\257\\212\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210 \\340\\256\\250\\340\\256\\277\\340\\256\\251\\340\\257\\210\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215 \\340\\256\\265\\340\\257\\210\\0\"\\\n  \"\\340\\256\\205\\340\\256\\256\\340\\257\\210\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\225\\340\\256\\263\\340\\257\\210 \\340\\256\\236\\340\\256\\276\\340\\256\\252\\340\\256\\225\\340\\256\\256\\340\\257\\215 \\340\\256\\225\\340\\257\\212\\340\\256\\263\\340\\257\\215\\0\"\\\n  \"\\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\210 \\340\\256\\250\\340\\257\\200\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201\\0\"\\\n  \"\\340\\256\\216\\340\\256\\251\\340\\256\\232\\340\\257\\215 \\340\\256\\232\\340\\257\\207\\340\\256\\256\\340\\256\\277...\\0\"\\\n  \"\\340\\256\\216\\340\\256\\251\\340\\256\\232\\340\\257\\215 \\340\\256\\232\\340\\257\\207\\340\\256\\256\\340\\256\\277...\\tCtrl+S\\0\"\\\n  \"\\340\\256\\205\\340\\256\\256\\340\\257\\210\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\225\\340\\256\\263\\340\\257\\215\\0\"\\\n  \"\\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\210 \\340\\256\\205\\340\\256\\232\\340\\257\\215\\340\\256\\232\\340\\256\\277\\340\\256\\237\\340\\257\\201\\340\\256\\256\\340\\257\\215 \\340\\256\\205\\340\\256\\263\\340\\256\\265\\340\\256\\277\\340\\256\\261\\340\\257\\215\\340\\256\\225\\340\\257\\201 \\340\\256\\232\\340\\257\\201\\340\\256\\260\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201 (\\340\\256\\244\\340\\257\\207\\340\\256\\265\\340\\257\\210\\340\\256\\252\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\256\\276\\340\\256\\262\\340\\257\\215)\\0\"\\\n  \"\\340\\256\\222\\340\\256\\261\\340\\257\\215\\340\\256\\261\\340\\257\\210\\340\\256\\252\\340\\257\\215 \\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215\\tCtrl+6\\0\"\\\n  \"\\340\\256\\207\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\244\\340\\256\\277\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\210 \\340\\256\\244\\340\\256\\265\\340\\256\\277\\340\\256\\260\\340\\257\\215\\0\"\\\n  \"\\340\\256\\256\\340\\257\\202\\340\\256\\262 \\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225 \\340\\256\\205\\340\\256\\263\\340\\256\\265\\340\\257\\201\\340\\256\\225\\340\\256\\263\\340\\257\\210 \\340\\256\\211\\340\\256\\252\\340\\256\\257\\340\\257\\213\\340\\256\\225\\340\\256\\277\\0\"\\\n  \"\\340\\256\\250\\340\\257\\213\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201\\0\"\\\n  \"\\0\"\\\n  \"\\340\\256\\206\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"\\340\\256\\252\\340\\257\\206\\340\\256\\260\\340\\256\\277\\340\\256\\244\\340\\256\\276\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201\\0\"\\\n  \"(\\340\\256\\207\\340\\256\\251\\340\\257\\215 %d)\\0\"\\\n  \"(\\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215 %s)\\0\"\\\n  \"\\340\\256\\232\\340\\257\\201\\340\\256\\256\\340\\256\\244\\340\\257\\215\\340\\256\\260\\340\\256\\276PDF \\340\\256\\252\\340\\256\\261\\340\\257\\215\\340\\256\\261\\340\\256\\277\\0\"\\\n  \"\\340\\256\\265\\340\\256\\277\\340\\256\\260\\340\\257\\201\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\225\\340\\256\\263\\340\\256\\277\\340\\256\\262\\340\\257\\215  \\340\\256\\232\\340\\257\\207\\340\\256\\260\\340\\257\\215\\0\"\\\n  \"\\340\\256\\265\\340\\256\\277\\340\\256\\260\\340\\257\\201\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\225\\340\\256\\263\\340\\256\\277\\340\\256\\262\\340\\257\\215  \\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215 %s \\340\\256\\220 \\340\\256\\232\\340\\257\\207\\340\\256\\260\\340\\257\\215\\0\"\\\n  \"\\340\\256\\265\\340\\256\\277\\340\\256\\260\\340\\257\\201\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\225\\340\\256\\263\\340\\256\\277\\340\\256\\262\\340\\257\\215  \\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215 %s \\340\\256\\220 \\340\\256\\252\\340\\257\\206\\340\\256\\257\\340\\256\\260\\340\\257\\201\\340\\256\\237\\340\\256\\251\\340\\257\\215 \\340\\256\\232\\340\\257\\207\\340\\256\\260\\340\\257\\215\\0\"\\\n  \"\\340\\256\\265\\340\\256\\277\\340\\256\\260\\340\\257\\201\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\225\\340\\256\\263\\340\\256\\277\\340\\256\\262\\340\\257\\215 \\340\\256\\232\\340\\257\\207\\340\\256\\260\\340\\257\\215\\0\"\\\n  \"\\340\\256\\256\\340\\257\\207\\340\\256\\256\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\215\\340\\256\\237 \\340\\256\\205\\340\\256\\256\\340\\257\\210\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\225\\340\\256\\263\\340\\257\\215\\0\"\\\n  \"\\340\\256\\216\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\256\\276 \\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\225\\340\\256\\263\\340\\257\\215\\0\"\\\n  \"\\340\\256\\216\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\256\\276 \\340\\256\\206\\340\\256\\244\\340\\256\\260\\340\\256\\277\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\215\\340\\256\\237 \\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\225\\340\\256\\263\\340\\257\\215\\0\"\\\n  \"\\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\256\\262\\340\\256\\277\\0\"\\\n  \"PDF \\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\225\\340\\256\\263\\340\\257\\201\\340\\256\\237\\340\\256\\251\\340\\257\\215 \\340\\256\\207\\340\\256\\243\\340\\257\\210\\0\"\\\n  \"\\340\\256\\207\\340\\256\\243\\340\\257\\210\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201 %s\\0\"\\\n  \"\\340\\256\\206\\340\\256\\232\\340\\256\\277\\340\\256\\260\\340\\256\\277\\340\\256\\257\\340\\256\\260\\340\\257\\215\\0\"\\\n  \"\\340\\256\\244\\340\\256\\276\\340\\256\\251\\340\\256\\277\\340\\256\\257\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\277\\0\"\\\n  \"\\340\\256\\244\\340\\256\\276\\340\\256\\251\\340\\256\\276\\340\\256\\225 \\340\\256\\252\\340\\257\\201\\340\\256\\244\\340\\257\\201\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\277\\340\\256\\244\\340\\257\\215\\340\\256\\244 \\340\\256\\252\\340\\256\\244\\340\\256\\277\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\210 \\340\\256\\244\\340\\257\\207\\340\\256\\237\\340\\257\\201\\0\"\\\n  \"\\340\\256\\217\\340\\256\\237\\340\\257\\201 \\340\\256\\265\\340\\256\\237\\340\\256\\277\\340\\256\\265\\340\\256\\277 \\340\\256\\250\\340\\257\\213\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201\\0\"\\\n  \"\\340\\256\\252\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\225\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201\\340\\256\\261\\340\\256\\277\\0\"\\\n  \"\\340\\256\\252\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\225\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201\\340\\256\\261\\340\\256\\277 \\340\\256\\207\\340\\256\\237\\340\\257\\201\\340\\256\\225\\0\"\\\n  \"%s / %s \\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\277\\340\\256\\251\\340\\257\\215 \\340\\256\\252\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\225\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201\\340\\256\\261\\340\\256\\277\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201 \\340\\256\\225\\340\\257\\201\\340\\256\\261\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201\\340\\256\\265\\340\\256\\264\\340\\256\\277\\0\"\\\n  \"\\340\\256\\252\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\225\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201\\340\\256\\261\\340\\256\\277\\0\"\\\n  \"\\340\\256\\252\\340\\256\\277\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201\\340\\256\\225\\340\\256\\263\\340\\257\\215\\0\"\\\n  \"CHM \\340\\256\\206\\340\\256\\265\\340\\256\\243\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\257\\215\\0\"\\\n  \"\\340\\256\\207\\340\\256\\243\\340\\257\\210\\340\\256\\257\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\277\\340\\256\\262\\340\\257\\215 \\340\\256\\207\\340\\256\\243\\340\\257\\210\\340\\256\\225\\340\\257\\215\\340\\256\\225 \\340\\256\\256\\340\\257\\201\\340\\256\\237\\340\\256\\277\\340\\256\\257\\340\\256\\276\\340\\256\\244\\340\\257\\201 (\\340\\256\\252\\340\\256\\277\\340\\256\\264\\340\\257\\210 %#x).\\0\"\\\n  \"\\340\\256\\207\\340\\256\\260\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\257\\201 \\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\257\\215\\0\"\\\n  \"\\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\210 \\340\\256\\205\\340\\256\\232\\340\\257\\215\\340\\256\\232\\340\\256\\277\\340\\256\\237 \\340\\256\\256\\340\\257\\201\\340\\256\\237\\340\\256\\277\\340\\256\\257\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\340\\256\\244\\340\\256\\262\\340\\257\\210\\340\\256\\225\\340\\257\\200\\340\\256\\264\\340\\257\\215 \\340\\256\\244\\340\\257\\207\\340\\256\\237\\340\\256\\262\\340\\257\\215 \\340\\256\\225\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\256\\263\\340\\257\\210 \\340\\256\\244\\340\\257\\206\\340\\256\\276\\340\\256\\237\\340\\256\\231\\340\\257\\215\\340\\256\\225 \\340\\256\\256\\340\\257\\201\\340\\256\\237\\340\\256\\277\\340\\256\\257\\340\\256\\276\\340\\256\\244\\340\\257\\201. \\340\\256\\205\\340\\256\\256\\340\\257\\210\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\225\\340\\256\\263\\340\\256\\277\\340\\256\\262\\340\\257\\215 \\340\\256\\225\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\256\\263\\340\\257\\210 \\340\\256\\265\\340\\256\\260\\340\\256\\277 \\340\\256\\232\\340\\256\\260\\340\\256\\277\\340\\256\\252\\340\\256\\276\\340\\256\\260\\340\\257\\215\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\265\\340\\257\\201\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"\\340\\256\\256\\340\\257\\212\\340\\256\\264\\340\\256\\277\\340\\256\\257\\340\\257\\210 \\340\\256\\256\\340\\256\\276\\340\\256\\261\\340\\257\\215\\340\\256\\261\\340\\257\\201\\0\"\\\n  \"\\340\\256\\252\\340\\257\\201\\340\\256\\244\\340\\256\\277\\340\\256\\257 \\340\\256\\252\\340\\256\\244\\340\\256\\277\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\210 \\340\\256\\244\\340\\257\\207\\340\\256\\237\\340\\257\\201\\0\"\\\n  \"\\340\\256\\232\\340\\256\\277\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\277\\340\\256\\260\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\244\\340\\257\\210 \\340\\256\\252\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\225\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\257\\215\\0\"\\\n  \"\\340\\256\\207\\340\\256\\243\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\251\\340\\257\\215\\340\\256\\256\\340\\257\\210\\0\"\\\n  \"\\340\\256\\244\\340\\257\\212\\340\\256\\237\\340\\256\\260\\340\\257\\215\\0\"\\\n  \"\\340\\256\\244\\340\\257\\212\\340\\256\\237\\340\\256\\260\\340\\257\\215 \\340\\256\\217\\340\\256\\237\\340\\257\\201 \\340\\256\\265\\340\\256\\237\\340\\256\\277\\340\\256\\265 \\340\\256\\250\\340\\257\\213\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201\\0\"\\\n  \"\\340\\256\\244\\340\\257\\212\\340\\256\\237\\340\\256\\260\\340\\257\\215 \\340\\256\\256\\340\\257\\201\\340\\256\\225\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\0\"\\\n  \"\\340\\256\\256\\340\\257\\212\\340\\256\\264\\340\\256\\277\\340\\256\\252\\340\\257\\206\\340\\256\\257\\340\\256\\260\\340\\257\\215\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201 \\340\\256\\252\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\256\\277\\0\"\\\n  \"\\340\\256\\250\\340\\256\\225\\340\\256\\262\\340\\257\\215 & \\340\\256\\252\\340\\256\\237\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"\\340\\256\\250\\340\\256\\225\\340\\256\\262\\340\\257\\215 &\\340\\256\\207\\340\\256\\243\\340\\257\\210\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201 \\340\\256\\256\\340\\257\\201\\340\\256\\225\\340\\256\\265\\340\\256\\260\\340\\256\\277\\0\"\\\n  \"\\340\\256\\225\\340\\256\\260\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\257\\201 \\340\\256\\250\\340\\256\\225\\340\\256\\262\\340\\257\\206\\340\\256\\237\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225\\0\"\\\n  \"\\340\\256\\211\\340\\256\\260\\340\\257\\210 \\340\\256\\250\\340\\256\\225\\340\\256\\262\\340\\257\\215 \\340\\256\\256\\340\\256\\261\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\256\\244\\340\\257\\201 (\\340\\256\\252\\340\\256\\237\\340\\256\\256\\340\\256\\276\\340\\256\\225 \\340\\256\\256\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201\\340\\256\\256\\340\\257\\215 \\340\\256\\250\\340\\256\\225\\340\\256\\262\\340\\257\\206\\340\\256\\237\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201\\340\\256\\256\\340\\257\\215)\\0\"\\\n  \"\\340\\256\\225\\340\\256\\276\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\260\\340\\256\\277\\340\\256\\256\\340\\257\\210:\\0\"\\\n  \"\\340\\256\\205\\340\\256\\232\\340\\257\\215\\340\\256\\232\\340\\257\\201\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\206\\340\\256\\276\\340\\256\\261\\340\\256\\277\\340\\256\\257\\340\\256\\277\\340\\256\\251\\340\\257\\215 \\340\\256\\252\\340\\256\\243\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\225\\340\\256\\263\\340\\257\\215 \\340\\256\\252\\340\\257\\206\\340\\256\\261 \\340\\256\\256\\340\\257\\201\\340\\256\\237\\340\\256\\277\\340\\256\\257\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\340\\256\\205\\340\\256\\232\\340\\257\\215\\340\\256\\232\\340\\257\\201\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\212\\340\\256\\261\\340\\256\\277\\340\\256\\257\\340\\257\\210 \\340\\256\\244\\340\\257\\212\\340\\256\\237\\340\\256\\225\\340\\257\\215\\340\\256\\225 \\340\\256\\256\\340\\257\\201\\340\\256\\237\\340\\256\\277\\340\\256\\257\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\257\\210 \\340\\256\\205\\340\\256\\263\\340\\256\\277\\340\\256\\225\\340\\257\\215\\340\\256\\225 \\340\\256\\256\\340\\257\\201\\340\\256\\237\\340\\256\\277\\340\\256\\257\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\340\\256\\211\\340\\256\\260\\340\\257\\201\\340\\256\\265\\340\\256\\276\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\256\\244\\340\\257\\201\\0\"\\\n  \"\\340\\256\\250\\340\\256\\237\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201 \\340\\256\\225\\340\\257\\207\\340\\256\\276\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\0\"\\\n  \"\\0\"\\\n  \"\\340\\256\\265\\340\\256\\277\\340\\256\\260\\340\\257\\201\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\277\\340\\256\\261\\340\\257\\215\\340\\256\\225\\340\\257\\207\\340\\256\\261\\340\\257\\215\\340\\256\\261 \\340\\256\\252\\340\\257\\206\\340\\256\\260\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215\\tCtrl+Y\\0\"\\\n  \"\\340\\256\\225\\340\\257\\213\\340\\256\\237 \\340\\256\\250\\340\\256\\277\\340\\256\\262\\340\\257\\210 \\340\\256\\265\\340\\256\\237\\340\\256\\277\\340\\256\\265\\340\\256\\256\\340\\257\\210\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\0\"\\\n  \"\\340\\256\\225\\340\\257\\213\\340\\256\\237 \\340\\256\\250\\340\\256\\277\\340\\256\\262\\340\\257\\210 \\340\\256\\211\\340\\256\\260\\340\\257\\201 \\340\\256\\205\\340\\256\\263\\340\\256\\265\\340\\257\\201\\0\"\\\n  \"\\340\\256\\256\\340\\257\\201\\340\\256\\244\\340\\256\\251\\340\\257\\215\\340\\256\\256\\340\\257\\210 PDF \\340\\256\\252\\340\\256\\237\\340\\256\\277\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\277\\340\\256\\257\\340\\257\\210 \\340\\256\\256\\340\\256\\276\\340\\256\\261\\340\\257\\215\\340\\256\\261 \\340\\256\\256\\340\\257\\201\\340\\256\\237\\340\\256\\277\\340\\256\\257\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\340\\256\\205\\340\\256\\251\\340\\257\\201\\340\\256\\256\\340\\256\\244\\340\\256\\277 \\340\\256\\256\\340\\256\\260\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\256\\244\\340\\257\\201\\0\"\\\n  \"DjVu \\340\\256\\206\\340\\256\\265\\340\\256\\243\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\257\\215\\0\"\\\n  \"\\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\277\\340\\256\\251\\340\\257\\215 \\340\\256\\252\\340\\256\\243\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\225\\340\\256\\263\\340\\257\\215\\0\"\\\n  \"\\340\\256\\252\\340\\256\\244\\340\\256\\277\\340\\256\\265\\340\\256\\277\\340\\256\\261\\340\\257\\215\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"\\340\\256\\265\\340\\257\\206\\340\\256\\263\\340\\256\\277\\340\\256\\257\\340\\257\\207\\340\\256\\261\\340\\257\\201\\tCtrl+Q\\0\"\\\n  \"EPUB \\340\\256\\256\\340\\256\\277\\340\\256\\251\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\225\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\257\\215\\0\"\\\n  \"\\340\\256\\225\\340\\256\\237\\340\\256\\265\\340\\257\\201\\340\\256\\232\\340\\257\\215\\340\\256\\232\\340\\257\\212\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210 \\340\\256\\265\\340\\256\\264\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\257\\201\\0\"\\\n  \"%s  \\340\\256\\225\\340\\256\\276\\340\\256\\243 \\340\\256\\225\\340\\256\\237\\340\\256\\265\\340\\257\\201\\340\\256\\232\\340\\257\\215\\340\\256\\232\\340\\257\\212\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210 \\340\\256\\265\\340\\256\\264\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\257\\201\\0\"\\\n  \"\\340\\256\\250\\340\\257\\200\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\257\\215 PDF \\340\\256\\206\\340\\256\\265\\340\\256\\243\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\277\\340\\256\\251\\340\\257\\215 \\340\\256\\256\\340\\257\\200\\340\\256\\244\\340\\257\\201 \\340\\256\\207\\340\\256\\260\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\210 \\340\\256\\232\\340\\257\\206\\340\\256\\276\\340\\256\\237\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201\\340\\256\\256\\340\\257\\215 \\340\\256\\252\\340\\257\\207\\340\\256\\276\\340\\256\\244\\340\\257\\201 \\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\256\\262\\340\\256\\276\\340\\256\\225\\340\\257\\215\\340\\256\\225 \\340\\256\\225\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\256\\263\\340\\257\\210 \\340\\256\\265\\340\\256\\260\\340\\256\\277 \\340\\256\\211\\340\\256\\263\\340\\257\\215\\340\\256\\263\\340\\256\\277\\340\\256\\237\\340\\256\\265\\340\\257\\201\\340\\256\\256\\340\\257\\215:\\0\"\\\n  \"\\340\\256\\217\\340\\256\\261\\340\\257\\215\\340\\256\\261\\340\\257\\201\\340\\256\\265\\340\\256\\244\\340\\256\\277\\340\\256\\262\\340\\257\\215 \\340\\256\\252\\340\\256\\277\\340\\256\\264\\340\\257\\210 %s\\0\"\\\n  \"\\340\\256\\252\\340\\256\\277\\340\\256\\237\\340\\256\\277\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\265\\340\\257\\210\\0\"\\\n  \"\\340\\256\\256\\340\\257\\201\\340\\256\\251\\340\\257\\215\\340\\256\\251\\340\\257\\207\\340\\256\\276\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\277 \\tAlt+Right Arrow\\0\"\\\n  \"\\340\\256\\256\\340\\257\\201\\340\\256\\264\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\277\\340\\256\\260\\340\\257\\210\\0\"\\\n  \"\\340\\256\\256\\340\\257\\201\\340\\256\\225\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\0\"\\\n  \"\\340\\256\\225\\340\\257\\207\\340\\256\\276\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201 \\340\\256\\256\\340\\256\\261\\340\\257\\201\\340\\256\\252\\340\\257\\206\\340\\256\\257\\340\\256\\260\\340\\256\\277\\340\\256\\237 \\340\\256\\256\\340\\257\\201\\340\\256\\237\\340\\256\\277\\340\\256\\257\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210!\\0\"\\\n  \"\\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201 \\340\\256\\232\\340\\257\\207\\340\\256\\256\\340\\256\\277\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201 \\340\\256\\244\\340\\257\\213\\340\\256\\261\\340\\257\\215\\340\\256\\252\\340\\257\\201\\0\"\\\n  \"\\340\\256\\265\\340\\257\\207\\340\\256\\225\\340\\256\\256\\340\\256\\276\\340\\256\\251 \\340\\256\\265\\340\\256\\262\\340\\257\\210 \\340\\256\\252\\340\\256\\276\\340\\256\\260\\340\\257\\215\\340\\256\\265\\340\\257\\210\\0\"\\\n  \"\\340\\256\\252\\340\\256\\277\\340\\256\\237\\340\\256\\277\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\265\\340\\257\\210\\0\"\\\n  \"\\340\\256\\252\\340\\257\\201\\340\\256\\251\\340\\257\\210\\340\\256\\265\\340\\257\\201 \\340\\256\\252\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\225 \\340\\256\\206\\340\\256\\265\\340\\256\\243\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"%s \\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201 \\340\\256\\225\\340\\256\\277\\340\\256\\237\\340\\257\\210\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\277\\340\\256\\251\\340\\257\\215 \\340\\256\\205\\340\\256\\263\\340\\256\\265\\340\\257\\201:\\0\"\\\n  \"\\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\0\"\\\n  \"\\340\\256\\244\\340\\257\\207\\340\\256\\237\\340\\257\\201...\\tCtrl+F\\0\"\\\n  \"\\340\\256\\244\\340\\257\\207\\340\\256\\237\\340\\257\\201\\0\"\\\n  \"\\340\\256\\205\\340\\256\\237\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\244\\340\\257\\210 \\340\\256\\244\\340\\257\\207\\340\\256\\237\\340\\257\\201\\0\"\\\n  \"\\340\\256\\256\\340\\257\\201\\340\\256\\250\\340\\257\\215\\340\\256\\244\\340\\257\\210\\340\\256\\257\\340\\256\\244\\340\\257\\210 \\340\\256\\244\\340\\257\\207\\340\\256\\237\\340\\257\\201\\0\"\\\n  \"\\340\\256\\244\\340\\257\\207\\340\\256\\237\\340\\257\\201:\\0\"\\\n  \"\\340\\256\\252\\340\\257\\206\\340\\256\\276\\340\\256\\260\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\256\\340\\257\\215 & \\340\\256\\211\\340\\256\\263\\340\\257\\215\\340\\256\\263\\340\\256\\237\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215\\tCtrl+3\\0\"\\\n  \"\\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215 \\340\\256\\252\\340\\257\\212\\340\\256\\260\\340\\257\\201\\340\\256\\250\\340\\257\\215\\340\\256\\244\\340\\256\\265\\340\\257\\210\\tCtrl+0\\0\"\\\n  \"\\340\\256\\205\\340\\256\\225\\340\\256\\262\\340\\256\\256\\340\\257\\215 \\340\\256\\252\\340\\257\\212\\340\\256\\260\\340\\257\\201\\340\\256\\250\\340\\257\\215\\340\\256\\244\\340\\256\\265\\340\\257\\210\\tCtrl+2\\0\"\\\n  \"\\340\\256\\211\\340\\256\\263\\340\\257\\215\\340\\256\\263\\340\\256\\237\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215 \\340\\256\\252\\340\\257\\212\\340\\256\\260\\340\\257\\201\\340\\256\\250\\340\\257\\215\\340\\256\\244\\340\\257\\201\\340\\256\\225\\0\"\\\n  \"\\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215 \\340\\256\\252\\340\\257\\212\\340\\256\\260\\340\\257\\201\\340\\256\\250\\340\\257\\215\\340\\256\\244\\340\\256\\265\\340\\257\\210\\0\"\\\n  \"\\340\\256\\205\\340\\256\\225\\340\\256\\262\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\277\\340\\256\\261\\340\\257\\215\\340\\256\\225\\340\\257\\201 \\340\\256\\252\\340\\257\\212\\340\\256\\260\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\257\\201\\0\"\\\n  \"\\340\\256\\205\\340\\256\\225\\340\\256\\262\\340\\256\\256\\340\\257\\215 \\340\\256\\252\\340\\257\\212\\340\\256\\260\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\277 \\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\257\\215 \\340\\256\\225\\340\\256\\276\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201\\340\\256\\225\\0\"\\\n  \"\\340\\256\\222\\340\\256\\261\\340\\257\\215\\340\\256\\261\\340\\257\\210 \\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215 \\340\\256\\252\\340\\257\\206\\340\\256\\276\\340\\256\\260\\340\\257\\201\\340\\256\\250\\340\\257\\215\\340\\256\\244\\340\\257\\201\\340\\256\\225\\0\"\\\n  \"\\340\\256\\216\\340\\256\\264\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\257\\201\\340\\256\\260\\340\\257\\201:\\0\"\\\n  \"\\340\\256\\252\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\225\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\257\\210 \\340\\256\\265\\340\\256\\237\\340\\256\\277\\340\\256\\265\\340\\256\\256\\340\\257\\210\\340\\256\\225\\340\\257\\215\\340\\256\\225 ... %d \\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\257\\215\\0\"\\\n  \"\\340\\256\\265\\340\\256\\276\\340\\256\\232\\340\\256\\225\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\257\\210 %s \\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\277\\340\\256\\262\\340\\257\\215 \\340\\256\\225\\340\\256\\243\\340\\257\\215\\340\\256\\237\\340\\257\\201\\340\\256\\252\\340\\256\\277\\340\\256\\237\\340\\256\\277\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201\\340\\256\\263\\340\\257\\215\\340\\256\\263\\340\\256\\244\\340\\257\\201\\0\"\\\n  \"\\340\\256\\211\\340\\256\\260\\340\\257\\210 %s(\\340\\256\\256\\340\\257\\200\\340\\256\\243\\340\\257\\215\\340\\256\\237\\340\\257\\201\\340\\256\\256\\340\\257\\215) \\340\\256\\207\\340\\256\\260\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\277\\340\\256\\261\\340\\256\\244\\340\\257\\201\\0\"\\\n  \"\\340\\256\\205\\340\\256\\237\\340\\256\\277\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\237\\340\\256\\277 \\340\\256\\252\\340\\256\\237\\340\\256\\277\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\244\\340\\257\\201\\0\"\\\n  \"\\340\\256\\234\\340\\256\\277\\340\\256\\225\\340\\256\\276 \\340\\256\\252\\340\\257\\210\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201\\0\"\\\n  \"\\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\244\\340\\256\\244\\340\\256\\277\\340\\256\\260\\340\\257\\215\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201 \\340\\256\\232\\340\\257\\206\\340\\256\\262\\340\\257\\215\\0\"\\\n  \"\\340\\256\\205\\340\\256\\237\\340\\256\\277\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\237\\340\\256\\277 \\340\\256\\265\\340\\256\\276\\340\\256\\232\\340\\256\\277\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\244\\340\\257\\210 \\340\\256\\256\\340\\256\\261\\340\\257\\210\\340\\256\\225\\340\\257\\215\\340\\256\\225\\0\"\\\n  \"\\340\\256\\232\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\225\\340\\257\\201\\340\\256\\260\\340\\256\\277\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201: F3 \\340\\256\\244\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\210 \\340\\256\\252\\340\\256\\257\\340\\256\\251\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\277 \\340\\256\\256\\340\\257\\200\\340\\256\\243\\340\\257\\215\\340\\256\\237\\340\\257\\201\\340\\256\\256\\340\\257\\215 \\340\\256\\244\\340\\257\\207\\340\\256\\237\\340\\257\\201\\0\"\\\n  \"\\340\\256\\252\\340\\256\\237 \\340\\256\\225\\340\\257\\207\\340\\256\\276\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\225\\340\\256\\263\\340\\257\\215 (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"\\340\\256\\232\\340\\257\\201\\340\\256\\256\\340\\256\\244\\340\\257\\215\\340\\256\\260\\340\\256\\276PDF\\340\\256\\257\\340\\257\\210 \\340\\256\\225\\340\\257\\213\\340\\256\\237 \\340\\256\\250\\340\\256\\277\\340\\256\\262\\340\\257\\210 PDF \\340\\256\\252\\340\\256\\237\\340\\256\\277\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\277\\340\\256\\257\\340\\256\\276\\340\\256\\225 \\340\\256\\256\\340\\256\\276\\340\\256\\261\\340\\257\\215\\340\\256\\261\\340\\256\\265\\340\\256\\276?\\0\"\\\n  \"\\340\\256\\232\\340\\257\\201\\340\\256\\256\\340\\256\\244\\340\\257\\215\\340\\256\\260\\340\\256\\276PDF\\340\\256\\257\\340\\257\\210 \\340\\256\\256\\340\\257\\201\\340\\256\\251\\340\\257\\215\\340\\256\\251\\340\\256\\277\\340\\256\\260\\340\\257\\201\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201 PDF \\340\\256\\252\\340\\256\\237\\340\\256\\277\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\277\\340\\256\\257\\340\\256\\276\\340\\256\\225 \\340\\256\\252\\340\\256\\244\\340\\256\\277\\340\\256\\265\\340\\257\\201 \\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\257\\215\\0\"\\\n  \"\\340\\256\\256\\340\\257\\207\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\276 \\340\\256\\256\\340\\257\\201\\340\\256\\261\\340\\257\\210\\0\"\\\n  \"\\340\\256\\244\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\212\\340\\256\\260\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"Mobi \\340\\256\\206\\340\\256\\265\\340\\256\\243\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\257\\215\\0\"\\\n  \"\\340\\256\\256\\340\\256\\276\\340\\256\\261\\340\\257\\215\\340\\256\\261\\340\\257\\215\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\215\\340\\256\\244\\340\\256\\244\\340\\257\\201\\0\"\\\n  \"\\340\\256\\252\\340\\257\\201\\340\\256\\244\\340\\256\\277\\340\\256\\257 \\340\\256\\252\\340\\256\\244\\340\\256\\277\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201 %s \\340\\256\\252\\340\\256\\244\\340\\256\\277\\340\\256\\265\\340\\256\\277\\340\\256\\261\\340\\256\\225\\340\\257\\215\\340\\256\\225 \\340\\256\\207\\340\\256\\260\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\277\\340\\256\\261\\340\\256\\244\\340\\257\\201. \\340\\256\\252\\340\\256\\244\\340\\256\\277\\340\\256\\265\\340\\256\\277\\340\\256\\260\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215 \\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\257\\215\\340\\256\\257\\340\\256\\265\\340\\256\\276?\\0\"\\\n  \"\\340\\256\\205\\340\\256\\237\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244 \\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"\\340\\256\\222\\340\\256\\260\\340\\257\\201 \\340\\256\\252\\340\\257\\212\\340\\256\\260\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\256\\340\\257\\201\\340\\256\\256\\340\\257\\215 \\340\\256\\207\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"%u \\340\\256\\265\\340\\256\\260\\340\\256\\277\\340\\256\\257\\340\\256\\277\\340\\256\\262\\340\\257\\215 %s \\340\\256\\225\\340\\257\\207\\340\\256\\276\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\277\\340\\256\\262\\340\\257\\215 \\340\\256\\256\\340\\257\\201\\340\\256\\237\\340\\256\\277\\340\\256\\265\\340\\257\\201\\340\\256\\225\\340\\256\\263\\340\\257\\215 \\340\\256\\225\\340\\256\\277\\340\\256\\237\\340\\257\\210\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\340\\256\\222\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\277\\340\\256\\257\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\257\\201 \\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201 \\340\\256\\216\\340\\256\\244\\340\\257\\201\\340\\256\\265\\340\\257\\201\\340\\256\\256\\340\\257\\215 \\340\\256\\225\\340\\256\\243\\340\\257\\215\\340\\256\\237\\340\\257\\201\\340\\256\\252\\340\\256\\277\\340\\256\\237\\340\\256\\277\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\340\\256\\222\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\277\\340\\256\\257\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\257\\201 \\340\\256\\244\\340\\256\\225\\340\\256\\265\\340\\256\\262\\340\\257\\215 \\340\\256\\216\\340\\256\\244\\340\\257\\201\\340\\256\\265\\340\\257\\201\\340\\256\\256\\340\\257\\215 \\340\\256\\207\\340\\256\\250\\340\\257\\215\\340\\256\\244 \\340\\256\\250\\340\\256\\277\\340\\256\\262\\340\\257\\210\\340\\256\\257\\340\\256\\277\\340\\256\\262\\340\\257\\215 \\340\\256\\207\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\256\\277\\340\\256\\251\\340\\257\\215 \\340\\256\\216\\340\\256\\243\\340\\257\\215\\340\\256\\243\\340\\256\\277\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\210\\0\"\\\n  \"\\340\\256\\232\\340\\256\\260\\340\\256\\277\\0\"\\\n  \"\\340\\256\\244\\340\\256\\277\\340\\256\\261\\0\"\\\n  \"PDF-XChange \\340\\256\\207\\340\\256\\262\\340\\257\\215 \\340\\256\\244\\340\\256\\277\\340\\256\\261\\0\"\\\n  \"\\340\\256\\206\\340\\256\\265\\340\\256\\243\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\257\\210 \\340\\256\\244\\340\\256\\277\\340\\256\\261\\340\\256\\225\\340\\257\\215\\340\\256\\225...\\0\"\\\n  \"\\340\\256\\244\\340\\256\\277\\340\\256\\261 %s\\0\"\\\n  \"&Adobe Reader \\340\\256\\207\\340\\256\\262\\340\\257\\215 \\340\\256\\244\\340\\256\\277\\340\\256\\261\\0\"\\\n  \"&Foxit Reader \\340\\256\\207\\340\\256\\262\\340\\257\\215 \\340\\256\\244\\340\\256\\277\\340\\256\\261\\0\"\\\n  \"Microsoft HTML Help \\340\\256\\207\\340\\256\\262\\340\\257\\215 \\340\\256\\244\\340\\256\\277\\340\\256\\261\\0\"\\\n  \"Microsoft XPS-Viewer \\340\\256\\207\\340\\256\\262\\340\\257\\215 \\340\\256\\244\\340\\256\\277\\340\\256\\261\\0\"\\\n  \"\\340\\256\\252\\340\\256\\243\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\225\\340\\256\\263\\340\\257\\215\\0\"\\\n  \"\\340\\256\\252\\340\\256\\243\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\225\\340\\256\\263\\340\\257\\215...\\tCtrl+D\\0\"\\\n  \"PDF \\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\0\"\\\n  \"PDF \\340\\256\\256\\340\\257\\207\\340\\256\\256\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\262\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\257\\215\\0\"\\\n  \"PDF \\340\\256\\211\\340\\256\\261\\340\\257\\215\\340\\256\\252\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\277\\340\\256\\257\\340\\256\\276\\340\\256\\263\\340\\256\\260\\340\\257\\215\\0\"\\\n  \"PDF \\340\\256\\252\\340\\256\\244\\340\\256\\277\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\0\"\\\n  \"PDF \\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\225\\340\\256\\263\\340\\257\\215\\0\"\\\n  \"\\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215...\\tCtrl+G\\0\"\\\n  \"\\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215 %s\\0\"\\\n  \"\\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225 \\340\\256\\205\\340\\256\\263\\340\\256\\265\\340\\257\\201\\0\"\\\n  \"\\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225 \\340\\256\\216\\340\\256\\243\\340\\257\\215 %u \\340\\256\\207\\340\\256\\260\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215 \\340\\256\\205\\340\\256\\263\\340\\256\\265\\340\\257\\201\\340\\256\\256\\340\\256\\276\\340\\256\\261\\340\\257\\215\\340\\256\\261\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"\\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215:\\0\"\\\n  \"\\0\"\\\n  \"\\340\\256\\244\\340\\256\\257\\340\\256\\265\\340\\257\\201\\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\257\\215\\340\\256\\244\\340\\257\\201 \\340\\256\\225\\340\\256\\276\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\277\\340\\256\\260\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\265\\340\\257\\201\\340\\256\\256\\340\\257\\215 - \\340\\256\\205\\340\\256\\263\\340\\256\\277\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\252\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201\\340\\256\\265\\340\\256\\260\\340\\257\\201\\340\\256\\225\\340\\256\\277\\340\\256\\261\\340\\256\\244\\340\\257\\201...\\0\"\\\n  \"\\340\\256\\252\\340\\257\\207\\340\\256\\276\\340\\256\\270\\340\\257\\215\\340\\256\\237\\340\\257\\215\\340\\256\\270\\340\\257\\215\\340\\256\\225\\340\\256\\277\\340\\256\\260\\340\\256\\277\\340\\256\\252\\340\\257\\215\\340\\256\\237\\340\\257\\215 \\340\\256\\206\\340\\256\\265\\340\\256\\243\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\257\\215\\0\"\\\n  \"\\340\\256\\265\\340\\256\\277\\340\\256\\263\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\276\\340\\256\\237\\340\\257\\215\\340\\256\\232\\340\\256\\277 \\tCtrl+L\\0\"\\\n  \"\\340\\256\\256\\340\\257\\201\\340\\256\\250\\340\\257\\215\\340\\256\\244\\340\\257\\210\\340\\256\\257 \\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"\\340\\256\\205\\340\\256\\232\\340\\257\\215\\340\\256\\232\\340\\256\\277\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201\\0\"\\\n  \"\\340\\256\\205\\340\\256\\232\\340\\257\\215\\340\\256\\232\\340\\256\\277\\340\\256\\237\\340\\257\\201\\340\\256\\256\\340\\257\\215 \\340\\256\\265\\340\\256\\260\\340\\256\\256\\340\\257\\215\\340\\256\\252\\340\\257\\201\\0\"\\\n  \"\\340\\256\\225\\340\\257\\201\\340\\256\\261\\340\\256\\277\\340\\256\\252\\340\\256\\277\\340\\256\\237\\340\\257\\215\\340\\256\\237 \\340\\256\\252\\340\\257\\206\\340\\256\\257\\340\\256\\260\\340\\256\\277\\340\\256\\262\\340\\257\\215 \\340\\256\\205\\340\\256\\232\\340\\257\\215\\340\\256\\232\\340\\257\\201\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\206\\340\\256\\276\\340\\256\\261\\340\\256\\277 \\340\\256\\207\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210.\\0\"\\\n  \"\\340\\256\\205\\340\\256\\232\\340\\257\\215\\340\\256\\232\\340\\257\\201 \\340\\256\\252\\340\\256\\243\\340\\256\\277\\340\\256\\257\\340\\256\\277\\340\\256\\262\\340\\257\\215 \\340\\256\\211\\340\\256\\263\\340\\257\\215\\340\\256\\263\\340\\256\\244\\340\\257\\201\\0\"\\\n  \"\\340\\256\\205\\340\\256\\232\\340\\257\\215\\340\\256\\232\\340\\256\\237\\340\\256\\277\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\262\\340\\257\\215 \\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\256\\262\\340\\256\\277\\340\\256\\262\\340\\257\\215 \\340\\256\\211\\340\\256\\263\\340\\257\\215\\340\\256\\263\\340\\256\\244\\340\\257\\201. \\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\277 \\340\\256\\260\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\257\\201 \\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\257\\215?\\0\"\\\n  \"\\340\\256\\205\\340\\256\\232\\340\\257\\215\\340\\256\\232\\340\\256\\277\\340\\256\\237\\340\\257\\201\\340\\256\\244\\340\\256\\262\\340\\257\\215 \\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\256\\262\\340\\257\\215\\340\\256\\252\\340\\256\\276\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\256\\277\\340\\256\\262\\340\\257\\215 \\340\\256\\211\\340\\256\\263\\340\\257\\215\\340\\256\\263\\340\\256\\244\\340\\257\\201. \\340\\256\\225\\340\\257\\210\\340\\256\\265\\340\\256\\277\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201 \\340\\256\\256\\340\\257\\200\\340\\256\\243\\340\\257\\215\\340\\256\\237\\340\\257\\201\\340\\256\\256\\340\\257\\215 \\340\\256\\244\\340\\257\\206\\340\\256\\276\\340\\256\\237\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\265\\340\\256\\276?\\0\"\\\n  \"\\340\\256\\205\\340\\256\\232\\340\\257\\215\\340\\256\\232\\340\\256\\277\\340\\256\\237\\340\\257\\201\\340\\256\\256\\340\\257\\215 \\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215 %d \\340\\256\\211\\340\\256\\263\\340\\257\\215 %d\\0\"\\\n  \"\\340\\256\\205\\340\\256\\232\\340\\257\\215\\340\\256\\232\\340\\257\\201\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\212\\340\\256\\261\\340\\256\\277 \\340\\256\\232\\340\\256\\277\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\262\\340\\257\\215\\0\"\\\n  \"\\340\\256\\256\\340\\256\\261\\340\\257\\201\\340\\256\\252\\340\\257\\206\\340\\256\\257\\340\\256\\260\\340\\256\\277\\340\\256\\237\\340\\257\\201\\340\\256\\244\\340\\256\\262\\340\\257\\215... \\tF2\\0\"\\\n  \"\\340\\256\\244\\340\\256\\277\\340\\256\\261\\340\\256\\250\\340\\257\\215\\340\\256\\244 &\\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\225\\340\\256\\263\\340\\257\\210 \\340\\256\\250\\340\\256\\277\\340\\256\\251\\340\\257\\210\\340\\256\\265\\340\\257\\201\\340\\256\\225\\340\\257\\212\\340\\256\\263\\340\\257\\215\\0\"\\\n  \"\\340\\256\\252\\340\\256\\277\\340\\256\\237\\340\\256\\277\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\265\\340\\256\\261\\340\\257\\215\\340\\256\\261\\340\\256\\277\\340\\256\\262\\340\\257\\215 \\340\\256\\207\\340\\256\\260\\340\\257\\201\\340\\256\\250\\340\\257\\215\\340\\256\\244\\340\\257\\201 \\340\\256\\250\\340\\257\\200\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201\\340\\256\\225\\0\"\\\n  \"%s \\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\257\\210 \\340\\256\\252\\340\\256\\277\\340\\256\\237\\340\\256\\277\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\265\\340\\257\\210\\340\\256\\257\\340\\256\\277\\340\\256\\262\\340\\257\\215 \\340\\256\\207\\340\\256\\260\\340\\257\\201\\340\\256\\250\\340\\257\\215\\340\\256\\244\\340\\257\\201 \\340\\256\\250\\340\\257\\200\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201\\340\\256\\225\\0\"\\\n  \"\\340\\256\\256\\340\\256\\261\\340\\257\\201\\340\\256\\252\\340\\257\\206\\340\\256\\257\\340\\256\\260\\340\\256\\277\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201\\0\"\\\n  \"\\340\\256\\207\\340\\256\\237\\340\\256\\244\\340\\257\\201\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\261\\340\\256\\256\\340\\257\\215 \\340\\256\\232\\340\\257\\201\\340\\256\\264\\340\\256\\261\\340\\257\\215\\340\\256\\261\\340\\257\\201\\tCtrl+Shift+-\\0\"\\\n  \"\\340\\256\\265\\340\\256\\262\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\261\\340\\256\\256\\340\\257\\215 \\340\\256\\232\\340\\257\\201\\340\\256\\264\\340\\256\\261\\340\\257\\215\\340\\256\\261\\340\\257\\201\\tCtrl+Shift++\\0\"\\\n  \"\\340\\256\\216\\340\\256\\251\\340\\256\\232\\340\\257\\215 \\340\\256\\232\\340\\257\\207\\340\\256\\256\\340\\256\\277\\0\"\\\n  \"\\340\\256\\225\\340\\257\\201\\340\\256\\261\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201\\340\\256\\265\\340\\256\\264\\340\\256\\277 \\340\\256\\232\\340\\257\\207\\340\\256\\256\\340\\256\\277...\\tCtrl+Shift+S\\0\"\\\n  \"%d \\340\\256\\207\\340\\256\\262\\340\\257\\215 %d \\340\\256\\244\\340\\257\\207\\340\\256\\237\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\201\\340\\256\\225\\340\\256\\277\\340\\256\\261\\340\\256\\244\\340\\257\\201....\\0\"\\\n  \"\\340\\256\\205\\340\\256\\251\\340\\257\\210\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\257\\210\\340\\256\\257\\340\\257\\201\\340\\256\\256\\340\\257\\215 \\340\\256\\244\\340\\257\\207\\340\\256\\260\\340\\257\\215\\340\\256\\265\\340\\257\\201 \\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\257\\215\\0\"\\\n  \"\\340\\256\\205\\340\\256\\251\\340\\257\\210\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\257\\210\\340\\256\\257\\340\\257\\201\\340\\256\\256\\340\\257\\215 \\340\\256\\244\\340\\257\\207\\340\\256\\260\\340\\257\\215\\340\\256\\265\\340\\257\\201 \\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\257\\215 \\tCtrl+A\\0\"\\\n  \"\\340\\256\\211\\340\\256\\263\\340\\257\\215\\340\\256\\263\\340\\256\\237\\340\\256\\225\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\257\\210 \\340\\256\\244\\340\\257\\207\\340\\256\\260\\340\\257\\215\\340\\256\\265\\340\\257\\201 \\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\257\\215\\340\\256\\257 Ctrl+\\340\\256\\207\\340\\256\\237\\340\\256\\244\\340\\257\\201 \\340\\256\\232\\340\\257\\201\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\206\\340\\256\\262\\340\\256\\277 \\340\\256\\252\\340\\257\\212\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\276\\340\\256\\251\\340\\257\\210 \\340\\256\\205\\340\\256\\264\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\257\\201\\0\"\\\n  \"\\0\"\\\n  \"\\340\\256\\256\\340\\256\\277\\340\\256\\251\\340\\257\\215\\340\\256\\251\\340\\256\\236\\340\\257\\215\\340\\256\\232\\340\\256\\262\\340\\256\\276\\340\\256\\225 \\340\\256\\205\\340\\256\\251\\340\\257\\201\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201...\\0\"\\\n  \"\\340\\256\\244\\340\\256\\262\\340\\257\\210\\340\\256\\225\\340\\257\\200\\340\\256\\264\\340\\257\\215 \\340\\256\\244\\340\\257\\207\\340\\256\\237\\340\\256\\262\\340\\257\\215 \\340\\256\\225\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\256\\263\\340\\257\\210 \\340\\256\\265\\340\\256\\260\\340\\256\\277 \\340\\256\\205\\340\\256\\256\\340\\257\\210\\340\\256\\225\\340\\257\\215\\340\\256\\225\\0\"\\\n  \"\\340\\256\\252\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\225\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201\\340\\256\\261\\340\\256\\277\\340\\256\\225\\340\\256\\263\\340\\257\\210 \\340\\256\\225\\340\\256\\276\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201\\340\\256\\225\\0\"\\\n  \"\\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\257\\210 \\340\\256\\244\\340\\257\\212\\340\\256\\237\\340\\256\\260\\340\\257\\215\\340\\256\\232\\340\\257\\215\\340\\256\\232\\340\\256\\277\\340\\256\\257\\340\\256\\276\\340\\256\\225 \\340\\256\\225\\340\\256\\276\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201\\0\"\\\n  \"\\340\\256\\225\\340\\256\\260\\340\\257\\201\\340\\256\\265\\340\\256\\277\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\210 \\340\\256\\225\\340\\256\\276\\340\\256\\243\\340\\257\\215\\340\\256\\252\\340\\256\\277\\0\"\\\n  \"\\340\\256\\252\\340\\256\\277\\340\\256\\237\\340\\256\\277\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\265\\340\\257\\210\\340\\256\\225\\340\\256\\263\\340\\257\\210 \\340\\256\\225\\340\\256\\276\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201\\340\\256\\225\\0\"\\\n  \"\\340\\256\\205\\340\\256\\237\\340\\256\\277\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\237\\340\\256\\277 \\340\\256\\252\\340\\256\\237\\340\\256\\277\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\265\\340\\257\\210\\0\"\\\n  \"\\340\\256\\252\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\225\\340\\256\\225\\340\\257\\201\\340\\256\\261\\340\\256\\277 \\340\\256\\252\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\210 \\340\\256\\207\\340\\256\\260\\340\\257\\201\\340\\256\\250\\340\\257\\215\\340\\256\\244\\340\\256\\262\\340\\257\\215 \\340\\256\\225\\340\\256\\276\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201\\0\"\\\n  \"\\340\\256\\222\\340\\256\\261\\340\\257\\215\\340\\256\\261\\340\\257\\210\\340\\256\\252\\340\\257\\215 \\340\\256\\252\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"\\340\\256\\256\\340\\256\\251\\340\\257\\215\\340\\256\\251\\340\\256\\277\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\265\\340\\257\\201\\340\\256\\256\\340\\257\\215, \\340\\256\\207\\340\\256\\244\\340\\257\\201 \\340\\256\\250\\340\\256\\237\\340\\256\\250\\340\\257\\215\\340\\256\\244\\340\\256\\277\\340\\256\\260\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225 \\340\\256\\225\\340\\257\\202\\340\\256\\237\\340\\256\\276\\340\\256\\244\\340\\257\\201! \\n\\n \\340\\256\\244\\340\\256\\257\\340\\256\\265\\340\\257\\201 \\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\257\\215\\340\\256\\244\\340\\257\\201 '\\340\\256\\260\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\257\\201\\340\\256\\244\\340\\257\\210' \\340\\256\\205\\340\\256\\264\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\265\\340\\257\\201\\340\\256\\256\\340\\257\\215, \\340\\256\\216\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201 \\340\\256\\207\\340\\256\\250\\340\\257\\215\\340\\256\\244 \\340\\256\\265\\340\\256\\277\\340\\256\\252\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\277\\340\\256\\251\\340\\257\\210 \\340\\256\\232\\340\\256\\260\\340\\256\\277\\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\257\\215\\340\\256\\257 \\340\\256\\211\\340\\256\\244\\340\\256\\265\\340\\257\\201\\340\\256\\256\\340\\257\\215.\\0\"\\\n  \"%s \\340\\256\\256\\340\\257\\201\\340\\256\\262 \\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\277\\340\\256\\260\\340\\257\\215\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201 \\340\\256\\222\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\277\\340\\256\\257\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\257\\201 \\340\\256\\256\\340\\257\\210\\340\\256\\257\\340\\256\\256\\340\\257\\215 \\340\\256\\216\\340\\256\\244\\340\\257\\201\\340\\256\\265\\340\\257\\201\\340\\256\\256\\340\\257\\215 \\340\\256\\207\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\340\\256\\216\\340\\256\\264\\340\\257\\201\\340\\256\\265\\340\\256\\276\\340\\256\\257\\340\\257\\215:\\0\"\\\n  \"\\340\\256\\232\\340\\257\\201\\340\\256\\256\\340\\256\\244\\340\\257\\215\\340\\256\\260\\340\\256\\276PDF\\340\\256\\207\\340\\256\\251\\340\\257\\215 \\340\\256\\265\\340\\256\\277\\340\\256\\260\\340\\257\\201\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\252 \\340\\256\\252\\340\\257\\207\\340\\256\\260\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"\\340\\256\\232\\340\\257\\201\\340\\256\\256\\340\\256\\244\\340\\257\\215\\340\\256\\260\\340\\256\\276PDF \\340\\256\\256\\340\\257\\207\\340\\256\\256\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\257\\201\\0\"\\\n  \"\\340\\256\\232\\340\\257\\201\\340\\256\\256\\340\\256\\244\\340\\257\\215\\340\\256\\260\\340\\256\\276PDF \\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\256\\262\\340\\256\\277\\340\\256\\264\\340\\256\\250\\340\\257\\215\\340\\256\\244\\340\\256\\244\\340\\257\\201\\0\"\\\n  \"\\340\\256\\232\\340\\257\\201\\340\\256\\256\\340\\256\\244\\340\\257\\215\\340\\256\\260\\340\\256\\276PDF \\340\\256\\211\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\256\\277\\340\\256\\251\\340\\257\\215 \\340\\256\\256\\340\\257\\201\\340\\256\\244\\340\\256\\251\\340\\257\\215\\340\\256\\256\\340\\257\\210 PDF \\340\\256\\252\\340\\256\\237\\340\\256\\277\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\277\\0\"\\\n  \"\\340\\256\\232\\340\\257\\201\\340\\256\\256\\340\\256\\244\\340\\257\\215\\340\\256\\260\\340\\256\\276PDF \\340\\256\\207\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\212\\340\\256\\264\\340\\257\\201\\340\\256\\244\\340\\257\\201 \\340\\256\\211\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\256\\277\\340\\256\\251\\340\\257\\215 \\340\\256\\256\\340\\257\\201\\340\\256\\244\\340\\256\\251\\340\\257\\215\\340\\256\\256\\340\\257\\210 PDF \\340\\256\\252\\340\\256\\237\\340\\256\\277\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\277\\0\"\\\n  \"\\340\\256\\222\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\277\\340\\256\\257\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\257\\201 \\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\210 \\340\\256\\244\\340\\256\\277\\340\\256\\261\\340\\256\\225\\340\\257\\215\\340\\256\\225 \\340\\256\\256\\340\\257\\201\\340\\256\\237\\340\\256\\277\\340\\256\\257\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\340\\256\\225\\340\\257\\201\\340\\256\\261\\340\\256\\277\\340\\256\\257\\340\\256\\277\\340\\256\\237\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\215\\340\\256\\237 PDF\\0\"\\\n  \"\\340\\256\\211\\340\\256\\260\\340\\257\\210 \\340\\256\\225\\340\\257\\212\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\225\\340\\256\\263\\340\\257\\215\\0\"\\\n  \"\\0\"\\\n  \"\\340\\256\\244\\340\\256\\262\\340\\257\\210\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201:\\0\"\\\n  \"(%s) \\340\\256\\256\\340\\257\\202\\340\\256\\262 \\340\\256\\225\\340\\257\\207\\340\\256\\276\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201 \\340\\256\\225\\340\\256\\277\\340\\256\\237\\340\\257\\210\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\0\"\\\n  \"\\340\\256\\250\\340\\257\\213\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201\\0\"\\\n  \"\\340\\256\\265\\340\\256\\262\\340\\257\\210\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\263\\340\\256\\256\\340\\257\\215 \\340\\256\\232\\340\\257\\206\\340\\256\\262\\340\\257\\215\\0\"\\\n  \"\\340\\256\\216\\340\\256\\225\\340\\257\\215\\340\\256\\232\\340\\256\\260\\340\\256\\277\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\210\\0\"\\\n  \"XPS \\340\\256\\206\\340\\256\\265\\340\\256\\243\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\257\\215\\0\"\\\n  \"\\340\\256\\211\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\256\\277\\340\\256\\237\\340\\256\\256\\340\\257\\215 \\340\\256\\252\\340\\257\\201\\340\\256\\244\\340\\256\\277\\340\\256\\257 \\340\\256\\252\\340\\256\\244\\340\\256\\277\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201 \\340\\256\\211\\340\\256\\263\\340\\257\\215\\340\\256\\263\\340\\256\\244\\340\\257\\201\\0\"\\\n  \"\\340\\256\\211\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\256\\277\\340\\256\\251\\340\\257\\215 \\340\\256\\252\\340\\256\\244\\340\\256\\277\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201 %s\\0\"\\\n  \"\\340\\256\\211\\340\\256\\260\\340\\257\\201 \\340\\256\\205\\340\\256\\263\\340\\256\\265\\340\\257\\201\\0\"\\\n  \"\\340\\256\\252\\340\\257\\206\\340\\256\\260\\340\\256\\277\\340\\256\\244\\340\\256\\276\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201\\0\"\\\n  \"\\340\\256\\232\\340\\256\\277\\340\\256\\261\\340\\256\\277\\340\\256\\244\\340\\256\\276\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201\\0\"\\\n  \"\\340\\256\\211\\340\\256\\260\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\276\\340\\256\\260\\340\\256\\243\\340\\256\\277\\0\"\\\n  \"[\\340\\256\\256\\340\\256\\276\\340\\256\\261\\340\\257\\215\\340\\256\\261\\340\\256\\231\\340\\257\\215\\340\\256\\225\\340\\256\\263\\340\\257\\215 \\340\\256\\225\\340\\256\\243\\340\\257\\215\\340\\256\\237\\340\\257\\201\\340\\256\\252\\340\\256\\277\\340\\256\\237\\340\\256\\277\\340\\256\\225\\340\\257\\215\\340\\256\\225 \\340\\256\\252\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201\\340\\256\\263\\340\\257\\215\\340\\256\\263\\340\\256\\244\\340\\257\\201; \\340\\256\\252\\340\\257\\201\\340\\256\\244\\340\\257\\201\\340\\256\\252\\340\\256\\277\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\252\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201 \\340\\256\\265\\340\\256\\260\\340\\257\\201\\340\\256\\225\\340\\256\\277\\340\\256\\261\\340\\256\\244\\340\\257\\201]%s\\0\"\\\n  \"\\340\\256\\250\\340\\256\\225\\340\\256\\262\\340\\257\\215 \\340\\256\\216\\340\\256\\237\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\201\\340\\256\\225\\340\\256\\277\\340\\256\\261\\340\\256\\244\\340\\257\\201\\0\"\\\n  \"\\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201 \\340\\256\\205\\340\\256\\225\\340\\257\\215\\340\\256\\232\\340\\256\\277\\340\\256\\237\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\201\\340\\256\\225\\340\\256\\277\\340\\256\\261\\340\\256\\244\\340\\257\\201\\0\";\n\nconst char * gTranslations_tr = \n  \"&Hakk\\304\\261nda\\0\"\\\n  \"Ger\\303\\247ek &Boyut\\tCtrl+1\\0\"\\\n  \"Geli\\305\\237mi\\305\\237 Ayarlar\\0\"\\\n  \"T\\303\\274m se\\303\\247ilen &sayfalar\\0\"\\\n  \"&Geri\\tAlt+Sol Ok\\0\"\\\n  \"&Kitap G\\303\\266r\\303\\274n\\303\\274m\\303\\274\\0\"\\\n  \"&Kapat\\tCtrl+W\\0\"\\\n  \"Se\\303\\247imi &Kopyala\\0\"\\\n  \"Se\\303\\247ileni &kopyala\\tCtrl+C\\0\"\\\n  \"Tekrar &sorma\\0\"\\\n  \"Sadece &\\303\\247ift sayfalar\\0\"\\\n  \"\\303\\207ift sayfa\\tCtrl+7\\0\"\\\n  \"&Dosya\\0\"\\\n  \"&Bulunacak olan:\\0\"\\\n  \"&\\304\\260lk Sayfa\\tHome\\0\"\\\n  \"Sayfalar\\304\\261 &yazd\\304\\261r\\304\\261labilecek alana \\303\\266l\\303\\247ekle\\0\"\\\n  \"&Git\\0\"\\\n  \"Sayfaya &git:\\0\"\\\n  \"&Yard\\304\\261m\\0\"\\\n  \"So&n Sayfa\\tEnd\\0\"\\\n  \"&B\\303\\274y\\303\\274te\\303\\247:\\0\"\\\n  \"&El kitab\\304\\261\\0\"\\\n  \"B&\\303\\274y\\303\\274k/K\\303\\274\\303\\247\\303\\274k harf e\\305\\237le\\305\\237tir\\0\"\\\n  \"S&onraki Sayfa\\t->\\0\"\\\n  \"&Hay\\304\\261r\\0\"\\\n  \"&Hay\\304\\261r, te\\305\\237ekk\\303\\274rler\\0\"\\\n  \"Sadece &tek sayfalar\\0\"\\\n  \"Belgeyi &A\\303\\247\\0\"\\\n  \"&A\\303\\247...\\tCtrl+O\\0\"\\\n  \"&Se\\303\\247enekler...\\0\"\\\n  \"&\\305\\236ifre:\\0\"\\\n  \"Belgeye &Tuttur\\0\"\\\n  \"&\\303\\226nceki Sayfa\\t<-\\0\"\\\n  \"&Yazd\\304\\261r...\\0\"\\\n  \"&Yazd\\304\\261r...\\tCtrl+P\\0\"\\\n  \"&Bask\\304\\261... (reddedildi)\\0\"\\\n  \"Bu belge i\\303\\247in \\305\\237ifreyi &hat\\304\\261rla\\0\"\\\n  \"Bu ayarlar\\304\\261 her belge i\\303\\247in &hat\\304\\261rla\\0\"\\\n  \"Belgeyi &Kald\\304\\261r\\0\"\\\n  \"&Farkl\\304\\261 Kaydet...\\0\"\\\n  \"&Farkl\\304\\261 kaydet...\\tCtrl+S\\0\"\\\n  \"&Ayarlar\\0\"\\\n  \"Sayfalar\\304\\261 bask\\304\\261 alan\\304\\261na &indirgele (gerekirse)\\0\"\\\n  \"&Tek Sayfa\\tCtrl+6\\0\"\\\n  \"Bu s&\\303\\274r\\303\\274m\\303\\274 atla\\0\"\\\n  \"Orijinal sayfa boyutlar\\304\\261n\\304\\261 &kullan\\0\"\\\n  \"G\\303\\266s&ter\\0\"\\\n  \"&Pencere\\0\"\\\n  \"&Evet\\0\"\\\n  \"&Yak\\304\\261nla\\305\\237t\\304\\261rma\\0\"\\\n  \"(toplam %d)\\0\"\\\n  \"(sayfa %s)\\0\"\\\n  \"SumatraPDF hakk\\304\\261nda\\0\"\\\n  \"S\\304\\261k kullan\\304\\261lanlara ekle\\0\"\\\n  \"%s no.lu sayfay\\304\\261 s\\304\\261k kullan\\304\\261lanlara ekle\\0\"\\\n  \"%s no.lu sayfay\\304\\261 s\\304\\261k kullan\\304\\261lanlara (tercihe ba\\304\\237l\\304\\261 isimle) ekle:\\0\"\\\n  \"S\\304\\261k kullan\\304\\261lanlara ekle\\0\"\\\n  \"Geli\\305\\237mi\\305\\237\\0\"\\\n  \"T\\303\\274m dosyalar\\0\"\\\n  \"B\\303\\274t\\303\\274n desteklenen belgeler\\0\"\\\n  \"Uygulama:\\0\"\\\n  \"PDF dosyalar\\304\\261 ile ba\\304\\237da\\305\\237t\\304\\261rmak ister misiniz?\\0\"\\\n  \"Ek: %s\\0\"\\\n  \"Yazar:\\0\"\\\n  \"Otomatik\\0\"\\\n  \"&G\\303\\274ncellemeleri otomatik olarak kontrol et\\0\"\\\n  \"Kitap G\\303\\266r\\303\\274n\\303\\274m\\303\\274\\0\"\\\n  \"&Yer imleri\\tF12\\0\"\\\n  \"Yer imi k\\304\\261sayollar\\304\\261\\0\"\\\n  \"%s. sayfas\\304\\261na %s yer imi k\\304\\261sayolu\\0\"\\\n  \"Yer imleri\\0\"\\\n  \"Bayt\\0\"\\\n  \"CHM belgeleri\\0\"\\\n  \"\\304\\260nternete eri\\305\\237ilemiyor (hata %#x)\\0\"\\\n  \"Vazge\\303\\247\\0\"\\\n  \"Bu dosyan\\304\\261n yaz\\304\\261c\\304\\261dan d\\303\\266k\\303\\274m\\303\\274 yap\\304\\261lamaz\\0\"\\\n  \"Sondan ba\\305\\237a arama komutu ba\\305\\237lat\\304\\261lamad\\304\\261. Ayarlarda komut sat\\304\\261r\\304\\261n\\304\\261 kontrol ediniz.\\0\"\\\n  \"Dil de\\304\\237i\\305\\237tir (Change Language)\\0\"\\\n  \"&G\\303\\274ncellemeleri kontrol et\\0\"\\\n  \"\\303\\207izgi romanlar\\0\"\\\n  \"Uyumluluk\\0\"\\\n  \"Devaml\\304\\261\\0\"\\\n  \"Devaml\\304\\261 Kitap Gibi G\\303\\266r\\303\\274n\\303\\274m\\0\"\\\n  \"Devaml\\304\\261 \\303\\247ift sayfa\\0\"\\\n  \"\\303\\207eviriye katk\\304\\261da bulunun.\\0\"\\\n  \"&G\\303\\266r\\303\\274nt\\303\\274y\\303\\274 Kopyala\\0\"\\\n  \"&Ba\\304\\237lant\\304\\261 Adresini Kopyala\\0\"\\\n  \"&A\\303\\247\\304\\261klamay\\304\\261 Kopyala\\0\"\\\n  \"Metnin kopyalanmas\\304\\261 reddedildi (g\\303\\266r\\303\\274nt\\303\\274 olarak kopyaland\\304\\261)\\0\"\\\n  \"Telif hakk\\304\\261:\\0\"\\\n  \"Yaz\\304\\261c\\304\\261 \\303\\266zellikleri temin edilemedi\\0\"\\\n  \"Yaz\\304\\261c\\304\\261 ba\\305\\237lat\\304\\261lamad\\304\\261\\0\"\\\n  \"Sayfa olu\\305\\237turulamad\\304\\261\\0\"\\\n  \"Olu\\305\\237turma tarihi:\\0\"\\\n  \"Y\\303\\274r\\303\\274rl\\303\\274kteki dosya\\0\"\\\n  \"\\304\\260mle\\303\\247 konumu:\\0\"\\\n  \"Ki\\305\\237iselle\\305\\237tirilmi\\305\\237 &Yak\\304\\261nla\\305\\237t\\304\\261rma... \\tCtrl+Y\\0\"\\\n  \"Varsay\\304\\261lan &D\\303\\274zen:\\0\"\\\n  \"Varsay\\304\\261lan &Yak\\304\\261nla\\305\\237t\\304\\261rma:\\0\"\\\n  \"Varsay\\304\\261lan PDF okuyucu ta\\305\\237\\304\\261nabilir modunda de\\304\\237i\\305\\237tirilemez\\0\"\\\n  \"Reddedilen \\304\\260zinler:\\0\"\\\n  \"DjVu belgeleri\\0\"\\\n  \"Belge \\303\\226zellikleri\\0\"\\\n  \"\\304\\260ndir\\0\"\\\n  \"\\303\\207&\\304\\261k\\tCtrl+O\\0\"\\\n  \"EPUB belgeleri\\0\"\\\n  \"\\305\\236ifrenizi giriniz\\0\"\\\n  \"%s i\\303\\247in \\305\\237ifrenizi giriniz\\0\"\\\n  \"PDF belgesine \\303\\247ift t\\304\\261klan\\304\\261nca y\\303\\274r\\303\\274t\\303\\274lecek komutu giriniz:\\0\"\\\n  \"%s y\\303\\274kleme hatas\\304\\261\\0\"\\\n  \"S&\\304\\261k kullan\\304\\261lanlar\\0\"\\\n  \"\\304\\260&leri\\tAlt+Sa\\304\\237 Ok\\0\"\\\n  \"&Tam Ekran\\tCtrl+Shift+L\\0\"\\\n  \"\\303\\207ift sayfa\\0\"\\\n  \"Dosyan\\304\\261n ismi de\\304\\237i\\305\\237tirilemedi!\\0\"\\\n  \"Dosya kaydedilirken hata \\303\\247\\304\\261kt\\304\\261.\\0\"\\\n  \"H\\304\\261zl\\304\\261 Web G\\303\\266r\\303\\274n\\303\\274m\\303\\274\\0\"\\\n  \"S\\304\\261k kullan\\304\\261lanlar\\0\"\\\n  \"FictionBook belgeleri\\0\"\\\n  \"%s dosyas\\304\\261 bulunamad\\304\\261\\0\"\\\n  \"Dosya boyutu:\\0\"\\\n  \"Dosya:\\0\"\\\n  \"&Bul...\\tCtrl+F\\0\"\\\n  \"Bul\\0\"\\\n  \"Sonrakini Bul\\0\"\\\n  \"\\303\\226ncekini bul\\0\"\\\n  \"Bul:\\0\"\\\n  \"&\\304\\260\\303\\247eri\\304\\237e \\303\\266l\\303\\247ekle\\tCtrl+3\\0\"\\\n  \"&Sayfaya s\\304\\261\\304\\237d\\304\\261r\\tCtrl+0\\0\"\\\n  \"&Geni\\305\\237li\\304\\237e s\\304\\261\\304\\237d\\304\\261r\\tCtrl+2\\0\"\\\n  \"\\304\\260\\303\\247eri\\304\\237e \\303\\266l\\303\\247ekle\\0\"\\\n  \"Sayfaya s\\304\\261\\304\\237d\\304\\261r\\0\"\\\n  \"Geni\\305\\237li\\304\\237e s\\304\\261\\304\\237d\\304\\261r\\0\"\\\n  \"Geni\\305\\237li\\304\\237e \\303\\266l\\303\\247ekle ve sayfalar\\304\\261 devaml\\304\\261 g\\303\\266ster\\0\"\\\n  \"Tek sayfaya \\303\\266l\\303\\247ekle\\0\"\\\n  \"Yaz\\304\\261 Tipleri:\\0\"\\\n  \"Kitap bi\\303\\247imlendiriliyor... %d sayfa\\0\"\\\n  \"Metin %s numaral\\304\\261 sayfada bulundu\\0\"\\\n  \"Metin sayfa %s bulundu (tekrar)\\0\"\\\n  \"S\\304\\261k\\303\\247a okunan\\0\"\\\n  \"\\0\"\\\n  \"Sayfaya git\\0\"\\\n  \"S\\304\\261k\\303\\247a okunan\\304\\261 gizle\\0\"\\\n  \"\\304\\260pucu: yeniden bulmak i\\303\\247in F3 tu\\305\\237unu kullan\\304\\261n\\0\"\\\n  \"G\\303\\266r\\303\\274nt\\303\\274 dosyalar\\304\\261 (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"SumatraPDF'i PDF dosyalar\\304\\261 i\\303\\247in varsay\\304\\261lan uygulama yapmak ister misiniz?\\0\"\\\n  \"Varsay\\304\\261lan PDF okuyucusu yap\\0\"\\\n  \"Man&ga modu\\0\"\\\n  \"B\\303\\274y\\303\\274k/K\\303\\274\\303\\247\\303\\274k harf e\\305\\237le\\305\\237tir\\0\"\\\n  \"Mobi belgeleri\\0\"\\\n  \"De\\304\\237i\\305\\237tirilme tarihi:\\0\"\\\n  \"Yeni s\\303\\274r\\303\\274m %s da\\304\\237\\304\\261t\\304\\261ma sunulmu\\305\\237tur. \\304\\260ndirmek ister misiniz?\\0\"\\\n  \"Sonraki Sayfa\\0\"\\\n  \"Sonu\\303\\247 bulunamad\\304\\261\\0\"\\\n  \"%u sat\\304\\261r\\304\\261 etraf\\304\\261nda %s dosyas\\304\\261ndaki sonu\\303\\247 bulunamad\\304\\261\\0\"\\\n  \"Herhangi bir senkronizasyon dosyas\\304\\261 bulunamad\\304\\261\\0\"\\\n  \"Bu konumda senkronizasyon bilgisi mevcut de\\304\\237ildir\\0\"\\\n  \"Sayfa say\\304\\261s\\304\\261:\\0\"\\\n  \"Tamam\\0\"\\\n  \"&A\\303\\247\\0\"\\\n  \"PDF-XChange ile a\\303\\247\\0\"\\\n  \"Belge a\\303\\247...\\0\"\\\n  \"%s i\\303\\247inde a\\303\\247\\0\"\\\n  \"&Adobe Reader ile a\\303\\247\\0\"\\\n  \"&Adobe Foxit ile a\\303\\247\\0\"\\\n  \"Microsoft HTML Help ile a\\303\\247\\0\"\\\n  \"Microsoft XPS-Viewer ile a\\303\\247\\0\"\\\n  \"\\303\\226&zellikler\\0\"\\\n  \"&\\303\\226zellikleri\\tCtrl+D\\0\"\\\n  \"PDF Belge\\0\"\\\n  \"PDF Optimizasyonlar\\304\\261:\\0\"\\\n  \"PDF \\303\\234retici:\\0\"\\\n  \"PDF S\\303\\274r\\303\\274m\\303\\274:\\0\"\\\n  \"PDF belgeleri\\0\"\\\n  \"&Sayfa...\\tCtrl+G\\0\"\\\n  \"Sayfa %s\\0\"\\\n  \"Sayfa Boyutu:\\0\"\\\n  \"%u numaral\\304\\261 sayfa mevcut de\\304\\237ildir\\0\"\\\n  \"Sayfa \\303\\266l\\303\\247eklendirme\\0\"\\\n  \"Sayfa:\\0\"\\\n  \"PalmDoc belgeleri\\0\"\\\n  \"Bekleyiniz - olu\\305\\237turulmakta...\\0\"\\\n  \"Postscript belgeleri\\0\"\\\n  \"Tan&\\304\\261t\\304\\261m\\tCtrl+L\\0\"\\\n  \"\\303\\226nceki Sayfa\\0\"\\\n  \"Yazd\\304\\261r\\0\"\\\n  \"Bask\\304\\261 aral\\304\\261\\304\\237\\304\\261\\0\"\\\n  \"Girilen isimli Yaz\\304\\261c\\304\\261 bulunamad\\304\\261\\0\"\\\n  \"Bask\\304\\261 devam ediyor.\\0\"\\\n  \"Yazd\\304\\261rma s\\303\\274r\\303\\274yor. \\304\\260ptal edip \\303\\247\\304\\261kmak istiyor musunuz?\\0\"\\\n  \"Yaz\\304\\261c\\304\\261 hala kullan\\304\\261mda. Durdurup yeniden ba\\305\\237lat\\304\\261ls\\304\\261nm\\304\\261?\\0\"\\\n  \"Sayfa %d %d yazd\\304\\261r\\304\\261l\\304\\261yor...\\0\"\\\n  \"Yazd\\304\\261rma problemi.\\0\"\\\n  \"\\304\\260sim De\\304\\237i\\305\\237tir\\0\"\\\n  \"&A\\303\\247\\304\\261lan dosyalar\\304\\261 hat\\304\\261rla\\0\"\\\n  \"S\\304\\261k kullan\\304\\261lanlardan \\303\\247\\304\\261kar\\0\"\\\n  \"Sayfa %s s\\304\\261k kullan\\304\\261lanlardan \\303\\247\\304\\261kar\\0\"\\\n  \"Belirtilen \\304\\260sme De\\304\\237i\\305\\237tir\\0\"\\\n  \"S&ola \\303\\247evir\\tCtrl+Shift+-\\0\"\\\n  \"&Sa\\304\\237a \\303\\247evir\\tCtrl+Shift++\\0\"\\\n  \"Farkl\\304\\261 kaydet\\0\"\\\n  \"K&\\304\\261sayolu kaydet...\\tCtrl+Shift+S\\0\"\\\n  \"%d sayfa (toplam %d sayfa) taran\\304\\261yor...\\0\"\\\n  \"&Hepsini Se\\303\\247\\0\"\\\n  \"T&\\303\\274m\\303\\274n\\303\\274 Se\\303\\247\\tCtrl+A\\0\"\\\n  \"\\304\\260\\303\\247eri\\304\\237i Ctrl+sol fare butonu ile se\\303\\247\\0\"\\\n  \"Se\\303\\247im:\\0\"\\\n  \"&E-mail ile yolla...\\0\"\\\n  \"Sondan ba\\305\\237a arama komut sat\\304\\261r\\304\\261\\0\"\\\n  \"G\\303\\266ster &S\\304\\261k Kullan\\304\\261lanlar\\0\"\\\n  \"&Sayfalar\\304\\261 devaml\\304\\261 g\\303\\266ster\\0\"\\\n  \"&Ara\\303\\247 \\303\\247ubu\\304\\237unu g\\303\\266ster\\0\"\\\n  \"S\\304\\261k kullan\\304\\261lanlar\\304\\261 g\\303\\266ster\\0\"\\\n  \"S\\304\\261k okunanlar\\304\\261 g\\303\\266ster\\0\"\\\n  \"Yer &imleri yan \\303\\247ubu\\304\\237unu bulundu\\304\\237unda g\\303\\266ster\\0\"\\\n  \"Tek sayfa\\0\"\\\n  \"\\303\\234zg\\303\\274n\\303\\274z, bu olmamal\\304\\261yd\\304\\261!\\n\\nE\\304\\237er hatay\\304\\261 d\\303\\274zeltmemize yard\\304\\261mc\\304\\261 olmak istiyorsan\\304\\261z l\\303\\274tfen 'Cancel' a bas\\304\\261n.\\0\"\\\n  \"%s kaynak dosyas\\304\\261nda senkronizasyon noktas\\304\\261 yoktur\\0\"\\\n  \"Konu:\\0\"\\\n  \"SumatraPDF Se\\303\\247enekleri\\0\"\\\n  \"SumatraPDF G\\303\\274ncelleme\\0\"\\\n  \"SumatraPDF \\303\\247\\303\\266kt\\303\\274\\0\"\\\n  \"SumatraPDF varsay\\304\\261lan PDF okuyucunuz.\\0\"\\\n  \"SumatraPDF art\\304\\261k varsay\\304\\261lan PDF okuyucunuzdur\\0\"\\\n  \"Senkronizasyon dosyas\\304\\261 a\\303\\247\\304\\261lamad\\304\\261\\0\"\\\n  \"\\304\\260\\305\\237aretlenmi\\305\\237 PDF\\0\"\\\n  \"Metin belgeler\\0\"\\\n  \"Bu belge desteklenmeyen \\303\\266zellikler i\\303\\247eriyor (%s) ve do\\304\\237ru g\\303\\266r\\303\\274nt\\303\\274lenemeyebilir\\0\"\\\n  \"Ba\\305\\237l\\304\\261k:\\0\"\\\n  \"Bilinmeyen kaynak dosyas\\304\\261 (%s)\\0\"\\\n  \"&Sekmeler kullan\\0\"\\\n  \"G\\303\\266r\\303\\274n\\303\\274m\\0\"\\\n  \"&Website ziyaret et\\0\"\\\n  \"Uyar\\304\\261\\0\"\\\n  \"XPS belgeleri\\0\"\\\n  \"G\\303\\274ncel s\\303\\274r\\303\\274m\\303\\274 kullan\\304\\261yorsunuz.\\0\"\\\n  \"Kulland\\304\\261\\304\\237\\304\\261n\\304\\261z s\\303\\274r\\303\\274m: %s\\0\"\\\n  \"Yak\\304\\261nla\\305\\237t\\304\\261rma\\0\"\\\n  \"Yak\\304\\261nla\\305\\237t\\304\\261r\\0\"\\\n  \"Uzakla\\305\\237t\\304\\261r\\0\"\\\n  \"Yak\\304\\261nla\\305\\237t\\304\\261rma fakt\\303\\266r\\303\\274\\0\"\\\n  \"[De\\304\\237i\\305\\237iklik tespit edildi; g\\303\\274ncelleniyor] %s\\0\"\\\n  \"metin kopyalan\\304\\261yor\\0\"\\\n  \"belge yazd\\304\\261r\\304\\261l\\304\\261yor\\0\";\n\nconst char * gTranslations_uk = \n  \"\\320\\237\\321\\200\\320\\276 \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\321\\203...\\0\"\\\n  \"\\320\\241\\320\\277\\321\\200\\320\\260\\320\\262\\320\\266\\320\\275\\321\\226\\320\\271 \\321\\200\\320\\276\\320\\267\\320\\274\\321\\226\\321\\200\\tCtrl+1\\0\"\\\n  \"\\320\\240\\320\\276\\320\\267\\321\\210\\320\\270\\321\\200\\320\\265\\320\\275\\321\\226 \\320\\275\\320\\260\\320\\273\\320\\260\\321\\210\\321\\202\\321\\203\\320\\262\\320\\260\\320\\275\\320\\275\\321\\217...\\0\"\\\n  \"\\320\\236\\320\\261\\321\\200\\320\\260\\320\\275\\320\\276 \\320\\262\\321\\201\\321\\226 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\270\\0\"\\\n  \"\\320\\235\\320\\260\\320\\267\\320\\260\\320\\264\\tAlt+\\320\\233\\321\\226\\320\\262\\320\\260 \\321\\201\\321\\202\\321\\200\\321\\226\\320\\273\\320\\272\\320\\260\\0\"\\\n  \"\\320\\232\\320\\275\\320\\270\\320\\266\\320\\275\\320\\260 \\321\\200\\320\\276\\320\\267\\320\\263\\320\\276\\321\\200\\321\\202\\320\\272\\320\\260\\tCtrl+8\\0\"\\\n  \"&\\320\\227\\320\\260\\320\\272\\321\\200\\320\\270\\321\\202\\320\\270\\tCtrl+W\\0\"\\\n  \"\\320\\241\\320\\272\\320\\276\\320\\277\\321\\226\\321\\216\\320\\262\\320\\260\\321\\202\\320\\270 \\320\\262\\320\\270\\320\\261\\321\\200\\320\\260\\320\\275\\320\\265\\0\"\\\n  \"\\320\\241\\320\\272\\320\\276\\320\\277\\321\\226\\321\\216\\320\\262\\320\\260\\321\\202\\320\\270 \\320\\262\\320\\270\\320\\261\\321\\200\\320\\260\\320\\275\\320\\265\\tCtrl+C\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\277\\320\\270\\321\\202\\320\\260\\321\\202\\320\\270 \\320\\267\\320\\275\\320\\276\\320\\262\\321\\203\\0\"\\\n  \"\\320\\242\\321\\226\\320\\273\\321\\214\\320\\272\\320\\270 \\320\\277\\320\\260\\321\\200\\320\\275\\321\\226 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\270\\0\"\\\n  \"\\320\\224\\320\\262\\321\\226 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\270\\tCtrl+7\\0\"\\\n  \"&\\320\\244\\320\\260\\320\\271\\320\\273\\0\"\\\n  \"\\320\\251\\320\\276 \\321\\210\\321\\203\\320\\272\\320\\260\\321\\202\\320\\270:\\0\"\\\n  \"\\320\\237\\320\\265\\321\\200\\321\\210\\320\\260 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\260\\tHome\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\277\\320\\260\\321\\201\\320\\276\\320\\262\\321\\203\\320\\262\\320\\260\\321\\202\\320\\270 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\270 \\320\\264\\320\\276 \\320\\267\\320\\276\\320\\275\\320\\270 \\320\\264\\321\\200\\321\\203\\320\\272\\321\\203\\0\"\\\n  \"&\\320\\237\\320\\265\\321\\200\\320\\265\\320\\271\\321\\202\\320\\270\\0\"\\\n  \"\\320\\237\\320\\265\\321\\200\\320\\265\\320\\271\\321\\202\\320\\270 \\320\\275\\320\\260 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\321\\203:\\0\"\\\n  \"&\\320\\224\\320\\276\\320\\277\\320\\276\\320\\274\\320\\276\\320\\263\\320\\260\\0\"\\\n  \"\\320\\236\\321\\201\\321\\202\\320\\260\\320\\275\\320\\275\\321\\217 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\260\\tEnd\\0\"\\\n  \"\\320\\234\\320\\260\\321\\201\\321\\210\\321\\202\\320\\260\\320\\261\\321\\203\\320\\262\\320\\260\\320\\275\\320\\275\\321\\217:\\0\"\\\n  \"\\320\\232\\320\\265\\321\\200\\321\\226\\320\\262\\320\\275\\320\\270\\321\\206\\321\\202\\320\\262\\320\\276 \\320\\267 \\320\\272\\320\\276\\321\\200\\320\\270\\321\\201\\321\\202\\321\\203\\320\\262\\320\\260\\320\\275\\320\\275\\321\\217\\0\"\\\n  \"\\320\\222\\321\\200\\320\\260\\321\\205\\320\\276\\320\\262\\321\\203\\320\\262\\320\\260\\321\\202\\320\\270 \\321\\200\\320\\265\\320\\263\\321\\226\\321\\201\\321\\202\\321\\200\\0\"\\\n  \"\\320\\235\\320\\260\\321\\201\\321\\202\\321\\203\\320\\277\\320\\275\\320\\260 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\260\\t->\\0\"\\\n  \"\\320\\235\\321\\226\\0\"\\\n  \"\\320\\235\\321\\226, \\320\\264\\321\\217\\320\\272\\321\\203\\321\\216\\0\"\\\n  \"\\320\\242\\321\\226\\320\\273\\321\\214\\320\\272\\320\\270 \\320\\275\\320\\265\\320\\277\\320\\260\\321\\200\\320\\275\\321\\226 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\270\\0\"\\\n  \"\\320\\222\\321\\226\\320\\264\\320\\272\\321\\200\\320\\270\\321\\202\\320\\270 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"\\320\\222\\321\\226\\320\\264\\320\\272\\321\\200\\320\\270\\321\\202\\320\\270...\\tCtrl+O\\0\"\\\n  \"\\320\\236\\320\\277\\321\\206\\321\\226\\321\\227...\\0\"\\\n  \"\\320\\237\\320\\260\\321\\200\\320\\276\\320\\273\\321\\214:\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202 pin\\0\"\\\n  \"\\320\\237\\320\\276\\320\\277\\320\\265\\321\\200\\320\\265\\320\\264\\320\\275\\321\\217 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\260\\t<-\\0\"\\\n  \"\\320\\224\\321\\200\\321\\203\\320\\272...\\0\"\\\n  \"&\\320\\224\\321\\200\\321\\203\\320\\272\\321\\203\\320\\262\\320\\260\\321\\202\\320\\270...\\tCtrl+P\\0\"\\\n  \"\\320\\224\\321\\200\\321\\203\\320\\272... (\\320\\262\\321\\226\\320\\264\\321\\205\\320\\270\\320\\273\\320\\265\\320\\275\\320\\276)\\0\"\\\n  \"\\320\\237\\320\\260\\320\\274'\\321\\217\\321\\202\\320\\260\\321\\202\\320\\270 \\320\\277\\320\\260\\321\\200\\320\\276\\320\\273\\321\\214 \\320\\264\\320\\273\\321\\217 \\320\\264\\320\\260\\320\\275\\320\\276\\320\\263\\320\\276 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\260\\0\"\\\n  \"\\320\\227\\320\\261\\320\\265\\321\\200\\320\\265\\320\\263\\321\\202\\320\\270 \\320\\275\\320\\260\\320\\273\\320\\260\\321\\210\\321\\202\\321\\203\\320\\262\\320\\260\\320\\275\\320\\275\\321\\217 \\320\\264\\320\\273\\321\\217 \\320\\272\\320\\276\\320\\266\\320\\275\\320\\276\\320\\263\\320\\276 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\260\\0\"\\\n  \"\\320\\222\\320\\270\\320\\264\\320\\260\\320\\273\\320\\270\\321\\202\\320\\270 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"\\320\\227\\320\\261\\320\\265\\321\\200\\320\\265\\320\\263\\321\\202\\320\\270 \\321\\217\\320\\272...\\0\"\\\n  \"\\320\\227\\320\\261&\\320\\265\\321\\200\\320\\265\\320\\263\\321\\202\\320\\270 \\321\\217\\320\\272...\\tCtrl+S\\0\"\\\n  \"\\320\\235\\320\\260\\320\\273\\320\\260\\321\\210\\321\\202\\321\\203\\320\\262\\320\\260\\320\\275\\320\\275\\321\\217\\0\"\\\n  \"\\320\\243\\321\\200\\321\\226\\320\\267\\320\\260\\321\\202\\320\\270 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\270 \\320\\264\\320\\276 \\320\\267\\320\\276\\320\\275\\320\\270 \\320\\264\\321\\200\\321\\203\\320\\272\\321\\203 (\\320\\277\\321\\200\\320\\270 \\320\\275\\320\\265\\320\\276\\320\\261\\321\\205\\321\\226\\320\\264\\320\\275\\320\\276\\321\\201\\321\\202\\321\\226)\\0\"\\\n  \"\\320\\236\\320\\264\\320\\275\\320\\260 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\260\\tCtrl+6\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\277\\321\\203\\321\\201\\321\\202\\320\\270\\321\\202\\320\\270 \\321\\206\\321\\216 \\320\\262\\320\\265\\321\\200\\321\\201\\321\\226\\321\\216.\\0\"\\\n  \"\\320\\222\\320\\270\\320\\272\\320\\276\\321\\200\\320\\270\\321\\201\\321\\202\\320\\276\\320\\262\\321\\203\\320\\262\\320\\260\\321\\202\\320\\270 \\320\\276\\321\\200\\320\\270\\320\\263\\321\\226\\320\\275\\320\\260\\320\\273\\321\\214\\320\\275\\321\\226 \\321\\200\\320\\276\\320\\267\\320\\274\\321\\226\\321\\200\\320\\270 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\270\\0\"\\\n  \"\\320\\222\\320\\270&\\320\\263\\320\\273\\321\\217\\320\\264\\0\"\\\n  \"&\\320\\222\\321\\226\\320\\272\\320\\275\\320\\276\\0\"\\\n  \"\\320\\242\\320\\260\\320\\272\\0\"\\\n  \"&\\320\\227\\320\\261\\321\\226\\320\\273\\321\\214\\321\\210\\320\\265\\320\\275\\320\\275\\321\\217\\0\"\\\n  \"(\\320\\267 %d)\\0\"\\\n  \"(\\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\260 %s)\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276 \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\321\\203 SumatraPDF\\0\"\\\n  \"\\320\\224\\320\\276\\320\\264\\320\\260\\321\\202\\320\\270 \\320\\267\\320\\260\\320\\272\\320\\273\\320\\260\\320\\264\\320\\272\\321\\203\\0\"\\\n  \"\\320\\224\\320\\276\\320\\264\\320\\260\\321\\202\\320\\270 %s \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\321\\203 \\320\\264\\320\\276 \\320\\267\\320\\260\\320\\272\\320\\273\\320\\260\\320\\264\\320\\276\\320\\272\\0\"\\\n  \"\\320\\224\\320\\276\\320\\264\\320\\260\\321\\202\\320\\270 %s \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\321\\203 \\320\\264\\320\\276 \\320\\267\\320\\260\\320\\272\\320\\273\\320\\260\\320\\264\\320\\276\\320\\272 \\320\\267 \\321\\226\\320\\274\\320\\265\\320\\275\\320\\265\\320\\274(\\320\\275\\320\\265\\320\\276\\320\\261\\320\\276\\320\\262'\\321\\217\\320\\267\\320\\272\\320\\276\\320\\262\\320\\276):\\0\"\\\n  \"\\320\\224\\320\\276\\320\\264\\320\\260\\321\\202\\320\\270 \\320\\264\\320\\276 \\320\\267\\320\\260\\320\\272\\320\\273\\320\\260\\320\\264\\320\\276\\320\\272\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\321\\201\\321\\203\\320\\275\\321\\203\\321\\202\\321\\226\\0\"\\\n  \"\\320\\222\\321\\201\\321\\226 \\321\\204\\320\\260\\320\\271\\320\\273\\320\\270\\0\"\\\n  \"\\320\\222\\321\\201\\321\\226 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270, \\321\\211\\320\\276 \\320\\277\\321\\226\\320\\264\\321\\202\\321\\200\\320\\270\\320\\274\\321\\203\\321\\216\\321\\202\\321\\214\\321\\201\\321\\217\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\272\\320\\273\\320\\260\\320\\264\\320\\275\\320\\260 \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\320\\260:\\0\"\\\n  \"\\320\\220\\321\\201\\320\\276\\321\\206\\321\\226\\321\\216\\320\\262\\320\\260\\321\\202\\320\\270 \\320\\267 PDF-\\321\\204\\320\\260\\320\\271\\320\\273\\320\\260\\320\\274\\320\\270?\\0\"\\\n  \"\\320\\224\\320\\276\\320\\264\\320\\260\\321\\202\\320\\276\\320\\272: %s\\0\"\\\n  \"\\320\\220\\320\\262\\321\\202\\320\\276\\321\\200:\\0\"\\\n  \"\\320\\220\\320\\262\\321\\202\\320\\276\\320\\274\\320\\260\\321\\202\\320\\270\\321\\207\\320\\275\\320\\276\\0\"\\\n  \"\\320\\220\\320\\262\\321\\202\\320\\276\\320\\274\\320\\260\\321\\202\\320\\270\\321\\207\\320\\275\\320\\260 \\320\\277\\320\\265\\321\\200\\320\\265\\320\\262\\321\\226\\321\\200\\320\\272\\320\\260 \\320\\276\\320\\275\\320\\276\\320\\262\\320\\273\\320\\265\\320\\275\\321\\214\\0\"\\\n  \"\\320\\232\\320\\275\\320\\270\\320\\266\\320\\275\\320\\260 \\321\\200\\320\\276\\320\\267\\320\\263\\320\\276\\321\\200\\321\\202\\320\\272\\320\\260\\0\"\\\n  \"\\320\\227\\320\\260\\320\\272\\320\\273\\320\\260\\320\\264\\320\\272\\320\\270\\tF12\\0\"\\\n  \"\\320\\227\\320\\260\\320\\272\\320\\273\\320\\260\\320\\264\\320\\272\\320\\260 \\321\\217\\321\\200\\320\\273\\320\\270\\320\\272\\321\\226\\320\\262\\0\"\\\n  \"\\320\\227\\320\\260\\320\\272\\320\\273\\320\\260\\320\\264\\320\\272\\320\\260 \\321\\217\\321\\200\\320\\273\\320\\270\\320\\272\\320\\260 \\320\\275\\320\\260 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\321\\203 %s \\320\\267 %s\\0\"\\\n  \"\\320\\227\\320\\260\\320\\272\\320\\273\\320\\260\\320\\264\\320\\272\\320\\270\\0\"\\\n  \"\\320\\221\\320\\260\\320\\271\\321\\202\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270 CHM\\0\"\\\n  \"\\320\\235\\320\\265\\320\\274\\320\\276\\320\\266\\320\\273\\320\\270\\320\\262\\320\\276 \\320\\277\\321\\226\\320\\264'\\321\\224\\320\\264\\320\\275\\320\\260\\321\\202\\320\\270\\321\\201\\321\\214 \\320\\264\\320\\276 \\321\\226\\320\\275\\321\\202\\320\\265\\321\\200\\320\\275\\320\\265\\321\\202\\321\\203 (\\320\\277\\320\\276\\320\\274\\320\\270\\320\\273\\320\\272\\320\\260 %#x).\\0\"\\\n  \"\\320\\241\\320\\272\\320\\260\\321\\201\\321\\203\\320\\262\\320\\260\\321\\202\\320\\270\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\321\\203 \\320\\275\\320\\260\\320\\264\\321\\200\\321\\203\\320\\272\\321\\203\\320\\262\\320\\260\\321\\202\\320\\270 \\321\\206\\320\\265\\320\\271 \\321\\204\\320\\260\\320\\271\\320\\273\\0\"\\\n  \"\\320\\235\\320\\265\\320\\274\\320\\276\\320\\266\\320\\273\\320\\270\\320\\262\\320\\276 \\320\\267\\320\\260\\320\\277\\321\\203\\321\\201\\321\\202\\320\\270\\321\\202\\320\\270 \\320\\272\\320\\276\\320\\274\\320\\260\\320\\275\\320\\264\\321\\203 \\320\\267\\320\\262\\320\\276\\321\\200\\320\\276\\321\\202\\320\\275\\321\\214\\320\\276\\320\\263\\320\\276 \\320\\277\\320\\276\\321\\210\\321\\203\\320\\272\\321\\203. \\320\\237\\320\\265\\321\\200\\320\\265\\320\\262\\321\\226\\321\\200\\321\\202\\320\\265 \\320\\275\\320\\260\\320\\273\\320\\260\\321\\210\\321\\203\\321\\202\\320\\262\\320\\260\\320\\275\\320\\275\\321\\217 \\320\\272\\320\\276\\320\\274\\320\\260\\320\\275\\320\\264\\320\\275\\320\\276\\320\\263\\320\\276 \\321\\200\\321\\217\\320\\264\\320\\272\\320\\260.\\0\"\\\n  \"\\320\\227\\320\\274\\321\\226\\320\\275\\320\\270\\321\\202\\320\\270 \\320\\274\\320\\276\\320\\262\\321\\203 (Change Language)\\0\"\\\n  \"\\320\\237\\320\\265\\321\\200\\320\\265\\320\\262\\321\\226\\321\\200\\320\\270\\321\\202\\320\\270, \\321\\207\\320\\270 \\321\\224 \\320\\275\\320\\276\\320\\262\\320\\260 \\320\\262\\320\\265\\321\\200\\321\\201\\321\\226\\321\\217\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270 CBR, CBZ (\\320\\272\\320\\276\\320\\274\\321\\226\\320\\272\\321\\201\\320\\270)\\0\"\\\n  \"\\320\\241\\321\\203\\320\\274\\321\\226\\321\\201\\320\\275\\321\\226\\321\\201\\321\\202\\321\\214\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\321\\202\\321\\217\\320\\266\\320\\275\\320\\270\\320\\271\\0\"\\\n  \"\\320\\232\\320\\275\\320\\270\\320\\266\\320\\272\\320\\276\\320\\262\\320\\270\\320\\271 \\320\\261\\320\\265\\320\\267\\320\\277\\320\\265\\321\\200\\320\\265\\321\\200\\320\\262\\320\\275\\320\\270\\320\\271\\0\"\\\n  \"\\320\\224\\320\\262\\321\\226 \\320\\277\\321\\200\\320\\276\\321\\202\\321\\217\\320\\266\\320\\275\\321\\226 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\270\\0\"\\\n  \"\\320\\224\\320\\276\\320\\277\\320\\276\\320\\274\\320\\276\\320\\266\\321\\226\\321\\202\\321\\214 \\320\\277\\320\\265\\321\\200\\320\\265\\320\\272\\320\\273\\320\\260\\321\\201\\321\\202\\320\\270\\0\"\\\n  \"\\320\\241\\320\\272\\320\\276\\320\\277\\321\\226\\321\\216\\320\\262\\320\\260\\321\\202\\320\\270 \\320\\267\\320\\276\\320\\261\\321\\200\\320\\260\\320\\266\\320\\265\\320\\275\\320\\275\\321\\217\\0\"\\\n  \"\\320\\232\\320\\276\\320\\277\\321\\226\\321\\216\\320\\262\\320\\260\\321\\202\\320\\270 \\320\\260\\320\\264\\321\\200\\320\\265\\321\\201\\320\\275\\321\\203 \\321\\201\\321\\202\\321\\200\\321\\226\\321\\207\\320\\272\\321\\203\\0\"\\\n  \"\\320\\232\\320\\276\\320\\277\\321\\226\\321\\216\\320\\262\\320\\260\\321\\202\\320\\270 \\320\\272\\320\\276\\320\\274\\320\\265\\320\\275\\321\\202\\320\\260\\321\\200\\0\"\\\n  \"\\320\\232\\320\\276\\320\\277\\321\\226\\321\\216\\320\\262\\320\\260\\320\\275\\320\\275\\321\\217 \\321\\202\\320\\265\\320\\272\\321\\201\\321\\202\\321\\203 \\320\\267\\320\\260\\320\\261\\320\\276\\321\\200\\320\\276\\320\\275\\320\\265\\320\\275\\320\\276 (\\321\\202\\321\\226\\320\\273\\321\\214\\320\\272\\320\\270 \\321\\217\\320\\272 \\320\\267\\320\\276\\320\\261\\321\\200\\320\\260\\320\\266\\320\\265\\320\\275\\320\\275\\321\\217)\\0\"\\\n  \"\\320\\232\\320\\276\\320\\277\\321\\226\\321\\200\\320\\260\\320\\271\\321\\202:\\0\"\\\n  \"\\320\\235\\320\\265\\320\\274\\320\\276\\320\\266\\320\\273\\320\\270\\320\\262\\320\\276 \\320\\276\\321\\202\\321\\200\\320\\270\\320\\274\\320\\260\\321\\202\\320\\270 \\320\\275\\320\\260\\320\\273\\320\\260\\321\\210\\321\\202\\321\\203\\320\\262\\320\\260\\320\\275\\320\\275\\321\\217 \\320\\277\\321\\200\\320\\270\\320\\275\\321\\202\\320\\265\\321\\200\\320\\260\\0\"\\\n  \"\\320\\235\\320\\265\\320\\274\\320\\276\\320\\266\\320\\273\\320\\270\\320\\262\\320\\276 \\320\\267\\320\\275\\320\\260\\320\\271\\321\\202\\320\\270 \\320\\264\\321\\200\\321\\203\\320\\272\\320\\260\\321\\200\\320\\272\\321\\203\\0\"\\\n  \"\\320\\235\\320\\265\\320\\274\\320\\276\\320\\266\\320\\273\\320\\270\\320\\262\\320\\276 \\320\\267\\320\\263\\320\\265\\320\\275\\320\\265\\321\\200\\321\\203\\320\\262\\320\\260\\321\\202\\320\\270(\\320\\262\\321\\226\\320\\264\\320\\276\\320\\261\\321\\200\\320\\260\\320\\267\\320\\270\\321\\202\\320\\270) \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\321\\203\\0\"\\\n  \"\\320\\241\\321\\202\\320\\262\\320\\276\\321\\200\\320\\265\\320\\275\\320\\276:\\0\"\\\n  \"\\320\\237\\320\\276\\321\\202\\320\\276\\321\\207\\320\\275\\320\\270\\320\\271 \\321\\204\\320\\260\\320\\271\\320\\273\\0\"\\\n  \"\\320\\237\\320\\276\\320\\267\\320\\270\\321\\206\\321\\226\\321\\217 \\320\\262\\320\\272\\320\\260\\320\\267\\321\\226\\320\\262\\320\\275\\320\\270\\320\\272\\320\\260:\\0\"\\\n  \"\\320\\222\\320\\272\\320\\260\\320\\267\\320\\260\\321\\202\\320\\270 \\320\\274\\320\\260\\321\\201\\321\\210\\321\\202\\320\\260\\320\\261...\\tCtrl+Y\\0\"\\\n  \"\\320\\240\\320\\276\\320\\267\\321\\202\\320\\260\\321\\210\\321\\203\\320\\262\\320\\260\\320\\275\\320\\275\\321\\217 \\320\\267\\320\\260 \\320\\267\\320\\260\\320\\274\\320\\276\\320\\262\\321\\207\\321\\203\\320\\262\\320\\260\\320\\275\\320\\275\\321\\217\\320\\274:\\0\"\\\n  \"\\320\\234\\320\\260\\321\\201\\321\\210\\321\\202\\320\\260\\320\\261 \\320\\267\\320\\260 \\320\\267\\320\\260\\320\\274\\320\\276\\320\\262\\321\\207\\321\\203\\320\\262\\320\\260\\320\\275\\320\\275\\321\\217\\320\\274:\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\275\\320\\260 \\320\\267\\320\\274\\321\\226\\320\\275\\320\\270\\321\\202\\320\\270 \\321\\210\\321\\202\\320\\260\\321\\202\\320\\275\\320\\270\\320\\271 \\320\\277\\320\\265\\321\\200\\320\\265\\320\\263\\320\\273\\321\\217\\320\\264\\320\\260\\321\\207 PDF \\321\\203 \\320\\277\\320\\276\\321\\200\\321\\202\\320\\260\\321\\202\\320\\270\\320\\262\\320\\275\\320\\276\\320\\274\\321\\203 \\321\\200\\320\\265\\320\\266\\320\\270\\320\\274\\321\\226\\0\"\\\n  \"\\320\\243 \\320\\264\\320\\276\\321\\201\\321\\202\\321\\203\\320\\277\\321\\226 \\320\\262\\321\\226\\320\\264\\320\\274\\320\\276\\320\\262\\320\\273\\320\\265\\320\\275\\320\\276:\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270 DjVu\\0\"\\\n  \"\\320\\222\\320\\273\\320\\260\\321\\201\\321\\202\\320\\270\\320\\262\\320\\276\\321\\201\\321\\202\\321\\226 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\260\\0\"\\\n  \"\\320\\227\\320\\260\\320\\262\\320\\260\\320\\275\\321\\202\\320\\260\\320\\266\\320\\270\\321\\202\\320\\270\\0\"\\\n  \"&\\320\\222\\320\\270\\320\\271\\321\\202\\320\\270\\tCtrl+Q\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270 EPUB\\0\"\\\n  \"\\320\\222\\320\\262\\320\\265\\320\\264\\321\\226\\321\\202\\321\\214 \\320\\277\\320\\260\\321\\200\\320\\276\\320\\273\\321\\214\\0\"\\\n  \"\\320\\222\\320\\262\\320\\265\\320\\264\\321\\226\\321\\202\\321\\214 \\320\\277\\320\\260\\321\\200\\320\\276\\320\\273\\321\\214 \\320\\264\\320\\273\\321\\217 %s\\0\"\\\n  \"\\320\\222\\320\\262\\320\\265\\320\\264\\321\\226\\321\\202\\321\\214 \\320\\272\\320\\276\\320\\274\\320\\260\\320\\275\\320\\264\\320\\275\\321\\203 \\321\\201\\321\\202\\321\\200\\321\\226\\321\\207\\320\\272\\321\\203, \\321\\211\\320\\276 \\320\\262\\320\\270\\320\\272\\320\\273\\320\\270\\320\\272\\320\\260\\321\\224\\321\\202\\321\\214\\321\\201\\321\\217 \\320\\277\\321\\200\\320\\270 \\320\\277\\320\\276\\320\\264\\320\\262\\321\\226\\320\\271\\320\\275\\320\\276\\320\\274\\321\\203 \\320\\272\\320\\273\\320\\260\\321\\206\\320\\260\\320\\275\\321\\226 \\320\\275\\320\\260 PDF-\\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\321\\226:\\0\"\\\n  \"\\320\\237\\320\\276\\320\\274\\320\\270\\320\\273\\320\\272\\320\\260 \\320\\267\\320\\260\\320\\262\\320\\260\\320\\275\\321\\202\\320\\260\\320\\266\\320\\265\\320\\275\\320\\275\\321\\217 %s\\0\"\\\n  \"\\320\\227\\320\\260\\320\\272\\320\\273\\320\\260\\320\\264\\320\\272\\320\\270\\0\"\\\n  \"\\320\\222\\320\\277\\320\\265\\321\\200\\320\\265\\320\\264\\tAlt+\\320\\237\\321\\200\\320\\260\\320\\262\\320\\260 \\321\\201\\321\\202\\321\\200\\321\\226\\320\\273\\320\\272\\320\\260\\0\"\\\n  \"\\320\\235\\320\\260 \\321\\206\\321\\226\\320\\273\\320\\270\\320\\271 \\320\\265\\320\\272\\321\\200\\320\\260\\320\\275\\tCtrl+Shift+L\\0\"\\\n  \"\\320\\224\\320\\262\\321\\226 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\270\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\262\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\217 \\320\\277\\320\\265\\321\\200\\320\\265\\320\\271\\320\\274\\320\\265\\320\\275\\321\\203\\320\\262\\320\\260\\321\\202\\320\\270 \\321\\204\\320\\260\\320\\271\\320\\273!\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\262\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\217 \\320\\267\\320\\261\\320\\265\\321\\200\\320\\265\\320\\263\\321\\202\\320\\270 \\321\\204\\320\\260\\320\\271\\320\\273.\\0\"\\\n  \"\\320\\250\\320\\262\\320\\270\\320\\264\\320\\272\\320\\270\\320\\271 \\320\\262\\320\\265\\320\\261 \\320\\277\\320\\265\\321\\200\\320\\265\\320\\263\\320\\273\\321\\217\\320\\264\\0\"\\\n  \"\\320\\227\\320\\260\\320\\272\\320\\273\\320\\260\\320\\264\\320\\272\\320\\270\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270 FictionBook\\0\"\\\n  \"\\320\\244\\320\\260\\320\\271\\320\\273 %s \\320\\275\\320\\265 \\320\\267\\320\\275\\320\\260\\320\\271\\320\\264\\320\\265\\320\\275\\320\\276\\0\"\\\n  \"\\320\\240\\320\\276\\320\\267\\320\\274\\321\\226\\321\\200 \\321\\204\\320\\260\\320\\271\\320\\273\\320\\260:\\0\"\\\n  \"\\320\\244\\320\\260\\320\\271\\320\\273:\\0\"\\\n  \"\\320\\227\\320\\275\\320\\260\\320\\271\\321\\202\\320\\270...\\tCtrl+F\\0\"\\\n  \"\\320\\227\\320\\275\\320\\260\\320\\271\\321\\202\\320\\270\\0\"\\\n  \"\\320\\227\\320\\275\\320\\260\\320\\271\\321\\202\\320\\270 \\320\\275\\320\\260\\321\\201\\321\\202\\321\\203\\320\\277\\320\\275\\320\\265\\0\"\\\n  \"\\320\\227\\320\\275\\320\\260\\320\\271\\321\\202\\320\\270 \\320\\277\\320\\276\\320\\277\\320\\265\\321\\200\\320\\265\\320\\264\\320\\275\\321\\224\\0\"\\\n  \"\\320\\227\\320\\275\\320\\260\\320\\271\\321\\202\\320\\270:\\0\"\\\n  \"\\320\\240\\320\\276\\320\\267\\320\\274\\321\\226\\321\\201\\321\\202\\320\\270\\321\\202\\320\\270 \\320\\262\\320\\274\\321\\226\\321\\201\\321\\202 \\tCtrl+3\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\277\\320\\260&\\321\\201\\321\\203\\320\\262\\320\\260\\321\\202\\320\\270 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\321\\203\\tCtrl+0\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\277\\320\\260\\321\\201\\321\\203\\320\\262\\320\\260\\321\\202\\320\\270 \\320\\264\\320\\276 &\\321\\210\\320\\270\\321\\200\\320\\270\\320\\275\\320\\270\\tCtrl+2\\0\"\\\n  \"\\320\\240\\320\\276\\320\\267\\320\\274\\321\\226\\321\\201\\321\\202\\320\\270\\321\\202\\320\\270 \\320\\262\\320\\274\\321\\226\\321\\201\\321\\202\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\277\\320\\260\\321\\201\\321\\203\\320\\262\\320\\260\\321\\202\\320\\270 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\321\\203\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\277\\320\\260\\321\\201\\321\\203\\320\\262\\320\\260\\321\\202\\320\\270 \\320\\264\\320\\276 \\321\\210\\320\\270\\321\\200\\320\\270\\320\\275\\320\\270\\0\"\\\n  \"\\320\\240\\320\\276\\320\\267\\320\\274\\321\\226\\321\\201\\321\\202\\320\\270\\321\\202\\320\\270 \\320\\277\\320\\276 \\321\\210\\320\\270\\321\\200\\320\\270\\320\\275\\321\\226 \\320\\275\\320\\260 \\320\\261\\320\\265\\320\\267\\320\\277\\320\\265\\321\\200\\320\\265\\321\\200\\320\\262\\320\\275\\321\\226\\320\\271 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\321\\206\\321\\226\\0\"\\\n  \"\\320\\222\\320\\274\\321\\226\\321\\201\\321\\202\\320\\270\\321\\202\\320\\270 \\320\\275\\320\\260 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\321\\203\\0\"\\\n  \"\\320\\250\\321\\200\\320\\270\\321\\204\\321\\202\\320\\270\\0\"\\\n  \"\\320\\244\\320\\276\\321\\200\\320\\274\\320\\260\\321\\202\\321\\203\\321\\224\\321\\202\\321\\214\\321\\201\\321\\217 \\320\\272\\320\\275\\320\\270\\320\\263\\320\\260... %d \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\276\\320\\272\\0\"\\\n  \"\\320\\227\\320\\275\\320\\260\\320\\271\\321\\202\\320\\270 \\321\\202\\320\\265\\320\\272\\321\\201\\321\\202 \\320\\275\\320\\260 %s \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\321\\206\\321\\226\\0\"\\\n  \"\\320\\227\\320\\275\\320\\260\\320\\271\\321\\202\\320\\270 \\321\\202\\320\\265\\320\\272\\321\\201\\321\\202 \\320\\275\\320\\260 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\321\\206\\321\\226 %s (\\320\\267\\320\\275\\320\\276\\320\\262\\321\\203)\\0\"\\\n  \"\\320\\247\\320\\260\\321\\201\\321\\202\\320\\276 \\321\\207\\320\\270\\321\\202\\320\\260\\320\\275\\321\\226\\0\"\\\n  \"\\0\"\\\n  \"\\320\\237\\320\\265\\321\\200\\320\\265\\320\\271\\321\\202\\320\\270 \\320\\275\\320\\260 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\321\\203\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\321\\205\\320\\276\\320\\262\\320\\260\\321\\202\\320\\270 \\321\\207\\320\\260\\321\\201\\321\\202\\320\\276 \\321\\207\\320\\270\\321\\202\\320\\260\\320\\275\\321\\226\\0\"\\\n  \"\\320\\237\\321\\226\\320\\264\\320\\272\\320\\260\\320\\267\\320\\272\\320\\260: \\320\\224\\320\\273\\321\\217 \\320\\277\\320\\276\\320\\262\\321\\202\\320\\276\\321\\200\\320\\275\\320\\276\\320\\263\\320\\276 \\320\\277\\320\\276\\321\\210\\321\\203\\320\\272\\321\\203 \\320\\275\\320\\260\\321\\202\\320\\270\\321\\201\\320\\275\\321\\226\\321\\202\\321\\214 F3\\0\"\\\n  \"\\320\\244\\320\\260\\320\\271\\320\\273\\320\\270 \\320\\267\\320\\276\\320\\261\\321\\200\\320\\260\\320\\266\\320\\265\\320\\275\\321\\214 (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"\\320\\227\\321\\200\\320\\276\\320\\261\\320\\270\\321\\202\\320\\270 SumatraPDF \\321\\202\\320\\270\\320\\277\\320\\276\\320\\262\\320\\276\\321\\216 \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\320\\276\\321\\216 \\320\\264\\320\\273\\321\\217 PDF-\\321\\204\\320\\260\\320\\271\\320\\273\\321\\226\\320\\262?\\0\"\\\n  \"\\320\\227\\321\\200\\320\\276\\320\\261\\320\\270\\321\\202\\320\\270 SumatraPDF \\320\\277\\320\\265\\321\\200\\320\\265\\320\\263\\320\\273\\321\\217\\320\\264\\320\\260\\321\\207\\320\\265\\320\\274 PDF \\320\\267\\320\\260 \\320\\267\\320\\260\\320\\274\\320\\276\\320\\262\\321\\207\\321\\203\\320\\262\\320\\260\\320\\275\\320\\275\\321\\217\\320\\274\\0\"\\\n  \"\\320\\240\\320\\265\\320\\266\\320\\270\\320\\274 \\320\\274\\320\\260\\320\\275\\320\\263\\320\\270\\0\"\\\n  \"\\320\\240\\320\\276\\320\\267\\321\\200\\321\\226\\320\\267\\320\\275\\321\\217\\321\\202\\320\\270 \\320\\274\\320\\260\\320\\273\\321\\203 \\320\\271 \\320\\262\\320\\265\\320\\273\\320\\270\\320\\272\\321\\203 \\320\\273\\321\\226\\321\\202\\320\\265\\321\\200\\320\\270\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270 Mobi\\0\"\\\n  \"\\320\\227\\320\\274\\321\\226\\320\\275\\320\\265\\320\\275\\320\\276:\\0\"\\\n  \"\\320\\235\\320\\276\\320\\262\\320\\260 \\320\\262\\320\\265\\321\\200\\321\\201\\321\\226\\321\\217 %s \\321\\224 \\320\\264\\320\\276\\321\\201\\321\\202\\321\\203\\320\\277\\320\\275\\320\\276\\321\\216. \\320\\227\\320\\260\\320\\262\\320\\260\\320\\275\\321\\202\\320\\260\\320\\266\\320\\270\\321\\202\\320\\270 \\320\\275\\320\\276\\320\\262\\321\\203 \\320\\262\\320\\265\\321\\200\\321\\201\\321\\226\\321\\216?\\0\"\\\n  \"\\320\\235\\320\\260\\321\\201\\321\\202\\321\\203\\320\\277\\320\\275\\320\\260 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\260\\0\"\\\n  \"\\320\\241\\320\\277\\321\\226\\320\\262\\320\\277\\320\\260\\320\\264\\321\\226\\320\\275\\321\\214 \\320\\275\\320\\265 \\320\\262\\320\\270\\321\\217\\320\\262\\320\\273\\320\\265\\320\\275\\320\\276\\0\"\\\n  \"\\320\\235\\321\\226\\321\\207\\320\\276\\320\\263\\320\\276 \\320\\275\\320\\265 \\320\\267\\320\\275\\320\\260\\320\\271\\320\\264\\320\\265\\320\\275\\320\\276 \\321\\203 \\320\\273\\321\\226\\320\\275\\321\\226\\321\\227 %u \\321\\203 \\321\\204\\320\\260\\320\\271\\320\\273\\321\\226 %s\\0\"\\\n  \"\\320\\244\\320\\260\\320\\271\\320\\273\\320\\270 \\321\\201\\320\\270\\320\\275\\321\\205\\321\\200\\320\\276\\320\\275\\321\\226\\320\\267\\320\\260\\321\\206\\321\\226\\321\\227 \\320\\275\\320\\265 \\320\\267\\320\\275\\320\\260\\320\\271\\320\\264\\320\\265\\320\\275\\320\\276\\0\"\\\n  \"\\320\\235\\320\\265\\320\\274\\320\\260\\321\\224 \\320\\206\\320\\275\\321\\204\\320\\276\\321\\200\\320\\274\\320\\260\\321\\206\\321\\226\\321\\227 \\320\\277\\321\\200\\320\\276 \\321\\201\\320\\270\\320\\275\\321\\205\\321\\200\\320\\276\\320\\275\\321\\226\\320\\267\\320\\260\\321\\206\\321\\226\\321\\216 \\320\\275\\320\\260 \\321\\206\\321\\226\\320\\271 \\320\\277\\320\\276\\320\\267\\320\\270\\321\\206\\321\\226\\321\\227\\0\"\\\n  \"\\320\\232\\321\\226\\320\\273\\321\\214\\320\\272\\321\\226\\321\\201\\321\\202\\321\\214 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\276\\320\\272:\\0\"\\\n  \"\\320\\223\\320\\260\\321\\200\\320\\260\\320\\267\\320\\264\\0\"\\\n  \"\\320\\222\\321\\226\\320\\264\\320\\272\\321\\200\\320\\270\\321\\202\\320\\270\\0\"\\\n  \"\\320\\222\\321\\226\\320\\264\\320\\272\\321\\200\\320\\270\\321\\202\\320\\270 \\321\\203 PDF-XChange\\0\"\\\n  \"\\320\\222\\321\\226\\320\\264\\320\\272\\321\\200\\320\\270\\321\\202\\320\\270 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202...\\0\"\\\n  \"\\320\\262\\321\\226\\320\\264\\320\\272\\321\\200\\320\\270\\321\\202\\320\\270 \\320\\262 %s\\0\"\\\n  \"\\320\\222\\321\\226\\320\\264\\320\\272\\321\\200\\320\\270\\321\\202\\320\\270 \\321\\203 Adobe Reader\\0\"\\\n  \"\\320\\222\\321\\226\\320\\264\\320\\272\\321\\200\\320\\270\\321\\202\\320\\270 \\321\\203 Foxit Reader\\0\"\\\n  \"\\320\\222\\321\\226\\320\\264\\320\\272\\321\\200\\320\\270\\321\\202\\320\\270 \\321\\203 Microsoft HTML Help\\0\"\\\n  \"\\320\\222\\321\\226\\320\\264\\320\\272\\321\\200\\320\\270\\321\\202\\320\\270 \\321\\203 Microsoft XPS-Viewer\\0\"\\\n  \"\\320\\222\\320\\273\\320\\260\\321\\201\\321\\202\\320\\270\\320\\262\\320\\276\\321\\201\\321\\202\\321\\226\\0\"\\\n  \"\\320\\222\\320\\273\\320\\260\\321\\201\\321\\202\\320\\270\\320\\262\\320\\276\\321\\201\\321\\202\\321\\226\\tCtrl+D\\0\"\\\n  \"PDF \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\0\"\\\n  \"\\320\\236\\320\\277\\321\\202\\320\\270\\320\\274\\321\\226\\320\\267\\320\\260\\321\\206\\321\\226\\321\\227 PDF:\\0\"\\\n  \"PDF \\320\\262\\320\\270\\320\\264\\320\\260\\320\\262\\320\\265\\321\\206\\321\\214:\\0\"\\\n  \"\\320\\222\\320\\265\\321\\200\\321\\201\\321\\226\\321\\217 PDF\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270 PDF\\0\"\\\n  \"\\320\\224\\320\\276 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\270...\\tCtrl+G\\0\"\\\n  \"\\320\\241\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\260 %s\\0\"\\\n  \"\\320\\240\\320\\276\\320\\267\\320\\274\\321\\226\\321\\200 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\270:\\0\"\\\n  \"\\320\\235\\320\\265\\321\\226\\321\\201\\320\\275\\321\\203\\321\\216\\321\\207\\320\\270\\320\\271 \\320\\275\\320\\276\\320\\274\\320\\265\\321\\200 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\270 %u\\0\"\\\n  \"\\320\\234\\320\\260\\321\\201\\321\\210\\321\\202\\320\\260\\320\\261 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\270\\0\"\\\n  \"\\320\\241\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\260:\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270 PalmDoc\\0\"\\\n  \"\\320\\227\\320\\260\\321\\207\\320\\265\\320\\272\\320\\260\\320\\271\\321\\202\\320\\265 - \\320\\263\\320\\265\\320\\275\\320\\265\\321\\200\\321\\203\\321\\224\\321\\202\\321\\214\\321\\201\\321\\217...\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270 postscript\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\320\\267\\320\\265\\320\\275\\321\\202\\320\\260\\321\\206\\321\\226\\321\\217\\tCtrl+L\\0\"\\\n  \"\\320\\237\\320\\276\\320\\277\\320\\265\\321\\200\\320\\265\\320\\264\\320\\275\\321\\217 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\260\\0\"\\\n  \"\\320\\224\\321\\200\\321\\203\\320\\272\\0\"\\\n  \"\\320\\234\\320\\265\\320\\266\\321\\226 \\320\\264\\321\\200\\321\\203\\320\\272\\321\\203\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\275\\321\\202\\320\\265\\321\\200\\320\\260 \\320\\267 \\320\\264\\320\\260\\320\\275\\320\\270\\320\\274 \\321\\226\\320\\274\\320\\265\\320\\275\\320\\265\\320\\274 \\320\\275\\320\\265 \\321\\226\\321\\201\\320\\275\\321\\203\\321\\224\\0\"\\\n  \"\\320\\242\\321\\200\\320\\270\\320\\262\\320\\260\\321\\224 \\320\\264\\321\\200\\321\\203\\320\\272.\\0\"\\\n  \"\\320\\224\\321\\200\\321\\203\\320\\272 \\321\\211\\320\\265 \\320\\275\\320\\265 \\320\\267\\320\\260\\320\\262\\320\\265\\321\\200\\321\\210\\320\\265\\320\\275\\320\\276. \\320\\237\\320\\265\\321\\200\\320\\265\\321\\200\\320\\262\\320\\260\\321\\202\\320\\270 \\321\\202\\320\\260 \\320\\262\\320\\270\\320\\271\\321\\202\\320\\270?\\0\"\\\n  \"\\320\\224\\321\\200\\321\\203\\320\\272 \\321\\211\\320\\265 \\320\\275\\320\\265 \\320\\267\\320\\260\\320\\262\\320\\265\\321\\200\\321\\210\\320\\265\\320\\275\\320\\276. \\320\\237\\320\\265\\321\\200\\320\\265\\321\\200\\320\\262\\320\\260\\321\\202\\320\\270 \\321\\202\\320\\260 \\321\\200\\320\\276\\320\\267\\320\\277\\320\\276\\321\\207\\320\\260\\321\\202\\320\\270 \\320\\267\\320\\275\\320\\276\\320\\262\\321\\203?\\0\"\\\n  \"\\320\\224\\321\\200\\321\\203\\320\\272 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\276\\320\\272 \\320\\267 %d \\320\\264\\320\\276 %d...\\0\"\\\n  \"\\320\\237\\320\\276\\320\\274\\320\\270\\320\\273\\320\\272\\320\\260 \\320\\264\\321\\200\\321\\203\\320\\272\\321\\203\\320\\262\\320\\260\\320\\275\\320\\275\\321\\217.\\0\"\\\n  \"\\320\\237\\320\\265\\321\\200\\320\\265\\320\\271\\320\\274\\320\\265\\320\\275\\321\\203\\320\\262\\320\\260\\321\\202\\320\\270...\\tF2\\0\"\\\n  \"\\320\\227\\320\\260\\320\\277\\320\\260\\320\\274'\\321\\217\\321\\202\\320\\260\\321\\202\\320\\270 \\320\\262\\321\\226\\320\\264\\320\\272\\321\\200\\320\\270\\321\\202\\321\\226 \\321\\204\\320\\260\\320\\271\\320\\273\\320\\270\\0\"\\\n  \"\\320\\222\\320\\270\\320\\264\\320\\260\\320\\273\\320\\270\\321\\202\\320\\270 \\321\\226\\320\\267 \\320\\267\\320\\260\\320\\272\\320\\273\\320\\260\\320\\264\\320\\276\\320\\272\\0\"\\\n  \"\\320\\222\\320\\270\\320\\264\\320\\260\\320\\273\\320\\270\\321\\202\\320\\270 %s \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\321\\203 \\321\\226\\320\\267 \\320\\267\\320\\260\\320\\272\\320\\273\\320\\260\\320\\264\\320\\276\\320\\272\\0\"\\\n  \"\\320\\237\\320\\265\\321\\200\\320\\265\\320\\271\\320\\274\\320\\265\\320\\275\\321\\203\\320\\262\\320\\260\\321\\202\\320\\270 \\320\\262\\0\"\\\n  \"\\320\\237\\320\\276\\320\\262\\320\\265\\321\\200\\320\\275\\321\\203\\321\\202\\320\\270 \\320\\273\\321\\226\\320\\262\\320\\276\\321\\200\\321\\203\\321\\207\\tCtrl+Shift+-\\0\"\\\n  \"\\320\\237\\320\\276\\320\\262\\320\\265\\321\\200\\320\\275\\321\\203\\321\\202\\320\\270 \\320\\277\\321\\200\\320\\260\\320\\262\\320\\276\\321\\200\\321\\203\\321\\207\\tCtrl+Shift++\\0\"\\\n  \"\\320\\227\\320\\261\\320\\265\\321\\200\\320\\265\\320\\263\\321\\202\\320\\270 \\321\\217\\320\\272\\0\"\\\n  \"\\320\\227\\320\\261\\320\\265\\321\\200\\320\\265\\320\\263\\321\\202\\320\\270 \\321\\217\\321\\200\\320\\273\\320\\270\\320\\272...\\tCtrl+Shift+S\\0\"\\\n  \"\\320\\237\\320\\276\\321\\210\\321\\203\\320\\272 %d \\320\\267 %d...\\0\"\\\n  \"\\320\\222\\320\\270\\320\\261\\321\\200\\320\\260\\321\\202\\320\\270 \\320\\262\\321\\201\\321\\226\\0\"\\\n  \"\\320\\222\\320\\270\\320\\261\\321\\200\\320\\260\\321\\202\\320\\270 \\320\\262\\321\\201\\321\\226\\tCtrl+A\\0\"\\\n  \"\\320\\222\\320\\270\\320\\261\\320\\265\\321\\200\\321\\226\\321\\202\\321\\214 \\320\\262\\320\\274\\321\\226\\321\\201\\321\\202 \\320\\267 \\320\\264\\320\\276\\320\\277\\320\\276\\320\\274\\320\\276\\320\\263\\320\\276\\321\\216 Ctrl+\\320\\273\\321\\226\\320\\262\\320\\260 \\320\\272\\320\\275\\320\\276\\320\\277\\320\\272\\320\\260 \\320\\274\\320\\270\\321\\210\\321\\226\\0\"\\\n  \"\\320\\222\\320\\270\\320\\264\\321\\226\\320\\273\\320\\265\\320\\275\\320\\275\\321\\217:\\0\"\\\n  \"\\320\\235\\320\\260\\320\\264\\321\\226\\321\\201\\320\\273\\320\\260\\321\\202\\320\\270 \\321\\207\\320\\265\\321\\200\\320\\265\\320\\267 E-mail...\\0\"\\\n  \"\\320\\243\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\270\\321\\202\\320\\270 \\320\\267\\320\\262\\320\\276\\321\\200\\320\\276\\321\\202\\320\\275\\321\\226\\320\\271 \\320\\277\\320\\276\\321\\210\\321\\203\\320\\272.\\0\"\\\n  \"\\320\\237\\320\\276\\320\\272\\320\\260\\320\\267\\320\\260\\321\\202\\320\\270 \\320\\267\\320\\260\\320\\272\\320\\273\\320\\260\\320\\264\\320\\272\\320\\270\\0\"\\\n  \"\\320\\222\\321\\226\\320\\264\\320\\276\\320\\261\\321\\200\\320\\260\\320\\266\\320\\260\\321\\202\\320\\270 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\270 \\320\\261\\320\\265\\320\\267\\320\\277\\320\\265\\321\\200\\320\\265\\321\\200\\320\\262\\320\\275\\320\\276\\0\"\\\n  \"\\320\\237\\320\\276\\320\\272\\320\\260\\320\\267\\320\\260\\321\\202\\320\\270 \\320\\277\\320\\260\\320\\275\\320\\265\\320\\273\\321\\214 \\321\\226\\320\\275\\321\\201\\321\\202\\321\\200\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\321\\226\\320\\262\\0\"\\\n  \"\\320\\237\\320\\265\\321\\200\\320\\265\\320\\273\\321\\226\\320\\272 \\320\\267\\320\\260\\320\\272\\320\\273\\320\\260\\320\\264\\320\\276\\320\\272\\0\"\\\n  \"\\320\\235\\320\\260\\320\\271\\320\\261\\321\\226\\320\\273\\321\\214\\321\\210 \\321\\207\\320\\260\\321\\201\\321\\202\\320\\276 \\321\\207\\320\\270\\321\\202\\320\\260\\320\\275\\321\\226\\0\"\\\n  \"\\320\\257\\320\\272\\321\\211\\320\\276 \\320\\264\\320\\276\\321\\201\\321\\202\\321\\203\\320\\277\\320\\275\\320\\276, \\320\\277\\320\\276\\320\\272\\320\\260\\320\\267\\320\\260\\321\\202\\320\\270 \\320\\261\\320\\276\\320\\272\\320\\276\\320\\262\\321\\203 \\320\\277\\320\\260\\320\\275\\320\\265\\320\\273\\321\\214 \\320\\267\\320\\260\\320\\272\\320\\273\\320\\260\\320\\264\\320\\276\\320\\272\\0\"\\\n  \"\\320\\236\\320\\264\\320\\275\\320\\260 \\321\\201\\321\\202\\320\\276\\321\\200\\321\\226\\320\\275\\320\\272\\320\\260\\0\"\\\n  \"\\320\\222\\320\\270\\320\\261\\320\\260\\321\\207\\321\\202\\320\\265, \\320\\260\\320\\273\\320\\265 \\321\\206\\320\\265 \\320\\275\\320\\265 \\320\\274\\320\\260\\320\\273\\320\\276 \\321\\201\\321\\202\\320\\260\\321\\202\\320\\270\\321\\201\\321\\214!\\n\\n\\320\\235\\320\\260\\321\\202\\320\\270\\321\\201\\320\\275\\321\\226\\321\\202\\321\\214 \\\"\\320\\241\\320\\272\\320\\260\\321\\201\\321\\203\\320\\262\\320\\260\\321\\202\\320\\270\\\", \\321\\217\\320\\272\\321\\211\\320\\276 \\320\\262\\320\\270 \\320\\261\\320\\260\\320\\266\\320\\260\\321\\224\\321\\202\\320\\265 \\320\\264\\320\\276\\320\\277\\320\\276\\320\\274\\320\\276\\320\\263\\321\\202\\320\\270 \\320\\275\\320\\260\\320\\274 \\320\\262\\320\\270\\320\\277\\321\\200\\320\\260\\320\\262\\320\\270\\321\\202\\320\\270 \\320\\277\\321\\200\\320\\270\\321\\207\\320\\270\\320\\275\\321\\203 \\320\\267\\320\\261\\320\\276\\321\\216.\\0\"\\\n  \"\\320\\244\\320\\260\\320\\271\\320\\273 \\321\\201\\320\\270\\321\\200\\321\\206\\320\\265\\320\\262\\320\\276\\320\\263\\320\\276 \\320\\272\\320\\276\\320\\264\\321\\203 %s \\320\\275\\320\\265 \\320\\274\\320\\260\\321\\224 \\321\\202\\320\\276\\321\\207\\320\\272\\320\\270 \\321\\201\\320\\270\\320\\275\\321\\205\\321\\200\\320\\276\\320\\275\\321\\226\\320\\267\\320\\260\\321\\206\\321\\226\\321\\227\\0\"\\\n  \"\\320\\242\\320\\265\\320\\274\\320\\260:\\0\"\\\n  \"\\320\\236\\320\\277\\321\\206\\321\\226\\321\\227 SumatraPDF\\0\"\\\n  \"\\320\\236\\320\\275\\320\\276\\320\\262\\320\\273\\320\\265\\320\\275\\320\\275\\321\\217 SumatraPDF\\0\"\\\n  \"SumatraPDF \\320\\262\\320\\277\\320\\260\\320\\262\\0\"\\\n  \"SumatraPDF \\320\\262\\320\\260\\321\\210 PDF \\320\\277\\320\\265\\321\\200\\320\\265\\320\\263\\320\\273\\321\\217\\320\\264\\320\\260\\321\\207 \\320\\277\\320\\276 \\320\\267\\320\\260\\320\\274\\320\\276\\320\\262\\321\\207\\321\\203\\320\\262\\320\\260\\320\\275\\320\\275\\321\\216\\0\"\\\n  \"SumatraPDF \\321\\202\\320\\265\\320\\277\\320\\265\\321\\200 \\320\\261\\321\\203\\320\\264\\320\\265 \\320\\262\\320\\260\\321\\210\\320\\270\\320\\274 PDF \\320\\277\\320\\265\\321\\200\\320\\265\\320\\263\\320\\273\\321\\217\\320\\264\\320\\260\\321\\207\\320\\265\\320\\274 \\320\\277\\320\\276 \\320\\267\\320\\260\\320\\274\\320\\276\\320\\262\\321\\207\\321\\203\\320\\262\\320\\260\\320\\275\\320\\275\\321\\216\\0\"\\\n  \"\\320\\235\\320\\265\\320\\274\\320\\276\\320\\266\\320\\273\\320\\270\\320\\262\\320\\276 \\320\\262\\321\\226\\320\\264\\320\\272\\321\\200\\320\\270\\321\\202\\320\\270 \\321\\204\\320\\260\\320\\271\\320\\273 \\321\\201\\320\\270\\320\\275\\321\\205\\321\\200\\320\\276\\320\\275\\321\\226\\320\\267\\320\\260\\321\\206\\321\\226\\321\\227\\0\"\\\n  \"PDF \\320\\267 \\320\\274\\321\\226\\321\\202\\320\\272\\320\\260\\320\\274\\320\\270\\0\"\\\n  \"\\320\\242\\320\\265\\320\\272\\321\\201\\321\\202\\320\\276\\320\\262\\321\\226 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\224\\320\\260\\320\\275\\320\\270\\320\\271 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202 \\320\\262\\320\\270\\320\\272\\320\\276\\321\\200\\320\\270\\321\\201\\321\\202\\320\\276\\320\\262\\321\\203\\321\\224 \\320\\274\\320\\276\\320\\266\\320\\273\\320\\270\\320\\262\\320\\276\\321\\201\\321\\202\\321\\226, \\321\\211\\320\\276 \\320\\275\\320\\265 \\320\\277\\321\\226\\320\\264\\321\\202\\321\\200\\320\\270\\320\\274\\321\\203\\321\\216\\321\\202\\321\\214\\321\\201\\321\\217 (%s) \\321\\226 \\321\\202\\320\\276\\320\\274\\321\\203 \\320\\274\\320\\276\\320\\266\\320\\265 \\320\\262\\321\\226\\320\\264\\320\\276\\320\\261\\321\\200\\320\\260\\320\\266\\320\\260\\321\\202\\320\\270\\321\\201\\321\\217 \\320\\267 \\320\\277\\320\\276\\320\\274\\320\\270\\320\\273\\320\\272\\320\\260\\320\\274\\320\\270\\0\"\\\n  \"\\320\\227\\320\\260\\320\\263\\320\\276\\320\\273\\320\\276\\320\\262\\320\\276\\320\\272:\\0\"\\\n  \"\\320\\235\\320\\265\\320\\262\\321\\226\\320\\264\\320\\276\\320\\274\\320\\270\\320\\271 \\321\\204\\320\\260\\320\\271\\320\\273-\\320\\264\\320\\266\\320\\265\\321\\200\\320\\265\\320\\273\\320\\276 (%s)\\0\"\\\n  \"\\320\\222\\320\\270\\320\\272\\320\\276\\321\\200\\320\\270\\321\\201\\321\\202\\320\\276\\320\\262\\321\\203\\320\\262\\320\\260\\321\\202\\320\\270 \\320\\262\\320\\272\\320\\273\\320\\260\\320\\264\\320\\272\\320\\270\\0\"\\\n  \"\\320\\222\\320\\270\\320\\263\\320\\273\\321\\217\\320\\264\\0\"\\\n  \"\\320\\222\\321\\226\\320\\264\\320\\272\\321\\200\\320\\270\\321\\202\\320\\270 \\321\\201\\320\\260\\320\\271\\321\\202\\0\"\\\n  \"\\320\\227\\320\\260\\321\\201\\321\\202\\320\\265\\321\\200\\320\\265\\320\\266\\320\\265\\320\\275\\320\\275\\321\\217\\0\"\\\n  \"\\320\\224\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270 XPS\\0\"\\\n  \"\\320\\222\\320\\270 \\320\\262\\320\\266\\320\\265 \\320\\274\\320\\260\\321\\224\\321\\202\\320\\265 \\320\\275\\320\\260\\320\\271\\320\\275\\320\\276\\320\\262\\321\\226\\321\\210\\321\\203 \\320\\262\\320\\265\\321\\200\\321\\201\\321\\226\\321\\216.\\0\"\\\n  \"\\320\\222\\320\\270 \\320\\262\\320\\270\\320\\272\\320\\276\\321\\200\\320\\270\\321\\201\\321\\202\\320\\276\\320\\262\\321\\203\\321\\224\\321\\202\\320\\265 \\320\\262\\320\\265\\321\\200\\321\\201\\321\\226\\321\\216 %s\\0\"\\\n  \"\\320\\234\\320\\260\\321\\201\\321\\210\\321\\202\\320\\260\\320\\261\\0\"\\\n  \"\\320\\227\\320\\261\\321\\226\\320\\273\\321\\214\\321\\210\\320\\270\\321\\202\\320\\270\\0\"\\\n  \"\\320\\227\\320\\274\\320\\265\\320\\275\\321\\210\\320\\270\\321\\202\\320\\270\\0\"\\\n  \"\\320\\234\\320\\260\\321\\201\\321\\210\\321\\202\\320\\260\\320\\261\\0\"\\\n  \"[\\320\\227\\320\\275\\320\\260\\320\\271\\320\\264\\320\\265\\320\\275\\320\\276 \\320\\267\\320\\274\\321\\226\\320\\275\\320\\270; \\320\\276\\320\\275\\320\\276\\320\\262\\320\\273\\320\\265\\320\\275\\320\\275\\321\\217] %s\\0\"\\\n  \"\\320\\272\\320\\276\\320\\277\\321\\226\\321\\216\\320\\262\\320\\260\\320\\275\\320\\275\\321\\217 \\321\\202\\320\\265\\320\\272\\321\\201\\321\\202\\321\\203\\0\"\\\n  \"\\320\\264\\321\\200\\321\\203\\320\\272 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\260\\0\";\n\nconst char * gTranslations_uz = \n  \"&Dastur haqida\\0\"\\\n  \"&Haqiqiy o'lchami\\tCtrl+1\\0\"\\\n  \"&Qo'shimcha parametrlar...\\0\"\\\n  \"&Hamma tanlangan betlar\\0\"\\\n  \"&Orqaga\\tAlt+<-\\0\"\\\n  \"&Kitob ko'rinishi\\tCtrl+8\\0\"\\\n  \"&Yopish\\tCtrl+W\\0\"\\\n  \"&Tanlanganni nusxa olish\\0\"\\\n  \"&Tanlanganni nusxa olish\\tCtrl+C\\0\"\\\n  \"&Boshqa so'ralmasin\\0\"\\\n  \"&Faqat juft betlar\\0\"\\\n  \"&Ikkita betdan\\tCtrl+7\\0\"\\\n  \"&Fayl\\0\"\\\n  \"&Qidirish:\\0\"\\\n  \"&Birinchi bet\\tHome\\0\"\\\n  \"&Betlarni printerga moslash\\0\"\\\n  \"&O'tish\\0\"\\\n  \"&Betga o'tish:\\0\"\\\n  \"&Yordam\\0\"\\\n  \"&Oxirgi bet\\tEnd\\0\"\\\n  \"&Miqyos:\\0\"\\\n  \"&Qo'llanma\\0\"\\\n  \"&Registrni hisobga olish\\0\"\\\n  \"&Keyingi bet\\t->\\0\"\\\n  \"&Yo'q\\0\"\\\n  \"&Yo'q, rahmat\\0\"\\\n  \"&Faqat toq betlar\\0\"\\\n  \"&Hujjatni ochish\\0\"\\\n  \"&Ochish...\\tCtrl+O\\0\"\\\n  \"&Parametrlar...\\0\"\\\n  \"&Maxfiy so'z:\\0\"\\\n  \"&Hujjatni eslab qolish\\0\"\\\n  \"&Oldingi bet\\t<-\\0\"\\\n  \"&Chop etish...\\0\"\\\n  \"&Chop etish\\tCtrl+P\\0\"\\\n  \"&Chop etish... (ruxsat etilmagan)\\0\"\\\n  \"&Ushbu hujjatning maxfiy so'zini eslab qolish\\0\"\\\n  \"&Ushbu parametrlarni har qaysi hujjat uchun eslab qolish\\0\"\\\n  \"&Hujjatni o'chirish\\0\"\\\n  \"&Quyidagicha saqlash...\\0\"\\\n  \"&Quyidagicha saqlash...\\tCtrl+S\\0\"\\\n  \"&Moslamalar\\0\"\\\n  \"&Betlarni printerga moslab kichraytirish (zarur bo'lganda)\\0\"\\\n  \"&Bitta betdan\\tCtrl+6\\0\"\\\n  \"&Ushbu versiyani o'tkazib yuborish\\0\"\\\n  \"&Betlarning asl o'lchamlarini ishlatish\\0\"\\\n  \"&Ko'rish\\0\"\\\n  \"&Oyna\\0\"\\\n  \"&Ha\\0\"\\\n  \"&Miqyos\\0\"\\\n  \"(%d dan)\\0\"\\\n  \"(bet %s)\\0\"\\\n  \"SumatraPDF haqida\\0\"\\\n  \"Tanlanganlarga qo'shish\\0\"\\\n  \"%s betni Tanlanganlarga qo'shish\\0\"\\\n  \"%s betni Tanlanganlarga (boshqa) nom bilan qo'shish:\\0\"\\\n  \"Tanlanganlarga qo'shish\\0\"\\\n  \"Qo'shimcha\\0\"\\\n  \"Hamma fayllar\\0\"\\\n  \"Hamma qo'llanadigan hujjatlar\\0\"\\\n  \"Dastur:\\0\"\\\n  \"PDF-fayllar bilan bog'lansinmi?\\0\"\\\n  \"Qo'shimcha ilovasi: %s\\0\"\\\n  \"Muallif:\\0\"\\\n  \"Avtomatik\\0\"\\\n  \"&Yangi versiyani avtomatik ravishda tekshirish\\0\"\\\n  \"Kitob ko'rinishi\\0\"\\\n  \"&Xatcho'plar\\tF12\\0\"\\\n  \"Xatcho'p yorliqlari\\0\"\\\n  \"Xatcho'p yorlig'i betga %s %s dan\\0\"\\\n  \"Xatcho'plar\\0\"\\\n  \"Bayt\\0\"\\\n  \"CHM hujjatlari\\0\"\\\n  \"Internet ulanmagan (xato %#x).\\0\"\\\n  \"Bekor qilish\\0\"\\\n  \"Faylni chop etib bo'lmadi\\0\"\\\n  \"Qayta qidirish buyrug'i xatosi. Buyruq satri parametrlarini tekshiring.\\0\"\\\n  \"Tilni o'zgartirish (Change Language)\\0\"\\\n  \"&Yangi versiyani tekshirish\\0\"\\\n  \"Komikslar\\0\"\\\n  \"Mosligi\\0\"\\\n  \"Uzluksiz\\0\"\\\n  \"Uzluksiz kitob ko'rinishi\\0\"\\\n  \"Uzluksiz ikkita betdan\\0\"\\\n  \"Tarjima qilish\\0\"\\\n  \"&Rasmni nusxa olish\\0\"\\\n  \"&Bog' manzilini nusxa olish\\0\"\\\n  \"&Izohni nusxa olish\\0\"\\\n  \"Matnni nusxa olish mumkin emas (rasm nusxa olinmoqda)\\0\"\\\n  \"Mualliflik huquqi:\\0\"\\\n  \"Printer xossalarini olib bo'lmadi\\0\"\\\n  \"Printerni ishga tushirib bo'lmadi\\0\"\\\n  \"Betni render qilib bo'lmadi\\0\"\\\n  \"Yaratilgan:\\0\"\\\n  \"Joriy fayl\\0\"\\\n  \"Kursor holati:\\0\"\\\n  \"&Miqyosni ko'rsatish...\\tCtrl+Y\\0\"\\\n  \"Andoza &joylashish\\0\"\\\n  \"Andoza &miqyos\\0\"\\\n  \"Portable usulida andoza PDF ko'rish vositasini o'zgartirib bo'lmaydi\\0\"\\\n  \"Taqiqlangan huquqlar:\\0\"\\\n  \"DjVu hujjatlari\\0\"\\\n  \"Hujjat xossalari\\0\"\\\n  \"Yuklab olish\\0\"\\\n  \"&Chiqish\\tCtrl+Q\\0\"\\\n  \"EPUB kitoblari\\0\"\\\n  \"Maxfiy so'zni kiriting\\0\"\\\n  \"%s uchun maxfiy so'zni kiriting\\0\"\\\n  \"PDF-hujjatni ikki marta bosganda ishga tushadigan buyruq satrini kiriting:\\0\"\\\n  \"%s yuklab olish xatosi\\0\"\\\n  \"&Tanlanganlar\\0\"\\\n  \"&Oldinga\\tAlt+->\\0\"\\\n  \"To'liq &ekran\\tCtrl+Shift+L\\0\"\\\n  \"Ikkita betdan\\0\"\\\n  \"Fayl nomini o'zgartirish muvaffaqiyatsiz tugadi!\\0\"\\\n  \"Faylni saqlash muvaffaqiyatsiz tugadi\\0\"\\\n  \"Tez veb ko'rish\\0\"\\\n  \"Tanlanganlar\\0\"\\\n  \"FictionBook hujjatlari\\0\"\\\n  \"%s fayli topilmadi\\0\"\\\n  \"Fayl hajmi:\\0\"\\\n  \"Fayl:\\0\"\\\n  \"&Qidirish...\\tCtrl+F\\0\"\\\n  \"Qidirish\\0\"\\\n  \"Keyingisini qidirish\\0\"\\\n  \"Oldingisini qidirish\\0\"\\\n  \"Qidirish:\\0\"\\\n  \"&Tarkibiga moslash\\tCtrl+3\\0\"\\\n  \"&Betga moslash\\tCtrl+0\\0\"\\\n  \"&Eniga moslash\\tCtrl+2\\0\"\\\n  \"Tarkibiga moslash\\0\"\\\n  \"Betga moslash\\0\"\\\n  \"Eniga moslash\\0\"\\\n  \"Eniga moslash va uzluksiz\\0\"\\\n  \"Bitta betga moslash\\0\"\\\n  \"Shriftlar:\\0\"\\\n  \"Kitob format qilinmoqda... %d bet\\0\"\\\n  \"%s betda matn topildi\\0\"\\\n  \"%s betda matn topildi (qayta)\\0\"\\\n  \"Tez-tez o'qiladiganlar\\0\"\\\n  \"\\0\"\\\n  \"Betga o'tish\\0\"\\\n  \"Tez-tez o'qiladiganlarni yashirish\\0\"\\\n  \"Eslatma: qayta qidirish uchun F3 tugmasini bosing\\0\"\\\n  \"Rasm fayllari (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"SumatraPDF PDF-fayllarni ko'rish andoza dasturi sifatida ishlatilsinmi?\\0\"\\\n  \"SumatraPDF PDF fayllar bilan bog'lanish\\0\"\\\n  \"Man&ga usuli\\0\"\\\n  \"Registrni hisobga olish\\0\"\\\n  \"Mobi hujjatlari\\0\"\\\n  \"O'zgartirilgan:\\0\"\\\n  \"Yangi versiya mavjud: %s. Yuklab olinsinmi?\\0\"\\\n  \"Keyingi bet\\0\"\\\n  \"Mos keladigan topilmadi\\0\"\\\n  \"%u satriga %s faylida mos keladigan natija topilmadi\\0\"\\\n  \"Sinxronlanish fayli topilmadi\\0\"\\\n  \"Bu joyda sinxronlanish ma'lumoti yo'q\\0\"\\\n  \"Betlar soni:\\0\"\\\n  \"\\0\"\\\n  \"Ochish\\0\"\\\n  \"PDF-XChangeda ochish\\0\"\\\n  \"Hujjatni ochish...\\0\"\\\n  \"%s'da ochish\\0\"\\\n  \"&Adobe Readerda ochish\\0\"\\\n  \"&Foxit Readerda ochish\\0\"\\\n  \"Microsoft HTML Helpda ochish\\0\"\\\n  \"Microsoft XPS-Viewerda ochish\\0\"\\\n  \"&Xossalari\\0\"\\\n  \"&Xossalari\\tCtrl+D\\0\"\\\n  \"PDF hujjati\\0\"\\\n  \"PDF optimizatsiyalari:\\0\"\\\n  \"PDF yaratuvchisi:\\0\"\\\n  \"PDF versiyasi:\\0\"\\\n  \"PDF hujjatlari\\0\"\\\n  \"&Bet...\\tCtrl+G\\0\"\\\n  \"Bet %s\\0\"\\\n  \"Bet o'lchami:\\0\"\\\n  \"Bet %u mavjud emas\\0\"\\\n  \"Bet miqyosi\\0\"\\\n  \"Bet:\\0\"\\\n  \"PalmDoc ho'jjatlari\\0\"\\\n  \"Kutib turing - render qilinmoqda...\\0\"\\\n  \"Postscript hujjatlari\\0\"\\\n  \"&Namoyish\\tCtrl+L\\0\"\\\n  \"Oldingi bet\\0\"\\\n  \"Chop etish\\0\"\\\n  \"Chop etish diapazoni\\0\"\\\n  \"Bunday printer mavjud emas\\0\"\\\n  \"Chop etilmoqda.\\0\"\\\n  \"Chop etilmoqda. To'xtatilib dasturdan chiqilsinmi?\\0\"\\\n  \"Chop etilmoqda. To'xtatilib qaytadan boshlansinmi?\\0\"\\\n  \"%d betni %d dan chop etilmoqda...\\0\"\\\n  \"Chop etish muammosi.\\0\"\\\n  \"&Nomini o'zgartirish...\\tF2\\0\"\\\n  \"&Ochilgan fayllarni eslab qolish\\0\"\\\n  \"Tanlanganlardan o'chirish\\0\"\\\n  \"%s betni tanlanganlardan o'chirish\\0\"\\\n  \"Yangi nom\\0\"\\\n  \"&Chapga burish\\tCtrl+Shift+-\\0\"\\\n  \"&O'ngga burish\\tCtrl+Shift++\\0\"\\\n  \"Quyidagicha saqlash\\0\"\\\n  \"&Yorliqni saqlash...\\tCtrl+Shift+S\\0\"\\\n  \"%d %d dan qidirilmoqda...\\0\"\\\n  \"&Hammasini tanlash\\0\"\\\n  \"&Hammasini tanlash\\tCtrl+A\\0\"\\\n  \"Ctrl va sichqonchaning chap tugmasini bosib tarkibini tanlang\\0\"\\\n  \"Tanlash:\\0\"\\\n  \"&Elektron pochta orqali yuborish...\\0\"\\\n  \"Teskari qidirish buyruq satrini moslash\\0\"\\\n  \"&Xatcho'plarni ko'rsatish\\0\"\\\n  \"&Betlarni uzluksiz ko'rsatish\\0\"\\\n  \"&Asboblar panelini ko'rsatish\\0\"\\\n  \"Tanlanganlarni ko'rsatish\\0\"\\\n  \"Tez-tez o'qiladiganlarni ko'rsatish\\0\"\\\n  \"Mavjud bo'lganda &xatcho'plar panelini ko'rsatish\\0\"\\\n  \"Bitta bet\\0\"\\\n  \"Kutilmagan voqea sodir bo'ldi.\\n\\nUshbu nosozlikni tuzatish uchun bizga yordam bermoqchi bo'lsaniz 'Bekor qilish' tugmasini bosing.\\0\"\\\n  \"%s manba faylida sinxronlanish nuqtasi yo'q\\0\"\\\n  \"Mavzu:\\0\"\\\n  \"SumatraPDF Parametrlari\\0\"\\\n  \"SumatraPDF yangilash\\0\"\\\n  \"SumatraPDFda nosozlik ro'y berdi\\0\"\\\n  \"SumatraPDF andoza PDF ko'rish vositasi\\0\"\\\n  \"SumatraPDF endi andoza PDF ko'rish vositasi bo'ldi\\0\"\\\n  \"Sinxronlanish faylini ochib bo'lmadi\\0\"\\\n  \"Belgilangan PDF\\0\"\\\n  \"Matn hujjatlari\\0\"\\\n  \"Ushbu ho'jjat qo'llanmaydigan imkoniyatlarni (%s) ishlatmoqda va to'g'ri render qilinmasligi mo'mkin\\0\"\\\n  \"Sarlavha:\\0\"\\\n  \"Noma'lum manba fayli (%s)\\0\"\\\n  \"&Ilovalarni qo'llash\\0\"\\\n  \"Ko'rish\\0\"\\\n  \"&Veb sahifaga o'tish\\0\"\\\n  \"Diqqat\\0\"\\\n  \"XPS hujjatlari\\0\"\\\n  \"Sizda so'nggi versiya.\\0\"\\\n  \"Sizdagi versiya %s\\0\"\\\n  \"Miqyos\\0\"\\\n  \"Kattalashtirish\\0\"\\\n  \"Kichraytirish\\0\"\\\n  \"Miqyos omili\\0\"\\\n  \"[O'zgarishlar aniqlangan; yangilanmoqda] %s\\0\"\\\n  \"matnni nusxa olish\\0\"\\\n  \"hujjatni chop etish\\0\";\n\nconst char * gTranslations_vn = \n  \"Gi\\341\\273\\233i thi\\341\\273\\207u\\0\"\\\n  \"K\\303\\255ch th\\306\\260\\341\\273\\233&c th\\341\\272\\255t\\tCtrl+1\\0\"\\\n  \"T\\303\\271y ch\\341\\273\\215n &n\\303\\242ng cao...\\0\"\\\n  \"T\\341\\272\\245t c\\341\\272\\243 c\\303\\241c tr&ang \\304\\221\\306\\260\\341\\273\\243c ch\\341\\273\\215n\\0\"\\\n  \"Tr\\341\\273\\237 v\\341\\273\\201\\tAlt+M\\305\\251i t\\303\\252n tr\\303\\241i\\0\"\\\n  \"Xem d\\341\\272\\241ng s\\303\\241ch\\tCtrl+8\\0\"\\\n  \"\\304\\220\\303\\263ng t\\341\\272\\255p tin\\tCtrl+W\\0\"\\\n  \"&Ch\\303\\251p ph\\341\\272\\247n \\304\\221\\303\\243 ch\\341\\273\\215n\\0\"\\\n  \"&Ch\\303\\251p ph\\341\\272\\247n \\304\\221\\303\\243 ch\\341\\273\\215n\\tCtrl+C\\0\"\\\n  \"Kh\\303\\264ng h\\341\\273\\217i l\\341\\272\\241i\\0\"\\\n  \"Ch\\341\\273\\211 nh\\341\\273\\257ng trang l\\341\\272\\273\\0\"\\\n  \"Trang k\\303\\251p\\tCtrl+7\\0\"\\\n  \"T\\341\\272\\255p tin\\0\"\\\n  \"T\\303\\254m (c\\303\\241c) t\\341\\273\\253 sau:\\0\"\\\n  \"Trang \\304\\221\\341\\272\\247u\\tHome\\0\"\\\n  \"V\\341\\273\\253a trang in\\0\"\\\n  \"Nh\\341\\272\\243y \\304\\221\\341\\272\\277n\\0\"\\\n  \"Nh\\341\\272\\243y \\304\\221\\341\\272\\277n trang:\\0\"\\\n  \"Tr\\341\\273\\243 &gi\\303\\272p\\0\"\\\n  \"Trang cu\\341\\273\\221i\\tEnd\\0\"\\\n  \"Ph\\303\\263ng \\304\\221\\341\\272\\241i:\\0\"\\\n  \"H\\306\\260\\341\\273\\233ng d\\341\\272\\253n s\\341\\273\\255 d\\341\\273\\245ng\\0\"\\\n  \"Ph\\303\\242n bi\\341\\273\\207t &HOA-th\\306\\260\\341\\273\\235ng\\0\"\\\n  \"Trang sau\\tM\\305\\251i t\\303\\252n ph\\341\\272\\243i\\0\"\\\n  \"Kh\\303\\264ng\\0\"\\\n  \"Kh\\303\\264ng, c\\341\\272\\243m \\306\\241n\\0\"\\\n  \"Ch\\341\\273\\211 nh\\341\\273\\257ng trang ch\\341\\272\\265n\\0\"\\\n  \"M\\341\\273\\237 t\\341\\272\\255p tin\\0\"\\\n  \"M\\341\\273\\237 t\\341\\272\\255p tin...\\tCtrl+O\\0\"\\\n  \"Tu\\341\\273\\263 ch\\341\\273\\215n\\0\"\\\n  \"M\\341\\272\\255t kh\\341\\272\\251u:\\0\"\\\n  \"Ghim t\\341\\272\\255p tin\\0\"\\\n  \"Trang tr\\306\\260\\341\\273\\233c\\tM\\305\\251i t\\303\\252n tr\\303\\241i\\0\"\\\n  \"In...\\0\"\\\n  \"In...\\tCtrl+P\\0\"\\\n  \"&In... (b\\341\\273\\213 t\\341\\273\\253 ch\\341\\273\\221i)\\0\"\\\n  \"Nh\\341\\273\\233 m\\341\\272\\255t kh\\341\\272\\251u cho t\\341\\272\\255p tin n\\303\\240y\\0\"\\\n  \"Nh\\341\\273\\233 c\\303\\241c c\\303\\240i \\304\\221\\341\\272\\267t n\\303\\240y cho t\\341\\273\\253ng t\\341\\272\\255p tin\\0\"\\\n  \"G\\341\\273\\241 t\\341\\272\\255p tin xu\\341\\273\\221ng\\0\"\\\n  \"L\\306\\260u th\\303\\240nh...\\0\"\\\n  \"L\\306\\260u th\\303\\240nh...\\tCtrl+S\\0\"\\\n  \"C\\303\\240i \\304\\221\\341\\272\\267t\\0\"\\\n  \"N\\303\\251n v\\341\\273\\253a trang in (n\\341\\272\\277u c\\341\\272\\247n thi\\341\\272\\277t)\\0\"\\\n  \"Trang \\304\\221\\306\\241n\\tCtrl+6\\0\"\\\n  \"B\\341\\273\\217 qua phi\\303\\252n b\\341\\272\\243n n\\303\\240y.\\0\"\\\n  \"S\\341\\273\\255 d\\341\\273\\245ng k\\303\\255ch th\\306\\260\\341\\273\\233c trang g\\341\\273\\221c\\0\"\\\n  \"Hi\\341\\273\\203n th\\341\\273\\213\\0\"\\\n  \"&C\\341\\273\\255a s\\341\\273\\225\\0\"\\\n  \"\\304\\220\\341\\273\\223ng \\303\\275\\0\"\\\n  \"Thu-&Ph\\303\\263ng\\0\"\\\n  \"(tr\\303\\252n %d)\\0\"\\\n  \"(trang %s)\\0\"\\\n  \"Gi\\341\\273\\233i thi\\341\\273\\207u SumatraPDF\\0\"\\\n  \"Th\\303\\252m \\306\\257a th\\303\\255ch\\0\"\\\n  \"Th\\303\\252m trang %s v\\303\\240o \\306\\257a th\\303\\255ch\\0\"\\\n  \"Th\\303\\252m trang %s v\\303\\240o \\306\\257a th\\303\\255ch v\\341\\273\\233i t\\303\\252n (t\\303\\271y ch\\341\\273\\215n):\\0\"\\\n  \"Th\\303\\252m v\\303\\240o \\306\\257a th\\303\\255ch\\0\"\\\n  \"N\\303\\242ng cao\\0\"\\\n  \"M\\341\\273\\215i t\\341\\272\\255p tin\\0\"\\\n  \"T\\341\\272\\245t c\\341\\272\\243 c\\303\\241c \\304\\221\\341\\273\\213nh d\\341\\272\\241ng \\304\\221\\306\\260\\341\\273\\243c h\\341\\273\\227 tr\\341\\273\\243\\0\"\\\n  \"\\341\\273\\250ng d\\341\\273\\245ng:\\0\"\\\n  \"Li\\303\\252n k\\341\\272\\277t v\\341\\273\\233i t\\341\\272\\255p tin PDF?\\0\"\\\n  \"\\304\\220\\303\\255nh k\\303\\250m: %s\\0\"\\\n  \"T\\303\\241c gi\\341\\272\\243\\0\"\\\n  \"T\\341\\273\\261 \\304\\221\\341\\273\\231ng\\0\"\\\n  \"T\\341\\273\\261 \\304\\221\\341\\273\\231ng ki\\341\\273\\203m tra c\\341\\272\\255p nh\\341\\272\\255t\\0\"\\\n  \"Xem d\\341\\272\\241ng s\\303\\241ch\\0\"\\\n  \"Ch\\341\\273\\211 d\\341\\272\\245u s\\303\\241ch\\tF12\\0\"\\\n  \"L\\341\\273\\221i t\\341\\272\\257t ch\\341\\273\\211 d\\341\\272\\245u s\\303\\241ch\\0\"\\\n  \"L\\341\\273\\221i t\\341\\272\\257t ch\\341\\273\\211 d\\341\\272\\245u s\\303\\241ch \\304\\221\\341\\272\\277n trang %s c\\341\\273\\247a %s\\0\"\\\n  \"Ch\\341\\273\\211 d\\341\\272\\245u s\\303\\241ch\\0\"\\\n  \"\\0\"\\\n  \"T\\341\\272\\255p tin CHM\\0\"\\\n  \"Kh\\303\\264ng th\\341\\273\\203 k\\341\\272\\277t n\\341\\273\\221i Internet (l\\341\\273\\227i %#x).\\0\"\\\n  \"H\\341\\273\\247y\\0\"\\\n  \"Kh\\303\\264ng in \\304\\221\\306\\260\\341\\273\\243c t\\341\\272\\255p tin n\\303\\240y\\0\"\\\n  \"Kh\\303\\264ng th\\341\\273\\203 b\\341\\272\\257t \\304\\221\\341\\272\\247u l\\341\\273\\207nh t\\303\\254m ki\\341\\272\\277m ng\\306\\260\\341\\273\\243c. Xin ki\\341\\273\\203m tra ph\\341\\272\\247n d\\303\\262ng l\\341\\273\\207nh trong C\\303\\240i \\304\\221\\341\\272\\267t.\\0\"\\\n  \"\\304\\220\\341\\273\\225i ng\\303\\264n ng\\341\\273\\257\\0\"\\\n  \"Ki\\341\\273\\203m tra c\\341\\272\\255p nh\\341\\272\\255t\\0\"\\\n  \"Truy\\341\\273\\207n tranh comic\\0\"\\\n  \"T\\303\\255nh t\\306\\260\\306\\241ng th\\303\\255ch\\0\"\\\n  \"Li\\303\\252n ti\\341\\272\\277p\\0\"\\\n  \"Xem s\\303\\241ch li\\303\\252n ti\\341\\272\\277p\\0\"\\\n  \"Trang k\\303\\251p li\\303\\252n ti\\341\\272\\277p\\0\"\\\n  \"\\304\\220\\303\\263ng g\\303\\263p d\\341\\273\\213ch thu\\341\\272\\255t\\0\"\\\n  \"Sao ch\\303\\251p h\\303\\254nh \\341\\272\\243nh\\0\"\\\n  \"Ch\\303\\251p \\304\\221\\341\\273\\213a ch\\341\\273\\211 li\\303\\252n k\\341\\272\\277t\\0\"\\\n  \"Ch\\303\\251p ch\\303\\272 th\\303\\255ch\\0\"\\\n  \"Ch\\303\\251p v\\304\\203n b\\341\\272\\243n b\\341\\273\\213 t\\341\\273\\253 ch\\341\\273\\221i (ch\\341\\273\\211 \\304\\221\\306\\260\\341\\273\\243c ch\\303\\251p nh\\306\\260 h\\303\\254nh \\341\\272\\243nh)\\0\"\\\n  \"Quy\\341\\273\\201n t\\303\\241c gi\\341\\272\\243:\\0\"\\\n  \"Kh\\303\\264ng th\\341\\273\\203 c\\303\\263 \\304\\221\\306\\260\\341\\273\\243c thu\\341\\273\\231c t\\303\\255nh M\\303\\241y in\\0\"\\\n  \"Kh\\303\\264ng kh\\341\\273\\237i \\304\\221\\341\\273\\231ng \\304\\221\\306\\260\\341\\273\\243c m\\303\\241y in\\0\"\\\n  \"Kh\\303\\264ng hi\\341\\273\\207n \\304\\221\\306\\260\\341\\273\\243c trang\\0\"\\\n  \"Ng\\303\\240y t\\341\\272\\241o:\\0\"\\\n  \"T\\341\\272\\255p tin hi\\341\\273\\207n h\\303\\240nh\\0\"\\\n  \"V\\341\\273\\213 tr\\303\\255 con tr\\341\\273\\217:\\0\"\\\n  \"Thu ph\\303\\263ng &tu\\341\\273\\263 \\303\\275...\\tCtrl+Y\\0\"\\\n  \"Khung nh\\303\\254n m\\341\\272\\267c \\304\\221\\341\\273\\213nh\\0\"\\\n  \"K\\303\\255ch th\\306\\260\\341\\273\\233c m\\341\\272\\267c \\304\\221\\341\\273\\213nh\\0\"\\\n  \"Kh\\303\\264ng thay \\304\\221\\341\\273\\225i \\304\\221\\306\\260\\341\\273\\243c tr\\303\\254nh \\304\\221\\341\\273\\215c PDF ch\\303\\255nh \\341\\273\\237 ch\\341\\272\\277 \\304\\221\\341\\273\\231 di \\304\\221\\341\\273\\231ng\\0\"\\\n  \"C\\303\\241c quy\\341\\273\\201n b\\341\\273\\213 t\\341\\273\\253 ch\\341\\273\\221i\\0\"\\\n  \"T\\341\\272\\255p tin DjVu\\0\"\\\n  \"Thu\\341\\273\\231c t\\303\\255nh t\\341\\272\\255p tin\\0\"\\\n  \"T\\341\\272\\243i xu\\341\\273\\221ng\\0\"\\\n  \"Th&o\\303\\241t\\tCtrl+Q\\0\"\\\n  \"T\\341\\272\\255p tin EPUB\\0\"\\\n  \"Nh\\341\\272\\255p m\\341\\272\\255t kh\\341\\272\\251u\\0\"\\\n  \"Nh\\341\\272\\255p m\\341\\272\\255t kh\\341\\272\\251u cho %s\\0\"\\\n  \"Nh\\341\\272\\255p d\\303\\262ng l\\341\\273\\207nh g\\341\\273\\215i khi b\\341\\272\\241n nh\\341\\272\\245p \\304\\221\\303\\272p v\\303\\240o t\\341\\272\\255p tin PDF:\\0\"\\\n  \"Kh\\303\\264ng m\\341\\273\\237 %s \\304\\221\\306\\260\\341\\273\\243c\\0\"\\\n  \"\\306\\257a th\\303\\255ch\\0\"\\\n  \"Ti\\341\\272\\277p t\\341\\273\\245c\\tAlt+M\\305\\251i t\\303\\252n ph\\341\\272\\243i\\0\"\\\n  \"To\\303\\240n m\\303\\240n h\\303\\254nh\\tCtrl+Shift+L\\0\"\\\n  \"Trang k\\303\\251p\\0\"\\\n  \"Kh\\303\\264ng th\\341\\273\\203 \\304\\221\\341\\273\\225i t\\303\\252n t\\341\\272\\255p tin!\\0\"\\\n  \"Kh\\303\\264ng l\\306\\260u \\304\\221\\306\\260\\341\\273\\243c t\\341\\272\\255p tin.\\0\"\\\n  \"Xem d\\341\\272\\241ng Web nhanh\\0\"\\\n  \"\\306\\257a th\\303\\255ch\\0\"\\\n  \"T\\341\\272\\255p tin FictionBook\\0\"\\\n  \"Kh\\303\\264ng t\\303\\254m th\\341\\272\\245y t\\341\\272\\255p tin %s\\0\"\\\n  \"K\\303\\255ch th\\306\\260\\341\\273\\233c:\\0\"\\\n  \"T\\341\\272\\255p tin:\\0\"\\\n  \"T\\303\\254m ki\\341\\272\\277m...\\tCtrl+F\\0\"\\\n  \"T\\303\\254m ki\\341\\272\\277m\\0\"\\\n  \"T\\303\\254m xu\\341\\273\\221ng\\0\"\\\n  \"T\\303\\254m l\\303\\252n\\0\"\\\n  \"T\\303\\254m ki\\341\\272\\277m:\\0\"\\\n  \"V\\341\\273\\253a n\\341\\273\\231i dung\\tCtrl+3\\0\"\\\n  \"V\\341\\273\\253a &trang\\tCtrl+0\\0\"\\\n  \"V\\341\\273\\253a chi\\341\\273\\201u &r\\341\\273\\231ng\\tCtrl+2\\0\"\\\n  \"V\\341\\273\\253a n\\341\\273\\231i dung\\0\"\\\n  \"V\\341\\273\\253a trang\\0\"\\\n  \"V\\341\\273\\253a chi\\341\\273\\201u r\\341\\273\\231ng\\0\"\\\n  \"V\\341\\273\\253a chi\\341\\273\\201u r\\341\\273\\231ng v\\303\\240 Xem trang li\\303\\252n ti\\341\\272\\277p\\0\"\\\n  \"V\\341\\273\\253a m\\341\\273\\231t trang \\304\\221\\306\\241n\\0\"\\\n  \"Font ch\\341\\273\\257\\0\"\\\n  \"\\304\\220ang \\304\\221\\341\\273\\213nh d\\341\\272\\241ng s\\303\\241ch... %d trang\\0\"\\\n  \"T\\303\\254m th\\341\\272\\245y t\\341\\273\\253 \\341\\273\\237 trang %s\\0\"\\\n  \"T\\303\\254m th\\341\\272\\245y \\304\\221o\\341\\272\\241n v\\304\\203n b\\341\\272\\243n t\\341\\272\\241i trang %s (l\\341\\272\\247n n\\341\\273\\257a)\\0\"\\\n  \"\\304\\220\\341\\273\\215c th\\306\\260\\341\\273\\235ng xuy\\303\\252n\\0\"\\\n  \"\\0\"\\\n  \"Nh\\341\\272\\243y \\304\\221\\341\\272\\277n trang\\0\"\\\n  \"\\341\\272\\250n \\304\\220\\341\\273\\215c th\\306\\260\\341\\273\\235ng xuy\\303\\252n\\0\"\\\n  \"G\\341\\273\\243i \\303\\275: Nh\\341\\272\\245n ph\\303\\255m F3 \\304\\221\\341\\273\\203 t\\303\\254m l\\341\\272\\241i\\0\"\\\n  \"T\\341\\272\\255p tin \\341\\272\\243nh (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"\\304\\220\\341\\272\\267t SumatraPDF l\\303\\240m tr\\303\\254nh \\304\\221\\341\\273\\215c PDF m\\341\\272\\267c \\304\\221\\341\\273\\213nh?\\0\"\\\n  \"\\304\\220\\341\\272\\267t SumatraPDF l\\303\\240m tr\\303\\254nh \\304\\221\\341\\273\\215c PDF ch\\303\\255nh\\0\"\\\n  \"Ki\\341\\273\\203u &Manga\\0\"\\\n  \"Ph\\303\\242n bi\\341\\273\\207t HOA-th\\306\\260\\341\\273\\235ng\\0\"\\\n  \"T\\341\\272\\255p tin Mobi\\0\"\\\n  \"Ng\\303\\240y ch\\341\\273\\211nh s\\341\\273\\255a\\0\"\\\n  \"\\304\\220\\303\\243 c\\303\\263 phi\\303\\252n b\\341\\272\\243n m\\341\\273\\233i %s. T\\341\\272\\243i v\\341\\273\\201 phi\\303\\252n b\\341\\272\\243n m\\341\\273\\233i?\\0\"\\\n  \"Trang sau\\0\"\\\n  \"Kh\\303\\264ng t\\303\\254m th\\341\\272\\245y\\0\"\\\n  \"Kh\\303\\264ng t\\303\\254m th\\341\\272\\245y g\\303\\254 quanh d\\303\\262ng %u trong t\\341\\272\\255p tin %s\\0\"\\\n  \"Kh\\303\\264ng t\\303\\254m th\\341\\272\\245y t\\341\\272\\255p tin \\304\\221\\341\\273\\223ng b\\341\\273\\231 n\\303\\240o\\0\"\\\n  \"Kh\\303\\264ng c\\303\\263 th\\303\\264ng tin \\304\\221\\341\\273\\223ng b\\341\\273\\231 \\341\\273\\237 ch\\341\\273\\227 n\\303\\240y\\0\"\\\n  \"S\\341\\273\\221 trang:\\0\"\\\n  \"\\304\\220\\341\\273\\223ng \\303\\275\\0\"\\\n  \"M\\341\\273\\237 t\\341\\272\\255p tin\\0\"\\\n  \"M\\341\\273\\237 b\\341\\272\\261ng PDF-XChange\\0\"\\\n  \"M\\341\\273\\237 m\\341\\273\\231t t\\341\\272\\255p tin...\\0\"\\\n  \"M\\341\\273\\237 b\\341\\272\\261ng %s\\0\"\\\n  \"M\\341\\273\\237 b\\341\\272\\261ng Adobe Reader\\0\"\\\n  \"M\\341\\273\\237 b\\341\\272\\261ng Foxit Reader\\0\"\\\n  \"M\\341\\273\\237 b\\341\\272\\261ng Microsoft HTML Help\\0\"\\\n  \"M\\341\\273\\237 b\\341\\272\\261ng Microsoft XPS-Viewer\\0\"\\\n  \"Thu\\341\\273\\231c t\\303\\255nh\\0\"\\\n  \"Thu\\341\\273\\231c t\\303\\255nh\\tCtrl+D\\0\"\\\n  \"T\\341\\272\\255p tin PDF\\0\"\\\n  \"C\\303\\241c t\\341\\273\\221i \\306\\260u PDF\\0\"\\\n  \"Ph\\341\\272\\247n m\\341\\273\\201m t\\341\\272\\241o PDF:\\0\"\\\n  \"Phi\\303\\252n b\\341\\272\\243n PDF:\\0\"\\\n  \"T\\341\\272\\255p tin PDF\\0\"\\\n  \"Trang...\\tCtrl+G\\0\"\\\n  \"Trang %s\\0\"\\\n  \"K\\303\\255ch th\\306\\260\\341\\273\\233c trang:\\0\"\\\n  \"Trang %u kh\\303\\264ng t\\341\\273\\223n t\\341\\272\\241i\\0\"\\\n  \"Th\\306\\260\\341\\273\\233c \\304\\221o trang\\0\"\\\n  \"Trang:\\0\"\\\n  \"T\\303\\240i li\\341\\273\\207u PalmDoc\\0\"\\\n  \"Xin ch\\341\\273\\235 \\304\\221\\341\\273\\243i, \\304\\221ang hi\\341\\273\\207n...\\0\"\\\n  \"T\\341\\272\\255p tin Postscript\\0\"\\\n  \"Tr\\303\\254nh chi\\341\\272\\277u\\tCtrl+L\\0\"\\\n  \"Trang tr\\306\\260\\341\\273\\233c\\0\"\\\n  \"In\\0\"\\\n  \"Gi\\341\\273\\233i h\\341\\272\\241n v\\303\\271ng in\\0\"\\\n  \"M\\303\\241y in v\\341\\273\\233i t\\303\\252n \\304\\221\\306\\260\\341\\273\\243c cho kh\\303\\264ng t\\341\\273\\223n t\\341\\272\\241i\\0\"\\\n  \"\\304\\220ang in.\\0\"\\\n  \"V\\341\\272\\253n c\\303\\262n \\304\\221ang in. H\\341\\273\\247y b\\341\\273\\217 v\\303\\240 tho\\303\\241t ra?\\0\"\\\n  \"V\\341\\272\\253n c\\303\\262n \\304\\221ang in. Tho\\303\\241t v\\303\\240 b\\341\\272\\257t \\304\\221\\341\\272\\247u l\\341\\272\\241i?\\0\"\\\n  \"\\304\\220ang in trang %d tr\\303\\252n %d...\\0\"\\\n  \"L\\341\\273\\227i in.\\0\"\\\n  \"\\304\\220\\341\\273\\225i t\\303\\252&n...\\tF2\\0\"\\\n  \"Nh\\341\\273\\233 c\\303\\241c t\\341\\272\\255p tin \\304\\221\\303\\243 m\\341\\273\\237\\0\"\\\n  \"X\\303\\263a kh\\341\\273\\217i \\306\\257a th\\303\\255ch\\0\"\\\n  \"Xo\\303\\241 trang %s kh\\341\\273\\217i \\306\\257a th\\303\\255ch\\0\"\\\n  \"\\304\\220\\341\\273\\225i t\\303\\252n th\\303\\240nh\\0\"\\\n  \"Quay tr\\303\\241i\\tCtrl+Shift+-\\0\"\\\n  \"Quay ph\\341\\272\\243i\\tCtrl+Shift++\\0\"\\\n  \"L\\306\\260u th\\303\\240nh\\0\"\\\n  \"L\\306\\260u l\\341\\273\\221i t\\341\\272\\257t...\\tCtrl+Shift+S\\0\"\\\n  \"\\304\\220ang t\\303\\254m %d tr\\303\\252n %d\\0\"\\\n  \"Ch\\341\\273\\215n h\\341\\272\\277t\\0\"\\\n  \"Ch\\341\\273\\215n h\\341\\272\\277t\\tCtrl+A\\0\"\\\n  \"\\304\\220\\303\\241nh d\\341\\272\\245u n\\341\\273\\231i dung b\\341\\272\\261ng Ctrl+ph\\303\\255m chu\\341\\273\\231t tr\\303\\241i\\0\"\\\n  \"L\\341\\273\\261a ch\\341\\273\\215n:\\0\"\\\n  \"G\\341\\273\\255i qua &email...\\0\"\\\n  \"\\304\\220\\341\\272\\267t d\\303\\262ng l\\341\\273\\207nh t\\303\\254m ki\\341\\272\\277m ng\\306\\260\\341\\273\\243c\\0\"\\\n  \"Hi\\341\\273\\207n ch\\341\\273\\211 d\\341\\272\\245u s\\303\\241ch\\0\"\\\n  \"Xem trang li\\303\\252n ti\\341\\272\\277p\\0\"\\\n  \"Hi\\341\\273\\207n thanh c\\303\\264ng c\\341\\273\\245\\0\"\\\n  \"Hi\\341\\273\\207n \\306\\257a th\\303\\255ch\\0\"\\\n  \"Hi\\341\\273\\207n \\304\\220\\341\\273\\215c th\\306\\260\\341\\273\\235ng xuy\\303\\252n\\0\"\\\n  \"Hi\\341\\273\\207n ch\\341\\273\\211 d\\341\\272\\245u s\\303\\241ch n\\341\\272\\277u c\\303\\263\\0\"\\\n  \"Trang \\304\\221\\306\\241n\\0\"\\\n  \"Xin l\\341\\273\\227i, \\304\\221i\\341\\273\\201u \\304\\221\\303\\263 kh\\303\\264ng n\\303\\252n x\\341\\272\\243y ra!\\n\\nVui l\\303\\262ng b\\341\\272\\245m 'Cancel', n\\341\\272\\277u b\\341\\272\\241n mu\\341\\273\\221n gi\\303\\272p ch\\303\\272ng t\\303\\264i s\\341\\273\\255a ch\\341\\273\\257a l\\303\\275 do c\\341\\273\\247a tr\\306\\260\\341\\273\\235ng h\\341\\273\\243p l\\341\\273\\227i n\\303\\240y.\\0\"\\\n  \"T\\341\\272\\255p tin ngu\\341\\273\\223n %s kh\\303\\264ng c\\303\\263 \\304\\221i\\341\\273\\203m \\304\\221\\341\\273\\223ng b\\341\\273\\231\\0\"\\\n  \"Ch\\341\\273\\247 \\304\\221\\341\\273\\201:\\0\"\\\n  \"Tu\\341\\273\\263 ch\\341\\273\\215n SumatraPDF\\0\"\\\n  \"C\\341\\272\\255p nh\\341\\272\\255t SumatraPDF\\0\"\\\n  \"SumatraPDF \\304\\221\\303\\243 ng\\306\\260ng ho\\341\\272\\241t \\304\\221\\341\\273\\215ng\\0\"\\\n  \"SumatraPDF l\\303\\240 tr\\303\\254nh \\304\\221\\341\\273\\215c PDF ch\\303\\255nh c\\341\\273\\247a b\\341\\272\\241n\\0\"\\\n  \"SumatraPDF gi\\341\\273\\235 l\\303\\240 tr\\303\\254nh \\304\\221\\341\\273\\215c PDF ch\\303\\255nh c\\341\\273\\247a b\\341\\272\\241n\\0\"\\\n  \"Kh\\303\\264ng m\\341\\273\\237 \\304\\221\\306\\260\\341\\273\\243c t\\341\\272\\255p tin \\304\\221\\341\\273\\223ng b\\341\\273\\231\\0\"\\\n  \"PDF \\304\\221\\306\\260\\341\\273\\243c g\\341\\272\\257n th\\341\\272\\273\\0\"\\\n  \"T\\341\\272\\255p tin v\\304\\203n b\\341\\272\\243n\\0\"\\\n  \"T\\303\\240i li\\341\\273\\207u n\\303\\240y c\\303\\263 v\\303\\240i t\\303\\255nh n\\304\\203ng kh\\303\\264ng \\304\\221\\306\\260\\341\\273\\243c h\\341\\273\\227 tr\\341\\273\\243 (%s) v\\303\\240 kh\\303\\264ng \\304\\221\\306\\260\\341\\273\\243c d\\341\\273\\261ng ch\\303\\255nh x\\303\\241c\\0\"\\\n  \"T\\341\\273\\261a \\304\\221\\341\\273\\201\\0\"\\\n  \"Kh\\303\\264ng r\\303\\265 t\\341\\272\\255p tin ngu\\341\\273\\223n (%s)\\0\"\\\n  \"D\\303\\271ng &th\\341\\272\\273\\0\"\\\n  \"Hi\\341\\273\\203n th\\341\\273\\213\\0\"\\\n  \"Trang ch\\341\\273\\247\\0\"\\\n  \"C\\341\\272\\243nh b\\303\\241o\\0\"\\\n  \"T\\341\\272\\255p tin XPS\\0\"\\\n  \"B\\341\\272\\241n \\304\\221ang d\\303\\271ng phi\\303\\252n b\\341\\272\\243n m\\341\\273\\233i nh\\341\\272\\245t.\\0\"\\\n  \"B\\341\\272\\241n \\304\\221ang d\\303\\271ng phi\\303\\252n b\\341\\272\\243n %s\\0\"\\\n  \"Thu Ph\\303\\263ng\\0\"\\\n  \"Ph\\303\\263ng to\\0\"\\\n  \"Thu nh\\341\\273\\217\\0\"\\\n  \"H\\341\\273\\207 s\\341\\273\\221 thu ph\\303\\263ng\\0\"\\\n  \"[Ph\\303\\241t hi\\341\\273\\207n thay \\304\\221\\341\\273\\225i; \\304\\221ang c\\341\\272\\255p nh\\341\\272\\255t] %s\\0\"\\\n  \"\\304\\221ang ch\\303\\251p v\\304\\203n b\\341\\272\\243n\\0\"\\\n  \"\\304\\221ang in t\\341\\272\\255p tin\\0\";\n\nconst char * gTranslations_cy = \n  \"&Ynghylch...\\0\"\\\n  \"&Gwir Faint\\tCtrl+1\\0\"\\\n  \"Dewisiadau &Uwch...\\0\"\\\n  \"&Pob tudalen \\303\\242 ddewiswyd\\0\"\\\n  \"N\\303\\264l\\tAlt+Saeth Chwith\\0\"\\\n  \"Golwg &Llyfr\\tCtrl+8\\0\"\\\n  \"&Cau\\tCtrl+W\\0\"\\\n  \"Cop\\303\\257o &Dewis\\0\"\\\n  \"Cop\\303\\257o'r Dewis\\tCtrl+C\\0\"\\\n  \"&Peidio gofyn eto\\0\"\\\n  \"Tudalennau &eilrif yn unig\\0\"\\\n  \"&Gwynebu\\tCtrl+7\\0\"\\\n  \"&Ffeil\\0\"\\\n  \"&Canfod beth:\\0\"\\\n  \"Tudalen Gyntaf\\tHome\\0\"\\\n  \"&Ffitio tudalennau i ardal argraffu\\0\"\\\n  \"&Mynd i\\0\"\\\n  \"&Mynd i dudalen:\\0\"\\\n  \"&Cymorth\\0\"\\\n  \"Tudalen Olaf\\tEnd\\0\"\\\n  \"&Chwyddiad:\\0\"\\\n  \"&Llawlyfr\\0\"\\\n  \"&Cydweddu maint\\0\"\\\n  \"Tudalen Nesaf\\t->\\0\"\\\n  \"&Na\\0\"\\\n  \"&Dim diolch\\0\"\\\n  \"Tudalennau &odrif yn unig\\0\"\\\n  \"Agor &Dogfen\\0\"\\\n  \"&Agor...\\tCtrl+O\\0\"\\\n  \"&Dewisiadau...\\0\"\\\n  \"&Cyfrinair:\\0\"\\\n  \"&Pinio Dogfen\\0\"\\\n  \"Tudalen &Flaenorol\\tSaeth Chwith\\0\"\\\n  \"&Argraffu...\\0\"\\\n  \"&Argraffu...\\tCtrl+P\\0\"\\\n  \"&Argraffu... (gwrthodwyd)\\0\"\\\n  \"&Cofio cyfrinair y ddogfen\\0\"\\\n  \"C&ofio'r gosodiadau hyn ar gyfer pob dogfen\\0\"\\\n  \"&Tynnu Dogfen\\0\"\\\n  \"&Cadw fel...\\0\"\\\n  \"&Cadw fel...\\tCtrl+S\\0\"\\\n  \"&Gosodiadau\\0\"\\\n  \"C&rebachu tudalennau i'r ardal argraffu (os oes angen)\\0\"\\\n  \"Tudalen &Unigol\\tCtrl+6\\0\"\\\n  \"&Hepgor y fersiwn yma.\\0\"\\\n  \"&Defnyddio maint gwreiddiol y dudalen\\0\"\\\n  \"&Gweld\\0\"\\\n  \"&Ffenestr\\0\"\\\n  \"&Iawn\\0\"\\\n  \"&Chwyddo\\0\"\\\n  \"(o %d)\\0\"\\\n  \"(tudalen %s)\\0\"\\\n  \"Ynghylch SumatraPDF\\0\"\\\n  \"Ychwanegu Ffefryn\\0\"\\\n  \"Ychwanegu tudalen %s i'r Ffefrynnau\\0\"\\\n  \"Ychwanegu tudalen %s i'r ffefrynnau gyda'r enw (dewisiol):\\0\"\\\n  \"Ychwanegu i'r ffefrynnau\\0\"\\\n  \"Uwch\\0\"\\\n  \"Pob ffeil\\0\"\\\n  \"Pob dogfen sy'n cael ei chynnal\\0\"\\\n  \"Rhaglen:\\0\"\\\n  \"Cysylltu gyda ffeiliau PDF?\\0\"\\\n  \"Atodiad: %s\\0\"\\\n  \"Awdur:\\0\"\\\n  \"Awtomatig\\0\"\\\n  \"Gwirio'n awtomatig am &ddiweddariadau\\0\"\\\n  \"Golwg Llyfr\\0\"\\\n  \"Nodau Tudalen\\tF12\\0\"\\\n  \"Llwybrau Byr Nodau Tudalen\\0\"\\\n  \"Llwybr byr nod tudalen i dudalen %s o %s\\0\"\\\n  \"Nodau Tudalen\\0\"\\\n  \"Beit\\0\"\\\n  \"Dogfennau CHM\\0\"\\\n  \"Methu cysylltu \\303\\242'r Rhyngrwyd (gwall %#x).\\0\"\\\n  \"Diddymu\\0\"\\\n  \"Methu argraffu'r ffeil\\0\"\\\n  \"Methu cychwyn gorchymyn chwilio gwrthdro. Gwiriwch y linell orchymyn yn y gosodiadau\\0\"\\\n  \"Newid Iaith\\0\"\\\n  \"Gwirio am &Ddiweddariad\\0\"\\\n  \"Llyfrau Comics\\0\"\\\n  \"Cydnawsedd\\0\"\\\n  \"Didor\\0\"\\\n  \"Golwg Llyfr Didor\\0\"\\\n  \"Gwynebu'n Ddidor\\0\"\\\n  \"Cyfrannu Cyfieithiad.\\0\"\\\n  \"Cop\\303\\257o &Delwedd\\0\"\\\n  \"Cop\\303\\257o &Dolen Cyfeiriad\\0\"\\\n  \"Cop\\303\\257o &Sylw\\0\"\\\n  \"Cop\\303\\257o testun wedi ei atal (cop\\303\\257o fel delwedd yn unig)\\0\"\\\n  \"Hawlfraint\\0\"\\\n  \"Methu canfod priodweddau Argraffydd\\0\"\\\n  \"Methu cychwyn yr argraffydd\\0\"\\\n  \"Methu cyflwyno'r dudalen\\0\"\\\n  \"Cr\\303\\253wyd:\\0\"\\\n  \"Ffeil cyfredol\\0\"\\\n  \"Safle'r cyrchwr:\\0\"\\\n  \"&Addasu Chwyddo...\\tCtrl+Y\\0\"\\\n  \"&Cynllun Rhagosodedig:\\0\"\\\n  \"C&hwyddo Rhagosodedig:\\0\"\\\n  \"Nid oes modd newid y prif ddarllenydd yn y modd cludadwy\\0\"\\\n  \"Gwrthodwyd Caniat\\303\\242d:\\0\"\\\n  \"Dogfennau DjVu\\0\"\\\n  \"Priodweddau Dogfen\\0\"\\\n  \"Llwytho i Lawr\\0\"\\\n  \"&Gadael\\tCtrl+Q\\0\"\\\n  \"eLyfrau EPUB\\0\"\\\n  \"Rhoi cyfrinair\\0\"\\\n  \"Rhoi cyfrinair ar gyfer %s\\0\"\\\n  \"Rhowch y llinell orchymyn i'w gychwyn pan yn rhoi clic dwbl i ddogfen PDF:\\0\"\\\n  \"Gwall llwytho %s\\0\"\\\n  \"&Ffefrynnau\\0\"\\\n  \"Ymlaen\\tAlt+Saeth Dde\\0\"\\\n  \"Sgrin Lawn\\tCtrl+Shift+L\\0\"\\\n  \"Gwynebu\\0\"\\\n  \"Methwyd ailenwi'r ffeil!\\0\"\\\n  \"Methwyd cadw ffeil\\0\"\\\n  \"Golwg Gwe Cyflym\\0\"\\\n  \"Ffefrynnau\\0\"\\\n  \"Dogfennau FictionBook\\0\"\\\n  \"Heb ganfod ffeil %s\\0\"\\\n  \"Maint Ffeil:\\0\"\\\n  \"Ffeil:\\0\"\\\n  \"Canfod...\\tCtrl+F\\0\"\\\n  \"Canfod\\0\"\\\n  \"Canfod y Nesaf\\0\"\\\n  \"Canfod y Blaenorol\\0\"\\\n  \"Canfod:\\0\"\\\n  \"Ffitio'r &Cynnwys\\tCtrl+3\\0\"\\\n  \"&Ffitio'r Dudalen\\tCtrl+0\\0\"\\\n  \"&Fitio'r Lled\\tCtrl+2\\0\"\\\n  \"Ffitio'r Cynnwys\\0\"\\\n  \"Ffitio'r Dudalen\\0\"\\\n  \"Fitio'r Lled\\0\"\\\n  \"Ffitio'r Lled a Dangos Tudalennau'n Barhaus\\0\"\\\n  \"Ffitio Tudalen Unigol\\0\"\\\n  \"Ffontiau:\\0\"\\\n  \"Fformatio'r llyfr... %d tudalen\\0\"\\\n  \"Canfod testun ar dudalen %s\\0\"\\\n  \"Canfod testun ar dudalen %s (eto)\\0\"\\\n  \"Darllen yn Aml\\0\"\\\n  \"\\0\"\\\n  \"Mynd i dudalen\\0\"\\\n  \"Cuddio darllen yn aml\\0\"\\\n  \"Cyngor: Defnyddiwch bysell F3 i ganfod eto\\0\"\\\n  \"Ffeiliau delwedd  (*.%s)\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"Gosod SumatraPDF fel rhaglen rhagosodedig ar gyfer ffeiliau PDF?\\0\"\\\n  \"Gosod SumatraPDF fel y darllenydd PDF rhagosodedig\\0\"\\\n  \"Modd &Manga\\0\"\\\n  \"Cydweddu Maint\\0\"\\\n  \"Dogfennau Mobi\\0\"\\\n  \"Newidwyd:\\0\"\\\n  \"Mae fersiwn newydd o %s ar gael. Llwytho'r fersiwn newydd i lawr??\\0\"\\\n  \"Tudalen Nesaf\\0\"\\\n  \"Heb ganfod cyfatebiad\\0\"\\\n  \"Dim canlyniad o liell %u yn ffeil %s\\0\"\\\n  \"Heb ganfod ffeil cydweddu\\0\"\\\n  \"Dim gwybodaeth cydweddu yn y fan hon\\0\"\\\n  \"Nifer o Dudalennau:\\0\"\\\n  \"Iawn\\0\"\\\n  \"Agor\\0\"\\\n  \"Agor yn PDF-XChange\\0\"\\\n  \"Agor dogfen...\\0\"\\\n  \"Agor yn %s\\0\"\\\n  \"Agor yn &Adobe Reader\\0\"\\\n  \"Agor yn &Foxit Reader\\0\"\\\n  \"Agor yn Microsoft HTML Help\\0\"\\\n  \"Agor yn Microsoft XPS-Viewer\\0\"\\\n  \"&Priodweddau\\0\"\\\n  \"P&riodweddau...\\tCtrl+D\\0\"\\\n  \"Dogfen PDF\\0\"\\\n  \"Gwella'r PDF\\0\"\\\n  \"Cynhyrchydd PDF:\\0\"\\\n  \"PDF Fersiwn:\\0\"\\\n  \"Dogfennau PDF\\0\"\\\n  \"Tudalen...\\tCtrl+G\\0\"\\\n  \"Tudalen %s\\0\"\\\n  \"Maint Tudalen:\\0\"\\\n  \"Nid yw tudalen rhif %u yn bodoli\\0\"\\\n  \"Graddio tudalen\\0\"\\\n  \"Tudalen:\\0\"\\\n  \"Dogfennau PalmDoc\\0\"\\\n  \"Arhoswch, wrthi'n cyflwyno...\\0\"\\\n  \"Dogfennau postscript\\0\"\\\n  \"Cyflwyniad\\tCtrl+L\\0\"\\\n  \"Tudalen Flaenorol\\0\"\\\n  \"Argraffu\\0\"\\\n  \"Ystod argraffu\\0\"\\\n  \"Nid oes argraffydd gyda'r enw yna'n bod\\0\"\\\n  \"Wrthi'n argraffu.\\0\"\\\n  \"Dal wrthi'n argraffu. Hepgor a gadael?\\0\"\\\n  \"Dal wrthi'n argraffu. Hepgor a chychwyn eto?\\0\"\\\n  \"Argraffu tudalen %d o %d...\\0\"\\\n  \"Anhawster argraffu\\0\"\\\n  \"&Ailenwi...\\tF2\\0\"\\\n  \"Co&fio ffeiliau ar agor\\0\"\\\n  \"Tynnu o'r ffefrynnau\\0\"\\\n  \"Tynnu tudalen %s o'r ffefrynnau\\0\"\\\n  \"Ailenwi i\\0\"\\\n  \"Troi i'r &Chwith\\tCtrl+Shift+-\\0\"\\\n  \"Troi i'r dde\\tCtrl+Shift++\\0\"\\\n  \"Cadw fel\\0\"\\\n  \"Cadw'r &Llwybr Byr...\\tCtrl+Shift+S\\0\"\\\n  \"Chwilio am %d o %d...\\0\"\\\n  \"Dewis &Popeth\\0\"\\\n  \"Dewis &Popeth\\tCtrl+A\\0\"\\\n  \"Dewis cynnwys drwy Ctrl a botwm chwith y llygoden\\0\"\\\n  \"Dewis:\\0\"\\\n  \"Anfon drwy &E-bost...\\0\"\\\n  \"Gosod linell-orchymyn chwilio gwrthdro\\0\"\\\n  \"Dangos &Nodau Tudalen\\0\"\\\n  \"Dangos &tudalennau'n ddidor\\0\"\\\n  \"Dangos y &Bar Offer\\0\"\\\n  \"Dangos Ffefrynnau\\0\"\\\n  \"Dangos darllenwyd yn aml\\0\"\\\n  \"Dangos bar ochr y &nodau tudalen pan yw ar gael\\0\"\\\n  \"Tudalen unigol\\0\"\\\n  \"Ymddiheuriadau. Dylai hynny heb fod wedi digwydd!\\n\\nPwyswch 'Diddymu', os hoffech chi ein cynorthwyo i drwsio achos y gwall.\\0\"\\\n  \"Does dim pwynt cydweddu yn ffeil %s\\0\"\\\n  \"Pwnc:\\0\"\\\n  \"Dewisiadau SumatraPDF\\0\"\\\n  \"Diweddaru SumatraPDF\\0\"\\\n  \"Chwalodd SumatraPDF\\0\"\\\n  \"SumatraPDF yw eich prif ddarllenydd PDF\\0\"\\\n  \"SumatraPDF dylai fod eich prif ddarllenydd PDF\\0\"\\\n  \"Methu agor ffeil cydweddu\\0\"\\\n  \"PDF wedi ei thagio\\0\"\\\n  \"Dogfennau testun\\0\"\\\n  \"Mae'r ddogfen hon yn defnyddio nodweddion sydd ddim yn cael eu cynnal (%s) ac efallai na fyddant yn rendro'n gywir\\0\"\\\n  \"Teitl:\\0\"\\\n  \"Ffeil ffynhonnell anhysbys (%s)\\0\"\\\n  \"Defnyddio &tabiau\\0\"\\\n  \"Gweld\\0\"\\\n  \"&Ymweld \\303\\242'r Wefan\\0\"\\\n  \"Rhybudd\\0\"\\\n  \"Dogfennau XPS\\0\"\\\n  \"Mae'r fersiwn diweddaraf gennych.\\0\"\\\n  \"Mae fersiwn %s gennych\\0\"\\\n  \"Chwyddo\\0\"\\\n  \"Chwyddo i Mewn\\0\"\\\n  \"Chwyddo Allan\\0\"\\\n  \"Ffactor Chwyddo\\0\"\\\n  \"[Wedi canfod newidiadau: adnewyddu] %s\\0\"\\\n  \"cop\\303\\257o testun\\0\"\\\n  \"argraffu dogfen\\0\";\n\n\nstatic const char *gTranslations[LANGS_COUNT] = {\n  NULL,\n  gTranslations_sq, \n  gTranslations_ar, \n  gTranslations_am, \n  gTranslations_az, \n  gTranslations_eu, \n  gTranslations_bs, \n  gTranslations_bg, \n  gTranslations_ca, \n  gTranslations_ca_xv, \n  gTranslations_cn, \n  gTranslations_tw, \n  gTranslations_hr, \n  gTranslations_cz, \n  gTranslations_dk, \n  gTranslations_nl, \n  gTranslations_et, \n  gTranslations_fi, \n  gTranslations_fr, \n  gTranslations_gl, \n  gTranslations_ka, \n  gTranslations_de, \n  gTranslations_el, \n  gTranslations_he, \n  gTranslations_hi, \n  gTranslations_hu, \n  gTranslations_id, \n  gTranslations_ga, \n  gTranslations_it, \n  gTranslations_ja, \n  gTranslations_kr, \n  gTranslations_ku, \n  gTranslations_lv, \n  gTranslations_lt, \n  gTranslations_mk, \n  gTranslations_my, \n  gTranslations_ne, \n  gTranslations_no, \n  gTranslations_nn, \n  gTranslations_fa, \n  gTranslations_pl, \n  gTranslations_br, \n  gTranslations_pt, \n  gTranslations_ro, \n  gTranslations_ru, \n  gTranslations_sr_rs, \n  gTranslations_sp_rs, \n  gTranslations_sk, \n  gTranslations_sl, \n  gTranslations_es, \n  gTranslations_sv, \n  gTranslations_ta, \n  gTranslations_tr, \n  gTranslations_uk, \n  gTranslations_uz, \n  gTranslations_vn, \n  gTranslations_cy\n};\n\nconst char *GetTranslationsForLang(int langIdx) { return gTranslations[langIdx]; }\n\n\nconst char *gLangCodes =   \"en\\0\" \\\n  \"sq\\0\" \\\n  \"ar\\0\" \\\n  \"am\\0\" \\\n  \"az\\0\" \\\n  \"eu\\0\" \\\n  \"bs\\0\" \\\n  \"bg\\0\" \\\n  \"ca\\0\" \\\n  \"ca-xv\\0\" \\\n  \"cn\\0\" \\\n  \"tw\\0\" \\\n  \"hr\\0\" \\\n  \"cz\\0\" \\\n  \"dk\\0\" \\\n  \"nl\\0\" \\\n  \"et\\0\" \\\n  \"fi\\0\" \\\n  \"fr\\0\" \\\n  \"gl\\0\" \\\n  \"ka\\0\" \\\n  \"de\\0\" \\\n  \"el\\0\" \\\n  \"he\\0\" \\\n  \"hi\\0\" \\\n  \"hu\\0\" \\\n  \"id\\0\" \\\n  \"ga\\0\" \\\n  \"it\\0\" \\\n  \"ja\\0\" \\\n  \"kr\\0\" \\\n  \"ku\\0\" \\\n  \"lv\\0\" \\\n  \"lt\\0\" \\\n  \"mk\\0\" \\\n  \"my\\0\" \\\n  \"ne\\0\" \\\n  \"no\\0\" \\\n  \"nn\\0\" \\\n  \"fa\\0\" \\\n  \"pl\\0\" \\\n  \"br\\0\" \\\n  \"pt\\0\" \\\n  \"ro\\0\" \\\n  \"ru\\0\" \\\n  \"sr-rs\\0\" \\\n  \"sp-rs\\0\" \\\n  \"sk\\0\" \\\n  \"sl\\0\" \\\n  \"es\\0\" \\\n  \"sv\\0\" \\\n  \"ta\\0\" \\\n  \"tr\\0\" \\\n  \"uk\\0\" \\\n  \"uz\\0\" \\\n  \"vn\\0\" \\\n  \"cy\\0\" \"\\0\";\n\nconst char *gLangNames =   \"English\\0\" \\\n  \"Albanian (Shqip)\\0\" \\\n  \"Arabic (\\330\\247\\331\\204\\331\\222\\330\\271\\331\\216\\330\\261\\331\\216\\330\\250\\331\\212\\331\\221\\330\\251)\\0\" \\\n  \"Armenian (\\325\\200\\325\\241\\325\\265\\325\\245\\326\\200\\325\\245\\325\\266)\\0\" \\\n  \"Azerbaijani (Az\\311\\231rbaycanca)\\0\" \\\n  \"Basque (Euskara)\\0\" \\\n  \"Bosnian (Bosanski)\\0\" \\\n  \"Bulgarian (\\320\\221\\321\\212\\320\\273\\320\\263\\320\\260\\321\\200\\321\\201\\320\\272\\320\\270)\\0\" \\\n  \"Catalan (Catal\\303\\240)\\0\" \\\n  \"Catalan-Valencian (Catal\\303\\240-Valenci\\303\\240)\\0\" \\\n  \"Chinese Simplified (\\347\\256\\200\\344\\275\\223\\344\\270\\255\\346\\226\\207)\\0\" \\\n  \"Chinese Traditional (\\347\\271\\201\\351\\253\\224\\344\\270\\255\\346\\226\\207)\\0\" \\\n  \"Croatian (Hrvatski)\\0\" \\\n  \"Czech (\\304\\214e\\305\\241tina)\\0\" \\\n  \"Danish (Dansk)\\0\" \\\n  \"Dutch (Nederlands)\\0\" \\\n  \"Estonian (Eesti)\\0\" \\\n  \"Finnish (Suomi)\\0\" \\\n  \"French (Fran\\303\\247ais)\\0\" \\\n  \"Galician (Galego)\\0\" \\\n  \"Georgian (\\341\\203\\245\\341\\203\\220\\341\\203\\240\\341\\203\\227\\341\\203\\243\\341\\203\\232\\341\\203\\230)\\0\" \\\n  \"German (Deutsch)\\0\" \\\n  \"Greek (\\316\\225\\316\\273\\316\\273\\316\\267\\316\\275\\316\\271\\316\\272\\316\\254)\\0\" \\\n  \"Hebrew (\\327\\242\\327\\221\\327\\250\\327\\231\\327\\252)\\0\" \\\n  \"Hindi (\\340\\244\\271\\340\\244\\277\\340\\244\\202\\340\\244\\246\\340\\245\\200)\\0\" \\\n  \"Hungarian (Magyar)\\0\" \\\n  \"Indonesian (Bahasa Indonesia)\\0\" \\\n  \"Irish (Gaeilge)\\0\" \\\n  \"Italian (Italiano)\\0\" \\\n  \"Japanese (\\346\\227\\245\\346\\234\\254\\350\\252\\236)\\0\" \\\n  \"Korean (\\355\\225\\234\\352\\265\\255\\354\\226\\264)\\0\" \\\n  \"Kurdish (\\331\\203\\331\\210\\330\\261\\330\\257\\333\\214)\\0\" \\\n  \"Latvian (latvie\\305\\241u valoda)\\0\" \\\n  \"Lithuanian (Lietuvi\\305\\263)\\0\" \\\n  \"Macedonian (\\320\\274\\320\\260\\320\\272\\320\\265\\320\\264\\320\\276\\320\\275\\321\\201\\320\\272\\320\\270)\\0\" \\\n  \"Malaysian (Bahasa Melayu)\\0\" \\\n  \"Nepali (\\340\\244\\250\\340\\245\\207\\340\\244\\252\\340\\244\\276\\340\\244\\262\\340\\245\\200)\\0\" \\\n  \"Norwegian (Norsk)\\0\" \\\n  \"Norwegian Neo-Norwegian (Norsk nynorsk)\\0\" \\\n  \"Persian (\\331\\201\\330\\247\\330\\261\\330\\263\\333\\214)\\0\" \\\n  \"Polish (Polski)\\0\" \\\n  \"Portuguese - Brazil (Portugu\\303\\252s)\\0\" \\\n  \"Portuguese - Portugal (Portugu\\303\\252s)\\0\" \\\n  \"Romanian (Rom\\303\\242n\\304\\203)\\0\" \\\n  \"Russian (\\320\\240\\321\\203\\321\\201\\321\\201\\320\\272\\320\\270\\320\\271)\\0\" \\\n  \"Serbian (Cyrillic)\\0\" \\\n  \"Serbian (Latin)\\0\" \\\n  \"Slovak (Sloven\\304\\215ina)\\0\" \\\n  \"Slovenian (Sloven\\305\\241\\304\\215ina)\\0\" \\\n  \"Spanish (Espa\\303\\261ol)\\0\" \\\n  \"Swedish (Svenska)\\0\" \\\n  \"Tamil (\\340\\256\\244\\340\\256\\256\\340\\256\\277\\340\\256\\264\\340\\257\\215)\\0\" \\\n  \"Turkish (T\\303\\274rk\\303\\247e)\\0\" \\\n  \"Ukrainian (\\320\\243\\320\\272\\321\\200\\320\\260\\321\\227\\320\\275\\321\\201\\321\\214\\320\\272\\320\\260)\\0\" \\\n  \"Uzbek (O'zbek)\\0\" \\\n  \"Vietnamese (Vi\\341\\273\\207t Nam)\\0\" \\\n  \"Welsh (Cymraeg)\\0\" \"\\0\";\n\n// from http://msdn.microsoft.com/en-us/library/windows/desktop/dd318693(v=vs.85).aspx\n// those definition are not present in 7.0A SDK my VS 2010 uses\n#ifndef LANG_CENTRAL_KURDISH\n#define LANG_CENTRAL_KURDISH 0x92\n#endif\n\n#ifndef SUBLANG_CENTRAL_KURDISH_CENTRAL_KURDISH_IRAQ\n#define SUBLANG_CENTRAL_KURDISH_CENTRAL_KURDISH_IRAQ 0x01\n#endif\n\n#define _LANGID(lang) MAKELANGID(lang, SUBLANG_NEUTRAL)\nconst LANGID gLangIds[LANGS_COUNT] = {\n  _LANGID(LANG_ENGLISH),\n  _LANGID(LANG_ALBANIAN),\n  _LANGID(LANG_ARABIC),\n  _LANGID(LANG_ARMENIAN),\n  _LANGID(LANG_AZERI),\n  _LANGID(LANG_BASQUE),\n  MAKELANGID(LANG_BOSNIAN, SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN),\n  _LANGID(LANG_BULGARIAN),\n  _LANGID(LANG_CATALAN),\n  (LANGID)-1,\n  MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED),\n  MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL),\n  _LANGID(LANG_CROATIAN),\n  _LANGID(LANG_CZECH),\n  _LANGID(LANG_DANISH),\n  _LANGID(LANG_DUTCH),\n  _LANGID(LANG_ESTONIAN),\n  _LANGID(LANG_FINNISH),\n  _LANGID(LANG_FRENCH),\n  _LANGID(LANG_GALICIAN),\n  _LANGID(LANG_GEORGIAN),\n  _LANGID(LANG_GERMAN),\n  _LANGID(LANG_GREEK),\n  _LANGID(LANG_HEBREW),\n  _LANGID(LANG_HINDI),\n  _LANGID(LANG_HUNGARIAN),\n  _LANGID(LANG_INDONESIAN),\n  _LANGID(LANG_IRISH),\n  _LANGID(LANG_ITALIAN),\n  _LANGID(LANG_JAPANESE),\n  _LANGID(LANG_KOREAN),\n  MAKELANGID(LANG_CENTRAL_KURDISH, SUBLANG_CENTRAL_KURDISH_CENTRAL_KURDISH_IRAQ),\n  _LANGID(LANG_LATVIAN),\n  _LANGID(LANG_LITHUANIAN),\n  _LANGID(LANG_MACEDONIAN),\n  _LANGID(LANG_MALAY),\n  _LANGID(LANG_NEPALI),\n  MAKELANGID(LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL),\n  MAKELANGID(LANG_NORWEGIAN, SUBLANG_NORWEGIAN_NYNORSK),\n  _LANGID(LANG_FARSI),\n  _LANGID(LANG_POLISH),\n  MAKELANGID(LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN),\n  _LANGID(LANG_PORTUGUESE),\n  _LANGID(LANG_ROMANIAN),\n  _LANGID(LANG_RUSSIAN),\n  MAKELANGID(LANG_SERBIAN, SUBLANG_SERBIAN_CYRILLIC),\n  MAKELANGID(LANG_SERBIAN, SUBLANG_SERBIAN_LATIN),\n  _LANGID(LANG_SLOVAK),\n  _LANGID(LANG_SLOVENIAN),\n  _LANGID(LANG_SPANISH),\n  _LANGID(LANG_SWEDISH),\n  _LANGID(LANG_TAMIL),\n  _LANGID(LANG_TURKISH),\n  _LANGID(LANG_UKRAINIAN),\n  _LANGID(LANG_UZBEK),\n  _LANGID(LANG_VIETNAMESE),\n  _LANGID(LANG_WELSH)\n};\n#undef _LANGID\n\nbool IsLangRtl(int idx)\n{\n  return (2 == idx) || (23 == idx) || (31 == idx) || (39 == idx);\n}\n\nint gLangsCount = LANGS_COUNT;\nint gStringsCount = STRINGS_COUNT;\n\nconst LANGID *GetLangIds() { return &gLangIds[0]; }\n\n} // namespace trans\n"
  },
  {
    "path": "src/Translations.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"Translations.h\"\r\n\r\n#ifdef DEBUG\r\n// define for adding \"English RTL\" for testing RTL layout\r\n#define ADD_EN_RTL_TEST_LANGUAGE\r\n#endif\r\n\r\n// set to 0 for not compressed. Must match trans_gen.py (gen_c_code_for_dir).\r\n// Also, in Sumatra, when using compressed, UNINSTALLER_OBJS need to include $(ZLIB_OBJS)\r\n// in makefile.msvc\r\n#define COMPRESSED 0\r\n// set to 0 for not compressed.\r\n\r\n#if COMPRESSED == 1\r\n\r\n// local copy of uncompr.c\r\n//#define ZLIB_INTERNAL\r\n#include \"zlib.h\"\r\n\r\nint uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)\r\n{\r\n    z_stream stream;\r\n    int err;\r\n\r\n    stream.next_in = (Bytef*)source;\r\n    stream.avail_in = (uInt)sourceLen;\r\n    /* Check for source > 64K on 16-bit machine: */\r\n    if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;\r\n\r\n    stream.next_out = dest;\r\n    stream.avail_out = (uInt)*destLen;\r\n    if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;\r\n\r\n    stream.zalloc = (alloc_func)0;\r\n    stream.zfree = (free_func)0;\r\n\r\n    err = inflateInit(&stream);\r\n    if (err != Z_OK) return err;\r\n\r\n    err = inflate(&stream, Z_FINISH);\r\n    if (err != Z_STREAM_END) {\r\n        inflateEnd(&stream);\r\n        if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0))\r\n            return Z_DATA_ERROR;\r\n        return err;\r\n    }\r\n    *destLen = stream.total_out;\r\n\r\n    err = inflateEnd(&stream);\r\n    return err;\r\n}\r\n#endif // COMPRESSED == 1\r\n\r\n/*\r\nTODO:\r\n - could use bzip2 for compression for additional ~7k savings\r\n*/\r\n\r\n// Note: this code is intentionally optimized for (small) size, not speed\r\n\r\nnamespace trans {\r\n\r\n// defined in Trans*_txt.cpp\r\nextern int              gLangsCount;\r\nextern int              gStringsCount;\r\nextern const char *     gLangNames;\r\nextern const char *     gLangCodes;\r\nconst LANGID *          GetLangIds();\r\nbool                    IsLangRtl(int langIdx);\r\nconst char **           GetOriginalStrings();\r\n\r\n// used locally, gCurrLangCode points into gLangCodes\r\nstatic const char *     gCurrLangCode = nullptr;\r\nstatic int              gCurrLangIdx = 0;\r\n\r\n// Note: we don't have access to STRINGS_COUNT and LANGS_COUNT\r\n// hence foo[] => *foo here\r\n// const char *gCurrLangStrings[STRINGS_COUNT];\r\nconst char **           gCurrLangStrings = nullptr;\r\n// WCHAR ** gLangsTransCache[LANGS_COUNT];\r\nWCHAR ***               gLangsTransCache = nullptr;\r\n\r\n#if COMPRESSED == 1\r\n// const char *gLangsStringsUncompressed[LANGS_COUNT];\r\nconst unsigned char *   GetTranslationsForLang(int langIdx, uint32_t *uncompressedSizeOut, uint32_t *compressedSizeOut);\r\nconst char **           gLangsStringsUncompressed = nullptr;\r\n#else\r\nconst char *   GetTranslationsForLang(int langIdx);\r\n#endif\r\n\r\n#ifdef ADD_EN_RTL_TEST_LANGUAGE\r\n#define EN_RTL_CODE \"en-rtl\"\r\n#define EN_RTL_NAME \"English RTL for testing\"\r\n#define EN_RTL_IDX  gLangsCount\r\n#endif\r\n\r\n/* In general, after adding new _TR() strings, one has to re-generate Translations_txt.cpp, but\r\nthat also requires uploading new strings to the server, for which one needs access.\r\n\r\nTo support adding new strings without re-generating Translatiosn_txt.cpp, we have a concept\r\nof missing translations. */\r\n\r\nstruct MissingTranslation {\r\n    const char *s;\r\n    const WCHAR *translation;\r\n};\r\n\r\n// number of missing translations should be small\r\nstatic MissingTranslation  gMissingTranslations[64];\r\nstatic int                 gMissingTranslationsCount = 0;\r\n\r\nstatic void FreeMissingTranslations()\r\n{\r\n    for (int i=0; i < gMissingTranslationsCount; i++) {\r\n        free((void*)gMissingTranslations[i].translation);\r\n    }\r\n    gMissingTranslationsCount = 0;\r\n}\r\n\r\nstatic const WCHAR *FindOrAddMissingTranslation(const char *s)\r\n{\r\n    for (int i = 0; i < gMissingTranslationsCount; i++) {\r\n        if (s == gMissingTranslations[i].s) {\r\n            return gMissingTranslations[i].translation;\r\n        }\r\n    }\r\n    if (gMissingTranslationsCount >= dimof(gMissingTranslations))\r\n        return L\"missing translation\";\r\n\r\n    gMissingTranslations[gMissingTranslationsCount].s = s;\r\n    const WCHAR *res = str::conv::FromUtf8(s);\r\n    gMissingTranslations[gMissingTranslationsCount].translation = res;\r\n    gMissingTranslationsCount++;\r\n    return res;\r\n}\r\n\r\nint GetLangsCount()\r\n{\r\n#ifdef ADD_EN_RTL_TEST_LANGUAGE\r\n    return gLangsCount + 1;\r\n#else\r\n    return gLangsCount;\r\n#endif\r\n}\r\n\r\nconst char *GetCurrentLangCode()\r\n{\r\n    return gCurrLangCode;\r\n}\r\n\r\nstatic WCHAR **GetTransCacheForLang(int langIdx)\r\n{\r\n#ifdef ADD_EN_RTL_TEST_LANGUAGE\r\n    if (langIdx == EN_RTL_IDX)\r\n        langIdx = 0;\r\n#endif\r\n    if (!gLangsTransCache[langIdx])\r\n        gLangsTransCache[langIdx] = AllocArray<WCHAR *>(gStringsCount);\r\n    return gLangsTransCache[langIdx];\r\n}\r\n\r\nstatic void FreeTransCache()\r\n{\r\n    for (int langIdx = 0; langIdx < gLangsCount; langIdx++) {\r\n        WCHAR **transCache = gLangsTransCache[langIdx];\r\n        for (int i = 0; transCache && i < gStringsCount; i++) {\r\n            free(transCache[i]);\r\n        }\r\n        free(transCache);\r\n#if COMPRESSED == 1\r\n        if (gLangsStringsUncompressed[langIdx])\r\n            free((void*)gLangsStringsUncompressed[langIdx]);\r\n#endif\r\n    }\r\n    free(gLangsTransCache);\r\n    free(gCurrLangStrings);\r\n#if COMPRESSED == 1\r\n    free(gLangsStringsUncompressed);\r\n#endif\r\n}\r\n\r\nstatic void BuildStringsIndexForLang(int langIdx)\r\n{\r\n#ifdef ADD_EN_RTL_TEST_LANGUAGE\r\n    if (0 == gCurrLangIdx || EN_RTL_IDX == gCurrLangIdx) {\r\n#else\r\n    if (0 == gCurrLangIdx) {\r\n#endif\r\n        const char **origStrings = GetOriginalStrings();\r\n        for (int idx = 0; idx < gStringsCount; idx++) {\r\n            gCurrLangStrings[idx] = origStrings[idx];\r\n            CrashIf(!gCurrLangStrings[idx]);\r\n        }\r\n        return;\r\n    }\r\n\r\n#if COMPRESSED == 1\r\n    const char *s =  gLangsStringsUncompressed[langIdx];\r\n    if (nullptr == s) {\r\n        uint32_t uncompressedSize, compressedSize;\r\n        const unsigned char *compressed = GetTranslationsForLang(langIdx, &uncompressedSize, &compressedSize);\r\n        void *uncompressed = malloc(uncompressedSize);\r\n        uLongf uncompressedSizeReal;\r\n        int res = uncompress((Bytef*)uncompressed, &uncompressedSizeReal, compressed, compressedSize);\r\n        CrashAlwaysIf(Z_OK != res);\r\n        CrashAlwaysIf(uncompressedSize != uncompressedSizeReal);\r\n        gLangsStringsUncompressed[langIdx] = (const char *)uncompressed;\r\n        s = gLangsStringsUncompressed[langIdx];\r\n    }\r\n#else\r\n    const char *s = GetTranslationsForLang(langIdx);\r\n#endif\r\n    for (int i = 0; i < gStringsCount; i++) {\r\n        if (0 == *s)\r\n            gCurrLangStrings[i] = nullptr;\r\n        else\r\n            gCurrLangStrings[i] = s;\r\n        // advance to the next string\r\n        while (*s) {\r\n            ++s;\r\n        }\r\n        ++s;\r\n    }\r\n}\r\n\r\nvoid SetCurrentLangByCode(const char *langCode)\r\n{\r\n    if (!gCurrLangStrings) {\r\n        gCurrLangStrings = AllocArray<const char*>(gStringsCount);\r\n        gLangsTransCache = AllocArray<WCHAR **>(gLangsCount);\r\n#if COMPRESSED == 1\r\n        gLangsStringsUncompressed = AllocArray<const char*>(gLangsCount);\r\n#endif\r\n    }\r\n\r\n    if (str::Eq(langCode, gCurrLangCode))\r\n        return;\r\n\r\n    int idx = seqstrings::StrToIdx(gLangCodes, langCode);\r\n#ifdef ADD_EN_RTL_TEST_LANGUAGE\r\n    if (-1 == idx && str::Eq(langCode, EN_RTL_CODE))\r\n        idx = EN_RTL_IDX;\r\n#endif\r\n    CrashIf(-1 == idx);\r\n    gCurrLangIdx = idx;\r\n    gCurrLangCode = GetLangCodeByIdx(idx);\r\n    BuildStringsIndexForLang(gCurrLangIdx);\r\n}\r\n\r\nconst char *ValidateLangCode(const char *langCode)\r\n{\r\n    int idx = seqstrings::StrToIdx(gLangCodes, langCode);\r\n#ifdef ADD_EN_RTL_TEST_LANGUAGE\r\n    if (-1 == idx && str::Eq(langCode, EN_RTL_CODE))\r\n        idx = EN_RTL_IDX;\r\n#endif\r\n    if (-1 == idx)\r\n        return nullptr;\r\n    return GetLangCodeByIdx(idx);\r\n}\r\n\r\nconst char *GetLangCodeByIdx(int idx)\r\n{\r\n#ifdef ADD_EN_RTL_TEST_LANGUAGE\r\n    if (idx == EN_RTL_IDX)\r\n        return EN_RTL_CODE;\r\n#endif\r\n    return seqstrings::IdxToStr(gLangCodes, idx);\r\n}\r\n\r\nconst char *GetLangNameByIdx(int idx)\r\n{\r\n#ifdef ADD_EN_RTL_TEST_LANGUAGE\r\n    if (idx == EN_RTL_IDX)\r\n        return EN_RTL_NAME;\r\n#endif\r\n    return seqstrings::IdxToStr(gLangNames, idx);\r\n}\r\n\r\nbool IsCurrLangRtl()\r\n{\r\n#ifdef ADD_EN_RTL_TEST_LANGUAGE\r\n    if (gCurrLangIdx == EN_RTL_IDX)\r\n        return true;\r\n#endif\r\n    return IsLangRtl(gCurrLangIdx);\r\n}\r\n\r\nconst char *DetectUserLang()\r\n{\r\n    const LANGID *langIds = GetLangIds();\r\n    LANGID langId = GetUserDefaultUILanguage();\r\n    // try the exact match\r\n    for (int i = 0; i < gLangsCount; i++) {\r\n        if (langId == langIds[i])\r\n            return GetLangCodeByIdx(i);\r\n    }\r\n\r\n    // see if we have a translation in a language that has the same\r\n    // primary id as user's language and neutral sublang\r\n    LANGID userLangIdNeutral = MAKELANGID(PRIMARYLANGID(langId), SUBLANG_NEUTRAL);\r\n    for (int i = 0; i < gLangsCount; i++) {\r\n        if (userLangIdNeutral == langIds[i])\r\n            return GetLangCodeByIdx(i);\r\n    }\r\n\r\n    return \"en\";\r\n}\r\n\r\nstatic int GetEnglishStringIndex(const char* txt)\r\n{\r\n    const char **origStrings = GetOriginalStrings();\r\n    for (int idx = 0; idx < gStringsCount; idx++) {\r\n        const char *s = origStrings[idx];\r\n        if (str::Eq(s, txt))\r\n            return idx;\r\n    }\r\n    return -1;\r\n}\r\n\r\nconst WCHAR *GetTranslation(const char *s)\r\n{\r\n    if (nullptr == gCurrLangCode)\r\n        SetCurrentLangByCode(\"en\");\r\n\r\n    int idx = GetEnglishStringIndex(s);\r\n    if (-1 == idx)\r\n        return FindOrAddMissingTranslation(s);\r\n\r\n    const char *trans = gCurrLangStrings[idx];\r\n    // fall back to English if the language doesn't have a translations for this string\r\n    if (!trans)\r\n        trans = s;\r\n\r\n    WCHAR **transCache = GetTransCacheForLang(gCurrLangIdx);\r\n    if (!transCache[idx])\r\n        transCache[idx] = str::conv::FromUtf8(trans);\r\n    return transCache[idx];\r\n}\r\n\r\nvoid Destroy()\r\n{\r\n    if (!gCurrLangCode) {\r\n        // no need for clean-up if translations were never initialized\r\n        return;\r\n    }\r\n\r\n    FreeTransCache();\r\n    FreeMissingTranslations();\r\n}\r\n\r\n} // namespace trans\r\n"
  },
  {
    "path": "src/Translations.h",
    "content": "/* Copyright 2015 Krzysztof Kowalczyk.\r\n   License: BSD */\r\n\r\nnamespace trans {\r\n\r\nint GetLangsCount();\r\n\r\nconst char *GetCurrentLangCode();\r\n\r\nvoid            SetCurrentLangByCode(const char *langCode);\r\nconst char *    ValidateLangCode(const char *langCode);\r\n\r\nconst WCHAR *   GetTranslation(const char *s);\r\nconst char *    GetLangCodeByIdx(int idx);\r\nconst char *    GetLangNameByIdx(int idx);\r\nbool            IsCurrLangRtl();\r\nconst char *    DetectUserLang();\r\nvoid            Destroy();\r\n\r\n} // namespace trans\r\n\r\n// _TR() marks strings that need to be translated\r\n#define _TR(x)  trans::GetTranslation(x)\r\n\r\n// _TRN() marks strings that need to be translated but are used in a context\r\n// that doesn't allow calling Trans::GetTranslation() (e.g. when used as part\r\n// of a struct). This allows the translation manager script to see the string\r\n// but they'll need additional code that does Trans::GetTranslation() on them\r\n#define _TRN(x) (x)\r\n"
  },
  {
    "path": "src/UnitTests.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"AppUtil.h\"\r\n#include \"FileUtil.h\"\r\n#include \"WinUtil.h\"\r\n#include \"StrFormat.h\"\r\n\r\n#include \"SettingsStructs.h\"\r\n#include \"GlobalPrefs.h\"\r\n#include \"ParseCommandLine.h\"\r\n\r\n// must be last to over-write assert()\r\n#include \"UtAssert.h\"\r\n\r\nstatic void ParseCommandLineTest()\r\n{\r\n    {\r\n        CommandLineInfo i;\r\n        i.ParseCommandLine(L\"SumatraPDF.exe -bench foo.pdf\");\r\n        utassert(2 == i.pathsToBenchmark.Count());\r\n        utassert(str::Eq(L\"foo.pdf\", i.pathsToBenchmark.At(0)));\r\n        utassert(nullptr == i.pathsToBenchmark.At(1));\r\n    }\r\n\r\n    {\r\n        CommandLineInfo i;\r\n        i.ParseCommandLine(L\"SumatraPDF.exe -bench foo.pdf -fwdsearch-width 5\");\r\n        utassert(i.globalPrefArgs.Count() == 2);\r\n        const WCHAR *s = i.globalPrefArgs.At(0);\r\n        utassert(str::Eq(s, L\"-fwdsearch-width\"));\r\n        s = i.globalPrefArgs.At(1);\r\n        utassert(str::Eq(s, L\"5\"));\r\n        utassert(2 == i.pathsToBenchmark.Count());\r\n        utassert(str::Eq(L\"foo.pdf\", i.pathsToBenchmark.At(0)));\r\n        utassert(nullptr == i.pathsToBenchmark.At(1));\r\n    }\r\n\r\n    {\r\n        CommandLineInfo i;\r\n        i.ParseCommandLine(L\"SumatraPDF.exe -bench bar.pdf loadonly\");\r\n        utassert(2 == i.pathsToBenchmark.Count());\r\n        utassert(str::Eq(L\"bar.pdf\", i.pathsToBenchmark.At(0)));\r\n        utassert(str::Eq(L\"loadonly\", i.pathsToBenchmark.At(1)));\r\n    }\r\n\r\n    {\r\n        CommandLineInfo i;\r\n        i.ParseCommandLine(L\"SumatraPDF.exe -bench bar.pdf 1 -set-color-range 0x123456 #abCDef\");\r\n        utassert(i.globalPrefArgs.Count() == 3);\r\n        utassert(2 == i.pathsToBenchmark.Count());\r\n        utassert(str::Eq(L\"bar.pdf\", i.pathsToBenchmark.At(0)));\r\n        utassert(str::Eq(L\"1\", i.pathsToBenchmark.At(1)));\r\n    }\r\n\r\n    {\r\n        CommandLineInfo i;\r\n        i.ParseCommandLine(L\"SumatraPDF.exe -bench bar.pdf 1-5,3   -bench some.pdf 1,3,8-34\");\r\n        utassert(4 == i.pathsToBenchmark.Count());\r\n        utassert(str::Eq(L\"bar.pdf\", i.pathsToBenchmark.At(0)));\r\n        utassert(str::Eq(L\"1-5,3\", i.pathsToBenchmark.At(1)));\r\n        utassert(str::Eq(L\"some.pdf\", i.pathsToBenchmark.At(2)));\r\n        utassert(str::Eq(L\"1,3,8-34\", i.pathsToBenchmark.At(3)));\r\n    }\r\n\r\n    {\r\n        CommandLineInfo i;\r\n        utassert(false == i.invertColors);\r\n        i.ParseCommandLine(L\"SumatraPDF.exe -presentation -bgcolor 0xaa0c13 foo.pdf -invert-colors bar.pdf\");\r\n        utassert(true == i.enterPresentation);\r\n        utassert(true == i.invertColors);\r\n        utassert(2 == i.fileNames.Count());\r\n        utassert(0 == i.fileNames.Find(L\"foo.pdf\"));\r\n        utassert(1 == i.fileNames.Find(L\"bar.pdf\"));\r\n    }\r\n\r\n    {\r\n        CommandLineInfo i;\r\n        i.ParseCommandLine(L\"SumatraPDF.exe -bg-color 0xaa0c13 -invertcolors rosanna.pdf\");\r\n        utassert(true == i.invertColors);\r\n        utassert(1 == i.fileNames.Count());\r\n        utassert(0 == i.fileNames.Find(L\"rosanna.pdf\"));\r\n    }\r\n\r\n    {\r\n        CommandLineInfo i;\r\n        i.ParseCommandLine(L\"SumatraPDF.exe \\\"foo \\\\\\\" bar \\\\\\\\.pdf\\\" un\\\\\\\"quoted.pdf\");\r\n        utassert(2 == i.fileNames.Count());\r\n        utassert(0 == i.fileNames.Find(L\"foo \\\" bar \\\\\\\\.pdf\"));\r\n        utassert(1 == i.fileNames.Find(L\"un\\\"quoted.pdf\"));\r\n    }\r\n\r\n    {\r\n        CommandLineInfo i;\r\n        i.ParseCommandLine(L\"SumatraPDF.exe -page 37 -view continuousfacing -zoom fitcontent -scroll 45,1234 -reuse-instance\");\r\n        utassert(0 == i.fileNames.Count());\r\n        utassert(i.pageNumber == 37);\r\n        utassert(i.startView == DM_CONTINUOUS_FACING);\r\n        utassert(i.startZoom == ZOOM_FIT_CONTENT);\r\n        utassert(i.startScroll.x == 45 && i.startScroll.y == 1234);\r\n    }\r\n\r\n    {\r\n        CommandLineInfo i;\r\n        i.ParseCommandLine(L\"SumatraPDF.exe -view \\\"single page\\\" -zoom 237.45 -scroll -21,-1\");\r\n        utassert(0 == i.fileNames.Count());\r\n        utassert(i.startView == DM_SINGLE_PAGE);\r\n        utassert(i.startZoom == 237.45f);\r\n        utassert(i.startScroll.x == -21 && i.startScroll.y == -1);\r\n    }\r\n\r\n    {\r\n        CommandLineInfo i;\r\n        i.ParseCommandLine(L\"SumatraPDF.exe -zoom 35%\");\r\n        utassert(0 == i.fileNames.Count());\r\n        utassert(i.startZoom == 35.f);\r\n    }\r\n\r\n    {\r\n        CommandLineInfo i;\r\n        i.ParseCommandLine(L\"SumatraPDF.exe -zoom fit-content\");\r\n        utassert(i.startZoom == ZOOM_FIT_CONTENT);\r\n        utassert(0 == i.fileNames.Count());\r\n    }\r\n}\r\n\r\nstatic void BenchRangeTest()\r\n{\r\n    utassert(IsBenchPagesInfo(L\"1\"));\r\n    utassert(IsBenchPagesInfo(L\"2-4\"));\r\n    utassert(IsBenchPagesInfo(L\"5,7\"));\r\n    utassert(IsBenchPagesInfo(L\"6,8,\"));\r\n    utassert(IsBenchPagesInfo(L\"1-3,4,6-9,13\"));\r\n    utassert(IsBenchPagesInfo(L\"2-\"));\r\n    utassert(IsBenchPagesInfo(L\"loadonly\"));\r\n\r\n    utassert(!IsBenchPagesInfo(L\"\"));\r\n    utassert(!IsBenchPagesInfo(L\"-2\"));\r\n    utassert(!IsBenchPagesInfo(L\"2--4\"));\r\n    utassert(!IsBenchPagesInfo(L\"4-2\"));\r\n    utassert(!IsBenchPagesInfo(L\"1-3,loadonly\"));\r\n    utassert(!IsBenchPagesInfo(nullptr));\r\n}\r\n\r\nstatic void versioncheck_test()\r\n{\r\n    utassert(IsValidProgramVersion(\"1\"));\r\n    utassert(IsValidProgramVersion(\"1.1\"));\r\n    utassert(IsValidProgramVersion(\"1.1.1\\r\\n\"));\r\n    utassert(IsValidProgramVersion(\"2662\"));\r\n\r\n    utassert(!IsValidProgramVersion(\"1.1b\"));\r\n    utassert(!IsValidProgramVersion(\"1..1\"));\r\n    utassert(!IsValidProgramVersion(\"1.1\\r\\n.1\"));\r\n\r\n    utassert(CompareVersion(L\"0.9.3.900\", L\"0.9.3\") > 0);\r\n    utassert(CompareVersion(L\"1.09.300\", L\"1.09.3\") > 0);\r\n    utassert(CompareVersion(L\"1.9.1\", L\"1.09.3\") < 0);\r\n    utassert(CompareVersion(L\"1.2.0\", L\"1.2\") == 0);\r\n    utassert(CompareVersion(L\"1.3.0\", L\"2662\") < 0);\r\n}\r\n\r\nstatic void hexstrTest()\r\n{\r\n    unsigned char buf[6] = { 1, 2, 33, 255, 0, 18 };\r\n    unsigned char buf2[6] = { 0 };\r\n    ScopedMem<char> s(_MemToHex(&buf));\r\n    utassert(str::Eq(s, \"010221ff0012\"));\r\n    bool ok = _HexToMem(s, &buf2);\r\n    utassert(ok);\r\n    utassert(memeq(buf, buf2, sizeof(buf)));\r\n\r\n    FILETIME ft1, ft2;\r\n    GetSystemTimeAsFileTime(&ft1);\r\n    s.Set(_MemToHex(&ft1));\r\n    _HexToMem(s, &ft2);\r\n    DWORD diff = FileTimeDiffInSecs(ft1, ft2);\r\n    utassert(0 == diff);\r\n    utassert(FileTimeEq(ft1, ft2));\r\n\r\n    s.Set(str::MemToHex(nullptr, 0));\r\n    utassert(str::Eq(s, \"\"));\r\n    ok = str::HexToMem(s, nullptr, 0);\r\n    utassert(ok);\r\n}\r\n\r\nvoid SumatraPDF_UnitTests()\r\n{\r\n    BenchRangeTest();\r\n    ParseCommandLineTest();\r\n    versioncheck_test();\r\n    hexstrTest();\r\n}\r\n"
  },
  {
    "path": "src/Version.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// CURR_VERSION can be over-written externally\r\n#ifndef CURR_VERSION\r\n#define CURR_VERSION 3.2\r\n#endif\r\n#ifndef CURR_VERSION_COMMA\r\n#define CURR_VERSION_COMMA 3,2,0\r\n#endif\r\n\r\n// VER_QUALIFIER allows people who recompile SumatraPDF to add\r\n// a distinguishing string at the end of the version number\r\n// (e.g. version 2.3.2z or 2.4opt)\r\n\r\n#define APP_NAME_STR       L\"SumatraPDF\"\r\n\r\n// #define SVN_PRE_RELEASE_VER 2295\r\n\r\n#define _QUOTEME(x) #x\r\n#define QM(x) _QUOTEME(x)\r\n#define _QUOTEME2(x, y) _QUOTEME(x##y)\r\n#define QM2(x, y) _QUOTEME2(x, y)\r\n#define _QUOTEME3(x, y, z) _QUOTEME(x##y##z)\r\n#define QM3(x, y, z) _QUOTEME3(x, y, z)\r\n#define _QUOTEME4(x, y, z, u) _QUOTEME(x##y##z##u)\r\n#define QM4(x, y, z, u) _QUOTEME4(x, y, z, u)\r\n\r\n// version as displayed in UI and included in resources\r\n#ifndef SVN_PRE_RELEASE_VER\r\n #ifndef VER_QUALIFIER\r\n  #define CURR_VERSION_STRA QM(CURR_VERSION)\r\n #else\r\n  #define CURR_VERSION_STRA QM2(CURR_VERSION, VER_QUALIFIER)\r\n #endif\r\n #define VER_RESOURCE_STR  CURR_VERSION_STRA\r\n #define VER_RESOURCE      CURR_VERSION_COMMA,0\r\n #define UPDATE_CHECK_VER  TEXT(QM(CURR_VERSION))\r\n#else\r\n #ifndef VER_QUALIFIER\r\n   #define CURR_VERSION_STRA QM3(CURR_VERSION, ., SVN_PRE_RELEASE_VER)\r\n   #define VER_RESOURCE_STR  QM3(CURR_VERSION, .0., SVN_PRE_RELEASE_VER)\r\n #else\r\n   #define CURR_VERSION_STRA QM4(CURR_VERSION, ., SVN_PRE_RELEASE_VER, VER_QUALIFIER)\r\n   #define VER_RESOURCE_STR  QM4(CURR_VERSION, .0., SVN_PRE_RELEASE_VER, VER_QUALIFIER)\r\n #endif\r\n #define VER_RESOURCE      CURR_VERSION_COMMA,SVN_PRE_RELEASE_VER\r\n #define UPDATE_CHECK_VER  TEXT(QM(SVN_PRE_RELEASE_VER))\r\n#endif\r\n#define CURR_VERSION_STR TEXT(CURR_VERSION_STRA)\r\n\r\n#define COPYRIGHT_STR      \"Copyright 2006-2016 all authors (GPLv3)\"\r\n#define PUBLISHER_STR      \"Krzysztof Kowalczyk\"\r\n"
  },
  {
    "path": "src/WindowInfo.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include <UIAutomationCore.h>\r\n#include <UIAutomationCoreApi.h>\r\n#include \"FileUtil.h\"\r\n#include \"FrameRateWnd.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EngineManager.h\"\r\n#include \"Doc.h\"\r\n// layout controllers\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"ChmModel.h\"\r\n#include \"DisplayModel.h\"\r\n#include \"EbookController.h\"\r\n#include \"GlobalPrefs.h\"\r\n#include \"TextSelection.h\"\r\n#include \"TextSearch.h\"\r\n// ui\r\n#include \"SumatraPDF.h\"\r\n#include \"WindowInfo.h\"\r\n#include \"TabInfo.h\"\r\n#include \"resource.h\"\r\n#include \"Caption.h\"\r\n#include \"Notifications.h\"\r\n#include \"Selection.h\"\r\n#include \"StressTesting.h\"\r\n#include \"Translations.h\"\r\n#include \"uia/Provider.h\"\r\n\r\nWindowInfo::WindowInfo(HWND hwnd) :\r\n    ctrl(nullptr), currentTab(nullptr), menu(nullptr), hwndFrame(hwnd), isMenuHidden(false),\r\n    linkOnLastButtonDown(nullptr), url(nullptr),\r\n    tocVisible(false), tocLoaded(false), tocKeepSelection(false),\r\n    isFullScreen(false), presentation(PM_DISABLED),\r\n    windowStateBeforePresentation(0), nonFullScreenWindowStyle(0),\r\n    hwndCanvas(nullptr), hwndToolbar(nullptr), hwndReBar(nullptr),\r\n    hwndFindText(nullptr), hwndFindBox(nullptr), hwndFindBg(nullptr),\r\n    hwndPageText(nullptr), hwndPageBox(nullptr), hwndPageBg(nullptr), hwndPageTotal(nullptr),\r\n    hwndTocBox(nullptr), hwndTocTree(nullptr), tocLabelWithClose(nullptr),\r\n    sidebarSplitter(nullptr), favSplitter(nullptr),\r\n    hwndInfotip(nullptr), infotipVisible(false),\r\n    findThread(nullptr), findCanceled(false), printThread(nullptr), printCanceled(false),\r\n    showSelection(false), mouseAction(MA_IDLE), dragStartPending(false),\r\n    currPageNo(0),\r\n    xScrollSpeed(0), yScrollSpeed(0), wheelAccumDelta(0),\r\n    delayedRepaintTimer(0), stressTest(nullptr),\r\n    hwndFavBox(nullptr), hwndFavTree(nullptr), favLabelWithClose(nullptr),\r\n    uia_provider(nullptr), cbHandler(nullptr), frameRateWnd(nullptr),\r\n    hwndTabBar(nullptr), tabsVisible(false), tabsInTitlebar(false), tabSelectionHistory(nullptr),\r\n    hwndCaption(nullptr), caption(nullptr), extendedFrameHeight(0)\r\n{\r\n    touchState.panStarted = false;\r\n    buffer = new DoubleBuffer(hwndCanvas, canvasRc);\r\n    linkHandler = new LinkHandler(*this);\r\n    notifications = new Notifications();\r\n    fwdSearchMark.show = false;\r\n}\r\n\r\nWindowInfo::~WindowInfo()\r\n{\r\n    FinishStressTest(this);\r\n\r\n    CrashIf(tabs.Count() > 0);\r\n    CrashIf(ctrl || linkOnLastButtonDown);\r\n\r\n    // release our copy of UIA provider\r\n    // the UI automation still might have a copy somewhere\r\n    if (uia_provider) {\r\n        if (AsFixed())\r\n            uia_provider->OnDocumentUnload();\r\n        uia_provider->Release();\r\n    }\r\n\r\n    delete linkHandler;\r\n    delete buffer;\r\n    delete notifications;\r\n    delete tabSelectionHistory;\r\n    delete caption;\r\n    DeleteVecMembers(tabs);\r\n    // cbHandler is passed into Controller and must be deleted afterwards\r\n    // (all controllers should have been deleted prior to WindowInfo, though)\r\n    delete cbHandler;\r\n\r\n    DeleteFrameRateWnd(frameRateWnd);\r\n    free(sidebarSplitter);\r\n    free(favSplitter);\r\n    free(tocLabelWithClose);\r\n    free(favLabelWithClose);\r\n}\r\n\r\nbool WindowInfo::IsAboutWindow() const\r\n{\r\n    return nullptr == currentTab;\r\n}\r\n\r\nbool WindowInfo::IsDocLoaded() const\r\n{\r\n    CrashIf(!this->ctrl != !(currentTab && currentTab->ctrl));\r\n    return this->ctrl != nullptr;\r\n}\r\n\r\nDisplayModel *WindowInfo::AsFixed() const { return ctrl ? ctrl->AsFixed() : nullptr; }\r\nChmModel *WindowInfo::AsChm() const { return ctrl ? ctrl->AsChm() : nullptr; }\r\nEbookController *WindowInfo::AsEbook() const { return ctrl ? ctrl->AsEbook() : nullptr; }\r\n\r\n// Notify both display model and double-buffer (if they exist)\r\n// about a potential change of available canvas size\r\nvoid WindowInfo::UpdateCanvasSize()\r\n{\r\n    RectI rc = ClientRect(hwndCanvas);\r\n    if (canvasRc == rc)\r\n        return;\r\n    canvasRc = rc;\r\n\r\n    // create a new output buffer and notify the model\r\n    // about the change of the canvas size\r\n    delete buffer;\r\n    buffer = new DoubleBuffer(hwndCanvas, canvasRc);\r\n\r\n    if (IsDocLoaded()) {\r\n        // the display model needs to know the full size (including scroll bars)\r\n        ctrl->SetViewPortSize(GetViewPortSize());\r\n    }\r\n    if (currentTab) {\r\n        currentTab->canvasRc = canvasRc;\r\n    }\r\n\r\n    // keep the notifications visible (only needed for right-to-left layouts)\r\n    if (IsUIRightToLeft())\r\n        notifications->Relayout();\r\n}\r\n\r\nSizeI WindowInfo::GetViewPortSize()\r\n{\r\n    SizeI size = canvasRc.Size();\r\n\r\n    DWORD style = GetWindowLong(hwndCanvas, GWL_STYLE);\r\n    if ((style & WS_VSCROLL))\r\n        size.dx += GetSystemMetrics(SM_CXVSCROLL);\r\n    if ((style & WS_HSCROLL))\r\n        size.dy += GetSystemMetrics(SM_CYHSCROLL);\r\n    CrashIf((style & (WS_VSCROLL | WS_HSCROLL)) && !AsFixed());\r\n\r\n    return size;\r\n}\r\n\r\nvoid WindowInfo::RedrawAll(bool update)\r\n{\r\n    InvalidateRect(this->hwndCanvas, nullptr, false);\r\n    if (this->AsEbook())\r\n        this->AsEbook()->RequestRepaint();\r\n    if (update)\r\n        UpdateWindow(this->hwndCanvas);\r\n}\r\n\r\nvoid WindowInfo::ChangePresentationMode(PresentationMode mode)\r\n{\r\n    presentation = mode;\r\n    if (PM_BLACK_SCREEN == mode || PM_WHITE_SCREEN == mode) {\r\n        DeleteInfotip();\r\n    }\r\n    RedrawAll();\r\n}\r\n\r\nvoid WindowInfo::Focus()\r\n{\r\n    win::ToForeground(hwndFrame);\r\n    // set focus to an owned modal dialog if there is one\r\n    HWND hwnd = nullptr;\r\n    while ((hwnd = FindWindowEx(HWND_DESKTOP, hwnd, nullptr, nullptr)) != nullptr) {\r\n        if (GetWindow(hwnd, GW_OWNER) == hwndFrame && (GetWindowStyle(hwnd) & WS_DLGFRAME)) {\r\n            SetFocus(hwnd);\r\n            return;\r\n        }\r\n    }\r\n    SetFocus(hwndFrame);\r\n}\r\n\r\nvoid WindowInfo::ToggleZoom()\r\n{\r\n    CrashIf(!this->ctrl);\r\n    if (!this->IsDocLoaded()) return;\r\n\r\n    if (ZOOM_FIT_PAGE == this->ctrl->GetZoomVirtual())\r\n        this->ctrl->SetZoomVirtual(ZOOM_FIT_WIDTH);\r\n    else if (ZOOM_FIT_WIDTH == this->ctrl->GetZoomVirtual())\r\n        this->ctrl->SetZoomVirtual(ZOOM_FIT_CONTENT);\r\n    else\r\n        this->ctrl->SetZoomVirtual(ZOOM_FIT_PAGE);\r\n}\r\n\r\nvoid WindowInfo::MoveDocBy(int dx, int dy)\r\n{\r\n    CrashIf(!this->AsFixed());\r\n    if (!this->AsFixed()) return;\r\n    CrashIf(this->linkOnLastButtonDown);\r\n    if (this->linkOnLastButtonDown) return;\r\n    DisplayModel *dm = this->ctrl->AsFixed();\r\n    if (0 != dx)\r\n        dm->ScrollXBy(dx);\r\n    if (0 != dy)\r\n        dm->ScrollYBy(dy, false);\r\n}\r\n\r\n#define MULTILINE_INFOTIP_WIDTH_PX 500\r\n\r\nvoid WindowInfo::CreateInfotip(const WCHAR *text, RectI& rc, bool multiline)\r\n{\r\n    if (str::IsEmpty(text)) {\r\n        this->DeleteInfotip();\r\n        return;\r\n    }\r\n\r\n    TOOLINFO ti = { 0 };\r\n    ti.cbSize = sizeof(ti);\r\n    ti.hwnd = this->hwndCanvas;\r\n    ti.uFlags = TTF_SUBCLASS;\r\n    ti.lpszText = (WCHAR *)text;\r\n    ti.rect = rc.ToRECT();\r\n\r\n    if (multiline || str::FindChar(text, '\\n'))\r\n        SendMessage(this->hwndInfotip, TTM_SETMAXTIPWIDTH, 0, MULTILINE_INFOTIP_WIDTH_PX);\r\n    else\r\n        SendMessage(this->hwndInfotip, TTM_SETMAXTIPWIDTH, 0, -1);\r\n\r\n    SendMessage(this->hwndInfotip, this->infotipVisible ? TTM_NEWTOOLRECT : TTM_ADDTOOL, 0, (LPARAM)&ti);\r\n    this->infotipVisible = true;\r\n}\r\n\r\nvoid WindowInfo::DeleteInfotip()\r\n{\r\n    if (!infotipVisible)\r\n        return;\r\n\r\n    TOOLINFO ti = { 0 };\r\n    ti.cbSize = sizeof(ti);\r\n    ti.hwnd = hwndCanvas;\r\n\r\n    SendMessage(hwndInfotip, TTM_DELTOOL, 0, (LPARAM)&ti);\r\n    infotipVisible = false;\r\n}\r\n\r\nvoid WindowInfo::ShowNotification(const WCHAR *message, int options, NotificationGroup groupId)\r\n{\r\n    int timeoutMS = (options & NOS_PERSIST) ? 0 : 3000;\r\n    bool highlight = (options & NOS_HIGHLIGHT);\r\n\r\n    NotificationWnd *wnd = new NotificationWnd(hwndCanvas, message, timeoutMS, highlight, notifications);\r\n    if (NG_CURSOR_POS_HELPER == groupId) {\r\n        wnd->shrinkLimit = 0.7f;\r\n    }\r\n    notifications->Add(wnd, groupId);\r\n}\r\n\r\nbool WindowInfo::CreateUIAProvider()\r\n{\r\n    if (!uia_provider) {\r\n        uia_provider = new SumatraUIAutomationProvider(this->hwndCanvas);\r\n        if (!uia_provider)\r\n            return false;\r\n        // load data to provider\r\n        if (AsFixed())\r\n            uia_provider->OnDocumentLoad(AsFixed());\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nclass RemoteDestination : public PageDestination {\r\n    PageDestType type;\r\n    int pageNo;\r\n    RectD rect;\r\n    ScopedMem<WCHAR> value;\r\n    ScopedMem<WCHAR> name;\r\n\r\npublic:\r\n    RemoteDestination(PageDestination *dest) :\r\n        type(dest->GetDestType()), pageNo(dest->GetDestPageNo()),\r\n        rect(dest->GetDestRect()), value(dest->GetDestValue()),\r\n        name(dest->GetDestName()) { }\r\n    virtual ~RemoteDestination() { }\r\n\r\n    PageDestType GetDestType() const override { return type; }\r\n    int GetDestPageNo() const override { return pageNo; }\r\n    RectD GetDestRect() const override { return rect; }\r\n    WCHAR *GetDestValue() const override { return str::Dup(value); }\r\n    WCHAR *GetDestName() const override { return str::Dup(name); }\r\n};\r\n\r\nvoid LinkHandler::GotoLink(PageDestination *link)\r\n{\r\n    CrashIf(!owner || owner->linkHandler != this);\r\n    if (!link || !owner->IsDocLoaded())\r\n        return;\r\n\r\n    TabInfo *tab = owner->currentTab;\r\n    ScopedMem<WCHAR> path(link->GetDestValue());\r\n    PageDestType type = link->GetDestType();\r\n    if (Dest_ScrollTo == type) {\r\n        // TODO: respect link->ld.gotor.new_window for PDF documents ?\r\n        ScrollTo(link);\r\n    }\r\n    else if (Dest_LaunchURL == type) {\r\n        if (!path)\r\n            /* ignore missing URLs */;\r\n        else {\r\n            WCHAR *colon = str::FindChar(path, ':');\r\n            WCHAR *hash = str::FindChar(path, '#');\r\n            if (!colon || (hash && colon > hash)) {\r\n                // treat relative URIs as file paths (without fragment identifier)\r\n                if (hash)\r\n                    *hash = '\\0';\r\n                str::TransChars(path.Get(), L\"/\", L\"\\\\\"); \r\n                url::DecodeInPlace(path.Get());\r\n                // LaunchFile will reject unsupported file types\r\n                LaunchFile(path, nullptr);\r\n            }\r\n            else {\r\n                // LaunchBrowser will reject unsupported URI schemes\r\n                // TODO: support file URIs?\r\n                LaunchBrowser(path);\r\n            }\r\n        }\r\n    }\r\n    else if (Dest_LaunchEmbedded == type) {\r\n        // open embedded PDF documents in a new window\r\n        if (path && str::StartsWith(path.Get(), tab->filePath.Get())) {\r\n            WindowInfo *newWin = FindWindowInfoByFile(path, true);\r\n            if (!newWin) {\r\n                LoadArgs args(path, owner);\r\n                newWin = LoadDocument(args);\r\n            }\r\n            if (newWin)\r\n                newWin->Focus();\r\n        }\r\n        // offer to save other attachments to a file\r\n        else {\r\n            LinkSaver linkSaverTmp(tab, owner->hwndFrame, path);\r\n            link->SaveEmbedded(linkSaverTmp);\r\n        }\r\n    }\r\n    else if (Dest_LaunchFile == type) {\r\n        if (path) {\r\n            // LaunchFile only opens files inside SumatraPDF\r\n            // (except for allowed perceived file types)\r\n            LaunchFile(path, link);\r\n        }\r\n    }\r\n    // predefined named actions\r\n    else if (Dest_NextPage == type)\r\n        tab->ctrl->GoToNextPage();\r\n    else if (Dest_PrevPage == type)\r\n        tab->ctrl->GoToPrevPage();\r\n    else if (Dest_FirstPage == type)\r\n        tab->ctrl->GoToFirstPage();\r\n    else if (Dest_LastPage == type)\r\n        tab->ctrl->GoToLastPage();\r\n    // Adobe Reader extensions to the spec, cf. http://www.tug.org/applications/hyperref/manual.html\r\n    else if (Dest_FindDialog == type)\r\n        PostMessage(owner->hwndFrame, WM_COMMAND, IDM_FIND_FIRST, 0);\r\n    else if (Dest_FullScreen == type)\r\n        PostMessage(owner->hwndFrame, WM_COMMAND, IDM_VIEW_PRESENTATION_MODE, 0);\r\n    else if (Dest_GoBack == type)\r\n        tab->ctrl->Navigate(-1);\r\n    else if (Dest_GoForward == type)\r\n        tab->ctrl->Navigate(1);\r\n    else if (Dest_GoToPageDialog == type)\r\n        PostMessage(owner->hwndFrame, WM_COMMAND, IDM_GOTO_PAGE, 0);\r\n    else if (Dest_PrintDialog == type)\r\n        PostMessage(owner->hwndFrame, WM_COMMAND, IDM_PRINT, 0);\r\n    else if (Dest_SaveAsDialog == type)\r\n        PostMessage(owner->hwndFrame, WM_COMMAND, IDM_SAVEAS, 0);\r\n    else if (Dest_ZoomToDialog == type)\r\n        PostMessage(owner->hwndFrame, WM_COMMAND, IDM_ZOOM_CUSTOM, 0);\r\n    else\r\n        CrashIf(Dest_None != type);\r\n}\r\n\r\nvoid LinkHandler::ScrollTo(PageDestination *dest)\r\n{\r\n    CrashIf(!owner || owner->linkHandler != this);\r\n    if (!dest || !owner->IsDocLoaded())\r\n        return;\r\n\r\n    int pageNo = dest->GetDestPageNo();\r\n    if (pageNo > 0)\r\n        owner->ctrl->ScrollToLink(dest);\r\n}\r\n\r\nvoid LinkHandler::LaunchFile(const WCHAR *path, PageDestination *link)\r\n{\r\n    // for safety, only handle relative paths and only open them in SumatraPDF\r\n    // (unless they're of an allowed perceived type) and never launch any external\r\n    // file in plugin mode (where documents are supposed to be self-contained)\r\n    WCHAR drive;\r\n    if (str::StartsWith(path, L\"\\\\\") || str::Parse(path, L\"%c:\\\\\", &drive) || gPluginMode) {\r\n        return;\r\n    }\r\n\r\n    // TODO: link is deleted when opening the document in a new tab\r\n    RemoteDestination *remoteLink = nullptr;\r\n    if (link) {\r\n        remoteLink = new RemoteDestination(link);\r\n        link = nullptr;\r\n    }\r\n\r\n    ScopedMem<WCHAR> fullPath(path::GetDir(owner->ctrl->FilePath()));\r\n    fullPath.Set(path::Join(fullPath, path));\r\n    fullPath.Set(path::Normalize(fullPath));\r\n    // TODO: respect link->ld.gotor.new_window for PDF documents ?\r\n    WindowInfo *newWin = FindWindowInfoByFile(fullPath, true);\r\n    // TODO: don't show window until it's certain that there was no error\r\n    if (!newWin) {\r\n        LoadArgs args(fullPath, owner);\r\n        newWin = LoadDocument(args);\r\n        if (!newWin) {\r\n            delete remoteLink;\r\n            return;\r\n        }\r\n    }\r\n\r\n    if (!newWin->IsDocLoaded()) {\r\n        CloseTab(newWin);\r\n        // OpenFileExternally rejects files we'd otherwise\r\n        // have to show a notification to be sure (which we\r\n        // consider bad UI and thus simply don't)\r\n        bool ok = OpenFileExternally(fullPath);\r\n        if (!ok) {\r\n            ScopedMem<WCHAR> msg(str::Format(_TR(\"Error loading %s\"), fullPath));\r\n            owner->ShowNotification(msg, NOS_HIGHLIGHT);\r\n        }\r\n        delete remoteLink;\r\n        return;\r\n    }\r\n\r\n    newWin->Focus();\r\n    if (!remoteLink)\r\n        return;\r\n\r\n    ScopedMem<WCHAR> destName(remoteLink->GetDestName());\r\n    if (destName) {\r\n        PageDestination *dest = newWin->ctrl->GetNamedDest(destName);\r\n        if (dest) {\r\n            newWin->linkHandler->ScrollTo(dest);\r\n            delete dest;\r\n        }\r\n    }\r\n    else {\r\n        newWin->linkHandler->ScrollTo(remoteLink);\r\n    }\r\n    delete remoteLink;\r\n}\r\n\r\n// normalizes case and whitespace in the string\r\n// caller needs to free() the result\r\nstatic WCHAR *NormalizeFuzzy(const WCHAR *str)\r\n{\r\n    WCHAR *dup = str::Dup(str);\r\n    CharLower(dup);\r\n    str::NormalizeWS(dup);\r\n    // cf. AddTocItemToView\r\n    return dup;\r\n}\r\n\r\nstatic bool MatchFuzzy(const WCHAR *s1, const WCHAR *s2, bool partially=false)\r\n{\r\n    if (!partially)\r\n        return str::Eq(s1, s2);\r\n\r\n    // only match at the start of a word (at the beginning and after a space)\r\n    for (const WCHAR *last = s1; (last = str::Find(last, s2)) != nullptr; last++) {\r\n        if (last == s1 || *(last - 1) == ' ')\r\n            return true;\r\n    }\r\n    return false;\r\n}\r\n\r\n// finds the first ToC entry that (partially) matches a given normalized name\r\n// (ignoring case and whitespace differences)\r\nPageDestination *LinkHandler::FindTocItem(DocTocItem *item, const WCHAR *name, bool partially)\r\n{\r\n    for (; item; item = item->next) {\r\n        ScopedMem<WCHAR> fuzTitle(NormalizeFuzzy(item->title));\r\n        if (MatchFuzzy(fuzTitle, name, partially))\r\n            return item->GetLink();\r\n        PageDestination *dest = FindTocItem(item->child, name, partially);\r\n        if (dest)\r\n            return dest;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nvoid LinkHandler::GotoNamedDest(const WCHAR *name)\r\n{\r\n    CrashIf(!owner || owner->linkHandler != this);\r\n    Controller *ctrl = owner->ctrl;\r\n    if (!ctrl)\r\n        return;\r\n\r\n    // Match order:\r\n    // 1. Exact match on internal destination name\r\n    // 2. Fuzzy match on full ToC item title\r\n    // 3. Fuzzy match on a part of a ToC item title\r\n    // 4. Exact match on page label\r\n    PageDestination *dest = ctrl->GetNamedDest(name);\r\n    bool hasDest = dest != NULL;\r\n    if (dest) {\r\n        ScrollTo(dest);\r\n        delete dest;\r\n    }\r\n    else if (ctrl->HasTocTree()) {\r\n        DocTocItem *root = ctrl->GetTocTree();\r\n        ScopedMem<WCHAR> fuzName(NormalizeFuzzy(name));\r\n        dest = FindTocItem(root, fuzName);\r\n        if (!dest)\r\n            dest = FindTocItem(root, fuzName, true);\r\n        if (dest) {\r\n            ScrollTo(dest);\r\n            hasDest = true;\r\n        }\r\n        delete root;\r\n    }\r\n    if (!hasDest && ctrl->HasPageLabels()) {\r\n        int pageNo = ctrl->GetPageByLabel(name);\r\n        if (ctrl->ValidPageNo(pageNo))\r\n            ctrl->GoToPage(pageNo, true);\r\n    }\r\n}\r\n"
  },
  {
    "path": "src/WindowInfo.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nclass DoubleBuffer;\r\nclass LinkHandler;\r\nclass Notifications;\r\nclass StressTest;\r\nclass SumatraUIAutomationProvider;\r\nstruct FrameRateWnd;\r\nstruct LabelWithCloseWnd;\r\nstruct SplitterWnd;\r\nclass CaptionInfo;\r\n\r\nclass PageElement;\r\nclass PageDestination;\r\nclass DocTocItem;\r\nclass Controller;\r\nclass ControllerCallback;\r\nclass ChmModel;\r\nclass DisplayModel;\r\nclass EbookController;\r\nclass TabInfo;\r\n\r\n/* Describes actions which can be performed by mouse */\r\nenum MouseAction {\r\n    MA_IDLE = 0,\r\n    MA_DRAGGING,\r\n    MA_DRAGGING_RIGHT,\r\n    MA_SELECTING,\r\n    MA_SCROLLING,\r\n    MA_SELECTING_TEXT\r\n};\r\n\r\nenum NotificationGroup {\r\n    NG_RESPONSE_TO_ACTION = 1,\r\n    NG_FIND_PROGRESS,\r\n    NG_PERSISTENT_WARNING,\r\n    NG_PAGE_INFO_HELPER,\r\n    NG_CURSOR_POS_HELPER,\r\n    NG_STRESS_TEST_BENCHMARK,\r\n    NG_STRESS_TEST_SUMMARY,\r\n};\r\n\r\nenum NotificationOptions {\r\n    NOS_DEFAULT = 0, // timeout after 3 seconds, no highlight\r\n    NOS_PERSIST = (1 << 0),\r\n    NOS_HIGHLIGHT = (1 << 1),\r\n    NOS_WARNING = NOS_PERSIST | NOS_HIGHLIGHT,\r\n};\r\n\r\nenum PresentationMode {\r\n    PM_DISABLED = 0,\r\n    PM_ENABLED,\r\n    PM_BLACK_SCREEN,\r\n    PM_WHITE_SCREEN\r\n};\r\n\r\n// WM_GESTURE handling\r\nstruct TouchState {\r\n    bool    panStarted;\r\n    POINTS  panPos;\r\n    int     panScrollOrigX;\r\n    double  startArg;\r\n};\r\n\r\n/* Describes position, the target (URL or file path) and infotip of a \"hyperlink\" */\r\nstruct StaticLinkInfo {\r\n    StaticLinkInfo() : target(nullptr), infotip(nullptr) { }\r\n    StaticLinkInfo(RectI rect, const WCHAR *target, const WCHAR *infotip=nullptr) :\r\n        rect(rect), target(target), infotip(infotip) { }\r\n\r\n    RectI rect;\r\n    const WCHAR *target;\r\n    const WCHAR *infotip;\r\n};\r\n\r\n/* Describes information related to one window with (optional) a document\r\n   on the screen */\r\nclass WindowInfo\r\n{\r\npublic:\r\n    explicit WindowInfo(HWND hwnd);\r\n    ~WindowInfo();\r\n\r\n    // TODO: error windows currently have\r\n    //       !IsAboutWindow() && !IsDocLoaded()\r\n    //       which doesn't allow distinction between PDF, XPS, etc. errors\r\n    bool IsAboutWindow() const;\r\n    bool IsDocLoaded() const;\r\n\r\n    DisplayModel *AsFixed() const;\r\n    ChmModel *AsChm() const;\r\n    EbookController *AsEbook() const;\r\n\r\n    // TODO: use currentTab->ctrl instead\r\n    Controller *    ctrl; // owned by currentTab\r\n\r\n    Vec<TabInfo *>  tabs;\r\n    TabInfo *       currentTab; // points into tabs\r\n\r\n    HWND            hwndFrame;\r\n    HWND            hwndCanvas;\r\n    HWND            hwndToolbar;\r\n    HWND            hwndReBar;\r\n    HWND            hwndFindText;\r\n    HWND            hwndFindBox;\r\n    HWND            hwndFindBg;\r\n    HWND            hwndPageText;\r\n    HWND            hwndPageBox;\r\n    HWND            hwndPageBg;\r\n    HWND            hwndPageTotal;\r\n\r\n    // state related to table of contents (PDF bookmarks etc.)\r\n    HWND            hwndTocBox;\r\n    LabelWithCloseWnd *tocLabelWithClose;\r\n    HWND            hwndTocTree;\r\n    // whether the current tab's ToC has been loaded into the tree\r\n    bool            tocLoaded;\r\n    // whether the ToC sidebar is currently visible\r\n    bool            tocVisible;\r\n    // set to temporarily disable UpdateTocSelection\r\n    bool            tocKeepSelection;\r\n\r\n    // state related to favorites\r\n    HWND            hwndFavBox;\r\n    LabelWithCloseWnd *favLabelWithClose;\r\n    HWND            hwndFavTree;\r\n    Vec<DisplayState *> expandedFavorites;\r\n\r\n    // vertical splitter for resizing left side panel\r\n    SplitterWnd *   sidebarSplitter;\r\n\r\n    // horizontal splitter for resizing favorites and bookmars parts\r\n    SplitterWnd *   favSplitter;\r\n\r\n    HWND            hwndTabBar;\r\n    bool            tabsVisible;\r\n    bool            tabsInTitlebar;\r\n    // keeps the sequence of tab selection. This is needed for restoration\r\n    // of the previous tab when the current one is closed. (Points into tabs.)\r\n    Vec<TabInfo *> *tabSelectionHistory;\r\n\r\n    HWND            hwndCaption;\r\n    CaptionInfo *   caption;\r\n    int             extendedFrameHeight;\r\n\r\n    HWND            hwndInfotip;\r\n\r\n    bool            infotipVisible;\r\n    HMENU           menu;\r\n    bool            isMenuHidden; // not persisted at shutdown\r\n\r\n    DoubleBuffer *  buffer;\r\n\r\n    MouseAction     mouseAction;\r\n    bool            dragStartPending;\r\n\r\n    /* when dragging the document around, this is previous position of the\r\n       cursor. A delta between previous and current is by how much we\r\n       moved */\r\n    PointI          dragPrevPos;\r\n    /* when dragging, mouse x/y position when dragging was started */\r\n    PointI          dragStart;\r\n\r\n    /* when moving the document by smooth scrolling, this keeps track of\r\n       the speed at which we should scroll, which depends on the distance\r\n       of the mouse from the point where the user middle clicked. */\r\n    int             xScrollSpeed, yScrollSpeed;\r\n\r\n    // true while selecting and when currentTab->selectionOnPage != nullptr\r\n    bool            showSelection;\r\n    // selection rectangle in screen coordinates (only needed while selecting)\r\n    RectI           selectionRect;\r\n    // size of the current rectangular selection in document units\r\n    SizeD           selectionMeasure;\r\n\r\n    // a list of static links (mainly used for About and Frequently Read pages)\r\n    Vec<StaticLinkInfo> staticLinks;\r\n\r\n    bool            isFullScreen;\r\n    PresentationMode presentation;\r\n    int             windowStateBeforePresentation;\r\n\r\n    long            nonFullScreenWindowStyle;\r\n    RectI           nonFullScreenFrameRect;\r\n\r\n    RectI           canvasRc; // size of the canvas (excluding any scroll bars)\r\n    int             currPageNo; // cached value, needed to determine when to auto-update the ToC selection\r\n\r\n    int             wheelAccumDelta;\r\n    UINT_PTR        delayedRepaintTimer;\r\n\r\n    Notifications * notifications; // only access from UI thread\r\n\r\n    HANDLE          printThread;\r\n    bool            printCanceled;\r\n\r\n    HANDLE          findThread;\r\n    bool            findCanceled;\r\n\r\n    LinkHandler *   linkHandler;\r\n    PageElement *   linkOnLastButtonDown;\r\n    const WCHAR *   url;\r\n\r\n    ControllerCallback *cbHandler;\r\n\r\n    /* when doing a forward search, the result location is highlighted with\r\n     * rectangular marks in the document. These variables indicate the position of the markers\r\n     * and whether they should be shown. */\r\n    struct {\r\n        bool show;          // are the markers visible?\r\n        Vec<RectI> rects;   // location of the markers in user coordinates\r\n        int page;\r\n        int hideStep;       // value used to gradually hide the markers\r\n    } fwdSearchMark;\r\n\r\n    StressTest *    stressTest;\r\n\r\n    TouchState      touchState;\r\n\r\n    FrameRateWnd *  frameRateWnd;\r\n\r\n    SumatraUIAutomationProvider * uia_provider;\r\n\r\n    void  UpdateCanvasSize();\r\n    SizeI GetViewPortSize();\r\n    void  RedrawAll(bool update=false);\r\n    void  RepaintAsync(UINT delay=0);\r\n\r\n    void ChangePresentationMode(PresentationMode mode);\r\n\r\n    void Focus();\r\n\r\n    void ToggleZoom();\r\n    void MoveDocBy(int dx, int dy);\r\n\r\n    void CreateInfotip(const WCHAR *text, RectI& rc, bool multiline=false);\r\n    void DeleteInfotip();\r\n    void ShowNotification(const WCHAR *message, int options=NOS_DEFAULT, NotificationGroup groupId=NG_RESPONSE_TO_ACTION);\r\n\r\n    bool CreateUIAProvider();\r\n};\r\n\r\nclass LinkHandler {\r\n    WindowInfo *owner;\r\n\r\n    void ScrollTo(PageDestination *dest);\r\n    void LaunchFile(const WCHAR *path, PageDestination *link);\r\n    PageDestination *FindTocItem(DocTocItem *item, const WCHAR *name, bool partially=false);\r\n\r\npublic:\r\n    explicit LinkHandler(WindowInfo& win) : owner(&win) { }\r\n\r\n    void GotoLink(PageDestination *link);\r\n    void GotoNamedDest(const WCHAR *name);\r\n};\r\n\r\n// TODO: this belongs in SumatraPDF.h but introduces a dependency on SettingsStructs.h\r\nvoid SwitchToDisplayMode(WindowInfo *win, DisplayMode displayMode, bool keepContinuous=false);\r\n"
  },
  {
    "path": "src/ifilter/CEpubFilter.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"ArchUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"HtmlPullParser.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EbookBase.h\"\r\n#include \"EbookDoc.h\"\r\n// ui\r\n#include \"FilterBase.h\"\r\n#include \"PdfFilter.h\"\r\n#include \"CEpubFilter.h\"\r\n\r\nVOID CEpubFilter::CleanUp()\r\n{\r\n    if (m_epubDoc) {\r\n        delete m_epubDoc;\r\n        m_epubDoc = nullptr;\r\n    }\r\n    m_state = STATE_EPUB_END;\r\n}\r\n\r\nHRESULT CEpubFilter::OnInit()\r\n{\r\n    CleanUp();\r\n\r\n    // TODO: EpubDoc::CreateFromStream never returns with\r\n    //       m_pStream instead of a clone - why?\r\n\r\n    // load content of EPUB document into a seekable stream\r\n    HRESULT res;\r\n    size_t len;\r\n    void *data = GetDataFromStream(m_pStream, &len, &res);\r\n    if (!data)\r\n        return res;\r\n\r\n    ScopedComPtr<IStream> stream(CreateStreamFromData(data, len));\r\n    free(data);\r\n    if (!stream)\r\n        return E_FAIL;\r\n\r\n    m_epubDoc = EpubDoc::CreateFromStream(stream);\r\n    if (!m_epubDoc)\r\n        return E_FAIL;\r\n\r\n    m_state = STATE_EPUB_START;\r\n    return S_OK;\r\n}\r\n\r\n// copied from SumatraProperties.cpp\r\nstatic bool IsoDateParse(const WCHAR *isoDate, SYSTEMTIME *timeOut)\r\n{\r\n    ZeroMemory(timeOut, sizeof(SYSTEMTIME));\r\n    const WCHAR *end = str::Parse(isoDate, L\"%4d-%2d-%2d\", &timeOut->wYear, &timeOut->wMonth, &timeOut->wDay);\r\n    if (end) // time is optional\r\n        str::Parse(end, L\"T%2d:%2d:%2dZ\", &timeOut->wHour, &timeOut->wMinute, &timeOut->wSecond);\r\n    return end != nullptr;\r\n    // don't bother about the day of week, we won't display it anyway\r\n}\r\n\r\nstatic WCHAR *ExtractHtmlText(EpubDoc *doc)\r\n{\r\n    size_t len;\r\n    const char *data = doc->GetHtmlData(&len);\r\n\r\n    str::Str<char> text(len / 2);\r\n    HtmlPullParser p(data, len);\r\n    HtmlToken *t;\r\n    Vec<HtmlTag> tagNesting;\r\n    while ((t = p.Next()) != nullptr && !t->IsError()) {\r\n        if (t->IsText() && !tagNesting.Contains(Tag_Head) && !tagNesting.Contains(Tag_Script) && !tagNesting.Contains(Tag_Style)) {\r\n            // trim whitespace (TODO: also normalize within text?)\r\n            while (t->sLen > 0 && str::IsWs(t->s[0])) {\r\n                t->s++;\r\n                t->sLen--;\r\n            }\r\n            while (t->sLen > 0 && str::IsWs(t->s[t->sLen-1]))\r\n                t->sLen--;\r\n            if (t->sLen > 0) {\r\n                text.AppendAndFree(ResolveHtmlEntities(t->s, t->sLen));\r\n                text.Append(' ');\r\n            }\r\n        }\r\n        else if (t->IsStartTag()) {\r\n            // TODO: force-close tags similar to HtmlFormatter.cpp's AutoCloseOnOpen?\r\n            if (!IsTagSelfClosing(t->tag))\r\n                tagNesting.Append(t->tag);\r\n        }\r\n        else if (t->IsEndTag()) {\r\n            if (!IsInlineTag(t->tag) && text.Size() > 0 && text.Last() == ' ') {\r\n                text.Pop();\r\n                text.Append(\"\\r\\n\");\r\n            }\r\n            // when closing a tag, if the top tag doesn't match but\r\n            // there are only potentially self-closing tags on the\r\n            // stack between the matching tag, we pop all of them\r\n            if (tagNesting.Contains(t->tag)) {\r\n                while (tagNesting.Last() != t->tag)\r\n                    tagNesting.Pop();\r\n            }\r\n            if (tagNesting.Count() > 0 && tagNesting.Last() == t->tag)\r\n                tagNesting.Pop();\r\n        }\r\n    }\r\n\r\n    return str::conv::FromUtf8(text.Get());\r\n}\r\n\r\nHRESULT CEpubFilter::GetNextChunkValue(CChunkValue &chunkValue)\r\n{\r\n    ScopedMem<WCHAR> str;\r\n\r\n    switch (m_state) {\r\n    case STATE_EPUB_START:\r\n        m_state = STATE_EPUB_AUTHOR;\r\n        chunkValue.SetTextValue(PKEY_PerceivedType, L\"document\");\r\n        return S_OK;\r\n\r\n    case STATE_EPUB_AUTHOR:\r\n        m_state = STATE_EPUB_TITLE;\r\n        str.Set(m_epubDoc->GetProperty(Prop_Author));\r\n        if (!str::IsEmpty(str.Get())) {\r\n            chunkValue.SetTextValue(PKEY_Author, str);\r\n            return S_OK;\r\n        }\r\n        // fall through\r\n\r\n    case STATE_EPUB_TITLE:\r\n        m_state = STATE_EPUB_DATE;\r\n        str.Set(m_epubDoc->GetProperty(Prop_Title));\r\n        if (!str) str.Set(m_epubDoc->GetProperty(Prop_Subject));\r\n        if (!str::IsEmpty(str.Get())) {\r\n            chunkValue.SetTextValue(PKEY_Title, str);\r\n            return S_OK;\r\n        }\r\n        // fall through\r\n\r\n    case STATE_EPUB_DATE:\r\n        m_state = STATE_EPUB_CONTENT;\r\n        str.Set(m_epubDoc->GetProperty(Prop_ModificationDate));\r\n        if (!str) str.Set(m_epubDoc->GetProperty(Prop_CreationDate));\r\n        if (!str::IsEmpty(str.Get())) {\r\n            SYSTEMTIME systime;\r\n            if (IsoDateParse(str, &systime)) {\r\n                FILETIME filetime;\r\n                SystemTimeToFileTime(&systime, &filetime);\r\n                chunkValue.SetFileTimeValue(PKEY_ItemDate, filetime);\r\n                return S_OK;\r\n            }\r\n        }\r\n        // fall through\r\n\r\n    case STATE_EPUB_CONTENT:\r\n        m_state = STATE_EPUB_END;\r\n        str.Set(ExtractHtmlText(m_epubDoc));\r\n        if (!str::IsEmpty(str.Get())) {\r\n            chunkValue.SetTextValue(PKEY_Search_Contents, str, CHUNK_TEXT);\r\n            return S_OK;\r\n        }\r\n        // fall through\r\n\r\n    case STATE_EPUB_END:\r\n    default:\r\n        return FILTER_E_END_OF_CHUNKS;\r\n    }\r\n}\r\n"
  },
  {
    "path": "src/ifilter/CEpubFilter.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: GPLv3 */\n\nenum EPUB_FILTER_STATE { STATE_EPUB_START, STATE_EPUB_AUTHOR, STATE_EPUB_TITLE, STATE_EPUB_DATE, STATE_EPUB_CONTENT, STATE_EPUB_END };\n\nclass EpubDoc;\n\nclass CEpubFilter : public CFilterBase\n{\npublic:\n    CEpubFilter(long *plRefCount) : CFilterBase(plRefCount),\n        m_state(STATE_EPUB_END), m_epubDoc(nullptr) { }\n    ~CEpubFilter()  override { CleanUp(); }\n\n    HRESULT OnInit() override;\n    HRESULT GetNextChunkValue(CChunkValue &chunkValue) override;\n\n    VOID CleanUp();\n\n    // IPersist\n    IFACEMETHODIMP GetClassID(CLSID *pClassID) {\n        return CLSIDFromString(SZ_EPUB_FILTER_HANDLER, pClassID);\n    }\n\nprivate:\n    EPUB_FILTER_STATE m_state;\n    EpubDoc *m_epubDoc;\n};\n"
  },
  {
    "path": "src/ifilter/CPdfFilter.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: GPLv3 */\n\n// utils\n#include \"BaseUtil.h\"\n#include \"WinUtil.h\"\n// rendering engines\n#include \"BaseEngine.h\"\n#include \"PdfEngine.h\"\n// ui\n#include \"FilterBase.h\"\n#include \"PdfFilter.h\"\n#include \"CPdfFilter.h\"\n\nVOID CPdfFilter::CleanUp()\n{\n    if (m_pdfEngine) {\n        delete m_pdfEngine;\n        m_pdfEngine = nullptr;\n    }\n    m_state = STATE_PDF_END;\n}\n\nHRESULT CPdfFilter::OnInit()\n{\n    CleanUp();\n\n    // TODO: PdfEngine::CreateFromStream never returns with\n    //       m_pStream instead of a clone - why?\n\n    // load content of PDF document into a seekable stream\n    HRESULT res;\n    size_t len;\n    void *data = GetDataFromStream(m_pStream, &len, &res);\n    if (!data)\n        return res;\n\n    ScopedComPtr<IStream> stream(CreateStreamFromData(data, len));\n    free(data);\n    if (!stream)\n        return E_FAIL;\n\n    m_pdfEngine = PdfEngine::CreateFromStream(stream);\n    if (!m_pdfEngine)\n        return E_FAIL;\n\n    m_state = STATE_PDF_START;\n    m_iPageNo = 0;\n    return S_OK;\n}\n\n// copied from SumatraProperties.cpp\nstatic bool PdfDateParse(const WCHAR *pdfDate, SYSTEMTIME *timeOut)\n{\n    ZeroMemory(timeOut, sizeof(SYSTEMTIME));\n    // \"D:\" at the beginning is optional\n    if (str::StartsWith(pdfDate, L\"D:\"))\n        pdfDate += 2;\n    return str::Parse(pdfDate, L\"%4d%2d%2d\" L\"%2d%2d%2d\",\n        &timeOut->wYear, &timeOut->wMonth, &timeOut->wDay,\n        &timeOut->wHour, &timeOut->wMinute, &timeOut->wSecond) != nullptr;\n    // don't bother about the day of week, we won't display it anyway\n}\n\nHRESULT CPdfFilter::GetNextChunkValue(CChunkValue &chunkValue)\n{\n    ScopedMem<WCHAR> str;\n\n    switch (m_state) {\n    case STATE_PDF_START:\n        m_state = STATE_PDF_AUTHOR;\n        chunkValue.SetTextValue(PKEY_PerceivedType, L\"document\");\n        return S_OK;\n\n    case STATE_PDF_AUTHOR:\n        m_state = STATE_PDF_TITLE;\n        str.Set(m_pdfEngine->GetProperty(Prop_Author));\n        if (!str::IsEmpty(str.Get())) {\n            chunkValue.SetTextValue(PKEY_Author, str);\n            return S_OK;\n        }\n        // fall through\n\n    case STATE_PDF_TITLE:\n        m_state = STATE_PDF_DATE;\n        str.Set(m_pdfEngine->GetProperty(Prop_Title));\n        if (!str) str.Set(m_pdfEngine->GetProperty(Prop_Subject));\n        if (!str::IsEmpty(str.Get())) {\n            chunkValue.SetTextValue(PKEY_Title, str);\n            return S_OK;\n        }\n        // fall through\n\n    case STATE_PDF_DATE:\n        m_state = STATE_PDF_CONTENT;\n        str.Set(m_pdfEngine->GetProperty(Prop_ModificationDate));\n        if (!str) str.Set(m_pdfEngine->GetProperty(Prop_CreationDate));\n        if (!str::IsEmpty(str.Get())) {\n            SYSTEMTIME systime;\n            FILETIME filetime;\n            if (PdfDateParse(str, &systime) && SystemTimeToFileTime(&systime, &filetime)) {\n                chunkValue.SetFileTimeValue(PKEY_ItemDate, filetime);\n                return S_OK;\n            }\n        }\n        // fall through\n\n    case STATE_PDF_CONTENT:\n        while (++m_iPageNo <= m_pdfEngine->PageCount()) {\n            str.Set(m_pdfEngine->ExtractPageText(m_iPageNo, L\"\\r\\n\"));\n            if (str::IsEmpty(str.Get()))\n                continue;\n            chunkValue.SetTextValue(PKEY_Search_Contents, str, CHUNK_TEXT);\n            return S_OK;\n        }\n        m_state = STATE_PDF_END;\n        // fall through\n\n    case STATE_PDF_END:\n    default:\n        return FILTER_E_END_OF_CHUNKS;\n    }\n}\n"
  },
  {
    "path": "src/ifilter/CPdfFilter.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: GPLv3 */\n\nenum PDF_FILTER_STATE { STATE_PDF_START, STATE_PDF_AUTHOR, STATE_PDF_TITLE, STATE_PDF_DATE, STATE_PDF_CONTENT, STATE_PDF_END };\n\nclass BaseEngine;\n\nclass CPdfFilter : public CFilterBase\n{\npublic:\n    CPdfFilter(long *plRefCount) : CFilterBase(plRefCount),\n        m_state(STATE_PDF_END), m_iPageNo(-1), m_pdfEngine(nullptr) { }\n    ~CPdfFilter()  override { CleanUp(); }\n\n    HRESULT OnInit() override;\n    HRESULT GetNextChunkValue(CChunkValue &chunkValue) override;\n\n    VOID CleanUp();\n\n    // IPersist\n    IFACEMETHODIMP GetClassID(CLSID *pClassID) {\n        return CLSIDFromString(SZ_PDF_FILTER_HANDLER, pClassID);\n    }\n\nprivate:\n    PDF_FILTER_STATE m_state;\n    int m_iPageNo;\n    BaseEngine *m_pdfEngine;\n};\n"
  },
  {
    "path": "src/ifilter/CTeXFilter.cpp",
    "content": "﻿/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: GPLv3 */\n\n// utils\n#include \"BaseUtil.h\"\n#include \"WinUtil.h\"\n// ui\n#include \"FilterBase.h\"\n#include \"PdfFilter.h\"\n#include \"CTeXFilter.h\"\n\nHRESULT CTeXFilter::OnInit()\n{\n    if (!m_pData) {\n        // load content of LaTeX file into m_pData\n        HRESULT res;\n        size_t len;\n        void *data = GetDataFromStream(m_pStream, &len, &res);\n        if (!data)\n            return res;\n\n        m_pData = str::ToWideChar((char *)data, CP_ACP);\n        m_pBuffer = AllocArray<WCHAR>(len + 1);\n        free(data);\n\n        if (!m_pData || !m_pBuffer) {\n            CleanUp();\n            return E_OUTOFMEMORY;\n        }\n    }\n\n    m_state = STATE_TEX_START;\n    m_pPtr = m_pData;\n    m_iDepth = 0;\n\n    return S_OK;\n}\n\n#define iscmdchar(c) (iswalnum(c) || (c) == '_')\n#define skipspace(pc) for (; str::IsWs(*(pc)) && *(pc) != '\\n'; (pc)++)\n#define skipcomment(pc) while (*(pc) && *(pc)++ != '\\n')\n\n// appends a new line, if the last character isn't one already\nstatic inline void addsingleNL(WCHAR *base, WCHAR **cur)\n{\n    if (*cur > base && *(*cur - 1) != '\\n')\n        *(*cur)++ = '\\n';\n}\n\n// appends a space, if the last character isn't one already\nstatic inline void addsinglespace(WCHAR *base, WCHAR **cur)\n{\n    if (*cur > base && !str::IsWs(*(*cur - 1)))\n        *(*cur)++ = ' ';\n}\n\n// extracts a text block contained within a pair of braces\n// (may contain nested braces)\nWCHAR *CTeXFilter::ExtractBracedBlock()\n{\n    m_iDepth++;\n\n    WCHAR *result = m_pBuffer + (m_pPtr - m_pData);\n    WCHAR *rptr = result;\n\n    int currDepth = m_iDepth;\n\n    while (*m_pPtr && m_iDepth >= currDepth) {\n        switch (*m_pPtr++) {\n        case '\\\\':\n            // skip all LaTeX/TeX commands\n            if (iscmdchar(*m_pPtr)) {\n                // ignore the content of \\begin{...} and \\end{...}\n                if (str::StartsWith(m_pPtr, L\"begin{\") || str::StartsWith(m_pPtr, L\"end{\")) {\n                    m_pPtr = wcschr(m_pPtr, '{') + 1;\n                    ExtractBracedBlock();\n                    addsingleNL(result, &rptr);\n                    break;\n                }\n                // convert \\item to a single dash\n                if (str::StartsWith(m_pPtr, L\"item\") && !iscmdchar(*(m_pPtr + 4))) {\n                    m_pPtr += 4;\n                    addsingleNL(result, &rptr);\n                    *rptr++ = '-';\n                    addsinglespace(result, &rptr);\n                }\n                for (; iscmdchar(*m_pPtr); m_pPtr++);\n                skipspace(m_pPtr);\n                // ignore command parameters in brackets\n                if (*m_pPtr == '[' && wcschr(m_pPtr, ']')) {\n                    m_pPtr = wcschr(m_pPtr, ']') + 1;\n                }\n                break;\n            }\n            // handle newlines newlines, spaces, etc.\n            if (*m_pPtr == '\\\\') { addsingleNL(result, &rptr); m_pPtr++; break; }\n            if (*m_pPtr == ',')  { addsinglespace(result, &rptr); m_pPtr++; break; }\n            if (*m_pPtr == '>')  { *rptr++ = '\\t'; m_pPtr++; break; }\n            if (*m_pPtr == '%')  { *rptr++ = '%'; m_pPtr++; break; }\n            // TODO: handle more international characters\n            if (str::StartsWith(m_pPtr, L\"'e\")) { *rptr++ = L'é'; m_pPtr += 2; break; }\n            if (str::StartsWith(m_pPtr, L\"`e\")) { *rptr++ = L'è'; m_pPtr += 2; break; }\n            if (str::StartsWith(m_pPtr, L\"`a\")) { *rptr++ = L'à'; m_pPtr += 2; break; }\n            if (*m_pPtr != '\"')\n                break;\n            m_pPtr++;\n            /* fall through */\n        case '\"':\n            // TODO: handle more international characters\n            switch (*m_pPtr++) {\n            case 'a': *rptr++ = L'ä'; break;\n            case 'A': *rptr++ = L'Ä'; break;\n            case 'o': *rptr++ = L'ö'; break;\n            case 'O': *rptr++ = L'Ö'; break;\n            case 'u': *rptr++ = L'ü'; break;\n            case 'U': *rptr++ = L'Ü'; break;\n            case '`': case '\\'': *rptr++ = '\"'; break;\n            default: *rptr++ = *(m_pPtr - 1); break;\n            }\n            break;\n        case '{':\n            m_iDepth++;\n            break;\n        case '}':\n            m_iDepth--;\n            if (*m_pPtr == '{')\n                addsinglespace(result, &rptr);\n            break;\n        case '[':\n            // ignore command parameters in brackets\n            if (wcschr(m_pPtr, ']') && wcschr(m_pPtr, ']') < wcschr(m_pPtr, '\\n'))\n                m_pPtr = wcschr(m_pPtr, ']') + 1;\n            break;\n        case '%':\n            skipcomment(m_pPtr);\n            break;\n        case '&':\n            *rptr++ = '\\t';\n            break;\n        case '~':\n            addsinglespace(result, &rptr);\n            break;\n        case '\\n':\n            // treat single newlines as spaces\n            if (*m_pPtr == '\\n' || *m_pPtr == '\\r') {\n                addsingleNL(result, &rptr);\n                m_pPtr++;\n                break;\n            }\n        default:\n            m_pPtr--;\n            if (str::IsWs(*m_pPtr)) {\n                addsinglespace(result, &rptr);\n                m_pPtr++;\n                break;\n            }\n            *rptr++ = *m_pPtr++;\n            break;\n        }\n    }\n\n    if (*m_pPtr == '}')\n        m_pPtr++;\n    *rptr = '\\0';\n    return result;\n}\n\nHRESULT CTeXFilter::GetNextChunkValue(CChunkValue &chunkValue)\n{\n    WCHAR *start, *end;\n\nContinueParsing:\n    if (!*m_pPtr && m_state == STATE_TEX_PREAMBLE) {\n        // if there was no preamble, treat the whole document as content\n        m_pPtr = m_pData;\n        m_iDepth = 0;\n        m_state = STATE_TEX_CONTENT;\n    }\n    else if (!*m_pPtr) {\n        m_state = STATE_TEX_END;\n    }\n\n    switch (m_state)\n    {\n    case STATE_TEX_START:\n        m_state = STATE_TEX_PREAMBLE;\n        chunkValue.SetTextValue(PKEY_PerceivedType, L\"document\");\n        return S_OK;\n    case STATE_TEX_PREAMBLE:\n        // the preamble (i.e. everything before \\begin{document}) may contain\n        // \\author{...} and \\title{...} commands\n        start = end = nullptr;\n        while (*m_pPtr && !start) {\n            switch (*m_pPtr++){\n            case '\\\\':\n                if (iscmdchar(*m_pPtr)) {\n                    start = m_pPtr;\n                    for (end = start; iscmdchar(*m_pPtr); m_pPtr++, end++);\n                    break;\n                }\n                if (*m_pPtr)\n                    m_pPtr++;\n                break;\n            case '{':\n                ExtractBracedBlock();\n                break;\n            case '%':\n                skipcomment(m_pPtr);\n                break;\n            }\n        }\n        if (!start)\n            goto ContinueParsing;\n        skipspace(m_pPtr);\n        if (*m_pPtr != '{')\n            goto ContinueParsing;\n        m_pPtr++;\n\n        if (!wcsncmp(start, L\"author\", end - start) || !wcsncmp(start, L\"title\", end - start)) {\n            chunkValue.SetTextValue(*start == 'a' ? PKEY_Author : PKEY_Title, ExtractBracedBlock());\n            return S_OK;\n        }\n\n        if (!wcsncmp(start, L\"begin\", end - start) && str::Eq(ExtractBracedBlock(), L\"document\"))\n            m_state = STATE_TEX_CONTENT;\n        goto ContinueParsing;\n    case STATE_TEX_CONTENT:\n        chunkValue.SetTextValue(PKEY_Search_Contents, ExtractBracedBlock(), CHUNK_TEXT);\n        return S_OK;\n    default:\n        return FILTER_E_END_OF_CHUNKS;\n    }\n}\n"
  },
  {
    "path": "src/ifilter/CTeXFilter.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: GPLv3 */\n\nenum TEX_FILTER_STATE { STATE_TEX_START, STATE_TEX_PREAMBLE, STATE_TEX_CONTENT, STATE_TEX_END };\n\nclass CTeXFilter : public CFilterBase\n{\npublic:\n    CTeXFilter(long *plRefCount) : CFilterBase(plRefCount),\n        m_state(STATE_TEX_END), m_pData(nullptr), m_pPtr(nullptr),\n        m_pBuffer(nullptr), m_iDepth(0) { }\n    ~CTeXFilter() override { CleanUp(); }\n\n    HRESULT OnInit() override;\n    HRESULT GetNextChunkValue(CChunkValue &chunkValue) override;\n\n    VOID CleanUp()\n    {\n        free(m_pData);\n        m_pData = nullptr;\n        free(m_pBuffer);\n        m_pBuffer = nullptr;\n    }\n    WCHAR *ExtractBracedBlock();\n\n    // IPersist\n    IFACEMETHODIMP GetClassID(CLSID *pClassID) {\n        return CLSIDFromString(SZ_TEX_FILTER_HANDLER, pClassID);\n    }\n\nprivate:\n    TEX_FILTER_STATE m_state;\n    WCHAR *m_pData, *m_pPtr, *m_pBuffer;\n    int m_iDepth;\n};\n"
  },
  {
    "path": "src/ifilter/FilterBase.h",
    "content": "// THIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF\n// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A\n// PARTICULAR PURPOSE.\n//\n// Copyright (c) Microsoft Corporation. All rights reserved\n\n#ifndef __FILTERBASE_H__\n#define __FILTERBASE_H__\n\n#include <strsafe.h>\n#include <propkey.h>\n#include <propsys.h>\n#include <filter.h>\n#include <filterr.h>\n\nclass CChunkValue\n{\npublic:\n    CChunkValue() : m_fIsValid(false), m_pszValue(nullptr)\n    {\n        PropVariantInit(&m_propVariant);\n        Clear();\n    }\n\n    ~CChunkValue() { Clear(); };\n\n    void Clear()\n    {\n        m_fIsValid = false;\n        ZeroMemory(&m_chunk, sizeof(m_chunk));\n        PropVariantClear(&m_propVariant);\n        CoTaskMemFree(m_pszValue);\n        m_pszValue = nullptr;\n    }\n\n    BOOL IsValid() { return m_fIsValid; }\n\n    HRESULT GetValue(PROPVARIANT **ppPropVariant)\n    {\n        if (!ppPropVariant)\n            return E_INVALIDARG;\n\n        *ppPropVariant = nullptr;\n\n        PROPVARIANT *pPropVariant = static_cast<PROPVARIANT*>(CoTaskMemAlloc(sizeof(PROPVARIANT)));\n        if (!pPropVariant)\n            return E_OUTOFMEMORY;\n\n        HRESULT hr = PropVariantCopy(pPropVariant, &m_propVariant);\n        if (SUCCEEDED(hr))\n            *ppPropVariant = pPropVariant;\n        else\n            CoTaskMemFree(pPropVariant);\n\n        return hr;\n    }\n\n    PWSTR GetString() { return m_pszValue; };\n\n    HRESULT CopyChunk(STAT_CHUNK *pStatChunk)\n    {\n        if (!pStatChunk)\n            return E_INVALIDARG;\n\n        *pStatChunk = m_chunk;\n        return S_OK;\n    }\n\n    CHUNKSTATE GetChunkType() { return m_chunk.flags; }\n\n    HRESULT SetTextValue(REFPROPERTYKEY pkey, PCWSTR pszValue, CHUNKSTATE chunkType = CHUNK_VALUE,\n                         LCID locale = 0, DWORD cwcLenSource = 0, DWORD cwcStartSource = 0,\n                         CHUNK_BREAKTYPE chunkBreakType = CHUNK_NO_BREAK)\n    {\n        if (pszValue == nullptr)\n            return E_INVALIDARG;\n\n        HRESULT hr = SetChunk(pkey, chunkType, locale, cwcLenSource, cwcStartSource, chunkBreakType);\n        if (FAILED(hr))\n            return hr;\n\n        size_t cch = wcslen(pszValue) + 1;\n        PWSTR pszCoTaskValue = static_cast<PWSTR>(CoTaskMemAlloc(cch * sizeof(WCHAR)));\n        if (!pszCoTaskValue)\n            return E_OUTOFMEMORY;\n\n        StringCchCopyW(pszCoTaskValue, cch, pszValue);\n        m_fIsValid = true;\n        if (chunkType == CHUNK_VALUE)\n        {\n            m_propVariant.vt = VT_LPWSTR;\n            m_propVariant.pwszVal = pszCoTaskValue;\n        }\n        else\n        {\n            m_pszValue = pszCoTaskValue;\n        }\n\n        return hr;\n    };\n\n    HRESULT SetFileTimeValue(REFPROPERTYKEY pkey, FILETIME dtVal, CHUNKSTATE chunkType = CHUNK_VALUE,\n                             LCID locale = 0, DWORD cwcLenSource = 0, DWORD cwcStartSource = 0,\n                             CHUNK_BREAKTYPE chunkBreakType = CHUNK_NO_BREAK)\n    {\n        HRESULT hr = SetChunk(pkey, chunkType, locale, cwcLenSource, cwcStartSource, chunkBreakType);\n        if (FAILED(hr))\n            return hr;\n\n        m_propVariant.vt = VT_FILETIME;\n        m_propVariant.filetime = dtVal;\n        m_fIsValid = true;\n\n        return hr;\n    };\n\nprotected:\n    HRESULT SetChunk(REFPROPERTYKEY pkey, CHUNKSTATE chunkType=CHUNK_VALUE, LCID locale=0, DWORD cwcLenSource=0, DWORD cwcStartSource=0, CHUNK_BREAKTYPE chunkBreakType=CHUNK_NO_BREAK);\n\nprivate:\n    bool m_fIsValid;\n    STAT_CHUNK  m_chunk;\n    PROPVARIANT m_propVariant;\n    PWSTR m_pszValue;\n\n};\n\ninline HRESULT CChunkValue::SetChunk(REFPROPERTYKEY pkey,\n                                     CHUNKSTATE chunkType/*=CHUNK_VALUE*/,\n                                     LCID locale /*=0*/,\n                                     DWORD cwcLenSource /*=0*/,\n                                     DWORD cwcStartSource /*=0*/,\n                                     CHUNK_BREAKTYPE chunkBreakType /*= CHUNK_NO_BREAK */)\n{\n    Clear();\n\n    m_chunk.attribute.psProperty.ulKind = PRSPEC_PROPID;\n    m_chunk.attribute.psProperty.propid = pkey.pid;\n    m_chunk.attribute.guidPropSet = pkey.fmtid;\n    m_chunk.flags = chunkType;\n    m_chunk.locale = locale;\n    m_chunk.cwcLenSource = cwcLenSource;\n    m_chunk.cwcStartSource = cwcStartSource;\n    m_chunk.breakType = chunkBreakType;\n\n    return S_OK;\n}\n\nclass CFilterBase : public IFilter, public IInitializeWithStream, public IPersistStream, public IPersistFile\n{\npublic:\n    // OnInit() is called when the IFilter is initialized (at the end of IFilter::Init)\n    virtual HRESULT OnInit() = 0;\n\n    // When GetNextChunkValue() is called you should fill in the ChunkValue by calling SetXXXValue() with the property.\n    // example:  chunkValue.SetTextValue(PKYE_ItemName, L\"foo bar\");\n    // return FILTER_E_END_OF_CHUNKS when there are no more chunks\n    virtual HRESULT GetNextChunkValue(CChunkValue &chunkValue) = 0;\n\nprotected:\n    inline DWORD GetChunkId() const { return m_dwChunkId; }\n\npublic:\n    CFilterBase(long *plRefCount) : m_lRef(1), m_plModuleRef(plRefCount),\n        m_dwChunkId(0), m_iText(0), m_pStream(nullptr) {\n        InterlockedIncrement(m_plModuleRef);\n    }\n\n    virtual ~CFilterBase() {\n        if (m_pStream)\n            m_pStream->Release();\n        InterlockedDecrement(m_plModuleRef);\n    }\n\n    // IUnknown\n    IFACEMETHODIMP QueryInterface(REFIID riid, void **ppv) {\n        static const QITAB qit[] = {\n            QITABENT(CFilterBase, IPersistStream),\n            QITABENT(CFilterBase, IPersistFile),\n            QITABENTMULTI(CFilterBase, IPersist, IPersistStream),\n            QITABENT(CFilterBase, IInitializeWithStream),\n            QITABENT(CFilterBase, IFilter),\n            { 0 }\n        };\n        return QISearch(this, qit, riid, ppv);\n    }\n    IFACEMETHODIMP_(ULONG) AddRef() {\n        return InterlockedIncrement(&m_lRef);\n    }\n    IFACEMETHODIMP_(ULONG) Release() {\n        long cRef = InterlockedDecrement(&m_lRef);\n        if (cRef == 0)\n            delete this;\n        return cRef;\n    }\n\n    // IFilter\n    IFACEMETHODIMP Init(ULONG grfFlags, ULONG cAttributes, const FULLPROPSPEC *aAttributes, ULONG *pFlags) {\n        UNUSED(grfFlags);\n        if (cAttributes > 0 && !aAttributes)\n            return E_INVALIDARG;\n\n        m_dwChunkId = 0;\n        m_iText = 0;\n        m_currentChunk.Clear();\n        if (pFlags)\n            *pFlags = 0;\n\n        return OnInit();\n    }\n\n    IFACEMETHODIMP GetChunk(STAT_CHUNK *pStat) {\n        m_currentChunk.Clear();\n        HRESULT hr = GetNextChunkValue(m_currentChunk);\n        if (hr != S_OK)\n            return hr;\n        if (!m_currentChunk.IsValid())\n             return E_INVALIDARG;\n\n        m_iText = 0;\n        m_currentChunk.CopyChunk(pStat);\n        pStat->idChunk = ++m_dwChunkId;\n        if (pStat->flags == CHUNK_TEXT)\n            pStat->idChunkSource = pStat->idChunk;\n\n        return hr;\n    }\n\n    IFACEMETHODIMP GetText(ULONG *pcwcBuffer, WCHAR *awcBuffer) {\n        if (!pcwcBuffer || !*pcwcBuffer)\n            return E_INVALIDARG;\n        if (!m_currentChunk.IsValid())\n            return FILTER_E_NO_MORE_TEXT;\n        if (m_currentChunk.GetChunkType() != CHUNK_TEXT)\n            return FILTER_E_NO_TEXT;\n\n        ULONG cchTotal = static_cast<ULONG>(wcslen(m_currentChunk.GetString()));\n        ULONG cchLeft = cchTotal - m_iText;\n        ULONG cchToCopy = std::min(*pcwcBuffer - 1, cchLeft);\n\n        if (!cchToCopy)\n            return FILTER_E_NO_MORE_TEXT;\n\n        PCWSTR psz = m_currentChunk.GetString() + m_iText;\n        StringCchCopyNW(awcBuffer, *pcwcBuffer, psz, cchToCopy);\n        awcBuffer[cchToCopy] = '\\0';\n\n        *pcwcBuffer = cchToCopy;\n        m_iText += cchToCopy;\n        cchLeft -= cchToCopy;\n\n        if (!cchLeft)\n            return FILTER_S_LAST_TEXT;\n\n        return S_OK;\n    }\n\n    IFACEMETHODIMP GetValue(PROPVARIANT **ppPropValue) {\n        if (!m_currentChunk.IsValid())\n            return FILTER_E_NO_MORE_VALUES;\n        if (m_currentChunk.GetChunkType() != CHUNK_VALUE)\n            return FILTER_E_NO_VALUES;\n        if (ppPropValue == nullptr)\n            return E_INVALIDARG;\n\n        HRESULT hr = m_currentChunk.GetValue(ppPropValue);\n        m_currentChunk.Clear();\n\n        return hr;\n    }\n    IFACEMETHODIMP BindRegion(FILTERREGION, REFIID, void **) { return E_NOTIMPL; }\n\n    // IInitializeWithStream\n    IFACEMETHODIMP Initialize(IStream *pStm, DWORD grfMode) {\n        UNUSED(grfMode);\n        if (m_pStream)\n            m_pStream->Release();\n        m_pStream = pStm;\n        if (!m_pStream)\n            return E_INVALIDARG;\n        m_pStream->AddRef();\n        return S_OK;\n    };\n\n    // IPersistStream\n    IFACEMETHODIMP IsDirty() { return E_NOTIMPL; }\n    IFACEMETHODIMP Load(IStream *pStm) { return Initialize(pStm, 0); }\n    IFACEMETHODIMP Save(IStream *pStm, BOOL fClearDirty) { UNUSED(pStm); UNUSED(fClearDirty); return E_NOTIMPL; }\n    IFACEMETHODIMP GetSizeMax(ULARGE_INTEGER *pcbSize) { UNUSED(pcbSize); return E_NOTIMPL; }\n\n    // IPersistFile (for compatibility with older Windows Desktop Search versions and ifilttst.exe)\n    IFACEMETHODIMP Load(LPCOLESTR pszFileName, DWORD dwMode) {\n        UNUSED(dwMode);\n        HANDLE hFile = CreateFileW(pszFileName, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);\n        if (hFile == INVALID_HANDLE_VALUE)\n            return E_INVALIDARG;\n        DWORD size = GetFileSize(hFile, nullptr), read;\n        HGLOBAL data = GlobalAlloc(GMEM_MOVEABLE, size);\n        if (!data) {\n            CloseHandle(hFile);\n            return E_OUTOFMEMORY;\n        }\n        BOOL ok = ReadFile(hFile, GlobalLock(data), size, &read, nullptr);\n        GlobalUnlock(data);\n        CloseHandle(hFile);\n\n        IStream *pStm;\n        if (!ok || FAILED(CreateStreamOnHGlobal(data, TRUE, &pStm))) {\n            GlobalFree(data);\n            return E_FAIL;\n        }\n        HRESULT res = Initialize(pStm, 0);\n        pStm->Release();\n        return res;\n    }\n    IFACEMETHODIMP Save(LPCOLESTR pszFileName, BOOL bRemember) { UNUSED(pszFileName); UNUSED(bRemember); return E_NOTIMPL; }\n    IFACEMETHODIMP SaveCompleted(LPCOLESTR pszFileName) { UNUSED(pszFileName); return E_NOTIMPL; }\n    IFACEMETHODIMP GetCurFile(LPOLESTR *ppszFileName) { UNUSED(ppszFileName); return E_NOTIMPL; }\n\nprotected:\n    IStream*                    m_pStream;\n\nprivate:\n    long                        m_lRef, * m_plModuleRef;\n\n    DWORD                       m_dwChunkId;\n    DWORD                       m_iText;\n\n    CChunkValue                 m_currentChunk;\n};\n\n#endif\n"
  },
  {
    "path": "src/ifilter/PdfFilter.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: GPLv3 */\n\n#define SZ_PDF_FILTER_CLSID   L\"{55808EA8-81FE-43c6-AAE8-1D8149F941D3}\"\n#define SZ_PDF_FILTER_HANDLER L\"{26CA6565-F22A-4f5e-B688-0AD051D56E96}\"\n\n#ifdef BUILD_TEX_IFILTER\n#define SZ_TEX_FILTER_CLSID   L\"{AF57F784-ED93-4f2c-8C1D-CCDCB6E27CA6}\"\n#define SZ_TEX_FILTER_HANDLER L\"{3FAB27F8-08EC-4b9e-9EEE-181A6E846B8D}\"\n#endif\n\n#ifdef BUILD_EPUB_IFILTER\n#define SZ_EPUB_FILTER_CLSID   L\"{FE4C7847-4260-43e3-A449-08ED76009F94}\"\n#define SZ_EPUB_FILTER_HANDLER L\"{FF68D1A0-DA54-4fbf-A406-06CFDB764CA9}\"\n#endif\n"
  },
  {
    "path": "src/ifilter/PdfFilter.rc",
    "content": "#include <windows.h>\n#include \"../Version.h\"\n\nVS_VERSION_INFO    VERSIONINFO     MOVEABLE IMPURE LOADONCALL DISCARDABLE\n  FILEVERSION    VER_RESOURCE\n  PRODUCTVERSION VER_RESOURCE\n  FILEFLAGS     0\n  FILEOS        VOS_NT_WINDOWS32\n  FILETYPE      VFT_DLL\n  FILESUBTYPE   0       // not used\nBEGIN\n  BLOCK \"StringFileInfo\"\n  BEGIN\n    BLOCK \"040904E4\"\n    //language ID = U.S. English, char set = Windows, Multilingual\n\n    BEGIN\n      VALUE \"FileDescription\",  \"SumatraPDF IFilter Search Helper\"\n      VALUE \"FileVersion\",      VER_RESOURCE_STR\n      VALUE \"LegalCopyright\",   COPYRIGHT_STR\n      VALUE \"OriginalFilename\", \"PdfFilter.dll\"\n      VALUE \"ProductName\",      \"SumatraPDF\"\n      VALUE \"ProductVersion\",   VER_RESOURCE_STR\n    END\n  END\n  BLOCK \"VarFileInfo\"\n  BEGIN\n    VALUE \"Translation\", 0x0409, 1252\n  END\nEND\n"
  },
  {
    "path": "src/ifilter/PdfFilterDll.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: GPLv3 */\n\n// utils\n#include \"BaseUtil.h\"\n#include \"FileUtil.h\"\n#include \"WinUtil.h\"\n// ui\n#include \"FilterBase.h\"\n#include \"PdfFilter.h\"\n#include \"CPdfFilter.h\"\n#ifdef BUILD_TEX_IFILTER\n#include \"CTeXFilter.h\"\n#endif\n#ifdef BUILD_EPUB_IFILTER\n#include \"CEpubFilter.h\"\n#endif\n\nlong g_lRefCount = 0;\n\nclass CClassFactory : public IClassFactory\n{\npublic:\n    CClassFactory(REFCLSID rclsid) : m_lRef(1), m_clsid(rclsid)\n    {\n        InterlockedIncrement(&g_lRefCount);\n    }\n\n    ~CClassFactory() { InterlockedDecrement(&g_lRefCount); }\n\n    // IUnknown\n    IFACEMETHODIMP QueryInterface(REFIID riid, void **ppv)\n    {\n        static const QITAB qit[] =\n        {\n            QITABENT(CClassFactory, IClassFactory),\n            { 0 }\n        };\n        return QISearch(this, qit, riid, ppv);\n    }\n\n    IFACEMETHODIMP_(ULONG) AddRef()\n    {\n        return InterlockedIncrement(&m_lRef);\n    }\n\n    IFACEMETHODIMP_(ULONG) Release()\n    {\n        long cRef = InterlockedDecrement(&m_lRef);\n        if (cRef == 0)\n            delete this;\n        return cRef;\n    }\n\n    // IClassFactory\n    IFACEMETHODIMP CreateInstance(IUnknown *punkOuter, REFIID riid, void **ppv)\n    {\n        *ppv = nullptr;\n        if (punkOuter)\n            return CLASS_E_NOAGGREGATION;\n\n        ScopedComPtr<IFilter> pFilter;\n\n        CLSID clsid;\n        if (SUCCEEDED(CLSIDFromString(SZ_PDF_FILTER_CLSID, &clsid)) && IsEqualCLSID(m_clsid, clsid))\n            pFilter = new CPdfFilter(&g_lRefCount);\n#ifdef BUILD_TEX_IFILTER\n        else if (SUCCEEDED(CLSIDFromString(SZ_TEX_FILTER_CLSID, &clsid)) && IsEqualCLSID(m_clsid, clsid))\n            pFilter = new CTeXFilter(&g_lRefCount);\n#endif\n#ifdef BUILD_EPUB_IFILTER\n        else if (SUCCEEDED(CLSIDFromString(SZ_EPUB_FILTER_CLSID, &clsid)) && IsEqualCLSID(m_clsid, clsid))\n            pFilter = new CEpubFilter(&g_lRefCount);\n#endif\n        else\n            return E_NOINTERFACE;\n        if (!pFilter)\n            return E_OUTOFMEMORY;\n\n        return pFilter->QueryInterface(riid, ppv);\n    }\n\n    IFACEMETHODIMP LockServer(BOOL bLock)\n    {\n        if (bLock)\n            InterlockedIncrement(&g_lRefCount);\n        else\n            InterlockedDecrement(&g_lRefCount);\n        return S_OK;\n    }\n\nprivate:\n    long m_lRef;\n    CLSID m_clsid;\n};\n\nSTDAPI_(BOOL) DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)\n{\n    UNUSED(hInstance); UNUSED(lpReserved);\n    if (dwReason == DLL_PROCESS_ATTACH) {\n        CrashIf(hInstance != GetInstance());\n    }\n\n    return TRUE;\n}\n\nSTDAPI DllCanUnloadNow(VOID)\n{\n    return g_lRefCount == 0 ? S_OK : S_FALSE;\n}\n\n// disable warning C6387 which is wrongly issued due to a compiler bug; cf.\n// http://connect.microsoft.com/VisualStudio/feedback/details/498862/c6387-warning-on-stock-dllgetclassobject-code-with-static-analyser\n#pragma warning(push)\n#pragma warning(disable: 6387) /* '*ppv' might be '0': this does not adhere to the specification for the function 'DllGetClassObject' */\n\nSTDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)\n{\n    *ppv = nullptr;\n    ScopedComPtr<CClassFactory> pClassFactory(new CClassFactory(rclsid));\n    if (!pClassFactory)\n        return E_OUTOFMEMORY;\n    return pClassFactory->QueryInterface(riid, ppv);\n}\n\n#pragma warning(pop)\n\nSTDAPI DllRegisterServer()\n{\n    ScopedMem<WCHAR> dllPath(path::GetAppPath());\n    if (!dllPath)\n        return HRESULT_FROM_WIN32(GetLastError());\n\n    struct {\n        WCHAR *key, *value, *data;\n    } regVals[] = {\n        { L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_PDF_FILTER_CLSID,\n                nullptr,                   L\"SumatraPDF IFilter\" },\n        { L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_PDF_FILTER_CLSID L\"\\\\InProcServer32\",\n                nullptr,                   dllPath.Get() },\n        { L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_PDF_FILTER_CLSID L\"\\\\InProcServer32\",\n                L\"ThreadingModel\",   L\"Both\" },\n        { L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_PDF_FILTER_HANDLER,\n                nullptr,                   L\"SumatraPDF IFilter Persistent Handler\" },\n        { L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_PDF_FILTER_HANDLER L\"\\\\PersistentAddinsRegistered\",\n                nullptr,                   L\"\" },\n        { L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_PDF_FILTER_HANDLER L\"\\\\PersistentAddinsRegistered\\\\{89BCB740-6119-101A-BCB7-00DD010655AF}\",\n                nullptr,                   SZ_PDF_FILTER_CLSID },\n        { L\"Software\\\\Classes\\\\.pdf\\\\PersistentHandler\",\n                nullptr,                   SZ_PDF_FILTER_HANDLER },\n#ifdef BUILD_TEX_IFILTER\n        { L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_TEX_FILTER_CLSID,\n                nullptr,                   L\"SumatraPDF IFilter\" },\n        { L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_TEX_FILTER_CLSID L\"\\\\InProcServer32\",\n                nullptr,                   dllPath.Get() },\n        { L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_TEX_FILTER_CLSID L\"\\\\InProcServer32\",\n                L\"ThreadingModel\",      L\"Both\" },\n        { L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_TEX_FILTER_HANDLER,\n                nullptr,                   L\"SumatraPDF LaTeX IFilter Persistent Handler\" },\n        { L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_TEX_FILTER_HANDLER L\"\\\\PersistentAddinsRegistered\",\n                nullptr,                   L\"\" },\n        { L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_TEX_FILTER_HANDLER L\"\\\\PersistentAddinsRegistered\\\\{89BCB740-6119-101A-BCB7-00DD010655AF}\",\n                nullptr,                   SZ_TEX_FILTER_CLSID },\n        { L\"Software\\\\Classes\\\\.tex\\\\PersistentHandler\",\n                nullptr,                   SZ_TEX_FILTER_HANDLER },\n#endif\n#ifdef BUILD_EPUB_IFILTER\n        { L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_EPUB_FILTER_CLSID,\n                nullptr,                   L\"SumatraPDF IFilter\" },\n        { L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_EPUB_FILTER_CLSID L\"\\\\InProcServer32\",\n                nullptr,                   dllPath.Get() },\n        { L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_EPUB_FILTER_CLSID L\"\\\\InProcServer32\",\n                L\"ThreadingModel\",      L\"Both\" },\n        { L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_EPUB_FILTER_HANDLER,\n                nullptr,                   L\"SumatraPDF LaTeX IFilter Persistent Handler\" },\n        { L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_EPUB_FILTER_HANDLER L\"\\\\PersistentAddinsRegistered\",\n                nullptr,                   L\"\" },\n        { L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_EPUB_FILTER_HANDLER L\"\\\\PersistentAddinsRegistered\\\\{89BCB740-6119-101A-BCB7-00DD010655AF}\",\n                nullptr,                   SZ_EPUB_FILTER_CLSID },\n        { L\"Software\\\\Classes\\\\.epub\\\\PersistentHandler\",\n                nullptr,                   SZ_EPUB_FILTER_HANDLER },\n#endif\n    };\n\n    for (int i = 0; i < dimof(regVals); i++) {\n        WriteRegStr(HKEY_LOCAL_MACHINE, regVals[i].key, regVals[i].value, regVals[i].data);\n        bool ok = WriteRegStr(HKEY_CURRENT_USER, regVals[i].key, regVals[i].value, regVals[i].data);\n        if (!ok)\n            return E_FAIL;\n    }\n\n    return S_OK;\n}\n\nSTDAPI DllUnregisterServer()\n{\n    const WCHAR *regKeys[] = {\n        L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_PDF_FILTER_CLSID,\n        L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_PDF_FILTER_HANDLER,\n        L\"Software\\\\Classes\\\\.pdf\\\\PersistentHandler\",\n#ifdef BUILD_TEX_IFILTER\n        L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_TEX_FILTER_CLSID,\n        L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_TEX_FILTER_HANDLER,\n        L\"Software\\\\Classes\\\\.tex\\\\PersistentHandler\",\n#endif\n#ifdef BUILD_EPUB_IFILTER\n        L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_EPUB_FILTER_CLSID,\n        L\"Software\\\\Classes\\\\CLSID\\\\\" SZ_EPUB_FILTER_HANDLER,\n        L\"Software\\\\Classes\\\\.epub\\\\PersistentHandler\",\n#endif\n    };\n\n    HRESULT hr = S_OK;\n\n    for (int i = 0; i < dimof(regKeys); i++) {\n        DeleteRegKey(HKEY_LOCAL_MACHINE, regKeys[i]);\n        bool ok = DeleteRegKey(HKEY_CURRENT_USER, regKeys[i]);\n        if (!ok)\n            hr = E_FAIL;\n    }\n\n    return hr;\n}\n\n#ifdef _WIN64\n#pragma comment(linker, \"/EXPORT:DllCanUnloadNow=DllCanUnloadNow,PRIVATE\")\n#pragma comment(linker, \"/EXPORT:DllGetClassObject=DllGetClassObject,PRIVATE\")\n#pragma comment(linker, \"/EXPORT:DllRegisterServer=DllRegisterServer,PRIVATE\")\n#pragma comment(linker, \"/EXPORT:DllUnregisterServer=DllUnregisterServer,PRIVATE\")\n#else\n#pragma comment(linker, \"/EXPORT:DllCanUnloadNow=_DllCanUnloadNow@0,PRIVATE\")\n#pragma comment(linker, \"/EXPORT:DllGetClassObject=_DllGetClassObject@12,PRIVATE\")\n#pragma comment(linker, \"/EXPORT:DllRegisterServer=_DllRegisterServer@0,PRIVATE\")\n#pragma comment(linker, \"/EXPORT:DllUnregisterServer=_DllUnregisterServer@0,PRIVATE\")\n#endif\n"
  },
  {
    "path": "src/installer/Install.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// Note: this is not built by itself but included in Installer.cpp\r\n#ifdef BUILD_UNINSTALLER\r\n#error BUILD_UNINSTALLER must not be defined!!!\r\n#endif\r\n\r\n#define ID_CHECKBOX_MAKE_DEFAULT      14\r\n#define ID_CHECKBOX_BROWSER_PLUGIN    15\r\n#define ID_BUTTON_START_SUMATRA       16\r\n#define ID_BUTTON_OPTIONS             17\r\n#define ID_BUTTON_BROWSE              18\r\n#define ID_CHECKBOX_PDF_FILTER        19\r\n#define ID_CHECKBOX_PDF_PREVIEWER     20\r\n\r\nstatic HWND             gHwndButtonOptions = nullptr;\r\n       HWND             gHwndButtonRunSumatra = nullptr;\r\nstatic HWND             gHwndStaticInstDir = nullptr;\r\nstatic HWND             gHwndTextboxInstDir = nullptr;\r\nstatic HWND             gHwndButtonBrowseDir = nullptr;\r\nstatic HWND             gHwndCheckboxRegisterDefault = nullptr;\r\nstatic HWND             gHwndCheckboxRegisterPdfFilter = nullptr;\r\nstatic HWND             gHwndCheckboxRegisterPdfPreviewer = nullptr;\r\nstatic HWND             gHwndCheckboxKeepBrowserPlugin = nullptr;\r\nstatic HWND             gHwndProgressBar = nullptr;\r\n\r\nstatic int GetInstallationStepCount()\r\n{\r\n    /* Installation steps\r\n     * - Create directory\r\n     * - One per file to be copied (count extracted from gPayloadData)\r\n     * - Optional registration (default viewer, browser plugin),\r\n     *   Shortcut and Registry keys\r\n     *\r\n     * Most time is taken by file extraction/copying, so we just add\r\n     * one step before - so that we start with some initial progress\r\n     * - and one step afterwards.\r\n     */\r\n    int count = 2;\r\n    for (int i = 0; nullptr != gPayloadData[i].fileName; i++) {\r\n        if (gPayloadData[i].install)\r\n            count++;\r\n    }\r\n    return count;\r\n}\r\n\r\nstatic inline void ProgressStep()\r\n{\r\n    if (gHwndProgressBar)\r\n        PostMessage(gHwndProgressBar, PBM_STEPIT, 0, 0);\r\n}\r\n\r\nstatic bool ExtractFiles(lzma::SimpleArchive *archive)\r\n{\r\n    lzma::FileInfo *fi;\r\n    char *uncompressed;\r\n\r\n    FileTransaction trans;\r\n    for (int i = 0; gPayloadData[i].fileName; i++) {\r\n        if (!gPayloadData[i].install)\r\n            continue;\r\n        int idx = lzma::GetIdxFromName(archive, gPayloadData[i].fileName);\r\n        if (-1 == idx) {\r\n            NotifyFailed(_TR(\"Some files to be installed are damaged or missing\"));\r\n            return false;\r\n        }\r\n\r\n        fi = &archive->files[idx];\r\n        uncompressed = lzma::GetFileDataByIdx(archive, idx, nullptr);\r\n        if (!uncompressed) {\r\n            NotifyFailed(_TR(\"The installer has been corrupted. Please download it again.\\nSorry for the inconvenience!\"));\r\n            return false;\r\n        }\r\n        ScopedMem<WCHAR> filePath(str::conv::FromUtf8(fi->name));\r\n        ScopedMem<WCHAR> extPath(path::Join(gGlobalData.installDir, filePath));\r\n        bool ok = trans.WriteAll(extPath, uncompressed, fi->uncompressedSize);\r\n        free(uncompressed);\r\n        if (!ok) {\r\n            ScopedMem<WCHAR> msg(str::Format(_TR(\"Couldn't write %s to disk\"), filePath));\r\n            NotifyFailed(msg);\r\n            return false;\r\n        }\r\n        trans.SetModificationTime(extPath, fi->ftModified);\r\n\r\n        ProgressStep();\r\n    }\r\n\r\n    return trans.Commit();\r\n}\r\n\r\n// TODO: also check if valid lzma::ParseSimpleArchive()\r\n// TODO: use it early in installer to show an error message\r\n#if 0\r\nstatic bool IsValidInstaller()\r\n{\r\n  HRSRC resSrc = FindResource(GetModuleHandle(nullptr), MAKEINTRESOURCE(1), RT_RCDATA);\r\n  return resSrc != nullptr;\r\n}\r\n#endif\r\n\r\nstatic bool InstallCopyFiles()\r\n{\r\n    bool ok;\r\n    HGLOBAL res = 0;\r\n    HRSRC resSrc = FindResource(GetModuleHandle(nullptr), MAKEINTRESOURCE(1), RT_RCDATA);\r\n    if (!resSrc)\r\n        goto Corrupted;\r\n    res = LoadResource(nullptr, resSrc);\r\n    if (!res)\r\n        goto Corrupted;\r\n\r\n    const char *data = (const char*)LockResource(res);\r\n    DWORD dataSize = SizeofResource(nullptr, resSrc);\r\n\r\n    lzma::SimpleArchive archive;\r\n    ok = lzma::ParseSimpleArchive(data, dataSize, &archive);\r\n    if (!ok)\r\n        goto Corrupted;\r\n\r\n    // on error, ExtractFiles() shows error message itself\r\n    ok = ExtractFiles(&archive);\r\nExit:\r\n    UnlockResource(res);\r\n    return ok;\r\nCorrupted:\r\n    NotifyFailed(_TR(\"The installer has been corrupted. Please download it again.\\nSorry for the inconvenience!\"));\r\n    ok = false;\r\n    goto Exit;\r\n}\r\n\r\n/* Caller needs to free() the result. */\r\nstatic WCHAR *GetDefaultPdfViewer()\r\n{\r\n    ScopedMem<WCHAR> buf(ReadRegStr(HKEY_CURRENT_USER, REG_EXPLORER_PDF_EXT L\"\\\\UserChoice\", PROG_ID));\r\n    if (buf)\r\n        return buf.StealData();\r\n    return ReadRegStr(HKEY_CLASSES_ROOT, L\".pdf\", nullptr);\r\n}\r\n\r\nstatic bool IsBrowserPluginInstalled()\r\n{\r\n    ScopedMem<WCHAR> dllPath(GetInstalledBrowserPluginPath());\r\n    return file::Exists(dllPath);\r\n}\r\n\r\nbool IsPdfFilterInstalled()\r\n{\r\n    ScopedMem<WCHAR> handler_iid(ReadRegStr(HKEY_CLASSES_ROOT, L\".pdf\\\\PersistentHandler\", nullptr));\r\n    if (!handler_iid)\r\n        return false;\r\n    return str::EqI(handler_iid, SZ_PDF_FILTER_HANDLER);\r\n}\r\n\r\nbool IsPdfPreviewerInstalled()\r\n{\r\n    ScopedMem<WCHAR> handler_iid(ReadRegStr(HKEY_CLASSES_ROOT, L\".pdf\\\\shellex\\\\{8895b1c6-b41f-4c1c-a562-0d564250836f}\", nullptr));\r\n    if (!handler_iid)\r\n        return false;\r\n    return str::EqI(handler_iid, SZ_PDF_PREVIEW_CLSID);\r\n}\r\n\r\n// Note: doesn't handle (total) sizes above 4GB\r\nstatic DWORD GetDirSize(const WCHAR *dir)\r\n{\r\n    ScopedMem<WCHAR> dirPattern(path::Join(dir, L\"*\"));\r\n    WIN32_FIND_DATA findData;\r\n\r\n    HANDLE h = FindFirstFile(dirPattern, &findData);\r\n    if (h == INVALID_HANDLE_VALUE)\r\n        return 0;\r\n\r\n    DWORD totalSize = 0;\r\n    do {\r\n        if (!(findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {\r\n            totalSize += findData.nFileSizeLow;\r\n        }\r\n        else if (!str::Eq(findData.cFileName, L\".\") && !str::Eq(findData.cFileName, L\"..\")) {\r\n            ScopedMem<WCHAR> subdir(path::Join(dir, findData.cFileName));\r\n            totalSize += GetDirSize(subdir);\r\n        }\r\n    } while (FindNextFile(h, &findData) != 0);\r\n    FindClose(h);\r\n\r\n    return totalSize;\r\n}\r\n\r\n// caller needs to free() the result\r\nstatic WCHAR *GetInstallDate()\r\n{\r\n    SYSTEMTIME st;\r\n    GetSystemTime(&st);\r\n    return str::Format(L\"%04d%02d%02d\", st.wYear, st.wMonth, st.wDay);\r\n}\r\n\r\nstatic bool WriteUninstallerRegistryInfo(HKEY hkey)\r\n{\r\n    bool ok = true;\r\n\r\n    ScopedMem<WCHAR> installedExePath(GetInstalledExePath());\r\n    ScopedMem<WCHAR> installDate(GetInstallDate());\r\n    ScopedMem<WCHAR> installDir(path::GetDir(installedExePath));\r\n    ScopedMem<WCHAR> uninstallCmdLine(str::Format(L\"\\\"%s\\\"\", ScopedMem<WCHAR>(GetUninstallerPath())));\r\n\r\n    // path to installed executable (or \"$path,0\" to force the first icon)\r\n    ok &= WriteRegStr(hkey,   REG_PATH_UNINST, L\"DisplayIcon\", installedExePath);\r\n    ok &= WriteRegStr(hkey,   REG_PATH_UNINST, L\"DisplayName\", APP_NAME_STR);\r\n    // version format: \"1.2\"\r\n    ok &= WriteRegStr(hkey,   REG_PATH_UNINST, L\"DisplayVersion\", CURR_VERSION_STR);\r\n    // Windows XP doesn't allow to view the version number at a glance,\r\n    // so include it in the DisplayName\r\n    if (!IsVistaOrGreater())\r\n        ok &= WriteRegStr(hkey, REG_PATH_UNINST, L\"DisplayName\", APP_NAME_STR L\" \" CURR_VERSION_STR);\r\n    DWORD size = GetDirSize(gGlobalData.installDir) / 1024;\r\n    // size of installed directory after copying files\r\n    ok &= WriteRegDWORD(hkey, REG_PATH_UNINST, L\"EstimatedSize\", size);\r\n    // current date as YYYYMMDD\r\n    ok &= WriteRegStr(hkey,   REG_PATH_UNINST, L\"InstallDate\", installDate);\r\n    ok &= WriteRegStr(hkey,   REG_PATH_UNINST, L\"InstallLocation\", installDir);\r\n    ok &= WriteRegDWORD(hkey, REG_PATH_UNINST, L\"NoModify\", 1);\r\n    ok &= WriteRegDWORD(hkey, REG_PATH_UNINST, L\"NoRepair\", 1);\r\n    ok &= WriteRegStr(hkey,   REG_PATH_UNINST, L\"Publisher\", TEXT(PUBLISHER_STR));\r\n    // command line for uninstaller\r\n    ok &= WriteRegStr(hkey,   REG_PATH_UNINST, L\"UninstallString\", uninstallCmdLine);\r\n    ok &= WriteRegStr(hkey,   REG_PATH_UNINST, L\"URLInfoAbout\", L\"http://www.sumatrapdfreader.org/\");\r\n    ok &= WriteRegStr(hkey,   REG_PATH_UNINST, L\"URLUpdateInfo\", L\"http://www.sumatrapdfreader.org/news.html\");\r\n\r\n    return ok;\r\n}\r\n\r\n// https://msdn.microsoft.com/en-us/library/windows/desktop/cc144154(v=vs.85).aspx\r\n// http://www.tenforums.com/software-apps/23509-how-add-my-own-program-list-default-programs.html#post407794\r\nstatic bool ListAsDefaultProgramWin10()\r\n{\r\n    HKEY hkey = HKEY_LOCAL_MACHINE;\r\n    bool ok = true;\r\n\r\n    ok &= WriteRegStr(hkey, L\"SOFTWARE\\\\RegisteredApplications\", L\"SumatraPDF\", L\"SOFTWARE\\\\SumatraPDF\\\\Capabilities\");\r\n    ok &= WriteRegStr(hkey, L\"SOFTWARE\\\\SumatraPDF\\\\Capabilities\", L\"ApplicationDescription\", L\"SumatraPDF is a PDF reader.\");\r\n    ok &= WriteRegStr(hkey, L\"SOFTWARE\\\\SumatraPDF\\\\Capabilities\", L\"ApplicationName\", L\"SumatraPDF Reader\");\r\n\r\n    for (int i = 0; nullptr != gSupportedExts[i]; i++) {\r\n        WCHAR *ext = gSupportedExts[i];\r\n        ok &= WriteRegStr(hkey, L\"SOFTWARE\\\\SumatraPDF\\\\Capabilities\\\\FileAssociations\", ext, L\"SumatraPDF.exe\");\r\n    }\r\n    return ok;\r\n}\r\n\r\nstatic bool ListAsDefaultProgramPreWin10(HKEY hkey)\r\n{\r\n    // add the installed SumatraPDF.exe to the Open With lists of the supported file extensions\r\n    // TODO: per http://msdn.microsoft.com/en-us/library/cc144148(v=vs.85).aspx we shouldn't be\r\n    // using OpenWithList but OpenWithProgIds. Also, it doesn't seem to work on my win7 32bit\r\n    // (HKLM\\Software\\Classes\\.mobi\\OpenWithList\\SumatraPDF.exe key is present but \"Open With\"\r\n    // menu item doesn't even exist for .mobi files\r\n    // It's not so easy, though, because if we just set it to SumatraPDF,\r\n    // all gSupportedExts will be reported as \"PDF Document\" by Explorer, so this needs\r\n    // to be more intelligent. We should probably mimic Windows Media Player scheme i.e.\r\n    // set OpenWithProgIds to SumatraPDF.AssocFile.Mobi etc. and create apropriate\r\n    // \\SOFTWARE\\Classes\\CLSID\\{GUID}\\ProgID etc. entries\r\n    // Also, if Sumatra is the only program handling those docs, our\r\n    // PDF icon will be shown (we need icons and properly configure them)\r\n    bool ok = true;\r\n    for (int i = 0; nullptr != gSupportedExts[i]; i++) {\r\n        ScopedMem<WCHAR> keyname(str::Join(L\"Software\\\\Classes\\\\\", gSupportedExts[i], L\"\\\\OpenWithList\\\\\" EXENAME));\r\n        ok &= CreateRegKey(hkey, keyname);\r\n    }\r\n    return ok;\r\n}\r\n\r\n// cf. http://msdn.microsoft.com/en-us/library/cc144148(v=vs.85).aspx\r\nstatic bool WriteExtendedFileExtensionInfo(HKEY hkey)\r\n{\r\n    bool ok = true;\r\n\r\n    ScopedMem<WCHAR> exePath(GetInstalledExePath());\r\n    if (HKEY_LOCAL_MACHINE == hkey)\r\n        ok &= WriteRegStr(hkey, L\"Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\App Paths\\\\\" EXENAME, nullptr, exePath);\r\n\r\n    // mirroring some of what DoAssociateExeWithPdfExtension() does (cf. AppTools.cpp)\r\n    ScopedMem<WCHAR> iconPath(str::Join(exePath, L\",1\"));\r\n    ok &= WriteRegStr(hkey, REG_CLASSES_APPS L\"\\\\DefaultIcon\", nullptr, iconPath);\r\n    ScopedMem<WCHAR> cmdPath(str::Format(L\"\\\"%s\\\" \\\"%%1\\\" %%*\", exePath));\r\n    ok &= WriteRegStr(hkey, REG_CLASSES_APPS L\"\\\\Shell\\\\Open\\\\Command\", nullptr, cmdPath);\r\n    ScopedMem<WCHAR> printPath(str::Format(L\"\\\"%s\\\" -print-to-default \\\"%%1\\\"\", exePath));\r\n    ok &= WriteRegStr(hkey, REG_CLASSES_APPS L\"\\\\Shell\\\\Print\\\\Command\", nullptr, printPath);\r\n    ScopedMem<WCHAR> printToPath(str::Format(L\"\\\"%s\\\" -print-to \\\"%%2\\\" \\\"%%1\\\"\", exePath));\r\n    ok &= WriteRegStr(hkey, REG_CLASSES_APPS L\"\\\\Shell\\\\PrintTo\\\\Command\", nullptr, printToPath);\r\n\r\n    // don't add REG_CLASSES_APPS L\"\\\\SupportedTypes\", as that prevents SumatraPDF.exe to\r\n    // potentially appear in the Open With lists for other filetypes (such as single images)\r\n    ok &= ListAsDefaultProgramPreWin10(hkey);\r\n\r\n    // in case these values don't exist yet (we won't delete these at uninstallation)\r\n    ok &= WriteRegStr(hkey, REG_CLASSES_PDF, L\"Content Type\", L\"application/pdf\");\r\n    ok &= WriteRegStr(hkey, L\"Software\\\\Classes\\\\MIME\\\\Database\\\\Content Type\\\\application/pdf\", L\"Extension\", L\".pdf\");\r\n\r\n    return ok;\r\n}\r\n\r\nstatic bool CreateInstallationDirectory()\r\n{\r\n    bool ok = dir::CreateAll(gGlobalData.installDir);\r\n    if (!ok) {\r\n        LogLastError();\r\n        NotifyFailed(_TR(\"Couldn't create the installation directory\"));\r\n    }\r\n    return ok;\r\n}\r\n\r\nstatic void CreateButtonRunSumatra(HWND hwndParent)\r\n{\r\n    gHwndButtonRunSumatra = CreateDefaultButton(hwndParent, _TR(\"Start SumatraPDF\"), ID_BUTTON_START_SUMATRA);\r\n}\r\n\r\nstatic bool CreateAppShortcut(bool allUsers)\r\n{\r\n    ScopedMem<WCHAR> shortcutPath(GetShortcutPath(allUsers));\r\n    if (!shortcutPath.Get())\r\n        return false;\r\n    ScopedMem<WCHAR> installedExePath(GetInstalledExePath());\r\n    return CreateShortcut(shortcutPath, installedExePath);\r\n}\r\n\r\nDWORD WINAPI InstallerThread(LPVOID data)\r\n{\r\n    UNUSED(data);\r\n    gGlobalData.success = false;\r\n\r\n    if (!CreateInstallationDirectory())\r\n        goto Error;\r\n    ProgressStep();\r\n\r\n    if (!InstallCopyFiles())\r\n        goto Error;\r\n    // all files have been extracted at this point\r\n    if (gGlobalData.justExtractFiles)\r\n        return 0;\r\n\r\n    if (gGlobalData.registerAsDefault) {\r\n        // need to sublaunch SumatraPDF.exe instead of replicating the code\r\n        // because registration uses translated strings\r\n        ScopedMem<WCHAR> installedExePath(GetInstalledExePath());\r\n        CreateProcessHelper(installedExePath, L\"-register-for-pdf\");\r\n    }\r\n\r\n    if (gGlobalData.installPdfFilter)\r\n        InstallPdfFilter();\r\n    else if (IsPdfFilterInstalled())\r\n        UninstallPdfFilter();\r\n\r\n    if (gGlobalData.installPdfPreviewer)\r\n        InstallPdfPreviewer();\r\n    else if (IsPdfPreviewerInstalled())\r\n        UninstallPdfPreviewer();\r\n\r\n    if (!gGlobalData.keepBrowserPlugin)\r\n        UninstallBrowserPlugin();\r\n\r\n    if (!CreateAppShortcut(true) && !CreateAppShortcut(false)) {\r\n        NotifyFailed(_TR(\"Failed to create a shortcut\"));\r\n        goto Error;\r\n    }\r\n\r\n    // consider installation a success from here on\r\n    // (still warn, if we've failed to create the uninstaller, though)\r\n    gGlobalData.success = true;\r\n\r\n    if (!WriteUninstallerRegistryInfo(HKEY_LOCAL_MACHINE) &&\r\n        !WriteUninstallerRegistryInfo(HKEY_CURRENT_USER)) {\r\n        NotifyFailed(_TR(\"Failed to write the uninstallation information to the registry\"));\r\n    }\r\n    if (!WriteExtendedFileExtensionInfo(HKEY_LOCAL_MACHINE) &&\r\n        !WriteExtendedFileExtensionInfo(HKEY_CURRENT_USER)) {\r\n        NotifyFailed(_TR(\"Failed to write the extended file extension information to the registry\"));\r\n    }\r\n\r\n    if (!ListAsDefaultProgramWin10()) {\r\n        NotifyFailed(_TR(\"Failed to register as default program on win 10\"));        \r\n    }\r\n\r\n    ProgressStep();\r\n\r\nError:\r\n    // TODO: roll back installation on failure (restore previous installation!)\r\n    if (gHwndFrame && !gGlobalData.silent) {\r\n        Sleep(500); // allow a glimpse of the completed progress bar before hiding it\r\n        PostMessage(gHwndFrame, WM_APP_INSTALLATION_FINISHED, 0, 0);\r\n    }\r\n    return 0;\r\n}\r\n\r\nstatic void OnButtonOptions();\r\n\r\nstatic bool IsCheckboxChecked(HWND hwnd)\r\n{\r\n    return (Button_GetState(hwnd) & BST_CHECKED) == BST_CHECKED;\r\n}\r\n\r\nstatic void OnButtonInstall()\r\n{\r\n    CrashAlwaysIf(gForceCrash);\r\n\r\n    if (gShowOptions)\r\n        OnButtonOptions();\r\n\r\n    KillSumatra();\r\n\r\n    if (!CheckInstallUninstallPossible())\r\n        return;\r\n\r\n    WCHAR *userInstallDir = win::GetText(gHwndTextboxInstDir);\r\n    if (!str::IsEmpty(userInstallDir))\r\n        str::ReplacePtr(&gGlobalData.installDir, userInstallDir);\r\n    free(userInstallDir);\r\n\r\n    // note: this checkbox isn't created if we're already registered as default\r\n    //       (in which case we're just going to re-register)\r\n    gGlobalData.registerAsDefault = gHwndCheckboxRegisterDefault == nullptr ||\r\n                                    IsCheckboxChecked(gHwndCheckboxRegisterDefault);\r\n\r\n    // note: this checkbox isn't created when running inside Wow64\r\n    gGlobalData.installPdfFilter = gHwndCheckboxRegisterPdfFilter != nullptr &&\r\n                                   IsCheckboxChecked(gHwndCheckboxRegisterPdfFilter);\r\n    // note: this checkbox isn't created on Windows 2000 and XP\r\n    gGlobalData.installPdfPreviewer = gHwndCheckboxRegisterPdfPreviewer != nullptr &&\r\n                                      IsCheckboxChecked(gHwndCheckboxRegisterPdfPreviewer);\r\n    // note: this checkbox isn't created if the browser plugin hasn't been installed before\r\n    gGlobalData.keepBrowserPlugin = gHwndCheckboxKeepBrowserPlugin != nullptr &&\r\n                                    IsCheckboxChecked(gHwndCheckboxKeepBrowserPlugin);\r\n\r\n    // create a progress bar in place of the Options button\r\n    RectI rc(0, 0, dpiAdjust(INSTALLER_WIN_DX / 2), gButtonDy);\r\n    rc = MapRectToWindow(rc, gHwndButtonOptions, gHwndFrame);\r\n    gHwndProgressBar = CreateWindow(PROGRESS_CLASS, nullptr, WS_CHILD | WS_VISIBLE,\r\n                                    rc.x, rc.y, rc.dx, rc.dy,\r\n                                    gHwndFrame, 0, GetModuleHandle(nullptr), nullptr);\r\n    SendMessage(gHwndProgressBar, PBM_SETRANGE32, 0, GetInstallationStepCount());\r\n    SendMessage(gHwndProgressBar, PBM_SETSTEP, 1, 0);\r\n\r\n    // disable the install button and remove all the installation options\r\n    SafeDestroyWindow(&gHwndStaticInstDir);\r\n    SafeDestroyWindow(&gHwndTextboxInstDir);\r\n    SafeDestroyWindow(&gHwndButtonBrowseDir);\r\n    SafeDestroyWindow(&gHwndCheckboxRegisterDefault);\r\n    SafeDestroyWindow(&gHwndCheckboxRegisterPdfFilter);\r\n    SafeDestroyWindow(&gHwndCheckboxRegisterPdfPreviewer);\r\n    SafeDestroyWindow(&gHwndCheckboxKeepBrowserPlugin);\r\n    SafeDestroyWindow(&gHwndButtonOptions);\r\n\r\n    EnableWindow(gHwndButtonInstUninst, FALSE);\r\n\r\n    SetMsg(_TR(\"Installation in progress...\"), COLOR_MSG_INSTALLATION);\r\n    InvalidateFrame();\r\n\r\n    gGlobalData.hThread = CreateThread(nullptr, 0, InstallerThread, nullptr, 0, 0);\r\n}\r\n\r\nvoid OnInstallationFinished()\r\n{\r\n    SafeDestroyWindow(&gHwndButtonInstUninst);\r\n    SafeDestroyWindow(&gHwndProgressBar);\r\n\r\n    if (gGlobalData.success) {\r\n        CreateButtonRunSumatra(gHwndFrame);\r\n        SetMsg(_TR(\"Thank you! SumatraPDF has been installed.\"), COLOR_MSG_OK);\r\n    } else {\r\n        CreateButtonExit(gHwndFrame);\r\n        SetMsg(_TR(\"Installation failed!\"), COLOR_MSG_FAILED);\r\n    }\r\n    gMsgError = gGlobalData.firstError;\r\n    InvalidateFrame();\r\n\r\n    CloseHandle(gGlobalData.hThread);\r\n\r\n    if (gGlobalData.autoUpdate && gGlobalData.success) {\r\n        // click the Start button\r\n        PostMessage(gHwndFrame, WM_COMMAND, IDOK, 0);\r\n    }\r\n}\r\n\r\nstatic void OnButtonStartSumatra()\r\n{\r\n    ScopedMem<WCHAR> exePath(GetInstalledExePath());\r\n    RunNonElevated(exePath);\r\n    OnButtonExit();\r\n}\r\n\r\ninline void EnableAndShow(HWND hwnd, bool enable)\r\n{\r\n    if (!hwnd)\r\n        return;\r\n    win::SetVisibility(hwnd, enable);\r\n    EnableWindow(hwnd, enable);\r\n}\r\n\r\nstatic void OnButtonOptions()\r\n{\r\n    gShowOptions = !gShowOptions;\r\n\r\n    EnableAndShow(gHwndStaticInstDir, gShowOptions);\r\n    EnableAndShow(gHwndTextboxInstDir, gShowOptions);\r\n    EnableAndShow(gHwndButtonBrowseDir, gShowOptions);\r\n    EnableAndShow(gHwndCheckboxRegisterDefault, gShowOptions);\r\n    EnableAndShow(gHwndCheckboxRegisterPdfFilter, gShowOptions);\r\n    EnableAndShow(gHwndCheckboxRegisterPdfPreviewer, gShowOptions);\r\n    EnableAndShow(gHwndCheckboxKeepBrowserPlugin, gShowOptions);\r\n\r\n//[ ACCESSKEY_GROUP Installer\r\n//[ ACCESSKEY_ALTERNATIVE // ideally, the same accesskey is used for both\r\n    if (gShowOptions)\r\n        SetButtonTextAndResize(gHwndButtonOptions, _TR(\"Hide &Options\"));\r\n//| ACCESSKEY_ALTERNATIVE\r\n    else\r\n        SetButtonTextAndResize(gHwndButtonOptions, _TR(\"&Options\"));\r\n//] ACCESSKEY_ALTERNATIVE\r\n//] ACCESSKEY_GROUP Installer\r\n\r\n    ClientRect rc(gHwndFrame);\r\n    RECT rcTmp = rc.ToRECT();\r\n    InvalidateRect(gHwndFrame, &rcTmp, TRUE);\r\n\r\n    SetFocus(gHwndButtonOptions);\r\n}\r\n\r\nstatic int CALLBACK BrowseCallbackProc(HWND hwnd, UINT msg, LPARAM lParam, LPARAM lpData)\r\n{\r\n    switch (msg) {\r\n    case BFFM_INITIALIZED:\r\n        if (!str::IsEmpty((WCHAR *)lpData))\r\n            SendMessage(hwnd, BFFM_SETSELECTION, TRUE, lpData);\r\n        break;\r\n\r\n    // disable the OK button for non-filesystem and inaccessible folders (and shortcuts to folders)\r\n    case BFFM_SELCHANGED:\r\n        {\r\n            WCHAR path[MAX_PATH];\r\n            if (SHGetPathFromIDList((LPITEMIDLIST)lParam, path) && dir::Exists(path)) {\r\n                SHFILEINFO sfi = { 0 };\r\n                SHGetFileInfo((LPCWSTR)lParam, 0, &sfi, sizeof(sfi), SHGFI_PIDL | SHGFI_ATTRIBUTES);\r\n                if (!(sfi.dwAttributes & SFGAO_LINK))\r\n                    break;\r\n            }\r\n            EnableWindow(GetDlgItem(hwnd, IDOK), FALSE);\r\n        }\r\n        break;\r\n    }\r\n\r\n    return 0;\r\n}\r\n\r\nstatic BOOL BrowseForFolder(HWND hwnd, const WCHAR *lpszInitialFolder, const WCHAR *lpszCaption, WCHAR *lpszBuf, DWORD dwBufSize)\r\n{\r\n    if (lpszBuf == nullptr || dwBufSize < MAX_PATH)\r\n        return FALSE;\r\n\r\n    BROWSEINFO bi = { 0 };\r\n    bi.hwndOwner = hwnd;\r\n    bi.ulFlags   = BIF_RETURNONLYFSDIRS | BIF_NEWDIALOGSTYLE;\r\n    bi.lpszTitle = lpszCaption;\r\n    bi.lpfn      = BrowseCallbackProc;\r\n    bi.lParam    = (LPARAM)lpszInitialFolder;\r\n\r\n    BOOL ok = FALSE;\r\n    LPITEMIDLIST pidlFolder = SHBrowseForFolder(&bi);\r\n    if (pidlFolder) {\r\n        ok = SHGetPathFromIDList(pidlFolder, lpszBuf);\r\n\r\n        IMalloc *pMalloc = nullptr;\r\n        if (SUCCEEDED(SHGetMalloc(&pMalloc)) && pMalloc) {\r\n            pMalloc->Free(pidlFolder);\r\n            pMalloc->Release();\r\n        }\r\n    }\r\n\r\n    return ok;\r\n}\r\n\r\nstatic void OnButtonBrowse()\r\n{\r\n    ScopedMem<WCHAR> installDir(win::GetText(gHwndTextboxInstDir));\r\n    // strip a trailing \"\\SumatraPDF\" if that directory doesn't exist (yet)\r\n    if (!dir::Exists(installDir))\r\n        installDir.Set(path::GetDir(installDir));\r\n\r\n    WCHAR path[MAX_PATH];\r\n    BOOL ok = BrowseForFolder(gHwndFrame, installDir, _TR(\"Select the folder where SumatraPDF should be installed:\"), path, dimof(path));\r\n    if (!ok) {\r\n        SetFocus(gHwndButtonBrowseDir);\r\n        return;\r\n    }\r\n\r\n    WCHAR *installPath = path;\r\n    // force paths that aren't entered manually to end in ...\\SumatraPDF\r\n    // to prevent unintended installations into e.g. %ProgramFiles% itself\r\n    if (!str::EndsWithI(path, L\"\\\\\" APP_NAME_STR))\r\n        installPath = path::Join(path, APP_NAME_STR);\r\n    win::SetText(gHwndTextboxInstDir, installPath);\r\n    Edit_SetSel(gHwndTextboxInstDir, 0, -1);\r\n    SetFocus(gHwndTextboxInstDir);\r\n    if (installPath != path)\r\n        free(installPath);\r\n}\r\n\r\nbool OnWmCommand(WPARAM wParam)\r\n{\r\n    switch (LOWORD(wParam))\r\n    {\r\n        case IDOK:\r\n            if (gHwndButtonInstUninst)\r\n                OnButtonInstall();\r\n            else if (gHwndButtonRunSumatra)\r\n                OnButtonStartSumatra();\r\n            else if (gHwndButtonExit)\r\n                OnButtonExit();\r\n            break;\r\n\r\n        case ID_BUTTON_START_SUMATRA:\r\n            OnButtonStartSumatra();\r\n            break;\r\n\r\n        case ID_BUTTON_OPTIONS:\r\n            OnButtonOptions();\r\n            break;\r\n\r\n        case ID_BUTTON_BROWSE:\r\n            OnButtonBrowse();\r\n            break;\r\n\r\n        case ID_BUTTON_EXIT:\r\n        case IDCANCEL:\r\n            OnButtonExit();\r\n            break;\r\n\r\n        default:\r\n            return false;\r\n    }\r\n    return true;\r\n}\r\n\r\n//[ ACCESSKEY_GROUP Installer\r\nvoid OnCreateWindow(HWND hwnd)\r\n{\r\n    ClientRect r(hwnd);\r\n    gHwndButtonInstUninst = CreateDefaultButton(hwnd, _TR(\"Install SumatraPDF\"), IDOK);\r\n\r\n    SIZE btnSize;\r\n    gHwndButtonOptions = CreateButton(hwnd, _TR(\"&Options\"), ID_BUTTON_OPTIONS, BS_PUSHBUTTON, btnSize);\r\n    int x = WINDOW_MARGIN;\r\n    int y = r.dy - btnSize.cy - WINDOW_MARGIN;\r\n    SetWindowPos(gHwndButtonOptions, nullptr, x, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_SHOWWINDOW);\r\n\r\n    gButtonDy = btnSize.cy;\r\n    gBottomPartDy = gButtonDy + (WINDOW_MARGIN * 2);\r\n\r\n    SizeI size = TextSizeInHwnd(hwnd, L\"Foo\");\r\n    int staticDy = size.dy + dpiAdjust(4);\r\n\r\n    y = r.dy - gBottomPartDy;\r\n    int dx = r.dx - (WINDOW_MARGIN * 2) - dpiAdjust(2);\r\n\r\n    x += dpiAdjust(2);\r\n\r\n    // build options controls going from the bottom\r\n    y -= (staticDy + WINDOW_MARGIN);\r\n\r\n    ScopedMem<WCHAR> defaultViewer(GetDefaultPdfViewer());\r\n    BOOL hasOtherViewer = !str::EqI(defaultViewer, APP_NAME_STR);\r\n    BOOL isSumatraDefaultViewer = defaultViewer && !hasOtherViewer;\r\n\r\n    // only show this checkbox if the browser plugin has been installed before\r\n    if (IsBrowserPluginInstalled()) {\r\n        gHwndCheckboxKeepBrowserPlugin = CreateWindowExW(\r\n            0, WC_BUTTON, _TR(\"Keep the PDF &browser plugin installed (no longer supported)\"),\r\n            WS_CHILD | BS_AUTOCHECKBOX | WS_TABSTOP,\r\n            x, y, dx, staticDy,\r\n            hwnd, (HMENU) ID_CHECKBOX_BROWSER_PLUGIN, GetModuleHandle(nullptr), nullptr);\r\n        SetWindowFont(gHwndCheckboxKeepBrowserPlugin, gFontDefault, TRUE);\r\n        Button_SetCheck(gHwndCheckboxKeepBrowserPlugin, gGlobalData.keepBrowserPlugin);\r\n        y -= staticDy;\r\n    }\r\n\r\n    // only show this checkbox if the CPU arch of DLL and OS match\r\n    // (assuming that the installer has the same CPU arch as its content!)\r\n    if (IsProcessAndOsArchSame()) {\r\n        // for Windows XP, this means only basic thumbnail support\r\n        gHwndCheckboxRegisterPdfPreviewer = CreateWindowExW(\r\n            0, WC_BUTTON, _TR(\"Let Windows show &previews of PDF documents\"),\r\n            WS_CHILD | BS_AUTOCHECKBOX | WS_TABSTOP,\r\n            x, y, dx, staticDy,\r\n            hwnd, (HMENU) ID_CHECKBOX_PDF_PREVIEWER, GetModuleHandle(nullptr), nullptr);\r\n        SetWindowFont(gHwndCheckboxRegisterPdfPreviewer, gFontDefault, TRUE);\r\n        Button_SetCheck(gHwndCheckboxRegisterPdfPreviewer, gGlobalData.installPdfPreviewer || IsPdfPreviewerInstalled());\r\n        y -= staticDy;\r\n\r\n        gHwndCheckboxRegisterPdfFilter = CreateWindowEx(\r\n            0, WC_BUTTON, _TR(\"Let Windows Desktop Search &search PDF documents\"),\r\n            WS_CHILD | BS_AUTOCHECKBOX | WS_TABSTOP,\r\n            x, y, dx, staticDy,\r\n            hwnd, (HMENU) ID_CHECKBOX_PDF_FILTER, GetModuleHandle(nullptr), nullptr);\r\n        SetWindowFont(gHwndCheckboxRegisterPdfFilter, gFontDefault, TRUE);\r\n        Button_SetCheck(gHwndCheckboxRegisterPdfFilter, gGlobalData.installPdfFilter || IsPdfFilterInstalled());\r\n        y -= staticDy;\r\n    }\r\n\r\n    // only show the checbox if Sumatra is not already a default viewer.\r\n    // the alternative (disabling the checkbox) is more confusing\r\n    if (!isSumatraDefaultViewer) {\r\n        gHwndCheckboxRegisterDefault = CreateWindowExW(\r\n            0, WC_BUTTON, _TR(\"Use SumatraPDF as the &default PDF reader\"),\r\n            WS_CHILD | BS_AUTOCHECKBOX | WS_TABSTOP,\r\n            x, y, dx, staticDy,\r\n            hwnd, (HMENU) ID_CHECKBOX_MAKE_DEFAULT, GetModuleHandle(nullptr), nullptr);\r\n        SetWindowFont(gHwndCheckboxRegisterDefault, gFontDefault, TRUE);\r\n        // only check the \"Use as default\" checkbox when no other PDF viewer\r\n        // is currently selected (not going to intrude)\r\n        Button_SetCheck(gHwndCheckboxRegisterDefault, !hasOtherViewer || gGlobalData.registerAsDefault);\r\n        y -= staticDy;\r\n    }\r\n    // a bit more space between text box and checkboxes\r\n    y -= (dpiAdjust(4) + WINDOW_MARGIN);\r\n\r\n    const WCHAR *s = L\"&...\";\r\n    SizeI btnSize2 = TextSizeInHwnd(hwnd, s);\r\n    btnSize.cx += dpiAdjust(4);\r\n    gHwndButtonBrowseDir = CreateButton(hwnd, s, ID_BUTTON_BROWSE, BS_PUSHBUTTON, btnSize);\r\n    x = r.dx - WINDOW_MARGIN - btnSize2.dx;\r\n    SetWindowPos(gHwndButtonBrowseDir, nullptr, x, y, btnSize2.dx, staticDy, SWP_NOZORDER | SWP_NOACTIVATE | SWP_SHOWWINDOW | SWP_FRAMECHANGED);\r\n\r\n    x = WINDOW_MARGIN;\r\n    dx = r.dx - (2 * WINDOW_MARGIN) - btnSize2.dx - dpiAdjust(4);\r\n    gHwndTextboxInstDir = CreateWindowExW(0, WC_EDIT, gGlobalData.installDir,\r\n        WS_CHILD | WS_TABSTOP | WS_BORDER | ES_LEFT | ES_AUTOHSCROLL,\r\n        x, y, dx, staticDy,\r\n        hwnd, nullptr, GetModuleHandle(nullptr), nullptr);\r\n    SetWindowFont(gHwndTextboxInstDir, gFontDefault, TRUE);\r\n\r\n    y -= staticDy;\r\n\r\n    gHwndStaticInstDir = CreateWindowExW(\r\n        0, WC_STATIC, _TR(\"Install SumatraPDF in &folder:\"),WS_CHILD,\r\n        x, y, r.dx, staticDy,\r\n        hwnd, nullptr, GetModuleHandle(nullptr), nullptr);\r\n    SetWindowFont(gHwndStaticInstDir, gFontDefault, TRUE);\r\n\r\n    gShowOptions = !gShowOptions;\r\n    OnButtonOptions();\r\n\r\n    SetFocus(gHwndButtonInstUninst);\r\n\r\n    if (gGlobalData.autoUpdate) {\r\n        // click the Install button\r\n        PostMessage(hwnd, WM_COMMAND, IDOK, 0);\r\n    }\r\n}\r\n//] ACCESSKEY_GROUP Installer\r\n\r\nvoid CreateMainWindow()\r\n{\r\n    ScopedMem<WCHAR> title(str::Format(_TR(\"SumatraPDF %s Installer\"), CURR_VERSION_STR));\r\n\r\n    gHwndFrame = CreateWindowEx(\r\n        trans::IsCurrLangRtl() ? WS_EX_LAYOUTRTL : 0,\r\n        INSTALLER_FRAME_CLASS_NAME, title.Get(),\r\n        WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU,\r\n        CW_USEDEFAULT, CW_USEDEFAULT,\r\n        dpiAdjust(INSTALLER_WIN_DX), dpiAdjust(INSTALLER_WIN_DY),\r\n        nullptr, nullptr,\r\n        GetModuleHandle(nullptr), nullptr);\r\n}\r\n\r\nvoid ShowUsage()\r\n{\r\n    // Note: translation services aren't initialized at this point, so English only\r\n    MessageBox(nullptr, APP_NAME_STR L\"-install.exe [/s][/d <path>][/register][/opt pdffilter,...][/x][/autoupdate]\\n\\\r\n    \\n\\\r\n    /s\\tinstalls \" APP_NAME_STR L\" silently (without user interaction).\\n\\\r\n    /d\\tchanges the directory where \" APP_NAME_STR L\" will be installed.\\n\\\r\n    /register\\tregisters \" APP_NAME_STR L\" as the default PDF viewer.\\n\\\r\n    /opt\\tenables optional components (currently: pdffilter, pdfpreviewer, plugin).\\n\\\r\n    /x\\tjust extracts the files contained within the installer.\\n\\\r\n    /autoupdate\\tperforms an update with visible UI and minimal user interaction.\", APP_NAME_STR L\" Installer Usage\", MB_OK);\r\n}\r\n"
  },
  {
    "path": "src/installer/Installer.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n/*\r\nThe installer is good enough for production but it doesn't mean it couldn't be improved:\r\n * some more fanciful animations e.g.:\r\n * letters could drop down and back up when cursor is over it\r\n * messages could scroll-in\r\n * some background thing could be going on, e.g. a spinning 3d cube\r\n * show fireworks on successful installation/uninstallation\r\n*/\r\n\r\n// define to allow testing crash handling via -crash cmd-line option\r\n#define ENABLE_CRASH_TESTING\r\n\r\n// define for testing the uninstaller\r\n// #define TEST_UNINSTALLER\r\n#if defined(TEST_UNINSTALLER) && !defined(BUILD_UNINSTALLER)\r\n#define BUILD_UNINSTALLER\r\n#endif\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"WinDynCalls.h\"\r\n#include <tlhelp32.h>\r\n#include <io.h>\r\n#include \"FileUtil.h\"\r\n#include \"FileTransactions.h\"\r\n#include \"Translations.h\"\r\n#include \"Resource.h\"\r\n#include \"Timer.h\"\r\n#include \"Version.h\"\r\n#include \"WinUtil.h\"\r\n#include \"Installer.h\"\r\n#include \"CmdLineParser.h\"\r\n#include \"CrashHandler.h\"\r\n#include \"Dpi.h\"\r\n#include \"FrameTimeoutCalculator.h\"\r\n#include \"DebugLog.h\"\r\n\r\n// TODO: can't build these separately without breaking TEST_UNINSTALLER\r\n#ifdef BUILD_UNINSTALLER\r\n#include \"Uninstall.cpp\"\r\n#else\r\n#include \"ByteOrderDecoder.h\"\r\n#include \"LzmaSimpleArchive.h\"\r\n\r\n#include \"../ifilter/PdfFilter.h\"\r\n#include \"../previewer/PdfPreview.h\"\r\n#include \"Install.cpp\"\r\n#endif\r\n\r\nusing namespace Gdiplus;\r\n\r\n// define to 1 to enable shadow effect, to 0 to disable\r\n#define DRAW_TEXT_SHADOW 1\r\n#define DRAW_MSG_TEXT_SHADOW 0\r\n\r\nHWND            gHwndFrame = nullptr;\r\nHWND            gHwndButtonExit = nullptr;\r\nHWND            gHwndButtonInstUninst = nullptr;\r\nHFONT           gFontDefault;\r\nbool            gShowOptions = false;\r\nbool            gForceCrash = false;\r\nWCHAR *         gMsgError = nullptr;\r\nint             gBottomPartDy = 0;\r\nint             gButtonDy = 0;\r\n\r\nstatic WStrVec          gProcessesToClose;\r\nstatic float            gUiDPIFactor = 1.0f;\r\n\r\nstatic ScopedMem<WCHAR> gMsg;\r\nstatic Color            gMsgColor;\r\n\r\nColor gCol1(196, 64, 50); Color gCol1Shadow(134, 48, 39);\r\nColor gCol2(227, 107, 35); Color gCol2Shadow(155, 77, 31);\r\nColor gCol3(93,  160, 40); Color gCol3Shadow(51, 87, 39);\r\nColor gCol4(69, 132, 190); Color gCol4Shadow(47, 89, 127);\r\nColor gCol5(112, 115, 207); Color gCol5Shadow(66, 71, 118);\r\n\r\nColor            COLOR_MSG_WELCOME(gCol5);\r\nColor            COLOR_MSG_OK(gCol5);\r\nColor            COLOR_MSG_INSTALLATION(gCol5);\r\nColor            COLOR_MSG_FAILED(gCol1);\r\n\r\n// list of supported file extensions for which SumatraPDF.exe will\r\n// be registered as a candidate for the Open With dialog's suggestions\r\nWCHAR *gSupportedExts[] = {\r\n    L\".pdf\", L\".xps\", L\".oxps\",\r\n    L\".cbz\", L\".cbr\", L\".cb7\", L\".cbt\",\r\n    L\".djvu\", L\".chm\",\r\n    L\".mobi\", L\".epub\", L\".fb2\", L\".fb2z\",\r\n    nullptr\r\n};\r\n\r\n// The following list is used to verify that all the required files have been\r\n// installed (install flag set) and to know what files are to be removed at\r\n// uninstallation (all listed files that actually exist).\r\n// When a file is no longer shipped, just disable the install flag so that the\r\n// file is still correctly removed when SumatraPDF is eventually uninstalled.\r\nPayloadInfo gPayloadData[] = {\r\n    { \"libmupdf.dll\",           true    },\r\n    { \"SumatraPDF.exe\",         true    },\r\n    { \"sumatrapdfprefs.dat\",    false   },\r\n    { \"DroidSansFallback.ttf\",  true    },\r\n    { \"npPdfViewer.dll\",        false   },\r\n    { \"PdfFilter.dll\",          true    },\r\n    { \"PdfPreview.dll\",         true    },\r\n    { \"uninstall.exe\",          true    },\r\n    { nullptr,                     false   },\r\n};\r\n\r\nGlobalData gGlobalData = {\r\n    false, /* bool silent */\r\n    false, /* bool showUsageAndQuit */\r\n    nullptr,  /* WCHAR *installDir */\r\n#ifndef BUILD_UNINSTALLER\r\n    false, /* bool registerAsDefault */\r\n    false, /* bool installPdfFilter */\r\n    false, /* bool installPdfPreviewer */\r\n    true,  /* bool keepBrowserPlugin */\r\n    false, /* bool extractFiles */\r\n    false, /* bool autoUpdate */\r\n#endif\r\n\r\n    nullptr,  /* WCHAR *firstError */\r\n    nullptr,  /* HANDLE hThread */\r\n    false, /* bool success */\r\n};\r\n\r\nvoid NotifyFailed(const WCHAR *msg)\r\n{\r\n    if (!gGlobalData.firstError)\r\n        gGlobalData.firstError = str::Dup(msg);\r\n    plogf(L\"%s\", msg);\r\n}\r\n\r\nvoid SetMsg(const WCHAR *msg, Color color)\r\n{\r\n    gMsg.Set(str::Dup(msg));\r\n    gMsgColor = color;\r\n}\r\n\r\n#define TEN_SECONDS_IN_MS 10*1000\r\n\r\nstatic bool IsProcWithName(DWORD processId, const WCHAR *modulePath)\r\n{\r\n    ScopedHandle hModSnapshot(CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, processId));\r\n    if (!hModSnapshot.IsValid())\r\n        return false;\r\n\r\n    MODULEENTRY32W me32 = { 0 };\r\n    me32.dwSize = sizeof(me32);\r\n    BOOL ok = Module32FirstW(hModSnapshot, &me32);\r\n    while (ok) {\r\n        if (path::IsSame(modulePath, me32.szExePath))\r\n            return true;\r\n        ok = Module32NextW(hModSnapshot, &me32);\r\n    }\r\n    return false;\r\n}\r\n\r\n// Kill a process with given <processId> if it has a module (dll or exe) <modulePath>.\r\n// If <waitUntilTerminated> is true, will wait until process is fully killed.\r\n// Returns TRUE if killed a process\r\nstatic bool KillProcIdWithName(DWORD processId, const WCHAR *modulePath, bool waitUntilTerminated)\r\n{\r\n    if (!IsProcWithName(processId, modulePath))\r\n        return false;\r\n\r\n    BOOL inheritHandle = FALSE;\r\n    // Note: do I need PROCESS_QUERY_INFORMATION and PROCESS_VM_READ?\r\n    DWORD dwAccess = PROCESS_QUERY_INFORMATION | PROCESS_VM_READ | PROCESS_TERMINATE;\r\n    ScopedHandle hProcess(OpenProcess(dwAccess, inheritHandle, processId));\r\n    if (!hProcess.IsValid())\r\n        return false;\r\n\r\n    BOOL killed = TerminateProcess(hProcess, 0);\r\n    if (!killed)\r\n        return false;\r\n\r\n    if (waitUntilTerminated)\r\n        WaitForSingleObject(hProcess, TEN_SECONDS_IN_MS);\r\n\r\n    return  true;\r\n}\r\n\r\n// returns number of killed processes that have a module (exe or dll) with a given\r\n// modulePath\r\n// returns -1 on error, 0 if no matching processes\r\nint KillProcess(const WCHAR *modulePath, bool waitUntilTerminated)\r\n{\r\n    ScopedHandle hProcSnapshot(CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0));\r\n    if (INVALID_HANDLE_VALUE == hProcSnapshot)\r\n        return -1;\r\n\r\n    PROCESSENTRY32 pe32;\r\n    pe32.dwSize = sizeof(pe32);\r\n    if (!Process32First(hProcSnapshot, &pe32))\r\n        return -1;\r\n\r\n    int killCount = 0;\r\n    do {\r\n        if (KillProcIdWithName(pe32.th32ProcessID, modulePath, waitUntilTerminated))\r\n            killCount++;\r\n    } while (Process32Next(hProcSnapshot, &pe32));\r\n\r\n    if (killCount > 0) {\r\n        UpdateWindow(FindWindow(nullptr, L\"Shell_TrayWnd\"));\r\n        UpdateWindow(GetDesktopWindow());\r\n    }\r\n    return killCount;\r\n}\r\n\r\nconst WCHAR *GetOwnPath()\r\n{\r\n    static WCHAR exePath[MAX_PATH];\r\n    exePath[0] = '\\0';\r\n    GetModuleFileName(nullptr, exePath, dimof(exePath));\r\n    exePath[dimof(exePath) - 1] = '\\0';\r\n    return exePath;\r\n}\r\n\r\nstatic WCHAR *GetInstallationDir()\r\n{\r\n    ScopedMem<WCHAR> dir(ReadRegStr(HKEY_CURRENT_USER, REG_PATH_UNINST, L\"InstallLocation\"));\r\n    if (!dir) dir.Set(ReadRegStr(HKEY_LOCAL_MACHINE, REG_PATH_UNINST, L\"InstallLocation\"));\r\n    if (dir) {\r\n        if (str::EndsWithI(dir, L\".exe\")) {\r\n            dir.Set(path::GetDir(dir));\r\n        }\r\n        if (!str::IsEmpty(dir.Get()) && dir::Exists(dir))\r\n            return dir.StealData();\r\n    }\r\n\r\n#ifndef BUILD_UNINSTALLER\r\n    // fall back to %ProgramFiles%\r\n    dir.Set(GetSpecialFolder(CSIDL_PROGRAM_FILES));\r\n    if (dir)\r\n        return path::Join(dir, APP_NAME_STR);\r\n    // fall back to C:\\ as a last resort\r\n    return str::Dup(L\"C:\\\\\" APP_NAME_STR);\r\n#else\r\n    // fall back to the uninstaller's path\r\n    return path::GetDir(GetOwnPath());\r\n#endif\r\n}\r\n\r\nWCHAR *GetUninstallerPath()\r\n{\r\n    return path::Join(gGlobalData.installDir, L\"uninstall.exe\");\r\n}\r\n\r\nWCHAR *GetInstalledExePath()\r\n{\r\n    return path::Join(gGlobalData.installDir, EXENAME);\r\n}\r\n\r\nstatic WCHAR *GetBrowserPluginPath()\r\n{\r\n    return path::Join(gGlobalData.installDir, L\"npPdfViewer.dll\");\r\n}\r\n\r\nWCHAR *GetInstalledBrowserPluginPath()\r\n{\r\n    WCHAR *path = ReadRegStr(HKEY_LOCAL_MACHINE, REG_PATH_PLUGIN, L\"Path\");\r\n    if (!path)\r\n        path = ReadRegStr(HKEY_CURRENT_USER, REG_PATH_PLUGIN, L\"Path\");\r\n    return path;\r\n}\r\n\r\nstatic WCHAR *GetPdfFilterPath()\r\n{\r\n    return path::Join(gGlobalData.installDir, L\"PdfFilter.dll\");\r\n}\r\n\r\nstatic WCHAR *GetPdfPreviewerPath()\r\n{\r\n    return path::Join(gGlobalData.installDir, L\"PdfPreview.dll\");\r\n}\r\n\r\nWCHAR *GetShortcutPath(bool allUsers)\r\n{\r\n    // CSIDL_COMMON_PROGRAMS => installing for all users\r\n    ScopedMem<WCHAR> dir(GetSpecialFolder(allUsers ? CSIDL_COMMON_PROGRAMS : CSIDL_PROGRAMS));\r\n    if (!dir)\r\n        return nullptr;\r\n    return path::Join(dir, APP_NAME_STR L\".lnk\");\r\n}\r\n\r\n/* if the app is running, we have to kill it so that we can over-write the executable */\r\nvoid KillSumatra()\r\n{\r\n    ScopedMem<WCHAR> exePath(GetInstalledExePath());\r\n    KillProcess(exePath, true);\r\n}\r\n\r\n#if 1\r\nstatic HFONT CreateDefaultGuiFont()\r\n{\r\n    NONCLIENTMETRICSW ncm;\r\n    ncm.cbSize = sizeof(ncm);\r\n    SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);\r\n    HFONT f = CreateFontIndirectW(&ncm.lfMenuFont);\r\n    return f;\r\n}\r\n#else\r\nstatic HFONT CreateDefaultGuiFont()\r\n{\r\n    HDC hdc = GetDC(nullptr);\r\n    HFONT font = CreateSimpleFont(hdc, L\"MS Shell Dlg\", 14);\r\n    ReleaseDC(nullptr, hdc);\r\n    return font;\r\n}\r\n#endif\r\n\r\nint dpiAdjust(int value)\r\n{\r\n    return (int)(value * gUiDPIFactor);\r\n}\r\n\r\nvoid InvalidateFrame()\r\n{\r\n    ClientRect rc(gHwndFrame);\r\n    RECT rcTmp = rc.ToRECT();\r\n    InvalidateRect(gHwndFrame, &rcTmp, FALSE);\r\n}\r\n\r\nbool CreateProcessHelper(const WCHAR *exe, const WCHAR *args)\r\n{\r\n    ScopedMem<WCHAR> cmd(str::Format(L\"\\\"%s\\\" %s\", exe, args ? args : L\"\"));\r\n    ScopedHandle process(LaunchProcess(cmd));\r\n    return process != nullptr;\r\n}\r\n\r\n// cf. http://support.microsoft.com/default.aspx?scid=kb;en-us;207132\r\nstatic bool RegisterServerDLL(const WCHAR *dllPath, bool install, const WCHAR *args=nullptr)\r\n{\r\n    if (FAILED(OleInitialize(nullptr)))\r\n        return false;\r\n\r\n    // make sure that the DLL can find any DLLs it depends on and\r\n    // which reside in the same directory (in this case: libmupdf.dll)\r\n    if (DynSetDllDirectoryW) {\r\n        ScopedMem<WCHAR> dllDir(path::GetDir(dllPath));\r\n        DynSetDllDirectoryW(dllDir);\r\n    }\r\n\r\n    bool ok = false;\r\n    HMODULE lib = LoadLibrary(dllPath);\r\n    if (lib) {\r\n        typedef HRESULT (WINAPI *DllInstallProc)(BOOL, LPCWSTR);\r\n        typedef HRESULT (WINAPI *DllRegUnregProc)(VOID);\r\n        if (args) {\r\n            DllInstallProc DllInstall = (DllInstallProc)GetProcAddress(lib, \"DllInstall\");\r\n            if (DllInstall)\r\n                ok = SUCCEEDED(DllInstall(install, args));\r\n            else\r\n                args = nullptr;\r\n        }\r\n        if (!args) {\r\n            const char *func = install ? \"DllRegisterServer\" : \"DllUnregisterServer\";\r\n            DllRegUnregProc DllRegUnreg = (DllRegUnregProc)GetProcAddress(lib, func);\r\n            if (DllRegUnreg)\r\n                ok = SUCCEEDED(DllRegUnreg());\r\n        }\r\n        FreeLibrary(lib);\r\n    }\r\n\r\n    if (DynSetDllDirectoryW)\r\n        DynSetDllDirectoryW(L\"\");\r\n\r\n    OleUninitialize();\r\n\r\n    return ok;\r\n}\r\n\r\nstatic bool IsUsingInstallation(DWORD procId)\r\n{\r\n    ScopedHandle snap(CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, procId));\r\n    if (snap == INVALID_HANDLE_VALUE)\r\n        return false;\r\n\r\n    ScopedMem<WCHAR> libmupdf(path::Join(gGlobalData.installDir, L\"libmupdf.dll\"));\r\n    ScopedMem<WCHAR> browserPlugin(GetBrowserPluginPath());\r\n\r\n    MODULEENTRY32 mod;\r\n    mod.dwSize = sizeof(mod);\r\n    BOOL cont = Module32First(snap, &mod);\r\n    while (cont) {\r\n        if (path::IsSame(libmupdf, mod.szExePath) ||\r\n            path::IsSame(browserPlugin, mod.szExePath)) {\r\n            return true;\r\n        }\r\n        cont = Module32Next(snap, &mod);\r\n    }\r\n\r\n    return false;\r\n}\r\n\r\n// return names of processes that are running part of the installation\r\n// (i.e. have libmupdf.dll or npPdfViewer.dll loaded)\r\nstatic void ProcessesUsingInstallation(WStrVec& names)\r\n{\r\n    ScopedHandle snap(CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0));\r\n    if (INVALID_HANDLE_VALUE == snap)\r\n        return;\r\n\r\n    PROCESSENTRY32 proc;\r\n    proc.dwSize = sizeof(proc);\r\n    BOOL ok = Process32First(snap, &proc);\r\n    while (ok) {\r\n        if (IsUsingInstallation(proc.th32ProcessID)) {\r\n            names.Append(str::Dup(proc.szExeFile));\r\n        }\r\n        proc.dwSize = sizeof(proc);\r\n        ok = Process32Next(snap, &proc);\r\n    }\r\n}\r\n\r\nstatic void SetDefaultMsg()\r\n{\r\n#ifdef BUILD_UNINSTALLER\r\n    SetMsg(_TR(\"Are you sure you want to uninstall SumatraPDF?\"), COLOR_MSG_WELCOME);\r\n#else\r\n    SetMsg(_TR(\"Thank you for choosing SumatraPDF!\"), COLOR_MSG_WELCOME);\r\n#endif\r\n}\r\n\r\nstatic const WCHAR *ReadableProcName(const WCHAR *procPath)\r\n{\r\n    const WCHAR *nameList[] = {\r\n        EXENAME, APP_NAME_STR,\r\n        L\"plugin-container.exe\", L\"Mozilla Firefox\",\r\n        L\"chrome.exe\", L\"Google Chrome\",\r\n        L\"prevhost.exe\", L\"Windows Explorer\",\r\n        L\"dllhost.exe\", L\"Windows Explorer\",\r\n    };\r\n    const WCHAR *procName = path::GetBaseName(procPath);\r\n    for (size_t i = 0; i < dimof(nameList); i += 2) {\r\n        if (str::EqI(procName, nameList[i]))\r\n            return nameList[i + 1];\r\n    }\r\n    return procName;\r\n}\r\n\r\nstatic void SetCloseProcessMsg()\r\n{\r\n    ScopedMem<WCHAR> procNames(str::Dup(ReadableProcName(gProcessesToClose.At(0))));\r\n    for (size_t i = 1; i < gProcessesToClose.Count(); i++) {\r\n        const WCHAR *name = ReadableProcName(gProcessesToClose.At(i));\r\n        if (i < gProcessesToClose.Count() - 1)\r\n            procNames.Set(str::Join(procNames, L\", \", name));\r\n        else\r\n            procNames.Set(str::Join(procNames, L\" and \", name));\r\n    }\r\n    ScopedMem<WCHAR> s(str::Format(_TR(\"Please close %s to proceed!\"), procNames));\r\n    SetMsg(s, COLOR_MSG_FAILED);\r\n}\r\n\r\nbool CheckInstallUninstallPossible(bool silent)\r\n{\r\n    gProcessesToClose.Reset();\r\n    ProcessesUsingInstallation(gProcessesToClose);\r\n\r\n    bool possible = gProcessesToClose.Count() == 0;\r\n    if (possible) {\r\n        SetDefaultMsg();\r\n    } else {\r\n        SetCloseProcessMsg();\r\n        if (!silent)\r\n            MessageBeep(MB_ICONEXCLAMATION);\r\n    }\r\n    InvalidateFrame();\r\n\r\n    return possible;\r\n}\r\n\r\nvoid UninstallBrowserPlugin()\r\n{\r\n    ScopedMem<WCHAR> dllPath(GetBrowserPluginPath());\r\n    if (!file::Exists(dllPath)) {\r\n        // uninstall the detected plugin, even if it isn't in the target installation path\r\n        dllPath.Set(GetInstalledBrowserPluginPath());\r\n        if (!file::Exists(dllPath))\r\n            return;\r\n    }\r\n    if (!RegisterServerDLL(dllPath, false))\r\n        NotifyFailed(_TR(\"Couldn't uninstall browser plugin\"));\r\n}\r\n\r\nvoid InstallPdfFilter()\r\n{\r\n    ScopedMem<WCHAR> dllPath(GetPdfFilterPath());\r\n    if (!RegisterServerDLL(dllPath, true))\r\n        NotifyFailed(_TR(\"Couldn't install PDF search filter\"));\r\n}\r\n\r\nvoid UninstallPdfFilter()\r\n{\r\n    ScopedMem<WCHAR> dllPath(GetPdfFilterPath());\r\n    if (!RegisterServerDLL(dllPath, false))\r\n        NotifyFailed(_TR(\"Couldn't uninstall PDF search filter\"));\r\n}\r\n\r\nvoid InstallPdfPreviewer()\r\n{\r\n    ScopedMem<WCHAR> dllPath(GetPdfPreviewerPath());\r\n    // TODO: RegisterServerDLL(dllPath, true, L\"exts:pdf,...\");\r\n    if (!RegisterServerDLL(dllPath, true))\r\n        NotifyFailed(_TR(\"Couldn't install PDF previewer\"));\r\n}\r\n\r\nvoid UninstallPdfPreviewer()\r\n{\r\n    ScopedMem<WCHAR> dllPath(GetPdfPreviewerPath());\r\n    // TODO: RegisterServerDLL(dllPath, false, L\"exts:pdf,...\");\r\n    if (!RegisterServerDLL(dllPath, false))\r\n        NotifyFailed(_TR(\"Couldn't uninstall PDF previewer\"));\r\n}\r\n\r\nSIZE GetIdealButtonSize(HWND hwnd) {\r\n    // adjust to real size and position to the right\r\n    SIZE s;\r\n    Button_GetIdealSize(hwnd, &s);\r\n    // add padding\r\n    s.cx += dpiAdjust(8) * 2;\r\n    s.cy += dpiAdjust(2) * 2;\r\n    return s;\r\n}\r\n\r\nSIZE SetButtonTextAndResize(HWND hwnd, const WCHAR * s)\r\n{\r\n    win::SetText(hwnd, s);\r\n    SIZE size = GetIdealButtonSize(hwnd);\r\n    SetWindowPos(hwnd, nullptr, 0, 0, size.cx, size.cy, SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE | SWP_FRAMECHANGED);\r\n    return size;\r\n}\r\n\r\n// Creates a button that has a right size for it's text, \r\nHWND CreateButton(HWND hwndParent, const WCHAR *s, int id, DWORD style, SIZE& sizeOut)\r\n{\r\n    HMENU idMenu = (HMENU) (UINT_PTR) id;\r\n    style |= WS_CHILD | WS_TABSTOP;\r\n    HWND hwnd = CreateWindowExW(0, WC_BUTTON, L\"\", style,\r\n        0, 0, 100, 20, hwndParent,\r\n        idMenu, GetModuleHandle(nullptr), nullptr);\r\n    SetWindowFont(hwnd, gFontDefault, TRUE);\r\n    sizeOut = SetButtonTextAndResize(hwnd, s);\r\n    return hwnd;\r\n}\r\n\r\nHWND CreateDefaultButton(HWND hwndParent, const WCHAR *s, int id)\r\n{\r\n    SIZE size;\r\n    HWND hwnd = CreateButton(hwndParent, s, id, BS_DEFPUSHBUTTON, size);\r\n\r\n    ClientRect r(hwndParent);\r\n    int x = r.dx - size.cx - WINDOW_MARGIN;\r\n    int y = r.dy - size.cy - WINDOW_MARGIN;\r\n    SetWindowPos(hwnd, nullptr, x, y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_SHOWWINDOW);\r\n    return hwnd;\r\n}\r\n\r\nvoid CreateButtonExit(HWND hwndParent)\r\n{\r\n    gHwndButtonExit = CreateDefaultButton(hwndParent, _TR(\"Close\"), ID_BUTTON_EXIT);\r\n}\r\n\r\nvoid OnButtonExit()\r\n{\r\n    SendMessage(gHwndFrame, WM_CLOSE, 0, 0);\r\n}\r\n\r\n// This display is inspired by http://letteringjs.com/\r\ntypedef struct {\r\n    // part that doesn't change\r\n    char c;\r\n    Color col, colShadow;\r\n    REAL rotation;\r\n    REAL dyOff; // displacement\r\n\r\n    // part calculated during layout\r\n    REAL dx, dy;\r\n    REAL x;\r\n} LetterInfo;\r\n\r\nLetterInfo gLetters[] = {\r\n    { 'S', gCol1, gCol1Shadow, -3.f,     0, 0, 0 },\r\n    { 'U', gCol2, gCol2Shadow,  0.f,     0, 0, 0 },\r\n    { 'M', gCol3, gCol3Shadow,  2.f,  -2.f, 0, 0 },\r\n    { 'A', gCol4, gCol4Shadow,  0.f, -2.4f, 0, 0 },\r\n    { 'T', gCol5, gCol5Shadow,  0.f,     0, 0, 0 },\r\n    { 'R', gCol5, gCol5Shadow, 2.3f, -1.4f, 0, 0 },\r\n    { 'A', gCol4, gCol4Shadow,  0.f,     0, 0, 0 },\r\n    { 'P', gCol3, gCol3Shadow,  0.f, -2.3f, 0, 0 },\r\n    { 'D', gCol2, gCol2Shadow,  0.f,   3.f, 0, 0 },\r\n    { 'F', gCol1, gCol1Shadow,  0.f,     0, 0, 0 }\r\n};\r\n\r\n#define SUMATRA_LETTERS_COUNT (dimof(gLetters))\r\n\r\n#if 0\r\nstatic char RandUppercaseLetter()\r\n{\r\n    // note: clearly, not random but seems to work ok anyway\r\n    static char l = 'A' - 1;\r\n    l++;\r\n    if (l > 'Z')\r\n        l = 'A';\r\n    return l;\r\n}\r\n\r\nstatic void RandomizeLetters()\r\n{\r\n    for (int i = 0; i < dimof(gLetters); i++) {\r\n        gLetters[i].c = RandUppercaseLetter();\r\n    }\r\n}\r\n#endif\r\n\r\nstatic void SetLettersSumatraUpTo(int n)\r\n{\r\n    char *s = \"SUMATRAPDF\";\r\n    for (int i = 0; i < dimof(gLetters); i++) {\r\n        if (i < n) {\r\n            gLetters[i].c = s[i];\r\n        } else {\r\n            gLetters[i].c = ' ';\r\n        }\r\n    }\r\n}\r\n\r\nstatic void SetLettersSumatra()\r\n{\r\n    SetLettersSumatraUpTo(SUMATRA_LETTERS_COUNT);\r\n}\r\n\r\n// an animation that reveals letters one by one\r\n\r\n// how long the animation lasts, in seconds\r\n#define REVEALING_ANIM_DUR double(2)\r\n\r\nstatic FrameTimeoutCalculator *gRevealingLettersAnim = nullptr;\r\n\r\nint gRevealingLettersAnimLettersToShow;\r\n\r\nstatic void RevealingLettersAnimStart()\r\n{\r\n    int framesPerSec = (int)(double(SUMATRA_LETTERS_COUNT) / REVEALING_ANIM_DUR);\r\n    gRevealingLettersAnim = new FrameTimeoutCalculator(framesPerSec);\r\n    gRevealingLettersAnimLettersToShow = 0;\r\n    SetLettersSumatraUpTo(0);\r\n}\r\n\r\nstatic void RevealingLettersAnimStop()\r\n{\r\n    delete gRevealingLettersAnim;\r\n    gRevealingLettersAnim = nullptr;\r\n    SetLettersSumatra();\r\n    InvalidateFrame();\r\n}\r\n\r\nstatic void RevealingLettersAnim()\r\n{\r\n    if (gRevealingLettersAnim->ElapsedTotal() > REVEALING_ANIM_DUR) {\r\n        RevealingLettersAnimStop();\r\n        return;\r\n    }\r\n    DWORD timeOut = gRevealingLettersAnim->GetTimeoutInMilliseconds();\r\n    if (timeOut != 0)\r\n        return;\r\n    SetLettersSumatraUpTo(++gRevealingLettersAnimLettersToShow);\r\n    gRevealingLettersAnim->Step();\r\n    InvalidateFrame();\r\n}\r\n\r\nstatic void AnimStep()\r\n{\r\n    if (gRevealingLettersAnim)\r\n        RevealingLettersAnim();\r\n}\r\n\r\nstatic void CalcLettersLayout(Graphics& g, Font *f, int dx)\r\n{\r\n    static BOOL didLayout = FALSE;\r\n    if (didLayout) return;\r\n\r\n    LetterInfo *li;\r\n    StringFormat sfmt;\r\n    const REAL letterSpacing = -12.f;\r\n    REAL totalDx = -letterSpacing; // counter last iteration of the loop\r\n    WCHAR s[2] = { 0 };\r\n    PointF origin(0.f, 0.f);\r\n    RectF bbox;\r\n    for (int i = 0; i < dimof(gLetters); i++) {\r\n        li = &gLetters[i];\r\n        s[0] = li->c;\r\n        g.MeasureString(s, 1, f, origin, &sfmt, &bbox);\r\n        li->dx = bbox.Width;\r\n        li->dy = bbox.Height;\r\n        totalDx += li->dx;\r\n        totalDx += letterSpacing;\r\n    }\r\n\r\n    REAL x = ((REAL)dx - totalDx) / 2.f;\r\n    for (int i = 0; i < dimof(gLetters); i++) {\r\n        li = &gLetters[i];\r\n        li->x = x;\r\n        x += li->dx;\r\n        x += letterSpacing;\r\n    }\r\n    RevealingLettersAnimStart();\r\n    didLayout = TRUE;\r\n}\r\n\r\nstatic REAL DrawMessage(Graphics &g, const WCHAR *msg, REAL y, REAL dx, Color color)\r\n{\r\n    ScopedMem<WCHAR> s(str::Dup(msg));\r\n\r\n    Font f(L\"Impact\", 16, FontStyleRegular);\r\n    RectF maxbox(0, y, dx, 0);\r\n    RectF bbox;\r\n    g.MeasureString(s, -1, &f, maxbox, &bbox);\r\n\r\n    bbox.X += (dx - bbox.Width) / 2.f;\r\n    StringFormat sft;\r\n    sft.SetAlignment(StringAlignmentCenter);\r\n    if (trans::IsCurrLangRtl())\r\n        sft.SetFormatFlags(StringFormatFlagsDirectionRightToLeft);\r\n#if DRAW_MSG_TEXT_SHADOW\r\n    {\r\n        bbox.X--; bbox.Y++;\r\n        SolidBrush b(Color(0xff, 0xff, 0xff));\r\n        g.DrawString(s, -1, &f, bbox, &sft, &b);\r\n        bbox.X++; bbox.Y--;\r\n    }\r\n#endif\r\n    SolidBrush b(color);\r\n    g.DrawString(s, -1, &f, bbox, &sft, &b);\r\n\r\n    return bbox.Height;\r\n}\r\n\r\nstatic void DrawSumatraLetters(Graphics &g, Font *f, Font *fVer, REAL y)\r\n{\r\n    LetterInfo *li;\r\n    WCHAR s[2] = { 0 };\r\n    for (int i = 0; i < dimof(gLetters); i++) {\r\n        li = &gLetters[i];\r\n        s[0] = li->c;\r\n        if (s[0] == ' ')\r\n            return;\r\n\r\n        g.RotateTransform(li->rotation, MatrixOrderAppend);\r\n#if DRAW_TEXT_SHADOW\r\n        // draw shadow first\r\n        SolidBrush b2(li->colShadow);\r\n        PointF o2(li->x - 3.f, y + 4.f + li->dyOff);\r\n        g.DrawString(s, 1, f, o2, &b2);\r\n#endif\r\n\r\n        SolidBrush b1(li->col);\r\n        PointF o1(li->x, y + li->dyOff);\r\n        g.DrawString(s, 1, f, o1, &b1);\r\n        g.RotateTransform(li->rotation, MatrixOrderAppend);\r\n        g.ResetTransform();\r\n    }\r\n\r\n    // draw version number\r\n    REAL x = gLetters[dimof(gLetters)-1].x;\r\n    g.TranslateTransform(x, y);\r\n    g.RotateTransform(45.f);\r\n    REAL x2 = 15; REAL y2 = -34;\r\n\r\n    WCHAR *ver_s = L\"v\" CURR_VERSION_STR;\r\n#if DRAW_TEXT_SHADOW\r\n    SolidBrush b1(Color(0, 0, 0));\r\n    g.DrawString(ver_s, -1, fVer, PointF(x2 - 2, y2 - 1), &b1);\r\n#endif\r\n    SolidBrush b2(Color(0xff, 0xff, 0xff));\r\n    g.DrawString(ver_s, -1, fVer, PointF(x2, y2), &b2);\r\n    g.ResetTransform();\r\n}\r\n\r\nstatic void DrawFrame2(Graphics &g, RectI r)\r\n{\r\n    g.SetCompositingQuality(CompositingQualityHighQuality);\r\n    g.SetSmoothingMode(SmoothingModeAntiAlias);\r\n    g.SetPageUnit(UnitPixel);\r\n\r\n    Font f(L\"Impact\", 40, FontStyleRegular);\r\n    CalcLettersLayout(g, &f, r.dx);\r\n\r\n    Gdiplus::Color bgCol;\r\n    bgCol.SetFromCOLORREF(WIN_BG_COLOR);\r\n    SolidBrush bgBrush(bgCol);\r\n    Rect r2(r.ToGdipRect());\r\n    r2.Inflate(1, 1);\r\n    g.FillRectangle(&bgBrush, r2);\r\n\r\n    Font f2(L\"Impact\", 16, FontStyleRegular);\r\n    DrawSumatraLetters(g, &f, &f2, 18.f);\r\n\r\n    if (gShowOptions)\r\n        return;\r\n\r\n    REAL msgY = (REAL)(r.dy / 2);\r\n    if (gMsg)\r\n        msgY += DrawMessage(g, gMsg, msgY, (REAL)r.dx, gMsgColor) + 5;\r\n    if (gMsgError)\r\n        DrawMessage(g, gMsgError, msgY, (REAL)r.dx, COLOR_MSG_FAILED);\r\n}\r\n\r\nstatic void DrawFrame(HWND hwnd, HDC dc, PAINTSTRUCT *)\r\n{\r\n    // TODO: cache bmp object?\r\n    Graphics g(dc);\r\n    ClientRect rc(hwnd);\r\n    Bitmap bmp(rc.dx, rc.dy, &g);\r\n    Graphics g2((Image*)&bmp);\r\n    DrawFrame2(g2, rc);\r\n    g.DrawImage(&bmp, 0, 0);\r\n}\r\n\r\nstatic void OnPaintFrame(HWND hwnd)\r\n{\r\n    PAINTSTRUCT ps;\r\n    HDC dc = BeginPaint(hwnd, &ps);\r\n    DrawFrame(hwnd, dc, &ps);\r\n    EndPaint(hwnd, &ps);\r\n}\r\n\r\nHBRUSH ghbrBackground = nullptr;\r\n\r\nstatic LRESULT CALLBACK WndProcFrame(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)\r\n{\r\n    bool handled;\r\n    switch (message)\r\n    {\r\n        case WM_CREATE:\r\n#ifdef BUILD_UNINSTALLER\r\n            if (!IsUninstallerNeeded()) {\r\n                MessageBox(nullptr, _TR(\"SumatraPDF installation not found.\"), _TR(\"Uninstallation failed\"),  MB_ICONEXCLAMATION | MB_OK);\r\n                PostQuitMessage(0);\r\n                return -1;\r\n            }\r\n#endif\r\n            OnCreateWindow(hwnd);\r\n            break;\r\n\r\n        case WM_CTLCOLORSTATIC:\r\n        {\r\n            if (ghbrBackground == nullptr) {\r\n                ghbrBackground = CreateSolidBrush(RGB(0xff, 0xf2, 0));\r\n            }\r\n            HDC hdc = (HDC) wParam;\r\n            SetTextColor(hdc, RGB(0, 0, 0));\r\n            SetBkMode(hdc, TRANSPARENT);\r\n            return (LRESULT) ghbrBackground;\r\n        }\r\n\r\n        case WM_DESTROY:\r\n            PostQuitMessage(0);\r\n            break;\r\n\r\n        case WM_ERASEBKGND:\r\n            return TRUE;\r\n\r\n        case WM_PAINT:\r\n            OnPaintFrame(hwnd);\r\n            break;\r\n\r\n        case WM_COMMAND:\r\n            handled = OnWmCommand(wParam);\r\n            if (!handled)\r\n                return DefWindowProc(hwnd, message, wParam, lParam);\r\n            break;\r\n\r\n        case WM_APP_INSTALLATION_FINISHED:\r\n#ifndef BUILD_UNINSTALLER\r\n            OnInstallationFinished();\r\n            if (gHwndButtonRunSumatra)\r\n                SetFocus(gHwndButtonRunSumatra);\r\n#else\r\n            OnUninstallationFinished();\r\n#endif\r\n            if (gHwndButtonExit)\r\n                SetFocus(gHwndButtonExit);\r\n            break;\r\n\r\n        default:\r\n            return DefWindowProc(hwnd, message, wParam, lParam);\r\n    }\r\n\r\n    return 0;\r\n}\r\n\r\nstatic bool RegisterWinClass()\r\n{\r\n    WNDCLASSEX  wcex;\r\n\r\n    FillWndClassEx(wcex, INSTALLER_FRAME_CLASS_NAME, WndProcFrame);\r\n    wcex.hIcon = LoadIcon(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDI_SUMATRAPDF));\r\n\r\n    ATOM atom = RegisterClassEx(&wcex);\r\n    CrashIf(!atom);\r\n    return atom != 0;\r\n}\r\n\r\nstatic BOOL InstanceInit()\r\n{\r\n    gFontDefault = CreateDefaultGuiFont();\r\n    gUiDPIFactor = (float)DpiGet(HWND_DESKTOP)->dpiX / 96.f;\r\n    trans::SetCurrentLangByCode(trans::DetectUserLang());\r\n\r\n    CreateMainWindow();\r\n    if (!gHwndFrame)\r\n        return FALSE;\r\n\r\n    SetDefaultMsg();\r\n\r\n    CenterDialog(gHwndFrame);\r\n    ShowWindow(gHwndFrame, SW_SHOW);\r\n\r\n    return TRUE;\r\n}\r\n\r\n// inspired by http://engineering.imvu.com/2010/11/24/how-to-write-an-interactive-60-hz-desktop-application/\r\nstatic int RunApp()\r\n{\r\n    MSG msg;\r\n    FrameTimeoutCalculator ftc(60);\r\n    Timer t;\r\n    for (;;) {\r\n        const DWORD timeout = ftc.GetTimeoutInMilliseconds();\r\n        DWORD res = WAIT_TIMEOUT;\r\n        if (timeout > 0) {\r\n            res = MsgWaitForMultipleObjects(0, 0, TRUE, timeout, QS_ALLINPUT);\r\n        }\r\n        if (res == WAIT_TIMEOUT) {\r\n            AnimStep();\r\n            ftc.Step();\r\n        }\r\n\r\n        while (PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE)) {\r\n            if (msg.message == WM_QUIT) {\r\n                return (int)msg.wParam;\r\n            }\r\n            if (!IsDialogMessage(gHwndFrame, &msg)) {\r\n                TranslateMessage(&msg);\r\n                DispatchMessage(&msg);\r\n            }\r\n        }\r\n        // check if there are processes that need to be closed but\r\n        // not more frequently than once per ten seconds and\r\n        // only before (un)installation starts.\r\n        if (t.GetTimeInMs() > 10000 &&\r\n            gHwndButtonInstUninst && IsWindowEnabled(gHwndButtonInstUninst)) {\r\n            CheckInstallUninstallPossible(true);\r\n            t.Start();\r\n        }\r\n    }\r\n}\r\n\r\nstatic void ParseCommandLine(WCHAR *cmdLine)\r\n{\r\n    WStrVec argList;\r\n    ParseCmdLine(cmdLine, argList);\r\n\r\n#define is_arg(param) str::EqI(arg + 1, TEXT(param))\r\n#define is_arg_with_param(param) (is_arg(param) && i < argList.Count() - 1)\r\n\r\n    // skip the first arg (exe path)\r\n    for (size_t i = 1; i < argList.Count(); i++) {\r\n        WCHAR *arg = argList.At(i);\r\n        if ('-' != *arg && '/' != *arg)\r\n            continue;\r\n\r\n        if (is_arg(\"s\"))\r\n            gGlobalData.silent = true;\r\n        else if (is_arg_with_param(\"d\"))\r\n            str::ReplacePtr(&gGlobalData.installDir, argList.At(++i));\r\n#ifndef BUILD_UNINSTALLER\r\n        else if (is_arg(\"register\"))\r\n            gGlobalData.registerAsDefault = true;\r\n        else if (is_arg_with_param(\"opt\")) {\r\n            WCHAR *opts = argList.At(++i);\r\n            str::ToLowerInPlace(opts);\r\n            str::TransChars(opts, L\" ;\", L\",,\");\r\n            WStrVec optlist;\r\n            optlist.Split(opts, L\",\", true);\r\n            if (optlist.Contains(L\"pdffilter\"))\r\n                gGlobalData.installPdfFilter = true;\r\n            if (optlist.Contains(L\"pdfpreviewer\"))\r\n                gGlobalData.installPdfPreviewer = true;\r\n            // uninstall the deprecated browser plugin if it's not\r\n            // explicitly listed (only applies if the /opt flag is used)\r\n            if (!optlist.Contains(L\"plugin\"))\r\n                gGlobalData.keepBrowserPlugin = false;\r\n        }\r\n        else if (is_arg(\"x\")) {\r\n            gGlobalData.justExtractFiles = true;\r\n            // silently extract files to the current directory (if /d isn't used)\r\n            gGlobalData.silent = true;\r\n            if (!gGlobalData.installDir)\r\n                str::ReplacePtr(&gGlobalData.installDir, L\".\");\r\n        }\r\n        else if (is_arg(\"autoupdate\")) {\r\n            gGlobalData.autoUpdate = true;\r\n        }\r\n#endif\r\n        else if (is_arg(\"h\") || is_arg(\"help\") || is_arg(\"?\"))\r\n            gGlobalData.showUsageAndQuit = true;\r\n#ifdef ENABLE_CRASH_TESTING\r\n        else if (is_arg(\"crash\")) {\r\n            // will induce crash when 'Install' button is pressed\r\n            // for testing crash handling\r\n            gForceCrash = true;\r\n        }\r\n#endif\r\n    }\r\n}\r\n\r\n#define CRASH_DUMP_FILE_NAME         L\"suminstaller.dmp\"\r\n\r\n// no-op but must be defined for CrashHandler.cpp\r\nvoid ShowCrashHandlerMessage() { }\r\nvoid GetStressTestInfo(str::Str<char>* s) { UNUSED(s); }\r\n\r\nvoid GetProgramInfo(str::Str<char>& s)\r\n{\r\n    s.AppendFmt(\"Ver: %s\", CURR_VERSION_STRA);\r\n#ifdef SVN_PRE_RELEASE_VER\r\n    s.AppendFmt(\" pre-release\");\r\n#endif\r\n    if (IsProcess64()) {\r\n        s.Append(\" 64-bit\");\r\n    }\r\n#ifdef DEBUG\r\n    if (!str::Find(s.Get(), \" (dbg)\"))\r\n        s.Append(\" (dbg)\");\r\n#endif\r\n    s.Append(\"\\r\\n\");\r\n#if defined(GIT_COMMIT_ID)\r\n    const char *gitSha1 = QM(GIT_COMMIT_ID);\r\n    s.AppendFmt(\"Git: %s (https://github.com/sumatrapdfreader/sumatrapdf/tree/%s)\\r\\n\", gitSha1, gitSha1);\r\n#endif\r\n}\r\n\r\nbool CrashHandlerCanUseNet()\r\n{\r\n    return true;\r\n}\r\n\r\n#ifndef BUILD_UNINSTALLER\r\nstatic void InstallInstallerCrashHandler()\r\n{\r\n    // save symbols directly into %TEMP% (so that the installer doesn't\r\n    // unnecessarily leave an empty directory behind if it doesn't have to)\r\n    ScopedMem<WCHAR> tempDir(path::GetTempPath());\r\n    if (!tempDir || !dir::Exists(tempDir))\r\n        tempDir.Set(GetSpecialFolder(CSIDL_LOCAL_APPDATA, true)); {\r\n        if (!tempDir || !dir::Exists(tempDir))\r\n            return;\r\n    }\r\n    ScopedMem<WCHAR> crashDumpPath(path::Join(tempDir, CRASH_DUMP_FILE_NAME));\r\n    InstallCrashHandler(crashDumpPath, tempDir);\r\n}\r\n#endif\r\n\r\nint APIENTRY WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/,\r\n                     LPSTR /* lpCmdLine*/, int nCmdShow)\r\n{\r\n    UNUSED(nCmdShow);\r\n    int ret = 1;\r\n\r\n    SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);\r\n    InitDynCalls();\r\n\r\n    ScopedCom com;\r\n    InitAllCommonControls();\r\n    ScopedGdiPlus gdi;\r\n\r\n#ifndef BUILD_UNINSTALLER\r\n    InstallInstallerCrashHandler();\r\n#endif\r\n\r\n    ParseCommandLine(GetCommandLine());\r\n    if (gGlobalData.showUsageAndQuit) {\r\n        ShowUsage();\r\n        ret = 0;\r\n        goto Exit;\r\n    }\r\n    if (!gGlobalData.installDir)\r\n        gGlobalData.installDir = GetInstallationDir();\r\n\r\n#if defined(BUILD_UNINSTALLER) && !defined(TEST_UNINSTALLER)\r\n    if (ExecuteUninstallerFromTempDir())\r\n        return 0;\r\n#endif\r\n\r\n    if (gGlobalData.silent) {\r\n#ifdef BUILD_UNINSTALLER\r\n        UninstallerThread(nullptr);\r\n#else\r\n        // make sure not to uninstall the plugins during silent installation\r\n        if (!gGlobalData.installPdfFilter)\r\n            gGlobalData.installPdfFilter = IsPdfFilterInstalled();\r\n        if (!gGlobalData.installPdfPreviewer)\r\n            gGlobalData.installPdfPreviewer = IsPdfPreviewerInstalled();\r\n        InstallerThread(nullptr);\r\n#endif\r\n        ret = gGlobalData.success ? 0 : 1;\r\n        goto Exit;\r\n    }\r\n\r\n    if (!RegisterWinClass())\r\n        goto Exit;\r\n\r\n    if (!InstanceInit())\r\n        goto Exit;\r\n\r\n    ret = RunApp();\r\n\r\nExit:\r\n    trans::Destroy();\r\n    free(gGlobalData.installDir);\r\n    free(gGlobalData.firstError);\r\n\r\n    return ret;\r\n}\r\n"
  },
  {
    "path": "src/installer/Installer.exe.manifest",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">\n\t<dependency>\n\t\t<dependentAssembly>\n\t\t\t<assemblyIdentity\n\t\t\t\tname=\"Microsoft.Windows.Common-Controls\"\n\t\t\t\tversion=\"6.0.0.0\"\n\t\t\t\ttype=\"win32\"\n\t\t\t\tprocessorArchitecture=\"*\"\n\t\t\t\tpublicKeyToken=\"6595b64144ccf1df\"\n\t\t\t\tlanguage=\"*\"\n\t\t\t/>\n\t\t</dependentAssembly>\n\t</dependency>\n\t<trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n\t\t<security>\n\t\t\t<requestedPrivileges>\n\t\t\t\t<requestedExecutionLevel level=\"requireAdministrator\" uiAccess=\"false\"/>\n\t\t\t</requestedPrivileges>\n\t\t</security>\n\t</trustInfo>\n\t<application xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n\t\t<windowsSettings>\n\t\t\t<dpiAware xmlns=\"http://schemas.microsoft.com/SMI/2005/WindowsSettings\">True</dpiAware>\n\t\t</windowsSettings>\n\t</application>\n\t<compatibility xmlns=\"urn:schemas-microsoft-com:compatibility.v1\">\n\t\t<application>\n\t\t\t<!-- Windows Vista -->\n\t\t\t<supportedOS Id=\"{e2011457-1546-43c5-a5fe-008deee3d3f0}\"/>\n\t\t\t<!-- Windows 7 -->\n\t\t\t<supportedOS Id=\"{35138b9a-5d96-4fbd-8e2d-a2440225f93a}\"/>\n\t\t\t<!-- Windows 8 -->\n\t\t\t<supportedOS Id=\"{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}\"/>\n\t\t\t<!-- Windows 8.1 -->\n\t\t\t<supportedOS Id=\"{1f676c76-80e1-4239-95bb-83d0f6d0da78}\"/>\n\t\t\t<!-- Windows 10 -->\n\t\t\t<supportedOS Id=\"{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}\"/>\n\t\t</application>\n\t</compatibility>\n</assembly>\n"
  },
  {
    "path": "src/installer/Installer.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n#define EXENAME             APP_NAME_STR L\".exe\"\r\n\r\n#define INSTALLER_FRAME_CLASS_NAME    L\"SUMATRA_PDF_INSTALLER_FRAME\"\r\n\r\n#define INSTALLER_WIN_DX    420\r\n#define INSTALLER_WIN_DY    340\r\n\r\n#define WIN_BG_COLOR RGB(0xff, 0xf2, 0) // yellow\r\n\r\n#define WINDOW_MARGIN   dpiAdjust(8)\r\n\r\n/* The window is divided in three parts:\r\n- top part, where we display nice graphics\r\n- middle part, where we either display messages or advanced options\r\n- bottom part, with install/uninstall button\r\n*/\r\n\r\n// This is the height of the lower part\r\nextern int gBottomPartDy;\r\n\r\nextern int gButtonDy;\r\n\r\n// This is in HKLM. Note that on 64bit windows, if installing 32bit app\r\n// the installer has to be 32bit as well, so that it goes into proper\r\n// place in registry (under Software\\Wow6432Node\\Microsoft\\Windows\\...\r\n#define REG_PATH_UNINST     L\"Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Uninstall\\\\\" APP_NAME_STR\r\n\r\n#define REG_CLASSES_APP     L\"Software\\\\Classes\\\\\" APP_NAME_STR\r\n#define REG_CLASSES_PDF     L\"Software\\\\Classes\\\\.pdf\"\r\n#define REG_CLASSES_APPS    L\"Software\\\\Classes\\\\Applications\\\\\" EXENAME\r\n\r\n#define REG_EXPLORER_PDF_EXT  L\"Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Explorer\\\\FileExts\\\\.pdf\"\r\n#define PROG_ID               L\"ProgId\"\r\n#define APPLICATION           L\"Application\"\r\n\r\n#ifndef _WIN64\r\n#define REG_PATH_PLUGIN     L\"Software\\\\MozillaPlugins\\\\@mozilla.zeniko.ch/SumatraPDF_Browser_Plugin\"\r\n#else\r\n#define REG_PATH_PLUGIN     L\"Software\\\\MozillaPlugins\\\\@mozilla.zeniko.ch/SumatraPDF_Browser_Plugin_x64\"\r\n#endif\r\n\r\n#define ID_BUTTON_EXIT                11\r\n\r\n#define WM_APP_INSTALLATION_FINISHED        (WM_APP + 1)\r\n\r\nstruct GlobalData {\r\n    bool    silent;\r\n    bool    showUsageAndQuit;\r\n    WCHAR * installDir;\r\n#ifndef BUILD_UNINSTALLER\r\n    bool    registerAsDefault;\r\n    bool    installPdfFilter;\r\n    bool    installPdfPreviewer;\r\n    bool    keepBrowserPlugin;\r\n    bool    justExtractFiles;\r\n    bool    autoUpdate;\r\n#endif\r\n\r\n    WCHAR * firstError;\r\n    HANDLE  hThread;\r\n    bool    success;\r\n};\r\n\r\nstruct PayloadInfo {\r\n    const char *fileName;\r\n    bool install;\r\n};\r\n\r\nextern GlobalData   gGlobalData;\r\nextern PayloadInfo  gPayloadData[];\r\nextern WCHAR *      gSupportedExts[];\r\nextern HWND         gHwndFrame;\r\nextern HWND         gHwndButtonExit;\r\nextern HWND         gHwndButtonInstUninst;\r\nextern HFONT        gFontDefault;\r\nextern WCHAR *      gMsgError;\r\nextern bool         gShowOptions;\r\nextern bool         gForceCrash;\r\nextern bool         gReproBug;\r\n\r\nextern Gdiplus::Color COLOR_MSG_WELCOME;\r\nextern Gdiplus::Color COLOR_MSG_OK;\r\nextern Gdiplus::Color COLOR_MSG_INSTALLATION;\r\nextern Gdiplus::Color COLOR_MSG_FAILED;\r\n\r\nvoid NotifyFailed(const WCHAR *msg);\r\nvoid SetMsg(const WCHAR *msg, Gdiplus::Color color);\r\nWCHAR *GetInstalledExePath();\r\nWCHAR *GetInstalledBrowserPluginPath();\r\nvoid OnCreateWindow(HWND hwnd);\r\nvoid ShowUsage();\r\nvoid CreateMainWindow();\r\nconst WCHAR *GetOwnPath();\r\nbool OnWmCommand(WPARAM wParam);\r\nbool CreateProcessHelper(const WCHAR *exe, const WCHAR *args=nullptr);\r\nWCHAR *GetUninstallerPath();\r\nint KillProcess(const WCHAR *processPath, bool waitUntilTerminated);\r\nvoid UninstallBrowserPlugin();\r\nvoid UninstallPdfFilter();\r\nvoid UninstallPdfPreviewer();\r\nvoid KillSumatra();\r\nWCHAR *GetShortcutPath(bool allUsers);\r\nvoid InvalidateFrame();\r\nbool CheckInstallUninstallPossible(bool silent=false);\r\nvoid CreateButtonExit(HWND hwndParent);\r\nvoid OnButtonExit();\r\nHWND CreateButton(HWND hwndParent, const WCHAR *s, int id, DWORD style, SIZE& sizeOut);\r\nHWND CreateDefaultButton(HWND hwndParent, const WCHAR *s, int id);\r\nSIZE SetButtonTextAndResize(HWND hwnd, const WCHAR * s);\r\nSIZE GetIdealButtonSize(HWND hwnd);\r\nint dpiAdjust(int value);\r\nvoid InstallPdfFilter();\r\nvoid InstallPdfPreviewer();\r\n\r\n#ifdef BUILD_UNINSTALLER\r\n\r\nbool ExecuteUninstallerFromTempDir();\r\nBOOL IsUninstallerNeeded();\r\nvoid OnUninstallationFinished();\r\nDWORD WINAPI UninstallerThread(LPVOID data);\r\n\r\n#else\r\n\r\nextern HWND gHwndButtonRunSumatra;\r\n\r\nbool IsValidInstaller();\r\nvoid OnInstallationFinished();\r\nbool IsPdfFilterInstalled();\r\nbool IsPdfPreviewerInstalled();\r\nDWORD WINAPI InstallerThread(LPVOID data);\r\n\r\n#endif\r\n"
  },
  {
    "path": "src/installer/Installer.rc",
    "content": "#include <windows.h>\r\n#include \"Resource.h\"\r\n#include \"../Version.h\"\r\n\r\nVS_VERSION_INFO    VERSIONINFO     MOVEABLE IMPURE LOADONCALL DISCARDABLE\r\n  FILEVERSION    VER_RESOURCE\r\n  PRODUCTVERSION VER_RESOURCE\r\n  FILEFLAGS     0\r\n  FILEOS        VOS_NT_WINDOWS32\r\n  FILETYPE      VFT_APP\r\n  FILESUBTYPE   0       // not used\r\nBEGIN\r\n  BLOCK \"StringFileInfo\"\r\n  BEGIN\r\n    BLOCK \"040904E4\"\r\n    //language ID = U.S. English, char set = Windows, Multilingual\r\n\r\n    BEGIN\r\n      VALUE \"FileDescription\",  \"SumatraPDF Installer\"\r\n      VALUE \"FileVersion\",      VER_RESOURCE_STR\r\n      VALUE \"LegalCopyright\",   COPYRIGHT_STR\r\n      VALUE \"OriginalFilename\", \"SumatraPDF-installer.exe\"\r\n      VALUE \"ProductName\",      \"SumatraPDF Installer\"\r\n      VALUE \"ProductVersion\",   VER_RESOURCE_STR\r\n      VALUE \"CompanyName\",      PUBLISHER_STR\r\n    END\r\n  END\r\n  BLOCK \"VarFileInfo\"\r\n  BEGIN\r\n    VALUE \"Translation\", 0x0409, 1252\r\n  END\r\nEND\r\n\r\nIDI_SUMATRAPDF          ICON                    \"..\\SumatraPDF-smaller.ico\"\r\n\r\n1                       RT_MANIFEST             \"Installer.exe.manifest\"\r\n\r\n#ifdef INSTALL_PAYLOAD_ZIP\r\n1                       RCDATA               QM(INSTALL_PAYLOAD_ZIP)\r\n#endif\r\n"
  },
  {
    "path": "src/installer/Resource.h",
    "content": "#define IDI_SUMATRAPDF                  1\r\n"
  },
  {
    "path": "src/installer/Trans_installer_txt.cpp",
    "content": "/*\n DO NOT EDIT MANUALLY !!!\n Generated by scripts\\trans_gen.py\n*/\n\n#include \"BaseUtil.h\"\n\nnamespace trans {\n\n#define LANGS_COUNT   53\n#define STRINGS_COUNT 43\n\nconst char *gOriginalStrings[STRINGS_COUNT] = {\n  \"&Options\",\n  \"Are you sure you want to uninstall SumatraPDF?\",\n  \"Close\",\n  \"Couldn't create temporary directory\",\n  \"Couldn't create the installation directory\",\n  \"Couldn't install PDF previewer\",\n  \"Couldn't install PDF search filter\",\n  \"Couldn't obtain temporary directory\",\n  \"Couldn't remove installation directory\",\n  \"Couldn't remove the shortcut\",\n  \"Couldn't uninstall PDF previewer\",\n  \"Couldn't uninstall PDF search filter\",\n  \"Couldn't uninstall browser plugin\",\n  \"Couldn't write %s to disk\",\n  \"Failed to copy uninstaller to temp directory\",\n  \"Failed to create a shortcut\",\n  \"Failed to delete uninstaller registry keys\",\n  \"Failed to register as default program on win 10\",\n  \"Failed to write the extended file extension information to the registry\",\n  \"Failed to write the uninstallation information to the registry\",\n  \"Hide &Options\",\n  \"Install SumatraPDF\",\n  \"Install SumatraPDF in &folder:\",\n  \"Installation failed!\",\n  \"Installation in progress...\",\n  \"Keep the PDF &browser plugin installed (no longer supported)\",\n  \"Let Windows Desktop Search &search PDF documents\",\n  \"Let Windows show &previews of PDF documents\",\n  \"Please close %s to proceed!\",\n  \"Select the folder where SumatraPDF should be installed:\",\n  \"Some files to be installed are damaged or missing\",\n  \"Start SumatraPDF\",\n  \"SumatraPDF %s Installer\",\n  \"SumatraPDF %s Uninstaller\",\n  \"SumatraPDF has been uninstalled.\",\n  \"SumatraPDF installation not found.\",\n  \"Thank you for choosing SumatraPDF!\",\n  \"Thank you! SumatraPDF has been installed.\",\n  \"The installer has been corrupted. Please download it again.\\nSorry for the inconvenience!\",\n  \"Uninstall SumatraPDF\",\n  \"Uninstallation failed\",\n  \"Uninstallation in progress...\",\n  \"Use SumatraPDF as the &default PDF reader\"\n};\n\nconst char **GetOriginalStrings() { return &gOriginalStrings[0]; }\n\n\nconst char * gTranslations_sq = \n  \"&Opsionet\\0\"\\\n  \"Jeni i sigurt se doni t\\303\\253 \\303\\247instaloni SumatraPDF?\\0\"\\\n  \"Mbyll\\0\"\\\n  \"Nuk mund t\\303\\253 krijoj\\303\\253 direktorin\\303\\253 e p\\303\\253rkohshme\\0\"\\\n  \"Nuk mund t\\303\\253 krijoj\\303\\253 direktorin\\303\\253 p\\303\\253r instalimin\\0\"\\\n  \"Nuk mund t\\303\\253 instaloj\\303\\253 parashikuesin e PDF-ve\\0\"\\\n  \"Nuk mund t\\303\\253 instaloj\\303\\253 k\\303\\253rkuesin e PDF-ve\\0\"\\\n  \"Nuk mund t\\303\\253 siguroj\\303\\253 direktorin\\303\\253 e p\\303\\253rkohshme\\0\"\\\n  \"Nuk mund t\\303\\253 heq\\303\\253 direktorin\\303\\253 e p\\303\\253rkohshme\\0\"\\\n  \"Nuk mund t\\303\\253 heq\\303\\253 shkurtoren\\0\"\\\n  \"Nuk mund t\\303\\253 \\303\\247instaloj\\303\\253 parashikuesin e PDF-ve\\0\"\\\n  \"Nuk mund t\\303\\253 \\303\\247instaloj\\303\\253 k\\303\\253rkuesin e PDF-ve\\0\"\\\n  \"Nuk mund t\\303\\253 \\303\\247instaloj\\303\\253 spin\\303\\253n p\\303\\253r shfletuesin\\0\"\\\n  \"Nuk mund t\\303\\253 shkruaj\\303\\253 %s n\\303\\253 disk\\0\"\\\n  \"D\\303\\253shtoi kopjimi i \\303\\247instaluesit te direktoria e p\\303\\253rkohshme\\0\"\\\n  \"D\\303\\253shtoi krijimi i shkurtores\\0\"\\\n  \"D\\303\\253shtoi fshirja e \\303\\247instaluesit nga regjistri\\0\"\\\n  \"\\0\"\\\n  \"D\\303\\253shtoi shkrimi n\\303\\253 regjist\\303\\253r i informacionit t\\303\\253 zgjeruar p\\303\\253r sked\\303\\253n.\\0\"\\\n  \"D\\303\\253shtoi shkrimi n\\303\\253 regjist\\303\\253r i informacionit p\\303\\253r \\303\\247instalimin\\0\"\\\n  \"Fsheh &opsionet\\0\"\\\n  \"Instaloj SumatraPDF\\0\"\\\n  \"Instaloj SumatraPDF n\\303\\253 &dosje:\\0\"\\\n  \"D\\303\\253shtoi instalimi!\\0\"\\\n  \"Instalimi vijon...\\0\"\\\n  \"\\0\"\\\n  \"Lejoj Windows Desktop Search t\\303\\253 &k\\303\\253rkoj\\303\\253 dokumentet PDF\\0\"\\\n  \"Lejoj Windows Desktop Search t\\303\\253 &parashikoj\\303\\253 dokumentet PDF\\0\"\\\n  \"Ju lutemi, mbyllni %s p\\303\\253r t\\303\\253 vazhduar!\\0\"\\\n  \"Seleksiononi dosjen ku do t\\303\\253 instalohet SumatraPDF:\\0\"\\\n  \"Jan\\303\\253 d\\303\\253mtuar ose mungojn\\303\\253 disa skeda q\\303\\253 do t\\303\\253 instalohen.\\0\"\\\n  \"Nis SumatraPDF\\0\"\\\n  \"Instaluesi i SumatraPDF %s\\0\"\\\n  \"\\303\\207instaluesi i SumatraPDF %s\\0\"\\\n  \"SumatraPDF u \\303\\247instalua\\0\"\\\n  \"Nuk u gjet SumatraPDF i instaluar.\\0\"\\\n  \"Faleminderit q\\303\\253 zgjodh\\303\\253t SumatraPDF!\\0\"\\\n  \"Faleminderit! SumatraPDF u instalua.\\0\"\\\n  \"Instaluesi ka t\\303\\253 meta. Ju lutemi, shkarkojeni edhe nj\\303\\253 her\\303\\253.\\nNa falni p\\303\\253r bezdin\\303\\253!\\0\"\\\n  \"\\303\\207instaloj SumatraPDF\\0\"\\\n  \"D\\303\\253shtoi \\303\\247instalimi\\0\"\\\n  \"\\303\\207instalimi vijon...\\0\"\\\n  \"P\\303\\253rdor SumatraPDF si lexuesin &standard t\\303\\253 PDF-ve\\0\";\n\nconst char * gTranslations_ar = \n  \"&\\330\\247\\331\\204\\330\\256\\331\\212\\330\\247\\330\\261\\330\\247\\330\\252\\0\"\\\n  \"\\330\\237  SumatraPDF \\331\\207\\331\\204 \\330\\247\\331\\206\\330\\252 \\331\\205\\330\\252\\330\\247\\331\\203\\330\\257 \\330\\252\\330\\261\\331\\212\\330\\257 \\331\\205\\330\\263\\330\\255 \\0\"\\\n  \"\\330\\245\\330\\272\\331\\204\\330\\247\\331\\202\\0\"\\\n  \"\\331\\204\\330\\247 \\331\\212\\331\\205\\331\\203\\331\\206 \\330\\245\\331\\206\\330\\264\\330\\247\\330\\241 \\330\\257\\331\\204\\331\\212\\331\\204 \\331\\205\\330\\244\\331\\202\\330\\252\\0\"\\\n  \"\\331\\204\\330\\247 \\331\\212\\331\\205\\331\\203\\331\\206 \\330\\245\\331\\206\\330\\264\\330\\247\\330\\241 \\330\\257\\331\\204\\331\\212\\331\\204 \\330\\247\\331\\204\\330\\252\\330\\253\\330\\250\\331\\212\\330\\252\\0\"\\\n  \"\\331\\204\\331\\205 \\330\\247\\330\\263\\330\\252\\330\\267\\330\\271 \\330\\252\\330\\253\\330\\250\\331\\212\\330\\252 \\331\\205\\330\\271\\330\\247\\331\\212\\331\\206 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251\\0\"\\\n  \"\\331\\204\\331\\205 \\330\\243\\330\\263\\330\\252\\330\\267\\330\\271 \\330\\252\\330\\253\\330\\250\\331\\212\\330\\252 \\330\\252\\330\\265\\331\\201\\331\\212\\330\\251 \\330\\250\\330\\255\\330\\253 \\330\\247\\331\\204\\331\\205\\331\\204\\331\\201\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251\\0\"\\\n  \"\\331\\204\\331\\205 \\330\\243\\330\\263\\330\\252\\330\\267\\330\\271 \\330\\247\\331\\204\\330\\255\\330\\265\\331\\210\\331\\204 \\330\\271\\331\\204\\331\\211 \\330\\247\\331\\204\\330\\257\\331\\204\\331\\212\\331\\204 \\330\\247\\331\\204\\331\\205\\330\\244\\331\\202\\330\\252\\0\"\\\n  \"\\331\\204\\330\\247 \\331\\212\\331\\205\\331\\203\\331\\206 \\330\\245\\330\\262\\330\\247\\331\\204\\330\\251 \\330\\257\\331\\204\\331\\212\\331\\204 \\330\\247\\331\\204\\330\\252\\330\\253\\330\\250\\331\\212\\330\\252\\0\"\\\n  \"\\331\\204\\330\\247 \\331\\212\\331\\205\\331\\203\\331\\206 \\330\\245\\330\\262\\330\\247\\331\\204\\330\\251 \\330\\247\\331\\204\\330\\247\\330\\256\\330\\252\\330\\265\\330\\247\\330\\261\\0\"\\\n  \"\\331\\204\\330\\247 \\331\\212\\331\\205\\331\\203\\331\\206 \\330\\245\\331\\204\\330\\272\\330\\247\\330\\241 \\330\\252\\330\\253\\330\\250\\331\\212\\330\\252 \\331\\205\\330\\271\\330\\247\\331\\212\\331\\206 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251\\0\"\\\n  \" \\331\\204\\330\\247 \\331\\212\\331\\205\\331\\203\\331\\206 \\330\\245\\331\\204\\330\\272\\330\\247\\330\\241 \\330\\252\\330\\253\\330\\250\\331\\212\\330\\252 \\330\\252\\330\\265\\331\\201\\331\\212\\330\\251 \\330\\250\\330\\255\\330\\253 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251 \\0\"\\\n  \"\\331\\204\\330\\247 \\331\\212\\331\\205\\331\\203\\331\\206 \\330\\245\\331\\204\\330\\272\\330\\247\\330\\241 \\330\\252\\330\\253\\330\\250\\331\\212\\330\\252 \\331\\205\\330\\252\\330\\265\\331\\201\\330\\255 \\330\\247\\331\\204\\330\\250\\330\\261\\331\\206\\330\\247\\331\\205\\330\\254 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\247\\330\\271\\330\\257\\0\"\\\n  \" \\330\\247\\331\\204\\331\\211 \\330\\247\\331\\204\\331\\202\\330\\261\\330\\265 %s \\331\\204\\330\\247 \\331\\212\\330\\263\\330\\252\\330\\267\\331\\212\\330\\271 \\330\\247\\331\\206 \\331\\212\\331\\203\\330\\252\\330\\250\\0\"\\\n  \"\\331\\201\\330\\264\\331\\204 \\331\\201\\331\\212 \\331\\206\\330\\263\\330\\256 \\330\\245\\331\\204\\330\\272\\330\\247\\330\\241 \\330\\247\\331\\204\\330\\252\\330\\253\\330\\250\\331\\212\\330\\252 \\330\\247\\331\\204\\331\\211 \\330\\247\\331\\204\\330\\257\\331\\204\\331\\212\\331\\204 \\330\\247\\331\\204\\331\\205\\330\\244\\331\\202\\330\\252\\0\"\\\n  \"\\331\\201\\330\\264\\331\\204 \\331\\201\\331\\212 \\330\\245\\331\\206\\330\\264\\330\\247\\330\\241 \\330\\261\\330\\247\\330\\250\\330\\267 \\330\\247\\330\\256\\330\\252\\330\\265\\330\\247\\330\\261 \\331\\204\\331\\204\\330\\250\\330\\261\\331\\206\\330\\247\\331\\205\\330\\254\\0\"\\\n  \"\\331\\201\\330\\264\\331\\204 \\331\\201\\331\\212 \\330\\255\\330\\260\\331\\201 \\331\\205\\331\\201\\330\\247\\330\\252\\331\\212\\330\\255 \\331\\205\\331\\203\\330\\252\\330\\250 \\330\\252\\330\\263\\330\\254\\331\\212\\331\\204 \\330\\245\\331\\204\\330\\272\\330\\247\\330\\241 \\330\\247\\331\\204\\330\\252\\330\\253\\330\\250\\331\\212\\330\\252\\0\"\\\n  \"\\0\"\\\n  \"\\331\\201\\330\\264\\331\\204 \\331\\201\\331\\212 \\331\\203\\330\\252\\330\\247\\330\\250\\330\\251 \\331\\205\\330\\271\\331\\204\\331\\210\\331\\205\\330\\247\\330\\252 \\330\\247\\331\\205\\330\\252\\330\\257\\330\\247\\330\\257 \\330\\247\\331\\204\\331\\205\\331\\204\\331\\201 \\330\\247\\331\\204\\331\\205\\331\\205\\330\\252\\330\\257\\330\\251 \\331\\204\\331\\205\\331\\203\\330\\252\\330\\250 \\330\\247\\331\\204\\330\\252\\330\\263\\330\\254\\331\\212\\331\\204\\0\"\\\n  \"\\331\\201\\330\\264\\331\\204 \\331\\201\\331\\212 \\331\\203\\330\\252\\330\\247\\330\\250\\330\\251 \\331\\205\\330\\271\\331\\204\\331\\210\\331\\205\\330\\247\\330\\252 \\330\\247\\331\\204\\330\\272\\330\\247\\330\\241 \\330\\247\\331\\204\\330\\252\\330\\253\\330\\250\\331\\212\\330\\252 \\330\\247\\331\\204\\331\\211 \\331\\205\\331\\203\\330\\252\\330\\250 \\330\\247\\331\\204\\330\\252\\330\\263\\330\\254\\331\\212\\331\\204\\0\"\\\n  \"\\330\\245\\330\\256\\331\\201\\330\\247\\330\\241 &\\330\\247\\331\\204\\330\\256\\331\\212\\330\\247\\330\\261\\330\\247\\330\\252\\0\"\\\n  \"\\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251 Sumatra \\330\\252\\330\\253\\330\\250\\331\\212\\330\\252 \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252\\0\"\\\n  \"\\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251 \\331\\201\\331\\212 \\330\\247\\331\\204\\331\\205\\330\\254\\331\\204\\330\\257 Sumatra \\330\\252\\330\\253\\330\\250\\331\\212\\330\\252 \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 :\\0\"\\\n  \"!\\331\\201\\330\\264\\331\\204 \\330\\247\\331\\204\\330\\252\\330\\253\\330\\250\\331\\212\\330\\252\\0\"\\\n  \"\\330\\247\\331\\204\\330\\252\\330\\253\\330\\250\\331\\212\\330\\252 \\331\\202\\331\\212\\330\\257 \\330\\247\\331\\204\\330\\252\\331\\202\\330\\257\\331\\205...\\0\"\\\n  \"(\\330\\247\\331\\204\\330\\255\\331\\201\\330\\247\\330\\270  \\330\\271\\331\\204\\331\\211 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251 \\331\\205\\330\\252\\330\\265\\331\\201\\330\\255 \\330\\247\\331\\204\\330\\250\\330\\261\\331\\206\\330\\247\\331\\205\\330\\254 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\247\\330\\271\\330\\257 \\330\\247\\331\\204\\331\\205\\330\\253\\330\\250\\330\\252 (\\331\\204\\331\\205 \\330\\252\\330\\271\\330\\257 \\331\\205\\330\\271\\330\\252\\331\\205\\330\\257\\330\\251\\0\"\\\n  \"\\330\\257\\330\\271 \\330\\247\\331\\204\\330\\250\\330\\255\\330\\253 \\331\\201\\331\\212 \\330\\263\\330\\267\\330\\255 \\331\\205\\331\\203\\330\\252\\330\\250 \\330\\247\\331\\204\\331\\210\\331\\206\\330\\257\\331\\210\\330\\262 &\\330\\247\\331\\204\\330\\250\\330\\255\\330\\253 \\331\\201\\331\\212 \\331\\210\\330\\253\\330\\247\\330\\246\\331\\202 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251\\0\"\\\n  \"\\330\\257\\330\\271 \\330\\247\\331\\204\\331\\210\\331\\206\\330\\257\\331\\210\\330\\262 \\330\\250\\330\\247\\330\\270\\331\\207\\330\\247\\330\\261 &\\331\\205\\330\\271\\330\\247\\331\\212\\331\\206\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\210\\330\\253\\330\\247\\330\\246\\331\\202 \\331\\205\\331\\206 \\330\\247\\331\\204\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251\\0\"\\\n  \" !\\330\\247\\331\\204\\331\\205\\330\\266\\331\\212 \\331\\202\\330\\257\\331\\205\\330\\247 %s \\330\\247\\331\\204\\330\\261\\330\\254\\330\\247\\330\\241 \\330\\247\\330\\272\\331\\204\\330\\247\\331\\202\\0\"\\\n  \"\\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251 Sumatra \\330\\255\\330\\257\\330\\257 \\330\\247\\331\\204\\331\\205\\330\\254\\331\\204\\330\\257 \\330\\255\\331\\212\\330\\253 \\331\\212\\330\\254\\330\\250 \\330\\243\\331\\206 \\331\\212\\331\\203\\331\\210\\331\\206 \\331\\205\\330\\253\\330\\250\\330\\252 \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 :\\0\"\\\n  \"\\330\\250\\330\\271\\330\\266 \\330\\247\\331\\204\\331\\205\\331\\204\\331\\201\\330\\247\\330\\252 \\330\\247\\331\\204\\330\\252\\331\\212 \\330\\263\\330\\252\\330\\253\\330\\250\\330\\252 \\331\\202\\330\\257  \\330\\252\\331\\203\\331\\210\\331\\206 \\330\\252\\330\\247\\331\\204\\331\\201\\330\\251 \\330\\243\\331\\210 \\331\\205\\331\\201\\331\\202\\331\\210\\330\\257\\330\\251\\0\"\\\n  \"\\330\\250\\330\\257\\330\\241 \\330\\252\\330\\264\\330\\272\\331\\212\\331\\204 \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 Sumatra  \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251\\0\"\\\n  \"\\330\\247\\331\\204\\331\\205\\330\\253\\330\\250\\330\\252%s \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251 Sumatra \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252\\0\"\\\n  \"\\330\\245\\331\\204\\330\\272\\330\\247\\330\\241  \\330\\252\\330\\253\\330\\250\\331\\212\\330\\252 %s \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251 Sumatra \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252\\0\"\\\n  \" \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 Sumatra \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251 \\330\\245\\331\\204\\330\\272\\330\\247\\330\\241 \\330\\252\\330\\253\\330\\250\\331\\212\\330\\252\\0\"\\\n  \"\\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 Sumatra \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251 \\331\\204\\331\\205 \\331\\212\\330\\252\\331\\205 \\330\\247\\331\\204\\330\\271\\330\\253\\331\\210\\330\\261 \\330\\271\\331\\204\\331\\211 \\330\\252\\330\\253\\330\\250\\331\\212\\330\\252\\0\"\\\n  \"\\331\\206\\330\\264\\331\\203\\330\\261\\331\\203\\331\\205 \\331\\204\\330\\247\\330\\256\\330\\252\\331\\212\\330\\247\\330\\261\\331\\203\\331\\205 \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 Sumatra \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251  \\0\"\\\n  \"\\330\\264\\331\\203\\330\\261\\330\\247! \\330\\252\\331\\205 \\330\\252\\330\\253\\330\\250\\331\\212\\330\\252  \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 Sumatra \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251  \\0\"\\\n  \"\\330\\247\\330\\263\\331\\201 \\331\\204\\331\\204\\330\\247\\330\\262\\330\\271\\330\\247\\330\\254! \\n . \\330\\252\\331\\205 \\330\\245\\330\\252\\331\\204\\330\\247\\331\\201 \\330\\247\\331\\204\\331\\205\\330\\253\\330\\250\\330\\252. \\330\\247\\331\\204\\330\\261\\330\\254\\330\\247\\330\\241 \\330\\252\\330\\255\\331\\205\\331\\212\\331\\204\\331\\207 \\331\\205\\330\\261\\330\\251 \\330\\243\\330\\256\\330\\261\\331\\211\\0\"\\\n  \"\\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251 Sumatra  \\330\\247\\331\\204\\330\\272\\330\\247\\330\\241 \\330\\252\\330\\253\\330\\250\\331\\212\\330\\252 \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252\\0\"\\\n  \"\\331\\201\\330\\264\\331\\204 \\330\\245\\331\\204\\330\\272\\330\\247\\330\\241 \\330\\247\\331\\204\\330\\252\\330\\253\\330\\250\\331\\212\\330\\252\\0\"\\\n  \"\\330\\245\\330\\262\\330\\247\\331\\204\\330\\251 \\330\\247\\331\\204\\330\\252\\330\\253\\330\\250\\331\\212\\330\\252 \\331\\202\\331\\212\\330\\257 \\330\\247\\331\\204\\330\\252\\331\\202\\330\\257\\331\\205...\\0\"\\\n  \" \\330\\247\\331\\204\\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251 \\330\\250\\330\\247\\330\\263\\331\\205& \\331\\202\\330\\247\\330\\261\\330\\246 \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252 \\331\\205\\330\\255\\331\\205\\331\\210\\331\\204\\330\\251 \\330\\247\\331\\201\\330\\252\\330\\261\\330\\247\\330\\266\\331\\212 Sumatra \\330\\247\\330\\263\\330\\252\\330\\256\\330\\257\\331\\205 \\331\\205\\330\\263\\330\\252\\331\\206\\330\\257\\330\\247\\330\\252\\0\";\n\nconst char * gTranslations_am = \n  \"&\\324\\270\\325\\266\\325\\277\\326\\200\\325\\241\\325\\266\\326\\204\\325\\266\\325\\245\\326\\200\\0\"\\\n  \"\\325\\200\\325\\241\\325\\264\\325\\270\\325\\246\\325\\276\\325\\241\\325\\236\\325\\256 \\325\\245\\326\\204, \\325\\270\\326\\200 \\326\\201\\325\\241\\325\\266\\325\\257\\325\\241\\325\\266\\325\\270\\326\\202\\325\\264 \\325\\245\\326\\204 \\325\\273\\325\\266\\325\\273\\325\\245\\325\\254 SumatraPDF-\\325\\250:\\0\"\\\n  \"\\325\\223\\325\\241\\325\\257\\325\\245\\325\\254\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\245\\325\\262\\325\\241\\325\\276 \\325\\275\\325\\277\\325\\245\\325\\262\\325\\256\\325\\245\\325\\254 \\325\\252\\325\\241\\325\\264\\325\\241\\325\\266\\325\\241\\325\\257\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\251\\325\\262\\325\\251\\325\\241\\325\\272\\325\\241\\325\\266\\325\\241\\325\\257\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\245\\325\\262\\325\\241\\325\\276 \\325\\275\\325\\277\\325\\245\\325\\262\\325\\256\\325\\245\\325\\254 \\325\\277\\325\\245\\325\\262\\325\\241\\325\\244\\326\\200\\325\\264\\325\\241\\325\\266 \\325\\251\\325\\262\\325\\251\\325\\241\\325\\272\\325\\241\\325\\266\\325\\241\\325\\257\\325\\250\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\245\\325\\262\\325\\241\\325\\276 \\325\\277\\325\\245\\325\\262\\325\\241\\325\\257\\325\\241\\325\\265\\325\\245\\325\\254 PDF-\\325\\253 \\325\\266\\325\\241\\325\\255\\325\\241\\325\\244\\325\\253\\325\\277\\325\\270\\326\\202\\325\\264\\325\\250\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\245\\325\\262\\325\\241\\325\\276 \\325\\277\\325\\245\\325\\262\\325\\241\\325\\257\\325\\241\\325\\265\\325\\245\\325\\254 PDF-\\325\\253 \\325\\270\\326\\200\\325\\270\\325\\266\\325\\264\\325\\241\\325\\266 \\325\\272\\325\\241\\325\\265\\325\\264\\325\\241\\325\\266\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\245\\325\\262\\325\\241\\325\\276 \\325\\275\\325\\277\\325\\241\\325\\266\\325\\241\\325\\254 \\325\\252\\325\\241\\325\\264\\325\\241\\325\\266\\325\\241\\325\\257\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\251\\325\\262\\325\\251\\325\\241\\325\\272\\325\\241\\325\\266\\325\\241\\325\\257\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\245\\325\\262\\325\\241\\325\\276 \\325\\273\\325\\266\\325\\273\\325\\245\\325\\254 \\325\\277\\325\\245\\325\\262\\325\\241\\325\\244\\326\\200\\325\\264\\325\\241\\325\\266 \\325\\251\\325\\262\\325\\251\\325\\241\\325\\272\\325\\241\\325\\266\\325\\241\\325\\257\\325\\250\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\245\\325\\262\\325\\241\\325\\276 \\325\\273\\325\\266\\325\\273\\325\\245\\325\\254 \\325\\272\\325\\253\\325\\277\\325\\241\\325\\257\\325\\250\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\245\\325\\262\\325\\241\\325\\276 \\325\\260\\325\\245\\325\\274\\325\\241\\326\\201\\325\\266\\325\\245\\325\\254 PDF-\\325\\253 \\325\\266\\325\\241\\325\\255\\325\\241\\325\\244\\325\\253\\325\\277\\325\\270\\326\\202\\325\\264\\325\\250\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\245\\325\\262\\325\\241\\325\\276 \\325\\260\\325\\245\\325\\274\\325\\241\\326\\201\\325\\266\\325\\245\\325\\254 PDF \\325\\270\\326\\200\\325\\270\\325\\266\\325\\264\\325\\241\\325\\266 \\325\\272\\325\\241\\325\\265\\325\\264\\325\\241\\325\\266\\325\\250\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\245\\325\\262\\325\\241\\325\\276 \\325\\260\\325\\245\\325\\274\\325\\241\\326\\201\\325\\266\\325\\245\\325\\254 \\325\\244\\325\\253\\325\\277\\325\\241\\326\\200\\325\\257\\325\\253\\325\\271\\325\\253 \\325\\242\\325\\241\\325\\262\\325\\241\\325\\244\\326\\200\\325\\253\\325\\271\\325\\250\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\247 \\325\\243\\326\\200\\325\\245\\325\\254 %s \\325\\272\\325\\266\\325\\241\\325\\257\\325\\270\\326\\202\\325\\264\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\245\\325\\262\\325\\241\\325\\276 \\325\\272\\325\\241\\325\\277\\325\\263\\325\\245\\325\\266\\325\\245\\325\\254 \\325\\273\\325\\266\\325\\273\\325\\253\\325\\271\\325\\250 \\325\\252\\325\\241\\325\\264\\325\\241\\325\\266\\325\\241\\325\\257\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\251\\325\\262\\325\\251\\325\\241\\325\\272\\325\\241\\325\\266\\325\\241\\325\\257\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\245\\325\\262\\325\\241\\325\\276 \\325\\275\\325\\277\\325\\245\\325\\262\\325\\256\\325\\245\\325\\254 \\325\\272\\325\\253\\325\\277\\325\\241\\325\\257\\325\\250\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\245\\325\\262\\325\\241\\325\\276 \\325\\273\\325\\266\\325\\273\\325\\245\\325\\254 \\324\\263\\326\\200\\325\\241\\325\\266\\326\\201\\325\\241\\325\\277\\325\\245\\325\\262\\325\\253\\325\\253 \\325\\242\\325\\241\\325\\266\\325\\241\\325\\254\\325\\253\\325\\266\\325\\245\\326\\200\\325\\250\\0\"\\\n  \"\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\245\\325\\262\\325\\241\\325\\276 \\326\\206\\325\\241\\325\\265\\325\\254\\325\\253 \\325\\250\\325\\266\\325\\244\\325\\254\\325\\241\\325\\265\\325\\266\\325\\264\\325\\241\\325\\266 \\325\\264\\325\\241\\325\\275\\325\\253\\325\\266 \\325\\243\\326\\200\\325\\241\\325\\274\\325\\245\\325\\254 \\324\\263\\326\\200\\325\\241\\325\\266\\326\\201\\325\\241\\325\\277\\325\\245\\325\\262\\325\\253\\325\\270\\326\\202\\325\\264\\0\"\\\n  \"\\324\\276\\326\\200\\325\\241\\325\\243\\325\\253\\326\\200\\325\\250 \\325\\260\\325\\245\\325\\274\\325\\241\\326\\201\\325\\266\\325\\245\\325\\254\\325\\270\\326\\202 \\325\\264\\325\\241\\325\\275\\325\\253\\325\\266 \\325\\243\\326\\200\\325\\241\\325\\274\\325\\270\\326\\202\\325\\264\\325\\250 \\325\\271\\325\\275\\325\\277\\325\\241\\326\\201\\325\\276\\325\\245\\326\\201 \\324\\263\\326\\200\\325\\241\\325\\266\\326\\201\\325\\241\\325\\277\\325\\245\\325\\262\\325\\253\\325\\270\\326\\202\\325\\264\\0\"\\\n  \"\\324\\271\\325\\241\\326\\204\\326\\201\\325\\266\\325\\245\\325\\254 &\\325\\250\\325\\266\\325\\277\\326\\200\\325\\241\\325\\266\\326\\204\\325\\266\\325\\245\\326\\200\\325\\250\\0\"\\\n  \"\\325\\217\\325\\245\\325\\262\\325\\241\\325\\257\\325\\241\\325\\265\\325\\245\\325\\254 SumatraPDF-\\325\\250\\0\"\\\n  \"\\325\\217\\325\\245\\325\\262\\325\\241\\325\\244\\326\\200\\325\\245\\325\\254 SumatraPDF-\\325\\250 &\\325\\260\\325\\245\\325\\277\\326\\207\\325\\265\\325\\241\\325\\254 \\325\\251\\325\\262\\325\\251\\325\\241\\325\\272\\325\\241\\325\\266\\325\\241\\325\\257\\325\\270\\326\\202\\325\\264\\325\\235\\0\"\\\n  \"\\325\\217\\325\\245\\325\\262\\325\\241\\325\\257\\325\\241\\325\\265\\325\\270\\326\\202\\325\\264\\325\\250 \\325\\261\\325\\241\\325\\255\\325\\270\\325\\262\\325\\276\\325\\245\\326\\201:\\0\"\\\n  \"\\324\\270\\325\\266\\325\\251\\325\\241\\326\\201\\326\\204\\325\\270\\326\\202\\325\\264 \\325\\247...\\0\"\\\n  \"\\324\\271\\325\\270\\325\\262\\325\\266\\325\\245\\325\\254 &\\325\\244\\325\\253\\325\\277\\325\\241\\326\\200\\325\\257\\325\\253\\325\\271\\325\\253 PDF \\325\\242\\325\\241\\325\\262\\325\\241\\325\\244\\326\\200\\325\\253\\325\\271\\325\\250 (\\325\\241\\325\\265\\325\\254\\326\\207\\325\\275 \\325\\271\\325\\253 \\325\\241\\325\\273\\325\\241\\325\\257\\326\\201\\325\\270\\326\\202\\325\\264)\\0\"\\\n  \"\\324\\271\\325\\270\\326\\202\\325\\265\\325\\254\\325\\241\\325\\277\\326\\200\\325\\245\\325\\254 Windows Desktop Search-\\325\\253\\325\\266 &PDF \\326\\206\\325\\241\\325\\265\\325\\254\\325\\245\\326\\200\\325\\253 \\325\\270\\326\\200\\325\\270\\325\\266\\325\\270\\326\\202\\325\\264\\325\\250\\0\"\\\n  \"\\324\\271\\325\\270\\326\\202\\325\\265\\325\\254\\325\\241\\325\\277\\326\\200\\325\\245\\325\\254 Windows-\\325\\253\\325\\266 &\\326\\201\\325\\270\\326\\202\\326\\201\\325\\241\\325\\244\\326\\200\\325\\245\\325\\254 PDF \\326\\206\\325\\241\\325\\265\\325\\254\\325\\245\\326\\200\\325\\253 \\325\\266\\325\\241\\325\\255\\325\\241\\325\\244\\325\\253\\325\\277\\325\\270\\326\\202\\325\\264\\325\\250\\0\"\\\n  \"\\325\\207\\325\\241\\326\\200\\325\\270\\326\\202\\325\\266\\325\\241\\325\\257\\325\\245\\325\\254\\325\\270\\326\\202\\326\\201 \\325\\241\\325\\274\\325\\241\\325\\273 \\326\\203\\325\\241\\325\\257\\325\\245\\326\\204 %s-\\325\\250:\\0\"\\\n  \"\\324\\270\\325\\266\\325\\277\\326\\200\\325\\245\\326\\204 \\325\\251\\325\\262\\325\\251\\325\\241\\325\\272\\325\\241\\325\\266\\325\\241\\325\\257\\325\\270\\326\\202\\325\\264, \\325\\270\\326\\200\\325\\277\\325\\245\\325\\262 \\325\\272\\325\\245\\325\\277\\326\\204 \\325\\247 \\325\\277\\325\\245\\325\\262\\325\\241\\325\\257\\325\\241\\325\\265\\325\\276\\325\\253 SumatraPDF-\\325\\250\\325\\235\\0\"\\\n  \"\\325\\217\\325\\245\\325\\262\\325\\241\\325\\257\\325\\241\\325\\265\\325\\276\\325\\270\\325\\262 \\325\\270\\326\\200\\325\\270\\325\\267 \\326\\206\\325\\241\\325\\265\\325\\254\\325\\245\\326\\200 \\325\\276\\325\\266\\325\\241\\325\\275\\325\\276\\325\\241\\325\\256 \\325\\245\\325\\266 \\325\\257\\325\\241\\325\\264 \\325\\242\\325\\241\\326\\201\\325\\241\\325\\257\\325\\241\\325\\265\\325\\270\\326\\202\\325\\264 \\325\\245\\325\\266\\0\"\\\n  \"\\324\\262\\325\\241\\326\\201\\325\\245\\325\\254 SumatraPDF-\\325\\250\\0\"\\\n  \"SumatraPDF %s-\\325\\250 \\325\\277\\325\\245\\325\\262\\325\\241\\325\\257\\325\\241\\325\\265\\325\\245\\325\\254\\325\\270\\326\\202 \\325\\256\\326\\200\\325\\241\\325\\243\\325\\253\\326\\200\\0\"\\\n  \"SumatraPDF %s-\\325\\250 \\325\\260\\325\\245\\325\\274\\325\\241\\326\\201\\325\\266\\325\\245\\325\\254\\325\\270\\326\\202 \\325\\256\\326\\200\\325\\241\\325\\243\\325\\253\\326\\200\\0\"\\\n  \"SumatraPDF-\\325\\250 \\325\\260\\325\\245\\325\\274\\325\\241\\326\\201\\325\\276\\325\\245\\325\\254 \\325\\247:\\0\"\\\n  \"SumatraPDF-\\325\\250 \\325\\271\\325\\253 \\325\\243\\325\\277\\325\\266\\325\\276\\325\\245\\325\\254:\\0\"\\\n  \"\\325\\207\\325\\266\\325\\270\\326\\200\\325\\260\\325\\241\\325\\257\\325\\241\\325\\254\\325\\270\\326\\202\\325\\251\\325\\265\\325\\270\\326\\202\\325\\266 SumatraPDF-\\325\\250 \\325\\266\\325\\241\\325\\255\\325\\250\\325\\266\\325\\277\\326\\200\\325\\245\\325\\254\\325\\270\\326\\202 \\325\\260\\325\\241\\325\\264\\325\\241\\326\\200:\\0\"\\\n  \"\\325\\207\\325\\266\\325\\270\\326\\200\\325\\260\\325\\241\\325\\257\\325\\241\\325\\254\\325\\270\\326\\202\\325\\251\\325\\265\\325\\270\\326\\202\\325\\266: SumatraPDF-\\325\\250 \\325\\277\\325\\245\\325\\262\\325\\241\\325\\244\\326\\200\\325\\276\\325\\245\\325\\254 \\325\\247:\\0\"\\\n  \"\\324\\276\\326\\200\\325\\241\\325\\243\\326\\200\\325\\253 \\325\\277\\325\\245\\325\\262\\325\\241\\325\\244\\326\\200\\325\\253\\325\\271\\325\\250 \\325\\276\\325\\266\\325\\241\\325\\275\\325\\276\\325\\241\\325\\256 \\325\\247: \\324\\277\\326\\200\\325\\257\\325\\253\\325\\266 \\325\\242\\325\\245\\325\\274\\325\\266\\325\\245\\326\\204 \\325\\241\\325\\265\\325\\266:\\n\\325\\200\\325\\241\\325\\265\\326\\201\\325\\270\\326\\202\\325\\264 \\325\\245\\325\\266\\326\\204 \\325\\201\\325\\245\\326\\200 \\325\\266\\325\\245\\326\\200\\325\\270\\325\\262\\325\\241\\325\\264\\325\\277\\325\\270\\326\\202\\325\\251\\325\\265\\325\\270\\326\\202\\325\\266\\325\\250:\\0\"\\\n  \"\\325\\213\\325\\266\\325\\273\\325\\245\\325\\254 SumatraPDF-\\325\\250\\0\"\\\n  \"\\325\\200\\325\\266\\325\\241\\326\\200\\325\\241\\325\\276\\325\\270\\326\\200 \\325\\271\\325\\245\\325\\262\\325\\241\\325\\276 \\325\\260\\325\\245\\325\\274\\325\\241\\326\\201\\325\\266\\325\\245\\325\\254 \\325\\256\\326\\200\\325\\241\\325\\243\\325\\253\\326\\200\\325\\250\\0\"\\\n  \"\\324\\276\\326\\200\\325\\241\\325\\243\\325\\253\\326\\200\\325\\250 \\325\\260\\325\\245\\325\\274\\325\\241\\326\\201\\325\\276\\325\\270\\326\\202\\325\\264 \\325\\247...\\0\"\\\n  \"\\325\\225\\325\\243\\325\\277. SumatraPDF-\\325\\250 \\325\\270\\326\\200\\325\\272\\325\\245\\325\\275 &PDF-\\325\\253 \\325\\260\\325\\253\\325\\264\\325\\266\\325\\241\\325\\257\\325\\241\\325\\266 \\325\\256\\326\\200\\325\\241\\325\\243\\325\\253\\326\\200\\0\";\n\nconst char * gTranslations_az = \n  \"&Se\\303\\247iml\\311\\231r\\0\"\\\n  \"\\306\\217minsiniz ki, SumatraPDF-i silm\\311\\231k ist\\311\\231yirsiniz?\\0\"\\\n  \"Ba\\304\\237la\\0\"\\\n  \"M\\303\\274v\\311\\231qq\\311\\231ti qovlu\\304\\237u yaratmaq m\\303\\274mk\\303\\274n olmad\\304\\261\\0\"\\\n  \"Qura\\305\\237d\\304\\261rma qovlu\\304\\237unu yaratmaq m\\303\\274mk\\303\\274n olmad\\304\\261\\0\"\\\n  \"PDF \\303\\266nbax\\304\\261\\305\\237 al\\311\\231tini qura\\305\\237d\\304\\261rmaq m\\303\\274mk\\303\\274n olmad\\304\\261\\0\"\\\n  \"PDF axtar\\304\\261\\305\\237 filtrini qura\\305\\237d\\304\\261rmaq m\\303\\274mk\\303\\274n olmad\\304\\261\\0\"\\\n  \"M\\303\\274v\\311\\231qq\\311\\231ti qovlu\\304\\237u t\\311\\231yin etm\\311\\231k m\\303\\274mk\\303\\274n olmad\\304\\261\\0\"\\\n  \"Qura\\305\\237d\\304\\261rma qovlu\\304\\237unu silm\\311\\231k m\\303\\274mk\\303\\274n olmad\\304\\261\\0\"\\\n  \"Yarl\\304\\261\\304\\237\\304\\261 silm\\311\\231k m\\303\\274mk\\303\\274n olmad\\304\\261\\0\"\\\n  \"PDF \\303\\266nbax\\304\\261\\305\\237 al\\311\\231tini silm\\311\\231k m\\303\\274mk\\303\\274n olmad\\304\\261\\0\"\\\n  \"PDF axtar\\304\\261\\305\\237 filtrini silm\\311\\231k m\\303\\274mk\\303\\274n olmad\\304\\261\\0\"\\\n  \"Brauzer plaginini silm\\311\\231k m\\303\\274mk\\303\\274n olmad\\304\\261\\0\"\\\n  \"%s disk\\311\\231 yaz\\304\\261la bilm\\311\\231di\\0\"\\\n  \"Deinstalyatoru m\\303\\274v\\311\\231qq\\311\\231ti qovlu\\304\\237a kopyalamaq m\\303\\274mk\\303\\274n olmad\\304\\261\\0\"\\\n  \"Yarl\\304\\261k yaratmaq m\\303\\274mk\\303\\274n olmad\\304\\261\\0\"\\\n  \"Deinstalyatorun reyestr a\\303\\247arlar\\304\\261n\\304\\261 silm\\311\\231k m\\303\\274mk\\303\\274n olmad\\304\\261\\0\"\\\n  \"\\0\"\\\n  \"Fayl\\304\\261n geni\\305\\237liyi haqq\\304\\261nda \\311\\231trafl\\304\\261 m\\311\\231lumat\\304\\261 reyestr\\311\\231 yazmaq m\\303\\274mk\\303\\274n olmad\\304\\261\\0\"\\\n  \"Deinstalyasiya m\\311\\231lumat\\304\\261n\\304\\261 reyestr\\311\\231 yazmaq m\\303\\274mk\\303\\274n olmad\\304\\261\\0\"\\\n  \"&Se\\303\\247iml\\311\\231ri gizl\\311\\231t\\0\"\\\n  \"SumatraPDF-i qura\\305\\237d\\304\\261r\\0\"\\\n  \"SumatraPDF-i bu &qovluqda qura\\305\\237d\\304\\261r:\\0\"\\\n  \"Qura\\305\\237d\\304\\261rma ba\\305\\237 tutmad\\304\\261!\\0\"\\\n  \"Qura\\305\\237d\\304\\261rma davam edir...\\0\"\\\n  \"PDF &brauzer plaginini silm\\311\\231 (art\\304\\261q d\\311\\231st\\311\\231kl\\311\\231nmir)\\0\"\\\n  \"PDF s\\311\\231n\\311\\231dl\\311\\231rini Windows Desktop Search vasit\\311\\231sil\\311\\231 a&xtar\\0\"\\\n  \"PDF s\\311\\231n\\311\\231dl\\311\\231rini Windows al\\311\\231tl\\311\\231ri vasit\\311\\231sil\\311\\231 &g\\303\\266r\\303\\274nt\\303\\274l\\311\\231\\0\"\\\n  \"Davam etm\\311\\231k \\303\\274\\303\\247\\303\\274n %s ba\\304\\237lay\\304\\261n!\\0\"\\\n  \"SumatraPDF-in qura\\305\\237d\\304\\261r\\304\\261laca\\304\\237\\304\\261 qovlu\\304\\237u se\\303\\247in:\\0\"\\\n  \"B\\311\\231zi qura\\305\\237d\\304\\261r\\304\\261lacaq fayllar z\\311\\231d\\311\\231l\\311\\231nmi\\305\\237dir v\\311\\231 ya yoxdur\\0\"\\\n  \"SumatraPDF-i i\\305\\237\\311\\231 sal\\0\"\\\n  \"SumatraPDF qura\\305\\237d\\304\\261r\\304\\261c\\304\\261s\\304\\261 %s\\0\"\\\n  \"SumatraPDF deinstalyatoru %s\\0\"\\\n  \"SumatraPDF silindi.\\0\"\\\n  \"SumatraPDF qura\\305\\237d\\304\\261rmas\\304\\261 tap\\304\\261lmad\\304\\261.\\0\"\\\n  \"SumatraPDF-i se\\303\\247diyiniz \\303\\274\\303\\247\\303\\274n t\\311\\231\\305\\237\\311\\231kk\\303\\274r edirik!\\0\"\\\n  \"T\\311\\231\\305\\237\\311\\231kk\\303\\274rl\\311\\231r! SumatraPDF qura\\305\\237d\\304\\261r\\304\\261ld\\304\\261.\\0\"\\\n  \"Qura\\305\\237d\\304\\261r\\304\\261c\\304\\261 z\\311\\231d\\311\\231l\\311\\231nmi\\305\\237dir. L\\303\\274tf\\311\\231n onu t\\311\\231krar endirin.\\nNarahat\\303\\247\\304\\261l\\304\\261\\304\\237a g\\303\\266r\\311\\231 \\303\\274zr ist\\311\\231yirik!\\0\"\\\n  \"SumatraPDF-i sil\\0\"\\\n  \"Deinstalyasiya ba\\305\\237 tutmad\\304\\261\\0\"\\\n  \"Deinstalyasiya davam edir...\\0\"\\\n  \"SumatraPDF &standart PDF oxuyucusu kimi istifad\\311\\231 olunsun\\0\";\n\nconst char * gTranslations_eu = \n  \"A&ukerak\\0\"\\\n  \"Zihur zaude SumatraPDF kentzea nahi duzula?\\0\"\\\n  \"Itxi\\0\"\\\n  \"Ezinezkoa aldibaterako zuzenbidea sortzea\\0\"\\\n  \"Ezinezkoa ezarpen zuzenbidea sortzea\\0\"\\\n  \"Ezinezkoa PDF aurreikustatzailea ezartzea\\0\"\\\n  \"Ezinezkoa PDF bilaketa iragazkia ezartzea\\0\"\\\n  \"Ezinezkoa aldibaterako zuzenbidea lortzea\\0\"\\\n  \"Ezinezkoa ezarpen zuzenbidea kentzea\\0\"\\\n  \"Ezinezkoa lastertekla kentzea\\0\"\\\n  \"Ezinezkoa PDF aurreikustatzailea kentzea\\0\"\\\n  \"Ezinezkoa PDF bilaketa iragazkia kentzea\\0\"\\\n  \"Ezinezkoa nabigatzaile plugina kentzea\\0\"\\\n  \"Ezinezkoa %s diskara idaztea\\0\"\\\n  \"Hutsegitea kentzailea aldibaterako zuzenbidra kopiatzerakoan\\0\"\\\n  \"Hutsegitea lasterbidea sortzerakoan\\0\"\\\n  \"Hutsegitea kentzaile erregistro giltzak ezabatzerakoan\\0\"\\\n  \"\\0\"\\\n  \"Hutsegitea agiri hedatu hedapen argibideak erregistroan idazterakoan\\0\"\\\n  \"Hutsegitea kentze argibideak erregistroan idazterakoan\\0\"\\\n  \"Ezkuta A&ukerak\\0\"\\\n  \"Ezarri SumatraPDF\\0\"\\\n  \"Ezarri Su&matraPDF agiritegi honetan:\\0\"\\\n  \"Ezarpen hutsegitea!\\0\"\\\n  \"Ezarpena garatzen...\\0\"\\\n  \"Eduki PDF &nabigatzaile plugina ezarrita (sostengu gabe aurrerantzean)\\0\"\\\n  \"&Utzi Windows Mahaigain Bilaketari PDF agiriak bilatzen\\0\"\\\n  \"Utzi &Windowsi PDF agirien aurreikuspenak erakusten\\0\"\\\n  \"Mesedez itxi %s jarraitzeko!\\0\"\\\n  \"Hautatu SumatraPDF ezarri behar den agiritegia:\\0\"\\\n  \"Ezarritako zenbait agiri hondatuta edo galduta daude\\0\"\\\n  \"Abiarazi SumatraPDF\\0\"\\\n  \"SumatraPDF %s Ezartzailea\\0\"\\\n  \"SumatraPDF %s Kentzailea\\0\"\\\n  \"SumatraPDF kendu da.\\0\"\\\n  \"SumatraPDF ezarpena ez da aurkitu.\\0\"\\\n  \"Mila esker SumatraPDF hautatzeagaitik!\\0\"\\\n  \"Mila esker! SumatraPDF ezarri da.\\0\"\\\n  \"Ezartzailea hondatuta dago. Mesedez jeitsi berriro.\\nBarkatu eragozpenagaitik!\\0\"\\\n  \"Kendu SumatraPDF\\0\"\\\n  \"Kentze hutsegitea\\0\"\\\n  \"Kentzea garatzen...\\0\"\\\n  \"Erabili SumatraP&DF berezko PDF irakurtzaile bezala\\0\";\n\nconst char * gTranslations_bs = \n  \"&Opcije\\0\"\\\n  \"Da li ste sigurni da \\305\\276elite deinstalirati SumatraPDF?\\0\"\\\n  \"Zatvori\\0\"\\\n  \"Neuspje\\305\\241no kreiranje privremenog direktorija\\0\"\\\n  \"Neuspje\\305\\241no kreiranje instalacijskog direktorija\\0\"\\\n  \"Neuspje\\305\\241no instaliranje PDF preglednika\\0\"\\\n  \"Neuspje\\305\\241no instaliranje filtera za pretragu PDF-ova\\0\"\\\n  \"Neuspje\\305\\241no dobavljanje privremenog direktorija\\0\"\\\n  \"Neuspje\\305\\241no uklanjanje instalacijskog direktorija\\0\"\\\n  \"Neuspje\\305\\241no uklanjanje kratice\\0\"\\\n  \"Neuspje\\305\\241na deinstalacija PDF preglednika\\0\"\\\n  \"Neuspje\\305\\241na deinstalacija filtera za pretragu PDF-ova\\0\"\\\n  \"Neuspje\\305\\241na instalacija plugina za browser\\0\"\\\n  \"Neuspje\\305\\241no zapisivanje %s na disk\\0\"\\\n  \"Neuspje\\305\\241no kopiranje deinstalera u privremeni direktorij\\0\"\\\n  \"Neuspje\\305\\241no kreiranje kratice\\0\"\\\n  \"Neuspje\\305\\241no brisanje registarskih klju\\304\\215eva deinstalera\\0\"\\\n  \"\\0\"\\\n  \"Neuspje\\305\\241no zapisivanje informacije o ekstenziji pro\\305\\241irenog fajla u registar\\0\"\\\n  \"Neuspje\\305\\241no zapisivanje deinstalacijske informacije u registar\\0\"\\\n  \"Sakrij &opcije\\0\"\\\n  \"Instaliraj SumatraPDF\\0\"\\\n  \"Instaliraj SumatraPDF u &direktorij:\\0\"\\\n  \"Neuspje\\305\\241na instalacija!\\0\"\\\n  \"Instalacija u toku...\\0\"\\\n  \"Ostavi plugin instaliran u &browseru (vi\\305\\241e nije podr\\305\\276ano)\\0\"\\\n  \"Omogu\\304\\207i Windows Desktop Search-u da &pretra\\305\\276uje PDF dokumente\\0\"\\\n  \"Omogu\\304\\207i Windows-ima da prika\\305\\276u &pregled PDF dokumenata\\0\"\\\n  \"Molimo da zatvorite %s za nastavak!\\0\"\\\n  \"Izaberite direktorij gdje bi SumatraPDF trebao biti instaliran:\\0\"\\\n  \"Neki fajlovi koji bi trebali biti instalirani su ili o\\305\\241te\\304\\207eni ili nedostaju\\0\"\\\n  \"Pokreni SumatraPDF\\0\"\\\n  \"SumatraPDF %s instaler\\0\"\\\n  \"SumatraPDF %s deinstaler\\0\"\\\n  \"SumatraPDF je deinstaliran.\\0\"\\\n  \"SumatraPDF instalacija nije prona\\304\\221ena.\\0\"\\\n  \"Hvala Vam \\305\\241to ste izabrali SumatraPDF!\\0\"\\\n  \"Hvala Vam! SumatraPDF je instaliran.\\0\"\\\n  \"Instaler je o\\305\\241te\\304\\207en. Molimo da ga ponovo preuzmete.\\nOprostite zbog neugodnosti!\\0\"\\\n  \"Deinstaliraj SumatraPDF\\0\"\\\n  \"Neuspje\\305\\241na deinstalacija\\0\"\\\n  \"Deinstalacija u toku ...\\0\"\\\n  \"Koristi SumatraPDF kao &izvorni PDF \\304\\215ita\\304\\215\\0\";\n\nconst char * gTranslations_bg = \n  \"\\0\"\\\n  \"\\320\\235\\320\\260\\320\\270\\321\\201\\321\\202\\320\\270\\320\\275\\320\\260 \\320\\273\\320\\270 \\320\\270\\321\\201\\320\\272\\320\\260\\321\\202\\320\\265 \\320\\264\\320\\260 \\320\\264\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\321\\202\\320\\265 SumatraPDF ?\\0\"\\\n  \"\\320\\227\\320\\260\\321\\202\\320\\262\\320\\260\\321\\200\\321\\217\\320\\275\\320\\265\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\265 \\320\\264\\320\\260 \\321\\201\\320\\265 \\321\\201\\321\\212\\320\\267\\320\\264\\320\\260\\320\\264\\320\\265 \\320\\262\\321\\200\\320\\265\\320\\274\\320\\265\\320\\275\\320\\275\\320\\260 \\320\\264\\320\\270\\321\\200\\320\\265\\320\\272\\321\\202\\320\\276\\321\\200\\320\\270\\321\\217\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\265 \\320\\264\\320\\260 \\321\\201\\320\\265 \\321\\201\\321\\212\\320\\267\\320\\264\\320\\260\\320\\264\\320\\265 \\320\\264\\320\\270\\321\\200\\320\\265\\320\\272\\321\\202\\320\\276\\321\\200\\320\\270\\321\\217 \\320\\267\\320\\260\\302\\240\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\321\\217\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\320\\260\\321\\202\\320\\260 \\320\\267\\320\\260 \\320\\277\\321\\200\\320\\265\\320\\263\\320\\273\\320\\265\\320\\264 \\320\\275\\320\\260 PDF \\321\\204\\320\\260\\320\\271\\320\\273\\320\\276\\320\\262\\320\\265 \\320\\275\\320\\265 \\321\\201\\320\\265 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\260 \\320\\264\\320\\260 \\321\\201\\320\\265 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260 PDF \\321\\204\\320\\270\\320\\273\\321\\202\\321\\212\\321\\200 \\320\\267\\320\\260 \\321\\202\\321\\212\\321\\200\\321\\201\\320\\265\\320\\275\\320\\265\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\260 \\320\\264\\320\\260 \\321\\201\\320\\265 \\320\\277\\320\\276\\320\\273\\321\\203\\321\\207\\320\\270 \\320\\262\\321\\200\\320\\265\\320\\274\\320\\265\\320\\275\\320\\275\\320\\260 \\320\\264\\320\\270\\321\\200\\320\\265\\320\\272\\321\\202\\320\\276\\321\\200\\320\\270\\321\\217\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\260 \\320\\264\\320\\260 \\321\\201\\320\\265 \\320\\270\\320\\267\\321\\202\\321\\200\\320\\270\\320\\265 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\320\\276\\320\\275\\320\\275\\320\\260\\321\\202\\320\\260 \\320\\264\\320\\270\\321\\200\\320\\265\\320\\272\\321\\202\\320\\276\\321\\200\\320\\270\\321\\217\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\260 \\320\\264\\320\\260 \\321\\201\\320\\265 \\320\\270\\320\\267\\321\\202\\321\\200\\320\\270\\320\\265 \\320\\272\\320\\276\\320\\274\\320\\260\\320\\275\\320\\264\\320\\260\\321\\202\\320\\260 \\320\\267\\320\\260 \\320\\261\\321\\212\\321\\200\\320\\267 \\320\\264\\320\\276\\321\\201\\321\\202\\321\\212\\320\\277\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\320\\260\\321\\202\\320\\260 \\320\\267\\320\\260 \\320\\277\\321\\200\\320\\265\\320\\263\\320\\273\\320\\265\\320\\264 \\320\\275\\320\\260 PDF \\321\\204\\320\\260\\320\\271\\320\\273\\320\\276\\320\\262\\320\\265 \\320\\275\\320\\265 \\320\\265 \\320\\277\\321\\200\\320\\265\\320\\274\\320\\260\\321\\205\\320\\275\\320\\260\\321\\202\\320\\260.\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\265 \\320\\264\\320\\260 \\320\\264\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\321\\202\\320\\265 PDF \\321\\204\\320\\270\\320\\273\\321\\202\\321\\212\\321\\200 \\320\\267\\320\\260 \\321\\202\\321\\212\\321\\200\\321\\201\\320\\265\\320\\275\\320\\265\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\265 \\320\\264\\320\\260 \\320\\264\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\321\\202\\320\\265 \\320\\277\\320\\273\\321\\212\\320\\263\\320\\270\\320\\275\\320\\260 \\320\\267\\320\\260 \\320\\261\\321\\200\\320\\260\\321\\203\\320\\267\\321\\212\\321\\200\\320\\260\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\260 \\320\\264\\320\\260 \\321\\201\\320\\265 \\320\\267\\320\\260\\320\\277\\320\\270\\321\\210\\320\\265 %s \\320\\275\\320\\260 \\320\\264\\320\\270\\321\\201\\320\\272\\320\\260\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\265 \\320\\264\\320\\260 \\321\\201\\320\\265 \\320\\272\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260 \\320\\264\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\202\\320\\276\\321\\200\\320\\260 \\320\\262\\321\\212\\320\\262 \\320\\262\\321\\200\\320\\265\\320\\274\\320\\265\\320\\275\\320\\275\\320\\260\\321\\202\\320\\260 \\320\\264\\320\\270\\321\\200\\320\\265\\320\\272\\321\\202\\320\\276\\321\\200\\320\\270\\321\\217\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\265 \\320\\264\\320\\260 \\321\\201\\320\\265 \\321\\201\\321\\212\\320\\267\\320\\264\\320\\260\\320\\264\\320\\265\\302\\240\\320\\272\\320\\276\\320\\274\\320\\260\\320\\275\\320\\264\\320\\260\\321\\202\\320\\260 \\320\\267\\320\\260 \\320\\261\\321\\212\\321\\200\\320\\267 \\320\\264\\320\\276\\321\\201\\321\\202\\321\\212\\320\\277\\0\"\\\n  \"\\320\\235\\320\\265\\321\\203\\321\\201\\320\\277\\320\\265\\321\\210\\320\\275\\320\\276 \\320\\270\\320\\267\\321\\202\\321\\200\\320\\270\\320\\262\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 \\320\\272\\320\\273\\321\\216\\321\\207\\320\\276\\320\\262\\320\\265\\321\\202\\320\\265 \\320\\275\\320\\260 \\320\\264\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\202\\320\\276\\321\\200\\320\\260 \\320\\262 \\321\\200\\320\\265\\320\\263\\320\\270\\321\\201\\321\\202\\321\\212\\321\\200\\320\\260\\0\"\\\n  \"\\0\"\\\n  \"\\320\\230\\320\\275\\321\\204\\320\\276\\321\\200\\320\\274\\320\\260\\321\\206\\320\\270\\321\\217 \\320\\267\\320\\260 \\321\\200\\320\\260\\320\\267\\321\\210\\320\\270\\321\\200\\320\\265\\320\\275\\320\\270\\320\\265\\321\\202\\320\\276 \\320\\267\\320\\260 \\320\\270\\320\\267\\320\\277\\321\\212\\320\\273\\320\\275\\320\\270\\321\\202\\320\\265\\320\\273\\320\\275\\320\\270 \\321\\204\\320\\260\\320\\271\\320\\273\\320\\276\\320\\262\\320\\265 \\320\\275\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\265 \\320\\264\\320\\260 \\321\\201\\320\\265 \\320\\262\\320\\272\\320\\260\\321\\200\\320\\260 \\320\\262 \\321\\200\\320\\265\\320\\263\\320\\270\\321\\201\\321\\202\\321\\212\\321\\200\\320\\260. \\0\"\\\n  \"\\320\\230\\320\\275\\321\\204\\320\\276\\321\\200\\320\\274\\320\\260\\321\\206\\320\\270\\321\\217\\321\\202\\320\\260 \\320\\267\\320\\260 \\320\\277\\321\\200\\320\\265\\320\\274\\320\\260\\321\\205\\320\\262\\320\\260\\320\\275\\320\\265\\321\\202\\320\\276 \\320\\275\\320\\260 \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\320\\260\\321\\202\\320\\260 \\320\\275\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\265 \\320\\264\\320\\260 \\321\\201\\320\\265 \\320\\262\\320\\277\\320\\270\\321\\210\\320\\265 \\320\\262 \\321\\200\\320\\265\\320\\263\\320\\270\\321\\201\\321\\202\\321\\212\\321\\200\\320\\260.\\0\"\\\n  \"\\320\\241\\320\\272\\321\\200\\320\\270\\320\\270 &\\320\\236\\320\\277\\321\\206\\320\\270\\320\\270\\0\"\\\n  \"\\320\\230\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 SumatraPDF\\0\"\\\n  \"\\320\\230\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\320\\270 SumatraPDF \\320\\262\\321\\212\\320\\262 &\\320\\277\\320\\260\\320\\277\\320\\272\\320\\260\\0\"\\\n  \"\\320\\230\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\321\\217\\321\\202\\320\\260 \\320\\261\\320\\265\\321\\210\\320\\265 \\320\\275\\320\\265\\321\\203\\321\\201\\320\\277\\320\\265\\321\\210\\320\\275\\320\\260!\\0\"\\\n  \"\\320\\230\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\320\\275\\320\\265...\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"\\320\\234\\320\\276\\320\\273\\321\\217 \\320\\270\\320\\267\\320\\261\\320\\265\\321\\200\\320\\265\\321\\202\\320\\265 %s \\320\\267\\320\\260 \\320\\264\\320\\260 \\320\\277\\321\\200\\320\\276\\320\\264\\321\\212\\320\\273\\320\\266\\320\\270\\321\\202\\320\\265!\\0\"\\\n  \"\\320\\230\\320\\267\\320\\261\\320\\265\\321\\200\\320\\265\\321\\202\\320\\265 \\320\\277\\320\\260\\320\\277\\320\\272\\320\\260\\321\\202\\320\\260, \\320\\262 \\320\\272\\320\\276\\321\\217\\321\\202\\320\\276 \\320\\264\\320\\260 \\321\\201\\320\\265 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260 SumatraPDF:\\0\"\\\n  \"\\320\\235\\321\\217\\320\\272\\320\\276\\320\\270 \\321\\204\\320\\260\\320\\271\\320\\273\\320\\276\\320\\262\\320\\265 \\320\\272\\320\\276\\320\\270\\321\\202\\320\\276 \\321\\201\\320\\260 \\320\\275\\321\\203\\320\\266\\320\\275\\320\\270 \\320\\267\\320\\260 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\321\\217\\321\\202\\320\\260 \\321\\201\\320\\260 \\320\\277\\320\\276\\320\\262\\321\\200\\320\\265\\320\\264\\320\\265\\320\\275\\320\\270 \\320\\270\\320\\273\\320\\270 \\320\\273\\320\\270\\320\\277\\321\\201\\320\\262\\320\\260\\321\\202\\0\"\\\n  \"\\320\\241\\321\\202\\320\\260\\321\\200\\321\\202\\320\\270\\321\\200\\320\\260\\320\\270 SumatraPDF\\0\"\\\n  \"\\0\"\\\n  \"\\0\"\\\n  \"SumatraPDF \\320\\265 \\320\\277\\321\\200\\320\\265\\320\\274\\320\\260\\321\\205\\320\\275\\320\\260\\321\\202.\\0\"\\\n  \"\\0\"\\\n  \"\\320\\221\\320\\273\\320\\260\\320\\263\\320\\276\\320\\264\\320\\260\\321\\200\\321\\217 \\321\\207\\320\\265 \\320\\270\\320\\267\\320\\261\\321\\200\\320\\260\\321\\205\\321\\202\\320\\265 SumatraPDF!\\0\"\\\n  \"\\320\\221\\320\\273\\320\\260\\320\\263\\320\\276\\320\\264\\320\\260\\321\\200\\321\\217 \\320\\262\\320\\270! SumatraPDF \\320\\262\\320\\265\\321\\207\\320\\265 \\320\\265 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\320\\275.\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\320\\260\\321\\202\\320\\260 \\320\\267\\320\\260 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\320\\275\\320\\265 \\320\\265 \\320\\277\\320\\276\\320\\262\\321\\200\\320\\265\\320\\264\\320\\265\\320\\275\\320\\260. \\320\\234\\320\\276\\320\\273\\321\\217, \\320\\270\\320\\267\\321\\202\\320\\265\\320\\263\\320\\273\\320\\265\\321\\202\\320\\265 \\321\\217 \\320\\276\\321\\202\\320\\275\\320\\276\\320\\262\\320\\276.\\n \\320\\237\\321\\200\\320\\276\\321\\201\\321\\202\\320\\265\\321\\202\\320\\265 \\320\\275\\320\\270 \\320\\267\\320\\260 \\320\\275\\320\\265\\321\\203\\320\\264\\320\\276\\320\\261\\321\\201\\321\\202\\320\\262\\320\\276\\321\\202\\320\\276!\\0\"\\\n  \"\\320\\224\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 SumatraPDF\\0\"\\\n  \"\\320\\224\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\320\\275\\320\\265\\321\\202\\320\\276 \\320\\261\\320\\265\\321\\210\\320\\265 \\320\\275\\320\\265\\321\\203\\321\\201\\320\\277\\320\\265\\321\\210\\320\\275\\320\\276!\\0\"\\\n  \"\\320\\224\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\320\\275\\320\\265...\\0\"\\\n  \"\\320\\230\\320\\267\\320\\277\\320\\276\\320\\273\\320\\267\\320\\262\\320\\260\\320\\275\\320\\265 \\320\\275\\320\\260 SumatraPDF \\320\\272\\320\\260\\321\\202\\320\\276 \\320\\276\\321\\201\\320\\275\\320\\276\\320\\262\\320\\265\\320\\275 \\321\\207\\320\\265\\321\\202\\320\\265\\321\\206 \\320\\275\\320\\260 PDF \\321\\204\\320\\260\\320\\271\\320\\273\\320\\276\\320\\262\\320\\265\\0\";\n\nconst char * gTranslations_ca = \n  \"&Opcions\\0\"\\\n  \"Esteu segur de voler desinstal\\302\\267lar el SumatraPDF?\\0\"\\\n  \"Tanca\\0\"\\\n  \"No es pot crear el directori temporal\\0\"\\\n  \"No es pot crear el directori d'instal\\302\\267laci\\303\\263\\0\"\\\n  \"No es pot instal\\302\\267lar el visor r\\303\\240pid de PDF\\0\"\\\n  \"No es pot instal\\302\\267lar el filtre de cerca PDF\\0\"\\\n  \"No es pot obtenir el directori temporal\\0\"\\\n  \"No es pot suprimir el directori d'instal\\302\\267laci\\303\\263\\0\"\\\n  \"No es pot suprimir la drecera\\0\"\\\n  \"No es pot desinstal\\302\\267lar el visor r\\303\\240pid PDF\\0\"\\\n  \"No es pot desinstal\\302\\267lar el filtre de cerca PDF\\0\"\\\n  \"No es pot desinstal\\302\\267lar el connector de navegador\\0\"\\\n  \"No es pot escriure %s al disc\\0\"\\\n  \"No es pot copiar el desinstal\\302\\267lador al directori temporal\\0\"\\\n  \"No es pot crear una drecera\\0\"\\\n  \"No es poden suprimir les claus de registre del desinstal\\302\\267lador\\0\"\\\n  \"\\0\"\\\n  \"No es pot escriure la informaci\\303\\263 d'extensi\\303\\263 de fitxer extesa al registre\\0\"\\\n  \"No es pot escriure la informaci\\303\\263 de desinstal\\302\\267laci\\303\\263 al registre\\0\"\\\n  \"Amaga les &opcions\\0\"\\\n  \"Instal\\302\\267la el SumatraPDF\\0\"\\\n  \"Instal\\302\\267la el SumatraPDF a la &carpeta:\\0\"\\\n  \"La instal\\302\\267laci\\303\\263 ha fallat.\\0\"\\\n  \"La instal\\302\\267laci\\303\\263 \\303\\251s en progr\\303\\251s...\\0\"\\\n  \"Mant\\303\\251n instal\\302\\267lat el connector PDF del &navegador (ja no es mant\\303\\251)\\0\"\\\n  \"Permet al Windows Desktop Search &cercar als documents PDF\\0\"\\\n  \"Permet al Windows mostrar &visualitzacions pr\\303\\250vies dels documents PDF\\0\"\\\n  \"Tanqueu %s per continuar!\\0\"\\\n  \"Seleccioneu la carpeta on voleu instal\\302\\267lar el SumatraPDF:\\0\"\\\n  \"Alguns fitxers que s'han d'instal\\302\\267lar no hi s\\303\\263n o s\\303\\263n malmesos\\0\"\\\n  \"Inicia el SumatraPDF\\0\"\\\n  \"Instal\\302\\267lador del SumatraPDF %s\\0\"\\\n  \"Desintal\\302\\267lador del SumatraPDF %s\\0\"\\\n  \"S'ha desinstal\\302\\267lat el SumatraPDF.\\0\"\\\n  \"No s'ha trobat cap instal\\302\\267laci\\303\\263 del SumatraPDF.\\0\"\\\n  \"Gr\\303\\240cies per triar el SumatraPDF!\\0\"\\\n  \"Gr\\303\\240cies! S'ha instal\\302\\267lat el SumatraPDF.\\0\"\\\n  \"L'instal\\302\\267lador \\303\\251s malm\\303\\250s. Baixeu-lo una altra vegada.\\nLamentem les mol\\303\\250sties!\\0\"\\\n  \"Desinstal\\302\\267la el SumatraPDF\\0\"\\\n  \"La desinstal\\302\\267laci\\303\\263 ha fallat\\0\"\\\n  \"Desinstal\\302\\267laci\\303\\263 en progr\\303\\251s...\\0\"\\\n  \"Usa el SumatraPDF com a visor PDF &predeterminat\\0\";\n\nconst char * gTranslations_ca_xv = \n  \"&Opcions\\0\"\\\n  \"Esteu segur de voler desinstal\\302\\267lar el SumatraPDF?\\0\"\\\n  \"Tanca\\0\"\\\n  \"No es pot crear el directori temporal\\0\"\\\n  \"No es pot crear el directori d'instal\\302\\267laci\\303\\263\\0\"\\\n  \"No es pot instal\\302\\267lar el visor r\\303\\240pid de PDF\\0\"\\\n  \"No es pot instal\\302\\267lar el filtre de cerca PDF\\0\"\\\n  \"No es pot obtindre el directori temporal\\0\"\\\n  \"No es pot suprimir el directori d'instal\\302\\267laci\\303\\263\\0\"\\\n  \"No es pot suprimir la drecera\\0\"\\\n  \"No es pot desinstal\\302\\267lar el visor r\\303\\240pid PDF\\0\"\\\n  \"No es pot desinstal\\302\\267lar el filtre de cerca PDF\\0\"\\\n  \"No es pot desinstal\\302\\267lar el connector de navegador\\0\"\\\n  \"No es pot escriure %s al disc\\0\"\\\n  \"No es pot copiar el desinstal\\302\\267lador al directori temporal\\0\"\\\n  \"No es pot crear una drecera\\0\"\\\n  \"No es poden suprimir les claus de registre del desinstal\\302\\267lador\\0\"\\\n  \"\\0\"\\\n  \"No es pot escriure la informaci\\303\\263 d'extensi\\303\\263 de fitxer extesa al registre\\0\"\\\n  \"No es pot escriure la informaci\\303\\263 de desinstal\\302\\267laci\\303\\263 al registre\\0\"\\\n  \"Amaga les &opcions\\0\"\\\n  \"Instal\\302\\267la el SumatraPDF\\0\"\\\n  \"Instal\\302\\267la el SumatraPDF a la &carpeta:\\0\"\\\n  \"La instal\\302\\267laci\\303\\263 ha fallat!\\0\"\\\n  \"La instal\\302\\267laci\\303\\263 \\303\\251s en progr\\303\\251s...\\0\"\\\n  \"Mant\\303\\255n instal\\302\\267lat el connector PDF del &navegador (ja no es mant\\303\\251)\\0\"\\\n  \"Permet al Windows Desktop Search &cercar als documents PDF\\0\"\\\n  \"Permet al Windows mostrar &visualitzacions pr\\303\\250vies dels documents\\0\"\\\n  \"Tanqueu %s per continuar!\\0\"\\\n  \"Seleccioneu la carpeta on voleu instal\\302\\267lar el SumatraPDF:\\0\"\\\n  \"Alguns fitxers que s'han d'instal\\302\\267lar no hi s\\303\\263n o s\\303\\263n malmesos\\0\"\\\n  \"Inicia el SumatraPDF\\0\"\\\n  \"Instal\\302\\267lador del SumatraPDF %s\\0\"\\\n  \"Desintal\\302\\267lador del SumatraPDF %s\\0\"\\\n  \"S'ha desinstal\\302\\267lat el SumatraPDF.\\0\"\\\n  \"No s'ha trobat cap instal\\302\\267laci\\303\\263 del SumatraPDF.\\0\"\\\n  \"Gr\\303\\240cies per triar el SumatraPDF!\\0\"\\\n  \"Gr\\303\\240cies! S'ha instal\\302\\267lat el SumatraPDF.\\0\"\\\n  \"L'instal\\302\\267lador \\303\\251s malm\\303\\251s. Baixeu-lo una altra vegada.\\nLamentem les mol\\303\\250sties!\\0\"\\\n  \"Desinstal\\302\\267la el SumatraPDF\\0\"\\\n  \"La desinstal\\302\\267laci\\303\\263 ha fallat\\0\"\\\n  \"Desinstal\\302\\267laci\\303\\263 en progr\\303\\251s...\\0\"\\\n  \"Usa el SumatraPDF com a visor PDF &predeterminat\\0\";\n\nconst char * gTranslations_cn = \n  \"\\351\\200\\211\\351\\241\\271(&O)\\0\"\\\n  \"\\344\\275\\240\\347\\241\\256\\345\\256\\236\\350\\246\\201\\345\\215\\270\\350\\275\\275 SumatraPDF \\345\\220\\227\\357\\274\\237\\0\"\\\n  \"\\345\\205\\263\\351\\227\\255\\0\"\\\n  \"\\346\\227\\240\\346\\263\\225\\345\\210\\233\\345\\273\\272\\344\\270\\264\\346\\227\\266\\347\\233\\256\\345\\275\\225\\0\"\\\n  \"\\346\\227\\240\\346\\263\\225\\345\\210\\233\\345\\273\\272\\345\\256\\211\\350\\243\\205\\346\\226\\207\\344\\273\\266\\345\\244\\271\\0\"\\\n  \"\\346\\227\\240\\346\\263\\225\\345\\256\\211\\350\\243\\205 PDF \\351\\242\\204\\350\\247\\210\\345\\231\\250\\0\"\\\n  \"\\346\\227\\240\\346\\263\\225\\345\\256\\211\\350\\243\\205 PDF \\346\\220\\234\\347\\264\\242\\350\\277\\207\\346\\273\\244\\345\\231\\250\\0\"\\\n  \"\\346\\227\\240\\346\\263\\225\\350\\216\\267\\345\\276\\227\\346\\232\\202\\345\\255\\230\\346\\226\\207\\344\\273\\266\\345\\244\\271\\0\"\\\n  \"\\346\\227\\240\\346\\263\\225\\347\\247\\273\\351\\231\\244\\345\\256\\211\\350\\243\\205\\347\\233\\256\\345\\275\\225\\0\"\\\n  \"\\346\\227\\240\\346\\263\\225\\347\\247\\273\\351\\231\\244\\345\\277\\253\\346\\215\\267\\346\\226\\271\\345\\274\\217\\0\"\\\n  \"\\346\\227\\240\\346\\263\\225\\345\\215\\270\\350\\275\\275 PDF \\351\\242\\204\\350\\247\\210\\345\\231\\250\\0\"\\\n  \"\\346\\227\\240\\346\\263\\225\\345\\215\\270\\350\\275\\275 PDF \\346\\220\\234\\347\\264\\242\\350\\277\\207\\346\\273\\244\\345\\231\\250\\0\"\\\n  \"\\346\\227\\240\\346\\263\\225\\345\\215\\270\\350\\275\\275\\346\\265\\217\\350\\247\\210\\345\\231\\250\\346\\217\\222\\344\\273\\266\\0\"\\\n  \"\\346\\227\\240\\346\\263\\225\\345\\206\\231\\345\\205\\245 %s \\345\\210\\260\\347\\243\\201\\347\\233\\230\\0\"\\\n  \"\\346\\227\\240\\346\\263\\225\\345\\244\\215\\345\\210\\266\\345\\215\\270\\350\\275\\275\\347\\250\\213\\345\\272\\217\\345\\210\\260\\346\\232\\202\\345\\255\\230\\347\\233\\256\\345\\275\\225\\0\"\\\n  \"\\346\\227\\240\\346\\263\\225\\345\\210\\233\\345\\273\\272\\345\\277\\253\\346\\215\\267\\346\\226\\271\\345\\274\\217\\0\"\\\n  \"\\345\\210\\240\\351\\231\\244\\345\\215\\270\\350\\275\\275\\347\\250\\213\\345\\272\\217\\346\\263\\250\\345\\206\\214\\351\\241\\271\\345\\244\\261\\350\\264\\245\\343\\200\\202\\0\"\\\n  \"\\0\"\\\n  \"\\345\\206\\231\\345\\205\\245\\346\\211\\251\\345\\261\\225\\345\\220\\215\\344\\277\\241\\346\\201\\257\\345\\210\\260\\346\\263\\250\\345\\206\\214\\351\\241\\271\\345\\244\\261\\350\\264\\245\\343\\200\\202\\0\"\\\n  \"\\345\\206\\231\\345\\205\\245\\345\\215\\270\\350\\275\\275\\344\\277\\241\\346\\201\\257\\345\\210\\260\\346\\263\\250\\345\\206\\214\\351\\241\\271\\345\\244\\261\\350\\264\\245\\343\\200\\202\\0\"\\\n  \"\\351\\232\\220\\350\\227\\217\\351\\200\\211\\351\\241\\271(&O)\\0\"\\\n  \"\\345\\256\\211\\350\\243\\205 SumatraPDF\\0\"\\\n  \"\\345\\256\\211\\350\\243\\205 SumatraPDF \\344\\272\\216\\346\\226\\207\\344\\273\\266\\345\\244\\271(&F):\\0\"\\\n  \"\\345\\256\\211\\350\\243\\205\\345\\244\\261\\350\\264\\245!\\0\"\\\n  \"\\345\\256\\211\\350\\243\\205\\346\\255\\243\\345\\234\\250\\350\\277\\233\\350\\241\\214\\344\\270\\255...\\0\"\\\n  \"\\347\\273\\264\\346\\214\\201 PDF \\346\\265\\217\\350\\247\\210\\345\\231\\250\\346\\217\\222\\344\\273\\266\\345\\256\\211\\350\\243\\205\\347\\212\\266\\346\\200\\201(\\344\\270\\215\\345\\206\\215\\346\\224\\257\\346\\214\\201)(&B)\\0\"\\\n  \"\\350\\256\\251 Windows \\342\\200\\234\\346\\241\\214\\351\\235\\242\\346\\220\\234\\347\\264\\242\\342\\200\\235\\346\\220\\234\\347\\264\\242 PDF \\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\350\\256\\251 Windows \\346\\230\\276\\347\\244\\272 PDF \\346\\226\\207\\344\\273\\266\\347\\232\\204\\351\\242\\204\\350\\247\\210(&P)\\0\"\\\n  \"\\350\\257\\267\\345\\205\\263\\351\\227\\255 %s \\344\\273\\245\\347\\273\\247\\347\\273\\255\\343\\200\\202\\0\"\\\n  \"\\351\\200\\211\\346\\213\\251 SumatraPDF \\345\\272\\224\\350\\242\\253\\345\\256\\211\\350\\243\\205\\347\\232\\204\\346\\226\\207\\344\\273\\266\\345\\244\\271\\357\\274\\232\\0\"\\\n  \"\\346\\237\\220\\344\\272\\233\\345\\256\\211\\350\\243\\205\\346\\211\\200\\351\\234\\200\\347\\232\\204\\346\\226\\207\\344\\273\\266\\346\\215\\237\\345\\235\\217\\346\\210\\226\\344\\270\\242\\345\\244\\261\\0\"\\\n  \"\\345\\220\\257\\345\\212\\250SumatraPDF\\0\"\\\n  \"SumatraPDF %s \\345\\256\\211\\350\\243\\205\\347\\250\\213\\345\\272\\217\\0\"\\\n  \"SumatraPDF %s \\345\\215\\270\\350\\275\\275\\347\\250\\213\\345\\272\\217\\0\"\\\n  \"\\345\\267\\262\\345\\215\\270\\350\\275\\275 SumatraPDF \\343\\200\\202\\0\"\\\n  \"\\346\\234\\252\\346\\211\\276\\345\\210\\260 SumatraPDF \\345\\256\\211\\350\\243\\205\\343\\200\\202\\0\"\\\n  \"\\350\\260\\242\\350\\260\\242\\351\\200\\211\\347\\224\\250SumatraPDF!\\0\"\\\n  \"\\350\\260\\242\\350\\260\\242! SumatraPDF\\345\\267\\262\\347\\273\\217\\345\\256\\211\\350\\243\\205\\345\\245\\275.\\0\"\\\n  \"\\346\\212\\261\\346\\255\\211\\345\\256\\211\\350\\243\\205\\347\\250\\213\\345\\272\\217\\346\\215\\237\\345\\235\\217\\357\\274\\214\\350\\257\\267\\351\\207\\215\\346\\226\\260\\344\\270\\213\\350\\275\\275\\343\\200\\202\\0\"\\\n  \"\\345\\215\\270\\350\\275\\275 SumatraPDF\\0\"\\\n  \"\\345\\215\\270\\350\\275\\275\\345\\244\\261\\350\\264\\245\\0\"\\\n  \"\\345\\215\\270\\350\\275\\275\\346\\255\\243\\345\\234\\250\\350\\277\\233\\350\\241\\214...\\0\"\\\n  \"\\344\\275\\277\\347\\224\\250 SumatraPDF \\344\\275\\234\\344\\270\\272\\351\\273\\230\\350\\256\\244\\347\\232\\204 PDF \\351\\230\\205\\350\\257\\273\\345\\231\\250(&U)\\0\";\n\nconst char * gTranslations_tw = \n  \"\\351\\201\\270\\351\\240\\205(&O)\\0\"\\\n  \"\\344\\275\\240\\347\\242\\272\\345\\256\\232\\350\\246\\201\\350\\247\\243\\351\\231\\244\\345\\256\\211\\350\\243\\235 SumatraPDF \\345\\227\\216\\357\\274\\237\\0\"\\\n  \"\\351\\227\\234\\351\\226\\211(&C)\\0\"\\\n  \"\\347\\204\\241\\346\\263\\225\\345\\273\\272\\347\\253\\213\\346\\232\\253\\345\\255\\230\\350\\263\\207\\346\\226\\231\\345\\244\\276\\0\"\\\n  \"\\347\\204\\241\\346\\263\\225\\345\\273\\272\\347\\253\\213\\345\\256\\211\\350\\243\\235\\350\\263\\207\\346\\226\\231\\345\\244\\276\\0\"\\\n  \"\\347\\204\\241\\346\\263\\225\\345\\256\\211\\350\\243\\235 PDF \\351\\240\\220\\350\\246\\275\\345\\231\\250\\0\"\\\n  \"\\347\\204\\241\\346\\263\\225\\345\\256\\211\\350\\243\\235 PDF \\346\\220\\234\\347\\264\\242\\351\\201\\216\\346\\277\\276\\345\\231\\250\\0\"\\\n  \"\\347\\204\\241\\346\\263\\225\\347\\215\\262\\345\\276\\227\\346\\232\\253\\345\\255\\230\\350\\263\\207\\346\\226\\231\\345\\244\\276\\0\"\\\n  \"\\347\\204\\241\\346\\263\\225\\347\\247\\273\\351\\231\\244\\345\\256\\211\\350\\243\\235\\347\\233\\256\\351\\214\\204\\0\"\\\n  \"\\347\\204\\241\\346\\263\\225\\347\\247\\273\\351\\231\\244\\346\\215\\267\\345\\276\\221\\0\"\\\n  \"\\347\\204\\241\\346\\263\\225\\350\\247\\243\\351\\231\\244\\345\\256\\211\\350\\243\\235 PDF \\351\\240\\220\\350\\246\\275\\345\\231\\250\\0\"\\\n  \"\\347\\204\\241\\346\\263\\225\\345\\256\\211\\350\\243\\235 PDF \\346\\220\\234\\347\\264\\242\\351\\201\\216\\346\\277\\276\\345\\231\\250\\0\"\\\n  \"\\347\\204\\241\\346\\263\\225\\350\\247\\243\\351\\231\\244\\345\\256\\211\\350\\243\\235\\347\\200\\217\\350\\246\\275\\345\\231\\250\\351\\231\\204\\345\\212\\240\\345\\205\\203\\344\\273\\266\\0\"\\\n  \"\\347\\204\\241\\346\\263\\225\\345\\257\\253\\345\\205\\245 %s \\345\\210\\260\\347\\243\\201\\347\\242\\237\\344\\270\\255\\0\"\\\n  \"\\347\\204\\241\\346\\263\\225\\345\\260\\207\\350\\247\\243\\351\\231\\244\\345\\256\\211\\350\\243\\235\\347\\250\\213\\345\\274\\217\\350\\244\\207\\350\\243\\275\\345\\210\\260\\346\\232\\253\\345\\255\\230\\347\\233\\256\\351\\214\\204\\0\"\\\n  \"\\347\\204\\241\\346\\263\\225\\345\\273\\272\\347\\253\\213\\346\\215\\267\\345\\276\\221\\0\"\\\n  \"\\345\\210\\252\\351\\231\\244\\350\\247\\243\\351\\231\\244\\345\\256\\211\\350\\243\\235\\345\\231\\250\\350\\250\\273\\345\\206\\212\\351\\240\\205\\345\\244\\261\\346\\225\\227\\343\\200\\202\\0\"\\\n  \"\\0\"\\\n  \"\\345\\257\\253\\345\\205\\245\\345\\273\\266\\351\\201\\262\\346\\252\\224\\346\\241\\210\\345\\211\\257\\346\\252\\224\\345\\220\\215\\350\\263\\207\\350\\250\\212\\345\\210\\260\\350\\250\\273\\345\\206\\212\\351\\240\\205\\345\\244\\261\\346\\225\\227\\343\\200\\202\\0\"\\\n  \"\\345\\257\\253\\345\\205\\245\\350\\247\\243\\351\\231\\244\\345\\256\\211\\350\\243\\235\\350\\263\\207\\350\\250\\212\\345\\210\\260\\350\\250\\273\\345\\206\\212\\351\\240\\205\\347\\233\\256\\345\\244\\261\\346\\225\\227\\343\\200\\202\\0\"\\\n  \"\\351\\232\\261\\350\\227\\217\\351\\201\\270\\351\\240\\205(&O)\\0\"\\\n  \"\\345\\256\\211\\350\\243\\235 SumatraPDF\\0\"\\\n  \"\\345\\256\\211\\350\\243\\235 SumatraPDF \\346\\226\\274\\350\\263\\207\\346\\226\\231\\345\\244\\276(&F):\\0\"\\\n  \"\\345\\256\\211\\350\\243\\235\\345\\244\\261\\346\\225\\227\\357\\274\\201\\0\"\\\n  \"\\345\\256\\211\\350\\243\\235\\346\\255\\243\\345\\234\\250\\351\\200\\262\\350\\241\\214...\\0\"\\\n  \"\\347\\266\\255\\346\\214\\201 PDF \\347\\200\\217\\350\\246\\275\\345\\231\\250\\346\\217\\222\\344\\273\\266\\345\\256\\211\\350\\243\\235\\347\\213\\200\\346\\205\\213(\\344\\270\\215\\345\\206\\215\\346\\224\\257\\346\\217\\264)(&B)\\0\"\\\n  \"\\350\\256\\223 Windows \\343\\200\\214\\346\\241\\214\\351\\235\\242\\346\\220\\234\\345\\260\\213\\343\\200\\215\\346\\220\\234\\345\\260\\213 PDF \\346\\226\\207\\344\\273\\266\\0\"\\\n  \"\\350\\256\\223 Windows \\351\\241\\257\\347\\244\\272 PDF \\346\\226\\207\\344\\273\\266\\347\\232\\204\\351\\240\\220\\350\\246\\275(&P)\\0\"\\\n  \"\\350\\253\\213\\351\\227\\234\\351\\226\\211 %s \\344\\273\\245\\347\\271\\274\\347\\272\\214\\343\\200\\202\\0\"\\\n  \"\\351\\201\\270\\346\\223\\207 SumatraPDF \\346\\207\\211\\350\\242\\253\\345\\256\\211\\350\\243\\235\\347\\232\\204\\350\\263\\207\\346\\226\\231\\345\\244\\276\\357\\274\\232\\0\"\\\n  \"\\344\\270\\200\\344\\272\\233\\350\\246\\201\\345\\256\\211\\350\\243\\235\\347\\232\\204\\346\\252\\224\\346\\241\\210\\345\\267\\262\\346\\220\\215\\345\\243\\236\\346\\210\\226\\344\\270\\237\\345\\244\\261\\0\"\\\n  \"\\345\\225\\237\\345\\213\\225 SumatraPDF\\0\"\\\n  \"SumatraPDF %s \\345\\256\\211\\350\\243\\235\\345\\231\\250\\0\"\\\n  \"SumatraPDF %s \\350\\247\\243\\351\\231\\244\\345\\256\\211\\350\\243\\235\\345\\231\\250\\0\"\\\n  \"\\345\\267\\262\\350\\247\\243\\351\\231\\244\\345\\256\\211\\350\\243\\235 SumatraPDF \\343\\200\\202\\0\"\\\n  \"\\346\\234\\252\\346\\211\\276\\345\\210\\260 SumatraPDF \\345\\256\\211\\350\\243\\235\\343\\200\\202\\0\"\\\n  \"\\346\\204\\237\\350\\254\\235\\351\\201\\270\\346\\223\\207 SumatraPDF!\\0\"\\\n  \"\\350\\254\\235\\350\\254\\235\\357\\274\\201 SumatraPDF \\345\\267\\262\\345\\256\\211\\350\\243\\235\\343\\200\\202\\0\"\\\n  \"\\345\\256\\211\\350\\243\\235\\347\\250\\213\\345\\274\\217\\345\\267\\262\\346\\220\\215\\345\\243\\236\\343\\200\\202\\350\\253\\213\\351\\207\\215\\346\\226\\260\\344\\270\\213\\350\\274\\211\\343\\200\\202\\n\\346\\212\\261\\346\\255\\211\\345\\270\\266\\344\\276\\206\\344\\270\\215\\344\\276\\277\\357\\274\\201\\0\"\\\n  \"\\350\\247\\243\\351\\231\\244\\345\\256\\211\\350\\243\\235 SumatraPDF\\0\"\\\n  \"\\350\\247\\243\\351\\231\\244\\345\\256\\211\\350\\243\\235\\345\\244\\261\\346\\225\\227\\0\"\\\n  \"\\350\\247\\243\\351\\231\\244\\345\\256\\211\\350\\243\\235\\346\\255\\243\\345\\234\\250\\351\\200\\262\\350\\241\\214...\\0\"\\\n  \"\\344\\275\\277\\347\\224\\250 SumatraPDF \\344\\275\\234\\347\\202\\272\\351\\240\\220\\350\\250\\255\\347\\232\\204 PDF \\351\\226\\261\\350\\256\\200\\345\\231\\250(&U)\\0\";\n\nconst char * gTranslations_hr = \n  \"P&ostavke\\0\"\\\n  \"Jeste li sigurni da \\305\\276elite deinstalirati SumatraPDF?\\0\"\\\n  \"Zatvori\\0\"\\\n  \"Nemogu\\304\\207e napraviti privremenu mapu\\0\"\\\n  \"Nemogu\\304\\207e napraviti instalacijsku mapu\\0\"\\\n  \"Nemogu\\304\\207e instalirati PDF preglednik\\0\"\\\n  \"Nemogu\\304\\207e instalirati PDF filter pretra\\305\\276ivanja\\0\"\\\n  \"Nemogu\\304\\207e dobiti privremenu mapu\\0\"\\\n  \"Nemogu\\304\\207e ukloniti instalacijsku mapu\\0\"\\\n  \"Nemogu\\304\\207e ukloniti pre\\304\\215ac\\0\"\\\n  \"Nemogu\\304\\207e deinstalirati PDF preglednik\\0\"\\\n  \"Nemogu\\304\\207e deinstalirati PDF filter pretra\\305\\276ivnja\\0\"\\\n  \"Nemogu\\304\\207e deinstalirati dodatak za internet preglednik\\0\"\\\n  \"Nemogu\\304\\207e zapisati %s na disk\\0\"\\\n  \"Neuspjeh kod kopiranju deinstalera u privremenu mapu\\0\"\\\n  \"Neuspjeh u kreiranju pre\\304\\215aca\\0\"\\\n  \"Neuspjeh kod brisanja klju\\304\\215eva registra deinstalatera\\0\"\\\n  \"\\0\"\\\n  \"Neuspjeh kod zapisivanja produ\\305\\276enih informacija nastavka datoteke u registru\\0\"\\\n  \"Neuspjeh kod zapisivanja deinstalacijskih informacija u registar\\0\"\\\n  \"Sakrij postavke\\0\"\\\n  \"Instaliraj SumatraPDF\\0\"\\\n  \"Instaliraj SumatraPDF u &mapu:\\0\"\\\n  \"Instalacija nije uspjela!\\0\"\\\n  \"Instaliranje...\\0\"\\\n  \"Zadr\\305\\276i PDF &browser dodatak instaliran (vi\\305\\241e nije podr\\305\\276ano)\\0\"\\\n  \"Neka Windows pretraga radne povr\\305\\241ine &pretra\\305\\276uje PDF dokumente\\0\"\\\n  \"Neka Windows prikazuje &pregled PDF dokumenata\\0\"\\\n  \"Molim zatvorite %s za nastavak!\\0\"\\\n  \"Odaberite mapu gdje bi trebalo instalirati SumatraPDF:\\0\"\\\n  \"Neke datoteke za instalaciju su o\\305\\241te\\304\\207ene ili nedostaju\\0\"\\\n  \"Pokreni SumatraPDF\\0\"\\\n  \"SumatraPDF %s instaler\\0\"\\\n  \"SumatraPDF %s deinstaler\\0\"\\\n  \"SumatraPDF je deinstaliran.\\0\"\\\n  \"SumatraPDF instalacija nije prona\\304\\221ena.\\0\"\\\n  \"Hvala Vam na odabiru SumatraPDF!\\0\"\\\n  \"Hvala Vam! SumatraPDF je instaliran.\\0\"\\\n  \"Instaler je o\\305\\241te\\304\\207en. Molim Vas preuzmite ga ponovno.\\nIsprika za tu neugodnost!\\0\"\\\n  \"Deinstaliraj SumatraPDF\\0\"\\\n  \"Deinstalacija nije uspjela\\0\"\\\n  \"Deinstaliranje...\\0\"\\\n  \"Koristi SumatraPDF kao zadani PDF preglednik\\0\";\n\nconst char * gTranslations_cz = \n  \"&Mo\\305\\276nosti\\0\"\\\n  \"Opravdu chcete odinstalovat SumatraPDF?\\0\"\\\n  \"Zav\\305\\231\\303\\255t\\0\"\\\n  \"Nepoda\\305\\231ilo se vytvo\\305\\231it do\\304\\215asn\\303\\275 adres\\303\\241\\305\\231\\0\"\\\n  \"Nepoda\\305\\231ilo se vytvo\\305\\231it adres\\303\\241\\305\\231 pro instalaci\\0\"\\\n  \"Nelze nainstalovat PDF prohl\\303\\255\\305\\276e\\304\\215\\0\"\\\n  \"Nelze nainstalovat vyhled\\303\\241vac\\303\\255 PDF filtr\\0\"\\\n  \"Do\\304\\215asn\\303\\275 adres\\303\\241\\305\\231 nen\\303\\255 dostupn\\303\\275\\0\"\\\n  \"Nepoda\\305\\231ilo se odstranit adres\\303\\241\\305\\231 pro instalaci\\0\"\\\n  \"Nepoda\\305\\231ilo se odstranit z\\303\\241stupce\\0\"\\\n  \"Nelze odinstalovat PDF prohl\\303\\255\\305\\276e\\304\\215\\0\"\\\n  \"Nelze odinstalovavat vyhled\\303\\241vac\\303\\255 PDF filtr\\0\"\\\n  \"Nepoda\\305\\231ilo se odinstalovat roz\\305\\241\\303\\255\\305\\231en\\303\\255 z prohl\\303\\255\\305\\276e\\304\\215e\\0\"\\\n  \"Nelze zapsat %s na disk\\0\"\\\n  \"Nezda\\305\\231ilo se zkop\\303\\255rovat odinstala\\304\\215n\\303\\255 program do do\\304\\215asn\\303\\251ho adres\\303\\241\\305\\231e\\0\"\\\n  \"Vytvo\\305\\231en\\303\\255 z\\303\\241stupce se nezda\\305\\231ilo\\0\"\\\n  \"Nepoda\\305\\231ilo se smazat odinsla\\304\\215n\\303\\255 z\\303\\241znamy z registru\\0\"\\\n  \"\\0\"\\\n  \"Nepoda\\305\\231ilo se zapsat informace o p\\305\\231\\303\\255pon\\304\\233 souboru do registru\\0\"\\\n  \"Nepoda\\305\\231ilo se zapsat odinsla\\304\\215n\\303\\255 z\\303\\241znamy do registru\\0\"\\\n  \"Skr\\303\\275t &mo\\305\\276nosti\\0\"\\\n  \"Nainstalovat SumatraPDF\\0\"\\\n  \"Nainstalovat SumatraPDF do &slo\\305\\276ky:\\0\"\\\n  \"Instalace se nezda\\305\\231ila!\\0\"\\\n  \"Prob\\303\\255h\\303\\241 instalace...\\0\"\\\n  \"Ponechat nainstalovan\\303\\275 plugin &prohl\\303\\255\\305\\276e\\304\\215 PDF (ji\\305\\276 nen\\303\\255 podporov\\303\\241n)\\0\"\\\n  \"Nechte Windows Desktop Search &prohled\\303\\241vat PDF dokumenty\\0\"\\\n  \"Nechte Windows zobrazit &n\\303\\241hledy PDF dokument\\305\\257\\0\"\\\n  \"Pros\\303\\255m ukon\\304\\215ete %s pro pokra\\304\\215ov\\303\\241n\\303\\255!\\0\"\\\n  \"Vyberte adres\\303\\241\\305\\231, do kter\\303\\251ho chcete nainstalovat SumatraPDF:\\0\"\\\n  \"N\\304\\233kter\\303\\251 soubory pot\\305\\231ebn\\303\\251 pro instalaci jsou po\\305\\241kozen\\303\\251 nebo nebyly nalezeny\\0\"\\\n  \"Spustit SumatraPDF\\0\"\\\n  \"SumatraPDF %s instal\\303\\241tor\\0\"\\\n  \"SumatraPDF %s odinstal\\303\\241tor\\0\"\\\n  \"SumatraPDF byl odinstalov\\303\\241n.\\0\"\\\n  \"Instalace programu SumatraPDF nebyla nalezena.\\0\"\\\n  \"D\\304\\233kujeme, \\305\\276e jste si vybrali SumatraPDF!\\0\"\\\n  \"D\\304\\233kujeme! Program SumatraPDF byl nainstalov\\303\\241n.\\0\"\\\n  \"Instala\\304\\215n\\303\\255 program byl nejsp\\303\\255\\305\\241e po\\305\\241kozen. St\\303\\241hn\\304\\233te si jej pros\\303\\255m znovu. \\nOmlouv\\303\\241me se za zp\\305\\257soben\\303\\251 nep\\305\\231\\303\\255jemnosti!\\0\"\\\n  \"Odinstalovat SumatraPDF\\0\"\\\n  \"Odinstalace programu se nezda\\305\\231ila\\0\"\\\n  \"Prob\\303\\255h\\303\\241 odinstalace...\\0\"\\\n  \"Pou\\305\\276\\303\\255t SumatraPDF jako &v\\303\\275choz\\303\\255 PDF prohl\\303\\255\\305\\276e\\304\\215\\0\";\n\nconst char * gTranslations_dk = \n  \"&Valgmuligheder\\0\"\\\n  \"Er du sikker p\\303\\245, at du vil afinstallere SumatraPDF?\\0\"\\\n  \"Luk\\0\"\\\n  \"Kunne ikke oprette midlertidig mappe\\0\"\\\n  \"Kunne ikke oprette installationsmappe\\0\"\\\n  \"Kunne ikke installere PDF-fremviser\\0\"\\\n  \"Kunne ikke installere PDF-s\\303\\270gefilter\\0\"\\\n  \"Kunne ikke tilg\\303\\245 midlertidig mappe\\0\"\\\n  \"Kunne ikke fjerne installationsmappe\\0\"\\\n  \"Kunne ikke fjerne genvej\\0\"\\\n  \"Kunne ikke fjerne PDF-fremviser\\0\"\\\n  \"Kunne ikke afinstallere PDF-s\\303\\270gefilter\\0\"\\\n  \"Kunne ikke fjerne browserudvidelsesmodul\\0\"\\\n  \"Kunne ikke skrive %s til disk\\0\"\\\n  \"Kunne ikke kopiere fra midlertidig mappe\\0\"\\\n  \"Kunne ikke oprette genvej\\0\"\\\n  \"Kunne ikke slette afinstalleringsn\\303\\270gler i registreringsdatabasen\\0\"\\\n  \"\\0\"\\\n  \"Kunne ikke skrive udvidet information om filens efternavn i registreringsdatabasen\\0\"\\\n  \"Kunne ikke skrive afinstalleringsinformation i registreringsdatabasen\\0\"\\\n  \"Gem &valgmuligheder\\0\"\\\n  \"Installer SumatraPDF\\0\"\\\n  \"Installer SumatraPDF i &mappe:\\0\"\\\n  \"Installation fejlede!\\0\"\\\n  \"Installation i gang ...\\0\"\\\n  \"Bevar PDF-&browserudvidelsesmodulet installeret (ikke l\\303\\246ngere underst\\303\\270ttet)\\0\"\\\n  \"Lad Windows' skrivebordss\\303\\270gning &s\\303\\270ge i PDF-dokumenter\\0\"\\\n  \"Lad Windows vise &forh\\303\\245ndsvisninger af PDF-dokumenter\\0\"\\\n  \"Luk venligst %s for at forts\\303\\246tte !\\0\"\\\n  \"V\\303\\246lg mappen hvor SumatraPDF skal installeres:\\0\"\\\n  \"Nogle installationsfiler er beskadiget eller mangler\\0\"\\\n  \"\\0\"\\\n  \"SumatraPDF %s installationsprogram\\0\"\\\n  \"SumatraPDF %s afinstallationsprogram\\0\"\\\n  \"SumatraPDF er afinstalleret.\\0\"\\\n  \"SumatraPDF-installation blev ikke fundet.\\0\"\\\n  \"Tak fordi du valgte SumatraPDF!\\0\"\\\n  \"Tak! SumatraPDF er installeret.\\0\"\\\n  \"Installationsprogrammet er fejlbeh\\303\\246ftet. Pr\\303\\270v venligst at hente det igen.\\nVi beklager ulejligheden!\\0\"\\\n  \"Afinstaller SumatraPDF\\0\"\\\n  \"Afinstallationen fejlede\\0\"\\\n  \"Afinstallation p\\303\\245g\\303\\245r ...\\0\"\\\n  \"Anvend SumatraPDF som &standardl\\303\\246ser for PDF-filer\\0\";\n\nconst char * gTranslations_nl = \n  \"&Opties\\0\"\\\n  \"Weet u zeker dat u SumatraPDF wilt verwijderen?\\0\"\\\n  \"Sluiten\\0\"\\\n  \"Kan tijdelijke map niet aanmaken\\0\"\\\n  \"Kan de installatiemap niet aanmaken\\0\"\\\n  \"Kan PDF-previewer niet installeren\\0\"\\\n  \"Kan PDF-zoekfilter niet installeren\\0\"\\\n  \"Kan tijdelijke map niet verkrijgen\\0\"\\\n  \"Kan installatiemap niet verwijderen\\0\"\\\n  \"Kon snelkoppeling niet verwijderen\\0\"\\\n  \"Kan PDF-previewer niet verwijderen\\0\"\\\n  \"Kon PDF zoek filter niet de\\303\\257nstalleren\\0\"\\\n  \"Kan browserplugin niet verwijderen\\0\"\\\n  \"Kon %s niet op schijf wegschrijven\\0\"\\\n  \"Kon deinstallatie programma niet kopieren naar tijdelijke folder\\0\"\\\n  \"Kon snelkoppeling niet aanmaken\\0\"\\\n  \"Kon deinstallatie register sleutels niet verwijderen\\0\"\\\n  \"\\0\"\\\n  \"Kan uitgebreide bestandsextensie-informatie niet wegschrijven in register\\0\"\\\n  \"Kan de\\303\\257nstallatie-informatie niet wegschrijven in het register\\0\"\\\n  \"Verberg &Opties\\0\"\\\n  \"Installeer SumatraPDF\\0\"\\\n  \"Installeer SumatraPDF in &map\\0\"\\\n  \"Installatie mislukt!\\0\"\\\n  \"Installatie in uitvoering...\\0\"\\\n  \"Behoud de PDF-&browserplugin ge\\303\\257nstalleerd (niet langer ondersteund)\\0\"\\\n  \"Laat Windows Bureaublad Zoeker PDF documenten &zoeken\\0\"\\\n  \"Laat Windows &voorbeelden tonen van PDF documenten\\0\"\\\n  \"Sluit %s om verder te gaan!\\0\"\\\n  \"Kies de folder waar SumatraPDF geinstalleerd moet worden:\\0\"\\\n  \"Sommige bestanden voor de installatie zijn beschadigd of ontbreken\\0\"\\\n  \"\\0\"\\\n  \"SumatraPDF %s installatieprogramma\\0\"\\\n  \"SumatraPDF %s deinstallatieprogramma\\0\"\\\n  \"SumatraPDF werd verwijderd.\\0\"\\\n  \"SumatraPDF-installatie niet gevonden.\\0\"\\\n  \"Dank u om voor SumatraPDF te kiezen!\\0\"\\\n  \"Dank u! SumatraPDF is geinstalleerd.\\0\"\\\n  \"Het installatieprogramma is beschadigd. Download het opnieuw aub.\\nOnze excuses voor het ongemak!\\0\"\\\n  \"Deinstalleer SumatraPDF\\0\"\\\n  \"Deinstallatie mislukt\\0\"\\\n  \"Deinstallatie is bezig...\\0\"\\\n  \"Gebruik SumatraPDF als &standaard PDF lezer\\0\";\n\nconst char * gTranslations_et = \n  \"&S\\303\\244tted\\0\"\\\n  \"Kas oled kindel, et soovid eemaldada rakendust SumatraPDF?\\0\"\\\n  \"Sulge\\0\"\\\n  \"Ei suudetud luua ajutist kataloogi\\0\"\\\n  \"Ei suudetud luua paigalduskataloogi\\0\"\\\n  \"Ei suudetud paigaldada PDF-eelvaaturit\\0\"\\\n  \"Ei suudetud paigaldada PDF otsingufiltrit\\0\"\\\n  \"Ei suudetud luua ajutist kataloogi\\0\"\\\n  \"Ei suudetud kustutada paigalduskataloogi\\0\"\\\n  \"Ei suudetud kustutada otseteed\\0\"\\\n  \"Ei suudetud eemaldada PDF-eelvaaturit\\0\"\\\n  \"Ei suudetud eemaldada PDF otsingufiltrit\\0\"\\\n  \"Ei suudetud eemaldada brauseri pluginat\\0\"\\\n  \"Ei suudetud kettale kirjutada %s\\0\"\\\n  \"Ei \\303\\265nnestunud kopeerida eemaldusprogrammi temp kataloogi\\0\"\\\n  \"Ei \\303\\265nnestu luua otseteed\\0\"\\\n  \"Ei \\303\\265nnestu kustutada eemaldusprogrammi registriv\\303\\265tmeid\\0\"\\\n  \"\\0\"\\\n  \"Ei \\303\\265nnestunud registrisse kirjutada infot pikendatud faililaiendi kohta\\0\"\\\n  \"Ei \\303\\265nnestunud registrisse kirjutada eemaldamise informatsiooni\\0\"\\\n  \"Peida &s\\303\\244tted\\0\"\\\n  \"Paigalda SumatraPDF\\0\"\\\n  \"Paigalda SumatraPDF &kataloogi:\\0\"\\\n  \"Paigaldamine eba\\303\\265nnestus!\\0\"\\\n  \"Toimub paigaldamine...\\0\"\\\n  \"J\\303\\244ta alles PDF &brauseri plugin (enam ei toetata)\\0\"\\\n  \"Windows Desktop Search &otsib PDF-dokumente\\0\"\\\n  \"Windows kuvab PDF-dokumentide &eelvaateid\\0\"\\\n  \"J\\303\\244tkamiseks palun sulge rakendus %s!\\0\"\\\n  \"Vali kataloog, mille seest SumatraPDF paigaldatakse.\\0\"\\\n  \"M\\303\\265ned paigaldatavad failid on viga saanud v\\303\\265i puuduvad\\0\"\\\n  \"K\\303\\244ivita SumatraPDF\\0\"\\\n  \"SumatraPDF %s paigaldamine\\0\"\\\n  \"SumatraPDF %s eemaldamine\\0\"\\\n  \"SumatraPDF on eemaldatud.\\0\"\\\n  \"SumatraPDF paigaldust ei leitud.\\0\"\\\n  \"T\\303\\244name, et valisid SumatraPDF'i!\\0\"\\\n  \"T\\303\\244name! SumatraPDF on paigaldatud.\\0\"\\\n  \"Paigaldusprogramm on vigane. Palun laadi see uuesti alla.\\nPalun vabandust ebamugavuste p\\303\\244rast!\\0\"\\\n  \"Eemalda SumatraPDF\\0\"\\\n  \"Eemaldamine eba\\303\\265nnestus\\0\"\\\n  \"Toimub eemaldamine...\\0\"\\\n  \"Kasuta SumatraPDF programmi &vaikimisi PDF-lehitsejana.\\0\";\n\nconst char * gTranslations_fi = \n  \"&Asetukset\\0\"\\\n  \"Oletko varma, ett\\303\\244 haluat poistaa SumatraPDF:n?\\0\"\\\n  \"Sulje\\0\"\\\n  \"V\\303\\244liaikaiskansion luominen ep\\303\\244onnistui\\0\"\\\n  \"Asennuskansion luominen ep\\303\\244onnistui\\0\"\\\n  \"PDF-esikatselijan asentaminen ep\\303\\244onnistui\\0\"\\\n  \"PDF-hakusuodattimen asentaminen ep\\303\\244onnistui\\0\"\\\n  \"V\\303\\244liaikaishakemiston k\\303\\244ytt\\303\\244minen ep\\303\\244onnistui\\0\"\\\n  \"Asennuskansion poistaminen ep\\303\\244onnistui\\0\"\\\n  \"Pikakuvakkeen poistaminen ep\\303\\244onnistui\\0\"\\\n  \"PDF-esikatselijan poistaminen ep\\303\\244onnistui\\0\"\\\n  \"PDF-hakusuodattimen poistaminen ep\\303\\244onnistui\\0\"\\\n  \"Selainliit\\303\\244nn\\303\\244isen poistaminen ep\\303\\244onnistui\\0\"\\\n  \"Levylle kirjoittaminen ep\\303\\244onnistui: %s\\0\"\\\n  \"Poisto-ohjelman kopioiminen v\\303\\244liaikaiskansioon ep\\303\\244onnistui\\0\"\\\n  \"Pikakuvakkeen luominen ep\\303\\244onnistui\\0\"\\\n  \"Poisto-ohjelman rekisteriavainten poistaminen ep\\303\\244onnistui\\0\"\\\n  \"\\0\"\\\n  \"Tiedostop\\303\\244\\303\\244tetietojen kirjoittaminen rekisteriin ep\\303\\244onnistui\\0\"\\\n  \"Poistamistietojen kirjoittaminen rekisteriin ep\\303\\244onnistui\\0\"\\\n  \"Piilota\\0\"\\\n  \"Asenna SumatraPDF\\0\"\\\n  \"Asenna SumatraPDF kansioon:\\0\"\\\n  \"Asentaminen ep\\303\\244onnistui!\\0\"\\\n  \"Asennus k\\303\\244ynniss\\303\\244...\\0\"\\\n  \"Pid\\303\\244 PDF-selainlaajennus asennettuna (ei en\\303\\244\\303\\244 tuettu)\\0\"\\\n  \"&Anna Windowsin hakutoiminnon etsi\\303\\244 PDF-asiakirjoista\\0\"\\\n  \"Anna Windowsin n\\303\\244ytt\\303\\244\\303\\244 &esikatselukuvat PDF-asiakirjoille\\0\"\\\n  \"Sulje %s jatkaaksesi!\\0\"\\\n  \"Valitse kansio, johon SumatraPDF asennetaan:\\0\"\\\n  \"Osa asennettavista tiedostoista on vahingoittuneita tai ne puuttuvat\\0\"\\\n  \"Avaa SumatraPDF\\0\"\\\n  \"SumatraPDF %s asennusohjelma\\0\"\\\n  \"SumatraPDF %s poisto-ohjelma\\0\"\\\n  \"SumatraPDF on poistettu.\\0\"\\\n  \"SumatraPDF-asennusta ei l\\303\\266ytynyt.\\0\"\\\n  \"Kiitos, ett\\303\\244 valitsit SumatraPDF:n!\\0\"\\\n  \"Kiitos! SumatraPDF asennettiin.\\0\"\\\n  \"Asennusohjelma on viallinen. Lataa se uudelleen.\\nAnteeksi h\\303\\244iri\\303\\266!\\0\"\\\n  \"Poista SumatraPDF\\0\"\\\n  \"Poistaminen ep\\303\\244onnistui\\0\"\\\n  \"Poistaminen k\\303\\244ynniss\\303\\244...\\0\"\\\n  \"K\\303\\244yt\\303\\244 SumatraPDF:\\303\\244\\303\\244 PDF-asiakirjojen oletuslukijana\\0\";\n\nconst char * gTranslations_fr = \n  \"\\0\"\\\n  \"\\303\\212tes-vous certain de vouloir d\\303\\251sinstaller SumatraPDF ?\\0\"\\\n  \"Fermer\\0\"\\\n  \"Impossible de cr\\303\\251er un r\\303\\251pertoire temporaire\\0\"\\\n  \"Impossible de cr\\303\\251er le r\\303\\251pertoire d'installation\\0\"\\\n  \"Impossible d'installer l'aper\\303\\247u PDF\\0\"\\\n  \"Impossible d'installer le filtre de recherche PDF\\0\"\\\n  \"Impossible d'obtenir un r\\303\\251pertoire temporaire\\0\"\\\n  \"Impossible de supprimer le r\\303\\251pertoire d'installation\\0\"\\\n  \"Impossible de supprimer le raccourci\\0\"\\\n  \"Impossible de d\\303\\251sinstaller l'aper\\303\\247u PDF\\0\"\\\n  \"Impossible de d\\303\\251sinstaller le filtre de recherche PDF\\0\"\\\n  \"Impossible de d\\303\\251sinstalle le plug-in du navigateur\\0\"\\\n  \"Impossible d'\\303\\251crire %s sur le disque\\0\"\\\n  \"La copie du d\\303\\251sinstalleur dans un r\\303\\251pertoire temporaire a \\303\\251chou\\303\\251\\0\"\\\n  \"Impossible de cr\\303\\251er un raccourci\\0\"\\\n  \"La suppression des cl\\303\\251s de la base de registre du d\\303\\251sinstalleur a \\303\\251chou\\303\\251\\0\"\\\n  \"\\0\"\\\n  \"L'\\303\\251criture dans la base de registre des informations \\303\\251tendues de l'extension de fichier a \\303\\251chou\\303\\251\\0\"\\\n  \"L'\\303\\251criture des informations de d\\303\\251sinstallation dans la base de registre a \\303\\251chou\\303\\251\\0\"\\\n  \"Masque les &options\\0\"\\\n  \"Installer SumatraPDF\\0\"\\\n  \"Installer SumatraPDF dans le r\\303\\251pertoire :\\0\"\\\n  \"\\303\\211chec de l'installation !\\0\"\\\n  \"Installation en cours\\342\\200\\246\\0\"\\\n  \"Conserver le plugin pour navigateur (plus de support)\\0\"\\\n  \"Permettre \\303\\240 Windows Desktop Search la recherche de documents PDF\\0\"\\\n  \"Permettre \\303\\240 Windows de montrer des a&per\\303\\247us des documents PDF\\0\"\\\n  \"Fermez %s pour continuer, s.v.p. !\\0\"\\\n  \"S\\303\\251lectionner le r\\303\\251pertoire d'installation de SumatraPDF :\\0\"\\\n  \"Des fichiers pr\\303\\251vus pour l'installation sont endommag\\303\\251s ou manquants\\0\"\\\n  \"Lancer SumatraPDF\\0\"\\\n  \"Installeur de SumatraPDF %s\\0\"\\\n  \"D\\303\\251sinstalleur de SumatraPDF %s\\0\"\\\n  \"SumatraPDF a \\303\\251t\\303\\251 d\\303\\251sinstall\\303\\251.\\0\"\\\n  \"Installation de SumatraPDF non trouv\\303\\251e\\0\"\\\n  \"Merci d'avoir choisi SumatraPDF !\\0\"\\\n  \"Merci ! SumatraPDF a \\303\\251t\\303\\251 install\\303\\251.\\0\"\\\n  \"L'installeur est corrompu. Veuillez le t\\303\\251l\\303\\251charger de nouveau. \\nD\\303\\251sol\\303\\251 de ce d\\303\\251sagr\\303\\251ment !\\0\"\\\n  \"D\\303\\251sinstaller SumatraPDF\\0\"\\\n  \"\\303\\211chec de la d\\303\\251sinstallation\\0\"\\\n  \"D\\303\\251sinstallation en cours\\342\\200\\246\\0\"\\\n  \"Choisir SumatraPDF comme lecteur PDF par &d\\303\\251faut\\0\";\n\nconst char * gTranslations_gl = \n  \"&Opci\\303\\263ns\\0\"\\\n  \"Seguro que queres desinstalar SumatraPDF?\\0\"\\\n  \"Pechar\\0\"\\\n  \"Non se puido crear o cartafol temporal\\0\"\\\n  \"Non se puido crear o cartafol de instalaci\\303\\263n\\0\"\\\n  \"Non se puido instalado o previsualizador de PDF\\0\"\\\n  \"Non se puido instalar o filtro de busca de PDF\\0\"\\\n  \"Non se puido obter o cartafol temporal\\0\"\\\n  \"Non se puido eliminar o cartafol de instalaci\\303\\263n\\0\"\\\n  \"Non se puido eliminar o atallo\\0\"\\\n  \"Non se puido desinstalar o previsualizador de PDFs\\0\"\\\n  \"Non se puido desinstalar o filtro de buscas de PDF\\0\"\\\n  \"Non se puido desinstalar o engadido do navegador\\0\"\\\n  \"Non se puido escribir %s no disco\\0\"\\\n  \"Fallou a copia do desinstalador no cartafol temporal\\0\"\\\n  \"Fallou a creaci\\303\\263n do atallo\\0\"\\\n  \"Fallou o borrado das claves de rexistro\\0\"\\\n  \"\\0\"\\\n  \"Non se puido escribir a informaci\\303\\263n de extensi\\303\\263n do ficheiro no rexistro\\0\"\\\n  \"Fallouse ao escribir a informaci\\303\\263n de desintalaci\\303\\263n no rexistro\\0\"\\\n  \"Agochar as &opci\\303\\263ns\\0\"\\\n  \"Instalar SumatraPDF\\0\"\\\n  \"Instalar SumatraPDF no &cartafol:\\0\"\\\n  \"Fallou a instalaci\\303\\263n!\\0\"\\\n  \"Instalaci\\303\\263n en curso...\\0\"\\\n  \"Manter instalado o engadido PDF do &navegador (sen soporte)\\0\"\\\n  \"Deixar que o buscador de escritorio de Windos &busque nos documentos de PDF\\0\"\\\n  \"Deixar que Windows mostre &previsualizaci\\303\\263ns de documentos PDF\\0\"\\\n  \"Peche %s para continuar\\0\"\\\n  \"Escolla o cartafol onde quere instalar SumatraPDF\\0\"\\\n  \"Alg\\303\\272ns ficheiros a instalar est\\303\\241n danados ou faltan\\0\"\\\n  \"Iniciar SumatraPDF\\0\"\\\n  \"Instalador %s SumatraPDF\\0\"\\\n  \"Desinstalador %s SumatraPDF\\0\"\\\n  \"Desintalouse SumatraPDF\\0\"\\\n  \"Non se atopou ningunha instalaci\\303\\263n de SumatraPDF.\\0\"\\\n  \"Graci\\303\\261as por escoller SumatraPDF!\\0\"\\\n  \"Parab\\303\\251ns! Xa tes SumatraPDF instalado.\\0\"\\\n  \"O instalador danouse. Por favor, desc\\303\\241rgueo de novo.\\nDesculpe as molestias!\\0\"\\\n  \"Desinstalar SumatraPDF\\0\"\\\n  \"Fallou a desinstalaci\\303\\263n\\0\"\\\n  \"Desinstalaci\\303\\263n en procreso...\\0\"\\\n  \"Emprega SumatraPDF como o lector de PDF por &defecto\\0\";\n\nconst char * gTranslations_de = \n  \"&Optionen\\0\"\\\n  \"M\\303\\266chten Sie SumatraPDF wirklich deinstallieren?\\0\"\\\n  \"Schlie\\303\\237en\\0\"\\\n  \"Konnte das Tempor\\303\\244rverzeichnis nicht erstellen\\0\"\\\n  \"Konnte das Installationsverzeichnis nicht erstellen\\0\"\\\n  \"Konnte die PDF Vorschau nicht installieren\\0\"\\\n  \"Konnte den PDF Suchfilter nicht installieren\\0\"\\\n  \"Konnte das tempor\\303\\244re Verzeichnis nicht finden\\0\"\\\n  \"Konnte das Installationsverzeichnis nicht l\\303\\266schen\\0\"\\\n  \"Konnte die Verkn\\303\\274pfung nicht l\\303\\266schen\\0\"\\\n  \"Konnte die PDF Vorschau nicht deinstallieren\\0\"\\\n  \"Konnte den PDF Suchfilter nicht deinstallieren\\0\"\\\n  \"Konnte das Browser-Plugin nicht deinstallieren\\0\"\\\n  \"Konnte %s nicht kopieren\\0\"\\\n  \"Konnte das Deinstallationsprogramm nicht kopieren\\0\"\\\n  \"Konnte keine Verkn\\303\\274pfung erstellen\\0\"\\\n  \"Konnte nicht alle Registry-Eintr\\303\\244ge l\\303\\266schen\\0\"\\\n  \"\\0\"\\\n  \"Konnte die Dateiformats-Verkn\\303\\274pfungen nicht vollst\\303\\244ndig in die Registry schreiben\\0\"\\\n  \"Konnte keine Deinstallations-Informationen in die Registry schreiben\\0\"\\\n  \"&Optionen\\0\"\\\n  \"Installieren\\0\"\\\n  \"&Installationsverzeichnis:\\0\"\\\n  \"Die Installation ist fehlgeschlagen!\\0\"\\\n  \"Die Installation wird ausgef\\303\\274hrt\\342\\200\\246\\0\"\\\n  \"PDF &Browser-Plugin installiert lassen (nicht mehr unterst\\303\\274tzt)\\0\"\\\n  \"PDF Dokumente in Windows-&Suchen einbeziehen\\0\"\\\n  \"&Vorschau f\\303\\274r PDF Dokumente in Explorer aktivieren\\0\"\\\n  \"Bitte schliessen Sie %s vor der Installation!\\0\"\\\n  \"In welches Verzeichnis soll SumatraPDF installiert werden?\\0\"\\\n  \"Einige Dateien konnten nicht korrekt installiert werden\\0\"\\\n  \"SumatraPDF starten\\0\"\\\n  \"SumatraPDF %s installieren\\0\"\\\n  \"SumatraPDF %s deinstallieren\\0\"\\\n  \"SumatraPDF wurde deinstalliert.\\0\"\\\n  \"Keine SumatraPDF-Installation zum Deinstallieren gefunden.\\0\"\\\n  \"Vielen Dank daf\\303\\274r, dass Sie SumatraPDF verwenden!\\0\"\\\n  \"Vielen Dank! SumatraPDF wurde erfolgreich installiert.\\0\"\\\n  \"Das Installationsprogramm wurde besch\\303\\244digt. Bitte laden Sie es erneut herunter.\\nEntschuldigen Sie bitte die Unannehmlichkeit!\\0\"\\\n  \"Deinstallieren\\0\"\\\n  \"Die Deinstallation ist fehlgeschlagen\\0\"\\\n  \"Die Deinstallation wird ausgef\\303\\274hrt\\342\\200\\246\\0\"\\\n  \"SumatraPDF als Standard&programm f\\303\\274r PDF Dokumente verwenden\\0\";\n\nconst char * gTranslations_el = \n  \"&\\316\\225\\317\\200\\316\\271\\316\\273\\316\\277\\316\\263\\316\\255\\317\\202\\0\"\\\n  \"\\316\\225\\316\\257\\317\\203\\317\\204\\316\\265 \\317\\203\\316\\257\\316\\263\\316\\277\\317\\205\\317\\201\\316\\277\\316\\271 \\317\\200\\317\\211\\317\\202 \\316\\265\\317\\200\\316\\271\\316\\270\\317\\205\\316\\274\\316\\265\\316\\257\\317\\204\\316\\265 \\317\\204\\316\\267\\316\\275 \\316\\261\\317\\200\\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\254\\317\\203\\317\\204\\316\\261\\317\\203\\316\\267 \\317\\204\\316\\277\\317\\205 SumatraPDF ;\\0\"\\\n  \"\\316\\232\\316\\273\\316\\265\\316\\257\\317\\203\\316\\271\\316\\274\\316\\277\\0\"\\\n  \"\\316\\221\\316\\264\\317\\205\\316\\275\\316\\261\\316\\274\\316\\257\\316\\261 \\316\\264\\316\\267\\316\\274\\316\\271\\316\\277\\317\\205\\317\\201\\316\\263\\316\\257\\316\\261\\317\\202 \\317\\200\\317\\201\\316\\277\\317\\203\\317\\211\\317\\201\\316\\271\\316\\275\\316\\277\\317\\215 \\317\\206\\316\\261\\316\\272\\316\\255\\316\\273\\316\\277\\317\\205\\0\"\\\n  \"\\316\\221\\316\\264\\317\\205\\316\\275\\316\\261\\316\\274\\316\\257\\316\\261 \\316\\264\\316\\267\\316\\274\\316\\271\\316\\277\\317\\205\\317\\201\\316\\263\\316\\257\\316\\261\\317\\202 \\317\\206\\316\\261\\316\\272\\316\\255\\316\\273\\316\\277\\317\\205 \\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\254\\317\\203\\317\\204\\316\\261\\317\\203\\316\\267\\317\\202\\0\"\\\n  \"\\316\\224\\316\\265\\316\\275 \\316\\256\\317\\204\\316\\261\\316\\275 \\316\\264\\317\\205\\316\\275\\316\\261\\317\\204\\316\\256 \\316\\267 \\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\254\\317\\203\\317\\204\\316\\261\\317\\203\\316\\267 \\317\\204\\316\\277\\317\\205 PDF previewer\\0\"\\\n  \"\\316\\224\\316\\265\\316\\275 \\316\\274\\317\\200\\317\\214\\317\\201\\316\\265\\317\\203\\316\\265 \\316\\275\\316\\261 \\316\\263\\316\\257\\316\\275\\316\\265\\316\\271 \\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\254\\317\\203\\317\\204\\316\\261\\317\\203\\316\\267 \\317\\204\\316\\277\\317\\205 \\317\\206\\316\\257\\316\\273\\317\\204\\317\\201\\316\\277\\317\\205 \\316\\261\\316\\275\\316\\261\\316\\266\\316\\256\\317\\204\\316\\267\\317\\203\\316\\267\\317\\202 PDF\\0\"\\\n  \"\\316\\221\\316\\264\\317\\205\\316\\275\\316\\261\\316\\274\\316\\257\\316\\261 \\316\\261\\316\\275\\316\\254\\316\\272\\317\\204\\316\\267\\317\\203\\316\\267\\317\\202 \\317\\200\\317\\201\\316\\277\\317\\203\\317\\211\\317\\201\\316\\271\\316\\275\\316\\277\\317\\215 \\317\\206\\316\\261\\316\\272\\316\\255\\316\\273\\316\\277\\317\\205\\0\"\\\n  \"\\316\\221\\316\\264\\317\\205\\316\\275\\316\\261\\316\\274\\316\\257\\316\\261 \\316\\274\\316\\265\\317\\204\\316\\261\\316\\272\\316\\257\\316\\275\\316\\267\\317\\203\\316\\267\\317\\202 \\317\\206\\316\\261\\316\\272\\316\\255\\316\\273\\316\\277\\317\\205 \\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\254\\317\\203\\317\\204\\316\\261\\317\\203\\316\\267\\317\\202\\0\"\\\n  \"\\316\\221\\316\\264\\317\\205\\316\\275\\316\\261\\316\\274\\316\\257\\316\\261 \\316\\261\\317\\200\\316\\277\\316\\274\\316\\254\\316\\272\\317\\201\\317\\205\\316\\275\\317\\203\\316\\267\\317\\202 \\317\\203\\317\\205\\316\\275\\317\\204\\317\\214\\316\\274\\316\\265\\317\\205\\317\\203\\316\\267\\317\\202\\0\"\\\n  \"\\316\\224\\316\\265\\316\\275 \\316\\256\\317\\204\\316\\261\\316\\275 \\316\\264\\317\\205\\316\\275\\316\\261\\317\\204\\316\\256 \\316\\267 \\316\\261\\317\\200\\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\254\\317\\203\\317\\204\\316\\261\\317\\203\\316\\267 \\317\\204\\316\\277\\317\\205 PDF previewer\\0\"\\\n  \"\\316\\224\\316\\265 \\316\\274\\317\\200\\317\\214\\317\\201\\316\\265\\317\\203\\316\\265 \\316\\275\\316\\261 \\316\\263\\316\\257\\316\\275\\316\\265\\316\\271 \\316\\261\\317\\200\\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\254\\317\\203\\317\\204\\316\\261\\317\\203\\316\\267 \\317\\204\\316\\277\\317\\205 \\317\\206\\316\\257\\316\\273\\317\\204\\317\\201\\316\\277\\317\\205 \\316\\261\\316\\275\\316\\261\\316\\266\\316\\256\\317\\204\\316\\267\\317\\203\\316\\267\\317\\202 PDF\\0\"\\\n  \"\\316\\224\\316\\265 \\316\\274\\317\\200\\317\\214\\317\\201\\316\\265\\317\\203\\316\\265 \\316\\275\\316\\261 \\316\\263\\316\\257\\316\\275\\316\\265\\316\\271 \\316\\261\\317\\200\\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\254\\317\\203\\317\\204\\316\\261\\317\\203\\316\\267 \\317\\204\\316\\277\\317\\205 \\317\\200\\317\\201\\317\\214\\317\\203\\316\\270\\316\\265\\317\\204\\316\\277\\317\\205 \\317\\200\\317\\201\\316\\277\\316\\263\\317\\201\\316\\254\\316\\274\\316\\274\\316\\261\\317\\204\\316\\277\\317\\202 \\317\\200\\316\\265\\317\\201\\316\\271\\316\\256\\316\\263\\316\\267\\317\\203\\316\\267\\317\\202\\0\"\\\n  \"\\316\\221\\316\\264\\317\\205\\316\\275\\316\\261\\316\\274\\316\\257\\316\\261 \\316\\265\\316\\263\\316\\263\\317\\201\\316\\261\\317\\206\\316\\256\\317\\202 %s \\317\\203\\317\\204\\316\\277\\316\\275 \\316\\264\\316\\257\\317\\203\\316\\272\\316\\277\\0\"\\\n  \"\\316\\221\\317\\200\\316\\277\\317\\204\\317\\205\\317\\207\\316\\257\\316\\261 \\316\\261\\316\\275\\317\\204\\316\\271\\316\\263\\317\\201\\316\\261\\317\\206\\316\\256\\317\\202 \\316\\261\\317\\200\\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\261\\317\\203\\317\\204\\316\\254\\317\\204\\316\\267 \\317\\203\\317\\204\\316\\277\\316\\275 \\316\\272\\316\\261\\317\\204\\316\\254\\316\\273\\316\\277\\316\\263\\316\\277 temp\\0\"\\\n  \"\\316\\221\\317\\200\\316\\277\\317\\204\\317\\205\\317\\207\\316\\257\\316\\261 \\316\\264\\316\\267\\316\\274\\316\\271\\316\\277\\317\\205\\317\\201\\316\\263\\316\\257\\316\\261\\317\\202 \\317\\203\\317\\205\\316\\275\\317\\204\\317\\214\\316\\274\\316\\265\\317\\205\\317\\203\\316\\267\\317\\202\\0\"\\\n  \"\\316\\221\\317\\200\\316\\255\\317\\204\\317\\205\\317\\207\\316\\265 \\316\\267 \\316\\264\\316\\271\\316\\261\\316\\263\\317\\201\\316\\261\\317\\206\\316\\256 \\317\\204\\317\\211\\316\\275 \\316\\272\\316\\273\\316\\265\\316\\271\\316\\264\\316\\271\\317\\216\\316\\275 \\316\\274\\316\\267\\317\\204\\317\\201\\317\\216\\316\\277\\317\\205 \\316\\261\\317\\200\\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\254\\317\\203\\317\\204\\316\\261\\317\\203\\316\\267\\317\\202\\0\"\\\n  \"\\0\"\\\n  \"\\316\\221\\317\\200\\316\\255\\317\\204\\317\\205\\317\\207\\316\\265 \\316\\267 \\316\\265\\316\\263\\316\\263\\317\\201\\316\\261\\317\\206\\316\\256 \\317\\204\\316\\277\\317\\205 \\316\\265\\316\\272\\317\\204\\316\\265\\317\\204\\316\\261\\316\\274\\316\\255\\316\\275\\316\\277\\317\\205 \\316\\261\\317\\201\\317\\207\\316\\265\\316\\257\\316\\277\\317\\205 \\317\\200\\316\\273\\316\\267\\317\\201\\316\\277\\317\\206\\316\\277\\317\\201\\316\\271\\317\\216\\316\\275 \\317\\203\\317\\204\\316\\277 \\316\\274\\316\\267\\317\\204\\317\\201\\317\\216\\316\\277\\0\"\\\n  \"\\316\\221\\317\\200\\316\\277\\317\\204\\317\\205\\317\\207\\316\\257\\316\\261 \\316\\265\\316\\263\\316\\263\\317\\201\\316\\261\\317\\206\\316\\256\\317\\202 \\317\\200\\316\\273\\316\\267\\317\\201\\316\\277\\317\\206\\316\\277\\317\\201\\316\\271\\317\\216\\316\\275 \\316\\261\\317\\200\\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\261\\317\\203\\317\\204\\316\\261\\317\\203\\316\\267\\317\\202 \\317\\203\\317\\204\\316\\277 \\316\\274\\316\\267\\317\\204\\317\\201\\317\\216\\316\\277\\0\"\\\n  \"\\316\\221\\317\\200\\317\\214\\316\\272\\317\\201\\317\\205\\317\\210\\316\\267 \\316\\265\\317\\200\\316\\271\\316\\273\\316\\277\\316\\263\\317\\216\\316\\275\\0\"\\\n  \"\\316\\225\\316\\263\\316\\272\\316\\261\\317\\204\\316\\254\\317\\203\\317\\204\\316\\261\\317\\203\\316\\267 SumatraPDF\\0\"\\\n  \"\\316\\225\\316\\263\\316\\272\\316\\261\\317\\204\\316\\254\\317\\203\\317\\204\\316\\261\\317\\203\\316\\267 SumatraPDF \\317\\203\\317\\204\\316\\277 \\317\\206\\316\\254\\316\\272\\316\\265\\316\\273\\316\\277:\\0\"\\\n  \"\\316\\221\\317\\200\\316\\277\\317\\204\\317\\205\\317\\207\\316\\257\\316\\261 \\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\254\\317\\203\\317\\204\\316\\261\\317\\203\\316\\267\\317\\202!\\0\"\\\n  \"\\316\\225\\316\\263\\316\\272\\316\\261\\317\\204\\316\\254\\317\\203\\317\\204\\316\\261\\317\\203\\316\\267 \\317\\203\\316\\265 \\316\\265\\316\\276\\316\\255\\316\\273\\316\\271\\316\\276\\316\\267...\\0\"\\\n  \"\\316\\224\\316\\271\\316\\261\\317\\204\\316\\256\\317\\201\\316\\267\\317\\203\\316\\267 \\317\\204\\316\\277\\317\\205 \\317\\200\\317\\201\\317\\214\\317\\203\\316\\270\\316\\265\\317\\204\\316\\277\\317\\205 \\317\\200\\317\\201\\316\\277\\316\\263\\317\\201\\316\\254\\316\\274\\316\\274\\316\\261\\317\\204\\316\\277\\317\\202 \\317\\200\\316\\265\\317\\201\\316\\271\\316\\256\\316\\263\\316\\267\\317\\203\\316\\267\\317\\202 PDF \\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\265\\317\\203\\317\\204\\316\\267\\316\\274\\316\\255\\316\\275\\316\\277 (\\316\\264\\316\\265 \\316\\270\\316\\261 \\317\\205\\317\\200\\316\\277\\317\\203\\317\\204\\316\\267\\317\\201\\316\\257\\316\\266\\316\\265\\317\\204\\316\\261\\316\\271 \\317\\200\\316\\273\\316\\255\\316\\277\\316\\275)\\0\"\\\n  \"\\316\\221\\316\\275\\316\\261\\316\\266\\316\\256\\317\\204\\316\\267\\317\\203\\316\\267 \\316\\265\\316\\263\\316\\263\\317\\201\\316\\254\\317\\206\\317\\211\\316\\275 PDF \\316\\274\\316\\255\\317\\203\\317\\211 \\317\\204\\316\\277\\317\\205 Windows Desktop Search \\0\"\\\n  \"\\316\\225\\316\\274\\317\\206\\316\\254\\316\\275\\316\\271\\317\\203\\316\\267 \\317\\200\\317\\201\\316\\277\\316\\265\\317\\200\\316\\271\\317\\203\\316\\272\\317\\214\\317\\200\\316\\267\\317\\203\\316\\267\\317\\202 \\317\\204\\317\\211\\316\\275 \\316\\265\\316\\263\\316\\263\\317\\201\\316\\254\\317\\206\\317\\211\\316\\275 PDF \\317\\203\\317\\204\\316\\261 Windows\\0\"\\\n  \"\\316\\240\\316\\261\\317\\201\\316\\261\\316\\272\\316\\261\\316\\273\\317\\216 \\316\\272\\316\\273\\316\\265\\316\\257\\317\\203\\317\\204\\316\\265 %s \\316\\263\\316\\271\\316\\261 \\316\\275\\316\\261 \\317\\203\\317\\205\\316\\275\\316\\265\\317\\207\\316\\257\\317\\203\\316\\265\\317\\204\\316\\265!\\0\"\\\n  \"\\316\\225\\317\\200\\316\\271\\316\\273\\316\\255\\316\\276\\317\\204\\316\\265 \\317\\204\\316\\277 \\317\\206\\316\\254\\316\\272\\316\\265\\316\\273\\316\\277 \\317\\200\\316\\277\\317\\205 \\316\\270\\316\\261 \\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\261\\317\\203\\317\\204\\316\\261\\316\\270\\316\\265\\316\\257 SumatraPDF:\\0\"\\\n  \"\\316\\237\\317\\201\\316\\271\\317\\203\\316\\274\\316\\255\\316\\275\\316\\261 \\316\\261\\317\\201\\317\\207\\316\\265\\316\\257\\316\\261 \\317\\200\\317\\201\\316\\277\\317\\202 \\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\254\\317\\203\\317\\204\\316\\261\\317\\203\\316\\267 \\316\\265\\316\\257\\316\\275\\316\\261\\316\\271 \\316\\272\\316\\261\\317\\204\\316\\265\\317\\203\\317\\204\\317\\201\\316\\261\\316\\274\\316\\274\\316\\255\\316\\275\\316\\261 \\316\\256 \\316\\273\\316\\265\\316\\257\\317\\200\\316\\277\\317\\205\\316\\275\\0\"\\\n  \"\\316\\210\\316\\275\\316\\261\\317\\201\\316\\276\\316\\267 SumatraPDF\\0\"\\\n  \"\\316\\240\\317\\201\\317\\214\\316\\263\\317\\201\\316\\261\\316\\274\\316\\274\\316\\261 \\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\254\\317\\203\\317\\204\\316\\261\\317\\203\\316\\267\\317\\202 SumatraPDF %s\\0\"\\\n  \"\\316\\240\\317\\201\\317\\214\\316\\263\\317\\201\\316\\261\\316\\274\\316\\274\\316\\261 \\316\\261\\317\\200\\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\254\\317\\203\\317\\204\\316\\261\\317\\203\\316\\267\\317\\202 SumatraPDF %s\\0\"\\\n  \"\\316\\244\\316\\277 SumatraPDF \\316\\261\\317\\200\\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\261\\317\\203\\317\\204\\316\\254\\316\\270\\316\\267\\316\\272\\316\\265.\\0\"\\\n  \"\\316\\227 \\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\254\\317\\203\\317\\204\\316\\261\\317\\203\\316\\267 \\317\\204\\316\\277\\317\\205 SumatraPDF \\316\\264\\316\\265\\316\\275 \\316\\262\\317\\201\\316\\255\\316\\270\\316\\267\\316\\272\\316\\265.\\0\"\\\n  \"\\316\\225\\317\\205\\317\\207\\316\\261\\317\\201\\316\\271\\317\\203\\317\\204\\316\\277\\317\\215\\316\\274\\316\\265 \\317\\200\\316\\277\\317\\205 \\316\\264\\316\\271\\316\\261\\316\\273\\316\\255\\316\\276\\316\\261\\317\\204\\316\\265 \\317\\204\\316\\277 SumatraPDF!\\0\"\\\n  \"\\316\\225\\317\\205\\317\\207\\316\\261\\317\\201\\316\\271\\317\\203\\317\\204\\316\\277\\317\\215\\316\\274\\316\\265! \\316\\244\\316\\277 SumatraPDF \\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\261\\317\\203\\317\\204\\316\\254\\316\\270\\316\\267\\316\\272\\316\\265.\\0\"\\\n  \"\\316\\244\\316\\277 \\317\\200\\317\\201\\317\\214\\316\\263\\317\\201\\316\\261\\316\\274\\316\\274\\316\\261 \\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\254\\317\\203\\317\\204\\316\\261\\317\\203\\316\\267\\317\\202 \\316\\255\\317\\207\\316\\265\\316\\271 \\316\\272\\316\\261\\317\\204\\316\\261\\317\\203\\317\\204\\317\\201\\316\\261\\317\\206\\316\\265\\316\\257. \\316\\240\\316\\261\\317\\201\\316\\261\\316\\272\\316\\261\\316\\273\\317\\216 \\316\\272\\316\\261\\317\\204\\316\\265\\316\\262\\316\\254\\317\\203\\317\\204\\316\\265 \\317\\204\\316\\277 \\316\\276\\316\\261\\316\\275\\316\\254.\\n\\316\\243\\317\\205\\316\\263\\316\\263\\316\\275\\317\\216\\316\\274\\316\\267 \\316\\263\\316\\271\\316\\261 \\317\\204\\316\\267\\316\\275 \\317\\204\\316\\261\\316\\273\\316\\261\\316\\271\\317\\200\\317\\211\\317\\201\\316\\257\\316\\261!\\0\"\\\n  \"\\316\\221\\317\\200\\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\254\\317\\203\\317\\204\\316\\261\\317\\203\\316\\267 SumatraPDF\\0\"\\\n  \"\\316\\221\\317\\200\\316\\277\\317\\204\\317\\205\\317\\207\\316\\257\\316\\261 \\316\\261\\317\\200\\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\254\\317\\203\\317\\204\\316\\261\\317\\203\\316\\267\\317\\202\\0\"\\\n  \"\\316\\221\\317\\200\\316\\265\\316\\263\\316\\272\\316\\261\\317\\204\\316\\254\\317\\203\\317\\204\\316\\261\\317\\203\\316\\267 \\317\\203\\316\\265 \\316\\265\\316\\276\\316\\255\\316\\273\\316\\271\\316\\276\\316\\267...\\0\"\\\n  \"\\316\\247\\317\\201\\316\\267\\317\\203\\316\\271\\316\\274\\316\\277\\317\\200\\316\\277\\316\\271\\316\\256\\317\\203\\317\\204\\316\\265 \\317\\204\\316\\277 SumatraPDF \\317\\203\\316\\261\\316\\275 \\317\\204\\316\\277 &default PDF reader\\0\";\n\nconst char * gTranslations_he = \n  \"\\327\\220\\327\\244\\327\\251\\327\\250\\327\\225\\327\\231\\327\\225\\327\\252\\0\"\\\n  \"\\327\\224\\327\\220\\327\\235 \\327\\220\\327\\252\\327\\224 \\327\\221\\327\\230\\327\\225\\327\\227 \\327\\251\\327\\221\\327\\250\\327\\246\\327\\225\\327\\240\\327\\232 \\327\\234\\327\\224\\327\\241\\327\\231\\327\\250 \\327\\220\\327\\252 SumatraPDF?\\0\"\\\n  \"\\327\\241\\327\\222\\327\\225\\327\\250\\0\"\\\n  \"\\327\\231\\327\\246\\327\\231\\327\\250\\327\\252 \\327\\252\\327\\231\\327\\247\\327\\231\\327\\231\\327\\224 \\327\\226\\327\\236\\327\\240\\327\\231\\327\\252 \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\231\\327\\246\\327\\231\\327\\250\\327\\252 \\327\\252\\327\\231\\327\\247\\327\\231\\327\\231\\327\\252 \\327\\224\\327\\252\\327\\247\\327\\240\\327\\224 \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\224\\327\\252\\327\\247\\327\\240\\327\\252 \\327\\252\\327\\246\\327\\225\\327\\222\\327\\224 \\327\\236\\327\\247\\327\\223\\327\\231\\327\\236\\327\\224 \\327\\234\\327\\247\\327\\225\\327\\221\\327\\246\\327\\231 PDF \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\224\\327\\252\\327\\247\\327\\240\\327\\252 \\327\\236\\327\\241\\327\\240\\327\\237 \\327\\227\\327\\231\\327\\244\\327\\225\\327\\251 \\327\\234- PDF \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\224\\327\\222\\327\\231\\327\\251\\327\\224 \\327\\234\\327\\252\\327\\231\\327\\247\\327\\231\\327\\231\\327\\224 \\327\\224\\327\\226\\327\\236\\327\\240\\327\\231\\327\\252 \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\224\\327\\241\\327\\250\\327\\252 \\327\\252\\327\\231\\327\\247\\327\\231\\327\\231\\327\\252 \\327\\224\\327\\224\\327\\252\\327\\247\\327\\240\\327\\224 \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\224\\327\\241\\327\\250\\327\\252 \\327\\247\\327\\231\\327\\246\\327\\225\\327\\250 \\327\\223\\327\\250\\327\\232 \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\224\\327\\241\\327\\250\\327\\252 \\327\\233\\327\\234\\327\\231 \\327\\252\\327\\246\\327\\225\\327\\222\\327\\224 \\327\\236\\327\\247\\327\\223\\327\\231\\327\\236\\327\\224 \\327\\234- PDF \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\224\\327\\241\\327\\250\\327\\252 \\327\\236\\327\\241\\327\\240\\327\\237 \\327\\227\\327\\231\\327\\244\\327\\225\\327\\251 \\327\\234- PDF \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\224\\327\\241\\327\\250\\327\\252 \\327\\224\\327\\252\\327\\225\\327\\241\\327\\243 \\327\\234\\327\\223\\327\\244\\327\\223\\327\\244\\327\\237 \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\233\\327\\252\\327\\231\\327\\221\\327\\252 %s \\327\\234\\327\\223\\327\\231\\327\\241\\327\\247 \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\224\\327\\242\\327\\252\\327\\247\\327\\252 \\327\\236\\327\\241\\327\\231\\327\\250 \\327\\224\\327\\252\\327\\225\\327\\233\\327\\240\\327\\224 \\327\\234\\327\\252\\327\\231\\327\\247\\327\\231\\327\\231\\327\\224 \\327\\224\\327\\226\\327\\236\\327\\240\\327\\231\\327\\252 \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\231\\327\\246\\327\\231\\327\\250\\327\\252 \\327\\247\\327\\231\\327\\246\\327\\225\\327\\250 \\327\\223\\327\\250\\327\\232 \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\236\\327\\227\\327\\231\\327\\247\\327\\252 \\327\\236\\327\\244\\327\\252\\327\\227\\327\\225\\327\\252 \\327\\250\\327\\231\\327\\251\\327\\225\\327\\235 \\327\\251\\327\\234 \\327\\236\\327\\241\\327\\231\\327\\250 \\327\\224\\327\\252\\327\\225\\327\\233\\327\\240\\327\\224 \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\0\"\\\n  \"\\327\\233\\327\\252\\327\\231\\327\\221\\327\\252 \\327\\240\\327\\252\\327\\225\\327\\240\\327\\231 \\327\\241\\327\\231\\327\\225\\327\\236\\327\\252 \\327\\247\\327\\221\\327\\246\\327\\231\\327\\235 \\327\\221\\327\\250\\327\\231\\327\\251\\327\\225\\327\\235 \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\233\\327\\252\\327\\231\\327\\221\\327\\252 \\327\\240\\327\\252\\327\\225\\327\\240\\327\\231 \\327\\224\\327\\241\\327\\250\\327\\252 \\327\\224\\327\\252\\327\\225\\327\\233\\327\\240\\327\\224 \\327\\221\\327\\250\\327\\231\\327\\251\\327\\225\\327\\235 \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\224\\327\\241\\327\\252\\327\\250 \\327\\220\\327\\244\\327\\251\\327\\250\\327\\225\\327\\231\\327\\225\\327\\252\\0\"\\\n  \"\\327\\224\\327\\252\\327\\247\\327\\237 \\327\\220\\327\\252 SumatraPDF\\0\"\\\n  \"\\327\\224\\327\\252\\327\\247\\327\\237 \\327\\220\\327\\252 SumatraPDF \\327\\221\\327\\252\\327\\231\\327\\247\\327\\231\\327\\231\\327\\224:\\0\"\\\n  \"\\327\\224\\327\\252\\327\\247\\327\\240\\327\\252 SumatraPDF \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\236\\327\\252\\327\\247\\327\\231\\327\\237 \\327\\220\\327\\252 SumatraPDF...\\0\"\\\n  \"\\327\\224\\327\\251\\327\\220\\327\\250 \\327\\220\\327\\252 \\327\\252\\327\\225\\327\\241\\327\\243 PDF \\327\\234\\327\\223\\327\\244\\327\\223\\327\\244\\327\\240\\327\\231\\327\\235 (\\327\\224\\327\\252\\327\\225\\327\\241\\327\\243 \\327\\220\\327\\231\\327\\240\\327\\225 \\327\\240\\327\\252\\327\\236\\327\\232 \\327\\242\\327\\225\\327\\223)\\0\"\\\n  \"\\327\\220\\327\\244\\327\\251\\327\\250 \\327\\227\\327\\231\\327\\244\\327\\225\\327\\251 \\327\\247\\327\\225\\327\\221\\327\\246\\327\\231 PDF \\327\\221\\327\\236\\327\\242\\327\\250\\327\\233\\327\\252 \\327\\224\\327\\227\\327\\231\\327\\244\\327\\225\\327\\251 \\327\\251\\327\\234 Windows\\0\"\\\n  \"\\327\\220\\327\\244\\327\\251\\327\\250 \\327\\252\\327\\246\\327\\225\\327\\222\\327\\224 \\327\\236\\327\\247\\327\\223\\327\\231\\327\\236\\327\\224 \\327\\251\\327\\234 \\327\\247\\327\\225\\327\\221\\327\\246\\327\\231 PDF\\0\"\\\n  \"\\327\\234\\327\\224\\327\\236\\327\\251\\327\\232, \\327\\220\\327\\240\\327\\220 \\327\\241\\327\\222\\327\\225\\327\\250 \\327\\220\\327\\252 %s!\\0\"\\\n  \"\\327\\221\\327\\227\\327\\250 \\327\\220\\327\\252 \\327\\252\\327\\231\\327\\247\\327\\231\\327\\231\\327\\252 \\327\\224\\327\\224\\327\\252\\327\\247\\327\\240\\327\\224 \\327\\251\\327\\234 SumatraPDF:\\0\"\\\n  \"\\327\\247\\327\\225\\327\\221\\327\\246\\327\\231 \\327\\224\\327\\252\\327\\247\\327\\240\\327\\224 \\327\\236\\327\\241\\327\\225\\327\\231\\327\\236\\327\\231\\327\\235 \\327\\244\\327\\222\\327\\225\\327\\236\\327\\231\\327\\235 \\327\\220\\327\\225 \\327\\227\\327\\241\\327\\250\\327\\231\\327\\235.\\0\"\\\n  \"\\327\\224\\327\\244\\327\\242\\327\\234 \\327\\220\\327\\252 SumatraPDF\\0\"\\\n  \"\\327\\224\\327\\252\\327\\247\\327\\240\\327\\252 SumatraPDF %s\\0\"\\\n  \"\\327\\224\\327\\241\\327\\250\\327\\252 SumatraPDF %s\\0\"\\\n  \"\\327\\224\\327\\252\\327\\247\\327\\240\\327\\252 SumatraPDF \\327\\224\\327\\225\\327\\251\\327\\234\\327\\236\\327\\224.\\0\"\\\n  \"\\327\\224\\327\\252\\327\\247\\327\\240\\327\\252 SumatraPDF \\327\\234\\327\\220 \\327\\240\\327\\236\\327\\246\\327\\220\\327\\224.\\0\"\\\n  \"\\327\\252\\327\\225\\327\\223\\327\\224 \\327\\242\\327\\234 \\327\\221\\327\\227\\327\\231\\327\\250\\327\\252\\327\\232 \\327\\221- SumatraPDF.\\0\"\\\n  \"\\327\\224\\327\\252\\327\\247\\327\\240\\327\\252 SumatraPDF \\327\\224\\327\\225\\327\\251\\327\\234\\327\\236\\327\\224.\\0\"\\\n  \"\\327\\247\\327\\225\\327\\221\\327\\245 \\327\\224\\327\\224\\327\\252\\327\\247\\327\\240\\327\\224 \\327\\244\\327\\222\\327\\225\\327\\235. \\327\\220\\327\\240\\327\\220 \\327\\224\\327\\225\\327\\250\\327\\223 \\327\\251\\327\\225\\327\\221.\\0\"\\\n  \"\\327\\224\\327\\241\\327\\250 \\327\\220\\327\\252 SumatraPDF\\0\"\\\n  \"\\327\\224\\327\\241\\327\\250\\327\\252 SumatraPDF \\327\\240\\327\\233\\327\\251\\327\\234\\327\\224.\\0\"\\\n  \"\\327\\236\\327\\241\\327\\231\\327\\250 \\327\\220\\327\\252 SumatraPDF...\\0\"\\\n  \"\\327\\224\\327\\222\\327\\223\\327\\250 \\327\\220\\327\\252 SumatraPDF \\327\\233\\327\\252\\327\\225\\327\\233\\327\\240\\327\\252 \\327\\221\\327\\250\\327\\231\\327\\250\\327\\252 \\327\\236\\327\\227\\327\\223\\327\\234 \\327\\234\\327\\247\\327\\225\\327\\221\\327\\246\\327\\231 PDF\\0\";\n\nconst char * gTranslations_hu = \n  \"&Be\\303\\241ll\\303\\255t\\303\\241sok\\0\"\\\n  \"Biztosan el szeretn\\303\\251 t\\303\\241vol\\303\\255tani a SumatraPDF-et?\\0\"\\\n  \"Bez\\303\\241r\\303\\241s\\0\"\\\n  \"Ideiglenes k\\303\\266nyvt\\303\\241r l\\303\\251trehoz\\303\\241sa sikertelen\\0\"\\\n  \"Telep\\303\\255t\\303\\251si k\\303\\266nyvt\\303\\241r l\\303\\251trehoz\\303\\241sa sikertelen\\0\"\\\n  \"PDF el\\305\\221n\\303\\251zet-megjelen\\303\\255t\\305\\221 telep\\303\\255t\\303\\251se sikertelen\\0\"\\\n  \"PDF keres\\303\\251si sz\\305\\261r\\305\\221 telep\\303\\255t\\303\\251se sikertelen\\0\"\\\n  \"Ideiglenes k\\303\\266nyvt\\303\\241r nem \\303\\251rhet\\305\\221 el\\0\"\\\n  \"Telep\\303\\255t\\303\\251si k\\303\\266nyvt\\303\\241r elt\\303\\241vol\\303\\255t\\303\\241sa sikertelen\\0\"\\\n  \"Parancsikon elt\\303\\241vol\\303\\255t\\303\\241sa sikertelen\\0\"\\\n  \"PDF el\\305\\221n\\303\\251zet-megjelen\\303\\255t\\305\\221 elt\\303\\241vol\\303\\255t\\303\\241sa sikertelen\\0\"\\\n  \"PDF keres\\303\\251si sz\\305\\261r\\305\\221 elt\\303\\241vol\\303\\255t\\303\\241sa sikertelen\\0\"\\\n  \"B\\303\\266ng\\303\\251sz\\305\\221 be\\303\\251p\\303\\274l\\305\\221 elt\\303\\241vol\\303\\255t\\303\\241sa sikertelen\\0\"\\\n  \"%s lemezre \\303\\255r\\303\\241sa sikertelen\\0\"\\\n  \"Az elt\\303\\241vol\\303\\255t\\303\\263 ideiglenes k\\303\\266nyvt\\303\\241rba m\\303\\241sol\\303\\241sa nem siker\\303\\274lt\\0\"\\\n  \"Nem siker\\303\\274lt l\\303\\251trehozni a parancsikont\\0\"\\\n  \"Az elt\\303\\241vol\\303\\255t\\303\\263 rendszerle\\303\\255r\\303\\263 adatb\\303\\241zis kulcsainak t\\303\\266rl\\303\\251se sikertelen\\0\"\\\n  \"\\0\"\\\n  \"Nem siker\\303\\274lt \\303\\255rni a kiterjesztett f\\303\\241jlkiterjeszt\\303\\251st inform\\303\\241ci\\303\\263kat a rendszerle\\303\\255r\\303\\263 adatb\\303\\241zisban\\0\"\\\n  \"Elt\\303\\241vol\\303\\255t\\303\\241ssal kapcsolatos inform\\303\\241ci\\303\\263k rendszerle\\303\\255r\\303\\263 adatb\\303\\241zisba \\303\\255r\\303\\241sa sikertelen\\0\"\\\n  \"Be\\303\\241ll\\303\\255t\\303\\241sok elrejt\\303\\251se\\0\"\\\n  \"SumatraPDF telep\\303\\255t\\303\\251se\\0\"\\\n  \"SumatraPDF telep\\303\\255t\\303\\251se a k\\303\\266vetkez\\305\\221 &k\\303\\266nyvt\\303\\241rba:\\0\"\\\n  \"Telep\\303\\255t\\303\\251s sikertelen!\\0\"\\\n  \"Telep\\303\\255t\\303\\251s folyamatban...\\0\"\\\n  \"Hagyja a PDF b\\303\\266ng\\303\\251sz\\305\\221 be\\303\\251p\\303\\274l\\305\\221t telep\\303\\255tve (m\\303\\241r nem t\\303\\241mogatott)\\0\"\\\n  \"Hagyja a Windows Desktop Search-re a PDF dokumentumok keres\\303\\251s\\303\\251t\\0\"\\\n  \"Hagyja a Windows-ra a PDF dokumentumok el\\305\\221n\\303\\251zet\\303\\251nek megjelen\\303\\255t\\303\\251s\\303\\251t\\0\"\\\n  \"A(z) %s bez\\303\\241r\\303\\241sa sz\\303\\274ks\\303\\251ges a folytat\\303\\241shoz!\\0\"\\\n  \"V\\303\\241lassza ki a SumatraPDF telep\\303\\255t\\303\\251si k\\303\\266nyvt\\303\\241r\\303\\241t:\\0\"\\\n  \"N\\303\\251h\\303\\241ny, a telep\\303\\255t\\303\\251shez sz\\303\\274ks\\303\\251ges f\\303\\241jl s\\303\\251r\\303\\274lt vagy hi\\303\\241nyzik\\0\"\\\n  \"SumatraPDF ind\\303\\255t\\303\\241sa\\0\"\\\n  \"SumatraPDF %s telep\\303\\255t\\305\\221\\0\"\\\n  \"SumatraPDF %s elt\\303\\241vol\\303\\255t\\303\\263\\0\"\\\n  \"SumatraPDF elt\\303\\241vol\\303\\255t\\303\\241sa befejez\\305\\221d\\303\\266tt.\\0\"\\\n  \"SumatraPDF telep\\303\\255t\\305\\221 nem tal\\303\\241lhat\\303\\263.\\0\"\\\n  \"K\\303\\266sz\\303\\266nj\\303\\274k, hogy a SumatraPDF-et v\\303\\241lasztotta!\\0\"\\\n  \"K\\303\\266sz\\303\\266nj\\303\\274k! A SumatraPDF telep\\303\\255t\\303\\251se befejez\\305\\221d\\303\\266tt.\\0\"\\\n  \"A telep\\303\\255t\\305\\221 s\\303\\251r\\303\\274lt. K\\303\\251rj\\303\\274k, t\\303\\266ltse le \\303\\272jra.\\nEln\\303\\251z\\303\\251st k\\303\\251r\\303\\274nk a kellemetlens\\303\\251g\\303\\251rt!\\0\"\\\n  \"SumatraPDF elt\\303\\241vol\\303\\255t\\303\\241sa\\0\"\\\n  \"Elt\\303\\241vol\\303\\255t\\303\\241s sikertelen\\0\"\\\n  \"Elt\\303\\241vol\\303\\255t\\303\\241s folyamatban...\\0\"\\\n  \"SumatraPDF haszn\\303\\241lata alap\\303\\251rtelmezett PDF olvas\\303\\263k\\303\\251nt\\0\";\n\nconst char * gTranslations_id = \n  \"Pilihan\\0\"\\\n  \"Anda yakin ingin menghapus instalasi SumatraPDF?\\0\"\\\n  \"Tutup\\0\"\\\n  \"Gagal membuat direktori sementara\\0\"\\\n  \"Gagal membuat direktori instalasi\\0\"\\\n  \"Gagal menginstal pratilik PDF\\0\"\\\n  \"Gagal memasang filter pencari PDF\\0\"\\\n  \"Gagal mendeteksi direktori sementara\\0\"\\\n  \"Gagal menghapus direktori instalasi\\0\"\\\n  \"Gagal menghapus shortcut\\0\"\\\n  \"Gagal menghapus penampil cepat PDF\\0\"\\\n  \"Gagal menghapus filter pencari PDF\\0\"\\\n  \"Gagal menghapus plugin untuk peramban\\0\"\\\n  \"Gagal menulis %s ke harddisk\\0\"\\\n  \"Gagal mengkopi uninstaller ke direktori temp\\0\"\\\n  \"Gagal membuat shortcut.\\0\"\\\n  \"Gagal menghapus kunci registry uninstaller\\0\"\\\n  \"\\0\"\\\n  \"Gagal menulis info ekstensi file lanjutan ke registry\\0\"\\\n  \"Gagal menulis info penghapusan program ke registry\\0\"\\\n  \"Sembunyikan &Opsi\\0\"\\\n  \"\\0\"\\\n  \"Install SumatraPDF ke &folder:\\0\"\\\n  \"Instalasi gagal!\\0\"\\\n  \"Instalasi sedang berlangsung...\\0\"\\\n  \"Biarkan plugin peramban PDF terinstal (tidak lagi didukung)\\0\"\\\n  \"Izinkan Windows Desktop Search mencari dokumen PDF\\0\"\\\n  \"Izinkan Windows menampilkan dokumen PDF\\0\"\\\n  \"Silakan tutup %s untuk melanjutkan.\\0\"\\\n  \"Pilih folder instalasi SumatraPDF:\\0\"\\\n  \"Beberapa berkas yang akan diinstal rusak atau terhapus.\\0\"\\\n  \"Jalankan SumatraPDF\\0\"\\\n  \"Pasang SumatraPDF %s\\0\"\\\n  \"Penghapus SumatraPDF %s\\0\"\\\n  \"SumatraPDF telah dihapus\\0\"\\\n  \"Instalasi SumatraPDF tidak ditemukan.\\0\"\\\n  \"Terima kasih telah memakai SumatraPDF!\\0\"\\\n  \"Terima kasih. SumatraPDF telah berhasil terinstal.\\0\"\\\n  \"Installer rusak. Harap unduh lagi.\\nMaaf atas ketidaknyamanan ini!\\0\"\\\n  \"\\0\"\\\n  \"Proses uninstall gagal.\\0\"\\\n  \"Proses uninstall sedang berjalan...\\0\"\\\n  \"Gunakan SumatraPDF sebagai pembaca PDF standar.\\0\";\n\nconst char * gTranslations_ga = \n  \"&Roghanna\\0\"\\\n  \"An bhfuil t\\303\\272 cinnte gur mian leat SumatraPDF a dh\\303\\255shuite\\303\\241il?\\0\"\\\n  \"D\\303\\272n\\0\"\\\n  \"N\\303\\255orbh fh\\303\\251idir comhadlann sealadach a chruth\\303\\272\\0\"\\\n  \"N\\303\\255orbh fh\\303\\251idir an chomhadlann suite\\303\\241la a chruth\\303\\272\\0\"\\\n  \"N\\303\\255orbh fh\\303\\251idir r\\303\\251amhamharc\\303\\263ir PDF a shuite\\303\\241il\\0\"\\\n  \"N\\303\\255orbh fh\\303\\251idir scagaire cuardaigh PDF a shuite\\303\\241il\\0\"\\\n  \"N\\303\\255orbh fh\\303\\251idir an chomhadlann sealadach a fh\\303\\241il\\0\"\\\n  \"N\\303\\255orbh fh\\303\\251idir an chomhadlann suite\\303\\241la a bhaint\\0\"\\\n  \"N\\303\\255 f\\303\\251idir an t-aicearra a bhaint\\0\"\\\n  \"N\\303\\255orbh fh\\303\\251idir an r\\303\\251amhamharc\\303\\263ir PDF a dh\\303\\255shuite\\303\\241il\\0\"\\\n  \"N\\303\\255orbh fh\\303\\251idir an scagaire cuardaigh PDF a dh\\303\\255shuite\\303\\241il\\0\"\\\n  \"N\\303\\255orbh fh\\303\\251idir an breise\\303\\241n don l\\303\\255onl\\303\\251itheoir a dh\\303\\255shuite\\303\\241il\\0\"\\\n  \"N\\303\\255orbh fh\\303\\251idir %s a scr\\303\\255obh chuig an diosca\\0\"\\\n  \"Theip air an d\\303\\255shuite\\303\\241la\\303\\255 a mhacasamhl\\303\\272 chuig an chomhadlann sealadach\\0\"\\\n  \"Theip air aicearra a chruth\\303\\272\\0\"\\\n  \"Theip air eochracha cl\\303\\241rlainne an d\\303\\255shuite\\303\\241laithe a scriosadh\\0\"\\\n  \"\\0\"\\\n  \"Theip air faisn\\303\\251is fhairsingthe iarmh\\303\\255r comhadainm a scr\\303\\255obh chuig an chl\\303\\241rlann\\0\"\\\n  \"Theip air an fhaisn\\303\\251is d\\303\\255shuite\\303\\241laithe a scr\\303\\255obh chuig an chl\\303\\241rlann\\0\"\\\n  \"Cuir na roghanna i bhfolach\\0\"\\\n  \"Suite\\303\\241il SumatraPDF\\0\"\\\n  \"Suite\\303\\241il SumatraPDF sa bh&fillte\\303\\241n seo:\\0\"\\\n  \"Theip ar an suite\\303\\241il!\\0\"\\\n  \"Suite\\303\\241il ar si\\303\\272l...\\0\"\\\n  \"Coinnigh suite\\303\\241ilte an breise\\303\\241n don l\\303\\255onl\\303\\251itheoir PDF (n\\303\\255 thugtar taca\\303\\255ocht d\\303\\263 feasta)\\0\"\\\n  \"Lig do Chuardach Deasca Windows c\\303\\241ip\\303\\251is\\303\\255 PDF a chuardach\\0\"\\\n  \"Lig do Windows r\\303\\251amhamhairc de ch\\303\\241ip\\303\\251is\\303\\255 PDF a thaispe\\303\\241int\\0\"\\\n  \"D\\303\\272n %s le do thoil chun dul ar aghaidh!\\0\"\\\n  \"Roghnaigh an fillte\\303\\241n inar ch\\303\\263ir SumatraPDF a shuite\\303\\241il:\\0\"\\\n  \"T\\303\\241 d\\303\\255obh\\303\\241il d\\303\\251anta de roinnt de na comhaid at\\303\\241 le suite\\303\\241il n\\303\\263 t\\303\\241 siad in easnamh\\0\"\\\n  \"Tosaigh SumatraPDF\\0\"\\\n  \"Suite\\303\\241la\\303\\255 %s SumatraPDF\\0\"\\\n  \"D\\303\\255shuite\\303\\241la\\303\\255 SumatraPDF %s\\0\"\\\n  \"D\\303\\255shuite\\303\\241ladh SumatraPDF.\\0\"\\\n  \"N\\303\\255or aims\\303\\255odh suite\\303\\241il SumatraPDF.\\0\"\\\n  \"Go raibh maith agat as ucht SumatraPDF a roghn\\303\\272!\\0\"\\\n  \"Go raibh maith agat! Suite\\303\\241ladh SumatraPDF.\\0\"\\\n  \"T\\303\\241 an suite\\303\\241la\\303\\255 truaillithe. D\\303\\251an \\303\\251 a \\303\\255oslucht\\303\\272 ar\\303\\255s le do thoil.\\nIs dona linn aon mh\\303\\255chuibhi\\303\\272lacht!\\0\"\\\n  \"D\\303\\251an SumatraPDF a dh\\303\\255shuite\\303\\241il\\0\"\\\n  \"Theip air d\\303\\255shuite\\303\\241il\\0\"\\\n  \"D\\303\\255shuite\\303\\241il ar si\\303\\272l...\\0\"\\\n  \"Bain feidhm as SumatraPDF mar an l\\303\\251itheoir PDF r\\303\\251amhshocraithe\\0\";\n\nconst char * gTranslations_it = \n  \"&Opzioni\\0\"\\\n  \"Siete sicuri di voler disinstallare SumatraPDF?\\0\"\\\n  \"Chiudi\\0\"\\\n  \"Impossibile creare la cartella temporanea\\0\"\\\n  \"Impossibile creare la cartella di installazione\\0\"\\\n  \"Impossibile installare modulo anteprima PDF\\0\"\\\n  \"Impossibile installare filtro ricerca PDF\\0\"\\\n  \"Impossibile ottenere la cartella temporanea\\0\"\\\n  \"Impossibile rimuovere la cartella di installazione\\0\"\\\n  \"Impossibile rimuovere il collegamento\\0\"\\\n  \"Impossibile disinstallare modulo anteprima PDF\\0\"\\\n  \"Impossibile disinstallare filtro ricerca PDF\\0\"\\\n  \"Impossibile disinstallare il plugin del browser\\0\"\\\n  \"Impossibile scrivere %s nel disco.\\0\"\\\n  \"Impossibile copiare programma disinstallazione nella cartella temporanea\\0\"\\\n  \"Impossibile creare il collegamento\\0\"\\\n  \"Impossibile rimuovere chiavi registro\\0\"\\\n  \"\\0\"\\\n  \"Scrittura fallita informazione estensione estesa file nel registro\\0\"\\\n  \"Scrittura fallita informazione disinstallazione nel registro\\0\"\\\n  \"Nascondi & opzioni\\0\"\\\n  \"Installa SumatraPDF\\0\"\\\n  \"Installa SumatraPD&F nella cartella:\\0\"\\\n  \"Installazione fallita!\\0\"\\\n  \"Installazione in corso...\\0\"\\\n  \"Mantieni installato il plugin PDF del &browser (non pi\\303\\271 supportato)\\0\"\\\n  \"Assegna a Windows la ricerca sul desktop & dei documenti PDF\\0\"\\\n  \"Assegna a Windows la visualizzazione & anteprima dei documenti PDF\\0\"\\\n  \"Chiudi %s per continuare!\\0\"\\\n  \"Seleziona la cartella dove installare SumatraPDF:\\0\"\\\n  \"Alcuni file che dovevano essere installati erano corrotti o mancanti\\0\"\\\n  \"Avvia SumatraPDF\\0\"\\\n  \"Installazione SumatraPDF %s\\0\"\\\n  \"Disinstallazione SumatraPDF %s\\0\"\\\n  \"SumatraPDF \\303\\250 stata completamente disinstallato.\\0\"\\\n  \"Installazione SumatraPDF non trovata.\\0\"\\\n  \"Grazie per aver scelto SumatraPDF!\\0\"\\\n  \"Grazie! SumatraPDF installato correttamente.\\0\"\\\n  \"Il programma di installazione \\303\\250 danneggiato. Riscaricalo nuovamente.\\nSiamo spiacenti per l'incoveniente!\\0\"\\\n  \"Disinstalla SumatraPDF\\0\"\\\n  \"Disinstallazione fallita\\0\"\\\n  \"Disinstallazione in corso...\\0\"\\\n  \"Usa SumatraPDF come lettore PDF pre&definito\\0\";\n\nconst char * gTranslations_ja = \n  \"\\343\\202\\252\\343\\203\\227\\343\\202\\267\\343\\203\\247\\343\\203\\263(&O)\\0\"\\\n  \"SumatraPDF\\343\\202\\222\\346\\234\\254\\345\\275\\223\\343\\201\\253\\343\\202\\242\\343\\203\\263\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\253\\343\\201\\227\\343\\201\\276\\343\\201\\231\\343\\201\\213\\357\\274\\237\\0\"\\\n  \"\\351\\226\\211\\343\\201\\230\\343\\202\\213\\0\"\\\n  \"\\344\\270\\200\\346\\231\\202\\343\\203\\207\\343\\202\\243\\343\\203\\254\\343\\202\\257\\343\\203\\210\\343\\203\\252\\343\\202\\222\\344\\275\\234\\346\\210\\220\\343\\201\\247\\343\\201\\215\\343\\201\\276\\343\\201\\233\\343\\202\\223\\343\\201\\247\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\253\\345\\205\\210\\343\\203\\207\\343\\202\\243\\343\\203\\254\\343\\202\\257\\343\\203\\210\\343\\203\\252\\343\\202\\222\\344\\275\\234\\346\\210\\220\\343\\201\\247\\343\\201\\215\\343\\201\\276\\343\\201\\233\\343\\202\\223\\343\\201\\247\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"PDF \\343\\203\\227\\343\\203\\254\\343\\203\\223\\343\\203\\245\\343\\203\\274\\343\\202\\242\\343\\202\\222\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\253\\343\\201\\247\\343\\201\\215\\343\\201\\276\\343\\201\\233\\343\\202\\223\\343\\201\\247\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"PDF \\346\\244\\234\\347\\264\\242\\343\\203\\225\\343\\202\\243\\343\\203\\253\\343\\202\\277\\343\\202\\222\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\253\\343\\201\\247\\343\\201\\215\\343\\201\\276\\343\\201\\233\\343\\202\\223\\343\\201\\247\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"\\344\\270\\200\\346\\231\\202\\343\\203\\207\\343\\202\\243\\343\\203\\254\\343\\202\\257\\343\\203\\210\\343\\203\\252\\343\\202\\222\\347\\242\\272\\344\\277\\235\\343\\201\\247\\343\\201\\215\\343\\201\\276\\343\\201\\233\\343\\202\\223\\343\\201\\247\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\253\\345\\205\\210\\343\\203\\207\\343\\202\\243\\343\\203\\254\\343\\202\\257\\343\\203\\210\\343\\203\\252\\343\\202\\222\\345\\211\\212\\351\\231\\244\\343\\201\\247\\343\\201\\215\\343\\201\\276\\343\\201\\233\\343\\202\\223\\343\\201\\247\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"\\343\\202\\267\\343\\203\\247\\343\\203\\274\\343\\203\\210\\343\\202\\253\\343\\203\\203\\343\\203\\210\\343\\202\\222\\345\\211\\212\\351\\231\\244\\343\\201\\247\\343\\201\\215\\343\\201\\276\\343\\201\\233\\343\\202\\223\\343\\201\\247\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"PDF \\343\\203\\227\\343\\203\\254\\343\\203\\223\\343\\203\\245\\343\\203\\274\\343\\202\\242\\343\\202\\222\\343\\202\\242\\343\\203\\263\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\253\\343\\201\\247\\343\\201\\215\\343\\201\\276\\343\\201\\233\\343\\202\\223\\343\\201\\247\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"PDF \\346\\244\\234\\347\\264\\242\\343\\203\\225\\343\\202\\243\\343\\203\\253\\343\\202\\277\\343\\202\\222\\343\\202\\242\\343\\203\\263\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\253\\343\\201\\247\\343\\201\\215\\343\\201\\276\\343\\201\\233\\343\\202\\223\\343\\201\\247\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"\\343\\203\\226\\343\\203\\251\\343\\202\\246\\343\\202\\266\\343\\203\\227\\343\\203\\251\\343\\202\\260\\343\\202\\244\\343\\203\\263\\343\\202\\222\\343\\202\\242\\343\\203\\263\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\253\\343\\201\\247\\343\\201\\215\\343\\201\\276\\343\\201\\233\\343\\202\\223\\343\\201\\247\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"%s \\343\\202\\222\\343\\203\\207\\343\\202\\243\\343\\202\\271\\343\\202\\257\\343\\201\\253\\346\\233\\270\\343\\201\\215\\350\\276\\274\\343\\202\\201\\343\\201\\276\\343\\201\\233\\343\\202\\223\\343\\201\\247\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"\\343\\202\\242\\343\\203\\263\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\251\\343\\202\\222\\344\\270\\200\\346\\231\\202\\343\\203\\207\\343\\202\\243\\343\\203\\254\\343\\202\\257\\343\\203\\210\\343\\203\\252\\343\\201\\270\\343\\202\\263\\343\\203\\224\\343\\203\\274\\343\\201\\231\\343\\202\\213\\343\\201\\256\\343\\201\\253\\345\\244\\261\\346\\225\\227\\343\\201\\227\\343\\201\\276\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"\\343\\202\\267\\343\\203\\247\\343\\203\\274\\343\\203\\210\\343\\202\\253\\343\\203\\203\\343\\203\\210\\343\\201\\256\\344\\275\\234\\346\\210\\220\\343\\201\\253\\345\\244\\261\\346\\225\\227\\343\\201\\227\\343\\201\\276\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"\\343\\202\\242\\343\\203\\263\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\251\\343\\201\\256\\343\\203\\254\\343\\202\\270\\343\\202\\271\\343\\203\\210\\343\\203\\252\\343\\202\\255\\343\\203\\274\\343\\202\\222\\345\\211\\212\\351\\231\\244\\343\\201\\231\\343\\202\\213\\343\\201\\256\\343\\201\\253\\345\\244\\261\\346\\225\\227\\343\\201\\227\\343\\201\\276\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"\\0\"\\\n  \"\\346\\213\\241\\345\\274\\265\\345\\255\\220\\346\\203\\205\\345\\240\\261\\343\\202\\222\\343\\203\\254\\343\\202\\270\\343\\202\\271\\343\\203\\210\\343\\203\\252\\343\\201\\253\\346\\233\\270\\343\\201\\215\\350\\276\\274\\343\\202\\200\\343\\201\\256\\343\\201\\253\\345\\244\\261\\346\\225\\227\\343\\201\\227\\343\\201\\276\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"\\343\\202\\242\\343\\203\\263\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\253\\346\\203\\205\\345\\240\\261\\343\\202\\222\\343\\203\\254\\343\\202\\270\\343\\202\\271\\343\\203\\210\\343\\203\\252\\343\\201\\253\\346\\233\\270\\343\\201\\215\\350\\276\\274\\343\\202\\200\\343\\201\\256\\343\\201\\253\\345\\244\\261\\346\\225\\227\\343\\201\\227\\343\\201\\276\\343\\201\\227\\343\\201\\237\\0\"\\\n  \"\\343\\202\\252\\343\\203\\227\\343\\202\\267\\343\\203\\247\\343\\203\\263\\343\\202\\222\\351\\232\\240\\343\\201\\231(&O)\\0\"\\\n  \"SumatraPDF\\343\\202\\222\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\253\\0\"\\\n  \"SumatraPDF \\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\253\\345\\205\\210\\343\\203\\225\\343\\202\\251\\343\\203\\253\\343\\203\\200(&F)\\0\"\\\n  \"\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\253\\343\\201\\253\\345\\244\\261\\346\\225\\227\\357\\274\\201\\0\"\\\n  \"\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\253\\344\\270\\255\\342\\200\\246\\0\"\\\n  \"PDF\\351\\226\\262\\350\\246\\247\\343\\203\\227\\343\\203\\251\\343\\202\\260\\343\\202\\244\\343\\203\\263\\343\\201\\256\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\253\\343\\201\\257\\344\\277\\235\\343\\201\\244(&b) (\\345\\273\\203\\346\\255\\242\\343\\201\\225\\343\\202\\214\\343\\201\\237\\346\\251\\237\\350\\203\\275)\\0\"\\\n  \"Windows \\343\\203\\207\\343\\202\\271\\343\\202\\257\\343\\203\\210\\343\\203\\203\\343\\203\\227 \\343\\202\\265\\343\\203\\274\\343\\203\\201\\343\\201\\256 PDF \\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\346\\244\\234\\347\\264\\242\\343\\202\\222\\350\\250\\261\\345\\217\\257\\343\\201\\231\\343\\202\\213(&s)\\0\"\\\n  \"Windows \\343\\201\\256 PDF \\343\\203\\211\\343\\202\\255\\343\\203\\245\\343\\203\\241\\343\\203\\263\\343\\203\\210\\343\\203\\227\\343\\203\\254\\343\\203\\223\\343\\203\\245\\343\\203\\274\\343\\202\\222\\350\\250\\261\\345\\217\\257\\343\\201\\231\\343\\202\\213(&p)\\0\"\\\n  \"%s \\343\\202\\222\\351\\226\\211\\343\\201\\230\\343\\201\\246\\343\\201\\217\\343\\201\\240\\343\\201\\225\\343\\201\\204\\0\"\\\n  \"\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\253\\345\\205\\210\\343\\203\\207\\343\\202\\243\\343\\203\\254\\343\\202\\257\\343\\203\\210\\343\\203\\252\\343\\201\\256\\351\\201\\270\\346\\212\\236:\\0\"\\\n  \"\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\253\\343\\201\\231\\343\\201\\271\\343\\201\\215\\343\\201\\204\\343\\201\\217\\343\\201\\244\\343\\201\\213\\343\\201\\256\\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253\\343\\201\\214\\347\\240\\264\\346\\220\\215\\343\\201\\227\\343\\201\\246\\343\\201\\204\\343\\202\\213\\343\\201\\213\\345\\255\\230\\345\\234\\250\\343\\201\\227\\343\\201\\276\\343\\201\\233\\343\\202\\223\\343\\200\\202\\0\"\\\n  \"SumatraPDF\\343\\202\\222\\345\\256\\237\\350\\241\\214\\0\"\\\n  \"SumatraPDF %s \\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\251\\0\"\\\n  \"SumatraPDF %s \\343\\202\\242\\343\\203\\263\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\251\\0\"\\\n  \"SumatraPDF \\343\\201\\214\\343\\202\\242\\343\\203\\263\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\253\\343\\201\\225\\343\\202\\214\\343\\201\\276\\343\\201\\227\\343\\201\\237\\343\\200\\202\\0\"\\\n  \"SumatraPDF\\343\\201\\256\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\253\\346\\203\\205\\345\\240\\261\\343\\202\\222\\350\\246\\213\\343\\201\\244\\343\\201\\221\\343\\202\\211\\343\\202\\214\\343\\201\\276\\343\\201\\233\\343\\202\\223\\0\"\\\n  \"SumatraPDF \\343\\202\\222\\351\\201\\270\\343\\202\\223\\343\\201\\247\\351\\240\\202\\343\\201\\215\\343\\201\\202\\343\\202\\212\\343\\201\\214\\343\\201\\250\\343\\201\\206\\343\\201\\224\\343\\201\\226\\343\\201\\204\\343\\201\\276\\343\\201\\231\\357\\274\\201\\0\"\\\n  \"\\343\\201\\202\\343\\202\\212\\343\\201\\214\\343\\201\\250\\343\\201\\206\\357\\274\\201SumatraPDF \\343\\201\\257\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\253\\343\\201\\225\\343\\202\\214\\343\\201\\276\\343\\201\\227\\343\\201\\237\\343\\200\\202\\0\"\\\n  \"\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\251\\343\\201\\214\\347\\240\\264\\346\\220\\215\\343\\201\\227\\343\\201\\246\\343\\201\\204\\343\\201\\276\\343\\201\\231\\343\\200\\202\\343\\202\\202\\343\\201\\206\\344\\270\\200\\345\\272\\246\\343\\203\\200\\343\\202\\246\\343\\203\\263\\343\\203\\255\\343\\203\\274\\343\\203\\211\\343\\201\\227\\343\\201\\246\\343\\201\\217\\343\\201\\240\\343\\201\\225\\343\\201\\204\\343\\200\\202\\n\\343\\201\\224\\344\\270\\215\\344\\276\\277\\343\\202\\222\\343\\201\\212\\343\\201\\213\\343\\201\\221\\343\\201\\227\\343\\200\\201\\347\\224\\263\\343\\201\\227\\350\\250\\263\\343\\201\\202\\343\\202\\212\\343\\201\\276\\343\\201\\233\\343\\202\\223\\343\\200\\202\\0\"\\\n  \"SumatraPDF\\343\\202\\222\\343\\202\\242\\343\\203\\263\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\253\\0\"\\\n  \"\\343\\202\\242\\343\\203\\263\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\253\\343\\201\\253\\345\\244\\261\\346\\225\\227\\0\"\\\n  \"\\343\\202\\242\\343\\203\\263\\343\\202\\244\\343\\203\\263\\343\\202\\271\\343\\203\\210\\343\\203\\274\\343\\203\\253\\344\\270\\255\\342\\200\\246\\0\"\\\n  \"SumatraPDF \\343\\202\\222 PDF \\343\\203\\225\\343\\202\\241\\343\\202\\244\\343\\203\\253\\343\\201\\256\\346\\227\\242\\345\\256\\232\\343\\201\\256\\343\\202\\242\\343\\203\\227\\343\\203\\252\\343\\202\\261\\343\\203\\274\\343\\202\\267\\343\\203\\247\\343\\203\\263\\343\\201\\253\\343\\201\\227\\343\\201\\276\\343\\201\\231\\343\\201\\213?(&d)\\0\";\n\nconst char * gTranslations_kr = \n  \"\\354\\230\\265\\354\\205\\230(&O)\\0\"\\\n  \"SumatraPDF\\353\\245\\274 \\354\\240\\234\\352\\261\\260\\355\\225\\240\\352\\271\\214\\354\\232\\224?\\0\"\\\n  \"\\353\\213\\253\\352\\270\\260\\0\"\\\n  \"\\354\\236\\204\\354\\213\\234 \\353\\224\\224\\353\\240\\211\\355\\206\\240\\353\\246\\254\\353\\245\\274 \\353\\247\\214\\353\\223\\244 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\354\\204\\244\\354\\271\\230 \\353\\224\\224\\353\\240\\211\\355\\206\\240\\353\\246\\254\\353\\245\\274 \\353\\247\\214\\353\\223\\244 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"PDF \\353\\257\\270\\353\\246\\254\\353\\263\\264\\352\\270\\260\\353\\245\\274 \\354\\204\\244\\354\\271\\230\\355\\225\\240 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"PDF \\352\\262\\200\\354\\203\\211 \\355\\225\\204\\355\\204\\260\\353\\245\\274 \\354\\204\\244\\354\\271\\230\\355\\225\\240 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\354\\236\\204\\354\\213\\234 \\353\\224\\224\\353\\240\\211\\355\\206\\240\\353\\246\\254\\353\\245\\274 \\352\\260\\200\\354\\240\\270\\354\\230\\254 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\354\\204\\244\\354\\271\\230 \\353\\224\\224\\353\\240\\211\\355\\206\\240\\353\\246\\254\\353\\245\\274 \\354\\240\\234\\352\\261\\260\\355\\225\\240 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\353\\260\\224\\353\\241\\234\\352\\260\\200\\352\\270\\260\\353\\245\\274 \\354\\240\\234\\352\\261\\260\\355\\225\\240 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"PDF \\353\\257\\270\\353\\246\\254\\353\\263\\264\\352\\270\\260\\353\\245\\274 \\354\\240\\234\\352\\261\\260\\355\\225\\240 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"PDF \\352\\262\\200\\354\\203\\211 \\355\\225\\204\\355\\204\\260\\353\\245\\274 \\354\\240\\234\\352\\261\\260\\355\\225\\240 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\353\\270\\214\\353\\235\\274\\354\\232\\260\\354\\240\\200 \\355\\224\\214\\353\\237\\254\\352\\267\\270\\354\\235\\270\\354\\235\\204 \\354\\240\\234\\352\\261\\260\\355\\225\\240 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"%s(\\354\\235\\204)\\353\\245\\274 \\353\\224\\224\\354\\212\\244\\355\\201\\254\\354\\227\\220 \\354\\223\\270 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\354\\240\\234\\352\\261\\260 \\352\\264\\200\\353\\246\\254\\354\\236\\220\\353\\245\\274 \\354\\236\\204\\354\\213\\234 \\353\\224\\224\\353\\240\\211\\355\\206\\240\\353\\246\\254\\354\\227\\220 \\353\\263\\265\\354\\202\\254\\355\\225\\230\\354\\247\\200 \\353\\252\\273\\355\\226\\210\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\353\\260\\224\\353\\241\\234\\352\\260\\200\\352\\270\\260\\353\\245\\274 \\353\\247\\214\\353\\223\\244\\354\\247\\200 \\353\\252\\273\\355\\226\\210\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\353\\240\\210\\354\\247\\200\\354\\212\\244\\355\\212\\270\\353\\246\\254 \\355\\202\\244\\353\\245\\274 \\354\\202\\255\\354\\240\\234\\355\\225\\230\\354\\247\\200 \\353\\252\\273\\355\\226\\210\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\0\"\\\n  \"\\355\\231\\225\\354\\236\\245\\353\\220\\234 \\355\\214\\214\\354\\235\\274\\354\\235\\230 \\355\\231\\225\\354\\236\\245\\354\\236\\220 \\354\\240\\225\\353\\263\\264\\353\\245\\274 \\353\\240\\210\\354\\247\\200\\354\\212\\244\\355\\212\\270\\353\\246\\254\\354\\227\\220 \\354\\223\\260\\354\\247\\200 \\353\\252\\273\\355\\226\\210\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\354\\240\\234\\352\\261\\260 \\354\\240\\225\\353\\263\\264\\353\\245\\274 \\353\\240\\210\\354\\247\\200\\354\\212\\244\\355\\212\\270\\353\\246\\254\\354\\227\\220 \\354\\223\\260\\354\\247\\200 \\353\\252\\273\\355\\226\\210\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\354\\230\\265\\354\\205\\230 \\354\\210\\250\\352\\271\\200(&O)\\0\"\\\n  \"SumatraPDF \\354\\204\\244\\354\\271\\230\\0\"\\\n  \"SumatraPDF \\354\\204\\244\\354\\271\\230 \\355\\217\\264\\353\\215\\224(&F):\\0\"\\\n  \"\\354\\204\\244\\354\\271\\230 \\354\\213\\244\\355\\214\\250!\\0\"\\\n  \"\\354\\204\\244\\354\\271\\230\\355\\225\\230\\353\\212\\224 \\354\\244\\221...\\0\"\\\n  \"\\353\\270\\214\\353\\235\\274\\354\\232\\260\\354\\240\\200\\354\\227\\220 \\354\\204\\244\\354\\271\\230\\353\\220\\234 PDF \\355\\224\\214\\353\\237\\254\\352\\267\\270\\354\\235\\270 \\354\\234\\240\\354\\247\\200(&B) (\\353\\215\\224 \\354\\235\\264\\354\\203\\201 \\354\\247\\200\\354\\233\\220 \\354\\225\\210 \\355\\225\\250)\\0\"\\\n  \"Windows \\353\\215\\260\\354\\212\\244\\355\\201\\254\\355\\206\\261 \\352\\262\\200\\354\\203\\211\\354\\227\\220 PDF \\353\\254\\270\\354\\204\\234 \\352\\262\\200\\354\\203\\211 \\352\\270\\260\\353\\212\\245 \\354\\266\\224\\352\\260\\200(&S)\\0\"\\\n  \"Windows \\354\\227\\220 PDF \\353\\254\\270\\354\\204\\234 \\353\\257\\270\\353\\246\\254\\353\\263\\264\\352\\270\\260 \\352\\270\\260\\353\\212\\245 \\354\\266\\224\\352\\260\\200(&P)\\0\"\\\n  \"\\354\\247\\204\\355\\226\\211\\355\\225\\230\\353\\240\\244\\353\\251\\264, %s (\\354\\235\\204)\\353\\245\\274 \\353\\213\\253\\354\\234\\274\\354\\204\\270\\354\\232\\224!\\0\"\\\n  \"SumatraPDF\\353\\245\\274 \\354\\204\\244\\354\\271\\230\\355\\225\\240 \\355\\217\\264\\353\\215\\224 \\354\\204\\240\\355\\203\\235:\\0\"\\\n  \"\\354\\204\\244\\354\\271\\230\\355\\225\\264\\354\\225\\274 \\355\\225\\240 \\354\\235\\274\\353\\266\\200 \\355\\214\\214\\354\\235\\274\\354\\235\\264 \\354\\206\\220\\354\\203\\201 \\353\\230\\220\\353\\212\\224 \\353\\210\\204\\353\\235\\275\\353\\220\\220\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"SumatraPDF \\354\\213\\234\\354\\236\\221\\0\"\\\n  \"SumatraPDF %s \\354\\204\\244\\354\\271\\230 \\352\\264\\200\\353\\246\\254\\354\\236\\220\\0\"\\\n  \"SumatraPDF %s \\354\\240\\234\\352\\261\\260 \\352\\264\\200\\353\\246\\254\\354\\236\\220\\0\"\\\n  \"SumatraPDF\\352\\260\\200 \\354\\240\\234\\352\\261\\260\\353\\220\\220\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"SumatraPDF \\354\\204\\244\\354\\271\\230 \\355\\214\\214\\354\\235\\274\\354\\235\\204 \\354\\260\\276\\354\\235\\204 \\354\\210\\230 \\354\\227\\206\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"SumatraPDF\\353\\245\\274 \\354\\204\\240\\355\\203\\235\\355\\225\\264 \\354\\243\\274\\354\\205\\224\\354\\204\\234 \\352\\263\\240\\353\\247\\210\\354\\233\\214\\354\\232\\224!\\0\"\\\n  \"\\354\\225\\274\\355\\230\\270! SumatraPDF\\352\\260\\200 \\354\\204\\244\\354\\271\\230\\353\\220\\220\\354\\212\\265\\353\\213\\210\\353\\213\\244.\\0\"\\\n  \"\\354\\204\\244\\354\\271\\230 \\352\\264\\200\\353\\246\\254\\354\\236\\220\\352\\260\\200 \\354\\206\\220\\354\\203\\201\\353\\220\\220\\354\\212\\265\\353\\213\\210\\353\\213\\244.  \\353\\213\\244\\354\\213\\234 \\353\\213\\244\\354\\232\\264\\353\\241\\234\\353\\223\\234\\355\\225\\230\\354\\204\\270\\354\\232\\224.\\n\\353\\266\\210\\355\\216\\270\\355\\225\\230\\352\\262\\214 \\355\\225\\264\\354\\204\\234 \\353\\257\\270\\354\\225\\210\\355\\225\\251\\353\\213\\210\\353\\213\\244!\\0\"\\\n  \"SumatraPDF \\354\\240\\234\\352\\261\\260\\0\"\\\n  \"\\354\\240\\234\\352\\261\\260 \\354\\213\\244\\355\\214\\250\\0\"\\\n  \"\\354\\240\\234\\352\\261\\260\\355\\225\\230\\353\\212\\224 \\354\\244\\221...\\0\"\\\n  \"SumatraPDF\\353\\245\\274 \\352\\270\\260\\353\\263\\270 PDF \\353\\246\\254\\353\\215\\224\\353\\241\\234 \\354\\202\\254\\354\\232\\251(&D)\\0\";\n\nconst char * gTranslations_ku = \n  \"\\331\\207\\333\\225\\332\\265\\330\\250\\332\\230\\330\\247\\330\\261\\330\\257\\331\\206\\333\\225\\332\\251\\330\\247\\331\\206&\\0\"\\\n  \"\\330\\246\\330\\247\\333\\214\\330\\247 \\330\\257\\332\\265\\331\\206\\333\\214\\330\\247\\333\\214\\330\\252 \\331\\204\\333\\225 \\330\\263\\332\\225\\333\\214\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 SumatraPDF?\\0\"\\\n  \"\\330\\257\\330\\247\\330\\256\\330\\263\\330\\252\\331\\206\\0\"\\\n  \"\\331\\206\\330\\247\\330\\252\\331\\210\\330\\247\\331\\206\\330\\261\\333\\216\\330\\252 \\331\\201\\333\\206\\332\\265\\330\\257\\333\\225\\330\\261\\333\\214 \\332\\251\\330\\247\\330\\252\\333\\214 \\330\\257\\330\\261\\331\\210\\330\\263\\330\\252\\330\\250\\332\\251\\330\\261\\333\\216\\330\\252\\0\"\\\n  \"\\331\\206\\330\\247\\330\\252\\331\\210\\330\\247\\331\\206\\330\\261\\333\\216\\330\\252 \\331\\201\\333\\206\\332\\265\\330\\257\\333\\225\\330\\261\\333\\214 \\330\\257\\330\\247\\330\\250\\333\\225\\330\\262\\330\\247\\331\\206\\330\\257\\331\\206 \\330\\257\\330\\261\\331\\210\\330\\263\\330\\252 \\330\\250\\332\\251\\330\\261\\333\\216\\330\\252\\0\"\\\n  \"\\331\\206\\330\\247\\330\\252\\331\\210\\330\\247\\331\\206\\330\\261\\333\\216\\330\\252 \\331\\276\\333\\214\\330\\264\\330\\247\\331\\206\\330\\257\\333\\225\\330\\261\\333\\214 PDF \\330\\257\\330\\247\\330\\250\\333\\225\\330\\262\\333\\216\\331\\206\\330\\257\\330\\261\\333\\216\\330\\252\\0\"\\\n  \"\\331\\206\\330\\247\\330\\252\\331\\210\\330\\247\\331\\206\\330\\261\\333\\216\\330\\252 \\331\\201\\330\\261\\331\\205\\330\\247\\331\\206\\333\\214 \\332\\257\\333\\225\\332\\225\\330\\247\\331\\206\\333\\214 PDF \\330\\257\\330\\247\\330\\250\\333\\225\\330\\262\\333\\216\\331\\206\\330\\257\\330\\261\\333\\216\\330\\252\\0\"\\\n  \"\\331\\206\\330\\247\\330\\252\\331\\210\\330\\247\\331\\206\\330\\261\\333\\216\\330\\252 \\331\\201\\333\\206\\332\\265\\330\\257\\333\\225\\330\\261\\333\\214 \\332\\251\\330\\247\\330\\252\\333\\214 \\330\\250\\330\\257\\333\\206\\330\\262\\330\\261\\333\\216\\330\\252\\333\\225\\331\\210\\333\\225\\0\"\\\n  \"\\331\\206\\330\\247\\330\\252\\331\\210\\330\\247\\331\\206\\330\\261\\333\\216\\330\\252 \\331\\201\\333\\206\\332\\265\\330\\257\\333\\225\\330\\261\\333\\214 \\330\\257\\330\\247\\330\\250\\333\\225\\330\\262\\330\\247\\331\\206\\330\\257\\331\\206 \\331\\204\\330\\247\\330\\250\\330\\257\\330\\261\\333\\216\\330\\252\\0\"\\\n  \"\\331\\206\\330\\247\\330\\252\\331\\210\\330\\247\\331\\206\\330\\261\\333\\216\\330\\252 \\332\\251\\331\\210\\330\\261\\330\\252\\333\\225 \\330\\246\\330\\247\\333\\214\\332\\251\\333\\206\\331\\206 \\331\\204\\330\\247\\330\\250\\330\\257\\330\\261\\333\\216\\330\\252\\0\"\\\n  \"\\331\\206\\330\\247\\330\\252\\331\\210\\330\\247\\331\\206\\330\\261\\333\\216\\330\\252 \\331\\276\\333\\214\\330\\264\\330\\247\\331\\206\\330\\257\\333\\225\\330\\261\\333\\214 PDF \\330\\250\\330\\263\\332\\225\\330\\257\\330\\261\\333\\216\\330\\252\\333\\225\\331\\210\\333\\225\\0\"\\\n  \"\\331\\206\\330\\247\\330\\252\\331\\210\\330\\247\\331\\206\\330\\261\\333\\216\\330\\252 \\331\\201\\330\\261\\331\\205\\330\\247\\331\\206\\333\\214 \\332\\257\\333\\225\\332\\225\\330\\247\\331\\206\\333\\214 PDF \\330\\250\\330\\263\\332\\225\\330\\257\\330\\261\\333\\216\\330\\252\\333\\225\\331\\210\\333\\225\\0\"\\\n  \"\\331\\206\\330\\247\\330\\252\\331\\210\\330\\247\\331\\206\\330\\261\\333\\216\\330\\252 \\331\\276\\333\\216\\331\\210\\333\\225\\332\\251\\330\\261\\330\\247\\331\\210\\333\\214 \\331\\210\\333\\216\\330\\250\\332\\257\\333\\225\\332\\225 \\330\\250\\330\\263\\332\\225\\330\\257\\330\\261\\333\\216\\330\\252\\333\\225\\331\\210\\333\\225\\0\"\\\n  \"\\330\\250\\330\\256\\331\\210\\333\\216\\331\\206\\330\\257\\330\\261\\333\\216\\330\\252\\333\\225\\331\\210\\333\\225 \\330\\250\\333\\206 \\330\\257\\333\\214\\330\\263\\332\\251 %s \\331\\206\\330\\247\\330\\252\\331\\210\\330\\247\\331\\206\\330\\261\\333\\216\\330\\252\\0\"\\\n  \"\\331\\204\\333\\225\\330\\250\\333\\225\\330\\261\\332\\257\\330\\261\\330\\252\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 \\330\\257\\330\\247\\330\\252\\330\\247\\332\\251\\330\\247\\331\\206\\333\\214 \\330\\263\\332\\225\\333\\214\\331\\206\\333\\225\\331\\210\\333\\225 \\330\\263\\333\\225\\330\\261\\332\\251\\333\\225\\330\\252\\331\\210 \\331\\206\\333\\225\\330\\250\\331\\210\\331\\210 \\330\\250\\333\\206 \\331\\201\\333\\206\\332\\265\\330\\257\\333\\225\\330\\261\\333\\214 \\332\\251\\330\\247\\330\\252\\333\\214\\0\"\\\n  \"\\330\\257\\330\\261\\331\\210\\330\\263\\330\\252\\332\\251\\330\\261\\330\\257\\331\\206\\333\\214 \\332\\251\\331\\210\\330\\261\\330\\252\\333\\225 \\330\\246\\330\\247\\333\\214\\332\\251\\333\\206\\331\\206 \\330\\263\\333\\225\\330\\261\\332\\251\\333\\225\\331\\210\\330\\252\\331\\210 \\331\\206\\333\\225\\330\\250\\331\\210\\331\\210\\0\"\\\n  \"\\330\\263\\332\\225\\333\\214\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 \\331\\276\\330\\247\\330\\264\\332\\251\\333\\206 \\331\\210 \\332\\251\\331\\204\\333\\214\\331\\204\\333\\225\\332\\251\\330\\247\\331\\206\\333\\214 \\332\\225\\333\\214\\332\\257\\330\\263\\330\\252\\330\\261\\333\\214 \\330\\263\\333\\225\\330\\261\\332\\251\\333\\225\\330\\252\\331\\210 \\331\\206\\333\\225\\330\\250\\331\\210\\331\\210\\0\"\\\n  \"\\0\"\\\n  \"\\330\\257\\330\\247\\331\\206\\330\\247\\331\\206\\333\\214 \\330\\262\\330\\247\\331\\206\\333\\214\\330\\247\\330\\261\\333\\214 \\331\\276\\330\\247\\330\\264\\332\\251\\333\\206\\333\\214 \\331\\201\\330\\247\\333\\214\\331\\204 \\330\\263\\333\\225\\330\\261\\332\\251\\333\\225\\331\\210\\330\\252\\331\\210 \\331\\206\\333\\225\\330\\250\\331\\210\\331\\210 \\331\\204\\333\\225 \\332\\225\\333\\214\\332\\257\\330\\263\\330\\252\\330\\261\\333\\214\\330\\257\\330\\247\\0\"\\\n  \"\\330\\257\\330\\247\\331\\206\\330\\247\\331\\206\\333\\214 \\330\\262\\330\\247\\331\\206\\333\\214\\330\\247\\330\\261\\333\\214 \\330\\263\\332\\225\\333\\214\\331\\206\\333\\225\\331\\210\\333\\225 \\330\\263\\333\\225\\330\\261\\332\\251\\333\\225\\331\\210\\330\\252\\331\\210 \\331\\206\\333\\225\\330\\250\\331\\210\\331\\210 \\331\\204\\333\\225 \\332\\225\\333\\214\\332\\257\\330\\263\\330\\252\\330\\261\\333\\214\\330\\257\\330\\247\\0\"\\\n  \"\\331\\207\\333\\225\\332\\265\\330\\250\\332\\230\\330\\247\\330\\261\\330\\257\\331\\206\\333\\225\\332\\251\\330\\247\\331\\206\\333\\214 &\\330\\264\\330\\247\\330\\261\\330\\257\\331\\206\\333\\225\\331\\210\\333\\225\\0\"\\\n  \"\\330\\257\\330\\247\\330\\250\\333\\225\\330\\262\\330\\247\\331\\206\\330\\257\\331\\206\\333\\214 SumatraPDF\\0\"\\\n  \"\\331\\204\\333\\225 \\331\\201\\333\\206\\332\\265\\330\\257\\333\\225\\330\\261\\333\\214 SumatraPDF \\330\\257\\330\\247\\330\\250\\333\\225\\330\\262\\330\\247\\331\\206\\330\\257\\331\\206\\333\\214:\\0\"\\\n  \"\\330\\257\\330\\247\\330\\250\\333\\225\\330\\262\\330\\247\\331\\206\\330\\257\\331\\206 \\330\\263\\333\\225\\330\\261\\332\\251\\333\\225\\331\\210\\330\\252\\331\\210 \\331\\206\\333\\225\\330\\250\\331\\210\\331\\210!\\0\"\\\n  \"\\330\\257\\330\\247\\330\\250\\333\\225\\330\\262\\330\\247\\331\\206\\330\\257\\331\\206 \\331\\204\\333\\225 \\330\\246\\333\\225\\331\\206\\330\\254\\330\\247\\331\\205\\330\\257\\330\\247\\331\\206\\330\\257\\330\\247\\333\\214\\333\\225...\\0\"\\\n  \"\\331\\207\\333\\216\\330\\264\\330\\252\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 \\331\\276\\333\\216\\331\\210\\333\\225\\332\\251\\330\\261\\330\\247\\331\\210\\333\\214 \\331\\210\\333\\216\\330\\250\\332\\257\\333\\225\\332\\225 \\330\\250\\333\\225 \\330\\257\\330\\247\\331\\205\\333\\225\\330\\262\\333\\216\\330\\261\\333\\216\\331\\206\\330\\261\\330\\247\\331\\210\\333\\214 (\\332\\206\\333\\214\\330\\252\\330\\261 \\331\\276\\330\\247\\332\\265\\331\\276\\330\\264\\330\\252\\333\\214 \\331\\206\\330\\247\\332\\251\\330\\261\\333\\216\\330\\252)\\0\"\\\n  \"PDF \\332\\225\\333\\216\\332\\257\\333\\225\\330\\257\\330\\247\\331\\206 \\330\\250\\333\\225 \\332\\257\\333\\225\\332\\225\\330\\247\\331\\206\\333\\214 \\330\\263\\333\\225\\330\\261\\330\\264\\330\\247\\330\\264\\333\\225\\333\\214 \\331\\210\\333\\214\\331\\206\\330\\257\\333\\206\\330\\262 &\\330\\250\\332\\257\\333\\225\\332\\225\\333\\216\\330\\252 \\330\\250\\333\\206 \\330\\250\\333\\225\\332\\265\\332\\257\\333\\225\\331\\206\\330\\247\\331\\205\\333\\225\\332\\251\\330\\247\\331\\206\\333\\214\\0\"\\\n  \"\\331\\276\\333\\214\\330\\264\\330\\247\\331\\206 \\330\\250\\330\\257\\330\\247\\330\\252 PDF \\332\\225\\333\\216\\332\\257\\333\\225\\330\\257\\330\\247\\331\\206 \\330\\250\\333\\225 \\331\\276\\333\\214\\330\\264\\330\\247\\331\\206\\330\\257\\333\\225\\330\\261\\333\\214 \\331\\210\\333\\214\\331\\206\\330\\257\\333\\206\\330\\262 &\\330\\250\\333\\225\\332\\265\\332\\257\\333\\225\\331\\206\\330\\247\\331\\205\\333\\225\\332\\251\\330\\247\\331\\206\\333\\214\\0\"\\\n  \"\\330\\252\\332\\251\\330\\247\\333\\214\\333\\225 %s \\330\\257\\330\\247\\330\\250\\330\\256\\333\\225 \\330\\250\\333\\206 \\330\\250\\333\\225\\330\\261\\330\\257\\333\\225\\331\\210\\330\\247\\331\\205\\330\\250\\331\\210\\331\\206!\\0\"\\\n  \":SumatraPDF \\331\\201\\333\\206\\332\\265\\330\\257\\333\\225\\330\\261\\333\\216\\332\\251 \\330\\257\\333\\214\\330\\247\\330\\261\\333\\214\\330\\250\\332\\251\\333\\225 \\330\\250\\333\\206 \\330\\257\\330\\247\\330\\250\\333\\225\\330\\262\\330\\247\\331\\206\\330\\257\\331\\206\\333\\214\\0\"\\\n  \"\\331\\207\\333\\225\\331\\206\\330\\257\\333\\216\\332\\251 \\331\\201\\330\\247\\333\\214\\331\\204\\333\\214 \\330\\257\\330\\247\\330\\250\\333\\225\\330\\262\\330\\247\\331\\206\\330\\257\\331\\206 \\331\\210\\331\\210\\331\\206\\330\\250\\331\\210\\331\\210\\331\\206 \\333\\214\\330\\247\\331\\206 \\330\\252\\333\\216\\332\\251\\332\\206\\331\\210\\331\\210\\331\\206\\0\"\\\n  \"SumatraPDF \\330\\257\\333\\225\\330\\263\\330\\252\\331\\276\\333\\216\\332\\251\\330\\261\\330\\257\\331\\206\\333\\214\\0\"\\\n  \"SumatraPDF %s \\330\\257\\330\\247\\330\\250\\333\\225\\330\\262\\330\\247\\331\\206\\330\\257\\331\\206\\333\\214\\0\"\\\n  \"SumatraPDF %s \\330\\263\\332\\225\\333\\214\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214\\0\"\\\n  \".\\330\\263\\332\\225\\330\\247\\333\\214\\333\\225\\331\\210\\333\\225 SumatraPDF\\0\"\\\n  \".\\331\\206\\333\\225\\330\\257\\333\\206\\330\\262\\330\\261\\330\\247\\333\\214\\333\\225\\331\\210\\333\\225 SumatraPDF \\330\\257\\330\\247\\330\\250\\333\\225\\330\\262\\333\\216\\331\\206\\333\\225\\330\\261\\333\\214\\0\"\\\n  \"\\330\\263\\331\\210\\331\\276\\330\\247\\330\\263 \\330\\250\\333\\206 \\331\\207\\333\\225\\332\\265\\330\\250\\332\\230\\330\\247\\330\\261\\330\\257\\331\\206\\333\\214 !SumatraPDF\\0\"\\\n  \"\\330\\263\\331\\210\\331\\276\\330\\247\\330\\263! SumatraPDF \\330\\257\\330\\247\\330\\250\\333\\225\\330\\262\\333\\216\\331\\206\\330\\261\\330\\247.\\0\"\\\n  \"\\330\\257\\330\\247\\330\\250\\333\\225\\330\\262\\333\\216\\331\\206\\333\\225\\330\\261 \\330\\252\\333\\216\\332\\251\\332\\206\\331\\210\\331\\210\\333\\225. \\330\\252\\332\\251\\330\\247\\333\\214\\333\\225 \\330\\257\\331\\210\\331\\210\\330\\250\\330\\247\\330\\261\\333\\225 \\330\\257\\330\\247\\333\\214\\330\\250\\332\\257\\330\\261\\333\\225\\331\\210\\333\\225.\\n\\330\\250\\330\\250\\331\\210\\330\\261\\333\\225 \\331\\204\\333\\225 \\332\\225\\331\\210\\331\\210\\330\\257\\330\\247\\331\\206\\333\\214 \\330\\246\\333\\225\\331\\210 \\331\\207\\333\\225\\332\\265\\333\\225\\333\\214\\333\\225!\\0\"\\\n  \"\\330\\263\\332\\225\\333\\214\\331\\206\\333\\225\\331\\210\\333\\225\\333\\214 SumatraPDF\\0\"\\\n  \"\\330\\263\\332\\225\\333\\214\\331\\206\\333\\225\\331\\210\\333\\225 \\330\\263\\333\\225\\330\\261\\332\\251\\333\\225\\331\\210\\330\\252\\331\\210 \\331\\206\\333\\225\\330\\250\\331\\210\\331\\210\\0\"\\\n  \"\\330\\263\\332\\225\\333\\214\\331\\206\\333\\225\\331\\210\\333\\225 \\331\\204\\333\\225 \\330\\246\\333\\225\\331\\206\\330\\254\\330\\247\\331\\205\\330\\257\\330\\247\\331\\206\\330\\257\\330\\247\\333\\214\\333\\225...\\0\"\\\n  \"\\331\\210\\333\\225\\332\\251\\331\\210 \\330\\256\\331\\210\\333\\216\\331\\206\\333\\225\\330\\261\\333\\225\\331\\210\\333\\225\\333\\214 &\\330\\263\\333\\225\\330\\261\\333\\225\\332\\251\\333\\214 PDF SumatraPDF \\330\\250\\333\\225\\332\\251\\330\\247\\330\\261\\331\\207\\333\\216\\331\\206\\330\\247\\331\\206\\333\\214\\0\";\n\nconst char * gTranslations_lv = \n  \"&Opcijas\\0\"\\\n  \"Vai j\\305\\253s esat p\\304\\201rliecin\\304\\201ts, ka v\\304\\223laties atinstal\\304\\223t SumatraPDF?\\0\"\\\n  \"Aizv\\304\\223rt\\0\"\\\n  \"Nevar\\304\\223ja izveidot pagaidu direktoriju\\0\"\\\n  \"Nevar\\304\\223ja izveidot instal\\304\\201cijas direktoriju\\0\"\\\n  \"Nevar\\304\\223ja instal\\304\\223t PDF priek\\305\\241skat\\304\\253jumu\\0\"\\\n  \"Nevar\\304\\223ja instal\\304\\223t PDF mekl\\304\\223\\305\\241anas filtru\\0\"\\\n  \"Nevar\\304\\223ja ieg\\305\\253t pagaidu direktoriju\\0\"\\\n  \"Nevar\\304\\223ja no\\305\\206emt instal\\304\\201cijas direktoriju\\0\"\\\n  \"Nevar\\304\\223ja no\\305\\206emt sa\\304\\253sni\\0\"\\\n  \"Nevar\\304\\223ja atinstal\\304\\223t PDF priek\\305\\241skat\\304\\253jumu\\0\"\\\n  \"Nevar\\304\\223ja atinstal\\304\\223t PDF mekl\\304\\223\\305\\241anas filtru\\0\"\\\n  \"Nevar\\304\\223ja atinstal\\304\\223t p\\304\\201rl\\305\\253kprogrammas spraudni\\0\"\\\n  \"Nevar\\304\\223ja rakst\\304\\253t %s disk\\304\\201\\0\"\\\n  \"Neizdev\\304\\201s iekop\\304\\223t instal\\304\\201cijas no\\305\\206em\\305\\241anas programmu pagaidu direktorij\\304\\201\\0\"\\\n  \"Neizdev\\304\\201s izveidot sa\\304\\253sni\\0\"\\\n  \"Neizdev\\304\\201s izdz\\304\\223st instal\\304\\201cijas no\\305\\206em\\305\\241anas programmas re\\304\\243istra atsl\\304\\223gas\\0\"\\\n  \"\\0\"\\\n  \"Neizdev\\304\\201s ierakst\\304\\253t failu papla\\305\\241in\\304\\201jumu inform\\304\\201ciju re\\304\\243istr\\304\\201\\0\"\\\n  \"Neizdev\\304\\201s ierakst\\304\\253t atinstal\\304\\223\\305\\241anas inform\\304\\201ciju re\\304\\243istr\\304\\201\\0\"\\\n  \"Pasl\\304\\223pt &opcijas\\0\"\\\n  \"Instal\\304\\223t SumatraPDF\\0\"\\\n  \"Instal\\304\\223t SumatraPDF &map\\304\\223:\\0\"\\\n  \"Instal\\304\\223\\305\\241ana neizdev\\304\\201s!\\0\"\\\n  \"Notiek instal\\304\\223\\305\\241ana...\\0\"\\\n  \"Patur\\304\\223t p\\304\\201rl\\305\\253ka PDF spraudni instal\\304\\223tu (vairs netiek atbalst\\304\\253ts)\\0\"\\\n  \"&Mekl\\304\\223t PDF dokumentus ar Windows Desktop Search\\0\"\\\n  \"\\304\\273aut Windows r\\304\\201d\\304\\253t PDF dokumentu &priek\\305\\241skat\\304\\253jumus\\0\"\\\n  \"Lai turpin\\304\\201tu, l\\305\\253dzu, aizveriet %s!\\0\"\\\n  \"Atlasiet mapi, kur\\304\\201 j\\304\\201instal\\304\\223 SumatraPDF\\0\"\\\n  \"K\\304\\201di faili ir instal\\304\\223ti boj\\304\\201ti vai tie tr\\305\\253kst\\0\"\\\n  \"Palaist SumatraPDF\\0\"\\\n  \"SumatraPDF %s instal\\304\\223t\\304\\201js\\0\"\\\n  \"SumatraPDF %s atinstal\\304\\223t\\304\\201js\\0\"\\\n  \"SumatraPDF ir atinstal\\304\\223ta\\0\"\\\n  \"SumatraPDF instal\\304\\201cija nav atrasta\\0\"\\\n  \"Pateicamies par SumatraPDF izv\\304\\223l\\304\\223\\305\\241anos!\\0\"\\\n  \"Paldies! SumatraPDF ir instal\\304\\223ta.\\0\"\\\n  \"Instal\\304\\223\\305\\241anas programma ir bijusi boj\\304\\201ta. L\\305\\253dzu, lejupiel\\304\\201d\\304\\223jiet to v\\304\\223lreiz.\\nPiedodiet par sag\\304\\201d\\304\\201taj\\304\\201m ne\\304\\223rt\\304\\253b\\304\\201m!\\0\"\\\n  \"Atinstal\\304\\223t SumatraPDF\\0\"\\\n  \"Atinstal\\304\\223\\305\\241ana neizdev\\304\\201s\\0\"\\\n  \"Notiek atinstal\\304\\223\\305\\241ana...\\0\"\\\n  \"Izmantot SumatraPDF k\\304\\201 &noklus\\304\\223juma PDF las\\304\\253t\\304\\201ju\\0\";\n\nconst char * gTranslations_mk = \n  \"&\\320\\236\\320\\277\\321\\206\\320\\270\\320\\270\\0\"\\\n  \"\\320\\224\\320\\260\\320\\273\\320\\270 \\321\\201\\321\\202\\320\\265 \\321\\201\\320\\270\\320\\263\\321\\203\\321\\200\\320\\275\\320\\270 \\320\\264\\320\\265\\320\\272\\320\\260 \\321\\201\\320\\260\\320\\272\\320\\260\\321\\202\\320\\265 \\320\\264\\320\\260 \\320\\263\\320\\276 \\320\\270\\320\\267\\320\\261\\321\\200\\320\\270\\321\\210\\320\\265\\321\\202\\320\\265 SumatraPDF?\\0\"\\\n  \"\\320\\227\\320\\260\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\260\\320\\274 \\320\\264\\320\\260 \\321\\201\\320\\276\\320\\267\\320\\264\\320\\260\\320\\264\\320\\260\\320\\274 \\320\\277\\321\\200\\320\\270\\320\\262\\321\\200\\320\\265\\320\\274\\320\\265\\320\\275\\320\\260 \\320\\277\\320\\260\\320\\277\\320\\272\\320\\260\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\260\\320\\274 \\320\\264\\320\\260 \\321\\230\\320\\260 \\321\\201\\320\\276\\320\\267\\320\\264\\320\\260\\320\\264\\320\\260\\320\\274 \\320\\277\\320\\260\\320\\277\\320\\272\\320\\260\\321\\202\\320\\260 \\320\\267\\320\\260 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\321\\230\\320\\260\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\260\\320\\274 \\320\\264\\320\\260 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\320\\274 \\320\\277\\321\\200\\320\\270\\320\\272\\320\\260\\320\\266\\321\\203\\320\\262\\320\\260\\321\\207\\320\\276\\321\\202 \\320\\275\\320\\260 PDF\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\260\\320\\274 \\320\\264\\320\\260 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\320\\274 \\321\\204\\320\\270\\320\\273\\321\\202\\320\\265\\321\\200 \\320\\267\\320\\260 \\320\\277\\321\\200\\320\\265\\320\\261\\320\\260\\321\\200\\321\\203\\320\\262\\320\\260\\321\\232\\320\\265 \\320\\275\\320\\260 PDF\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\260\\320\\274 \\320\\264\\320\\260 \\320\\277\\321\\200\\320\\270\\321\\201\\321\\202\\320\\260\\320\\277\\320\\260\\320\\274 \\320\\264\\320\\276 \\320\\277\\321\\200\\320\\270\\320\\262\\321\\200\\320\\265\\320\\274\\320\\265\\320\\275\\320\\260\\321\\202\\320\\260 \\320\\277\\320\\260\\320\\277\\320\\272\\320\\260\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\260\\320\\274 \\320\\264\\320\\260 \\321\\230\\320\\260 \\320\\270\\320\\267\\320\\261\\321\\200\\320\\270\\321\\210\\320\\260\\320\\274 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\320\\276\\320\\275\\320\\260\\321\\202\\320\\260 \\320\\277\\320\\260\\320\\277\\320\\272\\320\\260\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\260\\320\\274 \\320\\264\\320\\260 \\321\\230\\320\\260 \\320\\270\\320\\267\\320\\261\\321\\200\\320\\270\\321\\210\\320\\260\\320\\274 \\320\\272\\321\\200\\320\\260\\321\\202\\320\\265\\320\\275\\320\\272\\320\\260\\321\\202\\320\\260\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\260\\320\\274 \\320\\264\\320\\260 \\320\\263\\320\\276 \\320\\270\\320\\267\\320\\261\\321\\200\\320\\270\\321\\210\\320\\260\\320\\274 \\320\\277\\321\\200\\320\\270\\320\\272\\320\\260\\320\\266\\321\\203\\320\\262\\320\\260\\321\\207\\320\\276\\321\\202 \\320\\275\\320\\260 PDF\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\260\\320\\274 \\320\\264\\320\\260 \\320\\263\\320\\276 \\320\\270\\320\\267\\320\\261\\321\\200\\320\\270\\321\\210\\320\\260\\320\\274 \\321\\204\\320\\270\\320\\273\\321\\202\\320\\265\\321\\200\\320\\276\\321\\202 \\320\\267\\320\\260 \\320\\277\\321\\200\\320\\265\\320\\261\\320\\260\\321\\200\\321\\203\\320\\262\\320\\260\\321\\232\\320\\265 \\320\\275\\320\\260 PDF\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\260\\320\\274 \\320\\264\\320\\260 \\320\\263\\320\\276 \\320\\270\\320\\267\\320\\261\\321\\200\\320\\270\\321\\210\\320\\260\\320\\274 \\320\\264\\320\\276\\320\\264\\320\\260\\321\\202\\320\\276\\320\\272\\320\\276\\321\\202 \\320\\267\\320\\260 \\320\\277\\321\\200\\320\\265\\320\\273\\320\\270\\321\\201\\321\\202\\321\\203\\320\\262\\320\\260\\321\\207\\320\\270\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\260\\320\\274 \\320\\264\\320\\260 \\321\\230\\320\\260 \\321\\201\\320\\275\\320\\270\\320\\274\\320\\260\\320\\274 %s \\320\\275\\320\\260 \\320\\264\\320\\270\\321\\201\\320\\272\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\321\\201\\320\\277\\320\\265\\320\\260\\320\\262 \\320\\264\\320\\260 \\320\\263\\320\\276 \\320\\270\\321\\201\\320\\272\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\320\\274 \\320\\264\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\202\\320\\276\\321\\200\\320\\276\\321\\202 \\320\\262\\320\\276 \\320\\277\\321\\200\\320\\270\\320\\262\\321\\200\\320\\265\\320\\274\\320\\265\\320\\275\\320\\260\\321\\202\\320\\260 \\320\\277\\320\\260\\320\\277\\320\\272\\320\\260\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\321\\201\\320\\277\\320\\265\\320\\260\\320\\262 \\320\\264\\320\\260 \\321\\201\\320\\276\\320\\267\\320\\264\\320\\260\\320\\264\\320\\260\\320\\274 \\320\\272\\321\\200\\320\\260\\321\\202\\320\\265\\320\\275\\320\\272\\320\\260\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\321\\201\\320\\277\\320\\265\\320\\260\\320\\262 \\320\\264\\320\\260 \\320\\263\\320\\270 \\320\\270\\320\\267\\320\\261\\321\\200\\320\\270\\321\\210\\320\\260\\320\\274 \\321\\200\\320\\265\\320\\263\\320\\270\\321\\201\\321\\202\\320\\260\\321\\200\\321\\201\\320\\272\\320\\270\\321\\202\\320\\265 \\320\\272\\320\\273\\321\\203\\321\\207\\320\\265\\320\\262\\320\\270 \\320\\275\\320\\260 \\320\\264\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\202\\320\\276\\321\\200\\320\\276\\321\\202\\0\"\\\n  \"\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\321\\201\\320\\277\\320\\265\\320\\260\\320\\262 \\320\\264\\320\\260 \\320\\263\\320\\270 \\320\\267\\320\\260\\320\\277\\320\\270\\321\\210\\320\\260\\320\\274 \\320\\270\\320\\275\\321\\204\\320\\276\\321\\200\\320\\274\\320\\260\\321\\206\\320\\270\\320\\270\\321\\202\\320\\265 \\320\\267\\320\\260 \\321\\202\\320\\270\\320\\277\\320\\276\\320\\262\\320\\270 \\320\\275\\320\\260 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\270 \\320\\262\\320\\276 \\321\\200\\320\\265\\320\\263\\320\\270\\321\\201\\321\\202\\320\\260\\321\\200\\320\\276\\321\\202\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\321\\201\\320\\277\\320\\265\\320\\260\\320\\262 \\320\\264\\320\\260 \\320\\263\\320\\270 \\320\\267\\320\\260\\320\\277\\320\\270\\321\\210\\320\\260\\320\\274 \\320\\270\\320\\275\\321\\204\\320\\276\\321\\200\\320\\274\\320\\260\\321\\206\\320\\270\\320\\270\\321\\202\\320\\265 \\320\\267\\320\\260 \\320\\264\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\202\\320\\276\\321\\200\\320\\276\\321\\202 \\320\\262\\320\\276 \\321\\200\\320\\265\\320\\263\\320\\270\\321\\201\\321\\202\\320\\260\\321\\200\\320\\276\\321\\202\\0\"\\\n  \"\\320\\241\\320\\272\\321\\200\\320\\270\\321\\230 &\\320\\276\\320\\277\\321\\206\\320\\270\\320\\270\\0\"\\\n  \"\\320\\230\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\321\\230 SumatraPDF\\0\"\\\n  \"\\320\\230\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\321\\230 SumatraPDF \\320\\262\\320\\276 &\\320\\277\\320\\260\\320\\277\\320\\272\\320\\260:\\0\"\\\n  \"\\320\\230\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\321\\232\\320\\265\\321\\202\\320\\276 \\320\\275\\320\\265 \\321\\203\\321\\201\\320\\277\\320\\265\\320\\260!\\0\"\\\n  \"\\320\\230\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\321\\232\\320\\265\\321\\202\\320\\276 \\320\\265 \\320\\262\\320\\276 \\321\\202\\320\\265\\320\\272...\\0\"\\\n  \"\\320\\227\\320\\260\\320\\264\\321\\200\\320\\266\\320\\270 \\320\\263\\320\\276 \\320\\264\\320\\276\\320\\264\\320\\260\\321\\202\\320\\276\\320\\272\\320\\276\\321\\202 \\320\\267\\320\\260 PDF \\320\\267\\320\\260 &\\320\\277\\321\\200\\320\\265\\320\\273\\320\\270\\321\\201\\321\\202\\321\\203\\320\\262\\320\\260\\321\\207\\320\\270 (\\320\\275\\320\\265 \\320\\265 \\320\\277\\320\\276\\320\\262\\320\\265\\321\\234\\320\\265 \\320\\277\\320\\276\\320\\264\\320\\264\\321\\200\\320\\266\\320\\260\\320\\275)\\0\"\\\n  \"\\320\\224\\320\\276\\320\\267\\320\\262\\320\\276\\320\\273\\320\\270 Windows Desktop Search \\320\\264\\320\\260 \\320\\277\\321\\200\\320\\265\\320\\261\\320\\260\\321\\200\\321\\203\\320\\262\\320\\260 \\320\\275\\320\\270\\320\\267 PDF-\\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\224\\320\\276\\320\\267\\320\\262\\320\\276\\320\\273\\320\\270 Windows \\320\\264\\320\\260 \\320\\277\\321\\200\\320\\270\\320\\272\\320\\260\\320\\266\\321\\203\\320\\262\\320\\260 \\321\\201\\320\\273\\320\\270\\320\\272\\320\\270 \\320\\267\\320\\260 PDF-\\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\270\\0\"\\\n  \"\\320\\222\\320\\265 \\320\\274\\320\\276\\320\\273\\320\\260\\320\\274 \\320\\267\\320\\260\\321\\202\\320\\262\\320\\276\\321\\200\\320\\265\\321\\202\\320\\265 \\320\\263\\320\\276 %s, \\320\\267\\320\\260 \\320\\264\\320\\260 \\320\\277\\321\\200\\320\\276\\320\\264\\320\\276\\320\\273\\320\\266\\320\\270\\321\\202\\320\\265!\\0\"\\\n  \"\\320\\230\\320\\267\\320\\261\\320\\265\\321\\200\\320\\265\\321\\202\\320\\265 \\321\\230\\320\\260 \\320\\277\\320\\260\\320\\277\\320\\272\\320\\260\\321\\202\\320\\260 \\320\\272\\320\\260\\320\\264\\320\\265 \\321\\210\\321\\202\\320\\276 \\321\\202\\321\\200\\320\\265\\320\\261\\320\\260 \\320\\264\\320\\260 \\321\\201\\320\\265 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260 SumatraPDF:\\0\"\\\n  \"\\320\\235\\320\\265\\320\\272\\320\\276\\320\\270 \\320\\276\\320\\264 \\320\\264\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\270\\321\\202\\320\\265 \\321\\210\\321\\202\\320\\276 \\321\\202\\321\\200\\320\\265\\320\\261\\320\\260 \\320\\264\\320\\260 \\321\\201\\320\\265 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\320\\260\\321\\202 \\321\\201\\320\\265 \\320\\276\\321\\210\\321\\202\\320\\265\\321\\202\\320\\265\\320\\275\\320\\270 \\320\\270\\320\\273\\320\\270 \\320\\275\\320\\265\\320\\264\\320\\276\\321\\201\\321\\202\\320\\260\\321\\201\\321\\203\\320\\262\\320\\260\\320\\260\\321\\202\\0\"\\\n  \"\\320\\241\\321\\202\\320\\260\\321\\200\\321\\202\\321\\203\\320\\262\\320\\260\\321\\230 SumatraPDF\\0\"\\\n  \"\\320\\230\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\321\\230\\320\\260 \\320\\275\\320\\260 SumatraPDF %s\\0\"\\\n  \"\\320\\224\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\321\\230\\320\\260 \\320\\275\\320\\260 SumatraPDF %s\\0\"\\\n  \"SumatraPDF \\320\\265 \\320\\270\\320\\267\\320\\261\\321\\200\\320\\270\\321\\210\\320\\260\\320\\275.\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\275\\320\\260\\321\\230\\320\\264\\320\\276\\320\\262 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\320\\270 \\320\\275\\320\\260 SumatraPDF.\\0\"\\\n  \"\\320\\222\\320\\270 \\320\\261\\320\\273\\320\\260\\320\\263\\320\\276\\320\\264\\320\\260\\321\\200\\320\\260\\320\\274 \\321\\210\\321\\202\\320\\276 \\320\\263\\320\\276 \\320\\276\\320\\264\\320\\261\\321\\200\\320\\260\\320\\262\\321\\202\\320\\265 SumatraPDF!\\0\"\\\n  \"\\320\\222\\320\\270 \\320\\261\\320\\273\\320\\260\\320\\263\\320\\276\\320\\264\\320\\260\\321\\200\\320\\260\\320\\274! SumatraPDF \\320\\265 \\321\\203\\321\\201\\320\\277\\320\\265\\321\\210\\320\\275\\320\\276 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\320\\275.\\0\"\\\n  \"\\320\\224\\320\\260\\321\\202\\320\\276\\321\\202\\320\\265\\320\\272\\320\\260\\321\\202\\320\\260 \\320\\267\\320\\260 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\321\\232\\320\\265 \\320\\265 \\321\\200\\320\\260\\321\\201\\320\\270\\320\\277\\320\\260\\320\\275\\320\\260. \\320\\222\\320\\265 \\320\\274\\320\\276\\320\\273\\320\\260\\320\\274 \\320\\277\\321\\200\\320\\265\\320\\267\\320\\265\\320\\274\\320\\265\\321\\202\\320\\265 \\321\\230\\320\\260 \\320\\277\\320\\276\\320\\262\\321\\202\\320\\276\\321\\200\\320\\275\\320\\276.\\n\\320\\230\\320\\267\\320\\262\\320\\270\\320\\275\\320\\265\\321\\202\\320\\265 \\320\\275\\320\\260 \\320\\275\\320\\265\\320\\267\\320\\263\\320\\276\\320\\264\\320\\260\\321\\202\\320\\260!\\0\"\\\n  \"\\320\\230\\320\\267\\320\\261\\321\\200\\320\\270\\321\\210\\320\\270 SumatraPDF\\0\"\\\n  \"\\320\\221\\321\\200\\320\\270\\321\\210\\320\\265\\321\\232\\320\\265\\321\\202\\320\\276 \\320\\275\\320\\265 \\321\\203\\321\\201\\320\\277\\320\\265\\320\\260\\0\"\\\n  \"\\320\\221\\321\\200\\320\\270\\321\\210\\320\\265\\321\\232\\320\\265\\321\\202\\320\\276 \\320\\265 \\320\\262\\320\\276 \\321\\202\\320\\265\\320\\272...\\0\"\\\n  \"\\320\\232\\320\\276\\321\\200\\320\\270\\321\\201\\321\\202\\320\\270 \\320\\263\\320\\276 SumatraPDF \\320\\272\\320\\260\\320\\272\\320\\276 &\\320\\276\\321\\201\\320\\275\\320\\276\\320\\262\\320\\265\\320\\275 \\321\\207\\320\\270\\321\\202\\320\\260\\321\\207 \\320\\275\\320\\260 PDF\\0\";\n\nconst char * gTranslations_my = \n  \"&Tetapan\\0\"\\\n  \"Adakah anda pasti anda mahu membuang SumatraPDF?\\0\"\\\n  \"Tutup\\0\"\\\n  \"Tidak dapat mencipta direktori sementara\\0\"\\\n  \"Tidak dapat mencipta direktori pemasangan\\0\"\\\n  \"Tidak dapat memasang previewer PDF\\0\"\\\n  \"Tidak dapat memasang penapis carian PDF\\0\"\\\n  \"Tidak boleh mendapatkan direktori sementara\\0\"\\\n  \"Tidak dapat memadamkan direktori pemasangan\\0\"\\\n  \"Tidak dapat membuang shortcut\\0\"\\\n  \"Tidak dapat membuang previewer PDF\\0\"\\\n  \"Tidak dapat memadam penapis carian PDF\\0\"\\\n  \"Tidak dapat membuang pelayar plugin\\0\"\\\n  \"Tidak boleh memasukkan data %s ke cakera\\0\"\\\n  \"Gagal untuk menyalin uninstaller untuk direktori sementara\\0\"\\\n  \"Gagal untuk mencipta shortcut\\0\"\\\n  \"Gagal untuk memadam kekunci pendaftaran uninstaller\\0\"\\\n  \"\\0\"\\\n  \"Gagal menulis fail lanjutan maklumat tambahan ke dalam registry\\0\"\\\n  \"Gagal untuk menulis maklumat pemasangan untuk registry\\0\"\\\n  \"Sembunyi &Tetapan\\0\"\\\n  \"Pasang SumatraPDF\\0\"\\\n  \"Pasang SumatraPDF dalam &folder\\0\"\\\n  \"Pemasangan gagal!\\0\"\\\n  \"Pemasangan sedang dijalankan...\\0\"\\\n  \"\\0\"\\\n  \"Biarkan Windows Desktop Search &mencari dokumen PDF\\0\"\\\n  \"Biarkan Windows menunjukkan &preview dokumen PDF\\0\"\\\n  \"Sila tutup\\302\\240%s untuk meneruskan!\\0\"\\\n  \"Pilih folder di mana SumatraPDF harus dipasang:\\0\"\\\n  \"Sesetengah fail yang akan dipasang akan rosak atau hilang\\0\"\\\n  \"Mula SumatraPDF\\0\"\\\n  \"Installer SumatraPDF %s\\0\"\\\n  \"\\0\"\\\n  \"SumatraPDF telah dibuang.\\0\"\\\n  \"Pemasangan SumatraPDF tidak dijumpai.\\0\"\\\n  \"Terima kasih kerana memilih SumatraPDF!\\0\"\\\n  \"Terima kasih! SumatraPDF sudah dipasang pada komputer anda.\\0\"\\\n  \"Installer telah rosak. Sila muat turun sekali lagi.\\nMinta maaf atas kesulitan!\\0\"\\\n  \"Membuang SumatraPDF\\0\"\\\n  \"Penyahpasangan gagal\\0\"\\\n  \"Penyahpasangan sedang dijalankan ...\\0\"\\\n  \"Jadikan SumatraPDF sebagai aplikasi utama pembaca PDF anda\\0\";\n\nconst char * gTranslations_no = \n  \"&Tillegg\\0\"\\\n  \"Vil du virkelig avinstallere SumatraPDF?\\0\"\\\n  \"Lukk\\0\"\\\n  \"Kunne ikke opprette en midlertidig mappe\\0\"\\\n  \"Kunne ikke opprette installasjonsmappen \\0\"\\\n  \"Kunne ikke installere PDF forh\\303\\245ndsvisning\\0\"\\\n  \"Kunne ikke installere PDF s\\303\\270kefilter\\0\"\\\n  \"Kunne ikke finne midlertidig mappe\\0\"\\\n  \"Kunne ikke fjerne installasjonsmappen\\0\"\\\n  \"Kunne ikke fjerne snarveien\\0\"\\\n  \"Kunne ikke avinstallere PDF forh\\303\\245ndsvisning\\0\"\\\n  \"Kunne ikke avinstallere PDF s\\303\\270kefilter\\0\"\\\n  \"Kunne ikke avinstallere nettlesertillegget\\0\"\\\n  \"Kunne ikke skrive %s til disk \\0\"\\\n  \"Kan ikke kopiere avinstalleringsrutinen til midlertidig mappe\\0\"\\\n  \"Kan ikke opprette snarvei\\0\"\\\n  \"Kan ikke slette avinstalleringsn\\303\\270kler i Registeret\\0\"\\\n  \"\\0\"\\\n  \"Kan ikke lagre utvidet filtypeinformasjon i Registeret\\0\"\\\n  \"Kan ikke lagre avinstalleringsinformasjon i Registeret\\0\"\\\n  \"Skjule &Tillegg\\0\"\\\n  \"Installer SumatraPDF\\0\"\\\n  \"Installere SumatraPDF i &mappe:\\0\"\\\n  \"Feil ved installering!\\0\"\\\n  \"Installasjon p\\303\\245g\\303\\245r...\\0\"\\\n  \"Fortsett \\303\\245 ha PDF-nettlesertillegget installert (Ikke lenger st\\303\\270ttet)\\0\"\\\n  \"La Windows s\\303\\270kemotor &s\\303\\270ke PDF dokumenter\\0\"\\\n  \"La Windows vise &forh\\303\\245ndsvisning av PDF-dokumenter\\0\"\\\n  \"Vennligst lukk %s for \\303\\245 fortsette!\\0\"\\\n  \"Velg mappe der SumatraPDF skal installeres:\\0\"\\\n  \"Noen filer som skal installeres er skadet eller mangler\\0\"\\\n  \"\\0\"\\\n  \"SumatraPDF %s installering \\0\"\\\n  \"SumatraPDF %s avinstallering\\0\"\\\n  \"SumatraPDF har blitt avinstallert.\\0\"\\\n  \"SumatraPDF installering ikke funnet.\\0\"\\\n  \"Takk for at du valgte SumatraPDF!\\0\"\\\n  \"Takk! SumatraPDF har blitt installert.\\0\"\\\n  \"Installeringsprogrammet er defekt. Vennligst last det ned p\\303\\245 nytt. \\nBeklager!\\0\"\\\n  \"Avinstaller SumatraPDF\\0\"\\\n  \"Feil ved avinstallering\\0\"\\\n  \"Avinstallering p\\303\\245g\\303\\245r...\\0\"\\\n  \"Bruk SumatraPDF som &standard PDF-leser\\0\";\n\nconst char * gTranslations_nn = \n  \"&Innstillingar\\0\"\\\n  \"Er du sikker p\\303\\245 at du vil avinstallere SumatraPDF?\\0\"\\\n  \"Lukk\\0\"\\\n  \"Kunne ikkje lage midlertidig direktiv\\0\"\\\n  \"Kunne ikkje lage installasjonsdirektivet\\0\"\\\n  \"Kunne ikkje installere PDF-forhandsvisar\\0\"\\\n  \"Kunne ikkje installere PDF-s\\303\\270kjefilter\\0\"\\\n  \"Kunne ikkje hente midlertidig direktiv\\0\"\\\n  \"Kunne ikkje fjerne installasjonsdirektiv\\0\"\\\n  \"Kunne ikkje fjerne snarvegen\\0\"\\\n  \"Kunne ikkje avinstallere PDF-forhandsvisar\\0\"\\\n  \"Kunne ikkje avinstallere PDF-s\\303\\270kjefilteret\\0\"\\\n  \"Kunne ikkje avinstallere nettlesartillegget\\0\"\\\n  \"Kunne ikkje lagre %s til disken\\0\"\\\n  \"Mislykkas i \\303\\245 kopiere installasjonsfjernar til det midlertidige direktivet\\0\"\\\n  \"Klarte ikkje \\303\\245 lage ein snarveg\\0\"\\\n  \"Mislykkast i \\303\\245 slette avinstalleringsregistern\\303\\270klane\\0\"\\\n  \"\\0\"\\\n  \"Mislykkast i \\303\\245 skrive den utvida filutvidingsinformasjonen til registeret\\0\"\\\n  \"Mislykkast i \\303\\245 skrive avinstalleringsinformasjonen til registeret\\0\"\\\n  \"Skjul &innstillingar\\0\"\\\n  \"Installer SumatraPDF\\0\"\\\n  \"Installer SumatraPDF i mappa:\\0\"\\\n  \"Installering mislykkast!\\0\"\\\n  \"Installering under arbeid...\\0\"\\\n  \"Behald installeringa av PDF-&nettlesartillegget (Ikkje lenger st\\303\\270tta)\\0\"\\\n  \"Let Windows Skrivebordss\\303\\270k &s\\303\\270kje gjennom PDF-dokumentar\\0\"\\\n  \"Let Windows vise &forhandsvisingar av PDF-dokumentar\\0\"\\\n  \"Vennlig lukk %s for \\303\\245 fortsetje!\\0\"\\\n  \"Vel mappa der SumatraPDF skal bli installert:\\0\"\\\n  \"Nokre filar som skal installeres, enten mangler eller har forsvunnet.\\0\"\\\n  \"\\0\"\\\n  \"SumatraPDF %s-installerer\\0\"\\\n  \"SumatraPDF %s-avinstallerer\\0\"\\\n  \"SumatraPDF har blitt avinstallert.\\0\"\\\n  \"SumatraPDF-installeringa blei ikkje funnet.\\0\"\\\n  \"Takk for at du valde SumatraPDF!\\0\"\\\n  \"Tusen takk! SumatraPDF har blitt installert.\\0\"\\\n  \"Installeringsprogrammet har blitt korrumpert. Venligst installer han igjen.\\nVi beklager for problemane!\\0\"\\\n  \"Avinstaller SumatraPDF\\0\"\\\n  \"Avinstallering mislykkast\\0\"\\\n  \"Avinstallasjon under arbeid...\\0\"\\\n  \"Bruk SumatraPDF som standard PDF-lesar\\0\";\n\nconst char * gTranslations_fa = \n  \"&\\332\\257\\330\\262\\333\\214\\331\\206\\331\\207\\342\\200\\214\\331\\207\\330\\247\\0\"\\\n  \"\\330\\242\\333\\214\\330\\247 \\330\\250\\330\\261\\330\\247\\333\\214 \\331\\276\\330\\247\\332\\251 \\332\\251\\330\\261\\330\\257\\331\\206 \\330\\250\\330\\261\\331\\206\\330\\247\\331\\205\\331\\207\\342\\200\\214\\333\\214 \\330\\263\\331\\210\\331\\205\\330\\247\\330\\252\\330\\261\\330\\247 \\331\\276\\333\\214\\342\\200\\214\\330\\257\\333\\214\\342\\200\\214\\330\\247\\331\\201 \\331\\205\\330\\267\\331\\205\\330\\246\\331\\206 \\331\\207\\330\\263\\330\\252\\333\\214\\330\\257\\330\\237\\0\"\\\n  \"\\330\\250\\330\\263\\330\\252\\331\\206\\0\"\\\n  \"\\331\\206\\331\\205\\333\\214\\342\\200\\214\\330\\252\\331\\210\\330\\247\\331\\206 \\331\\276\\331\\210\\330\\264\\331\\207\\342\\200\\214\\333\\214 \\331\\205\\331\\210\\331\\202\\330\\252 \\330\\261\\330\\247 \\330\\247\\333\\214\\330\\254\\330\\247\\330\\257 \\332\\251\\330\\261\\330\\257\\0\"\\\n  \"\\331\\206\\331\\205\\333\\214\\342\\200\\214\\330\\252\\331\\210\\330\\247\\331\\206 \\331\\276\\331\\210\\330\\264\\331\\207\\342\\200\\214\\333\\214 \\331\\206\\330\\265\\330\\250 \\330\\261\\330\\247 \\330\\247\\333\\214\\330\\254\\330\\247\\330\\257 \\332\\251\\330\\261\\330\\257\\0\"\\\n  \"\\331\\206\\331\\205\\333\\214\\342\\200\\214\\330\\252\\331\\210\\330\\247\\331\\206 \\331\\276\\333\\214\\330\\264\\342\\200\\214\\331\\206\\331\\205\\330\\247\\333\\214\\330\\264\\332\\257\\330\\261 PDF \\330\\261\\330\\247 \\331\\206\\330\\265\\330\\250 \\332\\251\\330\\261\\330\\257.\\0\"\\\n  \"\\331\\206\\331\\205\\333\\214\\342\\200\\214\\330\\252\\331\\210\\330\\247\\331\\206 \\331\\201\\333\\214\\331\\204\\330\\252\\330\\261 \\330\\254\\330\\263\\330\\252\\330\\254\\331\\210\\333\\214 PDF \\330\\261\\330\\247 \\331\\206\\330\\265\\330\\250 \\332\\251\\330\\261\\330\\257.\\0\"\\\n  \"\\330\\257\\330\\263\\330\\252\\330\\261\\330\\263\\333\\214 \\330\\250\\331\\207 \\331\\276\\331\\210\\330\\264\\331\\207\\342\\200\\214\\333\\214 \\331\\205\\331\\210\\331\\202\\330\\252 \\331\\205\\331\\202\\330\\257\\331\\210\\330\\261 \\331\\206\\333\\214\\330\\263\\330\\252\\0\"\\\n  \"\\331\\206\\331\\205\\333\\214\\342\\200\\214\\330\\252\\331\\210\\330\\247\\331\\206 \\331\\276\\331\\210\\330\\264\\331\\207\\342\\200\\214\\333\\214 \\331\\206\\330\\265\\330\\250 \\330\\261\\330\\247 \\330\\255\\330\\260\\331\\201 \\332\\251\\330\\261\\330\\257\\0\"\\\n  \"\\331\\206\\331\\205\\333\\214\\342\\200\\214\\330\\252\\331\\210\\330\\247\\331\\206 \\331\\205\\333\\214\\330\\247\\331\\206\\330\\250\\330\\261 \\330\\261\\330\\247 \\330\\255\\330\\260\\331\\201 \\332\\251\\330\\261\\330\\257\\0\"\\\n  \"\\331\\206\\331\\205\\333\\214\\342\\200\\214\\330\\252\\331\\210\\330\\247\\331\\206 \\331\\276\\333\\214\\330\\264\\342\\200\\214\\331\\206\\331\\205\\330\\247\\333\\214\\330\\264\\332\\257\\330\\261 PDF \\330\\261\\330\\247 \\331\\276\\330\\247\\332\\251 \\332\\251\\330\\261\\330\\257\\0\"\\\n  \"\\331\\206\\331\\205\\333\\214\\342\\200\\214\\330\\252\\331\\210\\330\\247\\331\\206 \\331\\201\\333\\214\\331\\204\\330\\252\\330\\261 \\330\\254\\330\\263\\330\\252\\330\\254\\331\\210\\333\\214 PDF \\330\\261\\330\\247 \\331\\276\\330\\247\\332\\251 \\332\\251\\330\\261\\330\\257\\0\"\\\n  \"\\331\\206\\331\\205\\333\\214\\342\\200\\214\\330\\252\\331\\210\\330\\247\\331\\206 \\330\\247\\331\\201\\330\\262\\331\\210\\331\\206\\331\\207\\342\\200\\214\\333\\214 \\331\\205\\330\\261\\331\\210\\330\\261\\332\\257\\330\\261 \\330\\261\\330\\247 \\331\\276\\330\\247\\332\\251 \\332\\251\\330\\261\\330\\257\\0\"\\\n  \"\\331\\206\\331\\205\\333\\214\\342\\200\\214\\330\\252\\331\\210\\330\\247\\331\\206 %s \\330\\261\\330\\247 \\330\\261\\331\\210\\333\\214 \\330\\257\\333\\214\\330\\263\\332\\251 \\331\\206\\331\\210\\330\\264\\330\\252\\0\"\\\n  \"\\332\\251\\331\\276\\333\\214 \\332\\251\\330\\261\\330\\257\\331\\206 \\330\\250\\330\\261\\331\\206\\330\\247\\331\\205\\331\\207\\342\\200\\214\\333\\214 \\330\\255\\330\\260\\331\\201 \\330\\250\\331\\207 \\331\\276\\331\\210\\330\\264\\331\\207\\342\\200\\214\\333\\214 \\331\\205\\331\\210\\331\\202\\330\\252 \\331\\206\\330\\247\\331\\205\\331\\210\\331\\201\\331\\202 \\330\\250\\331\\210\\330\\257\\0\"\\\n  \"\\330\\256\\330\\267\\330\\247 \\330\\257\\330\\261 \\330\\247\\333\\214\\330\\254\\330\\247\\330\\257 \\331\\205\\333\\214\\330\\247\\331\\206\\330\\250\\330\\261\\0\"\\\n  \"\\332\\251\\331\\204\\333\\214\\330\\257\\331\\207\\330\\247\\333\\214 \\330\\261\\330\\254\\333\\214\\330\\263\\330\\252\\330\\261\\333\\214 \\330\\250\\330\\261\\331\\206\\330\\247\\331\\205\\331\\207\\342\\200\\214\\333\\214 \\330\\255\\330\\260\\331\\201 \\331\\276\\330\\247\\332\\251 \\331\\206\\330\\264\\330\\257\\0\"\\\n  \"\\0\"\\\n  \"\\330\\253\\330\\250\\330\\252 \\330\\247\\330\\267\\331\\204\\330\\247\\330\\271\\330\\247\\330\\252 \\330\\247\\330\\261\\330\\263\\330\\247\\331\\204 \\330\\264\\330\\257\\331\\207 \\330\\250\\330\\247 \\331\\276\\330\\263\\331\\210\\331\\206\\330\\257 \\330\\267\\331\\210\\331\\204\\330\\247\\331\\206\\333\\214 \\331\\206\\330\\247\\331\\205\\331\\210\\331\\201\\331\\202\\0\"\\\n  \"\\330\\253\\330\\250\\330\\252 \\330\\247\\330\\267\\331\\204\\330\\247\\330\\271\\330\\247\\330\\252 \\331\\201\\330\\261\\330\\242\\333\\214\\331\\206\\330\\257 \\330\\255\\330\\260\\331\\201 \\330\\257\\330\\261 \\330\\261\\330\\254\\333\\214\\330\\263\\330\\252\\330\\261\\333\\214 \\331\\206\\330\\247\\331\\205\\331\\210\\331\\201\\331\\202 \\330\\250\\331\\210\\330\\257\\0\"\\\n  \"\\331\\205\\330\\256\\331\\201\\333\\214 \\332\\251\\330\\261\\330\\257\\331\\206 &\\332\\257\\330\\262\\333\\214\\331\\206\\331\\207\\342\\200\\214\\331\\207\\330\\247\\0\"\\\n  \"\\331\\206\\330\\265\\330\\250 \\332\\251\\330\\261\\330\\257\\331\\206 SumatraPDF\\0\"\\\n  \"SumatraPDF \\330\\261\\330\\247 \\330\\257\\330\\261 \\330\\247\\333\\214\\331\\206 &\\331\\276\\331\\210\\330\\264\\331\\207 \\331\\206\\330\\265\\330\\250 \\332\\251\\331\\206:\\0\"\\\n  \"\\330\\247\\333\\214\\330\\261\\330\\247\\330\\257 \\330\\257\\330\\261 \\331\\206\\330\\265\\330\\250\\0\"\\\n  \"\\330\\257\\330\\261 \\330\\255\\330\\247\\331\\204 \\331\\206\\330\\265\\330\\250...\\0\"\\\n  \"\\330\\247\\331\\201\\330\\262\\331\\210\\331\\206\\331\\207\\342\\200\\214\\333\\214 PDF \\331\\206\\330\\265\\330\\250 \\330\\264\\330\\257\\331\\207 \\330\\261\\331\\210\\333\\214 \\331\\205\\330\\261\\331\\210\\330\\261\\332\\257\\330\\261 \\330\\250\\330\\247\\331\\202\\333\\214 \\330\\250\\331\\205\\330\\247\\331\\206\\330\\257 (\\330\\257\\333\\214\\332\\257\\330\\261 \\331\\276\\330\\264\\330\\252\\333\\214\\330\\250\\330\\247\\331\\206\\333\\214 \\331\\206\\331\\205\\333\\214\\342\\200\\214\\330\\264\\331\\210\\330\\257)\\0\"\\\n  \"\\330\\254\\330\\263\\330\\252\\330\\254\\331\\210\\332\\257\\330\\261 \\331\\210\\333\\214\\331\\206\\330\\257\\331\\210\\330\\262 \\330\\247\\331\\205\\332\\251\\330\\247\\331\\206 &\\330\\254\\330\\263\\330\\252\\330\\254\\331\\210 \\330\\257\\330\\261 \\330\\247\\330\\263\\331\\206\\330\\247\\330\\257 PDF \\330\\261\\330\\247 \\330\\257\\330\\247\\330\\264\\330\\252\\331\\207 \\330\\250\\330\\247\\330\\264\\330\\257\\0\"\\\n  \"\\331\\210\\333\\214\\331\\206\\330\\257\\331\\210\\330\\262 \\330\\247\\331\\205\\332\\251\\330\\247\\331\\206 \\331\\276\\333\\214\\330\\264\\342\\200\\214\\331\\206\\331\\205\\330\\247\\333\\214\\330\\264 \\330\\247\\330\\263\\331\\206\\330\\247\\330\\257 PDF \\330\\261\\330\\247 \\330\\257\\330\\247\\330\\264\\330\\252\\331\\207 \\330\\250\\330\\247\\330\\264\\330\\257\\0\"\\\n  \"\\331\\276\\333\\214\\330\\264 \\330\\247\\330\\262 \\330\\247\\330\\257\\330\\247\\331\\205\\331\\207 \\331\\204\\330\\267\\331\\201\\330\\247 %s \\330\\261\\330\\247 \\330\\250\\330\\250\\331\\206\\330\\257\\333\\214\\330\\257!\\0\"\\\n  \"\\331\\276\\331\\210\\330\\264\\331\\207\\342\\200\\214\\330\\247\\333\\214 \\330\\261\\330\\247 \\330\\250\\330\\261\\330\\247\\333\\214 \\331\\206\\330\\265\\330\\250 Sumatra PDF \\330\\247\\331\\206\\330\\252\\330\\256\\330\\247\\330\\250 \\332\\251\\331\\206\\333\\214\\330\\257:\\0\"\\\n  \"\\330\\250\\330\\271\\330\\266\\333\\214 \\330\\247\\330\\262 \\331\\201\\330\\247\\333\\214\\331\\204\\342\\200\\214\\331\\207\\330\\247\\333\\214 \\331\\206\\330\\265\\330\\250 \\330\\256\\330\\261\\330\\247\\330\\250 \\331\\207\\330\\263\\330\\252\\331\\206\\330\\257 \\333\\214\\330\\247 \\331\\210\\330\\254\\331\\210\\330\\257 \\331\\206\\330\\257\\330\\247\\330\\261\\331\\206\\330\\257\\0\"\\\n  \"\\330\\247\\330\\254\\330\\261\\330\\247\\333\\214 Sumatra PDF\\0\"\\\n  \"\\331\\206\\330\\265\\330\\250 \\332\\251\\331\\206\\331\\206\\330\\257\\331\\207 SumatraPDF %s\\0\"\\\n  \"\\330\\255\\330\\260\\331\\201 \\332\\251\\331\\206\\331\\206\\330\\257\\331\\207 SumatraPDF %s\\0\"\\\n  \"SumatraPDF \\331\\276\\330\\247\\332\\251 \\330\\264\\330\\257.\\0\"\\\n  \"\\331\\206\\330\\265\\330\\250 \\330\\264\\330\\257\\331\\207\\342\\200\\214\\333\\214 SumatraPDF \\331\\276\\333\\214\\330\\257\\330\\247 \\331\\206\\330\\264\\330\\257.\\0\"\\\n  \"\\330\\250\\331\\207 \\330\\256\\330\\247\\330\\267\\330\\261 \\330\\247\\331\\206\\330\\252\\330\\256\\330\\247\\330\\250 SumatraPDF \\330\\247\\330\\262 \\330\\264\\331\\205\\330\\247 \\331\\205\\330\\252\\330\\264\\332\\251\\330\\261\\333\\214\\331\\205!\\0\"\\\n  \"\\330\\250\\330\\247 \\330\\252\\330\\264\\332\\251\\330\\261! SumatraPDF \\331\\206\\330\\265\\330\\250 \\330\\264\\330\\257.\\0\"\\\n  \"\\330\\250\\330\\261\\331\\206\\330\\247\\331\\205\\331\\207 \\331\\206\\330\\265\\330\\250 \\330\\256\\330\\261\\330\\247\\330\\250 \\330\\264\\330\\257\\331\\207 \\330\\247\\330\\263\\330\\252. \\331\\204\\330\\267\\331\\201\\330\\247 \\330\\257\\331\\210\\330\\250\\330\\247\\330\\261\\331\\207 \\330\\257\\330\\247\\331\\206\\331\\204\\331\\210\\330\\257 \\332\\251\\331\\206\\333\\214\\330\\257.\\n\\330\\250\\330\\247 \\330\\271\\330\\261\\330\\266 \\331\\276\\331\\210\\330\\262\\330\\264 \\330\\250\\331\\207 \\330\\256\\330\\247\\330\\267\\330\\261 \\330\\247\\330\\264\\332\\251\\330\\247\\331\\204 \\330\\250\\331\\207 \\331\\210\\330\\254\\331\\210\\330\\257 \\330\\242\\331\\205\\330\\257\\331\\207..\\0\"\\\n  \"\\331\\276\\330\\247\\332\\251 \\332\\251\\330\\261\\330\\257\\331\\206 SumatraPDF\\0\"\\\n  \"\\331\\276\\330\\247\\332\\251 \\332\\251\\330\\261\\330\\257\\331\\206 \\330\\250\\330\\261\\331\\206\\330\\247\\331\\205\\331\\207 \\331\\206\\330\\247\\331\\205\\331\\210\\331\\201\\331\\202 \\330\\250\\331\\210\\330\\257\\0\"\\\n  \"\\331\\201\\330\\261\\330\\242\\333\\214\\331\\206\\330\\257 \\330\\255\\330\\260\\331\\201 \\330\\250\\330\\261\\331\\206\\330\\247\\331\\205\\331\\207 \\330\\257\\330\\261 \\330\\254\\330\\261\\333\\214\\330\\247\\331\\206 \\330\\247\\330\\263\\330\\252...\\0\"\\\n  \"\\330\\247\\330\\263\\330\\252\\331\\201\\330\\247\\330\\257\\331\\207 \\330\\247\\330\\262 SumatraPDF \\330\\250\\331\\207 \\330\\271\\331\\206\\331\\210\\330\\247\\331\\206 \\331\\276\\333\\214\\342\\200\\214\\330\\257\\333\\214\\342\\200\\214\\330\\247\\331\\201 \\330\\256\\331\\210\\330\\247\\331\\206 &\\331\\276\\333\\214\\330\\264\\331\\201\\330\\261\\330\\266\\0\";\n\nconst char * gTranslations_pl = \n  \"&Opcje\\0\"\\\n  \"Czy na pewno chcesz usun\\304\\205\\304\\207 SumatraPDF?\\0\"\\\n  \"Zamknij\\0\"\\\n  \"Nie mo\\305\\274na utworzy\\304\\207 katalogu tymczasowego\\0\"\\\n  \"Nie mo\\305\\274na utworzy\\304\\207 katalogu instalacyjnego\\0\"\\\n  \"Nie mo\\305\\274na zainstalowa\\304\\207 podgl\\304\\205du PDF\\0\"\\\n  \"Nie mo\\305\\274na zainstalowa\\304\\207 filtru przeszukiwania PDF\\0\"\\\n  \"Nie mo\\305\\274na uzyska\\304\\207 katalogu tymczasowego\\0\"\\\n  \"Nie mo\\305\\274na usun\\304\\205\\304\\207 katalogu instalacyjnego\\0\"\\\n  \"Nie mo\\305\\274na usun\\304\\205\\304\\207 skr\\303\\263tu\\0\"\\\n  \"Nie mo\\305\\274na usun\\304\\205\\304\\207 podgl\\304\\205du PDF\\0\"\\\n  \"Nie mo\\305\\274na usun\\304\\205\\304\\207 filtru przeszukiwania PDF\\0\"\\\n  \"Nie mo\\305\\274na usun\\304\\205\\304\\207 wtyczki do przegl\\304\\205darek\\0\"\\\n  \"Nie mo\\305\\274na zapisa\\304\\207 %s na dysk\\0\"\\\n  \"Nie mo\\305\\274na skopiowa\\304\\207 deinstalatora do katalogu tymczasowego\\0\"\\\n  \"B\\305\\202\\304\\205d przy tworzeniu skr\\303\\263tu\\0\"\\\n  \"Nie mo\\305\\274na usun\\304\\205\\304\\207 kluczy deinstalatora z rejestru\\0\"\\\n  \"\\0\"\\\n  \"Nie mo\\305\\274na wprowadzi\\304\\207 poszerzonych informacji o rozszerzeniu pliku do rejestru\\0\"\\\n  \"Nie mo\\305\\274na zapisa\\304\\207 informacji o usuni\\304\\231ciu programu do rejestru\\0\"\\\n  \"Ukryj &Opcje\\0\"\\\n  \"Zainstaluj SumatraPDF\\0\"\\\n  \"Zainstaluj SumatraPDF w &folderze:\\0\"\\\n  \"B\\305\\202\\304\\205d instalacji!\\0\"\\\n  \"Trwa instalacja...\\0\"\\\n  \"Pozostaw zainstalowan\\304\\205 &wtyczk\\304\\231 PDF do przegl\\304\\205darek (ju\\305\\274 nie jest wspierana)\\0\"\\\n  \"Wyszukiwanie z pulpitu systemu Windows ma &przeszukiwa\\304\\207 pliki PDF\\0\"\\\n  \"Windows ma pokazywa\\304\\207 &podgl\\304\\205d plik\\303\\263w PDF\\0\"\\\n  \"Zamknij  %s, aby kontynuowa\\304\\207!\\0\"\\\n  \"Wybierz folder, w kt\\303\\263rym nale\\305\\274y zainstalowa\\304\\207 program SumatraPDF:\\0\"\\\n  \"Niekt\\303\\263re pliki instalacyjne s\\304\\205 uszkodzone lub niedost\\304\\231pne\\0\"\\\n  \"Uruchom SumatraPDF\\0\"\\\n  \"Instalator SumatraPDF %s\\0\"\\\n  \"Usu\\305\\204 SumatraPDF %s\\0\"\\\n  \"Program SumatraPDF zosta\\305\\202 usuni\\304\\231ty.\\0\"\\\n  \"Program SumatraPDF nie zosta\\305\\202 znaleziony.\\0\"\\\n  \"Dzi\\304\\231kujemy za wyb\\303\\263r SumatraPDF!\\0\"\\\n  \"Program SumatraPDF zosta\\305\\202 zainstalowany.\\0\"\\\n  \"Plik instalacyjny jest uszkodzony. Pobierz go jeszcze raz.\\nPrzepraszamy za k\\305\\202opot.\\0\"\\\n  \"Usu\\305\\204 SumatraPDF\\0\"\\\n  \"Usuni\\304\\231cie programu nie powiod\\305\\202o si\\304\\231\\0\"\\\n  \"Trwa usuwanie...\\0\"\\\n  \"U\\305\\274ywaj SumatraPDF jako domy\\305\\233lnej przegl\\304\\205darki PDF\\0\";\n\nconst char * gTranslations_br = \n  \"&Op\\303\\247\\303\\265es\\0\"\\\n  \"Tem certeza de que quer desinstalar o SumatraPDF?\\0\"\\\n  \"Fechar\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel criar pasta tempor\\303\\241ria\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel criar a pasta de instala\\303\\247\\303\\243o.\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel instalar o pr\\303\\251-visualizador para PDF\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel instalar o filtro de pesquisa para PDF\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel obter a pasta tempor\\303\\241ria\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel remover a pasta de instala\\303\\247\\303\\243o\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel remover o atalho\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel desinstalar o pr\\303\\251-visualizador para PDF\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel desinstalar o filtro de pesquisa para PDF\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel desinstalar o plugin do navegador\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel gravar %s no disco\\0\"\\\n  \"Falha na c\\303\\263pia do desinstalador para a pasta tempor\\303\\241ria\\0\"\\\n  \"Falha na cria\\303\\247\\303\\243o do atalho\\0\"\\\n  \"Falha na remo\\303\\247\\303\\243o das entradas de registro do desinstalador\\0\"\\\n  \"\\0\"\\\n  \"Falha na grava\\303\\247\\303\\243o da extens\\303\\243o de arquivo no registro\\0\"\\\n  \"Falha na grava\\303\\247\\303\\243o dos dados de desinstala\\303\\247\\303\\243o no registro\\0\"\\\n  \"Ocultar &Op\\303\\247\\303\\265es\\0\"\\\n  \"Instalar SumatraPDF\\0\"\\\n  \"Instalar SumatraPDF na &pasta:\\0\"\\\n  \"Falha na instala\\303\\247\\303\\243o!\\0\"\\\n  \"Instala\\303\\247\\303\\243o em progresso...\\0\"\\\n  \"Mantenha o plugin PDF para instalado (n\\303\\243o \\303\\251 mais suportado)\\0\"\\\n  \"Permitir que o Windows fa\\303\\247a a bu&sca em documentos PDF\\0\"\\\n  \"Permitir que o Windows &pr\\303\\251-visualize documentos PDF\\0\"\\\n  \"Por favor feche %s para continuar!\\0\"\\\n  \"Selecione a pasta onde o SumatraPDF dever\\303\\241 ser instalado:\\0\"\\\n  \"Alguns arquivos de instala\\303\\247\\303\\243o est\\303\\243o danificados ou ausentes\\0\"\\\n  \"Iniciar SumatraPDF\\0\"\\\n  \"SumatraPDF %s instalador\\0\"\\\n  \"SumatraPDF %s desinstalador\\0\"\\\n  \"SumatraPDF foi desinstalado.\\0\"\\\n  \"A instala\\303\\247\\303\\243o do SumatraPDF n\\303\\243o foi encontrada.\\0\"\\\n  \"Obrigado por escolher o SumatraPDF!\\0\"\\\n  \"Obrigado! O SumatraPDF foi instalado.\\0\"\\\n  \"O instalador est\\303\\241 corrompido. Por favor baixe-o novamente.\\nDesculpe pelo inc\\303\\264modo!\\0\"\\\n  \"Desinstalar SumatraPDF\\0\"\\\n  \"A desinstala\\303\\247\\303\\243o falhou\\0\"\\\n  \"Desinstala\\303\\247\\303\\243o em progresso...\\0\"\\\n  \"Usar o SumatraPDF como o leitor PDF pa&dr\\303\\243o\\0\";\n\nconst char * gTranslations_pt = \n  \"&Op\\303\\247\\303\\265es\\0\"\\\n  \"Tem a certeza que quer desinstalar o SumatraPDF?\\0\"\\\n  \"Fechar\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel criar a pasta tempor\\303\\241ria\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel criar a pasta de instala\\303\\247\\303\\243o\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel instalar o antevis\\303\\243o de PDF\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel instalar o filtro de procuras\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel obter a pasta tempor\\303\\241ria\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel remover a pasta de instala\\303\\247\\303\\243o\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel remover o atalho\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel desinstalar a antevis\\303\\243o de PDF\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel desinstalar o filtro de procura\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel desinstalar o plugin do navegador\\0\"\\\n  \"N\\303\\243o foi poss\\303\\255vel escrever %s no disco\\0\"\\\n  \"Falha ao copiar o desinstalador para a pasta tempor\\303\\241ria\\0\"\\\n  \"Erro ao criar atalho\\0\"\\\n  \"Falha ao eliminar as chaves do registo\\0\"\\\n  \"\\0\"\\\n  \"Falha ao escrever as informa\\303\\247\\303\\265es do tipo de ficheiro nas chaves de registo\\0\"\\\n  \"Falha ao escrever as informa\\303\\247\\303\\265es de desinstala\\303\\247\\303\\243o no registo\\0\"\\\n  \"&Ocultar op\\303\\247\\303\\265es\\0\"\\\n  \"Instalar SumatraPDF\\0\"\\\n  \"Instalar SumatraPD&F na pasta:\\0\"\\\n  \"A instala\\303\\247\\303\\243o falhou!\\0\"\\\n  \"A instalar...\\0\"\\\n  \"&Manter plugin de navegador instalado (j\\303\\241 n\\303\\243o \\303\\251 suportado)\\0\"\\\n  \"Permitir que o Windows Desktop &Search localize os PDF\\0\"\\\n  \"&Permitir que o Windows mostre uma antevis\\303\\243o dos PDF\\0\"\\\n  \"Para continuar, feche o %s!\\0\"\\\n  \"Escolha a pasta de instala\\303\\247\\303\\243o do SumatraPDF:\\0\"\\\n  \"Alguns ficheiros do instalador est\\303\\243o danificados\\0\"\\\n  \"Iniciar SumatraPDF\\0\"\\\n  \"Instalador do SumatraPDF %s\\0\"\\\n  \"Desinstalador do SumatraPDF %s\\0\"\\\n  \"O SumatraPDF foi desinstalado.\\0\"\\\n  \"O SumatraPDF n\\303\\243o foi encontrado.\\0\"\\\n  \"Obrigado por ter escolhido o SumatraPDF!\\0\"\\\n  \"O SumatraPDF foi instalado.\\0\"\\\n  \"O instalador est\\303\\241 danificado. Efetue uma nova transfer\\303\\252ncia.\\nDesculpe o inconveniente.\\0\"\\\n  \"Remover SumatraPDF\\0\"\\\n  \"Falha na desinstala\\303\\247\\303\\243o!\\0\"\\\n  \"A desinstalar...\\0\"\\\n  \"Utilizar o SumatraPDF como leitor pa&dr\\303\\243o de PDF\\0\";\n\nconst char * gTranslations_ro = \n  \"&Optiuni\\0\"\\\n  \"Sunteti sigur ca doriti sa dezinstalati Sumatra PDF?\\0\"\\\n  \"Inchidere\\0\"\\\n  \"Nu s-a putut crea un director temporar\\0\"\\\n  \"Nu s-a putut crea directorul de instalare\\0\"\\\n  \"Nu s-a putut instala previzualizatorul PDF\\0\"\\\n  \"Nu s-a putut instala filtrul de cautare PDF\\0\"\\\n  \"Nu s-a putut obtine directorul temporar\\0\"\\\n  \"Nu s-a putut sterge directorul de instalare\\0\"\\\n  \"Nu s-au putut sterge scurtatura\\0\"\\\n  \"Nu s-a putut dezinstala previzualizatorul PDF\\0\"\\\n  \"Nu s-a putut dezinstala filtrul de cautare PDF\\0\"\\\n  \"Nu s-a putut dezinstala plugin-ul de browser\\0\"\\\n  \"Nu s-a putut scrie %s pe disc\\0\"\\\n  \"Eroare la copierea dezinstalatorului in directorul temporar\\0\"\\\n  \"Eroare la crearea unei scurtaturi\\0\"\\\n  \"Eroare la stergerea inregistrarilor de dezinstalare din registri\\0\"\\\n  \"\\0\"\\\n  \"Eroare la scrierea informatiei extinse despre extensia fisierului in registri\\0\"\\\n  \"Eroare la scrierea informatiilor de dezinstalare in registri\\0\"\\\n  \"Ascundere &Optiuni\\0\"\\\n  \"Instalare SumatraPDF\\0\"\\\n  \"Instalare SumatraPDF in &folderul:\\0\"\\\n  \"Instalare esuata!\\0\"\\\n  \"Se instaleaza...\\0\"\\\n  \"\\0\"\\\n  \"Permite Windows Desktop &Search sa caute in documente PDF\\0\"\\\n  \"Permite Windows-ului sa arate &previzualizari ale documentelor PDF\\0\"\\\n  \"Rugam inchideti %s pentru a putea continua!\\0\"\\\n  \"Alegeti folderul in care sa se instaleze SumatraPDF:\\0\"\\\n  \"Niste fisiere ce trebuiesc instalate lipsesc sau sunt pleznite\\0\"\\\n  \"Pornire SumatraPDF\\0\"\\\n  \"Programul de instalare %s SumatraPDF\\0\"\\\n  \"Programul de dezinstalare a %s SumatraPDF\\0\"\\\n  \"SumatraPDF a fost dezinstalat.\\0\"\\\n  \"Nu s-a gasit instalarea SumatraPDF.\\0\"\\\n  \"Va multumim pentru ca ati ales SumatraPDF!\\0\"\\\n  \"Multumim! SumatraPDF a fost dezinstalat.\\0\"\\\n  \"Programul de instalare este pleznit :(. Rugam descarcati-l din nou. \\n Scuze pentru deranj!\\0\"\\\n  \"Dezinstalare SumatraPDF\\0\"\\\n  \"Dezinstalarea a esuat\\0\"\\\n  \"Dezinstalare in curs...\\0\"\\\n  \"Folosi\\310\\233i SumatraPDF ca cititor implicit pentru fi\\310\\231iere P&DF\\0\";\n\nconst char * gTranslations_ru = \n  \"&\\320\\237\\320\\260\\321\\200\\320\\260\\320\\274\\320\\265\\321\\202\\321\\200\\321\\213\\0\"\\\n  \"\\320\\222\\321\\213 \\321\\203\\320\\262\\320\\265\\321\\200\\320\\265\\320\\275\\321\\213, \\321\\207\\321\\202\\320\\276 \\321\\205\\320\\276\\321\\202\\320\\270\\321\\202\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\270\\321\\202\\321\\214 SumatraPDF?\\0\"\\\n  \"\\320\\227\\320\\260\\320\\272\\321\\200\\321\\213\\321\\202\\321\\214\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\214 \\321\\201\\320\\276\\320\\267\\320\\264\\320\\260\\321\\202\\321\\214 \\320\\262\\321\\200\\320\\265\\320\\274\\320\\265\\320\\275\\320\\275\\321\\203\\321\\216 \\320\\264\\320\\270\\321\\200\\320\\265\\320\\272\\321\\202\\320\\276\\321\\200\\320\\270\\321\\216\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\214 \\321\\201\\320\\276\\320\\267\\320\\264\\320\\260\\321\\202\\321\\214 \\320\\264\\320\\270\\321\\200\\320\\265\\320\\272\\321\\202\\320\\276\\321\\200\\320\\270\\321\\216 \\320\\264\\320\\273\\321\\217 \\321\\203\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\272\\320\\270\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\214 \\321\\203\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\270\\321\\202\\321\\214 \\320\\277\\321\\200\\320\\276\\321\\201\\320\\274\\320\\276\\321\\202\\321\\200\\321\\211\\320\\270\\320\\272 PDF\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\214 \\321\\203\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\270\\321\\202\\321\\214 \\321\\204\\320\\270\\320\\273\\321\\214\\321\\202\\321\\200 \\320\\277\\320\\276\\320\\270\\321\\201\\320\\272\\320\\260 PDF\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\214 \\320\\276\\320\\277\\321\\200\\320\\265\\320\\264\\320\\265\\320\\273\\320\\270\\321\\202\\321\\214 \\320\\262\\321\\200\\320\\265\\320\\274\\320\\265\\320\\275\\320\\275\\321\\203\\321\\216 \\320\\264\\320\\270\\321\\200\\320\\265\\320\\272\\321\\202\\320\\276\\321\\200\\320\\270\\321\\216\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\214 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\270\\321\\202\\321\\214 \\320\\264\\320\\270\\321\\200\\320\\265\\320\\272\\321\\202\\320\\276\\321\\200\\320\\270\\321\\216 \\321\\203\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\272\\320\\270\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\214 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\270\\321\\202\\321\\214 \\321\\217\\321\\200\\320\\273\\321\\213\\320\\272\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\214 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\270\\321\\202\\321\\214 \\320\\277\\321\\200\\320\\276\\321\\201\\320\\274\\320\\276\\321\\202\\321\\200\\321\\211\\320\\270\\320\\272 PDF\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\214 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\270\\321\\202\\321\\214 \\321\\204\\320\\270\\320\\273\\321\\214\\321\\202\\321\\200 \\320\\277\\320\\276\\320\\270\\321\\201\\320\\272\\320\\260 PDF\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\214 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\270\\321\\202\\321\\214 \\320\\277\\320\\273\\320\\260\\320\\263\\320\\270\\320\\275 \\320\\261\\321\\200\\320\\260\\321\\203\\320\\267\\320\\265\\321\\200\\320\\260\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\214 \\320\\267\\320\\260\\320\\277\\320\\270\\321\\201\\320\\260\\321\\202\\321\\214 %s \\320\\275\\320\\260 \\320\\264\\320\\270\\321\\201\\320\\272\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\214 \\321\\201\\320\\272\\320\\276\\320\\277\\320\\270\\321\\200\\320\\276\\320\\262\\320\\260\\321\\202\\321\\214 \\320\\264\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\273\\321\\217\\321\\202\\320\\276\\321\\200 \\320\\262\\320\\276 \\320\\262\\321\\200\\320\\265\\320\\274\\320\\265\\320\\275\\320\\275\\321\\203\\321\\216 \\320\\264\\320\\270\\321\\200\\320\\265\\320\\272\\321\\202\\320\\276\\321\\200\\320\\270\\321\\216\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\214 \\321\\201\\320\\276\\320\\267\\320\\264\\320\\260\\321\\202\\321\\214 \\321\\217\\321\\200\\320\\273\\321\\213\\320\\272\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\214 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\270\\321\\202\\321\\214 \\320\\272\\320\\273\\321\\216\\321\\207\\320\\270 \\321\\200\\320\\265\\320\\263\\320\\270\\321\\201\\321\\202\\321\\200\\320\\260 \\320\\264\\320\\273\\321\\217 \\320\\264\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\273\\321\\217\\321\\202\\320\\276\\321\\200\\320\\260\\0\"\\\n  \"\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\214 \\320\\267\\320\\260\\320\\277\\320\\270\\321\\201\\320\\260\\321\\202\\321\\214 \\320\\277\\320\\276\\320\\273\\320\\275\\321\\203\\321\\216 \\320\\270\\320\\275\\321\\204\\320\\276\\321\\200\\320\\274\\320\\260\\321\\206\\320\\270\\321\\216 \\320\\276 \\321\\200\\320\\260\\321\\201\\321\\210\\320\\270\\321\\200\\320\\265\\320\\275\\320\\270\\320\\270 \\321\\204\\320\\260\\320\\271\\320\\273\\320\\260 \\320\\262 \\321\\200\\320\\265\\320\\265\\321\\201\\321\\202\\321\\200\\0\"\\\n  \"\\320\\235\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\214 \\320\\267\\320\\260\\320\\277\\320\\270\\321\\201\\320\\260\\321\\202\\321\\214 \\320\\270\\320\\275\\321\\204\\320\\276\\321\\200\\320\\274\\320\\260\\321\\206\\320\\270\\321\\216 \\320\\264\\320\\273\\321\\217 \\320\\264\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\273\\321\\217\\321\\202\\320\\276\\321\\200\\320\\260 \\320\\262 \\321\\200\\320\\265\\320\\265\\321\\201\\321\\202\\321\\200\\0\"\\\n  \"\\320\\241\\320\\272\\321\\200\\321\\213\\321\\202\\321\\214 \\320\\277\\320\\260\\321\\200\\320\\260\\320\\274\\320\\265\\321\\202\\321\\200\\321\\213\\0\"\\\n  \"\\320\\235\\320\\260\\321\\207\\320\\260\\321\\202\\321\\214 \\321\\203\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\272\\321\\203\\0\"\\\n  \"\\320\\243\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\270\\321\\202\\321\\214 SumatraPDF \\320\\262 &\\320\\277\\320\\260\\320\\277\\320\\272\\321\\203:\\0\"\\\n  \"\\320\\243\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\272\\320\\260 \\320\\275\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\260\\321\\201\\321\\214!\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\270\\321\\201\\321\\205\\320\\276\\320\\264\\320\\270\\321\\202 \\321\\203\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\272\\320\\260...\\0\"\\\n  \"\\320\\241\\320\\276\\321\\205\\321\\200\\320\\260\\320\\275\\320\\270\\321\\202\\321\\214 \\321\\203\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\273\\320\\265\\320\\275\\320\\275\\321\\213\\320\\271 PDF \\320\\277\\320\\273\\320\\260\\320\\263\\320\\270\\320\\275 \\320\\264\\320\\273\\321\\217 \\320\\261\\321\\200\\320\\260\\321\\203\\320\\267\\320\\265\\321\\200\\320\\260 (\\320\\261\\320\\276\\320\\273\\320\\265\\320\\265 \\320\\275\\320\\265 \\320\\277\\320\\276\\320\\264\\320\\264\\320\\265\\321\\200\\320\\266\\320\\270\\320\\262\\320\\260\\320\\265\\321\\202\\321\\201\\321\\217)\\0\"\\\n  \"&\\320\\237\\320\\276\\320\\270\\321\\201\\320\\272 \\321\\204\\320\\260\\320\\271\\320\\273\\320\\276\\320\\262 PDF \\321\\201 \\320\\277\\320\\276\\320\\274\\320\\276\\321\\211\\321\\214\\321\\216 Windows Desktop Search\\0\"\\\n  \"&\\320\\237\\321\\200\\320\\276\\321\\201\\320\\274\\320\\276\\321\\202\\321\\200 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\276\\320\\262 PDF \\321\\201\\321\\200\\320\\265\\320\\264\\321\\201\\321\\202\\320\\262\\320\\260\\320\\274\\320\\270 Windows\\0\"\\\n  \"\\320\\224\\320\\273\\321\\217 \\320\\277\\321\\200\\320\\276\\320\\264\\320\\276\\320\\273\\320\\266\\320\\265\\320\\275\\320\\270\\321\\217, \\320\\267\\320\\260\\320\\272\\321\\200\\320\\276\\320\\271\\321\\202\\320\\265 %s !\\0\"\\\n  \"\\320\\243\\320\\272\\320\\260\\320\\266\\320\\270\\321\\202\\320\\265 \\320\\277\\320\\260\\320\\277\\320\\272\\321\\203 \\321\\203\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\272\\320\\270 SumatraPDF:\\0\"\\\n  \"\\320\\235\\320\\265\\320\\272\\320\\276\\321\\202\\320\\276\\321\\200\\321\\213\\320\\265 \\321\\204\\320\\260\\320\\271\\320\\273\\321\\213 \\321\\203\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\272\\320\\270 \\320\\277\\320\\276\\320\\262\\321\\200\\320\\265\\320\\266\\320\\264\\320\\265\\320\\275\\321\\213 \\320\\270\\320\\273\\320\\270 \\320\\276\\321\\202\\321\\201\\321\\203\\321\\202\\321\\201\\321\\202\\320\\262\\321\\203\\321\\216\\321\\202\\0\"\\\n  \"\\320\\237\\321\\203\\321\\201\\320\\272 SumatraPDF\\0\"\\\n  \"\\320\\230\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\273\\321\\217\\321\\202\\320\\276\\321\\200 SumatraPDF %s\\0\"\\\n  \"\\320\\224\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\273\\321\\217\\321\\202\\320\\276\\321\\200 SumatraPDF %s\\0\"\\\n  \"SumatraPDF \\321\\203\\320\\264\\320\\260\\320\\273\\320\\265\\320\\275\\320\\260.\\0\"\\\n  \"\\320\\243\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\272\\320\\260 SumatraPDF \\320\\275\\320\\265 \\320\\275\\320\\260\\320\\271\\320\\264\\320\\265\\320\\275\\320\\260.\\0\"\\\n  \"\\320\\221\\320\\273\\320\\260\\320\\263\\320\\276\\320\\264\\320\\260\\321\\200\\320\\270\\320\\274 \\320\\222\\320\\260\\321\\201 \\320\\267\\320\\260 \\320\\262\\321\\213\\320\\261\\320\\276\\321\\200 SumatraPDF!\\0\"\\\n  \"\\320\\221\\320\\273\\320\\260\\320\\263\\320\\276\\320\\264\\320\\260\\321\\200\\320\\270\\320\\274 \\320\\222\\320\\260\\321\\201! SumatraPDF \\321\\203\\321\\201\\320\\277\\320\\265\\321\\210\\320\\275\\320\\276 \\321\\203\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\273\\320\\265\\320\\275\\320\\260.\\0\"\\\n  \"\\320\\230\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\273\\321\\217\\321\\202\\320\\276\\321\\200 \\320\\270\\321\\201\\320\\277\\320\\276\\321\\200\\321\\207\\320\\265\\320\\275. \\320\\237\\320\\276\\320\\266\\320\\260\\320\\273\\321\\203\\320\\271\\321\\201\\321\\202\\320\\260, \\320\\267\\320\\260\\320\\263\\321\\200\\321\\203\\320\\267\\320\\270\\321\\202\\320\\265 \\320\\265\\320\\263\\320\\276 \\320\\277\\320\\276\\320\\262\\321\\202\\320\\276\\321\\200\\320\\275\\320\\276.\\n\\320\\230\\320\\267\\320\\262\\320\\270\\320\\275\\320\\270\\321\\202\\320\\265 \\320\\267\\320\\260 \\320\\275\\320\\265\\321\\203\\320\\264\\320\\276\\320\\261\\321\\201\\321\\202\\320\\262\\320\\260!\\0\"\\\n  \"\\320\\243\\320\\264\\320\\260\\320\\273\\320\\270\\321\\202\\321\\214 SumatraPDF\\0\"\\\n  \"\\320\\243\\320\\264\\320\\260\\320\\273\\320\\265\\320\\275\\320\\270\\320\\265 \\320\\275\\320\\265 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\214\\0\"\\\n  \"\\320\\237\\321\\200\\320\\276\\320\\270\\321\\201\\321\\205\\320\\276\\320\\264\\320\\270\\321\\202 \\321\\203\\320\\264\\320\\260\\320\\273\\320\\265\\320\\275\\320\\270\\320\\265...\\0\"\\\n  \"\\320\\230\\321\\201\\320\\277\\320\\276\\320\\273\\321\\214\\320\\267\\320\\276\\320\\262\\320\\260\\321\\202\\321\\214 SumatraPDF \\320\\264\\320\\273\\321\\217 \\320\\277\\321\\200\\320\\276\\321\\201\\320\\274\\320\\276\\321\\202\\321\\200\\320\\260 PDF\\0\";\n\nconst char * gTranslations_sr_rs = \n  \"\\320\\236\\320\\277\\321\\206\\320\\270\\321\\230\\320\\265\\0\"\\\n  \"\\320\\224\\320\\260 \\320\\273\\320\\270 \\320\\266\\320\\265\\320\\273\\320\\270\\321\\202\\320\\265 \\320\\264\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\321\\230\\321\\203 \\320\\241\\321\\203\\320\\274\\320\\260\\321\\202\\321\\200\\320\\260\\320\\237\\320\\224\\320\\244\\0\"\\\n  \"\\320\\227\\320\\260\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\320\\262\\321\\200\\320\\265\\320\\274\\320\\265\\320\\275\\320\\270 \\320\\264\\320\\270\\321\\200\\320\\265\\320\\272\\321\\202\\320\\276\\321\\200\\320\\270\\321\\230\\321\\203\\320\\274 \\321\\201\\320\\265 \\320\\275\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\265 \\320\\272\\321\\200\\320\\265\\320\\270\\321\\200\\320\\260\\321\\202\\320\\270\\0\"\\\n  \"\\320\\230\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\320\\276\\320\\275\\320\\270 \\320\\264\\320\\270\\321\\200\\320\\265\\320\\272\\321\\202\\320\\276\\321\\200\\320\\270\\321\\230\\321\\203\\320\\274 \\321\\201\\320\\265 \\320\\275\\320\\265 \\320\\274\\320\\276\\320\\266\\320\\265 \\320\\272\\321\\200\\320\\265\\320\\270\\321\\200\\320\\260\\321\\202\\320\\270\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\320\\263\\320\\273\\320\\265\\320\\264\\320\\260\\321\\207 \\320\\237\\320\\224\\320\\244 \\320\\275\\320\\265\\320\\274\\320\\276\\320\\263\\321\\203\\321\\233\\320\\265 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\321\\202\\320\\270\\0\"\\\n  \"\\320\\235\\320\\265\\320\\274\\320\\276\\320\\263\\321\\203\\321\\233\\320\\265 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\321\\202\\320\\270 \\321\\204\\320\\270\\320\\273\\321\\202\\320\\265\\321\\200 \\320\\267\\320\\260 \\320\\277\\321\\200\\320\\265\\321\\202\\321\\200\\320\\260\\320\\263\\321\\203\\0\"\\\n  \"\\320\\235\\320\\265\\320\\274\\320\\276\\320\\263\\321\\203\\321\\233 \\320\\277\\321\\200\\320\\270\\321\\201\\321\\202\\321\\203\\320\\277 \\320\\277\\321\\200\\320\\270\\320\\262\\321\\200\\320\\265\\320\\274\\320\\265\\320\\275\\320\\276\\320\\274 \\320\\264\\320\\270\\321\\200\\320\\265\\320\\272\\321\\202\\320\\276\\321\\200\\320\\270\\321\\230\\321\\203\\320\\274\\321\\203\\0\"\\\n  \"\\320\\235\\320\\265\\320\\274\\320\\276\\320\\263\\321\\203\\321\\233\\320\\265 \\321\\203\\320\\272\\320\\273\\320\\276\\320\\275\\320\\270\\321\\202\\320\\270 \\320\\277\\321\\200\\320\\270\\320\\262\\321\\200\\320\\265\\320\\274\\320\\265\\320\\275\\320\\270 \\320\\264\\320\\270\\321\\200\\320\\265\\320\\272\\321\\202\\320\\276\\321\\200\\320\\270\\321\\230\\321\\203\\320\\274\\0\"\\\n  \"\\320\\235\\320\\265\\320\\274\\320\\276\\320\\263\\321\\203\\321\\233\\320\\265 \\321\\203\\320\\272\\320\\273\\320\\276\\320\\275\\320\\270\\320\\270\\321\\202\\320\\270 \\321\\201\\320\\272\\321\\200\\320\\260\\321\\233\\320\\265\\320\\275\\320\\270\\321\\206\\321\\203\\0\"\\\n  \"\\320\\235\\320\\265\\320\\274\\320\\276\\320\\263\\321\\203\\321\\233\\320\\265 \\320\\264\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\321\\202\\320\\270 \\320\\237\\320\\224\\320\\244 \\320\\277\\321\\200\\320\\265\\320\\263\\320\\273\\320\\265\\320\\264\\320\\260\\321\\207\\0\"\\\n  \"\\320\\235\\320\\265\\320\\274\\320\\276\\320\\263\\321\\203\\321\\233\\320\\260 \\320\\264\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\321\\230\\320\\260 \\320\\237\\320\\224\\320\\244 \\321\\204\\320\\270\\320\\273\\321\\202\\320\\265\\321\\200 \\320\\277\\321\\200\\320\\265\\321\\202\\321\\200\\320\\260\\320\\263\\320\\265\\0\"\\\n  \"\\320\\235\\320\\265\\320\\274\\320\\276\\320\\263\\321\\203\\321\\233\\320\\265 \\321\\203\\320\\272\\320\\273\\320\\276\\320\\275\\320\\270\\321\\202\\320\\270 \\320\\277\\320\\273\\321\\203\\320\\263\\320\\270\\320\\275 \\320\\267\\320\\260 \\320\\277\\321\\200\\320\\265\\320\\263\\320\\273\\320\\265\\320\\264\\320\\260\\321\\207\\0\"\\\n  \"\\320\\235\\320\\265\\320\\274\\320\\276\\320\\263\\321\\203\\321\\233 \\321\\203\\320\\277\\320\\270\\321\\201 %s \\320\\275\\320\\260 \\320\\264\\320\\270\\321\\201\\320\\272\\0\"\\\n  \"\\320\\235\\320\\265\\321\\203\\321\\201\\320\\277\\320\\265\\320\\273\\320\\276 \\320\\272\\320\\276\\320\\277\\320\\270\\321\\200\\320\\260\\321\\232\\320\\265 \\320\\264\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\265\\321\\200\\320\\260 \\321\\203 \\320\\277\\321\\200\\320\\270\\320\\262\\321\\200\\320\\265\\320\\274\\320\\265\\320\\275\\320\\270 \\320\\264\\320\\270\\321\\200\\320\\265\\320\\272\\321\\202\\320\\276\\321\\200\\320\\270\\321\\230\\321\\203\\320\\274\\0\"\\\n  \"\\320\\235\\320\\265\\321\\203\\321\\201\\320\\277\\320\\265\\320\\273\\320\\276 \\320\\272\\321\\200\\320\\265\\320\\270\\321\\200\\320\\260\\321\\232\\320\\265 \\321\\201\\320\\272\\321\\200\\320\\260\\321\\233\\320\\265\\320\\275\\320\\270\\321\\206\\320\\265!\\0\"\\\n  \"\\320\\235\\320\\265\\321\\203\\321\\201\\320\\277\\320\\265\\320\\273\\320\\276 \\320\\261\\321\\200\\320\\270\\321\\201\\320\\260\\321\\232\\320\\265 \\320\\272\\321\\231\\321\\203\\321\\207\\320\\265\\320\\262\\320\\260 \\320\\270\\320\\267 \\321\\200\\320\\265\\320\\263\\320\\270\\321\\201\\321\\202\\321\\200\\320\\270 \\320\\261\\320\\260\\320\\267\\320\\265\\0\"\\\n  \"\\0\"\\\n  \"\\320\\235\\320\\265\\321\\203\\321\\201\\320\\277\\320\\265\\320\\276 \\321\\203\\320\\277\\320\\270\\321\\201 \\320\\277\\321\\200\\320\\276\\321\\210\\320\\270\\321\\200\\320\\265\\320\\275\\320\\265 \\320\\265\\320\\272\\321\\201\\321\\202\\320\\265\\320\\275\\320\\267\\320\\270\\321\\230\\320\\265 \\321\\204\\320\\260\\321\\230\\320\\273\\320\\260 \\321\\203 \\321\\200\\320\\265\\320\\263\\320\\270\\321\\201\\321\\202\\321\\200\\320\\270 \\320\\261\\320\\260\\320\\267\\321\\203\\0\"\\\n  \"\\320\\235\\320\\265\\321\\203\\321\\201\\320\\277\\320\\265\\320\\276 \\321\\203\\320\\277\\320\\270\\321\\201 \\320\\270\\320\\275\\321\\204\\320\\276\\321\\200\\320\\274\\320\\260\\321\\206\\320\\270\\321\\230\\320\\260 \\320\\276 \\320\\264\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\321\\230\\320\\270 \\321\\203 \\321\\200\\320\\265\\320\\263\\320\\270\\321\\201\\321\\202\\321\\200\\320\\270 \\320\\261\\320\\260\\320\\267\\321\\203\\0\"\\\n  \"\\320\\241\\320\\260\\320\\272\\321\\200\\320\\270\\321\\230 \\320\\276\\320\\277\\321\\206\\320\\270\\321\\230\\320\\265\\0\"\\\n  \"\\320\\230\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\321\\230\\320\\260 \\320\\241\\321\\203\\320\\274\\320\\260\\321\\202\\321\\200\\320\\260\\320\\237\\320\\224\\320\\244\\0\"\\\n  \"\\320\\230\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\321\\230\\320\\260 \\320\\241\\321\\203\\320\\274\\320\\260\\321\\202\\321\\200\\320\\260\\320\\237\\320\\224\\320\\244\\0\"\\\n  \"\\320\\230\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\321\\230\\320\\260 \\320\\275\\320\\265\\321\\203\\321\\201\\320\\277\\320\\265\\320\\273\\320\\260!\\0\"\\\n  \"\\320\\230\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\321\\230\\320\\260 \\321\\203 \\321\\202\\320\\276\\320\\272\\321\\203...\\0\"\\\n  \"\\320\\227\\320\\260\\320\\264\\321\\200\\320\\266\\320\\270 \\320\\237\\320\\224\\320\\244 \\320\\277\\320\\273\\321\\203\\320\\263\\320\\270\\320\\275 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\201\\320\\260\\320\\275 (\\320\\275\\320\\270\\321\\230\\320\\265 \\320\\277\\320\\276\\320\\264\\321\\200\\320\\266\\320\\260\\320\\275\\320\\276)\\0\"\\\n  \"\\320\\237\\321\\200\\320\\265\\321\\202\\321\\200\\320\\260\\320\\263\\320\\260 Windows Desktop &\\320\\277\\321\\200\\320\\265\\321\\202\\321\\200\\320\\260\\320\\263\\320\\260 \\320\\237\\320\\224\\320\\244 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\260\\0\"\\\n  \"Windows &\\320\\277\\321\\200\\320\\270\\320\\272\\320\\260\\320\\267 \\320\\237\\320\\224\\320\\244 \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\260\\0\"\\\n  \"\\320\\227\\320\\260\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270\\321\\202\\320\\265 %s \\320\\267\\320\\260 \\320\\275\\320\\260\\321\\201\\321\\202\\320\\260\\320\\262\\320\\260\\320\\272!\\0\"\\\n  \"\\320\\236\\320\\264\\320\\260\\320\\261\\321\\200\\320\\260\\321\\202\\320\\270 \\321\\204\\320\\276\\320\\273\\320\\264\\320\\265\\321\\200 \\320\\267\\320\\260 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\321\\230\\321\\203 \\320\\241\\321\\203\\320\\274\\320\\260\\321\\202\\321\\200\\320\\260\\320\\237\\320\\224\\320\\244\\0\"\\\n  \"\\320\\235\\320\\265\\320\\272\\320\\270 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\320\\276\\320\\275\\320\\270 \\321\\204\\320\\260\\321\\230\\320\\273\\320\\276\\320\\262\\320\\270 \\321\\201\\321\\203 \\320\\276\\321\\210\\321\\202\\320\\265\\321\\233\\320\\265\\320\\275\\320\\270 \\320\\270\\320\\273\\320\\270 \\320\\275\\320\\265\\320\\264\\320\\276\\321\\201\\321\\202\\320\\260\\321\\230\\321\\203\\0\"\\\n  \"\\320\\241\\321\\202\\320\\260\\321\\200\\320\\276\\320\\262\\320\\260\\321\\202\\320\\270 \\320\\241\\321\\203\\320\\274\\320\\260\\321\\202\\321\\200\\320\\260\\320\\237\\320\\224\\320\\244\\0\"\\\n  \"\\320\\241\\321\\203\\320\\274\\320\\260\\321\\202\\321\\200\\320\\260\\320\\237\\320\\224\\320\\244 %s \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\321\\230\\320\\260\\0\"\\\n  \"\\320\\241\\321\\203\\320\\274\\320\\260\\321\\202\\321\\200\\320\\260\\320\\237\\320\\224\\320\\244 %s \\320\\264\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\321\\230\\320\\260\\0\"\\\n  \"\\320\\241\\321\\203\\320\\274\\320\\260\\321\\202\\321\\200\\320\\260\\320\\237\\320\\224\\320\\244 \\320\\264\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\320\\275\\0\"\\\n  \"\\320\\241\\321\\203\\320\\274\\320\\260\\321\\202\\321\\200\\320\\260\\320\\237\\320\\224\\320\\244 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\321\\230\\320\\260 \\320\\275\\320\\270\\321\\230\\320\\265 \\320\\277\\321\\200\\320\\276\\320\\275\\320\\260\\321\\222\\320\\265\\320\\275\\320\\260\\0\"\\\n  \"\\320\\245\\320\\262\\320\\260\\320\\273\\320\\260 \\320\\275\\320\\260 \\320\\270\\320\\267\\320\\261\\320\\276\\321\\200\\321\\203 \\320\\241\\321\\203\\320\\274\\320\\260\\321\\202\\321\\200\\320\\260\\320\\237\\320\\224\\320\\244\\0\"\\\n  \"\\320\\241\\321\\203\\320\\274\\320\\260\\321\\202\\321\\200\\320\\260\\320\\237\\320\\224\\320\\244 \\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\320\\275. \\320\\245\\320\\262\\320\\260\\320\\273\\320\\260!\\0\"\\\n  \"\\320\\230\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\260\\321\\206\\320\\270\\321\\230\\320\\260 \\321\\230\\320\\265 \\320\\276\\321\\210\\321\\202\\320\\265\\321\\233\\320\\265\\320\\275\\320\\260. \\320\\241\\320\\272\\320\\270\\320\\275\\321\\203\\321\\202\\320\\270 \\321\\230\\320\\265 \\320\\277\\320\\276\\320\\275\\320\\276\\320\\262\\320\\276. \\n \\320\\230\\320\\267\\320\\262\\320\\270\\321\\232\\320\\260\\320\\262\\320\\260\\320\\274\\320\\276 \\321\\201\\320\\265.\\0\"\\\n  \"\\320\\224\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\321\\232\\320\\265 \\320\\241\\321\\203\\320\\274\\320\\260\\321\\202\\321\\200\\320\\260\\320\\237\\320\\224\\320\\244\\0\"\\\n  \"\\320\\224\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\321\\232\\320\\265 \\320\\275\\320\\265\\321\\203\\321\\201\\320\\277\\320\\265\\320\\273\\320\\276\\0\"\\\n  \"\\320\\224\\320\\265\\320\\270\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\320\\270\\321\\200\\320\\260\\321\\232\\320\\265 \\321\\203 \\321\\202\\320\\276\\320\\272\\321\\203 ...\\0\"\\\n  \"\\320\\241\\321\\203\\320\\274\\320\\260\\321\\202\\321\\200\\320\\260\\320\\237\\320\\224\\320\\244 \\321\\230\\320\\265 &\\320\\277\\320\\276\\320\\264\\321\\200\\320\\260\\320\\267\\321\\203\\320\\274\\320\\265\\320\\262\\320\\260\\320\\275\\320\\270 \\320\\277\\321\\200\\320\\265\\320\\263\\320\\273\\320\\265\\320\\264\\320\\260\\321\\207\\0\";\n\nconst char * gTranslations_sp_rs = \n  \"Opcije\\0\"\\\n  \"Da li sigurno \\305\\276elite da uklonite SumatraPDF?\\0\"\\\n  \"Zatvori\\0\"\\\n  \"Gre\\305\\241ka prilikom kreiranja privremenog direktorijuma\\0\"\\\n  \"Nemogu\\304\\207e kreirati instalacioni direktorijum\\0\"\\\n  \"Nemogu\\304\\207e instalirati PDF pregleda\\304\\215\\0\"\\\n  \"Nemogu\\304\\207e instalirati PDF filter pretrage\\0\"\\\n  \"Nemogu\\304\\207 pristup privremenom direktorijumu\\0\"\\\n  \"Nemogu\\304\\207e ukloniti instalacioni direktorijum\\0\"\\\n  \"Nemogu\\304\\207e ukloniti skra\\304\\207enicu\\0\"\\\n  \"Nemogu\\304\\207e deinstalirati PDF pregleda\\304\\215\\0\"\\\n  \"Nemogu\\304\\207e deinstalirati PDF filter pretrage\\0\"\\\n  \"Nemogu\\304\\207e deinstalirati plugin Internet pregleda\\304\\215a\\0\"\\\n  \"Nemogu\\304\\207 upis %s na disk\\0\"\\\n  \"Neuspelo kopiranje deinstalera u privremeni direktorijum\\0\"\\\n  \"Neuspelo kreiranje skra\\304\\207enice\\0\"\\\n  \"Neuspelo brisanje registri klju\\304\\215eva deinstalera\\0\"\\\n  \"\\0\"\\\n  \"Neuspeli upis pro\\305\\241irene ekstenzije fajla u registri\\0\"\\\n  \"Neuspeli upis instalacionih informacija u registri\\0\"\\\n  \"Sakrij opcije\\0\"\\\n  \"Instaliraj SumatraPDF\\0\"\\\n  \"Instalacija SumatraPDF u folder\\0\"\\\n  \"Instalacija neuspe\\305\\241na!\\0\"\\\n  \"Instalacija u toku...\\0\"\\\n  \"Zadr\\305\\276i PDF plugin pretra\\305\\276iva\\304\\215a instalisan (nije podr\\305\\276ano)\\0\"\\\n  \"Pretraga Windows Desktop pretraga PDF dokumenta\\0\"\\\n  \"Windows &prikaz PDF dokumenta\\0\"\\\n  \"Zatvorite %s za nastavak!\\0\"\\\n  \"Odaberite folder gde \\305\\276elite da instalirate SumatraPDF:\\0\"\\\n  \"Neki instalacioni fajlovi nedostaju ili su o\\305\\241te\\304\\207eni\\0\"\\\n  \"Startovati sumatraPDF\\0\"\\\n  \"SumatraPDF %s instalacija\\0\"\\\n  \"SumatraPDF %s deinstalacija\\0\"\\\n  \"SumatraPDF deinstaliran\\0\"\\\n  \"SumatraPDF instalacija nije prona\\304\\221ena\\0\"\\\n  \"Hvala Vam \\305\\241to ste izabrali SumatraPDF!\\0\"\\\n  \"Hvala Vam! SumatraPDF je uspe\\305\\241no instaliran.\\0\"\\\n  \"Instalacija je o\\305\\241te\\304\\207ena. Molimo preuzmite je ponovo. \\n \\305\\275ao nam je zbog neugodnosti!\\0\"\\\n  \"Ukloni SumatraPDF\\0\"\\\n  \"Deinstaliranje neuspelo\\0\"\\\n  \"Deinstaliranje u toku ...\\0\"\\\n  \"Koristi SumatraPDF kao glavni PDF \\304\\215ita\\304\\215\\0\";\n\nconst char * gTranslations_sk = \n  \"&Mo\\305\\276nosti\\0\"\\\n  \"Naozaj chcete odin\\305\\241talovat SumatraPDF?\\0\"\\\n  \"Zatvori\\305\\245\\0\"\\\n  \"Nie je mo\\305\\276n\\303\\251 vytvori\\305\\245 do\\304\\215asn\\303\\275 adres\\303\\241r\\0\"\\\n  \"Nie je mo\\305\\276n\\303\\251 vytvori\\305\\245 in\\305\\241tala\\304\\215n\\303\\275 adres\\303\\241r\\0\"\\\n  \"Nie je mo\\305\\276n\\303\\251 nain\\305\\241talova\\305\\245 PDF prehliada\\304\\215 r\\303\\275chlych n\\303\\241h\\304\\276adov\\0\"\\\n  \"Nie je mo\\305\\276n\\303\\251 nain\\305\\241talova\\305\\245 PDF vyh\\304\\276ad\\303\\241vac\\303\\255 filter\\0\"\\\n  \"Po\\305\\276iadavka na do\\304\\215asn\\303\\275 adres\\303\\241r bola ne\\303\\272spe\\305\\241n\\303\\241\\0\"\\\n  \"Nie je mo\\305\\276n\\303\\251 odstr\\303\\241ni\\305\\245 in\\305\\241tala\\304\\215n\\303\\275 adres\\303\\241r\\0\"\\\n  \"Nie je mo\\305\\276n\\303\\251 odstr\\303\\241ni\\305\\245 odkaz\\0\"\\\n  \"Nie je mo\\305\\276n\\303\\251 odin\\305\\241talova\\305\\245 PDF prehliada\\304\\215 r\\303\\275chlych n\\303\\241h\\304\\276adov\\0\"\\\n  \"Nie je mo\\305\\276n\\303\\251 odin\\305\\241talova\\305\\245 PDF vyh\\304\\276ad\\303\\241vac\\303\\255 filter\\0\"\\\n  \"Nie je mo\\305\\276n\\303\\251 odin\\305\\241talova\\305\\245 plugin prehliada\\304\\215a\\0\"\\\n  \"Nie je mo\\305\\276n\\303\\251 zap\\303\\255sa\\305\\245 %s na disk\\0\"\\\n  \"Kop\\303\\255rovanie odin\\305\\241tal\\303\\241tora do do\\304\\215asn\\303\\251ho adres\\303\\241ra bolo ne\\303\\272spe\\305\\241n\\303\\251\\0\"\\\n  \"Vytvorenie odkazu bolo ne\\303\\272spe\\305\\241n\\303\\251\\0\"\\\n  \"Vymazanie odin\\305\\241tala\\304\\215n\\303\\275ch k\\304\\276\\303\\272\\304\\215ov v registroch bolo ne\\303\\272spe\\305\\241n\\303\\251\\0\"\\\n  \"\\0\"\\\n  \"Z\\303\\241pis roz\\305\\241\\303\\255ren\\303\\275ch inform\\303\\241ci\\303\\255 o pr\\303\\255pone s\\303\\272boru do registrov bolo ne\\303\\272spe\\305\\241n\\303\\251\\0\"\\\n  \"Ulo\\305\\276enie inform\\303\\241ci\\303\\255 pre odin\\305\\241talovanie do registrov bolo ne\\303\\272spe\\305\\241n\\303\\251\\0\"\\\n  \"Skry\\305\\245 &Mo\\305\\276nosti\\0\"\\\n  \"In\\305\\241taluj SumatraPDF\\0\"\\\n  \"In\\305\\241taluj SumatraPDF do &adres\\303\\241ra:\\0\"\\\n  \"In\\305\\241tal\\303\\241cia sa nepodarila!\\0\"\\\n  \"Prebieha in\\305\\241tal\\303\\241cia...\\0\"\\\n  \"Ponecha\\305\\245 PDF plugin prehliada\\304\\215a nain\\305\\241talovan\\303\\275 (u\\305\\276 nie je podporovan\\303\\275)\\0\"\\\n  \"Povoli\\305\\245, aby Windows Desktop Search &vyh\\304\\276ad\\303\\241val PDF dokumenty\\0\"\\\n  \"Povoli\\305\\245, aby Windows zobrazoval &n\\303\\241h\\304\\276ad PDF dokumentov\\0\"\\\n  \"Pros\\303\\255m zatvorte %s pre pokra\\304\\215ovanie!\\0\"\\\n  \"Vyberte adres\\303\\241r, kde sa m\\303\\241 SumatraPDF nain\\305\\241talova\\305\\245:\\0\"\\\n  \"Niektor\\303\\251 in\\305\\241tala\\304\\215n\\303\\251 s\\303\\272bory s\\303\\272 po\\305\\241koden\\303\\251 alebo ch\\303\\275baj\\303\\272\\0\"\\\n  \"Spusti\\305\\245 SumatraPDF\\0\"\\\n  \"SumatraPDF %s in\\305\\241tal\\303\\241tor\\0\"\\\n  \"SumatraPDF %s odin\\305\\241tal\\303\\241tor\\0\"\\\n  \"Program SumatraPDF bol odin\\305\\241talovan\\303\\275.\\0\"\\\n  \"In\\305\\241tal\\303\\241cia programu SumatraPDF nebola n\\303\\241jden\\303\\241.\\0\"\\\n  \"Dakujeme, \\305\\276e ste sa rozhodli pre SumatraPDF!\\0\"\\\n  \"\\304\\216akujeme! SumatraPDF bol nain\\305\\241talovan\\303\\275.\\0\"\\\n  \"In\\305\\241tala\\304\\215n\\303\\275 s\\303\\272bor je po\\305\\241koden\\303\\275. Pros\\303\\255m stiahnite si ho e\\305\\241te raz. \\nOspravedl\\305\\210ujeme sa za \\305\\245a\\305\\276kosti!\\0\"\\\n  \"Odin\\305\\241talovanie SumatraPDF\\0\"\\\n  \"Odin\\305\\241talovanie sa nepodarilo\\0\"\\\n  \"Prebieha odin\\305\\241talovanie...\\0\"\\\n  \"Pou\\305\\276i SumatraPDF ako &predvolen\\303\\275 PDF prehliada\\304\\215\\0\";\n\nconst char * gTranslations_sl = \n  \"M&o\\305\\276nosti\\0\"\\\n  \"Ali ste prepri\\304\\215ani, da \\305\\276elite odstraniti SumatraPDF?\\0\"\\\n  \"Zapri\\0\"\\\n  \"Ni bilo mogo\\304\\215e ustvariti za\\304\\215asne mape\\0\"\\\n  \"Ni bilo mogo\\304\\215e ustvariti mape za namestitev\\0\"\\\n  \"Ni bilo mogo\\304\\215e namestiti predogleda za PDF\\0\"\\\n  \"Ni bilo mogo\\304\\215e namestiti filtra za PDF iskanje\\0\"\\\n  \"Ni bilo mogo\\304\\215e pridobiti za\\304\\215asne mape\\0\"\\\n  \"Ni bilo mogo\\304\\215e odstraniti namestitvene mape\\0\"\\\n  \"Ni bilo mogo\\304\\215e odstraniti bli\\305\\276njice\\0\"\\\n  \"Ni bilo mogo\\304\\215e odstraniti predogleda za PDF\\0\"\\\n  \"Ni bilo mogo\\304\\215e odstraniti filtra za PDF iskanje\\0\"\\\n  \"Ni bilo mogo\\304\\215e odstraniti vti\\304\\215nika za brskalnik\\0\"\\\n  \"Ni bilo mogo\\304\\215e napisati %s na disk\\0\"\\\n  \"Kopiranje odstranjevalnega programa v za\\304\\215asno mapo ni uspelo\\0\"\\\n  \"Ustvarjanje bli\\305\\276njice ni uspelo\\0\"\\\n  \"Brisanje registrskih klju\\304\\215ev odstranjevalnega programa ni uspelo\\0\"\\\n  \"\\0\"\\\n  \"Pisanje v register informacij o raz\\305\\241irjenem podalj\\305\\241ku datoteke ni uspelo\\0\"\\\n  \"Pisanje v register informacij o odstranitvi ni uspelo\\0\"\\\n  \"Skrij M&o\\305\\276nosti\\0\"\\\n  \"Namesti SumatraPDF\\0\"\\\n  \"Namesti SumatraPDF v mapo:\\0\"\\\n  \"Namestitev ni uspela!\\0\"\\\n  \"Namestitev poteka \\342\\200\\246\\0\"\\\n  \"Obdr\\305\\276ati PDF vti\\304\\215nik &brskalnika name\\305\\241\\304\\215en (ni ve\\304\\215 podprt)\\0\"\\\n  \"Naj Windows Desktop Search i\\305\\241\\304\\215e PDF dokumente\\0\"\\\n  \"Naj Windows prikazuje predogled PDF dokumentov\\0\"\\\n  \"Prosimo, izberite %s za nadaljevati!\\0\"\\\n  \"Izberite mapo, kjer naj se namesti SumatraPDF:\\0\"\\\n  \"Nekatere datoteke za namestitev so po\\305\\241kodovane ali manjkajo\\0\"\\\n  \"Za\\305\\276eni SumatraPDF\\0\"\\\n  \"SumatraPDF %s namestitev\\0\"\\\n  \"SumatraPDF %s odstranitev\\0\"\\\n  \"SumatraPDF je bil odstranjen.\\0\"\\\n  \"SumatraPDF namestitve ni mogo\\304\\215e najti.\\0\"\\\n  \"Hvala, ker ste izbrali SumatraPDF!\\0\"\\\n  \"Hvala! SumatraPDF je bil name\\305\\241\\304\\215en.\\0\"\\\n  \"Namestitveni program je po\\305\\241kodovan. Prosimo, da ga ponovno prenesete.\\nOpravi\\304\\215ujemo se za nev\\305\\241e\\304\\215nost!\\0\"\\\n  \"Odstrani SumatraPDF\\0\"\\\n  \"Odstranitev ni uspela\\0\"\\\n  \"Odstranjevanje poteka \\342\\200\\246\\0\"\\\n  \"Uporabi SumatraPDF kot privzeti P&DF prikazovalnik\\0\";\n\nconst char * gTranslations_es = \n  \"&Opciones\\0\"\\\n  \"\\302\\277Est\\303\\241 seguro de querer desinstalar SumatraPDF?\\0\"\\\n  \"Cerrar\\0\"\\\n  \"No se pudo crear la carpeta temporal\\0\"\\\n  \"No se pudo crear la carpeta de instalaci\\303\\263n\\0\"\\\n  \"No se pudo instalar el previsualizador de PDF\\0\"\\\n  \"No se pudo instalar el filtro de b\\303\\272squeda PDF\\0\"\\\n  \"No se pudo obtener la carpeta temporal\\0\"\\\n  \"No se pudo eliminar la carpeta de instalaci\\303\\263n\\0\"\\\n  \"No se pudo eliminar el acceso directo\\0\"\\\n  \"No se pudo desinstalar el previsualizador de PDF\\0\"\\\n  \"No se pudo desinstalar el filtro de b\\303\\272squeda PDF\\0\"\\\n  \"No se pudo desinstalar el complemento del navegador\\0\"\\\n  \"No se puede escribir %s en el disco\\0\"\\\n  \"Error al copiar el desinstalador al directorio temporal\\0\"\\\n  \"No se pudo crear un acceso directo\\0\"\\\n  \"Error al eliminar las claves del registro del desinstalador\\0\"\\\n  \"\\0\"\\\n  \"Fallo al escribir informaci\\303\\263n de la extensi\\303\\263n de archivo en el registro\\0\"\\\n  \"Error al escribir informaci\\303\\263n de desinstalaci\\303\\263n en el registro\\0\"\\\n  \"Menos &opciones\\0\"\\\n  \"Instalar SumatraPDF\\0\"\\\n  \"&Instalar SumatraPDF en la siguiente carpeta:\\0\"\\\n  \"\\302\\241La instalaci\\303\\263n ha fallado!\\0\"\\\n  \"Instalaci\\303\\263n en progreso...\\0\"\\\n  \"Mantener instalado el complemento de &navegador (ahora obsoleto)\\0\"\\\n  \"Permitir que la b\\303\\272squeda de Windows encuentre documentos PDF\\0\"\\\n  \"Mostrar miniaturas en los iconos de documentos &PDF\\0\"\\\n  \"Necesita cerrar %s para continuar.\\0\"\\\n  \"Seleccione la carpeta de instalaci\\303\\263n de SumatraPDF:\\0\"\\\n  \"Algunos de los archivos que van a ser instalados estan da\\303\\261ados o no se encuentran\\0\"\\\n  \"Iniciar SumatraPDF\\0\"\\\n  \"Instalador de SumatraPDF %s\\0\"\\\n  \"Desinstalador de SumatraPDF %s\\0\"\\\n  \"Se ha desinstalado SumatraPDF.\\0\"\\\n  \"Instalaci\\303\\263n de SumatraPDF no encontrada.\\0\"\\\n  \"\\302\\241Gracias por elegir a SumatraPDF!\\0\"\\\n  \"\\302\\241Gracias! SumatraPDF ha sido instalado.\\0\"\\\n  \"El instalador est\\303\\241 da\\303\\261ado, pruebe descarg\\303\\241ndolo de nuevo.\\n\\302\\241Perd\\303\\263n por las molestias!\\0\"\\\n  \"Desinstalar SumatraPDF\\0\"\\\n  \"Fall\\303\\263 la desinstalaci\\303\\263n\\0\"\\\n  \"Desinstalaci\\303\\263n en progreso...\\0\"\\\n  \"Usar SumatraPDF como lector PDF pre&determinado\\0\";\n\nconst char * gTranslations_sv = \n  \"Alternativ\\0\"\\\n  \"\\303\\204r du s\\303\\244ker p\\303\\245 att du vill avinstallera SumatraPDF?\\0\"\\\n  \"St\\303\\244ng\\0\"\\\n  \"Kunde inte skapa en tillf\\303\\244llig katalog\\0\"\\\n  \"Kunde inte skapa installationsmappen\\0\"\\\n  \"Kunde inte installera f\\303\\266rhandstitt av PDF:er\\0\"\\\n  \"Kunde inte installera s\\303\\266kfilter f\\303\\266r PDF\\0\"\\\n  \"Kunde inte h\\303\\244mta temp-katalog\\0\"\\\n  \"Kunde inte ta bort installationsmappen\\0\"\\\n  \"Kunde inte ta bort genv\\303\\244gen\\0\"\\\n  \"Kunde inte avinstallera f\\303\\266rhandstitt p\\303\\245 PDF:er\\0\"\\\n  \"Kunde inte avinstallera s\\303\\266kfiltret f\\303\\266r PDF:er\\0\"\\\n  \"Kunde inte avinstallera webbl\\303\\244sarens insticksprogram\\0\"\\\n  \"Kunde inte spara %s p\\303\\245 h\\303\\245rddisken\\0\"\\\n  \"Misslyckades med att kopiera avinstalleraren till temp-katalogen\\0\"\\\n  \"Misslyckades med att skapa genv\\303\\244g\\0\"\\\n  \"Misslyckades med att ta bort registernycklar\\0\"\\\n  \"\\0\"\\\n  \"Misslyckades med att spara registernycklar f\\303\\266r den ut\\303\\266kade filhanteringen\\0\"\\\n  \"Missluckades spara data f\\303\\266r avinstallation i registret\\0\"\\\n  \"G\\303\\266m Alternativ\\0\"\\\n  \"Installera SumatraPDF\\0\"\\\n  \"Installera SumatraPDF i katalog:\\0\"\\\n  \"Installationen misslyckades!\\0\"\\\n  \"Installerar...\\0\"\\\n  \"Beh\\303\\245ll webbl\\303\\244sarens insticksprogram f\\303\\266r PDF (st\\303\\266ds inte l\\303\\244ngre)\\0\"\\\n  \"L\\303\\245t Windows inbyggda s\\303\\266kfunktion indexera PDF-dokument\\0\"\\\n  \"Visa f\\303\\266rhandstitt av PDF-dokument i Windows\\0\"\\\n  \"V\\303\\244nligen st\\303\\244ng %s innan du forts\\303\\244tter!\\0\"\\\n  \"V\\303\\244lj en katalog d\\303\\244r SumatraPDF ska installeras:\\0\"\\\n  \"N\\303\\245gra installationsfiler saknas eller \\303\\244r skadade\\0\"\\\n  \"Starta SumatraPDF\\0\"\\\n  \"Installationsprogram f\\303\\266r SumatraPDF %s\\0\"\\\n  \"Avinstallationsprogram f\\303\\266r SumatraPDF %s\\0\"\\\n  \"SumatraPDF \\303\\244r nu borttaget.\\0\"\\\n  \"Kunde inte hitta SumatraPDF-installation.\\0\"\\\n  \"Tack f\\303\\266r att du v\\303\\244ljer SumatraPDF!\\0\"\\\n  \"Tack! SumatraPDF \\303\\244r nu installerat.\\0\"\\\n  \"Installationsprogrammet \\303\\244r skadat. V\\303\\244nligen ladda ner det igen.\\nVi ber om urs\\303\\244kt f\\303\\266r problemen.\\0\"\\\n  \"Avinstallera SumatraPDF\\0\"\\\n  \"Avinstallationen misslyckades\\0\"\\\n  \"Avinstallerar...\\0\"\\\n  \"Anv\\303\\244nd SumatraPDF som standardl\\303\\244sare f\\303\\266r PDF-filer\\0\";\n\nconst char * gTranslations_ta = \n  \"&\\340\\256\\265\\340\\256\\277\\340\\256\\260\\340\\257\\201\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"\\340\\256\\232\\340\\257\\201\\340\\256\\256\\340\\256\\244\\340\\257\\215\\340\\256\\260\\340\\256\\276 PDF \\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265\\340\\256\\262\\340\\257\\210 \\340\\256\\250\\340\\257\\200\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\265\\340\\256\\276?\\0\"\\\n  \"\\340\\256\\256\\340\\257\\202\\340\\256\\237\\340\\257\\201\\0\"\\\n  \"\\340\\256\\244\\340\\256\\261\\340\\257\\215\\340\\256\\225\\340\\256\\276\\340\\256\\262\\340\\256\\277\\340\\256\\225 \\340\\256\\225\\340\\257\\207\\340\\256\\276\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\261\\340\\257\\210\\340\\256\\257\\340\\256\\277\\340\\256\\251\\340\\257\\210 \\340\\256\\211\\340\\256\\260\\340\\257\\201\\340\\256\\265\\340\\256\\276\\340\\256\\225\\340\\257\\215\\340\\256\\225 \\340\\256\\207\\340\\256\\257\\340\\256\\262\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265\\340\\256\\262\\340\\257\\215 \\340\\256\\225\\340\\257\\207\\340\\256\\276\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\261\\340\\257\\210\\340\\256\\257\\340\\256\\277\\340\\256\\251\\340\\257\\210 \\340\\256\\211\\340\\256\\260\\340\\257\\201\\340\\256\\265\\340\\256\\276\\340\\256\\225\\340\\257\\215\\340\\256\\225 \\340\\256\\207\\340\\256\\257\\340\\256\\262\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"PDF \\340\\256\\256\\340\\257\\201\\340\\256\\251\\340\\257\\215\\340\\256\\251\\340\\257\\213\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\256\\256\\340\\257\\215 \\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265 \\340\\256\\207\\340\\256\\257\\340\\256\\262\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"PDF \\340\\256\\244\\340\\257\\207\\340\\256\\237\\340\\256\\262\\340\\257\\210 \\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265 \\340\\256\\207\\340\\256\\257\\340\\256\\262\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\340\\256\\244\\340\\256\\261\\340\\257\\215\\340\\256\\225\\340\\256\\276\\340\\256\\262\\340\\256\\277\\340\\256\\225 \\340\\256\\225\\340\\257\\207\\340\\256\\276\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\261\\340\\257\\210\\340\\256\\257\\340\\257\\210 \\340\\256\\205\\340\\256\\237\\340\\257\\210\\340\\256\\257 \\340\\256\\256\\340\\257\\201\\340\\256\\237\\340\\256\\277\\340\\256\\257\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265\\340\\256\\277\\340\\256\\257 \\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\261\\340\\257\\210\\340\\256\\257\\340\\257\\210 \\340\\256\\250\\340\\257\\200\\340\\256\\225\\340\\257\\215\\340\\256\\225 \\340\\256\\256\\340\\257\\201\\340\\256\\237\\340\\256\\277\\340\\256\\257\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\340\\256\\232\\340\\257\\201\\340\\256\\260\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201 \\340\\256\\265\\340\\256\\264\\340\\256\\277\\340\\256\\257\\340\\257\\210 \\340\\256\\250\\340\\257\\200\\340\\256\\225\\340\\257\\215\\340\\256\\225 \\340\\256\\256\\340\\257\\201\\340\\256\\237\\340\\256\\277\\340\\256\\257\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"PDF \\340\\256\\256\\340\\257\\201\\340\\256\\251\\340\\257\\215\\340\\256\\251\\340\\257\\213\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\257\\210 \\340\\256\\250\\340\\257\\200\\340\\256\\225\\340\\257\\215\\340\\256\\225 \\340\\256\\256\\340\\257\\201\\340\\256\\237\\340\\256\\277\\340\\256\\257\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"PDF \\340\\256\\244\\340\\257\\207\\340\\256\\237\\340\\256\\262\\340\\257\\210 \\340\\256\\250\\340\\257\\200\\340\\256\\225\\340\\257\\215\\340\\256\\225 \\340\\256\\256\\340\\257\\201\\340\\256\\237\\340\\256\\277\\340\\256\\257\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\340\\256\\211\\340\\256\\262\\340\\256\\276\\340\\256\\265\\340\\256\\277 \\340\\256\\211\\340\\256\\263\\340\\257\\215\\340\\256\\207\\340\\256\\237\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\210\\340\\256\\263\\340\\257\\210 \\340\\256\\250\\340\\257\\200\\340\\256\\225\\340\\257\\215\\340\\256\\225 \\340\\256\\256\\340\\257\\201\\340\\256\\237\\340\\256\\277\\340\\256\\257\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"%s \\340\\256\\220 \\340\\256\\216\\340\\256\\264\\340\\257\\201\\340\\256\\244  \\340\\256\\207\\340\\256\\257\\340\\256\\262\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265\\340\\256\\277 \\340\\256\\250\\340\\257\\200\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\262\\340\\257\\210 \\340\\256\\244\\340\\256\\261\\340\\257\\215\\340\\256\\225\\340\\256\\276\\340\\256\\262\\340\\256\\277\\340\\256\\225 \\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\261\\340\\257\\210\\340\\256\\257\\340\\256\\277\\340\\256\\262\\340\\257\\215 \\340\\256\\207\\340\\256\\260\\340\\257\\201\\340\\256\\250\\340\\257\\215\\340\\256\\244\\340\\257\\201 \\340\\256\\250\\340\\256\\225\\340\\256\\262\\340\\257\\206\\340\\256\\237\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\256\\262\\340\\257\\215 \\340\\256\\244\\340\\257\\213\\340\\256\\262\\340\\257\\215\\340\\256\\265\\340\\256\\277\\0\"\\\n  \"\\340\\256\\232\\340\\257\\201\\340\\256\\260\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201 \\340\\256\\265\\340\\256\\264\\340\\256\\277 \\340\\256\\205\\340\\256\\256\\340\\257\\210\\340\\256\\244\\340\\256\\262\\340\\257\\215 \\340\\256\\244\\340\\257\\213\\340\\256\\262\\340\\257\\215\\340\\256\\265\\340\\256\\277\\0\"\\\n  \"\\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265\\340\\256\\277 \\340\\256\\250\\340\\257\\200\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\277\\340\\256\\257\\340\\256\\277\\340\\256\\251\\340\\257\\215 \\340\\256\\252\\340\\256\\244\\340\\256\\277\\340\\256\\265\\340\\257\\210 \\340\\256\\205\\340\\256\\264\\340\\256\\277\\340\\256\\225\\340\\257\\215\\340\\256\\225 \\340\\256\\256\\340\\257\\201\\340\\256\\237\\340\\256\\277\\340\\256\\257\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\0\"\\\n  \"\\340\\256\\252\\340\\256\\244\\340\\256\\277\\340\\256\\265\\340\\257\\201 \\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\257\\215\\340\\256\\257 \\340\\256\\265\\340\\256\\277\\340\\256\\260\\340\\256\\277\\340\\256\\265\\340\\256\\276\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\215\\340\\256\\237 \\340\\256\\225\\340\\257\\207\\340\\256\\276\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201 \\340\\256\\250\\340\\257\\200\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\256\\277\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201 \\340\\256\\244\\340\\256\\225\\340\\256\\265\\340\\256\\262\\340\\257\\210 \\340\\256\\216\\340\\256\\264\\340\\257\\201\\340\\256\\244 \\340\\256\\256\\340\\257\\201\\340\\256\\237\\340\\256\\277\\340\\256\\257\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265\\340\\256\\277 \\340\\256\\250\\340\\257\\200\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201\\340\\256\\256\\340\\257\\215 \\340\\256\\244\\340\\256\\225\\340\\256\\265\\340\\256\\262\\340\\257\\210 \\340\\256\\252\\340\\256\\244\\340\\256\\277\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215 \\340\\256\\216\\340\\256\\264\\340\\257\\201\\340\\256\\244 \\340\\256\\256\\340\\257\\201\\340\\256\\237\\340\\256\\277\\340\\256\\257\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\340\\256\\256\\340\\256\\261\\340\\257\\210 & \\340\\256\\265\\340\\256\\277\\340\\256\\260\\340\\257\\201\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"\\340\\256\\232\\340\\257\\201\\340\\256\\256\\340\\256\\244\\340\\257\\215\\340\\256\\260\\340\\256\\276PDF\\340\\256\\220 \\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265\\340\\257\\201\\0\"\\\n  \"\\340\\256\\232\\340\\257\\201\\340\\256\\256\\340\\256\\244\\340\\257\\215\\340\\256\\260\\340\\256\\276PDF\\340\\256\\220 &\\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\261\\340\\257\\210\\340\\256\\257\\340\\256\\277\\340\\256\\262\\340\\257\\215 \\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265\\340\\256\\265\\340\\257\\201\\340\\256\\256\\340\\257\\215:\\0\"\\\n  \"\\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265\\340\\256\\262\\340\\257\\215 \\340\\256\\244\\340\\257\\213\\340\\256\\262\\340\\257\\215\\340\\256\\265\\340\\256\\277!\\0\"\\\n  \"\\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265\\340\\256\\262\\340\\257\\215 \\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\256\\262\\340\\256\\277\\340\\256\\262\\340\\257\\215 \\340\\256\\211\\340\\256\\263\\340\\257\\215\\340\\256\\263\\340\\256\\244\\340\\257\\201...\\0\"\\\n  \"\\0\"\\\n  \"\\340\\256\\265\\340\\256\\277\\340\\256\\243\\340\\257\\215\\340\\256\\237\\340\\257\\213\\340\\256\\270\\340\\257\\215 \\340\\256\\237\\340\\257\\206\\340\\256\\270\\340\\257\\215\\340\\256\\225\\340\\257\\215\\340\\256\\237\\340\\256\\276\\340\\256\\252\\340\\257\\215 \\340\\256\\244\\340\\257\\207\\340\\256\\237\\340\\256\\262\\340\\257\\215 &PDF \\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\225\\340\\256\\263\\340\\257\\210 \\340\\256\\244\\340\\257\\207\\340\\256\\237\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"\\340\\256\\265\\340\\256\\277\\340\\256\\243\\340\\257\\215\\340\\256\\237\\340\\256\\276\\340\\256\\270\\340\\257\\215 PDF \\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\225\\340\\256\\263\\340\\257\\210 \\340\\256\\225\\340\\256\\276\\340\\256\\243\\340\\257\\215\\340\\256\\252\\340\\256\\277\\340\\256\\225\\340\\257\\215\\340\\256\\225 &\\340\\256\\256\\340\\257\\201\\340\\256\\251\\340\\257\\215\\340\\256\\251\\340\\257\\207\\340\\256\\276\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\256\\256\\340\\257\\215 \\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\257\\215\\340\\256\\257\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"\\340\\256\\244\\340\\256\\257\\340\\256\\265\\340\\257\\201 \\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\257\\215\\340\\256\\244\\340\\257\\201 %s \\340\\256\\256\\340\\257\\202\\340\\256\\237\\340\\256\\277\\340\\256\\265\\340\\256\\277\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201 \\340\\256\\244\\340\\257\\212\\340\\256\\237\\340\\256\\260\\340\\256\\265\\340\\257\\201\\340\\256\\256\\340\\257\\215!\\0\"\\\n  \"\\340\\256\\232\\340\\257\\201\\340\\256\\256\\340\\256\\244\\340\\257\\215\\340\\256\\260\\340\\256\\276PDF \\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265\\340\\256\\262\\340\\257\\215 \\340\\256\\225\\340\\257\\207\\340\\256\\276\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\261\\340\\257\\210 \\340\\256\\244\\340\\257\\207\\340\\256\\260\\340\\257\\215\\340\\256\\265\\340\\257\\201 \\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\257\\215\\340\\256\\225:\\0\"\\\n  \"\\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\215\\340\\256\\237 \\340\\256\\232\\340\\256\\277\\340\\256\\262 \\340\\256\\225\\340\\257\\213\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\257\\201\\340\\256\\225\\340\\256\\263\\340\\257\\215 \\340\\256\\232\\340\\257\\207\\340\\256\\244\\340\\256\\256\\340\\256\\237\\340\\257\\210\\340\\256\\250\\340\\257\\215\\340\\256\\244\\340\\257\\201\\340\\256\\263\\340\\257\\215\\340\\256\\263\\340\\256\\251/\\340\\256\\225\\340\\256\\276\\340\\256\\243\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210\\0\"\\\n  \"\\340\\256\\232\\340\\257\\201\\340\\256\\256\\340\\256\\244\\340\\257\\215\\340\\256\\260\\340\\256\\276PDF \\340\\256\\244\\340\\257\\212\\340\\256\\237\\340\\256\\260\\340\\256\\265\\340\\257\\201\\340\\256\\256\\340\\257\\215\\0\"\\\n  \"\\340\\256\\232\\340\\257\\201\\340\\256\\256\\340\\256\\244\\340\\257\\215\\340\\256\\260\\340\\256\\276PDF %s \\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265\\340\\256\\277\\0\"\\\n  \"\\340\\256\\232\\340\\257\\201\\340\\256\\256\\340\\256\\244\\340\\257\\215\\340\\256\\260\\340\\256\\276PDF %s \\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265\\340\\256\\262\\340\\257\\215\\340\\256\\250\\340\\257\\200\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\277\\0\"\\\n  \"\\340\\256\\232\\340\\257\\201\\340\\256\\256\\340\\256\\244\\340\\257\\215\\340\\256\\260\\340\\256\\276PDF \\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265\\340\\256\\262\\340\\257\\215 \\340\\256\\250\\340\\257\\200\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\256\\244\\340\\257\\201.\\0\"\\\n  \"\\340\\256\\232\\340\\257\\201\\340\\256\\256\\340\\256\\244\\340\\257\\215\\340\\256\\260\\340\\256\\276PDF \\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265\\340\\256\\262\\340\\257\\215 \\340\\256\\225\\340\\256\\277\\340\\256\\237\\340\\257\\210\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\265\\340\\256\\277\\340\\256\\262\\340\\257\\215\\340\\256\\262\\340\\257\\210.\\0\"\\\n  \"\\340\\256\\232\\340\\257\\201\\340\\256\\256\\340\\256\\244\\340\\257\\215\\340\\256\\260\\340\\256\\276 PDF \\340\\256\\244\\340\\257\\207\\340\\256\\260\\340\\257\\215\\340\\256\\265\\340\\257\\201 \\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\257\\215\\340\\256\\244\\340\\256\\244\\340\\257\\201\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201 \\340\\256\\250\\340\\256\\251\\340\\257\\215\\340\\256\\261\\340\\256\\277!\\0\"\\\n  \"\\340\\256\\250\\340\\256\\251\\340\\257\\215\\340\\256\\261\\340\\256\\277! \\340\\256\\232\\340\\257\\201\\340\\256\\256\\340\\256\\244\\340\\257\\215\\340\\256\\260\\340\\256\\276 PDF \\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201 \\340\\256\\211\\340\\256\\263\\340\\257\\215\\340\\256\\263\\340\\256\\244\\340\\257\\201\\0\"\\\n  \"\\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265\\340\\256\\277 \\340\\256\\225\\340\\257\\206\\340\\256\\237\\340\\257\\215\\340\\256\\237\\340\\257\\201\\340\\256\\263\\340\\257\\215\\340\\256\\263\\340\\256\\244\\340\\257\\201. \\340\\256\\256\\340\\257\\200\\340\\256\\243\\340\\257\\215\\340\\256\\237\\340\\257\\201\\340\\256\\256\\340\\257\\215 \\340\\256\\252\\340\\256\\244\\340\\256\\277\\340\\256\\265\\340\\256\\277\\340\\256\\261\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215 \\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\257\\215\\340\\256\\257\\340\\256\\265\\340\\257\\201\\340\\256\\256\\340\\257\\215. \\n \\340\\256\\232\\340\\257\\206\\340\\257\\227\\340\\256\\225\\340\\256\\260\\340\\256\\277\\340\\256\\257\\340\\256\\256\\340\\256\\277\\340\\256\\251\\340\\257\\215\\340\\256\\256\\340\\257\\210\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201 \\340\\256\\265\\340\\256\\260\\340\\257\\201\\340\\256\\250\\340\\257\\215\\340\\256\\244\\340\\257\\201\\340\\256\\225\\340\\256\\277\\340\\256\\261\\340\\257\\213\\340\\256\\256\\340\\257\\215!\\0\"\\\n  \"\\340\\256\\232\\340\\257\\201\\340\\256\\256\\340\\256\\244\\340\\257\\215\\340\\256\\260\\340\\256\\276PDF\\340\\256\\220 \\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265\\340\\256\\262\\340\\257\\215 \\340\\256\\250\\340\\257\\200\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\257\\201\\0\"\\\n  \"\\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265\\340\\256\\262\\340\\257\\215 \\340\\256\\250\\340\\257\\200\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215 \\340\\256\\244\\340\\257\\213\\340\\256\\262\\340\\257\\215\\340\\256\\265\\340\\256\\277\\0\"\\\n  \"\\340\\256\\250\\340\\256\\277\\340\\256\\261\\340\\257\\201\\340\\256\\265\\340\\256\\262\\340\\257\\215 \\340\\256\\250\\340\\257\\200\\340\\256\\225\\340\\257\\215\\340\\256\\225\\340\\256\\256\\340\\257\\215 \\340\\256\\232\\340\\257\\206\\340\\256\\257\\340\\256\\262\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\201\\340\\256\\225\\340\\256\\277\\340\\256\\261\\340\\256\\244\\340\\257\\201...\\0\"\\\n  \"\\340\\256\\232\\340\\257\\201\\340\\256\\256\\340\\256\\244\\340\\257\\215\\340\\256\\260\\340\\256\\276 PDF\\340\\256\\220 \\340\\256\\256\\340\\257\\201\\340\\256\\251\\340\\257\\215\\340\\256\\251\\340\\256\\277\\340\\256\\260\\340\\257\\201\\340\\256\\252\\340\\257\\215\\340\\256\\252\\340\\256\\225 \\340\\256\\252\\340\\256\\257\\340\\256\\251\\340\\257\\215\\340\\256\\252\\340\\256\\237\\340\\257\\201\\340\\256\\244\\340\\257\\215\\340\\256\\244\\340\\257\\201\\0\";\n\nconst char * gTranslations_tr = \n  \"&Ayarlar\\0\"\\\n  \"SumatraPDF'yi bilgisayar\\304\\261n\\304\\261zdan kald\\304\\261rmak istedi\\304\\237inize emin misiniz ?\\0\"\\\n  \"Kapat\\0\"\\\n  \"Ge\\303\\247ici dizin olu\\305\\237turulamad\\304\\261\\0\"\\\n  \"Kurulum dizini olu\\305\\237turulamad\\304\\261\\0\"\\\n  \"PDF \\303\\266n zileyici y\\303\\274klenemedi\\0\"\\\n  \"PDF arama filtresi y\\303\\274klenemedi\\0\"\\\n  \"Ge\\303\\247ici dizin bulunamad\\304\\261\\0\"\\\n  \"Kurulum dizini kald\\304\\261r\\304\\261lamad\\304\\261\\0\"\\\n  \"K\\304\\261sayol silinemedi\\0\"\\\n  \"PDF \\303\\266nizleyicisi kald\\304\\261r\\304\\261lamad\\304\\261\\0\"\\\n  \"PDF arama filtresi kald\\304\\261r\\304\\261lamad\\304\\261\\0\"\\\n  \"Taray\\304\\261c\\304\\261 eklentisi silinemedi\\0\"\\\n  \"Diske %s yaz\\304\\261lamad\\304\\261\\0\"\\\n  \"Kald\\304\\261r\\304\\261c\\304\\261y\\304\\261 ge\\303\\247ici dizine kopyalama ba\\305\\237ar\\304\\261s\\304\\261z oldu\\0\"\\\n  \"K\\304\\261sayol olu\\305\\237turulamad\\304\\261\\0\"\\\n  \"Kald\\304\\261r\\304\\261c\\304\\261 kay\\304\\261t defteri anahtarlar\\304\\261n\\304\\261 silemedi\\0\"\\\n  \"\\0\"\\\n  \"Kay\\304\\261t defterine geni\\305\\237letimi\\305\\237 dosya uzant\\304\\261s\\304\\261 yazma ba\\305\\237ar\\304\\261s\\304\\261z oldu\\0\"\\\n  \"Kay\\304\\261t defterine kald\\304\\261rma bilgisi yazma i\\305\\237i ba\\305\\237ar\\304\\261s\\304\\261z oldu\\0\"\\\n  \"Sakla & Se\\303\\247enekler\\0\"\\\n  \"SumatraPDF y\\303\\274kle\\0\"\\\n  \"&folder klas\\303\\266r\\303\\274ne SumatraPDF'yi y\\303\\274kle\\0\"\\\n  \"Y\\303\\274kleme ba\\305\\237ar\\304\\261s\\304\\261z !\\0\"\\\n  \"Kurulum devam ediyor...\\0\"\\\n  \"PDF ve taray\\304\\261c\\304\\261 eklentisini kurulu oalrak b\\304\\261rak\\304\\261n\\304\\261z (art\\304\\261k desteklenmiyor)\\0\"\\\n  \"PDF belgelrini aramak i\\303\\247in Windows Masa\\303\\274st\\303\\274 Aramaya izin ver\\0\"\\\n  \"PDF belgelerini g\\303\\266r\\303\\274nt\\303\\274lemek ve \\303\\266nizleme i\\303\\247in Windows'a izin ver\\0\"\\\n  \"Devam etmek i\\303\\247in %s kapat\\304\\261n!\\0\"\\\n  \"SumatraPDF'in y\\303\\274klenece\\304\\237i alan\\304\\261 se\\303\\247in:\\0\"\\\n  \"Y\\303\\274kl\\303\\274 olmas\\304\\261 gereken baz\\304\\261 dosyalar eksik ve ya hasar g\\303\\266rm\\303\\274\\305\\237\\0\"\\\n  \"SumatraPDF'yi ba\\305\\237lat\\0\"\\\n  \"SumatraPDF %s y\\303\\274kleyici\\0\"\\\n  \"SumatraPDF %s Kald\\304\\261r\\304\\261c\\304\\261\\0\"\\\n  \"SumatraPDF kald\\304\\261r\\304\\261ld\\304\\261.\\0\"\\\n  \"SumatraPDF kurulum dosyas\\304\\261 bulunamad\\304\\261.\\0\"\\\n  \"SumatraPDF 'i se\\303\\247ti\\304\\237iniz i\\303\\247in te\\305\\237ekk\\303\\274rler !\\0\"\\\n  \"Te\\305\\237ekk\\303\\274rler! SumatraPDF bilgisayar\\304\\261n\\304\\261za kuruldu\\0\"\\\n  \"Y\\303\\274kleyici hasar g\\303\\266rm\\303\\274\\305\\237.L\\303\\274tfen tekrar indirin.\\nGe\\303\\247ici rahats\\304\\261zl\\304\\261k i\\303\\247in \\303\\266z\\303\\274r dileriz!\\0\"\\\n  \"SumatraPDF'i kald\\304\\261r\\0\"\\\n  \"Program kald\\304\\261rma ba\\305\\237ar\\304\\261s\\304\\261z\\0\"\\\n  \"Program kald\\304\\261r\\304\\261l\\304\\261yor...\\0\"\\\n  \"SumatraPDF varsay\\304\\261lan PDF okuyucum olsun\\0\";\n\nconst char * gTranslations_uk = \n  \"\\320\\235\\320\\260\\320\\273\\320\\260\\321\\210\\321\\202\\321\\203\\320\\262\\320\\260\\320\\275\\320\\275\\321\\217\\0\"\\\n  \"\\320\\222\\320\\270 \\320\\262\\320\\277\\320\\265\\320\\262\\320\\275\\320\\265\\320\\275\\321\\226, \\321\\211\\320\\276 \\321\\205\\320\\276\\321\\207\\320\\265\\321\\202\\320\\265 \\320\\262\\320\\270\\320\\264\\320\\260\\320\\273\\320\\270\\321\\202\\320\\270 SumatraPDF?\\0\"\\\n  \"\\320\\227\\320\\260\\320\\272\\321\\200\\320\\270\\321\\202\\320\\270\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\262\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\217 \\321\\201\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270\\321\\202\\320\\270 \\321\\202\\320\\270\\320\\274\\321\\207\\320\\260\\321\\201\\320\\276\\320\\262\\321\\203 \\320\\277\\320\\260\\320\\277\\320\\272\\321\\203\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\262\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\217 \\321\\201\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270\\321\\202\\320\\270 \\320\\277\\320\\260\\320\\277\\320\\272\\321\\203 \\320\\264\\320\\273\\321\\217 \\320\\262\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\273\\320\\265\\320\\275\\320\\275\\321\\217\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\262\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\217 \\320\\262\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\270\\321\\202\\320\\270 \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\321\\203 \\320\\264\\320\\273\\321\\217 \\320\\277\\320\\276\\320\\277\\320\\265\\321\\200\\320\\265\\320\\264\\320\\275\\321\\214\\320\\276\\320\\263\\320\\276 \\320\\277\\320\\265\\321\\200\\320\\265\\320\\263\\320\\273\\321\\217\\320\\264\\321\\203 PDF\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\262\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\217 \\320\\262\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\270\\321\\202\\320\\270 \\321\\204\\321\\226\\320\\273\\321\\214\\321\\202\\321\\200 \\320\\277\\320\\276\\321\\210\\321\\203\\320\\272\\321\\203 \\320\\264\\320\\273\\321\\217 PDF\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\262\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\217 \\320\\276\\321\\202\\321\\200\\320\\270\\320\\274\\320\\260\\321\\202\\320\\270 \\321\\200\\320\\276\\320\\267\\321\\202\\320\\260\\321\\210\\321\\203\\320\\262\\320\\260\\320\\275\\320\\275\\321\\217 \\321\\202\\320\\270\\320\\274\\321\\207\\320\\260\\321\\201\\320\\276\\320\\262\\320\\276\\321\\227 \\320\\277\\320\\260\\320\\277\\320\\272\\320\\270\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\262\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\217 \\320\\262\\320\\270\\320\\264\\320\\260\\320\\273\\320\\270\\321\\202\\320\\270 \\320\\277\\320\\260\\320\\277\\320\\272\\321\\203, \\320\\264\\320\\265 \\320\\261\\321\\203\\320\\273\\320\\276 \\320\\262\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\273\\320\\265\\320\\275\\320\\276 \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\321\\203\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\262\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\217 \\320\\262\\320\\270\\320\\264\\320\\260\\320\\273\\320\\270\\321\\202\\320\\270 \\321\\217\\321\\200\\320\\273\\320\\270\\320\\272\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\262\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\217 \\320\\262\\320\\270\\320\\264\\320\\260\\320\\273\\320\\270\\321\\202\\320\\270 \\320\\277\\321\\200\\320\\276\\320\\263\\321\\200\\320\\260\\320\\274\\321\\203 \\320\\277\\320\\276\\320\\277\\320\\265\\321\\200\\320\\265\\320\\264\\320\\275\\321\\214\\320\\276\\320\\263\\320\\276 \\320\\277\\320\\265\\321\\200\\320\\265\\320\\263\\320\\273\\321\\217\\320\\264\\321\\203 PDF\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\262\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\217 \\320\\262\\320\\270\\320\\264\\320\\260\\320\\273\\320\\270\\321\\202\\320\\270 \\321\\204\\321\\226\\320\\273\\321\\214\\321\\202\\321\\200 \\320\\277\\320\\276\\321\\210\\321\\203\\320\\272\\321\\203 \\320\\264\\320\\273\\321\\217 PDF\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\262\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\217 \\320\\262\\320\\270\\320\\264\\320\\260\\320\\273\\320\\270\\321\\202\\320\\270 \\321\\200\\320\\276\\320\\267\\321\\210\\320\\270\\321\\200\\320\\265\\320\\275\\320\\275\\321\\217 \\320\\264\\320\\273\\321\\217 \\320\\261\\321\\200\\320\\260\\321\\203\\320\\267\\320\\265\\321\\200\\320\\260\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\262\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\217 \\320\\267\\320\\260\\320\\277\\320\\270\\321\\201\\320\\260\\321\\202\\320\\270 %s \\320\\275\\320\\260 \\320\\264\\320\\270\\321\\201\\320\\272\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\262\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\217 \\321\\201\\320\\272\\320\\276\\320\\277\\321\\226\\321\\216\\320\\262\\320\\260\\321\\202\\320\\270 \\320\\264\\320\\265\\321\\226\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\321\\217\\321\\202\\320\\276\\321\\200 \\321\\203 \\321\\202\\320\\270\\320\\274\\321\\207\\320\\260\\321\\201\\320\\276\\320\\262\\321\\203 \\320\\277\\320\\260\\320\\277\\320\\272\\321\\203\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\262\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\217 \\321\\201\\321\\202\\320\\262\\320\\276\\321\\200\\320\\270\\321\\202\\320\\270 \\321\\217\\321\\200\\320\\273\\320\\270\\320\\272\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\262\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\217 \\320\\262\\320\\270\\320\\264\\320\\260\\320\\273\\320\\270\\321\\202\\320\\270 \\321\\226\\320\\275\\321\\204\\320\\276\\321\\200\\320\\274\\320\\260\\321\\206\\321\\226\\321\\216 \\320\\264\\320\\265\\321\\226\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\321\\217\\321\\202\\320\\276\\321\\200\\320\\260 \\320\\267 \\321\\200\\320\\265\\321\\224\\321\\201\\321\\202\\321\\200\\321\\203\\0\"\\\n  \"\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\262\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\217 \\320\\267\\320\\260\\320\\277\\320\\270\\321\\201\\320\\260\\321\\202\\320\\270 \\321\\226\\320\\275\\321\\204\\320\\276\\321\\200\\320\\274\\320\\260\\321\\206\\321\\226\\321\\216 \\320\\277\\321\\200\\320\\276 \\321\\200\\320\\276\\320\\267\\321\\210\\320\\270\\321\\200\\320\\265\\320\\275\\320\\275\\321\\217 \\321\\204\\320\\260\\320\\271\\320\\273\\321\\203 \\320\\264\\320\\276 \\321\\200\\320\\265\\321\\224\\321\\201\\321\\202\\321\\200\\321\\203\\0\"\\\n  \"\\320\\235\\320\\265 \\320\\262\\320\\264\\320\\260\\320\\273\\320\\276\\321\\201\\321\\217 \\320\\267\\320\\260\\320\\277\\320\\270\\321\\201\\320\\260\\321\\202\\320\\270 \\321\\226\\320\\275\\321\\204\\320\\276\\321\\200\\320\\274\\320\\260\\321\\206\\321\\226\\321\\216 \\320\\264\\320\\273\\321\\217 \\320\\262\\320\\270\\320\\264\\320\\260\\320\\273\\320\\265\\320\\275\\320\\275\\321\\217 \\321\\203 \\321\\200\\320\\265\\321\\224\\321\\201\\321\\202\\321\\200\\0\"\\\n  \"\\320\\237\\321\\200\\320\\270\\321\\205\\320\\276\\320\\262\\320\\260\\321\\202\\320\\270 \\320\\275\\320\\260\\320\\273\\320\\260\\321\\210\\321\\202\\321\\203\\320\\262\\320\\260\\320\\275\\320\\275\\321\\217\\0\"\\\n  \"\\320\\222\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\270\\321\\202\\320\\270 SumatraPDF\\0\"\\\n  \"\\320\\222\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\270\\321\\202\\320\\270 SumatraPDF \\321\\203 \\320\\277\\320\\260\\320\\277\\320\\272\\321\\203\\0\"\\\n  \"\\320\\222\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\273\\320\\265\\320\\275\\320\\275\\321\\217 \\320\\275\\320\\265 \\320\\261\\321\\203\\320\\273\\320\\276 \\321\\203\\321\\201\\320\\277\\321\\226\\321\\210\\320\\275\\320\\270\\320\\274!\\0\"\\\n  \"\\320\\222\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\273\\320\\265\\320\\275\\320\\275\\321\\217 \\321\\202\\321\\200\\320\\270\\320\\262\\320\\260\\321\\224...\\0\"\\\n  \"\\320\\227\\320\\260\\320\\273\\320\\270\\321\\210\\320\\270\\321\\202\\320\\270 \\321\\200\\320\\276\\320\\267\\321\\210\\320\\270\\321\\200\\320\\265\\320\\275\\320\\275\\321\\217 \\320\\264\\320\\273\\321\\217 \\320\\261\\321\\200\\320\\260\\321\\203\\320\\267\\320\\265\\321\\200\\320\\260 (\\320\\261\\321\\226\\320\\273\\321\\214\\321\\210\\320\\265 \\320\\275\\320\\265 \\320\\277\\321\\226\\320\\264\\321\\202\\321\\200\\320\\270\\320\\274\\321\\203\\321\\224\\321\\202\\321\\214\\321\\201\\321\\217)\\0\"\\\n  \"\\320\\224\\320\\276\\320\\267\\320\\262\\320\\276\\320\\273\\320\\270\\321\\202\\320\\270 Windows Desktop Search \\320\\277\\320\\276\\321\\210\\321\\203\\320\\272 \\321\\203 PDF \\320\\264\\320\\276\\320\\272\\321\\203\\320\\274\\320\\265\\320\\275\\321\\202\\320\\260\\321\\205\\0\"\\\n  \"\\320\\224\\320\\276\\320\\267\\320\\262\\320\\276\\320\\273\\320\\270\\321\\202\\320\\270 Windows \\320\\267\\320\\264\\321\\226\\320\\271\\321\\201\\320\\275\\321\\216\\320\\262\\320\\260\\321\\202\\320\\270 \\320\\277\\320\\276\\320\\277\\320\\265\\321\\200\\320\\265\\320\\264\\320\\275\\321\\226\\320\\271 \\320\\277\\320\\265\\321\\200\\320\\265\\320\\263\\320\\273\\321\\217\\320\\264 \\320\\264\\320\\273\\321\\217 PDF\\0\"\\\n  \"\\320\\221\\321\\203\\320\\264\\321\\214 \\320\\273\\320\\260\\321\\201\\320\\272\\320\\260 \\320\\267\\320\\260\\320\\272\\321\\200\\320\\270\\320\\271\\321\\202\\320\\265 %s, \\321\\211\\320\\276\\320\\261 \\320\\277\\321\\200\\320\\276\\320\\264\\320\\276\\320\\262\\320\\266\\320\\270\\321\\202\\320\\270!\\0\"\\\n  \"\\320\\222\\320\\270\\320\\261\\320\\265\\321\\200\\321\\226\\321\\202\\321\\214 \\320\\277\\320\\260\\320\\277\\320\\272\\321\\203, \\320\\262 \\321\\217\\320\\272\\321\\203 \\320\\261\\321\\203\\320\\264\\320\\265 \\320\\262\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\273\\320\\265\\320\\275\\320\\276 SumatraPDF\\0\"\\\n  \"\\320\\224\\320\\265\\321\\217\\320\\272\\321\\226 \\321\\204\\320\\260\\320\\271\\320\\273\\320\\270 \\320\\275\\320\\265\\320\\276\\320\\261\\321\\205\\321\\226\\320\\264\\320\\275\\321\\226 \\320\\264\\320\\273\\321\\217 \\320\\262\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\273\\320\\265\\320\\275\\320\\275\\321\\217 \\320\\262\\321\\226\\320\\264\\321\\201\\321\\203\\321\\202\\320\\275\\321\\226 \\320\\260\\320\\261\\320\\276 \\320\\277\\320\\276\\321\\210\\320\\272\\320\\276\\320\\264\\320\\266\\320\\265\\320\\275\\321\\226\\0\"\\\n  \"\\320\\227\\320\\260\\320\\277\\321\\203\\321\\201\\321\\202\\320\\270\\321\\202\\320\\270 SumatraPDF\\0\"\\\n  \"\\320\\206\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\321\\217\\321\\202\\320\\276\\321\\200 SumatraPDF %s\\0\"\\\n  \"\\320\\224\\320\\265\\321\\226\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\321\\217\\321\\202\\320\\276\\321\\200 SumatraPDF %s\\0\"\\\n  \"SumatraPDF \\320\\261\\321\\203\\320\\273\\320\\276 \\321\\203\\321\\201\\320\\277\\321\\226\\321\\210\\320\\275\\320\\276 \\320\\262\\320\\270\\320\\264\\320\\260\\320\\273\\320\\265\\320\\275\\320\\276.\\0\"\\\n  \"\\320\\222\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\273\\320\\265\\320\\275\\320\\270\\320\\271 SumatraPDF \\320\\275\\320\\265 \\320\\261\\321\\203\\320\\273\\320\\276 \\320\\267\\320\\275\\320\\260\\320\\271\\320\\264\\320\\265\\320\\275\\320\\276.\\0\"\\\n  \"\\320\\224\\321\\217\\320\\272\\321\\203\\321\\224\\320\\274\\320\\276, \\321\\211\\320\\276 \\320\\262\\320\\270\\320\\261\\321\\200\\320\\260\\320\\273\\320\\270 SumatraPDF!\\0\"\\\n  \"\\320\\224\\321\\217\\320\\272\\321\\203\\321\\224\\320\\274\\320\\276! SumatraPDF \\320\\261\\321\\203\\320\\273\\320\\276 \\321\\203\\321\\201\\320\\277\\321\\226\\321\\210\\320\\275\\320\\276 \\320\\262\\321\\201\\321\\202\\320\\260\\320\\275\\320\\276\\320\\262\\320\\273\\320\\265\\320\\275\\320\\276.\\0\"\\\n  \"\\320\\206\\320\\275\\321\\201\\321\\202\\320\\260\\320\\273\\321\\217\\321\\202\\320\\276\\321\\200 \\320\\261\\321\\203\\320\\273\\320\\276 \\320\\277\\320\\276\\321\\210\\320\\272\\320\\276\\320\\264\\320\\266\\320\\265\\320\\275\\320\\276. \\320\\221\\321\\203\\320\\264\\321\\214 \\320\\273\\320\\260\\321\\201\\320\\272\\320\\260 \\320\\267\\320\\260\\320\\262\\320\\260\\320\\275\\321\\202\\320\\260\\320\\266\\321\\202\\320\\265 \\320\\271\\320\\276\\320\\263\\320\\276 \\320\\267\\320\\275\\320\\276\\320\\262\\321\\203.\\n\\320\\222\\320\\270\\320\\261\\320\\260\\321\\207\\321\\202\\320\\265 \\320\\267\\320\\260 \\320\\275\\320\\265\\320\\267\\321\\200\\321\\203\\321\\207\\320\\275\\320\\276\\321\\201\\321\\202\\321\\226!\\0\"\\\n  \"\\320\\222\\320\\270\\320\\264\\320\\260\\320\\273\\320\\270\\321\\202\\320\\270 SumatraPDF\\0\"\\\n  \"\\320\\222\\320\\270\\320\\264\\320\\260\\320\\273\\320\\265\\320\\275\\320\\275\\321\\217 \\320\\275\\320\\265 \\320\\261\\321\\203\\320\\273\\320\\276 \\321\\203\\321\\201\\320\\277\\321\\226\\321\\210\\320\\275\\320\\270\\320\\274\\0\"\\\n  \"\\320\\222\\320\\270\\320\\264\\320\\260\\320\\273\\320\\265\\320\\275\\320\\275\\321\\217 \\321\\202\\321\\200\\320\\270\\320\\262\\320\\260\\321\\224...\\0\"\\\n  \"\\320\\222\\320\\270\\320\\272\\320\\276\\321\\200\\320\\270\\321\\201\\321\\202\\320\\276\\320\\262\\321\\203\\320\\262\\320\\260\\321\\202\\320\\270 SumatraPDF \\321\\217\\320\\272 \\320\\277\\320\\265\\321\\200\\320\\265\\320\\263\\320\\273\\321\\217\\320\\264\\320\\260\\321\\207 \\320\\264\\320\\273\\321\\217 PDF \\320\\267\\320\\260 \\320\\267\\320\\260\\320\\274\\320\\276\\320\\262\\321\\207\\321\\203\\320\\262\\320\\260\\320\\275\\320\\275\\321\\217\\320\\274\\0\";\n\nconst char * gTranslations_uz = \n  \"&Parametrlar\\0\"\\\n  \"SumatraPDF'ni o'chirishga ishonchingiz komilmi?\\0\"\\\n  \"Yopish\\0\"\\\n  \"Vaqtincha direktoriyani yaratib bo'lmadi\\0\"\\\n  \"O'rnatish directoriyasini yaratib bo'lmadi\\0\"\\\n  \"PDF ko'rish vositasini o'rnatib bo'lmadi\\0\"\\\n  \"PDF qidirish filtrini o'rnatib bo'lmadi\\0\"\\\n  \"Vaqtinchalik direktoriyani olib bo'lmadi\\0\"\\\n  \"O'rnatish direktoriyasini o'chirib bo'lmadi\\0\"\\\n  \"Xatcho'pni o'chirib bo'lmadi\\0\"\\\n  \"PDF ko'rish vositasini o'chirib bo'lmadi\\0\"\\\n  \"PDF qidirish filtrini o'chirib bo'lmadi\\0\"\\\n  \"Brauzer plaginini o'chirib bo'lmadi\\0\"\\\n  \"%s diskka yozib bo'lmadi\\0\"\\\n  \"O'chirish dasturini vaqtinchalik direktoriyaga nusxa olish muvaffaqiyatsiz tugadi\\0\"\\\n  \"Xatcho'pni yaratib bo'lmadi\\0\"\\\n  \"O'chirish dasturining reyestr kalitlarini o'chirish muvaffaqiyatsiz tugadi\\0\"\\\n  \"\\0\"\\\n  \"Fayl turi haqida kengaytirilgan ma'lumotini reyestrga yozish muvaffaqiyatsiz tugadi\\0\"\\\n  \"Dasturni o'chirish ma'lumotini reyestrga yozish muvaffaqiyatsiz tugadi\\0\"\\\n  \"&Parametrlarni yashirish\\0\"\\\n  \"SumatraPDF o'rnatish\\0\"\\\n  \"SumatraPDF &jildga o'rnatish\\0\"\\\n  \"O'rnatish muvaffaqiyatsiz tugadi!\\0\"\\\n  \"O'rnatilmoqda...\\0\"\\\n  \"PDF &brauzer plaginini o'rnatilgan qoldirish (boshqa qo'llab-quvvatlanmaydi)\\0\"\\\n  \"Windows Desktop Search yordamida PDF hujjatlarini &qidirish\\0\"\\\n  \"Windows yordamida PDF hujjatlarini oldindan &ko'rish\\0\"\\\n  \"Davom etish uchun %s yoping!\\0\"\\\n  \"SumatraPDF o'rnatish uchun jildni tanlang:\\0\"\\\n  \"Ba'zi o'rnatilayotgan fayllar buzilgan yoki mavjud emas\\0\"\\\n  \"SumatraPDF ishga tushirish\\0\"\\\n  \"SumatraPDF %s o'rnatuvchisi\\0\"\\\n  \"SumatraPDF %s o'chirish dasturi\\0\"\\\n  \"SumatraPDF o'chirildi.\\0\"\\\n  \"SumatraPDF o'rnatilganligi topilmadi.\\0\"\\\n  \"SumatraPDF tanlaganingiz uchun tashakkur!\\0\"\\\n  \"Tashakkur! SumatraPDF o'rnatildi.\\0\"\\\n  \"O'rnatuvchi buzilgan. Qaytadan yuklab oling. \\nNoqulayliklar uchun uzr so'raymiz!\\0\"\\\n  \"SumatraPDFni o'chirish\\0\"\\\n  \"O'chirish muvaffaqiyatsiz tugadi\\0\"\\\n  \"O'chirilmoqda...\\0\"\\\n  \"SumatraPDF &andoza PDF o'qish vositasi sifatida ishlatish\\0\";\n\nconst char * gTranslations_vn = \n  \"&T\\303\\271y ch\\341\\273\\215n\\0\"\\\n  \"B\\341\\272\\241n c\\303\\263 ch\\341\\272\\257c mu\\341\\273\\221n g\\341\\273\\241 b\\341\\273\\217 SumatraPDF kh\\303\\264ng?\\0\"\\\n  \"\\304\\220\\303\\263ng l\\341\\272\\241i\\0\"\\\n  \"Kh\\303\\264ng t\\341\\272\\241o \\304\\221\\306\\260\\341\\273\\243c th\\306\\260 m\\341\\273\\245c t\\341\\272\\241m\\0\"\\\n  \"Kh\\303\\264ng t\\341\\272\\241o \\304\\221\\306\\260\\341\\273\\243c th\\306\\260 m\\341\\273\\245c c\\303\\240i \\304\\221\\341\\272\\267t\\0\"\\\n  \"Kh\\303\\264ng th\\341\\273\\203 c\\303\\240i \\304\\221\\341\\272\\267t ph\\341\\272\\247n hi\\341\\273\\203n th\\341\\273\\213 tr\\306\\260\\341\\273\\233c PDF\\0\"\\\n  \"Kh\\303\\264ng th\\341\\273\\203 c\\303\\240i \\304\\221\\341\\272\\267t b\\341\\273\\231 l\\341\\273\\215c t\\303\\254m ki\\341\\272\\277m PDF\\0\"\\\n  \"Kh\\303\\264ng th\\341\\273\\203 t\\303\\254m \\304\\221\\306\\260\\341\\273\\243c th\\306\\260 m\\341\\273\\245c t\\341\\272\\241m\\0\"\\\n  \"Kh\\303\\264ng th\\341\\273\\203 g\\341\\273\\241 b\\341\\273\\217 th\\306\\260 m\\341\\273\\245c c\\303\\240i \\304\\221\\341\\272\\267t\\0\"\\\n  \"Kh\\303\\264ng b\\341\\273\\217 l\\341\\273\\221i t\\341\\272\\257t \\304\\221\\306\\260\\341\\273\\243c\\0\"\\\n  \"Kh\\303\\264ng th\\341\\273\\203 g\\341\\273\\241 c\\303\\240i \\304\\221\\341\\272\\267t b\\341\\273\\231 xem tru\\341\\273\\233c PDF\\0\"\\\n  \"Kh\\303\\264ng th\\341\\273\\203 g\\341\\273\\241 c\\303\\240i \\304\\221\\341\\272\\267t b\\341\\273\\231 l\\341\\273\\215c t\\303\\254m ki\\341\\272\\277m PDF\\0\"\\\n  \"Kh\\303\\264ng th\\341\\273\\203 g\\341\\273\\241 c\\303\\240i \\304\\221\\341\\272\\267t Plugin tr\\303\\254nh duy\\341\\273\\207t\\0\"\\\n  \"Kh\\303\\264ng th\\341\\273\\203 ghi %s v\\303\\240o \\304\\221\\304\\251a\\0\"\\\n  \"Kh\\303\\264ng th\\341\\273\\203 ch\\303\\251p b\\341\\273\\231 g\\341\\273\\241 c\\303\\240i \\304\\221\\341\\272\\267t v\\303\\240o th\\306\\260 m\\341\\273\\245c t\\341\\272\\241m\\0\"\\\n  \"Kh\\303\\264ng th\\341\\273\\203 t\\341\\272\\241o Shortcut\\0\"\\\n  \"Kh\\303\\264ng th\\341\\273\\203 x\\303\\263a c\\303\\241c kh\\303\\263a Registry c\\341\\273\\247a b\\341\\273\\231 g\\341\\273\\241 c\\303\\240i \\304\\221\\341\\272\\267t\\0\"\\\n  \"\\0\"\\\n  \"Kh\\303\\264ng th\\341\\273\\203 ghi th\\303\\264ng tin v\\341\\273\\201 ph\\341\\272\\247n m\\341\\273\\237 r\\341\\273\\231ng c\\341\\273\\247a t\\341\\272\\255p tin v\\303\\240o kh\\303\\263a Registry\\0\"\\\n  \"Kh\\303\\264ng th\\341\\273\\203 ghi th\\303\\264ng tin v\\341\\273\\201 vi\\341\\273\\207c g\\341\\273\\241 c\\303\\240i \\304\\221\\341\\272\\267t v\\303\\240o kh\\303\\263a Registry\\0\"\\\n  \"Thi\\341\\272\\277t l\\341\\272\\255p \\341\\272\\251n v\\303\\240 t\\303\\271y ch\\341\\273\\215n\\0\"\\\n  \"C\\303\\240i \\304\\221\\341\\272\\267t SumatraPDF\\0\"\\\n  \"C\\303\\240i \\304\\221\\341\\272\\267t SumatraPDF trong &th\\306\\260 m\\341\\273\\245c:\\0\"\\\n  \"C\\303\\240i \\304\\221\\341\\272\\267t th\\341\\272\\245t b\\341\\272\\241i!\\0\"\\\n  \"\\304\\220ang c\\303\\240i \\304\\221\\341\\272\\267t...\\0\"\\\n  \"Gi\\341\\273\\257 l\\341\\272\\241i Plugin PDF \\304\\221\\303\\243 c\\303\\240i \\304\\221\\341\\272\\267t cho c\\303\\241c tr\\303\\254nh duy\\341\\273\\207t (kh\\303\\264ng c\\303\\262n \\304\\221\\306\\260\\341\\273\\243c h\\341\\273\\227 tr\\341\\273\\243)\\0\"\\\n  \"Cho ph\\303\\251p Windows &t\\303\\254m ki\\341\\272\\277m c\\303\\241c t\\303\\240i li\\341\\273\\207u PDF\\0\"\\\n  \"Cho ph\\303\\251p Windows hi\\341\\273\\203n th\\341\\273\\213 h\\303\\254nh \\341\\272\\243nh &xem tr\\306\\260\\341\\273\\233c c\\341\\273\\247a c\\303\\241c t\\303\\240i li\\341\\273\\207u PDF\\0\"\\\n  \"H\\303\\243y \\304\\221\\303\\263ng %s l\\341\\272\\241i \\304\\221\\341\\273\\203 ti\\341\\272\\277n h\\303\\240nh!\\0\"\\\n  \"Ch\\341\\273\\215n th\\306\\260 m\\341\\273\\245c n\\306\\241i m\\303\\240 SumatraPDF s\\341\\272\\275 \\304\\221\\306\\260\\341\\273\\243c c\\303\\240i \\304\\221\\341\\272\\267t:\\0\"\\\n  \"M\\341\\273\\231t s\\341\\273\\221 t\\341\\272\\255p tin d\\303\\271ng \\304\\221\\341\\273\\203 c\\303\\240i \\304\\221\\341\\272\\267t \\304\\221\\303\\243 b\\341\\273\\213 l\\341\\273\\227i ho\\341\\272\\267c b\\341\\273\\213 thi\\341\\272\\277u\\0\"\\\n  \"M\\341\\273\\237 SumatraPDF\\0\"\\\n  \"B\\341\\273\\231 c\\303\\240i \\304\\221\\341\\272\\267t %s SumatraPDF\\0\"\\\n  \"B\\341\\273\\231 g\\341\\273\\241 c\\303\\240i \\304\\221\\341\\272\\267t %s SumatraPDF\\0\"\\\n  \"SumatraPDF \\304\\221\\303\\243 \\304\\221\\306\\260\\341\\273\\243c g\\341\\273\\241 b\\341\\273\\217.\\0\"\\\n  \"Kh\\303\\264ng t\\303\\254m th\\341\\272\\245y g\\303\\263i c\\303\\240i \\304\\221\\341\\272\\267t SumatraPDF.\\0\"\\\n  \"C\\341\\272\\243m \\306\\241n v\\303\\254 \\304\\221\\303\\243 ch\\341\\273\\215n SumatraPDF!\\0\"\\\n  \"C\\341\\272\\243m \\306\\241n b\\341\\272\\241n! SumatraPDF \\304\\221\\303\\243 \\304\\221\\306\\260\\341\\273\\243c c\\303\\240i \\304\\221\\341\\272\\267t.\\0\"\\\n  \"Tr\\303\\254nh c\\303\\240i \\304\\221\\341\\272\\267t \\304\\221\\303\\243 b\\341\\273\\213 l\\341\\273\\227i. Xin vui l\\303\\262ng t\\341\\272\\243i v\\341\\273\\201 l\\341\\272\\247n n\\341\\273\\257a.\\nR\\341\\272\\245t ti\\341\\272\\277c v\\341\\273\\201 s\\341\\273\\261 b\\341\\272\\245t ti\\341\\273\\207n n\\303\\240y!\\0\"\\\n  \"G\\341\\273\\241 b\\341\\273\\217 SumatraPDF\\0\"\\\n  \"Kh\\303\\264ng g\\341\\273\\241 b\\341\\273\\217 \\304\\221\\306\\260\\341\\273\\243c\\0\"\\\n  \"\\304\\220ang g\\341\\273\\241 b\\341\\273\\217...\\0\"\\\n  \"\\304\\220\\341\\272\\267t SumatraPDF l\\303\\240 tr\\303\\254nh \\304\\221\\341\\273\\215c PDF m\\341\\272\\267c \\304\\221\\341\\273\\213nh\\0\";\n\nconst char * gTranslations_cy = \n  \"&Dewisiadau\\0\"\\\n  \"Ydych chi'n si\\305\\265r eich bod am ddadosod SumatraPDF\\0\"\\\n  \"Cau\\0\"\\\n  \"Methu creu cyfeiriadur dros dro\\0\"\\\n  \"Methu creu'r cyfeiriadur gosod\\0\"\\\n  \"Mehu gosod rhagolygwr PDF\\0\"\\\n  \"Methu gosod hidl chwilio PDF\\0\"\\\n  \"Methu canfod cyfeiriadur dros dro\\0\"\\\n  \"Methu tynnu'r cyfeiriadur gosod\\0\"\\\n  \"Methu tynnu'r llwybr byr\\0\"\\\n  \"Methu dadosod rhagolygwr PDF\\0\"\\\n  \"Methu dadosod hidl chwilio PDF\\0\"\\\n  \"Methu dadosod ategyn porwr\\0\"\\\n  \"Methu ysgrifennu %s i ddisg\\0\"\\\n  \"Methwyd cop\\303\\257o'r dadosodwr i'r cyfeiriadur dros dro\\0\"\\\n  \"Methwyd creu llwybr byr\\0\"\\\n  \"Methwyd dileu allweddi cofrestrfa'r dadosodwr\\0\"\\\n  \"\\0\"\\\n  \"Methwyd ysgrifennu gwybodaeth estyniad ffeil estynedig i'r gofrestrfa\\0\"\\\n  \"Methwyd ysgrifennu gwybodaeth y dadosodwr i'r gofrestrfa\\0\"\\\n  \"Dewisiadau C&uddio\\0\"\\\n  \"Gosod SumatraPDF\\0\"\\\n  \"Gosod SumatraPDF yn &ffolder:\\0\"\\\n  \"Methodd y gosod!\\0\"\\\n  \"Wrthi'n gosod\\0\"\\\n  \"Cadw yr ategyn porwr PDF wedi ei osod (ddim yn cael ei gynnal bellach)\\0\"\\\n  \"Gadael i Chwilio Bwrdd Gwaith Windows c&hwilio'r dogfennau PDF\\0\"\\\n  \"Gadael i Windows ddangos &rhagolwg o ddogfennau PDF\\0\"\\\n  \"Cau %s i barhau!\\0\"\\\n  \"Dewis y ffolder lle ddylai SumatraPDF gael ei gosod:\\0\"\\\n  \"Mae rhai ffeiliau i'w gosod wedi eu difrodi neu ar goll\\0\"\\\n  \"Cychwyn SumatraPDF\\0\"\\\n  \"Gosodwr SumatraPDF %s\\0\"\\\n  \"Dadosodwr SumatraPDF %s\\0\"\\\n  \"Mae SumatraPDF wedi ei ddadosod.\\0\"\\\n  \"Heb ganfod gosodiad SumatraPDF.\\0\"\\\n  \"Diolch am ddefnyddio SumatraPDF!\\0\"\\\n  \"Diolch yn fawr! Mae SumatraPDF wedi ei gosod\\0\"\\\n  \"Mae'r gosodwr yn llwgr. Llwythwch y ffeil i lawr eto. \\n Ymddiheuriadau am yr anghyfleuster!\\0\"\\\n  \"Dadosod SumatraPDF\\0\"\\\n  \"Methodd y gosod\\0\"\\\n  \"Wrthi'n dadosod...\\0\"\\\n  \"Defnyddio SumatraPDF fel y darllennydd PDF &rhagosodedig\\0\";\n\n\nstatic const char *gTranslations[LANGS_COUNT] = {\n  NULL,\n  gTranslations_sq, \n  gTranslations_ar, \n  gTranslations_am, \n  gTranslations_az, \n  gTranslations_eu, \n  gTranslations_bs, \n  gTranslations_bg, \n  gTranslations_ca, \n  gTranslations_ca_xv, \n  gTranslations_cn, \n  gTranslations_tw, \n  gTranslations_hr, \n  gTranslations_cz, \n  gTranslations_dk, \n  gTranslations_nl, \n  gTranslations_et, \n  gTranslations_fi, \n  gTranslations_fr, \n  gTranslations_gl, \n  gTranslations_de, \n  gTranslations_el, \n  gTranslations_he, \n  gTranslations_hu, \n  gTranslations_id, \n  gTranslations_ga, \n  gTranslations_it, \n  gTranslations_ja, \n  gTranslations_kr, \n  gTranslations_ku, \n  gTranslations_lv, \n  gTranslations_mk, \n  gTranslations_my, \n  gTranslations_no, \n  gTranslations_nn, \n  gTranslations_fa, \n  gTranslations_pl, \n  gTranslations_br, \n  gTranslations_pt, \n  gTranslations_ro, \n  gTranslations_ru, \n  gTranslations_sr_rs, \n  gTranslations_sp_rs, \n  gTranslations_sk, \n  gTranslations_sl, \n  gTranslations_es, \n  gTranslations_sv, \n  gTranslations_ta, \n  gTranslations_tr, \n  gTranslations_uk, \n  gTranslations_uz, \n  gTranslations_vn, \n  gTranslations_cy\n};\n\nconst char *GetTranslationsForLang(int langIdx) { return gTranslations[langIdx]; }\n\n\nconst char *gLangCodes =   \"en\\0\" \\\n  \"sq\\0\" \\\n  \"ar\\0\" \\\n  \"am\\0\" \\\n  \"az\\0\" \\\n  \"eu\\0\" \\\n  \"bs\\0\" \\\n  \"bg\\0\" \\\n  \"ca\\0\" \\\n  \"ca-xv\\0\" \\\n  \"cn\\0\" \\\n  \"tw\\0\" \\\n  \"hr\\0\" \\\n  \"cz\\0\" \\\n  \"dk\\0\" \\\n  \"nl\\0\" \\\n  \"et\\0\" \\\n  \"fi\\0\" \\\n  \"fr\\0\" \\\n  \"gl\\0\" \\\n  \"de\\0\" \\\n  \"el\\0\" \\\n  \"he\\0\" \\\n  \"hu\\0\" \\\n  \"id\\0\" \\\n  \"ga\\0\" \\\n  \"it\\0\" \\\n  \"ja\\0\" \\\n  \"kr\\0\" \\\n  \"ku\\0\" \\\n  \"lv\\0\" \\\n  \"mk\\0\" \\\n  \"my\\0\" \\\n  \"no\\0\" \\\n  \"nn\\0\" \\\n  \"fa\\0\" \\\n  \"pl\\0\" \\\n  \"br\\0\" \\\n  \"pt\\0\" \\\n  \"ro\\0\" \\\n  \"ru\\0\" \\\n  \"sr-rs\\0\" \\\n  \"sp-rs\\0\" \\\n  \"sk\\0\" \\\n  \"sl\\0\" \\\n  \"es\\0\" \\\n  \"sv\\0\" \\\n  \"ta\\0\" \\\n  \"tr\\0\" \\\n  \"uk\\0\" \\\n  \"uz\\0\" \\\n  \"vn\\0\" \\\n  \"cy\\0\" \"\\0\";\n\nconst char *gLangNames =   \"English\\0\" \\\n  \"Albanian (Shqip)\\0\" \\\n  \"Arabic (\\330\\247\\331\\204\\331\\222\\330\\271\\331\\216\\330\\261\\331\\216\\330\\250\\331\\212\\331\\221\\330\\251)\\0\" \\\n  \"Armenian (\\325\\200\\325\\241\\325\\265\\325\\245\\326\\200\\325\\245\\325\\266)\\0\" \\\n  \"Azerbaijani (Az\\311\\231rbaycanca)\\0\" \\\n  \"Basque (Euskara)\\0\" \\\n  \"Bosnian (Bosanski)\\0\" \\\n  \"Bulgarian (\\320\\221\\321\\212\\320\\273\\320\\263\\320\\260\\321\\200\\321\\201\\320\\272\\320\\270)\\0\" \\\n  \"Catalan (Catal\\303\\240)\\0\" \\\n  \"Catalan-Valencian (Catal\\303\\240-Valenci\\303\\240)\\0\" \\\n  \"Chinese Simplified (\\347\\256\\200\\344\\275\\223\\344\\270\\255\\346\\226\\207)\\0\" \\\n  \"Chinese Traditional (\\347\\271\\201\\351\\253\\224\\344\\270\\255\\346\\226\\207)\\0\" \\\n  \"Croatian (Hrvatski)\\0\" \\\n  \"Czech (\\304\\214e\\305\\241tina)\\0\" \\\n  \"Danish (Dansk)\\0\" \\\n  \"Dutch (Nederlands)\\0\" \\\n  \"Estonian (Eesti)\\0\" \\\n  \"Finnish (Suomi)\\0\" \\\n  \"French (Fran\\303\\247ais)\\0\" \\\n  \"Galician (Galego)\\0\" \\\n  \"German (Deutsch)\\0\" \\\n  \"Greek (\\316\\225\\316\\273\\316\\273\\316\\267\\316\\275\\316\\271\\316\\272\\316\\254)\\0\" \\\n  \"Hebrew (\\327\\242\\327\\221\\327\\250\\327\\231\\327\\252)\\0\" \\\n  \"Hungarian (Magyar)\\0\" \\\n  \"Indonesian (Bahasa Indonesia)\\0\" \\\n  \"Irish (Gaeilge)\\0\" \\\n  \"Italian (Italiano)\\0\" \\\n  \"Japanese (\\346\\227\\245\\346\\234\\254\\350\\252\\236)\\0\" \\\n  \"Korean (\\355\\225\\234\\352\\265\\255\\354\\226\\264)\\0\" \\\n  \"Kurdish (\\331\\203\\331\\210\\330\\261\\330\\257\\333\\214)\\0\" \\\n  \"Latvian (latvie\\305\\241u valoda)\\0\" \\\n  \"Macedonian (\\320\\274\\320\\260\\320\\272\\320\\265\\320\\264\\320\\276\\320\\275\\321\\201\\320\\272\\320\\270)\\0\" \\\n  \"Malaysian (Bahasa Melayu)\\0\" \\\n  \"Norwegian (Norsk)\\0\" \\\n  \"Norwegian Neo-Norwegian (Norsk nynorsk)\\0\" \\\n  \"Persian (\\331\\201\\330\\247\\330\\261\\330\\263\\333\\214)\\0\" \\\n  \"Polish (Polski)\\0\" \\\n  \"Portuguese - Brazil (Portugu\\303\\252s)\\0\" \\\n  \"Portuguese - Portugal (Portugu\\303\\252s)\\0\" \\\n  \"Romanian (Rom\\303\\242n\\304\\203)\\0\" \\\n  \"Russian (\\320\\240\\321\\203\\321\\201\\321\\201\\320\\272\\320\\270\\320\\271)\\0\" \\\n  \"Serbian (Cyrillic)\\0\" \\\n  \"Serbian (Latin)\\0\" \\\n  \"Slovak (Sloven\\304\\215ina)\\0\" \\\n  \"Slovenian (Sloven\\305\\241\\304\\215ina)\\0\" \\\n  \"Spanish (Espa\\303\\261ol)\\0\" \\\n  \"Swedish (Svenska)\\0\" \\\n  \"Tamil (\\340\\256\\244\\340\\256\\256\\340\\256\\277\\340\\256\\264\\340\\257\\215)\\0\" \\\n  \"Turkish (T\\303\\274rk\\303\\247e)\\0\" \\\n  \"Ukrainian (\\320\\243\\320\\272\\321\\200\\320\\260\\321\\227\\320\\275\\321\\201\\321\\214\\320\\272\\320\\260)\\0\" \\\n  \"Uzbek (O'zbek)\\0\" \\\n  \"Vietnamese (Vi\\341\\273\\207t Nam)\\0\" \\\n  \"Welsh (Cymraeg)\\0\" \"\\0\";\n\n// from http://msdn.microsoft.com/en-us/library/windows/desktop/dd318693(v=vs.85).aspx\n// those definition are not present in 7.0A SDK my VS 2010 uses\n#ifndef LANG_CENTRAL_KURDISH\n#define LANG_CENTRAL_KURDISH 0x92\n#endif\n\n#ifndef SUBLANG_CENTRAL_KURDISH_CENTRAL_KURDISH_IRAQ\n#define SUBLANG_CENTRAL_KURDISH_CENTRAL_KURDISH_IRAQ 0x01\n#endif\n\n#define _LANGID(lang) MAKELANGID(lang, SUBLANG_NEUTRAL)\nconst LANGID gLangIds[LANGS_COUNT] = {\n  _LANGID(LANG_ENGLISH),\n  _LANGID(LANG_ALBANIAN),\n  _LANGID(LANG_ARABIC),\n  _LANGID(LANG_ARMENIAN),\n  _LANGID(LANG_AZERI),\n  _LANGID(LANG_BASQUE),\n  MAKELANGID(LANG_BOSNIAN, SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN),\n  _LANGID(LANG_BULGARIAN),\n  _LANGID(LANG_CATALAN),\n  (LANGID)-1,\n  MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED),\n  MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL),\n  _LANGID(LANG_CROATIAN),\n  _LANGID(LANG_CZECH),\n  _LANGID(LANG_DANISH),\n  _LANGID(LANG_DUTCH),\n  _LANGID(LANG_ESTONIAN),\n  _LANGID(LANG_FINNISH),\n  _LANGID(LANG_FRENCH),\n  _LANGID(LANG_GALICIAN),\n  _LANGID(LANG_GERMAN),\n  _LANGID(LANG_GREEK),\n  _LANGID(LANG_HEBREW),\n  _LANGID(LANG_HUNGARIAN),\n  _LANGID(LANG_INDONESIAN),\n  _LANGID(LANG_IRISH),\n  _LANGID(LANG_ITALIAN),\n  _LANGID(LANG_JAPANESE),\n  _LANGID(LANG_KOREAN),\n  MAKELANGID(LANG_CENTRAL_KURDISH, SUBLANG_CENTRAL_KURDISH_CENTRAL_KURDISH_IRAQ),\n  _LANGID(LANG_LATVIAN),\n  _LANGID(LANG_MACEDONIAN),\n  _LANGID(LANG_MALAY),\n  MAKELANGID(LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL),\n  MAKELANGID(LANG_NORWEGIAN, SUBLANG_NORWEGIAN_NYNORSK),\n  _LANGID(LANG_FARSI),\n  _LANGID(LANG_POLISH),\n  MAKELANGID(LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN),\n  _LANGID(LANG_PORTUGUESE),\n  _LANGID(LANG_ROMANIAN),\n  _LANGID(LANG_RUSSIAN),\n  MAKELANGID(LANG_SERBIAN, SUBLANG_SERBIAN_CYRILLIC),\n  MAKELANGID(LANG_SERBIAN, SUBLANG_SERBIAN_LATIN),\n  _LANGID(LANG_SLOVAK),\n  _LANGID(LANG_SLOVENIAN),\n  _LANGID(LANG_SPANISH),\n  _LANGID(LANG_SWEDISH),\n  _LANGID(LANG_TAMIL),\n  _LANGID(LANG_TURKISH),\n  _LANGID(LANG_UKRAINIAN),\n  _LANGID(LANG_UZBEK),\n  _LANGID(LANG_VIETNAMESE),\n  _LANGID(LANG_WELSH)\n};\n#undef _LANGID\n\nbool IsLangRtl(int idx)\n{\n  return (2 == idx) || (22 == idx) || (29 == idx) || (35 == idx);\n}\n\nint gLangsCount = LANGS_COUNT;\nint gStringsCount = STRINGS_COUNT;\n\nconst LANGID *GetLangIds() { return &gLangIds[0]; }\n\n} // namespace trans\n"
  },
  {
    "path": "src/installer/Uninstall.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// Note: this is not built by itself but included in Installer.cpp\r\n#ifndef BUILD_UNINSTALLER\r\n#error \"BUILD_UNINSTALLER must be defined!!!\"\r\n#endif\r\n\r\n#define UNINSTALLER_WIN_DX  INSTALLER_WIN_DX\r\n#define UNINSTALLER_WIN_DY  INSTALLER_WIN_DY\r\n\r\n// Try harder getting temporary directory\r\n// Caller needs to free() the result.\r\n// Returns nullptr if fails for any reason.\r\nstatic WCHAR *GetValidTempDir()\r\n{\r\n    ScopedMem<WCHAR> d(path::GetTempPath());\r\n    if (!d) {\r\n        NotifyFailed(_TR(\"Couldn't obtain temporary directory\"));\r\n        return nullptr;\r\n    }\r\n    bool ok = dir::Create(d);\r\n    if (!ok) {\r\n        LogLastError();\r\n        NotifyFailed(_TR(\"Couldn't create temporary directory\"));\r\n        return nullptr;\r\n    }\r\n    return d.StealData();\r\n}\r\n\r\nstatic WCHAR *GetTempUninstallerPath()\r\n{\r\n    ScopedMem<WCHAR> tempDir(GetValidTempDir());\r\n    if (!tempDir)\r\n        return nullptr;\r\n    // Using fixed (unlikely) name instead of GetTempFileName()\r\n    // so that we don't litter temp dir with copies of ourselves\r\n    return path::Join(tempDir, L\"sum~inst.exe\");\r\n}\r\n\r\nBOOL IsUninstallerNeeded()\r\n{\r\n    ScopedMem<WCHAR> exePath(GetInstalledExePath());\r\n    return file::Exists(exePath);\r\n}\r\n\r\nstatic bool RemoveUninstallerRegistryInfo(HKEY hkey)\r\n{\r\n    bool ok1 = DeleteRegKey(hkey, REG_PATH_UNINST);\r\n    // legacy, this key was added by installers up to version 1.8\r\n    bool ok2 = DeleteRegKey(hkey, L\"Software\\\\\" APP_NAME_STR);\r\n    return ok1 && ok2;\r\n}\r\n\r\n/* Undo what DoAssociateExeWithPdfExtension() in AppTools.cpp did */\r\nstatic void UnregisterFromBeingDefaultViewer(HKEY hkey)\r\n{\r\n    ScopedMem<WCHAR> curr(ReadRegStr(hkey, REG_CLASSES_PDF, nullptr));\r\n    ScopedMem<WCHAR> prev(ReadRegStr(hkey, REG_CLASSES_APP, L\"previous.pdf\"));\r\n    if (!curr || !str::Eq(curr, APP_NAME_STR)) {\r\n        // not the default, do nothing\r\n    } else if (prev) {\r\n        WriteRegStr(hkey, REG_CLASSES_PDF, nullptr, prev);\r\n    } else {\r\n#pragma warning(push)\r\n#pragma warning(disable : 6387) // silence /analyze: '_Param_(3)' could be '0':  this does not adhere to the specification for the function 'SHDeleteValueW'\r\n        SHDeleteValue(hkey, REG_CLASSES_PDF, nullptr);\r\n#pragma warning(pop)\r\n    }\r\n\r\n    // the following settings overrule HKEY_CLASSES_ROOT\\.pdf\r\n    ScopedMem<WCHAR> buf(ReadRegStr(HKEY_CURRENT_USER, REG_EXPLORER_PDF_EXT, PROG_ID));\r\n    if (str::Eq(buf, APP_NAME_STR)) {\r\n        LONG res = SHDeleteValue(HKEY_CURRENT_USER, REG_EXPLORER_PDF_EXT, PROG_ID);\r\n        if (res != ERROR_SUCCESS)\r\n            LogLastError(res);\r\n    }\r\n    buf.Set(ReadRegStr(HKEY_CURRENT_USER, REG_EXPLORER_PDF_EXT, APPLICATION));\r\n    if (str::EqI(buf, EXENAME)) {\r\n        LONG res = SHDeleteValue(HKEY_CURRENT_USER, REG_EXPLORER_PDF_EXT, APPLICATION);\r\n        if (res != ERROR_SUCCESS)\r\n            LogLastError(res);\r\n    }\r\n    buf.Set(ReadRegStr(HKEY_CURRENT_USER, REG_EXPLORER_PDF_EXT L\"\\\\UserChoice\", PROG_ID));\r\n    if (str::Eq(buf, APP_NAME_STR))\r\n        DeleteRegKey(HKEY_CURRENT_USER, REG_EXPLORER_PDF_EXT L\"\\\\UserChoice\", true);\r\n}\r\n\r\nstatic bool DeleteEmptyRegKey(HKEY root, const WCHAR *keyName)\r\n{\r\n    HKEY hkey;\r\n    if (RegOpenKeyEx(root, keyName, 0, KEY_READ, &hkey) != ERROR_SUCCESS)\r\n        return true;\r\n\r\n    DWORD subkeys, values;\r\n    bool isEmpty = false;\r\n    if (RegQueryInfoKey(hkey, nullptr, nullptr, nullptr, &subkeys, nullptr, nullptr,\r\n                        &values, nullptr, nullptr, nullptr, nullptr) == ERROR_SUCCESS) {\r\n        isEmpty = 0 == subkeys && 0 == values;\r\n    }\r\n    RegCloseKey(hkey);\r\n\r\n    if (isEmpty)\r\n        DeleteRegKey(root, keyName);\r\n    return isEmpty;\r\n}\r\n\r\nstatic void RemoveOwnRegistryKeys()\r\n{\r\n    HKEY keys[] = { HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER };\r\n    // remove all keys from both HKLM and HKCU (wherever they exist)\r\n    for (int i = 0; i < dimof(keys); i++) {\r\n        UnregisterFromBeingDefaultViewer(keys[i]);\r\n        DeleteRegKey(keys[i], REG_CLASSES_APP);\r\n        DeleteRegKey(keys[i], REG_CLASSES_APPS);\r\n        SHDeleteValue(keys[i], REG_CLASSES_PDF L\"\\\\OpenWithProgids\", APP_NAME_STR);\r\n\r\n        for (int j = 0; nullptr != gSupportedExts[j]; j++) {\r\n            ScopedMem<WCHAR> keyname(str::Join(L\"Software\\\\Classes\\\\\", gSupportedExts[j], L\"\\\\OpenWithProgids\"));\r\n            SHDeleteValue(keys[i], keyname, APP_NAME_STR);\r\n            DeleteEmptyRegKey(keys[i], keyname);\r\n\r\n            keyname.Set(str::Join(L\"Software\\\\Classes\\\\\", gSupportedExts[j], L\"\\\\OpenWithList\\\\\" EXENAME));\r\n            if (!DeleteRegKey(keys[i], keyname))\r\n                continue;\r\n            // remove empty keys that the installer might have created\r\n            *(WCHAR *)str::FindCharLast(keyname, '\\\\') = '\\0';\r\n            if (!DeleteEmptyRegKey(keys[i], keyname))\r\n                continue;\r\n            *(WCHAR *)str::FindCharLast(keyname, '\\\\') = '\\0';\r\n            DeleteEmptyRegKey(keys[i], keyname);\r\n        }\r\n    }\r\n\r\n    // delete keys written in ListAsDefaultProgramWin10()\r\n    HKEY hkey = HKEY_LOCAL_MACHINE;\r\n    SHDeleteValue(hkey, L\"SOFTWARE\\\\RegisteredApplications\", L\"SumatraPDF\");\r\n    DeleteRegKey(hkey, L\"SOFTWARE\\\\SumatraPDF\\\\Capabilities\");\r\n}\r\n\r\nstatic BOOL RemoveEmptyDirectory(const WCHAR *dir)\r\n{\r\n    WIN32_FIND_DATA findData;\r\n    BOOL success = TRUE;\r\n\r\n    ScopedMem<WCHAR> dirPattern(path::Join(dir, L\"*\"));\r\n    HANDLE h = FindFirstFile(dirPattern, &findData);\r\n    if (h != INVALID_HANDLE_VALUE)\r\n    {\r\n        do {\r\n            ScopedMem<WCHAR> path(path::Join(dir, findData.cFileName));\r\n            DWORD attrs = findData.dwFileAttributes;\r\n            // filter out directories. Even though there shouldn't be any\r\n            // subdirectories, it also filters out the standard \".\" and \"..\"\r\n            if ((attrs & FILE_ATTRIBUTE_DIRECTORY) &&\r\n                !str::Eq(findData.cFileName, L\".\") &&\r\n                !str::Eq(findData.cFileName, L\"..\")) {\r\n                success &= RemoveEmptyDirectory(path);\r\n            }\r\n        } while (FindNextFile(h, &findData) != 0);\r\n        FindClose(h);\r\n    }\r\n\r\n    if (!RemoveDirectory(dir)) {\r\n        DWORD lastError = GetLastError();\r\n        if (ERROR_DIR_NOT_EMPTY != lastError && ERROR_FILE_NOT_FOUND != lastError) {\r\n            LogLastError(lastError);\r\n            success = FALSE;\r\n        }\r\n    }\r\n\r\n    return success;\r\n}\r\n\r\nstatic BOOL RemoveInstalledFiles()\r\n{\r\n    BOOL success = TRUE;\r\n\r\n    for (int i = 0; nullptr != gPayloadData[i].fileName; i++) {\r\n        ScopedMem<WCHAR> relPath(str::conv::FromUtf8(gPayloadData[i].fileName));\r\n        ScopedMem<WCHAR> path(path::Join(gGlobalData.installDir, relPath));\r\n\r\n        if (file::Exists(path))\r\n            success &= DeleteFile(path);\r\n    }\r\n\r\n    RemoveEmptyDirectory(gGlobalData.installDir);\r\n    return success;\r\n}\r\n\r\n// If this is uninstaller and we're running from installation directory,\r\n// copy uninstaller to temp directory and execute from there, exiting\r\n// ourselves. This is needed so that uninstaller can delete itself\r\n// from installation directory and remove installation directory\r\n// If returns TRUE, this is an installer and we sublaunched ourselves,\r\n// so the caller needs to exit\r\nbool ExecuteUninstallerFromTempDir()\r\n{\r\n    // only need to sublaunch if running from installation dir\r\n    ScopedMem<WCHAR> ownDir(path::GetDir(GetOwnPath()));\r\n    ScopedMem<WCHAR> tempPath(GetTempUninstallerPath());\r\n\r\n    // no temp directory available?\r\n    if (!tempPath)\r\n        return false;\r\n\r\n    // not running from the installation directory?\r\n    // (likely a test uninstaller that shouldn't be removed anyway)\r\n    if (!path::IsSame(ownDir, gGlobalData.installDir))\r\n        return false;\r\n\r\n    // already running from temp directory?\r\n    if (path::IsSame(GetOwnPath(), tempPath))\r\n        return false;\r\n\r\n    if (!CopyFile(GetOwnPath(), tempPath, FALSE)) {\r\n        NotifyFailed(_TR(\"Failed to copy uninstaller to temp directory\"));\r\n        return false;\r\n    }\r\n\r\n    ScopedMem<WCHAR> args(str::Format(L\"/d \\\"%s\\\" %s\", gGlobalData.installDir, gGlobalData.silent ? L\"/s\" : L\"\"));\r\n    bool ok = CreateProcessHelper(tempPath, args);\r\n\r\n    // mark the uninstaller for removal at shutdown (note: works only for administrators)\r\n    MoveFileEx(tempPath, nullptr, MOVEFILE_DELAY_UNTIL_REBOOT);\r\n\r\n    return ok;\r\n}\r\n\r\nstatic bool RemoveShortcut(bool allUsers)\r\n{\r\n    ScopedMem<WCHAR> p(GetShortcutPath(allUsers));\r\n    if (!p.Get())\r\n        return false;\r\n    bool ok = DeleteFile(p);\r\n    if (!ok && (ERROR_FILE_NOT_FOUND != GetLastError())) {\r\n        LogLastError();\r\n        return false;\r\n    }\r\n    return true;\r\n}\r\n\r\nDWORD WINAPI UninstallerThread(LPVOID data)\r\n{\r\n    UNUSED(data);\r\n    // also kill the original uninstaller, if it's just spawned\r\n    // a DELETE_ON_CLOSE copy from the temp directory\r\n    WCHAR *exePath = GetUninstallerPath();\r\n    if (!path::IsSame(exePath, GetOwnPath()))\r\n        KillProcess(exePath, TRUE);\r\n    free(exePath);\r\n\r\n    if (!RemoveUninstallerRegistryInfo(HKEY_LOCAL_MACHINE) &&\r\n        !RemoveUninstallerRegistryInfo(HKEY_CURRENT_USER)) {\r\n        NotifyFailed(_TR(\"Failed to delete uninstaller registry keys\"));\r\n    }\r\n\r\n    if (!RemoveShortcut(true) && !RemoveShortcut(false))\r\n        NotifyFailed(_TR(\"Couldn't remove the shortcut\"));\r\n\r\n    UninstallBrowserPlugin();\r\n    UninstallPdfFilter();\r\n    UninstallPdfPreviewer();\r\n    RemoveOwnRegistryKeys();\r\n\r\n    if (!RemoveInstalledFiles())\r\n        NotifyFailed(_TR(\"Couldn't remove installation directory\"));\r\n\r\n    // always succeed, even for partial uninstallations\r\n    gGlobalData.success = true;\r\n\r\n    if (!gGlobalData.silent)\r\n        PostMessage(gHwndFrame, WM_APP_INSTALLATION_FINISHED, 0, 0);\r\n    return 0;\r\n}\r\n\r\nstatic void OnButtonUninstall()\r\n{\r\n    KillSumatra();\r\n\r\n    if (!CheckInstallUninstallPossible())\r\n        return;\r\n\r\n    // disable the button during uninstallation\r\n    EnableWindow(gHwndButtonInstUninst, FALSE);\r\n    SetMsg(_TR(\"Uninstallation in progress...\"), COLOR_MSG_INSTALLATION);\r\n    InvalidateFrame();\r\n\r\n    gGlobalData.hThread = CreateThread(nullptr, 0, UninstallerThread, nullptr, 0, 0);\r\n}\r\n\r\nvoid OnUninstallationFinished()\r\n{\r\n    DestroyWindow(gHwndButtonInstUninst);\r\n    gHwndButtonInstUninst = nullptr;\r\n    CreateButtonExit(gHwndFrame);\r\n    SetMsg(_TR(\"SumatraPDF has been uninstalled.\"), gMsgError ? COLOR_MSG_FAILED : COLOR_MSG_OK);\r\n    gMsgError = gGlobalData.firstError;\r\n    InvalidateFrame();\r\n\r\n    CloseHandle(gGlobalData.hThread);\r\n}\r\n\r\nbool OnWmCommand(WPARAM wParam)\r\n{\r\n    switch (LOWORD(wParam))\r\n    {\r\n        case IDOK:\r\n            if (gHwndButtonInstUninst)\r\n                OnButtonUninstall();\r\n            else if (gHwndButtonExit)\r\n                OnButtonExit();\r\n            break;\r\n\r\n        case ID_BUTTON_EXIT:\r\n        case IDCANCEL:\r\n            OnButtonExit();\r\n            break;\r\n\r\n        default:\r\n            return false;\r\n    }\r\n    return true;\r\n}\r\n\r\nvoid OnCreateWindow(HWND hwnd)\r\n{\r\n    gHwndButtonInstUninst = CreateDefaultButton(hwnd, _TR(\"Uninstall SumatraPDF\"), IDOK);\r\n}\r\n\r\nvoid CreateMainWindow()\r\n{\r\n    ScopedMem<WCHAR> title(str::Format(_TR(\"SumatraPDF %s Uninstaller\"), CURR_VERSION_STR));\r\n    gHwndFrame = CreateWindow(\r\n        INSTALLER_FRAME_CLASS_NAME, title.Get(),\r\n        WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU,\r\n        CW_USEDEFAULT, CW_USEDEFAULT,\r\n        dpiAdjust(INSTALLER_WIN_DX), dpiAdjust(INSTALLER_WIN_DY),\r\n        nullptr, nullptr,\r\n        GetModuleHandle(nullptr), nullptr);\r\n}\r\n\r\nvoid ShowUsage()\r\n{\r\n    // Note: translation services aren't initialized at this point, so English only\r\n    MessageBox(nullptr, L\"uninstall.exe [/s][/d <path>]\\n\\\r\n    \\n\\\r\n    /s\\tuninstalls \" APP_NAME_STR L\" silently (without user interaction).\\n\\\r\n    /d\\tchanges the directory from where \" APP_NAME_STR L\" will be uninstalled.\",\r\n    APP_NAME_STR L\" Uninstaller Usage\", MB_OK | MB_ICONINFORMATION);\r\n}\r\n"
  },
  {
    "path": "src/libmupdf.def",
    "content": "; This file is auto-generated by gen_libmupdf.def.py\r\n\r\nLIBRARY libmupdf\r\nEXPORTS\r\n\r\n; Fitz exports\r\n\r\n\r\n\tfz_keep_bitmap\r\n\tfz_drop_bitmap\r\n\tfz_halftone_pixmap\r\n\tfz_new_bitmap\r\n\tfz_bitmap_details\r\n\tfz_clear_bitmap\r\n\tfz_new_halftone\r\n\tfz_default_halftone\r\n\tfz_drop_halftone\r\n\tfz_keep_halftone\r\n\tfz_keep_buffer\r\n\tfz_drop_buffer\r\n\tfz_buffer_storage\r\n\tfz_new_buffer\r\n\tfz_new_buffer_from_data\r\n\tfz_resize_buffer\r\n\tfz_grow_buffer\r\n\tfz_trim_buffer\r\n\tfz_buffer_cat\r\n\tfz_write_buffer\r\n\tfz_write_buffer_byte\r\n\tfz_write_buffer_rune\r\n\tfz_write_buffer_bits\r\n\tfz_write_buffer_pad\r\n\tfz_buffer_printf\r\n\tfz_buffer_vprintf\r\n\tfz_lookup_device_colorspace\r\n\tfz_colorspace_is_indexed\r\n\tfz_device_gray\r\n\tfz_device_rgb\r\n\tfz_device_bgr\r\n\tfz_device_cmyk\r\n\tfz_set_device_gray\r\n\tfz_set_device_rgb\r\n\tfz_set_device_bgr\r\n\tfz_set_device_cmyk\r\n\tfz_new_colorspace\r\n\tfz_new_indexed_colorspace\r\n\tfz_keep_colorspace\r\n\tfz_drop_colorspace\r\n\tfz_free_colorspace_imp\r\n\tfz_convert_color\r\n\tfz_new_colorspace_context\r\n\tfz_keep_colorspace_context\r\n\tfz_drop_colorspace_context\r\n\tfz_lookup_color_converter\r\n\tfz_init_cached_color_converter\r\n\tfz_fin_cached_color_converter\r\n\tfz_keep_transfer_function\r\n\tfz_drop_transfer_function\r\n\tfz_compressed_buffer_size\r\n\tfz_open_compressed_buffer\r\n\tfz_open_image_decomp_stream_from_buffer\r\n\tfz_open_image_decomp_stream\r\n\tfz_free_compressed_buffer\r\n\tfz_var_imp\r\n\tfz_push_try\r\n\tfz_throw_imp\r\n\tfz_rethrow\r\n\tfz_rethrow_message_imp\r\n\tfz_warn_imp\r\n\tfz_caught_message\r\n\tfz_caught\r\n\tfz_rethrow_if\r\n\tfz_flush_warnings\r\n\tfz_new_context_imp\r\n\tfz_clone_context\r\n\tfz_free_context\r\n\tfz_aa_level\r\n\tfz_set_aa_level\r\n\tfz_malloc\r\n\tfz_calloc\r\n\tfz_malloc_array\r\n\tfz_resize_array\r\n\tfz_strdup\r\n\tfz_free\r\n\tfz_malloc_no_throw\r\n\tfz_calloc_no_throw\r\n\tfz_malloc_array_no_throw\r\n\tfz_resize_array_no_throw\r\n\tfz_strdup_no_throw\r\n\tfz_gen_id\r\n\tfz_clone_context_internal\r\n\tfz_new_aa_context\r\n\tfz_free_aa_context\r\n\tfz_copy_aa_context\r\n\tfz_md5_init\r\n\tfz_md5_update\r\n\tfz_md5_final\r\n\tfz_sha256_init\r\n\tfz_sha256_update\r\n\tfz_sha256_final\r\n\tfz_sha512_init\r\n\tfz_sha512_update\r\n\tfz_sha512_final\r\n\tfz_sha384_init\r\n\tfz_sha384_update\r\n\tfz_sha384_final\r\n\tfz_arc4_init\r\n\tfz_arc4_encrypt\r\n\taes_setkey_enc\r\n\taes_setkey_dec\r\n\taes_crypt_cbc\r\n\tfz_lookup_blendmode\r\n\tfz_blendmode_name\r\n\tfz_rebind_device\r\n\tfz_begin_page\r\n\tfz_end_page\r\n\tfz_fill_path\r\n\tfz_stroke_path\r\n\tfz_clip_path\r\n\tfz_clip_stroke_path\r\n\tfz_fill_text\r\n\tfz_stroke_text\r\n\tfz_clip_text\r\n\tfz_clip_stroke_text\r\n\tfz_ignore_text\r\n\tfz_pop_clip\r\n\tfz_fill_shade\r\n\tfz_fill_image\r\n\tfz_fill_image_mask\r\n\tfz_clip_image_mask\r\n\tfz_begin_mask\r\n\tfz_end_mask\r\n\tfz_begin_group\r\n\tfz_end_group\r\n\tfz_begin_tile\r\n\tfz_begin_tile_id\r\n\tfz_end_tile\r\n\tfz_apply_transfer_function\r\n\tfz_new_device\r\n\tfz_free_device\r\n\tfz_enable_device_hints\r\n\tfz_disable_device_hints\r\n\tfz_new_trace_device\r\n\tfz_new_bbox_device\r\n\tfz_new_draw_device\r\n\tfz_new_draw_device_with_bbox\r\n\tfz_new_draw_device_type3\r\n\tfz_new_display_list\r\n\tfz_new_list_device\r\n\tfz_run_display_list\r\n\tfz_keep_display_list\r\n\tfz_drop_display_list\r\n\r\n\tfz_open_copy\r\n\tfz_open_null\r\n\tfz_open_concat\r\n\tfz_concat_push\r\n\tfz_open_arc4\r\n\tfz_open_aesd\r\n\tfz_open_a85d\r\n\tfz_open_ahxd\r\n\tfz_open_rld\r\n\tfz_open_dctd\r\n\tfz_open_faxd\r\n\tfz_open_flated\r\n\tfz_open_lzwd\r\n\tfz_open_predict\r\n\tfz_open_jbig2d\r\n\tfz_load_jbig2_globals\r\n\tfz_free_jbig2_globals_imp\r\n\tft_error_string\r\n\tfz_new_font_context\r\n\tfz_keep_font_context\r\n\tfz_drop_font_context\r\n\tfz_install_load_system_font_funcs\r\n\tfz_load_system_font\r\n\tfz_load_system_cjk_font\r\n\tfz_new_type3_font\r\n\tfz_new_font_from_memory\r\n\tfz_new_font_from_buffer\r\n\tfz_new_font_from_file\r\n\tfz_keep_font\r\n\tfz_drop_font\r\n\tfz_set_font_bbox\r\n\tfz_bound_glyph\r\n\tfz_glyph_cacheable\r\n\tfz_run_t3_glyph\r\n\tfz_decouple_type3_font\r\n\tfz_advance_glyph\r\n\tfz_encode_character\r\n\tfz_eval_function\r\n\tfz_keep_function\r\n\tfz_drop_function\r\n\tfz_function_size\r\n\tfz_getopt\r\n\tfz_new_glyph_cache_context\r\n\tfz_keep_glyph_cache\r\n\tfz_drop_glyph_cache_context\r\n\tfz_purge_glyph_cache\r\n\tfz_outline_ft_glyph\r\n\tfz_outline_glyph\r\n\tfz_render_ft_glyph\r\n\tfz_render_ft_glyph_pixmap\r\n\tfz_render_t3_glyph\r\n\tfz_render_t3_glyph_pixmap\r\n\tfz_render_ft_stroked_glyph\r\n\tfz_render_ft_stroked_glyph_pixmap\r\n\tfz_render_glyph\r\n\tfz_render_glyph_pixmap\r\n\tfz_render_stroked_glyph\r\n\tfz_render_stroked_glyph_pixmap\r\n\tfz_render_t3_glyph_direct\r\n\tfz_prepare_t3_glyph\r\n\tfz_dump_glyph_cache_stats\r\n\tfz_subpixel_adjust\r\n\tfz_glyph_bbox\r\n\tfz_glyph_width\r\n\tfz_glyph_height\r\n\tfz_new_glyph_from_pixmap\r\n\tfz_new_glyph_from_8bpp_data\r\n\tfz_keep_glyph\r\n\tfz_drop_glyph\r\n\tfz_glyph_bbox_no_ctx\r\n\tfz_new_hash_table\r\n\tfz_empty_hash\r\n\tfz_free_hash\r\n\tfz_hash_find\r\n\tfz_hash_insert\r\n\tfz_hash_insert_with_pos\r\n\tfz_hash_remove\r\n\tfz_hash_remove_fast\r\n\tfz_hash_len\r\n\tfz_hash_get_key\r\n\tfz_hash_get_val\r\n\tfz_new_pixmap_from_image\r\n\tfz_drop_image\r\n\tfz_keep_image\r\n\tfz_new_image\r\n\tfz_new_image_from_pixmap\r\n\tfz_new_image_from_data\r\n\tfz_new_image_from_buffer\r\n\tfz_image_get_pixmap\r\n\tfz_free_image\r\n\tfz_decomp_image_from_stream\r\n\tfz_expand_indexed_pixmap\r\n\tfz_load_jpx\r\n\tfz_load_png\r\n\tfz_load_tiff\r\n\tfz_load_jxr\r\n\tfz_load_jpeg_info\r\n\tfz_load_png_info\r\n\tfz_load_tiff_info\r\n\tfz_load_jxr_info\r\n\tfz_load_tiff_subimage_count\r\n\tfz_load_tiff_subimage\r\n\tfz_new_link\r\n\tfz_keep_link\r\n\tfz_drop_link\r\n\tfz_free_link_dest\r\n\tfz_atof\r\n\tfz_atoi\r\n\tfz_concat\r\n\tfz_scale\r\n\tfz_pre_scale\r\n\tfz_shear\r\n\tfz_pre_shear\r\n\tfz_rotate\r\n\tfz_pre_rotate\r\n\tfz_translate\r\n\tfz_pre_translate\r\n\tfz_invert_matrix\r\n\tfz_is_rectilinear\r\n\tfz_matrix_expansion\r\n\tfz_intersect_rect\r\n\tfz_intersect_irect\r\n\tfz_union_rect\r\n\tfz_irect_from_rect\r\n\tfz_round_rect\r\n\tfz_rect_from_irect\r\n\tfz_expand_rect\r\n\tfz_include_point_in_rect\r\n\tfz_translate_irect\r\n\tfz_transform_point\r\n\tfz_transform_point_xy\r\n\tfz_transform_vector\r\n\tfz_transform_rect\r\n\tfz_normalize_vector\r\n\tfz_gridfit_matrix\r\n\tfz_matrix_max_expansion\r\n\r\n\tfz_print_outline_xml\r\n\tfz_print_outline\r\n\tfz_free_outline\r\n\r\n\tfz_write_png\r\n\tfz_output_png\r\n\tfz_new_png_from_image\r\n\tfz_new_png_from_pixmap\r\n\tfz_output_png_header\r\n\tfz_output_png_band\r\n\tfz_output_png_trailer\r\n\tfz_write_pnm\r\n\tfz_output_pnm_header\r\n\tfz_output_pnm_band\r\n\tfz_write_pam\r\n\tfz_output_pam_header\r\n\tfz_output_pam_band\r\n\tfz_write_pbm\r\n\r\n\r\n\tfz_write_tga\r\n\tfz_new_output_with_file\r\n\tfz_new_output_to_filename\r\n\tfz_new_output_with_buffer\r\n\tfz_printf\r\n\tfz_puts\r\n\tfz_write\r\n\tfz_putc\r\n\tfz_close_output\r\n\tfz_rebind_output\r\n\tfz_vsnprintf\r\n\tfz_vfprintf\r\n\tfz_snprintf\r\n\tfz_new_path\r\n\tfz_currentpoint\r\n\tfz_moveto\r\n\tfz_lineto\r\n\tfz_curveto\r\n\tfz_curvetov\r\n\tfz_curvetoy\r\n\tfz_closepath\r\n\tfz_free_path\r\n\tfz_transform_path\r\n\tfz_clone_path\r\n\tfz_bound_path\r\n\tfz_adjust_rect_for_stroke\r\n\tfz_new_stroke_state\r\n\tfz_new_stroke_state_with_dash_len\r\n\tfz_keep_stroke_state\r\n\tfz_drop_stroke_state\r\n\tfz_unshare_stroke_state\r\n\tfz_unshare_stroke_state_with_dash_len\r\n\tfz_clone_stroke_state\r\n\tfz_pixmap_bbox\r\n\tfz_pixmap_width\r\n\tfz_pixmap_height\r\n\tfz_new_pixmap\r\n\tfz_new_pixmap_with_bbox\r\n\tfz_new_pixmap_with_data\r\n\tfz_new_pixmap_with_bbox_and_data\r\n\tfz_keep_pixmap\r\n\tfz_drop_pixmap\r\n\tfz_pixmap_colorspace\r\n\tfz_pixmap_components\r\n\tfz_pixmap_samples\r\n\tfz_pixmap_set_resolution\r\n\tfz_clear_pixmap_with_value\r\n\tfz_clear_pixmap_rect_with_value\r\n\tfz_clear_pixmap\r\n\tfz_invert_pixmap\r\n\tfz_tint_pixmap\r\n\tfz_invert_pixmap_rect\r\n\tfz_gamma_pixmap\r\n\tfz_unmultiply_pixmap\r\n\tfz_convert_pixmap\r\n\tfz_free_pixmap_imp\r\n\tfz_copy_pixmap_rect\r\n\tfz_premultiply_pixmap\r\n\tfz_alpha_from_gray\r\n\tfz_pixmap_size\r\n\tfz_scale_pixmap\r\n\tfz_new_scale_cache\r\n\tfz_free_scale_cache\r\n\tfz_scale_pixmap_cached\r\n\tfz_subsample_pixmap\r\n\tfz_pixmap_bbox_no_ctx\r\n\tfz_decode_tile\r\n\tfz_decode_indexed_tile\r\n\tfz_unpack_tile\r\n\tfz_md5_pixmap\r\n\tfz_new_pixmap_from_8bpp_data\r\n\tfz_new_pixmap_from_1bpp_data\r\n\tfz_keep_shade\r\n\tfz_drop_shade\r\n\tfz_free_shade_imp\r\n\tfz_bound_shade\r\n\tfz_paint_shade\r\n\tfz_process_mesh\r\n\tfz_keep_storable\r\n\tfz_drop_storable\r\n\tfz_new_store_context\r\n\tfz_drop_store_context\r\n\tfz_keep_store_context\r\n\tfz_store_item\r\n\tfz_find_item\r\n\tfz_remove_item\r\n\tfz_empty_store\r\n\tfz_store_scavenge\r\n\tfz_shrink_store\r\n\tfz_open_file\r\n\tfz_open_file_w\r\n\tfz_open_fd\r\n\tfz_open_memory\r\n\tfz_open_buffer\r\n\tfz_clone_stream\r\n\tfz_open_leecher\r\n\tfz_close\r\n\tfz_tell\r\n\tfz_seek\r\n\tfz_read\r\n\tfz_read_all\r\n\tfz_read_file\r\n\tfz_stream_meta\r\n\tfz_rebind_stream\r\n\tfz_new_stream\r\n\tfz_keep_stream\r\n\tfz_read_best\r\n\tfz_read_line\r\n\tfz_strsep\r\n\tfz_strlcpy\r\n\tfz_strlcat\r\n\tfz_dirname\r\n\tfz_cleanname\r\n\tfz_chartorune\r\n\tfz_runetochar\r\n\tfz_runelen\r\n\tfz_strtod\r\n\tfz_ftoa\r\n\tfz_text_char_at\r\n\tfz_text_char_bbox\r\n\tfz_new_text_sheet\r\n\tfz_free_text_sheet\r\n\tfz_new_text_page\r\n\tfz_free_text_page\r\n\tfz_analyze_text\r\n\tfz_print_text_sheet\r\n\tfz_print_text_page_html\r\n\tfz_print_text_page_xml\r\n\tfz_print_text_page\r\n\tfz_search_text_page\r\n\tfz_highlight_selection\r\n\tfz_copy_selection\r\n\tfz_new_text_device\r\n\tgettimeofday\r\n\tfz_fopen_utf8\r\n\tfz_utf8_from_wchar\r\n\tfz_wchar_from_utf8\r\n\tfz_fopen_utf8\r\n\tfz_free_argv\r\n\tfz_redirect_io_to_console\r\n\tfz_new_text\r\n\tfz_add_text\r\n\tfz_free_text\r\n\tfz_bound_text\r\n\tfz_clone_text\r\n\tfz_print_text\r\n\tfz_generate_transition\r\n\tfz_tree_lookup\r\n\tfz_tree_insert\r\n\tfz_free_tree\r\n\tfz_debug_tree\r\n\tfz_open_directory\r\n\tfz_open_archive\r\n\tfz_open_archive_with_stream\r\n\tfz_has_archive_entry\r\n\tfz_open_archive_entry\r\n\tfz_read_archive_entry\r\n\tfz_close_archive\r\n\tfz_rebind_archive\r\n\tfz_count_archive_entries\r\n\tfz_list_archive_entry\r\n\r\n\r\n\tfz_parse_xml\r\n\tfz_xml_prev\r\n\tfz_xml_next\r\n\tfz_xml_up\r\n\tfz_xml_down\r\n\tfz_xml_is_tag\r\n\tfz_xml_tag\r\n\tfz_xml_att\r\n\tfz_xml_text\r\n\tfz_free_xml\r\n\tfz_detach_xml\r\n\tfz_debug_xml\r\n\tfz_xml_find\r\n\tfz_xml_find_next\r\n\tfz_xml_find_down\r\n\r\n; MuPDF exports\r\n\r\n\tpdf_first_annot\r\n\tpdf_next_annot\r\n\tpdf_bound_annot\r\n\tpdf_annot_type\r\n\tpdf_run_annot\r\n\tpdf_parse_link_dest\r\n\tpdf_parse_action\r\n\tpdf_lookup_dest\r\n\tpdf_lookup_name\r\n\tpdf_load_name_tree\r\n\tpdf_file_spec_to_str\r\n\tpdf_load_link_annots\r\n\tpdf_transform_annot\r\n\tpdf_load_annots\r\n\tpdf_update_annot\r\n\tpdf_free_annot\r\n\tpdf_create_annot\r\n\tpdf_delete_annot\r\n\tpdf_set_markup_annot_quadpoints\r\n\tpdf_set_ink_annot_list\r\n\tpdf_set_text_annot_position\r\n\tpdf_set_annot_contents\r\n\tpdf_annot_contents\r\n\tpdf_set_free_text_details\r\n\tpdf_annot_obj_type\r\n\r\n\tpdf_new_cmap\r\n\tpdf_keep_cmap\r\n\tpdf_drop_cmap\r\n\tpdf_free_cmap_imp\r\n\tpdf_cmap_size\r\n\tpdf_cmap_wmode\r\n\tpdf_set_cmap_wmode\r\n\tpdf_set_usecmap\r\n\tpdf_add_codespace\r\n\tpdf_map_range_to_table\r\n\tpdf_map_range_to_range\r\n\tpdf_map_one_to_many\r\n\tpdf_sort_cmap\r\n\tpdf_lookup_cmap\r\n\tpdf_lookup_cmap_full\r\n\tpdf_decode_cmap\r\n\tpdf_new_identity_cmap\r\n\tpdf_load_cmap\r\n\tpdf_load_system_cmap\r\n\tpdf_load_builtin_cmap\r\n\tpdf_load_embedded_cmap\r\n\tpdf_new_crypt\r\n\tpdf_free_crypt\r\n\tpdf_crypt_obj\r\n\tpdf_open_crypt\r\n\tpdf_open_crypt_with_filter\r\n\tpdf_crypt_version\r\n\tpdf_crypt_revision\r\n\tpdf_crypt_method\r\n\tpdf_crypt_length\r\n\tpdf_crypt_key\r\n\tpdf_keep_signer\r\n\tpdf_drop_signer\r\n\tpdf_write_digest\r\n\tpdf_check_signature\r\n\tpdf_open_document\r\n\tpdf_open_document_with_stream\r\n\tpdf_open_document_no_run\r\n\tpdf_open_document_no_run_with_stream\r\n\tpdf_close_document\r\n\tpdf_specifics\r\n\tpdf_needs_password\r\n\tpdf_authenticate_password\r\n\tpdf_has_permission\r\n\tpdf_meta\r\n\tpdf_load_outline\r\n\tpdf_create_document\r\n\tpdf_create_page\r\n\tpdf_insert_page\r\n\tpdf_delete_page\r\n\tpdf_delete_page_range\r\n\tpdf_page_write\r\n\tpdf_finish_edit\r\n\tpdf_recognize\r\n\r\n\tpdf_get_string_or_stream\r\n\tpdf_get_inheritable\r\n\tpdf_get_field_flags\r\n\tpdf_field_type\r\n\tpdf_set_field_type\r\n\tpdf_field_value\r\n\tpdf_load_encoding\r\n\tpdf_lookup_agl\r\n\tpdf_set_font_wmode\r\n\tpdf_set_default_hmtx\r\n\tpdf_set_default_vmtx\r\n\tpdf_add_hmtx\r\n\tpdf_add_vmtx\r\n\tpdf_end_hmtx\r\n\tpdf_end_vmtx\r\n\tpdf_lookup_hmtx\r\n\tpdf_lookup_vmtx\r\n\tpdf_ft_lookup_vgid\r\n\tpdf_ft_free_vsubst\r\n\tpdf_load_to_unicode\r\n\tpdf_font_cid_to_gid\r\n\tpdf_lookup_builtin_font\r\n\tpdf_lookup_substitute_font\r\n\tpdf_lookup_substitute_cjk_font\r\n\tpdf_load_type3_font\r\n\tpdf_load_type3_glyphs\r\n\tpdf_load_font\r\n\tpdf_load_hail_mary_font\r\n\tpdf_clean_base14_name\r\n\tpdf_install_load_system_font_funcs\r\n\tpdf_new_font_desc\r\n\tpdf_keep_font\r\n\tpdf_drop_font\r\n\tpdf_measure_text\r\n\tpdf_text_stride\r\n\tpdf_run_glyph\r\n\tpdf_enable_js\r\n\tpdf_disable_js\r\n\tpdf_js_supported\r\n\tpdf_js_setup_event\r\n\tpdf_js_get_event\r\n\tpdf_js_execute\r\n\tpdf_js_execute_count\r\n\tpdf_new_null\r\n\tpdf_new_bool\r\n\tpdf_new_int\r\n\tpdf_new_real\r\n\tpdf_new_name\r\n\tpdf_new_string\r\n\tpdf_new_indirect\r\n\tpdf_new_array\r\n\tpdf_new_dict\r\n\tpdf_new_rect\r\n\tpdf_new_matrix\r\n\tpdf_copy_array\r\n\tpdf_copy_dict\r\n\tpdf_new_obj_from_str\r\n\tpdf_keep_obj\r\n\tpdf_drop_obj\r\n\tpdf_is_null\r\n\tpdf_is_bool\r\n\tpdf_is_int\r\n\tpdf_is_real\r\n\tpdf_is_number\r\n\tpdf_is_name\r\n\tpdf_is_string\r\n\tpdf_is_array\r\n\tpdf_is_dict\r\n\tpdf_is_indirect\r\n\tpdf_is_stream\r\n\tpdf_objcmp\r\n\tpdf_obj_marked\r\n\tpdf_mark_obj\r\n\tpdf_unmark_obj\r\n\tpdf_set_obj_memo\r\n\tpdf_obj_memo\r\n\tpdf_obj_is_dirty\r\n\tpdf_dirty_obj\r\n\tpdf_clean_obj\r\n\tpdf_to_bool\r\n\tpdf_to_int\r\n\tpdf_to_real\r\n\tpdf_to_name\r\n\tpdf_to_str_buf\r\n\tpdf_to_dict\r\n\tpdf_to_str_len\r\n\tpdf_to_num\r\n\tpdf_to_gen\r\n\tpdf_array_len\r\n\tpdf_array_get\r\n\tpdf_array_put\r\n\tpdf_array_push\r\n\tpdf_array_push_drop\r\n\tpdf_array_insert\r\n\tpdf_array_insert_drop\r\n\tpdf_array_delete\r\n\tpdf_array_contains\r\n\tpdf_dict_len\r\n\tpdf_dict_get_key\r\n\tpdf_dict_get_val\r\n\tpdf_dict_get\r\n\tpdf_dict_gets\r\n\tpdf_dict_getp\r\n\tpdf_dict_getsa\r\n\tpdf_dict_put\r\n\tpdf_dict_puts\r\n\tpdf_dict_puts_drop\r\n\tpdf_dict_putp\r\n\tpdf_dict_putp_drop\r\n\tpdf_dict_del\r\n\tpdf_dict_dels\r\n\tpdf_sort_dict\r\n\tpdf_set_obj_parent\r\n\tpdf_obj_refs\r\n\tpdf_obj_parent_num\r\n\tpdf_sprint_obj\r\n\tpdf_fprint_obj\r\n\tpdf_output_obj\r\n\tpdf_to_utf8\r\n\tpdf_to_ucs2\r\n\tpdf_to_utf8_name\r\n\tpdf_from_ucs2\r\n\tpdf_to_ucs2_buf\r\n\tpdf_to_rect\r\n\tpdf_to_matrix\r\n\tpdf_get_indirect_document\r\n\tpdf_set_str_len\r\n\tpdf_set_int\r\n\tpdf_new_pdf_device\r\n\tpdf_write_document\r\n\tpdf_localise_page_resources\r\n\tpdf_lookup_page_number\r\n\tpdf_count_pages\r\n\tpdf_lookup_page_obj\r\n\tpdf_lookup_inherited_page_item\r\n\tpdf_load_page\r\n\tpdf_load_page_by_obj\r\n\tpdf_load_links\r\n\tpdf_bound_page\r\n\tpdf_free_page\r\n\tpdf_run_page\r\n\tpdf_run_page_with_usage\r\n\tpdf_run_page_contents\r\n\tpdf_clean_page_contents\r\n\tpdf_page_presentation\r\n\tpdf_lexbuf_init\r\n\tpdf_lexbuf_fin\r\n\tpdf_lexbuf_grow\r\n\tpdf_lex\r\n\tpdf_lex_no_string\r\n\tpdf_parse_array\r\n\tpdf_parse_dict\r\n\tpdf_parse_stm_obj\r\n\tpdf_parse_ind_obj\r\n\tpdf_print_token\r\n\tpdf_store_item\r\n\tpdf_find_item\r\n\tpdf_remove_item\r\n\tpdf_load_function\r\n\tpdf_load_colorspace\r\n\tpdf_is_tint_colorspace\r\n\tpdf_load_shading\r\n\tpdf_load_inline_image\r\n\tpdf_is_jpx_image\r\n\tpdf_load_image\r\n\tpdf_load_pattern\r\n\tpdf_keep_pattern\r\n\tpdf_drop_pattern\r\n\tpdf_load_xobject\r\n\tpdf_new_xobject\r\n\tpdf_keep_xobject\r\n\tpdf_drop_xobject\r\n\tpdf_update_xobject_contents\r\n\tpdf_create_xobject\r\n\r\n\tpdf_create_object\r\n\tpdf_delete_object\r\n\tpdf_update_object\r\n\tpdf_update_stream\r\n\tpdf_cache_object\r\n\tpdf_count_objects\r\n\tpdf_resolve_indirect\r\n\tpdf_load_object\r\n\tpdf_load_raw_stream\r\n\tpdf_load_stream\r\n\tpdf_open_raw_stream\r\n\tpdf_open_stream\r\n\tpdf_open_inline_stream\r\n\tpdf_load_compressed_stream\r\n\tpdf_load_compressed_inline_image\r\n\tpdf_open_stream_with_offset\r\n\tpdf_open_contents_stream\r\n\tpdf_load_raw_renumbered_stream\r\n\tpdf_load_renumbered_stream\r\n\tpdf_open_raw_renumbered_stream\r\n\tpdf_trailer\r\n\tpdf_set_populating_xref_trailer\r\n\tpdf_xref_len\r\n\tpdf_get_populating_xref_entry\r\n\tpdf_get_xref_entry\r\n\tpdf_replace_xref\r\n\tpdf_xref_ensure_incremental_object\r\n\tpdf_xref_is_incremental\r\n\tpdf_repair_xref\r\n\tpdf_repair_obj_stms\r\n\tpdf_new_ref\r\n\tpdf_ensure_solid_xref\r\n\tpdf_mark_xref\r\n\tpdf_clear_xref\r\n\tpdf_clear_xref_to_mark\r\n\tpdf_repair_obj\r\n\tpdf_progressive_advance\r\n\tpdf_print_xref\r\n\r\n; MuXPS exports\r\n\r\n\txps_open_document\r\n\txps_open_document_with_stream\r\n\txps_close_document\r\n\txps_count_pages\r\n\txps_load_page\r\n\txps_bound_page\r\n\txps_run_page\r\n\txps_load_links\r\n\txps_free_page\r\n\txps_load_outline\r\n\txps_strcasecmp\r\n\txps_resolve_url\r\n\txps_url_is_remote\r\n\txps_parse_point\r\n\txps_has_part\r\n\txps_read_part\r\n\txps_free_part\r\n\txps_read_page_list\r\n\txps_print_page_list\r\n\txps_free_page_list\r\n\txps_lookup_link_target\r\n\txps_add_link\r\n\txps_lookup_link_target_obj\r\n\txps_count_font_encodings\r\n\txps_identify_font_encoding\r\n\txps_select_font_encoding\r\n\txps_encode_font_char\r\n\txps_measure_font_glyph\r\n\txps_parse_color\r\n\txps_set_color\r\n\txps_free_resource_dictionary\r\n\txps_resolve_resource_reference\r\n\txps_print_resource_dictionary\r\n\txps_parse_fixed_page\r\n\txps_parse_canvas\r\n\txps_parse_path\r\n\txps_parse_glyphs\r\n\txps_parse_image_brush\r\n\txps_parse_visual_brush\r\n\txps_parse_linear_gradient_brush\r\n\txps_parse_radial_gradient_brush\r\n\txps_parse_tiling_brush\r\n\txps_parse_matrix_transform\r\n\txps_parse_render_transform\r\n\txps_parse_rectangle\r\n\txps_begin_opacity\r\n\txps_end_opacity\r\n\txps_parse_brush\r\n\txps_parse_element\r\n\txps_clip\r\n\txps_lookup_alternate_content\r\n\txps_extract_anchor_info\r\n\r\n; unarr exports (required for ArchUtil, ZipUtil)\r\n\r\n\tar_open_file\r\n\tar_open_file_w\r\n\tar_open_memory\r\n\tar_open_istream\r\n\tar_close\r\n\tar_read\r\n\tar_seek\r\n\tar_skip\r\n\tar_tell\r\n\tar_close_archive\r\n\tar_parse_entry\r\n\tar_parse_entry_at\r\n\tar_parse_entry_for\r\n\tar_at_eof\r\n\tar_entry_get_name\r\n\tar_entry_get_offset\r\n\tar_entry_get_size\r\n\tar_entry_get_filetime\r\n\tar_entry_uncompress\r\n\tar_get_global_comment\r\n\tar_open_rar_archive\r\n\tar_open_tar_archive\r\n\tar_open_zip_archive\r\n\tar_open_7z_archive\r\n\r\n; djvu exports (required for DjVuEngine)\r\n\r\n\tddjvu_anno_get_hyperlinks\r\n\tddjvu_context_create\r\n\tddjvu_context_release\r\n\tddjvu_document_create_by_data\r\n\tddjvu_document_create_by_filename_utf8\r\n\tddjvu_document_get_fileinfo_imp\r\n\tddjvu_document_get_filenum\r\n\tddjvu_document_get_outline\r\n\tddjvu_document_get_pageanno\r\n\tddjvu_document_get_pageinfo_imp\r\n\tddjvu_document_get_pagenum\r\n\tddjvu_document_get_pagetext\r\n\tddjvu_document_job\r\n\tddjvu_format_create\r\n\tddjvu_format_release\r\n\tddjvu_format_set_row_order\r\n\tddjvu_free\r\n\tddjvu_job_release\r\n\tddjvu_job_status\r\n\tddjvu_message_peek\r\n\tddjvu_message_pop\r\n\tddjvu_message_wait\r\n\tddjvu_miniexp_release\r\n\tddjvu_page_create_by_pageno\r\n\tddjvu_page_get_type\r\n\tddjvu_page_job\r\n\tddjvu_page_render\r\n\tddjvu_page_set_rotation\r\n\tddjvu_stream_close\r\n\tddjvu_stream_write\r\n\tminiexp_caddr\r\n\tminiexp_cadr\r\n\tminiexp_cddr\r\n\tminiexp_stringp\r\n\tminiexp_symbol\r\n\tminiexp_to_str\r\n\tminilisp_finish\r\n\r\n; zlib exports (required for ZipUtil, PsEngine, PdfCreator, LzmaSimpleArchive)\r\n\r\n\tcrc32\r\n\tdeflate\r\n\tdeflateEnd\r\n\tdeflateInit_\r\n\tdeflateInit2_\r\n\tgzclose\r\n\tgzerror\r\n\tgzopen\r\n\tgzopen_w\r\n\tgzprintf\r\n\tgzread\r\n\tgzseek\r\n\tgztell\r\n\tinflate\r\n\tinflateEnd\r\n\tinflateInit_\r\n\tinflateInit2_\r\n\r\n; lzma exports (required for LzmaSimpleArchive)\r\n\r\n\tLzmaDecode\r\n\tx86_Convert\r\n\r\n; libwebp exports (required for WebpReader)\r\n\r\n\tWebPDecodeBGRAInto\r\n\tWebPGetInfo\r\n"
  },
  {
    "path": "src/libmupdf.rc",
    "content": "#include <windows.h>\r\n#include \"Version.h\"\r\n\r\nVS_VERSION_INFO    VERSIONINFO     MOVEABLE IMPURE LOADONCALL DISCARDABLE\r\n  FILEVERSION    VER_RESOURCE\r\n  PRODUCTVERSION VER_RESOURCE\r\n  FILEFLAGS     0\r\n  FILEOS        VOS_NT_WINDOWS32\r\n  FILETYPE      VFT_APP\r\n  FILESUBTYPE   0       // not used\r\nBEGIN\r\n  BLOCK \"StringFileInfo\"\r\n  BEGIN\r\n    BLOCK \"040904E4\"\r\n    //language ID = U.S. English, char set = Windows, Multilingual\r\n\r\n    BEGIN\r\n      VALUE \"FileDescription\",  \"MuPDF rendering library, DjVu rendering library and various helper libraries\"\r\n      VALUE \"FileVersion\",      VER_RESOURCE_STR\r\n      VALUE \"LegalCopyright\",   COPYRIGHT_STR\r\n      VALUE \"OriginalFilename\", \"libmupdf.dll\"\r\n      VALUE \"ProductName\",      \"SumatraPDF\"\r\n      VALUE \"ProductVersion\",   VER_RESOURCE_STR\r\n      VALUE \"CompanyName\",      \"Artifex Software et al.\"\r\n    END\r\n  END\r\n  BLOCK \"VarFileInfo\"\r\n  BEGIN\r\n    VALUE \"Translation\", 0x0409, 1252\r\n  END\r\nEND\r\n"
  },
  {
    "path": "src/memtrace/MemTrace.rc",
    "content": "#include <windows.h>\r\n\r\nVS_VERSION_INFO    VERSIONINFO     MOVEABLE IMPURE LOADONCALL DISCARDABLE\r\n  FILEVERSION     1.0\r\n  PRODUCTVERSION  1.0\r\n  FILEFLAGS       0\r\n  FILEOS          VOS_NT_WINDOWS32\r\n  FILETYPE        VFT_DLL\r\n  FILESUBTYPE     0       // not used\r\nBEGIN\r\n  BLOCK \"StringFileInfo\"\r\n  BEGIN\r\n    BLOCK \"040904E4\"\r\n    //language ID = U.S. English, char set = Windows, Multilingual\r\n\r\n    BEGIN\r\n      VALUE \"FileDescription\",  \"MemTrace\"\r\n      VALUE \"FileVersion\",      \"1.0\"\r\n      VALUE \"LegalCopyright\",   \"Copyright 2012-2014 all authors (BSD)\"\r\n      VALUE \"OriginalFilename\", \"memtrace.dll\"\r\n      VALUE \"ProductName\",      \"MemTrace\"\r\n      VALUE \"ProductVersion\",   \"1.0\"\r\n      VALUE \"CompanyName\",      \"http://blog.kowalczyk.info\"\r\n    END\r\n  END\r\n  BLOCK \"VarFileInfo\"\r\n  BEGIN\r\n    VALUE \"Translation\", 0x0409, 1252\r\n  END\r\nEND\r\n"
  },
  {
    "path": "src/memtrace/MemTraceCollector/Form1.Designer.cs",
    "content": "﻿namespace MemTraceCollector\r\n{\r\n    partial class Form1\r\n    {\r\n        /// <summary>\r\n        /// Required designer variable.\r\n        /// </summary>\r\n        private System.ComponentModel.IContainer components = null;\r\n\r\n        /// <summary>\r\n        /// Clean up any resources being used.\r\n        /// </summary>\r\n        /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\r\n        protected override void Dispose(bool disposing)\r\n        {\r\n            if (disposing && (components != null))\r\n            {\r\n                components.Dispose();\r\n            }\r\n            base.Dispose(disposing);\r\n        }\r\n\r\n        #region Windows Form Designer generated code\r\n\r\n        /// <summary>\r\n        /// Required method for Designer support - do not modify\r\n        /// the contents of this method with the code editor.\r\n        /// </summary>\r\n        private void InitializeComponent()\r\n        {\r\n            this.btnExit = new System.Windows.Forms.Button();\r\n            this.tbFromClients = new System.Windows.Forms.TextBox();\r\n            this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();\r\n            this.labelConnectionStatus = new System.Windows.Forms.Label();\r\n            this.labelCurrAllocated = new System.Windows.Forms.Label();\r\n            this.labelMessagesInfo = new System.Windows.Forms.Label();\r\n            this.flowLayoutPanel1.SuspendLayout();\r\n            this.SuspendLayout();\r\n            // \r\n            // btnExit\r\n            // \r\n            this.btnExit.AutoSize = true;\r\n            this.btnExit.Dock = System.Windows.Forms.DockStyle.Bottom;\r\n            this.btnExit.Location = new System.Drawing.Point(0, 239);\r\n            this.btnExit.Margin = new System.Windows.Forms.Padding(0);\r\n            this.btnExit.Name = \"btnExit\";\r\n            this.btnExit.Size = new System.Drawing.Size(284, 23);\r\n            this.btnExit.TabIndex = 0;\r\n            this.btnExit.Text = \"Exit\";\r\n            this.btnExit.UseVisualStyleBackColor = true;\r\n            this.btnExit.Click += new System.EventHandler(this.btnExit_Click);\r\n            // \r\n            // tbFromClients\r\n            // \r\n            this.tbFromClients.BackColor = System.Drawing.SystemColors.ActiveCaption;\r\n            this.tbFromClients.Dock = System.Windows.Forms.DockStyle.Fill;\r\n            this.tbFromClients.Location = new System.Drawing.Point(0, 0);\r\n            this.tbFromClients.Margin = new System.Windows.Forms.Padding(0);\r\n            this.tbFromClients.Multiline = true;\r\n            this.tbFromClients.Name = \"tbFromClients\";\r\n            this.tbFromClients.ReadOnly = true;\r\n            this.tbFromClients.Size = new System.Drawing.Size(284, 239);\r\n            this.tbFromClients.TabIndex = 2;\r\n            // \r\n            // flowLayoutPanel1\r\n            // \r\n            this.flowLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) \r\n            | System.Windows.Forms.AnchorStyles.Right)));\r\n            this.flowLayoutPanel1.AutoSize = true;\r\n            this.flowLayoutPanel1.Controls.Add(this.labelConnectionStatus);\r\n            this.flowLayoutPanel1.Controls.Add(this.labelCurrAllocated);\r\n            this.flowLayoutPanel1.Controls.Add(this.labelMessagesInfo);\r\n            this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;\r\n            this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);\r\n            this.flowLayoutPanel1.Name = \"flowLayoutPanel1\";\r\n            this.flowLayoutPanel1.Size = new System.Drawing.Size(221, 39);\r\n            this.flowLayoutPanel1.TabIndex = 3;\r\n            // \r\n            // labelConnectionStatus\r\n            // \r\n            this.labelConnectionStatus.AutoSize = true;\r\n            this.labelConnectionStatus.Dock = System.Windows.Forms.DockStyle.Top;\r\n            this.labelConnectionStatus.Location = new System.Drawing.Point(3, 0);\r\n            this.labelConnectionStatus.Name = \"labelConnectionStatus\";\r\n            this.labelConnectionStatus.Size = new System.Drawing.Size(174, 13);\r\n            this.labelConnectionStatus.TabIndex = 2;\r\n            this.labelConnectionStatus.Text = \"Waiting for connection form client...\";\r\n            // \r\n            // labelCurrAllocated\r\n            // \r\n            this.labelCurrAllocated.AutoSize = true;\r\n            this.labelCurrAllocated.Location = new System.Drawing.Point(3, 13);\r\n            this.labelCurrAllocated.Name = \"labelCurrAllocated\";\r\n            this.labelCurrAllocated.Size = new System.Drawing.Size(97, 13);\r\n            this.labelCurrAllocated.TabIndex = 3;\r\n            this.labelCurrAllocated.Text = \"Currently allocated:\";\r\n            // \r\n            // labelMessagesInfo\r\n            // \r\n            this.labelMessagesInfo.AutoSize = true;\r\n            this.labelMessagesInfo.Location = new System.Drawing.Point(3, 26);\r\n            this.labelMessagesInfo.Name = \"labelMessagesInfo\";\r\n            this.labelMessagesInfo.Size = new System.Drawing.Size(58, 13);\r\n            this.labelMessagesInfo.TabIndex = 4;\r\n            this.labelMessagesInfo.Text = \"Messages:\";\r\n            // \r\n            // Form1\r\n            // \r\n            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r\n            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r\n            this.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;\r\n            this.ClientSize = new System.Drawing.Size(284, 262);\r\n            this.Controls.Add(this.flowLayoutPanel1);\r\n            this.Controls.Add(this.tbFromClients);\r\n            this.Controls.Add(this.btnExit);\r\n            this.Name = \"Form1\";\r\n            this.Text = \"MemTraceCollector\";\r\n            this.Load += new System.EventHandler(this.Form1_Load);\r\n            this.flowLayoutPanel1.ResumeLayout(false);\r\n            this.flowLayoutPanel1.PerformLayout();\r\n            this.ResumeLayout(false);\r\n            this.PerformLayout();\r\n\r\n        }\r\n\r\n        #endregion\r\n\r\n        private System.Windows.Forms.Button btnExit;\r\n        private System.Windows.Forms.TextBox tbFromClients;\r\n        private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;\r\n        private System.Windows.Forms.Label labelConnectionStatus;\r\n        private System.Windows.Forms.Label labelCurrAllocated;\r\n        private System.Windows.Forms.Label labelMessagesInfo;\r\n\r\n    }\r\n}\r\n\r\n"
  },
  {
    "path": "src/memtrace/MemTraceCollector/Form1.cs",
    "content": "﻿using System;\r\nusing System.Collections.Generic;\r\nusing System.ComponentModel;\r\nusing System.Data;\r\nusing System.Drawing;\r\nusing System.IO;\r\nusing System.Runtime.InteropServices;\r\nusing System.Text;\r\nusing System.Threading;\r\nusing System.Windows.Forms;\r\nusing Microsoft.Win32.SafeHandles;\r\nusing NamedPipe;\r\n\r\nnamespace MemTraceCollector\r\n{\r\n    public partial class Form1 : Form\r\n    {\r\n        Server pipeServer;\r\n        const string PIPE_NAME = \"\\\\\\\\.\\\\pipe\\\\MemTraceCollectorPipe\";\r\n        const int BUFFER_SIZE = 4096;\r\n        int messagesSize = 0;\r\n        int messagesCount = 0;\r\n\r\n        public delegate void NewMessageHandler(PipeClient client, byte[] msg);\r\n        public delegate void ClientDisconnectedHandler(PipeClient client);\r\n\r\n        public enum MsgId : ushort {\r\n            AllocData  = 1,\r\n            FreeData = 2,\r\n        };\r\n\r\n        public class PipeClient\r\n        {\r\n            public SafeFileHandle FileHandle;\r\n            public FileStream Stream;\r\n            public event NewMessageHandler NewMessage;\r\n            public event ClientDisconnectedHandler ClientDisconnected;\r\n            public UInt64 CurrAllocated;\r\n            public Dictionary<UInt32, UInt32> CurrAllocsMap = new Dictionary<uint, uint>(16 * 1024);\r\n\r\n            public void NotifyNewMessage(byte[] msg)\r\n            {\r\n                NewMessage(this, msg);\r\n            }\r\n\r\n            public void NotifyClientDisconnected()\r\n            {\r\n                ClientDisconnected(this);\r\n            }\r\n        }\r\n\r\n        private List<PipeClient> clients;\r\n\r\n        public Form1()\r\n        {\r\n            InitializeComponent();\r\n            FormClosed += new FormClosedEventHandler(Form1_FormClosed);\r\n            clients = new List<PipeClient>();\r\n        }\r\n\r\n        void Form1_FormClosed(object sender, FormClosedEventArgs e)\r\n        {\r\n            pipeServer.Stop();\r\n        }\r\n\r\n        // called from the background thread\r\n        void pipeServer_ClientConnected(SafeFileHandle fileHandle)\r\n        {\r\n            this.Invoke(\r\n                new Server.ClientConnectedHandler(ClientConnected), \r\n                new object[] { fileHandle });\r\n        }\r\n\r\n        void ClientConnected(SafeFileHandle fileHandle)\r\n        {\r\n            PipeClient client = new PipeClient();\r\n            client.FileHandle = fileHandle;\r\n            client.Stream = new FileStream(fileHandle, FileAccess.ReadWrite, BUFFER_SIZE, true);\r\n            client.NewMessage += pipeClient_NewMessage;\r\n            client.ClientDisconnected += pipeClient_ClientDisconnected;\r\n            clients.Add(client);\r\n            labelConnectionStatus.Text = String.Format(\"Connected {0} clients\", clients.Count);\r\n            Thread readThread = new Thread(new ParameterizedThreadStart(ClientReadThread));\r\n            readThread.Start(client);\r\n        }\r\n\r\n        void pipeClient_ClientDisconnected(PipeClient client)\r\n        {\r\n            this.Invoke(\r\n                new ClientDisconnectedHandler(ClientDisconnected),\r\n                new object[] { client });\r\n        }\r\n\r\n        void ClientDisconnected(PipeClient client)\r\n        {\r\n            clients.Remove(client);\r\n            labelConnectionStatus.Text = String.Format(\"Connected {0} clients\", clients.Count);\r\n            int allocs = client.CurrAllocsMap.Count;\r\n            ulong currAllocated = client.CurrAllocated;\r\n            labelCurrAllocated.Text = String.Format(\"Currently allocated: {0} in {1} allocations\", currAllocated, allocs);\r\n        }\r\n\r\n        void pipeClient_NewMessage(PipeClient client, byte[] msg)\r\n        {\r\n            this.Invoke(new NewMessageHandler(NewMessage), new object[] { client, msg });\r\n        }\r\n\r\n        void DecodeAllocDataMsg(PipeClient client, byte[] msg)\r\n        {\r\n            UInt32 size = BitConverter.ToUInt32(msg, 2);\r\n            UInt32 addr = BitConverter.ToUInt32(msg, 2 + 4);\r\n            client.CurrAllocated += size;\r\n            client.CurrAllocsMap[addr] = size;\r\n            UpdateCurrAllocated(client.CurrAllocated);\r\n        }\r\n\r\n        void DecodeFreeDataMsg(PipeClient client, byte[] msg)\r\n        {\r\n            UInt32 addr = BitConverter.ToUInt32(msg, 2);\r\n            UInt32 size;\r\n            if (!client.CurrAllocsMap.TryGetValue(addr, out size))\r\n                return;\r\n            client.CurrAllocated -= size;\r\n            client.CurrAllocsMap.Remove(addr);\r\n            UpdateCurrAllocated(client.CurrAllocated);\r\n        }\r\n\r\n        DateTime currAllocatedLastUpdateTime = DateTime.Now;\r\n        void UpdateCurrAllocated(ulong currAllocated)\r\n        {\r\n            TimeSpan diff = DateTime.Now - currAllocatedLastUpdateTime;\r\n            if (diff.TotalMilliseconds < 1000)\r\n                return;\r\n            labelCurrAllocated.Text = String.Format(\"Currently allocated: {0}\", currAllocated);\r\n            currAllocatedLastUpdateTime = DateTime.Now;\r\n        }\r\n\r\n        void DecodeMessage(PipeClient client, byte[] msg)\r\n        {\r\n            MsgId msgId = (MsgId)BitConverter.ToUInt16(msg, 0);\r\n            switch (msgId)\r\n            {\r\n                case MsgId.AllocData:\r\n                    DecodeAllocDataMsg(client, msg);\r\n                    break;\r\n                case MsgId.FreeData:\r\n                    DecodeFreeDataMsg(client, msg);\r\n                    break;\r\n            }\r\n        }\r\n\r\n        DateTime currMessagesCountLastUpdateTime = DateTime.Now;\r\n        void UpdateMessagesCount()\r\n        {\r\n            TimeSpan diff = DateTime.Now - currMessagesCountLastUpdateTime;\r\n            if (diff.TotalMilliseconds < 1000)\r\n                return;\r\n            labelMessagesInfo.Text = String.Format(\"{0} bytes sent in {1} messages\", messagesSize, messagesCount);\r\n            currMessagesCountLastUpdateTime = DateTime.Now;\r\n        }\r\n\r\n        void NewMessage(PipeClient client, byte[] msg)\r\n        {\r\n            messagesCount += 1;\r\n            messagesSize += msg.Length;\r\n            DecodeMessage(client, msg);\r\n            UpdateMessagesCount();\r\n        }\r\n\r\n        void ClientReadThread(object clientObj)\r\n        {\r\n            PipeClient client = (PipeClient)clientObj;\r\n            FileStream stream = client.Stream;\r\n            byte[] buf = new byte[BUFFER_SIZE];\r\n            while (true)\r\n            {\r\n                int bytesRead = 0;\r\n                int msgLen = 0;\r\n                try\r\n                {\r\n                    bytesRead = stream.Read(buf, 0, 2);\r\n                    if (2 != bytesRead)\r\n                    {\r\n                        bytesRead = 0;\r\n                        break;\r\n                    }\r\n                    msgLen = buf[0] + buf[1] * 256;\r\n                    if (msgLen > BUFFER_SIZE)\r\n                    {\r\n                        bytesRead = 0;\r\n                        break;\r\n                    }\r\n                    bytesRead = stream.Read(buf, 0, msgLen);\r\n                    if (bytesRead != msgLen)\r\n                    {\r\n                        bytesRead = 0;\r\n                        break;\r\n                    }\r\n                }\r\n                catch\r\n                {\r\n                    //read error has occurred\r\n                    break;\r\n                }\r\n\r\n                //client has disconnected\r\n                if (bytesRead == 0)\r\n                    break;\r\n\r\n                byte[] msg = new byte[msgLen];\r\n                Array.Copy(buf, msg, msgLen);\r\n                client.NotifyNewMessage(msg);\r\n            }\r\n\r\n            stream.Close();\r\n            client.FileHandle.Close();\r\n            client.NotifyClientDisconnected();\r\n        }\r\n\r\n        private void Form1_Load(object sender, EventArgs e)\r\n        {\r\n            tbFromClients.Text = \"Nothing received from clients yet\";\r\n\r\n            pipeServer = new Server();\r\n            pipeServer.ClientConnected += pipeServer_ClientConnected;\r\n            pipeServer.PipeName = PIPE_NAME;\r\n            pipeServer.Start();\r\n        }\r\n\r\n        private void btnExit_Click(object sender, EventArgs e)\r\n        {\r\n            Application.Exit();\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "src/memtrace/MemTraceCollector/Form1.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<root>\r\n  <!-- \r\n    Microsoft ResX Schema \r\n    \r\n    Version 2.0\r\n    \r\n    The primary goals of this format is to allow a simple XML format \r\n    that is mostly human readable. The generation and parsing of the \r\n    various data types are done through the TypeConverter classes \r\n    associated with the data types.\r\n    \r\n    Example:\r\n    \r\n    ... ado.net/XML headers & schema ...\r\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\r\n    <resheader name=\"version\">2.0</resheader>\r\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\r\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\r\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\r\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\r\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\r\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\r\n    </data>\r\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\r\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\r\n        <comment>This is a comment</comment>\r\n    </data>\r\n                \r\n    There are any number of \"resheader\" rows that contain simple \r\n    name/value pairs.\r\n    \r\n    Each data row contains a name, and value. The row also contains a \r\n    type or mimetype. Type corresponds to a .NET class that support \r\n    text/value conversion through the TypeConverter architecture. \r\n    Classes that don't support this are serialized and stored with the \r\n    mimetype set.\r\n    \r\n    The mimetype is used for serialized objects, and tells the \r\n    ResXResourceReader how to depersist the object. This is currently not \r\n    extensible. For a given mimetype the value must be set accordingly:\r\n    \r\n    Note - application/x-microsoft.net.object.binary.base64 is the format \r\n    that the ResXResourceWriter will generate, however the reader can \r\n    read any of the formats listed below.\r\n    \r\n    mimetype: application/x-microsoft.net.object.binary.base64\r\n    value   : The object must be serialized with \r\n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\r\n            : and then encoded with base64 encoding.\r\n    \r\n    mimetype: application/x-microsoft.net.object.soap.base64\r\n    value   : The object must be serialized with \r\n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\r\n            : and then encoded with base64 encoding.\r\n\r\n    mimetype: application/x-microsoft.net.object.bytearray.base64\r\n    value   : The object must be serialized into a byte array \r\n            : using a System.ComponentModel.TypeConverter\r\n            : and then encoded with base64 encoding.\r\n    -->\r\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\r\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\r\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\r\n      <xsd:complexType>\r\n        <xsd:choice maxOccurs=\"unbounded\">\r\n          <xsd:element name=\"metadata\">\r\n            <xsd:complexType>\r\n              <xsd:sequence>\r\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\r\n              </xsd:sequence>\r\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\r\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\r\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\r\n              <xsd:attribute ref=\"xml:space\" />\r\n            </xsd:complexType>\r\n          </xsd:element>\r\n          <xsd:element name=\"assembly\">\r\n            <xsd:complexType>\r\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\r\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\r\n            </xsd:complexType>\r\n          </xsd:element>\r\n          <xsd:element name=\"data\">\r\n            <xsd:complexType>\r\n              <xsd:sequence>\r\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\r\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\r\n              </xsd:sequence>\r\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\r\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\r\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\r\n              <xsd:attribute ref=\"xml:space\" />\r\n            </xsd:complexType>\r\n          </xsd:element>\r\n          <xsd:element name=\"resheader\">\r\n            <xsd:complexType>\r\n              <xsd:sequence>\r\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\r\n              </xsd:sequence>\r\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\r\n            </xsd:complexType>\r\n          </xsd:element>\r\n        </xsd:choice>\r\n      </xsd:complexType>\r\n    </xsd:element>\r\n  </xsd:schema>\r\n  <resheader name=\"resmimetype\">\r\n    <value>text/microsoft-resx</value>\r\n  </resheader>\r\n  <resheader name=\"version\">\r\n    <value>2.0</value>\r\n  </resheader>\r\n  <resheader name=\"reader\">\r\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r\n  </resheader>\r\n  <resheader name=\"writer\">\r\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r\n  </resheader>\r\n</root>"
  },
  {
    "path": "src/memtrace/MemTraceCollector/MemTraceCollector-vs2010.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <PropertyGroup>\r\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\r\n    <Platform Condition=\" '$(Platform)' == '' \">x86</Platform>\r\n    <ProductVersion>8.0.30703</ProductVersion>\r\n    <SchemaVersion>2.0</SchemaVersion>\r\n    <ProjectGuid>{350213EB-6B6E-4EA2-986E-EE6C64CF4387}</ProjectGuid>\r\n    <OutputType>WinExe</OutputType>\r\n    <AppDesignerFolder>Properties</AppDesignerFolder>\r\n    <RootNamespace>MemTraceCollector</RootNamespace>\r\n    <AssemblyName>MemTraceCollector</AssemblyName>\r\n    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>\r\n    <FileAlignment>512</FileAlignment>\r\n    <PublishUrl>publish\\</PublishUrl>\r\n    <Install>true</Install>\r\n    <InstallFrom>Disk</InstallFrom>\r\n    <UpdateEnabled>false</UpdateEnabled>\r\n    <UpdateMode>Foreground</UpdateMode>\r\n    <UpdateInterval>7</UpdateInterval>\r\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\r\n    <UpdatePeriodically>false</UpdatePeriodically>\r\n    <UpdateRequired>false</UpdateRequired>\r\n    <MapFileExtensions>true</MapFileExtensions>\r\n    <ApplicationRevision>0</ApplicationRevision>\r\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\r\n    <IsWebBootstrapper>false</IsWebBootstrapper>\r\n    <UseApplicationTrust>false</UseApplicationTrust>\r\n    <BootstrapperEnabled>true</BootstrapperEnabled>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|x86' \">\r\n    <PlatformTarget>x86</PlatformTarget>\r\n    <DebugSymbols>true</DebugSymbols>\r\n    <DebugType>full</DebugType>\r\n    <Optimize>false</Optimize>\r\n    <OutputPath>bin\\Debug\\</OutputPath>\r\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|x86' \">\r\n    <PlatformTarget>x86</PlatformTarget>\r\n    <DebugType>pdbonly</DebugType>\r\n    <Optimize>true</Optimize>\r\n    <OutputPath>bin\\Release\\</OutputPath>\r\n    <DefineConstants>TRACE</DefineConstants>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n  </PropertyGroup>\r\n  <ItemGroup>\r\n    <Reference Include=\"System\" />\r\n    <Reference Include=\"System.Data\" />\r\n    <Reference Include=\"System.Deployment\" />\r\n    <Reference Include=\"System.Drawing\" />\r\n    <Reference Include=\"System.Windows.Forms\" />\r\n    <Reference Include=\"System.Xml\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Compile Include=\"Form1.cs\">\r\n      <SubType>Form</SubType>\r\n    </Compile>\r\n    <Compile Include=\"Form1.Designer.cs\">\r\n      <DependentUpon>Form1.cs</DependentUpon>\r\n    </Compile>\r\n    <Compile Include=\"NamedPipeServer.cs\" />\r\n    <Compile Include=\"Program.cs\" />\r\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\r\n    <EmbeddedResource Include=\"Form1.resx\">\r\n      <DependentUpon>Form1.cs</DependentUpon>\r\n    </EmbeddedResource>\r\n    <EmbeddedResource Include=\"Properties\\Resources.resx\">\r\n      <Generator>ResXFileCodeGenerator</Generator>\r\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\r\n      <SubType>Designer</SubType>\r\n    </EmbeddedResource>\r\n    <Compile Include=\"Properties\\Resources.Designer.cs\">\r\n      <AutoGen>True</AutoGen>\r\n      <DependentUpon>Resources.resx</DependentUpon>\r\n    </Compile>\r\n    <None Include=\"Properties\\Settings.settings\">\r\n      <Generator>SettingsSingleFileGenerator</Generator>\r\n      <LastGenOutput>Settings.Designer.cs</LastGenOutput>\r\n    </None>\r\n    <Compile Include=\"Properties\\Settings.Designer.cs\">\r\n      <AutoGen>True</AutoGen>\r\n      <DependentUpon>Settings.settings</DependentUpon>\r\n      <DesignTimeSharedInput>True</DesignTimeSharedInput>\r\n    </Compile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Content Include=\"ProfilingSessions\\Session20120311_160743.sdps\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\r\n      <Visible>False</Visible>\r\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\r\n      <Install>false</Install>\r\n    </BootstrapperPackage>\r\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\r\n      <Visible>False</Visible>\r\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\r\n      <Install>true</Install>\r\n    </BootstrapperPackage>\r\n    <BootstrapperPackage Include=\"Microsoft.Windows.Installer.3.1\">\r\n      <Visible>False</Visible>\r\n      <ProductName>Windows Installer 3.1</ProductName>\r\n      <Install>true</Install>\r\n    </BootstrapperPackage>\r\n  </ItemGroup>\r\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\r\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r\n       Other similar extension points exist, see Microsoft.Common.targets.\r\n  <Target Name=\"BeforeBuild\">\r\n  </Target>\r\n  <Target Name=\"AfterBuild\">\r\n  </Target>\r\n  -->\r\n</Project>"
  },
  {
    "path": "src/memtrace/MemTraceCollector/MemTraceCollector-vs2010.sln",
    "content": "﻿\r\nMicrosoft Visual Studio Solution File, Format Version 11.00\r\n# Visual Studio 2010\r\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"MemTraceCollector\", \"MemTraceCollector-vs2010.csproj\", \"{350213EB-6B6E-4EA2-986E-EE6C64CF4387}\"\r\nEndProject\r\nGlobal\r\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n\t\tDebug|x86 = Debug|x86\r\n\t\tRelease|x86 = Release|x86\r\n\tEndGlobalSection\r\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n\t\t{350213EB-6B6E-4EA2-986E-EE6C64CF4387}.Debug|x86.ActiveCfg = Debug|x86\r\n\t\t{350213EB-6B6E-4EA2-986E-EE6C64CF4387}.Debug|x86.Build.0 = Debug|x86\r\n\t\t{350213EB-6B6E-4EA2-986E-EE6C64CF4387}.Release|x86.ActiveCfg = Release|x86\r\n\t\t{350213EB-6B6E-4EA2-986E-EE6C64CF4387}.Release|x86.Build.0 = Release|x86\r\n\tEndGlobalSection\r\n\tGlobalSection(SolutionProperties) = preSolution\r\n\t\tHideSolutionNode = FALSE\r\n\tEndGlobalSection\r\nEndGlobal\r\n"
  },
  {
    "path": "src/memtrace/MemTraceCollector/NamedPipeServer.cs",
    "content": "﻿using System;\r\nusing System.Collections.Generic;\r\nusing System.Text;\r\nusing System.Runtime.InteropServices;\r\nusing Microsoft.Win32.SafeHandles;\r\nusing System.Threading;\r\nusing System.IO;\r\n\r\nnamespace NamedPipe\r\n{\r\n    class Server\r\n    {\r\n        [DllImport(\"kernel32.dll\", SetLastError = true)]\r\n        public static extern SafeFileHandle CreateNamedPipe(\r\n           String pipeName, uint dwOpenMode, uint dwPipeMode,\r\n           uint nMaxInstances, uint nOutBufferSize, uint nInBufferSize,\r\n           uint nDefaultTimeOut, IntPtr lpSecurityAttributes);\r\n\r\n        [DllImport(\"kernel32.dll\", SetLastError = true)]\r\n        public static extern int ConnectNamedPipe(SafeFileHandle hNamedPipe, IntPtr lpOverlapped);\r\n\r\n        public const uint DUPLEX = 0x00000003;\r\n        public const uint FILE_FLAG_OVERLAPPED = 0x40000000;\r\n\r\n        public delegate void ClientConnectedHandler(SafeFileHandle fileHandle);\r\n\r\n        public event ClientConnectedHandler ClientConnected;\r\n        public const int BUFFER_SIZE = 4096;\r\n\r\n        string  pipeName;\r\n        Thread  listenThread;\r\n        bool    running = false;\r\n        bool    requestedCancel = false;\r\n\r\n        public string PipeName\r\n        {\r\n            get { return this.pipeName; }\r\n            set { this.pipeName = value; }\r\n        }\r\n\r\n        public bool Running\r\n        {\r\n            get { return this.running; }\r\n        }\r\n\r\n        public Server()\r\n        {\r\n        }\r\n\r\n        public void Start()\r\n        {\r\n            this.listenThread = new Thread(new ThreadStart(ListenForClientsWrapper));\r\n            this.listenThread.Start();\r\n\r\n            this.running = true;\r\n        }\r\n\r\n        public void Stop()\r\n        {\r\n            requestedCancel = true;\r\n            // make ConnectNamedPipe() quit\r\n            try\r\n            {\r\n                File.Delete(PipeName);\r\n            }\r\n            catch (IOException)\r\n            {\r\n            }\r\n        }\r\n\r\n        private void ListenForClientsWrapper()\r\n        {\r\n            try\r\n            {\r\n                ListenForClients();\r\n            }\r\n            catch (ThreadAbortException)\r\n            {\r\n            }\r\n        }\r\n\r\n        private void ListenForClients()\r\n        {\r\n            while (true)\r\n            {\r\n                SafeFileHandle clientHandle = CreateNamedPipe(\r\n                     this.pipeName,\r\n                     DUPLEX | FILE_FLAG_OVERLAPPED, 0, 255,\r\n                     BUFFER_SIZE, BUFFER_SIZE, 0, IntPtr.Zero);\r\n\r\n                if (clientHandle.IsInvalid)\r\n                    return;\r\n\r\n                int success = ConnectNamedPipe(clientHandle, IntPtr.Zero);\r\n                if (requestedCancel)\r\n                    return;\r\n\r\n                // could not connect client\r\n                if (success == 0)\r\n                    return;\r\n\r\n                ClientConnected(clientHandle);\r\n            }\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "src/memtrace/MemTraceCollector/Program.cs",
    "content": "﻿using System;\r\nusing System.Collections.Generic;\r\nusing System.Windows.Forms;\r\n\r\nnamespace MemTraceCollector\r\n{\r\n    static class Program\r\n    {\r\n        /// <summary>\r\n        /// The main entry point for the application.\r\n        /// </summary>\r\n        [STAThread]\r\n        static void Main()\r\n        {\r\n            Application.EnableVisualStyles();\r\n            Application.SetCompatibleTextRenderingDefault(false);\r\n            Application.Run(new Form1());\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "src/memtrace/MemTraceCollector/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\r\nusing System.Runtime.CompilerServices;\r\nusing System.Runtime.InteropServices;\r\n\r\n// General Information about an assembly is controlled through the following \r\n// set of attributes. Change these attribute values to modify the information\r\n// associated with an assembly.\r\n[assembly: AssemblyTitle(\"MemTraceCollector\")]\r\n[assembly: AssemblyDescription(\"\")]\r\n[assembly: AssemblyConfiguration(\"\")]\r\n[assembly: AssemblyCompany(\"\")]\r\n[assembly: AssemblyProduct(\"MemTraceCollector\")]\r\n[assembly: AssemblyCopyright(\"Copyright ©  2014\")]\r\n[assembly: AssemblyTrademark(\"\")]\r\n[assembly: AssemblyCulture(\"\")]\r\n\r\n// Setting ComVisible to false makes the types in this assembly not visible \r\n// to COM components.  If you need to access a type in this assembly from \r\n// COM, set the ComVisible attribute to true on that type.\r\n[assembly: ComVisible(false)]\r\n\r\n// The following GUID is for the ID of the typelib if this project is exposed to COM\r\n[assembly: Guid(\"982774d8-d3ae-4fdd-9968-13a5e22a876f\")]\r\n\r\n// Version information for an assembly consists of the following four values:\r\n//\r\n//      Major Version\r\n//      Minor Version \r\n//      Build Number\r\n//      Revision\r\n//\r\n// You can specify all the values or you can default the Build and Revision Numbers \r\n// by using the '*' as shown below:\r\n// [assembly: AssemblyVersion(\"1.0.*\")]\r\n[assembly: AssemblyVersion(\"1.0.0.0\")]\r\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\r\n"
  },
  {
    "path": "src/memtrace/MemTraceCollector/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\r\n// <auto-generated>\r\n//     This code was generated by a tool.\r\n//     Runtime Version:4.0.30319.17379\r\n//\r\n//     Changes to this file may cause incorrect behavior and will be lost if\r\n//     the code is regenerated.\r\n// </auto-generated>\r\n//------------------------------------------------------------------------------\r\n\r\nnamespace MemTraceCollector.Properties\r\n{\r\n\r\n\r\n    /// <summary>\r\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\r\n    /// </summary>\r\n    // This class was auto-generated by the StronglyTypedResourceBuilder\r\n    // class via a tool like ResGen or Visual Studio.\r\n    // To add or remove a member, edit your .ResX file then rerun ResGen\r\n    // with the /str option, or rebuild your VS project.\r\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"4.0.0.0\")]\r\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\r\n    internal class Resources\r\n    {\r\n\r\n        private static global::System.Resources.ResourceManager resourceMan;\r\n\r\n        private static global::System.Globalization.CultureInfo resourceCulture;\r\n\r\n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\r\n        internal Resources()\r\n        {\r\n        }\r\n\r\n        /// <summary>\r\n        ///   Returns the cached ResourceManager instance used by this class.\r\n        /// </summary>\r\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\r\n        internal static global::System.Resources.ResourceManager ResourceManager\r\n        {\r\n            get\r\n            {\r\n                if ((resourceMan == null))\r\n                {\r\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"MemTraceCollector.Properties.Resources\", typeof(Resources).Assembly);\r\n                    resourceMan = temp;\r\n                }\r\n                return resourceMan;\r\n            }\r\n        }\r\n\r\n        /// <summary>\r\n        ///   Overrides the current thread's CurrentUICulture property for all\r\n        ///   resource lookups using this strongly typed resource class.\r\n        /// </summary>\r\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\r\n        internal static global::System.Globalization.CultureInfo Culture\r\n        {\r\n            get\r\n            {\r\n                return resourceCulture;\r\n            }\r\n            set\r\n            {\r\n                resourceCulture = value;\r\n            }\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "src/memtrace/MemTraceCollector/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<root>\r\n  <!-- \r\n    Microsoft ResX Schema \r\n    \r\n    Version 2.0\r\n    \r\n    The primary goals of this format is to allow a simple XML format \r\n    that is mostly human readable. The generation and parsing of the \r\n    various data types are done through the TypeConverter classes \r\n    associated with the data types.\r\n    \r\n    Example:\r\n    \r\n    ... ado.net/XML headers & schema ...\r\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\r\n    <resheader name=\"version\">2.0</resheader>\r\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\r\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\r\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\r\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\r\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\r\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\r\n    </data>\r\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\r\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\r\n        <comment>This is a comment</comment>\r\n    </data>\r\n                \r\n    There are any number of \"resheader\" rows that contain simple \r\n    name/value pairs.\r\n    \r\n    Each data row contains a name, and value. The row also contains a \r\n    type or mimetype. Type corresponds to a .NET class that support \r\n    text/value conversion through the TypeConverter architecture. \r\n    Classes that don't support this are serialized and stored with the \r\n    mimetype set.\r\n    \r\n    The mimetype is used for serialized objects, and tells the \r\n    ResXResourceReader how to depersist the object. This is currently not \r\n    extensible. For a given mimetype the value must be set accordingly:\r\n    \r\n    Note - application/x-microsoft.net.object.binary.base64 is the format \r\n    that the ResXResourceWriter will generate, however the reader can \r\n    read any of the formats listed below.\r\n    \r\n    mimetype: application/x-microsoft.net.object.binary.base64\r\n    value   : The object must be serialized with \r\n            : System.Serialization.Formatters.Binary.BinaryFormatter\r\n            : and then encoded with base64 encoding.\r\n    \r\n    mimetype: application/x-microsoft.net.object.soap.base64\r\n    value   : The object must be serialized with \r\n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\r\n            : and then encoded with base64 encoding.\r\n\r\n    mimetype: application/x-microsoft.net.object.bytearray.base64\r\n    value   : The object must be serialized into a byte array \r\n            : using a System.ComponentModel.TypeConverter\r\n            : and then encoded with base64 encoding.\r\n    -->\r\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\r\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\r\n      <xsd:complexType>\r\n        <xsd:choice maxOccurs=\"unbounded\">\r\n          <xsd:element name=\"metadata\">\r\n            <xsd:complexType>\r\n              <xsd:sequence>\r\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\r\n              </xsd:sequence>\r\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\r\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\r\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\r\n            </xsd:complexType>\r\n          </xsd:element>\r\n          <xsd:element name=\"assembly\">\r\n            <xsd:complexType>\r\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\r\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\r\n            </xsd:complexType>\r\n          </xsd:element>\r\n          <xsd:element name=\"data\">\r\n            <xsd:complexType>\r\n              <xsd:sequence>\r\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\r\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\r\n              </xsd:sequence>\r\n              <xsd:attribute name=\"name\" type=\"xsd:string\" msdata:Ordinal=\"1\" />\r\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\r\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\r\n            </xsd:complexType>\r\n          </xsd:element>\r\n          <xsd:element name=\"resheader\">\r\n            <xsd:complexType>\r\n              <xsd:sequence>\r\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\r\n              </xsd:sequence>\r\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\r\n            </xsd:complexType>\r\n          </xsd:element>\r\n        </xsd:choice>\r\n      </xsd:complexType>\r\n    </xsd:element>\r\n  </xsd:schema>\r\n  <resheader name=\"resmimetype\">\r\n    <value>text/microsoft-resx</value>\r\n  </resheader>\r\n  <resheader name=\"version\">\r\n    <value>2.0</value>\r\n  </resheader>\r\n  <resheader name=\"reader\">\r\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r\n  </resheader>\r\n  <resheader name=\"writer\">\r\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r\n  </resheader>\r\n</root>"
  },
  {
    "path": "src/memtrace/MemTraceCollector/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\r\n// <auto-generated>\r\n//     This code was generated by a tool.\r\n//     Runtime Version:4.0.30319.17379\r\n//\r\n//     Changes to this file may cause incorrect behavior and will be lost if\r\n//     the code is regenerated.\r\n// </auto-generated>\r\n//------------------------------------------------------------------------------\r\n\r\nnamespace MemTraceCollector.Properties\r\n{\r\n\r\n\r\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\r\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"10.0.0.0\")]\r\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase\r\n    {\r\n\r\n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\r\n\r\n        public static Settings Default\r\n        {\r\n            get\r\n            {\r\n                return defaultInstance;\r\n            }\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "src/memtrace/MemTraceCollector/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\r\n<SettingsFile xmlns=\"http://schemas.microsoft.com/VisualStudio/2004/01/settings\" CurrentProfile=\"(Default)\">\r\n  <Profiles>\r\n    <Profile Name=\"(Default)\" />\r\n  </Profiles>\r\n  <Settings />\r\n</SettingsFile>\r\n"
  },
  {
    "path": "src/memtrace/MemTraceDll.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\nLicense: Simplified BSD (see COPYING.BSD) */\r\n\r\n/*\r\nmemtrace.dll enables tracing memory allocations in arbitrary programs.\r\nIt hooks RtlFreeHeap etc. APIs in the process and sends collected information\r\n(allocation address/size, address of freed memory, callstacks if possible etc.)\r\nto an external collection and visualization process via named pipe.\r\n\r\nThe dll can either be injected into arbitrary processes or an app can load it\r\nby itself (easier to integrate than injecting dll).\r\n\r\nIf the collection process doesn't run when memtrace.dll is initialized, we do\r\nnothing.\r\n\r\nThe data sent via named pipe is framed as messages (packets):\r\nuint16  messageLen; // length of the data follows\r\nuint16  msgId;      // determines how the data is to be decoded\r\nbyte    data[];     // bytes for a given message\r\n*/\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"MemTraceDll.h\"\r\n#include \"nsWindowsDllInterceptor.h\"\r\n#include \"Timer.h\"\r\n#include \"WinUtil.h\"\r\n\r\n#define NOLOG 0\r\n#include \"DebugLog.h\"\r\n\r\n#define PIPE_NAME \"\\\\\\\\.\\\\pipe\\\\MemTraceCollectorPipe\"\r\n\r\n#define MIN_BLOCK_SIZE      1024*32\r\n#define MEMCOPY_THRESHOLD   1024\r\n\r\n// a block of memory. data to be sent is appended at the end,\r\n// sending thread consumes the data from the beginning\r\nstruct MemBlock {\r\n    MemBlock *  next;\r\n    size_t      size;\r\n    size_t      used; // includes sent, if used == sent => everything has been sent\r\n    size_t      sent;\r\n\r\n    size_t      Left() const { return size - used; }\r\n    byte *      Data() const { return (byte*)this + sizeof(MemBlock) + used; }\r\n    size_t      UnsentLen() const { return used - sent; }\r\n    byte *      UnsentData() const { return (byte*)this + sizeof(MemBlock) + sent; }\r\n    void        Append(byte *data, size_t len);\r\n    void        Reset() { used = 0; sent = 0; }\r\n    // data follows here\r\n};\r\n\r\nstruct PerThreadData {\r\n    bool        inAlloc;\r\n    bool        inFree;\r\n};\r\n\r\nstatic HANDLE           gModule;\r\n\r\n// heap for doing our allocations\r\nstatic HANDLE           gHeap;\r\n\r\n// tls indes for per-thread data\r\nstatic DWORD            gTlsIndex;\r\n\r\n// unnamed pipe used to send data to the collector client\r\n// it's nullptr if we failed to open the pipe in the first place\r\n// or if we failed to write data to the pipe (e.g. collector\r\n// client exited)\r\nstatic HANDLE           gPipe;\r\n\r\n// Data is written to gCurrBlock. If it's filled up, the block\r\n// is appended to the end of gBlocksToSend.\r\n// Sending thread first sends data from gBlocksToSend and\r\n// if it's empty, from gCurrBlock\r\nstatic MemBlock *       gCurrBlock;\r\nstatic MemBlock *       gBlocksToSend;\r\nstatic MemBlock *       gBlocksFreeList;\r\nstatic int              gBlocksAllocated;\r\n\r\n// protects access to gToSend and gBlocksFreList\r\nstatic CRITICAL_SECTION gMemMutex;\r\n// event that is notified when new data for sending\r\n// is available\r\nstatic HANDLE           gSendThreadEvent;\r\nstatic HANDLE           gSendThread;\r\n\r\nstatic PerThreadData *GetPerThreadData(PerThreadData *threadDataEmergency)\r\n{\r\n    void *data = TlsGetValue(gTlsIndex);\r\n    if (data)\r\n        return (PerThreadData*)data;\r\n    data = HeapAlloc(gHeap, 0, sizeof(PerThreadData));\r\n    if (!data) {\r\n        lf(\"memtrace.dll: failed to allocate PerThreadData\");\r\n        return threadDataEmergency;\r\n    }\r\n    if (!TlsSetValue(gTlsIndex, data)) {\r\n        HeapFree(gHeap, 0, data);\r\n        lf(\"memtrace.dll: TlsSetValue() failed\");\r\n        return threadDataEmergency;\r\n    }\r\n    PerThreadData *tmp = (PerThreadData*)data;\r\n    tmp->inAlloc = false;\r\n    tmp->inFree = false;\r\n    return tmp;\r\n}\r\n\r\n// the caller should ensure that block has enough data\r\nvoid MemBlock::Append(byte *data, size_t len)\r\n{\r\n    ScopedCritSec cs(&gMemMutex);\r\n    CrashIf(len > Left());\r\n    memcpy(Data(), data, len);\r\n    used += len;\r\n    CrashIf(used > size);\r\n}\r\n\r\nstatic void InsertAtEnd(MemBlock **root, MemBlock *el)\r\n{\r\n    CrashIf(el->next);\r\n    if (!*root) {\r\n        *root = el;\r\n        return;\r\n    }\r\n    MemBlock *curr = *root;\r\n    while (curr->next) {\r\n        curr = curr->next;\r\n    }\r\n    MemBlock **lastPtr = &curr;\r\n    CrashIf((*lastPtr)->next);\r\n    (*lastPtr)->next = el;\r\n}\r\n\r\nstatic MemBlock *GetBlock(size_t len)\r\n{\r\n    ScopedCritSec cs(&gMemMutex);\r\n\r\n    // first try current block\r\n    if (gCurrBlock && (gCurrBlock->Left() >= len))\r\n        return gCurrBlock;\r\n\r\n    MemBlock *newBlock;\r\n    size_t dataSize;\r\n    if (gBlocksFreeList && gBlocksFreeList->size >= len) {\r\n        newBlock = gBlocksFreeList;\r\n        dataSize = newBlock->size;\r\n        gBlocksFreeList = gBlocksFreeList->next;\r\n    } else {\r\n        // allocate new block\r\n        dataSize = len;\r\n        if (dataSize < MIN_BLOCK_SIZE)\r\n            dataSize = MIN_BLOCK_SIZE;\r\n        // TODO: have at least 2 MemBlocks allocated as a static memory?\r\n        newBlock = (MemBlock*)HeapAlloc(gHeap, 0, sizeof(MemBlock) + dataSize);\r\n        if (!newBlock) {\r\n            lf(\"memtrace.dll: failed to allocate a block\");\r\n            return nullptr;\r\n        }\r\n    }\r\n\r\n    //lf(\"memtrace.dll: allocated a new block\");\r\n    ++gBlocksAllocated;\r\n    newBlock->next = nullptr;\r\n    newBlock->size = dataSize;\r\n    newBlock->used = 0;\r\n    newBlock->sent = 0;\r\n\r\n    if (gCurrBlock)\r\n        InsertAtEnd(&gBlocksToSend, gCurrBlock);\r\n\r\n    gCurrBlock= newBlock;\r\n    return newBlock;\r\n}\r\n\r\n// put the block on a free list queue\r\n// note: could free the whole free list if it grows too big,\r\n// but then again it shouldn't happen often\r\nstatic void FreeBlock(MemBlock *block)\r\n{\r\n    ScopedCritSec cs(&gMemMutex);\r\n    CrashIf(0 != block->UnsentLen());\r\n    block->next = gBlocksFreeList;\r\n    gBlocksFreeList = block;\r\n}\r\n\r\n// done at the very end so no need to lock\r\nstatic void FreeAllBlocks()\r\n{\r\n    HeapFree(gHeap, 0, gCurrBlock);\r\n    MemBlock *next;\r\n    MemBlock *curr = gBlocksFreeList;\r\n    while (curr) {\r\n        next = curr->next;\r\n        HeapFree(gHeap, 0, curr);\r\n        curr = next;\r\n    }\r\n    curr = gBlocksToSend;\r\n    while (curr) {\r\n        next = curr->next;\r\n        HeapFree(gHeap, 0, curr);\r\n        curr = next;\r\n    }\r\n}\r\n\r\nenum SerializeMsgId {\r\n    AllocDataMsgId  = 1,\r\n    FreeDataMsgId   = 2\r\n};\r\n\r\n// TODO: since we use 32 bits, we don't support 64 builds\r\nstruct AllocData {\r\n    uint32    size;\r\n    uint32    addr;\r\n};\r\n\r\nstruct FreeData {\r\n    uint32    addr;\r\n};\r\n\r\nstruct MemberSerializeInfo {\r\n    enum Type { UInt16, Int32, UInt32, Int64, UInt64, Sentinel };\r\n    Type    type;\r\n    int     offset;\r\n\r\n    bool IsSentinel() const { return Sentinel == type; };\r\n};\r\n\r\nstruct TypeSerializeInfo {\r\n    SerializeMsgId          msgId;\r\n    MemberSerializeInfo *   members;\r\n};\r\n\r\n#define SERIALIZEINFO_SENTINEL { MemberSerializeInfo::Sentinel, 0 }\r\n\r\n// TODO: manually defining serialization info is fine for few types\r\n// but if we get more, this should be auto-generated by e.g. defining\r\n// the types in C# and generating the C descriptions in C# by reflecting\r\n// C# information.\r\nMemberSerializeInfo allocDataSerMemberInfo[] = {\r\n    { MemberSerializeInfo::UInt32, offsetof(AllocData, size) },\r\n    { MemberSerializeInfo::UInt32, offsetof(AllocData, addr) },\r\n    SERIALIZEINFO_SENTINEL\r\n};\r\n\r\nTypeSerializeInfo allocDataTypeInfo = {\r\n    AllocDataMsgId,\r\n    allocDataSerMemberInfo\r\n};\r\n\r\nMemberSerializeInfo freeDataSerMemberInfo[] = {\r\n    { MemberSerializeInfo::UInt32, offsetof(FreeData, addr) },\r\n    SERIALIZEINFO_SENTINEL\r\n};\r\n\r\nTypeSerializeInfo freeDataTypeInfo = {\r\n    FreeDataMsgId,\r\n    freeDataSerMemberInfo\r\n};\r\n\r\n// TODO: we should serialize numbers using variable-length encoding\r\n// like e.g. in snappy.\r\n// Assumes that data points to either int16 or uint16 value. Appends\r\n// serialized data to serOut and returns number of bytes needed to serialize\r\nstatic inline int SerNum16(byte *data, Vec<byte>& serOut)\r\n{\r\n    byte *dataOut = serOut.AppendBlanks(2);\r\n    *dataOut++ = *data++; *dataOut++ = *data++;\r\n    return 2;\r\n}\r\n\r\nstatic inline int SerNum32(byte *data, Vec<byte>& serOut)\r\n{\r\n    byte *dataOut = serOut.AppendBlanks(4);\r\n    *dataOut++ = *data++; *dataOut++ = *data++;\r\n    *dataOut++ = *data++; *dataOut++ = *data++;\r\n    return 4;\r\n}\r\n\r\nstatic inline int SerNum64(byte *data, Vec<byte>& serOut)\r\n{\r\n    byte *dataOut = serOut.AppendBlanks(8);\r\n    *dataOut++ = *data++; *dataOut++ = *data++;\r\n    *dataOut++ = *data++; *dataOut++ = *data++;\r\n    *dataOut++ = *data++; *dataOut++ = *data++;\r\n    *dataOut++ = *data++; *dataOut++ = *data++;\r\n    return 8;\r\n}\r\n\r\n// data is a pointer to a struct being serialized and typeInfo describes\r\n// the struct. res is a result as a stream of bytes\r\nstatic void SerializeType(byte *data, TypeSerializeInfo *typeInfo, Vec<byte>& msg)\r\n{\r\n    msg.Reset();\r\n    // reserve space for the size of the message, which we only know\r\n    // after serializeing the data. We're making an assumption here\r\n    // that serialized data will be smaller than 65k\r\n    // note: we can easily relax that by using uint32 for len\r\n    uint16 *msgLenPtr = (uint16*)msg.AppendBlanks(2);\r\n    uint16 msgId = (uint16)typeInfo->msgId;\r\n    int msgLen = SerNum16((byte*)&msgId, msg);\r\n\r\n    for (MemberSerializeInfo *member = typeInfo->members; !member->IsSentinel(); ++ member) {\r\n        switch (member->type) {\r\n            case MemberSerializeInfo::UInt16:\r\n                msgLen += SerNum16(data + member->offset, msg);\r\n                break;\r\n            case MemberSerializeInfo::Int32:\r\n            case MemberSerializeInfo::UInt32:\r\n                msgLen += SerNum32(data + member->offset, msg);\r\n                break;\r\n            case MemberSerializeInfo::Int64:\r\n            case MemberSerializeInfo::UInt64:\r\n                msgLen += SerNum32(data + member->offset, msg);\r\n                break;\r\n        }\r\n    }\r\n    *msgLenPtr = (uint16)msgLen;\r\n}\r\n\r\nstatic bool OpenPipe()\r\n{\r\n    gPipe = CreateFileA(PIPE_NAME, GENERIC_READ | GENERIC_WRITE,\r\n        0, nullptr, OPEN_EXISTING,\r\n        SECURITY_SQOS_PRESENT | SECURITY_IDENTIFICATION | FILE_FLAG_OVERLAPPED, nullptr);\r\n    if (INVALID_HANDLE_VALUE == gPipe) {\r\n        gPipe = nullptr;\r\n        return false;\r\n    }\r\n    return true;\r\n}\r\n\r\nstatic void ClosePipe()\r\n{\r\n    if (gPipe && (INVALID_HANDLE_VALUE != gPipe))\r\n        CloseHandle(gPipe);\r\n    gPipe = nullptr;\r\n}\r\n\r\nstatic bool WriteToPipe(const byte *s, size_t len)\r\n{\r\n    DWORD written;\r\n    if (!gPipe)\r\n        return false;\r\n    DWORD toWrite = (DWORD)len;\r\n    BOOL ok = WriteFile(gPipe, s, toWrite, &written, nullptr);\r\n    if (!ok) {\r\n        lf(\"memtrace.dll: WriteToPipe() failed\");\r\n        LogLastError();\r\n        ClosePipe();\r\n        return false;\r\n    }\r\n\r\n    if (written != toWrite) {\r\n        lf(\"memtrace.dll: only wrote %d out of %d\", (int)written, (int)toWrite);\r\n        ClosePipe();\r\n        return false;\r\n    }\r\n    return true;\r\n}\r\n\r\n// If the data to be sent fits in the buf, we copy it from MemBlock to buf\r\n// Otherwise we return the whole MemBlock, to minimize the time spent inside\r\n// the critical section to minimize blocking in hooked functions\r\nstatic MemBlock* GetDataToSend(byte *buf, size_t bufSize, size_t *bufLenOut)\r\n{\r\n    ScopedCritSec cs(&gMemMutex);\r\n    // sent queued blocks first\r\n    if (gBlocksToSend) {\r\n        MemBlock *tmp = gBlocksToSend;\r\n        gBlocksToSend = gBlocksToSend->next;\r\n        return tmp;\r\n    }\r\n\r\n    // no queued data - send gCurrBlock\r\n    if (!gCurrBlock) {\r\n        *bufLenOut = 0;\r\n        return nullptr;\r\n    }\r\n    if (gCurrBlock->UnsentLen() > bufSize) {\r\n        MemBlock *tmp = gCurrBlock;\r\n        gCurrBlock = nullptr;\r\n        return tmp;\r\n    }\r\n    size_t len = gCurrBlock->UnsentLen();\r\n    memcpy(buf, gCurrBlock->UnsentData(), len);\r\n    *bufLenOut = len;\r\n    gCurrBlock->sent += len;\r\n    CrashIf(gCurrBlock->sent > gCurrBlock->size);\r\n    CrashIf(0 != gCurrBlock->UnsentLen());\r\n    gCurrBlock->Reset();\r\n    return nullptr;\r\n}\r\n\r\nstatic bool gStopSendThread = false;\r\n\r\nstatic void SendQueuedMessages()\r\n{\r\n    byte        buf[MEMCOPY_THRESHOLD];\r\n    size_t      dataLen;\r\n    MemBlock *  block;\r\n\r\n    for (;;)\r\n    {\r\n        if (!gPipe)\r\n            return;\r\n\r\n        dataLen = 0;\r\n        block = GetDataToSend(buf, dimof(buf), &dataLen);\r\n        byte *dataToSend = buf;\r\n        if (block) {\r\n            dataToSend = block->UnsentData();\r\n            dataLen = block->UnsentLen();\r\n        }\r\n\r\n        if (0 == dataLen) {\r\n            CrashIf(block);\r\n            return;\r\n        }\r\n\r\n        //lf(\"memtrace.dll: sending %d bytes\", (int)dataLen);\r\n        WriteToPipe(dataToSend, dataLen);\r\n        if (block) {\r\n            block->sent += dataLen;\r\n            FreeBlock(block);\r\n        }\r\n    }\r\n}\r\n\r\nstatic DWORD WINAPI DataSendThreadProc(void* data)\r\n{\r\n    // if pipe was closed, we exit the thread\r\n    while (gPipe) {\r\n        DWORD res = WaitForSingleObject(gSendThreadEvent, INFINITE);\r\n        if (gStopSendThread) {\r\n            lf(\"memtrace.dll: DataSendThreadProc, gStopSendThread is true\");\r\n            return 0;\r\n        }\r\n        if (WAIT_OBJECT_0 != res)\r\n            continue;\r\n\r\n        SendQueuedMessages();\r\n    }\r\n    lf(\"memtrace.dll: DataSendThreadProc ended\");\r\n    return 0;\r\n}\r\n\r\n// transfers the data to a thread that does the actual sending\r\nstatic void QueueMessageForSending(Vec<byte>& msg)\r\n{\r\n    size_t len = msg.Size();\r\n    if (0 == len)\r\n        return;\r\n\r\n    MemBlock *block = GetBlock(len);\r\n    if (block) {\r\n        block->Append(msg.LendData(), len);\r\n        SetEvent(gSendThreadEvent);\r\n    } else {\r\n        lf(\"memtrace.dll: QueueMessageForSending() couldn't queu %d bytes\", (int)len);\r\n    }\r\n}\r\n\r\nWindowsDllInterceptor gNtdllIntercept;\r\n\r\n//http://msdn.microsoft.com/en-us/library/windows/hardware/ff552108(v=vs.85).aspx\r\nPVOID (WINAPI *gRtlAllocateHeapOrig)(PVOID heapHandle, ULONG flags, SIZE_T size);\r\n// http://msdn.microsoft.com/en-us/library/windows/hardware/ff552276(v=vs.85).aspx\r\nBOOLEAN (WINAPI *gRtlFreeHeapOrig)(PVOID heapHandle, ULONG flags, PVOID heapBase);\r\n\r\nPVOID WINAPI RtlAllocateHeapHook(PVOID heapHandle, ULONG flags, SIZE_T size)\r\n{\r\n    if (!gPipe || (gHeap == heapHandle) || gStopSendThread)\r\n        return gRtlAllocateHeapOrig(heapHandle, flags, size);\r\n\r\n    PerThreadData threadDataEmergency = { true, true };\r\n    PerThreadData *threadData = GetPerThreadData(&threadDataEmergency);\r\n    bool inAlloc = threadData->inAlloc;\r\n    // prevent infinite recursion\r\n    threadData->inAlloc = true;\r\n\r\n    PVOID res = gRtlAllocateHeapOrig(heapHandle, flags, size);\r\n    if (inAlloc)\r\n        return res;\r\n\r\n    AllocData d = { (uint32)size, (uint32)res };\r\n    Vec<byte> msg;\r\n    SerializeType((byte*)&d, &allocDataTypeInfo, msg);\r\n    QueueMessageForSending(msg);\r\n    threadData->inAlloc = false;\r\n    return res;\r\n}\r\n\r\nBOOLEAN WINAPI RtlFreeHeapHook(PVOID heapHandle, ULONG flags, PVOID heapBase)\r\n{\r\n    if (!gPipe || (gHeap == heapHandle) || gStopSendThread)\r\n        return gRtlFreeHeapOrig(heapHandle, flags, heapBase);\r\n\r\n    PerThreadData threadDataEmergency = { true, true };\r\n    PerThreadData *threadData = GetPerThreadData(&threadDataEmergency);\r\n    bool inFree = threadData->inFree;\r\n    // prevent infinite recursion\r\n    threadData->inFree = true;\r\n    BOOLEAN res = gRtlFreeHeapOrig(heapHandle, flags, heapBase);\r\n    if (inFree)\r\n        return res;\r\n\r\n    FreeData d = { (uint32)heapBase };\r\n    Vec<byte> msg;\r\n    SerializeType((byte*)&d, &freeDataTypeInfo, msg);\r\n    QueueMessageForSending(msg);\r\n    threadData->inFree = false;\r\n    return res;\r\n}\r\n\r\nstatic void InstallHooks()\r\n{\r\n    gNtdllIntercept.Init(\"ntdll.dll\");\r\n    bool ok = gNtdllIntercept.AddHook(\"RtlAllocateHeap\", reinterpret_cast<intptr_t>(RtlAllocateHeapHook), (void**) &gRtlAllocateHeapOrig);\r\n    if (ok)\r\n        lf(\"memtrace.dll: Hooked RtlAllocateHeap\");\r\n    else\r\n        lf(\"memtrace.dll: failed to hook RtlAllocateHeap\");\r\n\r\n    ok = gNtdllIntercept.AddHook(\"RtlFreeHeap\", reinterpret_cast<intptr_t>(RtlFreeHeapHook), (void**) &gRtlFreeHeapOrig);\r\n    if (ok)\r\n        lf(\"memtrace.dll: Hooked RtlFreeHeap\");\r\n    else\r\n        lf(\"memtrace.dll: failed to hook RtlFreeHeap\");\r\n}\r\n\r\n// TODO: I should probably move all initalization inside the thread\r\n// We should minimize the amount of work done in DLL_PROCESS_ATTACH as per\r\n// http://blogs.msdn.com/b/oleglv/archive/2003/10/24/56141.aspx\r\nstatic BOOL ProcessAttach()\r\n{\r\n    lf(\"memtrace.dll: ProcessAttach()\");\r\n    if (!OpenPipe()) {\r\n        lf(\"memtrace.dll: couldn't open pipe\");\r\n        return FALSE;\r\n    } else {\r\n        lf(\"memtrace.dll: opened pipe\");\r\n    }\r\n\r\n    gHeap = HeapCreate(0, 0, 0);\r\n    if (!gHeap) {\r\n        lf(\"memtrace.dll: failed to create heap\");\r\n        return FALSE;\r\n    }\r\n\r\n    InitializeCriticalSection(&gMemMutex);\r\n    gSendThreadEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);\r\n    if (!gSendThreadEvent) {\r\n        lf(\"memtrace.dll: couldn't create gSendThreadEvent\");\r\n        return FALSE;\r\n    }\r\n    gSendThread = CreateThread(nullptr, 0, DataSendThreadProc, nullptr, 0, 0);\r\n    if (!gSendThread) {\r\n        lf(\"memtrace.dll: couldn't create gSendThread\");\r\n        return FALSE;\r\n    }\r\n    InstallHooks();\r\n    return TRUE;\r\n}\r\n\r\nstatic void TerminateSendingThread()\r\n{\r\n    if (!gSendThread)\r\n        return;\r\n    lf(\"memtrace.dll: TerminateSendingThread() setting gStopSendThread=TRUE and signaling gSendThreadEvent\");\r\n    gStopSendThread = true;\r\n    SetEvent(gSendThreadEvent);\r\n    lf(\"memtrace.dll: TerminateSendingThread() waiting for gSendThread\");\r\n    Timer t(true);\r\n    DWORD res = WaitForSingleObject(gSendThread, 5*1024);\r\n    t.Stop();\r\n    lf(\"%.2f ms to terminate the thread\", t.GetTimeInMs());\r\n    if (WAIT_OBJECT_0 == res) {\r\n        lf(\"memtrace.dll: thread quit by itself\");\r\n    } else {\r\n        TerminateThread(gSendThread, 1);\r\n        lf(\"memtrace.dll: terminated sending thread\");\r\n    }\r\n    CloseHandle(gSendThread);\r\n    SendQueuedMessages();\r\n}\r\n\r\nstatic BOOL ProcessDetach()\r\n{\r\n    lf(\"memtrace.dll: ProcessDetach()\");\r\n    TerminateSendingThread();\r\n    ClosePipe();\r\n    DeleteCriticalSection(&gMemMutex);\r\n    CloseHandle(gSendThreadEvent);\r\n    FreeAllBlocks();\r\n    lf(\"memtrace.dll: allocated total %d blocks\", gBlocksAllocated);\r\n    HeapDestroy(gHeap);\r\n    return TRUE;\r\n}\r\n\r\nstatic BOOL ThreadAttach()\r\n{\r\n    return TRUE;\r\n}\r\n\r\nstatic BOOL ThreadDetach()\r\n{\r\n    return TRUE;\r\n}\r\n\r\nBOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)\r\n{\r\n    gModule = hModule;\r\n    if (DLL_PROCESS_ATTACH == dwReason)\r\n        return ProcessAttach();\r\n    if (DLL_PROCESS_DETACH == dwReason)\r\n        return ProcessDetach();\r\n    if (DLL_THREAD_ATTACH == dwReason)\r\n        return ThreadAttach();\r\n    if (DLL_THREAD_DETACH == dwReason)\r\n        return ThreadDetach();\r\n\r\n    return TRUE;\r\n}\r\n"
  },
  {
    "path": "src/memtrace/MemTraceDll.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n"
  },
  {
    "path": "src/memtrace/nsWindowsDllInterceptor.h",
    "content": "/* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\r\n/* ***** BEGIN LICENSE BLOCK *****\r\n * Version: MPL 1.1/GPL 2.0/LGPL 2.1\r\n *\r\n * The contents of this file are subject to the Mozilla Public License Version\r\n * 1.1 (the \"License\"); you may not use this file except in compliance with\r\n * the License. You may obtain a copy of the License at\r\n * http://www.mozilla.org/MPL/\r\n *\r\n * Software distributed under the License is distributed on an \"AS IS\" basis,\r\n * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\r\n * for the specific language governing rights and limitations under the\r\n * License.\r\n *\r\n * The Original Code is mozilla.org code.\r\n *\r\n * The Initial Developer of the Original Code is the Mozilla Foundation.\r\n * Portions created by the Initial Developer are Copyright (C) 2009\r\n * the Initial Developer. All Rights Reserved.\r\n *\r\n * Contributor(s):\r\n *  Vladimir Vukicevic <vladimir@pobox.com>\r\n *\r\n * Alternatively, the contents of this file may be used under the terms of\r\n * either the GNU General Public License Version 2 or later (the \"GPL\"), or\r\n * the GNU Lesser General Public License Version 2.1 or later (the \"LGPL\"),\r\n * in which case the provisions of the GPL or the LGPL are applicable instead\r\n * of those above. If you wish to allow use of your version of this file only\r\n * under the terms of either the GPL or the LGPL, and not to allow others to\r\n * use your version of this file under the terms of the MPL, indicate your\r\n * decision by deleting the provisions above and replace them with the notice\r\n * and other provisions required by the GPL or the LGPL. If you do not delete\r\n * the provisions above, a recipient may use your version of this file under\r\n * the terms of any one of the MPL, the GPL or the LGPL.\r\n *\r\n * ***** END LICENSE BLOCK ***** */\r\n\r\n#ifndef NS_WINDOWS_DLL_INTERCEPTOR_H_\r\n#define NS_WINDOWS_DLL_INTERCEPTOR_H_\r\n#include <windows.h>\r\n#include <winternl.h>\r\n\r\n/*\r\n * Simple trampoline interception\r\n *\r\n * 1. Save first N bytes of OrigFunction to trampoline, where N is a\r\n *    number of bytes >= 5 that are instruction aligned.\r\n *\r\n * 2. Replace first 5 bytes of OrigFunction with a jump to the Hook\r\n *    function.\r\n *\r\n * 3. After N bytes of the trampoline, add a jump to OrigFunction+N to\r\n *    continue original program flow.\r\n *\r\n * 4. Hook function needs to call the trampoline during its execution,\r\n *    to invoke the original function (so address of trampoline is\r\n *    returned).\r\n *\r\n * When the WindowsDllInterceptor class is destructed, OrigFunction is\r\n * patched again to jump directly to the trampoline instead of going\r\n * through the hook function. As such, re-intercepting the same function\r\n * won't work, as jump instructions are not supported.\r\n */\r\n\r\nclass WindowsDllInterceptor\r\n{\r\n  typedef unsigned char *byteptr_t;\r\npublic:\r\n  WindowsDllInterceptor()\r\n    : mModule(0)\r\n  {\r\n  }\r\n\r\n  WindowsDllInterceptor(const char *modulename, int nhooks = 0) {\r\n    Init(modulename, nhooks);\r\n  }\r\n\r\n  ~WindowsDllInterceptor() {\r\n    int i;\r\n    byteptr_t p;\r\n    for (i = 0, p = mHookPage; i < mCurHooks; i++, p += kHookSize) {\r\n#if defined(_M_IX86)\r\n      size_t nBytes = 1 + sizeof(intptr_t);\r\n#elif defined(_M_X64)\r\n      size_t nBytes = 2 + sizeof(intptr_t);\r\n#else\r\n#error \"Unknown processor type\"\r\n#endif\r\n      byteptr_t origBytes = *((byteptr_t *)p);\r\n      // ensure we can modify the original code\r\n      DWORD op;\r\n      if (!VirtualProtectEx(GetCurrentProcess(), origBytes, nBytes, PAGE_EXECUTE_READWRITE, &op)) {\r\n        //printf (\"VirtualProtectEx failed! %d\\n\", GetLastError());\r\n        continue;\r\n      }\r\n      // Remove the hook by making the original function jump directly\r\n      // in the trampoline.\r\n      intptr_t dest = (intptr_t)(p + sizeof(void *));\r\n#if defined(_M_IX86)\r\n      *((intptr_t*)(origBytes+1)) = dest - (intptr_t)(origBytes+5); // target displacement\r\n#elif defined(_M_X64)\r\n      *((intptr_t*)(origBytes+2)) = dest;\r\n#else\r\n#error \"Unknown processor type\"\r\n#endif\r\n      // restore protection; if this fails we can't really do anything about it\r\n      VirtualProtectEx(GetCurrentProcess(), origBytes, nBytes, op, &op);\r\n    }\r\n  }\r\n\r\n  void Init(const char *modulename, int nhooks = 0) {\r\n    if (mModule)\r\n      return;\r\n\r\n    mModule = LoadLibraryExA(modulename, nullptr, 0);\r\n    if (!mModule) {\r\n      //printf(\"LoadLibraryEx for '%s' failed\\n\", modulename);\r\n      return;\r\n    }\r\n\r\n    int hooksPerPage = 4096 / kHookSize;\r\n    if (nhooks == 0)\r\n      nhooks = hooksPerPage;\r\n\r\n    mMaxHooks = nhooks + (hooksPerPage % nhooks);\r\n    mCurHooks = 0;\r\n\r\n    mHookPage = (byteptr_t) VirtualAllocEx(GetCurrentProcess(), nullptr, mMaxHooks * kHookSize,\r\n             MEM_COMMIT | MEM_RESERVE,\r\n             PAGE_EXECUTE_READWRITE);\r\n\r\n    if (!mHookPage) {\r\n      mModule = 0;\r\n      return;\r\n    }\r\n  }\r\n\r\n  void LockHooks() {\r\n    if (!mModule)\r\n      return;\r\n\r\n    DWORD op;\r\n    VirtualProtectEx(GetCurrentProcess(), mHookPage, mMaxHooks * kHookSize, PAGE_EXECUTE_READ, &op);\r\n\r\n    mModule = 0;\r\n  }\r\n\r\n  bool AddHook(const char *pname,\r\n         intptr_t hookDest,\r\n         void **origFunc)\r\n  {\r\n    if (!mModule)\r\n      return false;\r\n\r\n    void *pAddr = (void *) GetProcAddress(mModule, pname);\r\n    if (!pAddr) {\r\n      //printf (\"GetProcAddress failed\\n\");\r\n      return false;\r\n    }\r\n\r\n    void *tramp = CreateTrampoline(pAddr, hookDest);\r\n    if (!tramp) {\r\n      //printf (\"CreateTrampoline failed\\n\");\r\n      return false;\r\n    }\r\n\r\n    *origFunc = tramp;\r\n\r\n    return true;\r\n  }\r\n\r\nprotected:\r\n  const static int kPageSize = 4096;\r\n  const static int kHookSize = 128;\r\n\r\n  HMODULE mModule;\r\n  byteptr_t mHookPage;\r\n  int mMaxHooks;\r\n  int mCurHooks;\r\n\r\n  byteptr_t CreateTrampoline(void *origFunction,\r\n           intptr_t dest)\r\n  {\r\n    byteptr_t tramp = FindTrampolineSpace();\r\n    if (!tramp)\r\n      return 0;\r\n\r\n    byteptr_t origBytes = (byteptr_t) origFunction;\r\n\r\n    int nBytes = 0;\r\n    int pJmp32 = -1;\r\n\r\n#if defined(_M_IX86)\r\n    while (nBytes < 5) {\r\n      // Understand some simple instructions that might be found in a\r\n      // prologue; we might need to extend this as necessary.\r\n      //\r\n      // Note!  If we ever need to understand jump instructions, we'll\r\n      // need to rewrite the displacement argument.\r\n      if (origBytes[nBytes] >= 0x88 && origBytes[nBytes] <= 0x8B) {\r\n        // various MOVs\r\n        unsigned char b = origBytes[nBytes+1];\r\n        if (((b & 0xc0) == 0xc0) ||\r\n            (((b & 0xc0) == 0x00) &&\r\n             ((b & 0x07) != 0x04) && ((b & 0x07) != 0x05)))\r\n        {\r\n          // REG=r, R/M=r or REG=r, R/M=[r]\r\n          nBytes += 2;\r\n        } else if (((b & 0xc0) == 0x40) && ((b & 0x38) != 0x20)) {\r\n          // REG=r, R/M=[r + disp8]\r\n          nBytes += 3;\r\n        } else {\r\n          // complex MOV, bail\r\n          return 0;\r\n        }\r\n      } else if (origBytes[nBytes] == 0x83) {\r\n        // ADD|ODR|ADC|SBB|AND|SUB|XOR|CMP r/m, imm8\r\n        unsigned char b = origBytes[nBytes+1];\r\n        if ((b & 0xc0) == 0xc0) {\r\n          // ADD|ODR|ADC|SBB|AND|SUB|XOR|CMP r, imm8\r\n          nBytes += 3;\r\n        } else {\r\n          // bail\r\n          return 0;\r\n        }\r\n      } else if (origBytes[nBytes] == 0x68) {\r\n        // PUSH with 4-byte operand\r\n        nBytes += 5;\r\n      } else if ((origBytes[nBytes] & 0xf0) == 0x50) {\r\n        // 1-byte PUSH/POP\r\n        nBytes++;\r\n      } else if (origBytes[nBytes] == 0x6A) {\r\n        // PUSH imm8\r\n        nBytes += 2;\r\n      } else if (origBytes[nBytes] == 0xe9) {\r\n        pJmp32 = nBytes;\r\n        // jmp 32bit offset\r\n        nBytes += 5;\r\n      } else {\r\n        //printf (\"Unknown x86 instruction byte 0x%02x, aborting trampoline\\n\", origBytes[nBytes]);\r\n        return 0;\r\n      }\r\n    }\r\n#elif defined(_M_X64)\r\n    while (nBytes < 13) {\r\n\r\n      // if found JMP 32bit offset, next bytes must be NOP\r\n      if (pJmp32 >= 0) {\r\n        if (origBytes[nBytes++] != 0x90)\r\n          return 0;\r\n\r\n        continue;\r\n      }\r\n\r\n      if (origBytes[nBytes] == 0x41) {\r\n        // REX.B\r\n        nBytes++;\r\n\r\n        if ((origBytes[nBytes] & 0xf0) == 0x50) {\r\n          // push/pop with Rx register\r\n          nBytes++;\r\n        } else if (origBytes[nBytes] >= 0xb8 && origBytes[nBytes] <= 0xbf) {\r\n          // mov r32, imm32\r\n          nBytes += 5;\r\n        } else {\r\n          return 0;\r\n        }\r\n      } else if (origBytes[nBytes] == 0x45) {\r\n        // REX.R & REX.B\r\n        nBytes++;\r\n\r\n        if (origBytes[nBytes] == 0x33) {\r\n          // xor r32, r32\r\n          nBytes += 2;\r\n        } else {\r\n          return 0;\r\n        }\r\n      } else if ((origBytes[nBytes] & 0xfb) == 0x48) {\r\n        // REX.W | REX.WR\r\n        nBytes++;\r\n\r\n        if (origBytes[nBytes] == 0x81 && (origBytes[nBytes+1] & 0xf8) == 0xe8) {\r\n          // sub r, dword\r\n          nBytes += 6;\r\n        } else if (origBytes[nBytes] == 0x83 &&\r\n                  (origBytes[nBytes+1] & 0xf8) == 0xe8) {\r\n          // sub r, byte\r\n          nBytes += 3;\r\n        } else if (origBytes[nBytes] == 0x83 &&\r\n                  (origBytes[nBytes+1] & 0xf8) == 0x60) {\r\n          // and [r+d], imm8\r\n          nBytes += 5;\r\n        } else if ((origBytes[nBytes] & 0xfd) == 0x89) {\r\n          // MOV r/m64, r64 | MOV r64, r/m64\r\n          if ((origBytes[nBytes+1] & 0xc0) == 0x40) {\r\n            if ((origBytes[nBytes+1] & 0x7) == 0x04) {\r\n              // R/M=[SIB+disp8], REG=r64\r\n              nBytes += 4;\r\n            } else {\r\n              // R/M=[r64+disp8], REG=r64\r\n              nBytes += 3;\r\n            }\r\n          } else if (((origBytes[nBytes+1] & 0xc0) == 0xc0) ||\r\n                     (((origBytes[nBytes+1] & 0xc0) == 0x00) &&\r\n                      ((origBytes[nBytes+1] & 0x07) != 0x04) && ((origBytes[nBytes+1] & 0x07) != 0x05))) {\r\n            // REG=r64, R/M=r64 or REG=r64, R/M=[r64]\r\n            nBytes += 2;\r\n          } else {\r\n            // complex MOV\r\n            return 0;\r\n          }\r\n        } else {\r\n          // not support yet!\r\n          return 0;\r\n        }\r\n      } else if ((origBytes[nBytes] & 0xf0) == 0x50) {\r\n        // 1-byte push/pop\r\n        nBytes++;\r\n      } else if (origBytes[nBytes] == 0x90) {\r\n        // nop\r\n        nBytes++;\r\n      } else if (origBytes[nBytes] == 0xe9) {\r\n        pJmp32 = nBytes;\r\n        // jmp 32bit offset\r\n        nBytes += 5;\r\n      } else if (origBytes[nBytes] == 0xff) {\r\n        nBytes++;\r\n        if ((origBytes[nBytes] & 0xf8) == 0xf0) {\r\n          // push r64\r\n          nBytes++;\r\n        } else {\r\n          return 0;\r\n        }\r\n      } else {\r\n        return 0;\r\n      }\r\n    }\r\n#else\r\n#error \"Unknown processor type\"\r\n#endif\r\n\r\n    if (nBytes > 100) {\r\n      //printf (\"Too big!\");\r\n      return 0;\r\n    }\r\n\r\n    // We keep the address of the original function in the first bytes of\r\n    // the trampoline buffer\r\n    *((void **)tramp) = origFunction;\r\n    tramp += sizeof(void *);\r\n\r\n    memcpy(tramp, origFunction, nBytes);\r\n\r\n    // OrigFunction+N, the target of the trampoline\r\n    byteptr_t trampDest = origBytes + nBytes;\r\n\r\n#if defined(_M_IX86)\r\n    if (pJmp32 >= 0) {\r\n      // Jump directly to the original target of the jump instead of jumping to the\r\n      // original function.\r\n      // Adjust jump target displacement to jump location in the trampoline.\r\n      *((intptr_t*)(tramp+pJmp32+1)) += origBytes + pJmp32 - tramp;\r\n    } else {\r\n      tramp[nBytes] = 0xE9; // jmp\r\n      *((intptr_t*)(tramp+nBytes+1)) = (intptr_t)trampDest - (intptr_t)(tramp+nBytes+5); // target displacement\r\n    }\r\n#elif defined(_M_X64)\r\n    // If JMP32 opcode found, we don't insert to trampoline jump\r\n    if (pJmp32 >= 0) {\r\n      // convert JMP 32bit offset to JMP 64bit direct\r\n      byteptr_t directJmpAddr = origBytes + pJmp32 + 5 + (*((LONG*)(origBytes+pJmp32+1)));\r\n      // mov r11, address\r\n      tramp[pJmp32]   = 0x49;\r\n      tramp[pJmp32+1] = 0xbb;\r\n      *((intptr_t*)(tramp+pJmp32+2)) = (intptr_t)directJmpAddr;\r\n\r\n      // jmp r11\r\n      tramp[pJmp32+10] = 0x41;\r\n      tramp[pJmp32+11] = 0xff;\r\n      tramp[pJmp32+12] = 0xe3;\r\n    } else {\r\n      // mov r11, address\r\n      tramp[nBytes] = 0x49;\r\n      tramp[nBytes+1] = 0xbb;\r\n      *((intptr_t*)(tramp+nBytes+2)) = (intptr_t)trampDest;\r\n\r\n      // jmp r11\r\n      tramp[nBytes+10] = 0x41;\r\n      tramp[nBytes+11] = 0xff;\r\n      tramp[nBytes+12] = 0xe3;\r\n    }\r\n#endif\r\n\r\n    // ensure we can modify the original code\r\n    DWORD op;\r\n    if (!VirtualProtectEx(GetCurrentProcess(), origFunction, nBytes, PAGE_EXECUTE_READWRITE, &op)) {\r\n      //printf (\"VirtualProtectEx failed! %d\\n\", GetLastError());\r\n      return 0;\r\n    }\r\n\r\n#if defined(_M_IX86)\r\n    // now modify the original bytes\r\n    origBytes[0] = 0xE9; // jmp\r\n    *((intptr_t*)(origBytes+1)) = dest - (intptr_t)(origBytes+5); // target displacement\r\n#elif defined(_M_X64)\r\n    // mov r11, address\r\n    origBytes[0] = 0x49;\r\n    origBytes[1] = 0xbb;\r\n\r\n    *((intptr_t*)(origBytes+2)) = dest;\r\n\r\n    // jmp r11\r\n    origBytes[10] = 0x41;\r\n    origBytes[11] = 0xff;\r\n    origBytes[12] = 0xe3;\r\n#endif\r\n\r\n    // restore protection; if this fails we can't really do anything about it\r\n    VirtualProtectEx(GetCurrentProcess(), origFunction, nBytes, op, &op);\r\n\r\n    return tramp;\r\n  }\r\n\r\n  byteptr_t FindTrampolineSpace() {\r\n    if (mCurHooks >= mMaxHooks)\r\n      return 0;\r\n\r\n    byteptr_t p = mHookPage + mCurHooks*kHookSize;\r\n\r\n    mCurHooks++;\r\n\r\n    return p;\r\n  }\r\n};\r\n\r\n\r\n#endif /* NS_WINDOWS_DLL_INTERCEPTOR_H_ */\r\n"
  },
  {
    "path": "src/mui/MiniMui.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// as little of mui as necessary to make ../EngineDump.cpp compile\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"MiniMui.h\"\r\n#include \"WinUtil.h\"\r\n\r\nusing namespace Gdiplus;\r\n\r\nnamespace mui {\r\n\r\nHFONT CachedFont::GetHFont() {\r\n    if (!hFont) {\r\n        LOGFONTW lf;\r\n        // TODO: Graphics is probably only used for metrics,\r\n        // so this might not be 100% correct (e.g. 2 monitors with different DPIs?)\r\n        // but previous code wasn't much better\r\n        Graphics *gfx = AllocGraphicsForMeasureText();\r\n        Status status = font->GetLogFontW(gfx, &lf);\r\n        FreeGraphicsForMeasureText(gfx);\r\n        CrashIf(status != Ok);\r\n        hFont = CreateFontIndirectW(&lf);\r\n        CrashIf(!hFont);\r\n    }\r\n    return hFont;\r\n}\r\n\r\nclass CachedFontItem : public CachedFont {\r\n  public:\r\n    CachedFontItem *_next;\r\n\r\n    CachedFontItem(const WCHAR *name, float sizePt, FontStyle style, Font *font) : _next(nullptr) {\r\n        this->name = str::Dup(name);\r\n        this->sizePt = sizePt;\r\n        this->style = style;\r\n        this->font = font;\r\n    }\r\n    ~CachedFontItem() {\r\n        free(name);\r\n        ::delete font;\r\n        DeleteObject(hFont);\r\n        delete _next;\r\n    }\r\n};\r\n\r\nstatic CachedFontItem *gFontCache = nullptr;\r\n\r\nCachedFont *GetCachedFont(const WCHAR *name, float size, FontStyle style) {\r\n    CachedFontItem **item = &gFontCache;\r\n    for (; *item; item = &(*item)->_next) {\r\n        if ((*item)->SameAs(name, size, style)) {\r\n            return *item;\r\n        }\r\n    }\r\n\r\n    Font *font = ::new Font(name, size, style);\r\n    CrashIf(!font);\r\n    if (!font) {\r\n        // fall back to the default font, if a desired font can't be created\r\n        font = ::new Font(L\"Times New Roman\", size, style);\r\n        if (!font) {\r\n            return gFontCache;\r\n        }\r\n    }\r\n\r\n    return (*item = new CachedFontItem(name, size, style, font));\r\n}\r\n\r\n// set consistent mode for our graphics objects so that we get\r\n// the same results when measuring text\r\nvoid InitGraphicsMode(Graphics *g) {\r\n    g->SetCompositingQuality(CompositingQualityHighQuality);\r\n    g->SetSmoothingMode(SmoothingModeAntiAlias);\r\n    // g.SetSmoothingMode(SmoothingModeHighQuality);\r\n    g->SetTextRenderingHint(TextRenderingHintClearTypeGridFit);\r\n    g->SetPageUnit(UnitPixel);\r\n}\r\n\r\nclass GlobalGraphicsHack {\r\n    Bitmap bmp;\r\n\r\n  public:\r\n    Graphics gfx;\r\n\r\n    GlobalGraphicsHack() : bmp(1, 1, PixelFormat32bppARGB), gfx(&bmp) { InitGraphicsMode(&gfx); }\r\n};\r\n\r\nstatic GlobalGraphicsHack *gGraphicsHack = nullptr;\r\n\r\nGraphics *AllocGraphicsForMeasureText() {\r\n    if (!gGraphicsHack) {\r\n        gGraphicsHack = new GlobalGraphicsHack();\r\n    }\r\n    return &gGraphicsHack->gfx;\r\n}\r\n\r\nvoid FreeGraphicsForMeasureText(Graphics *g) {\r\n    UNUSED(g); /* deallocation happens in mui::Destroy */\r\n}\r\n\r\n// allow for calls to mui::Initialize and mui::Destroy to be nested\r\nstatic LONG gMiniMuiRefCount = 0;\r\n\r\nvoid Initialize() { InterlockedIncrement(&gMiniMuiRefCount); }\r\n\r\nvoid Destroy() {\r\n    if (InterlockedDecrement(&gMiniMuiRefCount) != 0)\r\n        return;\r\n\r\n    delete gFontCache;\r\n    gFontCache = nullptr;\r\n    delete gGraphicsHack;\r\n    gGraphicsHack = nullptr;\r\n}\r\n}\r\n"
  },
  {
    "path": "src/mui/MiniMui.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// as little of mui as necessary to make ../EngineDump.cpp compile\r\n// TODO: extract from UI toolkit so that it can be used in model independent of view\r\n\r\nnamespace mui {\r\n\r\nvoid Initialize();\r\nvoid Destroy();\r\n\r\nstruct CachedFont {\r\n    WCHAR *name;\r\n    float sizePt;\r\n    Gdiplus::FontStyle style;\r\n\r\n    Gdiplus::Font *font;\r\n    // hFont is created out of font\r\n    HFONT hFont;\r\n\r\n    HFONT GetHFont();\r\n    Gdiplus::FontStyle GetStyle() const { return style; }\r\n    float GetSize() const { return sizePt; }\r\n    const WCHAR *GetName() const { return name; }\r\n\r\n    bool SameAs(const WCHAR *name, float sizePt, Gdiplus::FontStyle style) const {\r\n        return this->sizePt == sizePt && this->style == style && str::Eq(this->name, name);\r\n    }\r\n};\r\n\r\nCachedFont *GetCachedFont(const WCHAR *name, float sizePt, Gdiplus::FontStyle style);\r\n\r\nvoid InitGraphicsMode(Gdiplus::Graphics *g);\r\nGdiplus::Graphics *AllocGraphicsForMeasureText();\r\nvoid FreeGraphicsForMeasureText(Gdiplus::Graphics *g);\r\n};\r\n\r\nclass ScopedMiniMui {\r\n  public:\r\n    ScopedMiniMui() { mui::Initialize(); }\r\n    ~ScopedMiniMui() { mui::Destroy(); }\r\n};\r\n"
  },
  {
    "path": "src/mui/Mui.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"Mui.h\"\r\n#include \"DebugLog.h\"\r\n\r\n/*\r\nMUI is a simple UI library for win32.\r\nMUI stands for nothing, it's just ui and gui are overused.\r\n\r\nMUI is intended to allow building UIs that have modern\r\ncapabilities not supported by the standard win32 HWND\r\narchitecture:\r\n- overlapping, alpha-blended windows\r\n- animations\r\n- a saner layout\r\n\r\nIt's inspired by WPF, WDL (http://www.cockos.com/wdl/),\r\nDirectUI (https://github.com/kjk/directui).\r\n\r\nMUI is minimal - it only supports stuff needed for Sumatra.\r\nI got burned trying to build the whole toolkit at once with DirectUI.\r\nLess code there is, the easier it is to change or extend.\r\n\r\nThe basic architectures is that of a tree of \"virtual\" (not backed\r\nby HWND) windows. Each window can have children (making it a container).\r\nChildren windows are positioned relative to its parent window and can\r\nbe positioned outside of parent's bounds.\r\n\r\nThere must be a parent window backed by HWND which handles windows\r\nmessages and paints child windows on WM_PAINT.\r\n\r\nEvent handling is loosly coupled.\r\n*/\r\n\r\nnamespace mui {\r\n\r\n// if true, shows the bounding box of each control with red outline\r\nstatic bool gDebugPaint = false;\r\n\r\nvoid Initialize() {\r\n    InitializeBase();\r\n    css::Initialize();\r\n}\r\n\r\nvoid Destroy() {\r\n    FreeControlCreators();\r\n    FreeLayoutCreators();\r\n    css::Destroy();\r\n    DestroyBase();\r\n}\r\n\r\n// the caller needs to manually invalidate all windows\r\n// for this to take place\r\nvoid SetDebugPaint(bool debug) { gDebugPaint = debug; }\r\n\r\nbool IsDebugPaint() { return gDebugPaint; }\r\n\r\n#define RECTFromRect(r)                                                                            \\\r\n    { r.GetLeft(), r.GetTop(), r.GetRight(), r.GetBottom() }\r\n\r\nHwndWrapper *GetRootHwndWnd(const Control *c) {\r\n    while (c->parent) {\r\n        c = c->parent;\r\n    }\r\n    if (!c->hwndParent)\r\n        return nullptr;\r\n    return (HwndWrapper *)c;\r\n}\r\n\r\n// traverse tree upwards to find HWND that is ultimately backing\r\n// this window\r\nHWND GetHwndParent(const Control *c) {\r\n    HwndWrapper *wHwnd = GetRootHwndWnd(c);\r\n    if (wHwnd)\r\n        return wHwnd->hwndParent;\r\n    return nullptr;\r\n}\r\n\r\nvoid CollectWindowsBreathFirst(Control *c, int offX, int offY, WndFilter *wndFilter,\r\n                               Vec<CtrlAndOffset> *ctrls) {\r\n    if (wndFilter->skipInvisibleSubtrees && !c->IsVisible())\r\n        return;\r\n\r\n    offX += c->pos.X;\r\n    offY += c->pos.Y;\r\n    if (wndFilter->Matches(c, offX, offY)) {\r\n        CtrlAndOffset coff = { c, offX, offY };\r\n        ctrls->Append(coff);\r\n    }\r\n\r\n    size_t children = c->GetChildCount();\r\n    for (size_t i = 0; i < children; i++) {\r\n        CollectWindowsBreathFirst(c->GetChild(i), offX, offY, wndFilter, ctrls);\r\n    }\r\n}\r\n\r\n// Find all windows containing a given point (x, y) and interested in at least\r\n// one of the input evens in wantedInputMask. We have to traverse all windows\r\n// because children are not guaranteed to be bounded by their parent.\r\n// It's very likely to return more than one window because our window hierarchy\r\n// is a tree. Because we traverse the tree breadth-first, parent windows will be\r\n// in windows array before child windows. In most cases caller can use the last\r\n// window in returned array (but can use a custom logic as well).\r\n// Returns number of matched windows as a convenience.\r\nsize_t CollectWindowsAt(Control *wndRoot, int x, int y, uint16 wantedInputMask,\r\n                        Vec<CtrlAndOffset> *controls) {\r\n    WndInputWantedFilter filter(x, y, wantedInputMask);\r\n    controls->Reset();\r\n    CollectWindowsBreathFirst(wndRoot, 0, 0, &filter, controls);\r\n    return controls->Count();\r\n}\r\n\r\nstatic void DrawLine(Graphics *gfx, const Point &p1, const Point &p2, float width, Brush *br) {\r\n    if (0 == width)\r\n        return;\r\n    Pen p(br, width);\r\n    gfx->DrawLine(&p, p1, p2);\r\n}\r\n\r\nvoid DrawBorder(Graphics *gfx, const Rect r, CachedStyle *s) {\r\n    Point p1, p2;\r\n    float width;\r\n\r\n    // top\r\n    p1.X = r.X;\r\n    p1.Y = r.Y;\r\n    p2.X = r.X + r.Width;\r\n    p2.Y = p1.Y;\r\n    width = s->borderWidth.top;\r\n    Brush *br = BrushFromColorData(s->borderColors.top, r);\r\n    DrawLine(gfx, p1, p2, width, br);\r\n\r\n    // right\r\n    p1 = p2;\r\n    p2.X = p1.X;\r\n    p2.Y = p1.Y + r.Height;\r\n    width = s->borderWidth.right;\r\n    br = BrushFromColorData(s->borderColors.right, r);\r\n    DrawLine(gfx, p1, p2, width, br);\r\n\r\n    // bottom\r\n    p1 = p2;\r\n    p2.X = r.X;\r\n    p2.Y = p1.Y;\r\n    width = s->borderWidth.bottom;\r\n    br = BrushFromColorData(s->borderColors.bottom, r);\r\n    DrawLine(gfx, p1, p2, width, br);\r\n\r\n    // left\r\n    p1 = p2;\r\n    p2.X = p1.X;\r\n    p2.Y = r.Y;\r\n    width = s->borderWidth.left;\r\n    br = BrushFromColorData(s->borderColors.left, r);\r\n    DrawLine(gfx, p1, p2, width, br);\r\n}\r\n\r\nstatic void InvalidateAtOff(HWND hwnd, const Rect *r, int offX, int offY) {\r\n    RECT rc = RECTFromRect((*r));\r\n    rc.left += offX;\r\n    rc.right += offX;\r\n    rc.top += offY;\r\n    rc.bottom += offY;\r\n    InvalidateRect(hwnd, &rc, FALSE);\r\n}\r\n\r\n// r1 and r2 are relative to w. If both are nullptr, we invalidate the whole w\r\nvoid RequestRepaint(Control *c, const Rect *r1, const Rect *r2) {\r\n    // we might be called when the control hasn't yet been\r\n    // placed in the window hierarchy\r\n    if (!c->parent && !c->hwndParent)\r\n        return;\r\n\r\n    Rect wRect(0, 0, c->pos.Width, c->pos.Height);\r\n\r\n    int offX = 0, offY = 0;\r\n    c->MapMyToRootPos(offX, offY);\r\n    while (c->parent) {\r\n        c = c->parent;\r\n    }\r\n    HWND hwnd = c->hwndParent;\r\n    CrashIf(!hwnd);\r\n    HwndWrapper *wnd = GetRootHwndWnd(c);\r\n    if (wnd)\r\n        wnd->MarkForRepaint();\r\n\r\n    // if we have r1 or r2, invalidate those, else invalidate w\r\n    bool didInvalidate = false;\r\n    if (r1) {\r\n        InvalidateAtOff(hwnd, r1, offX, offY);\r\n        didInvalidate = true;\r\n    }\r\n\r\n    if (r2) {\r\n        InvalidateAtOff(hwnd, r2, offX, offY);\r\n        didInvalidate = true;\r\n    }\r\n\r\n    if (didInvalidate)\r\n        return;\r\n\r\n    InvalidateAtOff(hwnd, &wRect, offX, offY);\r\n}\r\n\r\nvoid RequestLayout(Control *c) {\r\n    HwndWrapper *wnd = GetRootHwndWnd(c);\r\n    if (wnd)\r\n        wnd->RequestLayout();\r\n}\r\n}\r\n"
  },
  {
    "path": "src/mui/Mui.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nstruct FrameRateWnd;\r\nstruct TxtNode;\r\n\r\nnamespace mui {\r\n\r\nusing namespace Gdiplus;\r\n\r\n#include \"MuiBase.h\"\r\n#include \"TextRender.h\"\r\n#include \"MuiCss.h\"\r\n\r\nusing namespace css;\r\n#include \"MuiLayout.h\"\r\n#include \"MuiControl.h\"\r\n#include \"MuiButton.h\"\r\n#include \"MuiScrollBar.h\"\r\n#include \"MuiGrid.h\"\r\n#include \"MuiHwndWrapper.h\"\r\n#include \"MuiPainter.h\"\r\n#include \"MuiEventMgr.h\"\r\n#include \"MuiFromText.h\"\r\n\r\n#define SizeInfinite ((INT)-1)\r\n\r\nstruct CtrlAndOffset {\r\n    Control *c;\r\n    int offX, offY;\r\n};\r\n\r\nclass WndFilter {\r\n  public:\r\n    bool skipInvisibleSubtrees;\r\n\r\n    WndFilter() : skipInvisibleSubtrees(true) {}\r\n\r\n    virtual ~WndFilter() {}\r\n\r\n    virtual bool Matches(Control *w, int offX, int offY) {\r\n        UNUSED(w);\r\n        UNUSED(offX);\r\n        UNUSED(offY);\r\n        return true;\r\n    }\r\n};\r\n\r\nclass WndInputWantedFilter : public WndFilter {\r\n    int x, y;\r\n    uint16 wantedInputMask;\r\n\r\n  public:\r\n    WndInputWantedFilter(int x, int y, uint16 wantedInputMask)\r\n        : x(x), y(y), wantedInputMask(wantedInputMask) {}\r\n    virtual ~WndInputWantedFilter() {}\r\n    virtual bool Matches(Control *c, int offX, int offY) {\r\n        if ((c->wantedInputBits & wantedInputMask) != 0) {\r\n            Rect r = Rect(offX, offY, c->pos.Width, c->pos.Height);\r\n            return r.Contains(x, y);\r\n        }\r\n        return false;\r\n    }\r\n};\r\n\r\nvoid Initialize();\r\nvoid Destroy();\r\nvoid SetDebugPaint(bool debug);\r\nbool IsDebugPaint();\r\nsize_t CollectWindowsAt(Control *wndRoot, int x, int y, uint16 wantedInputMask,\r\n                        Vec<CtrlAndOffset> *ctrls);\r\nvoid CollectWindowsBreathFirst(Control *c, int offX, int offY, WndFilter *wndFilter,\r\n                               Vec<CtrlAndOffset> *ctrls);\r\nvoid RequestRepaint(Control *c, const Rect *r1 = nullptr, const Rect *r2 = nullptr);\r\nvoid RequestLayout(Control *c);\r\nvoid DrawBorder(Graphics *gfx, const Rect r, CachedStyle *s);\r\nHwndWrapper *GetRootHwndWnd(const Control *c);\r\n\r\n} // namespace mui\r\n"
  },
  {
    "path": "src/mui/MuiBase.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"Mui.h\"\r\n#include \"WinUtil.h\"\r\n\r\nnamespace mui {\r\n\r\n// a critical section for everything that needs protecting in mui\r\n// we use only one for simplicity as long as contention is not a problem\r\nstatic CRITICAL_SECTION gMuiCs;\r\n\r\nvoid EnterMuiCriticalSection() { EnterCriticalSection(&gMuiCs); }\r\n\r\nvoid LeaveMuiCriticalSection() { LeaveCriticalSection(&gMuiCs); }\r\n\r\nclass FontListItem {\r\n  public:\r\n    FontListItem(const WCHAR *name, float sizePt, FontStyle style, Font *font, HFONT hFont)\r\n        : next(nullptr) {\r\n        cf.name = str::Dup(name);\r\n        cf.sizePt = sizePt;\r\n        cf.style = style;\r\n        cf.font = font;\r\n        cf.hFont = hFont;\r\n    }\r\n    ~FontListItem() {\r\n        free((void *)cf.name);\r\n        ::delete cf.font;\r\n        DeleteObject(cf.hFont);\r\n        delete next;\r\n    }\r\n\r\n    CachedFont cf;\r\n    FontListItem *next;\r\n};\r\n\r\n// Global, thread-safe font cache. Font objects live forever.\r\nstatic FontListItem *gFontsCache = nullptr;\r\n\r\n// Graphics objects cannot be used across threads. We have a per-thread\r\n// cache so that it's easy to grab Graphics object to be used for\r\n// measuring text\r\nstruct GraphicsCacheEntry {\r\n    enum {\r\n        bmpDx = 32,\r\n        bmpDy = 4,\r\n        stride = bmpDx * 4,\r\n    };\r\n\r\n    DWORD threadId;\r\n    int refCount;\r\n\r\n    Graphics *gfx;\r\n    Bitmap *bmp;\r\n    BYTE data[bmpDx * bmpDy * 4];\r\n\r\n    bool Create();\r\n    void Free();\r\n};\r\n\r\nstatic Vec<GraphicsCacheEntry> *gGraphicsCache = nullptr;\r\n\r\n// set consistent mode for our graphics objects so that we get\r\n// the same results when measuring text\r\nvoid InitGraphicsMode(Graphics *g) {\r\n    g->SetCompositingQuality(CompositingQualityHighQuality);\r\n    g->SetSmoothingMode(SmoothingModeAntiAlias);\r\n    // g.SetSmoothingMode(SmoothingModeHighQuality);\r\n    g->SetTextRenderingHint(TextRenderingHintClearTypeGridFit);\r\n    g->SetPageUnit(UnitPixel);\r\n}\r\n\r\nbool GraphicsCacheEntry::Create() {\r\n    memset(data, 0, sizeof(data));\r\n    refCount = 1;\r\n    threadId = GetCurrentThreadId();\r\n    // using a small bitmap under assumption that Graphics used only\r\n    // for measuring text doesn't need the actual bitmap\r\n    bmp = ::new Bitmap(bmpDx, bmpDy, stride, PixelFormat32bppARGB, data);\r\n    if (!bmp)\r\n        return false;\r\n    gfx = ::new Graphics((Image *)bmp);\r\n    if (!gfx)\r\n        return false;\r\n    InitGraphicsMode(gfx);\r\n    return true;\r\n}\r\n\r\nvoid GraphicsCacheEntry::Free() {\r\n    CrashIf(0 != refCount);\r\n    ::delete gfx;\r\n    ::delete bmp;\r\n}\r\n\r\nvoid InitializeBase() {\r\n    InitializeCriticalSection(&gMuiCs);\r\n    gGraphicsCache = new Vec<GraphicsCacheEntry>();\r\n    // allocate the first entry in gGraphicsCache for UI thread, ref count\r\n    // ensures it stays alive forever\r\n    AllocGraphicsForMeasureText();\r\n}\r\n\r\nvoid DestroyBase() {\r\n    FreeGraphicsForMeasureText(gGraphicsCache->At(0).gfx);\r\n    for (GraphicsCacheEntry &e : *gGraphicsCache) {\r\n        e.Free();\r\n    }\r\n    delete gGraphicsCache;\r\n    delete gFontsCache;\r\n    DeleteCriticalSection(&gMuiCs);\r\n}\r\n\r\nbool CachedFont::SameAs(const WCHAR *otherName, float otherSizePt, FontStyle otherStyle) const {\r\n    if (sizePt != otherSizePt)\r\n        return false;\r\n    if (style != otherStyle)\r\n        return false;\r\n    return str::Eq(name, otherName);\r\n}\r\n\r\nHFONT CachedFont::GetHFont() {\r\n    LOGFONTW lf;\r\n    EnterMuiCriticalSection();\r\n    if (!hFont) {\r\n        // TODO: Graphics is probably only used for metrics,\r\n        // so this might not be 100% correct (e.g. 2 monitors with different DPIs?)\r\n        // but previous code wasn't much better\r\n        Graphics *gfx = AllocGraphicsForMeasureText();\r\n        Status status = font->GetLogFontW(gfx, &lf);\r\n        FreeGraphicsForMeasureText(gfx);\r\n        CrashIf(status != Ok);\r\n        hFont = CreateFontIndirectW(&lf);\r\n        CrashIf(!hFont);\r\n    }\r\n    LeaveMuiCriticalSection();\r\n    return hFont;\r\n}\r\n\r\n// convenience function: given cached style, get a Font object matching the font\r\n// properties.\r\n// Caller should not delete the font - it's cached for performance and deleted at exit\r\nCachedFont *GetCachedFont(const WCHAR *name, float sizePt, FontStyle style) {\r\n    ScopedMuiCritSec muiCs;\r\n\r\n    for (FontListItem *item = gFontsCache; item; item = item->next) {\r\n        if (item->cf.SameAs(name, sizePt, style) && item->cf.font != nullptr) {\r\n            return &item->cf;\r\n        }\r\n    }\r\n\r\n    Font *font = ::new Font(name, sizePt, style);\r\n    if (!font) {\r\n        font = ::new Font(L\"Times New Roman\", sizePt, style);\r\n        if (!font) {\r\n            // if no font is available, return the last successfully created one\r\n            return gFontsCache ? &gFontsCache->cf : nullptr;\r\n        }\r\n    }\r\n\r\n    FontListItem *item = new FontListItem(name, sizePt, style, font, nullptr);\r\n    ListInsert(&gFontsCache, item);\r\n    return &item->cf;\r\n}\r\n\r\nGraphics *AllocGraphicsForMeasureText() {\r\n    ScopedMuiCritSec muiCs;\r\n\r\n    DWORD threadId = GetCurrentThreadId();\r\n    for (GraphicsCacheEntry &e : *gGraphicsCache) {\r\n        if (e.threadId == threadId) {\r\n            e.refCount++;\r\n            return e.gfx;\r\n        }\r\n    }\r\n    GraphicsCacheEntry ce;\r\n    ce.Create();\r\n    gGraphicsCache->Append(ce);\r\n    if (gGraphicsCache->Count() < 64)\r\n        return ce.gfx;\r\n\r\n    // try to limit the size of cache by evicting the oldest entries, but don't remove\r\n    // first (for ui thread) or last (one we just added) entries\r\n    for (size_t i = 1; i < gGraphicsCache->Count() - 1; i++) {\r\n        GraphicsCacheEntry e = gGraphicsCache->At(i);\r\n        if (0 == e.refCount) {\r\n            e.Free();\r\n            gGraphicsCache->RemoveAt(i);\r\n            return ce.gfx;\r\n        }\r\n    }\r\n    // We shouldn't get here - indicates ref counting problem\r\n    CrashIf(true);\r\n    return ce.gfx;\r\n}\r\n\r\nvoid FreeGraphicsForMeasureText(Graphics *gfx) {\r\n    ScopedMuiCritSec muiCs;\r\n\r\n    DWORD threadId = GetCurrentThreadId();\r\n    for (GraphicsCacheEntry &e : *gGraphicsCache) {\r\n        if (e.gfx == gfx) {\r\n            CrashIf(e.threadId != threadId);\r\n            e.refCount--;\r\n            CrashIf(e.refCount < 0);\r\n            return;\r\n        }\r\n    }\r\n    CrashIf(true);\r\n}\r\n\r\nint CeilI(float n) {\r\n    n = ceil(n);\r\n    return (int)n;\r\n}\r\n}\r\n"
  },
  {
    "path": "src/mui/MuiBase.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nvoid InitializeBase();\r\nvoid DestroyBase();\r\n\r\nvoid EnterMuiCriticalSection();\r\nvoid LeaveMuiCriticalSection();\r\n\r\nclass ScopedMuiCritSec {\r\n  public:\r\n    ScopedMuiCritSec() { EnterMuiCriticalSection(); }\r\n\r\n    ~ScopedMuiCritSec() { LeaveMuiCriticalSection(); }\r\n};\r\n\r\nstruct CachedFont {\r\n    const WCHAR *name;\r\n    float sizePt;\r\n    Gdiplus::FontStyle style;\r\n\r\n    Gdiplus::Font *font;\r\n    // hFont is created out of font\r\n    HFONT hFont;\r\n\r\n    HFONT GetHFont();\r\n    Gdiplus::FontStyle GetStyle() const { return style; }\r\n    float GetSize() const { return sizePt; }\r\n    const WCHAR *GetName() const { return name; }\r\n    bool SameAs(const WCHAR *name, float sizePt, FontStyle style) const;\r\n};\r\n\r\nvoid InitGraphicsMode(Graphics *g);\r\nCachedFont *GetCachedFont(const WCHAR *name, float sizePt, FontStyle style);\r\n\r\nGraphics *AllocGraphicsForMeasureText();\r\nvoid FreeGraphicsForMeasureText(Graphics *gfx);\r\n\r\nint CeilI(float n);\r\n"
  },
  {
    "path": "src/mui/MuiButton.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"Mui.h\"\r\n#include \"GdiPlusUtil.h\"\r\n#include \"DebugLog.h\"\r\n\r\nnamespace mui {\r\n\r\nButton::Button(const WCHAR *s, Style *def, Style *mouseOver) {\r\n    text = nullptr;\r\n    wantedInputBits = (uint16)-1; // wants everything\r\n    styleDefault = def;\r\n    styleMouseOver = mouseOver;\r\n    SetStyle(styleDefault);\r\n    SetText(s);\r\n}\r\n\r\nButton::~Button() { free(text); }\r\n\r\nvoid Button::NotifyMouseEnter() {\r\n    Control::NotifyMouseEnter();\r\n    bool changed = SetStyle(styleMouseOver);\r\n    if (changed)\r\n        RecalculateSize(true);\r\n}\r\n\r\nvoid Button::NotifyMouseLeave() {\r\n    Control::NotifyMouseLeave();\r\n    bool changed = SetStyle(styleDefault);\r\n    if (changed)\r\n        RecalculateSize(true);\r\n}\r\n\r\n// Update desired size of the button. If the size changes, trigger layout\r\n// (which will in turn request repaints of affected areas)\r\n// To keep size of the button stable (to avoid re-layouts) we use font\r\n// line spacing to be the height of the button, even if text is empty.\r\n// Note: it might be that for some cases button with no text should collapse\r\n// in size but we don't have a need for that yet\r\nvoid Button::RecalculateSize(bool repaintIfSizeDidntChange) {\r\n    Size prevSize = desiredSize;\r\n\r\n    desiredSize = GetBorderAndPaddingSize(cachedStyle);\r\n    Graphics *gfx = AllocGraphicsForMeasureText();\r\n    CachedStyle *s = cachedStyle;\r\n    CachedFont *cachedFont = GetCachedFont(s->fontName, s->fontSize, s->fontWeight);\r\n    Font *font = cachedFont->font;\r\n\r\n    textDx = 0;\r\n    float fontDy = font->GetHeight(gfx);\r\n    RectF bbox;\r\n    if (text) {\r\n        bbox = MeasureText(gfx, font, text);\r\n        textDx = CeilI(bbox.Width);\r\n        // I theorize that bbox shouldn't be bigger than fontDy. However, in practice\r\n        // it is (e.g. for Lucida Grande and text \"Page: 0 / 0\", bbox.Dy is 19.00\r\n        // and fontDy is 18.11). I still want to know if the difference gets even bigger\r\n        // than that\r\n        float maxDiff = 1.f;\r\n        if (bbox.Height > fontDy + maxDiff) {\r\n            fontDy = bbox.Height;\r\n            float diff = fontDy + maxDiff - bbox.Height;\r\n            if (diff < 0) {\r\n                char *fontName = str::conv::ToUtf8(s->fontName);\r\n                char *tmp = str::conv::ToUtf8(text);\r\n                dbglog::CrashLogF(\r\n                    \"fontDy=%.2f, bbox.Height=%.2f, diff=%.2f (should be > 0) font: %s, text='%s'\",\r\n                    fontDy, bbox.Height, diff, fontName, tmp);\r\n                CrashIf(true);\r\n            }\r\n        }\r\n    }\r\n    desiredSize.Width += textDx;\r\n    desiredSize.Height += CeilI(fontDy);\r\n    FreeGraphicsForMeasureText(gfx);\r\n\r\n    if (!prevSize.Equals(desiredSize))\r\n        RequestLayout(this);\r\n    else if (repaintIfSizeDidntChange)\r\n        RequestRepaint(this);\r\n}\r\n\r\nvoid Button::SetText(const WCHAR *s) {\r\n    str::ReplacePtr(&text, s);\r\n    RecalculateSize(true);\r\n}\r\n\r\nSize Button::Measure(const Size availableSize) {\r\n    UNUSED(availableSize);\r\n    // desiredSize is calculated when we change the\r\n    // text, font or other attributes that influence\r\n    // the size so it doesn't have to be calculated\r\n    // here\r\n    return desiredSize;\r\n}\r\n\r\nvoid Button::UpdateAfterStyleChange() {\r\n    if (IsMouseOver())\r\n        SetStyle(styleMouseOver);\r\n    else\r\n        SetStyle(styleDefault);\r\n\r\n    RecalculateSize(true);\r\n}\r\n\r\nvoid Button::SetStyles(Style *def, Style *mouseOver) {\r\n    styleDefault = def;\r\n    styleMouseOver = mouseOver;\r\n    UpdateAfterStyleChange();\r\n}\r\n\r\nvoid Button::SetDefaultStyle(Style *style) {\r\n    styleDefault = style;\r\n    UpdateAfterStyleChange();\r\n}\r\n\r\nvoid Button::SetMouseOverStyle(Style *style) {\r\n    styleMouseOver = style;\r\n    UpdateAfterStyleChange();\r\n}\r\n\r\n// given the size of a container, the size of an element inside\r\n// a container and alignment, calculates the position of\r\n// element within the container.\r\nstatic int AlignedOffset(int containerDx, int elDx, AlignAttr align) {\r\n    if (Align_Left == align)\r\n        return 0;\r\n    if (Align_Right == align)\r\n        return containerDx - elDx;\r\n    // Align_Center or Align_Justify\r\n    return (containerDx - elDx) / 2;\r\n}\r\n\r\nvoid Button::Paint(Graphics *gfx, int offX, int offY) {\r\n    CrashIf(!IsVisible());\r\n\r\n    CachedStyle *s = cachedStyle;\r\n\r\n    RectF bbox((REAL)offX, (REAL)offY, (REAL)pos.Width, (REAL)pos.Height);\r\n    Brush *brBgColor = BrushFromColorData(s->bgColor, bbox);\r\n    gfx->FillRectangle(brBgColor, bbox);\r\n\r\n    Rect r(offX, offY, pos.Width, pos.Height);\r\n    DrawBorder(gfx, r, s);\r\n    if (str::IsEmpty(text))\r\n        return;\r\n\r\n    Padding pad = s->padding;\r\n    int alignedOffX = AlignedOffset(pos.Width - pad.left - pad.right, textDx, s->textAlign);\r\n    int x = offX + alignedOffX + pad.left + (int)s->borderWidth.left;\r\n    int y = offY + pad.top + (int)s->borderWidth.top;\r\n    Brush *brColor = BrushFromColorData(s->color, bbox); // restrict bbox to just the text?\r\n\r\n    CachedFont *cachedFont = GetCachedFont(s->fontName, s->fontSize, s->fontWeight);\r\n    Font *font = cachedFont->font;\r\n    gfx->DrawString(text, (int)str::Len(text), font, PointF((REAL)x, (REAL)y), nullptr, brColor);\r\n}\r\n\r\nButtonVector::ButtonVector() {\r\n    wantedInputBits = (uint16)-1; // wants everything\r\n    styleDefault = nullptr;\r\n    styleMouseOver = nullptr;\r\n    graphicsPath = nullptr;\r\n    SetStyle(styleDefault);\r\n}\r\n\r\nButtonVector::ButtonVector(GraphicsPath *gp) {\r\n    wantedInputBits = (uint16)-1; // wants everything\r\n    styleDefault = nullptr;\r\n    styleMouseOver = nullptr;\r\n    graphicsPath = nullptr;\r\n    SetStyle(styleDefault);\r\n    SetGraphicsPath(gp);\r\n}\r\n\r\nButtonVector::~ButtonVector() { ::delete graphicsPath; }\r\n\r\nvoid ButtonVector::NotifyMouseEnter() {\r\n    Control::NotifyMouseEnter();\r\n    bool changed = SetStyle(styleMouseOver);\r\n    if (changed)\r\n        RecalculateSize(true);\r\n}\r\n\r\nvoid ButtonVector::NotifyMouseLeave() {\r\n    Control::NotifyMouseLeave();\r\n    bool changed = SetStyle(styleDefault);\r\n    if (changed)\r\n        RecalculateSize(true);\r\n}\r\n\r\nvoid ButtonVector::SetGraphicsPath(GraphicsPath *gp) {\r\n    ::delete graphicsPath;\r\n    graphicsPath = gp;\r\n    RecalculateSize(true);\r\n}\r\n\r\n// TODO: the position still seems a bit off wrt. padding\r\nvoid ButtonVector::RecalculateSize(bool repaintIfSizeDidntChange) {\r\n    Size prevSize = desiredSize;\r\n\r\n    CachedStyle *s = cachedStyle;\r\n    desiredSize = GetBorderAndPaddingSize(s);\r\n\r\n    Rect bbox;\r\n    Brush *brStroke = BrushFromColorData(s->stroke, bbox);\r\n    if (0.f == s->strokeWidth) {\r\n        graphicsPath->GetBounds(&bbox);\r\n    } else {\r\n        Pen pen(brStroke, s->strokeWidth);\r\n        // pen widith is multiplied by MiterLimit(), which is 10 by default\r\n        // so set it explicitly to 1 for the size we expect\r\n        pen.SetMiterLimit(1.f);\r\n        pen.SetAlignment(PenAlignmentInset);\r\n        graphicsPath->GetBounds(&bbox, nullptr, &pen);\r\n    }\r\n    desiredSize.Width += bbox.Width;\r\n    desiredSize.Height += bbox.Height;\r\n\r\n    if (!prevSize.Equals(desiredSize))\r\n        RequestLayout(this);\r\n    else if (repaintIfSizeDidntChange)\r\n        RequestRepaint(this);\r\n}\r\n\r\nSize ButtonVector::Measure(const Size availableSize) {\r\n    UNUSED(availableSize);\r\n    // do nothing: calculated in RecalculateSize()\r\n    return desiredSize;\r\n}\r\n\r\nvoid ButtonVector::Paint(Graphics *gfx, int offX, int offY) {\r\n    CrashIf(!IsVisible());\r\n\r\n    CachedStyle *s = cachedStyle;\r\n\r\n    RectF bbox((REAL)offX, (REAL)offY, (REAL)pos.Width, (REAL)pos.Height);\r\n    Brush *brBgColor = BrushFromColorData(s->bgColor, bbox);\r\n    gfx->FillRectangle(brBgColor, bbox);\r\n\r\n    Rect r(offX, offY, pos.Width, pos.Height);\r\n    DrawBorder(gfx, r, s);\r\n    if (!graphicsPath)\r\n        return;\r\n\r\n    // graphicsPath bbox can have non-zero X,Y\r\n    Rect gpBbox;\r\n    Brush *brFill = BrushFromColorData(s->fill, bbox);\r\n    Brush *brStroke = BrushFromColorData(s->stroke, bbox);\r\n    Pen pen(brStroke, s->strokeWidth);\r\n    pen.SetMiterLimit(1.f);\r\n    pen.SetAlignment(PenAlignmentInset);\r\n    if (0.f == s->strokeWidth)\r\n        graphicsPath->GetBounds(&gpBbox);\r\n    else\r\n        graphicsPath->GetBounds(&gpBbox, nullptr, &pen);\r\n\r\n    // calculate the position of graphics path within given button position, size\r\n    // and desired vertical/horizontal alignment.\r\n    // Note: alignment is calculated against the size after substracting\r\n    // ncSize is the size of the non-client parts i.e. border and padding, on both sides\r\n    Size ncSize = GetBorderAndPaddingSize(s);\r\n    int elOffY = s->vertAlign.CalcOffset(gpBbox.Height, pos.Height - ncSize.Height);\r\n    int elOffX = s->horizAlign.CalcOffset(gpBbox.Width, pos.Width - ncSize.Width);\r\n\r\n    int x = offX + elOffX + s->padding.left + (int)s->borderWidth.left + gpBbox.X;\r\n    int y = offY + elOffY + s->padding.top + (int)s->borderWidth.top + gpBbox.Y;\r\n\r\n    // TODO: can I avoid making a copy of GraphicsPath?\r\n    GraphicsPath *tmp = graphicsPath->Clone();\r\n    Matrix m;\r\n    m.Translate((float)x, (float)y);\r\n    tmp->Transform(&m);\r\n    gfx->FillPath(brFill, tmp);\r\n    if (0.f != s->strokeWidth)\r\n        gfx->DrawPath(&pen, tmp);\r\n\r\n    delete tmp;\r\n}\r\n\r\nvoid ButtonVector::UpdateAfterStyleChange() {\r\n    if (IsMouseOver())\r\n        SetStyle(styleMouseOver);\r\n    else\r\n        SetStyle(styleDefault);\r\n\r\n    RecalculateSize(true);\r\n}\r\n\r\nvoid ButtonVector::SetStyles(Style *def, Style *mouseOver) {\r\n    styleDefault = def;\r\n    styleMouseOver = mouseOver;\r\n    UpdateAfterStyleChange();\r\n}\r\n\r\nvoid ButtonVector::SetDefaultStyle(Style *style) {\r\n    styleDefault = style;\r\n    UpdateAfterStyleChange();\r\n}\r\n\r\nvoid ButtonVector::SetMouseOverStyle(Style *style) {\r\n    styleMouseOver = style;\r\n    UpdateAfterStyleChange();\r\n}\r\n}\r\n"
  },
  {
    "path": "src/mui/MuiButton.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// Button is a combined label/button control. It can have 2 visual states:\r\n// regular and when mouse is over it.\r\n\r\nclass Button : public Control {\r\n    // use SetStyles() to set\r\n    Style *styleDefault;   // gStyleButtonDefault if styleDefault is nullptr\r\n    Style *styleMouseOver; // gStyleButtonMouseOver if nullptr\r\n\r\n    void UpdateAfterStyleChange();\r\n\r\n  public:\r\n    Button(const WCHAR *s, Style *def, Style *mouseOver);\r\n\r\n    virtual ~Button();\r\n\r\n    void SetText(const WCHAR *s);\r\n\r\n    void RecalculateSize(bool repaintIfSizeDidntChange);\r\n\r\n    virtual Size Measure(const Size availableSize);\r\n    virtual void Paint(Graphics *gfx, int offX, int offY);\r\n\r\n    virtual void NotifyMouseEnter();\r\n    virtual void NotifyMouseLeave();\r\n\r\n    void SetDefaultStyle(Style *style);\r\n    void SetMouseOverStyle(Style *style);\r\n    void SetStyles(Style *def, Style *mouseOver);\r\n\r\n    WCHAR *text;\r\n    int textDx; // cached measured text width\r\n};\r\n\r\n// TODO: maybe should combine Button and ButtonVector into one?\r\nclass ButtonVector : public Control {\r\n    // use SetStyles() to set\r\n    Style *styleDefault;   // gStyleButtonDefault if styleDefault is nullptr\r\n    Style *styleMouseOver; // gStyleButtonMouseOver if nullptr\r\n\r\n    GraphicsPath *graphicsPath;\r\n\r\n    void UpdateAfterStyleChange();\r\n\r\n  public:\r\n    ButtonVector();\r\n    ButtonVector(GraphicsPath *gp);\r\n\r\n    virtual ~ButtonVector();\r\n\r\n    void SetGraphicsPath(GraphicsPath *gp);\r\n\r\n    void RecalculateSize(bool repaintIfSizeDidntChange);\r\n\r\n    virtual Size Measure(const Size availableSize);\r\n    virtual void Paint(Graphics *gfx, int offX, int offY);\r\n\r\n    virtual void NotifyMouseEnter();\r\n    virtual void NotifyMouseLeave();\r\n\r\n    void SetDefaultStyle(Style *style);\r\n    void SetMouseOverStyle(Style *style);\r\n    void SetStyles(Style *def, Style *mouseOver);\r\n};\r\n"
  },
  {
    "path": "src/mui/MuiControl.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"Mui.h\"\r\n#include \"BitManip.h\"\r\n\r\nnamespace mui {\r\n\r\nstatic HWND gHwndControlTooltip = nullptr;\r\n\r\nstatic void CreateInfotipForLink(HWND hwndParent, const WCHAR *url, RECT pos) {\r\n    if (gHwndControlTooltip)\r\n        return;\r\n\r\n    HINSTANCE hinst = GetModuleHandle(nullptr);\r\n    gHwndControlTooltip =\r\n        CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, nullptr,\r\n                       WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT,\r\n                       CW_USEDEFAULT, CW_USEDEFAULT, hwndParent, nullptr, hinst, nullptr);\r\n\r\n    TOOLINFO ti = { 0 };\r\n    ti.cbSize = sizeof(ti);\r\n    ti.hwnd = hwndParent;\r\n    ti.uFlags = TTF_SUBCLASS;\r\n    ti.lpszText = (WCHAR *)url;\r\n    ti.rect = pos;\r\n\r\n    SendMessage(gHwndControlTooltip, TTM_ADDTOOL, 0, (LPARAM)&ti);\r\n}\r\n\r\nstatic void ClearInfotip(HWND hwndParent) {\r\n    if (!gHwndControlTooltip)\r\n        return;\r\n\r\n    TOOLINFO ti = { 0 };\r\n    ti.cbSize = sizeof(ti);\r\n    ti.hwnd = hwndParent;\r\n\r\n    SendMessage(gHwndControlTooltip, TTM_DELTOOL, 0, (LPARAM)&ti);\r\n    DestroyWindow(gHwndControlTooltip);\r\n    gHwndControlTooltip = nullptr;\r\n}\r\n\r\n// we use uint16 for those\r\nstatic_assert(Control::WantedInputBitLast < 16, \"too many bits used for WantedInputBits\");\r\nstatic_assert(Control::StateBitLast < 16, \"too many bits used for StateBits\");\r\n\r\nControl::Control(Control *newParent) {\r\n    wantedInputBits = 0;\r\n    stateBits = 0;\r\n    zOrder = 0;\r\n    toolTip = nullptr;\r\n    parent = nullptr;\r\n    hwndParent = nullptr;\r\n    layout = nullptr;\r\n    hCursor = nullptr;\r\n    cachedStyle = nullptr;\r\n    namedEventClick = nullptr;\r\n    SetStyle(nullptr);\r\n    pos = Rect();\r\n    if (newParent)\r\n        SetParent(newParent);\r\n}\r\n\r\nvoid Control::SetToolTip(const WCHAR *toolTip) {\r\n    str::ReplacePtr(&this->toolTip, toolTip);\r\n    if (nullptr == toolTip)\r\n        wantedInputBits &= WantsMouseOverBit;\r\n    else\r\n        wantedInputBits |= WantsMouseOverBit;\r\n}\r\n\r\nvoid Control::SetNamedEventClick(const char *s) { str::ReplacePtr(&this->namedEventClick, s); }\r\n\r\n// note: all derived classes must call Control::NotifyMouseEnter()\r\n// from their own NotifyMouseEnter().\r\nvoid Control::NotifyMouseEnter() {\r\n    // show url as a tooltip\r\n    HwndWrapper *hw = GetRootHwndWnd(this);\r\n    HWND hwndParent = hw->hwndParent;\r\n    int x = 0, y = 0;\r\n    MapMyToRootPos(x, y);\r\n    RECT pos = { x, y, 0, 0 };\r\n    pos.right = x + this->pos.Width;\r\n    pos.bottom = y + this->pos.Height;\r\n    CreateInfotipForLink(hwndParent, toolTip, pos);\r\n}\r\n\r\n// note: all derived classes must call Control::NotifyMouseLeave()\r\n// from their own NotifyMouseLeave().\r\nvoid Control::NotifyMouseLeave() {\r\n    // hide url tooltip\r\n    HwndWrapper *hw = GetRootHwndWnd(this);\r\n    HWND hwndParent = hw->hwndParent;\r\n    ClearInfotip(hwndParent);\r\n}\r\n\r\nControl::~Control() {\r\n    delete layout;\r\n    DeleteVecMembers(children);\r\n    free(toolTip);\r\n    free((void *)namedEventClick);\r\n}\r\n\r\nvoid Control::SetParent(Control *newParent) { parent = newParent; }\r\n\r\nControl *Control::GetChild(size_t idx) const { return children.At(idx); }\r\n\r\nsize_t Control::GetChildCount() const { return children.Count(); }\r\n\r\nbool Control::WantsMouseClick() const { return bit::IsSet(wantedInputBits, WantsMouseClickBit); }\r\n\r\nbool Control::WantsMouseMove() const { return bit::IsSet(wantedInputBits, WantsMouseMoveBit); }\r\n\r\nbool Control::IsMouseOver() const { return bit::IsSet(stateBits, MouseOverBit); }\r\n\r\nbool Control::IsVisible() const { return !bit::IsSet(stateBits, IsHiddenBit); }\r\n\r\nvoid Control::SetIsMouseOver(bool isOver) {\r\n    if (isOver)\r\n        bit::Set(stateBits, MouseOverBit);\r\n    else\r\n        bit::Clear(stateBits, MouseOverBit);\r\n}\r\n\r\nvoid Control::AddChild(Control *c, int pos) {\r\n    CrashIf(nullptr == c);\r\n    if ((pos < 0) || (pos >= (int)children.Count()))\r\n        children.Append(c);\r\n    else\r\n        children.InsertAt(pos, c);\r\n    c->SetParent(this);\r\n}\r\n\r\nvoid Control::AddChild(Control *c1, Control *c2, Control *c3) {\r\n    AddChild(c1);\r\n    AddChild(c2);\r\n    if (c3)\r\n        AddChild(c3);\r\n}\r\n\r\nSize Control::Measure(const Size availableSize) {\r\n    if (layout) {\r\n        return layout->Measure(availableSize);\r\n    }\r\n    if (children.Count() == 1) {\r\n        ILayout *l = children.At(0);\r\n        return l->Measure(availableSize);\r\n    }\r\n    desiredSize = Size();\r\n    return desiredSize;\r\n}\r\n\r\nSize Control::DesiredSize() { return desiredSize; }\r\n\r\nvoid Control::MeasureChildren(Size availableSize) const {\r\n    for (size_t i = 0; i < GetChildCount(); i++) {\r\n        GetChild(i)->Measure(availableSize);\r\n    }\r\n}\r\n\r\nvoid Control::Arrange(const Rect finalRect) {\r\n    SetPosition(finalRect);\r\n    if (layout) {\r\n        // might over-write position if our layout knows about us\r\n        layout->Arrange(finalRect);\r\n    } else {\r\n        if (children.Count() == 1) {\r\n            ILayout *l = children.At(0);\r\n            l->Arrange(finalRect);\r\n        }\r\n    }\r\n}\r\n\r\nvoid Control::Show() {\r\n    if (IsVisible())\r\n        return; // perf: avoid unnecessary repaints\r\n    bit::Clear(stateBits, IsHiddenBit);\r\n    // showing/hiding controls might affect layout, so we need\r\n    // to re-do layout.\r\n    // Note: not sure if have to RequestRepaint(this) as well\r\n    RequestLayout(this);\r\n}\r\n\r\nvoid Control::Hide() {\r\n    if (!IsVisible())\r\n        return;\r\n    RequestRepaint(this); // request repaint before hiding, to trigger repaint\r\n    bit::Set(stateBits, IsHiddenBit);\r\n    RequestLayout(this);\r\n}\r\n\r\nvoid Control::SetPosition(const Rect &p) {\r\n    if (p.Equals(pos))\r\n        return; // perf optimization\r\n    bool sizeChanged = (p.Width != pos.Width) || (p.Height != pos.Height);\r\n    // when changing position we need to invalidate both\r\n    // before and after position\r\n    // TODO: not sure why I need this, but without it there\r\n    // are drawing artifacts\r\n    Rect p1(p);\r\n    p1.Inflate(1, 1);\r\n    Rect p2(pos);\r\n    p2.Inflate(1, 1);\r\n    RequestRepaint(this, &p1, &p2);\r\n    pos = p;\r\n    if (!sizeChanged)\r\n        return;\r\n    HwndWrapper *hwnd = GetRootHwndWnd(this);\r\n    hwnd->evtMgr->NotifySizeChanged(this, p.Width, p.Height);\r\n}\r\n\r\nvoid Control::MapMyToRootPos(int &x, int &y) const {\r\n    // calculate the offset of window w within its root window\r\n    x += pos.X;\r\n    y += pos.Y;\r\n    const Control *c = this;\r\n    if (c->parent)\r\n        c = c->parent;\r\n    while (c && !c->hwndParent) {\r\n        x += c->pos.X;\r\n        y += c->pos.Y;\r\n        c = c->parent;\r\n    }\r\n}\r\n\r\n// convert position (x,y) in coordinates of root window\r\n// to position in this window's coordinates\r\nvoid Control::MapRootToMyPos(int &x, int &y) const {\r\n    int offX = pos.X;\r\n    int offY = pos.Y;\r\n    const Control *c = this;\r\n    while (c->parent) {\r\n        c = c->parent;\r\n        offX += c->pos.X;\r\n        offY += c->pos.Y;\r\n    }\r\n    x -= offX;\r\n    y -= offY;\r\n}\r\n\r\n// Requests the window to draw itself on a Graphics canvas.\r\n// offX and offY is a position of this window within\r\n// Graphics canvas (pos is relative to that offset)\r\nvoid Control::Paint(Graphics *gfx, int offX, int offY) {\r\n    UNUSED(gfx);\r\n    UNUSED(offX);\r\n    UNUSED(offY);\r\n    CrashIf(!IsVisible());\r\n}\r\n\r\n// returns true if the style of control has changed\r\nbool Control::SetStyle(Style *style) {\r\n    bool changed;\r\n    CachedStyle *currStyle = cachedStyle;\r\n    cachedStyle = CacheStyle(style, &changed);\r\n    if (currStyle != cachedStyle)\r\n        changed = true;\r\n    if (changed)\r\n        RequestRepaint(this);\r\n    return changed;\r\n}\r\n}\r\n"
  },
  {
    "path": "src/mui/MuiControl.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nclass EventMgr;\r\n\r\nclass Control : public ILayout {\r\n  public:\r\n    // allows a control to opt-out from being notified about\r\n    // input events, stored in wantedInputBits\r\n    enum WantedInputBits {\r\n        WantsMouseOverBit = 0,\r\n        WantsMouseDownBit = 1,\r\n        WantsMouseUpBit = 2,\r\n        WantsMouseClickBit = 3,\r\n        WantsMouseMoveBit = 4,\r\n        WantedInputBitLast\r\n    };\r\n\r\n    // describes current state of a window, stored in stateBits\r\n    enum ControlStateBits {\r\n        MouseOverBit = 0,\r\n        IsPressedBit = 1,\r\n        // using IsHidden and not IsVisible so that 0 is default, visible state\r\n        IsHiddenBit = 2,\r\n        StateBitLast\r\n    };\r\n\r\n    Control(Control *newParent = nullptr);\r\n    virtual ~Control();\r\n\r\n    void SetParent(Control *newParent);\r\n    void AddChild(Control *c, int pos = -1);\r\n    void AddChild(Control *c1, Control *c2, Control *c3 = nullptr);\r\n    Control *GetChild(size_t idx) const;\r\n    size_t GetChildCount() const;\r\n\r\n    void SetPosition(const Rect &p);\r\n\r\n    virtual void Paint(Graphics *gfx, int offX, int offY);\r\n\r\n    // ILayout\r\n    virtual Size Measure(const Size availableSize);\r\n    virtual void Arrange(const Rect finalRect);\r\n    virtual Size DesiredSize();\r\n\r\n    // mouse enter/leave are used e.g. by a button to change the look when mouse\r\n    // is over them. The intention is that in response to those a window should\r\n    // only do minimal processing that affects the window itself, not the rest\r\n    // of the system\r\n    virtual void NotifyMouseEnter();\r\n    virtual void NotifyMouseLeave();\r\n\r\n    virtual void NotifyMouseMove(int x, int y) {\r\n        UNUSED(x);\r\n        UNUSED(y);\r\n    }\r\n\r\n    bool WantsMouseClick() const;\r\n    bool WantsMouseMove() const;\r\n    bool IsMouseOver() const;\r\n    void SetIsMouseOver(bool isOver);\r\n\r\n    bool IsVisible() const;\r\n    void Hide();\r\n    void Show();\r\n\r\n    void SetToolTip(const WCHAR *);\r\n    void SetNamedEventClick(const char *);\r\n\r\n    void MeasureChildren(Size availableSize) const;\r\n    void MapMyToRootPos(int &x, int &y) const;\r\n    void MapRootToMyPos(int &x, int &y) const;\r\n\r\n    uint16 wantedInputBits; // WndWantedInputBits\r\n    uint16 stateBits;       // WndStateBits\r\n    // windows with bigger z-order are painted on top, 0 is default\r\n    int16 zOrder;\r\n\r\n    ILayout *layout;\r\n    Control *parent;\r\n\r\n    WCHAR *toolTip;\r\n\r\n    const char *namedEventClick;\r\n\r\n    // we cache properties for the current style during SetStyle() which\r\n    // makes if fast to access them anywhere without repeating the work\r\n    // of searching the style inheritance chain\r\n    CachedStyle *cachedStyle;\r\n    bool SetStyle(Style *style);\r\n\r\n    // only used by HwndWrapper but we need it here\r\n    // TODO: figure out to not have it in every Control\r\n    HWND hwndParent;\r\n\r\n    // cursor to show when mouse is over this window.\r\n    // only works if the window sets WantsMouseOverBit.\r\n    // Control doesn't own hCursor in order to enable easy\r\n    // sharing of cursor among many windows.\r\n    HCURSOR hCursor;\r\n\r\n    // position and size (relative to parent, might be outside of parent's bounds)\r\n    Rect pos;\r\n\r\n  protected:\r\n    Vec<Control *> children;\r\n\r\n    // desired size calculated in Measure()\r\n    Size desiredSize;\r\n};\r\n"
  },
  {
    "path": "src/mui/MuiCss.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"VecSegmented.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"Mui.h\"\r\n\r\nusing namespace Gdiplus;\r\n\r\n/*\r\nA css-like way to style controls/windows.\r\n\r\nWe define a bunch of css-like properties.\r\n\r\nWe have a Style, which is a logical group of properties.\r\n\r\nEach control can have one or more styles that define how\r\na control looks like. A window has only one set of properties\r\nbut e.g. a button has two (one for normal look and one for\r\nmouse hover look).\r\n\r\nWe define a bunch of default style so that if e.g. button\r\ndoesn't have a style explicitly set, it'll get all the necessary\r\nproperties from our default set.\r\n\r\nProp objects are never freed. To conserve memory, they are\r\ninternalized i.e. there are never 2 Prop objects with exactly\r\nthe same data.\r\n*/\r\n\r\nnamespace mui {\r\nnamespace css {\r\n\r\n#define MKARGB(a, r, g, b) (((ARGB)(b)) | ((ARGB)(g) << 8) | ((ARGB)(r) << 16) | ((ARGB)(a) << 24))\r\n#define MKRGB(r, g, b) (((ARGB)(b)) | ((ARGB)(g) << 8) | ((ARGB)(r) << 16) | ((ARGB)(0xff) << 24))\r\n\r\nstruct FontCacheEntry {\r\n    Prop *fontName;\r\n    Prop *fontSize;\r\n    Prop *fontWeight;\r\n    Font *font;\r\n\r\n    // Prop objects are interned, so if the pointer is\r\n    // the same, the value is the same too\r\n    bool operator==(FontCacheEntry &other) const {\r\n        return ((fontName == other.fontName) && (fontSize == other.fontSize) &&\r\n                (fontWeight == other.fontWeight));\r\n    }\r\n};\r\n\r\n// gStyleDefault is a fallback style. It contains a default\r\n// value for each possible property. If a property is not\r\n// found in a given style, we use the value from gStyleDefault\r\n// An app might modify gStyleDefault but it should be done\r\n// as a first thing to avoid stale props from caching (cache\r\n// will be correctly refreshed if Control::SetStyle() is called)\r\nstatic Style *gStyleDefault = nullptr;\r\n// default button styles for convenience. The user must explicitly\r\n// use them in inheritance chain of their custom button styles\r\n// They can be obtained via GetStyleButtonDefault() and GetStyleButtonDefaultMouseOver()\r\nstatic Style *gStyleButtonDefault = nullptr;\r\nstatic Style *gStyleButtonMouseOver = nullptr;\r\n\r\nstruct StyleCacheEntry {\r\n    Style *style;\r\n    size_t styleId;\r\n    CachedStyle cachedStyle;\r\n};\r\n\r\n// Those must be VecSegmented so that code can retain pointers to\r\n// their elements (we can't move the memory)\r\nstatic VecSegmented<Prop> *gAllProps = nullptr;\r\nstatic VecSegmented<StyleCacheEntry> *gStyleCache = nullptr;\r\n\r\nvoid Initialize() {\r\n    CrashIf(gAllProps);\r\n\r\n    gAllProps = new VecSegmented<Prop>();\r\n\r\n    // gStyleDefault must have values for all properties\r\n    gStyleDefault = new Style();\r\n    gStyleDefault->SetName(\"default\");\r\n    gStyleDefault->Set(Prop::AllocFontName(L\"Times New Roman\"));\r\n    gStyleDefault->Set(Prop::AllocFontSize(14));\r\n    gStyleDefault->Set(Prop::AllocFontWeight(FontStyleBold));\r\n    gStyleDefault->Set(Prop::AllocColorSolid(PropColor, \"black\"));\r\n// gStyleDefault->Set(Prop::AllocColorSolid(PropBgColor, 0xff, 0xff, 0xff));\r\n#if 0\r\n    ARGB c1 = MKRGB(0x00, 0x00, 0x00);\r\n    ARGB c2 = MKRGB(0xff, 0xff, 0xff);\r\n#else\r\n    ARGB c1 = MKRGB(0xf5, 0xf6, 0xf6);\r\n    ARGB c2 = MKRGB(0xe4, 0xe4, 0xe3);\r\n#endif\r\n    gStyleDefault->Set(\r\n        Prop::AllocColorLinearGradient(PropBgColor, LinearGradientModeVertical, c1, c2));\r\n    gStyleDefault->SetBorderWidth(1);\r\n    gStyleDefault->SetBorderColor(MKRGB(0x99, 0x99, 0x99));\r\n    gStyleDefault->Set(Prop::AllocColorSolid(PropBorderBottomColor, \"#888\"));\r\n    gStyleDefault->Set(Prop::AllocPadding(0, 0, 0, 0));\r\n    gStyleDefault->Set(Prop::AllocTextAlign(Align_Left));\r\n    gStyleDefault->Set(Prop::AllocAlign(PropVertAlign, ElAlign::Center));\r\n    gStyleDefault->Set(Prop::AllocAlign(PropHorizAlign, ElAlign::Center));\r\n    gStyleDefault->Set(Prop::AllocColorSolid(PropFill, \"white\"));\r\n    gStyleDefault->Set(Prop::AllocColorSolid(PropStroke, \"black\"));\r\n    gStyleDefault->Set(Prop::AllocWidth(PropStrokeWidth, 0.5f));\r\n\r\n    gStyleButtonDefault = new Style(gStyleDefault);\r\n    gStyleButtonDefault->SetName(\"buttonDefault\");\r\n    gStyleButtonDefault->Set(Prop::AllocPadding(4, 8, 4, 8));\r\n    gStyleButtonDefault->Set(Prop::AllocFontName(L\"Lucida Grande\"));\r\n    gStyleButtonDefault->Set(Prop::AllocFontSize(8));\r\n    gStyleButtonDefault->Set(Prop::AllocFontWeight(FontStyleBold));\r\n\r\n    gStyleButtonMouseOver = new Style(gStyleButtonDefault);\r\n    gStyleButtonMouseOver->SetName(\"buttonDefaultMouseOver\");\r\n    gStyleButtonMouseOver->Set(Prop::AllocColorSolid(PropBorderTopColor, \"#777\"));\r\n    gStyleButtonMouseOver->Set(Prop::AllocColorSolid(PropBorderRightColor, \"#777\"));\r\n    gStyleButtonMouseOver->Set(Prop::AllocColorSolid(PropBorderBottomColor, \"#666\"));\r\n    // gStyleButtonMouseOver->Set(Prop::AllocColorSolid(PropBgColor, 180, 0, 0, 255));\r\n    // gStyleButtonMouseOver->Set(Prop::AllocColorSolid(PropBgColor, \"transparent\"));\r\n\r\n    gStyleCache = new VecSegmented<StyleCacheEntry>();\r\n    CacheStyle(gStyleDefault, nullptr);\r\n    CacheStyle(gStyleButtonDefault, nullptr);\r\n    CacheStyle(gStyleButtonMouseOver, nullptr);\r\n}\r\n\r\nvoid Destroy() {\r\n    for (Prop &p : *gAllProps) {\r\n        p.Free();\r\n    }\r\n    delete gAllProps;\r\n\r\n    for (StyleCacheEntry &e : *gStyleCache) {\r\n        delete e.style;\r\n    }\r\n    delete gStyleCache;\r\n}\r\n\r\nbool IsWidthProp(PropType type) {\r\n    return (PropBorderTopWidth == type) || (PropBorderRightWidth == type) ||\r\n           (PropBorderBottomWidth == type) || (PropBorderLeftWidth == type) ||\r\n           (PropStrokeWidth == type);\r\n}\r\n\r\nbool IsColorProp(PropType type) {\r\n    return (PropColor == type) || (PropBgColor == type) || (PropBorderTopColor == type) ||\r\n           (PropBorderRightColor == type) || (PropBorderBottomColor == type) ||\r\n           (PropBorderLeftColor == type) || (PropFill == type) || (PropStroke == type);\r\n}\r\n\r\nbool IsAlignProp(PropType type) { return ((PropVertAlign == type) || (PropHorizAlign == type)); }\r\n\r\n// TODO: use FindCssColor from gen_fast_string_lookup.py\r\n//       once there are significantly more colors\r\nstatic struct {\r\n    const char *name;\r\n    ARGB value;\r\n} gCssKnownColors[] = {\r\n    { \"black\", (ARGB)Color::Black },\r\n    { \"blue\", (ARGB)Color::Blue },\r\n    { \"gray\", (ARGB)Color::Gray },\r\n    { \"green\", (ARGB)Color::Green },\r\n    { \"red\", (ARGB)Color::Red },\r\n    { \"white\", (ARGB)Color::White },\r\n    { \"transparent\", MKARGB(0, 0, 0, 0) },\r\n    { \"sepia\", MKRGB(0xfb, 0xf0, 0xd9) },\r\n    { \"light blue\", MKRGB(0x64, 0xc7, 0xef) },\r\n    { \"light gray\", MKRGB(0xf0, 0xf0, 0xf0) },\r\n};\r\n\r\nstatic bool GetKnownCssColor(const char *name, ARGB &colOut) {\r\n    for (size_t i = 0; i < dimof(gCssKnownColors); i++) {\r\n        if (str::EqI(name, gCssKnownColors[i].name)) {\r\n            colOut = gCssKnownColors[i].value;\r\n            return true;\r\n        }\r\n    }\r\n    return false;\r\n}\r\n\r\n// Parses css-like color formats:\r\n// rrggbb, #rrggbb, #aarrggbb, #rgb, 0xrgb, 0xrrggbb\r\n// rgb(r,g,b), rgba(r,g,b,a) rgb(r%, g%, b%), rgba(r%, g%, b%, a%)\r\n// cf. https://developer.mozilla.org/en/CSS/color_value\r\nARGB ParseCssColor(const char *color) {\r\n    // parse #RRGGBB and #RGB and rgb(R,G,B)\r\n    int a, r, g, b;\r\n\r\n    // a bit too relaxed, but by skipping 0x and #\r\n    // we'll easily parse all variations of hex-encoded values\r\n    if (color[0] == '0' && color[1] == 'x')\r\n        color += 2;\r\n\r\n    if (*color == '#')\r\n        ++color;\r\n\r\n    // parse: #rgb, 0xrgb, rgb (which is a shortcut for #rrggbb)\r\n    if (str::Parse(color, \"%1x%1x%1x%$\", &r, &g, &b)) {\r\n        r |= (r << 4);\r\n        g |= (g << 4);\r\n        b |= (b << 4);\r\n        return MKRGB(r, g, b);\r\n    }\r\n\r\n    // parse rrggbb, #rrggbb, 0xrrggbb and rgb(n,n,n)\r\n    if (str::Parse(color, \"%2x%2x%2x%$\", &r, &g, &b) ||\r\n        str::Parse(color, \"rgb(%d,%d,%d)\", &r, &g, &b)) {\r\n        return MKRGB(r, g, b);\r\n    }\r\n\r\n    // parse aarrggbb, #aarrggbb, 0xaarrggbb and rgba(R,G,B,A)\r\n    if (str::Parse(color, \"%2x%2x%2x%2x%$\", &a, &r, &g, &b) ||\r\n        str::Parse(color, \"rgba(%d,%d,%d,%d)\", &r, &g, &b, &a)) {\r\n        return MKARGB(a, r, g, b);\r\n    }\r\n\r\n    // parse rgb(R%,G%,B%) and rgba(R%,G%,B%,A%)\r\n    float fa = 1.0f, fr, fg, fb;\r\n    if (str::Parse(color, \"rgb(%f%%,%f%%,%f%%)\", &fr, &fg, &fb) ||\r\n        str::Parse(color, \"rgba(%f%%,%f%%,%f%%,%f%%)\", &fr, &fg, &fb, &fa)) {\r\n        return MKARGB((int)(fa * 2.55f), (int)(fr * 2.55f), (int)(fg * 2.55f), (int)(fb * 2.55f));\r\n    }\r\n\r\n    // parse known color names\r\n    ARGB colVal = MKARGB(0, 0, 0, 0); // transparent if not known\r\n    GetKnownCssColor(color, colVal);\r\n    return colVal;\r\n}\r\n\r\nbool ColorData::operator==(const ColorData &other) const {\r\n    if (type != other.type)\r\n        return false;\r\n\r\n    if (ColorSolid == type)\r\n        return solid.color == other.solid.color;\r\n\r\n    if (ColorGradientLinear == type) {\r\n        return (gradientLinear.mode == other.gradientLinear.mode) &&\r\n               (gradientLinear.startColor == other.gradientLinear.startColor) &&\r\n               (gradientLinear.endColor == other.gradientLinear.endColor);\r\n    }\r\n    CrashIf(true);\r\n    return false;\r\n}\r\n\r\nbool ElAlignData::operator==(const ElAlignData &other) const {\r\n    return ((elementPoint == other.elementPoint) && (containerPoint == other.containerPoint));\r\n}\r\n\r\n// Note: the order must match enum ElAlign\r\nstruct ElAlignData g_ElAlignVals[5] = {\r\n    { .5f, .5f }, // ElAlign::Center\r\n    { 0.f, 0.f }, // ElAlign::Top\r\n    { 1.f, 1.f }, // ElAlign::Bottom\r\n    { 0.f, 0.f }, // ElAlign::Left\r\n    { 1.f, 1.f }, // ElAlign::Right\r\n};\r\n\r\n// calculates the offset of an element within container\r\nint ElAlignData::CalcOffset(int elSize, int containerSize) const {\r\n    int ep = (int)((float)elSize * elementPoint);\r\n    int cp = (int)((float)containerSize * containerPoint);\r\n    return cp - ep;\r\n}\r\n\r\nvoid Prop::Free() {\r\n    if (PropFontName == type)\r\n        free(fontName);\r\n    else if (PropStyleName == type)\r\n        free(styleName);\r\n    else if (IsColorProp(type) && (ColorSolid == color.type))\r\n        ::delete color.solid.cachedBrush;\r\n    else if (IsColorProp(type) && (ColorGradientLinear == color.type)) {\r\n        ::delete color.gradientLinear.cachedBrush;\r\n        ::delete color.gradientLinear.rect;\r\n    }\r\n}\r\n\r\nbool Prop::Eq(const Prop *other) const {\r\n    if (type != other->type)\r\n        return false;\r\n\r\n    switch (type) {\r\n        case PropStyleName:\r\n            return str::Eq(styleName, other->styleName);\r\n        case PropFontName:\r\n            return str::Eq(fontName, other->fontName);\r\n        case PropFontSize:\r\n            return fontSize == other->fontSize;\r\n        case PropFontWeight:\r\n            return fontWeight == other->fontWeight;\r\n        case PropPadding:\r\n            return padding == other->padding;\r\n        case PropTextAlign:\r\n            return textAlign == other->textAlign;\r\n    }\r\n\r\n    if (IsColorProp(type))\r\n        return color == other->color;\r\n\r\n    if (IsWidthProp(type))\r\n        return width == other->width;\r\n\r\n    if (IsAlignProp(type))\r\n        return elAlign == other->elAlign;\r\n\r\n    CrashIf(true);\r\n    return false;\r\n}\r\n\r\nstatic Prop *FindExistingProp(Prop *prop) {\r\n    for (Prop &p : *gAllProps) {\r\n        if (p.Eq(prop))\r\n            return &p;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nstatic Prop *UniqifyProp(Prop &p) {\r\n    Prop *existing = FindExistingProp(&p);\r\n    if (existing) {\r\n        p.Free();\r\n        return existing;\r\n    }\r\n    return gAllProps->Append(p);\r\n}\r\n\r\nProp *Prop::AllocStyleName(const char *styleName) {\r\n    Prop p(PropStyleName);\r\n    p.styleName = str::Dup(styleName);\r\n    return UniqifyProp(p);\r\n}\r\n\r\nProp *Prop::AllocFontName(const WCHAR *name) {\r\n    Prop p(PropFontName);\r\n    p.fontName = str::Dup(name);\r\n    return UniqifyProp(p);\r\n}\r\n\r\nProp *Prop::AllocFontSize(float size) {\r\n    Prop p(PropFontSize);\r\n    p.fontSize = size;\r\n    return UniqifyProp(p);\r\n}\r\n\r\nProp *Prop::AllocFontWeight(FontStyle style) {\r\n    Prop p(PropFontWeight);\r\n    p.fontWeight = style;\r\n    return UniqifyProp(p);\r\n}\r\n\r\nProp *Prop::AllocWidth(PropType type, float width) {\r\n    CrashIf(!IsWidthProp(type));\r\n    Prop p(type);\r\n    p.width = width;\r\n    return UniqifyProp(p);\r\n}\r\n\r\nProp *Prop::AllocTextAlign(AlignAttr align) {\r\n    Prop p(PropTextAlign);\r\n    p.textAlign = align;\r\n    return UniqifyProp(p);\r\n}\r\n\r\nProp *Prop::AllocAlign(PropType type, float elPoint, float containerPoint) {\r\n    CrashIf(!IsAlignProp(type));\r\n    Prop p(type);\r\n    p.elAlign = GetElAlign(elPoint, containerPoint);\r\n    return UniqifyProp(p);\r\n}\r\n\r\nProp *Prop::AllocAlign(PropType type, ElAlign align) {\r\n    CrashIf(!IsAlignProp(type));\r\n    Prop p(type);\r\n    p.elAlign = GetElAlign(align);\r\n    return UniqifyProp(p);\r\n}\r\n\r\nProp *Prop::AllocPadding(int top, int right, int bottom, int left) {\r\n    Padding pd = { top, right, bottom, left };\r\n    Prop p(PropPadding);\r\n    p.padding = pd;\r\n    return UniqifyProp(p);\r\n}\r\n\r\nProp *Prop::AllocColorSolid(PropType type, ARGB color) {\r\n    CrashIf(!IsColorProp(type));\r\n    Prop p(type);\r\n    p.color.type = ColorSolid;\r\n    p.color.solid.color = color;\r\n    p.color.solid.cachedBrush = nullptr;\r\n    Prop *res = UniqifyProp(p);\r\n    CrashIf(res->color.type != ColorSolid);\r\n    CrashIf(res->color.solid.color != color);\r\n    if (!res->color.solid.cachedBrush)\r\n        res->color.solid.cachedBrush = ::new SolidBrush(color);\r\n    return res;\r\n}\r\n\r\nProp *Prop::AllocColorSolid(PropType type, int a, int r, int g, int b) {\r\n    return AllocColorSolid(type, MKARGB(a, r, g, b));\r\n}\r\n\r\nProp *Prop::AllocColorSolid(PropType type, int r, int g, int b) {\r\n    return AllocColorSolid(type, MKARGB(0xff, r, g, b));\r\n}\r\n\r\nProp *Prop::AllocColorLinearGradient(PropType type, LinearGradientMode mode, ARGB startColor,\r\n                                     ARGB endColor) {\r\n    Prop p(type);\r\n    p.color.type = ColorGradientLinear;\r\n    p.color.gradientLinear.mode = mode;\r\n    p.color.gradientLinear.startColor = startColor;\r\n    p.color.gradientLinear.endColor = endColor;\r\n\r\n    p.color.gradientLinear.rect = ::new RectF();\r\n    p.color.gradientLinear.cachedBrush = nullptr;\r\n    return UniqifyProp(p);\r\n}\r\n\r\nProp *Prop::AllocColorLinearGradient(PropType type, LinearGradientMode mode, const char *startColor,\r\n                                     const char *endColor) {\r\n    ARGB c1 = ParseCssColor(startColor);\r\n    ARGB c2 = ParseCssColor(endColor);\r\n    return AllocColorLinearGradient(type, mode, c1, c2);\r\n}\r\n\r\nProp *Prop::AllocColorSolid(PropType type, const char *color) {\r\n    ARGB col = ParseCssColor(color);\r\n    return AllocColorSolid(type, col);\r\n}\r\n\r\nStyle *Style::GetInheritsFrom() const { return inheritsFrom; }\r\n\r\n// Identity is a way to track changes to Style\r\nsize_t Style::GetIdentity() const {\r\n    size_t identity = gen;\r\n    Style *curr = inheritsFrom;\r\n    while (curr) {\r\n        identity += curr->gen;\r\n        curr = curr->inheritsFrom;\r\n    }\r\n    identity += gStyleDefault->gen;\r\n    return identity;\r\n}\r\n\r\n// Add a property to a set, if a given PropType doesn't exist,\r\n// replace if a given PropType already exists in the set.\r\nvoid Style::Set(Prop *prop) {\r\n    CrashIf(!prop);\r\n    Prop *&p = props.FindEl([&](Prop *p2) { return p2->type == prop->type; });\r\n    if (p) {\r\n        if (!prop->Eq(p))\r\n            ++gen;\r\n        p = prop;\r\n        return;\r\n    }\r\n    props.Append(prop);\r\n    ++gen;\r\n}\r\n\r\nvoid Style::SetName(const char *styleName) { Set(Prop::AllocStyleName(styleName)); }\r\n\r\nvoid Style::SetPadding(int width) { Set(Prop::AllocPadding(width, width, width, width)); }\r\n\r\nvoid Style::SetPadding(int topBottom, int leftRight) {\r\n    Set(Prop::AllocPadding(topBottom, leftRight, topBottom, leftRight));\r\n}\r\n\r\nvoid Style::SetPadding(int top, int right, int bottom, int left) {\r\n    Set(Prop::AllocPadding(top, right, bottom, left));\r\n}\r\n\r\nvoid Style::SetBorderWidth(float width) {\r\n    Set(Prop::AllocWidth(PropBorderTopWidth, width));\r\n    Set(Prop::AllocWidth(PropBorderRightWidth, width));\r\n    Set(Prop::AllocWidth(PropBorderBottomWidth, width));\r\n    Set(Prop::AllocWidth(PropBorderLeftWidth, width));\r\n}\r\n\r\nvoid Style::SetBorderColor(ARGB color) {\r\n    Set(Prop::AllocColorSolid(PropBorderTopColor, color));\r\n    Set(Prop::AllocColorSolid(PropBorderRightColor, color));\r\n    Set(Prop::AllocColorSolid(PropBorderBottomColor, color));\r\n    Set(Prop::AllocColorSolid(PropBorderLeftColor, color));\r\n}\r\n\r\nstatic bool FoundAllProps(Prop **props) {\r\n    for (size_t i = 0; i < (size_t)PropsCount; i++) {\r\n        if (!props[i])\r\n            return false;\r\n    }\r\n    return true;\r\n}\r\n\r\n// props points to the Prop* array whos size must be PropsCount.\r\n// This function is designed to be called multiple times with\r\n// different styles. It only sets a given property in props\r\n// array if it's not already set (it should be all NULLs the first\r\n// time).\r\n// As an optimization it returns true if we got all props\r\nstatic bool GetAllProps(Style *style, Prop **props) {\r\n    bool inherited = false;\r\n    while (style) {\r\n        for (Prop *p : style->props) {\r\n            // PropStyleName is not inheritable\r\n            if ((PropStyleName == p->type) && inherited)\r\n                continue;\r\n            int propIdx = (int)p->type;\r\n            CrashIf(propIdx >= (int)PropsCount);\r\n            bool didSet = false;\r\n            if (!props[propIdx]) {\r\n                props[propIdx] = p;\r\n                didSet = true;\r\n            }\r\n            if (didSet && FoundAllProps(props))\r\n                return true;\r\n        }\r\n        style = style->GetInheritsFrom();\r\n        inherited = true;\r\n    }\r\n    return false;\r\n}\r\n\r\nstatic size_t GetStyleId(Style *style) {\r\n    if (!style)\r\n        return 0;\r\n    return style->GetIdentity();\r\n}\r\n\r\n// Because all styles implicitly inherit the properties they didn't explicitly\r\n// set from gStyleDefault, we need to track changes (via GetStyleId()) of both the given\r\n// style an gStyleDefault.\r\n// If a given style doesn't exist, we add it to the cache.\r\n// If it exists but it was modified or gStyleDefault was modified, we update the cache.\r\n// If it exists and didn't change, we return cached entry.\r\nCachedStyle *CacheStyle(Style *style, bool *changedOut) {\r\n    bool changedTmp;\r\n    if (!changedOut)\r\n        changedOut = &changedTmp;\r\n    *changedOut = false;\r\n\r\n    ScopedMuiCritSec muiCs;\r\n    StyleCacheEntry *e = nullptr;\r\n\r\n    for (StyleCacheEntry &e2 : *gStyleCache) {\r\n        if (e2.style == style) {\r\n            if (e2.styleId == GetStyleId(style)) {\r\n                return &e2.cachedStyle;\r\n            }\r\n            e = &e2;\r\n            break;\r\n        }\r\n    }\r\n\r\n    *changedOut = true;\r\n    Prop *props[PropsCount] = { 0 };\r\n    if (!GetAllProps(style, props))\r\n        GetAllProps(gStyleDefault, props);\r\n    for (size_t i = 0; i < dimof(props); i++) {\r\n        CrashIf(!props[i]);\r\n    }\r\n\r\n    CachedStyle s;\r\n    s.styleName = props[PropStyleName]->styleName;\r\n    s.fontName = props[PropFontName]->fontName;\r\n    s.fontSize = props[PropFontSize]->fontSize;\r\n    s.fontWeight = props[PropFontWeight]->fontWeight;\r\n    s.padding = props[PropPadding]->padding;\r\n    s.color = &(props[PropColor]->color);\r\n    s.bgColor = &(props[PropBgColor]->color);\r\n    s.borderWidth.top = props[PropBorderTopWidth]->width;\r\n    s.borderWidth.right = props[PropBorderRightWidth]->width;\r\n    s.borderWidth.bottom = props[PropBorderBottomWidth]->width;\r\n    s.borderWidth.left = props[PropBorderLeftWidth]->width;\r\n    s.borderColors.top = &(props[PropBorderTopColor]->color);\r\n    s.borderColors.right = &(props[PropBorderRightColor]->color);\r\n    s.borderColors.bottom = &(props[PropBorderBottomColor]->color);\r\n    s.borderColors.left = &(props[PropBorderLeftColor]->color);\r\n    s.textAlign = props[PropTextAlign]->textAlign;\r\n    s.vertAlign = props[PropVertAlign]->elAlign;\r\n    s.horizAlign = props[PropHorizAlign]->elAlign;\r\n    s.fill = &(props[PropFill]->color);\r\n    s.stroke = &(props[PropStroke]->color);\r\n    s.strokeWidth = props[PropStrokeWidth]->width;\r\n\r\n    if (e) {\r\n        e->cachedStyle = s;\r\n        e->styleId = GetStyleId(style);\r\n        return &e->cachedStyle;\r\n    }\r\n\r\n    StyleCacheEntry newEntry = { style, GetStyleId(style), s };\r\n    e = gStyleCache->Append(newEntry);\r\n    return &e->cachedStyle;\r\n}\r\n\r\nCachedStyle *CachedStyleByName(const char *name) {\r\n    if (!name)\r\n        return nullptr;\r\n    for (StyleCacheEntry &e : *gStyleCache) {\r\n        if (str::Eq(e.cachedStyle.styleName, name))\r\n            return &e.cachedStyle;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nStyle *StyleByName(const char *name) {\r\n    if (!name)\r\n        return nullptr;\r\n    for (StyleCacheEntry &e : *gStyleCache) {\r\n        if (str::Eq(e.cachedStyle.styleName, name))\r\n            return e.style;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nBrush *BrushFromColorData(ColorData *color, const RectF &r) {\r\n    if (ColorSolid == color->type)\r\n        return color->solid.cachedBrush;\r\n\r\n    if (ColorGradientLinear == color->type) {\r\n        ColorDataGradientLinear *d = &color->gradientLinear;\r\n        LinearGradientBrush *br = d->cachedBrush;\r\n        if (!br || !r.Equals(*d->rect)) {\r\n            ::delete br;\r\n            br = ::new LinearGradientBrush(r, d->startColor, d->endColor, d->mode);\r\n            *d->rect = r;\r\n            d->cachedBrush = br;\r\n        }\r\n        return br;\r\n    }\r\n\r\n    CrashIf(true);\r\n    return ::new SolidBrush(0);\r\n}\r\n\r\nBrush *BrushFromColorData(ColorData *color, const Rect &r) {\r\n    return BrushFromColorData(color,\r\n                              RectF((float)r.X, (float)r.Y, (float)r.Width, (float)r.Height));\r\n}\r\n\r\nstatic void AddBorders(int &dx, int &dy, CachedStyle *s) {\r\n    const BorderWidth &bw = s->borderWidth;\r\n    // note: width is a float, not sure how I should round them\r\n    dx += (int)(bw.left + bw.right);\r\n    dy += (int)(bw.top + bw.bottom);\r\n}\r\n\r\nSize GetBorderAndPaddingSize(CachedStyle *s) {\r\n    Padding pad = s->padding;\r\n    int dx = pad.left + pad.right;\r\n    int dy = pad.top + pad.bottom;\r\n    AddBorders(dx, dy, s);\r\n    return Size(dx, dy);\r\n}\r\n\r\nStyle *GetStyleDefault() { return gStyleDefault; }\r\n\r\nStyle *GetStyleButtonDefault() {\r\n#ifdef DEBUG\r\n    return StyleByName(\"buttonDefault\");\r\n#else\r\n    return gStyleButtonDefault;\r\n#endif\r\n}\r\n\r\nStyle *GetStyleButtonDefaultMouseOver() {\r\n#ifdef DEBUG\r\n    return StyleByName(\"buttonDefaultMouseOver\");\r\n#else\r\n    return gStyleButtonMouseOver;\r\n#endif\r\n}\r\n\r\n} // namespace css\r\n} // namespace mui\r\n"
  },
  {
    "path": "src/mui/MuiCss.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nnamespace css {\r\n\r\nenum PropType {\r\n    // Maybe: use Style::styleName instead of PropStyleName\r\n    PropStyleName = 0, // unique name of the style\r\n    PropFontName,      // font-family\r\n    PropFontSize,      // font-size\r\n    PropFontWeight,    // font-weight\r\n    PropPadding,       // padding\r\n    PropColor,         // color\r\n    PropBgColor,       // background-color\r\n\r\n    PropBorderTopWidth,    // border-top-width\r\n    PropBorderRightWidth,  // border-right-width\r\n    PropBorderBottomWidth, // border-bottom-width\r\n    PropBorderLeftWidth,   // border-left-width\r\n\r\n    PropBorderTopColor,    // border-top-color\r\n    PropBorderRightColor,  // border-right-color\r\n    PropBorderBottomColor, // border-bottom-color\r\n    PropBorderLeftColor,   // border-left-color\r\n\r\n    PropTextAlign, // text-align\r\n\r\n    // used to define horizontal/vertical alignment of an element\r\n    // inside a container. Used e.g. for a ButtonVector\r\n    PropVertAlign,\r\n    PropHorizAlign,\r\n\r\n    PropFill,        // fill, used for svg::path\r\n    PropStroke,      // stroke, used for svg::path\r\n    PropStrokeWidth, // stroke-width, used for svg::path\r\n\r\n    PropsCount // must be at the end!\r\n};\r\n\r\nbool IsWidthProp(PropType type);\r\nbool IsColorProp(PropType type);\r\nbool IsAlignProp(PropType type);\r\n\r\n// Align is a common name so to avoid potential conflicts, use ElAlign\r\n// which stands for Element Align.\r\n// Top/Left and Bottom/Right are represented by the same ElAlignData\r\n// values but they're semantically different, so we given them unique names\r\n// Note: must start at 0 and the order must match g_ElAlignVals\r\nenum class ElAlign { Center = 0, Top, Bottom, Left, Right };\r\n\r\n// A generalized way of specifying alignment (on a single axis,\r\n// vertical or horizontal) of an element relative to its container.\r\n// Each point of both the container and element can be represented\r\n// as a float in the <0.f - 1.f> range.\r\n// 0.f represents left (in horizontal case) or top (in vertical) case point.\r\n// 1.f represents right/bottom point and 0.5f represents a middle.\r\n// We define a point inside cotainer and point inside element and layout\r\n// positions element so that those points are the same.\r\n// For example:\r\n//  - (0.5f, 0.5f) centers element inside of the container.\r\n//  - (0.f, 0.f) makes left edge of the element align with left edge of the container\r\n//    i.e. ||el| container|\r\n//  - (1.f, 0.f) makes left edge of the element align with right edge of the container\r\n//    i.e. |container||el|\r\n// This is more flexible than, say, VerticalAlignment property in WPF.\r\n// Note: this could be extended for values outside of <0.f - 1.f> range.\r\nstruct ElAlignData {\r\n\r\n    float elementPoint;\r\n    float containerPoint;\r\n\r\n    bool operator==(const ElAlignData &other) const;\r\n    int CalcOffset(int elSize, int containerSize) const;\r\n};\r\n\r\nextern struct ElAlignData g_ElAlignVals[5];\r\n\r\n// we can't have constructors in ElAlignData, so those are\r\n// helper methods for constructing them\r\nstatic inline ElAlignData GetElAlignCenter() { return g_ElAlignVals[(int)ElAlign::Center]; }\r\n\r\nstatic inline ElAlignData GetElAlignTop() { return g_ElAlignVals[(int)ElAlign::Top]; }\r\n\r\nstatic inline ElAlignData GetElAlignLeft() { return g_ElAlignVals[(int)ElAlign::Left]; }\r\n\r\nstatic inline ElAlignData GetElAlignBottom() { return g_ElAlignVals[(int)ElAlign::Bottom]; }\r\n\r\nstatic inline ElAlignData GetElAlignRight() { return g_ElAlignVals[(int)ElAlign::Right]; }\r\n\r\nstatic inline ElAlignData GetElAlign(ElAlign align) {\r\n    size_t idx = (size_t)align;\r\n    CrashIf(idx >= dimof(g_ElAlignVals));\r\n    return g_ElAlignVals[idx];\r\n}\r\n\r\nstatic inline ElAlignData GetElAlign(float ep, float cp) {\r\n    ElAlignData align = { ep, cp };\r\n    return align;\r\n}\r\n\r\nenum ColorType {\r\n    ColorSolid,\r\n    ColorGradientLinear,\r\n    // TODO: other gradient types?\r\n};\r\n\r\nstruct ColorDataSolid {\r\n    ARGB color;\r\n    Brush *cachedBrush;\r\n};\r\n\r\nstruct ColorDataGradientLinear {\r\n    LinearGradientMode mode;\r\n    ARGB startColor;\r\n    ARGB endColor;\r\n    RectF *rect;\r\n    LinearGradientBrush *cachedBrush;\r\n};\r\n\r\nstruct ColorData {\r\n    ColorType type;\r\n    union {\r\n        ColorDataSolid solid;\r\n        ColorDataGradientLinear gradientLinear;\r\n    };\r\n\r\n    bool operator==(const ColorData &other) const;\r\n    bool IsTransparent() const { return type == ColorSolid && solid.color == 0; }\r\n};\r\n\r\nstruct Padding {\r\n    int top, right, bottom, left;\r\n    bool operator==(const Padding &other) const {\r\n        return (top == other.top) && (right == other.right) && (bottom == other.bottom) &&\r\n               (left == other.left);\r\n    }\r\n};\r\n\r\nstruct Prop {\r\n\r\n    Prop(PropType type) : type(type) {}\r\n\r\n    void Free();\r\n\r\n    PropType type;\r\n\r\n    union {\r\n        char *styleName;\r\n        WCHAR *fontName;\r\n        float fontSize;\r\n        FontStyle fontWeight;\r\n        Padding padding;\r\n        ColorData color;\r\n        float width;\r\n        AlignAttr textAlign;\r\n        ElAlignData elAlign;\r\n    };\r\n\r\n    bool Eq(const Prop *other) const;\r\n\r\n    static Prop *AllocStyleName(const char *styleName);\r\n    static Prop *AllocFontName(const WCHAR *name);\r\n    static Prop *AllocFontSize(float size);\r\n    static Prop *AllocFontWeight(FontStyle style);\r\n    // TODO: add AllocTextAlign(const char *s);\r\n    static Prop *AllocTextAlign(AlignAttr align);\r\n    static Prop *AllocAlign(PropType type, float elPoint, float containerPoint);\r\n    static Prop *AllocAlign(PropType type, ElAlign align);\r\n    static Prop *AllocPadding(int top, int right, int bottom, int left);\r\n    static Prop *AllocColorSolid(PropType type, ARGB color);\r\n    static Prop *AllocColorSolid(PropType type, int a, int r, int g, int b);\r\n    static Prop *AllocColorSolid(PropType type, int r, int g, int b);\r\n    static Prop *AllocColorSolid(PropType type, const char *color);\r\n    static Prop *AllocColorLinearGradient(PropType type, LinearGradientMode mode, ARGB startColor,\r\n                                          ARGB endColor);\r\n    static Prop *AllocColorLinearGradient(PropType type, LinearGradientMode mode,\r\n                                          const char *startColor, const char *endColor);\r\n    static Prop *AllocWidth(PropType type, float width);\r\n};\r\n\r\nclass Style {\r\n    // if property is not found here, we'll search the\r\n    // inheritance chain\r\n    Style *inheritsFrom;\r\n    // generation number, changes every time we change the style\r\n    size_t gen;\r\n\r\n  public:\r\n    Style(Style *inheritsFrom = nullptr) : inheritsFrom(inheritsFrom) {\r\n        gen = 1; // so that we can use 0 for nullptr\r\n    }\r\n\r\n    void SetName(const char *n);\r\n\r\n    Vec<Prop *> props;\r\n\r\n    void Set(Prop *prop);\r\n\r\n    // shortcuts for setting multiple properties at a time\r\n    void SetBorderWidth(float width);\r\n    void SetBorderColor(ARGB color);\r\n\r\n    void SetPadding(int width);\r\n    void SetPadding(int topBottom, int leftRight);\r\n    void SetPadding(int top, int right, int bottom, int left);\r\n\r\n    Style *GetInheritsFrom() const;\r\n    void SetInheritsFrom(Style *parent) { inheritsFrom = parent; }\r\n    size_t GetIdentity() const;\r\n};\r\n\r\nstruct BorderWidth {\r\n    float top, right, bottom, left;\r\n};\r\n\r\nstruct BorderColors {\r\n    ColorData *top;\r\n    ColorData *right;\r\n    ColorData *bottom;\r\n    ColorData *left;\r\n};\r\n\r\n// CachedStyle combines values of all properties for easier use by clients\r\nstruct CachedStyle {\r\n    const char *styleName;\r\n    const WCHAR *fontName;\r\n    float fontSize;\r\n    FontStyle fontWeight;\r\n    Padding padding;\r\n    ColorData *color;\r\n    ColorData *bgColor;\r\n    BorderWidth borderWidth;\r\n    BorderColors borderColors;\r\n    AlignAttr textAlign;\r\n    ElAlignData vertAlign;\r\n    ElAlignData horizAlign;\r\n    ColorData *fill;\r\n    ColorData *stroke;\r\n    float strokeWidth;\r\n};\r\n\r\n// few basic styles provided by mui\r\n// can be modified by the app (for easyily changing default appearance)\r\nStyle *GetStyleDefault();\r\nStyle *GetStyleButtonDefault();\r\nStyle *GetStyleButtonDefaultMouseOver();\r\n\r\nvoid Initialize();\r\nvoid Destroy();\r\n\r\nCachedStyle *CacheStyle(Style *style, bool *changedOut);\r\nCachedStyle *CachedStyleByName(const char *name);\r\nStyle *StyleByName(const char *name);\r\n\r\nBrush *BrushFromColorData(ColorData *color, const Rect &r);\r\nBrush *BrushFromColorData(ColorData *color, const RectF &r);\r\n\r\nARGB ParseCssColor(const char *color);\r\nSize GetBorderAndPaddingSize(CachedStyle *s);\r\n\r\n} // namespace css\r\n"
  },
  {
    "path": "src/mui/MuiDefs.cpp",
    "content": "// DON'T EDIT MANUALLY !!!!\r\n// auto-generated by gen_txt.py !!!!\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"SerializeTxt.h\"\r\n#include \"MuiDefs.h\"\r\n\r\nusing namespace sertxt;\r\n\r\n#define of offsetof\r\nconst FieldMetadata gButtonVectorDefFieldMetadata[] = {\r\n    { of(ButtonVectorDef, name), TYPE_STR, 0 },\r\n    { of(ButtonVectorDef, clicked), TYPE_STR, 0 },\r\n    { of(ButtonVectorDef, path), TYPE_STR, 0 },\r\n    { of(ButtonVectorDef, styleDefault), TYPE_STR, 0 },\r\n    { of(ButtonVectorDef, styleMouseOver), TYPE_STR, 0 },\r\n};\r\n\r\nconst StructMetadata gButtonVectorDefMetadata = {\r\n    sizeof(ButtonVectorDef), 5, \"name\\0clicked\\0path\\0style_default\\0style_mouse_over\\0\\0\",\r\n    &gButtonVectorDefFieldMetadata[0]\r\n};\r\n\r\nconst FieldMetadata gButtonDefFieldMetadata[] = {\r\n    { of(ButtonDef, name), TYPE_STR, 0 },\r\n    { of(ButtonDef, text), TYPE_WSTR, 0 },\r\n    { of(ButtonDef, style), TYPE_STR, 0 },\r\n};\r\n\r\nconst StructMetadata gButtonDefMetadata = { sizeof(ButtonDef), 3, \"name\\0text\\0style\\0\\0\",\r\n                                            &gButtonDefFieldMetadata[0] };\r\n\r\nconst FieldMetadata gScrollBarDefFieldMetadata[] = {\r\n    { of(ScrollBarDef, name), TYPE_STR, 0 },\r\n    { of(ScrollBarDef, style), TYPE_STR, 0 },\r\n    { of(ScrollBarDef, cursor), TYPE_STR, 0 },\r\n};\r\n\r\nconst StructMetadata gScrollBarDefMetadata = { sizeof(ScrollBarDef), 3, \"name\\0style\\0cursor\\0\\0\",\r\n                                               &gScrollBarDefFieldMetadata[0] };\r\n\r\nconst FieldMetadata gDirectionalLayoutDataDefFieldMetadata[] = {\r\n    { of(DirectionalLayoutDataDef, controlName), TYPE_STR, 0 },\r\n    { of(DirectionalLayoutDataDef, sla), TYPE_STR, 0 },\r\n    { of(DirectionalLayoutDataDef, snla), TYPE_STR, 0 },\r\n    { of(DirectionalLayoutDataDef, align), TYPE_STR, 0 },\r\n};\r\n\r\nconst StructMetadata gDirectionalLayoutDataDefMetadata = {\r\n    sizeof(DirectionalLayoutDataDef), 4, \"control_name\\0sla\\0snla\\0align\\0\\0\",\r\n    &gDirectionalLayoutDataDefFieldMetadata[0]\r\n};\r\n\r\nconst FieldMetadata gHorizontalLayoutDefFieldMetadata[] = {\r\n    { of(HorizontalLayoutDef, name), TYPE_STR, 0 },\r\n    { of(HorizontalLayoutDef, children), (Type)(TYPE_ARRAY | TYPE_STORE_COMPACT_MASK),\r\n      (uintptr_t)&gDirectionalLayoutDataDefMetadata },\r\n};\r\n\r\nconst StructMetadata gHorizontalLayoutDefMetadata = { sizeof(HorizontalLayoutDef), 2,\r\n                                                      \"name\\0children\\0\\0\",\r\n                                                      &gHorizontalLayoutDefFieldMetadata[0] };\r\n\r\nconst FieldMetadata gVerticalLayoutDefFieldMetadata[] = {\r\n    { of(VerticalLayoutDef, name), TYPE_STR, 0 },\r\n    { of(VerticalLayoutDef, children), (Type)(TYPE_ARRAY | TYPE_STORE_COMPACT_MASK),\r\n      (uintptr_t)&gDirectionalLayoutDataDefMetadata },\r\n};\r\n\r\nconst StructMetadata gVerticalLayoutDefMetadata = { sizeof(VerticalLayoutDef), 2,\r\n                                                    \"name\\0children\\0\\0\",\r\n                                                    &gVerticalLayoutDefFieldMetadata[0] };\r\n\r\n#undef of\r\n"
  },
  {
    "path": "src/mui/MuiDefs.h",
    "content": "// DON'T EDIT MANUALLY !!!!\r\n// auto-generated by gen_txt.py !!!!\r\n\r\nusing namespace sertxt;\r\n\r\nstruct ButtonVectorDef {\r\n    const char *name;\r\n    const char *clicked;\r\n    const char *path;\r\n    const char *styleDefault;\r\n    const char *styleMouseOver;\r\n};\r\n\r\nstruct ButtonDef {\r\n    const char *name;\r\n    const WCHAR *text;\r\n    const char *style;\r\n};\r\n\r\nstruct ScrollBarDef {\r\n    const char *name;\r\n    const char *style;\r\n    const char *cursor;\r\n};\r\n\r\nstruct DirectionalLayoutDataDef {\r\n    const char *controlName;\r\n    const char *sla;\r\n    const char *snla;\r\n    const char *align;\r\n};\r\n\r\nstruct HorizontalLayoutDef {\r\n    const char *name;\r\n    Vec<DirectionalLayoutDataDef *> *children;\r\n};\r\n\r\nstruct VerticalLayoutDef {\r\n    const char *name;\r\n    Vec<DirectionalLayoutDataDef *> *children;\r\n};\r\n\r\nextern const StructMetadata gButtonVectorDefMetadata;\r\n\r\ninline ButtonVectorDef *DeserializeButtonVectorDef(char *data, size_t dataLen) {\r\n    return (ButtonVectorDef *)Deserialize(data, dataLen, &gButtonVectorDefMetadata);\r\n}\r\n\r\ninline ButtonVectorDef *DeserializeButtonVectorDef(TxtNode *root) {\r\n    return (ButtonVectorDef *)Deserialize(root, &gButtonVectorDefMetadata);\r\n}\r\n\r\ninline uint8_t *SerializeButtonVectorDef(ButtonVectorDef *val, size_t *dataLenOut) {\r\n    return Serialize((const uint8_t *)val, &gButtonVectorDefMetadata, dataLenOut);\r\n}\r\n\r\ninline void FreeButtonVectorDef(ButtonVectorDef *val) {\r\n    FreeStruct((uint8_t *)val, &gButtonVectorDefMetadata);\r\n}\r\nextern const StructMetadata gButtonDefMetadata;\r\n\r\ninline ButtonDef *DeserializeButtonDef(char *data, size_t dataLen) {\r\n    return (ButtonDef *)Deserialize(data, dataLen, &gButtonDefMetadata);\r\n}\r\n\r\ninline ButtonDef *DeserializeButtonDef(TxtNode *root) {\r\n    return (ButtonDef *)Deserialize(root, &gButtonDefMetadata);\r\n}\r\n\r\ninline uint8_t *SerializeButtonDef(ButtonDef *val, size_t *dataLenOut) {\r\n    return Serialize((const uint8_t *)val, &gButtonDefMetadata, dataLenOut);\r\n}\r\n\r\ninline void FreeButtonDef(ButtonDef *val) { FreeStruct((uint8_t *)val, &gButtonDefMetadata); }\r\nextern const StructMetadata gScrollBarDefMetadata;\r\n\r\ninline ScrollBarDef *DeserializeScrollBarDef(char *data, size_t dataLen) {\r\n    return (ScrollBarDef *)Deserialize(data, dataLen, &gScrollBarDefMetadata);\r\n}\r\n\r\ninline ScrollBarDef *DeserializeScrollBarDef(TxtNode *root) {\r\n    return (ScrollBarDef *)Deserialize(root, &gScrollBarDefMetadata);\r\n}\r\n\r\ninline uint8_t *SerializeScrollBarDef(ScrollBarDef *val, size_t *dataLenOut) {\r\n    return Serialize((const uint8_t *)val, &gScrollBarDefMetadata, dataLenOut);\r\n}\r\n\r\ninline void FreeScrollBarDef(ScrollBarDef *val) {\r\n    FreeStruct((uint8_t *)val, &gScrollBarDefMetadata);\r\n}\r\nextern const StructMetadata gDirectionalLayoutDataDefMetadata;\r\n\r\ninline DirectionalLayoutDataDef *DeserializeDirectionalLayoutDataDef(char *data, size_t dataLen) {\r\n    return (DirectionalLayoutDataDef *)Deserialize(data, dataLen,\r\n                                                   &gDirectionalLayoutDataDefMetadata);\r\n}\r\n\r\ninline DirectionalLayoutDataDef *DeserializeDirectionalLayoutDataDef(TxtNode *root) {\r\n    return (DirectionalLayoutDataDef *)Deserialize(root, &gDirectionalLayoutDataDefMetadata);\r\n}\r\n\r\ninline uint8_t *SerializeDirectionalLayoutDataDef(DirectionalLayoutDataDef *val,\r\n                                                  size_t *dataLenOut) {\r\n    return Serialize((const uint8_t *)val, &gDirectionalLayoutDataDefMetadata, dataLenOut);\r\n}\r\n\r\ninline void FreeDirectionalLayoutDataDef(DirectionalLayoutDataDef *val) {\r\n    FreeStruct((uint8_t *)val, &gDirectionalLayoutDataDefMetadata);\r\n}\r\nextern const StructMetadata gHorizontalLayoutDefMetadata;\r\n\r\ninline HorizontalLayoutDef *DeserializeHorizontalLayoutDef(char *data, size_t dataLen) {\r\n    return (HorizontalLayoutDef *)Deserialize(data, dataLen, &gHorizontalLayoutDefMetadata);\r\n}\r\n\r\ninline HorizontalLayoutDef *DeserializeHorizontalLayoutDef(TxtNode *root) {\r\n    return (HorizontalLayoutDef *)Deserialize(root, &gHorizontalLayoutDefMetadata);\r\n}\r\n\r\ninline uint8_t *SerializeHorizontalLayoutDef(HorizontalLayoutDef *val, size_t *dataLenOut) {\r\n    return Serialize((const uint8_t *)val, &gHorizontalLayoutDefMetadata, dataLenOut);\r\n}\r\n\r\ninline void FreeHorizontalLayoutDef(HorizontalLayoutDef *val) {\r\n    FreeStruct((uint8_t *)val, &gHorizontalLayoutDefMetadata);\r\n}\r\nextern const StructMetadata gVerticalLayoutDefMetadata;\r\n\r\ninline VerticalLayoutDef *DeserializeVerticalLayoutDef(char *data, size_t dataLen) {\r\n    return (VerticalLayoutDef *)Deserialize(data, dataLen, &gVerticalLayoutDefMetadata);\r\n}\r\n\r\ninline VerticalLayoutDef *DeserializeVerticalLayoutDef(TxtNode *root) {\r\n    return (VerticalLayoutDef *)Deserialize(root, &gVerticalLayoutDefMetadata);\r\n}\r\n\r\ninline uint8_t *SerializeVerticalLayoutDef(VerticalLayoutDef *val, size_t *dataLenOut) {\r\n    return Serialize((const uint8_t *)val, &gVerticalLayoutDefMetadata, dataLenOut);\r\n}\r\n\r\ninline void FreeVerticalLayoutDef(VerticalLayoutDef *val) {\r\n    FreeStruct((uint8_t *)val, &gVerticalLayoutDefMetadata);\r\n}\r\n"
  },
  {
    "path": "src/mui/MuiEventMgr.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"BitManip.h\"\r\n#include \"Timer.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"Mui.h\"\r\n#include \"FrameRateWnd.h\"\r\n#include \"DebugLog.h\"\r\n\r\nnamespace mui {\r\n\r\nEventMgr::EventMgr(HwndWrapper *wndRoot) : wndRoot(wndRoot), currOver(nullptr), inSizeMove(false) {\r\n    CrashIf(!wndRoot);\r\n    // CrashIf(wndRoot->hwnd);\r\n}\r\n\r\nEventMgr::~EventMgr() {\r\n    // unsubscribe event handlers for all controls\r\n    for (EventHandler &h : eventHandlers) {\r\n        delete h.events;\r\n    }\r\n    for (NamedEventHandler &nh : namedEventHandlers) {\r\n        free((void *)nh.name);\r\n        delete nh.namedEvents;\r\n    }\r\n}\r\n\r\n// Set minimum size that will be enforced by handling WM_GETMINMAXINFO\r\n// Default is (0,0), which is unlimited\r\nvoid EventMgr::SetMinSize(Size s) {\r\n    // TODO: need to figure out a way to force resizing\r\n    // respecting those constraints. Could just size manually.\r\n    // Without doing sth., the constraints will only apply\r\n    // after next resize operation\r\n    minSize = s;\r\n}\r\n\r\n// Set maximum size that will be enforced by handling WM_GETMINMAXINFO\r\n// Default is (0,0), which is unlimited\r\nvoid EventMgr::SetMaxSize(Size s) {\r\n    // TODO: need to figure out a way to force resizing\r\n    // respecting those constraints. Could just size manually.\r\n    // Without doing sth., the constraints will only apply\r\n    // after next resize operation\r\n    maxSize = s;\r\n}\r\n\r\nvoid EventMgr::RemoveEventsForControl(Control *c) {\r\n    for (size_t i = 0; i < eventHandlers.Count(); i++) {\r\n        EventHandler h = eventHandlers.At(i);\r\n        if (h.ctrlSource == c) {\r\n            ControlEvents *events = eventHandlers.At(i).events;\r\n            eventHandlers.RemoveAtFast(i);\r\n            delete events;\r\n            return;\r\n        }\r\n    }\r\n}\r\n\r\nControlEvents *EventMgr::EventsForControl(Control *c) {\r\n    for (EventHandler &h : eventHandlers) {\r\n        if (h.ctrlSource == c)\r\n            return h.events;\r\n    }\r\n    ControlEvents *events = new ControlEvents();\r\n    EventHandler eh = { c, events };\r\n    eventHandlers.Append(eh);\r\n    return events;\r\n}\r\n\r\nNamedEvents *EventMgr::EventsForName(const char *name) {\r\n    for (NamedEventHandler &h : namedEventHandlers) {\r\n        if (str::EqI(h.name, name))\r\n            return h.namedEvents;\r\n    }\r\n    NamedEvents *namedEvents = new NamedEvents();\r\n    NamedEventHandler eh = { str::Dup(name), namedEvents };\r\n    namedEventHandlers.Append(eh);\r\n    return namedEvents;\r\n}\r\n\r\nvoid EventMgr::NotifyNamedEventClicked(Control *c, int x, int y) {\r\n    const char *name = c->namedEventClick;\r\n    if (!name)\r\n        return;\r\n    for (NamedEventHandler &h : namedEventHandlers) {\r\n        if (str::EqI(h.name, name)) {\r\n            h.namedEvents->Clicked(c, x, y);\r\n            return;\r\n        }\r\n    }\r\n}\r\n\r\nvoid EventMgr::NotifyClicked(Control *c, int x, int y) {\r\n    for (EventHandler &h : eventHandlers) {\r\n        if (h.ctrlSource == c) {\r\n            h.events->Clicked(c, x, y);\r\n            return;\r\n        }\r\n    }\r\n}\r\n\r\nvoid EventMgr::NotifySizeChanged(Control *c, int dx, int dy) {\r\n    for (EventHandler &h : eventHandlers) {\r\n        if (h.ctrlSource == c && h.events->SizeChanged) {\r\n            h.events->SizeChanged(c, dx, dy);\r\n        }\r\n    }\r\n}\r\n\r\n// TODO: optimize by getting both mouse over and mouse move windows in one call\r\n// x, y is a position in the root window\r\nLRESULT EventMgr::OnMouseMove(WPARAM keys, int x, int y, bool &wasHandled) {\r\n    UNUSED(keys);\r\n    UNUSED(wasHandled);\r\n    Vec<CtrlAndOffset> windows;\r\n    Control *c;\r\n\r\n    uint16 wantedInputMask = bit::FromBit<uint16>(Control::WantsMouseOverBit);\r\n    size_t count = CollectWindowsAt(wndRoot, x, y, wantedInputMask, &windows);\r\n    if (0 == count) {\r\n        if (currOver) {\r\n            currOver->SetIsMouseOver(false);\r\n            currOver->NotifyMouseLeave();\r\n            currOver = nullptr;\r\n        }\r\n    } else {\r\n        // TODO: should this take z-order into account ?\r\n        c = windows.Last().c;\r\n        if (c != currOver) {\r\n            if (currOver) {\r\n                currOver->SetIsMouseOver(false);\r\n                currOver->NotifyMouseLeave();\r\n            }\r\n            currOver = c;\r\n            currOver->SetIsMouseOver(true);\r\n            currOver->NotifyMouseEnter();\r\n        }\r\n    }\r\n\r\n    wantedInputMask = bit::FromBit<uint16>(Control::WantsMouseMoveBit);\r\n    count = CollectWindowsAt(wndRoot, x, y, wantedInputMask, &windows);\r\n    if (0 == count)\r\n        return 0;\r\n    c = windows.Last().c;\r\n    c->MapRootToMyPos(x, y);\r\n    c->NotifyMouseMove(x, y);\r\n    return 0;\r\n}\r\n\r\n// TODO: quite possibly the real logic for generating \"click\" events is\r\n// more complicated\r\n// (x, y) is in the coordinates of the root window\r\nLRESULT EventMgr::OnLButtonUp(WPARAM keys, int x, int y, bool &wasHandled) {\r\n    UNUSED(keys);\r\n    UNUSED(wasHandled);\r\n    Vec<CtrlAndOffset> controls;\r\n    uint16 wantedInputMask = bit::FromBit<uint16>(Control::WantsMouseClickBit);\r\n    size_t count = CollectWindowsAt(wndRoot, x, y, wantedInputMask, &controls);\r\n    if (0 == count)\r\n        return 0;\r\n    // TODO: should this take z-order into account?\r\n    Control *c = controls.Last().c;\r\n    c->MapRootToMyPos(x, y);\r\n    NotifyClicked(c, x, y);\r\n    NotifyNamedEventClicked(c, x, y);\r\n    return 0;\r\n}\r\n\r\nstatic void SetIfNotZero(LONG &l, int i, bool &didSet) {\r\n    if (i != 0) {\r\n        l = i;\r\n        didSet = true;\r\n    }\r\n}\r\n\r\nLRESULT EventMgr::OnGetMinMaxInfo(MINMAXINFO *info, bool &wasHandled) {\r\n    SetIfNotZero(info->ptMinTrackSize.x, minSize.Width, wasHandled);\r\n    SetIfNotZero(info->ptMinTrackSize.y, minSize.Height, wasHandled);\r\n    SetIfNotZero(info->ptMaxTrackSize.x, maxSize.Width, wasHandled);\r\n    SetIfNotZero(info->ptMaxTrackSize.y, maxSize.Height, wasHandled);\r\n    return 0;\r\n}\r\n\r\nLRESULT EventMgr::OnSetCursor(int x, int y, bool &wasHandled) {\r\n    UNUSED(x);\r\n    UNUSED(y);\r\n    if (currOver && currOver->hCursor) {\r\n        SetCursor(currOver->hCursor);\r\n        wasHandled = true;\r\n    }\r\n    return TRUE;\r\n}\r\n\r\nLRESULT EventMgr::OnMessage(UINT msg, WPARAM wParam, LPARAM lParam, bool &wasHandled) {\r\n    wasHandled = false;\r\n\r\n    if (WM_ENTERSIZEMOVE == msg) {\r\n        inSizeMove = true;\r\n    }\r\n\r\n    if (WM_EXITSIZEMOVE == msg) {\r\n        inSizeMove = false;\r\n    }\r\n\r\n    if (WM_SIZE == msg) {\r\n        // int dx = LOWORD(lParam);\r\n        // int dy = HIWORD(lParam);\r\n        wndRoot->RequestLayout();\r\n        return 0;\r\n    }\r\n\r\n    wndRoot->LayoutIfRequested();\r\n\r\n    if (WM_SETCURSOR == msg) {\r\n        POINT pt;\r\n        if (GetCursorPos(&pt) && ScreenToClient(wndRoot->hwndParent, &pt))\r\n            return OnSetCursor(pt.x, pt.y, wasHandled);\r\n        return 0;\r\n    }\r\n\r\n    if (WM_MOUSEMOVE == msg) {\r\n        int x = GET_X_LPARAM(lParam);\r\n        int y = GET_Y_LPARAM(lParam);\r\n        return OnMouseMove(wParam, x, y, wasHandled);\r\n    }\r\n\r\n    if (WM_LBUTTONUP == msg) {\r\n        int x = GET_X_LPARAM(lParam);\r\n        int y = GET_Y_LPARAM(lParam);\r\n        return OnLButtonUp(wParam, x, y, wasHandled);\r\n    }\r\n\r\n    if (WM_GETMINMAXINFO == msg) {\r\n        return OnGetMinMaxInfo((MINMAXINFO *)lParam, wasHandled);\r\n    }\r\n\r\n    if (WM_PAINT == msg) {\r\n        wndRoot->OnPaint(wndRoot->hwndParent);\r\n        wasHandled = true;\r\n        return 0;\r\n    }\r\n\r\n    return 0;\r\n}\r\n}\r\n"
  },
  {
    "path": "src/mui/MuiEventMgr.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nclass HwndWrapper;\r\nclass Control;\r\n\r\nclass ControlEvents {\r\n  public:\r\n    std::function<void(Control *, int, int)> Clicked;\r\n    std::function<void(Control *, int, int)> SizeChanged;\r\n};\r\n\r\nclass NamedEvents {\r\n  public:\r\n    std::function<void(Control *, int, int)> Clicked;\r\n};\r\n\r\n// A single EventMgr is associated with a single HwndWrapper\r\n// (which itself is associated with single HWND) and handles\r\n// win32 messages for that HWND needed to make the whole system\r\n// work.\r\nclass EventMgr {\r\n    HwndWrapper *wndRoot;\r\n    // current window over which the mouse is\r\n    Control *currOver;\r\n\r\n    Size minSize;\r\n    Size maxSize;\r\n\r\n    bool inSizeMove;\r\n\r\n    struct EventHandler {\r\n        Control *ctrlSource;\r\n        ControlEvents *events;\r\n    };\r\n    Vec<EventHandler> eventHandlers;\r\n\r\n    struct NamedEventHandler {\r\n        const char *name;\r\n        NamedEvents *namedEvents;\r\n    };\r\n    Vec<NamedEventHandler> namedEventHandlers;\r\n\r\n    LRESULT OnSetCursor(int x, int y, bool &wasHandled);\r\n    LRESULT OnMouseMove(WPARAM keys, int x, int y, bool &wasHandled);\r\n    LRESULT OnLButtonUp(WPARAM keys, int x, int y, bool &wasHandled);\r\n    LRESULT OnGetMinMaxInfo(MINMAXINFO *info, bool &wasHandled);\r\n\r\n  public:\r\n    EventMgr(HwndWrapper *wndRoot);\r\n    ~EventMgr();\r\n\r\n    LRESULT OnMessage(UINT msg, WPARAM wParam, LPARAM lParam, bool &handledOut);\r\n\r\n    ControlEvents *EventsForControl(Control *c);\r\n    NamedEvents *EventsForName(const char *name);\r\n\r\n    void RemoveEventsForControl(Control *c);\r\n\r\n    void NotifyClicked(Control *c, int x, int y);\r\n    void NotifySizeChanged(Control *c, int dx, int dy);\r\n    void NotifyNamedEventClicked(Control *c, int x, int y);\r\n\r\n    bool IsInSizeMove() const { return inSizeMove; }\r\n\r\n    void SetMinSize(Size s);\r\n    void SetMaxSize(Size s);\r\n};\r\n"
  },
  {
    "path": "src/mui/MuiFromText.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"StrSlice.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"Mui.h\"\r\n#include \"SerializeTxt.h\"\r\n#include \"MuiDefs.h\"\r\n#include \"SvgPath.h\"\r\n#include \"TxtParser.h\"\r\n\r\n/*\r\nCode to create mui controls from text description (so that it can be loaded\r\nat runtime).\r\n\r\n*/\r\n\r\nnamespace mui {\r\n\r\nstruct ControlCreatorNode {\r\n    ControlCreatorNode *next;\r\n    const char *typeName;\r\n    ControlCreatorFunc creator;\r\n};\r\n\r\nstruct LayoutCreatorNode {\r\n    LayoutCreatorNode *next;\r\n    const char *typeName;\r\n    LayoutCreatorFunc creator;\r\n};\r\n\r\n// This is an extensiblity point that allows creating custom controls and layouts\r\n// unknown to mui that appear in text description\r\nstatic ControlCreatorNode *gControlCreators = nullptr;\r\nstatic LayoutCreatorNode *gLayoutCreators = nullptr;\r\n\r\nvoid RegisterControlCreatorFor(const char *typeName, ControlCreatorFunc creator) {\r\n    ControlCreatorNode *cc = AllocStruct<ControlCreatorNode>();\r\n    cc->typeName = str::Dup(typeName);\r\n    cc->creator = creator;\r\n    ListInsert(&gControlCreators, cc);\r\n}\r\n\r\nstatic ControlCreatorFunc FindControlCreatorFuncFor(const char *typeName) {\r\n    ControlCreatorNode *curr = gControlCreators;\r\n    while (curr) {\r\n        if (str::EqI(typeName, curr->typeName))\r\n            return curr->creator;\r\n        curr = curr->next;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nvoid FreeControlCreators() {\r\n    ControlCreatorNode *curr = gControlCreators;\r\n    ControlCreatorNode *next;\r\n    while (curr) {\r\n        next = curr->next;\r\n        free((void *)curr->typeName);\r\n        free(curr);\r\n        curr = next;\r\n    }\r\n}\r\n\r\nvoid RegisterLayoutCreatorFor(const char *layoutName, LayoutCreatorFunc creator) {\r\n    LayoutCreatorNode *lc = AllocStruct<LayoutCreatorNode>();\r\n    lc->typeName = str::Dup(layoutName);\r\n    lc->creator = creator;\r\n    ListInsert(&gLayoutCreators, lc);\r\n}\r\n\r\nstatic LayoutCreatorFunc FindLayoutCreatorFuncFor(const char *typeName) {\r\n    LayoutCreatorNode *curr = gLayoutCreators;\r\n    while (curr) {\r\n        if (str::EqI(typeName, curr->typeName))\r\n            return curr->creator;\r\n        curr = curr->next;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nvoid FreeLayoutCreators() {\r\n    LayoutCreatorNode *curr = gLayoutCreators;\r\n    LayoutCreatorNode *next;\r\n    while (curr) {\r\n        next = curr->next;\r\n        free((void *)curr->typeName);\r\n        free(curr);\r\n        curr = next;\r\n    }\r\n}\r\n\r\nButton *FindButtonNamed(const ParsedMui &muiInfo, const char *name) {\r\n    for (size_t i = 0; i < muiInfo.buttons.Count(); i++) {\r\n        Button *c = muiInfo.buttons.At(i);\r\n        if (c->IsNamed(name))\r\n            return c;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nButtonVector *FindButtonVectorNamed(const ParsedMui &muiInfo, const char *name) {\r\n    for (size_t i = 0; i < muiInfo.vecButtons.Count(); i++) {\r\n        ButtonVector *c = muiInfo.vecButtons.At(i);\r\n        if (c->IsNamed(name))\r\n            return c;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nScrollBar *FindScrollBarNamed(const ParsedMui &muiInfo, const char *name) {\r\n    for (size_t i = 0; i < muiInfo.scrollBars.Count(); i++) {\r\n        ScrollBar *c = muiInfo.scrollBars.At(i);\r\n        if (c->IsNamed(name))\r\n            return c;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nControl *FindControlNamed(const ParsedMui &muiInfo, const char *name) {\r\n    for (size_t i = 0; i < muiInfo.allControls.Count(); i++) {\r\n        Control *c = muiInfo.allControls.At(i);\r\n        if (c->IsNamed(name))\r\n            return c;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nILayout *FindLayoutNamed(const ParsedMui &muiInfo, const char *name) {\r\n    for (size_t i = 0; i < muiInfo.layouts.Count(); i++) {\r\n        ILayout *l = muiInfo.layouts.At(i);\r\n        if (l->IsNamed(name))\r\n            return l;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nILayout *FindElementNamed(ParsedMui &muiInfo, const char *name) {\r\n    Control *c = FindControlNamed(muiInfo, name);\r\n    if (c)\r\n        return c;\r\n    return FindLayoutNamed(muiInfo, name);\r\n}\r\n\r\nstatic TxtNode *GetRootArray(TxtParser *parser) {\r\n    TxtNode *root = parser->nodes.At(0);\r\n    CrashIf(!root->IsArray());\r\n    return root;\r\n}\r\n\r\nstatic float ParseFloat(const char *s) {\r\n    char *end = (char *)s;\r\n    return (float)strtod(s, &end);\r\n}\r\n\r\nstruct ParsedPadding {\r\n    int top;\r\n    int right;\r\n    int bottom;\r\n    int left;\r\n};\r\n\r\nstatic void ParsePadding(const char *s, ParsedPadding &p) {\r\n    if (str::Parse(s, \"%d%_%d%_%d%_%d%_%$\", &p.top, &p.right, &p.bottom, &p.left))\r\n        return;\r\n    if (str::Parse(s, \"%d%_%d%_%$\", &p.top, &p.right)) {\r\n        p.bottom = p.top;\r\n        p.left = p.right;\r\n    } else if (str::Parse(s, \"%d%_%$\", &p.top)) {\r\n        p.left = p.right = p.bottom = p.top;\r\n    }\r\n}\r\n\r\nstatic AlignAttr ParseAlignAttr(const char *s) { return FindAlignAttr(s, str::Len(s)); }\r\n\r\n// TODO: optimize using seqstrings\r\nstatic ElAlign ParseElAlign(const char *s) {\r\n    if (str::EqI(s, \"center\"))\r\n        return ElAlign::Center;\r\n    if (str::EqI(s, \"top\"))\r\n        return ElAlign::Top;\r\n    if (str::EqI(s, \"bottom\"))\r\n        return ElAlign::Bottom;\r\n    if (str::EqI(s, \"left\"))\r\n        return ElAlign::Left;\r\n    if (str::EqI(s, \"right\"))\r\n        return ElAlign::Right;\r\n    CrashIf(true);\r\n    return ElAlign::Left;\r\n}\r\n\r\nstatic ElAlignData ParseElAlignData(const char *s) {\r\n    ElAlign align = ParseElAlign(s);\r\n    return GetElAlign(align);\r\n}\r\n\r\n#if 0\r\n    FontStyleRegular    = 0,\r\n    FontStyleBold       = 1,\r\n    FontStyleItalic     = 2,\r\n    FontStyleBoldItalic = 3,\r\n    FontStyleUnderline  = 4,\r\n    FontStyleStrikeout  = 8\r\n#endif\r\nstatic Gdiplus::FontStyle ParseFontWeight(const char *s) {\r\n    if (str::EqI(s, \"regular\"))\r\n        return FontStyleRegular;\r\n    CrashIf(true);\r\n    // TODO: more\r\n    return FontStyleRegular;\r\n}\r\n\r\nstatic void AddStyleProp(Style *style, TxtNode *prop) {\r\n    ScopedMem<char> tmp(prop->ValDup());\r\n\r\n    if (prop->IsTextWithKey(\"name\")) {\r\n        style->SetName(tmp);\r\n        return;\r\n    }\r\n\r\n    if (prop->IsTextWithKey(\"bg_col\")) {\r\n        style->Set(Prop::AllocColorSolid(PropBgColor, tmp));\r\n        return;\r\n    }\r\n\r\n    if (prop->IsTextWithKey(\"col\")) {\r\n        style->Set(Prop::AllocColorSolid(PropColor, tmp));\r\n        return;\r\n    }\r\n\r\n    if (prop->IsTextWithKey(\"parent\")) {\r\n        Style *parentStyle = StyleByName(tmp);\r\n        CrashIf(!parentStyle);\r\n        style->SetInheritsFrom(parentStyle);\r\n        return;\r\n    }\r\n\r\n    if (prop->IsTextWithKey(\"border_width\")) {\r\n        style->SetBorderWidth(ParseFloat(tmp));\r\n        return;\r\n    }\r\n\r\n    if (prop->IsTextWithKey(\"padding\")) {\r\n        ParsedPadding padding = { 0 };\r\n        ParsePadding(tmp, padding);\r\n        style->SetPadding(padding.top, padding.right, padding.bottom, padding.left);\r\n        return;\r\n    }\r\n\r\n    if (prop->IsTextWithKey(\"stroke_width\")) {\r\n        style->Set(Prop::AllocWidth(PropStrokeWidth, ParseFloat(tmp)));\r\n        return;\r\n    }\r\n\r\n    if (prop->IsTextWithKey(\"fill\")) {\r\n        style->Set(Prop::AllocColorSolid(PropFill, tmp));\r\n        return;\r\n    }\r\n\r\n    if (prop->IsTextWithKey(\"vert_align\")) {\r\n        style->Set(Prop::AllocAlign(PropVertAlign, ParseElAlign(tmp)));\r\n        return;\r\n    }\r\n\r\n    if (prop->IsTextWithKey(\"text_align\")) {\r\n        style->Set(Prop::AllocTextAlign(ParseAlignAttr(tmp)));\r\n        return;\r\n    }\r\n\r\n    if (prop->IsTextWithKey(\"font_size\")) {\r\n        style->Set(Prop::AllocFontSize(ParseFloat(tmp)));\r\n        return;\r\n    }\r\n\r\n    if (prop->IsTextWithKey(\"font_weight\")) {\r\n        style->Set(Prop::AllocFontWeight(ParseFontWeight(tmp)));\r\n        return;\r\n    }\r\n\r\n    CrashIf(true);\r\n}\r\n\r\nstatic TxtNode *TxtChildNodeWithKey(TxtNode *top, const char *keyName) {\r\n    size_t n = top->children->Count();\r\n    for (size_t i = 0; i < n; i++) {\r\n        TxtNode *node = top->children->At(i);\r\n        if (node->IsTextWithKey(keyName))\r\n            return node;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\n// styles are cached globally, so we only add a style if it doesn't\r\n// exist already\r\nstatic void CacheStyleFromStruct(TxtNode *def) {\r\n    CrashIf(!def->IsStructWithName(\"style\"));\r\n    TxtNode *nameNode = TxtChildNodeWithKey(def, \"name\");\r\n    CrashIf(!nameNode); // must have name or else no way to refer to it\r\n    ScopedMem<char> tmp(nameNode->ValDup());\r\n    if (StyleByName(tmp))\r\n        return;\r\n\r\n    Style *style = new Style();\r\n    size_t n = def->children->Count();\r\n    for (size_t i = 0; i < n; i++) {\r\n        TxtNode *node = def->children->At(i);\r\n        CrashIf(!node->IsText());\r\n        AddStyleProp(style, node);\r\n    }\r\n    CacheStyle(style, nullptr);\r\n}\r\n\r\nstatic ButtonVector *ButtonVectorFromDef(TxtNode *structDef) {\r\n    CrashIf(!structDef->IsStructWithName(\"ButtonVector\"));\r\n    ButtonVectorDef *def = DeserializeButtonVectorDef(structDef);\r\n    ButtonVector *b = new ButtonVector();\r\n    b->SetName(def->name);\r\n    b->SetNamedEventClick(def->clicked);\r\n\r\n    if (def->path) {\r\n        GraphicsPath *gp = svg::GraphicsPathFromPathData(def->path);\r\n        b->SetGraphicsPath(gp);\r\n    }\r\n    if (def->styleDefault) {\r\n        Style *style = StyleByName(def->styleDefault);\r\n        CrashIf(!style);\r\n        b->SetDefaultStyle(style);\r\n    }\r\n    if (def->styleMouseOver) {\r\n        Style *style = StyleByName(def->styleMouseOver);\r\n        CrashIf(!style);\r\n        b->SetMouseOverStyle(style);\r\n    }\r\n    FreeButtonVectorDef(def);\r\n    return b;\r\n}\r\n\r\nstatic Button *ButtonFromDef(TxtNode *structDef) {\r\n    CrashIf(!structDef->IsStructWithName(\"Button\"));\r\n    ButtonDef *def = DeserializeButtonDef(structDef);\r\n    Style *style = StyleByName(def->style);\r\n    Button *b = new Button(def->text, style, style);\r\n    b->SetName(def->name);\r\n    FreeButtonDef(def);\r\n    return b;\r\n}\r\n\r\nstatic ScrollBar *ScrollBarFromDef(TxtNode *structDef) {\r\n    CrashIf(!structDef->IsStructWithName(\"ScrollBar\"));\r\n    ScrollBarDef *def = DeserializeScrollBarDef(structDef);\r\n    ScrollBar *sb = new ScrollBar();\r\n    Style *style = StyleByName(def->style);\r\n    sb->SetStyle(style);\r\n    sb->SetName(def->name);\r\n\r\n    // TODO: support def->cursor\r\n\r\n    FreeScrollBarDef(def);\r\n    return sb;\r\n}\r\n\r\nstatic float ParseLayoutFloat(const char *s) {\r\n    if (str::EqI(s, \"self\"))\r\n        return SizeSelf;\r\n    return ParseFloat(s);\r\n}\r\n\r\nstatic void SetDirectionalLayouData(DirectionalLayoutData &ld, ParsedMui &parsed,\r\n                                    DirectionalLayoutDataDef *def) {\r\n    float sla = ParseLayoutFloat(def->sla);\r\n    float snla = ParseLayoutFloat(def->snla);\r\n    ElAlignData elAlign = ParseElAlignData(def->align);\r\n    ILayout *el = FindElementNamed(parsed, def->controlName);\r\n    ld.Set(el, sla, snla, elAlign);\r\n}\r\n\r\nstatic HorizontalLayout *HorizontalLayoutFromDef(ParsedMui &parsed, TxtNode *structDef) {\r\n    CrashIf(!structDef->IsStructWithName(\"HorizontalLayout\"));\r\n    HorizontalLayoutDef *def = DeserializeHorizontalLayoutDef(structDef);\r\n    HorizontalLayout *l = new HorizontalLayout();\r\n    l->SetName(def->name);\r\n    Vec<DirectionalLayoutDataDef *> *children = def->children;\r\n\r\n    DirectionalLayoutData ld;\r\n    for (size_t i = 0; children && i < children->Count(); i++) {\r\n        SetDirectionalLayouData(ld, parsed, children->At(i));\r\n        l->Add(ld);\r\n    }\r\n\r\n    FreeHorizontalLayoutDef(def);\r\n    return l;\r\n}\r\n\r\nstatic VerticalLayout *VerticalLayoutFromDef(ParsedMui &parsed, TxtNode *structDef) {\r\n    CrashIf(!structDef->IsStructWithName(\"VerticalLayout\"));\r\n    VerticalLayoutDef *def = DeserializeVerticalLayoutDef(structDef);\r\n    VerticalLayout *l = new VerticalLayout();\r\n    l->SetName(def->name);\r\n    Vec<DirectionalLayoutDataDef *> *children = def->children;\r\n\r\n    DirectionalLayoutData ld;\r\n    for (size_t i = 0; children && i < children->Count(); i++) {\r\n        SetDirectionalLayouData(ld, parsed, children->At(i));\r\n        l->Add(ld);\r\n    }\r\n\r\n    FreeVerticalLayoutDef(def);\r\n    return l;\r\n}\r\n\r\n// TODO: create the rest of controls\r\nstatic void ParseMuiDefinition(TxtNode *root, ParsedMui &res) {\r\n    for (TxtNode *node : *root->children) {\r\n        CrashIf(!node->IsStruct());\r\n        if (node->IsStructWithName(\"Style\")) {\r\n            CacheStyleFromStruct(node);\r\n        } else if (node->IsStructWithName(\"ButtonVector\")) {\r\n            ButtonVector *b = ButtonVectorFromDef(node);\r\n            res.allControls.Append(b);\r\n            res.vecButtons.Append(b);\r\n        } else if (node->IsStructWithName(\"Button\")) {\r\n            Button *b = ButtonFromDef(node);\r\n            res.allControls.Append(b);\r\n            res.buttons.Append(b);\r\n        } else if (node->IsStructWithName(\"ScrollBar\")) {\r\n            ScrollBar *sb = ScrollBarFromDef(node);\r\n            res.allControls.Append(sb);\r\n            res.scrollBars.Append(sb);\r\n        } else if (node->IsStructWithName(\"HorizontalLayout\")) {\r\n            HorizontalLayout *l = HorizontalLayoutFromDef(res, node);\r\n            res.layouts.Append(l);\r\n        } else if (node->IsStructWithName(\"VerticalLayout\")) {\r\n            VerticalLayout *l = VerticalLayoutFromDef(res, node);\r\n            res.layouts.Append(l);\r\n        } else {\r\n            ScopedMem<char> keyName(node->KeyDup());\r\n            ControlCreatorFunc creatorFunc = FindControlCreatorFuncFor(keyName);\r\n            if (creatorFunc) {\r\n                Control *c = creatorFunc(node);\r\n                if (c)\r\n                    res.allControls.Append(c);\r\n                continue;\r\n            }\r\n\r\n            LayoutCreatorFunc layoutCreatorFunc = FindLayoutCreatorFuncFor(keyName);\r\n            CrashIf(!layoutCreatorFunc);\r\n            ILayout *layout = layoutCreatorFunc(&res, node);\r\n            if (layout)\r\n                res.layouts.Append(layout);\r\n        }\r\n    }\r\n}\r\n\r\nbool MuiFromText(char *s, ParsedMui &res) {\r\n    TxtParser parser;\r\n    parser.SetToParse(s, str::Len(s));\r\n    bool ok = ParseTxt(parser);\r\n    if (!ok)\r\n        return false;\r\n    ParseMuiDefinition(GetRootArray(&parser), res);\r\n    CrashIf(!ok);\r\n    return ok;\r\n}\r\n\r\n} // namespace mui\r\n"
  },
  {
    "path": "src/mui/MuiFromText.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nclass ParsedMui {\r\n  public:\r\n    Vec<Control *> allControls;\r\n    Vec<ButtonVector *> vecButtons;\r\n    Vec<Button *> buttons;\r\n    Vec<ScrollBar *> scrollBars;\r\n    Vec<ILayout *> layouts;\r\n};\r\n\r\nbool MuiFromText(char *s, ParsedMui &res);\r\nButton *FindButtonNamed(const ParsedMui &muiInfo, const char *name);\r\nButtonVector *FindButtonVectorNamed(const ParsedMui &muiInfo, const char *name);\r\nScrollBar *FindScrollBarNamed(const ParsedMui &muiInfo, const char *name);\r\nControl *FindControlNamed(const ParsedMui &muiInfo, const char *name);\r\nILayout *FindLayoutNamed(const ParsedMui &muiInfo, const char *name);\r\n\r\ntypedef Control *(*ControlCreatorFunc)(TxtNode *);\r\nvoid RegisterControlCreatorFor(const char *typeName, ControlCreatorFunc creator);\r\nvoid FreeControlCreators();\r\n\r\ntypedef ILayout *(*LayoutCreatorFunc)(ParsedMui *, TxtNode *);\r\nvoid RegisterLayoutCreatorFor(const char *layoutName, LayoutCreatorFunc creator);\r\nvoid FreeLayoutCreators();\r\n"
  },
  {
    "path": "src/mui/MuiGrid.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"Mui.h\"\r\n\r\nnamespace mui {\r\n\r\nGrid::Grid(Style *style)\r\n    : dirty(true), cells(nullptr), maxColWidth(nullptr), maxRowHeight(nullptr), rows(0), cols(0) {\r\n    SetStyle(style);\r\n}\r\n\r\nGrid::~Grid() {\r\n    free(cells);\r\n    free(maxColWidth);\r\n    free(maxRowHeight);\r\n}\r\n\r\n// TODO: request repaint?\r\nGrid &Grid::Add(Grid::CellData &ld) {\r\n    CrashIf(!ld.el);\r\n    els.Append(ld);\r\n    AddChild(ld.el);\r\n    dirty = true;\r\n    return *this;\r\n}\r\n\r\nGrid::Cell *Grid::GetCell(int row, int col) const {\r\n    CrashIf(row < 0);\r\n    CrashIf(row >= rows);\r\n    CrashIf(col < 0);\r\n    CrashIf(col >= cols);\r\n    return &cells[row * cols + col];\r\n}\r\n\r\nPoint Grid::GetCellPos(int row, int col) const {\r\n    int x = 0, y = 0;\r\n    for (int c = 0; c < col; c++) {\r\n        x += maxColWidth[c];\r\n    }\r\n    for (int r = 0; r < row; r++) {\r\n        y += maxRowHeight[r];\r\n    }\r\n    return Point(x, y);\r\n}\r\n\r\n// if there were elements added/removed from the grid,\r\n// we need to rebuild info about cells\r\nvoid Grid::RebuildCellDataIfNeeded() {\r\n    if (!dirty)\r\n        return;\r\n\r\n    // calculate how many columns and rows we need and build 2d cells\r\n    // array, a cell for each column/row\r\n    cols = 0;\r\n    rows = 0;\r\n\r\n    for (Grid::CellData &d : els) {\r\n        int maxCols = d.col + d.colSpan;\r\n        if (maxCols > cols)\r\n            cols = maxCols;\r\n        if (d.row >= rows)\r\n            rows = d.row + 1;\r\n    }\r\n\r\n    free(cells);\r\n    cells = AllocArray<Cell>(cols * rows);\r\n\r\n    // TODO: not sure if I want to disallow empty grids, but do for now\r\n    CrashIf(0 == rows);\r\n    CrashIf(0 == cols);\r\n\r\n    free(maxColWidth);\r\n    maxColWidth = AllocArray<int>(this->cols);\r\n    free(maxRowHeight);\r\n    maxRowHeight = AllocArray<int>(this->rows);\r\n    dirty = false;\r\n}\r\n\r\nRect Grid::GetCellBbox(Grid::CellData *d) {\r\n    Rect r;\r\n    // TODO: probably add Grid's border to X\r\n    Point p(GetCellPos(d->row, d->col));\r\n    r.X = p.X;\r\n    r.Y = p.Y;\r\n    r.Height = maxRowHeight[d->row];\r\n    int totalDx = 0;\r\n    for (int i = d->col; i < d->col + d->colSpan; i++) {\r\n        totalDx += maxColWidth[i];\r\n    }\r\n    r.Width = totalDx;\r\n    return r;\r\n}\r\n\r\nvoid Grid::Paint(Graphics *gfx, int offX, int offY) {\r\n    CrashIf(!IsVisible());\r\n    CachedStyle *s = cachedStyle;\r\n\r\n    RectF bbox((REAL)offX, (REAL)offY, (REAL)pos.Width, (REAL)pos.Height);\r\n    Brush *brBgColor = BrushFromColorData(s->bgColor, bbox);\r\n    gfx->FillRectangle(brBgColor, bbox);\r\n\r\n    Rect r(offX, offY, pos.Width, pos.Height);\r\n    DrawBorder(gfx, r, s);\r\n\r\n    for (Grid::CellData &d : els) {\r\n        if (!d.cachedStyle)\r\n            continue;\r\n\r\n        Rect cellRect(GetCellBbox(&d));\r\n        cellRect.X += offX;\r\n        cellRect.Y += offY;\r\n        s = d.cachedStyle;\r\n        DrawBorder(gfx, cellRect, s);\r\n    }\r\n}\r\n\r\nSize Grid::Measure(const Size availableSize) {\r\n    RebuildCellDataIfNeeded();\r\n\r\n    Size borderSize(GetBorderAndPaddingSize(cachedStyle));\r\n\r\n    Cell *cell;\r\n    Control *el;\r\n    for (Grid::CellData &d : els) {\r\n        cell = GetCell(d.row, d.col);\r\n        cell->desiredSize.Width = 0;\r\n        cell->desiredSize.Height = 0;\r\n        el = d.el;\r\n        if (!el->IsVisible())\r\n            continue;\r\n\r\n        // calculate max dx of each column (dx of widest cell in the row)\r\n        //  and max dy of each row (dy of tallest cell in the column)\r\n        el->Measure(availableSize);\r\n\r\n        // TODO: take cell's border and padding into account\r\n\r\n        cell->desiredSize = el->DesiredSize();\r\n        // if a cell spans multiple columns, we don't count its size here\r\n        if (d.colSpan == 1) {\r\n            if (cell->desiredSize.Width > maxColWidth[d.col])\r\n                maxColWidth[d.col] = cell->desiredSize.Width;\r\n        }\r\n        if (cell->desiredSize.Height > maxRowHeight[d.row])\r\n            maxRowHeight[d.row] = cell->desiredSize.Height;\r\n    }\r\n\r\n    // account for cells with colSpan > 1. If cell.dx > total dx\r\n    // of columns it spans, we widen the columns by equally\r\n    // re-distributing the difference among columns\r\n    for (Grid::CellData &d : els) {\r\n        if (d.colSpan == 1)\r\n            continue;\r\n        cell = GetCell(d.row, d.col);\r\n\r\n        int totalDx = 0;\r\n        for (int i = d.col; i < d.col + d.colSpan; i++) {\r\n            totalDx += maxColWidth[i];\r\n        }\r\n        int diff = cell->desiredSize.Width - totalDx;\r\n        if (diff > 0) {\r\n            int diffPerCol = diff / d.colSpan;\r\n            int rest = diff % d.colSpan;\r\n            // note: we could try to redistribute rest for ideal sizing instead of\r\n            // over-sizing but not sure if that would matter in practice\r\n            if (rest > 0)\r\n                diffPerCol += 1;\r\n            CrashIf(diffPerCol * d.colSpan < diff);\r\n            for (int i = d.col; i < d.col + d.colSpan; i++) {\r\n                maxColWidth[i] += diffPerCol;\r\n            }\r\n        }\r\n    }\r\n\r\n    int desiredWidth = 0;\r\n    int desiredHeight = 0;\r\n    for (int row = 0; row < rows; row++) {\r\n        desiredHeight += maxRowHeight[row];\r\n    }\r\n    for (int col = 0; col < cols; col++) {\r\n        desiredWidth += maxColWidth[col];\r\n    }\r\n    // TODO: what to do if desired size is more than availableSize?\r\n    desiredSize.Width = desiredWidth + borderSize.Width;\r\n    desiredSize.Height = desiredHeight + borderSize.Height;\r\n    return desiredSize;\r\n}\r\n\r\nvoid Grid::Arrange(const Rect finalRect) {\r\n    Cell *cell;\r\n    Control *el;\r\n\r\n    for (Grid::CellData &d : els) {\r\n        cell = GetCell(d.row, d.col);\r\n        el = d.el;\r\n        Point pos(GetCellPos(d.row, d.col));\r\n        int elDx = el->DesiredSize().Width;\r\n        int containerDx = 0;\r\n        for (int i = d.col; i < d.col + d.colSpan; i++) {\r\n            containerDx += maxColWidth[i];\r\n        }\r\n\r\n        int xOff = d.horizAlign.CalcOffset(elDx, containerDx);\r\n        pos.X += xOff;\r\n        int elDy = el->DesiredSize().Height;\r\n        int containerDy = maxRowHeight[d.row];\r\n        int yOff = d.vertAlign.CalcOffset(elDy, containerDy);\r\n        pos.Y += yOff;\r\n        Rect r(pos, cell->desiredSize);\r\n        el->Arrange(r);\r\n    }\r\n    SetPosition(finalRect);\r\n}\r\n\r\n} // namespace mui\r\n"
  },
  {
    "path": "src/mui/MuiGrid.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// Grid consits of cells arranged as an array of rows and columns\r\n// It's also its own layout, because layout needs intimate knowledge\r\n// of grid data\r\nclass Grid : public Control {\r\n  public:\r\n    struct CellData {\r\n        Control *el;\r\n        CachedStyle *cachedStyle;\r\n        int row, col;\r\n        int colSpan;\r\n        // cell of the grid can be bigger than the element.\r\n        // vertAlign and horizAlign define how the element\r\n        // is laid out within the cell\r\n        ElAlignData vertAlign;\r\n        ElAlignData horizAlign;\r\n\r\n        CellData()\r\n            : el(nullptr),\r\n              cachedStyle(nullptr),\r\n              row(0),\r\n              col(0),\r\n              colSpan(1),\r\n              vertAlign(GetElAlignTop()),\r\n              horizAlign(GetElAlignLeft()) {}\r\n\r\n        CellData(const CellData &other)\r\n            : el(other.el),\r\n              cachedStyle(other.cachedStyle),\r\n              row(other.row),\r\n              col(other.col),\r\n              colSpan(other.colSpan),\r\n              vertAlign(other.vertAlign),\r\n              horizAlign(other.horizAlign) {}\r\n\r\n        void Set(Control *el, int row, int col, ElAlign horizAlign = ElAlign::Left,\r\n                 ElAlign vertAlign = ElAlign::Bottom) {\r\n            this->el = el;\r\n            this->cachedStyle = nullptr;\r\n            this->row = row;\r\n            this->col = col;\r\n            this->colSpan = 1; // this can be re-used, so re-set to default value\r\n            this->vertAlign = GetElAlign(vertAlign);\r\n            this->horizAlign = GetElAlign(horizAlign);\r\n        }\r\n\r\n        bool SetStyle(Style *s) {\r\n            bool changed;\r\n            cachedStyle = CacheStyle(s, &changed);\r\n            return changed;\r\n        }\r\n    };\r\n\r\n    struct Cell {\r\n        Size desiredSize;\r\n        // TODO: more data\r\n    };\r\n\r\n  private:\r\n    int rows;\r\n    int cols;\r\n\r\n    // if dirty is true, rows/cols and ld must be rebuilt from els\r\n    bool dirty;\r\n    // cells is rows * cols in size\r\n    Cell *cells;\r\n    // maxColWidth is an array of cols size and contains\r\n    // maximum width of each column (the width of the widest\r\n    // cell in that column)\r\n    int *maxColWidth;\r\n    int *maxRowHeight;\r\n\r\n    Size desiredSize; // calculated in Measure()\r\n\r\n    void RebuildCellDataIfNeeded();\r\n    Cell *GetCell(int row, int col) const;\r\n    Point GetCellPos(int row, int col) const;\r\n    Rect GetCellBbox(Grid::CellData *d);\r\n\r\n  public:\r\n    Vec<CellData> els;\r\n\r\n    Grid(Style *style = nullptr);\r\n    virtual ~Grid();\r\n\r\n    Grid &Add(CellData &);\r\n\r\n    // Control\r\n    virtual void Paint(Graphics *gfx, int offX, int offY);\r\n\r\n    // ILayout\r\n    virtual Size Measure(const Size availableSize);\r\n    virtual Size DesiredSize() { return desiredSize; }\r\n    virtual void Arrange(const Rect finalRect);\r\n};\r\n"
  },
  {
    "path": "src/mui/MuiHwndWrapper.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"Timer.h\"\r\n#include \"WinUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"Mui.h\"\r\n#include \"FrameRateWnd.h\"\r\n//#define NOLOG 0\r\n#include \"DebugLog.h\"\r\n\r\nnamespace mui {\r\n\r\nHwndWrapper::HwndWrapper(HWND hwnd)\r\n    : painter(nullptr),\r\n      evtMgr(nullptr),\r\n      layoutRequested(false),\r\n      firstLayout(true),\r\n      sizeToFit(false),\r\n      centerContent(false),\r\n      markedForRepaint(false) {\r\n    if (hwnd)\r\n        SetHwnd(hwnd);\r\n}\r\n\r\nHwndWrapper::~HwndWrapper() {\r\n    delete evtMgr;\r\n    delete painter;\r\n}\r\n\r\n// Set minimum size for the HWND represented by this HwndWrapper.\r\n// It is enforced in EventManager.\r\n// Default size is (0,0) which is unlimited.\r\n// For top-level windows it's the size of the whole window, including\r\n// non-client area like borders, title area etc.\r\nvoid HwndWrapper::SetMinSize(Size s) { evtMgr->SetMinSize(s); }\r\n\r\n// Set maximum size for the HWND represented by this HwndWrapper.\r\n// It is enforced in EventManager.\r\n// Default size is (0,0) which is unlimited.\r\n// For top-level windows it's the size of the whole window, including\r\n// non-client area like borders, title area etc.\r\nvoid HwndWrapper::SetMaxSize(Size s) { evtMgr->SetMaxSize(s); }\r\n\r\nvoid HwndWrapper::SetHwnd(HWND hwnd) {\r\n    CrashIf(nullptr != hwndParent);\r\n    hwndParent = hwnd;\r\n    evtMgr = new EventMgr(this);\r\n    painter = new Painter(this);\r\n}\r\n\r\nSize HwndWrapper::Measure(const Size availableSize) {\r\n    if (layout) {\r\n        return layout->Measure(availableSize);\r\n    }\r\n    if (children.Count() == 1) {\r\n        ILayout *l = children.At(0);\r\n        return l->Measure(availableSize);\r\n    }\r\n    desiredSize = Size();\r\n    return desiredSize;\r\n}\r\n\r\nvoid HwndWrapper::Arrange(const Rect finalRect) {\r\n    if (layout) {\r\n        // might over-write position if our layout knows about us\r\n        layout->Arrange(finalRect);\r\n    } else {\r\n        if (children.Count() == 1) {\r\n            ILayout *l = children.At(0);\r\n            l->Arrange(finalRect);\r\n        }\r\n    }\r\n}\r\n\r\n// called when either the window size changed (as a result\r\n// of WM_SIZE) or when the content of the window changes\r\nvoid HwndWrapper::TopLevelLayout() {\r\n    CrashIf(!hwndParent);\r\n    ClientRect rc(hwndParent);\r\n    Size availableSize(rc.dx, rc.dy);\r\n    // lf(\"(%3d,%3d) HwndWrapper::TopLevelLayout()\", rc.dx, rc.dy);\r\n    Size s = Measure(availableSize);\r\n\r\n    if (firstLayout && sizeToFit) {\r\n        firstLayout = false;\r\n        desiredSize = s;\r\n        ResizeHwndToClientArea(hwndParent, s.Width, s.Height, false);\r\n        layoutRequested = false;\r\n        return;\r\n    }\r\n\r\n    desiredSize = availableSize;\r\n    Rect r(0, 0, availableSize.Width, availableSize.Height);\r\n    SetPosition(r);\r\n    if (centerContent) {\r\n        int n = availableSize.Width - s.Width;\r\n        if (n > 0) {\r\n            r.X = n / 2;\r\n            r.Width = s.Width;\r\n        }\r\n        n = availableSize.Height - s.Height;\r\n        if (n > 0) {\r\n            r.Y = n / 2;\r\n            r.Height = s.Height;\r\n        }\r\n    }\r\n    Arrange(r);\r\n    layoutRequested = false;\r\n}\r\n\r\n// mark for re-layout as soon as possible\r\nvoid HwndWrapper::RequestLayout() {\r\n    layoutRequested = true;\r\n    markedForRepaint = true;\r\n    // trigger message queue so that the layout request is processed\r\n    InvalidateRect(hwndParent, nullptr, TRUE);\r\n    UpdateWindow(hwndParent);\r\n}\r\n\r\nvoid HwndWrapper::LayoutIfRequested() {\r\n    if (layoutRequested)\r\n        TopLevelLayout();\r\n}\r\n\r\nvoid HwndWrapper::OnPaint(HWND hwnd) {\r\n    CrashIf(hwnd != hwndParent);\r\n    Timer t;\r\n    painter->Paint(hwnd, markedForRepaint);\r\n    if (frameRateWnd) {\r\n        ShowFrameRateDur(frameRateWnd, t.GetTimeInMs());\r\n    }\r\n    markedForRepaint = false;\r\n}\r\n\r\nbool HwndWrapper::IsInSizeMove() const { return evtMgr->IsInSizeMove(); }\r\n}\r\n"
  },
  {
    "path": "src/mui/MuiHwndWrapper.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nclass Painter;\r\nclass EventMgr;\r\n\r\n// Control that has to be the root of window tree and is\r\n// backed by a HWND. It combines a painter and EventManager\r\n// for this HWND. In your message loop you must call\r\n// HwndWrapper::evtMgr->OnMessage()\r\nclass HwndWrapper : public Control {\r\n    bool layoutRequested;\r\n    bool markedForRepaint;\r\n    bool firstLayout;\r\n\r\n  public:\r\n    Painter* painter;\r\n    EventMgr* evtMgr;\r\n    // size the window to fit the size of the content on first layout\r\n    bool sizeToFit;\r\n    // center the content within the window. Incompatible with sizeToFit\r\n    bool centerContent;\r\n\r\n    FrameRateWnd* frameRateWnd;\r\n\r\n    HwndWrapper(HWND hwnd = nullptr);\r\n    virtual ~HwndWrapper();\r\n\r\n    void SetMinSize(Size minSize);\r\n    void SetMaxSize(Size maxSize);\r\n\r\n    void RequestLayout();\r\n    void MarkForRepaint() { markedForRepaint = true; }\r\n    void LayoutIfRequested();\r\n    void SetHwnd(HWND hwnd);\r\n    void OnPaint(HWND hwnd);\r\n\r\n    // ILayout\r\n    virtual Size Measure(const Size availableSize);\r\n    virtual void Arrange(const Rect finalRect);\r\n\r\n    void TopLevelLayout();\r\n\r\n    bool IsInSizeMove() const;\r\n};\r\n"
  },
  {
    "path": "src/mui/MuiLayout.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"Mui.h\"\r\n\r\nnamespace mui {\r\n\r\nDirectionalLayout::~DirectionalLayout() {}\r\n\r\nDirectionalLayout& DirectionalLayout::Add(const DirectionalLayoutData& ld) {\r\n    els.Append(ld);\r\n    return *this;\r\n}\r\n\r\nSize DirectionalLayout::Measure(const Size availableSize) {\r\n    for (DirectionalLayoutData& e : els) {\r\n        e.element->Measure(availableSize);\r\n        e.desiredSize = e.element->DesiredSize();\r\n    }\r\n    // TODO: this is wrong\r\n    return desiredSize;\r\n}\r\n\r\nstatic int CalcScaledClippedSize(int size, float scale, int selfSize) {\r\n    int scaledSize = selfSize;\r\n    if (SizeSelf != scale)\r\n        scaledSize = (int)((float)size * scale);\r\n    if (scaledSize > size)\r\n        scaledSize = size;\r\n    return scaledSize;\r\n}\r\n\r\nstruct SizeInfo {\r\n    int size;\r\n    float scale;\r\n\r\n    int finalPos;\r\n    int finalSize;\r\n};\r\n\r\nstatic void RedistributeSizes(Vec<SizeInfo>& sizes, int totalSize) {\r\n    float toDistributeTotal = 0.f;\r\n    int remainingSpace = totalSize;\r\n\r\n    for (SizeInfo& si : sizes) {\r\n        if (SizeSelf == si.scale)\r\n            remainingSpace -= si.size;\r\n        else\r\n            toDistributeTotal += si.scale;\r\n    }\r\n\r\n    int pos = 0;\r\n    for (SizeInfo& si : sizes) {\r\n        if (SizeSelf == si.scale)\r\n            si.finalSize = si.size;\r\n        else if (remainingSpace > 0 && toDistributeTotal != 0.f)\r\n            si.finalSize = (int)(((float)remainingSpace * si.scale) / toDistributeTotal);\r\n        else\r\n            si.finalSize = 0;\r\n        si.finalPos = pos;\r\n        pos += si.finalSize;\r\n    }\r\n}\r\n\r\nvoid HorizontalLayout::Arrange(const Rect finalRect) {\r\n    Vec<SizeInfo> sizes;\r\n\r\n    for (DirectionalLayoutData& e : els) {\r\n        SizeInfo sizeInfo = { e.desiredSize.Width, e.sizeLayoutAxis, 0, 0 };\r\n        sizes.Append(sizeInfo);\r\n    }\r\n    RedistributeSizes(sizes, finalRect.Width);\r\n\r\n    Vec<SizeInfo>::Iter si = sizes.begin();\r\n    for (DirectionalLayoutData& e : els) {\r\n        int dy = CalcScaledClippedSize(finalRect.Height, e.sizeNonLayoutAxis, e.desiredSize.Height);\r\n        int y = e.alignNonLayoutAxis.CalcOffset(dy, finalRect.Height);\r\n        e.element->Arrange(Rect((*si).finalPos, y, (*si).finalSize, dy));\r\n        ++si;\r\n    }\r\n    CrashIf(si != sizes.end());\r\n}\r\n\r\nvoid VerticalLayout::Arrange(const Rect finalRect) {\r\n    Vec<SizeInfo> sizes;\r\n\r\n    for (DirectionalLayoutData& e : els) {\r\n        SizeInfo sizeInfo = { e.desiredSize.Height, e.sizeLayoutAxis, 0, 0 };\r\n        sizes.Append(sizeInfo);\r\n    }\r\n    RedistributeSizes(sizes, finalRect.Height);\r\n\r\n    Vec<SizeInfo>::Iter si = sizes.begin();\r\n    for (DirectionalLayoutData& e : els) {\r\n        int dx = CalcScaledClippedSize(finalRect.Width, e.sizeNonLayoutAxis, e.desiredSize.Width);\r\n        int x = e.alignNonLayoutAxis.CalcOffset(dx, finalRect.Width);\r\n        e.element->Arrange(Rect(x, (*si).finalPos, dx, (*si).finalSize));\r\n        ++si;\r\n    }\r\n    CrashIf(si != sizes.end());\r\n}\r\n\r\n} // namespace mui\r\n"
  },
  {
    "path": "src/mui/MuiLayout.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// WPF-like layout system. Measure() should update DesiredSize()\r\n// After Measure() the parent uses DesiredSize() to calculate the\r\n// size of its children and uses Arrange() to set it.\r\n// availableSize can have SizeInfinite as dx or dy to allow\r\n// using as much space as the window wants\r\n// Every Control implements ILayout for calculating their desired\r\n// size but can also have independent ILayout (which is for controls\r\n// that contain other controls). This allows decoupling layout logic\r\n// from controls and implementing generic layouts.\r\nclass ILayout {\r\n  public:\r\n    ScopedMem<char> name;\r\n    void SetName(const char* n) {\r\n        if (n)\r\n            name.Set(str::Dup(n));\r\n    }\r\n    bool IsNamed(const char* s) const { return str::EqI(name.Get(), s); }\r\n    virtual ~ILayout(){};\r\n    virtual Size Measure(const Size availableSize) = 0;\r\n    virtual Size DesiredSize() = 0;\r\n    virtual void Arrange(const Rect finalRect) = 0;\r\n};\r\n\r\n#define SizeSelf 666.f\r\n\r\n// Defines how we layout a single element within a container\r\n// using either horizontal or vertical layout. Vertical/Horizontal\r\n// layout are conceptually the same, just using different axis/dimensions\r\n// for calculations. LayoutAxis is x for horizontal layout and y\r\n// for vertical layout. NonLayoutAxis is the other one.\r\nstruct DirectionalLayoutData {\r\n    ILayout* element;\r\n    // size is a float that determines how much of the remaining\r\n    // available space of the container should be allocated to\r\n    // this element. A magic value SizeSelf means the element should\r\n    // get its desired size. This is similar to star sizing in WPF in\r\n    // that the remaining space gets redistributed among all elements.\r\n    // e.g. if there is only one element with size != SizeSelf, and size\r\n    // is 0.5, it'll get half the remaining space, if size is 1.0, it'll\r\n    // get the whole remaining space but if there are 2 elements and\r\n    // both have size 1.0, they'll only get half remaining space each\r\n    float sizeLayoutAxis;\r\n    // similar to sizeLayoutAxis except there's only one element in\r\n    // this axis, so things are simpler\r\n    float sizeNonLayoutAxis;\r\n\r\n    // within layout axis, elements are laid out sequentially.\r\n    // alignNonLayoutAxis determines how to align the element\r\n    // within container in the other axis\r\n    ElAlignData alignNonLayoutAxis;\r\n\r\n    // data to be used during layout process\r\n\r\n    // desiredSize of the element after Measure() step\r\n    Size desiredSize;\r\n\r\n    DirectionalLayoutData()\r\n        : element(nullptr),\r\n          sizeLayoutAxis(0.f),\r\n          sizeNonLayoutAxis(0.f),\r\n          alignNonLayoutAxis(GetElAlignCenter()) {}\r\n\r\n    DirectionalLayoutData(const DirectionalLayoutData& other)\r\n        : element(other.element),\r\n          sizeLayoutAxis(other.sizeLayoutAxis),\r\n          sizeNonLayoutAxis(other.sizeNonLayoutAxis),\r\n          alignNonLayoutAxis(other.alignNonLayoutAxis),\r\n          desiredSize(other.desiredSize) {}\r\n\r\n    void Set(ILayout* el, float sla, float snla, const ElAlignData& a) {\r\n        element = el;\r\n        sizeLayoutAxis = sla;\r\n        sizeNonLayoutAxis = snla;\r\n        alignNonLayoutAxis = a;\r\n    }\r\n};\r\n\r\nclass DirectionalLayout : public ILayout {\r\n  protected:\r\n    Vec<DirectionalLayoutData> els;\r\n    Size desiredSize;\r\n\r\n  public:\r\n    virtual ~DirectionalLayout();\r\n    virtual Size DesiredSize() { return desiredSize; }\r\n\r\n    DirectionalLayout& Add(const DirectionalLayoutData& ld);\r\n\r\n    virtual Size Measure(const Size availableSize);\r\n    virtual void Arrange(const Rect finalRect) {\r\n        UNUSED(finalRect);\r\n        CrashIf(true);\r\n    }\r\n};\r\n\r\nclass HorizontalLayout : public DirectionalLayout {\r\n  public:\r\n    HorizontalLayout() {}\r\n\r\n    virtual void Arrange(const Rect finalRect);\r\n};\r\n\r\nclass VerticalLayout : public DirectionalLayout {\r\n  public:\r\n    VerticalLayout() {}\r\n\r\n    virtual void Arrange(const Rect finalRect);\r\n};\r\n"
  },
  {
    "path": "src/mui/MuiPainter.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"Mui.h\"\r\n#include \"DebugLog.h\"\r\n\r\nnamespace mui {\r\n\r\nstatic bool BitmapNotBigEnough(Bitmap *bmp, int dx, int dy) {\r\n    if (nullptr == bmp)\r\n        return true;\r\n    if (bmp->GetWidth() < (UINT)dx)\r\n        return true;\r\n    if (bmp->GetHeight() < (UINT)dy)\r\n        return true;\r\n    return false;\r\n}\r\n\r\nPainter::Painter(HwndWrapper *wnd) : wnd(wnd), cacheBmp(nullptr) {}\r\n\r\nPainter::~Painter() { ::delete cacheBmp; }\r\n\r\n// we paint the background in Painter() because I don't\r\n// want to add an artificial Control window just to cover\r\n// the whole HWND and paint the background.\r\nvoid Painter::PaintBackground(Graphics *g, Rect r) {\r\n    // TODO: don't quite get why I need to expand the rectangle, but\r\n    // sometimes there's a seemingly 1 pixel artifact on the left and\r\n    // at the top if I don't do this\r\n    r.Inflate(1, 1);\r\n    ColorData *bgColor = wnd->cachedStyle->bgColor;\r\n    Brush *br = BrushFromColorData(bgColor, r);\r\n    g->FillRectangle(br, r);\r\n}\r\n\r\n// TODO: figure out how INT16_MIN was defined\r\n// This is in <intsafe.h> and utils\\msvc\\stdint.h under some conditions\r\n#define MY_INT16_MIN (-32767 - 1)\r\n#define MY_INT16_MAX 32767\r\n\r\n// Paint windows in z-order by first collecting the windows\r\n// and then painting consecutive layers with the same z-order,\r\n// starting with the lowest z-order.\r\n// We don't sort because we want to preserve the order of\r\n// containment of windows with the same z-order and non-stable\r\n// sort could change it.\r\nstatic void PaintWindowsInZOrder(Graphics *g, Control *c) {\r\n    Vec<CtrlAndOffset> toPaint;\r\n    WndFilter wndFilter;\r\n    Pen debugPen(Color(255, 0, 0), 1);\r\n\r\n    CollectWindowsBreathFirst(c, 0, 0, &wndFilter, &toPaint);\r\n    size_t paintedCount = 0;\r\n    int16 lastPaintedZOrder = MY_INT16_MIN;\r\n    for (;;) {\r\n        // find which z-order should we paint now\r\n        int16 minUnpaintedZOrder = MY_INT16_MAX;\r\n        for (CtrlAndOffset &coff : toPaint) {\r\n            int16 zOrder = coff.c->zOrder;\r\n            if ((zOrder > lastPaintedZOrder) && (zOrder < minUnpaintedZOrder))\r\n                minUnpaintedZOrder = zOrder;\r\n        }\r\n        for (CtrlAndOffset &coff : toPaint) {\r\n            if (minUnpaintedZOrder == coff.c->zOrder) {\r\n                coff.c->Paint(g, coff.offX, coff.offY);\r\n                if (IsDebugPaint()) {\r\n                    Rect bbox(coff.offX, coff.offY, coff.c->pos.Width, coff.c->pos.Height);\r\n                    g->DrawRectangle(&debugPen, bbox);\r\n                }\r\n                ++paintedCount;\r\n            }\r\n        }\r\n        if (paintedCount == toPaint.Count())\r\n            return;\r\n        CrashIf(paintedCount > toPaint.Count());\r\n        lastPaintedZOrder = minUnpaintedZOrder;\r\n    }\r\n}\r\n\r\n// Should be called from WM_PAINT. Recursively paints a given window and\r\n// all its children. Control must be the top-level window associated\r\n// with HWND.\r\n// Note: maybe should be split into BeginPaint()/Paint()/EndPaint()\r\n// calls so that the caller can do more drawing after Paint()\r\nvoid Painter::Paint(HWND hwnd, bool isDirty) {\r\n    CrashAlwaysIf(hwnd != wnd->hwndParent);\r\n\r\n    PAINTSTRUCT ps;\r\n    HDC dc = BeginPaint(hwnd, &ps);\r\n\r\n    Region clip;\r\n\r\n    // TODO: be intelligent about only repainting changed\r\n    // parts for perf. Note: if cacheBmp changes, we need\r\n    // to repaint everything\r\n    Graphics gDC(dc);\r\n    gDC.GetClip(&clip);\r\n\r\n    ClientRect r(hwnd);\r\n\r\n    // TODO: fix showing black parts when resizing a window.\r\n    // my theory is that we see black background on right/bottom\r\n    // of the window when we resize the window because the os paints\r\n    // it black and we take too long to perform the whole paint so the\r\n    // black part persists long enough for human eye to notice.\r\n    // To fix that we could try to paint the black part immediately\r\n    // to gDC using the same color as the background. This is problematic\r\n    // for two reasons:\r\n    // - I don't know which part exactly needs to be repainted\r\n    // - it can be tricky if background is a gradient\r\n    // I thought I could just do PaintBackground(&gDC, r.ToGdipRect())\r\n    // but that generates flickr which leads me to believe that either\r\n    // Graphics::FillRectangle() ignores clip region or clip region is not set\r\n    // properly. Current solution detects a resize, paints a background and the\r\n    // last version of page, which somewhat eliminates the problem but also\r\n    // sometimes causes flickr\r\n    // See http://www.catch22.net/tuts/flicker for info on win repainting\r\n    if (cacheBmp && !sizeDuringLastPaint.Equals(Size(r.dx, r.dy))) {\r\n        PaintBackground(&gDC, r.ToGdipRect());\r\n        gDC.DrawImage(cacheBmp, 0, 0);\r\n        sizeDuringLastPaint = Size(r.dx, r.dy);\r\n    }\r\n\r\n    if (BitmapNotBigEnough(cacheBmp, r.dx, r.dy)) {\r\n        ::delete cacheBmp;\r\n        cacheBmp = ::new Bitmap(r.dx, r.dy, &gDC);\r\n        isDirty = true;\r\n    }\r\n\r\n    // TODO: log clipBounds for debugging\r\n    // Rect clipBounds;\r\n    // clip.GetBounds(&cliBounds)\r\n\r\n    // draw to a bitmap cache unless we were asked to skip\r\n    // this step and just blit cached bitmap because the caller\r\n    // knows it didn't change\r\n    if (isDirty) {\r\n        Graphics g((Image *)cacheBmp);\r\n        InitGraphicsMode(&g);\r\n        g.SetClip(&clip, CombineModeReplace);\r\n\r\n        PaintBackground(&g, r.ToGdipRect());\r\n        PaintWindowsInZOrder(&g, wnd);\r\n    }\r\n\r\n    // TODO: try to manually draw only the part that falls within\r\n    // clipBounds or is it done automatically by DrawImage() ?\r\n    gDC.DrawImage(cacheBmp, 0, 0);\r\n    EndPaint(hwnd, &ps);\r\n}\r\n}\r\n"
  },
  {
    "path": "src/mui/MuiPainter.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// Manages painting process of Control window and all its children.\r\n// Automatically does double-buffering for less flicker.\r\n// Create one object for each HWND-backed Control and keep it around.\r\nclass Painter {\r\n    HwndWrapper *wnd;\r\n    // bitmap for double-buffering\r\n    Bitmap *cacheBmp;\r\n    Size sizeDuringLastPaint;\r\n\r\n    void PaintBackground(Graphics *g, Rect r);\r\n\r\n  public:\r\n    Painter(HwndWrapper *wnd);\r\n    ~Painter();\r\n\r\n    void Paint(HWND hwnd, bool isDirty);\r\n};\r\n"
  },
  {
    "path": "src/mui/MuiScrollBar.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"BitManip.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"Mui.h\"\r\n\r\nnamespace mui {\r\n\r\nfloat PercFromInt(int total, int n) {\r\n    CrashIf(n > total);\r\n    if (0 == total)\r\n        return 0.f;\r\n    return (float)n / (float)total;\r\n}\r\n\r\nint IntFromPerc(int total, float perc) { return (int)(total * perc); }\r\n\r\nScrollBar::ScrollBar(int onOverDy, int inactiveDy) : onOverDy(onOverDy), inactiveDy(inactiveDy) {\r\n    filledPerc = 0.f;\r\n    bit::Set(wantedInputBits, WantsMouseOverBit, WantsMouseClickBit);\r\n}\r\n\r\nSize ScrollBar::Measure(const Size availableSize) {\r\n    // dx is max available\r\n    desiredSize.Width = availableSize.Width;\r\n\r\n    // dy is bigger of inactiveDy and onHoverDy but\r\n    // smaller than availableSize.Height\r\n    int dy = inactiveDy;\r\n    if (onOverDy > dy)\r\n        dy = onOverDy;\r\n    if (dy > availableSize.Height)\r\n        dy = availableSize.Height;\r\n\r\n    desiredSize.Height = dy;\r\n    return desiredSize;\r\n}\r\n\r\nvoid ScrollBar::NotifyMouseEnter() {\r\n    if (inactiveDy != onOverDy)\r\n        RequestRepaint(this);\r\n}\r\n\r\nvoid ScrollBar::NotifyMouseLeave() {\r\n    if (inactiveDy != onOverDy)\r\n        RequestRepaint(this);\r\n}\r\n\r\nvoid ScrollBar::SetFilled(float perc) {\r\n    CrashIf((perc < 0.f) || (perc > 1.f));\r\n    int prev = IntFromPerc(pos.Width, filledPerc);\r\n    int curr = IntFromPerc(pos.Width, perc);\r\n    filledPerc = perc;\r\n    if (prev != curr)\r\n        RequestRepaint(this);\r\n}\r\n\r\nfloat ScrollBar::GetPercAt(int x) { return PercFromInt(pos.Width, x); }\r\n\r\nvoid ScrollBar::Paint(Graphics *gfx, int offX, int offY) {\r\n    CrashIf(!IsVisible());\r\n    // TODO: take padding into account\r\n    CachedStyle *s = cachedStyle;\r\n\r\n    int dy = inactiveDy;\r\n    if (IsMouseOver())\r\n        dy = onOverDy;\r\n\r\n    Rect r(offX, offY + pos.Height - dy, pos.Width, dy);\r\n    Brush *br = BrushFromColorData(s->bgColor, r);\r\n    gfx->FillRectangle(br, r);\r\n\r\n    int filledDx = IntFromPerc(pos.Width, filledPerc);\r\n    if (0 == filledDx)\r\n        return;\r\n\r\n    r.Width = filledDx;\r\n    br = BrushFromColorData(s->color, r);\r\n    gfx->FillRectangle(br, r);\r\n}\r\n}\r\n"
  },
  {
    "path": "src/mui/MuiScrollBar.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// TODO: this is meant to evolve into a scroll bar (which can also serve\r\n// as a non-scrollable rectangle bar for e.g. indicating progress) but\r\n// it's far from it. Currently it's just horizontal progress bar that visually\r\n// represents percentage progress of some activity.\r\n// It can also report clicks within itself.\r\n// The background is drawn with PropBgColor and the part that represents\r\n// percentage with PropColor.\r\n// It has a fixed height, provided by a caller, but the width can vary\r\n// depending on layout.\r\n// For a bit of an extra effect, it has 2 heights: one when mouse is over\r\n// the control and another when mouse is not over.\r\n// For the purpose of layout, we use the bigger of the to as the real\r\n// height of the control\r\n// Clients can register fo IClickEvent events for this window to implement\r\n// interactivity\r\n\r\n// TODO: needs to work for both vertical and horizontal cases\r\n\r\n// TODO: needs all the other scrollbar functionality\r\n\r\n// TODO: we don't take padding int account yet\r\nclass ScrollBar : public Control {\r\n    int onOverDy;   // when mouse is over\r\n    int inactiveDy; // when mouse is not over\r\n\r\n    // what percentage of the rectangle is filled with PropColor\r\n    // (the rest is filled with PropBgColor).\r\n    // The range is from 0 to 1\r\n    float filledPerc;\r\n\r\n  public:\r\n    ScrollBar(int onOverDy = 12, int inactiveDy = 5);\r\n    ~ScrollBar() {}\r\n    virtual Size Measure(const Size availableSize);\r\n    virtual void NotifyMouseEnter();\r\n    virtual void NotifyMouseLeave();\r\n\r\n    virtual void Paint(Graphics *gfx, int offX, int offY);\r\n\r\n    void SetFilled(float perc);\r\n    float GetPercAt(int x);\r\n};\r\n\r\nfloat PercFromInt(int total, int n);\r\nint IntFromPerc(int total, float perc);\r\n"
  },
  {
    "path": "src/mui/SvgPath.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n/*\r\nParser for SVG path string (also used in WPF). The idea is\r\nto have an easy way to use vector graphics. Parsed path can\r\nbe converted to Gdiplus::GraphicsPath which then can be used\r\nin a Button etc.\r\n\r\nhttp://www.w3.org/TR/SVG/paths.html\r\nhttp://tutorials.jenkov.com/svg/path-element.html\r\nhttps://developer.mozilla.org/en/SVG/Tutorial/Paths\r\n\r\nThe eventual goal is to be able easily use vector data in SVG and XAML\r\nformats as there are many nice, freely licensable icons in those formats.\r\nParsing svg path syntax is the first step.\r\n\r\nTODO: support composite paths (i.e. comprising of multiple GraphicsPaths\r\nthat have attributes like color, pen size etc.). Some graphics require that.\r\n\r\nNote: this is not meant to fully support SVG or XAML syntax. We only need the\r\nbasic subset and we can assume that to import data from SVG/XAML files we'll\r\nwrite a pre-processing script that will convert them to something that we\r\nunderstand.\r\n*/\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"GdiPlusUtil.h\"\r\n#include \"SvgPath.h\"\r\n#include \"VecSegmented.h\"\r\n\r\nnamespace svg {\r\n\r\nenum PathInstrType {\r\n    MoveAbs = 0,\r\n    MoveRel, // M, m\r\n    LineToAbs,\r\n    LineToRel, // L, l\r\n    HLineAbs,\r\n    HLineRel, // H, h\r\n    VLineAbs,\r\n    VLineRel, // V, v\r\n    BezierCAbs,\r\n    BezierCRel, // C, c\r\n    BezierSAbs,\r\n    BezierSRel, // S, s\r\n    BezierQAbs,\r\n    BezierQRel, // Q, q\r\n    BezierTAbs,\r\n    BezierTRel, // T, t\r\n    ArcAbs,\r\n    ArcRel, // A, a\r\n    Close,\r\n    Close2, // Z, z\r\n    Count,\r\n    Unknown = Count\r\n};\r\n\r\n// the order must match order of PathInstrType enums\r\nstatic char *instructions = \"MmLlHhVvCcSsQqTtAaZz\";\r\n\r\nstruct SvgPathInstr {\r\n    SvgPathInstr(PathInstrType type) : type(type) {}\r\n\r\n    PathInstrType type;\r\n    // the meaning of values depends on InstrType. We could be more safe\r\n    // by giving them symbolic names but this gives us simpler parsing\r\n    float v[6];\r\n    bool largeArc, sweep;\r\n};\r\n\r\nstatic PathInstrType GetInstructionType(char c) {\r\n    const char *pos = str::FindChar(instructions, c);\r\n    if (!pos)\r\n        return Unknown;\r\n    return (PathInstrType)(pos - instructions);\r\n}\r\n\r\nstatic bool ParseSvgPathData(const char *s, VecSegmented<SvgPathInstr> &instr) {\r\n    for (; str::IsWs(*s); s++)\r\n        ;\r\n\r\n    while (*s) {\r\n        SvgPathInstr i(GetInstructionType(*s++));\r\n        switch (i.type) {\r\n            case Close:\r\n            case Close2:\r\n                break;\r\n\r\n            case HLineAbs:\r\n            case HLineRel:\r\n            case VLineAbs:\r\n            case VLineRel:\r\n                s = str::Parse(s, \"%f\", &i.v[0]);\r\n                break;\r\n\r\n            case MoveAbs:\r\n            case MoveRel:\r\n            case LineToAbs:\r\n            case LineToRel:\r\n            case BezierTAbs:\r\n            case BezierTRel:\r\n                s = str::Parse(s, \"%f%_%?,%_%f\", &i.v[0], &i.v[1]);\r\n                break;\r\n\r\n            case BezierSAbs:\r\n            case BezierSRel:\r\n            case BezierQAbs:\r\n            case BezierQRel:\r\n                s = str::Parse(s, \"%f%_%?,%_%f,%f%_%?,%_%f\", &i.v[0], &i.v[1], &i.v[2], &i.v[3]);\r\n                break;\r\n\r\n            case BezierCAbs:\r\n            case BezierCRel:\r\n                s = str::Parse(s, \"%f%_%?,%_%f,%f%_%?,%_%f,%f%_%?,%_%f\", &i.v[0], &i.v[1], &i.v[2],\r\n                               &i.v[3], &i.v[4], &i.v[5]);\r\n                break;\r\n\r\n            case ArcAbs:\r\n            case ArcRel: {\r\n                int largeArc, sweep;\r\n                s = str::Parse(s, \"%f%_%?,%_%f%_%?,%_%f%_%?,%_%d%_%?,%_%d%_%?,%_%f%_%?,%_%f\",\r\n                               &i.v[0], &i.v[1], &i.v[2], &largeArc, &sweep, &i.v[3], &i.v[4]);\r\n                i.largeArc = (largeArc != 0);\r\n                i.sweep = (sweep != 0);\r\n            } break;\r\n\r\n            default:\r\n                CrashIf(true);\r\n                return false;\r\n        }\r\n        if (!s)\r\n            return false;\r\n        instr.Append(i);\r\n\r\n        for (; str::IsWs(*s); s++)\r\n            ;\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nstatic void RelPointToAbs(const PointF &lastEnd, float *xy) {\r\n    xy[0] = lastEnd.X + xy[0];\r\n    xy[1] = lastEnd.Y + xy[1];\r\n}\r\n\r\nstatic void RelXToAbs(const PointF &lastEnd, float *x) { *x = lastEnd.X + *x; }\r\n\r\nstatic void RelYToAbs(const PointF &lastEnd, float *y) { *y = lastEnd.Y + *y; }\r\n\r\nGraphicsPath *GraphicsPathFromPathData(const char *s) {\r\n    VecSegmented<SvgPathInstr> instr;\r\n    if (!ParseSvgPathData(s, instr))\r\n        return nullptr;\r\n    GraphicsPath *gp = ::new GraphicsPath();\r\n    PointF prevEnd(0.f, 0.f);\r\n    for (SvgPathInstr &i : instr) {\r\n        PathInstrType type = i.type;\r\n\r\n        // convert relative coordinates to absolute based on end position of\r\n        // previous element\r\n        // TODO: support the rest of instructions\r\n        if (MoveRel == type) {\r\n            RelPointToAbs(prevEnd, i.v);\r\n            type = MoveAbs;\r\n        } else if (LineToRel == type) {\r\n            RelPointToAbs(prevEnd, i.v);\r\n            type = LineToAbs;\r\n        } else if (HLineRel == type) {\r\n            RelXToAbs(prevEnd, i.v);\r\n            type = HLineAbs;\r\n        } else if (VLineRel == type) {\r\n            RelYToAbs(prevEnd, i.v);\r\n            type = VLineAbs;\r\n        }\r\n\r\n        if (MoveAbs == type) {\r\n            PointF p(i.v[0], i.v[1]);\r\n            prevEnd = p;\r\n            gp->StartFigure();\r\n        } else if (LineToAbs == type) {\r\n            PointF p(i.v[0], i.v[1]);\r\n            gp->AddLine(prevEnd, p);\r\n            prevEnd = p;\r\n        } else if (HLineAbs == type) {\r\n            PointF p(prevEnd);\r\n            p.X = i.v[0];\r\n            gp->AddLine(prevEnd, p);\r\n            prevEnd = p;\r\n        } else if (VLineAbs == type) {\r\n            PointF p(prevEnd);\r\n            p.Y = i.v[0];\r\n            gp->AddLine(prevEnd, p);\r\n            prevEnd = p;\r\n        } else if ((Close == type) || (Close2 == type)) {\r\n            gp->CloseFigure();\r\n        } else {\r\n            CrashIf(true);\r\n        }\r\n    }\r\n    return gp;\r\n}\r\n}\r\n"
  },
  {
    "path": "src/mui/SvgPath.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nnamespace svg {\r\n\r\nGdiplus::GraphicsPath *GraphicsPathFromPathData(const char *s);\r\n}\r\n"
  },
  {
    "path": "src/mui/SvgPath_ut.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// note: only meant to be #included from SvgPath.cpp,\r\n// not compiled on its own\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"SvgPath.h\"\r\n#include \"VecSegmented.h\"\r\n\r\n// must be last due to assert() over-write\r\n#include \"UtAssert.h\"\r\n\r\nusing namespace Gdiplus;\r\n\r\nstatic void SvgPath00() {\r\n    const char *paths[] = { \"M0 0  L10 13 L0 ,26 Z\", \"M10 0 L0,  13 L10 26 z\" };\r\n    for (size_t i = 0; i < dimof(paths); i++) {\r\n        GraphicsPath *gp = svg::GraphicsPathFromPathData(paths[i]);\r\n        utassert(gp);\r\n        ::delete gp;\r\n    }\r\n}\r\n\r\nvoid SvgPath_UnitTests() { SvgPath00(); }\r\n"
  },
  {
    "path": "src/mui/TextRender.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"WinUtil.h\"\r\n#include \"GdiPlusUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"Mui.h\"\r\n\r\n/*\r\nTODO:\r\n - text drawing is still too slow. each html page takes ~20ms to draw, which is\r\n   terrible and much slower than what I think the test render was doing (~1ms)\r\n   Is it beacuase it draws to gfx->GetHDC() instead of e.g. natural or bitmap\r\n   HDC? In which case maybe I should render text to bitmap hdc and then\r\n   blit that once to Graphics?\r\n - add transparent rendering to GDI, see:\r\n   http://stackoverflow.com/questions/1340166/transparency-to-text-in-gdi\r\n   http://theartofdev.wordpress.com/2013/10/24/transparent-text-rendering-with-gdi/\r\n - figure out a way to get rid of Lock()/Unlock(). One way is to turn ITextRender into a full-blown\r\n   IGraphics abstraction (add drawing calls to it) and then GDI+-based implementation could\r\n   track locking state internally, so that the caller doesn't have to.\r\n   Another options would be to figure out a way to draw to a bitmap and blit that bitmap\r\n   to Graphics object.\r\n*/\r\n\r\n/* Note: I would prefer this code be in utils but it depends on mui, so it must\r\nbe in mui to avoid circular dependency */\r\n\r\nnamespace mui {\r\n\r\nTextRenderGdi *TextRenderGdi::Create(Graphics *gfx) {\r\n    TextRenderGdi *res = new TextRenderGdi();\r\n    res->gfx = gfx;\r\n    // default to red to make mistakes stand out\r\n    res->SetTextColor(Color(0xff, 0xff, 0x0, 0x0));\r\n    res->CreateHdcForTextMeasure(); // could do lazily, but that's more things to track, so not\r\n                                    // worth it\r\n    return res;\r\n}\r\n\r\nvoid TextRenderGdi::CreateHdcForTextMeasure() {\r\n    HDC hdc = hdcGfxLocked;\r\n    bool unlock = false;\r\n    if (!hdc) {\r\n        hdc = gfx->GetHDC();\r\n        unlock = true;\r\n    }\r\n    hdcForTextMeasure = CreateCompatibleDC(hdc);\r\n    if (unlock) {\r\n        gfx->ReleaseHDC(hdc);\r\n    }\r\n}\r\n\r\nTextRenderGdi::~TextRenderGdi() {\r\n    RestoreHdcForTextMeasurePrevFont();\r\n    RestoreMemHdcPrevFont();\r\n    RestoreMemHdcPrevBitmap();\r\n    FreeMemBmp();\r\n    DeleteDC(memHdc);\r\n    DeleteDC(hdcForTextMeasure);\r\n    CrashIf(hdcGfxLocked); // hasn't been Unlock()ed\r\n}\r\n\r\nvoid TextRenderGdi::RestoreMemHdcPrevBitmap() {\r\n    if (memHdcPrevBitmap != nullptr) {\r\n        SelectObject(memHdc, memHdcPrevBitmap);\r\n        memHdcPrevBitmap = nullptr;\r\n    }\r\n}\r\n\r\nvoid TextRenderGdi::RestoreMemHdcPrevFont() {\r\n    if (memHdcPrevFont != nullptr) {\r\n        SelectObject(memHdc, memHdcPrevFont);\r\n        memHdcPrevFont = nullptr;\r\n    }\r\n}\r\n\r\nvoid TextRenderGdi::RestoreHdcForTextMeasurePrevFont() {\r\n    if (hdcForTextMeasurePrevFont != nullptr) {\r\n        SelectObject(hdcForTextMeasure, hdcForTextMeasurePrevFont);\r\n        hdcForTextMeasurePrevFont = nullptr;\r\n    }\r\n}\r\n\r\nvoid TextRenderGdi::SetFont(mui::CachedFont *font) {\r\n    // I'm not sure how expensive SelectFont() is so avoid it just in case\r\n    if (currFont == font) {\r\n        return;\r\n    }\r\n    currFont = font;\r\n    HFONT hfont = font->GetHFont();\r\n    if (hdcGfxLocked) {\r\n        SelectFont(hdcGfxLocked, hfont);\r\n    }\r\n    if (hdcForTextMeasure) {\r\n        RestoreHdcForTextMeasurePrevFont();\r\n        hdcForTextMeasurePrevFont = SelectFont(hdcForTextMeasure, hfont);\r\n    }\r\n}\r\n\r\nfloat TextRenderGdi::GetCurrFontLineSpacing() {\r\n#if 1\r\n    return currFont->font->GetHeight(gfx);\r\n#else\r\n    CrashIf(!currFont);\r\n    TEXTMETRIC tm;\r\n    GetTextMetrics(hdcForTextMeasure, &tm);\r\n    return (float)tm.tmHeight;\r\n#endif\r\n}\r\n\r\nRectF TextRenderGdi::Measure(const WCHAR *s, size_t sLen) {\r\n    SIZE txtSize;\r\n    GetTextExtentPoint32W(hdcForTextMeasure, s, (int)sLen, &txtSize);\r\n    RectF res(0.0f, 0.0f, (float)txtSize.cx, (float)txtSize.cy);\r\n    return res;\r\n}\r\n\r\nRectF TextRenderGdi::Measure(const char *s, size_t sLen) {\r\n    size_t strLen = str::Utf8ToWcharBuf(s, sLen, txtConvBuf, dimof(txtConvBuf));\r\n    return Measure(txtConvBuf, strLen);\r\n}\r\n\r\nvoid TextRenderGdi::SetTextColor(Gdiplus::Color col) {\r\n    if (textColor.GetValue() == col.GetValue()) {\r\n        return;\r\n    }\r\n    textColor = col;\r\n    if (hdcGfxLocked) {\r\n        ::SetTextColor(hdcGfxLocked, col.ToCOLORREF());\r\n    }\r\n}\r\n\r\nvoid TextRenderGdi::SetTextBgColor(Gdiplus::Color col) {\r\n    if (textBgColor.GetValue() == col.GetValue()) {\r\n        return;\r\n    }\r\n    textBgColor = col;\r\n    if (hdcGfxLocked) {\r\n        ::SetBkColor(hdcGfxLocked, textBgColor.ToCOLORREF());\r\n    }\r\n}\r\n\r\nvoid TextRenderGdi::Lock() {\r\n    CrashIf(hdcGfxLocked);\r\n    Region r;\r\n    Status st = gfx->GetClip(&r); // must call before GetHDC(), which locks gfx\r\n    CrashIf(st != Ok);\r\n    HRGN hrgn = r.GetHRGN(gfx);\r\n\r\n    hdcGfxLocked = gfx->GetHDC();\r\n    SelectClipRgn(hdcGfxLocked, hrgn);\r\n    DeleteObject(hrgn);\r\n\r\n    SelectFont(hdcGfxLocked, currFont);\r\n    ::SetTextColor(hdcGfxLocked, textColor.ToCOLORREF());\r\n    ::SetBkColor(hdcGfxLocked, textBgColor.ToCOLORREF());\r\n}\r\n\r\nvoid TextRenderGdi::Unlock() {\r\n    CrashIf(!hdcGfxLocked);\r\n    gfx->ReleaseHDC(hdcGfxLocked);\r\n    hdcGfxLocked = nullptr;\r\n}\r\n\r\nvoid TextRenderGdi::Draw(const WCHAR *s, size_t sLen, RectF &bb, bool isRtl) {\r\n#if 0\r\n    DrawTransparent(s, sLen, bb, isRtl);\r\n#else\r\n    CrashIf(!hdcGfxLocked); // hasn't been Lock()ed\r\n    int x = (int)bb.X;\r\n    int y = (int)bb.Y;\r\n    UINT opts = ETO_OPAQUE;\r\n    if (isRtl)\r\n        opts = opts | ETO_RTLREADING;\r\n    ExtTextOut(hdcGfxLocked, x, y, opts, nullptr, s, (UINT)sLen, nullptr);\r\n#endif\r\n}\r\n\r\nvoid TextRenderGdi::Draw(const char *s, size_t sLen, RectF &bb, bool isRtl) {\r\n#if 0\r\n    DrawTransparent(s, sLen, bb, isRtl);\r\n#else\r\n    size_t strLen = str::Utf8ToWcharBuf(s, sLen, txtConvBuf, dimof(txtConvBuf));\r\n    return Draw(txtConvBuf, strLen, bb, isRtl);\r\n#endif\r\n}\r\n\r\nvoid TextRenderGdi::FreeMemBmp() { DeleteObject(memBmp); }\r\n\r\nvoid TextRenderGdi::CreateClearBmpOfSize(int dx, int dy) {\r\n    // set minimums for less allocations\r\n    if (dx < 128)\r\n        dx = 128;\r\n    if (dy < 48)\r\n        dy = 48;\r\n\r\n    if (dx <= memBmpDx && dy <= memBmpDy) {\r\n        ZeroMemory(memBmpData, memBmpDx * memBmpDy * 4);\r\n        return;\r\n    }\r\n    if (!memHdc) {\r\n        memHdc = CreateCompatibleDC(hdcGfxLocked);\r\n    }\r\n\r\n    FreeMemBmp();\r\n\r\n    BITMAPINFO bmi = {};\r\n    bmi.bmiHeader.biSize = sizeof(bmi.bmiHeader);\r\n    bmi.bmiHeader.biWidth = dx;\r\n    bmi.bmiHeader.biHeight = dy;\r\n    bmi.bmiHeader.biPlanes = 1;\r\n    bmi.bmiHeader.biBitCount = 32;\r\n    bmi.bmiHeader.biCompression = BI_RGB;\r\n    bmi.bmiHeader.biSizeImage = dx * dy * 4; // doesn't seem necessary?\r\n\r\n    memBmp = CreateDIBSection(memHdc, &bmi, DIB_RGB_COLORS, &memBmpData, nullptr, 0);\r\n    if (!memBmp)\r\n        return;\r\n\r\n    ZeroMemory(memBmpData, memBmpDx * memBmpDy * 4);\r\n\r\n    RestoreMemHdcPrevBitmap();\r\n    memHdcPrevBitmap = SelectObject(memHdc, memBmp);\r\n}\r\n\r\n// based on http://theartofdev.wordpress.com/2013/10/24/transparent-text-rendering-with-gdi/,\r\n// TODO: look into using http://theartofdev.wordpress.com/2014/01/12/gdi-text-rendering-to-image/\r\n// TODO: doesn't actually look good (i.e. similar to DrawText when using transparent SetBkMode())\r\n// which kind of makes sense, because I'm using transparent mode to draw to in-memory bitmap as well\r\n// TODO: doesn't actually do alpha bf.SourceConstantAlpha > 4 looks the same, values 1-4 produce\r\n// different, but not expected, results\r\n// TODO: I would like to figure out a way to draw text without the need to Lock()/Unlock()\r\n// maybe draw to in-memory bitmap, convert to Graphics bitmap and blit that bitmap to\r\n// Graphics object\r\nvoid TextRenderGdi::DrawTransparent(const WCHAR *s, size_t sLen, RectF &bb, bool isRtl) {\r\n    CrashIf(!hdcGfxLocked); // hasn't been Lock()ed\r\n\r\n    int x = (int)bb.X;\r\n    int y = (int)bb.Y;\r\n    int dx = (int)bb.Width;\r\n    int dy = (int)bb.Height;\r\n\r\n    CreateClearBmpOfSize(dx, dy);\r\n    // SetBkMode(hdcGfxLocked, 1);\r\n    SetBkMode(memHdc, TRANSPARENT);\r\n\r\n    // BitBlt(memHdc, 0, 0, dx, dy, hdcGfxLocked, x, y, SRCCOPY);\r\n    RestoreMemHdcPrevFont();\r\n    memHdcPrevFont = SelectObject(memHdc, currFont);\r\n    ::SetTextColor(memHdc, textColor.ToCOLORREF());\r\n\r\n#if 0\r\n    TextOut(memHdc, 0, 0, s, sLen);\r\n#else\r\n    UINT opts = 0; // ETO_OPAQUE;\r\n    if (isRtl)\r\n        opts = opts | ETO_RTLREADING;\r\n    ExtTextOut(memHdc, 0, 0, opts, nullptr, s, (UINT)sLen, nullptr);\r\n#endif\r\n\r\n    BLENDFUNCTION bf = {};\r\n    bf.BlendOp = AC_SRC_OVER;\r\n    bf.BlendFlags = 0;\r\n    bf.AlphaFormat = 0; // 0 - ignore source alpha, AC_SRC_ALPHA (1) - use source alpha\r\n    bf.SourceConstantAlpha = 0x3; // textColor.GetA();\r\n    AlphaBlend(hdcGfxLocked, x, y, dx, dy, memHdc, 0, 0, dx, dy, bf);\r\n}\r\n\r\nvoid TextRenderGdi::DrawTransparent(const char *s, size_t sLen, RectF &bb, bool isRtl) {\r\n    size_t strLen = str::Utf8ToWcharBuf(s, sLen, txtConvBuf, dimof(txtConvBuf));\r\n    return DrawTransparent(txtConvBuf, strLen, bb, isRtl);\r\n}\r\n\r\nTextRenderGdiplus *TextRenderGdiplus::Create(Graphics *gfx,\r\n                                             RectF (*measureAlgo)(Graphics *g, Font *f,\r\n                                                                  const WCHAR *s, int len)) {\r\n    TextRenderGdiplus *res = new TextRenderGdiplus();\r\n    res->gfx = gfx;\r\n    res->currFont = nullptr;\r\n    if (nullptr == measureAlgo)\r\n        res->measureAlgo = MeasureTextAccurate;\r\n    else\r\n        res->measureAlgo = measureAlgo;\r\n    // default to red to make mistakes stand out\r\n    res->SetTextColor(Color(0xff, 0xff, 0x0, 0x0));\r\n    return res;\r\n}\r\n\r\nvoid TextRenderGdiplus::SetFont(mui::CachedFont *font) {\r\n    CrashIf(!font->font);\r\n    currFont = font;\r\n}\r\n\r\nfloat TextRenderGdiplus::GetCurrFontLineSpacing() { return currFont->font->GetHeight(gfx); }\r\n\r\nRectF TextRenderGdiplus::Measure(const WCHAR *s, size_t sLen) {\r\n    CrashIf(!currFont);\r\n    return MeasureText(gfx, currFont->font, s, sLen, measureAlgo);\r\n}\r\n\r\nRectF TextRenderGdiplus::Measure(const char *s, size_t sLen) {\r\n    CrashIf(!currFont);\r\n    size_t strLen = str::Utf8ToWcharBuf(s, sLen, txtConvBuf, dimof(txtConvBuf));\r\n    return MeasureText(gfx, currFont->font, txtConvBuf, strLen, measureAlgo);\r\n}\r\n\r\nTextRenderGdiplus::~TextRenderGdiplus() { ::delete textColorBrush; }\r\n\r\nvoid TextRenderGdiplus::SetTextColor(Gdiplus::Color col) {\r\n    if (textColor.GetValue() == col.GetValue()) {\r\n        return;\r\n    }\r\n    textColor = col;\r\n    ::delete textColorBrush;\r\n    textColorBrush = ::new SolidBrush(col);\r\n}\r\n\r\nvoid TextRenderGdiplus::Draw(const WCHAR *s, size_t sLen, RectF &bb, bool isRtl) {\r\n    PointF pos;\r\n    bb.GetLocation(&pos);\r\n    if (!isRtl) {\r\n        gfx->DrawString(s, (INT)sLen, currFont->font, pos, nullptr, textColorBrush);\r\n    } else {\r\n        StringFormat rtl;\r\n        rtl.SetFormatFlags(StringFormatFlagsDirectionRightToLeft);\r\n        pos.X += bb.Width;\r\n        gfx->DrawString(s, (INT)sLen, currFont->font, pos, &rtl, textColorBrush);\r\n    }\r\n}\r\n\r\nvoid TextRenderGdiplus::Draw(const char *s, size_t sLen, RectF &bb, bool isRtl) {\r\n    size_t strLen = str::Utf8ToWcharBuf(s, sLen, txtConvBuf, dimof(txtConvBuf));\r\n    Draw(txtConvBuf, strLen, bb, isRtl);\r\n}\r\n\r\nvoid TextRenderHdc::Lock() {\r\n    int dx = bmi.bmiHeader.biWidth;\r\n    int dy = bmi.bmiHeader.biHeight;\r\n    ZeroMemory(bmpData, dx * dy * 4);\r\n}\r\n\r\nvoid TextRenderHdc::Unlock() {\r\n    Bitmap *b = Bitmap::FromBITMAPINFO(&bmi, bmpData);\r\n    gfx->DrawImage(b, 0, 0);\r\n    delete b;\r\n}\r\n\r\nTextRenderHdc *TextRenderHdc::Create(Graphics *gfx, int dx, int dy) {\r\n    TextRenderHdc *res = new TextRenderHdc();\r\n    res->gfx = gfx;\r\n\r\n    HDC hdc = gfx->GetHDC();\r\n    res->hdc = CreateCompatibleDC(hdc);\r\n    gfx->ReleaseHDC(hdc);\r\n\r\n    res->bmi.bmiHeader.biSize = sizeof(res->bmi.bmiHeader);\r\n    res->bmi.bmiHeader.biWidth = dx;\r\n    res->bmi.bmiHeader.biHeight = dy;\r\n    res->bmi.bmiHeader.biPlanes = 1;\r\n    res->bmi.bmiHeader.biBitCount = 32;\r\n    res->bmi.bmiHeader.biCompression = BI_RGB;\r\n    res->bmi.bmiHeader.biSizeImage = dx * dy * 4; // doesn't seem necessary?\r\n\r\n    res->bmp = CreateDIBSection(res->hdc, &res->bmi, DIB_RGB_COLORS, &res->bmpData, nullptr, 0);\r\n    if (!res->bmp) {\r\n        delete res;\r\n        return nullptr;\r\n    }\r\n\r\n    ZeroMemory(res->bmpData, dx * dy * 4);\r\n    SelectObject(res->hdc, res->bmp);\r\n\r\n    // default to red to make mistakes stand out\r\n    res->SetTextColor(Color(0xff, 0xff, 0x0, 0x0));\r\n    return res;\r\n}\r\n\r\nvoid TextRenderHdc::SetFont(CachedFont *font) {\r\n    CrashIf(!hdc);\r\n    // I'm not sure how expensive SelectFont() is so avoid it just in case\r\n    if (currFont == font) {\r\n        return;\r\n    }\r\n    currFont = font;\r\n    SelectFont(hdc, font->GetHFont());\r\n}\r\n\r\nvoid TextRenderHdc::SetTextColor(Gdiplus::Color col) {\r\n    CrashIf(!hdc);\r\n    if (textColor.GetValue() == col.GetValue()) {\r\n        return;\r\n    }\r\n    textColor = col;\r\n    ::SetTextColor(hdc, col.ToCOLORREF());\r\n}\r\n\r\nvoid TextRenderHdc::SetTextBgColor(Gdiplus::Color col) {\r\n    CrashIf(!hdc);\r\n    if (textBgColor.GetValue() == col.GetValue()) {\r\n        return;\r\n    }\r\n    textBgColor = col;\r\n    ::SetBkColor(hdc, textBgColor.ToCOLORREF());\r\n}\r\n\r\nfloat TextRenderHdc::GetCurrFontLineSpacing() { return currFont->font->GetHeight(gfx); }\r\n\r\nGdiplus::RectF TextRenderHdc::Measure(const char *s, size_t sLen) {\r\n    CrashIf(!currFont);\r\n    CrashIf(!hdc);\r\n    size_t strLen = str::Utf8ToWcharBuf(s, sLen, txtConvBuf, dimof(txtConvBuf));\r\n    return Measure(txtConvBuf, strLen);\r\n}\r\n\r\nGdiplus::RectF TextRenderHdc::Measure(const WCHAR *s, size_t sLen) {\r\n    SIZE txtSize;\r\n    CrashIf(!hdc);\r\n    GetTextExtentPoint32W(hdc, s, (int)sLen, &txtSize);\r\n    RectF res(0.0f, 0.0f, (float)txtSize.cx, (float)txtSize.cy);\r\n    return res;\r\n}\r\n\r\nvoid TextRenderHdc::Draw(const char *s, size_t sLen, RectF &bb, bool isRtl) {\r\n    size_t strLen = str::Utf8ToWcharBuf(s, sLen, txtConvBuf, dimof(txtConvBuf));\r\n    return Draw(txtConvBuf, strLen, bb, isRtl);\r\n}\r\n\r\nvoid TextRenderHdc::Draw(const WCHAR *s, size_t sLen, RectF &bb, bool isRtl) {\r\n    CrashIf(!hdc);\r\n    int x = (int)bb.X;\r\n    int y = (int)bb.Y;\r\n    UINT opts = ETO_OPAQUE;\r\n#if 0\r\n    if (isRtl)\r\n        opts = opts | ETO_RTLREADING;\r\n#else\r\n    UNUSED(isRtl);\r\n#endif\r\n    ExtTextOut(hdc, x, y, opts, nullptr, s, (UINT)sLen, nullptr);\r\n}\r\n\r\nTextRenderHdc::~TextRenderHdc() {\r\n    DeleteObject(bmp);\r\n    // free(bmpData);\r\n    DeleteDC(hdc);\r\n}\r\n\r\nITextRender *CreateTextRender(TextRenderMethod method, Graphics *gfx, int dx, int dy) {\r\n    ITextRender *res = nullptr;\r\n    if (TextRenderMethodGdiplus == method) {\r\n        res = TextRenderGdiplus::Create(gfx);\r\n    }\r\n    if (TextRenderMethodGdiplusQuick == method) {\r\n        res = TextRenderGdiplus::Create(gfx, MeasureTextQuick);\r\n    }\r\n    if (TextRenderMethodGdi == method) {\r\n        res = TextRenderGdi::Create(gfx);\r\n    }\r\n    if (TextRenderMethodHdc == method) {\r\n        res = TextRenderHdc::Create(gfx, dx, dy);\r\n    }\r\n    CrashIf(!res);\r\n    res->method = method;\r\n    return res;\r\n}\r\n\r\n// returns number of characters of string s that fits in a given width dx\r\n// note: could be speed up a bit because in our use case we already know\r\n// the width of the whole string so we could supply it to the function, but\r\n// this shouldn't happen often, so that's fine. It's also possible that\r\n// a smarter approach is possible, but this usually only does 3 MeasureText\r\n// calls, so it's not that bad\r\nsize_t StringLenForWidth(ITextRender *textMeasure, const WCHAR *s, size_t len, float dx) {\r\n    RectF r = textMeasure->Measure(s, len);\r\n    if (r.Width <= dx)\r\n        return len;\r\n    // make the best guess of the length that fits\r\n    size_t n = (size_t)((dx / r.Width) * (float)len);\r\n    CrashIf((0 == n) || (n > len));\r\n    r = textMeasure->Measure(s, n);\r\n    // find the length len of s that fits within dx iff width of len+1 exceeds dx\r\n    int dir = 1; // increasing length\r\n    if (r.Width > dx)\r\n        dir = -1; // decreasing length\r\n    for (;;) {\r\n        n += dir;\r\n        r = textMeasure->Measure(s, n);\r\n        if (1 == dir) {\r\n            // if advancing length, we know that previous string did fit, so if\r\n            // the new one doesn't fit, the previous length was the right one\r\n            if (r.Width > dx)\r\n                return n - 1;\r\n        } else {\r\n            // if decreasing length, we know that previous string didn't fit, so if\r\n            // the one one fits, it's of the correct length\r\n            if (r.Width < dx)\r\n                return n;\r\n        }\r\n    }\r\n}\r\n\r\n// TODO: not quite sure why spaceDx1 != spaceDx2, using spaceDx2 because\r\n// is smaller and looks as better spacing to me\r\nREAL GetSpaceDx(ITextRender *textMeasure) {\r\n    RectF bbox;\r\n#if 0\r\n    bbox = textMeasure->Measure(L\" \", 1, algo);\r\n    REAL spaceDx1 = bbox.Width;\r\n    return spaceDx1;\r\n#else\r\n    // this method seems to return (much) smaller size that measuring\r\n    // the space itself\r\n    bbox = textMeasure->Measure(L\"wa\", 2);\r\n    REAL l1 = bbox.Width;\r\n    bbox = textMeasure->Measure(L\"w a\", 3);\r\n    REAL l2 = bbox.Width;\r\n    REAL spaceDx2 = l2 - l1;\r\n    return spaceDx2;\r\n#endif\r\n}\r\n\r\n} // namespace mui\r\n"
  },
  {
    "path": "src/mui/TextRender.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nenum TextRenderMethod {\r\n    TextRenderMethodGdiplus,      // uses MeasureTextAccurate, which is slower than MeasureTextQuick\r\n    TextRenderMethodGdiplusQuick, // uses MeasureTextQuick\r\n    TextRenderMethodGdi,\r\n    TextRenderMethodHdc,\r\n    // TODO: implement TextRenderDirectDraw\r\n    // TextRenderDirectDraw\r\n};\r\n\r\nclass ITextRender {\r\n  public:\r\n    virtual void SetFont(CachedFont *font) = 0;\r\n    virtual void SetTextColor(Gdiplus::Color col) = 0;\r\n\r\n    // this is only for the benefit of TextRenderGdi. In GDI+, Draw() uses\r\n    // transparent background color (i.e. whatever is under).\r\n    // GDI doesn't support such transparency so the best we can do is simulate\r\n    // that if the background is solid color. It won't work in other cases\r\n    virtual void SetTextBgColor(Gdiplus::Color col) = 0;\r\n\r\n    virtual float GetCurrFontLineSpacing() = 0;\r\n\r\n    virtual Gdiplus::RectF Measure(const char *s, size_t sLen) = 0;\r\n    virtual Gdiplus::RectF Measure(const WCHAR *s, size_t sLen) = 0;\r\n\r\n    // GDI+ calls cannot be done if we called Graphics::GetHDC(). However, getting/releasing\r\n    // hdc is very expensive and kills performance if we do it for every Draw(). So we add\r\n    // explicit Lock()/Unlock() calls (only important for TextDrawGdi) so that a caller\r\n    // can batch Draw() calls to minimize GetHDC()/ReleaseHDC() calls\r\n    virtual void Lock() = 0;\r\n    virtual void Unlock() = 0;\r\n\r\n    virtual void Draw(const char *s, size_t sLen, RectF &bb, bool isRtl) = 0;\r\n    virtual void Draw(const WCHAR *s, size_t sLen, RectF &bb, bool isRtl) = 0;\r\n\r\n    virtual ~ITextRender(){};\r\n\r\n    TextRenderMethod method;\r\n};\r\n\r\nclass TextRenderGdi : public ITextRender {\r\n  private:\r\n    HDC hdcGfxLocked;\r\n    HDC hdcForTextMeasure;\r\n    HGDIOBJ hdcForTextMeasurePrevFont;\r\n    CachedFont *currFont;\r\n    Gdiplus::Graphics *gfx;\r\n    Gdiplus::Color textColor;\r\n    Gdiplus::Color textBgColor;\r\n    WCHAR txtConvBuf[512];\r\n\r\n    HDC memHdc;\r\n    HGDIOBJ memHdcPrevFont;\r\n    HBITMAP memBmp;\r\n    HGDIOBJ memHdcPrevBitmap;\r\n    void *memBmpData;\r\n    int memBmpDx, memBmpDy;\r\n\r\n    TextRenderGdi()\r\n        : hdcGfxLocked(nullptr),\r\n          hdcForTextMeasure(nullptr),\r\n          hdcForTextMeasurePrevFont(nullptr),\r\n          currFont(nullptr),\r\n          gfx(nullptr),\r\n          memHdc(nullptr),\r\n          memHdcPrevFont(nullptr),\r\n          memBmp(nullptr),\r\n          memHdcPrevBitmap(nullptr),\r\n          memBmpData(nullptr),\r\n          memBmpDx(0),\r\n          memBmpDy(0) {}\r\n\r\n    void FreeMemBmp();\r\n    void CreateClearBmpOfSize(int dx, int dy);\r\n    void RestoreMemHdcPrevFont();\r\n    void RestoreHdcForTextMeasurePrevFont();\r\n    void RestoreMemHdcPrevBitmap();\r\n\r\n  public:\r\n    void CreateHdcForTextMeasure();\r\n    // note: Draw() ignores any transformation set on gfx\r\n    static TextRenderGdi *Create(Gdiplus::Graphics *gfx);\r\n\r\n    void SetFont(CachedFont *font) override;\r\n    void SetTextColor(Gdiplus::Color col) override;\r\n    void SetTextBgColor(Gdiplus::Color col) override;\r\n\r\n    float GetCurrFontLineSpacing() override;\r\n\r\n    Gdiplus::RectF Measure(const char *s, size_t sLen) override;\r\n    Gdiplus::RectF Measure(const WCHAR *s, size_t sLen) override;\r\n\r\n    void Lock() override;\r\n    void Unlock() override;\r\n\r\n    void Draw(const char *s, size_t sLen, RectF &bb, bool isRtl) override;\r\n    void Draw(const WCHAR *s, size_t sLen, RectF &bb, bool isRtl) override;\r\n\r\n    void DrawTransparent(const char *s, size_t sLen, RectF &bb, bool isRtl);\r\n    void DrawTransparent(const WCHAR *s, size_t sLen, RectF &bb, bool isRtl);\r\n\r\n    ~TextRenderGdi() override;\r\n};\r\n\r\nclass TextRenderGdiplus : public ITextRender {\r\n  private:\r\n    Gdiplus::RectF (*measureAlgo)(Gdiplus::Graphics *g, Gdiplus::Font *f, const WCHAR *s, int len);\r\n\r\n    // We don't own gfx and currFont\r\n    Gdiplus::Graphics *gfx;\r\n    CachedFont *currFont;\r\n    Gdiplus::Color textColor;\r\n    Gdiplus::Brush *textColorBrush;\r\n    WCHAR txtConvBuf[512];\r\n\r\n    TextRenderGdiplus()\r\n        : gfx(nullptr), currFont(nullptr), textColorBrush(nullptr), textColor(0, 0, 0, 0) {}\r\n\r\n  public:\r\n    static TextRenderGdiplus *Create(Gdiplus::Graphics *gfx,\r\n                                     Gdiplus::RectF (*measureAlgo)(Gdiplus::Graphics *g,\r\n                                                                   Gdiplus::Font *f, const WCHAR *s,\r\n                                                                   int len) = nullptr);\r\n\r\n    void SetFont(CachedFont *font) override;\r\n    void SetTextColor(Gdiplus::Color col) override;\r\n    void SetTextBgColor(Gdiplus::Color col) override { UNUSED(col); }\r\n\r\n    float GetCurrFontLineSpacing() override;\r\n\r\n    Gdiplus::RectF Measure(const char *s, size_t sLen) override;\r\n    Gdiplus::RectF Measure(const WCHAR *s, size_t sLen) override;\r\n\r\n    void Lock() override {}\r\n    void Unlock() override {}\r\n\r\n    void Draw(const char *s, size_t sLen, RectF &bb, bool isRtl) override;\r\n    void Draw(const WCHAR *s, size_t sLen, RectF &bb, bool isRtl) override;\r\n\r\n    ~TextRenderGdiplus() override;\r\n};\r\n\r\n// Note: this is not meant to be used, just exists so that I can see\r\n// perf compared to other TextRender* implementations\r\nclass TextRenderHdc : public ITextRender {\r\n\r\n    BITMAPINFO bmi;\r\n\r\n    HDC hdc;\r\n    HBITMAP bmp;\r\n    void *bmpData;\r\n\r\n    // We don't own gfx and currFont\r\n    Gdiplus::Graphics *gfx;\r\n    CachedFont *currFont;\r\n    Gdiplus::Color textColor;\r\n    Gdiplus::Color textBgColor;\r\n    WCHAR txtConvBuf[512];\r\n\r\n    TextRenderHdc()\r\n        : hdc(nullptr),\r\n          bmp(nullptr),\r\n          bmpData(nullptr),\r\n          currFont(nullptr),\r\n          textColor(0, 0, 0, 0),\r\n          textBgColor(0, 0, 0, 0) {\r\n        ZeroMemory(&bmi, sizeof(bmi));\r\n    }\r\n\r\n  public:\r\n    static TextRenderHdc *Create(Gdiplus::Graphics *gfx, int dx, int dy);\r\n\r\n    void SetFont(CachedFont *font) override;\r\n    void SetTextColor(Gdiplus::Color col) override;\r\n    void SetTextBgColor(Gdiplus::Color col) override;\r\n\r\n    float GetCurrFontLineSpacing() override;\r\n\r\n    Gdiplus::RectF Measure(const char *s, size_t sLen) override;\r\n    Gdiplus::RectF Measure(const WCHAR *s, size_t sLen) override;\r\n\r\n    void Lock() override;\r\n    void Unlock() override;\r\n\r\n    void Draw(const char *s, size_t sLen, RectF &bb, bool isRtl) override;\r\n    void Draw(const WCHAR *s, size_t sLen, RectF &bb, bool isRtl) override;\r\n\r\n    ~TextRenderHdc() override;\r\n};\r\n\r\nITextRender *CreateTextRender(TextRenderMethod method, Graphics *gfx, int dx, int dy);\r\n\r\nsize_t StringLenForWidth(ITextRender *textRender, const WCHAR *s, size_t len, float dx);\r\nREAL GetSpaceDx(ITextRender *textRender);\r\n"
  },
  {
    "path": "src/mui/mui-todo.txt",
    "content": ". instead of Control:hCursor, make cursor be part of the style.\r\n  This is more css-like and we'll make Control smaller\r\n\r\n. make it easier to create HWND backing HwndWrapper()\r\n\r\n. combine Button and ButtonVector into one\r\n\r\n. introduce a concept of drawable, which would be\r\n  lighter-weight than a Control and could be used\r\n  to do html layout (i.e. make html layout we do\r\n  for ebooks also available as part of mui).\r\n\r\n. add more tests for testing various features e.g. Grid colSpan etc.\r\n\r\n. a way to easily do text selection in generic way in EventMgr\r\nby giving windows a way to declare they have selectable text/elements\r\n\r\n. some claim GDI+ text drawing is slower than GDI, so we could try\r\nto use GDI instead\r\n\r\n. Grid: add support for laying out elements in\r\n  cells in the same row by baseline (for text)\r\n  Use a magic value for ElAlignData (e.g. -1.f, -1.f)\r\n  when it's used as horizAlign\r\n\r\n. instead of making tooltip just WCHAR*, make it an arbitrary\r\n  Control, for greater creative control\r\n\r\n. use anti-graint library for graphics, instead of gdi+\r\n\r\n. optimize repainting. I have 2 ideas.\r\n\r\n1. Per-control bitmap cache. A flag on Control that requests using a\r\ncache bitmap. If a given control is complicated to draw, we wouldn't\r\nhave to draw it every time during MuiPainter::Paint() but simply blit\r\nif that control hasn't changed. Simple to implement but of limited use. \r\n\r\n2. Layers. We could add capability to group controls into z-ordered\r\nlayers. Each layer would have a cache bitmap. We would only need to\r\nredraw a given layer if some control in has changed. This would allow\r\ndividing controls into those that change frequently and those that\r\ndon't change frequently and putting them on separate layer. An especially\r\nimportant use case for this are animated controls like e.g. circular\r\nprogress indicator (placing them on a separate layer would probably\r\nsignificantly reduce time to redraw the whole window).\r\n\r\n. since we already paint to a cached bitmap, we could do rendering\r\non a background thread and then just blit the bitmap to a window in\r\nWM_PAINT, assuming rendering on a non-ui thread is ok with gdi+.\r\nTechnicall in WM_PAINT we could just start a thread to do the painting\r\nand when it's finished we would bilt the bitmap on ui thread. If there\r\nwere WM_PAINT messages sent in-between, we would note that and start\r\npainting again when the in-progress painting has finished.\r\n\r\n. optimize size of Control. One idea is that instead of embedding rarely used\r\nproperties (like e.g. Control::hwndParent), we could maintain separate mapping\r\nfrom Control * to such properties e.g. in an array. Another idea is to move\r\nrarely used fields into a separate struct linked from Control. If none of rarely\r\nused fields was set, we wouldn't have to allocate that struct.\r\n\r\n. could switch to layout units like in https://trac.webkit.org/wiki/LayoutUnit,\r\nhttps://wiki.mozilla.org/Mozilla2:Units, https://bugzilla.mozilla.org/show_bug.cgi?id=177805\r\n\r\n. not sure if HwndWrapper should be Control\r\n\r\n"
  },
  {
    "path": "src/previewer/PdfPreview.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"PdfEngine.h\"\r\n#if defined(BUILD_EPUB_PREVIEW) || defined(BUILD_FB2_PREVIEW) || defined(BUILD_MOBI_PREVIEW)\r\n#include \"MiniMui.h\"\r\n#include \"EbookEngine.h\"\r\n#endif\r\n#if defined(BUILD_CBZ_PREVIEW) || defined(BUILD_CBR_PREVIEW) || defined(BUILD_CB7_PREVIEW) || defined(BUILD_CBT_PREVIEW) || defined(BUILD_TGA_PREVIEW)\r\n#include \"ImagesEngine.h\"\r\n#endif\r\n// ui\r\n#include \"PdfPreview.h\"\r\n#include \"PdfPreviewBase.h\"\r\n\r\nIFACEMETHODIMP PreviewBase::GetThumbnail(UINT cx, HBITMAP *phbmp, WTS_ALPHATYPE *pdwAlpha)\r\n{\r\n    BaseEngine *engine = GetEngine();\r\n    if (!engine)\r\n        return E_FAIL;\r\n\r\n    RectD page = engine->Transform(engine->PageMediabox(1), 1, 1.0, 0);\r\n    float zoom = std::min(cx / (float)page.dx, cx / (float)page.dy) - 0.001f;\r\n    RectI thumb = RectD(0, 0, page.dx * zoom, page.dy * zoom).Round();\r\n\r\n    BITMAPINFO bmi = { 0 };\r\n    bmi.bmiHeader.biSize = sizeof(bmi.bmiHeader);\r\n    bmi.bmiHeader.biHeight = thumb.dy;\r\n    bmi.bmiHeader.biWidth = thumb.dx;\r\n    bmi.bmiHeader.biPlanes = 1;\r\n    bmi.bmiHeader.biBitCount = 32;\r\n    bmi.bmiHeader.biCompression = BI_RGB;\r\n\r\n    unsigned char *bmpData = nullptr;\r\n    HBITMAP hthumb = CreateDIBSection(nullptr, &bmi, DIB_RGB_COLORS, (void **)&bmpData, nullptr, 0);\r\n    if (!hthumb)\r\n        return E_OUTOFMEMORY;\r\n\r\n    page = engine->Transform(thumb.Convert<double>(), 1, zoom, 0, true);\r\n    RenderedBitmap *bmp = engine->RenderBitmap(1, zoom, 0, &page);\r\n\r\n    HDC hdc = GetDC(nullptr);\r\n    if (bmp && GetDIBits(hdc, bmp->GetBitmap(), 0, thumb.dy, bmpData, &bmi, DIB_RGB_COLORS)) {\r\n        // cf. http://msdn.microsoft.com/en-us/library/bb774612(v=VS.85).aspx\r\n        for (int i = 0; i < thumb.dx * thumb.dy; i++)\r\n            bmpData[4 * i + 3] = 0xFF;\r\n\r\n        *phbmp = hthumb;\r\n        if (pdwAlpha)\r\n            *pdwAlpha = WTSAT_RGB;\r\n    }\r\n    else {\r\n        DeleteObject(hthumb);\r\n        hthumb = nullptr;\r\n    }\r\n\r\n    ReleaseDC(nullptr, hdc);\r\n    delete bmp;\r\n\r\n    return hthumb ? S_OK : E_NOTIMPL;\r\n}\r\n\r\n#define COL_WINDOW_BG   RGB(0x99, 0x99, 0x99)\r\n#define PREVIEW_MARGIN  2\r\n#define UWM_PAINT_AGAIN (WM_USER + 1)\r\n\r\nclass PageRenderer {\r\n    BaseEngine *engine;\r\n    HWND hwnd;\r\n\r\n    int currPage;\r\n    RenderedBitmap *currBmp;\r\n    // due to rounding differences, currBmp->Size() and currSize can differ slightly\r\n    SizeI currSize;\r\n    int reqPage;\r\n    float reqZoom;\r\n    SizeI reqSize;\r\n    bool reqAbort;\r\n    AbortCookie *abortCookie;\r\n\r\n    CRITICAL_SECTION currAccess;\r\n    HANDLE thread;\r\n\r\n    // seeking inside an IStream spins an inner event loop\r\n    // which can cause reentrance in OnPaint and leave an\r\n    // engine semi-initialized when it's called recursively\r\n    // (this only applies for the UI thread where the critical\r\n    // sections can't prevent recursion without the risk of deadlock)\r\n    bool preventRecursion;\r\n\r\npublic:\r\n    PageRenderer(BaseEngine *engine, HWND hwnd) : engine(engine), hwnd(hwnd),\r\n        currPage(0), currBmp(nullptr), reqPage(0), reqZoom(0), reqAbort(false),\r\n        abortCookie(nullptr), thread(nullptr), preventRecursion(false) {\r\n        InitializeCriticalSection(&currAccess);\r\n    }\r\n    ~PageRenderer() {\r\n        if (thread)\r\n            WaitForSingleObject(thread, INFINITE);\r\n        delete currBmp;\r\n        DeleteCriticalSection(&currAccess);\r\n    }\r\n\r\n    RectD GetPageRect(int pageNo) {\r\n        if (preventRecursion)\r\n            return RectD();\r\n\r\n        preventRecursion = true;\r\n        // assume that any engine methods could lead to a seek\r\n        RectD bbox = engine->PageMediabox(pageNo);\r\n        bbox = engine->Transform(bbox, pageNo, 1.0, 0);\r\n        preventRecursion = false;\r\n        return bbox;\r\n    }\r\n\r\n    void Render(HDC hdc, RectI target, int pageNo, float zoom) {\r\n        ScopedCritSec scope(&currAccess);\r\n        if (currBmp && currPage == pageNo && currSize == target.Size())\r\n            currBmp->StretchDIBits(hdc, target);\r\n        else if (!thread) {\r\n            reqPage = pageNo;\r\n            reqZoom = zoom;\r\n            reqSize = target.Size();\r\n            reqAbort = false;\r\n            thread = CreateThread(nullptr, 0, RenderThread, this, 0, 0);\r\n        }\r\n        else if (reqPage != pageNo || reqSize != target.Size()) {\r\n            if (abortCookie)\r\n                abortCookie->Abort();\r\n            reqAbort = true;\r\n        }\r\n    }\r\n\r\nprotected:\r\n    static DWORD WINAPI RenderThread(LPVOID data) {\r\n        ScopedCom comScope; // because the engine reads data from a COM IStream\r\n\r\n        PageRenderer *pr = (PageRenderer *)data;\r\n        RenderedBitmap *bmp = pr->engine->RenderBitmap(pr->reqPage, pr->reqZoom, 0, nullptr, Target_View, &pr->abortCookie);\r\n\r\n        ScopedCritSec scope(&pr->currAccess);\r\n\r\n        if (!pr->reqAbort) {\r\n            delete pr->currBmp;\r\n            pr->currBmp = bmp;\r\n            pr->currPage = pr->reqPage;\r\n            pr->currSize = pr->reqSize;\r\n        }\r\n        else\r\n            delete bmp;\r\n        delete pr->abortCookie;\r\n        pr->abortCookie = nullptr;\r\n\r\n        HANDLE thread = pr->thread;\r\n        pr->thread = nullptr;\r\n        PostMessage(pr->hwnd, UWM_PAINT_AGAIN, 0, 0);\r\n\r\n        CloseHandle(thread);\r\n        return 0;\r\n    }\r\n};\r\n\r\nstatic LRESULT OnPaint(HWND hwnd)\r\n{\r\n    ClientRect rect(hwnd);\r\n    DoubleBuffer buffer(hwnd, rect);\r\n    HDC hdc = buffer.GetDC();\r\n    HBRUSH brushBg = CreateSolidBrush(COL_WINDOW_BG);\r\n    HBRUSH brushWhite = GetStockBrush(WHITE_BRUSH);\r\n    RECT rcClient = rect.ToRECT();\r\n    FillRect(hdc, &rcClient, brushBg);\r\n\r\n    PreviewBase *preview = (PreviewBase *)GetWindowLongPtr(hwnd, GWLP_USERDATA);\r\n    if (preview && preview->renderer) {\r\n        int pageNo = GetScrollPos(hwnd, SB_VERT);\r\n        RectD page = preview->renderer->GetPageRect(pageNo);\r\n        if (!page.IsEmpty()) {\r\n            rect.Inflate(-PREVIEW_MARGIN, -PREVIEW_MARGIN);\r\n            float zoom = (float)std::min(rect.dx / page.dx, rect.dy / page.dy) - 0.001f;\r\n            RectI onScreen = RectD(rect.x, rect.y, page.dx * zoom, page.dy * zoom).Round();\r\n            onScreen.Offset((rect.dx - onScreen.dx) / 2, (rect.dy - onScreen.dy) / 2);\r\n\r\n            RECT rcPage = onScreen.ToRECT();\r\n            FillRect(hdc, &rcPage, brushWhite);\r\n            preview->renderer->Render(hdc, onScreen, pageNo, zoom);\r\n        }\r\n    }\r\n\r\n    DeleteObject(brushBg);\r\n    DeleteObject(brushWhite);\r\n\r\n    PAINTSTRUCT ps;\r\n    buffer.Flush(BeginPaint(hwnd, &ps));\r\n    EndPaint(hwnd, &ps);\r\n    return 0;\r\n}\r\n\r\nstatic LRESULT OnVScroll(HWND hwnd, WPARAM wParam)\r\n{\r\n    SCROLLINFO si = { 0 };\r\n    si.cbSize = sizeof (si);\r\n    si.fMask  = SIF_ALL;\r\n    GetScrollInfo(hwnd, SB_VERT, &si);\r\n\r\n    switch (LOWORD(wParam)) {\r\n    case SB_TOP:        si.nPos = si.nMin; break;\r\n    case SB_BOTTOM:     si.nPos = si.nMax; break;\r\n    case SB_LINEUP:     si.nPos--; break;\r\n    case SB_LINEDOWN:   si.nPos++; break;\r\n    case SB_PAGEUP:     si.nPos--; break;\r\n    case SB_PAGEDOWN:   si.nPos++; break;\r\n    case SB_THUMBTRACK: si.nPos = si.nTrackPos; break;\r\n    }\r\n    si.fMask = SIF_POS;\r\n    SetScrollInfo(hwnd, SB_VERT, &si, TRUE);\r\n\r\n    InvalidateRect(hwnd, nullptr, TRUE);\r\n    UpdateWindow(hwnd);\r\n    return 0;\r\n}\r\n\r\nstatic LRESULT OnKeydown(HWND hwnd, WPARAM key)\r\n{\r\n    switch (key) {\r\n    case VK_DOWN: case VK_RIGHT: case VK_NEXT:\r\n        return OnVScroll(hwnd, SB_PAGEDOWN);\r\n    case VK_UP: case VK_LEFT: case VK_PRIOR:\r\n        return OnVScroll(hwnd, SB_PAGEUP);\r\n    case VK_HOME:\r\n        return OnVScroll(hwnd, SB_TOP);\r\n    case VK_END:\r\n        return OnVScroll(hwnd, SB_BOTTOM);\r\n    default:\r\n        return 0;\r\n    }\r\n}\r\n\r\nstatic LRESULT OnDestroy(HWND hwnd)\r\n{\r\n    PreviewBase *preview = (PreviewBase *)GetWindowLongPtr(hwnd, GWLP_USERDATA);\r\n    if (preview) {\r\n        delete preview->renderer;\r\n        preview->renderer = nullptr;\r\n    }\r\n    return 0;\r\n}\r\n\r\nstatic LRESULT CALLBACK PreviewWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)\r\n{\r\n    switch (message) {\r\n    case WM_PAINT:\r\n        return OnPaint(hwnd);\r\n    case WM_VSCROLL:\r\n        return OnVScroll(hwnd, wParam);\r\n    case WM_KEYDOWN:\r\n        return OnKeydown(hwnd, wParam);\r\n    case WM_LBUTTONDOWN:\r\n        SetFocus(hwnd);\r\n        return 0;\r\n    case WM_MOUSEWHEEL:\r\n        return OnVScroll(hwnd, GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? SB_LINEUP : SB_LINEDOWN);\r\n    case WM_DESTROY:\r\n        return OnDestroy(hwnd);\r\n    case UWM_PAINT_AGAIN:\r\n        InvalidateRect(hwnd, nullptr, TRUE);\r\n        UpdateWindow(hwnd);\r\n        return 0;\r\n    default:\r\n        return DefWindowProc(hwnd, message, wParam, lParam);\r\n    }\r\n}\r\n\r\nIFACEMETHODIMP PreviewBase::DoPreview()\r\n{\r\n    WNDCLASSEX wcex = { 0 };\r\n    wcex.cbSize = sizeof(wcex);\r\n    wcex.lpfnWndProc = PreviewWndProc;\r\n    wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);\r\n    wcex.lpszClassName = L\"SumatraPDF_PreviewPane\";\r\n    wcex.style = CS_HREDRAW | CS_VREDRAW;\r\n    RegisterClassEx(&wcex);\r\n\r\n    m_hwnd = CreateWindow(wcex.lpszClassName, nullptr, WS_CHILD | WS_VSCROLL | WS_VISIBLE,\r\n                          m_rcParent.x, m_rcParent.x, m_rcParent.dx, m_rcParent.dy,\r\n                          m_hwndParent, nullptr, nullptr, nullptr);\r\n    if (!m_hwnd)\r\n        return HRESULT_FROM_WIN32(GetLastError());\r\n\r\n    this->renderer = nullptr;\r\n    SetWindowLongPtr(m_hwnd, GWLP_USERDATA, (LONG_PTR)this);\r\n\r\n    BaseEngine *engine = GetEngine();\r\n    int pageCount = 1;\r\n    if (engine) {\r\n        pageCount = engine->PageCount();\r\n        this->renderer = new PageRenderer(engine, m_hwnd);\r\n        // don't use the engine afterwards directly (cf. PageRenderer::preventRecursion)\r\n        engine = nullptr;\r\n    }\r\n\r\n    SCROLLINFO si = { 0 };\r\n    si.cbSize = sizeof(si);\r\n    si.fMask = SIF_ALL;\r\n    si.nPos = 1;\r\n    si.nMin = 1;\r\n    si.nMax = pageCount;\r\n    si.nPage = si.nMax > 1 ? 1 : 2;\r\n    SetScrollInfo(m_hwnd, SB_VERT, &si, TRUE);\r\n\r\n    ShowWindow(m_hwnd, SW_SHOW);\r\n    return S_OK;\r\n}\r\n\r\nBaseEngine *CPdfPreview::LoadEngine(IStream *stream)\r\n{\r\n    return PdfEngine::CreateFromStream(stream);\r\n}\r\n\r\n#ifdef BUILD_XPS_PREVIEW\r\nBaseEngine *CXpsPreview::LoadEngine(IStream *stream)\r\n{\r\n    return XpsEngine::CreateFromStream(stream);\r\n}\r\n#endif\r\n\r\n#ifdef BUILD_DJVU_PREVIEW\r\n#include \"DjVuEngine.h\"\r\n\r\nBaseEngine *CDjVuPreview::LoadEngine(IStream *stream)\r\n{\r\n    return DjVuEngine::CreateFromStream(stream);\r\n}\r\n#endif\r\n\r\n#ifdef BUILD_EPUB_PREVIEW\r\n\r\nCEpubPreview::CEpubPreview(long *plRefCount) : PreviewBase(plRefCount, SZ_EPUB_PREVIEW_CLSID)\r\n{\r\n    m_gdiScope = new ScopedGdiPlus();\r\n    mui::Initialize();\r\n}\r\n\r\nCEpubPreview::~CEpubPreview()\r\n{\r\n    mui::Destroy();\r\n}\r\n\r\nBaseEngine *CEpubPreview::LoadEngine(IStream *stream)\r\n{\r\n    return EpubEngine::CreateFromStream(stream);\r\n}\r\n#endif\r\n\r\n#ifdef BUILD_FB2_PREVIEW\r\n\r\nCFb2Preview::CFb2Preview(long *plRefCount) : PreviewBase(plRefCount, SZ_FB2_PREVIEW_CLSID)\r\n{\r\n    m_gdiScope = new ScopedGdiPlus();\r\n    mui::Initialize();\r\n}\r\n\r\nCFb2Preview::~CFb2Preview()\r\n{\r\n    mui::Destroy();\r\n}\r\n\r\nBaseEngine *CFb2Preview::LoadEngine(IStream *stream)\r\n{\r\n    return Fb2Engine::CreateFromStream(stream);\r\n}\r\n#endif\r\n\r\n#ifdef BUILD_MOBI_PREVIEW\r\n\r\nCMobiPreview::CMobiPreview(long *plRefCount) : PreviewBase(plRefCount, SZ_MOBI_PREVIEW_CLSID)\r\n{\r\n    m_gdiScope = new ScopedGdiPlus();\r\n    mui::Initialize();\r\n}\r\n\r\nCMobiPreview::~CMobiPreview()\r\n{\r\n    mui::Destroy();\r\n}\r\n\r\nBaseEngine *CMobiPreview::LoadEngine(IStream *stream)\r\n{\r\n    return MobiEngine::CreateFromStream(stream);\r\n}\r\n#endif\r\n\r\n#if defined(BUILD_CBZ_PREVIEW) || defined(BUILD_CBR_PREVIEW) || defined(BUILD_CB7_PREVIEW) || defined(BUILD_CBT_PREVIEW)\r\n\r\nBaseEngine *CCbxPreview::LoadEngine(IStream *stream)\r\n{\r\n    return CbxEngine::CreateFromStream(stream);\r\n}\r\n#endif\r\n\r\n#ifdef BUILD_TGA_PREVIEW\r\n\r\nBaseEngine *CTgaPreview::LoadEngine(IStream *stream)\r\n{\r\n    return ImageEngine::CreateFromStream(stream);\r\n}\r\n#endif\r\n"
  },
  {
    "path": "src/previewer/PdfPreview.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n#define SZ_PDF_PREVIEW_CLSID    L\"{3D3B1846-CC43-42AE-BFF9-D914083C2BA3}\"\r\n#ifdef BUILD_XPS_PREVIEW\r\n#define SZ_XPS_PREVIEW_CLSID    L\"{D427A82C-6545-4FBE-8E87-030EDB3BE46D}\"\r\n#endif\r\n#ifdef BUILD_DJVU_PREVIEW\r\n#define SZ_DJVU_PREVIEW_CLSID   L\"{6689D0D4-1E9C-400A-8BCA-FA6C56B2C3B5}\"\r\n#endif\r\n#ifdef BUILD_EPUB_PREVIEW\r\n#define SZ_EPUB_PREVIEW_CLSID   L\"{80C4E4B1-2B0F-40D5-95AF-BE7B57FEA4F9}\"\r\n#endif\r\n#ifdef BUILD_FB2_PREVIEW\r\n#define SZ_FB2_PREVIEW_CLSID    L\"{D5878036-E863-403E-A62C-7B9C7453336A}\"\r\n#endif\r\n#ifdef BUILD_MOBI_PREVIEW\r\n#define SZ_MOBI_PREVIEW_CLSID   L\"{42CA907E-BDF5-4A75-994A-E1AEC8A10954}\"\r\n#endif\r\n#if defined(BUILD_CBZ_PREVIEW) || defined(BUILD_CBR_PREVIEW) || defined(BUILD_CB7_PREVIEW) || defined(BUILD_CBT_PREVIEW)\r\n#define SZ_CBX_PREVIEW_CLSID    L\"{C29D3E2B-8FF6-4033-A4E8-54221D859D74}\"\r\n#endif\r\n#ifdef BUILD_TGA_PREVIEW\r\n#define SZ_TGA_PREVIEW_CLSID    L\"{CB1D63A6-FE5E-4DED-BEA5-3F6AF1A70D08}\"\r\n#endif\r\n"
  },
  {
    "path": "src/previewer/PdfPreview.rc",
    "content": "#include <windows.h>\n#include \"../Version.h\"\n\nVS_VERSION_INFO    VERSIONINFO     MOVEABLE IMPURE LOADONCALL DISCARDABLE\n  FILEVERSION    VER_RESOURCE\n  PRODUCTVERSION VER_RESOURCE\n  FILEFLAGS     0\n  FILEOS        VOS_NT_WINDOWS32\n  FILETYPE      VFT_DLL\n  FILESUBTYPE   0       // not used\nBEGIN\n  BLOCK \"StringFileInfo\"\n  BEGIN\n    BLOCK \"040904E4\"\n    //language ID = U.S. English, char set = Windows, Multilingual\n\n    BEGIN\n      VALUE \"FileDescription\",  \"SumatraPDF Preview Shell Extension\"\n      VALUE \"FileVersion\",      VER_RESOURCE_STR\n      VALUE \"LegalCopyright\",   COPYRIGHT_STR\n      VALUE \"OriginalFilename\", \"PdfPreview.dll\"\n      VALUE \"ProductName\",      \"SumatraPDF\"\n      VALUE \"ProductVersion\",   VER_RESOURCE_STR\n    END\n  END\n  BLOCK \"VarFileInfo\"\n  BEGIN\n    VALUE \"Translation\", 0x0409, 1252\n  END\nEND\n"
  },
  {
    "path": "src/previewer/PdfPreviewBase.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n#include <Thumbcache.h>\r\n\r\nclass PageRenderer;\r\n\r\nclass PreviewBase : public IThumbnailProvider, public IInitializeWithStream,\r\n    public IObjectWithSite, public IPreviewHandler, public IOleWindow,\r\n    // for Windows XP\r\n    public IPersistFile, public IExtractImage2\r\n{\r\npublic:\r\n    PreviewBase(long *plRefCount, const WCHAR *clsid) : m_lRef(1),\r\n        m_plModuleRef(plRefCount), m_pStream(nullptr), m_engine(nullptr),\r\n        renderer(nullptr), m_gdiScope(nullptr), m_site(nullptr), m_hwnd(nullptr),\r\n        m_hwndParent(nullptr), m_clsid(clsid), m_extractCx(0) {\r\n        InterlockedIncrement(m_plModuleRef);\r\n        m_dateStamp.dwLowDateTime = m_dateStamp.dwHighDateTime = 0;\r\n    }\r\n\r\n    virtual ~PreviewBase() {\r\n        Unload();\r\n        delete m_gdiScope;\r\n        InterlockedDecrement(m_plModuleRef);\r\n    }\r\n\r\n    // IUnknown\r\n    IFACEMETHODIMP QueryInterface(REFIID riid, void **ppv) {\r\n        static const QITAB qit[] = {\r\n            QITABENT(PreviewBase, IInitializeWithStream),\r\n            QITABENT(PreviewBase, IThumbnailProvider),\r\n            QITABENT(PreviewBase, IObjectWithSite),\r\n            QITABENT(PreviewBase, IPreviewHandler),\r\n            QITABENT(PreviewBase, IOleWindow),\r\n            QITABENT(PreviewBase, IExtractImage2),\r\n            QITABENT(PreviewBase, IExtractImage),\r\n            QITABENT(PreviewBase, IPersistFile),\r\n            QITABENT(PreviewBase, IPersist),\r\n            { 0 }\r\n        };\r\n        return QISearch(this, qit, riid, ppv);\r\n    }\r\n    IFACEMETHODIMP_(ULONG) AddRef() {\r\n        return InterlockedIncrement(&m_lRef);\r\n    }\r\n    IFACEMETHODIMP_(ULONG) Release() {\r\n        long cRef = InterlockedDecrement(&m_lRef);\r\n        if (cRef == 0)\r\n            delete this;\r\n        return cRef;\r\n    }\r\n\r\n    // IThumbnailProvider\r\n    IFACEMETHODIMP GetThumbnail(UINT cx, HBITMAP *phbmp, WTS_ALPHATYPE *pdwAlpha);\r\n\r\n    // IInitializeWithStream\r\n    IFACEMETHODIMP Initialize(IStream *pStm, DWORD grfMode) {\r\n        UNUSED(grfMode);\r\n        m_pStream = pStm;\r\n        if (!m_pStream)\r\n            return E_INVALIDARG;\r\n        m_pStream->AddRef();\r\n        return S_OK;\r\n    };\r\n\r\n    // IObjectWithSite\r\n    IFACEMETHODIMP SetSite(IUnknown *punkSite) {\r\n        m_site = nullptr;\r\n        if (!punkSite)\r\n            return S_OK;\r\n        return punkSite->QueryInterface(&m_site);\r\n    }\r\n    IFACEMETHODIMP GetSite(REFIID riid, void **ppv) {\r\n        if (m_site)\r\n            return m_site->QueryInterface(riid, ppv);\r\n        if (!ppv)\r\n            return E_INVALIDARG;\r\n        *ppv = nullptr;\r\n        return E_FAIL;\r\n    }\r\n\r\n    // IPreviewHandler\r\n    IFACEMETHODIMP SetWindow(HWND hwnd, const RECT *prc) {\r\n        if (!hwnd || !prc)\r\n            return S_OK;\r\n        m_hwndParent = hwnd;\r\n        return SetRect(prc);\r\n    }\r\n    IFACEMETHODIMP SetFocus() {\r\n        if (!m_hwnd)\r\n            return S_FALSE;\r\n        ::SetFocus(m_hwnd);\r\n        return S_OK;\r\n    }\r\n    IFACEMETHODIMP QueryFocus(HWND *phwnd) {\r\n        if (!phwnd) return E_INVALIDARG;\r\n        *phwnd = GetFocus();\r\n        if (!*phwnd)\r\n            return HRESULT_FROM_WIN32(GetLastError());\r\n        return S_OK;\r\n    }\r\n    IFACEMETHODIMP TranslateAccelerator(MSG *pmsg) {\r\n        if (!m_site)\r\n            return S_FALSE;\r\n        ScopedComQIPtr<IPreviewHandlerFrame> frame(m_site);\r\n        if (!frame)\r\n            return S_FALSE;\r\n        return frame->TranslateAccelerator(pmsg);\r\n    }\r\n    IFACEMETHODIMP SetRect(const RECT *prc) {\r\n        if (!prc) return E_INVALIDARG;\r\n        m_rcParent = RectI::FromRECT(*prc);\r\n        if (m_hwnd) {\r\n            SetWindowPos(m_hwnd, nullptr, m_rcParent.x, m_rcParent.y, m_rcParent.dx, m_rcParent.dy, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);\r\n            InvalidateRect(m_hwnd, nullptr, TRUE);\r\n            UpdateWindow(m_hwnd);\r\n        }\r\n        return S_OK;\r\n    }\r\n    IFACEMETHODIMP DoPreview();\r\n    IFACEMETHODIMP Unload() {\r\n        if (m_hwnd) {\r\n            DestroyWindow(m_hwnd);\r\n            m_hwnd = nullptr;\r\n        }\r\n        m_pStream = nullptr;\r\n        delete m_engine;\r\n        m_engine = nullptr;\r\n        return S_OK;\r\n    }\r\n\r\n    // IOleWindow\r\n    IFACEMETHODIMP GetWindow(HWND *phwnd) {\r\n        if (!m_hwndParent || !phwnd)\r\n            return E_INVALIDARG;\r\n        *phwnd = m_hwndParent;\r\n        return S_OK;\r\n    }\r\n    IFACEMETHODIMP ContextSensitiveHelp(BOOL fEnterMode) { UNUSED(fEnterMode); return E_NOTIMPL; }\r\n\r\n    // IPersist (for Windows XP)\r\n    IFACEMETHODIMP GetClassID(CLSID *pClassID) {\r\n        return CLSIDFromString((WCHAR *)m_clsid, pClassID);\r\n    }\r\n\r\n    // IPersistFile (for Windows XP)\r\n    IFACEMETHODIMP Load(LPCOLESTR pszFileName, DWORD dwMode) {\r\n        UNUSED(dwMode);\r\n        HANDLE hFile = CreateFile(pszFileName, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);\r\n        if (hFile == INVALID_HANDLE_VALUE)\r\n            return E_INVALIDARG;\r\n        DWORD size = GetFileSize(hFile, nullptr), read;\r\n        HGLOBAL data = GlobalAlloc(GMEM_MOVEABLE, size);\r\n        if (!data) {\r\n            CloseHandle(hFile);\r\n            return E_OUTOFMEMORY;\r\n        }\r\n        BOOL ok = ReadFile(hFile, GlobalLock(data), size, &read, nullptr);\r\n        GlobalUnlock(data);\r\n        GetFileTime(hFile, nullptr, nullptr, &m_dateStamp);\r\n        CloseHandle(hFile);\r\n\r\n        IStream *pStm;\r\n        if (!ok || FAILED(CreateStreamOnHGlobal(data, TRUE, &pStm))) {\r\n            GlobalFree(data);\r\n            return E_FAIL;\r\n        }\r\n        HRESULT res = Initialize(pStm, 0);\r\n        pStm->Release();\r\n        return res;\r\n    }\r\n    IFACEMETHODIMP IsDirty() { return E_NOTIMPL; }\r\n    IFACEMETHODIMP Save(LPCOLESTR pszFileName, BOOL bRemember) { UNUSED(pszFileName); UNUSED(bRemember); return E_NOTIMPL; }\r\n    IFACEMETHODIMP SaveCompleted(LPCOLESTR pszFileName) { UNUSED(pszFileName);  return E_NOTIMPL; }\r\n    IFACEMETHODIMP GetCurFile(LPOLESTR *ppszFileName) { UNUSED(ppszFileName); return E_NOTIMPL; }\r\n\r\n    // IExtractImage2 (for Windows XP)\r\n    IFACEMETHODIMP Extract(HBITMAP *phBmpThumbnail) {\r\n        if (!phBmpThumbnail || !m_extractCx)\r\n            return E_INVALIDARG;\r\n        WTS_ALPHATYPE dummy;\r\n        return GetThumbnail(m_extractCx, phBmpThumbnail, &dummy);\r\n    }\r\n    IFACEMETHODIMP GetLocation(LPWSTR pszPathBuffer, DWORD cch, DWORD *pdwPriority, const SIZE *prgSize, DWORD dwRecClrDepth, DWORD *pdwFlags) {\r\n        UNUSED(pszPathBuffer);  UNUSED(cch);  UNUSED(pdwPriority); UNUSED(dwRecClrDepth);\r\n        if (!prgSize || !pdwFlags)\r\n            return E_INVALIDARG;\r\n        // cheap implementation: ignore anything that isn't useful for IThumbnailProvider::GetThumbnail\r\n        m_extractCx = std::min(prgSize->cx, prgSize->cy);\r\n        *pdwFlags |= IEIFLAG_CACHE;\r\n        return S_OK;\r\n    }\r\n    IFACEMETHODIMP GetDateStamp(FILETIME *pDateStamp) {\r\n        if (!m_dateStamp.dwLowDateTime && !m_dateStamp.dwHighDateTime)\r\n            return E_FAIL;\r\n        *pDateStamp = m_dateStamp;\r\n        return S_OK;\r\n    }\r\n\r\n    BaseEngine *GetEngine() {\r\n        if (!m_engine && m_pStream)\r\n            m_engine = LoadEngine(m_pStream);\r\n        return m_engine;\r\n    }\r\n\r\n    PageRenderer *renderer;\r\n\r\nprotected:\r\n    long m_lRef, * m_plModuleRef;\r\n    ScopedComPtr<IStream> m_pStream;\r\n    BaseEngine *m_engine;\r\n    // engines based on ImagesEngine require GDI+ to be preloaded\r\n    ScopedGdiPlus *m_gdiScope;\r\n    // state for IPreviewHandler\r\n    ScopedComPtr<IUnknown> m_site;\r\n    HWND        m_hwnd, m_hwndParent;\r\n    RectI       m_rcParent;\r\n    // for IExtractImage2\r\n    const WCHAR*m_clsid;\r\n    UINT        m_extractCx;\r\n    FILETIME    m_dateStamp;\r\n\r\n    virtual BaseEngine *LoadEngine(IStream *stream) = 0;\r\n};\r\n\r\nclass CPdfPreview : public PreviewBase {\r\npublic:\r\n    CPdfPreview(long *plRefCount) : PreviewBase(plRefCount, SZ_PDF_PREVIEW_CLSID) { }\r\n\r\nprotected:\r\n    virtual BaseEngine *LoadEngine(IStream *stream);\r\n};\r\n\r\n#ifdef BUILD_XPS_PREVIEW\r\nclass CXpsPreview : public PreviewBase {\r\npublic:\r\n    CXpsPreview(long *plRefCount) : PreviewBase(plRefCount, SZ_XPS_PREVIEW_CLSID) { }\r\n\r\nprotected:\r\n    virtual BaseEngine *LoadEngine(IStream *stream);\r\n};\r\n#endif\r\n\r\n#ifdef BUILD_DJVU_PREVIEW\r\nclass CDjVuPreview : public PreviewBase {\r\npublic:\r\n    CDjVuPreview(long *plRefCount) : PreviewBase(plRefCount, SZ_DJVU_PREVIEW_CLSID) {\r\n        m_gdiScope = new ScopedGdiPlus();\r\n    }\r\n\r\nprotected:\r\n    virtual BaseEngine *LoadEngine(IStream *stream);\r\n};\r\n#endif\r\n\r\n#ifdef BUILD_EPUB_PREVIEW\r\nclass CEpubPreview : public PreviewBase {\r\npublic:\r\n    CEpubPreview(long *plRefCount);\r\n    ~CEpubPreview();\r\n\r\nprotected:\r\n    virtual BaseEngine *LoadEngine(IStream *stream);\r\n};\r\n#endif\r\n\r\n#ifdef BUILD_FB2_PREVIEW\r\nclass CFb2Preview : public PreviewBase {\r\npublic:\r\n    CFb2Preview(long *plRefCount);\r\n    ~CFb2Preview();\r\n\r\nprotected:\r\n    virtual BaseEngine *LoadEngine(IStream *stream);\r\n};\r\n#endif\r\n\r\n#ifdef BUILD_MOBI_PREVIEW\r\nclass CMobiPreview : public PreviewBase {\r\npublic:\r\n    CMobiPreview(long *plRefCount);\r\n    ~CMobiPreview();\r\n\r\nprotected:\r\n    virtual BaseEngine *LoadEngine(IStream *stream);\r\n};\r\n#endif\r\n\r\n#if defined(BUILD_CBZ_PREVIEW) || defined(BUILD_CBR_PREVIEW) || defined(BUILD_CB7_PREVIEW) || defined(BUILD_CBT_PREVIEW)\r\nclass CCbxPreview : public PreviewBase {\r\npublic:\r\n    CCbxPreview(long *plRefCount) : PreviewBase(plRefCount, SZ_CBX_PREVIEW_CLSID) {\r\n        m_gdiScope = new ScopedGdiPlus();\r\n    }\r\n\r\nprotected:\r\n    virtual BaseEngine *LoadEngine(IStream *stream);\r\n};\r\n#endif\r\n\r\n#ifdef BUILD_TGA_PREVIEW\r\nclass CTgaPreview : public PreviewBase {\r\npublic:\r\n    CTgaPreview(long *plRefCount) : PreviewBase(plRefCount, SZ_TGA_PREVIEW_CLSID) {\r\n        m_gdiScope = new ScopedGdiPlus();\r\n    }\r\n\r\nprotected:\r\n    virtual BaseEngine *LoadEngine(IStream *stream);\r\n};\r\n#endif\r\n"
  },
  {
    "path": "src/previewer/PdfPreviewDll.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: GPLv3 */\n\n// utils\n#include \"BaseUtil.h\"\n#include \"FileUtil.h\"\n#include \"WinUtil.h\"\n// rendering engines\n#include \"BaseEngine.h\"\n// ui\n#include \"PdfPreview.h\"\n#include \"PdfPreviewBase.h\"\n\nlong g_lRefCount = 0;\n\nclass CClassFactory : public IClassFactory\n{\npublic:\n    CClassFactory(REFCLSID rclsid) : m_lRef(1), m_clsid(rclsid)\n    {\n        InterlockedIncrement(&g_lRefCount);\n    }\n\n    ~CClassFactory() { InterlockedDecrement(&g_lRefCount); }\n\n    // IUnknown\n    IFACEMETHODIMP QueryInterface(REFIID riid, void **ppv)\n    {\n        static const QITAB qit[] =\n        {\n            QITABENT(CClassFactory, IClassFactory),\n            { 0 }\n        };\n        return QISearch(this, qit, riid, ppv);\n    }\n\n    IFACEMETHODIMP_(ULONG) AddRef()\n    {\n        return InterlockedIncrement(&m_lRef);\n    }\n\n    IFACEMETHODIMP_(ULONG) Release()\n    {\n        long cRef = InterlockedDecrement(&m_lRef);\n        if (cRef == 0)\n            delete this;\n        return cRef;\n    }\n\n    // IClassFactory\n    IFACEMETHODIMP CreateInstance(IUnknown *punkOuter, REFIID riid, void **ppv)\n    {\n        *ppv = nullptr;\n        if (punkOuter)\n            return CLASS_E_NOAGGREGATION;\n\n        ScopedComPtr<IInitializeWithStream> pObject;\n\n        CLSID clsid;\n        if (SUCCEEDED(CLSIDFromString(SZ_PDF_PREVIEW_CLSID, &clsid)) && IsEqualCLSID(m_clsid, clsid))\n            pObject = new CPdfPreview(&g_lRefCount);\n#ifdef BUILD_XPS_PREVIEW\n        else if (SUCCEEDED(CLSIDFromString(SZ_XPS_PREVIEW_CLSID, &clsid)) && IsEqualCLSID(m_clsid, clsid))\n            pObject = new CXpsPreview(&g_lRefCount);\n#endif\n#ifdef BUILD_DJVU_PREVIEW\n        else if (SUCCEEDED(CLSIDFromString(SZ_DJVU_PREVIEW_CLSID, &clsid)) && IsEqualCLSID(m_clsid, clsid))\n            pObject = new CDjVuPreview(&g_lRefCount);\n#endif\n#ifdef BUILD_EPUB_PREVIEW\n        else if (SUCCEEDED(CLSIDFromString(SZ_EPUB_PREVIEW_CLSID, &clsid)) && IsEqualCLSID(m_clsid, clsid))\n            pObject = new CEpubPreview(&g_lRefCount);\n#endif\n#ifdef BUILD_FB2_PREVIEW\n        else if (SUCCEEDED(CLSIDFromString(SZ_FB2_PREVIEW_CLSID, &clsid)) && IsEqualCLSID(m_clsid, clsid))\n            pObject = new CFb2Preview(&g_lRefCount);\n#endif\n#ifdef BUILD_MOBI_PREVIEW\n        else if (SUCCEEDED(CLSIDFromString(SZ_MOBI_PREVIEW_CLSID, &clsid)) && IsEqualCLSID(m_clsid, clsid))\n            pObject = new CMobiPreview(&g_lRefCount);\n#endif\n#if defined(BUILD_CBZ_PREVIEW) || defined(BUILD_CBR_PREVIEW) || defined(BUILD_CB7_PREVIEW) || defined(BUILD_CBT_PREVIEW)\n        else if (SUCCEEDED(CLSIDFromString(SZ_CBX_PREVIEW_CLSID, &clsid)) && IsEqualCLSID(m_clsid, clsid))\n            pObject = new CCbxPreview(&g_lRefCount);\n#endif\n#ifdef BUILD_TGA_PREVIEW\n        else if (SUCCEEDED(CLSIDFromString(SZ_TGA_PREVIEW_CLSID, &clsid)) && IsEqualCLSID(m_clsid, clsid))\n            pObject = new CTgaPreview(&g_lRefCount);\n#endif\n        else\n            return E_NOINTERFACE;\n        if (!pObject)\n            return E_OUTOFMEMORY;\n\n        return pObject->QueryInterface(riid, ppv);\n    }\n\n    IFACEMETHODIMP LockServer(BOOL bLock)\n    {\n        if (bLock)\n            InterlockedIncrement(&g_lRefCount);\n        else\n            InterlockedDecrement(&g_lRefCount);\n        return S_OK;\n    }\n\nprivate:\n    long m_lRef;\n    CLSID m_clsid;\n};\n\nSTDAPI_(BOOL) DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)\n{\n    UNUSED(lpReserved);\n    if (dwReason == DLL_PROCESS_ATTACH) {\n        CrashIf(hInstance != GetInstance());\n    }\n\n    return TRUE;\n}\n\nSTDAPI DllCanUnloadNow(VOID)\n{\n    return g_lRefCount == 0 ? S_OK : S_FALSE;\n}\n\n// disable warning C6387 which is wrongly issued due to a compiler bug; cf.\n// http://connect.microsoft.com/VisualStudio/feedback/details/498862/c6387-warning-on-stock-dllgetclassobject-code-with-static-analyser\n#pragma warning(push)\n#pragma warning(disable: 6387) /* '*ppv' might be '0': this does not adhere to the specification for the function 'DllGetClassObject' */\n\nSTDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)\n{\n    *ppv = nullptr;\n    ScopedComPtr<CClassFactory> pClassFactory(new CClassFactory(rclsid));\n    if (!pClassFactory)\n        return E_OUTOFMEMORY;\n    return pClassFactory->QueryInterface(riid, ppv);\n}\n\n#pragma warning(pop)\n\n#define CLSID_I_THUMBNAIL_PROVIDER  L\"{e357fccd-a995-4576-b01f-234630154e96}\"\n#define CLSID_I_EXTRACT_IMAGE       L\"{bb2e617c-0920-11d1-9a0b-00c04fc2d6c1}\"\n#define CLSID_I_PREVIEW_HANDLER     L\"{8895b1c6-b41f-4c1c-a562-0d564250836f}\"\n#define APPID_PREVHOST_EXE          L\"{6d2b5079-2f0b-48dd-ab7f-97cec514d30b}\"\n#define APPID_PREVHOST_EXE_WOW64    L\"{534a1e02-d58f-44f0-b58b-36cbed287c7c}\"\n\n#define REG_KEY_PREVIEW_HANDLERS    L\"Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\PreviewHandlers\"\n\nstatic struct {\n    const WCHAR *clsid;\n    const WCHAR *ext, *ext2;\n    bool skip;\n} gPreviewers[] = {\n    { SZ_PDF_PREVIEW_CLSID, L\".pdf\" },\n#ifdef BUILD_XPS_PREVIEW\n    { SZ_XPS_PREVIEW_CLSID, L\".xps\", L\".oxps\" },\n#endif\n#ifdef BUILD_DJVU_PREVIEW\n    { SZ_DJVU_PREVIEW_CLSID,L\".djvu\" },\n#endif\n#ifdef BUILD_EPUB_PREVIEW\n    { SZ_EPUB_PREVIEW_CLSID,L\".epub\" },\n#endif\n#ifdef BUILD_FB2_PREVIEW\n    { SZ_FB2_PREVIEW_CLSID, L\".fb2\", L\".fb2z\" },\n#endif\n#ifdef BUILD_MOBI_PREVIEW\n    { SZ_MOBI_PREVIEW_CLSID,L\".mobi\" },\n#endif\n#ifdef BUILD_CBZ_PREVIEW\n    { SZ_CBX_PREVIEW_CLSID, L\".cbz\" },\n#endif\n#ifdef BUILD_CBR_PREVIEW\n    { SZ_CBX_PREVIEW_CLSID, L\".cbr\" },\n#endif\n#ifdef BUILD_CB7_PREVIEW\n    { SZ_CBX_PREVIEW_CLSID, L\".cb7\" },\n#endif\n#ifdef BUILD_CBT_PREVIEW\n    { SZ_CBX_PREVIEW_CLSID, L\".cbt\" },\n#endif\n#ifdef BUILD_TGA_PREVIEW\n    { SZ_TGA_PREVIEW_CLSID, L\".tga\" },\n#endif\n};\n\nSTDAPI DllRegisterServer()\n{\n    ScopedMem<WCHAR> dllPath(path::GetAppPath());\n    if (!dllPath)\n        return HRESULT_FROM_WIN32(GetLastError());\n\n#define WriteOrFail_(key, value, data) WriteRegStr(HKEY_LOCAL_MACHINE, key, value, data); \\\n    if (!WriteRegStr(HKEY_CURRENT_USER, key, value, data)) return E_FAIL\n\n    for (int i = 0; i < dimof(gPreviewers); i++) {\n        if (gPreviewers[i].skip)\n            continue;\n        ScopedMem<WCHAR> displayName(str::Format(L\"SumatraPDF Preview (*%s)\", gPreviewers[i].ext));\n        // register class\n        ScopedMem<WCHAR> key(str::Format(L\"Software\\\\Classes\\\\CLSID\\\\%s\", gPreviewers[i].clsid));\n        WriteOrFail_(key, nullptr, displayName);\n        WriteOrFail_(key, L\"AppId\", IsRunningInWow64() ? APPID_PREVHOST_EXE_WOW64 : APPID_PREVHOST_EXE);\n        WriteOrFail_(key, L\"DisplayName\", displayName);\n        key.Set(str::Format(L\"Software\\\\Classes\\\\CLSID\\\\%s\\\\InProcServer32\", gPreviewers[i].clsid));\n        WriteOrFail_(key, nullptr, dllPath);\n        WriteOrFail_(key, L\"ThreadingModel\", L\"Apartment\");\n        // IThumbnailProvider\n        key.Set(str::Format(L\"Software\\\\Classes\\\\%s\\\\shellex\\\\\" CLSID_I_THUMBNAIL_PROVIDER, gPreviewers[i].ext));\n        WriteOrFail_(key, nullptr, gPreviewers[i].clsid);\n        if (gPreviewers[i].ext2) {\n            key.Set(str::Format(L\"Software\\\\Classes\\\\%s\\\\shellex\\\\\" CLSID_I_THUMBNAIL_PROVIDER, gPreviewers[i].ext2));\n            WriteOrFail_(key, nullptr, gPreviewers[i].clsid);\n        }\n        // IExtractImage (for Windows XP)\n        if (!IsVistaOrGreater()) {\n            // don't register for IExtractImage on systems which accept IThumbnailProvider\n            // (because it doesn't offer anything beyond what IThumbnailProvider does)\n            key.Set(str::Format(L\"Software\\\\Classes\\\\%s\\\\shellex\\\\\" CLSID_I_EXTRACT_IMAGE, gPreviewers[i].ext));\n            WriteOrFail_(key, nullptr, gPreviewers[i].clsid);\n            if (gPreviewers[i].ext2) {\n                key.Set(str::Format(L\"Software\\\\Classes\\\\%s\\\\shellex\\\\\" CLSID_I_EXTRACT_IMAGE, gPreviewers[i].ext2));\n                WriteOrFail_(key, nullptr, gPreviewers[i].clsid);\n            }\n        }\n        // IPreviewHandler\n        key.Set(str::Format(L\"Software\\\\Classes\\\\%s\\\\shellex\\\\\" CLSID_I_PREVIEW_HANDLER, gPreviewers[i].ext));\n        WriteOrFail_(key, nullptr, gPreviewers[i].clsid);\n        if (gPreviewers[i].ext2) {\n            key.Set(str::Format(L\"Software\\\\Classes\\\\%s\\\\shellex\\\\\" CLSID_I_PREVIEW_HANDLER, gPreviewers[i].ext2));\n            WriteOrFail_(key, nullptr, gPreviewers[i].clsid);\n        }\n        WriteOrFail_(REG_KEY_PREVIEW_HANDLERS, gPreviewers[i].clsid, displayName);\n\n    }\n#undef WriteOrFail_\n\n    return S_OK;\n}\n\nSTDAPI DllUnregisterServer()\n{\n    HRESULT hr = S_OK;\n\n#define DeleteOrFail_(key) DeleteRegKey(HKEY_LOCAL_MACHINE, key); \\\n    if (!DeleteRegKey(HKEY_CURRENT_USER, key)) hr = E_FAIL\n\n    for (int i = 0; i < dimof(gPreviewers); i++) {\n        if (gPreviewers[i].skip)\n            continue;\n        // unregister preview handler\n        SHDeleteValue(HKEY_LOCAL_MACHINE, REG_KEY_PREVIEW_HANDLERS, gPreviewers[i].clsid);\n        SHDeleteValue(HKEY_CURRENT_USER, REG_KEY_PREVIEW_HANDLERS, gPreviewers[i].clsid);\n        // remove class data\n        ScopedMem<WCHAR> key(str::Format(L\"Software\\\\Classes\\\\CLSID\\\\%s\", gPreviewers[i].clsid));\n        DeleteOrFail_(key);\n        // IThumbnailProvider\n        key.Set(str::Format(L\"Software\\\\Classes\\\\%s\\\\shellex\\\\\" CLSID_I_THUMBNAIL_PROVIDER, gPreviewers[i].ext));\n        DeleteOrFail_(key);\n        if (gPreviewers[i].ext2) {\n            key.Set(str::Format(L\"Software\\\\Classes\\\\%s\\\\shellex\\\\\" CLSID_I_THUMBNAIL_PROVIDER, gPreviewers[i].ext2));\n            DeleteOrFail_(key);\n        }\n        // IExtractImage (for Windows XP)\n        key.Set(str::Format(L\"Software\\\\Classes\\\\%s\\\\shellex\\\\\" CLSID_I_EXTRACT_IMAGE, gPreviewers[i].ext));\n        DeleteOrFail_(key);\n        if (gPreviewers[i].ext2) {\n            key.Set(str::Format(L\"Software\\\\Classes\\\\%s\\\\shellex\\\\\" CLSID_I_EXTRACT_IMAGE, gPreviewers[i].ext2));\n            DeleteOrFail_(key);\n        }\n        // IPreviewHandler\n        key.Set(str::Format(L\"Software\\\\Classes\\\\%s\\\\shellex\\\\\" CLSID_I_PREVIEW_HANDLER, gPreviewers[i].ext));\n        DeleteOrFail_(key);\n        if (gPreviewers[i].ext2) {\n            key.Set(str::Format(L\"Software\\\\Classes\\\\%s\\\\shellex\\\\\" CLSID_I_PREVIEW_HANDLER, gPreviewers[i].ext2));\n            DeleteOrFail_(key);\n        }\n    }\n#undef DeleteOrFail_\n\n    return hr;\n}\n\nSTDAPI DllInstall(BOOL bInstall, LPCWSTR pszCmdLine)\n{\n    // allows installing only a subset of available preview handlers\n    if (str::StartsWithI(pszCmdLine, L\"exts:\")) {\n        ScopedMem<WCHAR> extsList(str::Dup(pszCmdLine + 5));\n        str::ToLowerInPlace(extsList);\n        str::TransChars(extsList, L\";. :\", L\",,,\\0\");\n        WStrVec exts;\n        exts.Split(extsList, L\",\", true);\n        for (int i = 0; i < dimof(gPreviewers); i++) {\n            gPreviewers[i].skip = !exts.Contains(gPreviewers[i].ext + 1);\n        }\n    }\n\n    if (!bInstall)\n        return DllUnregisterServer();\n    return DllRegisterServer();\n}\n\n#ifdef _WIN64\n#pragma comment(linker, \"/EXPORT:DllCanUnloadNow=DllCanUnloadNow,PRIVATE\")\n#pragma comment(linker, \"/EXPORT:DllGetClassObject=DllGetClassObject,PRIVATE\")\n#pragma comment(linker, \"/EXPORT:DllRegisterServer=DllRegisterServer,PRIVATE\")\n#pragma comment(linker, \"/EXPORT:DllUnregisterServer=DllUnregisterServer,PRIVATE\")\n#pragma comment(linker, \"/EXPORT:DllInstall=DllInstall,PRIVATE\")\n#else\n#pragma comment(linker, \"/EXPORT:DllCanUnloadNow=_DllCanUnloadNow@0,PRIVATE\")\n#pragma comment(linker, \"/EXPORT:DllGetClassObject=_DllGetClassObject@12,PRIVATE\")\n#pragma comment(linker, \"/EXPORT:DllRegisterServer=_DllRegisterServer@0,PRIVATE\")\n#pragma comment(linker, \"/EXPORT:DllUnregisterServer=_DllUnregisterServer@0,PRIVATE\")\n#pragma comment(linker, \"/EXPORT:DllInstall=_DllInstall@8,PRIVATE\")\n#endif\n"
  },
  {
    "path": "src/regress/Regress.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n/*\r\nA regression test suite. The idea is to add tests for bugs we fix that\r\nare too time consuming to be part of unit tests. The tests can rely\r\non presence of shared test files.\r\n\r\nNote: because it can be run as both release and debug, we can't use\r\nassert() or CrashIf() but CrashAlwaysIf().\r\n\r\nTo write new regression test:\r\n- add a file src/regress/Regress${NN}.cpp with Regress${NN} function\r\n- #include \"Regress${NN}.cpp\" right before RunTest() function\r\n- call Regress${NN} function from RunTests()\r\n*/\r\n\r\n// utils\r\n#include \"BaseUtil.h\"\r\n#include \"WinDynCalls.h\"\r\n#include \"ArchUtil.h\"\r\n#include \"DbgHelpDyn.h\"\r\n#include \"DirIter.h\"\r\n#include \"FileUtil.h\"\r\n#include \"GdiPlusUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"Mui.h\"\r\n#include \"WinUtil.h\"\r\n// rendering engines\r\n#include \"BaseEngine.h\"\r\n#include \"EbookBase.h\"\r\n#include \"EbookDoc.h\"\r\n#include \"HtmlFormatter.h\"\r\n#include \"EbookFormatter.h\"\r\n#include \"Doc.h\"\r\n\r\nstatic WCHAR *gTestFilesDir;\r\n\r\nstatic WCHAR *TestFilesDir()\r\n{\r\n    return gTestFilesDir;\r\n}\r\n\r\nstatic int Usage()\r\n{\r\n    printf(\"regress.exe\\n\");\r\n    printf(\"Error: didn't find test files on this computer!\\n\");\r\n    system(\"pause\");\r\n    return 1;\r\n}\r\n\r\nstatic void printflush(const char *s)\r\n{\r\n    printf(s);\r\n    fflush(stdout);\r\n}\r\n\r\n/* Auto-detect the location of test files. Ultimately we might add a cmd-line\r\noption to specify this directory, for now just add your location(s) to the list */\r\nstatic bool FindTestFilesDir()\r\n{\r\n    WCHAR *dirsToCheck[] = {\r\n        L\"C:\\\\Documents and Settings\\\\kkowalczyk\\\\My Documents\\\\Google Drive\\\\Sumatra\",\r\n        L\"C:\\\\Users\\\\kkowalczyk\\\\Google Drive\\\\Sumatra\"\r\n    };\r\n    for (size_t i = 0; i < dimof(dirsToCheck); i++) {\r\n        WCHAR *dir = dirsToCheck[i];\r\n        if (dir::Exists(dir)) {\r\n            gTestFilesDir = dir;\r\n            return true;\r\n        }\r\n    }\r\n    return false;\r\n}\r\n\r\nstatic void VerifyFileExists(const WCHAR *filePath)\r\n{\r\n    if (!file::Exists(filePath)) {\r\n        wprintf(L\"File '%s' doesn't exist!\\n\", filePath);\r\n        system(\"pause\");\r\n        exit(1);\r\n    }\r\n}\r\n\r\nstatic HANDLE   gDumpEvent = nullptr;\r\nstatic HANDLE   gDumpThread = nullptr;\r\nstatic bool     gCrashed = false;\r\n\r\nstatic MINIDUMP_EXCEPTION_INFORMATION gMei = { 0 };\r\nstatic LPTOP_LEVEL_EXCEPTION_FILTER gPrevExceptionFilter = nullptr;\r\n\r\nstatic DWORD WINAPI CrashDumpThread(LPVOID data)\r\n{\r\n    UNUSED(data);\r\n    WaitForSingleObject(gDumpEvent, INFINITE);\r\n    if (!gCrashed)\r\n        return 0;\r\n\r\n    printflush(\"Captain, we've got a crash!\\n\");\r\n    if (!dbghelp::Initialize(L\"\", false)) {\r\n        printflush(\"CrashDumpThread(): dbghelp::Initialize() failed\");\r\n        return 0;\r\n    }\r\n\r\n    if (!dbghelp::HasSymbols()) {\r\n        printflush(\"CrashDumpThread(): dbghelp::HasSymbols() is false\");\r\n        return 0;\r\n    }\r\n\r\n    str::Str<char> s(16 * 1024);\r\n    dbghelp::GetExceptionInfo(s, gMei.ExceptionPointers);\r\n    dbghelp::GetAllThreadsCallstacks(s);\r\n    s.Append(\"\\r\\n\");\r\n    printflush(s.LendData());\r\n    return 0;\r\n}\r\n\r\nstatic LONG WINAPI DumpExceptionHandler(EXCEPTION_POINTERS *exceptionInfo)\r\n{\r\n    if (!exceptionInfo || (EXCEPTION_BREAKPOINT == exceptionInfo->ExceptionRecord->ExceptionCode))\r\n        return EXCEPTION_CONTINUE_SEARCH;\r\n\r\n    static bool wasHere = false;\r\n    if (wasHere)\r\n        return EXCEPTION_CONTINUE_SEARCH;\r\n    wasHere = true;\r\n    gCrashed = true;\r\n\r\n    gMei.ThreadId = GetCurrentThreadId();\r\n    gMei.ExceptionPointers = exceptionInfo;\r\n    // per msdn (which is backed by my experience), MiniDumpWriteDump() doesn't\r\n    // write callstack for the calling thread correctly. We use msdn-recommended\r\n    // work-around of spinning a thread to do the writing\r\n    SetEvent(gDumpEvent);\r\n    WaitForSingleObject(gDumpThread, INFINITE);\r\n\r\n    TerminateProcess(GetCurrentProcess(), 1);\r\n    return EXCEPTION_CONTINUE_SEARCH;\r\n}\r\n\r\nstatic void InstallCrashHandler()\r\n{\r\n    gDumpEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);\r\n    if (!gDumpEvent) {\r\n        printflush(\"InstallCrashHandler(): CreateEvent() failed\\n\");\r\n        return;\r\n    }\r\n    gDumpThread = CreateThread(nullptr, 0, CrashDumpThread, nullptr, 0, 0);\r\n    if (!gDumpThread) {\r\n        printflush(\"InstallCrashHandler(): CreateThread() failed\\n\");\r\n        return;\r\n    }\r\n    gPrevExceptionFilter = SetUnhandledExceptionFilter(DumpExceptionHandler);\r\n}\r\n\r\nstatic void UninstallCrashHandler()\r\n{\r\n    if (!gDumpEvent || !gDumpThread)\r\n        return;\r\n\r\n    if (gPrevExceptionFilter)\r\n        SetUnhandledExceptionFilter(gPrevExceptionFilter);\r\n\r\n    SetEvent(gDumpEvent);\r\n    WaitForSingleObject(gDumpThread, 1000); // 1 sec\r\n\r\n    SafeCloseHandle(&gDumpThread);\r\n    SafeCloseHandle(&gDumpEvent);\r\n}\r\n\r\n#include \"Regress00.cpp\"\r\n\r\nstatic void RunTests()\r\n{\r\n    Regress00();\r\n    Regress01();\r\n    Regress02();\r\n}\r\n\r\nint RegressMain()\r\n{\r\n    RedirectIOToConsole();\r\n\r\n    if (!FindTestFilesDir()) {\r\n        return Usage();\r\n    }\r\n\r\n    InstallCrashHandler();\r\n    InitAllCommonControls();\r\n    ScopedGdiPlus gdi;\r\n    mui::Initialize();\r\n\r\n    RunTests();\r\n\r\n    printflush(\"All tests completed successfully!\\n\");\r\n    mui::Destroy();\r\n    UninstallCrashHandler();\r\n\r\n    system(\"pause\");\r\n    return 0;\r\n}\r\n"
  },
  {
    "path": "src/regress/Regress00.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// must be #included from Regress.cpp\r\n\r\n// test that a given epub file loads correctly. crash otherwise\r\nstatic void RegressTestEpubLoading(const WCHAR *fileName)\r\n{\r\n    WCHAR *filePath = path::Join(TestFilesDir(), fileName);\r\n    VerifyFileExists(filePath);\r\n    CrashAlwaysIf(!EpubDoc::IsSupportedFile(filePath));\r\n    EpubDoc *doc = EpubDoc::CreateFromFile(filePath);\r\n    CrashAlwaysIf(!doc);\r\n    delete doc;\r\n}\r\n\r\n// http://code.google.com/p/sumatrapdf/issues/detail?id=2102\r\nstatic void Regress02()\r\n{\r\n    RegressTestEpubLoading(L\"epub\\\\sumatra-crash-nov-23-2012.epub\");\r\n}\r\n\r\n// http://code.google.com/p/sumatrapdf/issues/detail?id=2091\r\nstatic void Regress01()\r\n{\r\n    RegressTestEpubLoading(L\"epub\\\\sumatra-crash-nov-12-2012.epub\");\r\n}\r\n\r\n// http://code.google.com/p/sumatrapdf/issues/detail?id=1926\r\nstatic void Regress00()\r\n{\r\n    WCHAR *filePath = path::Join(TestFilesDir(), L\"epub\\\\widget-figure-gallery-20120405.epub\");\r\n    VerifyFileExists(filePath);\r\n    CrashAlwaysIf(!EpubDoc::IsSupportedFile(filePath));\r\n    EpubDoc *doc = EpubDoc::CreateFromFile(filePath);\r\n    CrashAlwaysIf(!doc);\r\n\r\n    PoolAllocator textAllocator;\r\n    HtmlFormatterArgs *args = CreateFormatterDefaultArgs(820, 920, &textAllocator);\r\n    args->htmlStr = doc->GetHtmlData(&args->htmlStrLen);\r\n    HtmlPage *pages[3];\r\n    HtmlFormatter *formatter = new EpubFormatter(args, doc);\r\n    int page = 0;\r\n    for (HtmlPage *pd = formatter->Next(); pd; pd = formatter->Next()) {\r\n        pages[page++] = pd;\r\n        if (page == dimof(pages))\r\n            break;\r\n    }\r\n    delete formatter;\r\n    delete args;\r\n    CrashAlwaysIf(page != 3);\r\n\r\n    args = CreateFormatterDefaultArgs(820, 920, &textAllocator);\r\n    args->htmlStr = doc->GetHtmlData(&args->htmlStrLen);\r\n    args->reparseIdx = pages[2]->reparseIdx;\r\n    formatter = new EpubFormatter(args, doc);\r\n    // if bug is present, this will crash in formatter->Next()\r\n    for (HtmlPage *pd = formatter->Next(); pd; pd = formatter->Next()) {\r\n        delete pd;\r\n    }\r\n    delete formatter;\r\n    delete args;\r\n    delete doc;\r\n}\r\n"
  },
  {
    "path": "src/resource.h",
    "content": "//{{NO_DEPENDENCIES}}\n// Microsoft Visual C++ generated include file.\n// Used by SumatraPDF.rc\n//\n#define IDI_SUMATRAPDF                  1\n#define IDI_PDFDOC                      2\n#define IDD_DIALOG_GOTO_PAGE            129\n#define IDD_DIALOG_GET_PASSWORD         130\n#define IDD_DIALOG_PDF_ASSOCIATE        131\n#define IDC_CURSORDRAG                  132\n#define IDD_DIALOG_CHANGE_LANGUAGE      134\n#define IDD_DIALOG_NEW_VERSION          135\n#define IDD_DIALOG_SETTINGS             136\n#define IDD_DIALOG_FIND                 137\n#define IDD_DIALOG_CUSTOM_ZOOM          138\n#define IDD_PROPSHEET_PRINT_ADVANCED    139\n#define IDD_DIALOG_FAV_ADD              140\n#define IDM_OPEN                        400\n#define IDM_CLOSE                       401\n#define IDM_SAVEAS                      402\n#define IDM_PRINT                       403\n#define IDM_EXIT                        405\n#define IDM_REFRESH                     406\n#define IDM_SAVEAS_BOOKMARK             407\n#define IDM_SEND_BY_EMAIL               408\n#define IDM_PROPERTIES                  409\n#define IDM_VIEW_SINGLE_PAGE            410\n#define IDM_VIEW_FACING                 411\n#define IDM_VIEW_BOOK                   412\n#define IDM_VIEW_CONTINUOUS             413\n#define IDM_VIEW_MANGA_MODE             414\n#define IDM_VIEW_ROTATE_LEFT            415\n#define IDM_VIEW_ROTATE_RIGHT           416\n#define IDM_VIEW_BOOKMARKS              417\n#define IDM_VIEW_PRESENTATION_MODE      418\n#define IDM_VIEW_SHOW_HIDE_TOOLBAR      419\n#define IDM_COPY_SELECTION              420\n#define IDM_VIEW_FULLSCREEN             421\n#define IDM_SELECT_ALL                  422\n#define IDM_VIEW_SHOW_HIDE_MENUBAR      423\n#define IDM_COPY_IMAGE                  427\n#define IDM_COPY_LINK_TARGET            428\n#define IDM_COPY_COMMENT                429\n#define IDM_GOTO_NEXT_PAGE              430\n#define IDM_GOTO_PREV_PAGE              431\n#define IDM_GOTO_FIRST_PAGE             432\n#define IDM_GOTO_LAST_PAGE              433\n#define IDM_GOTO_PAGE                   434\n#define IDM_FIND_FIRST                  435\n#define IDM_FIND_NEXT                   436\n#define IDM_FIND_PREV                   437\n#define IDM_FIND_MATCH                  438\n#define IDM_ZOOM_FIT_PAGE               440\n#define IDM_ZOOM_ACTUAL_SIZE            441\n#define IDM_ZOOM_FIT_WIDTH              442\n#define IDM_ZOOM_6400                   443\n#define IDM_ZOOM_3200                   444\n#define IDM_ZOOM_1600                   445\n#define IDM_ZOOM_800                    446\n#define IDM_ZOOM_400                    447\n#define IDM_ZOOM_200                    448\n#define IDM_ZOOM_150                    449\n#define IDM_ZOOM_125                    450\n#define IDM_ZOOM_100                    451\n#define IDM_ZOOM_50                     452\n#define IDM_ZOOM_25                     453\n#define IDM_ZOOM_12_5                   454\n#define IDM_ZOOM_8_33                   455\n#define IDM_ZOOM_FIT_CONTENT            456\n#define IDM_ZOOM_CUSTOM                 457\n#define IDM_CONTRIBUTE_TRANSLATION      460\n#define IDM_VIEW_WITH_ACROBAT           470\n#define IDM_VIEW_WITH_FOXIT             471\n#define IDM_VIEW_WITH_PDF_XCHANGE       472\n#define IDM_VIEW_WITH_XPS_VIEWER        473\n#define IDM_VIEW_WITH_HTML_HELP         474\n#define IDM_OPEN_SELECTED_DOCUMENT      480\n#define IDM_PIN_SELECTED_DOCUMENT       481\n#define IDM_FORGET_SELECTED_DOCUMENT    482\n#define IDM_OPEN_WITH_EXTERNAL_FIRST    500\n#define IDM_OPEN_WITH_EXTERNAL_LAST     509\n#define IDM_FILE_HISTORY_FIRST          510\n#define IDM_FILE_HISTORY_LAST           519\n#define IDM_VISIT_WEBSITE               550\n#define IDM_ABOUT                       551\n#define IDM_OPTIONS                     552\n#define IDM_CHANGE_LANGUAGE             553\n#define IDM_CHECK_UPDATE                554\n#define IDM_MANUAL                      555\n#define IDM_MOVE_FRAME_FOCUS            557\n#define IDM_GOTO_NAV_BACK               558\n#define IDM_GOTO_NAV_FORWARD            559\n#define IDM_FAV_ADD                     560\n#define IDM_FAV_DEL                     561\n#define IDM_FAV_TOGGLE                  562\n#define IDM_RENAME_FILE                 580\n#define IDM_FIND_NEXT_SEL               581\n#define IDM_FIND_PREV_SEL               582\n#define IDM_DEBUG_SHOW_LINKS            590\n#define IDM_DEBUG_CRASH_ME              592\n#define IDM_LOAD_MOBI_SAMPLE            593\n#define IDM_DEBUG_EBOOK_UI              594\n#define IDM_DEBUG_MUI                   595\n#define IDM_DEBUG_ANNOTATION            596\n#define IDM_ADVANCED_OPTIONS            597\n#define IDM_FAV_FIRST                   600\n#define IDM_FAV_LAST                    800\n#define IDC_GOTO_PAGE_EDIT              1000\n#define IDC_GOTO_PAGE_GO                1001\n#define IDC_BUTTON2                     1002\n#define IDC_GOTOPAGE_CANCEL             1003\n#define IDC_GOTO_PAGE_CANCEL            1004\n#define IDC_GOTO_PAGE_LABEL_OF          1005\n#define IDC_DIALOG_GET_PASSWORD_EDIT    1006\n#define IDC_GET_PASSWORD_EDIT           1007\n#define IDC_GET_PASSWORD_LABEL          1008\n#define IDC_REMEMBER_PASSWORD           1009\n#define IDC_TOOLBAR                     1010\n#define IDC_REBAR                       1011\n#define IDC_EDIT1                       1012\n#define IDC_FAV_NAME_EDIT               1013\n#define IDC_DONT_ASK_ME_AGAIN           1014\n#define IDC_ADD_PAGE_STATIC             1015\n#define IDC_CHANGE_LANG_LANG_LIST       1017\n#define IDC_YOU_HAVE                    1018\n#define IDC_NEW_AVAILABLE               1019\n#define IDC_SKIP_THIS_VERSION           1020\n#define IDC_SECTION_VIEW                1021\n#define IDC_DEFAULT_LAYOUT_LABEL        1022\n#define IDC_DEFAULT_LAYOUT              1023\n#define IDC_DEFAULT_ZOOM_LABEL          1024\n#define IDC_DEFAULT_ZOOM                1025\n#define IDC_DEFAULT_SHOW_TOC            1026\n#define IDC_REMEMBER_STATE_PER_DOCUMENT 1027\n#define IDC_SECTION_ADVANCED            1028\n#define IDC_CHECK_FOR_UPDATES           1029\n#define IDC_SET_DEFAULT_READER          1030\n#define IDC_REMEMBER_OPENED_FILES       1031\n#define IDC_FIND_EDIT                   1032\n#define IDC_MATCH_CASE                  1033\n#define IDC_FIND_NEXT_HINT              1034\n#define IDC_SECTION_INVERSESEARCH       1040\n#define IDC_CMDLINE_LABEL               1041\n#define IDC_CMDLINE                     1042\n#define IDC_USE_TABS                    1045\n#define IDC_SECTION_PRINT_RANGE         1050\n#define IDC_PRINT_RANGE_ALL             1051\n#define IDC_PRINT_RANGE_EVEN            1052\n#define IDC_PRINT_RANGE_ODD             1053\n#define IDC_SECTION_PRINT_SCALE         1060\n#define IDC_PRINT_SCALE_SHRINK          1061\n#define IDC_PRINT_SCALE_FIT             1062\n#define IDC_PRINT_SCALE_NONE            1063\n#define IDC_SECTION_PRINT_COMPATIBILITY 1070\n#define IDC_TOC_BOX                     1100\n#define IDC_TOC_LABEL_WITH_CLOSE        1101\n#define IDC_TOC_TREE                    1102\n#define IDC_FAV_BOX                     1105\n#define IDC_FAV_LABEL_WITH_CLOSE        1106\n#define IDC_FAV_TREE                    1107\n#define IDC_TABBAR                      1110\n#define IDB_TOOLBAR                     2000\n#define IDB_RELOADING_CUE               2010\n// TODO: which of these are (still) needed?\n#define IDT_FILE_NEW                    3000\n#define IDT_FILE_OPEN                   3001\n#define IDT_FILE_METAPATH               3002\n#define IDT_FILE_SAVE                   3003\n#define IDT_EDIT_UNDO                   3004\n#define IDT_EDIT_REDO                   3005\n#define IDT_EDIT_CUT                    3006\n#define IDT_EDIT_COPY                   3007\n#define IDT_EDIT_PASTE                  3008\n#define IDT_EDIT_FIND                   3009\n#define IDT_EDIT_REPLACE                3010\n#define IDT_VIEW_WORDWRAP               3011\n#define IDT_VIEW_ZOOMIN                 3012\n#define IDT_VIEW_ZOOMOUT                3013\n#define IDT_VIEW_SCHEME                 3014\n#define IDT_VIEW_SCHEMECONFIG           3015\n#define IDT_FILE_EXIT                   3016\n#define IDT_FILE_SAVEAS                 3017\n#define IDT_FILE_SAVECOPY               3018\n#define IDT_EDIT_COPYALL                3019\n#define IDT_EDIT_CLEAR                  3020\n#define IDT_EDIT_FINDNEXT               3021\n#define IDT_EDIT_FINDPREV               3022\n#define IDT_FILE_PRINT                  3023\n#define IDT_FILE_OPENFAV                3024\n#define IDT_FILE_ADDTOFAV               3025\n#define IDT_VIEW_FIT_WIDTH              3026\n#define IDT_VIEW_FIT_PAGE               3027\n#define IDD_EBOOK_WIN_DESC              3051\n#define IDD_PUBLIC_APP_KEY              3060\n#define IDC_SUMATRAPDF                  4000\n#define IDC_STATIC                      -1\n\n// Next default values for new objects\n//\n#ifdef APSTUDIO_INVOKED\n#ifndef APSTUDIO_READONLY_SYMBOLS\n#define _APS_NO_MFC                     1\n#define _APS_NEXT_RESOURCE_VALUE        141\n#define _APS_NEXT_COMMAND_VALUE         32771\n#define _APS_NEXT_CONTROL_VALUE         1080\n#define _APS_NEXT_SYMED_VALUE           110\n#endif\n#endif\n"
  },
  {
    "path": "src/sample_mobi.html",
    "content": "<html><p align=justify width=1em><b>ClearType</b>, is <b>dependent</b> \r\non the <i>orientation &amp; ordering</i> of the LCD stripes and \r\npossibly some other <i><b>things</b> unknown</i>.</p> \r\n<p align='right height=13pt'><em>Currently</em>, ClearType is implemented \r\n<hr><br/> only for vertical stripes that are ordered RGB.</p> \r\n<p align=center height=8pt>This might be a concern if you are using a \r\n<a href='http://en.wikipedia.org/wiki/Tablet_pc'>tablet PC</a>.</p>\r\n<p width='1em'>Where the display can be oriented in any direction, or if you\r\nare using a screen that can be turned from landscape to portrait. The \r\n<strike>following example</strike> draws text with two <u>different quality</u> \r\nsettings.</p> \r\n<h2>Intermediary heading</h2>\r\n<p width=1em>This is a paragraph that should take at least two lines. \r\nWith study and discreet inquiries, Abagnale picked up airline jargon \r\nand discovered that pilots could ride free anywhere in the world on any \r\nairline; and that hotels billed airlines direct and cashed checks issued \r\nby airline companies.</p><br><p width=1em>    And this is another paragraph \r\ntha we wrote today. Hiding out in a southern city, Abagnale learned that the \r\nstate attorney general was seeking assistants. For nine months he practiced law, \r\nbut when a real Harvard lawyer appeared on the scene, Abagnale figured it was \r\ntime to move on.</p> \r\nOn to the <b>next<mbp:pagebreak>page</b>\r\n<p>ThisIsAVeryVeryVeryLongWordThatShouldBeBrokenIntoMultiple lines</p>\r\n<h3>List</h3><ul><li>First item</li><li>Nested: \r\n<ol><li>Number one</li><li>Two</li></ol></li></ul>\r\n<ul><ul><ul><ul><ul><ul><ul><ul><ul><ul><ul><ul><ul><ul><ul>\r\n<li>VeryVeryVeryVeryDeeplyNestedListItem</li>\r\n</ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul></ul>\r\n<mbp:pagebreak><hr><mbp:pagebreak>blah<br>Foodo.<p>And me</p></html>\r\n"
  },
  {
    "path": "src/tools/MakeLzSA.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// MakeLzSA creates LzSA archives as described in utils/LzmaSimpleArchive.cpp\r\n// Such archives use LZMA compression with an x86 bytecode filter which produces\r\n// best results for installer payloads. See ../makefile.msvc for a use case.\r\n\r\n#define __STDC_LIMIT_MACROS\r\n#include \"BaseUtil.h\"\r\n#include <LzmaEnc.h>\r\n#include <Bra.h>\r\n#include <zlib.h> // for crc32\r\n#include \"ByteWriter.h\"\r\n#include \"CmdLineParser.h\"\r\n#include \"FileUtil.h\"\r\n#include \"LzmaSimpleArchive.h\"\r\n\r\nnamespace lzsa {\r\n\r\nstruct ISzCrtAlloc : ISzAlloc {\r\n    static void *_Alloc(void *p, size_t size) { UNUSED(p);  return malloc(size); }\r\n    static void _Free(void *p, void *ptr) { UNUSED(p); free(ptr); }\r\n\r\n    ISzCrtAlloc() { this->Alloc = _Alloc; this->Free = _Free; }\r\n};\r\n\r\n#define LZMA_MAGIC_ID 0x41537a4c\r\n#define LZMA_HEADER_SIZE (1 + LZMA_PROPS_SIZE)\r\n\r\nstatic bool Compress(const char *uncompressed, size_t uncompressedSize, char *compressed, size_t *compressedSize)\r\n{\r\n    CrashIf(*compressedSize < uncompressedSize + 1);\r\n    if (*compressedSize < uncompressedSize + 1)\r\n        return false;\r\n\r\n    size_t lzma_size = (size_t)-1;\r\n\r\n    if (*compressedSize >= LZMA_HEADER_SIZE) {\r\n        ISzCrtAlloc lzmaAlloc;\r\n        CLzmaEncProps props;\r\n        LzmaEncProps_Init(&props);\r\n\r\n        // always apply the BCJ filter for speed (else two or three compression passes would be required)\r\n        ScopedMem<uint8_t> bcj_enc(AllocArray<uint8_t>(uncompressedSize));\r\n        if (bcj_enc) {\r\n            memcpy(bcj_enc, uncompressed, uncompressedSize);\r\n            UInt32 x86State;\r\n            x86_Convert_Init(x86State);\r\n            x86_Convert(bcj_enc, uncompressedSize, 0, &x86State, 1);\r\n        }\r\n        compressed[0] = bcj_enc ? 1 : 0;\r\n\r\n        SizeT outSize = *compressedSize - LZMA_HEADER_SIZE;\r\n        SizeT propsSize = LZMA_PROPS_SIZE;\r\n        SRes res = LzmaEncode((Byte *)compressed + LZMA_HEADER_SIZE, &outSize,\r\n                              bcj_enc ? bcj_enc : (const Byte *)uncompressed, uncompressedSize,\r\n                              &props, (Byte *)compressed + 1, &propsSize,\r\n                              TRUE /* add EOS marker */, nullptr, &lzmaAlloc, &lzmaAlloc);\r\n        if (SZ_OK == res && propsSize == LZMA_PROPS_SIZE)\r\n            lzma_size = outSize + LZMA_HEADER_SIZE;\r\n    }\r\n\r\n    if (lzma_size <= uncompressedSize) {\r\n        *compressedSize = lzma_size;\r\n    }\r\n    else {\r\n        compressed[0] = (uint8_t)-1;\r\n        memcpy(compressed + 1, uncompressed, uncompressedSize);\r\n        *compressedSize = uncompressedSize + 1;\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nstatic bool AppendEntry(str::Str<char>& data, str::Str<char>& content, const WCHAR *filePath, const char *inArchiveName, lzma::FileInfo *fi=nullptr)\r\n{\r\n    size_t nameLen = str::Len(inArchiveName);\r\n    CrashIf(nameLen > UINT32_MAX - 25);\r\n    uint32_t headerSize = 25 + (uint32_t)nameLen;\r\n    FILETIME ft = file::GetModificationTime(filePath);\r\n    if (fi && FileTimeEq(ft, fi->ftModified)) {\r\nReusePrevious:\r\n        ByteWriterLE meta(data.AppendBlanks(24), 24);\r\n        meta.Write32(headerSize);\r\n        meta.Write32(fi->compressedSize);\r\n        meta.Write32(fi->uncompressedSize);\r\n        meta.Write32(fi->uncompressedCrc32);\r\n        meta.Write32(ft.dwLowDateTime);\r\n        meta.Write32(ft.dwHighDateTime);\r\n        data.Append(inArchiveName, nameLen + 1);\r\n        return content.AppendChecked(fi->compressedData, fi->compressedSize);\r\n    }\r\n\r\n    size_t fileDataLen;\r\n    ScopedMem<char> fileData(file::ReadAll(filePath, &fileDataLen));\r\n    if (!fileData || fileDataLen >= UINT32_MAX) {\r\n        fprintf(stderr, \"Failed to read \\\"%S\\\" for compression\\n\", filePath);\r\n        return false;\r\n    }\r\n    uint32_t fileDataCrc = crc32(0, (const uint8_t *)fileData.Get(), (uint32_t)fileDataLen);\r\n    if (fi && fi->uncompressedCrc32 == fileDataCrc && fi->uncompressedSize == fileDataLen)\r\n        goto ReusePrevious;\r\n\r\n    size_t compressedSize = fileDataLen + 1;\r\n    ScopedMem<char> compressed((char *)malloc(compressedSize));\r\n    if (!compressed)\r\n        return false;\r\n    if (!Compress(fileData, fileDataLen, compressed, &compressedSize))\r\n        return false;\r\n\r\n    ByteWriterLE meta(data.AppendBlanks(24), 24);\r\n    meta.Write32(headerSize);\r\n    meta.Write32((uint32_t)compressedSize);\r\n    meta.Write32((uint32_t)fileDataLen);\r\n    meta.Write32(fileDataCrc);\r\n    meta.Write32(ft.dwLowDateTime);\r\n    meta.Write32(ft.dwHighDateTime);\r\n    data.Append(inArchiveName, nameLen + 1);\r\n    return content.AppendChecked(compressed, compressedSize);\r\n}\r\n\r\n// creates an archive from files (starting at index skipFiles);\r\n// file paths may be relative to the current directory or absolute and\r\n// may end in a colon followed by the desired path in the archive\r\n// (this is required for absolute paths)\r\nbool CreateArchive(const WCHAR *archivePath, WStrVec& files, size_t skipFiles=0)\r\n{\r\n    size_t prevDataLen = 0;\r\n    ScopedMem<char> prevData(file::ReadAll(archivePath, &prevDataLen));\r\n    lzma::SimpleArchive prevArchive;\r\n    if (!lzma::ParseSimpleArchive(prevData, prevDataLen, &prevArchive))\r\n        prevArchive.filesCount = 0;\r\n\r\n    str::Str<char> data;\r\n    str::Str<char> content;\r\n\r\n    ByteWriterLE lzsaHeader(data.AppendBlanks(8), 8);\r\n    lzsaHeader.Write32(LZMA_MAGIC_ID);\r\n    lzsaHeader.Write32((uint32_t)(files.Count() - skipFiles));\r\n\r\n    for (size_t i = skipFiles; i < files.Count(); i++) {\r\n        ScopedMem<WCHAR> filePath(str::Dup(files.At(i)));\r\n        WCHAR *sep = str::FindCharLast(filePath, ':');\r\n        ScopedMem<char> utf8Name;\r\n        if (sep) {\r\n            utf8Name.Set(str::conv::ToUtf8(sep + 1));\r\n            *sep = '\\0';\r\n        }\r\n        else {\r\n            utf8Name.Set(str::conv::ToUtf8(filePath));\r\n        }\r\n\r\n        str::TransChars(utf8Name, \"/\", \"\\\\\");\r\n        if ('/' == *utf8Name || str::Find(utf8Name, \"../\")) {\r\n            fprintf(stderr, \"In-archive name must not be an absolute path: %s\\n\", utf8Name.Get());\r\n            return false;\r\n        }\r\n\r\n        int idx = GetIdxFromName(&prevArchive, utf8Name);\r\n        lzma::FileInfo *fi = nullptr;\r\n        if (idx != -1)\r\n            fi = &prevArchive.files[idx];\r\n        if (!AppendEntry(data, content, filePath, utf8Name, fi))\r\n            return false;\r\n    }\r\n\r\n    uint32_t headerCrc32 = crc32(0, (const uint8_t *)data.Get(), (uint32_t)data.Size());\r\n    ByteWriterLE(data.AppendBlanks(4), 4).Write32(headerCrc32);\r\n    if (!data.AppendChecked(content.Get(), content.Size()))\r\n        return false;\r\n\r\n    return file::WriteAll(archivePath, data.Get(), data.Size());\r\n}\r\n\r\n}\r\n\r\n#define FailIf(cond, msg, ...) if (cond) { fprintf(stderr, msg \"\\n\", __VA_ARGS__); return errorStep; } errorStep++\r\n\r\nint mainVerify(const WCHAR *archivePath)\r\n{\r\n    int errorStep = 1;\r\n    size_t fileDataLen;\r\n    ScopedMem<char> fileData(file::ReadAll(archivePath, &fileDataLen));\r\n    FailIf(!fileData, \"Failed to read \\\"%S\\\"\", archivePath);\r\n\r\n    lzma::SimpleArchive lzsa;\r\n    bool ok = lzma::ParseSimpleArchive(fileData, fileDataLen, &lzsa);\r\n    FailIf(!ok, \"\\\"%S\\\" is no valid LzSA file\", archivePath);\r\n\r\n    for (int i = 0; i < lzsa.filesCount; i++) {\r\n        ScopedMem<char> data(lzma::GetFileDataByIdx(&lzsa, i, nullptr));\r\n        FailIf(!data, \"Failed to extract data for \\\"%s\\\"\", lzsa.files[i].name);\r\n    }\r\n\r\n    printf(\"Verified all %d archive entries\\n\", lzsa.filesCount);\r\n    return 0;\r\n}\r\n\r\nint main(int argc, char **argv)\r\n{\r\n    UNUSED(argc); UNUSED(argv);\r\n#ifdef DEBUG\r\n    // report memory leaks on stderr\r\n    _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);\r\n    _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);\r\n    _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);\r\n#endif\r\n\r\n    WStrVec args;\r\n    ParseCmdLine(GetCommandLine(), args);\r\n    int errorStep = 1;\r\n\r\n    if (args.Count() == 2 && file::Exists(args.At(1)))\r\n        return mainVerify(args.At(1));\r\n\r\n    FailIf(args.Count() < 3, \"Syntax: %S <archive.lzsa> <filename>[:<in-archive name>] [...]\", path::GetBaseName(args.At(0)));\r\n\r\n    bool ok = lzsa::CreateArchive(args.At(1), args, 2);\r\n    FailIf(!ok, \"Failed to create \\\"%S\\\"\", args.At(1));\r\n\r\n    return 0;\r\n}\r\n"
  },
  {
    "path": "src/tools/plugin-test.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: BSD */\r\n\r\n// this is a minimal example for how to use SumatraPDF in plugin mode\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"CmdLineParser.h\"\r\n#include \"FileUtil.h\"\r\n\r\n#define PLUGIN_TEST_NAME L\"SumatraPDF Plugin Test\"\r\n\r\nstruct PluginStartData {\r\n    // path to SumatraPDF.exe\r\n    const WCHAR *sumatraPath;\r\n    // path to the (downloaded) document to display\r\n    const WCHAR *filePath;\r\n    // path/URL to display in the UI (to hide temporary paths)\r\n    const WCHAR *fileOriginUrl;\r\n};\r\n\r\n// in order to host SumatraPDF as a plugin, create a (child) window and\r\n// handle the following messages for it:\r\nLRESULT CALLBACK PluginParentWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    if (WM_CREATE == msg) {\r\n        // run SumatraPDF.exe with the -plugin command line argument\r\n        PluginStartData *data = (PluginStartData *)((CREATESTRUCT *)lParam)->lpCreateParams;\r\n        ScopedMem<WCHAR> cmdLine(str::Format(L\"-plugin %d \\\"%s\\\"\", hwnd, data->filePath));\r\n        if (data->fileOriginUrl) {\r\n            cmdLine.Set(str::Format(L\"-plugin \\\"%s\\\" %d \\\"%s\\\"\", data->fileOriginUrl, hwnd, data->filePath));\r\n        }\r\n        ShellExecute(hwnd, L\"open\", data->sumatraPath, cmdLine, nullptr, SW_SHOW);\r\n    }\r\n    else if (WM_SIZE == msg) {\r\n        // resize the SumatraPDF window\r\n        HWND hChild = FindWindowEx(hwnd, nullptr, nullptr, nullptr);\r\n        if (hChild) {\r\n            ClientRect rcClient(hwnd);\r\n            MoveWindow(hChild, rcClient.x, rcClient.y, rcClient.dx, rcClient.dy, FALSE);\r\n        }\r\n        else {\r\n            InvalidateRect(hwnd, nullptr, TRUE);\r\n            UpdateWindow(hwnd);\r\n        }\r\n    }\r\n    else if (WM_COPYDATA == msg) {\r\n        // handle a URL to open externally (or prevent it)\r\n        HWND hChild = FindWindowEx(hwnd, nullptr, nullptr, nullptr);\r\n        COPYDATASTRUCT *cds = (COPYDATASTRUCT *)lParam;\r\n        if (cds && 0x4C5255 /* URL */ == cds->dwData && (HWND)wParam == hChild) {\r\n            ScopedMem<WCHAR> url(str::conv::FromUtf8((const char *)cds->lpData));\r\n            ShellExecute(hChild, L\"open\", url, nullptr, nullptr, SW_SHOW);\r\n            return TRUE;\r\n        }\r\n    }\r\n    else if (WM_PAINT == msg) {\r\n        // paint an error message (only needed if SumatraPDF couldn't be run)\r\n        PAINTSTRUCT ps;\r\n        HDC hDC = BeginPaint(hwnd, &ps);\r\n        RECT rcClient = ClientRect(hwnd).ToRECT();\r\n        HBRUSH brushBg = CreateSolidBrush(0xCCCCCC);\r\n        FillRect(hDC, &rcClient, brushBg);\r\n        LOGFONT lf = { 0 };\r\n        lf.lfHeight = -14;\r\n        str::BufSet(lf.lfFaceName, dimof(lf.lfFaceName), L\"MS Shell Dlg\");\r\n        HFONT hFont = CreateFontIndirect(&lf);\r\n        hFont = (HFONT)SelectObject(hDC, hFont);\r\n        SetTextColor(hDC, 0x000000);\r\n        SetBkMode(hDC, TRANSPARENT);\r\n        DrawText(hDC, L\"Error: Couldn't run SumatraPDF!\", -1, &rcClient, DT_CENTER | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX);\r\n        DeleteObject(SelectObject(hDC, hFont));\r\n        DeleteObject(brushBg);\r\n        EndPaint(hwnd, &ps);\r\n    }\r\n    else if (WM_DESTROY == msg) {\r\n        // clean-up happens automatically when the window is destroyed\r\n        PostQuitMessage(0);\r\n    }\r\n\r\n    return DefWindowProc(hwnd, msg, wParam, lParam);\r\n}\r\n\r\nWCHAR *GetSumatraExePath()\r\n{\r\n    // run SumatraPDF.exe either from plugin-test.exe's or the current directory\r\n    ScopedMem<WCHAR> path(path::GetAppPath(L\"SumatraPDF.exe\"));\r\n    if (!file::Exists(path))\r\n        return str::Dup(L\"SumatraPDF.exe\");\r\n    return path.StealData();\r\n}\r\n\r\nint APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLineA, int nCmdShow)\r\n{\r\n    UNUSED(hPrevInstance);  UNUSED(lpCmdLineA);\r\n    WStrVec argList;\r\n    ParseCmdLine(GetCommandLine(), argList);\r\n\r\n    if (argList.Count() == 1) {\r\n        ScopedMem<WCHAR> msg(str::Format(L\"Syntax: %s [<SumatraPDF.exe>] [<URL>] <filename.ext>\", path::GetBaseName(argList.At(0))));\r\n        MessageBox(nullptr, msg, PLUGIN_TEST_NAME, MB_OK | MB_ICONINFORMATION);\r\n        return 1;\r\n    }\r\n    if (argList.Count() == 2 || !str::EndsWithI(argList.At(1), L\".exe\")) {\r\n        argList.InsertAt(1, GetSumatraExePath());\r\n    }\r\n    if (argList.Count() == 3) {\r\n        argList.InsertAt(2, nullptr);\r\n    }\r\n\r\n    WNDCLASS wc = { 0 };\r\n    wc.lpfnWndProc = PluginParentWndProc;\r\n    wc.hInstance = hInstance;\r\n    wc.lpszClassName = PLUGIN_TEST_NAME;\r\n    wc.hCursor = LoadCursor(nullptr, IDC_ARROW);\r\n    RegisterClass(&wc);\r\n\r\n    PluginStartData data = { argList.At(1), argList.At(3), argList.At(2) };\r\n    HWND hwnd = CreateWindow(PLUGIN_TEST_NAME, PLUGIN_TEST_NAME,\r\n                             WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,\r\n                             nullptr, nullptr, hInstance,\r\n                             &data);\r\n    ShowWindow(hwnd, nCmdShow);\r\n\r\n    MSG msg;\r\n    while (GetMessage(&msg, nullptr, 0, 0)) {\r\n        TranslateMessage(&msg);\r\n        DispatchMessage(&msg);\r\n    }\r\n\r\n    return (int)msg.wParam;\r\n}\r\n"
  },
  {
    "path": "src/tools/signfile.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n// signfile produces a cryptographic signature of a given file\r\n// using a (self-signed) certificate from the local store.\r\n\r\n// The idea is that an application ships using the certificate's public key\r\n// and is then able to verify whether external data (e.g. an update downloaded\r\n// over a non-secure channel) is from the same source as the application.\r\n\r\n// To produce a usable certificate, use the SDK's makecert.exe tool:\r\n// makecert -r -n \"CN=SumatraPDF Authority\" -cy authority -a sha1 -sv sumatra.pvk sumatra.cer\r\n// makecert -n \"CN=SumatraPDF\" -ic sumatra.cer -iv sumatra.pvk -a sha1 -sky signature -pe -sr currentuser -ss My sumatra-app.cer\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"CmdLineParser.h\"\r\n#include \"CryptoUtil.h\"\r\n#include \"FileUtil.h\"\r\n\r\n#define ErrOut(msg, ...) fwprintf(stderr, TEXT(msg) TEXT(\"\\n\"), __VA_ARGS__)\r\n\r\nvoid ShowUsage(const WCHAR *exeName)\r\n{\r\n    ErrOut(\"Syntax: %s\", path::GetBaseName(exeName));\r\n    ErrOut(\"\\t[-cert CertName]\\t- name of the certificate to use\"); // when omitted uses first available\r\n    ErrOut(\"\\t[-out filename.out]\\t- where to save the signature file\"); // when omitted uses stdout\r\n    ErrOut(\"\\t[-comment #]\\t\\t- comment syntax for signed text files\"); // needed when saving the signature into the signed file\r\n    ErrOut(\"\\t[-pubkey public.key]\\t- where to save the public key\"); // usually not needed\r\n    ErrOut(\"\\tfilename.in\"); // usually needed, optional when -pubkey is present\r\n    ErrOut(\"\");\r\n\r\n    HCERTSTORE hStore = CertOpenSystemStore(NULL, L\"My\");\r\n    CrashAlwaysIf(!hStore);\r\n    bool hasCert = false;\r\n    PCCERT_CONTEXT pCertCtx = nullptr;\r\n    while ((pCertCtx = CertEnumCertificatesInStore(hStore, pCertCtx)) != nullptr) {\r\n        WCHAR name[128];\r\n        DWORD res = CertGetNameString(pCertCtx, CERT_NAME_SIMPLE_DISPLAY_TYPE, 0, nullptr, name, dimof(name));\r\n        if (!res)\r\n            continue;\r\n        HCRYPTPROV hProv = NULL;\r\n        DWORD keySpec = 0;\r\n        BOOL ok = CryptAcquireCertificatePrivateKey(pCertCtx, 0, nullptr, &hProv, &keySpec, nullptr);\r\n        if (!ok || (keySpec & AT_SIGNATURE) != AT_SIGNATURE)\r\n            continue;\r\n        if (!hasCert) {\r\n            ErrOut(\"Available certificates:\");\r\n            hasCert = true;\r\n        }\r\n        ErrOut(\"\\\"%s\\\"\", name);\r\n    }\r\n    if (!hasCert)\r\n        ErrOut(\"Warning: Failed to find a signature certificate in store \\\"My\\\"!\");\r\n    CertCloseStore(hStore, 0);\r\n}\r\n\r\nint main()\r\n{\r\n    WStrVec args;\r\n    ParseCmdLine(GetCommandLine(), args);\r\n\r\n    const WCHAR *filePath = nullptr;\r\n    const WCHAR *certName = nullptr;\r\n    const WCHAR *signFilePath = nullptr;\r\n    const WCHAR *pubkeyPath = nullptr;\r\n    ScopedMem<char> inFileCommentSyntax;\r\n\r\n#define is_arg(name, var) (str::EqI(args.At(i), TEXT(name)) && i + 1 < args.Count() && !var)\r\n    for (size_t i = 1; i < args.Count(); i++) {\r\n        if (is_arg(\"-cert\", certName))\r\n            certName = args.At(++i);\r\n        else if (is_arg(\"-out\", signFilePath))\r\n            signFilePath = args.At(++i);\r\n        else if (is_arg(\"-pubkey\", pubkeyPath))\r\n            pubkeyPath = args.At(++i);\r\n        else if (is_arg(\"-comment\", inFileCommentSyntax))\r\n            inFileCommentSyntax.Set(str::conv::ToUtf8(args.At(++i)));\r\n        else if (!filePath)\r\n            filePath = args.At(i);\r\n        else\r\n            goto SyntaxError;\r\n    }\r\n#undef is_arg\r\n    if (!filePath && !pubkeyPath) {\r\nSyntaxError:\r\n        ShowUsage(args.At(0));\r\n        return 1;\r\n    }\r\n\r\n    // find certificate\r\n    HCERTSTORE hStore = CertOpenSystemStore(NULL, L\"My\");\r\n    CrashAlwaysIf(!hStore);\r\n    PCCERT_CONTEXT pCertCtx = nullptr;\r\n    HCRYPTPROV hProv = NULL;\r\n    HCRYPTKEY hKey = NULL;\r\n    HCRYPTHASH hHash = NULL;\r\n    int errorCode = 2;\r\n\r\n    ScopedMem<BYTE> pubkey;\r\n    ScopedMem<char> data;\r\n    ScopedMem<char> hexSignature;\r\n    ScopedMem<BYTE> signature;\r\n    BOOL ok;\r\n\r\n#define QuitIfNot(cond, msg, ...) if (!(cond)) { ErrOut(msg, __VA_ARGS__); goto ErrorQuit; }\r\n\r\n    // find a certificate for hash signing\r\n    if (!certName) {\r\n        // find first available certificate (same as in ShowUsage)\r\n        while ((pCertCtx = CertEnumCertificatesInStore(hStore, pCertCtx)) != nullptr) {\r\n            WCHAR name[128];\r\n            DWORD res = CertGetNameString(pCertCtx, CERT_NAME_SIMPLE_DISPLAY_TYPE, 0, nullptr, name, dimof(name));\r\n            if (!res)\r\n                continue;\r\n            DWORD keySpec = 0;\r\n            ok = CryptAcquireCertificatePrivateKey(pCertCtx, 0, nullptr, &hProv, &keySpec, nullptr);\r\n            if (ok && (keySpec & AT_SIGNATURE) == AT_SIGNATURE)\r\n                break;\r\n        }\r\n        QuitIfNot(pCertCtx, \"Error: Failed to find a signature certificate in store \\\"My\\\"!\");\r\n    }\r\n    else {\r\n        DWORD keySpec;\r\n        do {\r\n            pCertCtx = CertFindCertificateInStore(hStore, X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, 0, CERT_FIND_SUBJECT_STR, certName, pCertCtx);\r\n            if (!pCertCtx)\r\n                break;\r\n            keySpec = 0;\r\n            ok = CryptAcquireCertificatePrivateKey(pCertCtx, 0, nullptr, &hProv, &keySpec, nullptr);\r\n        } while (!ok || (keySpec & AT_SIGNATURE) != AT_SIGNATURE);\r\n        QuitIfNot(pCertCtx, \"Error: Failed to find a signature certificate for \\\"%s\\\" in store \\\"My\\\"!\", certName);\r\n    }\r\n\r\n    // extract public key for verficiation and export\r\n    ok = CryptGetUserKey(hProv, AT_SIGNATURE, &hKey);\r\n    QuitIfNot(ok, \"Error: Failed to export the public key!\");\r\n    DWORD pubkeyLen = 0;\r\n    ok = CryptExportKey(hKey, NULL, PUBLICKEYBLOB, 0, nullptr, &pubkeyLen);\r\n    QuitIfNot(ok, \"Error: Failed to export the public key!\");\r\n    pubkey.Set(AllocArray<BYTE>(pubkeyLen));\r\n    ok = CryptExportKey(hKey, NULL, PUBLICKEYBLOB, 0, pubkey.Get(), &pubkeyLen);\r\n    QuitIfNot(ok, \"Error: Failed to export the public key!\");\r\n    if (pubkeyPath) {\r\n        ok = file::WriteAll(pubkeyPath, pubkey.Get(), pubkeyLen);\r\n        QuitIfNot(ok, \"Error: Failed to write the public key to \\\"%s\\\"!\", pubkeyPath);\r\n        QuitIfNot(filePath, \"Wrote the public key to \\\"%s\\\", no file to sign.\", pubkeyPath);\r\n    }\r\n\r\n    // prepare data for signing\r\n    size_t dataLen;\r\n    data.Set(file::ReadAll(filePath, &dataLen));\r\n    QuitIfNot(data && dataLen <= UINT_MAX, \"Error: Failed to read from \\\"%s\\\" (or file is too large)!\", filePath);\r\n    ok = !inFileCommentSyntax || (dataLen > 0 && !memchr(data.Get(), 0, dataLen));\r\n    QuitIfNot(ok, \"Error: Can't put signature comment into binary or empty file!\");\r\n    if (inFileCommentSyntax) {\r\n        // cut previous signature from file\r\n        char *lastLine = data + dataLen - 1;\r\n        while (lastLine > data.Get() && *(lastLine - 1) != '\\n')\r\n            lastLine--;\r\n        const char *lf = str::Find(data, \"\\r\\n\") || !str::FindChar(data, '\\n') ? \"\\r\\n\" : \"\\n\";\r\n        if (lastLine > data && str::StartsWith(lastLine, inFileCommentSyntax.Get()) &&\r\n            str::StartsWith(lastLine + str::Len(inFileCommentSyntax), \" Signature sha1:\")) {\r\n            strcpy_s(lastLine, 3, lf);\r\n        }\r\n        else {\r\n            data.Set(str::Format(\"%s%s\", data, lf));\r\n        }\r\n        dataLen = str::Len(data);\r\n    }\r\n\r\n    // sign data\r\n    ok = CryptCreateHash(hProv, CALG_SHA1, 0, 0, &hHash);\r\n    QuitIfNot(ok, \"Error: Failed to create a SHA-1 hash!\");\r\n#ifdef _WIN64\r\n    {\r\n        const BYTE *bytes = (const BYTE *)data.Get();\r\n        size_t bytesLen = dataLen;\r\n        for (; bytesLen > ULONG_MAX; bytes += ULONG_MAX, bytesLen -= ULONG_MAX) {\r\n            ok = ok && CryptHashData(hHash, bytes, ULONG_MAX, 0);\r\n        }\r\n        ok = ok && CryptHashData(hHash, bytes, (ULONG)bytesLen, 0);\r\n    }\r\n#else\r\n    ok = CryptHashData(hHash, (const BYTE *)data.Get(), dataLen, 0);\r\n#endif\r\n    QuitIfNot(ok, \"Error: Failed to calculate the SHA-1 hash!\");\r\n    DWORD sigLen = 0;\r\n    ok = CryptSignHash(hHash, AT_SIGNATURE, nullptr, 0, nullptr, &sigLen);\r\n    QuitIfNot(ok, \"Error: Failed to sign the SHA-1 hash!\");\r\n    signature.Set(AllocArray<BYTE>(sigLen));\r\n    ok = CryptSignHash(hHash, AT_SIGNATURE, nullptr, 0, signature.Get(), &sigLen);\r\n    QuitIfNot(ok, \"Error: Failed to sign the SHA-1 hash!\");\r\n\r\n    // convert signature to ASCII text\r\n    hexSignature.Set(str::MemToHex((const unsigned char *)signature.Get(), sigLen));\r\n    if (inFileCommentSyntax) {\r\n        const char *lf = str::Find(data, \"\\r\\n\") || !str::FindChar(data, '\\n') ? \"\\r\\n\" : \"\\n\";\r\n        data.Set(str::Format(\"%s%s Signature sha1:%s%s\", data, inFileCommentSyntax, hexSignature, lf));\r\n        dataLen = str::Len(data);\r\n        hexSignature.Set(str::Dup(data));\r\n    }\r\n    else {\r\n        hexSignature.Set(str::Format(\"sha1:%s\\r\\n\", hexSignature));\r\n    }\r\n\r\n    // verify signature\r\n    ok = VerifySHA1Signature(data.Get(), dataLen, inFileCommentSyntax ? nullptr : hexSignature.Get(), pubkey, pubkeyLen);\r\n    QuitIfNot(ok, \"Error: Failed to verify signature!\");\r\n\r\n    // save/display signature\r\n    if (signFilePath) {\r\n        ok = file::WriteAll(signFilePath, hexSignature.Get(), str::Len(hexSignature));\r\n        QuitIfNot(ok, \"Error: Failed to write signature to \\\"%s\\\"!\", signFilePath);\r\n    }\r\n    else {\r\n        fprintf(stdout, \"%s\", hexSignature.Get());\r\n    }\r\n    errorCode = 0;\r\n\r\nErrorQuit:\r\n    if (hHash)\r\n        CryptDestroyHash(hHash);\r\n    if (hKey)\r\n        CryptDestroyKey(hKey);\r\n    if (hProv)\r\n        CryptReleaseContext(hProv, 0);\r\n    if (pCertCtx)\r\n        CertFreeCertificateContext(pCertCtx);\r\n    if (hStore)\r\n        CertCloseStore(hStore, 0);\r\n\r\n    return errorCode;\r\n}\r\n"
  },
  {
    "path": "src/tools/test_util.cpp",
    "content": "#include \"BaseUtil.h\"\r\n#include \"WinDynCalls.h\"\r\n\r\n// must be last due to assert() over-write\r\n#include \"UtAssert.h\"\r\n\r\n// in src/util/tests/UtilTests.cpp\r\nextern void BaseUtils_UnitTests();\r\n\r\n// in src/UnitTests.cpp\r\nextern void SumatraPDF_UnitTests();\r\n\r\n// in src/mui/SvgPath_ut.cpp\r\nextern void SvgPath_UnitTests();\r\n\r\nextern void BaseUtilTest();\r\nextern void ByteOrderTests();\r\nextern void CmdLineParserTest();\r\nextern void CryptoUtilTest();\r\nextern void CssParser_UnitTests();\r\nextern void DictTest();\r\nextern void FileUtilTest();\r\nextern void HtmlPrettyPrintTest();\r\nextern void HtmlPullParser_UnitTests();\r\nextern void JsonTest();\r\nextern void SettingsUtilTest();\r\nextern void SimpleLogTest();\r\nextern void SquareTreeTest();\r\nextern void StrFormatTest();\r\nextern void StrTest();\r\nextern void TrivialHtmlParser_UnitTests();\r\nextern void VarintGobTest();\r\nextern void VecTest();\r\nextern void WinUtilTest();\r\nextern void StrFormatTest();\r\n\r\nint main(int argc, char **argv)\r\n{\r\n    UNUSED(argc); UNUSED(argv);\r\n    printf(\"Running unit tests\\n\");\r\n    InitDynCalls();\r\n    BaseUtilTest();\r\n    ByteOrderTests();\r\n    CmdLineParserTest();\r\n    CryptoUtilTest();\r\n    CssParser_UnitTests();\r\n    DictTest();\r\n    FileUtilTest();\r\n    HtmlPrettyPrintTest();\r\n    HtmlPullParser_UnitTests();\r\n    JsonTest();\r\n    SettingsUtilTest();\r\n    SimpleLogTest();\r\n    SquareTreeTest();\r\n    StrTest();\r\n    TrivialHtmlParser_UnitTests();\r\n    VarintGobTest();\r\n    VecTest();\r\n    WinUtilTest();\r\n    SumatraPDF_UnitTests();\r\n    SvgPath_UnitTests();\r\n    StrFormatTest();\r\n\r\n    int res = utassert_print_results();\r\n    return res;\r\n}\r\n"
  },
  {
    "path": "src/uia/Constants.h",
    "content": "// define necessary constants here if UIAutomationClient.h is not available\r\n\r\n#ifndef __UIA_PatternIds_MODULE_DEFINED__\r\nconst long UIA_TextPatternId = 10014;\r\nconst long UIA_ValuePatternId = 10002;\r\n#endif //__UIA_PatternIds_MODULE_DEFINED__\r\n\r\n#ifndef __UIA_EventIds_MODULE_DEFINED__\r\nconst long UIA_Text_TextSelectionChangedEventId = 20014;\r\n#endif //__UIA_EventIds_MODULE_DEFINED__\r\n\r\n#ifndef __UIA_PropertyIds_MODULE_DEFINED__\r\nconst long UIA_NamePropertyId = 30005;\r\nconst long UIA_ControlTypePropertyId = 30003;\r\nconst long UIA_IsKeyboardFocusablePropertyId = 30009;\r\nconst long UIA_AutomationIdPropertyId = 30011;\r\nconst long UIA_IsControlElementPropertyId = 30016;\r\nconst long UIA_IsContentElementPropertyId = 30017;\r\nconst long UIA_NativeWindowHandlePropertyId = 30020;\r\nconst long UIA_IsTextPatternAvailablePropertyId = 30040;\r\nconst long UIA_IsValuePatternAvailablePropertyId = 30043;\r\n#endif //__UIA_PropertyIds_MODULE_DEFINED__\r\n\r\n#ifndef __UIA_ControlTypeIds_MODULE_DEFINED__\r\nconst long UIA_CustomControlTypeId = 50025;\r\nconst long UIA_DocumentControlTypeId = 50030;\r\n#endif //__UIA_ControlTypeIds_MODULE_DEFINED__\r\n"
  },
  {
    "path": "src/uia/DocumentProvider.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n#include \"BaseUtil.h\"\r\n#include <UIAutomationCore.h>\r\n#include <UIAutomationCoreApi.h>\r\n#include <OleAcc.h>\r\n#include \"BaseEngine.h\"\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"EngineManager.h\"\r\n#include \"DisplayModel.h\"\r\n#include \"FileUtil.h\"\r\n#include \"uia/DocumentProvider.h\"\r\n#include \"uia/Constants.h\"\r\n#include \"uia/PageProvider.h\"\r\n#include \"uia/Provider.h\"\r\n#include \"uia/TextRange.h\"\r\n\r\nSumatraUIAutomationDocumentProvider::SumatraUIAutomationDocumentProvider(HWND canvasHwnd, SumatraUIAutomationProvider* root) :\r\n    refCount(1), canvasHwnd(canvasHwnd), root(root),\r\n    released(true), child_first(nullptr), child_last(nullptr),\r\n    dm(nullptr)\r\n{\r\n    //root->AddRef(); Don't add refs to our parent & owner.\r\n}\r\n\r\nSumatraUIAutomationDocumentProvider::~SumatraUIAutomationDocumentProvider()\r\n{\r\n    this->FreeDocument();\r\n}\r\n\r\nvoid SumatraUIAutomationDocumentProvider::LoadDocument(DisplayModel* newDm)\r\n{\r\n    this->FreeDocument();\r\n\r\n    // no mutexes needed, this function is called from thread that created dm\r\n\r\n    // create page element for each page\r\n    SumatraUIAutomationPageProvider* prevPage = nullptr;\r\n    for (int i=1; i<=newDm->PageCount(); ++i) {\r\n        SumatraUIAutomationPageProvider* currentPage = new SumatraUIAutomationPageProvider(i, canvasHwnd, newDm, this);\r\n        currentPage->sibling_prev = prevPage;\r\n        if (prevPage)\r\n            prevPage->sibling_next = currentPage;\r\n        prevPage = currentPage;\r\n\r\n        if (i == 1)\r\n            child_first = currentPage;\r\n    }\r\n    child_last = prevPage;\r\n\r\n    dm = newDm;\r\n    released = false;\r\n}\r\n\r\nvoid SumatraUIAutomationDocumentProvider::FreeDocument()\r\n{\r\n    // release our refs to the page elements\r\n    if (released)\r\n        return;\r\n\r\n    released = true;\r\n    dm = nullptr;\r\n\r\n    SumatraUIAutomationPageProvider* it = child_first;\r\n    while (it) {\r\n        SumatraUIAutomationPageProvider* current = it;\r\n        it = it->sibling_next;\r\n\r\n        current->released = true; // disallow DisplayModel access\r\n        current->Release();\r\n    }\r\n\r\n    // we have released our refs from these objects\r\n    // we are not allowed to access them anymore\r\n    child_first = nullptr;\r\n    child_last = nullptr;\r\n}\r\n\r\nbool SumatraUIAutomationDocumentProvider::IsDocumentLoaded() const\r\n{\r\n    return !released;\r\n}\r\n\r\nDisplayModel* SumatraUIAutomationDocumentProvider::GetDM()\r\n{\r\n    AssertCrash(IsDocumentLoaded());\r\n    AssertCrash(dm);\r\n    return dm;\r\n}\r\n\r\nSumatraUIAutomationPageProvider* SumatraUIAutomationDocumentProvider::GetFirstPage()\r\n{\r\n    AssertCrash(IsDocumentLoaded());\r\n    return child_first;\r\n}\r\n\r\nSumatraUIAutomationPageProvider* SumatraUIAutomationDocumentProvider::GetLastPage()\r\n{\r\n    AssertCrash(IsDocumentLoaded());\r\n    return child_last;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationDocumentProvider::QueryInterface(REFIID riid, void **ppv)\r\n{\r\n    static const QITAB qit[] = {\r\n        QITABENT(SumatraUIAutomationDocumentProvider, IRawElementProviderSimple),\r\n        QITABENT(SumatraUIAutomationDocumentProvider, IRawElementProviderFragment),\r\n        QITABENT(SumatraUIAutomationDocumentProvider, ITextProvider),\r\n        QITABENT(SumatraUIAutomationDocumentProvider, IAccIdentity),\r\n        { 0 }\r\n    };\r\n    return QISearch(this, qit, riid, ppv);\r\n}\r\n\r\nULONG STDMETHODCALLTYPE SumatraUIAutomationDocumentProvider::AddRef(void)\r\n{\r\n    return InterlockedIncrement(&refCount);\r\n}\r\n\r\nULONG STDMETHODCALLTYPE SumatraUIAutomationDocumentProvider::Release(void)\r\n{\r\n    LONG res = InterlockedDecrement(&refCount);\r\n    CrashIf(res < 0);\r\n    if (0 == res)\r\n        delete this;\r\n    return res;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationDocumentProvider::Navigate(enum NavigateDirection direction, IRawElementProviderFragment **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    if (direction == NavigateDirection_NextSibling ||\r\n        direction == NavigateDirection_PreviousSibling) {\r\n        *pRetVal = nullptr;\r\n        return S_OK;\r\n    } else if (direction == NavigateDirection_FirstChild ||\r\n             direction == NavigateDirection_LastChild) {\r\n        // don't allow traversion to enter invalid nodes\r\n        if (released) {\r\n            *pRetVal = nullptr;\r\n            return S_OK;\r\n        }\r\n\r\n        if (direction == NavigateDirection_FirstChild)\r\n            *pRetVal = child_first;\r\n        else\r\n            *pRetVal = child_last;\r\n        (*pRetVal)->AddRef();\r\n        return S_OK;\r\n    } else if (direction == NavigateDirection_Parent) {\r\n        *pRetVal = root;\r\n        (*pRetVal)->AddRef();\r\n        return S_OK;\r\n    } else {\r\n        return E_INVALIDARG;\r\n    }\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationDocumentProvider::GetRuntimeId(SAFEARRAY **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    SAFEARRAY *psa = SafeArrayCreateVector(VT_I4, 0, 2);\r\n    if (!psa)\r\n        return E_OUTOFMEMORY;\r\n\r\n    // RuntimeID magic, use hwnd to differentiate providers of different windows\r\n    LONG rId[] = { (LONG)canvasHwnd, SUMATRA_UIA_DOCUMENT_RUNTIME_ID };\r\n    for (LONG i = 0; i < 2; i++) {\r\n        HRESULT hr = SafeArrayPutElement(psa, &i, (void*)&(rId[i]));\r\n        CrashIf(FAILED(hr));\r\n    }\r\n\r\n    *pRetVal = psa;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationDocumentProvider::GetEmbeddedFragmentRoots(SAFEARRAY **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    // no other roots => return nullptr\r\n    *pRetVal = nullptr;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationDocumentProvider::SetFocus(void)\r\n{\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationDocumentProvider::get_BoundingRectangle(struct UiaRect *pRetVal)\r\n{\r\n    // share area with the canvas uia provider\r\n    return root->get_BoundingRectangle(pRetVal);\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationDocumentProvider::get_FragmentRoot(IRawElementProviderFragmentRoot **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    // return the root node\r\n    *pRetVal = root;\r\n    root->AddRef();\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationDocumentProvider::GetPatternProvider(PATTERNID patternId,IUnknown **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    if (patternId == UIA_TextPatternId) {\r\n        *pRetVal = static_cast<ITextProvider*>(this);\r\n        AddRef();\r\n        return S_OK;\r\n    }\r\n\r\n    *pRetVal = nullptr;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationDocumentProvider::GetPropertyValue(PROPERTYID propertyId,VARIANT *pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n    if (released)\r\n        return E_FAIL;\r\n\r\n    if (propertyId == UIA_NamePropertyId) {\r\n        // typically filename\r\n        pRetVal->vt = VT_BSTR;\r\n        pRetVal->bstrVal = SysAllocString(path::GetBaseName(dm->GetEngine()->FileName()));\r\n        return S_OK;\r\n    } else if (propertyId == UIA_IsTextPatternAvailablePropertyId) {\r\n        pRetVal->vt = VT_BOOL;\r\n        pRetVal->boolVal = TRUE;\r\n        return S_OK;\r\n    } else if (propertyId == UIA_ControlTypePropertyId) {\r\n        pRetVal->vt = VT_I4;\r\n        pRetVal->lVal = UIA_DocumentControlTypeId;\r\n        return S_OK;\r\n    } else if (propertyId == UIA_IsContentElementPropertyId || propertyId == UIA_IsControlElementPropertyId) {\r\n        pRetVal->vt = VT_BOOL;\r\n        pRetVal->boolVal = TRUE;\r\n        return S_OK;\r\n    } else if (propertyId == UIA_NativeWindowHandlePropertyId) {\r\n        pRetVal->vt = VT_I4;\r\n        pRetVal->lVal = 0;\r\n        return S_OK;\r\n    } else if (propertyId == UIA_AutomationIdPropertyId) {\r\n        pRetVal->vt = VT_BSTR;\r\n        pRetVal->bstrVal = SysAllocString(L\"Document\");\r\n        return S_OK;\r\n    }\r\n\r\n    pRetVal->vt = VT_EMPTY;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationDocumentProvider::get_HostRawElementProvider(IRawElementProviderSimple **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n    *pRetVal = nullptr;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationDocumentProvider::get_ProviderOptions(ProviderOptions *pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n    *pRetVal = ProviderOptions_ServerSideProvider;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationDocumentProvider::GetSelection(SAFEARRAY * *pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n    if (released)\r\n        return E_FAIL;\r\n\r\n    SAFEARRAY *psa = SafeArrayCreateVector(VT_UNKNOWN, 0, 1);\r\n    if (!psa)\r\n        return E_OUTOFMEMORY;\r\n\r\n    // TODO: this selection is leaked - why?\r\n    SumatraUIAutomationTextRange* selection = new SumatraUIAutomationTextRange(this, dm->textSelection);\r\n\r\n    LONG index = 0;\r\n    HRESULT hr = SafeArrayPutElement(psa, &index, selection);\r\n    CrashIf(FAILED(hr));\r\n    // the array now owns the selection\r\n    selection->Release();\r\n\r\n    *pRetVal = psa;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationDocumentProvider::GetVisibleRanges(SAFEARRAY * *pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n    if (released)\r\n        return E_FAIL;\r\n\r\n    // return all pages' ranges that are even partially visible\r\n    Vec<SumatraUIAutomationTextRange*> rangeArray;\r\n    SumatraUIAutomationPageProvider* it = child_first;\r\n    while (it && rangeArray.Size() > ULONG_MAX) {\r\n        if (it->dm->GetPageInfo(it->pageNum) &&\r\n            it->dm->GetPageInfo(it->pageNum)->shown &&\r\n            it->dm->GetPageInfo(it->pageNum)->visibleRatio > 0.0f) {\r\n            rangeArray.Append(new SumatraUIAutomationTextRange(this, it->pageNum));\r\n        }\r\n        it = it->sibling_next;\r\n    }\r\n    CrashIf(ULONG_MAX == rangeArray.Size());\r\n\r\n    SAFEARRAY *psa = SafeArrayCreateVector(VT_UNKNOWN, 0, (ULONG)rangeArray.Size());\r\n    if (!psa) {\r\n        for (size_t i = 0; i < rangeArray.Size(); i++) {\r\n            rangeArray[i]->Release();\r\n        }\r\n        return E_OUTOFMEMORY;\r\n    }\r\n\r\n    for (LONG i = 0; i < (LONG)rangeArray.Size(); i++) {\r\n        HRESULT hr = SafeArrayPutElement(psa, &i, rangeArray[i]);\r\n        CrashIf(FAILED(hr));\r\n        rangeArray[i]->Release();\r\n    }\r\n\r\n    *pRetVal = psa;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationDocumentProvider::RangeFromChild(IRawElementProviderSimple *childElement, ITextRangeProvider **pRetVal)\r\n{\r\n    if (pRetVal == nullptr || childElement == nullptr)\r\n        return E_POINTER;\r\n    if (released)\r\n        return E_FAIL;\r\n\r\n    // get page range\r\n    // TODO: is childElement guaranteed to be a SumatraUIAutomationPageProvider?\r\n    *pRetVal = new SumatraUIAutomationTextRange(this, ((SumatraUIAutomationPageProvider*)childElement)->pageNum);\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationDocumentProvider::RangeFromPoint(struct UiaPoint point, ITextRangeProvider **pRetVal)\r\n{\r\n    UNUSED(point); UNUSED(pRetVal);\r\n    // TODO: Is this even used? We wont support editing either way\r\n    // so there won't be even a caret visible. Hence empty ranges are useless?\r\n    return E_NOTIMPL;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationDocumentProvider::get_DocumentRange(ITextRangeProvider **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n    if (released)\r\n        return E_FAIL;\r\n\r\n    SumatraUIAutomationTextRange* documentRange = new SumatraUIAutomationTextRange(this);\r\n    documentRange->SetToDocumentRange();\r\n\r\n    *pRetVal = documentRange;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationDocumentProvider::get_SupportedTextSelection(enum SupportedTextSelection *pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n    *pRetVal = SupportedTextSelection_Single;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationDocumentProvider::GetIdentityString(DWORD dwIDChild, BYTE **ppIDString, DWORD *pdwIDStringLen)\r\n{\r\n    if (ppIDString == nullptr || pdwIDStringLen == nullptr)\r\n        return E_POINTER;\r\n    if (released)\r\n        return E_FAIL;\r\n\r\n    for (SumatraUIAutomationPageProvider* it = child_first; it; it = it->sibling_next) {\r\n        if (it->pageNum == (int)dwIDChild + 1) {\r\n            // Use memory address as identification. Use 8 bytes just in case\r\n            *ppIDString = (BYTE*) CoTaskMemAlloc(8);\r\n            if (!(*ppIDString))\r\n                return E_OUTOFMEMORY;\r\n\r\n            memset(*ppIDString, 0, 8);\r\n            memcpy(*ppIDString, &it, sizeof(void*)); // copy the pointer to the allocated array\r\n            *pdwIDStringLen = 8;\r\n            return S_OK;\r\n        }\r\n    }\r\n\r\n    return E_FAIL;\r\n}\r\n"
  },
  {
    "path": "src/uia/DocumentProvider.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nclass DisplayModel;\r\nclass SumatraUIAutomationProvider;\r\nclass SumatraUIAutomationPageProvider;\r\nclass SumatraUIAutomationTextRange;\r\n\r\nclass SumatraUIAutomationDocumentProvider : public IRawElementProviderFragment,\r\n                                            public IRawElementProviderSimple,\r\n                                            public ITextProvider,\r\n                                            public IAccIdentity \r\n{\r\n    LONG                                refCount;\r\n    HWND                                canvasHwnd;\r\n    SumatraUIAutomationProvider*        root;\r\n    bool                                released;\r\n\r\n    SumatraUIAutomationPageProvider*    child_first;\r\n    SumatraUIAutomationPageProvider*    child_last;\r\n\r\n    DisplayModel*                       dm;\r\n\r\npublic:\r\n    SumatraUIAutomationDocumentProvider(HWND canvasHwnd, SumatraUIAutomationProvider* root);\r\n    ~SumatraUIAutomationDocumentProvider();\r\n\r\n    // reads page count and creates a child element for each page\r\n    void LoadDocument(DisplayModel* dm);\r\n    void FreeDocument();\r\n    bool IsDocumentLoaded() const;\r\n\r\n    // GetDM() must not be called if IsDocumentLoaded()==FALSE\r\n    DisplayModel* GetDM();\r\n\r\n    SumatraUIAutomationPageProvider* GetFirstPage();\r\n    SumatraUIAutomationPageProvider* GetLastPage();\r\n\r\n    // IUnknown\r\n    HRESULT STDMETHODCALLTYPE QueryInterface(const IID &,void **);\r\n    ULONG   STDMETHODCALLTYPE AddRef(void);\r\n    ULONG   STDMETHODCALLTYPE Release(void);\r\n    \r\n    // IRawElementProviderFragment\r\n    HRESULT STDMETHODCALLTYPE Navigate(enum NavigateDirection direction, IRawElementProviderFragment **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE GetRuntimeId(SAFEARRAY **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE GetEmbeddedFragmentRoots(SAFEARRAY **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE SetFocus(void);\r\n    HRESULT STDMETHODCALLTYPE get_BoundingRectangle(struct UiaRect *pRetVal);\r\n    HRESULT STDMETHODCALLTYPE get_FragmentRoot(IRawElementProviderFragmentRoot **pRetVal);\r\n\r\n    // IRawElementProviderSimple\r\n    HRESULT STDMETHODCALLTYPE GetPatternProvider(PATTERNID patternId,IUnknown **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE GetPropertyValue(PROPERTYID propertyId,VARIANT *pRetVal);\r\n    HRESULT STDMETHODCALLTYPE get_HostRawElementProvider(IRawElementProviderSimple **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE get_ProviderOptions(ProviderOptions *pRetVal);\r\n    \r\n    // ITextProvider\r\n    HRESULT STDMETHODCALLTYPE GetSelection(SAFEARRAY * *pRetVal);\r\n    HRESULT STDMETHODCALLTYPE GetVisibleRanges(SAFEARRAY * *pRetVal);\r\n    HRESULT STDMETHODCALLTYPE RangeFromChild(IRawElementProviderSimple *childElement, ITextRangeProvider **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE RangeFromPoint( struct UiaPoint point, ITextRangeProvider **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE get_DocumentRange(  ITextRangeProvider **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE get_SupportedTextSelection( enum SupportedTextSelection *pRetVal);\r\n\r\n    // IAccIdentity\r\n    HRESULT STDMETHODCALLTYPE GetIdentityString(DWORD dwIDChild, BYTE **ppIDString, DWORD *pdwIDStringLen);\r\n};\r\n"
  },
  {
    "path": "src/uia/PageProvider.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n#include \"BaseUtil.h\"\r\n#include <UIAutomationCore.h>\r\n#include <UIAutomationCoreApi.h>\r\n#include <OleAcc.h>\r\n#include \"BaseEngine.h\"\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"EngineManager.h\"\r\n#include \"DisplayModel.h\"\r\n#include \"uia/PageProvider.h\"\r\n#include \"uia/Constants.h\"\r\n#include \"uia/DocumentProvider.h\"\r\n#include \"uia/Provider.h\"\r\n#include \"TextSelection.h\"\r\n\r\nSumatraUIAutomationPageProvider::SumatraUIAutomationPageProvider(int pageNum,HWND canvasHwnd, DisplayModel*dm, SumatraUIAutomationDocumentProvider* root) :\r\n    refCount(1), pageNum(pageNum),\r\n    canvasHwnd(canvasHwnd), dm(dm),\r\n    root(root), sibling_prev(nullptr), sibling_next(nullptr),\r\n    released(false)\r\n{\r\n    //root->AddRef(); Don't add refs to our parent & owner.\r\n}\r\n\r\nSumatraUIAutomationPageProvider::~SumatraUIAutomationPageProvider()\r\n{\r\n}\r\n\r\nint SumatraUIAutomationPageProvider::GetPageNum() const\r\n{\r\n    return pageNum;\r\n}\r\n\r\nSumatraUIAutomationPageProvider* SumatraUIAutomationPageProvider::GetNextPage()\r\n{\r\n    return sibling_next;\r\n}\r\n\r\nSumatraUIAutomationPageProvider* SumatraUIAutomationPageProvider::GetPreviousPage()\r\n{\r\n    return sibling_prev;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationPageProvider::QueryInterface(REFIID riid, void **ppv)\r\n{\r\n    static const QITAB qit[] = {\r\n        QITABENT(SumatraUIAutomationPageProvider, IRawElementProviderSimple),\r\n        QITABENT(SumatraUIAutomationPageProvider, IRawElementProviderFragment),\r\n        QITABENT(SumatraUIAutomationPageProvider, IValueProvider),\r\n        { 0 }\r\n    };\r\n    return QISearch(this, qit, riid, ppv);\r\n}\r\n\r\nULONG STDMETHODCALLTYPE SumatraUIAutomationPageProvider::AddRef(void)\r\n{\r\n    return InterlockedIncrement(&refCount);\r\n}\r\n\r\nULONG STDMETHODCALLTYPE SumatraUIAutomationPageProvider::Release(void)\r\n{\r\n    LONG res = InterlockedDecrement(&refCount);\r\n    CrashIf(res < 0);\r\n    if (0 == res)\r\n        delete this;\r\n    return res;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationPageProvider::Navigate(enum NavigateDirection direction, IRawElementProviderFragment **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    // disallow traverse if we are lingering\r\n    if (released)\r\n        return E_FAIL;\r\n\r\n    *pRetVal =  nullptr;\r\n    if (direction == NavigateDirection_PreviousSibling) {\r\n        *pRetVal = sibling_prev;\r\n    } else if (direction == NavigateDirection_NextSibling) {\r\n        *pRetVal = sibling_next;\r\n    } else if (direction == NavigateDirection_FirstChild ||\r\n             direction == NavigateDirection_LastChild) {\r\n        // do nothing\r\n    } else if (direction == NavigateDirection_Parent) {\r\n        *pRetVal = root;\r\n    } else {\r\n        return E_INVALIDARG;\r\n    }\r\n\r\n    if (*pRetVal)\r\n        (*pRetVal)->AddRef();\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationPageProvider::GetRuntimeId(SAFEARRAY **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    SAFEARRAY *psa = SafeArrayCreateVector(VT_I4, 0, 2);\r\n    if (!psa)\r\n        return E_OUTOFMEMORY;\r\n\r\n    // RuntimeID magic, use hwnd to differentiate providers of different windows\r\n    int rId[] = { (int)canvasHwnd, SUMATRA_UIA_PAGE_RUNTIME_ID(pageNum) };\r\n    for (LONG i = 0; i < 2; i++) {\r\n        HRESULT hr = SafeArrayPutElement(psa, &i, (void*)&(rId[i]));\r\n        CrashIf(FAILED(hr));\r\n    }\r\n\r\n    *pRetVal = psa;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationPageProvider::GetEmbeddedFragmentRoots(SAFEARRAY **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    // no other roots => return nullptr\r\n    *pRetVal = nullptr;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationPageProvider::SetFocus(void)\r\n{\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationPageProvider::get_BoundingRectangle(struct UiaRect *pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    if (released)\r\n        return E_FAIL;\r\n\r\n    // some engines might not support GetPageInfo\r\n    const PageInfo* page = dm->GetPageInfo(pageNum);\r\n    if (!page)\r\n        return E_FAIL;\r\n\r\n    RECT canvasRect;\r\n    GetWindowRect(canvasHwnd, &canvasRect);\r\n\r\n    pRetVal->left   = canvasRect.left + page->pageOnScreen.x;\r\n    pRetVal->top    = canvasRect.top + page->pageOnScreen.y;\r\n    pRetVal->width  = page->pageOnScreen.dx;\r\n    pRetVal->height = page->pageOnScreen.dy;\r\n\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationPageProvider::get_FragmentRoot(IRawElementProviderFragmentRoot **pRetVal)\r\n{\r\n    if (released)\r\n        return E_FAIL;\r\n\r\n    // let our parent to handle this\r\n    return root->get_FragmentRoot(pRetVal);\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationPageProvider::GetPatternProvider(PATTERNID patternId,IUnknown **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    if (patternId == UIA_ValuePatternId) {\r\n        *pRetVal = static_cast<IValueProvider*>(this);\r\n        AddRef();\r\n        return S_OK;\r\n    }\r\n\r\n    *pRetVal = nullptr;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationPageProvider::GetPropertyValue(PROPERTYID propertyId,VARIANT *pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    if (propertyId == UIA_NamePropertyId) {\r\n        pRetVal->vt = VT_BSTR;\r\n        pRetVal->bstrVal = SysAllocString(ScopedMem<WCHAR> (str::Format(L\"Page %d\",pageNum)));\r\n        return S_OK;\r\n    } else if (propertyId == UIA_IsValuePatternAvailablePropertyId) {\r\n        pRetVal->vt = VT_BOOL;\r\n        pRetVal->boolVal = TRUE;\r\n        return S_OK;\r\n    }\r\n\r\n    pRetVal->vt = VT_EMPTY;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationPageProvider::get_HostRawElementProvider(IRawElementProviderSimple **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n    *pRetVal = nullptr;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationPageProvider::get_ProviderOptions(ProviderOptions *pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n    *pRetVal = ProviderOptions_ServerSideProvider;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationPageProvider::SetValue(LPCWSTR val)\r\n{\r\n    UNUSED(val);\r\n    return E_ACCESSDENIED;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationPageProvider::get_Value(BSTR *pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n    if (released)\r\n        return E_FAIL;\r\n\r\n    const WCHAR * pageContent = dm->textCache->GetData(pageNum);\r\n    if (!pageContent) {\r\n        *pRetVal = nullptr;\r\n        return S_OK;\r\n    }\r\n\r\n    *pRetVal = SysAllocString(pageContent);\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationPageProvider::get_IsReadOnly(BOOL *pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    *pRetVal = TRUE;\r\n    return S_OK;\r\n}\r\n"
  },
  {
    "path": "src/uia/PageProvider.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nclass DisplayModel;\r\nclass SumatraUIAutomationDocumentProvider;\r\nclass SumatraUIAutomationPageProvider : public IRawElementProviderFragment, public IRawElementProviderSimple, public IValueProvider {\r\n    LONG                                    refCount;\r\n    int                                     pageNum;\r\n    HWND                                    canvasHwnd;\r\n    DisplayModel*                           dm;\r\n    SumatraUIAutomationDocumentProvider*    root;\r\n\r\n    SumatraUIAutomationPageProvider*        sibling_prev;\r\n    SumatraUIAutomationPageProvider*        sibling_next;\r\n\r\n    // is dm released, and our root has released us.\r\n    // Only UIA keeps us alive but we can't access anything\r\n    bool                                    released;\r\n    \r\n    friend class SumatraUIAutomationDocumentProvider; // for setting up next/prev sibling\r\n\r\npublic:\r\n    SumatraUIAutomationPageProvider(int pageNum,HWND canvasHwnd, DisplayModel*dm, SumatraUIAutomationDocumentProvider* root);\r\n    ~SumatraUIAutomationPageProvider();\r\n\r\n    int GetPageNum() const;\r\n    SumatraUIAutomationPageProvider* GetNextPage();\r\n    SumatraUIAutomationPageProvider* GetPreviousPage();\r\n\r\n    //IUnknown\r\n    HRESULT STDMETHODCALLTYPE QueryInterface(const IID &,void **);\r\n    ULONG   STDMETHODCALLTYPE AddRef(void);\r\n    ULONG   STDMETHODCALLTYPE Release(void);\r\n    \r\n    //IRawElementProviderFragment\r\n    HRESULT STDMETHODCALLTYPE Navigate(enum NavigateDirection direction, IRawElementProviderFragment **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE GetRuntimeId(SAFEARRAY **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE GetEmbeddedFragmentRoots(SAFEARRAY **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE SetFocus(void);\r\n    HRESULT STDMETHODCALLTYPE get_BoundingRectangle(struct UiaRect *pRetVal);\r\n    HRESULT STDMETHODCALLTYPE get_FragmentRoot(IRawElementProviderFragmentRoot **pRetVal);\r\n\r\n    //IRawElementProviderSimple\r\n    HRESULT STDMETHODCALLTYPE GetPatternProvider(PATTERNID patternId,IUnknown **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE GetPropertyValue(PROPERTYID propertyId,VARIANT *pRetVal);\r\n    HRESULT STDMETHODCALLTYPE get_HostRawElementProvider(IRawElementProviderSimple **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE get_ProviderOptions(ProviderOptions *pRetVal);\r\n\r\n    //IValueProvider\r\n    HRESULT STDMETHODCALLTYPE SetValue(LPCWSTR val);\r\n    HRESULT STDMETHODCALLTYPE get_Value(BSTR *pRetVal);\r\n    HRESULT STDMETHODCALLTYPE get_IsReadOnly(BOOL *pRetVal);\r\n};\r\n"
  },
  {
    "path": "src/uia/Provider.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"WinDynCalls.h\"\r\n#include \"DbgHelpDyn.h\"\r\n#include \"WinUtil.h\"\r\n#include \"uia/Provider.h\"\r\n#include \"uia/Constants.h\"\r\n#include \"uia/DocumentProvider.h\"\r\n#include \"uia/StartPageProvider.h\"\r\n\r\nSumatraUIAutomationProvider::SumatraUIAutomationProvider(HWND hwnd) :\r\n    refCount(1), canvasHwnd(hwnd), startpage(nullptr), document(nullptr)\r\n{\r\n    dbghelp::LogCallstack();\r\n    startpage = new SumatraUIAutomationStartPageProvider(hwnd, this);\r\n}\r\n\r\nSumatraUIAutomationProvider::~SumatraUIAutomationProvider()\r\n{\r\n    if (document) {\r\n        document->FreeDocument(); // tell that the dm is now invalid\r\n        document->Release(); // release our hooks\r\n        document = nullptr;\r\n    }\r\n\r\n    startpage->Release();\r\n    startpage = nullptr;\r\n}\r\n\r\nvoid SumatraUIAutomationProvider::OnDocumentLoad(DisplayModel *dm)\r\n{\r\n    AssertCrash(!document);\r\n\r\n    document = new SumatraUIAutomationDocumentProvider(canvasHwnd, this);\r\n    document->LoadDocument(dm);\r\n    uia::RaiseStructureChangedEvent(this, StructureChangeType_ChildrenInvalidated, nullptr, 0);\r\n}\r\n\r\nvoid SumatraUIAutomationProvider::OnDocumentUnload()\r\n{\r\n    if (document) {\r\n        document->FreeDocument(); // tell that the dm is now invalid\r\n        document->Release(); // release our hooks\r\n        document = nullptr;\r\n        uia::RaiseStructureChangedEvent(this, StructureChangeType_ChildrenInvalidated, nullptr, 0);\r\n    }\r\n}\r\n\r\nvoid SumatraUIAutomationProvider::OnSelectionChanged()\r\n{\r\n    if (document)\r\n        uia::RaiseAutomationEvent(document, UIA_Text_TextSelectionChangedEventId);\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationProvider::QueryInterface(REFIID riid, void **ppv)\r\n{\r\n    static const QITAB qit[] = {\r\n        QITABENT(SumatraUIAutomationProvider, IRawElementProviderSimple),\r\n        QITABENT(SumatraUIAutomationProvider, IRawElementProviderFragment),\r\n        QITABENT(SumatraUIAutomationProvider, IRawElementProviderFragmentRoot),\r\n        { 0 }\r\n    };\r\n    return QISearch(this, qit, riid, ppv);\r\n}\r\n\r\nULONG STDMETHODCALLTYPE SumatraUIAutomationProvider::AddRef(void)\r\n{\r\n    dbghelp::LogCallstack();\r\n    return InterlockedIncrement(&refCount);\r\n}\r\n\r\nULONG STDMETHODCALLTYPE SumatraUIAutomationProvider::Release(void)\r\n{\r\n    dbghelp::LogCallstack();\r\n    LONG res = InterlockedDecrement(&refCount);\r\n    CrashIf(res < 0);\r\n    if (0 == res)\r\n        delete this;\r\n    return res;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationProvider::GetPatternProvider(PATTERNID patternId,IUnknown **pRetVal)\r\n{\r\n    UNUSED(patternId);\r\n    *pRetVal = nullptr;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationProvider::GetPropertyValue(PROPERTYID propertyId,VARIANT *pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    if (propertyId == UIA_NamePropertyId) {\r\n        pRetVal->vt = VT_BSTR;\r\n        pRetVal->bstrVal = SysAllocString(L\"Canvas\");\r\n        return S_OK;\r\n    } else if (propertyId == UIA_IsKeyboardFocusablePropertyId) {\r\n        pRetVal->vt = VT_BOOL;\r\n        pRetVal->boolVal = TRUE;\r\n        return S_OK;\r\n    } else if (propertyId == UIA_ControlTypePropertyId) {\r\n        pRetVal->vt = VT_I4;\r\n        pRetVal->lVal = UIA_CustomControlTypeId;\r\n        return S_OK;\r\n    } else if (propertyId == UIA_NativeWindowHandlePropertyId) {\r\n        pRetVal->vt = VT_I4;\r\n        pRetVal->lVal = (LONG)canvasHwnd;\r\n        return S_OK;\r\n    }\r\n\r\n    pRetVal->vt = VT_EMPTY;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationProvider::get_HostRawElementProvider(IRawElementProviderSimple **pRetVal)\r\n{\r\n    return uia::HostProviderFromHwnd(canvasHwnd,pRetVal);\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationProvider::get_ProviderOptions(ProviderOptions *pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n    *pRetVal = ProviderOptions_ServerSideProvider;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationProvider::Navigate(enum NavigateDirection direction, IRawElementProviderFragment **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    *pRetVal = nullptr;\r\n    // no siblings, no parent\r\n    if (direction == NavigateDirection_Parent ||\r\n        direction == NavigateDirection_NextSibling ||\r\n        direction == NavigateDirection_PreviousSibling) {\r\n        return S_OK;\r\n    } else if (direction == NavigateDirection_FirstChild ||\r\n             direction == NavigateDirection_LastChild) {\r\n        // return document content element, or the start page element\r\n        if (document)\r\n            *pRetVal = document;\r\n        else\r\n            *pRetVal = startpage;\r\n\r\n        if (*pRetVal)\r\n            (*pRetVal)->AddRef();\r\n        return S_OK;\r\n    } else {\r\n        return E_INVALIDARG;\r\n    }\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationProvider::GetRuntimeId(SAFEARRAY **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    // top-level elements should return nullptr\r\n    *pRetVal = nullptr;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationProvider::GetEmbeddedFragmentRoots(SAFEARRAY **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    // no other roots => return nullptr\r\n    *pRetVal = nullptr;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationProvider::SetFocus(void)\r\n{\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationProvider::get_BoundingRectangle(struct UiaRect *pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    // return Bounding Rect of the Canvas area\r\n    RECT canvas_rect;\r\n    GetWindowRect(canvasHwnd, &canvas_rect);\r\n\r\n    pRetVal->left   = canvas_rect.left;\r\n    pRetVal->top    = canvas_rect.top;\r\n    pRetVal->width  = canvas_rect.right - canvas_rect.left;\r\n    pRetVal->height = canvas_rect.bottom - canvas_rect.top;\r\n\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationProvider::get_FragmentRoot(IRawElementProviderFragmentRoot **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    *pRetVal = this;\r\n    (*pRetVal)->AddRef();\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationProvider::ElementProviderFromPoint(double x,double y,IRawElementProviderFragment **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    *pRetVal = this->GetElementFromPoint(x,y,this);\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationProvider::GetFocus(IRawElementProviderFragment **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    // whichever child exists in the tree has the focus\r\n    if (document)\r\n        *pRetVal = document;\r\n    else\r\n        *pRetVal = startpage;\r\n    if (*pRetVal)\r\n        (*pRetVal)->AddRef();\r\n    return S_OK;\r\n}\r\n\r\nIRawElementProviderFragment* SumatraUIAutomationProvider::GetElementFromPoint(double x,double y,IRawElementProviderFragment * root)\r\n{\r\n    if (!root)\r\n        return nullptr;\r\n\r\n    // check the children\r\n    IRawElementProviderFragment* it;\r\n    HRESULT hr = root->Navigate(NavigateDirection_FirstChild, &it);\r\n\r\n    while (SUCCEEDED(hr) && it) {\r\n        UiaRect rect;\r\n        hr = it->get_BoundingRectangle(&rect);\r\n\r\n        // step into\r\n        if (SUCCEEDED(hr) && rect.left <= x && x <= rect.left + rect.width && rect.top <= y && y <= rect.top + rect.height) {\r\n            IRawElementProviderFragment* leaf = GetElementFromPoint(x, y, it);\r\n            it->Release();\r\n            return leaf;\r\n        }\r\n\r\n        // go to next element, release old one\r\n        IRawElementProviderFragment* old_it = it;\r\n        hr = old_it->Navigate(NavigateDirection_NextSibling, &it);\r\n        old_it->Release();\r\n    }\r\n\r\n    // no such child\r\n    root->AddRef();\r\n    return root;\r\n}\r\n"
  },
  {
    "path": "src/uia/Provider.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nconst int SUMATRA_UIA_STARTPAGE_RUNTIME_ID = 1;\r\nconst int SUMATRA_UIA_DOCUMENT_RUNTIME_ID = 2;\r\n\r\n#define SUMATRA_UIA_PAGE_RUNTIME_ID(X) (100 + (X))\r\n\r\nclass DisplayModel;\r\nclass SumatraUIAutomationStartPageProvider;\r\nclass SumatraUIAutomationDocumentProvider;\r\n\r\nclass SumatraUIAutomationProvider : public IRawElementProviderSimple, public IRawElementProviderFragment, public IRawElementProviderFragmentRoot {\r\n    LONG                                    refCount;\r\n\r\n    HWND                                    canvasHwnd;\r\n    SumatraUIAutomationStartPageProvider*   startpage;\r\n    SumatraUIAutomationDocumentProvider*    document;\r\n\r\npublic:\r\n    SumatraUIAutomationProvider(HWND hwnd);\r\nprivate: //ensure no accidental destruction of this class and bypassing refcounting\r\n    ~SumatraUIAutomationProvider();\r\n\r\npublic:\r\n    void OnDocumentLoad(DisplayModel *dm);\r\n    void OnDocumentUnload();\r\n    void OnSelectionChanged();\r\n\r\n    //IUnknown\r\n    HRESULT STDMETHODCALLTYPE QueryInterface(const IID &,void **);\r\n    ULONG   STDMETHODCALLTYPE AddRef(void);\r\n    ULONG   STDMETHODCALLTYPE Release(void);\r\n\r\n    //IRawElementProviderSimple\r\n    HRESULT STDMETHODCALLTYPE GetPatternProvider(PATTERNID patternId,IUnknown **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE GetPropertyValue(PROPERTYID propertyId,VARIANT *pRetVal);\r\n    HRESULT STDMETHODCALLTYPE get_HostRawElementProvider(IRawElementProviderSimple **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE get_ProviderOptions(ProviderOptions *pRetVal);\r\n\r\n    //IRawElementProviderFragment\r\n    HRESULT STDMETHODCALLTYPE Navigate(enum NavigateDirection direction, IRawElementProviderFragment **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE GetRuntimeId(SAFEARRAY **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE GetEmbeddedFragmentRoots(SAFEARRAY **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE SetFocus(void);\r\n    HRESULT STDMETHODCALLTYPE get_BoundingRectangle(struct UiaRect *pRetVal);\r\n    HRESULT STDMETHODCALLTYPE get_FragmentRoot(IRawElementProviderFragmentRoot **pRetVal);\r\n\r\n    //IRawElementProviderFragmentRoot\r\n    HRESULT STDMETHODCALLTYPE ElementProviderFromPoint(double,double,IRawElementProviderFragment **);\r\n    HRESULT STDMETHODCALLTYPE GetFocus(IRawElementProviderFragment **);\r\n\r\nprivate:\r\n    IRawElementProviderFragment* GetElementFromPoint(double,double,IRawElementProviderFragment *);\r\n};\r\n\r\n"
  },
  {
    "path": "src/uia/StartPageProvider.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n#include \"BaseUtil.h\"\r\n#include <UIAutomationCore.h>\r\n#include <UIAutomationCoreApi.h>\r\n#include \"uia/StartPageProvider.h\"\r\n#include \"uia/Constants.h\"\r\n#include \"uia/Provider.h\"\r\n\r\nSumatraUIAutomationStartPageProvider::SumatraUIAutomationStartPageProvider(HWND canvasHwnd, SumatraUIAutomationProvider* root) :\r\n    refCount(1), canvasHwnd(canvasHwnd), root(root)\r\n{\r\n    //root->AddRef(); Don't add refs to our parent & owner.\r\n}\r\n\r\nSumatraUIAutomationStartPageProvider::~SumatraUIAutomationStartPageProvider()\r\n{\r\n}\r\n\r\n// IUnknown\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationStartPageProvider::QueryInterface(REFIID riid, void **ppv)\r\n{\r\n    static const QITAB qit[] = {\r\n        QITABENT(SumatraUIAutomationStartPageProvider, IRawElementProviderSimple),\r\n        QITABENT(SumatraUIAutomationStartPageProvider, IRawElementProviderFragment),\r\n        { 0 }\r\n    };\r\n    return QISearch(this, qit, riid, ppv);\r\n}\r\n\r\nULONG STDMETHODCALLTYPE SumatraUIAutomationStartPageProvider::AddRef(void)\r\n{\r\n    return InterlockedIncrement(&refCount);\r\n}\r\n\r\nULONG STDMETHODCALLTYPE SumatraUIAutomationStartPageProvider::Release(void)\r\n{\r\n    LONG res = InterlockedDecrement(&refCount);\r\n    CrashIf(res < 0);\r\n    if (0 == res)\r\n        delete this;\r\n    return res;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationStartPageProvider::Navigate(enum NavigateDirection direction, IRawElementProviderFragment **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    *pRetVal = nullptr;\r\n    // no siblings, no children\r\n    if (direction == NavigateDirection_NextSibling ||\r\n        direction == NavigateDirection_PreviousSibling ||\r\n        direction == NavigateDirection_FirstChild ||\r\n        direction == NavigateDirection_LastChild) {\r\n        return S_OK;\r\n    } else if (direction == NavigateDirection_Parent) {\r\n        *pRetVal = root;\r\n        (*pRetVal)->AddRef();\r\n        return S_OK;\r\n    } else {\r\n        return E_INVALIDARG;\r\n    }\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationStartPageProvider::GetRuntimeId(SAFEARRAY **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    SAFEARRAY *psa = SafeArrayCreateVector(VT_I4, 0, 2);\r\n    if (!psa)\r\n        return E_OUTOFMEMORY;\r\n\r\n    // RuntimeID magic, use hwnd to differentiate providers of different windows\r\n    int rId[] = { (int)canvasHwnd, SUMATRA_UIA_STARTPAGE_RUNTIME_ID };\r\n    for (LONG i = 0; i < 2; i++) {\r\n        HRESULT hr = SafeArrayPutElement(psa, &i, (void*)&(rId[i]));\r\n        CrashIf(FAILED(hr));\r\n    }\r\n\r\n    *pRetVal = psa;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationStartPageProvider::GetEmbeddedFragmentRoots(SAFEARRAY **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    // no other roots => return nullptr\r\n    *pRetVal = nullptr;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationStartPageProvider::SetFocus(void)\r\n{\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationStartPageProvider::get_BoundingRectangle(struct UiaRect *pRetVal)\r\n{\r\n    // share area with the canvas uia provider\r\n    return root->get_BoundingRectangle(pRetVal);\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationStartPageProvider::get_FragmentRoot(IRawElementProviderFragmentRoot **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n\r\n    *pRetVal = root;\r\n    root->AddRef();\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationStartPageProvider::GetPatternProvider(PATTERNID patternId,IUnknown **pRetVal)\r\n{\r\n    UNUSED(patternId);\r\n    *pRetVal = nullptr;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationStartPageProvider::GetPropertyValue(PROPERTYID propertyId,VARIANT *pRetVal)\r\n{\r\n    if (propertyId == UIA_NamePropertyId) {\r\n        pRetVal->vt = VT_BSTR;\r\n        pRetVal->bstrVal = SysAllocString(L\"Start Page\");\r\n        return S_OK;\r\n    }\r\n\r\n    pRetVal->vt = VT_EMPTY;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationStartPageProvider::get_HostRawElementProvider(IRawElementProviderSimple **pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n    *pRetVal = nullptr;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationStartPageProvider::get_ProviderOptions(ProviderOptions *pRetVal)\r\n{\r\n    if (pRetVal == nullptr)\r\n        return E_POINTER;\r\n    *pRetVal = ProviderOptions_ServerSideProvider;\r\n    return S_OK;\r\n}\r\n"
  },
  {
    "path": "src/uia/StartPageProvider.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nclass SumatraUIAutomationProvider;\r\nclass SumatraUIAutomationStartPageProvider : public IRawElementProviderFragment, public IRawElementProviderSimple {\r\n    LONG                         refCount;\r\n    HWND                         canvasHwnd;\r\n    SumatraUIAutomationProvider* root;\r\n\r\npublic:\r\n    SumatraUIAutomationStartPageProvider(HWND canvasHwnd, SumatraUIAutomationProvider* root);\r\n    ~SumatraUIAutomationStartPageProvider();\r\n    \r\n    //IUnknown\r\n    HRESULT STDMETHODCALLTYPE QueryInterface(const IID &,void **);\r\n    ULONG   STDMETHODCALLTYPE AddRef(void);\r\n    ULONG   STDMETHODCALLTYPE Release(void);\r\n    \r\n    //IRawElementProviderFragment\r\n    HRESULT STDMETHODCALLTYPE Navigate(enum NavigateDirection direction, IRawElementProviderFragment **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE GetRuntimeId(SAFEARRAY **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE GetEmbeddedFragmentRoots(SAFEARRAY **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE SetFocus(void);\r\n    HRESULT STDMETHODCALLTYPE get_BoundingRectangle(struct UiaRect *pRetVal);\r\n    HRESULT STDMETHODCALLTYPE get_FragmentRoot(IRawElementProviderFragmentRoot **pRetVal);\r\n\r\n    //IRawElementProviderSimple\r\n    HRESULT STDMETHODCALLTYPE GetPatternProvider(PATTERNID patternId,IUnknown **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE GetPropertyValue(PROPERTYID propertyId,VARIANT *pRetVal);\r\n    HRESULT STDMETHODCALLTYPE get_HostRawElementProvider(IRawElementProviderSimple **pRetVal);\r\n    HRESULT STDMETHODCALLTYPE get_ProviderOptions(ProviderOptions *pRetVal);\r\n};\r\n"
  },
  {
    "path": "src/uia/TextRange.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"WinDynCalls.h\"\r\n#include \"BaseEngine.h\"\r\n#include \"uia/TextRange.h\"\r\n#include \"SettingsStructs.h\"\r\n#include \"Controller.h\"\r\n#include \"EngineManager.h\"\r\n#include \"DisplayModel.h\"\r\n#include \"uia/DocumentProvider.h\"\r\n#include \"uia/Constants.h\"\r\n#include \"uia/PageProvider.h\"\r\n#include \"uia/Provider.h\"\r\n#include \"TextSelection.h\"\r\n\r\nSumatraUIAutomationTextRange::SumatraUIAutomationTextRange(SumatraUIAutomationDocumentProvider* document) :\r\n    refCount(1), document(document)\r\n{\r\n    document->AddRef();\r\n\r\n    SetToNullRange();\r\n}\r\n\r\nSumatraUIAutomationTextRange::SumatraUIAutomationTextRange(SumatraUIAutomationDocumentProvider* document, int pageNum) :\r\n    refCount(1), document(document)\r\n{\r\n    document->AddRef();\r\n\r\n    startPage = pageNum;\r\n    startGlyph = 0;\r\n    endPage = pageNum;\r\n    endGlyph = GetPageGlyphCount(pageNum);\r\n}\r\n\r\nSumatraUIAutomationTextRange::SumatraUIAutomationTextRange(SumatraUIAutomationDocumentProvider* document, TextSelection* range) :\r\n    refCount(1), document(document)\r\n{\r\n    document->AddRef();\r\n\r\n    range->GetGlyphRange(&startPage, &startGlyph, &endPage, &endGlyph);\r\n    // null-range check\r\n    if (startPage == -1 || endPage == -1) {\r\n        SetToNullRange();\r\n    }\r\n}\r\n\r\nSumatraUIAutomationTextRange::SumatraUIAutomationTextRange(const SumatraUIAutomationTextRange&b) :\r\n    refCount(1), document(b.document)\r\n{\r\n    document->AddRef();\r\n\r\n    startPage = b.startPage;\r\n    startGlyph = b.startGlyph;\r\n    endPage = b.endPage;\r\n    endGlyph = b.endGlyph;\r\n}\r\n\r\nSumatraUIAutomationTextRange::~SumatraUIAutomationTextRange()\r\n{\r\n    document->Release();\r\n}\r\n\r\nbool SumatraUIAutomationTextRange::operator==(const SumatraUIAutomationTextRange&b) const\r\n{\r\n    return  document == b.document &&\r\n            startPage == b.startPage && endPage == b.endPage &&\r\n            startGlyph == b.startGlyph && endGlyph == b.endGlyph;\r\n}\r\n\r\nvoid SumatraUIAutomationTextRange::SetToDocumentRange()\r\n{\r\n    startPage = 1;\r\n    startGlyph = 0;\r\n    endPage = document->GetDM()->PageCount();\r\n    endGlyph = GetPageGlyphCount(endPage);\r\n}\r\n\r\nvoid SumatraUIAutomationTextRange::SetToNullRange()\r\n{\r\n    startPage = -1;\r\n    startGlyph = 0;\r\n    endPage = -1;\r\n    endGlyph = 0;\r\n}\r\n\r\nbool SumatraUIAutomationTextRange::IsNullRange() const\r\n{\r\n    return (startPage == -1 && endPage == -1);\r\n}\r\n\r\nbool SumatraUIAutomationTextRange::IsEmptyRange() const\r\n{\r\n    return (startPage == endPage && startGlyph == endGlyph);\r\n}\r\n\r\nint SumatraUIAutomationTextRange::GetPageGlyphCount(int pageNum)\r\n{\r\n    AssertCrash(document->IsDocumentLoaded());\r\n    AssertCrash(pageNum > 0);\r\n\r\n    int pageLen;\r\n    document->GetDM()->textCache->GetData(pageNum, &pageLen);\r\n    return pageLen;\r\n}\r\n\r\nint SumatraUIAutomationTextRange::GetPageCount()\r\n{\r\n    AssertCrash(document->IsDocumentLoaded());\r\n\r\n    return document->GetDM()->PageCount();\r\n}\r\n\r\nvoid SumatraUIAutomationTextRange::ValidateStartEndpoint()\r\n{\r\n    // ensure correct ordering of endpoints\r\n    if (startPage > endPage || (startPage == endPage && startGlyph > endGlyph)) {\r\n        startPage = endPage;\r\n        startGlyph = endGlyph;\r\n    }\r\n}\r\n\r\nvoid SumatraUIAutomationTextRange::ValidateEndEndpoint()\r\n{\r\n    // ensure correct ordering of endpoints\r\n    if (startPage > endPage || (startPage == endPage && startGlyph > endGlyph)) {\r\n        endPage = startPage;\r\n        endGlyph = startGlyph;\r\n    }\r\n}\r\n\r\nint SumatraUIAutomationTextRange::FindPreviousWordEndpoint(int pageno, int idx, bool dontReturnInitial)\r\n{\r\n    // based on TextSelection::SelectWordAt\r\n    int textLen;\r\n    const WCHAR *pageText = document->GetDM()->textCache->GetData(pageno, &textLen);\r\n\r\n    if (dontReturnInitial) {\r\n        for (; idx > 0; idx--) {\r\n            if (isWordChar(pageText[idx - 1]))\r\n                break;\r\n        }\r\n    }\r\n\r\n    for (; idx > 0; idx--) {\r\n        if (!isWordChar(pageText[idx - 1]))\r\n            break;\r\n    }\r\n    return idx;\r\n}\r\n\r\nint SumatraUIAutomationTextRange::FindNextWordEndpoint(int pageno, int idx, bool dontReturnInitial)\r\n{\r\n    int textLen;\r\n    const WCHAR *pageText = document->GetDM()->textCache->GetData(pageno, &textLen);\r\n\r\n    if (dontReturnInitial) {\r\n        for (; idx < textLen; idx++) {\r\n            if (isWordChar(pageText[idx]))\r\n                break;\r\n        }\r\n    }\r\n\r\n    for (; idx < textLen; idx++) {\r\n        if (!isWordChar(pageText[idx]))\r\n            break;\r\n    }\r\n    return idx;\r\n}\r\n\r\nint SumatraUIAutomationTextRange::FindPreviousLineEndpoint(int pageno, int idx, bool dontReturnInitial)\r\n{\r\n    int textLen;\r\n    const WCHAR *pageText = document->GetDM()->textCache->GetData(pageno, &textLen);\r\n\r\n    if (dontReturnInitial)\r\n    {\r\n        for (; idx > 0; idx--)\r\n        {\r\n            if (pageText[idx - 1] != L'\\n')\r\n                break;\r\n        }\r\n    }\r\n\r\n    for (; idx > 0; idx--)\r\n    {\r\n        if (pageText[idx - 1] == L'\\n')\r\n            break;\r\n    }\r\n    return idx;\r\n}\r\n\r\nint SumatraUIAutomationTextRange::FindNextLineEndpoint(int pageno, int idx, bool dontReturnInitial)\r\n{\r\n    int textLen;\r\n    const WCHAR *pageText = document->GetDM()->textCache->GetData(pageno, &textLen);\r\n\r\n    if (dontReturnInitial) {\r\n        for (; idx < textLen; idx++)\r\n        {\r\n            if (pageText[idx] != L'\\n')\r\n                break;\r\n        }\r\n    }\r\n\r\n    for (; idx < textLen; idx++)\r\n    {\r\n        if (pageText[idx] == L'\\n')\r\n            break;\r\n    }\r\n    return idx;\r\n}\r\n\r\n// IUnknown\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationTextRange::QueryInterface(REFIID riid, void **ppv)\r\n{\r\n    static const QITAB qit[] = {\r\n        QITABENT(SumatraUIAutomationTextRange, ITextRangeProvider),\r\n        { 0 }\r\n    };\r\n    return QISearch(this, qit, riid, ppv);\r\n}\r\n\r\nULONG STDMETHODCALLTYPE SumatraUIAutomationTextRange::AddRef(void)\r\n{\r\n    return InterlockedIncrement(&refCount);\r\n}\r\n\r\nULONG STDMETHODCALLTYPE SumatraUIAutomationTextRange::Release(void)\r\n{\r\n    LONG res = InterlockedDecrement(&refCount);\r\n    CrashIf(res < 0);\r\n    if (0 == res)\r\n        delete this;\r\n    return res;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationTextRange::Clone(ITextRangeProvider **clonedRange)\r\n{\r\n    if (clonedRange == nullptr)\r\n        return E_POINTER;\r\n    *clonedRange = new SumatraUIAutomationTextRange(*this);\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationTextRange::Compare(ITextRangeProvider *range, BOOL *areSame)\r\n{\r\n    if (areSame == nullptr)\r\n        return E_POINTER;\r\n    if (range == nullptr)\r\n        return E_POINTER;\r\n    // TODO: is range guaranteed to be a SumatraUIAutomationTextRange?\r\n    if (*((SumatraUIAutomationTextRange*)range) == *this)\r\n        *areSame = TRUE;\r\n    else\r\n        *areSame = FALSE;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationTextRange::CompareEndpoints(enum TextPatternRangeEndpoint srcEndPoint, ITextRangeProvider *range, enum TextPatternRangeEndpoint targetEndPoint, int *compValue)\r\n{\r\n    if (range == nullptr)\r\n        return E_POINTER;\r\n    if (compValue == nullptr)\r\n        return E_POINTER;\r\n\r\n    int comp_a_page, comp_a_idx;\r\n    if (srcEndPoint == TextPatternRangeEndpoint_Start) {\r\n        comp_a_page = this->startPage;\r\n        comp_a_idx = this->startGlyph;\r\n    } else if (srcEndPoint == TextPatternRangeEndpoint_End) {\r\n        comp_a_page = this->endPage;\r\n        comp_a_idx = this->endGlyph;\r\n    } else {\r\n        return E_INVALIDARG;\r\n    }\r\n\r\n    // TODO: is range guaranteed to be a SumatraUIAutomationTextRange?\r\n    SumatraUIAutomationTextRange* target = (SumatraUIAutomationTextRange*)range;\r\n\r\n    int comp_b_page, comp_b_idx;\r\n    if (targetEndPoint == TextPatternRangeEndpoint_Start) {\r\n        comp_b_page = target->startPage;\r\n        comp_b_idx = target->startGlyph;\r\n    } else if (targetEndPoint == TextPatternRangeEndpoint_End) {\r\n        comp_b_page = target->endPage;\r\n        comp_b_idx = target->endGlyph;\r\n    } else {\r\n        return E_INVALIDARG;\r\n    }\r\n\r\n    if (comp_a_page < comp_b_page)\r\n        *compValue = -1;\r\n    else if (comp_a_page > comp_b_page)\r\n        *compValue = 1;\r\n    else\r\n        *compValue = comp_a_idx - comp_b_idx;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationTextRange::ExpandToEnclosingUnit(enum TextUnit textUnit)\r\n{\r\n    //if document is closed, don't do anything\r\n    if (!document->IsDocumentLoaded())\r\n        return E_FAIL;\r\n\r\n    //if not set, don't do anything\r\n    if (IsNullRange())\r\n        return S_OK;\r\n\r\n    if (textUnit == TextUnit_Character)  {\r\n        //done\r\n        return S_OK;\r\n    } else if (textUnit == TextUnit_Format) {\r\n        // what is a \"format\" anyway?\r\n        return S_OK;\r\n    } else if (textUnit == TextUnit_Word) {\r\n        // select current word at start endpoint\r\n        int word_beg = FindPreviousWordEndpoint(startPage, startGlyph);\r\n        int word_end = FindNextWordEndpoint(startPage, startGlyph);\r\n\r\n        endPage = startPage;\r\n\r\n        startGlyph = word_beg;\r\n        endGlyph = word_end;\r\n\r\n        return S_OK;\r\n    } else if (textUnit == TextUnit_Line || textUnit == TextUnit_Paragraph) {\r\n        // select current line or current paragraph. In general case these cannot be differentiated? Right?\r\n        int word_beg = FindPreviousLineEndpoint(startPage, startGlyph);\r\n        int word_end = FindNextLineEndpoint(startPage, startGlyph);\r\n\r\n        endPage = startPage;\r\n\r\n        startGlyph = word_beg;\r\n        endGlyph = word_end;\r\n\r\n        return S_OK;\r\n    } else if (textUnit == TextUnit_Page) {\r\n        // select current page\r\n\r\n        // start from the beginning of start page\r\n        startGlyph = 0;\r\n\r\n        // to the end of the end page\r\n        endGlyph = GetPageGlyphCount(endPage);\r\n\r\n        return S_OK;\r\n    } else if (textUnit == TextUnit_Document) {\r\n        SetToDocumentRange();\r\n        return S_OK;\r\n    } else {\r\n        return E_INVALIDARG;\r\n    }\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationTextRange::FindAttribute(TEXTATTRIBUTEID attr, VARIANT val, BOOL backward, ITextRangeProvider **found)\r\n{\r\n    UNUSED(attr); UNUSED(val); UNUSED(backward);\r\n    if (found == nullptr)\r\n        return E_POINTER;\r\n    if (!document->IsDocumentLoaded())\r\n        return E_FAIL;\r\n\r\n    // raw text doesn't have attributes so just don't find anything\r\n    *found = nullptr;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationTextRange::FindText(BSTR text, BOOL backward, BOOL ignoreCase, ITextRangeProvider **found)\r\n{\r\n    UNUSED(text); UNUSED(backward); UNUSED(ignoreCase);\r\n    if (found == nullptr)\r\n        return E_POINTER;\r\n    if (!document->IsDocumentLoaded())\r\n        return E_FAIL;\r\n\r\n    //TODO: Support text searching\r\n    return E_NOTIMPL;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationTextRange::GetAttributeValue(TEXTATTRIBUTEID attr, VARIANT *value)\r\n{\r\n    UNUSED(attr);\r\n    if (value == nullptr)\r\n        return E_POINTER;\r\n    if (!document->IsDocumentLoaded())\r\n        return E_FAIL;\r\n\r\n    // text doesn't have attributes, we don't support those\r\n    IUnknown* not_supported = nullptr;\r\n    HRESULT hr = uia::GetReservedNotSupportedValue(&not_supported);\r\n    if (FAILED(hr))\r\n        return hr;\r\n\r\n    value->vt = VT_UNKNOWN;\r\n    value->punkVal = not_supported;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationTextRange::GetBoundingRectangles(SAFEARRAY * *boundingRects)\r\n{\r\n    if (boundingRects == nullptr)\r\n        return E_POINTER;\r\n    if (!document->IsDocumentLoaded())\r\n        return E_FAIL;\r\n\r\n    if (IsNullRange()) {\r\n        SAFEARRAY* sarray = SafeArrayCreateVector(VT_R8,0,0);\r\n        if (!sarray)\r\n            return E_OUTOFMEMORY;\r\n\r\n        *boundingRects = sarray;\r\n        return S_OK;\r\n    }\r\n\r\n    // TODO: support GetBoundingRectangles\r\n    return E_NOTIMPL;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationTextRange::GetEnclosingElement(IRawElementProviderSimple **enclosingElement)\r\n{\r\n    if (enclosingElement == nullptr)\r\n        return E_POINTER;\r\n    if (!document->IsDocumentLoaded())\r\n        return E_FAIL;\r\n\r\n    *enclosingElement = document;\r\n    (*enclosingElement)->AddRef();\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationTextRange::GetText(int maxLength, BSTR *text)\r\n{\r\n    if (text == nullptr)\r\n        return E_POINTER;\r\n    if (!document->IsDocumentLoaded())\r\n        return E_FAIL;\r\n\r\n    if (IsNullRange() || IsEmptyRange()) {\r\n        *text = SysAllocString(L\"\"); // 0-sized not-null string\r\n        return S_OK;\r\n    }\r\n\r\n    TextSelection selection(document->GetDM()->GetEngine(), document->GetDM()->textCache);\r\n    selection.StartAt(startPage, startGlyph);\r\n    selection.SelectUpTo(endPage, endGlyph);\r\n\r\n    ScopedMem<WCHAR> selected_text(selection.ExtractText(L\"\\r\\n\"));\r\n    size_t selected_text_length = str::Len(selected_text);\r\n\r\n    // -1 and [0, inf) are allowed\r\n    if (maxLength > -2) {\r\n        if (maxLength != -1 && selected_text_length > (size_t)maxLength)\r\n            selected_text[maxLength] = '\\0'; // truncate\r\n\r\n        *text = SysAllocString(selected_text);\r\n        if (*text)\r\n            return S_OK;\r\n        else\r\n            return E_OUTOFMEMORY;\r\n    } else {\r\n        return E_INVALIDARG;\r\n    }\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationTextRange::Move(enum TextUnit unit,int count, int *moved)\r\n{\r\n    if (moved == nullptr)\r\n        return E_POINTER;\r\n\r\n    // if document is closed, don't do anything\r\n    if (!document->IsDocumentLoaded())\r\n        return E_FAIL;\r\n\r\n    // Just move the endpoints using other methods\r\n    *moved = 0;\r\n    this->ExpandToEnclosingUnit(unit);\r\n\r\n    if (count > 0) {\r\n        for (int i=0;i<count;++i) {\r\n            int sub_moved;\r\n            this->MoveEndpointByUnit(TextPatternRangeEndpoint_End, unit, 1, &sub_moved);\r\n\r\n            // Move end first, other will succeed if this succeeds\r\n            if (sub_moved == 0)\r\n                break;\r\n\r\n            this->MoveEndpointByUnit(TextPatternRangeEndpoint_Start, unit, 1, &sub_moved);\r\n            ++*moved;\r\n        }\r\n    } else if (count < 0) {\r\n        for (int i=0;i<-count;++i) {\r\n            int sub_moved;\r\n            this->MoveEndpointByUnit(TextPatternRangeEndpoint_Start, unit, -1, &sub_moved);\r\n\r\n            // Move start first, other will succeed if this succeeds\r\n            if (sub_moved == 0)\r\n                break;\r\n\r\n            this->MoveEndpointByUnit(TextPatternRangeEndpoint_End, unit, -1, &sub_moved);\r\n            ++*moved;\r\n        }\r\n    }\r\n\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationTextRange::MoveEndpointByUnit(TextPatternRangeEndpoint endpoint, TextUnit unit, int count, int *moved)\r\n{\r\n    if (moved == nullptr)\r\n        return E_POINTER;\r\n\r\n    // if document is closed, don't do anything\r\n    if (!document->IsDocumentLoaded())\r\n        return E_FAIL;\r\n\r\n    // if not set, don't do anything\r\n    if (IsNullRange())\r\n        return S_OK;\r\n\r\n    // what to move\r\n    int *target_page, *target_glyph;\r\n    if (endpoint == TextPatternRangeEndpoint_Start) {\r\n        target_page = &startPage;\r\n        target_glyph = &startGlyph;\r\n    } else if (endpoint == TextPatternRangeEndpoint_End) {\r\n        target_page = &endPage;\r\n        target_glyph = &endGlyph;\r\n    } else {\r\n        return E_INVALIDARG;\r\n    }\r\n\r\n    class EndPointMover {\r\n    protected:\r\n        SumatraUIAutomationTextRange* target;\r\n        int* target_page;\r\n        int* target_glyph;\r\n\r\n    public:\r\n        // return false when cannot be moved\r\n        virtual bool NextEndpoint() const {\r\n            // HACK: Declaring these as pure virtual causes \"unreferenced local variable\" warnings ==> define a dummy body to get rid of warnings\r\n            CrashIf(true);\r\n            return false;\r\n        }\r\n        virtual bool PrevEndpoint() const {\r\n            CrashIf(true);\r\n            return false;\r\n        }\r\n\r\n        // return false when not appliable\r\n        bool NextPage() const {\r\n            int max_glyph = target->GetPageGlyphCount(*target_page);\r\n\r\n            if (*target_glyph == max_glyph) {\r\n                if (*target_page == target->GetPageCount()) {\r\n                    // last page\r\n                    return false;\r\n                }\r\n\r\n                // go to next page\r\n                (*target_page)++;\r\n                (*target_glyph) = 0;\r\n            }\r\n            return true;\r\n        }\r\n        bool PreviousPage() const {\r\n            if (*target_glyph == 0) {\r\n                if (*target_page == 1) {\r\n                    // first page\r\n                    return false;\r\n                }\r\n\r\n                // go to next page\r\n                (*target_page)--;\r\n                (*target_glyph) = target->GetPageGlyphCount(*target_page);\r\n            }\r\n            return true;\r\n        }\r\n\r\n        // do the moving\r\n        int Move(int count, SumatraUIAutomationTextRange* target, int* target_page, int* target_glyph) {\r\n            this->target = target;\r\n            this->target_page = target_page;\r\n            this->target_glyph = target_glyph;\r\n\r\n            int retVal = 0;\r\n            if (count > 0) {\r\n                for (int i=0;i<count && (NextPage() || NextEndpoint());++i)\r\n                    ++retVal;\r\n            } else {\r\n                for (int i=0;i<-count && (PreviousPage() || PrevEndpoint());++i)\r\n                    ++retVal;\r\n            }\r\n\r\n            return retVal;\r\n        }\r\n    };\r\n    class CharEndPointMover : public EndPointMover {\r\n        bool NextEndpoint() const  {\r\n            (*target_glyph)++;\r\n            return true;\r\n        }\r\n        bool PrevEndpoint() const  {\r\n            (*target_glyph)--;\r\n            return true;\r\n        }\r\n    };\r\n    class WordEndPointMover : public EndPointMover {\r\n        bool NextEndpoint() const  {\r\n            (*target_glyph) = target->FindNextWordEndpoint(*target_page, *target_glyph, true);\r\n            return true;\r\n        }\r\n        bool PrevEndpoint() const  {\r\n            (*target_glyph) = target->FindPreviousWordEndpoint(*target_page, *target_glyph, true);\r\n            (*target_glyph)--;\r\n            return true;\r\n        }\r\n    };\r\n    class LineEndPointMover : public EndPointMover {\r\n        bool NextEndpoint() const  {\r\n            (*target_glyph) = target->FindNextLineEndpoint(*target_page, *target_glyph, true);\r\n            return true;\r\n        }\r\n        bool PrevEndpoint() const  {\r\n            (*target_glyph) = target->FindPreviousLineEndpoint(*target_page, *target_glyph, true);\r\n            (*target_glyph)--;\r\n            return true;\r\n        }\r\n    };\r\n\r\n    // how much to move\r\n    if (unit == TextUnit_Character) {\r\n        CharEndPointMover mover;\r\n        *moved = mover.Move(count, this, target_page, target_glyph);\r\n    } else if (unit == TextUnit_Word || unit == TextUnit_Format) {\r\n        WordEndPointMover mover;\r\n        *moved = mover.Move(count, this, target_page, target_glyph);\r\n    } else if (unit == TextUnit_Line || unit == TextUnit_Paragraph) {\r\n        LineEndPointMover mover;\r\n        *moved = mover.Move(count, this, target_page, target_glyph);\r\n    } else if (unit == TextUnit_Page) {\r\n        *moved = 0;\r\n        *target_glyph = 0;\r\n\r\n        if (count > 0) {\r\n            // GetPageCount()+1 => allow overflow momentarily\r\n            for (int i=0;i<count && *target_page!=GetPageCount()+1;++i) {\r\n                (*target_page)++;\r\n                (*moved)++;\r\n            }\r\n\r\n            // fix overflow, allow seeking to the end this way\r\n            if (*target_page == GetPageCount()+1) {\r\n                *target_page = GetPageCount();\r\n                *target_glyph = GetPageGlyphCount(*target_page);\r\n            }\r\n        } else {\r\n            for (int i=0;i<-count && *target_page!=1;++i) {\r\n                (*target_page)--;\r\n                (*moved)++;\r\n            }\r\n        }\r\n    } else if (unit == TextUnit_Document) {\r\n        if (count > 0) {\r\n            int end_page = GetPageCount();\r\n            int end_glyph = GetPageGlyphCount(*target_page);\r\n\r\n            if (*target_page != end_page || *target_glyph != end_glyph) {\r\n                *target_page = end_page;\r\n                *target_glyph = end_glyph;\r\n                *moved = 1;\r\n            } else {\r\n                *moved = 0;\r\n            }\r\n        } else {\r\n            const int beg_page = 0;\r\n            const int beg_glyph = 0;\r\n\r\n            if (*target_page != beg_page || *target_glyph != beg_glyph) {\r\n                *target_page = beg_page;\r\n                *target_glyph = beg_glyph;\r\n                *moved = 1;\r\n            } else {\r\n                *moved = 0;\r\n            }\r\n        }\r\n    } else {\r\n        return E_INVALIDARG;\r\n    }\r\n\r\n    // keep range valid\r\n    if (endpoint == TextPatternRangeEndpoint_Start) {\r\n        // drag end with start\r\n        ValidateEndEndpoint();\r\n    } else if (endpoint == TextPatternRangeEndpoint_End) {\r\n        // drag start with end\r\n        ValidateStartEndpoint();\r\n    }\r\n\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationTextRange::MoveEndpointByRange(TextPatternRangeEndpoint srcEndPoint, ITextRangeProvider *range, TextPatternRangeEndpoint targetEndPoint)\r\n{\r\n    if (range == nullptr)\r\n        return E_POINTER;\r\n\r\n    // TODO: is range guaranteed to be a SumatraUIAutomationTextRange?\r\n    SumatraUIAutomationTextRange* target = (SumatraUIAutomationTextRange*)range;\r\n\r\n    // extract target location\r\n    int target_page, target_idx;\r\n    if (targetEndPoint == TextPatternRangeEndpoint_Start) {\r\n        target_page = target->startPage;\r\n        target_idx = target->startGlyph;\r\n    } else if (targetEndPoint == TextPatternRangeEndpoint_End) {\r\n        target_page = target->endPage;\r\n        target_idx = target->endGlyph;\r\n    } else {\r\n        return E_INVALIDARG;\r\n    }\r\n\r\n    // apply\r\n    if (srcEndPoint == TextPatternRangeEndpoint_Start) {\r\n        startPage = target_page;\r\n        startGlyph = target_idx;\r\n\r\n        // drag end with start\r\n        ValidateEndEndpoint();\r\n    } else if (srcEndPoint == TextPatternRangeEndpoint_End) {\r\n        endPage = target_page;\r\n        endGlyph = target_idx;\r\n\r\n        // drag start with end\r\n        ValidateStartEndpoint();\r\n    } else {\r\n        return E_INVALIDARG;\r\n    }\r\n\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationTextRange::Select(void)\r\n{\r\n    if (!document->IsDocumentLoaded())\r\n        return E_FAIL;\r\n\r\n    if (IsNullRange() || IsEmptyRange()) {\r\n        document->GetDM()->textSelection->Reset();\r\n    } else {\r\n        document->GetDM()->textSelection->Reset();\r\n        document->GetDM()->textSelection->StartAt(startPage, startGlyph);\r\n        document->GetDM()->textSelection->SelectUpTo(endPage, endGlyph);\r\n    }\r\n\r\n    return S_OK;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationTextRange::AddToSelection(void)\r\n{\r\n    return E_FAIL;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationTextRange::RemoveFromSelection(void)\r\n{\r\n    return E_FAIL;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationTextRange::ScrollIntoView(BOOL alignToTop)\r\n{\r\n    if (!document->IsDocumentLoaded())\r\n        return E_FAIL;\r\n\r\n    // extract target location\r\n    int target_page, target_idx;\r\n    if (IsNullRange()) {\r\n        target_page = 0;\r\n        target_idx = 0;\r\n    } else if (alignToTop) {\r\n        target_page = startPage;\r\n        target_idx = startGlyph;\r\n    } else {\r\n        target_page = endPage;\r\n        target_idx = endGlyph;\r\n    }\r\n\r\n    // TODO: Scroll to target_page, target_idx\r\n    //document->GetDM()->ScrollYTo()\r\n    return E_NOTIMPL;\r\n}\r\n\r\nHRESULT STDMETHODCALLTYPE SumatraUIAutomationTextRange::GetChildren(SAFEARRAY **children)\r\n{\r\n    if (children == nullptr)\r\n        return E_POINTER;\r\n    if (!document->IsDocumentLoaded())\r\n        return E_FAIL;\r\n\r\n    // return all children in range\r\n    if (IsNullRange()) {\r\n        SAFEARRAY *psa = SafeArrayCreateVector(VT_UNKNOWN, 0, 0);\r\n        if (!psa)\r\n            return E_OUTOFMEMORY;\r\n\r\n        *children = psa;\r\n        return S_OK;\r\n    }\r\n\r\n    SAFEARRAY *psa = SafeArrayCreateVector(VT_UNKNOWN, 0, endPage - startPage + 1);\r\n    if (!psa)\r\n        return E_OUTOFMEMORY;\r\n\r\n    SumatraUIAutomationPageProvider* it = document->GetFirstPage();\r\n    while (it) {\r\n        if (it->GetPageNum() >= startPage || it->GetPageNum() <= endPage) {\r\n            LONG index = it->GetPageNum() - startPage;\r\n\r\n            HRESULT hr = SafeArrayPutElement(psa, &index, it);\r\n            CrashIf(FAILED(hr));\r\n            it->AddRef();\r\n        }\r\n\r\n        it = it->GetNextPage();\r\n    }\r\n\r\n    *children = psa;\r\n    return S_OK;\r\n}\r\n"
  },
  {
    "path": "src/uia/TextRange.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: GPLv3 */\r\n\r\nclass TextSelection;\r\nclass SumatraUIAutomationDocumentProvider;\r\n\r\nclass SumatraUIAutomationTextRange : public ITextRangeProvider {\r\n    LONG refCount;\r\n\r\n    // used for getting dm and document state (== is document closed == dm is invalid)\r\n    // text range will hold reference to document to prevent it from being removed\r\n    SumatraUIAutomationDocumentProvider* document;\r\n    \r\n    // TODO: this part is very much like TextSelection. Merge them somehow?\r\n    // TODO: extend TextSelection to make these unnecessary\r\n    int startPage, endPage;\r\n    int startGlyph, endGlyph;\r\npublic:\r\n    // creates empty range\r\n    SumatraUIAutomationTextRange(SumatraUIAutomationDocumentProvider* document);\r\n    // creates range containing the given page\r\n    SumatraUIAutomationTextRange(SumatraUIAutomationDocumentProvider* document, int pageNum);\r\n    // creates range containing the given TextSelection range\r\n    SumatraUIAutomationTextRange(SumatraUIAutomationDocumentProvider* document, TextSelection* range);\r\n    // creates a copy of give range\r\n    SumatraUIAutomationTextRange(const SumatraUIAutomationTextRange&);\r\n    ~SumatraUIAutomationTextRange();\r\n\r\n    bool operator==(const SumatraUIAutomationTextRange&) const;\r\n\r\n    void SetToDocumentRange();\r\n    void SetToNullRange();\r\n    bool IsNullRange() const;\r\n    bool IsEmptyRange() const;\r\n\r\n    int GetPageGlyphCount(int pageNum);\r\n    int GetPageCount();\r\n\r\n    void ValidateStartEndpoint();\r\n    void ValidateEndEndpoint();\r\n\r\n    int FindPreviousWordEndpoint(int pageno, int idx, bool dontReturnInitial=false);\r\n    int FindNextWordEndpoint(int pageno, int idx, bool dontReturnInitial=false);\r\n    int FindPreviousLineEndpoint(int pageno, int idx, bool dontReturnInitial=false);\r\n    int FindNextLineEndpoint(int pageno, int idx, bool dontReturnInitial=false);\r\n\r\n    //IUnknown\r\n    HRESULT STDMETHODCALLTYPE QueryInterface(const IID &,void **);\r\n    ULONG   STDMETHODCALLTYPE AddRef(void);\r\n    ULONG   STDMETHODCALLTYPE Release(void);\r\n    \r\n    //ITextRangeProvider\r\n    HRESULT STDMETHODCALLTYPE Clone(ITextRangeProvider **clonedRange);\r\n    HRESULT STDMETHODCALLTYPE Compare(ITextRangeProvider *range, BOOL *areSame);\r\n    HRESULT STDMETHODCALLTYPE CompareEndpoints(enum TextPatternRangeEndpoint srcEndPoint, ITextRangeProvider *range, enum TextPatternRangeEndpoint targetEndPoint, int *compValue);\r\n    HRESULT STDMETHODCALLTYPE ExpandToEnclosingUnit(enum TextUnit textUnit);\r\n    HRESULT STDMETHODCALLTYPE FindAttribute(TEXTATTRIBUTEID attr, VARIANT val, BOOL backward, ITextRangeProvider **found);\r\n    HRESULT STDMETHODCALLTYPE FindText(BSTR text, BOOL backward, BOOL ignoreCase, ITextRangeProvider **found);\r\n    HRESULT STDMETHODCALLTYPE GetAttributeValue(TEXTATTRIBUTEID attr, VARIANT *value);\r\n    HRESULT STDMETHODCALLTYPE GetBoundingRectangles(SAFEARRAY * *boundingRects);\r\n    HRESULT STDMETHODCALLTYPE GetEnclosingElement(IRawElementProviderSimple **enclosingElement);\r\n    HRESULT STDMETHODCALLTYPE GetText(int maxLength, BSTR *text);\r\n    HRESULT STDMETHODCALLTYPE Move(enum TextUnit unit,int count, int *moved);\r\n    HRESULT STDMETHODCALLTYPE MoveEndpointByUnit(TextPatternRangeEndpoint endpoint, TextUnit unit, int count, int *moved);\r\n    HRESULT STDMETHODCALLTYPE MoveEndpointByRange(TextPatternRangeEndpoint srcEndPoint, ITextRangeProvider *range, TextPatternRangeEndpoint targetEndPoint);\r\n    HRESULT STDMETHODCALLTYPE Select(void);\r\n    HRESULT STDMETHODCALLTYPE AddToSelection(void);\r\n    HRESULT STDMETHODCALLTYPE RemoveFromSelection(void);\r\n    HRESULT STDMETHODCALLTYPE ScrollIntoView(BOOL alignToTop);\r\n    HRESULT STDMETHODCALLTYPE GetChildren(SAFEARRAY **children);\r\n};\r\n"
  },
  {
    "path": "src/utils/ArchUtil.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"ArchUtil.h\"\r\n\r\nextern \"C\" {\r\n#include <unarr.h>\r\n}\r\n\r\n// if this is defined, SumatraPDF will look for unrar.dll in\r\n// the same directory as SumatraPDF.exe whenever a RAR archive\r\n// fails to open or extract and uses that as a fallback\r\n#define ENABLE_UNRARDLL_FALLBACK\r\n\r\n#ifdef ENABLE_UNRARDLL_FALLBACK\r\n#include \"FileUtil.h\"\r\n#endif\r\n\r\nArchFile::ArchFile(ar_stream *data, ar_archive *(* openFormat)(ar_stream *)) : data(data), ar(nullptr)\r\n{\r\n    if (data && openFormat)\r\n        ar = openFormat(data);\r\n    if (!ar)\r\n        return;\r\n    while (ar_parse_entry(ar)) {\r\n        const char *name = ar_entry_get_name(ar);\r\n        if (name)\r\n            filenames.Append(str::conv::FromUtf8(name));\r\n        else\r\n            filenames.Append(nullptr);\r\n        filepos.Append(ar_entry_get_offset(ar));\r\n    }\r\n    // extract (further) filenames with fallback in derived class constructor\r\n    // once GetFileFromFallback has been correctly set in the vtable\r\n}\r\n\r\nArchFile::~ArchFile()\r\n{\r\n    ar_close_archive(ar);\r\n    ar_close(data);\r\n}\r\n\r\nsize_t ArchFile::GetFileIndex(const WCHAR *fileName)\r\n{\r\n    return filenames.FindI(fileName);\r\n}\r\n\r\nsize_t ArchFile::GetFileCount() const\r\n{\r\n    CrashIf(filenames.Count() != filepos.Count());\r\n    return filenames.Count();\r\n}\r\n\r\nconst WCHAR *ArchFile::GetFileName(size_t fileindex)\r\n{\r\n    if (fileindex >= filenames.Count())\r\n        return nullptr;\r\n    return filenames.At(fileindex);\r\n}\r\n\r\nchar *ArchFile::GetFileDataByName(const WCHAR *fileName, size_t *len)\r\n{\r\n    return GetFileDataByIdx(GetFileIndex(fileName), len);\r\n}\r\n\r\nchar *ArchFile::GetFileDataByIdx(size_t fileindex, size_t *len)\r\n{\r\n    if (fileindex >= filenames.Count())\r\n        return nullptr;\r\n\r\n    if (!ar || !ar_parse_entry_at(ar, filepos.At(fileindex)))\r\n        return GetFileFromFallback(fileindex, len);\r\n\r\n    size_t size = ar_entry_get_size(ar);\r\n    if (size > SIZE_MAX - 3)\r\n        return nullptr;\r\n    ScopedMem<char> data((char *)malloc(size + 3));\r\n    if (!data)\r\n        return nullptr;\r\n    if (!ar_entry_uncompress(ar, data, size))\r\n        return GetFileFromFallback(fileindex, len);\r\n    // zero-terminate for convenience\r\n    data[size] = data[size + 1] = data[size + 2] = '\\0';\r\n\r\n    if (len)\r\n        *len = size;\r\n    return data.StealData();\r\n}\r\n\r\nFILETIME ArchFile::GetFileTime(const WCHAR *fileName)\r\n{\r\n    return GetFileTime(GetFileIndex(fileName));\r\n}\r\n\r\nFILETIME ArchFile::GetFileTime(size_t fileindex)\r\n{\r\n    FILETIME ft = { (DWORD)-1, (DWORD)-1 };\r\n    if (ar && fileindex < filepos.Count() && ar_parse_entry_at(ar, filepos.At(fileindex))) {\r\n        time64_t filetime = ar_entry_get_filetime(ar);\r\n        LocalFileTimeToFileTime((FILETIME *)&filetime, &ft);\r\n    }\r\n    return ft;\r\n}\r\n\r\nchar *ArchFile::GetComment(size_t *len)\r\n{\r\n    if (!ar)\r\n        return nullptr;\r\n    size_t commentLen = ar_get_global_comment(ar, nullptr, 0);\r\n    if (0 == commentLen || (size_t)-1 == commentLen)\r\n        return nullptr;\r\n    ScopedMem<char> comment((char *)malloc(commentLen + 1));\r\n    if (!comment)\r\n        return nullptr;\r\n    size_t read = ar_get_global_comment(ar, comment, commentLen);\r\n    if (read != commentLen)\r\n        return nullptr;\r\n    comment[commentLen] = '\\0';\r\n    if (len)\r\n        *len = commentLen;\r\n    return comment.StealData();\r\n}\r\n\r\n///// format specific handling /////\r\n\r\nstatic ar_archive *ar_open_zip_archive_any(ar_stream *stream) { return ar_open_zip_archive(stream, false); }\r\nstatic ar_archive *ar_open_zip_archive_deflated(ar_stream *stream) { return ar_open_zip_archive(stream, true); }\r\n#define GetZipOpener(deflatedOnly) ((deflatedOnly) ? ar_open_zip_archive_deflated : ar_open_zip_archive_any)\r\n\r\nZipFile::ZipFile(const WCHAR *path, bool deflatedOnly) : ArchFile(ar_open_file_w(path), GetZipOpener(deflatedOnly)) { }\r\nZipFile::ZipFile(IStream *stream, bool deflatedOnly) : ArchFile(ar_open_istream(stream), GetZipOpener(deflatedOnly)) { }\r\n\r\n_7zFile::_7zFile(const WCHAR *path) : ArchFile(ar_open_file_w(path), ar_open_7z_archive) { }\r\n_7zFile::_7zFile(IStream *stream) : ArchFile(ar_open_istream(stream), ar_open_7z_archive) { }\r\n\r\nTarFile::TarFile(const WCHAR *path) : ArchFile(ar_open_file_w(path), ar_open_tar_archive) { }\r\nTarFile::TarFile(IStream *stream) : ArchFile(ar_open_istream(stream), ar_open_tar_archive) { }\r\n\r\n#ifdef ENABLE_UNRARDLL_FALLBACK\r\nclass UnRarDll {\r\npublic:\r\n    UnRarDll();\r\n\r\n    bool ExtractFilenames(const WCHAR *rarPath, WStrList& filenames);\r\n    char *GetFileByName(const WCHAR *rarPath, const WCHAR *filename, size_t *len=nullptr);\r\n};\r\n#else\r\nclass UnRarDll { };\r\n#endif\r\n\r\nRarFile::RarFile(const WCHAR *path) : ArchFile(ar_open_file_w(path), ar_open_rar_archive),\r\n    path(str::Dup(path)), fallback(nullptr) { ExtractFilenamesWithFallback(); }\r\nRarFile::RarFile(IStream *stream) : ArchFile(ar_open_istream(stream), ar_open_rar_archive),\r\n    path(nullptr), fallback(nullptr) { ExtractFilenamesWithFallback(); }\r\nRarFile::~RarFile() { delete fallback; }\r\n\r\nvoid RarFile::ExtractFilenamesWithFallback()\r\n{\r\n    if (!ar || !ar_at_eof(ar))\r\n        (void)GetFileFromFallback((size_t)-1);\r\n}\r\n\r\nchar *RarFile::GetFileFromFallback(size_t fileindex, size_t *len)\r\n{\r\n#ifdef ENABLE_UNRARDLL_FALLBACK\r\n    if (path) {\r\n        if (!fallback)\r\n            fallback = new UnRarDll();\r\n        if (fileindex != (size_t)-1) {\r\n            // always use the fallback for this file from now on\r\n            filepos.At(fileindex) = -1;\r\n            return fallback->GetFileByName(path, filenames.At(fileindex), len);\r\n        }\r\n        // if fileindex == -1, (re)load the entire archive listing using UnRAR\r\n        fallback->ExtractFilenames(path, filenames);\r\n        // always use the fallback for all additionally found files\r\n        while (filepos.Count() < filenames.Count()) {\r\n            filepos.Append(-1);\r\n        }\r\n    }\r\n#endif\r\n    return nullptr;\r\n}\r\n\r\n#ifdef ENABLE_UNRARDLL_FALLBACK\r\n\r\n// the following has been extracted from UnRARDLL.exe -> unrar.h\r\n// publicly available from http://www.rarlab.com/rar_add.htm\r\n\r\n#define RAR_DLL_VERSION 6\r\n#define RAR_OM_EXTRACT  1\r\n#define RAR_SKIP        0\r\n#define RAR_TEST        1\r\n#define UCM_PROCESSDATA 1\r\n\r\n#pragma pack(1)\r\n\r\nstruct RARHeaderDataEx\r\n{\r\n  char         ArcName[1024];\r\n  wchar_t      ArcNameW[1024];\r\n  char         FileName[1024];\r\n  wchar_t      FileNameW[1024];\r\n  unsigned int Flags;\r\n  unsigned int PackSize;\r\n  unsigned int PackSizeHigh;\r\n  unsigned int UnpSize;\r\n  unsigned int UnpSizeHigh;\r\n  unsigned int HostOS;\r\n  unsigned int FileCRC;\r\n  unsigned int FileTime;\r\n  unsigned int UnpVer;\r\n  unsigned int Method;\r\n  unsigned int FileAttr;\r\n  char         *CmtBuf;\r\n  unsigned int CmtBufSize;\r\n  unsigned int CmtSize;\r\n  unsigned int CmtState;\r\n  unsigned int DictSize;\r\n  unsigned int HashType;\r\n  char         Hash[32];\r\n  unsigned int Reserved[1014];\r\n};\r\n\r\ntypedef int (CALLBACK *UNRARCALLBACK)(UINT msg, LPARAM UserData, LPARAM P1, LPARAM P2);\r\n\r\nstruct RAROpenArchiveDataEx\r\n{\r\n  char         *ArcName;\r\n  wchar_t      *ArcNameW;\r\n  unsigned int  OpenMode;\r\n  unsigned int  OpenResult;\r\n  char         *CmtBuf;\r\n  unsigned int  CmtBufSize;\r\n  unsigned int  CmtSize;\r\n  unsigned int  CmtState;\r\n  unsigned int  Flags;\r\n  UNRARCALLBACK Callback;\r\n  LPARAM        UserData;\r\n  unsigned int  Reserved[28];\r\n};\r\n\r\n#pragma pack()\r\n\r\ntypedef int     (PASCAL *RARGetDllVersionProc)();\r\ntypedef HANDLE  (PASCAL *RAROpenArchiveExProc)(struct RAROpenArchiveDataEx *ArchiveData);\r\ntypedef int     (PASCAL *RARReadHeaderExProc)(HANDLE hArcData, struct RARHeaderDataEx *HeaderData);\r\ntypedef int     (PASCAL *RARProcessFileProc)(HANDLE hArcData, int Operation, char *DestPath, char *DestName);\r\ntypedef int     (PASCAL *RARCloseArchiveProc)(HANDLE hArcData);\r\n\r\nstatic RAROpenArchiveExProc RAROpenArchiveEx = nullptr;\r\nstatic RARReadHeaderExProc  RARReadHeaderEx = nullptr;\r\nstatic RARProcessFileProc   RARProcessFile = nullptr;\r\nstatic RARCloseArchiveProc  RARCloseArchive = nullptr;\r\nstatic RARGetDllVersionProc RARGetDllVersion = nullptr;\r\n\r\nUnRarDll::UnRarDll()\r\n{\r\n    if (!RARGetDllVersion) {\r\n        ScopedMem<WCHAR> dllPath(path::GetAppPath(L\"unrar.dll\"));\r\n#ifdef _WIN64\r\n        ScopedMem<WCHAR> dll64Path(path::GetAppPath(L\"unrar64.dll\"));\r\n        if (file::Exists(dll64Path))\r\n            dllPath.Set(dll64Path.StealData());\r\n#endif\r\n        if (!file::Exists(dllPath))\r\n            return;\r\n        HMODULE h = LoadLibrary(dllPath);\r\n        if (!h)\r\n            return;\r\n#define LoadProcOrFail(name) name = (name ## Proc)GetProcAddress(h, #name); if (!name) return\r\n        LoadProcOrFail(RAROpenArchiveEx);\r\n        LoadProcOrFail(RARReadHeaderEx);\r\n        LoadProcOrFail(RARProcessFile);\r\n        LoadProcOrFail(RARCloseArchive);\r\n        // only load RARGetDllVersion if everything else has succeeded so far\r\n        LoadProcOrFail(RARGetDllVersion);\r\n#undef LoadProc\r\n    }\r\n}\r\n\r\nbool UnRarDll::ExtractFilenames(const WCHAR *rarPath, WStrList &filenames)\r\n{\r\n    // assume that unrar.dll is forward compatible (as indicated by its documentation)\r\n    if (!RARGetDllVersion || RARGetDllVersion() < RAR_DLL_VERSION || !rarPath)\r\n        return false;\r\n\r\n    RAROpenArchiveDataEx arcData = { 0 };\r\n    arcData.ArcNameW = (WCHAR *)rarPath;\r\n    arcData.OpenMode = RAR_OM_EXTRACT;\r\n\r\n    HANDLE hArc = RAROpenArchiveEx(&arcData);\r\n    if (!hArc || arcData.OpenResult != 0)\r\n        return false;\r\n\r\n    for (size_t idx = 0; ; idx++) {\r\n        RARHeaderDataEx rarHeader;\r\n        int res = RARReadHeaderEx(hArc, &rarHeader);\r\n        if (0 != res)\r\n            break;\r\n        str::TransChars(rarHeader.FileNameW, L\"\\\\\", L\"/\");\r\n        if (filenames.Count() == idx)\r\n            filenames.Append(str::Dup(rarHeader.FileNameW));\r\n        else\r\n            CrashIf(!str::Eq(filenames.At(idx), rarHeader.FileNameW));\r\n        RARProcessFile(hArc, RAR_SKIP, nullptr, nullptr);\r\n    }\r\n\r\n    RARCloseArchive(hArc);\r\n    return true;\r\n}\r\n\r\nstatic int CALLBACK unrarCallback(UINT msg, LPARAM userData, LPARAM rarBuffer, LPARAM bytesProcessed)\r\n{\r\n    if (UCM_PROCESSDATA != msg || !userData)\r\n        return -1;\r\n    str::Str<char> *data = (str::Str<char> *)userData;\r\n    bool ok = data->AppendChecked((char *)rarBuffer, bytesProcessed);\r\n    return ok ? 1 : -1;\r\n}\r\n\r\nchar *UnRarDll::GetFileByName(const WCHAR *rarPath, const WCHAR *filename, size_t *len)\r\n{\r\n    // assume that unrar.dll is forward compatible (as indicated by its documentation)\r\n    if (!RARGetDllVersion || RARGetDllVersion() < RAR_DLL_VERSION || !rarPath)\r\n        return false;\r\n\r\n    str::Str<char> data;\r\n\r\n    RAROpenArchiveDataEx arcData = { 0 };\r\n    arcData.ArcNameW = (WCHAR *)rarPath;\r\n    arcData.OpenMode = RAR_OM_EXTRACT;\r\n    arcData.Callback = unrarCallback;\r\n    arcData.UserData = (LPARAM)&data;\r\n\r\n    HANDLE hArc = RAROpenArchiveEx(&arcData);\r\n    if (!hArc || arcData.OpenResult != 0)\r\n        return nullptr;\r\n\r\n    int res = 0;\r\n    RARHeaderDataEx rarHeader;\r\n    for (;;) {\r\n        res = RARReadHeaderEx(hArc, &rarHeader);\r\n        if (0 != res)\r\n            break;\r\n        str::TransChars(rarHeader.FileNameW, L\"\\\\\", L\"/\");\r\n        if (str::EqI(rarHeader.FileNameW, filename))\r\n            break;\r\n        RARProcessFile(hArc, RAR_SKIP, nullptr, nullptr);\r\n    }\r\n\r\n    if (0 == res) {\r\n        if (rarHeader.UnpSizeHigh != 0) {\r\n            res = 1;\r\n        }\r\n        else {\r\n            res = RARProcessFile(hArc, RAR_TEST, nullptr, nullptr);\r\n            if (rarHeader.UnpSize != data.Size()) {\r\n                res = 1;\r\n            }\r\n        }\r\n        // zero-terminate for convenience\r\n        if (!data.AppendChecked(\"\\0\\0\\0\", 3))\r\n            res = 1;\r\n    }\r\n\r\n    RARCloseArchive(hArc);\r\n\r\n    if (0 != res)\r\n        return nullptr;\r\n    if (len)\r\n        *len = data.Size() - 2;\r\n    return data.StealData();\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "src/utils/ArchUtil.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nextern \"C\" {\r\ntypedef struct ar_stream_s ar_stream;\r\ntypedef struct ar_archive_s ar_archive;\r\n}\r\n\r\nclass ArchFile {\r\nprotected:\r\n    WStrList filenames;\r\n    Vec<int64_t> filepos;\r\n\r\n    ar_stream *data;\r\n    ar_archive *ar;\r\n\r\n    // call with fileindex = -1 for filename extraction using the fallback\r\n    virtual char *GetFileFromFallback(size_t fileIndex, size_t *len = nullptr) { UNUSED(fileIndex); UNUSED(len); return nullptr; }\r\n\r\npublic:\r\n    ArchFile(ar_stream *data, ar_archive *(* openFormat)(ar_stream *));\r\n    virtual ~ArchFile();\r\n\r\n    size_t GetFileCount() const;\r\n    // the result is owned by ArchFile\r\n    const WCHAR *GetFileName(size_t fileindex);\r\n    // reverts GetFileName\r\n    size_t GetFileIndex(const WCHAR *filename);\r\n\r\n    // caller must free() the result\r\n    char *GetFileDataByName(const WCHAR *filename, size_t *len=nullptr);\r\n    char *GetFileDataByIdx(size_t fileindex, size_t *len=nullptr);\r\n\r\n    FILETIME GetFileTime(const WCHAR *filename);\r\n    FILETIME GetFileTime(size_t fileindex);\r\n\r\n    // caller must free() the result\r\n    char *GetComment(size_t *len=nullptr);\r\n};\r\n\r\nclass ZipFile : public ArchFile {\r\npublic:\r\n    explicit ZipFile(const WCHAR *path, bool deflatedOnly=false);\r\n    explicit ZipFile(IStream *stream, bool deflatedOnly=false);\r\n};\r\n\r\nclass _7zFile : public ArchFile {\r\npublic:\r\n    explicit _7zFile(const WCHAR *path);\r\n    explicit _7zFile(IStream *stream);\r\n};\r\n\r\nclass TarFile : public ArchFile {\r\npublic:\r\n    explicit TarFile(const WCHAR *path);\r\n    explicit TarFile(IStream *stream);\r\n};\r\n\r\nclass UnRarDll;\r\n\r\nclass RarFile : public ArchFile {\r\n    ScopedMem<WCHAR> path;\r\n    UnRarDll *fallback;\r\n\r\n    void ExtractFilenamesWithFallback();\r\n    virtual char *GetFileFromFallback(size_t fileindex, size_t *len=nullptr);\r\n\r\npublic:\r\n    explicit RarFile(const WCHAR *path);\r\n    explicit RarFile(IStream *stream);\r\n    virtual ~RarFile();\r\n};\r\n"
  },
  {
    "path": "src/utils/BaseUtil.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n\r\nvoid *Allocator::Alloc(Allocator *a, size_t size) {\r\n    if (!a)\r\n        return malloc(size);\r\n    return a->Alloc(size);\r\n}\r\n\r\nvoid *Allocator::AllocZero(Allocator *a, size_t size) {\r\n    void *m = Allocator::Alloc(a, size);\r\n    if (m)\r\n        ZeroMemory(m, size);\r\n    return m;\r\n}\r\n\r\nvoid Allocator::Free(Allocator *a, void *p) {\r\n    if (!a)\r\n        free(p);\r\n    else\r\n        a->Free(p);\r\n}\r\n\r\nvoid* Allocator::Realloc(Allocator *a, void *mem, size_t size) {\r\n    if (!a)\r\n        return realloc(mem, size);\r\n    return a->Realloc(mem, size);\r\n}\r\n\r\nvoid *Allocator::Dup(Allocator *a, const void *mem, size_t size, size_t padding) {\r\n    void *newMem = Alloc(a, size + padding);\r\n    if (newMem)\r\n        memcpy(newMem, mem, size);\r\n    return newMem;\r\n}\r\n\r\nchar *Allocator::StrDup(Allocator *a, const char *str) {\r\n    return str ? (char *)Dup(a, str, strlen(str) + 1) : nullptr;\r\n}\r\n\r\nWCHAR *Allocator::StrDup(Allocator *a, const WCHAR *str) {\r\n    return str ? (WCHAR *)Dup(a, str, (wcslen(str) + 1) * sizeof(WCHAR)) : nullptr;\r\n}\r\n\r\n\r\nvoid PoolAllocator::Init() {\r\n    currBlock = nullptr;\r\n    firstBlock = nullptr;\r\n    allocRounding = 8;\r\n}\r\n\r\nvoid PoolAllocator::SetMinBlockSize(size_t newMinBlockSize) {\r\n    CrashIf(currBlock); // can only be changed before first allocation\r\n    minBlockSize = newMinBlockSize;\r\n}\r\n\r\nvoid PoolAllocator::SetAllocRounding(size_t newRounding) {\r\n    CrashIf(currBlock); // can only be changed before first allocation\r\n    allocRounding = newRounding;\r\n}\r\n\r\nvoid PoolAllocator::FreeAll() {\r\n    MemBlockNode *curr = firstBlock;\r\n    while (curr) {\r\n        MemBlockNode *next = curr->next;\r\n        free(curr);\r\n        curr = next;\r\n    }\r\n    Init();\r\n}\r\n\r\nPoolAllocator::~PoolAllocator() {\r\n    FreeAll();\r\n}\r\n\r\nvoid PoolAllocator::AllocBlock(size_t minSize) {\r\n    minSize = RoundUp(minSize, allocRounding);\r\n    size_t size = minBlockSize;\r\n    if (minSize > size)\r\n        size = minSize;\r\n    MemBlockNode *node = (MemBlockNode*)calloc(1, sizeof(MemBlockNode) + size);\r\n    CrashAlwaysIf(!node);\r\n    if (!firstBlock)\r\n        firstBlock = node;\r\n    node->size = size;\r\n    node->free = size;\r\n    if (currBlock)\r\n        currBlock->next = node;\r\n    currBlock = node;\r\n}\r\n\r\n// Allocator methods\r\nvoid *PoolAllocator::Realloc(void *mem, size_t size) {\r\n    UNUSED(mem);  UNUSED(size);\r\n    // TODO: we can't do that because we don't know the original\r\n    // size of memory piece pointed by mem. We could remember it\r\n    // within the block that we allocate\r\n    CrashMe();\r\n    return nullptr;\r\n}\r\n\r\n\r\nvoid *PoolAllocator::Alloc(size_t size) {\r\n    size = RoundUp(size, allocRounding);\r\n    if (!currBlock || (currBlock->free < size))\r\n        AllocBlock(size);\r\n\r\n    void *mem = (void*)(currBlock->DataStart() + currBlock->Used());\r\n    currBlock->free -= size;\r\n    return mem;\r\n}\r\n\r\n// assuming allocated memory was for pieces of uniform size,\r\n// find the address of n-th piece\r\nvoid *PoolAllocator::FindNthPieceOfSize(size_t size, size_t n) const {\r\n    size = RoundUp(size, allocRounding);\r\n    MemBlockNode *curr = firstBlock;\r\n    while (curr) {\r\n        size_t piecesInBlock = curr->Used() / size;\r\n        if (piecesInBlock > n) {\r\n            char *p = (char*)curr + sizeof(MemBlockNode) + (n * size);\r\n                return (void*)p;\r\n        }\r\n        n -= piecesInBlock;\r\n        curr = curr->next;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nsize_t RoundToPowerOf2(size_t size)\r\n{\r\n    size_t n = 1;\r\n    while (n < size) {\r\n        n *= 2;\r\n        if (0 == n) {\r\n            // TODO: no power of 2\r\n            return (size_t)-1;\r\n        }\r\n    }\r\n    return n;\r\n}\r\n\r\n/* MurmurHash2, by Austin Appleby\r\n * Note - This code makes a few assumptions about how your machine behaves -\r\n * 1. We can read a 4-byte value from any address without crashing\r\n *\r\n * And it has a few limitations -\r\n *\r\n * 1. It will not work incrementally.\r\n * 2. It will not produce the same results on little-endian and big-endian\r\n *    machines.\r\n */\r\nstatic uint32_t hash_function_seed = 5381;\r\n\r\nuint32_t MurmurHash2(const void *key, size_t len)\r\n{\r\n    /* 'm' and 'r' are mixing constants generated offline.\r\n     They're not really 'magic', they just happen to work well.  */\r\n    const uint32_t m = 0x5bd1e995;\r\n    const int r = 24;\r\n\r\n    /* Initialize the hash to a 'random' value */\r\n    uint32_t h = hash_function_seed ^ (uint32_t)len;\r\n\r\n    /* Mix 4 bytes at a time into the hash */\r\n    const uint8_t *data = (const uint8_t *)key;\r\n\r\n    while (len >= 4) {\r\n        uint32_t k = *(uint32_t *)data;\r\n\r\n        k *= m;\r\n        k ^= k >> r;\r\n        k *= m;\r\n\r\n        h *= m;\r\n        h ^= k;\r\n\r\n        data += 4;\r\n        len -= 4;\r\n    }\r\n\r\n    /* Handle the last few bytes of the input array  */\r\n    switch (len) {\r\n    case 3: h ^= data[2] << 16;\r\n    case 2: h ^= data[1] << 8;\r\n    case 1: h ^= data[0]; h *= m;\r\n    }\r\n\r\n    /* Do a few final mixes of the hash to ensure the last few\r\n     * bytes are well-incorporated. */\r\n    h ^= h >> 13;\r\n    h *= m;\r\n    h ^= h >> 15;\r\n\r\n    return h;\r\n}\r\n"
  },
  {
    "path": "src/utils/BaseUtil.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#ifndef BaseUtil_h\r\n#define BaseUtil_h\r\n\r\n#ifndef UNICODE\r\n#define UNICODE\r\n#endif\r\n#ifndef _UNICODE\r\n#define _UNICODE\r\n#endif\r\n\r\n#include \"BuildConfig.h\"\r\n\r\n#include <windows.h>\r\n#include <unknwn.h>\r\n#include <shlwapi.h>\r\n#include <shlobj.h>\r\n#include <commctrl.h>\r\n#include <windowsx.h>\r\n#include <winsafer.h>\r\n#include <gdiplus.h>\r\n\r\n#ifdef min\r\n#undef min\r\n#endif\r\n\r\n#ifdef max\r\n#undef max\r\n#endif\r\n\r\n#ifdef DEBUG\r\n#define _CRTDBG_MAP_ALLOC\r\n#endif\r\n\r\n#include <algorithm>\r\n#include <stdlib.h>\r\n\r\n// TODO: this breaks placement new\r\n#ifdef DEBUG\r\n#include <crtdbg.h>\r\n#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)\r\n#define new DEBUG_NEW\r\n#endif\r\n\r\n#include <string.h>\r\n\r\n/* Few most common includes for C stdlib */\r\n#include <assert.h>\r\n#include <float.h>\r\n#include <stddef.h>\r\n#include <stdio.h>\r\n#include <stdint.h>\r\n#include <time.h>\r\n#include <locale.h>\r\n#include <malloc.h>\r\n#include <io.h>\r\n#include <fcntl.h>\r\n\r\n#define _USE_MATH_DEFINES\r\n#include <math.h>\r\n\r\n#if defined(__MINGW32__)\r\n#include \"mingw_compat.h\"\r\n#endif\r\n\r\n#include <functional>\r\n#include <memory>\r\n\r\ntemplate <typename T>\r\ninline T *AllocArray(size_t n)\r\n{\r\n    return (T*)calloc(n, sizeof(T));\r\n}\r\n\r\ntemplate <typename T>\r\ninline T *AllocStruct()\r\n{\r\n    return (T*)calloc(1, sizeof(T));\r\n}\r\n\r\n#if defined(_MSC_VER)\r\n#define NO_INLINE __declspec(noinline)\r\n#else\r\n// assuming gcc or similar\r\n#define NO_INLINE __attribute__((noinline))\r\n#endif\r\n\r\n#define NoOp()      ((void)0)\r\n#define dimof(array) (sizeof(DimofSizeHelper(array)))\r\ntemplate <typename T, size_t N>\r\nchar(&DimofSizeHelper(T(&array)[N]))[N];\r\n\r\ntypedef unsigned char uint8;\r\ntypedef int16_t   int16;\r\ntypedef uint16_t uint16;\r\ntypedef int32_t   int32;\r\ntypedef uint32_t uint32;\r\ntypedef int64_t   int64;\r\ntypedef uint64_t uint64;\r\n\r\nstatic_assert(2 == sizeof(int16) && 2 == sizeof(uint16), \"(u)int16 must be two bytes\");\r\nstatic_assert(4 == sizeof(int32) && 4 == sizeof(uint32), \"(u)int32 must be four bytes\");\r\nstatic_assert(8 == sizeof(int64) && 8 == sizeof(uint64), \"(u)int64 must be eight bytes\");\r\n\r\n// UNUSED is for marking unreferenced function arguments/variables\r\n// UNREFERENCED_PARAMETER is in windows SDK but too long. We use it if available,\r\n// otherwise we define our own version.\r\n// UNUSED might already be defined by mupdf\\fits\\system.h\r\n#if !defined(UNUSED)\r\n    #if defined(UNREFERENCED_PARAMETER)\r\n        #define UNUSED UNREFERENCED_PARAMETER\r\n    #else\r\n        #define UNUSED(P) (P)\r\n    #endif\r\n#endif\r\n\r\n#pragma warning(push)\r\n#pragma warning(disable: 6011) // silence /analyze: de-referencing a nullptr pointer\r\n// Note: it's inlined to make it easier on crash reports analyzer (if wasn't inlined\r\n// CrashMe() would show up as the cause of several different crash sites)\r\n//\r\n// Note: I tried doing this via RaiseException(0x40000015, EXCEPTION_NONCONTINUABLE, 0, 0);\r\n// but it seemed to confuse callstack walking\r\ninline void CrashMe()\r\n{\r\n    char *p = nullptr;\r\n    *p = 0;\r\n}\r\n#pragma warning(pop)\r\n\r\n// CrashIf() is like assert() except it crashes in debug and pre-release builds.\r\n// The idea is that assert() indicates \"can't possibly happen\" situation and if\r\n// it does happen, we would like to fix the underlying cause.\r\n// In practice in our testing we rarely get notified when an assert() is triggered\r\n// and they are disabled in builds running on user's computers.\r\n// Now that we have crash reporting, we can get notified about such cases if we\r\n// use CrashIf() instead of assert(), which we should be doing from now on.\r\n//\r\n// Enabling it in pre-release builds but not in release builds is trade-off between\r\n// shipping small executables (each CrashIf() adds few bytes of code) and having\r\n// more testing on user's machines and not only in our personal testing.\r\n// To crash uncoditionally use CrashAlwaysIf(). It should only be used in\r\n// rare cases where we really want to know a given condition happens. Before\r\n// each release we should audit the uses of CrashAlawysIf()\r\n//\r\n// Just as with assert(), the condition is not guaranteed to be executed\r\n// in some builds, so it shouldn't contain the actual logic of the code\r\n\r\ninline void CrashIfFunc(bool cond) {\r\n#if defined(SVN_PRE_RELEASE_VER) || defined(DEBUG)\r\n    if (cond) {\r\n        CrashMe();\r\n    }\r\n#else\r\n    UNUSED(cond);\r\n#endif\r\n}\r\n\r\n// Sometimes we want to assert only in debug build (not in pre-release)\r\ninline void CrashIfDebugOnlyFunc(bool cond) {\r\n#if defined(DEBUG)\r\n    if (cond) { CrashMe(); }\r\n#else\r\n    UNUSED(cond);\r\n#endif\r\n}\r\n\r\n#define while_0_nowarn __pragma(warning(push)) __pragma(warning(disable:4127)) while (0) __pragma(warning(pop))\r\n\r\n#define CrashIfDebugOnly(cond) \\\r\n    do { \\\r\n        __analysis_assume(!(cond)); \\\r\n        CrashIfDebugOnlyFunc(cond); \\\r\n    } while_0_nowarn\r\n\r\n#define CrashAlwaysIf(cond) \\\r\n    do { \\\r\n          __analysis_assume(!(cond)); \\\r\n          if (cond) { CrashMe(); } \\\r\n    } while_0_nowarn\r\n\r\n#define CrashIf(cond) \\\r\n    do { \\\r\n        __analysis_assume(!(cond)); \\\r\n        CrashIfFunc(cond); \\\r\n    } while_0_nowarn\r\n\r\n// AssertCrash is like assert() but crashes like CrashIf()\r\n// It's meant to make converting assert() easier (converting to\r\n// CrashIf() requires inverting the condition, which can introduce bugs)\r\n#define AssertCrash(cond) \\\r\n    do { \\\r\n        __analysis_assume(cond); \\\r\n        CrashIfFunc(!(cond)); \\\r\n    } while_0_nowarn\r\n\r\ntemplate <typename T>\r\ninline T limitValue(T val, T min, T max)\r\n{\r\n    assert(max >= min);\r\n    if (val < min) return min;\r\n    if (val > max) return max;\r\n    return val;\r\n}\r\n\r\ninline void *memdup(const void *data, size_t len)\r\n{\r\n    void *dup = malloc(len);\r\n    if (dup)\r\n        memcpy(dup, data, len);\r\n    return dup;\r\n}\r\n\r\ninline bool memeq(const void *s1, const void *s2, size_t len)\r\n{\r\n    return 0 == memcmp(s1, s2, len);\r\n}\r\n\r\nsize_t      RoundToPowerOf2(size_t size);\r\nuint32_t    MurmurHash2(const void *key, size_t len);\r\n\r\nstatic inline size_t RoundUp(size_t n, size_t rounding)\r\n{\r\n    return ((n+rounding-1)/rounding)*rounding;\r\n}\r\n\r\nstatic inline int RoundUp(int n, int rounding)\r\n{\r\n    return ((n+rounding-1)/rounding)*rounding;\r\n}\r\n\r\ntemplate <typename T>\r\nvoid ListInsert(T** root, T* el)\r\n{\r\n    el->next = *root;\r\n    *root = el;\r\n}\r\n\r\ntemplate <typename T>\r\nbool ListRemove(T** root, T* el)\r\n{\r\n    T **currPtr = root;\r\n    T *curr;\r\n    for (;;) {\r\n        curr = *currPtr;\r\n        if (!curr)\r\n            return false;\r\n        if (curr == el)\r\n            break;\r\n        currPtr = &(curr->next);\r\n    }\r\n    *currPtr = el->next;\r\n    return true;\r\n}\r\n\r\n// Base class for allocators that can be provided to Vec class\r\n// (and potentially others). Needed because e.g. in crash handler\r\n// we want to use Vec but not use standard malloc()/free() functions\r\nclass Allocator {\r\npublic:\r\n    Allocator() {}\r\n    virtual ~Allocator() { };\r\n    virtual void *Alloc(size_t size) = 0;\r\n    virtual void *Realloc(void *mem, size_t size) = 0;\r\n    virtual void Free(void *mem) = 0;\r\n\r\n    // helper functions that fallback to malloc()/free() if allocator is nullptr\r\n    // helps write clients where allocator is optional\r\n    static void *Alloc(Allocator *a, size_t size);\r\n\r\n    template <typename T>\r\n    static T *Alloc(Allocator *a, size_t n=1) {\r\n        size_t size = n * sizeof(T);\r\n        return (T *)AllocZero(a, size);\r\n    }\r\n\r\n    static void *AllocZero(Allocator *a, size_t size);\r\n    static void Free(Allocator *a, void *p);\r\n    static void* Realloc(Allocator *a, void *mem, size_t size);\r\n    static void *Dup(Allocator *a, const void *mem, size_t size, size_t padding=0);\r\n    static char *StrDup(Allocator *a, const char *str);\r\n    static WCHAR *StrDup(Allocator *a, const WCHAR *str);\r\n};\r\n\r\n// PoolAllocator is for the cases where we need to allocate pieces of memory\r\n// that are meant to be freed together. It simplifies the callers (only need\r\n// to track this object and not all allocated pieces). Allocation and freeing\r\n// is faster. The downside is that free() is a no-op i.e. it can't free memory\r\n// for re-use.\r\n//\r\n// Note: we could be a bit more clever here by allocating data in 4K chunks\r\n// via VirtualAlloc() etc. instead of malloc(), which would lower the overhead\r\nclass PoolAllocator : public Allocator {\r\n\r\n    // we'll allocate block of the minBlockSize unless\r\n    // asked for a block of bigger size\r\n    size_t  minBlockSize;\r\n    size_t  allocRounding;\r\n\r\n    struct MemBlockNode {\r\n        struct MemBlockNode *next;\r\n        size_t               size;\r\n        size_t               free;\r\n\r\n        size_t               Used() { return size - free; }\r\n        char *               DataStart() { return (char*)this + sizeof(MemBlockNode); }\r\n        // data follows here\r\n    };\r\n\r\n    MemBlockNode *  currBlock;\r\n    MemBlockNode *  firstBlock;\r\n\r\n    void Init();\r\n\r\npublic:\r\n    explicit PoolAllocator(size_t rounding=8) : minBlockSize(4096), allocRounding(rounding) {\r\n        Init();\r\n    }\r\n\r\n    void SetMinBlockSize(size_t newMinBlockSize);\r\n    void SetAllocRounding(size_t newRounding);\r\n    void FreeAll();\r\n    virtual ~PoolAllocator() override;\r\n    void AllocBlock(size_t minSize);\r\n\r\n    // Allocator methods\r\n    virtual void *Realloc(void *mem, size_t size) override;\r\n\r\n    virtual void Free(void *) override {\r\n        // does nothing, we can't free individual pieces of memory\r\n    }\r\n\r\n    virtual void *Alloc(size_t size) override;\r\n\r\n    void *FindNthPieceOfSize(size_t size, size_t n) const;\r\n\r\n    template <typename T>\r\n    T *GetAtPtr(size_t idx) const {\r\n        void *mem = FindNthPieceOfSize(sizeof(T), idx);\r\n        return reinterpret_cast<T*>(mem);\r\n    }\r\n\r\n    // only valid for structs, could alloc objects with\r\n    // placement new()\r\n    template <typename T>\r\n    T *AllocStruct() {\r\n        return (T *)Alloc(sizeof(T));\r\n    }\r\n\r\n    // Iterator for easily traversing allocated memory as array\r\n    // of values of type T. The caller has to enforce the fact\r\n    // that the values stored are indeed values of T\r\n    // cf. http://www.cprogramming.com/c++11/c++11-ranged-for-loop.html\r\n    template <typename T>\r\n    class Iter {\r\n        MemBlockNode *block;\r\n        size_t blockPos;\r\n\r\n    public:\r\n        Iter(MemBlockNode *block) : block(block), blockPos(0) {\r\n            CrashIf(block && (block->Used() % sizeof(T)) != 0);\r\n            CrashIf(block && block->Used() == 0);\r\n        }\r\n\r\n        bool operator!=(const Iter& other) const {\r\n            return block != other.block || blockPos != other.blockPos;\r\n        }\r\n        T& operator*() const {\r\n            return *(T *)(block->DataStart() + blockPos);\r\n        }\r\n        Iter& operator++() {\r\n            blockPos += sizeof(T);\r\n            if (block->Used() == blockPos) {\r\n                block = block->next;\r\n                blockPos = 0;\r\n                CrashIf(block && block->Used() == 0);\r\n            }\r\n            return *this;\r\n        }\r\n    };\r\n\r\n    template <typename T>\r\n    Iter<T> begin() {\r\n        return Iter<T>(firstBlock);\r\n    }\r\n    template <typename T>\r\n    Iter<T> end() {\r\n        return Iter<T>(nullptr);\r\n    }\r\n};\r\n\r\n// A helper for allocating an array of elements of type T\r\n// either on stack (if they fit within StackBufInBytes)\r\n// or in memory. Allocating on stack is a perf optimization\r\n// note: not the best name\r\ntemplate <typename T, int StackBufInBytes>\r\nclass FixedArray {\r\n    T stackBuf[StackBufInBytes / sizeof(T)];\r\n    T *memBuf;\r\npublic:\r\n    explicit FixedArray(size_t elCount) {\r\n        memBuf = nullptr;\r\n        size_t stackEls = StackBufInBytes / sizeof(T);\r\n        if (elCount > stackEls)\r\n            memBuf = (T*)malloc(elCount * sizeof(T));\r\n    }\r\n\r\n    ~FixedArray() {\r\n        free(memBuf);\r\n    }\r\n\r\n    T *Get() {\r\n        if (memBuf)\r\n            return memBuf;\r\n        return &(stackBuf[0]);\r\n    }\r\n};\r\n\r\n#include \"GeomUtil.h\"\r\n#include \"Scoped.h\"\r\n#include \"StrUtil.h\"\r\n#include \"Vec.h\"\r\n\r\n/* In debug mode, VS 2010 instrumentations complains about GetRValue() etc.\r\nThis adds equivalent functions that don't have this problem and ugly\r\nsubstitutions to make sure we don't use Get*Value() in the future */\r\n\r\nstatic inline BYTE GetRValueSafe(COLORREF rgb)\r\n{\r\n    rgb = rgb & 0xff;\r\n    return (BYTE)rgb;\r\n}\r\n\r\nstatic inline BYTE GetGValueSafe(COLORREF rgb)\r\n{\r\n    rgb = (rgb >> 8) & 0xff;\r\n    return (BYTE)rgb;\r\n}\r\n\r\nstatic inline BYTE GetBValueSafe(COLORREF rgb)\r\n{\r\n    rgb = (rgb >> 16) & 0xff;\r\n    return (BYTE)rgb;\r\n}\r\n\r\n#undef GetRValue\r\n#define GetRValue UseGetRValueSafeInstead\r\n#undef GetGValue\r\n#define GetGValue UseGetGValueSafeInstead\r\n#undef GetBValue\r\n#define GetBValue UseGetBValueSafeInstead\r\n\r\n#ifdef lstrcpy\r\n#undef lstrcpy\r\n#define lstrcpy dont_use_lstrcpy\r\n#endif\r\n\r\n#endif\r\n"
  },
  {
    "path": "src/utils/BitManip.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n/* Simple functions to make it easier to set/clear/test for bits in integers */\r\n\r\nnamespace bit {\r\n\r\ntemplate <typename T>\r\nvoid Set(T& v, int bitNo)\r\n{\r\n    T mask = 1 << bitNo;\r\n    v |= mask;\r\n}\r\n\r\ntemplate <typename T>\r\nvoid Set(T& v, int bit1, int bit2)\r\n{\r\n    T mask = 1 << bit1;\r\n    v |= mask;\r\n    mask = 1 << bit2;\r\n    v |= mask;\r\n}\r\n\r\ntemplate <typename T>\r\nT FromBit(int bitNo)\r\n{\r\n    T v = (T)(1 << bitNo);\r\n    return v;\r\n}\r\n\r\ntemplate <typename T>\r\nvoid Clear(T& v, int bitNo)\r\n{\r\n    T mask = 1 << bitNo;\r\n    v &= ~mask;\r\n}\r\n\r\ntemplate <typename T>\r\nbool IsSet(T v, int bitNo)\r\n{\r\n    T mask = (T)1 << bitNo;\r\n    return (v & mask) != 0;\r\n}\r\n\r\ntemplate <typename T>\r\nbool IsMaskSet(T v, T mask)\r\n{\r\n    return (v & mask) != 0;\r\n}\r\n\r\n}\r\n"
  },
  {
    "path": "src/utils/BitReader.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"BitReader.h\"\r\n\r\n// Bit reader is a streaming reader of bits from underlying memory data\r\n\r\n// data has to be valid for the lifetime of this class\r\nBitReader::BitReader(uint8_t *data, size_t len) :\r\n    data(data), dataLen(len), currBitPos(0)\r\n{\r\n    bitsCount = len * 8;\r\n}\r\n\r\nBitReader::~BitReader() {\r\n}\r\n\r\nuint8_t BitReader::GetByte(size_t pos) {\r\n    if (pos >= dataLen)\r\n        return 0;\r\n    return data[pos];\r\n}\r\n\r\n    // advance position in the bit stream\r\n// returns false if we've eaten bits more than we have\r\nbool BitReader::Eat(size_t bitsCount) {\r\n    currBitPos += bitsCount;\r\n    return (currBitPos <= bitsCount);\r\n}\r\n\r\nsize_t BitReader::BitsLeft() {\r\n    if (currBitPos < bitsCount)\r\n        return bitsCount - currBitPos;\r\n    return 0;\r\n}\r\n\r\n// Read bitsCount (up to 32) bits, without advancing the position in the bit stream\r\n// If asked for more bits than we have left, the extra bits will be 0\r\nuint32_t BitReader::Peek(size_t bitsCount) {\r\n    assert(bitsCount <= 32);\r\n    size_t currBytePos = currBitPos / 8;\r\n    uint8_t currByte = GetByte(currBytePos);\r\n    uint8_t currBit = currBitPos % 8;\r\n    currByte = currByte << currBit;\r\n    uint8_t bitsLeft = 8 - currBit;\r\n    uint32_t ret = 0;\r\n    while (bitsCount > 0) {\r\n        assert(bitsLeft >= 0);\r\n        if (0 == bitsLeft) {\r\n            ++currBytePos;\r\n            currByte = GetByte(currBytePos);\r\n            bitsLeft = 8;\r\n        }\r\n        // being conservative here, could probably handle\r\n        // bitsLeft other than 8\r\n        if ((8 == bitsLeft) && (bitsCount >= 8)) {\r\n            // fast path - 8 bits at a time\r\n            ret = (ret << 8) | currByte;\r\n            bitsLeft = 0;\r\n            bitsCount -= 8;\r\n        } else {\r\n            // slow path - 1 bit at a time\r\n            ret = ret << 1;\r\n            if ((0x80 & currByte) != 0)\r\n                ret |= 1;\r\n            currByte = currByte << 1;\r\n            --bitsLeft;\r\n            --bitsCount;\r\n        }\r\n    }\r\n    return ret;\r\n}\r\n"
  },
  {
    "path": "src/utils/BitReader.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nclass BitReader\r\n{\r\n    uint8_t GetByte(size_t pos);\r\n\r\npublic:\r\n    BitReader(uint8_t *data, size_t len);\r\n    ~BitReader();\r\n    uint32_t    Peek(size_t bitsCount);\r\n    size_t      BitsLeft();\r\n    bool        Eat(size_t bitsCount);\r\n\r\n    uint8_t *   data;\r\n    size_t      dataLen;\r\n    size_t      currBitPos;\r\n    size_t      bitsCount;\r\n};\r\n"
  },
  {
    "path": "src/utils/ByteOrderDecoder.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: Simplified BSD (see COPYING.BSD) */\n\n#include \"BaseUtil.h\"\n#include \"ByteOrderDecoder.h\"\n\nuint16 UInt16BE(const uint8* d)\n{\n    return d[1] | (d[0] << 8);\n}\n\nuint16 UInt16LE(const uint8* d)\n{\n    return d[0] | (d[1] << 8);\n}\n\nuint32 UInt32BE(const uint8* d)\n{\n    return d[3] | (d[2] << 8) | (d[1] << 16) | (d[0] << 24);\n}\n\nuint32 UInt32LE(const uint8* d)\n{\n    return d[0] | (d[1] << 8) | (d[2] << 16) | (d[3] << 24);\n}\n\nByteOrderDecoder::ByteOrderDecoder(const char *d, size_t len, ByteOrder order)\n    : data((const uint8 *)d), left(len), byteOrder(order), curr(data) { }\n\nByteOrderDecoder::ByteOrderDecoder(const uint8 *d, size_t len, ByteOrder order)\n    : data(d), left(len), byteOrder(order), curr(data) { }\n\nuint8 ByteOrderDecoder::UInt8()\n{\n    CrashIf(left < 1);\n\n    left--;\n    return *curr++;\n}\n\nuint16 ByteOrderDecoder::UInt16()\n{\n    uint16 v;\n    CrashIf(left < sizeof(v));\n\n    if (LittleEndian == byteOrder)\n        v = UInt16LE(curr);\n    else\n        v = UInt16BE(curr);\n    left -= sizeof(v);\n    curr += sizeof(v);\n    return v;\n}\n\nuint32 ByteOrderDecoder::UInt32()\n{\n    uint32 v;\n    CrashIf(left < sizeof(v));\n\n    if (LittleEndian == byteOrder)\n        v = UInt32LE(curr);\n    else\n        v = UInt32BE(curr);\n    left -= sizeof(v);\n    curr += sizeof(v);\n    return v;\n}\n\nuint64 ByteOrderDecoder::UInt64()\n{\n    uint64 first = UInt32();\n    if (LittleEndian == byteOrder)\n        return first | ((uint64)UInt32() << 32);\n    return (first << 32) | UInt32();\n}\n\nvoid ByteOrderDecoder::Bytes(char *dest, size_t len)\n{\n    CrashIf(left < len);\n    memcpy(dest, curr, len);\n    left -= len;\n    curr += len;\n}\n\nvoid ByteOrderDecoder::Skip(size_t len)\n{\n    CrashIf(left < len);\n    left -= len;\n    curr += len;\n}\n\nvoid ByteOrderDecoder::Unskip(size_t len)\n{\n    CrashIf(curr < data + len);\n    left += len;\n    curr -= len;\n}\n"
  },
  {
    "path": "src/utils/ByteOrderDecoder.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: Simplified BSD (see COPYING.BSD) */\n\n// class for decoding of byte buffer as a sequence of numbers\nclass ByteOrderDecoder\n{\npublic:\n    enum ByteOrder { LittleEndian, BigEndian };\n\n    ByteOrderDecoder(const char *d, size_t len, ByteOrder order);\n    ByteOrderDecoder(const uint8 *d, size_t len, ByteOrder order);\n\n    void ChangeOrder(ByteOrder newOrder) { CrashIf(byteOrder == newOrder); byteOrder = newOrder; }\n\n    uint8  UInt8();\n    char   Char() { return (char)UInt8(); }\n    uint16 UInt16();\n    int16  Int16() { return (int16)UInt16(); }\n    uint32 UInt32();\n    int32  Int32() { return (int32)UInt32(); }\n    uint64 UInt64();\n    int64  Int64() { return (int64)UInt64(); }\n\n    void   Bytes(char *dest, size_t len);\n\n    void   Skip(size_t len);\n    void   Unskip(size_t len);\n\n    size_t Offset() const { return curr - data; }\n\nprotected:\n    ByteOrder byteOrder;\n    const uint8 *data;\n\n    const uint8 *curr;\n    size_t left;\n};\n\n// decode a given piece of memory\nuint16 UInt16BE(const uint8* d);\nuint16 UInt16LE(const uint8* d);\nuint32 UInt32BE(const uint8* d);\nuint32 UInt32LE(const uint8* d);\n"
  },
  {
    "path": "src/utils/ByteReader.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nclass ByteReader {\r\n    const uint8_t *d;\r\n    size_t len;\r\n\r\n    // Unpacks a structure from the data according to the given format\r\n    // e.g. the format \"32b2w6d\" unpacks 32 Bytes, 2 16-bit Words and 6 32-bit Dwords\r\n    bool Unpack(void *strct, size_t size, const char *format, size_t off, bool isBE) const {\r\n        int repeat = 0;\r\n        size_t idx = 0;\r\n        for (const char *c = format; *c; c++) {\r\n            if (isdigit((unsigned char)*c)) {\r\n                repeat = atoi(c);\r\n                for (c++; isdigit((unsigned char)*c); c++);\r\n            }\r\n            switch (*c) {\r\n            case 'b':\r\n                if (off + idx + 1 > len || idx + 1 > size)\r\n                    return false;\r\n                *(uint8_t *)((uint8_t *)strct + idx) = Byte(off + idx);\r\n                idx += 1;\r\n                break;\r\n            case 'w':\r\n                if (off + idx + 2 > len || idx + 2 > size)\r\n                    return false;\r\n                *(uint16_t *)((uint8_t *)strct + idx) = Word(off + idx, isBE);\r\n                idx += 2;\r\n                break;\r\n            case 'd':\r\n                if (off + idx + 4 > len || idx + 4 > size)\r\n                    return false;\r\n                *(uint32_t *)((uint8_t *)strct + idx) = DWord(off + idx, isBE);\r\n                idx += 4;\r\n                break;\r\n            case 'q':\r\n                if (off + idx + 8 > len || idx + 8 > size)\r\n                    return false;\r\n                *(uint64_t *)((uint8_t *)strct + idx) = QWord(off + idx, isBE);\r\n                idx += 8;\r\n                break;\r\n            default:\r\n                return false;\r\n            }\r\n            if (--repeat > 0)\r\n                c--;\r\n        }\r\n        return idx == size;\r\n    }\r\n\r\npublic:\r\n    ByteReader(const char *data, size_t len) :\r\n        d((const uint8_t *)data), len(len) { }\r\n    ByteReader(const unsigned char *data, size_t len) :\r\n        d((const uint8_t *)data), len(len) { }\r\n\r\n    uint8_t Byte(size_t off) const {\r\n        if (off < len)\r\n            return d[off];\r\n        return 0;\r\n    }\r\n\r\n    uint16_t WordLE(size_t off) const {\r\n        if (off + 2 <= len)\r\n            return d[off] | (d[off + 1] << 8);\r\n        return 0;\r\n    }\r\n    uint16_t WordBE(size_t off) const {\r\n        if (off + 2 <= len)\r\n            return (d[off] << 8) | d[off + 1];\r\n        return 0;\r\n    }\r\n    uint16_t Word(size_t off, bool isBE) const {\r\n        return isBE ? WordBE(off) : WordLE(off);\r\n    }\r\n\r\n    uint32_t DWordLE(size_t off) const {\r\n        if (off + 4 <= len)\r\n            return d[off] | (d[off + 1] << 8) | (d[off + 2] << 16) | (d[off + 3] << 24);\r\n        return 0;\r\n    }\r\n    uint32_t DWordBE(size_t off) const {\r\n        if (off + 4 <= len)\r\n            return (d[off] << 24) | (d[off + 1] << 16) | (d[off + 2] << 8) | d[off + 3];\r\n        return 0;\r\n    }\r\n    uint32_t DWord(size_t off, bool isBE) const {\r\n        return isBE ? DWordBE(off) : DWordLE(off);\r\n    }\r\n\r\n    uint64_t QWordLE(size_t off) const {\r\n        if (off + 8 <= len)\r\n            return DWordLE(off) | ((uint64_t)DWordLE(off + 4) << 32);\r\n        return 0;\r\n    }\r\n    uint64_t QWordBE(size_t off) const {\r\n        if (off + 8 <= len)\r\n            return ((uint64_t)DWordBE(off) << 32) | DWordBE(off + 4);\r\n        return 0;\r\n    }\r\n    uint64_t QWord(size_t off, bool isBE) const {\r\n        return isBE ? QWordBE(off) : QWordLE(off);\r\n    }\r\n\r\n    const char *Find(size_t off, uint8_t byte) const {\r\n        if (off >= len)\r\n            return nullptr;\r\n        return (const char *)memchr(d + off, byte, len - off);\r\n    }\r\n\r\n    bool UnpackLE(void *strct, size_t size, const char *format, size_t off=0) const {\r\n        return Unpack(strct, size, format, off, false);\r\n    }\r\n    bool UnpackBE(void *strct, size_t size, const char *format, size_t off=0) const {\r\n        return Unpack(strct, size, format, off, true);\r\n    }\r\n    bool Unpack(void *strct, size_t size, const char *format, bool isBE, size_t off=0) const {\r\n        return Unpack(strct, size, format, off, isBE);\r\n    }\r\n};\r\n"
  },
  {
    "path": "src/utils/ByteWriter.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nclass ByteWriterLE {\r\n    uint8_t *dst;\r\n    size_t bytesLeft;\r\n\r\npublic:\r\n    ByteWriterLE(unsigned char *dst, size_t len) : dst((uint8_t *)dst), bytesLeft(len) { }\r\n    ByteWriterLE(char *dst, size_t len) : dst((uint8_t *)dst), bytesLeft(len) { }\r\n\r\n    bool Write8(uint8_t val) {\r\n        if (!bytesLeft)\r\n            return false;\r\n        *dst++ = val;\r\n        bytesLeft--;\r\n        return true;\r\n    }\r\n\r\n    bool Write16(uint16_t val) {\r\n        return Write8(val & 0xFF) && Write8((val >> 8) & 0xFF);\r\n    }\r\n\r\n    bool Write32(uint32_t val) {\r\n        return Write8(val & 0xFF) && Write8((val >> 8) & 0xFF) && Write8((val >> 16) & 0xFF) && Write8((val >> 24) & 0xFF);\r\n    }\r\n\r\n    bool Write64(uint64_t val) {\r\n        return Write32(val & 0xFFFFFFFF) && Write32((val >> 32) & 0xFFFFFFFF);\r\n    }\r\n};\r\n\r\nclass ByteWriterBE {\r\n    uint8_t *dst;\r\n    size_t bytesLeft;\r\n\r\npublic:\r\n    ByteWriterBE(unsigned char *dst, size_t len) : dst((uint8_t *)dst), bytesLeft(len) { }\r\n    ByteWriterBE(char *dst, size_t len) : dst((uint8_t *)dst), bytesLeft(len) { }\r\n\r\n    bool Write8(uint8_t val) {\r\n        if (!bytesLeft)\r\n            return false;\r\n        *dst++ = val;\r\n        bytesLeft--;\r\n        return true;\r\n    }\r\n\r\n    bool Write16(uint16_t val) {\r\n        return Write8((val >> 8) & 0xFF) && Write8(val & 0xFF);\r\n    }\r\n\r\n    bool Write32(uint32_t val) {\r\n        return Write8((val >> 24) & 0xFF) && Write8((val >> 16) & 0xFF) && Write8((val >> 8) & 0xFF) && Write8(val & 0xFF);\r\n    }\r\n\r\n    bool Write64(uint64_t val) {\r\n        return Write32((val >> 32) & 0xFFFFFFFF) && Write32(val & 0xFFFFFFFF);\r\n    }\r\n};\r\n"
  },
  {
    "path": "src/utils/CmdLineParser.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"CmdLineParser.h\"\r\n\r\n// Parses a command line according to the specification at\r\n// http://msdn.microsoft.com/en-us/library/17w5ykft.aspx :\r\n// * arguments are delimited by spaces or tabs\r\n// * whitespace in between two quotation marks are part of a single argument\r\n// * a single backslash in front of a quotation mark prevents this special treatment\r\n// * an even number of backslashes followed by either a backslash and a quotation\r\n//   mark or just a quotation mark is collapsed into half as many backslashes\r\nvoid ParseCmdLine(const WCHAR *cmdLine, WStrVec& out, int maxParts)\r\n{\r\n    if (!cmdLine)\r\n        return;\r\n\r\n    str::Str<WCHAR> arg(MAX_PATH / 2);\r\n    const WCHAR *s;\r\n\r\n    while (--maxParts != 0) {\r\n        while (str::IsWs(*cmdLine))\r\n            cmdLine++;\r\n        if (!*cmdLine)\r\n            break;\r\n\r\n        bool insideQuotes = false;\r\n        for (; *cmdLine; cmdLine++) {\r\n            if ('\"' == *cmdLine) {\r\n                insideQuotes = !insideQuotes;\r\n                continue;\r\n            }\r\n            if (!insideQuotes && str::IsWs(*cmdLine)) {\r\n                break;\r\n            }\r\n            if ('\\\\' == *cmdLine) {\r\n                for (s = cmdLine + 1; '\\\\' == *s; s++);\r\n                // backslashes escape only when followed by a quotation mark\r\n                if ('\"' == *s)\r\n                    cmdLine++;\r\n            }\r\n            arg.Append(*cmdLine);\r\n        }\r\n        out.Append(arg.StealData());\r\n    }\r\n\r\n    if (*cmdLine) {\r\n        while (str::IsWs(*cmdLine))\r\n            cmdLine++;\r\n        if (*cmdLine)\r\n            out.Append(str::Dup(cmdLine));\r\n    }\r\n}\r\n"
  },
  {
    "path": "src/utils/CmdLineParser.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nvoid ParseCmdLine(const WCHAR *cmdLine, WStrVec& out, int maxParts=-1);\r\n"
  },
  {
    "path": "src/utils/CryptoUtil.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#ifndef NO_LIBMUPDF\r\nextern \"C\" {\r\n#include <mupdf/fitz/crypt.h>\r\n}\r\n#endif\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"CryptoUtil.h\"\r\n\r\n#ifndef DWORD_MAX\r\n#define DWORD_MAX 0xffffffffUL\r\n#endif\r\n\r\n#ifndef NO_LIBMUPDF\r\n\r\nvoid CalcMD5Digest(const unsigned char *data, size_t byteCount, unsigned char digest[16])\r\n{\r\n    fz_md5 md5;\r\n    fz_md5_init(&md5);\r\n#ifdef _WIN64\r\n    for (; byteCount > UINT_MAX; data += UINT_MAX, byteCount -= UINT_MAX)\r\n        fz_md5_update(&md5, data, UINT_MAX);\r\n#endif\r\n    fz_md5_update(&md5, data, (unsigned int)byteCount);\r\n    fz_md5_final(&md5, digest);\r\n}\r\n\r\nvoid CalcSHA2Digest(const unsigned char *data, size_t byteCount, unsigned char digest[32])\r\n{\r\n    fz_sha256 sha2;\r\n    fz_sha256_init(&sha2);\r\n#ifdef _WIN64\r\n    for (; byteCount > UINT_MAX; data += UINT_MAX, byteCount -= UINT_MAX)\r\n        fz_sha256_update(&sha2, data, UINT_MAX);\r\n#endif\r\n    fz_sha256_update(&sha2, data, (unsigned int)byteCount);\r\n    fz_sha256_final(&sha2, digest);\r\n}\r\n\r\n#else\r\n\r\nvoid CalcMD5Digest(const unsigned char *data, size_t byteCount, unsigned char digest[16])\r\n{\r\n    CalcMD5DigestWin(data, byteCount, digest);\r\n}\r\n\r\nvoid CalcSHA2Digest(const unsigned char *data, size_t byteCount, unsigned char digest[32])\r\n{\r\n    CalcSha2DigestWin(data, byteCount, digest);\r\n}\r\n\r\n#endif\r\n\r\n// Note: this crashes under Win2000, use SHA2 or MD5 instad\r\nvoid CalcSHA1Digest(const unsigned char *data, size_t byteCount, unsigned char digest[20])\r\n{\r\n    CalcSha1DigestWin(data, byteCount, digest);\r\n}\r\n\r\n// Note: MS_ENH_RSA_AES_PROV, etc. aren't defined in the SDK shipping with VS2008\r\n#ifndef MS_ENH_RSA_AES_PROV\r\n#define MS_ENH_RSA_AES_PROV L\"Microsoft Enhanced RSA and AES Cryptographic Provider\"\r\n#endif\r\n#ifndef MS_ENH_RSA_AES_PROV_XP\r\n#define MS_ENH_RSA_AES_PROV_XP L\"Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)\"\r\n#endif\r\n#ifndef PROV_RSA_AES\r\n#define PROV_RSA_AES 24\r\n#endif\r\n// Note: CALG_SHA_256 isn't available for Windows XP SP2 and below\r\n#ifndef CALG_SHA_256\r\n#define ALG_SID_SHA_256 12\r\n#define CALG_SHA_256    (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_256)\r\n#endif\r\n\r\n// MD5 digest that uses Windows' CryptoAPI. It's good for code that doesn't already\r\n// have MD5 code (smaller code) and it's probably faster than most other implementations\r\n// TODO: could try to use CryptoNG available starting in Vista. But then again, would that be worth it?\r\nvoid CalcMD5DigestWin(const void *data, size_t byteCount, unsigned char digest[16])\r\n{\r\n    HCRYPTPROV hProv = 0;\r\n    HCRYPTHASH hHash = 0;\r\n\r\n    // http://stackoverflow.com/questions/9794745/ms-cryptoapi-doesnt-work-on-windows-xp-with-cryptacquirecontext\r\n    BOOL ok = CryptAcquireContext(&hProv, nullptr, MS_DEF_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);\r\n    if (!ok)\r\n        ok = CryptAcquireContext(&hProv, nullptr, MS_ENH_RSA_AES_PROV_XP, PROV_RSA_AES, CRYPT_VERIFYCONTEXT);\r\n\r\n    CrashAlwaysIf(!ok);\r\n    ok = CryptCreateHash(hProv, CALG_MD5, 0, 0, &hHash);\r\n    CrashAlwaysIf(!ok);\r\n#ifdef _WIN64\r\n    for (; byteCount > DWORD_MAX; data = (const BYTE *)data + DWORD_MAX, byteCount -= DWORD_MAX) {\r\n        ok = CryptHashData(hHash, (const BYTE *)data, DWORD_MAX, 0);\r\n        CrashAlwaysIf(!ok);\r\n    }\r\n#endif\r\n    CrashAlwaysIf(byteCount > DWORD_MAX);\r\n    ok = CryptHashData(hHash, (const BYTE*)data, (DWORD)byteCount, 0);\r\n    CrashAlwaysIf(!ok);\r\n\r\n    DWORD hashLen;\r\n    DWORD argSize = sizeof(DWORD);\r\n    ok = CryptGetHashParam(hHash, HP_HASHSIZE, (BYTE *)&hashLen, &argSize, 0);\r\n    CrashIf(sizeof(DWORD) != argSize);\r\n    CrashAlwaysIf(!ok);\r\n    CrashAlwaysIf(16 != hashLen);\r\n    ok = CryptGetHashParam(hHash, HP_HASHVAL, digest, &hashLen, 0);\r\n    CrashAlwaysIf(!ok);\r\n    CrashAlwaysIf(16 != hashLen);\r\n    CryptDestroyHash(hHash);\r\n    CryptReleaseContext(hProv,0);\r\n}\r\n\r\n// SHA1 digest that uses Windows' CryptoAPI. It's good for code that doesn't already\r\n// have SHA1 code (smaller code) and it's probably faster than most other implementations\r\n// TODO: hasn't been tested for corectness\r\nvoid CalcSha1DigestWin(const void *data, size_t byteCount, unsigned char digest[20])\r\n{\r\n    HCRYPTPROV hProv = 0;\r\n    HCRYPTHASH hHash = 0;\r\n\r\n    BOOL ok = CryptAcquireContext(&hProv, nullptr, MS_DEF_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);\r\n    CrashAlwaysIf(!ok);\r\n    ok = CryptCreateHash(hProv, CALG_SHA1, 0, 0, &hHash);\r\n    CrashAlwaysIf(!ok);\r\n#ifdef _WIN64\r\n    for (; byteCount > DWORD_MAX; data = (const BYTE *)data + DWORD_MAX, byteCount -= DWORD_MAX) {\r\n        ok = CryptHashData(hHash, (const BYTE *)data, DWORD_MAX, 0);\r\n        CrashAlwaysIf(!ok);\r\n    }\r\n#endif\r\n    CrashAlwaysIf(byteCount > DWORD_MAX);\r\n    ok = CryptHashData(hHash, (const BYTE*)data, (DWORD)byteCount, 0);\r\n    CrashAlwaysIf(!ok);\r\n\r\n    DWORD hashLen;\r\n    DWORD argSize = sizeof(DWORD);\r\n    ok = CryptGetHashParam(hHash, HP_HASHSIZE, (BYTE *)&hashLen, &argSize, 0);\r\n    CrashIf(sizeof(DWORD) != argSize);\r\n    CrashAlwaysIf(!ok);\r\n    CrashAlwaysIf(20 != hashLen);\r\n    ok = CryptGetHashParam(hHash, HP_HASHVAL, digest, &hashLen, 0);\r\n    CrashAlwaysIf(!ok);\r\n    CrashAlwaysIf(20 != hashLen);\r\n    CryptDestroyHash(hHash);\r\n    CryptReleaseContext(hProv,0);\r\n}\r\n\r\nvoid CalcSha2DigestWin(const void *data, size_t byteCount, unsigned char digest[32])\r\n{\r\n    HCRYPTPROV hProv = 0;\r\n    HCRYPTHASH hHash = 0;\r\n\r\n    BOOL ok = CryptAcquireContext(&hProv, nullptr, MS_ENH_RSA_AES_PROV, PROV_RSA_AES, CRYPT_VERIFYCONTEXT);\r\n    if (!ok) {\r\n        // TODO: test this on XP SP3\r\n        ok = CryptAcquireContext(&hProv, nullptr, MS_ENH_RSA_AES_PROV_XP, PROV_RSA_AES, CRYPT_VERIFYCONTEXT);\r\n    }\r\n    CrashAlwaysIf(!ok);\r\n    ok = CryptCreateHash(hProv, CALG_SHA_256, 0, 0, &hHash);\r\n    CrashAlwaysIf(!ok);\r\n#ifdef _WIN64\r\n    for (; byteCount > DWORD_MAX; data = (const BYTE *)data + DWORD_MAX, byteCount -= DWORD_MAX) {\r\n        ok = CryptHashData(hHash, (const BYTE *)data, DWORD_MAX, 0);\r\n        CrashAlwaysIf(!ok);\r\n    }\r\n#endif\r\n    CrashAlwaysIf(byteCount > DWORD_MAX);\r\n    ok = CryptHashData(hHash, (const BYTE*)data, (DWORD)byteCount, 0);\r\n    CrashAlwaysIf(!ok);\r\n\r\n    DWORD hashLen;\r\n    DWORD argSize = sizeof(DWORD);\r\n    ok = CryptGetHashParam(hHash, HP_HASHSIZE, (BYTE *)&hashLen, &argSize, 0);\r\n    CrashIf(sizeof(DWORD) != argSize);\r\n    CrashAlwaysIf(!ok);\r\n    CrashAlwaysIf(32 != hashLen);\r\n    ok = CryptGetHashParam(hHash, HP_HASHVAL, digest, &hashLen, 0);\r\n    CrashAlwaysIf(!ok);\r\n    CrashAlwaysIf(32 != hashLen);\r\n    CryptDestroyHash(hHash);\r\n    CryptReleaseContext(hProv,0);\r\n}\r\n\r\nstatic bool ExtractSignature(const char *hexSignature, const void *data, size_t& dataLen, ScopedMem<BYTE>& signature, size_t& signatureLen)\r\n{\r\n    // verify hexSignature format - must be either\r\n    // * a string starting with \"sha1:\" followed by the signature (and optionally whitespace and further content)\r\n    // * nullptr, then the signature must be found on the last line of non-binary data, starting at \" Signature sha1:\"\r\n    if (str::StartsWith(hexSignature, \"sha1:\"))\r\n        hexSignature += 5;\r\n    else if (!hexSignature) {\r\n        if (dataLen < 20 || memchr(data, 0, dataLen))\r\n            return false;\r\n        const char *lastLine = (const char *)data + dataLen - 1;\r\n        while (lastLine > data && *(lastLine - 1) != '\\n')\r\n            lastLine--;\r\n        if (lastLine == data || !str::Find(lastLine, \" Signature sha1:\"))\r\n            return false;\r\n        dataLen = lastLine - (const char *)data;\r\n        hexSignature = str::Find(lastLine, \" Signature sha1:\") + 16;\r\n    }\r\n    else\r\n        return false;\r\n\r\n    str::Str<BYTE> signatureBytes;\r\n    for (const char *c = hexSignature; *c && !str::IsWs(*c); c += 2) {\r\n        int val;\r\n        if (1 != sscanf_s(c, \"%02x\", &val))\r\n            return false;\r\n        signatureBytes.Append((BYTE)val);\r\n    }\r\n    signatureLen = signatureBytes.Size();\r\n    signature.Set(signatureBytes.StealData());\r\n    return true;\r\n}\r\n\r\nbool VerifySHA1Signature(const void *data, size_t dataLen, const char *hexSignature, const void *pubkey, size_t pubkeyLen)\r\n{\r\n    HCRYPTPROV hProv = 0;\r\n    HCRYPTKEY hPubKey = 0;\r\n    HCRYPTHASH hHash = 0;\r\n    BOOL ok = false;\r\n    ScopedMem<BYTE> signature;\r\n    size_t signatureLen;\r\n\r\n#define Check(val) if ((ok = (val)) == FALSE) goto CleanUp\r\n    Check(ExtractSignature(hexSignature, data, dataLen, signature, signatureLen));\r\n    Check(CryptAcquireContext(&hProv, nullptr, MS_DEF_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT));\r\n    Check(CryptImportKey(hProv, (const BYTE *)pubkey, (DWORD)pubkeyLen, 0, 0, &hPubKey));\r\n    Check(CryptCreateHash(hProv, CALG_SHA1, 0, 0, &hHash));\r\n#ifdef _WIN64\r\n    for (; dataLen > DWORD_MAX; data = (const BYTE *)data + DWORD_MAX, dataLen -= DWORD_MAX) {\r\n        Check(CryptHashData(hHash, (const BYTE *)data, DWORD_MAX, 0));\r\n    }\r\n#endif\r\n    Check(dataLen <= DWORD_MAX && pubkeyLen <= DWORD_MAX && signatureLen <= DWORD_MAX);\r\n    Check(CryptHashData(hHash, (const BYTE *)data, (DWORD)dataLen, 0));\r\n    Check(CryptVerifySignature(hHash, signature, (DWORD)signatureLen, hPubKey, nullptr, 0));\r\n#undef Check\r\n\r\nCleanUp:\r\n    if (hHash)\r\n        CryptDestroyHash(hHash);\r\n    if (hProv)\r\n        CryptReleaseContext(hProv, 0);\r\n    return ok;\r\n}\r\n"
  },
  {
    "path": "src/utils/CryptoUtil.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nvoid CalcMD5Digest(const unsigned char *data, size_t byteCount, unsigned char digest[16]);\r\nvoid CalcSHA1Digest(const unsigned char *data, size_t byteCount, unsigned char digest[20]);\r\nvoid CalcSHA2Digest(const unsigned char *data, size_t byteCount, unsigned char digest[32]);\r\n\r\nvoid CalcMD5DigestWin(const void *data, size_t byteCount, unsigned char digest[16]);\r\nvoid CalcSha1DigestWin(const void *data, size_t byteCount, unsigned char digest[20]);\r\nvoid CalcSha2DigestWin(const void *data, size_t byteCount, unsigned char digest[32]);\r\n\r\nbool VerifySHA1Signature(const void *data, size_t dataLen, const char *hexSignature, const void *pubkey, size_t pubkeyLen);\r\n"
  },
  {
    "path": "src/utils/CssParser.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"CssParser.h\"\r\n\r\n// TODO: the following parser doesn't comply yet with\r\n// http://www.w3.org/TR/CSS21/syndata.html#syntax\r\n\r\n// return true if skipped\r\nstatic bool SkipWsAndComments(const char*& s, const char *end)\r\n{\r\n    const char *start = s;\r\n    for (; s < end && str::IsWs(*s); s++);\r\n    while (s + 2 <= end && s[0] == '/' && s[1] == '*') {\r\n        for (s += 2; s < end; s++) {\r\n            if (s + 2 <= end && s[0] == '*' && s[1] == '/') {\r\n                s += 2;\r\n                break;\r\n            }\r\n        }\r\n        for (; s < end && str::IsWs(*s); s++);\r\n    }\r\n    return start != s;\r\n}\r\n\r\n// returns false if there was no closing quotation mark\r\nstatic bool SkipQuotedString(const char*& s, const char *end)\r\n{\r\n    char quote = *s;\r\n    while (++s < end && *s != quote) {\r\n        if (*s == '\\\\')\r\n            s++;\r\n    }\r\n    if (s == end)\r\n        return false;\r\n    s++;\r\n    return true;\r\n}\r\n\r\nstatic bool SkipBlock(const char*& s, const char *end)\r\n{\r\n    CrashIf(s >= end || *s != '{');\r\n    s++;\r\n    while (s < end && *s != '}') {\r\n        if (*s == '\"' || *s == '\\'') {\r\n            if (!SkipQuotedString(s, end))\r\n                return false;\r\n        }\r\n        else if (*s == '{') {\r\n            if (!SkipBlock(s, end))\r\n                return false;\r\n        }\r\n        else if (*s == '\\\\' && s < end - 1)\r\n            s += 2;\r\n        else if (!SkipWsAndComments(s, end))\r\n            s++;\r\n    }\r\n    if (s == end)\r\n        return false;\r\n    s++;\r\n    return true;\r\n}\r\n\r\nbool CssPullParser::NextRule()\r\n{\r\n    if (inProps)\r\n        while (NextProperty());\r\n    CrashIf(inProps && currPos < end);\r\n    if (inlineStyle || currPos == end)\r\n        return false;\r\n\r\n    if (currPos == s) {\r\n        SkipWsAndComments(currPos, end);\r\n        if (currPos + 4 < end && str::StartsWith(currPos, \"<!--\"))\r\n            currPos += 4;\r\n    }\r\n\r\n    SkipWsAndComments(currPos, end);\r\n    currSel = currPos;\r\n    // skip selectors\r\n    while (currPos < end && *currPos != '{') {\r\n        if (*currPos == '\"' || *currPos == '\\'') {\r\n            if (!SkipQuotedString(currPos, end))\r\n                break;\r\n        }\r\n        else if (*currPos == ';') {\r\n            currPos++;\r\n            SkipWsAndComments(currPos, end);\r\n            currSel = currPos;\r\n        }\r\n        else if (!SkipWsAndComments(currPos, end)) {\r\n            currPos++;\r\n        }\r\n    }\r\n\r\n    if (currPos == end) {\r\n        currSel = nullptr;\r\n        return false;\r\n    }\r\n    selEnd = currPos++;\r\n    inProps = true;\r\n    return true;\r\n}\r\n\r\nconst CssSelector *CssPullParser::NextSelector()\r\n{\r\n    if (!currSel)\r\n        return nullptr;\r\n    SkipWsAndComments(currSel, selEnd);\r\n    if (currSel == selEnd)\r\n        return nullptr;\r\n\r\n    sel.s = currSel;\r\n    // skip single selector\r\n    const char *sEnd = currSel;\r\n    while (currSel < selEnd && *currSel != ',') {\r\n        if (*currSel == '\"' || *currSel == '\\'') {\r\n            bool ok = SkipQuotedString(currSel, selEnd);\r\n            CrashIf(!ok);\r\n            sEnd = currSel;\r\n        }\r\n        else if (*currSel == '\\\\' && currSel < selEnd - 1) {\r\n            currSel += 2;\r\n            sEnd = currSel;\r\n        }\r\n        else if (!SkipWsAndComments(currSel, selEnd)) {\r\n            sEnd = ++currSel;\r\n        }\r\n    }\r\n    if (currSel < selEnd)\r\n        currSel++;\r\n\r\n    sel.sLen = sEnd - sel.s;\r\n    sel.tag = Tag_NotFound;\r\n    sel.clazz = nullptr;\r\n    sel.clazzLen = 0;\r\n\r\n    // parse \"*\", \"el\", \".class\" and \"el.class\"\r\n    const char *c = sEnd;\r\n    for (; c > sel.s && (isalnum((unsigned char)*(c - 1)) || *(c - 1) == '-'); c--);\r\n    if (c > sel.s && *(c - 1) == '.') {\r\n        sel.clazz = c;\r\n        sel.clazzLen = sEnd - c;\r\n        c--;\r\n    }\r\n    for (; c > sel.s && (isalnum((unsigned char)*(c - 1)) || *(c - 1) == '-'); c--);\r\n    if (sel.clazz - 1 == sel.s) {\r\n        sel.tag = Tag_Any;\r\n    }\r\n    else if (c == (sel.clazz ? sel.clazz - 1 : sEnd) && c == sel.s + 1 && *sel.s == '*') {\r\n        sel.tag = Tag_Any;\r\n    }\r\n    else if (c == sel.s) {\r\n        sel.tag = FindHtmlTag(sel.s, sel.clazz ? sel.clazz - sel.s - 1 : sel.sLen);\r\n    }\r\n\r\n    return &sel;\r\n}\r\n\r\nconst CssProperty *CssPullParser::NextProperty()\r\n{\r\n    if (currPos == s)\r\n        inlineStyle = inProps = true;\r\n    else if (!inProps)\r\n        return nullptr;\r\n\r\nGetNextProperty:\r\n    SkipWsAndComments(currPos, end);\r\n    if (currPos == end)\r\n        return nullptr;\r\n    if (*currPos == '}') {\r\n        currPos++;\r\n        inProps = false;\r\n        return nullptr;\r\n    }\r\n    if (*currPos == '{') {\r\n        if (!SkipBlock(currPos, end))\r\n            return nullptr;\r\n        goto GetNextProperty;\r\n    }\r\n    if (*currPos == ';') {\r\n        currPos++;\r\n        goto GetNextProperty;\r\n    }\r\n    const char *name = currPos;\r\n    // skip identifier\r\n    while (currPos < end && !str::IsWs(*currPos) && *currPos != ':' &&\r\n        *currPos != ';' && *currPos != '{' && *currPos != '}') {\r\n        currPos++;\r\n    }\r\n    SkipWsAndComments(currPos, end);\r\n    if (currPos == end || *currPos != ':')\r\n        goto GetNextProperty;\r\n    prop.type = FindCssProp(name, currPos - name);\r\n    currPos++;\r\n    SkipWsAndComments(currPos, end);\r\n\r\n    prop.s = currPos;\r\n    // skip value\r\n    const char *valEnd = currPos;\r\n    while (currPos < end && *currPos != ';' && *currPos != '}') {\r\n        if (*currPos == '\"' || *currPos == '\\'') {\r\n            if (!SkipQuotedString(currPos, end))\r\n                return nullptr;\r\n            valEnd = currPos;\r\n        }\r\n        else if (*currPos == '{') {\r\n            if (!SkipBlock(currPos, end))\r\n                return nullptr;\r\n            valEnd = currPos;\r\n        }\r\n        else if (*currPos == '\\\\' && currPos < end - 1) {\r\n            currPos += 2;\r\n            valEnd = currPos;\r\n        }\r\n        else if (!SkipWsAndComments(currPos, end)) {\r\n            valEnd = ++currPos;\r\n        }\r\n    }\r\n    prop.sLen = valEnd - prop.s;\r\n\r\n    return &prop;\r\n}\r\n"
  },
  {
    "path": "src/utils/CssParser.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#define Tag_Any ((HtmlTag)-1)\r\n\r\nstruct CssSelector {\r\n    const char *s;\r\n    size_t      sLen;\r\n    // for convenience\r\n    HtmlTag     tag;\r\n    const char *clazz;\r\n    size_t      clazzLen;\r\n};\r\n\r\nstruct CssProperty {\r\n    CssProp     type;\r\n    const char *s;\r\n    size_t      sLen;\r\n};\r\n\r\nclass CssPullParser {\r\n    const char *s;\r\n    const char *currPos;\r\n    const char *end;\r\n\r\n    bool        inProps;\r\n    bool        inlineStyle;\r\n\r\n    const char *currSel;\r\n    const char *selEnd;\r\n\r\n    CssSelector sel;\r\n    CssProperty prop;\r\n\r\npublic:\r\n    CssPullParser(const char *s, size_t len) :\r\n        s(s), currPos(s), end(s + len), inProps(false),\r\n        inlineStyle(false), currSel(nullptr) { }\r\n\r\n    // call NextRule first for parsing a style element and\r\n    // NextProperty only for parsing a single style attribute\r\n    bool NextRule();\r\n    const CssSelector *NextSelector();\r\n    const CssProperty *NextProperty();\r\n};\r\n"
  },
  {
    "path": "src/utils/DbgHelpDyn.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD */\r\n\r\n/* Wrappers around dbghelp.dll that load it on demand and provide\r\n   utility functions related to debugging like getting callstacs etc.\r\n   This module is carefully written to not allocate memory as it\r\n   can be used from crash handler.\r\n*/\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"WinDynCalls.h\"\r\n#include \"DbgHelpDyn.h\"\r\n#include \"FileUtil.h\"\r\n#include \"WinUtil.h\"\r\n\r\n/* Hard won wisdom: changing symbol path with SymSetSearchPath() after modules\r\n   have been loaded (invideProcess=TRUE in SymInitialize() or SymRefreshModuleList())\r\n   doesn't work.\r\n   I had to provide symbol path in SymInitialize() (and either invideProcess=TRUE\r\n   or invideProcess=FALSE and call SymRefreshModuleList()). There's probably\r\n   a way to force it, but I'm happy I found a way that works.\r\n*/\r\n\r\nnamespace dbghelp {\r\n\r\nstatic char *ExceptionNameFromCode(DWORD excCode)\r\n{\r\n#define EXC(x) case EXCEPTION_##x: return #x;\r\n\r\n    switch (excCode)\r\n    {\r\n        EXC(ACCESS_VIOLATION)\r\n        EXC(DATATYPE_MISALIGNMENT)\r\n        EXC(BREAKPOINT)\r\n        EXC(SINGLE_STEP)\r\n        EXC(ARRAY_BOUNDS_EXCEEDED)\r\n        EXC(FLT_DENORMAL_OPERAND)\r\n        EXC(FLT_DIVIDE_BY_ZERO)\r\n        EXC(FLT_INEXACT_RESULT)\r\n        EXC(FLT_INVALID_OPERATION)\r\n        EXC(FLT_OVERFLOW)\r\n        EXC(FLT_STACK_CHECK)\r\n        EXC(FLT_UNDERFLOW)\r\n        EXC(INT_DIVIDE_BY_ZERO)\r\n        EXC(INT_OVERFLOW)\r\n        EXC(PRIV_INSTRUCTION)\r\n        EXC(IN_PAGE_ERROR)\r\n        EXC(ILLEGAL_INSTRUCTION)\r\n        EXC(NONCONTINUABLE_EXCEPTION)\r\n        EXC(STACK_OVERFLOW)\r\n        EXC(INVALID_DISPOSITION)\r\n        EXC(GUARD_PAGE)\r\n        EXC(INVALID_HANDLE)\r\n    }\r\n#undef EXC\r\n\r\n    static char buf[512] = { 0 };\r\n\r\n    FormatMessageA(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_HMODULE,\r\n        GetModuleHandleA(\"ntdll.dll\"),\r\n        excCode, 0, buf, sizeof(buf), 0);\r\n\r\n    return buf;\r\n}\r\n\r\n#if 0\r\nstatic bool SetupSymbolPath()\r\n{\r\n    if (!DynSymSetSearchPathW && !DynSymSetSearchPath) {\r\n        plog(\"SetupSymbolPath(): DynSymSetSearchPathW and DynSymSetSearchPath missing\");\r\n        return false;\r\n    }\r\n\r\n    ScopedMem<WCHAR> path(GetSymbolPath());\r\n    if (!path) {\r\n        plog(\"SetupSymbolPath(): GetSymbolPath() returned nullptr\");\r\n        return false;\r\n    }\r\n\r\n    BOOL ok = FALSE;\r\n    ScopedMem<WCHAR> tpath(str::conv::FromWStr(path));\r\n    if (DynSymSetSearchPathW) {\r\n        ok = DynSymSetSearchPathW(GetCurrentProcess(), path);\r\n        if (!ok)\r\n            plog(\"DynSymSetSearchPathW() failed\");\r\n    } else {\r\n        ScopedMem<char> tmp(str::conv::ToAnsi(tpath));\r\n        ok = DynSymSetSearchPath(GetCurrentProcess(), tmp);\r\n        if (!ok)\r\n            plog(\"DynSymSetSearchPath() failed\");\r\n    }\r\n\r\n    DynSymRefreshModuleList(GetCurrentProcess());\r\n    return ok;\r\n}\r\n#endif\r\n\r\nstatic BOOL gSymInitializeOk = FALSE;\r\n\r\nstatic bool CanStackWalk()\r\n{\r\n    bool ok = DynSymCleanup && DynSymGetOptions &&\r\n        DynSymSetOptions && DynStackWalk64 && DynSymFunctionTableAccess64 &&\r\n        DynSymGetModuleBase64 && DynSymFromAddr;\r\n    //if (!ok)\r\n    //    plog(\"dbghelp::CanStackWalk(): no\");\r\n    return ok;\r\n}\r\n\r\n__declspec(noinline) bool CanSymbolizeAddress(DWORD64 addr)\r\n{\r\n    static const int MAX_SYM_LEN = 512;\r\n\r\n    char buf[sizeof(SYMBOL_INFO) + MAX_SYM_LEN * sizeof(char)];\r\n    SYMBOL_INFO *symInfo = (SYMBOL_INFO*)buf;\r\n\r\n    memset(buf, 0, sizeof(buf));\r\n    symInfo->SizeOfStruct = sizeof(SYMBOL_INFO);\r\n    symInfo->MaxNameLen = MAX_SYM_LEN;\r\n\r\n    DWORD64 symDisp = 0;\r\n    BOOL ok = DynSymFromAddr(GetCurrentProcess(), addr, &symDisp, symInfo);\r\n    return ok && symInfo->Name[0];\r\n}\r\n\r\n// a heuristic to test if we have symbols for our own binaries by testing if\r\n// we can get symbol for any of our functions.\r\nbool HasSymbols()\r\n{\r\n    DWORD64 addr = (DWORD64)&CanSymbolizeAddress;\r\n    return CanSymbolizeAddress(addr);\r\n}\r\n\r\n// Load and initialize dbghelp.dll. Returns false if failed.\r\n// To simplify callers, it can be called multiple times - it only does the\r\n// work the first time, unless force is true, in which case we re-initialize\r\n// the library (needed in crash dump where we re-initialize dbghelp.dll after\r\n// downloading symbols)\r\nbool Initialize(const WCHAR *symPathW, bool force)\r\n{\r\n    if (gSymInitializeOk && !force)\r\n        return true;\r\n\r\n    bool needsCleanup = gSymInitializeOk;\r\n\r\n    if (!DynSymInitializeW && !DynSymInitialize) {\r\n        //plog(\"dbghelp::Initialize(): SymInitializeW() and SymInitialize() not present in dbghelp.dll\");\r\n        return false;\r\n    }\r\n\r\n    if (needsCleanup)\r\n        DynSymCleanup(GetCurrentProcess());\r\n\r\n    if (DynSymInitializeW) {\r\n        gSymInitializeOk = DynSymInitializeW(GetCurrentProcess(), symPathW, TRUE);\r\n    } else {\r\n        // SymInitializeW() is not present on some XP systems\r\n        char symPathA[MAX_PATH];\r\n        if (0 != str::conv::ToCodePageBuf(symPathA, dimof(symPathA), symPathW, CP_ACP))\r\n            gSymInitializeOk = DynSymInitialize(GetCurrentProcess(), symPathA, TRUE);\r\n    }\r\n\r\n    if (!gSymInitializeOk) {\r\n        //plog(\"dbghelp::Initialize(): _SymInitialize() failed\");\r\n        return false;\r\n    }\r\n\r\n    DWORD symOptions = DynSymGetOptions();\r\n    symOptions |= (SYMOPT_LOAD_LINES | SYMOPT_DEFERRED_LOADS | SYMOPT_UNDNAME);\r\n    symOptions |= SYMOPT_FAIL_CRITICAL_ERRORS; // don't show system msg box on errors\r\n    DynSymSetOptions(symOptions);\r\n\r\n    //SetupSymbolPath();\r\n    return true;\r\n}\r\n\r\nstatic BOOL CALLBACK OpenMiniDumpCallback(void *param, PMINIDUMP_CALLBACK_INPUT input, PMINIDUMP_CALLBACK_OUTPUT output)\r\n{\r\n    UNUSED(param);\r\n    if (!input || !output)\r\n        return FALSE;\r\n\r\n    switch (input->CallbackType) {\r\n    case ModuleCallback:\r\n        if (!(output->ModuleWriteFlags & ModuleReferencedByMemory))\r\n            output->ModuleWriteFlags &= ~ModuleWriteModule;\r\n        return TRUE;\r\n    case IncludeModuleCallback:\r\n    case IncludeThreadCallback:\r\n    case ThreadCallback:\r\n    case ThreadExCallback:\r\n        return TRUE;\r\n    default:\r\n        return FALSE;\r\n    }\r\n}\r\n\r\nvoid WriteMiniDump(const WCHAR *crashDumpFilePath, MINIDUMP_EXCEPTION_INFORMATION* mei, bool fullDump)\r\n{\r\n    if (!Initialize(nullptr, false) || !DynMiniDumpWriteDump)\r\n        return;\r\n\r\n    HANDLE hFile = CreateFile(crashDumpFilePath, GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH, nullptr);\r\n    if (INVALID_HANDLE_VALUE == hFile)\r\n        return;\r\n\r\n    MINIDUMP_TYPE type = (MINIDUMP_TYPE)(MiniDumpNormal | MiniDumpWithIndirectlyReferencedMemory | MiniDumpScanMemory);\r\n    if (fullDump)\r\n        type = (MINIDUMP_TYPE)(type | MiniDumpWithDataSegs | MiniDumpWithHandleData | MiniDumpWithPrivateReadWriteMemory);\r\n    MINIDUMP_CALLBACK_INFORMATION mci = { OpenMiniDumpCallback, nullptr };\r\n\r\n    DynMiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, type, mei, nullptr, &mci);\r\n\r\n    CloseHandle(hFile);\r\n}\r\n\r\nstatic bool GetAddrInfo(void *addr, char *module, DWORD moduleLen, DWORD& sectionOut, DWORD_PTR& offsetOut)\r\n{\r\n    MEMORY_BASIC_INFORMATION mbi;\r\n    if (0 == VirtualQuery(addr, &mbi, sizeof(mbi)))\r\n        return false;\r\n\r\n    HMODULE hMod = (HMODULE)mbi.AllocationBase;\r\n    if (0 == hMod)\r\n        return false;\r\n\r\n    if (!GetModuleFileNameA(hMod, module, moduleLen))\r\n        return false;\r\n    module[moduleLen - 1] = '\\0';\r\n\r\n    PIMAGE_DOS_HEADER dosHeader = (PIMAGE_DOS_HEADER)mbi.AllocationBase;\r\n    PIMAGE_NT_HEADERS pNtHeader = (PIMAGE_NT_HEADERS)((BYTE *)dosHeader + dosHeader->e_lfanew);\r\n    PIMAGE_SECTION_HEADER section = IMAGE_FIRST_SECTION(pNtHeader);\r\n\r\n    DWORD_PTR lAddr = (DWORD_PTR)addr - (DWORD_PTR)hMod;\r\n    for (unsigned int i = 0; i < pNtHeader->FileHeader.NumberOfSections; i++) {\r\n        DWORD_PTR startAddr = section->VirtualAddress;\r\n        DWORD_PTR endAddr = startAddr;\r\n        if (section->SizeOfRawData > section->Misc.VirtualSize)\r\n            endAddr += section->SizeOfRawData;\r\n        else\r\n            section->Misc.VirtualSize;\r\n\r\n        if (lAddr >= startAddr && lAddr <= endAddr) {\r\n            sectionOut = i+1;\r\n            offsetOut = lAddr - startAddr;\r\n            return true;\r\n        }\r\n        section++;\r\n    }\r\n    return false;\r\n}\r\n\r\nstatic void AppendAddress(str::Str<char>& s, DWORD64 addr)\r\n{\r\n    void *p = reinterpret_cast<void*>(addr);\r\n    s.AppendFmt(\"%p\", p);\r\n}\r\n\r\nstatic void GetAddressInfo(str::Str<char>& s, DWORD64 addr)\r\n{\r\n    static const int MAX_SYM_LEN = 512;\r\n\r\n    char buf[sizeof(SYMBOL_INFO) + MAX_SYM_LEN * sizeof(char)];\r\n    SYMBOL_INFO *symInfo = (SYMBOL_INFO*)buf;\r\n\r\n    memset(buf, 0, sizeof(buf));\r\n    symInfo->SizeOfStruct = sizeof(SYMBOL_INFO);\r\n    symInfo->MaxNameLen = MAX_SYM_LEN;\r\n\r\n    DWORD64 symDisp = 0;\r\n    char *symName = nullptr;\r\n    BOOL ok = DynSymFromAddr(GetCurrentProcess(), addr, &symDisp, symInfo);\r\n    if (ok)\r\n        symName = &(symInfo->Name[0]);\r\n\r\n    char module[MAX_PATH] = { 0 };\r\n    DWORD section;\r\n    DWORD_PTR offset;\r\n    if (GetAddrInfo((void*)addr, module, sizeof(module), section, offset)) {\r\n        str::ToLowerInPlace(module);\r\n        const char *moduleShort = path::GetBaseName(module);\r\n        AppendAddress(s, addr);\r\n        s.AppendFmt(\" %02X:\", section);\r\n        AppendAddress(s, offset);\r\n        s.AppendFmt(\" %s\", moduleShort);\r\n\r\n        if (symName) {\r\n            s.AppendFmt(\"!%s+0x%x\", symName, (int)symDisp);\r\n        } else if (symDisp != 0) {\r\n            s.AppendFmt(\"+0x%x\", (int)symDisp);\r\n        }\r\n        IMAGEHLP_LINE64 line;\r\n        line.SizeOfStruct = sizeof(IMAGEHLP_LINE64);\r\n        DWORD disp;\r\n        if (DynSymGetLineFromAddr64(GetCurrentProcess(), addr, &disp, &line)) {\r\n            s.AppendFmt(\" %s+%d\", line.FileName, line.LineNumber);\r\n        }\r\n    } else {\r\n        AppendAddress(s, addr);\r\n    }\r\n    s.Append(\"\\r\\n\");\r\n}\r\n\r\nstatic bool GetStackFrameInfo(str::Str<char>& s, STACKFRAME64 *stackFrame,\r\n                              CONTEXT *ctx, HANDLE hThread)\r\n{\r\n#if defined(_WIN64)\r\n    int machineType = IMAGE_FILE_MACHINE_AMD64;\r\n#else\r\n    int machineType = IMAGE_FILE_MACHINE_I386;\r\n#endif\r\n    BOOL ok = DynStackWalk64(machineType, GetCurrentProcess(), hThread,\r\n        stackFrame, ctx, nullptr, DynSymFunctionTableAccess64,\r\n        DynSymGetModuleBase64, nullptr);\r\n    if (!ok)\r\n        return false;\r\n\r\n    DWORD64 addr = stackFrame->AddrPC.Offset;\r\n    if (0 == addr)\r\n        return true;\r\n    if (addr == stackFrame->AddrReturn.Offset) {\r\n        s.Append(\"GetStackFrameInfo(): addr == stackFrame->AddrReturn.Offset\");\r\n        return false;\r\n    }\r\n\r\n    GetAddressInfo(s, addr);\r\n    return true;\r\n}\r\n\r\nstatic bool GetCallstack(str::Str<char>& s, CONTEXT& ctx, HANDLE hThread)\r\n{\r\n    if (!CanStackWalk()) {\r\n        s.Append(\"GetCallstack(): CanStackWalk() returned false\");\r\n        return false;\r\n    }\r\n\r\n    STACKFRAME64 stackFrame;\r\n    memset(&stackFrame, 0, sizeof(stackFrame));\r\n#ifdef _WIN64\r\n    stackFrame.AddrPC.Offset = ctx.Rip;\r\n    stackFrame.AddrFrame.Offset = ctx.Rbp;\r\n    stackFrame.AddrStack.Offset = ctx.Rsp;\r\n#else\r\n    stackFrame.AddrPC.Offset = ctx.Eip;\r\n    stackFrame.AddrFrame.Offset = ctx.Ebp;\r\n    stackFrame.AddrStack.Offset = ctx.Esp;\r\n#endif\r\n    stackFrame.AddrPC.Mode = AddrModeFlat;\r\n    stackFrame.AddrFrame.Mode = AddrModeFlat;\r\n    stackFrame.AddrStack.Mode = AddrModeFlat;\r\n\r\n    int framesCount = 0;\r\n    static const int maxFrames = 32;\r\n    while (framesCount < maxFrames)\r\n    {\r\n        if (!GetStackFrameInfo(s, &stackFrame, &ctx, hThread))\r\n            break;\r\n        framesCount++;\r\n    }\r\n    if (0 == framesCount) {\r\n        s.Append(\"StackWalk64() couldn't get even the first stack frame info\");\r\n        return false;\r\n    }\r\n    return true;\r\n}\r\n\r\nvoid GetThreadCallstack(str::Str<char>& s, DWORD threadId)\r\n{\r\n    if (threadId == GetCurrentThreadId())\r\n        return;\r\n\r\n    s.AppendFmt(\"\\r\\nThread: %x\\r\\n\", threadId);\r\n\r\n    DWORD access = THREAD_GET_CONTEXT | THREAD_QUERY_INFORMATION | THREAD_SUSPEND_RESUME;\r\n    HANDLE hThread = OpenThread(access, false, threadId);\r\n    if (!hThread) {\r\n        s.Append(\"Failed to OpenThread()\\r\\n\");\r\n        return;\r\n    }\r\n\r\n    DWORD res = SuspendThread(hThread);\r\n    if (-1 == res) {\r\n        s.Append(\"Failed to SuspendThread()\\r\\n\");\r\n    } else {\r\n        CONTEXT ctx = { 0 };\r\n        ctx.ContextFlags = CONTEXT_FULL;\r\n        BOOL ok = GetThreadContext(hThread, &ctx);\r\n        if (ok)\r\n            GetCallstack(s, ctx, hThread);\r\n        else\r\n            s.Append(\"Failed to GetThreadContext()\\r\\n\");\r\n\r\n        ResumeThread(hThread);\r\n    }\r\n    CloseHandle(hThread);\r\n}\r\n\r\n// we disable optimizations for this function as it calls RtlCaptureContext()\r\n// which cannot deal with Omit Frame Pointers optimization (/Oy explicitly, turned\r\n// implicitly by e.g. /O2)\r\n// http://www.bytetalk.net/2011/06/why-rtlcapturecontext-crashes-on.html\r\n#pragma optimize( \"\", off )\r\n// we also need to disable warning 4748 \"/GS can not protect parameters and local variables\r\n// from local buffer overrun because optimizations are disabled in function)\"\r\n#pragma warning(push)\r\n#pragma warning(disable : 4748)\r\n__declspec(noinline) bool GetCurrentThreadCallstack(str::Str<char>& s)\r\n{\r\n    // not available under Win2000\r\n    if (!DynRtlCaptureContext)\r\n        return false;\r\n\r\n    if (!Initialize(nullptr, false))\r\n        return false;\r\n\r\n    CONTEXT ctx;\r\n    DynRtlCaptureContext(&ctx);\r\n    return GetCallstack(s, ctx, GetCurrentThread());\r\n}\r\n#pragma optimize(\"\", off )\r\n\r\nstr::Str<char> *gCallstackLogs = nullptr;\r\n\r\n// start remembering callstack logs done with LogCallstack()\r\nvoid RememberCallstackLogs()\r\n{\r\n    CrashIf(gCallstackLogs);\r\n    gCallstackLogs = new str::Str<char>();\r\n}\r\n\r\nvoid FreeCallstackLogs()\r\n{\r\n    delete gCallstackLogs;\r\n    gCallstackLogs = nullptr;\r\n}\r\n\r\nchar *GetCallstacks()\r\n{\r\n    if (!gCallstackLogs)\r\n        return nullptr;\r\n    return str::Dup(gCallstackLogs->Get());\r\n}\r\n\r\nvoid LogCallstack()\r\n{\r\n    str::Str<char> s(2048);\r\n    if (!GetCurrentThreadCallstack(s))\r\n        return;\r\n\r\n    s.Append(\"\\n\");\r\n    plog(s.Get());\r\n    if (gCallstackLogs)\r\n        gCallstackLogs->Append(s.Get());\r\n}\r\n\r\nvoid GetAllThreadsCallstacks(str::Str<char>& s)\r\n{\r\n    HANDLE threadSnap = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0);\r\n    if (threadSnap == INVALID_HANDLE_VALUE)\r\n        return;\r\n\r\n    THREADENTRY32 te32;\r\n    te32.dwSize = sizeof(THREADENTRY32);\r\n\r\n    DWORD pid = GetCurrentProcessId();\r\n    BOOL ok = Thread32First(threadSnap, &te32);\r\n    while (ok) {\r\n        if (te32.th32OwnerProcessID == pid)\r\n            GetThreadCallstack(s, te32.th32ThreadID);\r\n        ok = Thread32Next(threadSnap, &te32);\r\n    }\r\n\r\n    CloseHandle(threadSnap);\r\n}\r\n#pragma warning(pop)\r\n\r\nvoid GetExceptionInfo(str::Str<char>& s, EXCEPTION_POINTERS *excPointers)\r\n{\r\n    if (!excPointers)\r\n        return;\r\n    EXCEPTION_RECORD *excRecord = excPointers->ExceptionRecord;\r\n    DWORD excCode = excRecord->ExceptionCode;\r\n    s.AppendFmt(\"Exception: %08X %s\\r\\n\", (int)excCode, ExceptionNameFromCode(excCode));\r\n\r\n    s.AppendFmt(\"Faulting IP: \");\r\n    GetAddressInfo(s, (DWORD64)excRecord->ExceptionAddress);\r\n    if ((EXCEPTION_ACCESS_VIOLATION == excCode) ||\r\n        (EXCEPTION_IN_PAGE_ERROR == excCode))\r\n    {\r\n        int readWriteFlag = (int)excRecord->ExceptionInformation[0];\r\n        DWORD64 dataVirtAddr = (DWORD64)excRecord->ExceptionInformation[1];\r\n        if (0 == readWriteFlag) {\r\n            s.Append(\"Fault reading address \"); AppendAddress(s, dataVirtAddr);\r\n        } else if (1 == readWriteFlag) {\r\n            s.Append(\"Fault writing address \"); AppendAddress(s, dataVirtAddr);\r\n        } else if (8 == readWriteFlag) {\r\n            s.Append(\"DEP violation at address \"); AppendAddress(s, dataVirtAddr);\r\n        } else {\r\n            s.Append(\"unknown readWriteFlag: %d\", readWriteFlag);\r\n        }\r\n        s.Append(\"\\r\\n\");\r\n    }\r\n\r\n    PCONTEXT ctx = excPointers->ContextRecord;\r\n    s.AppendFmt(\"\\r\\nRegisters:\\r\\n\");\r\n\r\n#ifdef _WIN64\r\n    s.AppendFmt(\"RAX:%016I64X  RBX:%016I64X  RCX:%016I64X\\r\\nRDX:%016I64X  RSI:%016I64X  RDI:%016I64X\\r\\n\"\r\n        \"R8: %016I64X\\r\\nR9: %016I64X\\r\\nR10:%016I64X\\r\\nR11:%016I64X\\r\\nR12:%016I64X\\r\\nR13:%016I64X\\r\\nR14:%016I64X\\r\\nR15:%016I64X\\r\\n\",\r\n        ctx->Rax, ctx->Rbx, ctx->Rcx, ctx->Rdx, ctx->Rsi, ctx->Rdi,\r\n        ctx->R9,ctx->R10,ctx->R11,ctx->R12,ctx->R13,ctx->R14,ctx->R15);\r\n    s.AppendFmt(\"CS:RIP:%04X:%016I64X\\r\\n\", ctx->SegCs, ctx->Rip);\r\n    s.AppendFmt(\"SS:RSP:%04X:%016X  RBP:%08X\\r\\n\", ctx->SegSs, ctx->Rsp, ctx->Rbp);\r\n    s.AppendFmt(\"DS:%04X  ES:%04X  FS:%04X  GS:%04X\\r\\n\", ctx->SegDs, ctx->SegEs, ctx->SegFs, ctx->SegGs);\r\n    s.AppendFmt(\"Flags:%08X\\r\\n\", ctx->EFlags);\r\n#else\r\n    s.AppendFmt(\"EAX:%08X  EBX:%08X  ECX:%08X\\r\\nEDX:%08X  ESI:%08X  EDI:%08X\\r\\n\",\r\n        ctx->Eax, ctx->Ebx, ctx->Ecx, ctx->Edx, ctx->Esi, ctx->Edi);\r\n    s.AppendFmt(\"CS:EIP:%04X:%08X\\r\\n\", ctx->SegCs, ctx->Eip);\r\n    s.AppendFmt(\"SS:ESP:%04X:%08X  EBP:%08X\\r\\n\", ctx->SegSs, ctx->Esp, ctx->Ebp);\r\n    s.AppendFmt(\"DS:%04X  ES:%04X  FS:%04X  GS:%04X\\r\\n\", ctx->SegDs, ctx->SegEs, ctx->SegFs, ctx->SegGs);\r\n    s.AppendFmt(\"Flags:%08X\\r\\n\", ctx->EFlags);\r\n#endif\r\n\r\n    s.Append(\"\\r\\nCrashed thread:\\r\\n\");\r\n    // it's not really for current thread, but it seems to work\r\n    GetCallstack(s, *ctx, GetCurrentThread());\r\n}\r\n\r\n}\r\n"
  },
  {
    "path": "src/utils/DbgHelpDyn.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD */\r\n\r\n// We're not using DebugLog.[h|cpp] here to make sure logging doesn't allocate\r\n// memory. We use plog because it's similar to plogf() but we don't want to lie\r\n// by claiming we support formatted strings.\r\n// We always log those because they only kick in on error code paths\r\n#define plog(msg) \\\r\n    OutputDebugStringA(msg)\r\n\r\nnamespace dbghelp \r\n{\r\n\r\nbool Initialize(const WCHAR *symPath, bool force);\r\nbool HasSymbols();\r\nvoid WriteMiniDump(const WCHAR *crashDumpFilePath, MINIDUMP_EXCEPTION_INFORMATION* mei, bool fullDump);\r\nvoid GetThreadCallstack(str::Str<char>& s, DWORD threadId);\r\nbool GetCurrentThreadCallstack(str::Str<char>& s);\r\nvoid LogCallstack();\r\nvoid RememberCallstackLogs();\r\nvoid FreeCallstackLogs();\r\nchar *GetCallstacks();\r\nvoid GetAllThreadsCallstacks(str::Str<char>& s);\r\nvoid GetExceptionInfo(str::Str<char>& s, EXCEPTION_POINTERS *excPointers);\r\n\r\n}\r\n"
  },
  {
    "path": "src/utils/DebugLog.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"DebugLog.h\"\r\n\r\nnamespace dbglog {\r\n\r\n  // TODO: as an optimization (to avoid allocations) and to prevent potential problems\r\n  // when formatting, when there are no args just output fmt\r\nvoid LogFV(const char *fmt, va_list args)\r\n{\r\n  char buf[512] = { 0 };\r\n  str::BufFmtV(buf, dimof(buf), fmt, args);\r\n  str::BufAppend(buf, dimof(buf), \"\\n\");\r\n  OutputDebugStringA(buf);\r\n}\r\n\r\nvoid LogF(const char *fmt, ...)\r\n{\r\n    va_list args;\r\n    va_start(args, fmt);\r\n    LogFV(fmt, args);\r\n    va_end(args);\r\n}\r\n\r\n// TODO: as an optimization (to avoid allocations) and to prevent potential problems\r\n// when formatting, when there are no args just output fmt\r\nvoid LogFV(const WCHAR *fmt, va_list args)\r\n{\r\n    WCHAR buf[256] = { 0 };\r\n    str::BufFmtV(buf, dimof(buf), fmt, args);\r\n    str::BufAppend(buf, dimof(buf), L\"\\n\");\r\n    OutputDebugStringW(buf);\r\n}\r\n\r\nvoid LogF(const WCHAR *fmt, ...)\r\n{\r\n    va_list args;\r\n    va_start(args, fmt);\r\n    LogFV(fmt, args);\r\n    va_end(args);\r\n}\r\n\r\nstatic str::Str<char> *gCrashLog = nullptr;\r\n\r\nvoid CrashLogF(const char *fmt, ...)\r\n{\r\n    if (!gCrashLog) {\r\n        // this is never freed, so only call CrashLogF before a crash\r\n        gCrashLog = new str::Str<char>(4096);\r\n    }\r\n\r\n    va_list args;\r\n    va_start(args, fmt);\r\n    gCrashLog->AppendAndFree(str::FmtV(fmt, args));\r\n    gCrashLog->Append(\"\\r\\n\");\r\n    va_end(args);\r\n}\r\n\r\nconst char *GetCrashLog()\r\n{\r\n    if (!gCrashLog)\r\n        return nullptr;\r\n    return gCrashLog->LendData();\r\n}\r\n\r\n} // namespace dbglog\r\n"
  },
  {
    "path": "src/utils/DebugLog.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n/* Simple logging for ad-hoc logging with OutputDebugString().\r\nOnly enabled in debug builds by default.\r\n\r\nTo disable logging, #define NOLOG to 1 before including this file i.e.\r\n\r\n#define NOLOG 1\r\n#include \"DebugLog.h\"\r\n\r\nTo always enable logging, #define NOLOG to 0 before the #include\r\n\r\n#define NOLOG 0\r\n#include \"DebugLog.h\"\r\n\r\nAny other value for NOLOG (including 0), enables logging. This provides\r\nfor an easy switch for turning logging on/off in a given .cpp file.\r\n*/\r\n\r\n#ifndef NOLOG\r\n  #ifdef NDEBUG\r\n    #define NOLOG 1\r\n  #else\r\n    #define NOLOG 0\r\n  #endif\r\n#endif\r\n\r\nnamespace dbglog {\r\n\r\nvoid LogF(const char *fmt, ...);\r\nvoid LogF(const WCHAR *fmt, ...);\r\n\r\nvoid LogFV(const char *fmt, va_list args);\r\nvoid LogFV(const WCHAR *fmt, va_list args);\r\n\r\n// call this in the event of an exception to add\r\n// more information to the crash log\r\nvoid CrashLogF(const char *fmt, ...);\r\n\r\n// returns a copy of the data recorded with CrashLogF\r\nconst char *GetCrashLog();\r\n\r\n} // namespace dbglog\r\n\r\n// short names are important for this use case\r\n#if NOLOG == 1\r\ninline void lf(const char *, ...) {\r\n    NoOp();\r\n}\r\ninline void lf(const WCHAR *, ...) {\r\n    NoOp();\r\n}\r\n#else\r\ninline void lf(const char *fmt, ...) {\r\n    va_list args;\r\n    va_start(args, fmt);\r\n    dbglog::LogFV(fmt, args);\r\n    va_end(args);\r\n}\r\n\r\ninline void lf(const WCHAR *fmt, ...) {\r\n    va_list args;\r\n    va_start(args, fmt);\r\n    dbglog::LogFV(fmt, args);\r\n    va_end(args);\r\n}\r\n#endif\r\n\r\n// use to indicate that the log messages are meant to be more\r\n// permanent (mostly for rarely executed code paths so that\r\n// the log isn't unnecessarily spammed)\r\ninline void plogf(const char *fmt, ...) {\r\n    va_list args;\r\n    va_start(args, fmt);\r\n    dbglog::LogFV(fmt, args);\r\n    va_end(args);\r\n}\r\n\r\ninline void plogf(const WCHAR *fmt, ...) {\r\n    va_list args;\r\n    va_start(args, fmt);\r\n    dbglog::LogFV(fmt, args);\r\n    va_end(args);\r\n}\r\n"
  },
  {
    "path": "src/utils/Dict.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n/* This is a dictionary with intentionally unorthodox design.\r\nIt's called dictionary, not a hashtable, to emphasize it's\r\nabout the API, not implementation technique.\r\nCurrently it's imlemented on top of a hash table, but it could\r\njust as well be a tree of some kind.\r\n\r\nUsually those things are done as a templated hash table class,\r\nbut I want to avoid code bloat and awful syntax.\r\n\r\nThe classes are based on a generic, untyped uintptr => uintptr\r\nhash table. The actual dict class is a wrapper that provides\r\na type-safe API and handles policy decisions like allocations\r\n(if they are necessary).\r\n\r\nOur hash table uses the same parameters as the one in redis\r\n(but without complexity of incremental hashing):\r\n- we use chaining on collisions\r\n- size of the hash table is power of two\r\n\r\nTODO:\r\n- add iterator for keys/values\r\n- would hash function be faster if we got bytes one at a time\r\n  but only with a single pass vs. getting 4 at a time but\r\n  doing 2 passes (the first to calculate the length)?\r\n*/\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"Dict.h\"\r\n\r\nnamespace dict {\r\n\r\nclass HasherComparator {\r\npublic:\r\n    virtual size_t Hash(uintptr_t key) = 0;\r\n    virtual bool Equal(uintptr_t k1, uintptr_t k2) = 0;\r\n    virtual ~HasherComparator() { }\r\n};\r\n\r\nclass StrKeyHasherComparator : public HasherComparator {\r\n    virtual size_t Hash(uintptr_t key) { return MurmurHash2((const void*)key, str::Len((const char*)key)); }\r\n    virtual bool Equal(uintptr_t k1, uintptr_t k2) {\r\n        const char *s1 = (const char *)k1;\r\n        const char *s2 = (const char *)k2;\r\n        return str::Eq(s1, s2);\r\n    }\r\n};\r\n\r\nclass WStrKeyHasherComparator : public HasherComparator {\r\n    virtual size_t Hash(uintptr_t key) {\r\n        size_t cbLen = str::Len((const WCHAR*)key) * sizeof(WCHAR);\r\n        return MurmurHash2((const void*)key, cbLen);\r\n    }\r\n    virtual bool Equal(uintptr_t k1, uintptr_t k2) {\r\n        const WCHAR *s1 = (const WCHAR *)k1;\r\n        const WCHAR *s2 = (const WCHAR *)k2;\r\n        return str::Eq(s1, s2);\r\n    }\r\n};\r\n\r\nstatic StrKeyHasherComparator gStrKeyHasherComparator;\r\nstatic WStrKeyHasherComparator gWStrKeyHasherComparator;\r\n\r\nstruct HashTableEntry {\r\n    uintptr_t key;\r\n    uintptr_t val;\r\n    struct HashTableEntry *next;\r\n};\r\n\r\n// not a class so that it can be allocated with an allocator\r\nstruct HashTable {\r\n    HashTableEntry **entries;\r\n    HashTableEntry *freeList;\r\n\r\n    size_t nEntries;\r\n    size_t nUsed; // total number of inserted entries\r\n\r\n    // for debugging\r\n    size_t nResizes;\r\n    size_t nCollisions;\r\n};\r\n\r\nstatic HashTable *NewHashTable(size_t size, Allocator *allocator)\r\n{\r\n    CrashIf(!allocator); // we'll leak otherwise\r\n    HashTable *h = (HashTable*)Allocator::AllocZero(allocator, sizeof(HashTable));\r\n    // number of hash table entries should be power of 2\r\n    size = RoundToPowerOf2(size);\r\n    // entries are not allocated with allocator since those are large blocks\r\n    // and we don't want to waste their memory after\r\n    h->entries = AllocArray<HashTableEntry*>(size);\r\n    h->nEntries = size;\r\n    return h;\r\n}\r\n\r\nstatic void DeleteHashTable(HashTable *h)\r\n{\r\n    free(h->entries);\r\n    // the rest is freed by allocator\r\n}\r\n\r\nstatic void HashTableResize(HashTable *h, HasherComparator *hc)\r\n{\r\n    size_t newSize = RoundToPowerOf2(h->nEntries + 1);\r\n    CrashIf(newSize <= h->nEntries);\r\n    HashTableEntry **newEntries = AllocArray<HashTableEntry*>(newSize);\r\n    HashTableEntry *e, *next;\r\n    size_t hash, pos;\r\n    for (size_t i = 0; i < h->nEntries; i++) {\r\n        e = h->entries[i];\r\n        while (e) {\r\n            next = e->next;\r\n            hash = hc->Hash(e->key);\r\n            pos = hash % newSize;\r\n            e->next = newEntries[pos];\r\n            newEntries[pos] = e;\r\n            e = next;\r\n        }\r\n    }\r\n    free(h->entries);\r\n    h->entries = newEntries;\r\n    h->nEntries = newSize;\r\n    h->nResizes += 1;\r\n\r\n    CrashIf(h->nUsed >= (h->nEntries * 3) / 2);\r\n}\r\n\r\n// micro optimization: this is called often, so we want this check inlined. Resizing logic\r\n// is called rarely, so doesn't need to be inlined\r\nstatic inline void HashTableResizeIfNeeded(HashTable *h, HasherComparator *hc)\r\n{\r\n    // per http://stackoverflow.com/questions/1603712/when-should-i-do-rehashing-of-entire-hash-table/1604428#1604428\r\n    // when using collision chaining, load factor can be 150%\r\n    if (h->nUsed < (h->nEntries * 3) / 2)\r\n        return;\r\n    HashTableResize(h, hc);\r\n}\r\n\r\n// note: allocator must be nullptr for get, non-nullptr for create\r\nstatic HashTableEntry *GetOrCreateEntry(HashTable *h, HasherComparator *hc, uintptr_t key, Allocator *allocator, bool& newEntry)\r\n{\r\n    bool shouldCreate = (allocator != nullptr);\r\n    size_t hash = hc->Hash(key);\r\n    size_t pos = hash % h->nEntries;\r\n    HashTableEntry *e = h->entries[pos];\r\n    newEntry = false;\r\n    while (e) {\r\n        if (hc->Equal(key, e->key))\r\n            return e;\r\n        e = e->next;\r\n    }\r\n    if (!shouldCreate)\r\n        return nullptr;\r\n\r\n    if (h->freeList) {\r\n        e = h->freeList;\r\n        h->freeList = h->freeList->next;\r\n    } else {\r\n        e = (HashTableEntry*)Allocator::AllocZero(allocator, sizeof(HashTableEntry));\r\n    }\r\n    e->next = h->entries[pos];\r\n    h->entries[pos] = e;\r\n    h->nUsed++;\r\n    if (e->next != nullptr)\r\n        h->nCollisions++;\r\n    newEntry = true;\r\n    return e;\r\n}\r\n\r\nstatic bool RemoveEntry(HashTable *h, HasherComparator *hc, uintptr_t key, uintptr_t *removedValOut)\r\n{\r\n    size_t hash = hc->Hash(key);\r\n    size_t pos = hash % h->nEntries;\r\n    HashTableEntry *e = h->entries[pos];\r\n    while (e) {\r\n        if (hc->Equal(key, e->key))\r\n            break;\r\n        e = e->next;\r\n    }\r\n    if (!e)\r\n        return false;\r\n\r\n    // remove the the entry from the list\r\n    HashTableEntry *e2 = h->entries[pos];\r\n    if (e2 == e) {\r\n        h->entries[pos] = e->next;\r\n    } else {\r\n        while (e2->next != e) {\r\n            e2 = e2->next;\r\n        }\r\n        e2->next = e->next;\r\n    }\r\n    e->next = h->freeList;\r\n    h->freeList = e;\r\n    *removedValOut = e->val;\r\n    CrashIf(0 == h->nUsed);\r\n    h->nUsed -= 1;\r\n    return true;\r\n}\r\n\r\nMapStrToInt::MapStrToInt(size_t initialSize)\r\n{\r\n    // we use PoolAllocator to allocate HashTableEntry entries\r\n    // and copies of string keys\r\n    allocator = new PoolAllocator();\r\n    allocator->SetAllocRounding(4);\r\n    h = NewHashTable(initialSize, allocator);\r\n}\r\n\r\nMapStrToInt::~MapStrToInt()\r\n{\r\n    DeleteHashTable(h);\r\n    delete allocator;\r\n}\r\n\r\nsize_t MapStrToInt::Count() const\r\n{\r\n    return h->nUsed;\r\n}\r\n\r\n// if a key exists:\r\n//   * returns false\r\n//   * sets existingValOut to existing value\r\n//   * sets existingKeyOut to (interned) existing key\r\n\r\n// if a key doesn't exist:\r\n//   * returns true\r\n//   * inserts a copy of the key allocated with allocator\r\n//   * sets existingKeyOut to (interned) key\r\nbool MapStrToInt::Insert(const char *key, int val, int *existingValOut, const char **existingKeyOut)\r\n{\r\n    bool newEntry;\r\n    HashTableEntry *e = GetOrCreateEntry(h, &gStrKeyHasherComparator, (uintptr_t)key, allocator, newEntry);\r\n    if (!newEntry) {\r\n        if (existingValOut)\r\n            *existingValOut = (int)e->val;\r\n        if (existingKeyOut)\r\n            *existingKeyOut = (const char *)e->key;\r\n        return false;\r\n    }\r\n    e->key = (intptr_t)Allocator::StrDup(allocator, key);\r\n    e->val = (intptr_t)val;\r\n    if (existingKeyOut)\r\n        *existingKeyOut = (const char *)e->key;\r\n\r\n    HashTableResizeIfNeeded(h, &gStrKeyHasherComparator);\r\n    return true;\r\n}\r\n\r\nbool MapStrToInt::Remove(const char *key, int *removedValOut)\r\n{\r\n    uintptr_t removedVal;\r\n    bool removed = RemoveEntry(h, &gStrKeyHasherComparator, (uintptr_t)key, &removedVal);\r\n    if (removed && removedValOut)\r\n        *removedValOut = (int)removedVal;\r\n    return removed;\r\n}\r\n\r\nbool MapStrToInt::Get(const char *key, int* valOut)\r\n{\r\n    StrKeyHasherComparator hc;\r\n    bool newEntry;\r\n    HashTableEntry *e = GetOrCreateEntry(h, &hc, (uintptr_t)key, nullptr, newEntry);\r\n    if (!e)\r\n        return false;\r\n    *valOut = (int)e->val;\r\n    return true;\r\n}\r\n\r\nMapWStrToInt::MapWStrToInt(size_t initialSize)\r\n{\r\n    // we use PoolAllocator to allocate HashTableEntry entries\r\n    // and copies of string keys\r\n    allocator = new PoolAllocator();\r\n    allocator->SetAllocRounding(4);\r\n    h = NewHashTable(initialSize, allocator);\r\n}\r\n\r\nMapWStrToInt::~MapWStrToInt()\r\n{\r\n    DeleteHashTable(h);\r\n    delete allocator;\r\n}\r\n\r\nsize_t MapWStrToInt::Count() const\r\n{\r\n    return h->nUsed;\r\n}\r\n\r\nbool MapWStrToInt::Insert(const WCHAR *key, int val, int *prevVal)\r\n{\r\n    bool newEntry;\r\n    HashTableEntry *e = GetOrCreateEntry(h, &gWStrKeyHasherComparator, (uintptr_t)key, allocator, newEntry);\r\n    if (!newEntry) {\r\n        if (prevVal)\r\n            *prevVal = (int)e->val;\r\n        return false;\r\n    }\r\n    e->key = (intptr_t)Allocator::StrDup(allocator, key);\r\n    e->val = (intptr_t)val;\r\n\r\n    HashTableResizeIfNeeded(h, &gWStrKeyHasherComparator);\r\n    return true;\r\n}\r\n\r\nbool MapWStrToInt::Remove(const WCHAR *key, int *removedValOut)\r\n{\r\n    uintptr_t removedVal;\r\n    bool removed = RemoveEntry(h, &gStrKeyHasherComparator, (uintptr_t)key, &removedVal);\r\n    if (removed && removedValOut)\r\n        *removedValOut = (int)removedVal;\r\n    return removed;\r\n}\r\n\r\nbool MapWStrToInt::Get(const WCHAR *key, int* valOut)\r\n{\r\n    WStrKeyHasherComparator hc;\r\n    bool newEntry;\r\n    HashTableEntry *e = GetOrCreateEntry(h, &hc, (uintptr_t)key, nullptr, newEntry);\r\n    if (!e)\r\n        return false;\r\n    *valOut = (int)e->val;\r\n    return true;\r\n}\r\n\r\n}\r\n\r\nint StringInterner::Intern(const char *s, bool *alreadyPresent)\r\n{\r\n    nInternCalls++;\r\n    int idx = (int)intToStr.Count();\r\n    const char *internedString;\r\n    bool inserted = strToInt.Insert(s, idx, &idx, &internedString);\r\n    if (!inserted) {\r\n        if (alreadyPresent)\r\n            *alreadyPresent = true;\r\n        return idx;\r\n    }\r\n\r\n    intToStr.Append(internedString);\r\n    if (alreadyPresent)\r\n        *alreadyPresent = false;\r\n    return idx;\r\n}\r\n"
  },
  {
    "path": "src/utils/Dict.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nnamespace dict {\r\n\r\nstruct HashTable;\r\n\r\n// we are very generous with default initial size. It's a trade-off\r\n// between memory used by hash table and how often we need to resize it.\r\n// We allocate size*sizeof(ptr) which is 64k on 32-bit for 16k entries.\r\n// 64k is very little on today's machines, especially for short-lived\r\n// hash tables.\r\n// Should use smaller values for long-lived hash tables, especially\r\n// if there are many of them.\r\nenum { DEFAULT_HASH_TABLE_INITIAL_SIZE = 16*1024 };\r\n\r\n// a dictionary whose keys are char * strings and the values are integers\r\n// note: StrToInt would be more natural name but it's re-#define'd in <shlwapi.h>\r\nclass MapStrToInt {\r\npublic:\r\n    PoolAllocator *allocator;\r\n    HashTable *h;\r\n\r\n    explicit MapStrToInt(size_t initialSize = DEFAULT_HASH_TABLE_INITIAL_SIZE);\r\n    ~MapStrToInt();\r\n\r\n    size_t Count() const;\r\n\r\n    bool Insert(const char *key, int val, int *existingValOut=nullptr, const char **existingKeyOut=nullptr);\r\n\r\n    bool Remove(const char *key, int *removedValOut);\r\n    bool Get(const char *key, int *valOut);\r\n};\r\n\r\nclass MapWStrToInt {\r\npublic:\r\n    PoolAllocator *allocator;\r\n    HashTable *h;\r\n\r\n    explicit MapWStrToInt(size_t initialSize = DEFAULT_HASH_TABLE_INITIAL_SIZE);\r\n    ~MapWStrToInt();\r\n\r\n    size_t Count() const;\r\n\r\n    // if a key doesn't exist, inserts a key with a given value and return true\r\n    // if a key exists, returns false and sets prevValOut to existing value\r\n    bool Insert(const WCHAR *key, int val, int *prevValOut);\r\n    bool Remove(const WCHAR *key, int *removedValOut);\r\n    bool Get(const WCHAR *key, int *valOut);\r\n};\r\n\r\n}\r\n\r\nclass StringInterner {\r\n    dict::MapStrToInt   strToInt;\r\n    Vec<const char *>   intToStr;\r\n\r\npublic:\r\n    StringInterner() : nInternCalls(0) {}\r\n\r\n    int             Intern(const char *s, bool *alreadyPresent=nullptr);\r\n    size_t          StringsCount() const { return intToStr.Count(); }\r\n    const char *    GetByIndex(size_t n) const { return intToStr.At(n); }\r\n\r\n    int             nInternCalls; // so we know how effective interning is\r\n};\r\n"
  },
  {
    "path": "src/utils/DirIter.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"DirIter.h\"\r\n#include \"FileUtil.h\"\r\n\r\n// Start directory traversal in a given dir\r\nbool DirIter::StartDirIter(const WCHAR *dir)\r\n{\r\n    currDir.Set(str::Dup(dir));\r\n    ScopedMem<WCHAR> pattern(path::Join(currDir, L\"*\"));\r\n    currFindHandle = FindFirstFile(pattern, &currFindData);\r\n    if (INVALID_HANDLE_VALUE == currFindHandle)\r\n        return false;\r\n    return true;\r\n}\r\n\r\nbool DirIter::TryNextDir()\r\n{\r\n    while (dirsToVisit.Count() > 0) {\r\n        ScopedMem<WCHAR> nextDir(dirsToVisit.Pop());\r\n        // it's ok if we fail, this might be an auth problem,\r\n        // we keep going\r\n        bool ok = StartDirIter(nextDir);\r\n        if (ok)\r\n            return true;\r\n    }\r\n    return false;\r\n}\r\n\r\n// Start iteration in a given dir and return fullPath of first\r\n// file found or nullptr if no files\r\nconst WCHAR *DirIter::First()\r\n{\r\n    foundNext = StartDirIter(startDir);\r\n    if (!foundNext)\r\n        return nullptr;\r\n    return Next();\r\n}\r\n\r\n// try to filter out things that are not files\r\n// or not meant to be used by other applications\r\nstatic bool IsRegularFile(DWORD fileAttr)\r\n{\r\n    if (fileAttr & FILE_ATTRIBUTE_DEVICE)\r\n        return false;\r\n    if (fileAttr & FILE_ATTRIBUTE_DIRECTORY)\r\n        return false;\r\n    if (fileAttr & FILE_ATTRIBUTE_OFFLINE)\r\n        return false;\r\n    if (fileAttr & FILE_ATTRIBUTE_TEMPORARY)\r\n        return false;\r\n    if (fileAttr & FILE_ATTRIBUTE_REPARSE_POINT)\r\n        return false;\r\n    return true;\r\n}\r\n\r\n// \".\" and \"..\" are special\r\nstatic bool IsSpecialDir(const WCHAR *s)\r\n{\r\n    if ('.' == *s++) {\r\n        if (*s == 0)\r\n            return true;\r\n        if (('.' == *s++) && (0 == *s))\r\n            return true;\r\n    }\r\n    return false;\r\n}\r\n\r\n// Returns a full path of the next file\r\n// Returns nullptr if finished iteration.\r\n// Returned value is valid only until we call Next() again.\r\nconst WCHAR *DirIter::Next()\r\n{\r\n    // when we enter here, currFindData has info for an entry\r\n    // we haven't processed yet (filled by StartDirIter() or\r\n    // ourselves at the end) unless foundNext is false\r\n    currPath.Set(nullptr);\r\n    while (foundNext && !currPath) {\r\n        WCHAR *f = currFindData.cFileName;\r\n        if ((currFindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {\r\n            if (recursive && !IsSpecialDir(f)) {\r\n                WCHAR *d = path::Join(currDir, f);\r\n                dirsToVisit.Append(d);\r\n            }\r\n        } else if (IsRegularFile(currFindData.dwFileAttributes)) {\r\n            WCHAR *p = path::Join(currDir, f);\r\n            currPath.Set(p);\r\n        }\r\n        BOOL hasMore = FindNextFile(currFindHandle, &currFindData);\r\n        if (!hasMore)\r\n            foundNext = TryNextDir();\r\n    }\r\n    return currPath;\r\n}\r\n\r\nbool CollectPathsFromDirectory(const WCHAR *pattern, WStrVec& paths, bool dirsInsteadOfFiles)\r\n{\r\n    ScopedMem<WCHAR> dirPath(path::GetDir(pattern));\r\n\r\n    WIN32_FIND_DATA fdata;\r\n    HANDLE hfind = FindFirstFile(pattern, &fdata);\r\n    if (INVALID_HANDLE_VALUE == hfind)\r\n        return false;\r\n\r\n    do {\r\n        bool append = !dirsInsteadOfFiles;\r\n        if ((fdata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))\r\n            append = dirsInsteadOfFiles && !IsSpecialDir(fdata.cFileName);\r\n        if (append)\r\n            paths.Append(path::Join(dirPath, fdata.cFileName));\r\n    } while (FindNextFile(hfind, &fdata));\r\n    FindClose(hfind);\r\n\r\n    return paths.Count() > 0;\r\n}\r\n"
  },
  {
    "path": "src/utils/DirIter.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n/* How to use:\r\n\r\nDirIter di(dir, recursive);\r\nfor (const WCHAR *filePath = di.First(); filePath; filePath = di.Next()) {\r\n    // process filePath\r\n}\r\n\r\n*/\r\nclass DirIter\r\n{\r\n    bool                recursive;\r\n\r\n    WStrVec             dirsToVisit;\r\n    ScopedMem<WCHAR>    startDir;\r\n    ScopedMem<WCHAR>    currDir;\r\n    ScopedMem<WCHAR>    currPath;\r\n    HANDLE              currFindHandle;\r\n    WIN32_FIND_DATA     currFindData;\r\n    bool                foundNext;\r\n\r\n    bool StartDirIter(const WCHAR *dir);\r\n    bool TryNextDir();\r\n\r\npublic:\r\n    DirIter(const WCHAR *dir, bool recursive=false) : foundNext(false), currFindHandle(nullptr), recursive(recursive) {\r\n        startDir.Set(str::Dup(dir));\r\n    }\r\n    ~DirIter() { FindClose(currFindHandle); }\r\n\r\n    const WCHAR *First();\r\n    const WCHAR *Next();\r\n};\r\n\r\nbool CollectPathsFromDirectory(const WCHAR *pattern, WStrVec& paths, bool dirsInsteadOfFiles=false);\r\n"
  },
  {
    "path": "src/utils/Dpi.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"Dpi.h\"\r\n\r\n/* Info from https://code.msdn.microsoft.com/DPI-Tutorial-sample-64134744\r\n\r\nDPI Unaware: virtualized to 96 DPI and scaled by the system for the DPI of the monitor where shown\r\n\r\nSystem DPI Aware:\r\n These apps render themselves according to the DPI of the display where they\r\n are launched, and they expect that scaling to remain constant for all displays on the system.\r\n These apps are scaled up or down when moved to a display with a different DPI from the system DPI.\r\n\r\nPer-Monitor DPI Aware:\r\n These apps render themselves for any DPI, and re-render when the DPI changes\r\n (as indicated by the WM_DPICHANGED window message).\r\n*/\r\n\r\n/*\r\nIf you have HWND, call DpiScaleX(HWND, x) or DpiScaleY(HWND, y).\r\nIf we don't have dpi information for this HWND, we'll create it.\r\n\r\nOn WM_DPICHANGED call DpiUpdate(HWND) so that we can update\r\ndpi information for that window.\r\n\r\nOn WM_DESTROY call DpiRemove(HWND) so that we remove it.\r\n\r\nFor even faster access you can cache struct Dpi somewhere.\r\n\r\nNote: maybe I don't need keep a per-HWND cache and instead\r\nalways call GetDpiXY() ?\r\n*/\r\n\r\nstruct DpiNode {\r\n    DpiNode *next;\r\n    Dpi dpi;\r\n};\r\n\r\nstatic DpiNode *g_dpis = nullptr;\r\n\r\nstatic void GetDpiXY(HWND hwnd, int &scaleX, int &scaleY) {\r\n#if 0\r\n    // TODO: only available in 8.1\r\n    UINT dpiX = 96, dpiY = 96;\r\n    HMONITOR h = MonitorFromWindow(hwnd, 0);\r\n    if (h != nullptr ) {\r\n        HRESULT hr = GetDpiForMonitor(h, 0 /* MDT_Effective_DPI */, &dpiX, &dpiY);\r\n        if (hr == S_OK) {\r\n            scaleX = (int)dpiX;\r\n            scaleY = (int)dpiY;\r\n            return;\r\n        }\r\n#endif\r\n    HDC dc = GetDC(hwnd);\r\n    scaleX = (UINT)GetDeviceCaps(dc, LOGPIXELSX);\r\n    scaleY = (UINT)GetDeviceCaps(dc, LOGPIXELSY);\r\n    ReleaseDC(hwnd, dc);\r\n}\r\n\r\n// return the top-level parent of hwnd or nullptr if hwnd is top-level\r\nstatic HWND GetTopLevelParent(HWND hwnd) {\r\n    HWND topLevel = hwnd;\r\n    while (GetParent(topLevel) != nullptr) {\r\n        topLevel = GetParent(topLevel);\r\n    }\r\n    if (topLevel == hwnd) {\r\n        return nullptr;\r\n    }\r\n    return topLevel;\r\n}\r\n\r\nstatic DpiNode *DpiNodeFindByHwnd(HWND hwnd) {\r\n    DpiNode *n = g_dpis;\r\n    while (n != nullptr) {\r\n        if (n->dpi.hwnd == hwnd) {\r\n            return n;\r\n        }\r\n        n = n->next;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nstatic Dpi *DpiFindByHwnd(HWND hwnd) {\r\n    DpiNode *n = DpiNodeFindByHwnd(hwnd);\r\n    if (n == nullptr) {\r\n        return nullptr;\r\n    }\r\n    return &n->dpi;\r\n}\r\n\r\nvoid DpiUpdate(Dpi *dpi) {\r\n    dpi->dpiX = 96;\r\n    dpi->dpiY = 96;\r\n    GetDpiXY(dpi->hwnd, dpi->dpiX, dpi->dpiY);\r\n    // round up unusual DPIs\r\n    dpi->dpiX = RoundUp(dpi->dpiX, 4);\r\n    dpi->dpiY = RoundUp(dpi->dpiY, 4);\r\n}\r\n\r\nDpi *DpiGet(HWND hwnd) {\r\n    Dpi *dpi = DpiFindByHwnd(hwnd);\r\n    if (nullptr != dpi) {\r\n        return dpi;\r\n    }\r\n    // try the parent\r\n    HWND topLevel = GetTopLevelParent(hwnd);\r\n    if (topLevel != nullptr) {\r\n        hwnd = topLevel;\r\n        dpi = DpiFindByHwnd(topLevel);\r\n        if (nullptr != dpi) {\r\n            return dpi;\r\n        }\r\n    }\r\n    // create if doesn't exist\r\n    DpiNode *n = AllocStruct<DpiNode>();\r\n    n->dpi.hwnd = hwnd;\r\n    DpiUpdate(&n->dpi);\r\n    n->next = g_dpis;\r\n    g_dpis = n;\r\n    return &n->dpi;\r\n}\r\n\r\nint DpiGetPreciseX(HWND hwnd) {\r\n    int dpiX, dpiY;\r\n    GetDpiXY(hwnd, dpiX, dpiY);\r\n    return dpiX;\r\n}\r\n\r\nint DpiGetPreciseY(HWND hwnd) {\r\n    int dpiX, dpiY;\r\n    GetDpiXY(hwnd, dpiX, dpiY);\r\n    return dpiY;\r\n}\r\n\r\nvoid DpiRemove(HWND hwnd) {\r\n    DpiNode *n = DpiNodeFindByHwnd(hwnd);\r\n    CrashIf(nullptr == n);\r\n    ListRemove(&g_dpis, n);\r\n    free(n);\r\n}\r\n\r\nvoid DpiRemoveAll() {\r\n    while (g_dpis != nullptr) {\r\n        DpiNode *n = g_dpis;\r\n        DpiRemove(n->dpi.hwnd);\r\n    }\r\n}\r\n"
  },
  {
    "path": "src/utils/Dpi.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nstruct Dpi {\r\n    HWND hwnd;\r\n    int dpiX;\r\n    int dpiY;\r\n};\r\n\r\nDpi *DpiGet(HWND);\r\nint DpiGetPreciseX(HWND hwnd);\r\nint DpiGetPreciseY(HWND hwnd);\r\ninline int DpiScaleX(HWND hwnd, int x) { return MulDiv(x, DpiGet(hwnd)->dpiX, 96); }\r\ninline int DpiScaleY(HWND hwnd, int y) { return MulDiv(y, DpiGet(hwnd)->dpiY, 96); }\r\nvoid DpiUpdate(Dpi *);\r\ninline void DpiUpdate(HWND hwnd) { return DpiUpdate(DpiGet(hwnd)); }\r\nvoid DpiRemove(HWND);\r\nvoid DpiRemoveAll();\r\n"
  },
  {
    "path": "src/utils/FileTransactions.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"WinDynCalls.h\"\r\n#include \"FileTransactions.h\"\r\n#include \"FileUtil.h\"\r\n#include \"WinUtil.h\"\r\n\r\nFileTransaction::FileTransaction() : hTrans(nullptr)\r\n{\r\n    if (DynCreateTransaction && DynCommitTransaction && DynRollbackTransaction && DynCreateFileTransactedW && DynDeleteFileTransactedW)\r\n        hTrans = DynCreateTransaction(nullptr, 0, 0, 0, 0, 0, nullptr);\r\n}\r\n\r\nFileTransaction::~FileTransaction()\r\n{\r\n    CloseHandle(hTrans);\r\n}\r\n\r\nbool FileTransaction::Commit()\r\n{\r\n    if (!hTrans)\r\n        return true;\r\n    return DynCommitTransaction(hTrans);\r\n}\r\n\r\nHANDLE FileTransaction::CreateFile(const WCHAR *filePath, DWORD dwDesiredAccess, DWORD dwCreationDisposition)\r\n{\r\n    if (hTrans) {\r\n        HANDLE hFile = DynCreateFileTransactedW(filePath, dwDesiredAccess, 0, nullptr, dwCreationDisposition, FILE_ATTRIBUTE_NORMAL, nullptr, hTrans, nullptr, nullptr);\r\n        DWORD err = GetLastError();\r\n        if (INVALID_HANDLE_VALUE != hFile || ERROR_FILE_NOT_FOUND == err || ERROR_ACCESS_DENIED == err || ERROR_FILE_EXISTS  == err || ERROR_ALREADY_EXISTS  == err)\r\n            return hFile;\r\n        // fall back to untransacted file I/O, if transactions aren't supported\r\n    }\r\n    return ::CreateFile(filePath, dwDesiredAccess, 0, nullptr, dwCreationDisposition, FILE_ATTRIBUTE_NORMAL, nullptr);\r\n}\r\n\r\nbool FileTransaction::WriteAll(const WCHAR *filePath, const void *data, size_t dataLen)\r\n{\r\n    if (!hTrans)\r\n        return file::WriteAll(filePath, data, dataLen);\r\n\r\n    ScopedHandle hFile(CreateFile(filePath, GENERIC_WRITE, CREATE_ALWAYS));\r\n    if (INVALID_HANDLE_VALUE == hFile)\r\n        return false;\r\n\r\n    DWORD size;\r\n    BOOL ok = WriteFile(hFile, data, (DWORD)dataLen, &size, nullptr);\r\n    assert(!ok || (dataLen == (size_t)size));\r\n\r\n    return ok && dataLen == (size_t)size;\r\n}\r\n\r\nbool FileTransaction::Delete(const WCHAR *filePath)\r\n{\r\n    if (hTrans) {\r\n        BOOL ok = DynDeleteFileTransactedW(filePath, hTrans);\r\n        DWORD err = GetLastError();\r\n        if (ok || ERROR_FILE_NOT_FOUND == err || ERROR_ACCESS_DENIED == err)\r\n            return ok || ERROR_FILE_NOT_FOUND == err;\r\n        // fall back to an untransacted operation, if transactions aren't supported\r\n    }\r\n    return file::Delete(filePath);\r\n}\r\n\r\nbool FileTransaction::SetModificationTime(const WCHAR *filePath, FILETIME lastMod)\r\n{\r\n    if (!hTrans)\r\n        return file::SetModificationTime(filePath, lastMod);\r\n\r\n    ScopedHandle hFile(CreateFile(filePath, GENERIC_READ | GENERIC_WRITE, OPEN_EXISTING));\r\n    if (INVALID_HANDLE_VALUE == hFile)\r\n        return false;\r\n    return SetFileTime(hFile, nullptr, nullptr, &lastMod);\r\n}\r\n"
  },
  {
    "path": "src/utils/FileTransactions.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// cf. http://www.codeproject.com/KB/vista/VistaKTM.aspx for the inspiration\r\n\r\nclass FileTransaction {\r\n    HANDLE hTrans;\r\n\r\npublic:\r\n    FileTransaction();\r\n    ~FileTransaction();\r\n\r\n    // if Commit is never called on a transaction, it will be\r\n    // rolled back when the FileTransaction object is destroyed\r\n    bool Commit();\r\n\r\n    // all these functions fall back on untransacted operations,\r\n    // if either transactions aren't supported at all or if they're\r\n    // not supported by the file system (e.g. on FAT32 or a network drive)\r\n    HANDLE CreateFile(const WCHAR *filePath, DWORD dwDesiredAccess, DWORD dwCreationDisposition);\r\n    // same signatures as in FileUtil.h\r\n    bool WriteAll(const WCHAR *filePath, const void *data, size_t dataLen);\r\n    bool Delete(const WCHAR *filePath);\r\n    bool SetModificationTime(const WCHAR *filePath, FILETIME lastMod);\r\n};\r\n"
  },
  {
    "path": "src/utils/FileUtil.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: Simplified BSD (see COPYING.BSD) */\n\n#include \"BaseUtil.h\"\n#include \"FileUtil.h\"\n\n// cf. http://blogs.msdn.com/b/oldnewthing/archive/2004/10/25/247180.aspx\nEXTERN_C IMAGE_DOS_HEADER __ImageBase;\n\n// A convenient way to grab the same value as HINSTANCE passed to WinMain\nHINSTANCE GetInstance() { return (HINSTANCE)&__ImageBase; }\n\nnamespace path {\n\nbool IsSep(WCHAR c) { return '\\\\' == c || '/' == c; }\n\nbool IsSep(char c) { return '\\\\' == c || '/' == c; }\n\n// Note: returns pointer inside <path>, do not free\nconst WCHAR *GetBaseName(const WCHAR *path) {\n    const WCHAR *fileBaseName = path + str::Len(path);\n    for (; fileBaseName > path; fileBaseName--) {\n        if (IsSep(fileBaseName[-1]))\n            break;\n    }\n    return fileBaseName;\n}\n\n// Note: returns pointer inside <path>, do not free\nconst char *GetBaseName(const char *path) {\n    const char *fileBaseName = path + str::Len(path);\n    for (; fileBaseName > path; fileBaseName--) {\n        if (IsSep(fileBaseName[-1]))\n            break;\n    }\n    return fileBaseName;\n}\n\n// Note: returns pointer inside <path>, do not free\nconst WCHAR *GetExt(const WCHAR *path) {\n    const WCHAR *ext = path + str::Len(path);\n    for (; ext > path && !IsSep(*ext); ext--) {\n        if (*ext == '.')\n            return ext;\n    }\n    return path + str::Len(path);\n}\n\n// Caller has to free()\nWCHAR *GetDir(const WCHAR *path) {\n    const WCHAR *baseName = GetBaseName(path);\n    if (baseName == path) // relative directory\n        return str::Dup(L\".\");\n    if (baseName == path + 1) // relative root\n        return str::DupN(path, 1);\n    if (baseName == path + 3 && path[1] == ':') // local drive root\n        return str::DupN(path, 3);\n    if (baseName == path + 2 && str::StartsWith(path, L\"\\\\\\\\\")) // server root\n        return str::Dup(path);\n    // any subdirectory\n    return str::DupN(path, baseName - path - 1);\n}\n\nWCHAR *Join(const WCHAR *path, const WCHAR *fileName) {\n    if (IsSep(*fileName))\n        fileName++;\n    WCHAR *sepStr = nullptr;\n    if (!IsSep(path[str::Len(path) - 1]))\n        sepStr = L\"\\\\\";\n    return str::Join(path, sepStr, fileName);\n}\n\nchar *JoinUtf(const char *path, const char *fileName, Allocator *allocator) {\n    if (IsSep(*fileName))\n        fileName++;\n    char *sepStr = nullptr;\n    if (!IsSep(path[str::Len(path) - 1]))\n        sepStr = \"\\\\\";\n    return str::Join(path, sepStr, fileName, allocator);\n}\n\n// Normalize a file path.\n//  remove relative path component (..\\ and .\\),\n//  replace slashes by backslashes,\n//  convert to long form.\n//\n// Returns a pointer to a memory allocated block containing the normalized string.\n//   The caller is responsible for freeing the block.\n//   Returns nullptr if the file does not exist or if a memory allocation fails.\n//\n// Precondition: the file must exist on the file system.\n//\n// Note:\n//   - the case of the root component is preserved\n//   - the case of rest is set to the way it is stored on the file system\n//\n// e.g. suppose the a file \"C:\\foo\\Bar.Pdf\" exists on the file system then\n//    \"c:\\foo\\bar.pdf\" becomes \"c:\\foo\\Bar.Pdf\"\n//    \"C:\\foo\\BAR.PDF\" becomes \"C:\\foo\\Bar.Pdf\"\nWCHAR *Normalize(const WCHAR *path) {\n    // convert to absolute path, change slashes into backslashes\n    DWORD cch = GetFullPathName(path, 0, nullptr, nullptr);\n    if (!cch)\n        return str::Dup(path);\n    ScopedMem<WCHAR> fullpath(AllocArray<WCHAR>(cch));\n    GetFullPathName(path, cch, fullpath, nullptr);\n    // convert to long form\n    cch = GetLongPathName(fullpath, nullptr, 0);\n    if (!cch)\n        return fullpath.StealData();\n    ScopedMem<WCHAR> normpath(AllocArray<WCHAR>(cch));\n    GetLongPathName(fullpath, normpath, cch);\n    if (cch <= MAX_PATH)\n        return normpath.StealData();\n    // handle overlong paths: first, try to shorten the path\n    cch = GetShortPathName(fullpath, nullptr, 0);\n    if (cch && cch <= MAX_PATH) {\n        ScopedMem<WCHAR> shortpath(AllocArray<WCHAR>(cch));\n        GetShortPathName(fullpath, shortpath, cch);\n        if (str::Len(path::GetBaseName(normpath)) + path::GetBaseName(shortpath) - shortpath <\n            MAX_PATH) {\n            // keep the long filename if possible\n            *(WCHAR *)path::GetBaseName(shortpath) = '\\0';\n            return str::Join(shortpath, path::GetBaseName(normpath));\n        }\n        return shortpath.StealData();\n    }\n    // else mark the path as overlong\n    if (str::StartsWith(normpath.Get(), L\"\\\\\\\\?\\\\\"))\n        return normpath.StealData();\n    return str::Join(L\"\\\\\\\\?\\\\\", normpath);\n}\n\n// Normalizes the file path and the converts it into a short form that\n// can be used for interaction with non-UNICODE aware applications\nWCHAR *ShortPath(const WCHAR *path) {\n    ScopedMem<WCHAR> normpath(Normalize(path));\n    DWORD cch = GetShortPathName(normpath, nullptr, 0);\n    if (!cch)\n        return normpath.StealData();\n    WCHAR *shortpath = AllocArray<WCHAR>(cch);\n    GetShortPathName(normpath, shortpath, cch);\n    return shortpath;\n}\n\n// Code adapted from\n// http://stackoverflow.com/questions/562701/best-way-to-determine-if-two-path-reference-to-same-file-in-c-c/562830#562830\n// Determine if 2 paths point ot the same file...\nbool IsSame(const WCHAR *path1, const WCHAR *path2) {\n    bool isSame = false, needFallback = true;\n    HANDLE handle1 =\n        CreateFile(path1, 0, 0, nullptr, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, nullptr);\n    HANDLE handle2 =\n        CreateFile(path2, 0, 0, nullptr, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, nullptr);\n\n    if (handle1 != INVALID_HANDLE_VALUE && handle2 != INVALID_HANDLE_VALUE) {\n        BY_HANDLE_FILE_INFORMATION fi1, fi2;\n        if (GetFileInformationByHandle(handle1, &fi1) &&\n            GetFileInformationByHandle(handle2, &fi2)) {\n            isSame = fi1.dwVolumeSerialNumber == fi2.dwVolumeSerialNumber &&\n                     fi1.nFileIndexLow == fi2.nFileIndexLow &&\n                     fi1.nFileIndexHigh == fi2.nFileIndexHigh &&\n                     fi1.nFileSizeLow == fi2.nFileSizeLow &&\n                     fi1.nFileSizeHigh == fi2.nFileSizeHigh &&\n                     fi1.dwFileAttributes == fi2.dwFileAttributes &&\n                     fi1.nNumberOfLinks == fi2.nNumberOfLinks &&\n                     FileTimeEq(fi1.ftLastWriteTime, fi2.ftLastWriteTime) &&\n                     FileTimeEq(fi1.ftCreationTime, fi2.ftCreationTime);\n            needFallback = false;\n        }\n    }\n\n    CloseHandle(handle1);\n    CloseHandle(handle2);\n\n    if (!needFallback)\n        return isSame;\n\n    ScopedMem<WCHAR> npath1(Normalize(path1));\n    ScopedMem<WCHAR> npath2(Normalize(path2));\n    // consider the files different, if their paths can't be normalized\n    return npath1 && str::EqI(npath1, npath2);\n}\n\nbool HasVariableDriveLetter(const WCHAR *path) {\n    WCHAR root[] = L\"?:\\\\\";\n    root[0] = towupper(path[0]);\n    if (root[0] < 'A' || 'Z' < root[0])\n        return false;\n\n    UINT driveType = GetDriveType(root);\n    return DRIVE_REMOVABLE == driveType || DRIVE_CDROM == driveType ||\n           DRIVE_NO_ROOT_DIR == driveType;\n}\n\nbool IsOnFixedDrive(const WCHAR *path) {\n    if (PathIsNetworkPath(path))\n        return false;\n\n    UINT type;\n    WCHAR root[MAX_PATH];\n    if (GetVolumePathName(path, root, dimof(root)))\n        type = GetDriveType(root);\n    else\n        type = GetDriveType(path);\n    return DRIVE_FIXED == type;\n}\n\nstatic bool MatchWildcardsRec(const WCHAR *fileName, const WCHAR *filter) {\n#define AtEndOf(str) (*(str) == '\\0')\n    switch (*filter) {\n        case '\\0':\n        case ';':\n            return AtEndOf(fileName);\n        case '*':\n            filter++;\n            while (!AtEndOf(fileName) && !MatchWildcardsRec(fileName, filter))\n                fileName++;\n            return !AtEndOf(fileName) || AtEndOf(filter) || *filter == ';';\n        case '?':\n            return !AtEndOf(fileName) && MatchWildcardsRec(fileName + 1, filter + 1);\n        default:\n            return towlower(*fileName) == towlower(*filter) &&\n                   MatchWildcardsRec(fileName + 1, filter + 1);\n    }\n#undef AtEndOf\n}\n\n/* matches the filename of a path against a list of semicolon\n   separated filters as used by the common file dialogs\n   (e.g. \"*.pdf;*.xps;?.*\" will match all PDF and XPS files and\n   all filenames consisting of only a single character and\n   having any extension) */\nbool Match(const WCHAR *path, const WCHAR *filter) {\n    path = GetBaseName(path);\n    while (str::FindChar(filter, ';')) {\n        if (MatchWildcardsRec(path, filter))\n            return true;\n        filter = str::FindChar(filter, ';') + 1;\n    }\n    return MatchWildcardsRec(path, filter);\n}\n\nbool IsAbsolute(const WCHAR *path) { return !PathIsRelative(path); }\n\n// returns the path to either the %TEMP% directory or a\n// non-existing file inside whose name starts with filePrefix\nWCHAR *GetTempPath(const WCHAR *filePrefix) {\n    WCHAR tempDir[MAX_PATH - 14];\n    DWORD res = ::GetTempPath(dimof(tempDir), tempDir);\n    if (!res || res >= dimof(tempDir))\n        return nullptr;\n    if (!filePrefix)\n        return str::Dup(tempDir);\n    WCHAR path[MAX_PATH];\n    if (!GetTempFileName(tempDir, filePrefix, 0, path))\n        return nullptr;\n    return str::Dup(path);\n}\n\n// returns a path to the application module's directory\n// with either the given fileName or the module's name\n// (module is the EXE or DLL in which path::GetAppPath resides)\nWCHAR *GetAppPath(const WCHAR *fileName) {\n    WCHAR modulePath[MAX_PATH];\n    modulePath[0] = '\\0';\n    GetModuleFileName(GetInstance(), modulePath, dimof(modulePath));\n    modulePath[dimof(modulePath) - 1] = '\\0';\n    if (!fileName)\n        return str::Dup(modulePath);\n    ScopedMem<WCHAR> moduleDir(path::GetDir(modulePath));\n    return path::Join(moduleDir, fileName);\n}\n}\n\nnamespace file {\n\nHANDLE OpenReadOnly(const WCHAR *filePath) {\n    return CreateFile(filePath, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING,\n                      FILE_ATTRIBUTE_NORMAL, nullptr);\n}\n\nbool Exists(const WCHAR *filePath) {\n    if (nullptr == filePath)\n        return false;\n\n    WIN32_FILE_ATTRIBUTE_DATA fileInfo;\n    BOOL res = GetFileAttributesEx(filePath, GetFileExInfoStandard, &fileInfo);\n    if (0 == res)\n        return false;\n\n    if (fileInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)\n        return false;\n    return true;\n}\n\n// returns -1 on error (can't use INVALID_FILE_SIZE because it won't cast right)\nint64 GetSize(const WCHAR *filePath) {\n    CrashIf(!filePath);\n    if (!filePath)\n        return -1;\n\n    ScopedHandle h(OpenReadOnly(filePath));\n    if (h == INVALID_HANDLE_VALUE)\n        return -1;\n\n    // Don't use GetFileAttributesEx to retrieve the file size, as\n    // that function doesn't interact well with symlinks, etc.\n    LARGE_INTEGER size;\n    BOOL ok = GetFileSizeEx(h, &size);\n    if (!ok)\n        return -1;\n    return size.QuadPart;\n}\n\nchar *ReadAll(const WCHAR *filePath, size_t *fileSizeOut, Allocator *allocator) {\n    int64 size64 = GetSize(filePath);\n    if (size64 < 0)\n        return nullptr;\n    size_t size = (size_t)size64;\n#ifdef _WIN64\n    CrashIf(size != (size_t)size64);\n#else\n    if (size != size64)\n        return nullptr;\n#endif\n\n    // overflow check\n    if (size + 1 + sizeof(WCHAR) < sizeof(WCHAR) + 1)\n        return nullptr;\n    /* allocate one character more and zero-terminate just in case it's a\n       text file we'll want to treat as C string. Doesn't hurt for binary\n       files (note: three byte terminator for UTF-16 files) */\n    char *data = (char *)Allocator::Alloc(allocator, size + sizeof(WCHAR) + 1);\n    if (!data)\n        return nullptr;\n\n    if (!ReadN(filePath, data, size)) {\n        Allocator::Free(allocator, data);\n        return nullptr;\n    }\n\n    // zero-terminate for convenience\n    data[size] = data[size + 1] = data[size + 2] = '\\0';\n\n    if (fileSizeOut)\n        *fileSizeOut = size;\n    return data;\n}\n\nchar *ReadAllUtf(const char *filePath, size_t *fileSizeOut, Allocator *allocator) {\n    WCHAR buf[512];\n    str::Utf8ToWcharBuf(filePath, str::Len(filePath), buf, dimof(buf));\n    return ReadAll(buf, fileSizeOut, allocator);\n}\n\n// buf must be at least toRead in size (note: it won't be zero-terminated)\nbool ReadN(const WCHAR *filePath, char *buf, size_t toRead) {\n    ScopedHandle h(OpenReadOnly(filePath));\n    if (h == INVALID_HANDLE_VALUE)\n        return false;\n\n    DWORD nRead;\n    BOOL ok = ReadFile(h, buf, (DWORD)toRead, &nRead, nullptr);\n    return ok && nRead == toRead;\n}\n\nbool WriteAll(const WCHAR *filePath, const void *data, size_t dataLen) {\n    ScopedHandle h(CreateFile(filePath, GENERIC_WRITE, FILE_SHARE_READ, nullptr, CREATE_ALWAYS,\n                              FILE_ATTRIBUTE_NORMAL, nullptr));\n    if (INVALID_HANDLE_VALUE == h)\n        return false;\n\n    DWORD size;\n    BOOL ok = WriteFile(h, data, (DWORD)dataLen, &size, nullptr);\n    assert(!ok || (dataLen == (size_t)size));\n    return ok && dataLen == (size_t)size;\n}\n\nbool WriteAllUtf(const char *filePath, const void *data, size_t dataLen) {\n    WCHAR buf[512];\n    str::Utf8ToWcharBuf(filePath, str::Len(filePath), buf, dimof(buf));\n    return WriteAll(buf, data, dataLen);\n}\n\n// Return true if the file wasn't there or was successfully deleted\nbool Delete(const WCHAR *filePath) {\n    BOOL ok = DeleteFile(filePath);\n    return ok || GetLastError() == ERROR_FILE_NOT_FOUND;\n}\n\nFILETIME GetModificationTime(const WCHAR *filePath) {\n    FILETIME lastMod = { 0 };\n    ScopedHandle h(OpenReadOnly(filePath));\n    if (h != INVALID_HANDLE_VALUE)\n        GetFileTime(h, nullptr, nullptr, &lastMod);\n    return lastMod;\n}\n\nbool SetModificationTime(const WCHAR *filePath, FILETIME lastMod) {\n    ScopedHandle h(\n        CreateFile(filePath, GENERIC_READ | GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, 0, nullptr));\n    if (INVALID_HANDLE_VALUE == h)\n        return false;\n    return SetFileTime(h, nullptr, nullptr, &lastMod);\n}\n\n// return true if a file starts with string s of size len\nbool StartsWithN(const WCHAR *filePath, const char *s, size_t len) {\n    ScopedMem<char> buf(AllocArray<char>(len));\n    if (!buf)\n        return false;\n\n    if (!ReadN(filePath, buf, len))\n        return false;\n    return memeq(buf, s, len);\n}\n\n// return true if a file starts with null-terminated string s\nbool StartsWith(const WCHAR *filePath, const char *s) {\n    return file::StartsWithN(filePath, s, str::Len(s));\n}\n\nint GetZoneIdentifier(const WCHAR *filePath) {\n    ScopedMem<WCHAR> path(str::Join(filePath, L\":Zone.Identifier\"));\n    return GetPrivateProfileInt(L\"ZoneTransfer\", L\"ZoneId\", URLZONE_INVALID, path);\n}\n\nbool SetZoneIdentifier(const WCHAR *filePath, int zoneId) {\n    ScopedMem<WCHAR> path(str::Join(filePath, L\":Zone.Identifier\"));\n    ScopedMem<WCHAR> id(str::Format(L\"%d\", zoneId));\n    return WritePrivateProfileString(L\"ZoneTransfer\", L\"ZoneId\", id, path);\n}\n}\n\nnamespace dir {\n\nbool Exists(const WCHAR *dir) {\n    if (nullptr == dir)\n        return false;\n\n    WIN32_FILE_ATTRIBUTE_DATA fileInfo;\n    BOOL res = GetFileAttributesEx(dir, GetFileExInfoStandard, &fileInfo);\n    if (0 == res)\n        return false;\n\n    if (fileInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)\n        return true;\n    return false;\n}\n\n// Return true if a directory already exists or has been successfully created\nbool Create(const WCHAR *dir) {\n    BOOL ok = CreateDirectory(dir, nullptr);\n    if (ok)\n        return true;\n    return ERROR_ALREADY_EXISTS == GetLastError();\n}\n\n// creates a directory and all its parent directories that don't exist yet\nbool CreateAll(const WCHAR *dir) {\n    ScopedMem<WCHAR> parent(path::GetDir(dir));\n    if (!str::Eq(parent, dir) && !Exists(parent))\n        CreateAll(parent);\n    return Create(dir);\n}\n}\n"
  },
  {
    "path": "src/utils/FileUtil.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: Simplified BSD (see COPYING.BSD) */\n\nnamespace path {\n\nbool IsSep(WCHAR c);\nbool IsSep(char c);\n\nconst WCHAR *GetBaseName(const WCHAR *path);\nconst char *GetBaseName(const char *path);\nconst WCHAR *GetExt(const WCHAR *path);\n\nWCHAR *GetDir(const WCHAR *path);\nWCHAR *Join(const WCHAR *path, const WCHAR *fileName);\nchar *JoinUtf(const char *path, const char *fileName, Allocator *allocator);\nWCHAR *Normalize(const WCHAR *path);\nWCHAR *ShortPath(const WCHAR *path);\nbool IsSame(const WCHAR *path1, const WCHAR *path2);\nbool HasVariableDriveLetter(const WCHAR *path);\nbool IsOnFixedDrive(const WCHAR *path);\nbool Match(const WCHAR *path, const WCHAR *filter);\nbool IsAbsolute(const WCHAR *path);\n\nWCHAR *GetTempPath(const WCHAR *filePrefix = nullptr);\nWCHAR *GetAppPath(const WCHAR *fileName = nullptr);\n}\n\nnamespace file {\n\nbool Exists(const WCHAR *filePath);\nchar *ReadAll(const WCHAR *filePath, size_t *fileSizeOut, Allocator *allocator = nullptr);\nchar *ReadAllUtf(const char *filePath, size_t *fileSizeOut, Allocator *allocator = nullptr);\nbool ReadN(const WCHAR *filePath, char *buf, size_t toRead);\nbool WriteAll(const WCHAR *filePath, const void *data, size_t dataLen);\nbool WriteAllUtf(const char *filePath, const void *data, size_t dataLen);\nint64 GetSize(const WCHAR *filePath);\nbool Delete(const WCHAR *filePath);\nFILETIME GetModificationTime(const WCHAR *filePath);\nbool SetModificationTime(const WCHAR *filePath, FILETIME lastMod);\nbool StartsWithN(const WCHAR *filePath, const char *magicNumber, size_t len);\nbool StartsWith(const WCHAR *filePath, const char *magicNumber);\nint GetZoneIdentifier(const WCHAR *filePath);\nbool SetZoneIdentifier(const WCHAR *filePath, int zoneId = URLZONE_INTERNET);\n\nHANDLE OpenReadOnly(const WCHAR *filePath);\n}\n\nnamespace dir {\n\nbool Exists(const WCHAR *dir);\nbool Create(const WCHAR *dir);\nbool CreateAll(const WCHAR *dir);\n}\n\ninline bool FileTimeEq(const FILETIME &a, const FILETIME &b) {\n    return a.dwLowDateTime == b.dwLowDateTime && a.dwHighDateTime == b.dwHighDateTime;\n}\n\nHINSTANCE GetInstance();\n"
  },
  {
    "path": "src/utils/FileWatcher.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"FileWatcher.h\"\r\n#include \"FileUtil.h\"\r\n#include \"ThreadUtil.h\"\r\n#include \"WinUtil.h\"\r\n#define NOLOG 1\r\n#include \"DebugLog.h\"\r\n\r\n/*\r\nThis code is tricky, so here's a high-level overview. More info at:\r\nhttp://qualapps.blogspot.com/2010/05/understanding-readdirectorychangesw.html\r\n\r\nAlso, we did have a bug caused by incorrect use of CancelIo(). Here's a good\r\ndescription of its intricacies: http://blogs.msdn.com/b/oldnewthing/archive/2011/02/02/10123392.aspx\r\n\r\nWe use ReadDirectoryChangesW() with overlapped i/o and i/o completion\r\ncallback function.\r\n\r\nCallback function is called in the context of the thread that called\r\nReadDirectoryChangesW() but only if it's in alertable state.\r\nOur ui thread isn't so we create our own thread and run code that\r\ncalls ReadDirectoryChangesW() on that thread via QueueUserAPC().\r\n\r\ng_watchedDirs and g_watchedFiles are shared between the main thread and\r\nworker thread so must be protected via g_threadCritSec.\r\n\r\nReadDirectChangesW() doesn't always work for files on network drives,\r\nso for those files, we do manual checks, by using a timeout to\r\nperiodically wake up thread.\r\n*/\r\n\r\n/*\r\nTODO:\r\n  - should I end the thread when there are no files to watch?\r\n\r\n  - a single file copy can generate multiple notifications for the same\r\n    file. add some delay mechanism so that subsequent change notifications\r\n    cancel a previous, delayed one ? E.g. a copy f2.pdf f.pdf generates 3\r\n    notifications if f2.pdf is 2 MB.\r\n\r\n  - try to handle short file names as well: http://blogs.msdn.com/b/ericgu/archive/2005/10/07/478396.aspx\r\n    but how to test it?\r\n\r\n  - I could try to remove the need for g_threadCritSec by queing all code\r\n    that touches g_watchedDirs/g_watchedFiles onto a thread via APC, but that's\r\n    probably an overkill\r\n*/\r\n\r\n// there's a balance between responsiveness to changes and efficiency\r\n#define FILEWATCH_DELAY_IN_MS       1000\r\n\r\n// Some people use overlapped.hEvent to store data but I'm playing it safe.\r\nstruct OverlappedEx {\r\n    OVERLAPPED      overlapped;\r\n    void *          data;\r\n};\r\n\r\n// info needed to detect that a file has changed\r\nstruct FileState {\r\n    FILETIME    time;\r\n    int64       size;\r\n};\r\n\r\nstruct WatchedDir {\r\n    WatchedDir *    next;\r\n    const WCHAR *   dirPath;\r\n    HANDLE          hDir;\r\n    OverlappedEx    overlapped;\r\n    char            buf[8*1024];\r\n};\r\n\r\nstruct WatchedFile {\r\n    WatchedFile *           next;\r\n    WatchedDir *            watchedDir;\r\n    const WCHAR *           filePath;\r\n    FileChangeObserver *    observer;\r\n\r\n    // if true, the file is on a network drive and we have\r\n    // to check if it changed manually, by periodically checking\r\n    // file state for changes\r\n    bool                    isManualCheck;\r\n    FileState               fileState;\r\n};\r\n\r\nstatic HANDLE           g_threadHandle = 0;\r\nstatic DWORD            g_threadId = 0;\r\n\r\nstatic HANDLE           g_threadControlHandle = 0;\r\n\r\n// protects data structures shared between ui thread and file\r\n// watcher thread i.e. g_watchedDirs, g_watchedFiles\r\nstatic CRITICAL_SECTION g_threadCritSec;\r\n\r\nstatic WatchedDir *     g_watchedDirs = nullptr;\r\nstatic WatchedFile *    g_watchedFiles = nullptr;\r\n\r\nstatic LONG             gRemovalsPending = 0;\r\n\r\nstatic void StartMonitoringDirForChanges(WatchedDir *wd);\r\n\r\nstatic void AwakeWatcherThread()\r\n{\r\n    SetEvent(g_threadControlHandle);\r\n}\r\n\r\nstatic void GetFileState(const WCHAR *filePath, FileState* fs)\r\n{\r\n    // Note: in my testing on network drive that is mac volume mounted\r\n    // via parallels, lastWriteTime is not updated. lastAccessTime is,\r\n    // but it's also updated when the file is being read from (e.g.\r\n    // copy f.pdf f2.pdf will change lastAccessTime of f.pdf)\r\n    // So I'm sticking with lastWriteTime\r\n    fs->time = file::GetModificationTime(filePath);\r\n    fs->size = file::GetSize(filePath);\r\n}\r\n\r\nstatic bool FileStateEq(FileState *fs1, FileState *fs2)\r\n{\r\n    if (0 != CompareFileTime(&fs1->time, &fs2->time))\r\n        return false;\r\n    if (fs1->size != fs2->size)\r\n        return false;\r\n    return true;\r\n}\r\n\r\nstatic bool FileStateChanged(const WCHAR *filePath, FileState *fs)\r\n{\r\n    FileState fsTmp;\r\n\r\n    GetFileState(filePath, &fsTmp);\r\n    if (FileStateEq(fs, &fsTmp))\r\n        return false;\r\n\r\n    memcpy(fs, &fsTmp, sizeof(*fs));\r\n    return true;\r\n}\r\n\r\n// TODO: per internet, fileName could be short, 8.3 dos-style name\r\n// and we don't handle that. On the other hand, I've only seen references\r\n// to it wrt. to rename/delete operation, which we don't get notified about\r\n//\r\n// TODO: to collapse multiple notifications for the same file, could put it on a\r\n// queue, restart the thread with a timeout, restart the process if we\r\n// get notified again before timeout expires, call OnFileChanges() when\r\n// timeout expires\r\nstatic void NotifyAboutFile(WatchedDir *d, const WCHAR *fileName)\r\n{\r\n    lf(L\"NotifyAboutFile(): %s\", fileName);\r\n\r\n    for (WatchedFile *wf = g_watchedFiles; wf; wf = wf->next) {\r\n        if (wf->watchedDir != d)\r\n            continue;\r\n        const WCHAR *wfFileName = path::GetBaseName(wf->filePath);\r\n\r\n        if (!str::EqI(fileName, wfFileName))\r\n            continue;\r\n\r\n        // NOTE: It is not recommended to check whether the timestamp has changed\r\n        // because the time granularity is so big that this can cause genuine\r\n        // file notifications to be ignored. (This happens for instance for\r\n        // PDF files produced by pdftex from small.tex document)\r\n        wf->observer->OnFileChanged();\r\n    }\r\n}\r\n\r\nstatic void DeleteWatchedDir(WatchedDir *wd)\r\n{\r\n    free((void*)wd->dirPath);\r\n    free(wd);\r\n}\r\n\r\nstatic void CALLBACK ReadDirectoryChangesNotification(DWORD errCode,\r\n    DWORD bytesTransfered, LPOVERLAPPED overlapped)\r\n{\r\n    ScopedCritSec cs(&g_threadCritSec);\r\n\r\n    OverlappedEx *over = (OverlappedEx*)overlapped;\r\n    WatchedDir* wd = (WatchedDir*)over->data;\r\n\r\n    lf(L\"ReadDirectoryChangesNotification() dir: %s, numBytes: %d\", wd->dirPath, (int)bytesTransfered);\r\n\r\n    CrashIf(wd != wd->overlapped.data);\r\n\r\n    if (errCode == ERROR_OPERATION_ABORTED) {\r\n        lf(\"   ERROR_OPERATION_ABORTED\");\r\n        DeleteWatchedDir(wd);\r\n        InterlockedDecrement(&gRemovalsPending);\r\n        return;\r\n    }\r\n\r\n    // This might mean overflow? Not sure.\r\n    if (!bytesTransfered)\r\n        return;\r\n\r\n    FILE_NOTIFY_INFORMATION *notify = (FILE_NOTIFY_INFORMATION*)wd->buf;\r\n\r\n    // collect files that changed, removing duplicates\r\n    WStrVec changedFiles;\r\n    for (;;) {\r\n        ScopedMem<WCHAR> fileName(str::DupN(notify->FileName, notify->FileNameLength / sizeof(WCHAR)));\r\n        // files can get updated either by writing to them directly or\r\n        // by writing to a .tmp file first and then moving that file in place\r\n        // (the latter only yields a RENAMED action with the expected file name)\r\n        if (notify->Action == FILE_ACTION_MODIFIED || notify->Action == FILE_ACTION_RENAMED_NEW_NAME) {\r\n            if (!changedFiles.Contains(fileName)) {\r\n                lf(L\"ReadDirectoryChangesNotification() FILE_ACTION_MODIFIED, for '%s'\", fileName);\r\n                changedFiles.Append(fileName.StealData());\r\n            } else {\r\n                lf(L\"ReadDirectoryChangesNotification() eliminating duplicate notification for '%s'\", fileName);\r\n            }\r\n        } else {\r\n            lf(L\"ReadDirectoryChangesNotification() action=%d, for '%s'\", (int)notify->Action, fileName);\r\n        }\r\n\r\n        // step to the next entry if there is one\r\n        DWORD nextOff = notify->NextEntryOffset;\r\n        if (!nextOff)\r\n            break;\r\n        notify = (FILE_NOTIFY_INFORMATION *)((char*)notify + nextOff);\r\n    }\r\n\r\n    StartMonitoringDirForChanges(wd);\r\n\r\n    for (const WCHAR *f : changedFiles) {\r\n        NotifyAboutFile(wd, f);\r\n    }\r\n}\r\n\r\nstatic void CALLBACK StartMonitoringDirForChangesAPC(ULONG_PTR arg)\r\n{\r\n    WatchedDir *wd = (WatchedDir*)arg;\r\n    ZeroMemory(&wd->overlapped, sizeof(wd->overlapped));\r\n\r\n    OVERLAPPED *overlapped = (OVERLAPPED*)&(wd->overlapped);\r\n    wd->overlapped.data = (HANDLE)wd;\r\n\r\n    lf(L\"StartMonitoringDirForChangesAPC() %s\", wd->dirPath);\r\n\r\n    CrashIf(g_threadId != GetCurrentThreadId());\r\n\r\n    ReadDirectoryChangesW(\r\n         wd->hDir,\r\n         wd->buf,                           // read results buffer\r\n         sizeof(wd->buf),                   // length of buffer\r\n         FALSE,                             // bWatchSubtree\r\n         FILE_NOTIFY_CHANGE_LAST_WRITE | FILE_NOTIFY_CHANGE_FILE_NAME, // filter conditions\r\n         nullptr,                              // bytes returned\r\n         overlapped,                        // overlapped buffer\r\n         ReadDirectoryChangesNotification); // completion routine\r\n}\r\n\r\nstatic void StartMonitoringDirForChanges(WatchedDir *wd)\r\n{\r\n    QueueUserAPC(StartMonitoringDirForChangesAPC, g_threadHandle, (ULONG_PTR)wd);\r\n}\r\n\r\nstatic DWORD GetTimeoutInMs()\r\n{\r\n    ScopedCritSec cs(&g_threadCritSec);\r\n    for (WatchedFile *wf = g_watchedFiles; wf; wf = wf->next) {\r\n        if (wf->isManualCheck)\r\n            return FILEWATCH_DELAY_IN_MS;\r\n    }\r\n    return INFINITE;\r\n}\r\n\r\nstatic void RunManualCheck()\r\n{\r\n    ScopedCritSec cs(&g_threadCritSec);\r\n\r\n    for (WatchedFile *wf = g_watchedFiles; wf; wf = wf->next) {\r\n        if (!wf->isManualCheck)\r\n            continue;\r\n        if (FileStateChanged(wf->filePath, &wf->fileState)) {\r\n            lf(L\"RunManualCheck() %s changed\", wf->filePath);\r\n            wf->observer->OnFileChanged();\r\n        }\r\n    }\r\n}\r\n\r\nstatic DWORD WINAPI FileWatcherThread(void *param)\r\n{\r\n    UNUSED(param);\r\n    HANDLE handles[1];\r\n    // must be alertable to receive ReadDirectoryChangesW() callbacks and APCs\r\n    BOOL alertable = TRUE;\r\n\r\n    for (;;) {\r\n        handles[0] = g_threadControlHandle;\r\n        DWORD timeout = GetTimeoutInMs();\r\n        DWORD obj = WaitForMultipleObjectsEx(1, handles, FALSE, timeout, alertable);\r\n        if (WAIT_TIMEOUT == obj) {\r\n            RunManualCheck();\r\n            continue;\r\n        }\r\n\r\n        if (WAIT_IO_COMPLETION == obj) {\r\n            // APC complete. Nothing to do\r\n            lf(\"FileWatcherThread(): APC complete\");\r\n            continue;\r\n        }\r\n\r\n        int n = (int)(obj - WAIT_OBJECT_0);\r\n\r\n        if (n == 0) {\r\n            // a thread was explicitly awaken\r\n            ResetEvent(g_threadControlHandle);\r\n            lf(\"FileWatcherThread(): g_threadControlHandle signalled\");\r\n        } else {\r\n            dbglog::CrashLogF(\"FileWatcherThread(): n=%d\", n);\r\n            CrashIf(true);\r\n        }\r\n    }\r\n}\r\n\r\nstatic void StartThreadIfNecessary()\r\n{\r\n    if (g_threadHandle)\r\n        return;\r\n\r\n    InitializeCriticalSection(&g_threadCritSec);\r\n    g_threadControlHandle = CreateEvent(nullptr, TRUE, FALSE, nullptr);\r\n\r\n    g_threadHandle = CreateThread(nullptr, 0, FileWatcherThread, 0, 0, &g_threadId);\r\n    SetThreadName(g_threadId, \"FileWatcherThread\");\r\n}\r\n\r\nstatic WatchedDir *FindExistingWatchedDir(const WCHAR *dirPath)\r\n{\r\n    for (WatchedDir *wd = g_watchedDirs; wd; wd = wd->next) {\r\n        // TODO: normalize dirPath?\r\n        if (str::EqI(dirPath, wd->dirPath))\r\n            return wd;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nstatic void CALLBACK StopMonitoringDirAPC(ULONG_PTR arg)\r\n{\r\n    WatchedDir *wd = (WatchedDir*)arg;\r\n    lf(\"StopMonitoringDirAPC() wd=0x%p\", wd);\r\n\r\n    // this will cause ReadDirectoryChangesNotification() to be called\r\n    // with errCode = ERROR_OPERATION_ABORTED\r\n    BOOL ok = CancelIo(wd->hDir);\r\n    if (!ok)\r\n        LogLastError();\r\n    SafeCloseHandle(&wd->hDir);\r\n}\r\n\r\nstatic WatchedDir *NewWatchedDir(const WCHAR *dirPath)\r\n{\r\n    HANDLE hDir = CreateFile(\r\n        dirPath, FILE_LIST_DIRECTORY,\r\n        FILE_SHARE_READ|FILE_SHARE_DELETE|FILE_SHARE_WRITE,\r\n        nullptr, OPEN_EXISTING,\r\n        FILE_FLAG_BACKUP_SEMANTICS  | FILE_FLAG_OVERLAPPED, nullptr);\r\n    if (INVALID_HANDLE_VALUE == hDir)\r\n        return nullptr;\r\n\r\n    WatchedDir *wd = AllocStruct<WatchedDir>();\r\n    wd->hDir = hDir;\r\n    wd->dirPath = str::Dup(dirPath);\r\n\r\n    ListInsert(&g_watchedDirs, wd);\r\n    return wd;\r\n}\r\n\r\nstatic WatchedFile *NewWatchedFile(const WCHAR *filePath, FileChangeObserver *observer)\r\n{\r\n    bool isManualCheck = PathIsNetworkPath(filePath);\r\n    ScopedMem<WCHAR> dirPath(path::GetDir(filePath));\r\n    WatchedDir *wd = nullptr;\r\n    bool newDir = false;\r\n    if (!isManualCheck) {\r\n        wd = FindExistingWatchedDir(dirPath);\r\n        if (!wd) {\r\n            wd = NewWatchedDir(dirPath);\r\n            if (!wd)\r\n                return nullptr;\r\n            newDir = true;\r\n        }\r\n    }\r\n\r\n    WatchedFile *wf = AllocStruct<WatchedFile>();\r\n    wf->filePath = str::Dup(filePath);\r\n    wf->observer = observer;\r\n    wf->watchedDir = wd;\r\n    wf->isManualCheck = isManualCheck;\r\n\r\n    ListInsert(&g_watchedFiles, wf);\r\n\r\n    if (wf->isManualCheck) {\r\n        GetFileState(filePath, &wf->fileState);\r\n        AwakeWatcherThread();\r\n    } else {\r\n        if (newDir)\r\n            StartMonitoringDirForChanges(wf->watchedDir);\r\n    }\r\n\r\n    return wf;\r\n}\r\n\r\nstatic void DeleteWatchedFile(WatchedFile *wf)\r\n{\r\n    free((void*)wf->filePath);\r\n    delete wf->observer;\r\n    free(wf);\r\n}\r\n\r\n/* Subscribe for notifications about file changes. When a file changes, we'll\r\ncall observer->OnFileChanged().\r\n\r\nWe take ownership of observer object.\r\n\r\nReturns a cancellation token that can be used in FileWatcherUnsubscribe(). That\r\nway we can support multiple callers subscribing to the same file.\r\n*/\r\nWatchedFile *FileWatcherSubscribe(const WCHAR *path, FileChangeObserver *observer)\r\n{\r\n    CrashIf(!observer);\r\n\r\n    lf(L\"FileWatcherSubscribe() path: %s\", path);\r\n\r\n    if (!file::Exists(path)) {\r\n        delete observer;\r\n        return nullptr;\r\n    }\r\n\r\n    StartThreadIfNecessary();\r\n\r\n    ScopedCritSec cs(&g_threadCritSec);\r\n    return NewWatchedFile(path, observer);\r\n}\r\n\r\nstatic bool IsWatchedDirReferenced(WatchedDir *wd)\r\n{\r\n    for (WatchedFile *wf = g_watchedFiles; wf; wf = wf->next) {\r\n        if (wf->watchedDir == wd)\r\n            return true;\r\n    }\r\n    return false;\r\n}\r\n\r\nstatic void RemoveWatchedDirIfNotReferenced(WatchedDir *wd)\r\n{\r\n    if (IsWatchedDirReferenced(wd))\r\n        return;\r\n\r\n    bool ok = ListRemove(&g_watchedDirs, wd);\r\n    CrashIf(!ok);\r\n    // memory will be eventually freed in ReadDirectoryChangesNotification()\r\n    InterlockedIncrement(&gRemovalsPending);\r\n    QueueUserAPC(StopMonitoringDirAPC, g_threadHandle, (ULONG_PTR)wd);\r\n}\r\n\r\nvoid FileWatcherWaitForShutdown()\r\n{\r\n    // this is meant to be called at the end so we shouldn't\r\n    // have any file watching subscriptions pending\r\n    CrashIf(g_watchedFiles != nullptr);\r\n    CrashIf(g_watchedDirs != nullptr);\r\n\r\n    // wait for ReadDirectoryChangesNotification() process actions triggered\r\n    // in RemoveWatchedDirIfNotReferenced\r\n    LONG v;\r\n    int maxWait = 100; // 1 sec\r\n    for (;;) {\r\n        v = InterlockedCompareExchange(&gRemovalsPending, 0, 0);\r\n        if (v == 0) {\r\n            return;\r\n        }\r\n        Sleep(10);\r\n        if (--maxWait < 0) {\r\n            return;\r\n        }\r\n    }\r\n}\r\n\r\nstatic void RemoveWatchedFile(WatchedFile *wf)\r\n{\r\n    WatchedDir *wd = wf->watchedDir;\r\n    bool ok = ListRemove(&g_watchedFiles, wf);\r\n    CrashIf(!ok);\r\n\r\n    bool needsAwakeThread = wf->isManualCheck;\r\n    DeleteWatchedFile(wf);\r\n    if (needsAwakeThread)\r\n        AwakeWatcherThread();\r\n    else\r\n        RemoveWatchedDirIfNotReferenced(wd);\r\n}\r\n\r\nvoid FileWatcherUnsubscribe(WatchedFile *wf)\r\n{\r\n    if (!wf)\r\n        return;\r\n    CrashIf(!g_threadHandle);\r\n\r\n    ScopedCritSec cs(&g_threadCritSec);\r\n\r\n    RemoveWatchedFile(wf);\r\n}\r\n"
  },
  {
    "path": "src/utils/FileWatcher.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nclass FileChangeObserver {\r\npublic:\r\n    virtual ~FileChangeObserver() { }\r\n    virtual void OnFileChanged() = 0;\r\n};\r\n\r\nstruct WatchedFile;\r\n\r\nWatchedFile *FileWatcherSubscribe(const WCHAR *path, FileChangeObserver *observer);\r\nvoid         FileWatcherUnsubscribe(WatchedFile *wf);\r\nvoid         FileWatcherWaitForShutdown();\r\n"
  },
  {
    "path": "src/utils/FrameTimeoutCalculator.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nclass FrameTimeoutCalculator {\r\n\r\n    LARGE_INTEGER   timeStart;\r\n    LARGE_INTEGER   timeLast;\r\n    LONGLONG        ticksPerFrame;\r\n    LONGLONG        ticsPerMs;\r\n    LARGE_INTEGER   timeFreq;\r\n\r\npublic:\r\n    explicit FrameTimeoutCalculator(int framesPerSecond) {\r\n        QueryPerformanceFrequency(&timeFreq); // number of ticks per second\r\n        ticsPerMs = timeFreq.QuadPart / 1000;\r\n        ticksPerFrame = timeFreq.QuadPart / framesPerSecond;\r\n        QueryPerformanceCounter(&timeStart);\r\n        timeLast = timeStart;\r\n    }\r\n\r\n    // in seconds, as a double\r\n    double ElapsedTotal() {\r\n        LARGE_INTEGER timeCurr;\r\n        QueryPerformanceCounter(&timeCurr);\r\n        LONGLONG elapsedTicks =  timeCurr.QuadPart - timeStart.QuadPart;\r\n        double res = (double)elapsedTicks / (double)timeFreq.QuadPart;\r\n        return res;\r\n    }\r\n\r\n    DWORD GetTimeoutInMilliseconds() {\r\n        LARGE_INTEGER timeCurr;\r\n        LONGLONG elapsedTicks;\r\n        QueryPerformanceCounter(&timeCurr);\r\n        elapsedTicks = timeCurr.QuadPart - timeLast.QuadPart;\r\n        if (elapsedTicks > ticksPerFrame) {\r\n            return 0;\r\n        } else {\r\n            LONGLONG timeoutMs = (ticksPerFrame - elapsedTicks) / ticsPerMs;\r\n            return (DWORD)timeoutMs;\r\n        }\r\n    }\r\n\r\n    void Step() {\r\n        timeLast.QuadPart += ticksPerFrame;\r\n    }\r\n};\r\n"
  },
  {
    "path": "src/utils/FzImgReader.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#pragma warning(disable: 4611) // interaction between '_setjmp' and C++ object destruction is non-portable\r\n\r\n#ifndef NO_LIBMUPDF\r\nextern \"C\" {\r\n#include <mupdf/fitz.h>\r\n}\r\n#endif\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"FzImgReader.h\"\r\n\r\n#ifndef NO_LIBMUPDF\r\n\r\nusing namespace Gdiplus;\r\n\r\nnamespace fitz {\r\n\r\nstatic Bitmap *ImageFromJpegData(fz_context *ctx, const char *data, int len)\r\n{\r\n    int w = 0, h = 0, xres = 0, yres = 0;\r\n    fz_colorspace *cs = nullptr;\r\n    fz_stream *stm = nullptr;\r\n\r\n    fz_var(cs);\r\n    fz_var(stm);\r\n\r\n    fz_try(ctx) {\r\n        fz_load_jpeg_info(ctx, (unsigned char *)data, len, &w, &h, &xres, &yres, &cs);\r\n        stm = fz_open_memory(ctx, (unsigned char *)data, len);\r\n        stm = fz_open_dctd(stm, -1, 0, nullptr);\r\n    }\r\n    fz_catch(ctx) {\r\n        fz_drop_colorspace(ctx, cs);\r\n        cs = nullptr;\r\n    }\r\n\r\n    PixelFormat fmt = fz_device_rgb(ctx) == cs ? PixelFormat24bppRGB :\r\n                      fz_device_gray(ctx) == cs ? PixelFormat24bppRGB :\r\n                      fz_device_cmyk(ctx) == cs ? PixelFormat32bppCMYK :\r\n                      PixelFormatUndefined;\r\n    if (PixelFormatUndefined == fmt || w <= 0 || h <= 0 || !cs) {\r\n        fz_close(stm);\r\n        fz_drop_colorspace(ctx, cs);\r\n        return nullptr;\r\n    }\r\n\r\n    Bitmap bmp(w, h, fmt);\r\n    bmp.SetResolution(xres, yres);\r\n\r\n    Rect bmpRect(0, 0, w, h);\r\n    BitmapData bmpData;\r\n    Status ok = bmp.LockBits(&bmpRect, ImageLockModeWrite, fmt, &bmpData);\r\n    if (ok != Ok) {\r\n        fz_close(stm);\r\n        fz_drop_colorspace(ctx, cs);\r\n        return nullptr;\r\n    }\r\n\r\n    fz_var(bmp);\r\n    fz_var(bmpRect);\r\n\r\n    fz_try(ctx) {\r\n        for (int y = 0; y < h; y++) {\r\n            unsigned char *line = (unsigned char *)bmpData.Scan0 + y * bmpData.Stride;\r\n            for (int x = 0; x < w; x++) {\r\n                int read = fz_read(stm, line, cs->n);\r\n                if (read != cs->n)\r\n                    fz_throw(ctx, FZ_ERROR_GENERIC, \"insufficient data for image\");\r\n                if (3 == cs->n) { // RGB -> BGR\r\n                    std::swap(line[0], line[2]);\r\n                    line += 3;\r\n                }\r\n                else if (1 == cs->n) { // gray -> BGR\r\n                    line[1] = line[2] = line[0];\r\n                    line += 3;\r\n                }\r\n                else if (4 == cs->n) { // CMYK color inversion\r\n                    for (int k = 0; k < 4; k++)\r\n                        line[k] = 255 - line[k];\r\n                    line += 4;\r\n                }\r\n            }\r\n        }\r\n    }\r\n    fz_always(ctx) {\r\n        bmp.UnlockBits(&bmpData);\r\n        fz_close(stm);\r\n        fz_drop_colorspace(ctx, cs);\r\n    }\r\n    fz_catch(ctx) {\r\n        return nullptr;\r\n    }\r\n\r\n    // hack to avoid the use of ::new (because there won't be a corresponding ::delete)\r\n    return bmp.Clone(0, 0, w, h, fmt);\r\n}\r\n\r\nstatic Bitmap *ImageFromJp2Data(fz_context *ctx, const char *data, int len)\r\n{\r\n    fz_pixmap *pix = nullptr;\r\n    fz_pixmap *pix_argb = nullptr;\r\n\r\n    fz_var(pix);\r\n    fz_var(pix_argb);\r\n\r\n    fz_try(ctx) {\r\n        pix = fz_load_jpx(ctx, (unsigned char *)data, len, nullptr, 0);\r\n    }\r\n    fz_catch(ctx) {\r\n        return nullptr;\r\n    }\r\n\r\n    int w = pix->w, h = pix->h;\r\n    Bitmap bmp(w, h, PixelFormat32bppARGB);\r\n    bmp.SetResolution(pix->xres, pix->yres);\r\n\r\n    Rect bmpRect(0, 0, w, h);\r\n    BitmapData bmpData;\r\n    Status ok = bmp.LockBits(&bmpRect, ImageLockModeWrite, PixelFormat32bppARGB, &bmpData);\r\n    if (ok != Ok) {\r\n        fz_drop_pixmap(ctx, pix);\r\n        return nullptr;\r\n    }\r\n\r\n    fz_var(bmp);\r\n    fz_var(bmpRect);\r\n\r\n    fz_try(ctx) {\r\n        pix_argb = fz_new_pixmap_with_data(ctx, fz_device_bgr(ctx), w, h, (unsigned char *)bmpData.Scan0);\r\n        fz_convert_pixmap(ctx, pix_argb, pix);\r\n    }\r\n    fz_always(ctx) {\r\n        bmp.UnlockBits(&bmpData);\r\n        fz_drop_pixmap(ctx, pix);\r\n        fz_drop_pixmap(ctx, pix_argb);\r\n    }\r\n    fz_catch(ctx) {\r\n        return nullptr;\r\n    }\r\n\r\n    // hack to avoid the use of ::new (because there won't be a corresponding ::delete)\r\n    return bmp.Clone(0, 0, w, h, PixelFormat32bppARGB);\r\n}\r\n\r\nBitmap *ImageFromData(const char *data, size_t len)\r\n{\r\n    if (len > INT_MAX || len < 12)\r\n        return nullptr;\r\n\r\n    fz_context *ctx = fz_new_context(nullptr, nullptr, 0);\r\n    if (!ctx)\r\n        return nullptr;\r\n\r\n    Bitmap *result = nullptr;\r\n    if (str::StartsWith(data, \"\\xFF\\xD8\"))\r\n        result = ImageFromJpegData(ctx, data, (int)len);\r\n    else if (memeq(data, \"\\0\\0\\0\\x0CjP  \\x0D\\x0A\\x87\\x0A\", 12))\r\n        result = ImageFromJp2Data(ctx, data, (int)len);\r\n\r\n    fz_free_context(ctx);\r\n\r\n    return result;\r\n}\r\n\r\n}\r\n\r\n#else\r\n\r\nnamespace fitz {\r\n    Gdiplus::Bitmap *ImageFromData(const char *data, size_t len) { UNUSED(data); UNUSED(len); return nullptr; }\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "src/utils/FzImgReader.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nnamespace fitz {\r\n\r\nGdiplus::Bitmap *ImageFromData(const char *data, size_t len);\r\n\r\n}\r\n"
  },
  {
    "path": "src/utils/GdiPlusUtil.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include <wincodec.h>\r\n#include \"GdiPlusUtil.h\"\r\n#include \"ByteReader.h\"\r\n#include \"FzImgReader.h\"\r\n#include \"TgaReader.h\"\r\n#include \"WebpReader.h\"\r\n#include \"WinUtil.h\"\r\n\r\n// Get width of each character and add them up.\r\n// Doesn't seem to be any different than MeasureTextAccurate() i.e. it still\r\n// underreports the width\r\nRectF MeasureTextAccurate2(Graphics *g, Font *f, const WCHAR *s, int len)\r\n{\r\n    CrashIf(0 >= len);\r\n    FixedArray<Region, 1024> regionBuf(len);\r\n    Region *r = regionBuf.Get();\r\n    StringFormat sf(StringFormat::GenericTypographic());\r\n    sf.SetFormatFlags(sf.GetFormatFlags() | StringFormatFlagsMeasureTrailingSpaces);\r\n    RectF layoutRect;\r\n    FixedArray<CharacterRange, 1024> charRangesBuf(len);\r\n    CharacterRange *charRanges = charRangesBuf.Get();\r\n    for (int i = 0; i < len; i++) {\r\n        charRanges[i].First = i;\r\n        charRanges[i].Length = 1;\r\n    }\r\n    sf.SetMeasurableCharacterRanges(len, charRanges);\r\n    Status status = g->MeasureCharacterRanges(s, len, f, layoutRect, &sf, len, r);\r\n    CrashIf(status != Ok);\r\n    RectF bbox;\r\n    REAL maxDy = 0;\r\n    REAL totalDx = 0;\r\n    for (int i = 0; i < len; i++) {\r\n        r[i].GetBounds(&bbox, g);\r\n        if (bbox.Height > maxDy)\r\n            maxDy = bbox.Height;\r\n        totalDx += bbox.Width;\r\n    }\r\n    bbox.Width = totalDx;\r\n    bbox.Height = maxDy;\r\n    return bbox;\r\n}\r\n\r\n// note: gdi+ seems to under-report the width, the longer the text, the\r\n// bigger the difference. I'm trying to correct for that with those magic values\r\n#define PER_CHAR_DX_ADJUST .2f\r\n#define PER_STR_DX_ADJUST  1.f\r\n\r\n// http://www.codeproject.com/KB/GDI-plus/measurestring.aspx\r\nRectF MeasureTextAccurate(Graphics *g, Font *f, const WCHAR *s, int len)\r\n{\r\n    if (0 == len)\r\n        return RectF(0, 0, 0, 0); // TODO: should set height to font's height\r\n    // note: frankly, I don't see a difference between those StringFormat variations\r\n    StringFormat sf(StringFormat::GenericTypographic());\r\n    sf.SetFormatFlags(sf.GetFormatFlags() | StringFormatFlagsMeasureTrailingSpaces);\r\n    //StringFormat sf(StringFormat::GenericDefault());\r\n    //StringFormat sf;\r\n    RectF layoutRect;\r\n    CharacterRange cr(0, len);\r\n    sf.SetMeasurableCharacterRanges(1, &cr);\r\n    Region r;\r\n    Status status = g->MeasureCharacterRanges(s, len, f, layoutRect, &sf, 1, &r);\r\n    CrashIf(status != Ok);\r\n    RectF bbox;\r\n    r.GetBounds(&bbox, g);\r\n    if (bbox.Width != 0)\r\n        bbox.Width += PER_STR_DX_ADJUST + (PER_CHAR_DX_ADJUST * (float)len);\r\n    return bbox;\r\n}\r\n\r\n// this usually reports size that is too large\r\nRectF MeasureTextStandard(Graphics *g, Font *f, const WCHAR *s, int len)\r\n{\r\n    RectF bbox;\r\n    PointF pz(0,0);\r\n    g->MeasureString(s, len, f, pz, &bbox);\r\n    return bbox;\r\n}\r\n\r\nRectF MeasureTextQuick(Graphics *g, Font *f, const WCHAR *s, int len)\r\n{\r\n    CrashIf(0 >= len);\r\n\r\n    static Vec<Font *> fontCache;\r\n    static Vec<bool> fixCache;\r\n\r\n    RectF bbox;\r\n    g->MeasureString(s, len, f, PointF(0, 0), &bbox);\r\n    int idx = fontCache.Find(f);\r\n    if (-1 == idx) {\r\n        LOGFONTW lfw;\r\n        Status ok = f->GetLogFontW(g, &lfw);\r\n        bool isItalicOrMonospace = Ok != ok || lfw.lfItalic ||\r\n                                   str::Eq(lfw.lfFaceName, L\"Courier New\") ||\r\n                                   str::Find(lfw.lfFaceName, L\"Consol\") ||\r\n                                   str::EndsWith(lfw.lfFaceName, L\"Mono\") ||\r\n                                   str::EndsWith(lfw.lfFaceName, L\"Typewriter\");\r\n        fontCache.Append(f);\r\n        fixCache.Append(isItalicOrMonospace);\r\n        idx = (int)fontCache.Count() - 1;\r\n    }\r\n    // most documents look good enough with these adjustments\r\n    if (!fixCache.At(idx)) {\r\n        REAL correct = 0;\r\n        for (int i = 0; i < len; i++) {\r\n            switch (s[i]) {\r\n            case 'i': case 'l': correct += 0.2f; break;\r\n            case 't': case 'f': case 'I': correct += 0.1f; break;\r\n            case '.': case ',': case '!': correct += 0.1f; break;\r\n            }\r\n        }\r\n        bbox.Width *= (1.0f - correct / len) * 0.99f;\r\n    }\r\n    bbox.Height *= 0.95f;\r\n    return bbox;\r\n}\r\n\r\nRectF MeasureText(Graphics *g, Font *f, const WCHAR *s, size_t len, TextMeasureAlgorithm algo)\r\n{\r\n    if (-1 == len)\r\n        len = str::Len(s);\r\n    CrashIf(len > INT_MAX);\r\n    if (algo)\r\n        return algo(g, f, s, (int)len);\r\n    RectF bbox = MeasureTextAccurate(g, f, s, (int)len);\r\n    return bbox;\r\n}\r\n\r\n// returns number of characters of string s that fits in a given width dx\r\n// note: could be speed up a bit because in our use case we already know\r\n// the width of the whole string so we could supply it to the function, but\r\n// this shouldn't happen often, so that's fine. It's also possible that\r\n// a smarter approach is possible, but this usually only does 3 MeasureText\r\n// calls, so it's not that bad\r\nsize_t StringLenForWidth(Graphics *g, Font *f, const WCHAR *s, size_t len, float dx, TextMeasureAlgorithm algo)\r\n{\r\n    RectF r = MeasureText(g, f, s, len, algo);\r\n    if (r.Width <= dx)\r\n        return len;\r\n    // make the best guess of the length that fits\r\n    size_t n = (size_t)((dx / r.Width) * (float)len);\r\n    CrashIf((0 == n) || (n > len));\r\n    r = MeasureText(g, f, s, n, algo);\r\n    // find the length len of s that fits within dx iff width of len+1 exceeds dx\r\n    int dir = 1; // increasing length\r\n    if (r.Width > dx)\r\n        dir = -1; // decreasing length\r\n    for (;;) {\r\n        n += dir;\r\n        r = MeasureText(g, f, s, n, algo);\r\n        if (1 == dir) {\r\n            // if advancing length, we know that previous string did fit, so if\r\n            // the new one doesn't fit, the previous length was the right one\r\n            if (r.Width > dx)\r\n                return n - 1;\r\n        } else {\r\n            // if decreasing length, we know that previous string didn't fit, so if\r\n            // the one one fits, it's of the correct length\r\n            if (r.Width < dx)\r\n                return n;\r\n        }\r\n    }\r\n}\r\n\r\n// TODO: not quite sure why spaceDx1 != spaceDx2, using spaceDx2 because\r\n// is smaller and looks as better spacing to me\r\nREAL GetSpaceDx(Graphics *g, Font *f, TextMeasureAlgorithm algo)\r\n{\r\n    RectF bbox;\r\n#if 0\r\n    bbox = MeasureText(g, f, L\" \", 1, algo);\r\n    REAL spaceDx1 = bbox.Width;\r\n    return spaceDx1;\r\n#else\r\n    // this method seems to return (much) smaller size that measuring\r\n    // the space itself\r\n    bbox = MeasureText(g, f, L\"wa\", 2, algo);\r\n    REAL l1 = bbox.Width;\r\n    bbox = MeasureText(g, f, L\"w a\", 3, algo);\r\n    REAL l2 = bbox.Width;\r\n    REAL spaceDx2 = l2 - l1;\r\n    return spaceDx2;\r\n#endif\r\n}\r\n\r\nvoid GetBaseTransform(Matrix& m, RectF pageRect, float zoom, int rotation)\r\n{\r\n    rotation = rotation % 360;\r\n    if (rotation < 0) rotation = rotation + 360;\r\n    if (90 == rotation)\r\n        m.Translate(0, -pageRect.Height, MatrixOrderAppend);\r\n    else if (180 == rotation)\r\n        m.Translate(-pageRect.Width, -pageRect.Height, MatrixOrderAppend);\r\n    else if (270 == rotation)\r\n        m.Translate(-pageRect.Width, 0, MatrixOrderAppend);\r\n    else if (0 == rotation)\r\n        m.Translate(0, 0, MatrixOrderAppend);\r\n    else\r\n        CrashIf(true);\r\n\r\n    m.Scale(zoom, zoom, MatrixOrderAppend);\r\n    m.Rotate((REAL)rotation, MatrixOrderAppend);\r\n}\r\n\r\nstatic Bitmap *WICDecodeImageFromStream(IStream *stream)\r\n{\r\n    ScopedCom com;\r\n\r\n#define HR(hr) if (FAILED(hr)) return nullptr;\r\n    ScopedComPtr<IWICImagingFactory> pFactory;\r\n    if (!pFactory.Create(CLSID_WICImagingFactory)) return nullptr;\r\n    ScopedComPtr<IWICBitmapDecoder> pDecoder;\r\n    HR(pFactory->CreateDecoderFromStream(stream, nullptr, WICDecodeMetadataCacheOnDemand,\r\n                                         &pDecoder));\r\n    ScopedComPtr<IWICBitmapFrameDecode> srcFrame;\r\n    HR(pDecoder->GetFrame(0, &srcFrame));\r\n    ScopedComPtr<IWICFormatConverter> pConverter;\r\n    HR(pFactory->CreateFormatConverter(&pConverter));\r\n    HR(pConverter->Initialize(srcFrame, GUID_WICPixelFormat32bppBGRA,\r\n                              WICBitmapDitherTypeNone, nullptr, 0.f, WICBitmapPaletteTypeCustom));\r\n\r\n    UINT w, h;\r\n    HR(pConverter->GetSize(&w, &h));\r\n    double xres, yres;\r\n    HR(pConverter->GetResolution(&xres, &yres));\r\n    Bitmap bmp(w, h, PixelFormat32bppARGB);\r\n    Rect bmpRect(0, 0, w, h);\r\n    BitmapData bmpData;\r\n    Status ok = bmp.LockBits(&bmpRect, ImageLockModeWrite, PixelFormat32bppARGB, &bmpData);\r\n    if (ok != Ok)\r\n        return nullptr;\r\n    HR(pConverter->CopyPixels(nullptr, bmpData.Stride, bmpData.Stride * h, (BYTE *)bmpData.Scan0));\r\n    bmp.UnlockBits(&bmpData);\r\n    bmp.SetResolution((REAL)xres, (REAL)yres);\r\n#undef HR\r\n\r\n    // hack to avoid the use of ::new (because there won't be a corresponding ::delete)\r\n    return bmp.Clone(0, 0, w, h, PixelFormat32bppARGB);\r\n}\r\n\r\nenum ImgFormat {\r\n    Img_Unknown, Img_BMP, Img_GIF, Img_JPEG,\r\n    Img_JXR, Img_PNG, Img_TGA, Img_TIFF, Img_WebP, Img_JP2,\r\n};\r\n\r\nstatic ImgFormat GfxFormatFromData(const char *data, size_t len)\r\n{\r\n    if (!data || len < 12)\r\n        return Img_Unknown;\r\n    // check the most common formats first\r\n    if (str::StartsWith(data, \"\\x89PNG\\x0D\\x0A\\x1A\\x0A\"))\r\n        return Img_PNG;\r\n    if (str::StartsWith(data, \"\\xFF\\xD8\"))\r\n        return Img_JPEG;\r\n    if (str::StartsWith(data, \"GIF87a\") || str::StartsWith(data, \"GIF89a\"))\r\n        return Img_GIF;\r\n    if (str::StartsWith(data, \"BM\"))\r\n        return Img_BMP;\r\n    if (memeq(data, \"MM\\x00\\x2A\", 4) || memeq(data, \"II\\x2A\\x00\", 4))\r\n        return Img_TIFF;\r\n    if (tga::HasSignature(data, len))\r\n        return Img_TGA;\r\n    if (memeq(data, \"II\\xBC\\x01\", 4) || memeq(data, \"II\\xBC\\x00\", 4))\r\n        return Img_JXR;\r\n    if (webp::HasSignature(data, len))\r\n        return Img_WebP;\r\n    if (memeq(data, \"\\0\\0\\0\\x0CjP  \\x0D\\x0A\\x87\\x0A\", 12))\r\n        return Img_JP2;\r\n    return Img_Unknown;\r\n}\r\n\r\nconst WCHAR *GfxFileExtFromData(const char *data, size_t len)\r\n{\r\n    switch (GfxFormatFromData(data, len)) {\r\n    case Img_BMP:  return L\".bmp\";\r\n    case Img_GIF:  return L\".gif\";\r\n    case Img_JPEG: return L\".jpg\";\r\n    case Img_JXR:  return L\".jxr\";\r\n    case Img_PNG:  return L\".png\";\r\n    case Img_TGA:  return L\".tga\";\r\n    case Img_TIFF: return L\".tif\";\r\n    case Img_WebP: return L\".webp\";\r\n    case Img_JP2:  return L\".jp2\";\r\n    default:       return nullptr;\r\n    }\r\n}\r\n\r\n// Windows' JPEG codec doesn't support arithmetic coding\r\nstatic bool JpegUsesArithmeticCoding(const char *data, size_t len)\r\n{\r\n    CrashIf(GfxFormatFromData(data, len) != Img_JPEG);\r\n\r\n    ByteReader r(data, len);\r\n    for (size_t ix = 2; ix + 9 < len && r.Byte(ix) == 0xFF; ix += r.WordBE(ix + 2) + 2) {\r\n        if (0xC9 <= r.Byte(ix + 1) && r.Byte(ix + 1) <= 0xCB) {\r\n            // found the start of a frame using arithmetic coding\r\n            return true;\r\n        }\r\n    }\r\n    return false;\r\n}\r\n\r\n// Windows' PNG codec fails to handle an edge case, resulting in\r\n// an infinite loop (cf. http://cxsecurity.com/issue/WLB-2014080021 )\r\nstatic bool PngRequiresPresetDict(const char *data, size_t len)\r\n{\r\n    CrashIf(GfxFormatFromData(data, len) != Img_PNG);\r\n\r\n    ByteReader r(data, len);\r\n    for (size_t ix = 8; ix + 12 < len && r.DWordBE(ix) < len - ix - 12; ix += r.DWordBE(ix) + 12) {\r\n        if (r.DWordBE(ix + 4) == 0x49444154 /* IDAT */) {\r\n            // check the zlib header's FDICT flag\r\n            // (even if this image claims not to be zlib compressed!)\r\n            return (r.Byte(ix + 9) & (1 << 5)) != 0;\r\n        }\r\n    }\r\n\r\n    return false;\r\n}\r\n\r\nbool IsGdiPlusNativeFormat(const char *data, size_t len)\r\n{\r\n    ImgFormat fmt = GfxFormatFromData(data, len);\r\n    return Img_BMP == fmt || Img_GIF == fmt || Img_TIFF == fmt ||\r\n           (Img_JPEG == fmt && !JpegUsesArithmeticCoding(data, len)) ||\r\n           (Img_PNG == fmt && !PngRequiresPresetDict(data, len));\r\n}\r\n\r\n// cf. http://stackoverflow.com/questions/4598872/creating-hbitmap-from-memory-buffer/4616394#4616394\r\nBitmap *BitmapFromData(const char *data, size_t len)\r\n{\r\n    ImgFormat format = GfxFormatFromData(data, len);\r\n    if (Img_TGA == format)\r\n        return tga::ImageFromData(data, len);\r\n    if (Img_WebP == format)\r\n        return webp::ImageFromData(data, len);\r\n    if (Img_JP2 == format)\r\n        return fitz::ImageFromData(data, len);\r\n    if (Img_JPEG == format && JpegUsesArithmeticCoding(data, len))\r\n        return fitz::ImageFromData(data, len);\r\n    if (Img_PNG == format && PngRequiresPresetDict(data, len))\r\n        return nullptr;\r\n\r\n    ScopedComPtr<IStream> stream(CreateStreamFromData(data, len));\r\n    if (!stream)\r\n        return nullptr;\r\n    if (Img_JXR == format)\r\n        return WICDecodeImageFromStream(stream);\r\n\r\n    Bitmap *bmp = Bitmap::FromStream(stream);\r\n    if (bmp && bmp->GetLastStatus() != Ok) {\r\n        delete bmp;\r\n        bmp = nullptr;\r\n    }\r\n    // GDI+ under Windows XP sometimes fails to extract JPEG image dimensions\r\n    if (bmp && Img_JPEG == format && (0 == bmp->GetWidth() || 0 == bmp->GetHeight())) {\r\n        delete bmp;\r\n        bmp = fitz::ImageFromData(data, len);\r\n    }\r\n    return bmp;\r\n}\r\n\r\n// adapted from http://cpansearch.perl.org/src/RJRAY/Image-Size-3.230/lib/Image/Size.pm\r\nSize BitmapSizeFromData(const char *data, size_t len)\r\n{\r\n    Size result;\r\n    ByteReader r(data, len);\r\n    switch (GfxFormatFromData(data, len)) {\r\n    case Img_BMP:\r\n        if (len >= sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER)) {\r\n            BITMAPINFOHEADER bmi;\r\n            bool ok = r.UnpackLE(&bmi, sizeof(bmi), \"3d2w6d\", sizeof(BITMAPFILEHEADER));\r\n            CrashIf(!ok);\r\n            result.Width = bmi.biWidth;\r\n            result.Height = bmi.biHeight;\r\n        }\r\n        break;\r\n    case Img_GIF:\r\n        if (len >= 13) {\r\n            // find the first image's actual size instead of using the\r\n            // \"logical screen\" size which is sometimes too large\r\n            size_t ix = 13;\r\n            // skip the global color table\r\n            if ((r.Byte(10) & 0x80))\r\n                ix += 3 * (1 << ((r.Byte(10) & 0x07) + 1));\r\n            while (ix + 8 < len) {\r\n                if (r.Byte(ix) == 0x2C) {\r\n                    result.Width = r.WordLE(ix + 5);\r\n                    result.Height = r.WordLE(ix + 7);\r\n                    break;\r\n                }\r\n                else if (r.Byte(ix) == 0x21 && r.Byte(ix + 1) == 0xF9)\r\n                    ix += 8;\r\n                else if (r.Byte(ix) == 0x21 && r.Byte(ix + 1) == 0xFE) {\r\n                    const char *commentEnd = r.Find(ix + 2, 0x00);\r\n                    ix = commentEnd ? commentEnd - data + 1 : len;\r\n                }\r\n                else if (r.Byte(ix) == 0x21 && r.Byte(ix + 1) == 0x01 && ix + 15 < len) {\r\n                    const char *textDataEnd = r.Find(ix + 15, 0x00);\r\n                    ix = textDataEnd ? textDataEnd - data + 1 : len;\r\n                }\r\n                else if (r.Byte(ix) == 0x21 && r.Byte(ix + 1) == 0xFF && ix + 14 < len) {\r\n                    const char *applicationDataEnd = r.Find(ix + 14, 0x00);\r\n                    ix = applicationDataEnd ? applicationDataEnd - data + 1 : len;\r\n                }\r\n                else\r\n                    break;\r\n            }\r\n        }\r\n        break;\r\n    case Img_JPEG:\r\n        // find the last start of frame marker for non-differential Huffman/arithmetic coding\r\n        for (size_t ix = 2; ix + 9 < len && r.Byte(ix) == 0xFF; ) {\r\n            if (0xC0 <= r.Byte(ix + 1) && r.Byte(ix + 1) <= 0xC3 ||\r\n                0xC9 <= r.Byte(ix + 1) && r.Byte(ix + 1) <= 0xCB) {\r\n                result.Width = r.WordBE(ix + 7);\r\n                result.Height = r.WordBE(ix + 5);\r\n            }\r\n            ix += r.WordBE(ix + 2) + 2;\r\n        }\r\n        break;\r\n    case Img_JXR:\r\n    case Img_TIFF:\r\n        if (len >= 10) {\r\n            bool isBE = r.Byte(0) == 'M', isJXR = r.Byte(2) == 0xBC;\r\n            CrashIf(!isBE && r.Byte(0) != 'I' || isJXR && isBE);\r\n            const WORD WIDTH = isJXR ? 0xBC80 : 0x0100, HEIGHT = isJXR ? 0xBC81 : 0x0101;\r\n            size_t idx = r.DWord(4, isBE);\r\n            WORD count = idx <= len - 2 ? r.Word(idx, isBE) : 0;\r\n            for (idx += 2; count > 0 && idx <= len - 12; count--, idx += 12) {\r\n                WORD tag = r.Word(idx, isBE), type = r.Word(idx + 2, isBE);\r\n                if (r.DWord(idx + 4, isBE) != 1)\r\n                    continue;\r\n                else if (WIDTH == tag && 4 == type)\r\n                    result.Width = r.DWord(idx + 8, isBE);\r\n                else if (WIDTH == tag && 3 == type)\r\n                    result.Width = r.Word(idx + 8, isBE);\r\n                else if (WIDTH == tag && 1 == type)\r\n                    result.Width = r.Byte(idx + 8);\r\n                else if (HEIGHT == tag && 4 == type)\r\n                    result.Height = r.DWord(idx + 8, isBE);\r\n                else if (HEIGHT == tag && 3 == type)\r\n                    result.Height = r.Word(idx + 8, isBE);\r\n                else if (HEIGHT == tag && 1 == type)\r\n                    result.Height = r.Byte(idx + 8);\r\n            }\r\n        }\r\n        break;\r\n    case Img_PNG:\r\n        if (len >= 24 && str::StartsWith(data + 12, \"IHDR\")) {\r\n            result.Width = r.DWordBE(16);\r\n            result.Height = r.DWordBE(20);\r\n        }\r\n        break;\r\n    case Img_TGA:\r\n        if (len >= 16) {\r\n            result.Width = r.WordLE(12);\r\n            result.Height = r.WordLE(14);\r\n        }\r\n        break;\r\n    case Img_WebP:\r\n        if (len >= 30 && str::StartsWith(data + 12, \"VP8 \")) {\r\n            result.Width = r.WordLE(26) & 0x3fff;\r\n            result.Height = r.WordLE(28) & 0x3fff;\r\n        }\r\n        else {\r\n            result = webp::SizeFromData(data, len);\r\n        }\r\n        break;\r\n    case Img_JP2:\r\n        if (len >= 32) {\r\n            size_t ix = 0;\r\n            while (ix < len - 32) {\r\n                uint32_t lbox = r.DWordBE(ix);\r\n                uint32_t tbox = r.DWordBE(ix + 4);\r\n                if (0x6A703268 /* jp2h */ == tbox) {\r\n                    ix += 8;\r\n                    if (r.DWordBE(ix) == 24 && r.DWordBE(ix + 4) == 0x69686472 /* ihdr */) {\r\n                        result.Width = r.DWordBE(ix + 16);\r\n                        result.Height = r.DWordBE(ix + 12);\r\n                    }\r\n                    break;\r\n                }\r\n                else if (lbox != 0 && ix < UINT32_MAX - lbox) {\r\n                    ix += lbox;\r\n                }\r\n                else {\r\n                    break;\r\n                }\r\n            }\r\n        }\r\n        break;\r\n    }\r\n\r\n    if (result.Empty()) {\r\n        // let GDI+ extract the image size if we've failed\r\n        // (currently happens for animated GIF)\r\n        Bitmap *bmp = BitmapFromData(data, len);\r\n        if (bmp)\r\n            result = Size(bmp->GetWidth(), bmp->GetHeight());\r\n        delete bmp;\r\n    }\r\n\r\n    return result;\r\n}\r\n\r\nCLSID GetEncoderClsid(const WCHAR *format)\r\n{\r\n    CLSID null = { 0 };\r\n    UINT numEncoders, size;\r\n    Status ok = GetImageEncodersSize(&numEncoders, &size);\r\n    if (ok != Ok || 0 == size)\r\n        return null;\r\n    ScopedMem<ImageCodecInfo> codecInfo((ImageCodecInfo *)malloc(size));\r\n    if (!codecInfo)\r\n        return null;\r\n    GetImageEncoders(numEncoders, size, codecInfo);\r\n    for (UINT j = 0; j < numEncoders; j++) {\r\n        if (str::Eq(codecInfo[j].MimeType, format)) {\r\n            return codecInfo[j].Clsid;\r\n        }\r\n    }\r\n    return null;\r\n}\r\n"
  },
  {
    "path": "src/utils/GdiPlusUtil.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nusing namespace Gdiplus;\r\n\r\n#define COL_CLOSE_X         RGB(0xa0, 0xa0, 0xa0)\r\n#define COL_CLOSE_X_HOVER   RGB(0xf9, 0xeb, 0xeb)  // white-ish\r\n#define COL_CLOSE_HOVER_BG  RGB(0xC1, 0x35, 0x35)  // red-ish\r\n\r\ntypedef RectF (* TextMeasureAlgorithm)(Graphics *g, Font *f, const WCHAR *s, int len);\r\n\r\nRectF    MeasureTextAccurate(Graphics *g, Font *f, const WCHAR *s, int len);\r\nRectF    MeasureTextAccurate2(Graphics *g, Font *f, const WCHAR *s, int len);\r\nRectF    MeasureTextStandard(Graphics *g, Font *f, const WCHAR *s, int len);\r\nRectF    MeasureTextQuick(Graphics *g, Font *f, const WCHAR *s, int len);\r\nRectF    MeasureText(Graphics *g, Font *f, const WCHAR *s, size_t len=-1, TextMeasureAlgorithm algo=nullptr);\r\n//REAL     GetSpaceDx(Graphics *g, Font *f, TextMeasureAlgorithm algo=nullptr);\r\n//size_t   StringLenForWidth(Graphics *g, Font *f, const WCHAR *s, size_t len, float dx, TextMeasureAlgorithm algo=nullptr);\r\n\r\nvoid     GetBaseTransform(Matrix& m, RectF pageRect, float zoom, int rotation);\r\n\r\nconst WCHAR * GfxFileExtFromData(const char *data, size_t len);\r\nbool          IsGdiPlusNativeFormat(const char *data, size_t len);\r\nBitmap *      BitmapFromData(const char *data, size_t len);\r\nSize          BitmapSizeFromData(const char *data, size_t len);\r\nCLSID         GetEncoderClsid(const WCHAR *format);\r\n"
  },
  {
    "path": "src/utils/GeomUtil.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// note: include BaseUtil.h instead of including directly\r\n\r\nnamespace geomutil {\r\n\r\ntemplate <typename T>\r\nclass PointT\r\n{\r\npublic:\r\n    T x, y;\r\n\r\n    PointT() : x(0), y(0) { }\r\n    PointT(T x, T y) : x(x), y(y) { }\r\n\r\n    template <typename S>\r\n    PointT<S> Convert() const {\r\n        return PointT<S>((S)x, (S)y);\r\n    }\r\n\r\n    PointT<int> ToInt() const {\r\n        return PointT<int>((int)floor(x + 0.5), (int)floor(y + 0.5));\r\n    }\r\n\r\n    bool operator==(const PointT<T>& other) const {\r\n        return this->x == other.x && this->y == other.y;\r\n    }\r\n    bool operator!=(const PointT<T>& other) const {\r\n        return !this->operator==(other);\r\n    }\r\n};\r\n\r\ntemplate <typename T>\r\nclass SizeT\r\n{\r\npublic :\r\n    T dx, dy;\r\n\r\n    SizeT() : dx(0), dy(0) { }\r\n    SizeT(T dx, T dy) : dx(dx), dy(dy) { }\r\n\r\n    template <typename S>\r\n    SizeT<S> Convert() const {\r\n        return SizeT<S>((S)dx, (S)dy);\r\n    }\r\n\r\n    SizeT<int> ToInt() const {\r\n        return SizeT<int>((int)floor(dx + 0.5), (int)floor(dy + 0.5));\r\n    }\r\n\r\n    bool IsEmpty() const {\r\n        return dx == 0 || dy == 0;\r\n    }\r\n\r\n    bool operator==(const SizeT<T>& other) const {\r\n        return this->dx == other.dx && this->dy == other.dy;\r\n    }\r\n    bool operator!=(const SizeT<T>& other) const {\r\n        return !this->operator==(other);\r\n    }\r\n};\r\n\r\ntemplate <typename T>\r\nclass RectT\r\n{\r\npublic:\r\n    T x, y;\r\n    T dx, dy;\r\n\r\n    RectT() : x(0), y(0), dx(0), dy(0) { }\r\n    RectT(T x, T y, T dx, T dy) : x(x), y(y), dx(dx), dy(dy) { }\r\n    RectT(PointT<T> pt, SizeT<T> size) : x(pt.x), y(pt.y), dx(size.dx), dy(size.dy) { }\r\n\r\n    static RectT FromXY(T xs, T ys, T xe, T ye) {\r\n        if (xs > xe)\r\n            std::swap(xs, xe);\r\n        if (ys > ye)\r\n            std::swap(ys, ye);\r\n        return RectT(xs, ys, xe - xs, ye - ys);\r\n    }\r\n    static RectT FromXY(PointT<T> TL, PointT<T> BR) {\r\n        return FromXY(TL.x, TL.y, BR.x, BR.y);\r\n    }\r\n\r\n    template <typename S>\r\n    RectT<S> Convert() const {\r\n        return RectT<S>((S)x, (S)y, (S)dx, (S)dy);\r\n    }\r\n\r\n    RectT<int> ToInt() const {\r\n        return RectT<int>((int)floor(x + 0.5), (int)floor(y + 0.5),\r\n                          (int)floor(dx + 0.5), (int)floor(dy + 0.5));\r\n    }\r\n    // cf. fz_roundrect in mupdf/fitz/base_geometry.c\r\n#ifndef FLT_EPSILON\r\n#define FLT_EPSILON 1.192092896e-07f\r\n#endif\r\n    RectT<int> Round() const {\r\n        return RectT<int>::FromXY((int)floor(x + FLT_EPSILON),\r\n                                  (int)floor(y + FLT_EPSILON),\r\n                                  (int)ceil(x + dx - FLT_EPSILON),\r\n                                  (int)ceil(y + dy - FLT_EPSILON));\r\n    }\r\n\r\n    bool IsEmpty() const {\r\n        return dx == 0 || dy == 0;\r\n    }\r\n\r\n    bool Contains(PointT<T> pt) const {\r\n        if (pt.x < this->x)\r\n            return false;\r\n        if (pt.x > this->x + this->dx)\r\n            return false;\r\n        if (pt.y < this->y)\r\n            return false;\r\n        if (pt.y > this->y + this->dy)\r\n            return false;\r\n        return true;\r\n    }\r\n\r\n    /* Returns an empty rectangle if there's no intersection (see IsEmpty). */\r\n    RectT Intersect(RectT other) const {\r\n        /* The intersection starts with the larger of the start coordinates\r\n           and ends with the smaller of the end coordinates */\r\n        T _x = std::max(this->x, other.x);\r\n        T _y = std::max(this->y, other.y);\r\n        T _dx = std::min(this->x + this->dx, other.x + other.dx) - _x;\r\n        T _dy = std::min(this->y + this->dy, other.y + other.dy) - _y;\r\n\r\n        /* return an empty rectangle if the dimensions aren't positive */\r\n        if (_dx <= 0 || _dy <= 0)\r\n            return RectT();\r\n        return RectT(_x, _y, _dx, _dy);\r\n    }\r\n\r\n    RectT Union(RectT other) const {\r\n        if (this->dx <= 0 && this->dy <= 0)\r\n            return other;\r\n        if (other.dx <= 0 && other.dy <= 0)\r\n            return *this;\r\n\r\n        /* The union starts with the smaller of the start coordinates\r\n           and ends with the larger of the end coordinates */\r\n        T _x = std::min(this->x, other.x);\r\n        T _y = std::min(this->y, other.y);\r\n        T _dx = std::max(this->x + this->dx, other.x + other.dx) - _x;\r\n        T _dy = std::max(this->y + this->dy, other.y + other.dy) - _y;\r\n\r\n        return RectT(_x, _y, _dx, _dy);\r\n    }\r\n\r\n    void Offset(T _x, T _y) {\r\n        x += _x;\r\n        y += _y;\r\n    }\r\n\r\n    void Inflate(T _x, T _y) {\r\n        x -= _x; dx += 2 * _x;\r\n        y -= _y; dy += 2 * _y;\r\n    }\r\n\r\n    PointT<T> TL() const { return PointT<T>(x, y); }\r\n    PointT<T> BR() const { return PointT<T>(x + dx, y + dy); }\r\n    SizeT<T> Size() const { return SizeT<T>(dx, dy); }\r\n\r\n#ifdef _WIN32\r\n    RECT ToRECT() const {\r\n        RectT<int> rectI(this->ToInt());\r\n        RECT result = { rectI.x, rectI.y, rectI.x + rectI.dx, rectI.y + rectI.dy };\r\n        return result;\r\n    }\r\n    static RectT FromRECT(const RECT& rect) {\r\n        return FromXY(rect.left, rect.top, rect.right, rect.bottom);\r\n    }\r\n\r\n#if 1 //def GDIPVER, note: GDIPVER not defined in mingw?\r\n    Gdiplus::Rect ToGdipRect() const {\r\n        RectT<int> rect(this->ToInt());\r\n        return Gdiplus::Rect(rect.x, rect.y, rect.dx, rect.dy);\r\n    }\r\n    Gdiplus::RectF ToGdipRectF() const {\r\n        RectT<float> rectF(this->Convert<float>());\r\n        return Gdiplus::RectF(rectF.x, rectF.y, rectF.dx, rectF.dy);\r\n    }\r\n#endif\r\n#endif\r\n\r\n    bool operator==(const RectT<T>& other) const {\r\n        return this->x == other.x && this->y == other.y &&\r\n               this->dx == other.dx && this->dy == other.dy;\r\n    }\r\n    bool operator!=(const RectT<T>& other) const {\r\n        return !this->operator==(other);\r\n    }\r\n};\r\n\r\n} // namespace geomutil\r\n\r\ntypedef geomutil::SizeT<int> SizeI;\r\ntypedef geomutil::SizeT<double> SizeD;\r\n\r\ntypedef geomutil::PointT<int> PointI;\r\ntypedef geomutil::PointT<double> PointD;\r\n\r\ntypedef geomutil::RectT<int> RectI;\r\ntypedef geomutil::RectT<double> RectD;\r\n\r\n#ifdef _WIN32\r\n\r\nclass ClientRect : public RectI {\r\npublic:\r\n    explicit ClientRect(HWND hwnd) {\r\n        RECT rc;\r\n        if (GetClientRect(hwnd, &rc)) {\r\n            x = rc.left; dx = rc.right - rc.left;\r\n            y = rc.top; dy = rc.bottom - rc.top;\r\n        }\r\n    }\r\n};\r\n\r\nclass WindowRect : public RectI {\r\npublic:\r\n    explicit WindowRect(HWND hwnd) {\r\n        RECT rc;\r\n        if (GetWindowRect(hwnd, &rc)) {\r\n            x = rc.left; dx = rc.right - rc.left;\r\n            y = rc.top; dy = rc.bottom - rc.top;\r\n        }\r\n    }\r\n};\r\n\r\ninline RectI MapRectToWindow(RectI rect, HWND hwndFrom, HWND hwndTo)\r\n{\r\n    RECT rc = rect.ToRECT();\r\n    MapWindowPoints(hwndFrom, hwndTo, (LPPOINT)&rc, 2);\r\n    return RectI::FromRECT(rc);\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "src/utils/HtmlParseTest00.html",
    "content": "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">\r\n<HTML>\r\n<HEAD>\r\n<meta name=\"GENERATOR\" content=\"Microsoft&reg; HTML Help Workshop 4.1\">\r\n<!-- Sitemap 1.0 -->\r\n</HEAD>\r\n<BODY>\r\n   <OBJECT type=\"text/site properties\">\r\n     <param name=\"Window Styles\" value=\"0x800225\">\r\n     <param name=\"comment\" value=\"title:Online Help\">\r\n     <param name=\"comment\" value=\"base:index.htm\">\r\n   </OBJECT>\r\n   <UL>\r\n      <LI><OBJECT type=\"text/sitemap\">\r\n            <param name=\"Name\" value=\"Main Page\">\r\n            <param name=\"Local\" value=\"0789729717_main.html\">\r\n            <param name=\"ImageNumber\" value=\"12\">\r\n          </OBJECT>\r\n      <LI><OBJECT type=\"text/sitemap\">\r\n            <param name=\"Name\" value=\"Table of content\">\r\n            <param name=\"Local\" value=\"0789729717_toc.html\">\r\n            <param name=\"ImageNumber\" value=\"22\">\r\n          </OBJECT>\r\n      <LI><OBJECT type=\"text/sitemap\">\r\n            <param name=\"Name\" value=\"Copyright\">\r\n            <param name=\"Local\" value=\"0789729717_copyrightpg.html\">\r\n            <param name=\"ImageNumber\" value=\"17\">\r\n          </OBJECT>\r\n      <LI><OBJECT type=\"text/sitemap\">\r\n            <param name=\"Name\" value=\"About the Author\">\r\n            <param name=\"Local\" value=\"0789729717_pref01.html\">\r\n            <param name=\"ImageNumber\" value=\"27\">\r\n          </OBJECT>\r\n      <LI><OBJECT type=\"text/sitemap\">\r\n            <param name=\"Name\" value=\"Acknowledgments\">\r\n            <param name=\"Local\" value=\"0789729717_pref02.html\">\r\n            <param name=\"ImageNumber\" value=\"27\">\r\n          </OBJECT>\r\n      <LI><OBJECT type=\"text/sitemap\">\r\n            <param name=\"Name\" value=\"We Want to Hear from You!\">\r\n            <param name=\"Local\" value=\"0789729717_pref03.html\">\r\n            <param name=\"ImageNumber\" value=\"17\">\r\n          </OBJECT>\r\n      <LI><OBJECT type=\"text/sitemap\">\r\n            <param name=\"Name\" value=\"How to Use This Book\">\r\n            <param name=\"Local\" value=\"0789729717_pref04.html\">\r\n            <param name=\"ImageNumber\" value=\"17\">\r\n          </OBJECT>\r\n      <LI><OBJECT type=\"text/sitemap\">\r\n            <param name=\"Name\" value=\"Introduction\">\r\n            <param name=\"Local\" value=\"0789729717_pref05.html\">\r\n          </OBJECT>\r\n      <UL>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"I, Robot\">\r\n               <param name=\"Local\" value=\"0789729717_pref05lev1sec1.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Robots: Fantasy Versus Reality\">\r\n               <param name=\"Local\" value=\"0789729717_pref05lev1sec2.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Robots: Today and Tomorrow\">\r\n               <param name=\"Local\" value=\"0789729717_pref05lev1sec3.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n      </UL>\r\n      <LI><OBJECT type=\"text/sitemap\">\r\n            <param name=\"Name\" value=\"Part I: Robot.edu\">\r\n            <param name=\"Local\" value=\"0789729717_part01.html\">\r\n          </OBJECT>\r\n      <UL>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Chapter 1. What's in a Name?\">\r\n               <param name=\"Local\" value=\"0789729717_ch01.html\">\r\n             </OBJECT>\r\n         <UL>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"A Bot by Any Other Name...\">\r\n                  <param name=\"Local\" value=\"0789729717_ch01lev1sec1.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Bots in Brief\">\r\n                  <param name=\"Local\" value=\"0789729717_ch01lev1sec2.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Great Moments in Robot History\">\r\n                  <param name=\"Local\" value=\"0789729717_ch01lev1sec3.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n         </UL>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Chapter 2. Robot Evolution\">\r\n               <param name=\"Local\" value=\"0789729717_ch02.html\">\r\n             </OBJECT>\r\n         <UL>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Don't Call Me Chief!\">\r\n                  <param name=\"Local\" value=\"0789729717_ch02lev1sec1.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Humanoid Robots\">\r\n                  <param name=\"Local\" value=\"0789729717_ch02lev1sec2.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Robotic Presence\">\r\n                  <param name=\"Local\" value=\"0789729717_ch02lev1sec3.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Biomimicry\">\r\n                  <param name=\"Local\" value=\"0789729717_ch02lev1sec4.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Robot Sports\">\r\n                  <param name=\"Local\" value=\"0789729717_ch02lev1sec5.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Robotic Performance Art\">\r\n                  <param name=\"Local\" value=\"0789729717_ch02lev1sec6.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Robot Warriors\">\r\n                  <param name=\"Local\" value=\"0789729717_ch02lev1sec7.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Domestic Robots\">\r\n                  <param name=\"Local\" value=\"0789729717_ch02lev1sec8.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Robotic Evolution Through Open Networking\">\r\n                  <param name=\"Local\" value=\"0789729717_ch02lev1sec9.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n         </UL>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Chapter 3. Robot's Rules of Order\">\r\n               <param name=\"Local\" value=\"0789729717_ch03.html\">\r\n             </OBJECT>\r\n         <UL>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Bots in Legal Briefs\">\r\n                  <param name=\"Local\" value=\"0789729717_ch03lev1sec1.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"The Rules for Roboticists\">\r\n                  <param name=\"Local\" value=\"0789729717_ch03lev1sec2.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n         </UL>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Chapter 4. Robot Anatomy Class\">\r\n               <param name=\"Local\" value=\"0789729717_ch04.html\">\r\n             </OBJECT>\r\n         <UL>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Flesh and Steel\">\r\n                  <param name=\"Local\" value=\"0789729717_ch04lev1sec1.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Robot Body Types\">\r\n                  <param name=\"Local\" value=\"0789729717_ch04lev1sec2.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Robots: The Exploded View\">\r\n                  <param name=\"Local\" value=\"0789729717_ch04lev1sec3.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"The Frame\">\r\n                  <param name=\"Local\" value=\"0789729717_ch04lev1sec4.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Actuators\">\r\n                  <param name=\"Local\" value=\"0789729717_ch04lev1sec5.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Drive Train\">\r\n                  <param name=\"Local\" value=\"0789729717_ch04lev1sec6.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Locomotion\">\r\n                  <param name=\"Local\" value=\"0789729717_ch04lev1sec7.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Power Systems\">\r\n                  <param name=\"Local\" value=\"0789729717_ch04lev1sec8.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Manipulators/End Effectors (Optional)\">\r\n                  <param name=\"Local\" value=\"0789729717_ch04lev1sec9.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Sensors\">\r\n                  <param name=\"Local\" value=\"0789729717_ch04lev1sec10.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Controllers\">\r\n                  <param name=\"Local\" value=\"0789729717_ch04lev1sec11.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Communication (Optional)\">\r\n                  <param name=\"Local\" value=\"0789729717_ch04lev1sec12.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Outer Shell (Optional)\">\r\n                  <param name=\"Local\" value=\"0789729717_ch04lev1sec13.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Robot Soul (Software)\">\r\n                  <param name=\"Local\" value=\"0789729717_ch04lev1sec14.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"A Word About Spaghetti\">\r\n                  <param name=\"Local\" value=\"0789729717_ch04lev1sec15.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Robot Pop Quiz\">\r\n                  <param name=\"Local\" value=\"0789729717_ch04lev1sec16.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n         </UL>\r\n      </UL>\r\n      <LI><OBJECT type=\"text/sitemap\">\r\n            <param name=\"Name\" value=\"Part II: Gettin' Dirty with It\">\r\n            <param name=\"Local\" value=\"0789729717_part02.html\">\r\n          </OBJECT>\r\n      <UL>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Chapter 5. The Right Tools for the Job\">\r\n               <param name=\"Local\" value=\"0789729717_ch05.html\">\r\n             </OBJECT>\r\n         <UL>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"The Basic Bot Builder's Toolbox\">\r\n                  <param name=\"Local\" value=\"0789729717_ch05lev1sec1.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Thumbnail Guide to Digital Multimeters\">\r\n                  <param name=\"Local\" value=\"0789729717_ch05lev1sec2.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Your Robot Workshop\">\r\n                  <param name=\"Local\" value=\"0789729717_ch05lev1sec3.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Thumbnail Guide to Soldering\">\r\n                  <param name=\"Local\" value=\"0789729717_ch05lev1sec4.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Building a Ventilation System\">\r\n                  <param name=\"Local\" value=\"0789729717_ch05lev1sec5.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Safety First\">\r\n                  <param name=\"Local\" value=\"0789729717_ch05lev1sec6.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n         </UL>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Chapter 6. Acquiring Mad Robot Skills\">\r\n               <param name=\"Local\" value=\"0789729717_ch06.html\">\r\n             </OBJECT>\r\n         <UL>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Killer Kits\">\r\n                  <param name=\"Local\" value=\"0789729717_ch06lev1sec1.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Robot Building Systems\">\r\n                  <param name=\"Local\" value=\"0789729717_ch06lev1sec2.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Out-of-the-Box Bots\">\r\n                  <param name=\"Local\" value=\"0789729717_ch06lev1sec3.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Retro-Robotics\">\r\n                  <param name=\"Local\" value=\"0789729717_ch06lev1sec4.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Other Cool 'Antique' Robots\">\r\n                  <param name=\"Local\" value=\"0789729717_ch06lev1sec5.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Thumbnail Guide to Electronics\">\r\n                  <param name=\"Local\" value=\"0789729717_ch06lev1sec6.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n         </UL>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Chapter 7. Project 1: Coat Hanger Walker\">\r\n               <param name=\"Local\" value=\"0789729717_ch07.html\">\r\n             </OBJECT>\r\n         <UL>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Gathering the Parts\">\r\n                  <param name=\"Local\" value=\"0789729717_ch07lev1sec1.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Freeforming the Bicore Control Circuit\">\r\n                  <param name=\"Local\" value=\"0789729717_ch07lev1sec2.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Thumbnail Guide to Breadboards\">\r\n                  <param name=\"Local\" value=\"0789729717_ch07lev1sec3.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Building the Walker Body\">\r\n                  <param name=\"Local\" value=\"0789729717_ch07lev1sec4.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"The Power Plant\">\r\n                  <param name=\"Local\" value=\"0789729717_ch07lev1sec5.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Final Assembly\">\r\n                  <param name=\"Local\" value=\"0789729717_ch07lev1sec6.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Further Experiments\">\r\n                  <param name=\"Local\" value=\"0789729717_ch07lev1sec7.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n         </UL>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Chapter 8. Project 2: Mousey the Junkbot\">\r\n               <param name=\"Local\" value=\"0789729717_ch08.html\">\r\n             </OBJECT>\r\n         <UL>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"The Fine Art of Making 'Frankenmice'\">\r\n                  <param name=\"Local\" value=\"0789729717_ch08lev1sec1.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Gathering the Parts\">\r\n                  <param name=\"Local\" value=\"0789729717_ch08lev1sec2.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Building the Body\">\r\n                  <param name=\"Local\" value=\"0789729717_ch08lev1sec3.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Understanding Mousey's Brain\">\r\n                  <param name=\"Local\" value=\"0789729717_ch08lev1sec4.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"It's a Slightly Anxious, Light-Seeking Robot!\">\r\n                  <param name=\"Local\" value=\"0789729717_ch08lev1sec5.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Further Experiments\">\r\n                  <param name=\"Local\" value=\"0789729717_ch08lev1sec6.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n         </UL>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Chapter 9. Project 3: Building a DiscRover\">\r\n               <param name=\"Local\" value=\"0789729717_ch09.html\">\r\n             </OBJECT>\r\n         <UL>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"AOL Just Got a Whole Lot Smarter\">\r\n                  <param name=\"Local\" value=\"0789729717_ch09lev1sec1.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Gathering the Parts\">\r\n                  <param name=\"Local\" value=\"0789729717_ch09lev1sec2.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"The Brains Behind the Bot\">\r\n                  <param name=\"Local\" value=\"0789729717_ch09lev1sec3.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Thumbnail Guide to Microcontrollers\">\r\n                  <param name=\"Local\" value=\"0789729717_ch09lev1sec4.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Trash Recycling Through Bot Building\">\r\n                  <param name=\"Local\" value=\"0789729717_ch09lev1sec5.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Programming Your DiscRover\">\r\n                  <param name=\"Local\" value=\"0789729717_ch09lev1sec6.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Load 'n Go\">\r\n                  <param name=\"Local\" value=\"0789729717_ch09lev1sec7.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Troubleshooting the DiscRover\">\r\n                  <param name=\"Local\" value=\"0789729717_ch09lev1sec8.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Further Experimentation\">\r\n                  <param name=\"Local\" value=\"0789729717_ch09lev1sec9.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n         </UL>\r\n      </UL>\r\n      <LI><OBJECT type=\"text/sitemap\">\r\n            <param name=\"Name\" value=\"Part III: Resources\">\r\n            <param name=\"Local\" value=\"0789729717_part03.html\">\r\n          </OBJECT>\r\n      <UL>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Chapter 10. Robot Hardware and Software\">\r\n               <param name=\"Local\" value=\"0789729717_ch10.html\">\r\n             </OBJECT>\r\n         <UL>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Sourcing the Right Stuff\">\r\n                  <param name=\"Local\" value=\"0789729717_ch10lev1sec1.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Robot Kits and Bot-Specific Parts\">\r\n                  <param name=\"Local\" value=\"0789729717_ch10lev1sec2.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Building Materials and Supplies\">\r\n                  <param name=\"Local\" value=\"0789729717_ch10lev1sec3.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Motors and Drive Train\">\r\n                  <param name=\"Local\" value=\"0789729717_ch10lev1sec4.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Power Systems\">\r\n                  <param name=\"Local\" value=\"0789729717_ch10lev1sec5.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Electronics\">\r\n                  <param name=\"Local\" value=\"0789729717_ch10lev1sec6.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Remote Control (R/C) Equipment\">\r\n                  <param name=\"Local\" value=\"0789729717_ch10lev1sec7.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Microcontrollers and Control Software\">\r\n                  <param name=\"Local\" value=\"0789729717_ch10lev1sec8.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Tools\">\r\n                  <param name=\"Local\" value=\"0789729717_ch10lev1sec9.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Hobby Stores\">\r\n                  <param name=\"Local\" value=\"0789729717_ch10lev1sec10.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Surplus\">\r\n                  <param name=\"Local\" value=\"0789729717_ch10lev1sec11.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n         </UL>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Chapter 11. Robot Books, Magazines, and Videos\">\r\n               <param name=\"Local\" value=\"0789729717_ch11.html\">\r\n             </OBJECT>\r\n         <UL>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Attention Bot-Obsessed Bookworms!\">\r\n                  <param name=\"Local\" value=\"0789729717_ch11lev1sec1.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Books (General, Theoretical)\">\r\n                  <param name=\"Local\" value=\"0789729717_ch11lev1sec2.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Books (Bot Building)\">\r\n                  <param name=\"Local\" value=\"0789729717_ch11lev1sec3.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Books (Electronics)\">\r\n                  <param name=\"Local\" value=\"0789729717_ch11lev1sec4.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Magazines\">\r\n                  <param name=\"Local\" value=\"0789729717_ch11lev1sec5.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Videos\">\r\n                  <param name=\"Local\" value=\"0789729717_ch11lev1sec6.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n         </UL>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Chapter 12. Robots on the Web\">\r\n               <param name=\"Local\" value=\"0789729717_ch12.html\">\r\n             </OBJECT>\r\n         <UL>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Portals\">\r\n                  <param name=\"Local\" value=\"0789729717_ch12lev1sec1.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Robot-Specific Sites\">\r\n                  <param name=\"Local\" value=\"0789729717_ch12lev1sec2.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Robot Communities\">\r\n                  <param name=\"Local\" value=\"0789729717_ch12lev1sec3.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Robot Research Centers\">\r\n                  <param name=\"Local\" value=\"0789729717_ch12lev1sec4.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n            <LI><OBJECT type=\"text/sitemap\">\r\n                  <param name=\"Name\" value=\"Useful Bot-Building References\">\r\n                  <param name=\"Local\" value=\"0789729717_ch12lev1sec5.html\">\r\n                  <param name=\"ImageNumber\" value=\"11\">\r\n                </OBJECT>\r\n         </UL>\r\n      </UL>\r\n      <LI><OBJECT type=\"text/sitemap\">\r\n            <param name=\"Name\" value=\"Glossary\">\r\n            <param name=\"Local\" value=\"0789729717_gloss01.html\">\r\n            <param name=\"ImageNumber\" value=\"2\">\r\n          </OBJECT>\r\n      <LI><OBJECT type=\"text/sitemap\">\r\n            <param name=\"Name\" value=\"Index\">\r\n            <param name=\"Local\" value=\"0789729717_index_.html\">\r\n          </OBJECT>\r\n      <UL>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index SYMBOL\">\r\n               <param name=\"Local\" value=\"0789729717_index_SYMBOL.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index A\">\r\n               <param name=\"Local\" value=\"0789729717_index_A.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index B\">\r\n               <param name=\"Local\" value=\"0789729717_index_B.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index C\">\r\n               <param name=\"Local\" value=\"0789729717_index_C.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index D\">\r\n               <param name=\"Local\" value=\"0789729717_index_D.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index E\">\r\n               <param name=\"Local\" value=\"0789729717_index_E.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index F\">\r\n               <param name=\"Local\" value=\"0789729717_index_F.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index G\">\r\n               <param name=\"Local\" value=\"0789729717_index_G.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index H\">\r\n               <param name=\"Local\" value=\"0789729717_index_H.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index I\">\r\n               <param name=\"Local\" value=\"0789729717_index_I.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index J\">\r\n               <param name=\"Local\" value=\"0789729717_index_J.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index K\">\r\n               <param name=\"Local\" value=\"0789729717_index_K.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index L\">\r\n               <param name=\"Local\" value=\"0789729717_index_L.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index M\">\r\n               <param name=\"Local\" value=\"0789729717_index_M.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index N\">\r\n               <param name=\"Local\" value=\"0789729717_index_N.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index O\">\r\n               <param name=\"Local\" value=\"0789729717_index_O.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index P\">\r\n               <param name=\"Local\" value=\"0789729717_index_P.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index R\">\r\n               <param name=\"Local\" value=\"0789729717_index_R.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index S\">\r\n               <param name=\"Local\" value=\"0789729717_index_S.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index T\">\r\n               <param name=\"Local\" value=\"0789729717_index_T.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index U\">\r\n               <param name=\"Local\" value=\"0789729717_index_U.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index V\">\r\n               <param name=\"Local\" value=\"0789729717_index_V.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index W\">\r\n               <param name=\"Local\" value=\"0789729717_index_W.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index X\">\r\n               <param name=\"Local\" value=\"0789729717_index_X.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index Y\">\r\n               <param name=\"Local\" value=\"0789729717_index_Y.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n         <LI><OBJECT type=\"text/sitemap\">\r\n               <param name=\"Name\" value=\"Index Z\">\r\n               <param name=\"Local\" value=\"0789729717_index_Z.html\">\r\n               <param name=\"ImageNumber\" value=\"11\">\r\n             </OBJECT>\r\n      </UL>\r\n   </UL>\r\n</BODY>\r\n</HTML>\r\n"
  },
  {
    "path": "src/utils/HtmlParserLookup.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// This file is auto-generated by gen_htmlparserlookup.py\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n\r\n#define CS1(c1)             (c1)\r\n#define CS2(c1, c2)         (CS1(c1) | (c2 << 8))\r\n#define CS3(c1, c2, c3)     (CS2(c1, c2) | (c3 << 16))\r\n#define CS4(c1, c2, c3, c4) (CS3(c1, c2, c3) | (c4 << 24))\r\n\r\n#define STR1(s) ((s)[0])\r\n#define STR2(s) (STR1(s) | ((s)[1] << 8))\r\n#define STR3(s) (STR2(s) | ((s)[2] << 16))\r\n#define STR4(s) (STR3(s) | ((s)[3] << 24))\r\n\r\n#define lower(c) ((c) < 'A' || (c) > 'Z' ? (c) : (c) - 'A' + 'a')\r\n\r\n#define STR1i(s) (lower((s)[0]))\r\n#define STR2i(s) (STR1i(s) | (lower((s)[1]) << 8))\r\n#define STR3i(s) (STR2i(s) | (lower((s)[2]) << 16))\r\n#define STR4i(s) (STR3i(s) | (lower((s)[3]) << 24))\r\n\r\nHtmlTag FindHtmlTag(const char *name, size_t len)\r\n{\r\n    uint32_t key = 0 == len ? 0 : 1 == len ? STR1i(name) :\r\n                   2 == len ? STR2i(name) : 3 == len ? STR3i(name) : STR4i(name);\r\n    switch (key) {\r\n    case CS1('a'): return Tag_A;\r\n    case CS4('a','b','b','r'):\r\n        if (4 == len) return Tag_Abbr;\r\n        break;\r\n    case CS4('a','c','r','o'):\r\n        if (7 == len && CS3('n','y','m') == STR3i(name + 4)) return Tag_Acronym;\r\n        break;\r\n    case CS4('a','r','e','a'):\r\n        if (4 == len) return Tag_Area;\r\n        break;\r\n    case CS4('a','u','d','i'):\r\n        if (5 == len && CS1('o') == STR1i(name + 4)) return Tag_Audio;\r\n        break;\r\n    case CS1('b'): return Tag_B;\r\n    case CS4('b','a','s','e'):\r\n        if (4 == len) return Tag_Base;\r\n        if (8 == len && CS4('f','o','n','t') == STR4i(name + 4)) return Tag_Basefont;\r\n        break;\r\n    case CS4('b','l','o','c'):\r\n        if (10 == len && str::EqNI(name + 4, \"kquote\", 6)) return Tag_Blockquote;\r\n        break;\r\n    case CS4('b','o','d','y'):\r\n        if (4 == len) return Tag_Body;\r\n        break;\r\n    case CS2('b','r'): return Tag_Br;\r\n    case CS4('c','e','n','t'):\r\n        if (6 == len && CS2('e','r') == STR2i(name + 4)) return Tag_Center;\r\n        break;\r\n    case CS4('c','o','d','e'):\r\n        if (4 == len) return Tag_Code;\r\n        break;\r\n    case CS3('c','o','l'): return Tag_Col;\r\n    case CS2('d','d'): return Tag_Dd;\r\n    case CS3('d','i','v'): return Tag_Div;\r\n    case CS2('d','l'): return Tag_Dl;\r\n    case CS2('d','t'): return Tag_Dt;\r\n    case CS2('e','m'): return Tag_Em;\r\n    case CS4('f','o','n','t'):\r\n        if (4 == len) return Tag_Font;\r\n        break;\r\n    case CS4('f','r','a','m'):\r\n        if (5 == len && CS1('e') == STR1i(name + 4)) return Tag_Frame;\r\n        break;\r\n    case CS2('h','1'): return Tag_H1;\r\n    case CS2('h','2'): return Tag_H2;\r\n    case CS2('h','3'): return Tag_H3;\r\n    case CS2('h','4'): return Tag_H4;\r\n    case CS2('h','5'): return Tag_H5;\r\n    case CS2('h','6'): return Tag_H6;\r\n    case CS4('h','e','a','d'):\r\n        if (4 == len) return Tag_Head;\r\n        break;\r\n    case CS2('h','r'): return Tag_Hr;\r\n    case CS4('h','t','m','l'):\r\n        if (4 == len) return Tag_Html;\r\n        break;\r\n    case CS1('i'): return Tag_I;\r\n    case CS4('i','m','a','g'):\r\n        if (5 == len && CS1('e') == STR1i(name + 4)) return Tag_Image;\r\n        break;\r\n    case CS3('i','m','g'): return Tag_Img;\r\n    case CS4('i','n','p','u'):\r\n        if (5 == len && CS1('t') == STR1i(name + 4)) return Tag_Input;\r\n        break;\r\n    case CS2('l','h'): return Tag_Lh;\r\n    case CS2('l','i'): return Tag_Li;\r\n    case CS4('l','i','n','k'):\r\n        if (4 == len) return Tag_Link;\r\n        break;\r\n    case CS4('m','b','p',':'):\r\n        if (13 == len && str::EqNI(name + 4, \"pagebreak\", 9)) return Tag_Mbp_Pagebreak;\r\n        break;\r\n    case CS4('m','e','t','a'):\r\n        if (4 == len) return Tag_Meta;\r\n        break;\r\n    case CS3('n','a','v'): return Tag_Nav;\r\n    case CS4('o','b','j','e'):\r\n        if (6 == len && CS2('c','t') == STR2i(name + 4)) return Tag_Object;\r\n        break;\r\n    case CS2('o','l'): return Tag_Ol;\r\n    case CS1('p'): return Tag_P;\r\n    case CS4('p','a','g','e'):\r\n        if (9 == len && str::EqNI(name + 4, \"break\", 5)) return Tag_Pagebreak;\r\n        break;\r\n    case CS4('p','a','r','a'):\r\n        if (5 == len && CS1('m') == STR1i(name + 4)) return Tag_Param;\r\n        break;\r\n    case CS3('p','r','e'): return Tag_Pre;\r\n    case CS1('s'): return Tag_S;\r\n    case CS4('s','c','r','i'):\r\n        if (6 == len && CS2('p','t') == STR2i(name + 4)) return Tag_Script;\r\n        break;\r\n    case CS4('s','e','c','t'):\r\n        if (7 == len && CS3('i','o','n') == STR3i(name + 4)) return Tag_Section;\r\n        break;\r\n    case CS4('s','m','a','l'):\r\n        if (5 == len && CS1('l') == STR1i(name + 4)) return Tag_Small;\r\n        break;\r\n    case CS4('s','p','a','n'):\r\n        if (4 == len) return Tag_Span;\r\n        break;\r\n    case CS4('s','t','r','i'):\r\n        if (6 == len && CS2('k','e') == STR2i(name + 4)) return Tag_Strike;\r\n        break;\r\n    case CS4('s','t','r','o'):\r\n        if (6 == len && CS2('n','g') == STR2i(name + 4)) return Tag_Strong;\r\n        break;\r\n    case CS4('s','t','y','l'):\r\n        if (5 == len && CS1('e') == STR1i(name + 4)) return Tag_Style;\r\n        break;\r\n    case CS3('s','u','b'): return Tag_Sub;\r\n    case CS4('s','u','b','t'):\r\n        if (8 == len && CS4('i','t','l','e') == STR4i(name + 4)) return Tag_Subtitle;\r\n        break;\r\n    case CS3('s','u','p'): return Tag_Sup;\r\n    case CS3('s','v','g'): return Tag_Svg;\r\n    case CS4('s','v','g',':'):\r\n        if (9 == len && str::EqNI(name + 4, \"image\", 5)) return Tag_Svg_Image;\r\n        break;\r\n    case CS4('t','a','b','l'):\r\n        if (5 == len && CS1('e') == STR1i(name + 4)) return Tag_Table;\r\n        break;\r\n    case CS2('t','d'): return Tag_Td;\r\n    case CS2('t','h'): return Tag_Th;\r\n    case CS4('t','i','t','l'):\r\n        if (5 == len && CS1('e') == STR1i(name + 4)) return Tag_Title;\r\n        break;\r\n    case CS2('t','r'): return Tag_Tr;\r\n    case CS2('t','t'): return Tag_Tt;\r\n    case CS1('u'): return Tag_U;\r\n    case CS2('u','l'): return Tag_Ul;\r\n    case CS4('v','i','d','e'):\r\n        if (5 == len && CS1('o') == STR1i(name + 4)) return Tag_Video;\r\n        break;\r\n    }\r\n    return Tag_NotFound;\r\n}\r\n\r\nbool IsTagSelfClosing(HtmlTag item)\r\n{\r\n    switch (item) {\r\n    case Tag_Area: case Tag_Base: case Tag_Basefont: case Tag_Br:\r\n    case Tag_Col: case Tag_Frame: case Tag_Hr: case Tag_Img:\r\n    case Tag_Input: case Tag_Link: case Tag_Mbp_Pagebreak: case Tag_Meta:\r\n    case Tag_Pagebreak: case Tag_Param:\r\n        return true;\r\n    default:\r\n        return false;\r\n    }\r\n}\r\n\r\nbool IsInlineTag(HtmlTag item)\r\n{\r\n    switch (item) {\r\n    case Tag_A: case Tag_Abbr: case Tag_Acronym: case Tag_Audio:\r\n    case Tag_B: case Tag_Code: case Tag_Em: case Tag_Font:\r\n    case Tag_I: case Tag_S: case Tag_Small: case Tag_Span:\r\n    case Tag_Strike: case Tag_Strong: case Tag_Sub: case Tag_Sup:\r\n    case Tag_Tt: case Tag_U: case Tag_Video:\r\n        return true;\r\n    default:\r\n        return false;\r\n    }\r\n}\r\n\r\nAlignAttr FindAlignAttr(const char *name, size_t len)\r\n{\r\n    uint32_t key = 0 == len ? 0 : 1 == len ? STR1i(name) :\r\n                   2 == len ? STR2i(name) : 3 == len ? STR3i(name) : STR4i(name);\r\n    switch (key) {\r\n    case CS4('c','e','n','t'):\r\n        if (6 == len && CS2('e','r') == STR2i(name + 4)) return Align_Center;\r\n        break;\r\n    case CS4('j','u','s','t'):\r\n        if (7 == len && CS3('i','f','y') == STR3i(name + 4)) return Align_Justify;\r\n        break;\r\n    case CS4('l','e','f','t'):\r\n        if (4 == len) return Align_Left;\r\n        break;\r\n    case CS4('r','i','g','h'):\r\n        if (5 == len && CS1('t') == STR1i(name + 4)) return Align_Right;\r\n        break;\r\n    }\r\n    return Align_NotFound;\r\n}\r\n\r\n// map of entity names to their Unicode runes, cf.\r\n// http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references\r\n// and http://www.w3.org/TR/MathML2/bycodes.html\r\n\r\nuint32_t FindHtmlEntityRune(const char *name, size_t len)\r\n{\r\n    uint32_t key = 0 == len ? 0 : 1 == len ? STR1(name) :\r\n                   2 == len ? STR2(name) : 3 == len ? STR3(name) : STR4(name);\r\n    switch (key) {\r\n    case CS4('A','E','l','i'):\r\n        if (5 == len && CS1('g') == STR1(name + 4)) return 198;\r\n        break;\r\n    case CS4('A','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 193;\r\n        break;\r\n    case CS4('A','b','r','e'):\r\n        if (6 == len && CS2('v','e') == STR2(name + 4)) return 258;\r\n        break;\r\n    case CS4('A','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 194;\r\n        break;\r\n    case CS4('A','g','r','a'):\r\n        if (6 == len && CS2('v','e') == STR2(name + 4)) return 192;\r\n        break;\r\n    case CS4('A','l','p','h'):\r\n        if (5 == len && CS1('a') == STR1(name + 4)) return 913;\r\n        break;\r\n    case CS4('A','m','a','c'):\r\n        if (5 == len && CS1('r') == STR1(name + 4)) return 256;\r\n        break;\r\n    case CS4('A','o','g','o'):\r\n        if (5 == len && CS1('n') == STR1(name + 4)) return 260;\r\n        break;\r\n    case CS4('A','r','i','n'):\r\n        if (5 == len && CS1('g') == STR1(name + 4)) return 197;\r\n        break;\r\n    case CS4('A','t','i','l'):\r\n        if (6 == len && CS2('d','e') == STR2(name + 4)) return 195;\r\n        break;\r\n    case CS4('A','u','m','l'):\r\n        if (4 == len) return 196;\r\n        break;\r\n    case CS4('B','e','t','a'):\r\n        if (4 == len) return 914;\r\n        break;\r\n    case CS4('B','r','e','v'):\r\n        if (5 == len && CS1('e') == STR1(name + 4)) return 728;\r\n        break;\r\n    case CS4('C','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 262;\r\n        break;\r\n    case CS4('C','c','a','r'):\r\n        if (6 == len && CS2('o','n') == STR2(name + 4)) return 268;\r\n        break;\r\n    case CS4('C','c','e','d'):\r\n        if (6 == len && CS2('i','l') == STR2(name + 4)) return 199;\r\n        break;\r\n    case CS4('C','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 264;\r\n        break;\r\n    case CS4('C','d','o','t'):\r\n        if (4 == len) return 266;\r\n        break;\r\n    case CS4('C','e','d','i'):\r\n        if (7 == len && CS3('l','l','a') == STR3(name + 4)) return 184;\r\n        break;\r\n    case CS3('C','h','i'): return 935;\r\n    case CS4('D','a','g','g'):\r\n        if (6 == len && CS2('e','r') == STR2(name + 4)) return 8225;\r\n        break;\r\n    case CS4('D','c','a','r'):\r\n        if (6 == len && CS2('o','n') == STR2(name + 4)) return 270;\r\n        break;\r\n    case CS4('D','e','l','t'):\r\n        if (5 == len && CS1('a') == STR1(name + 4)) return 916;\r\n        break;\r\n    case CS4('D','i','a','c'):\r\n        if (14 == len && str::EqN(name + 4, \"riticalDot\", 10)) return 729;\r\n        if (22 == len && str::EqN(name + 4, \"riticalDoubleAcute\", 18)) return 733;\r\n        if (16 == len && str::EqN(name + 4, \"riticalTilde\", 12)) return 732;\r\n        break;\r\n    case CS4('D','o','u','b'):\r\n        if (9 == len && str::EqN(name + 4, \"leDot\", 5)) return 168;\r\n        break;\r\n    case CS4('D','o','w','n'):\r\n        if (9 == len && str::EqN(name + 4, \"Breve\", 5)) return 785;\r\n        break;\r\n    case CS4('D','s','t','r'):\r\n        if (6 == len && CS2('o','k') == STR2(name + 4)) return 272;\r\n        break;\r\n    case CS3('E','N','G'): return 330;\r\n    case CS3('E','T','H'): return 208;\r\n    case CS4('E','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 201;\r\n        break;\r\n    case CS4('E','c','a','r'):\r\n        if (6 == len && CS2('o','n') == STR2(name + 4)) return 282;\r\n        break;\r\n    case CS4('E','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 202;\r\n        break;\r\n    case CS4('E','d','o','t'):\r\n        if (4 == len) return 278;\r\n        break;\r\n    case CS4('E','g','r','a'):\r\n        if (6 == len && CS2('v','e') == STR2(name + 4)) return 200;\r\n        break;\r\n    case CS4('E','m','a','c'):\r\n        if (5 == len && CS1('r') == STR1(name + 4)) return 274;\r\n        break;\r\n    case CS4('E','o','g','o'):\r\n        if (5 == len && CS1('n') == STR1(name + 4)) return 280;\r\n        break;\r\n    case CS4('E','p','s','i'):\r\n        if (7 == len && CS3('l','o','n') == STR3(name + 4)) return 917;\r\n        break;\r\n    case CS3('E','t','a'): return 919;\r\n    case CS4('E','u','m','l'):\r\n        if (4 == len) return 203;\r\n        break;\r\n    case CS4('G','a','m','m'):\r\n        if (5 == len && CS1('a') == STR1(name + 4)) return 915;\r\n        if (6 == len && CS2('a','d') == STR2(name + 4)) return 988;\r\n        break;\r\n    case CS4('G','b','r','e'):\r\n        if (6 == len && CS2('v','e') == STR2(name + 4)) return 286;\r\n        break;\r\n    case CS4('G','c','e','d'):\r\n        if (6 == len && CS2('i','l') == STR2(name + 4)) return 290;\r\n        break;\r\n    case CS4('G','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 284;\r\n        break;\r\n    case CS4('G','d','o','t'):\r\n        if (4 == len) return 288;\r\n        break;\r\n    case CS4('H','a','c','e'):\r\n        if (5 == len && CS1('k') == STR1(name + 4)) return 711;\r\n        break;\r\n    case CS4('H','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 292;\r\n        break;\r\n    case CS4('H','s','t','r'):\r\n        if (6 == len && CS2('o','k') == STR2(name + 4)) return 294;\r\n        break;\r\n    case CS4('I','J','l','i'):\r\n        if (5 == len && CS1('g') == STR1(name + 4)) return 306;\r\n        break;\r\n    case CS4('I','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 205;\r\n        break;\r\n    case CS4('I','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 206;\r\n        break;\r\n    case CS4('I','d','o','t'):\r\n        if (4 == len) return 304;\r\n        break;\r\n    case CS4('I','g','r','a'):\r\n        if (6 == len && CS2('v','e') == STR2(name + 4)) return 204;\r\n        break;\r\n    case CS4('I','m','a','c'):\r\n        if (5 == len && CS1('r') == STR1(name + 4)) return 298;\r\n        break;\r\n    case CS4('I','o','g','o'):\r\n        if (5 == len && CS1('n') == STR1(name + 4)) return 302;\r\n        break;\r\n    case CS4('I','o','t','a'):\r\n        if (4 == len) return 921;\r\n        break;\r\n    case CS4('I','t','i','l'):\r\n        if (6 == len && CS2('d','e') == STR2(name + 4)) return 296;\r\n        break;\r\n    case CS4('I','u','m','l'):\r\n        if (4 == len) return 207;\r\n        break;\r\n    case CS4('J','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 308;\r\n        break;\r\n    case CS4('K','a','p','p'):\r\n        if (5 == len && CS1('a') == STR1(name + 4)) return 922;\r\n        break;\r\n    case CS4('K','c','e','d'):\r\n        if (6 == len && CS2('i','l') == STR2(name + 4)) return 310;\r\n        break;\r\n    case CS4('L','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 313;\r\n        break;\r\n    case CS4('L','a','m','b'):\r\n        if (6 == len && CS2('d','a') == STR2(name + 4)) return 923;\r\n        break;\r\n    case CS4('L','c','a','r'):\r\n        if (6 == len && CS2('o','n') == STR2(name + 4)) return 317;\r\n        break;\r\n    case CS4('L','c','e','d'):\r\n        if (6 == len && CS2('i','l') == STR2(name + 4)) return 315;\r\n        break;\r\n    case CS4('L','m','i','d'):\r\n        if (6 == len && CS2('o','t') == STR2(name + 4)) return 319;\r\n        break;\r\n    case CS4('L','s','t','r'):\r\n        if (6 == len && CS2('o','k') == STR2(name + 4)) return 321;\r\n        break;\r\n    case CS2('M','u'): return 924;\r\n    case CS4('N','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 323;\r\n        break;\r\n    case CS4('N','c','a','r'):\r\n        if (6 == len && CS2('o','n') == STR2(name + 4)) return 327;\r\n        break;\r\n    case CS4('N','c','e','d'):\r\n        if (6 == len && CS2('i','l') == STR2(name + 4)) return 325;\r\n        break;\r\n    case CS4('N','t','i','l'):\r\n        if (6 == len && CS2('d','e') == STR2(name + 4)) return 209;\r\n        break;\r\n    case CS2('N','u'): return 925;\r\n    case CS4('O','E','l','i'):\r\n        if (5 == len && CS1('g') == STR1(name + 4)) return 338;\r\n        break;\r\n    case CS4('O','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 211;\r\n        break;\r\n    case CS4('O','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 212;\r\n        break;\r\n    case CS4('O','d','b','l'):\r\n        if (6 == len && CS2('a','c') == STR2(name + 4)) return 336;\r\n        break;\r\n    case CS4('O','g','r','a'):\r\n        if (6 == len && CS2('v','e') == STR2(name + 4)) return 210;\r\n        break;\r\n    case CS4('O','m','a','c'):\r\n        if (5 == len && CS1('r') == STR1(name + 4)) return 332;\r\n        break;\r\n    case CS4('O','m','e','g'):\r\n        if (5 == len && CS1('a') == STR1(name + 4)) return 937;\r\n        break;\r\n    case CS4('O','m','i','c'):\r\n        if (7 == len && CS3('r','o','n') == STR3(name + 4)) return 927;\r\n        break;\r\n    case CS4('O','s','l','a'):\r\n        if (6 == len && CS2('s','h') == STR2(name + 4)) return 216;\r\n        break;\r\n    case CS4('O','t','i','l'):\r\n        if (6 == len && CS2('d','e') == STR2(name + 4)) return 213;\r\n        break;\r\n    case CS4('O','u','m','l'):\r\n        if (4 == len) return 214;\r\n        break;\r\n    case CS4('O','v','e','r'):\r\n        if (7 == len && CS3('B','a','r') == STR3(name + 4)) return 175;\r\n        break;\r\n    case CS3('P','h','i'): return 934;\r\n    case CS2('P','i'): return 928;\r\n    case CS4('P','l','u','s'):\r\n        if (9 == len && str::EqN(name + 4, \"Minus\", 5)) return 177;\r\n        break;\r\n    case CS4('P','r','i','m'):\r\n        if (5 == len && CS1('e') == STR1(name + 4)) return 8243;\r\n        break;\r\n    case CS3('P','s','i'): return 936;\r\n    case CS4('R','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 340;\r\n        break;\r\n    case CS4('R','c','a','r'):\r\n        if (6 == len && CS2('o','n') == STR2(name + 4)) return 344;\r\n        break;\r\n    case CS4('R','c','e','d'):\r\n        if (6 == len && CS2('i','l') == STR2(name + 4)) return 342;\r\n        break;\r\n    case CS3('R','h','o'): return 929;\r\n    case CS4('S','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 346;\r\n        break;\r\n    case CS4('S','c','a','r'):\r\n        if (6 == len && CS2('o','n') == STR2(name + 4)) return 352;\r\n        break;\r\n    case CS4('S','c','e','d'):\r\n        if (6 == len && CS2('i','l') == STR2(name + 4)) return 350;\r\n        break;\r\n    case CS4('S','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 348;\r\n        break;\r\n    case CS4('S','i','g','m'):\r\n        if (5 == len && CS1('a') == STR1(name + 4)) return 931;\r\n        break;\r\n    case CS4('T','H','O','R'):\r\n        if (5 == len && CS1('N') == STR1(name + 4)) return 222;\r\n        break;\r\n    case CS3('T','a','u'): return 932;\r\n    case CS4('T','c','a','r'):\r\n        if (6 == len && CS2('o','n') == STR2(name + 4)) return 356;\r\n        break;\r\n    case CS4('T','c','e','d'):\r\n        if (6 == len && CS2('i','l') == STR2(name + 4)) return 354;\r\n        break;\r\n    case CS4('T','h','e','t'):\r\n        if (5 == len && CS1('a') == STR1(name + 4)) return 920;\r\n        break;\r\n    case CS4('T','s','t','r'):\r\n        if (6 == len && CS2('o','k') == STR2(name + 4)) return 358;\r\n        break;\r\n    case CS4('U','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 218;\r\n        break;\r\n    case CS4('U','b','r','e'):\r\n        if (6 == len && CS2('v','e') == STR2(name + 4)) return 364;\r\n        break;\r\n    case CS4('U','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 219;\r\n        break;\r\n    case CS4('U','d','b','l'):\r\n        if (6 == len && CS2('a','c') == STR2(name + 4)) return 368;\r\n        break;\r\n    case CS4('U','g','r','a'):\r\n        if (6 == len && CS2('v','e') == STR2(name + 4)) return 217;\r\n        break;\r\n    case CS4('U','m','a','c'):\r\n        if (5 == len && CS1('r') == STR1(name + 4)) return 362;\r\n        break;\r\n    case CS4('U','n','d','e'):\r\n        if (8 == len && CS4('r','B','a','r') == STR4(name + 4)) return 818;\r\n        break;\r\n    case CS4('U','o','g','o'):\r\n        if (5 == len && CS1('n') == STR1(name + 4)) return 370;\r\n        break;\r\n    case CS4('U','p','s','i'):\r\n        if (4 == len) return 978;\r\n        if (7 == len && CS3('l','o','n') == STR3(name + 4)) return 933;\r\n        break;\r\n    case CS4('U','r','i','n'):\r\n        if (5 == len && CS1('g') == STR1(name + 4)) return 366;\r\n        break;\r\n    case CS4('U','t','i','l'):\r\n        if (6 == len && CS2('d','e') == STR2(name + 4)) return 360;\r\n        break;\r\n    case CS4('U','u','m','l'):\r\n        if (4 == len) return 220;\r\n        break;\r\n    case CS4('W','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 372;\r\n        break;\r\n    case CS2('X','i'): return 926;\r\n    case CS4('Y','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 221;\r\n        break;\r\n    case CS4('Y','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 374;\r\n        break;\r\n    case CS4('Y','u','m','l'):\r\n        if (4 == len) return 376;\r\n        break;\r\n    case CS4('Z','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 377;\r\n        break;\r\n    case CS4('Z','c','a','r'):\r\n        if (6 == len && CS2('o','n') == STR2(name + 4)) return 381;\r\n        break;\r\n    case CS4('Z','d','o','t'):\r\n        if (4 == len) return 379;\r\n        break;\r\n    case CS4('Z','e','t','a'):\r\n        if (4 == len) return 918;\r\n        break;\r\n    case CS4('a','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 225;\r\n        break;\r\n    case CS4('a','b','r','e'):\r\n        if (6 == len && CS2('v','e') == STR2(name + 4)) return 259;\r\n        break;\r\n    case CS4('a','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 226;\r\n        break;\r\n    case CS4('a','c','u','t'):\r\n        if (5 == len && CS1('e') == STR1(name + 4)) return 180;\r\n        break;\r\n    case CS4('a','e','l','i'):\r\n        if (5 == len && CS1('g') == STR1(name + 4)) return 230;\r\n        break;\r\n    case CS4('a','g','r','a'):\r\n        if (6 == len && CS2('v','e') == STR2(name + 4)) return 224;\r\n        break;\r\n    case CS4('a','l','e','f'):\r\n        if (7 == len && CS3('s','y','m') == STR3(name + 4)) return 8501;\r\n        break;\r\n    case CS4('a','l','p','h'):\r\n        if (5 == len && CS1('a') == STR1(name + 4)) return 945;\r\n        break;\r\n    case CS4('a','m','a','c'):\r\n        if (5 == len && CS1('r') == STR1(name + 4)) return 257;\r\n        break;\r\n    case CS3('a','m','p'): return 38;\r\n    case CS3('a','n','d'): return 8743;\r\n    case CS3('a','n','g'): return 8736;\r\n    case CS4('a','o','g','o'):\r\n        if (5 == len && CS1('n') == STR1(name + 4)) return 261;\r\n        break;\r\n    case CS4('a','p','o','s'):\r\n        if (4 == len) return 39;\r\n        break;\r\n    case CS4('a','r','i','n'):\r\n        if (5 == len && CS1('g') == STR1(name + 4)) return 229;\r\n        break;\r\n    case CS4('a','s','y','m'):\r\n        if (5 == len && CS1('p') == STR1(name + 4)) return 8776;\r\n        break;\r\n    case CS4('a','t','i','l'):\r\n        if (6 == len && CS2('d','e') == STR2(name + 4)) return 227;\r\n        break;\r\n    case CS4('a','u','m','l'):\r\n        if (4 == len) return 228;\r\n        break;\r\n    case CS4('b','a','c','k'):\r\n        if (11 == len && str::EqN(name + 4, \"epsilon\", 7)) return 1014;\r\n        break;\r\n    case CS4('b','d','q','u'):\r\n        if (5 == len && CS1('o') == STR1(name + 4)) return 8222;\r\n        break;\r\n    case CS4('b','e','t','a'):\r\n        if (4 == len) return 946;\r\n        break;\r\n    case CS4('b','r','v','b'):\r\n        if (6 == len && CS2('a','r') == STR2(name + 4)) return 166;\r\n        break;\r\n    case CS4('b','u','l','l'):\r\n        if (4 == len) return 8226;\r\n        break;\r\n    case CS4('c','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 263;\r\n        break;\r\n    case CS3('c','a','p'): return 8745;\r\n    case CS4('c','c','a','r'):\r\n        if (6 == len && CS2('o','n') == STR2(name + 4)) return 269;\r\n        break;\r\n    case CS4('c','c','e','d'):\r\n        if (6 == len && CS2('i','l') == STR2(name + 4)) return 231;\r\n        break;\r\n    case CS4('c','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 265;\r\n        break;\r\n    case CS4('c','d','o','t'):\r\n        if (4 == len) return 267;\r\n        break;\r\n    case CS4('c','e','d','i'):\r\n        if (5 == len && CS1('l') == STR1(name + 4)) return 184;\r\n        break;\r\n    case CS4('c','e','n','t'):\r\n        if (4 == len) return 162;\r\n        break;\r\n    case CS3('c','h','i'): return 967;\r\n    case CS4('c','i','r','c'):\r\n        if (4 == len) return 710;\r\n        break;\r\n    case CS4('c','l','u','b'):\r\n        if (5 == len && CS1('s') == STR1(name + 4)) return 9827;\r\n        break;\r\n    case CS4('c','o','n','g'):\r\n        if (4 == len) return 8773;\r\n        break;\r\n    case CS4('c','o','p','y'):\r\n        if (4 == len) return 169;\r\n        break;\r\n    case CS4('c','r','a','r'):\r\n        if (5 == len && CS1('r') == STR1(name + 4)) return 8629;\r\n        break;\r\n    case CS3('c','u','p'): return 8746;\r\n    case CS4('c','u','r','r'):\r\n        if (6 == len && CS2('e','n') == STR2(name + 4)) return 164;\r\n        break;\r\n    case CS4('d','A','r','r'):\r\n        if (4 == len) return 8659;\r\n        break;\r\n    case CS4('d','a','g','g'):\r\n        if (6 == len && CS2('e','r') == STR2(name + 4)) return 8224;\r\n        break;\r\n    case CS4('d','a','r','r'):\r\n        if (4 == len) return 8595;\r\n        break;\r\n    case CS4('d','c','a','r'):\r\n        if (6 == len && CS2('o','n') == STR2(name + 4)) return 271;\r\n        break;\r\n    case CS3('d','e','g'): return 176;\r\n    case CS4('d','e','l','t'):\r\n        if (5 == len && CS1('a') == STR1(name + 4)) return 948;\r\n        break;\r\n    case CS4('d','i','a','m'):\r\n        if (5 == len && CS1('s') == STR1(name + 4)) return 9830;\r\n        break;\r\n    case CS4('d','i','g','a'):\r\n        if (7 == len && CS3('m','m','a') == STR3(name + 4)) return 989;\r\n        break;\r\n    case CS4('d','i','v','i'):\r\n        if (6 == len && CS2('d','e') == STR2(name + 4)) return 247;\r\n        break;\r\n    case CS4('d','s','t','r'):\r\n        if (6 == len && CS2('o','k') == STR2(name + 4)) return 273;\r\n        break;\r\n    case CS4('e','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 233;\r\n        break;\r\n    case CS4('e','c','a','r'):\r\n        if (6 == len && CS2('o','n') == STR2(name + 4)) return 283;\r\n        break;\r\n    case CS4('e','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 234;\r\n        break;\r\n    case CS4('e','d','o','t'):\r\n        if (4 == len) return 279;\r\n        break;\r\n    case CS4('e','g','r','a'):\r\n        if (6 == len && CS2('v','e') == STR2(name + 4)) return 232;\r\n        break;\r\n    case CS4('e','m','a','c'):\r\n        if (5 == len && CS1('r') == STR1(name + 4)) return 275;\r\n        break;\r\n    case CS4('e','m','p','t'):\r\n        if (5 == len && CS1('y') == STR1(name + 4)) return 8709;\r\n        break;\r\n    case CS4('e','m','s','p'):\r\n        if (4 == len) return 8195;\r\n        break;\r\n    case CS3('e','n','g'): return 331;\r\n    case CS4('e','n','s','p'):\r\n        if (4 == len) return 8194;\r\n        break;\r\n    case CS4('e','o','g','o'):\r\n        if (5 == len && CS1('n') == STR1(name + 4)) return 281;\r\n        break;\r\n    case CS4('e','p','s','i'):\r\n        if (7 == len && CS3('l','o','n') == STR3(name + 4)) return 949;\r\n        break;\r\n    case CS4('e','q','u','i'):\r\n        if (5 == len && CS1('v') == STR1(name + 4)) return 8801;\r\n        break;\r\n    case CS3('e','t','a'): return 951;\r\n    case CS3('e','t','h'): return 240;\r\n    case CS4('e','u','m','l'):\r\n        if (4 == len) return 235;\r\n        break;\r\n    case CS4('e','u','r','o'):\r\n        if (4 == len) return 8364;\r\n        break;\r\n    case CS4('e','x','i','s'):\r\n        if (5 == len && CS1('t') == STR1(name + 4)) return 8707;\r\n        break;\r\n    case CS4('f','n','o','f'):\r\n        if (4 == len) return 402;\r\n        break;\r\n    case CS4('f','o','r','a'):\r\n        if (6 == len && CS2('l','l') == STR2(name + 4)) return 8704;\r\n        break;\r\n    case CS4('f','r','a','c'):\r\n        if (6 == len && CS2('1','2') == STR2(name + 4)) return 189;\r\n        if (6 == len && CS2('1','4') == STR2(name + 4)) return 188;\r\n        if (6 == len && CS2('3','4') == STR2(name + 4)) return 190;\r\n        break;\r\n    case CS4('f','r','a','s'):\r\n        if (5 == len && CS1('l') == STR1(name + 4)) return 8260;\r\n        break;\r\n    case CS4('g','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 501;\r\n        break;\r\n    case CS4('g','a','m','m'):\r\n        if (5 == len && CS1('a') == STR1(name + 4)) return 947;\r\n        break;\r\n    case CS4('g','b','r','e'):\r\n        if (6 == len && CS2('v','e') == STR2(name + 4)) return 287;\r\n        break;\r\n    case CS4('g','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 285;\r\n        break;\r\n    case CS4('g','d','o','t'):\r\n        if (4 == len) return 289;\r\n        break;\r\n    case CS2('g','e'): return 8805;\r\n    case CS2('g','t'): return 62;\r\n    case CS4('h','A','r','r'):\r\n        if (4 == len) return 8660;\r\n        break;\r\n    case CS4('h','a','r','r'):\r\n        if (4 == len) return 8596;\r\n        break;\r\n    case CS4('h','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 293;\r\n        break;\r\n    case CS4('h','e','a','r'):\r\n        if (6 == len && CS2('t','s') == STR2(name + 4)) return 9829;\r\n        break;\r\n    case CS4('h','e','l','l'):\r\n        if (6 == len && CS2('i','p') == STR2(name + 4)) return 8230;\r\n        break;\r\n    case CS4('h','s','t','r'):\r\n        if (6 == len && CS2('o','k') == STR2(name + 4)) return 295;\r\n        break;\r\n    case CS4('i','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 237;\r\n        break;\r\n    case CS4('i','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 238;\r\n        break;\r\n    case CS4('i','e','x','c'):\r\n        if (5 == len && CS1('l') == STR1(name + 4)) return 161;\r\n        break;\r\n    case CS4('i','g','r','a'):\r\n        if (6 == len && CS2('v','e') == STR2(name + 4)) return 236;\r\n        break;\r\n    case CS4('i','j','l','i'):\r\n        if (5 == len && CS1('g') == STR1(name + 4)) return 307;\r\n        break;\r\n    case CS4('i','m','a','c'):\r\n        if (5 == len && CS1('r') == STR1(name + 4)) return 299;\r\n        break;\r\n    case CS4('i','m','a','g'):\r\n        if (5 == len && CS1('e') == STR1(name + 4)) return 8465;\r\n        break;\r\n    case CS4('i','m','p','e'):\r\n        if (5 == len && CS1('d') == STR1(name + 4)) return 437;\r\n        break;\r\n    case CS4('i','n','f','i'):\r\n        if (5 == len && CS1('n') == STR1(name + 4)) return 8734;\r\n        break;\r\n    case CS3('i','n','t'): return 8747;\r\n    case CS4('i','o','g','o'):\r\n        if (5 == len && CS1('n') == STR1(name + 4)) return 303;\r\n        break;\r\n    case CS4('i','o','t','a'):\r\n        if (4 == len) return 953;\r\n        break;\r\n    case CS4('i','q','u','e'):\r\n        if (6 == len && CS2('s','t') == STR2(name + 4)) return 191;\r\n        break;\r\n    case CS4('i','s','i','n'):\r\n        if (4 == len) return 8712;\r\n        break;\r\n    case CS4('i','t','i','l'):\r\n        if (6 == len && CS2('d','e') == STR2(name + 4)) return 297;\r\n        break;\r\n    case CS4('i','u','m','l'):\r\n        if (4 == len) return 239;\r\n        break;\r\n    case CS4('j','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 309;\r\n        break;\r\n    case CS4('k','a','p','p'):\r\n        if (5 == len && CS1('a') == STR1(name + 4)) return 954;\r\n        break;\r\n    case CS4('k','c','e','d'):\r\n        if (6 == len && CS2('i','l') == STR2(name + 4)) return 311;\r\n        break;\r\n    case CS4('k','g','r','e'):\r\n        if (6 == len && CS2('e','n') == STR2(name + 4)) return 312;\r\n        break;\r\n    case CS4('l','A','r','r'):\r\n        if (4 == len) return 8656;\r\n        break;\r\n    case CS4('l','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 314;\r\n        break;\r\n    case CS4('l','a','m','b'):\r\n        if (6 == len && CS2('d','a') == STR2(name + 4)) return 955;\r\n        break;\r\n    case CS4('l','a','n','g'):\r\n        if (4 == len) return 9001;\r\n        break;\r\n    case CS4('l','a','q','u'):\r\n        if (5 == len && CS1('o') == STR1(name + 4)) return 171;\r\n        break;\r\n    case CS4('l','a','r','r'):\r\n        if (4 == len) return 8592;\r\n        break;\r\n    case CS4('l','c','a','r'):\r\n        if (6 == len && CS2('o','n') == STR2(name + 4)) return 318;\r\n        break;\r\n    case CS4('l','c','e','d'):\r\n        if (6 == len && CS2('i','l') == STR2(name + 4)) return 316;\r\n        break;\r\n    case CS4('l','c','e','i'):\r\n        if (5 == len && CS1('l') == STR1(name + 4)) return 8968;\r\n        break;\r\n    case CS4('l','d','q','u'):\r\n        if (5 == len && CS1('o') == STR1(name + 4)) return 8220;\r\n        break;\r\n    case CS2('l','e'): return 8804;\r\n    case CS4('l','f','l','o'):\r\n        if (6 == len && CS2('o','r') == STR2(name + 4)) return 8970;\r\n        break;\r\n    case CS4('l','m','i','d'):\r\n        if (6 == len && CS2('o','t') == STR2(name + 4)) return 320;\r\n        break;\r\n    case CS4('l','o','w','a'):\r\n        if (6 == len && CS2('s','t') == STR2(name + 4)) return 8727;\r\n        break;\r\n    case CS3('l','o','z'): return 9674;\r\n    case CS3('l','r','m'): return 8206;\r\n    case CS4('l','s','a','q'):\r\n        if (6 == len && CS2('u','o') == STR2(name + 4)) return 8249;\r\n        break;\r\n    case CS4('l','s','q','u'):\r\n        if (5 == len && CS1('o') == STR1(name + 4)) return 8216;\r\n        break;\r\n    case CS4('l','s','t','r'):\r\n        if (6 == len && CS2('o','k') == STR2(name + 4)) return 322;\r\n        break;\r\n    case CS2('l','t'): return 60;\r\n    case CS4('m','a','c','r'):\r\n        if (4 == len) return 175;\r\n        break;\r\n    case CS4('m','d','a','s'):\r\n        if (5 == len && CS1('h') == STR1(name + 4)) return 8212;\r\n        break;\r\n    case CS4('m','i','c','r'):\r\n        if (5 == len && CS1('o') == STR1(name + 4)) return 181;\r\n        break;\r\n    case CS4('m','i','d','d'):\r\n        if (6 == len && CS2('o','t') == STR2(name + 4)) return 183;\r\n        break;\r\n    case CS4('m','i','n','u'):\r\n        if (5 == len && CS1('s') == STR1(name + 4)) return 8722;\r\n        break;\r\n    case CS2('m','u'): return 956;\r\n    case CS4('n','a','b','l'):\r\n        if (5 == len && CS1('a') == STR1(name + 4)) return 8711;\r\n        break;\r\n    case CS4('n','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 324;\r\n        break;\r\n    case CS4('n','a','p','o'):\r\n        if (5 == len && CS1('s') == STR1(name + 4)) return 329;\r\n        break;\r\n    case CS4('n','b','s','p'):\r\n        if (4 == len) return 160;\r\n        break;\r\n    case CS4('n','c','a','r'):\r\n        if (6 == len && CS2('o','n') == STR2(name + 4)) return 328;\r\n        break;\r\n    case CS4('n','c','e','d'):\r\n        if (6 == len && CS2('i','l') == STR2(name + 4)) return 326;\r\n        break;\r\n    case CS4('n','d','a','s'):\r\n        if (5 == len && CS1('h') == STR1(name + 4)) return 8211;\r\n        break;\r\n    case CS2('n','e'): return 8800;\r\n    case CS2('n','i'): return 8715;\r\n    case CS3('n','o','t'): return 172;\r\n    case CS4('n','o','t','i'):\r\n        if (5 == len && CS1('n') == STR1(name + 4)) return 8713;\r\n        break;\r\n    case CS4('n','s','u','b'):\r\n        if (4 == len) return 8836;\r\n        break;\r\n    case CS4('n','t','i','l'):\r\n        if (6 == len && CS2('d','e') == STR2(name + 4)) return 241;\r\n        break;\r\n    case CS2('n','u'): return 957;\r\n    case CS4('o','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 243;\r\n        break;\r\n    case CS4('o','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 244;\r\n        break;\r\n    case CS4('o','d','b','l'):\r\n        if (6 == len && CS2('a','c') == STR2(name + 4)) return 337;\r\n        break;\r\n    case CS4('o','e','l','i'):\r\n        if (5 == len && CS1('g') == STR1(name + 4)) return 339;\r\n        break;\r\n    case CS4('o','g','o','n'):\r\n        if (4 == len) return 731;\r\n        break;\r\n    case CS4('o','g','r','a'):\r\n        if (6 == len && CS2('v','e') == STR2(name + 4)) return 242;\r\n        break;\r\n    case CS4('o','l','i','n'):\r\n        if (5 == len && CS1('e') == STR1(name + 4)) return 8254;\r\n        break;\r\n    case CS4('o','m','a','c'):\r\n        if (5 == len && CS1('r') == STR1(name + 4)) return 333;\r\n        break;\r\n    case CS4('o','m','e','g'):\r\n        if (5 == len && CS1('a') == STR1(name + 4)) return 969;\r\n        break;\r\n    case CS4('o','m','i','c'):\r\n        if (7 == len && CS3('r','o','n') == STR3(name + 4)) return 959;\r\n        break;\r\n    case CS4('o','p','l','u'):\r\n        if (5 == len && CS1('s') == STR1(name + 4)) return 8853;\r\n        break;\r\n    case CS2('o','r'): return 8744;\r\n    case CS4('o','r','d','f'):\r\n        if (4 == len) return 170;\r\n        break;\r\n    case CS4('o','r','d','m'):\r\n        if (4 == len) return 186;\r\n        break;\r\n    case CS4('o','s','l','a'):\r\n        if (6 == len && CS2('s','h') == STR2(name + 4)) return 248;\r\n        break;\r\n    case CS4('o','t','i','l'):\r\n        if (6 == len && CS2('d','e') == STR2(name + 4)) return 245;\r\n        break;\r\n    case CS4('o','t','i','m'):\r\n        if (6 == len && CS2('e','s') == STR2(name + 4)) return 8855;\r\n        break;\r\n    case CS4('o','u','m','l'):\r\n        if (4 == len) return 246;\r\n        break;\r\n    case CS4('p','a','r','a'):\r\n        if (4 == len) return 182;\r\n        break;\r\n    case CS4('p','a','r','t'):\r\n        if (4 == len) return 8706;\r\n        break;\r\n    case CS4('p','e','r','m'):\r\n        if (6 == len && CS2('i','l') == STR2(name + 4)) return 8240;\r\n        break;\r\n    case CS4('p','e','r','p'):\r\n        if (4 == len) return 8869;\r\n        break;\r\n    case CS3('p','h','i'): return 966;\r\n    case CS2('p','i'): return 960;\r\n    case CS3('p','i','v'): return 982;\r\n    case CS4('p','l','u','s'):\r\n        if (6 == len && CS2('m','n') == STR2(name + 4)) return 177;\r\n        break;\r\n    case CS4('p','o','u','n'):\r\n        if (5 == len && CS1('d') == STR1(name + 4)) return 163;\r\n        break;\r\n    case CS4('p','r','i','m'):\r\n        if (5 == len && CS1('e') == STR1(name + 4)) return 8242;\r\n        break;\r\n    case CS4('p','r','o','d'):\r\n        if (4 == len) return 8719;\r\n        break;\r\n    case CS4('p','r','o','p'):\r\n        if (4 == len) return 8733;\r\n        break;\r\n    case CS3('p','s','i'): return 968;\r\n    case CS4('q','u','o','t'):\r\n        if (4 == len) return 34;\r\n        break;\r\n    case CS4('r','A','r','r'):\r\n        if (4 == len) return 8658;\r\n        break;\r\n    case CS4('r','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 341;\r\n        break;\r\n    case CS4('r','a','d','i'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 8730;\r\n        break;\r\n    case CS4('r','a','n','g'):\r\n        if (4 == len) return 9002;\r\n        break;\r\n    case CS4('r','a','q','u'):\r\n        if (5 == len && CS1('o') == STR1(name + 4)) return 187;\r\n        break;\r\n    case CS4('r','a','r','r'):\r\n        if (4 == len) return 8594;\r\n        break;\r\n    case CS4('r','c','a','r'):\r\n        if (6 == len && CS2('o','n') == STR2(name + 4)) return 345;\r\n        break;\r\n    case CS4('r','c','e','d'):\r\n        if (6 == len && CS2('i','l') == STR2(name + 4)) return 343;\r\n        break;\r\n    case CS4('r','c','e','i'):\r\n        if (5 == len && CS1('l') == STR1(name + 4)) return 8969;\r\n        break;\r\n    case CS4('r','d','q','u'):\r\n        if (5 == len && CS1('o') == STR1(name + 4)) return 8221;\r\n        break;\r\n    case CS4('r','e','a','l'):\r\n        if (4 == len) return 8476;\r\n        break;\r\n    case CS3('r','e','g'): return 174;\r\n    case CS4('r','f','l','o'):\r\n        if (6 == len && CS2('o','r') == STR2(name + 4)) return 8971;\r\n        break;\r\n    case CS3('r','h','o'): return 961;\r\n    case CS4('r','i','n','g'):\r\n        if (4 == len) return 730;\r\n        break;\r\n    case CS3('r','l','m'): return 8207;\r\n    case CS4('r','s','a','q'):\r\n        if (6 == len && CS2('u','o') == STR2(name + 4)) return 8250;\r\n        break;\r\n    case CS4('r','s','q','u'):\r\n        if (5 == len && CS1('o') == STR1(name + 4)) return 8217;\r\n        break;\r\n    case CS4('s','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 347;\r\n        break;\r\n    case CS4('s','b','q','u'):\r\n        if (5 == len && CS1('o') == STR1(name + 4)) return 8218;\r\n        break;\r\n    case CS4('s','c','a','r'):\r\n        if (6 == len && CS2('o','n') == STR2(name + 4)) return 353;\r\n        break;\r\n    case CS4('s','c','e','d'):\r\n        if (6 == len && CS2('i','l') == STR2(name + 4)) return 351;\r\n        break;\r\n    case CS4('s','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 349;\r\n        break;\r\n    case CS4('s','d','o','t'):\r\n        if (4 == len) return 8901;\r\n        break;\r\n    case CS4('s','e','c','t'):\r\n        if (4 == len) return 167;\r\n        break;\r\n    case CS3('s','h','y'): return 173;\r\n    case CS4('s','i','g','m'):\r\n        if (5 == len && CS1('a') == STR1(name + 4)) return 963;\r\n        if (6 == len && CS2('a','f') == STR2(name + 4)) return 962;\r\n        break;\r\n    case CS3('s','i','m'): return 8764;\r\n    case CS4('s','p','a','d'):\r\n        if (6 == len && CS2('e','s') == STR2(name + 4)) return 9824;\r\n        break;\r\n    case CS4('s','t','r','a'):\r\n        if (15 == len && str::EqN(name + 4, \"ightepsilon\", 11)) return 1013;\r\n        if (11 == len && str::EqN(name + 4, \"ightphi\", 7)) return 981;\r\n        break;\r\n    case CS3('s','u','b'): return 8834;\r\n    case CS4('s','u','b','e'):\r\n        if (4 == len) return 8838;\r\n        break;\r\n    case CS3('s','u','m'): return 8721;\r\n    case CS3('s','u','p'): return 8835;\r\n    case CS4('s','u','p','1'):\r\n        if (4 == len) return 185;\r\n        break;\r\n    case CS4('s','u','p','2'):\r\n        if (4 == len) return 178;\r\n        break;\r\n    case CS4('s','u','p','3'):\r\n        if (4 == len) return 179;\r\n        break;\r\n    case CS4('s','u','p','e'):\r\n        if (4 == len) return 8839;\r\n        break;\r\n    case CS4('s','z','l','i'):\r\n        if (5 == len && CS1('g') == STR1(name + 4)) return 223;\r\n        break;\r\n    case CS3('t','a','u'): return 964;\r\n    case CS4('t','c','a','r'):\r\n        if (6 == len && CS2('o','n') == STR2(name + 4)) return 357;\r\n        break;\r\n    case CS4('t','c','e','d'):\r\n        if (6 == len && CS2('i','l') == STR2(name + 4)) return 355;\r\n        break;\r\n    case CS4('t','h','e','r'):\r\n        if (6 == len && CS2('e','4') == STR2(name + 4)) return 8756;\r\n        break;\r\n    case CS4('t','h','e','t'):\r\n        if (5 == len && CS1('a') == STR1(name + 4)) return 952;\r\n        if (8 == len && CS4('a','s','y','m') == STR4(name + 4)) return 977;\r\n        break;\r\n    case CS4('t','h','i','n'):\r\n        if (6 == len && CS2('s','p') == STR2(name + 4)) return 8201;\r\n        break;\r\n    case CS4('t','h','o','r'):\r\n        if (5 == len && CS1('n') == STR1(name + 4)) return 254;\r\n        break;\r\n    case CS4('t','i','l','d'):\r\n        if (5 == len && CS1('e') == STR1(name + 4)) return 732;\r\n        break;\r\n    case CS4('t','i','m','e'):\r\n        if (5 == len && CS1('s') == STR1(name + 4)) return 215;\r\n        break;\r\n    case CS4('t','r','a','d'):\r\n        if (5 == len && CS1('e') == STR1(name + 4)) return 8482;\r\n        break;\r\n    case CS4('t','s','t','r'):\r\n        if (6 == len && CS2('o','k') == STR2(name + 4)) return 359;\r\n        break;\r\n    case CS4('u','A','r','r'):\r\n        if (4 == len) return 8657;\r\n        break;\r\n    case CS4('u','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 250;\r\n        break;\r\n    case CS4('u','a','r','r'):\r\n        if (4 == len) return 8593;\r\n        break;\r\n    case CS4('u','b','r','e'):\r\n        if (6 == len && CS2('v','e') == STR2(name + 4)) return 365;\r\n        break;\r\n    case CS4('u','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 251;\r\n        break;\r\n    case CS4('u','d','b','l'):\r\n        if (6 == len && CS2('a','c') == STR2(name + 4)) return 369;\r\n        break;\r\n    case CS4('u','g','r','a'):\r\n        if (6 == len && CS2('v','e') == STR2(name + 4)) return 249;\r\n        break;\r\n    case CS4('u','m','a','c'):\r\n        if (5 == len && CS1('r') == STR1(name + 4)) return 363;\r\n        break;\r\n    case CS3('u','m','l'): return 168;\r\n    case CS4('u','o','g','o'):\r\n        if (5 == len && CS1('n') == STR1(name + 4)) return 371;\r\n        break;\r\n    case CS4('u','p','s','i'):\r\n        if (5 == len && CS1('h') == STR1(name + 4)) return 978;\r\n        if (7 == len && CS3('l','o','n') == STR3(name + 4)) return 965;\r\n        break;\r\n    case CS4('u','r','i','n'):\r\n        if (5 == len && CS1('g') == STR1(name + 4)) return 367;\r\n        break;\r\n    case CS4('u','t','i','l'):\r\n        if (6 == len && CS2('d','e') == STR2(name + 4)) return 361;\r\n        break;\r\n    case CS4('u','u','m','l'):\r\n        if (4 == len) return 252;\r\n        break;\r\n    case CS4('v','a','r','e'):\r\n        if (10 == len && str::EqN(name + 4, \"psilon\", 6)) return 949;\r\n        break;\r\n    case CS4('v','a','r','k'):\r\n        if (8 == len && CS4('a','p','p','a') == STR4(name + 4)) return 1008;\r\n        break;\r\n    case CS4('v','a','r','p'):\r\n        if (6 == len && CS2('h','i') == STR2(name + 4)) return 966;\r\n        if (5 == len && CS1('i') == STR1(name + 4)) return 982;\r\n        break;\r\n    case CS4('v','a','r','r'):\r\n        if (6 == len && CS2('h','o') == STR2(name + 4)) return 1009;\r\n        break;\r\n    case CS4('v','a','r','s'):\r\n        if (8 == len && CS4('i','g','m','a') == STR4(name + 4)) return 962;\r\n        break;\r\n    case CS4('v','a','r','t'):\r\n        if (8 == len && CS4('h','e','t','a') == STR4(name + 4)) return 977;\r\n        break;\r\n    case CS4('w','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 373;\r\n        break;\r\n    case CS4('w','e','i','e'):\r\n        if (6 == len && CS2('r','p') == STR2(name + 4)) return 8472;\r\n        break;\r\n    case CS2('x','i'): return 958;\r\n    case CS4('y','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 253;\r\n        break;\r\n    case CS4('y','c','i','r'):\r\n        if (5 == len && CS1('c') == STR1(name + 4)) return 375;\r\n        break;\r\n    case CS3('y','e','n'): return 165;\r\n    case CS4('y','u','m','l'):\r\n        if (4 == len) return 255;\r\n        break;\r\n    case CS4('z','a','c','u'):\r\n        if (6 == len && CS2('t','e') == STR2(name + 4)) return 378;\r\n        break;\r\n    case CS4('z','c','a','r'):\r\n        if (6 == len && CS2('o','n') == STR2(name + 4)) return 382;\r\n        break;\r\n    case CS4('z','d','o','t'):\r\n        if (4 == len) return 380;\r\n        break;\r\n    case CS4('z','e','t','a'):\r\n        if (4 == len) return 950;\r\n        break;\r\n    case CS3('z','w','j'): return 8205;\r\n    case CS4('z','w','n','j'):\r\n        if (4 == len) return 8204;\r\n        break;\r\n    }\r\n    return (uint32_t)-1;\r\n}\r\n\r\nCssProp FindCssProp(const char *name, size_t len)\r\n{\r\n    uint32_t key = 0 == len ? 0 : 1 == len ? STR1i(name) :\r\n                   2 == len ? STR2i(name) : 3 == len ? STR3i(name) : STR4i(name);\r\n    switch (key) {\r\n    case CS4('c','o','l','o'):\r\n        if (5 == len && CS1('r') == STR1i(name + 4)) return Css_Color;\r\n        break;\r\n    case CS4('d','i','s','p'):\r\n        if (7 == len && CS3('l','a','y') == STR3i(name + 4)) return Css_Display;\r\n        break;\r\n    case CS4('f','o','n','t'):\r\n        if (4 == len) return Css_Font;\r\n        if (11 == len && str::EqNI(name + 4, \"-family\", 7)) return Css_Font_Family;\r\n        if (9 == len && str::EqNI(name + 4, \"-size\", 5)) return Css_Font_Size;\r\n        if (10 == len && str::EqNI(name + 4, \"-style\", 6)) return Css_Font_Style;\r\n        if (11 == len && str::EqNI(name + 4, \"-weight\", 7)) return Css_Font_Weight;\r\n        break;\r\n    case CS4('l','i','s','t'):\r\n        if (10 == len && str::EqNI(name + 4, \"-style\", 6)) return Css_List_Style;\r\n        break;\r\n    case CS4('m','a','r','g'):\r\n        if (6 == len && CS2('i','n') == STR2i(name + 4)) return Css_Margin;\r\n        if (13 == len && str::EqNI(name + 4, \"in-bottom\", 9)) return Css_Margin_Bottom;\r\n        if (11 == len && str::EqNI(name + 4, \"in-left\", 7)) return Css_Margin_Left;\r\n        if (12 == len && str::EqNI(name + 4, \"in-right\", 8)) return Css_Margin_Right;\r\n        if (10 == len && str::EqNI(name + 4, \"in-top\", 6)) return Css_Margin_Top;\r\n        break;\r\n    case CS4('m','a','x','-'):\r\n        if (9 == len && str::EqNI(name + 4, \"width\", 5)) return Css_Max_Width;\r\n        break;\r\n    case CS4('o','p','a','c'):\r\n        if (7 == len && CS3('i','t','y') == STR3i(name + 4)) return Css_Opacity;\r\n        break;\r\n    case CS4('p','a','d','d'):\r\n        if (7 == len && CS3('i','n','g') == STR3i(name + 4)) return Css_Padding;\r\n        if (14 == len && str::EqNI(name + 4, \"ing-bottom\", 10)) return Css_Padding_Bottom;\r\n        if (12 == len && str::EqNI(name + 4, \"ing-left\", 8)) return Css_Padding_Left;\r\n        if (13 == len && str::EqNI(name + 4, \"ing-right\", 9)) return Css_Padding_Right;\r\n        if (11 == len && str::EqNI(name + 4, \"ing-top\", 7)) return Css_Padding_Top;\r\n        break;\r\n    case CS4('p','a','g','e'):\r\n        if (16 == len && str::EqNI(name + 4, \"-break-after\", 12)) return Css_Page_Break_After;\r\n        if (17 == len && str::EqNI(name + 4, \"-break-before\", 13)) return Css_Page_Break_Before;\r\n        break;\r\n    case CS4('t','e','x','t'):\r\n        if (10 == len && str::EqNI(name + 4, \"-align\", 6)) return Css_Text_Align;\r\n        if (15 == len && str::EqNI(name + 4, \"-decoration\", 11)) return Css_Text_Decoration;\r\n        if (11 == len && str::EqNI(name + 4, \"-indent\", 7)) return Css_Text_Indent;\r\n        if (14 == len && str::EqNI(name + 4, \"-underline\", 10)) return Css_Text_Underline;\r\n        break;\r\n    case CS4('w','h','i','t'):\r\n        if (11 == len && str::EqNI(name + 4, \"e-space\", 7)) return Css_White_Space;\r\n        break;\r\n    case CS4('w','o','r','d'):\r\n        if (9 == len && str::EqNI(name + 4, \"-wrap\", 5)) return Css_Word_Wrap;\r\n        break;\r\n    }\r\n    return Css_Unknown;\r\n}\r\n"
  },
  {
    "path": "src/utils/HtmlParserLookup.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// This file is auto-generated by gen_htmlparserlookup.py\r\n\r\nenum HtmlTag {\r\n    Tag_A, Tag_Abbr, Tag_Acronym, Tag_Area, Tag_Audio,\r\n    Tag_B, Tag_Base, Tag_Basefont, Tag_Blockquote, Tag_Body,\r\n    Tag_Br, Tag_Center, Tag_Code, Tag_Col, Tag_Dd,\r\n    Tag_Div, Tag_Dl, Tag_Dt, Tag_Em, Tag_Font,\r\n    Tag_Frame, Tag_H1, Tag_H2, Tag_H3, Tag_H4,\r\n    Tag_H5, Tag_H6, Tag_Head, Tag_Hr, Tag_Html,\r\n    Tag_I, Tag_Image, Tag_Img, Tag_Input, Tag_Lh,\r\n    Tag_Li, Tag_Link, Tag_Mbp_Pagebreak, Tag_Meta, Tag_Nav,\r\n    Tag_Object, Tag_Ol, Tag_P, Tag_Pagebreak, Tag_Param,\r\n    Tag_Pre, Tag_S, Tag_Script, Tag_Section, Tag_Small,\r\n    Tag_Span, Tag_Strike, Tag_Strong, Tag_Style, Tag_Sub,\r\n    Tag_Subtitle, Tag_Sup, Tag_Svg, Tag_Svg_Image, Tag_Table,\r\n    Tag_Td, Tag_Th, Tag_Title, Tag_Tr, Tag_Tt,\r\n    Tag_U, Tag_Ul, Tag_Video, Tag_NotFound\r\n};\r\n\r\nenum AlignAttr {\r\n    Align_Center, Align_Justify, Align_Left, Align_Right, Align_NotFound\r\n};\r\n\r\nHtmlTag         FindHtmlTag(const char *name, size_t len);\r\nbool            IsTagSelfClosing(HtmlTag item);\r\nbool            IsInlineTag(HtmlTag item);\r\nAlignAttr       FindAlignAttr(const char *name, size_t len);\r\nuint32_t        FindHtmlEntityRune(const char *name, size_t len);\r\n\r\nenum CssProp {\r\n    Css_Color, Css_Display, Css_Font, Css_Font_Family, Css_Font_Size,\r\n    Css_Font_Style, Css_Font_Weight, Css_List_Style, Css_Margin, Css_Margin_Bottom,\r\n    Css_Margin_Left, Css_Margin_Right, Css_Margin_Top, Css_Max_Width, Css_Opacity,\r\n    Css_Padding, Css_Padding_Bottom, Css_Padding_Left, Css_Padding_Right, Css_Padding_Top,\r\n    Css_Page_Break_After, Css_Page_Break_Before, Css_Text_Align, Css_Text_Decoration, Css_Text_Indent,\r\n    Css_Text_Underline, Css_White_Space, Css_Word_Wrap, Css_Unknown\r\n};\r\n\r\nCssProp         FindCssProp(const char *name, size_t len);\r\n"
  },
  {
    "path": "src/utils/HtmlPrettyPrint.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"HtmlPrettyPrint.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"HtmlPullParser.h\"\r\n\r\nstatic void HtmlAddWithNesting(str::Str<char>* out, HtmlToken *tok, size_t nesting)\r\n{\r\n    CrashIf(!tok->IsStartTag() && !tok->IsEndTag() && !tok->IsEmptyElementEndTag());\r\n    bool isInline = IsInlineTag(tok->tag);\r\n    // add a newline before block start tags (unless there already is one)\r\n    bool onNewLine = out->Count() == 0 || out->Last() == '\\n';\r\n    if (!onNewLine && !isInline && !tok->IsEndTag()) {\r\n        out->Append('\\n');\r\n        onNewLine = true;\r\n    }\r\n    // indent the tag if it starts on a new line\r\n    if (onNewLine) {\r\n        for (size_t i = 0; i < nesting; i++)\r\n            out->Append('\\t');\r\n        if (tok->IsEndTag() && nesting > 0)\r\n            out->Pop();\r\n    }\r\n    // output the tag and all its attributes\r\n    out->Append('<');\r\n    if (tok->IsEndTag())\r\n        out->Append('/');\r\n    // TODO: normalize whitespace between attributes?\r\n    out->Append(tok->s, tok->sLen);\r\n    if (tok->IsEmptyElementEndTag())\r\n        out->Append('/');\r\n    out->Append('>');\r\n    // add a newline after block end tags\r\n    if (!isInline && !tok->IsStartTag())\r\n        out->Append('\\n');\r\n}\r\n\r\nstatic bool IsWsText(const char *s, size_t len)\r\n{\r\n    const char *end = s + len;\r\n    for (; s < end && str::IsWs(*s); s++);\r\n    return s == end;\r\n}\r\n\r\nchar *PrettyPrintHtml(const char *s, size_t len, size_t& lenOut)\r\n{\r\n    if ((size_t)-1 == len)\r\n        len = str::Len(s);\r\n\r\n    str::Str<char> res(len);\r\n    HtmlPullParser parser(s, len);\r\n    Vec<HtmlTag> tagNesting;\r\n    HtmlToken *t;\r\n    while ((t = parser.Next()) != nullptr && !t->IsError()) {\r\n        if (t->IsText()) {\r\n            // TODO: normalize whitespace instead?\r\n            if (!IsWsText(t->s, t->sLen))\r\n                res.Append(t->s, t->sLen);\r\n        }\r\n        if (!t->IsTag())\r\n            continue;\r\n\r\n        HtmlAddWithNesting(&res, t, tagNesting.Count());\r\n\r\n        if (t->IsStartTag()) {\r\n            if (!IsTagSelfClosing(t->tag))\r\n                tagNesting.Append(t->tag);\r\n        }\r\n        else if (t->IsEndTag()) {\r\n            // when closing a tag, if the top tag doesn't match but\r\n            // there are only potentially self-closing tags on the\r\n            // stack between the matching tag, we pop all of them\r\n            if (tagNesting.Contains(t->tag)) {\r\n                while (tagNesting.Last() != t->tag)\r\n                    tagNesting.Pop();\r\n            }\r\n            if (tagNesting.Count() > 0 && tagNesting.Last() == t->tag)\r\n                tagNesting.Pop();\r\n        }\r\n    }\r\n    lenOut = res.Count();\r\n    return res.StealData();\r\n}\r\n"
  },
  {
    "path": "src/utils/HtmlPrettyPrint.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nchar *PrettyPrintHtml(const char *s, size_t len, size_t& lenOut);\r\n"
  },
  {
    "path": "src/utils/HtmlPullParser.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"HtmlPullParser.h\"\r\n\r\n// returns -1 if didn't find\r\nint HtmlEntityNameToRune(const char *name, size_t nameLen)\r\n{\r\n    return FindHtmlEntityRune(name, nameLen);\r\n}\r\n\r\n#define MAX_ENTITY_NAME_LEN 8\r\n\r\n// A unicode version of HtmlEntityNameToRune. It's safe because\r\n// entity names only contain ascii (<127) characters so if a simplistic\r\n// conversion from unicode to ascii succeeds, we can use ascii\r\n// version, otherwise it wouldn't match anyway\r\n// returns -1 if didn't find\r\nint HtmlEntityNameToRune(const WCHAR *name, size_t nameLen)\r\n{\r\n    char asciiName[MAX_ENTITY_NAME_LEN];\r\n    if (nameLen > MAX_ENTITY_NAME_LEN)\r\n        return -1;\r\n    for (size_t i = 0; i < nameLen; i++) {\r\n        if (name[i] > 127)\r\n            return -1;\r\n        asciiName[i] = (char)name[i];\r\n    }\r\n    return FindHtmlEntityRune(asciiName, nameLen);\r\n}\r\n\r\nbool SkipUntil(const char*& s, const char *end, char c)\r\n{\r\n    while ((s < end) && (*s != c)) {\r\n        ++s;\r\n    }\r\n    return *s == c;\r\n}\r\n\r\nbool SkipUntil(const char*& s, const char *end, char *term)\r\n{\r\n    size_t len = str::Len(term);\r\n    for (; s < end; s++) {\r\n        if (s + len <= end && str::StartsWith(s, term))\r\n            return true;\r\n    }\r\n    return false;\r\n}\r\n\r\n// return true if skipped\r\nbool SkipWs(const char* & s, const char *end)\r\n{\r\n    const char *start = s;\r\n    while ((s < end) && str::IsWs(*s)) {\r\n        ++s;\r\n    }\r\n    return start != s;\r\n}\r\n\r\n// return true if skipped\r\nbool SkipNonWs(const char* & s, const char *end)\r\n{\r\n    const char *start = s;\r\n    while ((s < end) && !str::IsWs(*s)) {\r\n        ++s;\r\n    }\r\n    return start != s;\r\n}\r\n\r\nstatic bool IsNameChar(char c)\r\n{\r\n    return c == '.' || c == '-' || c == '_' || c == ':' ||\r\n           str::IsDigit(c) || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z');\r\n}\r\n\r\nstatic bool IsValidTagStart(char c)\r\n{\r\n    return c == '/' || c == '!' || c == '?' || IsNameChar(c);\r\n}\r\n\r\n// skip all html tag or attribute characters\r\nstatic void SkipName(const char*& s, const char *end)\r\n{\r\n    while ((s < end) && IsNameChar(*s)) {\r\n        s++;\r\n    }\r\n}\r\n\r\n// return true if s consists only of whitespace\r\nbool IsSpaceOnly(const char *s, const char *end)\r\n{\r\n    SkipWs(s, end);\r\n    return s == end;\r\n}\r\n\r\nvoid MemAppend(char *& dst, const char *s, size_t len)\r\n{\r\n    if (0 == len)\r\n        return;\r\n    memcpy(dst, s, len);\r\n    dst += len;\r\n}\r\n\r\n// if \"&foo;\" was the entity, s points at the char\r\n// after '&' and len is the maximum lenght of the string\r\n// (4 in case of \"foo;\")\r\n// returns a pointer to the first character after the entity\r\nconst char *ResolveHtmlEntity(const char *s, size_t len, int& rune)\r\n{\r\n    const char *entEnd = str::Parse(s, len, \"#%d%?;\", &rune);\r\n    if (entEnd)\r\n        return entEnd;\r\n    entEnd = str::Parse(s, len, \"#x%x%?;\", &rune);\r\n    if (entEnd)\r\n        return entEnd;\r\n\r\n    // go to the end of a potential named entity\r\n    for (entEnd = s; entEnd < s + len && isalnum((unsigned char)*entEnd); entEnd++);\r\n    if (entEnd != s) {\r\n        rune = HtmlEntityNameToRune(s, entEnd - s);\r\n        if (-1 == rune)\r\n            return nullptr;\r\n        // skip the trailing colon - if there is one\r\n        if (entEnd < s + len && *entEnd == ';')\r\n            entEnd++;\r\n        return entEnd;\r\n    }\r\n\r\n    rune = -1;\r\n    return nullptr;\r\n}\r\n\r\n// if s doesn't contain html entities, we just return it\r\n// if it contains html entities, we'll return string allocated\r\n// with alloc in which entities are converted to their values\r\n// Entities are encoded as utf8 in the result.\r\n// alloc can be nullptr, in which case we'll allocate with malloc()\r\nconst char *ResolveHtmlEntities(const char *s, const char *end, Allocator *alloc)\r\n{\r\n    char *        res = nullptr;\r\n    size_t        resLen = 0;\r\n    char *        dst;\r\n\r\n    const char *curr = s;\r\n    for (;;) {\r\n        bool found = SkipUntil(curr, end, '&');\r\n        if (!found) {\r\n            if (!res)\r\n                return s;\r\n            // copy the remaining string\r\n            MemAppend(dst, s, end - s);\r\n            break;\r\n        }\r\n        if (!res) {\r\n            // allocate memory for the result string\r\n            // I'm banking that text after resolving entities will\r\n            // be smaller than the original\r\n            resLen = end - s + 8; // +8 just in case\r\n            res = (char*)Allocator::Alloc(alloc, resLen);\r\n            dst = res;\r\n        }\r\n        MemAppend(dst, s, curr - s);\r\n        // curr points at '&'\r\n        int rune = -1;\r\n        const char *entEnd = ResolveHtmlEntity(curr + 1, end - curr - 1, rune);\r\n        if (!entEnd) {\r\n            // unknown entity, just copy the '&'\r\n            MemAppend(dst, curr, 1);\r\n            curr++;\r\n        } else {\r\n            str::Utf8Encode(dst, rune);\r\n            curr = entEnd;\r\n        }\r\n        s = curr;\r\n    }\r\n    *dst = 0;\r\n    CrashIf(dst >= res + resLen);\r\n    return (const char*)res;\r\n}\r\n\r\n// convenience function for the above that always allocates\r\nchar *ResolveHtmlEntities(const char *s, size_t len)\r\n{\r\n    const char *tmp = ResolveHtmlEntities(s, s + len, nullptr);\r\n    if (tmp == s)\r\n        return str::DupN(s, len);\r\n    return (char *)tmp;\r\n}\r\n\r\nbool AttrInfo::NameIs(const char *s) const\r\n{\r\n    return str::EqNIx(name, nameLen, s);\r\n}\r\n\r\n// for now just ignores any namespace qualifier\r\n// (i.e. succeeds for \"xlink:href\" with name=\"href\" and any value of attrNS)\r\n// TODO: add proper namespace support\r\nbool AttrInfo::NameIsNS(const char *s, const char *ns) const\r\n{\r\n    CrashIf(!ns);\r\n    const char *nameStart = (const char *)memchr(name, ':', nameLen);\r\n    nameStart = nameStart ? nameStart + 1 : name;\r\n    return str::EqNIx(nameStart, nameLen - (nameStart - name), s);\r\n}\r\n\r\nbool AttrInfo::ValIs(const char *s) const\r\n{\r\n    return str::EqNIx(val, valLen, s);\r\n}\r\n\r\nvoid HtmlToken::SetTag(TokenType new_type, const char *new_s, const char *end)\r\n{\r\n    type = new_type;\r\n    s = new_s;\r\n    sLen = end - s;\r\n    SkipName(new_s, s + sLen);\r\n    nLen = new_s - s;\r\n    tag = FindHtmlTag(s, nLen);\r\n    nextAttr = nullptr;\r\n}\r\n\r\nvoid HtmlToken::SetText(const char *new_s, const char *end)\r\n{\r\n    type = Text;\r\n    s = new_s;\r\n    sLen = end - s;\r\n}\r\n\r\nvoid HtmlToken::SetError(ParsingError err, const char *errContext)\r\n{\r\n    type = Error;\r\n    error = err;\r\n    s = errContext;\r\n}\r\n\r\nbool HtmlToken::NameIs(const char *name) const\r\n{\r\n    return (str::Len(name) == nLen) && str::StartsWithI(s, name);\r\n}\r\n\r\n// for now just ignores any namespace qualifier\r\n// (i.e. succeeds for \"opf:content\" with name=\"content\" and any value of ns)\r\n// TODO: add proper namespace support\r\nbool HtmlToken::NameIsNS(const char *name, const char *ns) const\r\n{\r\n    CrashIf(!ns);\r\n    const char *nameStart = (const char *)memchr(s, ':', nLen);\r\n    nameStart = nameStart ? nameStart + 1 : s;\r\n    return str::EqNIx(nameStart, nLen - (nameStart - s), name);\r\n}\r\n\r\n// reparse point is an address within html that we can\r\n// can feed to HtmlPullParser() to start parsing from that point\r\nconst char *HtmlToken::GetReparsePoint() const\r\n{\r\n    if (IsStartTag() || IsEmptyElementEndTag())\r\n        return s - 1;\r\n    if (IsEndTag())\r\n        return s - 2;\r\n    if (IsText())\r\n        return s;\r\n    CrashIf(true); // don't call us on error tokens\r\n    return nullptr;\r\n}\r\n\r\nAttrInfo *HtmlToken::GetAttrByName(const char *name)\r\n{\r\n    nextAttr = nullptr; // start from the beginning\r\n    for (AttrInfo *a = NextAttr(); a; a = NextAttr()) {\r\n        if (a->NameIs(name))\r\n            return a;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nAttrInfo *HtmlToken::GetAttrByNameNS(const char *name, const char *attrNS)\r\n{\r\n    nextAttr = nullptr; // start from the beginning\r\n    for (AttrInfo *a = NextAttr(); a; a = NextAttr()) {\r\n        if (a->NameIsNS(name, attrNS))\r\n            return a;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\n// We expect:\r\n// whitespace | attribute name | = | attribute value\r\n// where attribute value can be quoted\r\nAttrInfo *HtmlToken::NextAttr()\r\n{\r\n    // start after the last attribute found (or the beginning)\r\n    const char *curr = nextAttr;\r\n    if (!curr)\r\n        curr = s + nLen;\r\n    const char *end = s + sLen;\r\n\r\n    // parse attribute name\r\n    SkipWs(curr, end);\r\n    if (curr == end) {\r\nNoNextAttr:\r\n        nextAttr = nullptr;\r\n        return nullptr;\r\n    }\r\n    attrInfo.name = curr;\r\n    SkipName(curr, end);\r\n    attrInfo.nameLen = curr - attrInfo.name;\r\n    if (0 == attrInfo.nameLen)\r\n        goto NoNextAttr;\r\n    SkipWs(curr, end);\r\n    if ((curr == end) || ('=' != *curr)) {\r\n        // attributes without values get their names as value in HTML\r\n        attrInfo.val = attrInfo.name;\r\n        attrInfo.valLen = attrInfo.nameLen;\r\n        nextAttr = curr;\r\n        return &attrInfo;\r\n    }\r\n\r\n    // parse attribute value\r\n    ++curr; // skip '='\r\n    SkipWs(curr, end);\r\n    if (curr == end) {\r\n        // attribute with implicit empty value\r\n        attrInfo.val = curr;\r\n        attrInfo.valLen = 0;\r\n    } else if (('\\'' == *curr) || ('\\\"' == *curr)) {\r\n        // attribute with quoted value\r\n        ++curr;\r\n        attrInfo.val = curr;\r\n        if (!SkipUntil(curr, end, *(curr - 1)))\r\n            goto NoNextAttr;\r\n        attrInfo.valLen = curr - attrInfo.val;\r\n        ++curr;\r\n    } else {\r\n        attrInfo.val = curr;\r\n        SkipNonWs(curr, end);\r\n        attrInfo.valLen = curr - attrInfo.val;\r\n    }\r\n    nextAttr = curr;\r\n    return &attrInfo;\r\n}\r\n\r\n// Given a tag like e.g.:\r\n// <tag attr=\">\" />\r\n// tries to find the closing '>' and not be confused by '>' that\r\n// are part of attribute value. We're not very strict here\r\n// Returns false if didn't find\r\nstatic bool SkipUntilTagEnd(const char*& s, const char *end)\r\n{\r\n    while (s < end) {\r\n        char c = *s++;\r\n        if ('>' == c) {\r\n            --s;\r\n            return true;\r\n        }\r\n        if (('\\'' == c) || ('\"' == c)) {\r\n            if (!SkipUntil(s, end, c))\r\n                return false;\r\n            ++s;\r\n        }\r\n    }\r\n    return false;\r\n}\r\n\r\n// Returns next part of html or nullptr if finished\r\nHtmlToken *HtmlPullParser::Next()\r\n{\r\n    if (currPos >= end)\r\n        return nullptr;\r\n\r\nNext:\r\n    const char *start = currPos;\r\n    if (*currPos != '<' || currPos + 1 < end && !IsValidTagStart(*++currPos)) {\r\n        // this must be text between tags\r\n        if (!SkipUntil(currPos, end, '<') && IsSpaceOnly(start, currPos)) {\r\n            // ignore whitespace after the last tag\r\n            return nullptr;\r\n        }\r\n        currToken.SetText(start, currPos);\r\n        return &currToken;\r\n    }\r\n\r\n    // '<' - tag begins\r\n    ++start;\r\n\r\n    // skip <? and <! (processing instructions and comments)\r\n    if (start < end && (('?' == *start) || ('!' == *start))) {\r\n        if ('!' == *start && start + 2 < end && str::StartsWith(start, \"!--\")) {\r\n            currPos = start + 3;\r\n            if (!SkipUntil(currPos, end, \"-->\")) {\r\n                currToken.SetError(HtmlToken::UnclosedTag, start);\r\n                return &currToken;\r\n            }\r\n            currPos += 2;\r\n        }\r\n        else if (!SkipUntil(currPos, end, '>')) {\r\n            currToken.SetError(HtmlToken::UnclosedTag, start);\r\n            return &currToken;\r\n        }\r\n        ++currPos;\r\n        goto Next;\r\n    }\r\n\r\n    if (!SkipUntilTagEnd(currPos, end)) {\r\n        currToken.SetError(HtmlToken::UnclosedTag, start);\r\n        return &currToken;\r\n    }\r\n\r\n    CrashIf('>' != *currPos);\r\n    if (currPos == start || currPos == start + 1 && *start == '/') {\r\n        // skip empty tags (</>), because we're lenient\r\n        ++currPos;\r\n        goto Next;\r\n    }\r\n\r\n    if (('/' == *start) && ('/' == currPos[-1])) { // </foo/>\r\n        currToken.SetError(HtmlToken::InvalidTag, start);\r\n    } else if ('/' == *start) { // </foo>\r\n        currToken.SetTag(HtmlToken::EndTag, start + 1, currPos);\r\n    } else if ('/' == currPos[-1]) { // <foo/>\r\n        currToken.SetTag(HtmlToken::EmptyElementTag, start, currPos - 1);\r\n    } else {\r\n        currToken.SetTag(HtmlToken::StartTag, start, currPos);\r\n    }\r\n    ++currPos;\r\n    return &currToken;\r\n}\r\n"
  },
  {
    "path": "src/utils/HtmlPullParser.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nstruct AttrInfo {\r\n    const char *      name;\r\n    size_t            nameLen;\r\n    const char *      val;\r\n    size_t            valLen;\r\n\r\n    bool NameIs(const char *s) const;\r\n    bool NameIsNS(const char *s, const char *ns) const;\r\n    bool ValIs(const char *s) const;\r\n};\r\n\r\n// TrivialHtmlParser needs to enumerate all attributes of an HtmlToken\r\nclass HtmlParser;\r\n\r\nstruct HtmlToken {\r\n    friend HtmlParser;\r\n\r\n    enum TokenType {\r\n        StartTag,           // <foo>\r\n        EndTag,             // </foo>\r\n        EmptyElementTag,    // <foo/>\r\n        Text,               // <foo>text</foo> => \"text\"\r\n        Error\r\n    };\r\n\r\n    enum ParsingError {\r\n        ExpectedElement,\r\n        UnclosedTag,\r\n        InvalidTag\r\n    };\r\n\r\n    bool IsStartTag() const { return type == StartTag; }\r\n    bool IsEndTag() const { return type == EndTag; }\r\n    bool IsEmptyElementEndTag() const { return type == EmptyElementTag; }\r\n    bool IsTag() const { return IsStartTag() || IsEndTag() || IsEmptyElementEndTag(); }\r\n    bool IsText() const { return type == Text; }\r\n    bool IsError() const { return type == Error; }\r\n\r\n    const char *GetReparsePoint() const;\r\n    void SetTag(TokenType new_type, const char *new_s, const char *end);\r\n    void SetError(ParsingError err, const char *errContext);\r\n    void SetText(const char *new_s, const char *end);\r\n\r\n    TokenType        type;\r\n    ParsingError     error;\r\n    const char *     s;\r\n    size_t           sLen;\r\n\r\n    // only for tags: type and name length\r\n    HtmlTag          tag;\r\n    size_t           nLen;\r\n\r\n    bool             NameIs(const char *name) const;\r\n    bool             NameIsNS(const char *name, const char *ns) const;\r\n    AttrInfo *       GetAttrByName(const char *name);\r\n    AttrInfo *       GetAttrByNameNS(const char *name, const char *attrNS);\r\n\r\nprotected:\r\n    AttrInfo *       NextAttr();\r\n    const char *     nextAttr;\r\n    AttrInfo         attrInfo;\r\n};\r\n\r\n/* A very simple pull html parser. Call Next() to get the next HtmlToken,\r\nwhich can be one one of 3 tag types or error. If a tag has attributes,\r\nthe caller has to parse them out (using HtmlToken::NextAttr()) */\r\nclass HtmlPullParser {\r\n    const char *   currPos;\r\n    const char *   end;\r\n\r\n    const char *   start;\r\n    size_t         len;\r\n\r\n    HtmlToken      currToken;\r\n\r\npublic:\r\n    HtmlPullParser(const char *s, size_t len) : currPos(s), end(s + len), start(s), len(len) { }\r\n    HtmlPullParser(const char *s, const char *end) : currPos(s), end(end), start(s), len(end - s) { }\r\n\r\n    void         SetCurrPosOff(ptrdiff_t off) { currPos = start + off; }\r\n    size_t       Len()   const { return len;   }\r\n    const char * Start() const { return start; }\r\n\r\n    HtmlToken *  Next();\r\n};\r\n\r\nbool        SkipWs(const char*& s, const char *end);\r\nbool        SkipNonWs(const char*& s, const char *end);\r\nbool        SkipUntil(const char*& s, const char *end, char c);\r\nbool        SkipUntil(const char*& s, const char *end, char *term);\r\nbool        IsSpaceOnly(const char *s, const char *end);\r\n\r\nint         HtmlEntityNameToRune(const char *name, size_t nameLen);\r\nint         HtmlEntityNameToRune(const WCHAR *name, size_t nameLen);\r\n\r\nconst char *ResolveHtmlEntity(const char *s, size_t len, int& rune);\r\nconst char *ResolveHtmlEntities(const char *s, const char *end, Allocator *alloc);\r\nchar *      ResolveHtmlEntities(const char *s, size_t len);\r\n"
  },
  {
    "path": "src/utils/HtmlWindow.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"HtmlWindow.h\"\r\n#include <mshtml.h>\r\n#include <mshtmhst.h>\r\n#include <oaidl.h>\r\n#include <exdispid.h>\r\n#include <wininet.h>\r\n#include \"Timer.h\"\r\n#include \"WinUtil.h\"\r\n#include \"GdiPlusUtil.h\"\r\n\r\n// An important (to Sumatra) use case is displaying CHM documents. First we used\r\n// IE's built-in support form CHM documents (using its: protocol http://msdn.microsoft.com/en-us/library/aa164814(v=office.10).aspx).\r\n// However, that doesn't work for CHM documents from network drives (http://code.google.com/p/sumatrapdf/issues/detail?id=1706)\r\n// To solve that we ended up the following solution:\r\n// * an app can provide html as data in memory. We write the data using custom\r\n//   IMoniker implementation with IE's IPersistentMoniker::Load() function.\r\n//   This allows us to provide base url which will be used to resolve relative\r\n//   links within the html (e.g. to embedded images in <img> tags etc.)\r\n// * We register application-global protocol handler and provide custom IInternetProtocol\r\n//   implementation which is called to handle getting content for URLs in that namespace.\r\n//   I've decided to over-ride its: protocol for our needs. A protocol unique to our\r\n//   code would be better, but completely new protocol don't seem to work with\r\n//   IPersistentMoniker::Load() code (I can see our IMoniker::GetDisplayName() (which\r\n//   returns the base url) called twice from mshtml/ieframe code but if the returned\r\n//   base url doesn't start with protocol that IE already understands, IPersistentMoniker::Load()\r\n//   fails) so I was forced to over-ride existing protocol name.\r\n//\r\n// I also tried the approach of implementing IInternetSecurityManager thinking that I can just\r\n// use built-in its: handling and tell IE to trust those links, but it seems that in case\r\n// of its: links for CHM files from network drives, that code isn't even reached.\r\n\r\n// Implementing scrolling:\r\n// Currently we implement scrolling by sending messages simulating user input\r\n// to the browser control window that is responsible for processing those messages.\r\n// It has a benefit of being simple to implement and matching ie's behavior closely.\r\n\r\n// Another option would be to provide scrolling functions to be called by callers\r\n// (e.g. from FrameOnKeydow()) by querying scroll state from IHTMLElement2 and setting\r\n// a new scroll state http://www.codeproject.com/KB/miscctrl/scrollbrowser.aspx\r\n// or using scrollTo() or scrollBy() on IHTMLWindow2:\r\n// http://msdn.microsoft.com/en-us/library/aa741497(v=VS.85).aspx\r\n\r\n// The more advanced ways of interacting with mshtml/ieframe are extremely poorly\r\n// documented so I mostly puzzled it out based on existing open source code that\r\n// does similar things. Some useful resources:\r\n\r\n// Book on ATL: http://369o.com/data/books/atl/index.html, which is\r\n// helpful in understanding basics of COM, has chapter on basics of embedding IE.\r\n\r\n// http://www.codeproject.com/KB/COM/cwebpage.aspx\r\n\r\n// This code is structured in a similar way as wxWindows'\r\n// browser wrapper\r\n// https://github.com/Aegisub/traydict/blob/master/IEHtmlWin.h\r\n// https://github.com/Aegisub/traydict/blob/master/IEHtmlWin.cpp\r\n\r\n// Info about IInternetProtocol: http://www.codeproject.com/KB/IP/DataProtocol.aspx\r\n\r\n// All the ways to load html into mshtml:\r\n// http://qualapps.blogspot.com/2008/10/how-to-load-mshtml-with-data.html\r\n\r\n// how to handle custom protocol like myapp://\r\n// http://www.nuonsoft.com/blog/2010/04/05/how-to-handle-custom-url-protocols-with-the-microsoft-webbrowser-control/\r\n// http://www.nuonsoft.com/blog/2010/04/05/how-to-navigate-to-an-anchor-in-the-microsoft-webbrowser-control-when-rendering-html-from-memory/\r\n// http://www.nuonsoft.com/blog/2010/03/24/how-to-use-the-microsoft-webbrowser-control-to-render-html-from-memory/\r\n\r\n// http://geekswithblogs.net/dotnetnomad/archive/2008/01/29/119065.aspx\r\n\r\n// Other code that does advanced things with embedding IE or providing it with non-trivial\r\n// interfaces:\r\n// http://osh.codeplex.com/\r\n// http://code.google.com/p/atc32/source/browse/trunk/WorldWindProject/lib-external/webview/windows/\r\n// http://code.google.com/p/fidolook/source/browse/trunk/Qm/ui/messageviewwindow.cpp\r\n// http://code.google.com/p/csexwb2/\r\n// chrome frame: http://codesearch.google.com/#wZuuyuB8jKQ/chromium/src/chrome_frame/chrome_protocol.h\r\n// gears: http://code.google.com/p/gears/\r\n// http://code.google.com/p/fictionbookeditor/\r\n// http://code.google.com/p/easymule/\r\n// http://code.google.com/p/svnprotocolhandler/ (IInternetProtocolInfo implementation)\r\n// https://github.com/facebook/ie-toolbar (also IInternetProtocolInfo implementation)\r\n// http://code.google.com/p/veryie/\r\n// http://www.codeproject.com/Articles/3365/Embed-an-HTML-control-in-your-own-window-using-pla\r\n// http://www.codeproject.com/Articles/642/Processing-HTML-Forms-From-a-CHtmlView\r\n// https://github.com/salsita/ProtocolLibrary\r\n// https://github.com/salsita/libbhohelper\r\n// https://github.com/salsita/libprothandlers\r\n// http://www.codeproject.com/Articles/1094/The-MFC-CDHtmlDialog-class#xx568889xx\r\n// http://www.codeproject.com/Articles/642/Processing-HTML-Forms-From-a-CHtmlView\r\n// http://www.codeproject.com/Articles/10401/Handling-HTML-Element-Events-in-CHtmlView-and-Reus\r\n// http://www.codeproject.com/Articles/3919/Using-the-WebBrowser-control-simplified\r\n\r\n// https://groups.google.com/forum/#!topic/microsoft.public.inetsdk.programming.mshtml_hosting/jogeNC4NXzU\r\n// https://blog.javascripting.com/2012/11/07/igor-tandetniks-passthrough-app-now-on-github/\r\n\r\n// Series of articles:\r\n// http://starkravingfinkle.org/blog/2005/04/mshtml-hosting-drawing-on-webbrowser/\r\n// http://starkravingfinkle.org/blog/2005/04/mshtml-hosting-more-tricks/\r\n// http://starkravingfinkle.org/blog/2005/02/mshtml-hosting-editing-tricks/\r\n// http://starkravingfinkle.org/blog/2005/01/mshtml-hosting-more-editing/\r\n// http://starkravingfinkle.org/blog/2004/12/mshtml-hosting-calling-javascript-from-host/\r\n// http://starkravingfinkle.org/blog/2004/10/mshtml-hosting-editing/\r\n// http://starkravingfinkle.org/blog/2004/10/mshtml-hosting-idochostuihandler/\r\n// http://starkravingfinkle.org/blog/2004/09/mshtml-hosting-odds-ends/\r\n// http://starkravingfinkle.org/blog/2004/09/mshtml-hosting-building-uis/\r\n// http://starkravingfinkle.org/blog/2004/08/mshtml-hosting-the-basics/\r\n\r\nclass HW_IOleInPlaceFrame;\r\nclass HW_IOleInPlaceSiteWindowless;\r\nclass HW_IOleClientSite;\r\nclass HW_IOleControlSite;\r\nclass HW_IOleCommandTarget;\r\nclass HW_IOleItemContainer;\r\nclass HW_DWebBrowserEvents2;\r\nclass HW_IAdviseSink2;\r\nclass HW_IDocHostUIHandler;\r\nclass HW_IDropTarget;\r\nclass HW_IServiceProvider;\r\n\r\ninline void VariantSetBool(VARIANT *res, bool val)\r\n{\r\n    res->vt = VT_BOOL;\r\n    res->boolVal = val ? VARIANT_TRUE : VARIANT_FALSE;\r\n}\r\n\r\ninline void VariantSetLong(VARIANT *res, long val)\r\n{\r\n    res->vt = VT_I4;\r\n    res->lVal = val;\r\n}\r\n\r\nbool IsBlankUrl(const WCHAR *url)\r\n{\r\n    return str::EqI(L\"about:blank\", url);\r\n}\r\n\r\n// HW stands for HtmlWindow\r\n// FrameSite ties together HtmlWindow and all the COM interfaces we need to implement\r\n// to support it\r\nclass FrameSite : public IUnknown\r\n{\r\n    friend class HtmlWindow;\r\n    friend class HW_IOleInPlaceFrame;\r\n    friend class HW_IOleInPlaceSiteWindowless;\r\n    friend class HW_IOleClientSite;\r\n    friend class HW_IOleControlSite;\r\n    friend class HW_IOleCommandTarget;\r\n    friend class HW_IOleItemContainer;\r\n    friend class HW_DWebBrowserEvents2;\r\n    friend class HW_IAdviseSink2;\r\n    friend class HW_IDocHostUIHandler;\r\n    friend class HW_IDropTarget;\r\n    friend class HW_IServiceProvider;\r\n\r\npublic:\r\n    explicit FrameSite(HtmlWindow * win);\r\n    ~FrameSite();\r\n\r\n    // IUnknown\r\n    STDMETHODIMP QueryInterface(REFIID iid, void **ppvObject);\r\n    ULONG STDMETHODCALLTYPE AddRef() { return InterlockedIncrement(&refCount); }\r\n    ULONG STDMETHODCALLTYPE Release();\r\n\r\nprotected:\r\n    LONG refCount;\r\n\r\n    HW_IOleInPlaceFrame *           oleInPlaceFrame;\r\n    HW_IOleInPlaceSiteWindowless *  oleInPlaceSiteWindowless;\r\n    HW_IOleClientSite *             oleClientSite;\r\n    HW_IOleControlSite *            oleControlSite;\r\n    HW_IOleCommandTarget *          oleCommandTarget;\r\n    HW_IOleItemContainer *          oleItemContainer;\r\n    HW_DWebBrowserEvents2 *         hwDWebBrowserEvents2;\r\n    HW_IAdviseSink2 *               adviseSink2;\r\n    HW_IDocHostUIHandler *          docHostUIHandler;\r\n    HW_IDropTarget *                dropTarget;\r\n    HW_IServiceProvider *           serviceProvider;\r\n\r\n    HtmlWindow * htmlWindow;\r\n\r\n    //HDC m_hDCBuffer;\r\n    HWND hwndParent;\r\n\r\n    bool supportsWindowlessActivation;\r\n    bool inPlaceLocked;\r\n    bool inPlaceActive;\r\n    bool uiActive;\r\n    bool isWindowless;\r\n\r\n    LCID        ambientLocale;\r\n    COLORREF    ambientForeColor;\r\n    COLORREF    ambientBackColor;\r\n    bool        ambientShowHatching;\r\n    bool        ambientShowGrabHandles;\r\n    bool        ambientUserMode;\r\n    bool        ambientAppearance;\r\n};\r\n\r\n// For simplicity, we just add to the array. We don't bother\r\n// reclaiming ids for deleted windows. I don't expect number\r\n// of HtmlWindow objects created to be so high as to be problematic\r\n// (1 thousand objects is just 4K of memory for the vector)\r\nstatic Vec<HtmlWindow*> gHtmlWindows;\r\n\r\nHtmlWindow *FindHtmlWindowById(int windowId)\r\n{\r\n    return gHtmlWindows.At(windowId);\r\n}\r\n\r\nstatic int GenNewWindowId(HtmlWindow *htmlWin)\r\n{\r\n    int newWindowId = (int)gHtmlWindows.Count();\r\n    gHtmlWindows.Append(htmlWin);\r\n    assert(htmlWin == FindHtmlWindowById(newWindowId));\r\n    return newWindowId;\r\n}\r\n\r\nstatic void FreeWindowId(int windowId)\r\n{\r\n    assert(nullptr != gHtmlWindows.At(windowId));\r\n    gHtmlWindows.At(windowId) = nullptr;\r\n}\r\n\r\n// Re-using its protocol, see comments at the top.\r\n#define HW_PROTO_PREFIX L\"its\"\r\n\r\n// {F1EC293F-DBBD-4A4B-94F4-FA52BA0BA6EE}\r\nstatic const GUID CLSID_HW_IInternetProtocol = { 0xf1ec293f, 0xdbbd, 0x4a4b, { 0x94, 0xf4, 0xfa, 0x52, 0xba, 0xb, 0xa6, 0xee } };\r\n\r\nclass HW_IInternetProtocolInfo : public IInternetProtocolInfo\r\n{\r\npublic:\r\n    HW_IInternetProtocolInfo() : refCount(1) { }\r\n\r\nprotected:\r\n    virtual ~HW_IInternetProtocolInfo() { }\r\n\r\npublic:\r\n    // IUnknown\r\n    STDMETHODIMP QueryInterface(REFIID riid, void **ppvObject);\r\n    ULONG STDMETHODCALLTYPE AddRef() { return InterlockedIncrement(&refCount); }\r\n    ULONG STDMETHODCALLTYPE Release();\r\n\r\n    // IInternetProtocolInfo\r\n    STDMETHODIMP ParseUrl(LPCWSTR pwzUrl, PARSEACTION parseAction, DWORD dwParseFlags,\r\n        LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)\r\n    {\r\n        UNUSED(pwzUrl); UNUSED(parseAction); UNUSED(dwParseFlags);\r\n        UNUSED(pwzResult); UNUSED(cchResult); UNUSED(pcchResult); UNUSED(dwReserved);\r\n        return INET_E_DEFAULT_ACTION;\r\n    }\r\n\r\n    STDMETHODIMP CombineUrl(LPCWSTR pwzBaseUrl, LPCWSTR pwzRelativeUrl,\r\n        DWORD dwCombineFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult,\r\n        DWORD dwReserved)\r\n    {\r\n        UNUSED(pwzBaseUrl); UNUSED(pwzRelativeUrl);\r\n        UNUSED(dwCombineFlags); UNUSED(pwzResult); UNUSED(cchResult); UNUSED(pcchResult);\r\n        UNUSED(dwReserved);\r\n        return INET_E_DEFAULT_ACTION;\r\n    }\r\n\r\n    STDMETHODIMP CompareUrl(LPCWSTR pwzUrl1, LPCWSTR pwzUrl2, DWORD dwCompareFlags)\r\n    {\r\n        UNUSED(pwzUrl1); UNUSED(pwzUrl2); UNUSED(dwCompareFlags);\r\n        return INET_E_DEFAULT_ACTION;\r\n    }\r\n\r\n    STDMETHODIMP QueryInfo(LPCWSTR pwzUrl, QUERYOPTION queryOption, DWORD dwQueryFlags,\r\n        LPVOID pBuffer, DWORD cbBuffer, DWORD *pcbBuf, DWORD dwReserved)\r\n    {\r\n        UNUSED(pwzUrl); UNUSED(queryOption); UNUSED(dwQueryFlags);\r\n        UNUSED(pBuffer); UNUSED(cbBuffer); UNUSED(pcbBuf); UNUSED(dwReserved);\r\n        return INET_E_DEFAULT_ACTION;\r\n    }\r\n\r\nprotected:\r\n    LONG refCount;\r\n};\r\n\r\nULONG STDMETHODCALLTYPE HW_IInternetProtocolInfo::Release()\r\n{\r\n    LONG res = InterlockedDecrement(&refCount);\r\n    CrashIf(res < 0);\r\n    if (0 == res)\r\n        delete this;\r\n    return res;\r\n}\r\n\r\nSTDMETHODIMP HW_IInternetProtocolInfo::QueryInterface(REFIID riid, void **ppv)\r\n{\r\n    static const QITAB qit[] = {\r\n        QITABENT(HW_IInternetProtocolInfo, IInternetProtocolInfo),\r\n        { 0 }\r\n    };\r\n    return QISearch(this, qit, riid, ppv);\r\n}\r\n\r\nclass HW_IInternetProtocol :public IInternetProtocol\r\n{\r\npublic:\r\n    HW_IInternetProtocol() : refCount(1), data(nullptr), dataLen(0), dataCurrPos(0) { }\r\n\r\nprotected:\r\n    virtual ~HW_IInternetProtocol() { }\r\n\r\npublic:\r\n    // IUnknown\r\n    STDMETHODIMP QueryInterface(REFIID riid, void **ppvObject);\r\n    ULONG STDMETHODCALLTYPE AddRef() { return InterlockedIncrement(&refCount); }\r\n    ULONG STDMETHODCALLTYPE Release();\r\n\r\n    // IInternetProtocol\r\n    STDMETHODIMP Start(\r\n            LPCWSTR szUrl,\r\n            IInternetProtocolSink *pIProtSink,\r\n            IInternetBindInfo *pIBindInfo,\r\n            DWORD grfSTI,\r\n            HANDLE_PTR dwReserved);\r\n    STDMETHODIMP Continue(PROTOCOLDATA *pStateInfo) { UNUSED(pStateInfo); return S_OK; }\r\n    STDMETHODIMP Abort(HRESULT hrReason, DWORD dwOptions) { UNUSED(hrReason); UNUSED(dwOptions); return S_OK; }\r\n    STDMETHODIMP Terminate(DWORD dwOptions) { UNUSED(dwOptions); return S_OK; }\r\n    STDMETHODIMP Suspend() { return E_NOTIMPL; }\r\n    STDMETHODIMP Resume() { return E_NOTIMPL; }\r\n    STDMETHODIMP Read(void *pv,ULONG cb,ULONG *pcbRead);\r\n    STDMETHODIMP Seek(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition);\r\n    STDMETHODIMP LockRequest(DWORD dwOptions) { UNUSED(dwOptions);  return S_OK; }\r\n    STDMETHODIMP UnlockRequest() { return S_OK; }\r\nprotected:\r\n    LONG refCount;\r\n\r\n    // those are filled in Start() and represent data to be sent\r\n    // for a given url\r\n    const unsigned char *data;\r\n    size_t dataLen;\r\n    size_t dataCurrPos;\r\n};\r\n\r\nULONG STDMETHODCALLTYPE HW_IInternetProtocol::Release()\r\n{\r\n    LONG res = InterlockedDecrement(&refCount);\r\n    CrashIf(res < 0);\r\n    if (0 == res)\r\n        delete this;\r\n    return res;\r\n}\r\n\r\nSTDMETHODIMP HW_IInternetProtocol::QueryInterface(REFIID riid, void **ppv)\r\n{\r\n    static const QITAB qit[] = {\r\n        QITABENT(HW_IInternetProtocol, IInternetProtocol),\r\n        QITABENT(HW_IInternetProtocol, IInternetProtocolRoot),\r\n        { 0 }\r\n    };\r\n    return QISearch(this, qit, riid, ppv);\r\n}\r\n\r\n// given url in the form \"its://$htmlWindowId/$urlRest, parses\r\n// out $htmlWindowId and $urlRest. Returns false if url doesn't conform\r\n// to this pattern.\r\nstatic bool ParseProtoUrl(const WCHAR *url, int *htmlWindowId, ScopedMem<WCHAR> *urlRest)\r\n{\r\n    const WCHAR *rest = str::Parse(url, HW_PROTO_PREFIX L\"://%d/%S\", htmlWindowId, urlRest);\r\n    return rest && !*rest;\r\n}\r\n\r\n#define DEFAULT_MIME_TYPE   L\"text/html\"\r\n\r\n// caller must free() the result\r\nstatic WCHAR *MimeFromUrl(const WCHAR *url, const WCHAR *imgExt=nullptr)\r\n{\r\n    const WCHAR *ext = str::FindCharLast(url, '.');\r\n    if (!ext)\r\n        return str::Dup(DEFAULT_MIME_TYPE);\r\n\r\n    if (str::FindChar(ext, ';')) {\r\n        // some CHM documents use (image) URLs that are followed by\r\n        // a semi-colon and a number after the file's extension\r\n        ScopedMem<WCHAR> newUrl(str::DupN(url, str::FindChar(ext, ';') - url));\r\n        return MimeFromUrl(newUrl, imgExt);\r\n    }\r\n\r\n    static const struct {\r\n        const WCHAR *ext;\r\n        const WCHAR *mimetype;\r\n    } mimeTypes[] = {\r\n        { L\".html\",  L\"text/html\" },\r\n        { L\".htm\",   L\"text/html\" },\r\n        { L\".gif\",   L\"image/gif\" },\r\n        { L\".png\",   L\"image/png\" },\r\n        { L\".jpg\",   L\"image/jpeg\" },\r\n        { L\".jpeg\",  L\"image/jpeg\" },\r\n        { L\".bmp\",   L\"image/bmp\" },\r\n        { L\".css\",   L\"text/css\" },\r\n        { L\".txt\",   L\"text/plain\" },\r\n    };\r\n\r\n    for (int i = 0; i < dimof(mimeTypes); i++) {\r\n        if (str::EqI(ext, mimeTypes[i].ext)) {\r\n            // trust an image's data more than its extension\r\n            if (imgExt && !str::Eq(imgExt, mimeTypes[i].ext) &&\r\n                str::StartsWith(mimeTypes[i].mimetype, L\"image/\")) {\r\n                for (int j = 0; j < dimof(mimeTypes); j++) {\r\n                    if (str::Eq(imgExt, mimeTypes[j].ext))\r\n                        return str::Dup(mimeTypes[j].mimetype);\r\n                }\r\n            }\r\n            return str::Dup(mimeTypes[i].mimetype);\r\n        }\r\n    }\r\n\r\n    ScopedMem<WCHAR> contentType(ReadRegStr(HKEY_CLASSES_ROOT, ext, L\"Content Type\"));\r\n    if (contentType)\r\n        return contentType.StealData();\r\n\r\n    return str::Dup(DEFAULT_MIME_TYPE);\r\n}\r\n\r\n// TODO: return an error page html in case of errors?\r\nSTDMETHODIMP HW_IInternetProtocol::Start(\r\n    LPCWSTR szUrl, IInternetProtocolSink *pIProtSink, IInternetBindInfo *pIBindInfo,\r\n    DWORD grfSTI, HANDLE_PTR dwReserved)\r\n{\r\n    UNUSED(pIBindInfo); UNUSED(grfSTI); UNUSED(dwReserved);\r\n    // TODO: others seem to return S_OK even if there is no content\r\n    //       for a URL (unless the PI_PARSE_URL bit is set on grfSTI),\r\n    //       this does however lead to this HW_IInternetProtocol being\r\n    //       leaked and to DISPID_DOCUMENTCOMPLETE never being fired\r\n\r\n    int htmlWindowId;\r\n    ScopedMem<WCHAR> urlRest;\r\n    bool ok = ParseProtoUrl(szUrl, &htmlWindowId, &urlRest);\r\n    if (!ok)\r\n        return INET_E_INVALID_URL;\r\n\r\n    pIProtSink->ReportProgress(BINDSTATUS_FINDINGRESOURCE, urlRest);\r\n    pIProtSink->ReportProgress(BINDSTATUS_CONNECTING, urlRest);\r\n    pIProtSink->ReportProgress(BINDSTATUS_SENDINGREQUEST, urlRest);\r\n\r\n    HtmlWindow *win = FindHtmlWindowById(htmlWindowId);\r\n    //TODO: this now happens due to events happening on HtmlWindow\r\n    //used to take a screenshot, so ignore it. Is there a way\r\n    //to cancel things and not get her?\r\n    //assert(win);\r\n    if (!win)\r\n        return INET_E_OBJECT_NOT_FOUND;\r\n    if (!win->htmlWinCb)\r\n        return INET_E_OBJECT_NOT_FOUND;\r\n    data = win->htmlWinCb->GetDataForUrl(urlRest, &dataLen);\r\n    if (!data)\r\n        return INET_E_DATA_NOT_AVAILABLE;\r\n\r\n    const WCHAR *imgExt = GfxFileExtFromData((const char *)data, dataLen);\r\n    ScopedMem<WCHAR> mime(MimeFromUrl(urlRest, imgExt));\r\n    pIProtSink->ReportProgress(BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE, mime);\r\n#ifdef _WIN64\r\n    // not going to report data in parts for unexpectedly huge webpages\r\n    CrashIf(dataLen > ULONG_MAX);\r\n#endif\r\n    pIProtSink->ReportData(BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION | BSCF_DATAFULLYAVAILABLE, (ULONG)dataLen, (ULONG)dataLen);\r\n    pIProtSink->ReportResult(S_OK, 200, nullptr);\r\n    return S_OK;\r\n}\r\n\r\nSTDMETHODIMP HW_IInternetProtocol::Read(void *pv, ULONG cb, ULONG *pcbRead)\r\n{\r\n    if (!data)\r\n        return S_FALSE;\r\n    size_t dataAvail = dataLen - dataCurrPos;\r\n    if (0 == dataAvail)\r\n        return S_FALSE;\r\n    ULONG toRead = cb;\r\n    if (toRead > dataAvail)\r\n        toRead = (ULONG)dataAvail;\r\n    const unsigned char *dataToRead = data + dataCurrPos;\r\n    memcpy(pv, dataToRead, toRead);\r\n    dataCurrPos += toRead;\r\n    *pcbRead = toRead;\r\n    return S_OK;\r\n}\r\n\r\nSTDMETHODIMP HW_IInternetProtocol::Seek(\r\n    LARGE_INTEGER /*dlibMove*/,\r\n    DWORD /*dwOrigin*/,\r\n    ULARGE_INTEGER * /*plibNewPosition*/)\r\n{\r\n    // doesn't seem to be called\r\n    return E_NOTIMPL;\r\n}\r\n\r\nclass HW_IInternetProtocolFactory : public IClassFactory\r\n{\r\nprotected:\r\n    virtual ~HW_IInternetProtocolFactory() { }\r\n\r\npublic:\r\n    HW_IInternetProtocolFactory() : refCount(1) { }\r\n\r\n    // IUnknown\r\n    STDMETHODIMP QueryInterface(REFIID riid, void **ppvObject);\r\n    ULONG STDMETHODCALLTYPE AddRef() { return InterlockedIncrement(&refCount); }\r\n    ULONG STDMETHODCALLTYPE Release();\r\n\r\n    // IClassFactory\r\n    STDMETHODIMP CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppvObject);\r\n    STDMETHODIMP LockServer(BOOL fLock) { UNUSED(fLock); return S_OK; }\r\n\r\nprotected:\r\n    LONG refCount;\r\n};\r\n\r\nSTDMETHODIMP_(ULONG) HW_IInternetProtocolFactory::Release()\r\n{\r\n    LONG res = InterlockedDecrement(&refCount);\r\n    CrashIf(res < 0);\r\n    if (0 == res)\r\n        delete this;\r\n    return res;\r\n}\r\n\r\nSTDMETHODIMP HW_IInternetProtocolFactory::QueryInterface(REFIID riid, void **ppv)\r\n{\r\n    static const QITAB qit[] = {\r\n        QITABENT(HW_IInternetProtocolFactory, IClassFactory),\r\n        { 0 }\r\n    };\r\n    return QISearch(this, qit, riid, ppv);\r\n}\r\n\r\nSTDMETHODIMP HW_IInternetProtocolFactory::CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppvObject)\r\n{\r\n    if (pUnkOuter != nullptr)\r\n        return CLASS_E_NOAGGREGATION;\r\n    if (riid == IID_IInternetProtocol) {\r\n        ScopedComPtr<IInternetProtocol> proto(new HW_IInternetProtocol());\r\n        return proto->QueryInterface(riid, ppvObject);\r\n    }\r\n    if (riid == IID_IInternetProtocolInfo) {\r\n        ScopedComPtr<IInternetProtocolInfo> proto(new HW_IInternetProtocolInfo());\r\n        return proto->QueryInterface(riid, ppvObject);\r\n    }\r\n    return E_NOINTERFACE;\r\n}\r\n\r\nstatic LONG gProtocolFactoryRefCount = 0;\r\nHW_IInternetProtocolFactory *gInternetProtocolFactory = nullptr;\r\n\r\n// Register our protocol so that urlmon will call us for every\r\n// url that starts with HW_PROTO_PREFIX\r\nstatic void RegisterInternetProtocolFactory()\r\n{\r\n    LONG val = InterlockedIncrement(&gProtocolFactoryRefCount);\r\n    if (val > 1)\r\n        return;\r\n\r\n    ScopedComPtr<IInternetSession> internetSession;\r\n    HRESULT hr = CoInternetGetSession(0, &internetSession, 0);\r\n    assert(!FAILED(hr));\r\n    assert(nullptr == gInternetProtocolFactory);\r\n    gInternetProtocolFactory = new HW_IInternetProtocolFactory();\r\n    hr = internetSession->RegisterNameSpace(gInternetProtocolFactory, CLSID_HW_IInternetProtocol, HW_PROTO_PREFIX, 0, nullptr, 0);\r\n    assert(!FAILED(hr));\r\n}\r\n\r\nstatic void UnregisterInternetProtocolFactory()\r\n{\r\n    LONG val = InterlockedDecrement(&gProtocolFactoryRefCount);\r\n    if (val > 0)\r\n        return;\r\n    ScopedComPtr<IInternetSession> internetSession;\r\n    HRESULT hr = CoInternetGetSession(0, &internetSession, 0);\r\n    CrashIf(FAILED(hr));\r\n    internetSession->UnregisterNameSpace(gInternetProtocolFactory, HW_PROTO_PREFIX);\r\n    ULONG refCount = gInternetProtocolFactory->Release();\r\n    CrashIf(refCount != 0);\r\n    gInternetProtocolFactory = nullptr;\r\n}\r\n\r\nclass HW_IOleInPlaceFrame : public IOleInPlaceFrame\r\n{\r\npublic:\r\n    explicit HW_IOleInPlaceFrame(FrameSite* fs) : fs(fs)\r\n    {\r\n    }\r\n    ~HW_IOleInPlaceFrame() {}\r\n\r\n    // IUnknown\r\n    STDMETHODIMP QueryInterface(REFIID iid, void ** ppvObject) { return fs->QueryInterface(iid, ppvObject); }\r\n    ULONG STDMETHODCALLTYPE AddRef() { return fs->AddRef(); }\r\n    ULONG STDMETHODCALLTYPE Release() { return fs->Release(); }\r\n\r\n    // IOleWindow\r\n    STDMETHODIMP GetWindow(HWND*);\r\n    STDMETHODIMP ContextSensitiveHelp(BOOL) { return S_OK; }\r\n\r\n    // IOleInPlaceUIWindow\r\n    STDMETHODIMP GetBorder(LPRECT);\r\n    STDMETHODIMP RequestBorderSpace(LPCBORDERWIDTHS);\r\n    STDMETHODIMP SetBorderSpace(LPCBORDERWIDTHS) { return S_OK; }\r\n    STDMETHODIMP SetActiveObject(IOleInPlaceActiveObject*, LPCOLESTR) { return S_OK; }\r\n\r\n    // IOleInPlaceFrame\r\n    STDMETHODIMP InsertMenus(HMENU, LPOLEMENUGROUPWIDTHS) { return S_OK; }\r\n    STDMETHODIMP SetMenu(HMENU, HOLEMENU, HWND) { return S_OK; }\r\n    STDMETHODIMP RemoveMenus(HMENU) { return S_OK; }\r\n    STDMETHODIMP SetStatusText(LPCOLESTR) { return S_OK; }\r\n    STDMETHODIMP EnableModeless(BOOL) { return S_OK; }\r\n    STDMETHODIMP TranslateAccelerator(LPMSG, WORD) { return E_NOTIMPL; }\r\nprotected:\r\n    FrameSite * fs;\r\n};\r\n\r\nclass HW_IOleInPlaceSiteWindowless : public IOleInPlaceSiteWindowless\r\n{\r\npublic:\r\n    explicit HW_IOleInPlaceSiteWindowless(FrameSite* fs) : fs(fs) { }\r\n    ~HW_IOleInPlaceSiteWindowless() {}\r\n\r\n    // IUnknown\r\n    STDMETHODIMP QueryInterface(REFIID iid, void ** ppvObject) { return fs->QueryInterface(iid, ppvObject); }\r\n    ULONG STDMETHODCALLTYPE AddRef() { return fs->AddRef(); }\r\n    ULONG STDMETHODCALLTYPE Release() { return fs->Release(); }\r\n\r\n    // IOleWindow\r\n    STDMETHODIMP GetWindow(HWND* h)\r\n    { return fs->oleInPlaceFrame->GetWindow(h); }\r\n    STDMETHODIMP ContextSensitiveHelp(BOOL b)\r\n    { return fs->oleInPlaceFrame->ContextSensitiveHelp(b); }\r\n\r\n    // IOleInPlaceSite\r\n    STDMETHODIMP CanInPlaceActivate() { return S_OK; }\r\n    STDMETHODIMP OnInPlaceActivate();\r\n    STDMETHODIMP OnUIActivate();\r\n    STDMETHODIMP GetWindowContext(IOleInPlaceFrame**, IOleInPlaceUIWindow**,\r\n            LPRECT, LPRECT, LPOLEINPLACEFRAMEINFO);\r\n    STDMETHODIMP Scroll(SIZE) { return S_OK; }\r\n    STDMETHODIMP OnUIDeactivate(BOOL);\r\n    STDMETHODIMP OnInPlaceDeactivate();\r\n    STDMETHODIMP DiscardUndoState() { return S_OK; }\r\n    STDMETHODIMP DeactivateAndUndo() { return S_OK; }\r\n    STDMETHODIMP OnPosRectChange(LPCRECT) { return S_OK; }\r\n\r\n    // IOleInPlaceSiteEx\r\n    STDMETHODIMP OnInPlaceActivateEx(BOOL*, DWORD);\r\n    STDMETHODIMP OnInPlaceDeactivateEx(BOOL) { return S_OK; }\r\n    STDMETHODIMP RequestUIActivate() { return S_FALSE; }\r\n\r\n    // IOleInPlaceSiteWindowless\r\n    STDMETHODIMP CanWindowlessActivate();\r\n    STDMETHODIMP GetCapture() { return S_FALSE; }\r\n    STDMETHODIMP SetCapture(BOOL) { return S_FALSE; }\r\n    STDMETHODIMP GetFocus() { return S_OK; }\r\n    STDMETHODIMP SetFocus(BOOL) { return S_OK; }\r\n    STDMETHODIMP GetDC(LPCRECT, DWORD, HDC*);\r\n    STDMETHODIMP ReleaseDC(HDC) { return E_NOTIMPL; }\r\n    STDMETHODIMP InvalidateRect(LPCRECT, BOOL);\r\n    STDMETHODIMP InvalidateRgn(HRGN, BOOL) { return E_NOTIMPL; }\r\n    STDMETHODIMP ScrollRect(INT, INT, LPCRECT, LPCRECT) { return E_NOTIMPL; }\r\n    STDMETHODIMP AdjustRect(LPRECT) { return E_NOTIMPL; }\r\n    STDMETHODIMP OnDefWindowMessage(UINT, WPARAM, LPARAM, LRESULT*) { return E_NOTIMPL; }\r\nprotected:\r\n    FrameSite *fs;\r\n};\r\n\r\nclass HW_IOleClientSite : public IOleClientSite\r\n{\r\npublic:\r\n    explicit HW_IOleClientSite(FrameSite* fs) : fs(fs) { }\r\n    ~HW_IOleClientSite() {}\r\n\r\n    // IUnknown\r\n    STDMETHODIMP QueryInterface(REFIID iid, void ** ppvObject) { return fs->QueryInterface(iid, ppvObject); }\r\n    ULONG STDMETHODCALLTYPE AddRef() { return fs->AddRef(); }\r\n    ULONG STDMETHODCALLTYPE Release() { return fs->Release(); }\r\n\r\n    // IOleClientSite\r\n    STDMETHODIMP SaveObject() { return S_OK; }\r\n    STDMETHODIMP GetMoniker(DWORD, DWORD, IMoniker**) { return E_NOTIMPL; }\r\n    STDMETHODIMP GetContainer(LPOLECONTAINER FAR*);\r\n    STDMETHODIMP ShowObject() { return S_OK; }\r\n    STDMETHODIMP OnShowWindow(BOOL) { return S_OK; }\r\n    STDMETHODIMP RequestNewObjectLayout() { return E_NOTIMPL; }\r\nprotected:\r\n    FrameSite * fs;\r\n};\r\n\r\nclass HW_IOleControlSite : public IOleControlSite\r\n{\r\npublic:\r\n    explicit HW_IOleControlSite(FrameSite* fs) : fs(fs) { }\r\n    ~HW_IOleControlSite() {}\r\n\r\n    // IUnknown\r\n    STDMETHODIMP QueryInterface(REFIID iid, void ** ppvObject) { return fs->QueryInterface(iid, ppvObject); }\r\n    ULONG STDMETHODCALLTYPE AddRef() { return fs->AddRef(); }\r\n    ULONG STDMETHODCALLTYPE Release() { return fs->Release(); }\r\n\r\n    // IOleControlSite\r\n    STDMETHODIMP OnControlInfoChanged() { return S_OK; }\r\n    STDMETHODIMP LockInPlaceActive(BOOL);\r\n    STDMETHODIMP GetExtendedControl(IDispatch**) { return E_NOTIMPL; }\r\n    STDMETHODIMP TransformCoords(POINTL*, POINTF*, DWORD);\r\n    STDMETHODIMP TranslateAccelerator(LPMSG, DWORD) { return E_NOTIMPL; }\r\n    STDMETHODIMP OnFocus(BOOL) { return S_OK; }\r\n    STDMETHODIMP ShowPropertyFrame() { return E_NOTIMPL; }\r\nprotected:\r\n    FrameSite * fs;\r\n};\r\n\r\nclass HW_IOleCommandTarget : public IOleCommandTarget\r\n{\r\npublic:\r\n    explicit HW_IOleCommandTarget(FrameSite* fs) : fs(fs) { }\r\n    ~HW_IOleCommandTarget() {}\r\n\r\n    // IUnknown\r\n    STDMETHODIMP QueryInterface(REFIID iid, void ** ppvObject) { return fs->QueryInterface(iid, ppvObject); }\r\n    ULONG STDMETHODCALLTYPE AddRef() { return fs->AddRef(); }\r\n    ULONG STDMETHODCALLTYPE Release() { return fs->Release(); }\r\n\r\n    // IOleCommandTarget\r\n    STDMETHODIMP QueryStatus(const GUID*, ULONG, OLECMD[], OLECMDTEXT*);\r\n    STDMETHODIMP Exec(const GUID*, DWORD, DWORD, VARIANTARG*, VARIANTARG*) { return OLECMDERR_E_NOTSUPPORTED; }\r\nprotected:\r\n    FrameSite * fs;\r\n};\r\n\r\nclass HW_IOleItemContainer : public IOleItemContainer\r\n{\r\npublic:\r\n    explicit HW_IOleItemContainer(FrameSite* fs) : fs(fs) { }\r\n    ~HW_IOleItemContainer() {}\r\n\r\n    // IUnknown\r\n    STDMETHODIMP QueryInterface(REFIID iid, void ** ppvObject) { return fs->QueryInterface(iid, ppvObject); }\r\n    ULONG STDMETHODCALLTYPE AddRef() { return fs->AddRef(); }\r\n    ULONG STDMETHODCALLTYPE Release() { return fs->Release(); }\r\n\r\n    // IParseDisplayName\r\n    STDMETHODIMP ParseDisplayName(IBindCtx*, LPOLESTR, ULONG*, IMoniker**) { return E_NOTIMPL; }\r\n\r\n    // IOleContainer\r\n    STDMETHODIMP EnumObjects(DWORD, IEnumUnknown**) { return E_NOTIMPL; }\r\n    STDMETHODIMP LockContainer(BOOL) { return S_OK; }\r\n\r\n    // IOleItemContainer\r\n    STDMETHODIMP GetObject(LPOLESTR, DWORD, IBindCtx*, REFIID, void**);\r\n    STDMETHODIMP GetObjectStorage(LPOLESTR, IBindCtx*, REFIID, void**);\r\n    STDMETHODIMP IsRunning(LPOLESTR);\r\nprotected:\r\n    FrameSite * fs;\r\n};\r\n\r\nclass HW_DWebBrowserEvents2 : public DWebBrowserEvents2\r\n{\r\n    FrameSite * fs;\r\n\r\n    HRESULT DispatchPropGet(DISPID dispIdMember, VARIANT *res);\r\n\r\npublic:\r\n    explicit HW_DWebBrowserEvents2(FrameSite* fs) : fs(fs) { }\r\n    ~HW_DWebBrowserEvents2() {}\r\n\r\n    // IUnknown\r\n    STDMETHODIMP QueryInterface(REFIID iid, void ** ppvObject) { return fs->QueryInterface(iid, ppvObject); }\r\n    ULONG STDMETHODCALLTYPE AddRef() { return fs->AddRef(); }\r\n    ULONG STDMETHODCALLTYPE Release() { return fs->Release(); }\r\n\r\n    // IDispatch\r\n    STDMETHODIMP GetIDsOfNames(REFIID, OLECHAR**, unsigned int, LCID, DISPID*) { return E_NOTIMPL; }\r\n    STDMETHODIMP GetTypeInfo(unsigned int, LCID, ITypeInfo**) { return E_NOTIMPL; }\r\n    STDMETHODIMP GetTypeInfoCount(unsigned int*) { return E_NOTIMPL; }\r\n    STDMETHODIMP Invoke(DISPID, REFIID, LCID, WORD, DISPPARAMS*, VARIANT*, EXCEPINFO*, UINT*);\r\n};\r\n\r\nclass HW_IAdviseSink2 : public IAdviseSink2, public IAdviseSinkEx\r\n{\r\n    FrameSite * fs;\r\n\r\npublic:\r\n    explicit HW_IAdviseSink2(FrameSite* fs) : fs(fs) { }\r\n    ~HW_IAdviseSink2() {}\r\n\r\n    // IUnknown\r\n    STDMETHODIMP QueryInterface(REFIID iid, void ** ppvObject) { return fs->QueryInterface(iid, ppvObject); }\r\n    ULONG STDMETHODCALLTYPE AddRef() { return fs->AddRef(); }\r\n    ULONG STDMETHODCALLTYPE Release() { return fs->Release(); }\r\n\r\n    // IAdviseSink\r\n    void STDMETHODCALLTYPE OnDataChange(FORMATETC*, STGMEDIUM*) { }\r\n    void STDMETHODCALLTYPE OnViewChange(DWORD, LONG) {\r\n        // redraw the control\r\n        fs->oleInPlaceSiteWindowless->InvalidateRect(nullptr, FALSE);\r\n    }\r\n    void STDMETHODCALLTYPE OnRename(IMoniker*) { }\r\n    void STDMETHODCALLTYPE OnSave() { }\r\n    void STDMETHODCALLTYPE OnClose() { }\r\n\r\n    // IAdviseSink2\r\n    void STDMETHODCALLTYPE OnLinkSrcChange(IMoniker*) { }\r\n\r\n    // IAdviseSinkEx\r\n    void STDMETHODCALLTYPE OnViewStatusChange(DWORD) { }\r\n};\r\n\r\n// http://www.popkistopki.ru/ch09b.shtml\r\nclass HW_IDocHostUIHandler : public IDocHostUIHandler\r\n{\r\n    FrameSite * fs;\r\npublic:\r\n    explicit HW_IDocHostUIHandler(FrameSite* fs) : fs(fs) { }\r\n    ~HW_IDocHostUIHandler() {}\r\n\r\n    // IUnknown\r\n    STDMETHODIMP QueryInterface(REFIID iid, void ** ppvObject) { return fs->QueryInterface(iid, ppvObject); }\r\n    ULONG STDMETHODCALLTYPE AddRef() { return fs->AddRef(); }\r\n    ULONG STDMETHODCALLTYPE Release() { return fs->Release(); }\r\n\r\n    // IDocHostUIHandler\r\n    STDMETHODIMP ShowContextMenu(DWORD dwID, POINT *ppt, IUnknown *pcmdtReserved, IDispatch *pdispReserved) {\r\n        UNUSED(dwID); UNUSED(ppt); UNUSED(pcmdtReserved); UNUSED(pdispReserved);\r\n        return S_FALSE;\r\n    }\r\n    STDMETHODIMP GetHostInfo(DOCHOSTUIINFO *pInfo);\r\n    STDMETHODIMP ShowUI(DWORD dwID, IOleInPlaceActiveObject *pActiveObject, IOleCommandTarget *pCommandTarget, IOleInPlaceFrame *pFrame, IOleInPlaceUIWindow *pDoc){\r\n        UNUSED(dwID); UNUSED(pActiveObject); UNUSED(pCommandTarget); UNUSED(pFrame); UNUSED(pDoc);\r\n        return S_FALSE; \r\n    }\r\n    STDMETHODIMP HideUI() { return E_NOTIMPL; }\r\n    STDMETHODIMP UpdateUI() { return E_NOTIMPL; }\r\n    STDMETHODIMP EnableModeless(BOOL fEnable) { UNUSED(fEnable); return E_NOTIMPL; }\r\n    STDMETHODIMP OnDocWindowActivate(BOOL fActivate) { UNUSED(fActivate); return E_NOTIMPL; }\r\n    STDMETHODIMP OnFrameWindowActivate(BOOL fActivate) { UNUSED(fActivate); return E_NOTIMPL; }\r\n    STDMETHODIMP ResizeBorder(LPCRECT prcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fRameWindow) {\r\n        UNUSED(prcBorder); UNUSED(pUIWindow); UNUSED(fRameWindow);\r\n        return E_NOTIMPL;\r\n    }\r\n    STDMETHODIMP TranslateAccelerator(LPMSG lpMsg, const GUID *pguidCmdGroup, DWORD nCmdID) {\r\n        UNUSED(lpMsg); UNUSED(pguidCmdGroup); UNUSED(nCmdID);\r\n        return S_FALSE;\r\n    }\r\n    STDMETHODIMP GetOptionKeyPath(LPOLESTR *pchKey, DWORD dw) { UNUSED(pchKey); UNUSED(dw); return S_FALSE; }\r\n    STDMETHODIMP GetDropTarget(IDropTarget *pDropTarget, IDropTarget **ppDropTarget) { \r\n        UNUSED(pDropTarget);\r\n        return fs->QueryInterface(IID_PPV_ARGS(ppDropTarget));\r\n    }\r\n    STDMETHODIMP GetExternal(IDispatch **ppDispatch) { if (ppDispatch) *ppDispatch = nullptr; return S_FALSE; }\r\n    STDMETHODIMP TranslateUrl(DWORD dwTranslate, OLECHAR *pchURLIn, OLECHAR **ppchURLOut) { \r\n        UNUSED(dwTranslate); UNUSED(pchURLIn); UNUSED(ppchURLOut);\r\n        return S_FALSE;\r\n    }\r\n    STDMETHODIMP FilterDataObject(IDataObject *pDO, IDataObject **ppDORet) {\r\n        UNUSED(pDO);\r\n        if (ppDORet) \r\n            *ppDORet = nullptr; \r\n        return S_FALSE; \r\n    }\r\n};\r\n\r\nSTDMETHODIMP HW_IDocHostUIHandler::GetHostInfo(DOCHOSTUIINFO *pInfo)\r\n{\r\n    if (!pInfo)\r\n        return S_FALSE;\r\n    pInfo->pchHostCss = nullptr;\r\n    pInfo->pchHostNS = nullptr;\r\n\r\n    // Note: I was hoping that also setting  DOCHOSTUIFLAG_SCROLL_NO\r\n    // would get rid of vertical scrollbar when not necessary, but alas it\r\n    // always removes it\r\n    pInfo->dwFlags = DOCHOSTUIFLAG_NO3DBORDER | DOCHOSTUIFLAG_NO3DOUTERBORDER;\r\n    pInfo->dwDoubleClick = DOCHOSTUIDBLCLK_DEFAULT;\r\n    return S_OK;\r\n}\r\n\r\nclass HW_IDropTarget : public IDropTarget\r\n{\r\n    FrameSite * fs;\r\npublic:\r\n    explicit HW_IDropTarget(FrameSite* fs) : fs(fs) { }\r\n    ~HW_IDropTarget() {}\r\n\r\n    // IUnknown\r\n    STDMETHODIMP QueryInterface(REFIID iid, void ** ppvObject) { return fs->QueryInterface(iid, ppvObject); }\r\n    ULONG STDMETHODCALLTYPE AddRef() { return fs->AddRef(); }\r\n    ULONG STDMETHODCALLTYPE Release() { return fs->Release(); }\r\n\r\n    STDMETHODIMP DragEnter(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) {\r\n        UNUSED(grfKeyState); UNUSED(pt);\r\n        HRESULT hr = fs->htmlWindow->OnDragEnter(pDataObj);\r\n        if (SUCCEEDED(hr))\r\n            *pdwEffect = DROPEFFECT_COPY;\r\n        return hr;\r\n    }\r\n    STDMETHODIMP DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) {\r\n        UNUSED(grfKeyState); UNUSED(pt);\r\n        *pdwEffect = DROPEFFECT_COPY;\r\n        return S_OK;\r\n    }\r\n    STDMETHODIMP DragLeave() { return S_OK; }\r\n    STDMETHODIMP Drop(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) {\r\n        UNUSED(grfKeyState); UNUSED(pt);\r\n        *pdwEffect = DROPEFFECT_COPY;\r\n        return fs->htmlWindow->OnDragDrop(pDataObj);\r\n    }\r\n};\r\n\r\n#ifndef __IDownloadManager_INTERFACE_DEFINED__\r\n#define __IDownloadManager_INTERFACE_DEFINED__\r\n\r\n#define DEFINE_GUID_STATIC(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \\\r\n    static const GUID name = { l, w1, w2, { b1, b2,  b3,  b4,  b5,  b6,  b7,  b8 } }\r\nDEFINE_GUID_STATIC(IID_IDownloadManager, 0x988934a4, 0x064b, 0x11d3, 0xbb, 0x80, 0x0, 0x10, 0x4b, 0x35, 0xe7, 0xf9);\r\n#define SID_SDownloadManager IID_IDownloadManager\r\n\r\nMIDL_INTERFACE(\"988934A4-064B-11D3-BB80-00104B35E7F9\")\r\nIDownloadManager : public IUnknown\r\n{\r\npublic:\r\n    virtual STDMETHODIMP Download(IMoniker __RPC_FAR *pmk, IBindCtx __RPC_FAR *pbc, DWORD dwBindVerb,\r\n                                  LONG grfBINDF, BINDINFO __RPC_FAR *pBindInfo, LPCOLESTR pszHeaders,\r\n                                  LPCOLESTR pszRedir, UINT uiCP) = 0;\r\n};\r\n\r\n#endif\r\n\r\nclass HW_IDownloadManager : public IDownloadManager\r\n{\r\n    LONG refCount;\r\n\r\npublic:\r\n    HW_IDownloadManager() : refCount(1) { }\r\n    ~HW_IDownloadManager() { }\r\n\r\n    // IUnknown\r\n    STDMETHODIMP QueryInterface(REFIID riid, void **ppv) {\r\n        static const QITAB qit[] = {\r\n            QITABENT(HW_IDownloadManager, IDownloadManager),\r\n            { 0 }\r\n        };\r\n        return QISearch(this, qit, riid, ppv);\r\n    }\r\n    ULONG STDMETHODCALLTYPE AddRef() {\r\n        return InterlockedIncrement(&refCount);\r\n    }\r\n    ULONG STDMETHODCALLTYPE Release() {\r\n        LONG res = InterlockedDecrement(&refCount);\r\n        CrashIf(res < 0);\r\n        if (0 == res)\r\n            delete this;\r\n        return res;\r\n    }\r\n\r\n    // IDownloadManager\r\n    STDMETHODIMP Download(IMoniker __RPC_FAR *pmk, IBindCtx __RPC_FAR *pbc, DWORD dwBindVerb,\r\n                          LONG grfBINDF, BINDINFO __RPC_FAR *pBindInfo, LPCOLESTR pszHeaders,\r\n                          LPCOLESTR pszRedir, UINT uiCP) {\r\n        UNUSED(dwBindVerb); UNUSED(grfBINDF); UNUSED(pBindInfo); UNUSED(pszHeaders); UNUSED(pszRedir); UNUSED(uiCP);\r\n        LPOLESTR urlToFile;\r\n        HRESULT hr = pmk->GetDisplayName(pbc, nullptr, &urlToFile);\r\n        if (FAILED(hr))\r\n            return hr;\r\n        // parse the URL (only internal its:// URLs are supported)\r\n        int htmlWindowId;\r\n        ScopedMem<WCHAR> urlRest;\r\n        bool ok = ParseProtoUrl(urlToFile, &htmlWindowId, &urlRest);\r\n        // free urlToFile using IMalloc::Free\r\n        IMalloc *pMalloc;\r\n        if (SUCCEEDED(CoGetMalloc(1, &pMalloc)))\r\n            pMalloc->Free(urlToFile);\r\n        else\r\n            CoTaskMemFree(urlToFile);\r\n        if (!ok)\r\n            return INET_E_INVALID_URL;\r\n        // fetch the data\r\n        HtmlWindow *win = FindHtmlWindowById(htmlWindowId);\r\n        if (!win || !win->htmlWinCb)\r\n            return INET_E_OBJECT_NOT_FOUND;\r\n        size_t len;\r\n        const unsigned char *data = win->htmlWinCb->GetDataForUrl(urlRest, &len);\r\n        if (!data)\r\n            return INET_E_DATA_NOT_AVAILABLE;\r\n        // ask the UI to let the user save the file\r\n        win->htmlWinCb->DownloadData(urlRest, data, len);\r\n        return S_OK;\r\n    }\r\n};\r\n\r\nclass HW_IServiceProvider : public IServiceProvider\r\n{\r\n    FrameSite * fs;\r\npublic:\r\n    explicit HW_IServiceProvider(FrameSite* fs) : fs(fs) { }\r\n    ~HW_IServiceProvider() {}\r\n\r\n    // IUnknown\r\n    STDMETHODIMP QueryInterface(REFIID iid, void ** ppvObject) { return fs->QueryInterface(iid, ppvObject); }\r\n    ULONG STDMETHODCALLTYPE AddRef() { return fs->AddRef(); }\r\n    ULONG STDMETHODCALLTYPE Release() { return fs->Release(); }\r\n\r\n    // IServiceProvider\r\n    STDMETHODIMP QueryService(REFGUID guidService, REFIID riid, void **ppv) {\r\n        if (guidService == SID_SDownloadManager) {\r\n            ScopedComPtr<IDownloadManager> dm(new HW_IDownloadManager());\r\n            return dm->QueryInterface(riid, ppv);\r\n        }\r\n        return E_NOINTERFACE;\r\n    }\r\n};\r\n\r\nclass HtmlMoniker : public IMoniker\r\n{\r\npublic:\r\n    HtmlMoniker();\r\n    virtual ~HtmlMoniker();\r\n\r\n    HRESULT SetHtml(const char *s, size_t len);\r\n    HRESULT SetBaseUrl(const WCHAR *baseUrl);\r\n\r\npublic:\r\n    // IUnknown\r\n    STDMETHODIMP QueryInterface(REFIID riid, void **ppvObject);\r\n    ULONG STDMETHODCALLTYPE AddRef(void);\r\n    ULONG STDMETHODCALLTYPE Release(void);\r\n\r\n    // IMoniker\r\n    STDMETHODIMP BindToStorage(IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riid, void **ppvObj);\r\n    STDMETHODIMP GetDisplayName(IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR *ppszDisplayName);\r\n    STDMETHODIMP BindToObject(IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riidResult, void **ppvResult) {\r\n        UNUSED(pbc); UNUSED(pmkToLeft); UNUSED(riidResult); UNUSED(ppvResult);\r\n        return E_NOTIMPL;\r\n    }\r\n    STDMETHODIMP Reduce(IBindCtx *pbc, DWORD dwReduceHowFar, IMoniker **ppmkToLeft, IMoniker **ppmkReduced) {\r\n        UNUSED(pbc); UNUSED(dwReduceHowFar); UNUSED(ppmkToLeft); UNUSED(ppmkReduced);\r\n        return E_NOTIMPL;\r\n    }\r\n    STDMETHODIMP ComposeWith(IMoniker *pmkRight, BOOL fOnlyIfNotGeneric, IMoniker **ppmkComposite) {\r\n        UNUSED(pmkRight); UNUSED(fOnlyIfNotGeneric); UNUSED(ppmkComposite); \r\n        return E_NOTIMPL;\r\n    }\r\n    STDMETHODIMP Enum(BOOL fForward, IEnumMoniker **ppenumMoniker) { UNUSED(fForward);  UNUSED(ppenumMoniker); return E_NOTIMPL; }\r\n    STDMETHODIMP IsEqual(IMoniker *pmkOtherMoniker) { UNUSED(pmkOtherMoniker); return E_NOTIMPL; }\r\n    STDMETHODIMP Hash(DWORD *pdwHash) { UNUSED(pdwHash);  return E_NOTIMPL;}\r\n    STDMETHODIMP IsRunning(IBindCtx *pbc, IMoniker *pmkToLeft, IMoniker *pmkNewlyRunning) {\r\n        UNUSED(pbc); UNUSED(pmkToLeft); UNUSED(pmkNewlyRunning);\r\n        return E_NOTIMPL;\r\n    }\r\n    STDMETHODIMP GetTimeOfLastChange(IBindCtx *pbc, IMoniker *pmkToLeft, FILETIME *pFileTime) { UNUSED(pbc); UNUSED(pmkToLeft); UNUSED(pFileTime); return E_NOTIMPL; }\r\n    STDMETHODIMP Inverse(IMoniker **ppmk) { UNUSED(ppmk);  return E_NOTIMPL; }\r\n    STDMETHODIMP CommonPrefixWith(IMoniker *pmkOther, IMoniker **ppmkPrefix) { UNUSED(pmkOther); UNUSED(ppmkPrefix); return E_NOTIMPL; }\r\n    STDMETHODIMP RelativePathTo(IMoniker *pmkOther, IMoniker **ppmkRelPath) { UNUSED(pmkOther); UNUSED(ppmkRelPath);  return E_NOTIMPL; }\r\n    STDMETHODIMP ParseDisplayName(IBindCtx *pbc, IMoniker *pmkToLeft,LPOLESTR pszDisplayName,\r\n        ULONG *pchEaten, IMoniker **ppmkOut);\r\n    STDMETHODIMP IsSystemMoniker(DWORD *pdwMksys) {\r\n        if (!pdwMksys)\r\n            return E_POINTER;\r\n        *pdwMksys = MKSYS_NONE;\r\n        return S_OK;\r\n    }\r\n\r\n    // IPersistStream methods\r\n    STDMETHODIMP Save(IStream *pStm, BOOL fClearDirty) { UNUSED(pStm); UNUSED(fClearDirty); return E_NOTIMPL; }\r\n    STDMETHODIMP IsDirty() { return E_NOTIMPL; }\r\n    STDMETHODIMP Load(IStream *pStm) { UNUSED(pStm);  return E_NOTIMPL; }\r\n    STDMETHODIMP GetSizeMax(ULARGE_INTEGER *pcbSize) { UNUSED(pcbSize); return E_NOTIMPL; }\r\n\r\n    // IPersist\r\n    STDMETHODIMP GetClassID(CLSID *pClassID) { UNUSED(pClassID); return E_NOTIMPL; }\r\n\r\nprivate:\r\n    LONG        refCount;\r\n\r\n    char *      htmlData;\r\n    IStream *   htmlStream;\r\n\r\n    WCHAR *     baseUrl;\r\n};\r\n\r\nHtmlMoniker::HtmlMoniker()\r\n    : refCount(1),\r\n      htmlData(nullptr),\r\n      htmlStream(nullptr),\r\n      baseUrl(nullptr)\r\n{\r\n}\r\n\r\nHtmlMoniker::~HtmlMoniker()\r\n{\r\n    if (htmlStream)\r\n        htmlStream->Release();\r\n\r\n    free(htmlData);\r\n    free(baseUrl);\r\n}\r\n\r\nHRESULT HtmlMoniker::SetHtml(const char *s, size_t len)\r\n{\r\n    free(htmlData);\r\n    htmlData = str::DupN(s, len);\r\n    if (htmlStream)\r\n        htmlStream->Release();\r\n    htmlStream = CreateStreamFromData(htmlData, len);\r\n    return S_OK;\r\n}\r\n\r\nHRESULT HtmlMoniker::SetBaseUrl(const WCHAR *newBaseUrl)\r\n{\r\n    free(baseUrl);\r\n    baseUrl = str::Dup(newBaseUrl);\r\n    return S_OK;\r\n}\r\n\r\nSTDMETHODIMP HtmlMoniker::BindToStorage(IBindCtx *pbc, IMoniker *pmkToLeft, REFIID riid, void **ppvObj)\r\n{\r\n    UNUSED(pbc); UNUSED(pmkToLeft);\r\n    LARGE_INTEGER seek = {0};\r\n    htmlStream->Seek(seek, STREAM_SEEK_SET, nullptr);\r\n    return htmlStream->QueryInterface(riid, ppvObj);\r\n}\r\n\r\nstatic LPOLESTR OleStrDup(WCHAR *s)\r\n{\r\n    size_t cb = sizeof(WCHAR) * (str::Len(s) + 1);\r\n    LPOLESTR ret = (LPOLESTR)CoTaskMemAlloc(cb);\r\n    if (ret)\r\n        memcpy(ret, s, cb);\r\n    return ret;\r\n}\r\n\r\nSTDMETHODIMP HtmlMoniker::GetDisplayName(IBindCtx *pbc, IMoniker *pmkToLeft,\r\n    LPOLESTR *ppszDisplayName)\r\n{\r\n    UNUSED(pbc); UNUSED(pmkToLeft);\r\n    if (!ppszDisplayName)\r\n        return E_POINTER;\r\n    *ppszDisplayName = OleStrDup(baseUrl ? baseUrl : L\"\");\r\n    return *ppszDisplayName ? S_OK : E_OUTOFMEMORY;\r\n}\r\n\r\nSTDMETHODIMP HtmlMoniker::ParseDisplayName(IBindCtx *pbc, IMoniker *pmkToLeft,\r\n    LPOLESTR pszDisplayName, ULONG *pchEaten, IMoniker **ppmkOut)\r\n{\r\n    UNUSED(pbc); UNUSED(pmkToLeft); UNUSED(pszDisplayName); UNUSED(pchEaten); UNUSED(ppmkOut);\r\n    return E_NOTIMPL;\r\n}\r\n\r\nSTDMETHODIMP HtmlMoniker::QueryInterface(REFIID riid, void **ppv)\r\n{\r\n    static const QITAB qit[] = {\r\n        QITABENT(HtmlMoniker, IMoniker),\r\n        QITABENT(HtmlMoniker, IPersistStream),\r\n        QITABENT(HtmlMoniker, IPersist),\r\n        { 0 }\r\n    };\r\n    return QISearch(this, qit, riid, ppv);\r\n}\r\n\r\nULONG STDMETHODCALLTYPE HtmlMoniker::AddRef()\r\n{\r\n    return InterlockedIncrement(&refCount);\r\n}\r\n\r\nULONG STDMETHODCALLTYPE HtmlMoniker::Release()\r\n{\r\n    LONG res = InterlockedDecrement(&refCount);\r\n    CrashIf(res < 0);\r\n    if (0 == res)\r\n        delete this;\r\n    return res;\r\n}\r\n\r\nstatic HWND GetBrowserControlHwnd(HWND hwndControlParent)\r\n{\r\n    // This is a fragile way to get the actual hwnd of the browser control\r\n    // that is responsible for processing keyboard messages (I believe the\r\n    // hierarchy might change depending on how the browser control is configured\r\n    // e.g. if it has status window etc.).\r\n    // But it works for us.\r\n    HWND w1 = GetWindow(hwndControlParent, GW_CHILD);\r\n    HWND w2 = GetWindow(w1, GW_CHILD);\r\n    HWND w3 = GetWindow(w2, GW_CHILD);\r\n    return w3;\r\n}\r\n\r\n// WndProc of the window that is a parent hwnd of embedded browser control.\r\nstatic LRESULT CALLBACK WndProcParent(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)\r\n{\r\n    HtmlWindow *win = (HtmlWindow*)GetWindowLongPtr(hwnd, GWLP_USERDATA);\r\n    if (!win)\r\n        return DefWindowProc(hwnd, msg, wParam, lParam);\r\n\r\n    switch (msg) {\r\n        case WM_SIZE:\r\n            if (SIZE_MINIMIZED != wParam) {\r\n                win->OnSize(SizeI(LOWORD(lParam), HIWORD(lParam)));\r\n                return 0;\r\n            }\r\n            break;\r\n\r\n        // Note: not quite sure why I need this but if we don't swallow WM_MOUSEWHEEL\r\n        // messages, we might get infinite recursion.\r\n        case WM_MOUSEWHEEL:\r\n        case WM_MOUSEHWHEEL:\r\n            return 0;\r\n\r\n        case WM_PARENTNOTIFY:\r\n            if (LOWORD(wParam) == WM_LBUTTONDOWN)\r\n                win->OnLButtonDown();\r\n            break;\r\n\r\n        case WM_DROPFILES:\r\n            return CallWindowProc(win->wndProcBrowserPrev, hwnd, msg, wParam, lParam);\r\n\r\n        case WM_VSCROLL:\r\n            win->SendMsg(msg, wParam, lParam);\r\n            return 0;\r\n    }\r\n    return DefWindowProc(hwnd, msg, wParam, lParam);\r\n}\r\n\r\nvoid HtmlWindow::SubclassHwnd()\r\n{\r\n    wndProcBrowserPrev = (WNDPROC)SetWindowLongPtr(hwndParent, GWLP_WNDPROC, (LONG_PTR)WndProcParent);\r\n    userDataBrowserPrev = SetWindowLongPtr(hwndParent, GWLP_USERDATA, (LONG_PTR)this);\r\n}\r\n\r\nvoid HtmlWindow::UnsubclassHwnd()\r\n{\r\n    if (!wndProcBrowserPrev)\r\n        return;\r\n    SetWindowLongPtr(hwndParent, GWLP_WNDPROC, (LONG_PTR)wndProcBrowserPrev);\r\n    SetWindowLongPtr(hwndParent, GWLP_USERDATA, (LONG_PTR)userDataBrowserPrev);\r\n}\r\n\r\nHtmlWindow::HtmlWindow(HWND hwndParent, HtmlWindowCallback *cb) :\r\n    hwndParent(hwndParent), webBrowser(nullptr), oleObject(nullptr),\r\n    oleInPlaceObject(nullptr), viewObject(nullptr),\r\n    connectionPoint(nullptr), htmlContent(nullptr), oleObjectHwnd(nullptr),\r\n    adviseCookie(0), htmlWinCb(cb),\r\n    wndProcBrowserPrev(nullptr), userDataBrowserPrev(0),\r\n    canGoBack(false), canGoForward(false)\r\n{\r\n    assert(hwndParent);\r\n    RegisterInternetProtocolFactory();\r\n    windowId = GenNewWindowId(this);\r\n    htmlSetInProgress = nullptr;\r\n    htmlSetInProgressUrl = nullptr;\r\n}\r\n\r\nbool HtmlWindow::CreateBrowser()\r\n{\r\n    HRESULT hr;\r\n    ScopedComPtr<IUnknown> p;\r\n    if (!p.Create(CLSID_WebBrowser)) return false;\r\n    hr = p->QueryInterface(&viewObject);\r\n    if (FAILED(hr)) return false;\r\n    hr = p->QueryInterface(&oleObject);\r\n    if (FAILED(hr)) return false;\r\n\r\n    DWORD status;\r\n    hr = oleObject->GetMiscStatus(DVASPECT_CONTENT, &status);\r\n    if (FAILED(hr)) return false;\r\n    bool setClientSiteFirst = 0 != (status & OLEMISC_SETCLIENTSITEFIRST);\r\n    bool invisibleAtRuntime = 0 != (status & OLEMISC_INVISIBLEATRUNTIME);\r\n\r\n    FrameSite *fs = new FrameSite(this);\r\n    ScopedComPtr<IUnknown> fsScope(fs);\r\n\r\n    if (setClientSiteFirst)\r\n        oleObject->SetClientSite(fs->oleClientSite);\r\n\r\n    ScopedComQIPtr<IPersistStreamInit> psInit(p);\r\n    if (psInit) {\r\n        hr = psInit->InitNew();\r\n        assert(SUCCEEDED(hr));\r\n    }\r\n\r\n    hr = p->QueryInterface(&oleInPlaceObject);\r\n    if (FAILED(hr)) return false;\r\n    hr = oleInPlaceObject->GetWindow(&oleObjectHwnd);\r\n    if (FAILED(hr)) return false;\r\n\r\n    ::SetActiveWindow(oleObjectHwnd);\r\n    RECT rc = ClientRect(hwndParent).ToRECT();\r\n\r\n    oleInPlaceObject->SetObjectRects(&rc, &rc);\r\n    if (!invisibleAtRuntime) {\r\n        hr = oleObject->DoVerb(OLEIVERB_INPLACEACTIVATE, nullptr,\r\n                fs->oleClientSite, 0, hwndParent, &rc);\r\n#if 0 // is this necessary?\r\n        hr = oleObject->DoVerb(OLEIVERB_SHOW, 0, fs->oleClientSite, 0,\r\n                hwnd, &rc);\r\n#endif\r\n    }\r\n\r\n    if (!setClientSiteFirst)\r\n        oleObject->SetClientSite(fs->oleClientSite);\r\n\r\n    hr = p->QueryInterface(&webBrowser);\r\n    if (FAILED(hr)) return false;\r\n\r\n    ScopedComQIPtr<IConnectionPointContainer> cpContainer(p);\r\n    if (!cpContainer) return false;\r\n    hr = cpContainer->FindConnectionPoint(DIID_DWebBrowserEvents2, &connectionPoint);\r\n    if (FAILED(hr)) return false;\r\n    connectionPoint->Advise(fs->hwDWebBrowserEvents2, &adviseCookie);\r\n\r\n    // TODO: disallow accessing any random url?\r\n    //webBrowser->put_Offline(VARIANT_TRUE);\r\n\r\n    webBrowser->put_MenuBar(VARIANT_FALSE);\r\n    webBrowser->put_AddressBar(VARIANT_FALSE);\r\n    webBrowser->put_StatusBar(VARIANT_FALSE);\r\n    webBrowser->put_ToolBar(VARIANT_FALSE);\r\n    webBrowser->put_Silent(VARIANT_TRUE);\r\n\r\n    webBrowser->put_RegisterAsBrowser(VARIANT_FALSE);\r\n    webBrowser->put_RegisterAsDropTarget(VARIANT_TRUE);\r\n\r\n    // TODO: do I need this anymore?\r\n    //NavigateToAboutBlank();\r\n    SubclassHwnd();\r\n\r\n    return true;\r\n}\r\n\r\nHtmlWindow *HtmlWindow::Create(HWND hwndParent, HtmlWindowCallback *cb)\r\n{\r\n    HtmlWindow *htmlWin = new HtmlWindow(hwndParent, cb);\r\n    if (!htmlWin->CreateBrowser()) {\r\n        delete htmlWin;\r\n        return nullptr;\r\n    }\r\n    return htmlWin;\r\n}\r\n\r\nHtmlWindow::~HtmlWindow()\r\n{\r\n    UnsubclassHwnd();\r\n    if (oleInPlaceObject) {\r\n        oleInPlaceObject->InPlaceDeactivate();\r\n        oleInPlaceObject->UIDeactivate();\r\n        oleInPlaceObject->Release();\r\n    }\r\n    if (connectionPoint) {\r\n        connectionPoint->Unadvise(adviseCookie);\r\n        connectionPoint->Release();\r\n    }\r\n    if (oleObject) {\r\n        oleObject->Close(OLECLOSE_NOSAVE);\r\n        oleObject->SetClientSite(nullptr);\r\n        oleObject->Release();\r\n    }\r\n\r\n    if (viewObject)\r\n        viewObject->Release();\r\n    if (htmlContent)\r\n        htmlContent->Release();\r\n    if (webBrowser) {\r\n        ULONG refCount = webBrowser->Release();\r\n        CrashIfDebugOnly(refCount != 0);\r\n    }\r\n\r\n    FreeWindowId(windowId);\r\n    UnregisterInternetProtocolFactory();\r\n    FreeHtmlSetInProgressData();\r\n}\r\n\r\nvoid HtmlWindow::OnSize(SizeI size)\r\n{\r\n    if (webBrowser) {\r\n        webBrowser->put_Width(size.dx);\r\n        webBrowser->put_Height(size.dy);\r\n    }\r\n\r\n    if (oleInPlaceObject) {\r\n        RECT r = RectI(PointI(), size).ToRECT();\r\n        oleInPlaceObject->SetObjectRects(&r, &r);\r\n    }\r\n}\r\n\r\nvoid HtmlWindow::OnLButtonDown() const\r\n{\r\n    if (htmlWinCb)\r\n        htmlWinCb->OnLButtonDown();\r\n}\r\n\r\nvoid HtmlWindow::SetVisible(bool visible)\r\n{\r\n    win::SetVisibility(hwndParent, visible);\r\n    if (webBrowser)\r\n        webBrowser->put_Visible(visible ? VARIANT_TRUE : VARIANT_FALSE);\r\n}\r\n\r\n// Use for urls for which data will be provided by HtmlWindowCallback::GetHtmlForUrl()\r\n// (will be called from OnBeforeNavigate())\r\nvoid HtmlWindow::NavigateToDataUrl(const WCHAR *url)\r\n{\r\n    ScopedMem<WCHAR> fullUrl(str::Format(L\"its://%d/%s\", windowId, url));\r\n    NavigateToUrl(fullUrl);\r\n}\r\n\r\nvoid HtmlWindow::NavigateToUrl(const WCHAR *url)\r\n{\r\n    VARIANT urlVar;\r\n    VariantInitBstr(urlVar, url);\r\n    currentURL.Set(nullptr);\r\n    webBrowser->Navigate2(&urlVar, 0, 0, 0, 0);\r\n    VariantClear(&urlVar);\r\n}\r\n\r\nvoid HtmlWindow::GoBack()\r\n{\r\n    if (webBrowser)\r\n        webBrowser->GoBack();\r\n}\r\n\r\nvoid HtmlWindow::GoForward()\r\n{\r\n    if (webBrowser)\r\n        webBrowser->GoForward();\r\n}\r\n\r\nint HtmlWindow::GetZoomPercent()\r\n{\r\n    VARIANT vtOut = { 0 };\r\n    HRESULT hr = webBrowser->ExecWB(OLECMDID_OPTICAL_ZOOM, OLECMDEXECOPT_DONTPROMPTUSER,\r\n                                    nullptr, &vtOut);\r\n    if (FAILED(hr))\r\n        return 100;\r\n    return vtOut.lVal;\r\n}\r\n\r\nvoid HtmlWindow::SetZoomPercent(int zoom)\r\n{\r\n    VARIANT vtIn = { 0 };\r\n    VARIANT vtOut = { 0 };\r\n    VariantSetLong(&vtIn, zoom);\r\n    webBrowser->ExecWB(OLECMDID_OPTICAL_ZOOM, OLECMDEXECOPT_DONTPROMPTUSER,\r\n                       &vtIn, &vtOut);\r\n}\r\n\r\nvoid HtmlWindow::PrintCurrentPage(bool showUI)\r\n{\r\n    OLECMDEXECOPT cmdexecopt = showUI ? OLECMDEXECOPT_PROMPTUSER : OLECMDEXECOPT_DONTPROMPTUSER;\r\n    webBrowser->ExecWB(OLECMDID_PRINT, cmdexecopt, nullptr, nullptr);\r\n}\r\n\r\nvoid HtmlWindow::FindInCurrentPage()\r\n{\r\n    webBrowser->ExecWB(OLECMDID_FIND, OLECMDEXECOPT_PROMPTUSER, nullptr, nullptr);\r\n}\r\n\r\nvoid HtmlWindow::SelectAll()\r\n{\r\n    webBrowser->ExecWB(OLECMDID_SELECTALL, OLECMDEXECOPT_DODEFAULT, nullptr, nullptr);\r\n}\r\n\r\nvoid HtmlWindow::CopySelection()\r\n{\r\n    webBrowser->ExecWB(OLECMDID_COPY, OLECMDEXECOPT_DODEFAULT, nullptr, nullptr);\r\n}\r\n\r\nvoid HtmlWindow::NavigateToAboutBlank()\r\n{\r\n    NavigateToUrl(L\"about:blank\");\r\n}\r\n\r\nvoid HtmlWindow::SetHtml(const char *s, size_t len, const WCHAR *url)\r\n{\r\n    FreeHtmlSetInProgressData();\r\n    if (len == (size_t)-1) {\r\n        len = str::Len(s);\r\n    }\r\n    htmlSetInProgress = str::DupN(s, len);\r\n    htmlSetInProgressUrl = str::Dup(url);\r\n    NavigateToAboutBlank();\r\n    // the real work will happen in OnDocumentComplete()\r\n}\r\n\r\n// TODO: we don't call OnDocumentComplete() on this because the url\r\n// reports \"about:blank\" and we suppress that. Figure out a way\r\n// to fix that (change the url somehow?)\r\n// TODO: IHtmlDocument2->write() seems like a simpler method\r\n// http://www.codeproject.com/Articles/3365/Embed-an-HTML-control-in-your-own-window-using-pla#BUFFER\r\n// https://github.com/ReneNyffenegger/development_misc/blob/master/windows/mshtml/HTMLWindow.cpp#L143\r\nvoid HtmlWindow::SetHtmlReal(const char *s, size_t len)\r\n{\r\n    if (-1 == len)\r\n        len = str::Len(s);\r\n\r\n    if (htmlContent)\r\n        htmlContent->Release();\r\n    htmlContent = new HtmlMoniker();\r\n    htmlContent->SetHtml(s, len);\r\n    ScopedMem<WCHAR> baseUrl(str::Format(HW_PROTO_PREFIX L\"://%d/\", windowId));\r\n    htmlContent->SetBaseUrl(baseUrl);\r\n\r\n    ScopedComPtr<IDispatch> docDispatch;\r\n    HRESULT hr = webBrowser->get_Document(&docDispatch);\r\n    if (FAILED(hr) || !docDispatch)\r\n        return;\r\n\r\n    ScopedComQIPtr<IHTMLDocument2> doc(docDispatch);\r\n    if (!doc)\r\n        return;\r\n\r\n    ScopedComQIPtr<IPersistMoniker> perstMon(doc);\r\n    if (!perstMon)\r\n        return;\r\n    ScopedComQIPtr<IMoniker> htmlMon(htmlContent);\r\n    hr = perstMon->Load(TRUE, htmlMon, nullptr, STGM_READ);\r\n}\r\n\r\n// http://stackoverflow.com/questions/9778206/how-i-can-get-information-about-the-scrollbars-of-an-webbrowser-control-instance\r\n// http://stackoverflow.com/questions/8630173/hide-scrollbars-in-webbrowser-control-mfc\r\n// This is equivalent of <body scroll=auto> but for any html\r\n// This seems to be the only way to hide vertical scrollbar if it's not necessary\r\nvoid HtmlWindow::SetScrollbarToAuto()\r\n{\r\n    ScopedComPtr<IDispatch> docDispatch;\r\n    HRESULT hr = webBrowser->get_Document(&docDispatch);\r\n    if (FAILED(hr) || !docDispatch)\r\n        return;\r\n\r\n    ScopedComQIPtr<IHTMLDocument2> doc2(docDispatch);\r\n    if (!doc2)\r\n        return;\r\n\r\n    ScopedComPtr<IHTMLElement> bodyElement;\r\n    hr = doc2->get_body(&bodyElement);\r\n    if (FAILED(hr) || !bodyElement)\r\n        return;\r\n\r\n    ScopedComQIPtr<IHTMLBodyElement> body(bodyElement);\r\n    if (!body)\r\n        return;\r\n\r\n    BSTR s = SysAllocString(L\"auto\");\r\n    hr = body->put_scroll(s);\r\n    SysFreeString(s);\r\n}\r\n\r\n// Take a screenshot of a given <area> inside an html window and resize\r\n// it to <finalSize>. It's up to the caller to make sure <area> fits\r\n// within window (we don't check that's the case)\r\nHBITMAP HtmlWindow::TakeScreenshot(RectI area, SizeI finalSize)\r\n{\r\n    ScopedComPtr<IDispatch> docDispatch;\r\n    HRESULT hr = webBrowser->get_Document(&docDispatch);\r\n    if (FAILED(hr) || !docDispatch)\r\n        return nullptr;\r\n    ScopedComQIPtr<IViewObject2> view(docDispatch);\r\n    if (!view)\r\n        return nullptr;\r\n\r\n    // capture the whole window (including scrollbars)\r\n    // to image and create imageRes containing the area\r\n    // user asked for\r\n    WindowRect winRc(hwndParent);\r\n    Bitmap image(winRc.dx, winRc.dy, PixelFormat24bppRGB);\r\n    Graphics g(&image);\r\n\r\n    HDC dc = g.GetHDC();\r\n    RECTL rc = { 0, 0, winRc.dx, winRc.dy };\r\n    hr = view->Draw(DVASPECT_CONTENT, -1, nullptr, nullptr, dc, dc, &rc, nullptr, nullptr, 0);\r\n    g.ReleaseHDC(dc);\r\n    if (FAILED(hr))\r\n        return nullptr;\r\n\r\n    Bitmap imageRes(finalSize.dx, finalSize.dy, PixelFormat24bppRGB);\r\n    Graphics g2(&imageRes);\r\n    g2.SetInterpolationMode(InterpolationModeHighQualityBicubic);\r\n    g2.DrawImage(&image, Rect(0, 0, finalSize.dx, finalSize.dy),\r\n                 area.x, area.y, area.dx, area.dy, UnitPixel);\r\n\r\n    HBITMAP hbmp;\r\n    Status ok = imageRes.GetHBITMAP((ARGB)Color::White, &hbmp);\r\n    if (ok != Ok)\r\n        return nullptr;\r\n    return hbmp;\r\n}\r\n\r\n// called before an url is shown. If returns false, will cancel\r\n// the navigation.\r\nbool HtmlWindow::OnBeforeNavigate(const WCHAR *url, bool newWindow)\r\n{\r\n    currentURL.Set(nullptr);\r\n    if (!htmlWinCb)\r\n        return true;\r\n    if (IsBlankUrl(url))\r\n        return true;\r\n\r\n    // if it's url for our internal protocol, strip the protocol\r\n    // part as we don't want to expose it to clients.\r\n    int protoWindowId;\r\n    ScopedMem<WCHAR> urlReal(str::Dup(url));\r\n    bool ok = ParseProtoUrl(url, &protoWindowId, &urlReal);\r\n    AssertCrash(!ok || protoWindowId == windowId);\r\n    bool shouldNavigate = htmlWinCb->OnBeforeNavigate(urlReal, newWindow);\r\n    return shouldNavigate;\r\n}\r\n\r\nvoid HtmlWindow::FreeHtmlSetInProgressData()\r\n{\r\n    free((void*)htmlSetInProgress);\r\n    free((void*)htmlSetInProgressUrl);\r\n    htmlSetInProgress = nullptr;\r\n    htmlSetInProgressUrl = nullptr;\r\n}\r\n\r\nvoid HtmlWindow::OnDocumentComplete(const WCHAR *url)\r\n{\r\n    if (IsBlankUrl(url)) {\r\n        if (htmlSetInProgress != nullptr) {\r\n            // TODO: I think this triggers another OnDocumentComplete() for \"about:blank\",\r\n            // which we should ignore?\r\n            SetHtmlReal(htmlSetInProgress);\r\n            if (htmlWinCb) {\r\n                if (htmlSetInProgressUrl) {\r\n                    htmlWinCb->OnDocumentComplete(htmlSetInProgressUrl);\r\n                } else {\r\n                    htmlWinCb->OnDocumentComplete(htmlSetInProgressUrl);\r\n                }\r\n            }\r\n\r\n            FreeHtmlSetInProgressData();\r\n            SetScrollbarToAuto();\r\n            return;\r\n        }\r\n    }\r\n\r\n    // if it's url for our internal protocol, strip the protocol\r\n    // part as we don't want to expose it to clients.\r\n    int protoWindowId;\r\n    ScopedMem<WCHAR> urlReal(str::Dup(url));\r\n    bool ok = ParseProtoUrl(url, &protoWindowId, &urlReal);\r\n    AssertCrash(!ok || protoWindowId == windowId);\r\n\r\n    currentURL.Set(urlReal.StealData());\r\n    if (htmlWinCb)\r\n        htmlWinCb->OnDocumentComplete(currentURL);\r\n    SetScrollbarToAuto();\r\n}\r\n\r\nHRESULT HtmlWindow::OnDragEnter(IDataObject *dataObj)\r\n{\r\n    ScopedComQIPtr<IDataObject> data(dataObj);\r\n    if (!data)\r\n        return E_INVALIDARG;\r\n    FORMATETC fe = { CF_HDROP, nullptr, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };\r\n    STGMEDIUM stg = { 0 };\r\n    if (FAILED(data->GetData(&fe, &stg)))\r\n        return E_FAIL;\r\n    ReleaseStgMedium(&stg);\r\n    return S_OK;\r\n}\r\n\r\nHRESULT HtmlWindow::OnDragDrop(IDataObject *dataObj)\r\n{\r\n    ScopedComQIPtr<IDataObject> data(dataObj);\r\n    if (!data)\r\n        return E_INVALIDARG;\r\n    FORMATETC fe = { CF_HDROP, nullptr, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };\r\n    STGMEDIUM stg = { 0 };\r\n    if (FAILED(data->GetData(&fe, &stg)))\r\n        return E_FAIL;\r\n\r\n    HDROP hDrop = (HDROP)GlobalLock(stg.hGlobal);\r\n    if (hDrop) {\r\n        SendMessage(hwndParent, WM_DROPFILES, (WPARAM)hDrop, 1);\r\n        GlobalUnlock(stg.hGlobal);\r\n    }\r\n    ReleaseStgMedium(&stg);\r\n    return hDrop != nullptr ? S_OK : E_FAIL;\r\n}\r\n\r\nLRESULT HtmlWindow::SendMsg(UINT msg, WPARAM wp, LPARAM lp)\r\n{\r\n    HWND hwndBrowser = GetBrowserControlHwnd(hwndParent);\r\n    return SendMessage(hwndBrowser, msg, wp, lp);\r\n}\r\n\r\nFrameSite::FrameSite(HtmlWindow * win)\r\n{\r\n    refCount = 1;\r\n\r\n    htmlWindow = win;\r\n    supportsWindowlessActivation = true;\r\n    inPlaceLocked = false;\r\n    uiActive = false;\r\n    inPlaceActive = false;\r\n    isWindowless = false;\r\n\r\n    ambientLocale = 0;\r\n    ambientForeColor = ::GetSysColor(COLOR_WINDOWTEXT);\r\n    ambientBackColor = ::GetSysColor(COLOR_WINDOW);\r\n    ambientUserMode = true;\r\n    ambientShowHatching = true;\r\n    ambientShowGrabHandles = true;\r\n    ambientAppearance = true;\r\n\r\n    //m_hDCBuffer = nullptr;\r\n    hwndParent = htmlWindow->hwndParent;\r\n\r\n    oleInPlaceFrame             = new HW_IOleInPlaceFrame(this);\r\n    oleInPlaceSiteWindowless    = new HW_IOleInPlaceSiteWindowless(this);\r\n    oleClientSite               = new HW_IOleClientSite(this);\r\n    oleControlSite              = new HW_IOleControlSite(this);\r\n    oleCommandTarget            = new HW_IOleCommandTarget(this);\r\n    oleItemContainer            = new HW_IOleItemContainer(this);\r\n    hwDWebBrowserEvents2        = new HW_DWebBrowserEvents2(this);\r\n    adviseSink2                 = new HW_IAdviseSink2(this);\r\n    docHostUIHandler            = new HW_IDocHostUIHandler(this);\r\n    dropTarget                  = new HW_IDropTarget(this);\r\n    serviceProvider             = new HW_IServiceProvider(this);\r\n}\r\n\r\nFrameSite::~FrameSite()\r\n{\r\n    delete serviceProvider;\r\n    delete dropTarget;\r\n    delete docHostUIHandler;\r\n    delete adviseSink2;\r\n    delete hwDWebBrowserEvents2;\r\n    delete oleItemContainer;\r\n    delete oleCommandTarget;\r\n    delete oleControlSite;\r\n    delete oleClientSite;\r\n    delete oleInPlaceSiteWindowless;\r\n    delete oleInPlaceFrame;\r\n}\r\n\r\n// IUnknown\r\nSTDMETHODIMP FrameSite::QueryInterface(REFIID riid, void **ppv)\r\n{\r\n    if (ppv == nullptr)\r\n        return E_INVALIDARG;\r\n\r\n    *ppv = nullptr;\r\n    if (riid == IID_IUnknown)\r\n        *ppv = this;\r\n    else if (riid == IID_IOleWindow ||\r\n        riid == IID_IOleInPlaceUIWindow ||\r\n        riid == IID_IOleInPlaceFrame)\r\n        *ppv = oleInPlaceFrame;\r\n    else if (riid == IID_IOleInPlaceSite ||\r\n        riid == IID_IOleInPlaceSiteEx ||\r\n        riid == IID_IOleInPlaceSiteWindowless)\r\n        *ppv = oleInPlaceSiteWindowless;\r\n    else if (riid == IID_IOleClientSite)\r\n        *ppv = oleClientSite;\r\n    else if (riid == IID_IOleControlSite)\r\n        *ppv = oleControlSite;\r\n    else if (riid == IID_IOleCommandTarget)\r\n        *ppv = oleCommandTarget;\r\n    else if (riid == IID_IOleItemContainer ||\r\n        riid == IID_IOleContainer ||\r\n        riid == IID_IParseDisplayName)\r\n        *ppv = oleItemContainer;\r\n    else if (riid == IID_IDispatch ||\r\n        riid == DIID_DWebBrowserEvents2)\r\n        *ppv = hwDWebBrowserEvents2;\r\n    else if (riid == IID_IAdviseSink ||\r\n        riid == IID_IAdviseSink2 ||\r\n        riid == IID_IAdviseSinkEx)\r\n        *ppv = adviseSink2;\r\n    else if (riid == IID_IDocHostUIHandler)\r\n        *ppv = docHostUIHandler;\r\n    else if (riid == IID_IDropTarget)\r\n        *ppv = dropTarget;\r\n    else if (riid == IID_IServiceProvider)\r\n        *ppv = serviceProvider;\r\n    else\r\n        return E_NOINTERFACE;\r\n    if (!*ppv)\r\n        return E_OUTOFMEMORY;\r\n    AddRef();\r\n    return S_OK;\r\n}\r\n\r\nULONG STDMETHODCALLTYPE FrameSite::Release()\r\n{\r\n    LONG res = InterlockedDecrement(&refCount);\r\n    CrashIf(res < 0);\r\n    if (0 == res)\r\n        delete this;\r\n    return res;\r\n}\r\n\r\n// IDispatch\r\nHRESULT HW_DWebBrowserEvents2::DispatchPropGet(DISPID dispIdMember, VARIANT *res)\r\n{\r\n    if (res == nullptr)\r\n        return E_INVALIDARG;\r\n\r\n    switch (dispIdMember)\r\n    {\r\n        case DISPID_AMBIENT_APPEARANCE:\r\n            VariantSetBool(res, fs->ambientAppearance);\r\n            break;\r\n\r\n        case DISPID_AMBIENT_FORECOLOR:\r\n            VariantSetLong(res, (long)fs->ambientForeColor);\r\n            break;\r\n\r\n        case DISPID_AMBIENT_BACKCOLOR:\r\n            VariantSetLong(res, (long)fs->ambientBackColor);\r\n            break;\r\n\r\n        case DISPID_AMBIENT_LOCALEID:\r\n            VariantSetLong(res, (long)fs->ambientLocale);\r\n            break;\r\n\r\n        case DISPID_AMBIENT_USERMODE:\r\n            VariantSetBool(res, fs->ambientUserMode);\r\n            break;\r\n\r\n        case DISPID_AMBIENT_SHOWGRABHANDLES:\r\n            VariantSetBool(res, fs->ambientShowGrabHandles);\r\n            break;\r\n\r\n        case DISPID_AMBIENT_SHOWHATCHING:\r\n            VariantSetBool(res, fs->ambientShowHatching);\r\n            break;\r\n\r\n        default:\r\n            return DISP_E_MEMBERNOTFOUND;\r\n    }\r\n    return S_OK;\r\n}\r\n\r\nstatic BSTR BstrFromVariant(VARIANT *vurl)\r\n{\r\n    if (vurl->vt & VT_BYREF)\r\n        return *vurl->pbstrVal;\r\n    else\r\n        return vurl->bstrVal;\r\n}\r\n\r\nHRESULT HW_DWebBrowserEvents2::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid,\r\n    WORD flags, DISPPARAMS * pDispParams, VARIANT * pVarResult,\r\n    EXCEPINFO * pExcepInfo, unsigned int * puArgErr)\r\n{\r\n    UNUSED(pExcepInfo); UNUSED(puArgErr);\r\n    UNUSED(riid); UNUSED(lcid);\r\n    if (flags & DISPATCH_PROPERTYGET)\r\n        return DispatchPropGet(dispIdMember, pVarResult);\r\n\r\n    switch (dispIdMember)\r\n    {\r\n        case DISPID_BEFORENAVIGATE2:\r\n        {\r\n            BSTR url = BstrFromVariant(pDispParams->rgvarg[5].pvarVal);\r\n            bool shouldCancel = !fs->htmlWindow->OnBeforeNavigate(url, false);\r\n            *pDispParams->rgvarg[0].pboolVal = shouldCancel ? VARIANT_TRUE : VARIANT_FALSE;\r\n            break;\r\n        }\r\n\r\n#if 0\r\n        case DISPID_PROGRESSCHANGE:\r\n        {\r\n            long current = pDispParams->rgvarg[1].lVal;\r\n            long maximum = pDispParams->rgvarg[0].lVal;\r\n            fs->htmlWindow->OnProgressURL(current, maximum);\r\n            break;\r\n        }\r\n#endif\r\n\r\n        case DISPID_DOCUMENTCOMPLETE:\r\n        {\r\n            // TODO: there are complexities related to multi-frame documents. This\r\n            // gets called on every frame and we should probably only notify\r\n            // on completion of top-level frame. On the other hand, I haven't\r\n            // encountered problems related to that yet\r\n            BSTR url = BstrFromVariant(pDispParams->rgvarg[0].pvarVal);\r\n            fs->htmlWindow->OnDocumentComplete(url);\r\n            break;\r\n        }\r\n\r\n        case DISPID_NAVIGATEERROR:\r\n        {\r\n            // TODO: probably should notify about that too\r\n            break;\r\n        }\r\n\r\n        case DISPID_COMMANDSTATECHANGE:\r\n            switch (pDispParams->rgvarg[1].lVal) {\r\n            case CSC_NAVIGATEBACK:\r\n                fs->htmlWindow->canGoBack = pDispParams->rgvarg[0].boolVal;\r\n                break;\r\n            case CSC_NAVIGATEFORWARD:\r\n                fs->htmlWindow->canGoForward = pDispParams->rgvarg[0].boolVal;\r\n                break;\r\n            }\r\n            break;\r\n\r\n        case DISPID_NEWWINDOW3:\r\n        {\r\n            BSTR url = pDispParams->rgvarg[0].bstrVal;\r\n            bool shouldCancel = !fs->htmlWindow->OnBeforeNavigate(url, true);\r\n            *pDispParams->rgvarg[3].pboolVal = shouldCancel ? VARIANT_TRUE : VARIANT_FALSE;\r\n            break;\r\n        }\r\n\r\n        case DISPID_NEWWINDOW2:\r\n            // prior to Windows XP SP2, there's no way of getting the URL\r\n            // to be opened, so we have to fail silently\r\n            *pDispParams->rgvarg[0].pboolVal = VARIANT_FALSE;\r\n            break;\r\n    }\r\n\r\n    return S_OK;\r\n}\r\n\r\n// IOleWindow\r\nHRESULT HW_IOleInPlaceFrame::GetWindow(HWND *phwnd)\r\n{\r\n    if (phwnd == nullptr)\r\n        return E_INVALIDARG;\r\n    *phwnd = fs->hwndParent;\r\n    return S_OK;\r\n}\r\n\r\n// IOleInPlaceUIWindow\r\nHRESULT HW_IOleInPlaceFrame::GetBorder(LPRECT lprectBorder)\r\n{\r\n    if (lprectBorder == nullptr)\r\n        return E_INVALIDARG;\r\n    return INPLACE_E_NOTOOLSPACE;\r\n}\r\n\r\nHRESULT HW_IOleInPlaceFrame::RequestBorderSpace(LPCBORDERWIDTHS pborderwidths)\r\n{\r\n    if (pborderwidths == nullptr)\r\n        return E_INVALIDARG;\r\n    return INPLACE_E_NOTOOLSPACE;\r\n}\r\n\r\n// IOleInPlaceSite\r\nHRESULT HW_IOleInPlaceSiteWindowless::OnInPlaceActivate()\r\n{\r\n    fs->inPlaceActive = true;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT HW_IOleInPlaceSiteWindowless::OnUIActivate()\r\n{\r\n    fs->uiActive = true;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT HW_IOleInPlaceSiteWindowless::GetWindowContext(\r\n    IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc,\r\n    LPRECT lprcPosRect, LPRECT lprcClipRect,\r\n    LPOLEINPLACEFRAMEINFO lpFrameInfo)\r\n{\r\n    if (ppFrame == nullptr || ppDoc == nullptr || lprcPosRect == nullptr ||\r\n            lprcClipRect == nullptr || lpFrameInfo == nullptr)\r\n    {\r\n        if (ppFrame != nullptr)\r\n            *ppFrame = nullptr;\r\n        if (ppDoc != nullptr)\r\n            *ppDoc = nullptr;\r\n        return E_INVALIDARG;\r\n    }\r\n\r\n    *ppDoc = *ppFrame = fs->oleInPlaceFrame;\r\n    (*ppDoc)->AddRef();\r\n    (*ppFrame)->AddRef();\r\n\r\n    lpFrameInfo->fMDIApp = FALSE;\r\n    lpFrameInfo->hwndFrame = fs->hwndParent;\r\n    lpFrameInfo->haccel = nullptr;\r\n    lpFrameInfo->cAccelEntries = 0;\r\n\r\n    return S_OK;\r\n}\r\n\r\nHRESULT HW_IOleInPlaceSiteWindowless::OnUIDeactivate(BOOL fUndoable)\r\n{\r\n    UNUSED(fUndoable);\r\n    fs->uiActive = false;\r\n    return S_OK;\r\n}\r\n\r\nHRESULT HW_IOleInPlaceSiteWindowless::OnInPlaceDeactivate()\r\n{\r\n    fs->inPlaceActive = false;\r\n    return S_OK;\r\n}\r\n\r\n// IOleInPlaceSiteEx\r\nHRESULT HW_IOleInPlaceSiteWindowless::OnInPlaceActivateEx(BOOL * pfNoRedraw, DWORD dwFlags)\r\n{\r\n    UNUSED(dwFlags);\r\n    if (pfNoRedraw)\r\n        *pfNoRedraw = FALSE;\r\n    return S_OK;\r\n}\r\n\r\n// IOleInPlaceSiteWindowless\r\nHRESULT HW_IOleInPlaceSiteWindowless::CanWindowlessActivate()\r\n{\r\n    return fs->supportsWindowlessActivation ? S_OK : S_FALSE;\r\n}\r\n\r\nHRESULT HW_IOleInPlaceSiteWindowless::GetDC(LPCRECT pRect, DWORD grfFlags, HDC* phDC)\r\n{\r\n    UNUSED(pRect);\r\n    if (phDC == nullptr)\r\n        return E_INVALIDARG;\r\n\r\n#if 0\r\n    if (grfFlags & OLEDC_NODRAW)\r\n    {\r\n        *phDC = mfs->hDCBuffer;\r\n        return S_OK;\r\n    }\r\n\r\n    if (fs->hDCBuffer != nullptr)\r\n        return E_UNEXPECTED;\r\n#else\r\n    UNUSED(grfFlags);\r\n#endif\r\n    return E_NOTIMPL;\r\n}\r\n\r\nHRESULT HW_IOleInPlaceSiteWindowless::InvalidateRect(LPCRECT pRect, BOOL fErase)\r\n{\r\n    UNUSED(pRect);\r\n    ::InvalidateRect(fs->hwndParent, nullptr, fErase);\r\n    return S_OK;\r\n}\r\n\r\n// IOleClientSite\r\nHRESULT HW_IOleClientSite::GetContainer(LPOLECONTAINER * ppContainer)\r\n{\r\n    if (ppContainer == nullptr)\r\n        return E_INVALIDARG;\r\n    return QueryInterface(IID_IOleContainer, (void**)ppContainer);\r\n}\r\n\r\n// IOleItemContainer\r\nHRESULT HW_IOleItemContainer::GetObject(LPOLESTR pszItem,\r\n    DWORD dwSpeedNeeded, IBindCtx * pbc, REFIID riid, void ** ppvObject)\r\n{\r\n    UNUSED(dwSpeedNeeded); UNUSED(pbc); UNUSED(riid);\r\n    if (pszItem == nullptr)\r\n        return E_INVALIDARG;\r\n    if (ppvObject == nullptr)\r\n        return E_INVALIDARG;\r\n    *ppvObject = nullptr;\r\n    return MK_E_NOOBJECT;\r\n}\r\n\r\nHRESULT HW_IOleItemContainer::GetObjectStorage(LPOLESTR pszItem,\r\n    IBindCtx * pbc, REFIID riid, void ** ppvStorage)\r\n{\r\n    UNUSED(pbc); UNUSED(riid);\r\n    if (pszItem == nullptr)\r\n        return E_INVALIDARG;\r\n    if (ppvStorage == nullptr)\r\n        return E_INVALIDARG;\r\n    *ppvStorage = nullptr;\r\n    return MK_E_NOOBJECT;\r\n}\r\n\r\nHRESULT HW_IOleItemContainer::IsRunning(LPOLESTR pszItem)\r\n{\r\n    if (pszItem == nullptr)\r\n        return E_INVALIDARG;\r\n    return MK_E_NOOBJECT;\r\n}\r\n\r\n// IOleControlSite\r\nHRESULT HW_IOleControlSite::LockInPlaceActive(BOOL fLock)\r\n{\r\n    fs->inPlaceLocked = (fLock == TRUE);\r\n    return S_OK;\r\n}\r\n\r\nHRESULT HW_IOleControlSite::TransformCoords(POINTL *pPtlHimetric,\r\n    POINTF *pPtfContainer, DWORD dwFlags)\r\n{\r\n    UNUSED(dwFlags);\r\n    HRESULT hr = S_OK;\r\n    if (pPtlHimetric == nullptr)\r\n            return E_INVALIDARG;\r\n    if (pPtfContainer == nullptr)\r\n            return E_INVALIDARG;\r\n    return hr;\r\n}\r\n\r\n// IOleCommandTarget\r\nHRESULT HW_IOleCommandTarget::QueryStatus(const GUID *pguidCmdGroup,\r\n    ULONG cCmds, OLECMD *prgCmds, OLECMDTEXT *pCmdTet)\r\n{\r\n    UNUSED(pguidCmdGroup); UNUSED(cCmds); UNUSED(pCmdTet);\r\n    if (prgCmds == nullptr)\r\n        return E_INVALIDARG;\r\n    return OLECMDERR_E_UNKNOWNGROUP;\r\n}\r\n"
  },
  {
    "path": "src/utils/HtmlWindow.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nclass FrameSite;\r\nclass HtmlMoniker;\r\n\r\nbool IsBlankUrl(const WCHAR *);\r\n\r\n// HtmlWindowCallback allows HtmlWindow to notify other code about notable\r\n// events or delegate some of the functionality.\r\nclass HtmlWindowCallback\r\n{\r\npublic:\r\n    // called when we're about to show a given url. Returning false will\r\n    // stop loading this url\r\n    virtual bool OnBeforeNavigate(const WCHAR *url, bool newWindow) = 0;\r\n\r\n    // called after html document has been completely loaded\r\n    virtual void OnDocumentComplete(const WCHAR *url) = 0;\r\n\r\n    // allows for providing data for a given url.\r\n    // returning nullptr means data wasn't provided.\r\n    virtual const unsigned char *GetDataForUrl(const WCHAR *url, size_t *len) = 0;\r\n\r\n    // called when left mouse button is clicked in the web control window.\r\n    // we use it to maintain proper focus (since it's stolen by left click)\r\n    virtual void OnLButtonDown() = 0;\r\n\r\n    // called when a file can't be displayed and has to be downloaded instead\r\n    virtual void DownloadData(const WCHAR *url, const unsigned char *data, size_t len) = 0;\r\n\r\n    virtual ~HtmlWindowCallback() { }\r\n};\r\n\r\n// HtmlWindow embeds a web browser (Internet Explorer) control\r\n// inside provided HWND so that an app can display html content.\r\nclass HtmlWindow\r\n{\r\nprotected:\r\n    friend class FrameSite;\r\n\r\n    int                 windowId;\r\n    HWND                hwndParent;\r\n    IWebBrowser2 *      webBrowser;\r\n    IOleObject *        oleObject;\r\n    IOleInPlaceObject * oleInPlaceObject;\r\n    IViewObject *       viewObject;\r\n    IConnectionPoint *  connectionPoint;\r\n    HtmlMoniker *       htmlContent;\r\n    HWND                oleObjectHwnd;\r\n\r\n    const char *        htmlSetInProgress;\r\n    const WCHAR *       htmlSetInProgressUrl;\r\n\r\n    DWORD               adviseCookie;\r\n    bool                blankWasShown;\r\n\r\n    ScopedMem<WCHAR>    currentURL;\r\n\r\n    HtmlWindow(HWND hwndParent, HtmlWindowCallback *cb);\r\n\r\n    void NavigateToAboutBlank();\r\n    bool CreateBrowser();\r\n\r\n    void SubclassHwnd();\r\n    void UnsubclassHwnd();\r\n    void SetScrollbarToAuto();\r\n    void SetHtmlReal(const char *s, size_t len=-1);\r\n    void FreeHtmlSetInProgressData();\r\n\r\npublic:\r\n    ~HtmlWindow();\r\n\r\n    void OnSize(SizeI size);\r\n    void SetVisible(bool visible);\r\n    void NavigateToUrl(const WCHAR *url);\r\n    void NavigateToDataUrl(const WCHAR *url);\r\n    void SetHtml(const char *s, size_t len=-1, const WCHAR *url=nullptr);\r\n    void GoBack();\r\n    void GoForward();\r\n    void PrintCurrentPage(bool showUI);\r\n    void SetZoomPercent(int zoom);\r\n    int  GetZoomPercent();\r\n    void FindInCurrentPage();\r\n    void SelectAll();\r\n    void CopySelection();\r\n    LRESULT SendMsg(UINT msg, WPARAM wp, LPARAM lp);\r\n    void OnLButtonDown() const;\r\n    HBITMAP TakeScreenshot(RectI area, SizeI finalSize);\r\n\r\n    bool canGoBack;\r\n    bool canGoForward;\r\n\r\n    // TODO: not for public use\r\n    WNDPROC wndProcBrowserPrev;\r\n    LONG_PTR userDataBrowserPrev;\r\n    HtmlWindowCallback *htmlWinCb;\r\n\r\n    bool    OnBeforeNavigate(const WCHAR *url, bool newWindow);\r\n    void    OnDocumentComplete(const WCHAR *url);\r\n    HRESULT OnDragEnter(IDataObject *dataObj);\r\n    HRESULT OnDragDrop(IDataObject *dataObj);\r\n\r\n    static HtmlWindow *Create(HWND hwndParent, HtmlWindowCallback *cb);\r\n};\r\n"
  },
  {
    "path": "src/utils/HttpUtil.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include <Wininet.h>\r\n#include <memory>\r\n#include \"HttpUtil.h\"\r\n#include \"ThreadUtil.h\"\r\n#include \"FileUtil.h\"\r\n#include \"WinUtil.h\"\r\n\r\n// per RFC 1945 10.15 and 3.7, a user agent product token shouldn't contain whitespace\r\n#define USER_AGENT L\"BaseHTTP\"\r\n\r\nbool HttpRspOk(const HttpRsp* rsp)\r\n{\r\n    return (rsp->error == ERROR_SUCCESS) && (rsp->httpStatusCode == 200);\r\n}\r\n\r\n// returns false if failed to download or status code is not 200\r\n// for other scenarios, check HttpRsp\r\nbool  HttpGet(const WCHAR *url, HttpRsp *rspOut)\r\n{\r\n    HINTERNET hReq = nullptr;\r\n    DWORD headerBuffSize = sizeof(DWORD);\r\n    DWORD flags = INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_RELOAD;\r\n\r\n    rspOut->error = ERROR_SUCCESS;\r\n    HINTERNET hInet = InternetOpen(USER_AGENT, INTERNET_OPEN_TYPE_PRECONFIG, nullptr, nullptr, 0);\r\n    if (!hInet)\r\n        goto Error;\r\n\r\n    hReq = InternetOpenUrl(hInet, url, nullptr, 0, flags, 0);\r\n    if (!hReq)\r\n        goto Error;\r\n\r\n    if (!HttpQueryInfoW(hReq, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &rspOut->httpStatusCode, &headerBuffSize, nullptr)) {\r\n        goto Error;\r\n    }\r\n\r\n    for (;;) {\r\n        char buf[1024];\r\n        DWORD dwRead = 0;\r\n        if (!InternetReadFile(hReq, buf, sizeof(buf), &dwRead)) {\r\n            goto Error;\r\n        }\r\n        if (0 == dwRead) {\r\n            break;\r\n        }\r\n        bool ok = rspOut->data.AppendChecked(buf, dwRead);\r\n        if (!ok)\r\n            goto Error;\r\n    }\r\n\r\nExit:\r\n    if (hReq)\r\n        InternetCloseHandle(hReq);\r\n    if (hInet)\r\n        InternetCloseHandle(hInet);\r\n    return HttpRspOk(rspOut);\r\n\r\nError:\r\n    rspOut->error = GetLastError();\r\n    if (0 == rspOut->error)\r\n        rspOut->error = ERROR_GEN_FAILURE;\r\n    goto Exit;\r\n}\r\n\r\n// Download content of a url to a file\r\nbool HttpGetToFile(const WCHAR *url, const WCHAR *destFilePath)\r\n{\r\n    bool ok = false;\r\n    HINTERNET  hReq = nullptr, hInet = nullptr;\r\n    DWORD dwRead = 0;\r\n    DWORD headerBuffSize = sizeof(DWORD);\r\n    DWORD statusCode = 0;\r\n    char buf[1024];\r\n\r\n    HANDLE hf = CreateFile(destFilePath, GENERIC_WRITE, FILE_SHARE_READ, nullptr,\r\n            CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL,  nullptr);\r\n    if (INVALID_HANDLE_VALUE == hf)\r\n        goto Exit;\r\n\r\n    hInet = InternetOpen(USER_AGENT, INTERNET_OPEN_TYPE_PRECONFIG, nullptr, nullptr, 0);\r\n    if (!hInet)\r\n        goto Exit;\r\n\r\n    hReq = InternetOpenUrl(hInet, url, nullptr, 0, 0, 0);\r\n    if (!hReq)\r\n        goto Exit;\r\n\r\n    if (!HttpQueryInfoW(hReq, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &statusCode, &headerBuffSize, nullptr)) {\r\n        goto Exit;\r\n    }\r\n    if (statusCode != 200) {\r\n        goto Exit;\r\n    }\r\n\r\n    for (;;) {\r\n        if (!InternetReadFile(hReq, buf, sizeof(buf), &dwRead))\r\n            goto Exit;\r\n        if (dwRead == 0)\r\n            break;\r\n        DWORD size;\r\n        BOOL wroteOk = WriteFile(hf, buf, (DWORD)dwRead, &size, nullptr);\r\n        if (!wroteOk)\r\n            goto Exit;\r\n\r\n        if (size != dwRead)\r\n            goto Exit;\r\n    }\r\n\r\n    ok = true;\r\nExit:\r\n    CloseHandle(hf);\r\n    if (hReq)\r\n        InternetCloseHandle(hReq);\r\n    if (hInet)\r\n        InternetCloseHandle(hInet);\r\n    if (!ok)\r\n        file::Delete(destFilePath);\r\n    return ok;\r\n}\r\n\r\nbool HttpPost(const WCHAR *server, const WCHAR *url, str::Str<char> *headers, str::Str<char> *data)\r\n{\r\n    str::Str<char> resp(2048);\r\n    bool ok = false;\r\n    DWORD flags = 0;\r\n    char *hdr = nullptr;\r\n    DWORD hdrLen = 0;\r\n    HINTERNET hConn = nullptr, hReq = nullptr;\r\n    void *d = nullptr;\r\n    DWORD dLen = 0;\r\n    unsigned int timeoutMs = 15 * 1000;\r\n    // Get the response status.\r\n    DWORD respHttpCode = 0;\r\n    DWORD respHttpCodeSize = sizeof(respHttpCode);\r\n    DWORD dwRead = 0;\r\n\r\n    HINTERNET hInet = InternetOpen(USER_AGENT, INTERNET_OPEN_TYPE_PRECONFIG, nullptr, nullptr, 0);\r\n    if (!hInet)\r\n        goto Exit;\r\n    hConn = InternetConnect(hInet, server, INTERNET_DEFAULT_HTTP_PORT,\r\n                            nullptr, nullptr, INTERNET_SERVICE_HTTP, 0, 1);\r\n    if (!hConn)\r\n        goto Exit;\r\n\r\n    hReq = HttpOpenRequest(hConn, L\"POST\", url, nullptr, nullptr, nullptr, flags, 0);\r\n    if (!hReq)\r\n        goto Exit;\r\n    if (headers && headers->Count() > 0) {\r\n        hdr = headers->Get();\r\n        hdrLen = (DWORD)headers->Count();\r\n    }\r\n    if (data && data->Count() > 0) {\r\n        d = data->Get();\r\n        dLen = (DWORD)data->Count();\r\n    }\r\n\r\n    InternetSetOption(hReq, INTERNET_OPTION_SEND_TIMEOUT,\r\n                      &timeoutMs, sizeof(timeoutMs));\r\n\r\n    InternetSetOption(hReq, INTERNET_OPTION_RECEIVE_TIMEOUT,\r\n                      &timeoutMs, sizeof(timeoutMs));\r\n\r\n    if (!HttpSendRequestA(hReq, hdr, hdrLen, d, dLen))\r\n        goto Exit;\r\n\r\n    HttpQueryInfo(hReq, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER,\r\n                       &respHttpCode, &respHttpCodeSize, 0);\r\n\r\n    do {\r\n        char buf[1024];\r\n        if (!InternetReadFile(hReq, buf, sizeof(buf), &dwRead))\r\n            goto Exit;\r\n        ok = resp.AppendChecked(buf, dwRead);\r\n        if (!ok)\r\n            goto Exit;\r\n    } while (dwRead > 0);\r\n\r\n#if 0\r\n    // it looks like I should be calling HttpEndRequest(), but it always claims\r\n    // a timeout even though the data has been sent, received and we get HTTP 200\r\n    if (!HttpEndRequest(hReq, nullptr, 0, 0)) {\r\n        LogLastError();\r\n        goto Exit;\r\n    }\r\n#endif\r\n    ok = (200 == respHttpCode);\r\nExit:\r\n    if (hReq)\r\n        InternetCloseHandle(hReq);\r\n    if (hConn)\r\n        InternetCloseHandle(hConn);\r\n    if (hInet)\r\n        InternetCloseHandle(hInet);\r\n    return ok;\r\n}\r\n\r\n// callback function f is responsible for deleting HttpRsp\r\nvoid HttpGetAsync(const WCHAR *url, const std::function<void(HttpRsp *)> &f) {\r\n    RunAsync([=] {\r\n        auto rsp = new HttpRsp;\r\n        rsp->url = str::Dup(url);\r\n        HttpGet(url, rsp);\r\n        f(rsp);\r\n    });\r\n}\r\n\r\n#if 0\r\n// returns false if failed to download or status code is not 200\r\n// for other scenarios, check HttpRsp\r\nstatic bool  HttpGet(const char *url, HttpRsp *rspOut) {\r\n    ScopedMem<WCHAR> urlW(str::conv::FromUtf8(url));\r\n    return HttpGet(urlW, rspOut);\r\n}\r\n\r\nvoid HttpGetAsync(const char *url, const std::function<void(HttpRsp *)> &f) {\r\n    std::thread t([=] {\r\n        auto rsp = new HttpRsp;\r\n        HttpGet(url, rsp.get());\r\n        f(rsp.get());\r\n    });\r\n    t.detach();\r\n}\r\n#endif\r\n"
  },
  {
    "path": "src/utils/HttpUtil.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: Simplified BSD (see COPYING.BSD) */\n\nclass HttpRsp {\npublic:\n    ScopedMem<WCHAR> url;\n    str::Str<char>  data;\n    DWORD           error;\n    DWORD           httpStatusCode;\n\n    HttpRsp() : error((DWORD)-1), httpStatusCode((DWORD)-1) { }\n};\n\nbool  HttpRspOk(const HttpRsp*);\n\nbool  HttpPost(const WCHAR *server, const WCHAR *url, str::Str<char> *headers, str::Str<char> *data);\nbool  HttpGet(const WCHAR *url, HttpRsp *rspOut);\nbool  HttpGetToFile(const WCHAR *url, const WCHAR *destFilePath);\n//void  HttpGetAsync(const char *url, const std::function<void(HttpRsp *)> &);\nvoid  HttpGetAsync(const WCHAR *url, const std::function<void(HttpRsp *)> &);\n"
  },
  {
    "path": "src/utils/JsonParser.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"JsonParser.h\"\r\n\r\nnamespace json {\r\n\r\nstatic inline const char *SkipWS(const char *s)\r\n{\r\n    while (str::IsWs(*s))\r\n        s++;\r\n    return s;\r\n}\r\n\r\nstatic inline const char *SkipDigits(const char *s)\r\n{\r\n    while (str::IsDigit(*s))\r\n        s++;\r\n    return s;\r\n}\r\n\r\nclass ParseArgs {\r\npublic:\r\n    str::Str<char> path;\r\n    bool canceled;\r\n    ValueVisitor *visitor;\r\n\r\n    explicit ParseArgs(ValueVisitor *visitor) : canceled(false), visitor(visitor) { }\r\n};\r\n\r\nstatic const char *ParseValue(ParseArgs& args, const char *data);\r\n\r\nstatic const char *ExtractString(str::Str<char>& string, const char *data)\r\n{\r\n    while (*++data) {\r\n        if ('\"' == *data)\r\n            return data + 1;\r\n        if ('\\\\' != *data) {\r\n            string.Append(*data);\r\n            continue;\r\n        }\r\n        // parse escape sequence\r\n        int i;\r\n        switch (*++data) {\r\n            case '\"': case '\\\\': case '/':\r\n                string.Append(*data);\r\n                break;\r\n            case 'b': string.Append('\\b'); break;\r\n            case 'f': string.Append('\\f'); break;\r\n            case 'n': string.Append('\\n'); break;\r\n            case 'r': string.Append('\\r'); break;\r\n            case 't': string.Append('\\t'); break;\r\n            case 'u':\r\n                if (str::Parse(data + 1, \"%4x\", &i) && 0 < i && i < 0x10000) {\r\n                    char buf[5] = { 0 };\r\n                    wchar_t c = (wchar_t)i;\r\n                    WideCharToMultiByte(CP_UTF8, 0, &c, 1, buf, dimof(buf), nullptr, nullptr);\r\n                    string.Append(buf);\r\n                    data += 4;\r\n                    break;\r\n                }\r\n                return nullptr;\r\n            default:\r\n                return nullptr;\r\n        }\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nstatic const char *ParseString(ParseArgs& args, const char *data)\r\n{\r\n    str::Str<char> string;\r\n    data = ExtractString(string, data);\r\n    if (data)\r\n        args.canceled = !args.visitor->Visit(args.path.Get(), string.Get(), Type_String);\r\n    return data;\r\n}\r\n\r\nstatic const char *ParseNumber(ParseArgs& args, const char *data)\r\n{\r\n    const char *start = data;\r\n    // integer part\r\n    if ('-' == *data)\r\n        data++;\r\n    if ('0' == *data)\r\n        data++;\r\n    else if (str::IsDigit(*data))\r\n        data = SkipDigits(data + 1);\r\n    else\r\n        return nullptr;\r\n    // fractional part\r\n    if ('.' == *data)\r\n        data = SkipDigits(data + 1);\r\n    // magnitude\r\n    if ('e' == *data || 'E' == *data) {\r\n        data++;\r\n        if ('+' == *data || '-' == *data)\r\n            data++;\r\n        data = SkipDigits(data + 1);\r\n    }\r\n    // validity check\r\n    if (!str::IsDigit(*(data - 1)) || str::IsDigit(*data))\r\n        return nullptr;\r\n\r\n    char *number = str::DupN(start, data - start);\r\n    args.canceled = !args.visitor->Visit(args.path.Get(), number, Type_Number);\r\n    free(number);\r\n    return data;\r\n}\r\n\r\nstatic const char *ParseObject(ParseArgs& args, const char *data)\r\n{\r\n    data = SkipWS(data + 1);\r\n    if ('}' == *data)\r\n        return data + 1;\r\n\r\n    size_t pathIdx = args.path.Size();\r\n    for (;;) {\r\n        data = SkipWS(data);\r\n        if ('\"' != *data)\r\n            return nullptr;\r\n        args.path.Append('/');\r\n        data = ExtractString(args.path, data);\r\n        if (!data)\r\n            return nullptr;\r\n        data = SkipWS(data);\r\n        if (':' != *data)\r\n            return nullptr;\r\n\r\n        data = ParseValue(args, data + 1);\r\n        if (args.canceled || !data)\r\n            return data;\r\n        args.path.RemoveAt(pathIdx, args.path.Size() - pathIdx);\r\n\r\n        data = SkipWS(data);\r\n        if ('}' == *data)\r\n            return data + 1;\r\n        if (',' != *data)\r\n            return nullptr;\r\n        data++;\r\n    }\r\n}\r\n\r\nstatic const char *ParseArray(ParseArgs& args, const char *data)\r\n{\r\n    data = SkipWS(data + 1);\r\n    if (']' == *data)\r\n        return data + 1;\r\n\r\n    size_t pathIdx = args.path.Size();\r\n    for (int idx = 0; ; idx++) {\r\n        args.path.AppendFmt(\"[%d]\", idx);\r\n        data = ParseValue(args, data);\r\n        if (args.canceled || !data)\r\n            return data;\r\n        args.path.RemoveAt(pathIdx, args.path.Size() - pathIdx);\r\n\r\n        data = SkipWS(data);\r\n        if (']' == *data)\r\n            return data + 1;\r\n        if (',' != *data)\r\n            return nullptr;\r\n        data++;\r\n    }\r\n}\r\n\r\nstatic const char *ParseKeyword(ParseArgs& args, const char *data,\r\n                                const char *keyword, DataType type)\r\n{\r\n    if (!str::StartsWith(data, keyword))\r\n        return nullptr;\r\n    args.canceled = !args.visitor->Visit(args.path.Get(), keyword, type);\r\n    return data + str::Len(keyword);\r\n}\r\n\r\nstatic const char *ParseValue(ParseArgs& args, const char *data)\r\n{\r\n    data = SkipWS(data);\r\n    switch (*data) {\r\n    case '\"':\r\n        return ParseString(args, data);\r\n    case '0': case '1': case '2': case '3':\r\n    case '4': case '5': case '6': case '7':\r\n    case '8': case '9': case '-':\r\n        return ParseNumber(args, data);\r\n    case '{':\r\n        return ParseObject(args, data);\r\n    case '[':\r\n        return ParseArray(args, data);\r\n    case 't':\r\n        return ParseKeyword(args, data, \"true\", Type_Bool);\r\n    case 'f':\r\n        return ParseKeyword(args, data, \"false\", Type_Bool);\r\n    case 'n':\r\n        return ParseKeyword(args, data, \"null\", Type_Null);\r\n    default:\r\n        return nullptr;\r\n    }\r\n}\r\n\r\nbool Parse(const char *data, ValueVisitor *visitor)\r\n{\r\n    ParseArgs args(visitor);\r\n    if (str::StartsWith(data, UTF8_BOM))\r\n        data += 3;\r\n    const char *end = ParseValue(args, data);\r\n    if (!end)\r\n        return false;\r\n    return args.canceled || !*SkipWS(end);\r\n}\r\n\r\n}\r\n"
  },
  {
    "path": "src/utils/JsonParser.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// simple push parser for JSON files (cf. http://www.json.org/ )\r\n\r\nnamespace json {\r\n\r\nenum DataType { Type_String, Type_Number, Type_Bool, Type_Null };\r\n\r\n// parsing JSON data will call the ValueVisitor for every\r\n// primitive data value with a string representation of that\r\n// value and a path to it\r\n\r\n// e.g. the following JSON data will lead to two calls:\r\n// { \"key\": [false, { \"name\": \"valu\\u0065\" }] }\r\n// 1. \"/key[0]\", \"false\", Type_Bool\r\n// 2. \"/key[1]/name\", \"value\", Type_String\r\n\r\nclass ValueVisitor {\r\npublic:\r\n    // return false to stop parsing\r\n    virtual bool Visit(const char *path, const char *value, DataType type) = 0;\r\n    virtual ~ValueVisitor() { }\r\n};\r\n\r\n// data must be UTF-8 encoded and nullptr-terminated\r\n// returns false on error\r\nbool Parse(const char *data, ValueVisitor *visitor);\r\n\r\n}\r\n"
  },
  {
    "path": "src/utils/LzmaSimpleArchive.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include <LzmaDec.h>\r\n#include <Bra.h>\r\n#include <zlib.h> // for crc32\r\n#include \"ByteOrderDecoder.h\"\r\n#include \"LzmaSimpleArchive.h\"\r\n#include \"FileUtil.h\"\r\n\r\n/*\r\nImplements extracting data from a simple archive format, made up by me.\r\nFor the description of the format, see comment below, above ParseSimpleArchive().\r\nArchives are simple to create (in SumatraPDF, we used to use lzma.exe and a python script)\r\nthere's a tool for creating them in ../MakeLzSA.cpp\r\n*/\r\n\r\n// 'LzSA' for \"Lzma Simple Archive\"\r\n#define LZMA_MAGIC_ID 0x41537a4c\r\n\r\nnamespace lzma {\r\n\r\nstruct ISzAllocatorAlloc : ISzAlloc {\r\n    Allocator *allocator;\r\n\r\n    static void *_Alloc(void *p, size_t size) {\r\n        ISzAllocatorAlloc *a = (ISzAllocatorAlloc *)p;\r\n        return Allocator::Alloc(a->allocator, size);\r\n    }\r\n    static void _Free(void *p, void *address) {\r\n        ISzAllocatorAlloc *a = (ISzAllocatorAlloc *)p;\r\n        Allocator::Free(a->allocator, address);\r\n    }\r\n\r\n    ISzAllocatorAlloc(Allocator *allocator) {\r\n        this->Alloc = _Alloc;\r\n        this->Free = _Free;\r\n        this->allocator = allocator;\r\n    }\r\n};\r\n\r\n// adapted from lzma/C/Lzma86Dec.c\r\n// (main difference: the uncompressed size isn't stored in bytes 6 to 13)\r\n\r\n#define LZMA_HEADER_SIZE (1 + LZMA_PROPS_SIZE)\r\n\r\n// the first compressed byte indicates whether compression is LZMA (0), LZMA+BJC (1) or none (-1)\r\nstatic bool Decompress(const char *compressed, size_t compressedSize, char *uncompressed, size_t uncompressedSize, Allocator *allocator)\r\n{\r\n    if (compressedSize < 1)\r\n        return false;\r\n\r\n    uint8_t usesX86Filter = compressed[0];\r\n    // handle stored data\r\n    if (usesX86Filter == (uint8_t)-1) {\r\n        if (uncompressedSize != compressedSize - 1)\r\n            return false;\r\n        memcpy(uncompressed, compressed + 1, compressedSize - 1);\r\n        return true;\r\n    }\r\n\r\n    if (compressedSize < LZMA_HEADER_SIZE || usesX86Filter > 1)\r\n        return false;\r\n\r\n    SizeT uncompressedSizeCmp = uncompressedSize;\r\n    SizeT compressedSizeTmp = compressedSize - LZMA_HEADER_SIZE;\r\n\r\n    ISzAllocatorAlloc lzmaAlloc(allocator);\r\n    ELzmaStatus status;\r\n    int res = LzmaDecode((Byte *)uncompressed, &uncompressedSizeCmp,\r\n        (Byte *)compressed + LZMA_HEADER_SIZE, &compressedSizeTmp,\r\n        (Byte *)compressed + 1, LZMA_PROPS_SIZE, LZMA_FINISH_END, &status,\r\n        &lzmaAlloc);\r\n\r\n    if (SZ_OK != res || status != LZMA_STATUS_FINISHED_WITH_MARK)\r\n        return false;\r\n    if (uncompressedSizeCmp != uncompressedSize)\r\n        return false;\r\n\r\n    if (usesX86Filter) {\r\n        UInt32 x86State;\r\n        x86_Convert_Init(x86State);\r\n        x86_Convert((Byte *)uncompressed, uncompressedSize, 0, &x86State, 0);\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\n/* archiveHeader points to the beginning of archive, which has a following format:\r\n\r\nu32   magic_id 0x41537a4c (\"LzSA' for \"Lzma Simple Archive\")\r\nu32   number of files\r\nfor each file:\r\n  u32        length of file metadata (from this field to file name's 0-terminator)\r\n  u32        file size compressed\r\n  u32        file size uncompressed\r\n  u32        crc32 checksum of uncompressed data\r\n  FILETIME   last modification time in Windows's FILETIME format (8 bytes)\r\n  char[...]  file name, 0-terminated\r\nu32   crc32 checksum of the header (i.e. data so far)\r\nfor each file:\r\n  compressed file data (for each file, the first byte indicates the compression method)\r\n\r\nIntegers are little-endian.\r\n*/\r\n\r\n// magic_id + number of files\r\n#define HEADER_START_SIZE (4 + 4)\r\n\r\n// 4 * u32 + FILETIME + name\r\n#define FILE_ENTRY_MIN_SIZE (4 * 4 + 8 + 1)\r\n\r\nbool ParseSimpleArchive(const char *archiveHeader, size_t dataLen, SimpleArchive* archiveOut)\r\n{\r\n    if (dataLen < HEADER_START_SIZE)\r\n        return false;\r\n    if (dataLen > (uint32_t)-1)\r\n        return false;\r\n\r\n    ByteOrderDecoder br(archiveHeader, dataLen, ByteOrderDecoder::LittleEndian);\r\n    uint32_t magic_id = br.UInt32();\r\n    if (magic_id != LZMA_MAGIC_ID)\r\n        return false;\r\n\r\n    uint32_t filesCount = br.UInt32();\r\n    archiveOut->filesCount = filesCount;\r\n    if (filesCount > dimof(archiveOut->files))\r\n        return false;\r\n\r\n    FileInfo *fi;\r\n    for (uint32_t i = 0; i < filesCount; i++) {\r\n        if (br.Offset() + FILE_ENTRY_MIN_SIZE > dataLen)\r\n            return false;\r\n\r\n        uint32_t fileHeaderSize = br.UInt32();\r\n        if (fileHeaderSize < FILE_ENTRY_MIN_SIZE || fileHeaderSize > 1024)\r\n            return false;\r\n        if (br.Offset() + fileHeaderSize - 4 > dataLen)\r\n            return false;\r\n\r\n        fi = &archiveOut->files[i];\r\n        fi->compressedSize = br.UInt32();\r\n        fi->uncompressedSize = br.UInt32();\r\n        fi->uncompressedCrc32 = br.UInt32();\r\n        fi->ftModified.dwLowDateTime = br.UInt32();\r\n        fi->ftModified.dwHighDateTime = br.UInt32();\r\n        fi->name = archiveHeader + br.Offset();\r\n        br.Skip(fileHeaderSize - FILE_ENTRY_MIN_SIZE);\r\n        if (br.Char() != '\\0')\r\n            return false;\r\n    }\r\n\r\n    if (br.Offset() + 4 > dataLen)\r\n        return false;\r\n\r\n    size_t headerSize = br.Offset();\r\n    uint32_t headerCrc32 = br.UInt32();\r\n    uint32_t realCrc = crc32(0, (const uint8_t *)archiveHeader, (uint32_t)headerSize);\r\n    if (headerCrc32 != realCrc)\r\n        return false;\r\n\r\n    for (uint32_t i = 0; i < filesCount; i++) {\r\n        fi = &archiveOut->files[i];\r\n        // overflow check\r\n        if (fi->compressedSize > dataLen || br.Offset() + fi->compressedSize > dataLen)\r\n            return false;\r\n        fi->compressedData = archiveHeader + br.Offset();\r\n        br.Skip(fi->compressedSize);\r\n    }\r\n\r\n    return br.Offset() == dataLen;\r\n}\r\n\r\nint GetIdxFromName(SimpleArchive *archive, const char *fileName)\r\n{\r\n    for (int i = 0; i < archive->filesCount; i++) {\r\n        const char *file = archive->files[i].name;\r\n        if (str::Eq(file, fileName))\r\n            return i;\r\n    }\r\n    return -1;\r\n}\r\n\r\nchar *GetFileDataByIdx(SimpleArchive *archive, int idx, Allocator *allocator)\r\n{\r\n    if (idx >= archive->filesCount)\r\n        return nullptr;\r\n\r\n    FileInfo *fi = &archive->files[idx];\r\n\r\n    char *uncompressed = (char *)Allocator::Alloc(allocator, fi->uncompressedSize);\r\n    if (!uncompressed)\r\n        return nullptr;\r\n\r\n    bool ok = Decompress(fi->compressedData, fi->compressedSize, uncompressed, fi->uncompressedSize, allocator);\r\n    if (!ok) {\r\n        Allocator::Free(allocator, uncompressed);\r\n        return nullptr;\r\n    }\r\n\r\n    uint32_t realCrc = crc32(0, (const uint8_t *)uncompressed, fi->uncompressedSize);\r\n    if (realCrc != fi->uncompressedCrc32) {\r\n        Allocator::Free(allocator, uncompressed);\r\n        return nullptr;\r\n    }\r\n\r\n    return uncompressed;\r\n}\r\n\r\nchar *GetFileDataByName(SimpleArchive *archive, const char *fileName, Allocator *allocator)\r\n{\r\n    int idx = GetIdxFromName(archive, fileName);\r\n    if (-1 != idx)\r\n        return GetFileDataByIdx(archive, idx, allocator);\r\n    return nullptr;\r\n}\r\n\r\nstatic bool ExtractFileByIdx(SimpleArchive *archive, int idx, const char *dstDir, Allocator *allocator)\r\n{\r\n    FileInfo *fi = &archive->files[idx];\r\n\r\n    char *uncompressed = GetFileDataByIdx(archive, idx, allocator);\r\n    if (!uncompressed)\r\n        return false;\r\n\r\n    bool ok = false;\r\n    char *filePath = path::JoinUtf(dstDir, fi->name, allocator);\r\n    if (filePath)\r\n        ok = file::WriteAllUtf(filePath, uncompressed, fi->uncompressedSize);\r\n\r\n    Allocator::Free(allocator, filePath);\r\n    Allocator::Free(allocator, uncompressed);\r\n\r\n    return ok;\r\n}\r\n\r\nbool ExtractFiles(const char *archivePath, const char *dstDir, const char **files, Allocator *allocator)\r\n{\r\n    size_t archiveDataSize;\r\n    char *archiveData = file::ReadAllUtf(archivePath, &archiveDataSize, allocator);\r\n    if (!archiveData)\r\n        return false;\r\n\r\n    SimpleArchive archive;\r\n    bool ok = ParseSimpleArchive(archiveData, archiveDataSize, &archive);\r\n    if (!ok) {\r\n        Allocator::Free(allocator, archiveData);\r\n        return false;\r\n    }\r\n    for (; *files; files++) {\r\n        int idx = GetIdxFromName(&archive, *files);\r\n        if (-1 != idx) {\r\n            ok &= ExtractFileByIdx(&archive, idx, dstDir, allocator);\r\n        }\r\n    }\r\n    Allocator::Free(allocator, archiveData);\r\n    return ok;\r\n}\r\n\r\n}\r\n"
  },
  {
    "path": "src/utils/LzmaSimpleArchive.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nnamespace lzma {\r\n\r\nstruct FileInfo {\r\n    // public data\r\n    uint32_t        compressedSize;\r\n    uint32_t        uncompressedSize;\r\n    uint32_t        uncompressedCrc32;\r\n    FILETIME        ftModified;\r\n    const char *    name;\r\n    const char *    compressedData;\r\n};\r\n\r\n// Note: good enough for our purposes, can be expanded when needed\r\n#define MAX_LZMA_ARCHIVE_FILES 128\r\n\r\nstruct SimpleArchive {\r\n    int             filesCount;\r\n    FileInfo        files[MAX_LZMA_ARCHIVE_FILES];\r\n};\r\n\r\nbool   ParseSimpleArchive(const char *archiveHeader, size_t dataLen, SimpleArchive *archiveOut);\r\nint    GetIdxFromName(SimpleArchive *archive, const char *name);\r\nchar * GetFileDataByIdx(SimpleArchive *archive, int idx, Allocator *allocator);\r\nchar * GetFileDataByName(SimpleArchive *archive, const char *fileName, Allocator *allocator);\r\n// files is an array of char * entries, last element must be nullptr\r\nbool   ExtractFiles(const char *archivePath, const char *dstDir, const char **files, Allocator *allocator=nullptr);\r\n\r\n}\r\n"
  },
  {
    "path": "src/utils/PalmDbReader.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"PalmDbReader.h\"\r\n\r\n#include \"ByteReader.h\"\r\n#include \"FileUtil.h\"\r\n#include \"WinUtil.h\"\r\n\r\n#include <pshpack1.h>\r\n\r\n// cf. http://wiki.mobileread.com/wiki/PDB\r\nstruct PdbHeader {\r\n     /* 31 chars + 1 null terminator */\r\n    char        name[32];\r\n    uint16_t    attributes;\r\n    uint16_t    version;\r\n    uint32_t    createTime;\r\n    uint32_t    modifyTime;\r\n    uint32_t    backupTime;\r\n    uint32_t    modificationNumber;\r\n    uint32_t    appInfoID;\r\n    uint32_t    sortInfoID;\r\n    char        typeCreator[8];\r\n    uint32_t    idSeed;\r\n    uint32_t    nextRecordList;\r\n    uint16_t    numRecords;\r\n};\r\n\r\nstruct PdbRecordHeader {\r\n    uint32_t offset;\r\n    uint8_t  flags; // deleted, dirty, busy, secret, category\r\n    char     uniqueID[3];\r\n};\r\n\r\n#include <poppack.h>\r\n\r\nstatic_assert(sizeof(PdbHeader) == kPdbHeaderLen, \"wrong size of PdbHeader structure\");\r\nstatic_assert(sizeof(PdbRecordHeader) == 8, \"wrong size of PdbRecordHeader structure\");\r\n\r\nPdbReader::PdbReader(const WCHAR *filePath) :\r\n    data(file::ReadAll(filePath, &dataSize))\r\n{\r\n    if (!ParseHeader())\r\n        recOffsets.Reset();\r\n}\r\n\r\nPdbReader::PdbReader(IStream *stream) :\r\n    data((char *)GetDataFromStream(stream, &dataSize))\r\n{\r\n    if (!ParseHeader())\r\n        recOffsets.Reset();\r\n}\r\n\r\nbool PdbReader::ParseHeader()\r\n{\r\n    CrashIf(recOffsets.Count() > 0);\r\n\r\n    PdbHeader pdbHeader;\r\n    if (!data || dataSize < sizeof(pdbHeader))\r\n        return false;\r\n    ByteReader r(data, dataSize);\r\n\r\n    bool ok = r.UnpackBE(&pdbHeader, sizeof(pdbHeader), \"32b2w6d8b2dw\");\r\n    CrashIf(!ok);\r\n    // the spec says it should be zero-terminated anyway, but this\r\n    // comes from untrusted source, so we do our own termination\r\n    pdbHeader.name[dimof(pdbHeader.name) - 1] = '\\0';\r\n    str::BufSet(dbType, dimof(dbType), pdbHeader.typeCreator);\r\n\r\n    if (0 == pdbHeader.numRecords)\r\n        return false;\r\n\r\n    for (int i = 0; i < pdbHeader.numRecords; i++) {\r\n        uint32_t off = r.DWordBE(sizeof(pdbHeader) + i * sizeof(PdbRecordHeader));\r\n        recOffsets.Append(off);\r\n    }\r\n    // add sentinel value to simplify use\r\n    recOffsets.Append(std::min((uint32_t)dataSize, (uint32_t)-1));\r\n\r\n    // validate offsets\r\n    for (int i = 0; i < pdbHeader.numRecords; i++) {\r\n        if (recOffsets.At(i + 1) < recOffsets.At(i))\r\n            return false;\r\n        // technically PDB record size should be less than 64K,\r\n        // but it's not true for mobi files, so we don't validate that\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nconst char *PdbReader::GetDbType()\r\n{\r\n    if (recOffsets.Count() == 0)\r\n        return nullptr;\r\n    return dbType;\r\n}\r\n\r\nsize_t PdbReader::GetRecordCount()\r\n{\r\n    return recOffsets.Count() - 1;\r\n}\r\n\r\nconst char *PdbReader::GetRecord(size_t recNo, size_t *sizeOut)\r\n{\r\n    if (recNo + 1 >= recOffsets.Count())\r\n        return nullptr;\r\n    size_t offset = recOffsets.At(recNo);\r\n    if (sizeOut)\r\n        *sizeOut = recOffsets.At(recNo + 1) - offset;\r\n    return data + offset;\r\n}\r\n"
  },
  {
    "path": "src/utils/PalmDbReader.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// http://en.wikipedia.org/wiki/PDB_(Palm_OS)\r\n#define kPdbHeaderLen 78\r\n\r\nclass PdbReader {\r\n    ScopedMem<char> data;\r\n    size_t          dataSize;\r\n    // offset of each pdb record within the file + a sentinel\r\n    // value equal to file size to simplify use\r\n    Vec<uint32_t>   recOffsets;\r\n    // cache so that we can compare with str::Eq\r\n    char            dbType[9];\r\n\r\n    bool ParseHeader();\r\n\r\npublic:\r\n    explicit PdbReader(const WCHAR *filePath);\r\n    explicit PdbReader(IStream *stream);\r\n\r\n    const char *GetDbType();\r\n    size_t GetRecordCount();\r\n    const char *GetRecord(size_t recNo, size_t *sizeOut);\r\n};\r\n"
  },
  {
    "path": "src/utils/Scoped.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// include BaseUtil.h instead of including directly\r\n\r\n// auto-free memory for arbitrary malloc()ed memory of type T*\r\ntemplate <typename T>\r\nclass ScopedMem\r\n{\r\n    T *ptr;\r\npublic:\r\n    ScopedMem() : ptr(nullptr) {}\r\n    explicit ScopedMem(T* ptr) : ptr(ptr) {}\r\n    ~ScopedMem() { free(ptr); }\r\n    void Set(T *newPtr) {\r\n        free(ptr);\r\n        ptr = newPtr;\r\n    }\r\n    ScopedMem& operator=(T* newPtr) {\r\n        free(ptr);\r\n        ptr = newPtr;\r\n        return *this;\r\n    }\r\n    T *Get() const { return ptr; }\r\n    T *StealData() {\r\n        T *tmp = ptr;\r\n        ptr = nullptr;\r\n        return tmp;\r\n    }\r\n    operator T*() const { return ptr; }\r\n};\r\n\r\nclass ScopedCritSec\r\n{\r\n    CRITICAL_SECTION *cs;\r\npublic:\r\n    explicit ScopedCritSec(CRITICAL_SECTION *cs) : cs(cs) {\r\n        EnterCriticalSection(cs);\r\n    }\r\n    ~ScopedCritSec() {\r\n        LeaveCriticalSection(cs);\r\n    }\r\n};\r\n\r\nclass ScopedHandle {\r\n    HANDLE handle;\r\npublic:\r\n    explicit ScopedHandle(HANDLE handle) : handle(handle) { }\r\n    ~ScopedHandle() { CloseHandle(handle); }\r\n    operator HANDLE() const { return handle; }\r\n    bool IsValid() const { return handle != NULL && handle != INVALID_HANDLE_VALUE; }\r\n};\r\n\r\n// deletes any object at the end of the scope\r\ntemplate <class T>\r\nclass ScopedPtr\r\n{\r\n    T *obj;\r\npublic:\r\n    ScopedPtr() : obj(nullptr) {}\r\n    explicit ScopedPtr(T* obj) : obj(obj) {}\r\n    ~ScopedPtr() { delete obj; }\r\n    T *Detach() {\r\n        T *tmp = obj;\r\n        obj = nullptr;\r\n        return tmp;\r\n    }\r\n    operator T*() const { return obj; }\r\n    T* operator->() const { return obj; }\r\n    T* operator=(T* newObj) {\r\n        delete obj;\r\n        return (obj = newObj);\r\n    }\r\n};\r\n\r\ntemplate <class T>\r\nclass ScopedComPtr {\r\nprotected:\r\n    T *ptr;\r\npublic:\r\n    ScopedComPtr() : ptr(nullptr) { }\r\n    explicit ScopedComPtr(T *ptr) : ptr(ptr) { }\r\n    ~ScopedComPtr() {\r\n        if (ptr)\r\n            ptr->Release();\r\n    }\r\n    bool Create(const CLSID clsid) {\r\n        CrashIf(ptr);\r\n        if (ptr) return false;\r\n        HRESULT hr = CoCreateInstance(clsid, nullptr, CLSCTX_ALL, IID_PPV_ARGS(&ptr));\r\n        return SUCCEEDED(hr);\r\n    }\r\n    operator T*() const { return ptr; }\r\n    T** operator&() { return &ptr; }\r\n    T* operator->() const { return ptr; }\r\n    T* operator=(T* newPtr) {\r\n        if (ptr)\r\n            ptr->Release();\r\n        return (ptr = newPtr);\r\n    }\r\n};\r\n\r\ntemplate <class T>\r\nclass ScopedComQIPtr {\r\nprotected:\r\n    T *ptr;\r\npublic:\r\n    ScopedComQIPtr() : ptr(nullptr) { }\r\n    explicit ScopedComQIPtr(IUnknown *unk) {\r\n        HRESULT hr = unk->QueryInterface(&ptr);\r\n        if (FAILED(hr))\r\n            ptr = nullptr;\r\n    }\r\n    ~ScopedComQIPtr() {\r\n        if (ptr)\r\n            ptr->Release();\r\n    }\r\n    bool Create(const CLSID clsid) {\r\n        CrashIf(ptr);\r\n        if (ptr) return false;\r\n        HRESULT hr = CoCreateInstance(clsid, nullptr, CLSCTX_ALL, IID_PPV_ARGS(&ptr));\r\n        return SUCCEEDED(hr);\r\n    }\r\n    T* operator=(IUnknown *newUnk) {\r\n        if (ptr)\r\n            ptr->Release();\r\n        HRESULT hr = newUnk->QueryInterface(&ptr);\r\n        if (FAILED(hr))\r\n            ptr = nullptr;\r\n        return ptr;\r\n    }\r\n    operator T*() const { return ptr; }\r\n    T** operator&() { return &ptr; }\r\n    T* operator->() const { return ptr; }\r\n    T* operator=(T* newPtr) {\r\n        if (ptr)\r\n            ptr->Release();\r\n        return (ptr = newPtr);\r\n    }\r\n};\r\n\r\ntemplate <typename T>\r\nclass ScopedGdiObj {\r\n    T obj;\r\npublic:\r\n    explicit ScopedGdiObj(T obj) : obj(obj) { }\r\n    ~ScopedGdiObj() { DeleteObject(obj); }\r\n    operator T() const { return obj; }\r\n};\r\ntypedef ScopedGdiObj<HFONT> ScopedFont;\r\ntypedef ScopedGdiObj<HPEN> ScopedPen;\r\ntypedef ScopedGdiObj<HBRUSH> ScopedBrush;\r\n\r\nclass ScopedHdcSelect {\r\n    HDC hdc;\r\n    HGDIOBJ prev;\r\npublic:\r\n    ScopedHdcSelect(HDC hdc, HGDIOBJ obj) : hdc(hdc) { prev = SelectObject(hdc, obj); }\r\n    ~ScopedHdcSelect() { SelectObject(hdc, prev); }\r\n};\r\n\r\nclass ScopedCom {\r\npublic:\r\n    ScopedCom() { (void)CoInitialize(nullptr); }\r\n    ~ScopedCom() { CoUninitialize(); }\r\n};\r\n\r\nclass ScopedOle {\r\npublic:\r\n    ScopedOle() { (void)OleInitialize(nullptr); }\r\n    ~ScopedOle() { OleUninitialize(); }\r\n};\r\n\r\nclass ScopedGdiPlus {\r\nprotected:\r\n    Gdiplus::GdiplusStartupInput si;\r\n    Gdiplus::GdiplusStartupOutput so;\r\n    ULONG_PTR token, hookToken;\r\n    bool noBgThread;\r\n\r\npublic:\r\n    // suppress the GDI+ background thread when initiating in WinMain,\r\n    // as that thread causes DDE messages to be sent too early and\r\n    // thus causes unexpected timeouts\r\n    explicit ScopedGdiPlus(bool inWinMain=false) : noBgThread(inWinMain) {\r\n        si.SuppressBackgroundThread = noBgThread;\r\n        Gdiplus::GdiplusStartup(&token, &si, &so);\r\n        if (noBgThread)\r\n            so.NotificationHook(&hookToken);\r\n    }\r\n    ~ScopedGdiPlus() {\r\n        if (noBgThread)\r\n            so.NotificationUnhook(hookToken);\r\n        Gdiplus::GdiplusShutdown(token);\r\n    }\r\n};\r\n"
  },
  {
    "path": "src/utils/SerializeTxt.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"StrSlice.h\"\r\n#include \"SerializeTxt.h\"\r\n#include \"TxtParser.h\"\r\n\r\nnamespace sertxt {\r\n\r\n#define NL \"\\r\\n\"\r\n\r\nstatic const StructMetadata *GetStructDef(const FieldMetadata *fieldDef)\r\n{\r\n    CrashIf(0 == fieldDef->defValOrDefinition);\r\n    return (const StructMetadata *)fieldDef->defValOrDefinition;\r\n}\r\n\r\n// the assumption here is that the data was either built by Deserialize()\r\n// or was created by application code in a way that observes our rule: each\r\n// struct and string was separately allocated with malloc()\r\nvoid FreeStruct(uint8_t *structStart, const StructMetadata *def)\r\n{\r\n    if (!structStart)\r\n        return;\r\n    Type type;\r\n    const FieldMetadata *fieldDef = nullptr;\r\n    for (int i = 0; i < def->nFields; i++) {\r\n        fieldDef = def->fields + i;\r\n        uint8_t *data = structStart + fieldDef->offset;\r\n        type = (Type)(fieldDef->type & TYPE_MASK);\r\n        if (TYPE_STRUCT_PTR ==  type) {\r\n            uint8_t **p = (uint8_t**)data;\r\n            FreeStruct(*p, GetStructDef(fieldDef));\r\n            *p = nullptr;\r\n        } else if (TYPE_ARRAY == type) {\r\n            Vec<uint8_t*> **vecPtr = (Vec<uint8_t*> **)data;\r\n            Vec<uint8_t*> *vec = *vecPtr;\r\n            CrashIf(!vec);\r\n            for (size_t j = 0; j < vec->Count(); j++) {\r\n                FreeStruct(vec->At(j), GetStructDef(fieldDef));\r\n            }\r\n            delete vec;\r\n            *vecPtr = nullptr;\r\n        } else if ((TYPE_STR == type) || (TYPE_WSTR == type)) {\r\n            char **sp = (char**)data;\r\n            char *s = *sp;\r\n            free(s);\r\n            *sp = nullptr;\r\n        }\r\n    }\r\n    free(structStart);\r\n}\r\n\r\nstatic bool IsSignedIntType(Type type)\r\n{\r\n    return ((TYPE_I16 == type) ||\r\n            (TYPE_I32 == type));\r\n}\r\n\r\nstatic bool IsUnsignedIntType(Type type)\r\n{\r\n    return ((TYPE_U16 == type) ||\r\n            (TYPE_U32 == type) ||\r\n            (TYPE_U64 == type));\r\n}\r\n\r\nstatic bool WriteStructInt(uint8_t *p, Type type, int64_t val)\r\n{\r\n    if (TYPE_I16 == type) {\r\n        if (val > 0xffff)\r\n            return false;\r\n        int16_t v = (int16_t)val;\r\n        int16_t *vp = (int16_t*)p;\r\n        *vp = v;\r\n        return true;\r\n    }\r\n\r\n    if (TYPE_I32 == type) {\r\n        if (val > 0xffffffff)\r\n            return false;\r\n        int32_t v = (int32_t)val;\r\n        int32_t *vp = (int32_t*)p;\r\n        *vp = v;\r\n        return true;\r\n    }\r\n    CrashIf(true);\r\n    return false;\r\n}\r\n\r\nstatic void WriteStructBool(uint8_t *p, bool val)\r\n{\r\n    bool *bp = (bool*)p;\r\n    if (val)\r\n        *bp = true;\r\n    else\r\n        *bp = false;\r\n}\r\n\r\nstatic bool WriteStructUInt(uint8_t *p, Type type, uint64_t val)\r\n{\r\n    if (TYPE_U16 == type) {\r\n        if (val > 0xffff)\r\n            return false;\r\n        uint16_t v = (uint16_t)val;\r\n        uint16_t *vp = (uint16_t*)p;\r\n        *vp = v;\r\n        return true;\r\n    }\r\n\r\n    if ((TYPE_U32 == type) || (TYPE_COLOR == type)) {\r\n        if (val > 0xffffffff)\r\n            return false;\r\n        uint32_t v = (uint32_t)val;\r\n        uint32_t *vp = (uint32_t*)p;\r\n        *vp = v;\r\n        return true;\r\n    }\r\n\r\n    if (TYPE_U64 == type) {\r\n        uint64_t *vp = (uint64_t*)p;\r\n        *vp = val;\r\n        return true;\r\n    }\r\n\r\n    CrashIf(true);\r\n    return false;\r\n}\r\n\r\nstatic void WriteStructPtrVal(uint8_t *p, void *val)\r\n{\r\n    void **pp = (void**)p;\r\n    *pp = val;\r\n}\r\n\r\nstatic void WriteStructStr(uint8_t *p, char *s)\r\n{\r\n    char **sp = (char **)p;\r\n    *sp = s;\r\n}\r\n\r\nstatic void WriteStructWStr(uint8_t *p, WCHAR *s)\r\n{\r\n    WCHAR **sp = (WCHAR **)p;\r\n    *sp = s;\r\n}\r\n\r\nstatic void WriteStructFloat(uint8_t *p, float f)\r\n{\r\n    float *fp = (float*)p;\r\n    *fp = f;\r\n}\r\n\r\nstatic bool ReadStructBool(const uint8_t *p)\r\n{\r\n    bool *bp = (bool*)p;\r\n    return *bp;\r\n}\r\n\r\nstatic int64_t ReadStructInt(const uint8_t *p, Type type)\r\n{\r\n    if (TYPE_I16 == type) {\r\n        int16_t *vp = (int16_t*)p;\r\n        return (int64_t)*vp;\r\n    }\r\n    if (TYPE_I32 == type) {\r\n        int32_t *vp = (int32_t*)p;\r\n        return (int64_t)*vp;\r\n    }\r\n    CrashIf(true);\r\n    return 0;\r\n}\r\n\r\nstatic uint64_t ReadStructUInt(const uint8_t *p, Type type)\r\n{\r\n    if (TYPE_U16 == type) {\r\n        uint16_t *vp = (uint16_t*)p;\r\n        return (uint64_t)*vp;\r\n    }\r\n    if ((TYPE_U32 == type) || (TYPE_COLOR == type)) {\r\n        uint32_t *vp = (uint32_t*)p;\r\n        return (uint64_t)*vp;\r\n    }\r\n    if (TYPE_U64 == type) {\r\n        uint64_t *vp = (uint64_t*)p;\r\n        return *vp;\r\n    }\r\n    CrashIf(true);\r\n    return 0;\r\n}\r\n\r\nstatic float ReadStructFloat(const uint8_t *p)\r\n{\r\n    float *fp = (float*)p;\r\n    return *fp;\r\n}\r\n\r\nstatic void *ReadStructPtr(const uint8_t *p)\r\n{\r\n    void **pp = (void**)p;\r\n    return *pp;\r\n}\r\n\r\nclass DecodeState {\r\npublic:\r\n    // data being decoded\r\n    TxtParser       parser;\r\n    DecodeState() {}\r\n};\r\n\r\nstatic bool ParseUInt(char *s, char *e, uint64_t *nOut)\r\n{\r\n    str::TrimWsEnd(s, e);\r\n    int d;\r\n    uint64_t n = 0;\r\n    uint64_t prev = 0;\r\n    while (s < e) {\r\n        d = *s - '0';\r\n        if (d < 0 || d > 9)\r\n            return false;\r\n        n = n * 10 + d;\r\n        if (n < prev) {\r\n            // on overflow return 0\r\n            *nOut = 0;\r\n            return true;\r\n        }\r\n        prev = n;\r\n        ++s;\r\n    }\r\n    *nOut = n;\r\n    return true;\r\n}\r\n\r\nstatic bool ParseInt(char *s, char *e, int64_t *iOut)\r\n{\r\n    if (s >= e)\r\n        return false;\r\n\r\n    bool neg = false;\r\n    if ('-' == *s) {\r\n        neg = true;\r\n        s++;\r\n    }\r\n    uint64_t u;\r\n    if (!ParseUInt(s, e, &u))\r\n        return false;\r\n#if 0 // TODO:: why is this missing?\r\n    if (u > MAXLONG64)\r\n        return false;\r\n#endif\r\n    int64_t i = (int64_t)u;\r\n    if (neg)\r\n        i = -i;\r\n    *iOut = i;\r\n    return true;\r\n}\r\n\r\nstatic bool ParseColor(char *s, char *e, COLORREF *colOut)\r\n{\r\n    str::TrimWsEnd(s, e);\r\n    *e = 0;\r\n    int a, r, g, b;\r\n    if (!str::Parse(s, \"#%2x%2x%2x%2x\", &a, &r, &g, &b)) {\r\n        a = 0;\r\n        if (!str::Parse(s, \"#%2x%2x%2x\", &r, &g, &b)) {\r\n            return false;\r\n        }\r\n    }\r\n    COLORREF col =  RGB(r, g, b);\r\n    COLORREF alpha = (COLORREF)a;\r\n    alpha = alpha << 24;\r\n    col = col | alpha;\r\n    *colOut = col;\r\n    return true;\r\n}\r\n\r\nstatic bool ParseBool(char *s, char *e, bool *bOut)\r\n{\r\n    str::TrimWsEnd(s, e);\r\n    size_t len = e - s;\r\n    if (4 == len && str::EqNI(s, \"true\", 4)) {\r\n        *bOut = true;\r\n        return true;\r\n    }\r\n    if (5 == len && str::EqNI(s, \"false\", 5)) {\r\n        *bOut = false;\r\n        return true;\r\n    }\r\n    int64_t i;\r\n    if (!ParseInt(s, e, &i))\r\n        return false;\r\n    if (0 == i) {\r\n        *bOut = false;\r\n        return true;\r\n    }\r\n    if (1 == i) {\r\n        *bOut = true;\r\n        return true;\r\n    }\r\n    return false;\r\n}\r\n\r\nstatic bool ParseFloat(char *s, char *e, float *f)\r\n{\r\n    char *end = e;\r\n    *f = (float)strtod(s, &end);\r\n    return true;\r\n}\r\n\r\nstatic uint8_t* DeserializeRec(DecodeState& ds, TxtNode *firstNode, const StructMetadata *def);\r\n\r\nstatic TxtNode *FindNode(TxtNode *curr, const char *name, size_t nameLen)\r\n{\r\n    if (!curr)\r\n        return nullptr;\r\n\r\n    char *nodeName;\r\n    size_t nodeNameLen;\r\n\r\n    TxtNode *child;\r\n    TxtNode *found = nullptr;\r\n    for (size_t i = 0; i < curr->children->Count(); i++) {\r\n        child = curr->children->At(i);\r\n        if (TextNode == child->type || StructNode == child->type) {\r\n            nodeName = child->keyStart;\r\n            nodeNameLen = child->keyEnd - nodeName;\r\n            if (nameLen == nodeNameLen && str::EqNI(name, nodeName, nameLen))\r\n                return child;\r\n        }\r\n        if (TextNode == child->type)\r\n            continue;\r\n        found = FindNode(child, name, nameLen);\r\n        if (found)\r\n            return found;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nstatic void WriteDefaultValue(uint8_t *structDataPtr, Type type)\r\n{\r\n    // all other types have default value of 0, which we get for\r\n    // free because the memory for struct is zero-allocated\r\n    if (TYPE_FLOAT == type) {\r\n        WriteStructFloat(structDataPtr, 0);\r\n    }\r\n}\r\n\r\nstatic void FreeTxtNode(TxtNode *node)\r\n{\r\n    if (node->children) {\r\n        for (size_t i = 0; i < node->children->Count(); i++) {\r\n            TxtNode *child = node->children->At(i);\r\n            CrashIf(TextNode != child->type);\r\n            delete child;\r\n        }\r\n    }\r\n    delete node->children;\r\n    delete node;\r\n}\r\n\r\nstatic TxtNode *StructNodeFromTextNode(DecodeState& ds, TxtNode *txtNode, const StructMetadata *structDef)\r\n{\r\n    UNUSED(ds);\r\n    CrashIf(TextNode != txtNode->type);\r\n    str::Slice slice(txtNode->valStart, txtNode->valEnd);\r\n    TxtNode *node = new TxtNode(StructNode);\r\n    node->children = new Vec<TxtNode*>();\r\n    uint16_t fieldNo = 0;\r\n    char *fieldName = (char*)structDef->fieldNames;\r\n    TxtNode *child;\r\n    for (;;) {\r\n        slice.SkipWsUntilNewline();\r\n        if (slice.Finished())\r\n            goto Error;\r\n        child = new TxtNode(TextNode);\r\n        child->valStart = slice.curr;\r\n        slice.SkipNonWs();\r\n        child->valEnd = slice.curr;\r\n        child->keyStart = fieldName;\r\n        child->keyEnd = fieldName + str::Len(fieldName);\r\n        node->children->Append(child);\r\n        ++fieldNo;\r\n        if (fieldNo == structDef->nFields)\r\n            break;\r\n        seqstrings::SkipStr(fieldName);\r\n    }\r\n    return node;\r\nError:\r\n    FreeTxtNode(node);\r\n    return nullptr;\r\n}\r\n\r\nstatic uint8_t *DeserializeCompact(DecodeState& ds, TxtNode *node, const StructMetadata *structDef)\r\n{\r\n    CrashIf(TextNode != node->type);\r\n    TxtNode *structNode = StructNodeFromTextNode(ds, node, structDef);\r\n    if (!structNode)\r\n        return nullptr;\r\n    uint8_t *res = DeserializeRec(ds, structNode, structDef);\r\n    FreeTxtNode(structNode);\r\n    return res;\r\n}\r\n\r\nstatic uint8_t *DecodeStruct(DecodeState& ds, const FieldMetadata *fieldDef, TxtNode *node, bool isCompact)\r\n{\r\n    uint8_t *d = nullptr;\r\n    if (isCompact && (TextNode == node->type)) {\r\n        d = DeserializeCompact(ds, node, GetStructDef(fieldDef));\r\n    } else {\r\n        if (StructNode == node->type)\r\n            d = DeserializeRec(ds, node, GetStructDef(fieldDef));\r\n    }\r\n    return d;\r\n}\r\n\r\nstatic bool DecodeField(DecodeState& ds, TxtNode *firstNode, const char *fieldName, const FieldMetadata *fieldDef, uint8_t *structDataStart)\r\n{\r\n    Type type = fieldDef->type;\r\n    uint8_t *structDataPtr = structDataStart + fieldDef->offset;\r\n\r\n    if ((type & TYPE_NO_STORE_MASK) != 0) {\r\n        WriteDefaultValue(structDataPtr, type);\r\n        return true;\r\n    }\r\n\r\n    bool isCompact = ((type & TYPE_STORE_COMPACT_MASK) != 0);\r\n    type = (Type)(type & TYPE_MASK);\r\n\r\n    size_t fieldNameLen = str::Len(fieldName);\r\n\r\n    // if the node doesn't exist in data, try to get it from default data\r\n    TxtNode *node = FindNode(firstNode, fieldName, fieldNameLen);\r\n    if (!node) {\r\n        WriteDefaultValue(structDataPtr, type);\r\n        return true;\r\n    }\r\n    bool ok;\r\n    if (TYPE_BOOL == type) {\r\n        bool bVal;\r\n        ok = ParseBool(node->valStart, node->valEnd, &bVal);\r\n        if (!ok)\r\n            return false;\r\n        WriteStructBool(structDataPtr, bVal);\r\n    } else if (TYPE_COLOR == type) {\r\n        COLORREF val;\r\n        ok = ParseColor(node->valStart, node->valEnd, &val);\r\n        if (ok)\r\n            WriteStructUInt(structDataPtr, TYPE_COLOR, val);\r\n    } else if (IsUnsignedIntType(type)) {\r\n        uint64_t n;\r\n        ok = ParseUInt(node->valStart, node->valEnd, &n);\r\n        if (ok)\r\n            ok = WriteStructUInt(structDataPtr, type, n);\r\n    } else if (IsSignedIntType(type)) {\r\n        int64_t n;\r\n        ok = ParseInt(node->valStart, node->valEnd, &n);\r\n        if (ok)\r\n            ok = WriteStructInt(structDataPtr, type, n);\r\n    } else if (TYPE_STRUCT_PTR == type) {\r\n        uint8_t *d = DecodeStruct(ds, fieldDef, node, isCompact);\r\n        if (d)\r\n            WriteStructPtrVal(structDataPtr, d);\r\n    } else if (TYPE_STR == type) {\r\n        char *s = node->valStart;\r\n        size_t sLen = node->valEnd - s;\r\n        if (s && (sLen > 0)) {\r\n            // note: we don't free s because it's remembered in structDataPtr\r\n            s = str::DupN(s, sLen);\r\n            WriteStructStr(structDataPtr, s);\r\n        }\r\n    } else if (TYPE_WSTR == type) {\r\n        char *s = node->valStart;\r\n        size_t sLen = node->valEnd - s;\r\n        if (s && (sLen > 0)) {\r\n            // note: we don't free ws because it's remembered in structDataPtr\r\n            WCHAR *ws = str::conv::FromUtf8(s);\r\n            WriteStructWStr(structDataPtr, ws);\r\n        }\r\n    }  else if (TYPE_FLOAT == type) {\r\n        float f;\r\n        ok = ParseFloat(node->valStart, node->valEnd, &f);\r\n        if (ok)\r\n            WriteStructFloat(structDataPtr, f);\r\n    } else if (TYPE_ARRAY == type) {\r\n        if (StructNode != node->type)\r\n            return false;\r\n        Vec<uint8_t*> *vec = new Vec<uint8_t*>();\r\n        // we remember it right away, so that it gets freed in case of error\r\n        WriteStructPtrVal(structDataPtr, (void*)vec);\r\n        TxtNode *child;\r\n        for (size_t i = 0; i < node->children->Count(); i++) {\r\n            child = node->children->At(i);\r\n            uint8_t *d = DecodeStruct(ds, fieldDef, child, isCompact);\r\n            if (d)\r\n                vec->Append(d);\r\n        }\r\n    } else {\r\n        CrashIf(true);\r\n        return false;\r\n    }\r\n    return true;\r\n}\r\n\r\nstatic uint8_t* DeserializeRec(DecodeState& ds, TxtNode *firstNode, const StructMetadata *def)\r\n{\r\n    bool ok = true;\r\n    if (!firstNode)\r\n        return nullptr;\r\n\r\n    uint8_t *res = AllocArray<uint8_t>(def->size);\r\n    const StructMetadata **defPtr = (const StructMetadata**)res;\r\n    *defPtr = def;\r\n    const char *fieldName = def->fieldNames;\r\n    for (int i = 0; i < def->nFields; i++) {\r\n        ok = DecodeField(ds, firstNode, fieldName, def->fields + i, res);\r\n        if (!ok)\r\n            goto Error;\r\n        seqstrings::SkipStr(fieldName);\r\n    }\r\n    return res;\r\nError:\r\n    FreeStruct(res, def);\r\n    return nullptr;\r\n}\r\n\r\nuint8_t* Deserialize(struct TxtNode *root, const StructMetadata *def)\r\n{\r\n    DecodeState ds;\r\n    return DeserializeRec(ds, root, def);\r\n}\r\n\r\nuint8_t* Deserialize(char *data, size_t dataSize, const StructMetadata *def)\r\n{\r\n    if (!data)\r\n        return nullptr;\r\n\r\n    DecodeState ds;\r\n    ds.parser.SetToParse(data, dataSize);\r\n    bool ok = ParseTxt(ds.parser);\r\n    if (!ok)\r\n        return nullptr;\r\n\r\n    return DeserializeRec(ds, ds.parser.nodes.At(0), def);\r\n}\r\n\r\nstatic void AppendNest(str::Str<char>& s, int nest)\r\n{\r\n    while (nest > 0) {\r\n        s.Append(\"  \");\r\n        --nest;\r\n    }\r\n}\r\n\r\nstatic void AppendVal(const char *val, char escapeChar, bool compact, str::Str<char>& res)\r\n{\r\n    const char *start = val;\r\n    const char *s = start;\r\n    char escaped = 0;\r\n    while (*s) {\r\n        char c = *s++;\r\n        if (escapeChar == c)\r\n            escaped = escapeChar;\r\n        else if (']' == c)\r\n            escaped = ']';\r\n        else if ('[' == c)\r\n            escaped = '[';\r\n        else if ('\\n' == c)\r\n            escaped = 'n';\r\n        else if ('\\r' == c)\r\n            escaped = 'r';\r\n        if (0 == escaped)\r\n            continue;\r\n\r\n        size_t len = s - start - 1;\r\n        res.Append(start, len);\r\n        res.Append(escapeChar);\r\n        res.Append(escaped);\r\n        start = s;\r\n        escaped = 0;\r\n    }\r\n    size_t len = s - start;\r\n    res.Append(start, len);\r\n    if (!compact)\r\n        res.Append(NL);\r\n}\r\n\r\nstruct EncodeState {\r\n    str::Str<char>  res;\r\n\r\n    char            escapeChar;\r\n\r\n    // nesting level for the currently serialized value\r\n    int             nest;\r\n\r\n    // is currently serialized structure in compact form\r\n    bool            compact;\r\n\r\n    EncodeState() {\r\n        escapeChar = SERIALIZE_ESCAPE_CHAR;\r\n        nest = 0;\r\n        compact = false;\r\n    }\r\n};\r\n\r\nstatic void AppendKeyVal(EncodeState& es, const char *key, const char *val)\r\n{\r\n    if (es.compact) {\r\n        es.res.Append(\" \");\r\n    } else {\r\n        AppendNest(es.res, es.nest);\r\n        es.res.Append(key);\r\n        es.res.Append(\": \");\r\n    }\r\n    AppendVal(val, es.escapeChar, es.compact, es.res);\r\n}\r\n\r\nvoid SerializeRec(EncodeState& es, const uint8_t *structStart, const StructMetadata *def);\r\n\r\nstatic void SerializeField(EncodeState& es, const char *fieldName, const FieldMetadata *fieldDef, const uint8_t *structStart)\r\n{\r\n    str::Str<char> val;\r\n    str::Str<char>& res = es.res;\r\n\r\n    Type type = fieldDef->type;\r\n    if ((type & TYPE_NO_STORE_MASK) != 0)\r\n        return;\r\n\r\n    if (!structStart)\r\n        return;\r\n\r\n    bool isCompact = ((type & TYPE_STORE_COMPACT_MASK) != 0);\r\n    type = (Type)(type & TYPE_MASK);\r\n\r\n    const uint8_t *data = structStart + fieldDef->offset;\r\n    if (TYPE_BOOL == type) {\r\n        bool b = ReadStructBool(data);\r\n        AppendKeyVal(es, fieldName, b ? \"true\" : \"false\");\r\n    } else if (TYPE_COLOR == type) {\r\n        uint64_t u = ReadStructUInt(data, type);\r\n        COLORREF c = (COLORREF)u;\r\n        int r = (int)((uint8_t)(c & 0xff));\r\n        int g = (int)((uint8_t)((c >> 8) & 0xff));\r\n        int b = (int)((uint8_t)((c >> 16) & 0xff));\r\n        int a = (int)((uint8_t)((c >> 24) & 0xff));\r\n        if (a > 0)\r\n            val.AppendFmt(\"#%02x%02x%02x%02x\", a, r, g, b);\r\n        else\r\n            val.AppendFmt(\"#%02x%02x%02x\", r, g, b);\r\n        AppendKeyVal(es, fieldName, val.Get());\r\n    } else if (IsUnsignedIntType(type)) {\r\n        uint64_t u = ReadStructUInt(data, type);\r\n        //val.AppendFmt(\"%\" PRIu64, u);\r\n        val.AppendFmt(\"%I64u\", u);\r\n        AppendKeyVal(es, fieldName, val.Get());\r\n    } else if (IsSignedIntType(type)) {\r\n        int64_t i = ReadStructInt(data, type);\r\n        //val.AppendFmt(\"%\" PRIi64, u);\r\n        val.AppendFmt(\"%I64d\", i);\r\n        AppendKeyVal(es, fieldName, val.Get());\r\n    } else if (TYPE_FLOAT == type) {\r\n        float f = ReadStructFloat(data);\r\n        val.AppendFmt(\"%g\", f);\r\n        AppendKeyVal(es, fieldName, val.Get());\r\n    } else if (TYPE_STR == type) {\r\n        char *s = (char*)ReadStructPtr(data);\r\n        if (s)\r\n            AppendKeyVal(es, fieldName, s);\r\n    } else if (TYPE_WSTR == type) {\r\n        WCHAR *s = (WCHAR*)ReadStructPtr(data);\r\n        if (s) {\r\n            ScopedMem<char> val2(str::conv::ToUtf8(s));\r\n            AppendKeyVal(es, fieldName, val2);\r\n        }\r\n    } else if (TYPE_STRUCT_PTR == type) {\r\n        AppendNest(res, es.nest);\r\n        res.Append(fieldName);\r\n        if (isCompact)\r\n            res.Append(\":\");\r\n        else\r\n            res.Append(\" [\" NL);\r\n        const uint8_t *structStart2 = (const uint8_t *)ReadStructPtr(data);\r\n        ++es.nest;\r\n        // compact status only lives for one structure, so this is enough\r\n        es.compact = isCompact;\r\n        SerializeRec(es, structStart2, GetStructDef(fieldDef));\r\n        --es.nest;\r\n        es.compact = false;\r\n        if (isCompact) {\r\n            res.Append(NL);\r\n        } else {\r\n            AppendNest(res, es.nest);\r\n            res.Append(\"]\" NL);\r\n        }\r\n    } else if (TYPE_ARRAY == type) {\r\n        AppendNest(res, es.nest);\r\n        res.Append(fieldName);\r\n        res.Append(\" [\" NL);\r\n        Vec<const uint8_t*> *vec = (Vec<const uint8_t*> *)ReadStructPtr(data);\r\n        ++es.nest;\r\n        for (size_t i = 0; vec && (i < vec->Count()); i++) {\r\n            AppendNest(res, es.nest);\r\n            res.Append(\"[\" NL);\r\n            const uint8_t *elData = vec->At(i);\r\n            ++es.nest;\r\n            SerializeRec(es, elData, GetStructDef(fieldDef));\r\n            --es.nest;\r\n            AppendNest(res, es.nest);\r\n            res.Append(\"]\" NL);\r\n        }\r\n        --es.nest;\r\n        AppendNest(res, es.nest);\r\n        res.Append(\"]\" NL);\r\n    } else {\r\n        CrashIf(true);\r\n    }\r\n}\r\n\r\nvoid SerializeRec(EncodeState& es, const uint8_t *structStart, const StructMetadata *def)\r\n{\r\n    if (!structStart)\r\n        return;\r\n    const char *fieldName = def->fieldNames;\r\n    for (size_t i = 0; i < def->nFields; i++) {\r\n        const FieldMetadata *fieldDef = &def->fields[i];\r\n        SerializeField(es, fieldName, fieldDef, structStart);\r\n        seqstrings::SkipStr(fieldName);\r\n    }\r\n}\r\n\r\nuint8_t *Serialize(const uint8_t *rootStruct, const StructMetadata *def, size_t *sizeOut)\r\n{\r\n    EncodeState es;\r\n    es.res.Append(UTF8_BOM \"; see http://www.sumatrapdfreader.org/settings.html for documentation\" NL);\r\n    es.nest = 0;\r\n    SerializeRec(es, rootStruct, def);\r\n    if (sizeOut)\r\n        *sizeOut = es.res.Size();\r\n    return (uint8_t *)es.res.StealData();\r\n}\r\n\r\n} // namespace sertxt\r\n"
  },
  {
    "path": "src/utils/SerializeTxt.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nstruct TxtNode;\r\n\r\nnamespace sertxt {\r\n\r\nstruct FieldMetadata;\r\n\r\ntypedef struct {\r\n    uint16_t                size;\r\n    uint16_t                nFields;\r\n    const char *            fieldNames;\r\n    const FieldMetadata *   fields;\r\n} StructMetadata;\r\n\r\ntypedef enum {\r\n    TYPE_BOOL,\r\n    TYPE_I16,\r\n    TYPE_U16,\r\n    TYPE_I32,\r\n    TYPE_U32,\r\n    TYPE_U64,\r\n    TYPE_FLOAT,\r\n    TYPE_COLOR,\r\n    TYPE_STR,\r\n    TYPE_WSTR,\r\n    TYPE_STRUCT_PTR,\r\n    TYPE_ARRAY,\r\n    // do && with TYPE_MASK to get just the type, no flags\r\n    TYPE_MASK = 0xFF,\r\n    // a flag, if set the value is not to be serialized\r\n    TYPE_NO_STORE_MASK = 0x4000,\r\n    // a flag, if set the value is serialized in a compact form\r\n    TYPE_STORE_COMPACT_MASK = 0x8000,\r\n} Type;\r\n\r\n// TODO: re-arrange fields for max compactness\r\n// information about a single field\r\nstruct FieldMetadata {\r\n    // offset of the value from the beginning of the struct\r\n    uint16_t         offset;\r\n    Type             type;\r\n    // StructMetadata * for TYP_ARRAY and TYPE_STRUCT_PT\r\n    // otherwise default value for this field\r\n    uintptr_t        defValOrDefinition;\r\n};\r\n\r\nuint8_t *   Serialize(const uint8_t *data,  const StructMetadata *def, size_t *sizeOut);\r\nuint8_t*    Deserialize(struct TxtNode *root, const StructMetadata *def);\r\nuint8_t*    Deserialize(char *data, size_t dataSize, const StructMetadata *def);\r\nvoid        FreeStruct(uint8_t *data, const StructMetadata *def);\r\n\r\n} // namespace sertxt\r\n"
  },
  {
    "path": "src/utils/SettingsUtil.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"SettingsUtil.h\"\r\n#include \"SquareTreeParser.h\"\r\n\r\nstatic inline const StructInfo *GetSubstruct(const FieldInfo& field)\r\n{\r\n    return (const StructInfo *)field.value;\r\n}\r\n\r\nstatic int ParseInt(const char *bytes)\r\n{\r\n    bool negative = *bytes == '-';\r\n    if (negative)\r\n        bytes++;\r\n    int value = 0;\r\n    for (; str::IsDigit(*bytes); bytes++) {\r\n        value = value * 10 + (*bytes - '0');\r\n        // return 0 on overflow\r\n        if (value - (negative ? 1 : 0) < 0)\r\n            return 0;\r\n    }\r\n    return negative ? -value : value;\r\n}\r\n\r\n// only escape characters which are significant to SquareTreeParser:\r\n// newlines and leading/trailing whitespace (and escape characters)\r\nstatic bool NeedsEscaping(const char *s)\r\n{\r\n    return str::IsWs(*s) || *s && str::IsWs(*(s + str::Len(s) - 1)) ||\r\n           str::FindChar(s, '\\n') || str::FindChar(s, '\\r') || str::FindChar(s, '$');\r\n}\r\n\r\nstatic void EscapeStr(str::Str<char>& out, const char *s)\r\n{\r\n    CrashIf(!NeedsEscaping(s));\r\n    if (str::IsWs(*s) && *s != '\\n' && *s != '\\r')\r\n        out.Append('$');\r\n    for (const char *c = s; *c; c++) {\r\n        switch (*c) {\r\n        case '$': out.Append(\"$$\"); break;\r\n        case '\\n': out.Append(\"$n\"); break;\r\n        case '\\r': out.Append(\"$r\"); break;\r\n        default: out.Append(*c);\r\n        }\r\n    }\r\n    if (*s && str::IsWs(s[str::Len(s) - 1]))\r\n        out.Append('$');\r\n}\r\n\r\nstatic char *UnescapeStr(const char *s)\r\n{\r\n    if (!str::FindChar(s, '$'))\r\n        return str::Dup(s);\r\n\r\n    str::Str<char> ret;\r\n    const char *end = s + str::Len(s);\r\n    if ('$' == *s && str::IsWs(*(s + 1)))\r\n        s++; // leading whitespace\r\n    for (const char *c = s; c < end; c++) {\r\n        if (*c != '$') {\r\n            ret.Append(*c);\r\n            continue;\r\n        }\r\n        switch (*++c) {\r\n        case '$': ret.Append('$'); break;\r\n        case 'n': ret.Append('\\n'); break;\r\n        case 'r': ret.Append('\\r'); break;\r\n        case '\\0': break; // trailing whitespace\r\n        default:\r\n            // keep all other instances of the escape character\r\n            ret.Append('$');\r\n            ret.Append(*c);\r\n            break;\r\n        }\r\n    }\r\n    return ret.StealData();\r\n}\r\n\r\n// string arrays are serialized by quoting strings containing spaces\r\n// or quotation marks (doubling quotation marks within quotes);\r\n// this is simpler than full command line serialization as read by ParseCmdLine\r\nstatic char *SerializeStringArray(const Vec<WCHAR *> *strArray)\r\n{\r\n    str::Str<WCHAR> serialized;\r\n\r\n    for (size_t i = 0; i < strArray->Count(); i++) {\r\n        if (i > 0)\r\n            serialized.Append(' ');\r\n        const WCHAR *str = strArray->At(i);\r\n        bool needsQuotes = !*str;\r\n        for (const WCHAR *c = str; !needsQuotes && *c; c++) {\r\n            needsQuotes = str::IsWs(*c) || '\"' == *c;\r\n        }\r\n        if (!needsQuotes) {\r\n            serialized.Append(str);\r\n        }\r\n        else {\r\n            serialized.Append('\"');\r\n            for (const WCHAR *c = str; *c; c++) {\r\n                if ('\"' == *c)\r\n                    serialized.Append('\"');\r\n                serialized.Append(*c);\r\n            }\r\n            serialized.Append('\"');\r\n        }\r\n    }\r\n\r\n    return str::conv::ToUtf8(serialized.Get());\r\n}\r\n\r\nstatic void DeserializeStringArray(Vec<WCHAR *> *strArray, const char *serialized)\r\n{\r\n    ScopedMem<WCHAR> str(str::conv::FromUtf8(serialized));\r\n    const WCHAR *s = str.Get();\r\n\r\n    for (;;) {\r\n        while (str::IsWs(*s))\r\n            s++;\r\n        if (!*s)\r\n            return;\r\n        if ('\"' == *s) {\r\n            str::Str<WCHAR> part;\r\n            for (s++; *s && (*s != '\"' || *(s + 1) == '\"'); s++) {\r\n                if ('\"' == *s)\r\n                    s++;\r\n                part.Append(*s);\r\n            }\r\n            strArray->Append(part.StealData());\r\n            if ('\"' == *s)\r\n                s++;\r\n        }\r\n        else {\r\n            const WCHAR *e;\r\n            for (e = s; *e && !str::IsWs(*e); e++);\r\n            strArray->Append(str::DupN(s, e - s));\r\n            s = e;\r\n        }\r\n    }\r\n}\r\n\r\nstatic void FreeStringArray(Vec<WCHAR *> *strArray)\r\n{\r\n    if (!strArray)\r\n        return;\r\n    strArray->FreeMembers();\r\n    delete strArray;\r\n}\r\n\r\nstatic void FreeArray(Vec<void *> *array, const FieldInfo& field)\r\n{\r\n    for (size_t j = 0; array && j < array->Count(); j++) {\r\n        FreeStruct(GetSubstruct(field), array->At(j));\r\n    }\r\n    delete array;\r\n}\r\n\r\n#ifndef NDEBUG\r\nstatic bool IsCompactable(const StructInfo *info)\r\n{\r\n    for (size_t i = 0; i < info->fieldCount; i++) {\r\n        switch (info->fields[i].type) {\r\n        case Type_Bool: case Type_Int: case Type_Float: case Type_Color:\r\n            continue;\r\n        default:\r\n            return false;\r\n        }\r\n    }\r\n    return info->fieldCount > 0;\r\n}\r\n#endif\r\n\r\nstatic_assert(sizeof(float) == sizeof(int) && sizeof(COLORREF) == sizeof(int),\r\n              \"compact array code can't be simplified if int, float and colorref are of different sizes\");\r\n\r\nstatic bool SerializeField(str::Str<char>& out, const uint8_t *base, const FieldInfo& field)\r\n{\r\n    const uint8_t *fieldPtr = base + field.offset;\r\n    ScopedMem<char> value;\r\n    COLORREF c;\r\n\r\n    switch (field.type) {\r\n    case Type_Bool:\r\n        out.Append(*(bool *)fieldPtr ? \"true\" : \"false\");\r\n        return true;\r\n    case Type_Int:\r\n        out.AppendFmt(\"%d\", *(int *)fieldPtr);\r\n        return true;\r\n    case Type_Float:\r\n        out.AppendFmt(\"%g\", *(float *)fieldPtr);\r\n        return true;\r\n    case Type_Color:\r\n        c = *(COLORREF *)fieldPtr;\r\n        if (((c >> 24) & 0xff))\r\n            out.AppendFmt(\"#%02x%02x%02x%02x\", (c >> 24) & 0xff, GetRValueSafe(c), GetGValueSafe(c), GetBValueSafe(c));\r\n        else\r\n            out.AppendFmt(\"#%02x%02x%02x\", GetRValueSafe(c), GetGValueSafe(c), GetBValueSafe(c));\r\n        return true;\r\n    case Type_String:\r\n        if (!*(const WCHAR **)fieldPtr) {\r\n            CrashIf(field.value);\r\n            return false; // skip empty strings\r\n        }\r\n        value.Set(str::conv::ToUtf8(*(const WCHAR **)fieldPtr));\r\n        if (!NeedsEscaping(value))\r\n            out.Append(value);\r\n        else\r\n            EscapeStr(out, value);\r\n        return true;\r\n    case Type_Utf8String:\r\n        if (!*(const char **)fieldPtr) {\r\n            CrashIf(field.value);\r\n            return false; // skip empty strings\r\n        }\r\n        if (!NeedsEscaping(*(const char **)fieldPtr))\r\n            out.Append(*(const char **)fieldPtr);\r\n        else\r\n            EscapeStr(out, *(const char **)fieldPtr);\r\n        return true;\r\n    case Type_Compact:\r\n        assert(IsCompactable(GetSubstruct(field)));\r\n        for (size_t i = 0; i < GetSubstruct(field)->fieldCount; i++) {\r\n            if (i > 0)\r\n                out.Append(' ');\r\n            SerializeField(out, fieldPtr, GetSubstruct(field)->fields[i]);\r\n        }\r\n        return true;\r\n    case Type_ColorArray:\r\n    case Type_FloatArray:\r\n    case Type_IntArray:\r\n        for (size_t i = 0; i < (*(Vec<int> **)fieldPtr)->Count(); i++) {\r\n            FieldInfo info = { 0 };\r\n            info.type = Type_IntArray == field.type ? Type_Int : Type_FloatArray == field.type ? Type_Float : Type_Color;\r\n            if (i > 0)\r\n                out.Append(' ');\r\n            SerializeField(out, (const uint8_t *)&(*(Vec<int> **)fieldPtr)->At(i), info);\r\n        }\r\n        // prevent empty arrays from being replaced with the defaults\r\n        return (*(Vec<int> **)fieldPtr)->Count() > 0 || field.value != 0;\r\n    case Type_StringArray:\r\n        value.Set(SerializeStringArray(*(Vec<WCHAR *> **)fieldPtr));\r\n        if (!NeedsEscaping(value))\r\n            out.Append(value);\r\n        else\r\n            EscapeStr(out, value);\r\n        // prevent empty arrays from being replaced with the defaults\r\n        return (*(Vec<WCHAR *> **)fieldPtr)->Count() > 0 || field.value != 0;\r\n    default:\r\n        CrashIf(true);\r\n        return false;\r\n    }\r\n}\r\n\r\nstatic void DeserializeField(const FieldInfo& field, uint8_t *base, const char *value)\r\n{\r\n    uint8_t *fieldPtr = base + field.offset;\r\n    int r, g, b, a;\r\n\r\n    switch (field.type) {\r\n    case Type_Bool:\r\n        if (value) {\r\n            // boolean true are \"true\", \"yes\" and any non-zero integer\r\n            *(bool *)fieldPtr = str::StartsWithI(value, \"true\") && (!value[4] || str::IsWs(value[4])) ||\r\n                                str::StartsWithI(value, \"yes\") && (!value[3] || str::IsWs(value[3])) ||\r\n                                ParseInt(value) != 0;\r\n        }\r\n        else\r\n            *(bool *)fieldPtr = field.value != 0;\r\n        break;\r\n    case Type_Int:\r\n        *(int *)fieldPtr = value ? ParseInt(value) : (int)field.value;\r\n        break;\r\n    case Type_Float:\r\n        str::Parse(value ? value : (const char *)field.value, \"%f\", (float *)fieldPtr);\r\n        break;\r\n    case Type_Color:\r\n        if (!value)\r\n            *(COLORREF *)fieldPtr = (COLORREF)field.value;\r\n        else if (str::Parse(value, \"#%2x%2x%2x%2x\", &a, &r, &g, &b))\r\n            *(COLORREF *)fieldPtr = RGB(r, g, b) | (a << 24);\r\n        else if (str::Parse(value, \"#%2x%2x%2x\", &r, &g, &b))\r\n            *(COLORREF *)fieldPtr = RGB(r, g, b);\r\n        break;\r\n    case Type_String:\r\n        free(*(WCHAR **)fieldPtr);\r\n        if (value)\r\n            *(WCHAR **)fieldPtr = str::conv::FromUtf8(ScopedMem<char>(UnescapeStr(value)));\r\n        else\r\n            *(WCHAR **)fieldPtr = str::Dup((const WCHAR *)field.value);\r\n        break;\r\n    case Type_Utf8String:\r\n        free(*(char **)fieldPtr);\r\n        if (value)\r\n            *(char **)fieldPtr = UnescapeStr(value);\r\n        else\r\n            *(char **)fieldPtr = str::Dup((const char *)field.value);\r\n        break;\r\n    case Type_Compact:\r\n        assert(IsCompactable(GetSubstruct(field)));\r\n        for (size_t i = 0; i < GetSubstruct(field)->fieldCount; i++) {\r\n            if (value) {\r\n                for (; str::IsWs(*value); value++);\r\n                if (!*value)\r\n                    value = nullptr;\r\n            }\r\n            DeserializeField(GetSubstruct(field)->fields[i], fieldPtr, value);\r\n            if (value)\r\n                for (; *value && !str::IsWs(*value); value++);\r\n        }\r\n        break;\r\n    case Type_ColorArray:\r\n    case Type_FloatArray:\r\n    case Type_IntArray:\r\n        if (!value)\r\n            value = (const char *)field.value;\r\n        delete *(Vec<int> **)fieldPtr;\r\n        *(Vec<int> **)fieldPtr = new Vec<int>();\r\n        while (value && *value) {\r\n            FieldInfo info = { 0 };\r\n            info.type = Type_IntArray == field.type ? Type_Int : Type_FloatArray == field.type ? Type_Float : Type_Color;\r\n            DeserializeField(info, (uint8_t *)(*(Vec<int> **)fieldPtr)->AppendBlanks(1), value);\r\n            for (; *value && !str::IsWs(*value); value++);\r\n            for (; str::IsWs(*value); value++);\r\n        }\r\n        break;\r\n    case Type_StringArray:\r\n        FreeStringArray(*(Vec<WCHAR *> **)fieldPtr);\r\n        *(Vec<WCHAR *> **)fieldPtr = new Vec<WCHAR *>();\r\n        if (value)\r\n            DeserializeStringArray(*(Vec<WCHAR *> **)fieldPtr, ScopedMem<char>(UnescapeStr(value)));\r\n        else if (field.value)\r\n            DeserializeStringArray(*(Vec<WCHAR *> **)fieldPtr, (const char *)field.value);\r\n        break;\r\n    default:\r\n        CrashIf(true);\r\n    }\r\n}\r\n\r\nstatic inline void Indent(str::Str<char>& out, int indent)\r\n{\r\n    while (indent-- > 0)\r\n        out.Append('\\t');\r\n}\r\n\r\nstatic void MarkFieldKnown(SquareTreeNode *node, const char *fieldName, SettingType type)\r\n{\r\n    if (!node)\r\n        return;\r\n    size_t off = 0;\r\n    if (Type_Struct == type || Type_Prerelease == type) {\r\n        if (node->GetChild(fieldName, &off)) {\r\n            delete node->data.At(off - 1).value.child;\r\n            node->data.RemoveAt(off - 1);\r\n        }\r\n    }\r\n    else if (Type_Array == type) {\r\n        while (node->GetChild(fieldName, &off)) {\r\n            delete node->data.At(off - 1).value.child;\r\n            node->data.RemoveAt(off - 1);\r\n            off--;\r\n        }\r\n    }\r\n    else if (node->GetValue(fieldName, &off)) {\r\n        node->data.RemoveAt(off - 1);\r\n    }\r\n}\r\n\r\nstatic void SerializeUnknownFields(str::Str<char>& out, SquareTreeNode *node, int indent)\r\n{\r\n    if (!node)\r\n        return;\r\n    for (size_t i = 0; i < node->data.Count(); i++) {\r\n        SquareTreeNode::DataItem& item = node->data.At(i);\r\n        Indent(out, indent);\r\n        out.Append(item.key);\r\n        if (item.isChild) {\r\n            out.Append(\" [\\r\\n\");\r\n            SerializeUnknownFields(out, item.value.child, indent + 1);\r\n            Indent(out, indent);\r\n            out.Append(\"]\\r\\n\");\r\n        }\r\n        else {\r\n            out.Append(\" = \");\r\n            out.Append(item.value.str);\r\n            out.Append(\"\\r\\n\");\r\n        }\r\n    }\r\n}\r\n\r\nstatic void SerializeStructRec(str::Str<char>& out, const StructInfo *info, const void *data, SquareTreeNode *prevNode, int indent=0)\r\n{\r\n    const uint8_t *base = (const uint8_t *)data;\r\n    const char *fieldName = info->fieldNames;\r\n    for (size_t i = 0; i < info->fieldCount; i++, fieldName += str::Len(fieldName) + 1) {\r\n        const FieldInfo& field = info->fields[i];\r\n        CrashIf(str::FindChar(fieldName, '=') || str::FindChar(fieldName, ':') ||\r\n                str::FindChar(fieldName, '[') || str::FindChar(fieldName, ']') ||\r\n                NeedsEscaping(fieldName));\r\n        if (Type_Struct == field.type || Type_Prerelease == field.type) {\r\n#if !(defined(SVN_PRE_RELEASE_VER) || defined(DEBUG))\r\n            if (Type_Prerelease == field.type)\r\n                continue;\r\n#endif\r\n            Indent(out, indent);\r\n            out.Append(fieldName);\r\n            out.Append(\" [\\r\\n\");\r\n            SerializeStructRec(out, GetSubstruct(field), base + field.offset, prevNode ? prevNode->GetChild(fieldName) : nullptr, indent + 1);\r\n            Indent(out, indent);\r\n            out.Append(\"]\\r\\n\");\r\n        }\r\n        else if (Type_Array == field.type) {\r\n            Indent(out, indent);\r\n            out.Append(fieldName);\r\n            out.Append(\" [\\r\\n\");\r\n            Vec<void *> *array = *(Vec<void *> **)(base + field.offset);\r\n            if (array && array->Count() > 0) {\r\n                for (size_t j = 0; j < array->Count(); j++) {\r\n                    Indent(out, indent + 1);\r\n                    out.Append(\"[\\r\\n\");\r\n                    SerializeStructRec(out, GetSubstruct(field), array->At(j), nullptr, indent + 2);\r\n                    Indent(out, indent + 1);\r\n                    out.Append(\"]\\r\\n\");\r\n                }\r\n            }\r\n            Indent(out, indent);\r\n            out.Append(\"]\\r\\n\");\r\n        }\r\n        else if (Type_Comment == field.type) {\r\n            if (field.value) {\r\n                Indent(out, indent);\r\n                out.Append(\"# \");\r\n                out.Append((const char *)field.value);\r\n            }\r\n            out.Append(\"\\r\\n\");\r\n        }\r\n        else {\r\n            size_t offset = out.Size();\r\n            Indent(out, indent);\r\n            out.Append(fieldName);\r\n            out.Append(\" = \");\r\n            bool keep = SerializeField(out, base, field);\r\n            if (keep)\r\n                out.Append(\"\\r\\n\");\r\n            else\r\n                out.RemoveAt(offset, out.Size() - offset);\r\n        }\r\n        MarkFieldKnown(prevNode, fieldName, field.type);\r\n    }\r\n    SerializeUnknownFields(out, prevNode, indent);\r\n}\r\n\r\nstatic void *DeserializeStructRec(const StructInfo *info, SquareTreeNode *node, uint8_t *base, bool useDefaults)\r\n{\r\n    if (!base)\r\n        base = AllocArray<uint8_t>(info->structSize);\r\n\r\n    const char *fieldName = info->fieldNames;\r\n    for (size_t i = 0; i < info->fieldCount; i++, fieldName += str::Len(fieldName) + 1) {\r\n        const FieldInfo& field = info->fields[i];\r\n        uint8_t *fieldPtr = base + field.offset;\r\n        if (Type_Struct == field.type || Type_Prerelease == field.type) {\r\n            SquareTreeNode *child = node ? node->GetChild(fieldName) : nullptr;\r\n#if !(defined(SVN_PRE_RELEASE_VER) || defined(DEBUG))\r\n            if (Type_Prerelease == field.type)\r\n                child = nullptr;\r\n#endif\r\n            DeserializeStructRec(GetSubstruct(field), child, fieldPtr, useDefaults);\r\n        }\r\n        else if (Type_Array == field.type) {\r\n            SquareTreeNode *parent = node, *child = nullptr;\r\n            if (parent && (child = parent->GetChild(fieldName)) != nullptr &&\r\n                (0 == child->data.Count() || child->GetChild(\"\"))) {\r\n                parent = child;\r\n                fieldName += str::Len(fieldName);\r\n            }\r\n            if (child || useDefaults || !*(Vec<void *> **)fieldPtr) {\r\n                Vec<void *> *array = new Vec<void *>();\r\n                size_t idx = 0;\r\n                while (parent && (child = parent->GetChild(fieldName, &idx)) != nullptr) {\r\n                    array->Append(DeserializeStructRec(GetSubstruct(field), child, nullptr, true));\r\n                }\r\n                FreeArray(*(Vec<void *> **)fieldPtr, field);\r\n                *(Vec<void *> **)fieldPtr = array;\r\n            }\r\n        }\r\n        else if (field.type != Type_Comment) {\r\n            const char *value = node ? node->GetValue(fieldName) : nullptr;\r\n            if (useDefaults || value)\r\n                DeserializeField(field, base, value);\r\n        }\r\n    }\r\n    return base;\r\n}\r\n\r\nchar *SerializeStruct(const StructInfo *info, const void *strct, const char *prevData, size_t *sizeOut)\r\n{\r\n    str::Str<char> out;\r\n    out.Append(UTF8_BOM);\r\n    SquareTree prevSqt(prevData);\r\n    SerializeStructRec(out, info, strct, prevSqt.root);\r\n    if (sizeOut)\r\n        *sizeOut = out.Size();\r\n    return out.StealData();\r\n}\r\n\r\nvoid *DeserializeStruct(const StructInfo *info, const char *data, void *strct)\r\n{\r\n    SquareTree sqt(data);\r\n    return DeserializeStructRec(info, sqt.root, (uint8_t *)strct, !strct);\r\n}\r\n\r\nstatic void FreeStructData(const StructInfo *info, uint8_t *base)\r\n{\r\n    for (size_t i = 0; i < info->fieldCount; i++) {\r\n        const FieldInfo& field = info->fields[i];\r\n        uint8_t *fieldPtr = base + field.offset;\r\n        if (Type_Struct == field.type || Type_Prerelease == field.type)\r\n            FreeStructData(GetSubstruct(field), fieldPtr);\r\n        else if (Type_Array == field.type)\r\n            FreeArray(*(Vec<void *> **)fieldPtr, field);\r\n        else if (Type_String == field.type || Type_Utf8String == field.type)\r\n            free(*(void **)fieldPtr);\r\n        else if (Type_ColorArray == field.type || Type_FloatArray == field.type || Type_IntArray == field.type)\r\n            delete *(Vec<int> **)fieldPtr;\r\n        else if (Type_StringArray == field.type)\r\n            FreeStringArray(*(Vec<WCHAR *> **)fieldPtr);\r\n    }\r\n}\r\n\r\nvoid FreeStruct(const StructInfo *info, void *strct)\r\n{\r\n    if (strct)\r\n        FreeStructData(info, (uint8_t *)strct);\r\n    free(strct);\r\n}\r\n"
  },
  {
    "path": "src/utils/SettingsUtil.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n/*\r\nSince version 2.3, settings are serialized in a structure of the following form:\r\n\r\n# comment linking to more information about the following values\r\nSettingName = string value (might also be a number, etc.)\r\nSubSettings [\r\n    Boolean = true\r\n    Rectangle = 0 0 40 50\r\n    Escaped = $ (leading space), $r$n (newline), $$ (escape character) and trailing space: $\r\n    ValueArray [\r\n        [\r\n            ItemNo = 1\r\n        ]\r\n        [\r\n            ItemNo = 2\r\n        ]\r\n    ]\r\n]\r\n\r\nSee SquareTreeParser.cpp for further details on variations allowed during\r\nthe deserialization of such a settings file.\r\n*/\r\n\r\nenum SettingType {\r\n    Type_Struct, Type_Array, Type_Compact,\r\n    Type_Bool, Type_Color, Type_Float, Type_Int, Type_String, Type_Utf8String,\r\n    Type_ColorArray, Type_FloatArray, Type_IntArray, Type_StringArray,\r\n    Type_Comment,\r\n    Type_Prerelease, // same as Type_Struct but won't be written out in release builds\r\n};\r\n\r\nstruct FieldInfo {\r\n    size_t offset; // offset of the field in the struct\r\n    SettingType type;\r\n    intptr_t value; // default value for primitive types and pointer to StructInfo for complex ones\r\n};\r\n\r\nstruct StructInfo {\r\n    uint16_t structSize;\r\n    uint16_t fieldCount;\r\n    const FieldInfo *fields;\r\n    // one string of fieldCount zero-terminated names of all fields in the order of fields\r\n    const char *fieldNames;\r\n};\r\n\r\nchar *SerializeStruct(const StructInfo *info, const void *strct, const char *prevData=nullptr, size_t *sizeOut=nullptr);\r\nvoid *DeserializeStruct(const StructInfo *info, const char *data, void *strct=nullptr);\r\nvoid FreeStruct(const StructInfo *info, void *strct);\r\n"
  },
  {
    "path": "src/utils/SimpleLog.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nnamespace slog {\r\n\r\nclass Logger {\r\npublic:\r\n    virtual ~Logger() { }\r\n    virtual void Log(const WCHAR *s) = 0;\r\n\r\n    void LogFmt(const WCHAR *fmt, ...)\r\n    {\r\n        va_list args;\r\n        va_start(args, fmt);\r\n        ScopedMem<WCHAR> s(str::FmtV(fmt, args));\r\n        Log(s);\r\n        va_end(args);\r\n    }\r\n\r\n    void LogAndFree(WCHAR *s)\r\n    {\r\n        Log(s);\r\n        free(s);\r\n    }\r\n};\r\n\r\nclass FileLogger : public Logger {\r\n    ScopedHandle fh;\r\n\r\npublic:\r\n    explicit FileLogger(const WCHAR *fileName) :\r\n        fh(CreateFile(fileName, FILE_APPEND_DATA, FILE_SHARE_READ, nullptr,\r\n                      OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr)) { }\r\n    explicit FileLogger(HANDLE fh) : fh(fh) { }\r\n\r\n    virtual void Log(const WCHAR *s)\r\n    {\r\n        ScopedMem<char> utf8s(str::conv::ToUtf8(s));\r\n        if (utf8s && INVALID_HANDLE_VALUE != fh) {\r\n            DWORD len;\r\n            BOOL ok = WriteFile(fh, utf8s.Get(), (DWORD)str::Len(utf8s), &len, nullptr);\r\n            if (ok)\r\n                WriteFile(fh, \"\\r\\n\", 2, &len, nullptr);\r\n        }\r\n    }\r\n};\r\n\r\nclass MemoryLogger : public Logger {\r\n    str::Str<WCHAR> log;\r\n\r\npublic:\r\n    virtual void Log(const WCHAR *s)\r\n    {\r\n        if (s) {\r\n            log.Append(s);\r\n            log.Append(L\"\\r\\n\");\r\n        }\r\n    }\r\n\r\n    // caller MUST NOT free the result\r\n    // (str::Dup data, if the logger is in use)\r\n    WCHAR *GetData() { return log.LendData(); }\r\n};\r\n\r\nclass DebugLogger : public Logger {\r\npublic:\r\n    virtual void Log(const WCHAR *s)\r\n    {\r\n        if (s) {\r\n            // DbgView displays one line per OutputDebugString call\r\n            OutputDebugString(ScopedMem<WCHAR>(str::Format(L\"%s\\n\", s)));\r\n        }\r\n    }\r\n};\r\n\r\nclass StderrLogger : public Logger {\r\npublic:\r\n    virtual ~StderrLogger()\r\n    {\r\n        fflush(stderr);\r\n    }\r\n\r\n    virtual void Log(const WCHAR *s)\r\n    {\r\n        if (s)\r\n            fwprintf(stderr, L\"%s\\n\", s);\r\n    }\r\n};\r\n\r\n// allows to log into several logs at the same time (thread safe)\r\nclass MultiLogger : public Logger {\r\n    Vec<Logger *>    loggers;\r\n    CRITICAL_SECTION cs;\r\n\r\npublic:\r\n    MultiLogger() { InitializeCriticalSection(&cs); }\r\n    ~MultiLogger()\r\n    {\r\n        EnterCriticalSection(&cs);\r\n        DeleteVecMembers(loggers);\r\n        LeaveCriticalSection(&cs);\r\n        DeleteCriticalSection(&cs);\r\n    }\r\n\r\n    virtual void Log(const WCHAR *s)\r\n    {\r\n        ScopedCritSec scope(&cs);\r\n        for (size_t i = 0; i < loggers.Count(); i++) {\r\n            loggers.At(i)->Log(s);\r\n        }\r\n    }\r\n\r\n    void AddLogger(Logger *logger)\r\n    {\r\n        ScopedCritSec scope(&cs);\r\n        loggers.Append(logger);\r\n    }\r\n    void RemoveLogger(Logger *logger)\r\n    {\r\n        ScopedCritSec scope(&cs);\r\n        loggers.Remove(logger);\r\n    }\r\n    size_t CountLoggers()\r\n    {\r\n        ScopedCritSec scope(&cs);\r\n        return loggers.Count();\r\n    }\r\n};\r\n\r\n} // namespace slog\r\n"
  },
  {
    "path": "src/utils/SquareTreeParser.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"SquareTreeParser.h\"\r\n\r\n/*\r\nA 'square tree' is a format for representing string values contained in a\r\ntree structure. Consumers may parse these string values further (as integers,\r\netc.) as required.\r\n\r\nEach non-empty line which doesn't start with either '#' or ';' (comment line)\r\ncontains either a key and a single-line string value separated by '=' or ':' or\r\nit contains a key followed by a single '[' which causes the following lines to be\r\nparsed as a nested child node until a line starts with ']':\r\n\r\nkey = value\r\nkey2 = [ value containing square brackets (length: 49) ]\r\nchild [\r\n  depth = 1\r\n  subchild [\r\n    depth = 2\r\n  ]\r\n]\r\n\r\nIf tree nodes are either concatenated or if their names are reused for a different\r\nnode, these nodes form a list which can be accessed by index (cf. SquareTreeNode::GetChild).\r\n\r\nlist [\r\n  value 1\r\n] [\r\n  value 2\r\n]\r\nlist [\r\n  value 3\r\n]\r\n\r\nThe below parser always tries to recover from errors, usually by ignoring\r\nfaulty lines. One intentional error hanling is the parsing of INI-style headers which\r\nallows to parse INI files mostly as expected as well. E.g.\r\n\r\n[Section]\r\nkey = value\r\n\r\nis read as if it were written as\r\n\r\nSection [\r\n  key = value\r\n]\r\n\r\nFinal note: Whitespace at the start and end of a line as well as around key-value\r\nseparators is always ignored.\r\n*/\r\n\r\nstatic inline char *SkipWs(char *s, bool stopAtLineEnd=false)\r\n{\r\n    for (; str::IsWs(*s) && (!stopAtLineEnd || *s != '\\n'); s++);\r\n    return s;\r\n}\r\nstatic inline char *SkipWsRev(char *begin, char *s)\r\n{\r\n    for (; s > begin && str::IsWs(*(s - 1)); s--);\r\n    return s;\r\n}\r\n\r\nstatic char *SkipWsAndComments(char *s)\r\n{\r\n    do {\r\n        s = SkipWs(s);\r\n        if ('#' == *s || ';' == *s) {\r\n            // skip entire comment line\r\n            for (; *s && *s != '\\n'; s++);\r\n        }\r\n    } while (str::IsWs(*s));\r\n    return s;\r\n}\r\n\r\nstatic bool IsBracketLine(char *s)\r\n{\r\n    if (*s != '[')\r\n        return false;\r\n    // the line may only contain whitespace and a comment\r\n    for (s++; *s && *s != '\\n' && *s != '#' && *s != ';'; s++) {\r\n        if (!str::IsWs(*s))\r\n            return false;\r\n    }\r\n    return true;\r\n}\r\n\r\nSquareTreeNode::~SquareTreeNode()\r\n{\r\n    for (size_t i = 0; i < data.Count(); i++) {\r\n        DataItem& item = data.At(i);\r\n        if (item.isChild)\r\n            delete item.value.child;\r\n    }\r\n}\r\n\r\nconst char *SquareTreeNode::GetValue(const char *key, size_t *startIdx) const\r\n{\r\n    for (size_t i = startIdx ? *startIdx : 0; i < data.Count(); i++) {\r\n        DataItem& item = data.At(i);\r\n        if (str::EqI(key, item.key) && !item.isChild) {\r\n            if (startIdx)\r\n                *startIdx = i + 1;\r\n            return item.value.str;\r\n        }\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nSquareTreeNode *SquareTreeNode::GetChild(const char *key, size_t *startIdx) const\r\n{\r\n    for (size_t i = startIdx ? *startIdx : 0; i < data.Count(); i++) {\r\n        DataItem& item = data.At(i);\r\n        if (str::EqI(key, item.key) && item.isChild) {\r\n            if (startIdx)\r\n                *startIdx = i + 1;\r\n            return item.value.child;\r\n        }\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nstatic SquareTreeNode *ParseSquareTreeRec(char *& data, bool isTopLevel=false)\r\n{\r\n    SquareTreeNode *node = new SquareTreeNode();\r\n\r\n    while (*(data = SkipWsAndComments(data))) {\r\n        // all non-empty non-comment lines contain a key-value pair\r\n        // where the value is either a string (separated by '=' or ':')\r\n        // or a list of child nodes (if the key is followed by '[' alone)\r\n        char *key = data;\r\n        for (data = key; *data && *data != '=' && *data != ':' && *data != '[' && *data != ']' && *data != '\\n'; data++);\r\n        if (!*data || '\\n' == *data) {\r\n            // use first whitespace as a fallback separator\r\n            for (data = key; *data && !str::IsWs(*data); data++);\r\n        }\r\n        char *separator = data;\r\n        if (*data && *data != '\\n') {\r\n            // skip to the first non-whitespace character on the same line (value)\r\n            data = SkipWs(data + 1, true);\r\n        }\r\n        char *value = data;\r\n        // skip to the end of the line\r\n        for (; *data && *data != '\\n'; data++);\r\n        if (IsBracketLine(separator) ||\r\n            // also tolerate \"key \\n [ \\n ... \\n ]\" (else the key\r\n            // gets an empty value and the child node an empty key)\r\n            str::IsWs(*separator) && '\\n' == *value && IsBracketLine(SkipWsAndComments(data))) {\r\n            // parse child node(s)\r\n            data = SkipWsAndComments(separator) + 1;\r\n            *SkipWsRev(key, separator) = '\\0';\r\n            node->data.Append(SquareTreeNode::DataItem(key, ParseSquareTreeRec(data)));\r\n            // arrays are created by either reusing the same key for a different child\r\n            // or by concatenating multiple children (\"[ \\n ] [ \\n ] [ \\n ]\")\r\n            while (IsBracketLine((data = SkipWsAndComments(data)))) {\r\n                data++;\r\n                node->data.Append(SquareTreeNode::DataItem(key, ParseSquareTreeRec(data)));\r\n            }\r\n        }\r\n        else if (']' == *key) {\r\n            // finish parsing child node\r\n            data = key + 1;\r\n            if (!isTopLevel)\r\n                return node;\r\n            // ignore superfluous closing square brackets instead of\r\n            // ignoring all content following them\r\n        }\r\n        else if ('[' == *key && ']' == SkipWsRev(value, data)[-1]) {\r\n            // treat INI section headers as top-level node names\r\n            // (else \"[Section]\" would be ignored)\r\n            if (!isTopLevel) {\r\n                data = key;\r\n                return node;\r\n            }\r\n            // trim whitespace around section name (for consistency with GetPrivateProfileString)\r\n            key = SkipWs(key + 1);\r\n            *SkipWsRev(key, SkipWsRev(value, data) - 1) = '\\0';\r\n            node->data.Append(SquareTreeNode::DataItem(key, ParseSquareTreeRec(data)));\r\n        }\r\n        else if ('[' == *separator || ']' == *separator) {\r\n            // invalid line (ignored)\r\n        }\r\n        else {\r\n            // string value (decoding is left to the consumer)\r\n            bool hasMoreLines = '\\n' == *data;\r\n            *SkipWsRev(key, separator) = '\\0';\r\n            *SkipWsRev(value, data) = '\\0';\r\n            node->data.Append(SquareTreeNode::DataItem(key, value));\r\n            if (hasMoreLines)\r\n                data++;\r\n        }\r\n    }\r\n\r\n    // assume that all square brackets have been properly balanced\r\n    return node;\r\n}\r\n\r\nSquareTree::SquareTree(const char *data) : root(nullptr)\r\n{\r\n    // convert the file content to UTF-8\r\n    if (str::StartsWith(data, UTF8_BOM))\r\n        dataUtf8.Set(str::Dup(data + 3));\r\n    else if (str::StartsWith(data, UTF16_BOM))\r\n        dataUtf8.Set(str::conv::ToUtf8((const WCHAR *)(data + 2)));\r\n    else if (data)\r\n        dataUtf8.Set(str::conv::ToUtf8(ScopedMem<WCHAR>(str::conv::FromAnsi(data))));\r\n    if (!dataUtf8)\r\n        return;\r\n\r\n    char *start = dataUtf8.Get();\r\n    root = ParseSquareTreeRec(start, true);\r\n    CrashIf(*start || !root);\r\n}\r\n"
  },
  {
    "path": "src/utils/SquareTreeParser.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nclass SquareTreeNode {\r\npublic:\r\n    SquareTreeNode() { }\r\n    ~SquareTreeNode();\r\n\r\n    struct DataItem {\r\n        const char *key;\r\n        union {\r\n            const char *str;\r\n            SquareTreeNode *child;\r\n        } value;\r\n        bool isChild;\r\n\r\n        DataItem() : key(nullptr) { }\r\n        DataItem(const char *key, const char *string) : key(key), isChild(false) { value.str = string; }\r\n        DataItem(const char *key, SquareTreeNode *node) : key(key), isChild(true) { value.child = node; }\r\n    };\r\n    Vec<DataItem> data;\r\n\r\n    const char *GetValue(const char *key, size_t *startIdx=nullptr) const;\r\n    SquareTreeNode *GetChild(const char *key, size_t *startIdx=nullptr) const;\r\n};\r\n\r\nclass SquareTree {\r\n    ScopedMem<char> dataUtf8;\r\n\r\npublic:\r\n    explicit SquareTree(const char *data);\r\n    ~SquareTree() { delete root; }\r\n\r\n    SquareTreeNode *root;\r\n};\r\n"
  },
  {
    "path": "src/utils/StrFormat.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: Simplified BSD (see COPYING.BSD) */\n\n#include \"BaseUtil.h\"\n#include \"StrFormat.h\"\n\nnamespace fmt {\n\nstatic Type typeFromChar(char c) {\n    switch (c) {\n        case 'c': // char\n            return Char;\n        case 's': // string or wstring\n            return Str;\n        case 'd': // integer in base 10\n            return Int;\n        case 'f': // float or double\n            return Float;\n    }\n    CrashIf(true);\n    return Invalid;\n}\n\nFmt::Fmt(const char *fmt) {\n    threadId = GetCurrentThreadId();\n    ParseFormat(fmt);\n}\n\nvoid Fmt::addFormatStr(const char *s, size_t len) {\n    if (len == 0) {\n        return;\n    }\n    CrashIf(nInst >= MaxInstructions);\n    instructions[nInst].t = FormatStr;\n    instructions[nInst].argNo = currArgFromFormatNo;\n    ++nInst;\n\n    CrashIf(nArgsUsed >= MaxArgs);\n    args[currArgFromFormatNo].t = FormatStr;\n    args[currArgFromFormatNo].s = s;\n    args[currArgFromFormatNo].len = len;\n    nArgsUsed++;\n    --currArgFromFormatNo;\n}\n\nconst char *Fmt::parseArgDefPositional(const char *fmt) {\n    CrashIf(*fmt != '{');\n    ++fmt;\n    int n = 0;\n    while (*fmt != '}') {\n        // TODO: this could be more featurful\n        CrashIf(!str::IsDigit(*fmt));\n        n = n * 10 + (*fmt - '0');\n        ++fmt;\n    }\n    instructions[nInst].t = Any;\n    instructions[nInst].argNo = n;\n    ++nInst;\n    return fmt + 1;\n}\n\nconst char *Fmt::parseArgDefPerc(const char *fmt) {\n    CrashIf(*fmt != '%');\n    // TODO: more features\n    instructions[nInst].t = typeFromChar(fmt[1]);\n    instructions[nInst].argNo = currPercArgNo;\n    ++nInst;\n    ++currPercArgNo;\n    return fmt + 2;\n}\n\nstatic bool hasInstructionWithArgNo(Inst *insts, int nInst, int argNo) {\n    for (int i = 0; i < nInst; i++) {\n        if (insts[i].argNo == argNo) {\n            return true;\n        }\n    }\n    return false;\n}\n\n// as an optimization, we can re-use object by calling ParseFormat() only once\n// and then using Reset() to restore the output\nFmt &Fmt::Reset() {\n    CrashIf(threadId != GetCurrentThreadId()); // check no cross-thread use\n    CrashIf(format != nullptr);\n    res.Reset();\n    return *this;\n}\n\nFmt &Fmt::ParseFormat(const char *fmt) {\n\n    // we can use Fmt in an optimized way by having only one global instance per\n    // thread or an instance for a given format expression. To make that a bit\n    // safer, we check that they are not used cross-thread\n    CrashIf(threadId != GetCurrentThreadId());\n\n    format = fmt;\n    nInst = 0;\n    nArgs = 0;\n    nArgsUsed = 0;\n    maxArgNo = 0;\n    currPercArgNo = 0;\n    currArgFromFormatNo = dimof(args) - 1; // points at the end\n    res.Reset();\n\n    // parse formatting string, until a %$c or {$n}\n    // %% is how we escape %, \\{ is how we escape {\n    const char *start = fmt;\n    char c;\n    while (*fmt) {\n        c = *fmt;\n        if ('\\\\' == c) {\n            // handle \\{\n            if ('{' == fmt[1]) {\n                addFormatStr(start, fmt - start);\n                start = fmt + 1;\n                fmt += 2; // skip '{'\n                continue;\n            }\n            continue;\n        }\n        if ('{' == c) {\n            addFormatStr(start, fmt - start);\n            fmt = parseArgDefPositional(fmt);\n            start = fmt;\n            continue;\n        }\n        if ('%' == c) {\n            // handle %%\n            if ('%' == fmt[1]) {\n                addFormatStr(start, fmt - start);\n                start = fmt + 1;\n                fmt += 2; // skip '%'\n                continue;\n            }\n            addFormatStr(start, fmt - start);\n            fmt = parseArgDefPerc(fmt);\n            start = fmt;\n            continue;\n        }\n        ++fmt;\n    }\n    addFormatStr(start, fmt - start);\n\n    // check that arg numbers in {$n} makes sense\n    for (int i = 0; i < nInst; i++) {\n        if (instructions[i].t == FormatStr) {\n            continue;\n        }\n        if (instructions[i].argNo > maxArgNo) {\n            maxArgNo = instructions[i].argNo;\n        }\n    }\n\n    // instructions[i].argNo can be duplicate\n    // (we can have positional arg like {0} multiple times\n    // but must cover all space from 0..nArgsExpected\n    for (int i = 0; i <= maxArgNo; i++) {\n        isOk = hasInstructionWithArgNo(instructions, nInst, i);\n        CrashIf(!isOk);\n        if (!isOk) {\n            return *this;\n        }\n    }\n    return *this;\n}\n\nFmt &Fmt::addArgType(Type t) {\n    CrashIf(nArgsUsed >= MaxArgs);\n    args[nArgs].t = t;\n    nArgs++;\n    nArgsUsed++;\n    return *this;\n}\n\nFmt &Fmt::i(int i) {\n    args[nArgs].i = i;\n    return addArgType(Int);\n}\n\nFmt &Fmt::s(const char *s) {\n    args[nArgs].s = s;\n    return addArgType(Str);\n}\n\nFmt &Fmt::s(const WCHAR *s) {\n    args[nArgs].ws = s;\n    return addArgType(WStr);\n}\n\nFmt &Fmt::c(char c) {\n    args[nArgs].c = c;\n    return addArgType(Char);\n}\n\nFmt &Fmt::f(float f) {\n    args[nArgs].f = f;\n    return addArgType(Float);\n}\n\nFmt &Fmt::f(double d) {\n    args[nArgs].d = d;\n    return addArgType(Double);\n}\n\nstatic bool validArgTypes(Type instType, Type argType) {\n    if (instType == Any) {\n        return true;\n    }\n    if (instType == FormatStr) {\n        return argType == FormatStr;\n    }\n    if (instType == Char) {\n        return argType == Char;\n    }\n    if (instType == Int) {\n        return argType == Int;\n    }\n    if (instType == Float) {\n        return argType == Float || argType == Double;\n    }\n    if (instType == Str) {\n        return argType == Str || argType == WStr;\n    }\n    return false;\n}\n\nvoid Fmt::serializeInst(int n) {\n    CrashIf(n >= dimof(instructions));\n    CrashIf(n >= nInst);\n\n    Type tInst = instructions[n].t;\n    int argNo = instructions[n].argNo;\n    Arg arg = args[argNo];\n    Type tArg = arg.t;\n    isOk = validArgTypes(tInst, tArg);\n    CrashIf(!isOk);\n    if (!isOk) {\n        return;\n    }\n    switch (tArg) {\n        case Char:\n            res.Append(arg.c);\n            break;\n        case Int:\n            // TODO: using AppendFmt is cheating\n            res.AppendFmt(\"%d\", arg.i);\n            break;\n        case Float:\n            // TODO: using AppendFmt is cheating\n            // Note: %G, unlike %f, avoid trailing '0'\n            res.AppendFmt(\"%G\", arg.f);\n            break;\n        case Double:\n            // TODO: using AppendFmt is cheating\n            // Note: %G, unlike %f, avoid trailing '0'\n            res.AppendFmt(\"%G\", arg.d);\n            break;\n        case FormatStr:\n            CrashIf(arg.len == 0);\n            res.Append(arg.s, arg.len);\n            break;\n        case Str:\n            res.Append(arg.s);\n            break;\n        case WStr:\n            char *sUtf8 = str::conv::ToUtf8(arg.ws);\n            res.AppendAndFree(sUtf8);\n            break;\n    };\n}\n\nchar *Fmt::Get() {\n    CrashIf(nArgs != maxArgNo + 1);\n    for (int i = 0; isOk && i < nInst; i++) {\n        serializeInst(i);\n    }\n    if (!isOk) {\n        res.Reset();\n        res.Append(\"Mismatch format/args for format string: \");\n        res.Append(format);\n    }\n    return res.Get();\n}\n\nchar *Fmt::GetDup() { return str::Dup(Get()); }\n}\n"
  },
  {
    "path": "src/utils/StrFormat.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: Simplified BSD (see COPYING.BSD) */\n\n/*\nfmt::Fmt is type-safe printf()-like system with support for both %-style formatting\ndirectives and C#-like positional directives ({0}, {1} etc.).\n\nType safety is achieved by using strongly typed methods for adding arguments\n(i(), c(), s() etc.). We also verify that the type of the argument matches\nthe type of formatting directive.\n\nPositional directives are useful in translations with more than 1 argument\nbecause in some languages translation is akward if you can't re-arrange\nthe order of arguments.\n\nTODO: we should change at least those translations that involve 2 or more arguments.\n\nTODO: ultimately we shouldn't use sprintf() in the implementation, so that we are\nsure what the semantics are and they are always the same (independent of platform).\nWe should serialize all values ourselves.\n\nTODO: similar approach could be used for type-safe scanf() replacement.\n\nIdiomatic usage:\nfmt::Fmt fmt(\"%d = %s\");\nchar *s = fmt.i(5).s(\"5\").Get(); // returns \"5 = 5\"\n// s is valid until fmt is valid\n// use .GetDup() to get a copy that must be free()d\n// you can re-use fmt as:\ns = fmt.ParseFormat(\"{1} = {2} + {0}\").i(3).s(\"3\").s(L\"\n\nYou can mix % and {} directives but beware, as the rule for assigning argument\nnumber to % directive is simple (n-th argument position for n-th % directive)\nbut it's easy to mis-count when adding {} to the mix.\n\n*/\n\nnamespace fmt {\n\n// arbitrary limits, but should be large enough for us\n// the bigger the limit, the bigger the sizeof(Fmt)\nenum { MaxInstructions = 32 };\nenum {\n    // more than MaxInstructions for positional args\n    MaxArgs = 32 + 8\n};\n\nenum Type {\n    FormatStr, // from format string\n    Char,\n    Int,\n    Float,\n    Double,\n    Str,\n    WStr,\n    Any,\n    Invalid,\n};\n\n// formatting instruction\nstruct Inst {\n    Type t;\n    int argNo; // <0 for strings that come from formatting string\n};\n\n// argument to a formatting instruction\n// at the front are arguments given with i(), s() etc.\n// at the end are FormatStr arguments from format string\nstruct Arg {\n    Type t;\n    size_t len; // for s when FormatStr\n    union {\n        char c;\n        int i;\n        float f;\n        double d;\n        const char *s;\n        const WCHAR *ws;\n    };\n};\n\nclass Fmt {\n  public:\n    Fmt(const char *fmt);\n    Fmt &i(int);\n    Fmt &s(const char *);\n    Fmt &s(const WCHAR *);\n    Fmt &c(char);\n    Fmt &f(float);\n    Fmt &f(double);\n\n    Fmt &ParseFormat(const char *fmt);\n    Fmt &Reset();\n    char *Get();\n    char *GetDup();\n\n    bool isOk; // true if mismatch between formatting instruction and args\n\n  private:\n    const char *parseArgDef(const char *fmt);\n    void addFormatStr(const char *s, size_t len);\n    const char *parseArgDefPerc(const char *);\n    const char *parseArgDefPositional(const char *);\n    Fmt &addArgType(Type t);\n    void serializeInst(int n);\n\n    DWORD threadId;\n    const char *format;\n    Inst instructions[MaxInstructions];\n    int nInst;\n    Arg args[MaxArgs];\n    int nArgs;\n    int nArgsUsed;\n    int maxArgNo;\n    int currPercArgNo;\n    int currArgFromFormatNo; // counts from the end of args\n    str::Str<char> res;\n};\n}\n"
  },
  {
    "path": "src/utils/StrHash.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n/* This is a trie-hash for strings. It maps a binary string (i.e. can\r\ncontain embedded 0) to a value of arbitrary type.\r\n\r\nTrie-hash means that it's actually crit-bit tree where the keys\r\nare 32-bit hash values of the string. The advantage of this over\r\nregular hash tree is that it never requires expensive rehashing\r\nwhen resizing.\r\n\r\nFor maximum compactness, we have restrictions:\r\n- we can't insert 2 strings with the same values\r\n- instead of storing pointers, we store 16-bit offsets into memory we\r\n  own, so there's a limit on number of nodes in the tree and total\r\n  size of strings we can store\r\n\r\nImplementation notes.\r\n---------------------\r\n\r\nWe have 2 kinds of nodes in the tree. Internal node is a binary\r\ntree node which has 2 children: one for bit 0 and another for bit 1,\r\n32 nodes for each bit of 32-bit hash value. A node is 4-byte value, 2\r\n16-bit offsets into array of nodes.\r\n\r\nThe last internal node points to a value node which (logically) consists\r\nof string value (16-bit offset of the array of strings and 16-bit lenght\r\nof the string) and value.\r\n\r\nTODO: this is meant to be used for cache of string measurements in\r\nHtmlFormatter.\r\n*/\r\n\r\n// non-templated base class where value is a blob of bytes of fixed\r\n// size. We do that so we can have the implementation in cpp file\r\nclass StrHashNT {\r\n    // 0 index means there's no child, otherwise it's 1-based index\r\n    // into nodes array\r\n    struct StrHashNode {\r\n        uint16 leftIdx;\r\n        uint16 rightIdx;\r\n    };\r\n    struct StrKey {\r\n        uint16 idx; // points withing stringAllocator\r\n        uint16 len;\r\n    };\r\n\r\n    PoolAllocator             stringAllocator;\r\n    VecSegmented<StrHashNode> nodes;\r\n    VecSegmented<StrKey>      strKeys;\r\n    VecSegmented<char>        values;\r\n    size_t                    valueSize;\r\npublic:\r\n    explicit StrHashNT(size_t valueSize) : valueSize(valueSize)\r\n    { }\r\n    void *Create(const char *s, size_t strLen, uint32 hash, bool& createdOut) {\r\n        return nullptr; // TODO: write me\r\n    }\r\n\r\n    void *Lookup(const char *s, size_t strLen, bool createIfNotExists, bool& createdOut) {\r\n        createdOut = false;\r\n        uint32 hash = CalcStrHash(s, strLen);\r\n        if (0 == nodex.Count()) {\r\n            if (createIfNotExists)\r\n                return Create(s, strLen, hash, createdOut);\r\n            return nullptr;\r\n        }\r\n        size_t nodeIdx = 0;\r\n        StrHashNode node;\r\n        for (size_t i = 0; i < 32; i++) {\r\n            node = nodes.At(nodeIdx);\r\n            bool left = ((hash & 1) == 1);\r\n            hash >>= 1;\r\n            if (left)\r\n                nodeIdx = node.leftIdx;\r\n            else\r\n                nodeIdx = node.rightIdx;\r\n            if (0 == nodeIdx) {\r\n                if (createIfNotExists)\r\n                    return Create(s, strLen, hash, createdOut);\r\n                return nullptr;\r\n            }\r\n        }\r\n        // at this point nodeIdx is index within values and strKey arrays\r\n        size_t valueIdx = nodeIdx * valueSize;\r\n        CrashIf(valueIdx + valueSize >= values.Size());\r\n        char *ret = values.AtPtr(valueIdx);\r\n        return (void*)ret;\r\n    }\r\n};\r\n\r\n<template V>\r\nclass StrHash : public StrHashNT {\r\npublic:\r\n    // TODO: sizeof(V) should probably be rounded to 4 or 8\r\n    StrHash() : StrHashNT(sizeof(V))\r\n    { }\r\n    V *Lookup(const char *s, size_t strLen, bool createIfNotExists, bool& createdOut) {\r\n        V *res = (V*)Lookup(s, strLen, createIfNotExists, createdOut);\r\n        return res;\r\n    }\r\n};\r\n"
  },
  {
    "path": "src/utils/StrSlice.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"StrSlice.h\"\r\n\r\nnamespace str {\r\n\r\ninline bool IsWsOrNewline(char c)\r\n{\r\n    return ( ' ' == c) ||\r\n           ('\\r' == c) ||\r\n           ('\\t' == c) ||\r\n           ('\\n' == c);\r\n}\r\n\r\ninline bool IsWsNoNewline(char c)\r\n{\r\n    return ( ' ' == c) ||\r\n           ('\\r' == c) ||\r\n           ('\\t' == c);\r\n}\r\n\r\n// returns number of characters skipped\r\nptrdiff_t Slice::SkipWsUntilNewline()\r\n{\r\n    char *start = curr;\r\n    for (; !Finished(); ++curr) {\r\n        if (!IsWsNoNewline(*curr))\r\n            break;\r\n    }\r\n    return curr - start;\r\n}\r\n\r\n// returns number of characters skipped\r\nptrdiff_t Slice::SkipNonWs()\r\n{\r\n    char *start = curr;\r\n    for (; !Finished(); ++curr) {\r\n        if (IsWsOrNewline(*curr))\r\n            break;\r\n    }\r\n    return curr - start;\r\n}\r\n\r\n// advances to a given character or end\r\nptrdiff_t Slice::SkipUntil(char toFind)\r\n{\r\n    char *start = curr;\r\n    for (; !Finished(); ++curr) {\r\n        if (*curr == toFind)\r\n            break;\r\n    }\r\n    return curr - start;\r\n}\r\n\r\nchar Slice::PrevChar() const\r\n{\r\n    if (curr > begin)\r\n        return curr[-1];\r\n    return 0;\r\n}\r\n\r\nchar Slice::CurrChar() const\r\n{\r\n    if (curr < end)\r\n        return *curr;\r\n    return 0;\r\n}\r\n\r\n// skip up to n characters\r\n// returns the number of characters skipped\r\nptrdiff_t Slice::Skip(int n)\r\n{\r\n    char *start = curr;\r\n    while ((curr < end) && (n > 0)) {\r\n        ++curr;\r\n        --n;\r\n    }\r\n    return curr - start;\r\n}\r\n\r\nvoid Slice::ZeroCurr()\r\n{\r\n    if (curr < end)\r\n        *curr = 0;\r\n}\r\n\r\n} // namespace str\r\n"
  },
  {
    "path": "src/utils/StrSlice.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nnamespace str {\r\n\r\n// a class to help scanning through text\r\nstruct Slice {\r\n    char *  begin;\r\n    char *  end;\r\n    char *  curr;\r\n\r\n    Slice() : begin(nullptr), end(nullptr), curr(nullptr) { }\r\n\r\n    Slice(char *txt, size_t len) {\r\n        Init(txt, len);\r\n    }\r\n\r\n    Slice(char *start, char *end) {\r\n        Init(start, end-start);\r\n    }\r\n\r\n    Slice(const Slice& other) {\r\n        this->begin = other.begin;\r\n        this->end = other.end;\r\n        this->curr = other.curr;\r\n    }\r\n\r\n    void Init(char *txt, size_t len) {\r\n        begin = txt;\r\n        curr = txt;\r\n        end = txt + len;\r\n    }\r\n\r\n    bool Finished() const { return curr >= end; }\r\n\r\n    char PrevChar() const;\r\n    char CurrChar() const;\r\n    ptrdiff_t SkipWsUntilNewline();\r\n    ptrdiff_t SkipUntil(char toFind);\r\n    ptrdiff_t SkipNonWs();\r\n    ptrdiff_t Skip(int n);\r\n    void ZeroCurr();\r\n};\r\n\r\n} // namespace str\r\n"
  },
  {
    "path": "src/utils/StrUtil.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n/* The most basic things, including string handling functions */\r\n#include \"BaseUtil.h\"\r\n\r\nnamespace str {\r\n\r\nsize_t Len(const char *s)\r\n{\r\n    return s ? strlen(s) : 0;\r\n}\r\nsize_t Len(const WCHAR *s)\r\n{\r\n    return s ? wcslen(s) : 0;\r\n}\r\n\r\nchar *Dup(const char *s)\r\n{\r\n    return s ? _strdup(s) : nullptr;\r\n}\r\n\r\nWCHAR *Dup(const WCHAR *s)\r\n{\r\n    return s ? _wcsdup(s) : nullptr;\r\n}\r\n\r\n// return true if s1 == s2, case sensitive\r\nbool Eq(const char *s1, const char *s2)\r\n{\r\n    if (s1 == s2)\r\n        return true;\r\n    if (!s1 || !s2)\r\n        return false;\r\n    return 0 == strcmp(s1, s2);\r\n}\r\n\r\n// return true if s1 == s2, case sensitive\r\nbool Eq(const WCHAR *s1, const WCHAR *s2)\r\n{\r\n    if (s1 == s2)\r\n        return true;\r\n    if (!s1 || !s2)\r\n        return false;\r\n    return 0 == wcscmp(s1, s2);\r\n}\r\n\r\n// return true if s1 == s2, case insensitive\r\nbool EqI(const char *s1, const char *s2)\r\n{\r\n    if (s1 == s2)\r\n        return true;\r\n    if (!s1 || !s2)\r\n        return false;\r\n    return 0 == _stricmp(s1, s2);\r\n}\r\n\r\n// return true if s1 == s2, case insensitive\r\nbool EqI(const WCHAR *s1, const WCHAR *s2)\r\n{\r\n    if (s1 == s2)\r\n        return true;\r\n    if (!s1 || !s2)\r\n        return false;\r\n    return 0 == _wcsicmp(s1, s2);\r\n}\r\n\r\n// compares two strings ignoring case and whitespace\r\nbool EqIS(const char *s1, const char *s2)\r\n{\r\n    while (*s1 && *s2) {\r\n        // skip whitespace\r\n        for (; IsWs(*s1); s1++);\r\n        for (; IsWs(*s2); s2++);\r\n\r\n        if (tolower(*s1) != tolower(*s2))\r\n            return false;\r\n        if (*s1) { s1++; s2++; }\r\n    }\r\n\r\n    return !*s1 && !*s2;\r\n}\r\n\r\n// compares two strings ignoring case and whitespace\r\nbool EqIS(const WCHAR *s1, const WCHAR *s2)\r\n{\r\n    while (*s1 && *s2) {\r\n        // skip whitespace\r\n        for (; IsWs(*s1); s1++);\r\n        for (; IsWs(*s2); s2++);\r\n\r\n        if (towlower(*s1) != towlower(*s2))\r\n            return false;\r\n        if (*s1) { s1++; s2++; }\r\n    }\r\n\r\n    return !*s1 && !*s2;\r\n}\r\n\r\nbool EqN(const char *s1, const char *s2, size_t len)\r\n{\r\n    if (s1 == s2)\r\n        return true;\r\n    if (!s1 || !s2)\r\n        return false;\r\n    return 0 == strncmp(s1, s2, len);\r\n}\r\n\r\nbool EqN(const WCHAR *s1, const WCHAR *s2, size_t len)\r\n{\r\n    if (s1 == s2)\r\n        return true;\r\n    if (!s1 || !s2)\r\n        return false;\r\n    return 0 == wcsncmp(s1, s2, len);\r\n}\r\n\r\nbool EqNI(const char *s1, const char *s2, size_t len)\r\n{\r\n    if (s1 == s2)\r\n        return true;\r\n    if (!s1 || !s2)\r\n        return false;\r\n    return 0 == _strnicmp(s1, s2, len);\r\n}\r\n\r\nbool EqNI(const WCHAR *s1, const WCHAR *s2, size_t len)\r\n{\r\n    if (s1 == s2)\r\n        return true;\r\n    if (!s1 || !s2)\r\n        return false;\r\n    return 0 == _wcsnicmp(s1, s2, len);\r\n}\r\n\r\n/* return true if 'str' starts with 'txt', NOT case-sensitive */\r\nbool StartsWithI(const char *str, const char *txt)\r\n{\r\n    if (str == txt)\r\n        return true;\r\n    if (!str || !txt)\r\n        return false;\r\n    return 0 == _strnicmp(str, txt, str::Len(txt));\r\n}\r\n\r\n/* return true if 'str' starts with 'txt', NOT case-sensitive */\r\nbool StartsWithI(const WCHAR *str, const WCHAR *txt)\r\n{\r\n    if (str == txt)\r\n        return true;\r\n    if (!str || !txt)\r\n        return false;\r\n    return 0 == _wcsnicmp(str, txt, str::Len(txt));\r\n}\r\n\r\n// TODO: implement with templates? (must happen in the header, though)\r\n// template <typename T> bool EndsWith(const T*, const T*) ?\r\n\r\nbool EndsWith(const char *txt, const char *end)\r\n{\r\n    if (!txt || !end)\r\n        return false;\r\n    size_t txtLen = str::Len(txt);\r\n    size_t endLen = str::Len(end);\r\n    if (endLen > txtLen)\r\n        return false;\r\n    return str::Eq(txt + txtLen - endLen, end);\r\n}\r\n\r\nbool EndsWith(const WCHAR *txt, const WCHAR *end)\r\n{\r\n    if (!txt || !end)\r\n        return false;\r\n    size_t txtLen = str::Len(txt);\r\n    size_t endLen = str::Len(end);\r\n    if (endLen > txtLen)\r\n        return false;\r\n    return str::Eq(txt + txtLen - endLen, end);\r\n}\r\n\r\nbool EndsWithI(const char *txt, const char *end)\r\n{\r\n    if (!txt || !end)\r\n        return false;\r\n    size_t txtLen = str::Len(txt);\r\n    size_t endLen = str::Len(end);\r\n    if (endLen > txtLen)\r\n        return false;\r\n    return str::EqI(txt + txtLen - endLen, end);\r\n}\r\n\r\nbool EndsWithI(const WCHAR *txt, const WCHAR *end)\r\n{\r\n    if (!txt || !end)\r\n        return false;\r\n    size_t txtLen = str::Len(txt);\r\n    size_t endLen = str::Len(end);\r\n    if (endLen > txtLen)\r\n        return false;\r\n    return str::EqI(txt + txtLen - endLen, end);\r\n}\r\n\r\nconst char *FindI(const char *s, const char *toFind)\r\n{\r\n    if (!s || !toFind)\r\n        return nullptr;\r\n\r\n    char first = (char)tolower(*toFind);\r\n    if (!first)\r\n        return s;\r\n    while (*s) {\r\n        char c = (char)tolower(*s);\r\n        if (c == first) {\r\n            if (str::StartsWithI(s, toFind)) {\r\n                return s;\r\n            }\r\n        }\r\n        s++;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nconst WCHAR *FindI(const WCHAR *s, const WCHAR *toFind)\r\n{\r\n    if (!s || !toFind)\r\n        return nullptr;\r\n\r\n    WCHAR first = towlower(*toFind);\r\n    if (!first)\r\n        return s;\r\n    while (*s) {\r\n        WCHAR c = towlower(*s);\r\n        if (c == first) {\r\n            if (str::StartsWithI(s, toFind)) {\r\n                return s;\r\n            }\r\n        }\r\n        s++;\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nvoid ReplacePtr(char **s, const char *snew)\r\n{\r\n    free(*s);\r\n    *s = str::Dup(snew);\r\n}\r\n\r\nvoid ReplacePtr(const char **s, const char *snew)\r\n{\r\n    free((char*)*s);\r\n    *s = str::Dup(snew);\r\n}\r\n\r\nvoid ReplacePtr(WCHAR **s, const WCHAR *snew)\r\n{\r\n    free(*s);\r\n    *s = str::Dup(snew);\r\n}\r\n\r\n/* Concatenate 2 strings. Any string can be nullptr.\r\n   Caller needs to free() memory. */\r\nchar *Join(const char *s1, const char *s2, const char *s3)\r\n{\r\n    return Join(s1, s2, s3, nullptr);\r\n}\r\n\r\nchar *Join(const char *s1, const char *s2, const char *s3, Allocator *allocator)\r\n{\r\n    size_t s1Len = str::Len(s1);\r\n    size_t s2Len = str::Len(s2);\r\n    size_t s3Len = str::Len(s3);\r\n    size_t len = s1Len + s2Len + s3Len + 1;\r\n    char *res = (char*)Allocator::Alloc(allocator, len);\r\n\r\n    char *s = res;\r\n    memcpy(s, s1, s1Len);\r\n    s += s1Len;\r\n    memcpy(s, s2, s2Len);\r\n    s += s2Len;\r\n    memcpy(s, s3, s3Len);\r\n    s += s3Len;\r\n    *s = 0;\r\n\r\n    return res;\r\n}\r\n\r\n/* Concatenate 2 strings. Any string can be nullptr.\r\n   Caller needs to free() memory. */\r\nWCHAR *Join(const WCHAR *s1, const WCHAR *s2, const WCHAR *s3)\r\n{\r\n    // don't use str::Format(L\"%s%s%s\", s1, s2, s3) since the strings\r\n    // might contain non-characters which str::Format fails to handle\r\n    size_t s1Len = str::Len(s1), s2Len = str::Len(s2), s3Len = str::Len(s3);\r\n    WCHAR *res = AllocArray<WCHAR>(s1Len + s2Len + s3Len + 1);\r\n    memcpy(res, s1, s1Len * sizeof(WCHAR));\r\n    memcpy(res + s1Len, s2, s2Len * sizeof(WCHAR));\r\n    memcpy(res + s1Len + s2Len, s3, s3Len * sizeof(WCHAR));\r\n    res[s1Len + s2Len + s3Len] = '\\0';\r\n    return res;\r\n}\r\n\r\nchar *DupN(const char *s, size_t lenCch)\r\n{\r\n    if (!s)\r\n        return nullptr;\r\n    char *res = (char *)memdup((void *)s, lenCch + 1);\r\n    if (res)\r\n        res[lenCch] = 0;\r\n    return res;\r\n}\r\n\r\nWCHAR *DupN(const WCHAR *s, size_t lenCch)\r\n{\r\n    if (!s)\r\n        return nullptr;\r\n    WCHAR *res = (WCHAR *)memdup((void *)s, (lenCch + 1) * sizeof(WCHAR));\r\n    if (res)\r\n        res[lenCch] = 0;\r\n    return res;\r\n}\r\n\r\nchar *ToLowerInPlace(char *s)\r\n{\r\n    char *res = s;\r\n    for (; s && *s; s++) {\r\n      *s = (char)tolower(*s);\r\n    }\r\n    return res;\r\n}\r\n\r\nWCHAR* ToLowerInPlace(WCHAR *s)\r\n{\r\n    WCHAR *res = s;\r\n    for (; s && *s; s++) {\r\n      *s = towlower(*s);\r\n    }\r\n    return res;\r\n}\r\n\r\n/* Caller needs to free() the result */\r\nchar *ToMultiByte(const WCHAR *txt, UINT codePage, int cchTxtLen)\r\n{\r\n    AssertCrash(txt);\r\n    if (!txt) return nullptr;\r\n\r\n    int requiredBufSize = WideCharToMultiByte(codePage, 0, txt, cchTxtLen, nullptr, 0, nullptr, nullptr);\r\n    if (0 == requiredBufSize)\r\n        return nullptr;\r\n    char *res = AllocArray<char>(requiredBufSize+1);\r\n    if (!res)\r\n        return nullptr;\r\n    WideCharToMultiByte(codePage, 0, txt, cchTxtLen, res, requiredBufSize, nullptr, nullptr);\r\n    return res;\r\n}\r\n\r\n/* Caller needs to free() the result */\r\nchar *ToMultiByte(const char *src, UINT codePageSrc, UINT codePageDest)\r\n{\r\n    AssertCrash(src);\r\n    if (!src) return nullptr;\r\n\r\n    if (codePageSrc == codePageDest)\r\n        return str::Dup(src);\r\n\r\n    ScopedMem<WCHAR> tmp(ToWideChar(src, codePageSrc));\r\n    if (!tmp)\r\n        return nullptr;\r\n\r\n    return ToMultiByte(tmp.Get(), codePageDest);\r\n}\r\n\r\n/* Caller needs to free() the result */\r\nWCHAR *ToWideChar(const char *src, UINT codePage, int cbSrcLen)\r\n{\r\n    AssertCrash(src);\r\n    if (!src) return nullptr;\r\n\r\n    int requiredBufSize = MultiByteToWideChar(codePage, 0, src, cbSrcLen, nullptr, 0);\r\n    if (0 == requiredBufSize)\r\n        return nullptr;\r\n    WCHAR *res = AllocArray<WCHAR>(requiredBufSize+1);\r\n    if (!res)\r\n        return nullptr;\r\n    MultiByteToWideChar(codePage, 0, src, cbSrcLen, res, requiredBufSize);\r\n    return res;\r\n}\r\n\r\n// Encode unicode character as utf8 to dst buffer and advance dst pointer.\r\n// The caller must ensure there is enough free space (4 bytes) in dst\r\nvoid Utf8Encode(char *& dst, int c)\r\n{\r\n    uint8 *tmp = (uint8*)dst;\r\n    if (c < 0x00080) {\r\n        *tmp++ = (uint8)(c & 0xFF);\r\n    } else if (c < 0x00800) {\r\n        *tmp++ = 0xC0 + (uint8)((c >> 6)&0x1F);\r\n        *tmp++ = 0x80 + (uint8)(c & 0x3F);\r\n    } else if (c < 0x10000) {\r\n        *tmp++ = 0xE0 + (uint8)((c >> 12)&0x0F);\r\n        *tmp++ = 0x80 + (uint8)((c >> 6) & 0x3F);\r\n        *tmp++ = 0x80 + (uint8)(c & 0x3F);\r\n    } else {\r\n        *tmp++ = 0xF0 + (uint8)((c >> 18) & 0x07);\r\n        *tmp++ = 0x80 + (uint8)((c >> 12) & 0x3F);\r\n        *tmp++ = 0x80 + (uint8)((c >> 6) & 0x3F);\r\n        *tmp++ = 0x80 + (uint8)(c & 0x3F);\r\n    }\r\n    dst = (char*)tmp;\r\n}\r\n\r\n// format string to a buffer profided by the caller\r\n// the hope here is to avoid allocating memory (assuming vsnprintf\r\n// doesn't allocate)\r\nbool BufFmtV(char *buf, size_t bufCchSize, const char *fmt, va_list args)\r\n{\r\n    int count = _vsnprintf_s(buf, bufCchSize, _TRUNCATE, fmt, args);\r\n    buf[bufCchSize-1] = 0;\r\n    if ((count >= 0) && ((size_t)count < bufCchSize))\r\n        return true;\r\n    return false;\r\n}\r\n\r\nchar *FmtV(const char *fmt, va_list args)\r\n{\r\n    char    message[256];\r\n    size_t  bufCchSize = dimof(message);\r\n    char  * buf = message;\r\n    for (;;)\r\n    {\r\n        int count = _vsnprintf_s(buf, bufCchSize, _TRUNCATE, fmt, args);\r\n        if ((count >= 0) && ((size_t)count < bufCchSize))\r\n            break;\r\n        /* we have to make the buffer bigger. The algorithm used to calculate\r\n           the new size is arbitrary (aka. educated guess) */\r\n        if (buf != message)\r\n            free(buf);\r\n        if (bufCchSize < 4*1024)\r\n            bufCchSize += bufCchSize;\r\n        else\r\n            bufCchSize += 1024;\r\n        buf = AllocArray<char>(bufCchSize);\r\n        if (!buf)\r\n            break;\r\n    }\r\n\r\n    if (buf == message)\r\n        buf = str::Dup(message);\r\n\r\n    return buf;\r\n}\r\n\r\nchar *Format(const char *fmt, ...)\r\n{\r\n    va_list args;\r\n    va_start(args, fmt);\r\n    char *res = FmtV(fmt, args);\r\n    va_end(args);\r\n    return res;\r\n}\r\n\r\nbool BufFmtV(WCHAR *buf, size_t bufCchSize, const WCHAR *fmt, va_list args)\r\n{\r\n    int count = _vsnwprintf_s(buf, bufCchSize, _TRUNCATE, fmt, args);\r\n    buf[bufCchSize-1] = 0;\r\n    if ((count >= 0) && ((size_t)count < bufCchSize))\r\n        return true;\r\n    return false;\r\n}\r\n\r\nWCHAR *FmtV(const WCHAR *fmt, va_list args)\r\n{\r\n    WCHAR   message[256];\r\n    size_t  bufCchSize = dimof(message);\r\n    WCHAR * buf = message;\r\n    for (;;)\r\n    {\r\n        // TODO: _vsnwprintf_s fails for certain inputs (e.g. strings containing U+FFFF)\r\n        //       but doesn't correctly set errno, either, so there's no way of telling\r\n        //       the failures apart\r\n        int count = _vsnwprintf_s(buf, bufCchSize, _TRUNCATE, fmt, args);\r\n        if ((count >= 0) && ((size_t)count < bufCchSize))\r\n            break;\r\n        // always grow the buffer exponentially (cf. TODO above)\r\n        if (buf != message)\r\n            free(buf);\r\n        bufCchSize = bufCchSize / 2 * 3;\r\n        buf = AllocArray<WCHAR>(bufCchSize);\r\n        if (!buf)\r\n            break;\r\n    }\r\n    if (buf == message)\r\n        buf = str::Dup(message);\r\n\r\n    return buf;\r\n}\r\n\r\nWCHAR *Format(const WCHAR *fmt, ...)\r\n{\r\n    va_list args;\r\n    va_start(args, fmt);\r\n    WCHAR *res = FmtV(fmt, args);\r\n    va_end(args);\r\n    return res;\r\n}\r\n\r\n// Trim whitespace characters, in-place, inside s.\r\n// Returns number of trimmed characters.\r\nsize_t TrimWS(WCHAR *s, TrimOpt opt)\r\n{\r\n    size_t sLen = str::Len(s);\r\n    WCHAR *ns = s;\r\n    WCHAR *e = s + sLen;\r\n    WCHAR *ne = e;\r\n    if ((TrimLeft == opt) || (TrimBoth == opt)) {\r\n        while (IsWs(*ns)) {\r\n            ++ns;\r\n        }\r\n    }\r\n\r\n    if ((TrimRight == opt) || (TrimBoth == opt)) {\r\n        while (((ne - 1) >= ns) && IsWs(ne[-1])) {\r\n            --ne;\r\n        }\r\n    }\r\n    *ne = 0;\r\n    size_t trimmed = (ns - s) + (e - ne);\r\n    if (ns != s) {\r\n        size_t toCopy = (sLen - trimmed + 1) * sizeof(WCHAR); // +1 for terminating 0\r\n        memmove(s, ns, toCopy);\r\n    }\r\n    return trimmed;\r\n}\r\n\r\n/* replace in <str> the chars from <oldChars> with their equivalents\r\n   from <newChars> (similar to UNIX's tr command)\r\n   Returns the number of replaced characters. */\r\nsize_t TransChars(char *str, const char *oldChars, const char *newChars)\r\n{\r\n    size_t findCount = 0;\r\n\r\n    for (char *c = str; *c; c++) {\r\n        const char *found = str::FindChar(oldChars, *c);\r\n        if (found) {\r\n            *c = newChars[found - oldChars];\r\n            findCount++;\r\n        }\r\n    }\r\n\r\n    return findCount;\r\n}\r\n\r\nsize_t TransChars(WCHAR *str, const WCHAR *oldChars, const WCHAR *newChars)\r\n{\r\n    size_t findCount = 0;\r\n\r\n    for (WCHAR *c = str; *c; c++) {\r\n        const WCHAR *found = str::FindChar(oldChars, *c);\r\n        if (found) {\r\n            *c = newChars[found - oldChars];\r\n            findCount++;\r\n        }\r\n    }\r\n\r\n    return findCount;\r\n}\r\n\r\n// potentially moves e backwards, skipping over whitespace\r\nvoid TrimWsEnd(char *s, char *&e)\r\n{\r\n    while (e > s) {\r\n        --e;\r\n        if (!str::IsWs(*e)) {\r\n            ++e;\r\n            return;\r\n        }\r\n    }\r\n}\r\n\r\n// the result needs to be free()d\r\nchar *Replace(const char *s, const char *toReplace, const char *replaceWith)\r\n{\r\n    if (!s || str::IsEmpty(toReplace) || !replaceWith)\r\n        return nullptr;\r\n\r\n    str::Str<char> result(str::Len(s));\r\n    size_t findLen = str::Len(toReplace), replLen = str::Len(replaceWith);\r\n    const char *start = s, *end;\r\n    while ((end = str::Find(start, toReplace)) != nullptr) {\r\n        result.Append(start, end - start);\r\n        result.Append(replaceWith, replLen);\r\n        start = end + findLen;\r\n    }\r\n    result.Append(start);\r\n    return result.StealData();\r\n}\r\n\r\n// the result needs to be free()d\r\nWCHAR *Replace(const WCHAR *s, const WCHAR *toReplace, const WCHAR *replaceWith)\r\n{\r\n    if (!s || str::IsEmpty(toReplace) || !replaceWith)\r\n        return nullptr;\r\n\r\n    str::Str<WCHAR> result(str::Len(s));\r\n    size_t findLen = str::Len(toReplace), replLen = str::Len(replaceWith);\r\n    const WCHAR *start = s, *end;\r\n    while ((end = str::Find(start, toReplace)) != nullptr) {\r\n        result.Append(start, end - start);\r\n        result.Append(replaceWith, replLen);\r\n        start = end + findLen;\r\n    }\r\n    result.Append(start);\r\n    return result.StealData();\r\n}\r\n\r\n// replaces all whitespace characters with spaces, collapses several\r\n// consecutive spaces into one and strips heading/trailing ones\r\n// returns the number of removed characters\r\nsize_t NormalizeWS(char *str)\r\n{\r\n    char *src = str, *dst = str;\r\n    bool addedSpace = true;\r\n\r\n    for (; *src; src++) {\r\n        if (!IsWs(*src)) {\r\n            *dst++ = *src;\r\n            addedSpace = false;\r\n        }\r\n        else if (!addedSpace) {\r\n            *dst++ = ' ';\r\n            addedSpace = true;\r\n        }\r\n    }\r\n\r\n    if (dst > str && IsWs(*(dst - 1)))\r\n        dst--;\r\n    *dst = '\\0';\r\n\r\n    return src - dst;\r\n}\r\n\r\n// replaces all whitespace characters with spaces, collapses several\r\n// consecutive spaces into one and strips heading/trailing ones\r\n// returns the number of removed characters\r\nsize_t NormalizeWS(WCHAR *str)\r\n{\r\n    WCHAR *src = str, *dst = str;\r\n    bool addedSpace = true;\r\n\r\n    for (; *src; src++) {\r\n        if (!IsWs(*src)) {\r\n            *dst++ = *src;\r\n            addedSpace = false;\r\n        }\r\n        else if (!addedSpace) {\r\n            *dst++ = ' ';\r\n            addedSpace = true;\r\n        }\r\n    }\r\n\r\n    if (dst > str && IsWs(*(dst - 1)))\r\n        dst--;\r\n    *dst = '\\0';\r\n\r\n    return src - dst;\r\n}\r\n\r\nstatic bool isNl(char c)\r\n{\r\n    return '\\r' == c || '\\n' == c;\r\n}\r\n\r\n// replaces '\\r\\n' and 'r\\' with just '\\n' and removes empty lines\r\nsize_t NormalizeNewlinesInPlace(char *s, char *e)\r\n{\r\n    char *start = s;\r\n    char *dst = s;\r\n    // remove newlines at the beginning\r\n    while (s < e && isNl(*s)) {\r\n        ++s;\r\n    }\r\n\r\n    bool inNewline = false;\r\n    while (s < e) {\r\n        if (isNl(*s)) {\r\n            if (!inNewline)\r\n                *dst++ = '\\n';\r\n            inNewline = true;\r\n            ++s;\r\n        } else {\r\n            *dst++ = *s++;\r\n            inNewline = false;\r\n        }\r\n    }\r\n    if (dst < e) {\r\n        *dst = 0;\r\n    }\r\n    // remove newlines from the end\r\n    while (dst > start && dst[-1] == '\\n') {\r\n        --dst;\r\n        *dst = 0;\r\n    }\r\n    return dst - start;\r\n}\r\n\r\nsize_t NormalizeNewlinesInPlace(char *s)\r\n{\r\n    return NormalizeNewlinesInPlace(s, s + str::Len(s));\r\n}\r\n\r\n// Remove all characters in \"toRemove\" from \"str\", in place.\r\n// Returns number of removed characters.\r\nsize_t RemoveChars(char *str, const char *toRemove)\r\n{\r\n    size_t removed = 0;\r\n    char *dst = str;\r\n    while (*str) {\r\n        char c = *str++;\r\n        if (!str::FindChar(toRemove, c))\r\n            *dst++ = c;\r\n        else\r\n            ++removed;\r\n    }\r\n    *dst = '\\0';\r\n    return removed;\r\n}\r\n\r\nsize_t RemoveChars(WCHAR *str, const WCHAR *toRemove)\r\n{\r\n    size_t removed = 0;\r\n    WCHAR *dst = str;\r\n    while (*str) {\r\n        WCHAR c = *str++;\r\n        if (!str::FindChar(toRemove, c))\r\n            *dst++ = c;\r\n        else\r\n            ++removed;\r\n    }\r\n    *dst = '\\0';\r\n    return removed;\r\n}\r\n\r\n// Note: BufSet() should only be used when absolutely necessary (e.g. when\r\n// handling buffers in OS-defined structures)\r\n// returns the number of characters written (without the terminating \\0)\r\nsize_t BufSet(char *dst, size_t dstCchSize, const char *src)\r\n{\r\n    CrashAlwaysIf(0 == dstCchSize);\r\n\r\n    size_t srcCchSize = str::Len(src);\r\n    size_t toCopy = std::min(dstCchSize - 1, srcCchSize);\r\n\r\n    errno_t err = strncpy_s(dst, dstCchSize, src, toCopy);\r\n    CrashIf(err || dst[toCopy] != '\\0');\r\n\r\n    return toCopy;\r\n}\r\n\r\nsize_t BufSet(WCHAR *dst, size_t dstCchSize, const WCHAR *src)\r\n{\r\n    CrashAlwaysIf(0 == dstCchSize);\r\n\r\n    size_t srcCchSize = str::Len(src);\r\n    size_t toCopy = std::min(dstCchSize - 1, srcCchSize);\r\n\r\n    errno_t err = wcsncpy_s(dst, dstCchSize, src, toCopy);\r\n    CrashIf(err || dst[toCopy] != '\\0');\r\n\r\n    return toCopy;\r\n}\r\n\r\n// append as much of s at the end of dst (which must be properly null-terminated)\r\n// as will fit.\r\nsize_t BufAppend(char *dst, size_t dstCchSize, const char *s)\r\n{\r\n    CrashAlwaysIf(0 == dstCchSize);\r\n\r\n    size_t currDstCchLen = str::Len(dst);\r\n    if (currDstCchLen + 1 >= dstCchSize)\r\n        return 0;\r\n    size_t left = dstCchSize - currDstCchLen - 1;\r\n    size_t srcCchSize = str::Len(s);\r\n    size_t toCopy = std::min(left, srcCchSize);\r\n\r\n    errno_t err = strncat_s(dst, dstCchSize, s, toCopy);\r\n    CrashIf(err || dst[currDstCchLen + toCopy] != '\\0');\r\n\r\n    return toCopy;\r\n}\r\n\r\nsize_t BufAppend(WCHAR *dst, size_t dstCchSize, const WCHAR *s)\r\n{\r\n    CrashAlwaysIf(0 == dstCchSize);\r\n\r\n    size_t currDstCchLen = str::Len(dst);\r\n    if (currDstCchLen + 1 >= dstCchSize)\r\n        return 0;\r\n    size_t left = dstCchSize - currDstCchLen - 1;\r\n    size_t srcCchSize = str::Len(s);\r\n    size_t toCopy = std::min(left, srcCchSize);\r\n\r\n    errno_t err = wcsncat_s(dst, dstCchSize, s, toCopy);\r\n    CrashIf(err || dst[currDstCchLen + toCopy] != '\\0');\r\n\r\n    return toCopy;\r\n}\r\n\r\n/* Convert binary data in <buf> of size <len> to a hex-encoded string */\r\nchar *MemToHex(const unsigned char *buf, size_t len)\r\n{\r\n    /* 2 hex chars per byte, +1 for terminating 0 */\r\n    char *ret = AllocArray<char>(2 * len + 1);\r\n    if (!ret)\r\n        return nullptr;\r\n    char *dst = ret;\r\n    for (; len > 0; len--) {\r\n        sprintf_s(dst, 3, \"%02x\", *buf++);\r\n        dst += 2;\r\n    }\r\n    return ret;\r\n}\r\n\r\n/* Reverse of MemToHex. Convert a 0-terminatd hex-encoded string <s> to\r\n   binary data pointed by <buf> of max size bufLen.\r\n   Returns false if size of <s> doesn't match bufLen or is not a valid\r\n   hex string. */\r\nbool HexToMem(const char *s, unsigned char *buf, size_t bufLen)\r\n{\r\n    for (; bufLen > 0; bufLen--) {\r\n        int c;\r\n        if (1 != sscanf_s(s, \"%02x\", &c))\r\n            return false;\r\n        s += 2;\r\n        *buf++ = (unsigned char)c;\r\n    }\r\n    return *s == '\\0';\r\n}\r\n\r\n// format a number with a given thousand separator e.g. it turns 1234 into \"1,234\"\r\n// Caller needs to free() the result.\r\nWCHAR *FormatNumWithThousandSep(size_t num, LCID locale)\r\n{\r\n    WCHAR thousandSep[4] = { 0 };\r\n    if (!GetLocaleInfo(locale, LOCALE_STHOUSAND, thousandSep, dimof(thousandSep)))\r\n        str::BufSet(thousandSep, dimof(thousandSep), L\",\");\r\n    ScopedMem<WCHAR> buf(str::Format(L\"%Iu\", num));\r\n\r\n    size_t resLen = str::Len(buf) + str::Len(thousandSep) * (str::Len(buf) + 3) / 3 + 1;\r\n    WCHAR *res = AllocArray<WCHAR>(resLen);\r\n    if (!res)\r\n        return nullptr;\r\n    WCHAR *next = res;\r\n    int i = 3 - (str::Len(buf) % 3);\r\n    for (const WCHAR *src = buf; *src; ) {\r\n        *next++ = *src++;\r\n        if (*src && i == 2)\r\n            next += str::BufSet(next, resLen - (next - res), thousandSep);\r\n        i = (i + 1) % 3;\r\n    }\r\n    *next = '\\0';\r\n\r\n    return res;\r\n}\r\n\r\n// Format a floating point number with at most two decimal after the point\r\n// Caller needs to free the result.\r\nWCHAR *FormatFloatWithThousandSep(double number, LCID locale)\r\n{\r\n    size_t num = (size_t)(number * 100 + 0.5);\r\n\r\n    ScopedMem<WCHAR> tmp(FormatNumWithThousandSep(num / 100, locale));\r\n    WCHAR decimal[4];\r\n    if (!GetLocaleInfo(locale, LOCALE_SDECIMAL, decimal, dimof(decimal)))\r\n        str::BufSet(decimal, dimof(decimal), L\".\");\r\n\r\n    // always add between one and two decimals after the point\r\n    ScopedMem<WCHAR> buf(str::Format(L\"%s%s%02d\", tmp, decimal, num % 100));\r\n    if (str::EndsWith(buf, L\"0\"))\r\n        buf[str::Len(buf) - 1] = '\\0';\r\n\r\n    return buf.StealData();\r\n}\r\n\r\n// cf. http://rosettacode.org/wiki/Roman_numerals/Encode#C.2B.2B\r\nWCHAR *FormatRomanNumeral(int number)\r\n{\r\n    if (number < 1)\r\n        return nullptr;\r\n\r\n    static struct {\r\n        int value;\r\n        const WCHAR *numeral;\r\n    } romandata[] = {\r\n        { 1000, L\"M\" }, { 900, L\"CM\" }, { 500, L\"D\" }, { 400, L\"CD\" },\r\n        {  100, L\"C\" }, {  90, L\"XC\" }, {  50, L\"L\" }, {  40, L\"XL\" },\r\n        {   10, L\"X\" }, {   9, L\"IX\" }, {   5, L\"V\" }, {   4, L\"IV\" }, { 1, L\"I\" }\r\n    };\r\n\r\n    size_t len = 0;\r\n    for (int num = number, i = 0; i < dimof(romandata); i++) {\r\n        for (; num >= romandata[i].value; num -= romandata[i].value) {\r\n            len += romandata[i].numeral[1] ? 2 : 1;\r\n        }\r\n    }\r\n    assert(len > 0);\r\n\r\n    WCHAR *roman = AllocArray<WCHAR>(len + 1), *c = roman;\r\n    for (int num = number, i = 0; i < dimof(romandata); i++) {\r\n        for (; num >= romandata[i].value; num -= romandata[i].value) {\r\n            c += str::BufSet(c, romandata[i].numeral[1] ? 3 : 2, romandata[i].numeral);\r\n        }\r\n    }\r\n\r\n    return roman;\r\n}\r\n\r\n/* compares two strings \"naturally\" by sorting numbers within a string\r\n   numerically instead of by pure ASCII order; we imitate Windows Explorer\r\n   by sorting special characters before alphanumeric characters\r\n   (e.g. \".hg\" < \"2.pdf\" < \"100.pdf\" < \"zzz\")\r\n   TODO: use StrCmpLogicalW instead once we no longer support Windows 2000 */\r\nint CmpNatural(const WCHAR *a, const WCHAR *b)\r\n{\r\n    CrashAlwaysIf(!a || !b);\r\n    const WCHAR *aStart = a, *bStart = b;\r\n    int diff = 0;\r\n\r\n    for (; 0 == diff; a++, b++) {\r\n        // ignore leading and trailing spaces, and differences in whitespace only\r\n        if (a == aStart || !*a || !*b || IsWs(*a) && IsWs(*b)) {\r\n            for (; IsWs(*a); a++);\r\n            for (; IsWs(*b); b++);\r\n        }\r\n        // if two strings are identical when ignoring case, leading zeroes and\r\n        // whitespace, compare them traditionally for a stable sort order\r\n        if (!*a && !*b)\r\n            return wcscmp(aStart, bStart);\r\n        if (str::IsDigit(*a) && str::IsDigit(*b)) {\r\n            // ignore leading zeroes\r\n            for (; '0' == *a; a++);\r\n            for (; '0' == *b; b++);\r\n            // compare the two numbers as (positive) integers\r\n            for (diff = 0; str::IsDigit(*a) || str::IsDigit(*b); a++, b++) {\r\n                // if either *a or *b isn't a number, they differ in magnitude\r\n                if (!str::IsDigit(*a))\r\n                    return -1;\r\n                if (!str::IsDigit(*b))\r\n                    return 1;\r\n                // remember the difference for when the numbers are of the same magnitude\r\n                if (0 == diff)\r\n                    diff = *a - *b;\r\n            }\r\n            // neither *a nor *b is a digit, so continue with them (unless diff != 0)\r\n            a--;\r\n            b--;\r\n        }\r\n        // sort letters case-insensitively\r\n        else if (iswalnum(*a) && iswalnum(*b))\r\n            diff = towlower(*a) - towlower(*b);\r\n        // sort special characters before text and numbers\r\n        else if (iswalnum(*a))\r\n            return 1;\r\n        else if (iswalnum(*b))\r\n            return -1;\r\n        // sort special characters by ASCII code\r\n        else\r\n            diff = *a - *b;\r\n    }\r\n\r\n    return diff;\r\n}\r\n\r\ntemplate <typename T>\r\nstatic T *ExtractUntil(const T *pos, T c, const T **endOut)\r\n{\r\n    *endOut = FindChar(pos, c);\r\n    if (!*endOut)\r\n        return nullptr;\r\n    return str::DupN(pos, *endOut - pos);\r\n}\r\n\r\nstatic const char *ParseLimitedNumber(const char *str, const char *format,\r\n                                      const char **endOut, void *valueOut)\r\n{\r\n    UINT width;\r\n    char f2[] = \"% \";\r\n    const char *endF = Parse(format, \"%u%c\", &width, &f2[1]);\r\n    if (endF && FindChar(\"udx\", f2[1]) && width <= Len(str)) {\r\n        char limited[16]; // 32-bit integers are at most 11 characters long\r\n        str::BufSet(limited, std::min((size_t)width + 1, dimof(limited)), str);\r\n        const char *end = Parse(limited, f2, valueOut);\r\n        if (end && !*end)\r\n            *endOut = str + width;\r\n    }\r\n    return endF;\r\n}\r\n\r\nstatic const WCHAR *ParseLimitedNumber(const WCHAR *str, const WCHAR *format,\r\n                                       const WCHAR **endOut, void *valueOut)\r\n{\r\n    UINT width;\r\n    WCHAR f2[] = L\"% \";\r\n    const WCHAR *endF = Parse(format, L\"%u%c\", &width, &f2[1]);\r\n    if (endF && FindChar(L\"udx\", f2[1]) && width <= Len(str)) {\r\n        WCHAR limited[16]; // 32-bit integers are at most 11 characters long\r\n        str::BufSet(limited, std::min((size_t)width + 1, dimof(limited)), str);\r\n        const WCHAR *end = Parse(limited, f2, valueOut);\r\n        if (end && !*end)\r\n            *endOut = str + width;\r\n    }\r\n    return endF;\r\n}\r\n\r\n/* Parses a string into several variables sscanf-style (i.e. pass in pointers\r\n   to where the parsed values are to be stored). Returns a pointer to the first\r\n   character that's not been parsed when successful and nullptr otherwise.\r\n\r\n   Supported formats:\r\n     %u - parses an unsigned int\r\n     %d - parses a signed int\r\n     %x - parses an unsigned hex-int\r\n     %f - parses a float\r\n     %c - parses a single WCHAR\r\n     %s - parses a string (pass in a WCHAR**, free after use - also on failure!)\r\n     %S - parses a string into a ScopedMem<WCHAR>\r\n     %? - makes the next single character optional (e.g. \"x%?,y\" parses both \"xy\" and \"x,y\")\r\n     %$ - causes the parsing to fail if it's encountered when not at the end of the string\r\n     %  - skips a single whitespace character\r\n     %_ - skips one or multiple whitespace characters (or none at all)\r\n     %% - matches a single '%'\r\n\r\n   %u, %d and %x accept an optional width argument, indicating exactly how many\r\n   characters must be read for parsing the number (e.g. \"%4d\" parses -123 out of \"-12345\"\r\n   and doesn't parse \"123\" at all).\r\n*/\r\nstatic const char *ParseV(const char *str, const char *format, va_list args)\r\n{\r\n    for (const char *f = format; *f; f++) {\r\n        if (*f != '%') {\r\n            if (*f != *str)\r\n                return nullptr;\r\n            str++;\r\n            continue;\r\n        }\r\n        f++;\r\n\r\n        const char *end = nullptr;\r\n        if ('u' == *f)\r\n            *va_arg(args, unsigned int *) = strtoul(str, (char **)&end, 10);\r\n        else if ('d' == *f)\r\n            *va_arg(args, int *) = strtol(str, (char **)&end, 10);\r\n        else if ('x' == *f)\r\n            *va_arg(args, unsigned int *) = strtoul(str, (char **)&end, 16);\r\n        else if ('f' == *f)\r\n            *va_arg(args, float *) = (float)strtod(str, (char **)&end);\r\n        else if ('c' == *f)\r\n            *va_arg(args, char *) = *str, end = str + 1;\r\n        else if ('s' == *f)\r\n            *va_arg(args, char **) = ExtractUntil(str, *(f + 1), &end);\r\n        else if ('S' == *f)\r\n            va_arg(args, ScopedMem<char> *)->Set(ExtractUntil(str, *(f + 1), &end));\r\n        else if ('$' == *f && !*str)\r\n            continue; // don't fail, if we're indeed at the end of the string\r\n        else if ('%' == *f && *f == *str)\r\n            end = str + 1;\r\n        else if (' ' == *f && str::IsWs(*str))\r\n            end = str + 1;\r\n        else if ('_' == *f) {\r\n            if (!str::IsWs(*str))\r\n                continue; // don't fail, if there's no whitespace at all\r\n            for (end = str + 1; str::IsWs(*end); end++);\r\n        }\r\n        else if ('?' == *f && *(f + 1)) {\r\n            // skip the next format character, advance the string,\r\n            // if it the optional character is the next character to parse\r\n            if (*str != *++f)\r\n                continue;\r\n            end = (char *)str + 1;\r\n        }\r\n        else if (str::IsDigit(*f))\r\n            f = ParseLimitedNumber(str, f, &end, va_arg(args, void *)) - 1;\r\n        if (!end || end == str)\r\n            return nullptr;\r\n        str = end;\r\n    }\r\n    return str;\r\n}\r\n\r\nconst char *Parse(const char *str, const char *fmt, ...)\r\n{\r\n    if (!str || !fmt)\r\n        return nullptr;\r\n\r\n    va_list args;\r\n    va_start(args, fmt);\r\n    const char *res = ParseV(str, fmt, args);\r\n    va_end(args);\r\n    return res;\r\n}\r\n\r\n// TODO: could optimize it by making the main Parse() implementation\r\n// work with explicit length and not rely on zero-termination\r\nconst char *Parse(const char *str, size_t len, const char *fmt, ...)\r\n{\r\n    char buf[128] = { 0 };\r\n    char *s = buf;\r\n\r\n    if (!str || !fmt)\r\n        return nullptr;\r\n\r\n    if (len < dimof(buf))\r\n        memcpy(buf, str, len);\r\n    else\r\n        s = DupN(str, len);\r\n\r\n    va_list args;\r\n    va_start(args, fmt);\r\n    const char *res = ParseV(s, fmt, args);\r\n    va_end(args);\r\n\r\n    if (res)\r\n        res = str + (res - s);\r\n    if (s != buf)\r\n        free(s);\r\n    return res;\r\n}\r\n\r\nconst WCHAR *Parse(const WCHAR *str, const WCHAR *format, ...)\r\n{\r\n    if (!str)\r\n        return nullptr;\r\n    va_list args;\r\n    va_start(args, format);\r\n    for (const WCHAR *f = format; *f; f++) {\r\n        if (*f != '%') {\r\n            if (*f != *str)\r\n                goto Failure;\r\n            str++;\r\n            continue;\r\n        }\r\n        f++;\r\n\r\n        const WCHAR *end = nullptr;\r\n        if ('u' == *f)\r\n            *va_arg(args, unsigned int *) = wcstoul(str, (WCHAR **)&end, 10);\r\n        else if ('d' == *f)\r\n            *va_arg(args, int *) = wcstol(str, (WCHAR **)&end, 10);\r\n        else if ('x' == *f)\r\n            *va_arg(args, unsigned int *) = wcstoul(str, (WCHAR **)&end, 16);\r\n        else if ('f' == *f)\r\n            *va_arg(args, float *) = (float)wcstod(str, (WCHAR **)&end);\r\n        else if ('c' == *f)\r\n            *va_arg(args, WCHAR *) = *str, end = str + 1;\r\n        else if ('s' == *f)\r\n            *va_arg(args, WCHAR **) = ExtractUntil(str, *(f + 1), &end);\r\n        else if ('S' == *f)\r\n            va_arg(args, ScopedMem<WCHAR> *)->Set(ExtractUntil(str, *(f + 1), &end));\r\n        else if ('$' == *f && !*str)\r\n            continue; // don't fail, if we're indeed at the end of the string\r\n        else if ('%' == *f && *f == *str)\r\n            end = str + 1;\r\n        else if (' ' == *f && str::IsWs(*str))\r\n            end = str + 1;\r\n        else if ('_' == *f) {\r\n            if (!str::IsWs(*str))\r\n                continue; // don't fail, if there's no whitespace at all\r\n            for (end = str + 1; str::IsWs(*end); end++);\r\n        }\r\n        else if ('?' == *f && *(f + 1)) {\r\n            // skip the next format character, advance the string,\r\n            // if it the optional character is the next character to parse\r\n            if (*str != *++f)\r\n                continue;\r\n            end = str + 1;\r\n        }\r\n        else if (str::IsDigit(*f))\r\n            f = ParseLimitedNumber(str, f, &end, va_arg(args, void *)) - 1;\r\n        if (!end || end == str)\r\n            goto Failure;\r\n        str = end;\r\n    }\r\n    va_end(args);\r\n    return str;\r\n\r\nFailure:\r\n    va_end(args);\r\n    return nullptr;\r\n}\r\n\r\nsize_t Utf8ToWcharBuf(const char *s, size_t cbLen, WCHAR *bufOut, size_t cchBufOutSize)\r\n{\r\n    CrashIf(!bufOut || (0 == cchBufOutSize));\r\n    int cchConverted = MultiByteToWideChar(CP_UTF8, 0, s, (int)cbLen, bufOut, (int)cchBufOutSize);\r\n    if (0 == cchConverted) {\r\n        // TODO: determine ideal string length so that the conversion succeeds\r\n        cchConverted = MultiByteToWideChar(CP_UTF8, 0, s, (int)cchBufOutSize / 2, bufOut, (int)cchBufOutSize);\r\n    }\r\n    else if ((size_t)cchConverted >= cchBufOutSize) {\r\n        cchConverted = (int)cchBufOutSize - 1;\r\n    }\r\n    bufOut[cchConverted] = '\\0';\r\n    return cchConverted;\r\n}\r\n\r\nsize_t WcharToUtf8Buf(const WCHAR *s, char *bufOut, size_t cbBufOutSize)\r\n{\r\n    CrashIf(!bufOut || (0 == cbBufOutSize));\r\n    int cbConverted = WideCharToMultiByte(CP_UTF8, 0, s, -1, nullptr, 0, nullptr, nullptr);\r\n    if ((size_t)cbConverted >= cbBufOutSize)\r\n        cbConverted = (int)cbBufOutSize - 1;\r\n    int res = WideCharToMultiByte(CP_UTF8, 0, s, (int)str::Len(s), bufOut, cbConverted, nullptr, nullptr);\r\n    CrashIf(res > cbConverted);\r\n    bufOut[res] = '\\0';\r\n    return res;\r\n}\r\n\r\n// --- copyright for utf8 code below\r\n\r\n/*\r\n * Copyright 2001-2004 Unicode, Inc.\r\n *\r\n * Disclaimer\r\n *\r\n * This source code is provided as is by Unicode, Inc. No claims are\r\n * made as to fitness for any particular purpose. No warranties of any\r\n * kind are expressed or implied. The recipient agrees to determine\r\n * applicability of information provided. If this file has been\r\n * purchased on magnetic or optical media from Unicode, Inc., the\r\n * sole remedy for any claim will be exchange of defective media\r\n * within 90 days of receipt.\r\n *\r\n * Limitations on Rights to Redistribute This Code\r\n *\r\n * Unicode, Inc. hereby grants the right to freely use the information\r\n * supplied in this file in the creation of products supporting the\r\n * Unicode Standard, and to make copies of this file in any form\r\n * for internal or external distribution as long as this notice\r\n * remains attached.\r\n */\r\n\r\ntypedef unsigned char UTF8; /* typically 8 bits */\r\n\r\n/*\r\n * Index into the table below with the first byte of a UTF-8 sequence to\r\n * get the number of trailing bytes that are supposed to follow it.\r\n * Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is\r\n * left as-is for anyone who may want to do such conversion, which was\r\n * allowed in earlier algorithms.\r\n */\r\nstatic const char trailingBytesForUTF8[256] = {\r\n    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,\r\n    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,\r\n    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,\r\n    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,\r\n    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,\r\n    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,\r\n    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\r\n    2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5\r\n};\r\n\r\n/*\r\n * Utility routine to tell whether a sequence of bytes is legal UTF-8.\r\n * This must be called with the length pre-determined by the first byte.\r\n * If not calling this from ConvertUTF8to*, then the length can be set by:\r\n *  length = trailingBytesForUTF8[*source]+1;\r\n * and the sequence is illegal right away if there aren't that many bytes\r\n * available.\r\n * If presented with a length > 4, this returns false.  The Unicode\r\n * definition of UTF-8 goes up to 4-byte sequences.\r\n */\r\n\r\nstatic bool isLegalUTF8(const UTF8 *source, int length) {\r\n    UTF8 a;\r\n    const UTF8 *srcptr = source+length;\r\n\r\n    switch (length) {\r\n    default: return false;\r\n    /* Everything else falls through when \"true\"... */\r\n    case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;\r\n    case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;\r\n    case 2: if ((a = (*--srcptr)) > 0xBF) return false;\r\n\r\n        switch (*source) {\r\n            /* no fall-through in this inner switch */\r\n            case 0xE0: if (a < 0xA0) return false; break;\r\n            case 0xED: if (a > 0x9F) return false; break;\r\n            case 0xF0: if (a < 0x90) return false; break;\r\n            case 0xF4: if (a > 0x8F) return false; break;\r\n            default:   if (a < 0x80) return false;\r\n        }\r\n\r\n    case 1: if (*source >= 0x80 && *source < 0xC2) return false;\r\n    }\r\n\r\n    if (*source > 0xF4) return false;\r\n\r\n    return true;\r\n}\r\n\r\n/* --------------------------------------------------------------------- */\r\n\r\n/*\r\n * Exported function to return whether a UTF-8 sequence is legal or not.\r\n * This is not used here; it's just exported.\r\n */\r\nbool isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) {\r\n    int length = trailingBytesForUTF8[*source]+1;\r\n    if (source+length > sourceEnd) return false;\r\n    return isLegalUTF8(source, length);\r\n}\r\n\r\n/*\r\n* Exported function to return whether a UTF-8 string is legal or not.\r\n* This is not used here; it's just exported.\r\n*/\r\nbool isLegalUTF8String(const UTF8 **source, const UTF8 *sourceEnd) {\r\n    while (*source != sourceEnd) {\r\n        int length = trailingBytesForUTF8[**source] + 1;\r\n        if (length > sourceEnd - *source || !isLegalUTF8(*source, length))\r\n            return false;\r\n        *source += length;\r\n    }\r\n    return true;\r\n}\r\n\r\n// --- end of Unicode, Inc. utf8 code\r\n\r\nnamespace conv {\r\n\r\n// tries to convert a string in unknown encoding to utf8, as best\r\n// as it cans\r\n// As an optimization, can return src if the string already is\r\n// valid utf8. Otherwise returns a copy of the string and the\r\n// caller has to free() it\r\nchar *UnknownToUtf8(const char *s, size_t len)\r\n{\r\n    if (0 == len)\r\n        len = str::Len(s);\r\n\r\n    if (len < 3)\r\n        return (char*)s;\r\n\r\n    if (str::StartsWith(s, UTF8_BOM))\r\n        return (char*)s;\r\n\r\n    // TODO: UTF16BE_BOM\r\n\r\n    if (str::StartsWith(s, UTF16_BOM)) {\r\n        s += 2;\r\n        int cchLen = (int)((len - 2) / 2);\r\n        return str::conv::ToUtf8((const WCHAR *)s, cchLen);\r\n    }\r\n\r\n    // if s is valid utf8, leave it alone\r\n    const UTF8 *tmp = (const UTF8*)s;\r\n    if (isLegalUTF8String(&tmp, tmp + len))\r\n        return (char*)s;\r\n\r\n    ScopedMem<WCHAR> uni(str::conv::FromAnsi(s, len));\r\n    return str::conv::ToUtf8(uni.Get());\r\n}\r\n\r\nsize_t ToCodePageBuf(char *buf, int cbBufSize, const WCHAR *s, UINT cp)\r\n{\r\n    return WideCharToMultiByte(cp, 0, s, -1, buf, cbBufSize, nullptr, nullptr);\r\n}\r\nsize_t FromCodePageBuf(WCHAR *buf, int cchBufSize, const char *s, UINT cp)\r\n{\r\n    return MultiByteToWideChar(cp, 0, s, -1, buf, cchBufSize);\r\n}\r\n\r\n} // namespace str::conv\r\n\r\n} // namespace str\r\n\r\nnamespace url {\r\n\r\nbool IsAbsolute(const WCHAR *url)\r\n{\r\n    const WCHAR *colon = str::FindChar(url, ':');\r\n    const WCHAR *hash = str::FindChar(url, '#');\r\n    return colon && (!hash || hash > colon);\r\n}\r\n\r\nvoid DecodeInPlace(char *url)\r\n{\r\n    for (char *src = url; *src; src++, url++) {\r\n        int val;\r\n        if (*src == '%' && str::Parse(src, \"%%%2x\", &val)) {\r\n            *url = (char)val;\r\n            src += 2;\r\n        } else {\r\n            *url = *src;\r\n        }\r\n    }\r\n    *url = '\\0';\r\n}\r\n\r\nvoid DecodeInPlace(WCHAR *url)\r\n{\r\n    if (!str::FindChar(url, '%'))\r\n        return;\r\n    // URLs are usually UTF-8 encoded\r\n    ScopedMem<char> urlUtf8(str::conv::ToUtf8(url));\r\n    DecodeInPlace(urlUtf8);\r\n    // convert back in place\r\n    CrashIf(str::Len(url) >= INT_MAX);\r\n    MultiByteToWideChar(CP_UTF8, 0, urlUtf8, -1, url, (int)str::Len(url) + 1);\r\n}\r\n\r\nWCHAR *GetFullPath(const WCHAR *url)\r\n{\r\n    WCHAR *path = str::Dup(url);\r\n    str::TransChars(path, L\"#?\", L\"\\0\\0\");\r\n    DecodeInPlace(path);\r\n    return path;\r\n}\r\n\r\nWCHAR *GetFileName(const WCHAR *url)\r\n{\r\n    ScopedMem<WCHAR> path(str::Dup(url));\r\n    str::TransChars(path, L\"#?\", L\"\\0\\0\");\r\n    WCHAR *base = path + str::Len(path);\r\n    for (; base > path; base--) {\r\n        if ('/' == base[-1] || '\\\\' == base[-1])\r\n            break;\r\n    }\r\n    if (str::IsEmpty(base))\r\n        return nullptr;\r\n    DecodeInPlace(base);\r\n    return str::Dup(base);\r\n}\r\n\r\n} // namespace url\r\n\r\n// seqstrings is for size-efficient implementation of:\r\n// string -> int and int->string.\r\n// it's even more efficient than using char *[] array\r\n// it comes at the cost of speed, so it's not good for places\r\n// that are critial for performance. On the other hand, it's\r\n// not that bad: linear scanning of memory is fast due to the magic\r\n// of L1 cache\r\nnamespace seqstrings {\r\n\r\n// advance to next string\r\nvoid SkipStr(char *& s)\r\n{\r\n    while (*s)\r\n        s++;\r\n    s++;\r\n}\r\n\r\n// advance to next string\r\nvoid SkipStr(const char *& s)\r\n{\r\n    while (*s)\r\n        s++;\r\n    s++;\r\n}\r\n\r\n// Returns nullptr if s is the same as toFind\r\n// If they are not equal, returns end of s + 1\r\nstatic inline const char *StrEqWeird(const char *s, const char *toFind)\r\n{\r\n    char c;\r\n    for (;;) {\r\n        c = *s++;\r\n        if (0 == c) {\r\n            if (0 == *toFind)\r\n                return nullptr;\r\n            return s;\r\n        }\r\n        if (c != *toFind++) {\r\n            while (*s) {\r\n                s++;\r\n            }\r\n            return s + 1;\r\n        }\r\n        // were equal, check another char\r\n    }\r\n}\r\n\r\n// Returns nullptr if s is the same as toFind\r\n// If they are not equal, returns end of s + 1\r\nstatic inline const char *StrEqWeird(const char *s, const WCHAR *toFind)\r\n{\r\n    WCHAR wc;\r\n    char c, c2;\r\n    for (;;) {\r\n        c = *s++;\r\n        if (0 == c) {\r\n            if (0 == *toFind)\r\n                return nullptr;\r\n            return s;\r\n        }\r\n        wc = *toFind++;\r\n        if (wc > 255)\r\n            return nullptr;\r\n        c2 = (char)wc;\r\n        if (c != c2) {\r\n            while (*s) {\r\n                s++;\r\n            }\r\n            return s + 1;\r\n        }\r\n        // were equal, check another char\r\n    }\r\n}\r\n\r\n// conceptually strings is an array of 0-terminated strings where, laid\r\n// out sequentially in memory, terminated with a 0-length string\r\n// Returns index of toFind string in strings\r\n// Returns -1 if string doesn't exist\r\nint StrToIdx(const char *strings, const char *toFind)\r\n{\r\n    const char *s = strings;\r\n    int idx = 0;\r\n    while (*s) {\r\n        s = StrEqWeird(s, toFind);\r\n        if (nullptr == s)\r\n            return idx;\r\n        ++idx;\r\n    }\r\n    return -1;\r\n}\r\n\r\n// optimization: allows finding WCHAR strings in char * strings array\r\n// without the need to convert first\r\n// returns -1 if toFind doesn't exist in strings, or its index if exists\r\nint StrToIdx(const char *strings, const WCHAR *toFind)\r\n{\r\n    const char *s = strings;\r\n    int idx = 0;\r\n    while (*s) {\r\n        s = StrEqWeird(s, toFind);\r\n        if (nullptr == s)\r\n            return idx;\r\n        ++idx;\r\n    }\r\n    return -1;\r\n}\r\n\r\n// Given an index in the \"array\" of sequentially laid out strings,\r\n// returns a strings at that index.\r\nconst char *IdxToStr(const char *strings, int idx)\r\n{\r\n    const char *s = strings;\r\n    while (idx > 0) {\r\n        while (*s) {\r\n            s++;\r\n        }\r\n        s++;\r\n        --idx;\r\n    }\r\n    return s;\r\n}\r\n\r\n} // namespace seqstrings\r\n"
  },
  {
    "path": "src/utils/StrUtil.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: Simplified BSD (see COPYING.BSD) */\n\n// note: include BaseUtil.h instead of including directly\n\nnamespace str {\n\nenum TrimOpt {\n    TrimLeft,\n    TrimRight,\n    TrimBoth\n};\n\nsize_t Len(const char *s);\nsize_t Len(const WCHAR *s);\n\nchar *  Dup(const char *s);\nWCHAR * Dup(const WCHAR *s);\n\nvoid ReplacePtr(char **s, const char *snew);\nvoid ReplacePtr(const char **s, const char *snew);\nvoid ReplacePtr(WCHAR **s, const WCHAR *snew);\n\nchar *  Join(const char *s1, const char *s2, const char *s3=nullptr);\nchar *  Join(const char *s1, const char *s2, const char *s3, Allocator *allocator);\nWCHAR * Join(const WCHAR *s1, const WCHAR *s2, const WCHAR *s3=nullptr);\n\nbool Eq(const char *s1, const char *s2);\nbool Eq(const WCHAR *s1, const WCHAR *s2);\nbool EqI(const char *s1, const char *s2);\nbool EqI(const WCHAR *s1, const WCHAR *s2);\nbool EqIS(const char *s1, const char *s2);\nbool EqIS(const WCHAR *s1, const WCHAR *s2);\nbool EqN(const char *s1, const char *s2, size_t len);\nbool EqN(const WCHAR *s1, const WCHAR *s2, size_t len);\nbool EqNI(const char *s1, const char *s2, size_t len);\nbool EqNI(const WCHAR *s1, const WCHAR *s2, size_t len);\n\ntemplate <typename T>\ninline bool IsEmpty(T *s) {\n    return !s || (0 == *s);\n}\n\ntemplate <typename T>\ninline bool StartsWith(const T* str, const T* txt) {\n    return EqN(str, txt, Len(txt));\n}\n\nbool StartsWithI(const char *str, const char *txt);\nbool StartsWithI(const WCHAR *str, const WCHAR *txt);\nbool EndsWith(const char *txt, const char *end);\nbool EndsWith(const WCHAR *txt, const WCHAR *end);\nbool EndsWithI(const char *txt, const char *end);\nbool EndsWithI(const WCHAR *txt, const WCHAR *end);\n\ninline bool EqNIx(const char *s, size_t len, const char *s2) {\n    return str::Len(s2) == len && str::StartsWithI(s, s2);\n}\n\nchar *  DupN(const char *s, size_t lenCch);\nWCHAR * DupN(const WCHAR *s, size_t lenCch);\n\nchar* ToLowerInPlace(char *s);\nWCHAR* ToLowerInPlace(WCHAR *s);\n\nchar *  ToMultiByte(const WCHAR *txt, UINT CodePage, int cchTxtLen=-1);\nchar *  ToMultiByte(const char *src, UINT CodePageSrc, UINT CodePageDest);\nWCHAR * ToWideChar(const char *src, UINT CodePage, int cbSrcLen=-1);\nvoid    Utf8Encode(char *& dst, int c);\n\ninline const char * FindChar(const char *str, const char c) {\n    return strchr(str, c);\n}\ninline const WCHAR * FindChar(const WCHAR *str, const WCHAR c) {\n    return wcschr(str, c);\n}\ninline char * FindChar(char *str, const char c) {\n    return strchr(str, c);\n}\ninline WCHAR * FindChar(WCHAR *str, const WCHAR c) {\n    return wcschr(str, c);\n}\n\ninline const char * FindCharLast(const char *str, const char c) {\n    return strrchr(str, c);\n}\ninline const WCHAR * FindCharLast(const WCHAR *str, const WCHAR c) {\n    return wcsrchr(str, c);\n}\ninline char * FindCharLast(char *str, const char c) {\n    return strrchr(str, c);\n}\ninline WCHAR * FindCharLast(WCHAR *str, const WCHAR c) {\n    return wcsrchr(str, c);\n}\n\ninline const char * Find(const char *str, const char *find) {\n    return strstr(str, find);\n}\ninline const WCHAR * Find(const WCHAR *str, const WCHAR *find) {\n    return wcsstr(str, find);\n}\n\nconst char * FindI(const char *str, const char *find);\nconst WCHAR * FindI(const WCHAR *str, const WCHAR *find);\n\nbool    BufFmtV(char *buf, size_t bufCchSize, const char *fmt, va_list args);\nchar *  FmtV(const char *fmt, va_list args);\nchar *  Format(const char *fmt, ...);\nbool    BufFmtV(WCHAR *buf, size_t bufCchSize, const WCHAR *fmt, va_list args);\nWCHAR * FmtV(const WCHAR *fmt, va_list args);\nWCHAR * Format(const WCHAR *fmt, ...);\n\ninline bool IsWs(char c) { return ' ' == c || '\\t' <= c && c <= '\\r'; }\ninline bool IsWs(WCHAR c) { return iswspace(c); }\n\n// Note: I tried an optimization: return (unsigned)(c - '0') < 10;\n// but it seems to mis-compile in release builds\ninline bool IsDigit(char c) {\n    return '0' <= c && c <= '9';\n}\n\ninline bool IsDigit(WCHAR c) {\n    return '0' <= c && c <= '9';\n}\n\ninline bool IsNonCharacter(WCHAR c) {\n    return c >= 0xFFFE || (c & ~1) == 0xDFFE || (0xFDD0 <= c && c <= 0xFDEF);\n}\n\nsize_t  TrimWS(WCHAR *s, TrimOpt opt=TrimBoth);\nvoid    TrimWsEnd(char *s, char *&e);\n\nsize_t  TransChars(char *str, const char *oldChars, const char *newChars);\nsize_t  TransChars(WCHAR *str, const WCHAR *oldChars, const WCHAR *newChars);\nchar *  Replace(const char *s, const char *toReplace, const char *replaceWith);\nWCHAR * Replace(const WCHAR *s, const WCHAR *toReplace, const WCHAR *replaceWith);\n\nsize_t  NormalizeWS(char *str);\nsize_t  NormalizeWS(WCHAR *str);\nsize_t  NormalizeNewlinesInPlace(char *s, char *e);\nsize_t  NormalizeNewlinesInPlace(char *s);\nsize_t  RemoveChars(char *str, const char *toRemove);\nsize_t  RemoveChars(WCHAR *str, const WCHAR *toRemove);\n\nsize_t  BufSet(char *dst, size_t dstCchSize, const char *src);\nsize_t  BufSet(WCHAR *dst, size_t dstCchSize, const WCHAR *src);\nsize_t  BufAppend(char *dst, size_t dstCchSize, const char *s);\nsize_t  BufAppend(WCHAR *dst, size_t dstCchSize, const WCHAR *s);\n\nchar *  MemToHex(const unsigned char *buf, size_t len);\nbool    HexToMem(const char *s, unsigned char *buf, size_t bufLen);\n\nWCHAR * FormatFloatWithThousandSep(double number, LCID locale=LOCALE_USER_DEFAULT);\nWCHAR * FormatNumWithThousandSep(size_t num, LCID locale=LOCALE_USER_DEFAULT);\nWCHAR * FormatRomanNumeral(int number);\n\nint     CmpNatural(const WCHAR *a, const WCHAR *b);\n\nconst char  *   Parse(const char *str, const char *format, ...);\nconst char  *   Parse(const char *str, size_t len, const char *format, ...);\nconst WCHAR *   Parse(const WCHAR *str, const WCHAR *format, ...);\n\nsize_t Utf8ToWcharBuf(const char *s, size_t sLen, WCHAR *bufOut, size_t cchBufOutSize);\nsize_t WcharToUtf8Buf(const WCHAR *s, char *bufOut, size_t cbBufOutSize);\n\nnamespace conv {\n\ninline WCHAR *  FromCodePage(const char *src, UINT cp) { return ToWideChar(src, cp); }\ninline char *   ToCodePage(const WCHAR *src, UINT cp) { return ToMultiByte(src, cp); }\n\ninline WCHAR *  FromUtf8(const char *src, size_t cbSrcLen) { return ToWideChar(src, CP_UTF8, (int)cbSrcLen); }\ninline WCHAR *  FromUtf8(const char *src) { return ToWideChar(src, CP_UTF8); }\ninline char *   ToUtf8(const WCHAR *src, size_t cchSrcLen) { return ToMultiByte(src, CP_UTF8, (int)cchSrcLen); }\ninline char *   ToUtf8(const WCHAR *src) { return ToMultiByte(src, CP_UTF8); }\ninline WCHAR *  FromAnsi(const char *src, size_t cbSrcLen=(size_t)-1) { return ToWideChar(src, CP_ACP, (int)cbSrcLen); }\ninline char *   ToAnsi(const WCHAR *src) { return ToMultiByte(src, CP_ACP); }\nchar *          UnknownToUtf8(const char *src, size_t len = 0);\n\nsize_t ToCodePageBuf(char *buf, int cbBufSize, const WCHAR *s, UINT cp);\nsize_t FromCodePageBuf(WCHAR *buf, int cchBufSize, const char *s, UINT cp);\n\n} // namespace str::conv\n\n}  // namespace str\n\nnamespace url {\n\nbool IsAbsolute(const WCHAR *url);\nvoid DecodeInPlace(char *urlUtf8);\nvoid DecodeInPlace(WCHAR *url);\nWCHAR *GetFullPath(const WCHAR *url);\nWCHAR *GetFileName(const WCHAR *url);\n\n} // namespace url\n\nnamespace seqstrings {\nvoid         SkipStr(char *& s);\nvoid         SkipStr(const char *& s);\nint          StrToIdx(const char *strings, const char *toFind);\nint          StrToIdx(const char *strings, const WCHAR *toFind);\nconst char * IdxToStr(const char *strings, int idx);\n\n} // namespace seqstrings\n\n#define _MemToHex(ptr) str::MemToHex((const unsigned char *)(ptr), sizeof(*ptr))\n#define _HexToMem(txt, ptr) str::HexToMem(txt, (unsigned char *)(ptr), sizeof(*ptr))\n\n#define UTF8_BOM    \"\\xEF\\xBB\\xBF\"\n#define UTF16_BOM   \"\\xFF\\xFE\"\n#define UTF16BE_BOM \"\\xFE\\xFF\"\n"
  },
  {
    "path": "src/utils/TgaReader.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: Simplified BSD (see COPYING.BSD) */\n\n#include \"BaseUtil.h\"\n#include \"TgaReader.h\"\n\nusing namespace Gdiplus;\n\nnamespace tga {\n\n#define TGA_FOOTER_SIGNATURE \"TRUEVISION-XFILE.\"\n\nenum ImageType {\n    Type_Palette = 1,\n    Type_Truecolor = 2,\n    Type_Grayscale = 3,\n    Type_Palette_RLE = 9,\n    Type_Truecolor_RLE = 10,\n    Type_Grayscale_RLE = 11,\n};\n\nenum ImageFlag {\n    Flag_Alpha = 0x0F,\n    Flag_InvertX = 0x10,\n    Flag_InvertY = 0x20,\n    Flag_Reserved = 0xC0,\n};\n\nenum ImageAlpha {\n    Alpha_Ignore = 0,\n    Alpha_Normal = 3,\n    Alpha_Premultiplied = 4,\n};\n\n#include <pshpack1.h>\n\nstruct TgaHeader {\n    uint8_t     idLength;\n    uint8_t     cmapType;\n    uint8_t     imageType;\n    uint16_t    cmapFirstEntry;\n    uint16_t    cmapLength;\n    uint8_t     cmapBitDepth;\n    uint16_t    offsetX, offsetY;\n    uint16_t    width, height;\n    uint8_t     bitDepth;\n    uint8_t     flags;\n};\n\nstruct TgaFooter {\n    uint32_t    extAreaOffset;\n    uint32_t    devAreaOffset;\n    char        signature[18];\n};\n\nstruct TgaExtArea {\n    uint16_t    size;\n    char        author[41];\n    char        comments[4][81];\n    uint16_t    dateTime[6];\n    uint8_t     fields_14_to_15[47];\n    char        progName[41];\n    uint16_t    progVersion;\n    char        progVersionC;\n    uint32_t    fields_18_to_23[6];\n    uint8_t     alphaType;\n};\n\n#include <poppack.h>\n\nstatic_assert(sizeof(TgaHeader) == 18, \"wrong size of TgaHeader structure\");\nstatic_assert(sizeof(TgaFooter) == 26, \"wrong size of TgaFooter structure\");\nstatic_assert(sizeof(TgaExtArea) == 495, \"wrong size of TgaExtArea structure\");\n\nstatic inline uint16_t convLE(uint16_t x)\n{\n    uint8_t *data = (uint8_t *)&x;\n    return data[0] | (data[1] << 8);\n}\n\nstatic inline uint32_t convLE(uint32_t x)\n{\n    uint8_t *data = (uint8_t *)&x;\n    return data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24);\n}\n\nstatic bool HasVersion2Footer(const char *data, size_t len)\n{\n    if (len < sizeof(TgaHeader) + sizeof(TgaFooter))\n        return false;\n    const TgaFooter *footerLE = (const TgaFooter *)(data + len - sizeof(TgaFooter));\n    return str::EqN(footerLE->signature, TGA_FOOTER_SIGNATURE, sizeof(footerLE->signature));\n}\n\nstatic const TgaExtArea *GetExtAreaPtr(const char *data, size_t len)\n{\n    if (!HasVersion2Footer(data, len))\n        return nullptr;\n    const TgaFooter *footerLE = (const TgaFooter *)(data + len - sizeof(TgaFooter));\n    if (convLE(footerLE->extAreaOffset) < sizeof(TgaHeader) ||\n        convLE(footerLE->extAreaOffset) + sizeof(TgaExtArea) + sizeof(TgaFooter) > len) {\n        return nullptr;\n    }\n    const TgaExtArea *extAreaLE = (const TgaExtArea *)(data + convLE(footerLE->extAreaOffset));\n    if (convLE(extAreaLE->size) < sizeof(TgaExtArea))\n        return nullptr;\n    return extAreaLE;\n}\n\n// note: we only support the more common bit depths:\n// http://www.ryanjuckett.com/programming/graphics/26-parsing-colors-in-a-tga-file\nstatic PixelFormat GetPixelFormat(const TgaHeader *headerLE, ImageAlpha aType=Alpha_Normal)\n{\n    int bits;\n    if (Type_Palette == headerLE->imageType || Type_Palette_RLE == headerLE->imageType) {\n        if (1 != headerLE->cmapType || 8 != headerLE->bitDepth && 16 != headerLE->bitDepth)\n            return 0;\n        bits = headerLE->cmapBitDepth;\n    }\n    else if (Type_Truecolor == headerLE->imageType || Type_Truecolor_RLE == headerLE->imageType) {\n        bits = headerLE->bitDepth;\n    }\n    else if (Type_Grayscale == headerLE->imageType || Type_Grayscale_RLE == headerLE->imageType) {\n        if (8 != headerLE->bitDepth || (headerLE->flags & Flag_Alpha))\n            return 0;\n        // using a non-indexed format so that we don't have to bother with a palette\n        return PixelFormat24bppRGB;\n    }\n    else\n        return 0;\n\n    int alphaBits = (headerLE->flags & Flag_Alpha);\n    if (15 == bits && 0 == alphaBits)\n        return PixelFormat16bppRGB555;\n    if (16 == bits && (0 == alphaBits || Alpha_Ignore == aType))\n        return PixelFormat16bppRGB555;\n    if (16 == bits && 1 == alphaBits)\n        return PixelFormat16bppARGB1555;\n    if (24 == bits && 0 == alphaBits)\n        return PixelFormat24bppRGB;\n    if (32 == bits && (0 == alphaBits || Alpha_Ignore == aType))\n        return PixelFormat32bppRGB;\n    if (32 == bits && 8 == alphaBits && Alpha_Normal == aType)\n        return PixelFormat32bppARGB;\n    if (32 == bits && 8 == alphaBits && Alpha_Premultiplied == aType)\n        return PixelFormat32bppPARGB;\n    return 0;\n}\n\nstatic ImageAlpha GetAlphaType(const char *data, size_t len)\n{\n    const TgaExtArea *extAreaLE = GetExtAreaPtr(data, len);\n    if (!extAreaLE)\n        return Alpha_Normal;\n\n    switch (extAreaLE->alphaType) {\n    case Alpha_Normal:          return Alpha_Normal;\n    case Alpha_Premultiplied:   return Alpha_Premultiplied;\n    default:                    return Alpha_Ignore;\n    }\n}\n\n// checks whether this could be data for a TGA image\nbool HasSignature(const char *data, size_t len)\n{\n    if (HasVersion2Footer(data, len))\n        return true;\n    // fall back to checking for values that would be valid for a TGA image\n    if (len < sizeof(TgaHeader))\n        return false;\n    const TgaHeader *headerLE = (const TgaHeader *)data;\n    if (headerLE->cmapType != 0 && headerLE->cmapType != 1)\n        return false;\n    if ((headerLE->flags & Flag_Reserved))\n        return false;\n    if (!GetPixelFormat(headerLE))\n        return false;\n    return true;\n}\n\nstatic void SetImageProperty(Bitmap *bmp, PROPID id, const char *asciiValue)\n{\n    PropertyItem item;\n    item.id = id;\n    item.type = PropertyTagTypeASCII;\n    item.value = (void *)asciiValue;\n    item.length = (ULONG)(str::Len(asciiValue) + 1);\n    Status ok = bmp->SetPropertyItem(&item);\n    CrashIf(ok != Ok);\n}\n\nstatic bool IsFieldSet(const char *field, size_t len, bool isBinary=false)\n{\n    for (size_t i = 0; i < len; i++) {\n        if (field[i] && (isBinary || field[i] != ' '))\n            return isBinary || '\\0' == field[len - 1];\n    }\n    return false;\n}\n\nstatic void CopyMetadata(const char *data, size_t len, Bitmap *bmp)\n{\n    const TgaExtArea *extAreaLE = GetExtAreaPtr(data, len);\n    if (!extAreaLE)\n        return;\n\n    if (IsFieldSet(extAreaLE->author, sizeof(extAreaLE->author)))\n        SetImageProperty(bmp, PropertyTagArtist, extAreaLE->author);\n    if (IsFieldSet((const char *)extAreaLE->dateTime, sizeof(extAreaLE->dateTime), true)) {\n        char dateTime[20];\n        int count = _snprintf_s(dateTime, dimof(dateTime), _TRUNCATE,\n            \"%04u-%02u-%02u %02u:%02u:%02u\",\n            convLE(extAreaLE->dateTime[2]), convLE(extAreaLE->dateTime[1]),\n            convLE(extAreaLE->dateTime[0]), convLE(extAreaLE->dateTime[3]),\n            convLE(extAreaLE->dateTime[4]), convLE(extAreaLE->dateTime[5]));\n        if (19 == count)\n            SetImageProperty(bmp, PropertyTagDateTime, dateTime);\n    }\n    if (IsFieldSet(extAreaLE->progName, sizeof(extAreaLE->progName))) {\n        char software[49];\n        str::BufSet(software, 41, extAreaLE->progName);\n        if (convLE(extAreaLE->progVersion) != 0) {\n            _snprintf_s(software + str::Len(software), 9, _TRUNCATE, \" %d.%d%c\",\n                convLE(extAreaLE->progVersion) / 100,\n                convLE(extAreaLE->progVersion) % 100,\n                extAreaLE->progVersionC != ' ' ? extAreaLE->progVersionC : '\\0');\n            software[48] = '\\0';\n        }\n        SetImageProperty(bmp, PropertyTagSoftwareUsed, software);\n    }\n}\n\nstruct ReadState {\n    const char *data;\n    const char *end;\n    ImageType type;\n    int n;\n    bool isRLE;\n    int repeat;\n    bool repeatSame;\n    struct {\n        int firstEntry;\n        int length;\n        const char *data;\n        int n;\n    } cmap;\n    bool failed;\n};\n\nstatic inline void CopyPixel(char *dst, const char *src, int n)\n{\n    switch (n) {\n    case 3: dst[2] = src[2]; // fall through\n    case 2: *(uint16_t *)dst = *(uint16_t *)src; break;\n    case 4: *(uint32_t *)dst = *(uint32_t *)src; break;\n    default: CrashIf(true);\n    }\n}\n\nstatic void ReadPixel(ReadState& s, char *dst)\n{\n    if (s.isRLE && 0 == s.repeat && s.data < s.end) {\n        s.repeat = (*s.data & 0x7F) + 1;\n        s.repeatSame = (*s.data & 0x80);\n        s.data++;\n    }\n    if (s.data + s.n > s.end) {\n        s.failed = true;\n        return;\n    }\n\n    int idx;\n    switch (s.type) {\n    case Type_Palette: case Type_Palette_RLE:\n        idx = ((uint8_t)s.data[0] | (2 == s.n ? ((uint8_t)s.data[1] << 8) : 0)) - s.cmap.firstEntry;\n        if (0 <= idx && idx < s.cmap.length)\n            CopyPixel(dst, s.cmap.data + idx * s.cmap.n, s.cmap.n);\n        break;\n    case Type_Truecolor: case Type_Truecolor_RLE:\n        CopyPixel(dst, s.data, s.n);\n        break;\n    case Type_Grayscale: case Type_Grayscale_RLE:\n        dst[0] = dst[1] = dst[2] = s.data[0];\n        break;\n    }\n\n    if (!s.isRLE || 0 == --s.repeat || !s.repeatSame)\n        s.data += s.n;\n}\n\nGdiplus::Bitmap *ImageFromData(const char *data, size_t len)\n{\n    if (len < sizeof(TgaHeader))\n        return nullptr;\n\n    ReadState s = { 0 };\n    const TgaHeader *headerLE = (const TgaHeader *)data;\n    s.data = data + sizeof(TgaHeader) + headerLE->idLength;\n    s.end = data + len;\n    if (1 == headerLE->cmapType) {\n        s.cmap.data = s.data;\n        s.cmap.n = (headerLE->cmapBitDepth + 7) / 8;\n        s.cmap.length = convLE(headerLE->cmapLength);\n        s.cmap.firstEntry = convLE(headerLE->cmapFirstEntry);\n        s.data += s.cmap.length * s.cmap.n;\n    }\n    s.type = (ImageType)headerLE->imageType;\n    s.n = (headerLE->bitDepth + 7) / 8;\n    s.isRLE = headerLE->imageType >= 8;\n\n    PixelFormat format = GetPixelFormat(headerLE, GetAlphaType(data, len));\n    if (!format)\n        return nullptr;\n\n    int w = convLE(headerLE->width);\n    int h = convLE(headerLE->height);\n    int n = ((format >> 8) & 0x3F) / 8;\n    bool invertX = (headerLE->flags & Flag_InvertX);\n    bool invertY = (headerLE->flags & Flag_InvertY);\n\n    Bitmap bmp(w, h, format);\n    Rect bmpRect(0, 0, w, h);\n    BitmapData bmpData;\n    Status ok = bmp.LockBits(&bmpRect, ImageLockModeWrite, format, &bmpData);\n    if (ok != Ok)\n        return nullptr;\n    for (int y = 0; y < h; y++) {\n        char *rowOut = (char *)bmpData.Scan0 + bmpData.Stride * (invertY ? y : h - 1 - y);\n        for (int x = 0; x < w; x++) {\n            ReadPixel(s, rowOut + n * (invertX ? w - 1 - x : x));\n        }\n    }\n    bmp.UnlockBits(&bmpData);\n    if (s.failed)\n        return nullptr;\n    CopyMetadata(data, len, &bmp);\n    // hack to avoid the use of ::new (because there won't be a corresponding ::delete)\n    return bmp.Clone(0, 0, w, h, format);\n}\n\ninline bool memeq3(const char *pix1, const char *pix2)\n{\n    return *(WORD *)pix1 == *(WORD *)pix2 && pix1[2] == pix2[2];\n}\n\nunsigned char *SerializeBitmap(HBITMAP hbmp, size_t *bmpBytesOut)\n{\n    BITMAP bmpInfo;\n    GetObject(hbmp, sizeof(BITMAP), &bmpInfo);\n    if ((ULONG)bmpInfo.bmWidth > USHRT_MAX || (ULONG)bmpInfo.bmHeight > USHRT_MAX)\n        return 0;\n\n    WORD w = (WORD)bmpInfo.bmWidth;\n    WORD h = (WORD)bmpInfo.bmHeight;\n    int stride = ((w * 3 + 3) / 4) * 4;\n    ScopedMem<char> bmpData((char *)malloc(stride * h));\n    if (!bmpData)\n        return nullptr;\n\n    BITMAPINFO bmi = { 0 };\n    bmi.bmiHeader.biSize = sizeof(bmi.bmiHeader);\n    bmi.bmiHeader.biWidth = w;\n    bmi.bmiHeader.biHeight = h;\n    bmi.bmiHeader.biPlanes = 1;\n    bmi.bmiHeader.biBitCount = 24;\n    bmi.bmiHeader.biCompression = BI_RGB;\n\n    HDC hDC = GetDC(nullptr);\n    if (!GetDIBits(hDC, hbmp, 0, h, bmpData, &bmi, DIB_RGB_COLORS)) {\n        ReleaseDC(nullptr, hDC);\n        return nullptr;\n    }\n    ReleaseDC(nullptr, hDC);\n\n    TgaHeader headerLE = { 0 };\n    headerLE.imageType = Type_Truecolor_RLE;\n    headerLE.width = convLE(w);\n    headerLE.height = convLE(h);\n    headerLE.bitDepth = 24;\n    TgaFooter footerLE = { 0, 0, TGA_FOOTER_SIGNATURE };\n\n    str::Str<char> tgaData;\n    tgaData.Append((char *)&headerLE, sizeof(headerLE));\n    for (int k = 0; k < h; k++) {\n        const char *line = bmpData + k * stride;\n        for (int i = 0, j = 1; i < w; i += j, j = 1) {\n            // determine the length of a run of identical pixels\n            while (i + j < w && j < 128 && memeq3(line + i * 3, line + (i + j) * 3)) {\n                j++;\n            }\n            if (j > 1) {\n                tgaData.Append((char)(j - 1 + 128));\n                tgaData.Append(line + i * 3, 3);\n            } else {\n                // determine the length of a run of different pixels\n                while (i + j < w && j <= 128 && !memeq3(line + (i + j - 1) * 3, line + (i + j) * 3)) {\n                    j++;\n                }\n                if (i + j < w || j > 128)\n                    j--;\n                tgaData.Append((char)(j - 1));\n                tgaData.Append(line + i * 3, j * 3);\n            }\n        }\n    }\n    tgaData.Append((char *)&footerLE, sizeof(footerLE));\n\n    // don't compress the image data if that increases the file size\n    if (tgaData.Size() > sizeof(headerLE) + w * h * 3 + sizeof(footerLE)) {\n        tgaData.RemoveAt(0, tgaData.Size());\n        headerLE.imageType = Type_Truecolor;\n        tgaData.Append((char *)&headerLE, sizeof(headerLE));\n        for (int k = 0; k < h; k++) {\n            tgaData.Append(bmpData + k * stride, w * 3);\n        }\n        tgaData.Append((char *)&footerLE, sizeof(footerLE));\n    }\n\n    if (bmpBytesOut)\n        *bmpBytesOut = tgaData.Size();\n    return (unsigned char *)tgaData.StealData();\n}\n\n}\n"
  },
  {
    "path": "src/utils/TgaReader.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\n   License: Simplified BSD (see COPYING.BSD) */\n\n// Support for Truevision TGA files\n// (as e.g. produced by EngineDump and mudraw)\n// spec: http://www.gamers.org/dEngine/quake3/TGA.ps.gz\n\nnamespace tga {\n\nbool                HasSignature(const char *data, size_t len);\nGdiplus::Bitmap *   ImageFromData(const char *data, size_t len);\n\nunsigned char *     SerializeBitmap(HBITMAP hbmp, size_t *bmpBytesOut);\n\n}\n"
  },
  {
    "path": "src/utils/ThreadUtil.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"ThreadUtil.h\"\r\n\r\n#if defined(_MSC_VER)\r\n\r\n// http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx\r\nconst DWORD MS_VC_EXCEPTION = 0x406D1388;\r\n\r\n#include <pshpack8.h>\r\n\r\ntypedef struct tagTHREADNAME_INFO {\r\n    DWORD dwType;     // Must be 0x1000.\r\n    LPCSTR szName;    // Pointer to name (in user addr space).\r\n    DWORD dwThreadID; // Thread ID (-1=caller thread).\r\n    DWORD dwFlags;    // Reserved for future use, must be zero.\r\n} THREADNAME_INFO;\r\n\r\n#include <poppack.h>\r\n\r\n#pragma warning(push)\r\n#pragma warning(disable : 6320) // silence /analyze: Exception-filter expression is the constant\r\n                                // EXCEPTION_EXECUTE_HANDLER. This might mask exceptions that were\r\n                                // not intended to be handled\r\n#pragma warning(disable : 6322) // silence /analyze: Empty _except block\r\nvoid SetThreadName(DWORD threadId, const char *threadName) {\r\n    THREADNAME_INFO info;\r\n    info.dwType = 0x1000;\r\n    info.szName = threadName;\r\n    info.dwThreadID = threadId;\r\n    info.dwFlags = 0;\r\n\r\n    __try {\r\n        RaiseException(MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR *)&info);\r\n    }\r\n    __except(EXCEPTION_EXECUTE_HANDLER) {}\r\n}\r\n#pragma warning(push)\r\n#else\r\nvoid SetThreadName(DWORD, const char *) {\r\n    // nothing\r\n}\r\n#endif\r\n\r\n// We need a way to uniquely identified threads (so that we can test for equality).\r\n// Thread id assigned by the OS might be recycled. The memory address given to ThreadBase\r\n// object can be recycled as well, so we keep our own counter.\r\nstatic int GenUniqueThreadId() {\r\n    static LONG gThreadNoSeq = 0;\r\n    return (int)InterlockedIncrement(&gThreadNoSeq);\r\n}\r\n\r\nThreadBase::ThreadBase(const char *name)\r\n    : hThread(nullptr),\r\n      cancelRequested(false),\r\n      threadNo(GenUniqueThreadId()),\r\n      threadName(str::Dup(name)) {\r\n    // lf(\"ThreadBase() %d\", threadNo);\r\n}\r\n\r\nThreadBase::~ThreadBase() {\r\n    // lf(\"~ThreadBase() %d\", threadNo);\r\n    CloseHandle(hThread);\r\n}\r\n\r\nDWORD WINAPI ThreadBase::ThreadProc(void *data) {\r\n    ThreadBase *thread = reinterpret_cast<ThreadBase *>(data);\r\n    if (thread->threadName)\r\n        SetThreadName(GetCurrentThreadId(), thread->threadName);\r\n    thread->Run();\r\n    return 0;\r\n}\r\n\r\nvoid ThreadBase::Start() {\r\n    CrashIf(hThread);\r\n    hThread = CreateThread(nullptr, 0, ThreadProc, this, 0, 0);\r\n}\r\n\r\nbool ThreadBase::Join(DWORD waitMs) {\r\n    DWORD res = WaitForSingleObject(hThread, waitMs);\r\n    if (WAIT_OBJECT_0 == res) {\r\n        CloseHandle(hThread);\r\n        hThread = nullptr;\r\n        return true;\r\n    }\r\n    return false;\r\n}\r\n\r\nstatic DWORD WINAPI ThreadFunc(void *data) {\r\n    auto *func = reinterpret_cast<std::function<void()> *>(data);\r\n    (*func)();\r\n    delete func;\r\n    return 0;\r\n}\r\n\r\nvoid RunAsync(const std::function<void()> &func) {\r\n    auto fp = new std::function<void()>(func);\r\n    ScopedHandle h(CreateThread(nullptr, 0, ThreadFunc, fp, 0, 0));\r\n}\r\n"
  },
  {
    "path": "src/utils/ThreadUtil.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n/* A very simple thread class that allows stopping a thread */\r\nclass ThreadBase {\r\n  private:\r\n    int threadNo;\r\n    HANDLE hThread;\r\n    bool cancelRequested;\r\n\r\n    static DWORD WINAPI ThreadProc(void *data);\r\n\r\n  protected:\r\n    // for debugging\r\n    ScopedMem<char> threadName;\r\n\r\n    virtual ~ThreadBase();\r\n\r\n    // note: no need for Interlocked* since this value is\r\n    //       only ever changed from false to true\r\n    bool WasCancelRequested() { return cancelRequested; }\r\n\r\n  public:\r\n    // name is for debugging purposes, can be nullptr.\r\n    explicit ThreadBase(const char *name = nullptr);\r\n\r\n    // call this to start executing Run() function.\r\n    void Start();\r\n\r\n    // request the thread to stop. It's up to Run() function\r\n    // to call WasCancelRequested() and stop processing if it returns true.\r\n    void RequestCancel() { cancelRequested = true; }\r\n\r\n    // synchronously waits for the thread to end\r\n    // returns true if thread stopped by itself and false if waiting timed out\r\n    bool Join(DWORD waitMs = INFINITE);\r\n\r\n    // get a unique number that identifies a thread and unlike an\r\n    // address of the object, will not be reused\r\n    LONG GetNo() const { return threadNo; }\r\n\r\n    // over-write this to implement the actual thread functionality\r\n    // note: for longer running threads, make sure to occasionally poll WasCancelRequested\r\n    virtual void Run() = 0;\r\n};\r\n\r\nvoid SetThreadName(DWORD threadId, const char *threadName);\r\n\r\nvoid RunAsync(const std::function<void()> &);\r\n"
  },
  {
    "path": "src/utils/Timer.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// Relatively high-precision timer. Can be used e.g. for measuring execution\r\n// time of a piece of code.\r\nclass Timer {\r\n    LARGE_INTEGER   start;\r\n    LARGE_INTEGER   end;\r\n\r\n    double TimeSince(LARGE_INTEGER t) const\r\n    {\r\n        LARGE_INTEGER freq;\r\n        QueryPerformanceFrequency(&freq);\r\n        double timeInSecs = (double)(t.QuadPart-start.QuadPart)/(double)freq.QuadPart;\r\n        return timeInSecs * 1000.0;\r\n    }\r\n\r\npublic:\r\n    explicit Timer() {\r\n        Start();\r\n    }\r\n\r\n    void Start() {\r\n        end.QuadPart = 0;\r\n        QueryPerformanceCounter(&start);\r\n    }\r\n\r\n    double Stop() { \r\n        QueryPerformanceCounter(&end);\r\n        return GetTimeInMs();\r\n    }\r\n\r\n    // If stopped, get the time at point it was stopped,\r\n    // otherwise get current time\r\n    double GetTimeInMs()\r\n    {\r\n        if (0 == end.QuadPart) {\r\n            LARGE_INTEGER curr;\r\n            QueryPerformanceCounter(&curr);\r\n            return TimeSince(curr);\r\n        }\r\n        return TimeSince(end);\r\n    }\r\n};\r\n"
  },
  {
    "path": "src/utils/TrivialHtmlParser.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n\r\n#include \"HtmlParserLookup.h\"\r\n#include \"TrivialHtmlParser.h\"\r\n#include \"HtmlPullParser.h\"\r\n\r\n/*\r\nHtml parser that is good enough for parsing html files\r\ninside CHM archives (and XML files in EPUB documents).\r\nNot really meant for general use.\r\n\r\nname/val pointers inside Element/Attr structs refer to\r\nmemory inside HtmlParser::s, so they don't need to be freed.\r\n*/\r\n\r\nbool HtmlElement::NameIs(const char *name) const\r\n{\r\n    if (!this->name) {\r\n        CrashIf(Tag_NotFound == this->tag);\r\n        HtmlTag tag = FindHtmlTag(name, str::Len(name));\r\n        return tag == this->tag;\r\n    }\r\n    return str::EqI(this->name, name);\r\n}\r\n\r\n// for now just ignores any namespace qualifier\r\n// (i.e. succeeds for \"opf:content\" with name=\"content\" and any value of ns)\r\n// TODO: add proper namespace support\r\nbool HtmlElement::NameIsNS(const char *name, const char *ns) const\r\n{\r\n    CrashIf(!ns);\r\n    const char *nameStart = nullptr;\r\n    if (this->name) {\r\n        nameStart = str::FindChar(this->name, ':');\r\n    }\r\n    if (!nameStart) {\r\n        return NameIs(name);\r\n    }\r\n    nameStart = nameStart ? nameStart + 1 : this->name;\r\n    return str::EqI(nameStart, name);\r\n}\r\n\r\nHtmlElement *HtmlElement::GetChildByTag(HtmlTag tag, int idx) const\r\n{\r\n    for (HtmlElement *el = down; el; el = el->next) {\r\n        if (tag == el->tag) {\r\n            if (0 == idx)\r\n                return el;\r\n            idx--;\r\n        }\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nstatic WCHAR IntToChar(int codepoint)\r\n{\r\n    if (codepoint <= 0 || codepoint >= (1 << (8 * sizeof(WCHAR))))\r\n        return '?';\r\n    return (WCHAR)codepoint;\r\n}\r\n\r\n// caller needs to free() the result\r\nWCHAR *DecodeHtmlEntitites(const char *string, UINT codepage)\r\n{\r\n    WCHAR *fixed = str::conv::FromCodePage(string, codepage), *dst = fixed;\r\n    const WCHAR *src = fixed;\r\n\r\n    while (*src) {\r\n        if (*src != '&') {\r\n            *dst++ = *src++;\r\n            continue;\r\n        }\r\n        src++;\r\n        // numeric entities\r\n        int unicode;\r\n        if (str::Parse(src, L\"#%d;\", &unicode) ||\r\n            str::Parse(src, L\"#x%x;\", &unicode)) {\r\n            *dst++ = IntToChar(unicode);\r\n            src = str::FindChar(src, ';') + 1;\r\n            continue;\r\n        }\r\n\r\n        // named entities\r\n        int rune = -1;\r\n        const WCHAR *entityEnd = src;\r\n        while (iswalnum(*entityEnd))\r\n            entityEnd++;\r\n        if (entityEnd != src) {\r\n            size_t entityLen = entityEnd - src;\r\n            rune = HtmlEntityNameToRune(src, entityLen);\r\n        }\r\n        if (-1 != rune) {\r\n            *dst++ = IntToChar(rune);\r\n            src = entityEnd;\r\n            if (*src == ';')\r\n                ++src;\r\n        } else {\r\n            *dst++ = '&';\r\n        }\r\n    }\r\n    *dst = '\\0';\r\n\r\n    return fixed;\r\n}\r\n\r\nHtmlParser::HtmlParser() : html(nullptr), freeHtml(false), rootElement(nullptr),\r\n    currElement(nullptr), elementsCount(0), attributesCount(0), codepage(CP_ACP),\r\n    error(ErrParsingNoError), errorContext(nullptr)\r\n{\r\n}\r\n\r\nHtmlParser::~HtmlParser()\r\n{\r\n    if (freeHtml)\r\n        free(html);\r\n}\r\n\r\nvoid HtmlParser::Reset()\r\n{\r\n    if (freeHtml)\r\n        free(html);\r\n    html = nullptr;\r\n    freeHtml = false;\r\n    rootElement = currElement = nullptr;\r\n    elementsCount = attributesCount = 0;\r\n    error = ErrParsingNoError;\r\n    errorContext = nullptr;\r\n    allocator.FreeAll();\r\n}\r\n\r\nHtmlAttr *HtmlParser::AllocAttr(char *name, HtmlAttr *next)\r\n{\r\n    HtmlAttr *attr = allocator.AllocStruct<HtmlAttr>();\r\n    attr->name = name;\r\n    attr->next = next;\r\n    ++attributesCount;\r\n    return attr;\r\n}\r\n\r\n// caller needs to free() the result\r\nWCHAR *HtmlElement::GetAttribute(const char *name) const\r\n{\r\n    for (HtmlAttr *attr = firstAttr; attr; attr = attr->next) {\r\n        if (str::EqI(attr->name, name))\r\n            return DecodeHtmlEntitites(attr->val, codepage);\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nHtmlElement *HtmlParser::AllocElement(HtmlTag tag, char *name, HtmlElement *parent)\r\n{\r\n    HtmlElement *el = allocator.AllocStruct<HtmlElement>();\r\n    el->tag = tag;\r\n    el->name = name;\r\n    el->up = parent;\r\n    el->codepage = codepage;\r\n    ++elementsCount;\r\n    return el;\r\n}\r\n\r\nHtmlElement *HtmlParser::FindParent(HtmlToken *tok)\r\n{\r\n    if (Tag_Li == tok->tag) {\r\n        // make a list item the child of the closest list\r\n        for (HtmlElement *el = currElement; el; el = el->up) {\r\n            if (Tag_Ul == el->tag || Tag_Ol == el->tag)\r\n                return el;\r\n        }\r\n    }\r\n\r\n    return currElement;\r\n}\r\n\r\nvoid HtmlParser::StartTag(HtmlToken *tok)\r\n{\r\n    char *tagName = nullptr;\r\n    if (Tag_NotFound == tok->tag) {\r\n        tagName = (char *)tok->s;\r\n        char *tagEnd = tagName + tok->nLen;\r\n        *tagEnd = '\\0';\r\n    }\r\n\r\n    HtmlElement *parent = FindParent(tok);\r\n    currElement = AllocElement(tok->tag, tagName, parent);\r\n    if (nullptr == rootElement)\r\n        rootElement = currElement;\r\n\r\n    if (!parent) {\r\n        // if this isn't the root tag, this tag\r\n        // and all its children will be ignored\r\n    } else if (nullptr == parent->down) {\r\n        // parent has no children => set as a first child\r\n        parent->down = currElement;\r\n    } else {\r\n        // parent has children => set as a sibling\r\n        HtmlElement *tmp = parent->down;\r\n        while (tmp->next) {\r\n            tmp = tmp->next;\r\n        }\r\n        tmp->next = currElement;\r\n    }\r\n}\r\n\r\nvoid HtmlParser::CloseTag(HtmlToken *tok)\r\n{\r\n    char *tagName = nullptr;\r\n    if (Tag_NotFound == tok->tag) {\r\n        tagName = (char *)tok->s;\r\n        char *tagEnd = tagName + tok->nLen;\r\n        *tagEnd = '\\0';\r\n    }\r\n\r\n    // to allow for lack of closing tags, e.g. in case like\r\n    // <a><b><c></a>, we look for the first parent with matching name\r\n    for (HtmlElement *el = currElement; el; el = el->up) {\r\n        if (tagName ? el->NameIs(tagName) : tok->tag == el->tag) {\r\n            currElement = el->up;\r\n            return;\r\n        }\r\n    }\r\n    // ignore the unexpected closing tag\r\n}\r\n\r\nvoid HtmlParser::AppendAttr(char *name, char *value)\r\n{\r\n    currElement->firstAttr = AllocAttr(name, currElement->firstAttr);\r\n    currElement->firstAttr->val = value;\r\n}\r\n\r\n// Parse s in place i.e. we assume we can modify it. Must be 0-terminated.\r\n// The caller owns the memory for s.\r\nHtmlElement *HtmlParser::ParseInPlace(char *s, UINT codepage)\r\n{\r\n    if (this->html)\r\n        Reset();\r\n    this->html = s;\r\n    this->codepage = codepage;\r\n\r\n    HtmlPullParser parser(s, strlen(s));\r\n    HtmlToken *tok;\r\n\r\n    while ((tok = parser.Next()) != nullptr) {\r\n        if (tok->IsError()) {\r\n            errorContext = tok->s;\r\n            switch (tok->error) {\r\n                case HtmlToken::UnclosedTag: return ParseError(ErrParsingElementName);\r\n                case HtmlToken::InvalidTag:  return ParseError(ErrParsingClosingElement);\r\n                default:                     return ParseError(ErrParsingElement);\r\n            }\r\n        }\r\n        if (!tok->IsTag()) {\r\n            // ignore text content\r\n            assert(tok->IsText());\r\n            continue;\r\n        }\r\n        if (!tok->IsEndTag()) {\r\n            // note: call tok->NextAttr() before zero-terminating names and values\r\n            AttrInfo *attr = tok->NextAttr();\r\n            StartTag(tok);\r\n\r\n            while (attr) {\r\n                char *name = (char *)attr->name;\r\n                char *nameEnd = name + attr->nameLen;\r\n                char *value = (char *)attr->val;\r\n                char *valueEnd = value + attr->valLen;\r\n                attr = tok->NextAttr();\r\n\r\n                *nameEnd = *valueEnd = '\\0';\r\n                AppendAttr(name, value);\r\n            }\r\n        }\r\n        if (!tok->IsStartTag() || IsTagSelfClosing(tok->tag)) {\r\n            CloseTag(tok);\r\n        }\r\n    }\r\n\r\n    return rootElement;\r\n}\r\n\r\nHtmlElement *HtmlParser::Parse(const char *s, UINT codepage)\r\n{\r\n    HtmlElement *root = ParseInPlace(str::Dup(s), codepage);\r\n    freeHtml = true;\r\n    return root;\r\n}\r\n\r\n// Does a depth-first search of element tree, looking for an element with\r\n// a given name. If from is nullptr, it starts from rootElement otherwise\r\n// it starts from *next* element in traversal order, which allows for\r\n// easy iteration over elements.\r\n// Note: name must be lower-case\r\nHtmlElement *HtmlParser::FindElementByName(const char *name, HtmlElement *from)\r\n{\r\n    return FindElementByNameNS(name, nullptr, from);\r\n}\r\n\r\nHtmlElement *HtmlParser::FindElementByNameNS(const char *name, const char *ns, HtmlElement *from)\r\n{\r\n    HtmlElement *el = from ? from : rootElement;\r\n    if (from)\r\n        goto FindNext;\r\n    if (!el)\r\n        return nullptr;\r\nCheckNext:\r\n    if (el->NameIs(name) || ns && el->NameIsNS(name, ns))\r\n        return el;\r\nFindNext:\r\n    if (el->down) {\r\n        el = el->down;\r\n        goto CheckNext;\r\n    }\r\n    if (el->next) {\r\n        el = el->next;\r\n        goto CheckNext;\r\n    }\r\n    // backup in the tree\r\n    HtmlElement *parent = el->up;\r\n    while (parent) {\r\n        if (parent->next) {\r\n            el = parent->next;\r\n            goto CheckNext;\r\n        }\r\n        parent = parent->up;\r\n    }\r\n    return nullptr;\r\n}\r\n"
  },
  {
    "path": "src/utils/TrivialHtmlParser.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nenum HtmlParseError {\r\n    ErrParsingNoError,\r\n    ErrParsingElement, // syntax error parsing element\r\n    ErrParsingExclOrPI,\r\n    ErrParsingClosingElement, // syntax error in closing element\r\n    ErrParsingElementName, // syntax error after element name\r\n    ErrParsingAttributes, // syntax error in attributes\r\n    ErrParsingAttributeName, // syntax error after attribute name\r\n    ErrParsingAttributeValue,\r\n};\r\n\r\nstruct HtmlToken;\r\n\r\nstruct HtmlAttr {\r\n    char *name;\r\n    char *val;\r\n    HtmlAttr *next;\r\n};\r\n\r\nstruct HtmlElement {\r\n    HtmlTag tag;\r\n    char *name; // name is nullptr whenever tag != Tag_NotFound\r\n    HtmlAttr *firstAttr;\r\n    HtmlElement *up, *down, *next;\r\n    UINT codepage;\r\n\r\n    bool NameIs(const char *name) const;\r\n    bool NameIsNS(const char *name, const char *ns) const;\r\n\r\n    WCHAR *GetAttribute(const char *name) const;\r\n    HtmlElement *GetChildByTag(HtmlTag tag, int idx=0) const;\r\n};\r\n\r\nclass HtmlParser {\r\n    PoolAllocator allocator;\r\n\r\n    // text to parse. It can be changed.\r\n    char *html;\r\n    // true if s was allocated by ourselves, false if managed\r\n    // by the caller\r\n    bool freeHtml;\r\n    // the codepage used for converting text to Unicode\r\n    UINT codepage;\r\n\r\n    size_t elementsCount;\r\n    size_t attributesCount;\r\n\r\n    HtmlElement *rootElement;\r\n    HtmlElement *currElement;\r\n\r\n    HtmlElement *AllocElement(HtmlTag tag, char *name, HtmlElement *parent);\r\n    HtmlAttr *AllocAttr(char *name, HtmlAttr *next);\r\n\r\n    void CloseTag(HtmlToken *tok);\r\n    void StartTag(HtmlToken *tok);\r\n    void AppendAttr(char *name, char *value);\r\n\r\n    HtmlElement *FindParent(HtmlToken *tok);\r\n    HtmlElement *ParseError(HtmlParseError err) {\r\n        error = err;\r\n        return nullptr;\r\n    }\r\n\r\n    void Reset();\r\n\r\npublic:\r\n    HtmlParseError error;  // parsing error, a static string\r\n    const char *errorContext; // pointer within html showing which part we failed to parse\r\n\r\n    HtmlParser();\r\n    ~HtmlParser();\r\n\r\n    HtmlElement *Parse(const char *s, UINT codepage=CP_ACP);\r\n    HtmlElement *ParseInPlace(char *s, UINT codepage=CP_ACP);\r\n\r\n    size_t ElementsCount() const {\r\n        return elementsCount;\r\n    }\r\n\r\n    size_t TotalAttrCount() const {\r\n        return attributesCount;\r\n    }\r\n\r\n    HtmlElement *FindElementByName(const char *name, HtmlElement *from=nullptr);\r\n    HtmlElement *FindElementByNameNS(const char *name, const char *ns, HtmlElement *from=nullptr);\r\n};\r\n\r\nWCHAR *DecodeHtmlEntitites(const char *string, UINT codepage);\r\n\r\nnamespace str {\r\n    namespace conv {\r\n\r\ninline WCHAR *FromHtmlUtf8(const char *s, size_t len)\r\n{\r\n    ScopedMem<char> tmp(str::DupN(s, len));\r\n    return DecodeHtmlEntitites(tmp, CP_UTF8);\r\n}\r\n\r\n    }\r\n}\r\n"
  },
  {
    "path": "src/utils/TxtParser.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"StrSlice.h\"\r\n#include \"TxtParser.h\"\r\n#include <new>  // for placement new\r\n\r\n// unbreak placement new introduced by defining new as DEBUG_NEW\r\n#ifdef new\r\n#undef new\r\n#endif\r\n\r\n/*\r\nThis is a parser for a tree-like text format:\r\n\r\nfoo [\r\n  key: val\r\n  k2 [\r\n    val\r\n    mulit-line values are possible\r\n  ]\r\n]\r\n\r\nThis is not a very strict format. On purpose it doesn't try to strictly break\r\nthings into key/values, just to decode tree structure and *help* to interpret\r\na given line either as a simple string or key/value pair. It's\r\nup to the caller to interpret the data.\r\n*/\r\n\r\nstatic TxtNode *AllocTxtNode(Allocator *allocator, TxtNodeType nodeType)\r\n{\r\n    void *p = Allocator::AllocZero(allocator, sizeof(TxtNode));\r\n    TxtNode *node = new (p) TxtNode(nodeType);\r\n    CrashIf(!node);\r\n    if (TextNode != nodeType) {\r\n        p = Allocator::AllocZero(allocator, sizeof(Vec<TxtNode*>));\r\n        node->children = new (p) Vec<TxtNode*>(0, allocator);\r\n    }\r\n    return node;\r\n}\r\n\r\nstatic TxtNode *TxtNodeFromToken(Allocator *allocator, TokenVal& tok, TxtNodeType nodeType)\r\n{\r\n    AssertCrash((TextNode == nodeType) || (StructNode == nodeType));\r\n    TxtNode *node = AllocTxtNode(allocator, nodeType);\r\n    node->lineStart = tok.lineStart;\r\n    node->valStart = tok.valStart;\r\n    node->valEnd = tok.valEnd;\r\n    node->keyStart = tok.keyStart;\r\n    node->keyEnd = tok.keyEnd;\r\n    return node;\r\n}\r\n\r\nstatic bool IsCommentStartChar(char c)\r\n{\r\n    return (';' == c ) || ('#' == c);\r\n}\r\n\r\n// unescapes a string until a newline (\\n)\r\n// returns the end of unescaped string\r\nstatic char *UnescapeLineInPlace(char *&sInOut, char *e, char escapeChar)\r\n{\r\n    char *s = sInOut;\r\n    char *dst = s;\r\n    while ((s < e) && (*s != '\\n')) {\r\n        if (escapeChar != *s) {\r\n            *dst++ = *s++;\r\n            continue;\r\n        }\r\n\r\n        // ignore unexpected lone escape char\r\n        if (s+1 >= e) {\r\n            *dst++ = *s++;\r\n            continue;\r\n        }\r\n\r\n        ++s;\r\n        char c = *s++;\r\n        if (c == escapeChar) {\r\n            *dst++ = escapeChar;\r\n            continue;\r\n        }\r\n\r\n        switch (c) {\r\n        case '[':\r\n        case ']':\r\n            *dst++ = c;\r\n            break;\r\n        case 'r':\r\n            *dst++ = '\\r';\r\n            break;\r\n        case 'n':\r\n            *dst++ = '\\n';\r\n            break;\r\n        default:\r\n            // invalid escaping sequence. we preserve it\r\n            *dst++ = escapeChar;\r\n            *dst++ = c;\r\n            break;\r\n        }\r\n    }\r\n    sInOut = s;\r\n    return dst;\r\n}\r\n\r\n// parses \"foo[: | (WS*=]WS*[WS*\\n\" (WS == whitespace\r\nstatic bool ParseStructStart(TxtParser& parser)\r\n{\r\n    // work on a copy in case we fail\r\n    str::Slice slice = parser.toParse;\r\n\r\n    char *keyStart = slice.curr;\r\n    slice.SkipNonWs();\r\n    // \"foo:  [\"\r\n    //      ^\r\n\r\n    char *keyEnd = slice.curr;\r\n    if (':' == slice.PrevChar()) {\r\n        // \"foo:  [  \"\r\n        //     ^ <- keyEnd\r\n        keyEnd--;\r\n    } else {\r\n        slice.SkipWsUntilNewline();\r\n        if ('=' == slice.CurrChar()) {\r\n            // \"foo  =  [\"\r\n            //       ^\r\n            slice.Skip(1);\r\n            // \"foo  =  [\"\r\n            //        ^\r\n        }\r\n    }\r\n    slice.SkipWsUntilNewline();\r\n    // \"foo  =  [  \"\r\n    //          ^\r\n    if ('[' != slice.CurrChar())\r\n        return false;\r\n    slice.Skip(1);\r\n    slice.SkipWsUntilNewline();\r\n    // \"foo  =  [  \"\r\n    //             ^\r\n    if (!(slice.Finished() || ('\\n' == slice.CurrChar())))\r\n        return false;\r\n\r\n    TokenVal& tok = parser.tok;\r\n    tok.type = TokenStructStart;\r\n    tok.keyStart = keyStart;\r\n    tok.keyEnd = keyEnd;\r\n    *keyEnd = 0;\r\n    if ('\\n' == slice.CurrChar()) {\r\n        slice.ZeroCurr();\r\n        slice.Skip(1);\r\n    }\r\n\r\n    parser.toParse = slice;\r\n    return true;\r\n}\r\n\r\n// parses \"foo:WS${rest}\" or \"fooWS=WS${rest}\"\r\n// if finds this pattern, sets parser.tok.keyStart and parser.tok.keyEnd\r\n// and positions slice at the beginning of ${rest}\r\nstatic bool ParseKey(TxtParser& parser)\r\n{\r\n    str::Slice slice = parser.toParse;\r\n    char *keyStart = slice.curr;\r\n    slice.SkipNonWs();\r\n    // \"foo:  bar\"\r\n    //      ^\r\n\r\n    char *keyEnd = slice.curr;\r\n    if (':' == slice.PrevChar()) {\r\n        // \"foo:  bar\"\r\n        //     ^ <- keyEnd\r\n        keyEnd--;\r\n    } else {\r\n        slice.SkipWsUntilNewline();\r\n        if ('=' != slice.CurrChar())\r\n            return false;\r\n        // \"foo  =  bar\"\r\n        //       ^\r\n        slice.Skip(1);\r\n        // \"foo  =  bar\"\r\n        //        ^\r\n    }\r\n    slice.SkipWsUntilNewline();\r\n    // \"foo  =   bar \"\r\n    //           ^\r\n\r\n    parser.tok.keyStart = keyStart;\r\n    parser.tok.keyEnd = keyEnd;\r\n\r\n    parser.toParse = slice;\r\n    return true;\r\n}\r\n\r\n// TODO: maybe also allow things like:\r\n// foo: [1 3 4]\r\n// i.e. a child on a single line\r\nstatic void ParseNextToken(TxtParser& parser)\r\n{\r\n    TokenVal& tok = parser.tok;\r\n    ZeroMemory(&tok, sizeof(TokenVal));\r\n    str::Slice& slice = parser.toParse;\r\n\r\nAgain:\r\n    // \"  foo:  bar  \"\r\n    //  ^\r\n    tok.lineStart = slice.curr;\r\n    slice.SkipWsUntilNewline();\r\n    if (slice.Finished()) {\r\n        tok.type = TokenFinished;\r\n        return;\r\n    }\r\n\r\n    // \"  foo:  bar  \"\r\n    //    ^\r\n\r\n    // skip comments\r\n    char c = slice.CurrChar();\r\n    if (IsCommentStartChar(c)) {\r\n        slice.SkipUntil('\\n');\r\n        slice.Skip(1);\r\n        goto Again;\r\n    }\r\n\r\n    if ('[' == c || ']' == c) {\r\n        tok.type = ('[' == c) ? TokenArrayStart : TokenClose;\r\n        slice.ZeroCurr();\r\n        slice.Skip(1);\r\n        slice.SkipWsUntilNewline();\r\n        if (slice.CurrChar() == '\\n') {\r\n            slice.ZeroCurr();\r\n            slice.Skip(1);\r\n        }\r\n        return;\r\n    }\r\n\r\n    if (ParseStructStart(parser))\r\n        return;\r\n\r\n    tok.type = TokenString;\r\n    ParseKey(parser);\r\n\r\n    // \"  foo:  bar\"\r\n    //          ^\r\n    tok.valStart = slice.curr;\r\n    char *origEnd = slice.curr;\r\n    char *valEnd = UnescapeLineInPlace(origEnd, slice.end, parser.escapeChar);\r\n    CrashIf((origEnd < slice.end) && (*origEnd != '\\n'));\r\n    if (valEnd < slice.end)\r\n        *valEnd = 0;\r\n    tok.valEnd = valEnd;\r\n\r\n    slice.curr = origEnd;\r\n    slice.ZeroCurr();\r\n    slice.Skip(1);\r\n    return;\r\n}\r\n\r\nstatic void ParseNodes(TxtParser& parser)\r\n{\r\n    TxtNode *currNode = nullptr;\r\n    for (;;) {\r\n        ParseNextToken(parser);\r\n        TokenVal& tok = parser.tok;\r\n\r\n        if (TokenFinished == tok.type) {\r\n            // we expect to end up with the implicit array node we created at start\r\n            if (parser.nodes.Count() != 1)\r\n                goto Failed;\r\n            return;\r\n        }\r\n\r\n        if (TokenString == tok.type || TokenKeyVal == tok.type) {\r\n            currNode = TxtNodeFromToken(parser.allocator, tok, TextNode);\r\n        } else if (TokenArrayStart == tok.type) {\r\n            currNode = AllocTxtNode(parser.allocator, ArrayNode);\r\n        } else if (TokenStructStart == tok.type) {\r\n            currNode = TxtNodeFromToken(parser.allocator, tok, StructNode);\r\n        } else {\r\n            CrashIf(TokenClose != tok.type);\r\n            // if the only node left is the implict array node we created,\r\n            // this is an error\r\n            if (1 == parser.nodes.Count())\r\n                goto Failed;\r\n            parser.nodes.Pop();\r\n            continue;\r\n        }\r\n        TxtNode *currParent = parser.nodes.At(parser.nodes.Count() - 1);\r\n        currParent->children->Append(currNode);\r\n        if (TextNode != currNode->type)\r\n            parser.nodes.Append(currNode);\r\n    }\r\nFailed:\r\n    parser.failed = true;\r\n}\r\n\r\nstatic void SkipUtf8Bom(char *& s, size_t& sLen)\r\n{\r\n    if (sLen >= 3 && str::EqN(s, UTF8_BOM, 3)) {\r\n        s += 3;\r\n        sLen -= 3;\r\n    }\r\n}\r\n\r\n// we will modify s in-place\r\nvoid TxtParser::SetToParse(char *s, size_t sLen)\r\n{\r\n    char *tmp = str::conv::UnknownToUtf8(s, sLen);\r\n    if (tmp != s) {\r\n        toFree = tmp;\r\n        s = tmp;\r\n        sLen = str::Len(s);\r\n    }\r\n    SkipUtf8Bom(s, sLen);\r\n    size_t n = str::NormalizeNewlinesInPlace(s, s + sLen);\r\n    toParse.Init(s, n);\r\n\r\n    // we create an implicit array node to hold the nodes we'll parse\r\n    CrashIf(0 != nodes.Count());\r\n    nodes.Append(AllocTxtNode(allocator, ArrayNode));\r\n}\r\n\r\nbool ParseTxt(TxtParser& parser)\r\n{\r\n    ParseNodes(parser);\r\n    if (parser.failed)\r\n        return false;\r\n    return true;\r\n}\r\n\r\nstatic void AppendNest(str::Str<char>& s, int nest)\r\n{\r\n    while (nest > 0) {\r\n        s.Append(\"  \");\r\n        --nest;\r\n    }\r\n}\r\n\r\nstatic void AppendWsTrimEnd(str::Str<char>& res, char *s, char *e)\r\n{\r\n    str::TrimWsEnd(s, e);\r\n    res.Append(s, e - s);\r\n}\r\n\r\nstatic void PrettyPrintKeyVal(TxtNode *curr, int nest, str::Str<char>& res)\r\n{\r\n    AppendNest(res, nest);\r\n    if (curr->keyStart) {\r\n        AppendWsTrimEnd(res, curr->keyStart, curr->keyEnd);\r\n        if (StructNode != curr->type)\r\n            res.Append(\" + \");\r\n    }\r\n    AppendWsTrimEnd(res, curr->valStart, curr->valEnd);\r\n    if (StructNode != curr->type)\r\n        res.Append(\"\\n\");\r\n}\r\n\r\nstatic void PrettyPrintNode(TxtNode *curr, int nest, str::Str<char>& res)\r\n{\r\n    if (TextNode == curr->type) {\r\n        PrettyPrintKeyVal(curr, nest, res);\r\n        return;\r\n    }\r\n\r\n    if (StructNode == curr->type) {\r\n        PrettyPrintKeyVal(curr, nest, res);\r\n        res.Append(\" + [\\n\");\r\n    } else if (nest >= 0) {\r\n        CrashIf(ArrayNode != curr->type);\r\n        AppendNest(res, nest);\r\n        res.Append(\"[\\n\");\r\n    }\r\n\r\n    TxtNode *child;\r\n    for (size_t i = 0; i < curr->children->Count(); i++) {\r\n        child = curr->children->At(i);\r\n        PrettyPrintNode(child, nest + 1, res);\r\n    }\r\n\r\n    if (nest >= 0) {\r\n        AppendNest(res, nest);\r\n        res.Append(\"]\\n\");\r\n    }\r\n}\r\n\r\nchar *PrettyPrintTxt(const TxtParser& parser)\r\n{\r\n    str::Str<char> res;\r\n    PrettyPrintNode(parser.nodes.At(0), -1, res);\r\n    return res.StealData();\r\n}\r\n"
  },
  {
    "path": "src/utils/TxtParser.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#define SERIALIZE_ESCAPE_CHAR '$'\r\n\r\nenum Token {\r\n    TokenFinished = 0,\r\n    TokenArrayStart,   // [\r\n    TokenStructStart,  // foo [\r\n    TokenClose,        // ]\r\n    TokenKeyVal,       // foo: bar\r\n    TokenString,       // foo\r\n};\r\n\r\nenum TxtNodeType {\r\n    StructNode,\r\n    ArrayNode,\r\n    TextNode,\r\n};\r\n\r\nstruct TxtNode {\r\n    TxtNodeType     type;\r\n    Vec<TxtNode*>*  children;\r\n\r\n    char *          lineStart;\r\n    char *          valStart;\r\n    char *          valEnd;\r\n    char *          keyStart;\r\n    char *          keyEnd;\r\n\r\n    explicit TxtNode(TxtNodeType tp) {\r\n        type = tp;\r\n    }\r\n    ~TxtNode() { }\r\n\r\n    size_t KeyLen() const {\r\n        return keyEnd - keyStart;\r\n    }\r\n\r\n    size_t ValLen() const {\r\n        return valEnd - valStart;\r\n    }\r\n\r\n    bool IsArray() const {\r\n        return ArrayNode == type;\r\n    }\r\n\r\n    bool IsStruct() const {\r\n        return StructNode == type;\r\n    }\r\n\r\n    // TODO: move to TxtParser.cpp\r\n    bool IsStructWithName(const char *name, size_t nameLen) const {\r\n        if (StructNode != type)\r\n            return false;\r\n        if (nameLen != KeyLen())\r\n            return false;\r\n        return str::EqNI(keyStart, name, nameLen);\r\n    }\r\n\r\n    bool IsStructWithName(const char *name) const {\r\n        return IsStructWithName(name, str::Len(name));\r\n    }\r\n\r\n    bool IsText() const {\r\n        return TextNode == type;\r\n    }\r\n\r\n    // TODO: move to TxtParser.cpp\r\n    bool IsTextWithKey(const char *name) const {\r\n        if (!keyStart)\r\n            return false;\r\n        size_t nameLen = str::Len(name);\r\n        if (nameLen != KeyLen())\r\n            return false;\r\n        return str::EqNI(keyStart, name, nameLen);\r\n    }\r\n\r\n    // TODO: move to TxtParser.cpp\r\n    char *KeyDup() const {\r\n        if (!keyStart)\r\n            return nullptr;\r\n        return str::DupN(keyStart, KeyLen());\r\n    }\r\n\r\n    // TODO: move to TxtParser.cpp\r\n    char *ValDup() const {\r\n        if (!valStart)\r\n            return nullptr;\r\n        return str::DupN(valStart, ValLen());\r\n    }\r\n};\r\n\r\nstruct TokenVal {\r\n    Token   type;\r\n\r\n    // TokenString, TokenKeyVal\r\n    char *  lineStart;\r\n    char *  valStart;\r\n    char *  valEnd;\r\n\r\n    // TokenKeyVal\r\n    char *  keyStart;\r\n    char *  keyEnd;\r\n};\r\n\r\nstruct TxtParser {\r\n    Allocator *     allocator;\r\n    str::Slice      toParse;\r\n    TokenVal        tok;\r\n    char            escapeChar;\r\n    bool            failed;\r\n    Vec<TxtNode*>   nodes;\r\n    char *          toFree;\r\n\r\n    TxtParser() {\r\n        allocator = new PoolAllocator();\r\n        escapeChar = SERIALIZE_ESCAPE_CHAR;\r\n        failed = false;\r\n        toFree = nullptr;\r\n    }\r\n    ~TxtParser() {\r\n        delete allocator;\r\n        free(toFree);\r\n    }\r\n    void SetToParse(char *s, size_t sLen);\r\n};\r\n\r\nbool ParseTxt(TxtParser& parser);\r\nchar *PrettyPrintTxt(const TxtParser& parser);\r\n"
  },
  {
    "path": "src/utils/UITask.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"WinUtil.h\"\r\n#include \"UITask.h\"\r\n\r\nnamespace uitask {\r\n\r\nstatic HWND gTaskDispatchHwnd = nullptr;\r\n\r\n#define UITASK_CLASS_NAME L\"UITask_Wnd_Class\"\r\n#define WM_EXECUTE_TASK (WM_USER + 1)\r\n\r\nstatic LRESULT CALLBACK WndProcTaskDispatch(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {\r\n    if (WM_EXECUTE_TASK == msg) {\r\n        auto func = (std::function<void()> *)lParam;\r\n        (*func)();\r\n        delete func;\r\n        return 0;\r\n    }\r\n    return DefWindowProc(hwnd, msg, wParam, lParam);\r\n}\r\n\r\nvoid Initialize() {\r\n    WNDCLASSEX wcex;\r\n    FillWndClassEx(wcex, UITASK_CLASS_NAME, WndProcTaskDispatch);\r\n    RegisterClassEx(&wcex);\r\n\r\n    CrashIf(gTaskDispatchHwnd);\r\n    gTaskDispatchHwnd =\r\n        CreateWindow(UITASK_CLASS_NAME, L\"UITask Dispatch Window\", WS_OVERLAPPED, 0, 0, 0, 0,\r\n                     HWND_MESSAGE, nullptr, GetModuleHandle(nullptr), nullptr);\r\n}\r\n\r\nvoid DrainQueue() {\r\n    CrashIf(!gTaskDispatchHwnd);\r\n    MSG msg;\r\n    while (PeekMessage(&msg, gTaskDispatchHwnd, WM_EXECUTE_TASK, WM_EXECUTE_TASK, PM_REMOVE)) {\r\n        DispatchMessage(&msg);\r\n    }\r\n}\r\n\r\nvoid Destroy() {\r\n    DrainQueue();\r\n    DestroyWindow(gTaskDispatchHwnd);\r\n    gTaskDispatchHwnd = nullptr;\r\n}\r\n\r\nvoid Post(const std::function<void()> &f) {\r\n    auto func = new std::function<void()>(f);\r\n    PostMessage(gTaskDispatchHwnd, WM_EXECUTE_TASK, 0, (LPARAM)func);\r\n}\r\n}\r\n"
  },
  {
    "path": "src/utils/UITask.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nnamespace uitask {\r\n\r\n// Call Initialize() at program startup and Destroy() at the end\r\nvoid Initialize();\r\nvoid Destroy();\r\n\r\n// call only from the same thread as Initialize() and Destroy()\r\nvoid DrainQueue();\r\n\r\nvoid Post(const std::function<void()> &);\r\n}\r\n"
  },
  {
    "path": "src/utils/UtAssert.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"UtAssert.h\"\r\n\r\nstatic int g_nTotal = 0;\r\nstatic int g_nFailed = 0;\r\n\r\n#define MAX_FAILED_ASSERTS 32\r\n\r\nstruct FailedAssert {\r\n    const char *exprStr;\r\n    const char *file;\r\n    int lineNo;\r\n};\r\n\r\nstatic FailedAssert g_failedAssert[MAX_FAILED_ASSERTS];\r\n\r\nvoid utassert_func(bool ok, const char *exprStr, const char *file, int lineNo)\r\n{\r\n    ++g_nTotal;\r\n    if (ok)\r\n        return;\r\n    if (g_nFailed < MAX_FAILED_ASSERTS) {\r\n        g_failedAssert[g_nFailed].exprStr = exprStr;\r\n        g_failedAssert[g_nFailed].file = file;\r\n        g_failedAssert[g_nFailed].lineNo = lineNo;\r\n    }\r\n    ++g_nFailed;\r\n}\r\n\r\nint utassert_print_results()\r\n{\r\n    if (0 == g_nFailed) {\r\n        printf(\"Passed all %d tests\\n\", g_nTotal);\r\n        return 0;\r\n    }\r\n\r\n    fprintf(stderr, \"Failed %d (of %d) tests\\n\", g_nFailed, g_nTotal);\r\n    for (int i=0; i < g_nFailed && i < MAX_FAILED_ASSERTS; i++) {\r\n        FailedAssert *a = &(g_failedAssert[i]);\r\n        fprintf(stderr, \"'%s' %s@%d\\n\", a->exprStr, a->file, a->lineNo);\r\n    }\r\n    return g_nFailed;\r\n}\r\n"
  },
  {
    "path": "src/utils/UtAssert.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n/* This is assert for unit tests that can be used in non-interactive usage.\r\nInstead of showing a UI to the user, like regular assert(), it simply\r\nremembers number of failed asserts. */\r\n\r\nvoid utassert_func(bool ok, const char *exprStr, const char *file, int lineNo);\r\nint  utassert_print_results();\r\n\r\n#define utassert(_expr) \\\r\n    utassert_func(_expr, #_expr, __FILE__, __LINE__)\r\n\r\n#undef assert\r\n#define assert use_utassert_insteadof_assert\r\n"
  },
  {
    "path": "src/utils/VarintGob.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"VarintGob.h\"\r\n#include \"BitManip.h\"\r\n\r\n// Varint decoding/encoding is the same as the scheme used by GOB in Go.\r\n// For unsinged 64-bit integer\r\n// - if the value is <= 0x7f, it's written as a single byte\r\n// - other values are written as:\r\n//  - count of bytes, negated\r\n//  - bytes of the number follow\r\n// Signed 64-bit integer is turned into unsigned by:\r\n//  - negative value has first bit set to 1 and other bits\r\n//    are negated and shifted by one to the left\r\n//  - positive value has first bit set to 0 and other bits\r\n//    shifted by one to the left\r\n// Smmaller values are cast to uint64 or int64, according to their signed-ness\r\n//\r\n// The downside of this scheme is that it's impossible to tell\r\n// if the value is signed or unsigned from the value itself.\r\n// The client needs to know the sign-edness to properly interpret the data\r\n\r\n// decodes unsigned 64-bit int from data d of dLen size\r\n// returns 0 on error\r\n// returns the number of consumed bytes from d on success\r\nint UVarintGobDecode(const uint8_t *d, int dLen, uint64_t *resOut)\r\n{\r\n    if (dLen < 1)\r\n        return 0;\r\n    uint8_t b = *d++;\r\n    if (b <= 0x7f) {\r\n        *resOut = b;\r\n        return 1;\r\n    }\r\n    --dLen;\r\n    if (dLen < 1)\r\n        return 0;\r\n    char numLenEncoded = (char)b;\r\n    int numLen = -numLenEncoded;\r\n    CrashIf(numLen < 1);\r\n    CrashIf(numLen > 8);\r\n    if (numLen > dLen)\r\n        return 0;\r\n    uint64_t res = 0;\r\n    for (int i=0; i < numLen; i++) {\r\n        b = *d++;\r\n        res = (res << 8) | b;\r\n    }\r\n    *resOut = res;\r\n    return 1 + numLen;\r\n}\r\n\r\nint VarintGobDecode(const uint8_t *d, int dLen, int64_t *resOut)\r\n{\r\n    uint64_t val;\r\n    int n = UVarintGobDecode(d, dLen, &val);\r\n    if (n == 0)\r\n        return 0;\r\n\r\n    bool negative = bit::IsSet(val, 0);\r\n    val = val >> 1;\r\n    int64_t res = (int64_t)val;\r\n    if (negative)\r\n        res = ~res;\r\n    *resOut = res;\r\n    return n;\r\n}\r\n\r\n// max 8 bytes plus 1 to encode size\r\nstatic const int MinGobEncodeBufferSize = 9;\r\nstatic const int UInt64SizeOf = 8;\r\n\r\n// encodes unsigned integer val into a buffer d of dLen size (must be at least 9 bytes)\r\n// returns number of bytes used\r\nint UVarintGobEncode(uint64_t val, uint8_t *d, int dLen)\r\n{\r\n    uint8_t b;\r\n    CrashIf(dLen < MinGobEncodeBufferSize);\r\n    if (val <= 0x7f) {\r\n        *d = (int8_t)val;\r\n        return 1;\r\n    }\r\n\r\n    uint8_t buf[UInt64SizeOf];\r\n    uint8_t *bufPtr = buf + UInt64SizeOf;\r\n    int len8Minus = UInt64SizeOf;\r\n    while (val > 0) {\r\n        b = (uint8_t)(val & 0xff);\r\n        val = val >> 8;\r\n        --bufPtr;\r\n        *bufPtr = b;\r\n        --len8Minus;\r\n    }\r\n    CrashIf(len8Minus < 1);\r\n    int realLen = 8-len8Minus;\r\n    CrashIf(realLen > 8);\r\n    int lenEncoded = (len8Minus - UInt64SizeOf);\r\n    uint8_t lenEncodedU = (uint8_t)lenEncoded;\r\n    *d++ = lenEncodedU;\r\n    memcpy(d, bufPtr, realLen);\r\n    return (int)realLen+1; // +1 for the length byte\r\n}\r\n\r\n// encodes signed integer val into a buffer d of dLen size (must be at least 9 bytes)\r\n// returns number of bytes used\r\nint VarintGobEncode(int64_t val, uint8_t *d, int dLen)\r\n{\r\n    uint64_t uVal;\r\n    if (val < 0) {\r\n        val = ~val;\r\n        uVal = (uint64_t)val;\r\n        uVal = (uVal << 1) | 1;\r\n    } else {\r\n        uVal = (uint64_t)val;\r\n        uVal = uVal << 1;\r\n    }\r\n    return UVarintGobEncode(uVal, d, dLen);\r\n}\r\n"
  },
  {
    "path": "src/utils/VarintGob.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nint VarintGobEncode(int64_t val, uint8_t *d, int dLen);\r\nint VarintGobDecode(const uint8_t *d, int dLen, int64_t *resOut);\r\n\r\nint UVarintGobEncode(uint64_t val, uint8_t *d, int dLen);\r\nint UVarintGobDecode(const uint8_t *d, int dLen, uint64_t *resOut);\r\n"
  },
  {
    "path": "src/utils/Vec.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// note: include BaseUtil.h instead of including directly\r\n\r\n/* Simple but also optimized for small sizes vector/array class that can\r\nstore pointer types or POD types\r\n(http://stackoverflow.com/questions/146452/what-are-pod-types-in-c).\r\n\r\nWe always pad the elements with a single 0 value. This makes\r\nVec<char> and Vec<WCHAR> a C-compatible string. Although it's\r\nnot useful for other types, the code is simpler if we always do it\r\n(rather than have it an optional behavior).\r\n*/\r\ntemplate <typename T>\r\nclass Vec {\r\nprotected:\r\n    static const size_t PADDING = 1;\r\n\r\n    size_t      len;\r\n    size_t      cap;\r\n    size_t      capacityHint;\r\n    T *         els;\r\n    T           buf[16];\r\n    Allocator * allocator;\r\n\r\n    bool EnsureCapTry(size_t needed) {\r\n        if (cap >= needed)\r\n            return true;\r\n\r\n        size_t newCap = cap * 2;\r\n        if (needed > newCap)\r\n            newCap = needed;\r\n        if (newCap < capacityHint)\r\n            newCap = capacityHint;\r\n\r\n        size_t newElCount = newCap + PADDING;\r\n        if (newElCount >= SIZE_MAX / sizeof(T))\r\n            return false;\r\n        if (newElCount > INT_MAX) // limitation of Vec::Find\r\n            return false;\r\n\r\n        size_t allocSize = newElCount * sizeof(T);\r\n        size_t newPadding = allocSize - len * sizeof(T);\r\n        T *newEls;\r\n        if (buf == els)\r\n            newEls = (T *)Allocator::Dup(allocator, buf, len * sizeof(T), newPadding);\r\n        else\r\n            newEls = (T *)Allocator::Realloc(allocator, els, allocSize);\r\n        if (!newEls)\r\n            return false;\r\n        els = newEls;\r\n        memset(els + len, 0, newPadding);\r\n        cap = newCap;\r\n        return true;\r\n    }\r\n\r\n    void EnsureCapCrash(size_t needed) {\r\n        bool ok = EnsureCapTry(needed);\r\n        CrashAlwaysIf(!ok);\r\n    }\r\n\r\n    T* MakeSpaceAt(size_t idx, size_t count, bool allowFailure=false) {\r\n        size_t newLen = std::max(len, idx) + count;\r\n        if (!allowFailure)\r\n            EnsureCapCrash(newLen);\r\n        else if (!EnsureCapTry(newLen))\r\n            return nullptr;\r\n        T* res = &(els[idx]);\r\n        if (len > idx) {\r\n            T* src = els + idx;\r\n            T* dst = els + idx + count;\r\n            memmove(dst, src, (len - idx) * sizeof(T));\r\n        }\r\n        len = newLen;\r\n        return res;\r\n    }\r\n\r\n    void FreeEls() {\r\n        if (els != buf)\r\n            Allocator::Free(allocator, els);\r\n    }\r\n\r\npublic:\r\n    // allocator is not owned by Vec and must outlive it\r\n    explicit Vec(size_t capHint=0, Allocator *allocator=nullptr) :\r\n        capacityHint(capHint), allocator(allocator)\r\n    {\r\n        els = buf;\r\n        Reset();\r\n    }\r\n\r\n    ~Vec() {\r\n        FreeEls();\r\n    }\r\n\r\n    // ensure that a Vec never shares its els buffer with another after a clone/copy\r\n    // note: we don't inherit allocator as it's not needed for our use cases\r\n    Vec(const Vec& orig) : capacityHint(0), allocator(nullptr) {\r\n        els = buf;\r\n        Reset();\r\n        EnsureCapCrash(orig.cap);\r\n        // use memcpy, as Vec only supports POD types\r\n        memcpy(els, orig.els, sizeof(T) * (len = orig.len));\r\n    }\r\n\r\n    // this frees all elements and clears the array.\r\n    // only applicable where T is a pointer. Otherwise will fail to compile\r\n    void FreeMembers() {\r\n        for (size_t i = 0; i < len; i++) {\r\n            auto s = els[i];\r\n            free(s);\r\n        }\r\n        Reset();\r\n    }\r\n\r\n    Vec& operator=(const Vec& that) {\r\n        if (this != &that) {\r\n            EnsureCapCrash(that.cap);\r\n            // use memcpy, as Vec only supports POD types\r\n            memcpy(els, that.els, sizeof(T) * (len = that.len));\r\n            memset(els + len, 0, sizeof(T) * (cap - len));\r\n        }\r\n        return *this;\r\n    }\r\n\r\n    T& operator[](size_t idx) {\r\n        CrashIf(idx >= len);\r\n        return els[idx];\r\n    }\r\n\r\n    void Reset() {\r\n        len = 0;\r\n        cap = dimof(buf) - PADDING;\r\n        FreeEls();\r\n        els = buf;\r\n        memset(buf, 0, sizeof(buf));\r\n    }\r\n\r\n    // use &At() if you need a pointer to the element (e.g. if T is a struct)\r\n    T& At(size_t idx) const {\r\n        CrashIf(idx >= len);\r\n        return els[idx];\r\n    }\r\n\r\n    T *AtPtr(size_t idx) const {\r\n        CrashIf(idx >= len);\r\n        CrashIf(&els[idx] != &At(idx));\r\n        return &els[idx];\r\n    }\r\n\r\n    size_t Count() const {\r\n        return len;\r\n    }\r\n\r\n    size_t Size() const {\r\n        return len;\r\n    }\r\n\r\n    void InsertAt(size_t idx, const T& el) {\r\n        MakeSpaceAt(idx, 1)[0] = el;\r\n    }\r\n\r\n    void Append(const T& el) {\r\n        InsertAt(len, el);\r\n    }\r\n\r\n    void Append(const T* src, size_t count) {\r\n        if (0 == count)\r\n            return;\r\n        T* dst = MakeSpaceAt(len, count);\r\n        memcpy(dst, src, count * sizeof(T));\r\n    }\r\n\r\n    // returns false on allocation failure instead of crashing\r\n    bool AppendChecked(const T* src, size_t count) {\r\n        if (0 == count)\r\n            return true;\r\n        T* dst = MakeSpaceAt(len, count, true);\r\n        if (dst)\r\n            memcpy(dst, src, count * sizeof(T));\r\n        return dst != nullptr;\r\n    }\r\n\r\n    // appends count blank (i.e. zeroed-out) elements at the end\r\n    T* AppendBlanks(size_t count) {\r\n        return MakeSpaceAt(len, count);\r\n    }\r\n\r\n    void RemoveAt(size_t idx, size_t count=1) {\r\n        if (len > idx + count) {\r\n            T *dst = els + idx;\r\n            T *src = els + idx + count;\r\n            memmove(dst, src, (len - idx - count) * sizeof(T));\r\n        }\r\n        len -= count;\r\n        memset(els + len, 0, count * sizeof(T));\r\n    }\r\n\r\n    // This is a fast version of RemoveAt() which replaces the element we're\r\n    // removing with the last element, copying less memory.\r\n    // It can only be used if order of elements doesn't matter and elements\r\n    // can be copied via memcpy()\r\n    // TODO: could be extend to take number of elements to remove\r\n    void RemoveAtFast(size_t idx) {\r\n        CrashIf(idx >= len);\r\n        if (idx >= len) return;\r\n        T *toRemove = els + idx;\r\n        T *last = els + len - 1;\r\n        if (toRemove != last)\r\n            memcpy(toRemove, last, sizeof(T));\r\n        memset(last, 0, sizeof(T));\r\n        --len;\r\n    }\r\n\r\n    void Push(T el) {\r\n        Append(el);\r\n    }\r\n\r\n    T Pop() {\r\n        CrashIf(0 == len);\r\n        T el = At(len - 1);\r\n        RemoveAtFast(len - 1);\r\n        return el;\r\n    }\r\n\r\n    T PopAt(size_t idx) {\r\n        CrashIf(idx >= len);\r\n        T el = At(idx);\r\n        RemoveAt(idx);\r\n        return el;\r\n    }\r\n\r\n    T& Last() const {\r\n        CrashIf(0 == len);\r\n        return At(len - 1);\r\n    }\r\n\r\n    // perf hack for using as a buffer: client can get accumulated data\r\n    // without duplicate allocation. Note: since Vec over-allocates, this\r\n    // is likely to use more memory than strictly necessary, but in most cases\r\n    // it doesn't matter\r\n    T *StealData() {\r\n        T* res = els;\r\n        if (els == buf)\r\n            res = (T *)Allocator::Dup(allocator, buf, (len + PADDING) * sizeof(T));\r\n        els = buf;\r\n        Reset();\r\n        return res;\r\n    }\r\n\r\n    T *LendData() const {\r\n        return els;\r\n    }\r\n\r\n    int Find(T el, size_t startAt=0) const {\r\n        for (size_t i = startAt; i < len; i++) {\r\n            if (els[i] == el)\r\n                return (int)i;\r\n        }\r\n        return -1;\r\n    }\r\n\r\n    bool Contains(T el) const {\r\n        return -1 != Find(el);\r\n    }\r\n\r\n    // returns true if removed\r\n    bool Remove(T el) {\r\n        int i = Find(el);\r\n        if (-1 == i)\r\n            return false;\r\n        RemoveAt(i);\r\n        return true;\r\n    }\r\n\r\n    void Sort(int (*cmpFunc)(const void *a, const void *b)) {\r\n        qsort(els, len, sizeof(T), cmpFunc);\r\n    }\r\n\r\n    void Reverse() {\r\n        for (size_t i = 0; i < len / 2; i++) {\r\n            std::swap(els[i], els[len - i - 1]);\r\n        }\r\n    }\r\n\r\n    T& FindEl(const std::function<bool (T&)> check) {\r\n        for (size_t i = 0; i < len; i++) {\r\n            if (check(els[i]))\r\n                return els[i];\r\n        }\r\n        return els[len]; // nullptr-sentinel\r\n    }\r\n\r\n    // cf. http://www.cprogramming.com/c++11/c++11-ranged-for-loop.html\r\n    class Iter {\r\n        Vec<T> *vec;\r\n        size_t pos;\r\n\r\n    public:\r\n        Iter(Vec<T> *vec, size_t pos) : vec(vec), pos(pos) { }\r\n\r\n        bool operator!=(const Iter& other) const {\r\n            return pos != other.pos;\r\n        }\r\n        T& operator*() const {\r\n            return vec->At(pos);\r\n        }\r\n        Iter& operator++() {\r\n            pos++;\r\n            return *this;\r\n        }\r\n    };\r\n\r\n    Iter begin() {\r\n        return Iter(this, 0);\r\n    }\r\n    Iter end() {\r\n        return Iter(this, len);\r\n    }\r\n};\r\n\r\n// only suitable for T that are pointers to C++ objects\r\ntemplate <typename T>\r\ninline void DeleteVecMembers(Vec<T>& v)\r\n{\r\n    for (T& el : v) {\r\n        delete el;\r\n    }\r\n    v.Reset();\r\n}\r\n\r\nnamespace str {\r\n\r\ntemplate <typename T>\r\nclass Str : public Vec<T> {\r\npublic:\r\n    explicit Str(size_t capHint=0, Allocator *allocator=nullptr) : Vec<T>(capHint, allocator) { }\r\n\r\n    void Append(T c)\r\n    {\r\n        Vec<T>::InsertAt(Vec<T>::len, c);\r\n    }\r\n\r\n    void Append(const T* src, size_t size=-1)\r\n    {\r\n        if ((size_t)-1 == size)\r\n            size = Len(src);\r\n        Vec<T>::Append(src, size);\r\n    }\r\n\r\n    void AppendFmt(const T* fmt, ...)\r\n    {\r\n        va_list args;\r\n        va_start(args, fmt);\r\n        T *res = FmtV(fmt, args);\r\n        AppendAndFree(res);\r\n        va_end(args);\r\n    }\r\n\r\n    void AppendAndFree(T* s)\r\n    {\r\n        if (s)\r\n            Append(s);\r\n        free(s);\r\n    }\r\n\r\n    // returns true if was replaced\r\n    bool Replace(const T *toReplace, const T *replaceWith)\r\n    {\r\n        // fast path: nothing to replace\r\n        if (!str::Find(Vec<T>::els, toReplace))\r\n            return false;\r\n        char *newStr = str::Replace(Vec<T>::els, toReplace, replaceWith);\r\n        Vec<T>::Reset();\r\n        AppendAndFree(newStr);\r\n        return true;\r\n    }\r\n\r\n    void Set(const T* s)\r\n    {\r\n        Vec<T>::Reset();\r\n        Append(s);\r\n    }\r\n\r\n    T *Get() const\r\n    {\r\n        return Vec<T>::els;\r\n    }\r\n\r\n    T LastChar() const {\r\n        if (len == 0) {\r\n            return 0;\r\n        }\r\n        return At(len - 1);\r\n    }\r\n};\r\n\r\n}\r\n\r\n// WStrVec owns the strings in the list\r\nclass WStrVec : public Vec<WCHAR *>\r\n{\r\npublic:\r\n    WStrVec() : Vec() { }\r\n    WStrVec(const WStrVec& orig) : Vec(orig) {\r\n        // make sure not to share string pointers between StrVecs\r\n        for (size_t i = 0; i < len; i++) {\r\n            if (At(i))\r\n                At(i) = str::Dup(At(i));\r\n        }\r\n    }\r\n    ~WStrVec() {\r\n        FreeMembers();\r\n    }\r\n\r\n    WStrVec& operator=(const WStrVec& that) {\r\n        if (this != &that) {\r\n            FreeMembers();\r\n            Vec::operator=(that);\r\n            for (size_t i = 0; i < that.len; i++) {\r\n                if (At(i))\r\n                    At(i) = str::Dup(At(i));\r\n            }\r\n        }\r\n        return *this;\r\n    }\r\n\r\n    void Reset() {\r\n        FreeMembers();\r\n    }\r\n\r\n    WCHAR *Join(const WCHAR *joint=nullptr) {\r\n        str::Str<WCHAR> tmp(256);\r\n        size_t jointLen = str::Len(joint);\r\n        for (size_t i = 0; i < len; i++) {\r\n            WCHAR *s = At(i);\r\n            if (i > 0 && jointLen > 0)\r\n                tmp.Append(joint, jointLen);\r\n            tmp.Append(s);\r\n        }\r\n        return tmp.StealData();\r\n    }\r\n\r\n    int Find(const WCHAR *s, size_t startAt=0) const {\r\n        for (size_t i = startAt; i < len; i++) {\r\n            WCHAR *item = At(i);\r\n            if (str::Eq(s, item))\r\n                return (int)i;\r\n        }\r\n        return -1;\r\n    }\r\n\r\n    bool Contains(const WCHAR *s) const {\r\n        return -1 != Find(s);\r\n    }\r\n\r\n    int FindI(const WCHAR *s, size_t startAt=0) const {\r\n        for (size_t i = startAt; i < len; i++) {\r\n            WCHAR *item = At(i);\r\n            if (str::EqI(s, item))\r\n                return (int)i;\r\n        }\r\n        return -1;\r\n    }\r\n\r\n    /* splits a string into several substrings, separated by the separator\r\n       (optionally collapsing several consecutive separators into one);\r\n       e.g. splitting \"a,b,,c,\" by \",\" results in the list \"a\", \"b\", \"\", \"c\", \"\"\r\n       (resp. \"a\", \"b\", \"c\" if separators are collapsed) */\r\n    size_t Split(const WCHAR *s, const WCHAR *separator, bool collapse=false) {\r\n        size_t start = len;\r\n        const WCHAR *next;\r\n\r\n        while ((next = str::Find(s, separator)) != nullptr) {\r\n            if (!collapse || next > s)\r\n                Append(str::DupN(s, next - s));\r\n            s = next + str::Len(separator);\r\n        }\r\n        if (!collapse || *s)\r\n            Append(str::Dup(s));\r\n\r\n        return len - start;\r\n    }\r\n\r\n    void Sort() { Vec::Sort(cmpAscii); }\r\n    void SortNatural() { Vec::Sort(cmpNatural); }\r\n\r\nprivate:\r\n    static int cmpNatural(const void *a, const void *b) {\r\n        return str::CmpNatural(*(const WCHAR **)a, *(const WCHAR **)b);\r\n    }\r\n\r\n    static int cmpAscii(const void *a, const void *b) {\r\n        return wcscmp(*(const WCHAR **)a, *(const WCHAR **)b);\r\n    }\r\n};\r\n\r\n// WStrList is a subset of WStrVec that's optimized for appending and searching\r\n// WStrList owns the strings it contains and frees them at destruction\r\nclass WStrList {\r\n    struct Item {\r\n        WCHAR *string;\r\n        uint32_t hash;\r\n\r\n        explicit Item(WCHAR *string=nullptr, uint32_t hash=0) : string(string), hash(hash) { }\r\n    };\r\n\r\n    Vec<Item> items;\r\n    size_t count;\r\n    Allocator *allocator;\r\n\r\n    // variation of MurmurHash2 which deals with strings that are\r\n    // mostly ASCII and should be treated case independently\r\n    // TODO: I'm guessing would be much faster when done as MurmuserHash2I()\r\n    // with lower-casing done in-line, without the need to allocate memory for the copy\r\n    static uint32_t GetQuickHashI(const WCHAR *str) {\r\n        size_t len = str::Len(str);\r\n        ScopedMem<char> data(AllocArray<char>(len));\r\n        WCHAR c;\r\n        for (char *dst = data; (c = *str++) != 0; dst++) {\r\n            *dst = (c & 0xFF80) ? 0x80 : 'A' <= c && c <= 'Z' ? (char)(c + 'a' - 'A') : (char)c;\r\n        }\r\n        return MurmurHash2(data, len);\r\n    }\r\n\r\npublic:\r\n    explicit WStrList(size_t capHint=0, Allocator *allocator=nullptr) :\r\n        items(capHint, allocator), count(0), allocator(allocator) { }\r\n\r\n    ~WStrList() {\r\n        for (Item& item : items) {\r\n            Allocator::Free(allocator, item.string);\r\n        }\r\n    }\r\n\r\n    const WCHAR *At(size_t idx) const {\r\n        return items.At(idx).string;\r\n    }\r\n\r\n    const WCHAR *Last() const {\r\n        return items.Last().string;\r\n    }\r\n\r\n    size_t Count() const {\r\n        return count;\r\n    }\r\n\r\n    // str must have been allocated by allocator and is owned by StrList\r\n    void Append(WCHAR *str) {\r\n        items.Append(Item(str, GetQuickHashI(str)));\r\n        count++;\r\n    }\r\n\r\n    int Find(const WCHAR *str, size_t startAt=0) const {\r\n        uint32_t hash = GetQuickHashI(str);\r\n        Item *item = items.LendData();\r\n        for (size_t i = startAt; i < count; i++) {\r\n            if (item[i].hash == hash && str::Eq(item[i].string, str))\r\n                return (int)i;\r\n        }\r\n        return -1;\r\n    }\r\n\r\n    int FindI(const WCHAR *str, size_t startAt=0) const {\r\n        uint32_t hash = GetQuickHashI(str);\r\n        Item *item = items.LendData();\r\n        for (size_t i = startAt; i < count; i++) {\r\n            if (item[i].hash == hash && str::EqI(item[i].string, str))\r\n                return (int)i;\r\n        }\r\n        return -1;\r\n    }\r\n\r\n    bool Contains(const WCHAR *str) const {\r\n        return -1 != Find(str);\r\n    }\r\n};\r\n"
  },
  {
    "path": "src/utils/VecSegmented.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n/* VecSegmented has (mostly) the same API as Vec but allocates\r\n   using PoolAllocator. This means it's append only (we have no\r\n   easy way to remove an item). The upside is that we can retain\r\n   pointers to elements within the vector because we never\r\n   reallocate memory, so once the element has been added to the\r\n   array, it forever occupies the same piece of memory.\r\n   It's also safe to read allocated elements in any thread.\r\n*/\r\ntemplate <typename T>\r\nclass VecSegmented {\r\nprotected:\r\n    size_t        len;\r\n    PoolAllocator allocator;\r\n\r\npublic:\r\n    VecSegmented() : len(0) {\r\n        allocator.SetAllocRounding(sizeof(T));\r\n    }\r\n\r\n    ~VecSegmented() {\r\n        allocator.FreeAll();\r\n    }\r\n\r\n    T* AllocAtEnd(size_t count = 1) {\r\n        void *p = allocator.Alloc(count * sizeof(T));\r\n        len += count;\r\n        return reinterpret_cast<T*>(p);\r\n    }\r\n\r\n#if 0\r\n    // use &At() if you need a pointer to the element (e.g. if T is a struct)\r\n    T& At(size_t idx) const {\r\n        T *elp = allocator.GetAtPtr<T>(idx);\r\n        return *elp;\r\n    }\r\n\r\n    T* AtPtr(size_t idx) const {\r\n        return allocator.GetAtPtr<T>(idx);\r\n    }\r\n#endif\r\n\r\n    size_t Count() const {\r\n        return len;\r\n    }\r\n\r\n    size_t Size() const {\r\n        return len;\r\n    }\r\n\r\n    T* Append(const T& el) {\r\n        T *elPtr = AllocAtEnd();\r\n        *elPtr = el;\r\n        return elPtr;\r\n    }\r\n\r\n#if 0\r\n    void Append(const T* src, size_t count) {\r\n        T *els = AllocAtEnd(count);\r\n        memcpy(els, src, count * sizeof(T));\r\n    }\r\n#endif\r\n\r\n    PoolAllocator::Iter<T> begin() {\r\n        return allocator.begin<T>();\r\n    }\r\n    PoolAllocator::Iter<T> end() {\r\n        return allocator.end<T>();\r\n    }\r\n};\r\n\r\n#if 0\r\n// only suitable for T that are pointers that were malloc()ed\r\ntemplate <typename T>\r\ninline void FreeVecMembers(VecSegmented<T>& v)\r\n{\r\n    T *data = v.LendData();\r\n    for (size_t i = 0; i < v.Count(); i++) {\r\n        free(data[i]);\r\n    }\r\n    v.Reset();\r\n}\r\n\r\n// only suitable for T that are pointers to C++ objects\r\ntemplate <typename T>\r\ninline void DeleteVecMembers(VecSegmented<T>& v)\r\n{\r\n    T *data = v.LendData();\r\n    for (size_t i = 0; i < v.Count(); i++) {\r\n        delete data[i];\r\n    }\r\n    v.Reset();\r\n}\r\n#endif\r\n"
  },
  {
    "path": "src/utils/WebpReader.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"WebpReader.h\"\r\n\r\n#ifndef NO_LIBWEBP\r\n\r\n#include <webp/decode.h>\r\nusing namespace Gdiplus;\r\n\r\nnamespace webp {\r\n\r\n// checks whether this could be data for a WebP image\r\nbool HasSignature(const char *data, size_t len)\r\n{\r\n    return len > 12 && str::StartsWith(data, \"RIFF\") && str::StartsWith(data + 8, \"WEBP\");\r\n}\r\n\r\nSize SizeFromData(const char *data, size_t len)\r\n{\r\n    Size size;\r\n    WebPGetInfo((const uint8_t *)data, len, &size.Width, &size.Height);\r\n    return size;\r\n}\r\n\r\nBitmap *ImageFromData(const char *data, size_t len)\r\n{\r\n    int w, h;\r\n    if (!WebPGetInfo((const uint8_t *)data, len, &w, &h))\r\n        return nullptr;\r\n\r\n    Bitmap bmp(w, h, PixelFormat32bppARGB);\r\n    Rect bmpRect(0, 0, w, h);\r\n    BitmapData bmpData;\r\n    Status ok = bmp.LockBits(&bmpRect, ImageLockModeWrite, PixelFormat32bppARGB, &bmpData);\r\n    if (ok != Ok)\r\n        return nullptr;\r\n    if (!WebPDecodeBGRAInto((const uint8_t *)data, len, (uint8_t *)bmpData.Scan0, bmpData.Stride * h, bmpData.Stride))\r\n        return nullptr;\r\n    bmp.UnlockBits(&bmpData);\r\n\r\n    // hack to avoid the use of ::new (because there won't be a corresponding ::delete)\r\n    return bmp.Clone(0, 0, w, h, PixelFormat32bppARGB);\r\n}\r\n\r\n}\r\n\r\n#else\r\n\r\nnamespace webp {\r\n    bool HasSignature(const char *data, size_t len) { UNUSED(data); UNUSED(len); return false; }\r\n    Gdiplus::Size SizeFromData(const char *data, size_t len) { UNUSED(data); UNUSED(len); return Gdiplus::Size(); }\r\n    Gdiplus::Bitmap *ImageFromData(const char *data, size_t len) { UNUSED(data); UNUSED(len); return nullptr; }\r\n}\r\n\r\n#endif\r\n"
  },
  {
    "path": "src/utils/WebpReader.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nnamespace webp {\r\n\r\nbool                HasSignature(const char *data, size_t len);\r\nGdiplus::Size       SizeFromData(const char *data, size_t len);\r\nGdiplus::Bitmap *   ImageFromData(const char *data, size_t len);\r\n\r\n}\r\n"
  },
  {
    "path": "src/utils/WinDynCalls.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\nLicense: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"WinDynCalls.h\"\r\n\r\n#define API_DECLARATION(name)                                                                      \\\r\n    \\\r\nSig_##name Dyn##name = nullptr;\r\n\r\nKERNEL32_API_LIST(API_DECLARATION)\r\nNTDLL_API_LIST(API_DECLARATION)\r\nUXTHEME_API_LIST(API_DECLARATION)\r\nNORMALIZ_API_LIST(API_DECLARATION)\r\nKTMW32_API_LIST(API_DECLARATION)\r\nUSER32_API_LIST(API_DECLARATION)\r\nDWMAPI_API_LIST(API_DECLARATION)\r\nUIA_API_LIST(API_DECLARATION)\r\nDBGHELP_API_LIST(API_DECLARATION)\r\n\r\n#undef API_DECLARATION\r\n\r\n// Loads a DLL explicitly from the system's library collection\r\nHMODULE SafeLoadLibrary(const WCHAR *dllName) {\r\n    WCHAR dllPath[MAX_PATH];\r\n    UINT res = GetSystemDirectoryW(dllPath, dimof(dllPath));\r\n    if (!res || res >= dimof(dllPath))\r\n        return nullptr;\r\n    BOOL ok = PathAppendW(dllPath, dllName);\r\n    if (!ok)\r\n        return nullptr;\r\n    return LoadLibraryW(dllPath);\r\n}\r\n\r\n#define API_LOAD(name) Dyn##name = (Sig_##name)GetProcAddress(h, #name);\r\n\r\nvoid InitDynCalls() {\r\n    HMODULE h = SafeLoadLibrary(L\"kernel32.dll\");\r\n    CrashAlwaysIf(!h);\r\n    KERNEL32_API_LIST(API_LOAD);\r\n\r\n    h = SafeLoadLibrary(L\"ntdll.dll\");\r\n    CrashAlwaysIf(!h);\r\n    NTDLL_API_LIST(API_LOAD);\r\n\r\n    h = SafeLoadLibrary(L\"user32.dll\");\r\n    CrashAlwaysIf(!h);\r\n    USER32_API_LIST(API_LOAD);\r\n\r\n    h = SafeLoadLibrary(L\"uxtheme.dll\");\r\n    if (h) {\r\n        UXTHEME_API_LIST(API_LOAD);\r\n    }\r\n\r\n    h = SafeLoadLibrary(L\"dwmapi.dll\");\r\n    if (h) {\r\n        DWMAPI_API_LIST(API_LOAD);\r\n    }\r\n\r\n    h = SafeLoadLibrary(L\"normaliz.dll\");\r\n    if (h) {\r\n        NORMALIZ_API_LIST(API_LOAD);\r\n    }\r\n\r\n    h = SafeLoadLibrary(L\"ktmw32.dll\");\r\n    if (h) {\r\n        KTMW32_API_LIST(API_LOAD);\r\n    }\r\n\r\n    h = SafeLoadLibrary(L\"uiautomationcore.dll\");\r\n    if (h) {\r\n        UIA_API_LIST(API_LOAD)\r\n    }\r\n\r\n#if 0\r\n    WCHAR *dbghelpPath = L\"C:\\\\Program Files (x86)\\\\Microsoft Visual Studio 10.0\\\\Team Tools\\\\Performance Tools\\\\dbghelp.dll\";\r\n    h = LoadLibrary(dbghelpPath);\r\n#else\r\n    h = SafeLoadLibrary(L\"dbghelp.dll\");\r\n#endif\r\n    if (h) {\r\n        DBGHELP_API_LIST(API_LOAD)\r\n    }\r\n}\r\n\r\n#undef API_LOAD\r\n\r\nnamespace touch {\r\n\r\nbool SupportsGestures() { return DynGetGestureInfo && DynCloseGestureInfoHandle; }\r\n\r\nBOOL GetGestureInfo(HGESTUREINFO hGestureInfo, PGESTUREINFO pGestureInfo) {\r\n    if (!DynGetGestureInfo)\r\n        return FALSE;\r\n    return DynGetGestureInfo(hGestureInfo, pGestureInfo);\r\n}\r\n\r\nBOOL CloseGestureInfoHandle(HGESTUREINFO hGestureInfo) {\r\n    if (!DynCloseGestureInfoHandle)\r\n        return FALSE;\r\n    return DynCloseGestureInfoHandle(hGestureInfo);\r\n}\r\n\r\nBOOL SetGestureConfig(HWND hwnd, DWORD dwReserved, UINT cIDs, PGESTURECONFIG pGestureConfig,\r\n                      UINT cbSize) {\r\n    if (!DynSetGestureConfig)\r\n        return FALSE;\r\n    return DynSetGestureConfig(hwnd, dwReserved, cIDs, pGestureConfig, cbSize);\r\n}\r\n}\r\n\r\nnamespace theme {\r\n\r\nbool IsAppThemed() {\r\n    if (DynIsAppThemed && DynIsAppThemed()) {\r\n        return true;\r\n    }\r\n    return false;\r\n}\r\n\r\nHTHEME OpenThemeData(HWND hwnd, LPCWSTR pszClassList) {\r\n    if (DynOpenThemeData) {\r\n        return DynOpenThemeData(hwnd, pszClassList);\r\n    }\r\n    return nullptr;\r\n}\r\n\r\nHRESULT CloseThemeData(HTHEME hTheme) {\r\n    if (DynCloseThemeData) {\r\n        return DynCloseThemeData(hTheme);\r\n    }\r\n    return E_NOTIMPL;\r\n}\r\n\r\nHRESULT DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCRECT pRect,\r\n                            LPCRECT pClipRect) {\r\n    if (DynDrawThemeBackground) {\r\n        return DynDrawThemeBackground(hTheme, hdc, iPartId, iStateId, pRect, pClipRect);\r\n    }\r\n    return E_NOTIMPL;\r\n}\r\n\r\nBOOL IsThemeActive() {\r\n    if (DynIsThemeActive) {\r\n        return DynIsThemeActive();\r\n    }\r\n    return FALSE;\r\n}\r\n\r\nBOOL IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, int iPartId, int iStateId) {\r\n    if (DynIsThemeBackgroundPartiallyTransparent) {\r\n        return DynIsThemeBackgroundPartiallyTransparent(hTheme, iPartId, iStateId);\r\n    }\r\n    return FALSE;\r\n}\r\n\r\nHRESULT GetThemeColor(HTHEME hTheme, int iPartId, int iStateId, int iPropId, COLORREF *pColor) {\r\n    if (DynGetThemeColor) {\r\n        return DynGetThemeColor(hTheme, iPartId, iStateId, iPropId, pColor);\r\n    }\r\n    return E_NOTIMPL;\r\n}\r\n};\r\n\r\nnamespace dwm {\r\n\r\nBOOL IsCompositionEnabled() {\r\n    if (!DynDwmIsCompositionEnabled)\r\n        return FALSE;\r\n    BOOL isEnabled;\r\n    if (SUCCEEDED(DynDwmIsCompositionEnabled(&isEnabled)))\r\n        return isEnabled;\r\n    return FALSE;\r\n}\r\n\r\nHRESULT ExtendFrameIntoClientArea(HWND hwnd, const MARGINS *pMarInset) {\r\n    if (!DynDwmExtendFrameIntoClientArea)\r\n        return E_NOTIMPL;\r\n    return DynDwmExtendFrameIntoClientArea(hwnd, pMarInset);\r\n}\r\n\r\nBOOL DefWindowProc_(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *plResult) {\r\n    if (!DynDwmDefWindowProc)\r\n        return FALSE;\r\n    return DynDwmDefWindowProc(hwnd, msg, wParam, lParam, plResult);\r\n}\r\n\r\nHRESULT GetWindowAttribute(HWND hwnd, DWORD dwAttribute, void *pvAttribute, DWORD cbAttribute) {\r\n    if (!DynDwmGetWindowAttribute)\r\n        return E_NOTIMPL;\r\n    return DynDwmGetWindowAttribute(hwnd, dwAttribute, pvAttribute, cbAttribute);\r\n}\r\n};\r\n\r\nnamespace uia {\r\n\r\nLRESULT ReturnRawElementProvider(HWND hwnd, WPARAM wParam, LPARAM lParam,\r\n                                 IRawElementProviderSimple *provider) {\r\n    if (!DynUiaReturnRawElementProvider)\r\n        return 0;\r\n    return DynUiaReturnRawElementProvider(hwnd, wParam, lParam, provider);\r\n}\r\n\r\nHRESULT HostProviderFromHwnd(HWND hwnd, IRawElementProviderSimple **pProvider) {\r\n    if (!DynUiaHostProviderFromHwnd)\r\n        return E_NOTIMPL;\r\n    return DynUiaHostProviderFromHwnd(hwnd, pProvider);\r\n}\r\n\r\nHRESULT RaiseAutomationEvent(IRawElementProviderSimple *pProvider, EVENTID id) {\r\n    if (!DynUiaRaiseAutomationEvent)\r\n        return E_NOTIMPL;\r\n    return DynUiaRaiseAutomationEvent(pProvider, id);\r\n}\r\n\r\nHRESULT RaiseStructureChangedEvent(IRawElementProviderSimple *pProvider,\r\n                                   StructureChangeType structureChangeType, int *pRuntimeId,\r\n                                   int cRuntimeIdLen) {\r\n    if (!DynUiaRaiseStructureChangedEvent)\r\n        return E_NOTIMPL;\r\n    return DynUiaRaiseStructureChangedEvent(pProvider, structureChangeType, pRuntimeId,\r\n                                            cRuntimeIdLen);\r\n}\r\n\r\nHRESULT GetReservedNotSupportedValue(IUnknown **punkNotSupportedValue) {\r\n    if (!DynUiaRaiseStructureChangedEvent)\r\n        return E_NOTIMPL;\r\n    return DynUiaGetReservedNotSupportedValue(punkNotSupportedValue);\r\n}\r\n};\r\n"
  },
  {
    "path": "src/utils/WinDynCalls.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\nLicense: Simplified BSD (see COPYING.BSD) */\r\n\r\n/*\r\nA centrialized location for all APIs that we need to load dynamically.\r\nThe convention is: for a function like SetProcessDEPPolicy(), we define\r\na  function pointer DynSetProcessDEPPolicy() (with a signature matching SetProcessDEPPolicy()).\r\n\r\nYou can test if a function is available with if (DynSetProcessDEPPolicy).\r\n\r\nThe intent is to standardize how we do it.\r\n*/\r\n\r\n// as an exception, we include system headers needed for the calls that we dynamically load\r\n#include <dwmapi.h>\r\n#include <vssym32.h>\r\n#include <UIAutomationCore.h>\r\n#include <UIAutomationCoreApi.h>\r\n#include <OleAcc.h>\r\n\r\n// dbghelp.h is included here so that warning C4091 can be disabled in a single location\r\n#pragma warning(push)\r\n#pragma warning(                                                                                   \\\r\n    disable : 4091) // VS2015: 'typedef ': ignored on left of '' when no variable is declared\r\n#include <dbghelp.h>\r\n#pragma warning(pop)\r\n#include <tlhelp32.h>\r\n\r\n// kernel32.dll\r\n#ifndef PROCESS_DEP_ENABLE\r\n#define PROCESS_DEP_ENABLE 0x1\r\n#define PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION 0x2\r\n#endif\r\ntypedef BOOL(WINAPI *Sig_SetProcessDEPPolicy)(DWORD dwFlags);\r\ntypedef BOOL(WINAPI *Sig_IsWow64Process)(HANDLE, PBOOL);\r\ntypedef BOOL(WINAPI *Sig_SetDllDirectoryW)(LPCWSTR);\r\ntypedef void(WINAPI *Sig_RtlCaptureContext)(PCONTEXT);\r\ntypedef HANDLE(WINAPI *Sig_CreateFileTransactedW)(LPCWSTR lpFileName, DWORD dwDesiredAccess,\r\n                                                  DWORD dwShareMode,\r\n                                                  LPSECURITY_ATTRIBUTES lpSecurityAttributes,\r\n                                                  DWORD dwCreationDisposition,\r\n                                                  DWORD dwFlagsAndAttributes, HANDLE hTemplateFile,\r\n                                                  HANDLE hTransaction, PUSHORT pusMiniVersion,\r\n                                                  PVOID pExtendedParameter);\r\ntypedef BOOL(WINAPI *Sig_DeleteFileTransactedW)(LPCWSTR lpFileName, HANDLE hTransaction);\r\n\r\n#define KERNEL32_API_LIST(V)                                                                       \\\r\n    V(SetProcessDEPPolicy)                                                                         \\\r\n    V(IsWow64Process)                                                                              \\\r\n    V(SetDllDirectoryW)                                                                            \\\r\n    V(RtlCaptureContext)                                                                           \\\r\n    V(CreateFileTransactedW)                                                                       \\\r\n    V(DeleteFileTransactedW)\r\n\r\n// ntdll.dll\r\n#define PROCESS_EXECUTE_FLAGS 0x22\r\n#define MEM_EXECUTE_OPTION_DISABLE 0x1\r\n#define MEM_EXECUTE_OPTION_ENABLE 0x2\r\n#define MEM_EXECUTE_OPTION_PERMANENT 0x8\r\n#define MEM_EXECUTE_OPTION_DISABLE_ATL 0x4\r\n\r\n/* enable \"NX\" execution prevention for XP, 2003\r\n* cf. http://www.uninformed.org/?v=2&a=4 */\r\ntypedef HRESULT(WINAPI *Sig_NtSetInformationProcess)(HANDLE ProcessHandle,\r\n                                                     UINT ProcessInformationClass,\r\n                                                     PVOID ProcessInformation,\r\n                                                     ULONG ProcessInformationLength);\r\n\r\n#define NTDLL_API_LIST(V) V(NtSetInformationProcess)\r\n\r\n// uxtheme.dll\r\n// for win SDKs that don't have this\r\n#ifndef WM_THEMECHANGED\r\n#define WM_THEMECHANGED 0x031A\r\n#endif\r\n#ifndef WM_DWMCOMPOSITIONCHANGED\r\n#define WM_DWMCOMPOSITIONCHANGED 0x031E\r\n#endif\r\n#ifndef SM_CXPADDEDBORDER\r\n#define SM_CXPADDEDBORDER 92\r\n#endif\r\n#ifndef WM_DWMCOLORIZATIONCOLORCHANGED\r\n#define WM_DWMCOLORIZATIONCOLORCHANGED 0x0320\r\n#endif\r\n\r\ntypedef BOOL(WINAPI *Sig_IsAppThemed)();\r\ntypedef HTHEME(WINAPI *Sig_OpenThemeData)(HWND hwnd, LPCWSTR pszClassList);\r\ntypedef HRESULT(WINAPI *Sig_CloseThemeData)(HTHEME hTheme);\r\ntypedef HRESULT(WINAPI *Sig_DrawThemeBackground)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId,\r\n                                                 LPCRECT pRect, LPCRECT pClipRect);\r\ntypedef BOOL(WINAPI *Sig_IsThemeActive)(void);\r\ntypedef BOOL(WINAPI *Sig_IsThemeBackgroundPartiallyTransparent)(HTHEME hTheme, int iPartId,\r\n                                                                int iStateId);\r\ntypedef HRESULT(WINAPI *Sig_GetThemeColor)(HTHEME hTheme, int iPartId, int iStateId, int iPropId,\r\n                                           COLORREF *pColor);\r\n\r\n#define UXTHEME_API_LIST(V)                                                                        \\\r\n    V(IsAppThemed)                                                                                 \\\r\n    V(OpenThemeData)                                                                               \\\r\n    V(CloseThemeData)                                                                              \\\r\n    V(DrawThemeBackground)                                                                         \\\r\n    V(IsThemeActive)                                                                               \\\r\n    V(IsThemeBackgroundPartiallyTransparent)                                                       \\\r\n    V(GetThemeColor)\r\n\r\n/// dwmapi.dll\r\ntypedef HRESULT(WINAPI *Sig_DwmIsCompositionEnabled)(BOOL *pfEnabled);\r\ntypedef HRESULT(WINAPI *Sig_DwmExtendFrameIntoClientArea)(HWND hwnd, const MARGINS *pMarInset);\r\ntypedef BOOL(WINAPI *Sig_DwmDefWindowProc)(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam,\r\n                                           LRESULT *plResult);\r\ntypedef HRESULT(WINAPI *Sig_DwmGetWindowAttribute)(HWND hwnd, DWORD dwAttribute, void *pvAttribute,\r\n                                                   DWORD cbAttribute);\r\n\r\n#define DWMAPI_API_LIST(V)                                                                         \\\r\n    V(DwmIsCompositionEnabled)                                                                     \\\r\n    V(DwmExtendFrameIntoClientArea)                                                                \\\r\n    V(DwmDefWindowProc)                                                                            \\\r\n    V(DwmGetWindowAttribute)\r\n\r\n// normaliz.dll\r\ntypedef int(WINAPI *Sig_NormalizeString)(int, LPCWSTR, int, LPWSTR, int);\r\n\r\n#define NORMALIZ_API_LIST(V) V(NormalizeString)\r\n\r\n// ktmw32.dll\r\ntypedef HANDLE(WINAPI *Sig_CreateTransaction)(LPSECURITY_ATTRIBUTES lpTransactionAttributes,\r\n                                              LPGUID UOW, DWORD CreateOptions, DWORD IsolationLevel,\r\n                                              DWORD IsolationFlags, DWORD Timeout,\r\n                                              LPWSTR Description);\r\ntypedef BOOL(WINAPI *Sig_CommitTransaction)(HANDLE TransactionHandle);\r\ntypedef BOOL(WINAPI *Sig_RollbackTransaction)(HANDLE TransactionHandle);\r\n\r\n#define KTMW32_API_LIST(V)                                                                         \\\r\n    V(CreateTransaction)                                                                           \\\r\n    V(CommitTransaction)                                                                           \\\r\n    V(RollbackTransaction)\r\n\r\n// uiautomationcore.dll, not available under Win2000\r\ntypedef LRESULT(WINAPI *Sig_UiaReturnRawElementProvider)(HWND hwnd, WPARAM wParam, LPARAM lParam,\r\n                                                         IRawElementProviderSimple *el);\r\ntypedef HRESULT(WINAPI *Sig_UiaHostProviderFromHwnd)(HWND hwnd,\r\n                                                     IRawElementProviderSimple **pProvider);\r\ntypedef HRESULT(WINAPI *Sig_UiaRaiseAutomationEvent)(IRawElementProviderSimple *pProvider,\r\n                                                     EVENTID id);\r\ntypedef HRESULT(WINAPI *Sig_UiaRaiseStructureChangedEvent)(IRawElementProviderSimple *pProvider,\r\n                                                           StructureChangeType structureChangeType,\r\n                                                           int *pRuntimeId, int cRuntimeIdLen);\r\ntypedef HRESULT(WINAPI *Sig_UiaGetReservedNotSupportedValue)(IUnknown **punkNotSupportedValue);\r\n\r\n#define UIA_API_LIST(V)                                                                            \\\r\n    V(UiaReturnRawElementProvider)                                                                 \\\r\n    V(UiaHostProviderFromHwnd)                                                                     \\\r\n    V(UiaRaiseAutomationEvent)                                                                     \\\r\n    V(UiaRaiseStructureChangedEvent)                                                               \\\r\n    V(UiaGetReservedNotSupportedValue)\r\n\r\n// user32.dll\r\n\r\n#ifndef _QWORD_DEFINED\r\n#define _QWORD_DEFINED\r\ntypedef unsigned __int64 QWORD, *LPQWORD;\r\n#endif\r\n\r\n#ifndef MAKEQWORD\r\n#define MAKEQWORD(a, b) ((QWORD)(((QWORD)((DWORD)(a))) << 32 | ((DWORD)(b))))\r\n#define LODWORD(l) ((DWORD)((l)&0xFFFFFFFF))\r\n#define HIDWORD(l) ((DWORD)(((QWORD)(l) >> 32) & 0xFFFFFFFF))\r\n#endif\r\n\r\n// Define the Gesture structures here because they\r\n// are not available in all versions of Windows\r\n// These defines can be found in WinUser.h\r\n#ifndef GF_BEGIN // needs WINVER >= 0x0601\r\n\r\nDECLARE_HANDLE(HGESTUREINFO);\r\n\r\n/*\r\n* Gesture flags - GESTUREINFO.dwFlags\r\n*/\r\n#define GF_BEGIN 0x00000001\r\n#define GF_INERTIA 0x00000002\r\n#define GF_END 0x00000004\r\n\r\n/*\r\n* Gesture configuration structure\r\n*   - Used in SetGestureConfig and GetGestureConfig\r\n*   - Note that any setting not included in either GESTURECONFIG.dwWant or\r\n*     GESTURECONFIG.dwBlock will use the parent window's preferences or\r\n*     system defaults.\r\n*/\r\ntypedef struct tagGESTURECONFIG {\r\n    DWORD dwID;    // gesture ID\r\n    DWORD dwWant;  // settings related to gesture ID that are to be turned on\r\n    DWORD dwBlock; // settings related to gesture ID that are to be turned off\r\n} GESTURECONFIG, *PGESTURECONFIG;\r\n\r\n/*\r\n* Gesture information structure\r\n*   - Pass the HGESTUREINFO received in the WM_GESTURE message lParam into the\r\n*     GetGestureInfo function to retrieve this information.\r\n*   - If cbExtraArgs is non-zero, pass the HGESTUREINFO received in the WM_GESTURE\r\n*     message lParam into the GetGestureExtraArgs function to retrieve extended\r\n*     argument information.\r\n*/\r\ntypedef struct tagGESTUREINFO {\r\n    UINT cbSize;        // size, in bytes, of this structure (including variable length Args field)\r\n    DWORD dwFlags;      // see GF_* flags\r\n    DWORD dwID;         // gesture ID, see GID_* defines\r\n    HWND hwndTarget;    // handle to window targeted by this gesture\r\n    POINTS ptsLocation; // current location of this gesture\r\n    DWORD dwInstanceID; // internally used\r\n    DWORD dwSequenceID; // internally used\r\n    ULONGLONG ullArguments; // arguments for gestures whose arguments fit in 8 BYTES\r\n    UINT cbExtraArgs; // size, in bytes, of extra arguments, if any, that accompany this gesture\r\n} GESTUREINFO, *PGESTUREINFO;\r\ntypedef GESTUREINFO const *PCGESTUREINFO;\r\n\r\n/*\r\n* Gesture argument helpers\r\n*   - Angle should be a double in the range of -2pi to +2pi\r\n*   - Argument should be an unsigned 16-bit value\r\n*/\r\n#define GID_ROTATE_ANGLE_TO_ARGUMENT(_arg_)                                                        \\\r\n    ((USHORT)((((_arg_) + 2.0 * M_PI) / (4.0 * M_PI)) * 65535.0))\r\n#define GID_ROTATE_ANGLE_FROM_ARGUMENT(_arg_)                                                      \\\r\n    ((((double)(_arg_) / 65535.0) * 4.0 * M_PI) - 2.0 * M_PI)\r\n\r\n/*\r\n* Gesture configuration flags\r\n*/\r\n#define GC_ALLGESTURES 0x00000001\r\n#define GC_ZOOM 0x00000001\r\n#define GC_PAN 0x00000001\r\n#define GC_PAN_WITH_SINGLE_FINGER_VERTICALLY 0x00000002\r\n#define GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY 0x00000004\r\n#define GC_PAN_WITH_GUTTER 0x00000008\r\n#define GC_PAN_WITH_INERTIA 0x00000010\r\n#define GC_ROTATE 0x00000001\r\n#define GC_TWOFINGERTAP 0x00000001\r\n#define GC_PRESSANDTAP 0x00000001\r\n\r\n/*\r\n* Gesture IDs\r\n*/\r\n#define GID_BEGIN 1\r\n#define GID_END 2\r\n#define GID_ZOOM 3\r\n#define GID_PAN 4\r\n#define GID_ROTATE 5\r\n#define GID_TWOFINGERTAP 6\r\n#define GID_PRESSANDTAP 7\r\n\r\n// Window events\r\n#define WM_GESTURE 0x0119\r\n\r\n#endif // HGESTUREINFO\r\n\r\ntypedef BOOL(WINAPI *Sig_GetGestureInfo)(HGESTUREINFO hGestureInfo, PGESTUREINFO pGestureInfo);\r\ntypedef BOOL(WINAPI *Sig_CloseGestureInfoHandle)(HGESTUREINFO hGestureInfo);\r\ntypedef BOOL(WINAPI *Sig_SetGestureConfig)(HWND hwnd, DWORD dwReserved, UINT cIDs,\r\n                                           PGESTURECONFIG pGestureConfig, UINT cbSize);\r\n\r\n#define USER32_API_LIST(V)                                                                         \\\r\n    V(GetGestureInfo)                                                                              \\\r\n    V(CloseGestureInfoHandle)                                                                      \\\r\n    V(SetGestureConfig)\r\n\r\n// dbghelp.dll,  may not be available under Win2000\r\ntypedef BOOL(WINAPI *Sig_MiniDumpWriteDump)(HANDLE hProcess, DWORD ProcessId, HANDLE hFile,\r\n                                            LONG DumpType,\r\n                                            PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam,\r\n                                            PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam,\r\n                                            PMINIDUMP_CALLBACK_INFORMATION CallbackParam);\r\n\r\ntypedef BOOL(WINAPI *Sig_SymInitializeW)(HANDLE hProcess, PCWSTR UserSearchPath,\r\n                                         BOOL fInvadeProcess);\r\n\r\ntypedef BOOL(WINAPI *Sig_SymInitialize)(HANDLE hProcess, PCSTR UserSearchPath, BOOL fInvadeProcess);\r\n\r\ntypedef BOOL(WINAPI *Sig_SymCleanup)(HANDLE hProcess);\r\n\r\ntypedef DWORD(WINAPI *Sig_SymGetOptions)();\r\ntypedef DWORD(WINAPI *Sig_SymSetOptions)(DWORD SymOptions);\r\n\r\ntypedef BOOL(WINAPI *Sig_StackWalk64)(DWORD MachineType, HANDLE hProcess, HANDLE hThread,\r\n                                      LPSTACKFRAME64 StackFrame, PVOID ContextRecord,\r\n                                      PREAD_PROCESS_MEMORY_ROUTINE64 ReadMemoryRoutine,\r\n                                      PFUNCTION_TABLE_ACCESS_ROUTINE64 FunctionTableAccessRoutine,\r\n                                      PGET_MODULE_BASE_ROUTINE64 GetModuleBaseRoutine,\r\n                                      PTRANSLATE_ADDRESS_ROUTINE64 TranslateAddress);\r\n\r\ntypedef BOOL(WINAPI *Sig_SymFromAddr)(HANDLE hProcess, DWORD64 Address, PDWORD64 Displacement,\r\n                                      PSYMBOL_INFO Symbol);\r\n\r\ntypedef PVOID(WINAPI *Sig_SymFunctionTableAccess64)(HANDLE hProcess, DWORD64 AddrBase);\r\n\r\ntypedef DWORD64(WINAPI *Sig_SymGetModuleBase64)(HANDLE hProcess, DWORD64 qwAddr);\r\n\r\ntypedef BOOL(WINAPI *Sig_SymSetSearchPathW)(HANDLE hProcess, PCWSTR SearchPath);\r\n\r\ntypedef BOOL(WINAPI *Sig_SymSetSearchPath)(HANDLE hProcess, PCSTR SearchPath);\r\n\r\ntypedef BOOL(WINAPI *Sig_SymRefreshModuleList)(HANDLE hProcess);\r\n\r\ntypedef BOOL(WINAPI *Sig_SymGetLineFromAddr64)(HANDLE hProcess, DWORD64 dwAddr,\r\n                                               PDWORD pdwDisplacement, PIMAGEHLP_LINE64 Line);\r\n\r\n#define DBGHELP_API_LIST(V)                                                                        \\\r\n    V(MiniDumpWriteDump)                                                                           \\\r\n    V(SymInitializeW)                                                                              \\\r\n    V(SymInitialize)                                                                               \\\r\n    V(SymCleanup)                                                                                  \\\r\n    V(SymGetOptions)                                                                               \\\r\n    V(SymSetOptions)                                                                               \\\r\n    V(StackWalk64)                                                                                 \\\r\n    V(SymFromAddr)                                                                                 \\\r\n    V(SymFunctionTableAccess64)                                                                    \\\r\n    V(SymGetModuleBase64)                                                                          \\\r\n    V(SymSetSearchPathW)                                                                           \\\r\n    V(SymSetSearchPath)                                                                            \\\r\n    V(SymRefreshModuleList)                                                                        \\\r\n    V(SymGetLineFromAddr64)\r\n\r\n#define API_DECLARATION(name)                                                                      \\\r\n    \\\r\nextern Sig_##name Dyn##name;\r\n\r\nKERNEL32_API_LIST(API_DECLARATION)\r\nNTDLL_API_LIST(API_DECLARATION)\r\nUXTHEME_API_LIST(API_DECLARATION)\r\nDWMAPI_API_LIST(API_DECLARATION)\r\nNORMALIZ_API_LIST(API_DECLARATION)\r\nKTMW32_API_LIST(API_DECLARATION)\r\nUSER32_API_LIST(API_DECLARATION)\r\nUIA_API_LIST(API_DECLARATION)\r\nDBGHELP_API_LIST(API_DECLARATION)\r\n#undef API_DECLARATION\r\n\r\nvoid InitDynCalls();\r\n\r\n// convenience wrappers\r\nnamespace theme {\r\n\r\nbool IsAppThemed();\r\nHTHEME OpenThemeData(HWND hwnd, LPCWSTR pszClassList);\r\nHRESULT CloseThemeData(HTHEME hTheme);\r\nHRESULT DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCRECT pRect,\r\n                            LPCRECT pClipRect);\r\nBOOL IsThemeActive();\r\nBOOL IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, int iPartId, int iStateId);\r\nHRESULT GetThemeColor(HTHEME hTheme, int iPartId, int iStateId, int iPropId, COLORREF *pColor);\r\n};\r\n\r\nnamespace dwm {\r\n\r\nBOOL IsCompositionEnabled();\r\nHRESULT ExtendFrameIntoClientArea(HWND hwnd, const MARGINS *pMarInset);\r\nBOOL DefWindowProc_(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *plResult);\r\nHRESULT GetWindowAttribute(HWND hwnd, DWORD dwAttribute, void *pvAttribute, DWORD cbAttribute);\r\n};\r\n\r\n// Touch Gesture API, only available in Windows 7\r\nnamespace touch {\r\n\r\nbool SupportsGestures();\r\n\r\nBOOL GetGestureInfo(HGESTUREINFO hGestureInfo, PGESTUREINFO pGestureInfo);\r\nBOOL CloseGestureInfoHandle(HGESTUREINFO hGestureInfo);\r\nBOOL SetGestureConfig(HWND hwnd, DWORD dwReserved, UINT cIDs, PGESTURECONFIG pGestureConfig,\r\n                      UINT cbSize);\r\n}\r\n\r\nnamespace uia {\r\n\r\nLRESULT ReturnRawElementProvider(HWND hwnd, WPARAM wParam, LPARAM lParam,\r\n                                 IRawElementProviderSimple *);\r\nHRESULT HostProviderFromHwnd(HWND hwnd, IRawElementProviderSimple **pProvider);\r\nHRESULT RaiseAutomationEvent(IRawElementProviderSimple *pProvider, EVENTID id);\r\nHRESULT RaiseStructureChangedEvent(IRawElementProviderSimple *pProvider,\r\n                                   StructureChangeType structureChangeType, int *pRuntimeId,\r\n                                   int cRuntimeIdLen);\r\nHRESULT GetReservedNotSupportedValue(IUnknown **punkNotSupportedValue);\r\n};\r\n"
  },
  {
    "path": "src/utils/WinUtil.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"BitManip.h\"\r\n#include \"FileUtil.h\"\r\n#include \"WinDynCalls.h\"\r\n#include \"WinUtil.h\"\r\n#include <mlang.h>\r\n\r\n#include \"DebugLog.h\"\r\n\r\nstatic HFONT gDefaultGuiFont = nullptr;\r\n\r\nvoid Edit_SelectAll(HWND hwnd) {\r\n    Edit_SetSel(hwnd, 0, -1);\r\n}\r\n\r\nvoid ListBox_AppendString_NoSort(HWND hwnd, WCHAR *txt) {\r\n    ListBox_InsertString(hwnd, -1, txt);\r\n}\r\n\r\nvoid InitAllCommonControls() {\r\n    INITCOMMONCONTROLSEX cex = { 0 };\r\n    cex.dwSize = sizeof(INITCOMMONCONTROLSEX);\r\n    cex.dwICC = ICC_WIN95_CLASSES | ICC_DATE_CLASSES | ICC_USEREX_CLASSES | ICC_COOL_CLASSES;\r\n    InitCommonControlsEx(&cex);\r\n}\r\n\r\nvoid FillWndClassEx(WNDCLASSEX &wcex, const WCHAR *clsName, WNDPROC wndproc) {\r\n    ZeroMemory(&wcex, sizeof(WNDCLASSEX));\r\n    wcex.cbSize = sizeof(WNDCLASSEX);\r\n    wcex.style = CS_HREDRAW | CS_VREDRAW;\r\n    wcex.hInstance = GetModuleHandle(nullptr);\r\n    wcex.hCursor = GetCursor(IDC_ARROW);\r\n    wcex.lpszClassName = clsName;\r\n    wcex.lpfnWndProc = wndproc;\r\n}\r\n\r\nvoid MoveWindow(HWND hwnd, RectI rect) {\r\n    MoveWindow(hwnd, rect.x, rect.y, rect.dx, rect.dy, TRUE);\r\n}\r\n\r\nvoid MoveWindow(HWND hwnd, RECT *r) {\r\n    MoveWindow(hwnd, r->left, r->top, RectDx(*r), RectDy(*r), TRUE);\r\n}\r\n\r\nvoid GetOsVersion(OSVERSIONINFOEX& ver)\r\n{\r\n    ZeroMemory(&ver, sizeof(ver));\r\n    ver.dwOSVersionInfoSize = sizeof(ver);\r\n#pragma warning(push)\r\n#pragma warning(disable: 4996) // 'GetVersionEx': was declared deprecated\r\n#pragma warning(disable: 28159) // Consider using 'IsWindows*' instead of 'GetVersionExW'\r\n    // see: https://msdn.microsoft.com/en-us/library/windows/desktop/dn424972(v=vs.85).aspx\r\n    // starting with Windows 8.1, GetVersionEx will report a wrong version number\r\n    // unless the OS's GUID has been explicitly added to the compatibility manifest\r\n    BOOL ok = GetVersionEx((OSVERSIONINFO*)&ver);\r\n#pragma warning(pop)\r\n    CrashIf(!ok);\r\n}\r\n\r\n// For more versions see OsNameFromVer() in CrashHandler.cpp\r\nbool IsWin10() {\r\n    OSVERSIONINFOEX ver;\r\n    GetOsVersion(ver);\r\n    return ver.dwMajorVersion == 10;\r\n}\r\n\r\nbool IsWin7() {\r\n    OSVERSIONINFOEX ver;\r\n    GetOsVersion(ver);\r\n    return ver.dwMajorVersion == 6 && ver.dwMinorVersion == 1;\r\n}\r\n\r\n/* Vista is major: 6, minor: 0 */\r\nbool IsVistaOrGreater() {\r\n    OSVERSIONINFOEX osver = { 0 };\r\n    ULONGLONG condMask = 0;\r\n    osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);\r\n    osver.dwMajorVersion = 6;\r\n    VER_SET_CONDITION(condMask, VER_MAJORVERSION, VER_GREATER_EQUAL);\r\n    return VerifyVersionInfo(&osver, VER_MAJORVERSION, condMask);\r\n}\r\n\r\nbool IsRunningInWow64() {\r\n#ifndef _WIN64\r\n    BOOL isWow = FALSE;\r\n    if (DynIsWow64Process && DynIsWow64Process(GetCurrentProcess(), &isWow)) {\r\n        return isWow == TRUE;\r\n    }\r\n#endif\r\n    return false;\r\n}\r\n\r\n// return true if this is 64-bit executable\r\nbool IsProcess64() {\r\n    return 8 == sizeof(void*);\r\n}\r\n\r\n// return true if running on a 64-bit OS\r\nbool IsOs64() {\r\n    // 64-bit processes can only run on a 64-bit OS,\r\n    // 32-bit processes run on a 64-bit OS under WOW64\r\n    return IsProcess64() || IsRunningInWow64();\r\n}\r\n\r\n// return true if OS and our process have the same arch (i.e. both are 32bit\r\n// or both are 64bit)\r\nbool IsProcessAndOsArchSame() {\r\n    return IsProcess64() == IsOs64();\r\n}\r\n\r\nvoid LogLastError(DWORD err) {\r\n    // allow to set a breakpoint in release builds\r\n    if (0 == err)\r\n        err = GetLastError();\r\n    char *msgBuf = nullptr;\r\n    DWORD flags =\r\n        FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS;\r\n    DWORD lang = MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT);\r\n    DWORD res = FormatMessageA(flags, nullptr, err, lang, (LPSTR)&msgBuf, 0, nullptr);\r\n    if (!res || !msgBuf)\r\n        return;\r\n    plogf(\"LogLastError: %s\", msgBuf);\r\n    LocalFree(msgBuf);\r\n}\r\n\r\n// return true if a given registry key (path) exists\r\nbool RegKeyExists(HKEY keySub, const WCHAR *keyName) {\r\n    HKEY hKey;\r\n    LONG res = RegOpenKey(keySub, keyName, &hKey);\r\n    if (ERROR_SUCCESS == res) {\r\n        RegCloseKey(hKey);\r\n        return true;\r\n    }\r\n\r\n    // return true for key that exists even if it's not\r\n    // accessible by us\r\n    return ERROR_ACCESS_DENIED == res;\r\n}\r\n\r\n// called needs to free() the result\r\nWCHAR *ReadRegStr(HKEY keySub, const WCHAR *keyName, const WCHAR *valName) {\r\n    WCHAR *val = nullptr;\r\n    REGSAM access = KEY_READ;\r\n    HKEY hKey;\r\nTryAgainWOW64:\r\n    LONG res = RegOpenKeyEx(keySub, keyName, 0, access, &hKey);\r\n    if (ERROR_SUCCESS == res) {\r\n        DWORD valLen;\r\n        res = RegQueryValueEx(hKey, valName, nullptr, nullptr, nullptr, &valLen);\r\n        if (ERROR_SUCCESS == res) {\r\n            val = AllocArray<WCHAR>(valLen / sizeof(WCHAR) + 1);\r\n            res = RegQueryValueEx(hKey, valName, nullptr, nullptr, (LPBYTE)val, &valLen);\r\n            if (ERROR_SUCCESS != res)\r\n                str::ReplacePtr(&val, nullptr);\r\n        }\r\n        RegCloseKey(hKey);\r\n    }\r\n    if (ERROR_FILE_NOT_FOUND == res && HKEY_LOCAL_MACHINE == keySub && KEY_READ == access) {\r\n// try the (non-)64-bit key as well, as HKLM\\Software is not shared between 32-bit and\r\n// 64-bit applications per http://msdn.microsoft.com/en-us/library/aa384253(v=vs.85).aspx\r\n#ifdef _WIN64\r\n        access = KEY_READ | KEY_WOW64_32KEY;\r\n#else\r\n        access = KEY_READ | KEY_WOW64_64KEY;\r\n#endif\r\n        goto TryAgainWOW64;\r\n    }\r\n    return val;\r\n}\r\n\r\nbool WriteRegStr(HKEY keySub, const WCHAR *keyName, const WCHAR *valName, const WCHAR *value) {\r\n    DWORD cbData = (DWORD)(str::Len(value) + 1) * sizeof(WCHAR);\r\n    LSTATUS res = SHSetValueW(keySub, keyName, valName, REG_SZ, (const void *)value, cbData);\r\n    return ERROR_SUCCESS == res;\r\n}\r\n\r\nbool ReadRegDWORD(HKEY keySub, const WCHAR *keyName, const WCHAR *valName, DWORD &value) {\r\n    DWORD size = sizeof(DWORD);\r\n    LSTATUS res = SHGetValue(keySub, keyName, valName, nullptr, &value, &size);\r\n    return ERROR_SUCCESS == res && sizeof(DWORD) == size;\r\n}\r\n\r\nbool WriteRegDWORD(HKEY keySub, const WCHAR *keyName, const WCHAR *valName, DWORD value) {\r\n    LSTATUS res =\r\n        SHSetValueW(keySub, keyName, valName, REG_DWORD, (const void *)&value, sizeof(DWORD));\r\n    return ERROR_SUCCESS == res;\r\n}\r\n\r\nbool CreateRegKey(HKEY keySub, const WCHAR *keyName) {\r\n    HKEY hKey;\r\n    LSTATUS res =\r\n        RegCreateKeyEx(keySub, keyName, 0, nullptr, 0, KEY_WRITE, nullptr, &hKey, nullptr);\r\n    if (res != ERROR_SUCCESS)\r\n        return false;\r\n    RegCloseKey(hKey);\r\n    return true;\r\n}\r\n\r\n#pragma warning(push)\r\n#pragma warning(disable : 6248) // \"Setting a SECURITY_DESCRIPTOR's DACL to nullptr will result in\r\n                                // an unprotected object\"\r\n// try to remove any access restrictions on the key\r\n// by granting everybody all access to this key (nullptr DACL)\r\nstatic void ResetRegKeyAcl(HKEY keySub, const WCHAR *keyName) {\r\n    HKEY hKey;\r\n    LONG res = RegOpenKeyEx(keySub, keyName, 0, WRITE_DAC, &hKey);\r\n    if (ERROR_SUCCESS != res)\r\n        return;\r\n    SECURITY_DESCRIPTOR secdesc;\r\n    InitializeSecurityDescriptor(&secdesc, SECURITY_DESCRIPTOR_REVISION);\r\n    SetSecurityDescriptorDacl(&secdesc, TRUE, nullptr, TRUE);\r\n    RegSetKeySecurity(hKey, DACL_SECURITY_INFORMATION, &secdesc);\r\n    RegCloseKey(hKey);\r\n}\r\n#pragma warning(pop)\r\n\r\nbool DeleteRegKey(HKEY keySub, const WCHAR *keyName, bool resetACLFirst) {\r\n    if (resetACLFirst)\r\n        ResetRegKeyAcl(keySub, keyName);\r\n\r\n    LSTATUS res = SHDeleteKeyW(keySub, keyName);\r\n    return ERROR_SUCCESS == res || ERROR_FILE_NOT_FOUND == res;\r\n}\r\n\r\nWCHAR *GetSpecialFolder(int csidl, bool createIfMissing) {\r\n    if (createIfMissing)\r\n        csidl = csidl | CSIDL_FLAG_CREATE;\r\n    WCHAR path[MAX_PATH] = { 0 };\r\n    HRESULT res = SHGetFolderPath(nullptr, csidl, nullptr, 0, path);\r\n    if (S_OK != res)\r\n        return nullptr;\r\n    return str::Dup(path);\r\n}\r\n\r\nvoid DisableDataExecution() {\r\n    // first try the documented SetProcessDEPPolicy\r\n    if (DynSetProcessDEPPolicy) {\r\n        DynSetProcessDEPPolicy(PROCESS_DEP_ENABLE);\r\n        return;\r\n    }\r\n\r\n    // now try undocumented NtSetInformationProcess\r\n    if (DynNtSetInformationProcess) {\r\n        DWORD depMode = MEM_EXECUTE_OPTION_DISABLE | MEM_EXECUTE_OPTION_DISABLE_ATL;\r\n        DynNtSetInformationProcess(GetCurrentProcess(), PROCESS_EXECUTE_FLAGS, &depMode,\r\n                                   sizeof(depMode));\r\n    }\r\n}\r\n\r\n// Code from http://www.halcyon.com/~ast/dload/guicon.htm\r\n// See https://github.com/benvanik/xenia/issues/228 for the VS2015 fix\r\nvoid RedirectIOToConsole() {\r\n    CONSOLE_SCREEN_BUFFER_INFO coninfo;\r\n\r\n    AllocConsole();\r\n\r\n    // make buffer big enough to allow scrolling\r\n    GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &coninfo);\r\n    coninfo.dwSize.Y = 500;\r\n    SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), coninfo.dwSize);\r\n\r\n    // redirect STDIN, STDOUT and STDERR to the console\r\n#if _MSC_VER < 1900\r\n    int hConHandle = _open_osfhandle((intptr_t)GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT);\r\n    *stdout = *_fdopen(hConHandle, \"w\");\r\n\r\n    hConHandle = _open_osfhandle((intptr_t) GetStdHandle(STD_ERROR_HANDLE), _O_TEXT);\r\n    *stderr = *_fdopen(hConHandle, \"w\");\r\n\r\n    hConHandle = _open_osfhandle((intptr_t) GetStdHandle(STD_INPUT_HANDLE), _O_TEXT);\r\n    *stdin = *_fdopen(hConHandle, \"r\");\r\n#else\r\n    FILE *con;\r\n    freopen_s(&con, \"CONOUT$\", \"w\", stdout);\r\n    freopen_s(&con, \"CONOUT$\", \"w\", stderr);\r\n    freopen_s(&con, \"CONIN$\", \"r\", stdin);\r\n#endif\r\n\r\n    // make them unbuffered\r\n    setvbuf(stdin, nullptr, _IONBF, 0);\r\n    setvbuf(stdout, nullptr, _IONBF, 0);\r\n    setvbuf(stderr, nullptr, _IONBF, 0);\r\n}\r\n\r\n/* Return the full exe path of my own executable.\r\n   Caller needs to free() the result. */\r\nWCHAR *GetExePath() {\r\n    WCHAR buf[MAX_PATH] = { 0 };\r\n    GetModuleFileName(nullptr, buf, dimof(buf));\r\n    // TODO: is normalization needed here at all?\r\n    return path::Normalize(buf);\r\n}\r\n\r\nstatic ULARGE_INTEGER FileTimeToLargeInteger(const FILETIME &ft) {\r\n    ULARGE_INTEGER res;\r\n    res.LowPart = ft.dwLowDateTime;\r\n    res.HighPart = ft.dwHighDateTime;\r\n    return res;\r\n}\r\n\r\n/* Return <ft1> - <ft2> in seconds */\r\nint FileTimeDiffInSecs(const FILETIME &ft1, const FILETIME &ft2) {\r\n    ULARGE_INTEGER t1 = FileTimeToLargeInteger(ft1);\r\n    ULARGE_INTEGER t2 = FileTimeToLargeInteger(ft2);\r\n    // diff is in 100 nanoseconds\r\n    LONGLONG diff = t1.QuadPart - t2.QuadPart;\r\n    diff = diff / (LONGLONG)10000000L;\r\n    return (int)diff;\r\n}\r\n\r\nWCHAR *ResolveLnk(const WCHAR *path) {\r\n    ScopedMem<OLECHAR> olePath(str::Dup(path));\r\n    if (!olePath)\r\n        return nullptr;\r\n\r\n    ScopedComPtr<IShellLink> lnk;\r\n    if (!lnk.Create(CLSID_ShellLink))\r\n        return nullptr;\r\n\r\n    ScopedComQIPtr<IPersistFile> file(lnk);\r\n    if (!file)\r\n        return nullptr;\r\n\r\n    HRESULT hRes = file->Load(olePath, STGM_READ);\r\n    if (FAILED(hRes))\r\n        return nullptr;\r\n\r\n    hRes = lnk->Resolve(nullptr, SLR_UPDATE);\r\n    if (FAILED(hRes))\r\n        return nullptr;\r\n\r\n    WCHAR newPath[MAX_PATH] = { 0 };\r\n    hRes = lnk->GetPath(newPath, MAX_PATH, nullptr, 0);\r\n    if (FAILED(hRes))\r\n        return nullptr;\r\n\r\n    return str::Dup(newPath);\r\n}\r\n\r\nbool CreateShortcut(const WCHAR *shortcutPath, const WCHAR *exePath, const WCHAR *args,\r\n                    const WCHAR *description, int iconIndex) {\r\n    ScopedCom com;\r\n\r\n    ScopedComPtr<IShellLink> lnk;\r\n    if (!lnk.Create(CLSID_ShellLink))\r\n        return false;\r\n\r\n    ScopedComQIPtr<IPersistFile> file(lnk);\r\n    if (!file)\r\n        return false;\r\n\r\n    HRESULT hr = lnk->SetPath(exePath);\r\n    if (FAILED(hr))\r\n        return false;\r\n\r\n    lnk->SetWorkingDirectory(ScopedMem<WCHAR>(path::GetDir(exePath)));\r\n    // lnk->SetShowCmd(SW_SHOWNORMAL);\r\n    // lnk->SetHotkey(0);\r\n    lnk->SetIconLocation(exePath, iconIndex);\r\n    if (args)\r\n        lnk->SetArguments(args);\r\n    if (description)\r\n        lnk->SetDescription(description);\r\n\r\n    hr = file->Save(shortcutPath, TRUE);\r\n    return SUCCEEDED(hr);\r\n}\r\n\r\n/* adapted from http://blogs.msdn.com/oldnewthing/archive/2004/09/20/231739.aspx */\r\nIDataObject *GetDataObjectForFile(const WCHAR *filePath, HWND hwnd) {\r\n    ScopedComPtr<IShellFolder> pDesktopFolder;\r\n    HRESULT hr = SHGetDesktopFolder(&pDesktopFolder);\r\n    if (FAILED(hr))\r\n        return nullptr;\r\n\r\n    IDataObject *pDataObject = nullptr;\r\n    ScopedMem<WCHAR> lpWPath(str::Dup(filePath));\r\n    LPITEMIDLIST pidl;\r\n    hr = pDesktopFolder->ParseDisplayName(nullptr, nullptr, lpWPath, nullptr, &pidl, nullptr);\r\n    if (SUCCEEDED(hr)) {\r\n        ScopedComPtr<IShellFolder> pShellFolder;\r\n        LPCITEMIDLIST pidlChild;\r\n        hr = SHBindToParent(pidl, IID_IShellFolder, (void **)&pShellFolder, &pidlChild);\r\n        if (SUCCEEDED(hr)) {\r\n            hr = pShellFolder->GetUIObjectOf(hwnd, 1, &pidlChild, IID_IDataObject, nullptr,\r\n                                             (void **)&pDataObject);\r\n            if (FAILED(hr))\r\n                pDataObject = nullptr;\r\n        }\r\n        CoTaskMemFree(pidl);\r\n    }\r\n\r\n    return pDataObject;\r\n}\r\n\r\n// The result value contains major and minor version in the high resp. the low WORD\r\nDWORD GetFileVersion(const WCHAR *path) {\r\n    DWORD fileVersion = 0;\r\n    DWORD size = GetFileVersionInfoSize(path, nullptr);\r\n    ScopedMem<void> versionInfo(malloc(size));\r\n\r\n    if (versionInfo && GetFileVersionInfo(path, 0, size, versionInfo)) {\r\n        VS_FIXEDFILEINFO *fileInfo;\r\n        UINT len;\r\n        if (VerQueryValue(versionInfo, L\"\\\\\", (LPVOID *)&fileInfo, &len))\r\n            fileVersion = fileInfo->dwFileVersionMS;\r\n    }\r\n\r\n    return fileVersion;\r\n}\r\n\r\nbool LaunchFile(const WCHAR *path, const WCHAR *params, const WCHAR *verb, bool hidden) {\r\n    if (!path)\r\n        return false;\r\n\r\n    SHELLEXECUTEINFO sei = { 0 };\r\n    sei.cbSize = sizeof(sei);\r\n    sei.fMask = SEE_MASK_FLAG_NO_UI;\r\n    sei.lpVerb = verb;\r\n    sei.lpFile = path;\r\n    sei.lpParameters = params;\r\n    sei.nShow = hidden ? SW_HIDE : SW_SHOWNORMAL;\r\n    return ShellExecuteEx(&sei);\r\n}\r\n\r\nHANDLE LaunchProcess(const WCHAR *cmdLine, const WCHAR *currDir, DWORD flags) {\r\n    PROCESS_INFORMATION pi = { 0 };\r\n    STARTUPINFO si = { 0 };\r\n    si.cb = sizeof(si);\r\n\r\n    // CreateProcess() might modify cmd line argument, so make a copy\r\n    // in case caller provides a read-only string\r\n    ScopedMem<WCHAR> cmdLineCopy(str::Dup(cmdLine));\r\n    if (!CreateProcessW(nullptr, cmdLineCopy, nullptr, nullptr, FALSE, flags, nullptr, currDir, &si,\r\n                        &pi))\r\n        return nullptr;\r\n\r\n    CloseHandle(pi.hThread);\r\n    return pi.hProcess;\r\n}\r\n\r\n/* Ensure that the rectangle is at least partially in the work area on a\r\n   monitor. The rectangle is shifted into the work area if necessary. */\r\nRectI ShiftRectToWorkArea(RectI rect, bool bFully) {\r\n    RectI monitor = GetWorkAreaRect(rect);\r\n\r\n    if (rect.y + rect.dy <= monitor.y || bFully && rect.y < monitor.y)\r\n        /* Rectangle is too far above work area */\r\n        rect.Offset(0, monitor.y - rect.y);\r\n    else if (rect.y >= monitor.y + monitor.dy ||\r\n             bFully && rect.y + rect.dy > monitor.y + monitor.dy)\r\n        /* Rectangle is too far below */\r\n        rect.Offset(0, monitor.y - rect.y + monitor.dy - rect.dy);\r\n\r\n    if (rect.x + rect.dx <= monitor.x || bFully && rect.x < monitor.x)\r\n        /* Too far left */\r\n        rect.Offset(monitor.x - rect.x, 0);\r\n    else if (rect.x >= monitor.x + monitor.dx ||\r\n             bFully && rect.x + rect.dx > monitor.x + monitor.dx)\r\n        /* Too far right */\r\n        rect.Offset(monitor.x - rect.x + monitor.dx - rect.dx, 0);\r\n\r\n    return rect;\r\n}\r\n\r\nRectI GetWorkAreaRect(RectI rect) {\r\n    MONITORINFO mi = { 0 };\r\n    mi.cbSize = sizeof mi;\r\n    RECT tmpRect = rect.ToRECT();\r\n    HMONITOR monitor = MonitorFromRect(&tmpRect, MONITOR_DEFAULTTONEAREST);\r\n    BOOL ok = GetMonitorInfo(monitor, &mi);\r\n    if (!ok)\r\n        SystemParametersInfo(SPI_GETWORKAREA, 0, &mi.rcWork, 0);\r\n    return RectI::FromRECT(mi.rcWork);\r\n}\r\n\r\n// returns the dimensions the given window has to have in order to be a fullscreen window\r\nRectI GetFullscreenRect(HWND hwnd) {\r\n    MONITORINFO mi = { 0 };\r\n    mi.cbSize = sizeof(mi);\r\n    if (GetMonitorInfo(MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST), &mi))\r\n        return RectI::FromRECT(mi.rcMonitor);\r\n    // fall back to the primary monitor\r\n    return RectI(0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));\r\n}\r\n\r\nstatic BOOL CALLBACK GetMonitorRectProc(HMONITOR hMonitor, HDC hdc, LPRECT rcMonitor, LPARAM data) {\r\n    UNUSED(hMonitor);\r\n    UNUSED(hdc);\r\n    RectI *rcAll = (RectI *)data;\r\n    *rcAll = rcAll->Union(RectI::FromRECT(*rcMonitor));\r\n    return TRUE;\r\n}\r\n\r\n// returns the smallest rectangle that covers the entire virtual screen (all monitors)\r\nRectI GetVirtualScreenRect() {\r\n    RectI result(0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));\r\n    EnumDisplayMonitors(nullptr, nullptr, GetMonitorRectProc, (LPARAM)&result);\r\n    return result;\r\n}\r\n\r\nvoid PaintRect(HDC hdc, const RectI &rect) {\r\n    MoveToEx(hdc, rect.x, rect.y, nullptr);\r\n    LineTo(hdc, rect.x + rect.dx - 1, rect.y);\r\n    LineTo(hdc, rect.x + rect.dx - 1, rect.y + rect.dy - 1);\r\n    LineTo(hdc, rect.x, rect.y + rect.dy - 1);\r\n    LineTo(hdc, rect.x, rect.y);\r\n}\r\n\r\nvoid PaintLine(HDC hdc, const RectI &rect) {\r\n    MoveToEx(hdc, rect.x, rect.y, nullptr);\r\n    LineTo(hdc, rect.x + rect.dx, rect.y + rect.dy);\r\n}\r\n\r\nvoid DrawCenteredText(HDC hdc, const RectI &r, const WCHAR *txt, bool isRTL) {\r\n    SetBkMode(hdc, TRANSPARENT);\r\n    RECT tmpRect = r.ToRECT();\r\n    DrawText(hdc, txt, -1, &tmpRect,\r\n             DT_CENTER | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX | (isRTL ? DT_RTLREADING : 0));\r\n}\r\n\r\nvoid DrawCenteredText(HDC hdc, const RECT &r, const WCHAR *txt, bool isRTL) {\r\n    RectI rc = RectI::FromRECT(r);\r\n    DrawCenteredText(hdc, rc, txt, isRTL);\r\n}\r\n\r\n/* Return size of a text <txt> in a given <hwnd>, taking into account its font */\r\nSizeI TextSizeInHwnd(HWND hwnd, const WCHAR *txt) {\r\n    SIZE sz;\r\n    size_t txtLen = str::Len(txt);\r\n    HDC dc = GetWindowDC(hwnd);\r\n    /* GetWindowDC() returns dc with default state, so we have to first set\r\n       window's current font into dc */\r\n    HFONT f = (HFONT)SendMessage(hwnd, WM_GETFONT, 0, 0);\r\n    HGDIOBJ prev = SelectObject(dc, f);\r\n    GetTextExtentPoint32(dc, txt, (int)txtLen, &sz);\r\n    SelectObject(dc, prev);\r\n    ReleaseDC(hwnd, dc);\r\n    return SizeI(sz.cx, sz.cy);\r\n}\r\n\r\nbool IsCursorOverWindow(HWND hwnd) {\r\n    POINT pt;\r\n    GetCursorPos(&pt);\r\n    WindowRect rcWnd(hwnd);\r\n    return rcWnd.Contains(PointI(pt.x, pt.y));\r\n}\r\n\r\nbool GetCursorPosInHwnd(HWND hwnd, PointI &posOut) {\r\n    POINT pt;\r\n    if (!GetCursorPos(&pt))\r\n        return false;\r\n    if (!ScreenToClient(hwnd, &pt))\r\n        return false;\r\n    posOut = PointI(pt.x, pt.y);\r\n    return true;\r\n}\r\n\r\nvoid CenterDialog(HWND hDlg, HWND hParent) {\r\n    if (!hParent)\r\n        hParent = GetParent(hDlg);\r\n\r\n    RectI rcDialog = WindowRect(hDlg);\r\n    rcDialog.Offset(-rcDialog.x, -rcDialog.y);\r\n    RectI rcOwner = WindowRect(hParent ? hParent : GetDesktopWindow());\r\n    RectI rcRect = rcOwner;\r\n    rcRect.Offset(-rcRect.x, -rcRect.y);\r\n\r\n    // center dialog on its parent window\r\n    rcDialog.Offset(rcOwner.x + (rcRect.x - rcDialog.x + rcRect.dx - rcDialog.dx) / 2,\r\n                    rcOwner.y + (rcRect.y - rcDialog.y + rcRect.dy - rcDialog.dy) / 2);\r\n    // ensure that the dialog is fully visible on one monitor\r\n    rcDialog = ShiftRectToWorkArea(rcDialog, true);\r\n\r\n    SetWindowPos(hDlg, 0, rcDialog.x, rcDialog.y, 0, 0, SWP_NOZORDER | SWP_NOSIZE);\r\n}\r\n\r\n/* Get the name of default printer or nullptr if not exists.\r\n   The caller needs to free() the result */\r\nWCHAR *GetDefaultPrinterName() {\r\n    WCHAR buf[512];\r\n    DWORD bufSize = dimof(buf);\r\n    if (GetDefaultPrinter(buf, &bufSize))\r\n        return str::Dup(buf);\r\n    return nullptr;\r\n}\r\n\r\nbool CopyTextToClipboard(const WCHAR *text, bool appendOnly) {\r\n    CrashIf(!text);\r\n    if (!text)\r\n        return false;\r\n\r\n    if (!appendOnly) {\r\n        if (!OpenClipboard(nullptr))\r\n            return false;\r\n        EmptyClipboard();\r\n    }\r\n\r\n    size_t n = str::Len(text) + 1;\r\n    HGLOBAL handle = GlobalAlloc(GMEM_MOVEABLE, n * sizeof(WCHAR));\r\n    if (handle) {\r\n        WCHAR *globalText = (WCHAR *)GlobalLock(handle);\r\n        if (globalText) {\r\n            str::BufSet(globalText, n, text);\r\n        }\r\n        GlobalUnlock(handle);\r\n\r\n        SetClipboardData(CF_UNICODETEXT, handle);\r\n    }\r\n\r\n    if (!appendOnly)\r\n        CloseClipboard();\r\n\r\n    return handle != nullptr;\r\n}\r\n\r\nstatic bool SetClipboardImage(HBITMAP hbmp) {\r\n    if (!hbmp)\r\n        return false;\r\n    BITMAP bmpInfo;\r\n    GetObject(hbmp, sizeof(BITMAP), &bmpInfo);\r\n    HANDLE h = nullptr;\r\n    if (bmpInfo.bmBits != nullptr) {\r\n        // GDI+ produced HBITMAPs are DIBs instead of DDBs which\r\n        // aren't correctly handled by the clipboard, so create a\r\n        // clipboard-safe clone\r\n        ScopedGdiObj<HBITMAP> ddbBmp(\r\n            (HBITMAP)CopyImage(hbmp, IMAGE_BITMAP, bmpInfo.bmWidth, bmpInfo.bmHeight, 0));\r\n        h = SetClipboardData(CF_BITMAP, ddbBmp);\r\n    } else {\r\n        h = SetClipboardData(CF_BITMAP, hbmp);\r\n    }\r\n    return h != nullptr;\r\n}\r\n\r\nbool CopyImageToClipboard(HBITMAP hbmp, bool appendOnly) {\r\n    if (!appendOnly) {\r\n        if (!OpenClipboard(nullptr))\r\n            return false;\r\n        EmptyClipboard();\r\n    }\r\n\r\n    bool ok = SetClipboardImage(hbmp);\r\n\r\n    if (!appendOnly)\r\n        CloseClipboard();\r\n\r\n    return ok;\r\n}\r\n\r\nvoid ToggleWindowStyle(HWND hwnd, DWORD flag, bool enable, int type) {\r\n    DWORD style = GetWindowLong(hwnd, type);\r\n    DWORD newStyle;\r\n    if (enable)\r\n        newStyle = style | flag;\r\n    else\r\n        newStyle = style & ~flag;\r\n    if (newStyle != style)\r\n        SetWindowLong(hwnd, type, newStyle);\r\n}\r\n\r\nRectI ChildPosWithinParent(HWND hwnd) {\r\n    POINT pt = { 0, 0 };\r\n    ClientToScreen(GetParent(hwnd), &pt);\r\n    WindowRect rc(hwnd);\r\n    rc.Offset(-pt.x, -pt.y);\r\n    return rc;\r\n}\r\n\r\nHFONT GetDefaultGuiFont() {\r\n    if (!gDefaultGuiFont) {\r\n        NONCLIENTMETRICS ncm = { 0 };\r\n        ncm.cbSize = sizeof(ncm);\r\n        SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);\r\n        gDefaultGuiFont = CreateFontIndirect(&ncm.lfMessageFont);\r\n    }\r\n    return gDefaultGuiFont;\r\n}\r\n\r\nDoubleBuffer::DoubleBuffer(HWND hwnd, RectI rect)\r\n    : hTarget(hwnd), rect(rect), hdcBuffer(nullptr), doubleBuffer(nullptr) {\r\n    hdcCanvas = ::GetDC(hwnd);\r\n\r\n    if (rect.IsEmpty())\r\n        return;\r\n\r\n    doubleBuffer = CreateCompatibleBitmap(hdcCanvas, rect.dx, rect.dy);\r\n    if (!doubleBuffer)\r\n        return;\r\n\r\n    hdcBuffer = CreateCompatibleDC(hdcCanvas);\r\n    if (!hdcBuffer)\r\n        return;\r\n\r\n    if (rect.x != 0 || rect.y != 0) {\r\n        SetGraphicsMode(hdcBuffer, GM_ADVANCED);\r\n        XFORM ctm = { 1.0, 0, 0, 1.0, (float)-rect.x, (float)-rect.y };\r\n        SetWorldTransform(hdcBuffer, &ctm);\r\n    }\r\n    DeleteObject(SelectObject(hdcBuffer, doubleBuffer));\r\n}\r\n\r\nDoubleBuffer::~DoubleBuffer() {\r\n    DeleteObject(doubleBuffer);\r\n    DeleteDC(hdcBuffer);\r\n    ReleaseDC(hTarget, hdcCanvas);\r\n}\r\n\r\nvoid DoubleBuffer::Flush(HDC hdc) {\r\n    assert(hdc != hdcBuffer);\r\n    if (hdcBuffer)\r\n        BitBlt(hdc, rect.x, rect.y, rect.dx, rect.dy, hdcBuffer, 0, 0, SRCCOPY);\r\n}\r\n\r\nDeferWinPosHelper::DeferWinPosHelper() { hdwp = ::BeginDeferWindowPos(32); }\r\n\r\nDeferWinPosHelper::~DeferWinPosHelper() { End(); }\r\n\r\nvoid DeferWinPosHelper::End() {\r\n    if (hdwp) {\r\n        ::EndDeferWindowPos(hdwp);\r\n        hdwp = nullptr;\r\n    }\r\n}\r\n\r\nvoid DeferWinPosHelper::SetWindowPos(HWND hWnd, HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT uFlags) {\r\n    hdwp = ::DeferWindowPos(hdwp, hWnd, hWndInsertAfter, x, y, cx, cy, uFlags);\r\n}\r\n\r\nvoid DeferWinPosHelper::MoveWindow(HWND hWnd, int x, int y, int cx, int cy, BOOL bRepaint) {\r\n    UINT uFlags = SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER;\r\n    if (!bRepaint)\r\n        uFlags |= SWP_NOREDRAW;\r\n    this->SetWindowPos(hWnd, 0, x, y, cx, cy, uFlags);\r\n}\r\n\r\nvoid DeferWinPosHelper::MoveWindow(HWND hWnd, RectI r) { \r\n    this->MoveWindow(hWnd, r.x, r.y, r.dx, r.dy);\r\n}\r\n\r\nnamespace win {\r\nnamespace menu {\r\n\r\nvoid SetChecked(HMENU m, UINT id, bool isChecked) {\r\n    CheckMenuItem(m, id, MF_BYCOMMAND | (isChecked ? MF_CHECKED : MF_UNCHECKED));\r\n}\r\n\r\nbool SetEnabled(HMENU m, UINT id, bool isEnabled) {\r\n    BOOL ret = EnableMenuItem(m, id, MF_BYCOMMAND | (isEnabled ? MF_ENABLED : MF_GRAYED));\r\n    return ret != -1;\r\n}\r\n\r\nvoid Remove(HMENU m, UINT id) { RemoveMenu(m, id, MF_BYCOMMAND); }\r\nvoid Empty(HMENU m) {\r\n    while (RemoveMenu(m, 0, MF_BYPOSITION))\r\n        ;\r\n}\r\n\r\nvoid SetText(HMENU m, UINT id, WCHAR *s) {\r\n    MENUITEMINFO mii = { 0 };\r\n    mii.cbSize = sizeof(mii);\r\n    mii.fMask = MIIM_STRING;\r\n    mii.fType = MFT_STRING;\r\n    mii.dwTypeData = s;\r\n    mii.cch = (UINT)str::Len(s);\r\n    SetMenuItemInfo(m, id, FALSE, &mii);\r\n}\r\n\r\n/* Make a string safe to be displayed as a menu item\r\n   (preserving all & so that they don't get swallowed)\r\n   if no change is needed, the string is returned as is,\r\n   else it's also saved in newResult for automatic freeing */\r\nconst WCHAR *ToSafeString(const WCHAR *str, ScopedMem<WCHAR> &newResult) {\r\n    if (!str::FindChar(str, '&'))\r\n        return str;\r\n    newResult = str::Replace(str, L\"&\", L\"&&\");\r\n    return newResult.Get();\r\n}\r\n}\r\n}\r\n\r\nHFONT CreateSimpleFont(HDC hdc, const WCHAR *fontName, int fontSize) {\r\n    LOGFONT lf = { 0 };\r\n\r\n    lf.lfWidth = 0;\r\n    lf.lfHeight = -MulDiv(fontSize, GetDeviceCaps(hdc, LOGPIXELSY), USER_DEFAULT_SCREEN_DPI);\r\n    lf.lfItalic = FALSE;\r\n    lf.lfUnderline = FALSE;\r\n    lf.lfStrikeOut = FALSE;\r\n    lf.lfCharSet = DEFAULT_CHARSET;\r\n    lf.lfOutPrecision = OUT_TT_PRECIS;\r\n    lf.lfQuality = DEFAULT_QUALITY;\r\n    lf.lfPitchAndFamily = DEFAULT_PITCH;\r\n    str::BufSet(lf.lfFaceName, dimof(lf.lfFaceName), fontName);\r\n    lf.lfWeight = FW_DONTCARE;\r\n    lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;\r\n    lf.lfEscapement = 0;\r\n    lf.lfOrientation = 0;\r\n\r\n    return CreateFontIndirect(&lf);\r\n}\r\n\r\nIStream *CreateStreamFromData(const void *data, size_t len) {\r\n    if (!data)\r\n        return nullptr;\r\n\r\n    ScopedComPtr<IStream> stream;\r\n    if (FAILED(CreateStreamOnHGlobal(nullptr, TRUE, &stream)))\r\n        return nullptr;\r\n\r\n    ULONG written;\r\n    if (FAILED(stream->Write(data, (ULONG)len, &written)) || written != len)\r\n        return nullptr;\r\n\r\n    LARGE_INTEGER zero = { 0 };\r\n    stream->Seek(zero, STREAM_SEEK_SET, nullptr);\r\n\r\n    stream->AddRef();\r\n    return stream;\r\n}\r\n\r\nstatic HRESULT GetDataFromStream(IStream *stream, void **data, ULONG *len) {\r\n    if (!stream)\r\n        return E_INVALIDARG;\r\n\r\n    STATSTG stat;\r\n    HRESULT res = stream->Stat(&stat, STATFLAG_NONAME);\r\n    if (FAILED(res))\r\n        return res;\r\n    if (stat.cbSize.HighPart > 0 || stat.cbSize.LowPart > UINT_MAX - sizeof(WCHAR) - 1)\r\n        return E_OUTOFMEMORY;\r\n\r\n    ULONG n = stat.cbSize.LowPart;\r\n    // zero-terminate the stream's content, so that it could be\r\n    // used directly as either a char* or a WCHAR* string\r\n    char *d = AllocArray<char>(n + sizeof(WCHAR) + 1);\r\n    if (!d)\r\n        return E_OUTOFMEMORY;\r\n\r\n    ULONG read;\r\n    LARGE_INTEGER zero = { 0 };\r\n    stream->Seek(zero, STREAM_SEEK_SET, nullptr);\r\n    res = stream->Read(d, stat.cbSize.LowPart, &read);\r\n    if (FAILED(res) || read != n) {\r\n        free(d);\r\n        return res;\r\n    }\r\n\r\n    *len = n;\r\n    *data = d;\r\n    return S_OK;\r\n}\r\n\r\nvoid *GetDataFromStream(IStream *stream, size_t *len, HRESULT *res_opt) {\r\n    void *data;\r\n    ULONG size;\r\n    HRESULT res = GetDataFromStream(stream, &data, &size);\r\n    if (len)\r\n        *len = size;\r\n    if (res_opt)\r\n        *res_opt = res;\r\n    if (FAILED(res))\r\n        return nullptr;\r\n    return data;\r\n}\r\n\r\nbool ReadDataFromStream(IStream *stream, void *buffer, size_t len, size_t offset) {\r\n    LARGE_INTEGER off;\r\n    off.QuadPart = offset;\r\n    HRESULT res = stream->Seek(off, STREAM_SEEK_SET, nullptr);\r\n    if (FAILED(res))\r\n        return false;\r\n    ULONG read;\r\n#ifdef _WIN64\r\n    for (; len > ULONG_MAX; len -= ULONG_MAX) {\r\n        res = stream->Read(buffer, ULONG_MAX, &read);\r\n        if (FAILED(res) || read != ULONG_MAX)\r\n            return false;\r\n        len -= ULONG_MAX;\r\n        buffer = (char *)buffer + ULONG_MAX;\r\n    }\r\n#endif\r\n    res = stream->Read(buffer, (ULONG)len, &read);\r\n    return SUCCEEDED(res) && read == len;\r\n}\r\n\r\nUINT GuessTextCodepage(const char *data, size_t len, UINT defVal) {\r\n    // try to guess the codepage\r\n    ScopedComPtr<IMultiLanguage2> pMLang;\r\n    if (!pMLang.Create(CLSID_CMultiLanguage))\r\n        return defVal;\r\n\r\n    int ilen = std::min((int)len, INT_MAX);\r\n    int count = 1;\r\n    DetectEncodingInfo info = { 0 };\r\n    HRESULT hr =\r\n        pMLang->DetectInputCodepage(MLDETECTCP_NONE, CP_ACP, (char *)data, &ilen, &info, &count);\r\n    if (FAILED(hr) || count != 1)\r\n        return defVal;\r\n    return info.nCodePage;\r\n}\r\n\r\nWCHAR *NormalizeString(const WCHAR *str, int /* NORM_FORM */ form) {\r\n    if (!DynNormalizeString) {\r\n        return nullptr;\r\n    }\r\n    int sizeEst = DynNormalizeString(form, str, -1, nullptr, 0);\r\n    if (sizeEst <= 0)\r\n        return nullptr;\r\n    // according to MSDN the estimate may be off somewhat:\r\n    // http://msdn.microsoft.com/en-us/library/windows/desktop/dd319093(v=vs.85).aspx\r\n    sizeEst = sizeEst * 3 / 2 + 1;\r\n    ScopedMem<WCHAR> res(AllocArray<WCHAR>(sizeEst));\r\n    sizeEst = DynNormalizeString(form, str, -1, res, sizeEst);\r\n    if (sizeEst <= 0)\r\n        return nullptr;\r\n    return res.StealData();\r\n}\r\n\r\nbool IsRtl(HWND hwnd) {\r\n    DWORD style = GetWindowLong(hwnd, GWL_EXSTYLE);\r\n    return bit::IsMaskSet<DWORD>(style, WS_EX_LAYOUTRTL);\r\n}\r\n\r\nnamespace win {\r\n\r\nvoid ToForeground(HWND hwnd) {\r\n    if (IsIconic(hwnd))\r\n        ShowWindow(hwnd, SW_RESTORE);\r\n    SetForegroundWindow(hwnd);\r\n}\r\n\r\n/* return text of window or edit control, nullptr in case of an error.\r\ncaller needs to free() the result */\r\nWCHAR *GetText(HWND hwnd) {\r\n    size_t cchTxtLen = GetTextLen(hwnd);\r\n    WCHAR *txt = AllocArray<WCHAR>(cchTxtLen + 1);\r\n    if (nullptr == txt)\r\n        return nullptr;\r\n    SendMessage(hwnd, WM_GETTEXT, cchTxtLen + 1, (LPARAM)txt);\r\n    txt[cchTxtLen] = 0;\r\n    return txt;\r\n}\r\n\r\nsize_t GetTextLen(HWND hwnd) { return (size_t)SendMessage(hwnd, WM_GETTEXTLENGTH, 0, 0); }\r\n\r\nvoid SetText(HWND hwnd, const WCHAR *txt) { SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM)txt); }\r\n\r\nvoid SetVisibility(HWND hwnd, bool visible) { ShowWindow(hwnd, visible ? SW_SHOW : SW_HIDE); }\r\n\r\nbool HasFrameThickness(HWND hwnd) {\r\n    return bit::IsMaskSet(GetWindowLong(hwnd, GWL_STYLE), WS_THICKFRAME);\r\n}\r\n\r\nbool HasCaption(HWND hwnd) { return bit::IsMaskSet(GetWindowLong(hwnd, GWL_STYLE), WS_CAPTION); }\r\n}\r\n\r\nSizeI GetBitmapSize(HBITMAP hbmp) {\r\n    BITMAP bmpInfo;\r\n    GetObject(hbmp, sizeof(BITMAP), &bmpInfo);\r\n    return SizeI(bmpInfo.bmWidth, bmpInfo.bmHeight);\r\n}\r\n\r\n// cf. fz_mul255 in fitz.h\r\ninline int mul255(int a, int b) {\r\n    int x = a * b + 128;\r\n    x += x >> 8;\r\n    return x >> 8;\r\n}\r\n\r\nvoid FinalizeBitmapPixels(BitmapPixels* bitmapPixels) {\r\n    HDC hdc = bitmapPixels->hdc;\r\n    if (hdc) {\r\n        SetDIBits(bitmapPixels->hdc, bitmapPixels->hbmp, 0, bitmapPixels->size.dy, bitmapPixels->pixels, &bitmapPixels->bmi, DIB_RGB_COLORS);\r\n        DeleteDC(hdc);\r\n    }\r\n    free(bitmapPixels);\r\n}\r\n\r\nstatic bool IsPalettedBitmap(DIBSECTION& info, int nBytes) {\r\n    return sizeof(info) == nBytes && info.dsBmih.biBitCount != 0 && info.dsBmih.biBitCount <= 8;\r\n}\r\n\r\nCOLORREF GetPixel(BitmapPixels *bitmap, int x, int y) {\r\n    CrashIf(x < 0 || x >= bitmap->size.dx);\r\n    CrashIf(y < 0 || y >= bitmap->size.dy);\r\n    uint8 *pixels = bitmap->pixels;\r\n    uint8 *pixel = pixels + y * bitmap->nBytesPerRow + x * bitmap->nBytesPerPixel;\r\n    // color order in DIB is blue-green-red-alpha\r\n    COLORREF c = 0;\r\n    if (3 == bitmap->nBytesPerPixel) {\r\n        c = RGB(pixel[2], pixel[1], pixel[0]);\r\n    } else if (4 == bitmap->nBytesPerPixel) {\r\n        c = RGB(pixel[3], pixel[2], pixel[1]);\r\n    } else {\r\n        CrashIf(true);\r\n    }\r\n    return c;\r\n}\r\n\r\nBitmapPixels *GetBitmapPixels(HBITMAP hbmp) {\r\n    BitmapPixels *res = AllocStruct<BitmapPixels>();\r\n\r\n    DIBSECTION info = { 0 };\r\n    int nBytes = GetObject(hbmp, sizeof(info), &info);\r\n    CrashIf(nBytes < sizeof(info.dsBm));\r\n    SizeI size(info.dsBm.bmWidth, info.dsBm.bmHeight);\r\n\r\n    res->size = size;\r\n    res->hbmp = hbmp;\r\n\r\n    if (nBytes >= sizeof(info.dsBm)) {\r\n        res->pixels = (uint8_t *)info.dsBm.bmBits;\r\n    }\r\n\r\n    // for mapped 32-bit DI bitmaps: directly access the pixel data\r\n    if (res->pixels && 32 == info.dsBm.bmBitsPixel && size.dx * 4 == info.dsBm.bmWidthBytes) {\r\n        res->nBytesPerPixel = 4;\r\n        res->nBytesPerRow = info.dsBm.bmWidthBytes;\r\n        res->nBytes = size.dx * size.dy * 4;\r\n        return res;\r\n    }\r\n\r\n    // for mapped 24-bit DI bitmaps: directly access the pixel data\r\n    if (res->pixels && 24 == info.dsBm.bmBitsPixel && info.dsBm.bmWidthBytes >= size.dx * 3) {\r\n        res->nBytesPerPixel = 3;\r\n        res->nBytesPerRow = info.dsBm.bmWidthBytes;\r\n        res->nBytes = size.dx * size.dy * 4;\r\n        return res;\r\n    }\r\n\r\n    // we don't support paletted DI bitmaps\r\n    if (IsPalettedBitmap(info, nBytes)) {\r\n        FinalizeBitmapPixels(res);\r\n        return nullptr;\r\n    }\r\n\r\n    BITMAPINFO bmi = { 0 };\r\n    bmi.bmiHeader.biSize = sizeof(bmi.bmiHeader);\r\n    bmi.bmiHeader.biWidth = size.dx;\r\n    bmi.bmiHeader.biHeight = size.dy;\r\n    bmi.bmiHeader.biPlanes = 1;\r\n    bmi.bmiHeader.biBitCount = 32;\r\n    bmi.bmiHeader.biCompression = BI_RGB;\r\n\r\n    HDC hdc = CreateCompatibleDC(nullptr);\r\n    int bmpBytes = size.dx * size.dy * 4;\r\n    ScopedMem<uint8> bmpData((uint8 *)malloc(bmpBytes));\r\n    CrashIf(!bmpData);\r\n\r\n    if (!GetDIBits(hdc, hbmp, 0, size.dy, bmpData, &bmi, DIB_RGB_COLORS)) {\r\n        DeleteDC(hdc);\r\n        FinalizeBitmapPixels(res);\r\n        return nullptr;\r\n    }\r\n    res->hdc = hdc;\r\n    return res;\r\n}\r\n\r\nvoid UpdateBitmapColors(HBITMAP hbmp, COLORREF textColor, COLORREF bgColor) {\r\n    if ((textColor & 0xFFFFFF) == WIN_COL_BLACK && (bgColor & 0xFFFFFF) == WIN_COL_WHITE)\r\n        return;\r\n\r\n    // color order in DIB is blue-green-red-alpha\r\n    int base[4] = { GetBValueSafe(textColor), GetGValueSafe(textColor), GetRValueSafe(textColor),\r\n                    0 };\r\n    int diff[4] = { GetBValueSafe(bgColor) - base[0], GetGValueSafe(bgColor) - base[1],\r\n                    GetRValueSafe(bgColor) - base[2], 255 };\r\n\r\n    DIBSECTION info = { 0 };\r\n    int ret = GetObject(hbmp, sizeof(info), &info);\r\n    CrashIf(ret < sizeof(info.dsBm));\r\n    SizeI size(info.dsBm.bmWidth, info.dsBm.bmHeight);\r\n\r\n    // for mapped 32-bit DI bitmaps: directly access the pixel data\r\n    if (ret >= sizeof(info.dsBm) && info.dsBm.bmBits && 32 == info.dsBm.bmBitsPixel &&\r\n        size.dx * 4 == info.dsBm.bmWidthBytes) {\r\n        int bmpBytes = size.dx * size.dy * 4;\r\n        uint8 *bmpData = (uint8 *)info.dsBm.bmBits;\r\n        for (int i = 0; i < bmpBytes; i++) {\r\n            int k = i % 4;\r\n            bmpData[i] = (uint8)(base[k] + mul255(bmpData[i], diff[k]));\r\n        }\r\n        return;\r\n    }\r\n\r\n    // for mapped 24-bit DI bitmaps: directly access the pixel data\r\n    if (ret >= sizeof(info.dsBm) && info.dsBm.bmBits && 24 == info.dsBm.bmBitsPixel &&\r\n        info.dsBm.bmWidthBytes >= size.dx * 3) {\r\n        uint8 *bmpData = (uint8 *)info.dsBm.bmBits;\r\n        for (int y = 0; y < size.dy; y++) {\r\n            for (int x = 0; x < size.dx * 3; x++) {\r\n                int k = x % 3;\r\n                bmpData[x] = (uint8)(base[k] + mul255(bmpData[x], diff[k]));\r\n            }\r\n            bmpData += info.dsBm.bmWidthBytes;\r\n        }\r\n        return;\r\n    }\r\n\r\n    // for paletted DI bitmaps: only update the color palette\r\n    if (sizeof(info) == ret && info.dsBmih.biBitCount && info.dsBmih.biBitCount <= 8) {\r\n        CrashIf(info.dsBmih.biBitCount != 8);\r\n        RGBQUAD palette[256];\r\n        HDC hDC = CreateCompatibleDC(nullptr);\r\n        DeleteObject(SelectObject(hDC, hbmp));\r\n        UINT num = GetDIBColorTable(hDC, 0, dimof(palette), palette);\r\n        for (UINT i = 0; i < num; i++) {\r\n            palette[i].rgbRed = (uint8)(base[2] + mul255(palette[i].rgbRed, diff[2]));\r\n            palette[i].rgbGreen = (uint8)(base[1] + mul255(palette[i].rgbGreen, diff[1]));\r\n            palette[i].rgbBlue = (uint8)(base[0] + mul255(palette[i].rgbBlue, diff[0]));\r\n        }\r\n        if (num > 0)\r\n            SetDIBColorTable(hDC, 0, num, palette);\r\n        DeleteDC(hDC);\r\n        return;\r\n    }\r\n\r\n    BITMAPINFO bmi = { 0 };\r\n    bmi.bmiHeader.biSize = sizeof(bmi.bmiHeader);\r\n    bmi.bmiHeader.biWidth = size.dx;\r\n    bmi.bmiHeader.biHeight = size.dy;\r\n    bmi.bmiHeader.biPlanes = 1;\r\n    bmi.bmiHeader.biBitCount = 32;\r\n    bmi.bmiHeader.biCompression = BI_RGB;\r\n\r\n    HDC hDC = CreateCompatibleDC(nullptr);\r\n    int bmpBytes = size.dx * size.dy * 4;\r\n    ScopedMem<uint8> bmpData((uint8 *)malloc(bmpBytes));\r\n    CrashIf(!bmpData);\r\n\r\n    if (GetDIBits(hDC, hbmp, 0, size.dy, bmpData, &bmi, DIB_RGB_COLORS)) {\r\n        for (int i = 0; i < bmpBytes; i++) {\r\n            int k = i % 4;\r\n            bmpData[i] = (uint8)(base[k] + mul255(bmpData[i], diff[k]));\r\n        }\r\n        SetDIBits(hDC, hbmp, 0, size.dy, bmpData, &bmi, DIB_RGB_COLORS);\r\n    }\r\n\r\n    DeleteDC(hDC);\r\n}\r\n\r\n// create data for a .bmp file from this bitmap (if saved to disk, the HBITMAP\r\n// can be deserialized with LoadImage(nullptr, ..., LD_LOADFROMFILE) and its\r\n// dimensions determined again with GetBitmapSize(...))\r\nunsigned char *SerializeBitmap(HBITMAP hbmp, size_t *bmpBytesOut) {\r\n    SizeI size = GetBitmapSize(hbmp);\r\n    DWORD bmpHeaderLen = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFO);\r\n    DWORD bmpBytes = ((size.dx * 3 + 3) / 4) * 4 * size.dy + bmpHeaderLen;\r\n    unsigned char *bmpData = AllocArray<unsigned char>(bmpBytes);\r\n    if (!bmpData)\r\n        return nullptr;\r\n\r\n    BITMAPINFO *bmi = (BITMAPINFO *)(bmpData + sizeof(BITMAPFILEHEADER));\r\n    bmi->bmiHeader.biSize = sizeof(bmi->bmiHeader);\r\n    bmi->bmiHeader.biWidth = size.dx;\r\n    bmi->bmiHeader.biHeight = size.dy;\r\n    bmi->bmiHeader.biPlanes = 1;\r\n    bmi->bmiHeader.biBitCount = 24;\r\n    bmi->bmiHeader.biCompression = BI_RGB;\r\n\r\n    HDC hDC = GetDC(nullptr);\r\n    if (GetDIBits(hDC, hbmp, 0, size.dy, bmpData + bmpHeaderLen, bmi, DIB_RGB_COLORS)) {\r\n        BITMAPFILEHEADER *bmpfh = (BITMAPFILEHEADER *)bmpData;\r\n        bmpfh->bfType = MAKEWORD('B', 'M');\r\n        bmpfh->bfOffBits = bmpHeaderLen;\r\n        bmpfh->bfSize = bmpBytes;\r\n    } else {\r\n        free(bmpData);\r\n        bmpData = nullptr;\r\n    }\r\n    ReleaseDC(nullptr, hDC);\r\n\r\n    if (bmpBytesOut)\r\n        *bmpBytesOut = bmpBytes;\r\n    return bmpData;\r\n}\r\n\r\nHBITMAP CreateMemoryBitmap(SizeI size, HANDLE *hDataMapping) {\r\n    BITMAPINFO bmi = { 0 };\r\n    bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);\r\n    bmi.bmiHeader.biWidth = size.dx;\r\n    bmi.bmiHeader.biHeight = -size.dy;\r\n    bmi.bmiHeader.biPlanes = 1;\r\n    bmi.bmiHeader.biCompression = BI_RGB;\r\n    // trading speed for memory (32 bits yields far better performance)\r\n    bmi.bmiHeader.biBitCount = 32;\r\n    bmi.bmiHeader.biSizeImage = size.dx * 4 * size.dy;\r\n\r\n    void *data = nullptr;\r\n    if (hDataMapping && !*hDataMapping)\r\n        *hDataMapping = CreateFileMapping(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0,\r\n                                          bmi.bmiHeader.biSizeImage, nullptr);\r\n    return CreateDIBSection(nullptr, &bmi, DIB_RGB_COLORS, &data,\r\n                            hDataMapping ? *hDataMapping : nullptr, 0);\r\n}\r\n\r\nCOLORREF AdjustLightness(COLORREF c, float factor) {\r\n    BYTE R = GetRValueSafe(c), G = GetGValueSafe(c), B = GetBValueSafe(c);\r\n    // cf. http://en.wikipedia.org/wiki/HSV_color_space#Hue_and_chroma\r\n    BYTE M = std::max(std::max(R, G), B), m = std::min(std::min(R, G), B);\r\n    if (M == m) {\r\n        // for grayscale values, lightness is proportional to the color value\r\n        BYTE X = (BYTE)limitValue((int)floorf(M * factor + 0.5f), 0, 255);\r\n        return RGB(X, X, X);\r\n    }\r\n    BYTE C = M - m;\r\n    BYTE Ha = (BYTE)abs(M == R ? G - B : M == G ? B - R : R - G);\r\n    // cf. http://en.wikipedia.org/wiki/HSV_color_space#Lightness\r\n    float L2 = (float)(M + m);\r\n    // cf. http://en.wikipedia.org/wiki/HSV_color_space#Saturation\r\n    float S = C / (L2 > 255.0f ? 510.0f - L2 : L2);\r\n\r\n    L2 = limitValue(L2 * factor, 0.0f, 510.0f);\r\n    // cf. http://en.wikipedia.org/wiki/HSV_color_space#From_HSL\r\n    float C1 = (L2 > 255.0f ? 510.0f - L2 : L2) * S;\r\n    float X1 = C1 * Ha / C;\r\n    float m1 = (L2 - C1) / 2;\r\n    R = (BYTE)floorf((M == R ? C1 : m != R ? X1 : 0) + m1 + 0.5f);\r\n    G = (BYTE)floorf((M == G ? C1 : m != G ? X1 : 0) + m1 + 0.5f);\r\n    B = (BYTE)floorf((M == B ? C1 : m != B ? X1 : 0) + m1 + 0.5f);\r\n    return RGB(R, G, B);\r\n}\r\n\r\n// cf. http://en.wikipedia.org/wiki/HSV_color_space#Lightness\r\nfloat GetLightness(COLORREF c) {\r\n    BYTE R = GetRValueSafe(c), G = GetGValueSafe(c), B = GetBValueSafe(c);\r\n    BYTE M = std::max(std::max(R, G), B), m = std::min(std::min(R, G), B);\r\n    return (M + m) / 2.0f;\r\n}\r\n\r\n// This is meant to measure program startup time from the user perspective.\r\n// One place to measure it is at the beginning of WinMain().\r\n// Another place is on the first run of WM_PAINT of the message loop of main window.\r\ndouble GetProcessRunningTime() {\r\n    FILETIME currTime, startTime, d1, d2, d3;\r\n    GetSystemTimeAsFileTime(&currTime);\r\n    HANDLE hproc = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, GetCurrentProcessId());\r\n    double timeInMs = 0;\r\n    if (!hproc)\r\n        return 0;\r\n    if (GetProcessTimes(hproc, &startTime, &d1, &d2, &d3)) {\r\n        ULARGE_INTEGER start = FileTimeToLargeInteger(startTime);\r\n        ULARGE_INTEGER curr = FileTimeToLargeInteger(currTime);\r\n        ULONGLONG diff = curr.QuadPart - start.QuadPart;\r\n        // FILETIME is in 100 ns chunks\r\n        timeInMs = ((double)(diff * 100)) / (double)1000000;\r\n    }\r\n    CloseHandle(hproc);\r\n    return timeInMs;\r\n}\r\n\r\n// This is just to satisfy /analyze. CloseHandle(nullptr) works perfectly fine\r\n// but /analyze complains anyway\r\nBOOL SafeCloseHandle(HANDLE *h) {\r\n    if (!*h)\r\n        return TRUE;\r\n    BOOL ok = CloseHandle(*h);\r\n    *h = nullptr;\r\n    return ok;\r\n}\r\n\r\n// This is just to satisfy /analyze. DestroyWindow(nullptr) works perfectly fine\r\n// but /analyze complains anyway\r\nBOOL SafeDestroyWindow(HWND *hwnd) {\r\n    if (!hwnd || !*hwnd)\r\n        return TRUE;\r\n    BOOL ok = DestroyWindow(*hwnd);\r\n    *hwnd = nullptr;\r\n    return ok;\r\n}\r\n\r\n// based on http://mdb-blog.blogspot.com/2013/01/nsis-lunch-program-as-user-from-uac.html\r\n// uses $WINDIR\\explorer.exe to launch cmd\r\n// Other promising approaches:\r\n// - http://blogs.msdn.com/b/oldnewthing/archive/2013/11/18/10468726.aspx\r\n// - http://brandonlive.com/2008/04/27/getting-the-shell-to-run-an-application-for-you-part-2-how/\r\n// - http://www.codeproject.com/Articles/23090/Creating-a-process-with-Medium-Integration-Level-f\r\n// Approaches tried but didn't work:\r\n// - http://stackoverflow.com/questions/3298611/run-my-program-asuser\r\n// - using CreateProcessAsUser() with hand-crafted token\r\n// It'll always run the process, might fail to run non-elevated if fails to find explorer.exe\r\n// Also, if explorer.exe is running elevated, it'll probably run elevated as well.\r\nvoid RunNonElevated(const WCHAR *exePath) {\r\n    ScopedMem<WCHAR> cmd, explorerPath;\r\n    WCHAR buf[MAX_PATH] = { 0 };\r\n    UINT res = GetWindowsDirectory(buf, dimof(buf));\r\n    if (0 == res || res >= dimof(buf))\r\n        goto Run;\r\n    explorerPath.Set(path::Join(buf, L\"explorer.exe\"));\r\n    if (!file::Exists(explorerPath))\r\n        goto Run;\r\n    cmd.Set(str::Format(L\"\\\"%s\\\" \\\"%s\\\"\", explorerPath.Get(), exePath));\r\nRun:\r\n    HANDLE h = LaunchProcess(cmd ? cmd : exePath);\r\n    SafeCloseHandle(&h);\r\n}\r\n\r\nvoid ResizeHwndToClientArea(HWND hwnd, int dx, int dy, bool hasMenu) {\r\n    WINDOWINFO wi = { 0 };\r\n    wi.cbSize = sizeof(wi);\r\n    GetWindowInfo(hwnd, &wi);\r\n\r\n    RECT r = { 0 };\r\n    r.right = dx;\r\n    r.bottom = dy;\r\n    DWORD style = wi.dwStyle;\r\n    DWORD exStyle = wi.dwExStyle;\r\n    AdjustWindowRectEx(&r, style, hasMenu, exStyle);\r\n    if ((dx == RectDx(wi.rcClient)) && (dy == RectDy(wi.rcClient)))\r\n        return;\r\n\r\n    dx = RectDx(r);\r\n    dy = RectDy(r);\r\n    int x = wi.rcWindow.left;\r\n    int y = wi.rcWindow.top;\r\n    MoveWindow(hwnd, x, y, dx, dy, TRUE);\r\n}\r\n\r\n// -1 to use existing value\r\nvoid ResizeWindow(HWND hwnd, int dx, int dy) {\r\n    RECT rc;\r\n    GetWindowRect(hwnd, &rc);\r\n    if (dx == -1) {\r\n        dx = RectDx(rc);\r\n    }\r\n    if (dy == -1) {\r\n        dy = RectDy(rc);\r\n    }\r\n    SetWindowPos(hwnd, nullptr, 0, 0, dx, dy, SWP_NOMOVE | SWP_NOZORDER);\r\n}\r\n\r\nvoid ScheduleRepaint(HWND hwnd) {\r\n    InvalidateRect(hwnd, nullptr, FALSE);\r\n}\r\n\r\n// do WM_PAINT immediately\r\nvoid RepaintNow(HWND hwnd) {\r\n    InvalidateRect(hwnd, nullptr, FALSE);\r\n    UpdateWindow(hwnd);\r\n}\r\n\r\nvoid VariantInitBstr(VARIANT &urlVar, const WCHAR *s) {\r\n    VariantInit(&urlVar);\r\n    urlVar.vt = VT_BSTR;\r\n    urlVar.bstrVal = SysAllocString(s);\r\n}\r\n\r\nchar *LoadTextResource(int resId, size_t *sizeOut) {\r\n    HRSRC resSrc = FindResource(nullptr, MAKEINTRESOURCE(resId), RT_RCDATA);\r\n    CrashIf(!resSrc);\r\n    HGLOBAL res = LoadResource(nullptr, resSrc);\r\n    CrashIf(!res);\r\n    DWORD size = SizeofResource(nullptr, resSrc);\r\n    const char *resData = (const char *)LockResource(res);\r\n    char *s = str::DupN(resData, size);\r\n    if (sizeOut)\r\n        *sizeOut = size;\r\n    UnlockResource(res);\r\n    return s;\r\n}\r\n\r\nstatic HDDEDATA CALLBACK DdeCallback(UINT uType, UINT uFmt, HCONV hconv, HSZ hsz1, HSZ hsz2,\r\n                                     HDDEDATA hdata, ULONG_PTR dwData1, ULONG_PTR dwData2) {\r\n    UNUSED(uType);\r\n    UNUSED(uFmt);\r\n    UNUSED(hconv);\r\n    UNUSED(hsz1);\r\n    UNUSED(hsz2);\r\n    UNUSED(hdata);\r\n    UNUSED(dwData1);\r\n    UNUSED(dwData2);\r\n    return 0;\r\n}\r\n\r\nbool DDEExecute(const WCHAR *server, const WCHAR *topic, const WCHAR *command) {\r\n    DWORD inst = 0;\r\n    HSZ hszServer = nullptr, hszTopic = nullptr;\r\n    HCONV hconv = nullptr;\r\n    bool ok = false;\r\n    UINT result = 0;\r\n    DWORD cbLen = 0;\r\n    HDDEDATA answer;\r\n\r\n    CrashIf(str::Len(command) >= INT_MAX - 1);\r\n    if (str::Len(command) >= INT_MAX - 1)\r\n        return false;\r\n\r\n    result = DdeInitialize(&inst, DdeCallback, APPCMD_CLIENTONLY, 0);\r\n    if (result != DMLERR_NO_ERROR)\r\n        return false;\r\n\r\n    hszServer = DdeCreateStringHandle(inst, server, CP_WINNEUTRAL);\r\n    if (!hszServer)\r\n        goto Exit;\r\n    hszTopic = DdeCreateStringHandle(inst, topic, CP_WINNEUTRAL);\r\n    if (!hszTopic)\r\n        goto Exit;\r\n    hconv = DdeConnect(inst, hszServer, hszTopic, nullptr);\r\n    if (!hconv)\r\n        goto Exit;\r\n\r\n    cbLen = ((DWORD)str::Len(command) + 1) * sizeof(WCHAR);\r\n    answer = DdeClientTransaction((BYTE *)command, cbLen, hconv, 0, CF_UNICODETEXT, XTYP_EXECUTE,\r\n                                  10000, nullptr);\r\n    if (answer) {\r\n        DdeFreeDataHandle(answer);\r\n        ok = true;\r\n    }\r\n\r\nExit:\r\n    if (hconv)\r\n        DdeDisconnect(hconv);\r\n    if (hszTopic)\r\n        DdeFreeStringHandle(inst, hszTopic);\r\n    if (hszServer)\r\n        DdeFreeStringHandle(inst, hszServer);\r\n    DdeUninitialize(inst);\r\n\r\n    return ok;\r\n}\r\n\r\n// given r,  sets r1, r2 and r3 so that:\r\n//  [         r       ]\r\n//  [ r1 ][  r2 ][ r3 ]\r\n//        ^     ^\r\n//        y     y+dy\r\nvoid DivideRectV(const RECT &r, int x, int dx, RECT &r1, RECT &r2, RECT &r3) {\r\n    r1 = r2 = r3 = r;\r\n    r1.right = x;\r\n    r2.left = x;\r\n    r2.right = x + dx;\r\n    r3.left = x + dx + 1;\r\n}\r\n\r\n// like DivideRectV\r\nvoid DivideRectH(const RECT &r, int y, int dy, RECT &r1, RECT &r2, RECT &r3) {\r\n    r1 = r2 = r3 = r;\r\n    r1.bottom = y;\r\n    r2.top = y;\r\n    r2.bottom = y + dy;\r\n    r3.top = y + dy + 1;\r\n}\r\n\r\nvoid RectInflateTB(RECT &r, int top, int bottom) {\r\n    r.top += top;\r\n    r.bottom += bottom;\r\n}\r\n\r\nstatic LPWSTR knownCursorIds[] = { IDC_ARROW,  IDC_IBEAM,  IDC_HAND, IDC_SIZEALL,\r\n                                   IDC_SIZEWE, IDC_SIZENS, IDC_NO,   IDC_CROSS };\r\n\r\nstatic HCURSOR cachedCursors[dimof(knownCursorIds)] = {};\r\n\r\nHCURSOR GetCursor(LPWSTR id) {\r\n    int cursorIdx = -1;\r\n    for (int i = 0; i < dimof(knownCursorIds); i++) {\r\n        if (id == knownCursorIds[i]) {\r\n            cursorIdx = i;\r\n            break;\r\n        }\r\n    }\r\n    CrashIf(cursorIdx == -1);\r\n    if (nullptr == cachedCursors[cursorIdx]) {\r\n        cachedCursors[cursorIdx] = LoadCursor(nullptr, id);\r\n        CrashIf(cachedCursors[cursorIdx] == nullptr);\r\n    }\r\n    return cachedCursors[cursorIdx];\r\n}\r\n\r\nvoid SetCursor(LPWSTR id) { SetCursor(GetCursor(id)); }\r\n\r\nvoid DeleteCachedCursors() {\r\n    for (int i = 0; i < dimof(knownCursorIds); i++) {\r\n        HCURSOR cur = cachedCursors[i];\r\n        if (cur) {\r\n            DestroyCursor(cur);\r\n            cachedCursors[i] = NULL;\r\n        }\r\n    }\r\n}\r\n\r\n// 0 - metric (centimeters etc.)\r\n// 1 - imperial (inches etc.)\r\n// this triggers drmemory. Force no inlining so that it's easy to write a\r\n// localized suppression\r\n__declspec(noinline) int GetMeasurementSystem() {\r\n    WCHAR unitSystem[2] = { 0 };\r\n    GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_IMEASURE, unitSystem, dimof(unitSystem));\r\n    if (unitSystem[0] == '0') {\r\n        return 0;\r\n    }\r\n    return 1;\r\n}\r\n\r\n"
  },
  {
    "path": "src/utils/WinUtil.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// the following are only defined if _WIN32_WINNT >= 0x0600 and we use 0x0500\r\n#ifndef USER_DEFAULT_SCREEN_DPI\r\n#define USER_DEFAULT_SCREEN_DPI 96\r\n#endif\r\n#ifndef WM_MOUSEHWHEEL\r\n#define WM_MOUSEHWHEEL 0x020E\r\n#endif\r\n\r\n#define NO_COLOR (COLORREF) - 1\r\n\r\n#define WIN_COL_WHITE RGB(0xff, 0xff, 0xff)\r\n#define WIN_COL_BLACK RGB(0, 0, 0)\r\n\r\n#define DRAGQUERY_NUMFILES 0xFFFFFFFF\r\n\r\ninline int RectDx(const RECT &r) { return r.right - r.left; }\r\ninline int RectDy(const RECT &r) { return r.bottom - r.top; }\r\n\r\nvoid Edit_SelectAll(HWND hwnd);\r\nvoid ListBox_AppendString_NoSort(HWND hwnd, WCHAR *txt);\r\n\r\nBOOL SafeCloseHandle(HANDLE *h);\r\nBOOL SafeDestroyWindow(HWND *hwnd);\r\nvoid FillWndClassEx(WNDCLASSEX &wcex, const WCHAR *clsName, WNDPROC wndproc);\r\nvoid MoveWindow(HWND hwnd, RectI rect);\r\nvoid MoveWindow(HWND hwnd, RECT *r);\r\n\r\nbool IsOs64();\r\nbool IsProcess64();\r\nbool IsRunningInWow64();\r\nbool IsProcessAndOsArchSame();\r\nbool IsVistaOrGreater();\r\nvoid GetOsVersion(OSVERSIONINFOEX& ver);\r\nbool IsWin10();\r\nbool IsWin7();\r\n\r\nvoid LogLastError(DWORD err = 0);\r\nbool RegKeyExists(HKEY keySub, const WCHAR *keyName);\r\nWCHAR *ReadRegStr(HKEY keySub, const WCHAR *keyName, const WCHAR *valName);\r\nbool WriteRegStr(HKEY keySub, const WCHAR *keyName, const WCHAR *valName, const WCHAR *value);\r\nbool ReadRegDWORD(HKEY keySub, const WCHAR *keyName, const WCHAR *valName, DWORD &value);\r\nbool WriteRegDWORD(HKEY keySub, const WCHAR *keyName, const WCHAR *valName, DWORD value);\r\nbool CreateRegKey(HKEY keySub, const WCHAR *keyName);\r\nbool DeleteRegKey(HKEY keySub, const WCHAR *keyName, bool resetACLFirst = false);\r\nWCHAR *GetSpecialFolder(int csidl, bool createIfMissing = false);\r\n\r\nvoid DisableDataExecution();\r\nvoid RedirectIOToConsole();\r\nWCHAR *GetExePath();\r\nint FileTimeDiffInSecs(const FILETIME &ft1, const FILETIME &ft2);\r\n\r\nWCHAR *ResolveLnk(const WCHAR *path);\r\nbool CreateShortcut(const WCHAR *shortcutPath, const WCHAR *exePath, const WCHAR *args = nullptr,\r\n                    const WCHAR *description = nullptr, int iconIndex = 0);\r\nIDataObject *GetDataObjectForFile(const WCHAR *filePath, HWND hwnd = nullptr);\r\nDWORD GetFileVersion(const WCHAR *path);\r\n\r\ninline bool IsKeyPressed(int key) { return GetKeyState(key) & 0x8000 ? true : false; }\r\ninline bool IsShiftPressed() { return IsKeyPressed(VK_SHIFT); }\r\ninline bool IsAltPressed() { return IsKeyPressed(VK_MENU); }\r\ninline bool IsCtrlPressed() { return IsKeyPressed(VK_CONTROL); }\r\n\r\nHFONT CreateSimpleFont(HDC hdc, const WCHAR *fontName, int fontSize);\r\n\r\nRectI ShiftRectToWorkArea(RectI rect, bool bFully = false);\r\nRectI GetWorkAreaRect(RectI rect);\r\nRectI GetFullscreenRect(HWND hwnd);\r\nRectI GetVirtualScreenRect();\r\n\r\nbool LaunchFile(const WCHAR *path, const WCHAR *params = nullptr, const WCHAR *verb = nullptr,\r\n                bool hidden = false);\r\nHANDLE LaunchProcess(const WCHAR *cmdLine, const WCHAR *currDir = nullptr, DWORD flags = 0);\r\n\r\nvoid PaintRect(HDC hdc, const RectI &rect);\r\nvoid PaintLine(HDC hdc, const RectI &rect);\r\nvoid DrawCenteredText(HDC hdc, const RectI &r, const WCHAR *txt, bool isRTL = false);\r\nvoid DrawCenteredText(HDC hdc, const RECT &r, const WCHAR *txt, bool isRTL = false);\r\nSizeI TextSizeInHwnd(HWND hwnd, const WCHAR *txt);\r\n\r\nbool IsCursorOverWindow(HWND hwnd);\r\nbool GetCursorPosInHwnd(HWND hwnd, PointI &posOut);\r\nvoid CenterDialog(HWND hDlg, HWND hParent = nullptr);\r\nWCHAR *GetDefaultPrinterName();\r\nbool CopyTextToClipboard(const WCHAR *text, bool appendOnly = false);\r\nbool CopyImageToClipboard(HBITMAP hbmp, bool appendOnly);\r\nvoid ToggleWindowStyle(HWND hwnd, DWORD flag, bool enable, int type = GWL_STYLE);\r\nRectI ChildPosWithinParent(HWND hwnd);\r\nHFONT GetDefaultGuiFont();\r\n\r\nIStream *CreateStreamFromData(const void *data, size_t len);\r\nvoid *GetDataFromStream(IStream *stream, size_t *len, HRESULT *res_opt = nullptr);\r\nbool ReadDataFromStream(IStream *stream, void *buffer, size_t len, size_t offset = 0);\r\nUINT GuessTextCodepage(const char *data, size_t len, UINT defVal = CP_ACP);\r\nWCHAR *NormalizeString(const WCHAR *str, int /* NORM_FORM */ form);\r\nbool IsRtl(HWND hwnd);\r\nvoid ResizeHwndToClientArea(HWND hwnd, int dx, int dy, bool hasMenu);\r\nvoid ResizeWindow(HWND, int dx, int dy);\r\n\r\n// schedule WM_PAINT at window's leasure\r\nvoid ScheduleRepaint(HWND hwnd);\r\n\r\n// do WM_PAINT immediately\r\nvoid RepaintNow(HWND hwnd);\r\n\r\ninline BOOL toBOOL(bool b) { return b ? TRUE : FALSE; }\r\n\r\nnamespace win {\r\n\r\nvoid ToForeground(HWND hwnd);\r\n\r\nsize_t GetTextLen(HWND hwnd);\r\nWCHAR *GetText(HWND hwnd);\r\n\r\nvoid SetText(HWND hwnd, const WCHAR *txt);\r\nvoid SetVisibility(HWND hwnd, bool visible);\r\nbool HasFrameThickness(HWND hwnd);\r\nbool HasCaption(HWND hwnd);\r\n\r\nnamespace menu {\r\nvoid SetChecked(HMENU m, UINT id, bool isChecked);\r\nbool SetEnabled(HMENU m, UINT id, bool isEnabled);\r\nvoid Remove(HMENU m, UINT id);\r\nvoid Empty(HMENU m);\r\nvoid SetText(HMENU m, UINT id, WCHAR *s);\r\nconst WCHAR *ToSafeString(const WCHAR *str, ScopedMem<WCHAR> &newStr);\r\n\r\n} // namespace menu\r\n\r\n} // namespace win\r\n\r\nclass DoubleBuffer {\r\n    HWND hTarget;\r\n    HDC hdcCanvas, hdcBuffer;\r\n    HBITMAP doubleBuffer;\r\n    RectI rect;\r\n\r\n  public:\r\n    DoubleBuffer(HWND hwnd, RectI rect);\r\n    ~DoubleBuffer();\r\n\r\n    HDC GetDC() const { return hdcBuffer ? hdcBuffer : hdcCanvas; }\r\n    void Flush(HDC hdc);\r\n};\r\n\r\nclass DeferWinPosHelper {\r\n    HDWP hdwp;\r\n\r\n  public:\r\n    DeferWinPosHelper();\r\n    ~DeferWinPosHelper();\r\n    void End();\r\n    void SetWindowPos(HWND hWnd, HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT uFlags);\r\n    void MoveWindow(HWND hWnd, int x, int y, int cx, int cy, BOOL bRepaint = TRUE);\r\n    void MoveWindow(HWND hWnd, RectI r);\r\n};\r\n\r\nstruct BitmapPixels {\r\n    uint8*      pixels;\r\n    SizeI       size;\r\n    int         nBytes;\r\n    int         nBytesPerPixel;\r\n    int         nBytesPerRow;\r\n\r\n    HBITMAP     hbmp;\r\n    BITMAPINFO  bmi;\r\n    HDC         hdc;\r\n};\r\n\r\nvoid InitAllCommonControls();\r\nSizeI GetBitmapSize(HBITMAP hbmp);\r\nBitmapPixels *GetBitmapPixels(HBITMAP hbmp);\r\nvoid FinalizeBitmapPixels(BitmapPixels* bitmapPixels);\r\nCOLORREF GetPixel(BitmapPixels *bitmap, int x, int y);\r\nvoid UpdateBitmapColors(HBITMAP hbmp, COLORREF textColor, COLORREF bgColor);\r\nunsigned char *SerializeBitmap(HBITMAP hbmp, size_t *bmpBytesOut);\r\nHBITMAP CreateMemoryBitmap(SizeI size, HANDLE *hDataMapping = nullptr);\r\nCOLORREF AdjustLightness(COLORREF c, float factor);\r\nfloat GetLightness(COLORREF c);\r\ndouble GetProcessRunningTime();\r\n\r\nvoid RunNonElevated(const WCHAR *exePath);\r\nvoid VariantInitBstr(VARIANT &urlVar, const WCHAR *s);\r\nchar *LoadTextResource(int resId, size_t *sizeOut = nullptr);\r\nbool DDEExecute(const WCHAR *server, const WCHAR *topic, const WCHAR *command);\r\n\r\nvoid RectInflateTB(RECT &r, int top, int bottom);\r\nvoid DivideRectH(const RECT &r, int y, int dy, RECT &r1, RECT &r2, RECT &r3);\r\nvoid DivideRectV(const RECT &r, int x, int dx, RECT &r1, RECT &r2, RECT &r3);\r\n\r\nHCURSOR GetCursor(LPWSTR id);\r\nvoid SetCursor(LPWSTR id);\r\nvoid DeleteCachedCursors();\r\n\r\nint GetMeasurementSystem();\r\n"
  },
  {
    "path": "src/utils/ZipUtil.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#define __STDC_LIMIT_MACROS\r\n#include \"BaseUtil.h\"\r\n#include \"ZipUtil.h\"\r\n\r\n#include \"ByteWriter.h\"\r\n#include \"DirIter.h\"\r\n#include \"FileUtil.h\"\r\n\r\nextern \"C\" {\r\n#include <unarr.h>\r\n#include <zlib.h>\r\n}\r\n\r\nZipFileAlloc::ZipFileAlloc(const WCHAR *path, bool deflatedOnly, Allocator *allocator) :\r\n    ar(nullptr), filenames(0, allocator), filepos(0, allocator), allocator(allocator)\r\n{\r\n    data = ar_open_file_w(path);\r\n    if (data)\r\n        ar = ar_open_zip_archive(data, deflatedOnly);\r\n    ExtractFilenames();\r\n}\r\n\r\nZipFileAlloc::ZipFileAlloc(IStream *stream, bool deflatedOnly, Allocator *allocator) :\r\n    ar(nullptr), filenames(0, allocator), filepos(0, allocator), allocator(allocator)\r\n{\r\n    data = ar_open_istream(stream);\r\n    if (data)\r\n        ar = ar_open_zip_archive(data, deflatedOnly);\r\n    ExtractFilenames();\r\n}\r\n\r\nZipFileAlloc::~ZipFileAlloc()\r\n{\r\n    ar_close_archive(ar);\r\n    ar_close(data);\r\n}\r\n\r\nvoid ZipFileAlloc::ExtractFilenames()\r\n{\r\n    if (!ar)\r\n        return;\r\n    while (ar_parse_entry(ar)) {\r\n        const char *nameUtf8 = ar_entry_get_name(ar);\r\n        if (nameUtf8) {\r\n            int len = MultiByteToWideChar(CP_UTF8, 0, nameUtf8, -1, nullptr, 0);\r\n            WCHAR *name = Allocator::Alloc<WCHAR>(allocator, len);\r\n            str::Utf8ToWcharBuf(nameUtf8, str::Len(nameUtf8), name, len);\r\n            filenames.Append(name);\r\n        }\r\n        else\r\n            filenames.Append(nullptr);\r\n        filepos.Append(ar_entry_get_offset(ar));\r\n    }\r\n}\r\n\r\nsize_t ZipFileAlloc::GetFileIndex(const WCHAR *fileName)\r\n{\r\n    return filenames.FindI(fileName);\r\n}\r\n\r\nsize_t ZipFileAlloc::GetFileCount() const\r\n{\r\n    CrashIf(filenames.Count() != filepos.Count());\r\n    return filenames.Count();\r\n}\r\n\r\nconst WCHAR *ZipFileAlloc::GetFileName(size_t fileindex)\r\n{\r\n    if (fileindex >= filenames.Count())\r\n        return nullptr;\r\n    return filenames.At(fileindex);\r\n}\r\n\r\nchar *ZipFileAlloc::GetFileDataByName(const WCHAR *fileName, size_t *len)\r\n{\r\n    return GetFileDataByIdx(GetFileIndex(fileName), len);\r\n}\r\n\r\nchar *ZipFileAlloc::GetFileDataByIdx(size_t fileindex, size_t *len)\r\n{\r\n    if (!ar)\r\n        return nullptr;\r\n    if (fileindex >= filenames.Count())\r\n        return nullptr;\r\n\r\n    if (!ar_parse_entry_at(ar, filepos.At(fileindex)))\r\n        return nullptr;\r\n\r\n    size_t size = ar_entry_get_size(ar);\r\n    if (size > SIZE_MAX - 3)\r\n        return nullptr;\r\n    char *data = (char *)Allocator::Alloc(allocator, size + 3);\r\n    if (!data)\r\n        return nullptr;\r\n    if (!ar_entry_uncompress(ar, data, size)) {\r\n        Allocator::Free(allocator, data);\r\n        return nullptr;\r\n    }\r\n    // zero-terminate for convenience\r\n    data[size] = data[size + 1] = data[size + 2] = '\\0';\r\n\r\n    if (len)\r\n        *len = size;\r\n    return data;\r\n}\r\n\r\nFILETIME ZipFileAlloc::GetFileTime(const WCHAR *fileName)\r\n{\r\n    return GetFileTime(GetFileIndex(fileName));\r\n}\r\n\r\nFILETIME ZipFileAlloc::GetFileTime(size_t fileindex)\r\n{\r\n    FILETIME ft = { (DWORD)-1, (DWORD)-1 };\r\n    if (ar && fileindex < filepos.Count() && ar_parse_entry_at(ar, filepos.At(fileindex))) {\r\n        time64_t filetime = ar_entry_get_filetime(ar);\r\n        LocalFileTimeToFileTime((FILETIME *)&filetime, &ft);\r\n    }\r\n    return ft;\r\n}\r\n\r\nchar *ZipFileAlloc::GetComment(size_t *len)\r\n{\r\n    if (!ar)\r\n        return nullptr;\r\n    size_t commentLen = ar_get_global_comment(ar, nullptr, 0);\r\n    char *comment = (char *)Allocator::Alloc(allocator, commentLen + 1);\r\n    if (!comment)\r\n        return nullptr;\r\n    size_t read = ar_get_global_comment(ar, comment, commentLen);\r\n    if (read != commentLen) {\r\n        Allocator::Free(allocator, comment);\r\n        return nullptr;\r\n    }\r\n    comment[commentLen] = '\\0';\r\n    if (len)\r\n        *len = commentLen;\r\n    return comment;\r\n}\r\n\r\nbool ZipFileAlloc::UnzipFile(const WCHAR *fileName, const WCHAR *dir, const WCHAR *unzippedName)\r\n{\r\n    size_t len;\r\n    char *data = GetFileDataByName(fileName, &len);\r\n    if (!data)\r\n        return false;\r\n\r\n    str::Str<WCHAR> filePath(MAX_PATH, allocator);\r\n    filePath.Append(dir);\r\n    if (!str::EndsWith(filePath.Get(), L\"\\\\\"))\r\n        filePath.Append(L\"\\\\\");\r\n    if (unzippedName) {\r\n        filePath.Append(unzippedName);\r\n    } else {\r\n        filePath.Append(fileName);\r\n        str::TransChars(filePath.Get(), L\"/\", L\"\\\\\");\r\n    }\r\n\r\n    bool ok = file::WriteAll(filePath.Get(), data, len);\r\n    Allocator::Free(allocator, data);\r\n    return ok;\r\n}\r\n\r\n/***** ZipCreator *****/\r\n\r\nclass FileWriteStream : public ISequentialStream {\r\n    HANDLE hFile;\r\n    LONG refCount;\r\npublic:\r\n    FileWriteStream(const WCHAR *filePath) : refCount(1) {\r\n        hFile = CreateFile(filePath, GENERIC_WRITE, FILE_SHARE_READ, nullptr,\r\n                           CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);\r\n    }\r\n    virtual ~FileWriteStream() {\r\n        CloseHandle(hFile);\r\n    }\r\n    // IUnknown\r\n    IFACEMETHODIMP QueryInterface(REFIID riid, void **ppv) {\r\n        static const QITAB qit[] = { QITABENT(FileWriteStream, ISequentialStream), { 0 } };\r\n        return QISearch(this, qit, riid, ppv);\r\n    }\r\n    IFACEMETHODIMP_(ULONG) AddRef() {\r\n        return InterlockedIncrement(&refCount);\r\n    }\r\n    IFACEMETHODIMP_(ULONG) Release() {\r\n        LONG newCount = InterlockedDecrement(&refCount);\r\n        if (newCount == 0)\r\n            delete this;\r\n        return newCount;\r\n    }\r\n    // ISequentialStream\r\n    IFACEMETHODIMP Read(void *buffer, ULONG size, ULONG *read) {\r\n        UNUSED(buffer); UNUSED(size); UNUSED(read);\r\n        return E_NOTIMPL;\r\n    }\r\n    IFACEMETHODIMP Write(const void *data, ULONG size, ULONG *written) {\r\n        bool ok = WriteFile(hFile, data, size, written, nullptr);\r\n        return ok && *written == size ? S_OK : E_FAIL;\r\n    }\r\n};\r\n\r\nZipCreator::ZipCreator(const WCHAR *zipFilePath) : bytesWritten(0), fileCount(0)\r\n{\r\n    stream = new FileWriteStream(zipFilePath);\r\n}\r\n\r\nZipCreator::ZipCreator(ISequentialStream *stream) : bytesWritten(0), fileCount(0)\r\n{\r\n    stream->AddRef();\r\n    this->stream = stream;\r\n}\r\n\r\nZipCreator::~ZipCreator()\r\n{\r\n    stream->Release();\r\n}\r\n\r\nbool ZipCreator::WriteData(const void *data, size_t size)\r\n{\r\n    ULONG written = 0;\r\n    HRESULT res = stream->Write(data, (ULONG)size, &written);\r\n    if (FAILED(res) || written != size)\r\n        return false;\r\n    bytesWritten += written;\r\n    return true;\r\n}\r\n\r\nstatic uint32_t zip_deflate(void *dst, uint32_t dstlen, const void *src, uint32_t srclen)\r\n{\r\n    z_stream stream = { 0 };\r\n    stream.next_in = (Bytef *)src;\r\n    stream.avail_in = srclen;\r\n    stream.next_out = (Bytef *)dst;\r\n    stream.avail_out = dstlen;\r\n\r\n    uint32_t newdstlen = 0;\r\n    int err = deflateInit2(&stream, Z_DEFAULT_COMPRESSION, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY);\r\n    if (err != Z_OK)\r\n        return 0;\r\n    err = deflate(&stream, Z_FINISH);\r\n    if (Z_STREAM_END == err)\r\n        newdstlen = stream.total_out;\r\n    err = deflateEnd(&stream);\r\n    if (err != Z_OK)\r\n        return 0;\r\n    return newdstlen;\r\n}\r\n\r\nbool ZipCreator::AddFileData(const char *nameUtf8, const void *data, size_t size, uint32_t dosdate)\r\n{\r\n    CrashIf(size >= UINT32_MAX);\r\n    CrashIf(str::Len(nameUtf8) >= UINT16_MAX);\r\n    if (size >= UINT32_MAX)\r\n        return false;\r\n\r\n    size_t fileOffset = bytesWritten;\r\n    uint16_t flags = (1 << 11); // filename is UTF-8\r\n    uInt crc = crc32(0, (const Bytef *)data, (uInt)size);\r\n    size_t namelen = str::Len(nameUtf8);\r\n    if (namelen >= UINT16_MAX)\r\n        return false;\r\n\r\n    uint16_t method = Z_DEFLATED;\r\n    uLongf compressedSize = (uint32_t)size;\r\n    ScopedMem<char> compressed((char *)malloc(size));\r\n    if (!compressed)\r\n        return false;\r\n    compressedSize = zip_deflate(compressed, (uint32_t)size, data, (uint32_t)size);\r\n    if (!compressedSize) {\r\n        method = 0; // Store\r\n        memcpy(compressed.Get(), data, size);\r\n        compressedSize = (uint32_t)size;\r\n    }\r\n\r\n    char localHeader[30];\r\n    ByteWriterLE local(localHeader, sizeof(localHeader));\r\n    local.Write32(0x04034B50); // signature\r\n    local.Write16(20); // version needed to extract\r\n    local.Write16(flags);\r\n    local.Write16(method);\r\n    local.Write32(dosdate);\r\n    local.Write32(crc);\r\n    local.Write32(compressedSize);\r\n    local.Write32((uint32_t)size);\r\n    local.Write16((uint16_t)namelen);\r\n    local.Write16(0); // extra field length\r\n\r\n    bool ok = WriteData(localHeader, sizeof(localHeader)) &&\r\n              WriteData(nameUtf8, namelen) &&\r\n              WriteData(compressed, compressedSize);\r\n\r\n    ByteWriterLE central(centraldir.AppendBlanks(46), 46);\r\n    central.Write32(0x02014B50); // signature\r\n    central.Write16(20); // version made by\r\n    central.Write16(20); // version needed to extract\r\n    central.Write16(flags);\r\n    central.Write16(method);\r\n    central.Write32(dosdate);\r\n    central.Write32(crc);\r\n    central.Write32(compressedSize);\r\n    central.Write32((uint32_t)size);\r\n    central.Write16((uint16_t)namelen);\r\n    central.Write16(0); // extra field length\r\n    central.Write16(0); // file comment length\r\n    central.Write16(0); // disk number\r\n    central.Write16(0); // internal file attributes\r\n    central.Write32(0); // external file attributes\r\n    central.Write32((uint32_t)fileOffset);\r\n    centraldir.Append(nameUtf8, namelen);\r\n\r\n    fileCount++;\r\n    return ok;\r\n}\r\n\r\n// add a given file under (optional) nameInZip\r\nbool ZipCreator::AddFile(const WCHAR *filePath, const WCHAR *nameInZip)\r\n{\r\n    size_t filelen;\r\n    ScopedMem<char> filedata(file::ReadAll(filePath, &filelen));\r\n    if (!filedata)\r\n        return false;\r\n\r\n    uint32_t dosdatetime = 0;\r\n    FILETIME ft = file::GetModificationTime(filePath);\r\n    if (ft.dwLowDateTime || ft.dwHighDateTime) {\r\n        FILETIME ftLocal;\r\n        WORD dosDate, dosTime;\r\n        if (FileTimeToLocalFileTime(&ft, &ftLocal) &&\r\n            FileTimeToDosDateTime(&ftLocal, &dosDate, &dosTime)) {\r\n            dosdatetime = MAKELONG(dosTime, dosDate);\r\n        }\r\n    }\r\n\r\n    if (!nameInZip)\r\n        nameInZip = path::IsAbsolute(filePath) ? path::GetBaseName(filePath) : filePath;\r\n    ScopedMem<char> nameUtf8(str::conv::ToUtf8(nameInZip));\r\n    str::TransChars(nameUtf8, \"\\\\\", \"/\");\r\n\r\n    return AddFileData(nameUtf8, filedata, filelen, dosdatetime);\r\n}\r\n\r\n// we use the filePath relative to dir as the zip name\r\nbool ZipCreator::AddFileFromDir(const WCHAR *filePath, const WCHAR *dir)\r\n{\r\n    if (str::IsEmpty(dir) || !str::StartsWith(filePath, dir))\r\n        return false;\r\n    const WCHAR *nameInZip = filePath + str::Len(dir) + 1;\r\n    if (!path::IsSep(nameInZip[-1]))\r\n        return false;\r\n    return AddFile(filePath, nameInZip);\r\n}\r\n\r\nbool ZipCreator::AddDir(const WCHAR *dirPath, bool recursive)\r\n{\r\n    DirIter di(dirPath, recursive);\r\n    for (const WCHAR *filePath = di.First(); filePath; filePath = di.Next()) {\r\n        if (!AddFileFromDir(filePath, dirPath))\r\n            return false;\r\n    }\r\n    return true;\r\n}\r\n\r\nbool ZipCreator::Finish()\r\n{\r\n    CrashIf(bytesWritten >= UINT32_MAX);\r\n    CrashIf(fileCount >= UINT16_MAX);\r\n    if (bytesWritten >= UINT32_MAX || fileCount >= UINT16_MAX)\r\n        return false;\r\n\r\n    char endOfCentralDir[22];\r\n    ByteWriterLE eocd(endOfCentralDir, sizeof(endOfCentralDir));\r\n    eocd.Write32(0x06054B50); // signature\r\n    eocd.Write16(0); // disk number\r\n    eocd.Write16(0); // disk number of central directory\r\n    eocd.Write16((uint16_t)fileCount);\r\n    eocd.Write16((uint16_t)fileCount);\r\n    eocd.Write32((uint32_t)centraldir.Size());\r\n    eocd.Write32((uint32_t)bytesWritten);\r\n    eocd.Write16(0); // comment len\r\n\r\n    return WriteData(centraldir.Get(), centraldir.Size()) &&\r\n           WriteData(endOfCentralDir, sizeof(endOfCentralDir));\r\n}\r\n\r\nIStream *OpenDirAsZipStream(const WCHAR *dirPath, bool recursive)\r\n{\r\n    if (!dir::Exists(dirPath))\r\n        return nullptr;\r\n\r\n    ScopedComPtr<IStream> stream;\r\n    if (FAILED(CreateStreamOnHGlobal(nullptr, TRUE, &stream)))\r\n        return nullptr;\r\n\r\n    ZipCreator zc(stream);\r\n    if (!zc.AddDir(dirPath, recursive))\r\n        return nullptr;\r\n    if (!zc.Finish())\r\n        return nullptr;\r\n\r\n    stream->AddRef();\r\n    return stream;\r\n}\r\n"
  },
  {
    "path": "src/utils/ZipUtil.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nextern \"C\" {\r\ntypedef struct ar_stream_s ar_stream;\r\ntypedef struct ar_archive_s ar_archive;\r\n}\r\n\r\n// TODO: unused - remove?\r\nclass ZipFileAlloc {\r\n    Allocator *allocator;\r\n    WStrList filenames;\r\n    Vec<int64_t> filepos;\r\n\r\n    ar_stream *data;\r\n    ar_archive *ar;\r\n\r\n    void ExtractFilenames();\r\n\r\npublic:\r\n    explicit ZipFileAlloc(const WCHAR *path, bool deflatedOnly=false, Allocator *allocator=nullptr);\r\n    explicit ZipFileAlloc(IStream *stream, bool deflatedOnly=false, Allocator *allocator=nullptr);\r\n    ~ZipFileAlloc();\r\n\r\n    size_t GetFileCount() const;\r\n    // the result is owned by ZipFileAlloc\r\n    const WCHAR *GetFileName(size_t fileindex);\r\n    // reverts GetFileName\r\n    size_t GetFileIndex(const WCHAR *filename);\r\n\r\n    // caller must free() the result (or rather Allocator::Free it)\r\n    char *GetFileDataByName(const WCHAR *filename, size_t *len=nullptr);\r\n    char *GetFileDataByIdx(size_t fileindex, size_t *len=nullptr);\r\n\r\n    FILETIME GetFileTime(const WCHAR *filename);\r\n    FILETIME GetFileTime(size_t fileindex);\r\n\r\n    // caller must free() the result (or rather Allocator::Free it)\r\n    char *GetComment(size_t *len=nullptr);\r\n\r\n    bool UnzipFile(const WCHAR *filename, const WCHAR *dir, const WCHAR *unzippedName=nullptr);\r\n};\r\n\r\nclass ZipCreator {\r\n    ISequentialStream *stream;\r\n    str::Str<char> centraldir;\r\n    size_t bytesWritten;\r\n    size_t fileCount;\r\n\r\n    bool WriteData(const void *data, size_t size);\r\n    bool AddFileData(const char *nameUtf8, const void *data, size_t size, uint32_t dosdate=0);\r\n\r\npublic:\r\n    ZipCreator(const WCHAR *zipFilePath);\r\n    ZipCreator(ISequentialStream *stream);\r\n    ~ZipCreator();\r\n\r\n    bool AddFile(const WCHAR *filePath, const WCHAR *nameInZip=nullptr);\r\n    bool AddFileFromDir(const WCHAR *filePath, const WCHAR *dir);\r\n    bool AddDir(const WCHAR *dirPath, bool recursive=false);\r\n    bool Finish();\r\n};\r\n\r\nIStream *OpenDirAsZipStream(const WCHAR *dirPath, bool recursive=false);\r\n"
  },
  {
    "path": "src/utils/mingw_compat.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n/*\r\nThings that are missing in mingw compiler\r\n*/\r\n\r\n#if defined(__MINGW32__)\r\n#define sprintf_s snprintf\r\n#endif\r\n"
  },
  {
    "path": "src/utils/tests/BaseUtil_ut.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n\r\n// must be last due to assert() over-write\r\n#include \"UtAssert.h\"\r\n\r\nstatic void GeomTest()\r\n{\r\n    PointD ptD(12.4, -13.6);\r\n    utassert(ptD.x == 12.4 && ptD.y == -13.6);\r\n    PointI ptI = ptD.ToInt();\r\n    utassert(ptI.x == 12 && ptI.y == -14);\r\n    ptD = ptI.Convert<double>();\r\n    utassert(PointD(12, -14) == ptD);\r\n    utassert(PointD(12.4, -13.6) != ptD);\r\n\r\n    SizeD szD(7.7, -3.3);\r\n    utassert(szD.dx == 7.7 && szD.dy == -3.3);\r\n    SizeI szI = szD.ToInt();\r\n    utassert(szI.dx == 8 && szI.dy == -3);\r\n    szD = szI.Convert<double>();\r\n    utassert(SizeD(8, -3) == szD);\r\n\r\n    utassert(!szD.IsEmpty() && !szI.IsEmpty());\r\n    utassert(SizeI().IsEmpty() && SizeD().IsEmpty());\r\n\r\n    struct SRIData {\r\n        int     x1s, x1e, y1s, y1e;\r\n        int     x2s, x2e, y2s, y2e;\r\n        bool    intersect;\r\n        int     i_xs, i_xe, i_ys, i_ye;\r\n        int     u_xs, u_xe, u_ys, u_ye;\r\n    } testData[] = {\r\n        { 0,10, 0,10,   0,10, 0,10,  true,  0,10, 0,10,  0,10, 0,10 }, /* complete intersect */\r\n        { 0,10, 0,10,  20,30,20,30,  false, 0, 0, 0, 0,  0,30, 0,30 }, /* no intersect */\r\n        { 0,10, 0,10,   5,15, 0,10,  true,  5,10, 0,10,  0,15, 0,10 }, /* { | } | */\r\n        { 0,10, 0,10,   5, 7, 0,10,  true,  5, 7, 0,10,  0,10, 0,10 }, /* { | | } */\r\n        { 0,10, 0,10,   5, 7, 5, 7,  true,  5, 7, 5, 7,  0,10, 0,10 },\r\n        { 0,10, 0,10,   5, 15,5,15,  true,  5,10, 5,10,  0,15, 0,15 },\r\n    };\r\n\r\n    for (size_t i = 0; i < dimof(testData); i++) {\r\n        struct SRIData *curr = &testData[i];\r\n\r\n        RectI rx1(curr->x1s, curr->y1s, curr->x1e - curr->x1s, curr->y1e - curr->y1s);\r\n        RectI rx2 = RectI::FromXY(curr->x2s, curr->y2s, curr->x2e, curr->y2e);\r\n        RectI isect = rx1.Intersect(rx2);\r\n        if (curr->intersect) {\r\n            utassert(!isect.IsEmpty());\r\n            utassert(isect.x == curr->i_xs && isect.y == curr->i_ys);\r\n            utassert(isect.x + isect.dx == curr->i_xe && isect.y + isect.dy == curr->i_ye);\r\n        }\r\n        else {\r\n            utassert(isect.IsEmpty());\r\n        }\r\n        RectI urect = rx1.Union(rx2);\r\n        utassert(urect.x == curr->u_xs && urect.y == curr->u_ys);\r\n        utassert(urect.x + urect.dx == curr->u_xe && urect.y + urect.dy == curr->u_ye);\r\n\r\n        /* if we swap rectangles, the results should be the same */\r\n        std::swap(rx1, rx2);\r\n        isect = rx1.Intersect(rx2);\r\n        if (curr->intersect) {\r\n            utassert(!isect.IsEmpty());\r\n            utassert(isect.x == curr->i_xs && isect.y == curr->i_ys);\r\n            utassert(isect.x + isect.dx == curr->i_xe && isect.y + isect.dy == curr->i_ye);\r\n        }\r\n        else {\r\n            utassert(isect.IsEmpty());\r\n        }\r\n        urect = rx1.Union(rx2);\r\n        utassert(RectI::FromXY(curr->u_xs, curr->u_ys, curr->u_xe, curr->u_ye) == urect);\r\n\r\n        utassert(!rx1.Contains(PointI(-2, -2)));\r\n        utassert(rx1.Contains(rx1.TL()));\r\n        utassert(!rx1.Contains(PointI(rx1.x, INT_MAX)));\r\n        utassert(!rx1.Contains(PointI(INT_MIN, rx1.y)));\r\n    }\r\n}\r\n\r\nvoid BaseUtilTest()\r\n{\r\n    utassert(RoundToPowerOf2(0) == 1);\r\n    utassert(RoundToPowerOf2(1) == 1);\r\n    utassert(RoundToPowerOf2(2) == 2);\r\n    utassert(RoundToPowerOf2(3) == 4);\r\n    utassert(RoundToPowerOf2(15) == 16);\r\n    utassert(RoundToPowerOf2((1 << 13) + 1) == (1 << 14));\r\n    utassert(RoundToPowerOf2((size_t)-42) == (size_t)-1);\r\n\r\n    utassert(MurmurHash2(nullptr, 0) == 0x342CE6C);\r\n    utassert(MurmurHash2(\"test\", 4) != MurmurHash2(\"Test\", 4));\r\n\r\n    GeomTest();\r\n}\r\n"
  },
  {
    "path": "src/utils/tests/ByteOrderDecoder_ut.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"ByteOrderDecoder.h\"\r\n\r\n// must be last due to assert() over-write\r\n#include \"UtAssert.h\"\r\n\r\n#define ABC \"abc\"\r\nvoid ByteOrderTests()\r\n{\r\n    unsigned char d1[] = {\r\n        0x00, 0x01,\r\n        0x00, // to skip\r\n        0x01, 0x00,\r\n        0xff, 0xfe,\r\n        0x00, 0x00, // to skip\r\n        0x00, 0x00, 0x00, 0x01,\r\n        0x01, 0x00, 0x00, 0x00,\r\n        0xff, 0xff, 0xff, 0xfe,\r\n        0x02, 0x00,\r\n        'a', 'b', 'c'\r\n    };\r\n\r\n    {\r\n        uint16 vu16; uint32 vu32;\r\n        char b[3];\r\n        ByteOrderDecoder d(d1, sizeof(d1), ByteOrderDecoder::LittleEndian);\r\n        utassert(0 == d.Offset());\r\n        vu16 = d.UInt16();\r\n        utassert(2 == d.Offset());\r\n        utassert(vu16 == 0x100);\r\n        d.Skip(1);\r\n        utassert(3 == d.Offset());\r\n        vu16 = d.UInt16();\r\n        utassert(5 == d.Offset());\r\n        utassert(vu16 == 0x1);\r\n        vu16 = d.UInt16();\r\n        utassert(7 == d.Offset());\r\n        utassert(vu16 == 0xfeff);\r\n        d.Skip(2);\r\n        utassert(9 == d.Offset());\r\n        d.Unskip(4);\r\n        utassert(5 == d.Offset());\r\n        vu32 = d.UInt32();\r\n        utassert(vu32 == 0xfeff);\r\n\r\n        vu32 = d.UInt32();\r\n        utassert(13 == d.Offset());\r\n        utassert(vu32 == 0x1000000);\r\n        vu32 = d.UInt32();\r\n        utassert(17 == d.Offset());\r\n        utassert(vu32 == 1);\r\n        vu32 = d.UInt32();\r\n        utassert(21 == d.Offset());\r\n        utassert(vu32 == 0xfeffffff);\r\n\r\n        d.ChangeOrder(ByteOrderDecoder::BigEndian);\r\n        vu16 = d.UInt16();\r\n        utassert(vu16 == 0x200);\r\n        utassert(23 == d.Offset());\r\n\r\n        d.Bytes(b, 3);\r\n        utassert(memeq(ABC, b, 3));\r\n        utassert(26 == d.Offset());\r\n    }\r\n\r\n    {\r\n        uint16 vu16; uint32 vu32;\r\n        char b[3];\r\n        ByteOrderDecoder d(d1, sizeof(d1), ByteOrderDecoder::BigEndian);\r\n        vu16 = d.UInt16();\r\n        utassert(vu16 == 1);\r\n        d.Skip(1);\r\n        vu16 = d.UInt16();\r\n        utassert(vu16 == 0x100);\r\n        vu16 = d.UInt16();\r\n        utassert(vu16 == 0xfffe);\r\n        d.Skip(2);\r\n\r\n        vu32 = d.UInt32();\r\n        utassert(vu32 == 1);\r\n        vu32 = d.UInt32();\r\n        utassert(vu32 == 0x1000000);\r\n        vu32 = d.UInt32();\r\n        utassert(vu32 == 0xfffffffe);\r\n\r\n        d.ChangeOrder(ByteOrderDecoder::LittleEndian);\r\n        vu16 = d.UInt16();\r\n        utassert(vu16 == 2);\r\n        d.Bytes(b, 3);\r\n        utassert(memeq(ABC, b, 3));\r\n        utassert(26 == d.Offset());\r\n    }\r\n\r\n    {\r\n        int16 v16; int32 v32;\r\n        char b[3];\r\n        ByteOrderDecoder d(d1, sizeof(d1), ByteOrderDecoder::LittleEndian);\r\n        v16 = d.Int16();\r\n        utassert(v16 == 0x100);\r\n        d.Skip(1);\r\n        v16 = d.Int16();\r\n        utassert(v16 == 0x1);\r\n        v16 = d.Int16();\r\n        utassert(v16 == -257);\r\n        d.Skip(2);\r\n\r\n        v32 = d.Int32();\r\n        utassert(v32 == 0x1000000);\r\n        v32 = d.Int32();\r\n        utassert(v32 == 1);\r\n        v32 = d.Int32();\r\n        utassert(v32 == -16777217);\r\n\r\n        d.ChangeOrder(ByteOrderDecoder::BigEndian);\r\n        v16 = d.Int16();\r\n        utassert(v16 == 0x200);\r\n        d.Bytes(b, 3);\r\n        utassert(memeq(ABC, b, 3));\r\n        utassert(26 == d.Offset());\r\n    }\r\n\r\n    {\r\n        int16 v16; int32 v32;\r\n        char b[3];\r\n        ByteOrderDecoder d(d1, sizeof(d1), ByteOrderDecoder::BigEndian);\r\n        v16 = d.Int16();\r\n        utassert(v16 == 0x1);\r\n        d.Skip(1);\r\n        v16 = d.Int16();\r\n        utassert(v16 == 0x100);\r\n        v16 = d.Int16();\r\n        utassert(v16 == -2);\r\n        d.Skip(2);\r\n\r\n        v32 = d.Int32();\r\n        utassert(v32 == 1);\r\n        v32 = d.Int32();\r\n        utassert(v32 == 0x1000000);\r\n        v32 = d.Int32();\r\n        utassert(v32 == -2);\r\n\r\n        d.ChangeOrder(ByteOrderDecoder::LittleEndian);\r\n        v16 = d.Int16();\r\n        utassert(v16 == 2);\r\n        d.Bytes(b, 3);\r\n        utassert(memeq(ABC, b, 3));\r\n        utassert(26 == d.Offset());\r\n    }\r\n}\r\n\r\n#undef ABC\r\n"
  },
  {
    "path": "src/utils/tests/CmdLineParser_ut.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"CmdLineParser.h\"\r\n\r\n// must be last due to assert() over-write\r\n#include \"UtAssert.h\"\r\n\r\nvoid CmdLineParserTest()\r\n{\r\n    WStrVec args;\r\n\r\n    ParseCmdLine(L\"test.exe -arg foo.pdf\", args);\r\n    utassert(3 == args.Count());\r\n    utassert(str::Eq(args.At(0), L\"test.exe\"));\r\n    utassert(str::Eq(args.At(1), L\"-arg\"));\r\n    utassert(str::Eq(args.At(2), L\"foo.pdf\"));\r\n    args.Reset();\r\n\r\n    ParseCmdLine(L\"test.exe \\\"foo \\\\\\\" bar \\\\\\\\.pdf\\\" un\\\\\\\"quoted.pdf\", args);\r\n    utassert(3 == args.Count());\r\n    utassert(str::Eq(args.At(0), L\"test.exe\"));\r\n    utassert(str::Eq(args.At(1), L\"foo \\\" bar \\\\\\\\.pdf\"));\r\n    utassert(str::Eq(args.At(2), L\"un\\\"quoted.pdf\"));\r\n    args.Reset();\r\n\r\n    ParseCmdLine(L\"test.exe \\\"foo\\\".pdf foo\\\" bar.pdf \", args);\r\n    utassert(3 == args.Count());\r\n    utassert(str::Eq(args.At(0), L\"test.exe\"));\r\n    utassert(str::Eq(args.At(1), L\"foo.pdf\"));\r\n    utassert(str::Eq(args.At(2), L\"foo bar.pdf \"));\r\n    args.Reset();\r\n\r\n    ParseCmdLine(L\"test.exe -arg \\\"%1\\\" -more\", args, 2);\r\n    utassert(2 == args.Count());\r\n    utassert(str::Eq(args.At(0), L\"test.exe\"));\r\n    utassert(str::Eq(args.At(1), L\"-arg \\\"%1\\\" -more\"));\r\n    args.Reset();\r\n}\r\n"
  },
  {
    "path": "src/utils/tests/CryptoUtil_ut.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"CryptoUtil.h\"\r\n\r\n// must be last due to assert() over-write\r\n#include \"UtAssert.h\"\r\n\r\nstatic bool TestDigestMD5(const char *data, size_t size, const char *verify)\r\n{\r\n    unsigned char digest[16];\r\n    CalcMD5Digest((const unsigned char *)data, size, digest);\r\n    ScopedMem<char> hash(_MemToHex(&digest));\r\n    return str::Eq(hash, verify);\r\n}\r\n\r\nstatic bool TestDigestSHA1(const char *data, size_t size, const char *verify)\r\n{\r\n    unsigned char digest[20];\r\n    CalcSHA1Digest((const unsigned char *)data, size, digest);\r\n    ScopedMem<char> hash(_MemToHex(&digest));\r\n    return str::Eq(hash, verify);\r\n}\r\n\r\nstatic bool TestDigestSHA2(const char *data, size_t size, const char *verify)\r\n{\r\n    unsigned char digest[32];\r\n    CalcSHA2Digest((const unsigned char *)data, size, digest);\r\n    ScopedMem<char> hash(_MemToHex(&digest));\r\n    return str::Eq(hash, verify);\r\n}\r\n\r\nvoid CryptoUtilTest()\r\n{\r\n    utassert(TestDigestMD5(\"\", 0, \"d41d8cd98f00b204e9800998ecf8427e\"));\r\n    utassert(TestDigestMD5(\"The quick brown fox jumps over the lazy dog\", 43, \"9e107d9d372bb6826bd81d3542a419d6\"));\r\n    utassert(TestDigestMD5(\"The quick brown fox jumps over the lazy dog.\", 44, \"e4d909c290d0fb1ca068ffaddf22cbd0\"));\r\n\r\n    utassert(TestDigestSHA1(\"\", 0, \"da39a3ee5e6b4b0d3255bfef95601890afd80709\"));\r\n    utassert(TestDigestSHA1(\"The quick brown fox jumps over the lazy dog\", 43, \"2fd4e1c67a2d28fced849ee1bb76e7391b93eb12\"));\r\n    utassert(TestDigestSHA1(\"The quick brown fox jumps over the lazy cog\", 43, \"de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3\"));\r\n\r\n    utassert(TestDigestSHA2(\"\", 0, \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"));\r\n    utassert(TestDigestSHA2(\"The quick brown fox jumps over the lazy dog\", 43, \"d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592\"));\r\n    utassert(TestDigestSHA2(\"The quick brown fox jumps over the lazy dog.\", 44, \"ef537f25c895bfa782526529a9b63d97aa631564d5d789c2b765448c8635fb6c\"));\r\n}\r\n"
  },
  {
    "path": "src/utils/tests/CssParser_ut.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"CssParser.h\"\r\n\r\n// must be last due to assert() over-write\r\n#include \"UtAssert.h\"\r\n\r\nstatic inline bool IsPropVal(const CssProperty *prop, const char *val) {\r\n    return str::EqNIx(prop->s, prop->sLen, val);\r\n}\r\nstatic inline bool IsSelector(const CssSelector *sel, const char *val) {\r\n    return str::EqNIx(sel->s, sel->sLen, val);\r\n}\r\n\r\nstatic void Test01()\r\n{\r\n    const char *inlineCss = \"color: red; text-indent: 20px; /* comment */\";\r\n    CssPullParser parser(inlineCss, str::Len(inlineCss));\r\n    const CssProperty *prop = parser.NextProperty();\r\n    utassert(prop && Css_Color == prop->type && IsPropVal(prop, \"red\"));\r\n    prop = parser.NextProperty();\r\n    utassert(prop && Css_Text_Indent == prop->type && IsPropVal(prop, \"20px\"));\r\n    prop = parser.NextProperty();\r\n    utassert(!prop);\r\n}\r\n\r\nstatic void Test02()\r\n{\r\n    const char *inlineCss = \"font-family: 'Courier New', \\\"Times New Roman\\\", Arial ; font: 12pt Georgia bold\";\r\n    CssPullParser parser(inlineCss, str::Len(inlineCss));\r\n    const CssProperty *prop = parser.NextProperty();\r\n    utassert(prop && Css_Font_Family == prop->type && IsPropVal(prop, \"'Courier New', \\\"Times New Roman\\\", Arial\"));\r\n    prop = parser.NextProperty();\r\n    utassert(prop && Css_Font == prop->type && IsPropVal(prop, \"12pt Georgia bold\"));\r\n    prop = parser.NextProperty();\r\n    utassert(!prop);\r\n}\r\n\r\nstatic void Test03()\r\n{\r\n    const char *simpleCss = \"* { color: red }\\np { color: blue }\\n.green { color: green }\\np.green { color: rgb(0,128,0) }\\n\";\r\n    CssPullParser parser(simpleCss, str::Len(simpleCss));\r\n    const CssSelector *sel = parser.NextSelector();\r\n    utassert(!sel);\r\n    const CssProperty *prop;\r\n\r\n    bool ok = parser.NextRule();\r\n    utassert(ok);\r\n    sel = parser.NextSelector();\r\n    utassert(sel && Tag_Any == sel->tag && !sel->clazz && IsSelector(sel, \"*\"));\r\n    sel = parser.NextSelector();\r\n    utassert(!sel);\r\n    prop = parser.NextProperty();\r\n    utassert(prop && Css_Color == prop->type && IsPropVal(prop, \"red\"));\r\n    prop = parser.NextProperty();\r\n    utassert(!prop);\r\n\r\n    ok = parser.NextRule();\r\n    utassert(ok);\r\n    sel = parser.NextSelector();\r\n    utassert(sel && Tag_P == sel->tag && !sel->clazz && IsSelector(sel, \"p\"));\r\n    prop = parser.NextProperty();\r\n    utassert(prop && Css_Color == prop->type && IsPropVal(prop, \"blue\"));\r\n    prop = parser.NextProperty();\r\n    utassert(!prop);\r\n\r\n    ok = parser.NextRule();\r\n    utassert(ok);\r\n    sel = parser.NextSelector();\r\n    utassert(sel && Tag_Any == sel->tag && IsSelector(sel, \".green\") && str::EqNIx(sel->clazz, sel->clazzLen, \"green\"));\r\n    prop = parser.NextProperty();\r\n    utassert(prop && Css_Color == prop->type && IsPropVal(prop, \"green\"));\r\n    prop = parser.NextProperty();\r\n    utassert(!prop);\r\n\r\n    ok = parser.NextRule();\r\n    utassert(ok);\r\n    sel = parser.NextSelector();\r\n    utassert(sel && Tag_P == sel->tag && IsSelector(sel, \"p.green\") && str::EqNIx(sel->clazz, sel->clazzLen, \"green\"));\r\n    prop = parser.NextProperty();\r\n    utassert(prop && Css_Color == prop->type && IsPropVal(prop, \"rgb(0,128,0)\"));\r\n    prop = parser.NextProperty();\r\n    utassert(!prop);\r\n\r\n    ok = parser.NextRule();\r\n    utassert(!ok);\r\n}\r\n\r\nstatic void Test04()\r\n{\r\n    const char *simpleCss = \" span\\n{ color: red }\\n\\tp /* plain paragraph */ , p#id { }\";\r\n    CssPullParser parser(simpleCss, str::Len(simpleCss));\r\n    const CssSelector *sel;\r\n    const CssProperty *prop;\r\n\r\n    bool ok = parser.NextRule();\r\n    utassert(ok);\r\n    prop = parser.NextProperty();\r\n    utassert(prop && Css_Color == prop->type && IsPropVal(prop, \"red\"));\r\n    prop = parser.NextProperty();\r\n    utassert(!prop);\r\n    sel = parser.NextSelector();\r\n    utassert(sel && Tag_Span == sel->tag && !sel->clazz && IsSelector(sel, \"span\"));\r\n    sel = parser.NextSelector();\r\n    utassert(!sel);\r\n\r\n    ok = parser.NextRule();\r\n    utassert(ok);\r\n    prop = parser.NextProperty();\r\n    utassert(!prop);\r\n    sel = parser.NextSelector();\r\n    utassert(sel && Tag_P == sel->tag && !sel->clazz && IsSelector(sel, \"p\"));\r\n    sel = parser.NextSelector();\r\n    utassert(sel && Tag_NotFound == sel->tag && !sel->clazz && IsSelector(sel, \"p#id\"));\r\n    sel = parser.NextSelector();\r\n    utassert(!sel);\r\n\r\n    ok = parser.NextRule();\r\n    utassert(!ok);\r\n}\r\n\r\nstatic void Test05()\r\n{\r\n    const char *simpleCss = \"<!-- html { ignore } @ignore this; p { } -->\";\r\n    CssPullParser parser(simpleCss, str::Len(simpleCss));\r\n    const CssSelector *sel;\r\n    const CssProperty *prop;\r\n\r\n    bool ok = parser.NextRule();\r\n    utassert(ok);\r\n    sel = parser.NextSelector();\r\n    utassert(sel && Tag_Html == sel->tag && !sel->clazz && IsSelector(sel, \"html\"));\r\n    sel = parser.NextSelector();\r\n    utassert(!sel);\r\n    prop = parser.NextProperty();\r\n    utassert(!prop);\r\n\r\n    ok = parser.NextRule();\r\n    utassert(ok);\r\n    sel = parser.NextSelector();\r\n    utassert(sel && Tag_P == sel->tag && !sel->clazz && IsSelector(sel, \"p\"));\r\n    sel = parser.NextSelector();\r\n    utassert(!sel);\r\n    prop = parser.NextProperty();\r\n    utassert(!prop);\r\n\r\n    ok = parser.NextRule();\r\n    utassert(!ok);\r\n}\r\n\r\nstatic void Test06()\r\n{\r\n    const char *inlineCss = \"block: {{ ignore this }} ; color: red; } color: blue\";\r\n    CssPullParser parser(inlineCss, str::Len(inlineCss));\r\n    const CssProperty *prop = parser.NextProperty();\r\n    utassert(prop && Css_Unknown == prop->type && IsPropVal(prop, \"{{ ignore this }}\"));\r\n    prop = parser.NextProperty();\r\n    utassert(prop && Css_Color == prop->type && IsPropVal(prop, \"red\"));\r\n    prop = parser.NextProperty();\r\n    utassert(!prop);\r\n    bool ok = parser.NextRule();\r\n    utassert(!ok);\r\n}\r\n\r\nstatic void Test07()\r\n{\r\n    const char *simpleCss = \" span\\n{ color: red }\\n\\tp /* plain paragraph */ , p#id { }\";\r\n    CssPullParser parser(simpleCss, str::Len(simpleCss));\r\n    bool ok = parser.NextRule();\r\n    utassert(ok);\r\n    ok = parser.NextRule();\r\n    utassert(ok);\r\n    ok = parser.NextRule();\r\n    utassert(!ok);\r\n}\r\n\r\nstatic void Test08()\r\n{\r\n    const char *simpleCss = \"broken { brace: \\\"doesn't close\\\"; { ignore { color: red; }\";\r\n    CssPullParser parser(simpleCss, str::Len(simpleCss));\r\n    bool ok = parser.NextRule();\r\n    utassert(ok);\r\n    const CssProperty *prop = parser.NextProperty();\r\n    utassert(Css_Unknown == prop->type && IsPropVal(prop, \"\\\"doesn't close\\\"\"));\r\n    prop = parser.NextProperty();\r\n    utassert(!prop);\r\n    ok = parser.NextRule();\r\n    utassert(!ok);\r\n}\r\n\r\nvoid CssParser_UnitTests()\r\n{\r\n    Test01();\r\n    Test02();\r\n    Test03();\r\n    Test04();\r\n    Test05();\r\n    Test06();\r\n    Test07();\r\n    Test08();\r\n}\r\n"
  },
  {
    "path": "src/utils/tests/Dict_ut.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"Dict.h\"\r\n\r\n// must be last due to assert() over-write\r\n#include \"UtAssert.h\"\r\n\r\n#define LETTERS \"abcdefghijklmnopqrtswzABCDEFGHIJLMNOPQRTSWZ0123456789\"\r\n\r\nstatic inline char GenRandChar()\r\n{\r\n    return LETTERS[rand() % dimof(LETTERS)];\r\n}\r\n\r\nstatic char *GenRandomString()\r\n{\r\n    static char buf[256];\r\n    int len = 1 + (rand() % (dimof(buf) - 4)); // 4 just in case, 2 should be precise value\r\n\r\n    for (int i=0; i<len; i++) {\r\n        buf[i] = GenRandChar();\r\n    }\r\n    buf[len] = 0;\r\n    return &buf[0];\r\n}\r\n\r\nvoid DictTestMapStrToInt()\r\n{\r\n    dict::MapStrToInt d(4); // start small so that we can test resizing\r\n    bool ok;\r\n    int val;\r\n\r\n    utassert(0 == d.Count());\r\n    ok = d.Get(\"foo\", &val);\r\n    utassert(!ok);\r\n    ok = d.Remove(\"foo\", nullptr);\r\n    utassert(!ok);\r\n\r\n    ok = d.Insert(\"foo\", 5, nullptr);\r\n    utassert(ok);\r\n    utassert(1 == d.Count());\r\n    ok = d.Get(\"foo\", &val);\r\n    utassert(ok);\r\n    utassert(val == 5);\r\n    ok = d.Insert(\"foo\", 8, &val);\r\n    utassert(!ok);\r\n    utassert(val == 5);\r\n    ok = d.Get(\"foo\", &val);\r\n    utassert(ok);\r\n    utassert(val == 5);\r\n    ok = d.Get(\"bar\", &val);\r\n    utassert(!ok);\r\n\r\n    val = 0;\r\n    ok = d.Remove(\"foo\", &val);\r\n    utassert(ok);\r\n    utassert(val == 5);\r\n    utassert(0 == d.Count());\r\n\r\n    srand((unsigned int)time(nullptr));\r\n    Vec<char *> toRemove;\r\n    for (int i=0; i < 1024; i++) {\r\n        char *k = GenRandomString();\r\n        ok = d.Insert(k, i, nullptr);\r\n        // no guarantee that the string is unique, so Insert() doesn't always succeeds\r\n        if (!ok)\r\n            continue;\r\n        toRemove.Append(str::Dup(k));\r\n        utassert(toRemove.Count() == d.Count());\r\n        ok = d.Get(k, &val);\r\n        CrashIf(!ok);\r\n        CrashIf(i != val);\r\n    }\r\n    for (const char *k : toRemove) {\r\n        ok = d.Remove(k, nullptr);\r\n        utassert(ok);\r\n    }\r\n    toRemove.FreeMembers();\r\n}\r\n\r\nvoid DictTest()\r\n{\r\n    DictTestMapStrToInt();\r\n}\r\n"
  },
  {
    "path": "src/utils/tests/FileUtil_ut.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"FileUtil.h\"\r\n\r\n// must be last due to assert() over-write\r\n#include \"UtAssert.h\"\r\n\r\nvoid FileUtilTest()\r\n{\r\n    WCHAR *path1 = L\"C:\\\\Program Files\\\\SumatraPDF\\\\SumatraPDF.exe\";\r\n\r\n    const WCHAR *baseName = path::GetBaseName(path1);\r\n    utassert(str::Eq(baseName, L\"SumatraPDF.exe\"));\r\n\r\n    ScopedMem<WCHAR> dirName(path::GetDir(path1));\r\n    utassert(str::Eq(dirName, L\"C:\\\\Program Files\\\\SumatraPDF\"));\r\n    baseName = path::GetBaseName(dirName);\r\n    utassert(str::Eq(baseName, L\"SumatraPDF\"));\r\n\r\n    dirName.Set(path::GetDir(L\"C:\\\\Program Files\"));\r\n    utassert(str::Eq(dirName, L\"C:\\\\\"));\r\n    dirName.Set(path::GetDir(dirName));\r\n    utassert(str::Eq(dirName, L\"C:\\\\\"));\r\n    dirName.Set(path::GetDir(L\"\\\\\\\\server\"));\r\n    utassert(str::Eq(dirName, L\"\\\\\\\\server\"));\r\n    dirName.Set(path::GetDir(L\"file.exe\"));\r\n    utassert(str::Eq(dirName, L\".\"));\r\n    dirName.Set(path::GetDir(L\"/etc\"));\r\n    utassert(str::Eq(dirName, L\"/\"));\r\n\r\n    path1 = L\"C:\\\\Program Files\";\r\n    WCHAR *path2 = path::Join(L\"C:\\\\\", L\"Program Files\");\r\n    utassert(str::Eq(path1, path2));\r\n    free(path2);\r\n    path2 = path::Join(path1, L\"SumatraPDF\");\r\n    utassert(str::Eq(path2, L\"C:\\\\Program Files\\\\SumatraPDF\"));\r\n    free(path2);\r\n    path2 = path::Join(L\"C:\\\\\", L\"\\\\Windows\");\r\n    utassert(str::Eq(path2, L\"C:\\\\Windows\"));\r\n    free(path2);\r\n\r\n    utassert(path::Match(L\"C:\\\\file.pdf\", L\"*.pdf\"));\r\n    utassert(path::Match(L\"C:\\\\file.pdf\", L\"file.*\"));\r\n    utassert(path::Match(L\"C:\\\\file.pdf\", L\"*.xps;*.pdf\"));\r\n    utassert(path::Match(L\"C:\\\\file.pdf\", L\"*.xps;*.pdf;*.djvu\"));\r\n    utassert(path::Match(L\"C:\\\\file.pdf\", L\"f??e.p?f\"));\r\n    utassert(!path::Match(L\"C:\\\\file.pdf\", L\"*.xps;*.djvu\"));\r\n    utassert(!path::Match(L\"C:\\\\dir.xps\\\\file.pdf\", L\"*.xps;*.djvu\"));\r\n    utassert(!path::Match(L\"C:\\\\file.pdf\", L\"f??f.p?f\"));\r\n    utassert(!path::Match(L\"C:\\\\.pdf\", L\"?.pdf\"));\r\n}\r\n"
  },
  {
    "path": "src/utils/tests/HtmlPrettyPrint_ut.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"HtmlPrettyPrint.h\"\r\n\r\n// must be last due to assert() over-write\r\n#include \"UtAssert.h\"\r\n\r\nvoid HtmlPrettyPrintTest()\r\n{\r\n    size_t lenOut;\r\n    ScopedMem<char> data;\r\n\r\n    data.Set(PrettyPrintHtml(\"<p><b>Test</b></p>\", (size_t)-1, lenOut));\r\n    utassert(str::Len(data) == lenOut && str::Eq(data, \"<p><b>Test</b></p>\\n\"));\r\n\r\n    data.Set(PrettyPrintHtml(\"<p><b>Test</p>\", (size_t)-1, lenOut));\r\n    utassert(str::Len(data) == lenOut && str::Eq(data, \"<p><b>Test</p>\\n\"));\r\n\r\n    data.Set(PrettyPrintHtml(\"<html><body><p>Content</p></body></html>\", (size_t)-1, lenOut));\r\n    utassert(str::Len(data) == lenOut && str::Eq(data, \"<html>\\n\\t<body>\\n\\t\\t<p>Content</p>\\n\\t</body>\\n</html>\\n\"));\r\n\r\n    data.Set(PrettyPrintHtml(\"<html><body><p>Content</html></body>\", (size_t)-1, lenOut));\r\n    // TODO: add newline before non-matching </html> ?\r\n    // TODO: insert missing closing tags (</p> and </body>)?\r\n    utassert(str::Len(data) == lenOut && str::Eq(data, \"<html>\\n\\t<body>\\n\\t\\t<p>Content</html>\\n</body>\\n\"));\r\n\r\n    data.Set(PrettyPrintHtml(\"<p  attr=' value '><b> bold  text </b> </p>\", (size_t)-1, lenOut));\r\n    // TODO: normalize whitespace?\r\n    utassert(str::Len(data) == lenOut && str::Eq(data, \"<p  attr=' value '><b> bold  text </b></p>\\n\"));\r\n}\r\n"
  },
  {
    "path": "src/utils/tests/HtmlPullParser_ut.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"HtmlPullParser.h\"\r\n\r\n// must be last due to assert() over-write\r\n#include \"UtAssert.h\"\r\n\r\nstatic void Test00(const char *s, HtmlToken::TokenType expectedType) {\r\n    HtmlPullParser parser(s, str::Len(s));\r\n    HtmlToken *t = parser.Next();\r\n    utassert(t->type == expectedType);\r\n    utassert(t->NameIs(\"p\"));\r\n    utassert(Tag_P == t->tag);\r\n    AttrInfo *a = t->GetAttrByName(\"a1\");\r\n    utassert(a->NameIs(\"a1\"));\r\n    utassert(a->ValIs(\">\"));\r\n\r\n    a = t->GetAttrByName(\"foo\");\r\n    utassert(a->NameIs(\"foo\"));\r\n    utassert(a->ValIs(\"bar\"));\r\n\r\n    a = t->GetAttrByName(\"nope\");\r\n    utassert(!a);\r\n\r\n    t = parser.Next();\r\n    utassert(!t);\r\n}\r\n\r\nstatic void HtmlEntities()\r\n{\r\n    struct {\r\n        const char *s; int rune;\r\n    } entities[] = {\r\n        { \"&Uuml;\", 220 },\r\n        { \"&uuml;\", 252 },\r\n        { \"&times;\", 215 },\r\n        { \"&AElig;\", 198 },\r\n        { \"&zwnj;\", 8204 },\r\n        { \"&#58;\", 58 },\r\n        { \"&#32783;\", 32783 },\r\n        { \"&#x20;\", 32 },\r\n        { \"&#xAf34;\", 44852 },\r\n        { \"&Auml;\", 196 },\r\n        { \"&a3;\", -1 },\r\n        { \"&#xz312;\", -1 },\r\n        { \"&aer;\", -1 }\r\n    };\r\n    for (size_t i = 0; i < dimof(entities); i++ ) {\r\n        const char *s = entities[i].s;\r\n        int got;\r\n        const char *entEnd = ResolveHtmlEntity(s + 1, str::Len(s) - 1, got);\r\n        utassert(got == entities[i].rune);\r\n        utassert((-1 == got) == !entEnd);\r\n    }\r\n    const char *unchanged[] = {\r\n        \"foo\", \"\", \" as;d \"\r\n    };\r\n    for (size_t i = 0; i < dimof(unchanged); i++) {\r\n        const char *s = unchanged[i];\r\n        const char *res = ResolveHtmlEntities(s, s + str::Len(s), nullptr);\r\n        utassert(res == s);\r\n    }\r\n\r\n    struct {\r\n        const char *s; const char *res;\r\n    } changed[] = {\r\n        // implementation detail: if there is '&' in the string\r\n        // we always allocate, even if it isn't a valid entity\r\n        { \"a&12\", \"a&12\" },\r\n        { \"a&x#30\", \"a&x#30\" },\r\n\r\n        { \"&#32;b\", \" b\" },\r\n        { \"&#x20;ra\", \" ra\" },\r\n        { \"&lt;\", \"<\" },\r\n        { \"a&amp; &#32;to&#x20;end\", \"a&  to end\" },\r\n        { \"&nbsp test&auml ;&ouml;&#64&#x50go\", \"\\xC2\\xA0 test\\xC3\\xA4 ;\\xC3\\xB6@Pgo\" },\r\n    };\r\n    for (size_t i = 0; i < dimof(changed); i++) {\r\n        const char *s = changed[i].s;\r\n        const char *res = ResolveHtmlEntities(s, s + str::Len(s), nullptr);\r\n        utassert(str::Eq(res, changed[i].res));\r\n        free((void*)res);\r\n    }\r\n}\r\n\r\nstatic void Test01()\r\n{\r\n    utassert(IsInlineTag(Tag_A));\r\n    utassert(IsInlineTag(Tag_U));\r\n    utassert(IsInlineTag(Tag_Span));\r\n    utassert(!IsInlineTag(Tag_P));\r\n    utassert(IsTagSelfClosing(Tag_Area));\r\n    utassert(IsTagSelfClosing(Tag_Link));\r\n    utassert(IsTagSelfClosing(Tag_Param));\r\n    utassert(!IsTagSelfClosing(Tag_P));\r\n}\r\n\r\nstatic void Test02()\r\n{\r\n    const char *s = \"<p>Last paragraph\";\r\n    HtmlPullParser parser(s, str::Len(s));\r\n    HtmlToken *t = parser.Next();\r\n    utassert(t && t->IsTag() && t->IsStartTag() && Tag_P == t->tag);\r\n    t = parser.Next();\r\n    utassert(t && t->IsText() && str::EqNIx(t->s, t->sLen, \"Last paragraph\"));\r\n}\r\n\r\nstatic void Test03()\r\n{\r\n    const char *s = \"a < b > c <> d <\";\r\n    HtmlPullParser parser(s, str::Len(s));\r\n    HtmlToken *t = parser.Next();\r\n    utassert(t && t->IsText() && str::EqNIx(t->s, t->sLen, \"a \"));\r\n    t = parser.Next();\r\n    utassert(t && t->IsText() && str::EqNIx(t->s, t->sLen, \"< b > c \"));\r\n    t = parser.Next();\r\n    utassert(t && t->IsText() && str::EqNIx(t->s, t->sLen, \"<> d \"));\r\n    t = parser.Next();\r\n    utassert(t && t->IsError() && HtmlToken::UnclosedTag == t->error);\r\n    t = parser.Next();\r\n    utassert(!t);\r\n}\r\n\r\nvoid HtmlPullParser_UnitTests()\r\n{\r\n    Test00(\"<p a1='>' foo=bar />\", HtmlToken::EmptyElementTag);\r\n    Test00(\"<p a1 ='>'     foo=\\\"bar\\\"/>\", HtmlToken::EmptyElementTag);\r\n    Test00(\"<p a1=  '>' foo=bar>\", HtmlToken::StartTag);\r\n    Test00(\"</><!-- < skip > --><p a1=\\\">\\\" foo=bar>\", HtmlToken::StartTag);\r\n    Test00(\"<P A1='>' FOO=bar />\", HtmlToken::EmptyElementTag);\r\n    HtmlEntities();\r\n    Test01();\r\n    Test02();\r\n    Test03();\r\n}\r\n"
  },
  {
    "path": "src/utils/tests/JsonParser_ut.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"JsonParser.h\"\r\n\r\n// must be last due to assert() over-write\r\n#include \"UtAssert.h\"\r\n\r\nstruct JsonValue {\r\n    const char *path;\r\n    json::DataType type;\r\n    const char *value;\r\n\r\n    JsonValue() : path(nullptr), value(nullptr) { }\r\n    JsonValue(const char *path, const char *value, json::DataType type=json::Type_String) :\r\n        path(path), type(type), value(value) { }\r\n};\r\n\r\nclass JsonVerifier : public json::ValueVisitor {\r\n    const JsonValue *data;\r\n    size_t dataLen;\r\n    size_t idx;\r\n\r\npublic:\r\n    JsonVerifier(const JsonValue *data, size_t dataLen) :\r\n        data(data), dataLen(dataLen), idx(0) { }\r\n    ~JsonVerifier() { utassert(dataLen == idx); }\r\n\r\n    virtual bool Visit(const char *path, const char *value, json::DataType type) {\r\n        utassert(idx < dataLen);\r\n        utassert(type == data[idx].type);\r\n        utassert(str::Eq(path, data[idx].path));\r\n        utassert(str::Eq(value, data[idx].value));\r\n\r\n        idx++;\r\n        return true;\r\n    }\r\n};\r\n\r\nvoid JsonTest()\r\n{\r\n    static const struct {\r\n        const char *json;\r\n        JsonValue value;\r\n    } validJsonData[] = {\r\n        // strings\r\n        { \"\\\"test\\\"\", JsonValue(\"\", \"test\") },\r\n        { \"\\\"\\\\\\\\\\\\n\\\\t\\\\u01234\\\"\", JsonValue(\"\", \"\\\\\\n\\t\\xC4\\xA3\"\"4\") },\r\n        // numbers\r\n        { \"123\", JsonValue(\"\", \"123\", json::Type_Number) },\r\n        { \"-99.99\", JsonValue(\"\", \"-99.99\", json::Type_Number) },\r\n        { \"1.2E+15\", JsonValue(\"\", \"1.2E+15\", json::Type_Number) },\r\n        { \"0e-7\", JsonValue(\"\", \"0e-7\", json::Type_Number) },\r\n        // keywords\r\n        { \"true\", JsonValue(\"\", \"true\", json::Type_Bool) },\r\n        { \"false\", JsonValue(\"\", \"false\", json::Type_Bool) },\r\n        { \"null\", JsonValue(\"\", \"null\", json::Type_Null) },\r\n        // dictionaries\r\n        { \"{\\\"key\\\":\\\"test\\\"}\", JsonValue(\"/key\", \"test\") },\r\n        { \"{ \\\"no\\\" : 123 }\", JsonValue(\"/no\", \"123\", json::Type_Number) },\r\n        { \"{ \\\"bool\\\": true }\", JsonValue(\"/bool\", \"true\", json::Type_Bool) },\r\n        { \"{}\", JsonValue() },\r\n        // arrays\r\n        { \"[\\\"test\\\"]\", JsonValue(\"[0]\", \"test\") },\r\n        { \"[123]\", JsonValue(\"[0]\", \"123\", json::Type_Number) },\r\n        { \"[ null ]\", JsonValue(\"[0]\", \"null\", json::Type_Null) },\r\n        { \"[]\", JsonValue() },\r\n        // combination\r\n        { \"{\\\"key\\\":[{\\\"name\\\":-987}]}\", JsonValue(\"/key[0]/name\", \"-987\", json::Type_Number) },\r\n    };\r\n\r\n    for (size_t i = 0; i < dimof(validJsonData); i++) {\r\n        JsonVerifier verifier(&validJsonData[i].value, validJsonData[i].value.value ? 1 : 0);\r\n        utassert(json::Parse(validJsonData[i].json, &verifier));\r\n    }\r\n\r\n    static const struct {\r\n        const char *json;\r\n        JsonValue value;\r\n    } invalidJsonData[] = {\r\n        // dictionaries\r\n        { \"{\\\"key\\\":\\\"test\\\"\", JsonValue(\"/key\", \"test\") },\r\n        { \"{ \\\"no\\\" : 123, }\", JsonValue(\"/no\", \"123\", json::Type_Number) },\r\n        { \"{\\\"key\\\":\\\"test\\\"]\", JsonValue(\"/key\", \"test\") },\r\n        // arrays\r\n        { \"[\\\"test\\\"\", JsonValue(\"[0]\", \"test\") },\r\n        { \"[123,]\", JsonValue(\"[0]\", \"123\", json::Type_Number) },\r\n        { \"[\\\"test\\\"}\", JsonValue(\"[0]\", \"test\") },\r\n    };\r\n\r\n    for (size_t i = 0; i < dimof(invalidJsonData); i++) {\r\n        JsonVerifier verifier(&invalidJsonData[i].value, 1);\r\n        utassert(!json::Parse(invalidJsonData[i].json, &verifier));\r\n    }\r\n\r\n    static const char *invalidJson[] = {\r\n        \"\", \"string\", \"nada\",\r\n        \"\\\"open\", \"\\\"\\\\xC4\\\"\", \"\\\"\\\\u123h\\\"\", \"'string'\",\r\n        \"01\", \".1\", \"12.\", \"1e\", \"-\", \"-01\",\r\n        \"{\", \"{,}\", \"{\\\"key\\\": }\", \"{\\\"key: 123 }\", \"{ 'key': 123 }\",\r\n        \"[\", \"[,]\"\r\n    };\r\n\r\n    JsonVerifier verifyError(nullptr, 0);\r\n    for (size_t i = 0; i < dimof(invalidJson); i++) {\r\n        utassert(!json::Parse(invalidJson[i], &verifyError));\r\n    }\r\n\r\n    const JsonValue testData[] = {\r\n        JsonValue(\"/ComicBookInfo/1.0/title\", \"Meta data demo\"),\r\n        JsonValue(\"/ComicBookInfo/1.0/publicationMonth\", \"4\", json::Type_Number),\r\n        JsonValue(\"/ComicBookInfo/1.0/publicationYear\", \"2010\", json::Type_Number),\r\n        JsonValue(\"/ComicBookInfo/1.0/credits[0]/primary\", \"true\", json::Type_Bool),\r\n        JsonValue(\"/ComicBookInfo/1.0/credits[0]/role\", \"Writer\"),\r\n        JsonValue(\"/ComicBookInfo/1.0/credits[1]/primary\", \"false\", json::Type_Bool),\r\n        JsonValue(\"/ComicBookInfo/1.0/credits[1]/role\", \"Publisher\"),\r\n        JsonValue(\"/ComicBookInfo/1.0/credits[2]\", \"null\", json::Type_Null),\r\n        JsonValue(\"/appID\", \"Test/123\"),\r\n    };\r\n    const char *jsonSample = \"{\\n\\\r\n    \\\"ComicBookInfo/1.0\\\": {\\n\\\r\n        \\\"title\\\": \\\"Meta data demo\\\",\\n\\\r\n        \\\"publicationMonth\\\": 4,\\n\\\r\n        \\\"publicationYear\\\": 2010,\\n\\\r\n        \\\"credits\\\": [\\n\\\r\n            { \\\"primary\\\": true, \\\"role\\\": \\\"Writer\\\" },\\n\\\r\n            { \\\"primary\\\": false, \\\"role\\\": \\\"Publisher\\\" },\\n\\\r\n            null\\n\\\r\n        ]\\n\\\r\n    },\\n\\\r\n    \\\"appID\\\": \\\"Test/123\\\"\\n\\\r\n}\";\r\n    JsonVerifier sampleVerifier(testData, dimof(testData));\r\n    utassert(json::Parse(jsonSample, &sampleVerifier));\r\n}\r\n"
  },
  {
    "path": "src/utils/tests/SettingsUtil_ut.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"SettingsUtil.h\"\r\n\r\n// must be last due to assert() over-write\r\n#include \"UtAssert.h\"\r\n\r\nstatic const FieldInfo gSutPointIFields[] = {\r\n    { offsetof(PointI, x), Type_Int, 111 },\r\n    { offsetof(PointI, y), Type_Int, 222 },\r\n};\r\nstatic const StructInfo gSutPointIInfo = { sizeof(PointI), 2, gSutPointIFields, \"X\\0Y\" };\r\n\r\nstruct SutStructNested {\r\n    PointI point;\r\n    Vec<COLORREF> *colorArray;\r\n};\r\n\r\nstatic const FieldInfo gSutStructNestedFields[] = {\r\n    { offsetof(SutStructNested, point), Type_Struct, (intptr_t)&gSutPointIInfo },\r\n    { offsetof(SutStructNested, colorArray), Type_ColorArray, (intptr_t)\"#000000 #ffffff\" },\r\n};\r\nstatic const StructInfo gSutStructNestedInfo = { sizeof(SutStructNested), 2, gSutStructNestedFields, \"Point\\0ColorArray\" };\r\n\r\nstruct SutStructItem {\r\n    Vec<float> *floatArray;\r\n    PointI compactPoint;\r\n    SutStructNested nested;\r\n};\r\n\r\nstatic const FieldInfo gSutStructItemFields[] = {\r\n    { offsetof(SutStructItem, compactPoint), Type_Compact, (intptr_t)&gSutPointIInfo },\r\n    { offsetof(SutStructItem, floatArray), Type_FloatArray, 0 },\r\n    { offsetof(SutStructItem, nested), Type_Struct, (intptr_t)&gSutStructNestedInfo },\r\n};\r\nstatic const StructInfo gSutStructItemInfo = { sizeof(SutStructItem), 3, gSutStructItemFields, \"CompactPoint\\0FloatArray\\0Nested\" };\r\n\r\nstruct SutStruct {\r\n    int internal;\r\n    bool boolean;\r\n    COLORREF color;\r\n    float floatingPoint;\r\n    int integer;\r\n    WCHAR *string;\r\n    WCHAR *nullString;\r\n    WCHAR *escapedString;\r\n    char *utf8String;\r\n    char *nullUtf8String;\r\n    char *escapedUtf8String;\r\n    Vec<int> *intArray;\r\n    Vec<WCHAR *> *strArray;\r\n    Vec<WCHAR *> *emptyStrArray;\r\n    PointI point;\r\n    Vec<SutStructItem *> *sutStructItems;\r\n    char *internalString;\r\n};\r\n\r\nstatic const FieldInfo gSutStructFields[] = {\r\n    { (size_t)-1, Type_Comment, (intptr_t)\"This file will be overwritten - modify at your own risk!\\r\\n\" },\r\n    { offsetof(SutStruct, boolean), Type_Bool, (intptr_t)true },\r\n    { offsetof(SutStruct, color), Type_Color, 0xffcc9933 },\r\n    { offsetof(SutStruct, floatingPoint), Type_Float, (intptr_t)\"-3.14\" },\r\n    { offsetof(SutStruct, integer), Type_Int, 27 },\r\n    { offsetof(SutStruct, string), Type_String, (intptr_t)L\"String\" },\r\n    { offsetof(SutStruct, nullString), Type_String, 0 },\r\n    { offsetof(SutStruct, escapedString), Type_String, (intptr_t)L\"$\\nstring \" },\r\n    { offsetof(SutStruct, utf8String), Type_Utf8String, (intptr_t)\"Utf-8 String\" },\r\n    { offsetof(SutStruct, nullUtf8String), Type_Utf8String, 0 },\r\n    { offsetof(SutStruct, escapedUtf8String), Type_Utf8String, (intptr_t)\"$\\nstring \" },\r\n    { offsetof(SutStruct, intArray), Type_IntArray, (intptr_t)\"1 2 -3\" },\r\n    { offsetof(SutStruct, strArray), Type_StringArray, (intptr_t)\"one \\\"two three\\\" \\\"\\\"\" },\r\n    { offsetof(SutStruct, emptyStrArray), Type_StringArray, 0 },\r\n    { offsetof(SutStruct, point), Type_Struct, (intptr_t)&gSutPointIInfo },\r\n    { (size_t)-1, Type_Comment, 0 },\r\n    { offsetof(SutStruct, sutStructItems), Type_Array, (intptr_t)&gSutStructItemInfo },\r\n};\r\nstatic const StructInfo gSutStructInfo = { sizeof(SutStruct), 17, gSutStructFields, \"\\0Boolean\\0Color\\0FloatingPoint\\0Integer\\0String\\0NullString\\0EscapedString\\0Utf8String\\0NullUtf8String\\0EscapedUtf8String\\0IntArray\\0StrArray\\0EmptyStrArray\\0Point\\0\\0SutStructItems\" };\r\n\r\nvoid SettingsUtilTest()\r\n{\r\n    static const char *serialized = UTF8_BOM \"# This file will be overwritten - modify at your own risk!\\r\\n\\r\\n\\\r\nBoolean = true\\r\\n\\\r\nColor = #abcdef\\r\\n\\\r\nFloatingPoint = 2.7182\\r\\n\\\r\nInteger = -1234567890\\r\\n\\\r\nString = Might\\\\be\\\\a\\\\path\\r\\n\\\r\nEscapedString = $\\t$r$n$$ $\\r\\n\\\r\nUtf8String = another string\\r\\n\\\r\nEscapedUtf8String = $r$n[]\\t$\\r\\n\\\r\nIntArray = 3 1\\r\\n\\\r\nStrArray = \\\"with space\\\" plain \\\"quote:\\\"\\\"\\\"\\r\\n\\\r\nPoint [\\r\\n\\\r\n\\tX = -17\\r\\n\\\r\n\\tY = -18\\r\\n\\\r\n\\tZ = -19\\r\\n\\\r\n]\\r\\n\\\r\n\\r\\n\\\r\nSutStructItems [\\r\\n\\\r\n\\t[\\r\\n\\\r\n\\t\\tCompactPoint = -1 5\\r\\n\\\r\n\\t\\tFloatArray = -1.5 1.5\\r\\n\\\r\n\\t\\tNested [\\r\\n\\\r\n\\t\\t\\tPoint [\\r\\n\\\r\n\\t\\t\\t\\tX = 1\\r\\n\\\r\n\\t\\t\\t\\tY = 2\\r\\n\\\r\n\\t\\t\\t]\\r\\n\\\r\n\\t\\t\\tColorArray = \\r\\n\\\r\n\\t\\t]\\r\\n\\\r\n\\t]\\r\\n\\\r\n\\t[\\r\\n\\\r\n\\t\\tCompactPoint = 3 -4\\r\\n\\\r\n\\t\\tNested [\\r\\n\\\r\n\\t\\t\\tPoint [\\r\\n\\\r\n\\t\\t\\t\\tX = 5\\r\\n\\\r\n\\t\\t\\t\\tY = 6\\r\\n\\\r\n\\t\\t\\t]\\r\\n\\\r\n\\t\\t\\tColorArray = #12345678 #987654\\r\\n\\\r\n\\t\\t]\\r\\n\\\r\n\\t]\\r\\n\\\r\n]\\r\\n\\\r\nUnknownString = Forget-me-not\\r\\n\\\r\nUnknownNode [\\r\\n\\\r\n\\tAnotherPoint = 7 8\\r\\n\\\r\n\\tNested [\\r\\n\\\r\n\\t\\tKey = Value\\r\\n\\\r\n\\t]\\r\\n\\\r\n]\\r\\n\";\r\n\r\n    static const char *unknownOnly = UTF8_BOM \"\\\r\nUnknownString: Forget-me-not\\r\\n\\\r\n[Point]\\r\\n\\\r\nZ: -19\\r\\n\\\r\n[UnknownNode]\\r\\n\\\r\nAnotherPoint: 7 8\\r\\n\\\r\nNested [\\r\\n\\\r\nKey = Value\";\r\n\r\n    SutStruct *data = nullptr;\r\n    for (int i = 0; i < 3; i++) {\r\n        data = (SutStruct *)DeserializeStruct(&gSutStructInfo, serialized, data);\r\n        utassert(data->internal == i);\r\n        ScopedMem<char> reserialized(SerializeStruct(&gSutStructInfo, data, i < 2 ? unknownOnly : serialized));\r\n        utassert(str::Eq(serialized, reserialized));\r\n        data->internal++;\r\n    }\r\n    utassert(RGB(0xab, 0xcd, 0xef) == data->color);\r\n    utassert(str::Eq(data->escapedString, L\"\\t\\r\\n$ \"));\r\n    utassert(str::Eq(data->escapedUtf8String, \"\\r\\n[]\\t\"));\r\n    utassert(2 == data->intArray->Count() && 3 == data->intArray->At(0));\r\n    utassert(3 == data->strArray->Count() && 0 == data->emptyStrArray->Count());\r\n    utassert(str::Eq(data->strArray->At(0), L\"with space\") && str::Eq(data->strArray->At(1), L\"plain\") && str::Eq(data->strArray->At(2), L\"quote:\\\"\"));\r\n    utassert(2 == data->sutStructItems->Count());\r\n    utassert(PointI(-1, 5) == data->sutStructItems->At(0)->compactPoint);\r\n    utassert(2 == data->sutStructItems->At(0)->floatArray->Count());\r\n    utassert(0 == data->sutStructItems->At(0)->nested.colorArray->Count());\r\n    utassert(0 == data->sutStructItems->At(1)->floatArray->Count());\r\n    utassert(2 == data->sutStructItems->At(1)->nested.colorArray->Count());\r\n    utassert(0x12785634 == data->sutStructItems->At(1)->nested.colorArray->At(0));\r\n    utassert(!data->internalString);\r\n    utassert(!str::Eq(serialized, ScopedMem<char>(SerializeStruct(&gSutStructInfo, data))));\r\n    data->sutStructItems->At(0)->nested.point.x++;\r\n    utassert(!str::Eq(serialized, ScopedMem<char>(SerializeStruct(&gSutStructInfo, data, unknownOnly))));\r\n    FreeStruct(&gSutStructInfo, data);\r\n\r\n    data = (SutStruct *)DeserializeStruct(&gSutStructInfo, nullptr);\r\n    utassert(data && data->boolean && 0xffcc9933 == data->color);\r\n    utassert(-3.14f == data->floatingPoint && 27 == data->integer);\r\n    utassert(str::Eq(data->string, L\"String\") && !data->nullString && str::Eq(data->escapedString, L\"$\\nstring \"));\r\n    utassert(str::Eq(data->utf8String, \"Utf-8 String\") && !data->nullUtf8String && str::Eq(data->escapedUtf8String, \"$\\nstring \"));\r\n    utassert(data->intArray && 3 == data->intArray->Count() && 1 == data->intArray->At(0));\r\n    utassert(2 == data->intArray->At(1) && -3 == data->intArray->At(2));\r\n    utassert(3 == data->strArray->Count() && 0 == data->emptyStrArray->Count());\r\n    utassert(str::Eq(data->strArray->At(0), L\"one\") && str::Eq(data->strArray->At(1), L\"two three\") && str::Eq(data->strArray->At(2), L\"\"));\r\n    utassert(PointI(111, 222) == data->point);\r\n    utassert(data->sutStructItems && 0 == data->sutStructItems->Count());\r\n    FreeStruct(&gSutStructInfo, data);\r\n\r\n    static const char *boolData[] = {\r\n        \"Boolean = true\",   \"Boolean = false\",\r\n        \"Boolean = TRUE\",   \"Boolean = FALSE\",\r\n        \"Boolean = yes\",    \"Boolean = no\",\r\n        \"Boolean = Yes\",    \"Boolean = No\",\r\n        \"Boolean = 1\",      \"Boolean = 0\",\r\n    };\r\n    for (int i = 0; i < dimof(boolData); i++) {\r\n        data = (SutStruct *)DeserializeStruct(&gSutStructInfo, boolData[i]);\r\n        utassert(data->boolean == ((i % 2) == 0));\r\n        FreeStruct(&gSutStructInfo, data);\r\n    }\r\n}\r\n"
  },
  {
    "path": "src/utils/tests/SimpleLog_ut.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"SimpleLog.h\"\r\n\r\n// must be last due to assert() over-write\r\n#include \"UtAssert.h\"\r\n\r\nvoid SimpleLogTest()\r\n{\r\n    slog::MultiLogger log;\r\n    log.LogAndFree(str::Dup(L\"Don't leak me!\"));\r\n\r\n    slog::MemoryLogger logAll;\r\n    log.AddLogger(&logAll);\r\n\r\n    {\r\n        slog::MemoryLogger ml;\r\n        log.AddLogger(&ml);\r\n        log.Log(L\"Test1\");\r\n        ml.Log(L\"ML\");\r\n        ml.LogFmt(L\"%s : %d\", L\"filen\\xE4me.pdf\", 25);\r\n        log.RemoveLogger(&ml);\r\n\r\n        utassert(str::Eq(ml.GetData(), L\"Test1\\r\\nML\\r\\nfilen\\xE4me.pdf : 25\\r\\n\"));\r\n    }\r\n\r\n    {\r\n        HANDLE hRead, hWrite;\r\n        CreatePipe(&hRead, &hWrite, nullptr, 0);\r\n        slog::FileLogger fl(hWrite);\r\n        log.AddLogger(&fl);\r\n        log.Log(L\"Test2\");\r\n        fl.Log(L\"FL\");\r\n        log.LogFmt(L\"%s : %d\", L\"filen\\xE4me.pdf\", 25);\r\n        log.RemoveLogger(&fl);\r\n\r\n        char pipeData[32];\r\n        char *expected = \"Test2\\r\\nFL\\r\\nfilen\\xC3\\xA4me.pdf : 25\\r\\n\";\r\n        DWORD len;\r\n        BOOL ok = ReadFile(hRead, pipeData, sizeof(pipeData), &len, nullptr);\r\n        utassert(ok && len == str::Len(expected));\r\n        pipeData[len] = '\\0';\r\n        utassert(str::Eq(pipeData, expected));\r\n        CloseHandle(hRead);\r\n    }\r\n\r\n    utassert(str::Eq(logAll.GetData(), L\"Test1\\r\\nTest2\\r\\nfilen\\xE4me.pdf : 25\\r\\n\"));\r\n    log.RemoveLogger(&logAll);\r\n\r\n    // don't leak the logger, don't crash on logging nullptr\r\n    log.AddLogger(new slog::DebugLogger());\r\n    log.Log(nullptr);\r\n}\r\n"
  },
  {
    "path": "src/utils/tests/SquareTreeParser_ut.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"SquareTreeParser.h\"\r\n\r\n// must be last due to assert() over-write\r\n#include \"UtAssert.h\"\r\n\r\nvoid SquareTreeTest()\r\n{\r\n    static const char *keyValueData[] = {\r\n        UTF8_BOM \"key = value\",\r\n        UTF8_BOM \"key = value\",\r\n        UTF8_BOM \"key=value\",\r\n        UTF8_BOM \" key =value \",\r\n        UTF8_BOM \"  key= value  \",\r\n        UTF8_BOM \"key: value\",\r\n        UTF8_BOM \"key : value\",\r\n        UTF8_BOM \"key :value\",\r\n        UTF8_BOM \"# key and value:\\n\\tkey value\\n\",\r\n        UTF8_BOM \"key\\t\\tvalue\",\r\n    };\r\n\r\n    for (size_t i = 0; i < dimof(keyValueData); i++) {\r\n        SquareTree keyValue(keyValueData[i]);\r\n        utassert(keyValue.root && 1 == keyValue.root->data.Count());\r\n        SquareTreeNode::DataItem& item = keyValue.root->data.At(0);\r\n        utassert(!item.isChild && str::Eq(item.key, \"key\") && str::Eq(item.value.str, \"value\"));\r\n        utassert(!keyValue.root->GetChild(\"key\"));\r\n        utassert(str::Eq(keyValue.root->GetValue(\"KEY\"), \"value\"));\r\n        size_t off = 0;\r\n        utassert(str::Eq(keyValue.root->GetValue(\"key\", &off), \"value\"));\r\n        utassert(!keyValue.root->GetValue(\"key\", &off));\r\n    }\r\n\r\n    static const char *nodeData[] = {\r\n        UTF8_BOM \"node [\\nkey = value\\n]\",\r\n        UTF8_BOM \"node[ # ignore comment\\n\\tkey: value\\n] # end of node\\n\",\r\n        UTF8_BOM \"node\\n[\\nkey:value\",\r\n        UTF8_BOM \"node\\n# node content:\\n\\t[\\n\\tkey: value\\n\\t]\\n\",\r\n        UTF8_BOM \"node [\\n  key : value\\n]\\n]\",\r\n        UTF8_BOM \"node[\\nkey=value\\n]]]\",\r\n        UTF8_BOM \"[node]\\nkey = value\\n\",\r\n        UTF8_BOM \"[ node ]\\nkey = value\\n\",\r\n    };\r\n\r\n    for (size_t i = 0; i < dimof(nodeData); i++) {\r\n        SquareTree node(nodeData[i]);\r\n        utassert(node.root && 1 == node.root->data.Count());\r\n        SquareTreeNode::DataItem& item = node.root->data.At(0);\r\n        utassert(item.isChild && str::Eq(item.key, \"node\"));\r\n        utassert(item.value.child == node.root->GetChild(\"NODE\"));\r\n        size_t off = 0;\r\n        utassert(item.value.child == node.root->GetChild(\"node\", &off));\r\n        utassert(!node.root->GetChild(\"node\", &off));\r\n        utassert(str::Eq(item.value.child->GetValue(\"key\"), \"value\"));\r\n    }\r\n\r\n    static const char *arrayData[] = {\r\n        UTF8_BOM \"array [\\n item = 0 \\n] [\\n item = 1 \\n]\",\r\n        UTF8_BOM \"array [\\n item = 0 \\n]\\n array [\\n item = 1 \\n]\",\r\n        UTF8_BOM \"[array]\\n item = 0 \\n[array]\\n item = 1 \\n\",\r\n        UTF8_BOM \"array [\\n item = 0 \\n]\\n [array]\\n item = 1 \\n\",\r\n    };\r\n\r\n    for (size_t i = 0; i < dimof(arrayData); i++) {\r\n        SquareTree array(arrayData[i]);\r\n        utassert(array.root && 2 == array.root->data.Count());\r\n        size_t off = 0;\r\n        SquareTreeNode *node = array.root->GetChild(\"array\", &off);\r\n        utassert(node && 1 == node->data.Count() && str::Eq(node->GetValue(\"item\"), \"0\"));\r\n        node = array.root->GetChild(\"array\", &off);\r\n        utassert(node && 1 == node->data.Count() && str::Eq(node->GetValue(\"item\"), \"1\"));\r\n        node = array.root->GetChild(\"array\", &off);\r\n        utassert(!node && 2 == off);\r\n    }\r\n\r\n    static const char *serArrayData[] = {\r\n        UTF8_BOM \"array [\\n[\\n item = 0 \\n]\\n[\\n item = 1 \\n]\\n]\\n\",\r\n        UTF8_BOM \"array [\\n[\\n item = 0 \\n] [\\n item = 1 \\n]]\",\r\n        UTF8_BOM \"array \\n# serialized array with two items: \\n[\\n\"\r\n            \"# first item: \\n[\\n item = 0 \\n] # end of first item\\n\"\r\n            \"# second item: \\n[\\n item = 1 \\n] # end of second item\\n\"\r\n            \"] # end of array\",\r\n        UTF8_BOM \"array [\\n[\\n item = 0 \\n] [\\n item = 1\",\r\n        UTF8_BOM \"[array]\\n[\\n item = 0 \\n] [\\n item = 1 \\n]\",\r\n    };\r\n\r\n    for (size_t i = 0; i < dimof(serArrayData); i++) {\r\n        SquareTree serArray(serArrayData[i]);\r\n        utassert(serArray.root && 1 == serArray.root->data.Count());\r\n        SquareTreeNode *array = serArray.root->GetChild(\"array\");\r\n        utassert(2 == array->data.Count());\r\n        size_t off = 0;\r\n        SquareTreeNode *node = array->GetChild(\"\", &off);\r\n        utassert(node && 1 == node->data.Count() && str::Eq(node->GetValue(\"item\"), \"0\"));\r\n        node = array->GetChild(\"\", &off);\r\n        utassert(node && 1 == node->data.Count() && str::Eq(node->GetValue(\"item\"), \"1\"));\r\n        node = array->GetChild(\"\", &off);\r\n        utassert(!node && 2 == off);\r\n    }\r\n\r\n    static const char *valueArrayData[] = {\r\n        UTF8_BOM \"count = 0\\ncount = 1\",\r\n        UTF8_BOM \"count:0\\ncount:1\\n\",\r\n        UTF8_BOM \"# first:\\n count : 0 \\n#second:\\n count : 1 \\n\",\r\n    };\r\n\r\n    for (size_t i = 0; i < dimof(valueArrayData); i++) {\r\n        SquareTree valueArray(valueArrayData[i]);\r\n        utassert(valueArray.root && 2 == valueArray.root->data.Count());\r\n        size_t off = 0;\r\n        const char *value = valueArray.root->GetValue(\"count\", &off);\r\n        utassert(str::Eq(value, \"0\") && 1 == off);\r\n        value = valueArray.root->GetValue(\"count\", &off);\r\n        utassert(str::Eq(value, \"1\") && 2 == off);\r\n        value = valueArray.root->GetValue(\"count\", &off);\r\n        utassert(!value && 2 == off);\r\n    }\r\n\r\n    static const char *emptyNodeData[] = {\r\n        UTF8_BOM \"node [\\n]\",\r\n        UTF8_BOM \"node \\n [ \\n ] \\n\",\r\n        UTF8_BOM \"node [\",\r\n        UTF8_BOM \"[node] \\n\",\r\n        UTF8_BOM \"[node]\",\r\n        UTF8_BOM \"  [  node  ]  \",\r\n    };\r\n\r\n    for (size_t i = 0; i < dimof(emptyNodeData); i++) {\r\n        SquareTree emptyNode(emptyNodeData[i]);\r\n        utassert(emptyNode.root && 1 == emptyNode.root->data.Count());\r\n        utassert(emptyNode.root->GetChild(\"node\"));\r\n        utassert(0 == emptyNode.root->GetChild(\"node\")->data.Count());\r\n    }\r\n\r\n    static const char *halfBrokenData[] = {\r\n        \"node [\\n child = \\n]\\n key = value\",\r\n        \"node [\\nchild\\n]\\n]\\n key = value\",\r\n        \"node[\\n[node\\nchild\\nchild [ node\\n]\\n key = value\",\r\n        \"node [\\r key = value\\n node [\\nchild\\r\\n] key = value\",\r\n    };\r\n\r\n    for (size_t i = 0; i < dimof(halfBrokenData); i++) {\r\n        SquareTree halfBroken(halfBrokenData[i]);\r\n        utassert(halfBroken.root && 2 == halfBroken.root->data.Count());\r\n        utassert(halfBroken.root->GetChild(\"node\") == halfBroken.root->data.At(0).value.child);\r\n        SquareTreeNode *node = halfBroken.root->GetChild(\"Node\");\r\n        utassert(node && 1 == node->data.Count() && str::Eq(node->GetValue(\"child\"), \"\"));\r\n        utassert(str::Eq(halfBroken.root->GetValue(\"key\"), \"value\"));\r\n        utassert(!halfBroken.root->GetValue(\"node\") && !halfBroken.root->GetChild(\"key\"));\r\n    }\r\n\r\n    SquareTree null(nullptr);\r\n    utassert(!null.root);\r\n\r\n    SquareTree empty(\"\");\r\n    utassert(empty.root && 0 == empty.root->data.Count());\r\n\r\n    SquareTree onlyBom(UTF8_BOM);\r\n    utassert(onlyBom.root && 0 == onlyBom.root->data.Count());\r\n\r\n    SquareTree nested(UTF8_BOM \"node [\\n node [\\n node [\\n node [\\n node [\\n depth 5 \\n]\\n]\\n]\\n]\\n]\");\r\n    SquareTreeNode *node = nested.root;\r\n    for (size_t i = 0; i < 5; i++) {\r\n        utassert(node && 1 == node->data.Count());\r\n        node = node->GetChild(\"node\");\r\n    }\r\n    utassert(node && 1 == node->data.Count() && str::Eq(node->GetValue(\"depth\"), \"5\"));\r\n\r\n    SquareTree mixed(UTF8_BOM \"node1 [\\n [node2] \\n key:value\");\r\n    utassert(mixed.root && mixed.root->GetChild(\"node1\") && mixed.root->GetChild(\"node2\"));\r\n    utassert(0 == mixed.root->GetChild(\"node1\")->data.Count());\r\n    utassert(str::Eq(mixed.root->GetChild(\"node2\")->GetValue(\"Key\"), \"value\"));\r\n}\r\n"
  },
  {
    "path": "src/utils/tests/StrFormat_ut.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"StrFormat.h\"\r\n\r\n// must be last due to assert() over-write\r\n#include \"UtAssert.h\"\r\n\r\n#define check(s, expected) \\\r\n{ \\\r\n    utassert(str::Eq(s, expected)); \\\r\n}\r\n\r\nvoid StrFormatTest()\r\n{\r\n    fmt::Fmt f(\"int: %d, s: %s\");\r\n    char *s = f.i(5).s(\"foo\").Get();\r\n    check(s, \"int: 5, s: foo\");\r\n\r\n    check(f.ParseFormat(\"be{0}af\").i(-1).Get(), \"be-1af\");\r\n    check(f.ParseFormat(\"\\\\{03foo{0}\").i(255).Get(), \"{03foo255\");\r\n    check(f.ParseFormat(\"int: {1}, s: {0}\").s(L\"hello\").i(-1).Get(), \"int: -1, s: hello\");\r\n    check(f.ParseFormat(\"{0}\").i(1).Get(), \"1\");\r\n    check(f.ParseFormat(\"{0}goal\").s(\"ah\").Get(), \"ahgoal\");\r\n    check(f.ParseFormat(\"{1}-{0}\").s(\"so\").s(L\"r\").Get(), \"r-so\");\r\n    check(f.ParseFormat(\"{0}\").s(L\"1\").Get(), \"1\");\r\n    s = f.ParseFormat(\"c: %c, i: %d, f: %f, d: %f, s: %s, ws: %s, c: {0}, i: {1}, f: {2}, d: {3}, s: {4}, ws: {5}, i: {1}\").c('x').i(-18).f(3.45).f(-18.38).s(\"str\").s(L\"wstr\").GetDup();\r\n    check(s, \"c: x, i: -18, f: 3.45, d: -18.38, s: str, ws: wstr, c: x, i: -18, f: 3.45, d: -18.38, s: str, ws: wstr, i: -18\");\r\n    free(s);\r\n}\r\n"
  },
  {
    "path": "src/utils/tests/StrUtil_ut.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n\r\n// must be last due to assert() over-write\r\n#include \"UtAssert.h\"\r\n\r\nstatic void StrReplaceTestOne(const char *s, const char *toReplace, const char *replaceWith, const char *expected)\r\n{\r\n    char *res = str::Replace(s, toReplace, replaceWith);\r\n    utassert(str::Eq(res, expected));\r\n    free(res);\r\n}\r\n\r\nstatic void StrReplaceTest()\r\n{\r\n    const char *d[] = {\r\n        \"golagon\", \"gon\", \"rabato\", \"golarabato\",\r\n        \"a\", \"a\", \"bor\", \"bor\",\r\n        \"abora\", \"a\", \"\", \"bor\",\r\n        \"aaaaaa\", \"a\", \"b\", \"bbbbbb\",\r\n        \"aba\", \"a\", \"ccc\", \"cccbccc\",\r\n        \"Aba\", \"a\", \"c\", \"Abc\",\r\n        \"abc\", \"abc\", \"\", \"\",\r\n        nullptr, \"a\", \"b\", nullptr,\r\n        \"a\", \"\", \"b\", nullptr,\r\n        \"a\", \"b\", nullptr, nullptr,\r\n    };\r\n    size_t n = dimof(d) / 4;\r\n    for (size_t i = 0; i < n; i++) {\r\n        StrReplaceTestOne(d[i*4], d[i*4+1], d[i*4+2], d[i*4+3]);\r\n    }\r\n\r\n    struct {\r\n        const WCHAR *string, *find, *replace, *result;\r\n    } data[] = {\r\n        { L\"golagon\", L\"gon\", L\"rabato\", L\"golarabato\" },\r\n        { L\"a\", L\"a\", L\"bor\", L\"bor\" },\r\n        { L\"abora\", L\"a\", L\"\", L\"bor\" },\r\n        { L\"aaaaaa\", L\"a\", L\"b\", L\"bbbbbb\" },\r\n        { L\"aba\", L\"a\", L\"ccc\", L\"cccbccc\" },\r\n        { L\"Aba\", L\"a\", L\"c\", L\"Abc\" },\r\n        { L\"abc\", L\"abc\", L\"\", L\"\" },\r\n        { nullptr, L\"a\", L\"b\", nullptr },\r\n        { L\"a\", L\"\", L\"b\", nullptr },\r\n        { L\"a\", L\"b\", nullptr, nullptr },\r\n    };\r\n    for (size_t i = 0; i < dimof(data); i++) {\r\n        ScopedMem<WCHAR> result(str::Replace(data[i].string, data[i].find, data[i].replace));\r\n        utassert(str::Eq(result, data[i].result));\r\n    }\r\n}\r\n\r\nstatic void StrSeqTest()\r\n{\r\n    const char *s = \"foo\\0a\\0bar\\0\";\r\n    utassert(0 == seqstrings::StrToIdx(s, \"foo\"));\r\n    utassert(1 == seqstrings::StrToIdx(s, \"a\"));\r\n    utassert(2 == seqstrings::StrToIdx(s, \"bar\"));\r\n\r\n    utassert(0 == seqstrings::StrToIdx(s, L\"foo\"));\r\n    utassert(1 == seqstrings::StrToIdx(s, L\"a\"));\r\n    utassert(2 == seqstrings::StrToIdx(s, L\"bar\"));\r\n\r\n    utassert(str::Eq(\"foo\", seqstrings::IdxToStr(s, 0)));\r\n    utassert(str::Eq(\"a\", seqstrings::IdxToStr(s, 1)));\r\n    utassert(str::Eq(\"bar\", seqstrings::IdxToStr(s, 2)));\r\n\r\n    utassert(0 == seqstrings::StrToIdx(s, \"foo\"));\r\n    utassert(1 == seqstrings::StrToIdx(s, \"a\"));\r\n    utassert(2 == seqstrings::StrToIdx(s, \"bar\"));\r\n    utassert(-1 == seqstrings::StrToIdx(s, \"fo\"));\r\n    utassert(-1 == seqstrings::StrToIdx(s, \"\"));\r\n    utassert(-1 == seqstrings::StrToIdx(s, \"ab\"));\r\n    utassert(-1 == seqstrings::StrToIdx(s, \"baro\"));\r\n    utassert(-1 == seqstrings::StrToIdx(s, \"ba\"));\r\n\r\n    utassert(0 == seqstrings::StrToIdx(s, L\"foo\"));\r\n    utassert(1 == seqstrings::StrToIdx(s, L\"a\"));\r\n    utassert(2 == seqstrings::StrToIdx(s, L\"bar\"));\r\n    utassert(-1 == seqstrings::StrToIdx(s, L\"fo\"));\r\n    utassert(-1 == seqstrings::StrToIdx(s, L\"\"));\r\n    utassert(-1 == seqstrings::StrToIdx(s, L\"ab\"));\r\n    utassert(-1 == seqstrings::StrToIdx(s, L\"baro\"));\r\n    utassert(-1 == seqstrings::StrToIdx(s, L\"ba\"));\r\n}\r\n\r\nstatic void StrIsDigitTest()\r\n{\r\n    const char *nonDigits = \"/:.bz{}\";\r\n    const char *digits = \"0123456789\";\r\n    for (size_t i = 0; i < str::Len(nonDigits); i++) {\r\n#if 0\r\n        if (str::IsDigit(nonDigits[i])) {\r\n            char c = nonDigits[i];\r\n            printf(\"%c is incorrectly determined as a digit\\n\", c);\r\n        }\r\n#endif\r\n        utassert(!str::IsDigit(nonDigits[i]));\r\n    }\r\n    for (size_t i = 0; i < str::Len(digits); i++) {\r\n        utassert(str::IsDigit(digits[i]));\r\n    }\r\n\r\n    const WCHAR *nonDigitsW = L\"/:.bz{}\";\r\n    const WCHAR *digitsW = L\"0123456789\";\r\n    for (size_t i = 0; i < str::Len(nonDigitsW); i++) {\r\n        utassert(!str::IsDigit(nonDigitsW[i]));\r\n    }\r\n    for (size_t i = 0; i < str::Len(digitsW); i++) {\r\n        utassert(str::IsDigit(digitsW[i]));\r\n    }\r\n}\r\n\r\nstatic void StrConvTest()\r\n{\r\n    WCHAR wbuf[4];\r\n    char cbuf[4];\r\n    size_t conv = str::Utf8ToWcharBuf(\"testing\", 4, wbuf, dimof(wbuf));\r\n    utassert(conv == 3 && str::Eq(wbuf, L\"tes\"));\r\n    conv = str::WcharToUtf8Buf(L\"abc\", cbuf, dimof(cbuf));\r\n    utassert(conv == 3 && str::Eq(cbuf, \"abc\"));\r\n    conv = str::Utf8ToWcharBuf(\"ab\\xF0\\x90\\x82\\x80\", 6, wbuf, dimof(wbuf));\r\n    utassert(conv == 3 && str::StartsWith(wbuf, L\"ab\") && wbuf[2] == 0xD800);\r\n    conv = str::Utf8ToWcharBuf(\"ab\\xF0\\x90\\x82\\x80\", 6, wbuf, dimof(wbuf) - 1);\r\n    utassert(conv == 1 && str::Eq(wbuf, L\"a\"));\r\n    conv = str::WcharToUtf8Buf(L\"ab\\u20AC\", cbuf, dimof(cbuf));\r\n    utassert(conv == 0 && str::Eq(cbuf, \"\"));\r\n    conv = str::WcharToUtf8Buf(L\"abcd\", cbuf, dimof(cbuf));\r\n    utassert(conv == 0 && str::Eq(cbuf, \"\"));\r\n}\r\n\r\nstatic void StrUrlExtractTest()\r\n{\r\n    utassert(!url::GetFileName(L\"\"));\r\n    utassert(!url::GetFileName(L\"#hash_only\"));\r\n    utassert(!url::GetFileName(L\"?query=only\"));\r\n    ScopedMem<WCHAR> fileName(url::GetFileName(L\"http://example.net/filename.ext\"));\r\n    utassert(str::Eq(fileName, L\"filename.ext\"));\r\n    fileName.Set(url::GetFileName(L\"http://example.net/filename.ext#with_hash\"));\r\n    utassert(str::Eq(fileName, L\"filename.ext\"));\r\n    fileName.Set(url::GetFileName(L\"http://example.net/path/to/filename.ext?more=data\"));\r\n    utassert(str::Eq(fileName, L\"filename.ext\"));\r\n    fileName.Set(url::GetFileName(L\"http://example.net/pa%74h/na%2f%6d%65%2ee%78t\"));\r\n    utassert(str::Eq(fileName, L\"na/me.ext\"));\r\n    fileName.Set(url::GetFileName(L\"http://example.net/%E2%82%AC\"));\r\n    utassert(str::Eq((char *)fileName.Get(), \"\\xAC\\x20\"));\r\n}\r\n\r\nvoid StrTest()\r\n{\r\n    WCHAR buf[32];\r\n    WCHAR *str = L\"a string\";\r\n    utassert(str::Len(str) == 8);\r\n    utassert(str::Eq(str, L\"a string\") && str::Eq(str, str));\r\n    utassert(!str::Eq(str, nullptr) && !str::Eq(str, L\"A String\"));\r\n    utassert(str::EqI(str, L\"A String\") && str::EqI(str, str));\r\n    utassert(!str::EqI(str, nullptr) && str::EqI((char*)nullptr, (char*)nullptr));\r\n    utassert(str::EqN(L\"abcd\", L\"abce\", 3) && !str::EqN(L\"abcd\", L\"Abcd\", 3));\r\n    utassert(str::EqNI(L\"abcd\", L\"ABCE\", 3) && !str::EqNI(L\"abcd\", L\"Ebcd\", 3));\r\n    utassert(str::StartsWith(str, L\"a s\") && str::StartsWithI(str, L\"A Str\"));\r\n    utassert(!str::StartsWith(str, L\"Astr\"));\r\n    utassert(str::EndsWith(str, L\"ing\") && str::EndsWithI(str, L\"ING\"));\r\n    utassert(!str::EndsWith(str, L\"ung\"));\r\n    utassert(str::IsEmpty((char*)nullptr) && str::IsEmpty((WCHAR*)nullptr)&& str::IsEmpty(L\"\") && !str::IsEmpty(str));\r\n    utassert(str::FindChar(str, 's') && !str::FindChar(str, 'S'));\r\n    size_t len = str::BufSet(buf, dimof(buf), str);\r\n    utassert(len == str::Len(buf) && str::Eq(buf, str));\r\n    len = str::BufSet(buf, 6, str);\r\n    utassert(len == 5 && str::Eq(buf, L\"a str\"));\r\n\r\n    str = str::Dup(buf);\r\n    utassert(str::Eq(str, buf));\r\n    free(str);\r\n    str = str::DupN(buf, 4);\r\n    utassert(str::Eq(str, L\"a st\"));\r\n    free(str);\r\n    str = str::Format(L\"%s\", buf);\r\n    utassert(str::Eq(str, buf));\r\n    free(str);\r\n    {\r\n        ScopedMem<WCHAR> large(AllocArray<WCHAR>(2000));\r\n        memset(large, 0x11, 1998);\r\n        str = str::Format(L\"%s\", large);\r\n        utassert(str::Eq(str, large));\r\n        free(str);\r\n    }\r\n#if 0\r\n    // TODO: this test slows down DEBUG builds significantly\r\n    str = str::Format(L\"%s\", L\"\\uFFFF\");\r\n    // TODO: in VS2015, str matches L\"\\uFFFF\" instead of nullptr\r\n    utassert(str::Eq(str, nullptr));\r\n    free(str);\r\n#endif\r\n    str = str::Join(buf, buf);\r\n    utassert(str::Len(str) == 2 * str::Len(buf));\r\n    free(str);\r\n    str = str::Join(nullptr, L\"ab\");\r\n    utassert(str::Eq(str, L\"ab\"));\r\n    free(str);\r\n    str = str::Join(L\"\\uFDEF\", L\"\\uFFFF\");\r\n    utassert(str::Eq(str, L\"\\uFDEF\\uFFFF\"));\r\n    free(str);\r\n\r\n    str::BufSet(buf, dimof(buf), L\"abc\\1efg\\1\");\r\n    size_t count = str::TransChars(buf, L\"ace\", L\"ACE\");\r\n    utassert(str::Eq(buf, L\"AbC\\1Efg\\1\") && count == 3);\r\n    count = str::TransChars(buf, L\"\\1\", L\"\\0\");\r\n    utassert(str::Eq(buf, L\"AbC\") && str::Eq(buf + 4, L\"Efg\") && count == 2);\r\n    count = str::TransChars(buf, L\"\", L\"X\");\r\n    utassert(str::Eq(buf, L\"AbC\") && count == 0);\r\n\r\n    str::BufSet(buf, dimof(buf), L\"blogarapato\");\r\n    count = str::RemoveChars(buf, L\"bo\");\r\n    utassert(3 == count);\r\n    utassert(str::Eq(buf, L\"lgarapat\"));\r\n\r\n    str::BufSet(buf, dimof(buf), L\"one\\r\\ntwo\\t\\v\\f\\tthree\");\r\n    count = str::NormalizeWS(buf);\r\n    utassert(4 == count);\r\n    utassert(str::Eq(buf, L\"one two three\"));\r\n\r\n    str::BufSet(buf, dimof(buf), L\" one    two three \");\r\n    count = str::NormalizeWS(buf);\r\n    utassert(5 == count);\r\n    utassert(str::Eq(buf, L\"one two three\"));\r\n\r\n    count = str::NormalizeWS(buf);\r\n    utassert(0 == count);\r\n    utassert(str::Eq(buf, L\"one two three\"));\r\n\r\n    str = L\"[Open(\\\"filename.pdf\\\",0,1,0)]\";\r\n    {\r\n        UINT u1 = 0;\r\n        WCHAR *str1 = nullptr;\r\n        const WCHAR *end = str::Parse(str, L\"[Open(\\\"%s\\\",%? 0,%u,0)]\", &str1, &u1);\r\n        utassert(end && !*end);\r\n        utassert(u1 == 1 && str::Eq(str1, L\"filename.pdf\"));\r\n        free(str1);\r\n    }\r\n\r\n    {\r\n        UINT u1 = 0;\r\n        ScopedMem<WCHAR> str1;\r\n        const WCHAR *end = str::Parse(str, L\"[Open(\\\"%S\\\",0%?,%u,0)]\", &str1, &u1);\r\n        utassert(end && !*end);\r\n        utassert(u1 == 1 && str::Eq(str1, L\"filename.pdf\"));\r\n\r\n        utassert(str::Parse(L\"0xABCD\", L\"%x\", &u1));\r\n        utassert(u1 == 0xABCD);\r\n        utassert(str::Parse(L\"ABCD\", L\"%2x%S\", &u1, &str1));\r\n        utassert(u1 == 0xAB && str::Eq(str1, L\"CD\"));\r\n    }\r\n\r\n    {\r\n        int i1, i2;\r\n        const WCHAR *end = str::Parse(L\"1, 2+3\", L\"%d,%d\", &i1, &i2);\r\n        utassert(end && str::Eq(end, L\"+3\"));\r\n        utassert(i1 == 1 && i2 == 2);\r\n        end = str::Parse(end, L\"+3\");\r\n        utassert(end && !*end);\r\n\r\n        utassert(str::Parse(L\" -2\", L\"%d\", &i1));\r\n        utassert(i1 == -2);\r\n        utassert(str::Parse(L\" 2\", L\" %u\", &i1));\r\n        utassert(i1 == 2);\r\n        utassert(str::Parse(L\"123-456\", L\"%3d%3d6\", &i1, &i2));\r\n        utassert(i1 == 123 && i2 == -45);\r\n        utassert(!str::Parse(L\"123\", L\"%4d\", &i1));\r\n        utassert(str::Parse(L\"654\", L\"%3d\", &i1));\r\n        utassert(i1 == 654);\r\n    }\r\n\r\n    utassert(str::Parse(L\"abc\", L\"abc%$\"));\r\n    utassert(str::Parse(L\"abc\", L\"a%?bc%?d%$\"));\r\n    utassert(!str::Parse(L\"abc\", L\"ab%$\"));\r\n    utassert(str::Parse(L\"a \\r\\n\\t b\", L\"a%_b\"));\r\n    utassert(str::Parse(L\"ab\", L\"a%_b\"));\r\n    utassert(!str::Parse(L\"a,b\", L\"a%_b\"));\r\n    utassert(str::Parse(L\"a\\tb\", L\"a% b\"));\r\n    utassert(!str::Parse(L\"a\\r\\nb\", L\"a% b\"));\r\n    utassert(str::Parse(L\"a\\r\\nb\", L\"a% %_b\"));\r\n    utassert(!str::Parse(L\"ab\", L\"a% b\"));\r\n    utassert(!str::Parse(L\"%+\", L\"+\") && !str::Parse(L\"%+\", L\"%+\"));\r\n\r\n    utassert(str::Parse(\"abcd\", 3, \"abc%$\"));\r\n    utassert(str::Parse(\"abc\", 3, \"a%?bc%?d%$\"));\r\n    utassert(!str::Parse(\"abcd\", 3, \"abcd\"));\r\n\r\n    {\r\n        const char *str1 = \"string\";\r\n        utassert(str::Parse(str1, 4, \"str\") == str1 + 3);\r\n\r\n        float f1, f2;\r\n        const WCHAR *end = str::Parse(L\"%1.23y -2e-3z\", L\"%%%fy%fz%$\", &f1, &f2);\r\n        utassert(end && !*end);\r\n        utassert(f1 == 1.23f && f2 == -2e-3f);\r\n        f1 = 0; f2 = 0;\r\n        const char *end2 = str::Parse(\"%1.23y -2e-3zlah\", 13, \"%%%fy%fz%$\", &f1, &f2);\r\n        utassert(end2 && str::Eq(end2, \"lah\"));\r\n        utassert(f1 == 1.23f && f2 == -2e-3f);\r\n    }\r\n\r\n    {\r\n        WCHAR *str1 = nullptr;\r\n        WCHAR c1;\r\n        utassert(!str::Parse(L\"no exclamation mark?\", L\"%s!\", &str1));\r\n        utassert(!str1);\r\n        utassert(str::Parse(L\"xyz\", L\"x%cz\", &c1));\r\n        utassert(c1 == 'y');\r\n        utassert(!str::Parse(L\"leaks memory!?\", L\"%s!%$\", &str1));\r\n        free(str1);\r\n    }\r\n\r\n    {\r\n        ScopedMem<char> str1;\r\n        int i, j;\r\n        float f;\r\n        utassert(str::Parse(\"ansi string, -30-20 1.5%\", \"%S,%d%?-%2u%f%%%$\", &str1, &i, &j, &f));\r\n        utassert(str::Eq(str1, \"ansi string\") && i == -30 && j == 20 && f == 1.5f);\r\n    }\r\n    {\r\n        ScopedMem<WCHAR> str1;\r\n        int i, j;\r\n        float f;\r\n        utassert(str::Parse(L\"wide string, -30-20 1.5%\", L\"%S,%d%?-%2u%f%%%$\", &str1, &i, &j, &f));\r\n        utassert(str::Eq(str1, L\"wide string\") && i == -30 && j == 20 && f == 1.5f);\r\n    }\r\n\r\n    {\r\n        const char *path = \"M10 80 C 40 10, 65\\r\\n10,\\t95\\t80 S 150 150, 180 80\\nA 45 45, 0, 1, 0, 125 125\\nA 1 2 3\\n0\\n1\\n20  -20\";\r\n        float f[6];\r\n        int b[2];\r\n        const char *s = str::Parse(path, \"M%f%_%f\", &f[0], &f[1]);\r\n        utassert(s && f[0] == 10 && f[1] == 80);\r\n        s = str::Parse(s + 1, \"C%f%_%f,%f%_%f,%f%_%f\", &f[0], &f[1], &f[2], &f[3], &f[4], &f[5]);\r\n        utassert(s && f[0] == 40 && f[1] == 10 && f[2] == 65 && f[3] == 10 && f[4] == 95 && f[5] == 80);\r\n        s = str::Parse(s + 1, \"S%f%_%f,%f%_%f\", &f[0], &f[1], &f[2], &f[3], &f[4]);\r\n        utassert(s && f[0] == 150 && f[1] == 150 && f[2] == 180 && f[3] == 80);\r\n        s = str::Parse(s + 1, \"A%f%_%f%?,%f%?,%d%?,%d%?,%f%_%f\", &f[0], &f[1], &f[2], &b[0], &b[1], &f[4], &f[5]);\r\n        utassert(s && f[0] == 45 && f[1] == 45 && f[2] == 0 && b[0] == 1 && b[1] == 0 && f[4] == 125 && f[5] == 125);\r\n        s = str::Parse(s + 1, \"A%f%_%f%?,%f%?,%d%?,%d%?,%f%_%f\", &f[0], &f[1], &f[2], &b[0], &b[1], &f[4], &f[5]);\r\n        utassert(s && f[0] == 1 && f[1] == 2 && f[2] == 3 && b[0] == 0 && b[1] == 1 && f[4] == 20 && f[5] == -20);\r\n    }\r\n\r\n    // the test string should only contain ASCII characters,\r\n    // as all others might not be available in all code pages\r\n#define TEST_STRING \"aBc\"\r\n    char *strA = str::conv::ToAnsi(TEXT(TEST_STRING));\r\n    utassert(str::Eq(strA, TEST_STRING));\r\n    str = str::conv::FromAnsi(strA);\r\n    free(strA);\r\n    utassert(str::Eq(str, TEXT(TEST_STRING)));\r\n    free(str);\r\n#undef TEST_STRING\r\n\r\n    utassert(str::IsDigit('0') && str::IsDigit(TEXT('5')) && str::IsDigit(L'9'));\r\n    utassert(iswdigit(L'\\u0660') && !str::IsDigit(L'\\xB2'));\r\n\r\n    utassert(str::CmpNatural(L\".hg\", L\"2.pdf\") < 0);\r\n    utassert(str::CmpNatural(L\"100.pdf\", L\"2.pdf\") > 0);\r\n    utassert(str::CmpNatural(L\"2.pdf\", L\"zzz\") < 0);\r\n    utassert(str::CmpNatural(L\"abc\", L\".svn\") > 0);\r\n    utassert(str::CmpNatural(L\"ab0200\", L\"AB333\") < 0);\r\n    utassert(str::CmpNatural(L\"a b\", L\"a  c\") < 0);\r\n\r\n#ifndef LOCALE_INVARIANT\r\n#define LOCALE_INVARIANT (MAKELCID(MAKELANGID(LANG_INVARIANT, SUBLANG_NEUTRAL), SORT_DEFAULT))\r\n#endif\r\n\r\n    struct {\r\n        size_t number;\r\n        const WCHAR *result;\r\n    } formatNumData[] = {\r\n        { 1,        L\"1\" },\r\n        { 12,       L\"12\" },\r\n        { 123,      L\"123\" },\r\n        { 1234,     L\"1,234\" },\r\n        { 12345,    L\"12,345\" },\r\n        { 123456,   L\"123,456\" },\r\n        { 1234567,  L\"1,234,567\" },\r\n        { 12345678, L\"12,345,678\" },\r\n    };\r\n\r\n    for (int i = 0; i < dimof(formatNumData); i++) {\r\n        ScopedMem<WCHAR> tmp(str::FormatNumWithThousandSep(formatNumData[i].number, LOCALE_INVARIANT));\r\n        utassert(str::Eq(tmp, formatNumData[i].result));\r\n    }\r\n\r\n    struct {\r\n        double number;\r\n        const WCHAR *result;\r\n    } formatFloatData[] = {\r\n        { 1,        L\"1.0\" },\r\n        { 1.2,      L\"1.2\" },\r\n        { 1.23,     L\"1.23\" },\r\n        { 1.234,    L\"1.23\" },\r\n        { 12.345,   L\"12.35\" },\r\n        { 123.456,  L\"123.46\" },\r\n        { 1234.5678,L\"1,234.57\" },\r\n    };\r\n\r\n    for (int i = 0; i < dimof(formatFloatData); i++) {\r\n        ScopedMem<WCHAR> tmp(str::FormatFloatWithThousandSep(formatFloatData[i].number, LOCALE_INVARIANT));\r\n        utassert(str::Eq(tmp, formatFloatData[i].result));\r\n    }\r\n\r\n    {\r\n        char str1[] = \"aAbBcC... 1-9\";\r\n        str::ToLowerInPlace(str1);\r\n        utassert(str::Eq(str1, \"aabbcc... 1-9\"));\r\n\r\n        WCHAR wstr[] = L\"aAbBcC... 1-9\";\r\n        str::ToLowerInPlace(wstr);\r\n        utassert(str::Eq(wstr, L\"aabbcc... 1-9\"));\r\n    }\r\n\r\n    struct {\r\n        int number;\r\n        const WCHAR *result;\r\n    } formatRomanData[] = {\r\n        { 1,    L\"I\" },\r\n        { 3,    L\"III\" },\r\n        { 6,    L\"VI\" },\r\n        { 14,   L\"XIV\" },\r\n        { 49,   L\"XLIX\" },\r\n        { 176,  L\"CLXXVI\" },\r\n        { 499,  L\"CDXCIX\" },\r\n        { 1666, L\"MDCLXVI\" },\r\n        { 2011, L\"MMXI\" },\r\n        { 12345,L\"MMMMMMMMMMMMCCCXLV\" },\r\n        { 0,    nullptr },\r\n        { -133, nullptr },\r\n    };\r\n\r\n    for (int i = 0; i < dimof(formatRomanData); i++) {\r\n        ScopedMem<WCHAR> tmp(str::FormatRomanNumeral(formatRomanData[i].number));\r\n        utassert(str::Eq(tmp, formatRomanData[i].result));\r\n    }\r\n\r\n    {\r\n        size_t trimmed;\r\n        WCHAR *s = str::Dup(L\"\");\r\n        trimmed = str::TrimWS(s);\r\n        utassert(trimmed == 0);\r\n        utassert(str::Eq(s, L\"\"));\r\n        trimmed = str::TrimWS(s, str::TrimRight);\r\n        utassert(trimmed == 0);\r\n        utassert(str::Eq(s, L\"\"));\r\n        trimmed = str::TrimWS(s, str::TrimLeft);\r\n        utassert(trimmed == 0);\r\n        utassert(str::Eq(s, L\"\"));\r\n\r\n        free(s); s = str::Dup(L\"  \\n\\t  \");\r\n        trimmed = str::TrimWS(s);\r\n        utassert(trimmed == 6);\r\n        utassert(str::Eq(s, L\"\"));\r\n\r\n        free(s); s = str::Dup(L\"  \\n\\t  \");\r\n        trimmed = str::TrimWS(s, str::TrimRight);\r\n        utassert(trimmed == 6);\r\n        utassert(str::Eq(s, L\"\"));\r\n\r\n        free(s); s = str::Dup(L\"  \\n\\t  \");\r\n        trimmed = str::TrimWS(s, str::TrimLeft);\r\n        utassert(trimmed == 6);\r\n        utassert(str::Eq(s, L\"\"));\r\n\r\n        free(s); s = str::Dup(L\"  lola\");\r\n        trimmed = str::TrimWS(s);\r\n        utassert(trimmed == 2);\r\n        utassert(str::Eq(s, L\"lola\"));\r\n\r\n        free(s); s = str::Dup(L\"  lola\");\r\n        trimmed = str::TrimWS(s, str::TrimLeft);\r\n        utassert(trimmed == 2);\r\n        utassert(str::Eq(s, L\"lola\"));\r\n\r\n        free(s); s = str::Dup(L\"  lola\");\r\n        trimmed = str::TrimWS(s, str::TrimRight);\r\n        utassert(trimmed == 0);\r\n        utassert(str::Eq(s, L\"  lola\"));\r\n\r\n        free(s); s = str::Dup(L\"lola\\r\\t\");\r\n        trimmed = str::TrimWS(s);\r\n        utassert(trimmed == 2);\r\n        utassert(str::Eq(s, L\"lola\"));\r\n\r\n        free(s); s = str::Dup(L\"lola\\r\\t\");\r\n        trimmed = str::TrimWS(s, str::TrimRight);\r\n        utassert(trimmed == 2);\r\n        utassert(str::Eq(s, L\"lola\"));\r\n\r\n        free(s); s = str::Dup(L\"lola\\r\\t\");\r\n        trimmed = str::TrimWS(s, str::TrimLeft);\r\n        utassert(trimmed == 0);\r\n        utassert(str::Eq(s, L\"lola\\r\\t\"));\r\n\r\n        free(s);\r\n    }\r\n\r\n    utassert(!str::ToMultiByte(\"abc\", 9876, 123456));\r\n    utassert(!str::ToMultiByte(L\"abc\", 98765));\r\n    utassert(!str::conv::FromCodePage(\"abc\", 12345));\r\n    utassert(!str::conv::ToCodePage(L\"abc\", 987654));\r\n\r\n    {\r\n        char buf1[6] = { 0 };\r\n        size_t cnt = str::BufAppend(buf1, dimof(buf1), \"\");\r\n        utassert(0 == cnt);\r\n        cnt = str::BufAppend(buf1, dimof(buf1), \"1234\");\r\n        utassert(4 == cnt);\r\n        utassert(str::Eq(\"1234\", buf1));\r\n        cnt = str::BufAppend(buf1, dimof(buf1), \"56\");\r\n        utassert(1 == cnt);\r\n        utassert(str::Eq(\"12345\", buf1));\r\n        cnt = str::BufAppend(buf1, dimof(buf1), \"6\");\r\n        utassert(0 == cnt);\r\n        utassert(str::Eq(\"12345\", buf1));\r\n    }\r\n\r\n    {\r\n        WCHAR buf1[6] = { 0 };\r\n        size_t cnt = str::BufAppend(buf1, dimof(buf1), L\"\");\r\n        utassert(0 == cnt);\r\n        cnt = str::BufAppend(buf1, dimof(buf1), L\"1234\");\r\n        utassert(4 == cnt);\r\n        utassert(str::Eq(L\"1234\", buf1));\r\n        cnt = str::BufAppend(buf1, dimof(buf1), L\"56\");\r\n        utassert(1 == cnt);\r\n        utassert(str::Eq(L\"12345\", buf1));\r\n        cnt = str::BufAppend(buf1, dimof(buf1), L\"6\");\r\n        utassert(0 == cnt);\r\n        utassert(str::Eq(L\"12345\", buf1));\r\n    }\r\n\r\n    {\r\n        for (int c = 0x00; c < 0x100; c++) {\r\n            utassert(!!isspace((unsigned char)c) == str::IsWs((char)c));\r\n        }\r\n        for (int c = 0x00; c < 0x10000; c++) {\r\n            utassert(!!iswspace((WCHAR)c) == str::IsWs((WCHAR)c));\r\n        }\r\n    }\r\n\r\n    {\r\n        utassert(str::Eq(str::FindI(L\"test\", nullptr), nullptr));\r\n        utassert(str::Eq(str::FindI(nullptr, L\"test\"), nullptr));\r\n        utassert(str::Eq(str::FindI(L\"test\", L\"\"), L\"test\"));\r\n        utassert(str::Eq(str::FindI(L\"test\", L\"ES\"), L\"est\"));\r\n        utassert(str::Eq(str::FindI(L\"test\", L\"Te\"), L\"test\"));\r\n        utassert(str::Eq(str::FindI(L\"testx\", L\"X\"), L\"x\"));\r\n        utassert(str::Eq(str::FindI(L\"test\", L\"st\"), L\"st\"));\r\n        utassert(str::Eq(str::FindI(L\"t\\xE4st\", L\"\\xC4s\"), nullptr));\r\n        utassert(str::Eq(str::FindI(L\"t\\xE4st\", L\"T\\xC5\"), nullptr));\r\n\r\n        utassert(str::Eq(str::FindI(\"test\", nullptr), nullptr));\r\n        utassert(str::Eq(str::FindI(nullptr, \"test\"), nullptr));\r\n        utassert(str::Eq(str::FindI(\"test\", \"\"), \"test\"));\r\n        utassert(str::Eq(str::FindI(\"test\", \"ES\"), \"est\"));\r\n        utassert(str::Eq(str::FindI(\"test\", \"Te\"), \"test\"));\r\n        utassert(str::Eq(str::FindI(\"testx\", \"X\"), \"x\"));\r\n        utassert(str::Eq(str::FindI(\"test\", \"st\"), \"st\"));\r\n    }\r\n\r\n    StrIsDigitTest();\r\n    StrReplaceTest();\r\n    StrSeqTest();\r\n    StrConvTest();\r\n    StrUrlExtractTest();\r\n}\r\n"
  },
  {
    "path": "src/utils/tests/TrivialHtmlParser_ut.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"FileUtil.h\"\r\n#include \"HtmlParserLookup.h\"\r\n#include \"TrivialHtmlParser.h\"\r\n#include \"WinUtil.h\"\r\n\r\n// must be last due to assert() over-write\r\n#include \"UtAssert.h\"\r\n\r\nstatic void HtmlParser00()\r\n{\r\n    HtmlParser p;\r\n    HtmlElement *root = p.Parse(\"<a></A>\");\r\n    utassert(p.ElementsCount() == 1);\r\n    utassert(root);\r\n    utassert(Tag_A == root->tag && !root->name);\r\n    utassert(root->NameIs(\"a\"));\r\n\r\n    root = p.Parse(\"<b></B>\");\r\n    utassert(p.ElementsCount() == 1);\r\n    utassert(root);\r\n    utassert(Tag_B == root->tag && !root->name);\r\n    utassert(root->NameIs(\"b\"));\r\n}\r\n\r\nstatic void HtmlParser01()\r\n{\r\n    HtmlParser p;\r\n    HtmlElement *root = p.Parse(\"<A><bAh></a>\");\r\n    utassert(p.ElementsCount() == 2);\r\n    utassert(Tag_A == root->tag && !root->name);\r\n    utassert(nullptr == root->up);\r\n    utassert(nullptr == root->next);\r\n    HtmlElement *el = root->down;\r\n    utassert(nullptr == el->firstAttr);\r\n    utassert(el->NameIs(\"bah\") && el->NameIs(\"BAH\"));\r\n    utassert(Tag_NotFound == el->tag && str::Eq(\"bAh\", el->name));\r\n    utassert(el->up == root);\r\n    utassert(nullptr == el->down);\r\n    utassert(nullptr == el->next);\r\n}\r\n\r\nstatic void HtmlParser05()\r\n{\r\n    HtmlParser p;\r\n    HtmlElement *root = p.Parse(\"<!doctype><html><HEAD><meta name=foo></head><body><object t=la><param name=foo val=bar></object><ul><li></ul></object></body></Html>\");\r\n    utassert(8 == p.ElementsCount());\r\n    utassert(4 == p.TotalAttrCount());\r\n    utassert(root->NameIs(\"html\"));\r\n    utassert(nullptr == root->up);\r\n    utassert(nullptr == root->next);\r\n    HtmlElement *el = root->down;\r\n    utassert(el->NameIs(\"head\"));\r\n    HtmlElement *el2 = el->down;\r\n    utassert(el2->NameIs(\"meta\"));\r\n    utassert(nullptr == el2->next);\r\n    utassert(nullptr == el2->down);\r\n    el2 = el->next;\r\n    utassert(el2->NameIs(\"body\"));\r\n    utassert(nullptr == el2->next);\r\n    el2 = el2->down;\r\n    utassert(el2->NameIs(\"object\"));\r\n    el = p.FindElementByName(\"html\");\r\n    utassert(el);\r\n    el = p.FindElementByName(\"head\", el);\r\n    utassert(el);\r\n    utassert(el->NameIs(\"head\"));\r\n    el = p.FindElementByName(\"ul\", el);\r\n    utassert(el);\r\n}\r\n\r\nstatic void HtmlParser04()\r\n{\r\n    HtmlParser p;\r\n    HtmlElement *root = p.Parse(\"<el att=  va&apos;l></ el >\");\r\n    utassert(1 == p.ElementsCount());\r\n    utassert(1 == p.TotalAttrCount());\r\n    utassert(root->NameIs(\"el\"));\r\n    utassert(nullptr == root->next);\r\n    utassert(nullptr == root->up);\r\n    utassert(nullptr == root->down);\r\n    ScopedMem<WCHAR> val(root->GetAttribute(\"att\"));\r\n    utassert(str::Eq(val, L\"va'l\"));\r\n    utassert(!root->firstAttr->next);\r\n}\r\n\r\nstatic void HtmlParser03()\r\n{\r\n    HtmlParser p;\r\n    HtmlElement *root = p.Parse(\"<el   att  =v&quot;al/>\");\r\n    utassert(1 == p.ElementsCount());\r\n    utassert(1 == p.TotalAttrCount());\r\n    utassert(root->NameIs(\"el\"));\r\n    utassert(nullptr == root->next);\r\n    utassert(nullptr == root->up);\r\n    utassert(nullptr == root->down);\r\n    ScopedMem<WCHAR> val(root->GetAttribute(\"att\"));\r\n    utassert(str::Eq(val, L\"v\\\"al\"));\r\n    utassert(!root->firstAttr->next);\r\n}\r\n\r\nstatic void HtmlParser02()\r\n{\r\n    HtmlParser p;\r\n    HtmlElement *root = p.Parse(\"<a><b/><c></c  ><d at1=\\\"&lt;quo&amp;ted&gt;\\\" at2='also quoted'   att3=notquoted att4=&#101;&#x6e;d/></a>\");\r\n    utassert(4 == p.ElementsCount());\r\n    utassert(4 == p.TotalAttrCount());\r\n    utassert(root->NameIs(\"a\"));\r\n    utassert(nullptr == root->next);\r\n    HtmlElement *el = root->down;\r\n    utassert(el->NameIs(\"b\"));\r\n    utassert(root == el->up);\r\n    el = el->next;\r\n    utassert(el->NameIs(\"c\"));\r\n    utassert(root == el->up);\r\n    el = el->next;\r\n    utassert(el->NameIs(\"d\"));\r\n    utassert(nullptr == el->next);\r\n    utassert(root == el->up);\r\n    ScopedMem<WCHAR> val(el->GetAttribute(\"at1\"));\r\n    utassert(str::Eq(val, L\"<quo&ted>\"));\r\n    val.Set(el->GetAttribute(\"at2\"));\r\n    utassert(str::Eq(val, L\"also quoted\"));\r\n    val.Set(el->GetAttribute(\"att3\"));\r\n    utassert(str::Eq(val, L\"notquoted\"));\r\n    val.Set(el->GetAttribute(\"att4\"));\r\n    utassert(str::Eq(val, L\"end\"));\r\n}\r\n\r\nstatic void HtmlParser06()\r\n{\r\n    HtmlParser p;\r\n    HtmlElement *root = p.Parse(\"<ul><p>ignore<li><br><meta><li><ol><li></ul><dropme>\");\r\n    utassert(9 == p.ElementsCount());\r\n    utassert(0 == p.TotalAttrCount());\r\n    utassert(root->NameIs(\"ul\"));\r\n    utassert(!root->next);\r\n    HtmlElement *el = root->GetChildByTag(Tag_Li);\r\n    utassert(el);\r\n    utassert(el->down->NameIs(\"br\"));\r\n    utassert(el->down->next->NameIs(\"meta\"));\r\n    utassert(!el->down->next->next);\r\n    el = root->GetChildByTag(Tag_Li, 1);\r\n    utassert(el);\r\n    utassert(!el->next);\r\n    el = el->GetChildByTag(Tag_Ol);\r\n    utassert(!el->next);\r\n    utassert(el->down->NameIs(\"li\"));\r\n    utassert(!el->down->down);\r\n}\r\n\r\nstatic void HtmlParser07()\r\n{\r\n    HtmlParser p;\r\n    HtmlElement *root = p.Parse(\"<test umls=&auml;\\xC3\\xB6&#xFC; Zero=&#1;&#0;&#-1;>\", CP_UTF8);\r\n    utassert(1 == p.ElementsCount());\r\n    ScopedMem<WCHAR> val(root->GetAttribute(\"umls\"));\r\n    utassert(str::Eq(val, L\"\\xE4\\xF6\\xFC\"));\r\n    val.Set(root->GetAttribute(\"zerO\"));\r\n    utassert(str::Eq(val, L\"\\x01??\"));\r\n}\r\n\r\nstatic void HtmlParser08()\r\n{\r\n    ScopedMem<WCHAR> val(DecodeHtmlEntitites(\"&auml&test;&&ouml-\", CP_ACP));\r\n    utassert(str::Eq(val, L\"\\xE4&test;&\\xF6-\"));\r\n}\r\n\r\nstatic void HtmlParser09()\r\n{\r\n    HtmlParser p;\r\n    HtmlElement *root = p.Parse(\"<?xml version='1.0'?><!-- <html><body></html> --><root attr='<!-- comment -->' />\");\r\n    utassert(1 == p.ElementsCount());\r\n    utassert(1 == p.TotalAttrCount());\r\n    utassert(root->NameIs(\"root\"));\r\n    ScopedMem<WCHAR> val(root->GetAttribute(\"attr\"));\r\n    utassert(str::Eq(val, L\"<!-- comment -->\"));\r\n\r\n    root = p.Parse(\"<!-- comment with \\\" and \\' --><main />\");\r\n    utassert(1 == p.ElementsCount());\r\n    utassert(0 == p.TotalAttrCount());\r\n    utassert(root->NameIs(\"main\"));\r\n}\r\n\r\nstatic void HtmlParser10()\r\n{\r\n    HtmlParser p;\r\n    HtmlElement *root = p.Parse(\"<!xml version='1.0'?><x:a xmlns:x='http://example.org/ns/x'><x:b attr='val'/></x:a>\");\r\n    utassert(2 == p.ElementsCount());\r\n    utassert(2 == p.TotalAttrCount());\r\n    utassert(root->NameIs(\"x:a\") && root->NameIsNS(\"a\", \"http://example.org/ns/x\"));\r\n\r\n    HtmlElement *node = p.FindElementByName(\"b\");\r\n    utassert(!node);\r\n    node = p.FindElementByNameNS(\"b\", \"http://example.org/ns/x\");\r\n    utassert(node);\r\n    utassert(node->NameIs(\"x:b\") && node->NameIsNS(\"b\", \"http://example.org/ns/x\"));\r\n    ScopedMem<WCHAR> val(node->GetAttribute(\"attr\"));\r\n    utassert(str::Eq(val, L\"val\"));\r\n    // TODO: XML tags are case sensitive (HTML tags aren't)\r\n    node = p.FindElementByName(\"X:B\");\r\n    utassert(node && node->NameIs(\"X:B\"));\r\n}\r\n\r\nstatic void HtmlParser11()\r\n{\r\n    HtmlParser p;\r\n    HtmlElement *root = p.Parse(\"<root/><!-- comment -->\");\r\n    utassert(1 == p.ElementsCount());\r\n    utassert(0 == p.TotalAttrCount());\r\n    utassert(root && root->NameIs(\"root\"));\r\n\r\n    root = p.Parse(\"<root><!---></root>\");\r\n    utassert(!root);\r\n}\r\n\r\nstatic void HtmlParserFile()\r\n{\r\n    WCHAR *fileName = L\"HtmlParseTest00.html\";\r\n    // We assume we're being run from obj-[dbg|rel], so the test\r\n    // files are in ..\\src\\utils directory relative to exe's dir\r\n    ScopedMem<WCHAR> exePath(GetExePath());\r\n    const WCHAR *exeDir = path::GetBaseName(exePath);\r\n    ScopedMem<WCHAR> p1(path::Join(exeDir, L\"..\\\\src\\\\utils\"));\r\n    ScopedMem<WCHAR> p2(path::Join(p1, fileName));\r\n    char *d = file::ReadAll(p2, nullptr);\r\n    // it's ok if we fail - we assume we were not run from the\r\n    // right location\r\n    if (!d)\r\n        return;\r\n    HtmlParser p;\r\n    HtmlElement *root = p.ParseInPlace(d);\r\n    utassert(root);\r\n    utassert(709 == p.ElementsCount());\r\n    utassert(955 == p.TotalAttrCount());\r\n    utassert(root->NameIs(\"html\"));\r\n    HtmlElement *el = root->down;\r\n    utassert(el->NameIs(\"head\"));\r\n    el = el->next;\r\n    utassert(el->NameIs(\"body\"));\r\n    el = el->down;\r\n    utassert(el->NameIs(\"object\"));\r\n    el = el->next;\r\n    utassert(el->NameIs(\"ul\"));\r\n    el = el->down;\r\n    utassert(el->NameIs(\"li\"));\r\n    el = el->down;\r\n    utassert(el->NameIs(\"object\"));\r\n    ScopedMem<WCHAR> val(el->GetAttribute(\"type\"));\r\n    utassert(str::Eq(val, L\"text/sitemap\"));\r\n    el = el->down;\r\n    utassert(el->NameIs(\"param\"));\r\n    utassert(!el->down);\r\n    utassert(el->next->NameIs(\"param\"));\r\n    el = p.FindElementByName(\"body\");\r\n    utassert(el);\r\n    el = p.FindElementByName(\"ul\", el);\r\n    utassert(el);\r\n    int count = 0;\r\n    while (el) {\r\n        ++count;\r\n        el = p.FindElementByName(\"ul\", el);\r\n    }\r\n    utassert(18 == count);\r\n    free(d);\r\n}\r\n\r\nvoid TrivialHtmlParser_UnitTests()\r\n{\r\n    HtmlParserFile();\r\n    HtmlParser11();\r\n    HtmlParser10();\r\n    HtmlParser09();\r\n    HtmlParser08();\r\n    HtmlParser07();\r\n    HtmlParser06();\r\n    HtmlParser05();\r\n    HtmlParser04();\r\n    HtmlParser03();\r\n    HtmlParser02();\r\n    HtmlParser00();\r\n    HtmlParser01();\r\n}\r\n"
  },
  {
    "path": "src/utils/tests/VarintGob_ut.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"VarintGob.h\"\r\n\r\n// must be last due to assert() over-write\r\n#include \"UtAssert.h\"\r\n\r\n// if set to 1, dumps on to the debugger code that can be copied\r\n// to util.py (test_gob()), to verify C and python generate\r\n// the same encoded data\r\n#define GEN_PYTHON_TESTS 0\r\n\r\nstatic void GenPythonIntTest(int64_t val, uint8_t *d, int dLen)\r\n{\r\n#if GEN_PYTHON_TESTS == 1\r\n    str::Str<char> s;\r\n    s.AppendFmt(\"  utassert gob_varint_encode(%I64d) == \", val);\r\n    int n;\r\n    for (int i = 0; i < dLen; i++) {\r\n        n = (int)d[i];\r\n        s.AppendFmt(\"chr(%d)\", n);\r\n        if (i < dLen - 1)\r\n            s.Append(\" + \");\r\n    }\r\n    plogf(\"%s\", s.Get());\r\n#else\r\n    UNUSED(val); UNUSED(d); UNUSED(dLen);\r\n#endif\r\n}\r\n\r\nstatic void GenPythonUIntTest(uint64_t val, uint8_t *d, int dLen)\r\n{\r\n#if GEN_PYTHON_TESTS == 1\r\n    str::Str<char> s;\r\n    s.AppendFmt(\"  utassert gob_uvarint_encode(%I64u) == \", val);\r\n    int n;\r\n    for (int i = 0; i < dLen; i++) {\r\n        n = (int)d[i];\r\n        s.AppendFmt(\"chr(%d)\", n);\r\n        if (i < dLen - 1)\r\n            s.Append(\" + \");\r\n    }\r\n    plogf(\"%s\", s.Get());\r\n#else\r\n    UNUSED(val); UNUSED(d); UNUSED(dLen);\r\n#endif\r\n}\r\n\r\nstatic void GobEncodingTest()\r\n{\r\n    uint8_t buf[2048];\r\n    int64_t intVals[] = {\r\n        0, 1, 0x7f, 0x80, 0x81, 0xfe, 0xff, 0x100, 0x1234, 0x12345, 0x123456,\r\n        0x1234567, 0x12345678, 0x7fffffff, -1, -2, -255, -256, -257, -0x1234,\r\n        -0x12345, -0x123456, -0x124567, -0x1245678\r\n    };\r\n    uint64_t uintVals[] = {\r\n        0, 1, 0x7f, 0x80, 0x81, 0xfe, 0xff, 0x100, 0x1234, 0x12345, 0x123456,\r\n        0x1234567, 0x12345678, 0x7fffffff, 0x80000000, 0x80000001, 0xfffffffe,\r\n        0xffffffff\r\n    };\r\n    int n, dLen, n2;\r\n    uint8_t *d;\r\n    int64_t val, expVal;\r\n    uint64_t uval, expUval;\r\n\r\n    d = buf; dLen = dimof(buf);\r\n    for (int i = 0; i < dimof(intVals); i++) {\r\n        val = intVals[i];\r\n        n = VarintGobEncode(val, d, dLen);\r\n        utassert(n >= 1);\r\n        GenPythonIntTest(val, d, n);\r\n        n2 = VarintGobDecode(d, n, &expVal);\r\n        utassert(n == n2);\r\n        utassert(val == expVal);\r\n        d += n;\r\n        dLen -= n;\r\n        utassert(dLen > 0);\r\n    }\r\n    dLen = (int)(d - buf);\r\n    d = buf;\r\n    for (int i = 0; i < dimof(intVals); i++) {\r\n        expVal = intVals[i];\r\n        n = VarintGobDecode(d, dLen, &val);\r\n        utassert(0 != n);\r\n        utassert(val == expVal);\r\n        d += n;\r\n        dLen -= n;\r\n    }\r\n    utassert(0 == dLen);\r\n\r\n    d = buf; dLen = dimof(buf);\r\n    for (int i = 0; i < dimof(uintVals); i++) {\r\n        uval = uintVals[i];\r\n        n = UVarintGobEncode(uval, d, dLen);\r\n        utassert(n >= 1);\r\n        GenPythonUIntTest(uval, d, n);\r\n        n2 = UVarintGobDecode(d, n, &expUval);\r\n        utassert(n == n2);\r\n        utassert(uval == expUval);\r\n        d += n;\r\n        dLen -= n;\r\n        utassert(dLen > 0);\r\n    }\r\n    dLen = (int)(d - buf);\r\n    d = buf;\r\n    for (int i = 0; i < dimof(uintVals); i++) {\r\n        expUval = uintVals[i];\r\n        n = UVarintGobDecode(d, dLen, &uval);\r\n        utassert(0 != n);\r\n        utassert(uval == expUval);\r\n        d += n;\r\n        dLen -= n;\r\n    }\r\n    utassert(0 == dLen);\r\n}\r\n\r\nvoid VarintGobTest()\r\n{\r\n    GobEncodingTest();\r\n}\r\n"
  },
  {
    "path": "src/utils/tests/Vec_ut.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#define __STDC_FORMAT_MACROS\r\n#include <inttypes.h>\r\n\r\n// must be last due to assert() over-write\r\n#include \"UtAssert.h\"\r\n\r\nstatic void WStrVecTest()\r\n{\r\n    WStrVec v;\r\n    v.Append(str::Dup(L\"foo\"));\r\n    v.Append(str::Dup(L\"bar\"));\r\n    WCHAR *s = v.Join();\r\n    utassert(v.Count() == 2);\r\n    utassert(str::Eq(L\"foobar\", s));\r\n    free(s);\r\n\r\n    s = v.Join(L\";\");\r\n    utassert(v.Count() == 2);\r\n    utassert(str::Eq(L\"foo;bar\", s));\r\n    free(s);\r\n\r\n    v.Append(str::Dup(L\"glee\"));\r\n    s = v.Join(L\"_ _\");\r\n    utassert(v.Count() == 3);\r\n    utassert(str::Eq(L\"foo_ _bar_ _glee\", s));\r\n    free(s);\r\n\r\n    v.Sort();\r\n    s = v.Join();\r\n    utassert(str::Eq(L\"barfooglee\", s));\r\n    free(s);\r\n\r\n    {\r\n        WStrVec v2(v);\r\n        utassert(str::Eq(v2.At(1), L\"foo\"));\r\n        v2.Append(str::Dup(L\"nobar\"));\r\n        utassert(str::Eq(v2.At(3), L\"nobar\"));\r\n        v2 = v;\r\n        utassert(v2.Count() == 3 && v2.At(0) != v.At(0));\r\n        utassert(str::Eq(v2.At(1), L\"foo\"));\r\n        utassert(&v2.At(2) == v2.AtPtr(2) && str::Eq(*v2.AtPtr(2), L\"glee\"));\r\n    }\r\n\r\n    {\r\n        WStrVec v2;\r\n        size_t count = v2.Split(L\"a,b,,c,\", L\",\");\r\n        utassert(count == 5 && v2.Find(L\"c\") == 3);\r\n        utassert(v2.Find(L\"\") == 2 && v2.Find(L\"\", 3) == 4 && v2.Find(L\"\", 5) == -1);\r\n        utassert(v2.Find(L\"B\") == -1 && v2.FindI(L\"B\") == 1);\r\n        ScopedMem<WCHAR> joined(v2.Join(L\";\"));\r\n        utassert(str::Eq(joined, L\"a;b;;c;\"));\r\n    }\r\n\r\n    {\r\n        WStrVec v2;\r\n        size_t count = v2.Split(L\"a,b,,c,\", L\",\", true);\r\n        utassert(count == 3 && v2.Find(L\"c\") == 2);\r\n        ScopedMem<WCHAR> joined(v2.Join(L\";\"));\r\n        utassert(str::Eq(joined, L\"a;b;c\"));\r\n        ScopedMem<WCHAR> last(v2.Pop());\r\n        utassert(v2.Count() == 2 && str::Eq(last, L\"c\"));\r\n    }\r\n}\r\n\r\nstatic void StrListTest()\r\n{\r\n    WStrList l;\r\n    utassert(l.Count() == 0);\r\n    l.Append(str::Dup(L\"one\"));\r\n    l.Append(str::Dup(L\"two\"));\r\n    l.Append(str::Dup(L\"One\"));\r\n    utassert(l.Count() == 3);\r\n    utassert(str::Eq(l.At(0), L\"one\"));\r\n    utassert(str::EqI(l.At(2), L\"one\"));\r\n    utassert(l.Find(L\"One\") == 2);\r\n    utassert(l.FindI(L\"One\") == 0);\r\n    utassert(l.Find(L\"Two\") == -1);\r\n}\r\n\r\nstatic size_t VecTestAppendFmt()\r\n{\r\n    str::Str<char> v(256);\r\n    int64_t val = 1;\r\n    for (int i = 0; i < 10000; i++) {\r\n        v.AppendFmt(\"i%\" PRId64 \"e\", val);\r\n        val = (val * 3) / 2; // somewhat exponential growth\r\n        val += 15;\r\n    }\r\n    size_t l = v.Count();\r\n    return l;\r\n}\r\n\r\nvoid VecTest()\r\n{\r\n    Vec<int> ints;\r\n    utassert(ints.Count() == 0);\r\n    ints.Append(1);\r\n    ints.Push(2);\r\n    ints.InsertAt(0, -1);\r\n    utassert(ints.Count() == 3);\r\n    utassert(ints.At(0) == -1 && ints.At(1) == 1 && ints.At(2) == 2);\r\n    utassert(ints.At(0) == -1 && ints.Last() == 2);\r\n    int last = ints.Pop();\r\n    utassert(last == 2);\r\n    utassert(ints.Count() == 2);\r\n    ints.Push(3);\r\n    ints.RemoveAt(0);\r\n    utassert(ints.Count() == 2);\r\n    utassert(ints.At(0) == 1 && ints.At(1) == 3);\r\n    ints.Reset();\r\n    utassert(ints.Count() == 0);\r\n\r\n    for (int i = 0; i < 1000; i++) {\r\n        ints.Push(i);\r\n    }\r\n    utassert(ints.Count() == 1000 && ints.At(500) == 500);\r\n    ints.Remove(500);\r\n    utassert(ints.Count() == 999 && ints.At(500) == 501);\r\n    last = ints.Pop();\r\n    utassert(last == 999);\r\n    ints.Append(last);\r\n    utassert(ints.AtPtr(501) == &ints.At(501));\r\n\r\n    for (int& value : ints) {\r\n        utassert(0 <= value && value < 1000);\r\n    }\r\n    utassert(ints.FindEl([](int& value) { return value == 999; }) == 999);\r\n    utassert(ints.FindEl([](int& value) { return value == 500; }) == 0);\r\n\r\n    {\r\n        Vec<int> ints2(ints);\r\n        utassert(ints2.Count() == 999);\r\n        utassert(ints.LendData() != ints2.LendData());\r\n        ints.Remove(600);\r\n        utassert(ints.Count() < ints2.Count());\r\n        ints2 = ints;\r\n        utassert(ints2.Count() == 998);\r\n    }\r\n\r\n    {\r\n        char buf[2] = {'a', '\\0'};\r\n        str::Str<char> v(0);\r\n        for (int i = 0; i < 7; i++) {\r\n            v.Append(buf, 1);\r\n            buf[0] = buf[0] + 1;\r\n        }\r\n        char *s = v.LendData();\r\n        utassert(str::Eq(\"abcdefg\", s));\r\n        utassert(7 == v.Count());\r\n        v.Set(\"helo\");\r\n        utassert(4 == v.Count());\r\n        utassert(str::Eq(\"helo\", v.LendData()));\r\n    }\r\n\r\n    {\r\n        str::Str<char> v(128);\r\n        v.Append(\"boo\", 3);\r\n        utassert(str::Eq(\"boo\", v.LendData()));\r\n        utassert(v.Count() == 3);\r\n        v.Append(\"fop\");\r\n        utassert(str::Eq(\"boofop\", v.LendData()));\r\n        utassert(v.Count() == 6);\r\n        v.RemoveAt(2, 3);\r\n        utassert(v.Count() == 3);\r\n        utassert(str::Eq(\"bop\", v.LendData()));\r\n        v.Append('a');\r\n        utassert(v.Count() == 4);\r\n        utassert(str::Eq(\"bopa\", v.LendData()));\r\n        char *s = v.StealData();\r\n        utassert(str::Eq(\"bopa\", s));\r\n        free(s);\r\n        utassert(v.Count() == 0);\r\n    }\r\n\r\n    {\r\n        str::Str<char> v(0);\r\n        for (size_t i = 0; i < 32; i++) {\r\n            utassert(v.Count() == i * 6);\r\n            v.Append(\"lambd\", 5);\r\n            if (i % 2 == 0)\r\n                v.Append('a');\r\n            else\r\n                v.Push('a');\r\n        }\r\n\r\n        for (size_t i=1; i<=16; i++) {\r\n            v.RemoveAt((16 - i) * 6, 6);\r\n            utassert(v.Count() == (32 - i) * 6);\r\n        }\r\n\r\n        v.RemoveAt(0, 6 * 15);\r\n        utassert(v.Count() == 6);\r\n        char *s = v.LendData();\r\n        utassert(str::Eq(s, \"lambda\"));\r\n        s = v.StealData();\r\n        utassert(str::Eq(s, \"lambda\"));\r\n        free(s);\r\n        utassert(v.Count() == 0);\r\n\r\n        v.Append(\"lambda\");\r\n        utassert(str::Eq(v.LendData(), \"lambda\"));\r\n        char c = v.Pop();\r\n        utassert(c == 'a');\r\n        utassert(str::Eq(v.LendData(), \"lambd\"));\r\n    }\r\n\r\n    VecTestAppendFmt();\r\n\r\n    {\r\n        Vec<PointI *> v;\r\n        srand((unsigned int)time(nullptr));\r\n        for (int i = 0; i < 128; i++) {\r\n            v.Append(new PointI(i, i));\r\n            size_t pos = rand() % v.Count();\r\n            v.InsertAt(pos, new PointI(i, i));\r\n        }\r\n        utassert(v.Count() == 128 * 2);\r\n\r\n        while (v.Count() > 64) {\r\n            size_t pos = rand() % v.Count();\r\n            PointI *f = v.At(pos);\r\n            v.Remove(f);\r\n            delete f;\r\n        }\r\n        DeleteVecMembers(v);\r\n    }\r\n\r\n    {\r\n        Vec<int> v;\r\n        v.Append(2);\r\n        for (int i = 0; i < 500; i++)\r\n            v.Append(4);\r\n        v.At(250) = 5;\r\n        v.Reverse();\r\n        utassert(v.Count() == 501 && v.At(0) == 4 && v.At(249) == v.At(251) && v.At(250) == 5 && v.At(500) == 2);\r\n        v.Remove(4);\r\n        v.Reverse();\r\n        utassert(v.Count() == 500 && v.At(0) == 2 && v.At(249) == v.At(251) && v.At(250) == 5 && v.At(499) == 4);\r\n    }\r\n\r\n    {\r\n        Vec<int> v;\r\n        v.InsertAt(2, 2);\r\n        utassert(v.Count() == 3 && v.At(0) == 0 && v.At(2) == 2);\r\n    }\r\n\r\n    WStrVecTest();\r\n    StrListTest();\r\n}\r\n"
  },
  {
    "path": "src/utils/tests/WinUtil_ut.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"WinUtil.h\"\r\n\r\n// must be last due to assert() over-write\r\n#include \"UtAssert.h\"\r\n\r\nvoid WinUtilTest()\r\n{\r\n    ScopedCom comScope;\r\n\r\n    {\r\n        char *string = \"abcde\";\r\n        size_t stringSize = 5, len;\r\n        ScopedComPtr<IStream> stream(CreateStreamFromData(string, stringSize));\r\n        utassert(stream);\r\n        char *data = (char *)GetDataFromStream(stream, &len);\r\n        utassert(data && stringSize == len && str::Eq(data, string));\r\n        free(data);\r\n    }\r\n\r\n    {\r\n        WCHAR *string = L\"abcde\";\r\n        size_t stringSize = 10, len;\r\n        ScopedComPtr<IStream> stream(CreateStreamFromData(string, stringSize));\r\n        utassert(stream);\r\n        WCHAR *data = (WCHAR *)GetDataFromStream(stream, &len);\r\n        utassert(data && stringSize == len && str::Eq(data, string));\r\n        free(data);\r\n    }\r\n\r\n    {\r\n        RectI oneScreen = GetFullscreenRect(nullptr);\r\n        RectI allScreens = GetVirtualScreenRect();\r\n        utassert(allScreens.Intersect(oneScreen) == oneScreen);\r\n    }\r\n\r\n    {\r\n        COLORREF c = AdjustLightness(RGB(255, 0, 0), 1.0f);\r\n        utassert(c == RGB(255, 0, 0));\r\n        c = AdjustLightness(RGB(255, 0, 0), 2.0f);\r\n        utassert(c == RGB(255, 255, 255));\r\n        c = AdjustLightness(RGB(255, 0, 0), 0.25f);\r\n        utassert(c == RGB(64, 0, 0));\r\n        c = AdjustLightness(RGB(226, 196, 226), 95 / 255.0f);\r\n        utassert(c == RGB(105, 52, 105));\r\n        c = AdjustLightness(RGB(255, 255, 255), 0.5f);\r\n        utassert(c == RGB(128, 128, 128));\r\n    }\r\n}\r\n"
  },
  {
    "path": "src/wingui/DialogSizer.cpp",
    "content": "/* Modified version of DialogSizer_Set.cpp. See DialogSizer.h for the original Copyright */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"DialogSizer.h\"\r\n#include \"WinUtil.h\"\r\n\r\n#define DIALOG_DATA_PROPERTY L\"GipsySoftDialogSizerData\"\r\n\r\nstatic LRESULT CALLBACK SizingProc(HWND, UINT, WPARAM, LPARAM);\r\n\r\nclass DialogData {\r\n  public:\r\n    DialogData(HWND hwnd, const DialogSizerSizingItem *psd, bool bShowSizingGrip)\r\n        : hwnd(hwnd), bMaximised(false), bShowSizingGrip(bShowSizingGrip) {\r\n        // Given an array of dialog item structures determine how many of them there\r\n        // are by scanning along them until we reach the last.\r\n        nItemCount = 0;\r\n        for (const DialogSizerSizingItem *psi = psd; psi->uSizeInfo != 0xFFFFFFFF; psi++)\r\n            nItemCount++;\r\n\r\n        // Copy all of the user controls etc. for later, this way the user can quite happily\r\n        // let the structure go out of scope.\r\n        this->psd = (DialogSizerSizingItem *)memdup((void *)psd,\r\n                                                    nItemCount * sizeof(DialogSizerSizingItem));\r\n        if (!this->psd)\r\n            nItemCount = 0;\r\n\r\n        // Store some sizes etc. for later.\r\n        WindowRect rectWnd(hwnd);\r\n        ptSmallest.x = rectWnd.dx;\r\n        ptSmallest.y = rectWnd.dy;\r\n\r\n        ClientRect rectClient(hwnd);\r\n        sizeClient = rectClient.Size();\r\n        UpdateGripperRect();\r\n\r\n        // Because we have successfully created our data we need to subclass the control now, if not\r\n        // we could end up in a situation where our data was never freed.\r\n        SetProp(hwnd, DIALOG_DATA_PROPERTY, (HANDLE) this);\r\n        wndProc = (WNDPROC)SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)SizingProc);\r\n    }\r\n    ~DialogData() {\r\n        SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)wndProc);\r\n        RemoveProp(hwnd, DIALOG_DATA_PROPERTY);\r\n        free(this->psd);\r\n    }\r\n\r\n    // The number of items contained in the psd member.\r\n    int nItemCount;\r\n    DialogSizerSizingItem *psd;\r\n\r\n    // We need the smallest to respond to the WM_GETMINMAXINFO message\r\n    POINT ptSmallest;\r\n\r\n    // we need this to decide how much the window has changed size when we get a WM_SIZE message\r\n    SizeI sizeClient;\r\n    bool bMaximised;\r\n\r\n    void UpdateGripper() {\r\n        if (!bShowSizingGrip)\r\n            return;\r\n\r\n        RectI rcOld = rcGrip;\r\n        UpdateGripperRect();\r\n        // We also need to invalidate the combined area of the old and new rectangles\r\n        // otherwise we would have trail of grippers when we sized the dialog larger\r\n        // in any axis\r\n        RECT tmpRect = rcGrip.Union(rcOld).ToRECT();\r\n        InvalidateRect(hwnd, &tmpRect, TRUE);\r\n    }\r\n\r\n    void DrawGripper(HDC hdc) {\r\n        if (bShowSizingGrip && !bMaximised) {\r\n            RECT tmpRect = rcGrip.ToRECT();\r\n            DrawFrameControl(hdc, &tmpRect, DFC_SCROLL, DFCS_SCROLLSIZEGRIP);\r\n        }\r\n    }\r\n\r\n    bool InsideGripper(PointI pt) { return bShowSizingGrip && rcGrip.Contains(pt); }\r\n\r\n    // The previous window procedure\r\n    WNDPROC wndProc;\r\n\r\n  private:\r\n    HWND hwnd;\r\n    RectI rcGrip;\r\n    // Draw the sizing grip...or not\r\n    bool bShowSizingGrip;\r\n\r\n    void UpdateGripperRect() {\r\n        int width = GetSystemMetrics(SM_CXVSCROLL);\r\n        int height = GetSystemMetrics(SM_CYHSCROLL);\r\n        rcGrip = RectI(sizeClient.dx - width, sizeClient.dy - height, width, height);\r\n    }\r\n};\r\n\r\n// Setting a dialog sizeable involves subclassing the window and handling it's\r\n// WM_SIZE messages.\r\n//\r\n// Returns non-zero for success and zero if it fails\r\nextern \"C\" BOOL DialogSizer_Set(HWND hwnd, const DialogSizerSizingItem *psd, BOOL bShowSizingGrip) {\r\n    DialogData *pdd = (DialogData *)GetProp(hwnd, DIALOG_DATA_PROPERTY);\r\n    // Overwrite previous settings (if there are any)\r\n    delete pdd;\r\n\r\n    pdd = new DialogData(hwnd, psd, bShowSizingGrip);\r\n    if (!pdd || !pdd->psd) {\r\n        delete pdd;\r\n        return FALSE;\r\n    }\r\n\r\n    return TRUE;\r\n}\r\n\r\nvoid UpdateWindowSize(DialogData *pdd, const int cx, const int cy, HWND hwnd) {\r\n    const int nDeltaX = cx - pdd->sizeClient.dx;\r\n    const int nDeltaY = cy - pdd->sizeClient.dy;\r\n\r\n    HDWP hdwp = BeginDeferWindowPos(pdd->nItemCount);\r\n    for (int i = 0; i < pdd->nItemCount; i++) {\r\n        const DialogSizerSizingItem *psd = pdd->psd + i;\r\n        HWND hwndChild = GetDlgItem(hwnd, psd->uControlID);\r\n        RectI rect = MapRectToWindow(WindowRect(hwndChild), HWND_DESKTOP, hwnd);\r\n\r\n        // Adjust the window horizontally\r\n        if (psd->uSizeInfo & DS_MoveX)\r\n            rect.x += nDeltaX;\r\n        // Adjust the window vertically\r\n        if (psd->uSizeInfo & DS_MoveY)\r\n            rect.y += nDeltaY;\r\n        // Size the window horizontally\r\n        if (psd->uSizeInfo & DS_SizeX)\r\n            rect.dx += nDeltaX;\r\n        // Size the window vertically\r\n        if (psd->uSizeInfo & DS_SizeY)\r\n            rect.dy += nDeltaY;\r\n\r\n        DeferWindowPos(hdwp, hwndChild, nullptr, rect.x, rect.y, rect.dx, rect.dy,\r\n                       SWP_NOACTIVATE | SWP_NOZORDER);\r\n    }\r\n    EndDeferWindowPos(hdwp);\r\n\r\n    pdd->sizeClient = SizeI(cx, cy);\r\n    // If we have a sizing grip enabled then adjust it's position\r\n    pdd->UpdateGripper();\r\n}\r\n\r\n// Actual window procedure that will handle saving window size/position and moving\r\n// the controls whilst the window sizes.\r\nstatic LRESULT CALLBACK SizingProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {\r\n    DialogData *pdd = (DialogData *)GetProp(hwnd, DIALOG_DATA_PROPERTY);\r\n    if (!pdd)\r\n        return DefWindowProc(hwnd, msg, wParam, lParam);\r\n\r\n    switch (msg) {\r\n        case WM_ERASEBKGND: {\r\n            LRESULT lr = CallWindowProc(pdd->wndProc, hwnd, msg, wParam, lParam);\r\n            pdd->DrawGripper((HDC)wParam);\r\n            return lr;\r\n        }\r\n\r\n        case WM_SIZE: {\r\n            if (wParam != SIZE_MINIMIZED) {\r\n                pdd->bMaximised = wParam == SIZE_MAXIMIZED;\r\n                UpdateWindowSize(pdd, LOWORD(lParam), HIWORD(lParam), hwnd);\r\n            }\r\n        } break;\r\n\r\n        case WM_NCHITTEST: {\r\n            // If the gripper is enabled then perform a simple hit test on our gripper area.\r\n            POINT pt = { LOWORD(lParam), HIWORD(lParam) };\r\n            ScreenToClient(hwnd, &pt);\r\n            if (pdd->InsideGripper(PointI(pt.x, pt.y)))\r\n                return HTBOTTOMRIGHT;\r\n        } break;\r\n\r\n        case WM_GETMINMAXINFO: {\r\n            // Our opportunity to say that we do not want the dialog to grow or shrink any more.\r\n            LPMINMAXINFO lpmmi = (LPMINMAXINFO)lParam;\r\n            lpmmi->ptMinTrackSize = pdd->ptSmallest;\r\n        }\r\n            return 0;\r\n\r\n        case WM_DESTROY: {\r\n            WNDPROC wndProc = pdd->wndProc;\r\n            delete pdd;\r\n            return CallWindowProc(wndProc, hwnd, msg, wParam, lParam);\r\n        }\r\n    }\r\n\r\n    return CallWindowProc(pdd->wndProc, hwnd, msg, wParam, lParam);\r\n}\r\n"
  },
  {
    "path": "src/wingui/DialogSizer.h",
    "content": "/*----------------------------------------------------------------------\r\nCopyright (c)  Gipsysoft. All Rights Reserved.\r\nWeb site: http://gipsysoft.com\r\n\r\nThis software is provided 'as-is', without any express or implied warranty.\r\n\r\nIn no event will the author be held liable for any damages arising from the\r\nuse of this software.\r\n\r\nPermission is granted to anyone to use this software for any purpose, including\r\ncommercial applications, and to alter it and redistribute it freely, subject\r\nto the following restrictions:\r\n\r\n1) The origin of this software must not be misrepresented; you must not claim\r\n   that you wrote the original software. If you use this software in a product,\r\n         an acknowledgment in the product documentation is requested but not required.\r\n2) Altered source versions must be plainly marked as such, and must not be\r\n   misrepresented as being the original software. Altered source is encouraged\r\n         to be submitted back to the original author so it can be shared with the\r\n         community. Please share your changes.\r\n3) This notice may not be removed or altered from any source distribution.\r\n\r\nFile:\tDialogSizer.h\r\nOwner:\trussf@gipsysoft.com\r\nPurpose:\tMain include file for sizeable dialogs API\r\n----------------------------------------------------------------------*/\r\n\r\n//\tPredefined sizing information\r\n#define DS_MoveX 1\r\n#define DS_MoveY 2\r\n#define DS_SizeX 4\r\n#define DS_SizeY 8\r\n\r\ntypedef struct DialogSizerSizingItem //\tsdi\r\n    {\r\n    UINT uControlID;\r\n    UINT uSizeInfo;\r\n} DialogSizerSizingItem;\r\n\r\n#define DIALOG_SIZER_START(name) DialogSizerSizingItem name[] = {\r\n#define DIALOG_SIZER_ENTRY(controlID, flags)                                                       \\\r\n    { controlID, flags }                                                                           \\\r\n    ,\r\n#define DIALOG_SIZER_END()                                                                         \\\r\n    { 0xFFFFFFFF, 0xFFFFFFFF }                                                                     \\\r\n    }                                                                                              \\\r\n    ;\r\n\r\n// SumatraPDF: removed the fourth argument and fixed the comment:\r\n//\tSet a window as sizeable, passing the sizing data for each control.\r\nextern \"C\" BOOL DialogSizer_Set(HWND hwnd, const DialogSizerSizingItem *psd, BOOL bShowSizingGrip);\r\n"
  },
  {
    "path": "src/wingui/EditCtrl.cpp",
    "content": "#include \"BaseUtil.h\"\r\n#include \"EditCtrl.h\"\r\n\r\n#include \"BitManip.h\"\r\n#include \"WinUtil.h\"\r\n\r\n// TODO:\r\n// - expose EN_UPDATE\r\n// (http://msdn.microsoft.com/en-us/library/windows/desktop/bb761687(v=vs.85).aspx)\r\n// - add border and possibly other decorations by handling WM_NCCALCSIZE, WM_NCPAINT and\r\n// WM_NCHITTEST\r\n//   etc., http://www.catch22.net/tuts/insert-buttons-edit-control\r\n// - include value we remember in WM_NCCALCSIZE in GetIdealSize()\r\n\r\nstatic LRESULT CALLBACK EditParentProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,\r\n                                       UINT_PTR uIdSubclass, DWORD_PTR dwRefData) {\r\n    UNUSED(uIdSubclass);\r\n    EditCtrl *w = (EditCtrl *)dwRefData;\r\n    CrashIf(GetParent(w->hwnd) != (HWND)lp);\r\n    if ((WM_CTLCOLOREDIT == msg) && (w->bgBrush != nullptr)) {\r\n        HDC hdc = (HDC)wp;\r\n        // SetBkColor(hdc, w->bgCol);\r\n        SetBkMode(hdc, TRANSPARENT);\r\n        if (w->txtCol != NO_COLOR) {\r\n            SetTextColor(hdc, w->txtCol);\r\n        }\r\n        return (INT_PTR)w->bgBrush;\r\n    }\r\n    if (w->onTextChanged && (WM_COMMAND == msg) && (EN_CHANGE == HIWORD(wp))) {\r\n        w->onTextChanged(w);\r\n        return 0;\r\n    }\r\n    // TODO: handle WM_CTLCOLORSTATIC for read-only/disabled controls\r\n    return DefSubclassProc(hwnd, msg, wp, lp);\r\n}\r\n\r\n#if 0\r\nstatic bool HasWsBorder(HWND hwnd)\r\n{\r\n    DWORD style = GetWindowStyle(hwnd);\r\n    return bit::IsMaskSet<DWORD>(style, WS_BORDER);\r\n}\r\n#endif\r\n\r\nstatic LRESULT CALLBACK\r\nEditProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, UINT_PTR uIdSubclass, DWORD_PTR dwRefData) {\r\n    UNUSED(uIdSubclass);\r\n    EditCtrl *w = (EditCtrl *)dwRefData;\r\n    CrashIf(w->hwnd != (HWND)lp);\r\n\r\n    if (w->preFilter) {\r\n        bool discard = false;\r\n        auto res = w->preFilter(hwnd, msg, wp, lp, discard);\r\n        if (discard) {\r\n            return res;\r\n        }\r\n    }\r\n\r\n    if (WM_NCDESTROY == msg) {\r\n        RemoveWindowSubclass(GetParent(w->hwnd), EditParentProc, 0);\r\n        RemoveWindowSubclass(w->hwnd, EditProc, 0);\r\n        return DefSubclassProc(hwnd, msg, wp, lp);\r\n    }\r\n\r\n    // Node: this is sent during creation, which is too early for us (we didn't\r\n    // subclass the window yet)\r\n    // currently, we force it with SetWindowPos(... SMP_FRAMECHANGED)\r\n    if (WM_NCCALCSIZE == msg) {\r\n        NCCALCSIZE_PARAMS *p = (NCCALCSIZE_PARAMS *)lp;\r\n        RECT orig = p->rgrc[0];\r\n        LRESULT res = DefSubclassProc(hwnd, msg, wp, lp);\r\n        RECT curr = p->rgrc[0];\r\n        w->ncDx = RectDx(orig) - RectDx(curr);\r\n        w->ncDy = RectDy(orig) - RectDy(curr);\r\n        return res;\r\n    }\r\n\r\n    return DefSubclassProc(hwnd, msg, wp, lp);\r\n}\r\n\r\nvoid SetFont(EditCtrl *w, HFONT f) { SetWindowFont(w->hwnd, f, TRUE); }\r\n\r\nvoid SetColors(EditCtrl *w, COLORREF txtCol, COLORREF bgCol) {\r\n    DeleteObject(w->bgBrush);\r\n    w->bgBrush = nullptr;\r\n    if (txtCol != NO_CHANGE) {\r\n        w->txtCol = txtCol;\r\n    }\r\n    if (bgCol != NO_CHANGE) {\r\n        w->bgCol = bgCol;\r\n    }\r\n    if (w->bgCol != NO_COLOR) {\r\n        w->bgBrush = CreateSolidBrush(bgCol);\r\n    }\r\n    InvalidateRect(w->hwnd, nullptr, FALSE);\r\n}\r\n\r\nvoid SetText(EditCtrl *w, const WCHAR *s) { SetWindowTextW(w->hwnd, s); }\r\n\r\nbool SetCueText(EditCtrl *w, const WCHAR *s) {\r\n    CrashIf(!w->hwnd);\r\n    return Edit_SetCueBannerText(w->hwnd, s) == TRUE;\r\n}\r\n\r\n// caller must free() the result\r\nWCHAR *GetTextW(EditCtrl *w) { return win::GetText(w->hwnd); }\r\n\r\n// caller must free() the result\r\nchar *GetText(EditCtrl *w) {\r\n    ScopedMem<WCHAR> su(GetTextW(w));\r\n    return str::conv::ToUtf8(su.Get());\r\n}\r\n\r\nEditCtrl *AllocEditCtrl(HWND parent, RECT *initialPosition) {\r\n    auto w = AllocStruct<EditCtrl>();\r\n    w->parent = parent;\r\n    if (initialPosition) {\r\n        w->initialPos = *initialPosition;\r\n    } else {\r\n        SetRect(&w->initialPos, 0, 0, 120, 28);\r\n    }\r\n\r\n    w->dwExStyle = 0;\r\n    w->dwStyle = WS_CHILD | WS_VISIBLE | ES_LEFT | ES_AUTOHSCROLL;\r\n\r\n    w->txtCol = NO_COLOR;\r\n    w->bgCol = NO_COLOR;\r\n    w->bgBrush = nullptr;\r\n\r\n    return w;\r\n}\r\n\r\nbool CreateEditCtrl(EditCtrl *w) {\r\n    // Note: has to remember this here because when I GetWindowStyle() later on,\r\n    // WS_BORDER is not set, which is a mystery, because it is being drawn.\r\n    // also, WS_BORDER seems to be painted in client areay\r\n    w->hasBorder = bit::IsMaskSet<DWORD>(w->dwStyle, WS_BORDER);\r\n\r\n    RECT rc = w->initialPos;\r\n    w->hwnd = CreateWindowExW(w->dwExStyle, WC_EDIT, L\"\", w->dwStyle, rc.left, rc.top, RectDx(rc),\r\n                              RectDy(rc), w->parent, nullptr, GetModuleHandleW(nullptr), nullptr);\r\n\r\n    if (!w->hwnd) {\r\n        return false;\r\n    }\r\n    SetFont(w, GetDefaultGuiFont());\r\n    SetWindowSubclass(w->hwnd, EditProc, 0, (DWORD_PTR)w);\r\n    SetWindowSubclass(GetParent(w->hwnd), EditParentProc, 0, (DWORD_PTR)w);\r\n    return true;\r\n}\r\n\r\nvoid DeleteEditCtrl(EditCtrl *w) {\r\n    if (!w)\r\n        return;\r\n\r\n    DeleteObject(w->bgBrush);\r\n    free(w);\r\n}\r\n\r\nSIZE GetIdealSize(EditCtrl *w) {\r\n    // force sending WM_NCCALCSIZE\r\n    SetWindowPos(w->hwnd, nullptr, 0, 0, 0, 0,\r\n                 SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE);\r\n    WCHAR *txt = GetTextW(w);\r\n    if (str::Len(txt) == 0) {\r\n        free(txt);\r\n        txt = str::Dup(L\"Sample\");\r\n    }\r\n    SizeI s = TextSizeInHwnd(w->hwnd, txt);\r\n    free(txt);\r\n    SIZE res;\r\n    res.cx = s.dx + w->ncDx;\r\n    res.cy = s.dy + w->ncDy;\r\n\r\n    if (w->hasBorder) {\r\n        res.cx += 4;\r\n        res.cy += 4;\r\n    }\r\n\r\n    return res;\r\n}\r\n\r\nvoid SetPos(EditCtrl *w, RECT *r) { MoveWindow(w->hwnd, r); }\r\n"
  },
  {
    "path": "src/wingui/EditCtrl.h",
    "content": "\r\nstruct EditCtrl;\r\n\r\ntypedef std::function<LRESULT(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp, bool& discardMsg)>\r\n    MsgFilter;\r\ntypedef std::function<void(EditCtrl*)> EditCtrlCb;\r\n\r\n// pass to SetColor() function to indicate this color should not change\r\n#define NO_CHANGE (COLORREF)(-2) // -1 is taken by NO_COLOR in windows headers\r\n\r\nstruct EditCtrl {\r\n    // creation parameters. must be set before CreateEditWnd() call\r\n    HWND parent;\r\n    RECT initialPos;\r\n    DWORD dwStyle;\r\n    DWORD dwExStyle;\r\n\r\n    // private\r\n    int ncDx;\r\n    int ncDy;\r\n    bool hasBorder;\r\n\r\n    // public\r\n    HWND hwnd;\r\n\r\n    // this data should be set via corresponding API call\r\n    HBRUSH bgBrush;\r\n    COLORREF bgCol;\r\n    COLORREF txtCol;\r\n\r\n    // this data can be set directly\r\n    MsgFilter preFilter; // called at start of windows proc to\r\n    EditCtrlCb onTextChanged;\r\n};\r\n\r\n/* Creation sequence:\r\n- AllocEditCtrl()\r\n- set creation parameters\r\n- CreateEditCtrl()\r\n*/\r\n\r\nEditCtrl* AllocEditCtrl(HWND parent, RECT* initialPosition);\r\nbool CreateEditCtrl(EditCtrl*);\r\n\r\nvoid DeleteEditCtrl(EditCtrl*);\r\nvoid SetColors(EditCtrl*, COLORREF bgCol, COLORREF txtCol);\r\nvoid SetFont(EditCtrl*, HFONT);\r\nvoid SetText(EditCtrl*, const WCHAR*);\r\nbool SetCueText(EditCtrl*, const WCHAR*);\r\nWCHAR* GetTextW(EditCtrl*);\r\nchar* GetText(EditCtrl*);\r\nSIZE GetIdealSize(EditCtrl*);\r\nvoid SetPos(EditCtrl*, RECT*);\r\n"
  },
  {
    "path": "src/wingui/FrameRateWnd.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n// SetWindowSubclass, RemoveWindowSubclass and DefSubclassProc require the WinXP SDK\r\n// per http://msdn.microsoft.com/en-us/library/windows/desktop/bb762102%28v=vs.85%29.aspx\r\n// these functions should also be available under Win2000, though\r\n#undef _WIN32_WINNT\r\n#define _WIN32_WINNT 0x0501\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"FrameRateWnd.h\"\r\n#include \"WinUtil.h\"\r\n\r\n/*\r\nFrame rate window is a debugging tool that shows the frame rate, most likely\r\nof how long it takes to service WM_PAINT. It's good for a rough measure of\r\nhow fast painting is.\r\n\r\nThe window is a top-level window, semi-transparent, without decorations\r\nthat sits in the upper right corner of some other window (associated window).\r\n\r\nThe window must follow associated window so that it maintains an illusion\r\nthat it's actually a part of that window.\r\n*/\r\n\r\n#define FRAME_RATE_CLASS_NAME L\"FrameRateWnd\"\r\n\r\n#define COL_WHITE RGB(0xff, 0xff, 0xff)\r\n#define COL_BLACK RGB(0, 0, 0)\r\n\r\nstatic RECT GetClientRect(HWND hwnd) {\r\n    RECT r;\r\n    GetClientRect(hwnd, &r);\r\n    return r;\r\n}\r\n\r\nstatic void FrameRatePaint(FrameRateWnd *w, HDC hdc, PAINTSTRUCT &ps) {\r\n    UNUSED(ps);\r\n    RECT rc = GetClientRect(w->hwnd);\r\n    ScopedGdiObj<HBRUSH> brush(CreateSolidBrush(COL_BLACK));\r\n    FillRect(hdc, &rc, brush);\r\n\r\n    SetTextColor(hdc, COL_WHITE);\r\n\r\n    ScopedHdcSelect selFont(hdc, w->font);\r\n    ScopedMem<WCHAR> txt(str::Format(L\"%d\", w->frameRate));\r\n    DrawCenteredText(hdc, rc, txt);\r\n}\r\n\r\nstatic void PositionWindow(FrameRateWnd *w, SIZE s) {\r\n    RECT rc = GetClientRect(w->hwndAssociatedWith);\r\n    POINT p = { rc.right - s.cx, rc.top };\r\n    ClientToScreen(w->hwndAssociatedWith, &p);\r\n    MoveWindow(w->hwnd, p.x, p.y, s.cx, s.cy, TRUE);\r\n}\r\n\r\nstatic SIZE GetIdealSize(FrameRateWnd *w) {\r\n    WCHAR *txt = str::Format(L\"%d\", w->frameRate);\r\n    SizeI s = TextSizeInHwnd(w->hwnd, txt);\r\n\r\n    // add padding\r\n    s.dy += 4;\r\n    s.dx += 8;\r\n\r\n    // we wan't to avoid the window to grow/shrink when the number changes\r\n    // so we keep the largest size so far, since the difference isn't big\r\n    if (s.dx > w->maxSizeSoFar.cx) {\r\n        w->maxSizeSoFar.cx = s.dx;\r\n    }\r\n    if (s.dy > w->maxSizeSoFar.cy) {\r\n        w->maxSizeSoFar.cy = s.dy;\r\n    }\r\n    free(txt);\r\n    return w->maxSizeSoFar;\r\n}\r\n\r\nvoid ShowFrameRate(FrameRateWnd *w, int frameRate) {\r\n    if (!w || w->frameRate == frameRate) {\r\n        return;\r\n    }\r\n    w->frameRate = frameRate;\r\n    SIZE s = GetIdealSize(w);\r\n    PositionWindow(w, s);\r\n    ScheduleRepaint(w->hwnd);\r\n}\r\n\r\nvoid ShowFrameRateDur(FrameRateWnd *w, double durMs) {\r\n    ShowFrameRate(w, FrameRateFromDuration(durMs));\r\n}\r\n\r\nstatic void FrameRateOnPaint(FrameRateWnd *w) {\r\n    PAINTSTRUCT ps;\r\n    HDC hdc = BeginPaint(w->hwnd, &ps);\r\n    FrameRatePaint(w, hdc, ps);\r\n    EndPaint(w->hwnd, &ps);\r\n}\r\n\r\nstatic LRESULT CALLBACK WndProcFrameRateAssociated(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,\r\n                                                   UINT_PTR uIdSubclass, DWORD_PTR dwRefData) {\r\n    UNUSED(uIdSubclass);\r\n    if (WM_MOVING == msg || WM_SIZING == msg || WM_SIZE == msg || WM_WINDOWPOSCHANGED == msg ||\r\n        WM_MOVE == msg) {\r\n        FrameRateWnd *w = (FrameRateWnd *)dwRefData;\r\n        PositionWindow(w, w->maxSizeSoFar);\r\n    }\r\n    return DefSubclassProc(hwnd, msg, wp, lp);\r\n}\r\n\r\nstatic LRESULT CALLBACK WndProcFrameRate(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) {\r\n    FrameRateWnd *w;\r\n\r\n    if (msg == WM_ERASEBKGND) {\r\n        return TRUE; // tells Windows we handle background erasing so it doesn't do it\r\n    }\r\n\r\n    if (msg == WM_NCCREATE) {\r\n        LPCREATESTRUCT lpcs = reinterpret_cast<LPCREATESTRUCT>(lp);\r\n        w = reinterpret_cast<FrameRateWnd *>(lpcs->lpCreateParams);\r\n        w->hwnd = hwnd;\r\n        SetWindowLongPtr(hwnd, GWLP_USERDATA, reinterpret_cast<LPARAM>(w));\r\n    } else {\r\n        w = reinterpret_cast<FrameRateWnd *>(GetWindowLongPtr(hwnd, GWLP_USERDATA));\r\n    }\r\n\r\n    if (!w) {\r\n        return DefWindowProc(hwnd, msg, wp, lp);\r\n    }\r\n\r\n    // other clients that might use WM_SETFONT/WM_GETFONT\r\n    if (WM_GETFONT == msg) {\r\n        return (LRESULT)w->font;\r\n    }\r\n\r\n    if (WM_SETFONT == msg) {\r\n        w->font = (HFONT)wp;\r\n        return 0;\r\n    }\r\n\r\n    if (WM_PAINT == msg) {\r\n        FrameRateOnPaint(w);\r\n        return 0;\r\n    }\r\n\r\n    return DefWindowProc(hwnd, msg, wp, lp);\r\n}\r\n\r\nstatic void RegisterFrameRateWndClass() {\r\n    static ATOM atom = 0;\r\n    if (!atom) {\r\n        WNDCLASSEX wcex;\r\n        FillWndClassEx(wcex, FRAME_RATE_CLASS_NAME, WndProcFrameRate);\r\n        atom = RegisterClassEx(&wcex);\r\n        CrashIf(!atom);\r\n    }\r\n}\r\n\r\nFrameRateWnd *AllocFrameRateWnd(HWND hwndAssociatedWith) {\r\n    RegisterFrameRateWndClass();\r\n    FrameRateWnd *w = AllocStruct<FrameRateWnd>();\r\n    w->hwndAssociatedWith = hwndAssociatedWith;\r\n    w->frameRate = -1;\r\n    return w;\r\n}\r\n\r\nbool CreateFrameRateWnd(FrameRateWnd *w) {\r\n    // if hwndAssociatedWith is a child window, we need to find its top-level parent\r\n    // so that we can intercept moving messages and re-position frame rate window\r\n    // during main window moves\r\n    HWND topLevel = w->hwndAssociatedWith;\r\n    while (GetParent(topLevel) != nullptr) {\r\n        topLevel = GetParent(topLevel);\r\n    }\r\n    w->hwndAssociatedWithTopLevel = topLevel;\r\n    // WS_POPUP removes all decorations\r\n    DWORD dwStyle = WS_POPUP | WS_VISIBLE | WS_DISABLED;\r\n    // since this is WS_POPUP window, providing w->hwndAssocatedWith doesn't establish\r\n    // parent-child relationship but ownership relationship (as long as hwndAssociatedWith\r\n    // is WS_OVERLAPEPED or WS_POPUP). Owned window always shows up on top of owner in z-order\r\n    // http://msdn.microsoft.com/en-us/library/ms632599%28v=VS.85%29.aspx#owned_windows\r\n    // WS_EX_TRANSPARENT so that the mouse events fall through to the window below\r\n    HWND hwnd =\r\n        CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT, FRAME_RATE_CLASS_NAME, nullptr, dwStyle,\r\n                       0, 0, 0, 0, w->hwndAssociatedWith, nullptr, GetModuleHandle(nullptr), w);\r\n    CrashIf(hwnd != w->hwnd);\r\n    if (!hwnd) {\r\n        return false;\r\n    }\r\n    w->font = GetDefaultGuiFont();\r\n    SetWindowSubclass(w->hwndAssociatedWithTopLevel, WndProcFrameRateAssociated, 0, (DWORD_PTR)w);\r\n\r\n    SetLayeredWindowAttributes(hwnd, 0, 0x7f, LWA_ALPHA);\r\n    ShowFrameRate(w, 0);\r\n    return true;\r\n}\r\n\r\nvoid DeleteFrameRateWnd(FrameRateWnd *w) {\r\n    if (w) {\r\n        RemoveWindowSubclass(w->hwndAssociatedWithTopLevel, WndProcFrameRateAssociated, 0);\r\n        free(w);\r\n    }\r\n}\r\n\r\nint FrameRateFromDuration(double durMs) { return (int)(double(1000) / durMs); }\r\n"
  },
  {
    "path": "src/wingui/FrameRateWnd.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nstruct FrameRateWnd {\r\n    HWND hwndAssociatedWith;\r\n    HWND hwndAssociatedWithTopLevel;\r\n\r\n    HWND hwnd;\r\n    HFONT font;\r\n\r\n    SIZE maxSizeSoFar;\r\n    int frameRate;\r\n};\r\n\r\nFrameRateWnd *AllocFrameRateWnd(HWND hwndAssociatedWith);\r\nbool CreateFrameRateWnd(FrameRateWnd *);\r\nvoid DeleteFrameRateWnd(FrameRateWnd *);\r\nvoid ShowFrameRate(FrameRateWnd *, int frameRate);\r\nvoid ShowFrameRateDur(FrameRateWnd *, double durMs);\r\n\r\nint FrameRateFromDuration(double durMs);\r\n"
  },
  {
    "path": "src/wingui/LabelWithCloseWnd.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"LabelWithCloseWnd.h\"\r\n#include \"Dpi.h\"\r\n#include \"GdiPlusUtil.h\"\r\n#include \"WinUtil.h\"\r\n\r\n#define CLOSE_BTN_DX 16\r\n#define CLOSE_BTN_DY 16\r\n#define LABEL_BUTTON_SPACE_DX 8\r\n\r\n#define WND_CLASS_NAME L\"LabelWithCloseWndClass\"\r\n\r\nstruct LabelWithCloseWnd {\r\n    HWND hwnd;\r\n    HFONT font;\r\n    int cmd;\r\n\r\n    RectI closeBtnPos;\r\n    COLORREF txtCol;\r\n    COLORREF bgCol;\r\n\r\n    // in points\r\n    int padX, padY;\r\n};\r\n\r\nstatic bool IsMouseOverClose(LabelWithCloseWnd *w) {\r\n    PointI p;\r\n    GetCursorPosInHwnd(w->hwnd, p);\r\n    return w->closeBtnPos.Contains(p);\r\n}\r\n\r\n// Draws the 'x' close button in regular state or onhover state\r\n// Tries to mimic visual style of Chrome tab close button\r\nstatic void DrawCloseButton(HDC hdc, LabelWithCloseWnd *w) {\r\n    Graphics g(hdc);\r\n    g.SetCompositingQuality(CompositingQualityHighQuality);\r\n    g.SetSmoothingMode(SmoothingModeAntiAlias);\r\n    g.SetPageUnit(UnitPixel);\r\n    // GDI+ doesn't pick up the window's orientation through the device context,\r\n    // so we have to explicitly mirror all rendering horizontally\r\n    if (IsRtl(w->hwnd)) {\r\n        g.ScaleTransform(-1, 1);\r\n        g.TranslateTransform((REAL)ClientRect(w->hwnd).dx, 0, MatrixOrderAppend);\r\n    }\r\n\r\n    Color c;\r\n    RectI &r = w->closeBtnPos;\r\n\r\n    // in onhover state, background is a red-ish circle\r\n    bool onHover = IsMouseOverClose(w);\r\n    if (onHover) {\r\n        c.SetFromCOLORREF(COL_CLOSE_HOVER_BG);\r\n        SolidBrush b(c);\r\n        g.FillEllipse(&b, r.x, r.y, r.dx - 2, r.dy - 2);\r\n    }\r\n\r\n    // draw 'x'\r\n    c.SetFromCOLORREF(onHover ? COL_CLOSE_X_HOVER : COL_CLOSE_X);\r\n    g.TranslateTransform((float)r.x, (float)r.y);\r\n    Pen p(c, 2);\r\n    if (onHover) {\r\n        g.DrawLine(&p, Point(4, 4), Point(r.dx - 6, r.dy - 6));\r\n        g.DrawLine(&p, Point(r.dx - 6, 4), Point(4, r.dy - 6));\r\n    } else {\r\n        g.DrawLine(&p, Point(4, 5), Point(r.dx - 6, r.dy - 5));\r\n        g.DrawLine(&p, Point(r.dx - 6, 5), Point(4, r.dy - 5));\r\n    }\r\n}\r\n\r\nstatic void PaintHDC(LabelWithCloseWnd *w, HDC hdc, const PAINTSTRUCT &ps) {\r\n    HBRUSH br = CreateSolidBrush(w->bgCol);\r\n    FillRect(hdc, &ps.rcPaint, br);\r\n\r\n    ClientRect cr(w->hwnd);\r\n\r\n    int x = DpiScaleX(w->hwnd, w->padX);\r\n    int y = DpiScaleY(w->hwnd, w->padY);\r\n    UINT opts = ETO_OPAQUE;\r\n    if (IsRtl(w->hwnd)) {\r\n        opts = opts | ETO_RTLREADING;\r\n    }\r\n\r\n    HGDIOBJ prevFont = nullptr;\r\n    if (w->font) {\r\n        prevFont = SelectObject(hdc, w->font);\r\n    }\r\n    SetTextColor(hdc, w->txtCol);\r\n    SetBkColor(hdc, w->bgCol);\r\n\r\n    WCHAR *s = win::GetText(w->hwnd);\r\n    ExtTextOut(hdc, x, y, opts, nullptr, s, (UINT)str::Len(s), nullptr);\r\n    free(s);\r\n\r\n    // Text might be too long and invade close button area. We just re-paint\r\n    // the background, which is not the pretties but works.\r\n    // A better way would be to intelligently truncate text or shrink the font\r\n    // size (within reason)\r\n    x = w->closeBtnPos.x - DpiScaleX(w->hwnd, LABEL_BUTTON_SPACE_DX);\r\n    RectI ri(x, 0, cr.dx - x, cr.dy);\r\n    RECT r = ri.ToRECT();\r\n    FillRect(hdc, &r, br);\r\n\r\n    DrawCloseButton(hdc, w);\r\n    DeleteObject(br);\r\n\r\n    if (w->font) {\r\n        SelectObject(hdc, prevFont);\r\n    }\r\n}\r\n\r\nstatic void OnPaint(LabelWithCloseWnd *w) {\r\n    PAINTSTRUCT ps;\r\n    HDC hdc = BeginPaint(w->hwnd, &ps);\r\n    DoubleBuffer buffer(w->hwnd, RectI::FromRECT(ps.rcPaint));\r\n    PaintHDC(w, buffer.GetDC(), ps);\r\n    buffer.Flush(hdc);\r\n    EndPaint(w->hwnd, &ps);\r\n}\r\n\r\nstatic void CalcCloseButtonPos(LabelWithCloseWnd *w, int dx, int dy) {\r\n    int btnDx = DpiScaleX(w->hwnd, CLOSE_BTN_DX);\r\n    int btnDy = DpiScaleY(w->hwnd, CLOSE_BTN_DY);\r\n    int x = dx - btnDx - DpiScaleX(w->hwnd, w->padX);\r\n    int y = 0;\r\n    if (dy > btnDy) {\r\n        y = (dy - btnDy) / 2;\r\n    }\r\n    w->closeBtnPos = RectI(x, y, btnDx, btnDy);\r\n}\r\n\r\nstatic LRESULT CALLBACK WndProcLabelWithClose(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) {\r\n    if (WM_ERASEBKGND == msg) {\r\n        return TRUE; // tells Windows we handle background erasing so it doesn't do it\r\n    }\r\n\r\n    LabelWithCloseWnd *w = nullptr;\r\n    if (WM_NCCREATE == msg) {\r\n        LPCREATESTRUCT lpcs = reinterpret_cast<LPCREATESTRUCT>(lp);\r\n        w = reinterpret_cast<LabelWithCloseWnd *>(lpcs->lpCreateParams);\r\n        w->hwnd = hwnd;\r\n        SetWindowLongPtr(hwnd, GWLP_USERDATA, reinterpret_cast<LPARAM>(w));\r\n        goto DoDefault;\r\n    } else {\r\n        w = reinterpret_cast<LabelWithCloseWnd *>(GetWindowLongPtr(hwnd, GWLP_USERDATA));\r\n    }\r\n\r\n    if (!w) {\r\n        goto DoDefault;\r\n    }\r\n\r\n    // to match other controls, preferred way is explict SetFont() call\r\n    if (WM_SETFONT == msg) {\r\n        SetFont(w, (HFONT)wp);\r\n        return 0;\r\n    }\r\n\r\n    if (WM_GETFONT == msg) {\r\n        return (LRESULT)w->font;\r\n    }\r\n\r\n    if (WM_SIZE == msg) {\r\n        int dx = LOWORD(lp);\r\n        int dy = HIWORD(lp);\r\n        CalcCloseButtonPos(w, dx, dy);\r\n        ScheduleRepaint(hwnd);\r\n        return 0;\r\n    }\r\n\r\n    if (WM_MOUSEMOVE == msg) {\r\n        ScheduleRepaint(w->hwnd);\r\n\r\n        if (IsMouseOverClose(w)) {\r\n            // ask for WM_MOUSELEAVE notifications\r\n            TRACKMOUSEEVENT tme = { 0 };\r\n            tme.cbSize = sizeof(tme);\r\n            tme.dwFlags = TME_LEAVE;\r\n            tme.hwndTrack = hwnd;\r\n            TrackMouseEvent(&tme);\r\n        }\r\n        goto DoDefault;\r\n    }\r\n\r\n    if (WM_MOUSELEAVE == msg) {\r\n        ScheduleRepaint(w->hwnd);\r\n        return 0;\r\n    }\r\n\r\n    if (WM_LBUTTONUP == msg) {\r\n        if (IsMouseOverClose(w)) {\r\n            HWND parent = GetParent(w->hwnd);\r\n            SendMessage(parent, WM_COMMAND, w->cmd, 0);\r\n        }\r\n        return 0;\r\n    }\r\n\r\n    if (WM_PAINT == msg) {\r\n        OnPaint(w);\r\n        return 0;\r\n    }\r\n\r\nDoDefault:\r\n    return DefWindowProc(hwnd, msg, wp, lp);\r\n}\r\n\r\nvoid RegisterLabelWithCloseWnd() {\r\n    WNDCLASSEX wcex;\r\n    FillWndClassEx(wcex, WND_CLASS_NAME, WndProcLabelWithClose);\r\n    RegisterClassEx(&wcex);\r\n}\r\n\r\nvoid SetLabel(LabelWithCloseWnd *w, const WCHAR *label) {\r\n    win::SetText(w->hwnd, label);\r\n    ScheduleRepaint(w->hwnd);\r\n}\r\n\r\nvoid SetBgCol(LabelWithCloseWnd *w, COLORREF c) {\r\n    w->bgCol = c;\r\n    ScheduleRepaint(w->hwnd);\r\n}\r\n\r\nvoid SetTextCol(LabelWithCloseWnd *w, COLORREF c) {\r\n    w->txtCol = c;\r\n    ScheduleRepaint(w->hwnd);\r\n}\r\n\r\n// cmd is both the id of the window as well as id of WM_COMMAND sent\r\n// when close button is clicked\r\n// caller needs to free() the result\r\nLabelWithCloseWnd *CreateLabelWithCloseWnd(HWND parent, int cmd) {\r\n    LabelWithCloseWnd *w = AllocStruct<LabelWithCloseWnd>();\r\n    w->cmd = cmd;\r\n    w->bgCol = GetSysColor(COLOR_BTNFACE);\r\n    w->txtCol = GetSysColor(COLOR_BTNTEXT);\r\n\r\n    // sets w->hwnd during WM_NCCREATE\r\n    HWND hwnd = CreateWindow(WND_CLASS_NAME, L\"\", WS_VISIBLE | WS_CHILD, 0, 0, 0, 0, parent,\r\n                             (HMENU)(INT_PTR)cmd, GetModuleHandle(nullptr), w);\r\n    CrashIf(w->hwnd != hwnd);\r\n    CrashIf(!w->hwnd);\r\n    return w;\r\n}\r\n\r\nHWND GetHwnd(LabelWithCloseWnd *w) { return w->hwnd; }\r\n\r\nSizeI GetIdealSize(LabelWithCloseWnd *w) {\r\n    WCHAR *s = win::GetText(w->hwnd);\r\n    SizeI size = TextSizeInHwnd(w->hwnd, s);\r\n    free(s);\r\n    int btnDx = DpiScaleX(w->hwnd, CLOSE_BTN_DX);\r\n    int btnDy = DpiScaleY(w->hwnd, CLOSE_BTN_DY);\r\n    size.dx += btnDx;\r\n    size.dx += DpiScaleX(w->hwnd, LABEL_BUTTON_SPACE_DX);\r\n    size.dx += 2 * DpiScaleX(w->hwnd, w->padX);\r\n    if (size.dy < btnDy) {\r\n        size.dy = btnDy;\r\n    }\r\n    size.dy += 2 * DpiScaleY(w->hwnd, w->padY);\r\n    return size;\r\n}\r\n\r\nvoid SetFont(LabelWithCloseWnd *w, HFONT f) { w->font = f; }\r\n\r\nvoid SetPaddingXY(LabelWithCloseWnd *w, int x, int y) {\r\n    w->padX = x;\r\n    w->padY = y;\r\n    ScheduleRepaint(w->hwnd);\r\n}\r\n"
  },
  {
    "path": "src/wingui/LabelWithCloseWnd.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nstruct LabelWithCloseWnd;\r\n\r\nvoid RegisterLabelWithCloseWnd();\r\nLabelWithCloseWnd* CreateLabelWithCloseWnd(HWND parent, int cmd);\r\nHWND GetHwnd(LabelWithCloseWnd*);\r\nvoid SetLabel(LabelWithCloseWnd*, const WCHAR*);\r\nvoid SetFont(LabelWithCloseWnd*, HFONT);\r\nvoid SetBgCol(LabelWithCloseWnd*, COLORREF);\r\nvoid SetTextCol(LabelWithCloseWnd*, COLORREF);\r\nvoid SetPaddingXY(LabelWithCloseWnd*, int x, int y);\r\nSizeI GetIdealSize(LabelWithCloseWnd*);\r\n"
  },
  {
    "path": "src/wingui/SplitterWnd.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"SplitterWnd.h\"\r\n\r\n#include \"BitManip.h\"\r\n#include \"WinUtil.h\"\r\n\r\n// the technique for drawing the splitter for non-live resize is described\r\n// at http://www.catch22.net/tuts/splitter-windows\r\n\r\n#define SPLITTER_CLASS_NAME L\"SplitterWndClass\"\r\n\r\nstatic HBITMAP splitterBmp = nullptr;\r\nstatic HBRUSH splitterBrush = nullptr;\r\n\r\nstruct SplitterWnd {\r\n    // none of this data needs to be freed by us\r\n    HWND hwnd;\r\n    void *ctx;\r\n    SplitterType type;\r\n    SplitterCallback cb;\r\n    COLORREF bgCol;\r\n    bool isLive;\r\n    PointI prevResizeLinePos;\r\n    // if a parent clips children, DrawXorBar() doesn't work, so for\r\n    // non-live resize, we need to remove WS_CLIPCHILDREN style from\r\n    // parent and restore it when we're done\r\n    bool parentClipsChildren;\r\n};\r\n\r\nstatic void OnPaint(SplitterWnd *w) {\r\n    PAINTSTRUCT ps;\r\n    HDC hdc = BeginPaint(w->hwnd, &ps);\r\n    HBRUSH br = CreateSolidBrush(w->bgCol);\r\n    FillRect(hdc, &ps.rcPaint, br);\r\n    DeleteObject(br);\r\n    EndPaint(w->hwnd, &ps);\r\n}\r\n\r\nstatic void DrawXorBar(HDC hdc, int x1, int y1, int width, int height) {\r\n    SetBrushOrgEx(hdc, x1, y1, 0);\r\n    HBRUSH hbrushOld = (HBRUSH)SelectObject(hdc, splitterBrush);\r\n    PatBlt(hdc, x1, y1, width, height, PATINVERT);\r\n    SelectObject(hdc, hbrushOld);\r\n}\r\n\r\nstatic HDC InitDraw(SplitterWnd *w, RectI &rc) {\r\n    rc = ChildPosWithinParent(w->hwnd);\r\n    HDC hdc = GetDC(GetParent(w->hwnd));\r\n    SetROP2(hdc, R2_NOTXORPEN);\r\n    return hdc;\r\n}\r\n\r\nstatic void DrawResizeLineV(SplitterWnd *w, int x) {\r\n    RectI rc;\r\n    HDC hdc = InitDraw(w, rc);\r\n    DrawXorBar(hdc, x, rc.y, 4, rc.dy);\r\n    ReleaseDC(GetParent(w->hwnd), hdc);\r\n}\r\n\r\nstatic void DrawResizeLineH(SplitterWnd *w, int y) {\r\n    RectI rc;\r\n    HDC hdc = InitDraw(w, rc);\r\n    DrawXorBar(hdc, rc.x, y, rc.dx, 4);\r\n    ReleaseDC(GetParent(w->hwnd), hdc);\r\n}\r\n\r\nstatic void DrawResizeLineVH(SplitterWnd *w, bool isVert, PointI pos) {\r\n    if (isVert)\r\n        DrawResizeLineV(w, pos.x);\r\n    else\r\n        DrawResizeLineH(w, pos.y);\r\n}\r\n\r\nstatic void DrawResizeLine(SplitterWnd *w, bool erasePrev, bool drawCurr) {\r\n    PointI pos;\r\n    GetCursorPosInHwnd(GetParent(w->hwnd), pos);\r\n    bool isVert = w->type != SplitterHoriz;\r\n\r\n    if (erasePrev) {\r\n        DrawResizeLineVH(w, isVert, w->prevResizeLinePos);\r\n    }\r\n    if (drawCurr) {\r\n        DrawResizeLineVH(w, isVert, pos);\r\n    }\r\n    w->prevResizeLinePos = pos;\r\n}\r\n\r\nstatic LRESULT CALLBACK WndProcSplitter(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) {\r\n    if (WM_ERASEBKGND == msg) {\r\n        return TRUE; // tells Windows we handle background erasing so it doesn't do it\r\n    }\r\n\r\n    SplitterWnd *w = nullptr;\r\n    if (WM_NCCREATE == msg) {\r\n        LPCREATESTRUCT lpcs = reinterpret_cast<LPCREATESTRUCT>(lp);\r\n        w = reinterpret_cast<SplitterWnd *>(lpcs->lpCreateParams);\r\n        w->hwnd = hwnd;\r\n        SetWindowLongPtr(hwnd, GWLP_USERDATA, reinterpret_cast<LPARAM>(w));\r\n        goto Exit;\r\n    } else {\r\n        w = reinterpret_cast<SplitterWnd *>(GetWindowLongPtr(hwnd, GWLP_USERDATA));\r\n    }\r\n\r\n    if (!w) {\r\n        goto Exit;\r\n    }\r\n\r\n    if (WM_LBUTTONDOWN == msg) {\r\n        SetCapture(hwnd);\r\n        if (!w->isLive) {\r\n            if (w->parentClipsChildren) {\r\n                ToggleWindowStyle(GetParent(hwnd), WS_CLIPCHILDREN, false);\r\n            }\r\n            DrawResizeLine(w, false, true);\r\n        }\r\n        return 0;\r\n    }\r\n\r\n    if (WM_LBUTTONUP == msg) {\r\n        if (!w->isLive) {\r\n            DrawResizeLine(w, true, false);\r\n            if (w->parentClipsChildren) {\r\n                ToggleWindowStyle(GetParent(hwnd), WS_CLIPCHILDREN, true);\r\n            }\r\n        }\r\n        ReleaseCapture();\r\n        w->cb(w->ctx, true);\r\n        ScheduleRepaint(w->hwnd);\r\n        return 0;\r\n    }\r\n\r\n    if (WM_MOUSEMOVE == msg) {\r\n        LPWSTR curId = IDC_SIZENS;\r\n        if (SplitterVert == w->type) {\r\n            curId = IDC_SIZEWE;\r\n        }\r\n        if (hwnd == GetCapture()) {\r\n            bool resizingAllowed = w->cb(w->ctx, false);\r\n            if (!resizingAllowed) {\r\n                curId = IDC_NO;\r\n            } else if (!w->isLive) {\r\n                DrawResizeLine(w, true, true);\r\n            }\r\n        }\r\n        SetCursor(curId);\r\n        return 0;\r\n    }\r\n\r\n    if (WM_PAINT == msg) {\r\n        OnPaint(w);\r\n        return 0;\r\n    }\r\n\r\nExit:\r\n    return DefWindowProc(hwnd, msg, wp, lp);\r\n}\r\n\r\n// call only once at the beginning of program\r\nvoid RegisterSplitterWndClass() {\r\n    if (splitterBmp)\r\n        return;\r\n\r\n    static WORD dotPatternBmp[8] = {\r\n        0x00aa, 0x0055, 0x00aa, 0x0055, 0x00aa, 0x0055, 0x00aa, 0x0055\r\n    };\r\n\r\n    splitterBmp = CreateBitmap(8, 8, 1, 1, dotPatternBmp);\r\n    splitterBrush = CreatePatternBrush(splitterBmp);\r\n\r\n    WNDCLASSEX wcex;\r\n    FillWndClassEx(wcex, SPLITTER_CLASS_NAME, WndProcSplitter);\r\n    RegisterClassEx(&wcex);\r\n}\r\n\r\n// caller needs to free() the result\r\nSplitterWnd *CreateSplitter(HWND parent, SplitterType type, void *ctx, SplitterCallback cb) {\r\n    SplitterWnd *w = AllocStruct<SplitterWnd>();\r\n    w->ctx = ctx;\r\n    w->cb = cb;\r\n    w->type = type;\r\n    w->bgCol = GetSysColor(COLOR_BTNFACE);\r\n    w->isLive = true;\r\n    DWORD style = GetWindowLong(parent, GWL_STYLE);\r\n    w->parentClipsChildren = bit::IsMaskSet<DWORD>(style, WS_CLIPCHILDREN);\r\n    // w->hwnd is set during WM_NCCREATE\r\n    CreateWindow(SPLITTER_CLASS_NAME, L\"\", WS_CHILDWINDOW, 0, 0, 0, 0, parent, (HMENU)0,\r\n                 GetModuleHandle(nullptr), w);\r\n    CrashIf(!w->hwnd);\r\n    return w;\r\n}\r\n\r\nHWND GetHwnd(SplitterWnd *s) { return s->hwnd; }\r\n\r\nvoid SetBgCol(SplitterWnd *w, COLORREF c) {\r\n    w->bgCol = c;\r\n    ScheduleRepaint(w->hwnd);\r\n}\r\n\r\nvoid SetSplitterLive(SplitterWnd *w, bool live) { w->isLive = live; }\r\n\r\nvoid DeleteSplitterBrush() {\r\n    DeleteObject(splitterBrush);\r\n    splitterBrush = nullptr;\r\n    DeleteObject(splitterBmp);\r\n    splitterBmp = nullptr;\r\n}\r\n"
  },
  {
    "path": "src/wingui/SplitterWnd.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\nstruct SplitterWnd;\r\n\r\nenum SplitterType {\r\n    SplitterHoriz,\r\n    SplitterVert,\r\n};\r\n\r\n// called when user drags the splitter ('done' is false) and when drag is finished ('done' is\r\n// true). the owner can constrain splitter by using current cursor\r\n// position and returning false if it's not allowed to go there\r\ntypedef bool (*SplitterCallback)(void *ctx, bool done);\r\n\r\nvoid RegisterSplitterWndClass();\r\nSplitterWnd *CreateSplitter(HWND parent, SplitterType type, void *ctx, SplitterCallback cb);\r\nHWND GetHwnd(SplitterWnd *);\r\nvoid SetBgCol(SplitterWnd *, COLORREF);\r\n\r\n// call at the end of program\r\nvoid DeleteSplitterBrush();\r\n\r\n// If a splitter is \"live\", the owner will re-layout windows in the callback,\r\n// otherwise we'll draw an indicator of where the splitter will be\r\n// at the end of resize and the owner only re-layouts when callback is called\r\n// with 'done' set to true\r\nvoid SetSplitterLive(SplitterWnd *, bool live);\r\n"
  },
  {
    "path": "src/wingui/TabsWnd.cpp",
    "content": "#include \"BaseUtil.h\"\r\n#include \"TabsWnd.h\"\r\n\r\nTabsWnd *AllocTabsWnd(HWND hwndParent) {\r\n    auto w = AllocStruct<TabsWnd>();\r\n    w->hwndParent = hwndParent;\r\n    return w;\r\n}\r\n\r\nbool CreateTabsWnd(TabsWnd* w) {\r\n    DWORD dwStyle = WS_CHILD\r\n        | WS_VISIBLE\r\n        | WS_CLIPSIBLINGS\r\n        | TCS_FOCUSNEVER\r\n        | TCS_FIXEDWIDTH\r\n        | TCS_FORCELABELLEFT;\r\n\r\n    w->hwnd = CreateWindowW(WC_TABCONTROL, L\"\",\r\n        dwStyle,\r\n        0, 0, 0, 0,\r\n        w->hwndParent, (HMENU)nullptr, GetModuleHandle(nullptr), nullptr);\r\n    return w->hwnd != nullptr;\r\n}\r\n\r\nvoid DeleteTabsWnd(TabsWnd* w) {\r\n    if (w) {\r\n        // it's a child window so need to destroy hwnd\r\n        free(w);\r\n    }\r\n}\r\n"
  },
  {
    "path": "src/wingui/TabsWnd.h",
    "content": "\r\nstruct TabsWnd {\r\n    HWND hwnd;\r\n    HWND hwndParent;\r\n};\r\n\r\nTabsWnd *AllocTabsWnd(HWND hwndParent);\r\nbool CreateTabsWnd(TabsWnd*);\r\nvoid DeleteTabsWnd(TabsWnd*);\r\n\r\n\r\n"
  },
  {
    "path": "src/wingui/Win32Window.cpp",
    "content": "#include \"BaseUtil.h\"\r\n\r\n#include \"WinUtil.h\"\r\n#include \"Win32Window.h\"\r\n#include \"FileUtil.h\"\r\n#include \"EditCtrl.h\" // TODO: for MsgFilter\r\n\r\n#define WIN_CLASS L\"WC_WIN32_WINDOW\"\r\n\r\nstatic ATOM wndClass = 0;\r\n\r\nstatic LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) {\r\n    if (WM_CREATE == msg) {\r\n        CREATESTRUCT *cs = (CREATESTRUCT *)lp;\r\n        Win32Window *w = (Win32Window *)cs->lpCreateParams;\r\n        SetWindowLongPtrW(hwnd, GWLP_USERDATA, (LONG_PTR)w);\r\n        return DefWindowProc(hwnd, msg, wp, lp);\r\n    }\r\n\r\n    Win32Window *w = (Win32Window *)GetWindowLongPtr(hwnd, GWLP_USERDATA);\r\n\r\n    // don't allow intercepting those messages\r\n    if (WM_DESTROY == msg) {\r\n        PostQuitMessage(0);\r\n        return 0;\r\n    }\r\n\r\n    if (WM_NCDESTROY == msg) {\r\n        free(w);\r\n        return DefWindowProc(hwnd, msg, wp, lp);\r\n    }\r\n\r\n    if (w && w->preFilter) {\r\n        bool discardMsg = false;\r\n        LRESULT res = w->preFilter(w, msg, wp, lp, discardMsg);\r\n        if (discardMsg)\r\n            return res;\r\n    }\r\n\r\n    if (w && (WM_COMMAND == msg) && w->onCommand) {\r\n        bool discardMsg = false;\r\n        LRESULT res = w->onCommand(w, LOWORD(wp), HIWORD(wp), lp, discardMsg);\r\n        if (discardMsg)\r\n            return res;\r\n        return DefWindowProc(hwnd, msg, wp, lp);\r\n    }\r\n\r\n    if (w && (WM_SIZE == msg) && w->onSize) {\r\n        int dx = LOWORD(lp);\r\n        int dy = HIWORD(lp);\r\n        w->onSize(w, dx, dy, wp);\r\n        return 0;\r\n    }\r\n\r\n    if (WM_PAINT == msg) {\r\n        PAINTSTRUCT ps;\r\n        BeginPaint(hwnd, &ps);\r\n        EndPaint(hwnd, &ps);\r\n        return 0;\r\n    }\r\n\r\n    return DefWindowProc(hwnd, msg, wp, lp);\r\n}\r\n\r\nstatic ATOM RegisterClass(Win32Window *w) {\r\n    if (wndClass != 0) {\r\n        return wndClass;\r\n    }\r\n\r\n    WNDCLASSEXW wcex = { 0 };\r\n    auto hInst = GetInstance();\r\n    wcex.cbSize = sizeof(WNDCLASSEXW);\r\n\r\n    wcex.style = CS_HREDRAW | CS_VREDRAW;\r\n    wcex.lpfnWndProc = WndProc;\r\n    wcex.cbClsExtra = 0;\r\n    wcex.cbWndExtra = 0;\r\n    wcex.hInstance = hInst;\r\n    wcex.hIcon = w->hIcon;\r\n    wcex.hIconSm = w->hIconSm;\r\n    wcex.lpszMenuName = w->lpszMenuName;\r\n    wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);\r\n    wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);\r\n    wcex.lpszClassName = WIN_CLASS;\r\n\r\n    wndClass = RegisterClassExW(&wcex);\r\n    return wndClass;\r\n}\r\n\r\nvoid InitWin32Window(Win32Window *w, HWND parent, RECT *initialPosition) {\r\n    w->parent = parent;\r\n    if (initialPosition) {\r\n        w->initialPos = *initialPosition;\r\n    }\r\n\r\n    w->dwExStyle = 0;\r\n    w->dwStyle = WS_OVERLAPPEDWINDOW;\r\n    if (parent != nullptr) {\r\n        w->dwStyle |= WS_CHILD;\r\n    }\r\n}\r\n\r\nWin32Window *AllocWin32Window(HWND parent, RECT *initialPosition) {\r\n    auto w = AllocStruct<Win32Window>();\r\n    InitWin32Window(w, parent, initialPosition);\r\n    return w;\r\n}\r\n\r\nbool CreateWin32Window(Win32Window *w, const WCHAR *title) {\r\n    RegisterClass(w);\r\n\r\n    RECT rc = w->initialPos;\r\n    int x = rc.left;\r\n    int y = rc.top;\r\n    int dx = RectDx(rc);\r\n    int dy = RectDy(rc);\r\n    if (dx == 0) {\r\n        x = CW_USEDEFAULT;\r\n        y = CW_USEDEFAULT;\r\n        dx = CW_USEDEFAULT;\r\n        dy = CW_USEDEFAULT;\r\n    }\r\n    w->hwnd = CreateWindowExW(w->dwExStyle, WIN_CLASS, title, w->dwStyle, x, y, dx, dy, w->parent,\r\n                              nullptr, GetInstance(), (void *)w);\r\n\r\n    return w->hwnd != nullptr;\r\n}\r\n\r\nvoid DeleteWin32Window(Win32Window *w) {\r\n    if (!w)\r\n        return;\r\n\r\n    // we free w in WM_DESTROY\r\n    DestroyWindow(w->hwnd);\r\n}\r\n"
  },
  {
    "path": "src/wingui/Win32Window.h",
    "content": "\r\nstruct Win32Window;\r\n\r\ntypedef std::function<LRESULT(Win32Window *w, UINT msg, WPARAM wp, LPARAM lp, bool &discardMsg)>\r\n    Win32MsgFilter;\r\ntypedef std::function<LRESULT(Win32Window *w, int id, int event, LPARAM lp, bool &discardMsg)>\r\n    WmCommandCb;\r\ntypedef std::function<void(Win32Window *w, int dx, int dy, WPARAM resizeType)> OnSizeCb;\r\n\r\nstruct Win32Window {\r\n    // creation parameters. must be set before CreateWin32Window() call\r\n    HWND parent;\r\n    RECT initialPos;\r\n    DWORD dwStyle;\r\n    DWORD dwExStyle;\r\n\r\n    // those tweak WNDCLASSEX for RegisterClass() class\r\n    HICON hIcon;\r\n    HICON hIconSm;\r\n    LPCWSTR lpszMenuName;\r\n\r\n    // can be set any time\r\n    Win32MsgFilter preFilter; // called at start of windows proc to allow intercepting commands\r\n    WmCommandCb onCommand;\r\n    OnSizeCb onSize;\r\n\r\n    // public\r\n    HWND hwnd;\r\n\r\n    // arbitrary data associated with this window\r\n    void *user;\r\n};\r\n\r\nWin32Window *AllocWin32Window(HWND parent, RECT *initialPosition);\r\nvoid InitWin32Window(Win32Window *, HWND parent, RECT *initialPosition);\r\nbool CreateWin32Window(Win32Window *, const WCHAR *title);\r\nvoid DeleteWin32Window(Win32Window *);\r\n"
  },
  {
    "path": "strings/last_uploaded.txt",
    "content": "AppTranslator strings\n&About\n&Actual Size\\tCtrl+1\n&Advanced Options...\n&All selected pages\n&Back\\tAlt+Left Arrow\n&Book View\\tCtrl+8\n&Close\\tCtrl+W\n&Copy Selection\n&Copy Selection\\tCtrl+C\n&Don't ask me again\n&Even pages only\n&Facing\\tCtrl+7\n&File\n&Find what:\n&First Page\\tHome\n&Fit pages to printable area\n&Go To\n&Go to page:\n&Help\n&Last Page\\tEnd\n&Magnification:\n&Manual\n&Match case\n&Next Page\\tRight Arrow\n&No\n&No, thanks\n&Odd pages only\n&Open Document\n&Open...\\tCtrl+O\n&Options\n&Options...\n&Password:\n&Pin Document\n&Previous Page\\tLeft Arrow\n&Print...\n&Print... (denied)\n&Print...\\tCtrl+P\n&Remember the password for this document\n&Remember these settings for each document\n&Remove Document\n&Save As...\n&Save As...\\tCtrl+S\n&Settings\n&Shrink pages to printable area (if necessary)\n&Single Page\\tCtrl+6\n&Skip this version\n&Use original page sizes\n&View\n&Window\n&Yes\n&Zoom\n(of %d)\n(page %s)\nAbout SumatraPDF\nAdd Favorite\nAdd page %s to favorites\nAdd page %s to favorites with (optional) name:\nAdd to favorites\nAdvanced\nAll files\nAll supported documents\nApplication:\nAre you sure you want to uninstall SumatraPDF?\nAssociate with PDF files?\nAttachment: %s\nAuthor:\nAutomatic\nAutomatically check for &updates\nBook View\nBook&marks\\tF12\nBookmark Shortcuts\nBookmark shortcut to page %s of %s\nBookmarks\nBytes\nCHM documents\nCan't connect to the Internet (error %#x).\nCancel\nCannot print this file\nCannot start inverse search command. Please check the command line in the settings.\nChange Language\nCheck for &Updates\nClose\nComic books\nCompatibility\nContinuous\nContinuous Book View\nContinuous Facing\nContribute Translation\nCopy &Image\nCopy &Link Address\nCopy Co&mment\nCopying text was denied (copying as image only)\nCopyright:\nCould not obtain Printer properties\nCouldn't create temporary directory\nCouldn't create the installation directory\nCouldn't initialize printer\nCouldn't install PDF previewer\nCouldn't install PDF search filter\nCouldn't obtain temporary directory\nCouldn't remove installation directory\nCouldn't remove the shortcut\nCouldn't render the page\nCouldn't uninstall PDF previewer\nCouldn't uninstall PDF search filter\nCouldn't uninstall browser plugin\nCouldn't write %s to disk\nCreated:\nCurrent file\nCursor position:\nCustom &Zoom...\\tCtrl+Y\nDefault &Layout:\nDefault &Zoom:\nDefault PDF reader can't be changed in portable mode\nDenied Permissions:\nDjVu documents\nDocument Properties\nDownload\nE&xit\\tCtrl+Q\nEPUB ebooks\nEnter password\nEnter password for %s\nEnter the command-line to invoke when you double-click on the PDF document:\nError loading %s\nF&avorites\nF&orward\\tAlt+Right Arrow\nF&ullscreen\\tF11\nFacing\nFailed to copy uninstaller to temp directory\nFailed to create a shortcut\nFailed to delete uninstaller registry keys\nFailed to register as default program on win 10\nFailed to rename the file!\nFailed to save a file\nFailed to write the extended file extension information to the registry\nFailed to write the uninstallation information to the registry\nFast Web View\nFavorites\nFictionBook documents\nFile %s not found\nFile Size:\nFile:\nFin&d...\\tCtrl+F\nFind\nFind Next\nFind Previous\nFind:\nFit &Content\\tCtrl+3\nFit &Page\\tCtrl+0\nFit &Width\\tCtrl+2\nFit Content\nFit Page\nFit Width\nFit Width and Show Pages Continuously\nFit a Single Page\nFonts:\nFormatting the book... %d pages\nFound text at page %s\nFound text at page %s (again)\nFrequently Read\nGB\nGo to page\nHide &Options\nHide frequently read\nHint: Use the F3 key for finding again\nImage files (*.%s)\nInstall SumatraPDF\nInstall SumatraPDF in &folder:\nInstallation failed!\nInstallation in progress...\nKB\nKeep the PDF &browser plugin installed (no longer supported)\nLet Windows Desktop Search &search PDF documents\nLet Windows show &previews of PDF documents\nMB\nMake SumatraPDF default application for PDF files?\nMake SumatraPDF my default PDF reader\nMan&ga Mode\nMatch Case\nMobi documents\nModified:\nNew version %s is available. Download new version?\nNext Page\nNo matches were found\nNo result found around line %u in file %s\nNo synchronization file found\nNo synchronization info at this position\nNumber of Pages:\nOK\nOpen\nOpen &in PDF-XChange\nOpen a document...\nOpen in %s\nOpen in &Adobe Reader\nOpen in &Foxit Reader\nOpen in &Microsoft HTML Help\nOpen in &Microsoft XPS-Viewer\nP&roperties\nP&roperties\\tCtrl+D\nPDF Document\nPDF Optimizations:\nPDF Producer:\nPDF Version:\nPDF documents\nPa&ge...\\tCtrl+G\nPage %s\nPage Size:\nPage number %u inexistant\nPage scaling\nPage:\nPalmDoc documents\nPlease close %s to proceed!\nPlease wait - rendering...\nPostscript documents\nPr&esentation\\tF5\nPrevious Page\nPrint\nPrint range\nPrinter with given name doesn't exist\nPrinting in progress.\nPrinting is still in progress. Abort and quit?\nPrinting is still in progress. Abort and start over?\nPrinting page %d of %d...\nPrinting problem.\nRe&name...\\tF2\nRemember &opened files\nRemove from favorites\nRemove page %s from favorites\nRename To\nRotate &Left\\tCtrl+Shift+-\nRotate &Right\\tCtrl+Shift++\nSave As\nSave S&hortcut...\\tCtrl+Shift+S\nSearching %d of %d...\nSelect &All\nSelect &All\\tCtrl+A\nSelect content with Ctrl+left mouse button\nSelect the folder where SumatraPDF should be installed:\nSelection:\nSend by &E-mail...\nSet inverse search command-line\nShow &Bookmarks\nShow &Pages Continuously\nShow &Toolbar\nShow Favorites\nShow frequently read\nShow the &bookmarks sidebar when available\nSingle Page\nSome files to be installed are damaged or missing\nSorry, that shouldn't have happened!\\n\\nPlease press 'Cancel', if you want to help us fix the cause of this crash.\nSource file %s has no synchronization point\nStart SumatraPDF\nSubject:\nSumatraPDF %s Installer\nSumatraPDF %s Uninstaller\nSumatraPDF Options\nSumatraPDF Update\nSumatraPDF crashed\nSumatraPDF has been uninstalled.\nSumatraPDF installation not found.\nSumatraPDF is your default PDF reader\nSumatraPDF should now be your default PDF reader\nSynchronization file cannot be opened\nTagged PDF\nText documents\nThank you for choosing SumatraPDF!\nThank you! SumatraPDF has been installed.\nThe installer has been corrupted. Please download it again.\\nSorry for the inconvenience!\nThis document uses unsupported features (%s) and might not render properly\nTitle:\nUninstall SumatraPDF\nUninstallation failed\nUninstallation in progress...\nUnknown source file (%s)\nUse &tabs\nUse SumatraPDF as the &default PDF reader\nView\nVisit &Website\nWarning\nXPS documents\nYou have the latest version.\nYou have version %s\nZoom\nZoom In\nZoom Out\nZoom factor\n[Changes detected; refreshing] %s\ncopying text\nprinting document"
  },
  {
    "path": "strings/translations.txt",
    "content": "AppTranslator: SumatraPDF\n3443f2b34d17a7d4f4de85892bc3ace63390424a\n:&About\naf:&Omtrent\nam:&Ծրագրի մասին\nar:حول& \naz:Proqram &haqqında\nbg:За &програмата\nbn:&আমাদের সম্পর্কে\nbr:S&obre\nbs:&O programu...\nby:Аб праграме\nca-xv:&Quant a...\nca:&Quant a...\ncn:关于(&A)...\ncy:&Ynghylch...\ncz:&O programu\nde:Über &SumatraPDF\ndk:&Om\nel:&Σχετικά\nes:&Acerca de\net:&Programmi teave\neu:&Honi buruz...\nfa:&درباره\nfi:&Tietoja\nfr:&À propos\nfy-nl:&Oer\nga:Maidir le\ngl:&Acerca de\nhe:אודות...\nhi:बारे में(&A)\nhr:&O programu...\nhu:Név&jegy\nid:&Tentang\nit:&Informazioni su...\nja:バージョン情報(&A)\njv:&Babagan\nka:&პროგრამის შესახებ...\nkr:정보(&A)\nku:دەربارەی&\nkw:&A-dro dhe...\nlt:Apie\nlv:&Par\nmk:&За SumatraPDF...\nml:പറ്റി\nmm:အကြောင်း\nmy:&Mengenai\nne:SumatraPDF &बारेमा\nnl:&Over\nnn:&Om\nno:&Om\npa:Sumatra ਬਾਰੇ(&A)\npl:&O SumatraPDF\npt:&Sobre\nro:&Despre\nru:&О программе...\nsi:&පිළීබඳව\nsk:&O programe...\nsl:&O programu\nsn:&Nezve...\nsp-rs:O programu\nsq:&Për\nsr-rs:О програму\nsv:&Om\nta:பற்றி\nth:เกี่ยวกับ\ntl:Tungkol S&a...\ntr:&Hakkında\ntw:關於(&A)...\nuk:Про програму...\nuz:&Dastur haqida\nvn:Giới thiệu\n:&Actual Size\\tCtrl+1\naf:&Gewone Grootte\\tCtrl+1\nam:Իրական &չափը\\tCtrl+1\nar:الحجم &الحقيقي\\tCtrl+1\naz:&Həqiqi ölçü\\tCtrl+1\nbg:&Оригинален (реален) размер\\tCtrl+1\nbn:বাস্তবিক আকার\\tCtrl+1\nbr:&Tamanho real\\tCtrl+1\nbs:Stvarna veličina\\tCtrl+1\nby:Рэальны памер\\tCtrl+1\nca-xv:Mida &real\\tCtrl+1\nca:Mida &real\\tCtrl+1\ncn:实际大小(&A)\\tCtrl+1\ncy:&Gwir Faint\\tCtrl+1\ncz:Skutečná &velikost\\tCtrl+1\nde:&Tatsächliche Größe\\tStrg+1\ndk:&Faktisk størrelse\\tCtrl+1\nel:Πραγματικό &μέγεθος\\tCtrl+1\nes:T&amaño real\\tCtrl+1\net:&Tegelik suurus\\tCtrl+1\neu:&Oraingo Neurria\\tKtrl+1\nfa:&اندازه واقعی\\tCtrl+1\nfi:&Todellinen koko\\tCtrl+1\nfr:&Taille réelle\\tCtrl+1\nfy-nl:Wiere grutte\\tCtrl+1\nga:&Fíormhéid\\tCtrl+1\ngl:&Tamaño actual\\tCtrl+1\nhe:גודל מקורי\\tCtrl+1\nhi:वास्तविक आकार(&A)\\tCtrl+1\nhr:Stvarna veličina\\tCtrl+1\nhu:&Tényleges méret\\tCtrl+1\nid:&Ukuran Sebenarnya\\tCtrl+1\nit:&Dimensioni reali\\t<Ctrl>+1\nja:実際のサイズ(&A)\\tCtrl+1\njv:&Ukuran Nyata\\tCtrl+1\nka:&თავდაპირველი ზომა\\tCtrl+1\nkr:실제 크기(&A)\\tCtrl+1\nku:قەبارەی ڕاستەقینە &\\tCtrl+1\nkw:&Braster gwir\\tCtrl+1\nlt:&Originalus\\tCtrl+1\nlv:&Patiesais lielums\\tCtrl+1\nmk:&Реална големина\\tCtrl+1\nml:ശരിയായ വലിപ്പം\\tCtrl+1\nmm:ပုံမှန် အရွယ်\\tCtrl+1\nmy:&Saiz sebenar\\tCtrl+1\nne:&सही आकार\\tCtrl+1\nnl:&Ware grootte\\tCtrl+1\nnn:F&aktisk storleik\\tCtrl+1\nno:Fak&tisk størrelse\\tCtrl+1\npa:ਸਹੀ ਅਕਾਰ(&u)\\tCtrl+1\npl:&Rozmiar rzeczywisty\\tCtrl+1\npt:&Tamanho real\\tCtrl+1\nro:Mărime &efectivă\\tCtrl+1\nru:&Настоящий размер\\tCtrl+1\nsi:&නියමිත ප්‍රමාණය\\tCtrl+1\nsk:&Skutočná veľkosť\\tCtrl+1\nsl:&Dejanska velikost\\tCtrl+1\nsn:Saizi chaiyo\\tCtrl+1\nsp-rs:Stvarna veličina\\tCtrl+1\nsq:Përmasa &reale\\tCtrl+1\nsr-rs:Стварна величина\\tCtrl+1\nsv:&Verklig storlek\\tCtrl+1\nta:மெய் அளவு\\tCtrl+1\nth:ขนาดจริง\\tCtrl+1\ntl:Tunay na Laki\\tCtrl+1\ntr:Gerçek &Boyut\\tCtrl+1\ntw:實際大小(&A)\\tCtrl+1\nuk:Справжній розмір\\tCtrl+1\nuz:&Haqiqiy o'lchami\\tCtrl+1\nvn:Kích thướ&c thật\\tCtrl+1\n:&Advanced Options...\nam:&Ընդլայնված կարգավորումներ..\nar:خيارات &متقدمة\naz:&Əlavə seçimlər...\nbg:Разширени опции\nbr:Opções &Avançadas...\nbs:N&apredne opcije...\nca-xv:Opcions &avançades...\nca:Opcions &avançades...\ncn:高级选项(&A)...\ncy:Dewisiadau &Uwch...\ncz:&Pokročilé možnosti...\nde:&Mehr Optionen…\ndk:&Avancerede valgmuligheder\nel:&Επιλογές για προχωρημένους\nes:Opciones &avanzadas...\net:&Rohkem sätteid...\neu:Au&kera aurreratuak...\nfa:تنظیمات پیشرفته\nfi:&Lisäasetukset...\nfr:Options &avancées…\nga:&Ardroghanna...\ngl:Opcións &avanzadas...\nhe:הגדרות מתקדמות...\nhr:N&apredne mogućnosti\nhu:Speciális beállítások...\nid:&Pengaturan Lanjutan...\nit:Opzioni &avanzate...\nja:詳細設定(&A)\njv:&Pilihan Terusan...\nkr:고급 옵션(&A)...\nku:هەڵبژاردنی پەرەسەندوو ...&\nlv:&Papildu opcijas...\nmk:&Напредни oпции...\nmy:&Tetapan terperinci...\nnl:&Geavanceerde Opties...\nnn:&Avanserte innstillingar\nno:&Avanserte innstillinger\npl:Opcje zaawansowane...\npt:Opções &avançadas...\nro:Opțiuni &avansate...\nru:&Расширенные настройки...\nsk:&Rozšírené možnosti...\nsl:N&apredne možnosti …\nsp-rs:Napredna podešavanja...\nsq:Opsionet e &avancuara...\nsr-rs:Напредне опције\nsv:&Avancerade Inställningar\nta:&மேம்பட்ட விருப்பங்கள்\nth:yyyy\ntr:Gelişmiş Ayarlar\ntw:進階選項(&A)...\nuk:Розширені налаштування...\nuz:&Qo'shimcha parametrlar...\nvn:Tùy chọn &nâng cao...\n:&All selected pages\nam:&Ընտրված բոլոր էջերը\nar:كل الصفحات المحددة&\naz:&Bütün seçilmiş səhifələr\nbg:&Всички избрани страници\nbn:&নির্বাচিত পৃষ্ঠাসমূহ\nbr:Tod&as as páginas selecionadas\nbs:Sve označene str&anice\nca-xv:&Totes les pàgines seleccionades\nca:&Totes les pàgines seleccionades\ncn:所有已选定页面(&A)\ncy:&Pob tudalen â ddewiswyd\ncz:Vše&chny vybrané stránky\nde:&Alle angegebenen Seiten\ndk:&Alle valgte sider\nel:Ό&λες οι επιλεγμένες\nes:Tod&as las páginas seleccionadas\net:Kõik v&alitud lehed\neu:&Hautatutako orrialde guztiak\nfa:&همه‌ی صفحات انتخاب ‌شده\nfi:K&aikki valitut sivut\nfr:&Toutes les pages sélectionnées\nga:&Gach leathanach roghnaithe\ngl:&Todas as páxinas seleccionadas\nhe:כל העמודים הנבחרים\nhi:&सभी चयनित पृष्ठों\nhr:Sve obilježene str&anice\nhu:Az összes kiválasztott oldal\nid:&Semua halaman yang dipilih\nit:&Tutte le pagine selezionate\nja:すべての選択されたページ(&A)\njv:&Kabeh kaca sing kapilih\nka:&ყველა მონიშნული გვერდი\nkr:선택한 모든 페이지(&A)\nku:هەموو پەڕە دیاریکراوەکان&\nlt:&Visi pažymėti puslapiai\nlv:&Visas atlasītās lappuses\nmk:&Сите означени страници\nml:&തിരഞ്ഞെടുത്ത താളുകളെല്ലാം\nmy:&Semua mukasurat pilihan\nne:चयन गरिएका &सबै पृष्ठहरु\nnl:&Alle geselecteerde pagina's\nnn:&Alle valde sider\nno:&Alle valgte sider\npl:&Zaznaczone strony\npt:&Todas as páginas selecionadas\nro:Toate paginile selectate\nru:&Все выбранные страницы\nsi:&සියලු තේරූ පිටු\nsk:&Tlačiť všetky strany\nsl:&Vse izbrane strani\nsp-rs:Sve izabrane stranice\nsq:&Gjithë faqet e përzgjedhura\nsr-rs:Све изабране странице\nsv:&Alla valda sidor\nta:எல்லா தேர்ந்தெடுத்த பக்கங்களும்\nth:หน้าที่เลือกทั้งหมด\ntl:&Lahat ng napiling pahina\ntr:Tüm seçilen &sayfalar\ntw:所有已選取頁面(&A)\nuk:Обрано всі сторінки\nuz:&Hamma tanlangan betlar\nvn:Tất cả các tr&ang được chọn\n:&Back\\tAlt+Left Arrow\nam:&Նախորդը\\tAlt+Left Arrow\nar:للخلف&\\tAlt+Left Arrow\naz:&Geri\\tAlt+Left Arrow\nbg:На&зад\\tAlt+Лява стрелка\nbr:Voltar\\tAlt+<-\nbs:Nazad\\tAlt+<-\nca-xv:Arrere\\tAlt+Left Arrow\nca:Enrere\\tAlt+Left Arrow\ncn:上一页(&B)\\tAlt+左箭头\ncy:Nôl\\tAlt+Saeth Chwith\ncz:Z&pět\\tAlt+Šipka vlevo\nde:&Zurück\\tAlt+<-\ndk:&Tilbage\\tAlt+venstre pil\nel:&Πίσω\\tAlt+<-\nes:A&trás\\tAlt+Izq\net:&Tagasi\\tAlt+Vasaknool\neu:A&tzera\\tAlt+Ezker Gezia\nfa:جای &قبلی\\tAlt+←‎\nfi:&Takaisin\\tAlt+Vasen nuoli\nfr:&Retour\\tAlt+<-\nfy-nl:Tebek\\tAlt+<-\nga:&Siar\\tAlt+Saighead Ar Clé\ngl:&Atrás\\tAlt+Frecha esquerda\nhe:מקטע קודם\\tחץ שמאלי + Alt\nhi:&वापस\\t Alt+बायाँ तीर\nhr:Natrag\\tAlt+<-\nhu:Ugrás vissza\\tAlt+<-\nid:Kembali\\tAlt+<-\nit:&Indietro\\t<Alt>+<Freccia sinistra>\nja:前に戻る(&B)\\tAlt+←\njv:&Mbalik\\tAlt+Arah Kiri\nka:&უკან\\tAlt+მარცხენა ისარი\nkr:이전에 본 페이지(&B)\\tAlt+왼쪽 방향키\nku:&گەڕانەوە\\tAlt+Left Arrow\nkw:War-lergh\\tAlt+<-\nlt:At&gal\\tAlt+Kairėn\nlv:&Atpakaļ\\tAlt+Kreisā bultiņa\nmk:Назад\\tAlt+Left Arrow\nmy:&Kembali\\tAlt+Left Arrow\nne:&पछाडि\\tAlt+बायाँ बाण\nnl:Terug\\tAlt+<-\nnn:&Tilbake\\tAlt+Venstretast\nno:Tilbake\\tAlt+←\npl:&Wstecz\\tAlt+W lewo\npt:V&oltar\\tAlt + <-\nro:Înapoi\\tAlt+<-\nru:&Назад\\tAlt+Стрелка влево\nsi:&පසුපසට\\tAlt+Left Arrow\nsk:&Naspäť\\tAlt+Left Arrow\nsl:&Nazaj\\tAlt+Leva puščica\nsp-rs:Nazad\\tAlt+<-\nsq:&Prapa\\tAlt+Left Arrow\nsr-rs:Назад\\tAlt+<-\nsv:Tillbaka\\tAlt+Pil vänster\nta:பின்\\tAlt+Left Arrow\nth:ถอยกลับ\\tAlt+Left Arrow\ntl:Bumalik\\tAlt+Left Arrow\ntr:&Geri\\tAlt+Sol Ok\ntw:上一頁(&B)\\tAlt+左箭頭\nuk:Назад\\tAlt+Ліва стрілка\nuz:&Orqaga\\tAlt+<-\nvn:Trở về\\tAlt+Mũi tên trái\n:&Book View\\tCtrl+8\nam:&Գրքի տեսքով\\tCtrl+8\nar:عرض &الكتاب\naz:&Kitab formatı\\tCtrl+8\nbg:&Изглед като книга\\tCtrl+8\nbr:Visualizar como livro\\tCtrl+8\nbs:&Knjiški pregled\\tCtrl+8\nca-xv:Visualització de &llibre\\tCtrl+8\nca:Visualització de &llibre\\tCtrl+8\ncn:书籍视图(&B)\\tCtrl+8\ncy:Golwg &Llyfr\\tCtrl+8\ncz:K&niha\\tCtrl+8\nde:&Buchansicht\\tStrg+8\ndk:&Bogvisning\\tCtrl+8\nel:&Προβολή βιβλίου\\tCtrl+8\nes:&Vista de libro\\tCtrl+8\net:&Raamatuvaade\\tCtrl+8\neu:&Liburu Ikuspegia\\tKtrl+8\nfa:&کتابی\\tCtrl+8\nfi:&Kirjanäkymä\\tCtrl+8\nfr:Comme un livre\\tCtrl+8\nga:&Leabhar-amharc\\tCtrl+8\ngl:Vista de &libro\\tCtrl+8\nhe:תצוגת ספר\\tCtrl+8\nhi:&पुस्तक के रुप में देखें\\tCtrl+8\nhr:&Knjiški pregled\\tCtrl+8\nhu:&Könyv-mód (oldalpár címlappal)\\tCtrl+8\nid:Tampilan &Buku\\tCtrl+8\nit:Vista &libro\\t<Ctrl>+8\nja:ブック ビュー&(B)\\tCtrl+B\njv:&Tampilan Buku\\tCtrl+8\nka:&წიგნის რეჟიმი\\tCtrl+8\nkr:책처럼 보기(&B)\\tCtrl+8\nku:شێوازی پەرتووک&\\tCtrl+8\nlt:Knyga\\tCtrl+8\nlv:&Grāmatas skats\\tCtrl+8\nmk:Книга\\tCtrl+8\nmy:Lihat &buku\\tCtrl+8\nne:&पुस्तिका दृश्य\\tCtrl+8\nnl:&Boekweergave\\tCtrl+8\nnn:&Bokvising\\tCtrl+8\nno:&Bokvisning\\tCtrl+8\npl:Widok o&dczytu\\tCtrl+8\npt:Como li&vro\\tCtrl+8\nro:Format carte\\tCtrl+8\nru:В &разворот\\tCtrl+8\nsk:&Kniha\\tCtrl+8\nsl:Knjižni pogled\\tCtrl+8\nsp-rs:Izgled knjige\\tCtrl+8\nsq:&Libër\\tCtrl+8\nsr-rs:Изглед књиге\\tCtrl+8\nsv:&Bokvy\\tCtrl+8\nta:&புத்தக தோற்றம்\\tCtrl+8\nth:แสดงแบบหนังสือ\\tCtrl+8\ntr:&Kitap Görünümü\ntw:書本檢視(&B)\\tCtrl+8\nuk:Книжна розгортка\\tCtrl+8\nuz:&Kitob ko'rinishi\\tCtrl+8\nvn:Xem dạng sách\\tCtrl+8\n:&Close\\tCtrl+W\naf:Maak Toe\\tCtrl+W\nam:&Փակել\\tCtrl+W\nar:&اغلاق\\tCtrl+W\naz:&Bağla\\tCtrl+W\nbg:&Затвори\\tCtrl+W\nbn:&বন্ধ\\tCtrl+W\nbr:&Fechar\\tCtrl+W\nbs:&Zatvori\\tCtrl+W\nby:Зачыніць\\tCtrl+W\nca-xv:&Tanca\\tCtrl+W\nca:&Tanca\\tCtrl+W\ncn:关闭(&C)\\tCtrl+W\ncy:&Cau\\tCtrl+W\ncz:&Zavřít\\tCtrl+W\nde:&Schließen\\tStrg+W\ndk:&Luk\\tCtrl+W\nel:&Κλείσιμο\\tCtrl+W\nes:&Cerrar\\tCtrl+W\net:&Sulge\\tCtrl+W\neu:It&xi\\tKtrl+W\nfa:ب&ستن\\tCtrl+W\nfi:&Sulje\\tCtrl+W\nfr:&Fermer\\tCtrl+W\nfy-nl:&Ofslute\\tCtrl+W\nga:&Dún\\tCtrl+W\ngl:&Pechar\\tCtrl+W\nhe:סגור\\tCtrl+W\nhi:बंद करें(&C)\\tCtrl+W\nhr:&Zatvori\\tCtrl+W\nhu:Be&zárás\\tCtrl+W\nid:&Tutup\\tCtrl+W\nit:&Chiudi\\tCtrl+W\nja:閉じる(&C)\\tCtrl+W\njv:&Cerrar\\tCtrl+W\nka:&დახურვა\\tCtrl+W\nkr:닫기(&C)\\tCtrl+W\nku:داخستن&\\tCtrl+W\nkw:&Degea\\tCtrl+W\nlt:&Užverti\\tCtrl+W\nlv:&Aizvērt\\tCtrl+W\nmk:&Затвори\\tCtrl+W\nml:അടയ്ക്കുക\\tCtrl+W\nmm:&ပိတ်ပါ\\tCtrl+W\nmy:&Tutup\\tCtrl+W\nne:&बन्द गर्नुहोस्\\tCtrl+W\nnl:&Sluiten\\tCtrl+W\nnn:&Lukk\\tCtrl+W\nno:&Lukk\\tCtrl+W\npa:ਬੰਦ ਕਰੋ(&C)\\tCtrl+W\npl:&Zamknij\\tCtrl+W\npt:&Fechar\\tCtrl+W\nro:Înc&hidere\\tCtrl+W\nru:&Закрыть\\tCtrl+W\nsi:&වසන්න\\tCtrl+W\nsk:&Zatvoriť\\tCtrl+W\nsl:&Zapri\\tCtrl+W\nsn:&Vhara\\tCtrl+0\nsp-rs:Zatvori\\tCtrl+W\nsq:&Mbyll\\tCtrl+W\nsr-rs:Затвори\\tCtrl+W\nsv:&Stäng\\tCtrl+W\nta:மூடு\\tCtrl+W\nth:ปิด\\tCtrl+W\ntl:Isara\\tCtrl+W\ntr:&Kapat\\tCtrl+W\ntw:關閉(&C)\\tCtrl+W\nuk:&Закрити\\tCtrl+W\nuz:&Yopish\\tCtrl+W\nvn:Đóng tập tin\\tCtrl+W\n:&Copy Selection\nam:&Պատճենել նշվածը\nar:نسخ المحدد&\naz:Seçilmiş sahəni &kopyala\nbg:&Копиране на избраното\nbn:&নির্বাচিত অংশ কপি করুন\nbr:&Copiar Seleção\nbs:&Kopiraj označeno\nca-xv:&Copia la selecció\nca:&Copia la selecció\ncn:复制选定范围(&C)\ncy:Copïo &Dewis\ncz:&Kopírovat výběr\nde:Auswahl &kopieren\ndk:&Kopier markering\nel:&Αντιγραφή επιλογής\nes:&Copiar selección\net:K&opeeri valik\neu:&Kopiatu Hautapena\nfa:&رونوشت از قسمت انتخاب شده\nfi:Kopioi &valinta\nfr:&Copier la sélection\nga:&Macasamhlaigh an Roghnúchán\ngl:&Copiar a selección\nhe:העתק בחירה\nhi:च&यनित का नक़ल करें\nhr:&Kopiraj obilježeno\nhu:Kijelölés &másolása\nid:&Salin Seleksi\nit:&Copia selezione\nja:選択範囲をコピー(&C)\nka:მონიშნულის &კოპირება\nkr:선택한 부분 복사(&C)\nku:لەبەرگرتنەوەی دیاریکراو&\nlt:&Kopijuoti pažymėtą sritį\nlv:&Kopēt atlasi\nmk:&Копирај селекција\nmy:&Salin Pilihan\nne:चयनको प्रति&लिपि बनाउनुहोस्\nnl:Selectie kopiëren\nnn:&Kopier utval\nno:&Kopier valgt område\npl:Kopiuj &zaznaczenie\npt:&Copiar seleção\nro:&Copiază selecția\nru:С&копировать выделенное\nsi:ලකුනුකල ‌කොටස ‌කොපිකරන්න\nsk:&Kopírovať vybrané\nsl:Kopiraj izbor\nsp-rs:Kopiraj izabrano\nsq:&Kopjoj materialin\nsr-rs:Копирај изабрано\nsv:&Kopiera markering\nta:தேர்ந்தெடுத்தவற்றை நகலெடு\nth:คัดลอกตัวเลือก\ntl:Kopyahin ang napili\ntr:Seçimi &Kopyala\ntw:複製選取範圍(&C)\nuk:Скопіювати вибране\nuz:&Tanlanganni nusxa olish\nvn:&Chép phần đã chọn\n:&Copy Selection\\tCtrl+C\nam:Պատճենել նշվածը\\tCtrl+C\nar:نسخ المحدد&\\tCtrl+C\naz:Seçilmiş &sahəni kopyala\\tCtrl+C\nbg:&Копиране на избраното\\tCtrl+C\nbr:Copiar seleção\\tCtrl+C\nbs:Kopiraj označeno\\tCtrl+C\nca-xv:&Copia la selecció\\tCtrl+C\nca:&Copia la selecció\\tCtrl+C\ncn:复制选定范围(&C)\\tCtrl+C\ncy:Copïo'r Dewis\\tCtrl+C\ncz:&Kopírovat výběr\\tCtrl+C\nde:Auswahl &kopieren\\tStrg+C\ndk:&Kopier markering\\tCtrl+C\nel:Αντιγραφή επι&λεγμένων\\tCtrl+C\nes:&Copiar selección\\tCtrl+C\net:K&opeeri valik\\tCtrl+C\neu:&Kopiatu Hautapena\\tKtrl+C\nfa:&رونوشت از قسمت انتخاب شده\\tCtrl+C\nfi:Ko&pioi valinta\\tCtrl+C\nfr:&Copier la sélection\nfy-nl:Kopiearje seleksje\\tCtrl+C\nga:&Macasamhlaigh an Roghnúchán\\tCtrl+C\ngl:&Copiar selección\\tCtrl+C\nhe:העתק בחירה\\tCtrl+C\nhi:च&यनित का नक़ल करें\\tCtrl+C\nhr:Kopiraj odabir\\tCtrl+C\nhu:Kijelölés másolása\\tCtrl+C\nid:Salin Hasil Seleksi\\tCtrl+C\nit:&Copia selezione\\t<Ctrl>+C\nja:選択範囲のコピー(&C)\\tCtrl+C\nka:მონიშნულის &კოპირება\\tCtrl+C\nkr:선택한 부분 복사(&C)\\tCtrl+C\nku:لەبەرگرتنەوەی دیاریکراو&\\tCtrl+C\nkw:Dasskrifa Dewis\\tCtrl+C\nlt:&Kopijuoti pažymėtą sritį\\tCtrl+C\nlv:&Kopēt atlasi\\tCtrl+C\nmk:Копирај селекција\\tCtrl+C\nmy:&Salin pilihan\\tCtrl+C\nne:चयनको प्रति&लिपि बनाउनुहोस्\\tCtrl+C\nnl:Kopieer selectie\\tCtrl+C\nnn:&Kopier utval\\tCtrl+C\nno:Kopier merket tekst\\tCtrl+C\npl:Kopiuj &zaznaczenie\\tCtrl+C\npt:&Copiar seleção\\tCtrl+C\nro:&Copiere selecție\\tCtrl+C\nru:С&копировать выделенное\\tCtrl+C\nsi:තේරූ සියල්ල &පිටපත්කරන්න\\tCtrl+C\nsk:&Kopírovať vybrané\\tCtrl+C\nsl:Kopiraj izbor\\tCtrl+C\nsp-rs:Kopiraj izabrano\nsq:&Kopjoj materialin\\tCtrl+C\nsr-rs:Копирај изабрано\nsv:Kopiera markering\\tCtrl+C\nta:தேர்வுசெய்ததை நகல் செய்\nth:คัดลอกตัวเลือก\\tCtrl+C\ntl:&Kopyahin ang Napili\\tCtrl+C\ntr:Seçileni &kopyala\\tCtrl+C\ntw:複製選取範圍(&C)\\tCtrl+C\nuk:Скопіювати вибране\\tCtrl+C\nuz:&Tanlanganni nusxa olish\\tCtrl+C\nvn:&Chép phần đã chọn\\tCtrl+C\n:&Don't ask me again\naf:Moet My Nie Weer Vra Nie\nam:&Այլևս չհարցնել\nar:لا تسألني مرةً أخرى&\naz:Bir daha &soruşma\nbg:Без повтор&но питане\nbn:&আমাকে আর জিজ্ঞেস করবেন না\nbr:Não perguntar novamente\nbs:Nemoj me ponovo pitati\nby:Больш не пытаць\nca-xv:&No ho tornes a preguntar\nca:&No ho tornis a preguntar\ncn:不要再问我(&D)\ncy:&Peidio gofyn eto\ncz:&Příště se již neptat\nde:Nicht &wieder fragen.\ndk:&Spørg mig ikke igen\nel:&Να μην ερωτηθώ ξανά\nes:&No volver a preguntar\net:Ä&ra küsi uuesti\neu:&Ez galdetu berriro\nfa:&دوباره از من نپرس\nfi:Ä&lä kysy uudestaan\nfr:&Ne plus me demander\nfy-nl:Net mear freegje\nga:&Ná fiafraigh dom arís\ngl:Non preguntar de novo\nhe:אל תציג הודעה זו שוב\nhi:फिर मत पूछिए\nhr:Ubuduće nemoj pitati\nhu:Ne kérdezze meg többé\nid:&Jangan ulangi pertanyaan ini\nit:Non chie&dermelo più\nja:再び質問しない(&D)\nka:&აღარ შემეკითხო\nkr:다시는 묻지 않기(&D)\nku:دووبارە پرسیار مەکەرەوە&\nkw:&Na wovyn orthiv arta\nlt:&Daugiau nebeklausti\nlv:&Vairs nejautāt\nmk:Не ме прашувај повторно\nmm:ထပ်မမေးပါနှင့်။\nmy:&Jangan tanya saya lagi\nne:मलाई पुनः &नसोध्नुहोस्\nnl:Niet opnieuw vragen\nnn:Ikkje spør meg igjen\nno:&Ikke spør meg igjen\npa:ਮੈਥੌਂ ਮੁੜ ਨਾ ਪੁਛੋ\npl:&Nie pytaj więcej\npt:&Não perguntar novamente\nro:Nu mă întreba din nou\nru:&Больше не спрашивать\nsi:යළි විමසන්න &එපා\nsk:&Nepýtať sa znova\nsl:&Ne sprašuj me več\nsn:Usandivhunze futi\nsp-rs:Ne pitaj me ponovo\nsq:&Mos pyet më\nsr-rs:Не питај ме поново\nsv:Fråga inte igen\nta:மரு படியும் கேட்காதே\nth:ไม่ต้องถามอีกครั้ง\ntl:Huwag na akong tanunging muli\ntr:Tekrar &sorma\ntw:不要再問我(&D)\nuk:Не питати знову\nuz:&Boshqa so'ralmasin\nvn:Không hỏi lại\n:&Even pages only\nam:&Միայն զույգ էջերը\nar:الصفحات &الزوجية فقط\naz:Yalnız &cüt səhifələr\nbg:Само &четни страници\nbr:Apenas as páginas par&es\nbs:Samo &parne stranice\nca-xv:Només les pàgines parelles\nca:Només les pàgines parelles\ncn:仅偶数页(&E)\ncy:Tudalennau &eilrif yn unig\ncz:Pouz&e sudé stránky\nde:Nur &gerade Seiten\ndk:&Kun lige sider\nel:&Μόνο οι ζυγές σελίδες\nes:&Sólo páginas pares\net:Vaid paa&risleheküljed\neu:&Orrialde bakoitiak bakarrik\nfa:فقط صفحات &زوج\nfi:Vain pa&rilliset sivut\nfr:Seulement les pages &paires\nga:&Leathanaigh cothromacha amháin\ngl:&Páxinas pares só\nhe:עמודים זוגיים בלבד\nhi:&सम पृष्ठ केवल​\nhr:Samo &parne stranice\nhu:Csak a páros oldalak\nid:&Hanya halaman genap\nit:Solo pagin&e pari\nja:偶数ページのみ(&E)\nka:მხოლოდ &ლუწი გვერდები\nkr:짝수 페이지만(&E)\nku:تەنها پەڕە جووتەکان&\nlt:Tik &lyginiai puslapiai\nlv:Tikai &pāra lappuses\nmk:Само &парни страници\nmy:&Mukasurat genap sahaja\nne:&जोर पृष्ठ मात्र\nnl:Alleen &Even pagina's\nnn:&Kun partalssider\nno:Bare &partallssider\npl:Strony &parzyste\npt:Só páginas &pares\nro:Doar paginile pare\nru:Только ч&ётные страницы\nsi:&ඉරට්ටෙ පිටු පමණි\nsk:&Tlačiť iba párne strany\nsl:Samo &parne strani\nsp-rs:Samo lica stranica\nsq:Vetëm faqet &çift\nsr-rs:Само лица страница\nsv:Endast &jämna sidor\nta:இரட்டைபடை எண்கள்  மட்டும்\ntl:Mga &even na pahina lamang\ntr:Sadece &çift sayfalar\ntw:祇有偶數頁(&E)\nuk:Тільки парні сторінки\nuz:&Faqat juft betlar\nvn:Chỉ những trang lẻ\n:&Facing\\tCtrl+7\nam:&Երկու էջով\\tCtrl+7\nar:متقابلتان&\\tCtrl+7\naz:&Cüt səhifələr\\tCtrl+7\nbg:&Срещуположни страници\\tCtrl+7\nbr:Página dupla\\tCtrl+7\nbs:&Dvije stranice\\tCtrl+7\nca-xv:Pàgina &doble\\tCtrl+7\nca:Pàgina &doble\\tCtrl+7\ncn:双页模式(&F)\\tCtrl+7\ncy:&Gwynebu\\tCtrl+7\ncz:&Dvojstránky\\tCtrl+7\nde:&Doppelseite\\tStrg+7\ndk:&Modstående\\tCtrl+7\nel:&Αντικριστές σελίδες\\tCtrl+7\nes:&Caras opuestas\\tCtrl+7\net:&Kaheleheküljeline\\tCtrl+7\neu:&Bi Aldeetatik\\tKtrl+7\nfa:&دوصفحه‌ای\\tCtrl+7\nfi:&Rinnakkain\\tCtrl+7\nfr:Double page\\tCtrl+7\nga:&Dhá Leathanach\\tCtrl+7\ngl:&Dúas páxinas\\tCtrl+7\nhe:עמוד לצד עמוד\\tCtrl+7\nhi:&समतल करना\\tCtrl+7\nhr:&Dvije stranice\\tCtrl+7\nhu:&Oldalpár\\tCtrl+7\nid:Meng&hadap\\tCtrl+7\nit:Pagine &affiancate\\t<Ctrl>+7\nja:見返し表示(&F)\\tCtrl+7\nka:&ურთიერთ-საპირისპიროდ\\tCtrl+7\nkr:두 페이지씩(&F)\\tCtrl+7\nku:&ڕووکار\\tCtrl+7\nlt:&Du puslapiai\\tCtrl+7\nlv:&Divas lappuses\\tCtrl+7\nmk:Две страници\\tCtrl+7\nmy:&Menghadap\\tCtrl+7\nne:&सम्मुख\\tCtrl+7\nnl:&Dubbele pagina\\tCtrl+7\nnn:&Fleire sider\\tCtrl+7\nno:&Flere sider\\tCtrl+7\npl:&Wiele stron\\tCtrl+7\npt:D&uas páginas\\tCtrl+7\nro:Două pagini\\tCtrl+7\nru:По &две страницы\\tCtrl+7\nsk:&Dve strany\\tCtrl+7\nsl:Dvostransko\\tCtrl+7\nsp-rs:Naspramno\\tCtrl+7\nsq:&Përbri\\tCtrl+7\nsr-rs:Наспрамно\\tCtrl+7\nsv:&Sida vid sida\\tCtrl+7\nta:பார்வையில்\\tCtrl+7\ntr:Çift sayfa\\tCtrl+7\ntw:雙頁模式(&F)\nuk:Дві сторінки\\tCtrl+7\nuz:&Ikkita betdan\\tCtrl+7\nvn:Trang kép\\tCtrl+7\n:&File\naf:&Lêer\nam:&Ֆայլ\nar:ملف&\naz:&Fayl\nbg:&Файл\nbn:&সঞ্চিকা\nbr:&Arquivo\nbs:&Fajl\nby:Файл\nca-xv:&Fitxer\nca:&Fitxer\ncn:文件(&F)\ncy:&Ffeil\ncz:&Soubor\nde:&Datei\ndk:&Fil\nel:&Αρχείο\nes:&Archivo\net:&Fail\neu:&Agiria\nfa:&پرونده\nfi:&Tiedosto\nfr:&Fichier\nfy-nl:&Bestân\nga:&Comhad\ngl:&Ficheiro\nhe:&קובץ\nhi:फाईल(&F)\nhr:&Datoteka\nhu:&Fájl\nid:&Berkas\nit:&File\nja:ファイル(&F)\nka:&ფაილი\nkr:파일(&F)\nku:فایل&\nkw:&Restren\nlt:&Failas\nlv:&Fails\nmk:&Датотека\nml:ഫയല്‍\nmm:&ဖိုင်\nmy:&Fail\nne:&फाइल\nnl:&Bestand\nnn:&Fil\nno:&Fil\npa:ਫਾਇਲ(&F)\npl:&Plik\npt:&Ficheiro\nro:&Fișier\nru:&Файл\nsi:&ගොනුව\nsk:&Súbor\nsl:&Datoteka\nsn:&Faira\nsp-rs:Datoteka\nsq:&Skedar\nsr-rs:Датотека\nsv:&Arkiv\nta:கோப்பு\nth:แฟ้ม\ntl:&File\ntr:&Dosya\ntw:檔案(&F)\nuk:&Файл\nuz:&Fayl\nvn:Tập tin\n:&Find what:\nam:&Ինչ գտնել.\nar:ابحث عن&:\naz:&Axtarılan sətir:\nbg:&Търсене на:\nbr:&Localizar o quê:\nbs:&Traži:\nby:&Узор:\nca-xv:&Cerca el texta:\nca:&Cerca el text:\ncn:查找(&F):\ncy:&Canfod beth:\ncz:&Najít:\nde:&Suchen nach:\ndk:&Find hvad:\nel:&Εύρεση του:\nes:&Encontrar:\net:&Otsitav:\neu:&Bilatu hau:\nfa:&جستجو برای:\nfi:&Etsittävä:\nfr:&Rechercher quoi :\nfy-nl:&Sykje nei:\nga:&Aimsigh céard:\ngl:&Atopar que:\nhe:חפש:\nhi:क्या ढूँढ़ें:(&F)\nhr:&Što tražiti:\nhu:Mit keres:\nid:&Cari:\nit:&Ricerca:\nja:検索する文字列(&F):\nka:პო&ვნა:\nkr:찾기(&F):\nku:دۆزینەوەی&:\nkw:&Kavos pyth:\nlt:&Surasti\nlv:&Ko atrast:\nmk:&Најди што:\nml:എന്തു തിരയണം\nmy:&carian:\nne:के फेला पार्ने:\nnl:&Zoek naar:\nnn:&Finn hvilke:\nno:&Søk etter:\npl:&Szukaj:\npt:&Localizar:\nro:Caută text:\nru:На&йти:\nsi:&සොයන්නෙ කුමක්ද:\nsk:&Vyhľadať:\nsl:&Najdi:\nsp-rs:Pojam:\nsq:&Gjej çfarë:\nsr-rs:Појам:\nsv:&Sök efter:\nta:எதை தேடவும்\ntl:Hanapin ang:\ntr:&Bulunacak olan:\ntw:尋找(&F):\nuk:Що шукати:\nuz:&Qidirish:\nvn:Tìm (các) từ sau:\n:&First Page\\tHome\naf:Eerste Bladsy\\tHome\nam:Առաջին էջը\\tHome\nar:الصفحة &الأولى\\tHome\naz:&Birinci səhifə\\tHome\nbg:&Начална страница\\tHome\nbn:প্রথম পৃষ্ঠা\\tHome\nbr:Primeira página\\tHome\nbs:Prva stranica\\tHome\nby:Першая старонка\\tHome\nca-xv:&Primera pàgina\\tInici\nca:&Primera pàgina\\tInici\ncn:第一页(&F)\\tHome\ncy:Tudalen Gyntaf\\tHome\ncz:První &stránka\\tHome\nde:&Erste Seite\\tPos1\ndk:&Første side\\tHome\nel:Πρώτ&η σελίδα\\tHome\nes:Primera página\\tInicio\net:E&simene lehekülg\\tHome\neu:&Lehen Orrialdea\\tHasiera\nfa:صفحه‌ی &نخست\\tHome\nfi:E&nsimmäinen sivu\\tHome\nfr:P&remière page\\tHome\nfy-nl:Earste side\\tHome\nga:An Chéad Leathanach\\tHome\ngl:Primeira páxina\\tHome\nhe:עמוד ראשון\\tHome\nhi:पहले पृष्ठ पर\\tHome\nhr:Prva stranica\\tHome\nhu:Első oldal\\tHome\nid:Halaman Pertama\\tHome\nit:&Prima pagina\\t<Home>\nja:最初のページ(&F)\\tHome\nka:&პირველი გვერდი\\tHome\nkr:첫 페이지(&F)\\tHome\nku:پەڕەی یەکەم&\\tHome\nkw:Kynsa Folen\\tHome\nlt:Pi&rmąjį puslapį\\tHome\nlv:&Pirmo lappusi\\tSākums\nmk:Прва страница\\tHome\nml:ആദ്യ താള്‍\\tHome\nmm:ပထမ စာမျက်နှာ\\tHome\nmy:&Halaman pertama\\tHome\nne:&पहिलो पृष्ठ\\tHome\nnl:Eerste pagina\\tHome\nnn:Fyrste side\\tHome\nno:Første side\\tHome\npa:ਪਹਿਲੇ ਪੰਨੇ ਤੇ\\tHome\npl:&Pierwsza strona\\tHome\npt:Primeira &página\\tHome\nro:Prima pagină\\tHome\nru:Перва&я страница\\tHome\nsi:&මුල් පිටුව\\tHome\nsk:&Prvá strana\\tHome\nsl:Prva stran\\tHome\nsn:Peji yekutanga\\tHome\nsp-rs:Prva stranica\\tHome\nsq:&Faqja e parë\\tHome\nsr-rs:Прва страница\\tHome\nsv:Första sidan\\tHome\nta:முதல் பக்கம்\\tHome\nth:หน้าแรก\ntl:Unang Pahina\\tHome\ntr:&İlk Sayfa\\tHome\ntw:第一頁(&F)\\tHome\nuk:Перша сторінка\\tHome\nuz:&Birinchi bet\\tHome\nvn:Trang đầu\\tHome\n:&Fit pages to printable area\nam:&Հարմարեցնել էջերը տպելու համար\nar:&ملائمة الصفحات لمنطقة الطباعة\naz:Səhifələri çap sa&həsinə sığışdır\nbg:&Оразмери страниците в полето за отпечатване\nbr:Ajustar páginas à área de impressão\nbs:Uklopi stranice na područje za štampu\nca-xv:Ajusta les pàgines a l'àrea imprimible\nca:Ajusta les pàgines a l'àrea imprimible\ncn:缩放页面以匹配可打印区域(&F)\ncy:&Ffitio tudalennau i ardal argraffu\ncz:Přizpůsobit &stránky na tisknutelnou plochu\nde:Seiten in Druckbereich &einpassen\ndk:&Tilpas sider til udskrivningsområdet\nel:Προσαρμογή σελίδων σε &εκτυπώσιμη περιοχή\nes:&Ajustar páginas al área de impresión\net:&Sobita leheküljed prinditavale alale\neu:&Zuzendu orrialdeak eremu irarkigarrira\nfa:اندازه‌ی صفحات را متناسب با ناحیه‌ی قابل چاپ کاغذ &درست کن\nfi:&Sovita sivut tulostettavalle alueelle\nfr:&Ajuster les pages à la zone d'impression\nga:&Oiriúnaigh leathanaigh go limistéar inchlóbhuailte\ngl:&Axustar páxinas á área imprimible\nhe:התאם עמודים לגודל אזור הדפסה\nhi:पृष्ठों को &छापने योग्य क्षेत्र के लिए उपयुक्त करें\nhr:Namjesti stranice do područja za ispis\nhu:Oldalméret illesztése a nyomtatható területhez\nid:&Sesuaikan halaman ke area cetakan\nit:&Adatta pagine alla zona stampabile\nja:ページを印刷可能領域に合わせる(&F)\nka:გვერდების ბეჭდვად არეში &განთავსება\nkr:인쇄 영역에 페이지 맞추기(&F)\nku:گونجاندنی پەڕەکان بۆ شوێنی چاپکردن&\nlt:Pritaikyti puslapių dydį prie spausdinamo ploto\nlv:Ietilpināt lappuses &apdrukājamā zonā\nmk:&Прилагоди страници на зона за печатење\nmy:&Muatkan halaman pada kawasan boleh cetak\nne:पृष्ठहरुलाई छाप्नयोग्य क्षेत्रमा &अटाउनुहोस्\nnl:Pagina's in afdrukgebied passen\nnn:&Tilpass sider til utskrivbart område\nno:&Tilpass sider til utskriftsområde\npl:Dopasuj strony do rozmiaru &wydruku\npt:A&justar páginas à área de impressão\nro:Potrivire pagini cu aria de imprimare\nru:Подо&гнать страницы под область печати\nsi:මෘද්‍රණ කලාපය සදහා සුදුසු ලෙස පිටු &සකසන්න\nsk:&Prispôsobiť strany na tlačiteľnú plochu\nsl:Prilagodi strani na področje tiskanja\nsp-rs:Podesi stranice prema oblasti štampanja\nsq:&Përshtat faqet në hapësirën e printuar\nsr-rs:Подеси странице према области штампања\nsv:Anpassa sidor till utskrivbart &område\nta:அச்சிடும் அளவில் பக்கத்தை காட்டு\ntl:Pagkasyahin ang mga pahina sa printable na area\ntr:Sayfaları &yazdırılabilecek alana ölçekle\ntw:縮放頁面以符合可列印區域(&F)\nuk:Припасовувати сторінки до зони друку\nuz:&Betlarni printerga moslash\nvn:Vừa trang in\n:&Go To\naf:&Gaan Na\nam:&Անցում\nar:انتقل الى&\naz:K&eçid\nbg:&Отиване на\nbn:এতে চলুন...\nbr:&Ir para\nbs:Idi na\nby:Перайсці да\nca-xv:&Vés a\nca:&Vés a\ncn:前往(&G)\ncy:&Mynd i\ncz:&Přejít\nde:&Gehe zu\ndk:&Gå til\nel:&Μετάβαση\nes:&Ir a\net:&Liigu\neu:&Joan Hona\nfa:&برو به\nfi:&Siirry\nfr:A&ller …\nfy-nl:&Gean nei\nga:&Téigh Chuig\ngl:Ir &a\nhe:&מעבר\nhi:जाए(&G)\nhr:Idi na\nhu:U&grás\nid:&Pergi ke\nit:&Vai a\nja:移動(&G)\nka:გადა&სვლა\nkr:가기(&G)\nku:چوون بۆ&\nkw:&Mos dhe\nlt:&Eiti į\nlv:&Doties uz\nmk:П&ојди на\nml:അവിടെ സന്ദര്‍ശിക്കുക\nmm:သို့ သွား\nmy:&Pergi\nne:&जानुहोस्\nnl:&Ga naar\nnn:&Gå til\nno:&Gå til\npa:ਜਾਵੋ(&G)\npl:&Idź do\npt:Ir &para\nro:Sal&t la\nru:Пере&ход\nsi:&යන්න (G)\nsk:&Ísť na\nsl:Po&jdi na\nsn:Enda ku...\nsp-rs:Idi\nsq:&Shkoj te\nsr-rs:Иди\nsv:&Gå till\nta:அங்கு செல்\nth:ไปที่\ntl:Pumun&ta Sa...\ntr:&Git\ntw:前往(&G)\nuk:&Перейти\nuz:&O'tish\nvn:Nhảy đến\n:&Go to page:\nam:&Անցնել էջի.\nar:انتقل إلى صفحة&\naz:&Səhifə:\nbg:Отиди на &страница:\nbr:&Ir para a página:\nbs:&Idi na stranicu:\nby:&Перайсці да старонкі\nca-xv:&Vés a la pàgina:\nca:&Vés a la pàgina:\ncn:前往页(&G):\ncy:&Mynd i dudalen:\ncz:&Přejít na stránku:\nde:&Gehe zu Seite:\ndk:&Gå til side:\nel:&Μετάβαση στη σελίδα:\nes:&Ir a la página:\net:&Leheküljele:\neu:J&oan orrialdera:\nfa:&برو به صفحه‌ی:\nfi:&Siirry sivulle:\nfr:&Aller à la page :\nfy-nl:&Gean nei side:\nga:&Téigh chuig lch:\ngl:&Ir á páxina:\nhe:עבור לעמוד:\nhi:पृष्ठ पर जायें (&G)\nhr:&Idi na stranicu:\nhu:&Ugrás oldal:\nid:&Pergi ke halaman:\nit:&Vai a pagina:\nja:ページへ移動(&G):\nka:გადასვლა &გვერდზე\nkr:이동할 페이지(&G):\nku:چوون بۆ پەڕە&:\nkw:&Mos dhe folen:\nlt:&Eiti į puslapį:\nlv:&Doties uz lappusi:\nmk:&Појди на страница:\nml:താളിലേക്ക് പോകുക\nmy:&Pergi ke halaman:\nne:&पृष्ठमा जानुहोस्\nnl:&Ga naar pagina:\nnn:&Hopp til side:\nno:&Gå til side:\npl:Idź &do strony:\npt:Ir pa&ra a página:\nro:Salt la pagina:\nru:Перейти &к странице\nsi:පිටුවට &යන්න:\nsk:&Prejsť na stranu:\nsl:Pojdi na &stran:\nsp-rs:Idi na stranicu:\nsq:&Shkoj te faqja:\nsr-rs:Иди на страницу:\nsv:&Gå till sida:\nta:பக்கதிர்க்கு செல்:\ntl:Pumunta sa pahina:\ntr:Sayfaya &git:\ntw:前往頁(&G):\nuk:Перейти на сторінку:\nuz:&Betga o'tish:\nvn:Nhảy đến trang:\n:&Help\naf:Hulp\nam:&Օգնություն\nar:التعليمات&\naz:&Kömək\nbg:&Помощ\nbn:&সাহায্য\nbr:Aj&uda\nbs:&Pomoć\nby:Дапамога\nca-xv:&Ajuda\nca:&Ajuda\ncn:帮助(&H)\ncy:&Cymorth\ncz:Náp&ověda\nde:&Hilfe\ndk:&Hjælp\nel:&Βοήθεια\nes:A&yuda\net:&Abi\neu:&Laguntza\nfa:&راهنما\nfi:&Ohje\nfr:Ai&de\nfy-nl:&Help\nga:&Cabhair\ngl:A&xuda\nhe:&עזרה\nhi:सहायता(&H)\nhr:&Pomoć\nhu:&Súgó\nid:Bantua&n\nit:&Guida in linea\nja:ヘルプ(&H)\nka:&დახმარება\nkr:도움말(&H)\nku:یارمەتی&\nkw:&Gweres\nlt:&Žinynas\nlv:&Palīdzība\nmk:&Помош\nml:സഹായം\nmm:&အကူအညီ\nmy:&Bantuan\nne:&मदत\nnl:&Help\nnn:&Hjelp\nno:&Hjelp\npa:ਸਹਾਇਤਾ(&H)\npl:&Pomoc\npt:Aj&uda\nro:A&jutor\nru:&Справка\nsi:&උදව් (H)\nsk:&Pomoc\nsl:Po&moč\nsn:&Rubatsiro\nsp-rs:Pomoć\nsq:&Ndihmë\nsr-rs:Помоћ\nsv:&Hjälp\nta:உதவி\nth:ช่วยเหลือ\ntl:Tulong\ntr:&Yardım\ntw:幫助(&H)\nuk:&Допомога\nuz:&Yordam\nvn:Trợ &giúp\n:&Last Page\\tEnd\naf:Laaste Bladsy\\tEnd\nam:Վերջին էջը\\tEnd\nar:الصفحة &الأخيرة\\tEnd\naz:&Axırıncı səhifə\\tEnd\nbg:&Последна страница\\tEnd\nbn:শেষ পৃষ্ঠা\\tEnd\nbr:Última página\\tEnd\nbs:Posljednja stranica\\tEnd\nby:Апошняя старонка\\tEnd\nca-xv:Ú&ltima pàgina\\tFinal\nca:Ú&ltima pàgina\\tFinal\ncn:最后一页(&L)\\tEnd\ncy:Tudalen Olaf\\tEnd\ncz:Pos&lední stránka\\tEnd\nde:&Letzte Seite\\tEnde\ndk:&Sidste side\\tEnd\nel:&Τελευταία σελίδα\\tEnd\nes:Última página\\tFin\net:&Viimane lehekülg\\tEnd\neu:A&zken Orrialdea\\tAmaiera\nfa:صفحه‌ی آ&خر\\tEnd\nfi:&Viimeinen sivu\\tEnd\nfr:&Dernière page\\tEnd\nfy-nl:Lêste side\\tEnd\nga:&An Leathanach Deiridh\\tEnd\ngl:Última páxina\\tEnd\nhe:עמוד אחרון\\tEnd\nhi:अन्तिम पृष्ठ पर\\tHome\nhr:Posljednja stranica\\tEnd\nhu:Utolsó oldal\\tEnd\nid:Halaman Terakhir\\tEnd\nit:&Ultima pagina\\t<Fine>\nja:最後のページ(&L)\\tEnd\nka:&ბოლო გვერდი\\tEnd\nkr:마지막 페이지(&L)\\tEnd\nku:دواین پەڕە&\\tEnd\nkw:Diwettha folen\\tEnd\nlt:Pa&skutinįjį puslapį\\tEnd\nlv:Pē&dējo lappusi\\tBeigas\nmk:Последна страница\\tEnd\nml:അവസാന താള്‍\\tEnd\nmm:နောက်ဆုံး စာမျက်နှာ\\tEnd\nmy:&Halaman terakhir\nne:अन्ति&म पृष्ठ\\tEnd\nnl:&Laatste pagina\\tEnd\nnn:Siste side\\tEnd\nno:Siste side\\tEnd\npa:ਆਖਰੀ ਪੰਨੇ ਤੇ\\tEnd\npl:&Ostatnia strona\\tEnd\npt:Última pá&gina\\tEnd\nro:Ultima pagină\\tEnd\nru:Посл&едняя страница\\tEnd\nsi:&අවසාන පිටුව\\tEnd\nsk:&Posledná strana\\tEnd\nsl:Zadnja stran\\tEnd\nsn:Peji yekupedzisira\\tEnd\nsp-rs:Poslednja stranica\\tEnd\nsq:&Faqja e fundit\\tEnd\nsr-rs:Последња страница\\tEnd\nsv:Sista sidan\\tEnd\nta:இறுதி பக்கம்\\tEnd\nth:หน้าสุดท้าย\ntl:Huling Pahina\\tEnd\ntr:So&n Sayfa\\tEnd\ntw:最後頁(&L)\\tEnd\nuk:Остання сторінка\\tEnd\nuz:&Oxirgi bet\\tEnd\nvn:Trang cuối\\tEnd\n:&Magnification:\nam:&Մեծացնել\nar:&التكبير\naz:&Böyütmə:\nbg:&Увеличение:\nbr:Aumento:\nbs:&Uvećanje:\nca-xv:&Nivell d'augment:\nca:&Nivell d'augment:\ncn:放大率(&M):\ncy:&Chwyddiad:\ncz:&Zvětšení:\nde:&Vergrößerung:\ndk:&Forstørrelse:\nel:&Μεγέθυνση:\nes:&Aumento:\net:&Suurendus:\neu:&Handipena:\nfa:&درشت نمایی\nfi:&Suurennus:\nfr:&Grossissement :\nfy-nl:&Fergrutting:\nga:For&mhéadú:\ngl:&Ampliación:\nhe:הגדלה:\nhi:&बङा करना:\nhr:&Uvećanje:\nhu:Nagyítás:\nid:&Pembesaran\nit:&Ingrandimento:\nja:拡大率(&M):\nka:მას&შტაბირება:\nkr:확대(&M):\nku:گەورەکردن&:\nkw:&Brasheans:\nlt:&Mastelis\nlv:&Palielinājums:\nmk:&Зголемување\nmy:&Pembesaran:\nne:&आवर्धन:\nnl:&Vergroting:\nnn:&Forstørring:\nno:&Forstørrelse:\npl:&Powiększenie:\npt:&Ampliação:\nro:Factor mărire:\nru:Мас&штабирование:\nsi:&විශාලනය:\nsk:&Zobrazenie:\nsl:&Povečava:\nsp-rs:Uvećanje:\nsq:&Zmadhimi:\nsr-rs:Увећање:\nsv:&Förstoring:\nta:பெரிதாக்கம்\ntl:&Laki\ntr:&Büyüteç:\ntw:倍率(&M)\nuk:Масштабування:\nuz:&Miqyos:\nvn:Phóng đại:\n:&Manual\naf:Handleiding\nam:&Օգնություն\nar:&التعليمات\naz:&Təlimat\nbg:&Ръководство\nbn:নির্দেশ নথিপত্র\nbr:Manual\nbs:Korisnički priručnik\nca-xv:&Manual\nca:&Manual\ncn:手册(&M)\ncy:&Llawlyfr\ncz:&Manuál\nde:&Handbuch\ndk:&Manual\nel:&Οδηγίες Χρήσης\nes:&Manual de instrucciones\net:K&asutusjuhend\neu:E&skuliburua\nfa:&کتابچه‌ی راهنمای آنلاین\nfi:&Käyttöohje\nfr:&Manuel\nfy-nl:Utlis\nga:Lá&mhleabhar\ngl:Manual de Instruccións\nhe:מדריך לתוכנה...\nhi:नियम-पुस्तक(&M)\nhr:Korisnički priručnik\nhu:Útmutató (web)\nid:&Manual\nit:&Manuale in linea (in inglese)\nja:マニュアル(&M)\nka:&სახელმძღვანელო\nkr:온라인 설명서(&M)\nku:فێرکاری&\nkw:&Kowethlyver\nlt:Naudotojo &vadovas\nlv:&Rokasgrāmata\nmk:Прирачник за употреба\nmm:&ကိုယ်တိုင်\nmy:&Manual\nne:&पुस्तिका\nnl:Handleiding\nnn:&Anvisning\nno:&Bruksanvisning\npa:ਮਦੱਦ ਕਤਾਬ(&M)\npl:Instrukcja o&bsługi\npt:&Manual\nro:Manual\nru:&Руководство пользователя\nsi:&අත්පොත (M)\nsk:&Príručka\nsl:P&riročnik\nsp-rs:Uputstvo\nsq:&Manuali\nsr-rs:Упутство\nsv:&Manual\nta:செய்முறை ஏடு\nth:คู่มือการใช้งาน\ntl:Gabay\ntr:&El kitabı\ntw:手冊(&M)\nuk:Керівництво з користування\nuz:&Qo'llanma\nvn:Hướng dẫn sử dụng\n:&Match case\nam:&Հաշվի առնել մեծատառ/փոքրատառը\nar:مطابقة حالة الأحرف& \naz:Re&gistri nəzərə al\nbg:&Същия текст\nbr:Diferenciar minúsculas e maiúsculas\nbs:Razlikuj velika i mala slova\nby:&Улічваць рэгістр\nca-xv:Respecta les &majúscules i minuscules\nca:Respecta les &majúscules i minuscules\ncn:匹配大小写(&M)\ncy:&Cydweddu maint\ncz:&Rozlišovat velikost písmen\nde:&Groß-/Kleinschreibung beachten\ndk:&Versalfølsom søgning\nel:Ταίριασμα πεζών/κεφαλαίων\nes:&Coincidir mayúsculas y minúsculas\net:&Tõstutundlik\neu:&Hizki larri-xeheak bereizi\nfa:دقیقا &مثل عبارت وارد شده\nfi:Sama kirjainkoko\nfr:&Respecter la casse\nfy-nl:Haad-/lytse letters tapasse\nga:&Comhoiriúnaigh an cás\ngl:&Coincidencia maiúsculas/minúsculas\nhe:הבחן בין אותיות גדולות לקטנות\nhi:केस मिलाएँ(&M)\nhr:Razlikuj velika i mala slova\nhu:Kis- és nagybetűk megkülönböztetése\nid:&Samakan ukuran\nit:&Maiuscole/minuscole\nja:大文字と小文字を区別する(&M)\nka:&Учитывать регистр\nkr:대/소문자 구분(&M)\nku:ئەنجامی هاوشێوە&\nkw:An &Keth kas\nlt:&Skirti didžiąsias ir mažąsias raides\nlv:&Saskaņot reģistru\nmk:&Разликувај мали и големи букви\nmy:&Padan case\nne:&केस मिलाउनुहोस्\nnl:Hoofd-/kleine letters toepassen\nnn:&Skil mellom store/små bokstaver\nno:&Skill mellom store og små bokstaver\npl:&Uwzględnij wielkość liter\npt:Sensível a &maiúsculas\nro:Potrivire literele mari și mici\nru:&Учитывать регистр\nsi:&උදාහරණය ගැළපීම\nsk:&Podľa zadaných kritérií\nsl:Razlikuj &med velikimi/malimi črkami\nsp-rs:Razlikuj mala i velika slova\nsq:&Krahasoj shkronjat\nsr-rs:Разликуј мала и велика слова\nsv:Matcha &versaler/gemener\nta:தட்டுப் பொருத்தம்\ntl:Itug&ma ang laki ng mga letra\ntr:B&üyük/Küçük harf eşleştir\ntw:符合大小寫(&M)\nuk:Враховувати регістр\nuz:&Registrni hisobga olish\nvn:Phân biệt &HOA-thường\n:&Next Page\\tRight Arrow\naf:Volgende Bladsy\\t->\nam:Հաջորդ էջը\\t->\nar:الصفحة &التالية\\t->\naz:&Sonrakı səhifə\\tRight Arrow\nbg:Следва&ща страница\\tДясна стрелка\nbn:পরবর্তী পৃষ্ঠা\\t->\nbr:Página seguinte\\t->\nbs:Sljedeća stranica\\t->\nby:Наступная старонка\\t->\nca-xv:Pàgina &següent\\t->\nca:Pàgina &següent\\t->\ncn:下一页(&N)\\t右箭头\ncy:Tudalen Nesaf\\t->\ncz:Další strá&nka\\tŠipka vpravo\nde:&Nächste Seite\\t->\ndk:&Næste side\\t->\nel:&Επόμενη σελίδα\\t->\nes:&Página siguiente\\t->\net:&Järgmine lehekülg\\tParemnool\neu:&Hurrengo Orrialdea\\tEskuin Gezia\nfa:صفحه‌ی &بعدی\\t→\nfi:&Seuraava sivu\\tOikea nuoli\nfr:Page &suivante\\t->\nfy-nl:Folgjende side\\t->\nga:&Leathanach Ar Aghaidh\\tSaighead ar deis\ngl:Páxina seguinte\\t->\nhe:עמוד הבא\\tחץ ימני\nhi:अगले पृष्ठ पर\\t->\nhr:Sljedeća stranica\\t->\nhu:Következő oldal\\t->\nid:Halaman Berikutnya\\t->\nit:Pagi&na successiva\\t<Freccia destra>\nja:次のページ(&N)\\t→\nka:შ&ემდეგი გვერდი\\tმარჯვენა ისარი\nkr:다음 페이지(&N)\\t오른쪽 방향키\nku:پەڕەی دواتر&\\tRight Arrow\nkw:Nessa Folen\\t->\nlt:&Kitas puslapis\\tDešinėn\nlv:&Nākamo lappusi\\tLabā bultiņa\nmk:Следна страница\\t->\nml:അടുത്ത താള്‍\\t->\nmm:နောက် တမျက်နှာ\\t->\nmy:&Halaman seterusnya\\t->\nne:&अर्को पृष्ठ\\tदायाँ बाण\nnl:Volgende pagina\\t->\nnn:Neste side\\t->\nno:Neste side\\t→\npa:ਅਗਲੇ ਪੰਨੇ ਤੇ\\t->\npl:&Następna strona\\tW prawo\npt:Página &seguinte\\t->\nro:Pagina următoare\\t->\nru:С&ледующая страница\\tСтрелка вправо\nsi:&මීළග පිටුව\\tRight Arrow\nsk:&Ďalšia strana\\t->\nsl:Naslednja stran\\tPuščica desno\nsn:Peji yemberi\\t->\nsp-rs:Sledeća stranica\\t->\nsq:&Faqja tjetër\\tRight Arrow\nsr-rs:Следећа страница\\t->\nsv:Nästa sida\\t->\nta:அடுத்த பக்கம்\\t->\nth:หน้าถัดไป\\t->\ntl:Sunod na Pahina\\t->\ntr:S&onraki Sayfa\\t->\ntw:下一頁(&N)\\t右箭頭\nuk:Наступна сторінка\\t->\nuz:&Keyingi bet\\t->\nvn:Trang sau\\tMũi tên phải\n:&No\nam:&Ոչ\nar:لا&\naz:&Xeyr\nbg:&Не\nbr:&Não\nbs:&Ne\nby:Нет\nca-xv:&No\nca:&No\ncn:否(&N)\ncy:&Na\ncz:&Ne\nde:&Nein\ndk:&Nej\nel:Ό&χι\nes:&No\net:&Ei\neu:&Ez\nfa:&خیر\nfi:&Ei\nfr:&Non\nfy-nl:&Nee\nga:&Ná déan\ngl:&Non\nhe:לא\nhi:नहीं(&N)\nhr:&Ne\nhu:&Nem\nid:&Tidak\nit:&No\nja:いいえ(&N)\nka:&არა\nkr:아니오(&N)\nku:نەخێر&\nkw:&Na\nlt:&Ne\nlv:&Nē\nmk:&Не\nmy:&Tidak\nne:&बेठिक\nnl:&Nee\nnn:&Nei\nno:&Nei\npl:&Nie\npt:&Não\nro:&Nu\nru:&Нет\nsi:&එපා\nsk:&Nie\nsl:&Ne\nsn:&kwete\nsp-rs:Ne\nsq:&Jo\nsr-rs:Не\nsv:&Nej\nta:இல்லை\ntl:Hindi\ntr:&Hayır\ntw:否(&N)\nuk:Ні\nuz:&Yo'q\nvn:Không\n:&No, thanks\nam:&Ոչ\nar:لا ، شكر&\naz:&Xeyr, təşəkkür!\nbg:&Не, благодаря\nbr:&Não, obrigado\nbs:&Ne, hvala\nby:Дзякуй, не\nca-xv:&No, gràcies\nca:&No, gràcies\ncn:不，谢谢(&N)\ncy:&Dim diolch\ncz:&Ne, děkuji\nde:&Nein danke\ndk:&Nej, tak\nel:&Όχι, ευχαριστώ\nes:&No, gracias\net:&Tänan, ei\neu:&Ez, eskerrik asko\nfa:&نه، متشکرم\nfi:&Ei kiitos\nfr:&Non, merci\nfy-nl:&Nee, tankewol\nga:&Níl, go raibh maith agat\ngl:&Non, grazas\nhe:לא, תודה\nhi:नहीं, धन्यवाद(&N)\nhr:&Ne, hvala\nhu:Köszönöm,&nem\nid:&Tidak, terima kasih\nit:&No, grazie\nja:いいえ(&N)\njv:&Ora, matur nuwun\nka:&არა, გმადლობთ\nkr:아니오(&N)\nku:نەخێر، سوپاس&\nkw:&Na, meur ras\nlt:Ačiū, &ne\nlv:&Nē, paldies\nmk:&Не, благодарам\nmy:&Tidak, terima kasih\nne:धन्यबाद, तर &पर्दैन\nnl:&Nee, bedankt\nnn:&Nei takk\nno:&Nei, takk\npl:Nie, &dziękuję\npt:&Não, obrigado(a)\nro:&Nu, mulțumesc\nru:&Нет, спасибо\nsi:&එපා, ස්තූතියි\nsk:&Nie, ďakujem\nsl:&Ne, hvala\nsp-rs:Ne, hvala\nsq:&Jo, faleminderit\nsr-rs:Не, хвала\nsv:&Nej, tack\nta:இல்லை, நன்றி\ntl:'Di bale na lang\ntr:&Hayır, teşekkürler\ntw:不用了，謝謝(&N)\nuk:Ні, дякую\nuz:&Yo'q, rahmat\nvn:Không, cảm ơn\n:&Odd pages only\nam:&Միայն կենտ էջերը\nar:&الصفحات الفردية فقط\naz:Yalnız tə&k səhifələr\nbg:Само &нечетни страници\nbr:Apenas as páginas ímpares\nbs:Samo &neparne stranice\nca-xv:Només les pàgines senars\nca:Només les pàgines senars\ncn:仅奇数页(&O)\ncy:Tudalennau &odrif yn unig\ncz:&Pouze liché stránky\nde:Nur &ungerade Seiten\ndk:&Kun ulige sider\nel:&Μόνο οι μονές σελίδες\nes:&Sólo páginas impares\net:Vaid &paaritud leheküljed\neu:&Orrialde bikoitiak bakarrik\nfa:فقط صفحات &فرد\nfi:Vain &parittomat sivut\nfr:Seulement les pages &impaires\nga:&Corr-leathanaigh amháin\ngl:&Só páxinas impares\nhe:עמודים אי-זוגיים בלבד\nhi:केवल &विषम पृष्ठों\nhr:Samo &neparne stranice\nhu:Csak a páratlan oldalak\nid:Hanya halaman ganji&l\nit:S&olo pagine dispari\nja:奇数ページのみ(&O)\nka:მხოლოდ &კენტი გვერდები\nkr:홀수 페이지만(&O)\nku:تەنها پەڕە تاکەکان&\nlt:&Tik nelyginiai puslapiai\nlv:Tikai &nepāra lappuses\nmk:Само &непарни страници\nml:ഒറ്റ സംഖ്യാ താളുകള്‍ മാത്രം\nmy:&Mukasurat ganjil sahaja\nne:&बिजोर पृष्ठ मात्र\nnl:Alleen &Oneven pagina's\nnn:&Kun oddetalssider\nno:Bare &oddetallssider\npl:Strony &nieparzyste\npt:Só páginas í&mpares\nro:Doar paginile impare\nru:Только нечётн&ые страницы\nsi:&ඔත්තෙ පිටු පමණි\nsk:&Tlačiť iba nepárne strany\nsl:Samo &lihe strani\nsp-rs:Samo poleđine stranica\nsq:Vetëm faqet &teke\nsr-rs:Само полеђине страница\nsv:Endast &udda sidor\nta:ஒற்றைபடை பக்கங்கள் மட்டும்\ntl:Mga odd na pahina lamang\ntr:Sadece &tek sayfalar\ntw:僅有奇數頁(&O)\nuk:Тільки непарні сторінки\nuz:&Faqat toq betlar\nvn:Chỉ những trang chẵn\n:&Open Document\nam:&Բացել փաստաթուղթ\nar:فتح مستند&\naz:Sənədi &aç\nbg:&Отваряне на документ\nbr:Abrir d&ocumento\nbs:&Otvori dokument\nca-xv:&Obri el document\nca:&Obre el document\ncn:打开文件(&O)\ncy:Agor &Dogfen\ncz:&Otevřít dokument\nde:Ö&ffnen\ndk:&Åbn dokument\nel:Ά&νοιγμα εγγράφου\nes:&Abrir documento\net:&Ava dokument\neu:&Ireki Agiria\nfa:باز کردن سند\nfi:&Avaa asiakirja\nfr:&Ouvrir le document\nga:&Oscail Cáipéis\ngl:Abrir documento\nhe:פתח קובץ\nhi:दस्तावेज़ &खोलें\nhr:&Otvori dokument\nhu:&Fájl megnyitása\nid:Buka D&okumen\nit:&Apri documento\nja:ドキュメントを開く(&O)\nka:&დოკუმენტის გახსნა\nkr:문서 열기(&O)\nku:کردنەوەی بەڵگەنامە&\nlt:&Atverti dokumentą\nlv:&Atvērt dokumentu\nmk:Отвори документ\nmy:&Buka dokumen\nne:&कागजात खोल्नुहोस्\nnl:Document &Openen\nnn:&Opne dokument\nno:&Åpne dokument\npl:&Otwórz dokument\npt:&Abrir documento\nro:Deschide d&ocument\nru:&Открыть документ\nsk:&Otvoriť dokument\nsl:&Odpri dokument\nsp-rs:Otvori dokument\nsq:&Hap dokumentin\nsr-rs:Отвори документ\nsv:&Öppna dokument\nta:கோப்பை திற\ntr:Belgeyi &Aç\ntw:開啟此文件(&O)\nuk:Відкрити документ\nuz:&Hujjatni ochish\nvn:Mở tập tin\n:&Open...\\tCtrl+O\naf:&Maak Oop...\\tCtrl+O\nam:Բացել...\\tCtrl+O\nar:&فتح...\\tCtrl+O\naz:&Aç...\\tCtrl+O\nbg:&Отваряне...\\tCtrl+O\nbn:&উন্মীলন...\\tCtrl+O\nbr:A&brir...\\tCtrl+O\nbs:&Otvori...\\tCtrl+O\nby:Адчыніць...\\tCtrl+O\nca-xv:&Obri...\\tCtrl+O\nca:&Obre...\\tCtrl+O\ncn:打开(&O)...\\tCtrl+O\ncy:&Agor...\\tCtrl+O\ncz:&Otevřít...\\tCtrl+O\nde:Ö&ffnen…\\tStrg+O\ndk:&Åbn...\\tCtrl+O\nel:Ά&νοιγμα...\\tCtrl+O\nes:&Abrir...\\tCtrl+O\net:&Ava...\\tCtrl+O\neu:&Ireki...\\tKtrl+O\nfa:&باز کردن...\\tCtrl+O\nfi:&Avaa...\\tCtrl+O\nfr:&Ouvrir...\\tCtrl+O\nfy-nl:&Iepenje...\\tCtrl+O\nga:&Oscail...\\tCtrl+O\ngl:A&brir...\\tCtrl+O\nhe:פתח...\\tCtrl+O\nhi:फाईल खोलें(&O)\\tCtrl+O\nhr:&Otvori...\\tCtrl+O\nhu:Megny&itás...\\tCtrl+O\nid:&Buka...\\tCtrl+O\nit:&Apri...\\tCtrl+O\nja:開く(&O)...\\tCtrl+O\nka:&გახსნა...\\tCtrl+O\nkr:열기(&O)...\\tCtrl+O\nku:کردنەوە...&\\tCtrl+O\nkw:&Ygor...\\tCtrl+O\nlt:&Atverti...\\tCtrl+O\nlv:&Atvērt...\\tCtrl+O\nmk:&Отвори...\\tCtrl+O\nml:തുറക്കുക...\\tCtrl+O\nmm:&ဖွင့်ပါ...\\tCtrl+O\nmy:&Buka...\\tCtrl+O\nne:खोल्नु&होस्...\\tCtrl+O\nnl:&Openen...\\tCtrl+O\nnn:&Opne...\\tCtrl+O\nno:&Åpne...\\tCtrl+O\npa:ਫਾਇਲ ਖੋਲੋ(&O)...\\tCtrl+O\npl:&Otwórz…\\tCtrl+O\npt:&Abrir...\\tCtrl+O\nro:&Deschidere...\\tCtrl+O\nru:&Открыть...\\tCtrl+O\nsi:&විවෘත කරන්න... (O)\\tCtrl+O\nsk:&Otvoriť...\\tCtrl+O\nsl:&Odpri …\\tCtrl+O\nsn:Vhura...\\tCtrl+0\nsp-rs:Otvori...\\tCtrl+O\nsq:&Hap...\\tCtrl+O\nsr-rs:Отвори...\\tCtrl+O\nsv:&Öppna...\\tCtrl+O\nta:திற...\\tCtrl+O\nth:เปิด...\\tCtrl+O\ntl:Buksan...\\tCtrl+O\ntr:&Aç...\\tCtrl+O\ntw:開啟(&O)...\\tCtrl+O\nuk:Відкрити...\\tCtrl+O\nuz:&Ochish...\\tCtrl+O\nvn:Mở tập tin...\\tCtrl+O\n:&Options\nam:&Ընտրանքներ\nar:&الخيارات\naz:&Seçimlər\nbr:&Opções\nbs:&Opcije\nca-xv:&Opcions\nca:&Opcions\ncn:选项(&O)\ncy:&Dewisiadau\ncz:&Možnosti\nde:&Optionen\ndk:&Valgmuligheder\nel:&Επιλογές\nes:&Opciones\net:&Sätted\neu:A&ukerak\nfa:&گزینه‌ها\nfi:&Asetukset\nfr:&Options\nga:&Roghanna\ngl:&Opcións\nhe:אפשרויות\nhr:P&ostavke\nhu:&Beállítások\nid:Pilihan\nit:&Opzioni\nja:オプション(&O)\nka:&ვარიანტები\nkr:옵션(&O)\nku:هەڵبژاردنەکان&\nlv:&Opcijas\nmk:&Опции\nmy:&Tetapan\nnl:&Opties\nnn:&Innstillingar\nno:&Tillegg\npl:&Opcje\npt:&Opções\nro:&Optiuni\nru:&Параметры\nsk:&Možnosti\nsl:M&ožnosti\nsp-rs:Opcije\nsq:&Opsionet\nsr-rs:Опције\nsv:Alternativ\nta:&விருப்பம்\ntr:&Ayarlar\ntw:選項(&O)\nuk:Налаштування\nuz:&Parametrlar\nvn:&Tùy chọn\n:&Options...\nam:&Ընտրանքներ...\nar:&خيارات...\naz:&Seçimlər...\nbg:&Настройки\nbr:&Opções...\nbs:Opcije...\nby:&Параметры...\nca-xv:&Opcions...\nca:&Opcions...\ncn:选项(&O)...\ncy:&Dewisiadau...\ncz:&Možnosti...\nde:&Optionen…\ndk:&Valgmuligheder ...\nel:&Επιλογές...\nes:&Opciones...\net:&Sätted...\neu:A&ukerak...\nfa:&تنظیمات ...\nfi:&Asetukset...\nfr:&Options...\nfy-nl:&Opsjes...\nga:&Roghanna...\ngl:&Opcións...\nhe:הגדרות...\nhi:&विकल्पों...\nhr:Mogućnosti...\nhu:&Beállítások...\nid:&Pilihan...\nit:&Opzioni...\nja:オプション(&O)...\nka:&პარამეტრები...\nkr:옵션(&O)...\nku:هەڵبژاردنەکان...&\nkw:&Etholyow...\nlt:&Nuostatos...\nlv:&Opcijas...\nmk:&Опции...\nmy:&Pilihan...\nne:&विकल्पहरु\nnl:&Opties...\nnn:&Innstillingar...\nno:&Innstillinger...\npl:&Opcje...\npt:&Opções...\nro:&Opțiuni...\nru:&Параметры...\nsi:&විකල්ප... (O)\nsk:&Možnosti...\nsl:&Možnosti …\nsp-rs:Opcije...\nsq:&Opsionet...\nsr-rs:Опције...\nsv:Alternativ...\nta:விருப்ப பேரம்\ntl:Mga Pagpipilian\ntr:&Seçenekler...\ntw:選項(&O)...\nuk:Опції...\nuz:&Parametrlar...\nvn:Tuỳ chọn\n:&Password:\nam:&Գաղտնաբառը\nar:كلمة السر&:\naz:&Parol:\nbg:&Парола\nbr:&Senha:\nbs:&Lozinka:\nby:&Пароль:\nca-xv:&Contrasenya:\nca:&Contrasenya:\ncn:密码(&P)\ncy:&Cyfrinair:\ncz:&Heslo:\nde:&Passwort:\ndk:&Kodeord:\nel:&Κωδικός:\nes:&Contraseña:\net:&Salasõna:\neu:Sarhitza\nfa:&کلمه‌ی عبور\nfi:&Salasana\nfr:&Mot de passe :\nfy-nl:&Wachtwurd:\nga:&Focal faire:\ngl:&Contrasinal:\nhe:ססמה:\nhi:&पासवर्ड:\nhr:&Lozinka:\nhu:&Jelszó:\nid:&Kata sandi:\nit:&Password:\nja:パスワード(&P):\nka:&პაროლი:\nkr:비밀번호(&P):\nku:تێپەڕە ووشە&:\nkw:&Ger-tremena:\nlt:&Slaptažodis:\nlv:&Parole:\nmk:&Лозинка:\nml:രഹസ്യവാക്ക്\nmy:&Kata laluan\nne:&पासवर्ड\nnl:&Wachtwoord:\nnn:&Passord:\nno:&Passord:\npl:&Hasło:\npt:&Palavra-passe:\nro:&Parola:\nru:&Пароль:\nsi:&රහස්පද:\nsk:&Heslo:\nsl:&Geslo:\nsp-rs:Lozinka\nsq:&Fjalëkalimi:\nsr-rs:Лозинка\nsv:&Lösenord:\nta:கடவுச்சொல்\ntl:&Password:\ntr:&Şifre:\ntw:密碼(&P):\nuk:Пароль:\nuz:&Maxfiy so'z:\nvn:Mật khẩu:\n:&Pin Document\nam:&Գամել փաստաթուղթը\nar:&ثبت المستند\naz:Sənədi &yadda saxla\nbg:&Закачи документ\nbr:Fixar documento\nbs:&Pričvrsti dokument\nca-xv:&Marca el document\nca:&Marca el document\ncn:钉选(&P)\ncy:&Pinio Dogfen\ncz:&Připnout dokument\nde:Auf dieser Seite &behalten\ndk:&Fastgør dokument\nel:&Καρφίτσωμα εγγράφου\nes:Fi&jar documento\net:&Kinnita dokument\neu:&Pin Agiria\nfa:&سنجاق کردن سند\nfi:&Kiinnitä asiakirja\nfr:Ajouter le document à la liste\nga:&Greamaigh an cháipéis le biorrán\ngl:&Marcar Documento\nhe:הצמד קובץ\nhi:दस्तावेज़ &जड़ें\nhr:&Pričvrsti dokument\nhu:Lista elejére\nid:&Pin Dokumen\nit:&Attacca il documento (Pin)\nja:ドキュメントをピンする&(P)\nka:დოკუმენიტს &მიმაგრება\nkr:문서 고정(&P)\nku:دیاریکردنی بەڵگەنامە&\nlt:Pasi&žymėti dokumentą\nlv:&Piespraust dokumentu\nmk:Закачи документ\nmy:&Pin Dokumen\nne:कागजातलाई &टाँस्नुहोस्\nnl:Document &Vastpinnen\nnn:&Fest dokument\nno:Fes&t dokument\npl:&Przypnij dokument\npt:Fi&xar documento\nro:&Fixează document\nru:&Запомнить документ\nsk:&Pripnúť dokument\nsl:&Pritrdi dokument\nsp-rs:Prikači dokument\nsq:&Ngul dokumentin\nsr-rs:Прикачи документ\nsv:&Fäst dokument\nta:கோப்பை குத்திவை\ntr:Belgeye &Tuttur\ntw:釘選(&P)\nuk:Документ pin\nuz:&Hujjatni eslab qolish\nvn:Ghim tập tin\n:&Previous Page\\tLeft Arrow\naf:Vorige Bladsy\\t<-\nam:Նախորդ էջը\\t<-\nar:الصفحة &السابقة\\tLeft Arrow\naz:&Əvvəlki səhifə\\tLeft Arrow\nbg:Преди&шна страница\\tЛява стрелка\nbn:পূর্ববর্তী পৃষ্ঠা\\t<-\nbr:Página anterior\\t<-\nbs:Prethodna stranica\\t<-\nby:Папярэдняя старонка\\t<-\nca-xv:Pàgina &anterior\\t<-\nca:Pàgina &anterior\\t<-\ncn:上一页(&P)\\t左箭头\ncy:Tudalen &Flaenorol\\tSaeth Chwith\ncz:&Předchozí stránka\\tŠipka vlevo\nde:&Vorherige Seite\\t<-\ndk:&Forrige side\\t<-\nel:&Προηγούμενη σελίδα\\t<-\nes:Página anterior\\t<-\net:&Eelmine lehekülg\\tVasaknool\neu:&Aurreko Orrialdea\\tEzker Gezia\nfa:صفحه‌ی &قبلی\\t←\nfi:&Edellinen sivu\\tVasen nuoli\nfr:Page &précédente\\t<-\nfy-nl:Foarige side\\t<-\nga:Leathanach Roimhe\\tSaighead ar clé\ngl:Páxina anterior\\t<-\nhe:עמוד קודם\\tחץ שמאלי\nhi:पिछले पृष्ठ पर\\t<-\nhr:Prethodna stranica\\t<-\nhu:Előző oldal\\t<-\nid:Halaman Sebelumnya\\t<-\nit:&Pagina precedente\\t<Freccia sinistra>\nja:前のページ(&P)\\t←\nka:წი&ნა გვერდი\\tმარცხენა ისარი\nkr:이전 페이지(&P)\\t왼쪽 방향키\nku:پەڕەی پێشوو&\\tLeft Arrow\nkw:Folen kyns\\t<-\nlt:&Ankstesnis puslapis\\tKairėn\nlv:&Iepriekšējo lappusi\\tKreisā bultiņa\nmk:Претходна страница\\t<-\nml:മുന്‍പുള്ള താള്‍\\t<-\nmm:ပြီးတဲ့ စာမျက်နှာ\\t<-\nmy:&Halaman sebelumnya\\t<-\nne:अ&घिल्लो पृष्ठ\\tबायाँ बाण\nnl:Vorige pagina\\t<-\nnn:Førre side\\t<-\nno:Forrige side\\t←\npa:ਪਿਛਲੇ ਪੰਨੇ ਤੇ\\t<-\npl:&Poprzednia strona\\tW lewo\npt:Página &anterior\\t<-\nro:Pagina anterioară\\t<-\nru:Пре&дыдущая страница\\tСтрелка влево\nsi:&පෙර පිටුව\\tLeft Arrow\nsk:&Predchádzajúca strana\\t<-\nsl:Predhodna stran\\tPuščica levo\nsn:Peji yesure\\t<-\nsp-rs:Prethodna stranica\\t<-\nsq:&Faqja e mëparshme\\tLeft Arrow\nsr-rs:Претходна страница\\t<-\nsv:Föregående sida\\t<-\nta:முந்தைய பக்கம்\\tLeft Arrow\nth:หน้าก่อนหน้า\\t<-\ntl:Naunang Pahina\\t<-\ntr:&Önceki Sayfa\\t<-\ntw:上一頁(&P)\\t左箭頭\nuk:Попередня сторінка\\t<-\nuz:&Oldingi bet\\t<-\nvn:Trang trước\\tMũi tên trái\n:&Print...\nam:&Տպել...\nar:&طباعة...\naz:&Çap et...\nbg:&Отпечатване...\nbr:Im&primir...\nbs:Š&tampaj...\nca-xv:Im&primeix...\nca:Im&primeix...\ncn:打印(&P)...\ncy:&Argraffu...\ncz:&Tisk...\nde:&Drucken…\ndk:&Udskriv ...\nel:&Εκτύπωση\nes:&Imprimir...\net:&Prindi...\neu:&Irarkitu...\nfa:&چاپ...\nfi:&Tulosta...\nfr:Im&primer...\nga:&Clóbhuail...\ngl:&Imprimir...\nhe:הדפס...\nhi:&छापें...\nhr:Is&pis...\nhu:&Nyomtatás\nid:&Cetak...\nit:&Stampa\nja:印刷(&P)...\nka:&ამობეჭდვა...\nkr:인쇄(&P)...\nku:چاپکردن...&\nlt:&Spausdinti...\nlv:&Drukāt...\nmk:&Печати...\nmy:&Cetak...\nne:&छाप्नुहोस् ...\nnl:Afdrukken...\nnn:&Skriv ut\nno:&Skriv ut...\npl:&Drukuj...\npt:&Imprimir...\nro:&Tipărește...\nru:Пе&чать...\nsi:මුද්‍රණය...\nsk:&Tlač...\nsl:&Natisni …\nsp-rs:Štampaj...\nsq:&Printoj...\nsr-rs:Штампај...\nsv:&Skriv ut...\nta:அச்சிடு...\ntl:I-&print\ntr:&Yazdır...\ntw:列印(&P)...\nuk:Друк...\nuz:&Chop etish...\nvn:In...\n:&Print... (denied)\nam:&Տպել... (մերժված)\nar:&تم رفض الطباعة\naz:&Çap et... (imtina)\nbg:От&печатване... (отказано)\nbr:&Imprimir... (negado)\nbs:&Štampa... (nije dopušteno)\nca-xv:&Imprimeix... (denegat)\nca:&Imprimeix... (denegat)\ncn:打印(&P)... (已中断)\ncy:&Argraffu... (gwrthodwyd)\ncz:&Tisk... (odepřen)\nde:&Drucken… (verweigert)\ndk:&Udskriv ... (nægtet)\nel:&Εκτύπωση... (απαγορεύεται)\nes:&Imprimir... (protegido)\net:&Prindi... (keelatud)\neu:&Irarkitu... (ukatuta)\nfa:&چاپ... (ممنوع شده)\nfi:&Tulosta... (kielletty)\nfr:&Imprimer... (Interdit)\nga:&Clóbhualadh... (diúltaithe)\ngl:&Imprimir... (denegado)\nhe:הדפס... (לא התאפשר)\nhi:&छपाई...(अस्वीकृत)\nhr:&Ispis... (nije dopušteno)\nhu:Nyomtatás... (tiltott)\nid:&Cetak... (ditolak)\nit:Stam&pa... (rifiutato)\nja:印刷... (拒否されました)(&P)\nka:&ამობეჭდვა... (გაუქმდა)\nkr:인쇄(&P)... (거부됨)\nku:(چاپکردن... (ڕەتکرایەوە&\nlt:&Spausdinti... (neprieinama)\nlv:&Drukāt... (liegts)\nmk:&Печати... (denied)\nmy:&Cetak... (dinafikan)\nne:&छपाई... (अस्वीकार भयो)\nnl:Afdrukken... (niet toegestaan)\nnn:&Skriv ut... (Blei nekta)\nno:&Skriv ut... (ikke tillatt)\npl:&Drukuj... (odmówiono)\npt:&Imprimir...(recusado)\nro:&Imprimare... (interzisă)\nru:Пе&чать... (отмена)\nsi:&මුද්‍රණය... (නොහැක)\nsk:&Tlač... (odmietnutá)\nsl:&Natisni … (onemogočeno)\nsp-rs:Štampaj... (odbijeno)\nsq:&Printoj... (ndalohet)\nsr-rs:Штампај... (одбијено)\nsv:&Utskrift... (nekad)\nta:அகசிடல்... (நிராகரிக்கப்பட்டது)\ntl:&I-print... (hindi maaari)\ntr:&Baskı... (reddedildi)\ntw:列印(&P)... (已中斷)\nuk:Друк... (відхилено)\nuz:&Chop etish... (ruxsat etilmagan)\nvn:&In... (bị từ chối)\n:&Print...\\tCtrl+P\naf:&Druk\\tCtrl+P\nam:&Տպել\\tCtrl+P\nar:&طباعة...\\tCtrl+P\naz:&Çap et...\\tCtrl+P\nbg:От&печатай\\tCtrl+P\nbn:&মুদ্রন...\\tCtrl+P\nbr:&Imprimir\\tCtrl+P\nbs:&Štampaj...\\tCtrl+P\nby:Друкаваць...\\tCtrl+P\nca-xv:&Imprimeix...\\tCtrl+P\nca:&Imprimeix...\\tCtrl+P\ncn:打印(&P)...\\tCtrl+P\ncy:&Argraffu...\\tCtrl+P\ncz:&Tisk...\\tCtrl+P\nde:&Drucken…\\tStrg+P\ndk:&Udskriv ...\\tCtrl+P\nel:&Εκτύπωση...\\tCtrl+P\nes:&Imprimir...\\tCtrl+P\net:&Prindi...\\tCtrl+P\neu:Irarkit&u...\\tKtrl+P\nfa:&چاپ...\\tCtrl+P\nfi:&Tulosta...\\tCtrl+P\nfr:&Imprimer...\\tCtrl+P\nfy-nl:&Ofdrukke...\\tCtrl+P\nga:&Clóbhuail\\tCtrl+P\ngl:&Imprimir...\\tCtrl+P\nhe:הדפס...\\tCtrl+P\nhi:परिंट करें(&P)\\tCtrl+P\nhr:&Ispiši...\\tCtrl+P\nhu:Nyomt&atás...\\tCtrl+P\nid:&Cetak...\\tCtrl+P\nit:Stam&pa...\\tCtrl+P\nja:印刷(&P)...\\tCtrl+P\nka:&ამობეჭდვა...\\tCtrl+P\nkr:인쇄(&P)...\\tCtrl+P\nku:چاپکردن...&\\tCtrl+P\nkw:&Pryntya\\tCtrl+P\nlt:&Spausdinti...\\tCtrl+P\nlv:&Drukāt...\\tCtrl+P\nmk:&Печати...\\tCtrl+P\nml:അച്ചടി...\\tCtrl+P\nmm:&ပုံနှိပ်ပါ...\\tCtrl+P\nmy:&Cetak...\\tCtrl+P\nne:&छाप्नुहोस्...\\tCtrl+P\nnl:Afdrukken...\\tCtrl+P\nnn:Skriv &ut...\\tCtrl+P\nno:&Skriv ut...\\tCtrl+P\npa:ਪਰਿੰਟ ਕਰੋ(&P)...\\tCtrl+P\npl:&Drukuj...\\tCtrl+P\npt:&Imprimir\\tCtrl+P\nro:I&mprimare...\\tCtrl+P\nru:Пе&чать...\\tCtrl+P\nsi:&මුද්‍රණය... (P)\\tCtrl+P\nsk:&Tlačiť...\\tCtrl+P\nsl:&Natisni …\\tCtrl+P\nsn:&Printa...\\tCtrl+P\nsp-rs:Štampaj...\\tCtrl+P\nsq:&Printoj...\\tCtrl+P\nsr-rs:Штампај...\\tCtrl+P\nsv:Skriv &ut...\\tCtrl+P\nta:அச்சிடு...\\tCtrl+P\nth:พิมพ์\\tCtrl+P\ntl:I-&print\\tCtrl+P\ntr:&Yazdır...\\tCtrl+P\ntw:列印(&P)...\\tCtrl+P\nuk:&Друкувати...\\tCtrl+P\nuz:&Chop etish\\tCtrl+P\nvn:In...\\tCtrl+P\n:&Remember the password for this document\nam:&Հիշել ֆայլի գաղտնաբառը\nar:&حفظ كلمة السر لهذا المستند\naz:Bu sənəd üçün parolu &yadda saxla\nbg:Запомни &паролата за този документ\nbr:Lembra&r a senha deste documento\nbs:&Zapamti lozinku za ovaj dokument\nca-xv:&Recorda la contrasenya per a este document\nca:&Recorda la contrasenya per a aquest document\ncn:记住本文档的密码(&R)\ncy:&Cofio cyfrinair y ddogfen\ncz:P&amatovat si heslo tohoto dokumentu\nde:Passwort für dieses Dokument &merken\ndk:&Husk kodeordet for dette dokument\nel:&Απομνημόνευση κωδικού για αυτό το έγγραφο\nes:&Recordar la contraseña para este documento\net:&Jäta meelde selle dokumendi salasõna\neu:&Gogoratu agiri honetarako sarhitza\nfa:رمز عبور این سند را به &خاطر داشته باش\nfi:&Muista tämän asiakirjan salasana\nfr:&Se rappeler le mot de passe pour ce document\nga:&Cuimhnigh ar an bhfocal faire don cháipéis seo\ngl:&Lembrar o contrasinal para este documento\nhe:שמור ססמה לקובץ זה\nhi:इस दस्तावेज़ के लिए पासवर्ड &याद रखें\nhr:&Zapamti lozinku za ovaj dokument\nhu:Jelszó megjegyzése a dokumentumhoz\nid:&Ingat kata sandi untuk dokumen ini\nit:&Ricorda la password per questo documento\nja:このドキュメントのパスワードを記憶する(&R)\nka:ამ დოკუმენტისთვის პაროლის და&მახსოვრება\nkr:이 문서의 비밀번호 기억(&R)\nku:بیرخستنەوەی تێپەڕە ووشە بۆ ئەم بەڵگەنامەیە&\nlt:Įsiminti šio dokumento &slaptažodį\nlv:&Atcerēties šī dokumenta paroli\nmk:&Запомни ја лозинката за овој документ\nmy:&Ingat katalaluan untuk dokumen ini\nne:यो कागजातको पासवर्ड &सम्झनुहोस्\nnl:Wachtwoord onthouden voor dit document\nnn:&Husk passordet for dette dokumentet\nno:&Husk passordet for dette dokumentet\npl:Pamiętaj &hasło dla tego dokumentu\npt:&Lembrar palavra-passe deste documento\nro:&Reține parola acestui document\nru:Запомнит&ь пароль для этого документа\nsi:මෙම ගොනුව සදහා මුරපදය &මතක තබාගන්න\nsk:&Zapamätať si heslo pre tento dokument\nsl:&Zapomni si geslo za ta dokument\nsp-rs:Zapamti lozinku za ovaj dokument\nsq:&Mbaj mend fjalëkalimin për këtë dokument\nsr-rs:Запамти лозинку за овај документ\nsv:&Minns lösenordet för detta dokument\nta:கடவுச்சொல்லை நினைவில் வை\ntl:Tandaan ang password para sa dokumentong ito\ntr:Bu belge için şifreyi &hatırla\ntw:記憶此文件的密碼(&R)\nuk:Пам'ятати пароль для даного документа\nuz:&Ushbu hujjatning maxfiy so'zini eslab qolish\nvn:Nhớ mật khẩu cho tập tin này\n:&Remember these settings for each document\nam:Հիշել այս կարգավորումները &բոլոր ֆայլերի համար\nar:&تذكر هذه الإعدادات لكل وثيقة\naz:Bu &parametrləri bütün sənədlər üçün yadda saxla\nbg:Запази &настройките за всеки документ\nbr:Lembrar estas preferências para cada documento\nbs:&Upamti ove postavke za svaki pojedini dokument\nby:Запомніць гэтыя параметры для &кожнага дакумента\nca-xv:Conserva estes &preferències per a cada document\nca:Conserva aquestes &preferències per a cada document\ncn:为每一个文档记住这些设置(&R)\ncy:C&ofio'r gosodiadau hyn ar gyfer pob dogfen\ncz:&Pamatovat si tato nastavení pro každý dokument\nde:Ansicht-&Einstellungen für jedes Dokument einzeln merken\ndk:&Husk disse indstillinger for hvert dokument\nel:&Απομνημόνευση ρυθμίσεων για κάθε έγγραφο\nes:&Recordar esta configuración para todos los documentos\net:Dokumendi sulgemisel jäetakse &meelde küljendi sätted\neu:G&ogoratu ezarpen hauek agiri bakoitzerako\nfa:این تنظیمات را برای همه‌ی اسناد به &خاطر بسپار\nfi:&Muista nämä asetukset jokaiselle asiakirjalle\nfr:&Se rappeler ces paramètres pour chaque document\nfy-nl:&Bewarje dizze ynstellingen foar elk dokumint\nga:Cuimhnigh ar na socruithe seo do gach cáipéis\ngl:&Lembrar estes axustes para cada documento\nhe:קבע הגדרות אלו לכל הקבצים\nhi:प्रत्येक दस्तावेज़ के लिए इन सेटिंग्स को &याद रखें\nhr:&Upamti ove postavke za svaki pojedini dokument\nhu:Eltérő nézetbeállítások megjegyzése dokumentumonként\nid:&Ingat pengaturan ini untuk setiap dokumen\nit:&Ricorda queste impostazioni per ogni documento\nja:ドキュメントごとにこれらの設定を記憶する(&R)\nka:ამ პარამეტრების ყველა დოკუმენტზე &მორგება\nkr:각 문서의 설정 기억(&R)\nku:بیرخستنەوەی ئەم هەڵبژاردنە بۆ هەموو بەڵگەنامەکان&\nkw:Gwitha an etholy&ow ma rag pub restren\nlt:Įsiminti šias &nuostatas kiekvienam dokumentui\nlv:&Atcerēties šos iestatījumus katram dokumentam\nmk:&Запомни ги овие поставувања за секој документ\nmy:&Ingat tetapan-tetapan ini untuk setiap dokumen\nne:यी सेटिङहरु प्रत्येक कागजातको लागि &सम्झनुहोस्\nnl:&Bewaar deze instellingen voor elk document\nnn:&Husk innstillingane for kvart dokument\nno:&Husk disse innstillingene for hvert dokument\npl:Pamiętaj ustawienia dla &każdego dokumentu\npt:&Lembrar estas definições para todos os documentos\nro:&Reține aceste opțiuni pentru fiecare document\nru:Запомнит&ь эти параметры для каждого документа\nsi:මෙම සැකසුම් සියලු ගොනු සදහා &මතක තබාගන්න\nsk:&Zapamätať si tieto nastavenia pre každý dokument\nsl:Zapomni si te &nastavitve za vsak dokument\nsp-rs:Zapamti ova podešavanja za svaki pojedinačni dokument\nsq:&Mbaj mend parametrat për çdo dokument\nsr-rs:Запамти ова подешавања за сваки појединачни документ\nsv:Kom ihåg dessa inställningar för &varje dokument\nta:அமைப்புகளை ஞாபகம் கொள்\ntl:Tandaan ang settings ng bawat dokumento\ntr:Bu ayarları her belge için &hatırla\ntw:記憶每個文件的設定值(&R)\nuk:Зберегти налаштування для кожного документа\nuz:&Ushbu parametrlarni har qaysi hujjat uchun eslab qolish\nvn:Nhớ các cài đặt này cho từng tập tin\n:&Remove Document\nam:&Հեռացնել փաստաթուղթը\nar:&إزالة مستند\naz:Sənədi &sil\nbg:&Премахни документ\nbr:&Remover documento\nbs:&Ukloni dokument\nca-xv:&Suprimeix el document\nca:&Suprimeix el document\ncn:删除文件(&R)\ncy:&Tynnu Dogfen\ncz:Odeb&rat dokument\nde:Von dieser Seite &entfernen\ndk:&Fjern dokument\nel:&Απόκρυψη εγγράφου\nes:Elimina&r documento\net:&Kustuta dokument\neu:&Kendu Agira\nfa:سند را &حذف کن\nfi:&Poista asiakirja\nfr:&Retirer le document de la liste\nga:&Bain cáipéis\ngl:&Borrar documento\nhe:הסר קובץ\nhi:दस्तावेज़ को &निकालें\nhr:&Ukloni dokument\nhu:&Eltávolítás a listából\nid:&Hapus Dokumen\nit:&Non ricordare documento\nja:ドキュメントの削除(&R)\nka:დოკუმენტის &წაშლა\nkr:고정 문서 제거(&R)\nku:لابردنی بەڵگەنامە&\nlt:Pa&šalinti dokumentą\nlv:&Noņemt dokumentu\nmk:Отстрани документ\nmy:&Buang dokumen\nne:कागजात &हटाउनुहोस्\nnl:Document ve&rwijderen\nnn:&Fjern dokument\nno:&Fjern dokument\npl:&Usuń dokument\npt:Remover doc&umento\nro:Înlătu&ră document\nru:&Удалить документ\nsk:&Odobrať dokument\nsl:Odstrani dokument\nsp-rs:Ukloni dokument\nsq:&Heq dokumentin\nsr-rs:Уклони документ\nsv:&Ta bort dokument\nta:கோப்பை நீக்கு\ntr:Belgeyi &Kaldır\ntw:移除此縮圖(&R)\nuk:Видалити документ\nuz:&Hujjatni o'chirish\nvn:Gỡ tập tin xuống\n:&Save As...\nam:&Պահպանել որպես\nar:&حفظ باسم...\naz:&Fərqli adla yadda saxla...\nbg:За&пис като...\nbr:&Salvar como...\nbs:&Spasi kao...\nca-xv:Anomena i al&ça...\nca:Anomena i de&sa...\ncn:另存为(&A)...\ncy:&Cadw fel...\ncz:&Uložit jako...\nde:&Speichern unter…\ndk:&Gem som ...\nel:&Αποθήκευση ως...\nes:&Guardar como...\net:Salvesta &kui...\neu:&Gorde Honela...\nfa:&ذخیره کردن با نام...\nfi:Tallenna &nimellä...\nfr:&Enregistrer sous...\nga:&Cuir i dtaisce mar...\ngl:&Gardar como...\nhe:שמור בשם...\nhi:सहेजें &जैसे...\nhr:&Spremi kao...\nhu:&Mentés másként...\nid:Si&mpan Sebagai...\nit:&Salva come...\nja:名前を付けて保存(&S)...\nka:შენახვა &როგორც...\nkr:다른 이름으로 저장(&S)...\nku:پاراستن وەکو...&\nlt:Į&rašyti kaip...\nlv:&Saglabāt kā...\nmk:&Зачувај како...\nmy:&Simpan Sebagai...\nne:ब&चत गर्नुहोस्...\nnl:Op&slaan als...\nnn:&Lagre som...\nno:&Lagre som...\npl:Zapisz jako...\npt:&Gravar como...\nro:&Salvează ca...\nru:Сохранить &как...\nsk:&Uložiť ako...\nsl:Shrani &kot …\nsp-rs:Sačuvaj kao...\nsq:&Ruaj si...\nsr-rs:Сачувај као...\nsv:&Spara som...\nta:எனச் சேமி...\ntl:I-&save bilang...\ntr:&Farklı Kaydet...\ntw:另存為(&A)...\nuk:Зберегти як...\nuz:&Quyidagicha saqlash...\nvn:Lưu thành...\n:&Save As...\\tCtrl+S\naf:&Stoor As\\tCtrl+S\nam:&Պահպանել որպես\\tCtrl+S\nar:&حفظ باسم...\\tCtrl+S\naz:Fərqli adla &yadda saxla...\\tCtrl+S\nbg:За&пис като...\\tCtrl+S\nbn:&সংরক্ষণ এই রূপে...\\tCtrl+S\nbr:&Salvar como...\\tCtrl+S\nbs:&Spasi kao...\\tCtrl+S\nby:Захаваць як...\\tCtrl+S\nca-xv:Anomena i al&ça...\\tCtrl+S\nca:Anomena i de&sa...\\tCtrl+S\ncn:另存为(&A)...\\tCtrl+A\ncy:&Cadw fel...\\tCtrl+S\ncz:&Uložit jako...\\tCtrl+S\nde:Speichern &unter…\\tStrg+S\ndk:&Gem som ...\\tCtrl+S\nel:&Αποθήκευση ως...\\tCtrl+S\nes:&Guardar como...\\tCtrl+S\net:Salvesta &kui...\\tCtrl+S\neu:&Gorde Honela...\\tKtrl+S\nfa:&ذخیره کردن با نام...\\tCtrl+S\nfi:Tallenna &nimellä...\\tCtrl+S\nfr:&Enregistrer sous...\\tCtrl+S\nfy-nl:&Bewarje as...\\tCtrl+S\nga:Cuir i dtaisce mar...\\tCtrl+S\ngl:&Gardar como...\\tCtrl+S\nhe:שמור בשם...\\tCtrl+S\nhi:इस तरह संभालें(&S)\\tCtrl+S\nhr:&Spremi kao...\\tCtrl+S\nhu:Ment&és másként...\\tCtrl+S\nid:&Simpan Sebagai...\\tCtrl+S\nit:&Salva con nome...\\t<Ctrl>+S\nja:名前を付けて保存(&S)...\\tCtrl+S\nka:შენახვა &როგორც...\\tCtrl+S\nkr:다른 이름으로 저장(&S)...\\tCtrl+S\nku:&پاراستن وەکو...\\tCtrl+S\nkw:&Gwitha avel...\\tCtrl+S\nlt:Į&rašyti kaip...\\tCtrl+S\nlv:&Saglabāt kā...\\tCtrl+S\nmk:&Зачувај како...\\tCtrl+S\nml:എന്ന പേരില്‍ സൂക്ഷിക്കുക...\\tCtrl+S\nmm:&ကဲ့သို့ သိမ်းပါ.....\\tCtrl+S\nmy:&Simpan sebagai...\\tCtrl+S\nne:ब&चत गर्नुहोस्...\\tCtrl+S\nnl:&Opslaan als...\\tCtrl+S\nnn:Lagre &som...\\tCtrl+S\nno:Lagre &som...\\tCtrl+S\npa:ਇੰਝ ਸੰਬਾਲੋ(&S)...\\tCtrl+S\npl:Zapisz &jako...\\tCtrl+S\npt:&Gravar como...\\tCtrl+S\nro:Salvare c&a...\\tCtrl+S\nru:Сохранить &как...\\tCtrl+S\nsi:ලෙස &සුරකින්න... (A)\\tCtrl+S\nsk:Uložiť ako...\\tCtrl+S\nsl:Shrani &kot …\\tCtrl+S\nsn:&Sevha se...\\tCtrl+S\nsp-rs:Sačuvaj kao...\\tCtrl+S\nsq:&Ruaj si...\\tCtrl+S\nsr-rs:Сачувај као...\\tCtrl+S\nsv:Spara so&m...\\tCtrl+S\nta:எனச் சேமி...\\tCtrl+S\nth:บันทึกเป็น...\\tCtrl+S\ntl:I-save Bilang...\\tCtrl+S\ntr:&Farklı kaydet...\\tCtrl+S\ntw:另存為(&A)...\\tCtrl+A\nuk:Зб&ерегти як...\\tCtrl+S\nuz:&Quyidagicha saqlash...\\tCtrl+S\nvn:Lưu thành...\\tCtrl+S\n:&Settings\nam:&Կարգավորումներ\nar:&الإعدادات\naz:&Parametrlər\nbg:&Настройки\nbr:&Preferências\nbs:&Postavke\nby:Налады\nca-xv:&Preferències\nca:&Preferències\ncn:设置(&S)\ncy:&Gosodiadau\ncz:&Nastavení\nde:&Einstellungen\ndk:&Indstillinger\nel:&Ρυθμίσεις\nes:&Configuración\net:Sea&distused\neu:&Ezarpenak\nfa:&تنظیمات\nfi:&Asetukset\nfr:&Préférences\nfy-nl:&Ynstellingen\nga:&Socruithe\ngl:&Axustes\nhe:&אפשרויות\nhi:&सेटिंग्स\nhr:&Postavke\nhu:&Beállítások\nid:&Pengaturan\nit:Impo&stazioni\nja:設定(&S)\nka:&გამართვა\nkr:설정(&S)\nku:ڕێکخستنەکان&\nkw:&Settyansow\nlt:&Nuostatos\nlv:&Iestatījumi\nmk:&Поставувања\nmy:&Tetapan\nne:&सेटिङहरू\nnl:&Instellingen\nnn:&Innstillingar\nno:&Alternativer\npl:&Ustawienia\npt:&Definições\nro:&Opțiuni\nru:&Настройки\nsi:සැකසුම් (E)\nsk:&Nastavenia\nsl:&Nastavitve\nsp-rs:Podešavanja\nsq:&Parametrat\nsr-rs:Подешавања\nsv:Alternati&v\nta:அமைப்புகள்\ntl:Mga Setting\ntr:&Ayarlar\ntw:設定值(&S)...\nuk:Налаштування\nuz:&Moslamalar\nvn:Cài đặt\n:&Shrink pages to printable area (if necessary)\nam:&Հարմարեցնել էջը տպելու համար (եթե պահանջվում է)\nar:(تقليص الصفحات إلى منطقة قابلة للطباعة (إذا لزم الأمر& \naz:Ehtiyac varsa, səhifələri çap sahəsinin ölçüsünə görə kiçilt\nbg:&Намали страниците в мястото за отпечатване (при необходимост)\nbr:Reduzir página&s à área de impressão (se necessário)\nbs:Umanji stranice na područje za štampu (ako je potrebno)\nca-xv:&Reduïu les pàgines a l'àrea imprimible (si és necessari)\nca:&Reduïu les pàgines a l'àrea imprimible (si és necessari)\ncn:缩小页面到可打印区域 (如果需要) (&S)\ncy:C&rebachu tudalennau i'r ardal argraffu (os oes angen)\ncz:&Zmenšit stránky na tisknutelnou plochu (v případě potřeby)\nde:Seiten auf Druckbereich &verkleinern (falls nötig)\ndk:&Formindsk sider til udskriftsområdet (hvis nødvendigt)\nel:Σμίκρυνση σελίδων σε &εκτυπώσιμη περιοχή (αν χρειάζεται)\nes:&Reducir páginas hasta llegar al área imprimible (si es necesario)\net:Mahuta leheküljed pr&inditavale alale (kui vaja)\neu:&Txikitu orrialdeak eremu irarkigarrira (beharrezkoa bada)\nfa:صفحات را متناسب با ناحیه‌ی قابل چاپ روی کاغذ &جمع و جور کن (اگر لازم است)\nfi:P&ienennä sivut tulostettavalle alueelle (jos tarpeellista)\nfr:&Réduire les pages à la zone d'impression (si nécessaire)\nga:&Crap na leathanaigh go limistéar inchlóbhuailte (más gá)\ngl:&Reducir páxinas á área imprimible (se for necesario)\nhe:כווץ עמודים לגודל אזור ההדפסה (אם נדרש)\nhi:पृष्ठों को छपाई योग्य क्षेत्र &में सिकोड़ें (यदि आवश्यक हो)\nhr:Smanji stranice do područja za ispis (ako je potrebno)\nhu:Oldalak széleinek levágása a nyomtatható méretre\nid:&Perkecil halaman ke area cetakan (jika dibutuhkan)\nit:Riduci pagine alla zona &stampabile (se necessario)\nja:必要な場合はページを印刷可能領域に縮小する(&S)\nka:გვერდების შემცირება ბეჭდვად არეში ჩასატევად (თუ საჭიროა)\nkr:(필요한 경우,) 인쇄 영역에 맞춰 페이지 축소(&S)\nku:(کورتکردنەوەی پەڕەکان بۆ شوێنی چاپکردن (ئەگەر پێویست بوو&\nlt:&Sumažinti puslapių dydį iki spausdinamo ploto (jei reikia)\nlv:&Samazināt lappuses līdz apdrukājamai zonai (ja ir nepieciešams)\nmk:&Намали страници според зона за печатење (ако е потребно)\nmy:&Kecilkan muka surat ke kawasan cetak (jika perlu)\nne:पृष्ठहरुलाई छाप्नयोग्य क्षेत्रमा &खुम्च्याउनुहोस् (आवस्यक परेमा)\nnl:Pagina's verkleinen tot afdrukgebied (indien nodig)\nnn:&Krymp sider til utskrivbart område (hvis nødvendig)\nno:&Krymp sider til utskriftsområde (om nødvendig)\npl:&Zmniejsz strony do rozmiaru wydruku (w razie potrzeby)\npt:&Reduzir páginas à área de impressão (se necessário)\nro:&Micșorează paginile la aria de imprimare (dacă e necesar)\nru:Уменьшить страницы до области печати (если нужно)\nsi:මෘද්‍රණ කළාපයේ පිටු &හකුලුවන්න (ඇවැසිනම්)\nsk:&Zmenšiť strany na tlačiteľnú plochu (ak je to potrebné)\nsl:&Skrči strani na področje tiskanja (če potrebno)\nsp-rs:Skupi stranice na oblast štampanja (ukoliko je neophodno)\nsq:&Ngjesh faqet në hapësirën e printuar (sipas nevojës)\nsr-rs:Скупи странице на област штампања (уколико је неопходно)\nsv:&Krymp sidor (om nödvändigt) så de ryms\nta:கோப்பை அச்சிடும் அளவிற்கு சுருக்கு (தேவைபட்டால்)\ntl:Paliitin ang pahina sa printable na area (kung kinakailangan)\ntr:Sayfaları baskı alanına &indirgele (gerekirse)\ntw:如有需要，縮小頁面符合可列印區域(&S)\nuk:Урізати сторінки до зони друку (при необхідності)\nuz:&Betlarni printerga moslab kichraytirish (zarur bo'lganda)\nvn:Nén vừa trang in (nếu cần thiết)\n:&Single Page\\tCtrl+6\nam:&Մեկ էջով\\tCtrl+6\nar:&صفحة واحدة\\tCtrl+6\naz:&Tək səhifə\\tCtrl+6\nbg:&Една страница\\tCtrl+6\nbr:Página única\\tCtrl+6\nbs:&Jedna stranica\\tCtrl+6\nca-xv:Pàgina ú&nica\\tCtrl+6\nca:Pàgina ú&nica\\tCtrl+6\ncn:单页模式(&S)\\tCtrl+6\ncy:Tudalen &Unigol\\tCtrl+6\ncz:&Jedna stránka\\tCtrl+6\nde:&Einzelne Seite\\tStrg+6\ndk:&Enkelt side\\tCtrl+6\nel:&Μονή σελίδα\\tCtrl+6\nes:Página única\\tCtrl+6\net:Ü&heleheküljeline\\tCtrl+6\neu:&Orrialde Bakarra\\tKtrl+6\nfa:&تک صفحه‌ای\\tCtrl+6\nfi:&Yksittäinen sivu\\tCtrl+6\nfr:Une &seule page\\tCtrl+6\nga:&Leathanach amháin\\tCtrl+6\ngl:Unha &soa páxina\\tCtrl+6\nhe:עמוד יחיד\\tCtrl+6\nhi:&एकल पृष्ठ\\tCtrl+6\nhr:&Jedna stranica\\tCtrl+6\nhu:&Egyoldalas\\tCtrl+6\nid:Halaman &Tunggal\\tCtrl+6\nit:Pagina &singola\\t<Ctrl>+6\nja:単一ページ(&S)\\tCtrl+6\nka:&თითო გვერდად\\tCtrl+6\nkr:한 페이지씩(&S)\\tCtrl+6\nku:پەڕەی تاک&\\tCtrl+6\nlt:&Vienas puslapis\\tCtrl+6\nlv:&Viena lappuse\\tCtrl+6\nmk:Единечна страница\\tCtrl+6\nmy:&Halaman Tunggal\\tCtrl+6\nne:&एकल पृष्ठ\\tCtrl+6\nnl:&Enkele pagina\\tCtrl+6\nnn:&Enkeltside\\tCtrl+6\nno:&Enkeltside\\tCtrl+6\npl:&Pojedyncza strona\\tCtrl+6\npt:Uma &página\\tCtrl+6\nro:O &singură pagină\\tCtrl+6\nru:&Постранично\\tCtrl+6\nsk:&Jedna strana\\tCtrl+6\nsl:&Enostransko\\tCtrl+6\nsp-rs:Pojedinačna stranica\\tCtrl+6\nsq:&Njëfletësh\\tCtrl+6\nsr-rs:Појединачна страница\\tCtrl+6\nsv:&Enkel sida\\tCtrl+6\nta:ஒற்றைப் பக்கம்\\tCtrl+6\ntr:&Tek Sayfa\\tCtrl+6\ntw:單頁模式(&S)\\tCtrl+6\nuk:Одна сторінка\\tCtrl+6\nuz:&Bitta betdan\\tCtrl+6\nvn:Trang đơn\\tCtrl+6\n:&Skip this version\naf:Slaan Dié Weergawe Oor.\nam:&Բաց թողնել այս տարբերակը\nar:&تخطي هذا الإصدار\naz:Bu &versiyanı burax\nbg:&Пропусни тази версия\nbn:এই সংস্করণটি পরিহার করুন\nbr:Ignorar esta versão\nbs:&Propusti ovu verziju.\nby:Прапусціць гэту версію.\nca-xv:&Omet esta versió\nca:&Omet aquesta versió\ncn:跳过此版本(&S)\ncy:&Hepgor y fersiwn yma.\ncz:&Přeskočit tuto verzi\nde:&Diese Version überspringen.\ndk:&Spring over denne version\nel:&Παράβλεψη αυτής της έκδοσης\nes:&Ignorar esta versión\net:&Jäta see versioon vahele\neu:&Ahaztu bertsio hau\nfa:از این نسخه &چشم‌پوشی کن\nfi:&Ohita tämä versio\nfr:&Ignorer cette version\nfy-nl:Dizze ferzje oerslaan\nga:&Ná bac leis an leagan seo\ngl:Ignorar esta versión\nhe:דלג על גרסה זו\nhi:इस संसकरण को छोडो\nhr:&Propusti ovu inačicu.\nhu:Verzió kihagyása\nid:&Lewatkan versi ini\nit:&Ignora questa versione\nja:このバージョンをスキップする(&S)\nka:ამ ვერსიის გამოტოვება\nkr:이 버전 건너뛰기(&S)\nku:فەرامۆشکردنی ئەم وەشانە&\nkw:&Tremena an versyon ma\nlt:Pralei&sti šią versiją\nlv:&Izlaist šo versiju\nmk:&Прескокни ја оваа верзија\nmm:ဒီအမျိုးအစား ကိုရှောင်မည်။\nmy:&Langkau versi ini\nne:यो संस्करणलाई & छोड्नुहोस्\nnl:Deze versie overslaan\nnn:Hopp over denne versjonen\nno:&Ignorer denne versjonen\npa:ਇਸ ਵਰਜਨ ਨੂੰ ਛਡੋ\npl:&Pomiń tę wersję\npt:Ignorar &esta versão\nro:&Sari peste această versiune\nru:Пропустить эту версию\nsi:මෙම වෙළුම &මගහරින්න\nsk:&Preskočiť túto verziu\nsl:&Preskoči to različico\nsn:Siyana neversion irori.\nsp-rs:Preskoči ovu verziju\nsq:&Shmang këtë versionin\nsr-rs:Прескочи ову верзију\nsv:Hoppa över denna version\nta:இப்பதிப்பை தவிர்\nth:ช้ามเวอร์ชั่นนี้ไป\ntl:Laktawan ang bersyong ito\ntr:Bu s&ürümü atla\ntw:略過此版本(&S)\nuk:Пропустити цю версію.\nuz:&Ushbu versiyani o'tkazib yuborish\nvn:Bỏ qua phiên bản này.\n:&Use original page sizes\nam:&Օգտագործել էջերի իրական չափը\nar:&استخدام الحجم الأصلي للصفحة\naz:Səhifələrin &həqiqi ölçüsü\nbg:Използване на &оригиналните размери на страниците\nbr:&Usar tamanhos de página originais\nbs:Koristi &originalne veličine stranica\nca-xv:&Usa la mida de pàgina original\nca:&Usa la mida de pàgina original\ncn:使用原始页面大小(&U)\ncy:&Defnyddio maint gwreiddiol y dudalen\ncz:Po&užít původní velikost stránky\nde:Seitengröße &nicht anpassen\ndk:&Brug originale sidestørrelser\nel:&Χρησιμοποίηση μεγέθους αρχικών σελίδων\nes:&Usar el tamaño original de la página\net:&Kasuta algseid lehekülje suuruseid\neu:E&rabili jatorrizko orrilde neurria\nfa:اندازه‌ی &واقعی صفحات را به کار بگیر\nfi:&Käytä alkuperäisiä sivukokoja\nfr:&Utiliser les dimensions d'origine\nga:&Bain feidhm as méideanna bunaidh an leathanaigh\ngl:&Usar tamaños de páxina orixinais\nhe:השתמש במידות עמוד מקוריות\nhi:वास्तविक पृष्ठ आकार का उपयोग(&U) करें\nhr:Koristi &originalne veličine stranica\nhu:Eredeti oldalméret használata\nid:&Gunakan ukuran halaman sebenarnya\nit:&Usa larghezza pagina originale\nja:元のページ サイズを使用する(&U)\nka:&გვერდების ორიგინალი ზომის გამოყენება\nkr:원래 페이지 크기 사용(&U)\nku:بەکارهێنانی قەبارەی ڕاستەقینەی پەڕەکان&\nlt:Na&udoti originalius puslapių dydžius\nlv:&Lietot sākotnējos lappušu izmērus\\n\nmk:&Користи оригинални димензии на страници\nmy:&Gunakan saiz halaman asal\nne:&मौलिक पृष्ठ साईज प्रयोग गर्नुहोस्\nnl:Originele paginagrootte gebruiken\nnn:&Bruk opprinnelige sidestorleikar\nno:&Benytt opprinnelige sidestørrelser\npl:Użyj &oryginalnego rozmiaru stron\npt:&Utilizar tamanho original\nro:&Utilizează mărimile originale ale paginii\nru:&Исходный размер страниц\nsi:&සෑබෑ පිටු ප්‍රමාණය යොදන්න\nsk:Použiť originálne veľkosti strán\nsl:&Uporabi izvirno velikost strani\nsp-rs:Upotrebi originalne veličine stranica\nsq:&Përdor përmasat origjinale të fletës\nsr-rs:Употреби оригиналне величине страница\nsv:Använd u&rsprunglig sidstorlek\nta:மூல பக்க அளவுகளை உபயோகி\ntl:Gamitin ang orihinal na laki ng mga pahina\ntr:Orijinal sayfa boyutlarını &kullan\ntw:使用頁面原始大小(&S)\nuk:Використовувати оригінальні розміри сторінки\nuz:&Betlarning asl o'lchamlarini ishlatish\nvn:Sử dụng kích thước trang gốc\n:&View\naf:&Vertoon\nam:&Տեսք\nar:&العرض\naz:&Görüntü\nbg:&Изглед\nbn:দর্শন\nbr:&Ver\nbs:&Prikaz\nby:Выгляд\nca-xv:&Visualitza\nca:&Visualitza\ncn:视图(&V)\ncy:&Gweld\ncz:&Zobrazit\nde:&Ansicht\ndk:&Vis\nel:&Προβολή\nes:&Ver\net:&Vaade\neu:I&kusi\nfa:&نمایش\nfi:&Näytä\nfr:&Affichage\nfy-nl:&Byld\nga:&Amharc\ngl:&Ver\nhe:&תצוגה\nhi:देखें(&V)\nhr:&Pogled\nhu:&Nézet\nid:&Tampilan\nit:&Visualizza\nja:表示(&V)\nka:&ხედი\nkr:보기(&V)\nku:پیشاندان&\nkw:&Gweles\nlt:&Rodymas\nlv:&Skats\nmk:&Поглед\nml:കാഴ്ച്ച\nmm:&မြင်ကွင်း\nmy:&Lihat\nne:&हेर्नुहोस्\nnl:&Beeld\nnn:&Vis\nno:&Visning\npa:ਵੇਖੋ(&V)\npl:&Widok\npt:&Ver\nro:&Vizualizare\nru:&Вид\nsi:&දසුන (V)\nsk:&Zobraziť\nsl:&Pogled\nsn:&Maonero\nsp-rs:Prikaz\nsq:&Pamje\nsr-rs:Приказ\nsv:Vi&sa\nta:நோக்கு\nth:มุมมอง\ntl:Tignan\ntr:Gös&ter\ntw:檢視(&V)\nuk:Ви&гляд\nuz:&Ko'rish\nvn:Hiển thị\n:&Window\nam:&Պատուհան\nar:النافذة&\naz:&Pəncərə\nbr:&Janela\nbs:&Prozor\nca-xv:&Finestra\nca:&Finestra\ncn:窗口(&W)\ncy:&Ffenestr\ncz:&Okno\nde:Fe&nster\ndk:&Vindue\nel:Παρά&θυρο\nes:V&entana\net:A&ken\neu:Lei&hoa\nfa:&پنجره\nfi:Ikkuna\nfr:F&enêtre\nga:&Fuinneog\ngl:&Xanela\nhe:&חלון\nhr:P&rozor\nhu:&Ablak\nid:&Jendela\nit:&Finestra\nja:ウィンドウ(&W)\nkr:창(&W)\nku:&پەنجەرە\nlv:&Logs\nmk:&Прозорец\nnl:&Venster\nnn:&Vindu\nno:&Vindu\npl:&Okno\npt:&Janela\nru:&Окно\nsk:&Okno\nsl:&Okno\nsp-rs:P&rozor\nsr-rs:П&розор\nsv:Fönster\ntr:&Pencere\ntw:視窗(&W)\nuk:&Вікно\nuz:&Oyna\nvn:&Cửa sổ\n:&Yes\nam:&Այո\nar:&نعم\naz:&Bəli\nbg:&Да\nbr:&Sim\nbs:&Da\nby:Да\nca-xv:&Sí\nca:&Sí\ncn:是(&Y)\ncy:&Iawn\ncz:&Ano\nde:&Ja\ndk:&Ja\nel:&Ναι\nes:&Sí\net:&Jah\neu:&Bai\nfa:&بلی\nfi:&Kyllä\nfr:&Oui\nfy-nl:&Ja\nga:&Déan sin\ngl:&Si\nhe:כן\nhi:हां(&Y)\nhr:&Da\nhu:&Igen\nid:&Ya\nit:&Sì\nja:はい(&Y)\nka:&დიახ\nkr:예(&Y)\nku:بەڵێ&\nkw:&Ya\nlt:&Taip\nlv:&Jā\nmk:&Да\nmy:&Ya\nne:&ठिक\nnl:&Ja\nnn:&Ja\nno:&Ja\npl:&Tak\npt:&Sim\nro:&Da\nru:&Да\nsi:&ඔව්\nsk:&Áno\nsl:&Da\nsp-rs:Da\nsq:&Po\nsr-rs:Да\nsv:&Ja\nta:ஆம்\ntl:Oo\ntr:&Evet\ntw:是(&Y)\nuk:Так\nuz:&Ha\nvn:Đồng ý\n:&Zoom\naf:&Zoem\nam:&Դիտափոխել\nar: تكبير/تصغير&\naz:&Miqyas\nbg:&Увеличение\nbn:&বিবর্ধন\nbr:&Zoom\nbs:&Uvećaj\nby:Памер\nca-xv:&Escalat\nca:&Escalat\ncn:缩放(&Z)\ncy:&Chwyddo\ncz:Z&většení\nde:&Zoom\ndk:&Zoom\nel:&Ζουμ\nes:&Zoom\net:&Suurendus\neu:&Zooma\nfa:&بزرگنمایی\nfi:&Zoomaus\nfr:&Zoom\nfy-nl:&Zoom\nga:&Formhéadú\ngl:&Aumento\nhe:&זום\nhi:&बडा करें\nhr:&Uvećaj\nhu:&Nagyítás\nid:&Ukuran\nit:&Ingrandimento\nja:ズーム(&Z)\nka:მას&შტაბი\nkr:배율(&Z)\nku:نزیک خستنەوە&\nkw:&Zoum\nlt:&Mastelis\nlv:&Tālummaiņa\nmk:&Зумирање\nml:വലുതാക്കുക\nmm:ချဲ့ထွင်\nmy:&Fokus\nne:&आकार परिवर्तन\nnl:&Zoom\nnn:&Zoom\nno:&Zoom\npa:ਵੱਡਾ ਕਰੋ(&Z)\npl:Po&większenie\npt:&Ampliação\nro:&Mărime\nru:Мас&штаб\nsi:&විශාලනය (Z)\nsk:&Zväčšenie\nsl:Po&večava\nsn:&Zuma\nsp-rs:Uvećanje\nsq:&Shkalla\nsr-rs:Увећање\nsv:&Zoom\nta:பெரிதாக்கு\nth:ขยาย\ntl:Palakihin/paliitin\ntr:&Yakınlaştırma\ntw:縮放(&Z)\nuk:&Збільшення\nuz:&Miqyos\nvn:Thu-&Phóng\n:(of %d)\nam:(%d-ից)\nar:(من %d)\naz:/ %d\nbg:(от %d)\nbr:(de %d)\nbs:(od %d)\nby:(з %d)\nca-xv:(de %d)\nca:(de %d)\ncn:(%d 页中的)\ncy:(o %d)\ncz:(z %d)\nde:(von %d)\ndk:(af %d)\nel:(από %d)\nes:(de %d)\net:(%d:st)\neu:(%d-tik)\nfa:(از %d)\nfi:(%d:stä)\nfr:(de %d)\nfy-nl:(fan %d)\nga:(as %d)\ngl:(de %d)\nhe:(מתוך %d)\nhi:(का %d)\nhr:(od %d)\nhu:(a %d-ból)\nid:(dari %d)\nit:(di %d)\nja:(%d 中)\nka:(დან %d)\nkr:(/ %d)\nku:(لە %d)\nkw:(a %d)\nlt:(iš %d)\nlv:(no %d)\nmk:(од %d)\nmy:(dari %d)\nne:(कुल %d मध्ये)\nnl:(van %d)\nnn:(av %d)\nno:(av %d)\npl:(z %d)\npt:(de %d)\nro:(de %d)\nru:(из %d)\nsi:(ගේ %d)\nsk:(z %d)\nsl:(od %d)\nsp-rs:(od %d)\nsq:(nga %d)\nsr-rs:(од %d)\nsv:(av %d)\nta:(இன் %d)\ntl:(ng %d)\ntr:(toplam %d)\ntw:（共 %d 頁）\nuk:(з %d)\nuz:(%d dan)\nvn:(trên %d)\n:(page %s)\nam:(էջ %s)\nar:(الصفحة %s)\naz:(səh. %s)\nbg:(страница %s)\nbr:(página %s)\nbs:(strana %s)\nca-xv:(pàgina %s)\nca:(pàgina %s)\ncn:(第 %s 页)\ncy:(tudalen %s)\ncz:(stránka %s)\nde:(Seite %s)\ndk:(side %s)\nel:(σελίδα %s)\nes:(página %s)\net:(lehekülg %s)\neu:(%s orrialdea)\nfa:(صفحه‌ی %s)\nfi:(sivu %s)\nfr:(page %s)\nga:(leathanach a %s)\ngl:(páxina %s)\nhe:(עמוד %s)\nhi:(पृष्ठ %s)\nhr:(stranica %s)\nhu:(%s. oldal)\nid:(halaman %s)\nit:(pagina %s)\nja:(ページ %s)\nka:(გვერდი %s)\nkr:(%s 페이지)\nku:(پەڕە %s)\nlt:(%s psl.)\nlv:(lappuse %s)\nmk:(страница %s)\nmy:(halaman %s)\nne:(पृष्ठ %s)\nnl:(pagina %s)\nnn:(side %s)\nno:(side %s)\npl:(strona %s)\npt:(página %s)\nro:(pagina %s)\nru:(стр. %s)\nsk:(strana %s)\nsl:(stran %s)\nsp-rs:(%s. stranica)\nsq:(faqja %s)\nsr-rs:(%s. страница)\nsv:(sida %s)\nta:(பக்கம் %s)\ntr:(sayfa %s)\ntw:(第 %s 頁)\nuk:(сторінка %s)\nuz:(bet %s)\nvn:(trang %s)\n:About SumatraPDF\naf:Omtrent SumatraPDF\nam:SumatraPDF-ի մասին\nar:حول SumatraPDF\naz:SumatraPDF haqqında\nbg:За SumatraPDF\nbn:সুমাত্রাপিডিএফ-এর সম্পর্কে\nbr:Sobre o SumatraPDF\nbs:O SumatraPDF\nby:Аб SumatraPDF\nca-xv:Quant al SumatraPDF\nca:Quant al SumatraPDF\ncn:关于 SumatraPDF\ncy:Ynghylch SumatraPDF\ncz:O programu SumatraPDF\nde:Über SumatraPDF\ndk:Om SumatraPDF\nel:Σχετικά με το SumatraPDF\nes:Acerca de SumatraPDF\net:Info SumatraPDF kohta\neu:SumatraPDF-ri buruz\nfa:درباره‌ی برنامه‌ی SumatraPDF\nfi:Tietoja SumatraPDF:stä\nfr:À propos de SumatraPDF\nfy-nl:Oer SumatraPDF\nga:Maidir le SumatraPDF\ngl:Acerca do SumatraPDF\nhe:אודות SumatraPDF\nhi:Sumatra PDF के बारे में\nhr:O SumatriPDF\nhu:A SumatraPDF névjegye\nid:Tentang SumatraPDF\nit:Informazioni su SumatraPDF\nja:SumatraPDF のバージョン情報\njv:Babagan SumatraPDF\nka:SumatraPDF-ის შესახებ\nkr:SumatraPDF 정보\nku:SumatraPDF دەربارەی\nkw:A-dro dhe SumatraPDF\nlt:Apie „SumatraPDF“\nlv:Par SumatraPDF\nmk:За SumatraPDF\nml:സുമാത്രാപിഡീഎഫിനെപ്പറ്റി\nmm:စူမာတရာ အကြောင်း\nmy:Mengenai SumatraPDF\nne:SumatraPDF बारेमा\nnl:Over SumatraPDF\nnn:Om SumatraPDF\nno:Om SumatraPDF\npa:Sumatra ਬਾਰੇ\npl:O SumatraPDF\npt:Sobre o SumatraPDF\nro:Despre SumatraPDF\nru:О программе SumatraPDF\nsi:SumatraPDF පිළිබඳව\nsk:O programe SumatraPDF\nsl:O programu SumatraPDF\nsn:NezveSumatraPDF\nsp-rs:O programu SumatraPDF\nsq:Për SumatraPDF\nsr-rs:О програму SumatraPDF\nsv:Om SumatraPDF\nta:சுமத்ராPDF பற்றி\nth:เกี่ยวกับ SumatraPDF\ntl:Tungkol sa SumatraPDF\ntr:SumatraPDF hakkında\ntw:關於 SumatraPDF\nuk:Про програму SumatraPDF\nuz:SumatraPDF haqida\nvn:Giới thiệu SumatraPDF\n:Add Favorite\nam:Ավելացնել ընտրյալներին\nar:اضافة للمفضلة\naz:Seçilmişlərə əlavə et\nbg:Добавяне към любимите\nbn:প্রিয় যোগ করুন\nbr:Adicionar Favorito\nbs:Dodaj favorit\nby:Дадаць у Выбранае\nca-xv:Afegix un preferit\nca:Afegeix un preferit\ncn:添加收藏夹(&A)\ncy:Ychwanegu Ffefryn\ncz:Přidat oblíbenou položku\nde:Favoriten hinzufügen\ndk:Tilføj bogmærke\nel:Προσθήκη αγαπημένου\nes:Añadir favorito\net:Lisa lemmik\neu:Gehitu Gogokoena\nfa:افزودن به علاقه‌مندی‌ها\nfi:Lisää suosikki\nfr:Ajouter aux favoris\nga:Cuir ceanán leis\ngl:Engadir favorito\nhe:הוספת מועדף\nhi:पसंदीदा सूचि जोड़ें\nhr:Dodaj favorita\nhu:Hozzáadás a kedvencekhez\nid:Tambah Favorit\nit:Aggiungi ai Preferiti\nja:お気に入りに追加\njv:Nambah Favorit\nka:რჩეულებში დამატება\nkr:즐겨찾기 추가.\nku:زیادکردنی بۆ لیستی پەسەندەکان\nlt:Sukurti žymą\nlv:Pievienošana izlasei\nmk:Додај омилен\nml:പ്രീയപ്പെട്ടതായി ചേര്‍ക്കുക\nmy:Tambah pada Kegemaran\nne:मनपर्नेमा थप्नुहोस्\nnl:Voeg Favoriet toe\nnn:Legg til ein favoritt\nno:Legg til i Favoritter\npl:Dodaj do ulubionych\npt:Adicionar favorito\nro:Adaugă ca favorit\nru:Добавить \"Избранное\"\nsi:ප්‍රියතම  ගොන්නට දමන්න\nsk:Pridať obľúbenú položku\nsl:Dodaj Priljubljene\nsp-rs:Dodavanje u odabir\nsq:Shënoj te pëlqimet\nsr-rs:Додавање у одабир\nsv:Lägg till favorit\nta:விருப்பகளில்  சேர்\nth:เพิ่มรายการโปรด\ntr:Sık kullanılanlara ekle\ntw:加入最愛(&A)\nuk:Додати закладку\nuz:Tanlanganlarga qo'shish\nvn:Thêm Ưa thích\n:Add page %s to favorites\nam:Ավելացնել %s էջը ընտրյալներին\nar:الى المفضلة %s اضافة صفحة\naz:%s. səhifəni seçilmişlərə əlavə et\nbg:Добавяне на страница %s към любимите\nbr:Adicionar página %s aos Favoritos\nbs:Dodaj stranicu %s u favorite\nby:Дадаць старонку %s да выбраных\nca-xv:Afegix la pàgina %s als preferits\nca:Afegeix la pàgina %s als preferits\ncn:添加第 %s 页到收藏夹\ncy:Ychwanegu tudalen %s i'r Ffefrynnau\ncz:Přidat stránku %s k oblíbeným...\nde:Seite %s hinzufügen…\ndk:Tilføj side %s til bogmærker\nel:Προσθήκη της σελίδας %s στα αγαπημένα\nes:Añadir página %s a favoritos\net:Lisa lehekülg %s lemmikutesse\neu:Gehitu %s Orrialdea Gogokoenetara\nfa:افزودن صفحه‌ی %s به علاقه‌مندی‌ها\nfi:&Lisää sivu %s suosikkeihin\nfr:Ajouter la page %s aux favoris\nga:Cuir leathanach a %s le na ceanáin\ngl:Engadir a páxina %s aos favoritos\nhe:הוסף את עמוד מס' %s למועדפים...\nhi:पृष्ठ %s को पसंदीदा सूचि में जोड़े\nhr:Dodaj stranicu %s u favorite\nhu:%s. oldal hozzáadása a kedvencekhez\nid:Tambah Halaman %s Ke Favorit\nit:Aggiungi pagina %s ai Preferiti\nja:ページ %s を追加\njv:Nambah kaca %s ning favorit\nka:%s გვერდის რჩეულებში დამატება\nkr:%s 페이지를 즐겨찾기에 추가\nku:بۆ پەسەندەکان %s زیادکردنی پەڕەی\nlt:Sukurti žymą į %s puslapį\nlv:Pievienot %s lappusi izlasei\nmk:Додај страница %s во омилени\nmy:Tambahkan halaman %s pada kegemaran\nne:पृष्ठ %s लाई मनपर्नेमा थप्नुहोस्\nnl:Voeg pagina %s toe aan favorieten\nnn:Legg til side %s i favorittane\nno:Legg til side %s i favoritter\npl:Dodaj stronę %s do ulubionych\npt:Adicionar página %s aos favoritos\nro:Adaugă pagina %s la favorite\nru:Добавить стр. %s к избранному\nsi:%s වැනි පිටුව ප්‍රියතම ‌ගොන්නට දමන්න\nsk:Pridať stranu %s k obľúbeným\nsl:Dodaj stran %s med priljubljene\nsp-rs:Dodaj stranicu %s među odabrane\nsq:Shënoj faqen %s te pëlqimet\nsr-rs:Додај страницу %s међу одабране\nsv:Lägg till sida %s i favoriter\nta:விருப்பகளில்  பக்கம் %s ஐ சேர்\nth:เพิ่มหน้า %s ไปยังรายการโปรด\ntr:%s no.lu sayfayı sık kullanılanlara ekle\ntw:加入第 %s 頁到最愛\nuk:Додати %s сторінку до закладок\nuz:%s betni Tanlanganlarga qo'shish\nvn:Thêm trang %s vào Ưa thích\n:Add page %s to favorites with (optional) name:\nam:Ավելացնել %s էջը ընտրյալներին հետևյալ անվամբ`\nar:(الى المفضلة مع  اسم (إختياري %s اضافة صفحة:\naz:%s. səhifəni bu (istənilən) adla seçilmişlərə əlavə et:\nbg:Добавяне на страница %s към любимите с име (по избор):\nbr:Adicionar página %s aos Favoritos com outro nome (opcional):\nbs:Dodaj stranicu %s u favorite sa (opcionalnim) nazivom:\nca-xv:Afegix la pàgina %s als preferits amb el nom (opcional):\nca:Afegeix la pàgina %s als preferits amb el nom (opcional):\ncn:以 (可选) 名称添加第 %s 页到收藏夹:\ncy:Ychwanegu tudalen %s i'r ffefrynnau gyda'r enw (dewisiol):\ncz:Přidat stránku %s k oblíbeným s (volitelným) názvem:\nde:Bezeichnung des Favoriten für Seite %s (optional):\ndk:Tilføj side %s til bogmærker med (valgfrit) navn:\nel:Προσθήκη σελίδας %s στα αγαπημένα με (προαιρετικό) όνομα:\nes:Añadir página %s a favoritos con nombre (opcional):\net:Lisa lehekülg %s lemmikutesse (valikulise) nimega:\neu:Gehitu %s Gogokoenetara (aukerazkoa) Izenarekin:\nfa:افزودن صفحه‌ی %s به علاقه‌مندی‌ها با نامی اختیاری:\nfi:Lisää sivu %s suosikkeihin (valinnaisella) nimellä:\nfr:Ajouter la page %s aux favoris avec un nom (optionnel):\nga:Cuir leathanach a %s le na ceanáin le ainm (roghnach):\ngl:Engadir páxina %s aos favoritos  cun nome (opcional):\nhe:הוסף את עמוד מס' %s למועדפים בשם:\nhi:पृष्ठ %s को पसंदीदा सूचि में नाम (वैकल्पिक) के साथ: जोड़ें:\nhr:Dodaj stranicu %s u favorite sa (opcijnalno) imenom:\nhu:%s. oldal hozzáadása a kedvencekhez, megnevezéssel (nem kötelező):\nid:Tambah Halaman %s Ke Favorit Dengan Nama:\nit:Aggiungi la pagina %s ai Preferiti con nome (opzionale):\nja:ページ %s に名前を付けて追加\njv:Nambah kaca %s ning favorit nganggo jeneng (opsional):\nka:%s გვერდის დამატება რჩეულებში (არასავალდებულო) სახელწოდებით:\nkr:%s 페이지의 즐겨찾기 이름을 입력하세요. (선택 사항) :\nku:(بۆ پەسەندەکان بەناوی (ئارەزوومەندانە %s زیادکردنی پەڕەی :\nlt:Sukurti žymą į %s puslapį, suteikiant jai šį pavadinimą (neprivalomas):\nlv:Pievienot %s lappusi izlasei ar (neobligātu) nosaukumu:\nmk:Додај страница %s во омилени со име по избор:\nmy:Tambah halaman %s pada kegemaran dengan nama (pilihan):\nne:पृष्ठ %s लाई मनपर्नेमा (ऐच्छिक) नाम सहित थप्नुहोस्\nnl:Voeg pagina %s toe aan favorieten met (optionele) naam:\nnn:Legg til side %s i favorittane med (valfritt) namn:\nno:Legg til side %s i favoritter med (valgfritt) navn:\npl:Dodaj stronę %s do ulubionych pod (opcjonalną) nazwą:\npt:Adicionar página %s aos favoritos com nome (opcional):\nro:Adaugă pagina %s la favorite cu (opțional) numele:\nru:Добавить стр. %s к избранному с (необязательным) именем:\nsi:%s වැනි පිටුව ප්‍රියතම ‌‌ගොන්නට දමන්න (අවශ්‍යයනම්) නමකින්\nsk:Pridať stranu %s k obľúbeným s (voliteľným) názvom:\nsl:Dodaj stran %s med priljubljene z (neobveznim) imenom:\nsp-rs:Dodaj stranicu %s među odabrane pod (opciono) imenom:\nsq:Mbani shënim faqen %s nën emrin (fakultativ):\nsr-rs:Додај страницу %s међу одабране под (опционо) именом:\nsv:Lägg till sida %s i favoriter med (valfritt) namn:\nta:விருப்பகளில்  பக்கம் %s ஐ பெயருடன் சேர்\nth:เพิ่มหน้า %s ไปยังรายการโปรดพร้อม (สามารถเลือกได้) ชื่อ:\ntr:%s no.lu sayfayı sık kullanılanlara (tercihe bağlı isimle) ekle:\ntw:以 (可選) 名稱加入第 %s 頁到最愛:\nuk:Додати %s сторінку до закладок з іменем(необов'язково):\nuz:%s betni Tanlanganlarga (boshqa) nom bilan qo'shish:\nvn:Thêm trang %s vào Ưa thích với tên (tùy chọn):\n:Add to favorites\nam:Ավելացնել ընտրյալներին\nar:اضافة للمفضلة\naz:Seçilmişlərə əlavə et\nbg:Добавяне към любимите\nbn:পছন্দের মধ্যে অন্তর্ভুক্ত করুন\nbr:Adicionar aos Favoritos\nbs:Dodaj u favorite\nby:Дадаць у Выбраныя\nca-xv:Afegix als preferits\nca:Afegeix als preferits\ncn:添加到收藏夹\ncy:Ychwanegu i'r ffefrynnau\ncz:Přidat k oblíbeným\nde:Zu Favoriten hinzufügen…\ndk:Tilføj til bogmærker\nel:Προσθήκη στα αγαπημένα\nes:Añadir a favoritos\net:Lisa lemmikutesse\neu:Gehitu Gogokoenetara\nfa:افزودن به علاقه‌مندی‌ها\nfi:Lisää suosikkeihin\nfr:Ajouter aux favoris\nga:Cuir leis na ceanáin\ngl:Engadir a favoritos\nhe:הוסף למועדפים\nhi:पसंदीदा सूचि में जोड़ें\nhr:Dodaj u favorite\nhu:Hozzáadás a kedvencekhez\nid:Tambah Ke Favorit\nit:Aggiungi ai Preferiti\nja:お気に入りに追加\njv:Nambah ning favorit\nka:რჩეულებში დამატება\nkr:즐겨찾기에 추가\nku:زیادکردن بۆ پەسەندەکان\nlt:Sukurti žymą\nlv:Pievienot izlasei\nmk:Додај во омилени\nml:പ്രീയപ്പെട്ടതിലേക്ക് കൂട്ടിച്ചേര്‍ക്കുക.\nmy:Tambah pada kegemaran\nne:मनपर्नेमा थप्नुहोस्\nnl:Voeg toe aan favorieten\nnn:Legg til i favorittar\nno:Legg til i favoritter\npl:Dodaj do ulubionych\npt:Adicionar aos favoritos\nro:Adaugă la favorite\nru:Добавить к избранному\nsi:ප්‍රියතම ‌‌ගොන්නට දමන්න\nsk:Pridať k obľúbeným\nsl:Dodaj med priljubljene\nsp-rs:Dodaj među odabrane\nsq:Shënoj te pëlqimet\nsr-rs:Додај међу одабране\nsv:Lägg till i favoriter\nta:விருப்பகளில் சேர்\nth:เพิ่มไปยังรายการโปรด\ntr:Sık kullanılanlara ekle\ntw:加入到最愛\nuk:Додати до закладок\nuz:Tanlanganlarga qo'shish\nvn:Thêm vào Ưa thích\n:Advanced\naf:Gevorderde\nam:Ընդլայնված\nar:متقدم\naz:Əlavə\nbg:Разширени (Допълнителни)\nbn:উন্নমিত\nbr:Avançado\nbs:Napredno\nby:Дадаткова\nca-xv:Avançats\nca:Avançats\ncn:高级\ncy:Uwch\ncz:Upřesnit\nde:Weiteres\ndk:Avanceret\nel:Προχωρημένα\nes:Avanzado\net:Muud\neu:Aurreratua\nfa:امکانات پیشرفته\nfi:Lisäasetukset\nfr:Avancé\nfy-nl:Avansearre\nga:Ardroghanna\ngl:Avanzado\nhe:מתקדם\nhi:उन्नत\nhr:Napredno\nhu:Speciális\nid:Lanjutan\nit:Avanzate\nja:詳細設定\njv:Terusan\nka:დამატებითი\nkr:고급\nku:پەرەسەندوو\nkw:Avonsyes\nlt:Kitos\nlv:Papildu\nmk:Напредни\nml:പുരോഗമിച്ചത്\nmy:Lanjutan\nne:उन्नत\nnl:Geavanceerd\nnn:Avansert\nno:Avansert\npl:Zaawansowane\npt:Avançadas\nro:Avansat\nru:Дополнительно\nsi:වැඩිමනත්\nsk:Pokročilé\nsl:Napredno\nsp-rs:Dodatno\nsq:Avancuar\nsr-rs:Додатно\nsv:Avancerat\nta:மேம்பட்ட அமைப்புகள்\nth:ขั้นสูง\ntl:Advanced\ntr:Gelişmiş\ntw:進階\nuk:Просунуті\nuz:Qo'shimcha\nvn:Nâng cao\n:All files\nam:Բոլոր ֆայլերը\nar:كل الملفات\naz:Bütün fayllar\nbg:Всички файлове\nbn:সকল ফাইল\nbr:Todos os arquivos\nbs:Svi fajlovi\nby:Усе файлы\nca-xv:Tots els fitxers\nca:Tots els fitxers\ncn:所有文件\ncy:Pob ffeil\ncz:Všechny soubory\nde:Alle Dateien\ndk:Alle filer\nel:Όλα τα αρχεία\nes:Todos los archivos\net:Kõik failid\neu:Agiri guztiak\nfa:تمام پرونده‌ها\nfi:Kaikki tiedostot\nfr:Tous les fichiers\nfy-nl:Alle bestannen\nga:Gach comhad\ngl:Todos os ficheiros\nhe:כל הקבצים\nhi:सभी फाइलें\nhr:Sve datoteke\nhu:Minden fájl\nid:Semua Berkas\nit:Tutti i file\nja:すべてのファイル\njv:Kabeh berkas\nka:ყველა ფაილი\nkr:모든 파일\nku:هەموو فایلەکان\nkw:Pub restren\nlt:Visi failai\nlv:Visi faili\nmk:Сите датотеки\nml:എല്ലാ ഫയലുകളും\nmy:Semua fail\nne:सबै फाइलहरु\nnl:Alle bestanden\nnn:Alle filar\nno:Alle filer (*.*)\npl:Wszystkie pliki\npt:Todos os ficheiros\nro:Toate fișierele\nru:Все файлы\nsi:සියලු ගොනු\nsk:Všetky súbory\nsl:Vse datoteke\nsn:Magwaro ose\nsp-rs:Sve datoteke\nsq:Të gjitha skedat\nsr-rs:Све датотеке\nsv:Alla filer\nta:எல்லா கோப்புகள்\nth:ไฟล์ทั้งหมด\ntl:Lahat ng files\ntr:Tüm dosyalar\ntw:所有檔案\nuk:Всі файли\nuz:Hamma fayllar\nvn:Mọi tập tin\n:All supported documents\nam:Աջակցվող բոլոր փասթաթղթերը\nar:كل المستندات المدعومة\naz:Bütün dəstəklənən sənədlər\nbg:Всички поддържани документи\nbr:Todos os documentos suportados\nbs:Svi podržani dokumenti\nca-xv:Tots els documents suportats\nca:Tots els documents suportats\ncn:所有支持的文件\ncy:Pob dogfen sy'n cael ei chynnal\ncz:Všechny podporované dokumenty\nde:Alle unterstützten Dokumente\ndk:Alle understøttede dokumenter\nel:Όλα τα υποστηριζόμενα έγγραφα\nes:Todos los documentos compatibles\net:Kõik toetatud vormingud\neu:Sostengatutako agiri guztiak\nfa:همه‌ی اسناد پشتیبانی شده\nfi:Kaikki tuetut asiakirjat\nfr:Tous les documents pris en charge\nga:Gach cáipéis inléite\ngl:Todos os documentos compatibles\nhe:כל הקבצים הנתמכים\nhi:सभी समर्थित दस्तावेज़\nhr:Svi podržani dokumenti\nhu:Minden támogatott fájltípus\nid:Semua dokumen yang didukung\nit:Tutti i documenti supportati\nja:すべての対応ドキュメント\njv:Kabeh dokumen sing didhukung\nka:ყველა მხარდაჭერილი დოკუმენტი\nkr:지원하는 모든 문서\nku:هەموو بەڵگەنامە گونجاوەکان\nlt:Visų palaikomų tipų dokumentai\nlv:Visi atbalstītie dokumenti\nmk:Сите поддражни документи\nmy:Semua dokumen yang disokong\nne:सबै समर्थनयोग्य कागजातहरू\nnl:Alle ondersteunde documenten\nnn:Alle støttede dokumentar\nno:Alle støttede dokumenter\npl:Wszystkie obsługiwane pliki\npt:Todos os documentos\nro:Toate formatele suportate\nru:Все поддерживаемые документы\nsk:Všetky podporované dokumenty\nsl:Vse podprte dokumente\nsn:Magwaro ese anovhurika\nsp-rs:Svi podržani dokumenti\nsq:Dokumente të garantuara\nsr-rs:Сви подржани документи\nsv:Alla dokument som stöds\nta:எல்லா ஆதரிக்கப்பட்ட கோப்புகள்\nth:เอกสารสนับสนุนทั้งหมด\ntr:Bütün desteklenen belgeler\ntw:所有支援的文件\nuk:Всі документи, що підтримуються\nuz:Hamma qo'llanadigan hujjatlar\nvn:Tất cả các định dạng được hỗ trợ\n:Application:\naf:Applikasie\nam:Ծրագիր՝\nar:التطبيق\naz:Proqram:\nbg:Приложение:\nbn:অ্যাপ্লিকেশানঃ\nbr:Aplicativo:\nbs:Aplikacija:\nca-xv:Programa:\nca:Programa:\ncn:应用程序:\ncy:Rhaglen:\ncz:Aplikace:\nde:Anwendung:\ndk:Program:\nel:Εφαρμογή:\nes:Aplicación:\net:Rakendus:\neu:Aplikazioa:\nfa::نرم‌افزار\nfi:Ohjelma:\nfr:Application :\nfy-nl:Applikaasje:\nga:Feidhmchlár:\ngl:Aplicación:\nhe:יישום:\nhi:आवेदन:\nhr:Aplikacija:\nhu:Alkalmazás:\nid:Aplikasi:\nit:Creato con:\nja:アプリケーション:\njv:Aplikasi\nka:აპლიკაცია:\nkr:프로그램:\nku:بەرنامە:\nlt:Programa:\nlv:Programma:\nmk:Апликација:\nmy:Aplikasi\nne:अनुप्रयोग:\nnl:Programma:\nnn:Applikasjon:\nno:Program:\npl:Program:\npt:Aplicação:\nro:Program:\nru:Приложение:\nsi:යෙදුම:\nsk:Program:\nsl:Aplikacija:\nsp-rs:Aplikacija:\nsq:Aplikacioni:\nsr-rs:Апликација:\nsv:Programvara:\nta:செயலி\nth:โปรแกรมใช้งาน:\ntl:Pangalan ng aplikasyon:\ntr:Uygulama:\ntw:應用程式:\nuk:Прикладна програма:\nuz:Dastur:\nvn:Ứng dụng:\n:Are you sure you want to uninstall SumatraPDF?\naf:Is jy seker jy wil SumatraPDF oninstalleer?\nam:Համոզվա՞ծ եք, որ ցանկանում եք ջնջել SumatraPDF-ը:\nar:؟  SumatraPDF هل انت متاكد تريد مسح \naz:Əminsiniz ki, SumatraPDF-i silmək istəyirsiniz?\nbg:Наистина ли искате да деинсталирате SumatraPDF ?\nbn:আপনি কি নিশ্চিত যে আপনি সুমাত্রা-পিডিএফ আন-ইন্সটল করতে চান?\nbr:Tem certeza de que quer desinstalar o SumatraPDF?\nbs:Da li ste sigurni da želite deinstalirati SumatraPDF?\nca-xv:Esteu segur de voler desinstal·lar el SumatraPDF?\nca:Esteu segur de voler desinstal·lar el SumatraPDF?\ncn:你确实要卸载 SumatraPDF 吗？\ncy:Ydych chi'n siŵr eich bod am ddadosod SumatraPDF\ncz:Opravdu chcete odinstalovat SumatraPDF?\nde:Möchten Sie SumatraPDF wirklich deinstallieren?\ndk:Er du sikker på, at du vil afinstallere SumatraPDF?\nel:Είστε σίγουροι πως επιθυμείτε την απεγκατάσταση του SumatraPDF ;\nes:¿Está seguro de querer desinstalar SumatraPDF?\net:Kas oled kindel, et soovid eemaldada rakendust SumatraPDF?\neu:Zihur zaude SumatraPDF kentzea nahi duzula?\nfa:آیا برای پاک کردن برنامه‌ی سوماترا پی‌دی‌اف مطمئن هستید؟\nfi:Oletko varma, että haluat poistaa SumatraPDF:n?\nfr:Êtes-vous certain de vouloir désinstaller SumatraPDF ?\nga:An bhfuil tú cinnte gur mian leat SumatraPDF a dhíshuiteáil?\ngl:Seguro que queres desinstalar SumatraPDF?\nhe:האם אתה בטוח שברצונך להסיר את SumatraPDF?\nhi:अस्थायी निर्देशिका नहीं बना सका\nhr:Jeste li sigurni da želite deinstalirati SumatraPDF?\nhu:Biztosan el szeretné távolítani a SumatraPDF-et?\nid:Anda yakin ingin menghapus instalasi SumatraPDF?\nit:Siete sicuri di voler disinstallare SumatraPDF?\nja:SumatraPDFを本当にアンインストールしますか？\njv:Apa panjenengan yakin arep mbusak instalasi SumatraPDF?\nkr:SumatraPDF를 제거할까요?\nku:ئایا دڵنیایت لە سڕینەوەی SumatraPDF?\nlv:Vai jūs esat pārliecināts, ka vēlaties atinstalēt SumatraPDF?\nmk:Дали сте сигурни дека сакате да го избришете SumatraPDF?\nmy:Adakah anda pasti anda mahu membuang SumatraPDF?\nne:SumatraPDF हटाउन चाहानुहुन्छ?\nnl:Weet u zeker dat u SumatraPDF wilt verwijderen?\nnn:Er du sikker på at du vil avinstallere SumatraPDF?\nno:Vil du virkelig avinstallere SumatraPDF?\npl:Czy na pewno chcesz usunąć SumatraPDF?\npt:Tem a certeza que quer desinstalar o SumatraPDF?\nro:Sunteti sigur ca doriti sa dezinstalati Sumatra PDF?\nru:Вы уверены, что хотите удалить SumatraPDF?\nsk:Naozaj chcete odinštalovat SumatraPDF?\nsl:Ali ste prepričani, da želite odstraniti SumatraPDF?\nsn:Une chokwadi chekuti urikuda kubvisa SumatraPDF?\nsp-rs:Da li sigurno želite da uklonite SumatraPDF?\nsq:Jeni i sigurt se doni të çinstaloni SumatraPDF?\nsr-rs:Да ли желите деинсталацију СуматраПДФ\nsv:Är du säker på att du vill avinstallera SumatraPDF?\nta:சுமத்ரா PDF நிறுவலை நீக்கவா?\ntr:SumatraPDF'yi bilgisayarınızdan kaldırmak istediğinize emin misiniz ?\ntw:你確定要解除安裝 SumatraPDF 嗎？\nuk:Ви впевнені, що хочете видалити SumatraPDF?\nuz:SumatraPDF'ni o'chirishga ishonchingiz komilmi?\nvn:Bạn có chắc muốn gỡ bỏ SumatraPDF không?\n:Associate with PDF files?\naf:Assosieer Met PDF lêers?\nam:Ասոցիացնե՞լ PDF ֆայլերի հետ։\nar:ارتبط بملفات مستندات محمولة ؟\naz:PDF fayllarla əlaqə yaradılsın?\nbg:Указване на програмата като такава по подразбиране за отваряне на PDF файлове?\nbn:পিডিএফ সঞ্চিকার সাথে সম্বন্ধ করা হবে?\nbr:Associar com arquivos PDF?\nbs:Asocirati sa PDF datotekama?\nby:Асацыяваць з PDF-файламі?\nca-xv:Voleu associar-lo amb els fitxers PDF?\nca:Voleu associar-lo amb els fitxers PDF?\ncn:设置 PDF 文件关联吗?\ncy:Cysylltu gyda ffeiliau PDF?\ncz:Přidružit k PDF souborům?\nde:Mit PDF-Dateien verknüpfen?\ndk:Tilknyt til  PDF-filer?\nel:Να γίνει συσχετισμός με τα αρχεία PDF;\nes:¿Asociar con archivos PDF?\net:Seosta PDF-failidega?\neu:Elkartu PDF agiriekin?\nfa:پرونده‌های PDF همیشه با این برنامه خوانده شوند؟\nfi:Tiedostosidos PDF-tiedostoihin?\nfr:Associer aux fichiers PDF ?\nfy-nl:Assosjearje mei PDF-bestannen?\nga:Comhthiomsaigh le comhaid PDF?\ngl:Asociar con ficheiros PDF?\nhe:לשייך לקובצי PDF?\nhi:PDF फाईलों से संबंध बनाइए?\nhr:Asocirati sa PDF datotekama?\nhu:Társítás a PDF fájlokkal?\nid:Asosiasikan dengan berkas PDF?\nit:Associare ai file PDF?\nja:PDF ファイルと関連付けますか？\njv:Asosiasi karo berkas PDF?\nka:გსურთ PDF ფაილებთან ასოცირება?\nkr:PDF 파일 확장자를 연결할까요?\nku:؟PDF پەیوەستکردن بە فایلەکانی\nkw:Keskelmi orth restrennow PDF?\nlt:Susieti su PDF failais?\nlv:Vai piesaistīt PDF failiem?\nmk:Да управувам со PDF-датотеки?\nml:capture\nmm:PDF ဖိုင်များနှင့်ဆက်စပ်ရန်\nmy:Kaitkan dengan fail PDF?\nne:PDF फाइलहरु सँग सम्बन्धन गराउने?\nnl:Associëren met PDF-bestanden?\nnn:Tilknytte PDF-filer?\nno:Tilknytt til PDF-filer?\npa:PDF ਫਾਈਲਾਂ ਨਾਲ ਸੰਬੰਦ ਬਣਾਓ ?\npl:Skojarzyć z plikami PDF?\npt:Associar a ficheiros PDF?\nro:Asociază cu fișierele PDF?\nru:Ассоциировать с PDF-файлами?\nsi:PDF ගොනු සමඟ සම්භන්ධක?\nsk:Asociovať s PDF súbormi?\nsl:Povežem s PDF datotekami?\nsn:Ita zvifambidzane nemagwaro ePDF\nsp-rs:Pridružiti PDF datotekama?\nsq:Do e shoqëroni me skedat PDF?\nsr-rs:Придружити PDF датотекама?\nsv:Koppla ihop med PDF-filer?\nta:PDF கோப்புகளுடன் இணை\nth:เชื่อมกับไฟล์ PDF\ntl:I-associate sa mga PDF file?\ntr:PDF dosyaları ile bağdaştırmak ister misiniz?\ntw:設定 PDF 檔案關聯嗎?\nuk:Асоціювати з PDF-файлами?\nuz:PDF-fayllar bilan bog'lansinmi?\nvn:Liên kết với tập tin PDF?\n:Attachment: %s\nam:Կցորդ. %s\nar:%s:مرفق\naz:Qoşma: %s\nbg:Прикрепен: %s\nbn:সংযুক্তিঃ %s\nbr:Anexo: %s\nbs:Prilog: %s\nca-xv:Adjunt: %s\nca:Adjunt: %s\ncn:附件: %s\ncy:Atodiad: %s\ncz:Příloha: %s\nde:Anhang: %s\ndk:Bilag: %s\nel:Επισύναψη: %s\nes:Adjunto: %s\net:Manus: %s\neu:Eranspena: %s\nfa:پیوست: %s\nfi:Liite: %s\nfr:Fichier joint : %s\nga:Ceangaltán: %s\ngl:Adxunto: %s\nhe:נספח: %s\nhi:संलान्गित : %s\nhr:Prilog: %s\nhu:Melléklet: %s\nid:Lampiran: %s\nit:Allegato: %s\nja:添付: %s\njv:Lampiran: %s\nka:დანართი: %s\nkr:첨부: %s\nku:%s :پاشکۆ\nlt:Priedas: %s\nlv:Pielikums: %s\nmk:Прилог: %s\nmy:Lampiran: %s\nne:संलग्नहरू: %s\nnl:Bijlage: %s\nnn:Vedlegg: %s\nno:Vedlegg: %s\npl:Załącznik: %s\npt:Anexo: %s\nro:Fișier atașat: %s\nru:Вложение: %s\nsi:සම්බන්ධිතය: %s\nsk:Príloha: %s\nsl:Priponka: %s\nsn:Mubatanidzwa: %s\nsp-rs:Prilog : %s\nsq:Shtojca: %s\nsr-rs:Прилог : %s\nsv:Bilagor: %s\nta:இணைப்பு %s\nth:เอกสารแนบ: %s\ntl:Nakasama: %s\ntr:Ek: %s\ntw:附件: %s\nuk:Додаток: %s\nuz:Qo'shimcha ilovasi: %s\nvn:Đính kèm: %s\n:Author:\naf:Outeur\nam:Հեղինակ՝\nar:المؤلف\naz:Müəllif:\nbg:Автор:\nbn:লেখকঃ\nbr:Autor:\nbs:Autor:\nca-xv:Autor:\nca:Autor:\ncn:作者:\ncy:Awdur:\ncz:Autor:\nde:Autor:\ndk:Forfatter:\nel:Δημιουργός:\nes:Autor:\net:Autor:\neu:Egilea:\nfa:مؤلف:\nfi:Tekijä:\nfr:Auteur :\nfy-nl:Auteur:\nga:Údar:\ngl:Autor:\nhe:מחבר:\nhi:लेखक:\nhr:Autor:\nhu:Készítő:\nid:Pencipta:\nit:Autore:\nja:作者:\njv:Penerjemah\nka:ავტორი:\nkr:저자:\nku:دانەر:\nlt:Autorius:\nlv:Autors:\nmk:Автор:\nml:രചയിതാവ്\nmy:Pengarang\nne:लेखक\nnl:Auteur:\nnn:Skapar:\nno:Forfatter:\npl:Autor:\npt:Autor:\nro:Autor:\nru:Автор:\nsi:කතෘ:\nsk:Tvorca:\nsl:Avtor:\nsn:Nyanduri\nsp-rs:Autor:\nsq:Autori:\nsr-rs:Аутор:\nsv:Författare:\nta:ஆசிரியர்\nth:ผู้แต่ง:\ntl:May-akda:\ntr:Yazar:\ntw:作者:\nuk:Автор:\nuz:Muallif:\nvn:Tác giả\n:Automatic\naf:Outomaties\nam:Ինքնաշխատ\nar:آلي\naz:Avtomatik\nbg:Автоматично\nbn:স্বয়ংক্রিয়\nbr:Automático\nbs:Automatsko\nca-xv:Automàtic\nca:Automàtic\ncn:自动\ncy:Awtomatig\ncz:Automaticky\nde:Automatisch\ndk:Automatisk\nel:Αυτόματα\nes:Automático\net:Automaatne\neu:Berezgaitasunez\nfa:خودکار\nfi:Automaattinen\nfr:Automatique\nfy-nl:Automatysk\nga:Uathoibríoch\ngl:Automático\nhe:אוטומטית\nhi:स्वचालित\nhr:Automatsko\nhu:Automatikus\nid:Otomatis\nit:Automatica\nja:自動\njv:Otomatis\nka:ავტომატური\nkr:자동\nku:خۆکار\nkw:Awtomatek\nlt:Automatinis\nlv:Automātiski\nmk:Автоматски\nml:സ്വയമേവ.\nmy:Automatik\nne:स्वत:\nnl:Automatisch\nnn:Automatisk\nno:Automatisk\npl:Automatycznie\npt:Automático\nro:Automat\nru:Автоматически\nsi:ස්වයංක්‍රීය\nsk:Automaticky\nsl:Samodejno\nsp-rs:Automatski\nsq:Automatik\nsr-rs:Аутоматски\nsv:Automatiskt\nta:தானியங்கி\nth:อัตโนมัติ\ntl:Awtomatiko\ntr:Otomatik\ntw:自動\nuk:Автоматично\nuz:Avtomatik\nvn:Tự động\n:Automatically check for &updates\nam:Ինքնաշխատ ստուգել &թարմացումները\nar:التحقق تلقائياً  من وجود &تحديثات\naz:Yeniləmələri avto&matik yoxla\nbg:Автоматична проверка за &обновления\nbr:&Procurar atualizações automaticamente\nbs:Automatski provjeravaj za &nadogradnju\nby:&Аўтаматычная праверка абнаўленняў\nca-xv:&Comprova les actualitzacions automàticament\nca:&Comprova les actualitzacions automàticament\ncn:自动检查更新(&U)\ncy:Gwirio'n awtomatig am &ddiweddariadau\ncz:&Automaticky kontrolovat aktualizace\nde:&Automatisch nach Updates suchen\ndk:Kontroller automatisk for &opdateringer\nel:Αυτόματος έλεγχος για &ενημερώσεις\nes:B&uscar actualizaciones automáticamente\net:Uuendusi k&ontrollitakse automaatselt\neu:&Berezgaitasunez egiaztatu eguneraketak\nfa:بررسی خودکار برای به‌روزرسانی‌ها\nfi:Tarkista pä&ivitykset automaattisesti\nfr:Vérifier &automatiquement les mises à jour\nfy-nl:Automatysk kontrolearje op &fernijings\nga:Lorg nuashonruithe go huathoibríoch\ngl:Comprobar se hai &actualizacións automáticamente\nhe:בדוק עדכונים אוטומטית\nhi:स्वचालित रूप से &नवीनतम के लिए जाँच\nhr:Provjeravaj &nadogradnje automatski\nhu:&Frissítések automatikus keresése\nid:Periksa &pembaruan secara otomatis\nit:Controlla a&utomaticamente aggiornamenti\nja:自動的に更新をチェックする(&U)\njv:Otomatis nge-cek &updatetan\nka:განახლების &ავტომატურად შემოწმება\nkr:자동으로 업데이트 확인(&U)\nku:پشکنین بۆ نوێکردنەوە بە &خۆکاری\nkw:Checkya rag nowythyansow yn awtomatek\nlt:Automatiškai &tikrinti, ar yra naujinimų\nlv:Automātiski pārbaudīt &atjauninājumus\nmk:Проверувај за &надградби автоматски\nml:പുതിയ പതിപ്പുണ്ടോയെന്ന് സ്വയം പരിശോധിയ്ക്കുക\nmy:Semak &kemas kini secara automatik\nne:&अद्यावधिकहरु स्वतः जाँच्नुहोस्\nnl:Automatisch controleren op &updates\nnn:Søk automatisk etter &oppdateringar\nno:Automatisk sjekk for &oppdateringer\npl:&Szukaj aktualizacji automatycznie\npt:&Procurar atualizações automaticamente\nro:Urmărește automat versiuni noi\nru:&Автоматически проверять обновления\nsi:යාවත්කාලකිරීම් ස්වයක්‍රීයව සොයන්න\nsk:Automaticky kontrolovať &aktualizácie\nsl:&Samodejno preveri za posodobitve\nsp-rs:Automatski proveravaj dostupnost nove verzije\nsq:Verifikoj automatikisht &azhurnimet\nsr-rs:Аутоматски проверавај доступност нове верзије\nsv:Sök &automatisk efter uppdateringar\nta:தானாக புதுப்பித்த பதிப்பை தேடு\nth:ตรวจสอบการปรับปรุงให้ทันสมัยโดยอัตโนมัติ\ntl:Awtomatikong tignan kung may mga pagbabago\ntr:&Güncellemeleri otomatik olarak kontrol et\ntw:自動檢查更新(&U)\nuk:Автоматична перевірка оновлень\nuz:&Yangi versiyani avtomatik ravishda tekshirish\nvn:Tự động kiểm tra cập nhật\n:Book View\nam:Գրքի տեսքով\nar:عرض الكتاب\naz:Kitab formatı\nbg:Изглед като книга\nbn:বইরূপ প্রদর্শন\nbr:Ver como livro\nbs:Knjiški pregled\nca-xv:Visualització de llibre\nca:Visualització de llibre\ncn:书籍视图\ncy:Golwg Llyfr\ncz:Kniha\nde:Buchansicht\ndk:Bogvisning\nel:Προβολή βιβλίου\nes:Vista de libro\net:Raamatuvaade\neu:Liburu Ikuspena\nfa:کتابی\nfi:Kirjanäkymä\nfr:Comme un livre\nfy-nl:Boekbyld\nga:Leabhar-amharc\ngl:Vista de libro\nhe:תצוגת ספר\nhi:पुस्तक दृश्य\nhr:Knjiški pregled\nhu:Könyv (oldalpár címlappal)\nid:Tampilan Buku\nit:Vista libro\nja:ブック ビュー\njv:Tampilan Buku\nka:წიგნის რეჟიმი\nkr:책처럼 보기\nku:شێوازی پەرتووک\nkw:Gwel-lyver\nlt:Knyga\nlv:Grāmatas skats\nmk:Книга\nmy:Paparan buku\nne:पुस्तिका दृश्य\nnl:Boekweergave\nnn:Bokvising\nno:Bokvisning\npl:Widok odczytu\npt:Como livro\nro:Vizualizare în format carte\nru:В разворот\nsi:පොත් දසුන\nsk:Zobraziť ako knihu\nsl:Knjižni pogled\nsn:Maonero egwaro\nsp-rs:Izgled knjige\nsq:Libër\nsr-rs:Изглед књиге\nsv:Bokuppslag\nta:ஏடு வடிவி நோக்கு\nth:แสดงแบบหนังสือ\ntl:Pang-aklat na tingin\ntr:Kitap Görünümü\ntw:書本檢視\nuk:Книжна розгортка\nuz:Kitob ko'rinishi\nvn:Xem dạng sách\n:Book&marks\\tF12\naf:Boekmerke\\tF12\nam:Էջան&իշեր\\tF12\nar:العلامات\\tF12\naz:&Əlfəcinlər\\tF12\nbg:&Отметки\\tF12\nbn:পৃষ্ঠাস্মারকসমূহ\\tF12\nbr:Marcadores\\tF12\nbs:Zabilješke\\tF12\nby:Закладкі\\tF12\nca-xv:&Marcadors\\tF12\nca:&Marcadors\\tF12\ncn:书签(&M)...\\tF12\ncy:Nodau Tudalen\\tF12\ncz:Zál&ožky\\tF12\nde:Lese&zeichen\\tF12\ndk:Bog&mærker\\tF12\nel:&Σελιδοδείκτες\\tF12\nes:&Marcadores\\tF12\net:Jär&jehoidjad\\tF12\neu:&Gogokoenak\\tF12\nfa:ن&شانک‌ها\\tF12\nfi:K&irjanmerkit\\tF12\nfr:Signets\\tF12\nfy-nl:Blêdwizers\\tF12\nga:Ceanáin\\tF12\ngl:&Marcadores\\tF12\nhe:סימניות\\tF12\nhi:संभाले हुए चिह्न\\tF12\nhr:Straničnik\\tF12\nhu:Könyvjelzők\\tF12\nid:&Markah\\tF12\nit:Segna&libri\\t<F12>\nja:ブックマーク(&M)\\tF12\nka:&სანიშნები\\tF12\nkr:책갈피(&M)\\tF12\nku:نیشانە&کراوەکان\\tF12\nkw:Lyververkyow\\tF12\nlt:Žymės\\tF12\nlv:Grāmat&zīmes\\tF12\nmk:Обележувачи\\tF12\nmm:စာမျက်နှာ မှတ်သား\\tF12\nmy:Penanda\\tF12\nne:पुस्तक&चिनोहरू\\tF12\nnl:Bladwijzers\\tF12\nnn:Bokmerker\\tF12\nno:Bokmerker\\tF12\npa:ਸੰਭਾਲੇ ਹੋਏ ਚਿੰਨ\\tF12\npl:&Zakładki\\tF12\npt:M&arcadores\\tF12\nro:Marcaje\\tF12\nru:&Закладки\\tF12\nsi:පොත්&සලකුණු\\tF12\nsk:Záložky\\tF12\nsl:Zazna&mki\\tF12\nsn:Mabhukumaki\\tF12\nsp-rs:Obeleživači\\tF12\nsq:Faqet e &shenjuara\\tF12\nsr-rs:Обележивачи\\tF12\nsv:Bokmärken\\tF12\nta:புத்தகக்குறி\nth:ที่คั่น\\tF12\ntl:Mga Pananda\\tF12\ntr:&Yer imleri\\tF12\ntw:書籤(&M)...\\tF12\nuk:Закладки\\tF12\nuz:&Xatcho'plar\\tF12\nvn:Chỉ dấu sách\\tF12\n:Bookmark Shortcuts\nam:Էջանշել պիտակները\nar:اختصارات قائمة العناوين\naz:Əlfəcin yarlıkları\nbg:Кратък път към отметки\nbn:পুস্তক-চিহ্ন শর্টকাট\nbr:Atalhos de Favoritos\nbs:Kratice zabilješki\nca-xv:Dreceres de marcadors\nca:Dreceres de marcadors\ncn:书签快捷方式\ncy:Llwybrau Byr Nodau Tudalen\ncz:Zástupce záložky\nde:Lesezeichen-Verknüpfungen\ndk:Gem genveje\nel:Συντομεύσεις σελιδοδεικτών\nes:Marcar atajos\net:Järjehoidjate otseteed\neu:Gogoekoenen Lasterbideak\nfa:میانبرهای نشانک\nfi:Pikakuvakkeet\nfr:Raccourcis des signets\nga:Déan ceanáin d'aicearraí\ngl:Atallos de marcadores\nhe:קיצורי דרך לסימנייה\nhi:चिन्हित अल्प तरीका\nhr:Prečaci oznaka\nhu:Könyvjelző parancsikonok\nid:Jalan Pintas Markah\nit:Scorciatoie segnalibro\nja:ショートカットをブックマーク\njv:Atajos de marcadores\nka:მალსახმობები\nkr:책갈피 바로가기\nku:نیشانەکردنی کورتە ئایکۆنەکان\nlv:Grāmatzīmju saīsnes\nmk:Кратенки од обележувачи\nmy:Pintasan Penanda\nne:पुस्तकचिनो सर्टकटहरु\nnl:Bladwijzer maken\nnn:Bokmerk snarveg\nno:Bokmerk snarveier\npl:Zakładki\npt:Atalhos de marcadores\nro:Legături rapide - semne de carte\nru:Ярлыки закладок\nsk:Zástupca záložiek\nsl:Zaznamki bližnjic\nsp-rs:Prečica ka obeleživaču\nsq:Shkurtoret e shenjimit\nsr-rs:Пречица ка обележивачу\nsv:Bokmärkesgenvägar\nta:புத்தகக்குறி இடுக\nth:คั่นหน้าทางลัด\ntr:Yer imi kısayolları\ntw:書籤捷徑\nuk:Закладка ярликів\nuz:Xatcho'p yorliqlari\nvn:Lối tắt chỉ dấu sách\n:Bookmark shortcut to page %s of %s\nam:Էջանշել %s էջից %s-ը\nar:%s من %s اختصار قائمة العناوين الى صفحة\naz:%s. (%s) səhifə yarlıkının əlfəcini\nbg:Кратък път към отметка на страница %s от %s\nbr:Atalho para a página %s de %s\nbs:Kratica zabilješke na stranicu %s od %s\nca-xv:Drecera del marcador a la pàgina %s de %s\nca:Drecera del marcador a la pàgina %s de %s\ncn:书签快捷方式指向第 %s 页 (文件 %s)\ncy:Llwybr byr nod tudalen i dudalen %s o %s\ncz:Zástupce záložky na straně %s souboru %s\nde:Lesezeichen-Verknüpfung zu Seite %s von %s\ndk:Gem genvej til side %s af %s\nel:Συντόμευση σελιδοδείκτη στη σελίδα %s του %s\nes:Marcar atajo a la página %s de %s\net:Tee järjehoidja otsetee leheküljele %s/%s\neu:Lastermarka lasterbidea %s orrialdeari %s-tik\nfa:میانبر به نشانک صفحه‌ی %s از %s\nfi:Tee pikakuvake sivulle %s/%s\nfr:Raccourci du signet de la page %s de %s\nga:Cruthaigh aicearra chuig lch %s as %s\ngl:Atallo de marcador á páxina %s de %s\nhe:קיצור דרך לסימניית עמוד %s מתוך %s\nhi:पृष्ठ %s पर बुकमार्क शॉर्टकट %s का करें\nhr:Prečac oznake do stranice %s of %s\nhu:Könyvjelző parancsikon a(z) %s/%s oldalhoz\nid:Jalan pintas markah ke halaman %s dari %s\nit:Segnalibro alla pagina %s di %s\nja:ページ %s、ファイル %s に対するショートカットをブックマーク\nka:%s-იდან %s გვერდის მალსახმობის ჩანიშვნა\nkr:%s / %s 페이지에 책갈피 바로가기\nku:%s لە %s نیشانەکردنی کورتەئایکۆن بۆ پەڕە\nlv:Grāmatzīmju saīsne uz %s lappusi no %s\nmk:Кратенки од обележувачи за страница %s од %s\nmy:Bookmark shortcut ke halaman %s daripada %s\nne:पृष्ठ %s (कुल %s मध्ये) को सर्टकटलाई पुस्तकचिनो बनाउनुहोस्\nnl:Bladwijzer maken naar pagina %s van %s\nnn:Bokmerk snarveg til side %s av %s\nno:Bokmerk snarvei til side %s av %s\npl:Wstaw zakładkę do strony %s z %s\npt:Atalho para a página %s de %s\nro:Legătură rapidă către pagina %s din %s\nru:Ярлык закладки на стр. %s из %s\nsk:Zástupca záložky na stranu %s z %s\nsl:Zaznamek bližnjice na stran %s od %s\nsp-rs:Obeleži prečicu na strani %s od %s\nsq:Shkurtorja e shenjimit për faqet %s nga %s\nsr-rs:Обележи пречицу на страни %s од %s\nsv:Bokmärk genväg till sida %s av %s\nta:%s / %s பக்கத்தின் புத்தகக்குறிக்கு குறுக்குவழி\nth:คั่นทางลัดไปยังหน้า %s ของ %s\ntr:%s. sayfasına %s yer imi kısayolu\ntw:書籤捷徑指向第 %s 頁 (檔案 %s)\nuk:Закладка ярлика на сторінку %s з %s\nuz:Xatcho'p yorlig'i betga %s %s dan\nvn:Lối tắt chỉ dấu sách đến trang %s của %s\n:Bookmarks\nam:Էջանիշեր\nar:قائمة العناوين\naz:Əlfəcinlər\nbg:Отметки\nbn:পুস্তক-চিহ্নসমূহ\nbr:Marcadores\nbs:Zabilješke\nca-xv:Marcadors\nca:Marcadors\ncn:书签\ncy:Nodau Tudalen\ncz:Záložky\nde:Lesezeichen\ndk:Bogmærker\nel:Σελιδοδείκτες\nes:Marcadores\net:Järjehoidjad\neu:Gogokoenak\nfa:نشانک‌ها\nfi:Kirjanmerkit\nfr:Signets\nga:Ceanáin\ngl:Marcadores\nhe:סימניות\nhi:चिन्हित\nhr:Oznake\nhu:Könyvjelzők\nid:Markah\nit:Segnalibri\nja:ブックマーク\njv:Marcadores\nka:სანიშნები\nkr:책갈피\nku:نیشانەکراوەکان\nlt:Žymės\nlv:Grāmatzīmes\nmk:Обележувачи\nml:അടയാളം വയ്ക്കുക\nmy:Penanda\nne:पुस्तकचिनो\nnl:Bladwijzers\nnn:Bokmerkar\nno:Bokmerker\npl:Zakładki\npt:Marcadores\nro:Marcaje\nru:Закладки\nsi:පිටු සලකුණු\nsk:Záložky\nsl:Zaznamki\nsp-rs:Obeleživači\nsq:Faqet e shenjuara\nsr-rs:Обележивачи\nsv:Bokmärken\nta:புத்தகக்குறி\nth:คั่นหน้า\ntl:Mga Pananda\ntr:Yer imleri\ntw:書籤\nuk:Закладки\nuz:Xatcho'plar\nvn:Chỉ dấu sách\n:Bytes\nam:Բայթ\nar:بايت\naz:bayt\nbg:байта\nbn:বাইটসমূহ\nbr:Bytes\nbs:Bajta\nca-xv:Bytes\nca:Bytes\ncn:字节\ncy:Beit\ncz:Bajtů\nde:Byte\ndk:Byte\nel:Bytes\nes:Bytes\net:Baiti\neu:Byte\nfa:بایت\nfi:tavua\nfr:Octets\nfy-nl:Bytes\nga:Bearta\ngl:Bytes\nhe:Bytes\nhi:बाइट्स\nhr:Bajtova\nhu:bájt\nid:Byte\nit:Byte\nja:バイト\njv:Bytes\nka:ბაიტი\nkr:바이트\nku:بایت\nlt:baitų\nlv:baiti\nmk:бајти\nml:Bytes\nmy:Bytes\nne:बाईट\nnl:Bytes\nnn:Bytes\nno:bytes\npl:bajtów\npt:Bytes\nro:Octeți\nru:Байт\nsi:Bytes\nsk:Bajtov\nsl:Bajtov\nsp-rs:bajtova\nsq:bajt\nsr-rs:бајтова\nsv:Byte\nta:பிட்டுகள்\nth:ไบต์\ntl:Bytes\ntr:Bayt\ntw:位元組\nuk:Байт\nuz:Bayt\nvn:Bytes\n:CHM documents\naf:CHM dokumente\nam:CHM ֆայլեր\nar:CHM ملفات \naz:CHM sənədləri\nbg:CHM документи\nbr:Documentos CHM\nbs:CHM dokumenti\nca-xv:Documents CHM\nca:Documents CHM\ncn:CHM 文档\ncy:Dogfennau CHM\ncz:Dokumenty CHM\nde:CHM Hilfe-Dateien\ndk:CHM-dokumenter\nel:Έγγραφα CHM\nes:Documentos CHM\net:CHM-dokumendid\neu:CHM agiriak\nfa:CHM اسناد\nfi:CHM-asiakirjat\nfr:Fichiers d'aide CHM\nfy-nl:CHM-bestannen\nga:Cáipéisí CHM\ngl:Documentos CHM\nhe:CHM קובצי\nhi:CHM दस्तावेजों\nhr:CHM dokumenti\nhu:CHM fájlok\nid:Dokumen CHM\nit:Documenti CHM\nja:CHM ドキュメント\njv:Documentos CHM\nka:CHM დოკუმენტები\nkr:CHM 문서\nku:CHM بەڵگەنامەکانی جۆری\nlt:CHM dokumentai\nlv:CHM dokumenti\nmk:CHM-документи\nmy:Dokumen CHM\nne:CHM कागजातहरु\nnl:CHM-documenten\nnn:CHM-dokumentar\nno:CHM-dokumenter\npl:Dokumenty CHM\npt:Documentos CHM\nro:Documente CHM\nru:Документы CHM\nsk:CHM dokumenty\nsl:CHM dokumenti\nsp-rs:CHM dokumenti\nsq:Dokumente CHM\nsr-rs:CHM документи\nsv:CHM-dokument\nta:CHM ஆவணங்கள்\nth:เอกสาร CHM\ntr:CHM belgeleri\ntw:CHM 文件\nuk:Документи CHM\nuz:CHM hujjatlari\nvn:Tập tin CHM\n:Can't connect to the Internet (error %#x).\nam:Հնարավոր չէ կապնվել (սխալ %#x)։\nar:لم يتم التمكن من الإتصال بالإنترنت (%#x خطأ).\naz:İnternetə qoşulmaq mümkün deyil (xəta %#x).\nbg:Няма връзка с Интернет (грешка %#x).\nbr:Falha na conexão à Internet (erro %#x).\nbs:Ne mogu se povezati na Internet (greška %#x)\nca-xv:No es pot connectar a internet (error %#x).\nca:No es pot connectar a internet (error %#x).\ncn:无法连接到互联网 (错误：%#x)。\ncy:Methu cysylltu â'r Rhyngrwyd (gwall %#x).\ncz:Nelze se připojit k Internetu (chyba %#x).\nde:Keine Verbindung zum Internet möglich (Fehler %#x).\ndk:Kan ikke forbinde til internettet (fejl %#x).\nel:Δεν είναι δυνατή η σύνδεση με το Internet (σφάλμα %#x).\nes:No se puede conectar a Internet (error %#x).\net:Internetiühenduse loomine ebaõnnestus (viga %#x).\neu:Ezinezkoa Internetera elkarketatzea (%#x akatsa).\nfa:نمی‌توان به اینترنت وصل شد (خطای %#x)\nfi:Internetiin yhdistäminen epäonnistui (virhe %#x).\nfr:Impossible de se connecter à Internet (erreur %#x)\nga:Ní féidir ceangailt leis an idirlíon (botún %#x).\ngl:Non se pode conectar a Internet (error %#x).\nhe:כישלון בחיבור לאינטרנט (שגיאה %#x).\nhi:इंटरनेट से जुड़​ नहीं पा रहा है ( ग़लती %#x )\nhr:Internet nedostupan (greška %#x)\nhu:Nem sikerült kapcsolódni az Internetre (hiba %#x).\nid:Tidak bisa terhubung ke Internet (kesalahan %#x).\nit:Impossibile connettersi a internet (errore %#x).\nja:インターネットへ接続できません (エラー %#x)。\nka:ინტერნეტთან დაკავშირება ვერ მოხერხდა (შეცდომა %#x).\nkr:인터넷에 접속할 수 없습니다. (%#x 오류)\nku:.(%#x ناتوانرێت پەیوەندی بکرێت بە ئینتەرنێتەوە (هەڵەی\nlt:Ryšys su internetu nutrūko (klaida %#x).\nlv:Nevar izveidot savienojumu ar internetu (kļūda %#x).\nmk:Не можам да се поврзам на Интернет (грешка %#x).\nmy:Gagal menyambung ke Internet (ralat %#x).\nne:इन्टरनेट जडान गर्न सकिएन (त्रुटि %#x).\nnl:Kan geen verbinding maken met internet (fout %#x).\nnn:Kan ikkje kople til internettet (Feilkode %#x).\nno:Kan ikke koble til Internett (feilmelding %#x).\npl:Nie można połączyć z Internetem (błąd %#x).\npt:Não foi possível ligar à Internet (erro %#x)\nro:Conectare la Internet eșuată (eroare %#x).\nru:Отсутствует соединение с Интернетом (ошибка %#x).\nsi:අන්තර්ජාලයට සම්භන්ධවිය නොහැක (error %#x).\nsk:Pripojenie k internetu zlyhalo (chyba %#x).\nsl:Ne morem se povezati na internet (napaka %#x).\nsp-rs:Povezivanje na internet nije moguće (greška %#x).\nsq:Nuk mund të lidhet në internet (gabim %#x).\nsr-rs:Повезивање на интернет није могуће (грешка %#x).\nsv:Kan ej ansluta till Internet (fel %#x).\nta:இணையத்தில் இணைக்க முடியாது (பிழை %#x).\nth:ไม่สามารถเชื่อมต่ออินเตอร์เน็ต (ข้อผิดพลาด %#x).\ntl:Hindi makakonekta sa Internet (error %#x).\ntr:İnternete erişilemiyor (hata %#x)\ntw:無法連線到網際網路 (錯誤：%#x)。\nuk:Неможливо під'єднатись до інтернету (помилка %#x).\nuz:Internet ulanmagan (xato %#x).\nvn:Không thể kết nối Internet (lỗi %#x).\n:Cancel\naf:Kanselleer\nam:Չեղարկել\nar:الغاء الامر\naz:İmtina\nbg:Отказ\nbn:বাতিল করুন\nbr:Cancelar\nbs:Otkaži\nby:Адмена\nca-xv:Cancel·la\nca:Cancel·la\ncn:取消(&C)\ncy:Diddymu\ncz:Storno\nde:Abbrechen\ndk:Annuller\nel:Άκυρο\nes:Cancelar\net:Loobu\neu:Ezeztatu\nfa:لغو\nfi:Peruuta\nfr:Annuler\nfy-nl:Annulearje\nga:Cealaigh\ngl:Cancelar\nhe:ביטול\nhi:रद्द करें\nhr:Odustani\nhu:Mégse\nid:Batalkan\nit:Annulla\nja:キャンセル\njv:Cancelar\nka:გაუქმება\nkr:취소\nku:پاشگەزبونەوە\nkw:Hedhi\nlt:Atsisakyti\nlv:Atcelt\nmk:Откажи\nml:വേണ്ടാ\nmy:Batal\nne:रद्द गर्नुहोस्\nnl:Annuleren\nnn:Lukk\nno:Avbryt\npl:Anuluj\npt:Cancelar\nro:Anulare\nru:Отмена\nsi:වසන්න\nsk:Zrušiť\nsl:Prekliči\nsn:regedza\nsp-rs:Otkaži\nsq:Anuloj\nsr-rs:Откажи\nsv:Avbryt\nta:இரத்து செய்\nth:ยกเลิก\ntl:Ikansela\ntr:Vazgeç\ntw:取消(&C)\nuk:Скасувати\nuz:Bekor qilish\nvn:Hủy\n:Cannot print this file\nam:Հնարավոր չէ տպել այս ֆայլը\nar:لايمكن طباعة هذا الملف\naz:Bu faylı çap etmək mümkün deyil\nbg:Файлът не може да бъде отпечатан\nbn:এই ফাইলটি মুদ্রণ করা যাচ্ছে না\nbr:Não foi possível imprimir este arquivo\nbs:Ne mogu odštampati ovaj fajl\nby:Не атрымалася раздрукаваць гэты файл\nca-xv:No es pot imprimir el fitxer\nca:No es pot imprimir el fitxer\ncn:无法打印此文件\ncy:Methu argraffu'r ffeil\ncz:Tento soubor nelze vytisknout\nde:Datei kann nicht gedruckt werden\ndk:Kan ikke udskrive denne fil\nel:Δεν είναι δυνατή η εκτύπωση αυτού του αρχείου\nes:No se puede imprimir este archivo\net:Faili printimine ebaõnnestus\neu:Ezinezkoa agiri hau irarkitzea\nfa:نمی‌توان این پرونده را چاپ کرد\nfi:Tämän tiedoston tulostaminen epäonnistui\nfr:Impossible d'imprimer ce fichier\nfy-nl:Dit bestân kin net ôfdrukt wurde\nga:Ní féidir an comhad seo a chlóbhualadh\ngl:Non se pode imprimir este ficheiro\nhe:הדפסת הקובץ נכשלה.\nhi:इस फ़ाइल का छपाई नहीं किया जा सकता\nhr:Ne mogu ispisati ovu datoteku\nhu:Ez a fájl nem nyomtatható\nid:Tidak dapat mencetak berkas ini\nit:Impossibile stampare questo file\nja:このファイルを印刷できません\nka:ამ ფაილის ამობეჭდვა ვერ მოხერხდა\nkr:이 파일을 인쇄할 수 없습니다.\nku:ناتوانرێت ئەم فایلە چاپ بکرێت\nkw:Ny yllir pryntya an restren ma\nlt:Nepavyko išspausdinti failo\nlv:Nevar izdrukāt šo failu\nmk:Не можам да ја печатам оваа датотека\nml:ഈ ഫയല്‍ അച്ചടിക്കാന്‍ പറ്റില്ല.\nmy:Tidak boleh cetak fail ini\nne:यो फाइल छाप्न सकिंदैन\nnl:Kan dit bestand niet afdrukken\nnn:Kan ikkje skrive ut denne fila\nno:Kan ikke skrive ut filen\npl:Nie można drukować tego pliku\npt:Não foi possível imprimir este ficheiro\nro:Nu pot imprima acest fișier\nru:Не удалось распечатать этот файл\nsi:මෙම ගොනුව මුද්‍රණය කළ නොහැක\nsk:Tlač súboru zlyhala\nsl:Te datoteke ni mogoče natisniti\nsp-rs:Štampanje ove datoteke nije moguće\nsq:Nuk mund të printojë skedën\nsr-rs:Штампање ове датотеке није могуће\nsv:Kan ej skriva ut denna fil\nta:கோப்பை அச்சிட முடியவில்லை\nth:ไม่สามารถพิมพ์ไฟล์นี้\ntl:Hindi mai-print ang file\ntr:Bu dosyanın yazıcıdan dökümü yapılamaz\ntw:無法列印此檔案\nuk:Не можу надрукувати цей файл\nuz:Faylni chop etib bo'lmadi\nvn:Không in được tập tin này\n:Cannot start inverse search command. Please check the command line in the settings.\nam:Հնարավոր չէ որոնել։ Ստուգեք հրամանների տողի կարգավորումները։\nar:لا يمكن بدء تشغيل الأمر بحث عكسي. الرجاء التحقق من سطر الأوامر في الإعدادات\naz:Tərs axtarış komandasını icra etmək mümkün deyil. Komanda sətrinin parametrlərini yoxlayın.\nbg:Обратното търсене не може да започне. Моля проверете параметрите в настройките.\nbr:Não é possível acionar a pesquisa inversa. Verifique a linha de comando nas preferências.\nbs:Ne mogu pokrenuti komandu pretraživanja unazad. Molimo da provjerite komandnu liniju u postavkama.\nca-xv:No es pot iniciar l'ordre de cerca inversa. Comproveu la línia de comandes a les preferencies.\nca:No es pot iniciar l'ordre de cerca inversa. Comproveu la línia d'ordres a les preferències.\ncn:无法进行逆向搜索。请检查设置数值里的命令栏。\ncy:Methu cychwyn gorchymyn chwilio gwrthdro. Gwiriwch y linell orchymyn yn y gosodiadau\ncz:Příkaz inverzní hledání nelze spustit. Zkontrolujte nastavení příkazového řádku.\nde:Fehler beim Ausführen des Befehls für die Inverssuche. Bitte überprüfen Sie die Einstellung.\ndk:Kan ikke starte søgekommandoen invers. Kontroller venligst kommandolinjen i indstillingerne.\nel:Δεν είναι δυνατή η εκκίνηση αντίστροφης αναζήτησης. Παρακαλώ ελέγξτε τη γραμμή εντολών στις ρυθμίσεις.\nes:No se puede iniciar la orden de búsqueda inversa. Compruebe la línea de órdenes en la configuración.\net:Pööratud otsingu alustamine ebaõnnestus. Kontrolli seadistustest käsurida.\neu:Ezinezkoa alderantzizko bilaketa komandoa hastea. Mesedez, egiaztatu komando lerroa ezarpenetan.\nfa:جستجوی معکوس قابل اجرا نیست. لطفاً تنظیمات خط فرمان را بازبینی کنید.\nfi:Käänteisen hakukomennon aloittaminen epäonnistui. Tarkista komentorivi asetuksista.\nfr:Impossible de lancer le programme configuré pour la recherche inverse. Veuillez vérifier la ligne de commande spécifiée dans les options.\nfy-nl:Kin de omkearde sykrjochting net starte. Kontrolearje de opdrachtrigel yn de ynstellingen.\nga:Ní féidir ordú cuardaigh aisiompaithe a thosú. Dearbháil líne na n-orduithe sna socruithe.\ngl:Non se pode iniciar o comando de busca inversa. Revisa a liña de comandos na configuración.\nhe:פקודת חיפוש הפוך נכשלה. אנא בדוק את שורת הפקודה בהגדרות.\nhi:उलटा खोज कमांड शुरू हो पा रहा । कृपया सेटिंग्स में कमांड लाइन की जाँच करें ।\nhr:Ne mogu pokrenuti naredbu unazadnog pretraživanja. Molim provjerite naredbeni redak u postavkama.\nhu:Nem indítható a fordított keresési parancs. Ellenőrizze a parancssorban a beállításokat.\nid:Tidak dapat memulai perintah pencarian terbalik. Harap periksa baris perintah di bagian pengaturan.\nit:Impossibile eseguire il comando di ricerca inversa. Controllare la riga di comando usata nelle impostazioni.\nja:逆順検索コマンドを開始できません。設定でコマンド ラインをチェックしてください。\nka:შებრუნებული ძებნის ბრძანების გაშვება ვერ მოხერხდა. გთხოვთ შეამოწმეთ ბრძანებების სტრიქონის პარამეტრები.\nkr:역방향 검색 명령을 시작할 수 없습니다.  설정에서 명령줄을 확인하세요.\nku:ناتوانرێت فرمانی گەڕانی پێچەوانە ئەنجام بدرێت. تکایە فرمانی هێڵ بپشکنە لە ڕێکخستنەکاندا\nkw:Ny yllir dalleth arhadow gorthhwilas.  Check an linen arhadow y'n settyansow mar pleg.\nlt:Nepavyko pradėti atvirkščios paieškos komandos. Patikrinkite kompandinę eilutę nuostatose.\nlv:Neizdevās palaist inversās meklēšanas komandu. Lūdzu pārbaudiet komandrindu iestatījumus.\nmk:Не можам да започнам со обратното пребарување. Провери ја командната линија во поставувањата.\nmy:Tidak boleh memulakan arahan carian songsang. Sila periksa baris arahan dalam tetapan.\nne:आदेश पङ्‌क्ति उल्टो खोजाई सुरु गर्न सकिएन | कृपया सेटिङमा आदेश पङ्‌क्ति हेर्नुहोस |\nnl:Kan de omgekeerde zoekopdracht niet starten. Controleer de opdrachtregel in de instellingen.\nnn:Kan ikkje starte invertert søkjekommando. Venligst sjekk kommandolinja i innstillingane.\nno:Kan ikke starte invertert søkekommando. Vennligst sjekk kommandolinjen i innstillingene.\npl:Nie można rozpocząć odwrotnego wyszukiwania. Proszę sprawdzić ustawienia wiersza poleceń.\npt:Não é possível iniciar o comando da pesquisa inversa. Verifique a linha de comandos nas definições.\nro:Nu pot lansa comanda de căutare inversă. Verificați, vă rog, opțiunile din linia de comandă.\nru:Ошибка команды обратного поиска. Проверьте параметры командной строки.\nsi:ප්‍රතිලෝම සෙවුමේ විධානය ආරම්භකළ නොහැක. කරුණාකර  සැකසුම්හි හි විධාන පෙළ බලන්න.\nsk:Príkaz inverzné hľadanie zlyhal. Skontrolujte príkazový riadok v nastaveniach.\nsl:Ukaza za obratno iskanje ni mogoče zagnati. Preverite ukazno vrstico v nastavitvah.\nsp-rs:Nije moguće pokrenuti inverznu pretragu. Proverite komandnu liniju u podešavanjima.\nsq:Nuk mund të kërkojë mbrapsht. Ju lutemi, verifikoni komandën te parametrat.\nsr-rs:Није могуће покренути инверзну претрагу. Проверите командну линију у подешавањима.\nsv:Kan ej starta omvänd sökning. Kontrollera inställningarna för kommandoraden.\nta:தலைகீழ் தேடல் கட்டளை தொடங்க முடியாது. அமைப்புகளில் கட்டளை வரி சரிபார்க்கவும்\nth:ไม่สามารถค้นหาคำสั่งที่ตรงกันข้าม โปรดตรวจสอบแถวคำสั่งในการตั้งค่า\ntl:Hindi ma-execute ang command para sa inverse search. Pakitingnan ang command line sa settings.\ntr:Sondan başa arama komutu başlatılamadı. Ayarlarda komut satırını kontrol ediniz.\ntw:無法進行逆向搜尋。請檢查設定值裡的命令列。\nuk:Неможливо запустити команду зворотнього пошуку. Перевірте налашутвання командного рядка.\nuz:Qayta qidirish buyrug'i xatosi. Buyruq satri parametrlarini tekshiring.\nvn:Không thể bắt đầu lệnh tìm kiếm ngược. Xin kiểm tra phần dòng lệnh trong Cài đặt.\n:Change Language\naf:Verander Taal (Change Language)\nam:Փոխել լեզուն (Change Language)\nar:تغيير اللغة \naz:Dili dəyişdir (Change Language)\nbg:Смяна на езика на програмата (Change Language)\nbn:ভাষা পরিবর্তন (Change Language)\nbr:Mudar o idioma (Change Language)\nbs:Promijeni jezik (Change Language)\nby:Змяніць мову (Change Language)\nca-xv:Canvia la llengua (Change Language)\nca:Canvia la llengua (Change Language)\ncn:更改语言 (Language)\ncy:Newid Iaith\ncz:Změnit jazyk... (Language)\nde:Sprache ändern… (Change Language)\ndk:Skift sprog (Change Language)\nel:Αλλαγή γλώσσας (Change Language)\nes:Cambiar idioma (Change Language)\net:Vali keel (Change Language)\neu:&Aldatu Hizkuntza\nfa:تغییر زبان (Change Language)\nfi:Valitse kieli (Change Language)\nfr:Changer de langue (Change Language)\nfy-nl:Taal kieze (Change Language)\nga:Athraigh an Teanga (Change Language)\ngl:Cambiar a lingua\nhe:שנה שפת ממשק (Change language)\nhi:भाषा बदलें (Change Language)\nhr:Promijeni jezik (Change Language)\nhu:Nyelv kiválasztása (Change Language)\nid:Ubah Bahasa (Change Language)\nit:Lingua dell'interfaccia\nja:言語の変更 (Change Language)\nka:ენის შეცვლა (Change Language)\nkr:언어 바꾸기(Change Language)\nku:گۆڕینی زمان (Change Language)\nkw:Chanjya yeth (Change Language)\nlt:Keisti kalbą (Change Language)\nlv:Mainīt valodu (Change Language)\nmk:Смени јазик (Change Language)\nml:ഭാഷ മാറ്റുക\nmm:စာ စကား ပြောင်းရန် (Change Language)\nmy:Tukar bahasa (Change Language)\nne:भाषा परिवर्तन गर्नुहोस् (Change Language)\nnl:Taal wijzigen (Change Language)\nnn:Byt språk (Change Language)\nno:Endre språk (Change Language)\npa:ਭਾਸ਼ਾ ਬਦਲੋ (Change Language)\npl:Zmień język (Change Language)\npt:Mudar idioma\nro:Schimbare limbă (Change Language)\nru:Изменить &язык (Change Language)\nsi:භාෂාව වෙනස්කරන්න (Change Language)\nsk:Zmeniť jazyk (Change Language)\nsl:Spremeni jezik (Change Language)\nsn:Chinja mutauro (Change Language)\nsp-rs:Promeni jezik (Change Language)\nsq:Ndryshoj gjuhën\nsr-rs:Промени језик (Change Language)\nsv:Byt språk (Change Language)\nta:மொழியை மாற்று\nth:เปลี่ยนภาษา (Change Language)\ntl:Ibahin ang Wika (Change Language)\ntr:Dil değiştir (Change Language)\ntw:變更語言 (Language)\nuk:Змінити мову (Change Language)\nuz:Tilni o'zgartirish (Change Language)\nvn:Đổi ngôn ngữ\n:Check for &Updates\naf:Kyk Vir Nuwe Uitgawe\nam:&Ստուգել նոր տարբերակը\nar:تحقق من وجود &تحديثات\naz:&Yenilikləri yoxla\nbg:Проверка за нова &версия\nbn:নতুন সংস্করণের জন্য নিরীক্ষা করুন\nbr:Procurar Atualizações\nbs:Provjeri za &nadogradnju\nby:Праверыць наяўнасць новай версіі\nca-xv:&Comprova si hi ha una versió nova\nca:&Comprova si hi ha una versió nova\ncn:检查是否有新版本(&U)\ncy:Gwirio am &Ddiweddariad\ncz:&Zkontrolovat aktualizace\nde:Nach &neuer Version suchen\ndk:Kontroller for ny &version\nel:Έ&λεγχος για νέα έκδοση\nes:&Buscar actualizaciones\net:Vaata, kas on &uuendusi\neu:&Egiaztatu Eguneraketak\nfa:بررسی برای به‌روزرسانی‌ها\nfi:Tarkista &päivitysten saatavuus\nfr:&Vérifier les mises à jour\nfy-nl:&Kontrolearje op fernijings\nga:Lorg Nuashonruithe\ngl:Buscar a&ctualizacións\nhe:בדוק עדכונים...\nhi:नए संसकरण के लिए जांच करें(&C)\nhr:Provjeri ažuriranje\nhu:&Frissítések keresése\nid:&Periksa Versi Terbaru\nit:Controlla &aggiornamenti\nja:更新のチェック(&U)\nka:&განახლების შემოწმება\nkr:업데이트 확인(&U)\nku:پشکنین بۆ &نوێکردنەوە\nkw:&Checkya rag versyon nowyth\nlt:Tikrinti, ar yra &naujinimų\nlv:Pārbaudīt, vai nav &atjauninājumi\nmk:&Провери за надградби\nmm:အမျိုးအစား သစ်စုံစမ်းရန်\nmy:Semak &Kemaskini\nne:&अद्यावधिकहरु जाँच्नुहोस्\nnl:Controleren op &updates\nnn:&Sjå etter ny versjon\nno:&Se etter oppdateringer...\npa:ਨਵੇ ਵਰਜਨ ਲਈ ਚੈੱਕ ਕਰੋ(&C)\npl:Szukaj &aktualizacji\npt:Procurar at&ualizações\nro:Verifică apariția unei versiuni noi\nru:Проверить наличие новой &версии\nsi:&යාවත්කාලීනකිරීම් සදහා සොයන්න\nsk:&Skontrolovať novú verziu\nsl:&Preveri za posodobitve\nsn:&Tsvaga version idzva\nsp-rs:Proveri postojanje novije verzije\nsq:&Azhurnoj\nsr-rs:Провери постојање новије верзије\nsv:&Sök efter ny version\nta:புதிய பதிப்பை தேடு\nth:&ตรวจสำหรับสอบเวอร์ชั่นใหม่\ntl:Tignan kung may bagong &bersyon\ntr:&Güncellemeleri kontrol et\ntw:檢查是否有新版本(&C)\nuk:Перевірити, чи є нова версія\nuz:&Yangi versiyani tekshirish\nvn:Kiểm tra cập nhật\n:Close\nam:Փակել\nar:إغلاق\naz:Bağla\nbg:Затваряне\nbn:বন্ধ করুন\nbr:Fechar\nbs:Zatvori\nby:Зачынiць\nca-xv:Tanca\nca:Tanca\ncn:关闭\ncy:Cau\ncz:Zavřít\nde:Schließen\ndk:Luk\nel:Κλείσιμο\nes:Cerrar\net:Sulge\neu:Itxi\nfa:بستن\nfi:Sulje\nfr:Fermer\nga:Dún\ngl:Pechar\nhe:סגור\nhi:Close\nhr:Zatvori\nhu:Bezárás\nid:Tutup\nit:Chiudi\nja:閉じる\njv:Tutup\nka:დახურვა\nkr:닫기\nku:داخستن\nlv:Aizvērt\nmk:Затвори\nml:അടയ്ക്കുക\nmy:Tutup\nne:बन्द गर्नुहोस्\nnl:Sluiten\nnn:Lukk\nno:Lukk\npl:Zamknij\npt:Fechar\nro:Inchidere\nru:Закрыть\nsi:වහන්න\nsk:Zatvoriť\nsl:Zapri\nsn:Vhara\nsp-rs:Zatvori\nsq:Mbyll\nsr-rs:Затвори\nsv:Stäng\nta:மூடு\ntr:Kapat\ntw:關閉(&C)\nuk:Закрити\nuz:Yopish\nvn:Đóng lại\n:Comic books\nam:Հումորային գրքեր\nar:الكتب الهزلية\naz:CBR, CBZ sənədləri\nbg:CBR, CBZ документи (комикси)\nbn:কমিক বই\nbr:Quadrinhos\nbs:Stripovi\nca-xv:Llibres de còmic\nca:Llibres de còmic\ncn:漫画书\ncy:Llyfrau Comics\ncz:Komiksy\nde:Comicbücher\ndk:Tegneserier\nel:Βιβλία κόμικ\nes:Cómics\net:Koomiksiraamatud\neu:Komiki liburuak\nfa:کتاب‌های فُکاهی\nfi:Sarjakuvat\nfr:Bandes dessinées\nga:Greannáin\ngl:Albumes de cómic\nhe:ספרי קומיקס\nhi:हास्य किताबें\nhr:Stripovi\nhu:Képregény fájlok\nid:Buku Komik\nit:Fumetti\nja:マンガ本\nka:კომიქსები\nkr:만화 책\nku:پەرتووکی کۆمیدی\nlt:Komiksų knygelės\nlv:Komiksu grāmatas\nmk:Стрипови\nmy:Buku komik\nne:कमिक पुस्तिका\nnl:Stripboeken\nnn:Teikneseriebøkjer\nno:Tegneserier\npl:Komiksy\npt:Banda desenhada\nro:Benzi desenate\nru:Документы CBR, CBZ (комиксы)\nsk:Komiksy\nsl:Comic books\nsp-rs:Stripovi\nsq:Comic books\nsr-rs:Стрипови\nsv:Serier\nta:சித்திரக்கதை புத்தகங்கள்\nth:หนังสือการ์ตูน\ntr:Çizgi romanlar\ntw:漫畫文件\nuk:Документи CBR, CBZ (комікси)\nuz:Komikslar\nvn:Truyện tranh comic\n:Compatibility\nam:Համատեղելիությունը\nar:التوافق\naz:Uyğunluq\nbg:Съвместимост\nbn:সামঞ্জস্য\nbr:Compatibilidade\nbs:Kompatibilnost\nca-xv:Compatibilitat\nca:Compatibilitat\ncn:兼容性\ncy:Cydnawsedd\ncz:Kompatibilita\nde:Kompatibilität\ndk:Kompatibilitet\nel:Συμβατότητα\nes:Compatibilidad\net:Ühilduvus\neu:Bateragarritasuna\nfa:سازگاری\nfi:Yhteensopivuus\nfr:Compatibilité\nga:Comhoiriúnacht\ngl:Compatibilidade\nhe:תאימות\nhi:अनुकूल\nhr:Kompatibilnost\nhu:Kompatibilitás\nid:Kompabilitas\nit:Compatibilità\nja:互換性\njv:Compatibilidad\nka:თავსებადობა\nkr:호환성\nku:گونجاو\nlv:Saderība\nmk:Компатибилност\nml:പൊരുത്തം\nmy:Kesesuaian\nne:मिल्दोजुल्दो\nnl:Compatibiliteit\nnn:Kompatibilitet\nno:Kompatibilitet\npl:Zgodność\npt:Compatibilidade\nro:Compatibilitate\nru:Совместимость\nsi:‌පෙර අනුවාදනවලට සරිලනබව\nsk:Kompatibilita\nsl:Združljivost\nsp-rs:Kompatibilnost\nsq:Përputhja\nsr-rs:Компатибилност\nsv:Kompatibilitet\nta:இணக்கத்தன்மை\nth:ความสอดคล้องกัน\ntr:Uyumluluk\ntw:相容性\nuk:Сумісність\nuz:Mosligi\nvn:Tính tương thích\n:Continuous\naf:Aanmekaar\nam:Անդադար\nar:مستمر\naz:Ardıcıl səhifələr\nbg:Непрекъснати страници\nbn:ক্রমাগত...\nbr:Contínuo\nbs:Slijedno\nby:Працягла\nca-xv:Contínua\nca:Contínua\ncn:连续页面\ncy:Didor\ncz:Jedna stránka průběžně\nde:Fortlaufend\ndk:Fortløbende\nel:Μια σελίδα, συνεχόμενα\nes:Continua\net:Jätkuv\neu:Jarraian\nfa:پیوسته\nfi:Peräkkäin\nfr:Vue continue\nfy-nl:Trochrinnend\nga:Amharc leanúnach\ngl:Contínuo\nhe:רציפה\nhi:निरन्तर\nhr:Slijedno\nhu:Folyamatos\nid:Bersambung\nit:Pagina continua\nja:連続\njv:Continuo\nka:უწყვეტი\nkr:한 페이지씩 계속\nku:بەردەوام\nkw:Heb aswa\nlt:Nenutrūkstama\nlv:Nepārtraukts\\n\nmk:Непрекинат поглед\nml:തുടര്‍ച്ച\nmm:ဆက်တိုက်\nmy:Bersambung\nne:निरन्तर\nnl:Doorlopend\nnn:Kontinuerleg\nno:Kontinuerlig\npa:ਲਗਾਤਾਰ\npl:Pojedyncza strona - układ ciągły\npt:Uma página contínua\nro:Continuu\nru:Прокрутка постранично\nsi:අඛණ්ඩව\nsk:Priebežne\nsl:Nepretrgano\nsn:Continuous\nsp-rs:Neprekidno\nsq:Vazhdimësi\nsr-rs:Непрекидно\nsv:Fortlöpande\nta:தொடர்\nth:ต่อเนื่อง\ntl:Tuloy-tuloy\ntr:Devamlı\ntw:連續頁面\nuk:Протяжний\nuz:Uzluksiz\nvn:Liên tiếp\n:Continuous Book View\nam:Շարունակել գրքի տեսքով\nar:عرض مستمر للكتاب\naz:Ardıcıl kitab formatı\nbg:Непрекъснат изглед като книга\nbr:Ver como livro contínuo\nbs:Slijedni knjiški pogled\nca-xv:Visualització contínua de llibre\nca:Visualització contínua de llibre\ncn:连续书籍视图\ncy:Golwg Llyfr Didor\ncz:Kniha průběžně\nde:Fortlaufende Buchansicht\ndk:Fortløbende bogvisning\nel:Συνεχόμενη προβολή βιβλίου\nes:Vista continua de libro\net:Jätkuv raamatuvaade\neu:Liburu Ikuspegi Jarraia\nfa:کتابی پیوسته\nfi:Kirjanäkymä, peräkkäin\nfr:Vue continue, comme un livre\nfy-nl:Fierder mei boekbyld\nga:Leabhar-amharc leanúnach\ngl:Vista de libro continua\nhe:תצוגת ספר רציפה\nhi:निरंतरित पुस्तक दृश्य\nhr:Slijedni knjiški pogled\nhu:Folyamatos könyv\nid:Tampilan Buku Bersambung\nit:Vista libro continua\nja:連続ブック ビュー\nka:წიგნის რეჟიმი (უწყვეტი)\nkr:이어서 책처럼 보기\nku:پیشاندانی پەرتووک بە بەردەوامی\nkw:Gwel-lyver heb aswa\nlt:Nenutrūkstama knygos peržiūra\nlv:Nepārtraukts grāmatas skats\nmk:Книга со непрекинат поглед\nmy:Paparan buku berterusan\nne:निरन्तर पुस्तिका दृश्य\nnl:Doorlopende boekweergave\nnn:Kontinuerleg bokvising\nno:Kontinuerlig bokvisning\npl:Widok odczytu - układ ciągły\npt:Como livro contínuo\nro:Vedere în format carte, continuu\nru:Прокрутка в разворот\nsi:පොත් දසුන අඛණ්ඩව\nsk:Priebežný knižný pohľad\nsl:Nepretrgan knjižni pogled\nsp-rs:Neprekidno, izgled knjige\nsq:Libër në vazhdimësi\nsr-rs:Непрекидно, изглед књиге\nsv:Fortlöpande bokuppslag\nta:தொடர் ஏடு வடிவ நோக்கு\nth:แสดงแบบหนังสือต่อเนื่อง\ntl:Tuluy-tuloy na tinging pang-aklat\ntr:Devamlı Kitap Gibi Görünüm\ntw:連續書本檢視\nuk:Книжковий безперервний\nuz:Uzluksiz kitob ko'rinishi\nvn:Xem sách liên tiếp\n:Continuous Facing\naf:Vertoon Aanmekaar\nam:Անդադար երկու էջով\nar:المواجهة مستمرة\naz:Ardıcıl cüt səhifələr\nbg:Непрекъснати срещуположни страници\nbn:ক্রমাগত দুটি পৃষ্ঠায়\nbr:Página dupla contínua\nbs:Dvije stranice slijedno\nby:Працягла дзьве старонкі\nca-xv:Pàgina doble contínua\nca:Pàgina doble contínua\ncn:连续对页模式\ncy:Gwynebu'n Ddidor\ncz:Dvojstránky průběžně\nde:Fortlaufende Doppelseiten\ndk:Fortløbende modstående\nel:Δύο σελίδες, συνεχόμενα\nes:Página doble continua\net:Jätkuv kaheleheküljeline\neu:Bi aldeetatik jarraian\nfa:دو صفحه‌ای پیوسته\nfi:Peräkkäin ja rinnakkain\nfr:Vue continue, page double\nfy-nl:Dûbele side trochrinnend\nga:Dhá leathanach ar leanúint\ngl:Páxina dobre continua\nhe:תצוגת 'עמוד לצד עמוד' רציפה\nhi:निरन्तर पुस्तक\nhr:Dvije stranice slijedno\nhu:Folyamatos oldalpár\nid:Halaman Berhadapan Tersambung\nit:Pagine affiancate continue\nja:連続見返し\nka:ურთიერთ-საპირისპიროდ (უწყვეტი)\nkr:두 페이지씩 계속\nku:پیشاندانی ڕووکار بە بەردەوامی\nkw:A-dal heb aswa\nlt:Nenutrūkstama dviejų puslapių\nlv:Nepārtraukti divas lappuses\nmk:Непрекинат поглед со две страници\nml:തുടര്‍ച്ചയായി കാണിക്കുക\nmm:ဆက်တိုက် မျက်နှာ\nmy:Dua belah mukasurat bersambung\nne:निरन्तर सम्मुख पृष्ठ\nnl:Dubbele pagina doorlopend\nnn:Kontunuerleg motståande\nno:Kontinuerlig - motstående\npa:ਲਗਾਤਾਰ ਕਿਤਾਬ\npl:Wiele stron - układ ciągły\npt:Duas páginas contínuas\nro:Pagină dublă continuu\nru:Прокрутка по две страницы\nsi:Facing අඛණ්ඩව\nsk:Dve strany priebežne\nsl:Nepretrgano dvostransko\nsn:Facing iriContinous\nsp-rs:Neprekidno, naspramno\nsq:Përbri në vazhdimësi\nsr-rs:Непрекидно, наспрамно\nsv:Fortlöpande uppslag\nta:தொடர் முகப்பு\nth:เป็นหน้าต่อเนื่อง\ntl:Tuloy-tuloy na Magkaharap\ntr:Devamlı çift sayfa\ntw:連續對頁模式\nuk:Дві протяжні сторінки\nuz:Uzluksiz ikkita betdan\nvn:Trang kép liên tiếp\n:Contribute Translation\naf:Dra By Tot Ñ Vertaling.\nam:Օգնել թարգմանել\nar:ساهم بالترجمة\naz:Tərcüməyə kömək et\nbg:Допринеси за превода\nbn:অনুবাদ প্রদান করুন\nbr:Contribute Translation\nbs:Pomozi prijevodom\nby:Дапамагчы з перакладам\nca-xv:Contribuïu en la traducció\nca:Contribuïu en la traducció\ncn:提供翻译\ncy:Cyfrannu Cyfieithiad.\ncz:Zaslat překlad\nde:Übersetzung beisteuern\ndk:Bidrag med oversættelse\nel:Βοηθήστε στη μετάφραση\nes:Contribuir con una traducción\net:Osale tõlkimises\neu:Lagundu Itzultzen\nfa:در ترجمه‌ی این برنامه کمک کنید\nfi:Osallistu suomennosprojektiin\nfr:Contribuer à la traduction\nfy-nl:Help mei oersetten\nga:Aistrigh é seo\ngl:Axudar coa traducción\nhe:סייע בתרגום\nhi:अनुवाद करने में मदद करें\nhr:Pomozi prijevodom\nhu:&Hozzájárulás a fordításhoz\nid:Bantu Alihbahasa\nit:Contribuisci alla traduzione\nja:翻訳の提供\nka:თარგმნაში მონაწილეობა\nkr:번역 기여\nku:پێشنیارکردنی وەرگێڕان\nkw:Keworra treylyans\nlt:Prisidėti prie vertimo\nlv:Piedalīties tulkošanā\nmk:Учествувај во преведувањето на оваа апликација\nml:മാക്സിന്‍ ബി ജൊണ്‍\nmy:Menyumbangkan alihbahasa\nne:अनुवादमा योगदान दिनुहोस्\nnl:Help met vertalen\nnn:Delta med omsetjing\nno:Bidra med oversetting\npa:ਅਨੁਵਾਦ ਕਰਨ ਵਿੱਚ ਮਦੱਦ ਕਰੋ\npl:Dodaj swoje tłumaczenie\npt:Ajudar na tradução\nro:Contribuie la traducere\nru:Помочь с переводом\nsi:පරිවර්ථනයට දායකවන්න\nsk:Prispieť k prekladu programu\nsl:Prispevajte prevod\nsn:Batsira kuturikira\nsp-rs:Učestvuj u prevođenju\nsq:Kontribuoj në përkthim\nsr-rs:Учествуј у превођењу\nsv:Bidra med översättning\nta:மொழிபெயர்ப்புக்கு பங்களி\nth:ร่วมช่วยเหลือในการแปลภาษา\ntl:Magbigay ng Saling-wika\ntr:Çeviriye katkıda bulunun.\ntw:提供翻譯\nuk:Допоможіть перекласти\nuz:Tarjima qilish\nvn:Đóng góp dịch thuật\n:Copy &Image\nam:Պատճենել &Նկարը\nar:نسخ &الصورة\naz:&Şəkli kopyala\nbg:Копиране на &изображението\nbn:&ছবি কপি করুন\nbr:Copiar &Imagem\nbs:Kopiraj &sliku\nca-xv:Copia la &imatge\nca:Copia la &imatge\ncn:复制图片(&I)\ncy:Copïo &Delwedd\ncz:Kopírovat &obrázek\nde:&Bild kopieren\ndk:Kopier &billede\nel:Αντιγραφή &εικόνας\nes:Copiar &imagen\net:Kopeeri &pilt\neu:Kopiatu &Irudia\nfa:رونوشت از &عکس\nfi:Kopioi &kuva\nfr:Copier l'&image\nga:Macasamhlaigh an &Íomhá\ngl:Copiar a &imaxe\nhe:העתק תמונה\nhi:&छवि नक़ल करें\nhr:Kopiraj Sl&iku\nhu:&Kép másolása\nid:Salin &Gambar\nit:Copia &immagine\nja:画像をコピー(&I)\njv:Copiar &Imagen\nka:სურათის &კოპირება\nkr:이미지 복사(&I)\nku:لەبەرگرتنەوەی &وێنە\nlv:Kopēt &attēlu\nmk:Копирај &слика\nmy:Salin &Imej\nne:&छवि प्रतिलिपि बनाउनुहोस्\nnl:Afbeelding kopiëren\nnn:Kopier &bilete\nno:Kopier &Bilde\npl:Kopiuj obraz\npt:Copiar &imagem\nro:Copiere &Imagine\nru:Скопировать &изображение\nsi:රුපය ‌කොපි කරන්න\nsk:Kopírovať &obrázok\nsl:Kopiraj &sliko\nsn:kopa nemufananidzo\nsp-rs:Kopiraj sliku\nsq:Kopjoj &figurën\nsr-rs:Копирај слику\nsv:Kop&iera bild\nta:நகல் & படம்\nth:คัดลอกรูปภาพ\ntr:&Görüntüyü Kopyala\ntw:複製圖片(&I)\nuk:Скопіювати зображення\nuz:&Rasmni nusxa olish\nvn:Sao chép hình ảnh\n:Copy &Link Address\nam:Պատճենել &հղումը\nar:نسخ &رابط العنوان\naz:Keçidin &ünvanını kopyala\nbg:Копиране на интернет &адреса\nbr:Copiar Ata&lho\nbs:Kopiraj adresu &linka\nca-xv:Copia l'adreça de l'enllaç\nca:Copia l'adreça de l'enllaç\ncn:复制链接地址(&L)\ncy:Copïo &Dolen Cyfeiriad\ncz:Kopírovat &adresu odkazu\nde:Adresse des &Links kopieren\ndk:Kopier &henvisningsadresse\nel:Αντιγραφή &διεύθυνσης\nes:Copiar dirección del en&lace\net:Kopeeri &lingi aadress\neu:Kopiatu &Lotura Helbidea\nfa:رونوشت از نشانی &پیوند\nfi:Kopioi &linkin osoite\nfr:Copier l'adresse du &lien\nga:Macasamhlaigh seoladh an naisc\ngl:Copiar o enderezo da &ligazón\nhe:העתק כתובת קישור\nhi:&लिंक पता नक़ल करें\nhr:Kopiraj adresu &linka\nhu:&Hivatkozás címének másolása\nid:Salin Alamat &Tautan\nit:Copia indirizzo co&llegamento\nja:リンク先のアドレスをコピー(&L)\nka:&ბმულის კოპირება\nkr:링크 주소 복사(&L)\nku:لەبەرگرتنەوەی &ناونیشانی بەستەر\nlt:Kopijuoti &saito adresą\nlv:Kopēt &saites adresi\nmk:Копирај ја адресата на &врската\nmy:Salin &Alamat Pautan\nne:&लिङ्क ठेगानाको प्रतिलिपि बनाउनुहोस्\nnl:&Verwijzing kopiëren\nnn:Kopier &lenkeadresse\nno:Kopier &lenkeadresse\npl:Kopiuj adres z &odnośnika\npt:Copiar endereço da &ligação\nro:Copiază adresa &legăturii\nru:Скопировать адрес &ссылки\nsk:Kopírovať odkaz\nsl:Kopiraj nas&lov povezave\nsp-rs:Kopiraj adresu veze\nsq:Kopjoj adresën e &lidhësit\nsr-rs:Копирај адресу везе\nsv:Kopiera länkadress\nta:நகல் &இணைப்பு முகவரி\nth:คัดลอก Link Address\ntl:Kopyahin nag address ng &link\ntr:&Bağlantı Adresini Kopyala\ntw:複製連結位址(&L)\nuk:Копіювати адресну стрічку\nuz:&Bog' manzilini nusxa olish\nvn:Chép địa chỉ liên kết\n:Copy Co&mment\nam:Պատճենել մեկ&նաբանությունը\nar:نسخ ال&تعليق  \naz:&Şərhi kopyala\nbg:Копиране на &коментара\nbr:Copiar Co&mentário\nbs:Kopiraj ko&mentar\nca-xv:Copia el co&mentari\nca:Copia el co&mentari\ncn:复制注释(&M)\ncy:Copïo &Sylw\ncz:Kopírovat ko&mentář\nde:K&ommentar kopieren\ndk:Kopier ko&mmentar\nel:Αντιγραφή σ&χολίου\nes:Copiar co&mentario\net:Kopeeri ko&mmentaar\neu:Kopiatu Ira&dokizuna\nfa:رونوشت از تو&ضیح\nfi:Kopioi kommentti\nfr:Copier le co&mmentaire\nga:Macasamhlaigh an nóta tráchta\ngl:Copiar o co&mentario\nhe:העתק הערה\nhi:&टिप्पणी नक़ल करें\nhr:Kopiraj ko&mentar\nhu:Me&gjegyzés másolása\nid:Salin &Komentar\nit:Copia co&mmento\nja:コメントをコピー(&M)\nka:კო&მენტარის კოპირება\nkr:주석(설명) 복사(&M)\nku:لەبەرگرتنەوەی لێد&وانەکان\nlt:Kopijuoti ko&mentarą\nlv:Kopēt &komentāru\nmk:Копирај коментар\nmy:Salin Ko&men\nne:&टिप्पणीको प्रतिलिपि बनाउनुहोस्\nnl:Notitie kopiëren\nnn:Kopier ko&mmentar\nno:Kopier ko&mmentar\npl:Kopiuj ko&mentarz\npt:Copiar co&mentário\nro:Copiază co&mentariul\nru:Скопировать ко&мментарий\nsk:Kopírovať ko&mentár\nsl:Kopiraj ko&mentar\nsp-rs:Kopiraj komentar\nsq:Kopjoj ko&mentin\nsr-rs:Копирај коментар\nsv:Kopiera kommentar\nta:கருத்து நகலெடுக்க\nth:คัดลอกความเห็น\ntl:Kopyahin ang komento\ntr:&Açıklamayı Kopyala\ntw:複製註解(&M)\nuk:Копіювати коментар\nuz:&Izohni nusxa olish\nvn:Chép chú thích\n:Copying text was denied (copying as image only)\nam:Տեքստի պատճենումը թույլատրված չէ (պատճենում է որպես պատկեր)\nar:(ناسخ النص رفض (ناسخ باسم صورة فقط \naz:Mətni kopyalamaq mümkün olmadı (şəkil kimi kopyalanır)\nbg:Текстът не може да бъде копиран (затова беше копиран само като картинка)\nbn:লেখা কপি করতে দেয়া হয়নি (ছবি-মাত্র কপি করা হচ্ছিল)\nbr:Cópia de texto negada (copiando somente como imagem)\nbs:Kopiranje teksta je nemoguće (kopirano kao slika)\nca-xv:No es pot copiar el text (només es copia com a imatge)\nca:No es pot copiar el text (només es copia com a imatge)\ncn:复制文本失败 (只能复制为图片)\ncy:Copïo testun wedi ei atal (copïo fel delwedd yn unig)\ncz:Kopírování textu bylo odepřeno (zkopírováno jako obraz)\nde:Text kopieren verweigert (nur als Bild kopiert)\ndk:Kopiering af tekst blev nægtet (kopierer kun som billede)\nel:Η αντιγραφή κειμένου δεν επετράπη (μόνο ως εικόνα)\nes:No se permite copiar como texto (copiando como imagen)\net:Teksti kopeerimine on keelatud (kopeerida saab vaid pildina)\neu:Idazkia kopiatzea eragotzita (kopiatzea irudi bezala bakarrik)\nfa:رونوشت‌گیری از متن ممنوع است (رونوشت فقط به صورت عکس)\nfi:Tekstin kopioiminen kiellettiin (kopioidaan vain kuvana)\nfr:La copie de texte est refusée (seule une capture d’écran est faite)\nga:Níorbh fhéidir téacs a mhacasamhlú (macasamhlú mar íomhá amháin)\ngl:Impediuse copiar texto (estase a copiar só como imaxe)\nhe:העתקת הטקסט לא התאפשרה (מעתיק כתמונה בלבד)\nhi:टेक्स्ट कि प्रतियां बनाने से अस्वीकृत ( केवल छवि के रूप में प्रतिलिपिकरण )\nhr:Kopiranje teksta je nemoguće (kopirano kao slika)\nhu:Szöveg másolása tiltott (csak képként másolva)\nid:Menyalin teks ditolak (menyalin sebagai gambar saja)\nit:Impossibile copiare il testo (copiare solo come immagine)\nja:テキストのコピーは拒否されました (イメージとしてのコピーのみ)\nka:ტექსტის კოპირება აკრძალულია (კოპირდება როგორც სურათი)\nkr:문구 복사가 거부됐습니다. (이미지만 복사합니다.)\nku:(لەبەرگرتنەوەی دەق ڕەتکرایەوە (تەنها لەبەرگرتنەوەی وێنە\nlt:Teksto kopijavimas uždraustas (kopijuojamas tik ekrano vaizdas)\nlv:Teksta kopēšana ir liegta (kopē tikai kā attēlu)\nmk:Копирањето на текстот беше одбиено (копирање само во вид на слика)\nmy:Salinan teks telah ditolak (menyalin sebagai imej sahaja)\nne:पाठ प्रतिलिपि अस्वीकार भयो (छविको रुपमा प्रतिलिपि बनाईदैछ)\nnl:Tekst kopiëren niet toegestaan (kopieer als afbeelding)\nnn:Kopiering av tekst blei nektast (Kopierer kun som bilete)\nno:Mangler tillatelse til kopiering av tekst (kopierer kun som bilde)\npl:Nie można kopiować tekstu (można kopiować jako obrazy)\npt:A cópia do texto foi recusada (copie como imagem)\nro:Copierea textului interzisă (s-a copiat ca imagine)\nru:Скопировать текст невозможно (копируется как изображение)\nsi:පෙළ පිටපත්කිරීමට නොහැක (ඡායාරූප පිටපත්කිරීම පමණයි)\nsk:Kopírovanie textu odmietnuté (iba ako obrázok)\nsl:Kopiranje besedila je bilo zavrnjeno (kopiranje samo kot slika)\nsp-rs:Kopiranje teksta je odbijeno (može se kopirati samo kao slika)\nsq:Ndalohet kopjimi i tekstit (kopjohet vetëm si figurë)\nsr-rs:Копирање текста је одбијено (може се копирати само као слика)\nsv:Textkopiering tilläts ej (kopierar som bild)\nta:உரை நகல் மறுக்கப்பட்டது (படமாக மட்டும் நகலெடுக்கும்)\nth:การคัดลอกข้อความถูกปฏิเสธ (คัดลอกแบบรูปภาพเท่านั้น)\ntl:Hindi maaaring kopyahin ang mensahe (kinopya bilang isang imahe lamang)\ntr:Metnin kopyalanması reddedildi (görüntü olarak kopyalandı)\ntw:複製文字失敗 (只能複製為圖片)\nuk:Копіювання тексту заборонено (тільки як зображення)\nuz:Matnni nusxa olish mumkin emas (rasm nusxa olinmoqda)\nvn:Chép văn bản bị từ chối (chỉ được chép như hình ảnh)\n:Copyright:\naf:Kopiereg\nam:Հեղ. իրավունքը.\nar:حقوق الطبع محفوظة:\naz:Müəlliflik hüququ:\nbg:Авторско право:\nbn:কপিরাইটঃ\nbr:Direito autoral:\nbs:Prava pridržana:\nca-xv:Copyright:\nca:Copyright:\ncn:版权:\ncy:Hawlfraint\ncz:Autorská práva:\nde:Copyright:\ndk:Ophavsret:\nel:Πνευματική ιδιοκτησία:\nes:Derechos de autor:\net:Autoriõigus:\neu:Copyrighta:\nfa:حقّ نشر\nfi:Copyright:\nfr:Copyright :\nga:Cóipcheart:\ngl:Copyright:\nhe:זכויות יוצרים:\nhi:पाठाधिकार\nhr:Autorsko pravo\nhu:Szerzői jog:\nid:Hak Cipta\nit:Copyright:\nja:コピーライト:\njv:Derechos de autor\nkr:저작권:\nku:مافی لەبەرگرتنەوە:\nlv:Autortiesības:\nmk:Авторско право:\nml:പകര്‍പ്പവകാശം\nmy:Hakcipta\nne:प्रतिलिपिअधिकार:\nnl:Auteursrecht\nnn:Opphavsret:\nno:Opphavsrett:\npl:Prawo autorskie:\npt:Direitos de autor:\nro:Drept de autor\nru:Авторское право:\nsi:බුද්ධිමය දේපළ\nsk:Autorské práva:\nsl:Avtorske pravice:\nsp-rs:Autorska prava:\nsq:Kopirajti:\nsr-rs:Ауторска права:\nsv:Copyright:\nta:காப்புரிமை:\nth:ลิขสิทธิ์:\ntr:Telif hakkı:\ntw:版權:\nuk:Копірайт:\nuz:Mualliflik huquqi:\nvn:Quyền tác giả:\n:Could not obtain Printer properties\nam:Տպիչի հատկությունները հասանելի չեն\nar:تعذر الحصول على خصائص الطابعة\naz:Printer xüsusiyyətlərini müəyyən etmək mümkün olmadı\nbg:Настройките на принтера не са намерени\nbn:মুদ্রণ যন্ত্রের প্রোপারটিজ অর্জন করা সম্ভব হয়নি\nbr:Não foi possível obter as propriedades da Impressora\nbs:Ne mogu dobaviti postavke štampača\nca-xv:No es poden obtindre les propietats de la impressora\nca:No es poden obtenir les propietats de la impressora\ncn:无法获取打印机属性\ncy:Methu canfod priodweddau Argraffydd\ncz:Nelze získat vlastnosti tiskárny\nde:Konnte Druckereigenschaften nicht bestimmen\ndk:Kan ikke hente printeregenskaber\nel:Δεν ήταν δυνατή η ανάκτηση των ιδιοτήτων του εκτυπωτή\nes:No se pudieron obtener las propiedades de la impresora\net:Printeri sätteid ei õnnestunud lugeda\neu:Ezinezkoa Irarkailu ezaugarriak lortzea\nfa:نمی‌توان خصوصیات چاپگر را به دست آورد\nfi:Tulostimen ominaisuuksia ei voinut lukea\nfr:Impossible d'obtenir les propriétés de l'imprimante\nga:Níorbh fhéidir airíonna an chlóire a fháil\ngl:Non se puideron obter as propiedades da impresora\nhe:הגישה אל מאפייני המדפסת נכשלה.\nhi:प्रिंटर के गुणों प्राप्त नहीं कर पा रहा\nhr:Nemoguće pribaviti svojstva printera\nhu:A nyomtató tulajdonságai nem érhetőek el\nid:Gagal mendapatkan properti Pencetak\nit:Impossibile ottenere info proprietà stampante\nja:プリンターのプロパティを開けませんでした\nka:პრინტერის თვისებების მიღება ვერ მოხერხდა\nkr:프린터 속성을 가져올 수 없습니다.\nku:ناتوانرێت تایبەتمەندییەکانی چاپکەر(پرێنتەر) وەربگیرێت\nlt:Spausdintuvo savybių sužinoti nepavyko\nlv:Nevar iegūt printera rekvizītus\nmk:Не можам да дојдам до својствата на печатачот\nmy:Gagal mendapatkan maklumat Pencetak\nne:मुद्रक गुणहरु प्राप्त गर्न सकिएन\nnl:Kan geen printereigenschappen verkrijgen\nnn:Kunne ikkje hente utskrivaregenskapene\nno:Kunne ikke innhente skriveregenskaper\npl:Nie można uzyskać właściwości drukarki\npt:Não foi possível obter as propriedades da impressora\nro:Nu s-au putut obține proprietățile imprimantei\nru:Не удалось определить свойства принтера\nsk:Získanie vlastností tlačiarne zlyhalo\nsl:Ni bilo mogoče dobiti Lastnosti tiskalnika\nsp-rs:Nije moguće prikazati osobine štampača\nsq:Nuk mund të marrë vetitë e printerit\nsr-rs:Није могуће приказати особине штампача\nsv:Kunde inte hämta egenskaper för skrivare\nta:அச்சுப்பொறியின் பண்புகள் பெற முடியவில்லை\nth:ไม่ได้รับคุณสมบัติเครื่องพิมพ์\ntr:Yazıcı özellikleri temin edilemedi\ntw:無法取得印表機特性\nuk:Неможливо отримати налаштування принтера\nuz:Printer xossalarini olib bo'lmadi\nvn:Không thể có được thuộc tính Máy in\n:Couldn't create temporary directory\nam:Հնարավոր չեղավ ստեղծել ժամանակավոր թղթապանակ\nar:لا يمكن إنشاء دليل مؤقت\naz:Müvəqqəti qovluğu yaratmaq mümkün olmadı\nbg:Не може да се създаде временна директория\nbn:অস্থায়ী ডিরেক্টরি প্রস্তুত করা সম্ভব হয়নি\nbr:Não foi possível criar pasta temporária\nbs:Neuspješno kreiranje privremenog direktorija\nca-xv:No es pot crear el directori temporal\nca:No es pot crear el directori temporal\ncn:无法创建临时目录\ncy:Methu creu cyfeiriadur dros dro\ncz:Nepodařilo se vytvořit dočasný adresář\nde:Konnte das Temporärverzeichnis nicht erstellen\ndk:Kunne ikke oprette midlertidig mappe\nel:Αδυναμία δημιουργίας προσωρινού φακέλου\nes:No se pudo crear la carpeta temporal\net:Ei suudetud luua ajutist kataloogi\neu:Ezinezkoa aldibaterako zuzenbidea sortzea\nfa:نمی‌توان پوشه‌ی موقت را ایجاد کرد\nfi:Väliaikaiskansion luominen epäonnistui\nfr:Impossible de créer un répertoire temporaire\nga:Níorbh fhéidir comhadlann sealadach a chruthú\ngl:Non se puido crear o cartafol temporal\nhe:יצירת תיקייה זמנית נכשלה.\nhi:अस्थायी निर्देशिका नहीं बना सका\nhr:Nemoguće napraviti privremenu mapu\nhu:Ideiglenes könyvtár létrehozása sikertelen\nid:Gagal membuat direktori sementara\nit:Impossibile creare la cartella temporanea\nja:一時ディレクトリを作成できませんでした\nka:დროებითი საქაღალდე ვერ შეიქმნა\nkr:임시 디렉토리를 만들 수 없습니다.\nku:ناتوانرێت فۆڵدەری کاتی دروستبکرێت\nlv:Nevarēja izveidot pagaidu direktoriju\nmk:Не можам да создадам привремена папка\nmy:Tidak dapat mencipta direktori sementara\nne:अस्थाई डाइरेक्टरी बनाउन सकिएन\nnl:Kan tijdelijke map niet aanmaken\nnn:Kunne ikkje lage midlertidig direktiv\nno:Kunne ikke opprette en midlertidig mappe\npl:Nie można utworzyć katalogu tymczasowego\npt:Não foi possível criar a pasta temporária\nro:Nu s-a putut crea un director temporar\nru:Не удалось создать временную директорию\nsk:Nie je možné vytvoriť dočasný adresár\nsl:Ni bilo mogoče ustvariti začasne mape\nsp-rs:Greška prilikom kreiranja privremenog direktorijuma\nsq:Nuk mund të krijojë direktorinë e përkohshme\nsr-rs:Привремени директоријум се не може креирати\nsv:Kunde inte skapa en tillfällig katalog\nta:தற்காலிக கோப்புறையினை உருவாக்க இயலவில்லை\ntr:Geçici dizin oluşturulamadı\ntw:無法建立暫存資料夾\nuk:Не вдалося створити тимчасову папку\nuz:Vaqtincha direktoriyani yaratib bo'lmadi\nvn:Không tạo được thư mục tạm\n:Couldn't create the installation directory\nam:Հնարավոր չեղավ ստեղծել տեղադրման թղթապանակը\nar:لا يمكن إنشاء دليل التثبيت\naz:Quraşdırma qovluğunu yaratmaq mümkün olmadı\nbg:Не може да се създаде директория за инсталация\nbn:ইন্সটলএসন ডিরেক্টরি প্রস্তুত করা সম্ভব হয়নি\nbr:Não foi possível criar a pasta de instalação.\nbs:Neuspješno kreiranje instalacijskog direktorija\nca-xv:No es pot crear el directori d'instal·lació\nca:No es pot crear el directori d'instal·lació\ncn:无法创建安装文件夹\ncy:Methu creu'r cyfeiriadur gosod\ncz:Nepodařilo se vytvořit adresář pro instalaci\nde:Konnte das Installationsverzeichnis nicht erstellen\ndk:Kunne ikke oprette installationsmappe\nel:Αδυναμία δημιουργίας φακέλου εγκατάστασης\nes:No se pudo crear la carpeta de instalación\net:Ei suudetud luua paigalduskataloogi\neu:Ezinezkoa ezarpen zuzenbidea sortzea\nfa:نمی‌توان پوشه‌ی نصب را ایجاد کرد\nfi:Asennuskansion luominen epäonnistui\nfr:Impossible de créer le répertoire d'installation\nga:Níorbh fhéidir an chomhadlann suiteála a chruthú\ngl:Non se puido crear o cartafol de instalación\nhe:יצירת תיקיית התקנה נכשלה.\nhi:अस्थायी निर्देशिका नहीं बना सका\nhr:Nemoguće napraviti instalacijsku mapu\nhu:Telepítési könyvtár létrehozása sikertelen\nid:Gagal membuat direktori instalasi\nit:Impossibile creare la cartella di installazione\nja:インストール先ディレクトリを作成できませんでした\nkr:설치 디렉토리를 만들 수 없습니다.\nku:ناتوانرێت فۆڵدەری دابەزاندن دروست بکرێت\nlv:Nevarēja izveidot instalācijas direktoriju\nmk:Не можам да ја создадам папката за инсталација\nmy:Tidak dapat mencipta direktori pemasangan\nnl:Kan de installatiemap niet aanmaken\nnn:Kunne ikkje lage installasjonsdirektivet\nno:Kunne ikke opprette installasjonsmappen \npl:Nie można utworzyć katalogu instalacyjnego\npt:Não foi possível criar a pasta de instalação\nro:Nu s-a putut crea directorul de instalare\nru:Не удалось создать директорию для установки\nsk:Nie je možné vytvoriť inštalačný adresár\nsl:Ni bilo mogoče ustvariti mape za namestitev\nsp-rs:Nemoguće kreirati instalacioni direktorijum\nsq:Nuk mund të krijojë direktorinë për instalimin\nsr-rs:Инсталациони директоријум се не може креирати\nsv:Kunde inte skapa installationsmappen\nta:நிறுவல் கோப்புறையினை உருவாக்க இயலவில்லை\ntr:Kurulum dizini oluşturulamadı\ntw:無法建立安裝資料夾\nuk:Не вдалося створити папку для встановлення\nuz:O'rnatish directoriyasini yaratib bo'lmadi\nvn:Không tạo được thư mục cài đặt\n:Couldn't initialize printer\nam:Հնարավոր չէ գտնել տպիչ\nar:لا يمكن تشغيل الطابعة\naz:Printeri işə salmaq mümkün olmadı\nbg:Принтерът не може да бъде инициализиран\nbn:মুদ্রণ যন্ত্র আরম্ভ করা সম্ভব হয়নি\nbr:Não foi possível acionar a impressora\nbs:Ne mogu inicijalizirati štampač\nca-xv:No es pot inicialitzar la impressora\nca:No es pot inicialitzar la impressora\ncn:不能初始化打印机\ncy:Methu cychwyn yr argraffydd\ncz:Tiskárnu nelze inicializovat\nde:Der Drucker konnte nicht initialisiert werden\ndk:Kunne ikke starte printer\nel:Απέτυχε η έναρξη του εκτυπωτή\nes:No se pudo inicializar la impresora\net:Printerit ei saa lähtestada\neu:Ezinezkoa irarkailua abiaraztea\nfa:متأسفانه چاپگر منتخب در دسترس نیست\nfi:Tulostimen valmistelu epäonnistui\nfr:Impossible d'initialiser l'imprimante\nfy-nl:Kin de printer net inisjalisearje\nga:Níorbh fhéidir an clóire a thúsú\ngl:Non se pode inicializar a impresora\nhe:אתחול המדפסת נכשל.\nhi:प्रिंटर प्रारंभ नहीं हो पा रहा\nhr:Ne mogu inicijalizirati pisač\nhu:A nyomtató inicializálása nem sikerült\nid:Gagal memulai pencetak\nit:Impossibile inizializzare la stampante\nja:プリンターを初期化できませんでした\nka:პრინტერის ინიციალიზაცია ვერ მოხერხდა\nkr:프린터를 초기화할 수 없습니다.\nku:ناتوانرێت جاپکەر ڕێکبخرێت\nkw:Ny yllys darbari pryntyer\nlt:Nepavyko prisijungti prie spausdintuvo\nlv:Neizdevās inicializēt printeri\nmk:Не можам да го подготвам печатачот\nmy:Tidak dapat memulakan pencetak\nne:मुद्रकलाई आरम्भ गर्न सकिएन\nnl:Kan de printer niet initialiseren\nnn:Kunne ikkje starte utskrivaren\nno:Kunne ikke klargjøre skriveren\npl:Nie można zainicjować drukarki\npt:Não foi possível iniciar a impressora\nro:Nu s-a putut inițializa imprimanta\nru:Не удалось инициализировать принтер\nsi:මුද්‍රණ යන්ත්‍රය ඇරඹිය නොහැක\nsk:Inicializácia tlačiarne zlyhala\nsl:Ni bilo mogoče inicializirati tiskalnika\nsp-rs:Nije moguće pokrenuti štampač\nsq:Nuk mund të vë në punë printerin\nsr-rs:Није могуће покренути штампач\nsv:Kunde ej använda skrivare\nta:அச்சுப்பொறியை தொடக்க முடியவில்லை\nth:ไม่สามารถเตรียมเครื่องพิมพ์\ntl:Hindi ma-initialize ang printer\ntr:Yazıcı başlatılamadı\ntw:無法初始化印表機\nuk:Неможливо знайти друкарку\nuz:Printerni ishga tushirib bo'lmadi\nvn:Không khởi động được máy in\n:Couldn't install PDF previewer\nam:Հնարավոր չեղավ տեղակայել PDF-ի նախադիտումը\nar:لم استطع تثبيت معاين المستندات المحمولة\naz:PDF önbaxış alətini quraşdırmaq mümkün olmadı\nbg:Програмата за преглед на PDF файлове не се инсталира\nbn:পিডিএফ প্রিভিউয়ার ইন্সটল করা সম্ভব হয়নি\nbr:Não foi possível instalar o pré-visualizador para PDF\nbs:Neuspješno instaliranje PDF preglednika\nca-xv:No es pot instal·lar el visor ràpid de PDF\nca:No es pot instal·lar el visor ràpid de PDF\ncn:无法安装 PDF 预览器\ncy:Mehu gosod rhagolygwr PDF\ncz:Nelze nainstalovat PDF prohlížeč\nde:Konnte die PDF Vorschau nicht installieren\ndk:Kunne ikke installere PDF-fremviser\nel:Δεν ήταν δυνατή η εγκατάσταση του PDF previewer\nes:No se pudo instalar el previsualizador de PDF\net:Ei suudetud paigaldada PDF-eelvaaturit\neu:Ezinezkoa PDF aurreikustatzailea ezartzea\nfa:نمی‌توان پیش‌نمایشگر PDF را نصب کرد.\nfi:PDF-esikatselijan asentaminen epäonnistui\nfr:Impossible d'installer l'aperçu PDF\nga:Níorbh fhéidir réamhamharcóir PDF a shuiteáil\ngl:Non se puido instalado o previsualizador de PDF\nhe:התקנת תצוגה מקדימה לקובצי PDF נכשלה.\nhr:Nemoguće instalirati PDF preglednik\nhu:PDF előnézet-megjelenítő telepítése sikertelen\nid:Gagal menginstal pratilik PDF\nit:Impossibile installare modulo anteprima PDF\nja:PDF プレビューアをインストールできませんでした\nkr:PDF 미리보기를 설치할 수 없습니다.\nku:ناتوانرێت پیشاندەری PDF دابەزێندرێت\nlv:Nevarēja instalēt PDF priekšskatījumu\nmk:Не можам да инсталирам прикажувачот на PDF\nmy:Tidak dapat memasang previewer PDF\nnl:Kan PDF-previewer niet installeren\nnn:Kunne ikkje installere PDF-forhandsvisar\nno:Kunne ikke installere PDF forhåndsvisning\npl:Nie można zainstalować podglądu PDF\npt:Não foi possível instalar o antevisão de PDF\nro:Nu s-a putut instala previzualizatorul PDF\nru:Не удалось установить просмотрщик PDF\nsk:Nie je možné nainštalovať PDF prehliadač rýchlych náhľadov\nsl:Ni bilo mogoče namestiti predogleda za PDF\nsp-rs:Nemoguće instalirati PDF pregledač\nsq:Nuk mund të instalojë parashikuesin e PDF-ve\nsr-rs:Прегледач ПДФ немогуће инсталирати\nsv:Kunde inte installera förhandstitt av PDF:er\nta:PDF முன்னோட்டம் நிறுவ இயலவில்லை\ntr:PDF ön zileyici yüklenemedi\ntw:無法安裝 PDF 預覽器\nuk:Не вдалося встановити програму для попереднього перегляду PDF\nuz:PDF ko'rish vositasini o'rnatib bo'lmadi\nvn:Không thể cài đặt phần hiển thị trước PDF\n:Couldn't install PDF search filter\nam:Հնարավոր չեղավ տեղակայել PDF-ի որոնման պայման\nar:لم أستطع تثبيت تصفية بحث الملفات المحمولة\naz:PDF axtarış filtrini quraşdırmaq mümkün olmadı\nbg:Не можа да се инсталира PDF филтър за търсене\nbn:পিডিএফ খোঁজ ফিল্টার ইন্সটল করা সম্ভব হয়নি\nbr:Não foi possível instalar o filtro de pesquisa para PDF\nbs:Neuspješno instaliranje filtera za pretragu PDF-ova\nca-xv:No es pot instal·lar el filtre de cerca PDF\nca:No es pot instal·lar el filtre de cerca PDF\ncn:无法安装 PDF 搜索过滤器\ncy:Methu gosod hidl chwilio PDF\ncz:Nelze nainstalovat vyhledávací PDF filtr\nde:Konnte den PDF Suchfilter nicht installieren\ndk:Kunne ikke installere PDF-søgefilter\nel:Δεν μπόρεσε να γίνει εγκατάσταση του φίλτρου αναζήτησης PDF\nes:No se pudo instalar el filtro de búsqueda PDF\net:Ei suudetud paigaldada PDF otsingufiltrit\neu:Ezinezkoa PDF bilaketa iragazkia ezartzea\nfa:نمی‌توان فیلتر جستجوی PDF را نصب کرد.\nfi:PDF-hakusuodattimen asentaminen epäonnistui\nfr:Impossible d'installer le filtre de recherche PDF\nga:Níorbh fhéidir scagaire cuardaigh PDF a shuiteáil\ngl:Non se puido instalar o filtro de busca de PDF\nhe:התקנת מסנן חיפוש ל- PDF נכשלה.\nhr:Nemoguće instalirati PDF filter pretraživanja\nhu:PDF keresési szűrő telepítése sikertelen\nid:Gagal memasang filter pencari PDF\nit:Impossibile installare filtro ricerca PDF\nja:PDF 検索フィルタをインストールできませんでした\nka:PDF ძიების ფილტრის ინსტალაცია ვერ მოხერხდა\nkr:PDF 검색 필터를 설치할 수 없습니다.\nku:ناتوانرێت فرمانی گەڕانی PDF دابەزێندرێت\nlv:Nevarēja instalēt PDF meklēšanas filtru\nmk:Не можам да инсталирам филтер за пребарување на PDF\nmy:Tidak dapat memasang penapis carian PDF\nnl:Kan PDF-zoekfilter niet installeren\nnn:Kunne ikkje installere PDF-søkjefilter\nno:Kunne ikke installere PDF søkefilter\npl:Nie można zainstalować filtru przeszukiwania PDF\npt:Não foi possível instalar o filtro de procuras\nro:Nu s-a putut instala filtrul de cautare PDF\nru:Не удалось установить фильтр поиска PDF\nsk:Nie je možné nainštalovať PDF vyhľadávací filter\nsl:Ni bilo mogoče namestiti filtra za PDF iskanje\nsp-rs:Nemoguće instalirati PDF filter pretrage\nsq:Nuk mund të instalojë kërkuesin e PDF-ve\nsr-rs:Немогуће инсталирати филтер за претрагу\nsv:Kunde inte installera sökfilter för PDF\nta:PDF தேடலை நிறுவ இயலவில்லை\ntr:PDF arama filtresi yüklenemedi\ntw:無法安裝 PDF 搜索過濾器\nuk:Не вдалося встановити фільтр пошуку для PDF\nuz:PDF qidirish filtrini o'rnatib bo'lmadi\nvn:Không thể cài đặt bộ lọc tìm kiếm PDF\n:Couldn't obtain temporary directory\nam:Հնարավոր չեղավ ստանալ ժամանակավոր թղթապանակ\nar:لم أستطع الحصول على الدليل المؤقت\naz:Müvəqqəti qovluğu təyin etmək mümkün olmadı\nbg:Не можа да се получи временна директория\nbr:Não foi possível obter a pasta temporária\nbs:Neuspješno dobavljanje privremenog direktorija\nca-xv:No es pot obtindre el directori temporal\nca:No es pot obtenir el directori temporal\ncn:无法获得暂存文件夹\ncy:Methu canfod cyfeiriadur dros dro\ncz:Dočasný adresář není dostupný\nde:Konnte das temporäre Verzeichnis nicht finden\ndk:Kunne ikke tilgå midlertidig mappe\nel:Αδυναμία ανάκτησης προσωρινού φακέλου\nes:No se pudo obtener la carpeta temporal\net:Ei suudetud luua ajutist kataloogi\neu:Ezinezkoa aldibaterako zuzenbidea lortzea\nfa:دسترسی به پوشه‌ی موقت مقدور نیست\nfi:Väliaikaishakemiston käyttäminen epäonnistui\nfr:Impossible d'obtenir un répertoire temporaire\nga:Níorbh fhéidir an chomhadlann sealadach a fháil\ngl:Non se puido obter o cartafol temporal\nhe:הגישה לתיקייה הזמנית נכשלה.\nhr:Nemoguće dobiti privremenu mapu\nhu:Ideiglenes könyvtár nem érhető el\nid:Gagal mendeteksi direktori sementara\nit:Impossibile ottenere la cartella temporanea\nja:一時ディレクトリを確保できませんでした\nkr:임시 디렉토리를 가져올 수 없습니다.\nku:ناتوانرێت فۆڵدەری کاتی بدۆزرێتەوە\nlv:Nevarēja iegūt pagaidu direktoriju\nmk:Не можам да пристапам до привремената папка\nmy:Tidak boleh mendapatkan direktori sementara\nnl:Kan tijdelijke map niet verkrijgen\nnn:Kunne ikkje hente midlertidig direktiv\nno:Kunne ikke finne midlertidig mappe\npl:Nie można uzyskać katalogu tymczasowego\npt:Não foi possível obter a pasta temporária\nro:Nu s-a putut obtine directorul temporar\nru:Не удалось определить временную директорию\nsk:Požiadavka na dočasný adresár bola neúspešná\nsl:Ni bilo mogoče pridobiti začasne mape\nsp-rs:Nemoguć pristup privremenom direktorijumu\nsq:Nuk mund të sigurojë direktorinë e përkohshme\nsr-rs:Немогућ приступ привременом директоријуму\nsv:Kunde inte hämta temp-katalog\nta:தற்காலிக கோப்புறையை அடைய முடியவில்லை\ntr:Geçici dizin bulunamadı\ntw:無法獲得暫存資料夾\nuk:Не вдалося отримати розташування тимчасової папки\nuz:Vaqtinchalik direktoriyani olib bo'lmadi\nvn:Không thể tìm được thư mục tạm\n:Couldn't remove installation directory\nam:Հնարավոր չեղավ ջնջել տեղադրման թղթապանակը\nar:لا يمكن إزالة دليل التثبيت\naz:Quraşdırma qovluğunu silmək mümkün olmadı\nbg:Не можа да се изтрие инсталационната директория\nbr:Não foi possível remover a pasta de instalação\nbs:Neuspješno uklanjanje instalacijskog direktorija\nca-xv:No es pot suprimir el directori d'instal·lació\nca:No es pot suprimir el directori d'instal·lació\ncn:无法移除安装目录\ncy:Methu tynnu'r cyfeiriadur gosod\ncz:Nepodařilo se odstranit adresář pro instalaci\nde:Konnte das Installationsverzeichnis nicht löschen\ndk:Kunne ikke fjerne installationsmappe\nel:Αδυναμία μετακίνησης φακέλου εγκατάστασης\nes:No se pudo eliminar la carpeta de instalación\net:Ei suudetud kustutada paigalduskataloogi\neu:Ezinezkoa ezarpen zuzenbidea kentzea\nfa:نمی‌توان پوشه‌ی نصب را حذف کرد\nfi:Asennuskansion poistaminen epäonnistui\nfr:Impossible de supprimer le répertoire d'installation\nga:Níorbh fhéidir an chomhadlann suiteála a bhaint\ngl:Non se puido eliminar o cartafol de instalación\nhe:הסרת תיקיית ההתקנה נכשלה.\nhr:Nemoguće ukloniti instalacijsku mapu\nhu:Telepítési könyvtár eltávolítása sikertelen\nid:Gagal menghapus direktori instalasi\nit:Impossibile rimuovere la cartella di installazione\nja:インストール先ディレクトリを削除できませんでした\nkr:설치 디렉토리를 제거할 수 없습니다.\nku:ناتوانرێت فۆڵدەری دابەزاندن لابدرێت\nlv:Nevarēja noņemt instalācijas direktoriju\nmk:Не можам да ја избришам инсталационата папка\nmy:Tidak dapat memadamkan direktori pemasangan\nnl:Kan installatiemap niet verwijderen\nnn:Kunne ikkje fjerne installasjonsdirektiv\nno:Kunne ikke fjerne installasjonsmappen\npl:Nie można usunąć katalogu instalacyjnego\npt:Não foi possível remover a pasta de instalação\nro:Nu s-a putut sterge directorul de instalare\nru:Не удалось удалить директорию установки\nsk:Nie je možné odstrániť inštalačný adresár\nsl:Ni bilo mogoče odstraniti namestitvene mape\nsp-rs:Nemoguće ukloniti instalacioni direktorijum\nsq:Nuk mund të heqë direktorinë e përkohshme\nsr-rs:Немогуће уклонити привремени директоријум\nsv:Kunde inte ta bort installationsmappen\nta:நிறுவிய கோப்புறையை நீக்க முடியவில்லை\ntr:Kurulum dizini kaldırılamadı\ntw:無法移除安裝目錄\nuk:Не вдалося видалити папку, де було встановлено програму\nuz:O'rnatish direktoriyasini o'chirib bo'lmadi\nvn:Không thể gỡ bỏ thư mục cài đặt\n:Couldn't remove the shortcut\nam:Հնարավոր չեղավ ջնջել պիտակը\nar:لا يمكن إزالة الاختصار\naz:Yarlığı silmək mümkün olmadı\nbg:Не можа да се изтрие командата за бърз достъп\nbn:শর্টকাট বাতিল করা সম্ভব হয়নি\nbr:Não foi possível remover o atalho\nbs:Neuspješno uklanjanje kratice\nca-xv:No es pot suprimir la drecera\nca:No es pot suprimir la drecera\ncn:无法移除快捷方式\ncy:Methu tynnu'r llwybr byr\ncz:Nepodařilo se odstranit zástupce\nde:Konnte die Verknüpfung nicht löschen\ndk:Kunne ikke fjerne genvej\nel:Αδυναμία απομάκρυνσης συντόμευσης\nes:No se pudo eliminar el acceso directo\net:Ei suudetud kustutada otseteed\neu:Ezinezkoa lastertekla kentzea\nfa:نمی‌توان میانبر را حذف کرد\nfi:Pikakuvakkeen poistaminen epäonnistui\nfr:Impossible de supprimer le raccourci\nga:Ní féidir an t-aicearra a bhaint\ngl:Non se puido eliminar o atallo\nhe:הסרת קיצור דרך נכשלה.\nhr:Nemoguće ukloniti prečac\nhu:Parancsikon eltávolítása sikertelen\nid:Gagal menghapus shortcut\nit:Impossibile rimuovere il collegamento\nja:ショートカットを削除できませんでした\nka:მალსახმობი ვერ ამოიშალა\nkr:바로가기를 제거할 수 없습니다.\nku:ناتوانرێت کورتە ئایکۆن لابدرێت\nlv:Nevarēja noņemt saīsni\nmk:Не можам да ја избришам кратенката\nmy:Tidak dapat membuang shortcut\nnl:Kon snelkoppeling niet verwijderen\nnn:Kunne ikkje fjerne snarvegen\nno:Kunne ikke fjerne snarveien\npl:Nie można usunąć skrótu\npt:Não foi possível remover o atalho\nro:Nu s-au putut sterge scurtatura\nru:Не удалось удалить ярлык\nsk:Nie je možné odstrániť odkaz\nsl:Ni bilo mogoče odstraniti bližnjice\nsp-rs:Nemoguće ukloniti skraćenicu\nsq:Nuk mund të heqë shkurtoren\nsr-rs:Немогуће уклониити скраћеницу\nsv:Kunde inte ta bort genvägen\nta:சுருக்கு வழியை நீக்க முடியவில்லை\ntr:Kısayol silinemedi\ntw:無法移除捷徑\nuk:Не вдалося видалити ярлик\nuz:Xatcho'pni o'chirib bo'lmadi\nvn:Không bỏ lối tắt được\n:Couldn't render the page\nam:Հնարավոր չեղավ ստեղծել էջի պատկերը\nar:لا يستطيع أن يعيد الصفحة\naz:Səhifəni əks etdirmək mümkün olmadı\nbg:Страницата не може да се изобрази\nbr:Não foi possível renderizar a página\nbs:Nije moguće iscrtati stranicu\nby:Не атрымаўся сфармаваць малюнак старонкі\nca-xv:No es pot representar la pàgina\nca:No es pot representar la pàgina\ncn:无法渲染该页面\ncy:Methu cyflwyno'r dudalen\ncz:Stránku nelze vykreslit\nde:Diese Seite kann leider nicht angezeigt werden\ndk:Kunne ikke vise siden\nel:Δε μπορεί να φορτωθεί η σελίδα\nes:No se pudo cargar la visualización de la página\net:Lehekülje visualiseerimine ei õnnestunud\neu:Ezinezkoa orrialdea aurkeztea\nfa:متأسفانه صفحه قابل نمایش نیست\nfi:Sivun tulkinta epäonnistui\nfr:Impossible de générer la page\nfy-nl:Dizze side kin net werjûn wurde\nga:Níorbh fhéidir an leathanach a chóiriú\ngl:Non se puido presentar a páxina\nhe:קריאת העמוד נכשלה.\nhi:पेज रेंडर नहीं कर सका\nhr:Nije moguće iscrtati stranicu\nhu:Oldalfeldolgozási hiba\nid:Gagal menampilkan halaman\nit:Impossibile presentare la pagina\nja:ページを描画できませんでした\nka:გვერდის რენდერი ვერ მოხერხდა\nkr:페이지를 렌더링할 수 없습니다.\nku:ناتوانرێت پەڕە پوختە بکرێت\nkw:Ny yllys rendra folen\nlt:Nepavyko atvaizduoti puslapio\nlv:Nevarēja atveidot lappusi\nmk:Не можам да ја прикажам страницата\nmy:Tidak dapat memuatkan halaman\nne:पृष्ठ रेन्डर गर्न सकिएन\nnl:Kan deze pagina niet weergegeven\nnn:Kunne ikkje rendre siden\nno:Kunne ikke vise siden\npl:Nie można wyświetlić strony\npt:Não foi possível processar a página\nro:Nu s-a putut afișa pagina\nru:Не удалось сформировать изображение страницы\nsi:පිටුව render නොවේ\nsk:Nepodarilo sa načítať stranu\nsl:Ni bilo mogoče upodobiti strani\nsp-rs:Nije moguće prikazati stranicu\nsq:Nuk mund të radhitë faqen\nsr-rs:Није могуће приказати страницу\nsv:Kunde ej visa sidan\nta:பக்கத்தை அளிக்க முடியவில்லை\nth:ไม่สามารถแสดงผลหน้าเพจ\ntl:Hindi maipakita ang pahina\ntr:Sayfa oluşturulamadı\ntw:無法產生頁面\nuk:Неможливо згенерувати(відобразити) сторінку\nuz:Betni render qilib bo'lmadi\nvn:Không hiện được trang\n:Couldn't uninstall PDF previewer\nam:Հնարավոր չեղավ հեռացնել PDF-ի նախադիտումը\nar:لا يمكن إلغاء تثبيت معاين المستندات المحمولة\naz:PDF önbaxış alətini silmək mümkün olmadı\nbg:Програмата за преглед на PDF файлове не е премахната.\nbr:Não foi possível desinstalar o pré-visualizador para PDF\nbs:Neuspješna deinstalacija PDF preglednika\nca-xv:No es pot desinstal·lar el visor ràpid PDF\nca:No es pot desinstal·lar el visor ràpid PDF\ncn:无法卸载 PDF 预览器\ncy:Methu dadosod rhagolygwr PDF\ncz:Nelze odinstalovat PDF prohlížeč\nde:Konnte die PDF Vorschau nicht deinstallieren\ndk:Kunne ikke fjerne PDF-fremviser\nel:Δεν ήταν δυνατή η απεγκατάσταση του PDF previewer\nes:No se pudo desinstalar el previsualizador de PDF\net:Ei suudetud eemaldada PDF-eelvaaturit\neu:Ezinezkoa PDF aurreikustatzailea kentzea\nfa:نمی‌توان پیش‌نمایشگر PDF را پاک کرد\nfi:PDF-esikatselijan poistaminen epäonnistui\nfr:Impossible de désinstaller l'aperçu PDF\nga:Níorbh fhéidir an réamhamharcóir PDF a dhíshuiteáil\ngl:Non se puido desinstalar o previsualizador de PDFs\nhe:הסרת כלי תצוגה מקדימה ל- PDF נכשלה.\nhr:Nemoguće deinstalirati PDF preglednik\nhu:PDF előnézet-megjelenítő eltávolítása sikertelen\nid:Gagal menghapus penampil cepat PDF\nit:Impossibile disinstallare modulo anteprima PDF\nja:PDF プレビューアをアンインストールできませんでした\nkr:PDF 미리보기를 제거할 수 없습니다.\nku:ناتوانرێت پیشاندەری PDF بسڕدرێتەوە\nlv:Nevarēja atinstalēt PDF priekšskatījumu\nmk:Не можам да го избришам прикажувачот на PDF\nmy:Tidak dapat membuang previewer PDF\nnl:Kan PDF-previewer niet verwijderen\nnn:Kunne ikkje avinstallere PDF-forhandsvisar\nno:Kunne ikke avinstallere PDF forhåndsvisning\npl:Nie można usunąć podglądu PDF\npt:Não foi possível desinstalar a antevisão de PDF\nro:Nu s-a putut dezinstala previzualizatorul PDF\nru:Не удалось удалить просмотрщик PDF\nsk:Nie je možné odinštalovať PDF prehliadač rýchlych náhľadov\nsl:Ni bilo mogoče odstraniti predogleda za PDF\nsp-rs:Nemoguće deinstalirati PDF pregledač\nsq:Nuk mund të çinstalojë parashikuesin e PDF-ve\nsr-rs:Немогуће деинсталирати ПДФ прегледач\nsv:Kunde inte avinstallera förhandstitt på PDF:er\nta:PDF முன்னோட்டத்தை நீக்க முடியவில்லை\ntr:PDF önizleyicisi kaldırılamadı\ntw:無法解除安裝 PDF 預覽器\nuk:Не вдалося видалити програму попереднього перегляду PDF\nuz:PDF ko'rish vositasini o'chirib bo'lmadi\nvn:Không thể gỡ cài đặt bộ xem truớc PDF\n:Couldn't uninstall PDF search filter\nam:Հնարավոր չեղավ հեռացնել PDF որոնման պայմանը\nar: لا يمكن إلغاء تثبيت تصفية بحث المستندات المحمولة \naz:PDF axtarış filtrini silmək mümkün olmadı\nbg:Не може да деинсталирате PDF филтър за търсене\nbr:Não foi possível desinstalar o filtro de pesquisa para PDF\nbs:Neuspješna deinstalacija filtera za pretragu PDF-ova\nca-xv:No es pot desinstal·lar el filtre de cerca PDF\nca:No es pot desinstal·lar el filtre de cerca PDF\ncn:无法卸载 PDF 搜索过滤器\ncy:Methu dadosod hidl chwilio PDF\ncz:Nelze odinstalovavat vyhledávací PDF filtr\nde:Konnte den PDF Suchfilter nicht deinstallieren\ndk:Kunne ikke afinstallere PDF-søgefilter\nel:Δε μπόρεσε να γίνει απεγκατάσταση του φίλτρου αναζήτησης PDF\nes:No se pudo desinstalar el filtro de búsqueda PDF\net:Ei suudetud eemaldada PDF otsingufiltrit\neu:Ezinezkoa PDF bilaketa iragazkia kentzea\nfa:نمی‌توان فیلتر جستجوی PDF را پاک کرد\nfi:PDF-hakusuodattimen poistaminen epäonnistui\nfr:Impossible de désinstaller le filtre de recherche PDF\nga:Níorbh fhéidir an scagaire cuardaigh PDF a dhíshuiteáil\ngl:Non se puido desinstalar o filtro de buscas de PDF\nhe:הסרת מסנן חיפוש ל- PDF נכשלה.\nhr:Nemoguće deinstalirati PDF filter pretraživnja\nhu:PDF keresési szűrő eltávolítása sikertelen\nid:Gagal menghapus filter pencari PDF\nit:Impossibile disinstallare filtro ricerca PDF\nja:PDF 検索フィルタをアンインストールできませんでした\nka:PDF ძიების ფილტრის დეინსტალაცია ვერ მოხერხდა\nkr:PDF 검색 필터를 제거할 수 없습니다.\nku:ناتوانرێت فرمانی گەڕانی PDF بسڕدرێتەوە\nlv:Nevarēja atinstalēt PDF meklēšanas filtru\nmk:Не можам да го избришам филтерот за пребарување на PDF\nmy:Tidak dapat memadam penapis carian PDF\nnl:Kon PDF zoek filter niet deïnstalleren\nnn:Kunne ikkje avinstallere PDF-søkjefilteret\nno:Kunne ikke avinstallere PDF søkefilter\npl:Nie można usunąć filtru przeszukiwania PDF\npt:Não foi possível desinstalar o filtro de procura\nro:Nu s-a putut dezinstala filtrul de cautare PDF\nru:Не удалось удалить фильтр поиска PDF\nsk:Nie je možné odinštalovať PDF vyhľadávací filter\nsl:Ni bilo mogoče odstraniti filtra za PDF iskanje\nsp-rs:Nemoguće deinstalirati PDF filter pretrage\nsq:Nuk mund të çinstalojë kërkuesin e PDF-ve\nsr-rs:Немогућа деинсталација ПДФ филтер претраге\nsv:Kunde inte avinstallera sökfiltret för PDF:er\nta:PDF தேடலை நீக்க முடியவில்லை\ntr:PDF arama filtresi kaldırılamadı\ntw:無法安裝 PDF 搜索過濾器\nuk:Не вдалося видалити фільтр пошуку для PDF\nuz:PDF qidirish filtrini o'chirib bo'lmadi\nvn:Không thể gỡ cài đặt bộ lọc tìm kiếm PDF\n:Couldn't uninstall browser plugin\nam:Հնարավոր չեղավ հեռացնել դիտարկիչի բաղադրիչը\nar:لا يمكن إلغاء تثبيت متصفح البرنامج المساعد\naz:Brauzer plaginini silmək mümkün olmadı\nbg:Не може да деинсталирате плъгина за браузъра\nbr:Não foi possível desinstalar o plugin do navegador\nbs:Neuspješna instalacija plugina za browser\nca-xv:No es pot desinstal·lar el connector de navegador\nca:No es pot desinstal·lar el connector de navegador\ncn:无法卸载浏览器插件\ncy:Methu dadosod ategyn porwr\ncz:Nepodařilo se odinstalovat rozšíření z prohlížeče\nde:Konnte das Browser-Plugin nicht deinstallieren\ndk:Kunne ikke fjerne browserudvidelsesmodul\nel:Δε μπόρεσε να γίνει απεγκατάσταση του πρόσθετου προγράμματος περιήγησης\nes:No se pudo desinstalar el complemento del navegador\net:Ei suudetud eemaldada brauseri pluginat\neu:Ezinezkoa nabigatzaile plugina kentzea\nfa:نمی‌توان افزونه‌ی مرورگر را پاک کرد\nfi:Selainliitännäisen poistaminen epäonnistui\nfr:Impossible de désinstalle le plug-in du navigateur\nga:Níorbh fhéidir an breiseán don líonléitheoir a dhíshuiteáil\ngl:Non se puido desinstalar o engadido do navegador\nhe:הסרת התוסף לדפדפן נכשלה.\nhr:Nemoguće deinstalirati dodatak za internet preglednik\nhu:Böngésző beépülő eltávolítása sikertelen\nid:Gagal menghapus plugin untuk peramban\nit:Impossibile disinstallare il plugin del browser\nja:ブラウザプラグインをアンインストールできませんでした\nka:ბრაუზერის დანამატის დეინსტალაცია ვერ მოხერხდა\nkr:브라우저 플러그인을 제거할 수 없습니다.\nku:ناتوانرێت پێوەکراوی وێبگەڕ بسڕدرێتەوە\nlv:Nevarēja atinstalēt pārlūkprogrammas spraudni\nmk:Не можам да го избришам додатокот за прелистувачи\nmy:Tidak dapat membuang pelayar plugin\nnl:Kan browserplugin niet verwijderen\nnn:Kunne ikkje avinstallere nettlesartillegget\nno:Kunne ikke avinstallere nettlesertillegget\npl:Nie można usunąć wtyczki do przeglądarek\npt:Não foi possível desinstalar o plugin do navegador\nro:Nu s-a putut dezinstala plugin-ul de browser\nru:Не удалось удалить плагин браузера\nsk:Nie je možné odinštalovať plugin prehliadača\nsl:Ni bilo mogoče odstraniti vtičnika za brskalnik\nsp-rs:Nemoguće deinstalirati plugin Internet pregledača\nsq:Nuk mund të çinstalojë spinën për shfletuesin\nsr-rs:Немогуће уклонити плугин за прегледач\nsv:Kunde inte avinstallera webbläsarens insticksprogram\nta:உலாவி உள்இடுக்கைளை நீக்க முடியவில்லை\ntr:Tarayıcı eklentisi silinemedi\ntw:無法解除安裝瀏覽器附加元件\nuk:Не вдалося видалити розширення для браузера\nuz:Brauzer plaginini o'chirib bo'lmadi\nvn:Không thể gỡ cài đặt Plugin trình duyệt\n:Couldn't write %s to disk\nam:Հնարավոր չէ գրել %s պնակում\nar: الى القرص %s لا يستطيع ان يكتب\naz:%s diskə yazıla bilmədi\nbg:Не можа да се запише %s на диска\nbr:Não foi possível gravar %s no disco\nbs:Neuspješno zapisivanje %s na disk\nca-xv:No es pot escriure %s al disc\nca:No es pot escriure %s al disc\ncn:无法写入 %s 到磁盘\ncy:Methu ysgrifennu %s i ddisg\ncz:Nelze zapsat %s na disk\nde:Konnte %s nicht kopieren\ndk:Kunne ikke skrive %s til disk\nel:Αδυναμία εγγραφής %s στον δίσκο\nes:No se puede escribir %s en el disco\net:Ei suudetud kettale kirjutada %s\neu:Ezinezkoa %s diskara idaztea\nfa:نمی‌توان %s را روی دیسک نوشت\nfi:Levylle kirjoittaminen epäonnistui: %s\nfr:Impossible d'écrire %s sur le disque\nga:Níorbh fhéidir %s a scríobh chuig an diosca\ngl:Non se puido escribir %s no disco\nhe:כתיבת %s לדיסק נכשלה.\nhr:Nemoguće zapisati %s na disk\nhu:%s lemezre írása sikertelen\nid:Gagal menulis %s ke harddisk\nit:Impossibile scrivere %s nel disco.\nja:%s をディスクに書き込めませんでした\nkr:%s(을)를 디스크에 쓸 수 없습니다.\nku:بخوێندرێتەوە بۆ دیسک %s ناتوانرێت\nlv:Nevarēja rakstīt %s diskā\nmk:Не можам да ја снимам %s на диск\nmy:Tidak boleh memasukkan data %s ke cakera\nne:%s डिस्कमा लेख्न सकिएन\nnl:Kon %s niet op schijf wegschrijven\nnn:Kunne ikkje lagre %s til disken\nno:Kunne ikke skrive %s til disk \npl:Nie można zapisać %s na dysk\npt:Não foi possível escrever %s no disco\nro:Nu s-a putut scrie %s pe disc\nru:Не удалось записать %s на диск\nsk:Nie je možné zapísať %s na disk\nsl:Ni bilo mogoče napisati %s na disk\nsp-rs:Nemoguć upis %s na disk\nsq:Nuk mund të shkruajë %s në disk\nsr-rs:Немогућ упис %s на диск\nsv:Kunde inte spara %s på hårddisken\nta:%s ஐ எழுத  இயலவில்லை\ntr:Diske %s yazılamadı\ntw:無法寫入 %s 到磁碟中\nuk:Не вдалося записати %s на диск\nuz:%s diskka yozib bo'lmadi\nvn:Không thể ghi %s vào đĩa\n:Created:\nam:Ստեղծված`\nar:منشاء\naz:Hazırlanma tarixi:\nbg:Създаден:\nbn:নির্মিতঃ\nbr:Criado:\nbs:Kreirano:\nca-xv:Creat:\nca:Creat:\ncn:创建时间:\ncy:Crëwyd:\ncz:Vytvořeno:\nde:Erstellt am:\ndk:Oprettet:\nel:Δημιουργήθηκε:\nes:Creado:\net:Loodud:\neu:Sortua:\nfa:زمان ایجاد:\nfi:Luotu:\nfr:Créé le :\nfy-nl:Makke:\nga:Cruthaithe:\ngl:Creado:\nhe:נוצר:\nhi:रचित\nhr:Stvoreno:\nhu:Készült:\nid:Dibuat:\nit:Data creazione:\nja:作成日時:\nka:შექმნილია:\nkr:만든 날짜:\nku:دروستکراو:\nlt:Sukurtas:\nlv:Izveidots:\nmk:Создадено на:\nml:സൃഷ്ടിച്ചു\nmy:Dicipta:\nne:सिर्जना गरिएको:\nnl:Gemaakt:\nnn:Skapt:\nno:Opprettet:\npl:Utworzono:\npt:Criado:\nro:Creat:\nru:Создан:\nsi:නිර්මිත:\nsk:Vytvorený:\nsl:Ustvarjeno:\nsn:Rakagadzirwa\nsp-rs:Izrađena:\nsq:Krijuar më:\nsr-rs:Израђена:\nsv:Skapad:\nta:உருவாக்கப்பட்டது\nth:สร้างแล้ว\ntl:Ginawa noong:\ntr:Oluşturma tarihi:\ntw:檔案建立日期:\nuk:Створено:\nuz:Yaratilgan:\nvn:Ngày tạo:\n:Current file\nam:Ընթացիկ ֆայլը\nar:الملف الحالي\naz:Hazırkı fayl\nbg:Сегашен файл\nbn:বর্তমান ফাইল\nbr:Arquivo atual\nbs:Trenutni fajl\nca-xv:Fitxer actual\nca:Fitxer actual\ncn:当前文件\ncy:Ffeil cyfredol\ncz:Aktuální soubor\nde:Aktuelle Datei\ndk:Aktuel fil\nel:Τρέχον αρχείο\nes:Archivo actual\net:Praegune fail\neu:Oraingo agiria\nfa:همین پرونده\nfi:Nykyinen tiedosto\nfr:Fichier actuel\nga:Comhad reatha\ngl:Ficheiro actual\nhe:קובץ נוכחי\nhi:वर्तमान फ़ाइल\nhr:Trenutna datoteka\nhu:Jelenlegi fájl\nid:Berkas ini\nit:File attuale\nja:現在のファイル\nka:მიმდინარე ფაილი\nkr:현재 파일\nku:فایلی ئێستا\nlt:Esamasis failas\nlv:Pašreizējais fails\nmk:Активна датотека\nml:നിലവിലെ ഫയല്‍\nmy:Fail semasa\nne:हालको फाइल\nnl:Huidig bestand\nnn:Nåverande fil\nno:Gjeldende fil\npl:Bieżący plik\npt:Ficheiro atual\nro:Fișier curent\nru:Текущий файл\nsi:‌මෙම ‌ගොනුව\nsk:Aktuálny súbor\nsl:Trenutna datoteka\nsp-rs:Tekuća datoteka\nsq:Skeda aktuale\nsr-rs:Текућа датотека\nsv:Aktuell fil\nta:நடப்பு கோப்பு\nth:ไฟล์ปัจจุบัน\ntr:Yürürlükteki dosya\ntw:當前的檔案\nuk:Поточний файл\nuz:Joriy fayl\nvn:Tập tin hiện hành\n:Cursor position:\nam:Նշորդի դիրքը.\nar:موقع المؤشرة:\naz:Kursorun mövqeyi:\nbg:Позиция на курсора\nbr:Posição do cursor:\nbs:Pozicija kursora:\nca-xv:Posició del cursor:\nca:Posició del cursor\ncn:光标位置:\ncy:Safle'r cyrchwr:\ncz:Pozice kurzoru:\nde:Zeigerposition:\ndk:Markørposition:\nel:Θέση κέρσορα:\nes:Posición del cursor:\net:Kursori asukoht\neu:Kurtsorearen kokapena:\nfa:موقعیت مکان‌نما\nfi:Kohdistimen sijainti:\nfr:Position du curseur :\nga:Suíomh an chúrsóra:\ngl:Posición do punteiro\nhe:מיקום סמן:\nhr:Pozicija pokazivača:\nhu:Kurzor pozíció:\nid:Posisi kursor:\nit:Posizione cursore\nja:カーソル位置：\njv:Posisi kursor:\nka:კურსორის პოზიცია:\nkr:커서 위치:\nku:شوێنی نیشانەی ماوس:\nlv:Kursora pozīcija:\nmk:Местоположба на покажувач:\nnl:Cursor positie\nnn:Markørposisjon:\nno:Skrivemerkeposisjon:\npl:Pozycja kursora:\npt:Posição do cursor:\nru:Позиция курсора:\nsk:Pozícia kurzora:\nsl:Položaj kurzorja:\nsp-rs:Pozicija kursora\nsr-rs:Позиција курсора\nsv:Muspekarens position:\ntr:İmleç konumu:\ntw:游標位置\nuk:Позиція вказівника:\nuz:Kursor holati:\nvn:Vị trí con trỏ:\n:Custom &Zoom...\\tCtrl+Y\nam:&Ընտրված չափով\\tCtrl+Y\nar:تكبير مخصص&\\tCtrl+Y\naz:Miq&yası qeyd et...\\tCtrl+Y\nbg:Увеличение по &избор...\\tCtrl+Y\nbr:&Zoom personalizado...\\tCtrl+Y\nbs:&Prilagođeno uvećanje...\\tCtrl+Y\nca-xv:Zoom &predeterminat..\\tCtrl+Y\nca:Escala &predeterminada…\\tCtrl+Y\ncn:自定义缩放(&Z)...\\tCtrl+Y\ncy:&Addasu Chwyddo...\\tCtrl+Y\ncz:Vlastní &měřítko...\\tCtrl+Y\nde:&Zoomfaktor…\\tStrg+Y\ndk:Brugerdefineret &zoom...\\tCtrl+Y\nel:&Προσαρμοσμένο ζουμ...\\tCtrl+Y\nes:&Zoom personalizado...\\tCtrl+Y\net:&Muu suurendus...\\tCtrl+Y\neu:Egile Zoo&ma...\\tKtrl+Y\nfa:بزرگنمایی &سفارشی...\\tCtrl+Y\nfi:&Mukautettu zoomaustaso...\\tCtrl+Y\nfr:&Zoom personnalisé...\\tCtrl+Y\nfy-nl:&Oanpaste Zoom...\\tCtrl+Y\nga:Formhéadú saincheaptha...\\tCtrl+Y\ngl:&Aumento a medida...\\tCtrl+Y\nhe:זום משתמש...\\tCtrl+Y\nhi:प्रचलन ज़ूम (&Z)...\\tCtrl+Y\nhr:&Prilagođeno uvećanje...\\tCtrl+Y\nhu:... Egyéni méret\\tCtrl+Y\nid:&Pembesaran Buatan\\tCtrl+Y\nit:Ingrandimento personali&zzato\\t<Ctrl>+Y\nja:拡大率の指定(&Z)...\\tCtrl+Y\nka:&მასშტაბის მითითება...\\tCtrl+Y\nkr:사용자 지정 배율(&Z)...\\tCtrl+Y\nku:هێنانەپێشەوەی &تایبەت...\\tCtrl+Y\nkw:&Zoum arbennik...\\tCtrl+Y\nlt:Pasirinkti &mastelį...\\tCtrl+Y\nlv:Pielāgot &tālummaiņu...\\tCtrl+Y\nmk:&Зумирање по избор...\\tCtrl+Y\nmy:Custom &Zoom...\\tCtrl+Y\nne:अनुकुल &आकार ...\\tCtrl+Y\nnl:Aangepaste &Zoom...\\tCtrl+Y\nnn:Tilpassa &zooming...\\tCtrl+Y\nno:&Egendefinert zoom...\\tCtrl+Y\npl:&Własne powiększenie...\\tCtrl+Y\npt:&Personalizar...\\tCtrl+Y\nro:Factor de mărire... \\tCtrl+Y\nru:&Указать масштаб...\\tCtrl+Y\nsi:අභිමත &විශාලනය\\tCtrl+Y\nsk:Vlastná &zmena veľkosti...\\tCtrl+Y\nsl:Povečava po &meri …\\tCtrl+Y\nsp-rs:Prilagođeno uvećanje...\\tCtrl+Y\nsq:&Shkalla e caktuar...\\tCtrl+Y\nsr-rs:Прилагођено увећање...\\tCtrl+Y\nsv:&Anpassad zoom...\\tCtrl+Y\nta:விருப்பிற்கேற்ற பெருக்கம்\\tCtrl+Y\nth:กำหนดการซูม...\\tCtrl+Y\ntl:Custom na laki...\\tCtrl+Y\ntr:Kişiselleştirilmiş &Yakınlaştırma... \\tCtrl+Y\ntw:自訂縮放(&Z)...\\tCtrl+Y\nuk:Вказати масштаб...\\tCtrl+Y\nuz:&Miqyosni ko'rsatish...\\tCtrl+Y\nvn:Thu phóng &tuỳ ý...\\tCtrl+Y\n:Default &Layout:\nam:Ծրագրային &դասավորություն.\nar:التخطيط الافتراضي&\naz:Standart &düzüm:\nbg:&Разположение по подразбиране:\nbr:&Visualização Padrão\nbs:Izvorni &izgled:\nby:&Кампаноўка па змаўчанні\nca-xv:&Visualització predeterminada:\nca:&Visualització predeterminada:\ncn:默认布局(&L):\ncy:&Cynllun Rhagosodedig:\ncz:Výchozí &uspořádání:\nde:&Standardlayout:\ndk:Standard&layout:\nel:Προκαθορισμένη &διαμόρφωση:\nes:Apariencia pre&determinada:\net:Vaike&küljend:\neu:Berezko &Egitura:\nfa:&صفحه‌بندی پیش‌فرض:\nfi:Oletus&tyyli:\nfr:Mise en &page par défaut :\nfy-nl:Standert &Layout:\nga:&Leagan amach réamhshocraithe:\ngl:Disposición por defecto:\nhe:פריסת ברירת מחדל:\nhi:मूलभूत लेआउट :(&L)\nhr:Pretpostavljeni &izgled:\nhu:Oldalmegjelenítési mód:\nid:Tampilan &Standar\nit:&Vista predefinita:\nja:既定のレイアウト(&L):\nka:&ნაგულისხმევი განლაგება:\nkr:기본 구성(&L):\nku:شێوازی &سەرەکی:\nkw:&Delinyans savonek:\nlt:Numatytasis iš&dėstymas:\nlv:Noklusējuma &izkārtojums\nmk:&Основен поглед:\nmy:Default &Susunatur:\nne:पूर्वनिर्धारित स&जावट:\nnl:Standaard opmaak:\nnn:Standard &oppsett:\nno:Standard sideoppsett:\npl:&Układ domyślny:\npt:&Exibição padrão:\nro:Design implicit:\nru:&Компоновка по умолчанию\nsi:පෙරනිමි දැක්ම:\nsk:Predvolené &zobrazenie:\nsl:&Privzeta postavitev:\nsp-rs:Podrazumevani prikaz\nsq:&Faqosja standarde:\nsr-rs:Подразумевани приказ\nsv:Förvalt &utseende\nta:கோட நிலை வடிவமைப்பு\nth:รูปแบบเริ่มต้น:\ntl:Default na Ayos:\ntr:Varsayılan &Düzen:\ntw:預設布局(&L):\nuk:Розташування за замовчуванням:\nuz:Andoza &joylashish\nvn:Khung nhìn mặc định\n:Default &Zoom:\nam:Ծրագրային &չափը.\nar:التكبير الافتراضي&:\naz:Standart miq&yas:\nbg:&Увеличение по подразбиране:\nbr:&Zoom Padrão\nbs:Izvorno &uvećanje:\nby:&Маштаб па змаўчанні\nca-xv:&Zoom predeterminat\nca:&Zoom predeterminat\ncn:默认缩放(&Z):\ncy:C&hwyddo Rhagosodedig:\ncz:Výchozí &zvětšení:\nde:Standard&vergrößerung:\ndk:Standard&zoom\nel:Προκαθορισμένο &ζουμ:\nes:Am&pliación predeterminada:\net:Vaike&suurendus:\neu:Berezko &Zooma:\nfa:&بزرگنمایی پیش‌فرض:\nfi:Oletus&zoomaus:\nfr:&Zoom par défaut :\nfy-nl:Standert &Zoom:\nga:Formhéadú réamhshocraithe:\ngl:&Aumento por defecto:\nhe:זום ברירת מחדל:\nhi:डिफ़ॉल्ट पृष्ठ &आकार:\nhr:Pretpostavljeno &uvećanje:\nhu:Alapnagyítás:\nid:Pembesaran &Standar\nit:&Ingrandimento predefinito:\nja:既定の拡大率(&Z):\nka:ნაგულისხმევი &მასშტაბი\nkr:기본 배율(&Z):\nku:هێنانەپێشەوەی  &سەرەکی:\nkw:&Zoum savonek:\nlt:Numatytasis &mastelis\nlv:Noklusējuma &tālummaiņa\nmk:Основно &зумирање:\nmy:Default &Zum:\nne:पूर्वनिर्धारित &आकार:\nnl:Standaard &zoom:\nnn:Standard &zooming:\nno:Standard&zoom:\npl:Domyślne &powiększenie:\npt:&Ampliação padrão:\nro:Factor de mărire implicit:\nru:Масшта&б по умолчанию\nsi:පෙරනිමි සෙවුම:\nsk:Predvolená &veľkosť\nsl:Pri&vzeta povečava:\nsp-rs:Podrazumevano uvećanje\nsq:&Shkalla standarde:\nsr-rs:Подразумевано увећање\nsv:Förvalt &zoomläge\nta:கோட நிலை உரு அளவு\nth:ซูมเริ่มต้น:\ntl:Default na Laki:\ntr:Varsayılan &Yakınlaştırma:\ntw:預設縮放(&Z):\nuk:Масштаб за замовчуванням:\nuz:Andoza &miqyos\nvn:Kích thước mặc định\n:Default PDF reader can't be changed in portable mode\nam:Շարժական վիճակում հնարավոր չէ փոխել PDF կարդալու հիմնական ծրագիրը\nar:لا يمكن تغيير قارئ المستندات المحمولة الافتراضية في وضع المحمول \naz:Mobil rejimdə PDF fayllarla əlaqə yaratmaq mümkün deyil\nbg:PDF четеца не може да бъде сменен в преносим режим\nbr:Não é possível alterar o leitor PDF padrão no modo portátil\nbs:Glavni preglednik PDF fajlova se ne može promijeniti u portable režimu\nby:У мабільным рэжыме змяніць PDF-в'юер нельга\nca-xv:No es pot canviar el lector de PDF predeterminat en mode portable.\nca:No es pot canviar el lector de PDF predeterminat en mode portable.\ncn:便携模式不能改变默认 PDF 阅读器\ncy:Nid oes modd newid y prif ddarllenydd yn y modd cludadwy\ncz:V přenosném režimu nelze měnit výchozí PDF prohlížeč\nde:Standardanwendung im portablen Modus nicht veränderbar\ndk:Standardlæseren for PDF kan ikke ændres i mobil tilstand\nel:Δε μπορεί να γίνει συσχετισμός σε portable mode\nes:No se puede cambiar el lector PDF predeterminado en el modo portátil\net:PDF-failide vaikeprogrammi ei saa muuta portatiivses režiimis\neu:Berezko PDF irakurtzailea ezin da eramangarri moduan aldatu\nfa:نمی‌توان خواننده‌ی پیش‌فرض پرونده‌های PDF را در نسخه‌ی قابل حمل تغییر داد.\nfi:PDF-oletuslukijaa ei voi vaihtaa kannettavassa tilassa\nfr:Le lecteur de PDF ne peut être changé en mode portable\nfy-nl:Standert PDF-lêzer kin net oanpast wurde yn portable moadus\nga:Ní féidir an léitheoir PDF réamhshocraithe a athrú sa mhodh soghluaiste\ngl:O lector de PDF por defecto non pode trocarse en modo portable\nhe:הגדרת תוכנת ברירת מחדל ל- PDF אינה אפשרית במצב נייד.\nhi:डिफ़ॉल्ट पीडीएफ रीडर पोर्टेबल मोड में बदला नहीं जा सकता\nhr:Glavni preglednik PDF datoteka se ne može mijenjati u prenosivom načinu\nhu:Nem tehető alapértelmezett PDF-olvasóvá hordozható módban\nid:Pembaca PDF utama tidak dapat diubah dalam mode portabel\nit:Il lettore PDF predefinito non è modificabile in modalità portatile\nja:ポータブル モードでは変更できません\nka:პორტატულ რეჟიმში, PDF-ის წამკითხველად დაყენება შეუძლებელია\nkr:포터블 방식에서는 기본 PDF 리더로 바꿀 수 없습니다.\nku:(ناتوانرێت بگۆڕدرێت لە شێوازی هەڵگرتندا (پۆرتەیبڵ  PDF پیشاندەری سەرەکی\nkw:Ny yll an pennredyer PDF bos chanjyes yn modh porthadow\nlt:Naudojant programą kaip portatyvią, numatytosios PDF žiūryklės keisti negalima\nlv:Noklusējuma PDF lasītāju nevar izmainīt pārnesamam režīmam\nmk:Основниот читач на PDF не може да работи во мобилен режим\nmy:Pembaca utama PDF tidak boleh ditukar ketika mod mudah alih\nne:चलायमान मोडमा पूर्वनिर्धारित PDF पाठक परिवर्तन गर्न मिल्दैन\nnl:Standaard PDF-lezer kan niet worden aangepast in portable modus\nnn:Standard PDF-lesar kan ikkje bli endra i flyttbar modus\nno:Standard PDF-leser kan ikke endres i flyttbar modus\npl:Domyślna przeglądarka PDF nie może być zmieniona w trybie przenośnym\npt:No modo portátil, não pode alterar o leitor pré-definido dos PDFs\nro:Cititorul PDF principal nu poate fi schimbat în modul portabil\nru:В мобильном режиме ассоциирование невозможно\nsi:portable ආකාරයෙදී ප්‍රධාන PDF කියවනය වෙනස් කළ නොහැක\nsk:Predvolený prehliadač PDF dokumentov nemôže byť zmenený, pokiaľ nie je nainštalovaný\nsl:Glavnega bralnika PDF ni mogoče spremeniti v prenosnem načinu\nsp-rs:Podrazumevani PDF čitač ne može biti promenjen u prenosivnom režimu\nsq:Lexuesi standard i PDF-ve nuk mund të ndryshojë në mënyrën portabël\nsr-rs:Подразумевани PDF читач не може бити промењен у преносивном режиму\nsv:SumatraPDF kan ej göras förvald i portabelt läge\nta:முதன்மை PDF படிப்பியை மாற்ற முடியவில்லை\nth:ค่า PDF reader เริ่มต้นไม่สามารถเปลี่ยนได้ในโหมดพกพา\ntl:Hindi maaaring palitan ang default na PDF reader sa portable na mode\ntr:Varsayılan PDF okuyucu taşınabilir modunda değiştirilemez\ntw:無法在可攜模式變更預設 PDF 閱讀器\nuk:Не можна змінити штатний переглядач PDF у портативному режимі\nuz:Portable usulida andoza PDF ko'rish vositasini o'zgartirib bo'lmaydi\nvn:Không thay đổi được trình đọc PDF chính ở chế độ di động\n:Denied Permissions:\nam:Լիազորությունները մերժված են.\nar:رفض الأذونات:\naz:Qadağan olunmuş hüquqlar:\nbg:Достъпът отказан:\nbr:Permissões negadas:\nbs:Odbijene dozvole:\nca-xv:Permisos denegats:\nca:Permisos denegats:\ncn:权限不足:\ncy:Gwrthodwyd Caniatâd:\ncz:Odepřená oprávnění:\nde:Einschränkungen:\ndk:Nægtede tilladelser:\nel:Απαγόρευση δικαιωμάτων:\nes:Permisos denegados:\net:Keelatud õigused:\neu:Baimen Ukatuak:\nfa:دسترسی‌های ممنوع:\nfi:Kielletyt oikeudet:\nfr:Interdictions :\nga:Ceadanna diúltaithe:\ngl:Permisos denegados:\nhe:הרשאות חסרות:\nhi:अस्वीकृत अनुमतियाँ\nhr:Dozvole ograničenja:\nhu:Tiltott műveletek:\nid:Izin Ditolak:\nit:Permessi rifiutati:\nja:拒否された権限:\nka:თქვენ არ გაქვთ საჭირო უფლებები:\nkr:거부된 사용 권한:\nku:مۆڵەتپێدانە ڕەتکراوەکان:\nlt:Nesuteikti leidimai:\nlv:Atteiktas atļaujas:\nmk:Одбиени привилегии:\nmy:Kebenaran Dinafikan:\nne:अस्वीकृत अनुमतिहरु:\nnl:Niet toegestaan:\nnn:Permisjonar som blei nekta:\nno:Manglende tillatelser:\npl:Brak zezwoleń:\npt:Permissões recusadas:\nro:Permisiuni interzise:\nru:Запрещённые права:\nsi:අවසර නොලැබිනි:\nsk:Odmietnuté povolenia:\nsl:Zavrnjena dovoljenja:\nsp-rs:Nije dopušteno:\nsq:Nuk lejohet:\nsr-rs:Није допуштено:\nsv:Saknade Tillstånd:\nta:அனுமதி மருக்கப்பட்டது\nth:ปฏิเสธการอนุญาต:\ntl:Mga hindi maaaring gawin:\ntr:Reddedilen İzinler:\ntw:權限不足：\nuk:У доступі відмовлено:\nuz:Taqiqlangan huquqlar:\nvn:Các quyền bị từ chối\n:DjVu documents\naf:DjVu dokumente\nam:DjVu ֆայլեր\nar:DjVu  وثائق\naz:DjVu sənədləri\nbg:DjVu документи\nbr:Documentos DjVu\nbs:DjVu dokumenti\nca-xv:Documents djvu\nca:Documents DjVu\ncn:DjVu 文件\ncy:Dogfennau DjVu\ncz:Dokumenty DjVu\nde:DjVu-Dokumente\ndk:DjVu-dokumenter\nel:Έγγραφα DjVu\nes:Documentos DjVu\net:DjVu-dokumendid\neu:DjVu agiriak\nfa:DjVu اسناد\nfi:DjVu-asiakirjat\nfr:Documents DjVu\nfy-nl:DjVu-bestannen\nga:Cáipéisí DjVu\ngl:Documentos DjVu\nhe:קובצי DjVu\nhi:DjVu दस्तावेजों\nhr:DjVu dokumenti\nhu:DjVu fájlok\nid:Dokumen DjVu\nit:Documenti DjVu\nja:DjVu ドキュメント\nka:DjVu დოკუმენტები\nkr:DjVu 문서\nku:DjVu بەڵگەنامەکانی\nlt:DjVu dokumentai\nlv:DjVu dokumenti\nmk:DjVu-документи\nmy:Dokumen DjVu\nne:DjVu कागजातहरु\nnl:DjVu-documenten\nnn:DjVu-dokumentar\nno:DjVu-dokumenter\npl:Dokumenty DjVu\npt:Documentos DjVu\nro:Documente DjVu\nru:Документы DjVu\nsk:DjVu dokumenty\nsl:DjVu dokumenti\nsp-rs:DjVu dokumenti\nsq:Dokumente DjVu\nsr-rs:DjVu документи\nsv:DjVu-dokument\nta:DjVu ஆவணங்கள்\nth:เอกสาร DjVu\ntr:DjVu belgeleri\ntw:DjVu 文件\nuk:Документи DjVu\nuz:DjVu hujjatlari\nvn:Tập tin DjVu\n:Document Properties\nam:Ֆայլի հատկությունները\nar:خصائص المستند\naz:Sənədin xüsusiyyətləri\nbg:Свойства на документа\nbr:Propriedades do Documento\nbs:Svojstva dokumenta\nca-xv:Propietats del document\nca:Propietats del document\ncn:文档属性\ncy:Priodweddau Dogfen\ncz:Vlastnosti dokumentu\nde:Dokumenteigenschaften\ndk:Dokumentegenskaber\nel:Ιδιότητες εγγράφου\nes:Propiedades del documento\net:Dokumendi omadused\neu:Agiriaren Ezaugarriak\nfa:مشخصات سند\nfi:Asiakirjan ominaisuudet\nfr:Propriétés du document\nfy-nl:Dokuminteigenskippen\nga:Airíonna na cáipéise\ngl:Propiedades do documento\nhe:מאפייני קובץ\nhi:दस्तावेज़ गुण\nhr:Svojstva dokumenta\nhu:A dokumentum tulajdonságai\nid:Properti Dokumen\nit:Proprietà del documento\nja:ドキュメントのプロパティ\nka:დოკუმენტის თვისებები\nkr:문서 속성\nku:تایبەتمەندییەکانی بەڵگەنامە\nlt:Dokumento savybės\nlv:Dokumenta rekvizīti\nmk:Својства на документ\nmy:Maklumat Dokumen\nne:कागजात गुणहरू\nnl:Documenteigenschappen\nnn:Dokumentegenskaper\nno:Dokumentegenskaper\npl:Właściwości dokumentu\npt:Propriedades do documento\nro:Proprietăți document\nru:Свойства документа\nsi:ගොනු වත්කම්\nsk:Vlastnosti dokumentu\nsl:Lastnosti dokumenta\nsp-rs:Osobine dokumenta\nsq:Vetitë e dokumentit\nsr-rs:Особине документа\nsv:Dokumentegenskaper\nta:கோப்பின் பண்புகள்\nth:คุณสมบัติเอกสาร\ntl:Mga katangian ng dokumento\ntr:Belge Özellikleri\ntw:文件特性\nuk:Властивості документа\nuz:Hujjat xossalari\nvn:Thuộc tính tập tin\n:Download\nam:Ներբեռնել\nar:تحميل\naz:Bəli\nbg:Свали\nbr:Baixar\nbs:Preuzmi\nby:Загрузка\nca-xv:Baixa\nca:Baixa\ncn:下载\ncy:Llwytho i Lawr\ncz:Stáhnout\nde:Herunterladen\ndk:Hent\nel:Λήψη\nes:Descargar\net:Laadi alla\neu:Jeitsi\nfa:دریافت\nfi:Lataa\nfr:Télécharger\nfy-nl:Ynlade\nga:Íosluchtaigh\ngl:Descargar\nhe:הורד\nhi:डाउनलोड\nhr:Preuzmi\nhu:Letöltés\nid:Unduh\nit:Scarica\nja:ダウンロード\njv:Ngunduh\nka:ჩამოტვირთვა\nkr:예\nku:داگرتن\nkw:Iskarga\nlt:Atsisiųsti\nlv:Lejupielādēt\nmk:Преземи\nmy:Muat turun\nne:डाउनलोड\nnl:Downloaden\nnn:Last ned\nno:Nedlasting\npl:Pobierz\npt:Transferir\nro:Descarcă\nru:Загрузка\nsi:භාගතකිරීම\nsk:Stiahnuť\nsl:Prenesi\nsp-rs:Preuzmi\nsq:Shkarkoj\nsr-rs:Преузми\nsv:Ladda &ned\nta:பதிவிற்க்கம்\ntl:I-download\ntr:İndir\ntw:下載\nuk:Завантажити\nuz:Yuklab olish\nvn:Tải xuống\n:E&xit\\tCtrl+Q\naf:&Gaan Uit-Q\nam:Փա&կել\\tCtrl+Q\nar:خروج\\tCtrl+Q\naz:Çıxı&ş\\tCtrl+Q\nbg:Из&ход\\tCtrl+Q\nbn:&প্রস্থান\\tCtrl+Q\nbr:Sai&r\\tCtrl+Q\nbs:&Izlaz\\tCtrl+Q\nby:Выйсце\\tCtrl+Q\nca-xv:I&x\\tCtrl+Q\nca:S&urt\\tCtrl+Q\ncn:退出(&X)\\tCtrl+Q\ncy:&Gadael\\tCtrl+Q\ncz:&Konec\\tCtrl+Q\nde:&Beenden\\tStrg+Q\ndk:&Afslut\\tCtrl+Q\nel:Έ&ξοδος\\tCtrl+Q\nes:&Salir\\tCtrl+Q\net:Väl&ju\\tCtrl+Q\neu:I&rten\\tKtrl+Q\nfa:&خروج\\tCtrl+Q\nfi:&Lopeta\\tCtrl+Q\nfr:&Quitter\\tCtrl+Q\nfy-nl:&Ofslute\\tCtrl+Q\nga:Scoir\\tCtrl+Q\ngl:&Saír\\tCtrl+Q\nhe:יציאה\\tCtrl+Q\nhi:बाहर निकलें(&x)\\tCtrl+Q\nhr:&Izađi\\tCtrl+Q\nhu:&Kilépés\\tCtrl+Q\nid:&Keluar\\tCtrl+Q\nit:Es&ci\\t<Ctrl>+Q\nja:終了(&X)\\tCtrl+Q\nka:&გამოსვლა\\tCtrl+Q\nkr:끝내기(&X)\\tCtrl+Q\nku:دە&رچوون\\tCtrl+Q\nkw:&Degea\\tCtrl+Q\nlt:&Baigti darbą\\tCtrl+Q\nlv:&Iziet\\tCtrl+Q\nmk:&Излези\\tCtrl+Q\nml:പുറത്തേക്ക് \\tCtrl+Q\nmm:&ထွက်ပါ\\tCtrl+Q\nmy:&Keluar\\tCtrl+Q\nne:बाहिर &जानुहोस्\\tCtrl+Q\nnl:&Afsluiten\\tCtrl+Q\nnn:&Avslutt\\tCtrl+Q\nno:A&vslutt\\tCtrl+Q\npa:ਬੰਦ ਕਰੋ(&x)\\tCtrl+Q\npl:&Wyjście\\tCtrl+Q\npt:&Sair\\tCtrl+Q\nro:&Ieșire\\tCtrl+Q\nru:В&ыход\\tCtrl+Q\nsi:වසන්න\\tCtrl+Q\nsk:&Ukončiť\\tCtrl+Q\nsl:I&zhod\\tCtrl+Q\nsn:&Siyana Nazvo\\tCtrl+Q\nsp-rs:Izađi\\tCtrl+Q\nsq:D&al\\tCtrl+Q\nsr-rs:Изађи\\tCtrl+Q\nsv:&Avsluta\\tCtrl+Q\nta:வெளியேறு\\tCtrl+Q\nth:ออก\\tCtrl+Q\ntl:Isara\\tCtrl+Q\ntr:Ç&ık\\tCtrl+O\ntw:離開(&X)\\tCtrl+Q\nuk:&Вийти\\tCtrl+Q\nuz:&Chiqish\\tCtrl+Q\nvn:Th&oát\\tCtrl+Q\n:EPUB ebooks\nam:EPUB ebooks\nar:EPUB كتب الكترونية\naz:EPUB e-kitabları\nbg:EPUB документи\nbr:Documentos EPUB\nbs:EPUB dokumenti\nca-xv:Documents EPUB\nca:Documents EPUB\ncn:EPUB 文档\ncy:eLyfrau EPUB\ncz:Dokumenty EPUB\nde:EPUB E-Bücher\ndk:EPUB-dokumenter\nel:Έγγραφα EPUB\nes:Libros electrónicos en EPUB\net:EPUB-dokumendid\neu:EPUB agiriak\nfa:EPUB اسناد\nfi:EPUB-asiakirjat\nfr:Fichiers EPUB\nfy-nl:EPUB-bestannen\nga:Cáipéisí EPUB\ngl:Documentos EPUB\nhe:קובצי EPUB\nhi:EPUB ई - किताबें\nhr:EPUB dokumenti\nhu:EPUB fájlok\nid:Dokumen EPUB\nit:Documenti EPUB\nja:EPUB ドキュメント\nka:EPUB დოკუმენტები\nkr:ePub 문서\nku:EPUB پەرتووکە ئەلکترۆنیەکانی\nlt:EPUB dokumentai\nlv:EPUB elektroniskās grāmatas\nmk:EPUB-е-книги\nml:EPUB പുസ്തകങ്ങള്‍\nmy:Ebook EPUB\nne:EPUB ई-पुस्तकहरु\nnl:EPUB-bestanden\nnn:EPUB digitale bøkjer\nno:EPUB-dokumenter\npl:Dokumenty EPUB\npt:Documentos EPUB\nro:Documente EPUB\nru:Документы EPUB\nsk:EPUB dokumenty\nsl:EPUB dokumenti\nsp-rs:EPUB dokumenti\nsq:Libra elektronikë EPUB\nsr-rs:EPUB документи\nsv:EPUB-dokument\nta:EPUB மின்புத்தகங்கள்\ntr:EPUB belgeleri\ntw:EPUB 文件\nuk:Документи EPUB\nuz:EPUB kitoblari\nvn:Tập tin EPUB\n:Enter password\naf:Tik Wagwoord In\nam:Գրեք գաղտնաբառը\nar:ادخل كلمة السر\naz:Parolu daxil edin\nbg:Въведете парола\nbn:শব্দকূট প্রবেশ করুন\nbr:Digite a senha\nbs:Unesite lozinku\nby:Увядзіце пароль\nca-xv:Introduïu la contrasenya\nca:Introduïu la contrasenya\ncn:键入密码\ncy:Rhoi cyfrinair\ncz:Zadejte heslo\nde:Bitte Passwort eingeben\ndk:Indtast kodeord\nel:Εισάγετε κωδικό\nes:Escriba la contraseña\net:Sisesta salasõna\neu:Idatzi sarhitza\nfa:کلمه‌ی عبور را وارد کنید\nfi:Kirjoita salasana\nfr:Entrer le mot de passe\nfy-nl:Wachtwurd ynfiere\nga:Cuir isteach focal faire\ngl:Insira o contrasinal\nhe:הכנס ססמה\nhi:पहचान शब्द भरें\nhr:Unesi lozinku\nhu:Írja be a jelszót\nid:Masukkan kata sandi\nit:Inserisci password\nja:パスワードの入力\nka:შეიყვანეთ პაროლი\nkr:비밀번호 입력\nku:تێپەڕە ووشە بنوسە\nkw:Ri ger-tremena\nlt:Įveskite slaptažodį\nlv:Ievadīt paroli\nmk:Внеси лозинка\nml:രഹസ്യവാക്ക് നള്‍കുക\nmm:လျှို့ဝှက် ထည့်သွင်းရန်\nmy:Masukkan kata laluan\nne:पासवर्ड भर्नुहोस्\nnl:Wachtwoord invoeren\nnn:Skriv inn passord\nno:Skriv inn passord\npa:ਪਾਸਵਰਡ ਭਰੋ\npl:Podaj hasło\npt:Introduza a palavra-passe\nro:Introduceți parola\nru:Введите пароль\nsi:මුරපදය ඇතුලුකරන්න\nsk:Zadať heslo\nsl:Vnesite geslo\nsn:Isa password\nsp-rs:Unesite lozinku\nsq:Shkruani fjalëkalimin\nsr-rs:Унесите лозинку\nsv:Ange lösenord\nta:கடவுச்சொல்லை வழங்கு\nth:ป้อนรหัสผ่าน\ntl:Ipasok ang password\ntr:Şifrenizi giriniz\ntw:鍵入密碼\nuk:Введіть пароль\nuz:Maxfiy so'zni kiriting\nvn:Nhập mật khẩu\n:Enter password for %s\naf:Tik Wagwoord In Vir %s\nam:Գրեք գաղտնաբառը՝ %s-ի համար\nar:%s ادخل كلمة سر ل\naz:%s üçün parolu daxil edin\nbg:Въведете парола за %s\nbn:%s-এর জন্য শব্দকূট প্রবেশ করুন\nbr:Digite a senha de %s\nbs:Unesite lozinku za %s\nby:Увядзіце пароль для %s\nca-xv:Introduïu la constrasenya per a %s\nca:Introduïu la constrasenya per a %s\ncn:键入 %s 的密码\ncy:Rhoi cyfrinair ar gyfer %s\ncz:Zadejte heslo pro %s\nde:Bitte Passwort für %s eingeben\ndk:Indtast kodeord for %s\nel:Εισάγετε κωδικό για το %s\nes:Introduzca contraseña para %s\net:Sisesta faili %s salasõna\neu:Idatzi %s-rentzako sarhitza\nfa:کلمه‌ی عبور را برای %s وارد کنید\nfi:Kirjoita tiedoston %s salasana\nfr:Entrer le mot de passe pour %s\nfy-nl:Wachtwurd ynfiere foar %s\nga:Cuir isteach focal faire le haghaidh %s\ngl:Insira contrasinal para %s\nhe:הכנס ססמה ל- %s\nhi:%s के लिए पहचान शब्द भरें\nhr:Unesi lozinku za %s\nhu:Írja be a(z) %s jelszavát\nid:Masukkan kata sandi untuk %s\nit:Inserisci password per %s\nja:%s のパスワードを入力します\nka:შეიყვანეთ პაროლი %s-ისთვის\nkr:%s의 비밀번호를 입력하세요.\nku:%s تێپەڕە ووشە بنوسە بۆ\nkw:Ri ger-tremena rag %s\nlt:Įveskite %s slaptažodį\nlv:Ievadīt %s paroli\nmk:Внеси лозинка за %s\nmm:လျှို့ဝှက် ထည့်သွင်း %s\nmy:Masukkan kata laluan untuk %s\nne:%s को पासवर्ड भर्नुहोस्\nnl:Wachtwoord invoeren voor %s\nnn:Skriv inn passord for %s\nno:Skriv inn passord for %s\npa:%s ਲਈ ਪਾਸਵਰਡ ਭਰੋ\npl:Podaj hasło dla %s\npt:Introduza a palavra-passe de %s\nro:Introduceți parola pentru %s\nru:Введите пароль для %s\nsi:%s සඳහා මුරපදය ඇතුල්කරන්න\nsk:Zadať heslo pre %s\nsl:Vnesite geslo za %s\nsn:Isa password ya %s\nsp-rs:Unesite lozinku za %s\nsq:Shkruani fjalëkalimin për %s\nsr-rs:Унесите лозинку за %s\nsv:Ange lösenord för %s\nta:%s  காண கடவுச்சொல்லை வழங்கு\nth:ป้อนรหัสผ่านสำหรับ %s\ntl:Ipasok ang password ng %s\ntr:%s için şifrenizi giriniz\ntw:鍵入 %s 的密碼\nuk:Введіть пароль для %s\nuz:%s uchun maxfiy so'zni kiriting\nvn:Nhập mật khẩu cho %s\n:Enter the command-line to invoke when you double-click on the PDF document:\nam:Մուտքագրեք հրաման, որը կկատարվի PDF ֆայլում մկնիկի կրկնակի սեղման ժամանակ.\nar:ادخل سطر الاوامر للاستدعاء عند النقر المزدوج فوق وثيقة المستندات المحمولة\naz:PDF sənədinin üstünə iki dəfə basdıqda çağırılan komanda sətrini daxil edin:\nbg:Въведете командата, която ще бъде изпълнена при двоен клик върху PDF документа:\nbr:Digite a linha de comando a ser invocada com um duplo clique sobre o documento PDF:\nbs:Unesite komandnu liniju za izvršavanje prilikom dvostrukog klika na PDF dokument:\nca-xv:Introduïu la línia d'ordes que voleu executar en fer doble clic al document PDF:\nca:Introduïu la línia d'ordres que voleu executar en fer doble clic al document PDF:\ncn:请键入双击 PDF 文件时，应运行的命令(&E):\ncy:Rhowch y llinell orchymyn i'w gychwyn pan yn rhoi clic dwbl i ddogfen PDF:\ncz:Dvojité kliknutí na PDF dokument vykoná zadaný příkazový řádek:\nde:Beim Doppelklicken im PDF Dokument wird der folgende Befehl ausgeführt:\ndk:Indtast den kommandolinje du vil bruge, når du dobbeltklikker på PDF-dokumentet:\nel:Εισάγετε την εντολή προς εκτέλεση με διπλό κλικ σε έγγραφο PDF:\nes:Introduzca los parámetros de línea de comandos que se ejecutarán al hacer doble-clic en el documento PDF:\net:Sisesta käsurida, mis käivitatakse, kui teed topeltklõpsu PDF dokumendil:\neu:Idatzi deitzeko agindu-lerroa PDF agirian klik-bikoitza egiten duzunean:\nfa:خط دستور را برای فراخوانی هنگام دوبار کلیک روی سند PDF وارد کنید:\nfi:Anna komentorivin komento, joka ajetaan kun PDF-asiakirjaa kaksoisnapsautetaan:\nfr:Entrer la ligne de commande à exécuter lorsque vous double-cliquez sur le document PDF :\nga:Cuir isteach líne na n-orduithe atá le gairm nuair a bhrúann tú faoi dhó ar cháipéis PDF:\ngl:Insira a liña de comandos a invocar cando prema dúas veces no documento PDF:\nhe:הזן שורת פקודה להפעלה בלחיצה כפולה על קובץ ה- PDF:\nhi:पीडीएफ दस्तावेज़ पर डबल क्लिक से आह्वान करने के लिये कमांड लाइन में प्रवेश करें:\nhr:Unesite naredbenu liniju za pokretanje kod dvostrukog klika na PDF dokumentu:\nhu:Írja be a parancsot, ami a PDF dokumentumra való dupla kattintáskor fut le:\nid:Masukkan baris perintah untuk dijalankan ketika Anda mengklik dua kali pada dokumen PDF:\nit:Inserire la linea di comando da eseguire quando si fa doppio clic su un documento PDF:\nja:PDF ドキュメント上でダブルクリックしたときに呼び出すコマンドラインを入力:\nka:შეიყვანეთ ბრძანების სტრიქონი რომლის გამოძახებაც PDF დოკუმენტზე ორჯერ დაწპაკუნების შემდეგ გსურთ:\nkr:PDF 문서를 더블 클릭할 때 호출할 명령줄 입력:\nku:کرا PDF فرمانی هێڵ بنوسە بۆ یارمەتیدان کاتێک دوو کلیک لەسەر بەڵگەنامەی:\nlt:Įveskite komandinę eilutę, vykdomą atverčiant PDF dokumentą:\nlv:Ievadiet komandrindu, izsaucamu ar dubultklikšķi uz PDF dokumenta:\nmk:Внесете команда, за да се извршува при секое двојно кликнунвање на PDF-документот:\nmy:Masukkan baris arahan untuk digunakan apabila anda klik dua kali pada dokumen PDF:\nne:PDF कागजातमा दोहोरो क्लिक गर्दा आह्वान गर्ने आदेश पङ्‌क्ति प्रविष्ट गराउनुहोस्:\nnl:Opdracht-regel die gestart moet worden bij het dubbelklikken van een PDF-document:\nnn:Gå inn i kommandolinja for å hentast, når du dobbeltklikkar på PDF-dokumentet:\nno:Skriv inn kommandolinjen som skal kjøres når du dobbeltklikker på PDF-dokumentet:\npl:Podaj polecenie wykonywane po dwukrotnym kliknięciu pliku PDF:\npt:Indique a linha de comandos a invocar ao clicar duas vezes no documento PDF:\nro:Introduceți comanda invocată la dublu click pe documentul PDF:\nru:Введите командную строку, вызываемую при двойном щелчке на PDF-документе:\nsi:PDF ගොනුව මත double-click කළ විට සිදුවන ක්‍රියාව සදහා විධාන පෙළට අවතීර්ණවන්න:\nsk:Dvojité kliknutie na PDF dokument vykoná zadaný príkazový riadok:\nsl:Vnesite ukazno vrstico, ki se bo izvedla, ko boste dvokliknili na PDF dokument:\nsp-rs:Unesite parametre komandne linije koji će se izvršiti prilikom dvoklika na PDF dokument:\nsq:Komanda që jepet kur klikoni dy herë dokumentin PDF:\nsr-rs:Унесите параметре командне линије који ће се извршити приликом двоклика на PDF документ:\nsv:Ange kommandorad att aktivera när du dubbelklickar på PDF-dokumentet:\nta:நீங்கள் PDF ஆவணத்தின் மீது இரட்டை சொடுக்கும் போது செயலாக்க கட்டளை வரி உள்ளிடவும்:\ntl:Pakisulat ang command na gagawin kapag dalawang beses na kli-nik ang dokumentong PDF:\ntr:PDF belgesine çift tıklanınca yürütülecek komutu giriniz:\ntw:請輸入滑鼠按兩下 PDF 文件時，應執行的指令(&E):\nuk:Введіть командну стрічку, що викликається при подвійному клацані на PDF-документі:\nuz:PDF-hujjatni ikki marta bosganda ishga tushadigan buyruq satrini kiriting:\nvn:Nhập dòng lệnh gọi khi bạn nhấp đúp vào tập tin PDF:\n:Error loading %s\nam:Բացման սխալ %s\nar:%s خطأ في التحميل  \naz:%s faylının yüklənməsində xəta baş verdi\nbg:Грешка при зареждане на %s\nbr:Erro ao carregar %s\nbs:Greška pri učitavanju %s\nca-xv:S'ha produït un error en carregar %s\nca:S'ha produït un error en carregar %s\ncn:载入错误 %s\ncy:Gwall llwytho %s\ncz:Chyba při načítání %s\nde:Fehler beim Öffnen von %s\ndk:Side %s kan ikke indlæses\nel:Σφάλμα φόρτωσης του %s\nes:Error al cargar %s\net:Viga laadimisel: %s\neu:Akatsa %s gertatzerakoan\nfa:خطا هنگام بارگذاری %s\nfi:Virhe ladattaessa: %s\nfr:Erreur de chargement de %s\nga:Tharla botún ag luchtú %s\ngl:Erro cargando %s\nhe:טעינת %s נכשלה.\nhi:त्रुटि लोड हो रही है %s\nhr:Greška kod pokretanja %s\nhu:Hiba %s dokumentum betöltésekor\nid:Kesalahan memuat %s\nit:Errore nel caricamento di %s\nja:%s の読み込みに失敗\nka:ჩატვირთვის შეცდომა %s\nkr:%s (을)를 불러오는 중에 오류가 발생했습니다!\nku:%s هەڵە ڕوویدا لە کردنەوەی\nlt:Nepavyko įkelti %s\nlv:%s ielādes kļūda\nmk:Грешка при вчитување %s\nmy:Ralat memuatkan %s\nne:%s लोड त्रुटि\nnl:Fout bij het laden van %s\nnn:Feil ved innlasting av %s\nno:Feil under innlasting av %s\npl:Błąd ładowania pliku %s\npt:Erro ao carregar %s\nro:Eroare la încărcarea %s\nru:Ошибка загрузки %s\nsk:Chyba pri načítaní %s\nsl:Napaka pri nalaganju %s\nsp-rs:Došlo je do greške prilikom učitavanja datoteke %s\nsq:Gabim në hapjen e %s\nsr-rs:Дошло је до грешке приликом учитавања датотеке %s\nsv:Fel vid öppning av %s\nta:ஏற்றுவதில் பிழை %s\ntr:%s yükleme hatası\ntw:正在載入 %s 時發生錯誤\nuk:Помилка завантаження %s\nuz:%s yuklab olish xatosi\nvn:Không mở %s được\n:F&avorites\nam:Ը&նտրյալներ\nar:المفضلة\naz:&Seçilmişlər\nbg:&Любими\nbr:&Favoritos\nbs:F&avoriti\nca-xv:F&avorits\nca:Pr&eferits\ncn:收藏(&A)\ncy:&Ffefrynnau\ncz:&Oblíbené položky\nde:&Favoriten\ndk:Bogm&ærker\nel:Α&γαπημένα\nes:&Favoritos\net:L&emmikud\neu:&Gogokoenak\nfa:&علاقه‌مندی‌ها\nfi:S&uosikit\nfr:Fa&voris\nga:Ce&anáin\ngl:F&avoritos\nhe:מוע&דפים\nhi:&पसंदीदा\nhr:F&avoriti\nhu:&Kedvencek\nid:F&avorit\nit:&Preferiti\nja:お気に入り(&A)\nka:&რჩეულები\nkr:즐겨찾기(&A)\nku:پە&سەندەکان\nlt:&Parankiniai\nlv:Grāmat&zīmes\nmk:Омилени\nmy:Kegem&aran\nne:&मनपर्ने\nnl:F&avorieten\nnn:F&avorittar\nno:F&avoritter\npl:&Ulubione\npt:Fav&oritos\nro:F&avorite\nru:&Избранное\nsk:&Obľúbené položky\nsl:Priljubljeni\nsp-rs:Odabir\nsq:P&ëlqej\nsr-rs:Одабир\nsv:&Favoriter\nta:பிடித்தவை\ntr:S&ık kullanılanlar\ntw:我的最愛(&A)\nuk:Закладки\nuz:&Tanlanganlar\nvn:Ưa thích\n:F&orward\\tAlt+Right Arrow\nam:Առաջ\\tAlt+->\nar:ل&لامام\\tAlt+Right Arrow\naz:&İrəli\\tAlt+Right Arrow\nbg:Нап&ред\\tAlt+Дясна стрелка\nbr:Avançar\\tAlt+->\nbs:Naprijed\\tAlt+->\nca-xv:Avan&t\\tAlt+Right Arrow\nca:En&davant\\tAlt+Right Arrow\ncn:下一页面(&O)\\tAlt+右箭头\ncy:Ymlaen\\tAlt+Saeth Dde\ncz:V&před\\tAlt+Šipka vpravo\nde:Vor&wärts\\tAlt+->\ndk:F&remad\\tAlt+->\nel:Εμπ&ρός\\tAlt+->\nes:Adelante\\tAlt+Der\net:E&dasi\\tAlt+Paremnool\neu:A&urrera\\tAlt+Eskuin Gezia\nfa:جای &بعدی\\tAlt+→‎\nfi:Se&uraava\\tAlt+Oikea nuoli\nfr:&Avancer\\tAlt+->\nfy-nl:Fierder\\tAlt+->\nga:Ar aghaidh\\tAlt+Saighead Ar Deis\ngl:Adiante\\tAlt+Right Arrow\nhe:מקטע הבא\\tחץ ימני + Alt\nhi:अग&ला\\tAlt+दायाँ तीर\nhr:Naprijed\\tAlt+->\nhu:Ugrás előre\\tAlt+->\nid:Berikutnya\\tAlt+->\nit:A&vanti\\t<Alt>+<Freccia destra>\nja:次に進む(&O)\\tAlt+→\nka:&წინ\\tAlt+ისარი მარჯვნივ\nkr:이후에 본 페이지(&O)\\tAlt+오른쪽 방향키\nku:پێ&شتر\\tAlt+Right Arrow\nkw:Yn-rag\\tAlt+->\nlt:&Pirmyn\\tAlt+Dešinėn\nlv:&Tālāk\\tAlt+Labā bultiņa\nmk:Напред\\tAlt+Right Arrow\nmy:F&orward \\t alt + Panah Kanan\nne:अ&गाडि\\tAlt+दायाँ बाण\nnl:Verder\\tAlt+->\nnn:F&ramover\\tAlt+Høyretast\nno:Fremover\\tAlt+→\npl:&Dalej\\tAlt+W prawo\npt:A&vançar\\tAlt + ->\nro:Înainte\\tAlt+->\nru:&Вперёд\\tAlt+Стрелка вправо\nsi:ඉදිරියට\\tAlt+Right Arrow\nsk:D&opredu\\tAlt+Right Arrow\nsl:Naprej\\tAlt+Desna puščica\nsp-rs:Napred\\tAlt+->\nsq:P&ërpara\\tAlt+Right Arrow\nsr-rs:Напред\\tAlt+->\nsv:Framåt\\tAlt+Pil höger\nta:முன்னோக்கி \\tAlt+Right Arrow\ntl:Susunod\\tAlt+Right Arrow\ntr:İ&leri\\tAlt+Sağ Ok\ntw:下一停頓頁面(&O)\\tAlt+->\nuk:Вперед\\tAlt+Права стрілка\nuz:&Oldinga\\tAlt+->\nvn:Tiếp tục\\tAlt+Mũi tên phải\n:F&ullscreen\\tF11\naf:Volskerm\\tCtrl+Shift+L\nam:Ամ&բողջ էկրանով\\tCtrl+Shift+L\nar:ملء الشاشة \\tF11 \naz:Tam ek&ran\\tCtrl+Shift+L\nbg:На &цял екран\\tCtrl+Shift+L / F11\nbn:পূর্ণ পর্দা\\tCtrl+Shift+L\nbr:Tela cheia\\tCtrl+Shift+L\nbs:Cijeli ekran\\tCtrl+Shift+L\nby:Поўны экран\\tCtrl+Shift+L\nca-xv:Pantalla &completa\\tCtrl+Shift+L\nca:Pantalla &completa\\tCtrl+Shift+L\ncn:全屏显示(&U)\\tCtrl+Shift+L\ncy:Sgrin Lawn\\tCtrl+Shift+L\ncz:&Celá obrazovka\\tF11\nde:&Vollbild\\tF11\ndk:F&uldskærmsvisning\\tCtrl+skift+L\nel:&Πλήρης οθόνη\\tCtrl+Shift+L\nes:Pantalla completa\\tCtrl+Mayús+L\net:&Täisekraanvaade\\tCtrl+Shift+L\neu:&Ikusleiho-osoan\\tKtrl+Shift+L\nfa:&تمام‌صفحه\\tCtrl+Shift+L\nfi:Koko &näyttö\\tCtrl+Shift+L\nfr:&Plein écran\\tCtrl+Maj+L\nfy-nl:Folslein skerm\\tCtrl+Shift+L\nga:Lánscáileán\\tCtrl+Shift+L\ngl:A toda pantalla\\tCtrl+Shift+L\nhe:מסך מלא\\tCtrl+Shift+L\nhi:पूरा परदा\\tCtrl+Shift+L\nhr:Cijeli zaslon\\tCtrl+Shift+L\nhu:Teljes képernyő\\tCtrl+Shift+L\nid:Selayar Penuh\\tCtrl+Shift+L\nit:S&chermo intero\\t<Ctrl>+<Maiusc>+L\nja:全画面表示(&U)\\tCtrl+Shift+L\nka:მთელ &ეკრანზე\\tCtrl+Shift+L\nkr:전체 화면(&U)\\tCtrl+Shift+L\nku:پڕ&بەشاشە\\tCtrl+Shift+L\nkw:Skrin Leun\\tCtrl+Shift+L\nlt:&Visas ekranas\\tCtrl+Shift+L\nlv:Pilnekrāna režīms\\tF11\nmk:На цел екран\\tCtrl+Shift+L\nml:മുഴുവന്‍ കാണിക്കുക\\tCtrl+Shift+L\nmm:မြင်ကွင်း ပြည့်\\tCtrl+Shift+L\nmy:Mukasurat Penuh\\tCtrl+Shift+L\nne:पू&र्णस्क्रिन\\tCtrl+Shift+L\nnl:Volledig scherm\\tCtrl+Shift+L\nnn:Full skjerm\\tCtrl+Shift+L\nno:Fullskjerm\\tCtrl+Shift+L\npa:ਪੂਰੀ ਸਕਰੀਨ\\tCtrl+Shift+L\npl:Pełny ekran\\tCtrl+Shift+L\npt:Ecrã co&mpleto\\tCtrl+Shift+L\nro:Tot ecranul\\tCtrl+Shift+L\nru:Полный &экран\\tF11\nsi:සම්පූර්ණ තිරය\\tCtrl+Shift+L\nsk:&Na celú obrazovku\\tCtrl+Shift+L\nsl:Celozaslonsko\\tCtrl+Shift+L\nsn:Zadza Screen\\tCtrl+Shift+L\nsp-rs:Ceo ekran\\tCtrl+Shift+L\nsq:Ekran i p&lotë\\tCtrl+Shift+L\nsr-rs:Цео екран\\tCtrl+Shift+L\nsv:Fullskärm\\tCtrl+Shift+L\nta:முழுத்திரை\nth:เต็มจอภาพ\\tCtrl+Shift+L\ntl:Pagkasyahin sa buong screen\\tCtrl+Shift+L\ntr:&Tam Ekran\\tCtrl+Shift+L\ntw:全螢幕顯示(&U)\\tCtrl+Shift+L\nuk:На цілий екран\\tCtrl+Shift+L\nuz:To'liq &ekran\\tCtrl+Shift+L\nvn:Toàn màn hình\\tCtrl+Shift+L\n:Facing\naf:Teenoor\nam:Երկու էջ\nar:متقابلتان\naz:Cüt səhifələr\nbg:Срещуположни страници\nbn:দুটি পৃষ্ঠায়\nbr:Página dupla\nbs:Dvije stranice\nby:Дзьве старонкі\nca-xv:Pàgina doble\nca:Pàgina doble\ncn:双页模式\ncy:Gwynebu\ncz:Dvojstránky\nde:Doppelseite\ndk:Modstående\nel:Δύο σελίδες\nes:Página doble\net:Kaheleheküljeline\neu:Bi Aldeetatik\nfa:نمایش دوصفحه‌ای\nfi:Rinnakkain\nfr:Page double\nfy-nl:Dûbele side\nga:Dhá Leathanach\ngl:Páxina dobre\nhe:עמוד לצד עמוד\nhi:पुस्तक\nhr:Dvije stranice\nhu:Oldalpár\nid:Dua Halaman\nit:Pagine affiancate\nja:見返し\nka:ურთიერთ-საპირისპიროდ\nkr:두 페이지씩\nku:ڕووکار\nkw:A-dal\nlt:Du puslapiai\nlv:Divas lappuses\nmk:Две страници\nml:തിരിച്ച്\nmm: အရှေ့မျက်နှာ\nmy:Dua belah mukasurat\nne:सम्मुख\nnl:Dubbele pagina\nnn:Fleire sider\nno:Flere sider\npa:ਕਿਤਾਬ\npl:Wiele stron\npt:Duas páginas\nro:Două pagini\nru:По две страницы\nsi:Facing\nsk:Dve strany\nsl:Dvostransko\nsn:Facing\nsp-rs:Naspramno\nsq:Përbri\nsr-rs:Наспрамно\nsv:Uppslag\nta:முகப்பு\nth:เป็นหน้า\ntl:Magkaharap\ntr:Çift sayfa\ntw:雙頁模式\nuk:Дві сторінки\nuz:Ikkita betdan\nvn:Trang kép\n:Failed to copy uninstaller to temp directory\nam:Հնարավոր չեղավ պատճենել ջնջիչը ժամանակավոր թղթապանակ\nar:فشل في نسخ إلغاء التثبيت الى الدليل المؤقت\naz:Deinstalyatoru müvəqqəti qovluğa kopyalamaq mümkün olmadı\nbg:Не може да се копира деинсталатора във временната директория\nbr:Falha na cópia do desinstalador para a pasta temporária\nbs:Neuspješno kopiranje deinstalera u privremeni direktorij\nca-xv:No es pot copiar el desinstal·lador al directori temporal\nca:No es pot copiar el desinstal·lador al directori temporal\ncn:无法复制卸载程序到暂存目录\ncy:Methwyd copïo'r dadosodwr i'r cyfeiriadur dros dro\ncz:Nezdařilo se zkopírovat odinstalační program do dočasného adresáře\nde:Konnte das Deinstallationsprogramm nicht kopieren\ndk:Kunne ikke kopiere fra midlertidig mappe\nel:Αποτυχία αντιγραφής απεγκαταστάτη στον κατάλογο temp\nes:Error al copiar el desinstalador al directorio temporal\net:Ei õnnestunud kopeerida eemaldusprogrammi temp kataloogi\neu:Hutsegitea kentzailea aldibaterako zuzenbidra kopiatzerakoan\nfa:کپی کردن برنامه‌ی حذف به پوشه‌ی موقت ناموفق بود\nfi:Poisto-ohjelman kopioiminen väliaikaiskansioon epäonnistui\nfr:La copie du désinstalleur dans un répertoire temporaire a échoué\nga:Theip air an díshuiteálaí a mhacasamhlú chuig an chomhadlann sealadach\ngl:Fallou a copia do desinstalador no cartafol temporal\nhe:העתקת מסיר התוכנה לתיקייה הזמנית נכשלה.\nhr:Neuspjeh kod kopiranju deinstalera u privremenu mapu\nhu:Az eltávolító ideiglenes könyvtárba másolása nem sikerült\nid:Gagal mengkopi uninstaller ke direktori temp\nit:Impossibile copiare programma disinstallazione nella cartella temporanea\nja:アンインストーラを一時ディレクトリへコピーするのに失敗しました\nkr:제거 관리자를 임시 디렉토리에 복사하지 못했습니다.\nku:لەبەرگرتنەوەی داتاکانی سڕینەوە سەرکەتو نەبوو بۆ فۆڵدەری کاتی\nlv:Neizdevās iekopēt instalācijas noņemšanas programmu pagaidu direktorijā\nmk:Не успеав да го ископирам деинсталаторот во привремената папка\nmy:Gagal untuk menyalin uninstaller untuk direktori sementara\nnl:Kon deinstallatie programma niet kopieren naar tijdelijke folder\nnn:Mislykkas i å kopiere installasjonsfjernar til det midlertidige direktivet\nno:Kan ikke kopiere avinstalleringsrutinen til midlertidig mappe\npl:Nie można skopiować deinstalatora do katalogu tymczasowego\npt:Falha ao copiar o desinstalador para a pasta temporária\nro:Eroare la copierea dezinstalatorului in directorul temporar\nru:Не удалось скопировать деинсталлятор во временную директорию\nsk:Kopírovanie odinštalátora do dočasného adresára bolo neúspešné\nsl:Kopiranje odstranjevalnega programa v začasno mapo ni uspelo\nsp-rs:Neuspelo kopiranje deinstalera u privremeni direktorijum\nsq:Dështoi kopjimi i çinstaluesit te direktoria e përkohshme\nsr-rs:Неуспело копирање деинсталера у привремени директоријум\nsv:Misslyckades med att kopiera avinstalleraren till temp-katalogen\nta:நிறுவி நீக்கலை தற்காலிக கோப்புறையில் இருந்து நகலெடுத்தல் தோல்வி\ntr:Kaldırıcıyı geçici dizine kopyalama başarısız oldu\ntw:無法將解除安裝程式複製到暫存目錄\nuk:Не вдалося скопіювати деінсталятор у тимчасову папку\nuz:O'chirish dasturini vaqtinchalik direktoriyaga nusxa olish muvaffaqiyatsiz tugadi\nvn:Không thể chép bộ gỡ cài đặt vào thư mục tạm\n:Failed to create a shortcut\nam:Հնարավոր չեղավ ստեղծել պիտակը\nar:فشل في إنشاء رابط اختصار للبرنامج\naz:Yarlık yaratmaq mümkün olmadı\nbg:Не може да се създаде командата за бърз достъп\nbr:Falha na criação do atalho\nbs:Neuspješno kreiranje kratice\nca-xv:No es pot crear una drecera\nca:No es pot crear una drecera\ncn:无法创建快捷方式\ncy:Methwyd creu llwybr byr\ncz:Vytvoření zástupce se nezdařilo\nde:Konnte keine Verknüpfung erstellen\ndk:Kunne ikke oprette genvej\nel:Αποτυχία δημιουργίας συντόμευσης\nes:No se pudo crear un acceso directo\net:Ei õnnestu luua otseteed\neu:Hutsegitea lasterbidea sortzerakoan\nfa:خطا در ایجاد میانبر\nfi:Pikakuvakkeen luominen epäonnistui\nfr:Impossible de créer un raccourci\nga:Theip air aicearra a chruthú\ngl:Fallou a creación do atallo\nhe:יצירת קיצור דרך נכשלה.\nhr:Neuspjeh u kreiranju prečaca\nhu:Nem sikerült létrehozni a parancsikont\nid:Gagal membuat shortcut.\nit:Impossibile creare il collegamento\nja:ショートカットの作成に失敗しました\nka:მალსახმობი ვერ შეიქმნა\nkr:바로가기를 만들지 못했습니다.\nku:دروستکردنی کورتە ئایکۆن سەرکەوتو نەبوو\nlv:Neizdevās izveidot saīsni\nmk:Не успеав да создадам кратенка\nmy:Gagal untuk mencipta shortcut\nnl:Kon snelkoppeling niet aanmaken\nnn:Klarte ikkje å lage ein snarveg\nno:Kan ikke opprette snarvei\npl:Błąd przy tworzeniu skrótu\npt:Erro ao criar atalho\nro:Eroare la crearea unei scurtaturi\nru:Не удалось создать ярлык\nsk:Vytvorenie odkazu bolo neúspešné\nsl:Ustvarjanje bližnjice ni uspelo\nsp-rs:Neuspelo kreiranje skraćenice\nsq:Dështoi krijimi i shkurtores\nsr-rs:Неуспело креирање скраћенице!\nsv:Misslyckades med att skapa genväg\nta:சுருக்கு வழி அமைதல் தோல்வி\ntr:Kısayol oluşturulamadı\ntw:無法建立捷徑\nuk:Не вдалося створити ярлик\nuz:Xatcho'pni yaratib bo'lmadi\nvn:Không thể tạo Shortcut\n:Failed to delete uninstaller registry keys\nam:Հնարավոր չեղավ ջնջել Գրանցատեղիի բանալիները\nar:فشل في حذف مفاتيح مكتب تسجيل إلغاء التثبيت\naz:Deinstalyatorun reyestr açarlarını silmək mümkün olmadı\nbg:Неуспешно изтриване на ключовете на деинсталатора в регистъра\nbr:Falha na remoção das entradas de registro do desinstalador\nbs:Neuspješno brisanje registarskih ključeva deinstalera\nca-xv:No es poden suprimir les claus de registre del desinstal·lador\nca:No es poden suprimir les claus de registre del desinstal·lador\ncn:删除卸载程序注册项失败。\ncy:Methwyd dileu allweddi cofrestrfa'r dadosodwr\ncz:Nepodařilo se smazat odinslační záznamy z registru\nde:Konnte nicht alle Registry-Einträge löschen\ndk:Kunne ikke slette afinstalleringsnøgler i registreringsdatabasen\nel:Απέτυχε η διαγραφή των κλειδιών μητρώου απεγκατάστασης\nes:Error al eliminar las claves del registro del desinstalador\net:Ei õnnestu kustutada eemaldusprogrammi registrivõtmeid\neu:Hutsegitea kentzaile erregistro giltzak ezabatzerakoan\nfa:کلیدهای رجیستری برنامه‌ی حذف پاک نشد\nfi:Poisto-ohjelman rekisteriavainten poistaminen epäonnistui\nfr:La suppression des clés de la base de registre du désinstalleur a échoué\nga:Theip air eochracha clárlainne an díshuiteálaithe a scriosadh\ngl:Fallou o borrado das claves de rexistro\nhe:מחיקת מפתחות רישום של מסיר התוכנה נכשלה.\nhr:Neuspjeh kod brisanja ključeva registra deinstalatera\nhu:Az eltávolító rendszerleíró adatbázis kulcsainak törlése sikertelen\nid:Gagal menghapus kunci registry uninstaller\nit:Impossibile rimuovere chiavi registro\nja:アンインストーラのレジストリキーを削除するのに失敗しました\nkr:레지스트리 키를 삭제하지 못했습니다.\nku:سڕینەوەی پاشکۆ و کلیلەکانی ڕیگستری سەرکەتو نەبوو\nlv:Neizdevās izdzēst instalācijas noņemšanas programmas reģistra atslēgas\nmk:Не успеав да ги избришам регистарските клучеви на деинсталаторот\nmy:Gagal untuk memadam kekunci pendaftaran uninstaller\nnl:Kon deinstallatie register sleutels niet verwijderen\nnn:Mislykkast i å slette avinstalleringsregisternøklane\nno:Kan ikke slette avinstalleringsnøkler i Registeret\npl:Nie można usunąć kluczy deinstalatora z rejestru\npt:Falha ao eliminar as chaves do registo\nro:Eroare la stergerea inregistrarilor de dezinstalare din registri\nru:Не удалось удалить ключи регистра для деинсталлятора\nsk:Vymazanie odinštalačných kľúčov v registroch bolo neúspešné\nsl:Brisanje registrskih ključev odstranjevalnega programa ni uspelo\nsp-rs:Neuspelo brisanje registri ključeva deinstalera\nsq:Dështoi fshirja e çinstaluesit nga regjistri\nsr-rs:Неуспело брисање кључева из регистри базе\nsv:Misslyckades med att ta bort registernycklar\nta:நிறுவி நீக்கியின் பதிவை அழிக்க முடியவில்லை\ntr:Kaldırıcı kayıt defteri anahtarlarını silemedi\ntw:刪除解除安裝器註冊項失敗。\nuk:Не вдалося видалити інформацію деінсталятора з реєстру\nuz:O'chirish dasturining reyestr kalitlarini o'chirish muvaffaqiyatsiz tugadi\nvn:Không thể xóa các khóa Registry của bộ gỡ cài đặt\n:Failed to rename the file!\nam:Հնարավոր չեղավ վերանվանել ֆայլը։\nar:فشل في إعادة تسمية الملف!\naz:Faylın adını dəyişmək mümkün olmadı!\nbg:Преименуването не беше успешно!\nbr:Falha ao renomear o arquivo!\nbs:Neuspješna promjena naziva faja!\nca-xv:S'ha produÏt un error en canviar el nom del fitxer!\nca:S'ha produït un error en canviar el nom del fitxer!\ncn:无法重命名!\ncy:Methwyd ailenwi'r ffeil!\ncz:Přejmenování souboru se nezdařilo!\nde:Die Datei konnte nicht umbenannt werden!\ndk:Fejl ved omdøbning af fil!\nel:Η μετονομασία του αρχείου απέτυχε!\nes:No se pudo renombrar el archivo.\net:Faili ümbernimetamine ebaõnnestus.\neu:Hutsegitea agiria berrizendatzerakoan!\nfa:تغییر نام پرونده ناموفق بود!\nfi:Tiedoston uudelleennimeäminen epäonnistui!\nfr:Impossible de renommer le fichier!\nga:Theip ar athainmniú an chomhaid!\ngl:Fallouse ao renomear o ficheiro\nhe:פעולת שינוי שם הקובץ נכשלה.\nhi:फ़ाइल का नाम बदलने मे असफ़ल​ !\nhr:Neuspjeh u preimenovanju datoteke!\nhu:A fájl átnevezése sikertelen\nid:Gagal mengganti nama berkas!\nit:Impossibile rinominare il file\nja:ファイル名の変更に失敗しました！\nka:ფაილის გადარქმევა ვერ მოხერხდა!\nkr:파일 이름을 바꾸지 못했습니다!\nku:گۆڕینی ناوی فایل سەرکەوتونەبوو!\nlv:Neizdevās pārdēvēt failu!\nmk:Не успеав да ја преименувам датотеката!\nmy:Gagal menamakan semula fail!\nne:नाम फेराई असफल\nnl:Naam niet kunnen wijzigen!\nnn:Klarte ikkje å omdøpe fila!\nno:Kunne ikke endre navn på filen!\npl:Błąd zmiany nazwy pliku!\npt:Falha ao mudar o nome do ficheiro!\nro:Eroare la redenumirea fisierului!\nru:Ошибка переименования файла!\nsk:Premenovanie súboru bolo neúspešné!\nsl:Preimenovanje datoteke ni uspelo!\nsp-rs:Nemoguće je preimenovati datoteku!\nsq:Dështoi riemërtimi i skedës!\nsr-rs:Немогуће је преименовати датотеку!\nsv:Kunde inte döpa om filen!\nta:கோப்புக்கு மறுபெயரிட முடியவில்லை!\ntr:Dosyanın ismi değiştirilemedi!\ntw:重新命名該檔案失敗!\nuk:Не вдалося перейменувати файл!\nuz:Fayl nomini o'zgartirish muvaffaqiyatsiz tugadi!\nvn:Không thể đổi tên tập tin!\n:Failed to save a file\naf:Kon nie die lêer stoor nie!\nam:Հնարավոր չէ պահպանել ֆայլում\nar:فشل في حفظ الملف\naz:Faylı yadda saxlamaq mümkün olmadı\nbg:Грешка при запаметяване на файла\nbn:সঞ্চিকা সংরক্ষণে ব্যর্থ\nbr:Erro ao salvar o arquivo.\nbs:Neuspješno spašavanje fajla\nby:Немагчыма захаваць файл\nca-xv:S'ha produït un error en guardar el fitxer.\nca:S'ha produït un error en desar el fitxer.\ncn:保存文件失败\ncy:Methwyd cadw ffeil\ncz:Soubor se nepodařilo uložit\nde:Die Datei konnte nicht neu gespeichert werden!\ndk:Kunne ikke gemme filen\nel:Αποτυχία αποθήκευσης αρχείου\nes:Error al guardar un archivo\net:Faili salvestamine ebaõnnestus\neu:Hutsegitea agiria gordetzerakoan\nfa:ذخیره کردن پرونده با شکست مواجه شد\nfi:Tiedoston tallennus epäonnistui\nfr:Échec à l'enregistrement du fichier\nfy-nl:Flater by bewarjen bestân\nga:Theip air comhad a chuir i dtaisce\ngl:Erro ao salvar o arquivo.\nhe:שמירת הקובץ נכשלה.\nhi:फाईल संभाली नहीं जा सकी\nhr:Spremanje datoteke nije uspjelo\nhu:A fájl mentése sikertelen\nid:Gagal menyimpan berkas\nit:Salvataggio file non riuscito\nja:ファイルの保存に失敗しました\nka:ფაილის შენახვა ვერ მოხერხდა\nkr:파일을 저장하지 못했습니다.\nku:پاراستنی فایل سەرکەتونەبوو\nkw:Gwithyans restren a fyllis\nlt:Failo įrašyti nepavyko\nlv:Neizdevās saglabāt failu\nmk:Зачувување на PDF-документот не успеа\nml:ഫയല്‍ സുക്ഷിക്കാന്‍ സാധിച്ചില്ല\nmm:ဖိုင် သိမ်းမရပါ\nmy:Gagal menyimpan fail\nne:फाइल बचत असफल\nnl:Fout bij opslaan bestand\nnn:Feil under lagring av fil\nno:Feil ved lagring av filen\npa:ਫਾਈਲ ਸੰਭਾਲੀ ਨਹੀ ਜਾ ਸਕੀ\npl:Błąd zapisywania pliku\npt:Erro ao gravar o ficheiro!\nro:Eroare la salvarea unui fișier\nru:Ошибка сохранения файла\nsi:ගොනුව සුරැකීමට නොහැකිය\nsk:Uloženie súboru bolo neúspešné\nsl:Shranjevanje datoteke ni uspelo\nsn:Tatadza kuseva faira\nsp-rs:Čuvanje datoteke nije uspelo\nsq:Dështoi ruajtja e skedës\nsr-rs:Чување датотеке није успело\nsv:Kan inte spara filen.\nta:கோப்பு சேமிப்பு தோற்பு\nth:การบันทึกไฟล์ล้มเหลว\ntl:Hindi ma-i-save ang file\ntr:Dosya kaydedilirken hata çıktı.\ntw:檔案儲存失敗\nuk:Не вдалося зберегти файл.\nuz:Faylni saqlash muvaffaqiyatsiz tugadi\nvn:Không lưu được tập tin.\n:Failed to write the extended file extension information to the registry\nam:Հնարավոր չեղավ ֆայլի ընդլայնման մասին գրառել Գրանցատեղիում\nar:فشل في كتابة معلومات امتداد الملف الممتدة لمكتب التسجيل\naz:Faylın genişliyi haqqında ətraflı məlumatı reyestrə yazmaq mümkün olmadı\nbg:Информация за разширението за изпълнителни файлове не може да се вкара в регистъра. \nbr:Falha na gravação da extensão de arquivo no registro\nbs:Neuspješno zapisivanje informacije o ekstenziji proširenog fajla u registar\nca-xv:No es pot escriure la informació d'extensió de fitxer extesa al registre\nca:No es pot escriure la informació d'extensió de fitxer extesa al registre\ncn:写入扩展名信息到注册项失败。\ncy:Methwyd ysgrifennu gwybodaeth estyniad ffeil estynedig i'r gofrestrfa\ncz:Nepodařilo se zapsat informace o příponě souboru do registru\nde:Konnte die Dateiformats-Verknüpfungen nicht vollständig in die Registry schreiben\ndk:Kunne ikke skrive udvidet information om filens efternavn i registreringsdatabasen\nel:Απέτυχε η εγγραφή του εκτεταμένου αρχείου πληροφοριών στο μητρώο\nes:Fallo al escribir información de la extensión de archivo en el registro\net:Ei õnnestunud registrisse kirjutada infot pikendatud faililaiendi kohta\neu:Hutsegitea agiri hedatu hedapen argibideak erregistroan idazterakoan\nfa:ثبت اطلاعات ارسال شده با پسوند طولانی ناموفق\nfi:Tiedostopäätetietojen kirjoittaminen rekisteriin epäonnistui\nfr:L'écriture dans la base de registre des informations étendues de l'extension de fichier a échoué\nga:Theip air faisnéis fhairsingthe iarmhír comhadainm a scríobh chuig an chlárlann\ngl:Non se puido escribir a información de extensión do ficheiro no rexistro\nhe:כתיבת נתוני סיומת קבצים ברישום נכשלה.\nhr:Neuspjeh kod zapisivanja produženih informacija nastavka datoteke u registru\nhu:Nem sikerült írni a kiterjesztett fájlkiterjesztést információkat a rendszerleíró adatbázisban\nid:Gagal menulis info ekstensi file lanjutan ke registry\nit:Scrittura fallita informazione estensione estesa file nel registro\nja:拡張子情報をレジストリに書き込むのに失敗しました\nkr:확장된 파일의 확장자 정보를 레지스트리에 쓰지 못했습니다.\nku:دانانی زانیاری پاشکۆی فایل سەرکەوتو نەبوو لە ڕیگستریدا\nlv:Neizdevās ierakstīt failu paplašinājumu informāciju reģistrā\nmk:Не успеав да ги запишам информациите за типови на датотеки во регистарот\nmy:Gagal menulis fail lanjutan maklumat tambahan ke dalam registry\nnl:Kan uitgebreide bestandsextensie-informatie niet wegschrijven in register\nnn:Mislykkast i å skrive den utvida filutvidingsinformasjonen til registeret\nno:Kan ikke lagre utvidet filtypeinformasjon i Registeret\npl:Nie można wprowadzić poszerzonych informacji o rozszerzeniu pliku do rejestru\npt:Falha ao escrever as informações do tipo de ficheiro nas chaves de registo\nro:Eroare la scrierea informatiei extinse despre extensia fisierului in registri\nru:Не удалось записать полную информацию о расширении файла в реестр\nsk:Zápis rozšírených informácií o prípone súboru do registrov bolo neúspešné\nsl:Pisanje v register informacij o razširjenem podaljšku datoteke ni uspelo\nsp-rs:Neuspeli upis proširene ekstenzije fajla u registri\nsq:Dështoi shkrimi në regjistër i informacionit të zgjeruar për skedën.\nsr-rs:Неуспео упис проширене екстензије фајла у регистри базу\nsv:Misslyckades med att spara registernycklar för den utökade filhanteringen\nta:பதிவு செய்ய விரிவாக்கப்பட்ட கோப்பு நீட்டிப்பு தகவலை எழுத முடியவில்லை\ntr:Kayıt defterine genişletimiş dosya uzantısı yazma başarısız oldu\ntw:寫入延遲檔案副檔名資訊到註冊項失敗。\nuk:Не вдалося записати інформацію про розширення файлу до реєстру\nuz:Fayl turi haqida kengaytirilgan ma'lumotini reyestrga yozish muvaffaqiyatsiz tugadi\nvn:Không thể ghi thông tin về phần mở rộng của tập tin vào khóa Registry\n:Failed to write the uninstallation information to the registry\nam:Ծրագիրը հեռացնելու մասին գրառումը չստացվեց Գրանցատեղիում\nar:فشل في كتابة معلومات الغاء التثبيت الى مكتب التسجيل\naz:Deinstalyasiya məlumatını reyestrə yazmaq mümkün olmadı\nbg:Информацията за премахването на програмата не може да се впише в регистъра.\nbr:Falha na gravação dos dados de desinstalação no registro\nbs:Neuspješno zapisivanje deinstalacijske informacije u registar\nca-xv:No es pot escriure la informació de desinstal·lació al registre\nca:No es pot escriure la informació de desinstal·lació al registre\ncn:写入卸载信息到注册项失败。\ncy:Methwyd ysgrifennu gwybodaeth y dadosodwr i'r gofrestrfa\ncz:Nepodařilo se zapsat odinslační záznamy do registru\nde:Konnte keine Deinstallations-Informationen in die Registry schreiben\ndk:Kunne ikke skrive afinstalleringsinformation i registreringsdatabasen\nel:Αποτυχία εγγραφής πληροφοριών απεγκαταστασης στο μητρώο\nes:Error al escribir información de desinstalación en el registro\net:Ei õnnestunud registrisse kirjutada eemaldamise informatsiooni\neu:Hutsegitea kentze argibideak erregistroan idazterakoan\nfa:ثبت اطلاعات فرآیند حذف در رجیستری ناموفق بود\nfi:Poistamistietojen kirjoittaminen rekisteriin epäonnistui\nfr:L'écriture des informations de désinstallation dans la base de registre a échoué\nga:Theip air an fhaisnéis díshuiteálaithe a scríobh chuig an chlárlann\ngl:Fallouse ao escribir a información de desintalación no rexistro\nhe:כתיבת נתוני הסרת התוכנה ברישום נכשלה.\nhr:Neuspjeh kod zapisivanja deinstalacijskih informacija u registar\nhu:Eltávolítással kapcsolatos információk rendszerleíró adatbázisba írása sikertelen\nid:Gagal menulis info penghapusan program ke registry\nit:Scrittura fallita informazione disinstallazione nel registro\nja:アンインストール情報をレジストリに書き込むのに失敗しました\nkr:제거 정보를 레지스트리에 쓰지 못했습니다.\nku:دانانی زانیاری سڕینەوە سەرکەوتو نەبوو لە ڕیگستریدا\nlv:Neizdevās ierakstīt atinstalēšanas informāciju reģistrā\nmk:Не успеав да ги запишам информациите за деинсталаторот во регистарот\nmy:Gagal untuk menulis maklumat pemasangan untuk registry\nnl:Kan deïnstallatie-informatie niet wegschrijven in het register\nnn:Mislykkast i å skrive avinstalleringsinformasjonen til registeret\nno:Kan ikke lagre avinstalleringsinformasjon i Registeret\npl:Nie można zapisać informacji o usunięciu programu do rejestru\npt:Falha ao escrever as informações de desinstalação no registo\nro:Eroare la scrierea informatiilor de dezinstalare in registri\nru:Не удалось записать информацию для деинсталлятора в реестр\nsk:Uloženie informácií pre odinštalovanie do registrov bolo neúspešné\nsl:Pisanje v register informacij o odstranitvi ni uspelo\nsp-rs:Neuspeli upis instalacionih informacija u registri\nsq:Dështoi shkrimi në regjistër i informacionit për çinstalimin\nsr-rs:Неуспео упис информација о деинсталацији у регистри базу\nsv:Missluckades spara data för avinstallation i registret\nta:நிறுவி நீக்கும் தகவலை பதிவில் எழுத முடியவில்லை\ntr:Kayıt defterine kaldırma bilgisi yazma işi başarısız oldu\ntw:寫入解除安裝資訊到註冊項目失敗。\nuk:Не вдалося записати інформацію для видалення у реєстр\nuz:Dasturni o'chirish ma'lumotini reyestrga yozish muvaffaqiyatsiz tugadi\nvn:Không thể ghi thông tin về việc gỡ cài đặt vào khóa Registry\n:Fast Web View\nam:Արագ վեբ դիտում\nar:عرض سريع على الويب\naz:Sürətli veb-görüntü\nbg:Бърз Web изглед\nbr:Visualização rápida na Web\nbs:Brzi web pregled\nca-xv:Visualització ràpida de web\nca:Visualització ràpida de web\ncn:快速网页查看\ncy:Golwg Gwe Cyflym\ncz:Rychlé zobrazování z webu\nde:Schnelle Webanzeige\ndk:Hurtig Internetvisning\nel:Γρήγορη διαδικτυακή προβολή\nes:Visualización rápida en Web\net:Kiire veebivaade\neu:Web Ikuspen Azkarra\nfa:نمایش بی‌درنگ\nfi:Nopea web-näkymä\nfr:Affichage Web rapide\nga:Gréasáin dearcadh go tapa\ngl:Vista web rápida\nhe:תצוגת רשת מהירה\nhi:तीव्र वेब दर्शन\nhr:Brzi Web prikaz\nhu:Gyors web-nézet\nid:Tampilan Web Cepat\nit:Vista web veloce\nja:高速ウェブ表示\nkr:빠른 웹 보기\nku:شێوازی پیشاندانی خێرای ماڵپەر\nlv:Ātrais tīmekļa skats\nmk:Брз веб-преглед\nmy:Paparan Web Cepat\nne:द्रुत वेब दृश्य\nnl:Snelle browserweergave\nnn:Rask nettvising\nno:Rask Nettvisning\npl:Szybkie wyświetlanie w Internecie\npt:Visualização rápida na web\nro:Vizualizare rapidă web\nru:Быстрый просмотр в Интернете\nsk:Rýchle zobrazovanie z internetu\nsl:Hiter spletni prikaz\nsp-rs:Brzi pregled na mreži\nsq:Hapet shpejt në internet\nsr-rs:Брзи преглед на мрежи\nsv:Snabb Webb-Visning\nta:வேகமான வலை பார்வை\ntr:Hızlı Web Görünümü\ntw:快速網頁模式\nuk:Швидкий веб перегляд\nuz:Tez veb ko'rish\nvn:Xem dạng Web nhanh\n:Favorites\nam:Ընտրյալներ\nar:المفضلة\naz:Seçilmişlər\nbg:Любими\nbr:Favoritos\nbs:Favoriti\nca-xv:Preferits\nca:Preferits\ncn:收藏夹\ncy:Ffefrynnau\ncz:Oblíbené položky\nde:Favoriten\ndk:Bogmærker\nel:Αγαπημένα\nes:Favoritos\net:Lemmikud\neu:Gogokoenak\nfa:علاقه‌مندی‌ها\nfi:suosikit\nfr:Favoris\nga:Ceanáin\ngl:Favoritos\nhe:מועדפים\nhi:पसंदीदा\nhr:Favoriti\nhu:Kedvencek\nid:Favorit\nit:Preferiti\nja:お気に入り\nka:რჩეულები\nkr:즐겨찾기\nku:پەسەندەکان\nlt:Parankiniai\nlv:Grāmatzīmes\nmk:Омилени\nml:പ്രിയപ്പെട്ടത്\nmy:Kegemaran\nne:मनपर्नेहरु\nnl:Favorieten\nnn:Favorittar\nno:Favoritter\npl:Ulubione\npt:Favoritos\nro:Favorite\nru:Избранное\nsi:ප්‍රියතමයන්\nsk:Obľúbené položky\nsl:Priljubljeni\nsp-rs:Odabir\nsq:Pëlqej\nsr-rs:Одабир\nsv:Favoriter\nta:பிடித்தவை\ntr:Sık kullanılanlar\ntw:最愛\nuk:Закладки\nuz:Tanlanganlar\nvn:Ưa thích\n:FictionBook documents\nam:FictionBook փաստաթղթեր\nar:وثائق كتاب الخيال\naz:FictionBook sənədləri\nbg:Документи FictionBook\nbr:Documentos FictionBook\nbs:FictionBook dokumenti\nca-xv:Documents FictionBook\nca:Documents FictionBook\ncn:小说文档\ncy:Dogfennau FictionBook\ncz:Dokumenty FictionBook\nde:FictionBook E-Bücher\ndk:FictionBook-dokumenter\nel:Έγγραφα FictionBook\nes:Documentos FictionBook\net:FictionBook-dokumendid\neu:FikzioLiburu agiriak\nfa:اسناد FictionBook\nfi:FictionBook-asiakirjat\nfr:Documents FictionBook\nga:Cáipéisí FictionBook\ngl:Documentos FictionBook\nhe:קובצי FictionBook\nhi:गल्प बुक दस्तावेजों\nhr:FictionBook dokumenti\nhu:FictionBook fájlok\nid:Dokumen FictionBook\nit:Documenti FictionBook\nja:フィクション文章\nka:FictionBook დოკუმენტები\nkr:FictionBook 문서\nku:FictionBook بەڵگەنامەکانی\nlv:FictionBook dokumenti\nmk:Документи на FictionBook\nmy:Dokumen FictionBook\nnl:FictionBookdocumenten\nnn:FictionBook-dokumentar\nno:FictionBook-dokumenter\npl:Dokumenty FictionBook\npt:Livros de ficção\nro:Documente SF (Carti de fictiune)\nru:Документы FictionBook\nsk:FictionBook dokumenty\nsl:FictionBook dokumenti\nsp-rs:FictionBook dokumenti\nsq:Dokumente FictionBook\nsr-rs:FictionBook докуменат\nsv:FictionBook dokument\nta:புனைவு புத்தக ஆவணம்\ntr:FictionBook belgeleri\ntw:FictionBook(fb2) 文件\nuk:Документи FictionBook\nuz:FictionBook hujjatlari\nvn:Tập tin FictionBook\n:File %s not found\nam:%s ֆայլը չի գտնվել\nar:الملف %s غير موجود\naz:Fayl %s tapılmadı\nbg:Файлът %s не е намерен\nbr:Arquivo %s não encontrado\nbs:Fajl %s nije pronađen\nca-xv:No s'ha trobat el fitxer %s\nca:No es troba el fitxer %s\ncn:无法找到文件 %s\ncy:Heb ganfod ffeil %s\ncz:Soubor %s nebyl nalezen\nde:Datei %s nicht gefunden\ndk:Filen %s blev ikke fundet\nel:Το αρχείο %s δε βρέθηκε\nes:No se encontró el archivo %s\net:Faili %s ei leitud\neu:%s agiria ez da aurkitu\nfa:پرونده %s پیدا نشد\nfi:Tiedosto %s ei löydy\nfr:Fichier %s non trouvé\nga:NÃor aimsÃodh an comhad %s\ngl:Ficheiro %s non atopado\nhe:הקובץ %s לא נמצא.\nhi:फ़ाइल %s नहीं मिली\nhr:Datoteka %s nije pronađena\nhu:Fájl %s nem található\nid:File %s tak ditemukan\nit:File %s non trovato\nja:ファイル %s が見つかりません\nka:%s ფაილი ვერ მოიძებნა\nkr:%s 파일을 찾을 수 없습니다.\nku:نەدۆزرایەوە %s فایلی\nlv:Fails %s nav atrasts\nmk:Датотеката %s не е најдена\nmy:Fail %s tidak dijumpai\nne:फाइल %s भेटिएन\nnl:Bestand %s niet gevonden\nnn:Filen %s blei ikkje funnet\nno:Filen %s finnes ikke\npl:Nie znaleziono pliku %s\npt:Ficheiro %s não encontrado\nro:Fisierul %s nu a fost gasit\nru:Файл %s не найден\nsk:Súbor %s nenájdený\nsl:Datoteka %s ni bila najdena\nsp-rs:Datoteka %s nije pronađena\nsq:Nuk gjen skedën %s\nsr-rs:Датотека %s није пронађена\nsv:Fil %s hittades inte\nta:%s கோப்பு கிடைக்கவில்லை\ntr:%s dosyası bulunamadı\ntw:找不到檔案 %s\nuk:Файл %s не знайдено\nuz:%s fayli topilmadi\nvn:Không tìm thấy tập tin %s\n:File Size:\nam:Ֆայլի չափը՝\nar:حجم الملف\naz:Faylın həcmi:\nbg:Големина на файла:\nbr:Tamanho do arquivo:\nbs:Veličina fajla:\nca-xv:Mida del fitxer:\nca:Mida del fitxer:\ncn:文件大小:\ncy:Maint Ffeil:\ncz:Velikost souboru:\nde:Dateigröße:\ndk:Filstørrelse:\nel:Μέγεθος αρχείου:\nes:Tamaño de archivo:\net:Faili suurus:\neu:Agiriaren neurria:\nfa:حجم پرونده:\nfi:Tiedoston koko:\nfr:Taille du fichier :\nfy-nl:Bestânsgrutte\nga:Méid an chomhaid:\ngl:Tamaño do ficheiro:\nhe:גודל הקובץ:\nhi:फ़ाइल का आकार:\nhr:Veličina datoteke:\nhu:Méret:\nid:Ukuran Berkas:\nit:Dimensione file:\nja:ファイルサイズ:\nka:ფაილის ზომა:\nkr:파일 크기:\nku:قەبارەی فایل:\nlt:Failo dydis:\nlv:Faila lielums:\nmk:Големина на датотека:\nml:ഫയല്‍ വലുപ്പം\nmy:Saiz fail:\nne:फाइल साइज\nnl:Bestandsgrootte\nnn:Filstørrelse:\nno:Filstørrelse:\npl:Rozmiar pliku:\npt:Tamanho do ficheiro:\nro:Mărime fișier:\nru:Размер файла:\nsi:ගොනුවේ විශාලත්වය:\nsk:Veľkosť súboru:\nsl:Velikost datoteke:\nsp-rs:Veličina:\nsq:Masa e skedës:\nsr-rs:Величина:\nsv:Filstorlek:\nta:கோப்பின் அளவு:\ntl:Laki ng file:\ntr:Dosya boyutu:\ntw:檔案大小:\nuk:Розмір файла:\nuz:Fayl hajmi:\nvn:Kích thước:\n:File:\nam:Ֆայլ՝\nar:ملف\naz:Fayl:\nbg:Файл:\nbr:Arquivo:\nbs:Fajl:\nca-xv:Fitxer:\nca:Fitxer:\ncn:文件:\ncy:Ffeil:\ncz:Soubor:\nde:Datei:\ndk:Fil:\nel:Αρχείο:\nes:Archivo:\net:Fail:\neu:Agiria:\nfa:پرونده:\nfi:Tiedosto:\nfr:Fichier :\nfy-nl:Bestân:\nga:Comhad:\ngl:Ficheiro:\nhe:קובץ:\nhi:फ़ाइल:\nhr:Datoteka:\nhu:Fájl:\nid:Berkas:\nit:File:\nja:ファイル:\nka:ფაილი:\nkr:파일:\nku:فایل:\nlt:Failas:\nlv:Fails:\nmk:Датотека:\nml:ഫയല്‍\nmy:Fail:\nne:फाइल:\nnl:Bestand:\nnn:Fil:\nno:Fil:\npl:Plik:\npt:Ficheiro:\nro:Fișier:\nru:Файл:\nsi:ගොනුව:\nsk:Súbor:\nsl:Datoteka:\nsn:Gwaro\nsp-rs:Datoteka:\nsq:Skeda:\nsr-rs:Датотека:\nsv:Fil:\nta:கோப்பு\ntl:File:\ntr:Dosya:\ntw:檔案(&F):\nuk:Файл:\nuz:Fayl:\nvn:Tập tin:\n:Fin&d...\\tCtrl+F\naf:Soek...\\tCtrl+F\nam:Փնտ&րել...\\tCtrl+F\nar:بح&ث...\\tCtrl+F\naz:A&xtar...\\tCtrl+F\nbg:&Търси...\\tCtrl+F\nbn:অনুসন্ধান...\\tCtrl+F\nbr:Localizar...\\tCtrl+F\nbs:Traži...\\tCtrl+F\nby:Знайсці...\\tCtrl+F\nca-xv:&Cerca...\\tCtrl+F\nca:&Cerca...\\tCtrl+F\ncn:查找(&D)...\\tCtrl+F\ncy:Canfod...\\tCtrl+F\ncz:Nají&t...\\tCtrl+F\nde:S&uchen…\\tStrg+F\ndk:Fin&d...\\tCtrl+F\nel:Εύ&ρεση...\\tCtrl+F\nes:Buscar...\\tCtrl+F\net:&Otsi...\\tCtrl+F\neu:&Bilatu...\\tKtrl+F\nfa:&جستجو...\\tCtrl+F\nfi:Ets&i...\\tCtrl+F\nfr:&Rechercher...\\tCtrl+F\nfy-nl:Sykje...\\tCtrl+F\nga:Aimsigh...\\tCtrl+F\ngl:Procura...\\tCtrl+F\nhe:חפש...\\tCtrl+F\nhi:खोज...\\tCtrl+F\nhr:Pronađi...\\tCtrl+F\nhu:Keresés...\\tCtrl+F\nid:Temukan...\\tCtrl+F\nit:Tro&va...\\t<Ctrl>+F\nja:検索(&D)...\\tCtrl+F\nka:&ძიება...\\tCtrl+F\nkr:찾기(&D)...\\tCtrl+F\nku:دۆ&زینەوە...\\tCtrl+F\nkw:Kavos...\\tCtrl+F\nlt:&Ieškoti...\\tCtrl+F\nlv:At&rast...\\tCtrl+F\nmk:Најди...\\tCtrl+F\nml:കണ്ടെത്തുക...\\tCtrl+F\nmm:ရှာပါ\\tCtrl+F\nmy:Cari...\\tCtrl+F\nne:&फेला पार्नुहोस् ...\\tCtrl+F\nnl:Zoeken...\\tCtrl+F\nnn:Finn...\\tCtrl+F\nno:Søk etter...\\tCtrl+F\npa:ਲੱਭੋ...\\tCtrl+F\npl:&Znajdź...\\tCtrl+F\npt:&Localizar...\\tCtrl+F\nro:Caută...\\tCtrl+F\nru:На&йти...\\tCtrl+F\nsi:සොයන්න... (F)\\tCtrl+F\nsk:H&ľadať...\\tCtrl+F\nsl:Naj&di …\\tCtrl+F\nsn:Wana...\\tCtrl+F\nsp-rs:Pronađi...\\tCtrl+F\nsq:G&jej...\\tCtrl+F\nsr-rs:Пронађи...\\tCtrl+F\nsv:Sök...\\tCtrl+F\nta:தேடு...\\tCtrl+F\ntl:Hanapin...\\tCtrl+F\ntr:&Bul...\\tCtrl+F\ntw:尋找(&F)...\\tCtrl+F\nuk:Знайти...\\tCtrl+F\nuz:&Qidirish...\\tCtrl+F\nvn:Tìm kiếm...\\tCtrl+F\n:Find\nam:Գտնել\nar:بحث\naz:Axtar\nbg:Търсене\nbr:Localizar\nbs:Traži\nby:Знайсці\nca-xv:Cerca\nca:Cerca\ncn:查找\ncy:Canfod\ncz:Najít\nde:Suchen\ndk:Find\nel:Εύρεση\nes:Buscar\net:Otsi\neu:Bilatu\nfa:جستجو\nfi:Etsi\nfr:Rechercher\nfy-nl:Sykje\nga:Aimsigh\ngl:Procurar\nhe:חפש\nhi:खोजें\nhr:Pronađi\nhu:Keresés\nid:Cari\nit:Trova\nja:検索\nka:ძიება\nkr:찾기\nku:دۆزینەوە\nkw:Kavos\nlt:Ieškoti\nlv:Atrast\nmk:Најди\nml:തിരയുക.\nmy:Cari\nne:खोज्नुहोस्\nnl:Zoeken\nnn:Finn\nno:Søk etter\npl:Znajdź\npt:Localizar\nro:Caută\nru:Поиск\nsi:සොයන්න (S)\nsk:Hľadať\nsl:Najdi\nsn:Tsvaga\nsp-rs:Pronađi\nsq:Gjej\nsr-rs:Пронађи\nsv:Sök\nta:தேடு\ntl:Hanapin\ntr:Bul\ntw:尋找\nuk:Знайти\nuz:Qidirish\nvn:Tìm kiếm\n:Find Next\naf:Soek Volgende\nam:Գտնել հաջորդը\nar:بحث عن التالي\naz:Sonrakını tap\nbg:Намиране на следващото съвпадение\nbn:পরবর্তী অনুসন্ধান\nbr:Localizar próximo\nbs:Nađi sljedeće\nby:Найти следующее\nca-xv:Cerca següent\nca:Cerca següent\ncn:向下查找\ncy:Canfod y Nesaf\ncz:Najít další\nde:Weitersuchen\ndk:Find næste\nel:Εύρεση επόμενου\nes:Buscar siguiente\net:Otsi järgmine\neu:Bilatu Hurrengoa\nfa:مورد بعدی را پیدا کن\nfi:Etsi seuraava\nfr:Occurrence suivante\nfy-nl:Folgjende\nga:Aimsigh Ar Aghaidh\ngl:Atopar seguinte\nhe:חפש הבא\nhi:अगला खोजें\nhr:Pronađi slijedeće\nhu:Következő keresése\nid:Temukan Selanjutnya\nit:Trova successivo\nja:次を検索\nka:შემდეგის პოვნა\nkr:다음 찾기\nku:دۆزینەوەی پێشتر\nkw:Kavos Nessa\nlt:Rasti kitą\nlv:Atrast nākamo\nmk:Најди следно\nml:അടുത്തത് കണ്ടെത്തുക\nmm:နောက်တခု ရှာပါ\nmy:Cari seterusnya\nne:अर्को खोज्नुहोस्\nnl:Volgende\nnn:Finn neste\nno:Neste\npa:ਅਗਲਾ ਲੱਭੋ\npl:Znajdź następny\npt:Localizar seguinte\nro:Caută înainte\nru:Найти следующее\nsi:ඉදිරියට සොයන්න\nsk:Hľadať ďalšie\nsl:Najdi naslednje\nsn:Wana pamberi\nsp-rs:Pronađi sledeće\nsq:Gjej përpara\nsr-rs:Пронађи следеће\nsv:Sök nästa\nta:அடுத்ததை தேடு\ntl:Hanapin ang Susunod\ntr:Sonrakini Bul\ntw:向下尋找\nuk:Знайти наступне\nuz:Keyingisini qidirish\nvn:Tìm xuống\n:Find Previous\naf:Soek Vorige\nam:Գտնել նախորդը\nar:البحث عن السابق\naz:Əvvəlkini tap\nbg:Намиране на предишното съвпадение\nbn:পূর্ববর্তী অনুসন্ধান\nbr:Localizar anterior\nbs:Nađi prethodno\nby:Знайсці папярэдняе\nca-xv:Cerca anterior\nca:Cerca anterior\ncn:向上查找\ncy:Canfod y Blaenorol\ncz:Najít předchozí\nde:Rückwärts suchen\ndk:Find forrige\nel:Εύρεση προηγούμενου\nes:Buscar anterior\net:Otsi eelmine\neu:Bilatu Aurrekoa\nfa:مورد قبلی را پیدا کن\nfi:Etsi edellinen\nfr:Occurrence précédente\nfy-nl:Foarige\nga:Aimsigh Roimhe\ngl:Atopar anterior\nhe:חפש הקודם\nhi:पुराना खोजें\nhr:Pronađi prethodno\nhu:Előző keresése\nid:Temukan Sebelumnya\nit:Trova precedente\nja:前を検索\nka:წინას პოვნა\nkr:이전 찾기\nku:دۆزینەوەی پێشوو\nkw:Kavos Kyns\nlt:Rasti ankstesnį\nlv:Atrast iepriekšējo\nmk:Најди претходно\nml: മുന്‍പുള്ളത് കണ്ടെത്തുക\nmm:ပြီးခဲ့တာ ရှာပါ\nmy:Cari sebelumnya\nne:अघिल्लो खोज्नुहोस्\nnl:Vorige\nnn:Finn førre\nno:Forrige\npa:ਪਿਛਲਾ ਲੱਭੋ\npl:Znajdź poprzedni\npt:Localizar anterior\nro:Caută înapoi\nru:Найти предыдущее\nsi:පසුපසට සොයන්න\nsk:Hľadať predchádzajúce\nsl:Najdi prejšnje\nsn:Wana pashure\nsp-rs:Pronađi prethodno\nsq:Gjej prapa\nsr-rs:Пронађи претходно\nsv:Sök föregående\nta:முந்தையதை தேடு\ntl:Hanapin ang Nauna\ntr:Öncekini bul\ntw:向上尋找\nuk:Знайти попереднє\nuz:Oldingisini qidirish\nvn:Tìm lên\n:Find:\naf:Soek:\nam:Գտնել.\nar:بحث\naz:Axtar:\nbg:Търсене:\nbn:অনুসন্ধান:\nbr:Localizar:\nbs:Traži:\nby:Знайсці:\nca-xv:Cerca:\nca:Cerca:\ncn:查找:\ncy:Canfod:\ncz:Najít:\nde:Suchen:\ndk:Find:\nel:Εύρεση:\nes:Buscar:\net:Otsing:\neu:Bilatu:\nfa:جستجو:\nfi:Etsi:\nfr:Rechercher :\nfy-nl:Sykje:\nga:Aimsigh:\ngl:Procura:\nhe:חפש:\nhi:खोज:\nhr:Pronađi:\nhu:Keresés:\nid:Temukan:\nit:Trova:\nja:検索:\nka:ძიება:\nkr:찾기:\nku:دۆزینەوە:\nkw:Kavos:\nlt:Ieškoti:\nlv:Atrast:\nmk:Најди:\nml:കണ്ടെത്തുക:\nmm:ရှာပါ\nmy:Cari:\nne:खोज्नुहोस्:\nnl:Zoeken:\nnn:Finn\nno:Søk etter:\npa:ਲੱਭੋ:\npl:Znajdź:\npt:Localizar:\nro:Caută:\nru:Найти:\nsi:සොයන්න (S):\nsk:Hľadať:\nsl:Najdi:\nsn:Wana:\nsp-rs:Pronađi:\nsq:Gjej:\nsr-rs:Пронађи:\nsv:Sök:\nta:தேடு:\ntl:Hanapin:\ntr:Bul:\ntw:尋找(&F):\nuk:Знайти:\nuz:Qidirish:\nvn:Tìm kiếm:\n:Fit &Content\\tCtrl+3\nam:Հարմարեցնել &բովանդակությունը\\tCtrl+3\nar:ملائمة المحتوى  \\tCtrl+3\naz:&Məzmuna görə sığışdır\\tCtrl+3\nbg:Оразмеряване по &съдържание\\tCtrl+3\nbr:Ajustar ao &conteúdo\\tCtrl+3\nbs:Uklopi s&adržaj\\tCtrl+3\nca-xv:Ajusta el &contingut\\tCtrl+3\nca:Ajusta el &contingut\\tCtrl+3\ncn:适合内容(&C)\\tCtrl+3\ncy:Ffitio'r &Cynnwys\\tCtrl+3\ncz:Přizpůsobit &obsah\\tCtrl+3\nde:An &Inhalt anpassen\\tStrg+3\ndk:Tilpas &indhold\\tCrtl-3\nel:&Προσαρμογή στα περιεχόμενα\\tCtrl+3\nes:Ajustar a &contenido\\tCtrl+3\net:&Sisu sobitamine\\tCtrl+3\neu:Finkatu &Edukia\\tKtrl+3\nfa:متناسب کردن با &محتویات\\tCtrl+3\nfi:&Sovita sisältö\\tCtrl+3\nfr:&Ajuster au contenu\\tCtrl+3\nga:Oiriúnaigh an t-inneachar\\tCtrl+3\ngl:Axustar &contido\\tCtrl+3\nhe:התאם לתוכן\\tCtrl+3\nhi:सामग्री को फ़िट करें \\tCtrl+3\nhr:Namjesti po &sadržaju\\tCtrl+3\nhu:&Tartalom\\tCtrl+3\nid:Sesuaikan Dengan &Konten\\tCtrl+3\nit:Adatta al &contenuto\\t<Ctrl>+3\nja:内容に合わせる(&C)\\tCtrl+3\nka:&შიგთავსის მიხედვით\\tCtrl+3\nkr:내용에 맞춤(&C)\\tCtrl+3\nku:گونجاندنی &پێکهاتە\\tCtrl+3\nlt:Visas puslapio &turinys\\tCtrl+3\nlv:Ietilpināt &saturu\\tCtrl+3\nmk:Прилагоди на &содржина\\tCtrl+3\nmy:Fit &Kandungan\\tCtrl +3\nne:&सामग्री अटाउनुहोस्\\tCtrl+3\nnl:Passend maken\\tCtrl+3\nnn:Tilpass &innhald\\tCtrl+3\nno:Tilpass &innhold\\tCtrl+3\npl:Dopasuj do &zawartości\\tCtrl+3\npt:Ajustar ao &conteúdo\\tCtrl+3\nro:Potrivire după conținut\\tCtrl+3\nru:По содер&жимому\\tCtrl+3\nsi:නිසිලෙස &අන්තර්ගතය සකසන්න\\tCtrl+3\nsk:Prispôsobiť &obsah\\tCtrl+3\nsl:&Prilagodi vsebino\\tCtrl+3\nsp-rs:Podesi prema sadržaju\\tCtrl+3\nsq:Përshtat &materialin\\tCtrl+3\nsr-rs:Подеси према садржају\\tCtrl+3\nsv:Passa &innehåll\\tCtrl+3\nta:பொருத்தம் & உள்ளடக்கம்\\tCtrl+3\ntl:Pagkasyahin ang laman\\tCtrl+3\ntr:&İçeriğe ölçekle\\tCtrl+3\ntw:符合內容(&C)\\tCtrl+3\nuk:Розмістити вміст \\tCtrl+3\nuz:&Tarkibiga moslash\\tCtrl+3\nvn:Vừa nội dung\\tCtrl+3\n:Fit &Page\\tCtrl+0\naf:&Pas Blad In\\tCtrl+0\nam:Էջի &չափով\\tCtrl+0\nar:ملائمة &الصفحة \\tCtrl+0\naz:&Səhifəyə görə sığışdır\\tCtrl+0\nbg:Оразмеряване по &височина\\tCtrl+0\nbn:পৃষ্ঠা অনুরূপ\\tCtrl+0\nbr:&Página inteira\\tCtrl+0\nbs:Uklopi &stranicu\\tCtrl+0\nby:Змясціць старонку\\tCtrl+0\nca-xv:Ajusta a la &pàgina\\tCtrl+0\nca:Ajusta a la &pàgina\\tCtrl+0\ncn:适合页面(&P)\\tCtrl+0\ncy:&Ffitio'r Dudalen\\tCtrl+0\ncz:Podle &stránky\\tCtrl+0\nde:An &Seite anpassen\\tStrg+0\ndk:Tilpas &side\\tCtrl+0\nel:&Προσαρμογή στη σελίδα\\tCtrl+0\nes:Ajustar a &página\\tCtrl+0\net:Lehekülje &kõrguse sobitamine\\tCtrl+0\neu:&Finkatu Orrialdea\\tKtrl+O\nfa:به &بزرگی پنجره\\tCtrl+0\nfi:Sovita sivu &pystysuunnassa\\tCtrl+0\nfr:&Page entière\\tCtrl+0\nfy-nl:Folsleine &side\\tCtrl+0\nga:Oiriúnaigh don Lch\\tCtrl+0\ngl:&Páxina enteira\\tCtrl+0\nhe:התאם לעמוד\\tCtrl+0\nhi:अनुरूप करें(&P)\\tCtrl+0\nhr:Prilagodi &stranici\\tCtrl+0\nhu:&Teljes oldal\\tCtrl+0\nid:Sesuaikan Dengan &Halaman\\tCtrl+0\nit:&Pagina intera\\t<Ctrl>+0\nja:ページに合わせる(&P)\\tCtrl+0\nka:&გვერდის ზომაზე მორგება\\tCtrl+0\nkr:페이지(세로) 맞춤(&P)\\tCtrl+0\nku:گونجاندنی &پەڕە\\tCtrl+0\nkw:Desedha &Folen\\tCtrl+0\nlt:Visas &puslapis\\tCtrl+0\nlv:Ietilpināt &lappusi\\tCtrl+0\nmk:Прилагоди на &страница\\tCtrl+0\nml:വലിപ്പം പൊരുത്തപ്പെടുത്തുക\\tCtrl+0\nmm:စာမျက်နှာ ပြည့်\\tCtrl+O\nmy:&Muatkan mukasurat\\tCtrl+0\nne:&पृष्ठ अटाउनुहोस्\\tCtrl+0\nnl:Hele &pagina\\tCtrl+0\nnn:Tilpass &side\\tCtrl+0\nno:Tilpass &side\\tCtrl+0\npa:ਫਿਟ ਕਰੋ(&P)\\tCtrl+0\npl:Dopasuj do s&trony\\tCtrl+0\npt:&Ajustar à página\\tCtrl+0\nro:&Pagină întreagă\\tCtrl+0\nru:По &размеру страницы\\tCtrl+0\nsi:නිසිලෙස &පිටුව සකසන්න\\tCtrl+0\nsk:P&rispôsobiť strane\\tCtrl+0\nsl:&Prilagodi stran\\tCtrl+0\nsn:Kwanisa &Peji\\tCtrl+0\nsp-rs:Podesi prema stranici\\tCtrl+0\nsq:Përshtat &faqen\\tCtrl+0\nsr-rs:Подеси према страници\\tCtrl+0\nsv:Anpassa efter &helsida\\tCtrl+0\nta:பக்கம் பொருந்தவை\\tCtrl+0\nth:พอดีหน้า\\tCtrl+0\ntl:Ipagkasya ang &Pahina\\tCtrl+0\ntr:&Sayfaya sığdır\\tCtrl+0\ntw:符合頁面(&P)\\tCtrl+0\nuk:Припа&сувати сторінку\\tCtrl+0\nuz:&Betga moslash\\tCtrl+0\nvn:Vừa &trang\\tCtrl+0\n:Fit &Width\\tCtrl+2\naf:Pas In Breedte\\tCtrl+2\nam:Հավասարեցնել &լայնությամբ\\tCtrl+2\nar:ملائمة &العرض \\tCtrl+2\naz:&Genişliyə görə sığışdır\\tCtrl+2\nbg:Оразмеряване по &ширина\\tCtrl+2\nbn:প্রস্থ অনুরূপ\\tCtrl+2\nbr:Ajustar pela l&argura\\tCtrl+2\nbs:&Uklopi po širini\\tCtrl+2\nby:Змясціць па шырыне\nca-xv:Ajusta a l'am&plada\\tCtrl+2\nca:Ajusta a l'am&plada\\tCtrl+2\ncn:适合宽度(&W)\\tCtrl+2\ncy:&Fitio'r Lled\\tCtrl+2\ncz:&Podle šířky\\tCtrl+2\nde:An &Breite anpassen\\tStrg+2\ndk:Tilpas &bredde\\tCtrl+2\nel:&Προσαρμογή στο πλάτος παραθύρου\\tCtrl+2\nes:Ajustar a a&nchura\\tCtrl+2\net:Lehekülje &laiuse sobitamine\\tCtrl+2\neu:Finkatu &Zabalera\\tKtrl+2\nfa:به بزرگی &پهنای پنجره\\tCtrl+2\nfi:Sovita sivu &vaakasuunnassa\\tCtrl+2\nfr:Pleine &largeur\\tCtrl+2\nfy-nl:Passend yn &breedte\\tCtrl+2\nga:Oiriúnaigh don Leithead\\tCtrl+2\ngl:Axustar ao ancho\\tCtrl+2\nhe:התאם לרוחב\\tCtrl+2\nhi:चौड़ाई के अनुसार(&h)\\tCtrl+2\nhr:&Namjesti po širini\\tCtrl+2\nhu:Oldal&szélesség\\tCtrl+2\nid:Sesuaikan Dengan &Lebar\\tCtrl+2\nit:Adatta alla &larghezza della pagina\\t<Ctrl>+2\nja:幅に合わせる(&W)\\tCtrl+2\nka:&სიგანეზე მორგება\\tCtrl+2\nkr:너비(가로) 맞춤(&H)\\tCtrl+2\nku:گونجاندنی &فراوانی\\tCtrl+2\nkw:&Desedha Les\\tCtrl+2\nlt:Visas puslapio pl&otis\\tCtrl+2\nlv:Ietilpināt &platumu\\tCtrl+2\\n\nmk:Прилагоди на &ширина\\tCtrl+2\nml:അകലം പൊരുത്തപ്പെടുത്തുക\\tCtrl+2\nmm:အလျားနှင့်အမြင့် အပြည့်\nmy:&Muatkan lebar\\tCtrl+2\nne:&चौडाइ अटाउनुहोस्\\tCtrl+2\nnl:Passend in &breedte\\tCtrl+2\nnn:Tilpass &breidde\\tCtrl+2\nno:Tilpass til bredd&e\\tCtrl+2\npa:ਚੋੜਾਈ ਦੇ ਮੁਤਾਬਕ(&h)\\tCtrl+2\npl:Dopasuj do sz&erokości\\tCtrl+2\npt:Ajustar à &largura\\tCtrl+2\nro:Potrivire după lățime pagină\\tCtrl+2\nru:По &ширине\\tCtrl+2\nsi:නිසිලෙස &පළල සකසන්න\\tCtrl+2\nsk:N&a šírku obrazovky\\tCtrl+2\nsl:P&rilagodi po širini\\tCtrl+2\nsn:Kwanisa hupamhu\\tCtrl+2\nsp-rs:Podesi prema širini\\tCtrl+2\nsq:Përshtat &gjerësinë\\tCtrl+2\nsr-rs:Подеси према ширини\\tCtrl+2\nsv:Anpassa efter &bredd\\tCtrl+2\nta:அகலம் பொருந்தவை\\tCtrl+2\nth:พอดีความกว้าง\\tCtrl+2\ntl:&Ipagkasya ang Lapad\\tCtrl+2\ntr:&Genişliğe sığdır\\tCtrl+2\ntw:符合寬度(&H)\\tCtrl+2\nuk:Припасувати до &ширини\\tCtrl+2\nuz:&Eniga moslash\\tCtrl+2\nvn:Vừa chiều &rộng\\tCtrl+2\n:Fit Content\nam:Հարմարեցնել բովանդակությունը\nar:ملائمة المحتوى\naz:Məzmuna görə sığışdır\nbg:Оразмеряване по съдържание\nbr:Ajustar ao conteúdo\nbs:Uklopi sadržaj\nca-xv:Ajusta el contingut\nca:Ajusta el contingut\ncn:适合内容\ncy:Ffitio'r Cynnwys\ncz:Přizpůsobit obsah\nde:An Inhalt anpassen\ndk:Tilpas indhold\nel:Προσαρμογή στα περιεχόμενα\nes:Ajustar a contenido\net:Sisu sobitamine\neu:Finkatu Edukia\nfa:متناسب کردن با محتویات\nfi:Sovita sisältö\nfr:Ajuster au contenu\nga:Oiriúnaigh an t-inneachar\ngl:Axustar contido\nhe:התאם לתוכן\nhi:सामग्री को अटाना\nhr:Namjesti po sadržaju\nhu:Tartalom\nid:Sesuaikan Dengan Konten\nit:Adatta al contenuto\nja:内容に合わせる\nka:შიგთავსის მიხედვით\nkr:내용에 맞춤\nku:گونجاندنی پێکهاتە\nlt:Visas puslapio turinys\nlv:Ietilpināt saturu\nmk:Прилагоди на содржина\nmy:Muatkan Kandungan\nne:सामग्री अटाउनुहोस्\nnl:Passend maken\nnn:Tilpass innhald\nno:Tilpass innhold\npl:Dopasuj do zawartości strony\npt:Ajustar ao conteúdo\nro:Potrivire după conținut\nru:По содержимому\nsi:නිසිලෙස අන්තර්ගතය සකසන්න\nsk:Prispôsobiť obsah\nsl:Prilagodi vsebino\nsp-rs:Podesi prema sadržaju\nsq:Përshtat materialin\nsr-rs:Подеси према садржају\nsv:Passa innehåll\nta:உள்ளடக்கம் பொருந்துக\ntl:Pagkasyahin ang laman\ntr:İçeriğe ölçekle\ntw:合適內容(&T)\nuk:Розмістити вміст\nuz:Tarkibiga moslash\nvn:Vừa nội dung\n:Fit Page\naf:Pas Blad In\nam:Ձգել էջը\nar:ملائمة الصفحة\naz:Səhifəyə görə sığışdır\nbg:Оразмеряване по височина\nbn:পৃষ্ঠা অনুরূপ\nbr:Página inteira\nbs:Uklopi stranicu\nby:Змясціць старонку\nca-xv:Ajusta a la pàgina\nca:Ajusta a la pàgina\ncn:适合页面\ncy:Ffitio'r Dudalen\ncz:Podle stránky\nde:An Seite anpassen\ndk:Tilpas side\nel:Ολόκληρη σελίδα\nes:Ajustar a página\net:Lehekülje kõrguse sobitamine\neu:Finkatu Orrialdea\nfa:به بزرگی پنجره\nfi:Sovita sivu pystysuunnassa\nfr:Page entière\nfy-nl:Folsleine side\nga:Oiriúnaigh don Lch\ngl:Páxina enteira\nhe:התאם לעמוד\nhi:अनुरूप करें\nhr:Prilagodi stranici\nhu:Teljes oldal\nid:Sesuaikan Dengan Halaman\nit:Adatta alla pagina\nja:ページに合わせる\nka:გვერდის ზომაზე მორგება\nkr:페이지(세로) 맞춤\nku:گونجاندنی پەڕە\nkw:Desedha Folen\nlt:Visas puslapis\nlv:Ietilpināt lappusi\nmk:Прилагоди на страница\nml:താളില്‍ ഉള്‍ക്കൊള്ളിക്കുക\nmm:စာမျက်နှာ ပြည့်\nmy:Muatkan mukasurat\nne:पृष्ठ अटाउनुहोस्\nnl:Hele pagina\nnn:Tilpass side\nno:Tilpass side\npa:ਫਿਟ ਕਰੋ\npl:Dopasuj do całej strony\npt:Ajustar à página\nro:Pagină întreagă\nru:По размеру страницы\nsi:නිසිලෙස පිටුව සකසන්න\nsk:Prispôsobiť strane\nsl:Prilagodi stran\nsn:Kwanisa Peji\nsp-rs:Podesi prema stranici\nsq:Përshtat faqen\nsr-rs:Подеси према страници\nsv:Anpassa efter helsida\nta:பக்கம் பொருந்தவை\nth:พอดีหน้า\ntl:Ipagkasya ang Pahina\ntr:Sayfaya sığdır\ntw:符合頁面(&P)\nuk:Припасувати сторінку\nuz:Betga moslash\nvn:Vừa trang\n:Fit Width\naf:Pas In Breedte\nam:Ձգել լայնությամբ\nar:ملائمة العرض \naz:Genişliyə görə sığışdır\nbg:Оразмери по ширина\nbn:প্রস্থ অনুরূপ\nbr:Ajustar pela largura\nbs:Uklopi po širini\nby:Змясціць па шырыне\nca-xv:Ajusta a l'amplada\nca:Ajusta a l'amplada\ncn:适合宽度\ncy:Fitio'r Lled\ncz:Podle šířky\nde:An Breite anpassen\ndk:Tilpas bredde\nel:Πλάτος παραθύρου\nes:Ajustar a ancho de página\net:Lehekülje laiuse sobitamine\neu:Finkatu Zabalera\nfa:به بزرگی پهنای پنجره\nfi:Sovita sivu vaakasuunnassa\nfr:Pleine largeur\nfy-nl:Passend yn breedte\nga:Oiriúnaigh don Leithead\ngl:Axustar ao ancho\nhe:התאם לרוחב\nhi:चौड़ाई के अनुसार\nhr:Namjesti po širini\nhu:Oldalszélesség\nid:Sesuaikan Dengan Lebar\nit:Adatta alla larghezza della pagina\nja:幅に合わせる\nka:სიგანეზე მორგება\nkr:너비(가로) 맞춤\nku:گونجاندنی فراوانی\nkw:Desedha Les\nlt:Visas puslapio plotis\nlv:Ietilpināt platumu\nmk:Прилагоди на ширина\nml:അകലം പൊരുത്തപ്പെടുത്തുക\nmm:အလျားနှင့်အမြင့် အပြည့်\nmy:Muatkan lebar\nne:चौडाइ अटाउनुहोस्\nnl:Passend in breedte\nnn:Tilpass breidde\nno:Tilpass til bredde\npa:ਚੋੜਾਈ ਦੇ ਮੁਤਾਬਕ\npl:Dopasuj szerokości strony\npt:Ajustar à largura\nro:Potrivire după lățime pagină\nru:По ширине\nsi:නිසිලෙස පළල සකසන්න\nsk:Na šírku obrazovky\nsl:Prilagodi po širini\nsn:Kwanisa hupamhu\nsp-rs:Podesi prema širini\nsq:Përshtat gjerësinë\nsr-rs:Подеси према ширини\nsv:Anpassa efter bredd\nta:அகலத்திற்கு பொருத்து\nth:พอดีความกว้าง\ntl:Ipagkasya ang Lapad\ntr:Genişliğe sığdır\ntw:合適寬度\nuk:Припасувати до ширини\nuz:Eniga moslash\nvn:Vừa chiều rộng\n:Fit Width and Show Pages Continuously\nam:Ձգել լայնությամբ և ցուցադրել էջերը անդադար\nar:ملائمة العرض واظهار الصفحات باستمرار\naz:Səhifənin genişliyinə görə sığışdır və səhifələri ardıcıl göstər\nbg:Оразмери по широчина и покажи страниците непрекъснато\nbr:Ajustar pela largura e exibir páginas de modo contínuo\nbs:Uklopi po širini i prikaži stranice slijedno\nca-xv:Ajusta l'amplada i mostra les pàgines de forma contínua\nca:Ajusta l'amplada i mostra les pàgines de forma contínua\ncn:自适应宽度连续模式\ncy:Ffitio'r Lled a Dangos Tudalennau'n Barhaus\ncz:Přizpůsobit šířce okna a zobrazit stránky průběžně\nde:An Breite anpassen und Seiten fortlaufend anzeigen\ndk:Tilpas bredde og vis sider løbende\nel:Προσαρμογή πλάτους και εμφάνιση σελίδων συνεχόμενα\nes:Ajustar al ancho de página y mostrar las páginas de forma continua\net:Sobita lehekülje laius ja näita jätkuvana\neu:Finkatu Zabalera eta Erakutsi Orrialdeak Jarraian\nfa:صفحات را به بزرگی پهنای پنجره و به صورت پیوسته نمایش بده\nfi:Sovita leveys ja näytä sivut peräkkäin\nfr:Pleine largeur, vue continue\nga:Oiriúnaigh don leithead & taispeáin leathanaigh go leanúnach\ngl:Axustar ancho e amosar páxinas seguidas\nhe:התאם לרוחב והצג עמודים ברציפות\nhi:उपयुक्त चौड़ाई के साथ पृष्ठ लगातार दिखाएँ\nhr:Namjesti po širini i prikaži stranice slijedno\nhu:Oldalszélességhez igazítás + folyamatos nézet\nid:Sesuaikan Lebar Dan Tampilkan Halaman Secara Kontinu\nit:Adatta alla larghezza e visualizza le pagine in modo continuo\nja:幅に合わせて連続してページを表示する\nka:ფანჯრის სიგანეზე მორგება და გვერდების შეუწყვეტლივ ჩვენება\nkr:지속적인 너비 맞춤과 페이지 보기\nku:گونجاندنی فراوانی و پیشاندانی پەڕەکان بە بەردەوامی\nlt:Visas puslapio plotis, nenutrūkstama peržiūra\nlv:Ietilpināt platumu un rādīt lappuses nepārtraukti\nmk:Прилагоди на широчина и прикажи страници непрекинато\nmy:Muatkan Lebar dan Paparkan Halaman Berterusan\nne:चौडाई अटाउनुहोस् र पृष्ठहरु निरन्तर देखाउनुहोस्\nnl:Passend in breedte en pagina's doorlopend\nnn:Tilpass bredde og vis sider kontinuerleg\nno:Tilpass bredde og vis sider kontinuerlig\npl:Dopasuj szerokość i wyświetlaj strony w układzie ciągłym\npt:Ajustar largura e mostrar páginas contínuas\nro:Potrivire după lățime și afișare continuă a paginilor\nru:Подогнать по ширине окна и разрешить прокрутку\nsi:අඛණ්ඩව නිසිලෙස පළල සකසමින් පිටු පෙන්වන්න\nsk:Prispôsobiť šírke okna\nsl:Prilagodi po širini in prikaži strani nepretrgano\nsp-rs:Podesi prema širini i prikaži stranice bez prekida\nsq:Përshtat gjerësinë dhe tregoj faqet në vazhdimësi\nsr-rs:Подеси према ширини и прикажи странице без прекида\nsv:Anpassa bredd och visa sidor fortlöpande\nta:அகலம் பொருத்தி பக்கங்கள் காட்டுக\ntl:Pagkasyahin ang lapad at ipakita nang tuluy-tuloy ang mga pahina\ntr:Genişliğe ölçekle ve sayfaları devamlı göster\ntw:符合寬度且連續顯示頁面\nuk:Розмістити по ширині на безперервній сторінці\nuz:Eniga moslash va uzluksiz\nvn:Vừa chiều rộng và Xem trang liên tiếp\n:Fit a Single Page\nam:Ձգել մեկ էջի չափով\nar:ملائمة صفحة مفردة\naz:Tək səhifəyə sığışdır\nbg:Оразмери една страница\nbr:Ajustar em uma única página\nbs:Uklopi jednu stranicu\nca-xv:Ajusta a una única pàgina\nca:Ajusta a una única pàgina\ncn:自适应单页模式\ncy:Ffitio Tudalen Unigol\ncz:Přizpůsobit pro jednu celou stránku v okně\nde:An eine einzelne Seite anpassen\ndk:Vis en side ad gangen\nel:Προσαρμογή μιας σελίδας\nes:Ajustar a una sola página\net:Sobita üksik lehekülg\neu:Finkatu Orrialde Bakar bat\nfa:متناسب کردن یک صفحه\nfi:Sovita yksittäinen sivu\nfr:Page unique\nga:Oiriúnaigh leathanach amháin\ngl:Axustar a páxina única\nhe:התאם לעמוד יחיד\nhi:एकल पृष्ठ को फ़िट करें\nhr:Namjesti po jednoj stranici\nhu:Teljes oldalankénti nézet\nid:Sesuaikan Halaman Tunggal\nit:Visualizza una pagina singola\nja:単一のページに合わせる\nka:გვერდის მორგება ფანჯრის ზომაზე\nkr:한 페이지 맞춤\nku:گونجاندنی یەک پەڕە\nlt:Visas puslapis\nlv:Ietilpināt vienā lappusē\nmk:Прилагоди на поединечна страница\nml:ഒരൊറ്റ താള്‍ ഉള്‍ക്കൊള്ളിക്കുക\nmy:Muatkan Halaman Tunggal\nne:एकल पृष्ठ अटाउनुहोस्\nnl:Hele pagina passend maken\nnn:Tilpass ein enkel side\nno:Tilpass til enkeltside\npl:Dopasuj pojedynczą stronę\npt:Ajustar a uma página\nro:Potrivire pentru o singură pagină\nru:Подогнать страницу по размеру окна\nsi:තනි පිටුවට සකසන්න\nsk:Prispôsobiť a zobraziť celú stranu v okne\nsl:Prilagodi enostransko\nsp-rs:Podesi prema pojedinačnoj stranici\nsq:Përshtat në njëfletësh\nsr-rs:Подеси према појединачној страници\nsv:Anpassa till helsida\nta:ஒற்றை பக்கம் பொருந்துக\ntl:Pagkasyahin ang isang pahina\ntr:Tek sayfaya ölçekle\ntw:符合單頁\nuk:Вмістити на сторінку\nuz:Bitta betga moslash\nvn:Vừa một trang đơn\n:Fonts:\nam:Տառատեսաներ.\nar:الخطوط:\naz:Fontlar:\nbg:Шрифтове:\nbr:Fontes:\nbs:Fontovi:\nca-xv:Tipus de lletra:\nca:Tipus de lletra:\ncn:字体(&F):\ncy:Ffontiau:\ncz:Písma:\nde:Schriftarten:\ndk:Skrifttyper:\nel:Γραμματοσειρές:\nes:Fuentes:\net:Fondid:\neu:Hizi-motak:\nfa:قلم‌ها:\nfi:Fontit:\nfr:Polices :\nga:Clófhoirne:\ngl:Tipos de letra:\nhe:גופנים:\nhi:अक्षर का आकर\nhr:Fontovi:\nhu:Betűk:\nid:Huruf:\nit:Font:\nja:フォント:\nka:შრიფტები\nkr:글꼴:\nku:فۆنت:\nlv:Fonti:\nmk:Букви:\nml:ലിപികള്‍\nmy:Fon:\nne:फन्टहरू:\nnl:Lettertypen:\nnn:Fontar:\nno:Skrifter:\npl:Czcionki:\npt:Tipo de letra:\nro:Fonturi:\nru:Шрифты:\nsi:අකුරුවර්ගය\nsk:Písma:\nsl:Pisave:\nsp-rs:Fontovi:\nsq:Fonte:\nsr-rs:Фонтови:\nsv:Typsnitt:\nta:எழுத்துரு:\ntr:Yazı Tipleri:\ntw:字型(&F):\nuk:Шрифти\nuz:Shriftlar:\nvn:Font chữ\n:Formatting the book... %d pages\nam:Գրքի կազմորոշում... %d էջ\nar:تهيئة الكتاب... %d صفحة\naz:Kitab formatlanır... %d səh.\nbg:Форматиране на книгата... %d страници\nbr:Formatando o livro... %d páginas\nbs:Formatiranje knjige... %d stranica\nca-xv:S'està formatant el llibre... %d pàgines\nca:S'està formatant el llibre... %d pàgines\ncn:正在为书籍排版格式... %d 页\ncy:Fformatio'r llyfr... %d tudalen\ncz:Formátování knihy... %d stránek\nde:Buch wird formatiert… Seite %d\ndk:Formaterer bogen ... %d sider\nel:Διαμόρφωση του βιβλίου... %d σελίδες\nes:Dando formato al libro... %d páginas\net:Raamatu vormindamine... %d lehekülge\neu:Liburua formateatzen... %d orrialde\nfa:قالب‌بندی کتاب... %d صفحه\nfi:Muotoillaan kirjaa... %d sivua\nfr:Mise en forme du livre... %d pages\nga:Ag formáidiú an leabhair... %d leathanach\ngl:Dándolle formato ao libro... %d páxinas\nhe:מעצב את הספר... %d עמודים\nhi:किताब स्वरूपित हो रहा... %d पृष्ठ\nhr:Oblikovanje knjige... %d stranica\nhu:Könyv formázása... %d oldal\nid:Memformat buku... %d halaman\nit:Formattazione del libro ... %d pagine\nja:製本中… %d ページ\nkr:%d 페이지 읽어들이는 중...\nku:پەڕە %d  فۆڕماتکردنی پەڕەکانی پەرتووک ...\nlv:Grāmatas formatēšana... %d lappuses\nmk:Ја форматирам книгата... %d страници\nmy:Format buku ... %d halaman\nne:पुस्तक स्वरूपण ... %d पृष्ठहरु\nnl:Boek samenstellen... %d paginas\nnn:Formatterer boka... %d sider\nno:Formater bok... %d sidene\npl:Formatowanie książki... %d stron\npt:A formatar livro... %d páginas\nro:Formatează cartea... %d pagini\nru:Форматирование книги... %d стр.\nsk:Formátovanie knihy... %d stránok\nsl:Oblikovanje knjige … %d strani\nsp-rs:Formatiranje knjige... %d stranica\nsq:Formaton librin... %d faqe\nsr-rs:Форматирање књиге... %d страница\nsv:Formatterar bok... %d sidor\nta:புத்தகத்தை வடிவமைக்க ... %d பக்கங்கள்\ntr:Kitap biçimlendiriliyor... %d sayfa\ntw:正在格式化書本... %d 頁\nuk:Форматується книга... %d сторінок\nuz:Kitob format qilinmoqda... %d bet\nvn:Đang định dạng sách... %d trang\n:Found text at page %s\nam:Տեքստը գտնվել է %s էջում\nar:تم العثور على النص في صفحة %s\naz:Mətn %s. səhifədə tapıldı\nbg:Текстът е намерен на страница %s\nbr:Texto encontrado na página %s\nbs:Tekst je pronađen na stranici %s\nby:Тэкст знойдзены на стар. %s\nca-xv:S'ha trobat el text a la pagina %s\nca:S'ha trobat el text a la pagina %s\ncn:于第 %s 页找到目标\ncy:Canfod testun ar dudalen %s\ncz:Položka nalezena na stránce %s\nde:Text auf Seite %s gefunden\ndk:Fandt tekst på side %s\nel:Το κείμενο βρέθηκε στη σελίδα %s\nes:Se encontró el texto en la página %s\net:Leiti tekst leheküljel %s\neu:Bilatu idazkia %s orrialdean\nfa:متن در صفحه‌ی ‌%s پیدا شد\nfi:Tekstiä löytyi sivulta %s\nfr:Texte trouvé à la page %s\nfy-nl:Tekst fûn op side %s\nga:Aimsíodh téacs ag lch a %s\ngl:Atopado texto na páxina %s\nhe:הטקסט נמצא בעמוד %s\nhi:टेक्स्ट पृष्ठ %s पर पाया गया\nhr:Tekst je pronađen na %s. stranici\nhu:Találat a(z) %s. oldalon\nid:Teks ditemukan pada halaman %s\nit:Testo trovato a pagina %s\nja:ページ %s でテキストが見つかりました\nka:ტექსტი ნაპოვნია %s გვერდზე\nkr:%s 페이지에서 문자열 찾음\nku:دەق دۆزرایەوە لە پەڕەکەدا %s\nkw:Tekst kevys war folen %s\nlt:Ieškoti teksto %s puslapyje\nlv:%s lappusē atrasts teksts\nmk:Пронајдов текст на страница %s\nmy:Menjumpai teks pada halaman %s\nne:पृष्ठ %s मा पाठ भेटियो\nnl:Tekst gevonden op pagina %s\nnn:Fann tekst på side %s\nno:Fant tekst på side %s\npl:Znaleziono tekst na stronie %s\npt:Texto encontrado na página %s\nro:Am găsit textul la pagina %s\nru:Текст найден на стр. %s\nsi:පිටුවෙහි පෙළ සොයාගත්තා %s(######found some problems)\nsk:Text bol nájdený na strane %s\nsl:Besedilo najdeno na strani %s\nsp-rs:Tekst je pronađen na %s. stranici\nsq:Gjen tekstin në faqen %s\nsr-rs:Текст је пронађен на %s. страници\nsv:Hittade text på sidan %s\nta:வாசகத்தை %s பக்கத்தில் கண்டுபிடிக்கப்பட்டுள்ளது\ntl:Nakita ang salita sa pahina %s\ntr:Metin %s numaralı sayfada bulundu\ntw:於第 %s 頁找到目標\nuk:Знайти текст на %s сторінці\nuz:%s betda matn topildi\nvn:Tìm thấy từ ở trang %s\n:Found text at page %s (again)\nam:Գտնել տեքստ %s էջում (կրկին)\nar:وُجد النص في الصفحة %s (مرة أخرى)\naz:Mətn %s. səhifədə (təkrar) tapıldı\nbg:Текстът е намерен на страница %s (отново)\nbr:Texto encontrado (de novo) na página %s\nbs:Tekst pronađen na stranici %s (opet)\nca-xv:S'ha trobat el text a la pàgina %s (altra vegada)\nca:S'ha trobat el text a la pàgina %s (altra vegada)\ncn:于第 %s 页找到目标 (已从头查找)\ncy:Canfod testun ar dudalen %s (eto)\ncz:Položka nalezena na stránce %s (znovu)\nde:Text auf Seite %s gefunden (erneut)\ndk:Tekst er (også) fundet på side %s\nel:Το κείμενο βρέθηκε στη σελίδα %s (πάλι)\nes:Se encontró el texto en la página %s (de nuevo)\net:Leiti tekst leheküljel %s (uuesti)\neu:Bilatu idazkia %s orrialdean (berriro)\nfa:متن در صفحه‌ی ‌%s پیدا شد (دوباره)\nfi:Teksti löytyi sivulta %s (uudelleen)\nfr:Texte trouvé page %s (suivant)\nga:Aimsíodh téacs ag lch a %s (arís)\ngl:Atopado texto na páxina %s (de novo)\nhe:הטקסט נמצא בעמוד %s (שוב)\nhi:पाठ पृष्ठ %s पर पाया गया ( फिर से )\nhr:Tekst pronađen na stranici %s (opet)\nhu:Találat a(z) %s. oldalon (ismét)\nid:Teks ditemukan pada halaman %s (lagi)\nit:Trovato testo alla pagina %s (ancora)\nja:%s ページに指定された文字列が見つかりました（一周）\nka:ტექსტი ნაპოვნია %s გვერდზე (ხელახლა)\nkr:%s 페이지에서 (다시) 문자열 찾음\nku:(دەق دۆزرایەوە لە پەڕەکەدا (دووبارە %s\nlt:Rastas tekstas %s puslapyje (vėl)\nlv:%s lappusē atrasts teksts (vēlreiz)\nmk:Пронајдов текст на страница %s (повторно)\nmy:Found teks pada halaman %s (lagi)\nne:पृष्ठ %s मा पाठ भेटियो (पुनः)\nnl:Tekst gevonden op pagina %s (opnieuw)\nnn:Fann tekst på side %s (igjen)\nno:Fant tekst på side %s (igjen)\npl:Znaleziono tekst na stronie %s (znowu)\npt:Texto encontrado na página %s\nro:Găsit textul la pagina %s (din nou)\nru:Текст найден на стр. %s (повторно)\nsk:Text bol nájdený na strane %s (znova)\nsl:Besedilo najdeno na strani %s (ponovno)\nsp-rs:Pronađi tekst na %s. stranici (ponovo)\nsq:Gjen tekstin në faqen %s (përsëri)\nsr-rs:Пронађи текст на %s. страници (поново)\nsv:Hittade text på sida %s (igen)\nta:உரை %s(மீண்டும்) இருக்கிறது\ntr:Metin sayfa %s bulundu (tekrar)\ntw:於第 %s 頁找到目標（已從頭尋找）\nuk:Знайти текст на сторінці %s (знову)\nuz:%s betda matn topildi (qayta)\nvn:Tìm thấy đoạn văn bản tại trang %s (lần nữa)\n:Frequently Read\nam:Հաճախ ընթերցվածներ\nar:الأكثر قراءة\naz:Ən çox oxunanlar\nbg:Често четени\nbr:Lidos com frequência\nbs:Najčešće čitano\nca-xv:Llegits més freqüents\nca:Llegits més freqüents\ncn:经常打开的文件\ncy:Darllen yn Aml\ncz:Často čtené dokumenty\nde:Oft gelesene Dokumente\ndk:Hyppigt læste\nel:Συχνά αναγνωσμένα\nes:Lo más leído\net:Sageli loetud dokumendid\neu:Sarri Irakurriak\nfa:آخرین چیزهایی که خوانده‌اید\nfi:Usein luetut\nfr:Documents lus fréquemment\nga:Léite Go Minic\ngl:Lido decote\nhe:נקרא תכופות\nhi:अक्सर पढ़ें जाने वाले\nhr:Najčešće čitano\nhu:Leggyakrabban olvasott fájlok\nid:Yang Sering Dibaca\nit:Letti frequentemente\nja:よく読むファイル\nka:ბოლოს წაკითხული დოკუმენტები\nkr:최근에 읽은 파일\nku:زۆرترین خوێندراوە\nlt:Dažniausiai skaitomi\nlv:Bieži lasītie\nmk:Често читани\nml:കൂടുതല്‍ വായിച്ചത്.\nmy:Kerap Dibaca\nne:प्रायजसो पढिएको\nnl:Eerder Weergegeven\nnn:Ofte lesne\nno:Ofte leste\npl:Ostatnio otwierane\npt:Frequentes\nro:Citite frecvent\nru:Часто используемые документы\nsk:Často čítané dokumenty\nsl:Pogosto brani\nsp-rs:Nedavno čitano\nsq:Lexime të shpeshta\nsr-rs:Недавно читано\nsv:Mest lästa\nta:அடிக்கடி படிப்பது\ntr:Sıkça okunan\ntw:經常開啟的檔案\nuk:Часто читані\nuz:Tez-tez o'qiladiganlar\nvn:Đọc thường xuyên\n:GB\naf:GB\nam:ԳԲ\nar:ج.ب\naz:GB\nbg:GB\nbn:জিবি\nbr:GB\nbs:GB\nby:GB\nca-xv:GB\nca:GB\ncn:GB\ncy:GB\ncz:GB\nde:GB\ndk:Gb\nel:GB\nes:GB\net:GB\neu:GB\nfa:گیگابایت\nfi:Gt\nfr:Go\nfy-nl:GB\nga:GB\ngl:GB\nhe:GB\nhi:GB\nhr:GiB\nhu:Gb\nid:GB\nit:GB\nja:GB\nka:გბ\nkr:GB\nku:گێگابایت\nkw:GB\nlt:GB\nlv:GB\nmk:GB\nml:GB\nmm:GB\nmy:GB\nne:जिबी\nnl:GB\nnn:GB\nno:GB\npa:GB\npl:GB\npt:GB\nro:GB\nru:Гб\nsi:GB\nsk:GB\nsl:GB\nsn:GB\nsp-rs:GB\nsq:GB\nsr-rs:GB\nsv:GB\nta:ஜிகா பைட்டு\nth:GB\ntl:GB\ntr:GB\ntw:GB\nuk:GB\nuz:GB\nvn:GB\n:Go to page\naf:Gaan Na Bladsy\nam:Անցնել էջի\nar:انتقل لصفحة\naz:Səhifəyə keç\nbg:Отиване на страница\nbn:এর পৃষ্ঠায় চলুন\nbr:Ir para a página\nbs:Idi na stranicu\nby:Перайсці на старонку\nca-xv:Vés a la pàgina\nca:Vés a la pàgina\ncn:前往页\ncy:Mynd i dudalen\ncz:Přejít na stránku\nde:Gehe zu Seite\ndk:Gå til side\nel:Μετάβαση στη σελίδα\nes:Ir a la página\net:Liigu leheküljele\neu:Joan orrialdera\nfa:برو به صفحه‌ی\nfi:Siirry sivulle\nfr:Aller à la page\nfy-nl:Gean nei side\nga:Téigh chuig lch\ngl:Ir a páxina\nhe:עבור לעמוד\nhi:पृष्ठ संख्या पर जाए(&G)\nhr:Idi na stranicu\nhu:Ugrás adott oldalra\nid:Pergi ke halaman\nit:Vai a pagina\nja:ページへ移動\nka:გვერდის მითითება\nkr:페이지로 가기\nku:چوون بۆ پەڕە\nkw:Mos dhe folen\nlt:Eiti į puslapį\nlv:Doties uz lappusi\nmk:Појди на страница\nml:താളിലേക്ക് പോകുക\nmm:သွားရန် စာမျက်နှာ\nmy:Pergi ke mukasurat\nne:पृष्ठमा जानुहोस्\nnl:Ga naar pagina\nnn:Gå til side\nno:Gå til side\npa:ਪੰਨੇ ਤੇ ਜਾਓ\npl:Przejdź do strony\npt:Ir para a página\nro:Salt la pagina\nru:Перейти на страницу\nsi:පිටුවට යන්න\nsk:Ísť na stranu\nsl:Pojdi na stran\nsn:Enda kupeji\nsp-rs:Idi na stranicu\nsq:Shkoj te faqja\nsr-rs:Иди на страницу\nsv:Gå till sida\nta:பக்கததிர்க்கு செல்\nth:ไปที่หน้า\ntl:Pumunta sa Pahina\ntr:Sayfaya git\ntw:前往頁\nuk:Перейти на сторінку\nuz:Betga o'tish\nvn:Nhảy đến trang\n:Hide &Options\nam:Թաքցնել &ընտրանքները\nar:إخفاء &الخيارات\naz:&Seçimləri gizlət\nbg:Скрии &Опции\nbr:Ocultar &Opções\nbs:Sakrij &opcije\nca-xv:Amaga les &opcions\nca:Amaga les &opcions\ncn:隐藏选项(&O)\ncy:Dewisiadau C&uddio\ncz:Skrýt &možnosti\nde:&Optionen\ndk:Gem &valgmuligheder\nel:Απόκρυψη επιλογών\nes:Menos &opciones\net:Peida &sätted\neu:Ezkuta A&ukerak\nfa:مخفی کردن &گزینه‌ها\nfi:Piilota\nfr:Masque les &options\nga:Cuir na roghanna i bhfolach\ngl:Agochar as &opcións\nhe:הסתר אפשרויות\nhr:Sakrij postavke\nhu:Beállítások elrejtése\nid:Sembunyikan &Opsi\nit:Nascondi & opzioni\nja:オプションを隠す(&O)\nka:&ვარიანტების დამალვა\nkr:옵션 숨김(&O)\nku:هەڵبژاردنەکانی &شاردنەوە\nlv:Paslēpt &opcijas\nmk:Скриј &опции\nmy:Sembunyi &Tetapan\nnl:Verberg &Opties\nnn:Skjul &innstillingar\nno:Skjule &Tillegg\npl:Ukryj &Opcje\npt:&Ocultar opções\nro:Ascundere &Optiuni\nru:Скрыть параметры\nsk:Skryť &Možnosti\nsl:Skrij M&ožnosti\nsp-rs:Sakrij opcije\nsq:Fsheh &opsionet\nsr-rs:Сакриј опције\nsv:Göm Alternativ\nta:மறை & விருப்பம்\ntr:Sakla & Seçenekler\ntw:隱藏選項(&O)\nuk:Приховати налаштування\nuz:&Parametrlarni yashirish\nvn:Thiết lập ẩn và tùy chọn\n:Hide frequently read\nam:Թաքցնել հաճախակի բացվածները\nar:إخفاء الأكثر قراءة\naz:Ən çox oxunanları gizlət\nbg:Скриване на често четените\nbr:Ocultar Lidos com frequência\nbs:Sakrij najčešće čitano\nca-xv:Amaga els més llegits\nca:Amaga els més llegits\ncn:隐藏经常打开的文件\ncy:Cuddio darllen yn aml\ncz:Skrýt často čtené dokumenty\nde:Oft gelesene Dokumente ausblenden\ndk:Skjul hyppigt læste\nel:Απόκρυψη συχνών αναγνωσμένων αρχείων\nes:Ocultar \"lo más leído\"\net:Peida sageli loetud dokumendid\neu:Ezkutatu sarri irakurriak\nfa:پنهان کردن آخرین چیزهایی که خوانده‌اید\nfi:Piilota usein luetut\nfr:Masquer les documents lus fréquemment\nga:Folaigh cinn léite go minic\ngl:Agachar o lido decote\nhe:הסתר 'נקרא תכופות'\nhi:अक्सर पढ़े जाने वालों को छुपाएँ\nhr:Sakrij najčešće čitano\nhu:Leggyakrabban olvasottak elrejtése\nid:Sembunyikan Yang Sering Dibaca\nit:Nascondi letto frequentemente\nja:よく読むファイルを表示しない\nka:ბოლოს წაკითხული დოკუმენტების დამალვა\nkr:최근에 읽은 파일 감추기\nku:شاردنەوەی زۆر خوێندراوەکان\nlt:Nerodyti dažniausiai skaitomų\nlv:Slēpt bieži lasītos\nmk:Сокриј често читани\nmy:Sembunyikan Bacaan Kerap\nne:प्रायजसो पढिएको लुकाउनुहोस्\nnl:'Eerder Weergegeven' verbergen\nnn:Skjul ofte lesne\nno:Skjult ofte leste\npl:Ukryj ostatnio otwierane\npt:Ocultar frequentes\nro:Ascunde paginile citite frecvent\nru:Скрыть часто используемые документы\nsk:Skryť často čítané dokumenty\nsl:Skrij pogosto brane\nsp-rs:Sakrij „nedavno čitano”\nsq:Fsheh leximet e shpeshta\nsr-rs:Сакриј „недавно читано”\nsv:Dölj mest lästa\nta:அடிக்கடி வாசிப்பதை மறைக்க\ntr:Sıkça okunanı gizle\ntw:隱藏經常開啟的檔案\nuk:Приховати часто читані\nuz:Tez-tez o'qiladiganlarni yashirish\nvn:Ẩn Đọc thường xuyên\n:Hint: Use the F3 key for finding again\nam:Որոնումը կրկնելու համար օգտագործեք F3 կոճակը\nar: للبحث مرة أخرى F3 تلميح: استخدام مفتاح\naz:Təkrar axtarış üçün F3 düyməsinə basın\nbg:Съвет: Използвайте F3 за повторно търсене\nbr:Dica: tecle F3 para achar a próxima ocorrência\nbs:Pomoć: upotrijebite tipku F3 za ponovnu pretragu\nca-xv:Suggeriment: feu servir la tecla F3 per tornar a cercar\nca:Suggeriment: feu servir la tecla F3 per tornar a cercar\ncn:提示: 按 F3 重新查找。\ncy:Cyngor: Defnyddiwch bysell F3 i ganfod eto\ncz:Nápověda: Klávesou F3 vyhledáte další výskyt\nde:Tipp: F3-Taste verwenden, um weiterzusuchen\ndk:Vink: Brug F3-knappen for at finde igen\nel:Συμβουλή: Χρησιμοποιήστε το F3 για εύρεση του επόμενου\nes:Consejo: Presione F3 para mostrar el siguiente resultado\net:Soovitus: Uuesti otsimiseks vajuta F3-klahvi\neu:Oharra: Erabili F3 tekla berriro bilatzeko\nfa:نکته: برای جستجوی مجدد از کلید F3 استفاده کنید\nfi:Vihje: Käytä F3-näppäintä etsiäksesi uudestaan\nfr:Remarque : utilisez la touche F3 pour trouver de nouveau\nfy-nl:Tip: Brûk de funksjetoets F3 om fierder te sykjen\nga:Leid: Bain feidhm as an gcnaipe F3 chun nithe a aimsiú arís\ngl:Usar \"F3\" para amosar seguinte resultado\nhe:לחיפוש המופע הבא, לחץ על F3\nhi:सुझाव: फिर से खोजने के लिए F3 कुंजी का प्रयोग करें\nhr:Pomoć: upotrijebite tipku F3 za ponovnu pretragu\nhu:Tipp: Nyomja meg az F3 gombot a következő találathoz\nid:Tips : Gunakan tombol F3 untuk mengulangi pencarian\nit:Consiglio: usare <F3> per trovare il successivo\nja:ヒント: 再び検索するには F3 キーを使用します\nka:ქარაგმა: ძებნის განმეორებისთვის გამოიყენეთ ღიალკი \"F3\"\nkr:힌트: 다시 찾으려면, F3 키를 누르세요.\nku:بەکاربهێنە بۆ دووبارە دۆزینەوە F3 فێرکاری: دوگمەی\nkw:Hynt: Devnydhya alhwedhen F3 rag daskavos\nlt:Patarimas: ieškodami kito atitikmens naudokite klavišą F3\nlv:Ieteikums: izmantojiet taustiņu F3, lai atrastu atkal\nmk:Совет: За повторно пребарување користете F3 од тастатурата\nmy:Petunjuk: Gunakan kekunci F3 untuk mencari semula\nne:सङ्केत: पुनः फेलापार्न F3 कुञ्जी प्रयोग गर्नुहोस्\nnl:Tip: Gebruik de functietoets F3 om verder te zoeken\nnn:Tips: Bruk F3-knappen for å finne igjen\nno:Tips: Bruk F3-tasten for å søke etter neste\npl:Wskazówka: użyj klawisza F3, aby szukać dalej\npt:Dica: utilize F3 para procurar a seguinte\nro:Sugestie: Utilizați tasta F3 pentru a căuta mai departe\nru:Для повторного поиска нажмите <F3>\nsi:ඉඟිය: නැවත සෙවීම සඳහා F3 යතුර භාවිත කරන්න\nsk:Rada: Použite klávesu F3 pre ďalšie hľadanie\nsl:Namig: uporabite tipko F3 za ponovno iskanje\nsp-rs:Savet: Upotrebite taster F3 za nastavak pretrage\nsq:Këshillë: Përdorni tastin F3 për gjetjen e radhës\nsr-rs:Савет: Употребите тастер F3 за наставак претраге\nsv:Tips: Tryck F3 för att söka vidare\nta:சிறுகுரிப்பு: F3 தட்டை பயன்படுத்தி மீண்டும் தேடு\ntl:Payo: Pindutin ang F3 para maghanap muli\ntr:İpucu: yeniden bulmak için F3 tuşunu kullanın\ntw:提示: 按 F3 重新尋找。\nuk:Підказка: Для повторного пошуку натисніть F3\nuz:Eslatma: qayta qidirish uchun F3 tugmasini bosing\nvn:Gợi ý: Nhấn phím F3 để tìm lại\n:Image files (*.%s)\nam:Պատկերի ֆայլեր (*.%s)\nar:ملفات الصور (*.%s)\naz:Şəkil faylları (*.%s)\nbg:Изображения (*.%s)\nbr:Arquivos de imagem (*.%s)\nbs:Slike (*.%s)\nca-xv:Fitxers d'imatge (*.%s))\nca:Fitxers d'imatge (*.%s))\ncn:图片文件 (*.%s)\ncy:Ffeiliau delwedd  (*.%s)\ncz:Soubory obrázků (*.%s)\nde:Bilder (*.%s)\ndk:Billedfiler (*.%s)\nel:Αρχεία εικόνων (*.%s)\nes:Archivos de imagen (*.%s)\net:Pildifailid (*.%s)\neu:Irudi agiriak (*.%s)\nfa:پرونده‌های تصویری (*.%s)\nfi:Kuvatiedostot (*.%s)\nfr:Fichiers-images (*.%s)\nga:Comhaid íomhánna (*.%s)\ngl:Ficheiros de imaxe (*.%s)\nhe:קובצי תמונה (*.%s)\nhi:छवि फ़ाइलें (*.%s)\nhr:Slikovne datoteke (*.%s)\nhu:Képfájlok (*.%s)\nid:Berkas Gambar (*.%s)\nit:File immagine (*.%s)\nja:画像ファイル (*.%s)\nka:ნახატი ფაილები (*.%s)\nkr:이미지 파일 (*.%s)\nku:(*.%s) فایلە وێنەییەکان\nlt:Grafiniai failai (*.%s)\nlv:Attēlu faili (*.%s)\nmk:Слики (*.%s)\nmy:Imej Fail (*.%s)\nne:छवि फाइल (*.%s)\nnl:Afbeeldingen (*.%s)\nnn:Biletfilar (*.%s)\nno:Bildefiler (*.%s)\npl:Pliki graficzne (*.%s)\npt:Imagens (*.%s)\nro:Fișiere-imagine (*.%s)\nru:Файлы изображений (*.%s)\nsk:Súbory obrázkov (*.%s)\nsl:Slikovne datoteke (*.%s)\nsp-rs:Datoteke slika (*.%s)\nsq:Figura (*.%s)\nsr-rs:Датотеке слика (*.%s)\nsv:Bildfiler (*.%s)\nta:பட கோப்புகள் (*.%s)\ntr:Görüntü dosyaları (*.%s)\ntw:圖片檔案 (*.%s)\nuk:Файли зображень (*.%s)\nuz:Rasm fayllari (*.%s)\nvn:Tập tin ảnh (*.%s)\n:Install SumatraPDF\naf:Installeer SumatraPDF\nam:Տեղակայել SumatraPDF-ը\nar:المحمولة Sumatra تثبيت مستندات\naz:SumatraPDF-i quraşdır\nbg:Инсталиране на SumatraPDF\nbr:Instalar SumatraPDF\nbs:Instaliraj SumatraPDF\nca-xv:Instal·la el SumatraPDF\nca:Instal·la el SumatraPDF\ncn:安装 SumatraPDF\ncy:Gosod SumatraPDF\ncz:Nainstalovat SumatraPDF\nde:Installieren\ndk:Installer SumatraPDF\nel:Εγκατάσταση SumatraPDF\nes:Instalar SumatraPDF\net:Paigalda SumatraPDF\neu:Ezarri SumatraPDF\nfa:نصب کردن SumatraPDF\nfi:Asenna SumatraPDF\nfr:Installer SumatraPDF\nga:Suiteáil SumatraPDF\ngl:Instalar SumatraPDF\nhe:התקן את SumatraPDF\nhi:SumatraPDF स्थापित करें\nhr:Instaliraj SumatraPDF\nhu:SumatraPDF telepítése\nid:Install SumatraPDF\nit:Installa SumatraPDF\nja:SumatraPDFをインストール\nka:SumatraPDF-ის ინსტალაცია\nkr:SumatraPDF 설치\nku:دابەزاندنی SumatraPDF\nlv:Instalēt SumatraPDF\nmk:Инсталирај SumatraPDF\nmy:Pasang SumatraPDF\nnl:Installeer SumatraPDF\nnn:Installer SumatraPDF\nno:Installer SumatraPDF\npl:Zainstaluj SumatraPDF\npt:Instalar SumatraPDF\nro:Instalare SumatraPDF\nru:Начать установку\nsk:Inštaluj SumatraPDF\nsl:Namesti SumatraPDF\nsp-rs:Instaliraj SumatraPDF\nsq:Instaloj SumatraPDF\nsr-rs:Инсталација СуматраПДФ\nsv:Installera SumatraPDF\nta:சுமத்ராPDFஐ நிறுவு\ntr:SumatraPDF yükle\ntw:安裝 SumatraPDF\nuk:Встановити SumatraPDF\nuz:SumatraPDF o'rnatish\nvn:Cài đặt SumatraPDF\n:Install SumatraPDF in &folder:\nam:Տեղադրել SumatraPDF-ը &հետևյալ թղթապանակում՝\nar:المحمولة في المجلد Sumatra تثبيت مستندات :\naz:SumatraPDF-i bu &qovluqda quraşdır:\nbg:Инсталираи SumatraPDF във &папка\nbr:Instalar SumatraPDF na &pasta:\nbs:Instaliraj SumatraPDF u &direktorij:\nca-xv:Instal·la el SumatraPDF a la &carpeta:\nca:Instal·la el SumatraPDF a la &carpeta:\ncn:安装 SumatraPDF 于文件夹(&F):\ncy:Gosod SumatraPDF yn &ffolder:\ncz:Nainstalovat SumatraPDF do &složky:\nde:&Installationsverzeichnis:\ndk:Installer SumatraPDF i &mappe:\nel:Εγκατάσταση SumatraPDF στο φάκελο:\nes:&Instalar SumatraPDF en la siguiente carpeta:\net:Paigalda SumatraPDF &kataloogi:\neu:Ezarri Su&matraPDF agiritegi honetan:\nfa:SumatraPDF را در این &پوشه نصب کن:\nfi:Asenna SumatraPDF kansioon:\nfr:Installer SumatraPDF dans le répertoire :\nga:Suiteáil SumatraPDF sa bh&fillteán seo:\ngl:Instalar SumatraPDF no &cartafol:\nhe:התקן את SumatraPDF בתיקייה:\nhr:Instaliraj SumatraPDF u &mapu:\nhu:SumatraPDF telepítése a következő &könyvtárba:\nid:Install SumatraPDF ke &folder:\nit:Installa SumatraPD&F nella cartella:\nja:SumatraPDF インストール先フォルダ(&F)\nka:SumatraPDF-ის ინსტალაცია &საქაღალდეში:\nkr:SumatraPDF 설치 폴더(&F):\nku:لە فۆڵدەری SumatraPDF دابەزاندنی:\nlv:Instalēt SumatraPDF &mapē:\nmk:Инсталирај SumatraPDF во &папка:\nmy:Pasang SumatraPDF dalam &folder\nnl:Installeer SumatraPDF in &map\nnn:Installer SumatraPDF i mappa:\nno:Installere SumatraPDF i &mappe:\npl:Zainstaluj SumatraPDF w &folderze:\npt:Instalar SumatraPD&F na pasta:\nro:Instalare SumatraPDF in &folderul:\nru:Установить SumatraPDF в &папку:\nsk:Inštaluj SumatraPDF do &adresára:\nsl:Namesti SumatraPDF v mapo:\nsp-rs:Instalacija SumatraPDF u folder\nsq:Instaloj SumatraPDF në &dosje:\nsr-rs:Инсталација СуматраПДФ\nsv:Installera SumatraPDF i katalog:\nta:சுமத்ராPDFஐ &கோப்புறையில் நிறுவவும்:\ntr:&folder klasörüne SumatraPDF'yi yükle\ntw:安裝 SumatraPDF 於資料夾(&F):\nuk:Встановити SumatraPDF у папку\nuz:SumatraPDF &jildga o'rnatish\nvn:Cài đặt SumatraPDF trong &thư mục:\n:Installation failed!\nam:Տեղակայումը ձախողվեց:\nar:!فشل التثبيت\naz:Quraşdırma baş tutmadı!\nbg:Инсталацията беше неуспешна!\nbr:Falha na instalação!\nbs:Neuspješna instalacija!\nca-xv:La instal·lació ha fallat!\nca:La instal·lació ha fallat.\ncn:安装失败!\ncy:Methodd y gosod!\ncz:Instalace se nezdařila!\nde:Die Installation ist fehlgeschlagen!\ndk:Installation fejlede!\nel:Αποτυχία εγκατάστασης!\nes:¡La instalación ha fallado!\net:Paigaldamine ebaõnnestus!\neu:Ezarpen hutsegitea!\nfa:ایراد در نصب\nfi:Asentaminen epäonnistui!\nfr:Échec de l'installation !\nga:Theip ar an suiteáil!\ngl:Fallou a instalación!\nhe:התקנת SumatraPDF נכשלה.\nhr:Instalacija nije uspjela!\nhu:Telepítés sikertelen!\nid:Instalasi gagal!\nit:Installazione fallita!\nja:インストールに失敗！\nka:ინსტალაცია ვერ მოხერხდა!\nkr:설치 실패!\nku:دابەزاندن سەرکەوتو نەبوو!\nlv:Instalēšana neizdevās!\nmk:Инсталирањето не успеа!\nmy:Pemasangan gagal!\nnl:Installatie mislukt!\nnn:Installering mislykkast!\nno:Feil ved installering!\npl:Błąd instalacji!\npt:A instalação falhou!\nro:Instalare esuata!\nru:Установка не удалась!\nsk:Inštalácia sa nepodarila!\nsl:Namestitev ni uspela!\nsp-rs:Instalacija neuspešna!\nsq:Dështoi instalimi!\nsr-rs:Инсталација неуспела!\nsv:Installationen misslyckades!\nta:நிறுவல் தோல்வி!\ntr:Yükleme başarısız !\ntw:安裝失敗！\nuk:Встановлення не було успішним!\nuz:O'rnatish muvaffaqiyatsiz tugadi!\nvn:Cài đặt thất bại!\n:Installation in progress...\nam:Ընթացքում է...\nar:التثبيت قيد التقدم...\naz:Quraşdırma davam edir...\nbg:Инсталиране...\nbr:Instalação em progresso...\nbs:Instalacija u toku...\nca-xv:La instal·lació és en progrés...\nca:La instal·lació és en progrés...\ncn:安装正在进行中...\ncy:Wrthi'n gosod\ncz:Probíhá instalace...\nde:Die Installation wird ausgeführt…\ndk:Installation i gang ...\nel:Εγκατάσταση σε εξέλιξη...\nes:Instalación en progreso...\net:Toimub paigaldamine...\neu:Ezarpena garatzen...\nfa:در حال نصب...\nfi:Asennus käynnissä...\nfr:Installation en cours…\nga:Suiteáil ar siúl...\ngl:Instalación en curso...\nhe:מתקין את SumatraPDF...\nhr:Instaliranje...\nhu:Telepítés folyamatban...\nid:Instalasi sedang berlangsung...\nit:Installazione in corso...\nja:インストール中…\nka:მიმდინარეობს ინსტალაცია...\nkr:설치하는 중...\nku:دابەزاندن لە ئەنجامداندایە...\nlv:Notiek instalēšana...\nmk:Инсталирањето е во тек...\nmy:Pemasangan sedang dijalankan...\nnl:Installatie in uitvoering...\nnn:Installering under arbeid...\nno:Installasjon pågår...\npl:Trwa instalacja...\npt:A instalar...\nro:Se instaleaza...\nru:Происходит установка...\nsk:Prebieha inštalácia...\nsl:Namestitev poteka …\nsp-rs:Instalacija u toku...\nsq:Instalimi vijon...\nsr-rs:Инсталација у току...\nsv:Installerar...\nta:நிறுவல் செயலில் உள்ளது...\ntr:Kurulum devam ediyor...\ntw:安裝正在進行...\nuk:Встановлення триває...\nuz:O'rnatilmoqda...\nvn:Đang cài đặt...\n:KB\naf:KB\nam:ԿԲ\nar:ك.ب\naz:KB\nbg:KB\nbn:KB\nbr:KB\nbs:KB\nby:KB\nca-xv:KB\nca:KB\ncn:KB\ncy:KB\ncz:KB\nde:KB\ndk:Kb\nel:KB\nes:KB\net:kB\neu:KB\nfa:کیلوبایت\nfi:Kt\nfr:Ko\nfy-nl:KB\nga:KB\ngl:KB\nhe:KB\nhi:KB\nhr:KiB\nhu:Kb\nid:KB\nit:KB\nja:KB\nka:კბ\nkr:KB\nku:کیلۆبایت\nkw:KB\nlt:KB\nlv:KB\nmk:KB\nml:KB\nmm:KB\nmy:KB\nne:केबी\nnl:KB\nnn:KB\nno:KB\npa:KB\npl:KB\npt:KB\nro:KB\nru:Кб\nsi:KB\nsk:KB\nsl:KB\nsn:KB\nsp-rs:kB\nsq:KB\nsr-rs:kB\nsv:KB\nta:KB\nth:KB\ntl:KB\ntr:KB\ntw:KB\nuk:KB\nuz:KB\nvn:KB\n:Keep the PDF &browser plugin installed (no longer supported)\nam:Թողնել &դիտարկիչի PDF բաղադրիչը (այլևս չի աջակցում)\nar:(الحفاظ  على المستندات المحمولة متصفح البرنامج المساعد المثبت (لم تعد معتمدة\naz:PDF &brauzer plaginini silmə (artıq dəstəklənmir)\nbr:Mantenha o plugin PDF para instalado (não é mais suportado)\nbs:Ostavi plugin instaliran u &browseru (više nije podržano)\nca-xv:Mantín instal·lat el connector PDF del &navegador (ja no es manté)\nca:Mantén instal·lat el connector PDF del &navegador (ja no es manté)\ncn:维持 PDF 浏览器插件安装状态(不再支持)(&B)\ncy:Cadw yr ategyn porwr PDF wedi ei osod (ddim yn cael ei gynnal bellach)\ncz:Ponechat nainstalovaný plugin &prohlížeč PDF (již není podporován)\nde:PDF &Browser-Plugin installiert lassen (nicht mehr unterstützt)\ndk:Bevar PDF-&browserudvidelsesmodulet installeret (ikke længere understøttet)\nel:Διατήρηση του πρόσθετου προγράμματος περιήγησης PDF εγκατεστημένο (δε θα υποστηρίζεται πλέον)\nes:Mantener instalado el complemento de &navegador (ahora obsoleto)\net:Jäta alles PDF &brauseri plugin (enam ei toetata)\neu:Eduki PDF &nabigatzaile plugina ezarrita (sostengu gabe aurrerantzean)\nfa:افزونه‌ی PDF نصب شده روی مرورگر باقی بماند (دیگر پشتیبانی نمی‌شود)\nfi:Pidä PDF-selainlaajennus asennettuna (ei enää tuettu)\nfr:Conserver le plugin pour navigateur (plus de support)\nga:Coinnigh suiteáilte an breiseán don líonléitheoir PDF (ní thugtar tacaíocht dó feasta)\ngl:Manter instalado o engadido PDF do &navegador (sen soporte)\nhe:השאר את תוסף PDF לדפדפנים (התוסף אינו נתמך עוד)\nhr:Zadrži PDF &browser dodatak instaliran (više nije podržano)\nhu:Hagyja a PDF böngésző beépülőt telepítve (már nem támogatott)\nid:Biarkan plugin peramban PDF terinstal (tidak lagi didukung)\nit:Mantieni installato il plugin PDF del &browser (non più supportato)\nja:PDF閲覧プラグインのインストールは保つ(&b) (廃止された機能)\nkr:브라우저에 설치된 PDF 플러그인 유지(&B) (더 이상 지원 안 함)\nku:هێشتنەوەی پێوەکراوی وێبگەڕ بە دامەزێرێنراوی (چیتر پاڵپشتی ناکرێت)\nlv:Paturēt pārlūka PDF spraudni instalētu (vairs netiek atbalstīts)\nmk:Задржи го додатокот за PDF за &прелистувачи (не е повеќе поддржан)\nnl:Behoud de PDF-&browserplugin geïnstalleerd (niet langer ondersteund)\nnn:Behald installeringa av PDF-&nettlesartillegget (Ikkje lenger støtta)\nno:Fortsett å ha PDF-nettlesertillegget installert (Ikke lenger støttet)\npl:Pozostaw zainstalowaną &wtyczkę PDF do przeglądarek (już nie jest wspierana)\npt:&Manter plugin de navegador instalado (já não é suportado)\nru:Сохранить установленный PDF плагин для браузера (более не поддерживается)\nsk:Ponechať PDF plugin prehliadača nainštalovaný (už nie je podporovaný)\nsl:Obdržati PDF vtičnik &brskalnika nameščen (ni več podprt)\nsp-rs:Zadrži PDF plugin pretraživača instalisan (nije podržano)\nsr-rs:Задржи ПДФ плугин инсталисан (није подржано)\nsv:Behåll webbläsarens insticksprogram för PDF (stöds inte längre)\ntr:PDF ve tarayıcı eklentisini kurulu oalrak bırakınız (artık desteklenmiyor)\ntw:維持 PDF 瀏覽器插件安裝狀態(不再支援)(&B)\nuk:Залишити розширення для браузера (більше не підтримується)\nuz:PDF &brauzer plaginini o'rnatilgan qoldirish (boshqa qo'llab-quvvatlanmaydi)\nvn:Giữ lại Plugin PDF đã cài đặt cho các trình duyệt (không còn được hỗ trợ)\n:Let Windows Desktop Search &search PDF documents\nam:Թույլատրել Windows Desktop Search-ին &PDF ֆայլերի որոնումը\nar:دع البحث في سطح مكتب الوندوز &البحث في وثائق المستندات المحمولة\naz:PDF sənədlərini Windows Desktop Search vasitəsilə a&xtar\nbr:Permitir que o Windows faça a bu&sca em documentos PDF\nbs:Omogući Windows Desktop Search-u da &pretražuje PDF dokumente\nca-xv:Permet al Windows Desktop Search &cercar als documents PDF\nca:Permet al Windows Desktop Search &cercar als documents PDF\ncn:让 Windows “桌面搜索”搜索 PDF 文件\ncy:Gadael i Chwilio Bwrdd Gwaith Windows c&hwilio'r dogfennau PDF\ncz:Nechte Windows Desktop Search &prohledávat PDF dokumenty\nde:PDF Dokumente in Windows-&Suchen einbeziehen\ndk:Lad Windows' skrivebordssøgning &søge i PDF-dokumenter\nel:Αναζήτηση εγγράφων PDF μέσω του Windows Desktop Search \nes:Permitir que la búsqueda de Windows encuentre documentos PDF\net:Windows Desktop Search &otsib PDF-dokumente\neu:&Utzi Windows Mahaigain Bilaketari PDF agiriak bilatzen\nfa:جستجوگر ویندوز امکان &جستجو در اسناد PDF را داشته باشد\nfi:&Anna Windowsin hakutoiminnon etsiä PDF-asiakirjoista\nfr:Permettre à Windows Desktop Search la recherche de documents PDF\nga:Lig do Chuardach Deasca Windows cáipéisí PDF a chuardach\ngl:Deixar que o buscador de escritorio de Windos &busque nos documentos de PDF\nhe:אפשר חיפוש קובצי PDF במערכת החיפוש של Windows\nhr:Neka Windows pretraga radne površine &pretražuje PDF dokumente\nhu:Hagyja a Windows Desktop Search-re a PDF dokumentumok keresését\nid:Izinkan Windows Desktop Search mencari dokumen PDF\nit:Assegna a Windows la ricerca sul desktop & dei documenti PDF\nja:Windows デスクトップ サーチの PDF ドキュメント検索を許可する(&s)\nkr:Windows 데스크톱 검색에 PDF 문서 검색 기능 추가(&S)\nku:PDF ڕێگەدان بە گەڕانی سەرشاشەی ویندۆز &بگەڕێت بۆ بەڵگەنامەکانی\nlv:&Meklēt PDF dokumentus ar Windows Desktop Search\nmk:Дозволи Windows Desktop Search да пребарува низ PDF-документи\nmy:Biarkan Windows Desktop Search &mencari dokumen PDF\nnl:Laat Windows Bureaublad Zoeker PDF documenten &zoeken\nnn:Let Windows Skrivebordssøk &søkje gjennom PDF-dokumentar\nno:La Windows søkemotor &søke PDF dokumenter\npl:Wyszukiwanie z pulpitu systemu Windows ma &przeszukiwać pliki PDF\npt:Permitir que o Windows Desktop &Search localize os PDF\nro:Permite Windows Desktop &Search sa caute in documente PDF\nru:&Поиск файлов PDF с помощью Windows Desktop Search\nsk:Povoliť, aby Windows Desktop Search &vyhľadával PDF dokumenty\nsl:Naj Windows Desktop Search išče PDF dokumente\nsp-rs:Pretraga Windows Desktop pretraga PDF dokumenta\nsq:Lejoj Windows Desktop Search të &kërkojë dokumentet PDF\nsr-rs:Претрага Windows Desktop &претрага ПДФ документа\nsv:Låt Windows inbyggda sökfunktion indexera PDF-dokument\nta:விண்டோஸ் டெஸ்க்டாப் தேடல் &PDF கோப்புகளை தேடட்டும்\ntr:PDF belgelrini aramak için Windows Masaüstü Aramaya izin ver\ntw:讓 Windows 「桌面搜尋」搜尋 PDF 文件\nuk:Дозволити Windows Desktop Search пошук у PDF документах\nuz:Windows Desktop Search yordamida PDF hujjatlarini &qidirish\nvn:Cho phép Windows &tìm kiếm các tài liệu PDF\n:Let Windows show &previews of PDF documents\nam:Թույլատրել Windows-ին &ցուցադրել PDF ֆայլերի նախադիտումը\nar:دع الوندوز باظهار &معاينات الوثائق من المستندات المحمولة\naz:PDF sənədlərini Windows alətləri vasitəsilə &görüntülə\nbr:Permitir que o Windows &pré-visualize documentos PDF\nbs:Omogući Windows-ima da prikažu &pregled PDF dokumenata\nca-xv:Permet al Windows mostrar &visualitzacions prèvies dels documents\nca:Permet al Windows mostrar &visualitzacions prèvies dels documents PDF\ncn:让 Windows 显示 PDF 文件的预览(&P)\ncy:Gadael i Windows ddangos &rhagolwg o ddogfennau PDF\ncz:Nechte Windows zobrazit &náhledy PDF dokumentů\nde:&Vorschau für PDF Dokumente in Explorer aktivieren\ndk:Lad Windows vise &forhåndsvisninger af PDF-dokumenter\nel:Εμφάνιση προεπισκόπησης των εγγράφων PDF στα Windows\nes:Mostrar miniaturas en los iconos de documentos &PDF\net:Windows kuvab PDF-dokumentide &eelvaateid\neu:Utzi &Windowsi PDF agirien aurreikuspenak erakusten\nfa:ویندوز امکان پیش‌نمایش اسناد PDF را داشته باشد\nfi:Anna Windowsin näyttää &esikatselukuvat PDF-asiakirjoille\nfr:Permettre à Windows de montrer des a&perçus des documents PDF\nga:Lig do Windows réamhamhairc de cháipéisí PDF a thaispeáint\ngl:Deixar que Windows mostre &previsualizacións de documentos PDF\nhe:אפשר תצוגה מקדימה של קובצי PDF\nhr:Neka Windows prikazuje &pregled PDF dokumenata\nhu:Hagyja a Windows-ra a PDF dokumentumok előnézetének megjelenítését\nid:Izinkan Windows menampilkan dokumen PDF\nit:Assegna a Windows la visualizzazione & anteprima dei documenti PDF\nja:Windows の PDF ドキュメントプレビューを許可する(&p)\nkr:Windows 에 PDF 문서 미리보기 기능 추가(&P)\nku:پیشان بدات PDF ڕێگەدان بە پیشاندەری ویندۆز &بەڵگەنامەکانی\nlv:Ļaut Windows rādīt PDF dokumentu &priekšskatījumus\nmk:Дозволи Windows да прикажува слики за PDF-документи\nmy:Biarkan Windows menunjukkan &preview dokumen PDF\nnl:Laat Windows &voorbeelden tonen van PDF documenten\nnn:Let Windows vise &forhandsvisingar av PDF-dokumentar\nno:La Windows vise &forhåndsvisning av PDF-dokumenter\npl:Windows ma pokazywać &podgląd plików PDF\npt:&Permitir que o Windows mostre uma antevisão dos PDF\nro:Permite Windows-ului sa arate &previzualizari ale documentelor PDF\nru:&Просмотр документов PDF средствами Windows\nsk:Povoliť, aby Windows zobrazoval &náhľad PDF dokumentov\nsl:Naj Windows prikazuje predogled PDF dokumentov\nsp-rs:Windows &prikaz PDF dokumenta\nsq:Lejoj Windows Desktop Search të &parashikojë dokumentet PDF\nsr-rs:Windows &приказ ПДФ документа\nsv:Visa förhandstitt av PDF-dokument i Windows\nta:விண்டாஸ் PDF கோப்புகளை காண்பிக்க &முன்னோட்டம் செய்யட்டும்\ntr:PDF belgelerini görüntülemek ve önizleme için Windows'a izin ver\ntw:讓 Windows 顯示 PDF 文件的預覽(&P)\nuk:Дозволити Windows здійснювати попередній перегляд для PDF\nuz:Windows yordamida PDF hujjatlarini oldindan &ko'rish\nvn:Cho phép Windows hiển thị hình ảnh &xem trước của các tài liệu PDF\n:MB\naf:MB\nam:ՄԲ\nar:م.ب\naz:MB\nbg:MB\nbn:এমবি\nbr:MB\nbs:MB\nby:MB\nca-xv:MB\nca:MB\ncn:MB\ncy:MB\ncz:MB\nde:MB\ndk:Mb\nel:MB\nes:MB\net:MB\neu:MB\nfa:مگابایت\nfi:Mt\nfr:Mo\nfy-nl:MB\nga:MB\ngl:MB\nhe:MB\nhi:MB\nhr:MiB\nhu:Mb\nid:MB\nit:MB\nja:MB\nka:მბ\nkr:MB\nku:مێگابایت\nkw:MB\nlt:MB\nlv:MB\nmk:MB\nml:MB\nmm:MB\nmy:MB\nne:एमबी\nnl:MB\nnn:MB\nno:MB\npa:MB\npl:MB\npt:MB\nro:MB\nru:Мб\nsi:MB\nsk:MB\nsl:MB\nsn:MB\nsp-rs:MB\nsq:MB\nsr-rs:MB\nsv:MB\nta:MB\nth:MB\ntl:MB\ntr:MB\ntw:MB\nuk:MB\nuz:MB\nvn:MB\n:Make SumatraPDF default application for PDF files?\naf:Maak Sumatra Die Automatiese Program Vir PDF Lêers?\nam:Հաստատե՞լ SumatraPDF-ն PDF ֆայլերը բացող հիմնական ծրագիր։\nar: المحمولة الافتراضي  لملفات المستندات المحمولة؟ Sumatra  جعل تطبيق مستندات\naz:SumatraPDF PDF faylların görüntülənməsi üçün standart proqram edilsin?\nbg:Искате ли да зададете SumatraPDF като основното си приложение за отваряне на PDF файлове?\nbn:সুমাত্রাপিডিএফ কে পিডিএফ সঞ্চিকাগুলির জন্য স্বাভাবিক অনুপ্রয়োগ রূপে নির্ধারণ করা হবে?\nbr:Fazer do SumatraPDF o programa padrão para arquivos PDF?\nbs:Postavi SumatraPDF za glavnu aplikaciju za PDF fajlove?\nby:Зрабіць SumatraPDF стандартнай праграмай прагляду PDF-файлаў?\nca-xv:Voleu que el SumatraPDF siga el visor predeterminat dels fitxers PDF?\nca:Voleu que el SumatraPDF sigui el visor predeterminat dels fitxers PDF?\ncn:把 SumatraPDF 作为默认的 PDF 阅读器?\ncy:Gosod SumatraPDF fel rhaglen rhagosodedig ar gyfer ffeiliau PDF?\ncz:Nastavit SumatraPDF jako výchozí prohlížeč PDF souborů?\nde:SumatraPDF als Standardanwendung für PDF-Dateien registrieren?\ndk:Gør SumatraPDF til standardprogrammet for PDF-filer\nel:Να γίνει το SumatraPDF το προεπιλεγμένο πρόγραμμα αρχείων PDF;\nes:¿Convertir SumatraPDF en la aplicación predeterminada para archivos PDF?\net:Tee SumatraPDF PDF-failide vaikerakenduseks?\neu:Egin SumatraPFD berezko aplikazioa PDF agirientzat?\nfa:پرونده‌های PDF همیشه با این برنامه خوانده شوند؟\nfi:Tee SumatraPDF:stä PDF-asiakirjojen oletuslukuohjelma?\nfr:Faire de SumatraPDF l’application par défaut pour les fichiers PDF ?\nfy-nl:SumatraPDF as standertlêzer fan PDF-bestannen ynstelle?\nga:Bíodh SumatraPDF mar an léitheoir PDF réamhshocruithe?\ngl:Facer o SumatraPDF a aplicación por defecto para arquivos PDF?\nhe:האם ברצונך להגדיר את SumatraPDF\\n כתוכנת ברירת מחדל לקובצי PDF?\nhi:सभी PDF फाईलें SumatraPDF में खोलें ?\nhr:Postaviti SumatruPDF pretpostavljenim preglednikom PDF datoteka?\nhu:Legyen a SumatraPDF az alapértelmezett PDF-megnyitó program?\nid:Jadikan SumatraPDF sebagai aplikasi standar untuk membuka berkas PDF?\nit:Impostare SumatraPDF come programma predefinito per i file PDF?\nja:SumatraPDF を PDF ファイルの既定のアプリケーションにしますか?\nka:ნამდვილად გსურთ SumatraPDF თქვენს ნაგულისხმევი PDF წამკითხველად დაყენება?\nkr:SumatraPDF를 PDF 파일의 기본 프로그램으로 만들까요?\nku:؟PDF وەکو بەرنامەی سەرەکی بۆ کردنەوەی فایلەکانی SumatraPDF ڕێکخستنی\nkw:Gul SumatraPDF towlen savonek rag restrennow PDF?\nlt:Ar nustatyti „SumatraPDF“ kaip numatytąją PDF žiūryklę?\nlv:Vai iestatīt SumatraPDF kā noklusējuma lietojumprogrammu PDF failiem?\nmk:Дали да ја направам SumatraPDF основна апликација за PDF-датотеки?\nmm:SumatraPDF ကို PDF ဖိုင်များဖွင့်ရန် အဖြစ်ပြုလုပ်လိုပါသလား။\nmy:Jadikan aplikasi SumatraPDF pembaca utama bagi fail PDF?\nne:SumatraPDF लाई PDF फाइलको पूर्वनिर्धारित अनुप्रयोग बनाउने?\nnl:SumatraPDF als standaardlezer van PDF-bestanden instellen?\nnn:Gjere SumatraPDF til standardprogram for PDF-filer?\nno:Gjøre SumatraPDF til standard åpningsprogram for PDF-filer?\npa:PDF ਫਾਈਲਾਂ SumatraPDF ਵਿੱਚ ਖੋਲੋ?\npl:Ustawić program SumatraPDF jako domyślną przeglądarkę plików PDF?\npt:Tornar SumatraPDF a aplicação principal para PDFs?\nro:Setați SumatraPDF ca program implicit pentru fișierele PDF?\nru:Сделать SumatraPDF программой просмотра PDF-файлов по умолчанию?\nsi:PDF ගොනු සදහා පෙරනිමි මෘදුකාංගය ලෙස SumatraPDF සකසන්නද?\nsk:Nastaviť SumatraPDF ako predvolený prehliadač PDF súborov?\nsl:Naj bo SumatraPDF privezti program za datoteke PDF?\nsp-rs:Postaviti SumatraPDF kao podrazumevanu aplikaciju za PDF datoteke?\nsq:SumatraPDF të jetë aplikacioni standard për skedat PDF?\nsr-rs:Поставити SumatraPDF као подразумевану апликацију за PDF датотеке?\nsv:Ställa in SumatraPDF som standardprogram för PDF-filer?\nta:சுமத்ராPDFயை கோட நிலை PDF படிப்பியாக மாற்றவா?\nth:ตั้ง SumatraPDF เป็นโปรแกรมมาตรฐานสำหรับเปิดไฟล์ PDF\ntl:Gawin ang SumatraPDF bilang default na pambukas ng mga PDF files?\ntr:SumatraPDF'i PDF dosyaları için varsayılan uygulama yapmak ister misiniz?\ntw:把 SumatraPDF 作為預設的 PDF 閱讀器?\nuk:Зробити SumatraPDF типовою програмою для PDF-файлів?\nuz:SumatraPDF PDF-fayllarni ko'rish andoza dasturi sifatida ishlatilsinmi?\nvn:Đặt SumatraPDF làm trình đọc PDF mặc định?\n:Make SumatraPDF my default PDF reader\naf:Maak Sumatra Die Automatiese PDF Leser\nam:Ասոցիացնել PDF ֆայլերը SumatraPDF-ի հետ\nar:المحمولة  قارئ المستندات المحمولة الافتراضي Sumatra جعل  مستندات \naz:SumatraPDF-i PDF fayllarla əlaqələndir\nbg:Направи SumatraPDF четец на PDF по подразбиране\nbn:সুমাত্রাপিডিএফ কে আপনার স্বাভাবিক পঠক রূপে নির্ধারণ\nbr:Tornar o SumatraPDF o leitor PDF padrão\nbs:Učini SumatraPDF mojim glavnim čitačem PDF fajlova\nby:Зрабіць SumatraPDF чытальнікам PDF па-змаўчанні\nca-xv:Fes el SumatraPDF el lector de PDF predeterminat\nca:Fes el SumatraPDF el lector de PDF predeterminat\ncn:将 SumatraPDF 设置为默认的 PDF 阅读器\ncy:Gosod SumatraPDF fel y darllenydd PDF rhagosodedig\ncz:Nastavit SumatraPDF jako výchozí PDF prohlížeč\nde:Standardmäßig PDF-Dateien mit SumatraPDF öffnen\ndk:Gør SumatraPDF til min standardlæser for PDF-filer\nel:Συσχετισμός του SumatraPDF με τα αρχεία PDF\nes:Convertir SumatraPDF el lector PDF predeterminado\net:Tee SumatraPDF PDF-failide vaikerakenduseks\neu:Egin SumatraPDF nire berezko PDF irakurlea\nfa:انتخاب SumatraPDF به عنوان برنامه‌ی پیش‌فرض من برای خواندن اسناد PDF\nfi:Tee SumatraPDF:stä PDF-asiakirjojen oletuslukuohjelma\nfr:Définir SumatraPDF comme lecteur PDF par défaut\nfy-nl:SumatraPDF as standert PDF-lêzer ynstelle\nga:Bíodh SumatraPDF mar an léitheoir PDF réamhshocruithe\ngl:Facer do SumatraPDF o lector PDF predefinido\nhe:הגדר את SumatraPDF כתוכנת ברירת מחדל לקובצי PDF\nhi:सभी PDF फाईलें SumatraPDF में खोलें\nhr:Neka SumatraPDF bude pretpostavljeni preglednik PDF datoteka\nhu:SumatraPDF mint alapértelmezett PDF olvasó\nid:Jadikan SumatraPDF sebagai pembaca PDF utama\nit:Imposta SumatraPDF come lettore PDF predefinito\nja:SumatraPDF を規定の PDF リーダーにする\nka:მოხდეს SumatraPDF-ის ასოცირება PDF ფაილებთან\nkr:SumatraPDF를 기본 PDF 리더로 만들기\nku:ڕێکخستنی ئەم بەرنامەیە وەکو خوێنەرەوەی سەرەکی فایلەکانی PDF\nkw:Gwra SumatraPDF ow fennredyer PDF\nlt:„SumatraPDF“ nustatymas numatytąja PDF žiūrykle\nlv:Padarīt SumatraPDF par manu noklusējuma PDF lasītāju\nmk:Направи ја SumatraPDF основен читач на PDF\nml:സുമാത്രാപിഡീഎഫ് നിങ്ങളു PDF ഫയല്‍ വായിക്കാനുള്ള മുഖ്യ പ്രോഗ്രാം ആക്കുക\nmm:စူမာတရာ PDF ကြည့်ရာကို အဓိကအဖြစ် အသုံးပြုရန်\nmy:Jadikan SumatraPDF pembaca utama PDF\nne:SumatraPDF लाई PDF फाइलको पूर्वनिर्धारित अनुप्रयोग बनाउनुहोस्\nnl:SumatraPDF als standaard PDF-lezer instellen\nnn:Bruk SumatraPDF som standard PDF-lesar\nno:Bruk SumatraPDF som standard PDF-leser\npa:ਸਾਰੀਂਆ  PDF ਫਾਈਲਾ SumatraPDF ਵਿਚ ਖੋਲੋ\npl:Ustaw SumatraPDF jako domyślną przeglądarkę PDF\npt:Tornar SumatraPDF o leitor principal dos PDF\nro:Setați SumatraPDF ca cititor implicit de PDF\nru:Ассоциировать SumatraPDF с файлами PDF\nsi:SumatraPDF ප්‍රධාන PDF කියවනය ලෙස සකසන්න\nsk:Nastaviť SumatraPDF ako predvolený PDF prehliadač\nsl:SumatraPDF naj bo privzeti bralnik PDF\nsn:Ita SumatraPDF igovhura maPDF ese\nsp-rs:Neka SumatraPFD bude podrazumevani PDF čitač\nsq:SumatraPDF të jetë lexuesi standard i PDF-ve\nsr-rs:Нека SumatraPFD буде подразумевани PDF читач\nsv:Använd SumatraPDF som standardläsare för PDF\nta:சுமத்ராPDFயை முன்னிருப்பு PDF படிப்பியாக பதிவு செய்\nth:ตั้ง SumatraPDF ตั้งเป็นโปรแกรมหลักสำหรับเปิดไฟล์ PDF\ntl:Gawin ang SumatraPDF bilang default na pambukas ng mga PDF files\ntr:Varsayılan PDF okuyucusu yap\ntw:把 SumatraPDF 作為預設的 PDF 閱讀工具\nuk:Зробити SumatraPDF переглядачем PDF за замовчуванням\nuz:SumatraPDF PDF fayllar bilan bog'lanish\nvn:Đặt SumatraPDF làm trình đọc PDF chính\n:Man&ga Mode\nam:Man&ga եղանակ\nar:نمط Man&ga \naz:Man&qa rejimi\nbg:Режим за ман&га\nbr:Modo Man&gá\nbs:Man&ga režim\nca-xv:Mode man&ga\nca:Mode man&ga\ncn:漫画模式(&G)\ncy:Modd &Manga\ncz:Man&ga režim\nde:Lese&richtung umkehren\ndk:Man&ga-tilstand\nel:Λειτουργία Manga\nes:Modo man&ga\net:Man&garežiim\neu:Ma&nga Modua\nfa:حالت مانگا\nfi:Man&ga-moodi\nfr:Mode man&ga\nga:Mód Man&ga\ngl:Modo Man&ga\nhe:מצב Manga\nhr:Man&ga način\nhu:Manga mód\nid:Mode komik\nit:Modo Man&ga\nja:漫画モード(&G)\nka:მან&გას რეჟიმი\nkr:만화 방식(&G)\nku:Man&ga شێوازی\nlv:&Manga režīms\nmk:Режим за Man&ga\nmy:Mode Man&ga\nnl:Man&gamodus\nnn:Man&ga-vising\nno:Man&ga-modus\npl:Tryb mangi\npt:Modo man&ga\nro:Mod man&ga\nru:Режим Man&ga\nsk:Man&ga mód\nsl:Način Man&ga\nsp-rs:Manga mod\nsq:Mënyra Man&ga\nsr-rs:Ман&га мод\nsv:Man&ga Läge\nta:மேங்கா முறை\ntr:Man&ga modu\ntw:漫畫模式(&G)\nuk:Режим манги\nuz:Man&ga usuli\nvn:Kiểu &Manga\n:Match Case\naf:Vind Bypassende Klein Letters / Hoofletters\nam:Հաշվի առնել մեծատառ/փոքրատառը\nar:مطابقة حالة الأحرف\naz:Registri nəzərə al\nbg:Същия текст\nbn:অক্ষরের আকার মেলান\nbr:Diferenciar minúsculas e maiúsculas\nbs:Razlikuj velika i mala slova\nby:Улічваць рэгістр\nca-xv:Distigeix entre majúscules i minúscules\nca:Distigeix entre majúscules i minúscules\ncn:大小写匹配\ncy:Cydweddu Maint\ncz:Rozlišovat velikost písmen\nde:Groß-/Kleinschreibung beachten\ndk:Versalfølsom søgning\nel:Αντιστοίχιση πεζών-κεφαλαίων\nes:Coincidir mayúsculas y minúsculas\net:Tõstutundlik\neu:Hizki Larriak-xeheak Bereizi\nfa:دقیقا مثل عبارت وارد شده\nfi:Sama kirjainkoko\nfr:Respecter la casse\nfy-nl:Haadlettergefoelich\nga:Comhoiriúnaigh an cás\ngl:Coincidir maiúsculas e minúsculas\nhe:הבחן בין אותיות גדולות לקטנות\nhi:अक्षर आकार मिलाएं\nhr:Razlikuj velika i mala slova\nhu:Kis- és nagybetűk megkülönböztetése\nid:Cocokkan Ukuran Huruf\nit:Maiuscole/minuscole\nja:大文字と小文字を区別する\nka:მთავრულის გათვალისწინებით\nkr:대/소문자 구분\nku:ئەنجامی هاوشێوە\nkw:An keth kas\nlt:Skirti didžiąsias ir mažąsias raides\nlv:Saskaņot reģistru\nmk:Разликувај мали и големи букви\nmm:တူညီ သော\nmy:Hampir sama\nne:केस मिलाउनुहोस्\nnl:Hoofdlettergevoelig\nnn:Skil mellom store/små bokstavar\nno:Skill mellom store og små bokstaver\npa:ਅੱਖਰ ਅਕਾਰ ਮਿਲਾਓ\npl:Uwzględnij wielkość liter\npt:Sensível a maiúsculas\nro:Potrivire literele mari și mici\nru:Учитывать регистр\nsi:ගැළපෙන අවස්ථාව\nsk:Rozlišovať veľké/malé písmená\nsl:Razlikuj med velikimi/malimi črkami\nsn:Fananidza kesi\nsp-rs:Razlikuj mala i velika slova\nsq:Krahasoj madhësinë e shkrimit\nsr-rs:Разликуј мала и велика слова\nsv:Matcha versaler/gemener\nta:தட்டுப்பொருத்தம்\ntl:Ipantay ang Laki ng Titik\ntr:Büyük/Küçük harf eşleştir\ntw:符合大小寫\nuk:Розрізняти малу й велику літери\nuz:Registrni hisobga olish\nvn:Phân biệt HOA-thường\n:Mobi documents\nam:XPS ֆայլեր\nar:وثائق Mobi\naz:Mobi sənədləri\nbg:Mobi документи\nbr:Documentos Mobi\nbs:Mobi dokumenti\nca-xv:Documents Mobi\nca:Documents Mobi\ncn:Mobi 文档\ncy:Dogfennau Mobi\ncz:Dokumenty Mobi\nde:Kindle E-Bücher\ndk:Mobi-dokumenter\nel:Έγγραφα Mobi\nes:Documentos en formato Mobi\net:Mobi-dokumendid\neu:Mobi agiriak\nfa:Mobi اسناد\nfi:Mobi-asiakirjat\nfr:Fichiers Mobi\nfy-nl:Mobi-bestannen\nga:Cáipéisí Mobi\ngl:Documentos Mobi\nhe:קובצי Mobi\nhi:Mobi दस्तावेज़\nhr:Mobi dokumenti\nhu:Mobi fájlok\nid:Dokumen Mobi\nit:Documenti Mobi\nja:Mobi ドキュメント\nka:Mobi დოკუმენტები\nkr:Mobi 문서\nku:Mobi بەڵگەنامەکانی\nlt:Mobi dokumentai\nlv:Mobi dokumenti\nmk:Mobi-документи\nmy:Dokumen Mobi\nne:Mobi कागजातहरु\nnl:Mobi-documenten\nnn:Mobi-dokumentar\nno:Mobi-dokumenter\npl:Dokumenty Mobi\npt:Documentos Mobi\nro:Documente Mobi\nru:Документы Mobi\nsk:Mobi dokumenty\nsl:Mobi dokumenti\nsp-rs:Mobi dokumenti\nsq:Dokumente Mobi\nsr-rs:Mobi документи\nsv:Mobi-dokument\nta:Mobi ஆவணங்கள்\ntr:Mobi belgeleri\ntw:Mobi 文件\nuk:Документи Mobi\nuz:Mobi hujjatlari\nvn:Tập tin Mobi\n:Modified:\naf:Aangepas:\nam:Փոփոխված՝\nar:التعديل\naz:Dəyişiklik tarixi:\nbg:Променен:\nbr:Modificado:\nbs:Izmijenjeno:\nca-xv:Modificat:\nca:Modificat:\ncn:修改时间:\ncy:Newidwyd:\ncz:Změněno:\nde:Geändert am:\ndk:Ændret:\nel:Τροποποιήθηκε:\nes:Modificado:\net:Muudetud:\neu:Aldatuta:\nfa:اصلاح شده:\nfi:Muuttanut:\nfr:Modifié le :\nfy-nl:Oanpast:\nga:Mionathraithe:\ngl:Modificado:\nhe:שונה:\nhi:संशोधित\nhr:Promijenjeno:\nhu:Módosítva:\nid:Termodifikasi:\nit:Data ultima modifica:\nja:変更日時:\nka:შეცვლილია:\nkr:고친 날짜:\nku:دەستکاریکراو:\nlt:Keistas:\nlv:Modificēts:\nmk:Изменето на:\nml:പരിഷ്കരിച്ചത്\nmy:Diubah:\nne:परिमार्जित:\nnl:Aangepast:\nnn:Endrast:\nno:Endret:\npl:Zmodyfikowano:\npt:Modificado:\nro:Modificat:\nru:Изменён:\nsi:වෙනස්කලා:\nsk:Upravené:\nsl:Spremenjeno:\nsp-rs:Izmenjena:\nsq:Modifikuar më:\nsr-rs:Измењена:\nsv:Ändrad:\nta:மாற்ற்ப்பட்தது\ntl:Nabago noong:\ntr:Değiştirilme tarihi:\ntw:檔案更新日期:\nuk:Змінено:\nuz:O'zgartirilgan:\nvn:Ngày chỉnh sửa\n:New version %s is available. Download new version?\naf:Nuwe Weergawe %s Is Beskikbaar. Laai Die Nuwe Weergawe Af?\nam:Հասանելի է նոր՝ %s տարբերակը։ Ներբեռնե՞լ նոր տարբերակը։\nar:يوجد نسخة جديدة    %s . هل تريد تحميلها؟\naz:Yeni versiya %s mövcuddur. Endirilsin?\nbg:Достъпна е нова версия %s. Искате ли да я свалите?\nbn:নতুন সংস্করণ %s উপলব্ধ হয়েছে। নতুন সংস্করণ অধঃভরণ করা হবে?\nbr:A versão %s está disponível. Baixar a nova versão?\nbs:Dostupna je nova verzija (%s). Preuzeti novu verziju?\nby:Даступная новая версія: %s. Загрузіць яе?\nca-xv:Es troba disponible una versió nova %s. Voleu baixar-la?\nca:Es troba disponible una versió nova %s. Voleu baixar-la?\ncn:最新版本 %s。 是否下载新版本?\ncy:Mae fersiwn newydd o %s ar gael. Llwytho'r fersiwn newydd i lawr??\ncz:Nová verze %s je k dispozici. Stáhnout novou verzi?\nde:Es ist die neue Version %s vorhanden. Möchten Sie diese herunterladen?\ndk:Ny version %s er tilgængelig. Hent ny version?\nel:Η νέα έκδοση %s είναι διαθέσιμη. Να γίνει λήψη;\nes:Está disponible la nueva versión %s. ¿Desea descargarla?\net:Uus %s versioon on saadaval. Kas laadin alla uue versiooni?\neu:%s bertsio berria eskuragarri dago. Jeitsi bertsio berria?\nfa:نسخه جدید %s موجود است. آن را دریافت می‌کنید؟\nfi:Uudempi versio %s saatavilla. Ladataanko uudempi versio?\nfr:La version %s est disponible. Télécharger la nouvelle version ?\nfy-nl:Nije ferzje %s is beskikber. Wolle jo dizze ynlade?\nga:Tá an leagan nua %s ar fáil. Íosluchtaigh an leagan nua?\ngl:A nova versión %s está dispoñible. ¿Desexa obtela?\nhe:גרסה חדשה (%s) זמינה. ברצונך להורידה?\nhi:संसकरण %s उपलब्ध है । डाउनलोड करूँ ?\nhr:Dostupna je nova inačica (%s). Preuzeti novu inačicu?\nhu:Új verzió érhető el: (%s). Kívánja letölteni?\nid:Versi baru %s telah tersedia. Unduh versi baru ini?\nit:È disponibile la versione %s. Scaricare la nuova versione?\nja:新しいバージョン %s が利用可能です。新しいバージョンをダウンロードしますか？\nka:ხელმიწვდომია ახალი ვერსია %s. გსურთ მისი ჩამოტვირთვა?\nkr:새 버전 %s (이)가 사용 가능합니다.  다운로드할까요?\nku:وەشانی نوێی %s ئامادەیە. داگرتنی وەشانی نوێ؟\nkw:Versyon nowyth %s yw parys. Iskarga versyon nowyth?\nlt:Yra nauja %s versija. Atsiųsti naują versiją?\nlv:Ir pieejama jauna versija %s. Vai lejupielādēt jauno versiju?\nmk:Нова верзија %s е достапна. Сакате да ја преземам?\nmy:Versi terbaru %s tersedia. Muat turun versi terbaru?\nne:नया संस्करण %s उपलब्ध छ | डाउनलोड गर्ने?\nnl:Nieuwe versie %s is beschikbaar. Wilt u deze downloaden?\nnn:Ny versjon (ver. %s) tilgjengeleg. Laste ned?\nno:En ny versjon %s er tilgjenglig. Vil du laste den ned nå?\npa:ਨਵਾ ਵਰਜਨ %s ਓੁਪਲਭਧ ਹੈ । ਡਾਓੂਨਲੋਡ ਕਰਾਂ ?\npl:Nowa wersja %s jest dostępna. Pobrać nową wersję?\npt:Está disponível a nova versão %s. Transferir?\nro:O nouă versiune %s este disponibilă. Descărcați versiunea nouă?\nru:Доступна новая версия: %s. Загрузить её?\nsi:%s නව වෙලුමක්  ඇත. නව වෙළුම බාගතකරන්නද?\nsk:Nová verzia %s je k dispozícii. Stiahnuť novú verziu?\nsl:Na voljo je nova različica %s. Jo želite prenesti?\nsn:Version %s ririkuwanika. Unoda here version idzva?\nsp-rs:Dostupna je verzija %s. Želite li da preuzmete novu verziju?\nsq:Ka dalë versioni i ri %s. Do e shkarkoni?\nsr-rs:Доступна је верзија %s. Желите ли да преузмете нову верзију?\nsv:Nyare version %s tillgänglig. Ladda ner den?\nta:புதிய பதிப்பு %s பதிவிறக்க இருக்கிறது. பதிவிரக்கம் செய்யவா?\nth:เวอร์ชั่นใหม่ %s ออกแล้ว ต้องการดาวน์โหลดหรือไม่\ntl:May bagong bersyon: %s. I-download?\ntr:Yeni sürüm %s dağıtıma sunulmuştur. İndirmek ister misiniz?\ntw:最新版本 %s。 是否下載新版本?\nuk:Нова версія %s є доступною. Завантажити нову версію?\nuz:Yangi versiya mavjud: %s. Yuklab olinsinmi?\nvn:Đã có phiên bản mới %s. Tải về phiên bản mới?\n:Next Page\naf:Volgende Bladsy\nam:Հաջորդ էջը\nar:الصفحة التالية\naz:Sonrakı səhifə\nbg:Следваща страница\nbn:পরবর্তী পৃষ্ঠা\nbr:Página seguinte\nbs:Sljedeća stranica\nby:Наступная старонка\nca-xv:Pàgina següent\nca:Pàgina següent\ncn:下一页\ncy:Tudalen Nesaf\ncz:Další stránka\nde:&Nächste Seite\ndk:Næste side\nel:Επόμενη σελίδα\nes:Página siguiente\net:Järgmine lehekülg\neu:Hurrengo Orrialdea\nfa:صفحه‌ی بعدی\nfi:Seuraava sivu\nfr:Page suivante\nfy-nl:Folgjende side\nga:Leathanach Ar Aghaidh\ngl:Páxina seguinte\nhe:עמוד הבא\nhi:अगले पृष्ठ पर\nhr:Sljedeća stranica\nhu:Következő oldal\nid:Halaman Berikutnya\nit:Pagina successiva\nja:次のページ\nka:შემდეგი გვერდი\nkr:다음 페이지\nku:پەڕەی دواتر\nkw:Nessa Folen\nlt:Kitas puslapis\nlv:Nākamā lappuse\nmk:Следна страница\nml:അടുത്ത താള്‍\nmm:နောက် တမျက်နှာ\nmy:Mukasurat seterusnya\nne:अर्को पृष्ठ\nnl:Volgende pagina\nnn:Neste side\nno:Neste side\npa:ਅਗਲੇ ਪੰਨੇ ਤੇ\npl:&Następna strona\npt:Página seguinte\nro:Pagina următoare\nru:Следующая страница\nsi:මීළග පිටුව\nsk:Ďalšia strana\nsl:Naslednja stran\nsn:Peji yemberi\nsp-rs:Sledeća stranica\nsq:Faqja tjetër\nsr-rs:Следећа страница\nsv:Nästa sida\nta:அடுத்த பக்கம்\nth:หน้าถัดไป\ntl:Sunod na Pahina\ntr:Sonraki Sayfa\ntw:下一頁\nuk:Наступна сторінка\nuz:Keyingi bet\nvn:Trang sau\n:No matches were found\nam:Ոչինչ չի գտնվել\nar:لا توجد متطابقات\naz:Uyğun mətn tapılmadı\nbg:Няма съвпадения\nbr:Nenhuma ocorrência encontrada\nbs:Pojam nije pronađen\nby:Узор не знойдзены\nca-xv:No s'han trobat coincidències\nca:No s'han trobat coincidències\ncn:没有找到匹配项\ncy:Heb ganfod cyfatebiad\ncz:Žádná položka nebyla nalezena\nde:Suchbegriff nicht gefunden\ndk:Ingen resultater blev fundet\nel:Δε βρέθηκε το κείμενο\nes:No se encontraron coincidencias\net:Otsitavat teksti ei leitud\neu:Ez da emaitzik aurkitu\nfa:موردی یافت نشد\nfi:Osumia ei löytynyt\nfr:Aucun résultat n'a été trouvé\nfy-nl:Gjin sykresultaat fûn\nga:Níor aimsíodh comhionanna\ngl:Non se atoparon coincidencias\nhe:לא נמצאו התאמות\nhi:कोई मिलान नहीं मिला\nhr:Pojam nije pronađen\nhu:Nem található a dokumentumban\nid:Tidak ditemukan kesamaan\nit:Nessuna corrispondenza trovata\nja:一致が見つかりませんでした\nka:სიტყვა არ მოიძებნა\nkr:일치하는 항목을 찾을 수 없습니다.\nku:هیچ ئەنجامێک نەدۆزرایەوە\nkw:Ny veu keyvys par vyth\nlt:Nerasta atitikmenų\nlv:Netika atrasta neviena atbilstība\nmk:Не се пронајдени совпаѓања\nml:തുല്യമായത് കണ്ടില്ല\nmy:Tiada padanan dijumpai\nne:जोडाहरु प्राप्त भएन\nnl:Geen zoekresultaat gevonden\nnn:Ingen treff blei funnet\nno:Søkeelementet ble ikke funnet\npl:Nie znaleziono wyników\npt:Nenhuma ocorrência encontrada\nro:Nu s-au găsit rezultate\nru:Совпадений не найдено\nsi:සෙවුම් යතුර සොයාගැනීමට නොහැකි විය\nsk:Nenájdené podľa zodpovedajúcich kritérií\nsl:Ni zadetkov\nsn:hapana zvakafanana zvawanikwa\nsp-rs:Pojam nije pronađen\nsq:Nuk ka ngjashmëri\nsr-rs:Појам није пронађен\nsv:Inga träffar hittades\nta:ஒரு பொருத்தமும் இல்லை\ntl:Walang makitang kapareha\ntr:Sonuç bulunamadı\ntw:找不到結果\nuk:Співпадінь не виявлено\nuz:Mos keladigan topilmadi\nvn:Không tìm thấy\n:No result found around line %u in file %s\nam:Ոչինչ չի գտնվել %u տողում %s ֆայլի\nar:لم يتم العثور على نتائج حول السطر %u في الملف %s\naz:%u sətrinə uyğun olan nəticə %s faylında tapılmadı\nbg:Няма резултати около ред %u във файла %s\nbr:Nenhum resultado próximo à linha %u no arquivo %s\nbs:Nema rezultata oko %u. linije u fajlu %s\nby:Вынік, які адпавядае радку %u у файле %s, не знойдзены\nca-xv:No s'ha trobat cap resultat de la cerca vàlid a la línia %u al fitxer %s\nca:No s'ha trobat cap resultat de cerca vàlid a la línia %u al fitxer %s\ncn:在第 %u 行附近 (文件 %s) 未找到目标\ncy:Dim canlyniad o liell %u yn ffeil %s\ncz:Kolem řádku %u v souboru %s nebyl nalezen žádný výsledek\nde:In der Nähe von Zeile %u in der Datei %s wurde kein Resultat gefunden\ndk:Intet resultat fundet omkring linje %u i filen %s\nel:Δε βρέθηκε αποτέλεσμα στη γραμμή %u του αρχείου %s\nes:No se encontró resultado cerca de la línea %u en el archivo %s\net:Tulemusi ei leitud rea %u lähedalt failis %s\neu:Ez da emaitzik aurkitu %u lerro inguran %s agirian\nfa:هیچ نتیجه‌ای در خط %u در پرونده‌ی %s یافت نشد\nfi:Tulosta ei löytynyt rivin %u ympäriltä tiedostossa %s\nfr:Aucun résultat trouvé autour de la ligne %u dans le fichier %s\nga:Níor aimsíodh toradh idir líne %u sa chomhad %s\ngl:Non se atopou resultado arredor da liña %u no ficheiro %s\nhe:לא נמצאה תוצאה במתחם שורה %u בקובץ %s\nhi:रेखा %u के आसपास फ़ाइल %s में कोई परिणाम नहीं मिला\nhr:Nema rezultata oko %u. retka u datoteci %s\nhu:Nincs találat a %u. sor körül ebben a fájlban: %s\nid:Tidak ditemukan hasil pada baris %u di dalam berkas %s\nit:Nessun risultato trovato intorno alla riga %u nel file %s\nja:行 %u はファイル %s に見つかりません\nkr:%u 행 (%s 파일) 주변에서 발견된 결과가 없습니다.\nku:%u هیچ ئەنجامێک نەدۆزرایەوە لە دێڕی %s لە فایلی\nkw:Ny veu kevys sywyans vyth a-dro dhe linen %u y'n restren %s\nlt:Aplink eilutę %u faile %s nerasta jokių rezultatų\nlv:Rezultāts nav atrasts %u līnijā %s failā\nmk:Не најдов резултати околу линијата %u во датотеката %s\nmy:Tiada hasil ditemui di sekitar baris %u dalam fail %s\nne:पङ्क्ति %u (फाइल %s को) वरपर कुनै नतिजा फेला परेन\nnl:Geen resultaat gevonden bij regel %u in bestand %s\nnn:Ingen resultat funnet omkring linje %u i fila %s\nno:Ingen resultater funnet rundt linje %u i filen %s\npl:Nie znaleziono wyników w okolicach wiersza %u w pliku %s\npt:Nenhum resultado perto da linha %u no ficheiro %s\nro:Nici un rezultat în jurul liniei %u în fișierul %s\nru:Результат, соответствующий строке %u в файле %s, не найден\nsk:Nenájdené žiadne výsledky na riadku %u v súbore %s\nsl:Okoli vrstice %u v datoteki %s ni zadetkov\nsp-rs:Rezultati oko linije %u u datoteci %s nisu pronađeni\nsq:Pa rezultat në radhën %u te skeda %s\nsr-rs:Резултати око линије %u у датотеци %s нису пронађени\nsv:Inget resultat hittades vid rad %u i filen %s\nta:%u வரியில் %s கோப்பில் முடிவுகள் கிடைக்கவில்லை\ntl:Walang nakitang resulta sa line %u ng file %s\ntr:%u satırı etrafında %s dosyasındaki sonuç bulunamadı\ntw:在第 %u 行附近（檔案 %s）找不到目標\nuk:Нічого не знайдено у лінії %u у файлі %s\nuz:%u satriga %s faylida mos keladigan natija topilmadi\nvn:Không tìm thấy gì quanh dòng %u trong tập tin %s\n:No synchronization file found\nam:Չեն գտնվել համանման ֆայլեր\nar:لاتوجد مزامنة للملف\naz:Sinxronlaşdırma faylı tapılmadı\nbg:Файлът за синхронизация не е намерен\nbr:Nenhum arquivo de sincronização foi encontrado\nbs:Sinhronizacijski fajl nije pronađen\nca-xv:No s'ha trobat el fitxer de sincronització\nca:No s'ha trobat el fitxer de sincronització\ncn:未发现同步文件\ncy:Heb ganfod ffeil cydweddu\ncz:Soubor synchronizace nebyl nalezen\nde:Synchronisationsdatei nicht gefunden\ndk:Ingen synkroniseringsfil fundet\nel:Δε βρέθηκε αρχείο συγχρονισμού\nes:No se encontró archivo de sincronización\net:Sünkroniserimisfaili ei leitud\neu:Aldiberetze agiria ez da aurkitu\nfa:پرونده همگام‌سازی موجود نیست\nfi:Synkronointitiedostoa ei löytynyt\nfr:Aucun fichier de synchronisation trouvé\nfy-nl:Gjin syngronisaasjebestân fûn\nga:Níor aimsíodh comhad comhaimseartha\ngl:Non se atopou ficheiro de sincronización\nhe:לא נמצא קובץ סנכרון.\nhi:कोई तुल्यकालन फाइल नहीं मिला\nhr:Datoteka usklađivanja nije pronađena\nhu:Nem található szinkronizációs fájl\nid:Tidak ada berkas sinkronisasi ditemukan\nit:Non è stato trovato il file di sincronizzazione\nja:同期ファイルが見つかりません\nka:სინქრონიზაციის ფაილი ვერ მოიძებნა\nkr:동기화 파일을 찾을 수 없습니다.\nku:هیچ فایلێکی هاوکاتکردن نەدۆزرایەوە\nkw:Ny veu kevys restren gettermynegi vyth\nlt:Sinchronizacijos failas nerastas\nlv:Sinhrizācijas fails nav atrasts\nmk:Не најдов синхронизациска датотека\nmy:Tiada fail penyegerakan ditemui\nne:कुनै समक्रमण फाइल भेटिएन्\nnl:Geen synchronisatiebestand gevonden\nnn:Ingen synkroniseringsfil blei funna\nno:Ingen synkroniseringsfil funnet\npl:Nie znaleziono pliku synchronizacji\npt:Nenhum ficheiro de sincronização encontrado\nro:Nu s-a găsit fișier de sincronizare\nru:Файл синхронизации не найден\nsi:සමකාලනයකල ගොනුවක් සොයාගැනීමට නොහැකි විය\nsk:Súbor synchronizácie nenájdený\nsl:Datoteka sinhronizacije ni bila najdena\nsp-rs:Usklađivačka datoteka nije nađena\nsq:Nuk gjen skedën e sinkronizimit\nsr-rs:Усклађивачка датотека није нађена\nsv:Ingen synkroniseringsfil hittad\nta:ஒத்தியங்கு கோப்பு எதுவும் கண்டுபிடிக்கவில்லை\ntl:Walang makitang synchronization file\ntr:Herhangi bir senkronizasyon dosyası bulunamadı\ntw:找不到同步檔案\nuk:Файли синхронізації не знайдено\nuz:Sinxronlanish fayli topilmadi\nvn:Không tìm thấy tập tin đồng bộ nào\n:No synchronization info at this position\nam:Այստեղ չկա համաժամեցնելու համար տեղեկություն\nar:لا معلومات تزامن في هذا الموقع\naz:Bu mövqedə sinxronlaşdırma məlumatı yoxdur\nbg:В тази позиция няма информация за синхронизация\nbr:Não há informação de sincronização nesta posição\nbs:Nema sinhronizacijskih podataka na ovoj poziciji\nby:У гэтай пазіцыі адсутнічае інфармацыя для сінхранізацыі\nca-xv:No hi ha informació de sincronització en esta posició\nca:No hi ha informació de sincronització en aquesta posició\ncn:此位置没有同步信息\ncy:Dim gwybodaeth cydweddu yn y fan hon\ncz:Na této pozici není informace o synchronizaci\nde:Keine Synchronisationsinformationen verfügbar\ndk:Ingen synkroniseringsinformation på denne position\nel:Δε βρέθηκαν πληροφορίες συγχρονισμού στη θέση αυτή\nes:No hay información de sincronización en esta posición\net:Sellel kohal ei ole sünkroniseerimisinfot\neu:Ez dago aldiberetze argibiderik toki honetan\nfa:هیچ اطلاعاتی در این محل همگام نشد\nfi:Tällä sijainnilla ei ole synkronisointitietoja\nfr:Aucune information de synchronisation à cette position\nfy-nl:Gjin syngronisaasjeynformaasje beskikber\nga:Níl faisnéis chomhaimseartha ag an suíomh seo\ngl:Non hai datos de sincronización nesta posición\nhe:לא נמצא מידע סנכרון במיקום זה.\nhi:इस स्थिति में कोई तुल्यकालन जानकारी नहीं है\nhr:Nema podatka o usklađenosti na ovom mjestu\nhu:Nem található szinkronizálási információ az adott pozícióhoz\nid:Tidak ada informasi sinkronisasi pada lokasi ini\nit:Nessuna informazione di sincronizzazione in questa posizione\nja:この位置に同期情報がありません\nka:ამ პოზიციაზე სინქრონიზაციის ინფორმაცია არ არის\nkr:이 위치의 동기화 정보가 없습니다.\nku:هیچ زانیارییەکی هاوکاتکردن نیە لەم شوێنەدا\nkw:Ny veu kevys derivadow kettermynegi y'n le ma\nlt:Nėra sinchronizacijos informacijos šioje pozicijoje\nlv:Sinhronizācijas fails nav atrasts šajā pozīcijā\nmk:Нема информации за синхронизација на оваа позиција\nmy:Tiada maklumat penyelarasan pada kedudukan ini\nne:यो स्थानमा समक्रमण जानकारी छैन\nnl:Geen synchronisatieinformatie beschikbaar\nnn:Ingen synkroniseringsinfo på denne posisjonen\nno:Ingen synkroniseringsinfo her\npl:Brak informacji o synchronizacji w tej pozycji\npt:Não há informações de sincronização nesta posição\nro:Nu există informație de sincronizare la această poziție\nru:В этой позиции нет информации для синхронизации\nsi:සමකාලනය කිරීමේ තොරතුරු මේ අවස්ථාවේ නැත\nsk:Chýba informácia o synchronizácii\nsl:Na tem mestu ni sinhronizacijskih podatkov\nsp-rs:Nema podataka o usklađenosti na ovoj poziciji\nsq:Nuk ka info për sinkronizimin në këtë pozicion\nsr-rs:Нема података о усклађености на овој позицији\nsv:Synkroniseringsinformation saknas här\nta:ஒத்தியங்கு தகவல் எதுவும் இந்த நிலையில் இல்லை\ntl:Walang makitang detalye ng synchronization dito\ntr:Bu konumda senkronizasyon bilgisi mevcut değildir\ntw:沒有同步資料\nuk:Немає Інформації про синхронізацію на цій позиції\nuz:Bu joyda sinxronlanish ma'lumoti yo'q\nvn:Không có thông tin đồng bộ ở chỗ này\n:Number of Pages:\nam:Էջերի քանակը.\nar:عدد الصفحات\naz:Səhifə sayı:\nbg:Брой страници:\nbr:Número de páginas:\nbs:Broj stranica:\nca-xv:Nombre de pàgines:\nca:Nombre de pàgines:\ncn:页数:\ncy:Nifer o Dudalennau:\ncz:Počet stránek:\nde:Anzahl der Seiten:\ndk:Antal sider:\nel:Αριθμός σελίδων:\nes:Número de páginas:\net:Lehekülgede arv:\neu:Orrialde Zenbatekoa:\nfa:تعداد صفحات:\nfi:Sivujen määrä:\nfr:Nombre de pages :\nfy-nl:Oantal sides:\nga:Líon na leathanaigh:\ngl:Número de Páxinas:\nhe:מספר עמודים:\nhi:पृषठ संख्या\nhr:Broj stranica:\nhu:Oldalak száma:\nid:Banyak Halaman:\nit:Numero pagine:\nja:ページ数:\nka:გვერდების რაოდენობა:\nkr:페이지 수:\nku:ژمارەی پەڕەکان:\nlt:Puslapių skaičius:\nlv:Lappušu skaits:\nmk:Број на страници:\nml:താളുകളുടെ എണ്ണം\nmy:Jumlah mukasurat:\nne:पृष्ठ संख्या:\nnl:Aantal pagina's:\nnn:Antal sider:\nno:Antall sider:\npl:Liczba stron:\npt:Número de páginas:\nro:Număr de pagini:\nru:Число страниц:\nsi:පිටු සංඛ්‍යාව\nsk:Počet strán:\nsl:Število strani:\nsp-rs:Broj stranica:\nsq:Numri i faqeve:\nsr-rs:Број страница:\nsv:Antal sidor:\nta:பக்கங்களின் எண்ணிக்கை\ntl:Bilang ng mga pahina:\ntr:Sayfa sayısı:\ntw:頁數：\nuk:Кількість сторінок:\nuz:Betlar soni:\nvn:Số trang:\n:OK\naf:OK\nam:ԼԱՎ\nar:موافق\naz:OK\nbg:OK\nbr:OK\nbs:OK\nby:ДА\nca-xv:D'acord\nca:D'acord\ncn:确定(&O)\ncy:Iawn\ncz:OK\nde:OK\ndk:O.k.\nel:ΟΚ\nes:Aceptar\net:Sobib\neu:Ongi\nfa:تأیید\nfi:OK\nfr:OK\nfy-nl:OK\nga:Tá go maith\ngl:OK\nhe:אישור\nhi:ठीक\nhr:U redu\nhu:OK\nid:OK\nit:OK\nja:OK\nka:კარგი\nkr:확인\nku:باشە\nkw:Da lowr\nlt:Gerai\nlv:Labi\nmk:Во ред\nml:ശരി\nmy:OK\nne:हुन्छ\nnl:OK\nnn:OK\nno:OK\npl:OK\npt:Aplicar\nro:În regulă\nru:OK\nsi:අනුමතයි\nsk:V poriadku\nsl:V redu\nsn:ehoyi\nsp-rs:U redu\nsq:OK\nsr-rs:У реду\nsv:OK\nta:சரி\ntl:OK\ntr:Tamam\ntw:確定(&O)\nuk:Гаразд\nuz:OK\nvn:Đồng ý\n:Open\naf:Maak Oop\nam:Բացել\nar:فتح\naz:Aç\nbg:Отваряне\nbn:উন্মীলন\nbr:Abrir\nbs:Otvori\nby:Адчыніць\nca-xv:Obri\nca:Obre\ncn:打开\ncy:Agor\ncz:Otevřít...\nde:Öffnen…\ndk:Åbn\nel:Άνοιγμα\nes:Abrir\net:Ava\neu:Ireki\nfa:باز کردن\nfi:Avaa\nfr:Ouvrir\nfy-nl:Iepenje\nga:Oscail\ngl:Abrir\nhe:פתח\nhi:खोलें\nhr:Otvori\nhu:Megny&itás\nid:Buka\nit:Apri\nja:開く\nka:გახსნა\nkr:열기\nku:کردنەوە\nkw:Ygeri\nlt:Atverti\nlv:Atvērt\nmk:Отвори\nml:തുറക്കുക\nmm:ဖွင့်ပါ\nmy:Buka\nne:खोल्नुहोस्\nnl:Openen\nnn:Opne\nno:Åpne\npa:ਖੋਲੋ\npl:Otwórz\npt:Abrir\nro:Deschide\nru:Открыть\nsi:විවෘතකරන්න (O)\nsk:Otvoriť\nsl:Odpri\nsn:Vhura\nsp-rs:Otvori\nsq:Hap\nsr-rs:Отвори\nsv:Öppna\nta:திற\nth:เปิด\ntl:Buksan\ntr:&Aç\ntw:開啟\nuk:Відкрити\nuz:Ochish\nvn:Mở tập tin\n:Open &in PDF-XChange\nam:Բացել PDF-XChange-ում\nar:فتح في PDF-XChange\naz:PD&F-XChange-də aç\nbg:Отворяне с PDF-XChange\nbr:Abrir no PDF-XChange\nbs:Otvori u PDF-XChange\nby:Адкрыць у PDF-XChange\nca-xv:Obri amb el PDF-XChange\nca:Obre amb el PDF-XChange\ncn:在 PDF-XChange 中打开(&I)\ncy:Agor yn PDF-XChange\ncz:Otevřít v programu PDF-XChange\nde:Mit PDF-&XChange öffnen\ndk:Åbn med PDF-XChange\nel:Άνοιγμα με PDF-XChange\nes:Abr&ir con PDF-XChange\net:Ava PDF-XChangega\neu:Ireki PDF-XChangen\nfa:باز کردن در PDF-&XChange\nfi:Avaa PDF-XChange\nfr:Ouvrir dans PDF-XChange\nfy-nl:Iepenje mei PDF-XChange\nga:Oscail &i PDF-XChange\ngl:Abrir no PDF-XChange\nhe:פתח ב- PDF-XChange\nhi:पीडीएफ &Xchange में खोलें\nhr:Otvori u programu PDF-XChange\nhu:Megnyitás PDF-XChange-ben\nid:Buka di PDF-&XChange\nit:Apri con PDF-XChange\nja:PDF-XChange で開く(&I)\nka:გახსნა PDF-XChange-ში\nkr:PDF-XChange로 열기(&I)\nku:PDF-XChange کردنەوە &بەهۆی\nkw:Ygeri yn PDF-XChange\nlt:Atverti naudojant „PDF-&XChange“\nlv:Atvērt ar &PDF-XChange\nmk:Отвори со PDF-XChange\nmy:Buka &menggunakan PDF-XChange\nne:PDF-XChange मा &खोल्नुहोस्\nnl:Openen met PDF-XChange\nnn:Opne &i PDF-XChange\nno:Åpne i PDF-XChange\npl:Otwórz w PDF-XChange\npt:Abrir no PDF-&XChange\nro:Deschide în PDF-XChange\nru:Открыть в PDF-XChange\nsi:PDF-XChange කියවනය මගින් විවෘතකරන්න\nsk:Otvoriť v programe PDF-XChange\nsl:Odpri s programom PDF-XChange\nsp-rs:Otvori u programu PDF-XChange\nsq:Hap &në PDF-XChange\nsr-rs:Отвори у програму PDF-XChange\nsv:Öppna i PDF-XChange\nta:PDF-XChange இல் திற\ntl:Buksan sa PDF-XChange\ntr:PDF-XChange ile aç\ntw:開啟於 PDF-XChange(&X)\nuk:Відкрити у PDF-XChange\nuz:PDF-XChangeda ochish\nvn:Mở bằng PDF-XChange\n:Open a document...\nam:Բացել փաստաթուղթ...\nar:فتح مستند...\naz:Sənədi aç...\nbg:Отворяне на документ...\nbr:Abrir um documento...\nbs:Otvori dokument...\nca-xv:Obri un document...\nca:Obre un document...\ncn:打开一个文件...\ncy:Agor dogfen...\ncz:Otevřít dokument...\nde:Dokument öffnen…\ndk:Åbn et dokument ...\nel:Άνοιγμα εγγράφου...\nes:Abrir un documento...\net:Ava dokument...\neu:Ireki agiri bat...\nfa:باز کردن یک سند...\nfi:Avaa asiakirja...\nfr:Ouvrir un document...\nga:Oscail cáipéis...\ngl:Abrir un documento...\nhe:פתח קובץ...\nhi:एक दस्तावेज़ खोलें\nhr:Otvori dokument...\nhu:Fájl megnyitása...\nid:Buka Dokumen...\nit:Apri documento...\nja:ドキュメントを開く...\nka:დოკუმენტის გახსნა...\nkr:문서 열기...\nku:کردنەوەی بەڵگەنامە...\nlt:Atverti dokumentą...\nlv:Atvērt dokumentu...\nmk:Отвори документ...\nmy:Buka dokumen...\nne:कागजात खोल्नुहोस्\nnl:Open een document...\nnn:Opne eit dokument\nno:Åpne et dokument...\npl:Otwórz dokument...\npt:Abrir documento...\nro:Deschide un document...\nru:Открыть документ...\nsk:Otvoriť dokument...\nsl:Odpri dokument …\nsn:vhura gwaro\nsp-rs:Otvori dokument...\nsq:Hap një dokument...\nsr-rs:Отвори документ...\nsv:Öppna ett dokument...\nta:ஆவணத்தை திறக்க...\ntr:Belge aç...\ntw:開啟檔案...\nuk:Відкрити документ...\nuz:Hujjatni ochish...\nvn:Mở một tập tin...\n:Open in %s\nam:Բացել %s-ում\nar:فتح في  %s\naz:%s ilə aç\nbg:Отваряне с %s\nbr:Abrir em %s\nbs:Otvori u %s\nca-xv:Obri amb %s\nca:Obre amb %s\ncn:用 %s 打开\ncy:Agor yn %s\ncz:Otevřít v %s\nde:Mit %s öffnen\ndk:Åbn i %s\nel:Άνοιγμα σε %s\nes:Abrir con %s\net:Ava rakenduses %s\neu:Irekitzea %s\nfa:باز کردن در %s\nfi:Avaa ohjelmassa %s\nfr:Ouvrir dans %s\nga:Oscail i %s\ngl:Abrir en %s\nhe:פתח ב- %s\nhr:Otvori u %s\nhu:Megnyitás %s\nid:Buka di %s\nit:Apri in %s\nja:%s で開く\nka:%s-ში გახსნა\nkr:%s(으)로 열기\nku:کردنەوە لە %s\nlv:Atvērt ar %s\nmk:Отвори во %s\nmy:Buka dalam %s\nne:%s मा खोल्नुहोस्\nnl:Open in %s\nnn:Opne i %s\nno:Åpne i %s\npl:Otwórz w %s\npt:Abrir em %s\nro:deschide în %s\nru:Открыть в %s\nsk:Otvoriť v %s\nsl:Odpri v %s\nsp-rs:Otvoriti u %s\nsq:Hap në %s\nsr-rs:Отворити у %s\nsv:Öppna med %s\nta:திற %s\ntr:%s içinde aç\ntw:以 %s 開啟\nuk:відкрити в %s\nuz:%s'da ochish\nvn:Mở bằng %s\n:Open in &Adobe Reader\nam:Բացել &Adobe Reader-ում\nar:فتح في &قارئ ادوبي\naz:&Adobe Reader-də aç\nbg:Отваряне с &Adobe Reader\nbr:Abrir no &Adobe Reader\nbs:Otvori u &Adobe Readeru\nby:Адкрыць у &Adobe Reader\nca-xv:Obri amb l'&Adobe Reader\nca:Obre amb l'&Adobe Reader\ncn:在 &Adobe Reader 中打开\ncy:Agor yn &Adobe Reader\ncz:Otevřít v programu &Adobe Reader\nde:Mit &Adobe Reader öffnen\ndk:Åbn med &Adobe Reader\nel:Άνοιγμα με &Adobe Reader\nes:Abrir con &Adobe Reader\net:Ava &Adobe Readeris\neu:Ireki &Adobe Readerren\nfa:باز کردن در &Adobe Reader\nfi:Avaa &Adobe Readerissa\nfr:Ouvrir dans &Adobe Reader\nfy-nl:Iepenje mei &Adobe Reader\nga:Oscail in &Adobe Reader\ngl:Abrir no &Adobe Reader\nhe:פתח ב- Adobe Reader\nhi:&एडोब रीडर में खोलें\nhr:Otvori u programu &Adobe Reader\nhu:Megnyitás &Adobe Acrobat-ban\nid:Buka di &Adobe Reader\nit:Apri con &Adobe Reader\nja:Adobe Reader で開く(&A)\nka:გახსნა &Adobe Reader-ში\nkr:Adobe Reader로 열기(&A)\nku:Adobe Reader کردنەوە &بەهۆی\nkw:Ygeri yn &Adobe Reader\nlt:Atverti naudojant „&Adobe Reader“\nlv:Atvērt ar &Adobe Reader\nmk:Отвори со &Adobe Reader\nmy:Buka menggunakan &Adobe Reader\nne:Adobe Reader मा &खोल्नुहोस्\nnl:Openen met &Adobe Reader\nnn:Opne i &Adobe Reader\nno:Åpne i &Adobe Reader\npl:Otwórz w &Adobe Reader\npt:Abrir no Adobe &Reader\nro:Deschide în &Adobe Reader\nru:О&ткрыть в Adobe Reader\nsi:&Adobe කියවනය මගින් විවෘතකරන්න\nsk:Otvoriť v programe &Adobe Reader\nsl:Odpri s programom &Adobe Reader\nsn:vhura mu&Adobe Reader\nsp-rs:Otvori u programu Adobe Reader\nsq:Hap në &Adobe Reader\nsr-rs:Отвори у програму Adobe Reader\nsv:Öppna i Adobe &Reader\nta:&Adobe Reader இல் திற\ntl:Buksan sa Adobe Reader\ntr:&Adobe Reader ile aç\ntw:開啟於 Adobe Reader(&A)\nuk:Відкрити у Adobe Reader\nuz:&Adobe Readerda ochish\nvn:Mở bằng Adobe Reader\n:Open in &Foxit Reader\nam:Բացել &Foxit Reader-ում\nar:فتح في Foxit Reader\naz:&Foxit Reader-də aç\nbg:Отваряне с &Foxit Reader\nbr:Abrir no &Foxit Reader\nbs:Otvori u &Foxit Readeru\nby:Адкрыць у &Foxit Reader\nca-xv:Obri amb el &Foxit Reader\nca:Obre amb el &Foxit Reader\ncn:在 &Foxit Reader 中打开\ncy:Agor yn &Foxit Reader\ncz:Otevřít v programu &Foxit Reader\nde:Mit F&oxit Reader öffnen\ndk:Åbn med &Foxit Reader\nel:Άνοιγμα με &Foxit Reader\nes:Abrir con &Foxit Reader\net:Ava &Foxit Readeris\neu:Ireki &Foxit Readerren\nfa:باز کردن در &Foxit Reader\nfi:Avaa &Foxit Readerissa\nfr:Ouvrir dans Fo&xit Reader\nfy-nl:Iepenje mei &Foxit Reader\nga:Oscail i &Foxit Reader\ngl:Abrir no &Foxit Reader\nhe:פתח ב- Foxit Reader\nhi:&Foxit रीडर में खोलें\nhr:Otvori u programu &Foxit Reader\nhu:Megnyitás &Foxit Readerben\nid:Buka di &Foxit Reader\nit:Apri con &Foxit Reader\nja:Foxit Reader で開く(&F)\nka:გახსნა &Foxit Reader-ში\nkr:Foxit Reader로 열기(&F)\nku:Foxit Reader کردنەوە &بەهۆی\nkw:Ygeri yn &Foxit Reader\nlt:Atverti naudojant „&Foxit Reader“\nlv:Atvērt ar &Foxit Reader\nmk:Отвори со &Foxit Reader\nmy:Buka dengan &Foxit Reader\nne:Foxit Reader मा &खोल्नुहोस्\nnl:Openen met &Foxit Reader\nnn:Opne i &Foxit Reader\nno:Åpne i &Foxit Reader\npl:Otwórz w &Foxit Reader\npt:Abrir &no &Foxit Reader\nro:Deschide în &Foxit Reader\nru:Отк&рыть в Foxit Reader\nsi:&Foxit කියවනය මගින් විවෘතකරන්න\nsk:Otvoriť v programe &Foxit Reader\nsl:Odpri s programom &Foxit Reader\nsp-rs:Otvori u programu Foxit Reader\nsq:Hap në &Foxit Reader\nsr-rs:Отвори у програму Foxit Reader\nsv:Öppna i Foxit Reader\nta:&Foxit Reader இல் திற\ntl:Buksan sa Foxit Reader\ntr:&Adobe Foxit ile aç\ntw:開啟於 Foxit Reader(&F)\nuk:Відкрити у Foxit Reader\nuz:&Foxit Readerda ochish\nvn:Mở bằng Foxit Reader\n:Open in &Microsoft HTML Help\nam:Բացել Microsoft HTML Help-ում\nar:فتح في Microsoft HTML Help\naz:Microsoft &HTML Help-də aç\nbg:Отваряне с Microsoft HTML Help\nbr:Abrir no Microsoft HTML Help\nbs:Otvori u Microsoft HTML Help\nby:Адкрыць у Microsoft HTML Help\nca-xv:Obri amb el Microsoft HTML Help\nca:Obre amb el Microsoft HTML Help\ncn:在 &Microsoft HTML Help 中打开(&M)\ncy:Agor yn Microsoft HTML Help\ncz:Otevřít v programu Microsoft HTML Help\nde:Mit &Microsoft HTML Hilfe öffnen\ndk:Åbn med Microsoft HTML Help\nel:Άνοιγμα με Microsoft HTML Help\nes:Abrir con &Microsoft HTML Help\net:Ava Microsoft HTML Helpga\neu:Ireki Microsoft HTML Laguntzan\nfa:باز کردن در &Microsoft HTML Help\nfi:Avaa Microsoft HTML Help\nfr:Ouvrir dans Microsoft HTML Help\nfy-nl:Iepenje mei Microsoft HTML Help\nga:Oscail i &Microsoft HTML Help\ngl:Abrir no Microsoft HTML Help\nhe:פתח ב- Microsoft HTML Help\nhi:Microsoft HTML मदद में खोलें\nhr:Otvori u programu Microsoft HTML Help\nhu:Megnyitás Microsoft HTML Helpben\nid:Buka dengan Microsoft HTML Help\nit:Apri con Microsoft HTML Help\nja:Microsoft HTML ヘルプで開く(&M)\nka:გახსნა Microsoft HTML Help-ში\nkr:Microsoft HTML Help로 열기(&M)\nku:Microsoft HTML کردنەوە  بەهۆی &یارمەتی\nkw:Ygeri yn Microsoft HTML Help\nlv:Atvērt ar &Microsoft HTML Help\nmk:Отвори со Microsoft HTML Help\nmy:Buka menggunakan &Microsoft HTML Help\nne:Microsoft HTML Help मा &खोल्नुहोस्\nnl:Openen met Microsoft HTML Help\nnn:Opne i &Microsoft HTML-hjelp\nno:Åpne i &Microsoft HTML Help\npl:Otwórz w Microsoft HTML Help\npt:Abrir no &Microsoft HTML Help\nro:Deschide în Microsoft HTML Help\nru:Открыть в Microsoft HTML Help\nsi:Microsoft HTML Help කියවනය මගින් විවෘතකරන්න\nsk:Otvoriť v programe Microsoft HTML Help\nsl:Odpri s programom Microsoft HTML Help\nsp-rs:Otvori u programu Microsoft HTML Help\nsq:Hap në &Microsoft HTML Help\nsr-rs:Отвори у програму Microsoft HTML Help\nsv:Öppna i Microsoft HTML Help\nta:Microsoft HTML Help இல் திற\ntl:Buksan sa Microsoft HTML Help\ntr:Microsoft HTML Help ile aç\ntw:開啟於 Microsoft HTML Help(&M)\nuk:Відкрити у Microsoft HTML Help\nuz:Microsoft HTML Helpda ochish\nvn:Mở bằng Microsoft HTML Help\n:Open in &Microsoft XPS-Viewer\nam:Բացել Microsoft XPS-Viewer-ում\nar:فتح في Microsoft XPS-Viewer\naz:Microsoft &XPS-Viewer-də aç\nbg:Отваряне с Microsoft XPS-Viewer\nbr:Abrir no Microsoft XPS-Viewer\nbs:Otvori u Microsoft XPS-Viewer\nby:Адкрыць у Microsoft XPS-Viewer\nca-xv:Obri amb el Microsoft XPS-Viewer\nca:Obre amb el Microsoft XPS-Viewer\ncn:在 &Microsoft XPS-Viewer 中打开\ncy:Agor yn Microsoft XPS-Viewer\ncz:Otevřít v programu Microsoft XPS-Viewer\nde:Mit &Microsoft XPS-Viewer öffnen\ndk:Åbn med Microsoft XPS-Viewer\nel:Άνοιγμα με Microsoft XPS-Viewer\nes:Abrir con el Visor XPS de &Microsoft\net:Ava Microsoft XPS-Viewerga\neu:Ireki Microsoft XPS-Ikusgailuan\nfa:باز کردن در Microsoft X&PS-Viewer\nfi:Avaa Microsoft XPS-Viewer\nfr:Ouvrir dans Microsoft XPS-Viewer\nfy-nl:Iepenje mei Microsoft XPS-Viewer\nga:Oscail i &Microsoft XPS-Viewer\ngl:Abrir no Microsoft XPS-Viewer\nhe:פתח ב- Microsoft XPS-Viewer\nhi:Microsoft XPS दर्शक में खोलें\nhr:Otvori u programu Microsoft XPS-Viewer\nhu:Megnyitás Microsoft XPS-Viewerben\nid:Buka dengan Microsoft XPS-Viewer\nit:Apri con Microsoft XPS-Viewer\nja:Microsoft XPS-Viewerで開く(&M)\nka:გახსნა Microsoft XPS-Viewer-ში\nkr:Microsoft XPS-Viewer로 열기(&M)\nku:Microsoft XPS کردنەوەی بەهۆی &پیشاندەری\nkw:Ygeri yn Microsoft XPS-Viewer\nlv:Atvērt ar &Microsoft XPS-Viewer\nmk:Отвори со Microsoft XPS-Viewer\nmy:Buka menggunakan &Microsoft XPS-Viewer\nne:Microsoft XPS-Viewer मा &खोल्नुहोस्\nnl:Openen met Microsoft XPS-Viewer\nnn:Opne i &Microsoft XPS-visar\nno:Åpne i &Microsoft XPS-visning\npl:Otwórz w Microsoft XPS-Viewer\npt:Abrir no &Microsoft XPS-Viewer\nro:Deschide în Microsoft XPS-Viewer\nru:Открыть в Microsoft XPS-Viewer\nsi:Microsoft XPS-Viewer කියවනය මගින් විවෘතකරන්න\nsk:Otvoriť v programe Microsoft XPS-Viewer\nsl:Odpri s programom Microsoft XPS-Viewer\nsp-rs:Otvori u programu Microsoft XPS-Viewer\nsq:Hap në &Microsoft XPS-Viewer\nsr-rs:Отвори у програму Microsoft XPS-Viewer\nsv:Öppna i Microsoft XPS-Viewer\nta:Microsoft XPS-Viewer இல் திற\ntl:Buksan sa Microsoft XPS-Viewer\ntr:Microsoft XPS-Viewer ile aç\ntw:開啟於 Microsoft XPS-Viewer(&W)\nuk:Відкрити у Microsoft XPS-Viewer\nuz:Microsoft XPS-Viewerda ochish\nvn:Mở bằng Microsoft XPS-Viewer\n:P&roperties\nam:Հ&ատկություններ\nar:الخصائص\naz:&Xüsusiyyətlər\nbg:&Свойства\nbr:P&ropriedades\nbs:&Postavke\nca-xv:P&ropietats\nca:P&ropietats\ncn:属性(&R)\ncy:&Priodweddau\ncz:&Vlastnosti\nde:Ei&genschaften\ndk:Egenskabe&r\nel:&Ιδιότητες\nes:P&ropiedades\net:O&madused\neu:Eza&ugarriak\nfa:م&شخصات\nfi:Ominaisuudet\nfr:P&ropriétés\nga:Ai&ríonna\ngl:P&ropiedades\nhe:מאפיינים\nhi:&गुण\nhr:&Svojstva\nhu:&Tulajdonságok\nid:P&roperti\nit:Proprietà\nja:プロパティ(&R)\nka:&თვისებები...\nkr:속성(&R)\nku:تایبە&تمەندییەکان\nlt:&Savybės\nlv:&Rekvizīti\nmk:&Својства\nmy:P&roperties\nne:&गुणहरु\nnl:E&igenschappen\nnn:E&genskaper\nno:E&genskaper\npl:Właściwości\npt:&Propriedades\nro:P&roprietăți\nru:Сво&йства...\nsk:&Vlastnosti\nsl:Lastnosti\nsp-rs:Osobine\nsq:V&eti\nsr-rs:Особине\nsv:E&genskaper\nta:பண்புகள்\ntl:Mga katangian\ntr:Ö&zellikler\ntw:特性(&R)...\nuk:Властивості\nuz:&Xossalari\nvn:Thuộc tính\n:P&roperties\\tCtrl+D\nam:Հ&ատկություններ...\\tCtrl+D\nar:الخصائص...\\tCtrl+D\naz:&Xüsusiyyətlər\\tCtrl+D\nbg:&Свойства\nbr:Propriedades...\\tCtrl+D\nbs:P&ostavke...\\tCtrl+D\nca-xv:P&ropietats...\\tCtrl+D\nca:P&ropietats...\\tCtrl+D\ncn:属性(&R)...\\tCtrl+D\ncy:P&riodweddau...\\tCtrl+D\ncz:&Vlastnosti...\\tCtrl+D\nde:Ei&genschaften\\tStrg+D\ndk:E&genskaber\\tCtrl+D\nel:&Ιδιότητες\\tCtrl+D\nes:P&ropiedades...\\tCtrl+D\net:O&madused\\tCtrl+D\neu:&Ezaugarriak\\tKtrl+D\nfa:م&شخصات\\tCtrl+D\nfi:O&minaisuudet\\tCtrl+D\nfr:&Propriétés\\tCtrl+D\nfy-nl:E&igenskippen...\\tCtrl+D\nga:Ai&ríonna\\tCtrl+D\ngl:P&ropiedades\\tCtrl+D\nhe:מאפיינים...\\tCtrl+D\nhi:&गुण\\tCtrl+D\nhr:S&vojstva...\\tCtrl+D\nhu:&Tulajdonságok\\tCtrl+D\nid:P&roperti\\tCtrl+D\nit:P&roprietà\\t<Ctrl>+D\nja:プロパティ(&R)\\tCtrl+D\nka:&თვისებები...\\tCtrl+D\nkr:속성(&R)\\tCtrl+D\nku:تا&یبەتمەندییەکان\\tCtrl+D\nlt:&Savybės\\tCtrl+D\nlv:&Rekvizīti\\tCtrl+D\nmk:С&војства...\\tCtrl+D\nmy:P&roperties\\tCtrl+D\nne:&गुणहरु\\tCtrl+D\nnl:E&igenschappen...\\tCtrl+D\nnn:E&genskaper\\tCtrl+D\nno:E&genskaper...\\tCtrl+D\npl:&Właściwości\\tCtrl+D\npt:&Propriedades...\\tCtrl+D\nro:P&roprietăți\\tCtrl+D\nru:Сво&йства...\\tCtrl+D\nsi:වත්කම් (P)\\tCtrl+D\nsk:V&lastnosti...\\tCtrl+D\nsl:Lastnosti\\tCtrl+D\nsp-rs:Osobine\\tCtrl+D\nsq:V&eti\\tCtrl+D\nsr-rs:Особине\\tCtrl+D\nsv:&Egenskaper...\\tCtrl+D\nta:பண்புகள்...\\tCtrl+D\ntl:Mga Katangian\\tCtrl+D\ntr:&Özellikleri\\tCtrl+D\ntw:特性(&R)...\\tCtrl+D\nuk:Властивості\\tCtrl+D\nuz:&Xossalari\\tCtrl+D\nvn:Thuộc tính\\tCtrl+D\n:PDF Document\naf:PDF Dokument\nam:PDF ֆայլ\nar:وثيقة المستندات المحمولة\naz:PDF sənədi\nbg:PDF документ\nbr:Documento PDF\nbs:PDF dokument\nby:PDF-дaкумент\nca-xv:Document PDF\nca:Document PDF\ncn:PDF 文档\ncy:Dogfen PDF\ncz:Dokument PDF\nde:PDF-Dokument\ndk:PDF-dokument\nel:Αρχείο PDF\nes:Documento PDF\net:PDF-dokument\neu:PDF Agiria\nfa:PDF سند\nfi:PDF-asiakirja\nfr:Document PDF\nfy-nl:PDF-bestân\nga:Cáipéis PDF\ngl:Documento PDF\nhe:קובץ PDF\nhi:पीडीएफ दस्तावेज़\nhr:PDF dokument\nhu:PDF dokumentum\nid:Dokumen PDF\nit:Documento PDF\nja:PDF ドキュメント\nka:PDF დოკუმენტი\nkr:PDF 문서\nku:PDF بەڵگەنامەی\nkw:Restren PDF\nlt:PDF dokumentas\nlv:PDF dokuments\nmk:PDF-документ\nmy:Dokumen PDF\nne:PDF कागजात\nnl:PDF-document\nnn:PDF-dokument\nno:PDF-dokument\npl:Dokument PDF\npt:Documento PDF\nro:Document PDF\nru:Документ PDF\nsi:PDF ගොනුව\nsk:PDF Dokument\nsl:Dokument PDF\nsn:gwaro rePDF\nsp-rs:PDF dokument\nsq:Dokument PDF\nsr-rs:PDF документ\nsv:PDF-dokument\nta:PDF கோப்பு\ntl:PDF Document\ntr:PDF Belge\ntw:PDF 文件\nuk:PDF документ\nuz:PDF hujjati\nvn:Tập tin PDF\n:PDF Optimizations:\nam:PDF-ի լավարկում՝\nar:تحسينات المستندات المحمولة\naz:PDF optimallaşdırması:\nbg:PDF оптимизации:\nbr:Otimizações PDF:\nbs:PDF optimizacije:\nca-xv:Optimitzacions del PDF:\nca:Optimitzacions del PDF:\ncn:PDF 优化:\ncy:Gwella'r PDF\ncz:Optimalizace PDF:\nde:PDF Optimierungen:\ndk:PDF-optimeringer:\nel:Βελτιστοποίηση PDF\nes:Optimizaciones de PDF:\net:PDF-i optimeerimised:\neu:PDF Hobekuntzak:\nfa:PDF بهینه‌سازی\nfi:PDF-optimoinnit:\nfr:Optimisations PDF\nga:Optimisations PDF\ngl:Optimización de PDF:\nhe:אופטימיזציות PDF:\nhi:पीडीएफ अनुकूलन:\nhr:PDF optimizacija:\nhu:PDF optimalizálás:\nid:Optimisasi PDF\nit:Ottimizzazioni PDF:\nja:PDF 最適化:\nka:PDF-ის ოპტიმიზაციის ხერხები:\nkr:PDF 최적화:\nku:PDF ڕێکخستنی:\nlv:PDF optimizācija:\nmk:Оптимизации за PDF:\nmy:Pengoptimuman PDF:\nne:PDF अप्टिमाइजेसन\nnl:PDF Optimalisaties\nnn:PDF-optimaliseringer:\nno:PDF Optimalisering:\npl:Optymalizacja PDF:\npt:Otimizações PDF:\nro:Optimizari PDF:\nru:Оптимизация PDF:\nsk:PDF Optimalizácia:\nsl:Optimizacije PDF:\nsp-rs:PDF optimizacija:\nsq:PDF optimizimet:\nsr-rs:PDF оптимизација\nsv:PDF Optimeringar:\nta:PDF மேம்படுத்தல்கள்\ntr:PDF Optimizasyonları:\ntw:PDF 最佳化:\nuk:Оптимізації PDF:\nuz:PDF optimizatsiyalari:\nvn:Các tối ưu PDF\n:PDF Producer:\nam:PDF-ի արտադրող՝\nar:منتج المستندات المحمولة:\naz:PDF kompilyatoru:\nbg:PDF създател:\nbr:Produtor do PDF:\nbs:Proizvođač PDF-a:\nca-xv:Productor PDF:\nca:Productor PDF:\ncn:PDF 制作程序:\ncy:Cynhyrchydd PDF:\ncz:Producent PDF:\nde:PDF Urheber:\ndk:PDF-producent:\nel:Δημιουργός PDF:\nes:Generador de PDF:\net:PDF-i looja:\neu:PDF Egilea:\nfa:برنامه‌ی ساخت PDF:\nfi:PDF-tuottaja:\nfr:PDF produit par :\nfy-nl:PDF-makker:\nga:Déantasóir PDF:\ngl:Productor do PDF:\nhe:מפיק PDF:\nhi:पीडीएफ निर्माता:\nhr:Proizvođač PDF-a:\nhu:PDF-et létrehozta:\nid:Pembuat PDF:\nit:Produttore PDF:\nja:PDF 出力:\nka:PDF-ის მწარმოებელი:\nkr:PDF 제작자:\nku:PDF بەرهەمهێنەری:\nlt:PDF leidėjas:\nlv:PDF veidotājs:\nmk:PDF-генератор:\nmy:PDF Producer:\nne:PDF निर्माता\nnl:PDF-maker:\nnn:PDF-lagar:\nno:PDF-produsent:\npl:Producent PDF:\npt:Criador do PDF:\nro:Producător PDF:\nru:Создатель PDF:\nsi:PDF නිශ්පාදකය:\nsk:Vytvorené v:\nsl:PDF izdelovalec:\nsp-rs:PDF izradio\nsq:PDF prodhuesi:\nsr-rs:PDF израдио\nsv:PDF-programvara:\nta:PDF உற்பத்தியாளர்\ntl:Gumawa ng PDF:\ntr:PDF Üretici:\ntw:PDF 產生器:\nuk:PDF видавець:\nuz:PDF yaratuvchisi:\nvn:Phần mềm tạo PDF:\n:PDF Version:\nam:PDF-ի տարբերակ՝\nar:اصدارالمستندات المحمولة\naz:PDF versiyası:\nbg:PDF версия:\nbr:Versão do PDF:\nbs:Verzija PDF-a:\nca-xv:Versió de PDF:\nca:Versió de PDF:\ncn:PDF 版本:\ncy:PDF Fersiwn:\ncz:Verze PDF:\nde:PDF Version:\ndk:PDF-version:\nel:Έκδοση PDF:\nes:Versión de PDF:\net:PDF-i versioon:\neu:PDF Bertsioa:\nfa:نسخه‌ی PDF:\nfi:PDF-versio:\nfr:Version du PDF :\nfy-nl:PDF-ferzje:\nga:Leagan PDF:\ngl:Versión PDF:\nhe:גרסת PDF:\nhi:पीडीएफ संस्करण:\nhr:Inačica PDF-a:\nhu:PDF verzió:\nid:Versi PDF:\nit:Versione PDF:\nja:PDF バージョン:\nka:PDF-ის ვერსია:\nkr:PDF 버전:\nku::PDF وەشانی\nlt:PDF versija:\nlv:PDF versija:\nmk:Верзија на PDF:\nmy:Versi PDF:\nne:PDF संस्करण\nnl:PDF-versie:\nnn:PDF-versjon:\nno:PDF-versjon:\npl:Wersja PDF:\npt:Versão PDF:\nro:Versiune PDF:\nru:Версия PDF:\nsi:PDF වෙළුම:\nsk:PDF Verzia:\nsl:Verzija PDF:\nsp-rs:PDF verzija:\nsq:PDF versioni:\nsr-rs:PDF верзија:\nsv:PDF-version:\nta:PDF பதிப்பு\ntl:Bersyon ng PDF:\ntr:PDF Sürümü:\ntw:PDF 版本：\nuk:Версія PDF\nuz:PDF versiyasi:\nvn:Phiên bản PDF:\n:PDF documents\nam:PDF ֆայլեր\nar:وثائق المستندات المحمولة\naz:PDF sənədləri\nbg:PDF документи\nbr:Documentos PDF\nbs:PDF dokumenti\nby:PDF-дакументы\nca-xv:Documents PDF\nca:Documents PDF\ncn:PDF 文档\ncy:Dogfennau PDF\ncz:Dokumenty PDF\nde:PDF-Dokumente\ndk:PDF dokumenter\nel:Αρχεία PDF\nes:Documentos PDF\net:PDF-dokumendid\neu:PDF agiriak\nfa:PDF اسناد\nfi:PDF-asiakirjat\nfr:Documents PDF\nfy-nl:PDF-bestannen\nga:Cáipéisí PDF\ngl:Documentos PDF\nhe:קובצי PDF\nhi:पीडीएफ दस्तावेजों\nhr:PDF dokumenti\nhu:PDF fájlok\nid:Dokumen PDF\nit:Documenti PDF\nja:PDF ドキュメント\nka:PDF დოკუმენტები\nkr:PDF 문서\nku:PDF بەڵگەنامەکانی\nkw:Restrennow PDF\nlt:PDF dokumentai\nlv:PDF dokumenti\nmk:PDF-документи\nmy:Dokumen-dokumen PDF\nne:PDF कागजात\nnl:PDF-documenten\nnn:PDF-dokumentar\nno:PDF-dokumenter (*.pdf)\npl:Dokumenty PDF\npt:Documentos PDF\nro:Documente PDF\nru:Документы PDF\nsi:PDF ගොනුව\nsk:PDF dokumenty\nsl:PDF dokumenti\nsn:magwaro ePDF\nsp-rs:PDF dokumenti\nsq:Dokumente PDF\nsr-rs:PDF документи\nsv:PDF-dokument\nta:PDF கோப்புகள்\ntl:Mga PDF na dokumento\ntr:PDF belgeleri\ntw:PDF 文件\nuk:Документи PDF\nuz:PDF hujjatlari\nvn:Tập tin PDF\n:Pa&ge...\\tCtrl+G\naf:Bladsy...\\tCtrl+G\nam:Էջ&ը...\\tCtrl+G\nar:صف&حة \\tCtrl+G\naz:Sə&hifə...\\tCtrl+G\nbg:&Страница...\\tCtrl+G\nbn:পৃষ্ঠা সংখ্যা...\\tCtrl+G\nbr:Página...\\tCtrl+G\nbs:Stranicu...\\tCtrl+G\nby:Старонка...\\tCtrl+G\nca-xv:Pà&gina...\\tCtrl+G\nca:Pà&gina...\\tCtrl+G\ncn:前往页(&G)...\\tCtrl+G\ncy:Tudalen...\\tCtrl+G\ncz:Strán&ka...\\tCtrl+G\nde:&Seite…\\tStrg+G\ndk:&Side ...\\tCtrl+G\nel:&Σελίδα...\\tCtrl+G\nes:Pá&gina...\\tCtrl+G\net:&Lehekülg...\\tCtrl+G\neu:&Orrialdea...\\tKtrl+G\nfa:&صفحه‌ی...\\tCtrl+G\nfi:Si&vulle...\\tCtrl+G\nfr:Pa&ge...\\tCtrl+G\nfy-nl:Side...\\tCtrl+G\nga:Leathanach...\\tCtrl+G\ngl:Páxina...\\tCtrl+G\nhe:עמוד...\\tCtrl+G\nhi:पृष्ठ संख्या पर\\tCtrl+G\nhr:Stranica...\\tCtrl+G\nhu:Megadott oldal...\\tCtrl+G\nid:Halaman...\\tCtrl+G\nit:Pa&gina...\\t<Ctrl>+G\nja:ページ指定(&G)...\\tCtrl+G\nka:&გვერდის მითითება...\\tCtrl+G\nkr:페이지 이동(&G)...\\tCtrl+G\nku:پە&ڕە...\\tCtrl+G\nkw:Folen...\\tCtrl+G\nlt:P&uslapis...\\tCtrl+G\nlv:Lap&pusi...\\tCtrl+G\nmk:Страница...\\tCtrl+G\nml:താള്‍...\\tCtrl+G\nmm:စာမျက်နှာ...\\tCtrl+G\nmy:Mukasurat...\\tCtrl+G\nne:&पृष्ठ ...\\tCtrl+G\nnl:Pa&gina...\\tCtrl+G\nnn:Side...\\tCtrl+G\nno:Side...\\tCtrl+G\npa:ਪੰਨਾ ਨੰਬਰ ਤੇ\\tCtrl+G\npl:&Strona...\\tCtrl+G\npt:Pági&na...\\tCtrl+G\nro:Pagina...\\tCtrl+G\nru:&Указанная страница...\\tCtrl+G\nsi:Pa&ge...\\tCtrl+G\nsk:St&rana...\\tCtrl+G\nsl:Stran …\\tCtrl+G\nsn:Peji...\\tCtrl+G\nsp-rs:Stranica...\\tCtrl+G\nsq:Fa&qja...\\tCtrl+G\nsr-rs:Страница...\\tCtrl+G\nsv:Sida...\\tCtrl+G\nta:பக்கம்...\\tCtrl+G\nth:หน้า...\\tCtrl+G\ntl:Pahina...\\tCtrl+G\ntr:&Sayfa...\\tCtrl+G\ntw:前往頁(&G)...\\tCtrl+G\nuk:До сторінки...\\tCtrl+G\nuz:&Bet...\\tCtrl+G\nvn:Trang...\\tCtrl+G\n:Page %s\nam:Էջ %s\nar:الصفحة %s\naz:Səhifə %s\nbg:Страница %s\nbr:Página %s\nbs:Stranica %s\nca-xv:Pàgina %s\nca:Pàgina %s\ncn:第 %s 页\ncy:Tudalen %s\ncz:Stránka %s\nde:Seite %s\ndk:Side %s\nel:Σελίδα %s\nes:Página %s\net:Lehekülg %s\neu:%s Orrialdea\nfa:صفحه‌ی %s\nfi:Sivu %s\nfr:Page %s\nga:Leathanach %s\ngl:Páxina %s\nhe:עמוד %s\nhi:पृष्ठ %s\nhr:Stranica %s\nhu:%s. oldal\nid:Halaman %s\nit:Pagina %s\nja:ページ %s\nka:%s გვერდი\nkr:%s 페이지\nku:پەڕەی %s\nlt:%s puslapis\nlv:Lappuse %s\nmk:страница %s\nmy:Halaman %s\nne:पृष्ठ %s\nnl:Pagina %s\nnn:Side %s\nno:Side %s\npl:Strona %s\npt:Página %s\nro:Pagina %s\nru:Стр. %s\nsi:%s වැනි පිටුව\nsk:Strana %s\nsl:Stran %s\nsn:shizha rechi %s\nsp-rs:Stranica %s\nsq:Faqja %s\nsr-rs:Страница %s\nsv:Sida %s\nta:பக்கம் %s\ntr:Sayfa %s\ntw:第 %s 頁\nuk:Сторінка %s\nuz:Bet %s\nvn:Trang %s\n:Page Size:\nam:Էջի չափը.\nar:حجم الصفحة\naz:Səhifə ölçüsü:\nbg:Размери на страницата:\nbr:Tamanho da página:\nbs:Veličina stranice:\nca-xv:Mida de pàgina:\nca:Mida de pàgina:\ncn:页面大小:\ncy:Maint Tudalen:\ncz:Velikost stránky:\nde:Seitengröße:\ndk:Sidestørrelse:\nel:Μέγεθος σελίδας:\nes:Tamaño de página:\net:Lehekülje suurus:\neu:Orrialde Neurria:\nfa:ابعاد صفحه:\nfi:Sivun koko:\nfr:Dimensions de la page :\nfy-nl:Sidegrutte:\nga:Méid an leathanaigh:\ngl:Tamaño de páxina:\nhe:גודל עמוד:\nhi:पृष्ठ आकर\nhr:Veličina stranice:\nhu:Oldalméret\nid:Ukuran Halaman:\nit:Formato pagina:\nja:ページ サイズ:\nka:გვერდის ფორმატი:\nkr:페이지 크기:\nku:قەبارەی پەڕە:\nlt:Puslapio dydis:\nlv:Lappuses lielums:\nmk:Големина на страница:\nml:താള്‍ വലുപ്പം\nmy:Saiz mukasurat\nne:पृष्ठ साइज:\nnl:Paginagrootte:\nnn:Sidestorleik:\nno:Sidestørrelse:\npl:Rozmiar strony:\npt:Tamanho da página:\nro:Mărime pagină:\nru:Формат страницы:\nsi:පිටුවේ ප්‍රමාණය:\nsk:Veľkosť strany:\nsl:Velikost strani:\nsp-rs:Dimenzije stranice:\nsq:Përmasat:\nsr-rs:Димензије странице:\nsv:Sidstorlek:\nta:பக்க அளவு\ntl:Laki ng Page\ntr:Sayfa Boyutu:\ntw:頁面大小(&Z):\nuk:Розмір сторінки:\nuz:Bet o'lchami:\nvn:Kích thước trang:\n:Page number %u inexistant\nam:%u էջը գոյություն չունի\nar:غير موجود %u رقم الصفحة \naz:Səhifə %u mövcud deyil\nbg:Страница с номер %u не съществува\nbr:A página %u não existe\nbs:Stranica %u ne postoji\nby:Старонка %u не існуе\nca-xv:La pàgina %u no existeix\nca:La pàgina %u no existeix\ncn:找不到页码 %u\ncy:Nid yw tudalen rhif %u yn bodoli\ncz:Stránka číslo %u neexistuje\nde:Seite %u nicht vorhanden\ndk:Sidenummer %u findes ikke\nel:Δεν υπάρχει σελίδα με αριθμό %u\nes:La página %u no existe\net:Lehekülge number %u ei ole olemas\neu:%u orrialde zenbakia ez dago\nfa:صفحه‌ی %u موجود نیست\nfi:Sivunumeroa %u ei ole olemassa\nfr:La page %u n'existe pas\nfy-nl:Sidenûmer %u bestiet net\nga:Níl an uimhir leathanaigh %u ann\ngl:Non existe a páxina %u\nhe:עמוד מס' %u לא קיים\nhi:%u पृष्ठ संख्या विद्यमान नहीं है\nhr:Stranica %u ne postoji\nhu:A(z) %u oldalszám nem létezik\nid:Halaman %u tidak tersedia\nit:Pagina numero %u inesistente\nja:ページ番号 %u が存在しません\nka:%u გვერდი არ არსებობს\nkr:%u 페이지가 없습니다.\nku:بوونی نیە %u پەڕەی ژمارە\nkw:Nyns eus folen %u\nlt:Puslapio numerio %u nėra\nlv:%u lappuse nepastāv\nmk:Страница со број %u не постои\nmy:Halaman bilangan %u tidak wujud\nne:पृष्ट संख्या %u अवस्थित छैन\nnl:Paginanummer %u bestaat niet\nnn:Side nummer %u eksisterer ikkje\nno:Sidetallet '%u' finnes ikke i dokumentet\npl:Brak strony o numerze %u\npt:A página %u não existe\nro:Număr de pagină %u inexistent\nru:Страница %u не существует\nsi:පිටු අංකය %u inexistant\nsk:Číslo strany %u neexistuje\nsl:Stran številka %u ne obstaja\nsp-rs:Stranica broj %u ne postoji\nsq:Nuk ekziston numri i faqes %u\nsr-rs:Страница број %u не постоји\nsv:Sidnummer %u finns ej\nta:பக்க எண் %u இருக்கவில்லை\ntl:Walang pahinang %u\ntr:%u numaralı sayfa mevcut değildir\ntw:第 %u 頁不存在\nuk:Неіснуючий номер сторінки %u\nuz:Bet %u mavjud emas\nvn:Trang %u không tồn tại\n:Page scaling\nam:Էջի շարժը\nar:قياس الصفحة\naz:Səhifələrin miqyaslanması\nbg:Оразмеряване на страницата\nbr:Ajuste da página\nbs:Skaliranje stranice\nca-xv:Escalat de la pàgina\nca:Escalat de la pàgina\ncn:页面缩放比例\ncy:Graddio tudalen\ncz:Měřítko stránky\nde:Anpassen der Seitengröße\ndk:Sideskalering\nel:Κλίμακα σελίδας\nes:Escalado de página\net:Lehekülje mastaapimine\neu:Orrialdea neurriratzen\nfa:مقیاس‌گذاری صفحه\nfi:Sivun skaalaus\nfr:Mise à l'échelle\nga:Scálú leathanaigh\ngl:Escalado de páxina\nhe:מתיחת עמודים\nhi:पृष्ठ आकर मप्यांकन\nhr:Skaliranje stranice\nhu:Lapmérethez igazítás\nid:Mengukur halaman\nit:Adattamento pagina\nja:ページの拡大縮小\nka:გვერდის მასშტაბირება\nkr:페이지 배율 조정\nku:ڕیزکردنی پەڕەکان\nlt:Puslapio mastelis\nlv:Lappuses mērogošana\nmk:Размер на страница\nmy:Skala halaman\nne:पृष्ठ मापन\nnl:Pagina schalen\nnn:Sideskalering\nno:Sideskalering\npl:Skalowanie strony\npt:Ajuste de páginas\nro:Scalare pagină\nru:Масштабирование страниц\nsk:Mierka strany\nsl:Merilo strani\nsp-rs:Podešavanje veličine stranice\nsq:Shkalla e fletës\nsr-rs:Подешавање величине странице\nsv:Skala om vid utskrift\nta:பக்கம் அளவுமாற்றம்\ntl:Pagkalaki ng pahina\ntr:Sayfa ölçeklendirme\ntw:頁面縮放\nuk:Масштаб сторінки\nuz:Bet miqyosi\nvn:Thước đo trang\n:Page:\naf:Bladsy:\nam:Էջը.\nar:الصفحة\naz:Səhifə:\nbg:Страница:\nbn:পৃষ্ঠা:\nbr:Página:\nbs:Stranica:\nby:Старонка:\nca-xv:Pàgina:\nca:Pàgina:\ncn:页码:\ncy:Tudalen:\ncz:Stránka:\nde:Seite:\ndk:Side:\nel:Σελίδα:\nes:Página:\net:Lehekülg:\neu:Orrialdea:\nfa:صفحه:\nfi:Sivu:\nfr:Page :\nfy-nl:Side:\nga:Leathanach:\ngl:Páxina:\nhe:עמוד:\nhi:पृष्ठ संख्या:\nhr:Stranica:\nhu:Oldal:\nid:Halaman:\nit:Pagina:\nja:ページ:\nka:გვერდი:\nkr:페이지:\nku:پەڕە:\nkw:Folen:\nlt:Puslapis:\nlv:Lappuse:\nmk:Страница:\nml:താള്‍\nmm:စာ မျက်နှာ\nmy:Mukasurat:\nne:पृष्ठ:\nnl:Pagina:\nnn:Side:\nno:Side:\npa:ਪੰਨਾ ਨੰਬਰ:\npl:Strona:\npt:Página:\nro:Pagina:\nru:Страница:\nsi:පිටුව:\nsk:Strana:\nsl:Stran:\nsn:Peji:\nsp-rs:Stranica:\nsq:Faqja:\nsr-rs:Страница:\nsv:Sida:\nta:பக்கம்:\ntl:Pahina:\ntr:Sayfa:\ntw:頁:\nuk:Сторінка:\nuz:Bet:\nvn:Trang:\n:PalmDoc documents\nam:PalmDoc փաստաթղթեր\nar:وثائق PalmDoc \naz:PalmDoc sənədləri\nbg:PalmDoc документи\nbr:Documentos PalmDoc\nbs:PalmDoc dokumenti\nca-xv:Documents PalmDoc\nca:Documents PalmDoc\ncn:PalmDoc 文档\ncy:Dogfennau PalmDoc\ncz:Dokumenty PalmDoc\nde:PalmDoc E-Bücher\ndk:PalmDoc-dokumenter\nel:Έγγραφα PalmDoc \nes:Documentos PalmDoc\net:PalmDoc-dokumendid\neu:PalmDoc agiriak\nfa:PalmDoc اسناد\nfi:PalmDoc-asiakirjat\nfr:Fichiers PalmDoc\nga:Cáipéisí PalmDoc\ngl:Documentos PalmDoc\nhe:קובצי PalmDoc\nhr:PalmDoc dokumenti\nhu:PalmDoc dokumentumok\nid:Dokumen PalmDoc\nit:Documenti PalmDoc\nja:PalmDoc ドキュメント\nka:PalmDoc დოკუმენტები\nkr:PalmDoc 문서\nku:بەڵگە نامەکانی PalmDoc\nlv:PalmDoc dokumenti\nmk:документи на PalmDoc\nnl:PalmDoc documenten\nnn:PalmDoc-dokumentar\nno:PalmDoc dokumenter\npl:Dokumenty PalmDoc\npt:Documentos PalmDoc\nru:Документы PalmDoc\nsk:PalmDoc dokumenty\nsl:PalmDoc dokumenti\nsp-rs:PalmDoc dokumenti\nsr-rs:PalmDoc документи\nsv:PalmDoc dokument\ntr:PalmDoc belgeleri\ntw:PalmDoc 文件\nuk:Документи PalmDoc\nuz:PalmDoc ho'jjatlari\nvn:Tài liệu PalmDoc\n:Please close %s to proceed!\nam:Շարունակելուց առաջ փակեք %s-ը:\nar: !المضي قدما %s الرجاء اغلاق\naz:Davam etmək üçün %s bağlayın!\nbg:Моля изберете %s за да продължите!\nbr:Por favor feche %s para continuar!\nbs:Molimo da zatvorite %s za nastavak!\nca-xv:Tanqueu %s per continuar!\nca:Tanqueu %s per continuar!\ncn:请关闭 %s 以继续。\ncy:Cau %s i barhau!\ncz:Prosím ukončete %s pro pokračování!\nde:Bitte schliessen Sie %s vor der Installation!\ndk:Luk venligst %s for at fortsætte !\nel:Παρακαλώ κλείστε %s για να συνεχίσετε!\nes:Necesita cerrar %s para continuar.\net:Jätkamiseks palun sulge rakendus %s!\neu:Mesedez itxi %s jarraitzeko!\nfa:پیش از ادامه لطفا %s را ببندید!\nfi:Sulje %s jatkaaksesi!\nfr:Fermez %s pour continuer, s.v.p. !\nga:Dún %s le do thoil chun dul ar aghaidh!\ngl:Peche %s para continuar\nhe:להמשך, אנא סגור את %s!\nhi:जारी रखने के लिए %s को बंद करे!\nhr:Molim zatvorite %s za nastavak!\nhu:A(z) %s bezárása szükséges a folytatáshoz!\nid:Silakan tutup %s untuk melanjutkan.\nit:Chiudi %s per continuare!\nja:%s を閉じてください\nka:გასაგრძელებლად, გთხოვთ, დაუხუროთ %s!\nkr:진행하려면, %s (을)를 닫으세요!\nku:تکایە %s دابخە بۆ بەردەوامبون!\nlv:Lai turpinātu, lūdzu, aizveriet %s!\nmk:Ве молам затворете го %s, за да продолжите!\nmy:Sila tutup %s untuk meneruskan!\nne:अगाडि बढ्न कृपया %s बन्द गर्नुहोस्!\nnl:Sluit %s om verder te gaan!\nnn:Vennlig lukk %s for å fortsetje!\nno:Vennligst lukk %s for å fortsette!\npl:Zamknij  %s, aby kontynuować!\npt:Para continuar, feche o %s!\nro:Rugam inchideti %s pentru a putea continua!\nru:Для продолжения, закройте %s !\nsk:Prosím zatvorte %s pre pokračovanie!\nsl:Prosimo, izberite %s za nadaljevati!\nsp-rs:Zatvorite %s za nastavak!\nsq:Ju lutemi, mbyllni %s për të vazhduar!\nsr-rs:Затворите %s за наставак!\nsv:Vänligen stäng %s innan du fortsätter!\nta:தயவு செய்து %s மூடிவிட்டு தொடரவும்!\ntr:Devam etmek için %s kapatın!\ntw:請關閉 %s 以繼續。\nuk:Будь ласка закрийте %s, щоб продовжити!\nuz:Davom etish uchun %s yoping!\nvn:Hãy đóng %s lại để tiến hành!\n:Please wait - rendering...\nam:Խնդրում ենք սպասել...\nar:الرجاء الإنتظار - اعادة...\naz:Görüntü hazırlanır, lütfən gözləyin...\nbg:Моля изчакайте - изображението се създава\nbr:Por favor aguarde, renderizando...\nbs:Molim pričekajte, iscrtavam...\nby:Пачакайце - фармуецца малюнак...\nca-xv:S'està renderitzant...\nca:S'està renderitzant...\ncn:请稍等─正在渲染...\ncy:Arhoswch, wrthi'n cyflwyno...\ncz:Prosím čekejte, probíhá vykreslování...\nde:Bitte einen Moment Geduld…\ndk:Vent venligst - optegner ...\nel:Παρακαλώ περιμένετε - φόρτωση...\nes:Espere un momento mientras se carga la visualización...\net:Palun oota - toimub visualiseerimine...\neu:Mesedez itxaron - aurkezten...\nfa:لطفاً صبر کنید...\nfi:Odota - tulkitaan...\nfr:Patientez s'il vous plaît (génération...)\nfy-nl:In amerijke asjobleaft - werjaan...\nga:Fan le do thoil - tá sé á chóiriú...\ngl:Agarde por favor - compoñendo...\nhe:אנא המתן – מבצע...\nhi:कृपया प्रतीक्षा करें - प्रतिपादन...\nhr:Molim pričekajte, iscrtavam...\nhu:Feldolgozás, kérem várjon\nid:Harap tunggu - sedang proses rendering...\nit:Rendering in corso - attendere...\nja:描画中...\nka:მიმდინარეობს რენდერი, გთხოვთ მოიცადეთ...\nkr:렌더링 중입니다, 기다리세요...\nku:تکایە چاوەڕوانبە - پوختە ئەکرێت...\nkw:Gortos, mar pleg - ow rendra...\nlt:Prašome palaukti – atvaizduojama...\nlv:Lūdzu, uzgaidiet – notiek atveidošana...\nmk:Ве молам почекајте - создавам приказ...\nmy:Sila tunggu - memaparkan...\nne:कृपया पर्खनुहोस - रेन्डरिङ हुदैछ ...\nnl:Een ogenblik - weergeven...\nnn:Venligst vent - Visar...\nno:Vennligst vent - arbeider...\npl:Proszę czekać - renderowanie...\npt:Por favor aguarde - a processar...\nro:Vă rugăm așteptați - afișare...\nru:Формируется изображение, подождите...\nsi:මදක් සිටින්න - rendering...\nsk:Prosím počkajte - zobrazovanie...\nsl:Počakajte trenutek, upodobitev poteka …\nsp-rs:Spremanje prikaza...\nsq:Ju lutemi, prisni - radhitet...\nsr-rs:Спремање приказа...\nsv:Ett ögonblick - förbereder...\nta:தயவுசெய்து காத்திருக்கவும் - அளிக்கபட்டுவருகிறது...\ntl:Maghintay - pinapakita...\ntr:Bekleyiniz - oluşturulmakta...\ntw:請稍等—正在渲染...\nuk:Зачекайте - генерується...\nuz:Kutib turing - render qilinmoqda...\nvn:Xin chờ đợi, đang hiện...\n:Postscript documents\nam:Հետգրվածքային ֆայլեր\nar:وثائق التذييل\naz:Postscript sənədləri\nbg:Postscript документи\nbr:Documentos Postscript\nbs:Postscript dokumenti\nca-xv:Documents Postscript\nca:Documents Postscript\ncn:Postscript 文件\ncy:Dogfennau postscript\ncz:Dokumenty PostScript\nde:Postscript-Dokumente\ndk:Postscript-dokumenter\nel:Έγγραφα Postscript\nes:Documentos Postscript\net:Postscript-dokumendid\neu:Postscript agirak\nfa:Postscript اسناد\nfi:Postscript-asiakirjat\nfr:Documents Postscript\nga:Cáipéisí Postscript\ngl:Documentos Postscript\nhe:קובצי Postscript\nhi:अनुलेख दस्तावेजों\nhr:Postscript dokumenti\nhu:Postscript fájlok\nid:Dokumen Postscript\nit:Documenti PostScript\nja:PostScript ドキュメント\nka:Postscript დოკუმენტები\nkr:Postscript 문서\nku:Postscript بەڵگەنامەنکانی\nlt:„PostScript“ dokumentai\nlv:PostScript dokumenti\nmk:Postscript-документи\nmy:Dokumen PostScript\nne:पोस्ट स्क्रिप्ट कागजातहरु\nnl:Postscript documenten\nnn:Etterskriv dokumentar\nno:Postscript-dokumenter\npl:Dokumenty postscript\npt:Documentos Postscript\nro:Documente Postscript\nru:Документы Postscript\nsk:Postscript dokumenty\nsl:Postscript dokumenti\nsp-rs:Postscript dokumenti\nsq:Dokumente Postscript\nsr-rs:Postscript документи\nsv:Postscript-dokument\nta:போஸ்ட்ஸ்கிரிப்ட் ஆவணங்கள்\ntr:Postscript belgeleri\ntw:Postscript 文件\nuk:Документи postscript\nuz:Postscript hujjatlari\nvn:Tập tin Postscript\n:Pr&esentation\\tF5\nam:Ներ&կայացում\\tF5\nar:العرض التقديم \\tF5\naz:Tə&qdimat\\tCtrl+L\nbg:&Презентация\\tCtrl+L\nbr:Apr&esentação\\tCtrl+L\nbs:Pr&ezentacija\\tCtrl+L\nca-xv:Pr&esentació\\tCtrl+L\nca:Pr&esentació\\tCtrl+L\ncn:幻灯片(&E)\\tCtrl+L\ncy:Cyflwyniad\\tCtrl+L\ncz:Pr&ezentace\\tF5\nde:&Präsentation\\tF5\ndk:H&ele skærmen\\tCtrl+L\nel:&Παρουσίαση\\tCtrl+L\nes:Pr&esentación\\tCtrl+L\net:&Esitlus\\tCtrl+L\neu:&Aurkezpena\\tKtrl+L\nfa:ارا&ئه\\tF5\nfi:&Esitys\\tCtrl+L\nfr:P&résentation\\tCtrl+L\nga:Cur i láthair\\tCtrl+L\ngl:Pr&esentación\\tCtrl+L\nhe:מצגת\\tCtrl+L\nhi:&प्रस्तुति\\tCtrl+L\nhr:Pr&ezentacija\\tCtrl+L\nhu:Bemutató\\tCtrl+L\nid:Pr&esentasi\\tF5\nit:Pr&esentazione\\t<Ctrl>+L\nja:プレゼンテーション(&E)\\tCtrl+L\nka:წარმოდგ&ენა\\tCtrl+L\nkr:프리젠테이션(&E)\\tCtrl+L\nku:پڕ& بە شاشە بەبێ شریتی ئامرازەکان\\tCtrl+L\nlt:&Pateiktis\\tCtrl+L\nlv:Prezentācija\\tF5\nmk:Презентација\\tCtrl+L\nmy:P&embentangan\\tCtrl + L\nne:प्रस्तुती&करण\\tCtrl+L\nnl:Pr&esentatie\\tCtrl+L\nnn:Pr&esentasjon\\tF5\nno:Pr&esentasjon\\tCtrl+L\npl:&Prezentacja\\tCtrl+L\npt:Aprese&ntação\\tCtrl+L\nro:Pr&ezentare\\tCtrl+L\nru:Пр&езентация\\tF5\nsk:Pr&ezentácia\\tCtrl+L\nsl:Pr&edstavitev\\tCtrl+L\nsp-rs:Prezentacija\\tCtrl+L\nsq:Pr&ezantim\\tCtrl+L\nsr-rs:Презентација\\tCtrl+L\nsv:Pr&esentation\\tCtrl+L\nta:விளக்கக்காட்சி \\tCtrl+L\ntl:Pr&esentasyon\\tCtrl+L\ntr:Tan&ıtım\\tCtrl+L\ntw:投影片顯示(&E)\\tCtrl+L\nuk:Презентація\\tCtrl+L\nuz:&Namoyish\\tCtrl+L\nvn:Trình chiếu\\tCtrl+L\n:Previous Page\naf:Vorige Bladsy\nam:Նախորդ էջը\nar:الصفحة السابقة\naz:Əvvəlki səhifə\nbg:Предишна страница\nbn:পূর্ববর্তী পৃষ্ঠা\nbr:Página anterior\nbs:Prethodna stranica\nby:Папярэдняя старонка\nca-xv:Pàgina anterior\nca:Pàgina anterior\ncn:上一页\ncy:Tudalen Flaenorol\ncz:Předchozí stránka\nde:&Vorherige Seite\ndk:Forrige side\nel:Προηγούμενη σελίδα\nes:Página anterior\net:Eelmine lehekülg\neu:Aurreko Orrialdea\nfa:صفحه‌ی قبلی\nfi:Edellinen sivu\nfr:Page précédente\nfy-nl:Foarige side\nga:Leathanach Roimhe\ngl:Páxina anterior\nhe:עמוד קודם\nhi:पिछले पृष्ठ पर\nhr:Prethodna stranica\nhu:Előző oldal\nid:Halaman Sebelumnya\nit:Pagina precedente\nja:前のページ\nka:წინა გვერდი\nkr:이전 페이지\nku:پەڕەی پێشوو\nkw:Folen kyns\nlt:Ankstesnis puslapis\nlv:Iepriekšējā lappuse\nmk:Претходна страница\nml:മുന്‍പുള്ള താള്‍\nmm:ပြီးတဲ့ စာမျက်နှာ\nmy:Mukasurat sebelumnya\nne:अघिल्लो पृष्ठ\nnl:Vorige pagina\nnn:Førre side\nno:Forrige side\npa:ਪਿਛਲੇ ਪੰਨੇ ਤੇ\npl:Poprzednia strona\npt:Página anterior\nro:Pagina anterioară\nru:Предыдущая страница\nsi:පෙර පිටුව\nsk:Predchádzajúca strana\nsl:Predhodna stran\nsn:Peji yesure\nsp-rs:Prethodna stranica\nsq:Faqja e mëparshme\nsr-rs:Претходна страница\nsv:Föregående sida\nta:முந்தைய பக்கம்\nth:หน้าก่อนหน้า\ntl:Naunang Pahina\ntr:Önceki Sayfa\ntw:上一頁\nuk:Попередня сторінка\nuz:Oldingi bet\nvn:Trang trước\n:Print\nam:Տպել\nar:طباعة\naz:Çap et\nbg:Отпечатване\nbr:Imprimir\nbs:Štampaj\nca-xv:Impressora\nca:Imprimeix\ncn:打印\ncy:Argraffu\ncz:Tisk...\nde:Drucken…\ndk:Udskriv\nel:Εκτύπωση\nes:Imprimir\net:Prindi\neu:Irarkitu\nfa:چاپ\nfi:Tulosta\nfr:Imprimer\nga:Clóbhuail\ngl:Imprimir\nhe:הדפס\nhi:छापें\nhr:Ispis\nhu:Nyomtatás\nid:Cetak\nit:Stampa\nja:印刷\nka:ამობეჭდვა\nkr:인쇄\nku:چاپکردن\nlt:Spausdinti\nlv:Drukāt\nmk:Печати\nml:അച്ചടിയ്ക്കുക.\nmy:Cetak\nne:छाप्नुहोस्\nnl:Afdrukken\nnn:Skriv ut\nno:Skriv ut\npl:Drukuj\npt:Imprimir\nro:Imprimare\nru:Печать\nsi:මුද්‍රණය\nsk:Tlač\nsl:Natisni\nsp-rs:Štampaj\nsq:Printoj\nsr-rs:Штампај\nsv:Skriv ut\nta:அச்சிட்டு\ntr:Yazdır\ntw:列印\nuk:Друк\nuz:Chop etish\nvn:In\n:Print range\nam:Տպելու կարգը\nar:نطاق الطباعة\naz:Çap diapazonu\nbg:Отпечатване на някои страници\nbr:Intervalo de impressão\nbs:Štampaj raspon\nca-xv:Interval d'impressió\nca:Interval d'impressió\ncn:打印范围\ncy:Ystod argraffu\ncz:Rozsah tisku\nde:Seitenbereich\ndk:Udskriftsområde\nel:Εύρος εκτύπωσης\nes:Rango de impresión\net:Printimisvahemik\neu:Irarketa eremua\nfa:محدوده‌ی چاپ\nfi:Tulostusalue\nfr:Plage d'impression\nga:Raon clóbhuailte\ngl:Imprimir un rango\nhe:טווח הדפסה\nhi:छपाई सीमा\nhr:Ispiši raspon\nhu:Nyomtatási tartomány\nid:Rentang cetakan\nit:Stampa intervallo\nja:印刷範囲\nka:ბეჭდვის დიაპაზონი\nkr:인쇄 범위\nku:زنجیرەی چاپکردن\nlt:Spausdinimo intervalas\nlv:Drukas diapazons\nmk:Опсег за печатење\nmy:Cetak julat\nne:छपाई दायरा\nnl:Bereik afdrukken\nnn:Utskrivingsrekkevidde\nno:Utskriftsområde\npl:Zakres druku\npt:Intervalo de impressão\nro:Interval imprimare\nru:Диапазон печати\nsk:Rozsah tlače\nsl:Natisni razpon\nsp-rs:Opseg štampanja\nsq:Kufiri i printimit\nsr-rs:Опсег штампања\nsv:Skriv ut urval\nta:அச்சிடும் வரம்பு\ntl:Mga ipi-print na pahina\ntr:Baskı aralığı\ntw:列印範圍\nuk:Межі друку\nuz:Chop etish diapazoni\nvn:Giới hạn vùng in\n:Printer with given name doesn't exist\nam:Այս անվամբ տպիչ գոյություն չունի\nar:طابعة بهذا الاسم غير موجودة\naz:Bu adda printer mövcud deyil\nbg:Принтер с това име не съществува\nbr:Nâo existe uma impressora com esse nome\nbs:Štampač sa datim nazivom ne postoji\nca-xv:No existeix cap impressora amb el nom proveït\nca:No existeix cap impressora amb el nom proveït\ncn:该打印机不存在\ncy:Nid oes argraffydd gyda'r enw yna'n bod\ncz:Tiskárna se zadaným názvem neexistuje\nde:Drucker mit dem angegebenen Namen nicht gefunden\ndk:Printer med dette navn findes ikke\nel:Ο εκτυπωτής με αυτό το όνομα δεν υπάρχει\nes:La impresora con el nombre especificado no existe\net:Antud nimega printerit ei leidu\neu:Ez dagi emandako izenik duen irarkailurik\nfa:چاپگری با نام داده شده وجود ندارد\nfi:Annetun nimistä tulostinta ei ole\nfr:Il n'y a pas d'imprimante de ce nom\nga:Níl clóire leis an ainm sin ann\ngl:A impresora co nome indicado non existe\nhe:לא זוהתה מדפסת בשם שצוין.\nhi:दिए गए नाम का प्रिंटर मौजूद नहीं है\nhr:Ne postoji printer sa zadanim imenom\nhu:Nem található nyomtató a megadott néven\nid:Printer dengan nama tersebut tidak ada\nit:La stampante con quel nome non esiste\nja:指定されたプリンタが見つかりません\nka:მოცემული სახელის მქონე პრინეტრი არ არსებობს\nkr:지정된 이름의 프린터가 없습니다.\nku:هیچ چاپکەرێک بەو ناوە بوونی نیە\nlt:Spausdintuvo tokiu vardu nėra\nlv:Printeris ar šādu nosaukumu nepastāv\nmk:Не постои печатач со зададеното име\nmy:Pencetak dengan nama yang diberikan tidak wujud\nne:दिईएको नाम भएको मुद्रक अवस्थित छैन\nnl:Printer met de opgegeven naam bestaat niet\nnn:Ein skriver med det namnet finnes ikkje\nno:Skriver med gjeldende navn eksisterer ikke\npl:Drukarka o podanej nazwie nie istnieje\npt:A impressora indicada não existe\nro:Imprimanta cu numele respectiv nu există\nru:Принтер с данным именем не найден\nsk:Tlačiareň s uvedeným názvom neexistuje.\nsl:Tiskalnik z navedenim imenom ne obstaja\nsp-rs:Štampač sa navedenim imenom ne postoji\nsq:Nuk ekziston printeri me këtë emër\nsr-rs:Штампач са наведеним именом не постоји\nsv:Det finns ingen skrivade med angivet namn\nta:குறிபிட்ட பெயரில் அச்சுப்பொறி இல்லை.\ntr:Girilen isimli Yazıcı bulunamadı\ntw:指定之印表機不存在\nuk:Принтера з даним іменем не існує\nuz:Bunday printer mavjud emas\nvn:Máy in với tên được cho không tồn tại\n:Printing in progress.\nam:Տպում է:\nar:الطباعة في التقدم.\naz:Çap davam edir.\nbg:Печатане...\nbr:Imprimindo...\nbs:Štampanje u napretku.\nca-xv:La impresió és en procés.\nca:La impressio és en procés.\ncn:正在打印\ncy:Wrthi'n argraffu.\ncz:Probíhá tisk\nde:Drucken - SumatraPDF\ndk:Udskrift i gang\nel:Εκτύπωση σε εξέλιξη\nes:Impresión en progreso.\net:Printimine on pooleli.\neu:Irarketa garatzen.\nfa:فرآیند چاپ در جریان است.\nfi:Tulostaminen käynnissä.\nfr:Impression en cours\nga:Clóbhualadh ar siúl.\ngl:Impresión en curso.\nhe:הדפסה מתבצעת.\nhi:छपाई में प्रगति.\nhr:Ispis u tijeku.\nhu:Nyomtatás folyamatban.\nid:Dalam proses mencetak\nit:Stampa in corso...\nja:印刷を実行中です。\nka:მიმდინარეობს ბეჭდვა.\nkr:인쇄 작업 중입니다.\nku:چاپکردن لە ئەنجامداندایە\nlv:Notiek drukāšana.\nmk:Печатењето е во тек.\nml:അച്ചടി പുരോഗമിക്കുന്നു\nmy:Cetakan sedang dijalankan.\nnl:Aan het printen.\nnn:Utskriving under arbeid.\nno:Utskrift pågår.\npl:Trwa drukowanie.\npt:Impressão em curso\nro:Tiparire in curs.\nru:Идёт печать.\nsk:Prebieha tlač...\nsl:Tiskanje v teku.\nsp-rs:Štampanje u toku.\nsq:Printimi vijon.\nsr-rs:Штампање у току!\nsv:Utskrift pågår.\nta:அச்சு பணியில் உள்ளது\ntr:Baskı devam ediyor.\ntw:正在列印\nuk:Триває друк.\nuz:Chop etilmoqda.\nvn:Đang in.\n:Printing is still in progress. Abort and quit?\nam:Տպում է: Ընդհատե՞լ և փակել:\nar:الطباعة قيد التقدم. إحباط وإنهاء؟\naz:Çap davam edir. Dayandırmaq və proqramdan çıxmaq?\nbg:Печатането все още е на ход. Сигурни ли сте, че искате принудително да го откажете и да излезете?\nbr:Ainda imprimindo... Interromper e sair?\nbs:Štampanje je još uvijek u toku. Prekini i izađi?\nca-xv:La impressió encara és en procés. Voleu aturar i sortir?\nca:La impressió encara està en procés. Voleu aturar i sortir?\ncn:打印仍在持续当中。要中止并放弃吗？\ncy:Dal wrthi'n argraffu. Hepgor a gadael?\ncz:Tisk stále probíhá. Přerušit a odejít?\nde:Bestehenden Druckvorgang abbrechen und Fenster schließen?\ndk:Udskrift er stadig i gang. Afbryd og afslut?\nel:Η εκτύπωση είναι ακόμα σε εξέλιξη. Ακύρωση και Έξοδος;\nes:Impresión aún en progreso. ¿Cancelar y salir?\net:Printimine on pooleli. Kas katkestada ja alustada uuesti?\neu:Irarketa oraindik garatzen ari da. Eten eta utzi?\nfa:فرآیند چاپ هنوز در جریان است. انصراف و خروج؟\nfi:Tulostaminen on edelleen käynnissä. Keskeytä ja lopeta?\nfr:Impression toujours en cours. Annuler et quitter ?\nga:Tá clóbhuladh fós ar siúl. Tobscoir agus dún?\ngl:Aínda se está imprimindo. Abortar e saír?\nhe:תהליך ההדפסה עדיין לא הסתיים. לבטל ולצאת?\nhi:छपाई अभी भी प्रगति पर है | रद्द किजिये और दें छोड़ दें ?\nhr:Ispis u tijeku. Prekinite i izađite?\nhu:A nyomtatás még folyamatban van. Megszakítás és kilépés?\nid:Sedang dalam proses mencetak. Batalkan dan keluar?\nit:La stampa è ancora in corso. Interrompere e uscire?\nja:印刷を実行中です。中止して終了しますか？\nkr:아직 인쇄가 진행 중입니다.  중단하고 끝낼까요?\nku:چاپکردن لە ئەنجامداندایە. کۆتایی پێهێنان و دەرچوون؟\nlv:Vēl joprojām notiek drukāšana. Priekšlaikus pārtraukt un beigt?\nmk:Печатењето е сè уште во тек. Да го поништам и прекинам?\nmy:Cetakan sedang dilakukan. Batal dan Henti?\nnl:Nog steeds aan het printen. Annuleren en stoppen?\nnn:Utskrivinga pågår framleis. Vil du stoppe og avslutte?\nno:Skriver ut fortsatt. Avbryte?\npl:Nadal trwa drukowanie. Przerwać i wyjść?\npt:Impressão ainda em curso. Abortar e sair?\nro:In prezent se tipareste ceva. Anulati si renuntati?\nru:Печать ещё не завершена. Отменить и выйти?\nsk:Prebieha tlač. Prerušiť a ukončiť tlač?\nsl:Tiskanje je še vedno v teku. Prekinem in končam?\nsp-rs:Štampanje je i dalje u toku. Obustaviti i izaći?\nsq:Printimi vijon. Do e ndërprisni dhe e pezulloni?\nsr-rs:Штампање је и даље у току. Завршити и прекинути?\nsv:Utskrift pågår fortfarande. Avbryt och avsluta?\nta:அச்சடித்தல் செயலில் உள்ளது. நிறுத்தி ரத்து செய்?\ntr:Yazdırma sürüyor. İptal edip çıkmak istiyor musunuz?\ntw:正在列印，要中止並放棄嗎？\nuk:Друк ще не завершено. Перервати та вийти?\nuz:Chop etilmoqda. To'xtatilib dasturdan chiqilsinmi?\nvn:Vẫn còn đang in. Hủy bỏ và thoát ra?\n:Printing is still in progress. Abort and start over?\nam:Տպում է։ Կանգնեցնե՞լ։\nar:الطباعة قيد التقدم. إحباط والبدء من جديد؟\naz:Çap davam edir. Dayandırmaq və yenidən başlamaq?\nbg:Отпечатването се извършва. Прекъсни и започни отначало?\nbr:A impressão está em andamento. Interromper e começar de novo?\nbs:Štampa je još u toku. Prekini i započni ispočetka?\nca-xv:La impressió encara es troba en progrés. Voleu cancel·lar-la i tornar a començar??\nca:La impressió encara es troba en progrés. Voleu cancel·lar-la i tornar a començar??\ncn:打印仍在持续当中。要中止并重新设置吗？\ncy:Dal wrthi'n argraffu. Hepgor a chychwyn eto?\ncz:Tisk je stále probíhá. Přerušit a začít znovu?\nde:Bestehenden Druckvorgang abbrechen und neu beginnen?\ndk:Udskrift pågår stadig. Afbryd og start forfra?\nel:Η εκτύπωση βρίσκεται σε εξέλιξη. Να ακυρωθεί και να ξεκινήσει πάλι;\nes:La impresión está en progreso. ¿Quiere interrumpirla e iniciar de nuevo?\net:Printimine on pooleli. Kas katkestada ja alustada uuesti?\neu:Irarketa oraindik garatzen ari da. Utzi eta berriro hasi?\nfa:فرآیند چاپ هنوز در جریان است. انصراف و شروع مجدد؟\nfi:Tulostaminen on vielä käynnissä. Keskeytetäänkö ja aloitetaan uudelleen?\nfr:Impression toujours en cours. Annuler et recommencer ?\nga:Tá sé fós ag clóbhualadh. Tobscoir agus tosaigh arís?\ngl:Aínda se está imprimino. Abortar e comezar de novo?\nhe:תהליך ההדפסה עדיין לא הסתיים. לבטל ולהתחיל מחדש?\nhi:छपाई अभी भी प्रगति में है | बन्द करें और फिर से शुरू करें?\nhr:Ispis je još u tijeku. Prekini i započni ponovno?\nhu:A nyomtatás még folyamatban van. Megszakítás és újrakezdés?\nid:Sedang dalam proses mencetak. Batalkan dan ulangi lagi?\nit:La stampa è in corso. Interrompere e ricominciare?\nja:印刷は既に実行されています。中止または再実行しますか？\nka:მიმდინარეობს ამობეჭდვა. გსურთ გაუქმება და ხელახლა დაწყება?\nkr:아직 인쇄가 진행 중입니다.  중단하고 다시 시작할까요?\nku:چاپکردن لە ئەنجامداندایە. کۆتایی پێهێنان و دەستپێکردنەوە؟\nlt:Spausdinimas dar nebaigtas. Ar norite jį nutraukti ir pradėti iš naujo?\nlv:Vēl joprojām notiek drukāšana. Priekšlaikus pārtraukt un sākt no jauna?\nmk:Печатењето трае сè уште. Да го запрам и да почнам одново?\nmy:Cetakan masih lagi dijalankan. Batalkan dan mulakan semula?\nne:छपाई कार्य प्रगति हुदैछ | परित्याग गरि पुनः सुरु गर्ने?\nnl:Afdrukken is nog niet voltooid. Afbreken en opnieuw beginnen?\nnn:Utskrivinga pågår framleis. Vil du stoppe og starte på nytt?\nno:Utskriften pågår fortsatt. Avbryte og starte på nytt?\npl:Nadal trwa drukowanie. Przerwać i zacząć od nowa?\npt:A impressão está em curso. Cancelar e reiniciar?\nro:Tipărirea este încă în curs. Opresc și reiau ?\nru:Печать ещё не завершена. Отменить и начать заново?\nsk:Prebieha tlač. Prerušiť a začať znova?\nsl:Tiskanje je še vedno v teku. Prekinem in začnem znova?\nsp-rs:Štampanje je još uvek u toku. Želite li da prekinete štampanje i počnete ponovo?\nsq:Printimi vijon. Do e ndërprisni dhe e filloni nga e para?\nsr-rs:Штампање је још увек у току. Желите ли да прекинете штампање и почнете поново?\nsv:Utskriften pågår fortfarande. Avbryt och börja om?\nta:அச்சிடுதல் செயல்பாட்டில் உள்ளது. கைவிட்டு மீண்டும் தொடங்கவா?\ntr:Yazıcı hala kullanımda. Durdurup yeniden başlatılsınmı?\ntw:正在列印，是否要放棄並重新設定？\nuk:Друк ще не завершено. Перервати та розпочати знову?\nuz:Chop etilmoqda. To'xtatilib qaytadan boshlansinmi?\nvn:Vẫn còn đang in. Thoát và bắt đầu lại?\n:Printing page %d of %d...\nam:Տպում է %d էջը %d-ից...\nar:طباعة الصفحة %d من %d...\naz:%d/%d səhifə çap olunur...\nbg:Отпечатване на страница %d от %d...\nbr:Imprimindo página %d de %d...\nbs:Štampam stranicu %d od %d...\nca-xv:S'està imprimient la pàgina %d de %d...\nca:S'està imprimient la pàgina %d de %d...\ncn:正在打印第 %d 页/共 %d 页\ncy:Argraffu tudalen %d o %d...\ncz:Tisk stránky %d z %d...\nde:Drucke Seite %d von %d…\ndk:Udskriver side %d af %d ...\nel:Εκτύπωση σελίδας %d από %d...\nes:Imprimiendo página %d de %d...\net:Lehekülje %d/%d printimine...\neu:%d orria %d-tik irarkitzen...\nfa:در حال چاپ کردن صفحه‌ی %d از %d...\nfi:Tulostetaan sivua %d/%d...\nfr:Impression de la page %d sur %d...\nga:Ag clóbhualadh leathanach a %d as %d...\ngl:Imprimir páxina %d de %d...\nhe:מדפיס עמוד %d מתוך %d...\nhi:पृष्ठ %d %d का छप रही है...\nhr:Ispis stranice %d od %d...\nhu:%d. oldal nyomtatása a(z) %d-ből...\nid:Mencetak halaman %d dari %d...\nit:Stampa pagina %d di %d...\nja:%d / %d ページ目を印刷中...\nka:მიმდინარეობს %d (%d-იდან) გვერდის ამობეჭდვა...\nkr:%d / %d 페이지 인쇄하는 중...\nku:%d پەڕە لە %d چاپکردنی...\nlt:Spausdinamas %d puslapis iš %d...\nlv:Drukā %d lappusi no %d...\nmk:Печатење на страница %d од %d...\nmy:Mencetak halaman %d daripada %d...\nne:पृष्ठ %d (कुल %d मध्ये) को छपाई हुदैछ ...\nnl:Pagina %d van %d afdrukken...\nnn:Skriver ut side %d av %d...\nno:Skriver ut side %d av %d...\npl:Drukowanie strony %d z %d...\npt:A imprimir página %d de %d...\nro:Tipărește pagina %d din %d...\nru:Печать страницы %d из %d...\nsk:Tlač strany %d z %d...\nsl:Tiskanje strani %d od %d …\nsp-rs:Štampanje %d. stranice od ukupno %d...\nsq:Printon faqen %d nga %d...\nsr-rs:Штампање %d. странице од укупно %d...\nsv:Skriver ut sida %d av %d...\nta:அச்சிடும் பக்கம் %d உள் %d\ntr:Sayfa %d %d yazdırılıyor...\ntw:正在列印第 %d 頁（共 %d 頁）\nuk:Друк сторінок з %d до %d...\nuz:%d betni %d dan chop etilmoqda...\nvn:Đang in trang %d trên %d...\n:Printing problem.\naf:Druk Probleem.\nam:Սխալ տպելիս\nar:يوجد مشكلة في الطباعة\naz:Çap xətası.\nbg:Проблем при печатане.\nbn:মুদ্রণ করতে সমস্যা হয়েছে\nbr:Problema de impressão.\nbs:Problem prilikom štampe.\nby:Памылка з друкаваннем.\nca-xv:S'ha produït un problema en la impressió.\nca:S'ha produït un problema en la impressió.\ncn:打印问题。\ncy:Anhawster argraffu\ncz:Potíže s tiskem\nde:Druckerproblem\ndk:Udskriftsproblem.\nel:Πρόβλημα εκτύπωσης.\nes:Problema de impresión.\net:Probleem printimisel\neu:Arazoak irarkitzerakoan.\nfa:مشکل در چاپ.\nfi:Tulostusongelma\nfr:Problème d'impression.\nfy-nl:Probleem by it ôfdrukken.\nga:Fadhb chlóbhuailte.\ngl:Problema de impresión.\nhe:שגיאת הדפסה.\nhi:परिंट करने में गलती\nhr:Problem prilikom ispisivanja.\nhu:Nyomtatási probléma.\nid:Masalah pencetakan.\nit:Problemi di stampa.\nja:印刷の問題です。\nka:ამობეჭდვის პრობლემა.\nkr:인쇄하는 중에 문제가 발생했습니다.\nku:کێشە هەیە لە  چاپکردندا.\nkw:Kaletter ow pryntya\nlt:Spausdinimo problema.\nlv:Drukas problēma.\nmk:Проблем при печатење.\nml:അച്ചടിയില് തകരാര്‍\nmm:ပုံနှိပ် ကရိယာ ပြသာနာ\nmy:Masalah mencetak\nne:छपाइ समस्या.\nnl:Probleem bij het afdrukken\nnn:Skrivarfeil\nno:Problem med utskrift.\npa:ਪਰਿਨਟ ਕਰਨ ਵਿੱਚ ਗਲਤੀ\npl:Problem z drukowaniem.\npt:Erro de impressão\nro:Problemă la imprimare.\nru:Ошибка при печати.\nsi:මෘද්‍රණ දෝශ.\nsk:Problém pri tlači.\nsl:Težave pri tiskanju.\nsn:Dambudziko pakuprinta\nsp-rs:Problem prilikom štampanja.\nsq:Problem në printim.\nsr-rs:Проблем приликом штампања.\nsv:Utskriftsproblem.\nta:அச்சுப்பொறி சிக்கல்\nth:การพิมพ์เกิดปัญหา\ntl:May Problema sa Pagpi-print.\ntr:Yazdırma problemi.\ntw:列印問題\nuk:Помилка друкування.\nuz:Chop etish muammosi.\nvn:Lỗi in.\n:Re&name...\\tF2\nam:Վե&րանվանել...\\tF2\nar:إعادة تسمية...\\tF2\naz:A&dını dəyişdir...\\tF2\nbg:Преименувай...\\tF2\nbr:Re&nomear...\\tF2\nbs:Promije&ni naziv...\\tF2\nca-xv:Canvia el &nom...\\tF2\nca:Canvia el &nom...\\tF2\ncn:重命名(&N)...\\tF2\ncy:&Ailenwi...\\tF2\ncz:Přejme&novat...\\tF2\nde:Umbe&nennen…\\tF2\ndk:Om&døb ... \\tF2\nel:&Μετονομασία...\\tF2\nes:Re&nombrar...\\tF2\net:&Nimeta ümber...\\tF2\neu:&Berrizendatu...\\tF2\nfa:تغییر  &نام...\\tF2\nfi:&Uudelleennimeä...\\tF2\nfr:Re&nommer...\\tF2\nga:Athainmnigh...\\tF2\ngl:Re&nomear...\\tF2\nhe:שנה שם...\\tF2\nhi:&नाम बदलें...\\tF2\nhr:Preime&novati...\\tF2\nhu:Átnevezés...\\tF2\nid:&Ganti Nama...\\tF2\nit:Ri&nomina...\\tF2\nja:名前を変更(&N)...\\tF2\nkr:이름 바꾸기(&N)...\\tF2\nku:گۆڕینی &ناو...\\tF2\nlv:Pār&dēvēt...\\tF2\nmk:Преименувај... \\tF2\nmy:&Nama semula ...\\tF2\nne:नाम &फेर्नुहोस्...\\tF2\nnl:&Naam wijzigen...\\tF2\nnn:Gjev n&ytt namn...\\tF2\nno:Gi nytt &navn... \\tF2\npl:Zmień &nazwę...\\tF2\npt:Mudar &nome...\\tF2\nro:Rede&numire...\\tF2\nru:Пере&именовать...\\tF2\nsk:Preme&novať...\\tF2\nsl:Preime&nuj …\\tF2\nsp-rs:Preimenuj...\\tF2\nsq:Rie&mërtoj...\\tF2\nsr-rs:Преименуј...\\tF2\nsv:Döp om\nta:மறுபெயரிடுதல்... \\tF2\ntr:İsim Değiştir\ntw:重新命名(&N)...\\tF2\nuk:Перейменувати...\\tF2\nuz:&Nomini o'zgartirish...\\tF2\nvn:Đổi tê&n...\\tF2\n:Remember &opened files\nam:Հիշել &բացված ֆայլերը\nar:تذكر الملفات المفتوحة\naz:&Açılmış faylları yadda saxla\nbg:&Запомни отворените файлове\nbr:&Lembrar arquivos abertos\nbs:Zapamti &otvorene fajlove\nby:&Запомніць адкрытыя файлы\nca-xv:Recorda els fitxers &oberts\nca:Recorda els fitxers &oberts\ncn:记住已打开的文件(&O)\ncy:Co&fio ffeiliau ar agor\ncz:Pamatovat si &otevřené soubory\nde:Liste der &zuletzt geöffneten Dokumente anlegen\ndk:Husk &åbnede filer\nel:Απο&μνημόνευση προσφάτων αρχείων\nes:Recordar archiv&os abiertos\net:Jäta &avatud failid meelde\neu:&Gogoratu irekitako agiriak\nfa:پرونده‌های &باز را به خاطر بسپار\nfi:Muista &avatut tiedostot\nfr:Se rappeler les fichiers &ouverts\nfy-nl:Unthâld &iepene bestannen\nga:Cuimhnigh ar chomhaid &oscailte\ngl:Lembrar ficheiros abertos\nhe:שמור רשימת והגדרת קבצים שנפתחו\nhi:खोले गये फाइल &याद रखें\nhr:Upamti &otvorene datoteke\nhu:Korábban megnyitott fájlok listájának tárolása\nid:Ingat &berkas yang pernah dibuka\nit:Ric&orda file aperti\nja:開かれたファイルを記憶する(&O)\nka:&ფაილის პოზიციის დამახსოვრება\nkr:열었던 파일(들) 기억(&O)\nku:بیرخستنەوەی فایلە &کراوەکان\nkw:Kovhe restrennow ygerys\nlt:Įsiminti &atvertus failus\nlv:&Atcerēties atvērtos failus\nmk:Запомни ги &отворените датотеки\nmy:Ingat &fail yang telah dibuka\nne:&खोलिएका फाइलहरु सम्झनुहोस्\nnl:Onthoud ge&opende bestanden\nnn:Husk &opna filar\nno:Husk &åpnede filer\npl:Pamiętaj &otwierane pliki\npt:Lembrar ficheiros abert&os\nro:Ține minte fișierele deschise\nru:Запоминать &открытые файлы\nsi:&විවෘතකළ ගොනු මතකතබාගන්න\nsk:Zapamätať si &otvorené súbory\nsl:&Zapomni si odprte datoteke\nsp-rs:Zapamti otvarane datoteke\nsq:Mbaj mend skedat e &hapura\nsr-rs:Запамти отваране датотеке\nsv:Kom ihåg öppnade &filer\nta:திறந்த &கோப்புகளை நினைவுகொள்\ntl:Alalahanin ang mga binuksang files\ntr:&Açılan dosyaları hatırla\ntw:記憶最近開啟的檔案(&O)\nuk:Запам'ятати відкриті файли\nuz:&Ochilgan fayllarni eslab qolish\nvn:Nhớ các tập tin đã mở\n:Remove from favorites\naf:Verwyder van gunstelinge\nam:Հեռացնել ընտրյալներից\nar:ازالة من المفضلة\naz:Seçilmişlərdən sil\nbg:Премахни от любимите\nbr:Remover dos Favoritos\nbs:Ukloni iz favorita\nca-xv:Suprimeix dels preferits\nca:Suprimeix dels preferits\ncn:自收藏删除\ncy:Tynnu o'r ffefrynnau\ncz:Odebrat z oblíbených\nde:Aus Favoriten entfernen\ndk:Fjern fra bogmærker\nel:Αφαίρεση από τα αγαπημένα\nes:Eliminar de favoritos\net:Kustuta lemmikutest\neu:Kendu Gogokoenetatik\nfa:حذف از علاقه‌مندی‌ها\nfi:&Poista suosikeista\nfr:Enlever des favoris\nga:Bain ó na ceanáin\ngl:Eliminar de favoritos\nhe:הסר ממועדפים\nhi:पसंदीदा से निकालें\nhr:Ukloni iz favorita\nhu:Eltávolítás a kedvencek közül\nid:Hapus Dari Favorit\nit:Rimuovi dai Preferiti\nja:お気に入りから削除\nka:რჩეულებიდან წაშლა\nkr:즐겨찾기에서 제거\nku:لابردن لە پەسەندەکاندا\nlt:Pašalinti iš parankinių\nlv:Noņemt no izlases\nmk:Отстрани од омилени\nmy:Keluarkan daripada kegemaran\nne:मनपर्ने बाट हटाउनुहोस्\nnl:Verwijder uit favorieten\nnn:Fjern frå favorittar\nno:Fjern fra favoritter\npl:Usuń z ulubionych\npt:Remover dos favoritos\nro:Scoate de la favorite\nru:Удалить из избранного\nsk:Odobrať z obľúbených položiek\nsl:Odstrani iz priljubljenih\nsp-rs:Ukloni iz odabranih\nsq:Heq nga pëlqimet\nsr-rs:Уклони из одабраних\nsv:Ta bort från favoriter\nta:பிடித்தவற்றில் இருந்து நீக்குக\ntr:Sık kullanılanlardan çıkar\ntw:自最愛移除\nuk:Видалити із закладок\nuz:Tanlanganlardan o'chirish\nvn:Xóa khỏi Ưa thích\n:Remove page %s from favorites\nam:Հեռացնել %s  էջը ընտրյալներից\nar:حذف الصفحة %s من المفضلة\naz:%s. səhifəni seçilmişlərdən sil\nbg:Премахни страница %s от любимите\nbr:Remover página %s dos Favoritos\nbs:Ukloni stranicu %s iz favorita\nca-xv:Suprimeix la pàgina %s dels preferits\nca:Suprimeix la pàgina %s dels preferits\ncn:从收藏中删除第 %s 页\ncy:Tynnu tudalen %s o'r ffefrynnau\ncz:Odebrat stránku %s z oblíbených\nde:Seite %s aus Favoriten entfernen\ndk:Fjern side %s fra bogmærker\nel:Αφαίρεση σελίδας %s από τα αγαπημένα\nes:Eliminar página %s de favoritos\net:Kustuta lehekülg %s lemmikutest\neu:Kendu %s orrialdea gogokoenetatik\nfa:حذف صفحه‌ی %s از علاقه‌مندی‌ها\nfi:Poista sivu %s suosikeista\nfr:Enlever page %s des favoris\nga:Bain leathanach a %s ó na ceanáin\ngl:Eliminar páxina %s de favoritos\nhe:הסר את עמוד מס' %s ממועדפים\nhi:पसंदीदा से %s पृष्ठ को निकालें\nhr:Ukloni stranicu %s iz favorita\nhu:%s. oldal eltávolítása a kedvencek közül\nid:Hapus Halaman %s Dari Favorit\nit:Rimuovi la pagina %s dai Preferiti\nja:ページ %s をお気に入りから削除\nka:%s გვერდის წაშლა რჩეულებიდან\nkr:즐겨찾기에서 %s 페이지 제거\nku:لە لیستی پەسەندەکاندا %s لابردنی پەڕەی\nlt:Pašalinti %s puslapį iš parankinių\nlv:Noņemt %s lappusi no izlases\nmk:Отстрани страница %s од омилени\nmy:Padam halaman %s dari kegemaran\nne:मनपर्ने बाट पृष्ठ %s लाई हटाउनुहोस्\nnl:Verwijder pagina %s uit favorieten\nnn:Fjern side %s frå favorittene\nno:Fjern side %s fra favoritter\npl:Usuń stronę %s z ulubionych\npt:Remover página %s dos favoritos\nro:Scoate pagina %s de la favorite\nru:Удалить стр. %s из избранного\nsk:Odobrať stranu %s z obľúbených položiek\nsl:Odstrani stran %s iz priljubljenih\nsp-rs:Ukloni stranicu %s iz odabranih\nsq:Heq faqen %s nga pëlqimet\nsr-rs:Уклони страницу %s из одабраних\nsv:Ta bort sida %s från favoriter\nta:%s பக்கத்தை பிடித்தவையில் இருந்து நீக்குக\ntr:Sayfa %s sık kullanılanlardan çıkar\ntw:從我的最愛中移除第 %s 頁\nuk:Видалити %s сторінку із закладок\nuz:%s betni tanlanganlardan o'chirish\nvn:Xoá trang %s khỏi Ưa thích\n:Rename To\naf:Hernoem na\nam:Վերանվանել՝\nar:إعادة تسمية إلى\naz:Adını dəyişdir\nbg:Преименувай на\nbr:Renomear para\nbs:Promije&ni naziv u\nca-xv:Canvia el nom a\nca:Canvia el nom a\ncn:重命名到\ncy:Ailenwi i\ncz:Přejmenovat na\nde:Umbenennen zu\ndk:Omdøb til\nel:Μετονομασία\nes:Renombrando a...\net:Nimeta ümber\neu:Berrizendatu Honela\nfa:تغییر نام به\nfi:Uudelleennimeä\nfr:Renommer En\nga:Athainmnigh chuig\ngl:Renomear como\nhe:שינוי שם\nhi:नाम बदल कर​\nhr:Preimenuj u\nhu:Átnevezés\nid:Ganti Nama Menjadi\nit:Rinomina in\nja:名前の変更名\nkr:바꿀 이름\nku:گۆڕینی ناو بۆ\nlv:Pārdēvēt uz\nmk:Преименувај во\nmy:Namakan sebagai\nne:नाम फेर्नुहोस्\nnl:Naam wijzigen in\nnn:Gjev nytt namn\nno:Endre Navn Til\npl:Zmień nazwę na\npt:Mudar nome para\nro:Redenumește la\nru:Переименовать в\nsk:Premenovať na\nsl:Preimenuj v\nsn:chinja zita kuinda\nsp-rs:Preimenuj u\nsq:Riemërtoj si\nsr-rs:Преименуј у\nsv:Döp om till\nta:மறுபெயரிட்டு\ntr:Belirtilen İsme Değiştir\ntw:重新命名為\nuk:Перейменувати в\nuz:Yangi nom\nvn:Đổi tên thành\n:Rotate &Left\\tCtrl+Shift+-\naf:Draai Links\\tCtrl+Shift+-\nam:Պտտել ձախ\\tCtrl+Shift+-\nar:دوران لليسار\\tCtrl+Shift+-\naz:So&la döndər\\tCtrl+Shift+-\nbg:Завъртане на&ляво\\tCtrl+Shift+-\nbn:বামদিকে বিবর্তন\\tCtrl+Shift+-\nbr:Girar à esquerda\\tCtrl+Shift+-\nbs:Rotiraj nalijevo\\tCtrl+Shift+-\nby:Павярнуць налева\\tCtrl+Shift+-\nca-xv:Gira a l'esquerra\\tCtrl+Shift+-\nca:Gira a l'esquerra\\tCtrl+Shift+-\ncn:向左旋转(&L)\\tCtrl+Shift+-\ncy:Troi i'r &Chwith\\tCtrl+Shift+-\ncz:Otočit do&leva\\tCtrl+Shift+Num-\nde:&Gegen UZS drehen\\tStrg+Umschalt+-\ndk:Roter mod &venstre\\tCtrl+skift+-\nel:Περιστροφή αριστερά\\tCtrl+Shift+-\nes:Girar a la izquierda\\tCtrl+Mayús+-\net:Pööra &vasemale\\tCtrl+Shift+-\neu:Itzulikatu E&zkerrerantz\\tKtrl+Shift+-\nfa:چرخاندن به &چپ\\tCtrl+Shift+-‎\nfi:Käännä &vasemmalle\\tCtrl+Shift+-\nfr:Rotation &antihoraire\\tCtrl+Maj+-\nfy-nl:Linksom draaie\\tCtrl+Shift+-\nga:Rothlaigh tuathalach\\tCtrl+Shift+-\ngl:Xirar á esquerda\\tCtrl+Shift+-\nhe:סובב שמאלה\nhi:बांयी ओर घूमाओ\\tCtrl+Shift+-\nhr:Zaokreni nalijevo\\tCtrl+Shift+-\nhu:Forgatás balra\\tCtrl+Shift+-\nid:Putar Ke Kiri\\tCtrl+Shift+-\nit:Ruota a &sinistra\\t<Ctrl> <Maiusc> -\nja:左に回転(&L)\\tCtrl+Shift+-\nka:მარ&ცხნივ გადაბრუნება\\tCtrl+Shift+-\nkr:반시계 방향으로 회전(&L)\\tCtrl+Shift+-\nku:سوڕانەوە بۆلای &چەپ\\tCtrl+Shift+-\nkw:Treylya a-gledh\\tCtrl+Shift+-\nlt:Pasukti į &kairę\\tCtrl+Shift+-\nlv:Pagriezt pa &kreisi\\tCtrl+Shift+-\nmk:Ротирај на лево\\tCtrl+Shift+-\nml: ഇടത്തേക്കു ചരിക്കുക\\tCtrl+Shift+-\nmm:ဘယ်သို့ လှဲ့\\tCtrl+Shift+-\nmy:Ubah ke kiri\\tCtrl+Shift+-\nne:&बायाँ घुमाउनुहोस्\\tCtrl+Shift+-\nnl:Linksom draaien\\tCtrl+Shift+-\nnn:Roter til venstre\\tCtrl+Shift+-\nno:Roter mot klokken\\tCtrl+Shift+Strek\npa:ਸੱਜੇ ਪਾਸੇ ਘੁਮਾਓ\\tCtrl+Shift+-\npl:Obróć w &lewo\\tCtrl+Shift+Minus\npt:Rodar à &esquerda\\tCtrl+Shift+-\nro:Rotește spre stânga\\tCtrl+Shift+-\nru:Повернуть в&лево\\tCtrl+Shift+-\nsi:&වමට හරවන්න\\tCtrl+Shift+-\nsk:Otočiť &vľavo\\tCtrl+Shift+-\nsl:Zasukaj v levo\\tCtrl+Shift+-\nsn:Tenderedza kuruboshwe\\tCtrl+Shift+-\nsp-rs:Rotiraj ulevo\\tCtrl+Shift+-\nsq:Kthej &majtas\\tCtrl+Shift+-\nsr-rs:Ротирај улево\\tCtrl+Shift+-\nsv:Rotera åt vänster\\tCtrl+Shift+-\nta:இடதுப்புறம் சுழற்று\\tCtrl+Shift+-\nth:หมุนซ้าย\\tCtrl+Shift+-\ntl:Iikot Pakaliwa\\tCtrl+Shift+-\ntr:S&ola çevir\\tCtrl+Shift+-\ntw:頁面左旋(&L)\\tCtrl+Shift+-\nuk:Повернути ліворуч\\tCtrl+Shift+-\nuz:&Chapga burish\\tCtrl+Shift+-\nvn:Quay trái\\tCtrl+Shift+-\n:Rotate &Right\\tCtrl+Shift++\naf:Draai Regs\\tCtrl+Shift++\nam:Պտտել աջ\\tCtrl+Shift++\nar:دوران لليمين\\tCtrl+Shift++\naz:Sa&ğa döndər\\tCtrl+Shift++\nbg:Завъртане на&дясно\\tCtrl+Shift++\nbn:ডানদিকে বিবর্তন\\tCtrl+Shift++\nbr:Girar à direita\\tCtrl+Shift++\nbs:Rotiraj nadesno\\tCtrl+Shift++\nby:Павярнуць направа\\tCtrl+Shift++\nca-xv:Gira a la dreta\\tCtrl+Shift++\nca:Gira a la dreta\\tCtrl+Shift++\ncn:向右旋转(&R)\\tCtrl+Shift++\ncy:Troi i'r dde\\tCtrl+Shift++\ncz:Otočit dop&rava\\tCtrl+Shift+Num+\nde:Im &UZS drehen\\tStrg+Umschalt++\ndk:Roter mod &højre\\tCtrl+skift++\nel:Περιστροφή δεξιά\\tCtrl+Shift++\nes:Girar a la derecha\\tCtrl+Mayús++\net:Pööra &paremale\\tCtrl+Shift++\neu:Itzulikatu E&skuinera\\tKtrl+Shift++\nfa:چرخاندن به &راست\\tCtrl+Shift++‎\nfi:Käännä &oikealle\\tCtrl+Shift++\nfr:Rotation &horaire\\tCtrl+Maj++\nfy-nl:Rjochtsom draaie\\tCtrl+Shift++\nga:Rothlaigh deiseal\\tCtrl+Shift++\ngl:Xirar á dereita\\tCtrl+Shift++\nhe:סובב ימינה\nhi:दांयी ओर घूमाओ\\tCtrl+Shift++\nhr:Zaokreni nadesno\\tCtrl+Shift++\nhu:Forgatás jobbra\\tCtrl+Shift++\nid:Putar Ke Kanan\\tCtrl+Shift++\nit:Ruota a &destra\\t<Ctrl> <Maiusc> +\nja:右に回転(&R)\\tCtrl+Shift++\nka:მარ&ჯვნივ გადაბრუნება\\tCtrl+Shift++\nkr:시계 방향으로 회전(&R)\\tCtrl+Shift++\nku:سوڕانەوە بۆلای &ڕاست\\tCtrl+Shift++\nkw:Treylya a-dhyhow\\tCtrl+Shift++\nlt:Pasukti į &dešinę\\tCtrl+Shift++\nlv:Pagriezt pa &labi\\tCtrl+Shift++\nmk:Ротирај на десно\\tCtrl+Shift++\nml:വലത്തേക്കു ചരിക്കുക\\tCtrl+Shift++\nmm:ညာသို့ လှဲ့\\tCtrl+Shift++\nmy:Ubah ke kanan\\tCtrl+Shift++\nne:&दायाँ घुमाउनुहोस्\\tCtrl+Shift++\nnl:Rechtsom draaien\\tCtrl+Shift++\nnn:Roter til høgre\\tCtrl+Shift++\nno:Roter med klokken\\tCtrl+Shift+Pluss\npa:ਖੱਬੇ ਪਾਸੇ ਘੁਮਾਓ\\tCtrl+Shift++\npl:Obróć w &prawo\\tCtrl+Shift+Plus\npt:Rodar à &direita\\tCtrl+Shift++\nro:Rotește spre dreapta\\tCtrl+Shift++\nru:Повернуть в&право\\tCtrl+Shift++\nsi:&දකුණට හරවන්න\\tCtrl+Shift++\nsk:Otočiť vpravo\\tCtrl+Shift++\nsl:Zasukaj v desno\\tCtrl+Shift++\nsn:Tenderedza kurudyi\\tCtrl+Shift++\nsp-rs:Rotiraj udesno\\tCtrl+Shift++\nsq:Kthej &djathtas\\tCtrl+Shift++\nsr-rs:Ротирај удесно\\tCtrl+Shift++\nsv:Rotera åt höger\\tCtrl+Shift++\nta:வலப்புறம் சுழற்று\\tCtrl+Shift++\nth:หมุนขวา\\tCtrl+Shift++\ntl:Iikot Pakanan\\tCtrl+Shift++\ntr:&Sağa çevir\\tCtrl+Shift++\ntw:頁面右旋(&R)\\tCtrl+Shift++\nuk:Повернути праворуч\\tCtrl+Shift++\nuz:&O'ngga burish\\tCtrl+Shift++\nvn:Quay phải\\tCtrl+Shift++\n:Save As\naf:Stoor As\nam:Պահպանել որպես\nar:حفظ باسم\naz:Fərqli adla yadda saxla\nbg:Запис като\nbn:সংরক্ষণ এই রূপে\nbr:Salvar como\nbs:Spasi kao\nby:Захаваць як\nca-xv:Anomena i guarda\nca:Anomena i desa\ncn:另存为\ncy:Cadw fel\ncz:Uložit jako...\nde:Speichern unter…\ndk:Gem som\nel:Αποθήκευση ως\nes:Guardar como\net:Salvesta kui...\neu:Gorde Honela\nfa:ذخیره کردن با نام\nfi:Tallenna nimellä\nfr:Enregistrer sous\nfy-nl:Bewarje as\nga:Cuir i dtaisce mar\ngl:Gardar como\nhe:שמירה בשם\nhi:इस तरह संभालें\nhr:Spremi kao\nhu:Mentés másként\nid:Simpan Sebagai\nit:Salva come\nja:名前を付けて保存\nka:შენახვა როგორც\nkr:다른 이름으로 저장\nku:پاراستن وەکو\nkw:Gwitha avel\nlt:Įrašyti kaip\nlv:Saglabāt kā\nmk:Зачувај како\nml:എന്ന പേരില്‍ സൂക്ഷിക്കുക\nmm:ကဲ့သို့ သိမ်းပါ..\nmy:Simpan sebagai\nne:बचत गर्नुहोस्\nnl:Opslaan als\nnn:Lagre som\nno:Lagre som\npa:ਇੰਝ ਸੰਬਾਲੋ\npl:Zapisz jako\npt:Gravar como\nro:Salvează ca\nru:Сохранить как\nsi:ලෙස සුරකින්න\nsk:Uložiť ako\nsl:Shrani kot …\nsn:Sevha se\nsp-rs:Sačuvaj kao\nsq:Ruaj si\nsr-rs:Сачувај као\nsv:Spara som\nta:எனச் சேமி\nth:บันทึกเป็น\ntl:I-save bilang\ntr:Farklı kaydet\ntw:另存為\nuk:Зберегти як\nuz:Quyidagicha saqlash\nvn:Lưu thành\n:Save S&hortcut...\\tCtrl+Shift+S\nam:Պահպանել պ&իտակը...\\tCtrl+Shift+S\nar:حفظ الاختصار...\\tCtrl+Shift+S\naz:Yarlı&ğı yadda saxla...\\tCtrl+Shift+S\nbg:Запамети &кратък път към файла...\\tCtrl+Shift+S\nbr:S&alvar atalho...\\tCtrl+Shift+S\nbs:Spasi k&raticu...\\tCtrl+Shift+S\nca-xv:Guarda una &drecera...\\tCtrl+Maj+5\nca:Desa una &drecera...\\tCtrl+Maj+5\ncn:保存快捷方式(&H)...\\tCtrl+Shift+S\ncy:Cadw'r &Llwybr Byr...\\tCtrl+Shift+S\ncz:U&ložit zástupce...\\tCtrl+Shift+S\nde:&Verknüpfung speichern…\\tStrg+Umschalt+S\ndk:Gem ge&nvej ...\\tCtrl+skift+S\nel:Αποθήκευση &συντόμευσης...\\tCtrl+Shift+S\nes:Guardar A&cceso directo...\\tCtrl+Mayús+S\net:Salvesta &otsetee...\\tCtrl+Shift+S\neu:Gorde &Lasterbidea...\\tKtrl+Shift+S\nfa:ذخیره‌ی &میانبر...\\tCtrl+Shift+S\nfi:Tallenna p&ikakuvake...\\tCtrl+Shift+S\nfr:Enregistrer un raccourci... \\tCtrl+Maj-S\nga:Cuir an t-aicearra i dtaisce...\\tCtrl+Shift+S\ngl:Gardar atallo...\\tCtrl+Shift+S\nhe:שמור קיצור דרך...\\tCtrl+Shift+S\nhi:शॉ&र्टकट सहेजें... \\tCtrl+Shift+S\nhr:Spremi p&rečac...\\tCtrl+Shift+S\nhu:Parancsikon készítése...\\tCtrl+Shift+S\nid:Simpan &Jalan Pintas...\\tCtrl+Shift+S\nit:Salva &collegamento\\t<Ctrl>+<Maiusc>+S\nja:ショートカットを作成(&H)...\\tCtrl+Shift+S\nka:&ჩანიშვნა…\\tCtrl+Shift+S\nkr:바로가기 저장(&H)...\\tCtrl+Shift+S\nku:پاراستنی کورتە&ئایکۆن...\\tCtrl+Shift+S\nlv:Saglabāt saīs&ni....\\tCtrl+Shift+S\nmk:Зачувај &кратенка...\\tCtrl+Shift+S\nmy:Simpan S&hortcut...\\tCtrl+Shift+S\nne:&सर्टकट बचत गर्नुहोस्...\\tCtrl+Shift+S\nnl:Snelkoppeling opslaan...\\tCtrl+Shift+S\nnn:Large s&narveg...\\tCtrl+Shift+S\nno:Lagre s&narvei...\\tCtrl+Shift+S\npl:Utwórz skrót do dokumentu\\tCtrl+Shift+S\npt:Criar atal&ho...\\tCtrl+Shift+S\nro:Salvează legătura...\\tCtrl+Shift+S\nru:Сохранить &ярлык…\\tCtrl+Shift+S\nsk:Uložiť z&ástupcu...\\tCtrl+Shift+S\nsl:S&hrani bližnjico …\\tCtrl+Shift+S\nsp-rs:Sačuvaj prečicu...\\tCtrl+Shift+S\nsq:&Ruaj s&hkurtoren...\\tCtrl+Shift+S\nsr-rs:Сачувај пречицу...\\tCtrl+Shift+S\nsv:Spara g&enväg...\\tCtrl+Shift+S\nta:குறுக்குவழி சேமி...\\tCtrl+Shift+S\ntr:K&ısayolu kaydet...\\tCtrl+Shift+S\ntw:儲存為捷徑(&H)...\\tCtrl+Shift+S\nuk:Зберегти ярлик...\\tCtrl+Shift+S\nuz:&Yorliqni saqlash...\\tCtrl+Shift+S\nvn:Lưu lối tắt...\\tCtrl+Shift+S\n:Searching %d of %d...\nam:Փնտրվում է %d-ից %d\nar:يتم البحث %d من %d...\naz:%d/%d axtarılır...\nbg:Търсене в страница %d от %d...\nbr:Localizando %d de %d...\nbs:Pretražujem %d od %d...\nby:Апрацоўка старонкі %d з %d...\nca-xv:S'està cercant %d de %d...\nca:S'està cercant %d de %d...\ncn:正在搜索第 %d 页/共 %d 页\ncy:Chwilio am %d o %d...\ncz:Prohledává se %d z %d...\nde:Durchsuche Seite %d von %d…\ndk:Søger i %d af %d ...\nel:Αναζήτηση %d από %d...\nes:Buscando %d de %d...\net:Otsitakse %d/%d...\neu:%d-tik %d bilatzen...\nfa:در حال جستجوی %d از %d...\nfi:Etsitään %d/%d...\nfr:Recherche de %d à %d...\nfy-nl:Sykje %d fan %d...\nga:Ag cuardach %d as %d...\ngl:Procurando %d de %d...\nhe:מחפש %d מתוך %d...\nhi:खोज रहा %d %d का...\nhr:Pretražujem %d. stranicu (od %d)...\nhu:Keresés a(z) %d./%d oldalon\nid:Sedang mencari %d dari %d\nit:Ricerca: %d di %d...\nja:%d (%d 中) を検索しています...\nka:მიმდინარეობს ძებნა %d %d-იდან...\nkr:%d / %d 페이지 검색하는 중...\nku:...%d لە %d گەڕانی\nkw:Ow hwilas %d a %d...\nlt:Ieškoma %d iš %d...\nlv:%d no %d meklēšana...\nmk:Пребарувам %d од %d страници...\nmy:Mencari %d dari %d...\nne:%d (कुल %d मध्ये) मा खोजि हुदैछ...\nnl:Zoek %d van %d...\nnn:Søkjer gjennom %d av %d...\nno:Søker %d av %d...\npl:Szukanie %d z %d...\npt:A procurar %d de %d...\nro:Caut %d din %d...\nru:Обработка страницы %d из %d...\nsi:සොයමින් %d of %d...\nsk:Vyhľadáva sa %d z/zo %d...\nsl:Preiskovanje strani %d od %d …\nsp-rs:Pretraživanje %d. stranice od ukupno %d...\nsq:Kërkon %d nga %d...\nsr-rs:Претраживање %d странице од укупно %d...\nsv:Söker %d av %d...\nta:%d இல் %d தேடப்படுகிறது....\ntl:Hinahanap ang %d ng %dâ€¦\ntr:%d sayfa (toplam %d sayfa) taranıyor...\ntw:正在搜尋第 %d 頁 (共 %d 頁)\nuk:Пошук %d з %d...\nuz:%d %d dan qidirilmoqda...\nvn:Đang tìm %d trên %d\n:Select &All\nam:Նշել &բոլորը\nar:حدد &الكل\naz:&Hamısını seç\nbg:Избери всичко\nbr:Selecion&ar tudo\nbs:Označi &sve\nca-xv:Selecciona-ho &tot\nca:Selecciona-ho &tot\ncn:全选(&A)\ncy:Dewis &Popeth\ncz:Vybrat &vše\nde:Alles &markieren\ndk:Marker &alt\nel:Επιλογή ό&λων\nes:Seleccionar &todo\net:V&ali kõik\neu:Hautatu G&uztiak\nfa:انتخاب &همه\nfi:V&alitse kaikki\nfr:&Tout sélectionner\nga:Roghnaigh Uile\ngl:Seleccion&ar todo\nhe:בחר הכל\nhi:सब &चुनें\nhr:Obilježi &sve\nhu:&Összes kijelölése\nid:Pilih Semu&a\nit:Seleziona &tutto\nja:すべて選択(&A)\nka:ყ&ველას მონიშვნა\nkr:모두 선택(&A)\nku:دیاریکردنی &هەمووی\nlt:Pažymėti &viską\nlv:Atlasīt &visu\nmk:Избери сè\nmy:Pilih &Semua\nne:सबै &चयन गर्नुहोस्\nnl:&Alles selecteren\nnn:Vel &alle\nno:Merk &alt\npl:Zaznacz wszystko\npt:&Selecionar tudo\nro:Selecte&ază Tot\nru:В&ыделить все\nsk:Vybrať &všetko\nsl:Izberi vse\nsp-rs:Izaberi sve\nsq:Seleksionoj të &gjithë\nsr-rs:Изабери све\nsv:Markera &alla\nta:அனைத்தையும் தேர்வு செய்\ntl:Piliin lahat\ntr:&Hepsini Seç\ntw:全選(&A)\nuk:Вибрати всі\nuz:&Hammasini tanlash\nvn:Chọn hết\n:Select &All\\tCtrl+A\nam:Նշել &բոլորը\\tCtrl+A\nar:حدد&الكل\\tCtrl+A\naz:&Hamısını seç\\tCtrl+A\nbg:Избери &всичко\\tCtrl+A\nbr:Selecion&ar Tudo\\tCtrl+A\nbs:Označi &sve\\tCtrl+A\nca-xv:Seleccciona-ho &tot\\tCtrl+A\nca:Seleccciona-ho &tot\\tCtrl+A\ncn:全选(&A)\\tCtrl+A\ncy:Dewis &Popeth\\tCtrl+A\ncz:Vybrat &vše\\tCtrl+A\nde:Alles &markieren\\tStrg+A\ndk:Vælg &alt\\tCtrl+A\nel:Επιλογή όλων\\tCtrl+A\nes:Seleccionar &todo\\tCtrl+A\net:V&ali kõik\\tCtrl+A\neu:&Hautatu Guztiak\\tKtrl+A\nfa:انتخاب &همه\\tCtrl+A\nfi:V&alitse kaikki\\tCtrl+A\nfr:&Tout sélectionner\\tCtrl+A\nga:Roghnaigh Uile\\tCtrl+A\ngl:Seleccion&ar todo\\tCtrl+A\nhe:בחר הכל\\tCtrl+A\nhi:सब &चुनें\\tCtrl+A\nhr:Obilježi &sve\\tCtrl+A\nhu:Összes &kijelölése\\tCtrl+A\nid:Pilih Semu&a\\tCtrl+A\nit:Selezion&a tutto\\t<Ctrl>+A\nja:すべて選択(&A)\\tCtrl+A\nka:ყ&ველას მონიშვნა\\tCtrl+A\nkr:모두 선택(&A)\\tCtrl+A\nku:دیاریکردنی &هەمووی\\tCtrl+A\nlt:Pažymėti &viską\\tCtrl+A\nlv:Atlasīt &visu\\tCtrl+A\nmk:Избери сè\\tCtrl+A\nmy:Pilih Semu&a\\tCtrl+A\nne:सबै &चयन गर्नुहोस्\\tCtrl+A\nnl:&Alles selecteren\\tCtrl+A\nnn:Vel &alle\\tCtrl+A\nno:Merk &alle\\tCtrl+A\npl:Zaznacz &wszystko\\tCtrl+A\npt:&Selecionar tudo\\tCtrl+A\nro:Selectează &tot\\tCtrl+A\nru:В&ыделить все\\tCtrl+A\nsk:Vybrať &všetko\\tCtrl+A\nsl:Izberi vse\\tCtrl+A\nsp-rs:Izaberi sve\\tCtrl+A\nsq:Seleksionoj të &gjithë\\tCtrl+A\nsr-rs:Изабери све\\tCtrl+A\nsv:Välj &Allt\\tCtrl+A\nta:அனைத்தையும் தேர்வு செய் \\tCtrl+A\ntl:Piliin L&ahat\\tCtrl+A\ntr:T&ümünü Seç\\tCtrl+A\ntw:全選(&A)\\tCtrl+A\nuk:Вибрати всі\\tCtrl+A\nuz:&Hammasini tanlash\\tCtrl+A\nvn:Chọn hết\\tCtrl+A\n:Select content with Ctrl+left mouse button\nam:Նշել ընտրվածը Ctrl+մկնիկի ձախ կոճակով\nar:حدد المحتوى بالضغط على زر الفأرة الأيسر و Ctrl\naz:Məzmunu Ctrl+sol siçan düyməsi ilə seç\nbg:Изберете съдържание с Ctrl и левия бутон на мишката\nbr:Selecionar com Ctrl+Botão esquerdo do mouse\nbs:Izaberi sadržaj pomoću Ctrl+lijeva tipka miša\nca-xv:Seleccioneu contigut amb la combinació Ctrl+botó secundari del ratolí\nca:Seleccioneu contigut amb la combinació Ctrl+botó secundari del ratolí\ncn:按 Ctrl+鼠标左键 选定内容\ncy:Dewis cynnwys drwy Ctrl a botwm chwith y llygoden\ncz:Vybrat obsah klávesou Ctrl a levým tlačítkem myši\nde:Inhalte mit Strg+linker Maustaste auswählen\ndk:Vælg indhold med Ctrl+venstre museknap\nel:Επιλέξτε περιεχόμενο με Ctrl+αριστερό πλήκτρο ποντικιού\nes:Seleccionar con Ctrl+Botón. Izq. del ratón\net:Sisu valimiseks Ctrl+vasak hiirenupp\neu:Hautatu edukia Ktrl+ezker sagu botoiarekin\nfa:انتخاب محتوا با نگه داشتن کلید Ctrl و کلید سمت چپ موشی\nfi:Valitse sisältöä Ctrl+vasemmanpuoleinen hiiren painike\nfr:Sélectionner avec Ctrl+bouton gauche de la souris\nfy-nl:Selektearje ynhâld mei Ctrl+linker mûsknop\nga:Roghnaigh inneachar le Ctrl+an cnaipe luchóige ar chlé\ngl:Seleccionar contido con Ctrl+botón esquerdo do rato\nhe:בחר תוכן באמצעות Ctrl + לחצן עכבר שמאלי\nhi:सामग्री का चयन करने के लिये  Ctrl +  माउस का बायाँ बटन दबाएँ\nhr:Odaberi sadržaj pomoću Ctrl+lijeva tipka miša\nhu:Jelölje ki a másolandó részt Ctrl+Bal egérgombbal\nid:Pilih konten dengan tombol Ctrl+tombol kiri mouse\nit:Seleziona contenuti con <Ctrl>+pulsante sinistro del mouse\nja:Ctrl+左マウス ボタンで内容を選択します\nka:აირჩიეთ შიგთავსი, Ctrl და მაუსის მარცხენა ღილაკზე დაჭერით\nkr:Ctrl+마우스 왼쪽 버튼으로 내용을 선택하세요.\nku:Ctrl پێکهاتەکان دیاریبکە بەهۆی کلیکی چەپ و\nkw:Dewis dalgh gans Ctrl+boton-logosen kledh\nlt:Turinį žymėkite su Ctrl+kairiuoju pelės klavišu\nlv:Atlasīt saturu ar Ctrl+peles kreiso pogu\nmk:Селектирај со Ctrl и левото копче на глувчето\nmy:Pilih kandungan dengan Ctrl + butang kiri tetikus\nne:Ctrl+बायाँ माउसबटनले सामाग्री चयन गर्नुहोस्\nnl:Selecteer inhoud met Ctrl+linker muisknop\nnn:Vel innhald med Ctrl + venstre museknapp\nno:Velg innhold med Ctrl+Venstre museknapp\npl:Zaznacz zawartość wciskając Ctrl i lewy przycisk myszy\npt:Selecione o conteúdo com Ctrl+botão esquerdo do rato\nro:Selectați conținut cu Ctrl+buton stânga maus\nru:Выберите содержимое, нажав Ctrl и левую кнопку мыши\nsi:Ctrl+left mouse button සමග අන්තර්ගතය තෝරන්න\nsk:Označiť obsah s \"Ctrl + ľavé tlačidlo myši\"\nsl:Izberite vsebino s pritisnjeno tipko Ctrl in levim gumbom miške\nsp-rs:Izaberite sadržaj koristeći Ctrl + levo dugme miša\nsq:Seleksiononi materialin me Ctrl+butonin e majtë të mausit\nsr-rs:Изаберите садржај користећи Ctrl + лево дугме миша\nsv:Markera med Ctrl + vänster musknapp\nta:உள்ளடகத்தை தேர்வு செய்ய Ctrl+இடது சுட்டெலி பொத்தானை அழுத்து\ntl:Mamili ng content gamit ang Ctrl+left mouse button\ntr:İçeriği Ctrl+sol fare butonu ile seç\ntw:按 Ctrl+滑鼠左鍵選取內容\nuk:Виберіть вміст з допомогою Ctrl+ліва кнопка миші\nuz:Ctrl va sichqonchaning chap tugmasini bosib tarkibini tanlang\nvn:Đánh dấu nội dung bằng Ctrl+phím chuột trái\n:Select the folder where SumatraPDF should be installed:\nam:Ընտրեք թղթապանակում, որտեղ պետք է տեղակայվի SumatraPDF-ը՝\nar:المحمولة Sumatra حدد المجلد حيث يجب أن يكون مثبت مستندات :\naz:SumatraPDF-in quraşdırılacağı qovluğu seçin:\nbg:Изберете папката, в която да се инсталира SumatraPDF:\nbr:Selecione a pasta onde o SumatraPDF deverá ser instalado:\nbs:Izaberite direktorij gdje bi SumatraPDF trebao biti instaliran:\nca-xv:Seleccioneu la carpeta on voleu instal·lar el SumatraPDF:\nca:Seleccioneu la carpeta on voleu instal·lar el SumatraPDF:\ncn:选择 SumatraPDF 应被安装的文件夹：\ncy:Dewis y ffolder lle ddylai SumatraPDF gael ei gosod:\ncz:Vyberte adresář, do kterého chcete nainstalovat SumatraPDF:\nde:In welches Verzeichnis soll SumatraPDF installiert werden?\ndk:Vælg mappen hvor SumatraPDF skal installeres:\nel:Επιλέξτε το φάκελο που θα εγκατασταθεί SumatraPDF:\nes:Seleccione la carpeta de instalación de SumatraPDF:\net:Vali kataloog, mille seest SumatraPDF paigaldatakse.\neu:Hautatu SumatraPDF ezarri behar den agiritegia:\nfa:پوشه‌ای را برای نصب Sumatra PDF انتخاب کنید:\nfi:Valitse kansio, johon SumatraPDF asennetaan:\nfr:Sélectionner le répertoire d'installation de SumatraPDF :\nga:Roghnaigh an fillteán inar chóir SumatraPDF a shuiteáil:\ngl:Escolla o cartafol onde quere instalar SumatraPDF\nhe:בחר את תיקיית ההתקנה של SumatraPDF:\nhi:sumatraPDF स्थापित करने के लिए फोल्डर का चुनाव किजिए:\nhr:Odaberite mapu gdje bi trebalo instalirati SumatraPDF:\nhu:Válassza ki a SumatraPDF telepítési könyvtárát:\nid:Pilih folder instalasi SumatraPDF:\nit:Seleziona la cartella dove installare SumatraPDF:\nja:インストール先ディレクトリの選択:\nkr:SumatraPDF를 설치할 폴더 선택:\nku::SumatraPDF فۆڵدەرێک دیاریبکە بۆ دابەزاندنی\nlv:Atlasiet mapi, kurā jāinstalē SumatraPDF\nmk:Изберете ја папката каде што треба да се инсталира SumatraPDF:\nmy:Pilih folder di mana SumatraPDF harus dipasang:\nnl:Kies de folder waar SumatraPDF geinstalleerd moet worden:\nnn:Vel mappa der SumatraPDF skal bli installert:\nno:Velg mappe der SumatraPDF skal installeres:\npl:Wybierz folder, w którym należy zainstalować program SumatraPDF:\npt:Escolha a pasta de instalação do SumatraPDF:\nro:Alegeti folderul in care sa se instaleze SumatraPDF:\nru:Укажите папку установки SumatraPDF:\nsk:Vyberte adresár, kde sa má SumatraPDF nainštalovať:\nsl:Izberite mapo, kjer naj se namesti SumatraPDF:\nsp-rs:Odaberite folder gde želite da instalirate SumatraPDF:\nsq:Seleksiononi dosjen ku do të instalohet SumatraPDF:\nsr-rs:Одабрати фолдер за инсталацију СуматраПДФ\nsv:Välj en katalog där SumatraPDF ska installeras:\nta:சுமத்ராPDF நிறுவல் கோப்புறை தேர்வு செய்க:\ntr:SumatraPDF'in yükleneceği alanı seçin:\ntw:選擇 SumatraPDF 應被安裝的資料夾：\nuk:Виберіть папку, в яку буде встановлено SumatraPDF\nuz:SumatraPDF o'rnatish uchun jildni tanlang:\nvn:Chọn thư mục nơi mà SumatraPDF sẽ được cài đặt:\n:Selection:\nam:Նշվածը.\nar:التحديد\naz:Seçmə:\nbg:Избор:\nbr:Seleção:\nbs:Selekcija:\nca-xv:Selecció:\nca:Selecció:\ncn:选择:\ncy:Dewis:\ncz:Výběr:\nde:Auswahl:\ndk:Markering:\nel:Επιλογή:\nes:Selección:\net:Valik:\neu:Hautatpena:\nfa:انتخاب\nfi:Valinta:\nfr:Sélection :\nga:Roghnúchán\ngl:Selección:\nhe:בחירה:\nhi:चुनाव\nhr:Odabir:\nhu:Kijelölés:\nid:Seleksi:\nit:Selezione\nja:Selection:\nkr:선택:\nku:دیاریکراو:\nlv:Atlase:\nmk:Селекција:\nmy:Pilihan\nnl:Selectie\nnn:Utval:\nno:Valg:\npl:Selekcja:\npt:Selecção:\nru:Выделение:\nsk:Výber:\nsl:Izbor:\nsp-rs:Izbor\nsr-rs:Избор\nsv:Markering:\ntr:Seçim:\ntw:選取:\nuk:Виділення:\nuz:Tanlash:\nvn:Lựa chọn:\n:Send by &E-mail...\nam:Ուղարկել &էլ. փոստով\nar:إرسال ب&البريد الإلكتروني\naz:&E-poçtla göndər...\nbg:Изпрати по &електронната поща\nbr:Enviar por email...\nbs:Pošalji &e-mailom...\nca-xv:Envia per correu-&e...\nca:Envia per correu-&e...\ncn:通过电子邮件发送(&E)...\ncy:Anfon drwy &E-bost...\ncz:Odeslat &e-mailem...\nde:Per &E-Mail versenden…\ndk:Send med &e-post ...\nel:Α&ποστολή με E-mail...\nes:Enviar por correo &electrónico\net:Saada &e-postiga\neu:&Post@z bidali...\nfa:ارسال با پست ا&لکترونیکی...\nfi:Lä&hetä sähköpostilla\nfr:Envoyer par &courriel...\nfy-nl:Ferstjoer per &e-mail...\nga:Seol i ríomhphost...\ngl:Enviar por email...\nhe:שלח בדוא\"ל...\nhi:&ई - मेल द्वारा भेजें...\nhr:Pošalji &e-poštom...\nhu:Fájl küldése &e-mail-ben\nid:Kirim Via &Email...\nit:Invia via &email...\nja:電子メールで送信(&E)...\nka:&ელ.ფოსტით გაგზავნა...\nkr:이메일로 보내기(&E)...\nku:ناردن بەهۆی &پۆستی ئەلکترۆنیەوە...\nkw:Danvon der &e-bost...\nlt:Siųsti el. &paštu...\nlv:Nosūtīt pa &e-pastu\nmk:Испрати по &е-пошта...\nmy:Hantar melalui &Emel...\nne:&ई-मेल द्वारा पठाउनुहोस्...\nnl:Verzend per &e-mail...\nnn:Send med &E-post...\nno:Send med E-post...\npl:Dołącz do wiadomości &e-mail...\npt:&Enviar por correio eletrónico...\nro:Trimite pe &E-mail...\nru:Отправить по &электронной почте...\nsi:&E-mail... මගින් යවන්න\nsk:Odoslať &e-mailom...\nsl:Pošlji po &E-pošti …\nsp-rs:Pošalji putem e-pošte...\nsq:Dërgoj me &e-mail...\nsr-rs:Пошаљи путем е-поште...\nsv:S&kicka som epost...\nta:மின்னஞ்சலாக அனுப்பு...\ntl:Ipadala sa &email...\ntr:&E-mail ile yolla...\ntw:發送電郵(&E)...\nuk:Надіслати через E-mail...\nuz:&Elektron pochta orqali yuborish...\nvn:Gửi qua &email...\n:Set inverse search command-line\naf:Stel Die Teenoorgestelde Soek Command-Line\nam:Նշել փնտրման հրամանների տողը\nar:أمر البحث عن نص باتجاه معاكس\naz:Tərs axtarış komandasını təyin etmək\nbg:Въведи параметри за обратно търсене\nbn:সমাদেশ-পংক্তিতে বিলোম অনুসন্ধান নির্ধারণ করুন\nbr:Configurar pesquisa inversa\nbs:Postavi komandnu liniju za pretragu unazad\nby:Задаць каманду зваротнага пошуку\nca-xv:Cerca cap arrere\nca:Cerca cap enrere\ncn:设置反向搜索命令行\ncy:Gosod linell-orchymyn chwilio gwrthdro\ncz:Nastavit inverzní vyhledávání z příkazového řádku\nde:Befehlszeile für die Inverssuche setzen\ndk:Angiv omvendt søgekommandolinje\nel:Εμφάνιση γραμμής αντίστροφης αναζήτησης\nes:Establecer orden de consola para búsqueda inversa\net:Loo pööratud otsingu käsurida\neu:Ezarri alderantzizko bilaketa agindu-lerroa\nfa:تنظیم خط فرمان جستجوی وارونه\nfi:Aseta käänteinen haku komentorivillä\nfr:Configurer la recherche inverse\nfy-nl:Omkearde sykrjochting ynstelle\nga:Socruigh líne na n-orduithe cuardaigh aisiompaithe\ngl:Establecer liña de comandos da procura inversa\nhe:הגדר פקודת שורה לחיפוש הפוך\nhi:उलटी command-line खोज सैट करें\nhr:Omogući unazadnu pretragu\nhu:Fordított keresés parancsának beállítása\nid:Tetapkan baris perintah pencarian terbalik\nit:Imposta la ricerca inversa via riga di comando\nja:逆順検索コマンドラインの設定\nka:შებრუნებული ძებნის ბრძანების სტრიქონის დაყენება\nkr:명령줄 역방향 탐색 설정\nku:ڕێکخستنی هێڵی پێچەوانەی گەڕان\nkw:Settya linen-arhadow gorthhwilas\nlt:Nustatyti atvirkščios paieškos komandinę eilutę\nlv:Iestatīt inversās meklēšanas komandrindu\nmk:Активирај инверзно пребарување\nmm:command line ဗြောင်းပြန်ရှာကို သတ်မှတ်ရန်\nmy:Tetapkan pencarian songsang baris arahan\nne:आदेश पङ्‌क्ति उल्टो खोजाई सेट गर्नुहोस्\nnl:Omgekeerde zoekrichting instellen\nnn:Velg motsatt søk-kommandolinje\nno:Velg invertert kommandolinje for søk\npa:ਪੁੱਠੀ command-line ਖੋਜ ਸੈਟ ਕਰੋ\npl:Ustaw wiersz poleceń do odwrotnego wyszukiwania\npt:Definir linha de comandos para procura inversa\nro:Setați comandă pentru căutare inversă\nru:Задать команду обратного поиска\nsk:Nastaviť inverzné vyhľadávanie\nsl:Nastavi obratno iskanje ukazne vrstice\nsp-rs:Omogući inverznu pretragu\nsq:Jepni komandën e kërkimit mbrapsht\nsr-rs:Омогући инверзну претрагу\nsv:Sätt motsatt sök-kommandorad\nta:தலைகீழ் தேடல் கட்டளை வரி அமைக்க\nth:ตั้งค่าตรงกันข้ามในการค้นหาในโหมด command-line\ntl:Iayos ang Utos-Linya ng Tiwarik na Paghahanap\ntr:Sondan başa arama komut satırı\ntw:設定反向搜尋命令行\nuk:Установити зворотній пошук.\nuz:Teskari qidirish buyruq satrini moslash\nvn:Đặt dòng lệnh tìm kiếm ngược\n:Show &Bookmarks\nam:Ցուցադրել &Էջանիշերը\nar:اظهار &قوائم العناوين\naz:Ə&lfəcinləri göstər\nbg:Покажи отметките\nbr:Mostrar Fa&voritos\nbs:Pokaži &oznake\nca-xv:Mostra els &marcadors\nca:Mostra els &marcadors\ncn:显示书签(&B)\ncy:Dangos &Nodau Tudalen\ncz:Zobrazit &záložky\nde:Lese&zeichen anzeigen\ndk:Vis &bogmærker\nel:Εμφάνιση &σελιδοδεικτών\nes:Mostrar &marcadores\net:Näita &järjehoidjaid\neu:Erakutsi Laster&markak\nfa:ن&شانک‌ها را نشان بده\nfi:Näytä &Kirjanmerkit\nfr:Voir les &Marque-pages\nga:Lea&bharmharcanna a taispeáint\ngl:Amosar &marcadores\nhe:הצג סימניות\nhi:बुकमार्क दिखाएँ (&B)\nhr:Prikaži &oznake\nhu:Könyvjelzők mutatása\nid:Tampilkan &Markah\nit:Visualizza segnali&bri\nja:ブックマークを表示(&B)\nka:&სანიშნეების ჩვენება\nkr:책갈피 보이기(&B)\nku:پیشنادانی &نیشانەکراوەکان\nlv:Rādīt &grāmatzīmes\nmk:Прикажи &обележувачи\nmy:Papar &Bookmark\nne:&पुस्तकचिनोहरू देखाउनुहोस्\nnl:Bladwijzers tonen\nnn:Vis &bokmerkar\nno:Vis &bokmerker\npl:Pokaż &Zakładki\npt:&Mostrar marcadores\nro:Arata Se&bnele de Carte\nru:Показать &закладки\nsk:Zobraziť &Záložky\nsl:Prikaži &zaznamke\nsp-rs:Prikaži Obeleživače\nsq:Tregoj &faqet e shenjuara\nsr-rs:Прикажи обележене\nsv:Visa &Bokmärken\nta:புத்தகக்குறிகளை காட்டுக\ntr:Göster &Sık Kullanılanlar\ntw:顯示書籤 (&B)\nuk:Показати закладки\nuz:&Xatcho'plarni ko'rsatish\nvn:Hiện chỉ dấu sách\n:Show &Pages Continuously\nam:Էջերը &ցուցադրել շարունակական\nar:اظهار الصفحات باستمرار\naz:Səhifələri &ardıcıl göstər\nbg:&Непрекъснати страници\nbr:Exibir páginas de modo contínuo\nbs:Prikaži stranice slijedno\nca-xv:Mostra les &pàgines de forma contínua\nca:Mostra les &pàgines de forma contínua\ncn:连续显示页面(&P)\ncy:Dangos &tudalennau'n ddidor\ncz:Zobrazit stránky &průběžně\nde:Seiten &fortlaufend anzeigen\ndk:Vis &sider fortløbende\nel:&Συνεχής εμφάνιση σελίδων\nes:Mostrar &páginas de forma continua\net:Näita &lehekülgi pidevana\neu:&Erakutsi Orrialdeak Jarraian\nfa:به صورت &پیوسته\nfi:Näytä &sivut peräkkäin\nfr:&Vue continue\nfy-nl:Toan sides kontinue\nga:Teaspáin na leathanaigh go leanúnach\ngl:Amosar páxinas seguidas\nhe:הצג עמודים ברציפות\nhi:पृष्ठों को लगातार दिखाएँ\nhr:Prikaži stranice slijedno\nhu:Folyamatos nézet\nid:Tampilkan Halaman Secara &Kontinu\nit:&Pagine in modo continuo\nja:連続してページを表示(&P)\nka:&გვერდების შეუწყვეტლივ ჩვენება\nkr:연속적으로 페이지 보이기(&P)\nku:پیشاندانی پەڕەکان &بە بەردەوامی\nkw:Diskwedhes folennow heb aswa\nlt:&Puslapius rodyti nenutrūkstamai\nlv:Rādīt &lappuses nepārtraukti\nmk:Прикажувај страници непрекинато\nmy:Papar mukasurat secara berterusan\nne:पृष्ठहरु &निरन्तर देखाउनुहोस्\nnl:Toon pagina's doorlopend\nnn:Vis &sider kontinuerleg\nno:Vis sider kontinuerlig\npl:Wyświetlaj strony w układzie &ciągłym\npt:M&ostrar páginas contínuas\nro:Arată &paginile continuu\nru:Разрешить &прокрутку\nsi:අඛණ්ඩව &පිටු පෙන්වන්න\nsk:Zobraziť &strany priebežne\nsl:&Prikaži strani nepretrgano\nsp-rs:Prikaži stranice bez prekida\nsq:Tregoj &faqet në vazhdimësi\nsr-rs:Прикажи странице без прекида\nsv:Visa sidor fortlöpande\nta:பக்கங்களை தொடர்ச்சியாக காட்டு\ntl:Ipakita nang tuloy-tuloy ang mga &pahina\ntr:&Sayfaları devamlı göster\ntw:連續顯示頁面(&P)\nuk:Відображати сторінки безперервно\nuz:&Betlarni uzluksiz ko'rsatish\nvn:Xem trang liên tiếp\n:Show &Toolbar\naf:Vertoon Toolbar\nam:Ցուցադրել &գործիքները\nar:اظهار شريط الأدوات\naz:Alətlər &panelini göstər\nbg:Лен&та с инструменти\nbn:উপকরণপট্টি প্রদর্শন\nbr:Mostrar barra de ferramentas\nbs:Prikaži alatnu traku\nby:Паказ панэлі прылад\nca-xv:Mostra la &barra d'eines\nca:Mostra la &barra d'eines\ncn:显示工具栏(&T)\ncy:Dangos y &Bar Offer\ncz:Zobrazit panel nás&trojů\nde:&Werkzeugleiste anzeigen\ndk:Vis &værktøjslinje\nel:&Εμφάνιση γραμμής εργαλείων\nes:Mostrar barra de &herramientas\net:&Näita tööriistariba\neu:Erakutsi &Tresnabarra\nfa:نمایش نوار &ابزار\nfi:Näytä &työkalupalkki\nfr:Afficher la &barre d'outils\nfy-nl:Arkbalke toane\nga:Taispeáin an Barra Uirlisí\ngl:Amosar barra de ferramentas\nhe:הצג סרגל כלים\nhi:औजार वाली पट्टी दिखाओ\nhr:Prikaži alatnu traku\nhu:Eszköztár\nid:Tampilkan &Toolbar\nit:&Barra strumenti\nja:ツール バーの表示(&T)\nka:&ხელსაწყოთა ზოლის ჩვენება\nkr:도구모음 보이기(&T)\nku:پیشاندانی &شریتی ئامراز\nkw:Diskwedhes toulvar\nlt:Rodyti &priemonių juostą\nlv:Rādīt &rīkjoslu\nmk:Прикажи алатник\nml:റ്റുള്‍ബാര്‍  കാണിക്കുക\nmm:တူးလ်ဘား ပြပါ\nmy:Tunjukkan Bar Alat\nne:&उपकरणपट्टी देखाउनुहोस्\nnl:Werkbalk tonen\nnn:Vis verktylinje\nno:Vis verktøylinje\npa:ਸੰਦ ਵਾਲੀ ਫੱਟੀ ਵਖਾਓ\npl:Pokaż pasek &narzędzi\npt:Mostrar &barra de ferramentas\nro:Arată bara de instrumente\nru:Панель &инструментов\nsi:&මෙවලම්පුවරුව පෙන්වන්න\nsk:Zobraziť &panel nástrojov\nsl:Pokaži orodno vrstico\nsn:Ratidza Toolbar\nsp-rs:Traka sa alatkama\nsq:Tregoj &brezin e mjeteve\nsr-rs:Трака са алаткама\nsv:Visa verktygsfält\nta:கருவிப்பட்டை காண்பி\nth:แสดงแถบเครื่องมือ\ntl:Ipakita ang toolbar\ntr:&Araç çubuğunu göster\ntw:顯示工具列(&T)\nuk:Показати панель інструментів\nuz:&Asboblar panelini ko'rsatish\nvn:Hiện thanh công cụ\n:Show Favorites\nam:Ցուցադրել ընտրյալները\nar:إظهار المفضلة\naz:Seçilmişləri göstər\nbg:Покажи Любими\nbr:Mostrar Favoritos\nbs:Prikaži favorite\nca-xv:Mostra els preferits\nca:Mostra els preferits\ncn:显示收藏\ncy:Dangos Ffefrynnau\ncz:Zobrazit oblíbené položky\nde:Favoriten anzeigen\ndk:Vis bogmærker\nel:Εμφάνιση αγαπημένων\nes:Mostrar favoritos\net:Näita lemmikuid\neu:Erakutsi Gogokoenak\nfa:علاقه‌مندی‌ها را نشان بده\nfi:&Näytä suosikit\nfr:Voir Favoris\nga:Taispeáin Ceanáin\ngl:Amosar favoritos\nhe:הצג מועדפים\nhi:पसंदीदा दिखाएँ\nhr:Prikaži favorite\nhu:Kedvencek megjelenítése\nid:Tampilkan Favorit\nit:Visualizza Preferiti\nja:お気に入りの表示\nka:რჩეულების ჩვენება\nkr:즐겨찾기 보이기\nku:پیشاندانی پەسەندەکان\nlt:Rodyti parankinius\nlv:Rādīt &grāmatzīmes\nmk:Прикажи омилени\nmy:Papar kegemaran\nne:मनपर्नेहरु देखाउनुहोस्\nnl:Toon Favorieten\nnn:Vis favorittar\nno:Vis favoritter\npl:Pokaż ulubione\npt:Mostrar favoritos\nro:Arată favoritele\nru:Показать \"Избранное\"\nsk:Zobraziť obľúbené položky\nsl:Prikaži Priljubljene\nsp-rs:Prikaži odabrane stranice\nsq:Tregoj pëlqimet\nsr-rs:Прикажи одабране странице\nsv:Visa favoriter\nta:பிடித்தவைகளை காட்டுக\ntr:Sık kullanılanları göster\ntw:顯示最愛\nuk:Перелік закладок\nuz:Tanlanganlarni ko'rsatish\nvn:Hiện Ưa thích\n:Show frequently read\nam:Ցուցադրել հաճախակի բացվածները\nar:إظهار الأكثر قراءة\naz:Ən çox oxunanları göstər\nbg:Покажи често четените\nbr:Mostrar Lidos com frequência\nbs:Prikaži najčešće čitano\nca-xv:Mostra els més llegits\nca:Mostra els més llegits\ncn:显示最常阅读\ncy:Dangos darllenwyd yn aml\ncz:Zobrazit často čtené dokumenty\nde:Oft gelesene Dokumente einblenden\ndk:Vis hyppigt læste\nel:Εμφάνιση συχνά αναγνωσμένων αρχείων\nes:Mostrar «lo más leído»\net:Näita sageli loetud dokumente\neu:Erakutsi Sarri irakurriak\nfa:نشان دادن آخرین چیزهایی که خوانده‌اید\nfi:Näytä usein luetut\nfr:Montrer les documents fréquemment lus\nga:Taispeáin cinn léite go minic\ngl:Amosar lidos decote\nhe:הצג 'נקרא תכופות'\nhi:अक्सर पढ़े जाने वाले दिखाएँ\nhr:Prikaži najčešće čitano\nhu:Leggyakrabban olvasott fájlok mutatása\nid:Tampilkan Yang Sering Dibaca\nit:Visualizza letto frequentemente\nja:よく読むファイル一覧を表示\nka:ხშირად წაკითხულების ჩვენება\nkr:최근에 읽은 파일 보이기\nku:پیشاندانی زۆرترین خوێنراوەکان\nlt:Rodyti dažniausiai skaitomus\nlv:Rādīt bieži lasītos\nmk:Прикажи често читани\nmy:Paparkan dokuman yang kerap dibaca\nne:प्रायजसो पढिएको देखाउनुहोस्\nnl:'Eerder Weergegeven' tonen\nnn:Vis ofte lesne\nno:Vis ofte leste\npl:Pokaż często otwierane\npt:Mostrar frequentes\nro:Arată documentele citite frecvent\nru:Показать часто используемые документы\nsk:Zobraziť často čítané dokumenty\nsl:Prikaži pogosto brane\nsp-rs:Prikaži nedavno čitane\nsq:Tregoj leximet e shpeshta\nsr-rs:Прикажи недавно читане\nsv:Visa mest lästa\nta:அடிக்கடி படிப்பவை\ntr:Sık okunanları göster\ntw:顯示經常開啟的檔案\nuk:Найбільш часто читані\nuz:Tez-tez o'qiladiganlarni ko'rsatish\nvn:Hiện Đọc thường xuyên\n:Show the &bookmarks sidebar when available\nam:Հնարավորության դեպքում ցուցադրել &Էջերը\nar:اظهار &قائمة العناوين في الشريط الجانبي عند توفرها\naz:Mümkündürsə, ə&lfəcinlər panelini göstər\nbg:Покажи &показалеца в страничната колона когато е възможно\nbr:Mostrar barra lateral de marcadores quando disponível\nbs:Prikaži traku sa &zabilješkama kad je dostupna\nby:Паказваць панэль &закладак (пры магчымасці)\nca-xv:Mostra la &barra lateral de marcadors quan estiga disponible\nca:Mostra la &barra lateral de marcadors quan estigui disponible\ncn:可用时显示书签边栏(&B)\ncy:Dangos bar ochr y &nodau tudalen pan yw ar gael\ncz:Zo&brazit záložky v postranním panelu, jsou-li dostupné\nde:&Lesezeichen standardmässig anzeigen\ndk:Vis sidepanelet for &bogmærker når tilgængeligt\nel:Εμφάνιση &πλευρικής στήλης σελιδοδεικτών όπου είναι δυνατόν\nes:Mostrar la barra de &marcadores cuando esté disponible\net:Näita &järjehoidjate külgriba kui võimalik\neu:E&rakutsi lastermarka albobarra eskuragarri dagoenean\nfa:نوار ن&شانک‌ها را در صورت وجود نشان بده\nfi:Näytä &kirjanmerkit sivupalkissa, kun saatavilla\nfr:Voir la barre latérale des &signets lorsqu'elle est disponible\nfy-nl:Toan de &blêdwizerarkbalke as beskikber\nga:Taispeáin taobh-bharra na gceanán nuair atá sé ar fáil\ngl:Amosar a &barra de marcadores cando estea dispoñible\nhe:הצג סרגל-צד סימניות (כאשר זמין)\nhi:जब बुकमार्क साइडबार उपलब्ध हो उसे दिखाएँ\nhr:Prikaži traku &oznaka kad je dostupna\nhu:Dokumentumba ágyazott könyvjelzők mutatása\nid:Tampilkan kolom &markah jika tersedia\nit:Visualizza la &barra laterale dei segnalibri quando disponibile\nja:利用可能ならブックマーク サイド バーを表示(&B)\nka:&სანიშნეთა ზოლის ჩვენება (თუ შესაძლებელია)\nkr:사용 가능하면, 책갈피 옆구리 표시줄 보이기(&B)\nku:پیشاندانی &نیشانەکراوەکان لە تەنیشتەوە ئەگەر هەبوو\nkw:Diskwedhes &amalvar an lyververkyow mars eus onan\nlt:Rodyti &žymų parankinę, kai yra žymų\nlv:Rādīt &grāmatzīmju sānjoslu, ja tā ir pieejama\nmk:Прикажи го алатникот со &обележувачи кога е достапен\nmy:Tunjukkan &bookmark sidebar apabila ada\nne:उपलब्ध भएमा &पुस्तकचिनो छेउपट्‍टि देखाउनुहोस्\nnl:Toon de &bladwijzerwerkbalk indien beschikbaar\nnn:Vis &bokmerkesidelinja hvis den er tilgjengeleg\nno:Vis &bokmerkefanen om tilgjengelig\npl:Pokaż panel za&kładek, gdy są dostępne\npt:&Mostrar barra de marcadores quando disponível\nro:Arată bara laterală pentru &marcaje, când există\nru:Показывать панель &закладок (по возможности)\nsi:තිබෙනවිටදී &පිටුසලකුණු පැතිපුවරුව පෙන්වන්න.\nsk:Zobraziť bočný panel &záložiek, pokiaľ je dostupný\nsl:Pokaži podokno z &zaznamki, če so na voljo\nsp-rs:Prikaži bočnu traku sa obeleživačima\nsq:Tregoj &faqet e shenjuara kur janë të gatshme\nsr-rs:Прикажи бочну траку са обележивачима\nsv:Visa &bokmärken när de finns\nta:புத்தககுறி பட்டை இருந்தல் காட்டு\ntl:Ipakita ang &bookmarks sidebar kung naangkop\ntr:Yer &imleri yan çubuğunu bulunduğunda göster\ntw:可用時顯示書籤邊欄(&B)\nuk:Якщо доступно, показати бокову панель закладок\nuz:Mavjud bo'lganda &xatcho'plar panelini ko'rsatish\nvn:Hiện chỉ dấu sách nếu có\n:Single Page\naf:Enkele Bladsy\nam:Մեկ էջ\nar:صفحة واحدة\naz:Tək səhifə\nbg:Една страница\nbn:একটি পৃষ্ঠায়\nbr:Página única\nbs:Jedna stranica\nby:Адна старонка\nca-xv:Pàgina única\nca:Pàgina única\ncn:单个页面\ncy:Tudalen unigol\ncz:Jedna stránka\nde:Einzelne Seite\ndk:Enkelt side\nel:Μονή Σελίδα\nes:Página única\net:Üheleheküljeline\neu:Orrialde Bakarra\nfa:تک صفحه‌ای\nfi:Yksittäinen sivu\nfr:Une seule page\nfy-nl:Inkele side\nga:Leathanach Amháin\ngl:Unha soa páxina\nhe:עמוד יחיד\nhi:एक पृष्ठ\nhr:Jedna stranica\nhu:Egy oldalas\nid:Halaman Tunggal\nit:Pagina singola\nja:単一のページ\nka:ერთ-გვერდიანი\nkr:한 페이지씩\nku:پەڕەی تاک\nkw:Unn folen hepken\nlt:Atskirais puslapiais\nlv:Viena lappuse\nmk:Една страница\nml:ഒറ്റ താള്‍\nmm: တ မျက်နှာ\nmy:Satu Mukasurat\nne:एकल पृष्ठ\nnl:Enkele pagina\nnn:Enkel side\nno:Enkeltside\npa:ਇਕ ਪੰਨਾ\npl:Pojedyncza strona\npt:Uma página\nro:O singură pagină\nru:Постранично\nsi:තනි පිටුව\nsk:Jedna strana\nsl:Enostransko\nsn:Peji imwechete\nsp-rs:Pojedinačna stranica\nsq:Njëfletësh\nsr-rs:Појединачна страница\nsv:Enkel sida\nta:ஒற்றைப் பக்கம்\nth:หน้าเดี่ยว\ntl:Iisang Pahina\ntr:Tek sayfa\ntw:單頁模式\nuk:Одна сторінка\nuz:Bitta bet\nvn:Trang đơn\n:Some files to be installed are damaged or missing\nam:Տեղակայվող որոշ ֆայլեր վնասված են կամ բացակայում են\nar:بعض الملفات التي ستثبت قد  تكون تالفة أو مفقودة\naz:Bəzi quraşdırılacaq fayllar zədələnmişdir və ya yoxdur\nbg:Някои файлове които са нужни за инсталацията са повредени или липсват\nbr:Alguns arquivos de instalação estão danificados ou ausentes\nbs:Neki fajlovi koji bi trebali biti instalirani su ili oštećeni ili nedostaju\nca-xv:Alguns fitxers que s'han d'instal·lar no hi són o són malmesos\nca:Alguns fitxers que s'han d'instal·lar no hi són o són malmesos\ncn:某些安装所需的文件损坏或丢失\ncy:Mae rhai ffeiliau i'w gosod wedi eu difrodi neu ar goll\ncz:Některé soubory potřebné pro instalaci jsou poškozené nebo nebyly nalezeny\nde:Einige Dateien konnten nicht korrekt installiert werden\ndk:Nogle installationsfiler er beskadiget eller mangler\nel:Ορισμένα αρχεία προς εγκατάσταση είναι κατεστραμμένα ή λείπουν\nes:Algunos de los archivos que van a ser instalados estan dañados o no se encuentran\net:Mõned paigaldatavad failid on viga saanud või puuduvad\neu:Ezarritako zenbait agiri hondatuta edo galduta daude\nfa:بعضی از فایل‌های نصب خراب هستند یا وجود ندارند\nfi:Osa asennettavista tiedostoista on vahingoittuneita tai ne puuttuvat\nfr:Des fichiers prévus pour l'installation sont endommagés ou manquants\nga:Tá díobháil déanta de roinnt de na comhaid atá le suiteáil nó tá siad in easnamh\ngl:Algúns ficheiros a instalar están danados ou faltan\nhe:קובצי התקנה מסוימים פגומים או חסרים.\nhr:Neke datoteke za instalaciju su oštećene ili nedostaju\nhu:Néhány, a telepítéshez szükséges fájl sérült vagy hiányzik\nid:Beberapa berkas yang akan diinstal rusak atau terhapus.\nit:Alcuni file che dovevano essere installati erano corrotti o mancanti\nja:インストールすべきいくつかのファイルが破損しているか存在しません。\nkr:설치해야 할 일부 파일이 손상 또는 누락됐습니다.\nku:هەندێک فایلی دابەزاندن وونبوون یان تێکچوون\nlv:Kādi faili ir instalēti bojāti vai tie trūkst\nmk:Некои од датотеките што треба да се инсталираат се оштетени или недостасуваат\nmy:Sesetengah fail yang akan dipasang akan rosak atau hilang\nnl:Sommige bestanden voor de installatie zijn beschadigd of ontbreken\nnn:Nokre filar som skal installeres, enten mangler eller har forsvunnet.\nno:Noen filer som skal installeres er skadet eller mangler\npl:Niektóre pliki instalacyjne są uszkodzone lub niedostępne\npt:Alguns ficheiros do instalador estão danificados\nro:Niste fisiere ce trebuiesc instalate lipsesc sau sunt pleznite\nru:Некоторые файлы установки повреждены или отсутствуют\nsk:Niektoré inštalačné súbory sú poškodené alebo chýbajú\nsl:Nekatere datoteke za namestitev so poškodovane ali manjkajo\nsp-rs:Neki instalacioni fajlovi nedostaju ili su oštećeni\nsq:Janë dëmtuar ose mungojnë disa skeda që do të instalohen.\nsr-rs:Неки инсталациони фајлови су оштећени или недостају\nsv:Några installationsfiler saknas eller är skadade\nta:நிறுவப்பட்ட சில கோப்புகள் சேதமடைந்துள்ளன/காணவில்லை\ntr:Yüklü olması gereken bazı dosyalar eksik ve ya hasar görmüş\ntw:一些要安裝的檔案已損壞或丟失\nuk:Деякі файли необхідні для встановлення відсутні або пошкоджені\nuz:Ba'zi o'rnatilayotgan fayllar buzilgan yoki mavjud emas\nvn:Một số tập tin dùng để cài đặt đã bị lỗi hoặc bị thiếu\n:Sorry, that shouldn't have happened!\\n\\nPlease press 'Cancel', if you want to help us fix the cause of this crash.\nam:Կներեք, սա չպետք է տեղի ունենար։\\n\\nՍեղմեք 'Չեղարկել'՝եթե ցանկանում եք օգնել մեզ վերացնելու այս սխալը։\nar:الرجاء اضغط 'إلغاء الأمر'، إذا كنت ترغب في مساعدتنا على إصلاح هذا الحادث \\n\\n !آسف، أنه لا ينبغي أن يكون قد حدث\naz:Bağışlayın, gözlənilməz xəta baş verdi!\\n\\nProblemin həllində bizə kömək etmək üçün \"İmtina\" düyməsinə basın.\nbg:Извинете, това не би трябвало да се случва!\\n\\nМоля, натиснете „Отказ“, ако искате да ни помогнете да поправим причината за този срив (спиране).\nbr:Desculpe, isso não deveria ter acontecido!\\n\\nAperte 'Cancelar' se quiser nos ajudar a corrigir a causa deste erro.\nbs:Oprostite, ovo se nije trebalo dogoditi!\\n\\nMolimo kliknite 'Otkaži' ako nam želite pomoći ispraviti uzrok ovog rušenja.\nca-xv:Això no hauria d'haver passat!\\n\\nFeu clic a 'Cancel·la', si voleu ajudar-nos a corregir la causa d'este error\nca:Això no hauria d'haver passat!\\n\\nFeu clic a 'Cancel·la', si voleu ajudar-nos a corregir la causa d'aquest error.\ncn:抱歉，本不应该发生的！\\n\\n如果你希望帮助我们修复这个崩溃问题，请点击'取消'。\ncy:Ymddiheuriadau. Dylai hynny heb fod wedi digwydd!\\n\\nPwyswch 'Diddymu', os hoffech chi ein cynorthwyo i drwsio achos y gwall.\ncz:To se nemělo stát, omlouváme se.\\n\\nPokud nám chcete pomoci vyřešit příčinu tohoto pádu, klikněte na tlačítko Storno.\nde:Entschuldigen Sie bitte dieses unerwartete Missgeschick!\\n\\nBitte drücken Sie 'Abbrechen', wenn Sie uns beim Beheben dieses Fehlers behilflich sein möchten.\ndk:Desværre, det var ikke meningen\\n\\nKlik på »Afbryd«, hvis du kan og vil hjælpe med at finde årsagen til nedbruddet.\nel:Μας συγχωρείτε για το αναπάντεχο σφάλμα που συνέβη!\\n\\nΑν θέλετε να μας βοηθήσετε να αντιμετωπίσουμε το προβλήμα, παρακαλούμε πατήστε 'Άκυρο'.\nes:Lo sentimos, esto no debería haber sucedido...\\n\\nPresione «cancelar» si quiere ayudarnos a arreglar la causa del fallo.\net:Vabandust, seda ei oleks tohtinud juhtuda!\\n\\nPalun vajuta 'Loobu' kui soovid aidata meil parandada selle kokkujooksmise põhjust.\neu:Barkatu, hau ez litzake gertatu behar!\\n\\nMesedez sakatu 'ezeztatu', matxura hau eragin duena zuzentzen laguntzea nahi badiguzu.\nfa:متأسفیم، نباید اینطوری می‌شد!\\n\\n لطفاً اگر مایلید تا این مشکل را برطرف کنیم، کلید لغو را بزنید.\nfi:Pahoittelut, jotain odottamatonta tapahtui!\\n\\nPaina 'Peruuta' jos haluat auttaa tekijöitä korjaamaan tämän virheen.\nfr:Désolé, cela n'aurait pas dû se produire !\\n\\n Cliquez sur \"Annuler\" si vous voulez nous aider à remédier à ce crash\nga:Faraor, níor chóir go dtarlódh sin!\\n\\nBrúigh 'Cealaigh' le do thoil, más mian leat cuidiú linn údar an chliste seo a dheisiú.\ngl:Desculpe, isto non debería ocorrer\\n\\nPor favor, prema 'Cancelar', se quere axudarnos a reparar o motivo deste erro.\nhe:מצטערים על התקלה!\\n\\nאנא לחץ על 'ביטול' אם ברצונך לסייע לנו בפתרון הבעיה.\nhi:क्षमा करें, ऐसा नहीं होना चाहिए; अगर आप इस दुर्घटना को ठीक करने में मदद करना चाहते है : \\n\\n कृपया  'रद्द करें' दबाएँ |\nhr:Isprika, ovo se nije trebalo dogoditi!\\n\\nMolimo kliknite 'Otkaži' ako nam želite pomoći ispraviti uzrok ovog rušenja.\nhu:Sajnáljuk, váratlan hiba történt!\\n\\nKérjük nyomja meg a Mégse gombot, ha segíteni szeretne nekünk a hiba kijavításában.\nid:Maaf, ini seharusnya tidak terjadi!\\n\\nHarap tekan 'Batalkan', jika Anda ingin membantu kami membetulkan penyebab kegagalan ini.\nit:Questo non doveva succedere!\\n\\nSe vuoi aiutarci a capire la causa del blocco del programma seleziona <Annulla>.\nja:謎のエラーが発生しました！\\n\\n「キャンセル」をクリックして、このエラーが起こった状況を報告して下さると助かります。\nka:ბოდიშს გიხდით, ეს არ უნდა მომხდარიყო!\\n\\nთუ გსურთ რომ დაგვეხმაროთ ამ პრობლემის მოგვარებაში, გთხოვთ დააწკაპუნეთ ღილაკს 'გაუქმება'.\nkr:미안합니다, 그런 일이 일어날 리가 없는데!\\n\\n이 충돌의 원인을 해결하는데 도움을 주려면, '취소'를 누르세요.\nku:تکایە کلیک لەسەر 'پاشگەزبونەوە' ، بکە ئەگەر ئەتەوێ یارمەتیدەرمان بیت لە جارەسەرکردنی ئەم کێشەیە\\n\\n !ببورە، لە ڕوودانی ئەم کێشەیە\nlt:Apgailestaujame, taip neturėjo nutikti!\\n\\nSpustelėkite „Atsisakyti“, jeigu norite mums padėti pašalinti šios strigties priežastį.\nlv:Piedodiet, šim nevajadzēja notikt!\\n\\nLūdzu, spiediet 'Atcelt', ja jūs vēlaties mums palīdzēt novērst šīs kļūmes cēloni.\nmk:Извинете, ова не требаше да се случи!\\n\\nДоколку сакате да ни помогнете да го отстраниме овој проблем, Ве молам изберете 'Откажи'.\nmy:Maaf, itu tidak sepatutnya berlaku!\\nSila tekan 'Batal', jika anda ingin membantu kami menetapkan punca kemalangan ini.\nne:माफ गर्नुहोला, यस्तो हुनुहुदैनथ्यो\\n\\nयदि तपाई यो क्र्यास ठिक गर्न सहयोग गर्न चाहानुहुन्छ भने कृपया 'रद्द गर्नुस्' मा थिच्नुस |\nnl:Sorry, dit had niet mogen gebeuren!\\n\\nDruk 'Annuleren', als je wilt helpen de oorzaak van deze fout te vinden.\nnn:Beklager, dét skulle ikkje ha skjedd!\\n\\nVenligst trykk 'Lukk' hvis du vil hjelpe oss å fikse orsaka til dette krasjet.\nno:Beklager, dette skulle ikke ha skjedd!\\n\\nVennligst trykk 'Avbryt' hvis du ønsker å hjelpe oss med å fikse dette problemet.\npl:Przepraszamy - to nie powinno się zdarzyć!\\n\\nProszę nacisnąć przycisk 'Anuluj', jeżeli chcesz pomóc nam w usunięciu tego problemu.\npt:Isto não devia ter ocorrido!\\n\\nPrima \"Cancelar\", se nos quiser ajudar a corrigir a origem deste erro.\nro:Scuze, acest eveniment nu ar fi trebuit să aibă loc!\\n\\nVă rugăm apăsați „Renunță”, dacă doriți să ne ajutați să îndreptăm cauza erorii.\nru:Извините, произошло что-то непредвиденное.\\n\\nНажмите 'Отмена', если хотите помочь нам устранить причину этого сбоя.\nsk:Ospravedlňujeme sa, nemalo sa to stať.\\n\\nAk nám chcete pomôcť vyriešiť príčinu tohto zlyhania programu, stlačte tlačidlo 'Storno'.\nsl:Oprostite, to se ne bi smelo zgoditi!\\n\\nPritisnite 'Prekliči', če želite pomagati pri določitvi vzroka za sesutje.\nsn:Tine\nsp-rs:Oprostite, ovo nije trebalo da se dogodi!\\n\\nPritisnite dugme 'Otkaži' ako želite da nam pomognete u rešavanju ovog problema.\nsq:Na falni, kjo nuk duhej të ndodhte!\\n\\nJu lutemi, shtypni 'Anuloj' po deshët të na ndihmoni që ta ndreqim gabimin.\nsr-rs:Опростите, ово није требало да се догоди!\\n\\nПритисните дугме 'Откажи' ако желите да нам помогнете у решавању овог проблема.\nsv:Ledsen, det där borde inte ha hänt!\\n\\nVar god tryck 'Avbryt', om du vill hjälpa oss att korrigera orsaken till denna krash.\nta:மன்னிக்கவும், இது நடந்திருக்க கூடாது! \\n\\n தயவு செய்து 'ரத்துதை' அழுத்தவும், எங்களுக்கு இந்த விபத்தினை சரிசெய்ய உதவும்.\ntr:Üzgünüz, bu olmamalıydı!\\n\\nEğer hatayı düzeltmemize yardımcı olmak istiyorsanız lütfen 'Cancel' a basın.\ntw:抱歉，這不該發生的！\\n\\n如果你希望協助我們修正這個錯誤，請按下 [取消] 。\nuk:Вибачте, але це не мало статись!\\n\\nНатисніть \"Скасувати\", якщо ви бажаєте допомогти нам виправити причину збою.\nuz:Kutilmagan voqea sodir bo'ldi.\\n\\nUshbu nosozlikni tuzatish uchun bizga yordam bermoqchi bo'lsaniz 'Bekor qilish' tugmasini bosing.\nvn:Xin lỗi, điều đó không nên xảy ra!\\n\\nVui lòng bấm 'Cancel', nếu bạn muốn giúp chúng tôi sửa chữa lý do của trường hợp lỗi này.\n:Source file %s has no synchronization point\nam:%s ֆայլը չունի համաժամեցման կետ\nar:الملف المصدر %s لم تتم مزامنته عند هذه النقطة\naz:%s mənbə faylının sinxronlaşdırma mövqeyi yoxdur\nbg:Файлът-източник %s няма точка на синхронизация\nbr:O arquivo fonte %s não tem ponto de sincronização\nbs:Izvorni fajl %s nema sinhronizacijske tačke\nby:Адсутнічае кропка сінхранізацыі ў зыходным файле %s\nca-xv:El fitxer d'origen %s no té un punt de sincronització vàlid\nca:El fitxer d'origen %s no té un punt de sincronització vàlid\ncn:源文件 %s 没有同步点\ncy:Does dim pwynt cydweddu yn ffeil %s\ncz:Zdrojový soubor %s nemá bod synchronizace\nde:%s hat keinen Synchronisations-Punkt\ndk:Kildefilen %s har ingen synkroniseringspunkter\nel:Το αρχείο προέλευσης %s δεν έχει σημείο συγχρονισμού\nes:El archivo de origen %s no posee un punto de sincronización\net:Lähtefailil %s puudub sünkroniseerimispunkt\neu:%s iturburu agiriak ez du aldiberetze punturik\nfa:پرونده‌ی %s نقاط همگام‌سازی ندارد\nfi:Lähdetiedostolla %s ei ole synkronointikohtaa\nfr:Le fichier source %s n'a pas de point de synchronisation\nfy-nl:Bestân %s hat gjin syngronisaasjepunt\nga:Níl láthair comhaimsearatha ag an gcomhad foinse %s\ngl:O ficheiro de orixe %s non ten punto de sincronización\nhe:נקודת סנכרון לקובץ המקור %s לא נמצאה.\nhi:स्रोत फ़ाइल %s का तुल्यकालन बिंदु नहीं है\nhr:Izvorna datoteka %s nema točke usklađivanja\nhu:A '%s' forrásfájlban nincs szinkronizációs hely\nid:Berkas asal %s tidak mempunyai titik sinkronisasi\nit:Il file sorgente %s non ha nessun punto di sincronizzazione\nja:ソース ファイル %s には同期ポイントがありません\nka:წყაროს ფაილს %s არ აქვს სინქრონიზაციის წერტილები\nkr:원본 파일 %s (은)는 동기화 지점이 없습니다.\nku:خاڵی هاوکاتکردنی نیە %s سەرچاوەی فایلی\nkw:Nyns eus poynt kettermynegi vyth y'n restren %s\nlt:Pradinis failas %s  neturi sinchronizacijos taško\nlv:Avota failam %s nav sinhronizācijas punkta\nmk:Изворната датотека %s нема синхронизациска точка\nmy:Sumber fail %s tidak mempunyai titik penyegerakan\nne:स्रोत फाइल %s मा समक्रमण विन्दु छैन\nnl:Bestand %s heeft geen synchronisatiepunt\nnn:Kildefila %s har ikkje nokre synkroniseringspunkt\nno:Kildefilen %s har ingen synkroniseringspunkt\npl:Plik źródłowy %s nie posiada punktów synchronizacji\npt:O ficheiro %s não tem ponto de sincronização\nro:Fișierul sursă %s nu are punct de sincronizare\nru:Нет точки синхронизации в исходном файле %s\nsi:%s මූලාශ්‍ර ගොනුව  සතුව සමකාලනයකිරීමේ ලක්ශයක් නොමැත\nsk:Zdrojový súbor %s nemá synchronizačný bod\nsl:Izvorna datoteka %s nima točke sinhronizacije\nsp-rs:Izvorna datoteka %s nema tačku usklađivanja\nsq:Skeda burimore %s nuk ka pikë sinkronizimi\nsr-rs:Изворна датотека %s нема тачку усклађивања\nsv:Källfilen %s har ingen synkroniseringspunkt\nta:%s முல கோப்பிர்க்கு ஒத்தியங்கு மையம் எதுவும் இல்லை\ntl:Walang synchronization point ang source file na %s\ntr:%s kaynak dosyasında senkronizasyon noktası yoktur\ntw:來源檔案 %s 沒有同步點\nuk:Файл сирцевого коду %s не має точки синхронізації\nuz:%s manba faylida sinxronlanish nuqtasi yo'q\nvn:Tập tin nguồn %s không có điểm đồng bộ\n:Start SumatraPDF\nam:Բացել SumatraPDF-ը\nar:بدء تشغيل مستندات Sumatra  المحمولة\naz:SumatraPDF-i işə sal\nbg:Стартираи SumatraPDF\nbr:Iniciar SumatraPDF\nbs:Pokreni SumatraPDF\nca-xv:Inicia el SumatraPDF\nca:Inicia el SumatraPDF\ncn:启动SumatraPDF\ncy:Cychwyn SumatraPDF\ncz:Spustit SumatraPDF\nde:SumatraPDF starten\ndk:Start SumatraPDF\nel:Έναρξη SumatraPDF\nes:Iniciar SumatraPDF\net:Käivita SumatraPDF\neu:Abiarazi SumatraPDF\nfa:اجرای Sumatra PDF\nfi:Avaa SumatraPDF\nfr:Lancer SumatraPDF\nga:Tosaigh SumatraPDF\ngl:Iniciar SumatraPDF\nhe:הפעל את SumatraPDF\nhi:SumatraPDF शुरू\nhr:Pokreni SumatraPDF\nhu:SumatraPDF indítása\nid:Jalankan SumatraPDF\nit:Avvia SumatraPDF\nja:SumatraPDFを実行\nka:SumatraPDF-ის გაშვება\nkr:SumatraPDF 시작\nku:SumatraPDF دەستپێکردنی\nlv:Palaist SumatraPDF\nmk:Стартувај SumatraPDF\nmy:Mula SumatraPDF\nnl:Start SumatraPDF\nnn:Start SumatraPDF\nno:Start SumatraPDF\npl:Uruchom SumatraPDF\npt:Iniciar SumatraPDF\nro:Pornire SumatraPDF\nru:Пуск SumatraPDF\nsk:Spustiť SumatraPDF\nsl:Zaženi SumatraPDF\nsp-rs:Startovati sumatraPDF\nsq:Nis SumatraPDF\nsr-rs:Старовати СуматраПДФ\nsv:Starta SumatraPDF\nta:சுமத்ராPDF தொடரவும்\ntr:SumatraPDF'yi başlat\ntw:啟動 SumatraPDF\nuk:Запустити SumatraPDF\nuz:SumatraPDF ishga tushirish\nvn:Mở SumatraPDF\n:Subject:\naf:Onderwerp\nam:Ֆայլը.\nar:الموضوع\naz:Mövzu:\nbg:Относно (тема):\nbr:Assunto:\nbs:Tema:\nca-xv:Assumpte:\nca:Subjecte:\ncn:主题:\ncy:Pwnc:\ncz:Předmět:\nde:Thema:\ndk:Emne:\nel:Θέμα:\nes:Asunto:\net:Teema:\neu:Gaia:\nfa:موضوع:\nfi:Otsikko:\nfr:Objet :\nga:Ábhar:\ngl:Asunto:\nhe:נושא:\nhi:विषय:\nhr:Tema:\nhu:Tárgy:\nid:Perihal:\nit:Oggetto:\nja:題名:\nka:თემა:\nkr:주제:\nku:سەردێڕ:\nlt:Tema:\nlv:Tēma:\nmk:Предмет:\nmy:Subjek\nne:बिषय\nnl:Onderwerp:\nnn:Tema:\nno:Emne:\npl:Temat:\npt:Assunto:\nro:Subiect:\nru:Тема:\nsi:මාතෘකාව:\nsk:Predmet:\nsl:Zadeva:\nsn:Musoro\nsp-rs:Predmet:\nsq:Tema:\nsr-rs:Предмет:\nsv:Ämne:\nta:எழுவாய்:\ntl:Paksa:\ntr:Konu:\ntw:主題:\nuk:Тема:\nuz:Mavzu:\nvn:Chủ đề:\n:SumatraPDF %s Installer\naf:SumatraPDF %s Installeerder\nam:SumatraPDF %s-ը տեղակայելու ծրագիր\nar:المثبت%s المحمولة Sumatra مستندات\naz:SumatraPDF quraşdırıcısı %s\nbr:SumatraPDF %s instalador\nbs:SumatraPDF %s instaler\nca-xv:Instal·lador del SumatraPDF %s\nca:Instal·lador del SumatraPDF %s\ncn:SumatraPDF %s 安装程序\ncy:Gosodwr SumatraPDF %s\ncz:SumatraPDF %s instalátor\nde:SumatraPDF %s installieren\ndk:SumatraPDF %s installationsprogram\nel:Πρόγραμμα εγκατάστασης SumatraPDF %s\nes:Instalador de SumatraPDF %s\net:SumatraPDF %s paigaldamine\neu:SumatraPDF %s Ezartzailea\nfa:نصب کننده SumatraPDF %s\nfi:SumatraPDF %s asennusohjelma\nfr:Installeur de SumatraPDF %s\nga:Suiteálaí %s SumatraPDF\ngl:Instalador %s SumatraPDF\nhe:התקנת SumatraPDF %s\nhr:SumatraPDF %s instaler\nhu:SumatraPDF %s telepítő\nid:Pasang SumatraPDF %s\nit:Installazione SumatraPDF %s\nja:SumatraPDF %s インストーラ\nkr:SumatraPDF %s 설치 관리자\nku:SumatraPDF %s دابەزاندنی\nlv:SumatraPDF %s instalētājs\nmk:Инсталација на SumatraPDF %s\nmy:Installer SumatraPDF %s\nnl:SumatraPDF %s installatieprogramma\nnn:SumatraPDF %s-installerer\nno:SumatraPDF %s installering \npl:Instalator SumatraPDF %s\npt:Instalador do SumatraPDF %s\nro:Programul de instalare %s SumatraPDF\nru:Инсталлятор SumatraPDF %s\nsk:SumatraPDF %s inštalátor\nsl:SumatraPDF %s namestitev\nsp-rs:SumatraPDF %s instalacija\nsq:Instaluesi i SumatraPDF %s\nsr-rs:СуматраПДФ %s инсталација\nsv:Installationsprogram för SumatraPDF %s\nta:சுமத்ராPDF %s நிறுவி\ntr:SumatraPDF %s yükleyici\ntw:SumatraPDF %s 安裝器\nuk:Інсталятор SumatraPDF %s\nuz:SumatraPDF %s o'rnatuvchisi\nvn:Bộ cài đặt %s SumatraPDF\n:SumatraPDF %s Uninstaller\nam:SumatraPDF %s-ը հեռացնելու ծրագիր\nar:إلغاء  تثبيت %s المحمولة Sumatra مستندات\naz:SumatraPDF deinstalyatoru %s\nbr:SumatraPDF %s desinstalador\nbs:SumatraPDF %s deinstaler\nca-xv:Desintal·lador del SumatraPDF %s\nca:Desintal·lador del SumatraPDF %s\ncn:SumatraPDF %s 卸载程序\ncy:Dadosodwr SumatraPDF %s\ncz:SumatraPDF %s odinstalátor\nde:SumatraPDF %s deinstallieren\ndk:SumatraPDF %s afinstallationsprogram\nel:Πρόγραμμα απεγκατάστασης SumatraPDF %s\nes:Desinstalador de SumatraPDF %s\net:SumatraPDF %s eemaldamine\neu:SumatraPDF %s Kentzailea\nfa:حذف کننده SumatraPDF %s\nfi:SumatraPDF %s poisto-ohjelma\nfr:Désinstalleur de SumatraPDF %s\nga:Díshuiteálaí SumatraPDF %s\ngl:Desinstalador %s SumatraPDF\nhe:הסרת SumatraPDF %s\nhr:SumatraPDF %s deinstaler\nhu:SumatraPDF %s eltávolító\nid:Penghapus SumatraPDF %s\nit:Disinstallazione SumatraPDF %s\nja:SumatraPDF %s アンインストーラ\nkr:SumatraPDF %s 제거 관리자\nku:SumatraPDF %s سڕینەوەی\nlv:SumatraPDF %s atinstalētājs\nmk:Деинсталација на SumatraPDF %s\nmy:SumatraPDF %s Uninstaller\nnl:SumatraPDF %s deinstallatieprogramma\nnn:SumatraPDF %s-avinstallerer\nno:SumatraPDF %s avinstallering\npl:Usuń SumatraPDF %s\npt:Desinstalador do SumatraPDF %s\nro:Programul de dezinstalare a %s SumatraPDF\nru:Деинсталлятор SumatraPDF %s\nsk:SumatraPDF %s odinštalátor\nsl:SumatraPDF %s odstranitev\nsp-rs:SumatraPDF %s deinstalacija\nsq:Çinstaluesi i SumatraPDF %s\nsr-rs:СуматраПДФ %s деинсталација\nsv:Avinstallationsprogram för SumatraPDF %s\nta:சுமத்ராPDF %s நிறுவல்நீக்கி\ntr:SumatraPDF %s Kaldırıcı\ntw:SumatraPDF %s 解除安裝器\nuk:Деінсталятор SumatraPDF %s\nuz:SumatraPDF %s o'chirish dasturi\nvn:Bộ gỡ cài đặt %s SumatraPDF\n:SumatraPDF Options\nam:Ընտրանքներ\nar:خيارات مستندات Sumatra المحمولة\naz:SumatraPDF seçimləri\nbg:Настройки на SumatraPDF\nbr:Opções do SumatraPDF\nbs:SumatraPDF opcije\nby:Параметры SumatraPDF\nca-xv:Opcions del SumatraPDF\nca:Opcions del SumatraPDF\ncn:SumatraPDF 选项\ncy:Dewisiadau SumatraPDF\ncz:Možnosti programu SumatraPDF\nde:SumatraPDF Optionen\ndk:SumatraPDF-valgmuligheder\nel:Επιλογές SumatraPDF\nes:Opciones de SumatraPDF\net:SumatraPDF-i sätted\neu:SumatraPDF Aukerak\nfa: گزینه‌های SumatraPDF\nfi:SumatraPDF:n asetukset\nfr:SumatraPDF Options\nfy-nl:SumatraPDF Opsjes\nga:Roghanna SumatraPDF\ngl:Opcións de SumatraPDF\nhe:הגדרות SumatraPDF\nhi:Sumatra पीडीएफ विकल्प\nhr:Mogućnosti programa\nhu:A SumatraPDF beállításai\nid:Pengaturan SumatraPDF\nit:Opzioni di SumatraPDF\nja:SumatraPDF のオプション\nka:SumatraPDF-ის პარამეტრები\nkr:SumatraPDF 옵션\nku:هەڵبژاردنەکانی SumatraPDF\nkw:Etholyow SumatraPDF\nlt:„SumatraPDF“ nuostatos\nlv:SumatraPDF opcijas\nmk:Поставувања на SumatraPDF\nmy:Tetapan-tetapan SumatraPDF\nne:SumatraPDF विकल्पहरु\nnl:SumatraPDF Opties\nnn:SumatraPDF-innstillingar\nno:Innstillinger\npl:Opcje SumatraPDF\npt:Opções do SumatraPDF\nro:Opțiuni SumatraPDF\nru:Параметры SumatraPDF\nsi:SumatraPDF විකල්ප (O)\nsk:Nastavenia SumatraPDF\nsl:Možnosti SumatraPDF\nsp-rs:Podešavanja programa SumatraPDF\nsq:SumatraPDF opsionet\nsr-rs:Подешавања програма SumatraPDF\nsv:SumatraPDF Inställningar\nta:சுமத்ராPDFஇன் விருப்பப பேரம்\ntl:Mga Opsyon para sa SumatraPDF\ntr:SumatraPDF Seçenekleri\ntw:SumatraPDF 選項\nuk:Опції SumatraPDF\nuz:SumatraPDF Parametrlari\nvn:Tuỳ chọn SumatraPDF\n:SumatraPDF Update\nam:SumatraPDF-ի թարմացումներ\nar:تحديث  مستندات Sumatra المحمولة\naz:SumatraPDF yeniləməsi\nbg:Обновяване на SumatraPDF\nbr:Atualização do SumatraPDF\nbs:SumatraPDF nadogradnja\nca-xv:Actualització del SumatraPDF\nca:Actualització del SumatraPDF\ncn:升级 SumatraPDF\ncy:Diweddaru SumatraPDF\ncz:SumatraPDF - Aktualizace\nde:SumatraPDF Update\ndk:SumatraPDF-opdatering\nel:Ενημέρωση SumatraPDF\nes:Actualizar SumatraPDF\net:SumatraPDF-i uuendamine\neu:SumatraPDF Eguneratu\nfa:به‌روز رسانی SumatraPDF\nfi:SumatraPDF:n päivitys\nfr:Mise à jour de SumatraPDF\nga:Nuashonrú do ShumatraPDF\ngl:Actualización de SumatraPDF\nhe:עדכון SumatraPDF\nhi:Sumatra पीडीएफ अपडेट\nhr:SumatraPDF ažuriranje\nhu:SumatraPDF frissítés\nid:Pembaruan SumatraPDF\nit:Controllo aggiornamenti SumatraPDF\nja:SumatraPDF の更新\nka:SumatraPDF-ის განახლება\nkr:SumatraPDF 업데이트\nku:نوێکردنەوەی SumatraPDF\nlt:„SumatraPDF“ naujinimas\nlv:SumatraPDF atjaunināšana\nmk:Надградување на SumatraPDF\nmy:Kemaskini SumatraPDF\nne:SumatraPDF अद्यावधिक\nnl:SumatraPDF Update\nnn:SumatraPDF Oppdatering\nno:SumatraPDF-oppdatering\npl:Aktualizacja SumatraPDF\npt:Atualização do SumatraPDF\nro:Versiune nouă SumatraPDF\nru:Обновление SumatraPDF\nsk:Aktualizácia SumatraPDF\nsl:Posodobitev SumatraPDF\nsp-rs:Ažuriranje SumatraPDF\nsq:SumatraPDF azhurnimi\nsr-rs:Ажурирање SumatraPDF\nsv:SumatraPDF Uppdatering\nta:சுமத்ராPDF மேம்படுத்து\ntl:Update sa SumatraPDF\ntr:SumatraPDF Güncelleme\ntw:SumatraPDF 更新\nuk:Оновлення SumatraPDF\nuz:SumatraPDF yangilash\nvn:Cập nhật SumatraPDF\n:SumatraPDF crashed\nam:SumatraPDF-ի ձախողում\nar:مستندات Sumatra المحمولة تحطمت\naz:SumatraPDF əməliyyatı qəza ilə nəticələndi\nbg:SumatraPDF се срина (спря внезапно)\nbr:O SumatraPDF travou\nbs:SumatraPDF se srušio\nca-xv:El SumatraPDF ha fallat\nca:El SumatraPDF ha fallat\ncn:SumatraPDF 发生错误\ncy:Chwalodd SumatraPDF\ncz:SumatraPDF - Selhání\nde:SumatraPDF ist abgestürzt\ndk:Kritisk fejl, SumatraPDF lukkes\nel:Το SumatraPDF σταμάτησε να λειτουργεί\nes:SumatraPDF se ha reiniciado debido a un fallo\net:SumatraPDF jooksis kokku\neu:SumatraPDF matxuratu egin da\nfa:SumatraPDF از کار افتاد\nfi:SumatraPDF kaatui\nfr:SumatraPDF a planté\nga:Chlis SumatraPDF\ngl:SumatraPDF fallou\nhe:התוכנה SumatraPDF קרסה.\nhi:Sumatra पीडीएफ दुर्घटनाग्रस्त हो गया\nhr:SumatraPDF se srušio\nhu:SumatraPDF működése leállt\nid:SumatraPDF berhenti berfungsi\nit:SumatraPDF ha incontrato un errore irreparabile\nja:SumatraPDF がクラッシュしました\nka:SumatraPDF-ის მუშაობა ავარიულად დასრულდა\nkr:SumatraPDF 충돌남\nku:تێکچوو SumatraPDF\nlt:„SumatraPDF“ strigo\nlv:SumatraPDF avarēja\nmk:SumatraPDF се сруши\nmy:SumatraPDF crashed\nne:SumatraPDF बिग्रियो\nnl:SumatraPDF is vastgelopen\nnn:SumatraPDF har krasja\nno:SumatraPDF krasjet\npl:SumatraPDF uległ awarii\npt:O SumatraPDF terminou\nro:SumatraPDF s-a terminat incorect\nru:Аварийное завершение работы SumatraPDF\nsk:SumatraPDF - zrútenie programu\nsl:SumatraPDF se je sesul\nsp-rs:Program SumatraPDF je krahirao\nsq:SumatraPDF ngeci\nsr-rs:Програм SumatraPDF је крахирао\nsv:SumatraPDF avslutades oväntat\nta:சுமத்ராPDF செயலிழந்தது\ntl:Nag-crash ang SumatraPDF\ntr:SumatraPDF çöktü\ntw:SumatraPDF 發生錯誤\nuk:SumatraPDF впав\nuz:SumatraPDFda nosozlik ro'y berdi\nvn:SumatraPDF đã ngưng hoạt đọng\n:SumatraPDF has been uninstalled.\nam:SumatraPDF-ը հեռացվել է:\nar: مستندات Sumatra المحمولة إلغاء تثبيت\naz:SumatraPDF silindi.\nbg:SumatraPDF е премахнат.\nbr:SumatraPDF foi desinstalado.\nbs:SumatraPDF je deinstaliran.\nca-xv:S'ha desinstal·lat el SumatraPDF.\nca:S'ha desinstal·lat el SumatraPDF.\ncn:已卸载 SumatraPDF 。\ncy:Mae SumatraPDF wedi ei ddadosod.\ncz:SumatraPDF byl odinstalován.\nde:SumatraPDF wurde deinstalliert.\ndk:SumatraPDF er afinstalleret.\nel:Το SumatraPDF απεγκαταστάθηκε.\nes:Se ha desinstalado SumatraPDF.\net:SumatraPDF on eemaldatud.\neu:SumatraPDF kendu da.\nfa:SumatraPDF پاک شد.\nfi:SumatraPDF on poistettu.\nfr:SumatraPDF a été désinstallé.\nga:Díshuiteáladh SumatraPDF.\ngl:Desintalouse SumatraPDF\nhe:התקנת SumatraPDF הושלמה.\nhr:SumatraPDF je deinstaliran.\nhu:SumatraPDF eltávolítása befejeződött.\nid:SumatraPDF telah dihapus\nit:SumatraPDF è stata completamente disinstallato.\nja:SumatraPDF がアンインストールされました。\nkr:SumatraPDF가 제거됐습니다.\nku:.سڕایەوە SumatraPDF\nlv:SumatraPDF ir atinstalēta\nmk:SumatraPDF е избришан.\nmy:SumatraPDF telah dibuang.\nnl:SumatraPDF werd verwijderd.\nnn:SumatraPDF har blitt avinstallert.\nno:SumatraPDF har blitt avinstallert.\npl:Program SumatraPDF został usunięty.\npt:O SumatraPDF foi desinstalado.\nro:SumatraPDF a fost dezinstalat.\nru:SumatraPDF удалена.\nsk:Program SumatraPDF bol odinštalovaný.\nsl:SumatraPDF je bil odstranjen.\nsp-rs:SumatraPDF deinstaliran\nsq:SumatraPDF u çinstalua\nsr-rs:СуматраПДФ деинсталиран\nsv:SumatraPDF är nu borttaget.\nta:சுமத்ராPDF நிறுவல் நீக்கப்பட்டது.\ntr:SumatraPDF kaldırıldı.\ntw:已解除安裝 SumatraPDF 。\nuk:SumatraPDF було успішно видалено.\nuz:SumatraPDF o'chirildi.\nvn:SumatraPDF đã được gỡ bỏ.\n:SumatraPDF installation not found.\nam:SumatraPDF-ը չի գտնվել:\nar:مستندات Sumatra المحمولة لم يتم العثور على تثبيت\naz:SumatraPDF quraşdırması tapılmadı.\nbr:A instalação do SumatraPDF não foi encontrada.\nbs:SumatraPDF instalacija nije pronađena.\nca-xv:No s'ha trobat cap instal·lació del SumatraPDF.\nca:No s'ha trobat cap instal·lació del SumatraPDF.\ncn:未找到 SumatraPDF 安装。\ncy:Heb ganfod gosodiad SumatraPDF.\ncz:Instalace programu SumatraPDF nebyla nalezena.\nde:Keine SumatraPDF-Installation zum Deinstallieren gefunden.\ndk:SumatraPDF-installation blev ikke fundet.\nel:Η εγκατάσταση του SumatraPDF δεν βρέθηκε.\nes:Instalación de SumatraPDF no encontrada.\net:SumatraPDF paigaldust ei leitud.\neu:SumatraPDF ezarpena ez da aurkitu.\nfa:نصب شده‌ی SumatraPDF پیدا نشد.\nfi:SumatraPDF-asennusta ei löytynyt.\nfr:Installation de SumatraPDF non trouvée\nga:Níor aimsíodh suiteáil SumatraPDF.\ngl:Non se atopou ningunha instalación de SumatraPDF.\nhe:התקנת SumatraPDF לא נמצאה.\nhr:SumatraPDF instalacija nije pronađena.\nhu:SumatraPDF telepítő nem található.\nid:Instalasi SumatraPDF tidak ditemukan.\nit:Installazione SumatraPDF non trovata.\nja:SumatraPDFのインストール情報を見つけられません\nkr:SumatraPDF 설치 파일을 찾을 수 없습니다.\nku:.نەدۆزرایەوە SumatraPDF دابەزێنەری\nlv:SumatraPDF instalācija nav atrasta\nmk:Не најдов инсталации на SumatraPDF.\nmy:Pemasangan SumatraPDF tidak dijumpai.\nnl:SumatraPDF-installatie niet gevonden.\nnn:SumatraPDF-installeringa blei ikkje funnet.\nno:SumatraPDF installering ikke funnet.\npl:Program SumatraPDF nie został znaleziony.\npt:O SumatraPDF não foi encontrado.\nro:Nu s-a gasit instalarea SumatraPDF.\nru:Установка SumatraPDF не найдена.\nsk:Inštalácia programu SumatraPDF nebola nájdená.\nsl:SumatraPDF namestitve ni mogoče najti.\nsp-rs:SumatraPDF instalacija nije pronađena\nsq:Nuk u gjet SumatraPDF i instaluar.\nsr-rs:СуматраПДФ инсталација није пронађена\nsv:Kunde inte hitta SumatraPDF-installation.\nta:சுமத்ராPDF நிறுவல் கிடைக்கவில்லை.\ntr:SumatraPDF kurulum dosyası bulunamadı.\ntw:未找到 SumatraPDF 安裝。\nuk:Встановлений SumatraPDF не було знайдено.\nuz:SumatraPDF o'rnatilganligi topilmadi.\nvn:Không tìm thấy gói cài đặt SumatraPDF.\n:SumatraPDF is your default PDF reader\nam:PDF ֆայլերը ասոցիացվել են SumatraPDF-ի հետ\nar:المحمولة هو قارئ المستندات المحمولة الافتراضي Sumatra مستندات\naz:SumatraPDF PDF faylları ilə əlaqələndirilmişdir\nbg:SumatraPDF е вашият PDF четец по подразбиране\nbr:O SumatraPDF é o seu leitor PDF padrão\nbs:SumatraPDF je vaš glavni čitač PDF fajlova\nby:SumatraPDF асацыявана з файламі PDF\nca-xv:El SumatraPDF és el seu lector PDF predeterminat\nca:El SumatraPDF és el seu lector PDF predeterminat\ncn:SumatraPDF 是默认 PDF 阅读器\ncy:SumatraPDF yw eich prif ddarllenydd PDF\ncz:SumatraPDF je výchozím PDF prohlížečem\nde:PDF-Dateien werden standardmäßig mit SumatraPDF geöffnet\ndk:SumatraPDF er din standardlæser til PDF-filer\nel:Το SumatraPDF είναι το προεπιλεγμένο πρόγραμμα PDF\nes:SumatraPDF es el lector PDF predeterminado\net:SumatraPDF on vaikimisi PDF-lehitseja\neu:SumatraPDF zure berezko PDF irakurlea da\nfa:SumatraPDF برنامه‌ی پیش‌فرض برای خواندن پرونده‌های PDF شماست\nfi:SumatraPDF on oletuslukijasi PDF-asiakirjoille\nfr:SumatraPDF est votre lecteur de PDF\nfy-nl:SumatraPDF is de standart PDF-lêzer\nga:Is é SumatraPDF do léitheoir PDF réamhshocraithe\ngl:SumatraPDF é o seu lector de PDF por defecto\nhe:SumatraPDF מוגדרת כתוכנת ברירת מחדל ל- PDF\nhi:Sumatra पीडीएफ आपका डिफ़ॉल्ट पीडीएफ रीडर है\nhr:SumatraPDF je vaš glavni glavni preglednik PDF datoteka\nhu:A SumatraPDF az alapértelmezett PDF-olvasó\nid:SumatraPDF adalah pembaca berkas PDF utama Anda\nit:SumatraPDF è il lettore PDF predefinito\nja:SumatraPDF は規定の PDF リーダーです\nka:SumatraPDF თქვენი ძირითადი PDF წამკითხველია\nkr:SumatraPDF는 기본 PDF 리더입니다.\nku:ە PDF خوێنەرەوەی سەرەکی فایلەکانی SumatraPDF\nkw:SumatraPDF yw dha bennredyer PDF\nlt:„SumatraPDF“ yra numatytoji PDF žiūryklė\nlv:SumatraPDF ir jūsu noklusējuma PDF lasītājs\nmk:SumatraPDF е Вашиот основен читач на PDF\nmy:SumatraPDF ialah pembaca PDF utama anda\nne:SumatraPDF तपाईको पूर्वनिर्धारित PDF पाठक हो\nnl:SumatraPDF is de standaard PDF-lezer\nnn:SumatraPDF er din standard PDF-lesar\nno:SumatraPDF er din standard PDF-leser\npl:SumatraPDF jest domyślną przeglądarką PDF\npt:O SumatraPDF é o leitor principal dos PDF\nro:SumatraPDF este cititorul PDF implicit\nru:SumatraPDF ассоциирована с файлами PDF\nsi:SumatraPDF ඔබගේ ප්‍රධාන PDF කියවනයයි\nsk:SumatraPDF je váš predvolený prehliadač PDF súborov\nsl:SumatraPDF je vaš privzeti bralnik PDF\nsp-rs:SumatraPDF je vaš podrazumevani PDF čitač\nsq:SumatraPDF është lexuesi standard i PDF-ve\nsr-rs:SumatraPDF је ваш подразумевани PDF читач\nsv:SumatraPDF är din valda PDF-läsare\nta:சுமத்ராPDF உங்களின் முதன்மை PDF படிப்பி\ntl:SumatraPDF ang iyong default na pambasa ng mga PDF file\ntr:SumatraPDF varsayılan PDF okuyucunuz.\ntw:SumatraPDF 已是你的預設 PDF 閱讀器\nuk:SumatraPDF ваш PDF переглядач по замовчуванню\nuz:SumatraPDF andoza PDF ko'rish vositasi\nvn:SumatraPDF là trình đọc PDF chính của bạn\n:SumatraPDF should now be your default PDF reader\nam:PDF ֆայլերը ասոցիացվեցին SumatraPDF-ի հետ\nar:  مستندات Sumatra المحمولة الان يجب ان تكون لديك قارئ مستندات محمولة افتراضي\naz:SumatraPDF artıq PDF faylları ilə əlaqələndirilmişdir\nbg:SumatraPDF вече трябва да е указана като подразбиращ се четец на/за PDF файлове\nbr:O SumatraPDF deve ser agora seu leitor PDF padrão\nbs:SumatraPDF bi sad trebao biti vaš glavni čitač PDF fajlova\nby:Зараз SumatraPDF асацыявана з файламі PDF\nca-xv:El SumatraPDF ha d'esser ara mateix el vostre lector PDF predeterminat\nca:El SumatraPDF ha d'ésser ara mateix el vostre lector PDF predeterminat\ncn:现在 SumatraPDF 应该是你的默认 PDF 阅读器了\ncy:SumatraPDF dylai fod eich prif ddarllenydd PDF\ncz:SumatraPDF by měl být výchozím PDF prohlížečem\nde:PDF-Dateien sollten nun mit SumatraPDF geöffnet werden\ndk:SumatraPDF skulle nu være din standardlæser til PDF-filer\nel:Το SumatraPDF πρέπει να είναι τώρα συσχετισμένο με τα αρχεία PDF\nes:A partir de ahora SumatraPDF será el lector PDF predeterminado\net:SumatraPDF peaks nüüd olema vaikimisi PDF-lehitseja\neu:SumatraPDF orain zure berezko PDF irakurlea izan beharko litzake\nfa:SumatraPDF باید اکنون برنامه‌ی پیش‌فرض PDF خوان شما باشد\nfi:SumatraPDF:n pitäisi nyt olla oletuslukijasi PDF-asiakirjoille\nfr:SumatraPDF doit maintenant être votre lecteur de PDF par défaut\nfy-nl:SumatraPDF soe no de standert PDF-lêzer wêze moatte\nga:Ba chóir go mbeadh SumatraPDF mar an léitheoir PDF réamhshocraithe agat\ngl:SumatraPDF será agora o seu lector de PDF por defecto\nhe:SumatraPDF אמורה להיות עכשיו תוכנת ברירת מחדל ל- PDF.\nhi:SumatraPDF अब आपका डिफ़ॉल्ट पीडीएफ रीडर होना चाहिए\nhr:SumatraPDF bi sad trebao biti vaš glavni preglednik PDF datoteka\nhu:Mostantól a SumatraPDF az alapértelmezett PDF-olvasója\nid:SumatraPDF sekarang telah menjadi pembaca berkas PDF utama Anda\nit:Ora SumatraPDF dovrebbe essere il lettore PDF predefinito\nja:SumatraPDF は規定の PDF リーダーになりました\nka:ამიერიდან SumatraPDF თქვენი ძირითადი PDF წამკითხველია\nkr:SumatraPDF는 이제 기본 PDF 리더여야 합니다.\nku:PDF ئێستا ئەبێت بە خوێنەرەوەی سەرەکی فایلەکانی SumatraPDF\nkw:Alemma rag y fydh SumatraPDF dha bennredyer PDF\nlt:Dabar „SumatraPDF“ bus numatytoji PDF žiūryklė\nlv:SumatraPDF tagad būs jūsu noklusējuma PDF lasītājs\nmk:Сега SumatraPDF би требало да е Вашиот основен читач на PDF\nmy:SumatraPDF kini harus menjadi pembaca utama PDF anda\nne:SumatraPDF अब तपाईको पूर्वनिर्धारित PDF पाठक हुनुपर्छ\nnl:SumatraPDF zou nu de standaard PDF-lezer moeten zijn\nnn:SumatraPDF skulle no vere din standard PDF-lesar\nno:SumatraPDF burde nå være din standard PDF-leser\npl:SumatraPDF powinien być teraz domyślną przeglądarką PDF\npt:O SumatraPDF deve agora ser o leitor principal dos PDF\nro:SumatraPDF ar trebui să fie acum cititorul PDF implicit\nru:Теперь SumatraPDF ассоциирована с файлами PDF\nsi:SumatraPDF මෙතැන් සිට ඔබගේ ප්‍රධාන  PDF කියවනයයි\nsk:SumatraPDF by teraz mala byť vaším predvoleným prehliadačom PDF súborov\nsl:SumatraPDF bi zdaj moral biti vaš privzeti bralnik PDF\nsp-rs:SumatraPDF je postavljen kao podrazumevani PDF čitač\nsq:SumatraPDF tani do të jetë lexuesi standard i PDF-ve\nsr-rs:SumatraPDF је постављен као подразумевани PDF читач\nsv:SumatraPDF ska nu vara din valda PDF-läsare\nta:சுமத்ராPDF இப்பொழுது உங்களின் முதன்மை PDF படிப்பி\ntl:SumatraPDF na dapat ang iyong default na pambasa ng mga PDF file\ntr:SumatraPDF artık varsayılan PDF okuyucunuzdur\ntw:SumatraPDF 已成為你的預設 PDF 閱讀器\nuk:SumatraPDF тепер буде вашим PDF переглядачем по замовчуванню\nuz:SumatraPDF endi andoza PDF ko'rish vositasi bo'ldi\nvn:SumatraPDF giờ là trình đọc PDF chính của bạn\n:Synchronization file cannot be opened\nam:Հնարավոր չէ բացել համաժամեցման ֆայլը\nar:لايمكن فتح مزامنة الملف\naz:Sinxronlaşdırma faylını açmaq mümkün deyil\nbg:Файлът за синхронизация не може да бъде отворен\nbr:Não foi possível abrir o arquivo de sincronização\nbs:Ne mogu otvoriti sinhronizacijski fajl\nby:Не атрымалася адкрыць файл з інфармацыяй для сінхранізацыі\nca-xv:El fitxer de sincronització no es pot obrir\nca:El fitxer de sincronització no es pot obrir\ncn:无法打开同步文件\ncy:Methu agor ffeil cydweddu\ncz:Soubor synchronizace nelze otevřít\nde:Die Synchronisationsdatei kann nicht geöffnet werden\ndk:Synkroniseringsfil kan ikke åbnes\nel:Το αρχείο συγχρονισμού δε μπορεί να ανοιχθεί\nes:No se pudo abrir el archivo de sincronización\net:Sünkroniseerimisfaili ei suudeta avada\neu:Aldiberetze agiria ezin da ireki\nfa:پرونده‌ی همگام‌سازی باز نمی‌شود\nfi:Synkronisointitiedostoa ei voitu avata\nfr:Le fichier de synchronisation ne peut pas être ouvert\nfy-nl:It syngronisaasjebestân kin net iepene wurde\nga:Ní féidir an comhad comhaimseartha a oscailt\ngl:O ficheiro de sincronización non pode abrirse\nhe:פתיחת קובץ סנכרון נכשלה.\nhi:तुल्यकालन फ़ाइल खोला नहीं जा सकता\nhr:Datoteka usklađenja se ne može otvoriti\nhu:Nem sikerült megnyitni a szinkronizációs fájlt\nid:Berkas sinkronisasi tidak dapat dibuka\nit:Il file di sincronizzazione non può essere aperto\nja:同期化ファイルが開けません\nka:სინქრონიზაციის ფაილის გახსნა ვერ მოხერხდა\nkr:동기화 파일을 열 수 없습니다.\nku:فایلی هاوکاتکراو ناتوانرێت بکرێتەوە\nkw:Ny yllir ygeri an restren gettermynegi\nlt:Sinchronizacijos failas negali būti atvertas\nlv:Sinhronizācijas failu nevar atvērt\nmk:Синхронизациската датотека не може да се отвори\nmy:File penyegerakan tidak boleh dibuka\nne:समक्रमण फाइल खोल्न सकिदैन्\nnl:Het synchronisatiebestand kan niet worden geopend\nnn:Synkroniseringsfila kan ikkje opnes\nno:Synkroniserende fil kan ikke åpnes\npl:Nie można otworzyć pliku synchronizacji\npt:Não foi possível abrir o ficheiro de sincronização\nro:Fișierul de sincronizare nu poate fi deschis\nru:Не удалось открыть файл с информацией для синхронизации\nsi:සමකාලනය කළ ගොනුව විවෘත කළ නොහැක\nsk:Synchronizačný súbor nie je možné otvoriť\nsl:Datoteke sinhronizacije ni mogoče odpreti\nsp-rs:Nije moguće otvoriti usklađivačku datoteku\nsq:Nuk hapet skeda e sinkronizimit\nsr-rs:Није могуће отворити усклађивачку датотеку\nsv:Synkroniseringsfil kan ej öppnas\nta:ஒத்தியங்கு கோப்பை திறக்க முடியவில்லை\ntl:Hindi mabuksan ang synchronization file\ntr:Senkronizasyon dosyası açılamadı\ntw:無法開啟同步檔案\nuk:Неможливо відкрити файл синхронізації\nuz:Sinxronlanish faylini ochib bo'lmadi\nvn:Không mở được tập tin đồng bộ\n:Tagged PDF\nam:Կցված PDF\nar:المستندات المحمولة موسومة\naz:Teqlənmiş PDF\nbg:Етикетирен .PDF файл (Tagged PDF)\nbr:PDF com marcações (tags)\nbs:Označeni PDF\nca-xv:PDF etiquetat\nca:PDF etiquetat\ncn:已标记PDF\ncy:PDF wedi ei thagio\ncz:Tagované PDF\nde:PDF mit Tags\ndk:Mærket PDF\nel:PDF με ετικέττα\nes:PDF etiquetado\net:Siltidega PDF\neu:PDF etiketatua\nfa:PDF برچسب‌گذاری شده\nfi:Merkitty PDF\nfr:PDF balisé\nga:PDF formáid chlibeáilte\ngl:Etiquetado PDF\nhe:מתוייג כ- PDF\nhi:टैग की गईं पीडीएफ\nhr:Strukturirani PDF\nhu:Címkézett PDF\nid:PDF Terlabeli\nit:PDF marcati\nja:タグ付き PDF\nkr:태그있는 PDF\nku:ە دیاریکراوەکان PDF\nlv:Atzīmēts PDF\nmk:Означен PDF\nmy:PDF ditanda\nne:ट्याग गरिएको PDF\nnl:Tagged PDF\nnn:Merka PDF\nno:Merket PDF\npl:Tagowany plik PDF\npt:PDF com tags\nro:PDF etichetat\nru:Размеченный PDF\nsk:Označený PDF\nsl:Označen PDF\nsp-rs:Označeni PDF\nsq:PDF me etiketa\nsr-rs:Означени PDF\nsv:Taggad PDF\nta:குறியிடப்பட்ட PDF\ntr:İşaretlenmiş PDF\ntw:已標示的 PDF\nuk:PDF з мітками\nuz:Belgilangan PDF\nvn:PDF được gắn thẻ\n:Text documents\nam:Տեքստային ֆայլեր\nar:مستندات نصية\naz:Mətn sənədləri\nbg:Текстови документи\nbr:Documentos de texto\nbs:Tekstualni dokumenti\nca-xv:Documents de text\nca:Documents de text\ncn:文本文档\ncy:Dogfennau testun\ncz:Textové dokumenty\nde:Text-Dokumente\ndk:Tekstdokumenter\nel:Αρχεία κειμένου\nes:Documentos de texto\net:Tekstidokumendid\neu:Idazki agiriak\nfa:سند متنی\nfi:Tekstiasiakirjat\nfr:Documents texte\nfy-nl:Tekstdokuminten\nga:Cáipéisí téacs\ngl:Documentos de texto\nhe:קובצי טקסט\nhi:टेक्स्ट दस्तावेज़\nhr:Tekstualni dokumenti\nhu:Szöveges fájlok\nid:Dokumen Teks\nit:Documenti di testo\nja:テキスト ドキュメント\nka:ტექსტური დოკუმენტები\nkr:텍스트 문서\nku:بەڵگەنامە دەقییەکان\nkw:Restrennow tekst\nlt:Tekstiniai dokumentai\nlv:Teksta dokumenti\nmk:Текстуални документи\nmy:Dokumen teks\nne:पाठ कागजातहरु\nnl:Tekstdocumenten\nnn:Tekstdokumentar\nno:Tekstdokumenter\npl:Pliki tekstowe\npt:Documentos de texto\nro:Fișiere text\nru:Текстовые документы\nsi:පෙළ ගොනුව\nsk:Textové dokumenty\nsl:Tekstovni dokumenti\nsp-rs:Tekstualni dokumenti\nsq:Dokumente tekst\nsr-rs:Текстуални документи\nsv:Text-dokument\nta:உரை கொப்புகள்\ntl:Mga tekstong dokumento\ntr:Metin belgeler\ntw:文字文件\nuk:Текстові документи\nuz:Matn hujjatlari\nvn:Tập tin văn bản\n:Thank you for choosing SumatraPDF!\nam:Շնորհակալություն SumatraPDF-ը նախընտրելու համար:\nar:نشكركم لاختياركم مستندات Sumatra المحمولة  \naz:SumatraPDF-i seçdiyiniz üçün təşəkkür edirik!\nbg:Благодаря че избрахте SumatraPDF!\nbr:Obrigado por escolher o SumatraPDF!\nbs:Hvala Vam što ste izabrali SumatraPDF!\nca-xv:Gràcies per triar el SumatraPDF!\nca:Gràcies per triar el SumatraPDF!\ncn:谢谢选用SumatraPDF!\ncy:Diolch am ddefnyddio SumatraPDF!\ncz:Děkujeme, že jste si vybrali SumatraPDF!\nde:Vielen Dank dafür, dass Sie SumatraPDF verwenden!\ndk:Tak fordi du valgte SumatraPDF!\nel:Ευχαριστούμε που διαλέξατε το SumatraPDF!\nes:¡Gracias por elegir a SumatraPDF!\net:Täname, et valisid SumatraPDF'i!\neu:Mila esker SumatraPDF hautatzeagaitik!\nfa:به خاطر انتخاب SumatraPDF از شما متشکریم!\nfi:Kiitos, että valitsit SumatraPDF:n!\nfr:Merci d'avoir choisi SumatraPDF !\nga:Go raibh maith agat as ucht SumatraPDF a roghnú!\ngl:Graciñas por escoller SumatraPDF!\nhe:תודה על בחירתך ב- SumatraPDF.\nhi:sumatraPDF चुनने के लिए धन्यवाद !\nhr:Hvala Vam na odabiru SumatraPDF!\nhu:Köszönjük, hogy a SumatraPDF-et választotta!\nid:Terima kasih telah memakai SumatraPDF!\nit:Grazie per aver scelto SumatraPDF!\nja:SumatraPDF を選んで頂きありがとうございます！\nka:გმადლობთ, რომ აირჩიეთ SumatraPDF!\nkr:SumatraPDF를 선택해 주셔서 고마워요!\nku:سوپاس بۆ هەڵبژاردنی !SumatraPDF\nlv:Pateicamies par SumatraPDF izvēlēšanos!\nmk:Ви благодарам што го одбравте SumatraPDF!\nmy:Terima kasih kerana memilih SumatraPDF!\nnl:Dank u om voor SumatraPDF te kiezen!\nnn:Takk for at du valde SumatraPDF!\nno:Takk for at du valgte SumatraPDF!\npl:Dziękujemy za wybór SumatraPDF!\npt:Obrigado por ter escolhido o SumatraPDF!\nro:Va multumim pentru ca ati ales SumatraPDF!\nru:Благодарим Вас за выбор SumatraPDF!\nsk:Dakujeme, že ste sa rozhodli pre SumatraPDF!\nsl:Hvala, ker ste izbrali SumatraPDF!\nsp-rs:Hvala Vam što ste izabrali SumatraPDF!\nsq:Faleminderit që zgjodhët SumatraPDF!\nsr-rs:Хвала на избору СуматраПДФ\nsv:Tack för att du väljer SumatraPDF!\nta:சுமத்ரா PDF தேர்வு செய்ததுக்கு நன்றி!\ntr:SumatraPDF 'i seçtiğiniz için teşekkürler !\ntw:感謝選擇 SumatraPDF!\nuk:Дякуємо, що вибрали SumatraPDF!\nuz:SumatraPDF tanlaganingiz uchun tashakkur!\nvn:Cảm ơn vì đã chọn SumatraPDF!\n:Thank you! SumatraPDF has been installed.\nam:Շնորհակալություն: SumatraPDF-ը տեղադրվել է:\nar:شكرا! تم تثبيت  مستندات Sumatra المحمولة  \naz:Təşəkkürlər! SumatraPDF quraşdırıldı.\nbg:Благодаря ви! SumatraPDF вече е инсталиран.\nbr:Obrigado! O SumatraPDF foi instalado.\nbs:Hvala Vam! SumatraPDF je instaliran.\nca-xv:Gràcies! S'ha instal·lat el SumatraPDF.\nca:Gràcies! S'ha instal·lat el SumatraPDF.\ncn:谢谢! SumatraPDF已经安装好.\ncy:Diolch yn fawr! Mae SumatraPDF wedi ei gosod\ncz:Děkujeme! Program SumatraPDF byl nainstalován.\nde:Vielen Dank! SumatraPDF wurde erfolgreich installiert.\ndk:Tak! SumatraPDF er installeret.\nel:Ευχαριστούμε! Το SumatraPDF εγκαταστάθηκε.\nes:¡Gracias! SumatraPDF ha sido instalado.\net:Täname! SumatraPDF on paigaldatud.\neu:Mila esker! SumatraPDF ezarri da.\nfa:با تشکر! SumatraPDF نصب شد.\nfi:Kiitos! SumatraPDF asennettiin.\nfr:Merci ! SumatraPDF a été installé.\nga:Go raibh maith agat! Suiteáladh SumatraPDF.\ngl:Parabéns! Xa tes SumatraPDF instalado.\nhe:התקנת SumatraPDF הושלמה.\nhr:Hvala Vam! SumatraPDF je instaliran.\nhu:Köszönjük! A SumatraPDF telepítése befejeződött.\nid:Terima kasih. SumatraPDF telah berhasil terinstal.\nit:Grazie! SumatraPDF installato correttamente.\nja:ありがとう！SumatraPDF はインストールされました。\nka:გმადლობთ! SumatraPDF დაინსტალირდა.\nkr:야호! SumatraPDF가 설치됐습니다.\nku:سوپاس! SumatraPDF دابەزێنرا.\nlv:Paldies! SumatraPDF ir instalēta.\nmk:Ви благодарам! SumatraPDF е успешно инсталиран.\nmy:Terima kasih! SumatraPDF sudah dipasang pada komputer anda.\nne:धन्यबाद! SumatraPDF इन्सटल गरिएको छ\nnl:Dank u! SumatraPDF is geinstalleerd.\nnn:Tusen takk! SumatraPDF har blitt installert.\nno:Takk! SumatraPDF har blitt installert.\npl:Program SumatraPDF został zainstalowany.\npt:O SumatraPDF foi instalado.\nro:Multumim! SumatraPDF a fost dezinstalat.\nru:Благодарим Вас! SumatraPDF успешно установлена.\nsk:Ďakujeme! SumatraPDF bol nainštalovaný.\nsl:Hvala! SumatraPDF je bil nameščen.\nsp-rs:Hvala Vam! SumatraPDF je uspešno instaliran.\nsq:Faleminderit! SumatraPDF u instalua.\nsr-rs:СуматраПДФ инсталиран. Хвала!\nsv:Tack! SumatraPDF är nu installerat.\nta:நன்றி! சுமத்ரா PDF நிறுவப்பட்டு உள்ளது\ntr:Teşekkürler! SumatraPDF bilgisayarınıza kuruldu\ntw:謝謝！ SumatraPDF 已安裝。\nuk:Дякуємо! SumatraPDF було успішно встановлено.\nuz:Tashakkur! SumatraPDF o'rnatildi.\nvn:Cảm ơn bạn! SumatraPDF đã được cài đặt.\n:The installer has been corrupted. Please download it again.\\nSorry for the inconvenience!\nam:Ծրագրի տեղադրիչը վնասված է: Կրկին բեռնեք այն:\\nՀայցում ենք Ձեր ներողամտությունը:\nar:اسف للازعاج! \\n . تم إتلاف المثبت. الرجاء تحميله مرة أخرى\naz:Quraşdırıcı zədələnmişdir. Lütfən onu təkrar endirin.\\nNarahatçılığa görə üzr istəyirik!\nbg:Програмата за инсталиране е повредена. Моля, изтеглете я отново.\\n Простете ни за неудобството!\nbr:O instalador está corrompido. Por favor baixe-o novamente.\\nDesculpe pelo incômodo!\nbs:Instaler je oštećen. Molimo da ga ponovo preuzmete.\\nOprostite zbog neugodnosti!\nca-xv:L'instal·lador és malmés. Baixeu-lo una altra vegada.\\nLamentem les molèsties!\nca:L'instal·lador és malmès. Baixeu-lo una altra vegada.\\nLamentem les molèsties!\ncn:抱歉安装程序损坏，请重新下载。\ncy:Mae'r gosodwr yn llwgr. Llwythwch y ffeil i lawr eto. \\n Ymddiheuriadau am yr anghyfleuster!\ncz:Instalační program byl nejspíše poškozen. Stáhněte si jej prosím znovu. \\nOmlouváme se za způsobené nepříjemnosti!\nde:Das Installationsprogramm wurde beschädigt. Bitte laden Sie es erneut herunter.\\nEntschuldigen Sie bitte die Unannehmlichkeit!\ndk:Installationsprogrammet er fejlbehæftet. Prøv venligst at hente det igen.\\nVi beklager ulejligheden!\nel:Το πρόγραμμα εγκατάστασης έχει καταστραφεί. Παρακαλώ κατεβάστε το ξανά.\\nΣυγγνώμη για την ταλαιπωρία!\nes:El instalador está dañado, pruebe descargándolo de nuevo.\\n¡Perdón por las molestias!\net:Paigaldusprogramm on vigane. Palun laadi see uuesti alla.\\nPalun vabandust ebamugavuste pärast!\neu:Ezartzailea hondatuta dago. Mesedez jeitsi berriro.\\nBarkatu eragozpenagaitik!\nfa:برنامه نصب خراب شده است. لطفا دوباره دانلود کنید.\\nبا عرض پوزش به خاطر اشکال به وجود آمده..\nfi:Asennusohjelma on viallinen. Lataa se uudelleen.\\nAnteeksi häiriö!\nfr:L'installeur est corrompu. Veuillez le télécharger de nouveau. \\nDésolé de ce désagrément !\nga:Tá an suiteálaí truaillithe. Déan é a íosluchtú arís le do thoil.\\nIs dona linn aon mhíchuibhiúlacht!\ngl:O instalador danouse. Por favor, descárgueo de novo.\\nDesculpe as molestias!\nhe:קובץ ההתקנה פגום. אנא הורד שוב.\nhr:Instaler je oštećen. Molim Vas preuzmite ga ponovno.\\nIsprika za tu neugodnost!\nhu:A telepítő sérült. Kérjük, töltse le újra.\\nElnézést kérünk a kellemetlenségért!\nid:Installer rusak. Harap unduh lagi.\\nMaaf atas ketidaknyamanan ini!\nit:Il programma di installazione è danneggiato. Riscaricalo nuovamente.\\nSiamo spiacenti per l'incoveniente!\nja:インストーラが破損しています。もう一度ダウンロードしてください。\\nご不便をおかけし、申し訳ありません。\nkr:설치 관리자가 손상됐습니다.  다시 다운로드하세요.\\n불편하게 해서 미안합니다!\nku:دابەزێنەر تێکچووە. تکایە دووبارە دایبگرەوە.\\nببورە لە ڕوودانی ئەو هەڵەیە!\nlv:Instalēšanas programma ir bijusi bojāta. Lūdzu, lejupielādējiet to vēlreiz.\\nPiedodiet par sagādātajām neērtībām!\nmk:Датотеката за инсталирање е расипана. Ве молам преземете ја повторно.\\nИзвинете на незгодата!\nmy:Installer telah rosak. Sila muat turun sekali lagi.\\nMinta maaf atas kesulitan!\nnl:Het installatieprogramma is beschadigd. Download het opnieuw aub.\\nOnze excuses voor het ongemak!\nnn:Installeringsprogrammet har blitt korrumpert. Venligst installer han igjen.\\nVi beklager for problemane!\nno:Installeringsprogrammet er defekt. Vennligst last det ned på nytt. \\nBeklager!\npl:Plik instalacyjny jest uszkodzony. Pobierz go jeszcze raz.\\nPrzepraszamy za kłopot.\npt:O instalador está danificado. Efetue uma nova transferência.\\nDesculpe o inconveniente.\nro:Programul de instalare este pleznit :(. Rugam descarcati-l din nou. \\n Scuze pentru deranj!\nru:Инсталлятор испорчен. Пожалуйста, загрузите его повторно.\\nИзвините за неудобства!\nsk:Inštalačný súbor je poškodený. Prosím stiahnite si ho ešte raz. \\nOspravedlňujeme sa za ťažkosti!\nsl:Namestitveni program je poškodovan. Prosimo, da ga ponovno prenesete.\\nOpravičujemo se za nevšečnost!\nsp-rs:Instalacija je oštećena. Molimo preuzmite je ponovo. \\n Žao nam je zbog neugodnosti!\nsq:Instaluesi ka të meta. Ju lutemi, shkarkojeni edhe një herë.\\nNa falni për bezdinë!\nsr-rs:Инсталација је оштећена. Скинути је поново. \\n Извињавамо се.\nsv:Installationsprogrammet är skadat. Vänligen ladda ner det igen.\\nVi ber om ursäkt för problemen.\nta:நிறுவி கெட்டுள்ளது. மீண்டும் பதிவிறக்கம் செய்யவும். \\n சௌகரியமின்மைக்கு வருந்துகிறோம்!\ntr:Yükleyici hasar görmüş.Lütfen tekrar indirin.\\nGeçici rahatsızlık için özür dileriz!\ntw:安裝程式已損壞。請重新下載。\\n抱歉帶來不便！\nuk:Інсталятор було пошкоджено. Будь ласка завантажте його знову.\\nВибачте за незручності!\nuz:O'rnatuvchi buzilgan. Qaytadan yuklab oling. \\nNoqulayliklar uchun uzr so'raymiz!\nvn:Trình cài đặt đã bị lỗi. Xin vui lòng tải về lần nữa.\\nRất tiếc về sự bất tiện này!\n:This document uses unsupported features (%s) and might not render properly\nam:Փաստաթուղթը օգտագործում է չաջակցվող յուրահատկություններ (%s) և հնարավոր է նորմալ չաշխատի:\nar:وقد لا تعرض بشكل صحيح (%s) هذا المستند يستخدم ميزات غير معتمدة\naz:Bu sənəd dəstəklənməyən funksiyalardan (%s) istifadə edir və düzgün əks olunmaya bilər\nbr:Este documento utiliza recursos não suportados (%s) e pode não ser exibido corretamente.\nbs:Ovaj dokument koristi nepodržane funkcionalnosti (%s) i zbog toga možda neće biti ispravno prikazan\nca-xv:Aquest document utilitza característiques no suportades (%s) i pot no mostrar-se correctament\nca:Aquest document utilitza característiques no suportades (%s) i podria no ser mostrat correctament\ncn:该文档使用了不支持的特性 (%s)，可能无法正确渲染。\ncy:Mae'r ddogfen hon yn defnyddio nodweddion sydd ddim yn cael eu cynnal (%s) ac efallai na fyddant yn rendro'n gywir\ncz:Tento dokument používá nepodporované funkce (%s) a tímto se nemusí vykreslit správně\nde:Dieses Dokument kann vermutlich nicht korrekt angezeigt werden wegen fehlender Unterstützung für %s\ndk:Dette dokument bruger funktioner, der ikke er understøttet (%s) og optegner måske ikke korrekt\nel:Αυτό το έγγραφο χρησιμοποιεί μη υποστηριζόμενες δυνατότητες (%s) και δεν θα μπορέσει να εμφανιστεί σωστά\nes:Este documento utiliza funcionalidades no admitidas (%s) y podría no mostrarse adecuadamente\net:See dokument sisaldab omadusi (%s), mida program ei toeta ja seetõttu ei pruugi see olla õigesti esitatud.\neu:Agiri honek sostengatu gabeko (%s) ezaugarriak erabiltzen ditu eta badaiteke egoki ez aurkeztea\nfa:این سند حاوی ویژگی‌هایی است که توسط این برنامه پشتیبانی نمی‌شود (%s) و ممکن است به درستی نمایش داده نشود\nfi:Asiakirja käyttää ei-tuettuja ominaisuuksia (%s) ja ei ehkä näy oikein.\nfr:Ce document utilise des fonctionnalités non supportées (%s) et pourrait ne pas s'afficher correctement\nga:Baineann an cháipéis seo feidhm as gnéithe (%s) nach dtugtar tacaíocht dóibh agus b'fhéidir nach ndéanfar iad a thaispeáint i gceart\ngl:Este documento usa características non compatibles (%s) e pode non presentarse correctamente.\nhe:קובץ זה כולל מאפיינים שאינם נתמכים (%s), וייתכן שלא יוצג כראוי.\nhr:Ovaj dokument koristi nepodržane značajke (%s) i možda se neće ispravno prikazati\nhu:Ez a fájl nem támogatott funkciókat (%s) tartalmaz és lehet, hogy nem pontosan kerül megjelenítésre\nid:Dokumen ini menggunakan fitur yang tidak didukung (%s) dan memungkinkan untuk tidak dimuat secara benar.\nit:Questo documento usa funzioni non supportate (%s) e potrebbe non essere visualizzato bene\nja:このドキュメントはサポートしていない機能(%s)を使用しているため、正しく描画できない可能性があります\nkr:이 문서는 지원되지 않는 기능 (%s)을 사용했고, 제대로 렌더링되지 않을 수 있습니다.\nku:ئەم بەڵگەنامەیە خزمەتگوزاری نەگونجاوی تێدایە  (%s) لەوانەیە بەباشی دەرنەکەێت\nlv:Šajā dokumentā ir izmantotas neatbalstītas iespējas (%s), un iespējams, netiek atveidots pareizi\nnl:Dit document maakt gebruik van niet-ondersteunde functies (%s) en wordt mogelijk niet goed weergegeven\nnn:Dette dokumentet bruker ustøtta funksjoner (%s) og kan kanskje ikkje visast riktig.\nno:Dette dokumentet bruker ustøttede funksjoner (%s) og kan muligens ikke bli vist riktig.\npl:Ten dokument używa niewspieranych funkcji (%s) i może wyświetlać się niepoprawnie\npt:Este documento possui funcionalidades não suportadas (%s) e pode não ser mostrado corretamente\nru:Этот документ использует неподдерживаемые функции (%s) и может отображаться с ошибками\nsk:Tento dokument používa nepodporované funkcie (%s) a týmto sa nemusí vykresliť správne\nsl:Da dokument uporablja nepodprte značilnosti (%s) in se morda ne bo naložil pravilno\nsp-rs:Ovaj dokument koristi nepodržane opcije (%s) i može biti prikazan nekorektno\nsr-rs:Овај документ користи неподржане опције (%s) и може бити приказан некоректно\nsv:Detta dokument använder funktioner som inte stöds (%s) och kan inte återges korrekt\ntr:Bu belge desteklenmeyen özellikler içeriyor (%s) ve doğru görüntülenemeyebilir\ntw:此文件使用未支援的功能 (%s) ，並可能無法正確的繪製。\nuk:Даний документ використовує можливості, що не підтримуються (%s) і тому може відображатися з помилками\nuz:Ushbu ho'jjat qo'llanmaydigan imkoniyatlarni (%s) ishlatmoqda va to'g'ri render qilinmasligi mo'mkin\nvn:Tài liệu này có vài tính năng không được hỗ trợ (%s) và không được dựng chính xác\n:Title:\naf:Titel:\nam:Անունը.\nar:العنوان\naz:Başlıq:\nbg:Заглавие:\nbr:Título:\nbs:Naslov:\nca-xv:Títol:\nca:Títol:\ncn:标题:\ncy:Teitl:\ncz:Název:\nde:Titel:\ndk:Titel:\nel:Τίτλος:\nes:Título:\net:Päis:\neu:Izenburua:\nfa:عنوان:\nfi:Otsikko:\nfr:Titre :\nfy-nl:Titel:\nga:Teideal:\ngl:Título:\nhe:כותרת:\nhi:शीर्षक:\nhr:Naslov:\nhu:Cím:\nid:Judul:\nit:Titolo:\nja:タイトル:\njv:Judul\nka:სათაური:\nkr:제목:\nku:ناونیشان:\nlt:Pavadinimas:\nlv:Nosaukums:\nmk:Наслов:\nml:തലക്കെട്ട്\nmy:Tajuk:\nne:शीर्षक:\nnl:Titel:\nnn:Tittel:\nno:Tittel:\npl:Tytuł:\npt:Título:\nro:Titlu:\nru:Название:\nsi:මාතෘකාව:\nsk:Názov:\nsl:Naslov:\nsn:Musoro\nsp-rs:Naslov:\nsq:Titulli:\nsr-rs:Наслов:\nsv:Titel:\nta:தலைப்பு:\ntl:Pamagat:\ntr:Başlık:\ntw:標題:\nuk:Заголовок:\nuz:Sarlavha:\nvn:Tựa đề\n:Uninstall SumatraPDF\nam:Ջնջել SumatraPDF-ը\nar:المحمولة Sumatra  الغاء تثبيت مستندات\naz:SumatraPDF-i sil\nbg:Деинсталиране на SumatraPDF\nbr:Desinstalar SumatraPDF\nbs:Deinstaliraj SumatraPDF\nca-xv:Desinstal·la el SumatraPDF\nca:Desinstal·la el SumatraPDF\ncn:卸载 SumatraPDF\ncy:Dadosod SumatraPDF\ncz:Odinstalovat SumatraPDF\nde:Deinstallieren\ndk:Afinstaller SumatraPDF\nel:Απεγκατάσταση SumatraPDF\nes:Desinstalar SumatraPDF\net:Eemalda SumatraPDF\neu:Kendu SumatraPDF\nfa:پاک کردن SumatraPDF\nfi:Poista SumatraPDF\nfr:Désinstaller SumatraPDF\nga:Déan SumatraPDF a dhíshuiteáil\ngl:Desinstalar SumatraPDF\nhe:הסר את SumatraPDF\nhr:Deinstaliraj SumatraPDF\nhu:SumatraPDF eltávolítása\nid:Uninstall SumatraPDF\nit:Disinstalla SumatraPDF\nja:SumatraPDFをアンインストール\nka:SumatraPDF-ის დეინსტალაცია\nkr:SumatraPDF 제거\nku:سڕینەوەی SumatraPDF\nlv:Atinstalēt SumatraPDF\nmk:Избриши SumatraPDF\nml:സുമാത്ര പി.ഡി.എഫ്.നീക്കം ചെയ്യുക.\nmy:Membuang SumatraPDF\nnl:Deinstalleer SumatraPDF\nnn:Avinstaller SumatraPDF\nno:Avinstaller SumatraPDF\npl:Usuń SumatraPDF\npt:Remover SumatraPDF\nro:Dezinstalare SumatraPDF\nru:Удалить SumatraPDF\nsk:Odinštalovanie SumatraPDF\nsl:Odstrani SumatraPDF\nsp-rs:Ukloni SumatraPDF\nsq:Çinstaloj SumatraPDF\nsr-rs:Деинсталирање СуматраПДФ\nsv:Avinstallera SumatraPDF\nta:சுமத்ராPDFஐ நிறுவல் நீக்கு\ntr:SumatraPDF'i kaldır\ntw:解除安裝 SumatraPDF\nuk:Видалити SumatraPDF\nuz:SumatraPDFni o'chirish\nvn:Gỡ bỏ SumatraPDF\n:Uninstallation failed\nam:Հնարավոր չեղավ հեռացնել ծրագիրը\nar:فشل إلغاء التثبيت\naz:Deinstalyasiya baş tutmadı\nbg:Деинсталирането беше неуспешно!\nbr:A desinstalação falhou\nbs:Neuspješna deinstalacija\nca-xv:La desinstal·lació ha fallat\nca:La desinstal·lació ha fallat\ncn:卸载失败\ncy:Methodd y gosod\ncz:Odinstalace programu se nezdařila\nde:Die Deinstallation ist fehlgeschlagen\ndk:Afinstallationen fejlede\nel:Αποτυχία απεγκατάστασης\nes:Falló la desinstalación\net:Eemaldamine ebaõnnestus\neu:Kentze hutsegitea\nfa:پاک کردن برنامه ناموفق بود\nfi:Poistaminen epäonnistui\nfr:Échec de la désinstallation\nga:Theip air díshuiteáil\ngl:Fallou a desinstalación\nhe:הסרת SumatraPDF נכשלה.\nhr:Deinstalacija nije uspjela\nhu:Eltávolítás sikertelen\nid:Proses uninstall gagal.\nit:Disinstallazione fallita\nja:アンインストールに失敗\nka:დეინსტალაცია ვერ მოხერხდა\nkr:제거 실패\nku:سڕینەوە سەرکەوتو نەبوو\nlv:Atinstalēšana neizdevās\nmk:Бришењето не успеа\nmy:Penyahpasangan gagal\nnl:Deinstallatie mislukt\nnn:Avinstallering mislykkast\nno:Feil ved avinstallering\npl:Usunięcie programu nie powiodło się\npt:Falha na desinstalação!\nro:Dezinstalarea a esuat\nru:Удаление не удалось\nsi:ඉවත්කිරීම අසාර්ථක විය\nsk:Odinštalovanie sa nepodarilo\nsl:Odstranitev ni uspela\nsp-rs:Deinstaliranje neuspelo\nsq:Dështoi çinstalimi\nsr-rs:Деинсталирање неуспело\nsv:Avinstallationen misslyckades\nta:நிறுவல் நீக்கம் தோல்வி\ntr:Program kaldırma başarısız\ntw:解除安裝失敗\nuk:Видалення не було успішним\nuz:O'chirish muvaffaqiyatsiz tugadi\nvn:Không gỡ bỏ được\n:Uninstallation in progress...\nam:Ծրագիրը հեռացվում է...\nar:إزالة التثبيت قيد التقدم...\naz:Deinstalyasiya davam edir...\nbg:Деинсталиране...\nbr:Desinstalação em progresso...\nbs:Deinstalacija u toku ...\nca-xv:Desinstal·lació en progrés...\nca:Desinstal·lació en progrés...\ncn:卸载正在进行...\ncy:Wrthi'n dadosod...\ncz:Probíhá odinstalace...\nde:Die Deinstallation wird ausgeführt…\ndk:Afinstallation pågår ...\nel:Απεγκατάσταση σε εξέλιξη...\nes:Desinstalación en progreso...\net:Toimub eemaldamine...\neu:Kentzea garatzen...\nfa:فرآیند حذف برنامه در جریان است...\nfi:Poistaminen käynnissä...\nfr:Désinstallation en cours…\nga:Díshuiteáil ar siúl...\ngl:Desinstalación en procreso...\nhe:מסיר את SumatraPDF...\nhr:Deinstaliranje...\nhu:Eltávolítás folyamatban...\nid:Proses uninstall sedang berjalan...\nit:Disinstallazione in corso...\nja:アンインストール中…\nka:მიმდინარეობს დეინსტალაცია...\nkr:제거하는 중...\nku:سڕینەوە لە ئەنجامداندایە...\nlv:Notiek atinstalēšana...\nmk:Бришењето е во тек...\nmy:Penyahpasangan sedang dijalankan ...\nnl:Deinstallatie is bezig...\nnn:Avinstallasjon under arbeid...\nno:Avinstallering pågår...\npl:Trwa usuwanie...\npt:A desinstalar...\nro:Dezinstalare in curs...\nru:Происходит удаление...\nsk:Prebieha odinštalovanie...\nsl:Odstranjevanje poteka …\nsp-rs:Deinstaliranje u toku ...\nsq:Çinstalimi vijon...\nsr-rs:Деинсталирање у току ...\nsv:Avinstallerar...\nta:நிறுவல் நீக்கம் செயல்படுகிறது...\ntr:Program kaldırılıyor...\ntw:解除安裝正在進行...\nuk:Видалення триває...\nuz:O'chirilmoqda...\nvn:Đang gỡ bỏ...\n:Unknown source file (%s)\nam:Անհայտ ֆայլ (%s)\nar:ملف مصدري غير معروف (%s)\naz:Naməlum mənbə faylı (%s)\nbg:Файлът, избран за източник, е непознат (%s)\nbr:Arquivo fonte desconhecido (%s)\nbs:Nepoznat izvorni fajl (%s)\nby:Невядомы зыходны файл (%s)\nca-xv:Fitxer origen desconegut (%s)\nca:Fitxer origen desconegut (%s)\ncn:未知的源文件 (%s)\ncy:Ffeil ffynhonnell anhysbys (%s)\ncz:Neznámý zdrojový soubor (%s)\nde:Unbekannte Datei (%s)\ndk:Ukendt kildefil (%s)\nel:Άγνωστο αρχείο προέλευσης (%s)\nes:Archivo de origen desconocido (%s)\net:Tundmatu lähtefail (%s)\neu:Iturburu agiri ezezaguna: (%s)\nfa:پرونده‌ی منبع ناشناخته (%s)\nfi:Tuntematon lähdetiedosto (%s)\nfr:Fichier source inconnue (%s)\nfy-nl:Unbekend boarnebestân (%s)\nga:Comhad foinse anaithnid (%s)\ngl:Ficheiro de orixe descoñecido (%s)\nhe:קובץ מקור לא ידוע (%s)\nhi:अज्ञात स्रोत फ़ाइल (%s)\nhr:Nepoznata izvorna datoteka (%s)\nhu:Ismeretlen forrásfájl (%s)\nid:Berkas asal (%s) tidak diketahui\nit:File sorgente sconosciuto (%s)\nja:不明なソース ファイル (%s)\nka:წყაროს ფაილი უცნობია (%s)\nkr:알 수 없는 원본 파일 (%s)\nku:فایلە سەرچاوە نەناسراوەکان (%s)\nkw:Restren-bennfenten anaswonnys (%s)\nlt:Nežinomas pradinis failas (%s)\nlv:Nezināmas izcelsmes fails (%s)\nmk:Непозната изворна датотека (%s)\nmy:Fail sumber tidak diketahui (%s)\nne:अज्ञात स्रोत फाइल (%s)\nnl:Onbekend bronbestand (%s)\nnn:Ukjend kildefil (%s)\nno:Ukjent kildefil (%s)\npl:Nieznany plik źródłowy (%s)\npt:O ficheiro (%s) é desconhecido\nro:Fișier sursă necunoscut (%s)\nru:Неизвестный исходный файл (%s)\nsi:නොදත් මූලාශ්‍ර ගොනුව (%s)\nsk:Neznámy zdrojový súbor (%s)\nsl:Neznana izvorna datoteka (%s)\nsp-rs:Nepoznata izvorna datoteka (%s)\nsq:Skedë burimore e panjohur (%s)\nsr-rs:Непозната изворна датотека (%s)\nsv:Okänd källfil (%s)\nta:(%s) மூல கோப்பு கிடைக்கவில்லை\ntl:Hindi alam na source file (%s)\ntr:Bilinmeyen kaynak dosyası (%s)\ntw:未知來源檔案 (%s)\nuk:Невідомий файл-джерело (%s)\nuz:Noma'lum manba fayli (%s)\nvn:Không rõ tập tin nguồn (%s)\n:Use &tabs\nam:Ավելացնել &ներդիրներ\nar:الإستعمال & التبويبات\naz:&Tab-vərəqələrdən istifadə et\nbr:Usar &abas\nbs:Koristi &tabove\nca-xv:Utilitza &pestanyes\nca:Utilitza les pes&tanyes\ncn:使用页签(&T)\ncy:Defnyddio &tabiau\ncz:Použít &karty\nde:Dokumente in &Tabs öffnen\ndk:Brug &faneblade\nel:Χρήση &καρτελών\nes:Usar &pestañas\net:Kasuta &kaarte\neu:Erabili &hegatsak\nfa:استفاده از &سربرگ\nfi:Käytä välilehtiä\nfr:Utiliser les ongle&ts\nga:Bain feidhm as &cluaisíní\ngl:Usar &lapelas\nhe:השתמש בלשוניות\nhr:Koristi &kartice\nhu:Fülek használata\nid:Gunakan &tab\nit:Usa &schede\nja:タブを使う(&t)\nka:ჩა&ნართების გამოყენება\nkr:탭 사용(&T)\nku:بەکارهێنان &شریتەکان\nlv:Lietot &cilnes\nmk:Користи &табови\nnl:Gebruik &tabs\nnn:Bruk &faner\nno:Bruk &faner\npl:Włącz wyświetlanie &kart\npt:&Utilizar separadores\nru:Использовать &вкладки\nsk:Povoliť &záložky\nsl:Uporabljaj &zavihke\nsp-rs:Koristiti tab\nsr-rs:Користити таб\nsv:Använd flikar\ntr:&Sekmeler kullan\ntw:使用頁籤(&T):\nuk:Використовувати вкладки\nuz:&Ilovalarni qo'llash\nvn:Dùng &thẻ\n:Use SumatraPDF as the &default PDF reader\nam:Օգտ. SumatraPDF-ը որպես &PDF-ի հիմնական ծրագիր\nar: المحمولة باسم& قارئ مستندات محمولة افتراضي Sumatra استخدم مستندات\naz:SumatraPDF &standart PDF oxuyucusu kimi istifadə olunsun\nbg:Използване на SumatraPDF като основен четец на PDF файлове\nbr:Usar o SumatraPDF como o leitor PDF pa&drão\nbs:Koristi SumatraPDF kao &izvorni PDF čitač\nca-xv:Usa el SumatraPDF com a visor PDF &predeterminat\nca:Usa el SumatraPDF com a visor PDF &predeterminat\ncn:使用 SumatraPDF 作为默认的 PDF 阅读器(&U)\ncy:Defnyddio SumatraPDF fel y darllennydd PDF &rhagosodedig\ncz:Použít SumatraPDF jako &výchozí PDF prohlížeč\nde:SumatraPDF als Standard&programm für PDF Dokumente verwenden\ndk:Anvend SumatraPDF som &standardlæser for PDF-filer\nel:Χρησιμοποιήστε το SumatraPDF σαν το &default PDF reader\nes:Usar SumatraPDF como lector PDF pre&determinado\net:Kasuta SumatraPDF programmi &vaikimisi PDF-lehitsejana.\neu:Erabili SumatraP&DF berezko PDF irakurtzaile bezala\nfa:استفاده از SumatraPDF به عنوان پی‌دی‌اف خوان &پیشفرض\nfi:Käytä SumatraPDF:ää PDF-asiakirjojen oletuslukijana\nfr:Choisir SumatraPDF comme lecteur PDF par &défaut\nga:Bain feidhm as SumatraPDF mar an léitheoir PDF réamhshocraithe\ngl:Emprega SumatraPDF como o lector de PDF por &defecto\nhe:הגדר את SumatraPDF כתוכנת ברירת מחדל לקובצי PDF\nhr:Koristi SumatraPDF kao zadani PDF preglednik\nhu:SumatraPDF használata alapértelmezett PDF olvasóként\nid:Gunakan SumatraPDF sebagai pembaca PDF standar.\nit:Usa SumatraPDF come lettore PDF pre&definito\nja:SumatraPDF を PDF ファイルの既定のアプリケーションにしますか?(&d)\nka:SumatraPDF-ის &ნაგულისხმევ PDF-ის წამკითხველად გაყენება\nkr:SumatraPDF를 기본 PDF 리더로 사용(&D)\nku:وەکو خوێنەرەوەی &سەرەکی PDF SumatraPDF بەکارهێنانی\nlv:Izmantot SumatraPDF kā &noklusējuma PDF lasītāju\nmk:Користи го SumatraPDF како &основен читач на PDF\nmy:Jadikan SumatraPDF sebagai aplikasi utama pembaca PDF anda\nnl:Gebruik SumatraPDF als &standaard PDF lezer\nnn:Bruk SumatraPDF som standard PDF-lesar\nno:Bruk SumatraPDF som &standard PDF-leser\npl:Używaj SumatraPDF jako domyślnej przeglądarki PDF\npt:Utilizar o SumatraPDF como leitor pa&drão de PDF\nro:Folosiți SumatraPDF ca cititor implicit pentru fișiere P&DF\nru:Использовать SumatraPDF для просмотра PDF\nsk:Použi SumatraPDF ako &predvolený PDF prehliadač\nsl:Uporabi SumatraPDF kot privzeti P&DF prikazovalnik\nsp-rs:Koristi SumatraPDF kao glavni PDF čitač\nsq:Përdor SumatraPDF si lexuesin &standard të PDF-ve\nsr-rs:СуматраПДФ је &подразумевани прегледач\nsv:Använd SumatraPDF som standardläsare för PDF-filer\nta:சுமத்ரா PDFஐ முன்னிருப்பக பயன்படுத்து\ntr:SumatraPDF varsayılan PDF okuyucum olsun\ntw:使用 SumatraPDF 作為預設的 PDF 閱讀器(&U)\nuk:Використовувати SumatraPDF як переглядач для PDF за замовчуванням\nuz:SumatraPDF &andoza PDF o'qish vositasi sifatida ishlatish\nvn:Đặt SumatraPDF là trình đọc PDF mặc định\n:View\naf:Vertoon\nam:Տեսք\nar:العرض\naz:Görüntü\nbg:Изглед\nbn:দর্শন\nbr:Exibir\nbs:Prikaz\nby:Выгляд\nca-xv:Visualitza\nca:Visualitza\ncn:视图\ncy:Gweld\ncz:Zobrazení\nde:Ansicht\ndk:Vis\nel:Προβολή\nes:Visualización\net:Vaade\neu:Ikusi\nfa:نمایش\nfi:Näytä\nfr:Affichage\nfy-nl:Byld\nga:Amharc\ngl:Ver\nhe:תצוגה\nhi:देखें\nhr:Pogled\nhu:Alapértelmezett nézet\nid:Tampilan\nit:Visualizza\nja:表示\nka:ხედი\nkr:보기\nku:پیشاندان\nkw:Gwel\nlt:Rodymas\nlv:Skats\nmk:Поглед\nml:കാഴ്ച്ച\nmm:မြင်ကွင်း\nmy:Lihat\nne:हेर्नुहोस्\nnl:Beeld\nnn:Vis\nno:Vis\npa:ਵੇਖੋ\npl:Widok\npt:Ver\nro:Vizualizare\nru:Вид\nsi:දසුන (V)\nsk:Zobraziť\nsl:Pogled\nsn:Maonero\nsp-rs:Prikaz\nsq:Pamje\nsr-rs:Приказ\nsv:Visa\nta:நோக்கு\nth:มุมมอง\ntl:Tignan\ntr:Görünüm\ntw:檢視\nuk:Вигляд\nuz:Ko'rish\nvn:Hiển thị\n:Visit &Website\naf:&Besoek Webtuiste\nam:Ծրագրի &կայքը\nar:&زيارة موقع البرنامج\naz:Proqramın &vebsaytına keç\nbg:Посетете &уебсайта\nbn:&আমাদের ওয়েবসাইট ভ্রমণ করুন\nbr:&Visitar a página do SumatraPDF\nbs:&Posjeti web stranicu\nby:Наведаць сайт\nca-xv:Visiteu el lloc &web\nca:Visiteu el lloc &web\ncn:访问网站(&W)\ncy:&Ymweld â'r Wefan\ncz:Navštívit &webovou stránku\nde:SumatraPDF im &Internet\ndk:Besøg &internetside\nel:&Ιστοσελίδα προγράμματος\nes:Visitar sitio &Web\net:&Külasta kodulehte\neu:Ikusi &Webgunea\nfa:بازدید از &وب‌سایت\nfi:&Vieraile ohjelman kotisivuilla\nfr:Visiter le site &web\nfy-nl:Besykje it &webstee\nga:Tabhair cuairt ar an suíomh idirlíon\ngl:Visitar a páxina &web\nhe:בקר באתר...\nhi:वेबसाइट देखें(&W)\nhr:&Posjeti internetsku stranicu\nhu:&Weboldal\nid:&Kunjungi Situs\nit:Visita il sito &web\nja:Web サイトの訪問(&W)\nka:&ვებ-გვერდზე გადასვლა\nkr:웹 사이트 방문(&V)\nku:سەردانکردنی &ماڵپەڕ\nkw:&Mos dhe'n wiasva\nlt:Interneto &svetainė\nlv:Apmeklēt tīmekļa &vietni\nmk:Посети веб-сајт\nml:വെബ്സൈറ്റ് സന്ദര്‍ശിക്കുക\nmm:&ဝဘ်ဌာနေ သို့\nmy:&Lawat lamanweb\nne:&वेबसाइट भ्रमण गर्नुहोस्\nnl:Bezoek de &website\nnn:Vitj &heimeside\nno:Åpne &hjemmesiden\npa:ਵੇਬਸਾਇਟ ਵੇਥੋ(&V)\npl:Odwiedź &stronę internetową\npt:&Visitar sítio web\nro:&Vizitează website-ul\nru:Посетить &сайт программы\nsi:&වෙබ්අඩවියට පිවිසෙන්න\nsk:&Navštíviť webovú stránku\nsl:Ob&išči domačo stran\nsn:&Shanyira dande-mtande\nsp-rs:Poseti veb-sajt\nsq:SumatraPDF në &internet\nsr-rs:Посети веб-сајт\nsv:Besök webbplats\nta:வலைத்தளம் செல்\nth:เยี่ยมเว็บไชด์\ntl:Puntahan ang Websa&yt\ntr:&Website ziyaret et\ntw:瀏覽網站(&W)\nuk:Відкрити сайт\nuz:&Veb sahifaga o'tish\nvn:Trang chủ\n:Warning\naf:Waarskuwing\nam:Զգուշացում\nar:تحذير\naz:Xəbərdarlıq\nbg:Внимание\nbr:Aviso\nbs:Upozorenje\nby:Папярэджанне\nca-xv:Avís\nca:Avís\ncn:警告\ncy:Rhybudd\ncz:Upozornění\nde:Warnung\ndk:Advarsel\nel:Προειδοποίηση\nes:Advertencia\net:Hoiatus\neu:Oharra\nfa:هشدار\nfi:Varoitus\nfr:Avertissement\nfy-nl:Warskôging\nga:Rabhadh\ngl:Aviso\nhe:אזהרה\nhi:चेतावनी\nhr:Upozorenje\nhu:Figyelmeztetés\nid:Peringatan\nit:Attenzione\nja:警告\nka:გაფრთხილება\nkr:경고\nku:ئاگادارکردنەوە\nkw:Gwarnyans\nlt:Įspėjimas\nlv:Brīdinājums\nmk:Предупредување\nml:മുന്നറിയിപ്പ്\nmy:Amaran\nne:चेतावनी\nnl:Waarschuwing\nnn:Fare\nno:Advarsel\npl:Uwaga\npt:Aviso\nro:Avertisment\nru:Внимание\nsi:අනතුරු හැගවීම\nsk:Upozornenie\nsl:Opozorilo\nsp-rs:Upozorenje\nsq:Kujdes\nsr-rs:Упозорење\nsv:Varning\nta:எக்சரிக்கை\ntl:Babala\ntr:Uyarı\ntw:警告\nuk:Застереження\nuz:Diqqat\nvn:Cảnh báo\n:XPS documents\nam:XPS ֆայլեր\nar:مستندات XPS\naz:XPS sənədləri\nbg:XPS документи\nbr:Documentos XPS\nbs:XPS dokumenti\nca-xv:Documents XPS\nca:Documents XPS\ncn:XPS 文件\ncy:Dogfennau XPS\ncz:Dokumenty XPS\nde:XPS-Dokumente\ndk:XPS-dokumenter\nel:Έγγραφα XPS\nes:Documentos XPS\net:XPS-dokumendid\neu:XPS agiriak\nfa:XPS اسناد\nfi:XPS-asiakirjat\nfr:Documents XPS\nfy-nl:XPS-bestannen\nga:Cáipéisí XPS\ngl:Documentos XPS\nhe:קובצי XPS\nhi:XPS दस्तावेज़\nhr:XPS dokumenti\nhu:XPS fájlok\nid:Dokumen XPS\nit:Documenti XPS\nja:XPS ドキュメント\nka:XPS დოკუმენტები\nkr:XPS 문서\nku:XPS بەڵگەنامەکانی\nlt:XPS dokumentai\nlv:XPS dokumenti\nmk:XPS-документи\nmy:Dokumen XPS\nne:XPS कागजातहरु\nnl:XPS-documenten\nnn:XPS-dokumentar\nno:XPS-dokumenter\npl:Pliki XPS\npt:Documentos XPS\nro:Documente XPS\nru:Документы XPS\nsk:XPS dokumenty\nsl:XPS dokumenti\nsp-rs:XPS dokumenti\nsq:Dokumente XPS\nsr-rs:XPS документи\nsv:XPS-dokument\nta:XPS ஆவணங்கள்\ntr:XPS belgeleri\ntw:XPS 文件\nuk:Документи XPS\nuz:XPS hujjatlari\nvn:Tập tin XPS\n:You have the latest version.\naf:Jy Het Die Nuutste Uitgawe.\nam:Սա նորագույն տարբերակն է։\nar:لديك آخر نسخة\naz:Ən son versiyanı istifadə edirsiniz.\nbg:Имате последната версия.\nbn:আপনার এই সংস্করণটি সর্বাধুনিক।\nbr:Esta é a versão mais recente.\nbs:Koristite najnoviju verziju.\nby:Вы выкарыстоўваеце апошнюю версію.\nca-xv:Teniu la darrera versió.\nca:Teniu la darrera versió.\ncn:您的版本为最新版。\ncy:Mae'r fersiwn diweddaraf gennych.\ncz:Používáte nejnovější verzi.\nde:Sie haben die neuste Version installiert.\ndk:Du har den seneste version.\nel:Έχετε την πιο πρόσφατη έκδοση.\nes:Esta es la última versión disponible.\net:Kasutusel on uusim versioon.\neu:Azken bertsioa duzu.\nfa:نسخه‌ی شما جدیدترین نسخه است.\nfi:Sinulla on uusin versio.\nfr:Vous avez la dernière version.\nfy-nl:Jo brûke de meast resinte ferzje.\nga:Tá an leagan is úire agat.\ngl:Tes a última versión\nhe:ברשותך הגרסה האחרונה.\nhi:आपके पास पहले से ही नवीनतम संसकरण है\nhr:Imate najnoviju inačicu.\nhu:Önnél a legfrissebb verzió van telepítve.\nid:Anda telah memiliki versi terbaru\nit:Il programma è aggiornato.\nja:最新のバージョンです。\nka:თქვენ იყენებთ უახლეს ვერსიას.\nkr:최신 버전을 사용하고 있습니다.\nku:تۆ دواین وەشانت هەیە.\nkw:Yma'n versyon nowyttha genes.\nlt:Jūs naudojatės naujausia programos laida.\nlv:Jums ir jaunākā versija.\nmk:Ја имате најновата верзија.\nmm:သင့်ဟာသည် နောက်ဆုံးထုပ်ဖြစ်၏။\nmy:Anda mempunyai versi terkini.\nne:तपाई संग अद्यावधिक संस्करण छ |\nnl:U gebruikt de meest recente versie.\nnn:Du har den siste versjonen.\nno:Du har den siste versjonen.\npa:ਤੋਹਾਡੇ ਕੋਲ ਪਿਹਲਾਂ ਤੌਂ ਹੀ ਨਵਾਂ ਵਰਜਨ ਹੈ\npl:Masz najnowszą wersję.\npt:Já tem a versão mais recente\nro:Aveți ultima versiune.\nru:Вы используете самую новую версию программы.\nsi:ඔබ සතුව නවතම සංස්කරණය ඇත.\nsk:Používate najnovšiu verziu.\nsl:Imate najnovejšo različico.\nsn:Pane version idzva.\nsp-rs:Vaša verzija je ažurna.\nsq:Keni versionin e fundit.\nsr-rs:Ваша верзија је ажурна.\nsv:Du har den senaste versionen.\nta:உங்களிடம் புதிய பதிப்பு உள்ளது\nth:โปรแกรมของคุณเป็นเวอร์ชั่นล่าสุดอยู่แล้ว\ntl:Ito ang pinakabagong bersyon.\ntr:Güncel sürümü kullanıyorsunuz.\ntw:你的版本已是最新版。\nuk:Ви вже маєте найновішу версію.\nuz:Sizda so'nggi versiya.\nvn:Bạn đang dùng phiên bản mới nhất.\n:You have version %s\naf:Jy Het Weergawe %s\nam:Դուք օգտագործում եք %s տարբերակը\nar:لديك النسخة %s\naz:Siz proqramın %s versiyasını istifadə edirsiniz.\nbg:Вашата версия е %s\nbn:আপনার সংস্করণটি হল %s\nbr:Você tem a versão %s\nbs:Imate verziju %s\nby:Вы выкарыстоўваеце версію %s\nca-xv:Teniu la versió %s\nca:Teniu la versió %s\ncn:目前版本为 %s\ncy:Mae fersiwn %s gennych\ncz:Používáte verzi %s\nde:Sie haben Version %s.\ndk:Du har version %s\nel:Έχετε την έκδοση %s\nes:La versión actual es: %s\net:Kasutusel on versioon %s\neu:%s bertsioa duzu\nfa:شما نسخه‌ی %s را دارید\nfi:Sinulla on versio %s\nfr:Votre version est la %s\nfy-nl:Jo hawwe ferzje %s\nga:Tá leagan %s agat\ngl:A versión actual é %s\nhe:הגרסה שברשותך: %s.\nhi:आपके पास  %s संसकरण है\nhr:Imate inačicu %s\nhu:Jelenlegi verzió: %s\nid:Anda memiliki versi %s\nit:Versione attuale: %s\nja:バージョン %s です\nka:თქვენ იყენებთ %s ვერსიას\nkr:현재 버전은 %s 입니다.\nku:تۆ وەشانی %s ت هەیە\nkw:Yma versyon %s genes\nlt:Jūsų naudojama laida: %s\nlv:Jums ir versija %s\nmk:Ја имате верзијата %s\nmm:သင့်အမျိုးအစားသည် %s\nmy:Versi anda %s\nne:तपाई संग %s संस्करण छ\nnl:U heeft versie %s\nnn:Du har versjon %s\nno:Du har versjon %s\npa:ਤੋਹਾਡੇ ਕੋਲ %s ਵਰਜਨ ਹੈ\npl:Masz wersję %s.\npt:Tem a versão %s\nro:Aveți versiunea %s\nru:Вы используете версию %s\nsi:ඔබගේ වෙළුම %s\nsk:Používate verziu %s\nsl:Imate različico %s\nsn:Pane version %s\nsp-rs:Imate verziju %s\nsq:Keni versionin %s\nsr-rs:Имате верзију %s\nsv:Du har version %s\nta:உங்களின் பதிப்பு %s\ntl:Ang bersyong nasa iyo ay %s\ntr:Kullandığınız sürüm: %s\ntw:你的版本為 %s\nuk:Ви використовуєте версію %s\nuz:Sizdagi versiya %s\nvn:Bạn đang dùng phiên bản %s\n:Zoom\nam:Դիտափոխել\nar:تكبير/تصغير\naz:Miqyas\nbg:Увеличение\nbr:Zoom\nbs:Uvećanje\nca-xv:Zoom\nca:Zoom\ncn:缩放\ncy:Chwyddo\ncz:Zvětšení\nde:Zoom\ndk:Zoom\nel:Ζουμ\nes:Ampliar\net:Suurenda\neu:Zooma\nfa:بزرگنمایی\nfi:Zoomaus\nfr:Zoom\nfy-nl:Zoom\nga:Formhéadú\ngl:Aumento\nhe:זום\nhi:ज़ूम\nhr:Uvećanje\nhu:Beállít\nid:Sesuaikan\nit:Zoom\nja:OK\nka:მასშტაბი\nkr:배율\nku:نزیک خستنەوە\nkw:Zoumya\nlt:Mastelis\nlv:Tālummainīt\nmk:Зумирање\nmy:Zum\nne:आकार परिवर्तन\nnl:Zoom\nnn:Zoom\nno:Zoom\npl:Powiększenie\npt:Ajustar\nro:Mărire\nru:Масштаб\nsi:විශාලනය (Z)\nsk:Zmeniť veľkosť\nsl:Povečava\nsp-rs:Uvećaj\nsq:Përshtat\nsr-rs:Увећај\nsv:Zoom\nta:உரு அளவு\ntl:Laki\ntr:Yakınlaştırma\ntw:縮放\nuk:Масштаб\nuz:Miqyos\nvn:Thu Phóng\n:Zoom In\naf:Zoem In\nam:Մեծացնել\nar:تكبير\naz:Böyüt\nbg:Увеличаване\nbn:বড় করুন\nbr:Aumentar zoom\nbs:Uvećaj\nby:Павялічыць\nca-xv:Apropa't\nca:Acosta't\ncn:放大\ncy:Chwyddo i Mewn\ncz:Zvětšit\nde:Vergrößern\ndk:Zoom ind\nel:Μεγέθυνση\nes:Acercar\net:Suurenda\neu:Zooma Handitu\nfa:بزرگ نمایی\nfi:Lähennä\nfr:Zoom avant\nfy-nl:Ynzoome\nga:Gluais isteach\ngl:Ampliar\nhe:הגדל תצוגה\nhi:ब​ङा करें\nhr:Uvećaj\nhu:Nagyítás\nid:Perbesar\nit:Ingrandimento\nja:拡大\njv:Nggedhekake\nka:გადიდება\nkr:확대\nku:نزیک خستنەوە\nkw:Zoumya a-bervedh\nlt:Padidinti\nlv:Pietuvināt\nmk:Зголеми\nml:വലുതാക്കുക\nmm:ကျဉ်းပါ\nmy:Fokus ke dalam\nne:ठुलो बनाउनुहोस्\nnl:Inzoomen\nnn:Zoom inn\nno:Zoom inn\npa:ਵੱਡਾ ਕਰੋ\npl:Powiększ\npt:Ampliar\nro:Mărește\nru:Увеличить\nsi:විශාල කරන්න\nsk:Zväčšiť\nsl:Povečaj\nsn:Kudza\nsp-rs:Uvećaj\nsq:Zmadhoj\nsr-rs:Увећај\nsv:Zooma in\nta:பெரிதாக்கு\nth:ขยาย\ntl:Palakihin\ntr:Yakınlaştır\ntw:放大\nuk:Збільшити\nuz:Kattalashtirish\nvn:Phóng to\n:Zoom Out\naf:Zoem Uit\nam:Փոքրացնել\nar:تصغير\naz:Kiçilt\nbg:Намаляне\nbn:ছোট করুন\nbr:Diminuir zoom\nbs:Umanji\nby:Паменьшыць\nca-xv:Allunya't\nca:Allunya't\ncn:缩小\ncy:Chwyddo Allan\ncz:Zmenšit\nde:Verkleinern\ndk:Zoom ud\nel:Σμίκρυνση\nes:Alejar\net:Vähenda\neu:Zooma Gutxitu\nfa:کوچک نمایی\nfi:Loitonna\nfr:Zoom arrière\nfy-nl:Utzoome\nga:Gluais amach\ngl:Reducir\nhe:הקטן תצוגה\nhi:छोटा करें\nhr:Umanji\nhu:Kicsinyítés\nid:Perkecil\nit:Riduzione\nja:縮小\njv:Nyilikake\nka:დაპატარავება\nkr:축소\nku:دوور خستنەوە\nkw:Zoumya dhe-ves\nlt:Sumažinti\nlv:Attālināt\nmk:Намали\nml:ചെറുതാക്കുക\nmm:ချဲ့ပါ\nmy:Fokus ke luar\nne:सानो बनाउनुहोस्\nnl:Uitzoomen\nnn:Zoom ut\nno:Zoom ut\npa:ਛੋਟਾ ਕਰੋ\npl:Zmniejsz\npt:Reduzir\nro:Micșorează\nru:Уменьшить\nsi:කුඩා කරන්න\nsk:Zmenšiť\nsl:Pomanjšaj\nsn:Duputsa\nsp-rs:Umanji\nsq:Zvogëloj\nsr-rs:Умањи\nsv:Zooma ut\nta:சிறிதாக்கு\nth:ย่อ\ntl:Paliitin\ntr:Uzaklaştır\ntw:縮小\nuk:Зменшити\nuz:Kichraytirish\nvn:Thu nhỏ\n:Zoom factor\nam:Չափի գործակիցը\nar:عامل التكبير/التصغير\naz:Miqyas\nbg:Коефициент на увеличение\nbr:Proporção de Zoom\nbs:Faktor uvećanja\nca-xv:Factor d'escala\nca:Factor d'escala\ncn:缩放比例\ncy:Ffactor Chwyddo\ncz:Měřítko přiblížení\nde:Zoomfaktor\ndk:Zoomfaktor\nel:Ποσοστό μεγέθυνσης\nes:Proporción de escala\net:Suurendusaste\neu:Zomm ezaugarria\nfa:ضریب بزرگنمایی\nfi:Zoomaustaso\nfr:Facteur de zoom\nfy-nl:Zoomfaktor\nga:Fachtóir formhéadaithe\ngl:Factor de aumento\nhe:מקדם זום\nhi:ज़ूम गुणक\nhr:Faktor uvećanja\nhu:Nagyítás mértéke\nid:Faktor pembesaran\nit:Fattore di ingrandimento\nja:拡大率\nka:მასშტაბი\nkr:배율 계수\nku:نزیک خستنەوەی تایبەت\nkw:Faktor-zoum\nlt:Mastelis\nlv:Tālummaiņas koeficients\nmk:Степен на зумирање\nmy:Faktor zoom\nne:आकार कारकतत्व\nnl:Zoomniveau\nnn:Zoomfaktor\nno:Zoom til\npl:Współczynnik powiększenia\npt:Ampliação\nro:Factor de mărire\nru:Масштаб\nsi:විශාලන කළමනාකරණය\nsk:Veľkosť zobrazenia\nsl:Faktor povečave\nsp-rs:Procenat uvećanja\nsq:Koeficienti i zmadhimit\nsr-rs:Проценат увећања\nsv:Zoomfaktor\nta:உருக்காரணி\ntl:Antas ng laki\ntr:Yakınlaştırma faktörü\ntw:縮放比例\nuk:Масштаб\nuz:Miqyos omili\nvn:Hệ số thu phóng\n:[Changes detected; refreshing] %s\nam:[Հայտնաբերվել են փոփոխություններ, ընթանում է թարմացում] %s\nar:%s [تغييرات إكتشفت؛ المنعش] \naz:[Dəyişikliklər müəyyən edildi; yenilənmə] %s\nbg:[Намерени са промени; обновявам] %s\nbn:[পরিবর্তন সনাক্ত হয়েছে; রিফ্রেশ করা হচ্ছে] %s\nbr:[Mudanças detectadas; atualizando] %s\nbs:[Uočena promjena; osvježavam] %s\nby:[Выяўлены змены; адбываецца абнаўленне] %s\nca-xv:[S'han detectat canvis; s'està actualitzant] %s\nca:[S'han detectat canvis; s'està actualitzant] %s\ncn:[已检测更改，正在更新] %s\ncy:[Wedi canfod newidiadau: adnewyddu] %s\ncz:[Zjištěna změna; probíhá aktualizace] %s\nde:[Datei wurde geändert; aktualisiere…] %s\ndk:[Ændringer konstateret; opdaterer] %s\nel:[Ανιχνεύτηκαν αλλαγές, ανανέωση] %s\nes:[Cambios detectados; actualizando] %s\net:[Leiti muutuseid; värskendamine] %s\neu:[Aldaketak atzeman dira, berritzen] %s\nfa:%s [تغییرات شناسایی شد؛ تازه‌سازی]\nfi:[Muutoksia tunnistettiin; päivitetään] %s\nfr:[Modifications détectées ; actualisation] %s\nfy-nl:[Bestân wizige; ferfarskje] %s\nga:[Athruithe braite; ag athnuachan] %s\ngl:[Cambios detectados; actualizando] %s\nhe:[זוהו שינויים; מרענן] %s\nhi:[परिवर्तन का पता चला; तरोताज़ा हो रहा है ]%s\nhr:[Dogodila se promjena - osvježavam] %s\nhu:[a file megváltozott; frissítés] %s\nid:[Perubahan terdeteksi; muat ulang] %s\nit:[Individuati cambiamenti; aggiornmento] %s\nja:[変更を検出: 更新中] %s\nka:[აღმოჩენილია ცვლილებები; მიმდინარეობს განახლება...] %s\nkr:[변경 감지됨.  새로 고치는 중...] %s\nku:%s [گۆڕانکاری تێداکرا؛ نوێکردنەوە ]\nkw:[Nowythyansow kevys; owth arnowytha] %s\nlt:[Aptikta pakitimų; atnaujinama] %s\nlv:[Ir atklātas izmaiņas; notiek atsvaidzināšana] %s\nmk:[Забележав промени; освежувам...] %s\nmy:[Perubahan dikesan; refresh semula] %s\nne:[परिवर्तन पत्ता लाग्यो; ताजा गरिँदैछ] %s\nnl:[Bestand gewijzigd; verversen] %s\nnn:[Endringar oppdaga; lastar inn på nytt] %s\nno:[Endringer oppdaget; oppdaterer] %s\npl:[wykryto zmiany; odświeżanie] %s\npt:[Mudanças detetadas; a atualizar] %s\nro:[Schimbări detectate; actualizare] %s\nru:[Обнаружены изменения; обновление...] %s\nsi:[වෙනස්කම් හදුනාගෙන; ප්‍රතිපූරණය වෙමින්] %s\nsk:[Boli zistené zmeny, znovu sa načítava] %s\nsl:[Spremembe zaznane; osvežitev poteka] %s\nsp-rs:[Promene su primećene; osvežavanje] %s\nsq:[Dikton ndryshimet; freskon] %s\nsr-rs:[Промене су примећене; освежавање] %s\nsv:[Ändringar detekterade; uppdaterar] %s\nta:[மாற்றங்கள் கண்டுபிடிக்க பட்டுள்ளது; புதுபிக்கபட்டு வருகிறது]%s\nth:[พบการเปลี่ยนแปลง; กำลังเรียกใหม่] %s\ntl:[May napansing mga pagbabago; nagre-refresh] %s\ntr:[Değişiklik tespit edildi; güncelleniyor] %s\ntw:[已偵測變更，正在更新] %s\nuk:[Знайдено зміни; оновлення] %s\nuz:[O'zgarishlar aniqlangan; yangilanmoqda] %s\nvn:[Phát hiện thay đổi; đang cập nhật] %s\n:copying text\nam:Տեքստը պատճենվում է\nar:ناسخ النص\naz:mətnin kopyalanması\nbg:копиране на текст\nbn:লেখা কপি করা হচ্ছে\nbr:copiando texto\nbs:kopiram tekst\nca-xv:s'està copiant text\nca:s'està copiant text\ncn:正在复制文本\ncy:copïo testun\ncz:kopírování textu\nde:Text kopieren verweigert\ndk:kopierer tekst\nel:αντιγραφή κειμένου\nes:copiado de texto\net:teksti kopeerimine\neu:idazkia kopiatzen\nfa:در حال رونوشت متن\nfi:Tekstin kopiointi\nfr:copie de texte\nga:ag macasamhlú an téacs\ngl:copiando texto\nhe:מעתיק טקסט\nhi:पाठ छापना\nhr:kopiram tekst\nhu:Szöveg vágólapra\nid:menyalin teks\nit:Copia del testo...\nja:コピーするテキスト\nka:ტექსტი კოპირდება\nkr:문구 복사하는 중...\nku:لەبەرگرتنەوەی دەق\nlt:kopijuojamas tekstas\nlv:teksta kopēšana\nmk:копирам текст\nml:വാക്യങ്ങള്‍ പകര്‍ത്തിക്കൊണ്ടിരിക്കുന്നു.\nmy:menyalin teks\nne:पाठ प्रतिलिपि बनाईदैछ\nnl:tekst kopiëren\nnn:Kopierer tekst\nno:kopierer tekst\npl:kopiowanie tekstu\npt:cópia de texto\nro:se copiază textul\nru:копирование текста\nsi:අකුරු පිටපත්කරන්න\nsk:prebieha kopírovanie textu\nsl:kopiranje besedila\nsp-rs:kopiranje teksta\nsq:kopjimi i tekstit\nsr-rs:копирање текста\nsv:kopierar text\nta:நகல் எடுக்கப்படுகிறது\nth:คัดลอกข้อความ\ntl:kinokopya ang mensahe\ntr:metin kopyalanıyor\ntw:正在複製文字\nuk:копіювання тексту\nuz:matnni nusxa olish\nvn:đang chép văn bản\n:printing document\nam:Ֆայլը տպվում է\nar:طباعة المستند\naz:sənədin çap olunması\nbg:отпечатване на документ\nbr:imprimindo documento\nbs:štampam dokument\nca-xv:s'està imprimint el document\nca:s'està imprimint el document\ncn:正在打印文档\ncy:argraffu dogfen\ncz:tisk dokumentu\nde:Dokument drucken verweigert\ndk:udskriver dokument\nel:εκτύπωση εγγράφου\nes:imprimiendo documento\net:dokumendi printimine\neu:agiria irarkitzen\nfa:در حال چاپ سند\nfi:tulostetaan asiakirjaa\nfr:impression du document\nga:ag clóbhualadh an cháipéis\ngl:imprimindo documento\nhe:מדפיס קובץ.\nhi:छपाई दस्तावेज़\nhr:ispisujem dokument\nhu:Nyomtatás\nid:mencetak dokumen\nit:Stampa documento...\nja:印刷するドキュメント\nka:დოკუმენტი იბეჭდება\nkr:문서 인쇄\nku:چاپکردنی بەڵگەنامە\nlt:spausdinamas dokumentas\nlv:dokumenta drukāšana\nmk:печатам документ\nmy:mencetak dokumen\nne:कागजात छपाइ\nnl:document afdrukken\nnn:Skrivar ut dokument\nno:skriver ut dokument\npl:drukowanie dokumentu\npt:imprimir documento\nro:se imprimă documentul\nru:печать документа\nsi:ලේඛනය මුද්‍රණය\nsk:prebieha tlač dokumentu\nsl:tiskanje dokumenta\nsp-rs:štampanje dokumenta\nsq:printimi i dokumentit\nsr-rs:штампање документа\nsv:skriver ut dokument\nta:கோப்பு அக்சிடப்படுகிறது\ntl:ipini-print ang dokumento\ntr:belge yazdırılıyor\ntw:正在列印文件\nuk:друк документа\nuz:hujjatni chop etish\nvn:đang in tập tin\n"
  },
  {
    "path": "tools/build/analyze.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// AnalyzeLine has info about a warning line from prefast/analyze build\n// Given:\n//\n// c:\\users\\kjk\\src\\sumatrapdf\\ext\\unarr\\rar\\uncompress-rar.c(171): warning C6011:\n// Dereferencing NULL pointer 'code->table'. : Lines: 163, 165, 169, 170,\n// 171 [C:\\Users\\kjk\\src\\sumatrapdf\\vs2015\\Installer.vcxproj]\n//\n// FilePath will be: \"ext\\unarr\\rar\\uncompress-rar.c\"\n// LineNo will be: 171\n// Message will be: warning C6011: Dereferencing NULL pointer 'code->table'. : Lines: 163, 165, 169, 170, 171\ntype AnalyzeLine struct {\n\tFilePath string\n\tLineNo   int\n\tMessage  string\n\tOrigLine string\n}\n\n// ByPathLine is to sort AnalyzeLine by file path then by line number\ntype ByPathLine []*AnalyzeLine\n\nfunc (s ByPathLine) Len() int {\n\treturn len(s)\n}\nfunc (s ByPathLine) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\nfunc (s ByPathLine) Less(i, j int) bool {\n\tif s[i].FilePath == s[j].FilePath {\n\t\treturn s[i].LineNo < s[j].LineNo\n\t}\n\treturn s[i].FilePath < s[j].FilePath\n}\n\nvar (\n\tcurrDirLenCached int\n)\n\nfunc currDirLen() int {\n\tif currDirLenCached == 0 {\n\t\tdir, err := os.Getwd()\n\t\tfataliferr(err)\n\t\tcurrDirLenCached = len(dir)\n\t}\n\treturn currDirLenCached\n}\n\nfunc pre(s string) string {\n\treturn `<pre style=\"white-space: pre-wrap;\">` + s + `</pre>`\n}\n\nfunc a(url, txt string) string {\n\treturn fmt.Sprintf(`<a href=\"%s\">%s</a>`, url, txt)\n}\n\n//https://github.com/sumatrapdfreader/sumatrapdf/blob/c760b1996bec63c0bd9b2910b0811c41ed26db60/premake5.lua\nfunc htmlizeSrcLink(al *AnalyzeLine, gitVersion string) string {\n\tpath := strings.Replace(al.FilePath, \"\\\\\", \"/\", -1)\n\tlineNo := al.LineNo\n\turi := fmt.Sprintf(\"https://github.com/sumatrapdfreader/sumatrapdf/blob/%s/%s#L%d\", gitSha1, path, lineNo)\n\ttxt := fmt.Sprintf(\"%s(%d)\", al.FilePath, lineNo)\n\treturn a(uri, txt)\n}\n\nfunc htmlizeErrorLines(errors []*AnalyzeLine) ([]string, []string, []string) {\n\tvar sumatraErrors, mupdfErrors, extErrors []string\n\tfor _, al := range errors {\n\t\ts := htmlizeSrcLink(al, gitSha1) + \" : \" + al.Message\n\t\tpath := al.FilePath\n\t\tif strings.HasPrefix(path, \"src\") {\n\t\t\tsumatraErrors = append(sumatraErrors, s)\n\t\t} else if strings.HasPrefix(path, \"mupdf\") {\n\t\t\tmupdfErrors = append(mupdfErrors, s)\n\t\t} else if strings.HasPrefix(path, \"ext\") {\n\t\t\textErrors = append(extErrors, s)\n\t\t} else {\n\t\t\textErrors = append(extErrors, s)\n\t\t}\n\t}\n\treturn sumatraErrors, mupdfErrors, extErrors\n}\n\nfunc genAnalyzeHTML(errors []*AnalyzeLine) string {\n\tsumatraErrors, mupdfErrors, extErrors := htmlizeErrorLines(errors)\n\tnSumatraErrors := len(sumatraErrors)\n\tnMupdfErrors := len(mupdfErrors)\n\tnExtErrors := len(extErrors)\n\n\tres := []string{\"<html>\", \"<body>\"}\n\n\thomeLink := a(\"../index.html\", \"Home\")\n\tcommitLink := a(\"https://github.com/sumatrapdfreader/sumatrapdf/commit/\"+gitSha1, gitSha1)\n\ts := fmt.Sprintf(\"%s: commit %s, %d warnings in sumatra code, %d in mupdf, %d in ext:\", homeLink, commitLink, nSumatraErrors, nMupdfErrors, nExtErrors)\n\tres = append(res, s)\n\n\ts = pre(strings.Join(sumatraErrors, \"\\n\"))\n\tres = append(res, s)\n\n\tres = append(res, \"<p>Warnings in mupdf code:</p>\")\n\ts = pre(strings.Join(mupdfErrors, \"\\n\"))\n\tres = append(res, s)\n\n\tres = append(res, \"<p>Warnings in ext code:</p>\")\n\ts = pre(strings.Join(extErrors, \"\\n\"))\n\tres = append(res, s)\n\n\tres = append(res, \"</pre>\")\n\tres = append(res, \"</body>\", \"</html>\")\n\treturn strings.Join(res, \"\\n\")\n}\n\nfunc parseAnalyzeLine(s string) AnalyzeLine {\n\tsOrig := s\n\t// remove \" [C:\\Users\\kjk\\src\\sumatrapdf\\vs2015\\Installer.vcxproj]\" from the end\n\tend := strings.LastIndex(s, \" [\")\n\tfatalif(end == -1, \"invalid line '%s'\\n\", sOrig)\n\ts = s[:end]\n\tparts := strings.SplitN(s, \"): \", 2)\n\tfatalif(len(parts) != 2, \"invalid line '%s'\\n\", sOrig)\n\tres := AnalyzeLine{\n\t\tOrigLine: sOrig,\n\t\tMessage:  parts[1],\n\t}\n\ts = parts[0]\n\tend = strings.LastIndex(s, \"(\")\n\tfatalif(end == -1, \"invalid line '%s'\\n\", sOrig)\n\t// change\n\t// c:\\users\\kjk\\src\\sumatrapdf\\ext\\unarr\\rar\\uncompress-rar.c\n\t// =>\n\t// ext\\unarr\\rar\\uncompress-rar.c\n\tpath := s[:end]\n\t// sometimes the line starts with:\n\t// 11>c:\\users\\kjk\\src\\sumatrapdf\\ext\\bzip2\\bzlib.c(238)\n\tstart := strings.Index(path, \">\")\n\tif start != -1 {\n\t\tpath = path[start+1:]\n\t}\n\tstart = currDirLen() + 1\n\tres.FilePath = path[start:]\n\tn, err := strconv.Atoi(s[end+1:])\n\tfataliferr(err)\n\tres.LineNo = n\n\treturn res\n}\n\nfunc isSrcFile(name string) bool {\n\text := strings.ToLower(filepath.Ext(name))\n\tswitch ext {\n\tcase \".cpp\", \".c\", \".h\":\n\t\treturn true\n\t}\n\treturn false\n}\n\n// the compiler prints file names lower cased, we want real name in file system\n// (otherwise e.g. links to github break)\nfunc fixFileNames(a []*AnalyzeLine) {\n\tfmt.Printf(\"fixFileNames\\n\")\n\tfiles := make(map[string]string)\n\tfilepath.Walk(\".\", func(path string, fi os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\t\tif !isSrcFile(path) {\n\t\t\treturn nil\n\t\t}\n\t\t//fmt.Printf(\"path: '%s', name: '%s'\\n\", path, fi.Name())\n\t\tpathLower := strings.ToLower(path)\n\t\tfiles[pathLower] = path\n\t\treturn nil\n\t})\n\tfor _, al := range a {\n\t\tif sub := files[al.FilePath]; sub != \"\" {\n\t\t\tal.FilePath = sub\n\t\t}\n\t}\n}\n\nfunc parseAnalyzeOutput(d []byte) {\n\tlines := toTrimmedLines(d)\n\tvar warnings []string\n\tfor _, line := range lines {\n\t\tif strings.Contains(line, \": warning C\") {\n\t\t\twarnings = append(warnings, line)\n\t\t}\n\t}\n\n\tseen := make(map[string]bool)\n\tvar deDuped []*AnalyzeLine\n\tfor _, s := range warnings {\n\t\tal := parseAnalyzeLine(s)\n\t\tfull := fmt.Sprintf(\"%s, %d, %s\\n\", al.FilePath, al.LineNo, al.Message)\n\t\tif !seen[full] {\n\t\t\tdeDuped = append(deDuped, &al)\n\t\t\tseen[full] = true\n\t\t\t//fmt.Print(full)\n\t\t}\n\t}\n\n\tsort.Sort(ByPathLine(deDuped))\n\tfixFileNames(deDuped)\n\n\tif false {\n\t\tfor _, al := range deDuped {\n\t\t\tfmt.Printf(\"%s, %d, %s\\n\", al.FilePath, al.LineNo, al.Message)\n\t\t}\n\t}\n\tfmt.Printf(\"\\n\\n%d warnings\\n\", len(deDuped))\n\n\ts := genAnalyzeHTML(deDuped)\n\terr := ioutil.WriteFile(\"analyze-errors.html\", []byte(s), 0644)\n\tfataliferr(err)\n\t// TODO: open a browser with analyze-errors.html\n}\n\nfunc parseSavedAnalyzeOuptut() {\n\td, err := ioutil.ReadFile(\"analyze-output.txt\")\n\tfataliferr(err)\n\tparseAnalyzeOutput(d)\n}\n"
  },
  {
    "path": "tools/build/cmd.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"time\"\n)\n\nfunc cmdToStrLong(cmd *exec.Cmd) string {\n\tarr := []string{cmd.Path}\n\tarr = append(arr, cmd.Args...)\n\treturn strings.Join(arr, \" \")\n}\n\nfunc cmdToStr(cmd *exec.Cmd) string {\n\ts := filepath.Base(cmd.Path)\n\tarr := []string{s}\n\tarr = append(arr, cmd.Args...)\n\treturn strings.Join(arr, \" \")\n}\n\nfunc getEnvAfterScript(dir, script string) []string {\n\t// TODO: maybe use COMSPEC env variable instead of \"cmd.exe\" (more robust)\n\tcmd := exec.Command(\"cmd.exe\", \"/c\", script+\" & set\")\n\tcmd.Dir = dir\n\tfmt.Printf(\"Executing: %s in %s\\n\", cmd.Args, cmd.Dir)\n\tresBytes, err := cmd.Output()\n\tif err != nil {\n\t\tfatalf(\"failed with %s\\n\", err)\n\t}\n\tres := string(resBytes)\n\tparts := strings.Split(res, \"\\n\")\n\tif len(parts) == 1 {\n\t\tfatalf(\"split failed\\nres:\\n%s\\n\", res)\n\t}\n\tfor idx, env := range parts {\n\t\tparts[idx] = strings.TrimSpace(env)\n\t}\n\treturn parts\n}\n\nfunc getEnvValue(env []string, name string) (string, bool) {\n\tfor _, v := range env {\n\t\tparts := strings.SplitN(v, \"=\", 2)\n\t\tif len(parts) != 2 {\n\t\t\tcontinue\n\t\t}\n\t\tif strings.EqualFold(name, parts[0]) {\n\t\t\treturn parts[1], true\n\t\t}\n\t}\n\treturn \"\", false\n}\n\nfunc getOsEnvValue(name string) (string, bool) {\n\treturn getEnvValue(os.Environ(), name)\n}\n\nfunc getEnvForVSUncached() []string {\n\tval, ok := getOsEnvValue(\"VS140COMNTOOLS\")\n\tif !ok {\n\t\tfatalf(\"VS140COMNTOOLS not set; VS 2015 not installed?\\n\")\n\t}\n\treturn getEnvAfterScript(val, \"vsvars32.bat\")\n}\n\nvar (\n\tenvForVSCached []string\n)\n\nfunc getPaths(env []string) []string {\n\tpath, ok := getEnvValue(env, \"path\")\n\tfatalif(!ok, \"\")\n\tsep := string(os.PathListSeparator)\n\tparts := strings.Split(path, sep)\n\tfor i, s := range parts {\n\t\tparts[i] = strings.TrimSpace(s)\n\t}\n\treturn parts\n}\n\nfunc dumpEnv(env []string) {\n\tfor _, e := range env {\n\t\tfmt.Printf(\"%s\\n\", e)\n\t}\n\tpaths := getPaths(env)\n\tfmt.Printf(\"PATH:\\n  %s\\n\", strings.Join(paths, \"\\n  \"))\n}\n\nfunc getEnvForVS() []string {\n\tif envForVSCached == nil {\n\t\tenvForVSCached = getEnvForVSUncached()\n\t\t//dumpEnv(envForVSCached)\n\t}\n\treturn envForVSCached\n}\n\nfunc lookExeInEnvPathUncachedHelper(env []string, exeName string) string {\n\tvar found []string\n\tpaths := getPaths(env)\n\tfor _, dir := range paths {\n\t\tpath := filepath.Join(dir, exeName)\n\t\tif fileExists(path) {\n\t\t\tfound = append(found, path)\n\t\t}\n\t}\n\tif len(found) == 0 {\n\t\treturn \"\"\n\t}\n\tif len(found) == 1 {\n\t\treturn found[0]\n\t}\n\t// HACK: for msbuild.exe we might find 3 locations, prefer the one for\n\t// 2015 VS. If we pick up 2013 VS, it'll complain about v140_xp toolset\n\t// not being installed\n\tfor _, p := range found {\n\t\tif strings.Contains(p, \"14.0\") {\n\t\t\treturn p\n\t\t}\n\t}\n\treturn found[0]\n}\n\nfunc lookExeInEnvPathUncached(env []string, exeName string) string {\n\tvar err error\n\tfmt.Printf(\"lookExeInEnvPathUncached: exeName=%s\\n\", exeName)\n\tpath := lookExeInEnvPathUncachedHelper(env, exeName)\n\tif path == \"\" && filepath.Ext(exeName) == \"\" {\n\t\tpath = lookExeInEnvPathUncachedHelper(env, exeName+\".exe\")\n\t}\n\t//panic(fmt.Sprintf(\"didn't find %s in %s\\n\", exeName, getPaths(env)))\n\tif path == \"\" {\n\t\tpath, err = exec.LookPath(exeName)\n\t}\n\tfataliferr(err)\n\tfatalif(path == \"\", \"didn't find %s in %s\\n\", exeName, getPaths(env))\n\tfmt.Printf(\"found %v for %s\\n\", path, exeName)\n\treturn path\n}\n\nfunc lookExeInEnvPath(env []string, exeName string) string {\n\tvar exePath string\n\tvar err error\n\tif false {\n\t\texePath, err = exec.LookPath(exeName)\n\t\tif err != nil {\n\t\t\texePath = lookExeInEnvPathUncached(env, exeName)\n\t\t}\n\t} else {\n\t\texePath = lookExeInEnvPathUncached(env, exeName)\n\t}\n\treturn exePath\n}\n\nfunc getCmdInEnv(env []string, exeName string, args ...string) *exec.Cmd {\n\tif env == nil {\n\t\tenv = os.Environ()\n\t}\n\texePath := lookExeInEnvPath(env, exeName)\n\tcmd := exec.Command(exePath, args...)\n\tcmd.Env = env\n\tif true {\n\t\tfmt.Printf(\"Running %s\\n\", cmd.Args)\n\t}\n\treturn cmd\n}\n\nfunc getCmd(exeName string, args ...string) *exec.Cmd {\n\treturn getCmdInEnv(nil, exeName, args...)\n}\n\nfunc logCmdResult(cmd *exec.Cmd, out []byte, err error) {\n\tvar s string\n\tif err != nil {\n\t\ts = fmt.Sprintf(\"%s failed with %s, out:\\n%s\\n\\n\", cmdToStr(cmd), err, string(out))\n\t} else {\n\t\ts = fmt.Sprintf(\"%s\\n%s\\n\\n\", cmdToStr(cmd), string(out))\n\t}\n\tlogToFile(s)\n}\n\nfunc runCmd(cmd *exec.Cmd, showProgress bool) ([]byte, error) {\n\tcmdTimeStart := time.Now()\n\tif !showProgress {\n\t\tres, err := cmd.CombinedOutput()\n\t\tappendTiming(time.Since(cmdTimeStart), cmdToStr(cmd))\n\t\tlogCmdResult(cmd, res, err)\n\t\treturn res, err\n\t}\n\tvar resOut, resErr []byte\n\tstdout, _ := cmd.StdoutPipe()\n\tstderr, _ := cmd.StderrPipe()\n\tcmd.Start()\n\n\tgo func() {\n\t\tbuf := make([]byte, 1024, 1024)\n\t\tfor {\n\t\t\tn, err := stdout.Read(buf)\n\t\t\tif err != nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif n > 0 {\n\t\t\t\td := buf[:n]\n\t\t\t\tresOut = append(resOut, d...)\n\t\t\t\tos.Stdout.Write(d)\n\t\t\t}\n\t\t}\n\t}()\n\n\tgo func() {\n\t\tbuf := make([]byte, 1024, 1024)\n\t\tfor {\n\t\t\tn, err := stderr.Read(buf)\n\t\t\tif err != nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif n > 0 {\n\t\t\t\td := buf[:n]\n\t\t\t\tresErr = append(resErr, d...)\n\t\t\t\tos.Stderr.Write(d)\n\t\t\t}\n\t\t}\n\t}()\n\terr := cmd.Wait()\n\tappendTiming(time.Since(cmdTimeStart), cmdToStr(cmd))\n\tresOut = append(resOut, resErr...)\n\tlogCmdResult(cmd, resOut, err)\n\treturn resOut, err\n}\n\nfunc runCmdMust(cmd *exec.Cmd, showProgress bool) {\n\t_, err := runCmd(cmd, showProgress)\n\tfataliferr(err)\n}\n\nfunc runCmdLogged(cmd *exec.Cmd, showProgress bool) ([]byte, error) {\n\tout, err := runCmd(cmd, showProgress)\n\tif err != nil {\n\t\targs := []string{cmd.Path}\n\t\targs = append(args, cmd.Args...)\n\t\tfmt.Printf(\"%s failed with %s, out:\\n%s\\n\", args, err, string(out))\n\t\treturn out, err\n\t}\n\tfmt.Printf(\"%s\\n\", out)\n\treturn out, nil\n}\n\nfunc runExe(exeName string, args ...string) ([]byte, error) {\n\tcmd := getCmd(exeName, args...)\n\treturn runCmd(cmd, false)\n}\n\nfunc runExeInEnv(env []string, exeName string, args ...string) ([]byte, error) {\n\tcmd := getCmdInEnv(env, exeName, args...)\n\treturn runCmd(cmd, false)\n}\n\nfunc runExeMust(exeName string, args ...string) []byte {\n\tout, err := runExeInEnv(os.Environ(), exeName, args...)\n\tfataliferr(err)\n\treturn out\n}\n\nfunc runExeLogged(env []string, exeName string, args ...string) ([]byte, error) {\n\tout, err := runExeInEnv(env, exeName, args...)\n\tif err != nil {\n\t\tfmt.Printf(\"%s failed with %s, out:\\n%s\\n\", args, err, string(out))\n\t\treturn out, err\n\t}\n\tfmt.Printf(\"%s\\n\", out)\n\treturn out, nil\n}\n\nfunc runMsbuild(showProgress bool, args ...string) error {\n\tcmd := getCmdInEnv(getEnvForVS(), \"msbuild.exe\", args...)\n\t_, err := runCmdLogged(cmd, showProgress)\n\treturn err\n}\n\nfunc runMsbuildGetOutput(showProgress bool, args ...string) ([]byte, error) {\n\tcmd := getCmdInEnv(getEnvForVS(), \"msbuild.exe\", args...)\n\treturn runCmdLogged(cmd, showProgress)\n}\n\nfunc runDevenvGetOutput(showProgress bool, args ...string) ([]byte, error) {\n\tcmd := getCmdInEnv(getEnvForVS(), \"devenv.exe\", args...)\n\treturn runCmdLogged(cmd, showProgress)\n}\n"
  },
  {
    "path": "tools/build/main.go",
    "content": "package main\n\nimport (\n\t\"archive/zip\"\n\t\"encoding/json\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n)\n\n/*\nTo run:\n* install Go\n - download and run latest installer https://golang.org/doc/install\n - restart so that PATH changes take place\n - set GOPATH env variable (e.g. to %USERPROFILE%\\src\\go)\n - install goamz: go get github.com/goamz/goamz/s3\n* see scripts\\build-release.bat for how to run it\n*/\n\n/*\nTODO:\n* implement buildbot loop\n*/\n\n// Secrets defines secrets\ntype Secrets struct {\n\tAwsSecret               string\n\tAwsAccess               string\n\tCertPwd                 string\n\tNotifierEmail           string\n\tNotifierEmailPwd        string\n\tTranslationUploadSecret string\n}\n\nconst (\n\ts3PreRelDir  = \"sumatrapdf/prerel/\"\n\ts3RelDir     = \"sumatrapdf/rel/\"\n\tmaxS3Results = 1000\n)\n\nvar (\n\tflgRelease       bool // if doing an official release build\n\tflgPreRelease    bool // if doing pre-release build\n\tflgUpload        bool\n\tflgSmoke         bool\n\tflgListS3        bool\n\tflgAnalyze       bool\n\tflgNoCleanCheck  bool\n\tsvnPreReleaseVer string\n\tgitSha1          string\n\tsumatraVersion   string\n\ttimeStart        time.Time\n\tcachedSecrets    *Secrets\n)\n\nfunc parseCmdLine() {\n\tflag.BoolVar(&flgListS3, \"list-s3\", false, \"list files in s3\")\n\tflag.BoolVar(&flgSmoke, \"smoke\", false, \"do a smoke (sanity) build\")\n\tflag.BoolVar(&flgRelease, \"release\", false, \"do a release build\")\n\tflag.BoolVar(&flgPreRelease, \"prerelease\", false, \"do a pre-release build\")\n\tflag.BoolVar(&flgAnalyze, \"analyze\", false, \"run analyze (prefast) and create summary of bugs as html file\")\n\tflag.BoolVar(&flgUpload, \"upload\", false, \"upload to s3 for release/prerelease builds\")\n\t// -no-clean-check is useful when testing changes to this build script\n\tflag.BoolVar(&flgNoCleanCheck, \"no-clean-check\", false, \"allow running if repo has changes (for testing build script)\")\n\tflag.Parse()\n\t// must provide an action to perform\n\tif flgListS3 || flgSmoke || flgRelease || flgPreRelease || flgAnalyze {\n\t\treturn\n\t}\n\tflag.Usage()\n\tos.Exit(1)\n}\n\nfunc finalizeThings(crashed bool) {\n\trevertBuildConfig()\n\tif !crashed {\n\t\tprintTimings()\n\t\tfmt.Printf(\"total time: %s\\n\", time.Since(timeStart))\n\t\tlogToFile(fmt.Sprintf(\"total time: %s\\n\", time.Since(timeStart)))\n\t}\n\tcloseLogFile()\n}\n\nfunc readSecretsMust() *Secrets {\n\tif cachedSecrets != nil {\n\t\treturn cachedSecrets\n\t}\n\tpath := pj(\"scripts\", \"secrets.json\")\n\td, err := ioutil.ReadFile(path)\n\tfatalif(err != nil, \"readSecretsMust(): error %s reading file '%s'\\n\", err, path)\n\tvar s Secrets\n\terr = json.Unmarshal(d, &s)\n\tfatalif(err != nil, \"readSecretsMust(): failed to json-decode file '%s'. err: %s, data:\\n%s\\n\", path, err, string(d))\n\tcachedSecrets = &s\n\treturn cachedSecrets\n}\n\nfunc revertBuildConfig() {\n\trunExe(\"git\", \"checkout\", buildConfigPath())\n}\n\nfunc extractSumatraVersionMust() string {\n\tpath := pj(\"src\", \"Version.h\")\n\td, err := ioutil.ReadFile(path)\n\tfataliferr(err)\n\tlines := toTrimmedLines(d)\n\ts := \"#define CURR_VERSION \"\n\tfor _, l := range lines {\n\t\tif strings.HasPrefix(l, s) {\n\t\t\tver := l[len(s):]\n\t\t\tverifyCorrectVersionMust(ver)\n\t\t\treturn ver\n\t\t}\n\t}\n\tfatalf(\"couldn't extract CURR_VERSION from %s\\n\", path)\n\treturn \"\"\n}\n\nfunc getGitLinearVersionMust() int {\n\tout, err := runExe(\"git\", \"log\", \"--oneline\")\n\tfataliferr(err)\n\tlines := toTrimmedLines(out)\n\t// we add 1000 to create a version that is larger than the svn version\n\t// from the time we used svn\n\tn := len(lines) + 1000\n\tfatalif(n < 10000, \"getGitLinearVersion: n is %d (should be > 10000)\", n)\n\treturn n\n}\n\nfunc verifyGitCleanMust() {\n\tif flgNoCleanCheck {\n\t\treturn\n\t}\n\tfatalif(!isGitClean(), \"git has unsaved changes\\n\")\n}\n\nfunc verifyStartedInRightDirectoryMust() {\n\tpath := buildConfigPath()\n\tfatalif(!fileExists(path), \"started in wrong directory (%s doesn't exist)\\n\", path)\n}\n\nfunc buildConfigPath() string {\n\treturn pj(\"src\", \"utils\", \"BuildConfig.h\")\n}\n\nfunc certPath() string {\n\treturn pj(\"scripts\", \"cert.pfx\")\n}\n\nfunc setBuildConfig(sha1, preRelVer string) {\n\tfatalif(sha1 == \"\", \"sha1 must be set\")\n\ts := fmt.Sprintf(\"#define GIT_COMMIT_ID %s\\n\", sha1)\n\tif preRelVer != \"\" {\n\t\ts += fmt.Sprintf(\"#define SVN_PRE_RELEASE_VER %s\\n\", preRelVer)\n\t}\n\terr := ioutil.WriteFile(buildConfigPath(), []byte(s), 644)\n\tfataliferr(err)\n}\n\n// we shouldn't re-upload files. We upload manifest-${ver}.txt last, so we\n// consider a pre-release build already present in s3 if manifest file exists\nfunc verifyPreReleaseNotInS3Must(ver string) {\n\tif !flgUpload {\n\t\treturn\n\t}\n\ts3Path := s3PreRelDir + fmt.Sprintf(\"SumatraPDF-prerelease-%s-manifest.txt\", ver)\n\tfatalif(s3Exists(s3Path), \"build %d already exists in s3 because '%s' exists\\n\", ver, s3Path)\n}\n\nfunc verifyReleaseNotInS3Must(ver string) {\n\tif !flgUpload {\n\t\treturn\n\t}\n\ts3Path := s3RelDir + fmt.Sprintf(\"SumatraPDF-%s-manifest.txt\", ver)\n\tfatalif(s3Exists(s3Path), \"build '%s' already exists in s3 because '%s' existst\\n\", ver, s3Path)\n}\n\n// check we have cert for signing and s3 creds for file uploads\nfunc verifyHasReleaseSecretsMust() {\n\tp := certPath()\n\tfatalif(!fileExists(p), \"verifyHasPreReleaseSecretsMust(): certificate file '%s' doesn't exist\\n\", p)\n\tsecrets := readSecretsMust()\n\tfatalif(secrets.CertPwd == \"\", \"CertPwd missing in %s\\n\", p)\n\n\tif flgUpload {\n\t\ts3SetSecrets(secrets.AwsAccess, secrets.AwsSecret)\n\t}\n}\n\nfunc runTestUtilMust(dir string) {\n\ttimeStart := time.Now()\n\tcmd := exec.Command(\".\\\\test_util.exe\")\n\tcmd.Dir = \"rel\"\n\tout, err := cmd.CombinedOutput()\n\tlogCmdResult(cmd, out, err)\n\tfataliferr(err)\n\tappendTiming(time.Since(timeStart), cmdToStr(cmd))\n}\n\nvar (\n\tpdbFiles = []string{\"libmupdf.pdb\", \"Installer.pdb\",\n\t\t\"SumatraPDF-no-MuPDF.pdb\", \"SumatraPDF.pdb\"}\n)\n\nfunc addZipFileMust(w *zip.Writer, path string) {\n\tfi, err := os.Stat(path)\n\tfataliferr(err)\n\tfih, err := zip.FileInfoHeader(fi)\n\tfataliferr(err)\n\tfih.Name = filepath.Base(path)\n\tfih.Method = zip.Deflate\n\td, err := ioutil.ReadFile(path)\n\tfataliferr(err)\n\tfw, err := w.CreateHeader(fih)\n\tfataliferr(err)\n\t_, err = fw.Write(d)\n\tfataliferr(err)\n\t// fw is just a io.Writer so we can't Close() it. It's not necessary as\n\t// it's implicitly closed by the next Create(), CreateHeader()\n\t// or Close() call on zip.Writer\n}\n\nfunc createExeZipWithGoMust(dir string) {\n\tpath := pj(dir, \"SumatraPDF.zip\")\n\tf, err := os.Create(path)\n\tfataliferr(err)\n\tdefer f.Close()\n\tzw := zip.NewWriter(f)\n\taddZipFileMust(zw, pj(dir, \"SumatraPDF.exe\"))\n\terr = zw.Close()\n\tfataliferr(err)\n}\n\nfunc createExeZipWithPigz(dir string) {\n\tsrcFile := \"SumatraPDF.exe\"\n\tsrcPath := filepath.Join(dir, srcFile)\n\tfatalif(!fileExists(srcPath), \"file '%s' doesn't exist\\n\", srcPath)\n\n\t// this is the file that pigz.exe will create\n\tdstFileTmp := \"SumatraPDF.exe.zip\"\n\tdstPathTmp := filepath.Join(dir, dstFileTmp)\n\tremoveFileMust(dstPathTmp)\n\n\t// this is the file we want at the end\n\tdstFile := \"SumatraPDF.zip\"\n\tdstPath := filepath.Join(dir, dstFile)\n\tremoveFileMust(dstPath)\n\n\twd, err := os.Getwd()\n\tfataliferr(err)\n\tpigzExePath := filepath.Join(wd, \"bin\", \"pigz.exe\")\n\tfatalif(!fileExists(pigzExePath), \"file '%s' doesn't exist\\n\", pigzExePath)\n\tcmd := exec.Command(pigzExePath, \"-11\", \"--keep\", \"--zip\", srcFile)\n\t// in pigz we don't control the name of the file created inside so\n\t// so when we run pigz the current directory is the same as\n\t// the directory with the file we're compressing\n\tcmd.Dir = dir\n\tfmt.Printf(\"Running %s\\n\", cmd.Args)\n\t_, err = runCmd(cmd, true)\n\tfataliferr(err)\n\n\tfatalif(!fileExists(dstPathTmp), \"file '%s' doesn't exist\\n\", dstPathTmp)\n\terr = os.Rename(dstPathTmp, dstPath)\n\tfataliferr(err)\n}\n\n// createExeZipWithGoMust() is faster, createExeZipWithPigz() generates slightly\n// smaller files\nfunc createExeZipMust(dir string) {\n\t//createExeZipWithGoMust(dir)\n\tcreateExeZipWithPigz(dir)\n}\n\nfunc createPdbZipMust(dir string) {\n\tpath := pj(dir, \"SumatraPDF.pdb.zip\")\n\tf, err := os.Create(path)\n\tfataliferr(err)\n\tdefer f.Close()\n\tw := zip.NewWriter(f)\n\n\tfor _, file := range pdbFiles {\n\t\taddZipFileMust(w, pj(dir, file))\n\t}\n\n\terr = w.Close()\n\tfataliferr(err)\n}\n\nfunc createPdbLzsaMust(dir string) {\n\targs := []string{\"SumatraPDF.pdb.lzsa\"}\n\targs = append(args, pdbFiles...)\n\t// refer to rel\\MakeLZSA.exe using absolute path so that we always\n\t// use 32-bit version and to avoid issues with running it in different\n\t// directories when name is relative\n\tcurDir, err := os.Getwd()\n\tfataliferr(err)\n\tmakeLzsaPath := pj(curDir, \"rel\", \"MakeLZSA.exe\")\n\tcmd := getCmd(makeLzsaPath, args...)\n\tcmd.Dir = dir\n\t_, err = runCmdLogged(cmd, true)\n\tfataliferr(err)\n}\n\nfunc buildPreRelease() {\n\tvar err error\n\n\tfmt.Printf(\"Building pre-release version %s\\n\", svnPreReleaseVer)\n\tverifyGitCleanMust()\n\tverifyOnMasterBranchMust()\n\tverifyPreReleaseNotInS3Must(svnPreReleaseVer)\n\n\tverifyTranslationsMust()\n\n\tdownloadPigzMust()\n\n\tsetBuildConfig(gitSha1, svnPreReleaseVer)\n\terr = runMsbuild(true, \"vs2015\\\\SumatraPDF.sln\", \"/t:SumatraPDF;SumatraPDF-no-MUPDF;PdfFilter;PdfPreview;Uninstaller;test_util\", \"/p:Configuration=Release;Platform=Win32\", \"/m\")\n\tfataliferr(err)\n\trunTestUtilMust(\"rel\")\n\tsignMust(pj(\"rel\", \"SumatraPDF.exe\"))\n\tsignMust(pj(\"rel\", \"libmupdf.dll\"))\n\tsignMust(pj(\"rel\", \"PdfFilter.dll\"))\n\tsignMust(pj(\"rel\", \"PdfPreview.dll\"))\n\tsignMust(pj(\"rel\", \"SumatraPDF-no-MUPDF.exe\"))\n\tsignMust(pj(\"rel\", \"Uninstaller.exe\"))\n\terr = runMsbuild(true, \"vs2015\\\\SumatraPDF.sln\", \"/t:Installer\", \"/p:Configuration=Release;Platform=Win32\", \"/m\")\n\tfataliferr(err)\n\tsignMust(pj(\"rel\", \"Installer.exe\"))\n\n\terr = runMsbuild(true, \"vs2015\\\\SumatraPDF.sln\", \"/t:SumatraPDF;SumatraPDF-no-MUPDF;PdfFilter;PdfPreview;Uninstaller;test_util\", \"/p:Configuration=Release;Platform=x64\", \"/m\")\n\tfataliferr(err)\n\n\tif isOS64Bit() {\n\t\trunTestUtilMust(\"rel64\")\n\t}\n\tsignMust(pj(\"rel64\", \"SumatraPDF.exe\"))\n\tsignMust(pj(\"rel64\", \"libmupdf.dll\"))\n\tsignMust(pj(\"rel\", \"PdfFilter.dll\"))\n\tsignMust(pj(\"rel\", \"PdfPreview.dll\"))\n\tsignMust(pj(\"rel64\", \"SumatraPDF-no-MUPDF.exe\"))\n\tsignMust(pj(\"rel64\", \"Uninstaller.exe\"))\n\terr = runMsbuild(true, \"vs2015\\\\SumatraPDF.sln\", \"/t:Installer\", \"/p:Configuration=Release;Platform=x64\", \"/m\")\n\tfataliferr(err)\n\tsignMust(pj(\"rel64\", \"Installer.exe\"))\n\n\tcreatePdbZipMust(\"rel\")\n\tcreatePdbZipMust(\"rel64\")\n\n\tcreatePdbLzsaMust(\"rel\")\n\tcreatePdbLzsaMust(\"rel64\")\n\n\tcreateManifestMust()\n\ts3UploadPreReleaseMust(svnPreReleaseVer)\n}\n\n// TOOD: alternatively, just puts pigz.exe in the repo\nfunc downloadPigzMust() {\n\turi := \"https://kjkpub.s3.amazonaws.com/software/pigz/2.3.1-149/pigz.exe\"\n\tpath := pj(\"bin\", \"pigz.exe\")\n\tsha1 := \"10a2d3e3cafbad083972d6498fee4dc7df603c04\"\n\thttpDlToFileMust(uri, path, sha1)\n}\n\nfunc buildRelease() {\n\tvar err error\n\n\tfmt.Printf(\"Building release version %s\\n\", sumatraVersion)\n\tverifyGitCleanMust()\n\tverifyOnReleaseBranchMust()\n\tverifyReleaseNotInS3Must(sumatraVersion)\n\n\tverifyTranslationsMust()\n\n\tdownloadPigzMust()\n\n\tsetBuildConfig(gitSha1, \"\")\n\terr = runMsbuild(true, \"vs2015\\\\SumatraPDF.sln\", \"/t:SumatraPDF;SumatraPDF-no-MUPDF;Uninstaller;test_util\", \"/p:Configuration=Release;Platform=Win32\", \"/m\")\n\tfataliferr(err)\n\trunTestUtilMust(\"rel\")\n\tsignMust(pj(\"rel\", \"SumatraPDF.exe\"))\n\tsignMust(pj(\"rel\", \"SumatraPDF-no-MUPDF.exe\"))\n\tsignMust(pj(\"rel\", \"Uninstaller.exe\"))\n\terr = runMsbuild(true, \"vs2015\\\\SumatraPDF.sln\", \"/t:Installer\", \"/p:Configuration=Release;Platform=Win32\", \"/m\")\n\tfataliferr(err)\n\tsignMust(pj(\"rel\", \"Installer.exe\"))\n\n\terr = runMsbuild(true, \"vs2015\\\\SumatraPDF.sln\", \"/t:SumatraPDF;SumatraPDF-no-MUPDF;Uninstaller;test_util\", \"/p:Configuration=Release;Platform=x64\", \"/m\")\n\tfataliferr(err)\n\n\tif isOS64Bit() {\n\t\trunTestUtilMust(\"rel64\")\n\t}\n\tsignMust(pj(\"rel64\", \"SumatraPDF.exe\"))\n\tsignMust(pj(\"rel64\", \"SumatraPDF-no-MUPDF.exe\"))\n\tsignMust(pj(\"rel64\", \"Uninstaller.exe\"))\n\terr = runMsbuild(true, \"vs2015\\\\SumatraPDF.sln\", \"/t:Installer\", \"/p:Configuration=Release;Platform=x64\", \"/m\")\n\tfataliferr(err)\n\tsignMust(pj(\"rel64\", \"Installer.exe\"))\n\n\tcreateExeZipMust(\"rel\")\n\tcreateExeZipMust(\"rel64\")\n\n\tcreatePdbZipMust(\"rel\")\n\tcreatePdbZipMust(\"rel64\")\n\n\tcreatePdbLzsaMust(\"rel\")\n\tcreatePdbLzsaMust(\"rel64\")\n\n\tcreateManifestMust()\n\ts3UploadReleaseMust(sumatraVersion)\n}\n\nfunc buildAnalyze() {\n\tfmt.Printf(\"Analyze build\\n\")\n\t// I assume 64-bit build will catch more issues\n\tout, _ := runMsbuildGetOutput(true, \"vs2015\\\\SumatraPDF.sln\", \"/t:Installer\", \"/p:Configuration=ReleasePrefast;Platform=x64\", \"/m\")\n\n\tif true {\n\t\terr2 := ioutil.WriteFile(\"analyze-output.txt\", out, 0644)\n\t\tfataliferr(err2)\n\t}\n\t//fataliferr(err)\n\n\tparseAnalyzeOutput(out)\n}\n\nfunc buildSmoke() {\n\tfmt.Printf(\"Smoke build\\n\")\n\tverifyTranslationsMust()\n\n\terr := runMsbuild(true, \"vs2015\\\\SumatraPDF.sln\", \"/t:Installer;SumatraPDF;Uninstaller;test_util\", \"/p:Configuration=Release;Platform=Win32\", \"/m\")\n\tfataliferr(err)\n\tpath := pj(\"rel\", \"test_util.exe\")\n\trunExeMust(path)\n\terr = runMsbuild(true, \"vs2015\\\\SumatraPDF.sln\", \"/t:Installer;SumatraPDF;Uninstaller;test_util\", \"/p:Configuration=Release;Platform=x64\", \"/m\")\n\tfataliferr(err)\n\terr = runMsbuild(true, \"vs2015\\\\SumatraPDF.sln\", \"/t:Installer;SumatraPDF;Uninstaller;test_util\", \"/p:Configuration=Debug;Platform=x64\", \"/m\")\n\tfataliferr(err)\n}\n\nfunc manifestPath() string {\n\treturn filepath.Join(\"rel\", \"manifest.txt\")\n}\n\n// manifest is build for pre-release builds and contains build stats\nfunc createManifestMust() {\n\tvar lines []string\n\tfiles := []string{\n\t\t\"SumatraPDF.exe\",\n\t\t\"SumatraPDF-no-MUPDF.exe\",\n\t\t\"Installer.exe\",\n\t\t\"libmupdf.dll\",\n\t\t\"PdfFilter.dll\",\n\t\t\"PdfPreview.dll\",\n\t\t\"Uninstaller.exe\",\n\t\t\"SumatraPDF.pdb.zip\",\n\t\t\"SumatraPDF.pdb.lzsa\",\n\t}\n\tdirs := []string{\"rel\", \"rel64\"}\n\tfor _, dir := range dirs {\n\t\tfor _, file := range files {\n\t\t\tpath := filepath.Join(dir, file)\n\t\t\tsize := fileSizeMust(path)\n\t\t\tline := fmt.Sprintf(\"%s: %d\", path, size)\n\t\t\tlines = append(lines, line)\n\t\t}\n\t}\n\ts := strings.Join(lines, \"\\n\")\n\terr := ioutil.WriteFile(manifestPath(), []byte(s), 0644)\n\tfataliferr(err)\n}\n\n// http://zabkat.com/blog/code-signing-sha1-armageddon.htm\n// signtool sign /n \"subject name\" /t http://timestamp.comodoca.com/authenticode myInstaller.exe\n// signtool sign /n \"subject name\" /fd sha256 /tr http://timestamp.comodoca.com/rfc3161 /td sha256 /as myInstaller.exe\n// signtool args (https://msdn.microsoft.com/en-us/library/windows/desktop/aa387764(v=vs.85).aspx):\n//   /as          : append signature\n//   /fd ${alg}   : specify digest algo, default is sha1\n//   /t ${url}    : timestamp server\n//   /tr ${url}   : timestamp rfc 3161 server\n//   /td ${alg}   : for /tr, must be after /tr\n//   /du ${url}   : URL for expanded description of the signed content.\nfunc signMust(path string) {\n\t// the sign tool is finicky, so copy the cert to the same dir as\n\t// the exe we're signing\n\tfileDir := filepath.Dir(path)\n\tfileName := filepath.Base(path)\n\tsecrets := readSecretsMust()\n\tcertPwd := secrets.CertPwd\n\tcertSrc := certPath()\n\tcertDest := pj(fileDir, \"cert.pfx\")\n\tif !fileExists(certDest) {\n\t\tfileCopyMust(certDest, certSrc)\n\t}\n\t// sign with sha1 for pre-win-7\n\tcmd := getCmdInEnv(getEnvForVS(), \"signtool.exe\", \"sign\", \"/t\", \"http://timestamp.verisign.com/scripts/timstamp.dll\",\n\t\t\"/du\", \"http://www.sumatrapdfreader.org\", \"/f\", \"cert.pfx\",\n\t\t\"/p\", certPwd, fileName)\n\tcmd.Dir = fileDir\n\t_, err := runCmdLogged(cmd, true)\n\tfataliferr(err)\n\n\t// double-sign with sha2 for win7+ ater Jan 2016\n\tcmd = getCmdInEnv(getEnvForVS(), \"signtool.exe\", \"sign\", \"/fd\", \"sha256\", \"/tr\", \"http://timestamp.comodoca.com/rfc3161\",\n\t\t\"/td\", \"sha256\", \"/du\", \"http://www.sumatrapdfreader.org\", \"/f\", \"cert.pfx\",\n\t\t\"/p\", certPwd, \"/as\", fileName)\n\tcmd.Dir = fileDir\n\t_, err = runCmdLogged(cmd, true)\n\tfataliferr(err)\n}\n\n// sumatrapdf/sumatralatest.js\n/*\nvar sumLatestVer = 10175;\nvar sumBuiltOn = \"2015-07-23\";\nvar sumLatestName = \"SumatraPDF-prerelease-10175.exe\";\nvar sumLatestExe = \"https://kjkpub.s3.amazonaws.com/sumatrapdf/prerel/SumatraPDF-prerelease-10175.exe\";\nvar sumLatestPdb = \"https://kjkpub.s3.amazonaws.com/sumatrapdf/prerel/SumatraPDF-prerelease-10175.pdb.zip\";\nvar sumLatestInstaller = \"https://kjkpub.s3.amazonaws.com/sumatrapdf/prerel/SumatraPDF-prerelease-10175-install.exe\";\n*/\nfunc createSumatraLatestJs() string {\n\tcurrDate := time.Now().Format(\"2006-01-02\")\n\tv := svnPreReleaseVer\n\treturn fmt.Sprintf(`\n\t\tvar sumLatestVer = %s;\n\t\tvar sumBuiltOn = \"%s\";\n\t\tvar sumLatestName = \"SumatraPDF-prerelease-%s.exe\";\n\n\t\tvar sumLatestExe = \"https://kjkpub.s3.amazonaws.com/sumatrapdf/prerel/SumatraPDF-prerelease-%s.exe\";\n\t\tvar sumLatestPdb = \"https://kjkpub.s3.amazonaws.com/sumatrapdf/prerel/SumatraPDF-prerelease-%s.pdb.zip\";\n\t\tvar sumLatestInstaller = \"https://kjkpub.s3.amazonaws.com/sumatrapdf/prerel/SumatraPDF-prerelease-%s-install.exe\";\n\n\t\tvar sumLatestExe64 = \"https://kjkpub.s3.amazonaws.com/sumatrapdf/prerel/SumatraPDF-prerelease-%s-64.exe\";\n\t\tvar sumLatestPdb64 = \"https://kjkpub.s3.amazonaws.com/sumatrapdf/prerel/SumatraPDF-prerelease-%s-64.pdb.zip\";\n\t\tvar sumLatestInstaller64 = \"https://kjkpub.s3.amazonaws.com/sumatrapdf/prerel/SumatraPDF-prerelease-%s-64-install.exe\";\n`, v, currDate, v, v, v, v, v, v, v)\n}\n\n// FilesForVer describes pre-release files in s3 for a given version\ntype FilesForVer struct {\n\tVersion    int      // pre-release version as int\n\tVersionStr string   // pre-release version as string\n\tNames      []string // relative to sumatrapdf/prerel/\n\tPaths      []string // full key path in S3\n}\n\n/*\nRecognize the following files:\nSumatraPDF-prerelease-10169-install.exe\nSumatraPDF-prerelease-10169.exe\nSumatraPDF-prerelease-10169.pdb.lzsa\nSumatraPDF-prerelease-10169.pdb.zip\nSumatraPDF-prerelease-10169-install-64.exe\nSumatraPDF-prerelease-10169-64.exe\nSumatraPDF-prerelease-10169.pdb-64.lzsa\nSumatraPDF-prerelease-10169.pdb-64.zip\nmanifest-10169.txt\n*/\n\nvar (\n\tpreRelNameRegexps []*regexp.Regexp\n\tregexps           = []string{\n\t\t`SumatraPDF-prerelease-(\\d+)-install-64.exe`,\n\t\t`SumatraPDF-prerelease-(\\d+)-64.exe`,\n\t\t`SumatraPDF-prerelease-(\\d+).pdb-64.lzsa`,\n\t\t`SumatraPDF-prerelease-(\\d+).pdb-64.zip`,\n\n\t\t`SumatraPDF-prerelease-(\\d+)-install.exe`,\n\t\t`SumatraPDF-prerelease-(\\d+).exe`,\n\t\t`SumatraPDF-prerelease-(\\d+).pdb.lzsa`,\n\t\t`SumatraPDF-prerelease-(\\d+).pdb.zip`,\n\n\t\t`manifest-(\\d+).txt`,\n\t}\n)\n\nfunc compilePreRelNameRegexpsMust() {\n\tfatalif(preRelNameRegexps != nil, \"preRelNameRegexps != nil\")\n\tfor _, s := range regexps {\n\t\tr := regexp.MustCompile(s)\n\t\tpreRelNameRegexps = append(preRelNameRegexps, r)\n\t}\n}\n\nfunc preRelFileVer(name string) string {\n\tfor _, r := range preRelNameRegexps {\n\t\tres := r.FindStringSubmatch(name)\n\t\tif len(res) == 2 {\n\t\t\treturn res[1]\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc addToFilesForVer(path, name, verStr string, files []*FilesForVer) []*FilesForVer {\n\tver, err := strconv.Atoi(verStr)\n\tfataliferr(err)\n\tfor _, fi := range files {\n\t\tif fi.Version == ver {\n\t\t\tfi.Names = append(fi.Names, name)\n\t\t\tfi.Paths = append(fi.Paths, path)\n\t\t\treturn files\n\t\t}\n\t}\n\n\tfi := FilesForVer{\n\t\tVersion:    ver,\n\t\tVersionStr: verStr,\n\t\tNames:      []string{name},\n\t\tPaths:      []string{path},\n\t}\n\treturn append(files, &fi)\n}\n\n// ByVerFilesForVer sorts by version\ntype ByVerFilesForVer []*FilesForVer\n\nfunc (s ByVerFilesForVer) Len() int {\n\treturn len(s)\n}\nfunc (s ByVerFilesForVer) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\nfunc (s ByVerFilesForVer) Less(i, j int) bool {\n\treturn s[i].Version > s[j].Version\n}\n\n// list is sorted by Version, biggest first, to make it easy to delete oldest\nfunc s3ListPreReleaseFilesMust(dbg bool) []*FilesForVer {\n\tfatalif(preRelNameRegexps == nil, \"preRelNameRegexps == nil\")\n\tvar res []*FilesForVer\n\tbucket := s3GetBucket()\n\tresp, err := bucket.List(s3PreRelDir, \"\", \"\", maxS3Results)\n\tfataliferr(err)\n\tfatalif(resp.IsTruncated, \"truncated response! implement reading all the files\\n\")\n\tif dbg {\n\t\tfmt.Printf(\"%d files\\n\", len(resp.Contents))\n\t}\n\tvar unrecognizedFiles []string\n\tfor _, key := range resp.Contents {\n\t\tpath := key.Key\n\t\tname := path[len(s3PreRelDir):]\n\t\tverStr := preRelFileVer(name)\n\t\tif dbg {\n\t\t\tfmt.Printf(\"path: '%s', name: '%s', ver: '%s', \\n\", path, name, verStr)\n\t\t}\n\t\tif verStr == \"\" {\n\t\t\tunrecognizedFiles = append(unrecognizedFiles, path)\n\t\t} else {\n\t\t\tres = addToFilesForVer(path, name, verStr, res)\n\t\t}\n\t}\n\tsort.Sort(ByVerFilesForVer(res))\n\tfor _, s := range unrecognizedFiles {\n\t\tfmt.Printf(\"Unrecognized pre-relase file in s3: '%s'\\n\", s)\n\t}\n\n\tif true || dbg {\n\t\tfor _, fi := range res {\n\t\t\tfmt.Printf(\"Ver: %s (%d)\\n\", fi.VersionStr, fi.Version)\n\t\t\tfmt.Printf(\"  names: %s\\n\", fi.Names)\n\t\t\tfmt.Printf(\"  paths: %s\\n\", fi.Paths)\n\t\t}\n\t}\n\treturn res\n}\n\nfunc s3DeleteOldestPreRel() {\n\tif !flgUpload {\n\t\treturn\n\t}\n\tmaxToRetain := 10\n\tfiles := s3ListPreReleaseFilesMust(false)\n\tif len(files) < maxToRetain {\n\t\treturn\n\t}\n\ttoDelete := files[maxToRetain:]\n\tfor _, fi := range toDelete {\n\t\tfor _, s3Path := range fi.Paths {\n\t\t\t// don't delete manifest files\n\t\t\tif strings.Contains(s3Path, \"manifest-\") {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\terr := s3Delete(s3Path)\n\t\t\tif err != nil {\n\t\t\t\t// it's ok if fails, we'll try again next time\n\t\t\t\tfmt.Printf(\"Failed to delete '%s' in s3\\n\", s3Path)\n\t\t\t}\n\t\t}\n\t}\n}\n\n// upload as:\n// https://kjkpub.s3.amazonaws.com/sumatrapdf/prerel/SumatraPDF-prerelease-1027-install.exe etc.\nfunc s3UploadPreReleaseMust(ver string) {\n\tif !flgUpload {\n\t\tfmt.Printf(\"Skipping pre-release upload to s3 because -upload flag not given\\n\")\n\t\treturn\n\t}\n\n\ts3DeleteOldestPreRel()\n\n\tprefix := fmt.Sprintf(\"SumatraPDF-prerelease-%s\", ver)\n\tmanifestRemotePath := s3PreRelDir + prefix + \"-manifest.txt\"\n\tfiles := []string{\n\t\t\"SumatraPDF.exe\", fmt.Sprintf(\"%s.exe\", prefix),\n\t\t\"Installer.exe\", fmt.Sprintf(\"%s-install.exe\", prefix),\n\t\t\"SumatraPDF.pdb.zip\", fmt.Sprintf(\"%s.pdb.zip\", prefix),\n\t\t\"SumatraPDF.pdb.lzsa\", fmt.Sprintf(\"%s.pdb.lzsa\", prefix),\n\t}\n\terr := s3UploadFiles(s3PreRelDir, \"rel\", files)\n\tfataliferr(err)\n\n\tprefix = fmt.Sprintf(\"SumatraPDF-prerelease-%s-64\", ver)\n\tfiles = []string{\n\t\t\"SumatraPDF.exe\", fmt.Sprintf(\"%s.exe\", prefix),\n\t\t\"Installer.exe\", fmt.Sprintf(\"%s-install.exe\", prefix),\n\t\t\"SumatraPDF.pdb.zip\", fmt.Sprintf(\"%s.pdb.zip\", prefix),\n\t\t\"SumatraPDF.pdb.lzsa\", fmt.Sprintf(\"%s.pdb.lzsa\", prefix),\n\t}\n\terr = s3UploadFiles(s3PreRelDir, \"rel64\", files)\n\tfataliferr(err)\n\n\tmanifestLocalPath := pj(\"rel\", \"manifest.txt\")\n\terr = s3UploadFileReader(manifestRemotePath, manifestLocalPath, true)\n\tfataliferr(err)\n\n\ts := createSumatraLatestJs()\n\terr = s3UploadString(\"sumatrapdf/sumatralatest.js\", s, true)\n\tfataliferr(err)\n\n\t//sumatrapdf/sumpdf-prerelease-latest.txt\n\terr = s3UploadString(\"sumatrapdf/sumpdf-prerelease-latest.txt\", ver, true)\n\tfataliferr(err)\n\n\t//sumatrapdf/sumpdf-prerelease-update.txt\n\t//don't set a Stable version for pre-release builds\n\ts = fmt.Sprintf(\"[SumatraPDF]\\nLatest %s\\n\", ver)\n\terr = s3UploadString(\"sumatrapdf/sumpdf-prerelease-update.txt\", s, true)\n\tfataliferr(err)\n}\n\n/*\nGiven result of git btranch that looks like:\n\nmaster\n* rel3.1working\n\nReturn active branch marked with \"*\" ('rel3.1working' in this case) or empty\nstring if no current branch.\n*/\nfunc getCurrentBranch(d []byte) string {\n\tlines := toTrimmedLines(d)\n\tfor _, l := range lines {\n\t\tif strings.HasPrefix(l, \"* \") {\n\t\t\treturn l[2:]\n\t\t}\n\t}\n\treturn \"\"\n}\n\n// When doing a release build, it must be from from a branch rel${ver}working\n// e.g. rel3.1working, where ${ver} must match first 2 digits in sumatraVersion\n// i.e. we allow 3.1.1 and 3.1.2 from branch 3.1 but not from 3.0 or 3.2\nfunc verifyOnReleaseBranchMust() {\n\t// 'git branch' return branch name in format: '* master'\n\tout := runExeMust(\"git\", \"branch\")\n\tcurrBranch := getCurrentBranch(out)\n\tpref := \"rel\"\n\tsuff := \"working\"\n\tfatalif(!strings.HasPrefix(currBranch, pref), \"running on branch '%s' which is not 'rel${ver}working' branch\\n\", currBranch)\n\tfatalif(!strings.HasSuffix(currBranch, suff), \"running on branch '%s' which is not 'rel${ver}working' branch\\n\", currBranch)\n\n\tver := currBranch[len(pref):]\n\tver = ver[:len(ver)-len(suff)]\n\n\tfatalif(!strings.HasPrefix(sumatraVersion, ver), \"version mismatch, sumatra: '%s', branch: '%s'\\n\", sumatraVersion, ver)\n}\n\nfunc verifyOnMasterBranchMust() {\n\t// 'git branch' return branch name in format: '* master'\n\tout := runExeMust(\"git\", \"branch\")\n\tcurrBranch := getCurrentBranch(out)\n\tfatalif(currBranch != \"master\", \"no on master branch (branch: '%s')\\n\", currBranch)\n}\n\n// upload as:\n// https://kjkpub.s3.amazonaws.com/sumatrapdf/rel/SumatraPDF-3.1-install.exe etc.\nfunc s3UploadReleaseMust(ver string) {\n\tif !flgUpload {\n\t\tfmt.Printf(\"Skipping release upload to s3 because -upload flag not given\\n\")\n\t\treturn\n\t}\n\n\tprefix := fmt.Sprintf(\"SumatraPDF-%s\", ver)\n\tmanifestRemotePath := s3RelDir + prefix + \"-manifest.txt\"\n\tfiles := []string{\n\t\t\"SumatraPDF.exe\", fmt.Sprintf(\"%s.exe\", prefix),\n\t\t\"SumatraPDF.zip\", fmt.Sprintf(\"%s.zip\", prefix),\n\t\t\"Installer.exe\", fmt.Sprintf(\"%s-install.exe\", prefix),\n\t\t\"SumatraPDF.pdb.zip\", fmt.Sprintf(\"%s.pdb.zip\", prefix),\n\t\t\"SumatraPDF.pdb.lzsa\", fmt.Sprintf(\"%s.pdb.lzsa\", prefix),\n\t}\n\terr := s3UploadFiles(s3RelDir, \"rel\", files)\n\tfataliferr(err)\n\n\tprefix = fmt.Sprintf(\"SumatraPDF-%s-64\", ver)\n\tfiles = []string{\n\t\t\"SumatraPDF.exe\", fmt.Sprintf(\"%s.exe\", prefix),\n\t\t\"SumatraPDF.zip\", fmt.Sprintf(\"%s.zip\", prefix),\n\t\t\"Installer.exe\", fmt.Sprintf(\"%s-install.exe\", prefix),\n\t\t\"SumatraPDF.pdb.zip\", fmt.Sprintf(\"%s.pdb.zip\", prefix),\n\t\t\"SumatraPDF.pdb.lzsa\", fmt.Sprintf(\"%s.pdb.lzsa\", prefix),\n\t}\n\terr = s3UploadFiles(s3RelDir, \"rel64\", files)\n\tfataliferr(err)\n\n\t// upload manifest last\n\tmanifestLocalPath := pj(\"rel\", \"manifest.txt\")\n\terr = s3UploadFileReader(manifestRemotePath, manifestLocalPath, true)\n\tfataliferr(err)\n\n\t// Note: not uploading auto-update version info. We update it separately,\n\t// a week or so after build is released, so that if there are serious issues,\n\t// we can create an update and less people will be affected\n}\n\nfunc clean() {\n\tif flgAnalyze {\n\t\tremoveDirMust(\"relPrefast\")\n\t\tremoveDirMust(\"dbgPrefast\")\n\t\treturn\n\t}\n\n\tremoveDirMust(\"rel\")\n\tremoveDirMust(\"rel64\")\n\t//removeDirMust(\"dbg\")\n\t//removeDirMust(\"dbg64\")\n}\n\nfunc detectVersions() {\n\tsvnPreReleaseVer = strconv.Itoa(getGitLinearVersionMust())\n\tgitSha1 = getGitSha1Must()\n\tsumatraVersion = extractSumatraVersionMust()\n\tfmt.Printf(\"svnPreReleaseVer: '%s'\\n\", svnPreReleaseVer)\n\tfmt.Printf(\"gitSha1: '%s'\\n\", gitSha1)\n\tfmt.Printf(\"sumatraVersion: '%s'\\n\", sumatraVersion)\n}\n\nfunc translationsPath() string {\n\treturn pj(\"strings\", \"translations.txt\")\n}\n\nfunc translationsSha1HexMust(d []byte) string {\n\tlines := toTrimmedLines(d)\n\tsha1 := lines[1]\n\tfatalif(len(sha1) != 40, \"lastTranslationsSha1HexMust: '%s' doesn't look like sha1\", sha1)\n\treturn sha1\n}\n\nfunc lastTranslationsSha1HexMust() string {\n\td, err := ioutil.ReadFile(translationsPath())\n\tfataliferr(err)\n\treturn translationsSha1HexMust(d)\n}\n\nfunc saveTranslationsMust(d []byte) {\n\terr := ioutil.WriteFile(translationsPath(), d, 0644)\n\tfataliferr(err)\n}\n\nfunc verifyTranslationsMust() {\n\tsha1 := lastTranslationsSha1HexMust()\n\turl := fmt.Sprintf(\"http://www.apptranslator.org/dltrans?app=SumatraPDF&sha1=%s\", sha1)\n\td := httpDlMust(url)\n\tlines := toTrimmedLines(d)\n\tfatalif(lines[1] != \"No change\", \"translations changed, run python scripts/trans_download.py\\n\")\n}\n\nfunc testS3Upload() {\n\tdst := \"temp2.txt\"\n\tsrc := pj(\"rel\", \"SumatraPDF.exe\")\n\t//src := pj(\"rel\", \"buildcmap.exe\")\n\terr := s3UploadFile(dst, src, true)\n\tif err != nil {\n\t\tfmt.Printf(\"upload failed with %s\\n\", err)\n\t} else {\n\t\tfmt.Printf(\"upload ok!\\n\")\n\t}\n\tos.Exit(0)\n}\n\nfunc testBuildLzsa() {\n\tcreatePdbLzsaMust(\"rel\")\n\tos.Exit(0)\n}\n\nfunc init() {\n\ttimeStart = time.Now()\n\tlogFileName = \"build-log.txt\"\n\tcompilePreRelNameRegexpsMust()\n}\n\nfunc main() {\n\t//testBuildLzsa()\n\t//testS3Upload()\n\n\tif false {\n\t\terr := os.Chdir(pj(\"..\", \"sumatrapdf-3.1\"))\n\t\tfataliferr(err)\n\t}\n\n\tif false {\n\t\tdetectVersions()\n\t\tparseSavedAnalyzeOuptut()\n\t\tos.Exit(0)\n\t}\n\n\tparseCmdLine()\n\n\tif flgListS3 {\n\t\ts3ListPreReleaseFilesMust(true)\n\t\treturn\n\t}\n\n\tos.Remove(logFileName)\n\tverifyStartedInRightDirectoryMust()\n\tdetectVersions()\n\tclean()\n\tif flgRelease || flgPreRelease {\n\t\tverifyHasReleaseSecretsMust()\n\t}\n\tif flgRelease {\n\t\tbuildRelease()\n\t} else if flgPreRelease {\n\t\tbuildPreRelease()\n\t} else if flgSmoke {\n\t\tbuildSmoke()\n\t} else if flgAnalyze {\n\t\tbuildAnalyze()\n\t} else {\n\t\tflag.Usage()\n\t\tos.Exit(1)\n\t}\n\tfinalizeThings(false)\n}\n"
  },
  {
    "path": "tools/build/s3.go",
    "content": "package main\n\nimport (\n\t\"crypto/md5\"\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"mime\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"time\"\n\n\t\"github.com/goamz/goamz/aws\"\n\t\"github.com/goamz/goamz/s3\"\n)\n\nvar (\n\ts3AwsAccess string\n\ts3AwsSecret string\n\t// client can change bucket\n\ts3BucketName = \"kjkpub\"\n)\n\nfunc md5B64OfBytes(d []byte) string {\n\tmd5Sum := md5.Sum(d)\n\treturn base64.StdEncoding.EncodeToString(md5Sum[:])\n}\n\nfunc md5B64OfFile(path string) string {\n\td, err := ioutil.ReadFile(path)\n\tfataliferr(err)\n\treturn md5B64OfBytes(d)\n}\n\nfunc s3VerifyHasSecrets() {\n\tfatalif(s3AwsAccess == \"\", \"invalid s3AwsAccess\\n\")\n\tfatalif(s3AwsSecret == \"\", \"invalid s3AwsSsecret\\n\")\n\tfatalif(s3AwsSecret == s3AwsAccess, \"s3AwsSecret == s3AwsAccess\")\n}\n\n// must be called before any other call\nfunc s3SetSecrets(access, secret string) {\n\ts3AwsAccess = access\n\ts3AwsSecret = secret\n\ts3VerifyHasSecrets()\n}\n\n//Note: http.DefaultClient is more robust than aws.RetryingClient\n//(which fails for me with a timeout for large files e.g. ~6MB)\nfunc getS3Client() *http.Client {\n\t// return aws.RetryingClient\n\treturn http.DefaultClient\n}\n\nfunc s3GetBucket() *s3.Bucket {\n\ts3VerifyHasSecrets()\n\tauth := aws.Auth{\n\t\tAccessKey: s3AwsAccess,\n\t\tSecretKey: s3AwsSecret,\n\t}\n\t// Note: it's important that region is aws.USEast. This is where my bucket\n\t// is and giving a different region will fail\n\t// TODO: make aws.USEast a variable s3BucketRegion, to allow over-ride\n\ts3Obj := s3.New(auth, aws.USEast, getS3Client())\n\treturn s3Obj.Bucket(s3BucketName)\n}\r\n\r\nfunc s3UploadFileReader(pathRemote, pathLocal string, public bool) error {\n\tfmt.Printf(\"Uploading '%s' as '%s'. \", pathLocal, pathRemote)\n\tstart := time.Now()\n\topts := s3.Options{}\n\topts.ContentMD5 = md5B64OfFile(pathLocal)\n\tbucket := s3GetBucket()\n\tmimeType := mime.TypeByExtension(filepath.Ext(pathLocal))\n\tfileSize := fileSizeMust(pathLocal)\n\tperm := s3.Private\n\tif public {\n\t\tperm = s3.PublicRead\n\t}\n\tf, err := os.Open(pathLocal)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\terr = bucket.PutReader(pathRemote, f, fileSize, mimeType, perm, opts)\n\tappendTiming(time.Since(start), fmt.Sprintf(\"Upload of %s, size: %d\", pathRemote, fileSize))\n\tif err != nil {\n\t\tfmt.Printf(\"Failed with %s\\n\", err)\n\t} else {\n\t\tfmt.Printf(\"Done in %s\\n\", time.Since(start))\n\t}\n\treturn err\n}\n\nfunc s3UploadFile(pathRemote, pathLocal string, public bool) error {\n\tfmt.Printf(\"Uploading '%s' as '%s'\\n\", pathLocal, pathRemote)\n\tbucket := s3GetBucket()\n\td, err := ioutil.ReadFile(pathLocal)\n\tif err != nil {\n\t\treturn err\n\t}\n\tperm := s3.Private\n\tif public {\n\t\tperm = s3.PublicRead\n\t}\n\tmimeType := mime.TypeByExtension(filepath.Ext(pathLocal))\n\topts := s3.Options{}\n\topts.ContentMD5 = md5B64OfBytes(d)\n\treturn bucket.Put(pathRemote, d, mimeType, perm, opts)\n}\n\nfunc s3UploadString(pathRemote string, s string, public bool) error {\n\tfmt.Printf(\"Uploading string of length %d  as '%s'\\n\", len(s), pathRemote)\n\tbucket := s3GetBucket()\n\td := []byte(s)\n\tmimeType := mime.TypeByExtension(filepath.Ext(pathRemote))\n\topts := s3.Options{}\n\topts.ContentMD5 = md5B64OfBytes([]byte(s))\n\tperm := s3.Private\n\tif public {\n\t\tperm = s3.PublicRead\n\t}\n\treturn bucket.Put(pathRemote, d, mimeType, perm, opts)\n}\n\nfunc s3UploadFiles(s3Dir string, dir string, files []string) error {\n\tn := len(files) / 2\n\tfor i := 0; i < n; i++ {\n\t\tpathLocal := filepath.Join(dir, files[2*i])\n\t\tpathRemote := files[2*i+1]\n\t\terr := s3UploadFileReader(s3Dir+pathRemote, pathLocal, true)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to upload '%s' as '%s', err: %s\", pathLocal, pathRemote, err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc s3Delete(path string) error {\n\tbucket := s3GetBucket()\n\treturn bucket.Del(path)\n}\n\nfunc s3Exists(s3Path string) bool {\n\tbucket := s3GetBucket()\n\texists, err := bucket.Exists(s3Path)\n\tif err != nil {\n\t\tfmt.Printf(\"bucket.Exists('%s') failed with %s\\n\", s3Path, err)\n\t\treturn false\n\t}\n\treturn exists\n}\n"
  },
  {
    "path": "tools/build/util.go",
    "content": "package main\n\nimport (\n\t\"crypto/sha1\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n)\n\n// Timing records how long something took to execute\ntype Timing struct {\n\tDuration time.Duration\n\tWhat     string\n}\n\nvar (\n\ttimings     []Timing\n\tinFatal     bool\n\tlogFile     *os.File\n\tlogFileName string // set logFileName to enable loggin\n)\n\nfunc logToFile(s string) {\n\tif logFileName == \"\" {\n\t\treturn\n\t}\n\n\tif logFile == nil {\n\t\tvar err error\n\t\tlogFile, err = os.Create(logFileName)\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"logToFile: os.Create('%s') failed with %s\\n\", logFileName, err)\n\t\t\tos.Exit(1)\n\t\t}\n\t}\n\tlogFile.WriteString(s)\n}\n\nfunc closeLogFile() {\n\tif logFile != nil {\n\t\tlogFile.Close()\n\t\tlogFile = nil\n\t}\n}\n\n// Note: it can say is 32bit on 64bit machine (if 32bit toolset is installed),\n// but it'll never say it's 64bit if it's 32bit\nfunc isOS64Bit() bool {\n\treturn runtime.GOARCH == \"amd64\"\n}\n\nfunc appendTiming(dur time.Duration, what string) {\n\tt := Timing{\n\t\tDuration: dur,\n\t\tWhat:     what,\n\t}\n\ttimings = append(timings, t)\n}\n\nfunc printTimings() {\n\tfor _, t := range timings {\n\t\tfmt.Printf(\"%s\\n    %s\\n\", t.Duration, t.What)\n\t\tlogToFile(fmt.Sprintf(\"%s\\n    %s\\n\", t.Duration, t.What))\n\t}\n}\n\nfunc printStack() {\n\tbuf := make([]byte, 1024*164)\n\tn := runtime.Stack(buf, false)\n\tfmt.Printf(\"%s\", buf[:n])\n}\n\nfunc fatalf(format string, args ...interface{}) {\n\tfmt.Printf(format, args...)\n\tprintStack()\n\tfinalizeThings(true)\n\tos.Exit(1)\n}\n\nfunc fatalif(cond bool, format string, args ...interface{}) {\n\tif cond {\n\t\tif inFatal {\n\t\t\tos.Exit(1)\n\t\t}\n\t\tinFatal = true\n\t\tfmt.Printf(format, args...)\n\t\tprintStack()\n\t\tfinalizeThings(true)\n\t\tos.Exit(1)\n\t}\n}\n\nfunc fataliferr(err error) {\n\tif err != nil {\n\t\tfatalf(\"%s\\n\", err.Error())\n\t}\n}\n\nfunc pj(elem ...string) string {\n\treturn filepath.Join(elem...)\n}\n\nfunc replaceExt(path string, newExt string) string {\n\text := filepath.Ext(path)\n\treturn path[0:len(path)-len(ext)] + newExt\n}\n\nfunc fileExists(path string) bool {\n\tfi, err := os.Stat(path)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn fi.Mode().IsRegular()\n}\n\nfunc toTrimmedLines(d []byte) []string {\n\tlines := strings.Split(string(d), \"\\n\")\n\ti := 0\n\tfor _, l := range lines {\n\t\tl = strings.TrimSpace(l)\n\t\t// remove empty lines\n\t\tif len(l) > 0 {\n\t\t\tlines[i] = l\n\t\t\ti++\n\t\t}\n\t}\n\treturn lines[:i]\n}\n\nfunc fileSizeMust(path string) int64 {\n\tfi, err := os.Stat(path)\n\tfataliferr(err)\n\treturn fi.Size()\n}\n\nfunc fileCopyMust(dst, src string) {\n\tin, err := os.Open(src)\n\tfataliferr(err)\n\tdefer in.Close()\n\n\tout, err := os.Create(dst)\n\tfataliferr(err)\n\n\t_, err = io.Copy(out, in)\n\tcerr := out.Close()\n\tfataliferr(err)\n\tfataliferr(cerr)\n}\n\nfunc isNum(s string) bool {\n\t_, err := strconv.Atoi(s)\n\treturn err == nil\n}\n\nfunc isGitClean() bool {\n\tout, err := runExe(\"git\", \"status\", \"--porcelain\")\n\tfataliferr(err)\n\ts := strings.TrimSpace(string(out))\n\treturn len(s) == 0\n}\n\nfunc removeDirMust(dir string) {\n\terr := os.RemoveAll(dir)\n\tfataliferr(err)\n}\n\nfunc removeFileMust(path string) {\n\tif !fileExists(path) {\n\t\treturn\n\t}\n\terr := os.Remove(path)\n\tfataliferr(err)\n}\n\n// Version must be in format x.y.z\nfunc verifyCorrectVersionMust(ver string) {\n\tparts := strings.Split(ver, \".\")\n\tfatalif(len(parts) == 0 || len(parts) > 3, \"%s is not a valid version number\", ver)\n\tfor _, part := range parts {\n\t\tfatalif(!isNum(part), \"%s is not a valid version number\", ver)\n\t}\n}\n\nfunc getGitSha1Must() string {\n\tout, err := runExe(\"git\", \"rev-parse\", \"HEAD\")\n\tfataliferr(err)\n\ts := strings.TrimSpace(string(out))\n\tfatalif(len(s) != 40, \"getGitSha1Must(): %s doesn't look like sha1\\n\", s)\n\treturn s\n}\n\nfunc dataSha1Hex(d []byte) string {\n\tsha1 := sha1.Sum(d)\n\treturn fmt.Sprintf(\"%x\", sha1[:])\n}\n\nfunc fileSha1Hex(path string) (string, error) {\n\td, err := ioutil.ReadFile(path)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tsha1 := sha1.Sum(d)\n\treturn fmt.Sprintf(\"%x\", sha1[:]), nil\n}\n\nfunc httpDlMust(uri string) []byte {\n\tres, err := http.Get(uri)\n\tfataliferr(err)\n\td, err := ioutil.ReadAll(res.Body)\n\tres.Body.Close()\n\tfataliferr(err)\n\treturn d\n}\n\nfunc httpDlToFileMust(uri string, path string, sha1Hex string) {\n\tif fileExists(path) {\n\t\tsha1File, err := fileSha1Hex(path)\n\t\tfataliferr(err)\n\t\tfatalif(sha1File != sha1Hex, \"file '%s' exists but has sha1 of %s and we expected %s\", path, sha1File, sha1Hex)\n\t\treturn\n\t}\n\tfmt.Printf(\"Downloading '%s'\\n\", uri)\n\td := httpDlMust(uri)\n\tsha1File := dataSha1Hex(d)\n\tfatalif(sha1File != sha1Hex, \"downloaded '%s' but it has sha1 of %s and we expected %s\", uri, sha1File, sha1Hex)\n\terr := ioutil.WriteFile(path, d, 0755)\n\tfataliferr(err)\n}\n"
  },
  {
    "path": "tools/buildgo/main.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"sort\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n)\n\n/*\nTo run:\n* install Go\n - download and run latest installer http://golang.org/doc/install\n - restart so that PATH changes take place\n - set GOPATH env variable (e.g. to %USERPROFILE%\\src\\go)\n* go run .\\tools\\buildgo\\main.go\n\nSome notes on the insanity that is setting up command-line build for both\n32 and 64 bit executables.\n\nUseful references:\nhttps://msdn.microsoft.com/en-us/library/f2ccy3wt.aspx\nhttps://msdn.microsoft.com/en-us/library/x4d2c09s.aspx\nhttp://www.sqlite.org/src/artifact/60dbf6021d3de0a9 -sqlite's win build script\n\n%VS140COMNTOOLS%\\vsvars32.bat is how set basic env for 32bit builds for VS 2015\n(it's VS120COMNTOOLS for VS 2013).\n\nThat sets VSINSTALLDIR env variable which we can use to setup both 32bit and\n64bit builds:\n%VCINSTALLDIR%\\vcvarsall.bat x86_amd64 : 64bit\n%VCINSTALLDIR%\\vcvarsall.bat x86 : 32bit\n\nIf the OS is 64bit, there are also 64bit compilers that can be selected with:\namd64 (for 64bit builds) and amd64_x86 (for 32bit builds). They generate\nthe exact same code but can compiler bigger programs (can use more memory).\n\nI'm guessing %VS140COMNTOOLS%\\vsvars32.bat is the same as %VSINSTALLDIR%\\vcvarsall.bat x86.\n*/\n\n// Platform represents a 32bit vs 64bit platform\ntype Platform int\n\n// Config is release, debug etc.\ntype Config int\n\nconst (\n\t// Platform32Bit describes 32bit build\n\tPlatform32Bit Platform = 1\n\t// Platform64Bit describes 64bit build\n\tPlatform64Bit Platform = 2\n\n\t// ConfigDebug describes debug build\n\tConfigDebug Config = 1\n\t// ConfigRelease describes release build\n\tConfigRelease Config = 2\n\t// ConfigAnalyze describes relase build with /analyze option\n\tConfigAnalyze Config = 3\n)\n\n// EnvVar describes an environment variable\ntype EnvVar struct {\n\tName string\n\tVal  string\n}\n\n// Args represent arguments to a command to run\ntype Args struct {\n\targs []string\n}\n\nvar (\n\tcachedVcInstallDir string\n\tcachedExePaths     map[string]string\n\tcreatedDirs        map[string]bool\n\tfileInfoCache      map[string]os.FileInfo\n\talwaysRebuild      bool\n\twg                 sync.WaitGroup\n\tsem                chan bool\n\tmupdfDir           string\n\textDir             string\n\tzlibDir            string\n\tfreetypeDir        string\n\tjpegTurboDir       string\n\topenJpegDir        string\n\tjbig2Dir           string\n\tmupdfGenDir        string\n\tnasmPath           string\n\tcflagsB            *Args\n\tcflagsOpt          *Args\n\tcflags             *Args\n\tzlibCflags         *Args // TODO: should be cflagsZlib\n\tfreetypeCflags     *Args\n\tjpegTurboCflags    *Args\n\tjbig2Cflags        *Args\n\topenJpegCflags     *Args\n\tjpegTurboNasmFlags *Args\n\tmupdfNasmFlags     *Args\n\tmpudfCflags        *Args\n\tldFlags            *Args\n\tlibs               *Args\n\tftSrc              []string\n\tzlibSrc            []string\n\tjpegTurboSrc       []string\n\tjpegTurboAsmSrc    []string\n\tjbig2Src           []string\n\topenJpegSrc        []string\n\tmupdfDrawSrc       []string\n\tmupdfFitzSrc       []string\n\tmupdfSrc           []string\n\tmuxpsSrc           []string\n\tmupdfAllSrc        []string\n\tmudocSrc           []string\n\tmutoolsSrc         []string\n\tmutoolAllSrc       []string\n\tmudrawSrc          []string\n)\n\nfunc (p Platform) is64() bool {\n\treturn p == Platform64Bit\n}\n\nfunc (p Platform) is32() bool {\n\treturn p == Platform32Bit\n}\n\nfunc (a *Args) append(toAppend ...string) *Args {\n\treturn &Args{\n\t\targs: strConcat(a.args, toAppend),\n\t}\n}\n\nfunc NewArgs(args ...string) *Args {\n\treturn &Args{\n\t\targs: args,\n\t}\n}\n\nfunc semEnter() {\n\tsem <- true\n}\n\nfunc semLeave() {\n\t<-sem\n}\n\nfunc fatalf(format string, args ...interface{}) {\n\tfmt.Printf(format, args...)\n\tos.Exit(1)\n}\n\nfunc pj(elem ...string) string {\n\treturn filepath.Join(elem...)\n}\n\nfunc strConcat(arr1, arr2 []string) []string {\n\tvar res []string\n\tfor _, s := range arr1 {\n\t\tres = append(res, s)\n\t}\n\tfor _, s := range arr2 {\n\t\tres = append(res, s)\n\t}\n\treturn res\n}\n\nfunc replaceExt(path string, newExt string) string {\n\text := filepath.Ext(path)\n\treturn path[0:len(path)-len(ext)] + newExt\n}\n\nfunc fileExists(path string) bool {\n\tif _, ok := fileInfoCache[path]; !ok {\n\t\tfi, err := os.Stat(path)\n\t\tif err != nil {\n\t\t\treturn false\n\t\t}\n\t\tfileInfoCache[path] = fi\n\t}\n\tfi := fileInfoCache[path]\n\treturn fi.Mode().IsRegular()\n}\n\nfunc createDirCached(dir string) {\n\tif _, ok := createdDirs[dir]; ok {\n\t\treturn\n\t}\n\tif err := os.MkdirAll(dir, 0644); err != nil {\n\t\tfatalf(\"os.MkdirAll(%s) failed wiht %s\\n\", dir, err)\n\t}\n}\n\nfunc getModTime(path string, def time.Time) time.Time {\n\tif _, ok := fileInfoCache[path]; !ok {\n\t\tfi, err := os.Stat(path)\n\t\tif err != nil {\n\t\t\treturn def\n\t\t}\n\t\tfileInfoCache[path] = fi\n\t}\n\tfi := fileInfoCache[path]\n\treturn fi.ModTime()\n}\n\n// maps upper-cased name of env variable to Name/Val\nfunc envToMap(env []string) map[string]*EnvVar {\n\tres := make(map[string]*EnvVar)\n\tfor _, v := range env {\n\t\tif len(v) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tparts := strings.SplitN(v, \"=\", 2)\n\t\tif len(parts) != 2 {\n\n\t\t}\n\t\tnameUpper := strings.ToUpper(parts[0])\n\t\tres[nameUpper] = &EnvVar{\n\t\t\tName: parts[0],\n\t\t\tVal:  parts[1],\n\t\t}\n\t}\n\treturn res\n}\n\nfunc getEnvAfterScript(dir, script string) map[string]*EnvVar {\n\t// TODO: maybe use COMSPEC env variable instead of \"cmd.exe\" (more robust)\n\tcmd := exec.Command(\"cmd.exe\", \"/c\", script+\" & set\")\n\tcmd.Dir = dir\n\tfmt.Printf(\"Executing: %s in %s\\n\", cmd.Args, cmd.Dir)\n\tresBytes, err := cmd.Output()\n\tif err != nil {\n\t\tfmt.Printf(\"failed with %s\\n\", err)\n\t\tos.Exit(1)\n\t}\n\tres := string(resBytes)\n\t//fmt.Printf(\"res:\\n%s\\n\", res)\n\tparts := strings.Split(res, \"\\n\")\n\tif len(parts) == 1 {\n\t\tfmt.Printf(\"split failed\\n\")\n\t\tfmt.Printf(\"res:\\n%s\\n\", res)\n\t\tos.Exit(1)\n\t}\n\tfor idx, env := range parts {\n\t\tenv = strings.TrimSpace(env)\n\t\tparts[idx] = env\n\t}\n\treturn envToMap(parts)\n}\n\nfunc calcEnvAdded(before, after map[string]*EnvVar) map[string]*EnvVar {\n\tres := make(map[string]*EnvVar)\n\tfor k, afterVal := range after {\n\t\tbeforeVal := before[k]\n\t\tif beforeVal == nil || beforeVal.Val != afterVal.Val {\n\t\t\tres[k] = afterVal\n\t\t}\n\t}\n\treturn res\n}\n\n// return value of VCINSTALLDIR env variable after running vsvars32.bat\nfunc getVcInstallDir(toolsDir string) string {\n\tif cachedVcInstallDir == \"\" {\n\t\tenv := getEnvAfterScript(toolsDir, \"vsvars32.bat\")\n\t\tval := env[\"VCINSTALLDIR\"]\n\t\tif val == nil {\n\t\t\tfmt.Printf(\"no 'VCINSTALLDIR' variable in %s\\n\", env)\n\t\t\tos.Exit(1)\n\t\t}\n\t\tcachedVcInstallDir = val.Val\n\t}\n\treturn cachedVcInstallDir\n}\n\nfunc getEnvForVcTools(vcInstallDir, platform string) []string {\n\t//initialEnv := envToMap(os.Environ())\n\tafterEnv := getEnvAfterScript(vcInstallDir, \"vcvarsall.bat \"+platform)\n\t//return calcEnvAdded(initialEnv, afterEnv)\n\n\tvar envArr []string\n\tfor _, envVar := range afterEnv {\n\t\tv := fmt.Sprintf(\"%s=%s\", envVar.Name, envVar.Val)\n\t\tenvArr = append(envArr, v)\n\t}\n\treturn envArr\n}\n\nfunc getEnv32(vcInstallDir string) []string {\n\treturn getEnvForVcTools(vcInstallDir, \"x86\")\n}\n\nfunc getEnv64(vcInstallDir string) []string {\n\treturn getEnvForVcTools(vcInstallDir, \"x86_amd64\")\n}\n\nfunc dumpEnv(env map[string]*EnvVar) {\n\tvar keys []string\n\tfor k := range env {\n\t\tkeys = append(keys, k)\n\t}\n\tsort.Strings(keys)\n\tfor _, k := range keys {\n\t\tv := env[k]\n\t\tfmt.Printf(\"%s: %s\\n\", v.Name, v.Val)\n\t}\n}\n\nfunc getEnv(platform Platform) []string {\n\tinitialEnv := envToMap(os.Environ())\n\tvs2013 := initialEnv[\"VS120COMNTOOLS\"]\n\tvs2015 := initialEnv[\"VS140COMNTOOLS\"]\n\tvsVar := vs2015\n\tif vsVar == nil {\n\t\tvsVar = vs2013\n\t}\n\tif vsVar == nil {\n\t\tfmt.Printf(\"VS120COMNTOOLS or VS140COMNTOOLS not set; VS 2013 or 2015 not installed\\n\")\n\t\tos.Exit(1)\n\t}\n\tvcInstallDir := getVcInstallDir(vsVar.Val)\n\tswitch platform {\n\tcase Platform32Bit:\n\t\treturn getEnv32(vcInstallDir)\n\tcase Platform64Bit:\n\t\treturn getEnv64(vcInstallDir)\n\tdefault:\n\t\tpanic(\"unknown platform\")\n\t}\n}\n\nfunc getOutDir(platform Platform, config Config) string {\n\tdir := \"\"\n\tswitch config {\n\tcase ConfigRelease:\n\t\tdir = \"rel\"\n\tcase ConfigDebug:\n\t\tdir = \"dbg\"\n\t}\n\tif platform == Platform64Bit {\n\t\tdir += \"64\"\n\t}\n\treturn dir\n}\n\n// returns true if dst doesn't exist or is older than src or any of the deps\nfunc isOutdated(src, dst string, deps []string) bool {\n\tif alwaysRebuild {\n\t\treturn true\n\t}\n\tif !fileExists(dst) {\n\t\treturn true\n\t}\n\tdstTime := getModTime(dst, time.Now())\n\tsrcTime := getModTime(src, time.Now())\n\tif srcTime.Sub(dstTime) > 0 {\n\t\treturn true\n\t}\n\tfor _, path := range deps {\n\t\tpathTime := getModTime(path, time.Now())\n\t\tif srcTime.Sub(pathTime) > 0 {\n\t\t\treturn true\n\t\t}\n\t}\n\tif true {\n\t\tfmt.Printf(\"%s is up to date\\n\", dst)\n\t}\n\treturn false\n}\n\nfunc createDirForFileCached(path string) {\n\tcreateDirCached(filepath.Dir(path))\n}\n\nfunc lookupInEnvPathUncached(exeName string, env []string) string {\n\tfor _, envVar := range env {\n\t\tparts := strings.SplitN(envVar, \"=\", 2)\n\t\tname := strings.ToLower(parts[0])\n\t\tif name != \"path\" {\n\t\t\tcontinue\n\t\t}\n\t\tparts = strings.Split(parts[1], \";\")\n\t\tfor _, dir := range parts {\n\t\t\tpath := filepath.Join(dir, exeName)\n\t\t\tif fileExists(path) {\n\t\t\t\treturn path\n\t\t\t}\n\t\t}\n\t\tfatalf(\"didn't find %s in '%s'\\n\", exeName, parts[1])\n\t}\n\treturn \"\"\n}\n\nfunc lookupInEnvPath(exeName string, env []string) string {\n\tif _, ok := cachedExePaths[exeName]; !ok {\n\t\tcachedExePaths[exeName] = lookupInEnvPathUncached(exeName, env)\n\t\tfmt.Printf(\"found %s as %s\\n\", exeName, cachedExePaths[exeName])\n\t}\n\treturn cachedExePaths[exeName]\n}\n\nfunc runExeHelper(exeName string, env []string, args *Args) {\n\texePath := lookupInEnvPath(exeName, env)\n\tcmd := exec.Command(exePath, args.args...)\n\tcmd.Env = env\n\tif true {\n\t\targs := cmd.Args\n\t\targs[0] = exeName\n\t\tfmt.Printf(\"Running %s\\n\", args)\n\t\targs[0] = exePath\n\t}\n\tout, err := cmd.CombinedOutput()\n\tif err != nil {\n\t\tfatalf(\"%s failed with %s, out:\\n%s\\n\", cmd.Args, err, string(out))\n\t}\n}\n\nfunc runExe(exeName string, env []string, args *Args) {\n\tsemEnter()\n\twg.Add(1)\n\tgo func() {\n\t\trunExeHelper(exeName, env, args)\n\t\tsemLeave()\n\t\twg.Done()\n\t}()\n}\n\nfunc rc(src, dst string, env []string, args *Args) {\n\tcreateDirForFileCached(dst)\n\textraArgs := []string{\n\t\t\"/Fo\" + dst,\n\t\tsrc,\n\t}\n\targs = args.append(extraArgs...)\n\trunExe(\"rc.exe\", env, args)\n}\n\nfunc cl(src, dst string, env []string, args *Args) {\n\tif !isOutdated(src, dst, nil) {\n\t\treturn\n\t}\n\tcreateDirForFileCached(dst)\n\textraArgs := []string{\n\t\t\"/Fo\" + dst,\n\t\tsrc,\n\t}\n\targs = args.append(extraArgs...)\n\trunExe(\"cl.exe\", env, args)\n}\n\nfunc isExt(name string, valid []string) bool {\n\text := strings.ToLower(filepath.Ext(name))\n\tfor _, s := range valid {\n\t\tif ext == s {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// given ${dir}/foo.rc, returns ${outDir}/${dir}/foo.rc\nfunc rcOut(src, outDir string) string {\n\tverifyIsRcFile(src)\n\ts := filepath.Join(outDir, src)\n\treturn replaceExt(s, \".res\")\n}\n\nfunc verifyIsRcFile(path string) {\n\tif !isExt(path, []string{\".rc\"}) {\n\t\tfatalf(\"%s should end in '.rc'\\n\", path)\n\t}\n}\n\nfunc verifyIsCFile(path string) {\n\tif !isExt(path, []string{\".cpp\", \".c\"}) {\n\t\tfatalf(\"%s should end in '.c' or '.cpp'\\n\", path)\n\t}\n}\n\nfunc clOut(src, outDir string) string {\n\tverifyIsCFile(src)\n\ts := filepath.Join(outDir, src)\n\treturn replaceExt(s, \".obj\")\n}\n\nfunc clDir(srcDir string, files []string, outDir string, env []string, args *Args) {\n\tfor _, f := range files {\n\t\tsrc := filepath.Join(srcDir, f)\n\t\tdst := clOut(src, outDir)\n\t\tcl(src, dst, env, args)\n\t}\n}\n\nfunc build(platform Platform, config Config) {\n\tenv := getEnv(platform)\n\t//dumpEnv(env)\n\toutDir := getOutDir(platform, config)\n\tcreateDirCached(outDir)\n\n\trcArgs := []string{\n\t\t\"/r\",\n\t\t\"/D\", \"DEBUG\",\n\t\t\"/D\", \"_DEBUG\",\n\t}\n\trcSrc := filepath.Join(\"src\", \"SumatraPDF.rc\")\n\trcDst := rcOut(rcSrc, outDir)\n\trc(rcSrc, rcDst, env, &Args{args: rcArgs})\n\n\tstartArgs := []string{\n\t\t\"/nologo\", \"/c\",\n\t\t\"/D\", \"WIN32\",\n\t\t\"/D\", \"_WIN32\",\n\t\t\"/D\", \"WINVER=0x0501\",\n\t\t\"/D\", \"_WIN32_WINNT=0x0501\",\n\t\t\"/D\", \"DEBUG\",\n\t\t\"/D\", \"_DEBUG\",\n\t\t\"/D\", \"_USING_V110_SDK71_\",\n\t\t\"/GR-\",\n\t\t\"/Zi\",\n\t\t\"/GS\",\n\t\t\"/Gy\",\n\t\t\"/GF\",\n\t\t\"/arch:IA32\",\n\t\t\"/EHs-c-\",\n\t\t\"/MTd\",\n\t\t\"/Od\",\n\t\t\"/RTCs\",\n\t\t\"/RTCu\",\n\t\t\"/WX\",\n\t\t\"/W4\",\n\t\t\"/FS\",\n\t\t\"/wd4100\",\n\t\t\"/wd4127\",\n\t\t\"/wd4189\",\n\t\t\"/wd4428\",\n\t\t\"/wd4324\",\n\t\t\"/wd4458\",\n\t\t\"/wd4838\",\n\t\t\"/wd4800\",\n\t\t\"/Imupdf/include\",\n\t\t\"/Iext/zlib\",\n\t\t\"/Iext/lzma/C\",\n\t\t\"/Iext/libwebp\",\n\t\t\"/Iext/unarr\",\n\t\t\"/Iext/synctex\",\n\t\t\"/Iext/libdjvu\",\n\t\t\"/Iext/CHMLib/src\",\n\t\t\"/Isrc\",\n\t\t\"/Isrc/utils\",\n\t\t\"/Isrc/wingui\",\n\t\t\"/Isrc/mui\",\n\t\t//fmt.Sprintf(\"/Fo%s\\\\sumatrapdf\", outDir),\n\t\tfmt.Sprintf(\"/Fd%s\\\\vc80.pdb\", outDir),\n\t}\n\tinitialClArgs := &Args{\n\t\targs: startArgs,\n\t}\n\tsrcFiles := []string{\n\t\t\"AppPrefs.cpp\",\n\t\t\"DisplayModel.cpp\",\n\t\t\"CrashHandler.cpp\",\n\t\t\"Favorites.cpp\",\n\t\t\"TextSearch.cpp\",\n\t\t\"SumatraAbout.cpp\",\n\t\t\"SumatraAbout2.cpp\",\n\t\t\"SumatraDialogs.cpp\",\n\t\t\"SumatraProperties.cpp\",\n\t\t\"GlobalPrefs.cpp\",\n\t\t\"PdfSync.cpp\",\n\t\t\"RenderCache.cpp\",\n\t\t\"TextSelection.cpp\",\n\t\t\"WindowInfo.cpp\",\n\t\t\"ParseCOmmandLine.cpp\",\n\t\t\"StressTesting.cpp\",\n\t\t\"AppTools.cpp\",\n\t\t\"AppUtil.cpp\",\n\t\t\"TableOfContents.cpp\",\n\t\t\"Toolbar.cpp\",\n\t\t\"Print.cpp\",\n\t\t\"Notifications.cpp\",\n\t\t\"Selection.cpp\",\n\t\t\"Search.cpp\",\n\t\t\"ExternalViewers.cpp\",\n\t\t\"EbookControls.cpp\",\n\t\t\"EbookController.cpp\",\n\t\t\"Doc.cpp\",\n\t\t\"MuiEbookPageDef.cpp\",\n\t\t\"PagesLayoutDef.cpp\",\n\t\t\"Tester.cpp\",\n\t\t\"Translations.cpp\",\n\t\t\"Trans_sumatra_txt.cpp\",\n\t\t\"Tabs.cpp\",\n\t\t\"FileThumbnails.cpp\",\n\t\t\"FileHistory.cpp\",\n\t\t\"ChmModel.cpp\",\n\t\t\"Caption.cpp\",\n\t\t\"Canvas.cpp\",\n\t\t\"TabInfo.cpp\",\n\t}\n\tclDir(\"src\", srcFiles, outDir, env, initialClArgs)\n\n\tif false {\n\t\tregressFiles := []string{\n\t\t\t\"Regress.cpp\",\n\t\t}\n\t\tclDir(pj(\"src\", \"regress\"), regressFiles, outDir, env, initialClArgs)\n\t}\n\n\tsrcUtilsFiles := []string{\n\t\t\"FileUtil.cpp\",\n\t\t\"HttpUtil.cpp\",\n\t\t\"StrUtil.cpp\",\n\t\t\"WinUtil.cpp\",\n\t\t\"GdiPlusUtil.cpp\",\n\t\t\"FileTransactions.cpp\",\n\t\t\"Touch.cpp\",\n\t\t\"TrivialHtmlParser.cpp\",\n\t\t\"HtmlWindow.cpp\",\n\t\t\"DirIter.cpp\",\n\t\t\"BitReader.cpp\",\n\t\t\"HtmlPullParser.cpp\",\n\t\t\"HtmlPrettyPrint.cpp\",\n\t\t\"ThreadUtil.cpp\",\n\t\t\"DebugLog.cpp\",\n\t\t\"DbgHelpDyn.cpp\",\n\t\t\"JsonParser.cpp\",\n\t\t\"TgaReader.cpp\",\n\t\t\"HtmlParserLookup.cpp\",\n\t\t\"ByteOrderDecoder.cpp\",\n\t\t\"CmdLineParser.cpp\",\n\t\t\"UITask.cpp\",\n\t\t\"StrFormat.cpp\",\n\t\t\"Dict.cpp\",\n\t\t\"BaseUtil.cpp\",\n\t\t\"CssParser.cpp\",\n\t\t\"FileWatcher.cpp\",\n\t\t\"CryptoUtil.cpp\",\n\t\t\"StrSlice.cpp\",\n\t\t\"TxtParser.cpp\",\n\t\t\"SerializeTxt.cpp\",\n\t\t\"SquareTreeParser.cpp\",\n\t\t\"SettingsUtil.cpp\",\n\t\t\"WebpReader.cpp\",\n\t\t\"FzImgReader.cpp\",\n\t\t\"ArchUtil.cpp\",\n\t\t\"ZipUtil.cpp\",\n\t\t\"LzmaSimpleArchive.cpp\",\n\t\t\"Dpi.cpp\",\n\t}\n\tclDir(pj(\"src\", \"utils\"), srcUtilsFiles, outDir, env, initialClArgs)\n}\n\nfunc initDirs() {\n\tmupdfDir = \"mupdf\"\n\t// we invoke make from inside mupdfDir, so this must be relative to that\n\t// TODO: fix that\n\textDir = pj(\"..\", \"ext\")\n\tzlibDir = pj(extDir, \"zlib\")\n\tfreetypeDir = pj(extDir, \"freetype2\")\n\tjpegTurboDir = pj(extDir, \"libjpeg-turbo\")\n\topenJpegDir = pj(extDir, \"openjpeg\")\n\tjbig2Dir = pj(extDir, \"jbig2dec\")\n\t// TODO: this is a build artifact so should go under outDir\n\tmupdfGenDir = pj(mupdfDir, \"generated\")\n}\n\nfunc initFlags(platform Platform, config Config) {\n\tcflagsB = NewArgs(\"/nologo\", \"/c\")\n\tif platform.is64() {\n\t\tcflagsB.append(\"/D\", \"WIN64\", \"/D\", \"_WIN64\")\n\t} else {\n\t\tcflagsB.append(\"/D\", \"WIN32\", \"/D\", \"_WIN32\")\n\t}\n\tif config != ConfigAnalyze {\n\t\t// TODO: probably different for vs 2015\n\t\tcflagsB = cflagsB.append(\"/D\", \"_USING_V110_SDK71_\")\n\t}\n\t/*\n\t\t# /WX  : treat warnings as errors\n\t\t# /GR- : disable RTTI\n\t\t# /Zi  : enable debug information\n\t\t# /GS  : enable security checks\n\t\t# /Gy  : separate functions for linker\n\t\t# /GF  : enable read-only string pooling\n\t\t# /MP  : use muliple processors to speed up compilation\n\t\t# Note: /MP not used as it might be causing extreme flakiness on EC2 buildbot\n\t*/\n\t// for 64bit don't treat warnings as errors\n\t// TODO: add an over-ride as STRICT_X64 in makefile\n\tif !platform.is32() {\n\t\tcflagsB = cflagsB.append(\"/WX\")\n\t}\n\tcflagsB = cflagsB.append(\"/GR-\", \"/Zi\", \"/GS\", \"/Gy\", \"/GF\")\n\t// disable the default /arch:SSE2 for 32-bit builds\n\tif platform.is32() {\n\t\tcflagsB = cflagsB.append(\"/arch:IA32\")\n\t}\n\t// /EHs-c- : disable C++ exceptions (generates smaller binaries)\n\tcflagsB = cflagsB.append(\"/EHs-c-\")\n\t/*\n\t\t# /W4  : bump warnings level from 1 to 4\n\t\t# warnings unlikely to be turned off due to false positives from using CrashIf()\n\t\t# and various logging functions:\n\t\t# 4100 : unreferenced param\n\t\t# 4127 : conditional expression is constant\n\t\t# 4189 : variable initialized but not referenced\n\t\t# warnings that might not make sense to fix:\n\t\t# 4428 : universal-character-name encountered in source (prevents using \"\\u202A\" etc.)\n\t\t# 4324 : structure was padded due to __declspec(align())\n\t*/\n\tcflagsB = cflagsB.append(\"/W4\", \"/wd4100\", \"/wd4127\", \"/wd4189\", \"/wd4428\", \"/wd4324\")\n\n\t/*\n\t\t# Those only need to be disabled in VS 2015\n\t\t# 4458 : declaration of '*' hides class member, a new warning in VS 2015\n\t\t#        unfortunately it's triggered by SDK 10 Gdiplus headers\n\t\t# 4838 : 'conversion from '*' to '*' requires a narrowing conversion\n\t\t#        because QITABENT in SDK 10 triggers this\n\t\tTODO: only for VS 2015\n\t*/\n\tcflagsB = cflagsB.append(\"/wd4458\", \"/wd4838\")\n\n\t/*\n\t\t# /Ox  : maximum optimizations\n\t\t# /O2  : maximize speed\n\t\t# docs say /Ox better, my tests say /O2 better\n\t*/\n\tcflagsOpt = cflagsB.append(\"/O2\", \"/D\", \"NDEBUG\")\n\n\tldFlags = NewArgs(\"/nologo\", \"/DEBUG\", \"/RELEASE\", \"/opt:ref\", \"/opt:icf\")\n\tif platform.is32() {\n\t\tldFlags = ldFlags.append(\"/MACHINE:X86\")\n\t} else {\n\t\tldFlags = ldFlags.append(\"/MACHINE:X64\")\n\t}\n\n\tif config != ConfigDebug {\n\t\t// /GL  : enable link-time code generation\n\t\tcflags = cflagsOpt.append(\"/GL\")\n\t\tldFlags = ldFlags.append(\"/LTCG\")\n\t\t// /DYNAMICBASE and /NXCOMPAT for better protection against stack overflows\n\t\t// http://blogs.msdn.com/vcblog/archive/2009/05/21/dynamicbase-and-nxcompat.aspx\n\t\t// We don't use /NXCOMPAT because we need to turn it on/off at runtime\n\t\tldFlags = ldFlags.append(\"/DYNAMICBASE\", \"/FIXED:NO\")\n\t} else {\n\t\t// /MTd  : statically link debug crt (libcmtd.lib)\n\t\tcflagsB = cflagsB.append(\"/MTd\")\n\t\t// /RTCs : stack frame runtime checking\n\t\t// /RTCu : ununitialized local usage checks\n\t\t// /Od   : disable optimizations\n\t\tcflags = cflagsB.append(\"/Od\", \"/RTCs\", \"/RTCu\")\n\t}\n\n\tif platform.is64() {\n\t\tldFlags = ldFlags.append(\"/SUBSYSTEM:WINDOWS,5.2\")\n\t} else {\n\t\tldFlags = ldFlags.append(\"/SUBSYSTEM:WINDOWS,5.1\")\n\t}\n\n\tzlibCflags = cflagsOpt.append(\"/TC\", \"/wd4131\", \"/wd4244\", \"/wd4996\", \"/I\"+zlibDir)\n\n\t// TODO:\n}\n\nfunc initSrc() {\n\tftSrc = []string{\n\t\t\"ftbase.c\", \"ftbbox.c\", \"ftbitmap.c\", \"ftgasp.c\",\n\t\t\"ftglyph.c\", \"ftinit.c\", \"ftstroke.c\", \"ftsynth.c\",\n\t\t\"ftsystem.c\", \"fttype1.c\", \"ftxf86.c\", \"cff.c\",\n\t\t\"type1cid.c\", \"psaux.c\", \"psnames.c\", \"smooth.c\",\n\t\t\"sfnt.c\", \"truetype.c\", \"type1.c\", \"raster.c\",\n\t\t\"otvalid.c\", \"ftotval.c\", \"pshinter.c\", \"ftgzip.c\",\n\t}\n}\n\nfunc main() {\n\tcachedExePaths = make(map[string]string)\n\tcreatedDirs = make(map[string]bool)\n\tfileInfoCache = make(map[string]os.FileInfo)\n\tinitDirs()\n\tinitFlags(Platform64Bit, ConfigRelease)\n\tinitSrc()\n\tn := runtime.NumCPU()\n\tfmt.Printf(\"Using %d goroutines\\n\", n)\n\tsem = make(chan bool, n)\n\ttimeStart := time.Now()\n\tbuild(Platform32Bit, ConfigRelease)\n\twg.Wait()\n\tfmt.Printf(\"total time: %s\\n\", time.Since(timeStart))\n}\n"
  },
  {
    "path": "tools/clang-fmt.go",
    "content": "package main\n\nimport (\n\t\"bytes\"\n\t\"crypto/sha1\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n/*\nSee .clang-fromat to see the style we're using.\nWe used to use Mozilla style for the base, but they changed the style a lot\nbetween 3.5 and 3.7. Our style is meant to not differ too much from Mozilla 3.5\nstyle (which we used for a bunch of files already)\n\nList of clang-format formats in 3.5 and 3.7: https://gist.github.com/kjk/298216da8cb4c665075b\n\nSummary of Mozilla clang-format style changes between clang 3.5 and 3.7\n\nMozilla 3.5\nConstructorInitializerIndentWidth: 4\nStandard:        Cpp03\nContinuationIndentWidth: 4\nAllowShortFunctionsOnASingleLine: All\nAlwaysBreakTemplateDeclarations: false\nBreakBeforeBinaryOperators: false\nBreakConstructorInitializersBeforeComma: false\nConstructorInitializerAllOnOneLineOrOnePerLine: true\nDerivePointerAlignment: true\nBreakBeforeBraces: Attach\n\nMozilla 3.7\nConstructorInitializerIndentWidth: 2\nStandard:        Cpp11\nContinuationIndentWidth: 2\nAllowShortFunctionsOnASingleLine: Inline\nAlwaysBreakTemplateDeclarations: true\nBreakBeforeBinaryOperators: None\nConstructorInitializerAllOnOneLineOrOnePerLine: false\nDerivePointerAlignment: false\nBreakBeforeBraces: Mozilla\n\nRemoved between 3.5 and 3.7:\nIndentFunctionDeclarationAfterType: false\n\nNew in 3.7:\nAlignAfterOpenBracket: true\nAlignConsecutiveAssignments: false\nAlignOperands:   true\nAllowShortCaseLabelsOnASingleLine: false\nAlwaysBreakAfterDefinitionReturnType: TopLevel\nBinPackArguments: true\nMacroBlockBegin: ''\nMacroBlockEnd:   ''\nObjCBlockIndentWidth: 2\nSpaceAfterCStyleCast: false\nSpacesInSquareBrackets: false\n\n\nDifferences between Chromium and Mozilla styles in clang 3.7\nMozilla\nAccessModifierOffset: -2\nAlignEscapedNewlinesLeft: false\nAlwaysBreakAfterDefinitionReturnType: TopLevel\nAlwaysBreakBeforeMultilineStrings: false\nBinPackParameters: true\nBreakBeforeBraces: Mozilla\nBreakConstructorInitializersBeforeComma: true\nConstructorInitializerAllOnOneLineOrOnePerLine: false\nConstructorInitializerIndentWidth: 2\nContinuationIndentWidth: 2\nCpp11BracedListStyle: false\nKeepEmptyLinesAtTheStartOfBlocks: true\nMacroBlockBegin: ''\nObjCSpaceAfterProperty: true\nPenaltyBreakBeforeFirstCallParameter: 19\nSpacesBeforeTrailingComments: 1\nStandard:        Cpp11\n\nChromium\nAccessModifierOffset: -1\nAlignEscapedNewlinesLeft: true\nAlwaysBreakAfterDefinitionReturnType: None\nAlwaysBreakBeforeMultilineStrings: true\nBinPackParameters: false\nBreakBeforeBraces: Attach\nBreakConstructorInitializersBeforeComma: false\nConstructorInitializerAllOnOneLineOrOnePerLine: true\nConstructorInitializerIndentWidth: 4\nContinuationIndentWidth: 4\nCpp11BracedListStyle: true\nKeepEmptyLinesAtTheStartOfBlocks: false\nMacroBlockBegin: '^IPC_END_MESSAGE_MAP$'\nObjCSpaceAfterProperty: false\nPenaltyBreakBeforeFirstCallParameter: 1\nSpacesBeforeTrailingComments: 2\nStandard:        Auto\n*/\n\nconst (\n\t// we don't want too many formatting changes per checkin, so we limit\n\t// number of files changed in one run\n\tmaxToChange = 2\n)\n\nvar (\n\tnChanged = 0\n)\n\nfunc fataliferr(err error) {\n\tif err != nil {\n\t\tfmt.Printf(\"err: %s\\n\", err)\n\t\tos.Exit(1)\n\t}\n}\n\nfunc toIntMust(s string) int {\n\tn, err := strconv.Atoi(s)\n\tfataliferr(err)\n\treturn n\n}\n\n// ensure we have at least version 3.7.0\nfunc verifyClangFormatVersion(exePath string) {\n\tcmd := exec.Command(exePath, \"--version\")\n\tout, err := cmd.Output()\n\tfataliferr(err)\n\t// output is in format: clang-format version 3.7.0 (tags/RELEASE_370/final)\n\ts := strings.TrimSpace(string(out))\n\tparts := strings.SplitN(s, \" \", 4)\n\tver := parts[2]\n\tparts = strings.Split(ver, \".\")\n\t// check version is at lest 3.7.0\n\tn1 := toIntMust(parts[0])\n\tn2 := toIntMust(parts[1])\n\tn3 := 0\n\tif len(parts) > 2 {\n\t\tn3 = toIntMust(parts[2])\n\t}\n\tn := n1*100 + n2*10 + n3\n\tif n < 370 {\n\t\tfmt.Printf(\"Version should be at least 3.7.0 (is %s)\\n\", ver)\n\t\tos.Exit(1)\n\t}\n}\n\nfunc ifCmdFailed(err error, out []byte, cmd *exec.Cmd) {\n\tif err == nil {\n\t\treturn\n\t}\n\ts := strings.Join(cmd.Args, \" \")\n\tfmt.Printf(\"'%s' failed with: '%s', out:\\n'%s'\\n\", s, err, string(out))\n\tos.Exit(1)\n}\n\nfunc isSrcFile(s string) bool {\n\text := strings.ToLower(filepath.Ext(s))\n\tswitch ext {\n\tcase \".cpp\", \".h\":\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc getSrcFilesMust(dir string) []string {\n\tfiles, err := ioutil.ReadDir(dir)\n\tfataliferr(err)\n\tvar srcFiles []string\n\tfor _, fi := range files {\n\t\tname := fi.Name()\n\t\tif isSrcFile(name) {\n\t\t\tsrcFiles = append(srcFiles, name)\n\t\t}\n\t}\n\treturn srcFiles\n}\n\nfunc getFileSha1Must(path string) []byte {\n\td, err := ioutil.ReadFile(path)\n\tfataliferr(err)\n\tres := sha1.Sum(d)\n\treturn res[:]\n}\n\nfunc formatFileInDirMust(exePath string, dir, file string) {\n\t// -style=file means: use .clang-format\n\tpath := filepath.Join(dir, file)\n\tsha1Before := getFileSha1Must(path)\n\tcmd := exec.Command(exePath, \"-style=file\", \"-i\", file)\n\tcmd.Dir = dir\n\tfmt.Printf(\"Running: '%s'\\n\", strings.Join(cmd.Args, \" \"))\n\tout, err := cmd.CombinedOutput()\n\tifCmdFailed(err, out, cmd)\n\tsha1After := getFileSha1Must(path)\n\tif !bytes.Equal(sha1Before, sha1After) {\n\t\tnChanged++\n\t\tif nChanged >= maxToChange {\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n}\n\nfunc formatFileMust(exePath string, filePath string) {\n\tdir := filepath.Dir(filePath)\n\tfile := filepath.Base(filePath)\n\tformatFileInDirMust(exePath, dir, file)\n}\n\nfunc runInDirMust(exePath string, dir string) {\n\tfiles := getSrcFilesMust(dir)\n\tfor _, file := range files {\n\t\tformatFileInDirMust(exePath, dir, file)\n\t}\n}\n\nfunc runOnFilesInDirMust(exePath, dir string, files []string) {\n\tfor _, file := range files {\n\t\tformatFileInDirMust(exePath, dir, file)\n\t}\n}\n\nfunc main() {\n\texePath, err := exec.LookPath(\"clang-format\")\n\tfataliferr(err)\n\tfmt.Printf(\"exe path: %s\\n\", exePath)\n\tverifyClangFormatVersion(exePath)\n\n\trunOnFilesInDirMust(exePath, \"src\", []string{\n\t\t\"ParseCommandLine.cpp\",\n\t\t\"ParseCommandLine.h\",\n\t\t\"Tests.cpp\",\n\t\t\"Tests.h\",\n\t\t//\"Print.cpp\",\n\t\t//\"Print.h\",\n\t})\n\n\t//runInDirMust(exePath, filepath.Join(\"src\", \"utils\"))\n\t//runInDirMust(exePath, filepath.Join(\"src\", \"mui\"))\n\t//runInDirMust(exePath, filepath.Join(\"src\", \"wingui\"))\n}\n"
  },
  {
    "path": "tools/diff-preview.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\t\"time\"\n)\n\n/*\nA tool to preview changes before checkin.\nUses WinMerge to do the diffing (http://winmerge.org/)\nAnohter option that wouldn't require winmerge is to make it a web server,\nimplement web-based ui and launch the browser.\n*/\n\nvar (\n\tgitPath      string\n\twinMergePath string\n\ttempDir      string\n)\n\nconst (\n\tModified = iota\n\tAdded\n\tDeleted\n\tNotCheckedIn\n)\n\ntype GitChange struct {\n\tType int // Modified, Added etc.\n\tPath string\n\tName string\n}\n\nfunc printStack() {\n\tbuf := make([]byte, 1024*164)\n\tn := runtime.Stack(buf, false)\n\tfmt.Printf(\"%s\", buf[:n])\n}\n\nfunc fatalf(format string, args ...interface{}) {\n\tfmt.Printf(format, args...)\n\tprintStack()\n\tos.Exit(1)\n}\n\nfunc fatalif(cond bool, format string, args ...interface{}) {\n\tif cond {\n\t\tfmt.Printf(format, args...)\n\t\tprintStack()\n\t\tos.Exit(1)\n\t}\n}\n\nfunc fataliferr(err error) {\n\tif err != nil {\n\t\tfatalf(\"%s\\n\", err.Error())\n\t}\n}\n\nfunc toTrimmedLines(d []byte) []string {\n\tlines := strings.Split(string(d), \"\\n\")\n\ti := 0\n\tfor _, l := range lines {\n\t\tl = strings.TrimSpace(l)\n\t\t// remove empty lines\n\t\tif len(l) > 0 {\n\t\t\tlines[i] = l\n\t\t\ti++\n\t\t}\n\t}\n\treturn lines[:i]\n}\n\nfunc detectExeMust(name string) string {\n\tpath, err := exec.LookPath(name)\n\tif err == nil {\n\t\tfmt.Printf(\"'%s' is '%s'\\n\", name, path)\n\t\treturn path\n\t}\n\tfmt.Printf(\"Couldn't find '%s'\\n\", name)\n\tfataliferr(err)\n\t// TODO: could also try known locations for WinMerge in $env[\"ProgramFiles(x86)\"]/WinMerge/WinMergeU.exe\n\treturn \"\"\n}\n\nfunc detectExesMust() {\n\tgitPath = detectExeMust(\"git\")\n\twinMergePath = detectExeMust(\"WinMergeU\")\n}\n\nfunc getWinTempDirMust() string {\n\tdir := os.Getenv(\"TEMP\")\n\tif dir != \"\" {\n\t\treturn dir\n\t}\n\tdir = os.Getenv(\"TMP\")\n\tfatalif(dir == \"\", \"env variable TEMP and TMP are not set\\n\")\n\treturn dir\n}\n\nfunc createTempDirMust() {\n\tdir := getWinTempDirMust()\n\t// we want a stable name so that we can clean up old junk\n\ttempDir = filepath.Join(dir, \"sum-diff-preview\")\n\terr := os.MkdirAll(tempDir, 0755)\n\tfataliferr(err)\n}\n\nfunc runCmd(exePath string, args ...string) ([]byte, error) {\n\tcmd := exec.Command(exePath, args...)\n\tfmt.Printf(\"running: %s %v\\n\", filepath.Base(exePath), args)\n\treturn cmd.Output()\n}\n\nfunc runCmdNoWait(exePath string, args ...string) error {\n\tcmd := exec.Command(exePath, args...)\n\tfmt.Printf(\"running: %s %v\\n\", filepath.Base(exePath), args)\n\treturn cmd.Start()\n}\n\nfunc parseGitStatusLineMust(s string) *GitChange {\n\tc := &GitChange{}\n\tparts := strings.SplitN(s, \" \", 2)\n\tfatalif(len(parts) != 2, \"invalid line: '%s'\\n\", s)\n\tswitch parts[0] {\n\tcase \"M\":\n\t\tc.Type = Modified\n\tcase \"A\":\n\t\tc.Type = Added\n\tcase \"D\":\n\t\tc.Type = Deleted\n\tcase \"??\":\n\t\tc.Type = NotCheckedIn\n\tdefault:\n\t\tfatalif(true, \"invalid line: '%s'\\n\", s)\n\t}\n\tc.Path = strings.TrimSpace(parts[1])\n\tc.Name = filepath.Base(c.Path)\n\treturn c\n}\n\nfunc parseGitStatusMust(out []byte, includeNotCheckedIn bool) []*GitChange {\n\tvar res []*GitChange\n\tlines := toTrimmedLines(out)\n\tfor _, l := range lines {\n\t\tc := parseGitStatusLineMust(l)\n\t\tif !includeNotCheckedIn && c.Type == NotCheckedIn {\n\t\t\tcontinue\n\t\t}\n\t\tres = append(res, c)\n\t}\n\treturn res\n}\n\nfunc gitStatusMust() []*GitChange {\n\tout, err := runCmd(gitPath, \"status\", \"--porcelain\")\n\tfataliferr(err)\n\treturn parseGitStatusMust(out, false)\n}\n\nfunc gitGetFileContentHeadMust(path string) []byte {\n\tloc := \"HEAD:\" + path\n\tout, err := runCmd(gitPath, \"show\", loc)\n\tfataliferr(err)\n\treturn out\n}\n\n// delete directories older than 1 day in tempDir\nfunc deleteOldDirs() {\n\tfiles, err := ioutil.ReadDir(tempDir)\n\tfataliferr(err)\n\tfor _, fi := range files {\n\t\tif !fi.IsDir() {\n\t\t\t// we shouldn't create anything but dirs\n\t\t\tcontinue\n\t\t}\n\t\tage := time.Now().Sub(fi.ModTime())\n\t\tpath := filepath.Join(tempDir, fi.Name())\n\t\tif age > time.Hour*24 {\n\t\t\tfmt.Printf(\"Deleting %s because older than 1 day\\n\", path)\n\t\t\terr = os.RemoveAll(path)\n\t\t\tfataliferr(err)\n\t\t} else {\n\t\t\tfmt.Printf(\"Not deleting %s because younger than 1 day (%s)\\n\", path, age)\n\t\t}\n\t}\n}\n\nfunc getBeforeAfterDirs(dir string) (string, string) {\n\tdirBefore := filepath.Join(dir, \"before\")\n\tdirAfter := filepath.Join(dir, \"after\")\n\treturn dirBefore, dirAfter\n}\n\n// http://manual.winmerge.org/Command_line.html\nfunc runWinMerge(dir string) {\n\tdirBefore, dirAfter := getBeforeAfterDirs(dir)\n\t/*\n\t\t/e : close with Esc\n\t\t/u : don't add paths to MRU\n\t\t/wl, wr : open left/right as read-only\n\t\t/r : recursive compare\n\t*/\n\terr := runCmdNoWait(winMergePath, \"/u\", \"/wl\", \"/wr\", dirBefore, dirAfter)\n\tfataliferr(err)\n}\n\nfunc catGitHeadToFileMust(dst, gitPath string) {\n\tfmt.Printf(\"catGitHeadToFileMust: %s => %s\\n\", gitPath, dst)\n\td := gitGetFileContentHeadMust(gitPath)\n\tf, err := os.Create(dst)\n\tfataliferr(err)\n\tdefer f.Close()\n\t_, err = f.Write(d)\n\tfataliferr(err)\n}\n\nfunc createEmptyFileMust(path string) {\n\tf, err := os.Create(path)\n\tfataliferr(err)\n\tf.Close()\n}\n\nfunc copyFileMust(dst, src string) {\n\t// ensure windows-style dir separator\n\tdst = strings.Replace(dst, \"/\", \"\\\\\", -1)\n\tsrc = strings.Replace(src, \"/\", \"\\\\\", -1)\n\n\tfdst, err := os.Create(dst)\n\tfataliferr(err)\n\tdefer fdst.Close()\n\tfsrc, err := os.Open(src)\n\tfataliferr(err)\n\tdefer fsrc.Close()\n\t_, err = io.Copy(fdst, fsrc)\n\tfataliferr(err)\n}\n\nfunc copyFileAddedMust(dirBefore, dirAfter string, change *GitChange) {\n\t// empty file in before, content in after\n\tpath := filepath.Join(dirBefore, change.Name)\n\tcreateEmptyFileMust(path)\n\tpath = filepath.Join(dirAfter, change.Name)\n\tcopyFileMust(path, change.Path)\n}\n\nfunc copyFileDeletedMust(dirBefore, dirAfter string, change *GitChange) {\n\t// empty file in after\n\tpath := filepath.Join(dirAfter, change.Name)\n\tcreateEmptyFileMust(path)\n\t// version from HEAD in before\n\tpath = filepath.Join(dirBefore, change.Name)\n\tcatGitHeadToFileMust(path, change.Path)\n}\n\nfunc copyFileModifiedMust(dirBefore, dirAfter string, change *GitChange) {\n\t// current version on disk in after\n\tpath := filepath.Join(dirAfter, change.Name)\n\tcopyFileMust(path, change.Path)\n\t// version from HEAD in before\n\tpath = filepath.Join(dirBefore, change.Name)\n\tcatGitHeadToFileMust(path, change.Path)\n}\n\nfunc copyFileChangeMust(dir string, change *GitChange) {\n\tdirBefore, dirAfter := getBeforeAfterDirs(dir)\n\tswitch change.Type {\n\tcase Added:\n\t\tcopyFileAddedMust(dirBefore, dirAfter, change)\n\tcase Modified:\n\t\tcopyFileModifiedMust(dirBefore, dirAfter, change)\n\tcase Deleted:\n\t\tcopyFileModifiedMust(dirBefore, dirAfter, change)\n\tdefault:\n\t\tfatalif(true, \"unknown change %+v\\n\", change)\n\t}\n}\n\nfunc copyFiles(dir string, changes []*GitChange) {\n\tdirBefore, dirAfter := getBeforeAfterDirs(dir)\n\terr := os.MkdirAll(dirBefore, 0755)\n\tfataliferr(err)\n\terr = os.MkdirAll(dirAfter, 0755)\n\tfataliferr(err)\n\tfor _, change := range changes {\n\t\tcopyFileChangeMust(dir, change)\n\t}\n}\n\nfunc hasGitDirMust(dir string) bool {\n\tfiles, err := ioutil.ReadDir(dir)\n\tfataliferr(err)\n\tfor _, fi := range files {\n\t\tif strings.ToLower(fi.Name()) == \".git\" {\n\t\t\treturn fi.IsDir()\n\t\t}\n\t}\n\treturn false\n}\n\n// git status returns names relative to root of\nfunc cdToGitRoot() {\n\tvar newDir string\n\tdir, err := os.Getwd()\n\tfataliferr(err)\n\tfor {\n\t\tif hasGitDirMust(dir) {\n\t\t\tbreak\n\t\t}\n\t\tnewDir = filepath.Dir(dir)\n\t\tfatalif(dir == newDir, \"dir == newDir (%s == %s)\", dir, newDir)\n\t\tdir = newDir\n\t}\n\tif newDir != \"\" {\n\t\tfmt.Printf(\"Changed current dir to: '%s'\\n\", newDir)\n\t\tos.Chdir(newDir)\n\t}\n}\n\nfunc main() {\n\tdetectExesMust()\n\tcreateTempDirMust()\n\tfmt.Printf(\"temp dir: %s\\n\", tempDir)\n\tdeleteOldDirs()\n\n\tcdToGitRoot()\n\tchanges := gitStatusMust()\n\tif len(changes) == 0 {\n\t\tfmt.Printf(\"No changes to preview!\")\n\t\tos.Exit(0)\n\t}\n\tfmt.Printf(\"%d change(s)\\n\", len(changes))\n\n\t// TODO: verify GitChange.Name is unique in changes\n\tsubDir := time.Now().Format(\"2006-01-02_15_04_05\")\n\tdir := filepath.Join(tempDir, subDir)\n\terr := os.MkdirAll(dir, 0755)\n\tfataliferr(err)\n\tcopyFiles(dir, changes)\n\trunWinMerge(dir)\n}\n"
  },
  {
    "path": "tools/efi/Dia2Subset.h",
    "content": "#ifndef Dia2Subset_h\r\n#define Dia2Subset_h\r\n\r\n// Dia2.h is huge (>350 kb) and not always present\r\n// This is a subset that is good enough for us\r\n\r\nenum SymTagEnum\r\n{\r\n    SymTagNull,\r\n    SymTagExe,\r\n    SymTagCompiland,\r\n    SymTagCompilandDetails,\r\n    SymTagCompilandEnv,\r\n    SymTagFunction,\r\n    SymTagBlock,\r\n    SymTagData,\r\n    SymTagAnnotation,\r\n    SymTagLabel,\r\n    SymTagPublicSymbol,\r\n    SymTagUDT,\r\n    SymTagEnum,\r\n    SymTagFunctionType,\r\n    SymTagPointerType,\r\n    SymTagArrayType,\r\n    SymTagBaseType,\r\n    SymTagTypedef,\r\n    SymTagBaseClass,\r\n    SymTagFriend,\r\n    SymTagFunctionArgType,\r\n    SymTagFuncDebugStart,\r\n    SymTagFuncDebugEnd,\r\n    SymTagUsingNamespace,\r\n    SymTagVTableShape,\r\n    SymTagVTable,\r\n    SymTagCustom,\r\n    SymTagThunk,\r\n    SymTagCustomType,\r\n    SymTagManagedType,\r\n    SymTagDimension,\r\n    SymTagMax\r\n};\r\n\r\nenum NameSearchOptions { \r\n    nsNone,\r\n    nsfCaseSensitive     = 0x1,\r\n    nsfCaseInsensitive   = 0x2,\r\n    nsfFNameExt          = 0x4,\r\n    nsfRegularExpression = 0x8,\r\n    nsfUndecoratedName   = 0x10,\r\n\r\n    // For backward compatibility:\r\n    nsCaseSensitive           = nsfCaseSensitive,\r\n    nsCaseInsensitive         = nsfCaseInsensitive,\r\n    nsFNameExt                = nsfCaseInsensitive | nsfFNameExt,\r\n    nsRegularExpression       = nsfRegularExpression | nsfCaseSensitive,\r\n    nsCaseInRegularExpression = nsfRegularExpression | nsfCaseInsensitive\r\n};\r\n\r\nenum LocationType { \r\n   LocIsNull,\r\n   LocIsStatic,\r\n   LocIsTLS,\r\n   LocIsRegRel,\r\n   LocIsThisRel,\r\n   LocIsEnregistered,\r\n   LocIsBitField,\r\n   LocIsSlot,\r\n   LocIsIlRel,\r\n   LocInMetaData,\r\n   LocIsConstant,\r\n   LocTypeMax\r\n};\r\n\r\nenum UdtKind { \r\n   UdtStruct,\r\n   UdtClass,\r\n   UdtUnion\r\n};\r\n\r\nclass IDiaEnumSymbols;\r\nclass IDiaEnumSymbolsByAddr;\r\nclass IDiaEnumTables;\r\n\r\nclass IDiaDataSource;\r\nclass IDiaSession;\r\n\r\nclass IDiaSymbol;\r\nclass IDiaSectionContrib;\r\n\r\nclass IDiaTable;\r\n\r\n// not transcribed here:\r\nclass IDiaSourceFile;\r\n\r\nclass IDiaEnumSourceFiles;\r\nclass IDiaEnumLineNumbers;\r\nclass IDiaEnumDebugStreams;\r\nclass IDiaEnumInjectedSources;\r\n\r\nclass IDiaEnumSymbols : public IUnknown\r\n{\r\npublic:\r\n    virtual HRESULT __stdcall get__NewEnum(IUnknown **ret) = 0;\r\n    virtual HRESULT __stdcall get_Count(LONG *ret) = 0;\r\n\r\n    virtual HRESULT __stdcall Item(DWORD index,IDiaSymbol **symbol) = 0;\r\n    virtual HRESULT __stdcall Next(ULONG celt,IDiaSymbol **rgelt,ULONG *pceltFetched) = 0;\r\n    virtual HRESULT __stdcall Skip(ULONG celt) = 0;\r\n    virtual HRESULT __stdcall Reset() = 0;\r\n\r\n    virtual HRESULT __stdcall Clone(IDiaEnumSymbols **penum) = 0;\r\n};\r\n\r\nclass IDiaEnumSymbolsByAddr : public IUnknown\r\n{\r\npublic:\r\n    virtual HRESULT __stdcall symbolByAddr(DWORD isect,DWORD offset,IDiaSymbol** ppSymbol) = 0;\r\n    virtual HRESULT __stdcall symbolByRVA(DWORD relativeVirtualAddress,IDiaSymbol** ppSymbol) = 0;\r\n    virtual HRESULT __stdcall symbolByVA(ULONGLONG virtualAddress,IDiaSymbol** ppSymbol) = 0;\r\n\r\n    virtual HRESULT __stdcall Next(ULONG celt,IDiaSymbol ** rgelt,ULONG* pceltFetched) = 0;\r\n    virtual HRESULT __stdcall Prev(ULONG celt,IDiaSymbol ** rgelt,ULONG * pceltFetched) = 0;\r\n\r\n    virtual HRESULT __stdcall Clone(IDiaEnumSymbolsByAddr **ppenum) = 0;\r\n};\r\n\r\nclass IDiaEnumTables : public IUnknown\r\n{\r\npublic:\r\n    virtual HRESULT __stdcall get__NewEnum(IUnknown **ret) = 0;\r\n    virtual HRESULT __stdcall get_Count(LONG *ret) = 0;\r\n\r\n    virtual HRESULT __stdcall Item(VARIANT index,IDiaTable **table) = 0;\r\n    virtual HRESULT __stdcall Next(ULONG celt,IDiaTable ** rgelt,ULONG *pceltFetched) = 0;\r\n    virtual HRESULT __stdcall Skip(ULONG celt) = 0;\r\n    virtual HRESULT __stdcall Reset() = 0;\r\n\r\n    virtual HRESULT __stdcall Clone(IDiaEnumTables **ppenum) = 0;\r\n};\r\n\r\nclass IDiaDataSource : public IUnknown\r\n{\r\npublic:\r\n    virtual HRESULT __stdcall get_lastError(BSTR *ret) = 0;\r\n\r\n    virtual HRESULT __stdcall loadDataFromPdb(LPCOLESTR pdbPath) = 0;\r\n    virtual HRESULT __stdcall loadAndValidateDataFromPdb(LPCOLESTR pdbPath,GUID *pcsig70,DWORD sig,DWORD age) = 0;\r\n    virtual HRESULT __stdcall loadDataForExe(LPCOLESTR executable,LPCOLESTR searchPath,IUnknown *pCallback) = 0;\r\n    virtual HRESULT __stdcall loadDataFromIStream(IStream *pIStream) = 0;\r\n\r\n    virtual HRESULT __stdcall openSession(IDiaSession **ppSession) = 0;\r\n};\r\n\r\nclass IDiaSession : public IUnknown\r\n{\r\npublic:\r\n    virtual HRESULT __stdcall get_loadAddress(ULONGLONG *ret) = 0;\r\n    virtual HRESULT __stdcall put_loadAddress(ULONGLONG val) = 0;\r\n    virtual HRESULT __stdcall get_globalScope(IDiaSymbol **sym) = 0;\r\n\r\n    virtual HRESULT __stdcall getEnumTables(IDiaEnumTables** ppEnumTables) = 0;\r\n    virtual HRESULT __stdcall getSymbolsByAddr(IDiaEnumSymbolsByAddr** ppEnumbyAddr) = 0;\r\n\r\n    virtual HRESULT __stdcall findChildren(IDiaSymbol* parent,enum SymTagEnum symtag,LPCOLESTR name,DWORD compareFlags,IDiaEnumSymbols** ppResult) = 0;\r\n    virtual HRESULT __stdcall findSymbolByAddr(DWORD isect,DWORD offset,enum SymTagEnum symtag,IDiaSymbol** ppSymbol) = 0;\r\n    virtual HRESULT __stdcall findSymbolByRVA(DWORD rva,enum SymTagEnum symtag,IDiaSymbol** ppSymbol) = 0;\r\n    virtual HRESULT __stdcall findSymbolByVA(ULONGLONG va,enum SymTagEnum symtag,IDiaSymbol** ppSymbol) = 0;\r\n    virtual HRESULT __stdcall findSymbolByToken(ULONG token,enum SymTagEnum symtag,IDiaSymbol** ppSymbol) = 0;\r\n    virtual HRESULT __stdcall symsAreEquiv(IDiaSymbol* symbolA,IDiaSymbol* symbolB) = 0;\r\n    virtual HRESULT __stdcall symbolById(DWORD id,IDiaSymbol** ppSymbol) = 0;\r\n    virtual HRESULT __stdcall findSymbolByRVAEx(DWORD rva,enum SymTagEnum symtag,IDiaSymbol** ppSymbol,long* displacement) = 0;\r\n    virtual HRESULT __stdcall findSymbolByVAEx(ULONGLONG va,enum SymTagEnum symtag,IDiaSymbol** ppSymbol,long* displacement) = 0;\r\n\r\n    virtual HRESULT __stdcall findFile(IDiaSymbol* pCompiland,LPCOLESTR name,DWORD compareFlags,IDiaEnumSourceFiles** ppResult) = 0;\r\n    virtual HRESULT __stdcall findFileById(DWORD uniqueId,IDiaSourceFile** ppResult) = 0;\r\n\r\n    virtual HRESULT __stdcall findLines(IDiaSymbol* compiland,IDiaSourceFile* file,IDiaEnumLineNumbers** ppResult) = 0;\r\n    virtual HRESULT __stdcall findLinesByAddr(DWORD seg,DWORD offset,DWORD length,IDiaEnumLineNumbers** ppResult) = 0;\r\n    virtual HRESULT __stdcall findLinesByRVA(DWORD rva,DWORD length,IDiaEnumLineNumbers** ppResult) = 0;\r\n    virtual HRESULT __stdcall findLinesByVA(ULONGLONG va,DWORD length,IDiaEnumLineNumbers** ppResult) = 0;\r\n    virtual HRESULT __stdcall findLinesByLinenum(IDiaSymbol* compiland,IDiaSourceFile* file,DWORD linenum,DWORD column,IDiaEnumLineNumbers** ppResult) = 0;\r\n\r\n    virtual HRESULT __stdcall findInjectedSource(LPCOLESTR srcFile,IDiaEnumInjectedSources** ppResult) = 0;\r\n    virtual HRESULT __stdcall getEnumDebugStreams(IDiaEnumDebugStreams** ppEnumDebugStreams) = 0;\r\n};\r\n\r\n//MIDL_INTERFACE(\"cb787b2f-bd6c-4635-ba52-933126bd2dcd\")\r\nclass IDiaSymbol : public IUnknown\r\n{\r\npublic:\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_symIndexId( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_symTag( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_name( \r\n        /* [retval][out] */ BSTR *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_lexicalParent( \r\n        /* [retval][out] */ IDiaSymbol **pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_classParent( \r\n        /* [retval][out] */ IDiaSymbol **pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_type( \r\n        /* [retval][out] */ IDiaSymbol **pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_dataKind( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_locationType( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_addressSection( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_addressOffset( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_relativeVirtualAddress( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_virtualAddress( \r\n        /* [retval][out] */ ULONGLONG *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_registerId( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_offset( \r\n        /* [retval][out] */ LONG *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_length( \r\n        /* [retval][out] */ ULONGLONG *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_slot( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_volatileType( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_constType( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_unalignedType( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_access( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_libraryName( \r\n        /* [retval][out] */ BSTR *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_platform( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_language( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_editAndContinueEnabled( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_frontEndMajor( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_frontEndMinor( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_frontEndBuild( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_backEndMajor( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_backEndMinor( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_backEndBuild( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_sourceFileName( \r\n        /* [retval][out] */ BSTR *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_unused( \r\n        /* [retval][out] */ BSTR *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_thunkOrdinal( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_thisAdjust( \r\n        /* [retval][out] */ LONG *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_virtualBaseOffset( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_virtual( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_intro( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_pure( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_callingConvention( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_value( \r\n        /* [retval][out] */ VARIANT *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_baseType( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_token( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_timeStamp( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_guid( \r\n        /* [retval][out] */ GUID *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_symbolsFileName( \r\n        /* [retval][out] */ BSTR *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_reference( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_count( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_bitPosition( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_arrayIndexType( \r\n        /* [retval][out] */ IDiaSymbol **pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_packed( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_constructor( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_overloadedOperator( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_nested( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_hasNestedTypes( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_hasAssignmentOperator( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_hasCastOperator( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_scoped( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_virtualBaseClass( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_indirectVirtualBaseClass( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_virtualBasePointerOffset( \r\n        /* [retval][out] */ LONG *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_virtualTableShape( \r\n        /* [retval][out] */ IDiaSymbol **pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_lexicalParentId( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_classParentId( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_typeId( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_arrayIndexTypeId( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_virtualTableShapeId( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_code( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_function( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_managed( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_msil( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_virtualBaseDispIndex( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_undecoratedName( \r\n        /* [retval][out] */ BSTR *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_age( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_signature( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_compilerGenerated( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_addressTaken( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_rank( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_lowerBound( \r\n        /* [retval][out] */ IDiaSymbol **pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_upperBound( \r\n        /* [retval][out] */ IDiaSymbol **pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_lowerBoundId( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_upperBoundId( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual HRESULT STDMETHODCALLTYPE get_dataBytes( \r\n        /* [in] */ DWORD cbData,\r\n        /* [out] */ DWORD *pcbData,\r\n        /* [size_is][out] */ BYTE *pbData) = 0;\r\n    virtual HRESULT STDMETHODCALLTYPE findChildren( \r\n        /* [in] */ enum SymTagEnum symtag,\r\n        /* [in] */ LPCOLESTR name,\r\n        /* [in] */ DWORD compareFlags,\r\n        /* [out] */ IDiaEnumSymbols **ppResult) = 0;\r\n    virtual HRESULT STDMETHODCALLTYPE findChildrenEx( \r\n        /* [in] */ enum SymTagEnum symtag,\r\n        /* [in] */ LPCOLESTR name,\r\n        /* [in] */ DWORD compareFlags,\r\n        /* [out] */ IDiaEnumSymbols **ppResult) = 0;\r\n    virtual HRESULT STDMETHODCALLTYPE findChildrenExByAddr( \r\n        /* [in] */ enum SymTagEnum symtag,\r\n        /* [in] */ LPCOLESTR name,\r\n        /* [in] */ DWORD compareFlags,\r\n        /* [in] */ DWORD isect,\r\n        /* [in] */ DWORD offset,\r\n        /* [out] */ IDiaEnumSymbols **ppResult) = 0;\r\n    virtual HRESULT STDMETHODCALLTYPE findChildrenExByVA( \r\n        /* [in] */ enum SymTagEnum symtag,\r\n        /* [in] */ LPCOLESTR name,\r\n        /* [in] */ DWORD compareFlags,\r\n        /* [in] */ ULONGLONG va,\r\n        /* [out] */ IDiaEnumSymbols **ppResult) = 0;\r\n    virtual HRESULT STDMETHODCALLTYPE findChildrenExByRVA( \r\n        /* [in] */ enum SymTagEnum symtag,\r\n        /* [in] */ LPCOLESTR name,\r\n        /* [in] */ DWORD compareFlags,\r\n        /* [in] */ DWORD rva,\r\n        /* [out] */ IDiaEnumSymbols **ppResult) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_targetSection( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_targetOffset( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_targetRelativeVirtualAddress( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_targetVirtualAddress( \r\n        /* [retval][out] */ ULONGLONG *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_machineType( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_oemId( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_oemSymbolId( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual HRESULT STDMETHODCALLTYPE get_types( \r\n        /* [in] */ DWORD cTypes,\r\n        /* [out] */ DWORD *pcTypes,\r\n        /* [size_is][size_is][out] */ IDiaSymbol **pTypes) = 0;\r\n    virtual HRESULT STDMETHODCALLTYPE get_typeIds( \r\n        /* [in] */ DWORD cTypeIds,\r\n        /* [out] */ DWORD *pcTypeIds,\r\n        /* [size_is][out] */ DWORD *pdwTypeIds) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_objectPointerType( \r\n        /* [retval][out] */ IDiaSymbol **pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_udtKind( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual HRESULT STDMETHODCALLTYPE get_undecoratedNameEx( \r\n        /* [in] */ DWORD undecorateOptions,\r\n        /* [out] */ BSTR *name) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_noReturn( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_customCallingConvention( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_noInline( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_optimizedCodeDebugInfo( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_notReached( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_interruptReturn( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_farReturn( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_isStatic( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_hasDebugInfo( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_isLTCG( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_isDataAligned( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_hasSecurityChecks( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_compilerName( \r\n        /* [retval][out] */ BSTR *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_hasAlloca( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_hasSetJump( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_hasLongJump( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_hasInlAsm( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_hasEH( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_hasSEH( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_hasEHa( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_isNaked( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_isAggregated( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_isSplitted( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_container( \r\n        /* [retval][out] */ IDiaSymbol **pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_inlSpec( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_noStackOrdering( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_virtualBaseTableType( \r\n        /* [retval][out] */ IDiaSymbol **pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_hasManagedCode( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_isHotpatchable( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_isCVTCIL( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_isMSILNetmodule( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_isCTypes( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_isStripped( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_frontEndQFE( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_backEndQFE( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_wasInlined( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_strictGSCheck( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_isCxxReturnUdt( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_isConstructorVirtualBase( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_RValueReference( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_unmodifiedType( \r\n        /* [retval][out] */ IDiaSymbol **pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_framePointerPresent( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_isSafeBuffers( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_intrinsic( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_sealed( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_hfaFloat( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_hfaDouble( \r\n        /* [retval][out] */ BOOL *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_liveRangeStartAddressSection( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_liveRangeStartAddressOffset( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_liveRangeStartRelativeVirtualAddress( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_countLiveRanges( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_liveRangeLength( \r\n        /* [retval][out] */ ULONGLONG *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_offsetInUdt( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_paramBasePointerRegisterId( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n    virtual /* [id][helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_localBasePointerRegisterId( \r\n        /* [retval][out] */ DWORD *pRetVal) = 0;\r\n};\r\n\r\nclass IDiaSectionContrib : public IUnknown\r\n{\r\npublic:\r\n    virtual HRESULT __stdcall get_compiland(IDiaSymbol **ret) = 0;\r\n    virtual HRESULT __stdcall get_addressSection(DWORD *ret) = 0;\r\n    virtual HRESULT __stdcall get_addressOffset(DWORD *ret) = 0;\r\n    virtual HRESULT __stdcall get_relativeVirtualAddress(DWORD *ret) = 0;\r\n    virtual HRESULT __stdcall get_virtualAddress(ULONGLONG *ret) = 0;\r\n    virtual HRESULT __stdcall get_length(DWORD *ret) = 0;\r\n\r\n    virtual HRESULT __stdcall get_notPaged(BOOL *ret) = 0;\r\n    virtual HRESULT __stdcall get_code(BOOL *ret) = 0;\r\n    virtual HRESULT __stdcall get_initializedData(BOOL *ret) = 0;\r\n    virtual HRESULT __stdcall get_uninitializedData(BOOL *ret) = 0;\r\n    virtual HRESULT __stdcall get_remove(BOOL *ret) = 0;\r\n    virtual HRESULT __stdcall get_comdat(BOOL *ret) = 0;\r\n    virtual HRESULT __stdcall get_discardable(BOOL *ret) = 0;\r\n    virtual HRESULT __stdcall get_notCached(BOOL *ret) = 0;\r\n    virtual HRESULT __stdcall get_share(BOOL *ret) = 0;\r\n    virtual HRESULT __stdcall get_execute(BOOL *ret) = 0;\r\n    virtual HRESULT __stdcall get_read(BOOL *ret) = 0;\r\n    virtual HRESULT __stdcall get_write(BOOL *ret) = 0;\r\n    virtual HRESULT __stdcall get_dataCrc(DWORD *ret) = 0;\r\n    virtual HRESULT __stdcall get_relocationsaCrc(DWORD *ret) = 0;\r\n    virtual HRESULT __stdcall get_compilandId(DWORD *ret) = 0;\r\n};\r\n\r\nclass IDiaTable : public IEnumUnknown\r\n{\r\npublic:\r\n    virtual HRESULT __stdcall get__NewEnum(IUnknown **ret) = 0;\r\n    virtual HRESULT __stdcall get_name(BSTR *ret) = 0;\r\n    virtual HRESULT __stdcall get_Count(LONG *ret) = 0;\r\n\r\n    virtual HRESULT __stdcall Item(DWORD index,IUnknown **element) = 0;\r\n};\r\n\r\nclass DECLSPEC_UUID(\"e60afbee-502d-46ae-858f-8272a09bd707\") DiaSource71;\r\nclass DECLSPEC_UUID(\"bce36434-2c24-499e-bf49-8bd99b0eeb68\") DiaSource80;\r\nclass DECLSPEC_UUID(\"4C41678E-887B-4365-A09E-925D28DB33C2\") DiaSource90;\r\nclass DECLSPEC_UUID(\"B86AE24D-BF2F-4ac9-B5A2-34B14E4CE11D\") DiaSource100;\r\nclass DECLSPEC_UUID(\"761D3BCD-1304-41D5-94E8-EAC54E4AC172\") DiaSource110;\r\nclass DECLSPEC_UUID(\"79f1bb5f-b66e-48e5-b6a9-1545c323ca3d\") IDiaDataSource;\r\n\r\n#endif\r\n"
  },
  {
    "path": "tools/efi/Util.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"Dict.h\"\r\n\r\n#include \"Dia2Subset.h\"\r\n#include \"Util.h\"\r\n\r\nvoid log(const char *s)\r\n{\r\n    fprintf(stderr, s);\r\n}\r\n\r\nstatic const struct DLLDesc\r\n{\r\n    const char *Filename;\r\n    IID UseCLSID;\r\n} msdiaDlls[] = {\r\n    // this list is complete as of April 2013. In the future new msdia version\r\n    // could be added, in which case it should be added to the top of this list\r\n    \"msdia110.dll\", __uuidof(DiaSource110),     // Visual Studio 2012\r\n    \"msdia100.dll\", __uuidof(DiaSource100),     // Visual Studio 2010\r\n    // Note: there are also older version (msdia90.dll, msdia80.dll, msdia71.dll)\r\n    // but they are not compatible because vtable layout for IDiaSymbol\r\n    // changed in msdia100.dll\r\n    0\r\n};\r\n\r\n// note: we leak g_dia_source but who cares\r\nIDiaDataSource *g_dia_source = 0;\r\n\r\nIDiaDataSource *LoadDia()\r\n{\r\n    if (g_dia_source)\r\n        return g_dia_source;\r\n\r\n    HRESULT hr = E_FAIL;\r\n\r\n    // Try creating things \"the official way\"\r\n    for (int i=0; msdiaDlls[i].Filename; i++)\r\n    {\r\n        hr = CoCreateInstance(msdiaDlls[i].UseCLSID,0,CLSCTX_INPROC_SERVER,\r\n            __uuidof(IDiaDataSource),(void**) &g_dia_source);\r\n\r\n        if (SUCCEEDED(hr)) {\r\n            //logf(\"using registered dia %s\\n\", msdiaDlls[i].Filename);\r\n            return g_dia_source;\r\n        }\r\n    }\r\n\r\n    // None of the classes are registered, but most programmers will have the\r\n    // DLLs on their system anyway and can copy it over; try loading it directly.\r\n\r\n    for (int i=0; msdiaDlls[i].Filename; i++)\r\n    {\r\n        const char *dllName = msdiaDlls[i].Filename;\r\n        // TODO: also try to find Visual Studio directories where it might exist. On\r\n        // my system:\r\n        // c:/Program Files/Common Files/microsoft shared/VC/msdia100.dll\r\n        // c:/Program Files/Common Files/microsoft shared/VC/msdia90.dll\r\n        // c:/Program Files/Microsoft Visual Studio 10.0/Common7/Packages/Debugger/msdia100.dll\r\n        // c:/Program Files/Microsoft Visual Studio 10.0/DIA SDK/bin/msdia100.dll\r\n        // c:/Program Files/Microsoft Visual Studio 11.0/Common7/IDE/Remote Debugger/x86/msdia110.dll\r\n        // c:/Program Files/Microsoft Visual Studio 11.0/Common7/Packages/Debugger/msdia110.dll\r\n        // c:/Program Files/Microsoft Visual Studio 11.0/DIA SDK/bin/msdia110.dll\r\n        // c:/Program Files/Windows Kits/8.0/App Certification Kit/msdia100.dll\r\n        // I'm sure Visual Studio 8 also puts them somewhere\r\n\r\n        HMODULE hDll = LoadLibraryA(dllName);\r\n        if (!hDll)\r\n            continue;\r\n\r\n        typedef HRESULT (__stdcall *PDllGetClassObject)(REFCLSID rclsid,REFIID riid,void** ppvObj);\r\n        PDllGetClassObject DllGetClassObject = (PDllGetClassObject) GetProcAddress(hDll,\"DllGetClassObject\");\r\n        if (DllGetClassObject)\r\n        {\r\n            // first create a class factory\r\n            IClassFactory *classFactory;\r\n            hr = DllGetClassObject(msdiaDlls[i].UseCLSID,IID_IClassFactory,(void**) &classFactory);\r\n            if (SUCCEEDED(hr))\r\n            {\r\n                hr = classFactory->CreateInstance(0,__uuidof(IDiaDataSource),(void**) &g_dia_source);\r\n                classFactory->Release();\r\n                //logf(\"using loaded dia %s\\n\", dllName);\r\n                return g_dia_source;\r\n            } else {\r\n                logf(\"DllGetClassObject() in %s failed\", dllName);\r\n            }\r\n        } else {\r\n            logf(\"dia dll found as %s but is missing DllGetClassObject function\", dllName);\r\n        }\r\n        FreeLibrary(hDll);\r\n    }\r\n    log(\"  couldn't find (or properly initialize) any DIA dll, copying msdia*.dll to app dir might help.\\n\");\r\n    return NULL;\r\n}\r\n\r\nvoid BStrToString(str::Str<char>& strInOut, BSTR str, const char *defString, bool stripWhitespace)\r\n{\r\n    strInOut.Reset();\r\n    if (!str) {\r\n        strInOut.Append(defString);\r\n        return;\r\n    }\r\n\r\n    OLECHAR c;\r\n    int len = SysStringLen(str);\r\n    for (int i=0; i<len; i++)\r\n    {\r\n        c = str[i];\r\n        if (stripWhitespace && isspace(c))\r\n            continue;\r\n        if (c < 32 || c >= 128)\r\n            c = '?';\r\n        strInOut.Append((char)c);\r\n    }\r\n}\r\n"
  },
  {
    "path": "tools/efi/Util.h",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#ifndef Util_h\r\n#define Util_h\r\n\r\n#define logf(fmt, ...) fprintf(stderr, fmt, __VA_ARGS__)\r\n\r\nvoid log(const char *s);\r\n\r\nclass IDiaDataSource;\r\n\r\nIDiaDataSource *LoadDia();\r\n\r\nvoid BStrToString(str::Str<char>& strInOut, BSTR str, const char *defString = \"\", bool stripWhitespace = false);\r\n\r\n#endif\r\n"
  },
  {
    "path": "tools/efi/efiparse.py",
    "content": "#!/usr/bin/env python\r\n\r\n\"\"\"\r\nParses the output of efi.exe.\r\n\r\nTODO:\r\n - do a per .obj file string size changes\r\n\"\"\"\r\n\r\nimport bz2, bisect\r\n\r\ng_file_name = \"efi.txt\"\r\n\r\n(SECTION_CODE, SECTION_DATA, SECTION_BSS, SECTION_UNKNOWN) = (\"C\", \"D\", \"B\", \"U\")\r\n\r\n# maps a numeric string idx to string. We take advantage of the fact that\r\n# strings in efi.exe output are stored with consequitive indexes\r\nclass Strings():\r\n\tdef __init__(self):\r\n\t\tself.strings = []\r\n\r\n\tdef add(self, idx, str):\r\n\t\tassert idx == len(self.strings)\r\n\t\tself.strings.append(str)\r\n\r\n\tdef idx_to_str(self, idx):\r\n\t\treturn self.strings[idx]\r\n\r\n# type | sectionNo | length | offset | objFileId\r\n# C|1|35|0|C:\\Users\\kkowalczyk\\src\\sumatrapdf\\obj-dbg\\sumatrapdf\\SumatraPDF.obj\r\nclass Section(object):\r\n\tdef __init__(self, l, strings):\r\n\t\tparts = l.split(\"|\")\r\n\t\tassert len(parts) == 5\r\n\t\tself.type = parts[0]\r\n\t\tself.section_no = int(parts[1])\r\n\t\tself.size = int(parts[2])\r\n\t\tself.offset = int(parts[3])\r\n\t\tidx = int(parts[4])\r\n\t\tself.name = strings.idx_to_str(idx)\r\n\r\ndef print_i_off_sec(i, off, section):\r\n\tprint(\"\"\"i: %d\r\noff:            %d\r\nsection.offset: %d\r\n\"\"\" % (i, off, section.offset))\r\n\r\nclass SectionsSorted(object):\r\n\tdef __init__(self):\r\n\t\tself.offsets = []\r\n\t\tself.sections = []\r\n\r\n\tdef add(self, section):\r\n\t\tprev_sec_idx = len(self.offsets) - 1\r\n\t\tself.offsets.append(section.offset)\r\n\t\tself.sections.append(section)\r\n\t\tif prev_sec_idx > 1:\r\n\t\t\tprev_off = self.offsets[prev_sec_idx]\r\n\t\t\tassert prev_off <= section.offset\r\n\r\n\tdef objname_by_offset(self, off):\r\n\t\ti = bisect.bisect_left(self.offsets, off)\r\n\t\tif i >= len(self.sections):\r\n\t\t\ti = len(self.sections) - 1\r\n\t\tsection = self.sections[i]\r\n\t\tif off < section.offset:\r\n\t\t\ttry:\r\n\t\t\t\tassert i > 0\r\n\t\t\texcept:\r\n\t\t\t\tprint_i_off_sec(i, off, section)\r\n\t\t\t\traise\r\n\t\t\ti -= 1\r\n\t\t\tsection = self.sections[i]\r\n\t\ttry:\r\n\t\t\tassert off >= section.offset\r\n\t\texcept:\r\n\t\t\tprint_i_off_sec(i, off, section)\r\n\t\t\traise\r\n\t\tif len(self.sections) < i + 1:\r\n\t\t\tnext_section = self.sections[i+1]\r\n\t\t\tassert off < next_section.offset\r\n\t\treturn section.name\r\n\r\nclass SectionToObjFile(object):\r\n\tdef __init__(self, sections, strings):\r\n\t\tself.strings = strings\r\n\r\n\t\tsec_no_to_sec = {}\r\n\t\tcurr_sec_no = -1\r\n\t\tcurr_sec_sorted = None\r\n\t\tfor s in sections:\r\n\t\t\tif s.section_no != curr_sec_no:\r\n\t\t\t\tassert s.section_no not in sec_no_to_sec\r\n\t\t\t\tassert s.section_no > curr_sec_no\r\n\t\t\t\tcurr_sec_no = s.section_no\r\n\t\t\t\tcurr_sec_sorted = SectionsSorted()\r\n\t\t\t\tsec_no_to_sec[curr_sec_no] = curr_sec_sorted\r\n\t\t\tcurr_sec_sorted.add(s)\r\n\t\tself.sec_no_to_sec = sec_no_to_sec\r\n\r\n\tdef get_objname_by_sec_no_off(self, sec_no, sec_off):\r\n\t\t# Note: it does happen that we have symbols in sections\r\n\t\t# that are not in sections list, like:\r\n\t\t# P|6|553|0|0|__except_list\r\n\t\t# D|6|0|553|0|__safe_se_handler_count|\r\n\t\tif sec_no not in self.sec_no_to_sec:\r\n\t\t\treturn \"\"\r\n\t\tsec_sorted = self.sec_no_to_sec[sec_no]\r\n\t\treturn sec_sorted.objname_by_offset(sec_off)\r\n\r\n\tdef get_objname_by_symbol(self, sym):\r\n\t\treturn self.get_objname_by_sec_no_off(sym.section, sym.offset)\r\n\r\n(SYM_NULL, SYM_EXE, SYM_COMPILAND, SYM_COMPILAND_DETAILS) = (\"N\", \"Exe\", \"C\", \"CD\")\r\n(SYM_COMPILAND_ENV, SYM_FUNCTION, SYM_BLOCK, SYM_DATA) = (\"CE\", \"F\", \"B\", \"D\")\r\n(SYM_ANNOTATION, SYM_LABEL, SYM_PUBLIC, SYM_UDT, SYM_ENUM) = (\"A\", \"L\", \"P\", \"U\", \"E\")\r\n(SYM_FUNC_TYPE, SYM_POINTER_TYPE, SYM_ARRAY_TYPE) = (\"FT\", \"PT\", \"AT\")\r\n(SYM_BASE_TYPE, SYM_TYPEDEF, SYM_BASE_CLASS, SYM_FRIEND) = (\"BT\", \"T\", \"BC\", \"Friend\")\r\n(SYM_FUNC_ARG_TYPE, SYM_FUNC_DEBUG_START, SYM_FUNC_DEBUG_END) = (\"FAT\", \"FDS\", \"FDE\")\r\n(SYM_USING_NAMESPACE, SYM_VTABLE_SHAPE, SYM_VTABLE, SYM_CUSTOM) = (\"UN\", \"VTS\", \"VT\", \"Custom\")\r\n(SYM_THUNK, SYM_CUSTOM_TYPE, SYM_MANAGED_TYPE, SYM_DIMENSION) = (\"Thunk\", \"CT\", \"MT\", \"Dim\")\r\n\r\n# type | section | length | offset | rva | name\r\n# F|1|35|0|4096|AllocArray<wchar_t>|wchar_t*__cdeclAllocArray<wchar_t>(unsignedint)\r\nclass Symbol(object):\r\n\tdef __init__(self, l):\r\n\t\tparts = l.split(\"|\")\r\n\t\tassert len(parts) in (6,7), \"len(parts) is %d\\n'%s'\" % (len(parts), l)\r\n\t\tself.type = parts[0]\r\n\t\tself.section = int(parts[1])\r\n\t\tself.size = int(parts[2])\r\n\t\tself.offset = int(parts[3])\r\n\t\tself.rva = int(parts[4])\r\n\t\tself.name = parts[5]\r\n\t\tif self.type == SYM_THUNK:\r\n\t\t\tself.thunk_type = parts[6]\r\n\t\telif self.type == SYM_DATA:\r\n\t\t\tself.data_type_name = parts[6]\r\n\t\tself.objname = None\r\n\r\n\tdef full_name(self):\r\n\t\treturn self.name + \"@\" + self.objname\r\n\r\nclass Type(object):\r\n\tdef __init__(self, l):\r\n\t\t# TODO: parse the line\r\n\t\tself.line = l\r\n\r\ndef print_sym(sym):\r\n\tprint(sym)\r\n\tprint(\"name : %s\" % sym.name)\r\n\tprint(\"off  : %d\" % sym.offset)\r\n\tprint(\"size : %d\" % sym.size)\r\n\r\nclass ParseState(object):\r\n\tdef __init__(self, fo, obj_file_splitters):\r\n\t\tself.fo = fo\r\n\t\tself.obj_file_splitters = obj_file_splitters\r\n\t\tself.strings = Strings()\r\n\t\tself.types = []\r\n\t\tself.symbols = []\r\n\t\tself.sections = []\r\n\t\t# functions, strings etc. are laid out rounded so e.g. a function 11 bytes\r\n\t\t# in size really takes 16 bytes in the binary, due to rounding of the symbol\r\n\t\t# after it. Those values allow us to calculate how much is wasted due\r\n\t\t# to rounding\r\n\t\tself.symbols_unrounded_size = 0\r\n\t\tself.symbols_rounding_waste = 0\r\n\r\n\tdef add_symbol(self, sym):\r\n\t\tself.symbols.append(sym)\r\n\t\tself.symbols_unrounded_size += sym.size\r\n\t\tprev_sym_idx = len(self.symbols) - 2\r\n\t\tif prev_sym_idx < 0: return\r\n\t\tprev_sym = self.symbols[prev_sym_idx]\r\n\t\tprev_sym_rounded_size = sym.offset - prev_sym.offset\r\n\t\t# prev_sym_rounded_size/ prev_sym_wasted can be < 0 in rare cases because\r\n\t\t# symbols can be inter-leaved e.g. a data symbol can be inside function\r\n\t\t# symbol, which breaks the simplistic logic of calculating rounded size\r\n\t\t# as curr.offset - prev.offset it can also happen when we cross section\r\n\t\t# boundaries. We just ignore those cases because approximate data is\r\n\t\t# better than no data\r\n\t\tif prev_sym_rounded_size < 0: return\r\n\t\tprev_sym_wasted = prev_sym_rounded_size - prev_sym.size\r\n\t\t# Note: I don't understand why but efi dump shows some very large gaps\r\n\t\t# between e.g. 2 functions. I filter everything above 16 bytes, since\r\n\t\t# wastage shouldn't be bigger than that\r\n\t\tif prev_sym_wasted > 16:\r\n\t\t\t#prev_sym_off = prev_sym.offset\r\n\t\t\t#sym_off = sym.offset\r\n\t\t\treturn\r\n\t\tif prev_sym_wasted > 0:\r\n\t\t\tself.symbols_rounding_waste += prev_sym_wasted\r\n\r\n\tdef readline(self):\r\n\t\tl = self.fo.readline()\r\n\t\tif not l:\r\n\t\t\treturn None\r\n\t\tl = l.rstrip()\r\n\t\t#print(\"'%s'\" % l)\r\n\t\treturn l\r\n\r\ndef parse_start(state):\r\n\tl = state.readline()\r\n\tif l is None or len(l) == 0:\r\n\t\treturn None\r\n\tassert l == \"Format: 1\", \"unexpected line: '%s'\" % l\r\n\treturn parse_next_section\r\n\r\ndef parse_next_section(state):\r\n\tl = state.readline()\r\n\t#print(\"'%s'\" % l)\r\n\tif l == None: return None\r\n\tif l == \"\": return parse_next_section\r\n\tif l == \"Strings:\":\r\n\t\treturn parse_strings\r\n\tif l == \"Types:\":\r\n\t\treturn parse_types\r\n\tif l == \"Sections:\":\r\n\t\treturn parse_sections\r\n\tif l == \"Symbols:\":\r\n\t\treturn parse_symbols\r\n\tprint(\"Unknonw section: '%s'\" % l)\r\n\treturn None\r\n\r\ndef parse_strings(state):\r\n\twhile True:\r\n\t\tl = state.readline()\r\n\t\tif l == None: return None\r\n\t\tif l == \"\": return parse_next_section\r\n\t\tparts = l.split(\"|\", 2)\r\n\t\tidx = int(parts[0])\r\n\t\ts = parts[1]\r\n\t\tfor splitter in state.obj_file_splitters:\r\n\t\t\tpos = s.find(splitter)\r\n\t\t\tif -1 != pos:\r\n\t\t\t\ts = s[pos + len(splitter):]\r\n\t\t\t\tbreak\r\n\t\tstate.strings.add(idx, s)\r\n\r\ndef parse_sections(state):\r\n\twhile True:\r\n\t\tl = state.readline()\r\n\t\tif l == None: return None\r\n\t\tif l == \"\": return parse_next_section\r\n\t\tstate.sections.append(Section(l, state.strings))\r\n\r\ndef parse_symbols(state):\r\n\twhile True:\r\n\t\tl = state.readline()\r\n\t\tif l == None: return None\r\n\t\tif l == \"\": return parse_next_section\r\n\t\tstate.add_symbol(Symbol(l))\r\n\r\ndef parse_types(state):\r\n\twhile True:\r\n\t\tl = state.readline()\r\n\t\tif l == None: return None\r\n\t\tif l == \"\": return parse_next_section\r\n\t\t# TODO: should parse structs, not just count them\r\n\t\tif l.startswith(\"struct\"):\r\n\t\t\tstate.types.append(Type(l))\r\n\r\ndef calc_symbols_objname(state):\r\n\tsec_to_objfile = SectionToObjFile(state.sections, state.strings)\r\n\tfor sym in state.symbols:\r\n\t\tsym.objname = sec_to_objfile.get_objname_by_symbol(sym)\r\n\r\ndef parse_file_object(fo, obj_file_splitters):\r\n\tstate = ParseState(fo, obj_file_splitters)\r\n\tcurr = parse_start\r\n\twhile curr:\r\n\t\tcurr = curr(state)\r\n\tcalc_symbols_objname(state)\r\n\treturn state\r\n\r\ndef parse_file(file_name, obj_file_splitters=[]):\r\n\tprint(\"parse_file: %s\" % file_name)\r\n\tif file_name.endswith(\".bz2\"):\r\n\t\twith bz2.BZ2File(file_name, \"r\", buffering=2*1024*1024) as fo:\r\n\t\t\treturn parse_file_object(fo, obj_file_splitters)\r\n\twith open(file_name, \"r\") as fo:\r\n\t\treturn parse_file_object(fo, obj_file_splitters)\r\n\r\ndef n_as_str(n):\r\n\tif n > 0: return \"+\" + str(n)\r\n\treturn str(n)\r\n\r\nclass Diff(object):\r\n\tdef __init__(self):\r\n\t\tself.added = []\r\n\t\tself.removed = []\r\n\t\tself.changed = []\r\n\t\tself.str_sizes1 = 0\r\n\t\tself.str_sizes2 = 0\r\n\r\n\t\tself.n_symbols1 = 0\r\n\t\tself.symbols_unrounded_size1 = 0\r\n\t\tself.symbols_rounding_waste1 = 0\r\n\r\n\t\tself.n_symbols2 = 0\r\n\t\tself.symbols_unrounded_size2 = 0\r\n\t\tself.symbols_rounding_waste2 = 0\r\n\r\n\tdef __repr__(self):\r\n\t\tstr_sizes1 = self.str_sizes1\r\n\t\tstr_sizes2 = self.str_sizes2\r\n\t\tstr_sizes_diff = n_as_str(str_sizes2 - str_sizes1)\r\n\t\tn_symbols1 = self.n_symbols1\r\n\t\tn_symbols2 = self.n_symbols2\r\n\t\tsymbols_diff = n_as_str(n_symbols2 - n_symbols1)\r\n\t\tsym_size1 = self.symbols_unrounded_size1\r\n\t\tsym_size2 = self.symbols_unrounded_size2\r\n\t\tsym_size_diff = n_as_str(sym_size2 - sym_size1)\r\n\t\twasted1 = self.symbols_rounding_waste1\r\n\t\twasted2 = self.symbols_rounding_waste2\r\n\t\twasted_diff = n_as_str(wasted2 - wasted1)\r\n\t\tn_added = len(self.added)\r\n\t\tn_removed = len(self.removed)\r\n\t\tn_changed = len(self.changed)\r\n\t\ts = \"\"\"symbols       : %(symbols_diff)-6s (%(n_symbols1)d => %(n_symbols2)d)\r\nadded         : %(n_added)d\r\nremoved       : %(n_removed)d\r\nchanged       : %(n_changed)d\r\nsymbol sizes  : %(sym_size_diff)-6s (%(sym_size1)d => %(sym_size2)d)\r\nwasted rouding: %(wasted_diff)-6s (%(wasted1)d => %(wasted2)d)\r\nstring sizes  : %(str_sizes_diff)-6s (%(str_sizes1)d => %(str_sizes2)d)\"\"\" % locals()\r\n\t\treturn s\r\n\r\ndef same_sym_sizes(syms):\r\n\tsizes = []\r\n\tfor sym in syms:\r\n\t\tif sym.size in sizes:\r\n\t\t\treturn True\r\n\t\tsizes.append(sym.size)\r\n\treturn False\r\n\r\ndef syms_len(syms):\r\n\tif isinstance(syms, list):\r\n\t\treturn len(syms)\r\n\treturn 1\r\n\r\nclass ChangedSymbol(object):\r\n\tdef __init__(self, sym1, sym2):\r\n\t\tassert sym1.name == sym2.name\r\n\t\tself.name = sym1.name\r\n\t\tself.size_diff = sym2.size - sym1.size\r\n\t\tself._full_name = sym1.full_name()\r\n\r\n\tdef full_name(self):\r\n\t\treturn self._full_name\r\n\r\nclass SymbolStats(object):\r\n\tdef __init__(self):\r\n\t\tself.name_to_sym = {}\r\n\t\tself.str_sizes = 0\r\n\r\n\tdef process_symbols(self, symbols):\r\n\t\tfor sym in symbols:\r\n\t\t\tname = sym.name\r\n\t\t\t# for anonymous strings, we just count their total size\r\n\t\t\t# since we don't have a way to tell one string from another\r\n\t\t\tif name == \"*str\":\r\n\t\t\t\tself.str_sizes += sym.size\r\n\t\t\t\tcontinue\r\n\r\n\t\t\tif name not in self.name_to_sym:\r\n\t\t\t\tself.name_to_sym[name] = sym\r\n\t\t\t\tcontinue\r\n\t\t\tv = self.name_to_sym[name]\r\n\t\t\tif isinstance(v, list):\r\n\t\t\t\tv.append(sym)\r\n\t\t\telse:\r\n\t\t\t\tv = [v, sym]\r\n\t\t\tself.name_to_sym[name] = v\r\n\r\n\tdef syms_len(self, name):\r\n\t\tif name not in self.name_to_sym:\r\n\t\t\treturn 0\r\n\t\treturn syms_len(self.name_to_sym[name])\r\n\r\ndef find_added(name, diff_syms1, diff_syms2):\r\n\tif name not in diff_syms1.name_to_sym:\r\n\t\tsyms = diff_syms2.name_to_sym[name]\r\n\t\tif isinstance(syms, list):\r\n\t\t\treturn syms\r\n\t\treturn [syms]\r\n\treturn []\r\n\r\ndef diff(parse1, parse2):\r\n\tassert isinstance(parse1, ParseState)\r\n\tassert isinstance(parse2, ParseState)\r\n\tdiff_syms1 = SymbolStats()\r\n\tdiff_syms1.process_symbols(parse1.symbols)\r\n\r\n\tdiff_syms2 = SymbolStats()\r\n\tdiff_syms2.process_symbols(parse2.symbols)\r\n\r\n\tadded = []\r\n\tchanged = []\r\n\r\n\tfor name in diff_syms2.name_to_sym.keys():\r\n\t\tlen1 = diff_syms1.syms_len(name)\r\n\t\tlen2 = diff_syms2.syms_len(name)\r\n\t\tif len2 > len1:\r\n\t\t\tadded += find_added(name, diff_syms1, diff_syms2)\r\n\t\telse:\r\n\t\t\tif len1 == 1 and len2 == 1:\r\n\t\t\t\tsym1 = diff_syms1.name_to_sym[name]\r\n\t\t\t\tsym2 = diff_syms2.name_to_sym[name]\r\n\t\t\t\tif sym1.size != sym2.size:\r\n\t\t\t\t\tchanged += [ChangedSymbol(sym1, sym2)]\r\n\r\n\tremoved = []\r\n\tfor name in diff_syms1.name_to_sym.keys():\r\n\t\tlen1 = diff_syms2.syms_len(name)\r\n\t\tlen2 = diff_syms1.syms_len(name)\r\n\t\tif len2 > len1:\r\n\t\t\tremoved += find_added(name, diff_syms2, diff_syms1)\r\n\r\n\tdiff = Diff()\r\n\tdiff.syms1 = diff_syms1\r\n\tdiff.syms2 = diff_syms2\r\n\tdiff.str_sizes1 =  diff_syms1.str_sizes\r\n\tdiff.str_sizes2 =  diff_syms2.str_sizes\r\n\tdiff.added = added\r\n\tdiff.removed = removed\r\n\tdiff.changed = changed\r\n\tdiff.n_symbols1 = len(parse1.symbols)\r\n\tdiff.symbols_unrounded_size1 = parse1.symbols_unrounded_size\r\n\tdiff.symbols_rounding_waste1 = parse1.symbols_rounding_waste\r\n\r\n\tdiff.n_symbols2 = len(parse2.symbols)\r\n\tdiff.symbols_unrounded_size2 = parse2.symbols_unrounded_size\r\n\tdiff.symbols_rounding_waste2 = parse2.symbols_rounding_waste\r\n\treturn diff\r\n\r\ndef main():\r\n\tstate = parse_file(g_file_name)\r\n\tprint(\"%d types, %d sections, %d symbols\" % (len(state.types), len(state.sections), len(state.symbols)))\r\n\r\nif __name__ == \"__main__\":\r\n\tmain()\r\n"
  },
  {
    "path": "tools/efi/main.cpp",
    "content": "/* Copyright 2015 the SumatraPDF project authors (see AUTHORS file).\r\n   License: Simplified BSD (see COPYING.BSD) */\r\n\r\n#include \"BaseUtil.h\"\r\n#include \"BitManip.h\"\r\n#include \"Dict.h\"\r\n\r\n#include \"Dia2Subset.h\"\r\n//#include <Dia2.h>\r\n#include \"Util.h\"\r\n\r\n#include <DbgHelp.h>\r\n\r\n/*\r\nTODO: in GetUndecoratedSymbolName() we can probably get more descriptive names\r\nfor strings by using different undecorateOptions. Sometimes the name indicates\r\nwhat the string is. On the other hand, it'll increase the output because\r\nthose symbol names tend to be long (and ugly). Maybe attributing strings\r\nper .obj file (which can be done with existing output) will be enoug.\r\n*/\r\n\r\n// This constant may be missing from DbgHelp.h.  See the documentation for\r\n// IDiaSymbol::get_undecoratedNameEx.\r\n#ifndef UNDNAME_NO_ECSU\r\n#define UNDNAME_NO_ECSU 0x8000  // Suppresses enum/class/struct/union.\r\n#endif  // UNDNAME_NO_ECSU\r\n\r\n// Add SymTag to get the DIA name (i.e. Null => SymTagNull). You can then google\r\n// that name to figure out what it means\r\n//\r\n// must match order of enum SymTagEnum in Dia2Subset.h\r\nconst char *g_symTypeNames[SymTagMax] = {\r\n    \"Null\",\r\n    \"Exe\",\r\n    \"Compiland\",\r\n    \"CompilandDetails\",\r\n    \"CompilandEnv\",\r\n    \"Function\",\r\n    \"Block\",\r\n    \"Data\",\r\n    \"Annotation\",\r\n    \"Label\",\r\n    \"PublicSymbol\",\r\n    \"UDT\",\r\n    \"Enum\",\r\n    \"FunctionType\",\r\n    \"PointerType\",\r\n    \"ArrayType\",\r\n    \"BaseType\",\r\n    \"Typedef\",\r\n    \"BaseClass\",\r\n    \"Friend\",\r\n    \"FunctionArgType\",\r\n    \"FuncDebugStart\",\r\n    \"FuncDebugEnd\",\r\n    \"UsingNamespace\",\r\n    \"VTableShape\",\r\n    \"VTable\",\r\n    \"Custom\",\r\n    \"Thunk\",\r\n    \"CustomType\",\r\n    \"ManagedType\",\r\n    \"Dimension\"\r\n};\r\n\r\nconst char *g_symTypeNamesCompact[SymTagMax] = {\r\n    \"N\",        // Null\r\n    \"Exe\",      // Exe\r\n    \"C\",        // Compiland\r\n    \"CD\",       // CompilandDetails\r\n    \"CE\",       // CompilandEnv\r\n    \"F\",        // Function\r\n    \"B\",        // Block\r\n    \"D\",        // Data\r\n    \"A\",        // Annotation\r\n    \"L\",        // Label\r\n    \"P\",        // PublicSymbol\r\n    \"U\",        // UDT\r\n    \"E\",        // Enum\r\n    \"FT\",       // FunctionType\r\n    \"PT\",       // PointerType\r\n    \"AT\",       // ArrayType\r\n    \"BT\",       // BaseType\r\n    \"T\",        // Typedef\r\n    \"BC\",       // BaseClass\r\n    \"Friend\",   // Friend\r\n    \"FAT\",      // FunctionArgType\r\n    \"FDS\",      // FuncDebugStart\r\n    \"FDE\",      // FuncDebugEnd\r\n    \"UN\",       // UsingNamespace\r\n    \"VTS\",      // VTableShape\r\n    \"VT\",       // VTable\r\n    \"Custom\",   // Custom\r\n    \"Thunk\",    // Thunk\r\n    \"CT\",       // CustomType\r\n    \"MT\",       // ManagedType\r\n    \"Dim\"       // Dimension\r\n};\r\n\r\nconst char *g_thunkTypeNames[] = {\r\n    \"NoType\",\r\n    \"Adjustor\",\r\n    \"VCall\",\r\n    \"PCode\",\r\n    \"Load\",\r\n    \"TrampInc\",\r\n    \"TrampBranch\"\r\n};\r\n\r\nconst char *GetThunkTypeName(DWORD thunkType)\r\n{\r\n    if (thunkType >= dimof(g_thunkTypeNames))\r\n        return \"Unknown\";\r\n    return g_thunkTypeNames[thunkType];\r\n}\r\n\r\nstatic str::Str<char> g_report;\r\nstatic StringInterner g_strInterner;\r\nstatic StringInterner g_typesSeen;\r\n\r\nstatic bool           g_dumpSections = false;\r\nstatic bool           g_dumpSymbols = false;\r\nstatic bool           g_dumpTypes = false;\r\n// TODO: possibly just remove the flag and always do compact\r\nstatic bool           g_compact = true;\r\n\r\nstatic void SysFreeStringSafe(BSTR s)\r\n{\r\n    if (s)\r\n        SysFreeString(s);\r\n}\r\n\r\nstatic void UnkReleaseSafe(IUnknown *i)\r\n{\r\n    if (i)\r\n        i->Release();\r\n}\r\n\r\nstatic int InternString(const char *s)\r\n{\r\n    return g_strInterner.Intern(s);\r\n}\r\n\r\nstatic void GetInternedStringsReport(str::Str<char>& resOut)\r\n{\r\n    resOut.Append(\"Strings:\\n\");\r\n    size_t n = g_strInterner.StringsCount();\r\n    for (size_t i = 0; i < n; i++) {\r\n        resOut.AppendFmt(\"%d|%s\\n\", i, g_strInterner.GetByIndex(i));\r\n    }\r\n    resOut.Append(\"\\n\");\r\n}\r\n\r\nstatic void AddReportSepLine()\r\n{\r\n    if (g_report.Count() > 0)\r\n        g_report.Append(\"\\n\");\r\n}\r\n\r\nstatic char g_spacesBuf[256];\r\nstatic const char *spaces(int deep)\r\n{\r\n    int n = deep * 2;\r\n    for (int i = 0; i < n; i++) {\r\n        g_spacesBuf[i] = ' ';\r\n    }\r\n    g_spacesBuf[n] = 0;\r\n    return (const char*)g_spacesBuf;\r\n}\r\n\r\nstatic const char *GetSymTypeName(int i)\r\n{\r\n    if (i >= SymTagMax)\r\n        return \"<unknown type>\";\r\n    if (g_compact)\r\n        return g_symTypeNamesCompact[i];\r\n    else\r\n        return g_symTypeNames[i];\r\n}\r\n\r\nstatic const char *GetSectionType(IDiaSectionContrib *item)\r\n{\r\n    BOOL code=FALSE,initData=FALSE,uninitData=FALSE;\r\n    item->get_code(&code);\r\n    item->get_initializedData(&initData);\r\n    item->get_uninitializedData(&uninitData);\r\n\r\n    if (code && !initData && !uninitData)\r\n        return \"C\";\r\n    if (!code && initData && !uninitData)\r\n        return \"D\";\r\n    if (!code && !initData && uninitData)\r\n        return \"B\";\r\n    return \"U\";\r\n}\r\n\r\nstatic const char *GetUdtType(IDiaSymbol *symbol)\r\n{\r\n    DWORD kind = (DWORD)-1;\r\n    if (FAILED(symbol->get_udtKind(&kind)))\r\n        return \"<unknown udt kind>\";\r\n    if (UdtStruct == kind)\r\n        return \"struct\";\r\n    if (UdtClass == kind)\r\n        return \"class\";\r\n    if (UdtUnion == kind)\r\n        return \"union\";\r\n    return \"<unknown udt kind>\";\r\n}\r\n\r\n// the result doesn't have to be free()d but is only valid until the next call to this function\r\nstatic const char *GetObjFileName(IDiaSectionContrib *item)\r\n{\r\n    static str::Str<char> strTmp;\r\n    BSTR            name = 0;\r\n\r\n    IDiaSymbol *    compiland = 0;\r\n    item->get_compiland(&compiland);\r\n    if (compiland) {\r\n        compiland->get_name(&name);\r\n        compiland->Release();\r\n    }\r\n    BStrToString(strTmp, name, \"<noobjfile>\");\r\n    SysFreeStringSafe(name);\r\n    return strTmp.Get();\r\n}\r\n\r\n// doesn't seem to exit\r\n#if 0\r\nstatic const char *GetLibraryName(IDiaSymbol *symbol)\r\n{\r\n    static str::Str<char> strTmp;\r\n    BSTR   name = 0;\r\n    symbol->get_libraryName(&name);\r\n    BStrToString(strTmp, name, \"<nolibfile>\");\r\n    SysFreeStringSafe(name);\r\n    return strTmp.Get();\r\n}\r\n#endif\r\n\r\n// always returns <nosrcfile>\r\n#if 0\r\nstatic const char *GetSourceFileName(IDiaSymbol *symbol)\r\n{\r\n    static str::Str<char> strTmp;\r\n    BSTR   name = 0;\r\n    symbol->get_sourceFileName(&name);\r\n    BStrToString(strTmp, name, \"<nosrcfile>\");\r\n    SysFreeStringSafe(name);\r\n    return strTmp.Get();\r\n}\r\n#endif\r\n\r\n// the result doesn't have to be free()d but is only valid until the next call to this function\r\nstatic const char *GetTypeName(IDiaSymbol *symbol)\r\n{\r\n    static str::Str<char> strTmp;\r\n    BSTR name = NULL;\r\n    symbol->get_name(&name);\r\n    BStrToString(strTmp, name, \"<noname>\", true);\r\n    SysFreeStringSafe(name);\r\n    return strTmp.Get();\r\n}\r\n\r\n// the result doesn't have to be free()d but is only valid until the next call to this function\r\nstatic const char *GetUndecoratedSymbolName(IDiaSymbol *symbol, const char *defName = \"<noname>\")\r\n{\r\n    static str::Str<char> strTmp;\r\n\r\n    BSTR name = NULL;\r\n\r\n#if 0\r\n    DWORD undecorateOptions = UNDNAME_COMPLETE;\r\n#else\r\n    DWORD undecorateOptions =  UNDNAME_NO_MS_KEYWORDS |\r\n                                UNDNAME_NO_FUNCTION_RETURNS |\r\n                                UNDNAME_NO_ALLOCATION_MODEL |\r\n                                UNDNAME_NO_ALLOCATION_LANGUAGE |\r\n                                UNDNAME_NO_THISTYPE |\r\n                                UNDNAME_NO_ACCESS_SPECIFIERS |\r\n                                UNDNAME_NO_THROW_SIGNATURES |\r\n                                UNDNAME_NO_MEMBER_TYPE |\r\n                                UNDNAME_NO_RETURN_UDT_MODEL |\r\n                                UNDNAME_NO_ECSU;\r\n#endif\r\n\r\n    if (S_OK == symbol->get_undecoratedNameEx(undecorateOptions, &name)) {\r\n        BStrToString(strTmp, name, \"\", true);\r\n        if (str::Eq(strTmp.Get(), \"`string'\"))\r\n            return \"*str\";\r\n        strTmp.Replace(\"(void)\", \"()\");\r\n        // more ideas for undecoration:\r\n        // http://google-breakpad.googlecode.com/svn/trunk/src/common/windows/pdb_source_line_writer.cc\r\n    } else {\r\n        // Unfortunately it does happen that get_undecoratedNameEx() fails\r\n        // e.g. for RememberDefaultWindowPosition() in Sumatra code\r\n        symbol->get_name(&name);\r\n        BStrToString(strTmp, name, defName, true);\r\n    }\r\n    SysFreeStringSafe(name);\r\n\r\n    return strTmp.Get();\r\n}\r\n\r\nstatic void DumpSection(IDiaSectionContrib *item)\r\n{\r\n    DWORD           sectionNo;\r\n    DWORD           offset;\r\n    DWORD           length;\r\n\r\n    item->get_addressSection(&sectionNo);\r\n    item->get_addressOffset(&offset);\r\n    item->get_length(&length);\r\n\r\n    //DWORD compilandId;\r\n    //item->get_compilandId(&compilandId);\r\n\r\n    const char *sectionType = GetSectionType(item);\r\n    const char *objFileName = GetObjFileName(item);\r\n\r\n    if (g_compact) {\r\n        // type | sectionNo | length | offset | objFileId\r\n        int objFileId = InternString(objFileName);\r\n        g_report.AppendFmt(\"%s|%d|%d|%d|%d\\n\", sectionType, sectionNo, length, offset, objFileId);\r\n    } else {\r\n        // type | sectionNo | length | offset | objFile\r\n        g_report.AppendFmt(\"%s|%d|%d|%d|%s\\n\", sectionType, sectionNo, length, offset, objFileName);\r\n    }\r\n}\r\n\r\nstatic void DumpType(IDiaSymbol *symbol, int deep)\r\n{\r\n    IDiaEnumSymbols *   enumChilds = NULL;\r\n    HRESULT             hr;\r\n    const char *        nameStr = NULL;\r\n    const char *        type;\r\n    LONG                offset;\r\n    ULONGLONG           length;\r\n    ULONG               celt = 0;\r\n    ULONG               symtag;\r\n    DWORD               locType;\r\n    bool                typeSeen;\r\n\r\n#if 0\r\n    if (deep > 2)\r\n        return;\r\n#endif\r\n\r\n    if (symbol->get_symTag(&symtag) != S_OK)\r\n        return;\r\n\r\n    nameStr = GetTypeName(symbol);\r\n\r\n    g_typesSeen.Intern(nameStr, &typeSeen);\r\n    if (typeSeen)\r\n        return;\r\n\r\n    symbol->get_length(&length);\r\n    symbol->get_offset(&offset);\r\n\r\n    if (SymTagData == symtag) {\r\n        if (symbol->get_locationType(&locType) != S_OK)\r\n            return; // must be a symbol in optimized code\r\n\r\n        // TODO: use get_offsetInUdt (http://msdn.microsoft.com/en-us/library/dd997149.aspx) ?\r\n        // TODO: use get_type (http://msdn.microsoft.com/en-US/library/cwx3656b(v=vs.80).aspx) ?\r\n        // TODO: see what else we can get http://msdn.microsoft.com/en-US/library/w8ae4k32(v=vs.80).aspx\r\n        if (LocIsThisRel == locType) {\r\n            g_report.AppendFmt(\"%s%s|%d\\n\", spaces(deep), nameStr, (int)offset);\r\n        }\r\n    } else if (SymTagUDT == symtag) {\r\n        // TODO: why is it always \"struct\" even for classes?\r\n        type = GetUdtType(symbol);\r\n        g_report.AppendFmt(\"%s%s|%s|%d\\n\", spaces(deep), type, nameStr, (int)length);\r\n        hr = symbol->findChildren(SymTagNull, NULL, nsNone, &enumChilds);\r\n        if (!SUCCEEDED(hr))\r\n            return;\r\n        IDiaSymbol* child;\r\n        while (SUCCEEDED(enumChilds->Next(1, &child, &celt)) && (celt == 1))\r\n        {\r\n            DumpType(child, deep+1);\r\n            child->Release();\r\n        }\r\n        enumChilds->Release();\r\n    } else {\r\n        if (symbol->get_locationType(&locType) != S_OK)\r\n            return; // must be a symbol in optimized code\r\n        // TODO: assert?\r\n    }\r\n}\r\n\r\nstatic void DumpTypes(IDiaSession *session)\r\n{\r\n    IDiaSymbol *        globalScope = NULL;\r\n    IDiaEnumSymbols *   enumSymbols = NULL;\r\n    IDiaSymbol *        symbol = NULL;\r\n\r\n    HRESULT hr = session->get_globalScope(&globalScope);\r\n    if (FAILED(hr))\r\n        return;\r\n\r\n    AddReportSepLine();\r\n    g_report.Append(\"Types:\\n\");\r\n\r\n    DWORD flags = nsfCaseInsensitive|nsfUndecoratedName; // nsNone ?\r\n    hr = globalScope->findChildren(SymTagUDT, 0, flags, &enumSymbols);\r\n    if (FAILED(hr))\r\n        goto Exit;\r\n\r\n    ULONG celt = 0;\r\n    for (;;)\r\n    {\r\n        hr = enumSymbols->Next(1, &symbol, &celt);\r\n        if (FAILED(hr) || (celt != 1))\r\n            break;\r\n        DumpType(symbol, 0);\r\n        symbol->Release();\r\n    }\r\n\r\nExit:\r\n    UnkReleaseSafe(enumSymbols);\r\n    UnkReleaseSafe(globalScope);\r\n}\r\n\r\nstatic void DumpSymbol(IDiaSymbol *symbol)\r\n{\r\n    DWORD               section, offset, rva;\r\n    DWORD               dwTag;\r\n    enum SymTagEnum     tag;\r\n    ULONGLONG           length = 0;\r\n    const char *        typeName = NULL;\r\n          char *        dataTypeName = NULL;\r\n    const char *        thunkTypeName = NULL;\r\n\r\n    symbol->get_symTag(&dwTag);\r\n    tag = (enum SymTagEnum)dwTag;\r\n    typeName = GetSymTypeName(tag);\r\n\r\n    symbol->get_relativeVirtualAddress(&rva);\r\n    symbol->get_addressSection(&section);\r\n    symbol->get_addressOffset(&offset);\r\n\r\n    // for data, get length from type\r\n    if (SymTagData == tag)\r\n    {\r\n        IDiaSymbol *type = NULL;\r\n        if (symbol->get_type(&type) == S_OK) // no SUCCEEDED test as may return S_FALSE!\r\n        {\r\n            type->get_length(&length);\r\n            const char *s = GetUndecoratedSymbolName(type, \"\");\r\n            if (s && *s)\r\n                dataTypeName = str::Dup(s);\r\n            type->Release();\r\n        }\r\n    } if (SymTagThunk == tag) {\r\n        DWORD dwThunkKind;\r\n        if (S_OK == symbol->get_thunkOrdinal(&dwThunkKind))\r\n            thunkTypeName = GetThunkTypeName(dwThunkKind);\r\n    } else {\r\n        symbol->get_length(&length);\r\n    }\r\n\r\n    const char *nameStr = GetUndecoratedSymbolName(symbol);\r\n    if (SymTagData == tag) {\r\n        // type | section | length | offset | rva | name | dataTypeName\r\n        char *tmp = dataTypeName ? dataTypeName : \"\";\r\n        g_report.AppendFmt(\"%s|%d|%d|%d|%d|%s|%s\\n\", typeName, (int)section, (int)length, (int)offset, (int)rva, nameStr, tmp);\r\n        free(dataTypeName);\r\n    } else if (SymTagThunk == tag) {\r\n        const char *tmp = thunkTypeName ? thunkTypeName : \"\";\r\n        // type | section | length | offset | rva | name | thunkTypeName\r\n        g_report.AppendFmt(\"%s|%d|%d|%d|%d|%s|%s\\n\", typeName, (int)section, (int)length, (int)offset, (int)rva, nameStr, tmp);\r\n    } else {\r\n        // type | section | length | offset | rva | name\r\n        g_report.AppendFmt(\"%s|%d|%d|%d|%d|%s\\n\", typeName, (int)section, (int)length, (int)offset, (int)rva, nameStr);\r\n    }\r\n}\r\n\r\nstatic void DumpSymbols(IDiaSession *session)\r\n{\r\n    HRESULT                 hr;\r\n    IDiaEnumSymbolsByAddr * enumByAddr = NULL;\r\n    IDiaSymbol *            symbol = NULL;\r\n\r\n    hr = session->getSymbolsByAddr(&enumByAddr);\r\n    if (!SUCCEEDED(hr))\r\n        goto Exit;\r\n\r\n    // get first symbol to get first RVA (argh)\r\n    hr = enumByAddr->symbolByAddr(1, 0, &symbol);\r\n    if (!SUCCEEDED(hr))\r\n        goto Exit;\r\n\r\n    DWORD rva;\r\n    hr = symbol->get_relativeVirtualAddress(&rva);\r\n    if (S_OK != hr)\r\n        goto Exit;\r\n\r\n    symbol->Release();\r\n    symbol = NULL;\r\n\r\n    // enumerate by rva\r\n    hr = enumByAddr->symbolByRVA(rva, &symbol);\r\n    if (!SUCCEEDED(hr))\r\n        goto Exit;\r\n\r\n    AddReportSepLine();\r\n    g_report.Append(\"Symbols:\\n\");\r\n\r\n    ULONG numFetched;\r\n    for (;;)\r\n    {\r\n        DumpSymbol(symbol);\r\n        symbol->Release();\r\n        symbol = NULL;\r\n\r\n        hr = enumByAddr->Next(1, &symbol, &numFetched);\r\n        if (FAILED(hr) || (numFetched != 1))\r\n            break;\r\n    }\r\n\r\nExit:\r\n    UnkReleaseSafe(symbol);\r\n    UnkReleaseSafe(enumByAddr);\r\n}\r\n\r\nstatic void DumpSections(IDiaSession *session)\r\n{\r\n    HRESULT             hr;\r\n    IDiaEnumTables *    enumTables = NULL;\r\n    IDiaTable *         secTable = NULL;\r\n\r\n    hr = session->getEnumTables(&enumTables);\r\n    if (S_OK != hr)\r\n        return;\r\n\r\n    AddReportSepLine();\r\n    g_report.Append(\"Sections:\\n\");\r\n\r\n    VARIANT vIndex;\r\n    vIndex.vt = VT_BSTR;\r\n    vIndex.bstrVal = SysAllocString(L\"Sections\");\r\n\r\n    hr = enumTables->Item(vIndex, &secTable);\r\n    if (S_OK != hr)\r\n        goto Exit;\r\n\r\n    LONG count;\r\n\r\n    secTable->get_Count(&count);\r\n\r\n    IDiaSectionContrib *item;\r\n    ULONG numFetched;\r\n    for (;;)\r\n    {\r\n        hr = secTable->Next(1,(IUnknown **)&item, &numFetched);\r\n        if (FAILED(hr) || (numFetched != 1))\r\n            break;\r\n\r\n        DumpSection(item);\r\n        item->Release();\r\n    }\r\n\r\nExit:\r\n    UnkReleaseSafe(secTable);\r\n    SysFreeStringSafe(vIndex.bstrVal);\r\n    UnkReleaseSafe(enumTables);\r\n}\r\n\r\nstatic void ProcessPdbFile(const char *fileNameA)\r\n{\r\n    HRESULT             hr;\r\n    IDiaDataSource *    dia = NULL;\r\n    IDiaSession *       session = NULL;\r\n    str::Str<char>      report;\r\n\r\n    dia = LoadDia();\r\n    if (!dia)\r\n        return;\r\n\r\n    ScopedMem<WCHAR> fileName(str::conv::FromAnsi(fileNameA));\r\n    hr = dia->loadDataForExe(fileName, 0, 0);\r\n    if (FAILED(hr)) {\r\n        logf(\"  failed to load %s or its debug symbols from .pdb file\\n\", fileNameA);\r\n        goto Exit;\r\n    }\r\n\r\n    hr = dia->openSession(&session);\r\n    if (FAILED(hr)) {\r\n        log(\"  failed to open DIA session\\n\");\r\n        goto Exit;\r\n    }\r\n\r\n    if (g_dumpTypes)\r\n        DumpTypes(session);\r\n\r\n    if (g_dumpSections)\r\n        DumpSections(session);\r\n\r\n    if (g_dumpSymbols)\r\n        DumpSymbols(session);\r\n\r\n    fputs(\"Format: 1\\n\", stdout);\r\n    if (g_compact) {\r\n        str::Str<char> res;\r\n        GetInternedStringsReport(res);\r\n        fputs(res.Get(), stdout);\r\n    }\r\n    fputs(g_report.Get(), stdout);\r\n\r\nExit:\r\n    UnkReleaseSafe(session);\r\n}\r\n\r\nstatic char *g_fileName = NULL;\r\n\r\nstatic bool ParseCommandLine(int argc, char **argv)\r\n{\r\n    char *s;\r\n    for (int i=0; i<argc; i++) {\r\n        s = argv[i];\r\n        if (str::EqI(s, \"-compact\"))\r\n            g_compact = true;\r\n        else if (str::EqI(s, \"-sections\"))\r\n            g_dumpSections = true;\r\n        else if (str::EqI(s, \"-symbols\"))\r\n            g_dumpSymbols = true;\r\n        else if (str::EqI(s, \"-types\"))\r\n            g_dumpTypes = true;\r\n        else {\r\n            if (g_fileName != NULL)\r\n                goto InvalidCmdLine;\r\n            g_fileName = s;\r\n        }\r\n    }\r\n    if (!g_fileName)\r\n        goto InvalidCmdLine;\r\n\r\n    if (!g_dumpSections && !g_dumpSymbols && !g_dumpTypes) {\r\n        // no options specified so use default settings:\r\n        // dump all information in non-compact way\r\n        g_dumpSections = true;\r\n        g_dumpSymbols = true;\r\n        // TODO: for now don't dump types by default\r\n        //g_dumpTypes = true;\r\n    }\r\n\r\n    return true;\r\n\r\nInvalidCmdLine:\r\n    printf(\"%s\", \"Usage: efi [-sections] [-symbols] [-types] <exefile>\\n\");\r\n    return false;\r\n}\r\n\r\nint main(int argc, char** argv)\r\n{\r\n    ScopedCom comInitializer;\r\n    if (!ParseCommandLine(argc-1, &argv[1]))\r\n        return 1;\r\n    ProcessPdbFile(g_fileName);\r\n    return 0;\r\n}\r\n"
  },
  {
    "path": "tools/efi/readme.txt",
    "content": "Executable Fat Inspector is a tool that helps fight executable bloat.\r\n\r\nIt does that by giving visibility into what kind of data ends up\r\nin the executable.\r\n"
  },
  {
    "path": "tools/mingw/VagrantBootstrap.sh",
    "content": "#!/usr/bin/env bash\n\nset -o nounset\nset -o errexit\nset -o pipefail\n\nif [ ! -e ./first_run_happened ]; then\n  sudo apt-get update\n  sudo apt-get --yes install build-essential git mercurial pkg-config\n  sudo apt-get --yes install wget curl mingw-w64 mingw32\n\n  echo \"export GOPATH=\\\"`pwd`/GoPath\\\"\" >> .bash_profile\n  echo \"export PATH=\\\"\\$PATH:/usr/local/go/bin:\\$GOPATH/bin\\\"\" >> .bash_profile\n  source .bash_profile\n\n  echo -e \"Host github.com\\n  StrictHostKeyChecking no\" > ~/.ssh/config\n\n  touch ./first_run_happened\nfi\n\nget_go() {\n  if [ ! -e /usr/local/go/ ]; then\n    echo \"installing go\"\n    curl -sS https://storage.googleapis.com/golang/go1.3.1.linux-amd64.tar.gz | sudo tar zx -C /usr/local/\n  fi\n}\n\nget_go\n\ncd /vagrant/sumatrapdf\ngo run tools/mingw/build.go\n"
  },
  {
    "path": "tools/mingw/Vagrantfile",
    "content": "# created with `vagrant init ubuntu/trusty64` (latest Ubuntu 14.04 LTS)\n# and tweaked for our use\n\nVAGRANTFILE_API_VERSION = \"2\"\n\nVagrant.configure(VAGRANTFILE_API_VERSION) do |config|\n  config.vm.box = \"ubuntu/trusty64\"\n  config.ssh.forward_agent = true\n  config.vm.synced_folder \"../..\", \"/vagrant/sumatrapdf\"\n\n  config.vm.provision \"shell\", privileged: false, path: \"VagrantBootstrap.sh\"\n\n  # Disable automatic box update checking. If you disable this, then\n  # boxes will only be checked for updates when the user runs\n  # `vagrant box outdated`. This is not recommended.\n  # config.vm.box_check_update = false\n\n  # Create a forwarded port mapping which allows access to a specific port\n  # within the machine from a port on the host machine. In the example below,\n  # accessing \"localhost:8080\" will access port 80 on the guest machine.\n  # config.vm.network \"forwarded_port\", guest: 80, host: 8080\n\n  # Create a private network, which allows host-only access to the machine\n  # using a specific IP.\n  # config.vm.network \"private_network\", ip: \"192.168.33.10\"\n\n  # Create a public network, which generally matched to bridged network.\n  # Bridged networks make the machine appear as another physical device on\n  # your network.\n  # config.vm.network \"public_network\"\n\n  # Provider-specific configuration so you can fine-tune various\n  # backing providers for Vagrant. These expose provider-specific options.\n  # Example for VirtualBox:\n  #\n  # config.vm.provider \"virtualbox\" do |vb|\n  #   # Don't boot with headless mode\n  #   vb.gui = true\n  #\n  #   # Use VBoxManage to customize the VM. For example to change memory:\n  #   vb.customize [\"modifyvm\", :id, \"--memory\", \"1024\"]\n  # end\n  #\n  # View the documentation for the provider you're using for more\n  # information on available options.\nend\n"
  },
  {
    "path": "tools/mingw/build.go",
    "content": "package main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\n/*\nTODO:\nmsvc and gcc (in C mode) support __VA_ARGS___\ng++ supports ##args in C++ mode\n\nWe need to update all uses of __VA_ARGS___:\n\n#ifdef DEBUG\n        #define dbgprint(format,args...) \\\n        fprintf(stderr, format, ##args)\n#else\n        #define dbgprint(format,args...)\n#endif\n\nc99 （gcc） / vs2005\n\n#define dgbmsg(fmt,...) \\\n             printf(fmt,__VA_ARGS__)\n\n*/\n\nconst (\n\tOUT_DIR_VAR = \"OUT_DIR\"\n)\n\nvar (\n\tMINGW32_CC  = \"i686-w64-mingw32-gcc\"\n\tMINGW32_CPP = \"i686-w64-mingw32-g++\"\n)\n\n// Context is used to pass variables to tasks. Variable is identified by string\n// and its value can be of any type. Context values are hierarchial i.e. they\n// might start with a default, globally visible values and then some variables\n// can be modified for a subtasks.\n// Imagine a c compilation task. We start with a standard compiler flags for\n// all files but we need to be able to over-ride them for all files in a given\n// directory or even for a specific file\ntype Context map[string]interface{}\n\nfunc NewContext() Context {\n\treturn make(map[string]interface{})\n}\n\n// Dup creates a copy\nfunc (c Context) Dup() Context {\n\tres := make(map[string]interface{}, len(c))\n\tfor k, v := range c {\n\t\tres[k] = v\n\t}\n\treturn res\n}\n\n// GetStrVal() returns a given context variable and casts it to string\n// Returns \"\" if variable doesn't exist or isn't a string\nfunc (c Context) GetStrVal(k string) string {\n\tif v, exists := c[k]; exists {\n\t\tif s, ok := v.(string); ok {\n\t\t\treturn s\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc (c Context) GetStrValMust(k string) string {\n\tif v, exists := c[k]; exists {\n\t\tif s, ok := v.(string); ok {\n\t\t\treturn s\n\t\t}\n\t}\n\tpanicif(true, fmt.Sprintf(\"value for %q doesn't exist or is not a string\", k))\n\treturn \"\"\n}\n\n// Task is a single build operation e.g. running compiler for a given .c file\ntype Task interface {\n\t// Run executes the task. Most tasks involve executing other programs (like\n\t// a C compiler) so we also return stdout and stderr for diagnostic\n\tRun() (error, []byte, []byte)\n\tSetContext(ctx Context)\n}\n\n// default implementation of context that can be embedded in all implementation of Task\ntype TaskContext struct {\n\tCtx Context\n}\n\nfunc (tc *TaskContext) SetContext(ctx Context) {\n\ttc.Ctx = ctx\n}\n\n// MkdirTask creates a directory\ntype MkdirTask struct {\n\tTaskContext\n\tDir string\n}\n\nfunc (t *MkdirTask) Run() (error, []byte, []byte) {\n\tdir := t.Dir\n\tpanicif(dir == \"\")\n\tfmt.Printf(\"mkdir %s\\n\", dir)\n\terr := os.MkdirAll(dir, 0755)\n\tif os.IsExist(err) {\n\t\terr = nil\n\t}\n\treturn err, nil, nil\n}\n\ntype MkdirOutTask struct {\n\tTaskContext\n}\n\nfunc (t *MkdirOutTask) Run() (error, []byte, []byte) {\n\tdir := t.Ctx.GetStrValMust(OUT_DIR_VAR)\n\tfmt.Printf(\"mkdir %s\\n\", dir)\n\terr := os.MkdirAll(dir, 0755)\n\tif os.IsExist(err) {\n\t\terr = nil\n\t}\n\treturn err, nil, nil\n}\n\n// Tasks is a sequence of tasks. They all share a common context\n// TODO: add notion of serial and parallel tasks; execute parallel tasks in parallel\ntype Tasks struct {\n\tTaskContext\n\tToRun []Task\n}\n\nfunc combineOut(curr, additional []byte) []byte {\n\tif len(curr) == 0 {\n\t\treturn additional\n\t}\n\tif len(additional) == 0 {\n\t\treturn additional\n\t}\n\tcurr = append(curr, '\\n')\n\treturn append(curr, additional...)\n}\n\nfunc (t *Tasks) Run() (error, []byte, []byte) {\n\tvar stdoutCombined []byte\n\tvar stderrCombined []byte\n\tfor _, task := range t.ToRun {\n\t\t// propagate the context to all children\n\t\ttask.SetContext(t.Ctx)\n\t\terr, stdout, stderr := task.Run()\n\t\tif err != nil {\n\t\t\treturn err, stdout, stderr\n\t\t}\n\t\tstdoutCombined = combineOut(stdoutCombined, stdout)\n\t\tstderrCombined = combineOut(stderrCombined, stderr)\n\t}\n\treturn nil, stdoutCombined, stderrCombined\n}\n\nfunc cmdString(cmd *exec.Cmd) string {\n\tarr := []string{cmd.Path}\n\targs := cmd.Args[1:]\n\tarr = append(arr, args...)\n\treturn strings.Join(arr, \" \")\n}\n\nfunc panicif(cond bool, msgs ...string) {\n\tif cond {\n\t\tvar msg string\n\t\tif len(msgs) > 0 {\n\t\t\tmsg = msgs[0]\n\t\t} else {\n\t\t\tmsg = \"error\"\n\t\t}\n\t\tpanic(msg)\n\t}\n}\n\nfunc genOut(dir, in, ext string) string {\n\tpanicif(ext[0] != '.')\n\tin = filepath.Base(in)\n\te := filepath.Ext(in)\n\tin = in[:len(in)-len(e)]\n\treturn filepath.Join(dir, in+ext)\n}\n\nfunc isUpToDate(srcPath, dstPath string) bool {\n\tdstFi, err := os.Stat(dstPath)\n\tif err != nil {\n\t\treturn false\n\t}\n\tsrcFi, err := os.Stat(srcPath)\n\tpanicif(err != nil)\n\treturn dstFi.ModTime().Sub(srcFi.ModTime()) > 0\n}\n\nfunc mingwCompile(src, dst, incDirs string) (error, []byte, []byte) {\n\tcc := mingwCcExe(src)\n\tvar args []string\n\targs = append(args, mingwIncArgs(incDirs)...)\n\targs = append(args, \"-o\", dst)\n\targs = append(args, \"-c\", src)\n\tcmd := exec.Command(cc, args...)\n\tfmt.Println(cmdString(cmd))\n\t// TODO: get stdout, stderr separately\n\tstdout, err := cmd.CombinedOutput()\n\treturn err, stdout, nil\n}\n\n// MingwCcTask compiles a single c/c++ file with mingw\ntype MingwCcTask struct {\n\tTaskContext\n\tIn string\n\t// TODO: move IncDirs to Context\n\tIncDirs string\n}\n\nfunc isCppFile(src string) bool {\n\text := strings.ToLower(filepath.Ext(src))\n\treturn ext == \".c\" || ext == \".cpp\"\n}\n\nfunc mingwCcExe(src string) string {\n\text := strings.ToLower(filepath.Ext(src))\n\tif strings.HasSuffix(ext, \".c\") {\n\t\treturn MINGW32_CC\n\t}\n\tif strings.HasSuffix(ext, \".cpp\") {\n\t\treturn MINGW32_CPP\n\t}\n\tpanic(fmt.Sprintf(\"unsupported suffix: %s\", ext))\n}\n\nfunc mingwIncArgs(incDirs string) []string {\n\targs := make([]string, 0)\n\tdirs := strings.Split(incDirs, \";\")\n\tfor _, dir := range dirs {\n\t\targs = append(args, \"-I\", dir)\n\t}\n\treturn args\n}\n\nfunc (t *MingwCcTask) Run() (error, []byte, []byte) {\n\toutDir := t.Ctx.GetStrValMust(OUT_DIR_VAR)\n\tsrc := t.In\n\tdst := genOut(outDir, t.In, \".o\")\n\tif isUpToDate(src, dst) {\n\t\treturn nil, nil, nil\n\t}\n\treturn mingwCompile(src, dst, t.IncDirs)\n}\n\n// compile Files in a Dir\ntype MingwCcDirTask struct {\n\tTaskContext\n\tDir     string\n\tFiles   []string\n\tIncDirs string\n}\n\nfunc (t *MingwCcDirTask) Run() (error, []byte, []byte) {\n\toutDir := t.Ctx.GetStrValMust(OUT_DIR_VAR)\n\tfor _, f := range t.Files {\n\t\tsrc := filepath.Join(t.Dir, f)\n\t\tdst := genOut(outDir, f, \".o\")\n\t\tif isUpToDate(src, dst) {\n\t\t\tcontinue\n\t\t}\n\t\t// TODO: ensure dst hasn't been generated in other tasks\n\t\terr, stdout, stderr := mingwCompile(src, dst, t.IncDirs)\n\t\tif err != nil {\n\t\t\treturn err, stdout, stderr\n\t\t}\n\t}\n\treturn nil, nil, nil\n}\n\n// compile all .c and .cpp files in a directory, possibly excluding some\ntype MingwCcDirAllTask struct {\n\tTaskContext\n\tDir     string\n\tExclude []string\n\tIncDirs string\n}\n\nfunc getCppFiles(dir string) ([]string, error) {\n\tfileInfos, err := ioutil.ReadDir(dir)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tres := make([]string, 0)\n\tfor _, fi := range fileInfos {\n\t\tname := fi.Name()\n\t\tif isCppFile(name) {\n\t\t\tres = append(res, name)\n\t\t}\n\t}\n\treturn res, nil\n}\n\nfunc filterStrings(a, toFilter []string) []string {\n\tif len(toFilter) == 0 {\n\t\treturn a\n\t}\n\tm := make(map[string]struct{})\n\tfor _, s := range toFilter {\n\t\tm[s] = struct{}{}\n\t}\n\n\tres := make([]string, 0)\n\tfor _, s := range a {\n\t\tif _, ok := m[s]; ok {\n\t\t\tcontinue\n\t\t}\n\t\tres = append(res, s)\n\t}\n\treturn res\n}\n\nfunc (t *MingwCcDirAllTask) Run() (error, []byte, []byte) {\n\toutDir := t.Ctx.GetStrValMust(OUT_DIR_VAR)\n\tfiles, err := getCppFiles(t.Dir)\n\tif err != nil {\n\t\treturn err, nil, nil\n\t}\n\tfiles = filterStrings(files, t.Exclude)\n\tfor _, f := range files {\n\t\tsrc := filepath.Join(t.Dir, f)\n\t\tdst := genOut(outDir, f, \".o\")\n\t\tif isUpToDate(src, dst) {\n\t\t\tcontinue\n\t\t}\n\t\t// TODO: ensure dst hasn't been generated in other tasks\n\t\terr, stdout, stderr := mingwCompile(src, dst, t.IncDirs)\n\t\tif err != nil {\n\t\t\treturn err, stdout, stderr\n\t\t}\n\t}\n\treturn nil, nil, nil\n}\n\nfunc main() {\n\tctx := NewContext()\n\tctx[OUT_DIR_VAR] = \"rel-mingw\"\n\trootTask := Tasks{\n\t\tTaskContext: TaskContext{ctx},\n\t\tToRun: []Task{\n\t\t\t&MkdirOutTask{},\n\t\t\t&MingwCcDirAllTask{Dir: \"src/mui\", IncDirs: \"src/utils;src/utils/mui\"},\n\t\t\t&MingwCcDirAllTask{Dir: \"src/utils\", Exclude: []string{\n\t\t\t\t\"CryptoUtil.cpp\", // mingw complains about sscanf_s\n\t\t\t\t\"FzImgReader.cpp\", // mingw complains about fz_warn()\n\t\t\t\t\"GdiPlusUtil.cpp\",  // mingw complains about lack of UINT32_MAX\n\t\t\t\t\"HtmlWindow.cpp\", // mingw doesn't have QITAB\n\t\t\t\t\"StrUtil.cpp\", // mingw doesn't have _vsnprintf_s, sprintf_s, sscanf_s\n\t\t\t\t\"TgaReader.cpp\", // mingw doesn't have _snprintf_s\n\t\t\t\t\"ZipUtil.cpp\", // mingw doesn't have QITAB\n\t\t\t},\n\t\t\t\tIncDirs: \"src/utils;mupdf/include;ext/lzma/C;ext/zlib;ext/libwebp;ext/unarr\",\n\t\t\t},\n\t\t\t&MingwCcDirAllTask{Dir: \"src\", Exclude: []string{\n\t\t\t\t\"Canvas.cpp\",  // uia stuff\n\t\t\t\t\"EngineDump.cpp\",  // mingw: __VA_ARGS__\n\t\t\t\t\"MobiDoc.cpp\",  // mingw: __VA_ARGS__\n\t\t\t\t\"PdfCreator.cpp\",  // mingw: __VA_ARGS__\n\t\t\t\t\"PdfEngine.cpp\",  // mingw: __VA_ARGS__\n\t\t\t\t\"PsEngine.cpp\",  // mingw: no _wfopen_s\n\t\t\t\t\"Selection.cpp\", // mingw: no IRawElementProviderFragment\n\t\t\t\t\"StressTesting.cpp\", // mingw: many issues\n\t\t\t\t\"SumatraPDF.cpp\", // mingw: many issues\n\t\t\t\t\"SumatraStartup.cpp\",  // uia and many others\n\t\t\t\t\"WindowInfo.cpp\",  // uia stuff\n\t\t\t},\n\t\t\t\tIncDirs: \"src/utils;ext/CHMLib/src;src/mui;ext/libdjvu;ext/lzma/C;ext/zlib;mupdf/include;ext/synctex\",\n\t\t\t},\n\t\t\t&MingwCcTask{In: \"ext/zlib/adler32.c\"},\n\t\t},\n\t}\n\terr, stdout, stderr := rootTask.Run()\n\tif err != nil {\n\t\tfmt.Printf(\"Failed with %s, stdout:\\n%s\\nstderr:\\n%s\\n\", err, string(stdout), string(stderr))\n\t}\n}\n"
  },
  {
    "path": "tools/mingw/readme.txt",
    "content": "This is an attempt to create a mingw-based cross-compilation.\n\nCompilation is run inside Linux VM running under VirtualBox, controlled by\nVagrant.\n\nThis is to detect code that is compiler dependent (i.e. assumes things about\nMSVC that aren't true for gcc).\n\nThere are no plans to publish those builds.\n\nThere are 3 options to run the build.\n\nOption 1:\n* install cygwin\n* install mingw in cygwin\n* install go (native Windows binaries)\n* go run tools/mingw/build.go\n\nOption 2:\n* get access to some recent Linux (I use Ubuntu 14.04) distro e.g.:\n - use VM running under VirtualBox or VMWare\n - or install Linux on a PC\n - or get a cheap VPS e.g from DigitalOcean\n* install necessary tools (mingw, Go, etc, see VagrantBootstrap.sh for\n  commands needed to install those on Ubuntu)\n* go run tools/mingw/build.go to run the build\n\nOption 3:\n* get a Mac (might also work on Windows but haven't tried)\n* install latest VirtualBox\n* install latest Vagrant\n* cd tools/mingw-build\n* ./vagrant_build.sh\n\nNotes:\n* x86_64-w64-mingw32-gcc is the compiler name for 64-bit builds\n* i686-w64-mingw32-gcc is for 32-bit builds\n* http://www.blogcompiler.com/2010/07/11/compile-for-windows-on-linux/\n\nTemplate error about 'no argument .. that depend on template parameter':\nhttp://www.linuxquestions.org/questions/programming-9/compile-error-there-are-no-arguments-to-'function'-that-depend-on-a-template-param-931065/\n"
  },
  {
    "path": "tools/mingw/vagrant_build.sh",
    "content": "#!/usr/bin/env bash\n\nset -o nounset\nset -o errexit\nset -o pipefail\n\nvagrant up\n\nvagrant provision\n\n#vagrant halt\n"
  },
  {
    "path": "tools/premake/no_op_console.c",
    "content": "#include <stdio.h>\r\n#include <stdlib.h>\r\n\r\nint main(int argc, char **argv) {\r\n    printf(\"This is just a dummy program to satisfy premake. argc: %d, argv: %p\\n\", argc, argv);\r\n    return 0;\r\n}\r\n"
  },
  {
    "path": "tools/premake/no_op_for_premake.cpp",
    "content": "/*\nThis is a dummy file that does nothing. Exists only to\naccomodate premake.\n*/\n\n"
  },
  {
    "path": "tools/regress/main.go",
    "content": "package main\n\nimport (\n\t\"crypto/sha1\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n)\n\n/*\nThe big idea is to start collecting regression tests for bugs we fixed.\n\nEach test is a command we run on a file. A command can be any executable but\nfor simplicity we'll probably just add more functionality to SumatraPDF.exe.\n\nTest succeeds if the output is same as expected.\n*/\n\n// Test describes a single test\ntype Test struct {\n\t// values from parsing test file\n\tCmdUnparsed    string\n\tFileSha1Hex    string\n\tFileURL        string\n\tExpectedOutput string\n\n\t// computed values\n\tCmdName  string // e.g. SumatraPDF.exe\n\tCmdPath  string // e.g. rel64\\SumatraPDF.exe\n\tCmdArgs  []string\n\tFilePath string\n\tError    error\n\tOutput   string\n}\n\n// TestFile describes as test file\ntype TestFile struct {\n\tPath    string\n\tSha1Hex string\n}\n\nvar (\n\tinFatal         bool\n\ttestFilesBySha1 map[string]*TestFile\n)\n\nfunc init() {\n\ttestFilesBySha1 = make(map[string]*TestFile)\n}\n\nfunc errStr(err error) string {\n\tif err == nil {\n\t\treturn \"\"\n\t}\n\treturn err.Error()\n}\n\nfunc dumpTest(t *Test) {\n\tfmt.Printf(`CmdUnparsed: '%s'\nFileSha1Hex: %s\nFileURL: '%s'\nExpectedOutput: '%s'\nCmdName: '%s'\nCmdPath: '%s'\nCmdArgs: %v\nFilePath: '%s'\nError: '%s'\nOutput: '%s'\n\n`, t.CmdUnparsed, t.FileSha1Hex, t.FileURL, t.ExpectedOutput, t.CmdName, t.CmdPath, t.CmdArgs, t.FilePath, errStr(t.Error), t.Output)\n}\n\nfunc printStack() {\n\tbuf := make([]byte, 1024*164)\n\tn := runtime.Stack(buf, false)\n\tfmt.Printf(\"%s\", buf[:n])\n}\n\nvar (\n\tcacheDir string\n)\n\nfunc getCacheDirMust() string {\n\tif cacheDir == \"\" {\n\t\td := filepath.Join(\"..\", \"sumatra-test-files\")\n\t\terr := os.MkdirAll(d, 0755)\n\t\tfataliferr(err)\n\t\tcacheDir = d\n\t}\n\treturn cacheDir\n}\n\nfunc fatalf(format string, args ...interface{}) {\n\tfmt.Printf(format, args...)\n\tprintStack()\n\tos.Exit(1)\n}\n\nfunc fatalif(cond bool, format string, args ...interface{}) {\n\tif cond {\n\t\tif inFatal {\n\t\t\tos.Exit(1)\n\t\t}\n\t\tinFatal = true\n\t\tfmt.Printf(format, args...)\n\t\tprintStack()\n\t\tos.Exit(1)\n\t}\n}\n\nfunc fataliferr(err error) {\n\tif err != nil {\n\t\tfatalf(\"%s\\n\", err.Error())\n\t}\n}\n\nfunc toTrimmedLines(d []byte) []string {\n\tvar res []string\n\tfor _, l := range strings.Split(string(d), \"\\n\") {\n\t\tl = strings.TrimSpace(l)\n\t\tres = append(res, l)\n\t}\n\treturn res\n}\n\nfunc collapseMultipleEmptyLines(lines []string) []string {\n\tvar res []string\n\tprevWasEmpty := false\n\tfor _, l := range lines {\n\t\tif l == \"\" && prevWasEmpty {\n\t\t\tcontinue\n\t\t}\n\t\tprevWasEmpty = l == \"\"\n\t\tres = append(res, l)\n\t}\n\treturn res\n}\n\nfunc parseTest(lines []string) (*Test, []string) {\n\tt := &Test{}\n\t//fmt.Printf(\"parseTest: %d lines\\n\", len(lines))\n\tif len(lines) == 0 {\n\t\treturn nil, nil\n\t}\n\tfor len(lines) > 0 {\n\t\tl := lines[0]\n\t\tlines = lines[1:]\n\t\t// skip comments\n\t\tif strings.HasPrefix(l, \"#\") {\n\t\t\tcontinue\n\t\t}\n\t\t//fmt.Printf(\"lt: '%s'\\n\", l)\n\t\t// empty line separates tests\n\t\tif l == \"\" {\n\t\t\tbreak\n\t\t}\n\n\t\tparts := strings.SplitN(l, \":\", 2)\n\t\tfatalif(len(parts) != 2, \"invalid line: '%s'\", l)\n\t\tname := strings.ToLower(parts[0])\n\t\tval := strings.TrimSpace(parts[1])\n\t\tswitch name {\n\t\tcase \"url\":\n\t\t\tt.FileURL = val\n\t\tcase \"sha1\":\n\t\t\tfatalif(len(val) != 40, \"len(val) != 40 (%d)\", len(val))\n\t\t\tt.FileSha1Hex = val\n\t\tcase \"cmd\":\n\t\t\tt.CmdUnparsed = val\n\t\tcase \"out\":\n\t\t\tt.ExpectedOutput = val\n\t\t}\n\t}\n\tfatalif(t.FileURL == \"\", \"Url: filed missing\")\n\tfatalif(t.FileSha1Hex == \"\", \"Sha1: field missing\")\n\tfatalif(t.CmdUnparsed == \"\", \"Cmd: field missing\")\n\tfatalif(t.ExpectedOutput == \"\", \"Out: field missing\")\n\n\tparts := strings.Split(t.CmdUnparsed, \" \")\n\tt.CmdName = parts[0]\n\tt.CmdArgs = parts[1:]\n\treturn t, lines\n}\n\nfunc parseTestsMust(path string) []*Test {\n\tvar res []*Test\n\tvar test *Test\n\td, err := ioutil.ReadFile(path)\n\tfataliferr(err)\n\tlines := toTrimmedLines(d)\n\tlines = collapseMultipleEmptyLines(lines)\n\tfor {\n\t\ttest, lines = parseTest(lines)\n\t\tif test == nil {\n\t\t\tbreak\n\t\t}\n\t\tres = append(res, test)\n\t}\n\tfmt.Printf(\"%d tests\\n\", len(res))\n\treturn res\n}\n\nfunc cmdToStrLong2(cmd *exec.Cmd) string {\n\tarr := []string{`\"` + cmd.Path + `\"`}\n\tarr = append(arr, cmd.Args...)\n\treturn strings.Join(arr, \" \")\n}\n\nfunc cmdToStrLong(cmd *exec.Cmd) string {\n\treturn strings.Join(cmd.Args, \" \")\n}\n\nfunc isOutputEqual(s1, s2 string) bool {\n\t// TODO: normalize newlines\n\ts1 = strings.TrimSpace(s1)\n\ts2 = strings.TrimSpace(s2)\n\treturn s1 == s2\n}\n\nfunc runTest(t *Test) {\n\tfor i, arg := range t.CmdArgs {\n\t\tif arg == \"$file\" {\n\t\t\tt.CmdArgs[i] = t.FilePath\n\t\t}\n\t}\n\tcmd := exec.Command(t.CmdPath, t.CmdArgs...)\n\tfmt.Printf(\"Running: %s\\n\", cmdToStrLong(cmd))\n\tres, err := cmd.Output()\n\tt.Output = strings.TrimSpace(string(res))\n\tif err != nil {\n\t\tt.Error = err\n\t\tfmt.Printf(\"Failed test:\\n\")\n\t\tdumpTest(t)\n\t\treturn\n\t}\n\tif !isOutputEqual(t.Output, t.ExpectedOutput) {\n\t\tfmt.Printf(\"Failed test:\\n\")\n\t\tdumpTest(t)\n\t\treturn\n\t}\n\tfmt.Printf(\"test passed, output: %s\\n\", res)\n}\n\nfunc isFailedTest(t *Test) bool {\n\tif t.Error != nil {\n\t\treturn true\n\t}\n\treturn !isOutputEqual(t.Output, t.ExpectedOutput)\n}\n\nfunc dumpFailedTest(t *Test) {\n\targs := strings.Join(t.CmdArgs, \" \")\n\tfmt.Printf(\"Test %s %s failed\\n\", t.CmdPath, args)\n\tdumpTest(t)\n\tif t.Error != nil {\n\t\tfmt.Printf(\"Reason: process exited with error '%s'\\n\", t.Error)\n\t\treturn\n\t}\n\tif !isOutputEqual(t.Output, t.ExpectedOutput) {\n\t\tfmt.Printf(`\nReason: got output:\n-----\n%s\n-----\nexpected:\n-----\n%s\n-----\n`, t.Output, t.ExpectedOutput)\n\t\treturn\n\t}\n\tfmt.Printf(\"Internal error: unknown reason\\n\")\n}\n\nfunc dumpFailedTests(tests []*Test) int {\n\tnFailed := 0\n\tfor _, test := range tests {\n\t\tif !isFailedTest(test) {\n\t\t\tcontinue\n\t\t}\n\t\tnFailed++\n\t\tdumpFailedTest(test)\n\t}\n\tif nFailed == 0 {\n\t\tfmt.Printf(\"All tests passed!\\n\")\n\t} else {\n\t\tfmt.Printf(\"Failed %d out of %d tests\\n\", nFailed, len(tests))\n\t}\n\treturn nFailed\n}\n\nfunc sha1OfBytes(data []byte) []byte {\n\tres := sha1.Sum(data)\n\treturn res[:]\n}\n\nfunc sha1HexOfBytes(data []byte) string {\n\treturn fmt.Sprintf(\"%x\", sha1OfBytes(data))\n}\n\nfunc sha1OfFile(path string) ([]byte, error) {\n\tf, err := os.Open(path)\n\tfataliferr(err)\n\tdefer f.Close()\n\th := sha1.New()\n\t_, err = io.Copy(h, f)\n\tfataliferr(err)\n\treturn h.Sum(nil), nil\n}\n\nfunc sha1HexOfFile(path string) (string, error) {\n\tsha1, err := sha1OfFile(path)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn fmt.Sprintf(\"%x\", sha1), nil\n}\n\nfunc httpDlMust(uri string) []byte {\n\tres, err := http.Get(uri)\n\tfataliferr(err)\n\td, err := ioutil.ReadAll(res.Body)\n\tres.Body.Close()\n\tfataliferr(err)\n\treturn d\n}\n\nfunc testFileExists(sha1Hex string) bool {\n\treturn nil != testFilesBySha1[sha1Hex]\n}\n\nfunc dlIfNotExistsMust(uri, sha1Hex string) {\n\tif testFileExists(sha1Hex) {\n\t\treturn\n\t}\n\tfmt.Printf(\"downloading '%s'...\", uri)\n\td := httpDlMust(uri)\n\trealSha1Hex := sha1HexOfBytes(d)\n\tfatalif(sha1Hex != realSha1Hex, \"sha1Hex != realSha1Hex (%s != %s)\", sha1Hex, realSha1Hex)\n\text := filepath.Ext(uri)\n\tfileName := sha1Hex + ext\n\tpath := filepath.Join(getCacheDirMust(), fileName)\n\terr := ioutil.WriteFile(path, d, 0644)\n\tfataliferr(err)\n\tfmt.Printf(\" saved to '%s'\\n\", path)\n\ttestFilesBySha1[sha1Hex] = &TestFile{\n\t\tPath:    path,\n\t\tSha1Hex: sha1Hex,\n\t}\n}\n\nfunc downloadTestFilesMust(tests []*Test) {\n\tfor _, test := range tests {\n\t\tdlIfNotExistsMust(test.FileURL, test.FileSha1Hex)\n\t}\n}\n\nfunc runTests(tests []*Test) {\n\tfor _, test := range tests {\n\t\trunTest(test)\n\t}\n}\n\nfunc removeExt(s string) string {\n\text := filepath.Ext(s)\n\tif len(ext) == 0 {\n\t\treturn s\n\t}\n\treturn s[:len(s)-len(ext)]\n}\n\nfunc verifyTestFiles() {\n\td := getCacheDirMust()\n\tfiles, err := ioutil.ReadDir(d)\n\tfataliferr(err)\n\tfor _, fi := range files {\n\t\tpath := filepath.Join(d, fi.Name())\n\t\tsha1HexFromName := removeExt(fi.Name())\n\t\tfatalif(len(sha1HexFromName) != 40, \"len(sha1HexFromName) != 40 (%d)\", len(sha1HexFromName))\n\t\tsha1Hex, err := sha1HexOfFile(path)\n\t\tfataliferr(err)\n\t\tfatalif(sha1Hex != sha1HexFromName, \"sha1Hex != sha1HexFromName (%s != %s)\", sha1Hex, sha1HexFromName)\n\t\ttestFilesBySha1[sha1Hex] = &TestFile{\n\t\t\tPath:    path,\n\t\t\tSha1Hex: sha1Hex,\n\t\t}\n\t}\n\tfmt.Printf(\"%d test files locally\\n\", len(testFilesBySha1))\n}\n\nfunc isOS64Bit() bool {\n\treturn runtime.GOARCH == \"amd64\"\n}\n\nfunc dirExists(path string) bool {\n\tfi, err := os.Stat(path)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn fi.IsDir()\n}\n\nfunc fileExists(path string) bool {\n\tfi, err := os.Stat(path)\n\tif err != nil {\n\t\treturn false\n\t}\n\treturn fi.Mode().IsRegular()\n}\n\nfunc verifyCommandsMust(tests []*Test) {\n\tvar dirsToCheck []string\n\tcmds := make(map[string]bool)\n\tif isOS64Bit() && dirExists(\"rel64\") {\n\t\tdirsToCheck = append(dirsToCheck, \"rel64\")\n\t}\n\tif dirExists(\"rel\") {\n\t\tdirsToCheck = append(dirsToCheck, \"rel\")\n\t}\n\t// TODO: also check dbg64 and dbg?\n\tfatalif(len(dirsToCheck) == 0, \"there is no rel or rel64 directory with executables\")\n\tfor _, test := range tests {\n\t\tcmds[test.CmdName] = true\n\t}\n\tvar dirWithCommands string\n\tfor _, dir := range dirsToCheck {\n\t\tvar cmdsFound []string\n\t\tfor cmd := range cmds {\n\t\t\tpath := filepath.Join(dir, cmd)\n\t\t\tif fileExists(path) {\n\t\t\t\tcmdsFound = append(cmdsFound, cmd)\n\t\t\t}\n\t\t}\n\t\tif len(cmdsFound) == len(cmds) {\n\t\t\tfmt.Printf(\"found all test commands in '%s'\\n\", dir)\n\t\t\tdirWithCommands = dir\n\t\t\tbreak\n\t\t} else {\n\t\t\tfmt.Printf(\"dir '%s' has only %d out of %d commands\\n\", dir, len(cmdsFound), len(cmds))\n\t\t}\n\t}\n\tfatalif(dirWithCommands == \"\", \"didn't find a directory with all tests commands %v\\n\", cmds)\n\tfor _, test := range tests {\n\t\ttest.CmdPath = filepath.Join(dirWithCommands, test.CmdName)\n\t}\n}\n\nfunc dumpTests(tests []*Test) {\n\tfor _, test := range tests {\n\t\tdumpTest(test)\n\t}\n}\n\nfunc substFileVar(s, filePath string) string {\n\treturn strings.Replace(s, \"$file\", filePath, -1)\n}\n\nfunc substFileVarAll(tests []*Test) {\n\tfor _, test := range tests {\n\t\tsha1Hex := test.FileSha1Hex\n\t\ttf := testFilesBySha1[sha1Hex]\n\t\tfatalif(tf == nil, \"no test file for '%s'\\n\", sha1Hex)\n\t\ttest.FilePath = tf.Path\n\t\ttest.ExpectedOutput = substFileVar(test.ExpectedOutput, tf.Path)\n\t\tfor i, arg := range test.CmdArgs {\n\t\t\ttest.CmdArgs[i] = substFileVar(arg, tf.Path)\n\t\t}\n\t}\n}\n\nfunc main() {\n\tfmt.Printf(\"regress, 64-bit os: %v\\n\", isOS64Bit())\n\n\tverifyTestFiles()\n\tp := filepath.Join(\"tools\", \"regress\", \"tests.txt\")\n\ttests := parseTestsMust(p)\n\tverifyCommandsMust(tests)\n\tdownloadTestFilesMust(tests)\n\tsubstFileVarAll(tests)\n\t//dumpTests(tests)\n\n\trunTests(tests)\n\tos.Exit(dumpFailedTests(tests))\n}\n"
  },
  {
    "path": "tools/regress/tests.txt",
    "content": "# Note: tests are separated by a single empty line (that is not a part\r\n# of Out: block)\r\n# https://github.com/sumatrapdfreader/sumatrapdf/issues/306\r\n# this crashed rendering page 2. -zoom 10 because actual size is 4k x 3k\r\nUrl: https://kjkpub.s3.amazonaws.com/testfiles/6f/d3/89a36816f1ab490d46c0c7a6b34b678f72bf.pdf\r\nSha1: 6fd389a36816f1ab490d46c0c7a6b34b678f72bf\r\nCmd: SumatraPDF.exe -render 2 -zoom 5 $file\r\nOut: rendering page 2 for '$file', zoom: 5.00\r\n\r\n# https://github.com/sumatrapdfreader/sumatrapdf/issues/267\r\nUrl: https://kjkpub.s3.amazonaws.com/testfiles/56/3d/c5439587d72663803537a171e6f9dc8c61d4.pdf\r\nSha1: 563dc5439587d72663803537a171e6f9dc8c61d4\r\nCmd: SumatraPDF.exe -extract-text 1 $file\r\nOut: text on page 1: 'f0 9d 91 93 5f '\r\n"
  },
  {
    "path": "tools/s3/main.go",
    "content": "package main\n\nimport (\n\t\"crypto/md5\"\n\t\"crypto/sha1\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"mime\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/goamz/goamz/aws\"\n\t\"github.com/goamz/goamz/s3\"\n)\n\n/*\nThis tool uploads files to s3 so that they are preserved for future testing.\n\nFiles are stored by their sha1 + suffix.\n\nUsage:\ngo run tools/s3/main.go $file [-pub]\ngo run tools/s3/main.go $dir [-pub]\n\nProviding a file does a recursive upload.\n*/\n\n// Secrets defines secrets\ntype Secrets struct {\n\tAwsSecret string\n\tAwsAccess string\n}\n\ntype FileInfo struct {\n\tPath           string // file path of the original file\n\tS3PathSha1Part string\n\tS3FullPath     string // S3PathSha1Part + ext\n\tSha1Hex        string\n\tMd5Hex         string\n\tMd5B64         string\n\tSize           int64 // size of the file, not compressed\n}\n\ntype FileInS3 struct {\n\tS3Path  string // full path in S3 i.e. testfiles/xx/yy/zzzzz.ext\n\tName    string // original name of the file\n\tSize    int64\n\tSha1Hex string\n\tMd5Hex  string\n}\n\nconst (\n\ts3Bucket     = \"kjkpub\"\n\ts3Dir        = \"testfiles/\"\n\tMaxS3Results = 1000\n)\n\nvar (\n\tflgPub        bool\n\tflgPublic     bool\n\tflgList       bool\n\tcachedSecrets *Secrets\n\n\twgUploads sync.WaitGroup\n\tinFatal   bool\n\tvalidExts = []string{\".pdf\", \".mobi\", \".epub\", \".chm\", \".cbz\", \".cbr\", \".xps\", \".djvu\"}\n)\n\nfunc (fi *FileInS3) Url() string {\n\treturn \"https://kjkpub.s3.amazonaws.com/testfiles/\" + fi.S3Path\n}\n\nfunc printStack() {\n\tbuf := make([]byte, 1024*164)\n\tn := runtime.Stack(buf, false)\n\tfmt.Printf(\"%s\", buf[:n])\n}\n\nfunc pj(elem ...string) string {\n\treturn filepath.Join(elem...)\n}\n\nfunc fatalf(format string, args ...interface{}) {\n\tfmt.Printf(format, args...)\n\tprintStack()\n\tos.Exit(1)\n}\n\nfunc fatalif(cond bool, format string, args ...interface{}) {\n\tif cond {\n\t\tif inFatal {\n\t\t\tos.Exit(1)\n\t\t}\n\t\tinFatal = true\n\t\tfmt.Printf(format, args...)\n\t\tprintStack()\n\t\tos.Exit(1)\n\t}\n}\n\nfunc fataliferr(err error) {\n\tif err != nil {\n\t\tfatalf(\"%s\\n\", err.Error())\n\t}\n}\nfunc isPublic() bool {\n\treturn flgPub || flgPublic\n}\n\nfunc strInArr(s string, a []string) bool {\n\tfor _, s2 := range a {\n\t\tif s == s2 {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc isSupportedFile(fileName string) bool {\n\text := strings.ToLower(filepath.Ext(fileName))\n\treturn strInArr(ext, validExts)\n}\n\nfunc readSecretsMust() *Secrets {\n\tif cachedSecrets != nil {\n\t\treturn cachedSecrets\n\t}\n\tpath := pj(\"scripts\", \"secrets.json\")\n\td, err := ioutil.ReadFile(path)\n\tfatalif(err != nil, \"readSecretsMust(): error %s reading file '%s'\\n\", err, path)\n\tvar s Secrets\n\terr = json.Unmarshal(d, &s)\n\tfatalif(err != nil, \"readSecretsMust(): failed to json-decode file '%s'. err: %s, data:\\n%s\\n\", path, err, string(d))\n\tfatalif(s.AwsAccess == \"\", \"AwsAccess in secrets.json missing\")\n\tfatalif(s.AwsSecret == \"\", \"AwsSecret in secrets.json missing\")\n\tcachedSecrets = &s\n\treturn cachedSecrets\n}\n\n// to minimize number of files per s3 \"directory\", we use 3 level structure\n// xx/yy/zzzzzzzzzzz..\n// This gives 256 files in the leaf for 16 million total files\nfunc sha1HexToS3Path(sha1Hex string) string {\n\tfatalif(len(sha1Hex) != 40, \"invalid sha1Hex '%s'\", sha1Hex)\n\treturn fmt.Sprintf(\"%s/%s/%s\", sha1Hex[:2], sha1Hex[2:4], sha1Hex[4:])\n}\n\nfunc removeExt(s string) string {\n\text := filepath.Ext(s)\n\tif len(ext) == 0 {\n\t\treturn s\n\t}\n\treturn s[:len(s)-len(ext)]\n}\n\n// reverse of sha1HexToS3Path\nfunc s3PathToSha1Hex(s string) string {\n\ts = removeExt(s)\n\ts = s[len(s)-42:]\n\tfatalif(s[2] != '/', \"s[2] is '%c', should be '/'\", s[2])\n\ts = strings.Replace(s, \"/\", \"\", -1)\n\tfatalif(len(s) != 40, \"len(s) is %d, should be 40\", len(s))\n\treturn s\n}\n\nfunc perc(total, n int) float64 {\n\treturn float64(n) * 100 / float64(total)\n}\n\nfunc calcFileInfo(fi *FileInfo) {\n\tfmt.Printf(\"calcFileInfo: '%s'\\n\", fi.Path)\n\tvar buf [16 * 1024]byte\n\tr, err := os.Open(fi.Path)\n\tfataliferr(err)\n\tdefer r.Close()\n\tsha1 := sha1.New()\n\tmd5Hash := md5.New()\n\tfi.Size = 0\n\tfor {\n\t\tn, err := r.Read(buf[:])\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\td := buf[:n]\n\t\tfataliferr(err)\n\t\tfatalif(n == 0, \"n is 0\")\n\t\tfi.Size += int64(n)\n\t\t_, err = sha1.Write(d)\n\t\tfataliferr(err)\n\t\t_, err = md5Hash.Write(d)\n\t\tfataliferr(err)\n\t}\n\tsha1Sum := sha1.Sum(nil)\n\tfi.Sha1Hex = fmt.Sprintf(\"%x\", sha1Sum)\n\n\tmd5Sum := md5Hash.Sum(nil)\n\tfi.Md5Hex = fmt.Sprintf(\"%x\", md5Sum)\n\tfi.Md5B64 = base64.StdEncoding.EncodeToString(md5Sum)\n\n\tfi.S3PathSha1Part = sha1HexToS3Path(fi.Sha1Hex)\n\text := strings.ToLower(filepath.Ext(fi.Path))\n\tfi.S3FullPath = s3Dir + fi.S3PathSha1Part + ext\n\tfmt.Printf(\"  sha1: %s\\n\", fi.Sha1Hex)\n\tfmt.Printf(\"   md5: %s\\n\", fi.Md5Hex)\n\tfmt.Printf(\"   md5: %s\\n\", fi.Md5B64)\n\tfmt.Printf(\"    s3: %s\\n\", fi.S3FullPath)\n\tfmt.Printf(\"  size: %d\\n\", fi.Size)\n}\n\n// TODO: speed it up by getting all files once at startup and using hashtable\n// to check for existence\nfunc sha1ExistsInS3Must(sha1 string) bool {\n\t// must do a list, because we add file extension at the end\n\tprefix := s3Dir + sha1[:2] + \"/\" + sha1[2:4] + \"/\" + sha1[4:]\n\tbucket := s3GetBucket()\n\tresp, err := bucket.List(prefix, \"\", \"\", MaxS3Results)\n\tfataliferr(err)\n\tkeys := resp.Contents\n\tfatalif(len(keys) > 1, \"len(keys) == %d (should be 0 or 1)\", len(keys))\n\treturn len(keys) == 1\n}\n\nfunc uploadFileInfo(fi *FileInfo) {\n\ttimeStart := time.Now()\n\tpathRemote := fi.S3FullPath\n\tpathLocal := fi.Path\n\tfmt.Printf(\"uploadFileInfo(): %s => %s, pub: %v, %d bytes\", pathLocal, pathRemote, isPublic(), fi.Size)\n\tif sha1ExistsInS3Must(fi.Sha1Hex) {\n\t\t// TODO: if different permissions (public vs. private), change the perms\n\t\t// TODO: for extra paranoia could verify that fi.Size matches size in S3\n\t\tfmt.Printf(\"  skipping because already exists\\n\")\n\t\treturn\n\t}\n\tbucket := s3GetBucket()\n\td, err := ioutil.ReadFile(pathLocal)\n\tfataliferr(err)\n\tmimeType := mime.TypeByExtension(filepath.Ext(pathLocal))\n\tperm := s3.Private\n\tif isPublic() {\n\t\tperm = s3.PublicRead\n\t}\n\topts := s3.Options{}\n\topts.Meta = make(map[string][]string)\n\topts.Meta[\"name\"] = []string{filepath.Base(pathLocal)}\n\topts.ContentMD5 = fi.Md5B64\n\terr = bucket.Put(pathRemote, d, mimeType, perm, opts)\n\tfataliferr(err)\n\tfmt.Printf(\" took %s\\n\", time.Since(timeStart))\n}\n\nfunc uploadWorker(files chan *FileInfo) {\n\tfor fi := range files {\n\t\tuploadFileInfo(fi)\n\t\twgUploads.Done()\n\t}\n}\n\nfunc uploadDir(dir string) {\n\tfmt.Printf(\"Uploading dir '%s'\\n\", dir)\n\tch := make(chan *FileInfo)\n\t// only one uploader because I'm most likely limited by bandwidth\n\tgo uploadWorker(ch)\n\tfilepath.Walk(dir, func(path string, fi os.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\treturn nil\n\t\t}\n\t\tif !isSupportedFile(path) {\n\t\t\treturn nil\n\t\t}\n\t\tfileInfo := &FileInfo{\n\t\t\tPath: path,\n\t\t}\n\t\tcalcFileInfo(fileInfo)\n\t\treturn nil\n\t})\n\tclose(ch)\n\twgUploads.Wait()\n}\n\nfunc uploadFile(filePath string) {\n\tfmt.Printf(\"Uploading file '%s'\\n\", filePath)\n\tfi := &FileInfo{\n\t\tPath: filePath,\n\t}\n\tcalcFileInfo(fi)\n\tuploadFileInfo(fi)\n}\n\n//Note: http.DefaultClient is more robust than aws.RetryingClient\n//(which fails for me with a timeout for large files e.g. ~6MB)\nfunc getS3Client() *http.Client {\n\t// return aws.RetryingClient\n\treturn http.DefaultClient\n}\n\nfunc s3GetBucket() *s3.Bucket {\n\ts3BucketName := \"kjkpub\"\n\tsecrets := readSecretsMust()\n\tauth := aws.Auth{\n\t\tAccessKey: secrets.AwsAccess,\n\t\tSecretKey: secrets.AwsSecret,\n\t}\n\t// Note: it's important that region is aws.USEast. This is where my bucket\n\t// is and giving a different region will fail\n\ts3Obj := s3.New(auth, aws.USEast, getS3Client())\n\treturn s3Obj.Bucket(s3BucketName)\n}\n\n// ETag gives the hex-encoded MD5 sum of the contents,\n// surrounded with double-quotes.\nfunc keyEtagToMd5Hex(s string) string {\n\tres := strings.Trim(s, `\"`)\n\tfatalif(len(res) != 32, \"len(res) = %d (should be 32)\", len(res))\n\treturn res\n}\n\nfunc s3ListFilesMust() []*FileInS3 {\n\tvar res []*FileInS3\n\tbucket := s3GetBucket()\n\tdelim := \"\"\n\tmarker := \"\"\n\tfor {\n\t\tresp, err := bucket.List(s3Dir, delim, marker, MaxS3Results)\n\t\tfataliferr(err)\n\t\tfor _, key := range resp.Contents {\n\t\t\tfi := &FileInS3{}\n\t\t\tfi.S3Path = key.Key\n\t\t\tfi.Size = key.Size\n\t\t\tfi.Md5Hex = keyEtagToMd5Hex(key.ETag)\n\t\t\tfi.Sha1Hex = s3PathToSha1Hex(key.Key)\n\t\t\t// TODO: get filename using func (b *Bucket) Head(path string, headers map[string][]string) (*http.Response, error)\n\t\t\t// and x-amz-meta-name header.\n\t\t\t// Cache locally because doing network call for each file will be\n\t\t\t// expensive\n\t\t\tres = append(res, fi)\n\t\t}\n\t\tif !resp.IsTruncated {\n\t\t\tbreak\n\t\t}\n\t\tmarker = resp.NextMarker\n\t}\n\treturn res\n}\n\nfunc s3List() {\n\tfiles := s3ListFilesMust()\n\tfmt.Printf(\"%d files\\n\", len(files))\n\tfor _, fi := range files {\n\t\tfmt.Printf(\"  %s, %d, '%s'\\n\", fi.S3Path, fi.Size, fi.Name)\n\t}\n}\n\nfunc usageAndExit() {\n\tfmt.Printf(\"s3 $fileOrDir \")\n}\n\nfunc main() {\n\tflag.BoolVar(&flgPub, \"pub\", false, \"should file be made public, short version\")\n\tflag.BoolVar(&flgPublic, \"public\", false, \"should file be made public\")\n\tflag.BoolVar(&flgList, \"list\", false, \"list files in s3\")\n\tflag.Parse()\n\tif flgList {\n\t\ts3List()\n\t\treturn\n\t}\n\tif 1 == len(flag.Args()) {\n\t\tusageAndExit()\n\t}\n\tfileOrDir := flag.Arg(0)\n\tfi, err := os.Stat(fileOrDir)\n\tfataliferr(err)\n\tif fi.IsDir() {\n\t\tuploadDir(fileOrDir)\n\t} else if fi.Mode().IsRegular() {\n\t\tuploadFile(fileOrDir)\n\t}\n}\n"
  },
  {
    "path": "tools/test-app/Resource.h",
    "content": "//{{NO_DEPENDENCIES}}\r\n// Microsoft Visual C++ generated include file.\r\n// Used by render-speed-test.rc\r\n//\r\n\r\n#define IDR_MAINFRAME\t\t\t128\r\n#define IDD_RENDERSPEEDTEST_DIALOG\t102\r\n#define IDD_ABOUTBOX\t\t\t103\r\n#define IDM_ABOUT\t\t\t\t104\r\n#define IDM_EXIT\t\t\t\t105\r\n#define IDI_RENDERSPEEDTEST\t\t\t107\r\n#define IDI_SMALL\t\t\t\t108\r\n#define IDC_RENDERSPEEDTEST\t\t\t109\r\n#define IDC_MYICON\t\t\t\t2\r\n#ifndef IDC_STATIC\r\n#define IDC_STATIC\t\t\t\t-1\r\n#endif\r\n// Next default values for new objects\r\n//\r\n#ifdef APSTUDIO_INVOKED\r\n#ifndef APSTUDIO_READONLY_SYMBOLS\r\n\r\n#define _APS_NO_MFC\t\t\t\t\t130\r\n#define _APS_NEXT_RESOURCE_VALUE\t129\r\n#define _APS_NEXT_COMMAND_VALUE\t\t32771\r\n#define _APS_NEXT_CONTROL_VALUE\t\t1000\r\n#define _APS_NEXT_SYMED_VALUE\t\t110\r\n#endif\r\n#endif\r\n"
  },
  {
    "path": "tools/test-app/scratch.cpp",
    "content": "#include \"stdafx.h\"\r\n\r\n#include \"test-app.h\"\r\n\r\nstruct Buf {\r\n    char *s;\r\n    u64 sLen;\r\n    bool owned;\r\n\r\n    Buf() {\r\n        Reset();\r\n    }\r\n\r\n    void Reset() {\r\n        s = nullptr;\r\n        sLen = 0;\r\n        owned = false;\r\n    }\r\n\r\n    explicit Buf(char *sIn, u64 sLenIn = (u64) -1, bool ownedIn = false) {\r\n        Set(sIn, sLenIn, ownedIn);\r\n    }\r\n    void Free() {\r\n        if (owned)\r\n            free(s);\r\n        Reset();\r\n    }\r\n\r\n    void Set(char *sIn, u64 sLenIn = (u64) -1, bool ownedIn = false) {\r\n        Free();\r\n        s = sIn;\r\n        if (sLenIn == (u64) -1) {\r\n            sLen = (u64) strlen(s);\r\n        }\r\n        else {\r\n            sLen = sLenIn;\r\n        }\r\n        owned = ownedIn;\r\n    }\r\n\r\n    void TakeOwnership(char *sIn, u64 sLenIn = (u64) -1) {\r\n        char *tmp = _strdup(sIn);\r\n        Set(tmp, sLenIn, true);\r\n    }\r\n\r\n    ~Buf() {\r\n        if (owned) {\r\n            free(s);\r\n        }\r\n    }\r\n};\r\n"
  },
  {
    "path": "tools/test-app/stdafx.cpp",
    "content": "// stdafx.cpp : source file that includes just the standard includes\r\n// render-speed-test.pch will be the pre-compiled header\r\n// stdafx.obj will contain the pre-compiled type information\r\n\r\n#include \"stdafx.h\"\r\n\r\n// TODO: reference any additional headers you need in STDAFX.H\r\n// and not in this file\r\n"
  },
  {
    "path": "tools/test-app/stdafx.h",
    "content": "// stdafx.h : include file for standard system include files,\r\n// or project specific include files that are used frequently, but\r\n// are changed infrequently\r\n//\r\n\r\n#pragma once\r\n\r\n#include \"targetver.h\"\r\n\r\n#include \"BaseUtil.h\"\r\n"
  },
  {
    "path": "tools/test-app/targetver.h",
    "content": "#pragma once\r\n\r\n// Including SDKDDKVer.h defines the highest available Windows platform.\r\n\r\n// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and\r\n// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.\r\n\r\n#include <SDKDDKVer.h>\r\n"
  },
  {
    "path": "tools/test-app/test-app.cpp",
    "content": "/*\r\nThe purpose of this is to have a skeleton of an app for easy testing ideas.\r\nMain benefit over adding code to Sumatra is that it's much smaller and compiles\r\nmuch more quickly.\r\n*/\r\n#include \"stdafx.h\"\r\n#include \"test-app.h\"\r\n\r\nHINSTANCE hInst;\r\n\r\n\r\n// http://kennykerr.ca/2014/03/29/classy-windows-2/s\r\ntemplate <typename T>\r\nstruct Window\r\n{\r\n    HWND m_window = nullptr;\r\n\r\n    static T * GetThisFromHandle(HWND window)\r\n    {\r\n        return reinterpret_cast<T *>(GetWindowLongPtr(window,\r\n            GWLP_USERDATA));\r\n    }\r\n\r\n    static LRESULT __stdcall WndProc(HWND window, UINT message, WPARAM wparam, LPARAM lparam)\r\n    {\r\n        CrashIf(!window);\r\n\r\n        if (WM_NCCREATE == message)\r\n        {\r\n            CREATESTRUCT * cs = reinterpret_cast<CREATESTRUCT *>(lparam);\r\n            T * that = static_cast<T *>(cs->lpCreateParams);\r\n            CrashIf(!that);\r\n            CrashIf(that->m_window);\r\n            that->m_window = window;\r\n            SetWindowLongPtr(window, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(that));\r\n        }\r\n        else if (T * that = GetThisFromHandle(window))\r\n        {\r\n            return that->MessageHandler(message, wparam, lparam);\r\n        }\r\n\r\n        return DefWindowProc(window, message, wparam, lparam);\r\n    }\r\n\r\n    LRESULT MessageHandler(UINT message, WPARAM wparam, LPARAM lparam)\r\n    {\r\n        if (WM_DESTROY == message)\r\n        {\r\n            PostQuitMessage(0);\r\n            return 0;\r\n        }\r\n\r\n        return DefWindowProc(m_window, message, wparam, lparam);\r\n    }\r\n};\r\n\r\nstruct SampleWindow : Window<SampleWindow>\r\n{\r\n    SampleWindow(const WCHAR *title)\r\n    {\r\n        WNDCLASS wc = {};\r\n\r\n        wc.hCursor = LoadCursor(nullptr, IDC_ARROW);\r\n        wc.hInstance = hInst;\r\n        wc.lpszClassName = L\"SAMPLE_WINDOW_WIN_CLASS\";\r\n        wc.style = CS_HREDRAW | CS_VREDRAW;\r\n        wc.lpfnWndProc = WndProc;\r\n\r\n        RegisterClass(&wc);\r\n\r\n        CreateWindowW(wc.lpszClassName,\r\n            title,\r\n            WS_OVERLAPPEDWINDOW | WS_VISIBLE,\r\n            CW_USEDEFAULT, CW_USEDEFAULT, 720, 480,\r\n            nullptr,\r\n            nullptr,\r\n            wc.hInstance,\r\n            this);\r\n    }\r\n\r\n    ~SampleWindow() {\r\n    }\r\n\r\n    LRESULT MessageHandler(UINT message, WPARAM wparam, LPARAM lparam)\r\n    {\r\n        if (WM_PAINT == message)\r\n        {\r\n            PaintHandler();\r\n            return 0;\r\n        }\r\n\r\n        if (WM_ERASEBKGND == message) {\r\n            // do nothing, helps to avoid flicker\r\n            return TRUE;\r\n        }\r\n\r\n        return Window::MessageHandler(message, wparam, lparam);\r\n    }\r\n\r\n    void PaintHandlerGdiplus()\r\n    {\r\n#if 0\r\n        PAINTSTRUCT ps;\r\n        HDC hdc = BeginPaint(m_window, &ps);\r\n        ClientRect rcClient(m_window);\r\n        RECT rTmp = rcClient.ToRECT();\r\n        ScopedGdiObj<HBRUSH> brushAboutBg(CreateSolidBrush(RGB(0xff, 0xff, 0xff)));\r\n        FillRect(hdc, &rTmp, brushAboutBg);\r\n        Pen                  debugPen(Color(255, 0, 0), 1);\r\n        EndPaint(m_window, &ps);\r\n#endif\r\n    }\r\n\r\n    void PaintHandler()\r\n    {\r\n        PaintHandlerGdiplus();\r\n    }\r\n};\r\n\r\nint APIENTRY wWinMain(_In_ HINSTANCE hInstance,\r\n                     _In_opt_ HINSTANCE,\r\n                     _In_ LPWSTR,\r\n                     _In_ int )\r\n{\r\n    hInst = hInstance;\r\n\r\n#if 0\r\n    ScopedCom initCom;\r\n    InitAllCommonControls();\r\n    ScopedGdiPlus initGdiplus;\r\n#endif\r\n    MSG msg;\r\n    HACCEL hAccelTable;\r\n\r\n    SampleWindow window(L\"Test app\");\r\n\r\n    hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_RENDERSPEEDTEST));\r\n    while (GetMessage(&msg, NULL, 0, 0))\r\n    {\r\n        if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))\r\n        {\r\n            TranslateMessage(&msg);\r\n            DispatchMessage(&msg);\r\n        }\r\n    }\r\n    return (int) msg.wParam;\r\n}\r\n"
  },
  {
    "path": "tools/test-app/test-app.h",
    "content": "#pragma once\r\n\r\n#include \"resource.h\"\r\n"
  },
  {
    "path": "tools/test-app/test-app.sln",
    "content": "﻿\r\nMicrosoft Visual Studio Solution File, Format Version 12.00\r\n# Visual Studio 2013\r\nVisualStudioVersion = 12.0.30110.0\r\nMinimumVisualStudioVersion = 10.0.40219.1\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"test-app\", \"test-app.vcxproj\", \"{BDF88450-FD68-4C65-8BEB-5CAF2A4DCBC3}\"\r\nEndProject\r\nGlobal\r\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n\t\tDebug|Win32 = Debug|Win32\r\n\t\tRelease|Win32 = Release|Win32\r\n\tEndGlobalSection\r\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n\t\t{BDF88450-FD68-4C65-8BEB-5CAF2A4DCBC3}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{BDF88450-FD68-4C65-8BEB-5CAF2A4DCBC3}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{BDF88450-FD68-4C65-8BEB-5CAF2A4DCBC3}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{BDF88450-FD68-4C65-8BEB-5CAF2A4DCBC3}.Release|Win32.Build.0 = Release|Win32\r\n\tEndGlobalSection\r\n\tGlobalSection(SolutionProperties) = preSolution\r\n\t\tHideSolutionNode = FALSE\r\n\tEndGlobalSection\r\nEndGlobal\r\n"
  },
  {
    "path": "tools/test-app/test-app.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"12.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{BDF88450-FD68-4C65-8BEB-5CAF2A4DCBC3}</ProjectGuid>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>renderspeedtest</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <PlatformToolset>v120</PlatformToolset>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <PlatformToolset>v120</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <IncludePath>$(ProjectDir)..\\..\\src\\utils;$(IncludePath)</IncludePath>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <IncludePath>$(ProjectDir)..\\..\\src\\utils;$(IncludePath)</IncludePath>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>Use</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <Optimization>Disabled</Optimization>\r\n      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;NO_LIBMUPDF;NO_LIBWEBP;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <SDLCheck>true</SDLCheck>\r\n      <DisableSpecificWarnings>4127;4100;4800;4627;4189</DisableSpecificWarnings>\r\n      <ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>Comctl32.lib;gdiplus.lib;Shlwapi.lib;Urlmon.lib;Wininet.lib;Version.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <WarningLevel>Level3</WarningLevel>\r\n      <PrecompiledHeader>Use</PrecompiledHeader>\r\n      <Optimization>MaxSpeed</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;NO_LIBMUPDF;NO_LIBWEBP;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <SDLCheck>true</SDLCheck>\r\n      <DisableSpecificWarnings>4127;4100;4800;4627;4189</DisableSpecificWarnings>\r\n      <ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>Comctl32.lib;gdiplus.lib;Shlwapi.lib;Urlmon.lib;Wininet.lib;Version.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\Allocator.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\BaseUtil.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\BencUtil.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\BitManip.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\BitReader.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\ByteOrderDecoder.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\ByteReader.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\CmdLineParser.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\CssParser.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\DbgHelpDyn.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\DebugLog.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\DialogSizer.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\Dict.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\DirIter.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\FileTransactions.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\FileUtil.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\FileWatcher.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\FrameTimeoutCalculator.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\FzImgReader.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\GdiPlusUtil.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\GeomUtil.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\HtmlParserLookup.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\HtmlPrettyPrint.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\HtmlPullParser.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\HtmlWindow.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\HttpUtil.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\JsonParser.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\PalmDbReader.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\Scoped.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\SerializeTxt.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\SettingsUtil.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\SimpleLog.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\SquareTreeParser.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\StrFormat.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\StrHash.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\StrSlice.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\StrUtil.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\TgaReader.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\ThreadUtil.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\Timer.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\Touch.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\TrivialHtmlParser.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\TxtParser.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\UITask.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\UtAssert.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\VarintGob.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\Vec.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\VecSegmented.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\WebpReader.h\" />\r\n    <ClInclude Include=\"..\\..\\src\\utils\\WinUtil.h\" />\r\n    <ClInclude Include=\"test-app.h\" />\r\n    <ClInclude Include=\"Resource.h\" />\r\n    <ClInclude Include=\"stdafx.h\" />\r\n    <ClInclude Include=\"targetver.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\BaseUtil.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\BencUtil.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\BitReader.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\ByteOrderDecoder.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\CmdLineParser.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\CssParser.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\DbgHelpDyn.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\DebugLog.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\DialogSizer.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\Dict.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\DirIter.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\FileTransactions.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\FileUtil.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\FileWatcher.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\FzImgReader.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\GdiPlusUtil.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\HtmlParserLookup.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\HtmlPrettyPrint.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\HtmlPullParser.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\HtmlWindow.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\HttpUtil.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\JsonParser.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\PalmDbReader.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\SerializeTxt.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\SettingsUtil.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\SquareTreeParser.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\StrFormat.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\StrSlice.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\StrUtil.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\TgaReader.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\ThreadUtil.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\Touch.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\TrivialHtmlParser.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\TxtParser.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\UITask.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\UtAssert.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\VarintGob.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\WebpReader.cpp\" />\r\n    <ClCompile Include=\"..\\..\\src\\utils\\WinUtil.cpp\" />\r\n    <ClCompile Include=\"test-app.cpp\" />\r\n    <ClCompile Include=\"stdafx.cpp\">\r\n      <PrecompiledHeader Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">Create</PrecompiledHeader>\r\n      <PrecompiledHeader Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">Create</PrecompiledHeader>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ResourceCompile Include=\"test-app.rc\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Image Include=\"test-app.ico\" />\r\n    <Image Include=\"small.ico\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <None Include=\"..\\..\\src\\utils\\HtmlParseTest00.html\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>\r\n"
  },
  {
    "path": "tools/test-app/test-app.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"Source Files\">\r\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r\n      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r\n    </Filter>\r\n    <Filter Include=\"Resource Files\">\r\n      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\r\n      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>\r\n    </Filter>\r\n    <Filter Include=\"Source Files\\utils\">\r\n      <UniqueIdentifier>{11f52f4a-a9a6-4762-9072-b3ad97d2fd57}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"Source Files\\mui\">\r\n      <UniqueIdentifier>{6908020d-5f2f-4b39-8f4a-e16017e5478a}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"stdafx.h\">\r\n      <Filter>Source Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"targetver.h\">\r\n      <Filter>Source Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"Resource.h\">\r\n      <Filter>Source Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"test-app.h\">\r\n      <Filter>Source Files</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\Allocator.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\BaseUtil.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\BencUtil.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\BitManip.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\BitReader.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\ByteOrderDecoder.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\ByteReader.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\CmdLineParser.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\CssParser.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\DbgHelpDyn.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\DebugLog.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\DialogSizer.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\Dict.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\DirIter.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\FileTransactions.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\FileUtil.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\FileWatcher.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\FrameTimeoutCalculator.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\FzImgReader.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\GdiPlusUtil.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\GeomUtil.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\HtmlParserLookup.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\HtmlPrettyPrint.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\HtmlPullParser.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\HtmlWindow.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\HttpUtil.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\JsonParser.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\PalmDbReader.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\Scoped.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\SerializeTxt.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\SettingsUtil.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\SimpleLog.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\SquareTreeParser.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\StrFormat.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\StrHash.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\StrSlice.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\StrUtil.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\TgaReader.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\ThreadUtil.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\Timer.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\Touch.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\TrivialHtmlParser.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\TxtParser.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\UITask.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\UtAssert.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\VarintGob.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\Vec.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\VecSegmented.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\WebpReader.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\..\\src\\utils\\WinUtil.h\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"stdafx.cpp\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"test-app.cpp\">\r\n      <Filter>Source Files</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\BaseUtil.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\BencUtil.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\BitReader.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\ByteOrderDecoder.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\CmdLineParser.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\CssParser.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\DbgHelpDyn.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\DebugLog.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\DialogSizer.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\Dict.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\DirIter.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\FileTransactions.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\FileUtil.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\FileWatcher.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\FzImgReader.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\GdiPlusUtil.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\HtmlParserLookup.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\HtmlPrettyPrint.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\HtmlPullParser.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\HtmlWindow.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\HttpUtil.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\JsonParser.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\PalmDbReader.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\SerializeTxt.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\SettingsUtil.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\SquareTreeParser.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\StrFormat.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\StrSlice.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\StrUtil.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\TgaReader.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\ThreadUtil.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\Touch.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\TrivialHtmlParser.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\TxtParser.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\UITask.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\UtAssert.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\VarintGob.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\WebpReader.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\..\\src\\utils\\WinUtil.cpp\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ResourceCompile Include=\"test-app.rc\">\r\n      <Filter>Resource Files</Filter>\r\n    </ResourceCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Image Include=\"small.ico\">\r\n      <Filter>Resource Files</Filter>\r\n    </Image>\r\n    <Image Include=\"test-app.ico\">\r\n      <Filter>Resource Files</Filter>\r\n    </Image>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <None Include=\"..\\..\\src\\utils\\HtmlParseTest00.html\">\r\n      <Filter>Source Files\\utils</Filter>\r\n    </None>\r\n  </ItemGroup>\r\n</Project>\r\n"
  },
  {
    "path": "vs2015/Installer.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{F34AFA57-5FB5-AECE-A8F3-5F74149D8C23}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>Installer</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\Installer\\</IntDir>\r\n    <TargetName>Installer</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\Installer\\</IntDir>\r\n    <TargetName>Installer</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\Installer\\</IntDir>\r\n    <TargetName>Installer</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\Installer\\</IntDir>\r\n    <TargetName>Installer</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\Installer\\</IntDir>\r\n    <TargetName>Installer</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\Installer\\</IntDir>\r\n    <TargetName>Installer</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4100;4131;4244;4267;4302;4311;4312;4456;4457;4838;4702;4706;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;INSTALL_PAYLOAD_ZIP=.\\../dbg\\InstallerData.dat;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n    <PreBuildEvent>\r\n      <Command>cd ../dbg &amp; ..\\rel\\MakeLZSA.exe InstallerData.dat SumatraPDF-no-MUPDF.exe:SumatraPDF.exe libmupdf.dll:libmupdf.dll PdfFilter.dll:PdfFilter.dll PdfPreview.dll:PdfPreview.dll Uninstaller.exe:uninstall.exe ..\\mupdf\\resources\\fonts\\droid\\DroidSansFallback.ttf:DroidSansFallback.ttf</Command>\r\n    </PreBuildEvent>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4100;4131;4244;4267;4302;4311;4312;4456;4457;4838;4702;4706;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;INSTALL_PAYLOAD_ZIP=.\\../dbg64\\InstallerData.dat;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n    <PreBuildEvent>\r\n      <Command>cd ../dbg64 &amp; ..\\rel\\MakeLZSA.exe InstallerData.dat SumatraPDF-no-MUPDF.exe:SumatraPDF.exe libmupdf.dll:libmupdf.dll PdfFilter.dll:PdfFilter.dll PdfPreview.dll:PdfPreview.dll Uninstaller.exe:uninstall.exe ..\\mupdf\\resources\\fonts\\droid\\DroidSansFallback.ttf:DroidSansFallback.ttf</Command>\r\n    </PreBuildEvent>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4100;4131;4244;4267;4302;4311;4312;4456;4457;4838;4702;4706;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;INSTALL_PAYLOAD_ZIP=.\\../rel\\InstallerData.dat;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n    <PreBuildEvent>\r\n      <Command>cd ../rel &amp; ..\\rel\\MakeLZSA.exe InstallerData.dat SumatraPDF-no-MUPDF.exe:SumatraPDF.exe libmupdf.dll:libmupdf.dll PdfFilter.dll:PdfFilter.dll PdfPreview.dll:PdfPreview.dll Uninstaller.exe:uninstall.exe ..\\mupdf\\resources\\fonts\\droid\\DroidSansFallback.ttf:DroidSansFallback.ttf</Command>\r\n    </PreBuildEvent>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4100;4131;4244;4267;4302;4311;4312;4456;4457;4838;4702;4706;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;INSTALL_PAYLOAD_ZIP=.\\../rel64\\InstallerData.dat;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n    <PreBuildEvent>\r\n      <Command>cd ../rel64 &amp; ..\\rel\\MakeLZSA.exe InstallerData.dat SumatraPDF-no-MUPDF.exe:SumatraPDF.exe libmupdf.dll:libmupdf.dll PdfFilter.dll:PdfFilter.dll PdfPreview.dll:PdfPreview.dll Uninstaller.exe:uninstall.exe ..\\mupdf\\resources\\fonts\\droid\\DroidSansFallback.ttf:DroidSansFallback.ttf</Command>\r\n    </PreBuildEvent>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4018;4100;4131;4244;4267;4302;4311;4312;4456;4457;4838;4702;4706;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;INSTALL_PAYLOAD_ZIP=.\\../relPrefast\\InstallerData.dat;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n    </Link>\r\n    <PreBuildEvent>\r\n      <Command>cd ../relPrefast &amp; ..\\rel\\MakeLZSA.exe InstallerData.dat SumatraPDF-no-MUPDF.exe:SumatraPDF.exe libmupdf.dll:libmupdf.dll PdfFilter.dll:PdfFilter.dll PdfPreview.dll:PdfPreview.dll Uninstaller.exe:uninstall.exe ..\\mupdf\\resources\\fonts\\droid\\DroidSansFallback.ttf:DroidSansFallback.ttf</Command>\r\n    </PreBuildEvent>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4018;4100;4131;4244;4267;4302;4311;4312;4456;4457;4838;4702;4706;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;INSTALL_PAYLOAD_ZIP=.\\../relPrefast64\\InstallerData.dat;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n    </Link>\r\n    <PreBuildEvent>\r\n      <Command>cd ../relPrefast64 &amp; ..\\rel\\MakeLZSA.exe InstallerData.dat SumatraPDF-no-MUPDF.exe:SumatraPDF.exe libmupdf.dll:libmupdf.dll PdfFilter.dll:PdfFilter.dll PdfPreview.dll:PdfPreview.dll Uninstaller.exe:uninstall.exe ..\\mupdf\\resources\\fonts\\droid\\DroidSansFallback.ttf:DroidSansFallback.ttf</Command>\r\n    </PreBuildEvent>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\CrashHandler.h\" />\r\n    <ClInclude Include=\"..\\src\\Translations.h\" />\r\n    <ClInclude Include=\"..\\src\\installer\\Installer.h\" />\r\n    <ClInclude Include=\"..\\src\\installer\\Resource.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\ArchUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\BaseUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\BitReader.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\ByteOrderDecoder.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\CmdLineParser.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\DbgHelpDyn.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\DebugLog.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\Dict.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\DirIter.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\Dpi.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\FileTransactions.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\FileUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\FzImgReader.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\GdiPlusUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\HttpUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\LzmaSimpleArchive.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\StrFormat.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\StrSlice.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\StrUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\TgaReader.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\ThreadUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\UITask.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\WebpReader.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\WinDynCalls.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\WinUtil.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\ext\\bzip2\\bzip_all.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zBuf.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zDec.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zIn.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zStream.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Bcj2.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Bra.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Bra86.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzFind.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzFindMt.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Lzma2Dec.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzmaDec.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzmaEnc.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Threads.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\_7z\\_7z.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\conv.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\crc32.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\stream.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\unarr.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\CpuArch.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd7.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd7Dec.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd8.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd8Dec.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\filter-rar.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\huffman-rar.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\parse-rar.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\rar.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\rarvm.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\uncompress-rar.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\tar\\parse-tar.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\tar\\tar.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\inflate.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\parse-zip.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\uncompress-zip.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\zip.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\adler32.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\compress.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\crc32.c\">\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)\\crc321.obj</ObjectFileName>\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(IntDir)\\crc321.obj</ObjectFileName>\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)\\crc321.obj</ObjectFileName>\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(IntDir)\\crc321.obj</ObjectFileName>\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)\\crc321.obj</ObjectFileName>\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">$(IntDir)\\crc321.obj</ObjectFileName>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\deflate.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\gzclose.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\gzlib.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\gzread.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\gzwrite.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\inffast.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\inflate.c\">\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)\\inflate1.obj</ObjectFileName>\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(IntDir)\\inflate1.obj</ObjectFileName>\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)\\inflate1.obj</ObjectFileName>\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(IntDir)\\inflate1.obj</ObjectFileName>\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)\\inflate1.obj</ObjectFileName>\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">$(IntDir)\\inflate1.obj</ObjectFileName>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\inftrees.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\trees.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\zutil.c\" />\r\n    <ClCompile Include=\"..\\src\\CrashHandler.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Translations.cpp\" />\r\n    <ClCompile Include=\"..\\src\\installer\\Installer.cpp\" />\r\n    <ClCompile Include=\"..\\src\\installer\\Trans_installer_txt.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\ArchUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\BaseUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\BitReader.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\ByteOrderDecoder.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\CmdLineParser.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\DbgHelpDyn.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\DebugLog.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\Dict.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\DirIter.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\Dpi.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\FileTransactions.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\FileUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\FzImgReader.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\GdiPlusUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\HttpUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\LzmaSimpleArchive.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\StrFormat.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\StrSlice.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\StrUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\TgaReader.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\ThreadUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\UITask.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\WebpReader.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\WinDynCalls.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\WinUtil.cpp\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ResourceCompile Include=\"..\\src\\installer\\Installer.rc\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/Installer.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"ext\">\r\n      <UniqueIdentifier>{7670880B-E279-887C-6BF5-9E7CD7FD937C}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"ext\\bzip2\">\r\n      <UniqueIdentifier>{6CFB48FC-D865-FD72-21A4-AE188D4DDBC7}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"ext\\lzma\">\r\n      <UniqueIdentifier>{39F81ED9-25C5-79E4-4EDE-678C3A0AAF72}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"ext\\lzma\\C\">\r\n      <UniqueIdentifier>{CBF0BD9C-B7A8-FFE9-20B0-D8450C879ADA}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"ext\\unarr\">\r\n      <UniqueIdentifier>{ED169AFD-5981-4E74-A2BF-FF190E692CC9}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"ext\\unarr\\_7z\">\r\n      <UniqueIdentifier>{EC2691D9-58E7-0C10-2122-568D8DA151EC}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"ext\\unarr\\common\">\r\n      <UniqueIdentifier>{A58B8DDE-9184-AC30-BAB6-91B5A60E8C3C}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"ext\\unarr\\lzmasdk\">\r\n      <UniqueIdentifier>{925DAD7E-FE73-AB14-47EB-3636B3407C9C}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"ext\\unarr\\rar\">\r\n      <UniqueIdentifier>{217D91D9-8D3D-0D10-5678-568DC2F751EC}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"ext\\unarr\\tar\">\r\n      <UniqueIdentifier>{A38591D9-0F46-0D10-D880-568D440052EC}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"ext\\unarr\\zip\">\r\n      <UniqueIdentifier>{2FA091D9-9B60-0D10-649B-568DD01A52EC}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"ext\\zlib\">\r\n      <UniqueIdentifier>{766926D9-6236-81E4-8B4F-6F8C777BB672}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"src\">\r\n      <UniqueIdentifier>{2DAB880B-99B4-887C-2230-9F7C8E38947C}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"src\\installer\">\r\n      <UniqueIdentifier>{EACC4227-568D-BE5D-1FC8-07DB8B47033A}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"src\\utils\">\r\n      <UniqueIdentifier>{6DAA42B6-D914-F72C-2253-A8D28EFCD481}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\CrashHandler.h\">\r\n      <Filter>src</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\Translations.h\">\r\n      <Filter>src</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\installer\\Installer.h\">\r\n      <Filter>src\\installer</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\installer\\Resource.h\">\r\n      <Filter>src\\installer</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\ArchUtil.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\BaseUtil.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\BitReader.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\ByteOrderDecoder.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\CmdLineParser.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\DbgHelpDyn.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\DebugLog.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\Dict.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\DirIter.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\Dpi.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\FileTransactions.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\FileUtil.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\FzImgReader.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\GdiPlusUtil.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\HttpUtil.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\LzmaSimpleArchive.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\StrFormat.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\StrSlice.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\StrUtil.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\TgaReader.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\ThreadUtil.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\UITask.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\WebpReader.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\WinDynCalls.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\WinUtil.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\ext\\bzip2\\bzip_all.c\">\r\n      <Filter>ext\\bzip2</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zBuf.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zDec.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zIn.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zStream.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Bcj2.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Bra.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Bra86.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzFind.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzFindMt.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Lzma2Dec.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzmaDec.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzmaEnc.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Threads.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\_7z\\_7z.c\">\r\n      <Filter>ext\\unarr\\_7z</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\conv.c\">\r\n      <Filter>ext\\unarr\\common</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\crc32.c\">\r\n      <Filter>ext\\unarr\\common</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\stream.c\">\r\n      <Filter>ext\\unarr\\common</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\unarr.c\">\r\n      <Filter>ext\\unarr\\common</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\CpuArch.c\">\r\n      <Filter>ext\\unarr\\lzmasdk</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd7.c\">\r\n      <Filter>ext\\unarr\\lzmasdk</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd7Dec.c\">\r\n      <Filter>ext\\unarr\\lzmasdk</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd8.c\">\r\n      <Filter>ext\\unarr\\lzmasdk</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd8Dec.c\">\r\n      <Filter>ext\\unarr\\lzmasdk</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\filter-rar.c\">\r\n      <Filter>ext\\unarr\\rar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\huffman-rar.c\">\r\n      <Filter>ext\\unarr\\rar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\parse-rar.c\">\r\n      <Filter>ext\\unarr\\rar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\rar.c\">\r\n      <Filter>ext\\unarr\\rar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\rarvm.c\">\r\n      <Filter>ext\\unarr\\rar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\uncompress-rar.c\">\r\n      <Filter>ext\\unarr\\rar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\tar\\parse-tar.c\">\r\n      <Filter>ext\\unarr\\tar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\tar\\tar.c\">\r\n      <Filter>ext\\unarr\\tar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\inflate.c\">\r\n      <Filter>ext\\unarr\\zip</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\parse-zip.c\">\r\n      <Filter>ext\\unarr\\zip</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\uncompress-zip.c\">\r\n      <Filter>ext\\unarr\\zip</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\zip.c\">\r\n      <Filter>ext\\unarr\\zip</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\adler32.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\compress.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\crc32.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\deflate.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\gzclose.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\gzlib.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\gzread.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\gzwrite.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\inffast.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\inflate.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\inftrees.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\trees.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\zutil.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\CrashHandler.cpp\">\r\n      <Filter>src</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\Translations.cpp\">\r\n      <Filter>src</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\installer\\Installer.cpp\">\r\n      <Filter>src\\installer</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\installer\\Trans_installer_txt.cpp\">\r\n      <Filter>src\\installer</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\ArchUtil.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\BaseUtil.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\BitReader.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\ByteOrderDecoder.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\CmdLineParser.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\DbgHelpDyn.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\DebugLog.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\Dict.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\DirIter.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\Dpi.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\FileTransactions.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\FileUtil.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\FzImgReader.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\GdiPlusUtil.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\HttpUtil.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\LzmaSimpleArchive.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\StrFormat.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\StrSlice.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\StrUtil.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\TgaReader.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\ThreadUtil.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\UITask.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\WebpReader.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\WinDynCalls.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\WinUtil.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ResourceCompile Include=\"..\\src\\installer\\Installer.rc\">\r\n      <Filter>src\\installer</Filter>\r\n    </ResourceCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/InstallerNoData.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{EA6B8310-56F7-F0D4-5F08-74C9CB124DD5}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>InstallerNoData</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\InstallerNoData\\</IntDir>\r\n    <TargetName>InstallerNoData</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\InstallerNoData\\</IntDir>\r\n    <TargetName>InstallerNoData</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\InstallerNoData\\</IntDir>\r\n    <TargetName>InstallerNoData</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\InstallerNoData\\</IntDir>\r\n    <TargetName>InstallerNoData</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\InstallerNoData\\</IntDir>\r\n    <TargetName>InstallerNoData</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\InstallerNoData\\</IntDir>\r\n    <TargetName>InstallerNoData</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4100;4131;4244;4267;4302;4311;4312;4456;4457;4838;4702;4706;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4100;4131;4244;4267;4302;4311;4312;4456;4457;4838;4702;4706;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4100;4131;4244;4267;4302;4311;4312;4456;4457;4838;4702;4706;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4100;4131;4244;4267;4302;4311;4312;4456;4457;4838;4702;4706;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4018;4100;4131;4244;4267;4302;4311;4312;4456;4457;4838;4702;4706;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4018;4100;4131;4244;4267;4302;4311;4312;4456;4457;4838;4702;4706;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NO_LIBWEBP;NO_LIBMUPDF;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;..\\ext\\bzip2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\CrashHandler.h\" />\r\n    <ClInclude Include=\"..\\src\\Translations.h\" />\r\n    <ClInclude Include=\"..\\src\\installer\\Installer.h\" />\r\n    <ClInclude Include=\"..\\src\\installer\\Resource.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\ArchUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\BaseUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\BitReader.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\ByteOrderDecoder.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\CmdLineParser.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\DbgHelpDyn.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\DebugLog.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\Dict.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\DirIter.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\Dpi.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\FileTransactions.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\FileUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\FzImgReader.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\GdiPlusUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\HttpUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\LzmaSimpleArchive.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\StrFormat.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\StrSlice.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\StrUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\TgaReader.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\ThreadUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\UITask.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\WebpReader.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\WinDynCalls.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\WinUtil.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\ext\\bzip2\\bzip_all.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zBuf.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zDec.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zIn.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zStream.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Bcj2.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Bra.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Bra86.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzFind.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzFindMt.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Lzma2Dec.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzmaDec.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzmaEnc.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Threads.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\_7z\\_7z.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\conv.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\crc32.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\stream.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\unarr.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\CpuArch.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd7.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd7Dec.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd8.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd8Dec.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\filter-rar.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\huffman-rar.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\parse-rar.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\rar.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\rarvm.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\uncompress-rar.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\tar\\parse-tar.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\tar\\tar.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\inflate.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\parse-zip.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\uncompress-zip.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\zip.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\adler32.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\compress.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\crc32.c\">\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)\\crc321.obj</ObjectFileName>\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(IntDir)\\crc321.obj</ObjectFileName>\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)\\crc321.obj</ObjectFileName>\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(IntDir)\\crc321.obj</ObjectFileName>\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)\\crc321.obj</ObjectFileName>\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">$(IntDir)\\crc321.obj</ObjectFileName>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\deflate.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\gzclose.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\gzlib.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\gzread.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\gzwrite.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\inffast.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\inflate.c\">\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)\\inflate1.obj</ObjectFileName>\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(IntDir)\\inflate1.obj</ObjectFileName>\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)\\inflate1.obj</ObjectFileName>\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(IntDir)\\inflate1.obj</ObjectFileName>\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)\\inflate1.obj</ObjectFileName>\r\n      <ObjectFileName Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">$(IntDir)\\inflate1.obj</ObjectFileName>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\inftrees.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\trees.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\zutil.c\" />\r\n    <ClCompile Include=\"..\\src\\CrashHandler.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Translations.cpp\" />\r\n    <ClCompile Include=\"..\\src\\installer\\Installer.cpp\" />\r\n    <ClCompile Include=\"..\\src\\installer\\Trans_installer_txt.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\ArchUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\BaseUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\BitReader.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\ByteOrderDecoder.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\CmdLineParser.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\DbgHelpDyn.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\DebugLog.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\Dict.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\DirIter.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\Dpi.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\FileTransactions.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\FileUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\FzImgReader.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\GdiPlusUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\HttpUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\LzmaSimpleArchive.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\StrFormat.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\StrSlice.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\StrUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\TgaReader.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\ThreadUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\UITask.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\WebpReader.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\WinDynCalls.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\WinUtil.cpp\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ResourceCompile Include=\"..\\src\\installer\\Installer.rc\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/InstallerNoData.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"ext\">\r\n      <UniqueIdentifier>{7670880B-E279-887C-6BF5-9E7CD7FD937C}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"ext\\bzip2\">\r\n      <UniqueIdentifier>{6CFB48FC-D865-FD72-21A4-AE188D4DDBC7}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"ext\\lzma\">\r\n      <UniqueIdentifier>{39F81ED9-25C5-79E4-4EDE-678C3A0AAF72}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"ext\\lzma\\C\">\r\n      <UniqueIdentifier>{CBF0BD9C-B7A8-FFE9-20B0-D8450C879ADA}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"ext\\unarr\">\r\n      <UniqueIdentifier>{ED169AFD-5981-4E74-A2BF-FF190E692CC9}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"ext\\unarr\\_7z\">\r\n      <UniqueIdentifier>{EC2691D9-58E7-0C10-2122-568D8DA151EC}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"ext\\unarr\\common\">\r\n      <UniqueIdentifier>{A58B8DDE-9184-AC30-BAB6-91B5A60E8C3C}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"ext\\unarr\\lzmasdk\">\r\n      <UniqueIdentifier>{925DAD7E-FE73-AB14-47EB-3636B3407C9C}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"ext\\unarr\\rar\">\r\n      <UniqueIdentifier>{217D91D9-8D3D-0D10-5678-568DC2F751EC}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"ext\\unarr\\tar\">\r\n      <UniqueIdentifier>{A38591D9-0F46-0D10-D880-568D440052EC}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"ext\\unarr\\zip\">\r\n      <UniqueIdentifier>{2FA091D9-9B60-0D10-649B-568DD01A52EC}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"ext\\zlib\">\r\n      <UniqueIdentifier>{766926D9-6236-81E4-8B4F-6F8C777BB672}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"src\">\r\n      <UniqueIdentifier>{2DAB880B-99B4-887C-2230-9F7C8E38947C}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"src\\installer\">\r\n      <UniqueIdentifier>{EACC4227-568D-BE5D-1FC8-07DB8B47033A}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"src\\utils\">\r\n      <UniqueIdentifier>{6DAA42B6-D914-F72C-2253-A8D28EFCD481}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\CrashHandler.h\">\r\n      <Filter>src</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\Translations.h\">\r\n      <Filter>src</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\installer\\Installer.h\">\r\n      <Filter>src\\installer</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\installer\\Resource.h\">\r\n      <Filter>src\\installer</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\ArchUtil.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\BaseUtil.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\BitReader.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\ByteOrderDecoder.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\CmdLineParser.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\DbgHelpDyn.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\DebugLog.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\Dict.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\DirIter.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\Dpi.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\FileTransactions.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\FileUtil.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\FzImgReader.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\GdiPlusUtil.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\HttpUtil.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\LzmaSimpleArchive.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\StrFormat.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\StrSlice.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\StrUtil.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\TgaReader.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\ThreadUtil.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\UITask.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\WebpReader.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\WinDynCalls.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\WinUtil.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\ext\\bzip2\\bzip_all.c\">\r\n      <Filter>ext\\bzip2</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zBuf.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zDec.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zIn.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zStream.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Bcj2.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Bra.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Bra86.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzFind.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzFindMt.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Lzma2Dec.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzmaDec.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzmaEnc.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Threads.c\">\r\n      <Filter>ext\\lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\_7z\\_7z.c\">\r\n      <Filter>ext\\unarr\\_7z</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\conv.c\">\r\n      <Filter>ext\\unarr\\common</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\crc32.c\">\r\n      <Filter>ext\\unarr\\common</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\stream.c\">\r\n      <Filter>ext\\unarr\\common</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\unarr.c\">\r\n      <Filter>ext\\unarr\\common</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\CpuArch.c\">\r\n      <Filter>ext\\unarr\\lzmasdk</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd7.c\">\r\n      <Filter>ext\\unarr\\lzmasdk</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd7Dec.c\">\r\n      <Filter>ext\\unarr\\lzmasdk</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd8.c\">\r\n      <Filter>ext\\unarr\\lzmasdk</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd8Dec.c\">\r\n      <Filter>ext\\unarr\\lzmasdk</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\filter-rar.c\">\r\n      <Filter>ext\\unarr\\rar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\huffman-rar.c\">\r\n      <Filter>ext\\unarr\\rar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\parse-rar.c\">\r\n      <Filter>ext\\unarr\\rar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\rar.c\">\r\n      <Filter>ext\\unarr\\rar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\rarvm.c\">\r\n      <Filter>ext\\unarr\\rar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\uncompress-rar.c\">\r\n      <Filter>ext\\unarr\\rar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\tar\\parse-tar.c\">\r\n      <Filter>ext\\unarr\\tar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\tar\\tar.c\">\r\n      <Filter>ext\\unarr\\tar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\inflate.c\">\r\n      <Filter>ext\\unarr\\zip</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\parse-zip.c\">\r\n      <Filter>ext\\unarr\\zip</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\uncompress-zip.c\">\r\n      <Filter>ext\\unarr\\zip</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\zip.c\">\r\n      <Filter>ext\\unarr\\zip</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\adler32.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\compress.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\crc32.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\deflate.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\gzclose.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\gzlib.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\gzread.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\gzwrite.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\inffast.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\inflate.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\inftrees.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\trees.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\zlib\\zutil.c\">\r\n      <Filter>ext\\zlib</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\CrashHandler.cpp\">\r\n      <Filter>src</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\Translations.cpp\">\r\n      <Filter>src</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\installer\\Installer.cpp\">\r\n      <Filter>src\\installer</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\installer\\Trans_installer_txt.cpp\">\r\n      <Filter>src\\installer</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\ArchUtil.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\BaseUtil.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\BitReader.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\ByteOrderDecoder.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\CmdLineParser.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\DbgHelpDyn.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\DebugLog.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\Dict.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\DirIter.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\Dpi.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\FileTransactions.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\FileUtil.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\FzImgReader.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\GdiPlusUtil.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\HttpUtil.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\LzmaSimpleArchive.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\StrFormat.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\StrSlice.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\StrUtil.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\TgaReader.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\ThreadUtil.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\UITask.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\WebpReader.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\WinDynCalls.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\WinUtil.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ResourceCompile Include=\"..\\src\\installer\\Installer.rc\">\r\n      <Filter>src\\installer</Filter>\r\n    </ResourceCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/MakeLZSA.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{9D3338B7-8900-93C2-B219-816A9E45C850}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>MakeLZSA</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\MakeLZSA\\</IntDir>\r\n    <TargetName>MakeLZSA</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\MakeLZSA\\</IntDir>\r\n    <TargetName>MakeLZSA</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\MakeLZSA\\</IntDir>\r\n    <TargetName>MakeLZSA</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\MakeLZSA\\</IntDir>\r\n    <TargetName>MakeLZSA</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\MakeLZSA\\</IntDir>\r\n    <TargetName>MakeLZSA</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\MakeLZSA\\</IntDir>\r\n    <TargetName>MakeLZSA</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\unarr;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\unarr;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\unarr;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\unarr;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\unarr;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\unarr;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\tools\\MakeLzSA.cpp\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"unarrlib.vcxproj\">\r\n      <Project>{C45AE373-B027-3E7F-D940-2C27C56C730D}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"utils.vcxproj\">\r\n      <Project>{169C8510-82B0-ADC1-4B32-5121B705AAF2}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"zlib.vcxproj\">\r\n      <Project>{16CFA17C-0206-A30D-ABF2-881097081F0F}</Project>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/PdfFilter.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{85945DF9-F1FE-1170-3A3D-C315A6E6EFC4}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>PdfFilter</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\PdfFilter\\</IntDir>\r\n    <TargetName>PdfFilter</TargetName>\r\n    <TargetExt>.dll</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\PdfFilter\\</IntDir>\r\n    <TargetName>PdfFilter</TargetName>\r\n    <TargetExt>.dll</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\PdfFilter\\</IntDir>\r\n    <TargetName>PdfFilter</TargetName>\r\n    <TargetExt>.dll</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\PdfFilter\\</IntDir>\r\n    <TargetName>PdfFilter</TargetName>\r\n    <TargetExt>.dll</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\PdfFilter\\</IntDir>\r\n    <TargetName>PdfFilter</TargetName>\r\n    <TargetExt>.dll</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\PdfFilter\\</IntDir>\r\n    <TargetName>PdfFilter</TargetName>\r\n    <TargetExt>.dll</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;BUILD_TEX_IFILTER;BUILD_EPUB_IFILTER;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;BUILD_TEX_IFILTER;BUILD_EPUB_IFILTER;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;shlwapi.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <ImportLibrary>..\\dbg\\PdfFilter.lib</ImportLibrary>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;BUILD_TEX_IFILTER;BUILD_EPUB_IFILTER;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;BUILD_TEX_IFILTER;BUILD_EPUB_IFILTER;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;shlwapi.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <ImportLibrary>..\\dbg64\\PdfFilter.lib</ImportLibrary>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;shlwapi.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <ImportLibrary>..\\rel\\PdfFilter.lib</ImportLibrary>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;shlwapi.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <ImportLibrary>..\\rel64\\PdfFilter.lib</ImportLibrary>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;shlwapi.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <ImportLibrary>..\\relPrefast\\PdfFilter.lib</ImportLibrary>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;shlwapi.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <ImportLibrary>..\\relPrefast64\\PdfFilter.lib</ImportLibrary>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\EbookDoc.h\" />\r\n    <ClInclude Include=\"..\\src\\MobiDoc.h\" />\r\n    <ClInclude Include=\"..\\src\\ifilter\\CEpubFilter.h\" />\r\n    <ClInclude Include=\"..\\src\\ifilter\\CPdfFilter.h\" />\r\n    <ClInclude Include=\"..\\src\\ifilter\\CTeXFilter.h\" />\r\n    <ClInclude Include=\"..\\src\\ifilter\\FilterBase.h\" />\r\n    <ClInclude Include=\"..\\src\\ifilter\\PdfFilter.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\PalmDbReader.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\EbookDoc.cpp\">\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">true</ExcludedFromBuild>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\MUPDF_Exports.cpp\" />\r\n    <ClCompile Include=\"..\\src\\MobiDoc.cpp\">\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">true</ExcludedFromBuild>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\PdfEngine.cpp\" />\r\n    <ClCompile Include=\"..\\src\\ifilter\\CEpubFilter.cpp\">\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">true</ExcludedFromBuild>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ifilter\\CPdfFilter.cpp\" />\r\n    <ClCompile Include=\"..\\src\\ifilter\\CTeXFilter.cpp\">\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">true</ExcludedFromBuild>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ifilter\\PdfFilterDll.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\PalmDbReader.cpp\">\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">true</ExcludedFromBuild>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ResourceCompile Include=\"..\\src\\ifilter\\PdfFilter.rc\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"utils.vcxproj\">\r\n      <Project>{169C8510-82B0-ADC1-4B32-5121B705AAF2}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"libmupdf.vcxproj\">\r\n      <Project>{B812ACA6-A4DF-06B2-CDF8-F459B9243C40}</Project>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/PdfFilter.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"ifilter\">\r\n      <UniqueIdentifier>{74F9F98B-E0D8-7827-E9F0-03FE554FDF88}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"utils\">\r\n      <UniqueIdentifier>{169C8510-82B0-ADC1-4B32-5121B705AAF2}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\EbookDoc.h\" />\r\n    <ClInclude Include=\"..\\src\\MobiDoc.h\" />\r\n    <ClInclude Include=\"..\\src\\ifilter\\CEpubFilter.h\">\r\n      <Filter>ifilter</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ifilter\\CPdfFilter.h\">\r\n      <Filter>ifilter</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ifilter\\CTeXFilter.h\">\r\n      <Filter>ifilter</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ifilter\\FilterBase.h\">\r\n      <Filter>ifilter</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\ifilter\\PdfFilter.h\">\r\n      <Filter>ifilter</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\PalmDbReader.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\EbookDoc.cpp\" />\r\n    <ClCompile Include=\"..\\src\\MUPDF_Exports.cpp\" />\r\n    <ClCompile Include=\"..\\src\\MobiDoc.cpp\" />\r\n    <ClCompile Include=\"..\\src\\PdfEngine.cpp\" />\r\n    <ClCompile Include=\"..\\src\\ifilter\\CEpubFilter.cpp\">\r\n      <Filter>ifilter</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ifilter\\CPdfFilter.cpp\">\r\n      <Filter>ifilter</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ifilter\\CTeXFilter.cpp\">\r\n      <Filter>ifilter</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ifilter\\PdfFilterDll.cpp\">\r\n      <Filter>ifilter</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\PalmDbReader.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ResourceCompile Include=\"..\\src\\ifilter\\PdfFilter.rc\">\r\n      <Filter>ifilter</Filter>\r\n    </ResourceCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/PdfPreview.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{616F573B-4D27-9988-B62E-72E4A2053479}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>PdfPreview</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\PdfPreview\\</IntDir>\r\n    <TargetName>PdfPreview</TargetName>\r\n    <TargetExt>.dll</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\PdfPreview\\</IntDir>\r\n    <TargetName>PdfPreview</TargetName>\r\n    <TargetExt>.dll</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\PdfPreview\\</IntDir>\r\n    <TargetName>PdfPreview</TargetName>\r\n    <TargetExt>.dll</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\PdfPreview\\</IntDir>\r\n    <TargetName>PdfPreview</TargetName>\r\n    <TargetExt>.dll</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\PdfPreview\\</IntDir>\r\n    <TargetName>PdfPreview</TargetName>\r\n    <TargetExt>.dll</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\PdfPreview\\</IntDir>\r\n    <TargetName>PdfPreview</TargetName>\r\n    <TargetExt>.dll</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;BUILD_XPS_PREVIEW;BUILD_DJVU_PREVIEW;BUILD_EPUB_PREVIEW;BUILD_FB2_PREVIEW;BUILD_MOBI_PREVIEW;BUILD_CBZ_PREVIEW;BUILD_CBR_PREVIEW;BUILD_CB7_PREVIEW;BUILD_CBT_PREVIEW;BUILD_TGA_PREVIEW;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;..\\ext\\libdjvu;..\\ext\\CHMLib\\src;..\\ext\\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;BUILD_XPS_PREVIEW;BUILD_DJVU_PREVIEW;BUILD_EPUB_PREVIEW;BUILD_FB2_PREVIEW;BUILD_MOBI_PREVIEW;BUILD_CBZ_PREVIEW;BUILD_CBR_PREVIEW;BUILD_CB7_PREVIEW;BUILD_CBT_PREVIEW;BUILD_TGA_PREVIEW;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;..\\ext\\libdjvu;..\\ext\\CHMLib\\src;..\\ext\\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <ImportLibrary>..\\dbg\\PdfPreview.lib</ImportLibrary>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;BUILD_XPS_PREVIEW;BUILD_DJVU_PREVIEW;BUILD_EPUB_PREVIEW;BUILD_FB2_PREVIEW;BUILD_MOBI_PREVIEW;BUILD_CBZ_PREVIEW;BUILD_CBR_PREVIEW;BUILD_CB7_PREVIEW;BUILD_CBT_PREVIEW;BUILD_TGA_PREVIEW;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;..\\ext\\libdjvu;..\\ext\\CHMLib\\src;..\\ext\\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;BUILD_XPS_PREVIEW;BUILD_DJVU_PREVIEW;BUILD_EPUB_PREVIEW;BUILD_FB2_PREVIEW;BUILD_MOBI_PREVIEW;BUILD_CBZ_PREVIEW;BUILD_CBR_PREVIEW;BUILD_CB7_PREVIEW;BUILD_CBT_PREVIEW;BUILD_TGA_PREVIEW;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;..\\ext\\libdjvu;..\\ext\\CHMLib\\src;..\\ext\\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <ImportLibrary>..\\dbg64\\PdfPreview.lib</ImportLibrary>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;..\\ext\\libdjvu;..\\ext\\CHMLib\\src;..\\ext\\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;..\\ext\\libdjvu;..\\ext\\CHMLib\\src;..\\ext\\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <ImportLibrary>..\\rel\\PdfPreview.lib</ImportLibrary>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;..\\ext\\libdjvu;..\\ext\\CHMLib\\src;..\\ext\\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;..\\ext\\libdjvu;..\\ext\\CHMLib\\src;..\\ext\\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <ImportLibrary>..\\rel64\\PdfPreview.lib</ImportLibrary>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;..\\ext\\libdjvu;..\\ext\\CHMLib\\src;..\\ext\\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;..\\ext\\libdjvu;..\\ext\\CHMLib\\src;..\\ext\\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <ImportLibrary>..\\relPrefast\\PdfPreview.lib</ImportLibrary>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;..\\ext\\libdjvu;..\\ext\\CHMLib\\src;..\\ext\\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;..\\ext\\libdjvu;..\\ext\\CHMLib\\src;..\\ext\\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <ImportLibrary>..\\relPrefast64\\PdfPreview.lib</ImportLibrary>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\ChmDoc.h\" />\r\n    <ClInclude Include=\"..\\src\\DjVuEngine.h\" />\r\n    <ClInclude Include=\"..\\src\\EbookDoc.h\" />\r\n    <ClInclude Include=\"..\\src\\EbookEngine.h\" />\r\n    <ClInclude Include=\"..\\src\\EbookFormatter.h\" />\r\n    <ClInclude Include=\"..\\src\\HtmlFormatter.h\" />\r\n    <ClInclude Include=\"..\\src\\ImagesEngine.h\" />\r\n    <ClInclude Include=\"..\\src\\MobiDoc.h\" />\r\n    <ClInclude Include=\"..\\src\\PdfCreator.h\" />\r\n    <ClInclude Include=\"..\\src\\PdfEngine.h\" />\r\n    <ClInclude Include=\"..\\src\\mui\\MiniMui.h\" />\r\n    <ClInclude Include=\"..\\src\\mui\\TextRender.h\" />\r\n    <ClInclude Include=\"..\\src\\previewer\\PdfPreview.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\PalmDbReader.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\ChmDoc.cpp\">\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">true</ExcludedFromBuild>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\DjVuEngine.cpp\">\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">true</ExcludedFromBuild>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\EbookDoc.cpp\">\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">true</ExcludedFromBuild>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\EbookEngine.cpp\">\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">true</ExcludedFromBuild>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\EbookFormatter.cpp\">\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">true</ExcludedFromBuild>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\HtmlFormatter.cpp\">\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">true</ExcludedFromBuild>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\ImagesEngine.cpp\">\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">true</ExcludedFromBuild>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\MUPDF_Exports.cpp\" />\r\n    <ClCompile Include=\"..\\src\\MobiDoc.cpp\">\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">true</ExcludedFromBuild>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\PdfCreator.cpp\">\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">true</ExcludedFromBuild>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\PdfEngine.cpp\" />\r\n    <ClCompile Include=\"..\\src\\mui\\MiniMui.cpp\">\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">true</ExcludedFromBuild>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\mui\\TextRender.cpp\">\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">true</ExcludedFromBuild>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\previewer\\PdfPreview.cpp\" />\r\n    <ClCompile Include=\"..\\src\\previewer\\PdfPreviewDll.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\PalmDbReader.cpp\">\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">true</ExcludedFromBuild>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ResourceCompile Include=\"..\\src\\previewer\\PdfPreview.rc\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"utils.vcxproj\">\r\n      <Project>{169C8510-82B0-ADC1-4B32-5121B705AAF2}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"libmupdf.vcxproj\">\r\n      <Project>{B812ACA6-A4DF-06B2-CDF8-F459B9243C40}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"chm.vcxproj\">\r\n      <Project>{DD65880B-496F-887C-D2EA-9E7C3EF3937C}</Project>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/PdfPreview.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"mui\">\r\n      <UniqueIdentifier>{1092880B-7C9B-887C-0517-9F7C711F947C}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"previewer\">\r\n      <UniqueIdentifier>{7EF07E97-EA5A-330E-3399-E4B39F421163}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"utils\">\r\n      <UniqueIdentifier>{169C8510-82B0-ADC1-4B32-5121B705AAF2}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\ChmDoc.h\" />\r\n    <ClInclude Include=\"..\\src\\DjVuEngine.h\" />\r\n    <ClInclude Include=\"..\\src\\EbookDoc.h\" />\r\n    <ClInclude Include=\"..\\src\\EbookEngine.h\" />\r\n    <ClInclude Include=\"..\\src\\EbookFormatter.h\" />\r\n    <ClInclude Include=\"..\\src\\HtmlFormatter.h\" />\r\n    <ClInclude Include=\"..\\src\\ImagesEngine.h\" />\r\n    <ClInclude Include=\"..\\src\\MobiDoc.h\" />\r\n    <ClInclude Include=\"..\\src\\PdfCreator.h\" />\r\n    <ClInclude Include=\"..\\src\\PdfEngine.h\" />\r\n    <ClInclude Include=\"..\\src\\mui\\MiniMui.h\">\r\n      <Filter>mui</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\mui\\TextRender.h\">\r\n      <Filter>mui</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\previewer\\PdfPreview.h\">\r\n      <Filter>previewer</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\PalmDbReader.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\ChmDoc.cpp\" />\r\n    <ClCompile Include=\"..\\src\\DjVuEngine.cpp\" />\r\n    <ClCompile Include=\"..\\src\\EbookDoc.cpp\" />\r\n    <ClCompile Include=\"..\\src\\EbookEngine.cpp\" />\r\n    <ClCompile Include=\"..\\src\\EbookFormatter.cpp\" />\r\n    <ClCompile Include=\"..\\src\\HtmlFormatter.cpp\" />\r\n    <ClCompile Include=\"..\\src\\ImagesEngine.cpp\" />\r\n    <ClCompile Include=\"..\\src\\MUPDF_Exports.cpp\" />\r\n    <ClCompile Include=\"..\\src\\MobiDoc.cpp\" />\r\n    <ClCompile Include=\"..\\src\\PdfCreator.cpp\" />\r\n    <ClCompile Include=\"..\\src\\PdfEngine.cpp\" />\r\n    <ClCompile Include=\"..\\src\\mui\\MiniMui.cpp\">\r\n      <Filter>mui</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\mui\\TextRender.cpp\">\r\n      <Filter>mui</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\previewer\\PdfPreview.cpp\">\r\n      <Filter>previewer</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\previewer\\PdfPreviewDll.cpp\">\r\n      <Filter>previewer</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\PalmDbReader.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ResourceCompile Include=\"..\\src\\previewer\\PdfPreview.rc\">\r\n      <Filter>previewer</Filter>\r\n    </ResourceCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/SumatraPDF-no-MUPDF.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{8F5D3594-FBBE-12A2-842C-5954F08C4961}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>SumatraPDF-no-MUPDF</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\SumatraPDF-no-MUPDF\\</IntDir>\r\n    <TargetName>SumatraPDF-no-MUPDF</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\SumatraPDF-no-MUPDF\\</IntDir>\r\n    <TargetName>SumatraPDF-no-MUPDF</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\SumatraPDF-no-MUPDF\\</IntDir>\r\n    <TargetName>SumatraPDF-no-MUPDF</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\SumatraPDF-no-MUPDF\\</IntDir>\r\n    <TargetName>SumatraPDF-no-MUPDF</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\SumatraPDF-no-MUPDF\\</IntDir>\r\n    <TargetName>SumatraPDF-no-MUPDF</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\SumatraPDF-no-MUPDF\\</IntDir>\r\n    <TargetName>SumatraPDF-no-MUPDF</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\MuPDF_Exports.cpp\" />\r\n    <ClCompile Include=\"..\\src\\SumatraPDF.cpp\" />\r\n    <ClCompile Include=\"..\\src\\SumatraStartup.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Tests.cpp\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ResourceCompile Include=\"..\\src\\SumatraPDF.rc\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"synctex.vcxproj\">\r\n      <Project>{13E867BA-7FC7-E655-88DF-712CF43D4DB7}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"sumatra.vcxproj\">\r\n      <Project>{E21500B1-4EF5-7E4C-570D-0A23C36BE5AD}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"libmupdf.vcxproj\">\r\n      <Project>{B812ACA6-A4DF-06B2-CDF8-F459B9243C40}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"utils.vcxproj\">\r\n      <Project>{169C8510-82B0-ADC1-4B32-5121B705AAF2}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"mui.vcxproj\">\r\n      <Project>{1092880B-7C9B-887C-0517-9F7C711F947C}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"engines.vcxproj\">\r\n      <Project>{CE5B946A-3A3B-1306-4353-9EDCAFB17967}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"uia.vcxproj\">\r\n      <Project>{84B2880B-F0BB-887C-7937-9F7CE53F947C}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"unarrlib.vcxproj\">\r\n      <Project>{C45AE373-B027-3E7F-D940-2C27C56C730D}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"libwebp.vcxproj\">\r\n      <Project>{0A466F79-7625-EE14-7F3D-79EBEB9B5476}</Project>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/SumatraPDF.sln",
    "content": "﻿\r\nMicrosoft Visual Studio Solution File, Format Version 12.00\r\n# Visual Studio 2015\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"SumatraPDF\", \"SumatraPDF.vcxproj\", \"{DC1BAF9B-C8D3-F0E8-31DB-C9441DB28BD9}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"zlib\", \"zlib.vcxproj\", \"{16CFA17C-0206-A30D-ABF2-881097081F0F}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libdjvu\", \"libdjvu.vcxproj\", \"{B5F26479-21D2-E314-2AEA-6EEB96484A76}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"unarrlib\", \"unarrlib.vcxproj\", \"{C45AE373-B027-3E7F-D940-2C27C56C730D}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"jbig2dec\", \"jbig2dec.vcxproj\", \"{BF5813C3-AB25-6ECE-D43E-5C76C06AA35C}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"openjpeg\", \"openjpeg.vcxproj\", \"{FDC4548D-E991-AF98-12AB-9D40FED6E426}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libwebp\", \"libwebp.vcxproj\", \"{0A466F79-7625-EE14-7F3D-79EBEB9B5476}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libjpeg-turbo\", \"libjpeg-turbo.vcxproj\", \"{DB56484D-4717-C483-1052-0D017CD10860}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"freetype\", \"freetype.vcxproj\", \"{89895BD8-7556-B6E3-9E6F-A48B8A9BEB71}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"chm\", \"chm.vcxproj\", \"{DD65880B-496F-887C-D2EA-9E7C3EF3937C}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"engines\", \"engines.vcxproj\", \"{CE5B946A-3A3B-1306-4353-9EDCAFB17967}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"mupdf\", \"mupdf.vcxproj\", \"{2181F50F-8D95-1DC1-5617-C120C2EA19F2}\"\r\n\tProjectSection(ProjectDependencies) = postProject\r\n\t\t{76DFAF19-E249-6490-2B88-1536973142E5} = {76DFAF19-E249-6490-2B88-1536973142E5}\r\n\tEndProjectSection\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libmupdf\", \"libmupdf.vcxproj\", \"{B812ACA6-A4DF-06B2-CDF8-F459B9243C40}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"synctex\", \"synctex.vcxproj\", \"{13E867BA-7FC7-E655-88DF-712CF43D4DB7}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"utils\", \"utils.vcxproj\", \"{169C8510-82B0-ADC1-4B32-5121B705AAF2}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"mui\", \"mui.vcxproj\", \"{1092880B-7C9B-887C-0517-9F7C711F947C}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"uia\", \"uia.vcxproj\", \"{84B2880B-F0BB-887C-7937-9F7CE53F947C}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"sumatra\", \"sumatra.vcxproj\", \"{E21500B1-4EF5-7E4C-570D-0A23C36BE5AD}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"efi\", \"efi.vcxproj\", \"{196E880B-8577-887C-0EF3-9E7C7AFB937C}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"mutool\", \"mutool.vcxproj\", \"{2507A80E-11A9-D2E4-FA63-E638E6A45935}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"mudraw\", \"mudraw.vcxproj\", \"{154C9F0E-01EE-C9E4-EAA8-DD38D6E95035}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"cmapdump\", \"cmapdump.vcxproj\", \"{BC6E1C8A-A83B-7795-D154-653DBD80AC23}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"buildcmap\", \"buildcmap.vcxproj\", \"{76DFAF19-E249-6490-2B88-1536973142E5}\"\r\n\tProjectSection(ProjectDependencies) = postProject\r\n\t\t{BC6E1C8A-A83B-7795-D154-653DBD80AC23} = {BC6E1C8A-A83B-7795-D154-653DBD80AC23}\r\n\tEndProjectSection\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"enginedump\", \"enginedump.vcxproj\", \"{91376584-7DEF-A6D1-E6F6-7F2DD2CD41C2}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"unarr\", \"unarr.vcxproj\", \"{8D308210-F944-AAC1-C2C6-4D212E9AA6F2}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"test_util\", \"test_util.vcxproj\", \"{22AB719A-8E15-2611-D753-D7B643FD0366}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"signfile\", \"signfile.vcxproj\", \"{16722C28-023F-8733-2B58-75DB1784BCC1}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"plugin-test\", \"plugin-test.vcxproj\", \"{21A274DA-8D57-EDCF-164C-E7A68200E4D3}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"MakeLZSA\", \"MakeLZSA.vcxproj\", \"{9D3338B7-8900-93C2-B219-816A9E45C850}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"PdfFilter\", \"PdfFilter.vcxproj\", \"{85945DF9-F1FE-1170-3A3D-C315A6E6EFC4}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"PdfPreview\", \"PdfPreview.vcxproj\", \"{616F573B-4D27-9988-B62E-72E4A2053479}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"SumatraPDF-no-MUPDF\", \"SumatraPDF-no-MUPDF.vcxproj\", \"{8F5D3594-FBBE-12A2-842C-5954F08C4961}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"Uninstaller\", \"Uninstaller.vcxproj\", \"{163328E5-82E8-A0DA-0BDD-9AB1779197DE}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"InstallerNoData\", \"InstallerNoData.vcxproj\", \"{EA6B8310-56F7-F0D4-5F08-74C9CB124DD5}\"\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"Installer\", \"Installer.vcxproj\", \"{F34AFA57-5FB5-AECE-A8F3-5F74149D8C23}\"\r\n\tProjectSection(ProjectDependencies) = postProject\r\n\t\t{9D3338B7-8900-93C2-B219-816A9E45C850} = {9D3338B7-8900-93C2-B219-816A9E45C850}\r\n\t\t{8F5D3594-FBBE-12A2-842C-5954F08C4961} = {8F5D3594-FBBE-12A2-842C-5954F08C4961}\r\n\t\t{85945DF9-F1FE-1170-3A3D-C315A6E6EFC4} = {85945DF9-F1FE-1170-3A3D-C315A6E6EFC4}\r\n\t\t{616F573B-4D27-9988-B62E-72E4A2053479} = {616F573B-4D27-9988-B62E-72E4A2053479}\r\n\t\t{163328E5-82E8-A0DA-0BDD-9AB1779197DE} = {163328E5-82E8-A0DA-0BDD-9AB1779197DE}\r\n\tEndProjectSection\r\nEndProject\r\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"all\", \"all.vcxproj\", \"{DE5D880B-4A67-887C-D3E2-9E7C3FEB937C}\"\r\n\tProjectSection(ProjectDependencies) = postProject\r\n\t\t{616F573B-4D27-9988-B62E-72E4A2053479} = {616F573B-4D27-9988-B62E-72E4A2053479}\r\n\t\t{85945DF9-F1FE-1170-3A3D-C315A6E6EFC4} = {85945DF9-F1FE-1170-3A3D-C315A6E6EFC4}\r\n\t\t{DC1BAF9B-C8D3-F0E8-31DB-C9441DB28BD9} = {DC1BAF9B-C8D3-F0E8-31DB-C9441DB28BD9}\r\n\t\t{8F5D3594-FBBE-12A2-842C-5954F08C4961} = {8F5D3594-FBBE-12A2-842C-5954F08C4961}\r\n\t\t{22AB719A-8E15-2611-D753-D7B643FD0366} = {22AB719A-8E15-2611-D753-D7B643FD0366}\r\n\t\t{BC6E1C8A-A83B-7795-D154-653DBD80AC23} = {BC6E1C8A-A83B-7795-D154-653DBD80AC23}\r\n\t\t{16722C28-023F-8733-2B58-75DB1784BCC1} = {16722C28-023F-8733-2B58-75DB1784BCC1}\r\n\t\t{21A274DA-8D57-EDCF-164C-E7A68200E4D3} = {21A274DA-8D57-EDCF-164C-E7A68200E4D3}\r\n\t\t{9D3338B7-8900-93C2-B219-816A9E45C850} = {9D3338B7-8900-93C2-B219-816A9E45C850}\r\n\t\t{2507A80E-11A9-D2E4-FA63-E638E6A45935} = {2507A80E-11A9-D2E4-FA63-E638E6A45935}\r\n\t\t{154C9F0E-01EE-C9E4-EAA8-DD38D6E95035} = {154C9F0E-01EE-C9E4-EAA8-DD38D6E95035}\r\n\t\t{163328E5-82E8-A0DA-0BDD-9AB1779197DE} = {163328E5-82E8-A0DA-0BDD-9AB1779197DE}\r\n\t\t{91376584-7DEF-A6D1-E6F6-7F2DD2CD41C2} = {91376584-7DEF-A6D1-E6F6-7F2DD2CD41C2}\r\n\t\t{196E880B-8577-887C-0EF3-9E7C7AFB937C} = {196E880B-8577-887C-0EF3-9E7C7AFB937C}\r\n\t\t{8D308210-F944-AAC1-C2C6-4D212E9AA6F2} = {8D308210-F944-AAC1-C2C6-4D212E9AA6F2}\r\n\tEndProjectSection\r\nEndProject\r\nGlobal\r\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n\t\tDebug|Win32 = Debug|Win32\r\n\t\tDebug|x64 = Debug|x64\r\n\t\tReleasePrefast|Win32 = ReleasePrefast|Win32\r\n\t\tReleasePrefast|x64 = ReleasePrefast|x64\r\n\t\tRelease|Win32 = Release|Win32\r\n\t\tRelease|x64 = Release|x64\r\n\tEndGlobalSection\r\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n\t\t{DC1BAF9B-C8D3-F0E8-31DB-C9441DB28BD9}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{DC1BAF9B-C8D3-F0E8-31DB-C9441DB28BD9}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{DC1BAF9B-C8D3-F0E8-31DB-C9441DB28BD9}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{DC1BAF9B-C8D3-F0E8-31DB-C9441DB28BD9}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{DC1BAF9B-C8D3-F0E8-31DB-C9441DB28BD9}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{DC1BAF9B-C8D3-F0E8-31DB-C9441DB28BD9}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{DC1BAF9B-C8D3-F0E8-31DB-C9441DB28BD9}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{DC1BAF9B-C8D3-F0E8-31DB-C9441DB28BD9}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{DC1BAF9B-C8D3-F0E8-31DB-C9441DB28BD9}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{DC1BAF9B-C8D3-F0E8-31DB-C9441DB28BD9}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{DC1BAF9B-C8D3-F0E8-31DB-C9441DB28BD9}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{DC1BAF9B-C8D3-F0E8-31DB-C9441DB28BD9}.Release|x64.Build.0 = Release|x64\r\n\t\t{16CFA17C-0206-A30D-ABF2-881097081F0F}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{16CFA17C-0206-A30D-ABF2-881097081F0F}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{16CFA17C-0206-A30D-ABF2-881097081F0F}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{16CFA17C-0206-A30D-ABF2-881097081F0F}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{16CFA17C-0206-A30D-ABF2-881097081F0F}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{16CFA17C-0206-A30D-ABF2-881097081F0F}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{16CFA17C-0206-A30D-ABF2-881097081F0F}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{16CFA17C-0206-A30D-ABF2-881097081F0F}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{16CFA17C-0206-A30D-ABF2-881097081F0F}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{16CFA17C-0206-A30D-ABF2-881097081F0F}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{16CFA17C-0206-A30D-ABF2-881097081F0F}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{16CFA17C-0206-A30D-ABF2-881097081F0F}.Release|x64.Build.0 = Release|x64\r\n\t\t{B5F26479-21D2-E314-2AEA-6EEB96484A76}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{B5F26479-21D2-E314-2AEA-6EEB96484A76}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{B5F26479-21D2-E314-2AEA-6EEB96484A76}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{B5F26479-21D2-E314-2AEA-6EEB96484A76}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{B5F26479-21D2-E314-2AEA-6EEB96484A76}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{B5F26479-21D2-E314-2AEA-6EEB96484A76}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{B5F26479-21D2-E314-2AEA-6EEB96484A76}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{B5F26479-21D2-E314-2AEA-6EEB96484A76}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{B5F26479-21D2-E314-2AEA-6EEB96484A76}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{B5F26479-21D2-E314-2AEA-6EEB96484A76}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{B5F26479-21D2-E314-2AEA-6EEB96484A76}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{B5F26479-21D2-E314-2AEA-6EEB96484A76}.Release|x64.Build.0 = Release|x64\r\n\t\t{C45AE373-B027-3E7F-D940-2C27C56C730D}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{C45AE373-B027-3E7F-D940-2C27C56C730D}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{C45AE373-B027-3E7F-D940-2C27C56C730D}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{C45AE373-B027-3E7F-D940-2C27C56C730D}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{C45AE373-B027-3E7F-D940-2C27C56C730D}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{C45AE373-B027-3E7F-D940-2C27C56C730D}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{C45AE373-B027-3E7F-D940-2C27C56C730D}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{C45AE373-B027-3E7F-D940-2C27C56C730D}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{C45AE373-B027-3E7F-D940-2C27C56C730D}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{C45AE373-B027-3E7F-D940-2C27C56C730D}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{C45AE373-B027-3E7F-D940-2C27C56C730D}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{C45AE373-B027-3E7F-D940-2C27C56C730D}.Release|x64.Build.0 = Release|x64\r\n\t\t{BF5813C3-AB25-6ECE-D43E-5C76C06AA35C}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{BF5813C3-AB25-6ECE-D43E-5C76C06AA35C}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{BF5813C3-AB25-6ECE-D43E-5C76C06AA35C}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{BF5813C3-AB25-6ECE-D43E-5C76C06AA35C}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{BF5813C3-AB25-6ECE-D43E-5C76C06AA35C}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{BF5813C3-AB25-6ECE-D43E-5C76C06AA35C}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{BF5813C3-AB25-6ECE-D43E-5C76C06AA35C}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{BF5813C3-AB25-6ECE-D43E-5C76C06AA35C}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{BF5813C3-AB25-6ECE-D43E-5C76C06AA35C}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{BF5813C3-AB25-6ECE-D43E-5C76C06AA35C}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{BF5813C3-AB25-6ECE-D43E-5C76C06AA35C}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{BF5813C3-AB25-6ECE-D43E-5C76C06AA35C}.Release|x64.Build.0 = Release|x64\r\n\t\t{FDC4548D-E991-AF98-12AB-9D40FED6E426}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{FDC4548D-E991-AF98-12AB-9D40FED6E426}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{FDC4548D-E991-AF98-12AB-9D40FED6E426}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{FDC4548D-E991-AF98-12AB-9D40FED6E426}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{FDC4548D-E991-AF98-12AB-9D40FED6E426}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{FDC4548D-E991-AF98-12AB-9D40FED6E426}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{FDC4548D-E991-AF98-12AB-9D40FED6E426}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{FDC4548D-E991-AF98-12AB-9D40FED6E426}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{FDC4548D-E991-AF98-12AB-9D40FED6E426}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{FDC4548D-E991-AF98-12AB-9D40FED6E426}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{FDC4548D-E991-AF98-12AB-9D40FED6E426}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{FDC4548D-E991-AF98-12AB-9D40FED6E426}.Release|x64.Build.0 = Release|x64\r\n\t\t{0A466F79-7625-EE14-7F3D-79EBEB9B5476}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{0A466F79-7625-EE14-7F3D-79EBEB9B5476}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{0A466F79-7625-EE14-7F3D-79EBEB9B5476}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{0A466F79-7625-EE14-7F3D-79EBEB9B5476}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{0A466F79-7625-EE14-7F3D-79EBEB9B5476}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{0A466F79-7625-EE14-7F3D-79EBEB9B5476}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{0A466F79-7625-EE14-7F3D-79EBEB9B5476}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{0A466F79-7625-EE14-7F3D-79EBEB9B5476}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{0A466F79-7625-EE14-7F3D-79EBEB9B5476}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{0A466F79-7625-EE14-7F3D-79EBEB9B5476}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{0A466F79-7625-EE14-7F3D-79EBEB9B5476}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{0A466F79-7625-EE14-7F3D-79EBEB9B5476}.Release|x64.Build.0 = Release|x64\r\n\t\t{DB56484D-4717-C483-1052-0D017CD10860}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{DB56484D-4717-C483-1052-0D017CD10860}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{DB56484D-4717-C483-1052-0D017CD10860}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{DB56484D-4717-C483-1052-0D017CD10860}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{DB56484D-4717-C483-1052-0D017CD10860}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{DB56484D-4717-C483-1052-0D017CD10860}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{DB56484D-4717-C483-1052-0D017CD10860}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{DB56484D-4717-C483-1052-0D017CD10860}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{DB56484D-4717-C483-1052-0D017CD10860}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{DB56484D-4717-C483-1052-0D017CD10860}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{DB56484D-4717-C483-1052-0D017CD10860}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{DB56484D-4717-C483-1052-0D017CD10860}.Release|x64.Build.0 = Release|x64\r\n\t\t{89895BD8-7556-B6E3-9E6F-A48B8A9BEB71}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{89895BD8-7556-B6E3-9E6F-A48B8A9BEB71}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{89895BD8-7556-B6E3-9E6F-A48B8A9BEB71}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{89895BD8-7556-B6E3-9E6F-A48B8A9BEB71}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{89895BD8-7556-B6E3-9E6F-A48B8A9BEB71}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{89895BD8-7556-B6E3-9E6F-A48B8A9BEB71}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{89895BD8-7556-B6E3-9E6F-A48B8A9BEB71}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{89895BD8-7556-B6E3-9E6F-A48B8A9BEB71}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{89895BD8-7556-B6E3-9E6F-A48B8A9BEB71}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{89895BD8-7556-B6E3-9E6F-A48B8A9BEB71}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{89895BD8-7556-B6E3-9E6F-A48B8A9BEB71}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{89895BD8-7556-B6E3-9E6F-A48B8A9BEB71}.Release|x64.Build.0 = Release|x64\r\n\t\t{DD65880B-496F-887C-D2EA-9E7C3EF3937C}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{DD65880B-496F-887C-D2EA-9E7C3EF3937C}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{DD65880B-496F-887C-D2EA-9E7C3EF3937C}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{DD65880B-496F-887C-D2EA-9E7C3EF3937C}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{DD65880B-496F-887C-D2EA-9E7C3EF3937C}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{DD65880B-496F-887C-D2EA-9E7C3EF3937C}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{DD65880B-496F-887C-D2EA-9E7C3EF3937C}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{DD65880B-496F-887C-D2EA-9E7C3EF3937C}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{DD65880B-496F-887C-D2EA-9E7C3EF3937C}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{DD65880B-496F-887C-D2EA-9E7C3EF3937C}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{DD65880B-496F-887C-D2EA-9E7C3EF3937C}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{DD65880B-496F-887C-D2EA-9E7C3EF3937C}.Release|x64.Build.0 = Release|x64\r\n\t\t{CE5B946A-3A3B-1306-4353-9EDCAFB17967}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{CE5B946A-3A3B-1306-4353-9EDCAFB17967}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{CE5B946A-3A3B-1306-4353-9EDCAFB17967}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{CE5B946A-3A3B-1306-4353-9EDCAFB17967}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{CE5B946A-3A3B-1306-4353-9EDCAFB17967}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{CE5B946A-3A3B-1306-4353-9EDCAFB17967}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{CE5B946A-3A3B-1306-4353-9EDCAFB17967}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{CE5B946A-3A3B-1306-4353-9EDCAFB17967}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{CE5B946A-3A3B-1306-4353-9EDCAFB17967}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{CE5B946A-3A3B-1306-4353-9EDCAFB17967}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{CE5B946A-3A3B-1306-4353-9EDCAFB17967}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{CE5B946A-3A3B-1306-4353-9EDCAFB17967}.Release|x64.Build.0 = Release|x64\r\n\t\t{2181F50F-8D95-1DC1-5617-C120C2EA19F2}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{2181F50F-8D95-1DC1-5617-C120C2EA19F2}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{2181F50F-8D95-1DC1-5617-C120C2EA19F2}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{2181F50F-8D95-1DC1-5617-C120C2EA19F2}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{2181F50F-8D95-1DC1-5617-C120C2EA19F2}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{2181F50F-8D95-1DC1-5617-C120C2EA19F2}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{2181F50F-8D95-1DC1-5617-C120C2EA19F2}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{2181F50F-8D95-1DC1-5617-C120C2EA19F2}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{2181F50F-8D95-1DC1-5617-C120C2EA19F2}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{2181F50F-8D95-1DC1-5617-C120C2EA19F2}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{2181F50F-8D95-1DC1-5617-C120C2EA19F2}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{2181F50F-8D95-1DC1-5617-C120C2EA19F2}.Release|x64.Build.0 = Release|x64\r\n\t\t{B812ACA6-A4DF-06B2-CDF8-F459B9243C40}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{B812ACA6-A4DF-06B2-CDF8-F459B9243C40}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{B812ACA6-A4DF-06B2-CDF8-F459B9243C40}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{B812ACA6-A4DF-06B2-CDF8-F459B9243C40}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{B812ACA6-A4DF-06B2-CDF8-F459B9243C40}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{B812ACA6-A4DF-06B2-CDF8-F459B9243C40}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{B812ACA6-A4DF-06B2-CDF8-F459B9243C40}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{B812ACA6-A4DF-06B2-CDF8-F459B9243C40}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{B812ACA6-A4DF-06B2-CDF8-F459B9243C40}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{B812ACA6-A4DF-06B2-CDF8-F459B9243C40}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{B812ACA6-A4DF-06B2-CDF8-F459B9243C40}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{B812ACA6-A4DF-06B2-CDF8-F459B9243C40}.Release|x64.Build.0 = Release|x64\r\n\t\t{13E867BA-7FC7-E655-88DF-712CF43D4DB7}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{13E867BA-7FC7-E655-88DF-712CF43D4DB7}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{13E867BA-7FC7-E655-88DF-712CF43D4DB7}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{13E867BA-7FC7-E655-88DF-712CF43D4DB7}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{13E867BA-7FC7-E655-88DF-712CF43D4DB7}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{13E867BA-7FC7-E655-88DF-712CF43D4DB7}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{13E867BA-7FC7-E655-88DF-712CF43D4DB7}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{13E867BA-7FC7-E655-88DF-712CF43D4DB7}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{13E867BA-7FC7-E655-88DF-712CF43D4DB7}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{13E867BA-7FC7-E655-88DF-712CF43D4DB7}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{13E867BA-7FC7-E655-88DF-712CF43D4DB7}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{13E867BA-7FC7-E655-88DF-712CF43D4DB7}.Release|x64.Build.0 = Release|x64\r\n\t\t{169C8510-82B0-ADC1-4B32-5121B705AAF2}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{169C8510-82B0-ADC1-4B32-5121B705AAF2}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{169C8510-82B0-ADC1-4B32-5121B705AAF2}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{169C8510-82B0-ADC1-4B32-5121B705AAF2}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{169C8510-82B0-ADC1-4B32-5121B705AAF2}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{169C8510-82B0-ADC1-4B32-5121B705AAF2}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{169C8510-82B0-ADC1-4B32-5121B705AAF2}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{169C8510-82B0-ADC1-4B32-5121B705AAF2}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{169C8510-82B0-ADC1-4B32-5121B705AAF2}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{169C8510-82B0-ADC1-4B32-5121B705AAF2}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{169C8510-82B0-ADC1-4B32-5121B705AAF2}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{169C8510-82B0-ADC1-4B32-5121B705AAF2}.Release|x64.Build.0 = Release|x64\r\n\t\t{1092880B-7C9B-887C-0517-9F7C711F947C}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{1092880B-7C9B-887C-0517-9F7C711F947C}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{1092880B-7C9B-887C-0517-9F7C711F947C}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{1092880B-7C9B-887C-0517-9F7C711F947C}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{1092880B-7C9B-887C-0517-9F7C711F947C}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{1092880B-7C9B-887C-0517-9F7C711F947C}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{1092880B-7C9B-887C-0517-9F7C711F947C}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{1092880B-7C9B-887C-0517-9F7C711F947C}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{1092880B-7C9B-887C-0517-9F7C711F947C}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{1092880B-7C9B-887C-0517-9F7C711F947C}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{1092880B-7C9B-887C-0517-9F7C711F947C}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{1092880B-7C9B-887C-0517-9F7C711F947C}.Release|x64.Build.0 = Release|x64\r\n\t\t{84B2880B-F0BB-887C-7937-9F7CE53F947C}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{84B2880B-F0BB-887C-7937-9F7CE53F947C}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{84B2880B-F0BB-887C-7937-9F7CE53F947C}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{84B2880B-F0BB-887C-7937-9F7CE53F947C}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{84B2880B-F0BB-887C-7937-9F7CE53F947C}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{84B2880B-F0BB-887C-7937-9F7CE53F947C}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{84B2880B-F0BB-887C-7937-9F7CE53F947C}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{84B2880B-F0BB-887C-7937-9F7CE53F947C}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{84B2880B-F0BB-887C-7937-9F7CE53F947C}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{84B2880B-F0BB-887C-7937-9F7CE53F947C}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{84B2880B-F0BB-887C-7937-9F7CE53F947C}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{84B2880B-F0BB-887C-7937-9F7CE53F947C}.Release|x64.Build.0 = Release|x64\r\n\t\t{E21500B1-4EF5-7E4C-570D-0A23C36BE5AD}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{E21500B1-4EF5-7E4C-570D-0A23C36BE5AD}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{E21500B1-4EF5-7E4C-570D-0A23C36BE5AD}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{E21500B1-4EF5-7E4C-570D-0A23C36BE5AD}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{E21500B1-4EF5-7E4C-570D-0A23C36BE5AD}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{E21500B1-4EF5-7E4C-570D-0A23C36BE5AD}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{E21500B1-4EF5-7E4C-570D-0A23C36BE5AD}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{E21500B1-4EF5-7E4C-570D-0A23C36BE5AD}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{E21500B1-4EF5-7E4C-570D-0A23C36BE5AD}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{E21500B1-4EF5-7E4C-570D-0A23C36BE5AD}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{E21500B1-4EF5-7E4C-570D-0A23C36BE5AD}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{E21500B1-4EF5-7E4C-570D-0A23C36BE5AD}.Release|x64.Build.0 = Release|x64\r\n\t\t{196E880B-8577-887C-0EF3-9E7C7AFB937C}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{196E880B-8577-887C-0EF3-9E7C7AFB937C}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{196E880B-8577-887C-0EF3-9E7C7AFB937C}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{196E880B-8577-887C-0EF3-9E7C7AFB937C}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{196E880B-8577-887C-0EF3-9E7C7AFB937C}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{196E880B-8577-887C-0EF3-9E7C7AFB937C}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{196E880B-8577-887C-0EF3-9E7C7AFB937C}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{196E880B-8577-887C-0EF3-9E7C7AFB937C}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{196E880B-8577-887C-0EF3-9E7C7AFB937C}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{196E880B-8577-887C-0EF3-9E7C7AFB937C}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{196E880B-8577-887C-0EF3-9E7C7AFB937C}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{196E880B-8577-887C-0EF3-9E7C7AFB937C}.Release|x64.Build.0 = Release|x64\r\n\t\t{2507A80E-11A9-D2E4-FA63-E638E6A45935}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{2507A80E-11A9-D2E4-FA63-E638E6A45935}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{2507A80E-11A9-D2E4-FA63-E638E6A45935}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{2507A80E-11A9-D2E4-FA63-E638E6A45935}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{2507A80E-11A9-D2E4-FA63-E638E6A45935}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{2507A80E-11A9-D2E4-FA63-E638E6A45935}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{2507A80E-11A9-D2E4-FA63-E638E6A45935}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{2507A80E-11A9-D2E4-FA63-E638E6A45935}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{2507A80E-11A9-D2E4-FA63-E638E6A45935}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{2507A80E-11A9-D2E4-FA63-E638E6A45935}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{2507A80E-11A9-D2E4-FA63-E638E6A45935}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{2507A80E-11A9-D2E4-FA63-E638E6A45935}.Release|x64.Build.0 = Release|x64\r\n\t\t{154C9F0E-01EE-C9E4-EAA8-DD38D6E95035}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{154C9F0E-01EE-C9E4-EAA8-DD38D6E95035}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{154C9F0E-01EE-C9E4-EAA8-DD38D6E95035}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{154C9F0E-01EE-C9E4-EAA8-DD38D6E95035}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{154C9F0E-01EE-C9E4-EAA8-DD38D6E95035}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{154C9F0E-01EE-C9E4-EAA8-DD38D6E95035}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{154C9F0E-01EE-C9E4-EAA8-DD38D6E95035}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{154C9F0E-01EE-C9E4-EAA8-DD38D6E95035}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{154C9F0E-01EE-C9E4-EAA8-DD38D6E95035}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{154C9F0E-01EE-C9E4-EAA8-DD38D6E95035}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{154C9F0E-01EE-C9E4-EAA8-DD38D6E95035}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{154C9F0E-01EE-C9E4-EAA8-DD38D6E95035}.Release|x64.Build.0 = Release|x64\r\n\t\t{BC6E1C8A-A83B-7795-D154-653DBD80AC23}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{BC6E1C8A-A83B-7795-D154-653DBD80AC23}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{BC6E1C8A-A83B-7795-D154-653DBD80AC23}.Debug|x64.ActiveCfg = Debug x64|Win32\r\n\t\t{BC6E1C8A-A83B-7795-D154-653DBD80AC23}.Debug|x64.Build.0 = Debug x64|Win32\r\n\t\t{BC6E1C8A-A83B-7795-D154-653DBD80AC23}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{BC6E1C8A-A83B-7795-D154-653DBD80AC23}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{BC6E1C8A-A83B-7795-D154-653DBD80AC23}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast x64|Win32\r\n\t\t{BC6E1C8A-A83B-7795-D154-653DBD80AC23}.ReleasePrefast|x64.Build.0 = ReleasePrefast x64|Win32\r\n\t\t{BC6E1C8A-A83B-7795-D154-653DBD80AC23}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{BC6E1C8A-A83B-7795-D154-653DBD80AC23}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{BC6E1C8A-A83B-7795-D154-653DBD80AC23}.Release|x64.ActiveCfg = Release x64|Win32\r\n\t\t{BC6E1C8A-A83B-7795-D154-653DBD80AC23}.Release|x64.Build.0 = Release x64|Win32\r\n\t\t{76DFAF19-E249-6490-2B88-1536973142E5}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{76DFAF19-E249-6490-2B88-1536973142E5}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{76DFAF19-E249-6490-2B88-1536973142E5}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{76DFAF19-E249-6490-2B88-1536973142E5}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{76DFAF19-E249-6490-2B88-1536973142E5}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{76DFAF19-E249-6490-2B88-1536973142E5}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{76DFAF19-E249-6490-2B88-1536973142E5}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{76DFAF19-E249-6490-2B88-1536973142E5}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{76DFAF19-E249-6490-2B88-1536973142E5}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{76DFAF19-E249-6490-2B88-1536973142E5}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{76DFAF19-E249-6490-2B88-1536973142E5}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{76DFAF19-E249-6490-2B88-1536973142E5}.Release|x64.Build.0 = Release|x64\r\n\t\t{91376584-7DEF-A6D1-E6F6-7F2DD2CD41C2}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{91376584-7DEF-A6D1-E6F6-7F2DD2CD41C2}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{91376584-7DEF-A6D1-E6F6-7F2DD2CD41C2}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{91376584-7DEF-A6D1-E6F6-7F2DD2CD41C2}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{91376584-7DEF-A6D1-E6F6-7F2DD2CD41C2}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{91376584-7DEF-A6D1-E6F6-7F2DD2CD41C2}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{91376584-7DEF-A6D1-E6F6-7F2DD2CD41C2}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{91376584-7DEF-A6D1-E6F6-7F2DD2CD41C2}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{91376584-7DEF-A6D1-E6F6-7F2DD2CD41C2}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{91376584-7DEF-A6D1-E6F6-7F2DD2CD41C2}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{91376584-7DEF-A6D1-E6F6-7F2DD2CD41C2}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{91376584-7DEF-A6D1-E6F6-7F2DD2CD41C2}.Release|x64.Build.0 = Release|x64\r\n\t\t{8D308210-F944-AAC1-C2C6-4D212E9AA6F2}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{8D308210-F944-AAC1-C2C6-4D212E9AA6F2}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{8D308210-F944-AAC1-C2C6-4D212E9AA6F2}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{8D308210-F944-AAC1-C2C6-4D212E9AA6F2}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{8D308210-F944-AAC1-C2C6-4D212E9AA6F2}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{8D308210-F944-AAC1-C2C6-4D212E9AA6F2}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{8D308210-F944-AAC1-C2C6-4D212E9AA6F2}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{8D308210-F944-AAC1-C2C6-4D212E9AA6F2}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{8D308210-F944-AAC1-C2C6-4D212E9AA6F2}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{8D308210-F944-AAC1-C2C6-4D212E9AA6F2}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{8D308210-F944-AAC1-C2C6-4D212E9AA6F2}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{8D308210-F944-AAC1-C2C6-4D212E9AA6F2}.Release|x64.Build.0 = Release|x64\r\n\t\t{22AB719A-8E15-2611-D753-D7B643FD0366}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{22AB719A-8E15-2611-D753-D7B643FD0366}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{22AB719A-8E15-2611-D753-D7B643FD0366}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{22AB719A-8E15-2611-D753-D7B643FD0366}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{22AB719A-8E15-2611-D753-D7B643FD0366}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{22AB719A-8E15-2611-D753-D7B643FD0366}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{22AB719A-8E15-2611-D753-D7B643FD0366}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{22AB719A-8E15-2611-D753-D7B643FD0366}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{22AB719A-8E15-2611-D753-D7B643FD0366}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{22AB719A-8E15-2611-D753-D7B643FD0366}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{22AB719A-8E15-2611-D753-D7B643FD0366}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{22AB719A-8E15-2611-D753-D7B643FD0366}.Release|x64.Build.0 = Release|x64\r\n\t\t{16722C28-023F-8733-2B58-75DB1784BCC1}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{16722C28-023F-8733-2B58-75DB1784BCC1}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{16722C28-023F-8733-2B58-75DB1784BCC1}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{16722C28-023F-8733-2B58-75DB1784BCC1}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{16722C28-023F-8733-2B58-75DB1784BCC1}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{16722C28-023F-8733-2B58-75DB1784BCC1}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{16722C28-023F-8733-2B58-75DB1784BCC1}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{16722C28-023F-8733-2B58-75DB1784BCC1}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{16722C28-023F-8733-2B58-75DB1784BCC1}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{16722C28-023F-8733-2B58-75DB1784BCC1}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{16722C28-023F-8733-2B58-75DB1784BCC1}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{16722C28-023F-8733-2B58-75DB1784BCC1}.Release|x64.Build.0 = Release|x64\r\n\t\t{21A274DA-8D57-EDCF-164C-E7A68200E4D3}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{21A274DA-8D57-EDCF-164C-E7A68200E4D3}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{21A274DA-8D57-EDCF-164C-E7A68200E4D3}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{21A274DA-8D57-EDCF-164C-E7A68200E4D3}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{21A274DA-8D57-EDCF-164C-E7A68200E4D3}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{21A274DA-8D57-EDCF-164C-E7A68200E4D3}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{21A274DA-8D57-EDCF-164C-E7A68200E4D3}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{21A274DA-8D57-EDCF-164C-E7A68200E4D3}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{21A274DA-8D57-EDCF-164C-E7A68200E4D3}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{21A274DA-8D57-EDCF-164C-E7A68200E4D3}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{21A274DA-8D57-EDCF-164C-E7A68200E4D3}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{21A274DA-8D57-EDCF-164C-E7A68200E4D3}.Release|x64.Build.0 = Release|x64\r\n\t\t{9D3338B7-8900-93C2-B219-816A9E45C850}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{9D3338B7-8900-93C2-B219-816A9E45C850}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{9D3338B7-8900-93C2-B219-816A9E45C850}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{9D3338B7-8900-93C2-B219-816A9E45C850}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{9D3338B7-8900-93C2-B219-816A9E45C850}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{9D3338B7-8900-93C2-B219-816A9E45C850}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{9D3338B7-8900-93C2-B219-816A9E45C850}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{9D3338B7-8900-93C2-B219-816A9E45C850}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{9D3338B7-8900-93C2-B219-816A9E45C850}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{9D3338B7-8900-93C2-B219-816A9E45C850}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{9D3338B7-8900-93C2-B219-816A9E45C850}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{9D3338B7-8900-93C2-B219-816A9E45C850}.Release|x64.Build.0 = Release|x64\r\n\t\t{85945DF9-F1FE-1170-3A3D-C315A6E6EFC4}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{85945DF9-F1FE-1170-3A3D-C315A6E6EFC4}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{85945DF9-F1FE-1170-3A3D-C315A6E6EFC4}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{85945DF9-F1FE-1170-3A3D-C315A6E6EFC4}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{85945DF9-F1FE-1170-3A3D-C315A6E6EFC4}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{85945DF9-F1FE-1170-3A3D-C315A6E6EFC4}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{85945DF9-F1FE-1170-3A3D-C315A6E6EFC4}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{85945DF9-F1FE-1170-3A3D-C315A6E6EFC4}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{85945DF9-F1FE-1170-3A3D-C315A6E6EFC4}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{85945DF9-F1FE-1170-3A3D-C315A6E6EFC4}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{85945DF9-F1FE-1170-3A3D-C315A6E6EFC4}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{85945DF9-F1FE-1170-3A3D-C315A6E6EFC4}.Release|x64.Build.0 = Release|x64\r\n\t\t{616F573B-4D27-9988-B62E-72E4A2053479}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{616F573B-4D27-9988-B62E-72E4A2053479}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{616F573B-4D27-9988-B62E-72E4A2053479}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{616F573B-4D27-9988-B62E-72E4A2053479}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{616F573B-4D27-9988-B62E-72E4A2053479}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{616F573B-4D27-9988-B62E-72E4A2053479}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{616F573B-4D27-9988-B62E-72E4A2053479}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{616F573B-4D27-9988-B62E-72E4A2053479}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{616F573B-4D27-9988-B62E-72E4A2053479}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{616F573B-4D27-9988-B62E-72E4A2053479}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{616F573B-4D27-9988-B62E-72E4A2053479}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{616F573B-4D27-9988-B62E-72E4A2053479}.Release|x64.Build.0 = Release|x64\r\n\t\t{8F5D3594-FBBE-12A2-842C-5954F08C4961}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{8F5D3594-FBBE-12A2-842C-5954F08C4961}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{8F5D3594-FBBE-12A2-842C-5954F08C4961}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{8F5D3594-FBBE-12A2-842C-5954F08C4961}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{8F5D3594-FBBE-12A2-842C-5954F08C4961}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{8F5D3594-FBBE-12A2-842C-5954F08C4961}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{8F5D3594-FBBE-12A2-842C-5954F08C4961}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{8F5D3594-FBBE-12A2-842C-5954F08C4961}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{8F5D3594-FBBE-12A2-842C-5954F08C4961}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{8F5D3594-FBBE-12A2-842C-5954F08C4961}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{8F5D3594-FBBE-12A2-842C-5954F08C4961}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{8F5D3594-FBBE-12A2-842C-5954F08C4961}.Release|x64.Build.0 = Release|x64\r\n\t\t{163328E5-82E8-A0DA-0BDD-9AB1779197DE}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{163328E5-82E8-A0DA-0BDD-9AB1779197DE}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{163328E5-82E8-A0DA-0BDD-9AB1779197DE}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{163328E5-82E8-A0DA-0BDD-9AB1779197DE}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{163328E5-82E8-A0DA-0BDD-9AB1779197DE}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{163328E5-82E8-A0DA-0BDD-9AB1779197DE}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{163328E5-82E8-A0DA-0BDD-9AB1779197DE}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{163328E5-82E8-A0DA-0BDD-9AB1779197DE}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{163328E5-82E8-A0DA-0BDD-9AB1779197DE}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{163328E5-82E8-A0DA-0BDD-9AB1779197DE}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{163328E5-82E8-A0DA-0BDD-9AB1779197DE}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{163328E5-82E8-A0DA-0BDD-9AB1779197DE}.Release|x64.Build.0 = Release|x64\r\n\t\t{EA6B8310-56F7-F0D4-5F08-74C9CB124DD5}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{EA6B8310-56F7-F0D4-5F08-74C9CB124DD5}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{EA6B8310-56F7-F0D4-5F08-74C9CB124DD5}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{EA6B8310-56F7-F0D4-5F08-74C9CB124DD5}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{EA6B8310-56F7-F0D4-5F08-74C9CB124DD5}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{EA6B8310-56F7-F0D4-5F08-74C9CB124DD5}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{EA6B8310-56F7-F0D4-5F08-74C9CB124DD5}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{EA6B8310-56F7-F0D4-5F08-74C9CB124DD5}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{EA6B8310-56F7-F0D4-5F08-74C9CB124DD5}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{EA6B8310-56F7-F0D4-5F08-74C9CB124DD5}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{EA6B8310-56F7-F0D4-5F08-74C9CB124DD5}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{EA6B8310-56F7-F0D4-5F08-74C9CB124DD5}.Release|x64.Build.0 = Release|x64\r\n\t\t{F34AFA57-5FB5-AECE-A8F3-5F74149D8C23}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{F34AFA57-5FB5-AECE-A8F3-5F74149D8C23}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{F34AFA57-5FB5-AECE-A8F3-5F74149D8C23}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{F34AFA57-5FB5-AECE-A8F3-5F74149D8C23}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{F34AFA57-5FB5-AECE-A8F3-5F74149D8C23}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{F34AFA57-5FB5-AECE-A8F3-5F74149D8C23}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{F34AFA57-5FB5-AECE-A8F3-5F74149D8C23}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{F34AFA57-5FB5-AECE-A8F3-5F74149D8C23}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{F34AFA57-5FB5-AECE-A8F3-5F74149D8C23}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{F34AFA57-5FB5-AECE-A8F3-5F74149D8C23}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{F34AFA57-5FB5-AECE-A8F3-5F74149D8C23}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{F34AFA57-5FB5-AECE-A8F3-5F74149D8C23}.Release|x64.Build.0 = Release|x64\r\n\t\t{DE5D880B-4A67-887C-D3E2-9E7C3FEB937C}.Debug|Win32.ActiveCfg = Debug|Win32\r\n\t\t{DE5D880B-4A67-887C-D3E2-9E7C3FEB937C}.Debug|Win32.Build.0 = Debug|Win32\r\n\t\t{DE5D880B-4A67-887C-D3E2-9E7C3FEB937C}.Debug|x64.ActiveCfg = Debug|x64\r\n\t\t{DE5D880B-4A67-887C-D3E2-9E7C3FEB937C}.Debug|x64.Build.0 = Debug|x64\r\n\t\t{DE5D880B-4A67-887C-D3E2-9E7C3FEB937C}.ReleasePrefast|Win32.ActiveCfg = ReleasePrefast|Win32\r\n\t\t{DE5D880B-4A67-887C-D3E2-9E7C3FEB937C}.ReleasePrefast|Win32.Build.0 = ReleasePrefast|Win32\r\n\t\t{DE5D880B-4A67-887C-D3E2-9E7C3FEB937C}.ReleasePrefast|x64.ActiveCfg = ReleasePrefast|x64\r\n\t\t{DE5D880B-4A67-887C-D3E2-9E7C3FEB937C}.ReleasePrefast|x64.Build.0 = ReleasePrefast|x64\r\n\t\t{DE5D880B-4A67-887C-D3E2-9E7C3FEB937C}.Release|Win32.ActiveCfg = Release|Win32\r\n\t\t{DE5D880B-4A67-887C-D3E2-9E7C3FEB937C}.Release|Win32.Build.0 = Release|Win32\r\n\t\t{DE5D880B-4A67-887C-D3E2-9E7C3FEB937C}.Release|x64.ActiveCfg = Release|x64\r\n\t\t{DE5D880B-4A67-887C-D3E2-9E7C3FEB937C}.Release|x64.Build.0 = Release|x64\r\n\tEndGlobalSection\r\n\tGlobalSection(SolutionProperties) = preSolution\r\n\t\tHideSolutionNode = FALSE\r\n\tEndGlobalSection\r\nEndGlobal\r\n"
  },
  {
    "path": "vs2015/SumatraPDF.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{DC1BAF9B-C8D3-F0E8-31DB-C9441DB28BD9}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>SumatraPDF</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\SumatraPDF\\</IntDir>\r\n    <TargetName>SumatraPDF</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\SumatraPDF\\</IntDir>\r\n    <TargetName>SumatraPDF</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\SumatraPDF\\</IntDir>\r\n    <TargetName>SumatraPDF</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\SumatraPDF\\</IntDir>\r\n    <TargetName>SumatraPDF</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\SumatraPDF\\</IntDir>\r\n    <TargetName>SumatraPDF</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\SumatraPDF\\</IntDir>\r\n    <TargetName>SumatraPDF</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\SumatraPDF.cpp\" />\r\n    <ClCompile Include=\"..\\src\\SumatraStartup.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Tests.cpp\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <None Include=\"..\\docs\\releasenotes.txt\" />\r\n    <None Include=\"..\\docs\\releaseplan.txt\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ResourceCompile Include=\"..\\src\\SumatraPDF.rc\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"engines.vcxproj\">\r\n      <Project>{CE5B946A-3A3B-1306-4353-9EDCAFB17967}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"libdjvu.vcxproj\">\r\n      <Project>{B5F26479-21D2-E314-2AEA-6EEB96484A76}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"libwebp.vcxproj\">\r\n      <Project>{0A466F79-7625-EE14-7F3D-79EBEB9B5476}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"mui.vcxproj\">\r\n      <Project>{1092880B-7C9B-887C-0517-9F7C711F947C}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"mupdf.vcxproj\">\r\n      <Project>{2181F50F-8D95-1DC1-5617-C120C2EA19F2}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"sumatra.vcxproj\">\r\n      <Project>{E21500B1-4EF5-7E4C-570D-0A23C36BE5AD}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"synctex.vcxproj\">\r\n      <Project>{13E867BA-7FC7-E655-88DF-712CF43D4DB7}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"uia.vcxproj\">\r\n      <Project>{84B2880B-F0BB-887C-7937-9F7CE53F947C}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"unarrlib.vcxproj\">\r\n      <Project>{C45AE373-B027-3E7F-D940-2C27C56C730D}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"utils.vcxproj\">\r\n      <Project>{169C8510-82B0-ADC1-4B32-5121B705AAF2}</Project>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/SumatraPDF.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"docs\">\r\n      <UniqueIdentifier>{CECA957C-BA01-970D-63EE-7C104F04130F}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"src\">\r\n      <UniqueIdentifier>{2DAB880B-99B4-887C-2230-9F7C8E38947C}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\SumatraPDF.cpp\">\r\n      <Filter>src</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\SumatraStartup.cpp\">\r\n      <Filter>src</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\Tests.cpp\">\r\n      <Filter>src</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <None Include=\"..\\docs\\releasenotes.txt\">\r\n      <Filter>docs</Filter>\r\n    </None>\r\n    <None Include=\"..\\docs\\releaseplan.txt\">\r\n      <Filter>docs</Filter>\r\n    </None>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ResourceCompile Include=\"..\\src\\SumatraPDF.rc\">\r\n      <Filter>src</Filter>\r\n    </ResourceCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/Uninstaller.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{163328E5-82E8-A0DA-0BDD-9AB1779197DE}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>Uninstaller</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\Uninstaller\\</IntDir>\r\n    <TargetName>Uninstaller</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\Uninstaller\\</IntDir>\r\n    <TargetName>Uninstaller</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\Uninstaller\\</IntDir>\r\n    <TargetName>Uninstaller</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\Uninstaller\\</IntDir>\r\n    <TargetName>Uninstaller</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\Uninstaller\\</IntDir>\r\n    <TargetName>Uninstaller</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\Uninstaller\\</IntDir>\r\n    <TargetName>Uninstaller</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n    <GenerateManifest>false</GenerateManifest>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4244;4264;4838;4702;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;BUILD_UNINSTALLER;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;BUILD_UNINSTALLER;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n    <Manifest>\r\n      <AdditionalManifestFiles>../src/installer/Installer.exe.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>\r\n    </Manifest>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4244;4264;4838;4702;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;BUILD_UNINSTALLER;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;BUILD_UNINSTALLER;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n    <Manifest>\r\n      <AdditionalManifestFiles>../src/installer/Installer.exe.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>\r\n    </Manifest>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4244;4264;4838;4702;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;BUILD_UNINSTALLER;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;BUILD_UNINSTALLER;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n    <Manifest>\r\n      <AdditionalManifestFiles>../src/installer/Installer.exe.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>\r\n    </Manifest>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4244;4264;4838;4702;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;BUILD_UNINSTALLER;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;BUILD_UNINSTALLER;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n    <Manifest>\r\n      <AdditionalManifestFiles>../src/installer/Installer.exe.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>\r\n    </Manifest>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4018;4244;4264;4838;4702;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;BUILD_UNINSTALLER;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;BUILD_UNINSTALLER;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n    </Link>\r\n    <Manifest>\r\n      <AdditionalManifestFiles>../src/installer/Installer.exe.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>\r\n    </Manifest>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4018;4244;4264;4838;4702;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;BUILD_UNINSTALLER;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;BUILD_UNINSTALLER;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\ext\\zlib;..\\ext\\unarr;..\\ext\\lzma\\C;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;urlmon.lib;version.lib;windowscodecs.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n    </Link>\r\n    <Manifest>\r\n      <AdditionalManifestFiles>../src/installer/Installer.exe.manifest %(AdditionalManifestFiles)</AdditionalManifestFiles>\r\n    </Manifest>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\CrashHandler.h\" />\r\n    <ClInclude Include=\"..\\src\\Translations.h\" />\r\n    <ClInclude Include=\"..\\src\\installer\\Installer.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\CrashHandler.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Translations.cpp\" />\r\n    <ClCompile Include=\"..\\src\\installer\\Installer.cpp\" />\r\n    <ClCompile Include=\"..\\src\\installer\\Trans_installer_txt.cpp\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <None Include=\"..\\src\\installer\\Installer.exe.manifest\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ResourceCompile Include=\"..\\src\\installer\\Installer.rc\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"utils.vcxproj\">\r\n      <Project>{169C8510-82B0-ADC1-4B32-5121B705AAF2}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"zlib.vcxproj\">\r\n      <Project>{16CFA17C-0206-A30D-ABF2-881097081F0F}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"unarrlib.vcxproj\">\r\n      <Project>{C45AE373-B027-3E7F-D940-2C27C56C730D}</Project>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/Uninstaller.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"installer\">\r\n      <UniqueIdentifier>{136B88E7-7FD5-3C5E-C813-EE0334BD1AB3}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\CrashHandler.h\" />\r\n    <ClInclude Include=\"..\\src\\Translations.h\" />\r\n    <ClInclude Include=\"..\\src\\installer\\Installer.h\">\r\n      <Filter>installer</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\CrashHandler.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Translations.cpp\" />\r\n    <ClCompile Include=\"..\\src\\installer\\Installer.cpp\">\r\n      <Filter>installer</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\installer\\Trans_installer_txt.cpp\">\r\n      <Filter>installer</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <None Include=\"..\\src\\installer\\Installer.exe.manifest\">\r\n      <Filter>installer</Filter>\r\n    </None>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ResourceCompile Include=\"..\\src\\installer\\Installer.rc\">\r\n      <Filter>installer</Filter>\r\n    </ResourceCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/all.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{DE5D880B-4A67-887C-D3E2-9E7C3FEB937C}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>all</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\all\\</IntDir>\r\n    <TargetName>all</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\all\\</IntDir>\r\n    <TargetName>all</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\all\\</IntDir>\r\n    <TargetName>all</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\all\\</IntDir>\r\n    <TargetName>all</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\all\\</IntDir>\r\n    <TargetName>all</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\all\\</IntDir>\r\n    <TargetName>all</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\tools\\premake\\no_op_console.c\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/buildcmap.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{76DFAF19-E249-6490-2B88-1536973142E5}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>buildcmap</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\buildcmap\\</IntDir>\r\n    <TargetName>buildcmap</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\buildcmap\\</IntDir>\r\n    <TargetName>buildcmap</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\buildcmap\\</IntDir>\r\n    <TargetName>buildcmap</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\buildcmap\\</IntDir>\r\n    <TargetName>buildcmap</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\buildcmap\\</IntDir>\r\n    <TargetName>buildcmap</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\buildcmap\\</IntDir>\r\n    <TargetName>buildcmap</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n    <PostBuildEvent>\r\n      <Command>IF EXIST ..\\dbg\\cmapdump.exe\\ (xcopy /Q /E /Y /I ..\\dbg\\cmapdump.exe ..\\bin &gt; nul) ELSE (xcopy /Q /Y /I ..\\dbg\\cmapdump.exe ..\\bin &gt; nul)\r\ncd .. &amp; call scripts\\gen_mupdf_generated.bat bin\\cmapdump.exe</Command>\r\n    </PostBuildEvent>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n    <PostBuildEvent>\r\n      <Command>IF EXIST ..\\dbg64\\cmapdump.exe\\ (xcopy /Q /E /Y /I ..\\dbg64\\cmapdump.exe ..\\bin &gt; nul) ELSE (xcopy /Q /Y /I ..\\dbg64\\cmapdump.exe ..\\bin &gt; nul)\r\ncd .. &amp; call scripts\\gen_mupdf_generated.bat bin\\cmapdump.exe</Command>\r\n    </PostBuildEvent>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n    <PostBuildEvent>\r\n      <Command>IF EXIST ..\\rel\\cmapdump.exe\\ (xcopy /Q /E /Y /I ..\\rel\\cmapdump.exe ..\\bin &gt; nul) ELSE (xcopy /Q /Y /I ..\\rel\\cmapdump.exe ..\\bin &gt; nul)\r\ncd .. &amp; call scripts\\gen_mupdf_generated.bat bin\\cmapdump.exe</Command>\r\n    </PostBuildEvent>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n    <PostBuildEvent>\r\n      <Command>IF EXIST ..\\rel64\\cmapdump.exe\\ (xcopy /Q /E /Y /I ..\\rel64\\cmapdump.exe ..\\bin &gt; nul) ELSE (xcopy /Q /Y /I ..\\rel64\\cmapdump.exe ..\\bin &gt; nul)\r\ncd .. &amp; call scripts\\gen_mupdf_generated.bat bin\\cmapdump.exe</Command>\r\n    </PostBuildEvent>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n    </Link>\r\n    <PostBuildEvent>\r\n      <Command>IF EXIST ..\\relPrefast\\cmapdump.exe\\ (xcopy /Q /E /Y /I ..\\relPrefast\\cmapdump.exe ..\\bin &gt; nul) ELSE (xcopy /Q /Y /I ..\\relPrefast\\cmapdump.exe ..\\bin &gt; nul)\r\ncd .. &amp; call scripts\\gen_mupdf_generated.bat bin\\cmapdump.exe</Command>\r\n    </PostBuildEvent>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n    </Link>\r\n    <PostBuildEvent>\r\n      <Command>IF EXIST ..\\relPrefast64\\cmapdump.exe\\ (xcopy /Q /E /Y /I ..\\relPrefast64\\cmapdump.exe ..\\bin &gt; nul) ELSE (xcopy /Q /Y /I ..\\relPrefast64\\cmapdump.exe ..\\bin &gt; nul)\r\ncd .. &amp; call scripts\\gen_mupdf_generated.bat bin\\cmapdump.exe</Command>\r\n    </PostBuildEvent>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\tools\\premake\\no_op_console.c\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/chm.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{DD65880B-496F-887C-D2EA-9E7C3EF3937C}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>chm</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\chm\\</IntDir>\r\n    <TargetName>chm</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\chm\\</IntDir>\r\n    <TargetName>chm</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\chm\\</IntDir>\r\n    <TargetName>chm</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\chm\\</IntDir>\r\n    <TargetName>chm</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\chm\\</IntDir>\r\n    <TargetName>chm</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\chm\\</IntDir>\r\n    <TargetName>chm</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4057;4189;4244;4267;4295;4701;4706;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;UNICODE;_UNICODE;PPC_BSTR;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4057;4189;4244;4267;4295;4701;4706;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;UNICODE;_UNICODE;PPC_BSTR;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4057;4189;4244;4267;4295;4701;4706;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;UNICODE;_UNICODE;PPC_BSTR;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4057;4189;4244;4267;4295;4701;4706;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;UNICODE;_UNICODE;PPC_BSTR;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4018;4057;4189;4244;4267;4295;4701;4706;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;UNICODE;_UNICODE;PPC_BSTR;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4018;4057;4189;4244;4267;4295;4701;4706;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;UNICODE;_UNICODE;PPC_BSTR;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\ext\\CHMLib\\src\\chm_lib.c\" />\r\n    <ClCompile Include=\"..\\ext\\CHMLib\\src\\lzx.c\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/cmapdump.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug x64|Win32\">\r\n      <Configuration>Debug x64</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release x64|Win32\">\r\n      <Configuration>Release x64</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast x64|Win32\">\r\n      <Configuration>ReleasePrefast x64</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{BC6E1C8A-A83B-7795-D154-653DBD80AC23}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>cmapdump</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug x64|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release x64|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast x64|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug x64|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release x64|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast x64|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\cmapdump\\</IntDir>\r\n    <TargetName>cmapdump</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug x64|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\cmapdump\\</IntDir>\r\n    <TargetName>cmapdump</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\cmapdump\\</IntDir>\r\n    <TargetName>cmapdump</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release x64|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\cmapdump\\</IntDir>\r\n    <TargetName>cmapdump</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\cmapdump\\</IntDir>\r\n    <TargetName>cmapdump</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast x64|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\cmapdump\\</IntDir>\r\n    <TargetName>cmapdump</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug x64|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release x64|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4100;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast x64|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4100;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\mupdf\\scripts\\cmapdump.c\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/efi.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{196E880B-8577-887C-0EF3-9E7C7AFB937C}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>efi</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\efi\\</IntDir>\r\n    <TargetName>efi</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\efi\\</IntDir>\r\n    <TargetName>efi</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\efi\\</IntDir>\r\n    <TargetName>efi</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\efi\\</IntDir>\r\n    <TargetName>efi</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\efi\\</IntDir>\r\n    <TargetName>efi</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\efi\\</IntDir>\r\n    <TargetName>efi</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4091;4577;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4091;4577;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4091;4577;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4091;4577;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4091;4577;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4091;4577;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\utils\\BaseUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\BitManip.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\Dict.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\StrUtil.h\" />\r\n    <ClInclude Include=\"..\\tools\\efi\\Dia2Subset.h\" />\r\n    <ClInclude Include=\"..\\tools\\efi\\Util.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\utils\\BaseUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\Dict.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\StrUtil.cpp\" />\r\n    <ClCompile Include=\"..\\tools\\efi\\Util.cpp\" />\r\n    <ClCompile Include=\"..\\tools\\efi\\main.cpp\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/efi.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"src\">\r\n      <UniqueIdentifier>{2DAB880B-99B4-887C-2230-9F7C8E38947C}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"src\\utils\">\r\n      <UniqueIdentifier>{6DAA42B6-D914-F72C-2253-A8D28EFCD481}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"tools\">\r\n      <UniqueIdentifier>{36DF7010-A2F3-98C1-6B75-3C21D74895F2}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"tools\\efi\">\r\n      <UniqueIdentifier>{390BB58F-A575-6906-EEB3-1AAC5A5D475B}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\utils\\BaseUtil.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\BitManip.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\Dict.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\StrUtil.h\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\tools\\efi\\Dia2Subset.h\">\r\n      <Filter>tools\\efi</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\tools\\efi\\Util.h\">\r\n      <Filter>tools\\efi</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\utils\\BaseUtil.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\Dict.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\StrUtil.cpp\">\r\n      <Filter>src\\utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\tools\\efi\\Util.cpp\">\r\n      <Filter>tools\\efi</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\tools\\efi\\main.cpp\">\r\n      <Filter>tools\\efi</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/enginedump.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{91376584-7DEF-A6D1-E6F6-7F2DD2CD41C2}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>enginedump</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\enginedump\\</IntDir>\r\n    <TargetName>enginedump</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\enginedump\\</IntDir>\r\n    <TargetName>enginedump</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\enginedump\\</IntDir>\r\n    <TargetName>enginedump</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\enginedump\\</IntDir>\r\n    <TargetName>enginedump</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\enginedump\\</IntDir>\r\n    <TargetName>enginedump</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\enginedump\\</IntDir>\r\n    <TargetName>enginedump</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;version.lib;windowscodecs.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;version.lib;windowscodecs.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;version.lib;windowscodecs.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;version.lib;windowscodecs.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;version.lib;windowscodecs.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\mui;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;version.lib;windowscodecs.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\mui\\MiniMui.h\" />\r\n    <ClInclude Include=\"..\\src\\mui\\TextRender.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\EngineDump.cpp\" />\r\n    <ClCompile Include=\"..\\src\\mui\\MiniMui.cpp\" />\r\n    <ClCompile Include=\"..\\src\\mui\\TextRender.cpp\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"engines.vcxproj\">\r\n      <Project>{CE5B946A-3A3B-1306-4353-9EDCAFB17967}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"utils.vcxproj\">\r\n      <Project>{169C8510-82B0-ADC1-4B32-5121B705AAF2}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"mupdf.vcxproj\">\r\n      <Project>{2181F50F-8D95-1DC1-5617-C120C2EA19F2}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"unarrlib.vcxproj\">\r\n      <Project>{C45AE373-B027-3E7F-D940-2C27C56C730D}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"libwebp.vcxproj\">\r\n      <Project>{0A466F79-7625-EE14-7F3D-79EBEB9B5476}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"libdjvu.vcxproj\">\r\n      <Project>{B5F26479-21D2-E314-2AEA-6EEB96484A76}</Project>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/enginedump.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"mui\">\r\n      <UniqueIdentifier>{1092880B-7C9B-887C-0517-9F7C711F947C}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\mui\\MiniMui.h\">\r\n      <Filter>mui</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\mui\\TextRender.h\">\r\n      <Filter>mui</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\EngineDump.cpp\" />\r\n    <ClCompile Include=\"..\\src\\mui\\MiniMui.cpp\">\r\n      <Filter>mui</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\mui\\TextRender.cpp\">\r\n      <Filter>mui</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/engines.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{CE5B946A-3A3B-1306-4353-9EDCAFB17967}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>engines</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\engines\\</IntDir>\r\n    <TargetName>engines</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\engines\\</IntDir>\r\n    <TargetName>engines</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\engines\\</IntDir>\r\n    <TargetName>engines</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\engines\\</IntDir>\r\n    <TargetName>engines</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\engines\\</IntDir>\r\n    <TargetName>engines</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\engines\\</IntDir>\r\n    <TargetName>engines</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4057;4189;4244;4267;4295;4819;4701;4706;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\ext\\synctex;..\\ext\\libdjvu;..\\ext\\CHMLib\\src;..\\ext\\zlib;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4057;4189;4244;4267;4295;4819;4701;4706;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\ext\\synctex;..\\ext\\libdjvu;..\\ext\\CHMLib\\src;..\\ext\\zlib;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4057;4189;4244;4267;4295;4819;4701;4706;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\ext\\synctex;..\\ext\\libdjvu;..\\ext\\CHMLib\\src;..\\ext\\zlib;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4057;4189;4244;4267;4295;4819;4701;4706;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\ext\\synctex;..\\ext\\libdjvu;..\\ext\\CHMLib\\src;..\\ext\\zlib;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4018;4057;4189;4244;4267;4295;4819;4701;4706;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\ext\\synctex;..\\ext\\libdjvu;..\\ext\\CHMLib\\src;..\\ext\\zlib;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4018;4057;4189;4244;4267;4295;4819;4701;4706;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\ext\\synctex;..\\ext\\libdjvu;..\\ext\\CHMLib\\src;..\\ext\\zlib;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\ChmDoc.h\" />\r\n    <ClInclude Include=\"..\\src\\DjVuEngine.h\" />\r\n    <ClInclude Include=\"..\\src\\EbookDoc.h\" />\r\n    <ClInclude Include=\"..\\src\\EbookEngine.h\" />\r\n    <ClInclude Include=\"..\\src\\EbookFormatter.h\" />\r\n    <ClInclude Include=\"..\\src\\EngineManager.h\" />\r\n    <ClInclude Include=\"..\\src\\FileModifications.h\" />\r\n    <ClInclude Include=\"..\\src\\HtmlFormatter.h\" />\r\n    <ClInclude Include=\"..\\src\\ImagesEngine.h\" />\r\n    <ClInclude Include=\"..\\src\\MobiDoc.h\" />\r\n    <ClInclude Include=\"..\\src\\PdfCreator.h\" />\r\n    <ClInclude Include=\"..\\src\\PdfEngine.h\" />\r\n    <ClInclude Include=\"..\\src\\PsEngine.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\PalmDbReader.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\ChmDoc.cpp\" />\r\n    <ClCompile Include=\"..\\src\\DjVuEngine.cpp\" />\r\n    <ClCompile Include=\"..\\src\\EbookDoc.cpp\" />\r\n    <ClCompile Include=\"..\\src\\EbookEngine.cpp\" />\r\n    <ClCompile Include=\"..\\src\\EbookFormatter.cpp\" />\r\n    <ClCompile Include=\"..\\src\\EngineManager.cpp\" />\r\n    <ClCompile Include=\"..\\src\\FileModifications.cpp\" />\r\n    <ClCompile Include=\"..\\src\\HtmlFormatter.cpp\" />\r\n    <ClCompile Include=\"..\\src\\ImagesEngine.cpp\" />\r\n    <ClCompile Include=\"..\\src\\MobiDoc.cpp\" />\r\n    <ClCompile Include=\"..\\src\\PdfCreator.cpp\" />\r\n    <ClCompile Include=\"..\\src\\PdfEngine.cpp\" />\r\n    <ClCompile Include=\"..\\src\\PsEngine.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\PalmDbReader.cpp\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"chm.vcxproj\">\r\n      <Project>{DD65880B-496F-887C-D2EA-9E7C3EF3937C}</Project>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/engines.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"utils\">\r\n      <UniqueIdentifier>{169C8510-82B0-ADC1-4B32-5121B705AAF2}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\ChmDoc.h\" />\r\n    <ClInclude Include=\"..\\src\\DjVuEngine.h\" />\r\n    <ClInclude Include=\"..\\src\\EbookDoc.h\" />\r\n    <ClInclude Include=\"..\\src\\EbookEngine.h\" />\r\n    <ClInclude Include=\"..\\src\\EbookFormatter.h\" />\r\n    <ClInclude Include=\"..\\src\\EngineManager.h\" />\r\n    <ClInclude Include=\"..\\src\\FileModifications.h\" />\r\n    <ClInclude Include=\"..\\src\\HtmlFormatter.h\" />\r\n    <ClInclude Include=\"..\\src\\ImagesEngine.h\" />\r\n    <ClInclude Include=\"..\\src\\MobiDoc.h\" />\r\n    <ClInclude Include=\"..\\src\\PdfCreator.h\" />\r\n    <ClInclude Include=\"..\\src\\PdfEngine.h\" />\r\n    <ClInclude Include=\"..\\src\\PsEngine.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\PalmDbReader.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\ChmDoc.cpp\" />\r\n    <ClCompile Include=\"..\\src\\DjVuEngine.cpp\" />\r\n    <ClCompile Include=\"..\\src\\EbookDoc.cpp\" />\r\n    <ClCompile Include=\"..\\src\\EbookEngine.cpp\" />\r\n    <ClCompile Include=\"..\\src\\EbookFormatter.cpp\" />\r\n    <ClCompile Include=\"..\\src\\EngineManager.cpp\" />\r\n    <ClCompile Include=\"..\\src\\FileModifications.cpp\" />\r\n    <ClCompile Include=\"..\\src\\HtmlFormatter.cpp\" />\r\n    <ClCompile Include=\"..\\src\\ImagesEngine.cpp\" />\r\n    <ClCompile Include=\"..\\src\\MobiDoc.cpp\" />\r\n    <ClCompile Include=\"..\\src\\PdfCreator.cpp\" />\r\n    <ClCompile Include=\"..\\src\\PdfEngine.cpp\" />\r\n    <ClCompile Include=\"..\\src\\PsEngine.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\PalmDbReader.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/freetype.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{89895BD8-7556-B6E3-9E6F-A48B8A9BEB71}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>freetype</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\freetype\\</IntDir>\r\n    <TargetName>freetype</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\freetype\\</IntDir>\r\n    <TargetName>freetype</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\freetype\\</IntDir>\r\n    <TargetName>freetype</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\freetype\\</IntDir>\r\n    <TargetName>freetype</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\freetype\\</IntDir>\r\n    <TargetName>freetype</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\freetype\\</IntDir>\r\n    <TargetName>freetype</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;FT2_BUILD_LIBRARY;FT_OPTION_AUTOFIT2;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\freetype2\\config;..\\ext\\freetype2\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;FT2_BUILD_LIBRARY;FT_OPTION_AUTOFIT2;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\freetype2\\config;..\\ext\\freetype2\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;FT2_BUILD_LIBRARY;FT_OPTION_AUTOFIT2;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\freetype2\\config;..\\ext\\freetype2\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;FT2_BUILD_LIBRARY;FT_OPTION_AUTOFIT2;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\freetype2\\config;..\\ext\\freetype2\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4018;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;FT2_BUILD_LIBRARY;FT_OPTION_AUTOFIT2;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\freetype2\\config;..\\ext\\freetype2\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4018;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;FT2_BUILD_LIBRARY;FT_OPTION_AUTOFIT2;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\freetype2\\config;..\\ext\\freetype2\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftbase.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftbbox.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftbitmap.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftdebug.c\">\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">true</ExcludedFromBuild>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftgasp.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftglyph.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftinit.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftotval.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftstroke.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftsynth.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftsystem.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\fttype1.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftxf86.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\cff\\cff.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\cid\\type1cid.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\gzip\\ftgzip.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\otvalid\\otvalid.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\psaux\\psaux.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\pshinter\\pshinter.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\psnames\\psnames.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\raster\\raster.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\sfnt\\sfnt.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\smooth\\smooth.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\truetype\\truetype.c\" />\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\type1\\type1.c\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/freetype.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"base\">\r\n      <UniqueIdentifier>{8078947C-6CAF-950D-159C-7B1001B2110F}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"cff\">\r\n      <UniqueIdentifier>{9465880B-006F-887C-89EA-9E7CF5F2937C}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"cid\">\r\n      <UniqueIdentifier>{F565880B-616F-887C-EAEA-9E7C56F3937C}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"gzip\">\r\n      <UniqueIdentifier>{7F9F977C-6BD6-980D-14C3-7E1000D9140F}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"otvalid\">\r\n      <UniqueIdentifier>{98B3647B-0493-E316-0DAB-6EED79094A78}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"psaux\">\r\n      <UniqueIdentifier>{56742A10-C288-52C1-8B0A-F620F7DD4EF2}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"pshinter\">\r\n      <UniqueIdentifier>{12922C67-FE5E-8772-2778-751A13A4BC00}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"psnames\">\r\n      <UniqueIdentifier>{7C0779C5-E8E6-F760-F1FE-82375D5D5EC2}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"raster\">\r\n      <UniqueIdentifier>{D66FE718-C211-12EF-ABCC-2543970D993F}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"sfnt\">\r\n      <UniqueIdentifier>{A0DF9D7C-8C16-9F0D-3503-851021191B0F}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"smooth\">\r\n      <UniqueIdentifier>{9F79131C-8B1B-3EF2-74D6-51466017C542}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"truetype\">\r\n      <UniqueIdentifier>{E7B747E9-D384-A2F4-FC9D-909CE8C9D782}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"type1\">\r\n      <UniqueIdentifier>{185E7610-8472-9EC1-4DF4-4121B9C79AF2}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftbase.c\">\r\n      <Filter>base</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftbbox.c\">\r\n      <Filter>base</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftbitmap.c\">\r\n      <Filter>base</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftdebug.c\">\r\n      <Filter>base</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftgasp.c\">\r\n      <Filter>base</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftglyph.c\">\r\n      <Filter>base</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftinit.c\">\r\n      <Filter>base</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftotval.c\">\r\n      <Filter>base</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftstroke.c\">\r\n      <Filter>base</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftsynth.c\">\r\n      <Filter>base</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftsystem.c\">\r\n      <Filter>base</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\fttype1.c\">\r\n      <Filter>base</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\base\\ftxf86.c\">\r\n      <Filter>base</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\cff\\cff.c\">\r\n      <Filter>cff</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\cid\\type1cid.c\">\r\n      <Filter>cid</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\gzip\\ftgzip.c\">\r\n      <Filter>gzip</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\otvalid\\otvalid.c\">\r\n      <Filter>otvalid</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\psaux\\psaux.c\">\r\n      <Filter>psaux</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\pshinter\\pshinter.c\">\r\n      <Filter>pshinter</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\psnames\\psnames.c\">\r\n      <Filter>psnames</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\raster\\raster.c\">\r\n      <Filter>raster</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\sfnt\\sfnt.c\">\r\n      <Filter>sfnt</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\smooth\\smooth.c\">\r\n      <Filter>smooth</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\truetype\\truetype.c\">\r\n      <Filter>truetype</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\freetype2\\src\\type1\\type1.c\">\r\n      <Filter>type1</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/jbig2dec.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{BF5813C3-AB25-6ECE-D43E-5C76C06AA35C}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>jbig2dec</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\jbig2dec\\</IntDir>\r\n    <TargetName>jbig2dec</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\jbig2dec\\</IntDir>\r\n    <TargetName>jbig2dec</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\jbig2dec\\</IntDir>\r\n    <TargetName>jbig2dec</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\jbig2dec\\</IntDir>\r\n    <TargetName>jbig2dec</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\jbig2dec\\</IntDir>\r\n    <TargetName>jbig2dec</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\jbig2dec\\</IntDir>\r\n    <TargetName>jbig2dec</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4100;4244;4267;4701;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;HAVE_STRING_H=1;JBIG_NO_MEMENTO;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\jbig2dec;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4100;4244;4267;4701;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;HAVE_STRING_H=1;JBIG_NO_MEMENTO;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\jbig2dec;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4100;4244;4267;4701;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;HAVE_STRING_H=1;JBIG_NO_MEMENTO;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\jbig2dec;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4100;4244;4267;4701;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;HAVE_STRING_H=1;JBIG_NO_MEMENTO;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\jbig2dec;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4018;4100;4244;4267;4701;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;HAVE_STRING_H=1;JBIG_NO_MEMENTO;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\jbig2dec;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4018;4100;4244;4267;4701;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;HAVE_STRING_H=1;JBIG_NO_MEMENTO;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\jbig2dec;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\ext\\jbig2dec\\jbig2.c\" />\r\n    <ClCompile Include=\"..\\ext\\jbig2dec\\jbig2_arith.c\" />\r\n    <ClCompile Include=\"..\\ext\\jbig2dec\\jbig2_arith_iaid.c\" />\r\n    <ClCompile Include=\"..\\ext\\jbig2dec\\jbig2_arith_int.c\" />\r\n    <ClCompile Include=\"..\\ext\\jbig2dec\\jbig2_generic.c\" />\r\n    <ClCompile Include=\"..\\ext\\jbig2dec\\jbig2_halftone.c\" />\r\n    <ClCompile Include=\"..\\ext\\jbig2dec\\jbig2_huffman.c\" />\r\n    <ClCompile Include=\"..\\ext\\jbig2dec\\jbig2_image.c\" />\r\n    <ClCompile Include=\"..\\ext\\jbig2dec\\jbig2_metadata.c\" />\r\n    <ClCompile Include=\"..\\ext\\jbig2dec\\jbig2_mmr.c\" />\r\n    <ClCompile Include=\"..\\ext\\jbig2dec\\jbig2_page.c\" />\r\n    <ClCompile Include=\"..\\ext\\jbig2dec\\jbig2_refinement.c\" />\r\n    <ClCompile Include=\"..\\ext\\jbig2dec\\jbig2_segment.c\" />\r\n    <ClCompile Include=\"..\\ext\\jbig2dec\\jbig2_symbol_dict.c\" />\r\n    <ClCompile Include=\"..\\ext\\jbig2dec\\jbig2_text.c\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/libdjvu.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{B5F26479-21D2-E314-2AEA-6EEB96484A76}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>libdjvu</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>MultiByte</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>MultiByte</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>MultiByte</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>MultiByte</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>MultiByte</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>MultiByte</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\libdjvu\\</IntDir>\r\n    <TargetName>libdjvu</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\libdjvu\\</IntDir>\r\n    <TargetName>libdjvu</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\libdjvu\\</IntDir>\r\n    <TargetName>libdjvu</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\libdjvu\\</IntDir>\r\n    <TargetName>libdjvu</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\libdjvu\\</IntDir>\r\n    <TargetName>libdjvu</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\libdjvu\\</IntDir>\r\n    <TargetName>libdjvu</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4189;4244;4267;4302;4311;4312;4456;4457;4459;4530;4611;4701;4702;4703;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;NEED_JPEG_DECODER;THREADMODEL=0;DDJVUAPI=/**/;MINILISPAPI=/**/;DO_CHANGELOCALE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\libjpeg-turbo;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4189;4244;4267;4302;4311;4312;4456;4457;4459;4530;4611;4701;4702;4703;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;NEED_JPEG_DECODER;THREADMODEL=0;DDJVUAPI=/**/;MINILISPAPI=/**/;DO_CHANGELOCALE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\libjpeg-turbo;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4189;4244;4267;4302;4311;4312;4456;4457;4459;4530;4611;4701;4702;4703;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NEED_JPEG_DECODER;THREADMODEL=0;DDJVUAPI=/**/;MINILISPAPI=/**/;DO_CHANGELOCALE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\libjpeg-turbo;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4189;4244;4267;4302;4311;4312;4456;4457;4459;4530;4611;4701;4702;4703;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NEED_JPEG_DECODER;THREADMODEL=0;DDJVUAPI=/**/;MINILISPAPI=/**/;DO_CHANGELOCALE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\libjpeg-turbo;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4100;4189;4244;4267;4302;4311;4312;4456;4457;4459;4530;4611;4701;4702;4703;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NEED_JPEG_DECODER;THREADMODEL=0;DDJVUAPI=/**/;MINILISPAPI=/**/;DO_CHANGELOCALE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\libjpeg-turbo;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4100;4189;4244;4267;4302;4311;4312;4456;4457;4459;4530;4611;4701;4702;4703;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NEED_JPEG_DECODER;THREADMODEL=0;DDJVUAPI=/**/;MINILISPAPI=/**/;DO_CHANGELOCALE=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\libjpeg-turbo;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\Arrays.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\BSByteStream.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\BSEncodeByteStream.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\ByteStream.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DataPool.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DjVmDir.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DjVmDir0.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DjVmDoc.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DjVmNav.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DjVuAnno.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DjVuDocEditor.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DjVuDocument.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DjVuDumpHelper.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DjVuErrorList.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DjVuFile.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DjVuFileCache.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DjVuGlobal.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DjVuGlobalMemory.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DjVuImage.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DjVuInfo.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DjVuMessage.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DjVuMessageLite.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DjVuNavDir.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DjVuPalette.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DjVuPort.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DjVuText.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\DjVuToPS.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\GBitmap.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\GContainer.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\GException.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\GIFFManager.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\GMapAreas.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\GOS.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\GPixmap.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\GRect.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\GScaler.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\GSmartPointer.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\GString.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\GThreads.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\GURL.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\GUnicode.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\IFFByteStream.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\IW44EncodeCodec.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\IW44Image.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\JB2EncodeCodec.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\JB2Image.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\JPEGDecoder.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\MMRDecoder.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\MMX.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\UnicodeByteStream.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\XMLParser.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\XMLTags.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\ZPCodec.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\atomic.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\ddjvuapi.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\debug.cpp\" />\r\n    <ClCompile Include=\"..\\ext\\libdjvu\\miniexp.cpp\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/libjpeg-turbo.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{DB56484D-4717-C483-1052-0D017CD10860}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>libjpeg-turbo</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\libjpeg-turbo\\</IntDir>\r\n    <TargetName>libjpeg-turbo</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\libjpeg-turbo\\</IntDir>\r\n    <TargetName>libjpeg-turbo</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\libjpeg-turbo\\</IntDir>\r\n    <TargetName>libjpeg-turbo</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\libjpeg-turbo\\</IntDir>\r\n    <TargetName>libjpeg-turbo</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\libjpeg-turbo\\</IntDir>\r\n    <TargetName>libjpeg-turbo</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\libjpeg-turbo\\</IntDir>\r\n    <TargetName>libjpeg-turbo</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4100;4244;4245;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\libjpeg-turbo;..\\ext\\libjpeg-turbo\\simd;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4100;4244;4245;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\libjpeg-turbo;..\\ext\\libjpeg-turbo\\simd;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4100;4244;4245;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\libjpeg-turbo;..\\ext\\libjpeg-turbo\\simd;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4018;4100;4244;4245;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\libjpeg-turbo;..\\ext\\libjpeg-turbo\\simd;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4018;4100;4244;4245;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\libjpeg-turbo;..\\ext\\libjpeg-turbo\\simd;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4018;4100;4244;4245;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\libjpeg-turbo;..\\ext\\libjpeg-turbo\\simd;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jaricom.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jcomapi.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdapimin.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdapistd.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdarith.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdatadst.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdatasrc.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdcoefct.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdcolor.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jddctmgr.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdhuff.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdinput.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdmainct.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdmarker.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdmaster.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdmerge.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdphuff.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdpostct.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdsample.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdtrans.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jerror.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jfdctflt.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jfdctfst.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jfdctint.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jidctflt.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jidctfst.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jidctint.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jidctred.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jmemmgr.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jmemnobs.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jquant1.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jquant2.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jutils.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\simd\\jsimd_i386.c\">\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">true</ExcludedFromBuild>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\simd\\jsimd_x86_64.c\">\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">true</ExcludedFromBuild>\r\n      <ExcludedFromBuild Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">true</ExcludedFromBuild>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jccolmmx.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jccolss2-64.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jccolss2.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcgrammx.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcgrass2-64.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcgrass2.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcqnt3dn.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcqntmmx.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcqnts2f-64.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcqnts2f.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcqnts2i-64.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcqnts2i.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcqntsse.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcsammmx.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcsamss2-64.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcsamss2.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jdcolmmx.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jdcolss2-64.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jdcolss2.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jdmermmx.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jdmerss2-64.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jdmerss2.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jdsammmx.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jdsamss2-64.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jdsamss2.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jf3dnflt.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jfmmxfst.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jfmmxint.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jfss2fst-64.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jfss2fst.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jfss2int-64.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jfss2int.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jfsseflt-64.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jfsseflt.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\ji3dnflt.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jimmxfst.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jimmxint.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jimmxred.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jiss2flt-64.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jiss2flt.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jiss2fst-64.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jiss2fst.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jiss2int-64.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jiss2int.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jiss2red-64.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">..\\bin\\nasm.exe -f win64 -D__x86_64__ -DWIN64 -DMSVC -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jiss2red.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jisseflt.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jsimdcpu.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">%(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../ext/libjpeg-turbo/simd/ -I ../ext/libjpeg-turbo/win/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">%(Identity)</Message>\r\n    </CustomBuild>\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/libjpeg-turbo.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"simd\">\r\n      <UniqueIdentifier>{32EC9D7C-1E23-9F0D-C70F-8510B3251B0F}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jaricom.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jcomapi.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdapimin.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdapistd.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdarith.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdatadst.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdatasrc.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdcoefct.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdcolor.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jddctmgr.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdhuff.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdinput.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdmainct.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdmarker.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdmaster.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdmerge.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdphuff.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdpostct.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdsample.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jdtrans.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jerror.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jfdctflt.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jfdctfst.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jfdctint.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jidctflt.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jidctfst.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jidctint.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jidctred.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jmemmgr.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jmemnobs.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jquant1.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jquant2.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\jutils.c\" />\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\simd\\jsimd_i386.c\">\r\n      <Filter>simd</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libjpeg-turbo\\simd\\jsimd_x86_64.c\">\r\n      <Filter>simd</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jccolmmx.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jccolss2-64.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jccolss2.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcgrammx.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcgrass2-64.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcgrass2.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcqnt3dn.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcqntmmx.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcqnts2f-64.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcqnts2f.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcqnts2i-64.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcqnts2i.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcqntsse.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcsammmx.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcsamss2-64.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jcsamss2.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jdcolmmx.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jdcolss2-64.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jdcolss2.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jdmermmx.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jdmerss2-64.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jdmerss2.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jdsammmx.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jdsamss2-64.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jdsamss2.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jf3dnflt.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jfmmxfst.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jfmmxint.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jfss2fst-64.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jfss2fst.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jfss2int-64.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jfss2int.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jfsseflt-64.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jfsseflt.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\ji3dnflt.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jimmxfst.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jimmxint.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jimmxred.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jiss2flt-64.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jiss2flt.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jiss2fst-64.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jiss2fst.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jiss2int-64.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jiss2int.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jiss2red-64.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jiss2red.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jisseflt.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n    <CustomBuild Include=\"..\\ext\\libjpeg-turbo\\simd\\jsimdcpu.asm\">\r\n      <Filter>simd</Filter>\r\n    </CustomBuild>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/libmupdf.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{B812ACA6-A4DF-06B2-CDF8-F459B9243C40}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>libmupdf</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\libmupdf\\</IntDir>\r\n    <TargetName>libmupdf</TargetName>\r\n    <TargetExt>.dll</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\libmupdf\\</IntDir>\r\n    <TargetName>libmupdf</TargetName>\r\n    <TargetExt>.dll</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\libmupdf\\</IntDir>\r\n    <TargetName>libmupdf</TargetName>\r\n    <TargetExt>.dll</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\libmupdf\\</IntDir>\r\n    <TargetName>libmupdf</TargetName>\r\n    <TargetExt>.dll</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\libmupdf\\</IntDir>\r\n    <TargetName>libmupdf</TargetName>\r\n    <TargetExt>.dll</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\libmupdf\\</IntDir>\r\n    <TargetName>libmupdf</TargetName>\r\n    <TargetExt>.dll</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4206;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>advapi32.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;shell32.lib;windowscodecs.lib;comctl32.lib;msimg32.lib;winspool.lib;wininet.lib;urlmon.lib;gdiplus.lib;ole32.lib;oleAut32.lib;shlwapi.lib;version.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <ImportLibrary>..\\dbg\\libmupdf.lib</ImportLibrary>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n      <AdditionalOptions>/DEF:..\\src\\libmupdf.def %(AdditionalOptions)</AdditionalOptions>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4206;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>advapi32.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;shell32.lib;windowscodecs.lib;comctl32.lib;msimg32.lib;winspool.lib;wininet.lib;urlmon.lib;gdiplus.lib;ole32.lib;oleAut32.lib;shlwapi.lib;version.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <ImportLibrary>..\\dbg64\\libmupdf.lib</ImportLibrary>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n      <AdditionalOptions>/DEF:..\\src\\libmupdf.def %(AdditionalOptions)</AdditionalOptions>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4206;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>advapi32.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;shell32.lib;windowscodecs.lib;comctl32.lib;msimg32.lib;winspool.lib;wininet.lib;urlmon.lib;gdiplus.lib;ole32.lib;oleAut32.lib;shlwapi.lib;version.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <ImportLibrary>..\\rel\\libmupdf.lib</ImportLibrary>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n      <AdditionalOptions>/DEF:..\\src\\libmupdf.def %(AdditionalOptions)</AdditionalOptions>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4206;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>advapi32.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;shell32.lib;windowscodecs.lib;comctl32.lib;msimg32.lib;winspool.lib;wininet.lib;urlmon.lib;gdiplus.lib;ole32.lib;oleAut32.lib;shlwapi.lib;version.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <ImportLibrary>..\\rel64\\libmupdf.lib</ImportLibrary>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n      <AdditionalOptions>/DEF:..\\src\\libmupdf.def %(AdditionalOptions)</AdditionalOptions>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4206;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>advapi32.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;shell32.lib;windowscodecs.lib;comctl32.lib;msimg32.lib;winspool.lib;wininet.lib;urlmon.lib;gdiplus.lib;ole32.lib;oleAut32.lib;shlwapi.lib;version.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <ImportLibrary>..\\relPrefast\\libmupdf.lib</ImportLibrary>\r\n      <AdditionalOptions>/DEF:..\\src\\libmupdf.def %(AdditionalOptions)</AdditionalOptions>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4206;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <ResourceCompile>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n    </ResourceCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>advapi32.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;shell32.lib;windowscodecs.lib;comctl32.lib;msimg32.lib;winspool.lib;wininet.lib;urlmon.lib;gdiplus.lib;ole32.lib;oleAut32.lib;shlwapi.lib;version.lib;crypt32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <ImportLibrary>..\\relPrefast64\\libmupdf.lib</ImportLibrary>\r\n      <AdditionalOptions>/DEF:..\\src\\libmupdf.def %(AdditionalOptions)</AdditionalOptions>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\tools\\premake\\no_op_for_premake.cpp\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ResourceCompile Include=\"..\\src\\libmupdf.rc\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"mupdf.vcxproj\">\r\n      <Project>{2181F50F-8D95-1DC1-5617-C120C2EA19F2}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"libdjvu.vcxproj\">\r\n      <Project>{B5F26479-21D2-E314-2AEA-6EEB96484A76}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"unarrlib.vcxproj\">\r\n      <Project>{C45AE373-B027-3E7F-D940-2C27C56C730D}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"libwebp.vcxproj\">\r\n      <Project>{0A466F79-7625-EE14-7F3D-79EBEB9B5476}</Project>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/libmupdf.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"src\">\r\n      <UniqueIdentifier>{2DAB880B-99B4-887C-2230-9F7C8E38947C}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"tools\">\r\n      <UniqueIdentifier>{36DF7010-A2F3-98C1-6B75-3C21D74895F2}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"tools\\premake\">\r\n      <UniqueIdentifier>{AA91FD97-1652-79CE-DF8C-C24B4B0CBEAA}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\tools\\premake\\no_op_for_premake.cpp\">\r\n      <Filter>tools\\premake</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ResourceCompile Include=\"..\\src\\libmupdf.rc\">\r\n      <Filter>src</Filter>\r\n    </ResourceCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/libwebp.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{0A466F79-7625-EE14-7F3D-79EBEB9B5476}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>libwebp</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\libwebp\\</IntDir>\r\n    <TargetName>libwebp</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\libwebp\\</IntDir>\r\n    <TargetName>libwebp</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\libwebp\\</IntDir>\r\n    <TargetName>libwebp</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\libwebp\\</IntDir>\r\n    <TargetName>libwebp</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\libwebp\\</IntDir>\r\n    <TargetName>libwebp</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\libwebp\\</IntDir>\r\n    <TargetName>libwebp</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4204;4244;4057;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\libwebp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4204;4244;4057;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\libwebp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4204;4244;4057;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\libwebp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4204;4244;4057;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\libwebp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4204;4244;4057;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\libwebp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4204;4244;4057;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\libwebp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dec\\alpha.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dec\\buffer.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dec\\frame.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dec\\idec.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dec\\io.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dec\\quant.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dec\\tree.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dec\\vp8.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dec\\vp8l.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dec\\webp.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\alpha_processing.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\alpha_processing_sse2.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\cpu.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\dec.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\dec_clip_tables.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\dec_sse2.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\lossless.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\lossless_sse2.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\upsampling.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\upsampling_sse2.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\yuv.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\yuv_sse2.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\utils\\bit_reader.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\utils\\color_cache.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\utils\\filters.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\utils\\huffman.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\utils\\quant_levels_dec.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\utils\\random.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\utils\\rescaler.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\utils\\thread.c\" />\r\n    <ClCompile Include=\"..\\ext\\libwebp\\utils\\utils.c\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/libwebp.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"dec\">\r\n      <UniqueIdentifier>{B169880B-1D73-887C-A6EE-9E7C12F7937C}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"dsp\">\r\n      <UniqueIdentifier>{8C6B880B-F874-887C-81F0-9E7CEDF8937C}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"utils\">\r\n      <UniqueIdentifier>{169C8510-82B0-ADC1-4B32-5121B705AAF2}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dec\\alpha.c\">\r\n      <Filter>dec</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dec\\buffer.c\">\r\n      <Filter>dec</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dec\\frame.c\">\r\n      <Filter>dec</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dec\\idec.c\">\r\n      <Filter>dec</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dec\\io.c\">\r\n      <Filter>dec</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dec\\quant.c\">\r\n      <Filter>dec</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dec\\tree.c\">\r\n      <Filter>dec</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dec\\vp8.c\">\r\n      <Filter>dec</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dec\\vp8l.c\">\r\n      <Filter>dec</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dec\\webp.c\">\r\n      <Filter>dec</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\alpha_processing.c\">\r\n      <Filter>dsp</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\alpha_processing_sse2.c\">\r\n      <Filter>dsp</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\cpu.c\">\r\n      <Filter>dsp</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\dec.c\">\r\n      <Filter>dsp</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\dec_clip_tables.c\">\r\n      <Filter>dsp</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\dec_sse2.c\">\r\n      <Filter>dsp</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\lossless.c\">\r\n      <Filter>dsp</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\lossless_sse2.c\">\r\n      <Filter>dsp</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\upsampling.c\">\r\n      <Filter>dsp</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\upsampling_sse2.c\">\r\n      <Filter>dsp</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\yuv.c\">\r\n      <Filter>dsp</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\dsp\\yuv_sse2.c\">\r\n      <Filter>dsp</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\utils\\bit_reader.c\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\utils\\color_cache.c\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\utils\\filters.c\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\utils\\huffman.c\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\utils\\quant_levels_dec.c\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\utils\\random.c\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\utils\\rescaler.c\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\utils\\thread.c\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\libwebp\\utils\\utils.c\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/mudraw.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{154C9F0E-01EE-C9E4-EAA8-DD38D6E95035}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>mudraw</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\mudraw\\</IntDir>\r\n    <TargetName>mudraw</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\mudraw\\</IntDir>\r\n    <TargetName>mudraw</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\mudraw\\</IntDir>\r\n    <TargetName>mudraw</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\mudraw\\</IntDir>\r\n    <TargetName>mudraw</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\mudraw\\</IntDir>\r\n    <TargetName>mudraw</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\mudraw\\</IntDir>\r\n    <TargetName>mudraw</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\unarr;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>windowscodecs.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n      <AdditionalOptions>/ENTRY:\"wmainCRTStartup\" %(AdditionalOptions)</AdditionalOptions>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\unarr;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>windowscodecs.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n      <AdditionalOptions>/ENTRY:\"wmainCRTStartup\" %(AdditionalOptions)</AdditionalOptions>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\unarr;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>windowscodecs.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n      <AdditionalOptions>/ENTRY:\"wmainCRTStartup\" %(AdditionalOptions)</AdditionalOptions>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\unarr;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>windowscodecs.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n      <AdditionalOptions>/ENTRY:\"wmainCRTStartup\" %(AdditionalOptions)</AdditionalOptions>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4100;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\unarr;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>windowscodecs.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>\r\n      <AdditionalOptions>/ENTRY:\"wmainCRTStartup\" %(AdditionalOptions)</AdditionalOptions>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4100;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\unarr;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>windowscodecs.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>\r\n      <AdditionalOptions>/ENTRY:\"wmainCRTStartup\" %(AdditionalOptions)</AdditionalOptions>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\mupdf\\source\\cbz\\mucbz.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\document-all.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\document-no-run.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\output-pcl.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\output-pwg.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\stream-prog.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\svg-device.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\test-device.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\img\\muimage.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\tiff\\mutiff.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\tools\\mudraw.c\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"mupdf.vcxproj\">\r\n      <Project>{2181F50F-8D95-1DC1-5617-C120C2EA19F2}</Project>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/mudraw.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"cbz\">\r\n      <UniqueIdentifier>{2465880B-906E-887C-19EA-9E7C85F2937C}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"fitz\">\r\n      <UniqueIdentifier>{42CC967C-2E03-980D-D7EF-7D10C305140F}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"img\">\r\n      <UniqueIdentifier>{0280880B-6E89-887C-F704-9F7C630D947C}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"tiff\">\r\n      <UniqueIdentifier>{AE779E7C-9AAE-9F0D-439B-85102FB11B0F}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"tools\">\r\n      <UniqueIdentifier>{36DF7010-A2F3-98C1-6B75-3C21D74895F2}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\mupdf\\source\\cbz\\mucbz.c\">\r\n      <Filter>cbz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\document-all.c\">\r\n      <Filter>fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\document-no-run.c\">\r\n      <Filter>fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\output-pcl.c\">\r\n      <Filter>fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\output-pwg.c\">\r\n      <Filter>fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\stream-prog.c\">\r\n      <Filter>fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\svg-device.c\">\r\n      <Filter>fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\test-device.c\">\r\n      <Filter>fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\img\\muimage.c\">\r\n      <Filter>img</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\tiff\\mutiff.c\">\r\n      <Filter>tiff</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\tools\\mudraw.c\">\r\n      <Filter>tools</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/mui.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{1092880B-7C9B-887C-0517-9F7C711F947C}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>mui</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\mui\\</IntDir>\r\n    <TargetName>mui</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\mui\\</IntDir>\r\n    <TargetName>mui</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\mui\\</IntDir>\r\n    <TargetName>mui</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\mui\\</IntDir>\r\n    <TargetName>mui</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\mui\\</IntDir>\r\n    <TargetName>mui</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\mui\\</IntDir>\r\n    <TargetName>mui</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\src\\wingui;..\\src\\mui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\src\\wingui;..\\src\\mui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\src\\wingui;..\\src\\mui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\src\\wingui;..\\src\\mui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\src\\wingui;..\\src\\mui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\src\\wingui;..\\src\\mui;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\mui\\Mui.h\" />\r\n    <ClInclude Include=\"..\\src\\mui\\MuiBase.h\" />\r\n    <ClInclude Include=\"..\\src\\mui\\MuiButton.h\" />\r\n    <ClInclude Include=\"..\\src\\mui\\MuiControl.h\" />\r\n    <ClInclude Include=\"..\\src\\mui\\MuiCss.h\" />\r\n    <ClInclude Include=\"..\\src\\mui\\MuiDefs.h\" />\r\n    <ClInclude Include=\"..\\src\\mui\\MuiEventMgr.h\" />\r\n    <ClInclude Include=\"..\\src\\mui\\MuiFromText.h\" />\r\n    <ClInclude Include=\"..\\src\\mui\\MuiGrid.h\" />\r\n    <ClInclude Include=\"..\\src\\mui\\MuiHwndWrapper.h\" />\r\n    <ClInclude Include=\"..\\src\\mui\\MuiLayout.h\" />\r\n    <ClInclude Include=\"..\\src\\mui\\MuiPainter.h\" />\r\n    <ClInclude Include=\"..\\src\\mui\\MuiScrollBar.h\" />\r\n    <ClInclude Include=\"..\\src\\mui\\SvgPath.h\" />\r\n    <ClInclude Include=\"..\\src\\mui\\TextRender.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\mui\\Mui.cpp\" />\r\n    <ClCompile Include=\"..\\src\\mui\\MuiBase.cpp\" />\r\n    <ClCompile Include=\"..\\src\\mui\\MuiButton.cpp\" />\r\n    <ClCompile Include=\"..\\src\\mui\\MuiControl.cpp\" />\r\n    <ClCompile Include=\"..\\src\\mui\\MuiCss.cpp\" />\r\n    <ClCompile Include=\"..\\src\\mui\\MuiDefs.cpp\" />\r\n    <ClCompile Include=\"..\\src\\mui\\MuiEventMgr.cpp\" />\r\n    <ClCompile Include=\"..\\src\\mui\\MuiFromText.cpp\" />\r\n    <ClCompile Include=\"..\\src\\mui\\MuiGrid.cpp\" />\r\n    <ClCompile Include=\"..\\src\\mui\\MuiHwndWrapper.cpp\" />\r\n    <ClCompile Include=\"..\\src\\mui\\MuiLayout.cpp\" />\r\n    <ClCompile Include=\"..\\src\\mui\\MuiPainter.cpp\" />\r\n    <ClCompile Include=\"..\\src\\mui\\MuiScrollBar.cpp\" />\r\n    <ClCompile Include=\"..\\src\\mui\\SvgPath.cpp\" />\r\n    <ClCompile Include=\"..\\src\\mui\\TextRender.cpp\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/mupdf.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{2181F50F-8D95-1DC1-5617-C120C2EA19F2}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>mupdf</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\mupdf\\</IntDir>\r\n    <TargetName>mupdf</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\mupdf\\</IntDir>\r\n    <TargetName>mupdf</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\mupdf\\</IntDir>\r\n    <TargetName>mupdf</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\mupdf\\</IntDir>\r\n    <TargetName>mupdf</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\mupdf\\</IntDir>\r\n    <TargetName>mupdf</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\mupdf\\</IntDir>\r\n    <TargetName>mupdf</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4244;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;NOCJKFONT;SHARE_JPEG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\mupdf\\include;..\\mupdf\\generated;..\\ext\\zlib;..\\ext\\freetype2\\config;..\\ext\\freetype2\\include;..\\ext\\jbig2dec;..\\ext\\libjpeg-turbo;..\\ext\\openjpeg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4244;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;NOCJKFONT;SHARE_JPEG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\mupdf\\include;..\\mupdf\\generated;..\\ext\\zlib;..\\ext\\freetype2\\config;..\\ext\\freetype2\\include;..\\ext\\jbig2dec;..\\ext\\libjpeg-turbo;..\\ext\\openjpeg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4244;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NOCJKFONT;SHARE_JPEG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\mupdf\\include;..\\mupdf\\generated;..\\ext\\zlib;..\\ext\\freetype2\\config;..\\ext\\freetype2\\include;..\\ext\\jbig2dec;..\\ext\\libjpeg-turbo;..\\ext\\openjpeg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4244;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NOCJKFONT;SHARE_JPEG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\mupdf\\include;..\\mupdf\\generated;..\\ext\\zlib;..\\ext\\freetype2\\config;..\\ext\\freetype2\\include;..\\ext\\jbig2dec;..\\ext\\libjpeg-turbo;..\\ext\\openjpeg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4244;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NOCJKFONT;SHARE_JPEG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\mupdf\\include;..\\mupdf\\generated;..\\ext\\zlib;..\\ext\\freetype2\\config;..\\ext\\freetype2\\include;..\\ext\\jbig2dec;..\\ext\\libjpeg-turbo;..\\ext\\openjpeg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4244;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NOCJKFONT;SHARE_JPEG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\mupdf\\include;..\\mupdf\\generated;..\\ext\\zlib;..\\ext\\freetype2\\config;..\\ext\\freetype2\\include;..\\ext\\jbig2dec;..\\ext\\libjpeg-turbo;..\\ext\\openjpeg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\bbox-device.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\bitmap.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\buffer.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\colorspace.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\compressed-buffer.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\context.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\crypt-aes.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\crypt-arc4.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\crypt-md5.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\crypt-sha2.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\device.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\document.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\draw-affine.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\draw-blend.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\draw-device.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\draw-edge.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\draw-glyph.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\draw-mesh.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\draw-paint.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\draw-path.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\draw-scale-simple.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\draw-unpack.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\error.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\filter-basic.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\filter-dct.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\filter-fax.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\filter-flate.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\filter-jbig2.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\filter-leech.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\filter-lzw.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\filter-predict.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\font.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\ftoa.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\function.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\geometry.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\getopt.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\glyph.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\halftone.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\hash.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\image.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\link.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\list-device.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\load-jpeg.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\load-jpx.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\load-jxr.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\load-png.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\load-tiff.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\memory.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\outline.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\output.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\path.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\pixmap.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\printf.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\shade.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\stext-device.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\stext-output.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\stext-paragraph.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\stext-search.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\store.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\stream-open.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\stream-read.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\string.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\strtod.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\text.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\time.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\trace-device.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\transition.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\tree.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\ucdn.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\unzip.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\xml.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\js\\pdf-js-none.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-annot-edit.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-annot.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-appearance.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-clean.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-cmap-load.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-cmap-parse.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-cmap-table.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-cmap.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-colorspace.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-crypt.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-device.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-encoding.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-event.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-field.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-font.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-fontfile.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-form.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-ft-tools.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-function.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-image.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-interpret.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-lex.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-metrics.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-nametree.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-object.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-op-buffer.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-op-filter.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-op-run.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-outline.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-page.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-parse.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-pattern.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-pkcs7.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-repair.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-run.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-shade.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-store.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-stream.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-type3.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-unicode.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-write.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-xobject.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-xref-aux.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-xref.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\xps\\xps-common.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\xps\\xps-doc.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\xps\\xps-glyphs.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\xps\\xps-gradient.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\xps\\xps-image.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\xps\\xps-outline.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\xps\\xps-path.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\xps\\xps-resource.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\xps\\xps-tile.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\xps\\xps-util.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\xps\\xps-zip.c\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <CustomBuild Include=\"..\\mupdf\\font_base14.asm\">\r\n      <FileType>Document</FileType>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">..\\bin\\nasm.exe -f win32 -I ../mupdf/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">Compiling %(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">..\\bin\\nasm.exe -f win64 -DWIN64 -I ../mupdf/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">Compiling %(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">..\\bin\\nasm.exe -f win32 -I ../mupdf/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">Compiling %(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">..\\bin\\nasm.exe -f win64 -DWIN64 -I ../mupdf/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">Compiling %(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">..\\bin\\nasm.exe -f win32 -I ../mupdf/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">Compiling %(Identity)</Message>\r\n      <Command Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">..\\bin\\nasm.exe -f win64 -DWIN64 -I ../mupdf/ -o \"$(IntDir)/%(Filename).obj\" \"%(Identity)\"</Command>\r\n      <Outputs Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">$(IntDir)/%(Filename).obj</Outputs>\r\n      <Message Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">Compiling %(Identity)</Message>\r\n    </CustomBuild>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"zlib.vcxproj\">\r\n      <Project>{16CFA17C-0206-A30D-ABF2-881097081F0F}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"freetype.vcxproj\">\r\n      <Project>{89895BD8-7556-B6E3-9E6F-A48B8A9BEB71}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"libjpeg-turbo.vcxproj\">\r\n      <Project>{DB56484D-4717-C483-1052-0D017CD10860}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"jbig2dec.vcxproj\">\r\n      <Project>{BF5813C3-AB25-6ECE-D43E-5C76C06AA35C}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"openjpeg.vcxproj\">\r\n      <Project>{FDC4548D-E991-AF98-12AB-9D40FED6E426}</Project>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/mupdf.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"source\">\r\n      <UniqueIdentifier>{76FF3A1C-62A1-65F2-4B5C-7946379DEC42}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"source\\fitz\">\r\n      <UniqueIdentifier>{A255BFBA-0E0B-38B0-97FF-318703B42EB4}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"source\\pdf\">\r\n      <UniqueIdentifier>{FF7915B8-EB31-5705-5439-30614010F2F5}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"source\\pdf\\js\">\r\n      <UniqueIdentifier>{AB83DB7E-1744-57B5-E07E-A0324CFE9B91}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"source\\xps\">\r\n      <UniqueIdentifier>{A09D15B8-8C55-5705-F55C-3061E133F2F5}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\bbox-device.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\bitmap.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\buffer.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\colorspace.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\compressed-buffer.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\context.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\crypt-aes.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\crypt-arc4.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\crypt-md5.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\crypt-sha2.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\device.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\document.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\draw-affine.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\draw-blend.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\draw-device.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\draw-edge.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\draw-glyph.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\draw-mesh.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\draw-paint.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\draw-path.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\draw-scale-simple.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\draw-unpack.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\error.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\filter-basic.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\filter-dct.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\filter-fax.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\filter-flate.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\filter-jbig2.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\filter-leech.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\filter-lzw.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\filter-predict.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\font.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\ftoa.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\function.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\geometry.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\getopt.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\glyph.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\halftone.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\hash.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\image.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\link.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\list-device.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\load-jpeg.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\load-jpx.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\load-jxr.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\load-png.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\load-tiff.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\memory.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\outline.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\output.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\path.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\pixmap.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\printf.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\shade.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\stext-device.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\stext-output.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\stext-paragraph.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\stext-search.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\store.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\stream-open.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\stream-read.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\string.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\strtod.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\text.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\time.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\trace-device.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\transition.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\tree.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\ucdn.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\unzip.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\xml.c\">\r\n      <Filter>source\\fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\js\\pdf-js-none.c\">\r\n      <Filter>source\\pdf\\js</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-annot-edit.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-annot.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-appearance.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-clean.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-cmap-load.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-cmap-parse.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-cmap-table.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-cmap.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-colorspace.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-crypt.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-device.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-encoding.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-event.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-field.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-font.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-fontfile.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-form.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-ft-tools.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-function.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-image.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-interpret.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-lex.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-metrics.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-nametree.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-object.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-op-buffer.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-op-filter.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-op-run.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-outline.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-page.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-parse.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-pattern.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-pkcs7.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-repair.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-run.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-shade.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-store.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-stream.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-type3.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-unicode.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-write.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-xobject.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-xref-aux.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\pdf\\pdf-xref.c\">\r\n      <Filter>source\\pdf</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\xps\\xps-common.c\">\r\n      <Filter>source\\xps</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\xps\\xps-doc.c\">\r\n      <Filter>source\\xps</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\xps\\xps-glyphs.c\">\r\n      <Filter>source\\xps</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\xps\\xps-gradient.c\">\r\n      <Filter>source\\xps</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\xps\\xps-image.c\">\r\n      <Filter>source\\xps</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\xps\\xps-outline.c\">\r\n      <Filter>source\\xps</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\xps\\xps-path.c\">\r\n      <Filter>source\\xps</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\xps\\xps-resource.c\">\r\n      <Filter>source\\xps</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\xps\\xps-tile.c\">\r\n      <Filter>source\\xps</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\xps\\xps-util.c\">\r\n      <Filter>source\\xps</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\xps\\xps-zip.c\">\r\n      <Filter>source\\xps</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <CustomBuild Include=\"..\\mupdf\\font_base14.asm\" />\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/mutool.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{2507A80E-11A9-D2E4-FA63-E638E6A45935}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>mutool</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\mutool\\</IntDir>\r\n    <TargetName>mutool</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\mutool\\</IntDir>\r\n    <TargetName>mutool</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\mutool\\</IntDir>\r\n    <TargetName>mutool</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\mutool\\</IntDir>\r\n    <TargetName>mutool</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\mutool\\</IntDir>\r\n    <TargetName>mutool</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\mutool\\</IntDir>\r\n    <TargetName>mutool</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\unarr;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>windowscodecs.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\unarr;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>windowscodecs.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\unarr;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>windowscodecs.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\unarr;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>windowscodecs.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4100;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\unarr;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>windowscodecs.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4100;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\unarr;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>windowscodecs.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>wmainCRTStartup</EntryPointSymbol>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\mupdf\\source\\cbz\\mucbz.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\document-all.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\document-no-run.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\output-pcl.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\output-pwg.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\stream-prog.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\svg-device.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\test-device.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\img\\muimage.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\tiff\\mutiff.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\tools\\mutool.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\tools\\pdfclean.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\tools\\pdfextract.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\tools\\pdfinfo.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\tools\\pdfposter.c\" />\r\n    <ClCompile Include=\"..\\mupdf\\source\\tools\\pdfshow.c\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"mupdf.vcxproj\">\r\n      <Project>{2181F50F-8D95-1DC1-5617-C120C2EA19F2}</Project>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/mutool.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"cbz\">\r\n      <UniqueIdentifier>{2465880B-906E-887C-19EA-9E7C85F2937C}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"fitz\">\r\n      <UniqueIdentifier>{42CC967C-2E03-980D-D7EF-7D10C305140F}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"img\">\r\n      <UniqueIdentifier>{0280880B-6E89-887C-F704-9F7C630D947C}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"tiff\">\r\n      <UniqueIdentifier>{AE779E7C-9AAE-9F0D-439B-85102FB11B0F}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"tools\">\r\n      <UniqueIdentifier>{36DF7010-A2F3-98C1-6B75-3C21D74895F2}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\mupdf\\source\\cbz\\mucbz.c\">\r\n      <Filter>cbz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\document-all.c\">\r\n      <Filter>fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\document-no-run.c\">\r\n      <Filter>fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\output-pcl.c\">\r\n      <Filter>fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\output-pwg.c\">\r\n      <Filter>fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\stream-prog.c\">\r\n      <Filter>fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\svg-device.c\">\r\n      <Filter>fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\fitz\\test-device.c\">\r\n      <Filter>fitz</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\img\\muimage.c\">\r\n      <Filter>img</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\tiff\\mutiff.c\">\r\n      <Filter>tiff</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\tools\\mutool.c\">\r\n      <Filter>tools</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\tools\\pdfclean.c\">\r\n      <Filter>tools</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\tools\\pdfextract.c\">\r\n      <Filter>tools</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\tools\\pdfinfo.c\">\r\n      <Filter>tools</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\tools\\pdfposter.c\">\r\n      <Filter>tools</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\mupdf\\source\\tools\\pdfshow.c\">\r\n      <Filter>tools</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/openjpeg.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{FDC4548D-E991-AF98-12AB-9D40FED6E426}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>openjpeg</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\openjpeg\\</IntDir>\r\n    <TargetName>openjpeg</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\openjpeg\\</IntDir>\r\n    <TargetName>openjpeg</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\openjpeg\\</IntDir>\r\n    <TargetName>openjpeg</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\openjpeg\\</IntDir>\r\n    <TargetName>openjpeg</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\openjpeg\\</IntDir>\r\n    <TargetName>openjpeg</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\openjpeg\\</IntDir>\r\n    <TargetName>openjpeg</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4244;4819;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\openjpeg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4244;4819;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\openjpeg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4244;4819;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\openjpeg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4244;4819;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\openjpeg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4100;4244;4819;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\openjpeg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4100;4244;4819;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\openjpeg;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\ext\\openjpeg\\bio.h\" />\r\n    <ClInclude Include=\"..\\ext\\openjpeg\\cidx_manager.h\" />\r\n    <ClInclude Include=\"..\\ext\\openjpeg\\cio.h\" />\r\n    <ClInclude Include=\"..\\ext\\openjpeg\\dwt.h\" />\r\n    <ClInclude Include=\"..\\ext\\openjpeg\\event.h\" />\r\n    <ClInclude Include=\"..\\ext\\openjpeg\\function_list.h\" />\r\n    <ClInclude Include=\"..\\ext\\openjpeg\\image.h\" />\r\n    <ClInclude Include=\"..\\ext\\openjpeg\\invert.h\" />\r\n    <ClInclude Include=\"..\\ext\\openjpeg\\j2k.h\" />\r\n    <ClInclude Include=\"..\\ext\\openjpeg\\jp2.h\" />\r\n    <ClInclude Include=\"..\\ext\\openjpeg\\mct.h\" />\r\n    <ClInclude Include=\"..\\ext\\openjpeg\\mqc.h\" />\r\n    <ClInclude Include=\"..\\ext\\openjpeg\\openjpeg.h\" />\r\n    <ClInclude Include=\"..\\ext\\openjpeg\\opj_clock.h\" />\r\n    <ClInclude Include=\"..\\ext\\openjpeg\\opj_config.h\" />\r\n    <ClInclude Include=\"..\\ext\\openjpeg\\pi.h\" />\r\n    <ClInclude Include=\"..\\ext\\openjpeg\\raw.h\" />\r\n    <ClInclude Include=\"..\\ext\\openjpeg\\t1.h\" />\r\n    <ClInclude Include=\"..\\ext\\openjpeg\\t2.h\" />\r\n    <ClInclude Include=\"..\\ext\\openjpeg\\tcd.h\" />\r\n    <ClInclude Include=\"..\\ext\\openjpeg\\tgt.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\bio.c\" />\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\cidx_manager.c\" />\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\cio.c\" />\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\dwt.c\" />\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\event.c\" />\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\function_list.c\" />\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\image.c\" />\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\invert.c\" />\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\j2k.c\" />\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\jp2.c\" />\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\mct.c\" />\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\mqc.c\" />\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\openjpeg.c\" />\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\opj_clock.c\" />\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\phix_manager.c\" />\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\pi.c\" />\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\raw.c\" />\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\t1.c\" />\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\t2.c\" />\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\tcd.c\" />\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\tgt.c\" />\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\thix_manager.c\" />\r\n    <ClCompile Include=\"..\\ext\\openjpeg\\tpix_manager.c\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <None Include=\"..\\ext\\openjpeg\\ppix_manager.\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/plugin-test.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{21A274DA-8D57-EDCF-164C-E7A68200E4D3}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>plugin-test</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\plugin-test\\</IntDir>\r\n    <TargetName>plugin-test</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\plugin-test\\</IntDir>\r\n    <TargetName>plugin-test</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\plugin-test\\</IntDir>\r\n    <TargetName>plugin-test</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\plugin-test\\</IntDir>\r\n    <TargetName>plugin-test</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\plugin-test\\</IntDir>\r\n    <TargetName>plugin-test</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\plugin-test\\</IntDir>\r\n    <TargetName>plugin-test</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\tools\\plugin-test.cpp\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"utils.vcxproj\">\r\n      <Project>{169C8510-82B0-ADC1-4B32-5121B705AAF2}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"mupdf.vcxproj\">\r\n      <Project>{2181F50F-8D95-1DC1-5617-C120C2EA19F2}</Project>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/signfile.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{16722C28-023F-8733-2B58-75DB1784BCC1}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>signfile</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\signfile\\</IntDir>\r\n    <TargetName>signfile</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\signfile\\</IntDir>\r\n    <TargetName>signfile</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\signfile\\</IntDir>\r\n    <TargetName>signfile</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\signfile\\</IntDir>\r\n    <TargetName>signfile</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\signfile\\</IntDir>\r\n    <TargetName>signfile</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\signfile\\</IntDir>\r\n    <TargetName>signfile</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>crypt32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>crypt32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>crypt32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>crypt32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>crypt32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>crypt32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\tools\\signfile.cpp\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"utils.vcxproj\">\r\n      <Project>{169C8510-82B0-ADC1-4B32-5121B705AAF2}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"mupdf.vcxproj\">\r\n      <Project>{2181F50F-8D95-1DC1-5617-C120C2EA19F2}</Project>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/sumatra.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{E21500B1-4EF5-7E4C-570D-0A23C36BE5AD}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>sumatra</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\sumatra\\</IntDir>\r\n    <TargetName>sumatra</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\sumatra\\</IntDir>\r\n    <TargetName>sumatra</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\sumatra\\</IntDir>\r\n    <TargetName>sumatra</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\sumatra\\</IntDir>\r\n    <TargetName>sumatra</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\sumatra\\</IntDir>\r\n    <TargetName>sumatra</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\sumatra\\</IntDir>\r\n    <TargetName>sumatra</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\ext\\synctex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\ext\\synctex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\ext\\synctex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\ext\\synctex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\ext\\synctex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\ext\\synctex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\AppPrefs.h\" />\r\n    <ClInclude Include=\"..\\src\\AppTools.h\" />\r\n    <ClInclude Include=\"..\\src\\AppUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\Canvas.h\" />\r\n    <ClInclude Include=\"..\\src\\Caption.h\" />\r\n    <ClInclude Include=\"..\\src\\ChmModel.h\" />\r\n    <ClInclude Include=\"..\\src\\CrashHandler.h\" />\r\n    <ClInclude Include=\"..\\src\\DisplayModel.h\" />\r\n    <ClInclude Include=\"..\\src\\Doc.h\" />\r\n    <ClInclude Include=\"..\\src\\EbookController.h\" />\r\n    <ClInclude Include=\"..\\src\\EbookControls.h\" />\r\n    <ClInclude Include=\"..\\src\\ExternalViewers.h\" />\r\n    <ClInclude Include=\"..\\src\\Favorites.h\" />\r\n    <ClInclude Include=\"..\\src\\FileHistory.h\" />\r\n    <ClInclude Include=\"..\\src\\FileThumbnails.h\" />\r\n    <ClInclude Include=\"..\\src\\GlobalPrefs.h\" />\r\n    <ClInclude Include=\"..\\src\\Menu.h\" />\r\n    <ClInclude Include=\"..\\src\\MuiEbookPageDef.h\" />\r\n    <ClInclude Include=\"..\\src\\Notifications.h\" />\r\n    <ClInclude Include=\"..\\src\\PagesLayoutDef.h\" />\r\n    <ClInclude Include=\"..\\src\\ParseCommandLine.h\" />\r\n    <ClInclude Include=\"..\\src\\PdfSync.h\" />\r\n    <ClInclude Include=\"..\\src\\Print.h\" />\r\n    <ClInclude Include=\"..\\src\\RenderCache.h\" />\r\n    <ClInclude Include=\"..\\src\\Search.h\" />\r\n    <ClInclude Include=\"..\\src\\Selection.h\" />\r\n    <ClInclude Include=\"..\\src\\SettingsStructs.h\" />\r\n    <ClInclude Include=\"..\\src\\StressTesting.h\" />\r\n    <ClInclude Include=\"..\\src\\SumatraAbout.h\" />\r\n    <ClInclude Include=\"..\\src\\SumatraAbout2.h\" />\r\n    <ClInclude Include=\"..\\src\\SumatraDialogs.h\" />\r\n    <ClInclude Include=\"..\\src\\SumatraProperties.h\" />\r\n    <ClInclude Include=\"..\\src\\TabInfo.h\" />\r\n    <ClInclude Include=\"..\\src\\TableOfContents.h\" />\r\n    <ClInclude Include=\"..\\src\\Tabs.h\" />\r\n    <ClInclude Include=\"..\\src\\TextSearch.h\" />\r\n    <ClInclude Include=\"..\\src\\TextSelection.h\" />\r\n    <ClInclude Include=\"..\\src\\Toolbar.h\" />\r\n    <ClInclude Include=\"..\\src\\Translations.h\" />\r\n    <ClInclude Include=\"..\\src\\Version.h\" />\r\n    <ClInclude Include=\"..\\src\\WindowInfo.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\AppPrefs.cpp\" />\r\n    <ClCompile Include=\"..\\src\\AppTools.cpp\" />\r\n    <ClCompile Include=\"..\\src\\AppUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Canvas.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Caption.cpp\" />\r\n    <ClCompile Include=\"..\\src\\ChmModel.cpp\" />\r\n    <ClCompile Include=\"..\\src\\CrashHandler.cpp\" />\r\n    <ClCompile Include=\"..\\src\\DisplayModel.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Doc.cpp\" />\r\n    <ClCompile Include=\"..\\src\\EbookController.cpp\" />\r\n    <ClCompile Include=\"..\\src\\EbookControls.cpp\" />\r\n    <ClCompile Include=\"..\\src\\ExternalViewers.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Favorites.cpp\" />\r\n    <ClCompile Include=\"..\\src\\FileHistory.cpp\" />\r\n    <ClCompile Include=\"..\\src\\FileThumbnails.cpp\" />\r\n    <ClCompile Include=\"..\\src\\GlobalPrefs.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Menu.cpp\" />\r\n    <ClCompile Include=\"..\\src\\MuiEbookPageDef.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Notifications.cpp\" />\r\n    <ClCompile Include=\"..\\src\\PagesLayoutDef.cpp\" />\r\n    <ClCompile Include=\"..\\src\\ParseCommandLine.cpp\" />\r\n    <ClCompile Include=\"..\\src\\PdfSync.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Print.cpp\" />\r\n    <ClCompile Include=\"..\\src\\RenderCache.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Search.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Selection.cpp\" />\r\n    <ClCompile Include=\"..\\src\\SettingsStructs.cpp\" />\r\n    <ClCompile Include=\"..\\src\\StressTesting.cpp\" />\r\n    <ClCompile Include=\"..\\src\\SumatraAbout.cpp\" />\r\n    <ClCompile Include=\"..\\src\\SumatraAbout2.cpp\" />\r\n    <ClCompile Include=\"..\\src\\SumatraDialogs.cpp\" />\r\n    <ClCompile Include=\"..\\src\\SumatraProperties.cpp\" />\r\n    <ClCompile Include=\"..\\src\\TabInfo.cpp\" />\r\n    <ClCompile Include=\"..\\src\\TableOfContents.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Tabs.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Tester.cpp\" />\r\n    <ClCompile Include=\"..\\src\\TextSearch.cpp\" />\r\n    <ClCompile Include=\"..\\src\\TextSelection.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Toolbar.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Trans_sumatra_txt.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Translations.cpp\" />\r\n    <ClCompile Include=\"..\\src\\WindowInfo.cpp\" />\r\n    <ClCompile Include=\"..\\src\\regress\\Regress.cpp\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/sumatra.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"regress\">\r\n      <UniqueIdentifier>{E0CE4F3E-4CAE-CED9-55C6-59B0C124353B}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\AppPrefs.h\" />\r\n    <ClInclude Include=\"..\\src\\AppTools.h\" />\r\n    <ClInclude Include=\"..\\src\\AppUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\Canvas.h\" />\r\n    <ClInclude Include=\"..\\src\\Caption.h\" />\r\n    <ClInclude Include=\"..\\src\\ChmModel.h\" />\r\n    <ClInclude Include=\"..\\src\\CrashHandler.h\" />\r\n    <ClInclude Include=\"..\\src\\DisplayModel.h\" />\r\n    <ClInclude Include=\"..\\src\\Doc.h\" />\r\n    <ClInclude Include=\"..\\src\\EbookController.h\" />\r\n    <ClInclude Include=\"..\\src\\EbookControls.h\" />\r\n    <ClInclude Include=\"..\\src\\ExternalViewers.h\" />\r\n    <ClInclude Include=\"..\\src\\Favorites.h\" />\r\n    <ClInclude Include=\"..\\src\\FileHistory.h\" />\r\n    <ClInclude Include=\"..\\src\\FileThumbnails.h\" />\r\n    <ClInclude Include=\"..\\src\\GlobalPrefs.h\" />\r\n    <ClInclude Include=\"..\\src\\Menu.h\" />\r\n    <ClInclude Include=\"..\\src\\MuiEbookPageDef.h\" />\r\n    <ClInclude Include=\"..\\src\\Notifications.h\" />\r\n    <ClInclude Include=\"..\\src\\PagesLayoutDef.h\" />\r\n    <ClInclude Include=\"..\\src\\ParseCommandLine.h\" />\r\n    <ClInclude Include=\"..\\src\\PdfSync.h\" />\r\n    <ClInclude Include=\"..\\src\\Print.h\" />\r\n    <ClInclude Include=\"..\\src\\RenderCache.h\" />\r\n    <ClInclude Include=\"..\\src\\Search.h\" />\r\n    <ClInclude Include=\"..\\src\\Selection.h\" />\r\n    <ClInclude Include=\"..\\src\\SettingsStructs.h\" />\r\n    <ClInclude Include=\"..\\src\\StressTesting.h\" />\r\n    <ClInclude Include=\"..\\src\\SumatraAbout.h\" />\r\n    <ClInclude Include=\"..\\src\\SumatraAbout2.h\" />\r\n    <ClInclude Include=\"..\\src\\SumatraDialogs.h\" />\r\n    <ClInclude Include=\"..\\src\\SumatraProperties.h\" />\r\n    <ClInclude Include=\"..\\src\\TabInfo.h\" />\r\n    <ClInclude Include=\"..\\src\\TableOfContents.h\" />\r\n    <ClInclude Include=\"..\\src\\Tabs.h\" />\r\n    <ClInclude Include=\"..\\src\\TextSearch.h\" />\r\n    <ClInclude Include=\"..\\src\\TextSelection.h\" />\r\n    <ClInclude Include=\"..\\src\\Toolbar.h\" />\r\n    <ClInclude Include=\"..\\src\\Translations.h\" />\r\n    <ClInclude Include=\"..\\src\\Version.h\" />\r\n    <ClInclude Include=\"..\\src\\WindowInfo.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\AppPrefs.cpp\" />\r\n    <ClCompile Include=\"..\\src\\AppTools.cpp\" />\r\n    <ClCompile Include=\"..\\src\\AppUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Canvas.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Caption.cpp\" />\r\n    <ClCompile Include=\"..\\src\\ChmModel.cpp\" />\r\n    <ClCompile Include=\"..\\src\\CrashHandler.cpp\" />\r\n    <ClCompile Include=\"..\\src\\DisplayModel.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Doc.cpp\" />\r\n    <ClCompile Include=\"..\\src\\EbookController.cpp\" />\r\n    <ClCompile Include=\"..\\src\\EbookControls.cpp\" />\r\n    <ClCompile Include=\"..\\src\\ExternalViewers.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Favorites.cpp\" />\r\n    <ClCompile Include=\"..\\src\\FileHistory.cpp\" />\r\n    <ClCompile Include=\"..\\src\\FileThumbnails.cpp\" />\r\n    <ClCompile Include=\"..\\src\\GlobalPrefs.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Menu.cpp\" />\r\n    <ClCompile Include=\"..\\src\\MuiEbookPageDef.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Notifications.cpp\" />\r\n    <ClCompile Include=\"..\\src\\PagesLayoutDef.cpp\" />\r\n    <ClCompile Include=\"..\\src\\ParseCommandLine.cpp\" />\r\n    <ClCompile Include=\"..\\src\\PdfSync.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Print.cpp\" />\r\n    <ClCompile Include=\"..\\src\\RenderCache.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Search.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Selection.cpp\" />\r\n    <ClCompile Include=\"..\\src\\SettingsStructs.cpp\" />\r\n    <ClCompile Include=\"..\\src\\StressTesting.cpp\" />\r\n    <ClCompile Include=\"..\\src\\SumatraAbout.cpp\" />\r\n    <ClCompile Include=\"..\\src\\SumatraAbout2.cpp\" />\r\n    <ClCompile Include=\"..\\src\\SumatraDialogs.cpp\" />\r\n    <ClCompile Include=\"..\\src\\SumatraProperties.cpp\" />\r\n    <ClCompile Include=\"..\\src\\TabInfo.cpp\" />\r\n    <ClCompile Include=\"..\\src\\TableOfContents.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Tabs.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Tester.cpp\" />\r\n    <ClCompile Include=\"..\\src\\TextSearch.cpp\" />\r\n    <ClCompile Include=\"..\\src\\TextSelection.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Toolbar.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Trans_sumatra_txt.cpp\" />\r\n    <ClCompile Include=\"..\\src\\Translations.cpp\" />\r\n    <ClCompile Include=\"..\\src\\WindowInfo.cpp\" />\r\n    <ClCompile Include=\"..\\src\\regress\\Regress.cpp\">\r\n      <Filter>regress</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/synctex.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{13E867BA-7FC7-E655-88DF-712CF43D4DB7}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>synctex</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\synctex\\</IntDir>\r\n    <TargetName>synctex</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\synctex\\</IntDir>\r\n    <TargetName>synctex</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\synctex\\</IntDir>\r\n    <TargetName>synctex</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\synctex\\</IntDir>\r\n    <TargetName>synctex</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\synctex\\</IntDir>\r\n    <TargetName>synctex</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\synctex\\</IntDir>\r\n    <TargetName>synctex</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4244;4267;4702;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\synctex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4244;4267;4702;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\synctex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4244;4267;4702;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\synctex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4244;4267;4702;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\synctex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4100;4244;4267;4702;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\synctex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4100;4244;4267;4702;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\synctex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\ext\\synctex\\synctex_parser.c\" />\r\n    <ClCompile Include=\"..\\ext\\synctex\\synctex_parser_utils.c\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/test_util.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{22AB719A-8E15-2611-D753-D7B643FD0366}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>test_util</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\test_util\\</IntDir>\r\n    <TargetName>test_util</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\test_util\\</IntDir>\r\n    <TargetName>test_util</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\test_util\\</IntDir>\r\n    <TargetName>test_util</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\test_util\\</IntDir>\r\n    <TargetName>test_util</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\test_util\\</IntDir>\r\n    <TargetName>test_util</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\test_util\\</IntDir>\r\n    <TargetName>test_util</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;NO_LIBMUPDF;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>gdiplus.lib;comctl32.lib;shlwapi.lib;Version.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;NO_LIBMUPDF;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <AdditionalDependencies>gdiplus.lib;comctl32.lib;shlwapi.lib;Version.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NO_LIBMUPDF;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>gdiplus.lib;comctl32.lib;shlwapi.lib;Version.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NO_LIBMUPDF;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>gdiplus.lib;comctl32.lib;shlwapi.lib;Version.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NO_LIBMUPDF;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>gdiplus.lib;comctl32.lib;shlwapi.lib;Version.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;NO_LIBMUPDF;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <AdditionalDependencies>gdiplus.lib;comctl32.lib;shlwapi.lib;Version.lib;%(AdditionalDependencies)</AdditionalDependencies>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\AppUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\ParseCommandLine.h\" />\r\n    <ClInclude Include=\"..\\src\\SettingsStructs.h\" />\r\n    <ClInclude Include=\"..\\src\\mui\\SvgPath.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\BaseUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\BitManip.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\ByteOrderDecoder.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\CmdLineParser.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\CryptoUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\CssParser.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\DebugLog.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\Dict.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\FileUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\GeomUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\HtmlParserLookup.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\HtmlPrettyPrint.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\HtmlPullParser.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\JsonParser.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\Scoped.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\SettingsUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\SimpleLog.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\SquareTreeParser.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\StrFormat.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\StrUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\TrivialHtmlParser.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\UtAssert.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\VarintGob.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\Vec.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\WinDynCalls.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\WinUtil.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\AppUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\ParseCommandLine.cpp\" />\r\n    <ClCompile Include=\"..\\src\\SettingsStructs.cpp\" />\r\n    <ClCompile Include=\"..\\src\\UnitTests.cpp\" />\r\n    <ClCompile Include=\"..\\src\\mui\\SvgPath.cpp\" />\r\n    <ClCompile Include=\"..\\src\\mui\\SvgPath_ut.cpp\" />\r\n    <ClCompile Include=\"..\\src\\tools\\test_util.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\BaseUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\ByteOrderDecoder.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\CmdLineParser.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\CryptoUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\CssParser.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\DebugLog.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\Dict.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\FileUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\HtmlParserLookup.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\HtmlPrettyPrint.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\HtmlPullParser.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\JsonParser.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\SettingsUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\SquareTreeParser.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\StrFormat.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\StrUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\TrivialHtmlParser.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\UtAssert.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\VarintGob.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\WinDynCalls.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\WinUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\BaseUtil_ut.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\ByteOrderDecoder_ut.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\CmdLineParser_ut.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\CryptoUtil_ut.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\CssParser_ut.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\Dict_ut.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\FileUtil_ut.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\HtmlPrettyPrint_ut.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\HtmlPullParser_ut.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\JsonParser_ut.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\SettingsUtil_ut.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\SimpleLog_ut.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\SquareTreeParser_ut.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\StrFormat_ut.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\StrUtil_ut.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\TrivialHtmlParser_ut.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\VarintGob_ut.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\Vec_ut.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\WinUtil_ut.cpp\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/test_util.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"mui\">\r\n      <UniqueIdentifier>{1092880B-7C9B-887C-0517-9F7C711F947C}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"tools\">\r\n      <UniqueIdentifier>{36DF7010-A2F3-98C1-6B75-3C21D74895F2}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"utils\">\r\n      <UniqueIdentifier>{169C8510-82B0-ADC1-4B32-5121B705AAF2}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"utils\\tests\">\r\n      <UniqueIdentifier>{78BFDA30-E474-5326-6D69-4DFDD91D4A2A}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\AppUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\ParseCommandLine.h\" />\r\n    <ClInclude Include=\"..\\src\\SettingsStructs.h\" />\r\n    <ClInclude Include=\"..\\src\\mui\\SvgPath.h\">\r\n      <Filter>mui</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\BaseUtil.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\BitManip.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\ByteOrderDecoder.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\CmdLineParser.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\CryptoUtil.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\CssParser.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\DebugLog.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\Dict.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\FileUtil.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\GeomUtil.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\HtmlParserLookup.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\HtmlPrettyPrint.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\HtmlPullParser.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\JsonParser.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\Scoped.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\SettingsUtil.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\SimpleLog.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\SquareTreeParser.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\StrFormat.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\StrUtil.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\TrivialHtmlParser.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\UtAssert.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\VarintGob.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\Vec.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\WinDynCalls.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\WinUtil.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\AppUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\ParseCommandLine.cpp\" />\r\n    <ClCompile Include=\"..\\src\\SettingsStructs.cpp\" />\r\n    <ClCompile Include=\"..\\src\\UnitTests.cpp\" />\r\n    <ClCompile Include=\"..\\src\\mui\\SvgPath.cpp\">\r\n      <Filter>mui</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\mui\\SvgPath_ut.cpp\">\r\n      <Filter>mui</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\tools\\test_util.cpp\">\r\n      <Filter>tools</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\BaseUtil.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\ByteOrderDecoder.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\CmdLineParser.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\CryptoUtil.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\CssParser.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\DebugLog.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\Dict.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\FileUtil.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\HtmlParserLookup.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\HtmlPrettyPrint.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\HtmlPullParser.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\JsonParser.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\SettingsUtil.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\SquareTreeParser.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\StrFormat.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\StrUtil.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\TrivialHtmlParser.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\UtAssert.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\VarintGob.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\WinDynCalls.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\WinUtil.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\BaseUtil_ut.cpp\">\r\n      <Filter>utils\\tests</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\ByteOrderDecoder_ut.cpp\">\r\n      <Filter>utils\\tests</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\CmdLineParser_ut.cpp\">\r\n      <Filter>utils\\tests</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\CryptoUtil_ut.cpp\">\r\n      <Filter>utils\\tests</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\CssParser_ut.cpp\">\r\n      <Filter>utils\\tests</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\Dict_ut.cpp\">\r\n      <Filter>utils\\tests</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\FileUtil_ut.cpp\">\r\n      <Filter>utils\\tests</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\HtmlPrettyPrint_ut.cpp\">\r\n      <Filter>utils\\tests</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\HtmlPullParser_ut.cpp\">\r\n      <Filter>utils\\tests</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\JsonParser_ut.cpp\">\r\n      <Filter>utils\\tests</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\SettingsUtil_ut.cpp\">\r\n      <Filter>utils\\tests</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\SimpleLog_ut.cpp\">\r\n      <Filter>utils\\tests</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\SquareTreeParser_ut.cpp\">\r\n      <Filter>utils\\tests</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\StrFormat_ut.cpp\">\r\n      <Filter>utils\\tests</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\StrUtil_ut.cpp\">\r\n      <Filter>utils\\tests</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\TrivialHtmlParser_ut.cpp\">\r\n      <Filter>utils\\tests</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\VarintGob_ut.cpp\">\r\n      <Filter>utils\\tests</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\Vec_ut.cpp\">\r\n      <Filter>utils\\tests</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\tests\\WinUtil_ut.cpp\">\r\n      <Filter>utils\\tests</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/uia.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{84B2880B-F0BB-887C-7937-9F7CE53F947C}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>uia</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\uia\\</IntDir>\r\n    <TargetName>uia</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\uia\\</IntDir>\r\n    <TargetName>uia</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\uia\\</IntDir>\r\n    <TargetName>uia</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\uia\\</IntDir>\r\n    <TargetName>uia</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\uia\\</IntDir>\r\n    <TargetName>uia</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\uia\\</IntDir>\r\n    <TargetName>uia</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4302;4311;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4302;4311;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4302;4311;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4302;4311;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4302;4311;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4302;4311;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src;..\\src\\utils;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\uia\\DocumentProvider.h\" />\r\n    <ClInclude Include=\"..\\src\\uia\\PageProvider.h\" />\r\n    <ClInclude Include=\"..\\src\\uia\\Provider.h\" />\r\n    <ClInclude Include=\"..\\src\\uia\\StartPageProvider.h\" />\r\n    <ClInclude Include=\"..\\src\\uia\\TextRange.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\uia\\DocumentProvider.cpp\" />\r\n    <ClCompile Include=\"..\\src\\uia\\PageProvider.cpp\" />\r\n    <ClCompile Include=\"..\\src\\uia\\Provider.cpp\" />\r\n    <ClCompile Include=\"..\\src\\uia\\StartPageProvider.cpp\" />\r\n    <ClCompile Include=\"..\\src\\uia\\TextRange.cpp\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/unarr.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{8D308210-F944-AAC1-C2C6-4D212E9AA6F2}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>unarr</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>Application</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\unarr\\</IntDir>\r\n    <TargetName>unarr</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <LinkIncremental>true</LinkIncremental>\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\unarr\\</IntDir>\r\n    <TargetName>unarr</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\unarr\\</IntDir>\r\n    <TargetName>unarr</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\unarr\\</IntDir>\r\n    <TargetName>unarr</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\unarr\\</IntDir>\r\n    <TargetName>unarr</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <LinkIncremental>false</LinkIncremental>\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\unarr\\</IntDir>\r\n    <TargetName>unarr</TargetName>\r\n    <TargetExt>.exe</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n      <TreatLinkerWarningAsErrors>true</TreatLinkerWarningAsErrors>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Console</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n      <EntryPointSymbol>mainCRTStartup</EntryPointSymbol>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\ext\\unarr\\main.c\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ProjectReference Include=\"unarrlib.vcxproj\">\r\n      <Project>{C45AE373-B027-3E7F-D940-2C27C56C730D}</Project>\r\n    </ProjectReference>\r\n    <ProjectReference Include=\"zlib.vcxproj\">\r\n      <Project>{16CFA17C-0206-A30D-ABF2-881097081F0F}</Project>\r\n    </ProjectReference>\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/unarrlib.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{C45AE373-B027-3E7F-D940-2C27C56C730D}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>unarrlib</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\unarrlib\\</IntDir>\r\n    <TargetName>unarrlib</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\unarrlib\\</IntDir>\r\n    <TargetName>unarrlib</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\unarrlib\\</IntDir>\r\n    <TargetName>unarrlib</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\unarrlib\\</IntDir>\r\n    <TargetName>unarrlib</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\unarrlib\\</IntDir>\r\n    <TargetName>unarrlib</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\unarrlib\\</IntDir>\r\n    <TargetName>unarrlib</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4244;4267;4456;4457;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;BZ_NO_STDIO;_7ZIP_PPMD_SUPPPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\bzip2;..\\ext\\lzma\\C;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4244;4267;4456;4457;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;BZ_NO_STDIO;_7ZIP_PPMD_SUPPPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\bzip2;..\\ext\\lzma\\C;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4244;4267;4456;4457;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;BZ_NO_STDIO;_7ZIP_PPMD_SUPPPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\bzip2;..\\ext\\lzma\\C;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4100;4244;4267;4456;4457;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;BZ_NO_STDIO;_7ZIP_PPMD_SUPPPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\bzip2;..\\ext\\lzma\\C;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4100;4244;4267;4456;4457;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;BZ_NO_STDIO;_7ZIP_PPMD_SUPPPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\bzip2;..\\ext\\lzma\\C;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4100;4244;4267;4456;4457;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;HAVE_ZLIB;HAVE_BZIP2;HAVE_7Z;BZ_NO_STDIO;_7ZIP_PPMD_SUPPPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\ext\\zlib;..\\ext\\bzip2;..\\ext\\lzma\\C;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\ext\\bzip2\\bzip_all.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zBuf.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zDec.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zIn.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zStream.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Bcj2.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Bra.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Bra86.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzFind.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzFindMt.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Lzma2Dec.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzmaDec.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzmaEnc.c\" />\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Threads.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\_7z\\_7z.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\conv.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\crc32.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\stream.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\unarr.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\CpuArch.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd7.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd7Dec.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd8.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd8Dec.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\filter-rar.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\huffman-rar.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\parse-rar.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\rar.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\rarvm.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\uncompress-rar.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\tar\\parse-tar.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\tar\\tar.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\inflate.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\parse-zip.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\uncompress-zip.c\" />\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\zip.c\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/unarrlib.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"bzip2\">\r\n      <UniqueIdentifier>{0C15310F-7829-59C0-41AB-FC1FAD7E55F1}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"lzma\">\r\n      <UniqueIdentifier>{D95D9A7C-C594-9B0D-6E81-81105A97170F}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"lzma\\C\">\r\n      <UniqueIdentifier>{6B3EA90C-57E0-D3E2-409B-E7362CDC5A33}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"unarr\">\r\n      <UniqueIdentifier>{8D308210-F944-AAC1-C2C6-4D212E9AA6F2}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"unarr\\_7z\">\r\n      <UniqueIdentifier>{8C102DF0-F87A-E166-41B9-920CAD62BFBB}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"unarr\\common\">\r\n      <UniqueIdentifier>{459164B3-31F4-F357-DA79-2C0EC6BBBFDA}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"unarr\\lzmasdk\">\r\n      <UniqueIdentifier>{321765EE-9ED7-E024-6712-2AA2D3912501}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"unarr\\rar\">\r\n      <UniqueIdentifier>{C1662DF0-2DD1-E166-760F-930CE2B8BFBB}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"unarr\\tar\">\r\n      <UniqueIdentifier>{436F2DF0-AFD9-E166-F817-930C64C1BFBB}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"unarr\\zip\">\r\n      <UniqueIdentifier>{CF892DF0-3BF4-E166-8432-930CF0DBBFBB}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\ext\\bzip2\\bzip_all.c\">\r\n      <Filter>bzip2</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zBuf.c\">\r\n      <Filter>lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zDec.c\">\r\n      <Filter>lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zIn.c\">\r\n      <Filter>lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\7zStream.c\">\r\n      <Filter>lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Bcj2.c\">\r\n      <Filter>lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Bra.c\">\r\n      <Filter>lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Bra86.c\">\r\n      <Filter>lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzFind.c\">\r\n      <Filter>lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzFindMt.c\">\r\n      <Filter>lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Lzma2Dec.c\">\r\n      <Filter>lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzmaDec.c\">\r\n      <Filter>lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\LzmaEnc.c\">\r\n      <Filter>lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\lzma\\C\\Threads.c\">\r\n      <Filter>lzma\\C</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\_7z\\_7z.c\">\r\n      <Filter>unarr\\_7z</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\conv.c\">\r\n      <Filter>unarr\\common</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\crc32.c\">\r\n      <Filter>unarr\\common</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\stream.c\">\r\n      <Filter>unarr\\common</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\common\\unarr.c\">\r\n      <Filter>unarr\\common</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\CpuArch.c\">\r\n      <Filter>unarr\\lzmasdk</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd7.c\">\r\n      <Filter>unarr\\lzmasdk</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd7Dec.c\">\r\n      <Filter>unarr\\lzmasdk</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd8.c\">\r\n      <Filter>unarr\\lzmasdk</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\lzmasdk\\Ppmd8Dec.c\">\r\n      <Filter>unarr\\lzmasdk</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\filter-rar.c\">\r\n      <Filter>unarr\\rar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\huffman-rar.c\">\r\n      <Filter>unarr\\rar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\parse-rar.c\">\r\n      <Filter>unarr\\rar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\rar.c\">\r\n      <Filter>unarr\\rar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\rarvm.c\">\r\n      <Filter>unarr\\rar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\rar\\uncompress-rar.c\">\r\n      <Filter>unarr\\rar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\tar\\parse-tar.c\">\r\n      <Filter>unarr\\tar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\tar\\tar.c\">\r\n      <Filter>unarr\\tar</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\inflate.c\">\r\n      <Filter>unarr\\zip</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\parse-zip.c\">\r\n      <Filter>unarr\\zip</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\uncompress-zip.c\">\r\n      <Filter>unarr\\zip</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\ext\\unarr\\zip\\zip.c\">\r\n      <Filter>unarr\\zip</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/utils.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{169C8510-82B0-ADC1-4B32-5121B705AAF2}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>utils</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\utils\\</IntDir>\r\n    <TargetName>utils</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\utils\\</IntDir>\r\n    <TargetName>utils</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\utils\\</IntDir>\r\n    <TargetName>utils</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\utils\\</IntDir>\r\n    <TargetName>utils</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\utils\\</IntDir>\r\n    <TargetName>utils</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\utils\\</IntDir>\r\n    <TargetName>utils</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\libwebp;..\\ext\\unarr;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\libwebp;..\\ext\\unarr;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\libwebp;..\\ext\\unarr;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\libwebp;..\\ext\\unarr;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\libwebp;..\\ext\\unarr;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4838;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <AdditionalIncludeDirectories>..\\src\\utils;..\\src\\wingui;..\\src\\mui;..\\ext\\zlib;..\\ext\\lzma\\C;..\\ext\\libwebp;..\\ext\\unarr;..\\mupdf\\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\utils\\ArchUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\BaseUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\BitReader.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\BuildConfig.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\ByteOrderDecoder.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\CmdLineParser.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\CryptoUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\CssParser.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\DbgHelpDyn.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\DebugLog.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\Dict.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\DirIter.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\Dpi.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\FileTransactions.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\FileUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\FileWatcher.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\FzImgReader.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\GdiPlusUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\HtmlParserLookup.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\HtmlPrettyPrint.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\HtmlPullParser.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\HtmlWindow.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\HttpUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\JsonParser.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\LzmaSimpleArchive.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\SerializeTxt.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\SettingsUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\SquareTreeParser.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\StrFormat.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\StrSlice.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\StrUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\TgaReader.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\ThreadUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\TrivialHtmlParser.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\TxtParser.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\UITask.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\WebpReader.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\WinDynCalls.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\WinUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\utils\\ZipUtil.h\" />\r\n    <ClInclude Include=\"..\\src\\wingui\\DialogSizer.h\" />\r\n    <ClInclude Include=\"..\\src\\wingui\\EditCtrl.h\" />\r\n    <ClInclude Include=\"..\\src\\wingui\\FrameRateWnd.h\" />\r\n    <ClInclude Include=\"..\\src\\wingui\\LabelWithCloseWnd.h\" />\r\n    <ClInclude Include=\"..\\src\\wingui\\SplitterWnd.h\" />\r\n    <ClInclude Include=\"..\\src\\wingui\\TabsWnd.h\" />\r\n    <ClInclude Include=\"..\\src\\wingui\\Win32Window.h\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\utils\\ArchUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\BaseUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\BitReader.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\ByteOrderDecoder.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\CmdLineParser.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\CryptoUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\CssParser.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\DbgHelpDyn.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\DebugLog.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\Dict.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\DirIter.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\Dpi.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\FileTransactions.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\FileUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\FileWatcher.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\FzImgReader.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\GdiPlusUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\HtmlParserLookup.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\HtmlPrettyPrint.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\HtmlPullParser.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\HtmlWindow.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\HttpUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\JsonParser.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\LzmaSimpleArchive.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\SerializeTxt.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\SettingsUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\SquareTreeParser.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\StrFormat.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\StrSlice.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\StrUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\TgaReader.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\ThreadUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\TrivialHtmlParser.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\TxtParser.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\UITask.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\WebpReader.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\WinDynCalls.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\WinUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\utils\\ZipUtil.cpp\" />\r\n    <ClCompile Include=\"..\\src\\wingui\\DialogSizer.cpp\" />\r\n    <ClCompile Include=\"..\\src\\wingui\\EditCtrl.cpp\" />\r\n    <ClCompile Include=\"..\\src\\wingui\\FrameRateWnd.cpp\" />\r\n    <ClCompile Include=\"..\\src\\wingui\\LabelWithCloseWnd.cpp\" />\r\n    <ClCompile Include=\"..\\src\\wingui\\SplitterWnd.cpp\" />\r\n    <ClCompile Include=\"..\\src\\wingui\\TabsWnd.cpp\" />\r\n    <ClCompile Include=\"..\\src\\wingui\\Win32Window.cpp\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/utils.vcxproj.filters",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup>\r\n    <Filter Include=\"utils\">\r\n      <UniqueIdentifier>{169C8510-82B0-ADC1-4B32-5121B705AAF2}</UniqueIdentifier>\r\n    </Filter>\r\n    <Filter Include=\"wingui\">\r\n      <UniqueIdentifier>{D80B1F25-C4AD-49FB-AD68-5D4F99A9D04B}</UniqueIdentifier>\r\n    </Filter>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClInclude Include=\"..\\src\\utils\\ArchUtil.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\BaseUtil.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\BitReader.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\BuildConfig.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\ByteOrderDecoder.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\CmdLineParser.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\CryptoUtil.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\CssParser.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\DbgHelpDyn.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\DebugLog.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\Dict.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\DirIter.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\Dpi.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\FileTransactions.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\FileUtil.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\FileWatcher.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\FzImgReader.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\GdiPlusUtil.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\HtmlParserLookup.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\HtmlPrettyPrint.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\HtmlPullParser.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\HtmlWindow.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\HttpUtil.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\JsonParser.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\LzmaSimpleArchive.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\SerializeTxt.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\SettingsUtil.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\SquareTreeParser.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\StrFormat.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\StrSlice.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\StrUtil.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\TgaReader.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\ThreadUtil.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\TrivialHtmlParser.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\TxtParser.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\UITask.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\WebpReader.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\WinDynCalls.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\WinUtil.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\utils\\ZipUtil.h\">\r\n      <Filter>utils</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wingui\\DialogSizer.h\">\r\n      <Filter>wingui</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wingui\\EditCtrl.h\">\r\n      <Filter>wingui</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wingui\\FrameRateWnd.h\">\r\n      <Filter>wingui</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wingui\\LabelWithCloseWnd.h\">\r\n      <Filter>wingui</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wingui\\SplitterWnd.h\">\r\n      <Filter>wingui</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wingui\\TabsWnd.h\">\r\n      <Filter>wingui</Filter>\r\n    </ClInclude>\r\n    <ClInclude Include=\"..\\src\\wingui\\Win32Window.h\">\r\n      <Filter>wingui</Filter>\r\n    </ClInclude>\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\src\\utils\\ArchUtil.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\BaseUtil.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\BitReader.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\ByteOrderDecoder.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\CmdLineParser.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\CryptoUtil.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\CssParser.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\DbgHelpDyn.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\DebugLog.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\Dict.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\DirIter.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\Dpi.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\FileTransactions.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\FileUtil.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\FileWatcher.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\FzImgReader.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\GdiPlusUtil.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\HtmlParserLookup.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\HtmlPrettyPrint.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\HtmlPullParser.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\HtmlWindow.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\HttpUtil.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\JsonParser.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\LzmaSimpleArchive.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\SerializeTxt.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\SettingsUtil.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\SquareTreeParser.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\StrFormat.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\StrSlice.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\StrUtil.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\TgaReader.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\ThreadUtil.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\TrivialHtmlParser.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\TxtParser.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\UITask.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\WebpReader.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\WinDynCalls.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\WinUtil.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\utils\\ZipUtil.cpp\">\r\n      <Filter>utils</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wingui\\DialogSizer.cpp\">\r\n      <Filter>wingui</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wingui\\EditCtrl.cpp\">\r\n      <Filter>wingui</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wingui\\FrameRateWnd.cpp\">\r\n      <Filter>wingui</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wingui\\LabelWithCloseWnd.cpp\">\r\n      <Filter>wingui</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wingui\\SplitterWnd.cpp\">\r\n      <Filter>wingui</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wingui\\TabsWnd.cpp\">\r\n      <Filter>wingui</Filter>\r\n    </ClCompile>\r\n    <ClCompile Include=\"..\\src\\wingui\\Win32Window.cpp\">\r\n      <Filter>wingui</Filter>\r\n    </ClCompile>\r\n  </ItemGroup>\r\n</Project>"
  },
  {
    "path": "vs2015/zlib.vcxproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"14.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <ItemGroup Label=\"ProjectConfigurations\">\r\n    <ProjectConfiguration Include=\"Debug|Win32\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Debug|x64\">\r\n      <Configuration>Debug</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|Win32\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"Release|x64\">\r\n      <Configuration>Release</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|Win32\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>Win32</Platform>\r\n    </ProjectConfiguration>\r\n    <ProjectConfiguration Include=\"ReleasePrefast|x64\">\r\n      <Configuration>ReleasePrefast</Configuration>\r\n      <Platform>x64</Platform>\r\n    </ProjectConfiguration>\r\n  </ItemGroup>\r\n  <PropertyGroup Label=\"Globals\">\r\n    <ProjectGuid>{16CFA17C-0206-A30D-ABF2-881097081F0F}</ProjectGuid>\r\n    <IgnoreWarnCompileDuplicatedFilename>true</IgnoreWarnCompileDuplicatedFilename>\r\n    <Keyword>Win32Proj</Keyword>\r\n    <RootNamespace>zlib</RootNamespace>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>true</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140_xp</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\" Label=\"Configuration\">\r\n    <ConfigurationType>StaticLibrary</ConfigurationType>\r\n    <UseDebugLibraries>false</UseDebugLibraries>\r\n    <CharacterSet>Unicode</CharacterSet>\r\n    <PlatformToolset>v140</PlatformToolset>\r\n    <WholeProgramOptimization>true</WholeProgramOptimization>\r\n  </PropertyGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n  <ImportGroup Label=\"ExtensionSettings\">\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\r\n  </ImportGroup>\r\n  <PropertyGroup Label=\"UserMacros\" />\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <OutDir>..\\dbg\\</OutDir>\r\n    <IntDir>..\\dbg\\obj\\x32\\Debug\\zlib\\</IntDir>\r\n    <TargetName>zlib</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <OutDir>..\\dbg64\\</OutDir>\r\n    <IntDir>..\\dbg64\\obj\\x64\\Debug\\zlib\\</IntDir>\r\n    <TargetName>zlib</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <OutDir>..\\rel\\</OutDir>\r\n    <IntDir>..\\rel\\obj\\x32\\Release\\zlib\\</IntDir>\r\n    <TargetName>zlib</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <OutDir>..\\rel64\\</OutDir>\r\n    <IntDir>..\\rel64\\obj\\x64\\Release\\zlib\\</IntDir>\r\n    <TargetName>zlib</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <OutDir>..\\relPrefast\\</OutDir>\r\n    <IntDir>..\\relPrefast\\obj\\x32\\ReleasePrefast\\zlib\\</IntDir>\r\n    <TargetName>zlib</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <OutDir>..\\relPrefast64\\</OutDir>\r\n    <IntDir>..\\relPrefast64\\obj\\x64\\ReleasePrefast\\zlib\\</IntDir>\r\n    <TargetName>zlib</TargetName>\r\n    <TargetExt>.lib</TargetExt>\r\n  </PropertyGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4131;4244;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4131;4244;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Disabled</Optimization>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4131;4244;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <TreatWarningAsError>true</TreatWarningAsError>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;4131;4244;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n    <Lib>\r\n      <TreatLibWarningAsErrors>true</TreatLibWarningAsErrors>\r\n    </Lib>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|Win32'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4131;4244;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/arch:IA32 /analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='ReleasePrefast|x64'\">\r\n    <ClCompile>\r\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\r\n      <WarningLevel>Level4</WarningLevel>\r\n      <DisableSpecificWarnings>4127;4324;4458;4800;28125;28252;28253;4131;4244;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r\n      <PreprocessorDefinitions>WIN32;_WIN32;_CRT_SECURE_NO_WARNINGS;WINVER=0x0501;_WIN32_WINNT=0x0501;_HAS_EXCEPTIONS=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r\n      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r\n      <Optimization>Full</Optimization>\r\n      <FunctionLevelLinking>true</FunctionLevelLinking>\r\n      <IntrinsicFunctions>true</IntrinsicFunctions>\r\n      <MinimalRebuild>false</MinimalRebuild>\r\n      <StringPooling>true</StringPooling>\r\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r\n      <ExceptionHandling>false</ExceptionHandling>\r\n      <RuntimeTypeInfo>false</RuntimeTypeInfo>\r\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\r\n      <AdditionalOptions>/analyze %(AdditionalOptions)</AdditionalOptions>\r\n      <CompileAs>CompileAsC</CompileAs>\r\n    </ClCompile>\r\n    <Link>\r\n      <SubSystem>Windows</SubSystem>\r\n      <GenerateDebugInformation>true</GenerateDebugInformation>\r\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r\n      <OptimizeReferences>true</OptimizeReferences>\r\n    </Link>\r\n  </ItemDefinitionGroup>\r\n  <ItemGroup>\r\n    <ClCompile Include=\"..\\ext\\zlib\\adler32.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\compress.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\crc32.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\deflate.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\gzclose.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\gzlib.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\gzread.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\gzwrite.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\inffast.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\inflate.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\inftrees.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\trees.c\" />\r\n    <ClCompile Include=\"..\\ext\\zlib\\zutil.c\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n  <ImportGroup Label=\"ExtensionTargets\">\r\n  </ImportGroup>\r\n</Project>"
  }
]